From: Andrea Amorese Date: Fri, 10 Sep 2021 12:04:09 +0000 (+0200) Subject: Built motion from commit fb0188bc.|2.5.34 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=b476a5d2f436b2b8280ab793f64b79221280ef80;p=motion2.git Built motion from commit fb0188bc.|2.5.34 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 8542fcf..f012e98 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-10T08:59:14.535Z", + "time": "2021-09-10T11:50:18.270Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 20dd3fe..c42a2e9 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-10T08:59:14.535Z", + "time": "2021-09-10T11:50:18.270Z", "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 3164653..d2c464b 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 _0x7a54=['jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','STRING','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar'];(function(_0x3b6b06,_0x5db84b){var _0xdb9708=function(_0x28c3b7){while(--_0x28c3b7){_0x3b6b06['push'](_0x3b6b06['shift']());}};_0xdb9708(++_0x5db84b);}(_0x7a54,0x106));var _0x47a5=function(_0x2a7e69,_0x1361fe){_0x2a7e69=_0x2a7e69-0x0;var _0x44c9b8=_0x7a54[_0x2a7e69];return _0x44c9b8;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'name':{'type':Sequelize[_0x47a5('0x2')],'get':function(_0x58157c){return this[_0x47a5('0x3')](_0x47a5('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'browser',_0x47a5('0xa'),'script']],'msg':_0x47a5('0xb')}},'comment':_0x47a5('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x47a5('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x47a5('0xd')},'data4':{'type':Sequelize[_0x47a5('0xe')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x47a5('0xe')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize['STRING'],'comments':_0x47a5('0xf')},'data7':{'type':Sequelize[_0x47a5('0x10')],'comments':_0x47a5('0x11')}}; \ No newline at end of file +var _0x5334=['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)]','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)]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','integration','motionbar','bot'];(function(_0xd5c88,_0x508cda){var _0xa786d0=function(_0x4d1ffc){while(--_0x4d1ffc){_0xd5c88['push'](_0xd5c88['shift']());}};_0xa786d0(++_0x508cda);}(_0x5334,0x84));var _0x4533=function(_0x3ca4c1,_0x404c12){_0x3ca4c1=_0x3ca4c1-0x0;var _0x566ab5=_0x5334[_0x3ca4c1];return _0x566ab5;};'use strict';var Sequelize=require(_0x4533('0x0'));module[_0x4533('0x1')]={'name':{'type':Sequelize[_0x4533('0x2')],'get':function(_0x35fb80){return this[_0x4533('0x3')]('action');}},'action':{'type':Sequelize[_0x4533('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x4533('0x5'),_0x4533('0x6'),'jscripty','urlForward','browser',_0x4533('0x7'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x4533('0x4')](0x1000),'comment':_0x4533('0x8')},'data2':{'type':Sequelize[_0x4533('0x4')](0x1000),'comment':_0x4533('0x9')},'data3':{'type':Sequelize[_0x4533('0x4')](0x1000),'comment':_0x4533('0xa')},'data4':{'type':Sequelize[_0x4533('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x4533('0x4')](0x1000),'comments':_0x4533('0xb')},'data6':{'type':Sequelize[_0x4533('0x4')],'comments':_0x4533('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':_0x4533('0xd')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index ab31149..3cb79de 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 _0x1b78=['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','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','body','Action','find','catch','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x4f4c2a,_0x5f5a28){var _0xd15be6=function(_0x1bc725){while(--_0x1bc725){_0x4f4c2a['push'](_0x4f4c2a['shift']());}};_0xd15be6(++_0x5f5a28);}(_0x1b78,0x1bc));var _0x81b7=function(_0xb44fb1,_0x52d6be){_0xb44fb1=_0xb44fb1-0x0;var _0x242522=_0x1b78[_0xb44fb1];return _0x242522;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x81b7('0x0'));var zipdir=require(_0x81b7('0x1'));var jsonpatch=require(_0x81b7('0x2'));var rp=require(_0x81b7('0x3'));var moment=require(_0x81b7('0x4'));var BPromise=require(_0x81b7('0x5'));var Mustache=require(_0x81b7('0x6'));var util=require('util');var path=require(_0x81b7('0x7'));var sox=require(_0x81b7('0x8'));var csv=require('to-csv');var ejs=require(_0x81b7('0x9'));var fs=require('fs');var fs_extra=require(_0x81b7('0xa'));var _=require(_0x81b7('0xb'));var squel=require(_0x81b7('0xc'));var crypto=require(_0x81b7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x81b7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x81b7('0xf'));var Papa=require(_0x81b7('0x10'));var Redis=require(_0x81b7('0x11'));var authService=require(_0x81b7('0x12'));var qs=require(_0x81b7('0x13'));var as=require(_0x81b7('0x14'));var hardwareService=require(_0x81b7('0x15'));var logger=require(_0x81b7('0x16'))(_0x81b7('0x17'));var utils=require(_0x81b7('0x18'));var config=require(_0x81b7('0x19'));var licenseUtil=require(_0x81b7('0x1a'));var db=require(_0x81b7('0x1b'))['db'];function respondWithStatusCode(_0x56ac87,_0x4968b6){_0x4968b6=_0x4968b6||0xcc;return function(_0x14ec1e){if(_0x14ec1e){return _0x56ac87['sendStatus'](_0x4968b6);}return _0x56ac87[_0x81b7('0x1c')](_0x4968b6)[_0x81b7('0x1d')]();};}function respondWithResult(_0x39cd88,_0x35f72f){_0x35f72f=_0x35f72f||0xc8;return function(_0x5a5cc1){if(_0x5a5cc1){return _0x39cd88[_0x81b7('0x1c')](_0x35f72f)[_0x81b7('0x1e')](_0x5a5cc1);}};}function respondWithFilteredResult(_0x563619,_0x360947){return function(_0x7d9b0){if(_0x7d9b0){var _0x41a809=typeof _0x360947[_0x81b7('0x1f')]===_0x81b7('0x20')&&typeof _0x360947[_0x81b7('0x21')]===_0x81b7('0x20');var _0x52b927=_0x7d9b0[_0x81b7('0x22')];var _0x2b3305=_0x41a809?0x0:_0x360947[_0x81b7('0x1f')];var _0x5f5a32=_0x41a809?_0x7d9b0[_0x81b7('0x22')]:_0x360947[_0x81b7('0x1f')]+_0x360947[_0x81b7('0x21')];var _0x5a960a;if(_0x5f5a32>=_0x52b927){_0x5f5a32=_0x52b927;_0x5a960a=0xc8;}else{_0x5a960a=0xce;}_0x563619['status'](_0x5a960a);return _0x563619['set'](_0x81b7('0x23'),_0x2b3305+'-'+_0x5f5a32+'/'+_0x52b927)[_0x81b7('0x1e')](_0x7d9b0);}return null;};}function patchUpdates(_0x5c7e93){return function(_0x1a11a0){try{jsonpatch[_0x81b7('0x24')](_0x1a11a0,_0x5c7e93,!![]);}catch(_0x24e3fc){return BPromise[_0x81b7('0x25')](_0x24e3fc);}return _0x1a11a0[_0x81b7('0x26')]();};}function saveUpdates(_0x4dfe82,_0x5f3d11){return function(_0x305a8a){if(_0x305a8a){return _0x305a8a[_0x81b7('0x27')](_0x4dfe82)[_0x81b7('0x28')](function(_0x270891){return _0x270891;});}return null;};}function removeEntity(_0x432c38,_0x2114fe){return function(_0x37b086){if(_0x37b086){return _0x37b086['destroy']()[_0x81b7('0x28')](function(){_0x432c38[_0x81b7('0x1c')](0xcc)[_0x81b7('0x1d')]();});}};}function handleEntityNotFound(_0x1b20c1,_0x580ce8){return function(_0x3df7e7){if(!_0x3df7e7){_0x1b20c1[_0x81b7('0x29')](0x194);}return _0x3df7e7;};}function handleError(_0x2ebf33,_0x1edb0b){_0x1edb0b=_0x1edb0b||0x1f4;return function(_0x2b718e){logger['error'](_0x2b718e[_0x81b7('0x2a')]);if(_0x2b718e['name']){delete _0x2b718e[_0x81b7('0x2b')];}_0x2ebf33[_0x81b7('0x1c')](_0x1edb0b)[_0x81b7('0x2c')](_0x2b718e);};}exports[_0x81b7('0x27')]=function(_0xf7ae9c,_0x264f50){if(_0xf7ae9c[_0x81b7('0x2d')]['id']){delete _0xf7ae9c[_0x81b7('0x2d')]['id'];}return db[_0x81b7('0x2e')][_0x81b7('0x2f')]({'where':{'id':_0xf7ae9c['params']['id']}})[_0x81b7('0x28')](handleEntityNotFound(_0x264f50,null))[_0x81b7('0x28')](saveUpdates(_0xf7ae9c[_0x81b7('0x2d')],null))[_0x81b7('0x28')](respondWithResult(_0x264f50,null))[_0x81b7('0x30')](handleError(_0x264f50,null));};exports[_0x81b7('0x31')]=function(_0x5b55ea,_0x112733){return db[_0x81b7('0x2e')][_0x81b7('0x2f')]({'where':{'id':_0x5b55ea[_0x81b7('0x32')]['id']}})[_0x81b7('0x28')](handleEntityNotFound(_0x112733,null))['then'](removeEntity(_0x112733,null))['catch'](handleError(_0x112733,null));}; \ No newline at end of file +var _0x4cf2=['stack','name','send','Action','params','body','catch','find','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0x4cf2,0xcc));var _0x24cf=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x4cf2[_0x4314d7];return _0x5c599b;};'use strict';var emlformat=require(_0x24cf('0x0'));var rimraf=require(_0x24cf('0x1'));var zipdir=require(_0x24cf('0x2'));var jsonpatch=require(_0x24cf('0x3'));var rp=require(_0x24cf('0x4'));var moment=require('moment');var BPromise=require(_0x24cf('0x5'));var Mustache=require(_0x24cf('0x6'));var util=require(_0x24cf('0x7'));var path=require('path');var sox=require(_0x24cf('0x8'));var csv=require(_0x24cf('0x9'));var ejs=require(_0x24cf('0xa'));var fs=require('fs');var fs_extra=require(_0x24cf('0xb'));var _=require(_0x24cf('0xc'));var squel=require(_0x24cf('0xd'));var crypto=require(_0x24cf('0xe'));var jsforce=require(_0x24cf('0xf'));var deskjs=require(_0x24cf('0x10'));var toCsv=require(_0x24cf('0x9'));var querystring=require('querystring');var Papa=require(_0x24cf('0x11'));var Redis=require(_0x24cf('0x12'));var authService=require(_0x24cf('0x13'));var qs=require(_0x24cf('0x14'));var as=require(_0x24cf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24cf('0x16'))(_0x24cf('0x17'));var utils=require(_0x24cf('0x18'));var config=require(_0x24cf('0x19'));var licenseUtil=require(_0x24cf('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ab8bd,_0x4b3e04){_0x4b3e04=_0x4b3e04||0xcc;return function(_0x48df55){if(_0x48df55){return _0x1ab8bd[_0x24cf('0x1b')](_0x4b3e04);}return _0x1ab8bd[_0x24cf('0x1c')](_0x4b3e04)['end']();};}function respondWithResult(_0x4c7512,_0x47d175){_0x47d175=_0x47d175||0xc8;return function(_0x2203aa){if(_0x2203aa){return _0x4c7512[_0x24cf('0x1c')](_0x47d175)['json'](_0x2203aa);}};}function respondWithFilteredResult(_0x4c270a,_0x5daa9c){return function(_0x1ebe44){if(_0x1ebe44){var _0x38c198=typeof _0x5daa9c['offset']===_0x24cf('0x1d')&&typeof _0x5daa9c[_0x24cf('0x1e')]===_0x24cf('0x1d');var _0x3718e9=_0x1ebe44[_0x24cf('0x1f')];var _0x2f3335=_0x38c198?0x0:_0x5daa9c[_0x24cf('0x20')];var _0x32274e=_0x38c198?_0x1ebe44[_0x24cf('0x1f')]:_0x5daa9c[_0x24cf('0x20')]+_0x5daa9c[_0x24cf('0x1e')];var _0x3466ea;if(_0x32274e>=_0x3718e9){_0x32274e=_0x3718e9;_0x3466ea=0xc8;}else{_0x3466ea=0xce;}_0x4c270a[_0x24cf('0x1c')](_0x3466ea);return _0x4c270a[_0x24cf('0x21')](_0x24cf('0x22'),_0x2f3335+'-'+_0x32274e+'/'+_0x3718e9)['json'](_0x1ebe44);}return null;};}function patchUpdates(_0xf896fb){return function(_0x159255){try{jsonpatch[_0x24cf('0x23')](_0x159255,_0xf896fb,!![]);}catch(_0x37ebb1){return BPromise['reject'](_0x37ebb1);}return _0x159255['save']();};}function saveUpdates(_0x1579b6,_0x2e0927){return function(_0x5ee3e2){if(_0x5ee3e2){return _0x5ee3e2[_0x24cf('0x24')](_0x1579b6)[_0x24cf('0x25')](function(_0x194a3f){return _0x194a3f;});}return null;};}function removeEntity(_0x93c49b,_0x119f5e){return function(_0x2d81fa){if(_0x2d81fa){return _0x2d81fa[_0x24cf('0x26')]()['then'](function(){_0x93c49b[_0x24cf('0x1c')](0xcc)[_0x24cf('0x27')]();});}};}function handleEntityNotFound(_0x280d8d,_0xdfef90){return function(_0x5e3ddb){if(!_0x5e3ddb){_0x280d8d[_0x24cf('0x1b')](0x194);}return _0x5e3ddb;};}function handleError(_0x304241,_0x48450f){_0x48450f=_0x48450f||0x1f4;return function(_0x3ffbda){logger[_0x24cf('0x28')](_0x3ffbda[_0x24cf('0x29')]);if(_0x3ffbda[_0x24cf('0x2a')]){delete _0x3ffbda[_0x24cf('0x2a')];}_0x304241[_0x24cf('0x1c')](_0x48450f)[_0x24cf('0x2b')](_0x3ffbda);};}exports[_0x24cf('0x24')]=function(_0x4c3e78,_0x16a748){if(_0x4c3e78['body']['id']){delete _0x4c3e78['body']['id'];}return db[_0x24cf('0x2c')]['find']({'where':{'id':_0x4c3e78[_0x24cf('0x2d')]['id']}})['then'](handleEntityNotFound(_0x16a748,null))[_0x24cf('0x25')](saveUpdates(_0x4c3e78[_0x24cf('0x2e')],null))[_0x24cf('0x25')](respondWithResult(_0x16a748,null))[_0x24cf('0x2f')](handleError(_0x16a748,null));};exports[_0x24cf('0x26')]=function(_0x2210d0,_0x5d8f27){return db[_0x24cf('0x2c')][_0x24cf('0x30')]({'where':{'id':_0x2210d0['params']['id']}})[_0x24cf('0x25')](handleEntityNotFound(_0x5d8f27,null))[_0x24cf('0x25')](removeEntity(_0x5d8f27,null))[_0x24cf('0x2f')](handleError(_0x5d8f27,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 5aba98a..b091f6d 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 _0xc9ca=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc9ca,0x116));var _0xac9c=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0xc9ca[_0x57cb4f];return _0x29bb45;};'use strict';var _=require(_0xac9c('0x0'));var util=require(_0xac9c('0x1'));var logger=require(_0xac9c('0x2'))(_0xac9c('0x3'));var moment=require('moment');var BPromise=require(_0xac9c('0x4'));var rp=require(_0xac9c('0x5'));var fs=require('fs');var path=require(_0xac9c('0x6'));var rimraf=require(_0xac9c('0x7'));var config=require(_0xac9c('0x8'));var attributes=require(_0xac9c('0x9'));module[_0xac9c('0xa')]=function(_0x1fcf4e,_0x2255d7){return _0x1fcf4e[_0xac9c('0xb')](_0xac9c('0xc'),attributes,{'tableName':_0xac9c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbf3=['exports','tools_actions','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x379daf,_0x57135f){var _0x438198=function(_0x32a69e){while(--_0x32a69e){_0x379daf['push'](_0x379daf['shift']());}};_0x438198(++_0x57135f);}(_0xcbf3,0xf2));var _0x3cbf=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xcbf3[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x3cbf('0x0'));var util=require(_0x3cbf('0x1'));var logger=require(_0x3cbf('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3cbf('0x3'));var rp=require(_0x3cbf('0x4'));var fs=require('fs');var path=require(_0x3cbf('0x5'));var rimraf=require(_0x3cbf('0x6'));var config=require(_0x3cbf('0x7'));var attributes=require('./action.attributes');module[_0x3cbf('0x8')]=function(_0x12d916,_0x32505e){return _0x12d916['define']('Action',attributes,{'tableName':_0x3cbf('0x9'),'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 a34a5c5..f1d238f 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 _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(_0x59a7ed,_0x2cf6a2){var _0x53bd62=function(_0x52823b){while(--_0x52823b){_0x59a7ed['push'](_0x59a7ed['shift']());}};_0x53bd62(++_0x2cf6a2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'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 +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x42c916,_0x456eed){var _0x54f7e9=function(_0x23e4bf){while(--_0x23e4bf){_0x42c916['push'](_0x42c916['shift']());}};_0x54f7e9(++_0x456eed);}(_0xabce,0x103));var _0xeabc=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xabce[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 6516181..67e38bf 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 _0x8705=['multer','path','connect-timeout','express','fs-extra','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy'];(function(_0x425ecd,_0x1e1bed){var _0xddc406=function(_0x179638){while(--_0x179638){_0x425ecd['push'](_0x425ecd['shift']());}};_0xddc406(++_0x1e1bed);}(_0x8705,0x15c));var _0x5870=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8705[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x5870('0x0'));var util=require('util');var path=require(_0x5870('0x1'));var timeout=require(_0x5870('0x2'));var express=require(_0x5870('0x3'));var router=express['Router']();var fs_extra=require(_0x5870('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5870('0x5'));var controller=require(_0x5870('0x6'));router[_0x5870('0x7')](_0x5870('0x8'),auth[_0x5870('0x9')](),controller[_0x5870('0xa')]);router['delete'](_0x5870('0x8'),auth[_0x5870('0x9')](),controller[_0x5870('0xb')]);module['exports']=router; \ No newline at end of file +var _0xfa4c=['./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xfa4c,0x108));var _0xcfa4=function(_0x14dbf5,_0x2ec47f){_0x14dbf5=_0x14dbf5-0x0;var _0x161348=_0xfa4c[_0x14dbf5];return _0x161348;};'use strict';var multer=require(_0xcfa4('0x0'));var util=require(_0xcfa4('0x1'));var path=require(_0xcfa4('0x2'));var timeout=require(_0xcfa4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcfa4('0x4'));var auth=require(_0xcfa4('0x5'));var interaction=require(_0xcfa4('0x6'));var config=require(_0xcfa4('0x7'));var controller=require(_0xcfa4('0x8'));router[_0xcfa4('0x9')](_0xcfa4('0xa'),auth[_0xcfa4('0xb')](),controller[_0xcfa4('0xc')]);router[_0xcfa4('0xd')](_0xcfa4('0xa'),auth[_0xcfa4('0xb')](),controller[_0xcfa4('0xe')]);module[_0xcfa4('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 94e01c6..7d9c1b8 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x57b38f,_0xc26f33){var _0x6aa12c=function(_0x32850d){while(--_0x32850d){_0x57b38f['push'](_0x57b38f['shift']());}};_0x6aa12c(++_0xc26f33);}(_0x5fab,0x177));var _0xb5fa=function(_0x5224b9,_0x195fcb){_0x5224b9=_0x5224b9-0x0;var _0x363bcc=_0x5fab[_0x5224b9];return _0x363bcc;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file +var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x3330c,_0x3bd322){var _0x345555=function(_0x599928){while(--_0x599928){_0x3330c['push'](_0x3330c['shift']());}};_0x345555(++_0x3bd322);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x2a83b1,_0x12ba87){_0x2a83b1=_0x2a83b1-0x0;var _0x4d17b5=_0x3eea[_0x2a83b1];return _0x4d17b5;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index b875966..1a881b9 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 _0x1569=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','json','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','show','params','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','toString','sequelize','cross_join','GROUP_CONCAT(%s)','HOUR(%s)','keyBy','from','DESC','alias','clone','output','web','fullPath','%s-%s.%s','randomstring','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','countTable','SELECT','QueryTypes','run','runReport','COUNT(%s)','IS\x20NOT\x20EMPTY','findAll','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','desk.js','querystring','../../config/utils'];(function(_0x1726e1,_0x1cc1f4){var _0x44eccc=function(_0x29d671){while(--_0x29d671){_0x1726e1['push'](_0x1726e1['shift']());}};_0x44eccc(++_0x1cc1f4);}(_0x1569,0x1bf));var _0x9156=function(_0x4db198,_0x3ea6c2){_0x4db198=_0x4db198-0x0;var _0xedceb9=_0x1569[_0x4db198];return _0xedceb9;};'use strict';var emlformat=require(_0x9156('0x0'));var rimraf=require(_0x9156('0x1'));var zipdir=require(_0x9156('0x2'));var jsonpatch=require(_0x9156('0x3'));var rp=require('request-promise');var moment=require(_0x9156('0x4'));var BPromise=require(_0x9156('0x5'));var Mustache=require(_0x9156('0x6'));var util=require('util');var path=require(_0x9156('0x7'));var sox=require(_0x9156('0x8'));var csv=require(_0x9156('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9156('0xa'));var squel=require('squel');var crypto=require(_0x9156('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9156('0xc'));var toCsv=require(_0x9156('0x9'));var querystring=require(_0x9156('0xd'));var Papa=require('papaparse');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('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9156('0xe'));var config=require(_0x9156('0xf'));var licenseUtil=require(_0x9156('0x10'));var db=require(_0x9156('0x11'))['db'];var dbH=require(_0x9156('0x11'))['dbH'];function respondWithStatusCode(_0x2fb563,_0xc1ee7){_0xc1ee7=_0xc1ee7||0xcc;return function(_0x1f80f2){if(_0x1f80f2){return _0x2fb563[_0x9156('0x12')](_0xc1ee7);}return _0x2fb563['status'](_0xc1ee7)[_0x9156('0x13')]();};}function respondWithResult(_0x31478a,_0x4efbf3){_0x4efbf3=_0x4efbf3||0xc8;return function(_0x3285a1){if(_0x3285a1){return _0x31478a[_0x9156('0x14')](_0x4efbf3)['json'](_0x3285a1);}};}function respondWithFilteredResult(_0x35f293,_0x4d4490){return function(_0x3d1f41){if(_0x3d1f41){var _0x57b038=typeof _0x4d4490[_0x9156('0x15')]===_0x9156('0x16')&&typeof _0x4d4490[_0x9156('0x17')]===_0x9156('0x16');var _0x3c190b=_0x3d1f41[_0x9156('0x18')];var _0x5a80f6=_0x57b038?0x0:_0x4d4490[_0x9156('0x15')];var _0x358752=_0x57b038?_0x3d1f41[_0x9156('0x18')]:_0x4d4490[_0x9156('0x15')]+_0x4d4490[_0x9156('0x17')];var _0x334ec0;if(_0x358752>=_0x3c190b){_0x358752=_0x3c190b;_0x334ec0=0xc8;}else{_0x334ec0=0xce;}_0x35f293[_0x9156('0x14')](_0x334ec0);return _0x35f293['set']('Content-Range',_0x5a80f6+'-'+_0x358752+'/'+_0x3c190b)[_0x9156('0x19')](_0x3d1f41);}return null;};}function patchUpdates(_0x3d66e9){return function(_0x496c8c){try{jsonpatch['apply'](_0x496c8c,_0x3d66e9,!![]);}catch(_0x1cb50d){return BPromise[_0x9156('0x1a')](_0x1cb50d);}return _0x496c8c[_0x9156('0x1b')]();};}function saveUpdates(_0x2b8d20,_0x5cdf84){return function(_0x4f04e7){if(_0x4f04e7){return _0x4f04e7[_0x9156('0x1c')](_0x2b8d20)[_0x9156('0x1d')](function(_0x3ce9c3){return _0x3ce9c3;});}return null;};}function removeEntity(_0x33440a,_0x3b89f9){return function(_0x3c38f8){if(_0x3c38f8){return _0x3c38f8['destroy']()['then'](function(){var _0x53aa15=_0x3c38f8[_0x9156('0x1e')]({'plain':!![]});var _0x2faa60='CustomReports';return db[_0x9156('0x1f')][_0x9156('0x20')]({'where':{'type':_0x2faa60,'resourceId':_0x53aa15['id']}})[_0x9156('0x1d')](function(){return _0x3c38f8;});})[_0x9156('0x1d')](function(){_0x33440a['status'](0xcc)[_0x9156('0x13')]();});}};}function handleEntityNotFound(_0x3f183c,_0x3b38a2){return function(_0x1a0c07){if(!_0x1a0c07){_0x3f183c[_0x9156('0x12')](0x194);}return _0x1a0c07;};}function handleError(_0x34e02f,_0x3439a2){_0x3439a2=_0x3439a2||0x1f4;return function(_0x560006){logger[_0x9156('0x21')](_0x560006[_0x9156('0x22')]);if(_0x560006[_0x9156('0x23')]){delete _0x560006[_0x9156('0x23')];}_0x34e02f[_0x9156('0x14')](_0x3439a2)[_0x9156('0x24')](_0x560006);};}exports[_0x9156('0x25')]=function(_0x1b656e,_0x45d39c){var _0x5b2980={},_0x4a12af={},_0x1b5525={'count':0x0,'rows':[]};var _0x5850cd=_[_0x9156('0x26')](db[_0x9156('0x27')][_0x9156('0x28')],function(_0x2b2ee7){return{'name':_0x2b2ee7[_0x9156('0x29')],'type':_0x2b2ee7[_0x9156('0x2a')][_0x9156('0x2b')]};});_0x4a12af[_0x9156('0x2c')]=_['map'](_0x5850cd,_0x9156('0x23'));_0x4a12af['query']=_['keys'](_0x1b656e['query']);_0x4a12af[_0x9156('0x2d')]=_[_0x9156('0x2e')](_0x4a12af['model'],_0x4a12af[_0x9156('0x2f')]);_0x5b2980[_0x9156('0x30')]=_[_0x9156('0x2e')](_0x4a12af[_0x9156('0x2c')],qs[_0x9156('0x31')](_0x1b656e[_0x9156('0x2f')]['fields']));_0x5b2980[_0x9156('0x30')]=_0x5b2980[_0x9156('0x30')][_0x9156('0x32')]?_0x5b2980[_0x9156('0x30')]:_0x4a12af[_0x9156('0x2c')];if(!_0x1b656e[_0x9156('0x2f')][_0x9156('0x33')]('nolimit')){_0x5b2980[_0x9156('0x17')]=qs[_0x9156('0x17')](_0x1b656e[_0x9156('0x2f')][_0x9156('0x17')]);_0x5b2980['offset']=qs[_0x9156('0x15')](_0x1b656e[_0x9156('0x2f')][_0x9156('0x15')]);}_0x5b2980[_0x9156('0x34')]=qs['sort'](_0x1b656e[_0x9156('0x2f')]['sort']);_0x5b2980[_0x9156('0x35')]=qs[_0x9156('0x2d')](_[_0x9156('0x36')](_0x1b656e[_0x9156('0x2f')],_0x4a12af[_0x9156('0x2d')]),_0x5850cd);if(_0x1b656e[_0x9156('0x2f')][_0x9156('0x37')]){_0x5b2980[_0x9156('0x35')]=_['merge'](_0x5b2980[_0x9156('0x35')],{'$or':_[_0x9156('0x26')](_0x5850cd,function(_0x262eb2){if(_0x262eb2[_0x9156('0x2a')]!==_0x9156('0x38')){var _0x2140af={};_0x2140af[_0x262eb2[_0x9156('0x23')]]={'$like':'%'+_0x1b656e[_0x9156('0x2f')]['filter']+'%'};return _0x2140af;}})});}_0x5b2980=_[_0x9156('0x39')]({},_0x5b2980,_0x1b656e['options']);var _0x4cc9bf={'where':_0x5b2980[_0x9156('0x35')]};return db[_0x9156('0x27')][_0x9156('0x18')](_0x4cc9bf)[_0x9156('0x1d')](function(_0x5b30b5){_0x1b5525[_0x9156('0x18')]=_0x5b30b5;if(_0x1b656e[_0x9156('0x2f')][_0x9156('0x3a')]){_0x5b2980[_0x9156('0x3b')]=[{'all':!![]}];}return db[_0x9156('0x27')]['findAll'](_0x5b2980);})[_0x9156('0x1d')](function(_0x223b26){_0x1b5525[_0x9156('0x3c')]=_0x223b26;return _0x1b5525;})[_0x9156('0x1d')](respondWithFilteredResult(_0x45d39c,_0x5b2980))['catch'](handleError(_0x45d39c,null));};exports[_0x9156('0x3d')]=function(_0x1c5880,_0x308b3a){var _0x2c9639={'raw':![],'where':{'id':_0x1c5880[_0x9156('0x3e')]['id']}},_0x3d9997={};_0x3d9997[_0x9156('0x2c')]=_['keys'](db[_0x9156('0x27')][_0x9156('0x28')]);_0x3d9997[_0x9156('0x2f')]=_[_0x9156('0x3f')](_0x1c5880[_0x9156('0x2f')]);_0x3d9997[_0x9156('0x2d')]=_['intersection'](_0x3d9997[_0x9156('0x2c')],_0x3d9997[_0x9156('0x2f')]);_0x2c9639['attributes']=_[_0x9156('0x2e')](_0x3d9997[_0x9156('0x2c')],qs['fields'](_0x1c5880[_0x9156('0x2f')][_0x9156('0x31')]));_0x2c9639[_0x9156('0x30')]=_0x2c9639[_0x9156('0x30')][_0x9156('0x32')]?_0x2c9639[_0x9156('0x30')]:_0x3d9997[_0x9156('0x2c')];if(_0x1c5880['query'][_0x9156('0x3a')]){_0x2c9639[_0x9156('0x3b')]=[{'all':!![]}];}_0x2c9639=_[_0x9156('0x39')]({},_0x2c9639,_0x1c5880[_0x9156('0x40')]);return db[_0x9156('0x27')][_0x9156('0x41')](_0x2c9639)[_0x9156('0x1d')](handleEntityNotFound(_0x308b3a,null))['then'](respondWithResult(_0x308b3a,null))[_0x9156('0x42')](handleError(_0x308b3a,null));};exports['create']=function(_0x1a9661,_0x5c9ef5){return db[_0x9156('0x27')][_0x9156('0x43')](_0x1a9661[_0x9156('0x44')],{})[_0x9156('0x1d')](function(_0x48265d){var _0x2398e3=_0x1a9661[_0x9156('0x45')][_0x9156('0x1e')]({'plain':!![]});if(!_0x2398e3)throw new Error(_0x9156('0x46'));if(_0x2398e3[_0x9156('0x47')]===_0x9156('0x45')){var _0x214802=_0x48265d[_0x9156('0x1e')]({'plain':!![]});var _0x19498f=_0x9156('0x48');return db[_0x9156('0x49')][_0x9156('0x41')]({'where':{'name':_0x19498f,'userProfileId':_0x2398e3['userProfileId']},'raw':!![]})[_0x9156('0x1d')](function(_0x4fe765){if(_0x4fe765&&_0x4fe765[_0x9156('0x4a')]===0x0){return db['UserProfileResource'][_0x9156('0x43')]({'name':_0x214802[_0x9156('0x23')],'resourceId':_0x214802['id'],'type':'CustomReports','sectionId':_0x4fe765['id']},{})[_0x9156('0x1d')](function(){return _0x48265d;});}else{return _0x48265d;}})[_0x9156('0x42')](function(_0x928454){logger['error'](_0x9156('0x4b'),_0x928454);throw _0x928454;});}return _0x48265d;})[_0x9156('0x1d')](respondWithResult(_0x5c9ef5,0xc9))[_0x9156('0x42')](handleError(_0x5c9ef5,null));};exports[_0x9156('0x1c')]=function(_0x3a8881,_0x23f76d){if(_0x3a8881['body']['id']){delete _0x3a8881[_0x9156('0x44')]['id'];}return db[_0x9156('0x27')][_0x9156('0x41')]({'where':{'id':_0x3a8881[_0x9156('0x3e')]['id']}})[_0x9156('0x1d')](handleEntityNotFound(_0x23f76d,null))[_0x9156('0x1d')](saveUpdates(_0x3a8881[_0x9156('0x44')],null))[_0x9156('0x1d')](respondWithResult(_0x23f76d,null))['catch'](handleError(_0x23f76d,null));};exports[_0x9156('0x20')]=function(_0x533295,_0x2dfd80){return db['AnalyticCustomReport'][_0x9156('0x41')]({'where':{'id':_0x533295[_0x9156('0x3e')]['id']}})[_0x9156('0x1d')](handleEntityNotFound(_0x2dfd80,null))[_0x9156('0x1d')](removeEntity(_0x2dfd80,null))['catch'](handleError(_0x2dfd80,null));};exports[_0x9156('0x4c')]=function(_0x421417,_0x44d5f6){var _0x2382bf=0xa;var _0x3e0a26=[_0x9156('0x4d'),_0x9156('0x4e'),_0x9156('0x4f'),'cross_join'];var _0x2991a9={'SUM':_0x9156('0x50'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9156('0x51'),'MAX':_0x9156('0x52'),'MIN':_0x9156('0x53'),'AVG':_0x9156('0x54'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9156('0x55'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f8d50={'SEC_TO_TIME':_0x9156('0x56'),'DATE':_0x9156('0x57'),'HOUR':'HOUR(%s)','ROUND':_0x9156('0x58'),'UNIX_TIMESTAMP':_0x9156('0x59')};var _0x3ffee1=function(_0x57b3c7){return!_[_0x9156('0x5a')]([_0x9156('0x5b'),_0x9156('0x5c'),_0x9156('0x5d'),'IS\x20NOT\x20EMPTY'],_0x57b3c7);};var _0x583224=function(_0x271e97){if(!_0x271e97||!_0x271e97[_0x9156('0x5e')][_0x9156('0x32')]){return'';}for(var _0x2f7cf3='(',_0x1da26f=0x0;_0x1da26f<_0x271e97[_0x9156('0x5e')][_0x9156('0x32')];_0x1da26f+=0x1){_0x1da26f>0x0&&(_0x2f7cf3+='\x20'+_0x271e97[_0x9156('0x5f')]+'\x20');_0x2f7cf3+=_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x60')]?_0x583224(_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x60')]):_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x61')]+'\x20'+_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x62')]+(_0x3ffee1(_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x62')])?'\x20'+_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x63')]:'');}return _0x2f7cf3+')';};var _0x433de5={'where':{'id':_0x421417['params']['id']}},_0x5108cc,_0x34c58a,_0xf9fa17,_0x2b7001,_0x2f6a3c;_0x433de5=_['merge']({},_0x433de5,_0x421417[_0x9156('0x40')]);return db[_0x9156('0x27')]['find'](_0x433de5)[_0x9156('0x1d')](function(_0xedb3f3){if(_0xedb3f3){_0x5108cc=_0xedb3f3;return _0xedb3f3[_0x9156('0x64')]();}return null;})[_0x9156('0x1d')](function(_0x5a01e8){if(_0x5a01e8){if(!_0x5a01e8['length']){throw new db['Sequelize'][(_0x9156('0x65'))](_0x9156('0x66'),0x193);}_0x34c58a=_0x5a01e8;return db[_0x9156('0x67')]['findAll']({'raw':!![]});}return null;})[_0x9156('0x1d')](function(_0x5c7619){if(_0x5c7619){_0xf9fa17=_['keyBy'](_0x5c7619,'id');var _0x3d3ad7;var _0x35c221=squel[_0x9156('0x68')]();_0x35c221['from'](_0x5108cc[_0x9156('0x69')]);for(var _0x58275a=0x0;_0x58275a<_0x34c58a[_0x9156('0x32')];_0x58275a+=0x1){_0x3d3ad7=_0x34c58a[_0x58275a][_0x9156('0x6a')]?_0xf9fa17[_0x34c58a[_0x58275a][_0x9156('0x6a')]][_0x9156('0x6b')]:_0x34c58a[_0x58275a]['field'];_0x3d3ad7=_0x34c58a[_0x58275a][_0x9156('0x6c')]?_['replace'](_0x2991a9[_0x34c58a[_0x58275a][_0x9156('0x6c')]],'%s',_0x3d3ad7):_0x3d3ad7;_0x3d3ad7=_0x34c58a[_0x58275a][_0x9156('0x6d')]?_[_0x9156('0x6e')](_0x1f8d50[_0x34c58a[_0x58275a][_0x9156('0x6d')]],'%s',_0x3d3ad7):_0x3d3ad7;if(_0x34c58a[_0x58275a][_0x9156('0x6f')]){_0x35c221[_0x9156('0x60')](_0x3d3ad7);}_0x34c58a[_0x58275a][_0x9156('0x70')]&&_0x35c221[_0x9156('0x34')](_0x3d3ad7,_0x34c58a[_0x58275a][_0x9156('0x70')]==='DESC'?![]:!![]);_0x35c221['field'](_0x3d3ad7,_0x34c58a[_0x58275a]['alias']||_0x3d3ad7);}if(_0x5108cc[_0x9156('0x71')]){_0x5108cc[_0x9156('0x71')]=JSON[_0x9156('0x72')](_0x5108cc[_0x9156('0x71')]);for(var _0x5aa831=0x0;_0x5aa831<_0x5108cc[_0x9156('0x71')][_0x9156('0x32')];_0x5aa831+=0x1){if(_0x5108cc[_0x9156('0x71')][_0x5aa831]['type']&&_[_0x9156('0x5a')](_0x3e0a26,_0x5108cc['joins'][_0x5aa831][_0x9156('0x2a')])&&_0x5108cc['joins'][_0x5aa831][_0x9156('0x73')]&&_0x5108cc[_0x9156('0x71')][_0x5aa831][_0x9156('0x74')]&&_0x5108cc[_0x9156('0x71')][_0x5aa831][_0x9156('0x75')]){_0x35c221[_0x5108cc[_0x9156('0x71')][_0x5aa831]['type']](_0x5108cc[_0x9156('0x71')][_0x5aa831][_0x9156('0x74')],null,util['format'](_0x9156('0x76'),_0x5108cc['table'],_0x5108cc[_0x9156('0x71')][_0x5aa831]['parentKey'],_0x5108cc[_0x9156('0x71')][_0x5aa831][_0x9156('0x74')],_0x5108cc[_0x9156('0x71')][_0x5aa831][_0x9156('0x75')]));}}}if(_0x5108cc['conditions']){_0x5108cc[_0x9156('0x77')]=JSON[_0x9156('0x72')](_0x5108cc[_0x9156('0x77')]);_0x35c221[_0x9156('0x35')](_0x583224(_0x5108cc[_0x9156('0x77')][_0x9156('0x60')]));}_0x2f6a3c=_0x35c221['clone']();_0x35c221['limit'](_0x2382bf);_0x35c221[_0x9156('0x15')](0x0);logger[_0x9156('0x78')]('Limited\x20Query:',_0x35c221[_0x9156('0x79')]());return dbH[_0x9156('0x7a')]['query'](_0x35c221['toString'](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x9156('0x1d')](respondWithResult(_0x44d5f6,null))[_0x9156('0x42')](handleError(_0x44d5f6,null));};function runReport(_0x208b7c,_0x364fc1,_0x493a15){var _0x1c1f97=_0x364fc1[_0x9156('0x23')];var _0x5822a0=0xa;var _0x11892e=[_0x9156('0x4d'),_0x9156('0x4e'),_0x9156('0x4f'),_0x9156('0x7b')];var _0x55b09e={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9156('0x52'),'MIN':_0x9156('0x53'),'AVG':_0x9156('0x54'),'GROUP_CONCAT':_0x9156('0x7c'),'GROUP_CONCAT ASC':_0x9156('0x55'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5a6a14={'SEC_TO_TIME':_0x9156('0x56'),'DATE':_0x9156('0x57'),'HOUR':_0x9156('0x7d'),'ROUND':_0x9156('0x58'),'UNIX_TIMESTAMP':_0x9156('0x59')};var _0x5b50ef=function(_0x8ee25e){return!_[_0x9156('0x5a')]([_0x9156('0x5b'),'IS\x20NOT\x20NULL',_0x9156('0x5d'),'IS\x20NOT\x20EMPTY'],_0x8ee25e);};var _0x4169fb=function(_0x550f0d){if(!_0x550f0d||!_0x550f0d['rules'][_0x9156('0x32')]){return'';}for(var _0x4d54bc='(',_0x2644d2=0x0;_0x2644d2<_0x550f0d[_0x9156('0x5e')]['length'];_0x2644d2+=0x1){_0x2644d2>0x0&&(_0x4d54bc+='\x20'+_0x550f0d[_0x9156('0x5f')]+'\x20');_0x4d54bc+=_0x550f0d[_0x9156('0x5e')][_0x2644d2][_0x9156('0x60')]?_0x4169fb(_0x550f0d[_0x9156('0x5e')][_0x2644d2][_0x9156('0x60')]):_0x550f0d[_0x9156('0x5e')][_0x2644d2][_0x9156('0x61')]+'\x20'+_0x550f0d[_0x9156('0x5e')][_0x2644d2]['condition']+(_0x5b50ef(_0x550f0d[_0x9156('0x5e')][_0x2644d2][_0x9156('0x62')])?'\x20'+_0x550f0d[_0x9156('0x5e')][_0x2644d2][_0x9156('0x63')]:'');}return _0x4d54bc+')';};var _0x565bb1={'where':{'id':_0x208b7c['id']}},_0x3463c1,_0x2783ee,_0xad4f31,_0x3c9f06,_0x121da0;_0x565bb1=_[_0x9156('0x39')]({},_0x565bb1,_0x493a15);return db[_0x9156('0x27')]['find'](_0x565bb1)[_0x9156('0x1d')](function(_0xbbbe04){if(_0xbbbe04){_0x3463c1=_0xbbbe04;return _0xbbbe04[_0x9156('0x64')]();}return null;})['then'](function(_0x216dd9){if(_0x216dd9){if(!_0x216dd9['length']){throw new db['Sequelize'][(_0x9156('0x65'))](_0x9156('0x66'),0x193);}_0x2783ee=_0x216dd9;return db[_0x9156('0x67')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x12ba78){if(_0x12ba78){_0xad4f31=_[_0x9156('0x7e')](_0x12ba78,'id');var _0x17c92d;var _0x381cde=squel[_0x9156('0x68')]();_0x381cde[_0x9156('0x7f')](_0x3463c1[_0x9156('0x69')]);for(var _0x3fada2=0x0;_0x3fada2<_0x2783ee[_0x9156('0x32')];_0x3fada2+=0x1){_0x17c92d=_0x2783ee[_0x3fada2][_0x9156('0x6a')]?_0xad4f31[_0x2783ee[_0x3fada2]['MetricId']][_0x9156('0x6b')]:_0x2783ee[_0x3fada2][_0x9156('0x61')];_0x17c92d=_0x2783ee[_0x3fada2][_0x9156('0x6c')]?_[_0x9156('0x6e')](_0x55b09e[_0x2783ee[_0x3fada2][_0x9156('0x6c')]],'%s',_0x17c92d):_0x17c92d;_0x17c92d=_0x2783ee[_0x3fada2]['format']?_[_0x9156('0x6e')](_0x5a6a14[_0x2783ee[_0x3fada2][_0x9156('0x6d')]],'%s',_0x17c92d):_0x17c92d;if(_0x2783ee[_0x3fada2]['groupBy']){_0x381cde['group'](_0x17c92d);}_0x2783ee[_0x3fada2]['orderBy']&&_0x381cde[_0x9156('0x34')](_0x17c92d,_0x2783ee[_0x3fada2][_0x9156('0x70')]===_0x9156('0x80')?![]:!![]);_0x381cde[_0x9156('0x61')](_0x17c92d,_0x2783ee[_0x3fada2][_0x9156('0x81')]||_0x17c92d);}if(_0x3463c1['joins']){_0x3463c1[_0x9156('0x71')]=JSON[_0x9156('0x72')](_0x3463c1[_0x9156('0x71')]);for(var _0x16bdc1=0x0;_0x16bdc1<_0x3463c1[_0x9156('0x71')][_0x9156('0x32')];_0x16bdc1+=0x1){if(_0x3463c1[_0x9156('0x71')][_0x16bdc1][_0x9156('0x2a')]&&_[_0x9156('0x5a')](_0x11892e,_0x3463c1[_0x9156('0x71')][_0x16bdc1][_0x9156('0x2a')])&&_0x3463c1['joins'][_0x16bdc1][_0x9156('0x73')]&&_0x3463c1[_0x9156('0x71')][_0x16bdc1][_0x9156('0x74')]&&_0x3463c1[_0x9156('0x71')][_0x16bdc1]['foreignKey']){_0x381cde[_0x3463c1['joins'][_0x16bdc1][_0x9156('0x2a')]](_0x3463c1[_0x9156('0x71')][_0x16bdc1][_0x9156('0x74')],null,util[_0x9156('0x6d')](_0x9156('0x76'),_0x3463c1[_0x9156('0x69')],_0x3463c1[_0x9156('0x71')][_0x16bdc1]['parentKey'],_0x3463c1['joins'][_0x16bdc1][_0x9156('0x74')],_0x3463c1[_0x9156('0x71')][_0x16bdc1][_0x9156('0x75')]));}}}if(_0x3463c1[_0x9156('0x77')]){_0x3463c1[_0x9156('0x77')]=JSON['parse'](_0x3463c1[_0x9156('0x77')]);_0x381cde[_0x9156('0x35')](_0x4169fb(_0x3463c1[_0x9156('0x77')][_0x9156('0x60')]));}_0x121da0=_0x381cde[_0x9156('0x82')]();_0x381cde[_0x9156('0x17')](_0x5822a0);_0x381cde[_0x9156('0x15')](0x0);return;}})[_0x9156('0x1d')](function(){if(_0x364fc1[_0x9156('0x83')]===_0x9156('0x84')){return null;}var _0x49eccc=_[_0x9156('0x39')](_0x364fc1,{'name':_0x364fc1[_0x9156('0x85')]||_0x364fc1['name']||_0x3463c1[_0x9156('0x23')],'basename':_0x1c1f97,'savename':util[_0x9156('0x6d')](_0x9156('0x86'),_0x364fc1[_0x9156('0x23')]||_0x3463c1[_0x9156('0x23')],require(_0x9156('0x87'))['generate'](0x4),_0x364fc1['output']||'csv'),'reportId':_0x3463c1['id'],'reportType':_0x9156('0x88')});return db['AnalyticExtractedReport']['create'](_0x49eccc,{'raw':!![]});})[_0x9156('0x1d')](function(_0x4e6d10){if(_0x3463c1[_0x9156('0x69')]==='cdr'){_0x121da0[_0x9156('0x35')](_0x3463c1[_0x9156('0x69')]+_0x9156('0x89'),_0x364fc1[_0x9156('0x8a')],_0x364fc1[_0x9156('0x8b')]);}else{_0x121da0[_0x9156('0x35')](_0x3463c1[_0x9156('0x69')]+_0x9156('0x8c'),_0x364fc1[_0x9156('0x8a')],_0x364fc1['endDate']);}if(_0x4e6d10){logger[_0x9156('0x8d')]('Run\x20Query:',_0x121da0[_0x9156('0x79')]());require(_0x9156('0x8e'))[_0x9156('0x8f')](path['join'](__dirname,'../../components/export/',_0x4e6d10[_0x9156('0x83')]),[_0x4e6d10['id'],_0x121da0[_0x9156('0x79')](),path[_0x9156('0x4d')](__dirname,_0x9156('0x90'),_0x4e6d10['savename']),_0x1c1f97]);return _0x4e6d10;}else{var _0x555337=squel[_0x9156('0x68')]();_0x555337[_0x9156('0x7f')]('('+_0x121da0['toString']()+')',_0x9156('0x91'));_0x555337['field']('COUNT(*)',_0x9156('0x18'));_0x121da0['limit'](_0x364fc1['limit']||_0x5822a0);_0x121da0['offset'](_0x364fc1[_0x9156('0x15')]||0x0);return dbH[_0x9156('0x7a')][_0x9156('0x2f')](_0x555337['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x9156('0x92')]})[_0x9156('0x1d')](function(_0xdd0410){if(!_0xdd0410[_0x9156('0x32')]){_0x3c9f06=0x0;}else{_0x3c9f06=_0xdd0410[0x0][_0x9156('0x18')]||0x0;}return dbH['sequelize'][_0x9156('0x2f')](_0x121da0[_0x9156('0x79')](),{'type':dbH[_0x9156('0x7a')][_0x9156('0x93')][_0x9156('0x92')]});})[_0x9156('0x1d')](function(_0x341cf1){return{'rows':_0x341cf1||[],'count':_0x3c9f06};});}});}exports[_0x9156('0x94')]=function(_0x16604f,_0x2a5e75){return runReport(_0x16604f[_0x9156('0x3e')],_0x16604f['query'],_0x16604f[_0x9156('0x40')])['then'](respondWithResult(_0x2a5e75,null))[_0x9156('0x42')](handleError(_0x2a5e75,null));};exports[_0x9156('0x95')]=runReport;exports['query']=function(_0x56b776,_0x38ce1e){var _0x8027c7=0xa;var _0x591a33=[_0x9156('0x4d'),'left_join',_0x9156('0x4f'),_0x9156('0x7b')];var _0x56eda8={'SUM':_0x9156('0x50'),'COUNT':_0x9156('0x96'),'COUNT DISTINCT':_0x9156('0x51'),'MAX':_0x9156('0x52'),'MIN':_0x9156('0x53'),'AVG':_0x9156('0x54'),'GROUP_CONCAT':_0x9156('0x7c'),'GROUP_CONCAT ASC':_0x9156('0x55'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25a59a={'SEC_TO_TIME':_0x9156('0x56'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9156('0x59')};var _0x5bba0f=function(_0x524311){return!_[_0x9156('0x5a')]([_0x9156('0x5b'),_0x9156('0x5c'),'IS\x20EMPTY',_0x9156('0x97')],_0x524311);};var _0xe92626=function(_0x63bec7){if(!_0x63bec7||!_0x63bec7[_0x9156('0x5e')][_0x9156('0x32')]){return'';}for(var _0x290085='(',_0x56f80f=0x0;_0x56f80f<_0x63bec7[_0x9156('0x5e')][_0x9156('0x32')];_0x56f80f+=0x1){_0x56f80f>0x0&&(_0x290085+='\x20'+_0x63bec7[_0x9156('0x5f')]+'\x20');_0x290085+=_0x63bec7[_0x9156('0x5e')][_0x56f80f][_0x9156('0x60')]?_0xe92626(_0x63bec7[_0x9156('0x5e')][_0x56f80f][_0x9156('0x60')]):_0x63bec7['rules'][_0x56f80f][_0x9156('0x61')]+'\x20'+_0x63bec7[_0x9156('0x5e')][_0x56f80f][_0x9156('0x62')]+(_0x5bba0f(_0x63bec7['rules'][_0x56f80f][_0x9156('0x62')])?'\x20'+_0x63bec7[_0x9156('0x5e')][_0x56f80f][_0x9156('0x63')]:'');}return _0x290085+')';};var _0x2f3b03={'where':{'id':_0x56b776['params']['id']}},_0x1a2b7f,_0x9933c9,_0x3a7d45,_0x524ba6,_0x4f5bcf;_0x2f3b03=_[_0x9156('0x39')]({},_0x2f3b03,_0x56b776[_0x9156('0x40')]);return db[_0x9156('0x27')][_0x9156('0x41')](_0x2f3b03)['then'](function(_0x48289e){if(_0x48289e){_0x1a2b7f=_0x48289e;return _0x48289e['getFields']();}return null;})[_0x9156('0x1d')](function(_0x527011){if(_0x527011){if(!_0x527011[_0x9156('0x32')]){throw new db['Sequelize']['ValidationErrorItem'](_0x9156('0x66'),0x193);}_0x9933c9=_0x527011;return db[_0x9156('0x67')][_0x9156('0x98')]({'raw':!![]});}return null;})[_0x9156('0x1d')](function(_0xa55a65){if(_0xa55a65){_0x3a7d45=_['keyBy'](_0xa55a65,'id');var _0x22cbb4;var _0x31578b=squel[_0x9156('0x68')]();_0x31578b[_0x9156('0x7f')](_0x1a2b7f['table']);for(var _0x557979=0x0;_0x557979<_0x9933c9[_0x9156('0x32')];_0x557979+=0x1){_0x22cbb4=_0x9933c9[_0x557979][_0x9156('0x6a')]?_0x3a7d45[_0x9933c9[_0x557979][_0x9156('0x6a')]]['metric']:_0x9933c9[_0x557979]['field'];_0x22cbb4=_0x9933c9[_0x557979]['function']?_[_0x9156('0x6e')](_0x56eda8[_0x9933c9[_0x557979]['function']],'%s',_0x22cbb4):_0x22cbb4;_0x22cbb4=_0x9933c9[_0x557979][_0x9156('0x6d')]?_[_0x9156('0x6e')](_0x25a59a[_0x9933c9[_0x557979][_0x9156('0x6d')]],'%s',_0x22cbb4):_0x22cbb4;if(_0x9933c9[_0x557979][_0x9156('0x6f')]){_0x31578b[_0x9156('0x60')](_0x22cbb4);}_0x9933c9[_0x557979][_0x9156('0x70')]&&_0x31578b[_0x9156('0x34')](_0x22cbb4,_0x9933c9[_0x557979]['orderBy']===_0x9156('0x80')?![]:!![]);_0x31578b[_0x9156('0x61')](_0x22cbb4,_0x9933c9[_0x557979][_0x9156('0x81')]||_0x22cbb4);}if(_0x1a2b7f[_0x9156('0x71')]){_0x1a2b7f['joins']=JSON[_0x9156('0x72')](_0x1a2b7f[_0x9156('0x71')]);for(var _0x398687=0x0;_0x398687<_0x1a2b7f[_0x9156('0x71')][_0x9156('0x32')];_0x398687+=0x1){if(_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x2a')]&&_[_0x9156('0x5a')](_0x591a33,_0x1a2b7f['joins'][_0x398687]['type'])&&_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x73')]&&_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x74')]&&_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x75')]){_0x31578b[_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x2a')]](_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x74')],null,util[_0x9156('0x6d')](_0x9156('0x76'),_0x1a2b7f[_0x9156('0x69')],_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x73')],_0x1a2b7f[_0x9156('0x71')][_0x398687]['foreignTable'],_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x75')]));}}}if(_0x1a2b7f[_0x9156('0x77')]){_0x1a2b7f[_0x9156('0x77')]=JSON[_0x9156('0x72')](_0x1a2b7f['conditions']);_0x31578b[_0x9156('0x35')](_0xe92626(_0x1a2b7f['conditions'][_0x9156('0x60')]));}_0x4f5bcf=_0x31578b[_0x9156('0x82')]();_0x31578b['limit'](_0x8027c7);_0x31578b['offset'](0x0);logger['debug'](_0x9156('0x99'),_0x31578b[_0x9156('0x79')]());return dbH[_0x9156('0x7a')]['query'](_0x31578b[_0x9156('0x79')](),{'type':dbH[_0x9156('0x7a')]['QueryTypes'][_0x9156('0x92')]});}})[_0x9156('0x1d')](function(){return{'sql':_0x4f5bcf[_0x9156('0x79')]()};})[_0x9156('0x1d')](respondWithResult(_0x38ce1e,null))['catch'](handleError(_0x38ce1e,null));}; \ No newline at end of file +var _0x4dee=['groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','HOUR(%s)','ROUND(%s)','operator','getFields','keyBy','foreignKey','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','runReport','IS\x20EMPTY','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','AnalyticCustomReport','findAll','rows','catch','show','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format'];(function(_0x6f6f18,_0x406aee){var _0x57c18c=function(_0x289369){while(--_0x289369){_0x6f6f18['push'](_0x6f6f18['shift']());}};_0x57c18c(++_0x406aee);}(_0x4dee,0x172));var _0xe4de=function(_0x4aa667,_0x179830){_0x4aa667=_0x4aa667-0x0;var _0x3ca1b2=_0x4dee[_0x4aa667];return _0x3ca1b2;};'use strict';var emlformat=require(_0xe4de('0x0'));var rimraf=require(_0xe4de('0x1'));var zipdir=require(_0xe4de('0x2'));var jsonpatch=require(_0xe4de('0x3'));var rp=require(_0xe4de('0x4'));var moment=require(_0xe4de('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe4de('0x6'));var util=require(_0xe4de('0x7'));var path=require(_0xe4de('0x8'));var sox=require(_0xe4de('0x9'));var csv=require('to-csv');var ejs=require(_0xe4de('0xa'));var fs=require('fs');var fs_extra=require(_0xe4de('0xb'));var _=require(_0xe4de('0xc'));var squel=require(_0xe4de('0xd'));var crypto=require('crypto');var jsforce=require(_0xe4de('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4de('0xf'));var authService=require(_0xe4de('0x10'));var qs=require(_0xe4de('0x11'));var as=require(_0xe4de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe4de('0x13'));var utils=require(_0xe4de('0x14'));var config=require(_0xe4de('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4de('0x16'))['db'];var dbH=require('../../mysqldb')[_0xe4de('0x17')];function respondWithStatusCode(_0x258b4e,_0xbe0d50){_0xbe0d50=_0xbe0d50||0xcc;return function(_0x26f1eb){if(_0x26f1eb){return _0x258b4e[_0xe4de('0x18')](_0xbe0d50);}return _0x258b4e[_0xe4de('0x19')](_0xbe0d50)[_0xe4de('0x1a')]();};}function respondWithResult(_0x51eeed,_0x36f3f0){_0x36f3f0=_0x36f3f0||0xc8;return function(_0x279104){if(_0x279104){return _0x51eeed[_0xe4de('0x19')](_0x36f3f0)['json'](_0x279104);}};}function respondWithFilteredResult(_0x4f892c,_0x53e52b){return function(_0x141ad5){if(_0x141ad5){var _0x1fa341=typeof _0x53e52b[_0xe4de('0x1b')]===_0xe4de('0x1c')&&typeof _0x53e52b[_0xe4de('0x1d')]===_0xe4de('0x1c');var _0x43b47d=_0x141ad5[_0xe4de('0x1e')];var _0x1c6c1a=_0x1fa341?0x0:_0x53e52b[_0xe4de('0x1b')];var _0x4f1e9a=_0x1fa341?_0x141ad5[_0xe4de('0x1e')]:_0x53e52b[_0xe4de('0x1b')]+_0x53e52b['limit'];var _0x28712d;if(_0x4f1e9a>=_0x43b47d){_0x4f1e9a=_0x43b47d;_0x28712d=0xc8;}else{_0x28712d=0xce;}_0x4f892c[_0xe4de('0x19')](_0x28712d);return _0x4f892c[_0xe4de('0x1f')](_0xe4de('0x20'),_0x1c6c1a+'-'+_0x4f1e9a+'/'+_0x43b47d)[_0xe4de('0x21')](_0x141ad5);}return null;};}function patchUpdates(_0x1a8784){return function(_0x2a8bd8){try{jsonpatch['apply'](_0x2a8bd8,_0x1a8784,!![]);}catch(_0x218a73){return BPromise['reject'](_0x218a73);}return _0x2a8bd8[_0xe4de('0x22')]();};}function saveUpdates(_0x3e571d,_0x3349c2){return function(_0x5a2c18){if(_0x5a2c18){return _0x5a2c18[_0xe4de('0x23')](_0x3e571d)['then'](function(_0xe35f0d){return _0xe35f0d;});}return null;};}function removeEntity(_0xb75ef,_0x145f00){return function(_0x5d26da){if(_0x5d26da){return _0x5d26da[_0xe4de('0x24')]()[_0xe4de('0x25')](function(){var _0x59d5ac=_0x5d26da[_0xe4de('0x26')]({'plain':!![]});var _0x4c8530=_0xe4de('0x27');return db[_0xe4de('0x28')]['destroy']({'where':{'type':_0x4c8530,'resourceId':_0x59d5ac['id']}})[_0xe4de('0x25')](function(){return _0x5d26da;});})['then'](function(){_0xb75ef[_0xe4de('0x19')](0xcc)[_0xe4de('0x1a')]();});}};}function handleEntityNotFound(_0x29f20b,_0x68ed21){return function(_0x46ed77){if(!_0x46ed77){_0x29f20b[_0xe4de('0x18')](0x194);}return _0x46ed77;};}function handleError(_0xae7e08,_0x26657b){_0x26657b=_0x26657b||0x1f4;return function(_0x1a2ca5){logger[_0xe4de('0x29')](_0x1a2ca5[_0xe4de('0x2a')]);if(_0x1a2ca5[_0xe4de('0x2b')]){delete _0x1a2ca5[_0xe4de('0x2b')];}_0xae7e08[_0xe4de('0x19')](_0x26657b)[_0xe4de('0x2c')](_0x1a2ca5);};}exports[_0xe4de('0x2d')]=function(_0x135a66,_0x3fc25a){var _0x286dd6={},_0x5b56e3={},_0x6fdc4={'count':0x0,'rows':[]};var _0x56980d=_[_0xe4de('0x2e')](db['AnalyticCustomReport'][_0xe4de('0x2f')],function(_0x4ff82a){return{'name':_0x4ff82a['fieldName'],'type':_0x4ff82a[_0xe4de('0x30')][_0xe4de('0x31')]};});_0x5b56e3['model']=_[_0xe4de('0x2e')](_0x56980d,_0xe4de('0x2b'));_0x5b56e3[_0xe4de('0x32')]=_['keys'](_0x135a66[_0xe4de('0x32')]);_0x5b56e3[_0xe4de('0x33')]=_[_0xe4de('0x34')](_0x5b56e3[_0xe4de('0x35')],_0x5b56e3[_0xe4de('0x32')]);_0x286dd6[_0xe4de('0x36')]=_[_0xe4de('0x34')](_0x5b56e3[_0xe4de('0x35')],qs[_0xe4de('0x37')](_0x135a66[_0xe4de('0x32')][_0xe4de('0x37')]));_0x286dd6['attributes']=_0x286dd6[_0xe4de('0x36')][_0xe4de('0x38')]?_0x286dd6[_0xe4de('0x36')]:_0x5b56e3[_0xe4de('0x35')];if(!_0x135a66[_0xe4de('0x32')]['hasOwnProperty'](_0xe4de('0x39'))){_0x286dd6[_0xe4de('0x1d')]=qs[_0xe4de('0x1d')](_0x135a66[_0xe4de('0x32')][_0xe4de('0x1d')]);_0x286dd6[_0xe4de('0x1b')]=qs[_0xe4de('0x1b')](_0x135a66[_0xe4de('0x32')][_0xe4de('0x1b')]);}_0x286dd6[_0xe4de('0x3a')]=qs[_0xe4de('0x3b')](_0x135a66[_0xe4de('0x32')]['sort']);_0x286dd6[_0xe4de('0x3c')]=qs[_0xe4de('0x33')](_[_0xe4de('0x3d')](_0x135a66[_0xe4de('0x32')],_0x5b56e3[_0xe4de('0x33')]),_0x56980d);if(_0x135a66['query'][_0xe4de('0x3e')]){_0x286dd6[_0xe4de('0x3c')]=_['merge'](_0x286dd6[_0xe4de('0x3c')],{'$or':_[_0xe4de('0x2e')](_0x56980d,function(_0x55e5a7){if(_0x55e5a7[_0xe4de('0x30')]!==_0xe4de('0x3f')){var _0x4d7e6b={};_0x4d7e6b[_0x55e5a7[_0xe4de('0x2b')]]={'$like':'%'+_0x135a66[_0xe4de('0x32')]['filter']+'%'};return _0x4d7e6b;}})});}_0x286dd6=_[_0xe4de('0x40')]({},_0x286dd6,_0x135a66[_0xe4de('0x41')]);var _0x497878={'where':_0x286dd6[_0xe4de('0x3c')]};return db['AnalyticCustomReport'][_0xe4de('0x1e')](_0x497878)[_0xe4de('0x25')](function(_0x4308eb){_0x6fdc4['count']=_0x4308eb;if(_0x135a66[_0xe4de('0x32')]['includeAll']){_0x286dd6[_0xe4de('0x42')]=[{'all':!![]}];}return db[_0xe4de('0x43')][_0xe4de('0x44')](_0x286dd6);})[_0xe4de('0x25')](function(_0x578356){_0x6fdc4[_0xe4de('0x45')]=_0x578356;return _0x6fdc4;})[_0xe4de('0x25')](respondWithFilteredResult(_0x3fc25a,_0x286dd6))[_0xe4de('0x46')](handleError(_0x3fc25a,null));};exports[_0xe4de('0x47')]=function(_0x1d571c,_0x5354e6){var _0x3c11ae={'raw':![],'where':{'id':_0x1d571c['params']['id']}},_0x49149e={};_0x49149e[_0xe4de('0x35')]=_[_0xe4de('0x48')](db[_0xe4de('0x43')][_0xe4de('0x2f')]);_0x49149e[_0xe4de('0x32')]=_[_0xe4de('0x48')](_0x1d571c[_0xe4de('0x32')]);_0x49149e[_0xe4de('0x33')]=_['intersection'](_0x49149e[_0xe4de('0x35')],_0x49149e[_0xe4de('0x32')]);_0x3c11ae['attributes']=_['intersection'](_0x49149e[_0xe4de('0x35')],qs[_0xe4de('0x37')](_0x1d571c['query'][_0xe4de('0x37')]));_0x3c11ae[_0xe4de('0x36')]=_0x3c11ae[_0xe4de('0x36')][_0xe4de('0x38')]?_0x3c11ae[_0xe4de('0x36')]:_0x49149e['model'];if(_0x1d571c[_0xe4de('0x32')][_0xe4de('0x49')]){_0x3c11ae[_0xe4de('0x42')]=[{'all':!![]}];}_0x3c11ae=_[_0xe4de('0x40')]({},_0x3c11ae,_0x1d571c[_0xe4de('0x41')]);return db['AnalyticCustomReport']['find'](_0x3c11ae)['then'](handleEntityNotFound(_0x5354e6,null))[_0xe4de('0x25')](respondWithResult(_0x5354e6,null))[_0xe4de('0x46')](handleError(_0x5354e6,null));};exports[_0xe4de('0x4a')]=function(_0x518946,_0x42bbf2){return db[_0xe4de('0x43')][_0xe4de('0x4a')](_0x518946[_0xe4de('0x4b')],{})['then'](function(_0x52d305){var _0x2f5f4d=_0x518946[_0xe4de('0x4c')][_0xe4de('0x26')]({'plain':!![]});if(!_0x2f5f4d)throw new Error(_0xe4de('0x4d'));if(_0x2f5f4d['role']===_0xe4de('0x4c')){var _0x4ab531=_0x52d305[_0xe4de('0x26')]({'plain':!![]});var _0x439823=_0xe4de('0x4e');return db[_0xe4de('0x4f')][_0xe4de('0x50')]({'where':{'name':_0x439823,'userProfileId':_0x2f5f4d[_0xe4de('0x51')]},'raw':!![]})[_0xe4de('0x25')](function(_0x13f883){if(_0x13f883&&_0x13f883[_0xe4de('0x52')]===0x0){return db[_0xe4de('0x28')][_0xe4de('0x4a')]({'name':_0x4ab531['name'],'resourceId':_0x4ab531['id'],'type':_0xe4de('0x27'),'sectionId':_0x13f883['id']},{})[_0xe4de('0x25')](function(){return _0x52d305;});}else{return _0x52d305;}})['catch'](function(_0x11a50f){logger[_0xe4de('0x29')](_0xe4de('0x53'),_0x11a50f);throw _0x11a50f;});}return _0x52d305;})[_0xe4de('0x25')](respondWithResult(_0x42bbf2,0xc9))[_0xe4de('0x46')](handleError(_0x42bbf2,null));};exports[_0xe4de('0x23')]=function(_0x443506,_0x39a901){if(_0x443506[_0xe4de('0x4b')]['id']){delete _0x443506[_0xe4de('0x4b')]['id'];}return db[_0xe4de('0x43')][_0xe4de('0x50')]({'where':{'id':_0x443506[_0xe4de('0x54')]['id']}})[_0xe4de('0x25')](handleEntityNotFound(_0x39a901,null))['then'](saveUpdates(_0x443506[_0xe4de('0x4b')],null))[_0xe4de('0x25')](respondWithResult(_0x39a901,null))['catch'](handleError(_0x39a901,null));};exports[_0xe4de('0x24')]=function(_0x5d241f,_0x2fc3fe){return db[_0xe4de('0x43')]['find']({'where':{'id':_0x5d241f[_0xe4de('0x54')]['id']}})[_0xe4de('0x25')](handleEntityNotFound(_0x2fc3fe,null))[_0xe4de('0x25')](removeEntity(_0x2fc3fe,null))[_0xe4de('0x46')](handleError(_0x2fc3fe,null));};exports[_0xe4de('0x55')]=function(_0x2e0aab,_0xac7c5){var _0x7e84f7=0xa;var _0x19514a=[_0xe4de('0x56'),_0xe4de('0x57'),_0xe4de('0x58'),_0xe4de('0x59')];var _0xdb8337={'SUM':_0xe4de('0x5a'),'COUNT':_0xe4de('0x5b'),'COUNT DISTINCT':_0xe4de('0x5c'),'MAX':_0xe4de('0x5d'),'MIN':_0xe4de('0x5e'),'AVG':_0xe4de('0x5f'),'GROUP_CONCAT':_0xe4de('0x60'),'GROUP_CONCAT ASC':_0xe4de('0x61'),'GROUP_CONCAT DESC':_0xe4de('0x62')};var _0x37ee3d={'SEC_TO_TIME':_0xe4de('0x63'),'DATE':_0xe4de('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe4de('0x65')};var _0x28b299=function(_0x2da856){return!_[_0xe4de('0x66')]([_0xe4de('0x67'),_0xe4de('0x68'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x2da856);};var _0x4ee4d4=function(_0x2682e6){if(!_0x2682e6||!_0x2682e6[_0xe4de('0x69')][_0xe4de('0x38')]){return'';}for(var _0x37b52c='(',_0x5a07c7=0x0;_0x5a07c7<_0x2682e6[_0xe4de('0x69')][_0xe4de('0x38')];_0x5a07c7+=0x1){_0x5a07c7>0x0&&(_0x37b52c+='\x20'+_0x2682e6['operator']+'\x20');_0x37b52c+=_0x2682e6[_0xe4de('0x69')][_0x5a07c7][_0xe4de('0x6a')]?_0x4ee4d4(_0x2682e6['rules'][_0x5a07c7][_0xe4de('0x6a')]):_0x2682e6[_0xe4de('0x69')][_0x5a07c7][_0xe4de('0x6b')]+'\x20'+_0x2682e6[_0xe4de('0x69')][_0x5a07c7][_0xe4de('0x6c')]+(_0x28b299(_0x2682e6[_0xe4de('0x69')][_0x5a07c7][_0xe4de('0x6c')])?'\x20'+_0x2682e6[_0xe4de('0x69')][_0x5a07c7][_0xe4de('0x6d')]:'');}return _0x37b52c+')';};var _0xe26c45={'where':{'id':_0x2e0aab[_0xe4de('0x54')]['id']}},_0x4c9eea,_0x434c0f,_0x4a94f3,_0x258ac4,_0xde93c2;_0xe26c45=_[_0xe4de('0x40')]({},_0xe26c45,_0x2e0aab[_0xe4de('0x41')]);return db[_0xe4de('0x43')][_0xe4de('0x50')](_0xe26c45)[_0xe4de('0x25')](function(_0x231f5b){if(_0x231f5b){_0x4c9eea=_0x231f5b;return _0x231f5b['getFields']();}return null;})[_0xe4de('0x25')](function(_0x476990){if(_0x476990){if(!_0x476990['length']){throw new db[(_0xe4de('0x6e'))][(_0xe4de('0x6f'))](_0xe4de('0x70'),0x193);}_0x434c0f=_0x476990;return db[_0xe4de('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe4de('0x25')](function(_0x50adb3){if(_0x50adb3){_0x4a94f3=_['keyBy'](_0x50adb3,'id');var _0x431172;var _0x3008a2=squel[_0xe4de('0x72')]();_0x3008a2[_0xe4de('0x73')](_0x4c9eea[_0xe4de('0x74')]);for(var _0x489a72=0x0;_0x489a72<_0x434c0f[_0xe4de('0x38')];_0x489a72+=0x1){_0x431172=_0x434c0f[_0x489a72]['MetricId']?_0x4a94f3[_0x434c0f[_0x489a72][_0xe4de('0x75')]][_0xe4de('0x76')]:_0x434c0f[_0x489a72]['field'];_0x431172=_0x434c0f[_0x489a72][_0xe4de('0x77')]?_[_0xe4de('0x78')](_0xdb8337[_0x434c0f[_0x489a72]['function']],'%s',_0x431172):_0x431172;_0x431172=_0x434c0f[_0x489a72]['format']?_[_0xe4de('0x78')](_0x37ee3d[_0x434c0f[_0x489a72][_0xe4de('0x79')]],'%s',_0x431172):_0x431172;if(_0x434c0f[_0x489a72][_0xe4de('0x7a')]){_0x3008a2[_0xe4de('0x6a')](_0x431172);}_0x434c0f[_0x489a72][_0xe4de('0x7b')]&&_0x3008a2[_0xe4de('0x3a')](_0x431172,_0x434c0f[_0x489a72][_0xe4de('0x7b')]===_0xe4de('0x7c')?![]:!![]);_0x3008a2[_0xe4de('0x6b')](_0x431172,_0x434c0f[_0x489a72][_0xe4de('0x7d')]||_0x431172);}if(_0x4c9eea[_0xe4de('0x7e')]){_0x4c9eea[_0xe4de('0x7e')]=JSON[_0xe4de('0x7f')](_0x4c9eea['joins']);for(var _0x3e0e29=0x0;_0x3e0e29<_0x4c9eea[_0xe4de('0x7e')][_0xe4de('0x38')];_0x3e0e29+=0x1){if(_0x4c9eea['joins'][_0x3e0e29][_0xe4de('0x30')]&&_['includes'](_0x19514a,_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29][_0xe4de('0x30')])&&_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29][_0xe4de('0x80')]&&_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29][_0xe4de('0x81')]&&_0x4c9eea['joins'][_0x3e0e29]['foreignKey']){_0x3008a2[_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29][_0xe4de('0x30')]](_0x4c9eea['joins'][_0x3e0e29][_0xe4de('0x81')],null,util[_0xe4de('0x79')](_0xe4de('0x82'),_0x4c9eea[_0xe4de('0x74')],_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29][_0xe4de('0x80')],_0x4c9eea['joins'][_0x3e0e29][_0xe4de('0x81')],_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29]['foreignKey']));}}}if(_0x4c9eea[_0xe4de('0x83')]){_0x4c9eea[_0xe4de('0x83')]=JSON[_0xe4de('0x7f')](_0x4c9eea[_0xe4de('0x83')]);_0x3008a2[_0xe4de('0x3c')](_0x4ee4d4(_0x4c9eea['conditions'][_0xe4de('0x6a')]));}_0xde93c2=_0x3008a2[_0xe4de('0x84')]();_0x3008a2[_0xe4de('0x1d')](_0x7e84f7);_0x3008a2[_0xe4de('0x1b')](0x0);logger[_0xe4de('0x85')](_0xe4de('0x86'),_0x3008a2[_0xe4de('0x87')]());return dbH['sequelize'][_0xe4de('0x32')](_0x3008a2['toString'](),{'type':dbH[_0xe4de('0x88')][_0xe4de('0x89')][_0xe4de('0x8a')]});}})[_0xe4de('0x25')](respondWithResult(_0xac7c5,null))[_0xe4de('0x46')](handleError(_0xac7c5,null));};function runReport(_0x37ac82,_0x598b24,_0x58f787){var _0x41a2af=_0x598b24['name'];var _0x2f00e2=0xa;var _0x40f535=[_0xe4de('0x56'),'left_join',_0xe4de('0x58'),_0xe4de('0x59')];var _0x559d91={'SUM':'SUM(%s)','COUNT':_0xe4de('0x5b'),'COUNT DISTINCT':_0xe4de('0x5c'),'MAX':_0xe4de('0x5d'),'MIN':_0xe4de('0x5e'),'AVG':_0xe4de('0x5f'),'GROUP_CONCAT':_0xe4de('0x60'),'GROUP_CONCAT ASC':_0xe4de('0x61'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5098fd={'SEC_TO_TIME':_0xe4de('0x63'),'DATE':'DATE(%s)','HOUR':_0xe4de('0x8b'),'ROUND':_0xe4de('0x8c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x13aa2b=function(_0x20ce59){return!_[_0xe4de('0x66')]([_0xe4de('0x67'),_0xe4de('0x68'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x20ce59);};var _0x169817=function(_0x4649bd){if(!_0x4649bd||!_0x4649bd[_0xe4de('0x69')][_0xe4de('0x38')]){return'';}for(var _0x33040a='(',_0x28ea9f=0x0;_0x28ea9f<_0x4649bd[_0xe4de('0x69')][_0xe4de('0x38')];_0x28ea9f+=0x1){_0x28ea9f>0x0&&(_0x33040a+='\x20'+_0x4649bd[_0xe4de('0x8d')]+'\x20');_0x33040a+=_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6a')]?_0x169817(_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6a')]):_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6b')]+'\x20'+_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6c')]+(_0x13aa2b(_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6c')])?'\x20'+_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6d')]:'');}return _0x33040a+')';};var _0x42e858={'where':{'id':_0x37ac82['id']}},_0x43993b,_0x539173,_0x5cdf7d,_0x2af21a,_0x91f81b;_0x42e858=_[_0xe4de('0x40')]({},_0x42e858,_0x58f787);return db[_0xe4de('0x43')][_0xe4de('0x50')](_0x42e858)[_0xe4de('0x25')](function(_0x350611){if(_0x350611){_0x43993b=_0x350611;return _0x350611[_0xe4de('0x8e')]();}return null;})[_0xe4de('0x25')](function(_0x32a796){if(_0x32a796){if(!_0x32a796[_0xe4de('0x38')]){throw new db[(_0xe4de('0x6e'))][(_0xe4de('0x6f'))](_0xe4de('0x70'),0x193);}_0x539173=_0x32a796;return db['AnalyticMetric'][_0xe4de('0x44')]({'raw':!![]});}return null;})[_0xe4de('0x25')](function(_0x1a7417){if(_0x1a7417){_0x5cdf7d=_[_0xe4de('0x8f')](_0x1a7417,'id');var _0x37e3cd;var _0x18ca02=squel['select']();_0x18ca02['from'](_0x43993b[_0xe4de('0x74')]);for(var _0x4f6925=0x0;_0x4f6925<_0x539173[_0xe4de('0x38')];_0x4f6925+=0x1){_0x37e3cd=_0x539173[_0x4f6925]['MetricId']?_0x5cdf7d[_0x539173[_0x4f6925][_0xe4de('0x75')]]['metric']:_0x539173[_0x4f6925][_0xe4de('0x6b')];_0x37e3cd=_0x539173[_0x4f6925][_0xe4de('0x77')]?_[_0xe4de('0x78')](_0x559d91[_0x539173[_0x4f6925][_0xe4de('0x77')]],'%s',_0x37e3cd):_0x37e3cd;_0x37e3cd=_0x539173[_0x4f6925][_0xe4de('0x79')]?_[_0xe4de('0x78')](_0x5098fd[_0x539173[_0x4f6925][_0xe4de('0x79')]],'%s',_0x37e3cd):_0x37e3cd;if(_0x539173[_0x4f6925]['groupBy']){_0x18ca02[_0xe4de('0x6a')](_0x37e3cd);}_0x539173[_0x4f6925]['orderBy']&&_0x18ca02[_0xe4de('0x3a')](_0x37e3cd,_0x539173[_0x4f6925][_0xe4de('0x7b')]==='DESC'?![]:!![]);_0x18ca02[_0xe4de('0x6b')](_0x37e3cd,_0x539173[_0x4f6925][_0xe4de('0x7d')]||_0x37e3cd);}if(_0x43993b[_0xe4de('0x7e')]){_0x43993b['joins']=JSON['parse'](_0x43993b['joins']);for(var _0x4bce62=0x0;_0x4bce62<_0x43993b[_0xe4de('0x7e')][_0xe4de('0x38')];_0x4bce62+=0x1){if(_0x43993b['joins'][_0x4bce62][_0xe4de('0x30')]&&_['includes'](_0x40f535,_0x43993b[_0xe4de('0x7e')][_0x4bce62]['type'])&&_0x43993b['joins'][_0x4bce62]['parentKey']&&_0x43993b[_0xe4de('0x7e')][_0x4bce62][_0xe4de('0x81')]&&_0x43993b[_0xe4de('0x7e')][_0x4bce62][_0xe4de('0x90')]){_0x18ca02[_0x43993b['joins'][_0x4bce62][_0xe4de('0x30')]](_0x43993b[_0xe4de('0x7e')][_0x4bce62][_0xe4de('0x81')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x43993b[_0xe4de('0x74')],_0x43993b[_0xe4de('0x7e')][_0x4bce62]['parentKey'],_0x43993b[_0xe4de('0x7e')][_0x4bce62][_0xe4de('0x81')],_0x43993b[_0xe4de('0x7e')][_0x4bce62][_0xe4de('0x90')]));}}}if(_0x43993b[_0xe4de('0x83')]){_0x43993b[_0xe4de('0x83')]=JSON[_0xe4de('0x7f')](_0x43993b[_0xe4de('0x83')]);_0x18ca02[_0xe4de('0x3c')](_0x169817(_0x43993b[_0xe4de('0x83')][_0xe4de('0x6a')]));}_0x91f81b=_0x18ca02[_0xe4de('0x84')]();_0x18ca02[_0xe4de('0x1d')](_0x2f00e2);_0x18ca02[_0xe4de('0x1b')](0x0);return;}})[_0xe4de('0x25')](function(){if(_0x598b24['output']===_0xe4de('0x91')){return null;}var _0x27eca1=_[_0xe4de('0x40')](_0x598b24,{'name':_0x598b24[_0xe4de('0x92')]||_0x598b24['name']||_0x43993b[_0xe4de('0x2b')],'basename':_0x41a2af,'savename':util[_0xe4de('0x79')]('%s-%s.%s',_0x598b24['name']||_0x43993b[_0xe4de('0x2b')],require(_0xe4de('0x93'))[_0xe4de('0x94')](0x4),_0x598b24['output']||_0xe4de('0x95')),'reportId':_0x43993b['id'],'reportType':_0xe4de('0x96')});return db[_0xe4de('0x97')][_0xe4de('0x4a')](_0x27eca1,{'raw':!![]});})[_0xe4de('0x25')](function(_0x4ac93){if(_0x43993b[_0xe4de('0x74')]==='cdr'){_0x91f81b[_0xe4de('0x3c')](_0x43993b[_0xe4de('0x74')]+_0xe4de('0x98'),_0x598b24[_0xe4de('0x99')],_0x598b24[_0xe4de('0x9a')]);}else{_0x91f81b['where'](_0x43993b[_0xe4de('0x74')]+_0xe4de('0x9b'),_0x598b24[_0xe4de('0x99')],_0x598b24[_0xe4de('0x9a')]);}if(_0x4ac93){logger[_0xe4de('0x9c')]('Run\x20Query:',_0x91f81b['toString']());require(_0xe4de('0x9d'))[_0xe4de('0x9e')](path['join'](__dirname,_0xe4de('0x9f'),_0x4ac93['output']),[_0x4ac93['id'],_0x91f81b[_0xe4de('0x87')](),path[_0xe4de('0x56')](__dirname,_0xe4de('0xa0'),_0x4ac93['savename']),_0x41a2af]);return _0x4ac93;}else{var _0x35b343=squel['select']();_0x35b343['from']('('+_0x91f81b[_0xe4de('0x87')]()+')','countTable');_0x35b343[_0xe4de('0x6b')]('COUNT(*)',_0xe4de('0x1e'));_0x91f81b[_0xe4de('0x1d')](_0x598b24['limit']||_0x2f00e2);_0x91f81b[_0xe4de('0x1b')](_0x598b24['offset']||0x0);return dbH['sequelize'][_0xe4de('0x32')](_0x35b343[_0xe4de('0x87')](),{'type':dbH[_0xe4de('0x88')][_0xe4de('0x89')]['SELECT']})[_0xe4de('0x25')](function(_0xc504df){if(!_0xc504df[_0xe4de('0x38')]){_0x2af21a=0x0;}else{_0x2af21a=_0xc504df[0x0][_0xe4de('0x1e')]||0x0;}return dbH[_0xe4de('0x88')][_0xe4de('0x32')](_0x91f81b['toString'](),{'type':dbH[_0xe4de('0x88')]['QueryTypes'][_0xe4de('0x8a')]});})[_0xe4de('0x25')](function(_0x4f6a3d){return{'rows':_0x4f6a3d||[],'count':_0x2af21a};});}});}exports['run']=function(_0x268b00,_0x63b0c8){return runReport(_0x268b00[_0xe4de('0x54')],_0x268b00[_0xe4de('0x32')],_0x268b00[_0xe4de('0x41')])[_0xe4de('0x25')](respondWithResult(_0x63b0c8,null))[_0xe4de('0x46')](handleError(_0x63b0c8,null));};exports[_0xe4de('0xa1')]=runReport;exports[_0xe4de('0x32')]=function(_0x50b4f8,_0x46d8df){var _0x38926b=0xa;var _0x4b57d9=[_0xe4de('0x56'),_0xe4de('0x57'),'right_join',_0xe4de('0x59')];var _0xf5d9fd={'SUM':_0xe4de('0x5a'),'COUNT':_0xe4de('0x5b'),'COUNT DISTINCT':_0xe4de('0x5c'),'MAX':_0xe4de('0x5d'),'MIN':_0xe4de('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe4de('0x61'),'GROUP_CONCAT DESC':_0xe4de('0x62')};var _0x115a90={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe4de('0x64'),'HOUR':_0xe4de('0x8b'),'ROUND':_0xe4de('0x8c'),'UNIX_TIMESTAMP':_0xe4de('0x65')};var _0x4527ac=function(_0x2bbb37){return!_[_0xe4de('0x66')]([_0xe4de('0x67'),_0xe4de('0x68'),_0xe4de('0xa2'),_0xe4de('0xa3')],_0x2bbb37);};var _0x1b4084=function(_0x2bc938){if(!_0x2bc938||!_0x2bc938[_0xe4de('0x69')][_0xe4de('0x38')]){return'';}for(var _0x33818b='(',_0x4e5db0=0x0;_0x4e5db0<_0x2bc938[_0xe4de('0x69')]['length'];_0x4e5db0+=0x1){_0x4e5db0>0x0&&(_0x33818b+='\x20'+_0x2bc938[_0xe4de('0x8d')]+'\x20');_0x33818b+=_0x2bc938['rules'][_0x4e5db0][_0xe4de('0x6a')]?_0x1b4084(_0x2bc938[_0xe4de('0x69')][_0x4e5db0][_0xe4de('0x6a')]):_0x2bc938[_0xe4de('0x69')][_0x4e5db0][_0xe4de('0x6b')]+'\x20'+_0x2bc938['rules'][_0x4e5db0]['condition']+(_0x4527ac(_0x2bc938[_0xe4de('0x69')][_0x4e5db0]['condition'])?'\x20'+_0x2bc938[_0xe4de('0x69')][_0x4e5db0][_0xe4de('0x6d')]:'');}return _0x33818b+')';};var _0x53a699={'where':{'id':_0x50b4f8[_0xe4de('0x54')]['id']}},_0x213c06,_0xfc17a8,_0x442946,_0x11f4fe,_0x46e2e6;_0x53a699=_[_0xe4de('0x40')]({},_0x53a699,_0x50b4f8[_0xe4de('0x41')]);return db[_0xe4de('0x43')]['find'](_0x53a699)[_0xe4de('0x25')](function(_0x12dc51){if(_0x12dc51){_0x213c06=_0x12dc51;return _0x12dc51['getFields']();}return null;})[_0xe4de('0x25')](function(_0x424809){if(_0x424809){if(!_0x424809[_0xe4de('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe4de('0x70'),0x193);}_0xfc17a8=_0x424809;return db['AnalyticMetric'][_0xe4de('0x44')]({'raw':!![]});}return null;})[_0xe4de('0x25')](function(_0x1fe8f6){if(_0x1fe8f6){_0x442946=_[_0xe4de('0x8f')](_0x1fe8f6,'id');var _0x41e67f;var _0x3f7734=squel[_0xe4de('0x72')]();_0x3f7734['from'](_0x213c06[_0xe4de('0x74')]);for(var _0x4ef007=0x0;_0x4ef007<_0xfc17a8['length'];_0x4ef007+=0x1){_0x41e67f=_0xfc17a8[_0x4ef007][_0xe4de('0x75')]?_0x442946[_0xfc17a8[_0x4ef007][_0xe4de('0x75')]][_0xe4de('0x76')]:_0xfc17a8[_0x4ef007][_0xe4de('0x6b')];_0x41e67f=_0xfc17a8[_0x4ef007]['function']?_[_0xe4de('0x78')](_0xf5d9fd[_0xfc17a8[_0x4ef007][_0xe4de('0x77')]],'%s',_0x41e67f):_0x41e67f;_0x41e67f=_0xfc17a8[_0x4ef007][_0xe4de('0x79')]?_[_0xe4de('0x78')](_0x115a90[_0xfc17a8[_0x4ef007]['format']],'%s',_0x41e67f):_0x41e67f;if(_0xfc17a8[_0x4ef007]['groupBy']){_0x3f7734['group'](_0x41e67f);}_0xfc17a8[_0x4ef007]['orderBy']&&_0x3f7734[_0xe4de('0x3a')](_0x41e67f,_0xfc17a8[_0x4ef007][_0xe4de('0x7b')]==='DESC'?![]:!![]);_0x3f7734['field'](_0x41e67f,_0xfc17a8[_0x4ef007][_0xe4de('0x7d')]||_0x41e67f);}if(_0x213c06[_0xe4de('0x7e')]){_0x213c06[_0xe4de('0x7e')]=JSON[_0xe4de('0x7f')](_0x213c06[_0xe4de('0x7e')]);for(var _0x5cf01d=0x0;_0x5cf01d<_0x213c06[_0xe4de('0x7e')][_0xe4de('0x38')];_0x5cf01d+=0x1){if(_0x213c06['joins'][_0x5cf01d]['type']&&_[_0xe4de('0x66')](_0x4b57d9,_0x213c06['joins'][_0x5cf01d][_0xe4de('0x30')])&&_0x213c06[_0xe4de('0x7e')][_0x5cf01d][_0xe4de('0x80')]&&_0x213c06[_0xe4de('0x7e')][_0x5cf01d][_0xe4de('0x81')]&&_0x213c06[_0xe4de('0x7e')][_0x5cf01d]['foreignKey']){_0x3f7734[_0x213c06[_0xe4de('0x7e')][_0x5cf01d][_0xe4de('0x30')]](_0x213c06['joins'][_0x5cf01d]['foreignTable'],null,util[_0xe4de('0x79')](_0xe4de('0x82'),_0x213c06[_0xe4de('0x74')],_0x213c06[_0xe4de('0x7e')][_0x5cf01d][_0xe4de('0x80')],_0x213c06[_0xe4de('0x7e')][_0x5cf01d][_0xe4de('0x81')],_0x213c06['joins'][_0x5cf01d][_0xe4de('0x90')]));}}}if(_0x213c06[_0xe4de('0x83')]){_0x213c06[_0xe4de('0x83')]=JSON[_0xe4de('0x7f')](_0x213c06[_0xe4de('0x83')]);_0x3f7734[_0xe4de('0x3c')](_0x1b4084(_0x213c06[_0xe4de('0x83')][_0xe4de('0x6a')]));}_0x46e2e6=_0x3f7734[_0xe4de('0x84')]();_0x3f7734['limit'](_0x38926b);_0x3f7734[_0xe4de('0x1b')](0x0);logger['debug'](_0xe4de('0x86'),_0x3f7734['toString']());return dbH['sequelize'][_0xe4de('0x32')](_0x3f7734['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xe4de('0x8a')]});}})['then'](function(){return{'sql':_0x46e2e6[_0xe4de('0x87')]()};})[_0xe4de('0x25')](respondWithResult(_0x46d8df,null))[_0xe4de('0x46')](handleError(_0x46d8df,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index cc1720c..2443d4a 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 _0x6677=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','bluebird','request-promise','./analyticCustomReport.attributes'];(function(_0x2d066d,_0x2269d7){var _0x3e41d2=function(_0x1ecc20){while(--_0x1ecc20){_0x2d066d['push'](_0x2d066d['shift']());}};_0x3e41d2(++_0x2269d7);}(_0x6677,0xa4));var _0x7667=function(_0x4ef5a1,_0x37a788){_0x4ef5a1=_0x4ef5a1-0x0;var _0x25b667=_0x6677[_0x4ef5a1];return _0x25b667;};'use strict';var _=require(_0x7667('0x0'));var util=require(_0x7667('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7667('0x2'));var BPromise=require(_0x7667('0x3'));var rp=require(_0x7667('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7667('0x5'));module[_0x7667('0x6')]=function(_0xfcfb61,_0x1b0443){return _0xfcfb61[_0x7667('0x7')](_0x7667('0x8'),attributes,{'tableName':_0x7667('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x093a=['moment','bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger'];(function(_0x4e0c31,_0x208e9f){var _0x3fd7df=function(_0x5ee817){while(--_0x5ee817){_0x4e0c31['push'](_0x4e0c31['shift']());}};_0x3fd7df(++_0x208e9f);}(_0x093a,0x1b6));var _0xa093=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0x093a[_0x456a4b];return _0x42957c;};'use strict';var _=require(_0xa093('0x0'));var util=require('util');var logger=require(_0xa093('0x1'))('api');var moment=require(_0xa093('0x2'));var BPromise=require(_0xa093('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa093('0x4'));var config=require(_0xa093('0x5'));var attributes=require(_0xa093('0x6'));module[_0xa093('0x7')]=function(_0x4cbff8,_0x123144){return _0x4cbff8[_0xa093('0x8')](_0xa093('0x9'),attributes,{'tableName':_0xa093('0xa'),'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 0049906..d8c747c 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 _0xa0ca=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x46d492,_0x1c407d){var _0x41fc87=function(_0x49e5dc){while(--_0x49e5dc){_0x46d492['push'](_0x46d492['shift']());}};_0x41fc87(++_0x1c407d);}(_0xa0ca,0x6e));var _0xaa0c=function(_0xc1b9ae,_0x12c6ac){_0xc1b9ae=_0xc1b9ae-0x0;var _0x27c07e=_0xa0ca[_0xc1b9ae];return _0x27c07e;};'use strict';var _=require('lodash');var util=require(_0xaa0c('0x0'));var moment=require(_0xaa0c('0x1'));var BPromise=require('bluebird');var rs=require(_0xaa0c('0x2'));var fs=require('fs');var Redis=require(_0xaa0c('0x3'));var db=require(_0xaa0c('0x4'))['db'];var utils=require(_0xaa0c('0x5'));var logger=require(_0xaa0c('0x6'))(_0xaa0c('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa0c('0x8'));var client=jayson[_0xaa0c('0x9')][_0xaa0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34e749,_0xa11c32,_0x130d89){return new BPromise(function(_0x598371,_0x2a26a9){return client[_0xaa0c('0xb')](_0x34e749,_0x130d89)[_0xaa0c('0xc')](function(_0x434910){logger[_0xaa0c('0xd')](_0xaa0c('0xe'),_0xa11c32,_0xaa0c('0xf'));logger['debug'](_0xaa0c('0x10'),_0xa11c32,'request\x20sent',JSON[_0xaa0c('0x11')](_0x434910));if(_0x434910[_0xaa0c('0x12')]){if(_0x434910[_0xaa0c('0x12')][_0xaa0c('0x13')]===0x1f4){logger[_0xaa0c('0x12')](_0xaa0c('0xe'),_0xa11c32,_0x434910['error'][_0xaa0c('0x14')]);return _0x2a26a9(_0x434910['error'][_0xaa0c('0x14')]);}logger['error'](_0xaa0c('0xe'),_0xa11c32,_0x434910[_0xaa0c('0x12')][_0xaa0c('0x14')]);return _0x598371(_0x434910[_0xaa0c('0x12')][_0xaa0c('0x14')]);}else{logger[_0xaa0c('0xd')](_0xaa0c('0xe'),_0xa11c32,_0xaa0c('0xf'));_0x598371(_0x434910[_0xaa0c('0x15')]['message']);}})[_0xaa0c('0x16')](function(_0x181706){logger['error'](_0xaa0c('0xe'),_0xa11c32,_0x181706);_0x2a26a9(_0x181706);});});} \ No newline at end of file +var _0xdc46=['../../config/environment','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14e517,_0x56cee3){var _0x52bdde=function(_0x3e7ca4){while(--_0x3e7ca4){_0x14e517['push'](_0x14e517['shift']());}};_0x52bdde(++_0x56cee3);}(_0xdc46,0xcb));var _0x6dc4=function(_0x4176c5,_0x497677){_0x4176c5=_0x4176c5-0x0;var _0x305a70=_0xdc46[_0x4176c5];return _0x305a70;};'use strict';var _=require(_0x6dc4('0x0'));var util=require(_0x6dc4('0x1'));var moment=require(_0x6dc4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6dc4('0x3'))['db'];var utils=require(_0x6dc4('0x4'));var logger=require(_0x6dc4('0x5'))(_0x6dc4('0x6'));var config=require(_0x6dc4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6dc4('0x8')][_0x6dc4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x328bd3,_0x54260a,_0x20bc90){return new BPromise(function(_0x274833,_0x394266){return client[_0x6dc4('0xa')](_0x328bd3,_0x20bc90)[_0x6dc4('0xb')](function(_0x192093){logger[_0x6dc4('0xc')](_0x6dc4('0xd'),_0x54260a,'request\x20sent');logger['debug'](_0x6dc4('0xe'),_0x54260a,_0x6dc4('0xf'),JSON['stringify'](_0x192093));if(_0x192093['error']){if(_0x192093[_0x6dc4('0x10')][_0x6dc4('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x54260a,_0x192093[_0x6dc4('0x10')][_0x6dc4('0x12')]);return _0x394266(_0x192093[_0x6dc4('0x10')][_0x6dc4('0x12')]);}logger[_0x6dc4('0x10')](_0x6dc4('0xd'),_0x54260a,_0x192093[_0x6dc4('0x10')][_0x6dc4('0x12')]);return _0x274833(_0x192093[_0x6dc4('0x10')]['message']);}else{logger[_0x6dc4('0xc')](_0x6dc4('0xd'),_0x54260a,_0x6dc4('0xf'));_0x274833(_0x192093[_0x6dc4('0x13')][_0x6dc4('0x12')]);}})[_0x6dc4('0x14')](function(_0x2f9b10){logger[_0x6dc4('0x10')](_0x6dc4('0xd'),_0x54260a,_0x2f9b10);_0x394266(_0x2f9b10);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index a4b922a..2227ea0 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 _0xd8d2=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/query','query','post'];(function(_0x169ea9,_0xf9fc24){var _0x1ab3e3=function(_0x2a2c45){while(--_0x2a2c45){_0x169ea9['push'](_0x169ea9['shift']());}};_0x1ab3e3(++_0xf9fc24);}(_0xd8d2,0xf9));var _0x2d8d=function(_0xe1fb9c,_0x264431){_0xe1fb9c=_0xe1fb9c-0x0;var _0x48b5ea=_0xd8d2[_0xe1fb9c];return _0x48b5ea;};'use strict';var multer=require(_0x2d8d('0x0'));var util=require(_0x2d8d('0x1'));var path=require(_0x2d8d('0x2'));var timeout=require(_0x2d8d('0x3'));var express=require(_0x2d8d('0x4'));var router=express[_0x2d8d('0x5')]();var fs_extra=require(_0x2d8d('0x6'));var auth=require(_0x2d8d('0x7'));var interaction=require(_0x2d8d('0x8'));var config=require(_0x2d8d('0x9'));var controller=require(_0x2d8d('0xa'));router[_0x2d8d('0xb')]('/',auth[_0x2d8d('0xc')](),controller[_0x2d8d('0xd')]);router[_0x2d8d('0xb')](_0x2d8d('0xe'),auth[_0x2d8d('0xc')](),controller[_0x2d8d('0xf')]);router[_0x2d8d('0xb')](_0x2d8d('0x10'),auth[_0x2d8d('0xc')](),controller[_0x2d8d('0x11')]);router[_0x2d8d('0xb')]('/:id/run',auth[_0x2d8d('0xc')](),controller['run']);router['get'](_0x2d8d('0x12'),auth[_0x2d8d('0xc')](),controller[_0x2d8d('0x13')]);router[_0x2d8d('0x14')]('/',auth[_0x2d8d('0xc')](),controller[_0x2d8d('0x15')]);router[_0x2d8d('0x16')](_0x2d8d('0xe'),auth[_0x2d8d('0xc')](),controller[_0x2d8d('0x17')]);router[_0x2d8d('0x18')]('/:id',auth[_0x2d8d('0xc')](),controller[_0x2d8d('0x19')]);module[_0x2d8d('0x1a')]=router; \ No newline at end of file +var _0x037e=['/:id/preview','preview','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x037e,0x136));var _0xe037=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x037e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe037('0x0'));var util=require(_0xe037('0x1'));var path=require(_0xe037('0x2'));var timeout=require(_0xe037('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe037('0x4'));var auth=require(_0xe037('0x5'));var interaction=require(_0xe037('0x6'));var config=require(_0xe037('0x7'));var controller=require(_0xe037('0x8'));router[_0xe037('0x9')]('/',auth[_0xe037('0xa')](),controller[_0xe037('0xb')]);router[_0xe037('0x9')](_0xe037('0xc'),auth[_0xe037('0xa')](),controller['show']);router['get'](_0xe037('0xd'),auth['isAuthenticated'](),controller[_0xe037('0xe')]);router[_0xe037('0x9')]('/:id/run',auth['isAuthenticated'](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0xe037('0xa')](),controller['create']);router[_0xe037('0xf')](_0xe037('0xc'),auth[_0xe037('0xa')](),controller[_0xe037('0x10')]);router[_0xe037('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe037('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 520bd7f..f552608 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 _0xdbf5=['exports','STRING','TEXT'];(function(_0x5e3a94,_0x234e03){var _0x25af6f=function(_0x189ed8){while(--_0x189ed8){_0x5e3a94['push'](_0x5e3a94['shift']());}};_0x25af6f(++_0x234e03);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xe8a2d,_0x2a8c2d){_0xe8a2d=_0xe8a2d-0x0;var _0x1569dd=_0xdbf5[_0xe8a2d];return _0x1569dd;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x46ed,0x168));var _0xd46e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46ed[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 03a2e50..b5edaa6 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 _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x1416fc,_0x72e155){var _0x3a4b34=function(_0x455ac8){while(--_0x455ac8){_0x1416fc['push'](_0x1416fc['shift']());}};_0x3a4b34(++_0x72e155);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file +var _0x3f8a=['get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','condition','ValidationErrorItem','metric','DESC','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','%s.%s\x20=\x20%s.%s','debug','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','dbH','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x2dbe55,_0x117ce0){var _0x47687e=function(_0x5a676c){while(--_0x5a676c){_0x2dbe55['push'](_0x2dbe55['shift']());}};_0x47687e(++_0x117ce0);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x20909c,_0x3ffc7c){_0x20909c=_0x20909c-0x0;var _0x4fc341=_0x3f8a[_0x20909c];return _0x4fc341;};'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'];var dbH=require(_0xa3f8('0x1c'))[_0xa3f8('0x1d')];function respondWithStatusCode(_0x63de8b,_0x324aa8){_0x324aa8=_0x324aa8||0xcc;return function(_0x36b1b8){if(_0x36b1b8){return _0x63de8b[_0xa3f8('0x1e')](_0x324aa8);}return _0x63de8b[_0xa3f8('0x1f')](_0x324aa8)['end']();};}function respondWithResult(_0x2d8f74,_0xe55848){_0xe55848=_0xe55848||0xc8;return function(_0x45014f){if(_0x45014f){return _0x2d8f74[_0xa3f8('0x1f')](_0xe55848)['json'](_0x45014f);}};}function respondWithFilteredResult(_0x39c450,_0x33b98e){return function(_0x46a8d9){if(_0x46a8d9){var _0x8cd130=typeof _0x33b98e[_0xa3f8('0x20')]===_0xa3f8('0x21')&&typeof _0x33b98e[_0xa3f8('0x22')]===_0xa3f8('0x21');var _0x2cb49f=_0x46a8d9[_0xa3f8('0x23')];var _0x54b870=_0x8cd130?0x0:_0x33b98e[_0xa3f8('0x20')];var _0x5a0e18=_0x8cd130?_0x46a8d9[_0xa3f8('0x23')]:_0x33b98e[_0xa3f8('0x20')]+_0x33b98e[_0xa3f8('0x22')];var _0x46042d;if(_0x5a0e18>=_0x2cb49f){_0x5a0e18=_0x2cb49f;_0x46042d=0xc8;}else{_0x46042d=0xce;}_0x39c450['status'](_0x46042d);return _0x39c450[_0xa3f8('0x24')]('Content-Range',_0x54b870+'-'+_0x5a0e18+'/'+_0x2cb49f)[_0xa3f8('0x25')](_0x46a8d9);}return null;};}function patchUpdates(_0x58336d){return function(_0x4066bb){try{jsonpatch[_0xa3f8('0x26')](_0x4066bb,_0x58336d,!![]);}catch(_0x353daa){return BPromise[_0xa3f8('0x27')](_0x353daa);}return _0x4066bb[_0xa3f8('0x28')]();};}function saveUpdates(_0x1e5f30,_0x187352){return function(_0x490717){if(_0x490717){return _0x490717[_0xa3f8('0x29')](_0x1e5f30)['then'](function(_0x3ce57b){return _0x3ce57b;});}return null;};}function removeEntity(_0xa5a697,_0x24985a){return function(_0x37b290){if(_0x37b290){return _0x37b290[_0xa3f8('0x2a')]()[_0xa3f8('0x2b')](function(){var _0x6e3cb4=_0x37b290[_0xa3f8('0x2c')]({'plain':!![]});var _0x1e22b8=_0xa3f8('0x2d');return db['UserProfileResource'][_0xa3f8('0x2a')]({'where':{'type':_0x1e22b8,'resourceId':_0x6e3cb4['id']}})[_0xa3f8('0x2b')](function(){return _0x37b290;});})[_0xa3f8('0x2b')](function(){_0xa5a697['status'](0xcc)[_0xa3f8('0x2e')]();});}};}function handleEntityNotFound(_0x57f6be,_0xbad6a6){return function(_0x3a3746){if(!_0x3a3746){_0x57f6be[_0xa3f8('0x1e')](0x194);}return _0x3a3746;};}function handleError(_0x4ea213,_0x458824){_0x458824=_0x458824||0x1f4;return function(_0x5e69e2){logger[_0xa3f8('0x2f')](_0x5e69e2[_0xa3f8('0x30')]);if(_0x5e69e2[_0xa3f8('0x31')]){delete _0x5e69e2[_0xa3f8('0x31')];}_0x4ea213[_0xa3f8('0x1f')](_0x458824)[_0xa3f8('0x32')](_0x5e69e2);};}exports[_0xa3f8('0x33')]=function(_0x424a3e,_0x25f9f5){var _0x290a4e={},_0x6e83b0={},_0x57c465={'count':0x0,'rows':[]};var _0x4404da=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x3bb4b0){return{'name':_0x3bb4b0['fieldName'],'type':_0x3bb4b0[_0xa3f8('0x37')][_0xa3f8('0x38')]};});_0x6e83b0['model']=_[_0xa3f8('0x34')](_0x4404da,_0xa3f8('0x31'));_0x6e83b0['query']=_[_0xa3f8('0x39')](_0x424a3e['query']);_0x6e83b0['filters']=_[_0xa3f8('0x3a')](_0x6e83b0[_0xa3f8('0x3b')],_0x6e83b0['query']);_0x290a4e[_0xa3f8('0x3c')]=_['intersection'](_0x6e83b0[_0xa3f8('0x3b')],qs[_0xa3f8('0x3d')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x290a4e['attributes']=_0x290a4e[_0xa3f8('0x3c')]['length']?_0x290a4e[_0xa3f8('0x3c')]:_0x6e83b0['model'];if(!_0x424a3e[_0xa3f8('0x3e')]['hasOwnProperty']('nolimit')){_0x290a4e['limit']=qs[_0xa3f8('0x22')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x22')]);_0x290a4e[_0xa3f8('0x20')]=qs['offset'](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x20')]);}_0x290a4e[_0xa3f8('0x3f')]=qs[_0xa3f8('0x40')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x40')]);_0x290a4e['where']=qs[_0xa3f8('0x41')](_[_0xa3f8('0x42')](_0x424a3e[_0xa3f8('0x3e')],_0x6e83b0['filters']),_0x4404da);if(_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x43')]){_0x290a4e['where']=_[_0xa3f8('0x44')](_0x290a4e['where'],{'$or':_[_0xa3f8('0x34')](_0x4404da,function(_0x5a077c){if(_0x5a077c[_0xa3f8('0x37')]!==_0xa3f8('0x45')){var _0x9a00e7={};_0x9a00e7[_0x5a077c[_0xa3f8('0x31')]]={'$like':'%'+_0x424a3e[_0xa3f8('0x3e')]['filter']+'%'};return _0x9a00e7;}})});}_0x290a4e=_[_0xa3f8('0x44')]({},_0x290a4e,_0x424a3e[_0xa3f8('0x46')]);var _0x4db9c5={'where':_0x290a4e[_0xa3f8('0x47')]};return db['AnalyticDefaultReport'][_0xa3f8('0x23')](_0x4db9c5)[_0xa3f8('0x2b')](function(_0x1542cc){_0x57c465[_0xa3f8('0x23')]=_0x1542cc;if(_0x424a3e[_0xa3f8('0x3e')]['includeAll']){_0x290a4e[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x35')][_0xa3f8('0x49')](_0x290a4e);})[_0xa3f8('0x2b')](function(_0x337808){_0x57c465['rows']=_0x337808;return _0x57c465;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x25f9f5,_0x290a4e))[_0xa3f8('0x4a')](handleError(_0x25f9f5,null));};exports[_0xa3f8('0x4b')]=function(_0x32e371,_0x2a124b){var _0x314dba={'raw':!![],'where':{'id':_0x32e371[_0xa3f8('0x4c')]['id']}},_0x497217={};_0x497217[_0xa3f8('0x3b')]=_[_0xa3f8('0x39')](db[_0xa3f8('0x35')][_0xa3f8('0x36')]);_0x497217[_0xa3f8('0x3e')]=_['keys'](_0x32e371['query']);_0x497217['filters']=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],_0x497217[_0xa3f8('0x3e')]);_0x314dba[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],qs['fields'](_0x32e371[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x314dba[_0xa3f8('0x3c')]=_0x314dba[_0xa3f8('0x3c')]['length']?_0x314dba[_0xa3f8('0x3c')]:_0x497217[_0xa3f8('0x3b')];if(_0x32e371[_0xa3f8('0x3e')]['includeAll']){_0x314dba['include']=[{'all':!![]}];}_0x314dba=_['merge']({},_0x314dba,_0x32e371[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')]['find'](_0x314dba)[_0xa3f8('0x2b')](handleEntityNotFound(_0x2a124b,null))[_0xa3f8('0x2b')](respondWithResult(_0x2a124b,null))[_0xa3f8('0x4a')](handleError(_0x2a124b,null));};exports[_0xa3f8('0x4d')]=function(_0x14932f,_0x3c74b5){return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x14932f[_0xa3f8('0x4e')],{})[_0xa3f8('0x2b')](function(_0x338554){var _0x29d8f5=_0x14932f[_0xa3f8('0x4f')][_0xa3f8('0x2c')]({'plain':!![]});if(!_0x29d8f5)throw new Error(_0xa3f8('0x50'));if(_0x29d8f5[_0xa3f8('0x51')]===_0xa3f8('0x4f')){var _0x559ae7=_0x338554['get']({'plain':!![]});var _0x1fad80=_0xa3f8('0x52');return db['UserProfileSection'][_0xa3f8('0x53')]({'where':{'name':_0x1fad80,'userProfileId':_0x29d8f5[_0xa3f8('0x54')]},'raw':!![]})[_0xa3f8('0x2b')](function(_0xaff79b){if(_0xaff79b&&_0xaff79b[_0xa3f8('0x55')]===0x0){return db[_0xa3f8('0x56')][_0xa3f8('0x4d')]({'name':_0x559ae7[_0xa3f8('0x31')],'resourceId':_0x559ae7['id'],'type':_0xa3f8('0x2d'),'sectionId':_0xaff79b['id']},{})[_0xa3f8('0x2b')](function(){return _0x338554;});}else{return _0x338554;}})[_0xa3f8('0x4a')](function(_0x3752fa){logger[_0xa3f8('0x2f')](_0xa3f8('0x57'),_0x3752fa);throw _0x3752fa;});}return _0x338554;})[_0xa3f8('0x2b')](respondWithResult(_0x3c74b5,0xc9))[_0xa3f8('0x4a')](handleError(_0x3c74b5,null));};exports['update']=function(_0x593614,_0xd0628e){if(_0x593614['body']['id']){delete _0x593614[_0xa3f8('0x4e')]['id'];}return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x593614['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0xd0628e,null))[_0xa3f8('0x2b')](saveUpdates(_0x593614[_0xa3f8('0x4e')],null))[_0xa3f8('0x2b')](respondWithResult(_0xd0628e,null))['catch'](handleError(_0xd0628e,null));};exports[_0xa3f8('0x2a')]=function(_0x47cc0c,_0x392e1e){return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x47cc0c['params']['id']}})['then'](handleEntityNotFound(_0x392e1e,null))[_0xa3f8('0x2b')](removeEntity(_0x392e1e,null))[_0xa3f8('0x4a')](handleError(_0x392e1e,null));};exports[_0xa3f8('0x58')]=function(_0x6ad40a,_0x48f5a6){var _0x36eac9=0xa;var _0x3478e8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x5d7877={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521719={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x27de61=function(_0x356643){return!_[_0xa3f8('0x68')](['IS\x20NULL',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x356643);};var _0x42e3f8=function(_0x27c5aa){if(!_0x27c5aa||!_0x27c5aa[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x4d0404='(',_0x33ea06=0x0;_0x33ea06<_0x27c5aa[_0xa3f8('0x6c')]['length'];_0x33ea06+=0x1){_0x33ea06>0x0&&(_0x4d0404+='\x20'+_0x27c5aa[_0xa3f8('0x6e')]+'\x20');_0x4d0404+=_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]?_0x42e3f8(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]):_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x70')]+'\x20'+_0x27c5aa['rules'][_0x33ea06]['condition']+(_0x27de61(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06]['condition'])?'\x20'+_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x71')]:'');}return _0x4d0404+')';};var _0x3ff369={'where':{'id':_0x6ad40a[_0xa3f8('0x4c')]['id']}},_0x1dba7e,_0x452e99,_0x35d4d6,_0xeca2dc,_0x14508d;_0x3ff369=_[_0xa3f8('0x44')]({},_0x3ff369,_0x6ad40a[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x3ff369)['then'](function(_0x5efdcf){if(_0x5efdcf){_0x1dba7e=_0x5efdcf;return _0x5efdcf[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x1688ca){if(_0x1688ca){if(!_0x1688ca[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))]['ValidationErrorItem'](_0xa3f8('0x74'),0x193);}_0x452e99=_0x1688ca;return db[_0xa3f8('0x75')][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x28d359){if(_0x28d359){_0x35d4d6=_[_0xa3f8('0x76')](_0x28d359,'id');var _0x3d45ae;var _0x3a2362=squel[_0xa3f8('0x77')]();_0x3a2362[_0xa3f8('0x78')](_0x1dba7e[_0xa3f8('0x79')]);for(var _0x5d4fe5=0x0;_0x5d4fe5<_0x452e99[_0xa3f8('0x6d')];_0x5d4fe5+=0x1){_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7a')]?_0x35d4d6[_0x452e99[_0x5d4fe5]['MetricId']]['metric']:_0x452e99[_0x5d4fe5][_0xa3f8('0x70')];_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x5d7877[_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]],'%s',_0x3d45ae):_0x3d45ae;_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x521719[_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]],'%s',_0x3d45ae):_0x3d45ae;if(_0x452e99[_0x5d4fe5][_0xa3f8('0x7e')]){_0x3a2362['group'](_0x3d45ae);}_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]&&_0x3a2362[_0xa3f8('0x3f')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3a2362[_0xa3f8('0x70')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x80')]||_0x3d45ae);}if(_0x1dba7e['joins']){_0x1dba7e[_0xa3f8('0x81')]=JSON[_0xa3f8('0x82')](_0x1dba7e[_0xa3f8('0x81')]);for(var _0x14a5b5=0x0;_0x14a5b5<_0x1dba7e[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x14a5b5+=0x1){if(_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x3478e8,_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x37')])&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x83')]&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')]&&_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x85')]){_0x3a2362[_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]](_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1dba7e[_0xa3f8('0x79')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x83')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x84')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5]['foreignKey']));}}}if(_0x1dba7e[_0xa3f8('0x86')]){_0x1dba7e[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1dba7e['conditions']);_0x3a2362[_0xa3f8('0x47')](_0x42e3f8(_0x1dba7e['conditions'][_0xa3f8('0x6f')]));}_0x14508d=_0x3a2362['clone']();_0x3a2362['limit'](_0x36eac9);_0x3a2362[_0xa3f8('0x20')](0x0);logger['debug'](_0xa3f8('0x87'),_0x3a2362['toString']());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3a2362[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](respondWithResult(_0x48f5a6,null))['catch'](handleError(_0x48f5a6,null));};function runReport(_0x3187e0,_0xd0d568,_0x3715ea){var _0x345089=_0xd0d568[_0xa3f8('0x31')];var _0x20ae51=0xa;var _0x190ce8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x7dc5ec={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e2d99={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x599484=function(_0x24fe62){return!_[_0xa3f8('0x68')]([_0xa3f8('0x8c'),_0xa3f8('0x69'),'IS\x20EMPTY',_0xa3f8('0x6b')],_0x24fe62);};var _0x427830=function(_0x3c5091){if(!_0x3c5091||!_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x2db7dd='(',_0x12fe03=0x0;_0x12fe03<_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')];_0x12fe03+=0x1){_0x12fe03>0x0&&(_0x2db7dd+='\x20'+_0x3c5091[_0xa3f8('0x6e')]+'\x20');_0x2db7dd+=_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']?_0x427830(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']):_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x70')]+'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')]+(_0x599484(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')])?'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x71')]:'');}return _0x2db7dd+')';};var _0x4bb7dd={'where':{'id':_0x3187e0['id']}},_0x2c6efe,_0x4f9513,_0x39bd5c,_0x52fcc3,_0x2d2883;_0x4bb7dd=_['merge']({},_0x4bb7dd,_0x3715ea);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x4bb7dd)[_0xa3f8('0x2b')](function(_0xe3cc6a){if(_0xe3cc6a){_0x2c6efe=_0xe3cc6a;return _0xe3cc6a['getFields']();}return null;})[_0xa3f8('0x2b')](function(_0x3d343f){if(_0x3d343f){if(!_0x3d343f[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f9513=_0x3d343f;return db['AnalyticMetric'][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0xbe1a54){if(_0xbe1a54){_0x39bd5c=_[_0xa3f8('0x76')](_0xbe1a54,'id');var _0x477b0a;var _0x565a10=squel[_0xa3f8('0x77')]();_0x565a10[_0xa3f8('0x78')](_0x2c6efe['table']);for(var _0x4494a5=0x0;_0x4494a5<_0x4f9513[_0xa3f8('0x6d')];_0x4494a5+=0x1){_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7a')]?_0x39bd5c[_0x4f9513[_0x4494a5]['MetricId']][_0xa3f8('0x8f')]:_0x4f9513[_0x4494a5][_0xa3f8('0x70')];_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x7dc5ec[_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]],'%s',_0x477b0a):_0x477b0a;_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x2e2d99[_0x4f9513[_0x4494a5]['format']],'%s',_0x477b0a):_0x477b0a;if(_0x4f9513[_0x4494a5][_0xa3f8('0x7e')]){_0x565a10[_0xa3f8('0x6f')](_0x477b0a);}_0x4f9513[_0x4494a5]['orderBy']&&_0x565a10[_0xa3f8('0x3f')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x7f')]===_0xa3f8('0x90')?![]:!![]);_0x565a10[_0xa3f8('0x70')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x80')]||_0x477b0a);}if(_0x2c6efe[_0xa3f8('0x81')]){_0x2c6efe[_0xa3f8('0x81')]=JSON['parse'](_0x2c6efe[_0xa3f8('0x81')]);for(var _0x151bab=0x0;_0x151bab<_0x2c6efe[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x151bab+=0x1){if(_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x190ce8,_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')])&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')]&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable']&&_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x85')]){_0x565a10[_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')]](_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c6efe[_0xa3f8('0x79')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable'],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignKey']));}}}if(_0x2c6efe[_0xa3f8('0x86')]){_0x2c6efe[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x2c6efe['conditions']);_0x565a10['where'](_0x427830(_0x2c6efe['conditions'][_0xa3f8('0x6f')]));}_0x2d2883=_0x565a10[_0xa3f8('0x91')]();_0x565a10[_0xa3f8('0x22')](_0x20ae51);_0x565a10[_0xa3f8('0x20')](0x0);return;}})[_0xa3f8('0x2b')](function(){if(_0xd0d568[_0xa3f8('0x92')]===_0xa3f8('0x93')){return null;}var _0x18890e=_['merge'](_0xd0d568,{'name':_0xd0d568[_0xa3f8('0x94')]||_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe[_0xa3f8('0x31')],'basename':_0x345089,'savename':util['format'](_0xa3f8('0x95'),_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe['name'],require(_0xa3f8('0x96'))[_0xa3f8('0x97')](0x4),_0xd0d568['output']||_0xa3f8('0x98')),'reportId':_0x2c6efe['id'],'reportType':_0xa3f8('0x99')});return db['AnalyticExtractedReport'][_0xa3f8('0x4d')](_0x18890e,{'raw':!![]});})[_0xa3f8('0x2b')](function(_0x21cc1d){if(_0x2c6efe['table']===_0xa3f8('0x9a')){_0x2d2883[_0xa3f8('0x47')](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9b'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568['endDate']);}else{_0x2d2883['where'](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9d'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568[_0xa3f8('0x9e')]);}if(_0x21cc1d){logger['info'](_0xa3f8('0x9f'),_0x2d2883[_0xa3f8('0x89')]());require(_0xa3f8('0xa0'))[_0xa3f8('0xa1')](path[_0xa3f8('0x59')](__dirname,_0xa3f8('0xa2'),_0x21cc1d[_0xa3f8('0x92')]),[_0x21cc1d['id'],_0x2d2883[_0xa3f8('0x89')](),path['join'](__dirname,_0xa3f8('0xa3'),_0x21cc1d['savename']),_0x345089]);return _0x21cc1d;}else{var _0xe9842=squel['select']();_0xe9842['from']('('+_0x2d2883[_0xa3f8('0x89')]()+')',_0xa3f8('0xa4'));_0xe9842[_0xa3f8('0x70')](_0xa3f8('0xa5'),_0xa3f8('0x23'));_0x2d2883['limit'](_0xd0d568['limit']||_0x20ae51);_0x2d2883[_0xa3f8('0x20')](_0xd0d568[_0xa3f8('0x20')]||0x0);return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0xe9842[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]})[_0xa3f8('0x2b')](function(_0x5a4f4a){if(!_0x5a4f4a['length']){_0x52fcc3=0x0;}else{_0x52fcc3=_0x5a4f4a[0x0][_0xa3f8('0x23')]||0x0;}return dbH[_0xa3f8('0x88')]['query'](_0x2d2883[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});})[_0xa3f8('0x2b')](function(_0x52f592){return{'rows':_0x52f592||[],'count':_0x52fcc3};});}});}exports[_0xa3f8('0xa7')]=function(_0x59026b,_0x234636){return runReport(_0x59026b[_0xa3f8('0x4c')],_0x59026b['query'],_0x59026b['options'])[_0xa3f8('0x2b')](respondWithResult(_0x234636,null))[_0xa3f8('0x4a')](handleError(_0x234636,null));};exports[_0xa3f8('0xa8')]=runReport;exports[_0xa3f8('0x3e')]=function(_0x26ec07,_0x2c9db8){var _0x18ab67=0xa;var _0x1f21a2=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x15a11c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x481b70={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x1f776a=function(_0x5b1527){return!_['includes']([_0xa3f8('0x8c'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x5b1527);};var _0x4670cc=function(_0xfde509){if(!_0xfde509||!_0xfde509['rules']['length']){return'';}for(var _0x3d81fe='(',_0x15111a=0x0;_0x15111a<_0xfde509[_0xa3f8('0x6c')]['length'];_0x15111a+=0x1){_0x15111a>0x0&&(_0x3d81fe+='\x20'+_0xfde509[_0xa3f8('0x6e')]+'\x20');_0x3d81fe+=_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']?_0x4670cc(_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']):_0xfde509[_0xa3f8('0x6c')][_0x15111a]['field']+'\x20'+_0xfde509['rules'][_0x15111a][_0xa3f8('0x8d')]+(_0x1f776a(_0xfde509[_0xa3f8('0x6c')][_0x15111a][_0xa3f8('0x8d')])?'\x20'+_0xfde509[_0xa3f8('0x6c')][_0x15111a]['value']:'');}return _0x3d81fe+')';};var _0x2e694e={'where':{'id':_0x26ec07[_0xa3f8('0x4c')]['id']}},_0x1669be,_0x4f248f,_0x6ef1ad,_0xae3a31,_0x31d45c;_0x2e694e=_[_0xa3f8('0x44')]({},_0x2e694e,_0x26ec07[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x2e694e)[_0xa3f8('0x2b')](function(_0x529021){if(_0x529021){_0x1669be=_0x529021;return _0x529021[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x35c498){if(_0x35c498){if(!_0x35c498[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f248f=_0x35c498;return db[_0xa3f8('0x75')]['findAll']({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x286490){if(_0x286490){_0x6ef1ad=_['keyBy'](_0x286490,'id');var _0x16e98d;var _0x3be5c9=squel['select']();_0x3be5c9[_0xa3f8('0x78')](_0x1669be[_0xa3f8('0x79')]);for(var _0x5260e0=0x0;_0x5260e0<_0x4f248f[_0xa3f8('0x6d')];_0x5260e0+=0x1){_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7a')]?_0x6ef1ad[_0x4f248f[_0x5260e0]['MetricId']][_0xa3f8('0x8f')]:_0x4f248f[_0x5260e0][_0xa3f8('0x70')];_0x16e98d=_0x4f248f[_0x5260e0]['function']?_['replace'](_0x15a11c[_0x4f248f[_0x5260e0][_0xa3f8('0x7b')]],'%s',_0x16e98d):_0x16e98d;_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x481b70[_0x4f248f[_0x5260e0]['format']],'%s',_0x16e98d):_0x16e98d;if(_0x4f248f[_0x5260e0]['groupBy']){_0x3be5c9[_0xa3f8('0x6f')](_0x16e98d);}_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]&&_0x3be5c9['order'](_0x16e98d,_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3be5c9[_0xa3f8('0x70')](_0x16e98d,_0x4f248f[_0x5260e0]['alias']||_0x16e98d);}if(_0x1669be[_0xa3f8('0x81')]){_0x1669be['joins']=JSON['parse'](_0x1669be[_0xa3f8('0x81')]);for(var _0x5ac693=0x0;_0x5ac693<_0x1669be[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x5ac693+=0x1){if(_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x1f21a2,_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')])&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')]&&_0x1669be['joins'][_0x5ac693][_0xa3f8('0x84')]&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]){_0x3be5c9[_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]](_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')](_0xa3f8('0xa9'),_0x1669be[_0xa3f8('0x79')],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')],_0x1669be[_0xa3f8('0x81')][_0x5ac693]['foreignTable'],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]));}}}if(_0x1669be[_0xa3f8('0x86')]){_0x1669be[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1669be[_0xa3f8('0x86')]);_0x3be5c9['where'](_0x4670cc(_0x1669be[_0xa3f8('0x86')][_0xa3f8('0x6f')]));}_0x31d45c=_0x3be5c9[_0xa3f8('0x91')]();_0x3be5c9[_0xa3f8('0x22')](_0x18ab67);_0x3be5c9[_0xa3f8('0x20')](0x0);logger[_0xa3f8('0xaa')](_0xa3f8('0x87'),_0x3be5c9[_0xa3f8('0x89')]());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3be5c9[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](function(){return{'sql':_0x31d45c[_0xa3f8('0x89')]()};})[_0xa3f8('0x2b')](respondWithResult(_0x2c9db8,null))[_0xa3f8('0x4a')](handleError(_0x2c9db8,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index de40f68..57c4d07 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 _0x6bf8=['path','rimraf','../../config/environment','exports','define','analytics_default_reports','lodash','util','../../config/logger','request-promise'];(function(_0x1a4df0,_0x1e150b){var _0x2a6e62=function(_0xce9ce6){while(--_0xce9ce6){_0x1a4df0['push'](_0x1a4df0['shift']());}};_0x2a6e62(++_0x1e150b);}(_0x6bf8,0x11e));var _0x86bf=function(_0x3fb256,_0xa066af){_0x3fb256=_0x3fb256-0x0;var _0x1ca90f=_0x6bf8[_0x3fb256];return _0x1ca90f;};'use strict';var _=require(_0x86bf('0x0'));var util=require(_0x86bf('0x1'));var logger=require(_0x86bf('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86bf('0x3'));var fs=require('fs');var path=require(_0x86bf('0x4'));var rimraf=require(_0x86bf('0x5'));var config=require(_0x86bf('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x86bf('0x7')]=function(_0x597504,_0x5ce2da){return _0x597504[_0x86bf('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x86bf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae8d=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0xb4564c,_0x4fcb88){var _0x4e8dab=function(_0x32be0a){while(--_0x32be0a){_0xb4564c['push'](_0xb4564c['shift']());}};_0x4e8dab(++_0x4fcb88);}(_0xae8d,0x180));var _0xdae8=function(_0x4fda04,_0x503892){_0x4fda04=_0x4fda04-0x0;var _0x1d98f9=_0xae8d[_0x4fda04];return _0x1d98f9;};'use strict';var _=require(_0xdae8('0x0'));var util=require(_0xdae8('0x1'));var logger=require('../../config/logger')(_0xdae8('0x2'));var moment=require(_0xdae8('0x3'));var BPromise=require(_0xdae8('0x4'));var rp=require(_0xdae8('0x5'));var fs=require('fs');var path=require(_0xdae8('0x6'));var rimraf=require(_0xdae8('0x7'));var config=require('../../config/environment');var attributes=require(_0xdae8('0x8'));module[_0xdae8('0x9')]=function(_0x22a0d9,_0x108987){return _0x22a0d9[_0xdae8('0xa')](_0xdae8('0xb'),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 7115e1c..0fc027d 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 _0xdf4c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0xa56c32,_0x2ecb4a){var _0x245d51=function(_0x530c85){while(--_0x530c85){_0xa56c32['push'](_0xa56c32['shift']());}};_0x245d51(++_0x2ecb4a);}(_0xdf4c,0x15f));var _0xcdf4=function(_0x1f6835,_0xff3520){_0x1f6835=_0x1f6835-0x0;var _0x10aee2=_0xdf4c[_0x1f6835];return _0x10aee2;};'use strict';var _=require(_0xcdf4('0x0'));var util=require(_0xcdf4('0x1'));var moment=require(_0xcdf4('0x2'));var BPromise=require(_0xcdf4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdf4('0x4'));var db=require(_0xcdf4('0x5'))['db'];var utils=require(_0xcdf4('0x6'));var logger=require(_0xcdf4('0x7'))('rpc');var config=require(_0xcdf4('0x8'));var jayson=require(_0xcdf4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e060a,_0x26c77d,_0x589122){return new BPromise(function(_0x23b25c,_0x9fc8d6){return client[_0xcdf4('0xa')](_0x5e060a,_0x589122)[_0xcdf4('0xb')](function(_0x22dead){logger[_0xcdf4('0xc')](_0xcdf4('0xd'),_0x26c77d,_0xcdf4('0xe'));logger[_0xcdf4('0xf')](_0xcdf4('0x10'),_0x26c77d,'request\x20sent',JSON[_0xcdf4('0x11')](_0x22dead));if(_0x22dead[_0xcdf4('0x12')]){if(_0x22dead[_0xcdf4('0x12')]['code']===0x1f4){logger[_0xcdf4('0x12')](_0xcdf4('0xd'),_0x26c77d,_0x22dead[_0xcdf4('0x12')]['message']);return _0x9fc8d6(_0x22dead[_0xcdf4('0x12')][_0xcdf4('0x13')]);}logger[_0xcdf4('0x12')](_0xcdf4('0xd'),_0x26c77d,_0x22dead[_0xcdf4('0x12')][_0xcdf4('0x13')]);return _0x23b25c(_0x22dead[_0xcdf4('0x12')][_0xcdf4('0x13')]);}else{logger[_0xcdf4('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26c77d,'request\x20sent');_0x23b25c(_0x22dead[_0xcdf4('0x14')][_0xcdf4('0x13')]);}})['catch'](function(_0x839b57){logger[_0xcdf4('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26c77d,_0x839b57);_0x9fc8d6(_0x839b57);});});} \ No newline at end of file +var _0x31b7=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4bfb4d,_0x404c40){var _0x3488f2=function(_0x204c9e){while(--_0x204c9e){_0x4bfb4d['push'](_0x4bfb4d['shift']());}};_0x3488f2(++_0x404c40);}(_0x31b7,0x13a));var _0x731b=function(_0xc51c1e,_0x495721){_0xc51c1e=_0xc51c1e-0x0;var _0x808ca7=_0x31b7[_0xc51c1e];return _0x808ca7;};'use strict';var _=require(_0x731b('0x0'));var util=require(_0x731b('0x1'));var moment=require('moment');var BPromise=require(_0x731b('0x2'));var rs=require(_0x731b('0x3'));var fs=require('fs');var Redis=require(_0x731b('0x4'));var db=require(_0x731b('0x5'))['db'];var utils=require(_0x731b('0x6'));var logger=require(_0x731b('0x7'))(_0x731b('0x8'));var config=require(_0x731b('0x9'));var jayson=require(_0x731b('0xa'));var client=jayson[_0x731b('0xb')][_0x731b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c010c,_0x34fb96,_0xe250b1){return new BPromise(function(_0x16b18e,_0x259659){return client[_0x731b('0xd')](_0x4c010c,_0xe250b1)[_0x731b('0xe')](function(_0x540e47){logger[_0x731b('0xf')](_0x731b('0x10'),_0x34fb96,_0x731b('0x11'));logger[_0x731b('0x12')](_0x731b('0x13'),_0x34fb96,_0x731b('0x11'),JSON[_0x731b('0x14')](_0x540e47));if(_0x540e47[_0x731b('0x15')]){if(_0x540e47[_0x731b('0x15')]['code']===0x1f4){logger[_0x731b('0x15')](_0x731b('0x10'),_0x34fb96,_0x540e47[_0x731b('0x15')]['message']);return _0x259659(_0x540e47['error'][_0x731b('0x16')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x34fb96,_0x540e47[_0x731b('0x15')][_0x731b('0x16')]);return _0x16b18e(_0x540e47[_0x731b('0x15')][_0x731b('0x16')]);}else{logger[_0x731b('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x34fb96,_0x731b('0x11'));_0x16b18e(_0x540e47['result'][_0x731b('0x16')]);}})[_0x731b('0x17')](function(_0x4fccc3){logger[_0x731b('0x15')](_0x731b('0x10'),_0x34fb96,_0x4fccc3);_0x259659(_0x4fccc3);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 85880bc..9d400fd 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 _0xad7c=['delete','destroy','exports','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/preview','preview','/:id/run','run','/:id/query','create','put','update'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xad7c,0xae));var _0xcad7=function(_0x17da18,_0x2563e5){_0x17da18=_0x17da18-0x0;var _0x501192=_0xad7c[_0x17da18];return _0x501192;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcad7('0x0'));var timeout=require('connect-timeout');var express=require(_0xcad7('0x1'));var router=express['Router']();var fs_extra=require(_0xcad7('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xcad7('0x3'));var config=require(_0xcad7('0x4'));var controller=require('./analyticDefaultReport.controller');router[_0xcad7('0x5')]('/',auth[_0xcad7('0x6')](),controller['index']);router[_0xcad7('0x5')](_0xcad7('0x7'),auth['isAuthenticated'](),controller['show']);router['get'](_0xcad7('0x8'),auth[_0xcad7('0x6')](),controller[_0xcad7('0x9')]);router[_0xcad7('0x5')](_0xcad7('0xa'),auth[_0xcad7('0x6')](),controller[_0xcad7('0xb')]);router[_0xcad7('0x5')](_0xcad7('0xc'),auth[_0xcad7('0x6')](),controller['query']);router['post']('/',auth[_0xcad7('0x6')](),controller[_0xcad7('0xd')]);router[_0xcad7('0xe')](_0xcad7('0x7'),auth[_0xcad7('0x6')](),controller[_0xcad7('0xf')]);router[_0xcad7('0x10')](_0xcad7('0x7'),auth['isAuthenticated'](),controller[_0xcad7('0x11')]);module[_0xcad7('0x12')]=router; \ No newline at end of file +var _0xd39b=['preview','/:id/run','run','/:id/query','post','create','put','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview'];(function(_0x1c1509,_0x2dfa81){var _0xf11b7=function(_0x17949e){while(--_0x17949e){_0x1c1509['push'](_0x1c1509['shift']());}};_0xf11b7(++_0x2dfa81);}(_0xd39b,0x181));var _0xbd39=function(_0x267df9,_0x58a4a7){_0x267df9=_0x267df9-0x0;var _0x4054a1=_0xd39b[_0x267df9];return _0x4054a1;};'use strict';var multer=require(_0xbd39('0x0'));var util=require('util');var path=require(_0xbd39('0x1'));var timeout=require(_0xbd39('0x2'));var express=require(_0xbd39('0x3'));var router=express['Router']();var fs_extra=require(_0xbd39('0x4'));var auth=require(_0xbd39('0x5'));var interaction=require(_0xbd39('0x6'));var config=require('../../config/environment');var controller=require(_0xbd39('0x7'));router[_0xbd39('0x8')]('/',auth[_0xbd39('0x9')](),controller[_0xbd39('0xa')]);router['get'](_0xbd39('0xb'),auth['isAuthenticated'](),controller[_0xbd39('0xc')]);router[_0xbd39('0x8')](_0xbd39('0xd'),auth[_0xbd39('0x9')](),controller[_0xbd39('0xe')]);router[_0xbd39('0x8')](_0xbd39('0xf'),auth[_0xbd39('0x9')](),controller[_0xbd39('0x10')]);router[_0xbd39('0x8')](_0xbd39('0x11'),auth[_0xbd39('0x9')](),controller['query']);router[_0xbd39('0x12')]('/',auth[_0xbd39('0x9')](),controller[_0xbd39('0x13')]);router[_0xbd39('0x14')](_0xbd39('0xb'),auth[_0xbd39('0x9')](),controller['update']);router['delete'](_0xbd39('0xb'),auth[_0xbd39('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index a7a7def..88b76df 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 _0xbb1f=['scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf','xlsx','csv','DATE','manual'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0xbb1f,0x1bd));var _0xfbb1=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xbb1f[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0xfbb1('0x0'));var moment=require(_0xfbb1('0x1'));module[_0xfbb1('0x2')]={'name':{'type':Sequelize[_0xfbb1('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xfbb1('0x4')]('csv',_0xfbb1('0x5'),_0xfbb1('0x6')),'allowNull':![],'defaultValue':_0xfbb1('0x7')},'savename':{'type':Sequelize[_0xfbb1('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xfbb1('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xfbb1('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xfbb1('0x4')](_0xfbb1('0x9'),_0xfbb1('0xa')),'allowNull':![],'defaultValue':_0xfbb1('0x9')},'reportId':{'type':Sequelize[_0xfbb1('0xb')](0xb)[_0xfbb1('0xc')]},'reportType':{'type':Sequelize[_0xfbb1('0x3')]}}; \ No newline at end of file +var _0xf660=['ENUM','csv','pdf','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','moment','STRING'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xf660,0x106));var _0x0f66=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0xf660[_0x4843f9];return _0x193c6a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0f66('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f66('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x0f66('0x2')](_0x0f66('0x3'),_0x0f66('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x0f66('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0f66('0x5')]},'endDate':{'type':Sequelize[_0x0f66('0x5')]},'status':{'type':Sequelize[_0x0f66('0x1')],'defaultValue':_0x0f66('0x6')},'type':{'type':Sequelize[_0x0f66('0x2')]('manual',_0x0f66('0x7')),'allowNull':![],'defaultValue':_0x0f66('0x8')},'reportId':{'type':Sequelize[_0x0f66('0x9')](0xb)[_0x0f66('0xa')]},'reportType':{'type':Sequelize[_0x0f66('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 4562250..7288968 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 _0xb4f9=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','AnalyticExtractedReport','findAll','rows','catch','params','length','includeAll','options','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4f9,0xab));var _0x9b4f=function(_0x3758dd,_0x3608b9){_0x3758dd=_0x3758dd-0x0;var _0x16ba2f=_0xb4f9[_0x3758dd];return _0x16ba2f;};'use strict';var emlformat=require(_0x9b4f('0x0'));var rimraf=require(_0x9b4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b4f('0x2'));var rp=require(_0x9b4f('0x3'));var moment=require(_0x9b4f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9b4f('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9b4f('0x6'));var ejs=require(_0x9b4f('0x7'));var fs=require('fs');var fs_extra=require(_0x9b4f('0x8'));var _=require(_0x9b4f('0x9'));var squel=require(_0x9b4f('0xa'));var crypto=require(_0x9b4f('0xb'));var jsforce=require(_0x9b4f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b4f('0x6'));var querystring=require(_0x9b4f('0xd'));var Papa=require(_0x9b4f('0xe'));var Redis=require(_0x9b4f('0xf'));var authService=require(_0x9b4f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9b4f('0x11'));var hardwareService=require(_0x9b4f('0x12'));var logger=require('../../config/logger')(_0x9b4f('0x13'));var utils=require(_0x9b4f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9b4f('0x15'));var db=require(_0x9b4f('0x16'))['db'];function respondWithStatusCode(_0x450757,_0x5a8f54){_0x5a8f54=_0x5a8f54||0xcc;return function(_0x3323d6){if(_0x3323d6){return _0x450757[_0x9b4f('0x17')](_0x5a8f54);}return _0x450757['status'](_0x5a8f54)[_0x9b4f('0x18')]();};}function respondWithResult(_0x15b944,_0x2fa2cc){_0x2fa2cc=_0x2fa2cc||0xc8;return function(_0x2f2b61){if(_0x2f2b61){return _0x15b944[_0x9b4f('0x19')](_0x2fa2cc)[_0x9b4f('0x1a')](_0x2f2b61);}};}function respondWithFilteredResult(_0x819243,_0xf409cd){return function(_0x1f2263){if(_0x1f2263){var _0x381bad=typeof _0xf409cd[_0x9b4f('0x1b')]==='undefined'&&typeof _0xf409cd[_0x9b4f('0x1c')]===_0x9b4f('0x1d');var _0xfd6ea3=_0x1f2263['count'];var _0x17f07c=_0x381bad?0x0:_0xf409cd[_0x9b4f('0x1b')];var _0x4052a8=_0x381bad?_0x1f2263[_0x9b4f('0x1e')]:_0xf409cd[_0x9b4f('0x1b')]+_0xf409cd[_0x9b4f('0x1c')];var _0xc0d6d9;if(_0x4052a8>=_0xfd6ea3){_0x4052a8=_0xfd6ea3;_0xc0d6d9=0xc8;}else{_0xc0d6d9=0xce;}_0x819243[_0x9b4f('0x19')](_0xc0d6d9);return _0x819243['set'](_0x9b4f('0x1f'),_0x17f07c+'-'+_0x4052a8+'/'+_0xfd6ea3)['json'](_0x1f2263);}return null;};}function patchUpdates(_0x887388){return function(_0x2e98cf){try{jsonpatch[_0x9b4f('0x20')](_0x2e98cf,_0x887388,!![]);}catch(_0x7d1fef){return BPromise[_0x9b4f('0x21')](_0x7d1fef);}return _0x2e98cf[_0x9b4f('0x22')]();};}function saveUpdates(_0x427ea1,_0x161ffe){return function(_0x2d42ff){if(_0x2d42ff){return _0x2d42ff[_0x9b4f('0x23')](_0x427ea1)[_0x9b4f('0x24')](function(_0x4b16c7){return _0x4b16c7;});}return null;};}function removeEntity(_0x2e5583,_0x2221a4){return function(_0x205912){if(_0x205912){return _0x205912[_0x9b4f('0x25')]()[_0x9b4f('0x24')](function(){var _0x4cfca6=_0x205912['get']({'plain':!![]});var _0x4fdbb6=_0x9b4f('0x26');return db['UserProfileResource'][_0x9b4f('0x25')]({'where':{'type':_0x4fdbb6,'resourceId':_0x4cfca6['id']}})[_0x9b4f('0x24')](function(){return _0x205912;});})[_0x9b4f('0x24')](function(){_0x2e5583['status'](0xcc)[_0x9b4f('0x18')]();});}};}function handleEntityNotFound(_0x177612,_0x44d0ff){return function(_0x460382){if(!_0x460382){_0x177612[_0x9b4f('0x17')](0x194);}return _0x460382;};}function handleError(_0x4293a4,_0xc1c8fa){_0xc1c8fa=_0xc1c8fa||0x1f4;return function(_0x2bd532){logger[_0x9b4f('0x27')](_0x2bd532[_0x9b4f('0x28')]);if(_0x2bd532[_0x9b4f('0x29')]){delete _0x2bd532[_0x9b4f('0x29')];}_0x4293a4['status'](_0xc1c8fa)[_0x9b4f('0x2a')](_0x2bd532);};}exports[_0x9b4f('0x2b')]=function(_0x401d2d,_0x433017){var _0x403424={},_0x511088={},_0x8450d0={'count':0x0,'rows':[]};var _0x267fb5=_[_0x9b4f('0x2c')](db['AnalyticExtractedReport'][_0x9b4f('0x2d')],function(_0xf97538){return{'name':_0xf97538[_0x9b4f('0x2e')],'type':_0xf97538[_0x9b4f('0x2f')][_0x9b4f('0x30')]};});_0x511088[_0x9b4f('0x31')]=_[_0x9b4f('0x2c')](_0x267fb5,_0x9b4f('0x29'));_0x511088[_0x9b4f('0x32')]=_[_0x9b4f('0x33')](_0x401d2d[_0x9b4f('0x32')]);_0x511088['filters']=_[_0x9b4f('0x34')](_0x511088[_0x9b4f('0x31')],_0x511088[_0x9b4f('0x32')]);_0x403424[_0x9b4f('0x35')]=_['intersection'](_0x511088[_0x9b4f('0x31')],qs[_0x9b4f('0x36')](_0x401d2d[_0x9b4f('0x32')][_0x9b4f('0x36')]));_0x403424[_0x9b4f('0x35')]=_0x403424['attributes']['length']?_0x403424[_0x9b4f('0x35')]:_0x511088[_0x9b4f('0x31')];if(!_0x401d2d[_0x9b4f('0x32')]['hasOwnProperty'](_0x9b4f('0x37'))){_0x403424[_0x9b4f('0x1c')]=qs[_0x9b4f('0x1c')](_0x401d2d['query'][_0x9b4f('0x1c')]);_0x403424[_0x9b4f('0x1b')]=qs[_0x9b4f('0x1b')](_0x401d2d[_0x9b4f('0x32')]['offset']);}_0x403424[_0x9b4f('0x38')]=qs[_0x9b4f('0x39')](_0x401d2d[_0x9b4f('0x32')][_0x9b4f('0x39')]);_0x403424[_0x9b4f('0x3a')]=qs[_0x9b4f('0x3b')](_[_0x9b4f('0x3c')](_0x401d2d[_0x9b4f('0x32')],_0x511088[_0x9b4f('0x3b')]),_0x267fb5);if(_0x401d2d['query'][_0x9b4f('0x3d')]){_0x403424[_0x9b4f('0x3a')]=_[_0x9b4f('0x3e')](_0x403424[_0x9b4f('0x3a')],{'$or':_['map'](_0x267fb5,function(_0x309c5a){if(_0x309c5a['type']!==_0x9b4f('0x3f')){var _0x461892={};_0x461892[_0x309c5a['name']]={'$like':'%'+_0x401d2d[_0x9b4f('0x32')][_0x9b4f('0x3d')]+'%'};return _0x461892;}})});}_0x403424=_[_0x9b4f('0x3e')]({},_0x403424,_0x401d2d['options']);var _0x4e0c27={'where':_0x403424[_0x9b4f('0x3a')]};return db[_0x9b4f('0x40')][_0x9b4f('0x1e')](_0x4e0c27)[_0x9b4f('0x24')](function(_0x4dbfa6){_0x8450d0[_0x9b4f('0x1e')]=_0x4dbfa6;if(_0x401d2d[_0x9b4f('0x32')]['includeAll']){_0x403424['include']=[{'all':!![]}];}return db[_0x9b4f('0x40')][_0x9b4f('0x41')](_0x403424);})[_0x9b4f('0x24')](function(_0x295a47){_0x8450d0[_0x9b4f('0x42')]=_0x295a47;return _0x8450d0;})[_0x9b4f('0x24')](respondWithFilteredResult(_0x433017,_0x403424))[_0x9b4f('0x43')](handleError(_0x433017,null));};exports['show']=function(_0x30ac62,_0x311bae){var _0xb635e3={'raw':!![],'where':{'id':_0x30ac62[_0x9b4f('0x44')]['id']}},_0x345ca4={};_0x345ca4[_0x9b4f('0x31')]=_['keys'](db[_0x9b4f('0x40')][_0x9b4f('0x2d')]);_0x345ca4[_0x9b4f('0x32')]=_['keys'](_0x30ac62[_0x9b4f('0x32')]);_0x345ca4[_0x9b4f('0x3b')]=_['intersection'](_0x345ca4['model'],_0x345ca4['query']);_0xb635e3[_0x9b4f('0x35')]=_[_0x9b4f('0x34')](_0x345ca4[_0x9b4f('0x31')],qs[_0x9b4f('0x36')](_0x30ac62['query']['fields']));_0xb635e3[_0x9b4f('0x35')]=_0xb635e3[_0x9b4f('0x35')][_0x9b4f('0x45')]?_0xb635e3['attributes']:_0x345ca4[_0x9b4f('0x31')];if(_0x30ac62[_0x9b4f('0x32')][_0x9b4f('0x46')]){_0xb635e3['include']=[{'all':!![]}];}_0xb635e3=_[_0x9b4f('0x3e')]({},_0xb635e3,_0x30ac62[_0x9b4f('0x47')]);return db[_0x9b4f('0x40')]['find'](_0xb635e3)['then'](handleEntityNotFound(_0x311bae,null))[_0x9b4f('0x24')](respondWithResult(_0x311bae,null))['catch'](handleError(_0x311bae,null));};exports['create']=function(_0x15887d,_0x567fdd){return db[_0x9b4f('0x40')]['create'](_0x15887d[_0x9b4f('0x48')],{})[_0x9b4f('0x24')](function(_0x51caf3){var _0x16dd56=_0x15887d[_0x9b4f('0x49')][_0x9b4f('0x4a')]({'plain':!![]});if(!_0x16dd56)throw new Error(_0x9b4f('0x4b'));if(_0x16dd56[_0x9b4f('0x4c')]===_0x9b4f('0x49')){var _0x40e9f7=_0x51caf3[_0x9b4f('0x4a')]({'plain':!![]});var _0x5dfa55=_0x9b4f('0x26');return db['UserProfileSection'][_0x9b4f('0x4d')]({'where':{'name':_0x5dfa55,'userProfileId':_0x16dd56[_0x9b4f('0x4e')]},'raw':!![]})[_0x9b4f('0x24')](function(_0xda8690){if(_0xda8690&&_0xda8690[_0x9b4f('0x4f')]===0x0){return db[_0x9b4f('0x50')]['create']({'name':_0x40e9f7['name'],'resourceId':_0x40e9f7['id'],'type':_0xda8690[_0x9b4f('0x29')],'sectionId':_0xda8690['id']},{})[_0x9b4f('0x24')](function(){return _0x51caf3;});}else{return _0x51caf3;}})[_0x9b4f('0x43')](function(_0x20de80){logger[_0x9b4f('0x27')](_0x9b4f('0x51'),_0x20de80);throw _0x20de80;});}return _0x51caf3;})[_0x9b4f('0x24')](respondWithResult(_0x567fdd,0xc9))[_0x9b4f('0x43')](handleError(_0x567fdd,null));};exports[_0x9b4f('0x23')]=function(_0x85fcc9,_0x3c1547){if(_0x85fcc9['body']['id']){delete _0x85fcc9[_0x9b4f('0x48')]['id'];}return db[_0x9b4f('0x40')][_0x9b4f('0x4d')]({'where':{'id':_0x85fcc9[_0x9b4f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c1547,null))[_0x9b4f('0x24')](saveUpdates(_0x85fcc9[_0x9b4f('0x48')],null))[_0x9b4f('0x24')](respondWithResult(_0x3c1547,null))[_0x9b4f('0x43')](handleError(_0x3c1547,null));};exports['destroy']=function(_0x6df832,_0xf1c9b7){return db['AnalyticExtractedReport'][_0x9b4f('0x4d')]({'where':{'id':_0x6df832[_0x9b4f('0x44')]['id']}})[_0x9b4f('0x24')](handleEntityNotFound(_0xf1c9b7,null))['then'](removeEntity(_0xf1c9b7,null))['catch'](handleError(_0xf1c9b7,null));};exports['download']=function(_0x23c57f,_0x27b3fe,_0x407b66){return db[_0x9b4f('0x40')][_0x9b4f('0x4d')]({'where':{'id':_0x23c57f[_0x9b4f('0x44')]['id']},'attributes':['name',_0x9b4f('0x52'),'savename',_0x9b4f('0x53')],'raw':!![]})[_0x9b4f('0x24')](handleEntityNotFound(_0x27b3fe,null))[_0x9b4f('0x24')](function(_0x41ac22){if(_0x41ac22){if(!fs['existsSync'](path[_0x9b4f('0x54')](config[_0x9b4f('0x55')],_0x9b4f('0x56'),_0x41ac22['savename']))){throw new db[(_0x9b4f('0x57'))][(_0x9b4f('0x58'))](_0x9b4f('0x59'));}if(_0x23c57f[_0x9b4f('0x32')][_0x9b4f('0x5a')]){return _0x27b3fe['sendStatus'](0xc8);}return _0x27b3fe['download'](path[_0x9b4f('0x54')](config[_0x9b4f('0x55')],_0x9b4f('0x56'),_0x41ac22[_0x9b4f('0x5b')]),util[_0x9b4f('0x5c')](_0x9b4f('0x5d'),_0x41ac22[_0x9b4f('0x52')]||_0x41ac22[_0x9b4f('0x29')],_0x41ac22[_0x9b4f('0x53')][_0x9b4f('0x5e')]()));}})['catch'](handleError(_0x27b3fe,null));}; \ No newline at end of file +var _0x3e28=['name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','download','basename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','exists','root','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack'];(function(_0xc7fbe7,_0x553b01){var _0x7c4e0c=function(_0x228441){while(--_0x228441){_0xc7fbe7['push'](_0xc7fbe7['shift']());}};_0x7c4e0c(++_0x553b01);}(_0x3e28,0x14a));var _0x83e2=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3e28[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x83e2('0x0'));var rimraf=require(_0x83e2('0x1'));var zipdir=require(_0x83e2('0x2'));var jsonpatch=require(_0x83e2('0x3'));var rp=require(_0x83e2('0x4'));var moment=require(_0x83e2('0x5'));var BPromise=require(_0x83e2('0x6'));var Mustache=require(_0x83e2('0x7'));var util=require('util');var path=require('path');var sox=require(_0x83e2('0x8'));var csv=require(_0x83e2('0x9'));var ejs=require(_0x83e2('0xa'));var fs=require('fs');var fs_extra=require(_0x83e2('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x83e2('0xc'));var jsforce=require(_0x83e2('0xd'));var deskjs=require(_0x83e2('0xe'));var toCsv=require(_0x83e2('0x9'));var querystring=require(_0x83e2('0xf'));var Papa=require(_0x83e2('0x10'));var Redis=require(_0x83e2('0x11'));var authService=require(_0x83e2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x83e2('0x13'));var hardwareService=require(_0x83e2('0x14'));var logger=require(_0x83e2('0x15'))('api');var utils=require(_0x83e2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x160a0d,_0x26dfce){_0x26dfce=_0x26dfce||0xcc;return function(_0x53a340){if(_0x53a340){return _0x160a0d[_0x83e2('0x17')](_0x26dfce);}return _0x160a0d[_0x83e2('0x18')](_0x26dfce)[_0x83e2('0x19')]();};}function respondWithResult(_0x5606b6,_0x3b2f99){_0x3b2f99=_0x3b2f99||0xc8;return function(_0x3f50ef){if(_0x3f50ef){return _0x5606b6[_0x83e2('0x18')](_0x3b2f99)[_0x83e2('0x1a')](_0x3f50ef);}};}function respondWithFilteredResult(_0xd8d6ca,_0xd40fc8){return function(_0x2e6c37){if(_0x2e6c37){var _0x38e9f6=typeof _0xd40fc8[_0x83e2('0x1b')]==='undefined'&&typeof _0xd40fc8['limit']===_0x83e2('0x1c');var _0x3466db=_0x2e6c37[_0x83e2('0x1d')];var _0xcb2c5e=_0x38e9f6?0x0:_0xd40fc8[_0x83e2('0x1b')];var _0x4565e5=_0x38e9f6?_0x2e6c37[_0x83e2('0x1d')]:_0xd40fc8[_0x83e2('0x1b')]+_0xd40fc8[_0x83e2('0x1e')];var _0x3a4c6f;if(_0x4565e5>=_0x3466db){_0x4565e5=_0x3466db;_0x3a4c6f=0xc8;}else{_0x3a4c6f=0xce;}_0xd8d6ca['status'](_0x3a4c6f);return _0xd8d6ca[_0x83e2('0x1f')]('Content-Range',_0xcb2c5e+'-'+_0x4565e5+'/'+_0x3466db)['json'](_0x2e6c37);}return null;};}function patchUpdates(_0x44593f){return function(_0x4f4d2d){try{jsonpatch[_0x83e2('0x20')](_0x4f4d2d,_0x44593f,!![]);}catch(_0x10686d){return BPromise[_0x83e2('0x21')](_0x10686d);}return _0x4f4d2d[_0x83e2('0x22')]();};}function saveUpdates(_0x3839ad,_0x22ff35){return function(_0x5c42fa){if(_0x5c42fa){return _0x5c42fa[_0x83e2('0x23')](_0x3839ad)[_0x83e2('0x24')](function(_0x2257c4){return _0x2257c4;});}return null;};}function removeEntity(_0x2add80,_0x2f3a5f){return function(_0x1d4db3){if(_0x1d4db3){return _0x1d4db3[_0x83e2('0x25')]()[_0x83e2('0x24')](function(){var _0x2d293d=_0x1d4db3[_0x83e2('0x26')]({'plain':!![]});var _0x2b52a4=_0x83e2('0x27');return db[_0x83e2('0x28')][_0x83e2('0x25')]({'where':{'type':_0x2b52a4,'resourceId':_0x2d293d['id']}})[_0x83e2('0x24')](function(){return _0x1d4db3;});})[_0x83e2('0x24')](function(){_0x2add80[_0x83e2('0x18')](0xcc)[_0x83e2('0x19')]();});}};}function handleEntityNotFound(_0x33dcb8,_0x34957a){return function(_0x14c144){if(!_0x14c144){_0x33dcb8['sendStatus'](0x194);}return _0x14c144;};}function handleError(_0x332f47,_0x1b49e1){_0x1b49e1=_0x1b49e1||0x1f4;return function(_0x158b7f){logger['error'](_0x158b7f[_0x83e2('0x29')]);if(_0x158b7f[_0x83e2('0x2a')]){delete _0x158b7f[_0x83e2('0x2a')];}_0x332f47['status'](_0x1b49e1)[_0x83e2('0x2b')](_0x158b7f);};}exports[_0x83e2('0x2c')]=function(_0x14bad7,_0x1f000e){var _0x13dd2f={},_0x478893={},_0x2d2533={'count':0x0,'rows':[]};var _0x2a78dd=_[_0x83e2('0x2d')](db[_0x83e2('0x2e')][_0x83e2('0x2f')],function(_0x5ee8dc){return{'name':_0x5ee8dc[_0x83e2('0x30')],'type':_0x5ee8dc[_0x83e2('0x31')][_0x83e2('0x32')]};});_0x478893[_0x83e2('0x33')]=_['map'](_0x2a78dd,'name');_0x478893[_0x83e2('0x34')]=_['keys'](_0x14bad7[_0x83e2('0x34')]);_0x478893[_0x83e2('0x35')]=_['intersection'](_0x478893[_0x83e2('0x33')],_0x478893[_0x83e2('0x34')]);_0x13dd2f[_0x83e2('0x36')]=_[_0x83e2('0x37')](_0x478893[_0x83e2('0x33')],qs[_0x83e2('0x38')](_0x14bad7[_0x83e2('0x34')][_0x83e2('0x38')]));_0x13dd2f[_0x83e2('0x36')]=_0x13dd2f[_0x83e2('0x36')]['length']?_0x13dd2f[_0x83e2('0x36')]:_0x478893[_0x83e2('0x33')];if(!_0x14bad7['query'][_0x83e2('0x39')](_0x83e2('0x3a'))){_0x13dd2f[_0x83e2('0x1e')]=qs['limit'](_0x14bad7[_0x83e2('0x34')][_0x83e2('0x1e')]);_0x13dd2f[_0x83e2('0x1b')]=qs['offset'](_0x14bad7['query'][_0x83e2('0x1b')]);}_0x13dd2f['order']=qs[_0x83e2('0x3b')](_0x14bad7['query']['sort']);_0x13dd2f[_0x83e2('0x3c')]=qs[_0x83e2('0x35')](_[_0x83e2('0x3d')](_0x14bad7[_0x83e2('0x34')],_0x478893[_0x83e2('0x35')]),_0x2a78dd);if(_0x14bad7[_0x83e2('0x34')][_0x83e2('0x3e')]){_0x13dd2f['where']=_['merge'](_0x13dd2f['where'],{'$or':_[_0x83e2('0x2d')](_0x2a78dd,function(_0x50d53e){if(_0x50d53e[_0x83e2('0x31')]!=='VIRTUAL'){var _0x2135e5={};_0x2135e5[_0x50d53e[_0x83e2('0x2a')]]={'$like':'%'+_0x14bad7[_0x83e2('0x34')]['filter']+'%'};return _0x2135e5;}})});}_0x13dd2f=_[_0x83e2('0x3f')]({},_0x13dd2f,_0x14bad7[_0x83e2('0x40')]);var _0xe141fe={'where':_0x13dd2f[_0x83e2('0x3c')]};return db[_0x83e2('0x2e')][_0x83e2('0x1d')](_0xe141fe)[_0x83e2('0x24')](function(_0x77f616){_0x2d2533[_0x83e2('0x1d')]=_0x77f616;if(_0x14bad7['query'][_0x83e2('0x41')]){_0x13dd2f[_0x83e2('0x42')]=[{'all':!![]}];}return db[_0x83e2('0x2e')][_0x83e2('0x43')](_0x13dd2f);})[_0x83e2('0x24')](function(_0x26eb0a){_0x2d2533['rows']=_0x26eb0a;return _0x2d2533;})['then'](respondWithFilteredResult(_0x1f000e,_0x13dd2f))[_0x83e2('0x44')](handleError(_0x1f000e,null));};exports[_0x83e2('0x45')]=function(_0x3f952e,_0x552815){var _0x3ba007={'raw':!![],'where':{'id':_0x3f952e[_0x83e2('0x46')]['id']}},_0x4621f9={};_0x4621f9[_0x83e2('0x33')]=_['keys'](db[_0x83e2('0x2e')]['rawAttributes']);_0x4621f9['query']=_[_0x83e2('0x47')](_0x3f952e[_0x83e2('0x34')]);_0x4621f9[_0x83e2('0x35')]=_[_0x83e2('0x37')](_0x4621f9['model'],_0x4621f9[_0x83e2('0x34')]);_0x3ba007['attributes']=_[_0x83e2('0x37')](_0x4621f9[_0x83e2('0x33')],qs[_0x83e2('0x38')](_0x3f952e[_0x83e2('0x34')][_0x83e2('0x38')]));_0x3ba007[_0x83e2('0x36')]=_0x3ba007[_0x83e2('0x36')][_0x83e2('0x48')]?_0x3ba007[_0x83e2('0x36')]:_0x4621f9[_0x83e2('0x33')];if(_0x3f952e[_0x83e2('0x34')][_0x83e2('0x41')]){_0x3ba007[_0x83e2('0x42')]=[{'all':!![]}];}_0x3ba007=_['merge']({},_0x3ba007,_0x3f952e[_0x83e2('0x40')]);return db[_0x83e2('0x2e')][_0x83e2('0x49')](_0x3ba007)[_0x83e2('0x24')](handleEntityNotFound(_0x552815,null))['then'](respondWithResult(_0x552815,null))['catch'](handleError(_0x552815,null));};exports[_0x83e2('0x4a')]=function(_0x3f2942,_0x573077){return db[_0x83e2('0x2e')][_0x83e2('0x4a')](_0x3f2942[_0x83e2('0x4b')],{})['then'](function(_0x10402f){var _0x1f41a6=_0x3f2942[_0x83e2('0x4c')][_0x83e2('0x26')]({'plain':!![]});if(!_0x1f41a6)throw new Error(_0x83e2('0x4d'));if(_0x1f41a6['role']===_0x83e2('0x4c')){var _0x353ac7=_0x10402f['get']({'plain':!![]});var _0x396d5e=_0x83e2('0x27');return db[_0x83e2('0x4e')]['find']({'where':{'name':_0x396d5e,'userProfileId':_0x1f41a6[_0x83e2('0x4f')]},'raw':!![]})['then'](function(_0x4c308b){if(_0x4c308b&&_0x4c308b['autoAssociation']===0x0){return db[_0x83e2('0x28')][_0x83e2('0x4a')]({'name':_0x353ac7[_0x83e2('0x2a')],'resourceId':_0x353ac7['id'],'type':_0x4c308b[_0x83e2('0x2a')],'sectionId':_0x4c308b['id']},{})['then'](function(){return _0x10402f;});}else{return _0x10402f;}})[_0x83e2('0x44')](function(_0x23a573){logger[_0x83e2('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23a573);throw _0x23a573;});}return _0x10402f;})[_0x83e2('0x24')](respondWithResult(_0x573077,0xc9))[_0x83e2('0x44')](handleError(_0x573077,null));};exports['update']=function(_0x13e7f4,_0x461850){if(_0x13e7f4['body']['id']){delete _0x13e7f4['body']['id'];}return db[_0x83e2('0x2e')][_0x83e2('0x49')]({'where':{'id':_0x13e7f4[_0x83e2('0x46')]['id']}})['then'](handleEntityNotFound(_0x461850,null))['then'](saveUpdates(_0x13e7f4[_0x83e2('0x4b')],null))['then'](respondWithResult(_0x461850,null))['catch'](handleError(_0x461850,null));};exports[_0x83e2('0x25')]=function(_0x26e24b,_0xb6322c){return db[_0x83e2('0x2e')]['find']({'where':{'id':_0x26e24b[_0x83e2('0x46')]['id']}})[_0x83e2('0x24')](handleEntityNotFound(_0xb6322c,null))['then'](removeEntity(_0xb6322c,null))[_0x83e2('0x44')](handleError(_0xb6322c,null));};exports[_0x83e2('0x51')]=function(_0x32d6d8,_0x2c3cda,_0x24c951){return db[_0x83e2('0x2e')]['find']({'where':{'id':_0x32d6d8['params']['id']},'attributes':['name',_0x83e2('0x52'),'savename',_0x83e2('0x53')],'raw':!![]})[_0x83e2('0x24')](handleEntityNotFound(_0x2c3cda,null))[_0x83e2('0x24')](function(_0x26fceb){if(_0x26fceb){if(!fs[_0x83e2('0x54')](path[_0x83e2('0x55')](config['root'],_0x83e2('0x56'),_0x26fceb['savename']))){throw new db[(_0x83e2('0x57'))][(_0x83e2('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x32d6d8['query'][_0x83e2('0x59')]){return _0x2c3cda[_0x83e2('0x17')](0xc8);}return _0x2c3cda['download'](path[_0x83e2('0x55')](config[_0x83e2('0x5a')],_0x83e2('0x56'),_0x26fceb['savename']),util['format'](_0x83e2('0x5b'),_0x26fceb[_0x83e2('0x52')]||_0x26fceb[_0x83e2('0x2a')],_0x26fceb['output'][_0x83e2('0x5c')]()));}})[_0x83e2('0x44')](handleError(_0x2c3cda,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index f4ed8ba..83d9ae1 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 _0x4aff=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','lodash','util'];(function(_0x39b11b,_0x2435c2){var _0x4d6e84=function(_0x3ce0b6){while(--_0x3ce0b6){_0x39b11b['push'](_0x39b11b['shift']());}};_0x4d6e84(++_0x2435c2);}(_0x4aff,0xc1));var _0xf4af=function(_0x313c92,_0x5d9943){_0x313c92=_0x313c92-0x0;var _0x8ddf39=_0x4aff[_0x313c92];return _0x8ddf39;};'use strict';var _=require(_0xf4af('0x0'));var util=require(_0xf4af('0x1'));var logger=require(_0xf4af('0x2'))(_0xf4af('0x3'));var moment=require(_0xf4af('0x4'));var BPromise=require(_0xf4af('0x5'));var rp=require(_0xf4af('0x6'));var fs=require('fs');var path=require(_0xf4af('0x7'));var rimraf=require(_0xf4af('0x8'));var config=require(_0xf4af('0x9'));var attributes=require(_0xf4af('0xa'));module[_0xf4af('0xb')]=function(_0xf9f81d,_0xb2e354){return _0xf9f81d['define'](_0xf4af('0xc'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5169=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','rimraf','../../config/environment','exports','define'];(function(_0x1187ee,_0x11f291){var _0x4ff316=function(_0x10691c){while(--_0x10691c){_0x1187ee['push'](_0x1187ee['shift']());}};_0x4ff316(++_0x11f291);}(_0x5169,0x16a));var _0x9516=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x5169[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x9516('0x0'));var util=require(_0x9516('0x1'));var logger=require('../../config/logger')(_0x9516('0x2'));var moment=require(_0x9516('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9516('0x4'));var config=require(_0x9516('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0x9516('0x6')]=function(_0x1d8ba7,_0x171855){return _0x1d8ba7[_0x9516('0x7')](_0x9516('0x8'),attributes,{'tableName':_0x9516('0x9'),'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 615449a..f364ee9 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 _0x365c=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x365c,0x1d5));var _0xc365=function(_0x5b58f2,_0x2431af){_0x5b58f2=_0x5b58f2-0x0;var _0x41e066=_0x365c[_0x5b58f2];return _0x41e066;};'use strict';var _=require(_0xc365('0x0'));var util=require('util');var moment=require(_0xc365('0x1'));var BPromise=require(_0xc365('0x2'));var rs=require(_0xc365('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc365('0x4'))['db'];var utils=require(_0xc365('0x5'));var logger=require(_0xc365('0x6'))(_0xc365('0x7'));var config=require(_0xc365('0x8'));var jayson=require(_0xc365('0x9'));var client=jayson[_0xc365('0xa')][_0xc365('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x91976b,_0x44427e,_0x684752){return new BPromise(function(_0x2b22cf,_0x303ebb){return client['request'](_0x91976b,_0x684752)[_0xc365('0xc')](function(_0x4ae332){logger[_0xc365('0xd')](_0xc365('0xe'),_0x44427e,_0xc365('0xf'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x44427e,_0xc365('0xf'),JSON[_0xc365('0x10')](_0x4ae332));if(_0x4ae332[_0xc365('0x11')]){if(_0x4ae332[_0xc365('0x11')][_0xc365('0x12')]===0x1f4){logger[_0xc365('0x11')](_0xc365('0xe'),_0x44427e,_0x4ae332['error']['message']);return _0x303ebb(_0x4ae332[_0xc365('0x11')]['message']);}logger[_0xc365('0x11')](_0xc365('0xe'),_0x44427e,_0x4ae332['error']['message']);return _0x2b22cf(_0x4ae332[_0xc365('0x11')][_0xc365('0x13')]);}else{logger[_0xc365('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x44427e,_0xc365('0xf'));_0x2b22cf(_0x4ae332[_0xc365('0x14')]['message']);}})[_0xc365('0x15')](function(_0x11412d){logger[_0xc365('0x11')](_0xc365('0xe'),_0x44427e,_0x11412d);_0x303ebb(_0x11412d);});});} \ No newline at end of file +var _0x1b8f=['catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x510cd9,_0x551300){var _0x2b1f61=function(_0x345249){while(--_0x345249){_0x510cd9['push'](_0x510cd9['shift']());}};_0x2b1f61(++_0x551300);}(_0x1b8f,0x8b));var _0xf1b8=function(_0x3d685b,_0x13b983){_0x3d685b=_0x3d685b-0x0;var _0x4fb0d4=_0x1b8f[_0x3d685b];return _0x4fb0d4;};'use strict';var _=require('lodash');var util=require(_0xf1b8('0x0'));var moment=require('moment');var BPromise=require(_0xf1b8('0x1'));var rs=require(_0xf1b8('0x2'));var fs=require('fs');var Redis=require(_0xf1b8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1b8('0x4'));var logger=require(_0xf1b8('0x5'))(_0xf1b8('0x6'));var config=require(_0xf1b8('0x7'));var jayson=require(_0xf1b8('0x8'));var client=jayson[_0xf1b8('0x9')][_0xf1b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58f761,_0x5a2087,_0x26538e){return new BPromise(function(_0x1b8c35,_0x2c9f56){return client[_0xf1b8('0xb')](_0x58f761,_0x26538e)[_0xf1b8('0xc')](function(_0x2967b3){logger['info'](_0xf1b8('0xd'),_0x5a2087,_0xf1b8('0xe'));logger[_0xf1b8('0xf')](_0xf1b8('0x10'),_0x5a2087,_0xf1b8('0xe'),JSON['stringify'](_0x2967b3));if(_0x2967b3[_0xf1b8('0x11')]){if(_0x2967b3[_0xf1b8('0x11')][_0xf1b8('0x12')]===0x1f4){logger[_0xf1b8('0x11')](_0xf1b8('0xd'),_0x5a2087,_0x2967b3['error'][_0xf1b8('0x13')]);return _0x2c9f56(_0x2967b3[_0xf1b8('0x11')][_0xf1b8('0x13')]);}logger['error'](_0xf1b8('0xd'),_0x5a2087,_0x2967b3['error'][_0xf1b8('0x13')]);return _0x1b8c35(_0x2967b3[_0xf1b8('0x11')][_0xf1b8('0x13')]);}else{logger[_0xf1b8('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5a2087,_0xf1b8('0xe'));_0x1b8c35(_0x2967b3[_0xf1b8('0x15')][_0xf1b8('0x13')]);}})[_0xf1b8('0x16')](function(_0x4621ba){logger['error'](_0xf1b8('0xd'),_0x5a2087,_0x4621ba);_0x2c9f56(_0x4621ba);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 58d5883..21ca81f 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 _0x1cb1=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','get','/:id/download','download','post','create'];(function(_0x48e675,_0x270383){var _0x260d65=function(_0x14509d){while(--_0x14509d){_0x48e675['push'](_0x48e675['shift']());}};_0x260d65(++_0x270383);}(_0x1cb1,0x165));var _0x11cb=function(_0x31bcec,_0x22d9b9){_0x31bcec=_0x31bcec-0x0;var _0x595821=_0x1cb1[_0x31bcec];return _0x595821;};'use strict';var multer=require('multer');var util=require(_0x11cb('0x0'));var path=require(_0x11cb('0x1'));var timeout=require(_0x11cb('0x2'));var express=require(_0x11cb('0x3'));var router=express[_0x11cb('0x4')]();var fs_extra=require(_0x11cb('0x5'));var auth=require(_0x11cb('0x6'));var interaction=require(_0x11cb('0x7'));var config=require(_0x11cb('0x8'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x11cb('0x9')](),controller[_0x11cb('0xa')]);router['get'](_0x11cb('0xb'),auth[_0x11cb('0x9')](),controller['show']);router[_0x11cb('0xc')](_0x11cb('0xd'),auth['isAuthenticated'](),controller[_0x11cb('0xe')]);router[_0x11cb('0xf')]('/',auth[_0x11cb('0x9')](),controller[_0x11cb('0x10')]);router[_0x11cb('0x11')]('/:id',auth[_0x11cb('0x9')](),controller[_0x11cb('0x12')]);router[_0x11cb('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x11cb('0x14')]);module[_0x11cb('0x15')]=router; \ No newline at end of file +var _0x3da4=['download','post','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x4955fa,_0x2e654c){var _0x9a2fd7=function(_0x3f3756){while(--_0x3f3756){_0x4955fa['push'](_0x4955fa['shift']());}};_0x9a2fd7(++_0x2e654c);}(_0x3da4,0x182));var _0x43da=function(_0xe15f5a,_0x2e028e){_0xe15f5a=_0xe15f5a-0x0;var _0xef92a1=_0x3da4[_0xe15f5a];return _0xef92a1;};'use strict';var multer=require(_0x43da('0x0'));var util=require(_0x43da('0x1'));var path=require(_0x43da('0x2'));var timeout=require('connect-timeout');var express=require(_0x43da('0x3'));var router=express['Router']();var fs_extra=require(_0x43da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x43da('0x5'));var config=require(_0x43da('0x6'));var controller=require(_0x43da('0x7'));router[_0x43da('0x8')]('/',auth[_0x43da('0x9')](),controller[_0x43da('0xa')]);router[_0x43da('0x8')](_0x43da('0xb'),auth[_0x43da('0x9')](),controller[_0x43da('0xc')]);router[_0x43da('0x8')](_0x43da('0xd'),auth['isAuthenticated'](),controller[_0x43da('0xe')]);router[_0x43da('0xf')]('/',auth[_0x43da('0x9')](),controller['create']);router[_0x43da('0x10')](_0x43da('0xb'),auth[_0x43da('0x9')](),controller[_0x43da('0x11')]);router[_0x43da('0x12')](_0x43da('0xb'),auth['isAuthenticated'](),controller[_0x43da('0x13')]);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 3ee93e3..88439df 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 _0x9bc3=['sequelize','exports','TEXT','STRING'];(function(_0x5ed55e,_0x332aac){var _0x8cb4ef=function(_0x3919ab){while(--_0x3919ab){_0x5ed55e['push'](_0x5ed55e['shift']());}};_0x8cb4ef(++_0x332aac);}(_0x9bc3,0x120));var _0x39bc=function(_0x1cfc64,_0x49087e){_0x1cfc64=_0x1cfc64-0x0;var _0x295e1b=_0x9bc3[_0x1cfc64];return _0x295e1b;};'use strict';var Sequelize=require(_0x39bc('0x0'));module[_0x39bc('0x1')]={'field':{'type':Sequelize[_0x39bc('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x39bc('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x39bc('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1dee=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3f07d1,_0x90c878){var _0x19502c=function(_0x971b0d){while(--_0x971b0d){_0x3f07d1['push'](_0x3f07d1['shift']());}};_0x19502c(++_0x90c878);}(_0x1dee,0xe1));var _0xe1de=function(_0x3c5ce3,_0x18c28e){_0x3c5ce3=_0x3c5ce3-0x0;var _0x4dc6dd=_0x1dee[_0x3c5ce3];return _0x4dc6dd;};'use strict';var Sequelize=require(_0xe1de('0x0'));module[_0xe1de('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xe1de('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xe1de('0x2')]},'groupBy':{'type':Sequelize[_0xe1de('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe1de('0x2')]},'custom':{'type':Sequelize[_0xe1de('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 22eb048..40663e1 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 _0xaf3a=['ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','bulkCreate','update','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaf3a,0x13f));var _0xaaf3=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xaf3a[_0x2459fd];return _0x364cd2;};'use strict';var emlformat=require(_0xaaf3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaaf3('0x1'));var jsonpatch=require(_0xaaf3('0x2'));var rp=require('request-promise');var moment=require(_0xaaf3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaaf3('0x4'));var util=require(_0xaaf3('0x5'));var path=require(_0xaaf3('0x6'));var sox=require(_0xaaf3('0x7'));var csv=require(_0xaaf3('0x8'));var ejs=require(_0xaaf3('0x9'));var fs=require('fs');var fs_extra=require(_0xaaf3('0xa'));var _=require(_0xaaf3('0xb'));var squel=require(_0xaaf3('0xc'));var crypto=require(_0xaaf3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaaf3('0xe'));var Papa=require(_0xaaf3('0xf'));var Redis=require(_0xaaf3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xaaf3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaaf3('0x12'))('api');var utils=require(_0xaaf3('0x13'));var config=require(_0xaaf3('0x14'));var licenseUtil=require(_0xaaf3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe7d413,_0x316c68){_0x316c68=_0x316c68||0xcc;return function(_0x24fa1f){if(_0x24fa1f){return _0xe7d413[_0xaaf3('0x16')](_0x316c68);}return _0xe7d413[_0xaaf3('0x17')](_0x316c68)[_0xaaf3('0x18')]();};}function respondWithResult(_0x5062fe,_0x2536dc){_0x2536dc=_0x2536dc||0xc8;return function(_0x11a96f){if(_0x11a96f){return _0x5062fe['status'](_0x2536dc)[_0xaaf3('0x19')](_0x11a96f);}};}function respondWithFilteredResult(_0x1fcab6,_0x4a389c){return function(_0x40501e){if(_0x40501e){var _0x3e8b97=typeof _0x4a389c[_0xaaf3('0x1a')]===_0xaaf3('0x1b')&&typeof _0x4a389c[_0xaaf3('0x1c')]===_0xaaf3('0x1b');var _0x67e5a5=_0x40501e[_0xaaf3('0x1d')];var _0x492e18=_0x3e8b97?0x0:_0x4a389c[_0xaaf3('0x1a')];var _0x49bd25=_0x3e8b97?_0x40501e[_0xaaf3('0x1d')]:_0x4a389c[_0xaaf3('0x1a')]+_0x4a389c[_0xaaf3('0x1c')];var _0x3ae6b1;if(_0x49bd25>=_0x67e5a5){_0x49bd25=_0x67e5a5;_0x3ae6b1=0xc8;}else{_0x3ae6b1=0xce;}_0x1fcab6[_0xaaf3('0x17')](_0x3ae6b1);return _0x1fcab6[_0xaaf3('0x1e')]('Content-Range',_0x492e18+'-'+_0x49bd25+'/'+_0x67e5a5)[_0xaaf3('0x19')](_0x40501e);}return null;};}function patchUpdates(_0x2d6184){return function(_0x4006d9){try{jsonpatch[_0xaaf3('0x1f')](_0x4006d9,_0x2d6184,!![]);}catch(_0x255f0e){return BPromise[_0xaaf3('0x20')](_0x255f0e);}return _0x4006d9[_0xaaf3('0x21')]();};}function saveUpdates(_0x46618d,_0x6c8a72){return function(_0x2066a5){if(_0x2066a5){return _0x2066a5['update'](_0x46618d)[_0xaaf3('0x22')](function(_0x5f1f61){return _0x5f1f61;});}return null;};}function removeEntity(_0x3472ce,_0x16adbc){return function(_0x3d4dc7){if(_0x3d4dc7){return _0x3d4dc7['destroy']()[_0xaaf3('0x22')](function(){_0x3472ce[_0xaaf3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f52c1,_0x2c5fff){return function(_0x42332f){if(!_0x42332f){_0x1f52c1[_0xaaf3('0x16')](0x194);}return _0x42332f;};}function handleError(_0x2df858,_0x3a1643){_0x3a1643=_0x3a1643||0x1f4;return function(_0x1e702e){logger[_0xaaf3('0x23')](_0x1e702e['stack']);if(_0x1e702e[_0xaaf3('0x24')]){delete _0x1e702e['name'];}_0x2df858['status'](_0x3a1643)[_0xaaf3('0x25')](_0x1e702e);};}exports[_0xaaf3('0x26')]=function(_0x4da8b7,_0x41984a){var _0x2438f2={},_0x483a37={},_0x4b6987={'count':0x0,'rows':[]};var _0x1d4ef0=_[_0xaaf3('0x27')](db[_0xaaf3('0x28')][_0xaaf3('0x29')],function(_0x2f6ad2){return{'name':_0x2f6ad2[_0xaaf3('0x2a')],'type':_0x2f6ad2['type'][_0xaaf3('0x2b')]};});_0x483a37[_0xaaf3('0x2c')]=_[_0xaaf3('0x27')](_0x1d4ef0,_0xaaf3('0x24'));_0x483a37[_0xaaf3('0x2d')]=_[_0xaaf3('0x2e')](_0x4da8b7[_0xaaf3('0x2d')]);_0x483a37[_0xaaf3('0x2f')]=_[_0xaaf3('0x30')](_0x483a37[_0xaaf3('0x2c')],_0x483a37[_0xaaf3('0x2d')]);_0x2438f2[_0xaaf3('0x31')]=_[_0xaaf3('0x30')](_0x483a37['model'],qs['fields'](_0x4da8b7[_0xaaf3('0x2d')]['fields']));_0x2438f2[_0xaaf3('0x31')]=_0x2438f2[_0xaaf3('0x31')][_0xaaf3('0x32')]?_0x2438f2[_0xaaf3('0x31')]:_0x483a37[_0xaaf3('0x2c')];if(!_0x4da8b7[_0xaaf3('0x2d')][_0xaaf3('0x33')](_0xaaf3('0x34'))){_0x2438f2[_0xaaf3('0x1c')]=qs[_0xaaf3('0x1c')](_0x4da8b7[_0xaaf3('0x2d')][_0xaaf3('0x1c')]);_0x2438f2['offset']=qs[_0xaaf3('0x1a')](_0x4da8b7['query']['offset']);}_0x2438f2[_0xaaf3('0x35')]=qs['sort'](_0x4da8b7['query'][_0xaaf3('0x36')]);_0x2438f2[_0xaaf3('0x37')]=qs['filters'](_['pick'](_0x4da8b7[_0xaaf3('0x2d')],_0x483a37[_0xaaf3('0x2f')]),_0x1d4ef0);if(_0x4da8b7[_0xaaf3('0x2d')][_0xaaf3('0x38')]){_0x2438f2['where']=_['merge'](_0x2438f2[_0xaaf3('0x37')],{'$or':_[_0xaaf3('0x27')](_0x1d4ef0,function(_0x2e2325){if(_0x2e2325[_0xaaf3('0x39')]!==_0xaaf3('0x3a')){var _0x29e059={};_0x29e059[_0x2e2325[_0xaaf3('0x24')]]={'$like':'%'+_0x4da8b7[_0xaaf3('0x2d')][_0xaaf3('0x38')]+'%'};return _0x29e059;}})});}_0x2438f2=_[_0xaaf3('0x3b')]({},_0x2438f2,_0x4da8b7[_0xaaf3('0x3c')]);var _0x52aa8e={'where':_0x2438f2['where']};return db[_0xaaf3('0x28')][_0xaaf3('0x1d')](_0x52aa8e)[_0xaaf3('0x22')](function(_0x1eefac){_0x4b6987[_0xaaf3('0x1d')]=_0x1eefac;if(_0x4da8b7['query'][_0xaaf3('0x3d')]){_0x2438f2[_0xaaf3('0x3e')]=[{'all':!![]}];}return db[_0xaaf3('0x28')][_0xaaf3('0x3f')](_0x2438f2);})[_0xaaf3('0x22')](function(_0x4c7eb9){_0x4b6987[_0xaaf3('0x40')]=_0x4c7eb9;return _0x4b6987;})[_0xaaf3('0x22')](respondWithFilteredResult(_0x41984a,_0x2438f2))[_0xaaf3('0x41')](handleError(_0x41984a,null));};exports[_0xaaf3('0x42')]=function(_0x36d68b,_0x301912){var _0x553f29={'raw':![],'where':{'id':_0x36d68b[_0xaaf3('0x43')]['id']}},_0x4c81c3={};_0x4c81c3['model']=_['keys'](db[_0xaaf3('0x28')]['rawAttributes']);_0x4c81c3['query']=_[_0xaaf3('0x2e')](_0x36d68b[_0xaaf3('0x2d')]);_0x4c81c3[_0xaaf3('0x2f')]=_[_0xaaf3('0x30')](_0x4c81c3[_0xaaf3('0x2c')],_0x4c81c3['query']);_0x553f29[_0xaaf3('0x31')]=_[_0xaaf3('0x30')](_0x4c81c3[_0xaaf3('0x2c')],qs[_0xaaf3('0x44')](_0x36d68b[_0xaaf3('0x2d')][_0xaaf3('0x44')]));_0x553f29[_0xaaf3('0x31')]=_0x553f29[_0xaaf3('0x31')]['length']?_0x553f29[_0xaaf3('0x31')]:_0x4c81c3[_0xaaf3('0x2c')];if(_0x36d68b[_0xaaf3('0x2d')][_0xaaf3('0x3d')]){_0x553f29[_0xaaf3('0x3e')]=[{'all':!![]}];}_0x553f29=_[_0xaaf3('0x3b')]({},_0x553f29,_0x36d68b['options']);return db[_0xaaf3('0x28')][_0xaaf3('0x45')](_0x553f29)[_0xaaf3('0x22')](handleEntityNotFound(_0x301912,null))[_0xaaf3('0x22')](respondWithResult(_0x301912,null))['catch'](handleError(_0x301912,null));};exports[_0xaaf3('0x46')]=function(_0x54975f,_0x3683be){return db[_0xaaf3('0x28')][_0xaaf3('0x46')](_0x54975f[_0xaaf3('0x47')],{})[_0xaaf3('0x22')](respondWithResult(_0x3683be,0xc9))[_0xaaf3('0x41')](handleError(_0x3683be,null));};exports['bulkCreate']=function(_0x377883,_0x181a88){return db[_0xaaf3('0x28')][_0xaaf3('0x48')](_0x377883[_0xaaf3('0x47')],{'raw':![],'individualHooks':!![]})[_0xaaf3('0x22')](respondWithResult(_0x181a88,0xc9))['catch'](handleError(_0x181a88,null));};exports[_0xaaf3('0x49')]=function(_0x2ea1c3,_0x482ed7){if(_0x2ea1c3[_0xaaf3('0x47')]['id']){delete _0x2ea1c3['body']['id'];}return db[_0xaaf3('0x28')]['find']({'where':{'id':_0x2ea1c3[_0xaaf3('0x43')]['id']}})[_0xaaf3('0x22')](handleEntityNotFound(_0x482ed7,null))[_0xaaf3('0x22')](saveUpdates(_0x2ea1c3['body'],null))[_0xaaf3('0x22')](respondWithResult(_0x482ed7,null))[_0xaaf3('0x41')](handleError(_0x482ed7,null));};exports[_0xaaf3('0x4a')]=function(_0x17f179,_0x3e9a68){return db[_0xaaf3('0x28')][_0xaaf3('0x45')]({'where':{'id':_0x17f179[_0xaaf3('0x43')]['id']}})[_0xaaf3('0x22')](handleEntityNotFound(_0x3e9a68,null))[_0xaaf3('0x22')](removeEntity(_0x3e9a68,null))[_0xaaf3('0x41')](handleError(_0x3e9a68,null));};exports[_0xaaf3('0x4b')]=function(_0x57a237,_0x56d7ab){return db[_0xaaf3('0x28')][_0xaaf3('0x4a')]({'where':{'id':_0x57a237['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x56d7ab,0xcc))[_0xaaf3('0x41')](handleError(_0x56d7ab,null));};exports[_0xaaf3('0x4c')]=function(_0x4709ab,_0xf04c5a,_0x2a4aac){return db[_0xaaf3('0x4d')][_0xaaf3('0x4e')]({'where':{'id':_0x4709ab[_0xaaf3('0x43')]['id']}})['then'](handleEntityNotFound(_0xf04c5a,null))['then'](function(_0x5742c1){if(_0x5742c1){return db[_0xaaf3('0x4f')][_0xaaf3('0x50')](function(_0x545f90){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x4709ab[_0xaaf3('0x43')]['id']},'transaction':_0x545f90})[_0xaaf3('0x22')](function(_0x4dabb1){var _0x571079=_[_0xaaf3('0x27')](_0x4709ab[_0xaaf3('0x47')],function(_0x5906f9){delete _0x5906f9['id'];_0x5906f9[_0xaaf3('0x51')]=_0x4709ab[_0xaaf3('0x43')]['id'];return _0x5906f9;});return db['AnalyticFieldReport'][_0xaaf3('0x48')](_0x571079,{'transaction':_0x545f90});});})['then'](function(){return db[_0xaaf3('0x28')]['findAll']({'where':{'CustomReportId':_0x4709ab[_0xaaf3('0x43')]['id']}});});}})['then'](respondWithResult(_0xf04c5a,null))['catch'](handleError(_0xf04c5a,null));}; \ No newline at end of file +var _0xf7a0=['end','json','limit','count','offset','set','Content-Range','apply','then','destroy','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','params','keys','create','body','bulkCreate','catch','update','find','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xf7a0,0x80));var _0x0f7a=function(_0x351914,_0x1d4fe5){_0x351914=_0x351914-0x0;var _0x23707c=_0xf7a0[_0x351914];return _0x23707c;};'use strict';var emlformat=require(_0x0f7a('0x0'));var rimraf=require(_0x0f7a('0x1'));var zipdir=require(_0x0f7a('0x2'));var jsonpatch=require(_0x0f7a('0x3'));var rp=require('request-promise');var moment=require(_0x0f7a('0x4'));var BPromise=require(_0x0f7a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0f7a('0x6'));var sox=require(_0x0f7a('0x7'));var csv=require(_0x0f7a('0x8'));var ejs=require(_0x0f7a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0f7a('0xa'));var crypto=require('crypto');var jsforce=require(_0x0f7a('0xb'));var deskjs=require(_0x0f7a('0xc'));var toCsv=require(_0x0f7a('0x8'));var querystring=require(_0x0f7a('0xd'));var Papa=require(_0x0f7a('0xe'));var Redis=require('ioredis');var authService=require(_0x0f7a('0xf'));var qs=require(_0x0f7a('0x10'));var as=require(_0x0f7a('0x11'));var hardwareService=require(_0x0f7a('0x12'));var logger=require(_0x0f7a('0x13'))(_0x0f7a('0x14'));var utils=require(_0x0f7a('0x15'));var config=require(_0x0f7a('0x16'));var licenseUtil=require(_0x0f7a('0x17'));var db=require(_0x0f7a('0x18'))['db'];function respondWithStatusCode(_0xa1d94,_0x3f40b3){_0x3f40b3=_0x3f40b3||0xcc;return function(_0x5e1c1e){if(_0x5e1c1e){return _0xa1d94['sendStatus'](_0x3f40b3);}return _0xa1d94[_0x0f7a('0x19')](_0x3f40b3)[_0x0f7a('0x1a')]();};}function respondWithResult(_0xc43c4b,_0x532bf9){_0x532bf9=_0x532bf9||0xc8;return function(_0x274d0d){if(_0x274d0d){return _0xc43c4b[_0x0f7a('0x19')](_0x532bf9)[_0x0f7a('0x1b')](_0x274d0d);}};}function respondWithFilteredResult(_0xb4f8ec,_0x80bc50){return function(_0x3c4a72){if(_0x3c4a72){var _0x156532=typeof _0x80bc50['offset']==='undefined'&&typeof _0x80bc50[_0x0f7a('0x1c')]==='undefined';var _0x152714=_0x3c4a72[_0x0f7a('0x1d')];var _0x25e443=_0x156532?0x0:_0x80bc50[_0x0f7a('0x1e')];var _0x21245f=_0x156532?_0x3c4a72[_0x0f7a('0x1d')]:_0x80bc50[_0x0f7a('0x1e')]+_0x80bc50[_0x0f7a('0x1c')];var _0x272cec;if(_0x21245f>=_0x152714){_0x21245f=_0x152714;_0x272cec=0xc8;}else{_0x272cec=0xce;}_0xb4f8ec[_0x0f7a('0x19')](_0x272cec);return _0xb4f8ec[_0x0f7a('0x1f')](_0x0f7a('0x20'),_0x25e443+'-'+_0x21245f+'/'+_0x152714)[_0x0f7a('0x1b')](_0x3c4a72);}return null;};}function patchUpdates(_0x4436ce){return function(_0x12c3ae){try{jsonpatch[_0x0f7a('0x21')](_0x12c3ae,_0x4436ce,!![]);}catch(_0x1c16d9){return BPromise['reject'](_0x1c16d9);}return _0x12c3ae['save']();};}function saveUpdates(_0x25893d,_0xe300d6){return function(_0x48d487){if(_0x48d487){return _0x48d487['update'](_0x25893d)[_0x0f7a('0x22')](function(_0x4b49f2){return _0x4b49f2;});}return null;};}function removeEntity(_0x3e71d3,_0x178c66){return function(_0x39d187){if(_0x39d187){return _0x39d187[_0x0f7a('0x23')]()[_0x0f7a('0x22')](function(){_0x3e71d3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x333c50,_0x592f0a){return function(_0x247688){if(!_0x247688){_0x333c50['sendStatus'](0x194);}return _0x247688;};}function handleError(_0x4cfab0,_0x3fc0c7){_0x3fc0c7=_0x3fc0c7||0x1f4;return function(_0x152530){logger['error'](_0x152530[_0x0f7a('0x24')]);if(_0x152530[_0x0f7a('0x25')]){delete _0x152530[_0x0f7a('0x25')];}_0x4cfab0[_0x0f7a('0x19')](_0x3fc0c7)['send'](_0x152530);};}exports[_0x0f7a('0x26')]=function(_0x8f927d,_0x431a14){var _0x21e8d9={},_0x3b09cd={},_0x2bf9dc={'count':0x0,'rows':[]};var _0x5f4cdb=_[_0x0f7a('0x27')](db[_0x0f7a('0x28')][_0x0f7a('0x29')],function(_0x1461ac){return{'name':_0x1461ac[_0x0f7a('0x2a')],'type':_0x1461ac['type'][_0x0f7a('0x2b')]};});_0x3b09cd[_0x0f7a('0x2c')]=_[_0x0f7a('0x27')](_0x5f4cdb,'name');_0x3b09cd[_0x0f7a('0x2d')]=_['keys'](_0x8f927d['query']);_0x3b09cd['filters']=_[_0x0f7a('0x2e')](_0x3b09cd[_0x0f7a('0x2c')],_0x3b09cd[_0x0f7a('0x2d')]);_0x21e8d9[_0x0f7a('0x2f')]=_[_0x0f7a('0x2e')](_0x3b09cd[_0x0f7a('0x2c')],qs[_0x0f7a('0x30')](_0x8f927d[_0x0f7a('0x2d')][_0x0f7a('0x30')]));_0x21e8d9[_0x0f7a('0x2f')]=_0x21e8d9['attributes']['length']?_0x21e8d9[_0x0f7a('0x2f')]:_0x3b09cd[_0x0f7a('0x2c')];if(!_0x8f927d[_0x0f7a('0x2d')]['hasOwnProperty'](_0x0f7a('0x31'))){_0x21e8d9['limit']=qs[_0x0f7a('0x1c')](_0x8f927d[_0x0f7a('0x2d')][_0x0f7a('0x1c')]);_0x21e8d9[_0x0f7a('0x1e')]=qs[_0x0f7a('0x1e')](_0x8f927d[_0x0f7a('0x2d')][_0x0f7a('0x1e')]);}_0x21e8d9[_0x0f7a('0x32')]=qs[_0x0f7a('0x33')](_0x8f927d['query'][_0x0f7a('0x33')]);_0x21e8d9[_0x0f7a('0x34')]=qs[_0x0f7a('0x35')](_[_0x0f7a('0x36')](_0x8f927d['query'],_0x3b09cd[_0x0f7a('0x35')]),_0x5f4cdb);if(_0x8f927d['query']['filter']){_0x21e8d9[_0x0f7a('0x34')]=_[_0x0f7a('0x37')](_0x21e8d9[_0x0f7a('0x34')],{'$or':_[_0x0f7a('0x27')](_0x5f4cdb,function(_0xa2a1c){if(_0xa2a1c[_0x0f7a('0x38')]!==_0x0f7a('0x39')){var _0x367908={};_0x367908[_0xa2a1c[_0x0f7a('0x25')]]={'$like':'%'+_0x8f927d['query'][_0x0f7a('0x3a')]+'%'};return _0x367908;}})});}_0x21e8d9=_[_0x0f7a('0x37')]({},_0x21e8d9,_0x8f927d[_0x0f7a('0x3b')]);var _0x12c2dd={'where':_0x21e8d9[_0x0f7a('0x34')]};return db['AnalyticFieldReport']['count'](_0x12c2dd)['then'](function(_0x26737f){_0x2bf9dc[_0x0f7a('0x1d')]=_0x26737f;if(_0x8f927d[_0x0f7a('0x2d')][_0x0f7a('0x3c')]){_0x21e8d9[_0x0f7a('0x3d')]=[{'all':!![]}];}return db[_0x0f7a('0x28')]['findAll'](_0x21e8d9);})[_0x0f7a('0x22')](function(_0xe9786f){_0x2bf9dc['rows']=_0xe9786f;return _0x2bf9dc;})[_0x0f7a('0x22')](respondWithFilteredResult(_0x431a14,_0x21e8d9))['catch'](handleError(_0x431a14,null));};exports['show']=function(_0x16831c,_0x240e04){var _0x4bb95f={'raw':![],'where':{'id':_0x16831c[_0x0f7a('0x3e')]['id']}},_0x3c4be={};_0x3c4be[_0x0f7a('0x2c')]=_[_0x0f7a('0x3f')](db['AnalyticFieldReport'][_0x0f7a('0x29')]);_0x3c4be[_0x0f7a('0x2d')]=_[_0x0f7a('0x3f')](_0x16831c[_0x0f7a('0x2d')]);_0x3c4be['filters']=_[_0x0f7a('0x2e')](_0x3c4be[_0x0f7a('0x2c')],_0x3c4be['query']);_0x4bb95f[_0x0f7a('0x2f')]=_[_0x0f7a('0x2e')](_0x3c4be[_0x0f7a('0x2c')],qs[_0x0f7a('0x30')](_0x16831c[_0x0f7a('0x2d')][_0x0f7a('0x30')]));_0x4bb95f['attributes']=_0x4bb95f[_0x0f7a('0x2f')]['length']?_0x4bb95f[_0x0f7a('0x2f')]:_0x3c4be['model'];if(_0x16831c['query']['includeAll']){_0x4bb95f['include']=[{'all':!![]}];}_0x4bb95f=_[_0x0f7a('0x37')]({},_0x4bb95f,_0x16831c[_0x0f7a('0x3b')]);return db[_0x0f7a('0x28')]['find'](_0x4bb95f)[_0x0f7a('0x22')](handleEntityNotFound(_0x240e04,null))[_0x0f7a('0x22')](respondWithResult(_0x240e04,null))['catch'](handleError(_0x240e04,null));};exports[_0x0f7a('0x40')]=function(_0x935d13,_0x47311b){return db[_0x0f7a('0x28')][_0x0f7a('0x40')](_0x935d13[_0x0f7a('0x41')],{})['then'](respondWithResult(_0x47311b,0xc9))['catch'](handleError(_0x47311b,null));};exports[_0x0f7a('0x42')]=function(_0x210c3a,_0x32fb22){return db[_0x0f7a('0x28')][_0x0f7a('0x42')](_0x210c3a[_0x0f7a('0x41')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x32fb22,0xc9))[_0x0f7a('0x43')](handleError(_0x32fb22,null));};exports[_0x0f7a('0x44')]=function(_0x2a0fdd,_0x73650e){if(_0x2a0fdd[_0x0f7a('0x41')]['id']){delete _0x2a0fdd[_0x0f7a('0x41')]['id'];}return db[_0x0f7a('0x28')][_0x0f7a('0x45')]({'where':{'id':_0x2a0fdd['params']['id']}})[_0x0f7a('0x22')](handleEntityNotFound(_0x73650e,null))[_0x0f7a('0x22')](saveUpdates(_0x2a0fdd[_0x0f7a('0x41')],null))[_0x0f7a('0x22')](respondWithResult(_0x73650e,null))[_0x0f7a('0x43')](handleError(_0x73650e,null));};exports[_0x0f7a('0x23')]=function(_0x6553f,_0x408b56){return db['AnalyticFieldReport'][_0x0f7a('0x45')]({'where':{'id':_0x6553f['params']['id']}})[_0x0f7a('0x22')](handleEntityNotFound(_0x408b56,null))[_0x0f7a('0x22')](removeEntity(_0x408b56,null))['catch'](handleError(_0x408b56,null));};exports[_0x0f7a('0x46')]=function(_0x1e1490,_0x3024b0){return db['AnalyticFieldReport'][_0x0f7a('0x23')]({'where':{'id':_0x1e1490[_0x0f7a('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x0f7a('0x22')](respondWithResult(_0x3024b0,0xcc))[_0x0f7a('0x43')](handleError(_0x3024b0,null));};exports[_0x0f7a('0x47')]=function(_0x4ed131,_0x5a88bd,_0x2cb69e){return db[_0x0f7a('0x48')][_0x0f7a('0x49')]({'where':{'id':_0x4ed131[_0x0f7a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5a88bd,null))[_0x0f7a('0x22')](function(_0x1c516e){if(_0x1c516e){return db[_0x0f7a('0x4a')][_0x0f7a('0x4b')](function(_0x3ef56a){return db[_0x0f7a('0x28')][_0x0f7a('0x23')]({'where':{'CustomReportId':_0x4ed131[_0x0f7a('0x3e')]['id']},'transaction':_0x3ef56a})[_0x0f7a('0x22')](function(_0x30a93a){var _0x2286fb=_['map'](_0x4ed131[_0x0f7a('0x41')],function(_0x15fabe){delete _0x15fabe['id'];_0x15fabe['CustomReportId']=_0x4ed131['params']['id'];return _0x15fabe;});return db['AnalyticFieldReport'][_0x0f7a('0x42')](_0x2286fb,{'transaction':_0x3ef56a});});})[_0x0f7a('0x22')](function(){return db[_0x0f7a('0x28')][_0x0f7a('0x4c')]({'where':{'CustomReportId':_0x4ed131[_0x0f7a('0x3e')]['id']}});});}})[_0x0f7a('0x22')](respondWithResult(_0x5a88bd,null))[_0x0f7a('0x43')](handleError(_0x5a88bd,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 8379cea..b62600f 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 _0xa836=['exports','define','lodash','util','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x33914b,_0x53f567){var _0x5f3f3b=function(_0x30be15){while(--_0x30be15){_0x33914b['push'](_0x33914b['shift']());}};_0x5f3f3b(++_0x53f567);}(_0xa836,0x158));var _0x6a83=function(_0x24eef9,_0x1856ec){_0x24eef9=_0x24eef9-0x0;var _0xed5fc4=_0xa836[_0x24eef9];return _0xed5fc4;};'use strict';var _=require(_0x6a83('0x0'));var util=require(_0x6a83('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a83('0x2'));var fs=require('fs');var path=require(_0x6a83('0x3'));var rimraf=require(_0x6a83('0x4'));var config=require(_0x6a83('0x5'));var attributes=require(_0x6a83('0x6'));module[_0x6a83('0x7')]=function(_0x461e85,_0xd33321){return _0x461e85[_0x6a83('0x8')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fce=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0x6fce,0x1ac));var _0xe6fc=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x6fce[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xe6fc('0x0'));var util=require(_0xe6fc('0x1'));var logger=require(_0xe6fc('0x2'))(_0xe6fc('0x3'));var moment=require('moment');var BPromise=require(_0xe6fc('0x4'));var rp=require(_0xe6fc('0x5'));var fs=require('fs');var path=require(_0xe6fc('0x6'));var rimraf=require(_0xe6fc('0x7'));var config=require(_0xe6fc('0x8'));var attributes=require(_0xe6fc('0x9'));module[_0xe6fc('0xa')]=function(_0x1c4783,_0x10a668){return _0x1c4783[_0xe6fc('0xb')](_0xe6fc('0xc'),attributes,{'tableName':_0xe6fc('0xd'),'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 70284b7..363b44c 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 _0x9c39=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x298b53,_0x3f830d){var _0x370c14=function(_0x16a8d7){while(--_0x16a8d7){_0x298b53['push'](_0x298b53['shift']());}};_0x370c14(++_0x3f830d);}(_0x9c39,0x78));var _0x99c3=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x9c39[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x99c3('0x0'));var util=require('util');var moment=require(_0x99c3('0x1'));var BPromise=require(_0x99c3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99c3('0x3'));var db=require(_0x99c3('0x4'))['db'];var utils=require(_0x99c3('0x5'));var logger=require(_0x99c3('0x6'))('rpc');var config=require(_0x99c3('0x7'));var jayson=require(_0x99c3('0x8'));var client=jayson[_0x99c3('0x9')][_0x99c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x511ade,_0x394a96,_0x423840){return new BPromise(function(_0x3f27b6,_0x5da20a){return client[_0x99c3('0xb')](_0x511ade,_0x423840)[_0x99c3('0xc')](function(_0x213523){logger[_0x99c3('0xd')](_0x99c3('0xe'),_0x394a96,_0x99c3('0xf'));logger['debug'](_0x99c3('0x10'),_0x394a96,_0x99c3('0xf'),JSON[_0x99c3('0x11')](_0x213523));if(_0x213523[_0x99c3('0x12')]){if(_0x213523[_0x99c3('0x12')][_0x99c3('0x13')]===0x1f4){logger[_0x99c3('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x394a96,_0x213523[_0x99c3('0x12')]['message']);return _0x5da20a(_0x213523[_0x99c3('0x12')][_0x99c3('0x14')]);}logger[_0x99c3('0x12')](_0x99c3('0xe'),_0x394a96,_0x213523[_0x99c3('0x12')][_0x99c3('0x14')]);return _0x3f27b6(_0x213523[_0x99c3('0x12')]['message']);}else{logger[_0x99c3('0xd')](_0x99c3('0xe'),_0x394a96,_0x99c3('0xf'));_0x3f27b6(_0x213523['result'][_0x99c3('0x14')]);}})['catch'](function(_0x590a40){logger[_0x99c3('0x12')](_0x99c3('0xe'),_0x394a96,_0x590a40);_0x5da20a(_0x590a40);});});} \ No newline at end of file +var _0xd6ec=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x23add2,_0x59a127){var _0x2fdc91=function(_0x28671c){while(--_0x28671c){_0x23add2['push'](_0x23add2['shift']());}};_0x2fdc91(++_0x59a127);}(_0xd6ec,0x1df));var _0xcd6e=function(_0x5b60e3,_0x181ac2){_0x5b60e3=_0x5b60e3-0x0;var _0x2ea378=_0xd6ec[_0x5b60e3];return _0x2ea378;};'use strict';var _=require(_0xcd6e('0x0'));var util=require(_0xcd6e('0x1'));var moment=require(_0xcd6e('0x2'));var BPromise=require(_0xcd6e('0x3'));var rs=require(_0xcd6e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd6e('0x5'))['db'];var utils=require(_0xcd6e('0x6'));var logger=require(_0xcd6e('0x7'))(_0xcd6e('0x8'));var config=require(_0xcd6e('0x9'));var jayson=require(_0xcd6e('0xa'));var client=jayson[_0xcd6e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x573daf,_0x7ca5cb,_0x4caf10){return new BPromise(function(_0x211b81,_0x4d1ca9){return client[_0xcd6e('0xc')](_0x573daf,_0x4caf10)[_0xcd6e('0xd')](function(_0x186ebb){logger[_0xcd6e('0xe')](_0xcd6e('0xf'),_0x7ca5cb,_0xcd6e('0x10'));logger[_0xcd6e('0x11')](_0xcd6e('0x12'),_0x7ca5cb,_0xcd6e('0x10'),JSON['stringify'](_0x186ebb));if(_0x186ebb[_0xcd6e('0x13')]){if(_0x186ebb[_0xcd6e('0x13')]['code']===0x1f4){logger['error'](_0xcd6e('0xf'),_0x7ca5cb,_0x186ebb[_0xcd6e('0x13')][_0xcd6e('0x14')]);return _0x4d1ca9(_0x186ebb[_0xcd6e('0x13')][_0xcd6e('0x14')]);}logger[_0xcd6e('0x13')](_0xcd6e('0xf'),_0x7ca5cb,_0x186ebb[_0xcd6e('0x13')][_0xcd6e('0x14')]);return _0x211b81(_0x186ebb['error'][_0xcd6e('0x14')]);}else{logger[_0xcd6e('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x7ca5cb,'request\x20sent');_0x211b81(_0x186ebb[_0xcd6e('0x15')][_0xcd6e('0x14')]);}})[_0xcd6e('0x16')](function(_0x3ed544){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x7ca5cb,_0x3ed544);_0x4d1ca9(_0x3ed544);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index b8570db..fa96f2a 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(_0x397a80,_0x2754a4){var _0x7086c1=function(_0x283a73){while(--_0x283a73){_0x397a80['push'](_0x397a80['shift']());}};_0x7086c1(++_0x2754a4);}(_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['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(_0x4690d2,_0x32bf1e){var _0x4a19fe=function(_0x7ee1a){while(--_0x7ee1a){_0x4690d2['push'](_0x4690d2['shift']());}};_0x4a19fe(++_0x32bf1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 72d74c0..8a49f9e 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 _0x9861=['STRING','TEXT','sequelize','name'];(function(_0x21a53f,_0x182961){var _0x23ca6c=function(_0xbbdeff){while(--_0xbbdeff){_0x21a53f['push'](_0x21a53f['shift']());}};_0x23ca6c(++_0x182961);}(_0x9861,0x176));var _0x1986=function(_0x1b46ef,_0x5d30c9){_0x1b46ef=_0x1b46ef-0x0;var _0x12eee9=_0x9861[_0x1b46ef];return _0x12eee9;};'use strict';var Sequelize=require(_0x1986('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1986('0x1')},'table':{'type':Sequelize[_0x1986('0x2')]},'metric':{'type':Sequelize[_0x1986('0x3')]},'description':{'type':Sequelize[_0x1986('0x2')]}}; \ No newline at end of file +var _0x049e=['TEXT','STRING','sequelize','exports','name'];(function(_0xb953a,_0x3d230e){var _0x27ea69=function(_0x4c9b9e){while(--_0x4c9b9e){_0xb953a['push'](_0xb953a['shift']());}};_0x27ea69(++_0x3d230e);}(_0x049e,0x16a));var _0xe049=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x049e[_0x1857d0];return _0x3e3c46;};'use strict';var Sequelize=require(_0xe049('0x0'));module[_0xe049('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe049('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xe049('0x3')]},'description':{'type':Sequelize[_0xe049('0x4')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 6ff85e2..f85619f 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 _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','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','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x4ec48f,_0x21c136){var _0x39fe28=function(_0x342394){while(--_0x342394){_0x4ec48f['push'](_0x4ec48f['shift']());}};_0x39fe28(++_0x21c136);}(_0x81bd,0x7c));var _0xd81b=function(_0x1e6d9a,_0x548cf2){_0x1e6d9a=_0x1e6d9a-0x0;var _0x59b4da=_0x81bd[_0x1e6d9a];return _0x59b4da;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));}; \ No newline at end of file +var _0x9957=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d3a1739..eec9353 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 _0xa63f=['request-promise','path','rimraf','../../config/environment','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x58ce0d,_0x3038cd){var _0x1eb027=function(_0x39efe1){while(--_0x39efe1){_0x58ce0d['push'](_0x58ce0d['shift']());}};_0x1eb027(++_0x3038cd);}(_0xa63f,0x1b6));var _0xfa63=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xa63f[_0xe4d6c6];return _0x3a8935;};'use strict';var _=require(_0xfa63('0x0'));var util=require(_0xfa63('0x1'));var logger=require(_0xfa63('0x2'))(_0xfa63('0x3'));var moment=require(_0xfa63('0x4'));var BPromise=require(_0xfa63('0x5'));var rp=require(_0xfa63('0x6'));var fs=require('fs');var path=require(_0xfa63('0x7'));var rimraf=require(_0xfa63('0x8'));var config=require(_0xfa63('0x9'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x20d4f6,_0x41efce){return _0x20d4f6[_0xfa63('0xa')](_0xfa63('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b8e=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x1a77bc,_0x1e48de){var _0x5d1aec=function(_0x1e9673){while(--_0x1e9673){_0x1a77bc['push'](_0x1a77bc['shift']());}};_0x5d1aec(++_0x1e48de);}(_0x8b8e,0x108));var _0xe8b8=function(_0x49bf07,_0x3cd323){_0x49bf07=_0x49bf07-0x0;var _0x4e9276=_0x8b8e[_0x49bf07];return _0x4e9276;};'use strict';var _=require(_0xe8b8('0x0'));var util=require('util');var logger=require(_0xe8b8('0x1'))('api');var moment=require(_0xe8b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8b8('0x3'));var rimraf=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var attributes=require(_0xe8b8('0x6'));module[_0xe8b8('0x7')]=function(_0x3f5dd7,_0x1c0548){return _0x3f5dd7[_0xe8b8('0x8')](_0xe8b8('0x9'),attributes,{'tableName':_0xe8b8('0xa'),'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 3bc7814..0d8c05f 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 _0x95f9=['jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','../../mysqldb','../../config/logger','../../config/environment'];(function(_0xc63c19,_0xccae28){var _0x3c1a6b=function(_0xb5d410){while(--_0xb5d410){_0xc63c19['push'](_0xc63c19['shift']());}};_0x3c1a6b(++_0xccae28);}(_0x95f9,0x10c));var _0x995f=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x95f9[_0x381589];return _0x2a075d;};'use strict';var _=require(_0x995f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x995f('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x995f('0x2'))('rpc');var config=require(_0x995f('0x3'));var jayson=require(_0x995f('0x4'));var client=jayson[_0x995f('0x5')][_0x995f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1ce329,_0x1a0428,_0x250505){return new BPromise(function(_0x1e47d0,_0x28e25b){return client['request'](_0x1ce329,_0x250505)['then'](function(_0x5d786e){logger[_0x995f('0x7')](_0x995f('0x8'),_0x1a0428,'request\x20sent');logger['debug'](_0x995f('0x9'),_0x1a0428,_0x995f('0xa'),JSON[_0x995f('0xb')](_0x5d786e));if(_0x5d786e[_0x995f('0xc')]){if(_0x5d786e['error'][_0x995f('0xd')]===0x1f4){logger['error'](_0x995f('0x8'),_0x1a0428,_0x5d786e[_0x995f('0xc')][_0x995f('0xe')]);return _0x28e25b(_0x5d786e[_0x995f('0xc')]['message']);}logger[_0x995f('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x1a0428,_0x5d786e[_0x995f('0xc')][_0x995f('0xe')]);return _0x1e47d0(_0x5d786e['error'][_0x995f('0xe')]);}else{logger[_0x995f('0x7')]('AnalyticMetric,\x20%s,\x20%s',_0x1a0428,_0x995f('0xa'));_0x1e47d0(_0x5d786e[_0x995f('0xf')][_0x995f('0xe')]);}})['catch'](function(_0x232edd){logger[_0x995f('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x1a0428,_0x232edd);_0x28e25b(_0x232edd);});});} \ No newline at end of file +var _0x051a=['jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x051a,0x198));var _0xa051=function(_0x4b4a8f,_0x73c713){_0x4b4a8f=_0x4b4a8f-0x0;var _0x562df5=_0x051a[_0x4b4a8f];return _0x562df5;};'use strict';var _=require(_0xa051('0x0'));var util=require(_0xa051('0x1'));var moment=require(_0xa051('0x2'));var BPromise=require('bluebird');var rs=require(_0xa051('0x3'));var fs=require('fs');var Redis=require(_0xa051('0x4'));var db=require(_0xa051('0x5'))['db'];var utils=require(_0xa051('0x6'));var logger=require(_0xa051('0x7'))(_0xa051('0x8'));var config=require(_0xa051('0x9'));var jayson=require(_0xa051('0xa'));var client=jayson[_0xa051('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec0c7,_0x26de82,_0x26324e){return new BPromise(function(_0x2fbce6,_0x84dd93){return client[_0xa051('0xc')](_0x5ec0c7,_0x26324e)[_0xa051('0xd')](function(_0x171850){logger[_0xa051('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x26de82,_0xa051('0xf'));logger[_0xa051('0x10')](_0xa051('0x11'),_0x26de82,_0xa051('0xf'),JSON[_0xa051('0x12')](_0x171850));if(_0x171850[_0xa051('0x13')]){if(_0x171850[_0xa051('0x13')]['code']===0x1f4){logger[_0xa051('0x13')](_0xa051('0x14'),_0x26de82,_0x171850[_0xa051('0x13')][_0xa051('0x15')]);return _0x84dd93(_0x171850[_0xa051('0x13')][_0xa051('0x15')]);}logger[_0xa051('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x26de82,_0x171850[_0xa051('0x13')][_0xa051('0x15')]);return _0x2fbce6(_0x171850[_0xa051('0x13')][_0xa051('0x15')]);}else{logger[_0xa051('0xe')](_0xa051('0x14'),_0x26de82,_0xa051('0xf'));_0x2fbce6(_0x171850['result']['message']);}})['catch'](function(_0x36dbcc){logger[_0xa051('0x13')](_0xa051('0x14'),_0x26de82,_0x36dbcc);_0x84dd93(_0x36dbcc);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 6491985..6324ecc 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 _0x0b3d=['express','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','post','put','isAuthenticated','update','destroy','exports','multer','path'];(function(_0x1e85b3,_0x11726d){var _0x20835a=function(_0x438dee){while(--_0x438dee){_0x1e85b3['push'](_0x1e85b3['shift']());}};_0x20835a(++_0x11726d);}(_0x0b3d,0x76));var _0xd0b3=function(_0x44c44b,_0x57e40d){_0x44c44b=_0x44c44b-0x0;var _0xb29ca8=_0x0b3d[_0x44c44b];return _0xb29ca8;};'use strict';var multer=require(_0xd0b3('0x0'));var util=require('util');var path=require(_0xd0b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xd0b3('0x2'));var router=express['Router']();var fs_extra=require(_0xd0b3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd0b3('0x4'));var config=require('../../config/environment');var controller=require(_0xd0b3('0x5'));router[_0xd0b3('0x6')]('/',auth['isAuthenticated'](),controller[_0xd0b3('0x7')]);router['get'](_0xd0b3('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xd0b3('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd0b3('0xa')]('/:id',auth[_0xd0b3('0xb')](),controller[_0xd0b3('0xc')]);router['delete']('/:id',auth[_0xd0b3('0xb')](),controller[_0xd0b3('0xd')]);module[_0xd0b3('0xe')]=router; \ No newline at end of file +var _0xa4dc=['put','/:id','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','post'];(function(_0x1492b1,_0x1a7f9a){var _0x4fff7c=function(_0x1175bf){while(--_0x1175bf){_0x1492b1['push'](_0x1492b1['shift']());}};_0x4fff7c(++_0x1a7f9a);}(_0xa4dc,0x16a));var _0xca4d=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xa4dc[_0x4e7d25];return _0x526fe6;};'use strict';var multer=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca4d('0x2'));var router=express[_0xca4d('0x3')]();var fs_extra=require(_0xca4d('0x4'));var auth=require(_0xca4d('0x5'));var interaction=require(_0xca4d('0x6'));var config=require('../../config/environment');var controller=require(_0xca4d('0x7'));router[_0xca4d('0x8')]('/',auth[_0xca4d('0x9')](),controller['index']);router[_0xca4d('0x8')]('/:id',auth[_0xca4d('0x9')](),controller[_0xca4d('0xa')]);router[_0xca4d('0xb')]('/',auth[_0xca4d('0x9')](),controller['create']);router[_0xca4d('0xc')](_0xca4d('0xd'),auth['isAuthenticated'](),controller[_0xca4d('0xe')]);router['delete'](_0xca4d('0xd'),auth[_0xca4d('0x9')](),controller[_0xca4d('0xf')]);module[_0xca4d('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index e037e72..e2298f7 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 _0x22e7=['exports','TEXT','sequelize'];(function(_0x546b62,_0x2e9a97){var _0x50ef01=function(_0x352ee7){while(--_0x352ee7){_0x546b62['push'](_0x546b62['shift']());}};_0x50ef01(++_0x2e9a97);}(_0x22e7,0x188));var _0x722e=function(_0xac9cb9,_0x75280f){_0xac9cb9=_0xac9cb9-0x0;var _0xccf29b=_0x22e7[_0xac9cb9];return _0xccf29b;};'use strict';var Sequelize=require(_0x722e('0x0'));module[_0x722e('0x1')]={'tree':{'type':Sequelize[_0x722e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf7b1=['sequelize'];(function(_0x5f52a4,_0x5706d9){var _0xde1bce=function(_0x16ef65){while(--_0x16ef65){_0x5f52a4['push'](_0x5f52a4['shift']());}};_0xde1bce(++_0x5706d9);}(_0xf7b1,0x197));var _0x1f7b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xf7b1[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x1f7b('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 4fb5e4d..6ced81a 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 _0x8fd7=['filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','include','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys'];(function(_0x26d89d,_0x291e31){var _0x3a74f4=function(_0x16281e){while(--_0x16281e){_0x26d89d['push'](_0x26d89d['shift']());}};_0x3a74f4(++_0x291e31);}(_0x8fd7,0x1e6));var _0x78fd=function(_0x25e412,_0x177961){_0x25e412=_0x25e412-0x0;var _0x34042f=_0x8fd7[_0x25e412];return _0x34042f;};'use strict';var emlformat=require(_0x78fd('0x0'));var rimraf=require(_0x78fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x78fd('0x2'));var rp=require(_0x78fd('0x3'));var moment=require(_0x78fd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x78fd('0x5'));var util=require(_0x78fd('0x6'));var path=require('path');var sox=require(_0x78fd('0x7'));var csv=require(_0x78fd('0x8'));var ejs=require(_0x78fd('0x9'));var fs=require('fs');var fs_extra=require(_0x78fd('0xa'));var _=require(_0x78fd('0xb'));var squel=require(_0x78fd('0xc'));var crypto=require(_0x78fd('0xd'));var jsforce=require(_0x78fd('0xe'));var deskjs=require(_0x78fd('0xf'));var toCsv=require(_0x78fd('0x8'));var querystring=require(_0x78fd('0x10'));var Papa=require(_0x78fd('0x11'));var Redis=require(_0x78fd('0x12'));var authService=require(_0x78fd('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x78fd('0x14'));var hardwareService=require(_0x78fd('0x15'));var logger=require(_0x78fd('0x16'))(_0x78fd('0x17'));var utils=require(_0x78fd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x78fd('0x19'));var db=require(_0x78fd('0x1a'))['db'];function respondWithStatusCode(_0x68b0eb,_0x109805){_0x109805=_0x109805||0xcc;return function(_0x4fe5b4){if(_0x4fe5b4){return _0x68b0eb[_0x78fd('0x1b')](_0x109805);}return _0x68b0eb[_0x78fd('0x1c')](_0x109805)[_0x78fd('0x1d')]();};}function respondWithResult(_0xa90a70,_0x584301){_0x584301=_0x584301||0xc8;return function(_0x3c7c71){if(_0x3c7c71){return _0xa90a70[_0x78fd('0x1c')](_0x584301)[_0x78fd('0x1e')](_0x3c7c71);}};}function respondWithFilteredResult(_0xd668a4,_0x5c49a7){return function(_0x149cfd){if(_0x149cfd){var _0x23aac9=typeof _0x5c49a7[_0x78fd('0x1f')]===_0x78fd('0x20')&&typeof _0x5c49a7['limit']===_0x78fd('0x20');var _0x1d3440=_0x149cfd[_0x78fd('0x21')];var _0x4e4164=_0x23aac9?0x0:_0x5c49a7['offset'];var _0x4d48dd=_0x23aac9?_0x149cfd[_0x78fd('0x21')]:_0x5c49a7['offset']+_0x5c49a7[_0x78fd('0x22')];var _0x394787;if(_0x4d48dd>=_0x1d3440){_0x4d48dd=_0x1d3440;_0x394787=0xc8;}else{_0x394787=0xce;}_0xd668a4[_0x78fd('0x1c')](_0x394787);return _0xd668a4[_0x78fd('0x23')](_0x78fd('0x24'),_0x4e4164+'-'+_0x4d48dd+'/'+_0x1d3440)[_0x78fd('0x1e')](_0x149cfd);}return null;};}function patchUpdates(_0xb21943){return function(_0x199cb3){try{jsonpatch[_0x78fd('0x25')](_0x199cb3,_0xb21943,!![]);}catch(_0x1610ea){return BPromise[_0x78fd('0x26')](_0x1610ea);}return _0x199cb3[_0x78fd('0x27')]();};}function saveUpdates(_0x4723b5,_0x29d7b7){return function(_0x2934a8){if(_0x2934a8){return _0x2934a8[_0x78fd('0x28')](_0x4723b5)[_0x78fd('0x29')](function(_0x58ab44){return _0x58ab44;});}return null;};}function removeEntity(_0x33c165,_0x11131d){return function(_0x4351e5){if(_0x4351e5){return _0x4351e5[_0x78fd('0x2a')]()['then'](function(){_0x33c165[_0x78fd('0x1c')](0xcc)[_0x78fd('0x1d')]();});}};}function handleEntityNotFound(_0x3ba0a3,_0x53dd73){return function(_0x37b71e){if(!_0x37b71e){_0x3ba0a3['sendStatus'](0x194);}return _0x37b71e;};}function handleError(_0x331f11,_0x37ceed){_0x37ceed=_0x37ceed||0x1f4;return function(_0x13f7dd){logger['error'](_0x13f7dd[_0x78fd('0x2b')]);if(_0x13f7dd[_0x78fd('0x2c')]){delete _0x13f7dd[_0x78fd('0x2c')];}_0x331f11[_0x78fd('0x1c')](_0x37ceed)[_0x78fd('0x2d')](_0x13f7dd);};}exports['index']=function(_0x2b38dc,_0x4514c1){var _0x14bd04={},_0x2beedc={},_0x4db5b2={'count':0x0,'rows':[]};var _0x4387ca=_['map'](db['AnalyticTreeReport'][_0x78fd('0x2e')],function(_0x493b32){return{'name':_0x493b32[_0x78fd('0x2f')],'type':_0x493b32['type'][_0x78fd('0x30')]};});_0x2beedc[_0x78fd('0x31')]=_[_0x78fd('0x32')](_0x4387ca,'name');_0x2beedc[_0x78fd('0x33')]=_[_0x78fd('0x34')](_0x2b38dc[_0x78fd('0x33')]);_0x2beedc[_0x78fd('0x35')]=_[_0x78fd('0x36')](_0x2beedc[_0x78fd('0x31')],_0x2beedc['query']);_0x14bd04['attributes']=_['intersection'](_0x2beedc[_0x78fd('0x31')],qs[_0x78fd('0x37')](_0x2b38dc[_0x78fd('0x33')][_0x78fd('0x37')]));_0x14bd04['attributes']=_0x14bd04['attributes'][_0x78fd('0x38')]?_0x14bd04[_0x78fd('0x39')]:_0x2beedc[_0x78fd('0x31')];if(!_0x2b38dc[_0x78fd('0x33')][_0x78fd('0x3a')](_0x78fd('0x3b'))){_0x14bd04[_0x78fd('0x22')]=qs[_0x78fd('0x22')](_0x2b38dc['query'][_0x78fd('0x22')]);_0x14bd04[_0x78fd('0x1f')]=qs[_0x78fd('0x1f')](_0x2b38dc[_0x78fd('0x33')][_0x78fd('0x1f')]);}_0x14bd04[_0x78fd('0x3c')]=qs[_0x78fd('0x3d')](_0x2b38dc[_0x78fd('0x33')]['sort']);_0x14bd04[_0x78fd('0x3e')]=qs[_0x78fd('0x35')](_[_0x78fd('0x3f')](_0x2b38dc['query'],_0x2beedc[_0x78fd('0x35')]),_0x4387ca);if(_0x2b38dc[_0x78fd('0x33')][_0x78fd('0x40')]){_0x14bd04[_0x78fd('0x3e')]=_[_0x78fd('0x41')](_0x14bd04[_0x78fd('0x3e')],{'$or':_[_0x78fd('0x32')](_0x4387ca,function(_0x50029a){if(_0x50029a['type']!==_0x78fd('0x42')){var _0x24ef80={};_0x24ef80[_0x50029a[_0x78fd('0x2c')]]={'$like':'%'+_0x2b38dc['query'][_0x78fd('0x40')]+'%'};return _0x24ef80;}})});}_0x14bd04=_['merge']({},_0x14bd04,_0x2b38dc[_0x78fd('0x43')]);var _0x3a852a={'where':_0x14bd04['where']};return db[_0x78fd('0x44')][_0x78fd('0x21')](_0x3a852a)['then'](function(_0x36fd69){_0x4db5b2[_0x78fd('0x21')]=_0x36fd69;if(_0x2b38dc[_0x78fd('0x33')]['includeAll']){_0x14bd04[_0x78fd('0x45')]=[{'all':!![]}];}return db[_0x78fd('0x44')]['findAll'](_0x14bd04);})[_0x78fd('0x29')](function(_0x1a9a16){_0x4db5b2[_0x78fd('0x46')]=_0x1a9a16;return _0x4db5b2;})[_0x78fd('0x29')](respondWithFilteredResult(_0x4514c1,_0x14bd04))[_0x78fd('0x47')](handleError(_0x4514c1,null));};exports[_0x78fd('0x48')]=function(_0x413dd2,_0x17a052){var _0x3672d3={'raw':!![],'where':{'id':_0x413dd2[_0x78fd('0x49')]['id']}},_0xb3579f={};_0xb3579f[_0x78fd('0x31')]=_[_0x78fd('0x34')](db[_0x78fd('0x44')][_0x78fd('0x2e')]);_0xb3579f[_0x78fd('0x33')]=_[_0x78fd('0x34')](_0x413dd2[_0x78fd('0x33')]);_0xb3579f[_0x78fd('0x35')]=_['intersection'](_0xb3579f[_0x78fd('0x31')],_0xb3579f[_0x78fd('0x33')]);_0x3672d3[_0x78fd('0x39')]=_[_0x78fd('0x36')](_0xb3579f['model'],qs[_0x78fd('0x37')](_0x413dd2[_0x78fd('0x33')][_0x78fd('0x37')]));_0x3672d3['attributes']=_0x3672d3[_0x78fd('0x39')][_0x78fd('0x38')]?_0x3672d3[_0x78fd('0x39')]:_0xb3579f[_0x78fd('0x31')];if(_0x413dd2[_0x78fd('0x33')]['includeAll']){_0x3672d3['include']=[{'all':!![]}];}_0x3672d3=_[_0x78fd('0x41')]({},_0x3672d3,_0x413dd2[_0x78fd('0x43')]);return db['AnalyticTreeReport'][_0x78fd('0x4a')](_0x3672d3)[_0x78fd('0x29')](handleEntityNotFound(_0x17a052,null))[_0x78fd('0x29')](respondWithResult(_0x17a052,null))[_0x78fd('0x47')](handleError(_0x17a052,null));};exports[_0x78fd('0x4b')]=function(_0xed3e90,_0x40fce7){return db[_0x78fd('0x44')][_0x78fd('0x4b')](_0xed3e90[_0x78fd('0x4c')],{})['then'](respondWithResult(_0x40fce7,0xc9))[_0x78fd('0x47')](handleError(_0x40fce7,null));};exports['update']=function(_0x35fbf6,_0x5293ad){if(_0x35fbf6[_0x78fd('0x4c')]['id']){delete _0x35fbf6['body']['id'];}return db[_0x78fd('0x44')][_0x78fd('0x4a')]({'where':{'id':_0x35fbf6[_0x78fd('0x49')]['id']}})['then'](handleEntityNotFound(_0x5293ad,null))[_0x78fd('0x29')](saveUpdates(_0x35fbf6[_0x78fd('0x4c')],null))[_0x78fd('0x29')](respondWithResult(_0x5293ad,null))[_0x78fd('0x47')](handleError(_0x5293ad,null));};exports['destroy']=function(_0x54a1dc,_0x57fdbf){return db[_0x78fd('0x44')][_0x78fd('0x4a')]({'where':{'id':_0x54a1dc[_0x78fd('0x49')]['id']}})[_0x78fd('0x29')](handleEntityNotFound(_0x57fdbf,null))['then'](removeEntity(_0x57fdbf,null))[_0x78fd('0x47')](handleError(_0x57fdbf,null));}; \ No newline at end of file +var _0x301c=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','sendStatus','error','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4e46fd,_0x55dcbb){var _0x2b4a68=function(_0x3a0551){while(--_0x3a0551){_0x4e46fd['push'](_0x4e46fd['shift']());}};_0x2b4a68(++_0x55dcbb);}(_0x301c,0x93));var _0xc301=function(_0x2563e4,_0x456262){_0x2563e4=_0x2563e4-0x0;var _0x53e6d8=_0x301c[_0x2563e4];return _0x53e6d8;};'use strict';var emlformat=require(_0xc301('0x0'));var rimraf=require(_0xc301('0x1'));var zipdir=require(_0xc301('0x2'));var jsonpatch=require(_0xc301('0x3'));var rp=require(_0xc301('0x4'));var moment=require(_0xc301('0x5'));var BPromise=require(_0xc301('0x6'));var Mustache=require('mustache');var util=require(_0xc301('0x7'));var path=require(_0xc301('0x8'));var sox=require(_0xc301('0x9'));var csv=require(_0xc301('0xa'));var ejs=require(_0xc301('0xb'));var fs=require('fs');var fs_extra=require(_0xc301('0xc'));var _=require(_0xc301('0xd'));var squel=require(_0xc301('0xe'));var crypto=require(_0xc301('0xf'));var jsforce=require(_0xc301('0x10'));var deskjs=require(_0xc301('0x11'));var toCsv=require(_0xc301('0xa'));var querystring=require('querystring');var Papa=require(_0xc301('0x12'));var Redis=require(_0xc301('0x13'));var authService=require(_0xc301('0x14'));var qs=require(_0xc301('0x15'));var as=require(_0xc301('0x16'));var hardwareService=require(_0xc301('0x17'));var logger=require(_0xc301('0x18'))(_0xc301('0x19'));var utils=require(_0xc301('0x1a'));var config=require(_0xc301('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xc301('0x1c'))['db'];function respondWithStatusCode(_0x5e9336,_0x1332c7){_0x1332c7=_0x1332c7||0xcc;return function(_0x39a239){if(_0x39a239){return _0x5e9336['sendStatus'](_0x1332c7);}return _0x5e9336['status'](_0x1332c7)[_0xc301('0x1d')]();};}function respondWithResult(_0x163346,_0x558c1a){_0x558c1a=_0x558c1a||0xc8;return function(_0x49e0da){if(_0x49e0da){return _0x163346[_0xc301('0x1e')](_0x558c1a)['json'](_0x49e0da);}};}function respondWithFilteredResult(_0x18fa2d,_0xf8e652){return function(_0x1ecead){if(_0x1ecead){var _0x57db74=typeof _0xf8e652[_0xc301('0x1f')]===_0xc301('0x20')&&typeof _0xf8e652[_0xc301('0x21')]===_0xc301('0x20');var _0x381a6f=_0x1ecead[_0xc301('0x22')];var _0x1c4c56=_0x57db74?0x0:_0xf8e652[_0xc301('0x1f')];var _0x3aeed2=_0x57db74?_0x1ecead[_0xc301('0x22')]:_0xf8e652[_0xc301('0x1f')]+_0xf8e652[_0xc301('0x21')];var _0x20d94b;if(_0x3aeed2>=_0x381a6f){_0x3aeed2=_0x381a6f;_0x20d94b=0xc8;}else{_0x20d94b=0xce;}_0x18fa2d['status'](_0x20d94b);return _0x18fa2d[_0xc301('0x23')](_0xc301('0x24'),_0x1c4c56+'-'+_0x3aeed2+'/'+_0x381a6f)[_0xc301('0x25')](_0x1ecead);}return null;};}function patchUpdates(_0x1d040f){return function(_0x366f38){try{jsonpatch[_0xc301('0x26')](_0x366f38,_0x1d040f,!![]);}catch(_0x5c3b98){return BPromise[_0xc301('0x27')](_0x5c3b98);}return _0x366f38['save']();};}function saveUpdates(_0x8e048c,_0x5cbd99){return function(_0x2e50dc){if(_0x2e50dc){return _0x2e50dc[_0xc301('0x28')](_0x8e048c)['then'](function(_0x490610){return _0x490610;});}return null;};}function removeEntity(_0xfe4ec1,_0x3a9a48){return function(_0x2090b9){if(_0x2090b9){return _0x2090b9[_0xc301('0x29')]()[_0xc301('0x2a')](function(){_0xfe4ec1[_0xc301('0x1e')](0xcc)[_0xc301('0x1d')]();});}};}function handleEntityNotFound(_0x35240d,_0x3b16c2){return function(_0x5da12f){if(!_0x5da12f){_0x35240d[_0xc301('0x2b')](0x194);}return _0x5da12f;};}function handleError(_0x2941f3,_0x56a525){_0x56a525=_0x56a525||0x1f4;return function(_0x4d2022){logger[_0xc301('0x2c')](_0x4d2022['stack']);if(_0x4d2022['name']){delete _0x4d2022['name'];}_0x2941f3['status'](_0x56a525)[_0xc301('0x2d')](_0x4d2022);};}exports[_0xc301('0x2e')]=function(_0x2072c2,_0x3a2b99){var _0x1c970b={},_0x26edc4={},_0x1f4cea={'count':0x0,'rows':[]};var _0x1c0eed=_['map'](db[_0xc301('0x2f')][_0xc301('0x30')],function(_0x33e095){return{'name':_0x33e095[_0xc301('0x31')],'type':_0x33e095[_0xc301('0x32')][_0xc301('0x33')]};});_0x26edc4[_0xc301('0x34')]=_[_0xc301('0x35')](_0x1c0eed,_0xc301('0x36'));_0x26edc4[_0xc301('0x37')]=_[_0xc301('0x38')](_0x2072c2['query']);_0x26edc4[_0xc301('0x39')]=_[_0xc301('0x3a')](_0x26edc4[_0xc301('0x34')],_0x26edc4['query']);_0x1c970b['attributes']=_['intersection'](_0x26edc4[_0xc301('0x34')],qs[_0xc301('0x3b')](_0x2072c2['query'][_0xc301('0x3b')]));_0x1c970b[_0xc301('0x3c')]=_0x1c970b['attributes'][_0xc301('0x3d')]?_0x1c970b[_0xc301('0x3c')]:_0x26edc4['model'];if(!_0x2072c2[_0xc301('0x37')][_0xc301('0x3e')]('nolimit')){_0x1c970b[_0xc301('0x21')]=qs[_0xc301('0x21')](_0x2072c2[_0xc301('0x37')]['limit']);_0x1c970b['offset']=qs[_0xc301('0x1f')](_0x2072c2['query'][_0xc301('0x1f')]);}_0x1c970b[_0xc301('0x3f')]=qs[_0xc301('0x40')](_0x2072c2['query'][_0xc301('0x40')]);_0x1c970b['where']=qs[_0xc301('0x39')](_[_0xc301('0x41')](_0x2072c2['query'],_0x26edc4[_0xc301('0x39')]),_0x1c0eed);if(_0x2072c2[_0xc301('0x37')][_0xc301('0x42')]){_0x1c970b['where']=_['merge'](_0x1c970b[_0xc301('0x43')],{'$or':_[_0xc301('0x35')](_0x1c0eed,function(_0x2583de){if(_0x2583de['type']!==_0xc301('0x44')){var _0x50ef06={};_0x50ef06[_0x2583de[_0xc301('0x36')]]={'$like':'%'+_0x2072c2[_0xc301('0x37')][_0xc301('0x42')]+'%'};return _0x50ef06;}})});}_0x1c970b=_[_0xc301('0x45')]({},_0x1c970b,_0x2072c2[_0xc301('0x46')]);var _0x1aa554={'where':_0x1c970b['where']};return db[_0xc301('0x2f')][_0xc301('0x22')](_0x1aa554)[_0xc301('0x2a')](function(_0x2f871b){_0x1f4cea['count']=_0x2f871b;if(_0x2072c2[_0xc301('0x37')][_0xc301('0x47')]){_0x1c970b[_0xc301('0x48')]=[{'all':!![]}];}return db[_0xc301('0x2f')][_0xc301('0x49')](_0x1c970b);})[_0xc301('0x2a')](function(_0x1dcc39){_0x1f4cea['rows']=_0x1dcc39;return _0x1f4cea;})[_0xc301('0x2a')](respondWithFilteredResult(_0x3a2b99,_0x1c970b))['catch'](handleError(_0x3a2b99,null));};exports[_0xc301('0x4a')]=function(_0x2d426e,_0xdb01e){var _0x4b46d8={'raw':!![],'where':{'id':_0x2d426e[_0xc301('0x4b')]['id']}},_0x15eb94={};_0x15eb94[_0xc301('0x34')]=_['keys'](db[_0xc301('0x2f')][_0xc301('0x30')]);_0x15eb94[_0xc301('0x37')]=_[_0xc301('0x38')](_0x2d426e['query']);_0x15eb94['filters']=_[_0xc301('0x3a')](_0x15eb94[_0xc301('0x34')],_0x15eb94[_0xc301('0x37')]);_0x4b46d8['attributes']=_[_0xc301('0x3a')](_0x15eb94['model'],qs[_0xc301('0x3b')](_0x2d426e[_0xc301('0x37')]['fields']));_0x4b46d8[_0xc301('0x3c')]=_0x4b46d8[_0xc301('0x3c')]['length']?_0x4b46d8['attributes']:_0x15eb94[_0xc301('0x34')];if(_0x2d426e[_0xc301('0x37')][_0xc301('0x47')]){_0x4b46d8[_0xc301('0x48')]=[{'all':!![]}];}_0x4b46d8=_['merge']({},_0x4b46d8,_0x2d426e[_0xc301('0x46')]);return db[_0xc301('0x2f')][_0xc301('0x4c')](_0x4b46d8)[_0xc301('0x2a')](handleEntityNotFound(_0xdb01e,null))[_0xc301('0x2a')](respondWithResult(_0xdb01e,null))['catch'](handleError(_0xdb01e,null));};exports[_0xc301('0x4d')]=function(_0x6f8bf4,_0x122e4e){return db[_0xc301('0x2f')][_0xc301('0x4d')](_0x6f8bf4['body'],{})[_0xc301('0x2a')](respondWithResult(_0x122e4e,0xc9))['catch'](handleError(_0x122e4e,null));};exports[_0xc301('0x28')]=function(_0x3a19ca,_0x140472){if(_0x3a19ca['body']['id']){delete _0x3a19ca[_0xc301('0x4e')]['id'];}return db[_0xc301('0x2f')]['find']({'where':{'id':_0x3a19ca[_0xc301('0x4b')]['id']}})[_0xc301('0x2a')](handleEntityNotFound(_0x140472,null))['then'](saveUpdates(_0x3a19ca[_0xc301('0x4e')],null))[_0xc301('0x2a')](respondWithResult(_0x140472,null))[_0xc301('0x4f')](handleError(_0x140472,null));};exports[_0xc301('0x29')]=function(_0x21dc4e,_0x49dbf1){return db[_0xc301('0x2f')][_0xc301('0x4c')]({'where':{'id':_0x21dc4e[_0xc301('0x4b')]['id']}})[_0xc301('0x2a')](handleEntityNotFound(_0x49dbf1,null))[_0xc301('0x2a')](removeEntity(_0x49dbf1,null))[_0xc301('0x4f')](handleError(_0x49dbf1,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 61c8131..ba78822 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 _0x7688=['analytics_report_trees','lodash','util','../../config/logger','api','moment','path','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x12fe24,_0x4061cd){var _0x309501=function(_0x2c91d8){while(--_0x2c91d8){_0x12fe24['push'](_0x12fe24['shift']());}};_0x309501(++_0x4061cd);}(_0x7688,0x173));var _0x8768=function(_0x10d697,_0xdb207c){_0x10d697=_0x10d697-0x0;var _0x13d86a=_0x7688[_0x10d697];return _0x13d86a;};'use strict';var _=require(_0x8768('0x0'));var util=require(_0x8768('0x1'));var logger=require(_0x8768('0x2'))(_0x8768('0x3'));var moment=require(_0x8768('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8768('0x5'));var rimraf=require('rimraf');var config=require(_0x8768('0x6'));var attributes=require(_0x8768('0x7'));module[_0x8768('0x8')]=function(_0x260341,_0x4b5ed0){return _0x260341['define']('AnalyticTreeReport',attributes,{'tableName':_0x8768('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd350=['exports','AnalyticTreeReport','analytics_report_trees','lodash','api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x3709ca,_0x2a026b){var _0x44e1a8=function(_0x4ac820){while(--_0x4ac820){_0x3709ca['push'](_0x3709ca['shift']());}};_0x44e1a8(++_0x2a026b);}(_0xd350,0x1cf));var _0x0d35=function(_0x3cc05d,_0x4b8f88){_0x3cc05d=_0x3cc05d-0x0;var _0x28b736=_0xd350[_0x3cc05d];return _0x28b736;};'use strict';var _=require(_0x0d35('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0d35('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0d35('0x2'));var fs=require('fs');var path=require(_0x0d35('0x3'));var rimraf=require(_0x0d35('0x4'));var config=require(_0x0d35('0x5'));var attributes=require(_0x0d35('0x6'));module[_0x0d35('0x7')]=function(_0x45b590,_0x29c5a6){return _0x45b590['define'](_0x0d35('0x8'),attributes,{'tableName':_0x0d35('0x9'),'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 40be36d..1c1821d 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x21241d,_0x4069c7){_0x21241d=_0x21241d-0x0;var _0x3c11d1=_0x7a54[_0x21241d];return _0x3c11d1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3382e2,_0x6fbda2){var _0x25381b=function(_0x28cabc){while(--_0x28cabc){_0x3382e2['push'](_0x3382e2['shift']());}};_0x25381b(++_0x6fbda2);}(_0x2ef3,0xba));var _0x32ef=function(_0xd6f43d,_0x583ec3){_0xd6f43d=_0xd6f43d-0x0;var _0x12ea0=_0x2ef3[_0xd6f43d];return _0x12ea0;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 445e204..f1aae76 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 _0x1cd8=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','show'];(function(_0xbd6685,_0x2dad17){var _0x50a71a=function(_0x8911b9){while(--_0x8911b9){_0xbd6685['push'](_0xbd6685['shift']());}};_0x50a71a(++_0x2dad17);}(_0x1cd8,0xcb));var _0x81cd=function(_0x4d7bd5,_0x196f54){_0x4d7bd5=_0x4d7bd5-0x0;var _0x1d37e6=_0x1cd8[_0x4d7bd5];return _0x1d37e6;};'use strict';var multer=require(_0x81cd('0x0'));var util=require(_0x81cd('0x1'));var path=require(_0x81cd('0x2'));var timeout=require(_0x81cd('0x3'));var express=require(_0x81cd('0x4'));var router=express['Router']();var fs_extra=require(_0x81cd('0x5'));var auth=require(_0x81cd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x81cd('0x7'));var controller=require(_0x81cd('0x8'));router['get']('/',auth[_0x81cd('0x9')](),controller[_0x81cd('0xa')]);router['get'](_0x81cd('0xb'),auth[_0x81cd('0x9')](),controller[_0x81cd('0xc')]);router['post']('/',auth[_0x81cd('0x9')](),controller['create']);router[_0x81cd('0xd')](_0x81cd('0xb'),auth[_0x81cd('0x9')](),controller[_0x81cd('0xe')]);router[_0x81cd('0xf')](_0x81cd('0xb'),auth[_0x81cd('0x9')](),controller[_0x81cd('0x10')]);module[_0x81cd('0x11')]=router; \ No newline at end of file +var _0x9b26=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x16ad45,_0x4bcf1d){var _0x51f76c=function(_0x790f59){while(--_0x790f59){_0x16ad45['push'](_0x16ad45['shift']());}};_0x51f76c(++_0x4bcf1d);}(_0x9b26,0x1d7));var _0x69b2=function(_0x362099,_0x19e68f){_0x362099=_0x362099-0x0;var _0x43adb7=_0x9b26[_0x362099];return _0x43adb7;};'use strict';var multer=require(_0x69b2('0x0'));var util=require(_0x69b2('0x1'));var path=require(_0x69b2('0x2'));var timeout=require(_0x69b2('0x3'));var express=require(_0x69b2('0x4'));var router=express[_0x69b2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x69b2('0x6'));var interaction=require(_0x69b2('0x7'));var config=require(_0x69b2('0x8'));var controller=require(_0x69b2('0x9'));router[_0x69b2('0xa')]('/',auth[_0x69b2('0xb')](),controller[_0x69b2('0xc')]);router[_0x69b2('0xa')]('/:id',auth[_0x69b2('0xb')](),controller[_0x69b2('0xd')]);router[_0x69b2('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x69b2('0xf')]('/:id',auth[_0x69b2('0xb')](),controller[_0x69b2('0x10')]);router[_0x69b2('0x11')]('/:id',auth[_0x69b2('0xb')](),controller[_0x69b2('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index c413be4..f0e4e2e 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 _0x0328=['STRING','sequelize','exports'];(function(_0x302013,_0x49d2fd){var _0x1aa768=function(_0x935431){while(--_0x935431){_0x302013['push'](_0x302013['shift']());}};_0x1aa768(++_0x49d2fd);}(_0x0328,0x172));var _0x8032=function(_0x1e578b,_0x1db00c){_0x1e578b=_0x1e578b-0x0;var _0xd491d=_0x0328[_0x1e578b];return _0xd491d;};'use strict';var Sequelize=require(_0x8032('0x0'));module[_0x8032('0x1')]={'name':{'type':Sequelize[_0x8032('0x2')]},'basename':{'type':Sequelize[_0x8032('0x2')]},'type':{'type':Sequelize[_0x8032('0x2')]}}; \ No newline at end of file +var _0xfa2f=['STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfa2f,0xe8));var _0xffa2=function(_0x2f4217,_0x397e98){_0x2f4217=_0x2f4217-0x0;var _0x3fffd9=_0xfa2f[_0x2f4217];return _0x3fffd9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xffa2('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xffa2('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 48c942a..44deaea 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 _0xff1d=['length','hasOwnProperty','sort','filters','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','catch','show','rawAttributes','keys','find','clone','get','createdAt','updatedAt','body','omit','update','create','file','originalname','basename','filename','mimetype','ChatOfflineMessageId','join','root','server/files/attachments/','download','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','then','destroy','stack','name','send','index','map','Attachment','type','key','model','query','intersection','attributes','fields'];(function(_0xa8e337,_0x518b8c){var _0xff00a3=function(_0xc83578){while(--_0xc83578){_0xa8e337['push'](_0xa8e337['shift']());}};_0xff00a3(++_0x518b8c);}(_0xff1d,0x1d2));var _0xdff1=function(_0x5252c8,_0x1adf14){_0x5252c8=_0x5252c8-0x0;var _0x480ac4=_0xff1d[_0x5252c8];return _0x480ac4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdff1('0x0'));var zipdir=require(_0xdff1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdff1('0x2'));var moment=require('moment');var BPromise=require(_0xdff1('0x3'));var Mustache=require(_0xdff1('0x4'));var util=require(_0xdff1('0x5'));var path=require(_0xdff1('0x6'));var sox=require(_0xdff1('0x7'));var csv=require(_0xdff1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdff1('0x9'));var _=require(_0xdff1('0xa'));var squel=require(_0xdff1('0xb'));var crypto=require(_0xdff1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdff1('0xd'));var toCsv=require(_0xdff1('0x8'));var querystring=require(_0xdff1('0xe'));var Papa=require(_0xdff1('0xf'));var Redis=require(_0xdff1('0x10'));var authService=require(_0xdff1('0x11'));var qs=require(_0xdff1('0x12'));var as=require(_0xdff1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdff1('0x14'))(_0xdff1('0x15'));var utils=require(_0xdff1('0x16'));var config=require(_0xdff1('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x198f1c,_0x53f4e6){_0x53f4e6=_0x53f4e6||0xcc;return function(_0x5c0a33){if(_0x5c0a33){return _0x198f1c[_0xdff1('0x18')](_0x53f4e6);}return _0x198f1c[_0xdff1('0x19')](_0x53f4e6)[_0xdff1('0x1a')]();};}function respondWithResult(_0x5185cf,_0x3bf51c){_0x3bf51c=_0x3bf51c||0xc8;return function(_0x279a18){if(_0x279a18){return _0x5185cf[_0xdff1('0x19')](_0x3bf51c)[_0xdff1('0x1b')](_0x279a18);}};}function respondWithFilteredResult(_0x4e9398,_0x6216cd){return function(_0x35d6d0){if(_0x35d6d0){var _0xc5e093=typeof _0x6216cd[_0xdff1('0x1c')]===_0xdff1('0x1d')&&typeof _0x6216cd[_0xdff1('0x1e')]===_0xdff1('0x1d');var _0x3a77b9=_0x35d6d0['count'];var _0x2afc88=_0xc5e093?0x0:_0x6216cd['offset'];var _0x457809=_0xc5e093?_0x35d6d0['count']:_0x6216cd['offset']+_0x6216cd[_0xdff1('0x1e')];var _0x107581;if(_0x457809>=_0x3a77b9){_0x457809=_0x3a77b9;_0x107581=0xc8;}else{_0x107581=0xce;}_0x4e9398[_0xdff1('0x19')](_0x107581);return _0x4e9398[_0xdff1('0x1f')]('Content-Range',_0x2afc88+'-'+_0x457809+'/'+_0x3a77b9)[_0xdff1('0x1b')](_0x35d6d0);}return null;};}function patchUpdates(_0x18eb6e){return function(_0x27773a){try{jsonpatch[_0xdff1('0x20')](_0x27773a,_0x18eb6e,!![]);}catch(_0x14c8f1){return BPromise[_0xdff1('0x21')](_0x14c8f1);}return _0x27773a[_0xdff1('0x22')]();};}function saveUpdates(_0x4418f2,_0x3ff4c6){return function(_0x26a1ab){if(_0x26a1ab){return _0x26a1ab['update'](_0x4418f2)[_0xdff1('0x23')](function(_0x1f52f4){return _0x1f52f4;});}return null;};}function removeEntity(_0x2c4ea2,_0x179923){return function(_0x5a53f1){if(_0x5a53f1){return _0x5a53f1[_0xdff1('0x24')]()[_0xdff1('0x23')](function(){_0x2c4ea2[_0xdff1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6dad,_0x27ca6f){return function(_0x83054c){if(!_0x83054c){_0x2c6dad[_0xdff1('0x18')](0x194);}return _0x83054c;};}function handleError(_0x28205f,_0xf56cca){_0xf56cca=_0xf56cca||0x1f4;return function(_0x54fe84){logger['error'](_0x54fe84[_0xdff1('0x25')]);if(_0x54fe84[_0xdff1('0x26')]){delete _0x54fe84[_0xdff1('0x26')];}_0x28205f[_0xdff1('0x19')](_0xf56cca)[_0xdff1('0x27')](_0x54fe84);};}exports[_0xdff1('0x28')]=function(_0x40853f,_0x46758e){var _0x31cc63={},_0x353099={},_0xaeb334={'count':0x0,'rows':[]};var _0x13d12c=_[_0xdff1('0x29')](db[_0xdff1('0x2a')]['rawAttributes'],function(_0x589370){return{'name':_0x589370['fieldName'],'type':_0x589370[_0xdff1('0x2b')][_0xdff1('0x2c')]};});_0x353099[_0xdff1('0x2d')]=_[_0xdff1('0x29')](_0x13d12c,_0xdff1('0x26'));_0x353099[_0xdff1('0x2e')]=_['keys'](_0x40853f['query']);_0x353099['filters']=_[_0xdff1('0x2f')](_0x353099[_0xdff1('0x2d')],_0x353099[_0xdff1('0x2e')]);_0x31cc63[_0xdff1('0x30')]=_[_0xdff1('0x2f')](_0x353099['model'],qs[_0xdff1('0x31')](_0x40853f[_0xdff1('0x2e')][_0xdff1('0x31')]));_0x31cc63[_0xdff1('0x30')]=_0x31cc63[_0xdff1('0x30')][_0xdff1('0x32')]?_0x31cc63['attributes']:_0x353099[_0xdff1('0x2d')];if(!_0x40853f[_0xdff1('0x2e')][_0xdff1('0x33')]('nolimit')){_0x31cc63[_0xdff1('0x1e')]=qs[_0xdff1('0x1e')](_0x40853f[_0xdff1('0x2e')][_0xdff1('0x1e')]);_0x31cc63[_0xdff1('0x1c')]=qs[_0xdff1('0x1c')](_0x40853f[_0xdff1('0x2e')]['offset']);}_0x31cc63['order']=qs[_0xdff1('0x34')](_0x40853f[_0xdff1('0x2e')]['sort']);_0x31cc63['where']=qs[_0xdff1('0x35')](_[_0xdff1('0x36')](_0x40853f[_0xdff1('0x2e')],_0x353099[_0xdff1('0x35')]),_0x13d12c);if(_0x40853f[_0xdff1('0x2e')]['filter']){_0x31cc63[_0xdff1('0x37')]=_[_0xdff1('0x38')](_0x31cc63[_0xdff1('0x37')],{'$or':_[_0xdff1('0x29')](_0x13d12c,function(_0x1183f7){if(_0x1183f7[_0xdff1('0x2b')]!==_0xdff1('0x39')){var _0x464087={};_0x464087[_0x1183f7[_0xdff1('0x26')]]={'$like':'%'+_0x40853f[_0xdff1('0x2e')][_0xdff1('0x3a')]+'%'};return _0x464087;}})});}_0x31cc63=_[_0xdff1('0x38')]({},_0x31cc63,_0x40853f[_0xdff1('0x3b')]);var _0x508b44={'where':_0x31cc63[_0xdff1('0x37')]};return db[_0xdff1('0x2a')][_0xdff1('0x3c')](_0x508b44)[_0xdff1('0x23')](function(_0x40d10e){_0xaeb334[_0xdff1('0x3c')]=_0x40d10e;if(_0x40853f['query'][_0xdff1('0x3d')]){_0x31cc63[_0xdff1('0x3e')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x31cc63);})['then'](function(_0x137c7e){_0xaeb334['rows']=_0x137c7e;return _0xaeb334;})[_0xdff1('0x23')](respondWithFilteredResult(_0x46758e,_0x31cc63))[_0xdff1('0x3f')](handleError(_0x46758e,null));};exports[_0xdff1('0x40')]=function(_0x10a461,_0x456ef6){var _0x81f69f={'raw':!![],'where':{'id':_0x10a461['params']['id']}},_0x46164c={};_0x46164c[_0xdff1('0x2d')]=_['keys'](db[_0xdff1('0x2a')][_0xdff1('0x41')]);_0x46164c[_0xdff1('0x2e')]=_[_0xdff1('0x42')](_0x10a461['query']);_0x46164c[_0xdff1('0x35')]=_[_0xdff1('0x2f')](_0x46164c[_0xdff1('0x2d')],_0x46164c['query']);_0x81f69f[_0xdff1('0x30')]=_[_0xdff1('0x2f')](_0x46164c[_0xdff1('0x2d')],qs[_0xdff1('0x31')](_0x10a461['query'][_0xdff1('0x31')]));_0x81f69f[_0xdff1('0x30')]=_0x81f69f[_0xdff1('0x30')][_0xdff1('0x32')]?_0x81f69f['attributes']:_0x46164c[_0xdff1('0x2d')];if(_0x10a461[_0xdff1('0x2e')][_0xdff1('0x3d')]){_0x81f69f['include']=[{'all':!![]}];}_0x81f69f=_['merge']({},_0x81f69f,_0x10a461['options']);return db[_0xdff1('0x2a')][_0xdff1('0x43')](_0x81f69f)['then'](handleEntityNotFound(_0x456ef6,null))['then'](respondWithResult(_0x456ef6,null))[_0xdff1('0x3f')](handleError(_0x456ef6,null));};exports[_0xdff1('0x44')]=function(_0x5609a4,_0x201d50){var _0x4990f0={'where':{'id':_0x5609a4['params']['id']}},_0x253593={};_0x253593[_0xdff1('0x2d')]=_[_0xdff1('0x42')](db[_0xdff1('0x2a')][_0xdff1('0x41')]);_0x4990f0[_0xdff1('0x30')]=_[_0xdff1('0x2f')](_0x253593['model'],qs[_0xdff1('0x31')](_0x5609a4[_0xdff1('0x2e')]['fields']));_0x4990f0[_0xdff1('0x30')]=_0x4990f0[_0xdff1('0x30')][_0xdff1('0x32')]?_0x4990f0[_0xdff1('0x30')]:_0x253593['model'];if(_0x5609a4[_0xdff1('0x2e')][_0xdff1('0x3d')]){_0x4990f0['include']=[{'all':!![]}];}_0x4990f0=_['merge']({},_0x4990f0,_0x5609a4[_0xdff1('0x3b')]);return db[_0xdff1('0x2a')][_0xdff1('0x43')](_0x4990f0)[_0xdff1('0x23')](handleEntityNotFound(_0x201d50,null))[_0xdff1('0x23')](function(_0x41cd8e){if(_0x41cd8e){var _0x19872f=_0x41cd8e[_0xdff1('0x45')]({'plain':!![]});_0x19872f=qs['omit'](_0x19872f,['id',_0xdff1('0x46'),_0xdff1('0x47')]);_0x5609a4[_0xdff1('0x48')]=_[_0xdff1('0x49')](_0x5609a4['body'],['id',_0xdff1('0x46'),'updatedAt']);return db['Attachment']['create'](_['merge'](_0x19872f,_0x5609a4['body']),{'include':_0x5609a4[_0xdff1('0x2e')][_0xdff1('0x3d')]?[{'all':!![]}]:undefined});}})[_0xdff1('0x23')](respondWithResult(_0x201d50,0xc9))['catch'](handleError(_0x201d50,null));};exports[_0xdff1('0x4a')]=function(_0x4539bb,_0x497635){if(_0x4539bb[_0xdff1('0x48')]['id']){delete _0x4539bb[_0xdff1('0x48')]['id'];}return db[_0xdff1('0x2a')][_0xdff1('0x43')]({'where':{'id':_0x4539bb['params']['id']}})[_0xdff1('0x23')](handleEntityNotFound(_0x497635,null))['then'](saveUpdates(_0x4539bb['body'],null))['then'](respondWithResult(_0x497635,null))['catch'](handleError(_0x497635,null));};exports[_0xdff1('0x24')]=function(_0x593d85,_0x23b7d6){return db[_0xdff1('0x2a')][_0xdff1('0x43')]({'where':{'id':_0x593d85['params']['id']}})[_0xdff1('0x23')](handleEntityNotFound(_0x23b7d6,null))['then'](removeEntity(_0x23b7d6,null))[_0xdff1('0x3f')](handleError(_0x23b7d6,null));};exports[_0xdff1('0x4b')]=function(_0x50c592,_0x5b67c6,_0x512999){_0x50c592[_0xdff1('0x48')][_0xdff1('0x26')]=_0x50c592[_0xdff1('0x4c')][_0xdff1('0x4d')];_0x50c592[_0xdff1('0x48')][_0xdff1('0x4e')]=_0x50c592[_0xdff1('0x4c')][_0xdff1('0x4f')];_0x50c592[_0xdff1('0x48')]['type']=_0x50c592[_0xdff1('0x4c')][_0xdff1('0x50')];return db['Attachment'][_0xdff1('0x4b')](_0x50c592[_0xdff1('0x48')])[_0xdff1('0x23')](respondWithResult(_0x5b67c6,0xc9))[_0xdff1('0x3f')](handleError(_0x5b67c6,null));};exports['download']=function(_0x124354,_0x106816,_0x241e77){return db[_0xdff1('0x2a')]['findOne']({'where':{'id':_0x124354['params']['id']},'raw':!![]})[_0xdff1('0x23')](handleEntityNotFound(_0x106816,null))['then'](function(_0x58344d){if(_0x58344d){var _0x3794fb=_0x58344d[_0xdff1('0x51')]!==null;var _0x4ed1d6=path[_0xdff1('0x52')](config[_0xdff1('0x53')],_0xdff1('0x54'));if(_0x3794fb){_0x4ed1d6=path[_0xdff1('0x52')](_0x4ed1d6,'offline-chat/');}var _0x352db5=path['join'](_0x4ed1d6,_0x58344d[_0xdff1('0x4e')]);return _0x106816[_0xdff1('0x55')](_0x352db5);}})[_0xdff1('0x3f')](handleError(_0x106816,null));}; \ No newline at end of file +var _0xd2fd=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','clone','get','omit','body','createdAt','updatedAt','create','file','originalname','basename','filename','mimetype','download','findOne','join','server/files/attachments/','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','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','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model'];(function(_0x30b045,_0x5cea47){var _0x290a8b=function(_0x3997cd){while(--_0x3997cd){_0x30b045['push'](_0x30b045['shift']());}};_0x290a8b(++_0x5cea47);}(_0xd2fd,0x1da));var _0xdd2f=function(_0x5a3d74,_0x546dc6){_0x5a3d74=_0x5a3d74-0x0;var _0x5db855=_0xd2fd[_0x5a3d74];return _0x5db855;};'use strict';var emlformat=require(_0xdd2f('0x0'));var rimraf=require(_0xdd2f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd2f('0x2'));var moment=require(_0xdd2f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdd2f('0x4'));var util=require(_0xdd2f('0x5'));var path=require(_0xdd2f('0x6'));var sox=require(_0xdd2f('0x7'));var csv=require(_0xdd2f('0x8'));var ejs=require(_0xdd2f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xdd2f('0xb'));var deskjs=require(_0xdd2f('0xc'));var toCsv=require(_0xdd2f('0x8'));var querystring=require(_0xdd2f('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdd2f('0xe'));var qs=require(_0xdd2f('0xf'));var as=require(_0xdd2f('0x10'));var hardwareService=require(_0xdd2f('0x11'));var logger=require(_0xdd2f('0x12'))(_0xdd2f('0x13'));var utils=require(_0xdd2f('0x14'));var config=require(_0xdd2f('0x15'));var licenseUtil=require(_0xdd2f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24f753,_0x4e0e55){_0x4e0e55=_0x4e0e55||0xcc;return function(_0x322995){if(_0x322995){return _0x24f753[_0xdd2f('0x17')](_0x4e0e55);}return _0x24f753[_0xdd2f('0x18')](_0x4e0e55)[_0xdd2f('0x19')]();};}function respondWithResult(_0x1b0f9d,_0x2b277a){_0x2b277a=_0x2b277a||0xc8;return function(_0x560329){if(_0x560329){return _0x1b0f9d['status'](_0x2b277a)[_0xdd2f('0x1a')](_0x560329);}};}function respondWithFilteredResult(_0x5d99dc,_0xaa3a22){return function(_0x4de182){if(_0x4de182){var _0x3e2a21=typeof _0xaa3a22[_0xdd2f('0x1b')]===_0xdd2f('0x1c')&&typeof _0xaa3a22[_0xdd2f('0x1d')]===_0xdd2f('0x1c');var _0x24790b=_0x4de182['count'];var _0x521747=_0x3e2a21?0x0:_0xaa3a22[_0xdd2f('0x1b')];var _0x581905=_0x3e2a21?_0x4de182['count']:_0xaa3a22[_0xdd2f('0x1b')]+_0xaa3a22[_0xdd2f('0x1d')];var _0x24e2fc;if(_0x581905>=_0x24790b){_0x581905=_0x24790b;_0x24e2fc=0xc8;}else{_0x24e2fc=0xce;}_0x5d99dc[_0xdd2f('0x18')](_0x24e2fc);return _0x5d99dc[_0xdd2f('0x1e')](_0xdd2f('0x1f'),_0x521747+'-'+_0x581905+'/'+_0x24790b)['json'](_0x4de182);}return null;};}function patchUpdates(_0x1066fb){return function(_0x4992d8){try{jsonpatch[_0xdd2f('0x20')](_0x4992d8,_0x1066fb,!![]);}catch(_0x19eb9f){return BPromise['reject'](_0x19eb9f);}return _0x4992d8['save']();};}function saveUpdates(_0x31e470,_0x30be65){return function(_0x5bf912){if(_0x5bf912){return _0x5bf912[_0xdd2f('0x21')](_0x31e470)[_0xdd2f('0x22')](function(_0x3b350d){return _0x3b350d;});}return null;};}function removeEntity(_0x2db51a,_0x788678){return function(_0x2b736b){if(_0x2b736b){return _0x2b736b[_0xdd2f('0x23')]()['then'](function(){_0x2db51a[_0xdd2f('0x18')](0xcc)[_0xdd2f('0x19')]();});}};}function handleEntityNotFound(_0x460ca1,_0x554cd8){return function(_0xd6cf33){if(!_0xd6cf33){_0x460ca1['sendStatus'](0x194);}return _0xd6cf33;};}function handleError(_0x4b8c6b,_0x36e2ef){_0x36e2ef=_0x36e2ef||0x1f4;return function(_0x4607ac){logger[_0xdd2f('0x24')](_0x4607ac[_0xdd2f('0x25')]);if(_0x4607ac[_0xdd2f('0x26')]){delete _0x4607ac['name'];}_0x4b8c6b[_0xdd2f('0x18')](_0x36e2ef)[_0xdd2f('0x27')](_0x4607ac);};}exports[_0xdd2f('0x28')]=function(_0xfc4e8c,_0x35262d){var _0x5a8a63={},_0x307f5e={},_0x5a99dd={'count':0x0,'rows':[]};var _0x482bcc=_[_0xdd2f('0x29')](db[_0xdd2f('0x2a')][_0xdd2f('0x2b')],function(_0x3a0037){return{'name':_0x3a0037[_0xdd2f('0x2c')],'type':_0x3a0037[_0xdd2f('0x2d')][_0xdd2f('0x2e')]};});_0x307f5e[_0xdd2f('0x2f')]=_[_0xdd2f('0x29')](_0x482bcc,_0xdd2f('0x26'));_0x307f5e[_0xdd2f('0x30')]=_[_0xdd2f('0x31')](_0xfc4e8c[_0xdd2f('0x30')]);_0x307f5e[_0xdd2f('0x32')]=_[_0xdd2f('0x33')](_0x307f5e['model'],_0x307f5e['query']);_0x5a8a63['attributes']=_[_0xdd2f('0x33')](_0x307f5e[_0xdd2f('0x2f')],qs[_0xdd2f('0x34')](_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x34')]));_0x5a8a63['attributes']=_0x5a8a63[_0xdd2f('0x35')][_0xdd2f('0x36')]?_0x5a8a63[_0xdd2f('0x35')]:_0x307f5e[_0xdd2f('0x2f')];if(!_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x37')](_0xdd2f('0x38'))){_0x5a8a63[_0xdd2f('0x1d')]=qs['limit'](_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x1d')]);_0x5a8a63[_0xdd2f('0x1b')]=qs[_0xdd2f('0x1b')](_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x1b')]);}_0x5a8a63['order']=qs[_0xdd2f('0x39')](_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x39')]);_0x5a8a63[_0xdd2f('0x3a')]=qs['filters'](_['pick'](_0xfc4e8c[_0xdd2f('0x30')],_0x307f5e[_0xdd2f('0x32')]),_0x482bcc);if(_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x3b')]){_0x5a8a63[_0xdd2f('0x3a')]=_[_0xdd2f('0x3c')](_0x5a8a63[_0xdd2f('0x3a')],{'$or':_['map'](_0x482bcc,function(_0x10d0ff){if(_0x10d0ff[_0xdd2f('0x2d')]!=='VIRTUAL'){var _0x57b5aa={};_0x57b5aa[_0x10d0ff[_0xdd2f('0x26')]]={'$like':'%'+_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x3b')]+'%'};return _0x57b5aa;}})});}_0x5a8a63=_[_0xdd2f('0x3c')]({},_0x5a8a63,_0xfc4e8c[_0xdd2f('0x3d')]);var _0x3f4371={'where':_0x5a8a63[_0xdd2f('0x3a')]};return db[_0xdd2f('0x2a')][_0xdd2f('0x3e')](_0x3f4371)[_0xdd2f('0x22')](function(_0x5c6381){_0x5a99dd['count']=_0x5c6381;if(_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x3f')]){_0x5a8a63[_0xdd2f('0x40')]=[{'all':!![]}];}return db['Attachment'][_0xdd2f('0x41')](_0x5a8a63);})[_0xdd2f('0x22')](function(_0x6c681){_0x5a99dd[_0xdd2f('0x42')]=_0x6c681;return _0x5a99dd;})['then'](respondWithFilteredResult(_0x35262d,_0x5a8a63))[_0xdd2f('0x43')](handleError(_0x35262d,null));};exports[_0xdd2f('0x44')]=function(_0x499cd0,_0x3f188b){var _0x526d86={'raw':!![],'where':{'id':_0x499cd0[_0xdd2f('0x45')]['id']}},_0x2e1821={};_0x2e1821['model']=_[_0xdd2f('0x31')](db[_0xdd2f('0x2a')][_0xdd2f('0x2b')]);_0x2e1821[_0xdd2f('0x30')]=_['keys'](_0x499cd0[_0xdd2f('0x30')]);_0x2e1821[_0xdd2f('0x32')]=_['intersection'](_0x2e1821[_0xdd2f('0x2f')],_0x2e1821[_0xdd2f('0x30')]);_0x526d86[_0xdd2f('0x35')]=_[_0xdd2f('0x33')](_0x2e1821[_0xdd2f('0x2f')],qs[_0xdd2f('0x34')](_0x499cd0[_0xdd2f('0x30')][_0xdd2f('0x34')]));_0x526d86['attributes']=_0x526d86[_0xdd2f('0x35')]['length']?_0x526d86[_0xdd2f('0x35')]:_0x2e1821[_0xdd2f('0x2f')];if(_0x499cd0[_0xdd2f('0x30')]['includeAll']){_0x526d86['include']=[{'all':!![]}];}_0x526d86=_['merge']({},_0x526d86,_0x499cd0[_0xdd2f('0x3d')]);return db[_0xdd2f('0x2a')][_0xdd2f('0x46')](_0x526d86)[_0xdd2f('0x22')](handleEntityNotFound(_0x3f188b,null))[_0xdd2f('0x22')](respondWithResult(_0x3f188b,null))[_0xdd2f('0x43')](handleError(_0x3f188b,null));};exports[_0xdd2f('0x47')]=function(_0x4d91b1,_0x44b17a){var _0xb83f42={'where':{'id':_0x4d91b1[_0xdd2f('0x45')]['id']}},_0x2f79b4={};_0x2f79b4[_0xdd2f('0x2f')]=_[_0xdd2f('0x31')](db[_0xdd2f('0x2a')]['rawAttributes']);_0xb83f42['attributes']=_['intersection'](_0x2f79b4[_0xdd2f('0x2f')],qs[_0xdd2f('0x34')](_0x4d91b1[_0xdd2f('0x30')][_0xdd2f('0x34')]));_0xb83f42['attributes']=_0xb83f42[_0xdd2f('0x35')][_0xdd2f('0x36')]?_0xb83f42[_0xdd2f('0x35')]:_0x2f79b4['model'];if(_0x4d91b1[_0xdd2f('0x30')][_0xdd2f('0x3f')]){_0xb83f42[_0xdd2f('0x40')]=[{'all':!![]}];}_0xb83f42=_['merge']({},_0xb83f42,_0x4d91b1[_0xdd2f('0x3d')]);return db[_0xdd2f('0x2a')][_0xdd2f('0x46')](_0xb83f42)[_0xdd2f('0x22')](handleEntityNotFound(_0x44b17a,null))[_0xdd2f('0x22')](function(_0x2ce70c){if(_0x2ce70c){var _0x2d6b9d=_0x2ce70c[_0xdd2f('0x48')]({'plain':!![]});_0x2d6b9d=qs[_0xdd2f('0x49')](_0x2d6b9d,['id','createdAt','updatedAt']);_0x4d91b1[_0xdd2f('0x4a')]=_['omit'](_0x4d91b1[_0xdd2f('0x4a')],['id',_0xdd2f('0x4b'),_0xdd2f('0x4c')]);return db[_0xdd2f('0x2a')][_0xdd2f('0x4d')](_[_0xdd2f('0x3c')](_0x2d6b9d,_0x4d91b1['body']),{'include':_0x4d91b1[_0xdd2f('0x30')][_0xdd2f('0x3f')]?[{'all':!![]}]:undefined});}})[_0xdd2f('0x22')](respondWithResult(_0x44b17a,0xc9))['catch'](handleError(_0x44b17a,null));};exports[_0xdd2f('0x21')]=function(_0x2b7001,_0x55d53d){if(_0x2b7001[_0xdd2f('0x4a')]['id']){delete _0x2b7001[_0xdd2f('0x4a')]['id'];}return db[_0xdd2f('0x2a')][_0xdd2f('0x46')]({'where':{'id':_0x2b7001[_0xdd2f('0x45')]['id']}})[_0xdd2f('0x22')](handleEntityNotFound(_0x55d53d,null))['then'](saveUpdates(_0x2b7001[_0xdd2f('0x4a')],null))[_0xdd2f('0x22')](respondWithResult(_0x55d53d,null))[_0xdd2f('0x43')](handleError(_0x55d53d,null));};exports['destroy']=function(_0x2bb77d,_0x15771e){return db[_0xdd2f('0x2a')][_0xdd2f('0x46')]({'where':{'id':_0x2bb77d['params']['id']}})['then'](handleEntityNotFound(_0x15771e,null))[_0xdd2f('0x22')](removeEntity(_0x15771e,null))[_0xdd2f('0x43')](handleError(_0x15771e,null));};exports['create']=function(_0x445d7f,_0x28691a,_0x37795e){_0x445d7f['body'][_0xdd2f('0x26')]=_0x445d7f[_0xdd2f('0x4e')][_0xdd2f('0x4f')];_0x445d7f['body'][_0xdd2f('0x50')]=_0x445d7f['file'][_0xdd2f('0x51')];_0x445d7f[_0xdd2f('0x4a')][_0xdd2f('0x2d')]=_0x445d7f['file'][_0xdd2f('0x52')];return db['Attachment']['create'](_0x445d7f[_0xdd2f('0x4a')])[_0xdd2f('0x22')](respondWithResult(_0x28691a,0xc9))[_0xdd2f('0x43')](handleError(_0x28691a,null));};exports[_0xdd2f('0x53')]=function(_0x1200fb,_0x2431e5,_0x6ea29f){return db[_0xdd2f('0x2a')][_0xdd2f('0x54')]({'where':{'id':_0x1200fb[_0xdd2f('0x45')]['id']},'raw':!![]})[_0xdd2f('0x22')](handleEntityNotFound(_0x2431e5,null))[_0xdd2f('0x22')](function(_0x210763){if(_0x210763){var _0x1bda05=_0x210763['ChatOfflineMessageId']!==null;var _0x17d933=path[_0xdd2f('0x55')](config['root'],_0xdd2f('0x56'));if(_0x1bda05){_0x17d933=path[_0xdd2f('0x55')](_0x17d933,'offline-chat/');}var _0x1a2a3a=path[_0xdd2f('0x55')](_0x17d933,_0x210763[_0xdd2f('0x50')]);return _0x2431e5['download'](_0x1a2a3a);}})[_0xdd2f('0x43')](handleError(_0x2431e5,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 1e15eec..75b338e 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 _0xeda3=['path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','request-promise'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0xeda3,0x8b));var _0x3eda=function(_0x29f59b,_0x163fae){_0x29f59b=_0x29f59b-0x0;var _0xb18960=_0xeda3[_0x29f59b];return _0xb18960;};'use strict';var _=require(_0x3eda('0x0'));var util=require(_0x3eda('0x1'));var logger=require(_0x3eda('0x2'))(_0x3eda('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3eda('0x4'));var fs=require('fs');var path=require(_0x3eda('0x5'));var rimraf=require('rimraf');var config=require(_0x3eda('0x6'));var attributes=require(_0x3eda('0x7'));module[_0x3eda('0x8')]=function(_0x1957bf,_0x1ad3ac){return _0x1957bf[_0x3eda('0x9')](_0x3eda('0xa'),attributes,{'tableName':_0x3eda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed1a=['../../config/logger','api','moment','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xed1a,0x6b));var _0xaed1=function(_0x4a8f91,_0x462fa6){_0x4a8f91=_0x4a8f91-0x0;var _0x445b73=_0xed1a[_0x4a8f91];return _0x445b73;};'use strict';var _=require(_0xaed1('0x0'));var util=require('util');var logger=require(_0xaed1('0x1'))(_0xaed1('0x2'));var moment=require(_0xaed1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaed1('0x4'));var rimraf=require(_0xaed1('0x5'));var config=require(_0xaed1('0x6'));var attributes=require(_0xaed1('0x7'));module[_0xaed1('0x8')]=function(_0x39da32,_0xe3fa64){return _0x39da32[_0xaed1('0x9')](_0xaed1('0xa'),attributes,{'tableName':_0xaed1('0xb'),'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 4164bb2..8eb38bc 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 _0x31c2=['CreateAttachment','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Attachment','create','body','options','raw'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0x31c2,0x98));var _0x231c=function(_0xb2f5d2,_0x98f388){_0xb2f5d2=_0xb2f5d2-0x0;var _0x3488fe=_0x31c2[_0xb2f5d2];return _0x3488fe;};'use strict';var _=require(_0x231c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x231c('0x1'));var rs=require(_0x231c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x231c('0x3'))['db'];var utils=require(_0x231c('0x4'));var logger=require(_0x231c('0x5'))(_0x231c('0x6'));var config=require(_0x231c('0x7'));var jayson=require(_0x231c('0x8'));var client=jayson[_0x231c('0x9')][_0x231c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afc76,_0x1e3997,_0x4fd8b8){return new BPromise(function(_0x3dfccb,_0x396da8){return client[_0x231c('0xb')](_0x5afc76,_0x4fd8b8)[_0x231c('0xc')](function(_0x4cd3b8){logger[_0x231c('0xd')](_0x231c('0xe'),_0x1e3997,_0x231c('0xf'));logger[_0x231c('0x10')](_0x231c('0x11'),_0x1e3997,_0x231c('0xf'),JSON['stringify'](_0x4cd3b8));if(_0x4cd3b8['error']){if(_0x4cd3b8['error'][_0x231c('0x12')]===0x1f4){logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x396da8(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x3dfccb(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}else{logger[_0x231c('0xd')]('Attachment,\x20%s,\x20%s',_0x1e3997,_0x231c('0xf'));_0x3dfccb(_0x4cd3b8[_0x231c('0x15')][_0x231c('0x14')]);}})[_0x231c('0x16')](function(_0x40f4f6){logger['error'](_0x231c('0xe'),_0x1e3997,_0x40f4f6);_0x396da8(_0x40f4f6);});});}exports['CreateAttachment']=function(_0x1d48e3){var _0x59282c=this;return new Promise(function(_0x286148,_0x34f391){return db[_0x231c('0x17')][_0x231c('0x18')](_0x1d48e3[_0x231c('0x19')],{'raw':_0x1d48e3[_0x231c('0x1a')]?_0x1d48e3[_0x231c('0x1a')][_0x231c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x29a94){logger[_0x231c('0xd')](_0x231c('0x1c'),_0x1d48e3);logger['debug']('CreateAttachment',_0x1d48e3,JSON[_0x231c('0x1d')](_0x29a94));_0x286148(_0x29a94);})[_0x231c('0x16')](function(_0x3bd9ed){logger['error'](_0x231c('0x1c'),_0x3bd9ed['message'],_0x1d48e3);_0x34f391(_0x59282c[_0x231c('0x13')](0x1f4,_0x3bd9ed[_0x231c('0x14')]));});});}; \ No newline at end of file +var _0x80df=['catch','CreateAttachment','Attachment','create','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var moment=require(_0xf80d('0x2'));var BPromise=require(_0xf80d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x4'));var db=require(_0xf80d('0x5'))['db'];var utils=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var jayson=require(_0xf80d('0xa'));var client=jayson[_0xf80d('0xb')][_0xf80d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x62e50f,_0x5068d4,_0x30e2b3){return new BPromise(function(_0x16b219,_0x2f56b3){return client[_0xf80d('0xd')](_0x62e50f,_0x30e2b3)[_0xf80d('0xe')](function(_0x186339){logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));logger[_0xf80d('0x12')](_0xf80d('0x13'),_0x5068d4,_0xf80d('0x11'),JSON[_0xf80d('0x14')](_0x186339));if(_0x186339[_0xf80d('0x15')]){if(_0x186339['error']['code']===0x1f4){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x2f56b3(_0x186339['error'][_0xf80d('0x16')]);}logger['error'](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x16b219(_0x186339[_0xf80d('0x15')][_0xf80d('0x16')]);}else{logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));_0x16b219(_0x186339[_0xf80d('0x17')][_0xf80d('0x16')]);}})[_0xf80d('0x18')](function(_0x3b8a82){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x3b8a82);_0x2f56b3(_0x3b8a82);});});}exports[_0xf80d('0x19')]=function(_0x1d104a){var _0x34b49d=this;return new Promise(function(_0x2ea2c1,_0x7ba89c){return db[_0xf80d('0x1a')][_0xf80d('0x1b')](_0x1d104a['body'],{'raw':_0x1d104a[_0xf80d('0x1c')]?_0x1d104a[_0xf80d('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf80d('0xe')](function(_0x539c80){logger[_0xf80d('0xf')](_0xf80d('0x19'),_0x1d104a);logger[_0xf80d('0x12')](_0xf80d('0x19'),_0x1d104a,JSON[_0xf80d('0x14')](_0x539c80));_0x2ea2c1(_0x539c80);})[_0xf80d('0x18')](function(_0x446153){logger[_0xf80d('0x15')](_0xf80d('0x19'),_0x446153[_0xf80d('0x16')],_0x1d104a);_0x7ba89c(_0x34b49d[_0xf80d('0x15')](0x1f4,_0x446153[_0xf80d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 5cc3312..0aa459e 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x469414,_0x303535){var _0x495fde=function(_0xd58ad0){while(--_0xd58ad0){_0x469414['push'](_0x469414['shift']());}};_0x495fde(++_0x303535);}(_0x2032,0xd9));var _0x2203=function(_0x4e7603,_0x42f87d){_0x4e7603=_0x4e7603-0x0;var _0x413b08=_0x2032[_0x4e7603];return _0x413b08;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x113aeb,_0x215442){var _0xc0a75f=function(_0x4bbc76){while(--_0x4bbc76){_0x113aeb['push'](_0x113aeb['shift']());}};_0xc0a75f(++_0x215442);}(_0xb10b,0x12a));var _0xbb10=function(_0x163691,_0x3d10c4){_0x163691=_0x163691-0x0;var _0x543ae5=_0xb10b[_0x163691];return _0x543ae5;};'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('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index cb2809b..ddbee83 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 _0x3861=['authenticate','google','/login','callback','use','clientID','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','find','map','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login'];(function(_0x463376,_0x13871c){var _0x336ccd=function(_0x33afd2){while(--_0x33afd2){_0x463376['push'](_0x463376['shift']());}};_0x336ccd(++_0x13871c);}(_0x3861,0x80));var _0x1386=function(_0x434e47,_0x3ac472){_0x434e47=_0x434e47-0x0;var _0x46febc=_0x3861[_0x434e47];return _0x46febc;};'use strict';var _=require(_0x1386('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x1386('0x1'))[_0x1386('0x2')];var moment=require('moment');var db=require(_0x1386('0x3'))['db'];var config=require(_0x1386('0x4'));var signToken=require(_0x1386('0x5'))[_0x1386('0x6')];var utils=require('../../config/utils');exports[_0x1386('0x7')]=passport[_0x1386('0x8')](_0x1386('0x9'),{'failureRedirect':_0x1386('0xa'),'scope':['profile','email'],'session':![]});exports[_0x1386('0xb')]=passport[_0x1386('0x8')]('google',{'failureRedirect':_0x1386('0xa'),'session':![]});passport[_0x1386('0xc')](new GoogleStrategy({'clientID':config[_0x1386('0x9')]?config['google'][_0x1386('0xd')]:'id','clientSecret':config['google']?config[_0x1386('0x9')]['clientSecret']:'secret','callbackURL':config[_0x1386('0x9')]?config['google'][_0x1386('0xe')]:''},function(_0x2c6f24,_0x1336ed,_0x53fc01,_0x47e247){var _0x4796b9,_0x2338ae;return db[_0x1386('0xf')][_0x1386('0x10')]({'where':{'id':0x1},'attributes':[_0x1386('0x11'),_0x1386('0x12')],'raw':!![]})[_0x1386('0x13')](function(_0x1597d0){_0x4796b9=_0x1597d0;return db['User'][_0x1386('0x14')]({'where':{'email':_[_0x1386('0x15')](_0x53fc01[_0x1386('0x16')],'value'),'role':{'$or':[_0x1386('0x17'),_0x1386('0x18'),_0x1386('0x19')]}}});})[_0x1386('0x13')](function(_0x265997){_0x2338ae=_0x265997;if(_0x2338ae){if(_0x2338ae[_0x1386('0x1a')]){return _0x47e247(_0x1386('0x1b'));}else if(_0x4796b9[_0x1386('0x12')]>0x0){if(_0x2338ae['blocked']){if(moment(_0x2338ae[_0x1386('0x1c')])[_0x1386('0x1d')](_0x4796b9[_0x1386('0x12')],_0x1386('0x1e'))>moment()){return _0x47e247(_0x1386('0x1b'));}else{return utils[_0x1386('0x1f')](_0x2338ae,0x0,![],null)[_0x1386('0x13')](function(){return utils[_0x1386('0x20')](_0x2338ae);})[_0x1386('0x13')](function(){return _0x47e247(null,_0x2338ae);});}}else{return utils[_0x1386('0x20')](_0x2338ae)[_0x1386('0x13')](function(){return _0x47e247(null,_0x2338ae);});}}else{return utils['getLicense'](_0x2338ae)[_0x1386('0x13')](function(){return _0x47e247(null,_0x2338ae);});}}return _0x47e247(_0x1386('0x1b'));})[_0x1386('0x21')](function(_0x5ec8ea){_0x47e247(_0x5ec8ea);});})); \ No newline at end of file +var _0x9daf=['authenticate','google','/login','profile','email','callback','use','secret','findOne','allowedLoginAttempts','blockDuration','then','find','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login'];(function(_0x2938b9,_0x52e916){var _0x20b12a=function(_0x11c439){while(--_0x11c439){_0x2938b9['push'](_0x2938b9['shift']());}};_0x20b12a(++_0x52e916);}(_0x9daf,0x16d));var _0xf9da=function(_0xaa7629,_0x219723){_0xaa7629=_0xaa7629-0x0;var _0x487c07=_0x9daf[_0xaa7629];return _0x487c07;};'use strict';var _=require(_0xf9da('0x0'));var passport=require(_0xf9da('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0xf9da('0x2')];var moment=require(_0xf9da('0x3'));var db=require(_0xf9da('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0xf9da('0x5'))[_0xf9da('0x6')];var utils=require(_0xf9da('0x7'));exports[_0xf9da('0x8')]=passport[_0xf9da('0x9')](_0xf9da('0xa'),{'failureRedirect':_0xf9da('0xb'),'scope':[_0xf9da('0xc'),_0xf9da('0xd')],'session':![]});exports[_0xf9da('0xe')]=passport[_0xf9da('0x9')](_0xf9da('0xa'),{'failureRedirect':_0xf9da('0xb'),'session':![]});passport[_0xf9da('0xf')](new GoogleStrategy({'clientID':config[_0xf9da('0xa')]?config[_0xf9da('0xa')]['clientID']:'id','clientSecret':config['google']?config[_0xf9da('0xa')]['clientSecret']:_0xf9da('0x10'),'callbackURL':config[_0xf9da('0xa')]?config[_0xf9da('0xa')]['callbackURL']:''},function(_0x5925e8,_0x5f5b0f,_0x5a843b,_0x250a01){var _0x396adf,_0x32fabb;return db['Setting'][_0xf9da('0x11')]({'where':{'id':0x1},'attributes':[_0xf9da('0x12'),_0xf9da('0x13')],'raw':!![]})[_0xf9da('0x14')](function(_0x205a0a){_0x396adf=_0x205a0a;return db['User'][_0xf9da('0x15')]({'where':{'email':_['map'](_0x5a843b[_0xf9da('0x16')],_0xf9da('0x17')),'role':{'$or':[_0xf9da('0x18'),_0xf9da('0x19'),_0xf9da('0x1a')]}}});})['then'](function(_0x187cc3){_0x32fabb=_0x187cc3;if(_0x32fabb){if(_0x32fabb[_0xf9da('0x1b')]){return _0x250a01(_0xf9da('0x1c'));}else if(_0x396adf['blockDuration']>0x0){if(_0x32fabb['blocked']){if(moment(_0x32fabb['blockedAt'])[_0xf9da('0x1d')](_0x396adf[_0xf9da('0x13')],_0xf9da('0x1e'))>moment()){return _0x250a01(_0xf9da('0x1c'));}else{return utils[_0xf9da('0x1f')](_0x32fabb,0x0,![],null)['then'](function(){return utils[_0xf9da('0x20')](_0x32fabb);})['then'](function(){return _0x250a01(null,_0x32fabb);});}}else{return utils['getLicense'](_0x32fabb)[_0xf9da('0x14')](function(){return _0x250a01(null,_0x32fabb);});}}else{return utils[_0xf9da('0x20')](_0x32fabb)[_0xf9da('0x14')](function(){return _0x250a01(null,_0x32fabb);});}}return _0x250a01(_0xf9da('0x1c'));})[_0xf9da('0x21')](function(_0x47d605){_0x250a01(_0x47d605);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 77c5255..b25af48 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 _0x7fac=['login','setTokenCookie','exports','express','Router','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0x7fac,0x137));var _0xc7fa=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0x7fac[_0x529f1c];return _0x4d57ab;};'use strict';var express=require(_0xc7fa('0x0'));var passport=require('passport');var router=express[_0xc7fa('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xc7fa('0x2'));var authService=require(_0xc7fa('0x3'));router[_0xc7fa('0x4')]('/',controller['login']);router[_0xc7fa('0x4')](_0xc7fa('0x5'),controller[_0xc7fa('0x6')],authService[_0xc7fa('0x7')],userController[_0xc7fa('0x8')],authService[_0xc7fa('0x9')]);module[_0xc7fa('0xa')]=router; \ No newline at end of file +var _0x7649=['get','/callback','callback','isMiddleware','setTokenCookie','exports','express','Router','./authGoogle.controller','../../components/auth/service','login'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7649,0x1df));var _0x9764=function(_0x522d1f,_0x9246e2){_0x522d1f=_0x522d1f-0x0;var _0x2d652d=_0x7649[_0x522d1f];return _0x2d652d;};'use strict';var express=require(_0x9764('0x0'));var passport=require('passport');var router=express[_0x9764('0x1')]();var controller=require(_0x9764('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x9764('0x3'));router['get']('/',controller[_0x9764('0x4')]);router[_0x9764('0x5')](_0x9764('0x6'),controller[_0x9764('0x7')],authService[_0x9764('0x8')],userController[_0x9764('0x4')],authService[_0x9764('0x9')]);module[_0x9764('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 16476b2..65d0e96 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 _0xffda=['error','message','stringify','status','send','login','authenticate','local','role','signToken','json','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','/reset/','Reset\x20Email\x20sent!','reset','params','token','enforcePasswordHistory','securePassword','validatePasswordPattern','previousPasswords','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','client','http','Setting','findOne','then','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','blockDuration','minutes','clearBlockUser','getLicense','catch','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','format','user','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!'];(function(_0x26defc,_0x23c1bb){var _0x467fe8=function(_0xc9707f){while(--_0xc9707f){_0x26defc['push'](_0x26defc['shift']());}};_0x467fe8(++_0x23c1bb);}(_0xffda,0x73));var _0xaffd=function(_0x1002a3,_0x4b7184){_0x1002a3=_0x1002a3-0x0;var _0x328e80=_0xffda[_0x1002a3];return _0x328e80;};'use strict';var util=require(_0xaffd('0x0'));var passport=require(_0xaffd('0x1'));var LocalStrategy=require(_0xaffd('0x2'))[_0xaffd('0x3')];var jayson=require('jayson/promise');var _=require(_0xaffd('0x4'));var rs=require(_0xaffd('0x5'));var moment=require(_0xaffd('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0xaffd('0x7'));var utils=require('../../config/utils');var client=jayson[_0xaffd('0x8')][_0xaffd('0x9')]({'port':0x232b});function localAuthenticate(_0x5747e0,_0x4ca99e,_0x39b2e5,_0x12865c){var _0x3647e1,_0x514b76;return db[_0xaffd('0xa')][_0xaffd('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xaffd('0xc')](function(_0x42159b){_0x3647e1=_0x42159b;return _0x5747e0[_0xaffd('0xb')]({'attributes':['id','name',_0xaffd('0xd'),_0xaffd('0xe'),'role',_0xaffd('0xf'),_0xaffd('0x10'),_0xaffd('0x11'),_0xaffd('0x12')],'where':{'name':_0x4ca99e,'role':{'$or':[_0xaffd('0x13'),'user',_0xaffd('0x14')]}}});})['then'](function(_0x513bc8){if(!_0x513bc8||_0x513bc8&&_0x513bc8[_0xaffd('0x15')]!==_0x4ca99e){throw new Error(_0xaffd('0x16'));}else{_0x514b76=_0x513bc8;return _0x514b76;}})[_0xaffd('0xc')](function(){_0x514b76['authenticate'](_0x39b2e5,function(_0x2b0b99,_0x35ebc6){var _0x14caba=_0x514b76[_0xaffd('0x12')]+0x1;if(_0x2b0b99){return _0x12865c(_0x2b0b99);}else if(!_0x35ebc6){if(_0x514b76[_0xaffd('0xf')]){return _0x12865c(null,![],{'message':_0xaffd('0x16')});}else if(_0x3647e1[_0xaffd('0x17')]>0x0){if(_0x514b76[_0xaffd('0x10')]){if(_0x3647e1['blockDuration']>0x0){if(moment(_0x514b76[_0xaffd('0x11')])[_0xaffd('0x18')](_0x3647e1[_0xaffd('0x19')],_0xaffd('0x1a'))>moment()){return _0x12865c(null,![],{'message':_0xaffd('0x16')});}else{return utils[_0xaffd('0x1b')](_0x514b76,_0x14caba,![],null)['then'](function(){return _0x12865c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x12865c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x14caba>=_0x3647e1[_0xaffd('0x17')]){return utils[_0xaffd('0x1b')](_0x514b76,0x0,!![],moment())['then'](function(){return _0x12865c(null,![],{'message':_0xaffd('0x16')});});}else{return utils[_0xaffd('0x1b')](_0x514b76,_0x14caba,![],null)[_0xaffd('0xc')](function(){return _0x12865c(null,![],{'message':_0xaffd('0x16')});});}}}else{return _0x12865c(null,![],{'message':_0xaffd('0x16')});}}else{if(_0x514b76[_0xaffd('0xf')]){return _0x12865c(null,![],{'message':_0xaffd('0x16')});}else if(_0x3647e1[_0xaffd('0x17')]>0x0){if(_0x514b76[_0xaffd('0x10')]){if(_0x3647e1[_0xaffd('0x19')]>0x0){if(moment(_0x514b76[_0xaffd('0x11')])[_0xaffd('0x18')](_0x3647e1[_0xaffd('0x19')],_0xaffd('0x1a'))>moment()){return _0x12865c(null,![],{'message':_0xaffd('0x16')});}else{return utils[_0xaffd('0x1b')](_0x514b76,0x0,![],null)[_0xaffd('0xc')](function(){return utils[_0xaffd('0x1c')](_0x514b76);})['then'](function(){return _0x12865c(null,_0x514b76);});}}else{return _0x12865c(null,![],{'message':_0xaffd('0x16')});}}else{return utils[_0xaffd('0x1b')](_0x514b76,0x0,![],null)[_0xaffd('0xc')](function(){return utils[_0xaffd('0x1c')](_0x514b76);})[_0xaffd('0xc')](function(){return _0x12865c(null,_0x514b76);})[_0xaffd('0x1d')](function(_0x401ad7){return _0x12865c(null,![],_0x401ad7);});}}else{if(_0x514b76[_0xaffd('0x10')]){return _0x12865c(null,![],{'message':_0xaffd('0x16')});}else{return utils['getLicense'](_0x514b76)[_0xaffd('0xc')](function(){return _0x12865c(null,_0x514b76);});}}}});})['catch'](function(_0x5a7fe0){return _0x12865c(null,![],_0x5a7fe0);});}function sendServiceMail(_0x1f4da9){return db['MailAccount'][_0xaffd('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xaffd('0x15'),_0xaffd('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0xaffd('0x20')}]})[_0xaffd('0xc')](function(_0x193926){if(!_0x193926){throw new Error(_0xaffd('0x21'));}var _0xa4f13={'tls':{'rejectUnauthorized':![]}};if(_0x193926['Smtp']['service']){_0xa4f13[_0xaffd('0x22')]=_0x193926['Smtp'][_0xaffd('0x22')];}else{_0xa4f13[_0xaffd('0x23')]=_0x193926[_0xaffd('0x20')]['host'];_0xa4f13[_0xaffd('0x24')]=_0x193926[_0xaffd('0x20')][_0xaffd('0x24')];_0xa4f13[_0xaffd('0x25')]=_0x193926[_0xaffd('0x20')][_0xaffd('0x25')];}if(_0x193926[_0xaffd('0x20')][_0xaffd('0x26')]){_0xa4f13['auth']={'user':_0x193926[_0xaffd('0x20')]['user'],'pass':_0x193926['Smtp'][_0xaffd('0x27')]};}var _0x470f5c={'account':_0xa4f13,'message':_['merge']({'from':util[_0xaffd('0x28')]('\x22%s\x22\x20<%s>',_0x193926[_0xaffd('0x15')],_0x193926[_0xaffd('0x1f')]||_0x193926[_0xaffd('0x20')][_0xaffd('0x29')])},_0x1f4da9)};return client[_0xaffd('0x2a')](_0xaffd('0x2b'),_0x470f5c);})[_0xaffd('0xc')](function(_0x995fc6){if(_0x995fc6['error']){throw new Error(util[_0xaffd('0x28')](_0xaffd('0x2c'),_0x995fc6[_0xaffd('0x2d')][_0xaffd('0x2e')]||JSON[_0xaffd('0x2f')](_0x995fc6['error'])));}return!![];});}function handleError(_0x404cec,_0x1a21ff,_0x2f12a4){return _0x404cec[_0xaffd('0x30')](_0x1a21ff||0x1f4)[_0xaffd('0x31')]({'message':_0x2f12a4?_0x2f12a4[_0xaffd('0x2e')]||_0x2f12a4:''});}exports[_0xaffd('0x32')]=function(_0x4c6a30,_0x33ef8a,_0x30ac8a){passport[_0xaffd('0x33')](_0xaffd('0x34'),function(_0x337b90,_0x537256,_0x151566){var _0x1d1eca=_0x337b90||_0x151566;if(_0x1d1eca){return handleError(_0x33ef8a,0x191,_0x1d1eca);}if(!_0x537256){return handleError(_0x33ef8a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x208b11={'payload':{'id':_0x537256['id'],'role':_0x537256[_0xaffd('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0xaffd('0x36')](_0x208b11)[_0xaffd('0xc')](function(_0x38a904){_0x33ef8a[_0xaffd('0x37')]({'id':_0x537256['id'],'token':_0x38a904,'statusCall':'','isAlreadyLogged':_0x537256['online']});});}})(_0x4c6a30,_0x33ef8a,_0x30ac8a);};exports['forgot']=function(_0xe47c4,_0x54a86e,_0x2168bc){if(!_0xe47c4['body'][_0xaffd('0x1f')]){return handleError(_0x54a86e,0x1f4,{'message':_0xaffd('0x38')});}var _0x476b59=rs[_0xaffd('0x39')]();_0xe47c4[_0xaffd('0x3a')]['email']=_0xe47c4['body']['email']['trim']()[_0xaffd('0x3b')]();var _0x35b453;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xaffd('0x17'),'blockDuration'],'raw':!![]})[_0xaffd('0xc')](function(_0x1a53ff){_0x35b453=_0x1a53ff;return db[_0xaffd('0x3c')][_0xaffd('0x1e')]({'where':{'email':_0xe47c4[_0xaffd('0x3a')][_0xaffd('0x1f')]}});})['then'](function(_0x5e72){if(!_0x5e72){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5e72[_0xaffd('0xf')]){throw new Error(_0xaffd('0x3d'));}if(_0x5e72['blocked']){if(moment(_0x5e72['blockedAt'])[_0xaffd('0x18')](_0x35b453['blockDuration'],_0xaffd('0x1a'))>moment()){throw new Error(_0xaffd('0x3e'));}else{_0x5e72[_0xaffd('0x10')]=![];_0x5e72['blockedAt']=null;}}_0x5e72[_0xaffd('0x3f')]=_0x476b59;_0x5e72[_0xaffd('0x40')]=Date[_0xaffd('0x41')]()+0x36ee80;return _0x5e72[_0xaffd('0x42')]();})['then'](function(){return sendServiceMail({'to':_0xe47c4[_0xaffd('0x3a')][_0xaffd('0x1f')],'subject':_0xaffd('0x43'),'text':'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'+_0xaffd('0x44')+_0xe47c4[_0xaffd('0x45')][_0xaffd('0x23')]+_0xaffd('0x46')+_0x476b59+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x54a86e[_0xaffd('0x30')](0xc8)[_0xaffd('0x31')]({'message':_0xaffd('0x47')});})[_0xaffd('0x1d')](function(_0x1b88c1){return handleError(_0x54a86e,0x1f4,_0x1b88c1);});};exports[_0xaffd('0x48')]=function(_0x38e3a1,_0x4afa85,_0xb985fc){return db['User']['find']({'where':{'resetPasswordToken':_0x38e3a1[_0xaffd('0x49')][_0xaffd('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xaffd('0x41')]()}}})['then'](function(_0x3b842f){if(!_0x3b842f){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xaffd('0xb')]({'attributes':['id','securePassword',_0xaffd('0x4b'),'passwordHistoryLimit']})[_0xaffd('0xc')](function(_0x1ca289){if(_0x1ca289[_0xaffd('0x4c')])authService[_0xaffd('0x4d')](_0x38e3a1[_0xaffd('0x3a')][_0xaffd('0xd')]);if(!_0x1ca289[_0xaffd('0x4b')]||!_0x3b842f[_0xaffd('0x4e')])return _0x3b842f;authService['validatePasswordHistory'](_0x38e3a1[_0xaffd('0x3a')][_0xaffd('0xd')],_0x3b842f['previousPasswords'],_0x1ca289['passwordHistoryLimit']);return _0x3b842f;})[_0xaffd('0xc')](function(){_0x3b842f[_0xaffd('0xd')]=_0x38e3a1['body']['password'];_0x3b842f[_0xaffd('0x3f')]=null;_0x3b842f[_0xaffd('0x40')]=null;return _0x3b842f[_0xaffd('0x42')]();});})[_0xaffd('0xc')](function(){_0x4afa85['status'](0xc8)[_0xaffd('0x31')]({'message':'Password\x20reset!'});})['catch'](function(_0x41bfe0){return handleError(_0x4afa85,0x1f4,_0x41bfe0);});};passport[_0xaffd('0x4f')](new LocalStrategy({'usernameField':_0xaffd('0x15'),'passwordField':_0xaffd('0xd')},function(_0x168bb2,_0x15fccd,_0xb21690){return localAuthenticate(db['User'],_0x168bb2,_0x15fccd,_0xb21690);})); \ No newline at end of file +var _0x2ec8=['MailAccount','find','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','message','stringify','status','send','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','../../mysqldb','../../config/utils','client','findOne','allowedLoginAttempts','then','name','password','role','disabled','blocked','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add','clearBlockUser','minutes','getLicense','catch'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x2ec8,0x188));var _0x82ec=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2ec8[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0x82ec('0x0'));var passport=require(_0x82ec('0x1'));var LocalStrategy=require(_0x82ec('0x2'))[_0x82ec('0x3')];var jayson=require('jayson/promise');var _=require(_0x82ec('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x82ec('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x82ec('0x6'));var client=jayson[_0x82ec('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x4c9400,_0x5c786a,_0x527476,_0x3af0cf){var _0x3ceabc,_0x4dd14f;return db['Setting'][_0x82ec('0x8')]({'where':{'id':0x1},'attributes':[_0x82ec('0x9'),'blockDuration'],'raw':!![]})[_0x82ec('0xa')](function(_0xf1ab6c){_0x3ceabc=_0xf1ab6c;return _0x4c9400[_0x82ec('0x8')]({'attributes':['id',_0x82ec('0xb'),_0x82ec('0xc'),'salt',_0x82ec('0xd'),_0x82ec('0xe'),_0x82ec('0xf'),'blockedAt',_0x82ec('0x10')],'where':{'name':_0x5c786a,'role':{'$or':[_0x82ec('0x11'),'user',_0x82ec('0x12')]}}});})['then'](function(_0x2a57c2){if(!_0x2a57c2||_0x2a57c2&&_0x2a57c2[_0x82ec('0xb')]!==_0x5c786a){throw new Error(_0x82ec('0x13'));}else{_0x4dd14f=_0x2a57c2;return _0x4dd14f;}})['then'](function(){_0x4dd14f[_0x82ec('0x14')](_0x527476,function(_0x58c4d5,_0x1f0b2c){var _0x4ce834=_0x4dd14f['loginAttempts']+0x1;if(_0x58c4d5){return _0x3af0cf(_0x58c4d5);}else if(!_0x1f0b2c){if(_0x4dd14f['disabled']){return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}else if(_0x3ceabc[_0x82ec('0x9')]>0x0){if(_0x4dd14f[_0x82ec('0xf')]){if(_0x3ceabc[_0x82ec('0x15')]>0x0){if(moment(_0x4dd14f[_0x82ec('0x16')])[_0x82ec('0x17')](_0x3ceabc[_0x82ec('0x15')],'minutes')>moment()){return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}else{return utils[_0x82ec('0x18')](_0x4dd14f,_0x4ce834,![],null)['then'](function(){return _0x3af0cf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}}else{if(_0x4ce834>=_0x3ceabc[_0x82ec('0x9')]){return utils['clearBlockUser'](_0x4dd14f,0x0,!![],moment())[_0x82ec('0xa')](function(){return _0x3af0cf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x82ec('0x18')](_0x4dd14f,_0x4ce834,![],null)['then'](function(){return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});});}}}else{return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}}else{if(_0x4dd14f[_0x82ec('0xe')]){return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}else if(_0x3ceabc[_0x82ec('0x9')]>0x0){if(_0x4dd14f[_0x82ec('0xf')]){if(_0x3ceabc[_0x82ec('0x15')]>0x0){if(moment(_0x4dd14f['blockedAt'])[_0x82ec('0x17')](_0x3ceabc['blockDuration'],_0x82ec('0x19'))>moment()){return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}else{return utils[_0x82ec('0x18')](_0x4dd14f,0x0,![],null)[_0x82ec('0xa')](function(){return utils[_0x82ec('0x1a')](_0x4dd14f);})['then'](function(){return _0x3af0cf(null,_0x4dd14f);});}}else{return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}}else{return utils[_0x82ec('0x18')](_0x4dd14f,0x0,![],null)[_0x82ec('0xa')](function(){return utils[_0x82ec('0x1a')](_0x4dd14f);})['then'](function(){return _0x3af0cf(null,_0x4dd14f);})[_0x82ec('0x1b')](function(_0x533a2e){return _0x3af0cf(null,![],_0x533a2e);});}}else{if(_0x4dd14f[_0x82ec('0xf')]){return _0x3af0cf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x82ec('0x1a')](_0x4dd14f)[_0x82ec('0xa')](function(){return _0x3af0cf(null,_0x4dd14f);});}}}});})[_0x82ec('0x1b')](function(_0x96d96a){return _0x3af0cf(null,![],_0x96d96a);});}function sendServiceMail(_0x2fe135){return db[_0x82ec('0x1c')][_0x82ec('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x82ec('0xb'),'email'],'include':[{'model':db[_0x82ec('0x1e')],'as':_0x82ec('0x1f')}]})[_0x82ec('0xa')](function(_0x278016){if(!_0x278016){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x35b4f3={'tls':{'rejectUnauthorized':![]}};if(_0x278016[_0x82ec('0x1f')]['service']){_0x35b4f3[_0x82ec('0x20')]=_0x278016[_0x82ec('0x1f')][_0x82ec('0x20')];}else{_0x35b4f3[_0x82ec('0x21')]=_0x278016[_0x82ec('0x1f')]['host'];_0x35b4f3[_0x82ec('0x22')]=_0x278016[_0x82ec('0x1f')]['port'];_0x35b4f3[_0x82ec('0x23')]=_0x278016[_0x82ec('0x1f')][_0x82ec('0x23')];}if(_0x278016['Smtp'][_0x82ec('0x24')]){_0x35b4f3[_0x82ec('0x25')]={'user':_0x278016['Smtp'][_0x82ec('0x26')],'pass':_0x278016[_0x82ec('0x1f')][_0x82ec('0x27')]};}var _0x5ac03a={'account':_0x35b4f3,'message':_[_0x82ec('0x28')]({'from':util[_0x82ec('0x29')](_0x82ec('0x2a'),_0x278016[_0x82ec('0xb')],_0x278016[_0x82ec('0x2b')]||_0x278016['Smtp'][_0x82ec('0x26')])},_0x2fe135)};return client[_0x82ec('0x2c')](_0x82ec('0x2d'),_0x5ac03a);})[_0x82ec('0xa')](function(_0x88e244){if(_0x88e244[_0x82ec('0x2e')]){throw new Error(util[_0x82ec('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x88e244[_0x82ec('0x2e')][_0x82ec('0x2f')]||JSON[_0x82ec('0x30')](_0x88e244[_0x82ec('0x2e')])));}return!![];});}function handleError(_0x3bf738,_0x14563d,_0x41d47c){return _0x3bf738[_0x82ec('0x31')](_0x14563d||0x1f4)[_0x82ec('0x32')]({'message':_0x41d47c?_0x41d47c[_0x82ec('0x2f')]||_0x41d47c:''});}exports['login']=function(_0x4d89ba,_0x4ab41a,_0x1300f2){passport[_0x82ec('0x14')]('local',function(_0x2e3f7e,_0x1ee571,_0x16d509){var _0x80a185=_0x2e3f7e||_0x16d509;if(_0x80a185){return handleError(_0x4ab41a,0x191,_0x80a185);}if(!_0x1ee571){return handleError(_0x4ab41a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1c6208={'payload':{'id':_0x1ee571['id'],'role':_0x1ee571[_0x82ec('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x82ec('0x33')](_0x1c6208)[_0x82ec('0xa')](function(_0x151958){_0x4ab41a[_0x82ec('0x34')]({'id':_0x1ee571['id'],'token':_0x151958,'statusCall':'','isAlreadyLogged':_0x1ee571[_0x82ec('0x35')]});});}})(_0x4d89ba,_0x4ab41a,_0x1300f2);};exports[_0x82ec('0x36')]=function(_0x25c515,_0x2d22d9,_0x434645){if(!_0x25c515[_0x82ec('0x37')][_0x82ec('0x2b')]){return handleError(_0x2d22d9,0x1f4,{'message':_0x82ec('0x38')});}var _0x4cad21=rs[_0x82ec('0x39')]();_0x25c515[_0x82ec('0x37')]['email']=_0x25c515['body']['email'][_0x82ec('0x3a')]()['toLowerCase']();var _0x2017e7;return db[_0x82ec('0x3b')][_0x82ec('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x82ec('0x15')],'raw':!![]})[_0x82ec('0xa')](function(_0x28d803){_0x2017e7=_0x28d803;return db[_0x82ec('0x3c')][_0x82ec('0x1d')]({'where':{'email':_0x25c515[_0x82ec('0x37')][_0x82ec('0x2b')]}});})[_0x82ec('0xa')](function(_0x4a3712){if(!_0x4a3712){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4a3712['disabled']){throw new Error(_0x82ec('0x3d'));}if(_0x4a3712[_0x82ec('0xf')]){if(moment(_0x4a3712[_0x82ec('0x16')])[_0x82ec('0x17')](_0x2017e7[_0x82ec('0x15')],_0x82ec('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4a3712[_0x82ec('0xf')]=![];_0x4a3712[_0x82ec('0x16')]=null;}}_0x4a3712[_0x82ec('0x3e')]=_0x4cad21;_0x4a3712[_0x82ec('0x3f')]=Date[_0x82ec('0x40')]()+0x36ee80;return _0x4a3712[_0x82ec('0x41')]();})[_0x82ec('0xa')](function(){return sendServiceMail({'to':_0x25c515['body'][_0x82ec('0x2b')],'subject':_0x82ec('0x42'),'text':_0x82ec('0x43')+_0x82ec('0x44')+_0x82ec('0x45')+_0x25c515[_0x82ec('0x46')][_0x82ec('0x21')]+'/reset/'+_0x4cad21+'\x0a\x0a'+_0x82ec('0x47')});})[_0x82ec('0xa')](function(){_0x2d22d9[_0x82ec('0x31')](0xc8)[_0x82ec('0x32')]({'message':_0x82ec('0x48')});})[_0x82ec('0x1b')](function(_0x4a9901){return handleError(_0x2d22d9,0x1f4,_0x4a9901);});};exports[_0x82ec('0x49')]=function(_0x1b707f,_0x3ac2d3,_0x3c6f7b){return db[_0x82ec('0x3c')][_0x82ec('0x1d')]({'where':{'resetPasswordToken':_0x1b707f[_0x82ec('0x4a')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x1c6964){if(!_0x1c6964){throw new Error(_0x82ec('0x4b'));}return db['Setting']['findOne']({'attributes':['id',_0x82ec('0x4c'),_0x82ec('0x4d'),_0x82ec('0x4e')]})[_0x82ec('0xa')](function(_0x4c13f5){if(_0x4c13f5[_0x82ec('0x4c')])authService[_0x82ec('0x4f')](_0x1b707f[_0x82ec('0x37')][_0x82ec('0xc')]);if(!_0x4c13f5['enforcePasswordHistory']||!_0x1c6964[_0x82ec('0x50')])return _0x1c6964;authService[_0x82ec('0x51')](_0x1b707f['body'][_0x82ec('0xc')],_0x1c6964['previousPasswords'],_0x4c13f5['passwordHistoryLimit']);return _0x1c6964;})['then'](function(){_0x1c6964[_0x82ec('0xc')]=_0x1b707f[_0x82ec('0x37')][_0x82ec('0xc')];_0x1c6964[_0x82ec('0x3e')]=null;_0x1c6964[_0x82ec('0x3f')]=null;return _0x1c6964[_0x82ec('0x41')]();});})[_0x82ec('0xa')](function(){_0x3ac2d3[_0x82ec('0x31')](0xc8)[_0x82ec('0x32')]({'message':_0x82ec('0x52')});})[_0x82ec('0x1b')](function(_0x5efd84){return handleError(_0x3ac2d3,0x1f4,_0x5efd84);});};passport[_0x82ec('0x53')](new LocalStrategy({'usernameField':_0x82ec('0xb'),'passwordField':_0x82ec('0xc')},function(_0x18afe4,_0x32d3ab,_0x18df3b){return localAuthenticate(db[_0x82ec('0x3c')],_0x18afe4,_0x32d3ab,_0x18df3b);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 6c0dd6a..6f3db79 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 _0xbb34=['forgot','/reset/:token','reset','exports','Router','login','post','/forgot'];(function(_0x340ddc,_0x4c69d6){var _0x29eed3=function(_0x17d566){while(--_0x17d566){_0x340ddc['push'](_0x340ddc['shift']());}};_0x29eed3(++_0x4c69d6);}(_0xbb34,0x164));var _0x4bb3=function(_0x42a44a,_0x15ca12){_0x42a44a=_0x42a44a-0x0;var _0x1e6ab6=_0xbb34[_0x42a44a];return _0x1e6ab6;};'use strict';var express=require('express');var router=express[_0x4bb3('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x4bb3('0x1')]);router[_0x4bb3('0x2')](_0x4bb3('0x3'),controller[_0x4bb3('0x4')]);router['post'](_0x4bb3('0x5'),controller[_0x4bb3('0x6')]);module[_0x4bb3('0x7')]=router; \ No newline at end of file +var _0x9ce0=['./authLocal.controller','post','/forgot','reset','exports','express','Router'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x9ce0,0x108));var _0x09ce=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9ce0[_0x1ac595];return _0x455fff;};'use strict';var express=require(_0x09ce('0x0'));var router=express[_0x09ce('0x1')]();var controller=require(_0x09ce('0x2'));router[_0x09ce('0x3')]('/',controller['login']);router[_0x09ce('0x3')](_0x09ce('0x4'),controller['forgot']);router[_0x09ce('0x3')]('/reset/:token',controller[_0x09ce('0x5')]);module[_0x09ce('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 6375fbe..d00ad35 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 _0xcf64=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x2a241e,_0x1e950d){var _0x4c7b68=function(_0x26948f){while(--_0x26948f){_0x2a241e['push'](_0x2a241e['shift']());}};_0x4c7b68(++_0x1e950d);}(_0xcf64,0x156));var _0x4cf6=function(_0x3f92a4,_0x296cac){_0x3f92a4=_0x3f92a4-0x0;var _0x5cb51c=_0xcf64[_0x3f92a4];return _0x5cb51c;};'use strict';var Sequelize=require(_0x4cf6('0x0'));module['exports']={'name':{'type':Sequelize[_0x4cf6('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x4cf6('0x1')]},'description':{'type':Sequelize[_0x4cf6('0x1')]},'status':{'type':Sequelize[_0x4cf6('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4cf6('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x63a4=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x63a4,0x1b4));var _0x463a=function(_0x4256c5,_0x288cee){_0x4256c5=_0x4256c5-0x0;var _0x3c8bfd=_0x63a4[_0x4256c5];return _0x3c8bfd;};'use strict';var Sequelize=require(_0x463a('0x0'));module[_0x463a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x463a('0x2')]},'description':{'type':Sequelize[_0x463a('0x2')]},'status':{'type':Sequelize[_0x463a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x463a('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 9424ef1..b559a13 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 _0xbbf4=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Automation','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','addConditions','ids','omit','findOne','Condition','getConditions','addActions','getActions','Action','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util'];(function(_0x53d905,_0x4d125d){var _0x347bad=function(_0x45e016){while(--_0x45e016){_0x53d905['push'](_0x53d905['shift']());}};_0x347bad(++_0x4d125d);}(_0xbbf4,0x141));var _0x4bbf=function(_0x7db1a8,_0xe45de3){_0x7db1a8=_0x7db1a8-0x0;var _0x48d2e7=_0xbbf4[_0x7db1a8];return _0x48d2e7;};'use strict';var emlformat=require(_0x4bbf('0x0'));var rimraf=require(_0x4bbf('0x1'));var zipdir=require(_0x4bbf('0x2'));var jsonpatch=require(_0x4bbf('0x3'));var rp=require(_0x4bbf('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4bbf('0x5'));var util=require(_0x4bbf('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('fs-extra');var _=require(_0x4bbf('0x7'));var squel=require(_0x4bbf('0x8'));var crypto=require(_0x4bbf('0x9'));var jsforce=require(_0x4bbf('0xa'));var deskjs=require(_0x4bbf('0xb'));var toCsv=require(_0x4bbf('0xc'));var querystring=require(_0x4bbf('0xd'));var Papa=require(_0x4bbf('0xe'));var Redis=require(_0x4bbf('0xf'));var authService=require(_0x4bbf('0x10'));var qs=require(_0x4bbf('0x11'));var as=require(_0x4bbf('0x12'));var hardwareService=require(_0x4bbf('0x13'));var logger=require('../../config/logger')(_0x4bbf('0x14'));var utils=require('../../config/utils');var config=require(_0x4bbf('0x15'));var licenseUtil=require(_0x4bbf('0x16'));var db=require(_0x4bbf('0x17'))['db'];function respondWithStatusCode(_0x4c48c2,_0x3236f2){_0x3236f2=_0x3236f2||0xcc;return function(_0x2b7d45){if(_0x2b7d45){return _0x4c48c2[_0x4bbf('0x18')](_0x3236f2);}return _0x4c48c2[_0x4bbf('0x19')](_0x3236f2)['end']();};}function respondWithResult(_0x1db077,_0xa7c3b2){_0xa7c3b2=_0xa7c3b2||0xc8;return function(_0x33aef7){if(_0x33aef7){return _0x1db077[_0x4bbf('0x19')](_0xa7c3b2)[_0x4bbf('0x1a')](_0x33aef7);}};}function respondWithFilteredResult(_0x238d8b,_0x1faebb){return function(_0x506a07){if(_0x506a07){var _0x42f2d0=typeof _0x1faebb[_0x4bbf('0x1b')]===_0x4bbf('0x1c')&&typeof _0x1faebb[_0x4bbf('0x1d')]===_0x4bbf('0x1c');var _0x458911=_0x506a07['count'];var _0x5559b4=_0x42f2d0?0x0:_0x1faebb[_0x4bbf('0x1b')];var _0x2f6c88=_0x42f2d0?_0x506a07[_0x4bbf('0x1e')]:_0x1faebb[_0x4bbf('0x1b')]+_0x1faebb['limit'];var _0x35376e;if(_0x2f6c88>=_0x458911){_0x2f6c88=_0x458911;_0x35376e=0xc8;}else{_0x35376e=0xce;}_0x238d8b[_0x4bbf('0x19')](_0x35376e);return _0x238d8b[_0x4bbf('0x1f')](_0x4bbf('0x20'),_0x5559b4+'-'+_0x2f6c88+'/'+_0x458911)[_0x4bbf('0x1a')](_0x506a07);}return null;};}function patchUpdates(_0x4cabef){return function(_0x235f76){try{jsonpatch[_0x4bbf('0x21')](_0x235f76,_0x4cabef,!![]);}catch(_0x12d49a){return BPromise[_0x4bbf('0x22')](_0x12d49a);}return _0x235f76[_0x4bbf('0x23')]();};}function saveUpdates(_0x46a5b2,_0x4b0632){return function(_0x38f771){if(_0x38f771){return _0x38f771[_0x4bbf('0x24')](_0x46a5b2)[_0x4bbf('0x25')](function(_0xb29a81){return _0xb29a81;});}return null;};}function removeEntity(_0x10cec3,_0x123cb1){return function(_0x41644c){if(_0x41644c){return _0x41644c[_0x4bbf('0x26')]()['then'](function(){_0x10cec3['status'](0xcc)[_0x4bbf('0x27')]();});}};}function handleEntityNotFound(_0x588650,_0xb6707a){return function(_0x300aac){if(!_0x300aac){_0x588650['sendStatus'](0x194);}return _0x300aac;};}function handleError(_0x80f8d4,_0x31d2d6){_0x31d2d6=_0x31d2d6||0x1f4;return function(_0x1657ea){logger[_0x4bbf('0x28')](_0x1657ea[_0x4bbf('0x29')]);if(_0x1657ea[_0x4bbf('0x2a')]){delete _0x1657ea[_0x4bbf('0x2a')];}_0x80f8d4['status'](_0x31d2d6)[_0x4bbf('0x2b')](_0x1657ea);};}exports[_0x4bbf('0x2c')]=function(_0xde81ca,_0x3e3ca9){var _0x3f87bb={},_0x5400f7={},_0x4fae64={'count':0x0,'rows':[]};var _0x32512b=_[_0x4bbf('0x2d')](db['Automation'][_0x4bbf('0x2e')],function(_0x26c9bc){return{'name':_0x26c9bc['fieldName'],'type':_0x26c9bc[_0x4bbf('0x2f')][_0x4bbf('0x30')]};});_0x5400f7[_0x4bbf('0x31')]=_[_0x4bbf('0x2d')](_0x32512b,_0x4bbf('0x2a'));_0x5400f7[_0x4bbf('0x32')]=_[_0x4bbf('0x33')](_0xde81ca['query']);_0x5400f7[_0x4bbf('0x34')]=_[_0x4bbf('0x35')](_0x5400f7['model'],_0x5400f7['query']);_0x3f87bb['attributes']=_[_0x4bbf('0x35')](_0x5400f7[_0x4bbf('0x31')],qs[_0x4bbf('0x36')](_0xde81ca['query'][_0x4bbf('0x36')]));_0x3f87bb['attributes']=_0x3f87bb['attributes']['length']?_0x3f87bb[_0x4bbf('0x37')]:_0x5400f7[_0x4bbf('0x31')];if(!_0xde81ca[_0x4bbf('0x32')][_0x4bbf('0x38')](_0x4bbf('0x39'))){_0x3f87bb['limit']=qs[_0x4bbf('0x1d')](_0xde81ca[_0x4bbf('0x32')][_0x4bbf('0x1d')]);_0x3f87bb['offset']=qs[_0x4bbf('0x1b')](_0xde81ca['query'][_0x4bbf('0x1b')]);}_0x3f87bb[_0x4bbf('0x3a')]=qs[_0x4bbf('0x3b')](_0xde81ca[_0x4bbf('0x32')]['sort']);_0x3f87bb[_0x4bbf('0x3c')]=qs['filters'](_['pick'](_0xde81ca['query'],_0x5400f7[_0x4bbf('0x34')]),_0x32512b);if(_0xde81ca['query'][_0x4bbf('0x3d')]){_0x3f87bb[_0x4bbf('0x3c')]=_[_0x4bbf('0x3e')](_0x3f87bb[_0x4bbf('0x3c')],{'$or':_[_0x4bbf('0x2d')](_0x32512b,function(_0x74d5b3){if(_0x74d5b3[_0x4bbf('0x2f')]!=='VIRTUAL'){var _0x53d39e={};_0x53d39e[_0x74d5b3['name']]={'$like':'%'+_0xde81ca['query'][_0x4bbf('0x3d')]+'%'};return _0x53d39e;}})});}_0x3f87bb=_[_0x4bbf('0x3e')]({},_0x3f87bb,_0xde81ca[_0x4bbf('0x3f')]);var _0x5c7973={'where':_0x3f87bb[_0x4bbf('0x3c')]};return db[_0x4bbf('0x40')][_0x4bbf('0x1e')](_0x5c7973)['then'](function(_0x2b2c86){_0x4fae64[_0x4bbf('0x1e')]=_0x2b2c86;if(_0xde81ca[_0x4bbf('0x32')][_0x4bbf('0x41')]){_0x3f87bb[_0x4bbf('0x42')]=[{'all':!![]}];}return db['Automation'][_0x4bbf('0x43')](_0x3f87bb);})[_0x4bbf('0x25')](function(_0x57d212){_0x4fae64[_0x4bbf('0x44')]=_0x57d212;return _0x4fae64;})[_0x4bbf('0x25')](respondWithFilteredResult(_0x3e3ca9,_0x3f87bb))[_0x4bbf('0x45')](handleError(_0x3e3ca9,null));};exports[_0x4bbf('0x46')]=function(_0x585ac8,_0x5de590){var _0x49d990={'raw':![],'where':{'id':_0x585ac8[_0x4bbf('0x47')]['id']}},_0x5e6c9b={};_0x5e6c9b[_0x4bbf('0x31')]=_[_0x4bbf('0x33')](db[_0x4bbf('0x40')]['rawAttributes']);_0x5e6c9b[_0x4bbf('0x32')]=_[_0x4bbf('0x33')](_0x585ac8['query']);_0x5e6c9b[_0x4bbf('0x34')]=_[_0x4bbf('0x35')](_0x5e6c9b[_0x4bbf('0x31')],_0x5e6c9b[_0x4bbf('0x32')]);_0x49d990[_0x4bbf('0x37')]=_[_0x4bbf('0x35')](_0x5e6c9b[_0x4bbf('0x31')],qs[_0x4bbf('0x36')](_0x585ac8['query'][_0x4bbf('0x36')]));_0x49d990[_0x4bbf('0x37')]=_0x49d990[_0x4bbf('0x37')][_0x4bbf('0x48')]?_0x49d990['attributes']:_0x5e6c9b[_0x4bbf('0x31')];if(_0x585ac8['query'][_0x4bbf('0x41')]){_0x49d990[_0x4bbf('0x42')]=[{'all':!![]}];}_0x49d990=_[_0x4bbf('0x3e')]({},_0x49d990,_0x585ac8[_0x4bbf('0x3f')]);return db[_0x4bbf('0x40')][_0x4bbf('0x49')](_0x49d990)[_0x4bbf('0x25')](handleEntityNotFound(_0x5de590,null))[_0x4bbf('0x25')](respondWithResult(_0x5de590,null))[_0x4bbf('0x45')](handleError(_0x5de590,null));};exports[_0x4bbf('0x4a')]=function(_0x442917,_0x580b6e){return db[_0x4bbf('0x40')][_0x4bbf('0x4a')](_0x442917[_0x4bbf('0x4b')],{})[_0x4bbf('0x25')](respondWithResult(_0x580b6e,0xc9))['catch'](handleError(_0x580b6e,null));};exports[_0x4bbf('0x24')]=function(_0x40ae3e,_0x39b67f){if(_0x40ae3e[_0x4bbf('0x4b')]['id']){delete _0x40ae3e[_0x4bbf('0x4b')]['id'];}return db[_0x4bbf('0x40')][_0x4bbf('0x49')]({'where':{'id':_0x40ae3e['params']['id']}})[_0x4bbf('0x25')](handleEntityNotFound(_0x39b67f,null))[_0x4bbf('0x25')](saveUpdates(_0x40ae3e['body'],null))[_0x4bbf('0x25')](respondWithResult(_0x39b67f,null))['catch'](handleError(_0x39b67f,null));};exports[_0x4bbf('0x26')]=function(_0x41d2f1,_0x497125){return db['Automation'][_0x4bbf('0x49')]({'where':{'id':_0x41d2f1['params']['id']}})[_0x4bbf('0x25')](handleEntityNotFound(_0x497125,null))[_0x4bbf('0x25')](removeEntity(_0x497125,null))[_0x4bbf('0x45')](handleError(_0x497125,null));};exports['addConditions']=function(_0x21d1e1,_0x362175,_0x34489a){return db['Condition']['find']({'where':{'id':_0x21d1e1[_0x4bbf('0x47')]['id']}})[_0x4bbf('0x25')](handleEntityNotFound(_0x362175,null))['then'](function(_0x2c89e0){if(_0x2c89e0){return _0x2c89e0[_0x4bbf('0x4c')](_0x21d1e1['body'][_0x4bbf('0x4d')],_[_0x4bbf('0x4e')](_0x21d1e1['body'],['ids','id'])||{});}})[_0x4bbf('0x25')](respondWithResult(_0x362175,null))['catch'](handleError(_0x362175,null));};exports['getConditions']=function(_0x23a6e8,_0x58f43c,_0x35375b){var _0x347aa3={};var _0x4db7b6={};var _0x1fb4bc;var _0x587df2;return db[_0x4bbf('0x40')][_0x4bbf('0x4f')]({'where':{'id':_0x23a6e8[_0x4bbf('0x47')]['id']}})[_0x4bbf('0x25')](handleEntityNotFound(_0x58f43c,null))[_0x4bbf('0x25')](function(_0x5214d1){if(_0x5214d1){_0x1fb4bc=_0x5214d1;_0x4db7b6[_0x4bbf('0x31')]=_[_0x4bbf('0x33')](db[_0x4bbf('0x50')][_0x4bbf('0x2e')]);_0x4db7b6[_0x4bbf('0x32')]=_[_0x4bbf('0x33')](_0x23a6e8['query']);_0x4db7b6['filters']=_[_0x4bbf('0x35')](_0x4db7b6[_0x4bbf('0x31')],_0x4db7b6[_0x4bbf('0x32')]);_0x347aa3[_0x4bbf('0x37')]=_['intersection'](_0x4db7b6[_0x4bbf('0x31')],qs[_0x4bbf('0x36')](_0x23a6e8[_0x4bbf('0x32')][_0x4bbf('0x36')]));_0x347aa3['attributes']=_0x347aa3[_0x4bbf('0x37')][_0x4bbf('0x48')]?_0x347aa3[_0x4bbf('0x37')]:_0x4db7b6[_0x4bbf('0x31')];_0x347aa3[_0x4bbf('0x3a')]=qs[_0x4bbf('0x3b')](_0x23a6e8[_0x4bbf('0x32')][_0x4bbf('0x3b')]);_0x347aa3[_0x4bbf('0x3c')]=qs[_0x4bbf('0x34')](_['pick'](_0x23a6e8['query'],_0x4db7b6[_0x4bbf('0x34')]));if(_0x23a6e8['query']['filter']){_0x347aa3[_0x4bbf('0x3c')]=_[_0x4bbf('0x3e')](_0x347aa3[_0x4bbf('0x3c')],{'$or':_['map'](_0x347aa3[_0x4bbf('0x37')],function(_0x155f3d){var _0x10a449={};_0x10a449[_0x155f3d]={'$like':'%'+_0x23a6e8[_0x4bbf('0x32')][_0x4bbf('0x3d')]+'%'};return _0x10a449;})});}_0x347aa3=_[_0x4bbf('0x3e')]({},_0x347aa3,_0x23a6e8[_0x4bbf('0x3f')]);return _0x1fb4bc['getConditions'](_0x347aa3);}})[_0x4bbf('0x25')](function(_0x31cd28){if(_0x31cd28){_0x587df2=_0x31cd28[_0x4bbf('0x48')];if(!_0x23a6e8[_0x4bbf('0x32')][_0x4bbf('0x38')](_0x4bbf('0x39'))){_0x347aa3[_0x4bbf('0x1d')]=qs[_0x4bbf('0x1d')](_0x23a6e8[_0x4bbf('0x32')][_0x4bbf('0x1d')]);_0x347aa3['offset']=qs['offset'](_0x23a6e8['query'][_0x4bbf('0x1b')]);}return _0x1fb4bc[_0x4bbf('0x51')](_0x347aa3);}})['then'](function(_0x305bad){if(_0x305bad){return _0x305bad?{'count':_0x587df2,'rows':_0x305bad}:null;}})[_0x4bbf('0x25')](respondWithResult(_0x58f43c,null))['catch'](handleError(_0x58f43c,null));};exports[_0x4bbf('0x52')]=function(_0x4fbb44,_0x588a5e,_0x55b2d7){return db['Action'][_0x4bbf('0x49')]({'where':{'id':_0x4fbb44[_0x4bbf('0x47')]['id']}})['then'](handleEntityNotFound(_0x588a5e,null))[_0x4bbf('0x25')](function(_0x426319){if(_0x426319){return _0x426319[_0x4bbf('0x52')](_0x4fbb44[_0x4bbf('0x4b')][_0x4bbf('0x4d')],_[_0x4bbf('0x4e')](_0x4fbb44['body'],[_0x4bbf('0x4d'),'id'])||{});}})[_0x4bbf('0x25')](respondWithResult(_0x588a5e,null))['catch'](handleError(_0x588a5e,null));};exports[_0x4bbf('0x53')]=function(_0x1ca2d7,_0x5ac6e0,_0x258356){var _0x526725={};var _0x1fb44f={};var _0xac9b21;var _0x4af9ce;return db[_0x4bbf('0x40')][_0x4bbf('0x4f')]({'where':{'id':_0x1ca2d7[_0x4bbf('0x47')]['id']}})[_0x4bbf('0x25')](handleEntityNotFound(_0x5ac6e0,null))[_0x4bbf('0x25')](function(_0x109dc2){if(_0x109dc2){_0xac9b21=_0x109dc2;_0x1fb44f['model']=_['keys'](db[_0x4bbf('0x54')][_0x4bbf('0x2e')]);_0x1fb44f[_0x4bbf('0x32')]=_[_0x4bbf('0x33')](_0x1ca2d7['query']);_0x1fb44f[_0x4bbf('0x34')]=_['intersection'](_0x1fb44f['model'],_0x1fb44f[_0x4bbf('0x32')]);_0x526725[_0x4bbf('0x37')]=_[_0x4bbf('0x35')](_0x1fb44f['model'],qs['fields'](_0x1ca2d7[_0x4bbf('0x32')][_0x4bbf('0x36')]));_0x526725[_0x4bbf('0x37')]=_0x526725[_0x4bbf('0x37')]['length']?_0x526725[_0x4bbf('0x37')]:_0x1fb44f['model'];_0x526725[_0x4bbf('0x3a')]=qs[_0x4bbf('0x3b')](_0x1ca2d7[_0x4bbf('0x32')][_0x4bbf('0x3b')]);_0x526725[_0x4bbf('0x3c')]=qs[_0x4bbf('0x34')](_[_0x4bbf('0x55')](_0x1ca2d7[_0x4bbf('0x32')],_0x1fb44f[_0x4bbf('0x34')]));if(_0x1ca2d7[_0x4bbf('0x32')][_0x4bbf('0x3d')]){_0x526725[_0x4bbf('0x3c')]=_[_0x4bbf('0x3e')](_0x526725[_0x4bbf('0x3c')],{'$or':_[_0x4bbf('0x2d')](_0x526725['attributes'],function(_0x19b447){var _0x3aa995={};_0x3aa995[_0x19b447]={'$like':'%'+_0x1ca2d7[_0x4bbf('0x32')]['filter']+'%'};return _0x3aa995;})});}_0x526725=_[_0x4bbf('0x3e')]({},_0x526725,_0x1ca2d7[_0x4bbf('0x3f')]);return _0xac9b21[_0x4bbf('0x53')](_0x526725);}})[_0x4bbf('0x25')](function(_0x5dfe86){if(_0x5dfe86){_0x4af9ce=_0x5dfe86[_0x4bbf('0x48')];if(!_0x1ca2d7[_0x4bbf('0x32')]['hasOwnProperty'](_0x4bbf('0x39'))){_0x526725[_0x4bbf('0x1d')]=qs['limit'](_0x1ca2d7[_0x4bbf('0x32')][_0x4bbf('0x1d')]);_0x526725[_0x4bbf('0x1b')]=qs[_0x4bbf('0x1b')](_0x1ca2d7[_0x4bbf('0x32')]['offset']);}return _0xac9b21['getActions'](_0x526725);}})[_0x4bbf('0x25')](function(_0x344d7e){if(_0x344d7e){return _0x344d7e?{'count':_0x4af9ce,'rows':_0x344d7e}:null;}})[_0x4bbf('0x25')](respondWithResult(_0x5ac6e0,null))['catch'](handleError(_0x5ac6e0,null));}; \ No newline at end of file +var _0x6139=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','error','stack','name','index','Automation','rawAttributes','fieldName','key','model','map','keys','query','attributes','intersection','fields','length','nolimit','sort','where','filters','filter','merge','type','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','addConditions','Condition','ids','omit','getConditions','pick','Action','addActions','findOne','order','getActions','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel'];(function(_0x4f3964,_0x33df88){var _0xf98636=function(_0x565a2c){while(--_0x565a2c){_0x4f3964['push'](_0x4f3964['shift']());}};_0xf98636(++_0x33df88);}(_0x6139,0xef));var _0x9613=function(_0xfec4f,_0x516119){_0xfec4f=_0xfec4f-0x0;var _0x4d8bad=_0x6139[_0xfec4f];return _0x4d8bad;};'use strict';var emlformat=require(_0x9613('0x0'));var rimraf=require(_0x9613('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9613('0x2'));var rp=require(_0x9613('0x3'));var moment=require(_0x9613('0x4'));var BPromise=require(_0x9613('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9613('0x6'));var sox=require(_0x9613('0x7'));var csv=require(_0x9613('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9613('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9613('0xa'));var toCsv=require(_0x9613('0x8'));var querystring=require(_0x9613('0xb'));var Papa=require('papaparse');var Redis=require(_0x9613('0xc'));var authService=require(_0x9613('0xd'));var qs=require(_0x9613('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9613('0xf'));var logger=require(_0x9613('0x10'))(_0x9613('0x11'));var utils=require(_0x9613('0x12'));var config=require(_0x9613('0x13'));var licenseUtil=require(_0x9613('0x14'));var db=require(_0x9613('0x15'))['db'];function respondWithStatusCode(_0x16d41b,_0x1bc9ba){_0x1bc9ba=_0x1bc9ba||0xcc;return function(_0x5319eb){if(_0x5319eb){return _0x16d41b[_0x9613('0x16')](_0x1bc9ba);}return _0x16d41b[_0x9613('0x17')](_0x1bc9ba)[_0x9613('0x18')]();};}function respondWithResult(_0x16ec05,_0x40b51b){_0x40b51b=_0x40b51b||0xc8;return function(_0x5d4b74){if(_0x5d4b74){return _0x16ec05[_0x9613('0x17')](_0x40b51b)[_0x9613('0x19')](_0x5d4b74);}};}function respondWithFilteredResult(_0x4dd580,_0x2c13f3){return function(_0x2c2b4d){if(_0x2c2b4d){var _0x44e1ea=typeof _0x2c13f3[_0x9613('0x1a')]===_0x9613('0x1b')&&typeof _0x2c13f3['limit']===_0x9613('0x1b');var _0x4e8a9c=_0x2c2b4d['count'];var _0x15559a=_0x44e1ea?0x0:_0x2c13f3[_0x9613('0x1a')];var _0x87db25=_0x44e1ea?_0x2c2b4d['count']:_0x2c13f3[_0x9613('0x1a')]+_0x2c13f3[_0x9613('0x1c')];var _0x1a2ee8;if(_0x87db25>=_0x4e8a9c){_0x87db25=_0x4e8a9c;_0x1a2ee8=0xc8;}else{_0x1a2ee8=0xce;}_0x4dd580[_0x9613('0x17')](_0x1a2ee8);return _0x4dd580[_0x9613('0x1d')]('Content-Range',_0x15559a+'-'+_0x87db25+'/'+_0x4e8a9c)['json'](_0x2c2b4d);}return null;};}function patchUpdates(_0x36dda6){return function(_0x5d12e5){try{jsonpatch[_0x9613('0x1e')](_0x5d12e5,_0x36dda6,!![]);}catch(_0x140f4b){return BPromise[_0x9613('0x1f')](_0x140f4b);}return _0x5d12e5[_0x9613('0x20')]();};}function saveUpdates(_0x270327,_0x33ff16){return function(_0x31b2ac){if(_0x31b2ac){return _0x31b2ac[_0x9613('0x21')](_0x270327)['then'](function(_0x4486de){return _0x4486de;});}return null;};}function removeEntity(_0x37e1b2,_0x3d1baa){return function(_0xc19af){if(_0xc19af){return _0xc19af[_0x9613('0x22')]()[_0x9613('0x23')](function(){_0x37e1b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14bfe1,_0x2d93b1){return function(_0x5971a9){if(!_0x5971a9){_0x14bfe1[_0x9613('0x16')](0x194);}return _0x5971a9;};}function handleError(_0x2bcd75,_0x5468e1){_0x5468e1=_0x5468e1||0x1f4;return function(_0x3a3391){logger[_0x9613('0x24')](_0x3a3391[_0x9613('0x25')]);if(_0x3a3391[_0x9613('0x26')]){delete _0x3a3391['name'];}_0x2bcd75[_0x9613('0x17')](_0x5468e1)['send'](_0x3a3391);};}exports[_0x9613('0x27')]=function(_0x2d4416,_0x2a826c){var _0x474f47={},_0x27297f={},_0x33fedb={'count':0x0,'rows':[]};var _0x2f7a39=_['map'](db[_0x9613('0x28')][_0x9613('0x29')],function(_0xd661e){return{'name':_0xd661e[_0x9613('0x2a')],'type':_0xd661e['type'][_0x9613('0x2b')]};});_0x27297f[_0x9613('0x2c')]=_[_0x9613('0x2d')](_0x2f7a39,_0x9613('0x26'));_0x27297f['query']=_[_0x9613('0x2e')](_0x2d4416[_0x9613('0x2f')]);_0x27297f['filters']=_['intersection'](_0x27297f[_0x9613('0x2c')],_0x27297f[_0x9613('0x2f')]);_0x474f47[_0x9613('0x30')]=_[_0x9613('0x31')](_0x27297f[_0x9613('0x2c')],qs['fields'](_0x2d4416['query'][_0x9613('0x32')]));_0x474f47[_0x9613('0x30')]=_0x474f47['attributes'][_0x9613('0x33')]?_0x474f47[_0x9613('0x30')]:_0x27297f['model'];if(!_0x2d4416['query']['hasOwnProperty'](_0x9613('0x34'))){_0x474f47[_0x9613('0x1c')]=qs[_0x9613('0x1c')](_0x2d4416['query'][_0x9613('0x1c')]);_0x474f47['offset']=qs[_0x9613('0x1a')](_0x2d4416[_0x9613('0x2f')][_0x9613('0x1a')]);}_0x474f47['order']=qs['sort'](_0x2d4416['query'][_0x9613('0x35')]);_0x474f47[_0x9613('0x36')]=qs['filters'](_['pick'](_0x2d4416[_0x9613('0x2f')],_0x27297f[_0x9613('0x37')]),_0x2f7a39);if(_0x2d4416['query'][_0x9613('0x38')]){_0x474f47[_0x9613('0x36')]=_[_0x9613('0x39')](_0x474f47['where'],{'$or':_['map'](_0x2f7a39,function(_0x460dc0){if(_0x460dc0[_0x9613('0x3a')]!=='VIRTUAL'){var _0x1981e6={};_0x1981e6[_0x460dc0[_0x9613('0x26')]]={'$like':'%'+_0x2d4416[_0x9613('0x2f')][_0x9613('0x38')]+'%'};return _0x1981e6;}})});}_0x474f47=_[_0x9613('0x39')]({},_0x474f47,_0x2d4416[_0x9613('0x3b')]);var _0x573d77={'where':_0x474f47[_0x9613('0x36')]};return db['Automation']['count'](_0x573d77)[_0x9613('0x23')](function(_0x580758){_0x33fedb[_0x9613('0x3c')]=_0x580758;if(_0x2d4416[_0x9613('0x2f')][_0x9613('0x3d')]){_0x474f47[_0x9613('0x3e')]=[{'all':!![]}];}return db[_0x9613('0x28')][_0x9613('0x3f')](_0x474f47);})['then'](function(_0xa2a883){_0x33fedb[_0x9613('0x40')]=_0xa2a883;return _0x33fedb;})[_0x9613('0x23')](respondWithFilteredResult(_0x2a826c,_0x474f47))['catch'](handleError(_0x2a826c,null));};exports[_0x9613('0x41')]=function(_0x46a27d,_0x2da1c9){var _0x14e7a5={'raw':![],'where':{'id':_0x46a27d[_0x9613('0x42')]['id']}},_0x39c164={};_0x39c164[_0x9613('0x2c')]=_[_0x9613('0x2e')](db['Automation'][_0x9613('0x29')]);_0x39c164[_0x9613('0x2f')]=_['keys'](_0x46a27d[_0x9613('0x2f')]);_0x39c164[_0x9613('0x37')]=_[_0x9613('0x31')](_0x39c164[_0x9613('0x2c')],_0x39c164['query']);_0x14e7a5[_0x9613('0x30')]=_['intersection'](_0x39c164['model'],qs[_0x9613('0x32')](_0x46a27d[_0x9613('0x2f')][_0x9613('0x32')]));_0x14e7a5[_0x9613('0x30')]=_0x14e7a5[_0x9613('0x30')][_0x9613('0x33')]?_0x14e7a5[_0x9613('0x30')]:_0x39c164[_0x9613('0x2c')];if(_0x46a27d['query']['includeAll']){_0x14e7a5[_0x9613('0x3e')]=[{'all':!![]}];}_0x14e7a5=_[_0x9613('0x39')]({},_0x14e7a5,_0x46a27d[_0x9613('0x3b')]);return db['Automation'][_0x9613('0x43')](_0x14e7a5)[_0x9613('0x23')](handleEntityNotFound(_0x2da1c9,null))[_0x9613('0x23')](respondWithResult(_0x2da1c9,null))[_0x9613('0x44')](handleError(_0x2da1c9,null));};exports[_0x9613('0x45')]=function(_0x47a6a8,_0x194a2c){return db['Automation']['create'](_0x47a6a8[_0x9613('0x46')],{})[_0x9613('0x23')](respondWithResult(_0x194a2c,0xc9))[_0x9613('0x44')](handleError(_0x194a2c,null));};exports[_0x9613('0x21')]=function(_0x498cad,_0x3a8021){if(_0x498cad['body']['id']){delete _0x498cad[_0x9613('0x46')]['id'];}return db[_0x9613('0x28')][_0x9613('0x43')]({'where':{'id':_0x498cad[_0x9613('0x42')]['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x3a8021,null))[_0x9613('0x23')](saveUpdates(_0x498cad['body'],null))[_0x9613('0x23')](respondWithResult(_0x3a8021,null))['catch'](handleError(_0x3a8021,null));};exports['destroy']=function(_0x59d074,_0x46c77d){return db[_0x9613('0x28')][_0x9613('0x43')]({'where':{'id':_0x59d074['params']['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x46c77d,null))[_0x9613('0x23')](removeEntity(_0x46c77d,null))[_0x9613('0x44')](handleError(_0x46c77d,null));};exports[_0x9613('0x47')]=function(_0x5cccfa,_0x24f92b,_0x5b8fdb){return db[_0x9613('0x48')]['find']({'where':{'id':_0x5cccfa['params']['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x24f92b,null))[_0x9613('0x23')](function(_0x2bc7fe){if(_0x2bc7fe){return _0x2bc7fe[_0x9613('0x47')](_0x5cccfa['body'][_0x9613('0x49')],_[_0x9613('0x4a')](_0x5cccfa['body'],[_0x9613('0x49'),'id'])||{});}})['then'](respondWithResult(_0x24f92b,null))['catch'](handleError(_0x24f92b,null));};exports[_0x9613('0x4b')]=function(_0x2adc07,_0x29f57f,_0x2477ea){var _0x42a1a1={};var _0x33d3a0={};var _0x4454e4;var _0x523c68;return db['Automation']['findOne']({'where':{'id':_0x2adc07[_0x9613('0x42')]['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x29f57f,null))[_0x9613('0x23')](function(_0x4f6c27){if(_0x4f6c27){_0x4454e4=_0x4f6c27;_0x33d3a0[_0x9613('0x2c')]=_['keys'](db[_0x9613('0x48')]['rawAttributes']);_0x33d3a0[_0x9613('0x2f')]=_[_0x9613('0x2e')](_0x2adc07[_0x9613('0x2f')]);_0x33d3a0[_0x9613('0x37')]=_[_0x9613('0x31')](_0x33d3a0[_0x9613('0x2c')],_0x33d3a0[_0x9613('0x2f')]);_0x42a1a1[_0x9613('0x30')]=_[_0x9613('0x31')](_0x33d3a0[_0x9613('0x2c')],qs[_0x9613('0x32')](_0x2adc07[_0x9613('0x2f')]['fields']));_0x42a1a1[_0x9613('0x30')]=_0x42a1a1['attributes'][_0x9613('0x33')]?_0x42a1a1[_0x9613('0x30')]:_0x33d3a0[_0x9613('0x2c')];_0x42a1a1['order']=qs[_0x9613('0x35')](_0x2adc07[_0x9613('0x2f')][_0x9613('0x35')]);_0x42a1a1['where']=qs[_0x9613('0x37')](_[_0x9613('0x4c')](_0x2adc07[_0x9613('0x2f')],_0x33d3a0[_0x9613('0x37')]));if(_0x2adc07[_0x9613('0x2f')]['filter']){_0x42a1a1[_0x9613('0x36')]=_[_0x9613('0x39')](_0x42a1a1['where'],{'$or':_[_0x9613('0x2d')](_0x42a1a1[_0x9613('0x30')],function(_0x148793){var _0x1deb05={};_0x1deb05[_0x148793]={'$like':'%'+_0x2adc07['query'][_0x9613('0x38')]+'%'};return _0x1deb05;})});}_0x42a1a1=_['merge']({},_0x42a1a1,_0x2adc07[_0x9613('0x3b')]);return _0x4454e4[_0x9613('0x4b')](_0x42a1a1);}})[_0x9613('0x23')](function(_0x281f9e){if(_0x281f9e){_0x523c68=_0x281f9e['length'];if(!_0x2adc07['query']['hasOwnProperty'](_0x9613('0x34'))){_0x42a1a1[_0x9613('0x1c')]=qs[_0x9613('0x1c')](_0x2adc07[_0x9613('0x2f')][_0x9613('0x1c')]);_0x42a1a1[_0x9613('0x1a')]=qs[_0x9613('0x1a')](_0x2adc07[_0x9613('0x2f')][_0x9613('0x1a')]);}return _0x4454e4[_0x9613('0x4b')](_0x42a1a1);}})[_0x9613('0x23')](function(_0x5dc858){if(_0x5dc858){return _0x5dc858?{'count':_0x523c68,'rows':_0x5dc858}:null;}})[_0x9613('0x23')](respondWithResult(_0x29f57f,null))[_0x9613('0x44')](handleError(_0x29f57f,null));};exports['addActions']=function(_0x4d2502,_0x10f7e3,_0x5430a6){return db[_0x9613('0x4d')][_0x9613('0x43')]({'where':{'id':_0x4d2502[_0x9613('0x42')]['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x10f7e3,null))[_0x9613('0x23')](function(_0x251f67){if(_0x251f67){return _0x251f67[_0x9613('0x4e')](_0x4d2502[_0x9613('0x46')][_0x9613('0x49')],_[_0x9613('0x4a')](_0x4d2502[_0x9613('0x46')],['ids','id'])||{});}})['then'](respondWithResult(_0x10f7e3,null))[_0x9613('0x44')](handleError(_0x10f7e3,null));};exports['getActions']=function(_0x12c247,_0x133fe9,_0x45ab8d){var _0x460d3b={};var _0x12dd2b={};var _0x38b6f3;var _0x116232;return db[_0x9613('0x28')][_0x9613('0x4f')]({'where':{'id':_0x12c247[_0x9613('0x42')]['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x133fe9,null))[_0x9613('0x23')](function(_0xe63c33){if(_0xe63c33){_0x38b6f3=_0xe63c33;_0x12dd2b[_0x9613('0x2c')]=_['keys'](db[_0x9613('0x4d')][_0x9613('0x29')]);_0x12dd2b[_0x9613('0x2f')]=_['keys'](_0x12c247[_0x9613('0x2f')]);_0x12dd2b[_0x9613('0x37')]=_[_0x9613('0x31')](_0x12dd2b[_0x9613('0x2c')],_0x12dd2b[_0x9613('0x2f')]);_0x460d3b['attributes']=_[_0x9613('0x31')](_0x12dd2b['model'],qs[_0x9613('0x32')](_0x12c247[_0x9613('0x2f')][_0x9613('0x32')]));_0x460d3b[_0x9613('0x30')]=_0x460d3b[_0x9613('0x30')][_0x9613('0x33')]?_0x460d3b['attributes']:_0x12dd2b[_0x9613('0x2c')];_0x460d3b[_0x9613('0x50')]=qs[_0x9613('0x35')](_0x12c247[_0x9613('0x2f')][_0x9613('0x35')]);_0x460d3b[_0x9613('0x36')]=qs[_0x9613('0x37')](_[_0x9613('0x4c')](_0x12c247[_0x9613('0x2f')],_0x12dd2b[_0x9613('0x37')]));if(_0x12c247[_0x9613('0x2f')][_0x9613('0x38')]){_0x460d3b[_0x9613('0x36')]=_[_0x9613('0x39')](_0x460d3b['where'],{'$or':_[_0x9613('0x2d')](_0x460d3b['attributes'],function(_0x5ef84c){var _0x2b27cf={};_0x2b27cf[_0x5ef84c]={'$like':'%'+_0x12c247[_0x9613('0x2f')][_0x9613('0x38')]+'%'};return _0x2b27cf;})});}_0x460d3b=_[_0x9613('0x39')]({},_0x460d3b,_0x12c247[_0x9613('0x3b')]);return _0x38b6f3[_0x9613('0x51')](_0x460d3b);}})['then'](function(_0x940206){if(_0x940206){_0x116232=_0x940206[_0x9613('0x33')];if(!_0x12c247[_0x9613('0x2f')][_0x9613('0x52')]('nolimit')){_0x460d3b['limit']=qs[_0x9613('0x1c')](_0x12c247[_0x9613('0x2f')]['limit']);_0x460d3b[_0x9613('0x1a')]=qs[_0x9613('0x1a')](_0x12c247[_0x9613('0x2f')][_0x9613('0x1a')]);}return _0x38b6f3[_0x9613('0x51')](_0x460d3b);}})[_0x9613('0x23')](function(_0x49faf8){if(_0x49faf8){return _0x49faf8?{'count':_0x116232,'rows':_0x49faf8}:null;}})[_0x9613('0x23')](respondWithResult(_0x133fe9,null))[_0x9613('0x44')](handleError(_0x133fe9,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 6c91c67..53c350a 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 _0x4b24=['api','moment','request-promise','path','../../config/environment','./automation.attributes','exports','define','Automation','lodash','util','../../config/logger'];(function(_0x337651,_0x2af690){var _0x20893c=function(_0x545dcd){while(--_0x545dcd){_0x337651['push'](_0x337651['shift']());}};_0x20893c(++_0x2af690);}(_0x4b24,0x1c5));var _0x44b2=function(_0x1877d8,_0x16c26a){_0x1877d8=_0x1877d8-0x0;var _0x176162=_0x4b24[_0x1877d8];return _0x176162;};'use strict';var _=require(_0x44b2('0x0'));var util=require(_0x44b2('0x1'));var logger=require(_0x44b2('0x2'))(_0x44b2('0x3'));var moment=require(_0x44b2('0x4'));var BPromise=require('bluebird');var rp=require(_0x44b2('0x5'));var fs=require('fs');var path=require(_0x44b2('0x6'));var rimraf=require('rimraf');var config=require(_0x44b2('0x7'));var attributes=require(_0x44b2('0x8'));module[_0x44b2('0x9')]=function(_0x53f02c,_0x559e5b){return _0x53f02c[_0x44b2('0xa')](_0x44b2('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x634d=['tools_automations','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x284ca5,_0x2ac104){var _0x2a8e36=function(_0x55b040){while(--_0x55b040){_0x284ca5['push'](_0x284ca5['shift']());}};_0x2a8e36(++_0x2ac104);}(_0x634d,0x91));var _0xd634=function(_0x36f1a9,_0x4ff6c0){_0x36f1a9=_0x36f1a9-0x0;var _0x12d802=_0x634d[_0x36f1a9];return _0x12d802;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd634('0x0'));var BPromise=require('bluebird');var rp=require(_0xd634('0x1'));var fs=require('fs');var path=require(_0xd634('0x2'));var rimraf=require(_0xd634('0x3'));var config=require(_0xd634('0x4'));var attributes=require('./automation.attributes');module[_0xd634('0x5')]=function(_0x12142c,_0x32ca1f){return _0x12142c[_0xd634('0x6')]('Automation',attributes,{'tableName':_0xd634('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 3f735bd..de680d3 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 _0x46c1=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment'];(function(_0x275073,_0x4ea63a){var _0x2864f7=function(_0x4ea815){while(--_0x4ea815){_0x275073['push'](_0x275073['shift']());}};_0x2864f7(++_0x4ea63a);}(_0x46c1,0x7c));var _0x146c=function(_0x17397c,_0x2e2208){_0x17397c=_0x17397c-0x0;var _0x58aa5f=_0x46c1[_0x17397c];return _0x58aa5f;};'use strict';var _=require('lodash');var util=require(_0x146c('0x0'));var moment=require(_0x146c('0x1'));var BPromise=require(_0x146c('0x2'));var rs=require(_0x146c('0x3'));var fs=require('fs');var Redis=require(_0x146c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x146c('0x5'));var logger=require(_0x146c('0x6'))(_0x146c('0x7'));var config=require(_0x146c('0x8'));var jayson=require(_0x146c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e394f,_0x226480,_0x3bccd4){return new BPromise(function(_0x54f99b,_0x36a8c2){return client['request'](_0x2e394f,_0x3bccd4)[_0x146c('0xa')](function(_0x2c8c0a){logger['info'](_0x146c('0xb'),_0x226480,_0x146c('0xc'));logger[_0x146c('0xd')](_0x146c('0xe'),_0x226480,'request\x20sent',JSON[_0x146c('0xf')](_0x2c8c0a));if(_0x2c8c0a['error']){if(_0x2c8c0a[_0x146c('0x10')][_0x146c('0x11')]===0x1f4){logger[_0x146c('0x10')]('Automation,\x20%s,\x20%s',_0x226480,_0x2c8c0a[_0x146c('0x10')]['message']);return _0x36a8c2(_0x2c8c0a[_0x146c('0x10')]['message']);}logger[_0x146c('0x10')](_0x146c('0xb'),_0x226480,_0x2c8c0a[_0x146c('0x10')][_0x146c('0x12')]);return _0x54f99b(_0x2c8c0a['error'][_0x146c('0x12')]);}else{logger[_0x146c('0x13')]('Automation,\x20%s,\x20%s',_0x226480,_0x146c('0xc'));_0x54f99b(_0x2c8c0a['result']['message']);}})[_0x146c('0x14')](function(_0x512ac8){logger[_0x146c('0x10')](_0x146c('0xb'),_0x226480,_0x512ac8);_0x36a8c2(_0x512ac8);});});} \ No newline at end of file +var _0x20d8=['stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x467efe,_0x18a682){var _0x2ba774=function(_0x15da4b){while(--_0x15da4b){_0x467efe['push'](_0x467efe['shift']());}};_0x2ba774(++_0x18a682);}(_0x20d8,0xee));var _0x820d=function(_0x192249,_0x59b0e0){_0x192249=_0x192249-0x0;var _0x37efc8=_0x20d8[_0x192249];return _0x37efc8;};'use strict';var _=require(_0x820d('0x0'));var util=require(_0x820d('0x1'));var moment=require(_0x820d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x820d('0x3'));var db=require(_0x820d('0x4'))['db'];var utils=require(_0x820d('0x5'));var logger=require(_0x820d('0x6'))(_0x820d('0x7'));var config=require('../../config/environment');var jayson=require(_0x820d('0x8'));var client=jayson[_0x820d('0x9')][_0x820d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e23e3,_0x435a84,_0xa2751d){return new BPromise(function(_0x3b084c,_0x485bde){return client[_0x820d('0xb')](_0x4e23e3,_0xa2751d)['then'](function(_0x45fdd7){logger['info']('Automation,\x20%s,\x20%s',_0x435a84,_0x820d('0xc'));logger['debug'](_0x820d('0xd'),_0x435a84,_0x820d('0xc'),JSON[_0x820d('0xe')](_0x45fdd7));if(_0x45fdd7['error']){if(_0x45fdd7[_0x820d('0xf')][_0x820d('0x10')]===0x1f4){logger['error'](_0x820d('0x11'),_0x435a84,_0x45fdd7['error'][_0x820d('0x12')]);return _0x485bde(_0x45fdd7[_0x820d('0xf')][_0x820d('0x12')]);}logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x45fdd7[_0x820d('0xf')]['message']);return _0x3b084c(_0x45fdd7['error'][_0x820d('0x12')]);}else{logger['info'](_0x820d('0x11'),_0x435a84,_0x820d('0xc'));_0x3b084c(_0x45fdd7[_0x820d('0x13')]['message']);}})[_0x820d('0x14')](function(_0x3466c1){logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x3466c1);_0x485bde(_0x3466c1);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 1483f28..b43e298 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 _0x46b3=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','/:id','get','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions'];(function(_0x57b38f,_0xc26f33){var _0x6aa12c=function(_0x32850d){while(--_0x32850d){_0x57b38f['push'](_0x57b38f['shift']());}};_0x6aa12c(++_0xc26f33);}(_0x46b3,0x194));var _0x346b=function(_0x163285,_0x25607c){_0x163285=_0x163285-0x0;var _0x299c0b=_0x46b3[_0x163285];return _0x299c0b;};'use strict';var multer=require(_0x346b('0x0'));var util=require(_0x346b('0x1'));var path=require(_0x346b('0x2'));var timeout=require(_0x346b('0x3'));var express=require(_0x346b('0x4'));var router=express['Router']();var fs_extra=require(_0x346b('0x5'));var auth=require(_0x346b('0x6'));var interaction=require(_0x346b('0x7'));var config=require(_0x346b('0x8'));var controller=require(_0x346b('0x9'));router['get']('/',auth[_0x346b('0xa')](),controller[_0x346b('0xb')]);router['get'](_0x346b('0xc'),auth[_0x346b('0xa')](),controller['show']);router[_0x346b('0xd')](_0x346b('0xe'),auth[_0x346b('0xa')](),controller[_0x346b('0xf')]);router[_0x346b('0xd')](_0x346b('0x10'),auth[_0x346b('0xa')](),controller[_0x346b('0x11')]);router[_0x346b('0x12')]('/',auth['isAuthenticated'](),controller[_0x346b('0x13')]);router[_0x346b('0x12')]('/:id/conditions',auth[_0x346b('0xa')](),controller[_0x346b('0x14')]);router['post'](_0x346b('0x10'),auth[_0x346b('0xa')](),controller['addActions']);router['put'](_0x346b('0xc'),auth[_0x346b('0xa')](),controller[_0x346b('0x15')]);router[_0x346b('0x16')](_0x346b('0xc'),auth[_0x346b('0xa')](),controller[_0x346b('0x17')]);module[_0x346b('0x18')]=router; \ No newline at end of file +var _0x3cb7=['post','create','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x39f34f,_0x298f45){var _0x59fee1=function(_0x6ebbb7){while(--_0x6ebbb7){_0x39f34f['push'](_0x39f34f['shift']());}};_0x59fee1(++_0x298f45);}(_0x3cb7,0x1a8));var _0x73cb=function(_0x3b6648,_0x2d723a){_0x3b6648=_0x3b6648-0x0;var _0x5a0a0d=_0x3cb7[_0x3b6648];return _0x5a0a0d;};'use strict';var multer=require(_0x73cb('0x0'));var util=require(_0x73cb('0x1'));var path=require('path');var timeout=require(_0x73cb('0x2'));var express=require(_0x73cb('0x3'));var router=express[_0x73cb('0x4')]();var fs_extra=require(_0x73cb('0x5'));var auth=require(_0x73cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x73cb('0x7'));var controller=require('./automation.controller');router[_0x73cb('0x8')]('/',auth[_0x73cb('0x9')](),controller[_0x73cb('0xa')]);router[_0x73cb('0x8')](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller['show']);router[_0x73cb('0x8')](_0x73cb('0xc'),auth[_0x73cb('0x9')](),controller[_0x73cb('0xd')]);router[_0x73cb('0x8')](_0x73cb('0xe'),auth[_0x73cb('0x9')](),controller[_0x73cb('0xf')]);router[_0x73cb('0x10')]('/',auth[_0x73cb('0x9')](),controller[_0x73cb('0x11')]);router[_0x73cb('0x10')](_0x73cb('0xc'),auth[_0x73cb('0x9')](),controller['addConditions']);router[_0x73cb('0x10')](_0x73cb('0xe'),auth[_0x73cb('0x9')](),controller['addActions']);router['put'](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller[_0x73cb('0x12')]);router['delete'](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller['destroy']);module[_0x73cb('0x13')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index b8c5cb9..94872d3 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 _0x6e91=['#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x128b04,_0x5de299){var _0x4a79e0=function(_0x4ea9b1){while(--_0x4ea9b1){_0x128b04['push'](_0x128b04['shift']());}};_0x4a79e0(++_0x5de299);}(_0x6e91,0x15e));var _0x16e9=function(_0x5a8a3c,_0x505557){_0x5a8a3c=_0x5a8a3c-0x0;var _0x201660=_0x6e91[_0x5a8a3c];return _0x201660;};'use strict';var Sequelize=require(_0x16e9('0x0'));module[_0x16e9('0x1')]={'name':{'type':Sequelize[_0x16e9('0x2')],'unique':_0x16e9('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x16e9('0x4')},'description':{'type':Sequelize[_0x16e9('0x2')]},'active':{'type':Sequelize[_0x16e9('0x5')],'defaultValue':0x0,'comment':_0x16e9('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x16e9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x16e9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x16e9('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x16e9('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x16e9('0x2')],'defaultValue':_0x16e9('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x16e9('0x10')](_0x16e9('0x11'),'never',_0x16e9('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x16e9('0x5')],'defaultValue':0x0,'comment':_0x16e9('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x16e9('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x16e9('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x16e9('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x16e9('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x16e9('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x16e9('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x16e9('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x16e9('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x16e9('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x16e9('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x16e9('0x1c'),_0x16e9('0x1d')),'defaultValue':_0x16e9('0x1c')},'dialPrefix':{'type':Sequelize[_0x16e9('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x16e9('0x1e')},'dialCutDigit':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x16e9('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0x22')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0x27')}}; \ No newline at end of file +var _0xf1cb=['name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING'];(function(_0x420990,_0x2031bd){var _0x533411=function(_0x42b118){while(--_0x42b118){_0x420990['push'](_0x420990['shift']());}};_0x533411(++_0x2031bd);}(_0xf1cb,0x6d));var _0xbf1c=function(_0x11c471,_0x1f9001){_0x11c471=_0x11c471-0x0;var _0x18285e=_0xf1cb[_0x11c471];return _0x18285e;};'use strict';var Sequelize=require(_0xbf1c('0x0'));module['exports']={'name':{'type':Sequelize[_0xbf1c('0x1')],'unique':_0xbf1c('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xbf1c('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xbf1c('0x4')},'description':{'type':Sequelize[_0xbf1c('0x1')]},'active':{'type':Sequelize[_0xbf1c('0x5')],'defaultValue':0x0,'comment':_0xbf1c('0x6')},'limitCalls':{'type':Sequelize[_0xbf1c('0x7')](0x4)[_0xbf1c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbf1c('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbf1c('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf1c('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'comment':_0xbf1c('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbf1c('0xf')},'dialTimezone':{'type':Sequelize[_0xbf1c('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbf1c('0x1')],'defaultValue':_0xbf1c('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xbf1c('0x3')](_0xbf1c('0x11'),_0xbf1c('0x12'),_0xbf1c('0x13')),'defaultValue':_0xbf1c('0x11')},'dialAMDActive':{'type':Sequelize[_0xbf1c('0x5')],'defaultValue':0x0,'comment':_0xbf1c('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbf1c('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbf1c('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbf1c('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf1c('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xbf1c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf1c('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbf1c('0x3')](_0xbf1c('0x1a'),'ASC'),'defaultValue':_0xbf1c('0x1a')},'dialPrefix':{'type':Sequelize[_0xbf1c('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbf1c('0x1b')},'dialCutDigit':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbf1c('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf1c('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf1c('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf1c('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf1c('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 917b778..6d02b3e 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 _0x6c2d=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','findAll','rows','params','keys','includeAll','catch','create','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','getHoppers','CmHopper','nolimit','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CampaignId','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','field','NOW()','ContactId','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','CmListId','cm_contacts','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','sequelize','removeBlackLists','eml-format','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x6c2d,0x1e9));var _0xd6c2=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0x6c2d[_0x593752];return _0x4612be;};'use strict';var emlformat=require(_0xd6c2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd6c2('0x1'));var moment=require(_0xd6c2('0x2'));var BPromise=require(_0xd6c2('0x3'));var Mustache=require(_0xd6c2('0x4'));var util=require(_0xd6c2('0x5'));var path=require(_0xd6c2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd6c2('0x7'));var fs=require('fs');var fs_extra=require(_0xd6c2('0x8'));var _=require('lodash');var squel=require(_0xd6c2('0x9'));var crypto=require(_0xd6c2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd6c2('0xb'));var querystring=require(_0xd6c2('0xc'));var Papa=require(_0xd6c2('0xd'));var Redis=require(_0xd6c2('0xe'));var authService=require(_0xd6c2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd6c2('0x10'));var hardwareService=require(_0xd6c2('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xd6c2('0x12'));var config=require(_0xd6c2('0x13'));var licenseUtil=require(_0xd6c2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdd7a59,_0x2571fa){_0x2571fa=_0x2571fa||0xcc;return function(_0x5bfc8b){if(_0x5bfc8b){return _0xdd7a59[_0xd6c2('0x15')](_0x2571fa);}return _0xdd7a59['status'](_0x2571fa)[_0xd6c2('0x16')]();};}function respondWithResult(_0x4dd054,_0x328de6){_0x328de6=_0x328de6||0xc8;return function(_0x2bd725){if(_0x2bd725){return _0x4dd054['status'](_0x328de6)[_0xd6c2('0x17')](_0x2bd725);}};}function respondWithFilteredResult(_0xc21f55,_0x3b6f23){return function(_0x323cec){if(_0x323cec){var _0xc328=typeof _0x3b6f23[_0xd6c2('0x18')]===_0xd6c2('0x19')&&typeof _0x3b6f23['limit']===_0xd6c2('0x19');var _0x17026c=_0x323cec[_0xd6c2('0x1a')];var _0x58fa76=_0xc328?0x0:_0x3b6f23[_0xd6c2('0x18')];var _0x34fd7e=_0xc328?_0x323cec[_0xd6c2('0x1a')]:_0x3b6f23[_0xd6c2('0x18')]+_0x3b6f23[_0xd6c2('0x1b')];var _0x774f7c;if(_0x34fd7e>=_0x17026c){_0x34fd7e=_0x17026c;_0x774f7c=0xc8;}else{_0x774f7c=0xce;}_0xc21f55[_0xd6c2('0x1c')](_0x774f7c);return _0xc21f55['set'](_0xd6c2('0x1d'),_0x58fa76+'-'+_0x34fd7e+'/'+_0x17026c)['json'](_0x323cec);}return null;};}function patchUpdates(_0x213cf2){return function(_0xc8b7e6){try{jsonpatch[_0xd6c2('0x1e')](_0xc8b7e6,_0x213cf2,!![]);}catch(_0x1a69cf){return BPromise[_0xd6c2('0x1f')](_0x1a69cf);}return _0xc8b7e6[_0xd6c2('0x20')]();};}function saveUpdates(_0x4c6af8,_0x56fc10){return function(_0x49bbb0){if(_0x49bbb0){return _0x49bbb0[_0xd6c2('0x21')](_0x4c6af8)[_0xd6c2('0x22')](function(_0x30bf64){return _0x30bf64;});}return null;};}function removeEntity(_0x2ce300,_0x5ae8de){return function(_0x513a8d){if(_0x513a8d){return _0x513a8d[_0xd6c2('0x23')]()[_0xd6c2('0x22')](function(){var _0x32127e=_0x513a8d['get']({'plain':!![]});var _0xbf58ca=_0xd6c2('0x24');return db[_0xd6c2('0x25')][_0xd6c2('0x23')]({'where':{'type':_0xbf58ca,'resourceId':_0x32127e['id']}})[_0xd6c2('0x22')](function(){return _0x513a8d;});})[_0xd6c2('0x22')](function(){_0x2ce300[_0xd6c2('0x1c')](0xcc)[_0xd6c2('0x16')]();});}};}function handleEntityNotFound(_0xaf813b,_0x383bfb){return function(_0x7b6020){if(!_0x7b6020){_0xaf813b[_0xd6c2('0x15')](0x194);}return _0x7b6020;};}function handleError(_0x429c39,_0x2bb192){_0x2bb192=_0x2bb192||0x1f4;return function(_0x54ea64){logger['error'](_0x54ea64[_0xd6c2('0x26')]);if(_0x54ea64[_0xd6c2('0x27')]){delete _0x54ea64[_0xd6c2('0x27')];}_0x429c39[_0xd6c2('0x1c')](_0x2bb192)[_0xd6c2('0x28')](_0x54ea64);};}exports[_0xd6c2('0x29')]=function(_0x2ef1d0,_0x592738){var _0x17dfad={},_0x212933={},_0x2f452b={'count':0x0,'rows':[]};var _0x595cdf=_[_0xd6c2('0x2a')](db[_0xd6c2('0x2b')][_0xd6c2('0x2c')],function(_0x41fe48){return{'name':_0x41fe48[_0xd6c2('0x2d')],'type':_0x41fe48[_0xd6c2('0x2e')][_0xd6c2('0x2f')]};});_0x212933[_0xd6c2('0x30')]=_[_0xd6c2('0x2a')](_0x595cdf,_0xd6c2('0x27'));_0x212933[_0xd6c2('0x31')]=_['keys'](_0x2ef1d0['query']);_0x212933[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0x212933[_0xd6c2('0x30')],_0x212933['query']);_0x17dfad[_0xd6c2('0x34')]=_['intersection'](_0x212933[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x35')]));_0x17dfad[_0xd6c2('0x34')]=_0x17dfad['attributes'][_0xd6c2('0x36')]?_0x17dfad[_0xd6c2('0x34')]:_0x212933[_0xd6c2('0x30')];if(!_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x37')]('nolimit')){_0x17dfad[_0xd6c2('0x1b')]=qs[_0xd6c2('0x1b')](_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x1b')]);_0x17dfad['offset']=qs[_0xd6c2('0x18')](_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x18')]);}_0x17dfad[_0xd6c2('0x38')]=qs[_0xd6c2('0x39')](_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x39')]);_0x17dfad[_0xd6c2('0x3a')]=qs[_0xd6c2('0x32')](_[_0xd6c2('0x3b')](_0x2ef1d0[_0xd6c2('0x31')],_0x212933[_0xd6c2('0x32')]),_0x595cdf);if(_0x2ef1d0[_0xd6c2('0x31')]['filter']){_0x17dfad['where']=_[_0xd6c2('0x3c')](_0x17dfad[_0xd6c2('0x3a')],{'$or':_[_0xd6c2('0x2a')](_0x595cdf,function(_0x9e755c){if(_0x9e755c['type']!=='VIRTUAL'){var _0xae00ea={};_0xae00ea[_0x9e755c[_0xd6c2('0x27')]]={'$like':'%'+_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x3d')]+'%'};return _0xae00ea;}})});}_0x17dfad=_[_0xd6c2('0x3c')]({},_0x17dfad,_0x2ef1d0[_0xd6c2('0x3e')]);var _0x46e7c4={'where':_0x17dfad[_0xd6c2('0x3a')]};return db[_0xd6c2('0x2b')]['count'](_0x46e7c4)[_0xd6c2('0x22')](function(_0x8fdd4c){_0x2f452b[_0xd6c2('0x1a')]=_0x8fdd4c;if(_0x2ef1d0[_0xd6c2('0x31')]['includeAll']){_0x17dfad[_0xd6c2('0x3f')]=[{'all':!![]}];}return db[_0xd6c2('0x2b')][_0xd6c2('0x40')](_0x17dfad);})[_0xd6c2('0x22')](function(_0x315932){_0x2f452b[_0xd6c2('0x41')]=_0x315932;return _0x2f452b;})['then'](respondWithFilteredResult(_0x592738,_0x17dfad))['catch'](handleError(_0x592738,null));};exports['show']=function(_0x552f13,_0x16ee7d){var _0x20899c={'raw':![],'where':{'id':_0x552f13[_0xd6c2('0x42')]['id']}},_0xbf5f25={};_0xbf5f25[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db[_0xd6c2('0x2b')]['rawAttributes']);_0xbf5f25[_0xd6c2('0x31')]=_[_0xd6c2('0x43')](_0x552f13[_0xd6c2('0x31')]);_0xbf5f25['filters']=_['intersection'](_0xbf5f25[_0xd6c2('0x30')],_0xbf5f25[_0xd6c2('0x31')]);_0x20899c[_0xd6c2('0x34')]=_['intersection'](_0xbf5f25[_0xd6c2('0x30')],qs['fields'](_0x552f13['query'][_0xd6c2('0x35')]));_0x20899c[_0xd6c2('0x34')]=_0x20899c['attributes'][_0xd6c2('0x36')]?_0x20899c[_0xd6c2('0x34')]:_0xbf5f25[_0xd6c2('0x30')];if(_0x552f13[_0xd6c2('0x31')][_0xd6c2('0x44')]){_0x20899c[_0xd6c2('0x3f')]=[{'all':!![]}];}_0x20899c=_['merge']({},_0x20899c,_0x552f13[_0xd6c2('0x3e')]);return db['Campaign']['find'](_0x20899c)[_0xd6c2('0x22')](handleEntityNotFound(_0x16ee7d,null))['then'](respondWithResult(_0x16ee7d,null))[_0xd6c2('0x45')](handleError(_0x16ee7d,null));};exports[_0xd6c2('0x46')]=function(_0x18a574,_0x3b6cd7){return db[_0xd6c2('0x2b')][_0xd6c2('0x46')](_0x18a574['body'],{})['then'](function(_0x554672){var _0x41ab42=_0x18a574[_0xd6c2('0x47')][_0xd6c2('0x48')]({'plain':!![]});if(!_0x41ab42)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41ab42[_0xd6c2('0x49')]===_0xd6c2('0x47')){var _0x1b6f18=_0x554672[_0xd6c2('0x48')]({'plain':!![]});var _0x31eb49=_0xd6c2('0x24');return db[_0xd6c2('0x4a')][_0xd6c2('0x4b')]({'where':{'name':_0x31eb49,'userProfileId':_0x41ab42[_0xd6c2('0x4c')]},'raw':!![]})[_0xd6c2('0x22')](function(_0x20e9d5){if(_0x20e9d5&&_0x20e9d5[_0xd6c2('0x4d')]===0x0){return db[_0xd6c2('0x25')]['create']({'name':_0x1b6f18['name'],'resourceId':_0x1b6f18['id'],'type':_0x20e9d5[_0xd6c2('0x27')],'sectionId':_0x20e9d5['id']},{})[_0xd6c2('0x22')](function(){return _0x554672;});}else{return _0x554672;}})[_0xd6c2('0x45')](function(_0x2d1c9d){logger['error'](_0xd6c2('0x4e'),_0x2d1c9d);throw _0x2d1c9d;});}return _0x554672;})['then'](respondWithResult(_0x3b6cd7,0xc9))[_0xd6c2('0x45')](handleError(_0x3b6cd7,null));};exports['clone']=function(_0xe244a9,_0xbf9e3e){var _0x3c8417={'where':{'id':_0xe244a9['params']['id']}},_0x4f6cea={};_0x4f6cea[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db[_0xd6c2('0x2b')][_0xd6c2('0x2c')]);_0x3c8417[_0xd6c2('0x34')]=_[_0xd6c2('0x33')](_0x4f6cea[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0xe244a9[_0xd6c2('0x31')]['fields']));_0x3c8417[_0xd6c2('0x34')]=_0x3c8417[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0x3c8417[_0xd6c2('0x34')]:_0x4f6cea[_0xd6c2('0x30')];if(_0xe244a9[_0xd6c2('0x31')]['includeAll']){_0x3c8417[_0xd6c2('0x3f')]=[{'all':!![]}];}_0x3c8417=_[_0xd6c2('0x3c')]({},_0x3c8417,_0xe244a9[_0xd6c2('0x3e')]);return db[_0xd6c2('0x2b')][_0xd6c2('0x4b')](_0x3c8417)['then'](handleEntityNotFound(_0xbf9e3e,null))[_0xd6c2('0x22')](function(_0x204c90){if(_0x204c90){var _0x3724de=_0x204c90[_0xd6c2('0x48')]({'plain':!![]});_0x3724de=qs[_0xd6c2('0x4f')](_0x3724de,['id',_0xd6c2('0x50'),_0xd6c2('0x51')]);_0xe244a9[_0xd6c2('0x52')]=_['omit'](_0xe244a9['body'],['id',_0xd6c2('0x50'),_0xd6c2('0x51')]);return db['Campaign']['create'](_['merge'](_0x3724de,_0xe244a9[_0xd6c2('0x52')]),{'include':_0xe244a9[_0xd6c2('0x31')][_0xd6c2('0x44')]?[{'all':!![]}]:undefined})[_0xd6c2('0x22')](function(_0x169ecf){var _0x2639ff=_0xe244a9[_0xd6c2('0x47')][_0xd6c2('0x48')]({'plain':!![]});if(!_0x2639ff)throw new Error(_0xd6c2('0x53'));if(_0x2639ff[_0xd6c2('0x49')]===_0xd6c2('0x47')){var _0xfd0874=_0x169ecf[_0xd6c2('0x48')]({'plain':!![]});var _0x4db495=_0xd6c2('0x24');return db[_0xd6c2('0x4a')]['find']({'where':{'name':_0x4db495,'userProfileId':_0x2639ff['userProfileId']},'raw':!![]})['then'](function(_0x36742f){if(_0x36742f&&_0x36742f['autoAssociation']===0x0){return db[_0xd6c2('0x25')][_0xd6c2('0x46')]({'name':_0xfd0874['name'],'resourceId':_0xfd0874['id'],'type':_0x36742f[_0xd6c2('0x27')],'sectionId':_0x36742f['id']},{})[_0xd6c2('0x22')](function(){return _0x169ecf;});}else{return _0x169ecf;}})['catch'](function(_0x466f35){logger[_0xd6c2('0x54')](_0xd6c2('0x4e'),_0x466f35);throw _0x466f35;});}return _0x169ecf;});}})[_0xd6c2('0x22')](respondWithResult(_0xbf9e3e,0xc9))[_0xd6c2('0x45')](handleError(_0xbf9e3e,null));};exports[_0xd6c2('0x21')]=function(_0x858bbd,_0x9ae1da){if(_0x858bbd[_0xd6c2('0x52')]['id']){delete _0x858bbd[_0xd6c2('0x52')]['id'];}return db['Campaign'][_0xd6c2('0x4b')]({'where':{'id':_0x858bbd[_0xd6c2('0x42')]['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x9ae1da,null))[_0xd6c2('0x22')](saveUpdates(_0x858bbd['body'],null))[_0xd6c2('0x22')](respondWithResult(_0x9ae1da,null))[_0xd6c2('0x45')](handleError(_0x9ae1da,null));};exports[_0xd6c2('0x23')]=function(_0x3af333,_0x24cf4c){return db[_0xd6c2('0x2b')]['find']({'where':{'id':_0x3af333[_0xd6c2('0x42')]['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x24cf4c,null))[_0xd6c2('0x22')](removeEntity(_0x24cf4c,null))[_0xd6c2('0x45')](handleError(_0x24cf4c,null));};exports[_0xd6c2('0x55')]=function(_0x280516,_0x123760,_0x483c4e){var _0x49f9b7={'raw':!![],'where':{}};var _0x3ca1c0={};var _0x5d4018={'count':0x0,'rows':[]};return db[_0xd6c2('0x2b')]['findOne']({'where':{'id':_0x280516['params']['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x123760,null))[_0xd6c2('0x22')](function(_0x1cde7){if(_0x1cde7){_0x3ca1c0['model']=_[_0xd6c2('0x43')](db[_0xd6c2('0x56')][_0xd6c2('0x2c')]);_0x3ca1c0[_0xd6c2('0x31')]=_[_0xd6c2('0x43')](_0x280516[_0xd6c2('0x31')]);_0x3ca1c0[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0x3ca1c0[_0xd6c2('0x30')],_0x3ca1c0[_0xd6c2('0x31')]);_0x49f9b7[_0xd6c2('0x34')]=_[_0xd6c2('0x33')](_0x3ca1c0[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0x280516[_0xd6c2('0x31')]['fields']));_0x49f9b7[_0xd6c2('0x34')]=_0x49f9b7[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0x49f9b7[_0xd6c2('0x34')]:_0x3ca1c0[_0xd6c2('0x30')];if(!_0x280516[_0xd6c2('0x31')][_0xd6c2('0x37')](_0xd6c2('0x57'))){_0x49f9b7[_0xd6c2('0x1b')]=qs[_0xd6c2('0x1b')](_0x280516[_0xd6c2('0x31')][_0xd6c2('0x1b')]);_0x49f9b7['offset']=qs['offset'](_0x280516['query'][_0xd6c2('0x18')]);}_0x49f9b7[_0xd6c2('0x38')]=qs[_0xd6c2('0x39')](_0x280516[_0xd6c2('0x31')]['sort']);_0x49f9b7[_0xd6c2('0x3a')]=qs[_0xd6c2('0x32')](_[_0xd6c2('0x3b')](_0x280516['query'],_0x3ca1c0[_0xd6c2('0x32')]));_0x49f9b7[_0xd6c2('0x3a')]['CampaignId']=_0x1cde7['id'];if(_0x280516[_0xd6c2('0x31')][_0xd6c2('0x3d')]){_0x49f9b7[_0xd6c2('0x3a')]=_[_0xd6c2('0x3c')](_0x49f9b7[_0xd6c2('0x3a')],{'$or':_[_0xd6c2('0x2a')](_0x49f9b7['attributes'],function(_0x5b857d){var _0x19e6f5={};_0x19e6f5[_0x5b857d]={'$like':'%'+_0x280516[_0xd6c2('0x31')]['filter']+'%'};return _0x19e6f5;})});}_0x49f9b7=_[_0xd6c2('0x3c')]({},_0x49f9b7,_0x280516['options']);return db[_0xd6c2('0x56')][_0xd6c2('0x1a')]({'where':_0x49f9b7['where']})[_0xd6c2('0x22')](function(_0xedc7b5){_0x5d4018[_0xd6c2('0x1a')]=_0xedc7b5;if(_0x280516[_0xd6c2('0x31')][_0xd6c2('0x44')]){_0x49f9b7[_0xd6c2('0x3f')]=[{'all':!![]}];}return db[_0xd6c2('0x56')][_0xd6c2('0x40')](_0x49f9b7);})[_0xd6c2('0x22')](function(_0x267647){_0x5d4018[_0xd6c2('0x41')]=_0x267647;return _0x5d4018;});}})[_0xd6c2('0x22')](respondWithFilteredResult(_0x123760,_0x49f9b7))[_0xd6c2('0x45')](handleError(_0x123760,null));};exports['getHopperHistories']=function(_0x11079e,_0x4cd0ed,_0x38848c){var _0x14e38f={'raw':!![],'where':{}};var _0x3e5bf1={};var _0x15fa77={'count':0x0,'rows':[]};return db['Campaign'][_0xd6c2('0x58')]({'where':{'id':_0x11079e['params']['id']}})['then'](handleEntityNotFound(_0x4cd0ed,null))[_0xd6c2('0x22')](function(_0x15522c){if(_0x15522c){_0x3e5bf1[_0xd6c2('0x30')]=_['keys'](db[_0xd6c2('0x59')][_0xd6c2('0x2c')]);_0x3e5bf1[_0xd6c2('0x31')]=_[_0xd6c2('0x43')](_0x11079e[_0xd6c2('0x31')]);_0x3e5bf1[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0x3e5bf1[_0xd6c2('0x30')],_0x3e5bf1[_0xd6c2('0x31')]);_0x14e38f[_0xd6c2('0x34')]=_['intersection'](_0x3e5bf1[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x35')]));_0x14e38f[_0xd6c2('0x34')]=_0x14e38f['attributes'][_0xd6c2('0x36')]?_0x14e38f[_0xd6c2('0x34')]:_0x3e5bf1[_0xd6c2('0x30')];if(!_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x37')]('nolimit')){_0x14e38f['limit']=qs[_0xd6c2('0x1b')](_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x1b')]);_0x14e38f[_0xd6c2('0x18')]=qs['offset'](_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x18')]);}_0x14e38f[_0xd6c2('0x38')]=qs['sort'](_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x39')]);_0x14e38f['where']=qs['filters'](_[_0xd6c2('0x3b')](_0x11079e[_0xd6c2('0x31')],_0x3e5bf1[_0xd6c2('0x32')]));_0x14e38f[_0xd6c2('0x3a')]['CampaignId']=_0x15522c['id'];if(_0x11079e[_0xd6c2('0x31')]['filter']){_0x14e38f['where']=_[_0xd6c2('0x3c')](_0x14e38f[_0xd6c2('0x3a')],{'$or':_['map'](_0x14e38f['attributes'],function(_0x3447c4){var _0x5534df={};_0x5534df[_0x3447c4]={'$like':'%'+_0x11079e['query'][_0xd6c2('0x3d')]+'%'};return _0x5534df;})});}_0x14e38f=_[_0xd6c2('0x3c')]({},_0x14e38f,_0x11079e[_0xd6c2('0x3e')]);return db[_0xd6c2('0x59')]['count']({'where':_0x14e38f[_0xd6c2('0x3a')]})[_0xd6c2('0x22')](function(_0x3fb10){_0x15fa77[_0xd6c2('0x1a')]=_0x3fb10;if(_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x44')]){_0x14e38f[_0xd6c2('0x3f')]=[{'all':!![]}];}return db[_0xd6c2('0x59')][_0xd6c2('0x40')](_0x14e38f);})[_0xd6c2('0x22')](function(_0xb148b1){_0x15fa77['rows']=_0xb148b1;return _0x15fa77;});}})[_0xd6c2('0x22')](respondWithFilteredResult(_0x4cd0ed,_0x14e38f))[_0xd6c2('0x45')](handleError(_0x4cd0ed,null));};exports[_0xd6c2('0x5a')]=function(_0x38a094,_0x28f7f7,_0x1a1582){var _0x29b239={'raw':!![],'where':{}};var _0x2bad89={};var _0x48585a={'count':0x0,'rows':[]};return db['Campaign'][_0xd6c2('0x58')]({'where':{'id':_0x38a094['params']['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x28f7f7,null))[_0xd6c2('0x22')](function(_0x2a358c){if(_0x2a358c){_0x2bad89[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db['CmHopperFinal'][_0xd6c2('0x2c')]);_0x2bad89['query']=_[_0xd6c2('0x43')](_0x38a094[_0xd6c2('0x31')]);_0x2bad89[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0x2bad89[_0xd6c2('0x30')],_0x2bad89[_0xd6c2('0x31')]);_0x29b239[_0xd6c2('0x34')]=_[_0xd6c2('0x33')](_0x2bad89[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0x38a094[_0xd6c2('0x31')][_0xd6c2('0x35')]));_0x29b239[_0xd6c2('0x34')]=_0x29b239[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0x29b239['attributes']:_0x2bad89['model'];if(!_0x38a094[_0xd6c2('0x31')]['hasOwnProperty'](_0xd6c2('0x57'))){_0x29b239['limit']=qs[_0xd6c2('0x1b')](_0x38a094[_0xd6c2('0x31')][_0xd6c2('0x1b')]);_0x29b239[_0xd6c2('0x18')]=qs[_0xd6c2('0x18')](_0x38a094['query'][_0xd6c2('0x18')]);}_0x29b239[_0xd6c2('0x38')]=qs['sort'](_0x38a094[_0xd6c2('0x31')][_0xd6c2('0x39')]);_0x29b239[_0xd6c2('0x3a')]=qs[_0xd6c2('0x32')](_[_0xd6c2('0x3b')](_0x38a094[_0xd6c2('0x31')],_0x2bad89['filters']));_0x29b239[_0xd6c2('0x3a')]['CampaignId']=_0x2a358c['id'];if(_0x38a094[_0xd6c2('0x31')]['filter']){_0x29b239[_0xd6c2('0x3a')]=_[_0xd6c2('0x3c')](_0x29b239['where'],{'$or':_['map'](_0x29b239[_0xd6c2('0x34')],function(_0x382d11){var _0x4360d0={};_0x4360d0[_0x382d11]={'$like':'%'+_0x38a094[_0xd6c2('0x31')]['filter']+'%'};return _0x4360d0;})});}_0x29b239=_[_0xd6c2('0x3c')]({},_0x29b239,_0x38a094['options']);return db[_0xd6c2('0x5b')]['count']({'where':_0x29b239[_0xd6c2('0x3a')]})[_0xd6c2('0x22')](function(_0x5d025f){_0x48585a['count']=_0x5d025f;if(_0x38a094[_0xd6c2('0x31')]['includeAll']){_0x29b239[_0xd6c2('0x3f')]=[{'all':!![]}];}return db[_0xd6c2('0x5b')][_0xd6c2('0x40')](_0x29b239);})[_0xd6c2('0x22')](function(_0x57f56c){_0x48585a['rows']=_0x57f56c;return _0x48585a;});}})[_0xd6c2('0x22')](respondWithFilteredResult(_0x28f7f7,_0x29b239))['catch'](handleError(_0x28f7f7,null));};exports[_0xd6c2('0x5c')]=function(_0xab817e,_0x2e57fc,_0x3112b2){var _0x35a4d7={'raw':!![],'where':{}};var _0x52fdfc={};var _0x6e1b85={'count':0x0,'rows':[]};return db[_0xd6c2('0x2b')][_0xd6c2('0x58')]({'where':{'id':_0xab817e['params']['id']}})['then'](handleEntityNotFound(_0x2e57fc,null))[_0xd6c2('0x22')](function(_0xf5dbb){if(_0xf5dbb){_0x52fdfc[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db[_0xd6c2('0x5d')][_0xd6c2('0x2c')]);_0x52fdfc[_0xd6c2('0x31')]=_['keys'](_0xab817e[_0xd6c2('0x31')]);_0x52fdfc[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0x52fdfc['model'],_0x52fdfc[_0xd6c2('0x31')]);_0x35a4d7[_0xd6c2('0x34')]=_['intersection'](_0x52fdfc['model'],qs[_0xd6c2('0x35')](_0xab817e[_0xd6c2('0x31')]['fields']));_0x35a4d7[_0xd6c2('0x34')]=_0x35a4d7[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0x35a4d7['attributes']:_0x52fdfc[_0xd6c2('0x30')];if(!_0xab817e['query'][_0xd6c2('0x37')](_0xd6c2('0x57'))){_0x35a4d7[_0xd6c2('0x1b')]=qs['limit'](_0xab817e[_0xd6c2('0x31')][_0xd6c2('0x1b')]);_0x35a4d7[_0xd6c2('0x18')]=qs[_0xd6c2('0x18')](_0xab817e['query'][_0xd6c2('0x18')]);}_0x35a4d7['order']=qs[_0xd6c2('0x39')](_0xab817e['query'][_0xd6c2('0x39')]);_0x35a4d7['where']=qs[_0xd6c2('0x32')](_[_0xd6c2('0x3b')](_0xab817e['query'],_0x52fdfc[_0xd6c2('0x32')]));_0x35a4d7['where'][_0xd6c2('0x5e')]=_0xf5dbb['id'];if(_0xab817e[_0xd6c2('0x31')][_0xd6c2('0x3d')]){_0x35a4d7['where']=_[_0xd6c2('0x3c')](_0x35a4d7[_0xd6c2('0x3a')],{'$or':_['map'](_0x35a4d7[_0xd6c2('0x34')],function(_0xf2797b){var _0x3e823c={};_0x3e823c[_0xf2797b]={'$like':'%'+_0xab817e[_0xd6c2('0x31')]['filter']+'%'};return _0x3e823c;})});}_0x35a4d7=_['merge']({},_0x35a4d7,_0xab817e['options']);return db[_0xd6c2('0x5d')][_0xd6c2('0x1a')]({'where':_0x35a4d7[_0xd6c2('0x3a')]})['then'](function(_0x8772fc){_0x6e1b85['count']=_0x8772fc;if(_0xab817e[_0xd6c2('0x31')][_0xd6c2('0x44')]){_0x35a4d7[_0xd6c2('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd6c2('0x40')](_0x35a4d7);})[_0xd6c2('0x22')](function(_0x5bf8a1){_0x6e1b85['rows']=_0x5bf8a1;return _0x6e1b85;});}})[_0xd6c2('0x22')](respondWithFilteredResult(_0x2e57fc,_0x35a4d7))[_0xd6c2('0x45')](handleError(_0x2e57fc,null));};exports[_0xd6c2('0x5f')]=function(_0x57679d,_0x60a4aa,_0x5dd5e1){var _0x4fb2e6={};var _0x324015={};var _0x1ef19a;var _0x29f81f;return db['Campaign'][_0xd6c2('0x58')]({'where':{'id':_0x57679d['params']['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x60a4aa,null))[_0xd6c2('0x22')](function(_0x54ba2b){if(_0x54ba2b){_0x1ef19a=_0x54ba2b;_0x324015[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db[_0xd6c2('0x60')][_0xd6c2('0x2c')]);_0x324015['query']=_[_0xd6c2('0x43')](_0x57679d[_0xd6c2('0x31')]);_0x324015[_0xd6c2('0x32')]=_['intersection'](_0x324015[_0xd6c2('0x30')],_0x324015['query']);_0x4fb2e6[_0xd6c2('0x34')]=_[_0xd6c2('0x33')](_0x324015[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0x57679d[_0xd6c2('0x31')][_0xd6c2('0x35')]));_0x4fb2e6[_0xd6c2('0x34')]=_0x4fb2e6[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0x4fb2e6[_0xd6c2('0x34')]:_0x324015[_0xd6c2('0x30')];_0x4fb2e6[_0xd6c2('0x38')]=qs[_0xd6c2('0x39')](_0x57679d[_0xd6c2('0x31')]['sort']);_0x4fb2e6['where']=qs['filters'](_[_0xd6c2('0x3b')](_0x57679d['query'],_0x324015[_0xd6c2('0x32')]));if(_0x57679d[_0xd6c2('0x31')][_0xd6c2('0x3d')]){_0x4fb2e6['where']=_['merge'](_0x4fb2e6['where'],{'$or':_['map'](_0x4fb2e6[_0xd6c2('0x34')],function(_0x274e10){var _0xde458f={};_0xde458f[_0x274e10]={'$like':'%'+_0x57679d['query'][_0xd6c2('0x3d')]+'%'};return _0xde458f;})});}_0x4fb2e6=_[_0xd6c2('0x3c')]({},_0x4fb2e6,_0x57679d[_0xd6c2('0x3e')]);return _0x1ef19a[_0xd6c2('0x5f')](_0x4fb2e6);}})['then'](function(_0x5a9f54){if(_0x5a9f54){_0x29f81f=_0x5a9f54[_0xd6c2('0x36')];if(!_0x57679d[_0xd6c2('0x31')][_0xd6c2('0x37')]('nolimit')){_0x4fb2e6[_0xd6c2('0x1b')]=qs[_0xd6c2('0x1b')](_0x57679d['query'][_0xd6c2('0x1b')]);_0x4fb2e6['offset']=qs[_0xd6c2('0x18')](_0x57679d[_0xd6c2('0x31')][_0xd6c2('0x18')]);}return _0x1ef19a[_0xd6c2('0x5f')](_0x4fb2e6);}})[_0xd6c2('0x22')](function(_0x1ed127){if(_0x1ed127){return _0x1ed127?{'count':_0x29f81f,'rows':_0x1ed127}:null;}})[_0xd6c2('0x22')](respondWithResult(_0x60a4aa,null))['catch'](handleError(_0x60a4aa,null));};exports[_0xd6c2('0x61')]=function(_0x3a283e,_0x1bae9d,_0x467307){var _0x54a333,_0x52dae8;return db['Campaign'][_0xd6c2('0x4b')]({'where':{'id':_0x3a283e[_0xd6c2('0x42')]['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x1bae9d,null))[_0xd6c2('0x22')](function(_0x2c9f7f){if(_0x2c9f7f){_0x52dae8=_0x2c9f7f;return _0x2c9f7f[_0xd6c2('0x61')](_0x3a283e[_0xd6c2('0x52')]['ids'],_[_0xd6c2('0x4f')](_0x3a283e[_0xd6c2('0x52')],[_0xd6c2('0x62'),'id'])||{});}return null;})[_0xd6c2('0x63')](function(_0x3547f6){var _0x17a0f3;_0x54a333=_0x3547f6||[];var _0x254c03=[];if(_0x3547f6){for(var _0x5edb41=0x0;_0x5edb41<_0x3547f6[_0xd6c2('0x36')];_0x5edb41+=0x1){var _0x28542d=_0x3547f6[_0x5edb41]['get']({'plain':!![]});_0x52dae8['dialCheckDuplicateType']=_0x3a283e[_0xd6c2('0x52')][_0xd6c2('0x64')]?_0x3a283e[_0xd6c2('0x52')]['dialCheckDuplicateType']:_0x52dae8[_0xd6c2('0x64')];switch(_0x52dae8[_0xd6c2('0x64')]){case _0xd6c2('0x65'):_0x17a0f3=squel[_0xd6c2('0x66')]()[_0xd6c2('0x67')](_0xd6c2('0x68'))[_0xd6c2('0x69')]([_0xd6c2('0x6a'),_0xd6c2('0x6b'),'ContactId','ListId',_0xd6c2('0x5e'),_0xd6c2('0x50'),_0xd6c2('0x51')],squel['select']()[_0xd6c2('0x6c')](_0xd6c2('0x6a'),_0xd6c2('0x6a'))['field'](_0xd6c2('0x6d'),_0xd6c2('0x6b'))[_0xd6c2('0x6c')]('id',_0xd6c2('0x6e'))['field'](_0x28542d['CmListId'][_0xd6c2('0x6f')](),_0xd6c2('0x70'))[_0xd6c2('0x6c')](_0x3a283e[_0xd6c2('0x42')]['id'][_0xd6c2('0x6f')](),_0xd6c2('0x5e'))['field'](_0xd6c2('0x6d'),_0xd6c2('0x50'))['field']('NOW()',_0xd6c2('0x51'))[_0xd6c2('0x71')]('cm_contacts')[_0xd6c2('0x3a')](_0xd6c2('0x72'))[_0xd6c2('0x3a')](_0xd6c2('0x73'),_0x28542d['CmListId'][_0xd6c2('0x6f')]())[_0xd6c2('0x3a')](_0xd6c2('0x74'))[_0xd6c2('0x3a')](_0xd6c2('0x75'),squel[_0xd6c2('0x76')]()[_0xd6c2('0x6c')](_0xd6c2('0x77'))['from'](_0xd6c2('0x78'))['where'](_0xd6c2('0x79'),_0x3a283e[_0xd6c2('0x42')]['id'][_0xd6c2('0x6f')]()))[_0xd6c2('0x3a')](_0xd6c2('0x75'),squel[_0xd6c2('0x76')]()['field'](_0xd6c2('0x7a'))[_0xd6c2('0x71')]('cm_hopper')[_0xd6c2('0x3a')]('CampaignId\x20=\x20?',_0x3a283e[_0xd6c2('0x42')]['id'][_0xd6c2('0x6f')]())))[_0xd6c2('0x6f')]();break;case _0xd6c2('0x7b'):_0x17a0f3=squel['insert']()[_0xd6c2('0x67')](_0xd6c2('0x68'))['fromQuery']([_0xd6c2('0x6a'),_0xd6c2('0x6b'),'ContactId',_0xd6c2('0x70'),_0xd6c2('0x5e'),_0xd6c2('0x50'),_0xd6c2('0x51')],squel['select']()[_0xd6c2('0x6c')](_0xd6c2('0x6a'),_0xd6c2('0x6a'))[_0xd6c2('0x6c')]('NOW()',_0xd6c2('0x6b'))[_0xd6c2('0x6c')]('id','ContactId')[_0xd6c2('0x6c')](_0x28542d[_0xd6c2('0x7c')][_0xd6c2('0x6f')](),_0xd6c2('0x70'))[_0xd6c2('0x6c')](_0x3a283e['params']['id'][_0xd6c2('0x6f')](),_0xd6c2('0x5e'))[_0xd6c2('0x6c')](_0xd6c2('0x6d'),_0xd6c2('0x50'))[_0xd6c2('0x6c')](_0xd6c2('0x6d'),_0xd6c2('0x51'))[_0xd6c2('0x71')]('cm_contacts')[_0xd6c2('0x3a')](_0xd6c2('0x72'))[_0xd6c2('0x3a')](_0xd6c2('0x73'),_0x28542d['CmListId'][_0xd6c2('0x6f')]())[_0xd6c2('0x3a')](_0xd6c2('0x74'))[_0xd6c2('0x3a')](_0xd6c2('0x75'),squel[_0xd6c2('0x76')]()['field'](_0xd6c2('0x7a'))[_0xd6c2('0x71')](_0xd6c2('0x68'))['where'](_0xd6c2('0x79'),_0x3a283e['params']['id'][_0xd6c2('0x6f')]())))[_0xd6c2('0x6f')]();break;default:_0x17a0f3=squel[_0xd6c2('0x66')]()[_0xd6c2('0x67')](_0xd6c2('0x68'))['fromQuery'](['phone',_0xd6c2('0x6b'),_0xd6c2('0x6e'),'ListId',_0xd6c2('0x5e'),_0xd6c2('0x50'),_0xd6c2('0x51')],squel[_0xd6c2('0x76')]()['field'](_0xd6c2('0x6a'),_0xd6c2('0x6a'))[_0xd6c2('0x6c')](_0xd6c2('0x6d'),_0xd6c2('0x6b'))[_0xd6c2('0x6c')]('id','ContactId')[_0xd6c2('0x6c')](_0x28542d['CmListId']['toString'](),'ListId')[_0xd6c2('0x6c')](_0x3a283e[_0xd6c2('0x42')]['id'][_0xd6c2('0x6f')](),_0xd6c2('0x5e'))['field']('NOW()',_0xd6c2('0x50'))['field']('NOW()',_0xd6c2('0x51'))[_0xd6c2('0x71')](_0xd6c2('0x7d'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x28542d[_0xd6c2('0x7c')][_0xd6c2('0x6f')]())['where'](_0xd6c2('0x74')))['toString']();}_0x254c03['push'](db['sequelize'][_0xd6c2('0x31')](_0x17a0f3));}return BPromise[_0xd6c2('0x7e')](_0x254c03);}})[_0xd6c2('0x22')](function(){return _0x54a333;})['then'](respondWithResult(_0x1bae9d,null))[_0xd6c2('0x45')](handleError(_0x1bae9d,null));};exports['removeLists']=function(_0x2c7dbf,_0x1773a0,_0x1f6353){return db[_0xd6c2('0x2b')][_0xd6c2('0x4b')]({'where':{'id':_0x2c7dbf[_0xd6c2('0x42')]['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x1773a0,null))[_0xd6c2('0x22')](function(_0x38dab4){if(_0x38dab4){return _0x38dab4[_0xd6c2('0x7f')](_0x2c7dbf['query'][_0xd6c2('0x62')]);}})[_0xd6c2('0x22')](function(_0x1c54a2){if(_0x1c54a2){return db['CmHopper'][_0xd6c2('0x23')]({'where':{'ListId':_0x2c7dbf[_0xd6c2('0x31')][_0xd6c2('0x62')],'CampaignId':_0x2c7dbf['params']['id']}})[_0xd6c2('0x22')](function(){return _0x1c54a2;});}})[_0xd6c2('0x22')](respondWithStatusCode(_0x1773a0,null))[_0xd6c2('0x45')](handleError(_0x1773a0,null));};exports[_0xd6c2('0x80')]=function(_0x1e6fb3,_0x74c7fa,_0x372329){var _0xdfad1a={};var _0xe5a378={};var _0x358126;var _0x4071e2;return db[_0xd6c2('0x2b')][_0xd6c2('0x58')]({'where':{'id':_0x1e6fb3['params']['id']}})['then'](handleEntityNotFound(_0x74c7fa,null))[_0xd6c2('0x22')](function(_0x468e32){if(_0x468e32){_0x358126=_0x468e32;_0xe5a378[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db[_0xd6c2('0x60')]['rawAttributes']);_0xe5a378['query']=_['keys'](_0x1e6fb3['query']);_0xe5a378[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0xe5a378[_0xd6c2('0x30')],_0xe5a378[_0xd6c2('0x31')]);_0xdfad1a[_0xd6c2('0x34')]=_[_0xd6c2('0x33')](_0xe5a378['model'],qs[_0xd6c2('0x35')](_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x35')]));_0xdfad1a[_0xd6c2('0x34')]=_0xdfad1a[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0xdfad1a[_0xd6c2('0x34')]:_0xe5a378[_0xd6c2('0x30')];_0xdfad1a[_0xd6c2('0x38')]=qs[_0xd6c2('0x39')](_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x39')]);_0xdfad1a['where']=qs[_0xd6c2('0x32')](_[_0xd6c2('0x3b')](_0x1e6fb3[_0xd6c2('0x31')],_0xe5a378[_0xd6c2('0x32')]));if(_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x3d')]){_0xdfad1a[_0xd6c2('0x3a')]=_['merge'](_0xdfad1a[_0xd6c2('0x3a')],{'$or':_['map'](_0xdfad1a['attributes'],function(_0x43f014){var _0x161bbc={};_0x161bbc[_0x43f014]={'$like':'%'+_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x3d')]+'%'};return _0x161bbc;})});}_0xdfad1a=_[_0xd6c2('0x3c')]({},_0xdfad1a,_0x1e6fb3['options']);return _0x358126['getBlackLists'](_0xdfad1a);}})[_0xd6c2('0x22')](function(_0x559593){if(_0x559593){_0x4071e2=_0x559593[_0xd6c2('0x36')];if(!_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x37')](_0xd6c2('0x57'))){_0xdfad1a['limit']=qs['limit'](_0x1e6fb3['query'][_0xd6c2('0x1b')]);_0xdfad1a[_0xd6c2('0x18')]=qs[_0xd6c2('0x18')](_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x18')]);}return _0x358126[_0xd6c2('0x80')](_0xdfad1a);}})['then'](function(_0x1e66e8){if(_0x1e66e8){return _0x1e66e8?{'count':_0x4071e2,'rows':_0x1e66e8}:null;}})[_0xd6c2('0x22')](respondWithResult(_0x74c7fa,null))[_0xd6c2('0x45')](handleError(_0x74c7fa,null));};exports[_0xd6c2('0x81')]=function(_0x450cba,_0x1b1fb0,_0x2ae00d){var _0x61c29a,_0xfa7f7b;return db[_0xd6c2('0x2b')][_0xd6c2('0x4b')]({'where':{'id':_0x450cba['params']['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x1b1fb0,null))['then'](function(_0x55584f){if(_0x55584f){_0xfa7f7b=_0x55584f;return _0x55584f['addBlackLists'](_0x450cba[_0xd6c2('0x52')][_0xd6c2('0x62')],_['omit'](_0x450cba[_0xd6c2('0x52')],[_0xd6c2('0x62'),'id'])||{});}return null;})['spread'](function(_0x2dd279){var _0x5dbc6b;_0x61c29a=_0x2dd279||[];var _0x3e8a92=[];if(_0x2dd279){for(var _0xe4f509=0x0;_0xe4f509<_0x2dd279[_0xd6c2('0x36')];_0xe4f509+=0x1){var _0x10e823=_0x2dd279[_0xe4f509][_0xd6c2('0x48')]({'plain':!![]});_0x5dbc6b=squel['insert']()['into'](_0xd6c2('0x82'))[_0xd6c2('0x69')](['phone','ContactId','ListId',_0xd6c2('0x5e'),_0xd6c2('0x50'),_0xd6c2('0x51')],squel[_0xd6c2('0x76')]()['field']('phone',_0xd6c2('0x6a'))['field']('id',_0xd6c2('0x6e'))[_0xd6c2('0x6c')](_0x10e823[_0xd6c2('0x7c')][_0xd6c2('0x6f')](),_0xd6c2('0x70'))[_0xd6c2('0x6c')](_0x450cba[_0xd6c2('0x42')]['id']['toString'](),'CampaignId')[_0xd6c2('0x6c')]('NOW()',_0xd6c2('0x50'))[_0xd6c2('0x6c')]('NOW()',_0xd6c2('0x51'))['from']('cm_contacts')[_0xd6c2('0x3a')]('deletedAt\x20IS\x20NULL')[_0xd6c2('0x3a')]('ListId\x20=\x20?',_0x10e823[_0xd6c2('0x7c')][_0xd6c2('0x6f')]())[_0xd6c2('0x3a')](_0xd6c2('0x74')))[_0xd6c2('0x6f')]();_0x3e8a92[_0xd6c2('0x83')](db[_0xd6c2('0x84')][_0xd6c2('0x31')](_0x5dbc6b));}return BPromise[_0xd6c2('0x7e')](_0x3e8a92);}})['then'](function(){return _0x61c29a;})[_0xd6c2('0x22')](respondWithResult(_0x1b1fb0,null))[_0xd6c2('0x45')](handleError(_0x1b1fb0,null));};exports['removeBlackLists']=function(_0x46bff4,_0x305cbb,_0x52376b){return db[_0xd6c2('0x2b')][_0xd6c2('0x4b')]({'where':{'id':_0x46bff4[_0xd6c2('0x42')]['id']}})['then'](handleEntityNotFound(_0x305cbb,null))[_0xd6c2('0x22')](function(_0xe537e0){if(_0xe537e0){return _0xe537e0[_0xd6c2('0x85')](_0x46bff4[_0xd6c2('0x31')][_0xd6c2('0x62')]);}})['then'](function(_0x743c77){if(_0x743c77){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x46bff4['query'][_0xd6c2('0x62')],'CampaignId':_0x46bff4[_0xd6c2('0x42')]['id']}})[_0xd6c2('0x22')](function(){return _0x743c77;});}})[_0xd6c2('0x22')](respondWithStatusCode(_0x305cbb,null))[_0xd6c2('0x45')](handleError(_0x305cbb,null));}; \ No newline at end of file +var _0x66a4=['map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','UserProfileResource','clone','omit','createdAt','updatedAt','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','into','cm_hopper_black','sequelize','removeBlackLists','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','end','error','stack','name','index'];(function(_0x4ce0fa,_0x42443b){var _0x1a2457=function(_0x4b19ee){while(--_0x4b19ee){_0x4ce0fa['push'](_0x4ce0fa['shift']());}};_0x1a2457(++_0x42443b);}(_0x66a4,0x161));var _0x466a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x66a4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x466a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x466a('0x1'));var BPromise=require(_0x466a('0x2'));var Mustache=require(_0x466a('0x3'));var util=require(_0x466a('0x4'));var path=require(_0x466a('0x5'));var sox=require(_0x466a('0x6'));var csv=require(_0x466a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x466a('0x8'));var squel=require('squel');var crypto=require(_0x466a('0x9'));var jsforce=require(_0x466a('0xa'));var deskjs=require(_0x466a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x466a('0xc'));var Papa=require(_0x466a('0xd'));var Redis=require(_0x466a('0xe'));var authService=require(_0x466a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x466a('0x10'));var logger=require(_0x466a('0x11'))('api');var utils=require(_0x466a('0x12'));var config=require(_0x466a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x466a('0x14'))['db'];function respondWithStatusCode(_0x47d3e9,_0x51b051){_0x51b051=_0x51b051||0xcc;return function(_0x119506){if(_0x119506){return _0x47d3e9[_0x466a('0x15')](_0x51b051);}return _0x47d3e9[_0x466a('0x16')](_0x51b051)['end']();};}function respondWithResult(_0x1069b9,_0x4635c3){_0x4635c3=_0x4635c3||0xc8;return function(_0xe3701){if(_0xe3701){return _0x1069b9[_0x466a('0x16')](_0x4635c3)[_0x466a('0x17')](_0xe3701);}};}function respondWithFilteredResult(_0x460c47,_0x42eea8){return function(_0x50e9fd){if(_0x50e9fd){var _0x3d6528=typeof _0x42eea8[_0x466a('0x18')]===_0x466a('0x19')&&typeof _0x42eea8[_0x466a('0x1a')]===_0x466a('0x19');var _0x43bacd=_0x50e9fd[_0x466a('0x1b')];var _0xa71cb7=_0x3d6528?0x0:_0x42eea8['offset'];var _0x197021=_0x3d6528?_0x50e9fd[_0x466a('0x1b')]:_0x42eea8[_0x466a('0x18')]+_0x42eea8[_0x466a('0x1a')];var _0x33910b;if(_0x197021>=_0x43bacd){_0x197021=_0x43bacd;_0x33910b=0xc8;}else{_0x33910b=0xce;}_0x460c47[_0x466a('0x16')](_0x33910b);return _0x460c47[_0x466a('0x1c')](_0x466a('0x1d'),_0xa71cb7+'-'+_0x197021+'/'+_0x43bacd)[_0x466a('0x17')](_0x50e9fd);}return null;};}function patchUpdates(_0x34ccf9){return function(_0x40b27f){try{jsonpatch['apply'](_0x40b27f,_0x34ccf9,!![]);}catch(_0x216d83){return BPromise['reject'](_0x216d83);}return _0x40b27f[_0x466a('0x1e')]();};}function saveUpdates(_0x51289f,_0x1dc4a4){return function(_0x417939){if(_0x417939){return _0x417939[_0x466a('0x1f')](_0x51289f)[_0x466a('0x20')](function(_0x480e27){return _0x480e27;});}return null;};}function removeEntity(_0x38d151,_0x1c471d){return function(_0x3d8df5){if(_0x3d8df5){return _0x3d8df5[_0x466a('0x21')]()[_0x466a('0x20')](function(){var _0x41ced6=_0x3d8df5[_0x466a('0x22')]({'plain':!![]});var _0x8c582b='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x8c582b,'resourceId':_0x41ced6['id']}})[_0x466a('0x20')](function(){return _0x3d8df5;});})[_0x466a('0x20')](function(){_0x38d151[_0x466a('0x16')](0xcc)[_0x466a('0x23')]();});}};}function handleEntityNotFound(_0x51cac7,_0x4964fa){return function(_0x174e6c){if(!_0x174e6c){_0x51cac7[_0x466a('0x15')](0x194);}return _0x174e6c;};}function handleError(_0x320cba,_0x50a2a4){_0x50a2a4=_0x50a2a4||0x1f4;return function(_0xe1cdbe){logger[_0x466a('0x24')](_0xe1cdbe[_0x466a('0x25')]);if(_0xe1cdbe['name']){delete _0xe1cdbe[_0x466a('0x26')];}_0x320cba[_0x466a('0x16')](_0x50a2a4)['send'](_0xe1cdbe);};}exports[_0x466a('0x27')]=function(_0x2b675a,_0x581dcc){var _0x15a9f8={},_0x5edc76={},_0x4a9f83={'count':0x0,'rows':[]};var _0x5e754b=_[_0x466a('0x28')](db[_0x466a('0x29')][_0x466a('0x2a')],function(_0x4788d9){return{'name':_0x4788d9[_0x466a('0x2b')],'type':_0x4788d9['type'][_0x466a('0x2c')]};});_0x5edc76[_0x466a('0x2d')]=_[_0x466a('0x28')](_0x5e754b,'name');_0x5edc76[_0x466a('0x2e')]=_['keys'](_0x2b675a['query']);_0x5edc76[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x5edc76[_0x466a('0x2d')],_0x5edc76[_0x466a('0x2e')]);_0x15a9f8['attributes']=_[_0x466a('0x30')](_0x5edc76[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x2b675a['query'][_0x466a('0x31')]));_0x15a9f8[_0x466a('0x32')]=_0x15a9f8[_0x466a('0x32')][_0x466a('0x33')]?_0x15a9f8['attributes']:_0x5edc76['model'];if(!_0x2b675a[_0x466a('0x2e')][_0x466a('0x34')](_0x466a('0x35'))){_0x15a9f8[_0x466a('0x1a')]=qs['limit'](_0x2b675a[_0x466a('0x2e')]['limit']);_0x15a9f8[_0x466a('0x18')]=qs[_0x466a('0x18')](_0x2b675a[_0x466a('0x2e')][_0x466a('0x18')]);}_0x15a9f8[_0x466a('0x36')]=qs[_0x466a('0x37')](_0x2b675a[_0x466a('0x2e')]['sort']);_0x15a9f8['where']=qs['filters'](_['pick'](_0x2b675a[_0x466a('0x2e')],_0x5edc76[_0x466a('0x2f')]),_0x5e754b);if(_0x2b675a['query']['filter']){_0x15a9f8[_0x466a('0x38')]=_[_0x466a('0x39')](_0x15a9f8[_0x466a('0x38')],{'$or':_[_0x466a('0x28')](_0x5e754b,function(_0x4753f8){if(_0x4753f8[_0x466a('0x3a')]!==_0x466a('0x3b')){var _0x2570f2={};_0x2570f2[_0x4753f8['name']]={'$like':'%'+_0x2b675a[_0x466a('0x2e')][_0x466a('0x3c')]+'%'};return _0x2570f2;}})});}_0x15a9f8=_[_0x466a('0x39')]({},_0x15a9f8,_0x2b675a[_0x466a('0x3d')]);var _0x41a272={'where':_0x15a9f8['where']};return db[_0x466a('0x29')][_0x466a('0x1b')](_0x41a272)['then'](function(_0x424b12){_0x4a9f83[_0x466a('0x1b')]=_0x424b12;if(_0x2b675a['query'][_0x466a('0x3e')]){_0x15a9f8[_0x466a('0x3f')]=[{'all':!![]}];}return db[_0x466a('0x29')][_0x466a('0x40')](_0x15a9f8);})['then'](function(_0x29e1a3){_0x4a9f83[_0x466a('0x41')]=_0x29e1a3;return _0x4a9f83;})[_0x466a('0x20')](respondWithFilteredResult(_0x581dcc,_0x15a9f8))[_0x466a('0x42')](handleError(_0x581dcc,null));};exports[_0x466a('0x43')]=function(_0x4c1ee5,_0xb2809d){var _0x495c12={'raw':![],'where':{'id':_0x4c1ee5[_0x466a('0x44')]['id']}},_0x5ba6a7={};_0x5ba6a7[_0x466a('0x2d')]=_['keys'](db[_0x466a('0x29')][_0x466a('0x2a')]);_0x5ba6a7[_0x466a('0x2e')]=_[_0x466a('0x45')](_0x4c1ee5[_0x466a('0x2e')]);_0x5ba6a7['filters']=_[_0x466a('0x30')](_0x5ba6a7[_0x466a('0x2d')],_0x5ba6a7[_0x466a('0x2e')]);_0x495c12[_0x466a('0x32')]=_[_0x466a('0x30')](_0x5ba6a7[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x4c1ee5['query'][_0x466a('0x31')]));_0x495c12[_0x466a('0x32')]=_0x495c12[_0x466a('0x32')]['length']?_0x495c12[_0x466a('0x32')]:_0x5ba6a7[_0x466a('0x2d')];if(_0x4c1ee5[_0x466a('0x2e')]['includeAll']){_0x495c12[_0x466a('0x3f')]=[{'all':!![]}];}_0x495c12=_[_0x466a('0x39')]({},_0x495c12,_0x4c1ee5[_0x466a('0x3d')]);return db[_0x466a('0x29')][_0x466a('0x46')](_0x495c12)[_0x466a('0x20')](handleEntityNotFound(_0xb2809d,null))[_0x466a('0x20')](respondWithResult(_0xb2809d,null))[_0x466a('0x42')](handleError(_0xb2809d,null));};exports[_0x466a('0x47')]=function(_0x627b93,_0xd473d2){return db[_0x466a('0x29')][_0x466a('0x47')](_0x627b93[_0x466a('0x48')],{})[_0x466a('0x20')](function(_0x4aa6cd){var _0x7abe2=_0x627b93['user']['get']({'plain':!![]});if(!_0x7abe2)throw new Error(_0x466a('0x49'));if(_0x7abe2[_0x466a('0x4a')]==='user'){var _0x56ee30=_0x4aa6cd[_0x466a('0x22')]({'plain':!![]});var _0x5f141d=_0x466a('0x4b');return db[_0x466a('0x4c')]['find']({'where':{'name':_0x5f141d,'userProfileId':_0x7abe2[_0x466a('0x4d')]},'raw':!![]})[_0x466a('0x20')](function(_0x1c8083){if(_0x1c8083&&_0x1c8083['autoAssociation']===0x0){return db[_0x466a('0x4e')][_0x466a('0x47')]({'name':_0x56ee30[_0x466a('0x26')],'resourceId':_0x56ee30['id'],'type':_0x1c8083['name'],'sectionId':_0x1c8083['id']},{})[_0x466a('0x20')](function(){return _0x4aa6cd;});}else{return _0x4aa6cd;}})[_0x466a('0x42')](function(_0x2cbbb4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cbbb4);throw _0x2cbbb4;});}return _0x4aa6cd;})[_0x466a('0x20')](respondWithResult(_0xd473d2,0xc9))[_0x466a('0x42')](handleError(_0xd473d2,null));};exports[_0x466a('0x4f')]=function(_0x396164,_0x3e3ff1){var _0x402fdb={'where':{'id':_0x396164[_0x466a('0x44')]['id']}},_0xfe14d5={};_0xfe14d5[_0x466a('0x2d')]=_[_0x466a('0x45')](db['Campaign'][_0x466a('0x2a')]);_0x402fdb['attributes']=_['intersection'](_0xfe14d5[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x396164[_0x466a('0x2e')][_0x466a('0x31')]));_0x402fdb[_0x466a('0x32')]=_0x402fdb['attributes'][_0x466a('0x33')]?_0x402fdb[_0x466a('0x32')]:_0xfe14d5[_0x466a('0x2d')];if(_0x396164[_0x466a('0x2e')][_0x466a('0x3e')]){_0x402fdb[_0x466a('0x3f')]=[{'all':!![]}];}_0x402fdb=_[_0x466a('0x39')]({},_0x402fdb,_0x396164[_0x466a('0x3d')]);return db[_0x466a('0x29')][_0x466a('0x46')](_0x402fdb)[_0x466a('0x20')](handleEntityNotFound(_0x3e3ff1,null))[_0x466a('0x20')](function(_0x17e875){if(_0x17e875){var _0x24afdd=_0x17e875['get']({'plain':!![]});_0x24afdd=qs[_0x466a('0x50')](_0x24afdd,['id',_0x466a('0x51'),'updatedAt']);_0x396164['body']=_['omit'](_0x396164[_0x466a('0x48')],['id',_0x466a('0x51'),_0x466a('0x52')]);return db[_0x466a('0x29')][_0x466a('0x47')](_[_0x466a('0x39')](_0x24afdd,_0x396164['body']),{'include':_0x396164[_0x466a('0x2e')][_0x466a('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x3046a3){var _0x41cc6c=_0x396164['user']['get']({'plain':!![]});if(!_0x41cc6c)throw new Error(_0x466a('0x49'));if(_0x41cc6c['role']===_0x466a('0x53')){var _0xd02bca=_0x3046a3[_0x466a('0x22')]({'plain':!![]});var _0x23549f=_0x466a('0x4b');return db[_0x466a('0x4c')][_0x466a('0x46')]({'where':{'name':_0x23549f,'userProfileId':_0x41cc6c[_0x466a('0x4d')]},'raw':!![]})['then'](function(_0x37d4d7){if(_0x37d4d7&&_0x37d4d7[_0x466a('0x54')]===0x0){return db[_0x466a('0x4e')][_0x466a('0x47')]({'name':_0xd02bca[_0x466a('0x26')],'resourceId':_0xd02bca['id'],'type':_0x37d4d7[_0x466a('0x26')],'sectionId':_0x37d4d7['id']},{})[_0x466a('0x20')](function(){return _0x3046a3;});}else{return _0x3046a3;}})[_0x466a('0x42')](function(_0x1b22b2){logger[_0x466a('0x24')](_0x466a('0x55'),_0x1b22b2);throw _0x1b22b2;});}return _0x3046a3;});}})['then'](respondWithResult(_0x3e3ff1,0xc9))[_0x466a('0x42')](handleError(_0x3e3ff1,null));};exports['update']=function(_0x5927b4,_0x1e86cb){if(_0x5927b4[_0x466a('0x48')]['id']){delete _0x5927b4['body']['id'];}return db[_0x466a('0x29')][_0x466a('0x46')]({'where':{'id':_0x5927b4[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x1e86cb,null))[_0x466a('0x20')](saveUpdates(_0x5927b4['body'],null))[_0x466a('0x20')](respondWithResult(_0x1e86cb,null))[_0x466a('0x42')](handleError(_0x1e86cb,null));};exports[_0x466a('0x21')]=function(_0x244b3f,_0x5d98a1){return db['Campaign']['find']({'where':{'id':_0x244b3f['params']['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x5d98a1,null))[_0x466a('0x20')](removeEntity(_0x5d98a1,null))[_0x466a('0x42')](handleError(_0x5d98a1,null));};exports[_0x466a('0x56')]=function(_0x25a0a2,_0x2edf30,_0x428df3){var _0x2a2961={'raw':!![],'where':{}};var _0x1e82bd={};var _0x13bb13={'count':0x0,'rows':[]};return db[_0x466a('0x29')][_0x466a('0x57')]({'where':{'id':_0x25a0a2[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x2edf30,null))[_0x466a('0x20')](function(_0x552ab8){if(_0x552ab8){_0x1e82bd[_0x466a('0x2d')]=_['keys'](db[_0x466a('0x58')]['rawAttributes']);_0x1e82bd['query']=_['keys'](_0x25a0a2['query']);_0x1e82bd[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x1e82bd[_0x466a('0x2d')],_0x1e82bd[_0x466a('0x2e')]);_0x2a2961[_0x466a('0x32')]=_['intersection'](_0x1e82bd['model'],qs['fields'](_0x25a0a2[_0x466a('0x2e')][_0x466a('0x31')]));_0x2a2961[_0x466a('0x32')]=_0x2a2961[_0x466a('0x32')][_0x466a('0x33')]?_0x2a2961[_0x466a('0x32')]:_0x1e82bd['model'];if(!_0x25a0a2[_0x466a('0x2e')][_0x466a('0x34')]('nolimit')){_0x2a2961[_0x466a('0x1a')]=qs[_0x466a('0x1a')](_0x25a0a2['query'][_0x466a('0x1a')]);_0x2a2961[_0x466a('0x18')]=qs['offset'](_0x25a0a2[_0x466a('0x2e')][_0x466a('0x18')]);}_0x2a2961[_0x466a('0x36')]=qs['sort'](_0x25a0a2['query'][_0x466a('0x37')]);_0x2a2961[_0x466a('0x38')]=qs[_0x466a('0x2f')](_[_0x466a('0x59')](_0x25a0a2[_0x466a('0x2e')],_0x1e82bd[_0x466a('0x2f')]));_0x2a2961[_0x466a('0x38')][_0x466a('0x5a')]=_0x552ab8['id'];if(_0x25a0a2['query'][_0x466a('0x3c')]){_0x2a2961[_0x466a('0x38')]=_['merge'](_0x2a2961['where'],{'$or':_['map'](_0x2a2961[_0x466a('0x32')],function(_0x2dbc14){var _0x4c74e5={};_0x4c74e5[_0x2dbc14]={'$like':'%'+_0x25a0a2[_0x466a('0x2e')][_0x466a('0x3c')]+'%'};return _0x4c74e5;})});}_0x2a2961=_[_0x466a('0x39')]({},_0x2a2961,_0x25a0a2[_0x466a('0x3d')]);return db[_0x466a('0x58')]['count']({'where':_0x2a2961[_0x466a('0x38')]})[_0x466a('0x20')](function(_0x5b676c){_0x13bb13[_0x466a('0x1b')]=_0x5b676c;if(_0x25a0a2[_0x466a('0x2e')]['includeAll']){_0x2a2961['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x2a2961);})['then'](function(_0x4d81a0){_0x13bb13[_0x466a('0x41')]=_0x4d81a0;return _0x13bb13;});}})[_0x466a('0x20')](respondWithFilteredResult(_0x2edf30,_0x2a2961))[_0x466a('0x42')](handleError(_0x2edf30,null));};exports[_0x466a('0x5b')]=function(_0x3e2b3c,_0x227295,_0x41e2bc){var _0x2716da={'raw':!![],'where':{}};var _0x25e2c5={};var _0x50cda8={'count':0x0,'rows':[]};return db[_0x466a('0x29')][_0x466a('0x57')]({'where':{'id':_0x3e2b3c[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x227295,null))[_0x466a('0x20')](function(_0x20aa66){if(_0x20aa66){_0x25e2c5[_0x466a('0x2d')]=_[_0x466a('0x45')](db[_0x466a('0x5c')][_0x466a('0x2a')]);_0x25e2c5[_0x466a('0x2e')]=_[_0x466a('0x45')](_0x3e2b3c[_0x466a('0x2e')]);_0x25e2c5[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x25e2c5['model'],_0x25e2c5[_0x466a('0x2e')]);_0x2716da['attributes']=_[_0x466a('0x30')](_0x25e2c5[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x3e2b3c['query'][_0x466a('0x31')]));_0x2716da[_0x466a('0x32')]=_0x2716da[_0x466a('0x32')][_0x466a('0x33')]?_0x2716da[_0x466a('0x32')]:_0x25e2c5[_0x466a('0x2d')];if(!_0x3e2b3c['query'][_0x466a('0x34')](_0x466a('0x35'))){_0x2716da[_0x466a('0x1a')]=qs['limit'](_0x3e2b3c[_0x466a('0x2e')][_0x466a('0x1a')]);_0x2716da[_0x466a('0x18')]=qs[_0x466a('0x18')](_0x3e2b3c['query']['offset']);}_0x2716da[_0x466a('0x36')]=qs[_0x466a('0x37')](_0x3e2b3c['query'][_0x466a('0x37')]);_0x2716da['where']=qs[_0x466a('0x2f')](_[_0x466a('0x59')](_0x3e2b3c['query'],_0x25e2c5[_0x466a('0x2f')]));_0x2716da[_0x466a('0x38')]['CampaignId']=_0x20aa66['id'];if(_0x3e2b3c['query'][_0x466a('0x3c')]){_0x2716da[_0x466a('0x38')]=_[_0x466a('0x39')](_0x2716da['where'],{'$or':_[_0x466a('0x28')](_0x2716da[_0x466a('0x32')],function(_0x320028){var _0x5a2399={};_0x5a2399[_0x320028]={'$like':'%'+_0x3e2b3c['query'][_0x466a('0x3c')]+'%'};return _0x5a2399;})});}_0x2716da=_[_0x466a('0x39')]({},_0x2716da,_0x3e2b3c[_0x466a('0x3d')]);return db['CmHopperHistory'][_0x466a('0x1b')]({'where':_0x2716da[_0x466a('0x38')]})[_0x466a('0x20')](function(_0x4e0909){_0x50cda8[_0x466a('0x1b')]=_0x4e0909;if(_0x3e2b3c[_0x466a('0x2e')][_0x466a('0x3e')]){_0x2716da[_0x466a('0x3f')]=[{'all':!![]}];}return db[_0x466a('0x5c')][_0x466a('0x40')](_0x2716da);})['then'](function(_0x5f5845){_0x50cda8['rows']=_0x5f5845;return _0x50cda8;});}})[_0x466a('0x20')](respondWithFilteredResult(_0x227295,_0x2716da))[_0x466a('0x42')](handleError(_0x227295,null));};exports[_0x466a('0x5d')]=function(_0x17658d,_0x4d2974,_0x18e0e6){var _0x15479c={'raw':!![],'where':{}};var _0x5da76a={};var _0x3bf3ae={'count':0x0,'rows':[]};return db[_0x466a('0x29')][_0x466a('0x57')]({'where':{'id':_0x17658d[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x4d2974,null))[_0x466a('0x20')](function(_0x4b22a3){if(_0x4b22a3){_0x5da76a[_0x466a('0x2d')]=_[_0x466a('0x45')](db[_0x466a('0x5e')]['rawAttributes']);_0x5da76a[_0x466a('0x2e')]=_['keys'](_0x17658d['query']);_0x5da76a[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x5da76a['model'],_0x5da76a['query']);_0x15479c[_0x466a('0x32')]=_[_0x466a('0x30')](_0x5da76a[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x17658d[_0x466a('0x2e')][_0x466a('0x31')]));_0x15479c[_0x466a('0x32')]=_0x15479c[_0x466a('0x32')][_0x466a('0x33')]?_0x15479c[_0x466a('0x32')]:_0x5da76a[_0x466a('0x2d')];if(!_0x17658d[_0x466a('0x2e')][_0x466a('0x34')](_0x466a('0x35'))){_0x15479c[_0x466a('0x1a')]=qs[_0x466a('0x1a')](_0x17658d[_0x466a('0x2e')][_0x466a('0x1a')]);_0x15479c[_0x466a('0x18')]=qs[_0x466a('0x18')](_0x17658d[_0x466a('0x2e')][_0x466a('0x18')]);}_0x15479c['order']=qs[_0x466a('0x37')](_0x17658d['query'][_0x466a('0x37')]);_0x15479c[_0x466a('0x38')]=qs[_0x466a('0x2f')](_['pick'](_0x17658d[_0x466a('0x2e')],_0x5da76a['filters']));_0x15479c[_0x466a('0x38')][_0x466a('0x5a')]=_0x4b22a3['id'];if(_0x17658d['query'][_0x466a('0x3c')]){_0x15479c[_0x466a('0x38')]=_[_0x466a('0x39')](_0x15479c[_0x466a('0x38')],{'$or':_[_0x466a('0x28')](_0x15479c[_0x466a('0x32')],function(_0x1176e7){var _0x5cde25={};_0x5cde25[_0x1176e7]={'$like':'%'+_0x17658d[_0x466a('0x2e')]['filter']+'%'};return _0x5cde25;})});}_0x15479c=_[_0x466a('0x39')]({},_0x15479c,_0x17658d['options']);return db[_0x466a('0x5e')][_0x466a('0x1b')]({'where':_0x15479c['where']})[_0x466a('0x20')](function(_0x159200){_0x3bf3ae[_0x466a('0x1b')]=_0x159200;if(_0x17658d[_0x466a('0x2e')][_0x466a('0x3e')]){_0x15479c[_0x466a('0x3f')]=[{'all':!![]}];}return db[_0x466a('0x5e')]['findAll'](_0x15479c);})[_0x466a('0x20')](function(_0xcd6449){_0x3bf3ae[_0x466a('0x41')]=_0xcd6449;return _0x3bf3ae;});}})[_0x466a('0x20')](respondWithFilteredResult(_0x4d2974,_0x15479c))[_0x466a('0x42')](handleError(_0x4d2974,null));};exports['getHopperBlacks']=function(_0x3633d5,_0x7fec4e,_0x217809){var _0x1509f7={'raw':!![],'where':{}};var _0x37b6b3={};var _0x4fdc40={'count':0x0,'rows':[]};return db['Campaign'][_0x466a('0x57')]({'where':{'id':_0x3633d5[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x7fec4e,null))[_0x466a('0x20')](function(_0x6038f7){if(_0x6038f7){_0x37b6b3[_0x466a('0x2d')]=_[_0x466a('0x45')](db[_0x466a('0x5f')][_0x466a('0x2a')]);_0x37b6b3[_0x466a('0x2e')]=_[_0x466a('0x45')](_0x3633d5[_0x466a('0x2e')]);_0x37b6b3[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x37b6b3['model'],_0x37b6b3['query']);_0x1509f7['attributes']=_[_0x466a('0x30')](_0x37b6b3[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x3633d5[_0x466a('0x2e')]['fields']));_0x1509f7['attributes']=_0x1509f7[_0x466a('0x32')][_0x466a('0x33')]?_0x1509f7[_0x466a('0x32')]:_0x37b6b3[_0x466a('0x2d')];if(!_0x3633d5['query']['hasOwnProperty']('nolimit')){_0x1509f7['limit']=qs[_0x466a('0x1a')](_0x3633d5[_0x466a('0x2e')][_0x466a('0x1a')]);_0x1509f7['offset']=qs[_0x466a('0x18')](_0x3633d5[_0x466a('0x2e')]['offset']);}_0x1509f7['order']=qs[_0x466a('0x37')](_0x3633d5[_0x466a('0x2e')]['sort']);_0x1509f7[_0x466a('0x38')]=qs[_0x466a('0x2f')](_[_0x466a('0x59')](_0x3633d5[_0x466a('0x2e')],_0x37b6b3[_0x466a('0x2f')]));_0x1509f7[_0x466a('0x38')][_0x466a('0x5a')]=_0x6038f7['id'];if(_0x3633d5[_0x466a('0x2e')][_0x466a('0x3c')]){_0x1509f7['where']=_[_0x466a('0x39')](_0x1509f7[_0x466a('0x38')],{'$or':_['map'](_0x1509f7[_0x466a('0x32')],function(_0x18eb6a){var _0x21a260={};_0x21a260[_0x18eb6a]={'$like':'%'+_0x3633d5['query'][_0x466a('0x3c')]+'%'};return _0x21a260;})});}_0x1509f7=_['merge']({},_0x1509f7,_0x3633d5[_0x466a('0x3d')]);return db[_0x466a('0x5f')]['count']({'where':_0x1509f7[_0x466a('0x38')]})['then'](function(_0x36defa){_0x4fdc40[_0x466a('0x1b')]=_0x36defa;if(_0x3633d5[_0x466a('0x2e')][_0x466a('0x3e')]){_0x1509f7[_0x466a('0x3f')]=[{'all':!![]}];}return db[_0x466a('0x5f')][_0x466a('0x40')](_0x1509f7);})[_0x466a('0x20')](function(_0x25c65c){_0x4fdc40[_0x466a('0x41')]=_0x25c65c;return _0x4fdc40;});}})[_0x466a('0x20')](respondWithFilteredResult(_0x7fec4e,_0x1509f7))['catch'](handleError(_0x7fec4e,null));};exports[_0x466a('0x60')]=function(_0x47b5aa,_0x125741,_0x590b23){var _0x2403f1={};var _0x3e3ce8={};var _0x19a85b;var _0x1bac1a;return db[_0x466a('0x29')][_0x466a('0x57')]({'where':{'id':_0x47b5aa[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x125741,null))['then'](function(_0x4796dd){if(_0x4796dd){_0x19a85b=_0x4796dd;_0x3e3ce8[_0x466a('0x2d')]=_[_0x466a('0x45')](db['CmList'][_0x466a('0x2a')]);_0x3e3ce8[_0x466a('0x2e')]=_[_0x466a('0x45')](_0x47b5aa[_0x466a('0x2e')]);_0x3e3ce8['filters']=_['intersection'](_0x3e3ce8[_0x466a('0x2d')],_0x3e3ce8['query']);_0x2403f1[_0x466a('0x32')]=_[_0x466a('0x30')](_0x3e3ce8[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x47b5aa[_0x466a('0x2e')][_0x466a('0x31')]));_0x2403f1[_0x466a('0x32')]=_0x2403f1[_0x466a('0x32')][_0x466a('0x33')]?_0x2403f1[_0x466a('0x32')]:_0x3e3ce8[_0x466a('0x2d')];_0x2403f1[_0x466a('0x36')]=qs['sort'](_0x47b5aa['query'][_0x466a('0x37')]);_0x2403f1[_0x466a('0x38')]=qs['filters'](_[_0x466a('0x59')](_0x47b5aa[_0x466a('0x2e')],_0x3e3ce8[_0x466a('0x2f')]));if(_0x47b5aa['query'][_0x466a('0x3c')]){_0x2403f1[_0x466a('0x38')]=_['merge'](_0x2403f1[_0x466a('0x38')],{'$or':_[_0x466a('0x28')](_0x2403f1[_0x466a('0x32')],function(_0x3dfbef){var _0x30d7b2={};_0x30d7b2[_0x3dfbef]={'$like':'%'+_0x47b5aa[_0x466a('0x2e')][_0x466a('0x3c')]+'%'};return _0x30d7b2;})});}_0x2403f1=_[_0x466a('0x39')]({},_0x2403f1,_0x47b5aa[_0x466a('0x3d')]);return _0x19a85b[_0x466a('0x60')](_0x2403f1);}})[_0x466a('0x20')](function(_0x5b02d1){if(_0x5b02d1){_0x1bac1a=_0x5b02d1[_0x466a('0x33')];if(!_0x47b5aa[_0x466a('0x2e')][_0x466a('0x34')](_0x466a('0x35'))){_0x2403f1[_0x466a('0x1a')]=qs[_0x466a('0x1a')](_0x47b5aa['query']['limit']);_0x2403f1['offset']=qs[_0x466a('0x18')](_0x47b5aa[_0x466a('0x2e')][_0x466a('0x18')]);}return _0x19a85b[_0x466a('0x60')](_0x2403f1);}})[_0x466a('0x20')](function(_0x3d0edf){if(_0x3d0edf){return _0x3d0edf?{'count':_0x1bac1a,'rows':_0x3d0edf}:null;}})[_0x466a('0x20')](respondWithResult(_0x125741,null))['catch'](handleError(_0x125741,null));};exports[_0x466a('0x61')]=function(_0x4be424,_0x38bb7e,_0x549ff5){var _0x2636f2,_0x3d794b;return db[_0x466a('0x29')]['find']({'where':{'id':_0x4be424[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x38bb7e,null))[_0x466a('0x20')](function(_0x5248ab){if(_0x5248ab){_0x3d794b=_0x5248ab;return _0x5248ab[_0x466a('0x61')](_0x4be424[_0x466a('0x48')][_0x466a('0x62')],_[_0x466a('0x50')](_0x4be424[_0x466a('0x48')],[_0x466a('0x62'),'id'])||{});}return null;})[_0x466a('0x63')](function(_0x484aae){var _0x287c3b;_0x2636f2=_0x484aae||[];var _0x465528=[];if(_0x484aae){for(var _0x52a09a=0x0;_0x52a09a<_0x484aae[_0x466a('0x33')];_0x52a09a+=0x1){var _0x4f32eb=_0x484aae[_0x52a09a][_0x466a('0x22')]({'plain':!![]});_0x3d794b['dialCheckDuplicateType']=_0x4be424[_0x466a('0x48')][_0x466a('0x64')]?_0x4be424[_0x466a('0x48')][_0x466a('0x64')]:_0x3d794b[_0x466a('0x64')];switch(_0x3d794b['dialCheckDuplicateType']){case'always':_0x287c3b=squel[_0x466a('0x65')]()['into'](_0x466a('0x66'))[_0x466a('0x67')]([_0x466a('0x68'),'scheduledAt',_0x466a('0x69'),_0x466a('0x6a'),_0x466a('0x5a'),_0x466a('0x51'),_0x466a('0x52')],squel[_0x466a('0x6b')]()[_0x466a('0x6c')](_0x466a('0x68'),_0x466a('0x68'))['field'](_0x466a('0x6d'),_0x466a('0x6e'))['field']('id',_0x466a('0x69'))['field'](_0x4f32eb[_0x466a('0x6f')]['toString'](),_0x466a('0x6a'))[_0x466a('0x6c')](_0x4be424[_0x466a('0x44')]['id']['toString'](),'CampaignId')[_0x466a('0x6c')]('NOW()',_0x466a('0x51'))[_0x466a('0x6c')](_0x466a('0x6d'),_0x466a('0x52'))[_0x466a('0x70')](_0x466a('0x71'))[_0x466a('0x38')](_0x466a('0x72'))[_0x466a('0x38')](_0x466a('0x73'),_0x4f32eb[_0x466a('0x6f')][_0x466a('0x74')]())[_0x466a('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x466a('0x38')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x466a('0x6c')](_0x466a('0x75'))['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x4be424[_0x466a('0x44')]['id']['toString']()))['where'](_0x466a('0x76'),squel[_0x466a('0x6b')]()[_0x466a('0x6c')]('COALESCE(phone,\x27\x27)')[_0x466a('0x70')](_0x466a('0x66'))[_0x466a('0x38')]('CampaignId\x20=\x20?',_0x4be424[_0x466a('0x44')]['id'][_0x466a('0x74')]())))[_0x466a('0x74')]();break;case _0x466a('0x77'):_0x287c3b=squel[_0x466a('0x65')]()['into'](_0x466a('0x66'))[_0x466a('0x67')]([_0x466a('0x68'),_0x466a('0x6e'),_0x466a('0x69'),_0x466a('0x6a'),_0x466a('0x5a'),'createdAt',_0x466a('0x52')],squel[_0x466a('0x6b')]()[_0x466a('0x6c')](_0x466a('0x68'),_0x466a('0x68'))[_0x466a('0x6c')](_0x466a('0x6d'),_0x466a('0x6e'))['field']('id','ContactId')[_0x466a('0x6c')](_0x4f32eb[_0x466a('0x6f')][_0x466a('0x74')](),_0x466a('0x6a'))['field'](_0x4be424[_0x466a('0x44')]['id']['toString'](),'CampaignId')['field'](_0x466a('0x6d'),_0x466a('0x51'))[_0x466a('0x6c')](_0x466a('0x6d'),_0x466a('0x52'))[_0x466a('0x70')](_0x466a('0x71'))[_0x466a('0x38')](_0x466a('0x72'))['where'](_0x466a('0x73'),_0x4f32eb['CmListId']['toString']())[_0x466a('0x38')](_0x466a('0x78'))[_0x466a('0x38')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x466a('0x6c')]('COALESCE(phone,\x27\x27)')['from'](_0x466a('0x66'))['where'](_0x466a('0x79'),_0x4be424['params']['id'][_0x466a('0x74')]())))[_0x466a('0x74')]();break;default:_0x287c3b=squel[_0x466a('0x65')]()['into'](_0x466a('0x66'))[_0x466a('0x67')]([_0x466a('0x68'),_0x466a('0x6e'),_0x466a('0x69'),_0x466a('0x6a'),_0x466a('0x5a'),_0x466a('0x51'),_0x466a('0x52')],squel['select']()[_0x466a('0x6c')](_0x466a('0x68'),_0x466a('0x68'))[_0x466a('0x6c')]('NOW()',_0x466a('0x6e'))[_0x466a('0x6c')]('id',_0x466a('0x69'))[_0x466a('0x6c')](_0x4f32eb[_0x466a('0x6f')][_0x466a('0x74')](),_0x466a('0x6a'))[_0x466a('0x6c')](_0x4be424[_0x466a('0x44')]['id'][_0x466a('0x74')](),_0x466a('0x5a'))['field']('NOW()',_0x466a('0x51'))[_0x466a('0x6c')](_0x466a('0x6d'),_0x466a('0x52'))[_0x466a('0x70')]('cm_contacts')[_0x466a('0x38')]('deletedAt\x20IS\x20NULL')[_0x466a('0x38')](_0x466a('0x73'),_0x4f32eb[_0x466a('0x6f')][_0x466a('0x74')]())[_0x466a('0x38')](_0x466a('0x78')))['toString']();}_0x465528[_0x466a('0x7a')](db['sequelize'][_0x466a('0x2e')](_0x287c3b));}return BPromise[_0x466a('0x7b')](_0x465528);}})[_0x466a('0x20')](function(){return _0x2636f2;})[_0x466a('0x20')](respondWithResult(_0x38bb7e,null))[_0x466a('0x42')](handleError(_0x38bb7e,null));};exports[_0x466a('0x7c')]=function(_0x901c82,_0x300971,_0x1140f6){return db[_0x466a('0x29')][_0x466a('0x46')]({'where':{'id':_0x901c82[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x300971,null))[_0x466a('0x20')](function(_0x125d92){if(_0x125d92){return _0x125d92['removeLists'](_0x901c82['query'][_0x466a('0x62')]);}})['then'](function(_0xe751b0){if(_0xe751b0){return db[_0x466a('0x58')]['destroy']({'where':{'ListId':_0x901c82[_0x466a('0x2e')]['ids'],'CampaignId':_0x901c82[_0x466a('0x44')]['id']}})[_0x466a('0x20')](function(){return _0xe751b0;});}})[_0x466a('0x20')](respondWithStatusCode(_0x300971,null))[_0x466a('0x42')](handleError(_0x300971,null));};exports['getBlackLists']=function(_0x491710,_0x3f29f7,_0x39e530){var _0x79ad8a={};var _0x28e937={};var _0x19a973;var _0x3a7fbe;return db['Campaign'][_0x466a('0x57')]({'where':{'id':_0x491710[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x3f29f7,null))[_0x466a('0x20')](function(_0x495bad){if(_0x495bad){_0x19a973=_0x495bad;_0x28e937[_0x466a('0x2d')]=_[_0x466a('0x45')](db['CmList']['rawAttributes']);_0x28e937[_0x466a('0x2e')]=_['keys'](_0x491710['query']);_0x28e937[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x28e937[_0x466a('0x2d')],_0x28e937['query']);_0x79ad8a['attributes']=_[_0x466a('0x30')](_0x28e937[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x491710[_0x466a('0x2e')][_0x466a('0x31')]));_0x79ad8a[_0x466a('0x32')]=_0x79ad8a[_0x466a('0x32')]['length']?_0x79ad8a[_0x466a('0x32')]:_0x28e937[_0x466a('0x2d')];_0x79ad8a['order']=qs[_0x466a('0x37')](_0x491710[_0x466a('0x2e')][_0x466a('0x37')]);_0x79ad8a[_0x466a('0x38')]=qs[_0x466a('0x2f')](_[_0x466a('0x59')](_0x491710['query'],_0x28e937[_0x466a('0x2f')]));if(_0x491710[_0x466a('0x2e')][_0x466a('0x3c')]){_0x79ad8a[_0x466a('0x38')]=_[_0x466a('0x39')](_0x79ad8a[_0x466a('0x38')],{'$or':_[_0x466a('0x28')](_0x79ad8a[_0x466a('0x32')],function(_0x1edf6f){var _0x57562c={};_0x57562c[_0x1edf6f]={'$like':'%'+_0x491710[_0x466a('0x2e')]['filter']+'%'};return _0x57562c;})});}_0x79ad8a=_[_0x466a('0x39')]({},_0x79ad8a,_0x491710[_0x466a('0x3d')]);return _0x19a973[_0x466a('0x7d')](_0x79ad8a);}})[_0x466a('0x20')](function(_0xee5e35){if(_0xee5e35){_0x3a7fbe=_0xee5e35[_0x466a('0x33')];if(!_0x491710[_0x466a('0x2e')][_0x466a('0x34')](_0x466a('0x35'))){_0x79ad8a[_0x466a('0x1a')]=qs[_0x466a('0x1a')](_0x491710[_0x466a('0x2e')]['limit']);_0x79ad8a[_0x466a('0x18')]=qs[_0x466a('0x18')](_0x491710[_0x466a('0x2e')][_0x466a('0x18')]);}return _0x19a973[_0x466a('0x7d')](_0x79ad8a);}})['then'](function(_0x3fff0e){if(_0x3fff0e){return _0x3fff0e?{'count':_0x3a7fbe,'rows':_0x3fff0e}:null;}})[_0x466a('0x20')](respondWithResult(_0x3f29f7,null))[_0x466a('0x42')](handleError(_0x3f29f7,null));};exports['addBlackLists']=function(_0x385416,_0x1572b5,_0x2ff91c){var _0x252d85,_0x4815ef;return db[_0x466a('0x29')][_0x466a('0x46')]({'where':{'id':_0x385416[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x1572b5,null))[_0x466a('0x20')](function(_0x2db913){if(_0x2db913){_0x4815ef=_0x2db913;return _0x2db913[_0x466a('0x7e')](_0x385416[_0x466a('0x48')][_0x466a('0x62')],_[_0x466a('0x50')](_0x385416['body'],[_0x466a('0x62'),'id'])||{});}return null;})[_0x466a('0x63')](function(_0x3f5ff3){var _0x982559;_0x252d85=_0x3f5ff3||[];var _0x2ed016=[];if(_0x3f5ff3){for(var _0x4827dc=0x0;_0x4827dc<_0x3f5ff3[_0x466a('0x33')];_0x4827dc+=0x1){var _0x3d82e1=_0x3f5ff3[_0x4827dc][_0x466a('0x22')]({'plain':!![]});_0x982559=squel[_0x466a('0x65')]()[_0x466a('0x7f')](_0x466a('0x80'))[_0x466a('0x67')]([_0x466a('0x68'),'ContactId',_0x466a('0x6a'),'CampaignId',_0x466a('0x51'),_0x466a('0x52')],squel['select']()[_0x466a('0x6c')](_0x466a('0x68'),_0x466a('0x68'))['field']('id',_0x466a('0x69'))[_0x466a('0x6c')](_0x3d82e1[_0x466a('0x6f')][_0x466a('0x74')](),_0x466a('0x6a'))['field'](_0x385416['params']['id']['toString'](),_0x466a('0x5a'))[_0x466a('0x6c')](_0x466a('0x6d'),'createdAt')[_0x466a('0x6c')]('NOW()',_0x466a('0x52'))['from']('cm_contacts')[_0x466a('0x38')](_0x466a('0x72'))[_0x466a('0x38')](_0x466a('0x73'),_0x3d82e1[_0x466a('0x6f')]['toString']())[_0x466a('0x38')](_0x466a('0x78')))[_0x466a('0x74')]();_0x2ed016[_0x466a('0x7a')](db[_0x466a('0x81')][_0x466a('0x2e')](_0x982559));}return BPromise['all'](_0x2ed016);}})[_0x466a('0x20')](function(){return _0x252d85;})[_0x466a('0x20')](respondWithResult(_0x1572b5,null))[_0x466a('0x42')](handleError(_0x1572b5,null));};exports[_0x466a('0x82')]=function(_0x557317,_0x4d3f5f,_0x12eed0){return db[_0x466a('0x29')][_0x466a('0x46')]({'where':{'id':_0x557317['params']['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x4d3f5f,null))['then'](function(_0x157e66){if(_0x157e66){return _0x157e66['removeBlackLists'](_0x557317[_0x466a('0x2e')][_0x466a('0x62')]);}})[_0x466a('0x20')](function(_0x5d69cc){if(_0x5d69cc){return db[_0x466a('0x5f')]['destroy']({'where':{'ListId':_0x557317[_0x466a('0x2e')]['ids'],'CampaignId':_0x557317[_0x466a('0x44')]['id']}})[_0x466a('0x20')](function(){return _0x5d69cc;});}})[_0x466a('0x20')](respondWithStatusCode(_0x4d3f5f,null))[_0x466a('0x42')](handleError(_0x4d3f5f,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 37df881..28d0fb3 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 de67ffe..df8edfd 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 _0xdb13=['result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x433bd8,_0x3f646a){var _0x2c8fbf=function(_0x24fcad){while(--_0x24fcad){_0x433bd8['push'](_0x433bd8['shift']());}};_0x2c8fbf(++_0x3f646a);}(_0xdb13,0x10c));var _0x3db1=function(_0x277b9a,_0x181597){_0x277b9a=_0x277b9a-0x0;var _0x16785f=_0xdb13[_0x277b9a];return _0x16785f;};'use strict';var _=require('lodash');var util=require(_0x3db1('0x0'));var moment=require(_0x3db1('0x1'));var BPromise=require(_0x3db1('0x2'));var rs=require(_0x3db1('0x3'));var fs=require('fs');var Redis=require(_0x3db1('0x4'));var db=require(_0x3db1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3db1('0x6'))(_0x3db1('0x7'));var config=require(_0x3db1('0x8'));var jayson=require(_0x3db1('0x9'));var client=jayson[_0x3db1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37ae52,_0x2e1935,_0x28e7b6){return new BPromise(function(_0x379cfb,_0x22f0c7){return client[_0x3db1('0xb')](_0x37ae52,_0x28e7b6)[_0x3db1('0xc')](function(_0x9a9677){logger[_0x3db1('0xd')](_0x3db1('0xe'),_0x2e1935,_0x3db1('0xf'));logger[_0x3db1('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2e1935,_0x3db1('0xf'),JSON[_0x3db1('0x11')](_0x9a9677));if(_0x9a9677[_0x3db1('0x12')]){if(_0x9a9677[_0x3db1('0x12')]['code']===0x1f4){logger['error'](_0x3db1('0xe'),_0x2e1935,_0x9a9677[_0x3db1('0x12')][_0x3db1('0x13')]);return _0x22f0c7(_0x9a9677[_0x3db1('0x12')][_0x3db1('0x13')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x2e1935,_0x9a9677['error']['message']);return _0x379cfb(_0x9a9677[_0x3db1('0x12')][_0x3db1('0x13')]);}else{logger[_0x3db1('0xd')](_0x3db1('0xe'),_0x2e1935,_0x3db1('0xf'));_0x379cfb(_0x9a9677[_0x3db1('0x14')]['message']);}})[_0x3db1('0x15')](function(_0x6b8af0){logger['error'](_0x3db1('0xe'),_0x2e1935,_0x6b8af0);_0x22f0c7(_0x6b8af0);});});}exports[_0x3db1('0x16')]=function(_0x549a0e){var _0x26edb2=this;return new Promise(function(_0x5f3203,_0x16d339){return db[_0x3db1('0x17')][_0x3db1('0x18')]({'raw':_0x549a0e[_0x3db1('0x19')]?_0x549a0e['options'][_0x3db1('0x1a')]===undefined?!![]:![]:!![],'where':_0x549a0e[_0x3db1('0x19')]?_0x549a0e[_0x3db1('0x19')]['where']||null:null,'attributes':_0x549a0e[_0x3db1('0x19')]?_0x549a0e[_0x3db1('0x19')][_0x3db1('0x1b')]||null:null,'limit':_0x549a0e[_0x3db1('0x19')]?_0x549a0e[_0x3db1('0x19')][_0x3db1('0x1c')]||null:null,'include':_0x549a0e[_0x3db1('0x19')]?_0x549a0e[_0x3db1('0x19')][_0x3db1('0x1d')]?_[_0x3db1('0x1e')](_0x549a0e[_0x3db1('0x19')][_0x3db1('0x1d')],function(_0x1ee0c6){return{'model':db[_0x1ee0c6[_0x3db1('0x1f')]],'as':_0x1ee0c6['as'],'attributes':_0x1ee0c6[_0x3db1('0x1b')],'include':_0x1ee0c6['include']?_[_0x3db1('0x1e')](_0x1ee0c6[_0x3db1('0x1d')],function(_0x2263c6){return{'model':db[_0x2263c6['model']],'as':_0x2263c6['as'],'attributes':_0x2263c6[_0x3db1('0x1b')],'include':_0x2263c6[_0x3db1('0x1d')]?_[_0x3db1('0x1e')](_0x2263c6[_0x3db1('0x1d')],function(_0x5bd826){return{'model':db[_0x5bd826[_0x3db1('0x1f')]],'as':_0x5bd826['as'],'attributes':_0x5bd826[_0x3db1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x408d1c){logger[_0x3db1('0xd')](_0x3db1('0x16'),_0x549a0e);logger['debug'](_0x3db1('0x16'),_0x549a0e,JSON[_0x3db1('0x11')](_0x408d1c));_0x5f3203(_0x408d1c);})[_0x3db1('0x15')](function(_0x51ec2f){logger['error'](_0x3db1('0x16'),_0x51ec2f[_0x3db1('0x13')],_0x549a0e);_0x16d339(_0x26edb2['error'](0x1f4,_0x51ec2f['message']));});});}; \ No newline at end of file +var _0xef38=['include','info','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','attributes','limit','map','model'];(function(_0x2d5116,_0x4a8bb5){var _0x44808d=function(_0x482ed2){while(--_0x482ed2){_0x2d5116['push'](_0x2d5116['shift']());}};_0x44808d(++_0x4a8bb5);}(_0xef38,0x122));var _0x8ef3=function(_0x103b66,_0x483f12){_0x103b66=_0x103b66-0x0;var _0x4e8417=_0xef38[_0x103b66];return _0x4e8417;};'use strict';var _=require('lodash');var util=require(_0x8ef3('0x0'));var moment=require(_0x8ef3('0x1'));var BPromise=require(_0x8ef3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ef3('0x3'))['db'];var utils=require(_0x8ef3('0x4'));var logger=require(_0x8ef3('0x5'))(_0x8ef3('0x6'));var config=require(_0x8ef3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8ef3('0x8')][_0x8ef3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ee13,_0x2c9ccd,_0x26107d){return new BPromise(function(_0x217874,_0x12b6c0){return client[_0x8ef3('0xa')](_0x50ee13,_0x26107d)[_0x8ef3('0xb')](function(_0xc4b3b3){logger['info'](_0x8ef3('0xc'),_0x2c9ccd,_0x8ef3('0xd'));logger[_0x8ef3('0xe')](_0x8ef3('0xf'),_0x2c9ccd,_0x8ef3('0xd'),JSON[_0x8ef3('0x10')](_0xc4b3b3));if(_0xc4b3b3[_0x8ef3('0x11')]){if(_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x12')]===0x1f4){logger[_0x8ef3('0x11')](_0x8ef3('0xc'),_0x2c9ccd,_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x13')]);return _0x12b6c0(_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x13')]);}logger[_0x8ef3('0x11')](_0x8ef3('0xc'),_0x2c9ccd,_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x13')]);return _0x217874(_0xc4b3b3['error'][_0x8ef3('0x13')]);}else{logger['info'](_0x8ef3('0xc'),_0x2c9ccd,'request\x20sent');_0x217874(_0xc4b3b3[_0x8ef3('0x14')][_0x8ef3('0x13')]);}})['catch'](function(_0x56884c){logger[_0x8ef3('0x11')](_0x8ef3('0xc'),_0x2c9ccd,_0x56884c);_0x12b6c0(_0x56884c);});});}exports[_0x8ef3('0x15')]=function(_0x434aa9){var _0x5296f2=this;return new Promise(function(_0x5cbed2,_0x29025b){return db[_0x8ef3('0x16')][_0x8ef3('0x17')]({'raw':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9['options'][_0x8ef3('0x19')]===undefined?!![]:![]:!![],'where':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9[_0x8ef3('0x18')]['where']||null:null,'attributes':_0x434aa9['options']?_0x434aa9[_0x8ef3('0x18')][_0x8ef3('0x1a')]||null:null,'limit':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9[_0x8ef3('0x18')][_0x8ef3('0x1b')]||null:null,'include':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9[_0x8ef3('0x18')]['include']?_[_0x8ef3('0x1c')](_0x434aa9[_0x8ef3('0x18')]['include'],function(_0xa9829e){return{'model':db[_0xa9829e[_0x8ef3('0x1d')]],'as':_0xa9829e['as'],'attributes':_0xa9829e[_0x8ef3('0x1a')],'include':_0xa9829e[_0x8ef3('0x1e')]?_[_0x8ef3('0x1c')](_0xa9829e['include'],function(_0x18ef45){return{'model':db[_0x18ef45[_0x8ef3('0x1d')]],'as':_0x18ef45['as'],'attributes':_0x18ef45[_0x8ef3('0x1a')],'include':_0x18ef45[_0x8ef3('0x1e')]?_['map'](_0x18ef45[_0x8ef3('0x1e')],function(_0x28637a){return{'model':db[_0x28637a[_0x8ef3('0x1d')]],'as':_0x28637a['as'],'attributes':_0x28637a[_0x8ef3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8ef3('0xb')](function(_0x28748f){logger[_0x8ef3('0x1f')](_0x8ef3('0x15'),_0x434aa9);logger[_0x8ef3('0xe')](_0x8ef3('0x15'),_0x434aa9,JSON[_0x8ef3('0x10')](_0x28748f));_0x5cbed2(_0x28748f);})['catch'](function(_0x4408f9){logger[_0x8ef3('0x11')](_0x8ef3('0x15'),_0x4408f9[_0x8ef3('0x13')],_0x434aa9);_0x29025b(_0x5296f2[_0x8ef3('0x11')](0x1f4,_0x4408f9[_0x8ef3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 3d96e98..9662af2 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 _0x1ec4=['../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','delete','destroy','removeLists','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x3a87ef,_0x25aa94){var _0x414ef9=function(_0x5787eb){while(--_0x5787eb){_0x3a87ef['push'](_0x3a87ef['shift']());}};_0x414ef9(++_0x25aa94);}(_0x1ec4,0xef));var _0x41ec=function(_0x23661c,_0x2cd175){_0x23661c=_0x23661c-0x0;var _0x4295c1=_0x1ec4[_0x23661c];return _0x4295c1;};'use strict';var multer=require(_0x41ec('0x0'));var util=require(_0x41ec('0x1'));var path=require(_0x41ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x41ec('0x3'));var router=express[_0x41ec('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x41ec('0x5'));var interaction=require(_0x41ec('0x6'));var config=require(_0x41ec('0x7'));var controller=require(_0x41ec('0x8'));router[_0x41ec('0x9')]('/',auth[_0x41ec('0xa')](),controller[_0x41ec('0xb')]);router[_0x41ec('0x9')]('/:id',auth[_0x41ec('0xa')](),controller[_0x41ec('0xc')]);router['get'](_0x41ec('0xd'),auth[_0x41ec('0xa')](),controller[_0x41ec('0xe')]);router[_0x41ec('0x9')](_0x41ec('0xf'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x10')]);router[_0x41ec('0x9')](_0x41ec('0x11'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x12')]);router[_0x41ec('0x9')]('/:id/hopper_black',auth[_0x41ec('0xa')](),controller['getHopperBlacks']);router[_0x41ec('0x9')](_0x41ec('0x13'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x14')]);router[_0x41ec('0x9')](_0x41ec('0x15'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x16')]);router[_0x41ec('0x17')]('/',auth['isAuthenticated'](),controller[_0x41ec('0x18')]);router[_0x41ec('0x17')](_0x41ec('0x19'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x1a')]);router[_0x41ec('0x17')](_0x41ec('0x13'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x1b')]);router[_0x41ec('0x17')]('/:id/blacklists',auth[_0x41ec('0xa')](),controller[_0x41ec('0x1c')]);router[_0x41ec('0x1d')](_0x41ec('0x1e'),auth[_0x41ec('0xa')](),controller['update']);router[_0x41ec('0x1f')]('/:id',auth[_0x41ec('0xa')](),controller[_0x41ec('0x20')]);router['delete'](_0x41ec('0x13'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x21')]);router[_0x41ec('0x1f')](_0x41ec('0x15'),auth[_0x41ec('0xa')](),controller['removeBlackLists']);module[_0x41ec('0x22')]=router; \ No newline at end of file +var _0x569b=['getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addBlackLists','put','update','destroy','delete','removeLists','removeBlackLists','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x569b,0x173));var _0xb569=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x569b[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0xb569('0x0'));var util=require(_0xb569('0x1'));var path=require('path');var timeout=require(_0xb569('0x2'));var express=require(_0xb569('0x3'));var router=express[_0xb569('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb569('0x5'));var interaction=require(_0xb569('0x6'));var config=require('../../config/environment');var controller=require(_0xb569('0x7'));router[_0xb569('0x8')]('/',auth[_0xb569('0x9')](),controller['index']);router[_0xb569('0x8')](_0xb569('0xa'),auth[_0xb569('0x9')](),controller[_0xb569('0xb')]);router['get'](_0xb569('0xc'),auth['isAuthenticated'](),controller[_0xb569('0xd')]);router[_0xb569('0x8')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xb569('0xe')]);router[_0xb569('0x8')](_0xb569('0xf'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0xb569('0x10'),auth[_0xb569('0x9')](),controller[_0xb569('0x11')]);router[_0xb569('0x8')](_0xb569('0x12'),auth[_0xb569('0x9')](),controller[_0xb569('0x13')]);router['get'](_0xb569('0x14'),auth[_0xb569('0x9')](),controller[_0xb569('0x15')]);router[_0xb569('0x16')]('/',auth['isAuthenticated'](),controller[_0xb569('0x17')]);router[_0xb569('0x16')](_0xb569('0x18'),auth[_0xb569('0x9')](),controller['clone']);router['post']('/:id/lists',auth[_0xb569('0x9')](),controller['addLists']);router[_0xb569('0x16')](_0xb569('0x14'),auth['isAuthenticated'](),controller[_0xb569('0x19')]);router[_0xb569('0x1a')](_0xb569('0xa'),auth[_0xb569('0x9')](),controller[_0xb569('0x1b')]);router['delete'](_0xb569('0xa'),auth[_0xb569('0x9')](),controller[_0xb569('0x1c')]);router[_0xb569('0x1d')](_0xb569('0x12'),auth[_0xb569('0x9')](),controller[_0xb569('0x1e')]);router[_0xb569('0x1d')](_0xb569('0x14'),auth[_0xb569('0x9')](),controller[_0xb569('0x1f')]);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 6c124a9..48d98da 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 _0x80ea=['sequelize','TEXT','VIRTUAL','getDataValue','key'];(function(_0x451563,_0x1d02c6){var _0x1bff88=function(_0x4bcb4b){while(--_0x4bcb4b){_0x451563['push'](_0x451563['shift']());}};_0x1bff88(++_0x1d02c6);}(_0x80ea,0x127));var _0xa80e=function(_0x54a225,_0x512d8e){_0x54a225=_0x54a225-0x0;var _0x7451ec=_0x80ea[_0x54a225];return _0x7451ec;};'use strict';var Sequelize=require(_0xa80e('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xa80e('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa80e('0x2')],'get':function(){return this[_0xa80e('0x3')](_0xa80e('0x4'));}}}; \ No newline at end of file +var _0x8bc3=['getDataValue','key','STRING'];(function(_0x4bcd88,_0x36dc32){var _0x19b254=function(_0x1f7acf){while(--_0x1f7acf){_0x4bcd88['push'](_0x4bcd88['shift']());}};_0x19b254(++_0x36dc32);}(_0x8bc3,0x1a6));var _0x38bc=function(_0x448255,_0x2e681d){_0x448255=_0x448255-0x0;var _0x55d7ec=_0x8bc3[_0x448255];return _0x55d7ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x38bc('0x0')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x38bc('0x0')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x38bc('0x1')](_0x38bc('0x2'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index d4fed5e..8d4ce40 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 _0xd0c4=['sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','CannedAnswer','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x106b83,_0x5dc565){var _0x207ed4=function(_0x37ceb1){while(--_0x37ceb1){_0x106b83['push'](_0x106b83['shift']());}};_0x207ed4(++_0x5dc565);}(_0xd0c4,0x6f));var _0x4d0c=function(_0x334201,_0x39f06f){_0x334201=_0x334201-0x0;var _0x134700=_0xd0c4[_0x334201];return _0x134700;};'use strict';var emlformat=require(_0x4d0c('0x0'));var rimraf=require(_0x4d0c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d0c('0x2'));var moment=require('moment');var BPromise=require(_0x4d0c('0x3'));var Mustache=require(_0x4d0c('0x4'));var util=require(_0x4d0c('0x5'));var path=require(_0x4d0c('0x6'));var sox=require(_0x4d0c('0x7'));var csv=require(_0x4d0c('0x8'));var ejs=require(_0x4d0c('0x9'));var fs=require('fs');var fs_extra=require(_0x4d0c('0xa'));var _=require(_0x4d0c('0xb'));var squel=require(_0x4d0c('0xc'));var crypto=require(_0x4d0c('0xd'));var jsforce=require(_0x4d0c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4d0c('0xf'));var Papa=require(_0x4d0c('0x10'));var Redis=require(_0x4d0c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4d0c('0x12'));var as=require(_0x4d0c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d0c('0x14'))('api');var utils=require(_0x4d0c('0x15'));var config=require(_0x4d0c('0x16'));var licenseUtil=require(_0x4d0c('0x17'));var db=require(_0x4d0c('0x18'))['db'];function respondWithStatusCode(_0x5286f9,_0x504839){_0x504839=_0x504839||0xcc;return function(_0x5592ad){if(_0x5592ad){return _0x5286f9[_0x4d0c('0x19')](_0x504839);}return _0x5286f9[_0x4d0c('0x1a')](_0x504839)[_0x4d0c('0x1b')]();};}function respondWithResult(_0x396de2,_0x3184b3){_0x3184b3=_0x3184b3||0xc8;return function(_0x186a42){if(_0x186a42){return _0x396de2['status'](_0x3184b3)[_0x4d0c('0x1c')](_0x186a42);}};}function respondWithFilteredResult(_0x26fc71,_0x2ff89d){return function(_0x2aa781){if(_0x2aa781){var _0x188451=typeof _0x2ff89d[_0x4d0c('0x1d')]===_0x4d0c('0x1e')&&typeof _0x2ff89d[_0x4d0c('0x1f')]==='undefined';var _0x164a34=_0x2aa781[_0x4d0c('0x20')];var _0x2617c2=_0x188451?0x0:_0x2ff89d['offset'];var _0x4f2b5f=_0x188451?_0x2aa781[_0x4d0c('0x20')]:_0x2ff89d[_0x4d0c('0x1d')]+_0x2ff89d[_0x4d0c('0x1f')];var _0x13f115;if(_0x4f2b5f>=_0x164a34){_0x4f2b5f=_0x164a34;_0x13f115=0xc8;}else{_0x13f115=0xce;}_0x26fc71['status'](_0x13f115);return _0x26fc71['set'](_0x4d0c('0x21'),_0x2617c2+'-'+_0x4f2b5f+'/'+_0x164a34)[_0x4d0c('0x1c')](_0x2aa781);}return null;};}function patchUpdates(_0x29ba80){return function(_0x54f61e){try{jsonpatch[_0x4d0c('0x22')](_0x54f61e,_0x29ba80,!![]);}catch(_0x5d60c4){return BPromise['reject'](_0x5d60c4);}return _0x54f61e[_0x4d0c('0x23')]();};}function saveUpdates(_0xe5bdaa,_0x3fc636){return function(_0x2b16f0){if(_0x2b16f0){return _0x2b16f0[_0x4d0c('0x24')](_0xe5bdaa)[_0x4d0c('0x25')](function(_0x5b91f9){return _0x5b91f9;});}return null;};}function removeEntity(_0x442d56,_0x14839d){return function(_0x51672){if(_0x51672){return _0x51672['destroy']()[_0x4d0c('0x25')](function(){var _0x4f343c=_0x51672[_0x4d0c('0x26')]({'plain':!![]});var _0x3b4939='CannedAnswers';return db[_0x4d0c('0x27')][_0x4d0c('0x28')]({'where':{'type':_0x3b4939,'resourceId':_0x4f343c['id']}})[_0x4d0c('0x25')](function(){return _0x51672;});})[_0x4d0c('0x25')](function(){_0x442d56[_0x4d0c('0x1a')](0xcc)[_0x4d0c('0x1b')]();});}};}function handleEntityNotFound(_0x49ae94,_0x28edba){return function(_0x532351){if(!_0x532351){_0x49ae94[_0x4d0c('0x19')](0x194);}return _0x532351;};}function handleError(_0x488b49,_0x40257c){_0x40257c=_0x40257c||0x1f4;return function(_0x1e3c9d){logger[_0x4d0c('0x29')](_0x1e3c9d['stack']);if(_0x1e3c9d[_0x4d0c('0x2a')]){delete _0x1e3c9d[_0x4d0c('0x2a')];}_0x488b49['status'](_0x40257c)[_0x4d0c('0x2b')](_0x1e3c9d);};}exports[_0x4d0c('0x2c')]=function(_0x3f84db,_0x51b3b9){var _0x10dff8={},_0x4a0b22={},_0x488632={'count':0x0,'rows':[]};var _0x22de60=_[_0x4d0c('0x2d')](db[_0x4d0c('0x2e')][_0x4d0c('0x2f')],function(_0x1ec0f2){return{'name':_0x1ec0f2['fieldName'],'type':_0x1ec0f2['type'][_0x4d0c('0x30')]};});_0x4a0b22[_0x4d0c('0x31')]=_[_0x4d0c('0x2d')](_0x22de60,_0x4d0c('0x2a'));_0x4a0b22[_0x4d0c('0x32')]=_[_0x4d0c('0x33')](_0x3f84db[_0x4d0c('0x32')]);_0x4a0b22[_0x4d0c('0x34')]=_[_0x4d0c('0x35')](_0x4a0b22[_0x4d0c('0x31')],_0x4a0b22[_0x4d0c('0x32')]);_0x10dff8[_0x4d0c('0x36')]=_[_0x4d0c('0x35')](_0x4a0b22[_0x4d0c('0x31')],qs[_0x4d0c('0x37')](_0x3f84db['query']['fields']));_0x10dff8['attributes']=_0x10dff8['attributes'][_0x4d0c('0x38')]?_0x10dff8[_0x4d0c('0x36')]:_0x4a0b22[_0x4d0c('0x31')];if(!_0x3f84db['query']['hasOwnProperty'](_0x4d0c('0x39'))){_0x10dff8[_0x4d0c('0x1f')]=qs['limit'](_0x3f84db[_0x4d0c('0x32')]['limit']);_0x10dff8[_0x4d0c('0x1d')]=qs[_0x4d0c('0x1d')](_0x3f84db['query']['offset']);}_0x10dff8[_0x4d0c('0x3a')]=qs[_0x4d0c('0x3b')](_0x3f84db[_0x4d0c('0x32')][_0x4d0c('0x3b')]);_0x10dff8[_0x4d0c('0x3c')]=qs[_0x4d0c('0x34')](_[_0x4d0c('0x3d')](_0x3f84db['query'],_0x4a0b22[_0x4d0c('0x34')]),_0x22de60);if(_0x3f84db['query'][_0x4d0c('0x3e')]){_0x10dff8[_0x4d0c('0x3c')]=_[_0x4d0c('0x3f')](_0x10dff8[_0x4d0c('0x3c')],{'$or':[{'key':{'$like':'%'+_0x3f84db[_0x4d0c('0x32')][_0x4d0c('0x3e')]+'%'}},{'value':{'$like':'%'+_0x3f84db[_0x4d0c('0x32')][_0x4d0c('0x3e')]+'%'}}]});}_0x10dff8=_[_0x4d0c('0x3f')]({},_0x10dff8,_0x3f84db[_0x4d0c('0x40')]);var _0x452519={'where':_0x10dff8[_0x4d0c('0x3c')]};return db['CannedAnswer'][_0x4d0c('0x20')](_0x452519)[_0x4d0c('0x25')](function(_0x3ed847){_0x488632[_0x4d0c('0x20')]=_0x3ed847;if(_0x3f84db['query'][_0x4d0c('0x41')]){_0x10dff8[_0x4d0c('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4d0c('0x43')](_0x10dff8);})[_0x4d0c('0x25')](function(_0x3f9fd6){_0x488632['rows']=_0x3f9fd6;return _0x488632;})[_0x4d0c('0x25')](respondWithFilteredResult(_0x51b3b9,_0x10dff8))[_0x4d0c('0x44')](handleError(_0x51b3b9,null));};exports[_0x4d0c('0x45')]=function(_0x433394,_0x538811){var _0x3ce858={'raw':!![],'where':{'id':_0x433394[_0x4d0c('0x46')]['id']}},_0x471ddc={};_0x471ddc[_0x4d0c('0x31')]=_[_0x4d0c('0x33')](db[_0x4d0c('0x2e')]['rawAttributes']);_0x471ddc['query']=_[_0x4d0c('0x33')](_0x433394[_0x4d0c('0x32')]);_0x471ddc['filters']=_[_0x4d0c('0x35')](_0x471ddc['model'],_0x471ddc['query']);_0x3ce858[_0x4d0c('0x36')]=_['intersection'](_0x471ddc[_0x4d0c('0x31')],qs[_0x4d0c('0x37')](_0x433394[_0x4d0c('0x32')][_0x4d0c('0x37')]));_0x3ce858[_0x4d0c('0x36')]=_0x3ce858[_0x4d0c('0x36')][_0x4d0c('0x38')]?_0x3ce858[_0x4d0c('0x36')]:_0x471ddc['model'];if(_0x433394[_0x4d0c('0x32')]['includeAll']){_0x3ce858[_0x4d0c('0x42')]=[{'all':!![]}];}_0x3ce858=_[_0x4d0c('0x3f')]({},_0x3ce858,_0x433394[_0x4d0c('0x40')]);return db[_0x4d0c('0x2e')][_0x4d0c('0x47')](_0x3ce858)[_0x4d0c('0x25')](handleEntityNotFound(_0x538811,null))[_0x4d0c('0x25')](respondWithResult(_0x538811,null))[_0x4d0c('0x44')](handleError(_0x538811,null));};exports['update']=function(_0x47481a,_0x672106){if(_0x47481a['body']['id']){delete _0x47481a[_0x4d0c('0x48')]['id'];}return db[_0x4d0c('0x2e')][_0x4d0c('0x47')]({'where':{'id':_0x47481a[_0x4d0c('0x46')]['id']}})[_0x4d0c('0x25')](handleEntityNotFound(_0x672106,null))['then'](saveUpdates(_0x47481a['body'],null))[_0x4d0c('0x25')](respondWithResult(_0x672106,null))[_0x4d0c('0x44')](handleError(_0x672106,null));};exports[_0x4d0c('0x28')]=function(_0x589942,_0x3cb6fa){return db[_0x4d0c('0x2e')][_0x4d0c('0x47')]({'where':{'id':_0x589942[_0x4d0c('0x46')]['id']}})[_0x4d0c('0x25')](handleEntityNotFound(_0x3cb6fa,null))[_0x4d0c('0x25')](removeEntity(_0x3cb6fa,null))[_0x4d0c('0x44')](handleError(_0x3cb6fa,null));};exports[_0x4d0c('0x49')]=function(_0x43e5da,_0x597996){var _0x2830a3={'key':_0x43e5da[_0x4d0c('0x48')][_0x4d0c('0x30')]};if(_0x43e5da['body']['MailAccountId']){_0x2830a3[_0x4d0c('0x4a')]=_0x43e5da[_0x4d0c('0x48')]['MailAccountId'];}else if(_0x43e5da['body']['SmsAccountId']){_0x2830a3['SmsAccountId']=_0x43e5da[_0x4d0c('0x48')][_0x4d0c('0x4b')];}else if(_0x43e5da[_0x4d0c('0x48')][_0x4d0c('0x4c')]){_0x2830a3[_0x4d0c('0x4c')]=_0x43e5da[_0x4d0c('0x48')]['OpenchannelAccountId'];}else if(_0x43e5da[_0x4d0c('0x48')]['ChatWebsiteId']){_0x2830a3[_0x4d0c('0x4d')]=_0x43e5da[_0x4d0c('0x48')][_0x4d0c('0x4d')];}return db[_0x4d0c('0x2e')]['find']({'where':_0x2830a3})[_0x4d0c('0x25')](function(_0xcdf751){if(_0xcdf751){throw new db[(_0x4d0c('0x4e'))][(_0x4d0c('0x4f'))](_0x4d0c('0x50'));}return db[_0x4d0c('0x2e')][_0x4d0c('0x49')](_0x43e5da[_0x4d0c('0x48')]);})[_0x4d0c('0x25')](function(_0x133a92){var _0x1161b7=_0x43e5da[_0x4d0c('0x51')][_0x4d0c('0x26')]({'plain':!![]});if(!_0x1161b7)throw new Error(_0x4d0c('0x52'));if(_0x1161b7['role']===_0x4d0c('0x51')){var _0x33240c=_0x133a92[_0x4d0c('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x4d0c('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x1161b7['userProfileId']},'raw':!![]})['then'](function(_0x22fb1d){if(_0x22fb1d&&_0x22fb1d[_0x4d0c('0x53')]===0x0){return db[_0x4d0c('0x27')][_0x4d0c('0x49')]({'name':_0x33240c[_0x4d0c('0x2a')],'resourceId':_0x33240c['id'],'type':_0x22fb1d[_0x4d0c('0x2a')],'sectionId':_0x22fb1d['id']},{})[_0x4d0c('0x25')](function(){return _0x133a92;});}else{return _0x133a92;}})[_0x4d0c('0x44')](function(_0x2ec6f4){logger[_0x4d0c('0x29')](_0x4d0c('0x54'),_0x2ec6f4);throw _0x2ec6f4;});}return _0x133a92;})[_0x4d0c('0x25')](respondWithResult(_0x597996,0xc9))['catch'](handleError(_0x597996,null));}; \ No newline at end of file +var _0xde49=['filters','intersection','attributes','model','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','fields','catch','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0xde49,0x1f1));var _0x9de4=function(_0x2293cf,_0x4747ac){_0x2293cf=_0x2293cf-0x0;var _0x14f93f=_0xde49[_0x2293cf];return _0x14f93f;};'use strict';var emlformat=require(_0x9de4('0x0'));var rimraf=require(_0x9de4('0x1'));var zipdir=require(_0x9de4('0x2'));var jsonpatch=require(_0x9de4('0x3'));var rp=require(_0x9de4('0x4'));var moment=require(_0x9de4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9de4('0x6'));var sox=require(_0x9de4('0x7'));var csv=require(_0x9de4('0x8'));var ejs=require(_0x9de4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9de4('0xa'));var squel=require(_0x9de4('0xb'));var crypto=require(_0x9de4('0xc'));var jsforce=require(_0x9de4('0xd'));var deskjs=require(_0x9de4('0xe'));var toCsv=require(_0x9de4('0x8'));var querystring=require(_0x9de4('0xf'));var Papa=require(_0x9de4('0x10'));var Redis=require(_0x9de4('0x11'));var authService=require(_0x9de4('0x12'));var qs=require(_0x9de4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9de4('0x14'));var logger=require(_0x9de4('0x15'))('api');var utils=require(_0x9de4('0x16'));var config=require(_0x9de4('0x17'));var licenseUtil=require(_0x9de4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7ca7aa,_0x3a1bd3){_0x3a1bd3=_0x3a1bd3||0xcc;return function(_0x1cdb4b){if(_0x1cdb4b){return _0x7ca7aa[_0x9de4('0x19')](_0x3a1bd3);}return _0x7ca7aa['status'](_0x3a1bd3)[_0x9de4('0x1a')]();};}function respondWithResult(_0x1ec39b,_0x315ba3){_0x315ba3=_0x315ba3||0xc8;return function(_0x5f64f8){if(_0x5f64f8){return _0x1ec39b[_0x9de4('0x1b')](_0x315ba3)[_0x9de4('0x1c')](_0x5f64f8);}};}function respondWithFilteredResult(_0xb75ff7,_0x15d96f){return function(_0x20ed3f){if(_0x20ed3f){var _0x3fce8a=typeof _0x15d96f[_0x9de4('0x1d')]==='undefined'&&typeof _0x15d96f[_0x9de4('0x1e')]==='undefined';var _0x203a34=_0x20ed3f[_0x9de4('0x1f')];var _0x32d8ed=_0x3fce8a?0x0:_0x15d96f['offset'];var _0x167f04=_0x3fce8a?_0x20ed3f[_0x9de4('0x1f')]:_0x15d96f[_0x9de4('0x1d')]+_0x15d96f[_0x9de4('0x1e')];var _0x57fcaa;if(_0x167f04>=_0x203a34){_0x167f04=_0x203a34;_0x57fcaa=0xc8;}else{_0x57fcaa=0xce;}_0xb75ff7['status'](_0x57fcaa);return _0xb75ff7['set'](_0x9de4('0x20'),_0x32d8ed+'-'+_0x167f04+'/'+_0x203a34)[_0x9de4('0x1c')](_0x20ed3f);}return null;};}function patchUpdates(_0x4f0472){return function(_0x15ced7){try{jsonpatch[_0x9de4('0x21')](_0x15ced7,_0x4f0472,!![]);}catch(_0x1cc0d9){return BPromise[_0x9de4('0x22')](_0x1cc0d9);}return _0x15ced7[_0x9de4('0x23')]();};}function saveUpdates(_0x504c4b,_0x518448){return function(_0x1444ea){if(_0x1444ea){return _0x1444ea[_0x9de4('0x24')](_0x504c4b)[_0x9de4('0x25')](function(_0x5d6a55){return _0x5d6a55;});}return null;};}function removeEntity(_0x26e834,_0x3f3de8){return function(_0x3819b0){if(_0x3819b0){return _0x3819b0[_0x9de4('0x26')]()['then'](function(){var _0x182a1e=_0x3819b0[_0x9de4('0x27')]({'plain':!![]});var _0x2e626a=_0x9de4('0x28');return db[_0x9de4('0x29')][_0x9de4('0x26')]({'where':{'type':_0x2e626a,'resourceId':_0x182a1e['id']}})['then'](function(){return _0x3819b0;});})[_0x9de4('0x25')](function(){_0x26e834[_0x9de4('0x1b')](0xcc)[_0x9de4('0x1a')]();});}};}function handleEntityNotFound(_0x589f22,_0xf9c205){return function(_0x76e5f7){if(!_0x76e5f7){_0x589f22['sendStatus'](0x194);}return _0x76e5f7;};}function handleError(_0x2d9fa9,_0x3bcd01){_0x3bcd01=_0x3bcd01||0x1f4;return function(_0x1bfcfd){logger[_0x9de4('0x2a')](_0x1bfcfd[_0x9de4('0x2b')]);if(_0x1bfcfd['name']){delete _0x1bfcfd[_0x9de4('0x2c')];}_0x2d9fa9[_0x9de4('0x1b')](_0x3bcd01)[_0x9de4('0x2d')](_0x1bfcfd);};}exports[_0x9de4('0x2e')]=function(_0x413816,_0x553f81){var _0x351378={},_0x1474c8={},_0x257f6d={'count':0x0,'rows':[]};var _0xca76d5=_[_0x9de4('0x2f')](db[_0x9de4('0x30')][_0x9de4('0x31')],function(_0x39267b){return{'name':_0x39267b[_0x9de4('0x32')],'type':_0x39267b[_0x9de4('0x33')][_0x9de4('0x34')]};});_0x1474c8['model']=_[_0x9de4('0x2f')](_0xca76d5,_0x9de4('0x2c'));_0x1474c8[_0x9de4('0x35')]=_[_0x9de4('0x36')](_0x413816['query']);_0x1474c8[_0x9de4('0x37')]=_[_0x9de4('0x38')](_0x1474c8['model'],_0x1474c8['query']);_0x351378[_0x9de4('0x39')]=_[_0x9de4('0x38')](_0x1474c8[_0x9de4('0x3a')],qs['fields'](_0x413816[_0x9de4('0x35')]['fields']));_0x351378[_0x9de4('0x39')]=_0x351378['attributes'][_0x9de4('0x3b')]?_0x351378[_0x9de4('0x39')]:_0x1474c8['model'];if(!_0x413816['query']['hasOwnProperty'](_0x9de4('0x3c'))){_0x351378[_0x9de4('0x1e')]=qs['limit'](_0x413816[_0x9de4('0x35')]['limit']);_0x351378[_0x9de4('0x1d')]=qs[_0x9de4('0x1d')](_0x413816[_0x9de4('0x35')][_0x9de4('0x1d')]);}_0x351378[_0x9de4('0x3d')]=qs['sort'](_0x413816['query'][_0x9de4('0x3e')]);_0x351378[_0x9de4('0x3f')]=qs['filters'](_[_0x9de4('0x40')](_0x413816['query'],_0x1474c8[_0x9de4('0x37')]),_0xca76d5);if(_0x413816['query']['filter']){_0x351378[_0x9de4('0x3f')]=_[_0x9de4('0x41')](_0x351378['where'],{'$or':[{'key':{'$like':'%'+_0x413816[_0x9de4('0x35')][_0x9de4('0x42')]+'%'}},{'value':{'$like':'%'+_0x413816['query']['filter']+'%'}}]});}_0x351378=_[_0x9de4('0x41')]({},_0x351378,_0x413816[_0x9de4('0x43')]);var _0x4cbd21={'where':_0x351378[_0x9de4('0x3f')]};return db[_0x9de4('0x30')][_0x9de4('0x1f')](_0x4cbd21)[_0x9de4('0x25')](function(_0x5292f8){_0x257f6d[_0x9de4('0x1f')]=_0x5292f8;if(_0x413816[_0x9de4('0x35')][_0x9de4('0x44')]){_0x351378[_0x9de4('0x45')]=[{'all':!![]}];}return db[_0x9de4('0x30')][_0x9de4('0x46')](_0x351378);})[_0x9de4('0x25')](function(_0x458077){_0x257f6d[_0x9de4('0x47')]=_0x458077;return _0x257f6d;})[_0x9de4('0x25')](respondWithFilteredResult(_0x553f81,_0x351378))['catch'](handleError(_0x553f81,null));};exports[_0x9de4('0x48')]=function(_0x7b758b,_0x2ab672){var _0x57fed0={'raw':!![],'where':{'id':_0x7b758b[_0x9de4('0x49')]['id']}},_0x4b61cd={};_0x4b61cd[_0x9de4('0x3a')]=_[_0x9de4('0x36')](db[_0x9de4('0x30')][_0x9de4('0x31')]);_0x4b61cd[_0x9de4('0x35')]=_[_0x9de4('0x36')](_0x7b758b[_0x9de4('0x35')]);_0x4b61cd[_0x9de4('0x37')]=_[_0x9de4('0x38')](_0x4b61cd[_0x9de4('0x3a')],_0x4b61cd[_0x9de4('0x35')]);_0x57fed0[_0x9de4('0x39')]=_[_0x9de4('0x38')](_0x4b61cd[_0x9de4('0x3a')],qs['fields'](_0x7b758b[_0x9de4('0x35')][_0x9de4('0x4a')]));_0x57fed0[_0x9de4('0x39')]=_0x57fed0[_0x9de4('0x39')][_0x9de4('0x3b')]?_0x57fed0[_0x9de4('0x39')]:_0x4b61cd[_0x9de4('0x3a')];if(_0x7b758b[_0x9de4('0x35')][_0x9de4('0x44')]){_0x57fed0[_0x9de4('0x45')]=[{'all':!![]}];}_0x57fed0=_[_0x9de4('0x41')]({},_0x57fed0,_0x7b758b[_0x9de4('0x43')]);return db[_0x9de4('0x30')]['find'](_0x57fed0)[_0x9de4('0x25')](handleEntityNotFound(_0x2ab672,null))[_0x9de4('0x25')](respondWithResult(_0x2ab672,null))[_0x9de4('0x4b')](handleError(_0x2ab672,null));};exports['update']=function(_0x152760,_0x2cd163){if(_0x152760[_0x9de4('0x4c')]['id']){delete _0x152760[_0x9de4('0x4c')]['id'];}return db[_0x9de4('0x30')][_0x9de4('0x4d')]({'where':{'id':_0x152760[_0x9de4('0x49')]['id']}})[_0x9de4('0x25')](handleEntityNotFound(_0x2cd163,null))[_0x9de4('0x25')](saveUpdates(_0x152760[_0x9de4('0x4c')],null))[_0x9de4('0x25')](respondWithResult(_0x2cd163,null))['catch'](handleError(_0x2cd163,null));};exports[_0x9de4('0x26')]=function(_0x4400f0,_0x487a1a){return db[_0x9de4('0x30')][_0x9de4('0x4d')]({'where':{'id':_0x4400f0[_0x9de4('0x49')]['id']}})['then'](handleEntityNotFound(_0x487a1a,null))[_0x9de4('0x25')](removeEntity(_0x487a1a,null))[_0x9de4('0x4b')](handleError(_0x487a1a,null));};exports[_0x9de4('0x4e')]=function(_0x540dd8,_0x355d4f){var _0x56f202={'key':_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x34')]};if(_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x4f')]){_0x56f202[_0x9de4('0x4f')]=_0x540dd8['body']['MailAccountId'];}else if(_0x540dd8['body'][_0x9de4('0x50')]){_0x56f202['SmsAccountId']=_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x50')];}else if(_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x51')]){_0x56f202['OpenchannelAccountId']=_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x51')];}else if(_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x52')]){_0x56f202['ChatWebsiteId']=_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x52')];}return db[_0x9de4('0x30')][_0x9de4('0x4d')]({'where':_0x56f202})[_0x9de4('0x25')](function(_0x20e9d2){if(_0x20e9d2){throw new db[(_0x9de4('0x53'))][(_0x9de4('0x54'))](_0x9de4('0x55'));}return db['CannedAnswer']['create'](_0x540dd8['body']);})['then'](function(_0x418bbc){var _0x462536=_0x540dd8[_0x9de4('0x56')]['get']({'plain':!![]});if(!_0x462536)throw new Error(_0x9de4('0x57'));if(_0x462536[_0x9de4('0x58')]===_0x9de4('0x56')){var _0x120f26=_0x418bbc[_0x9de4('0x27')]({'plain':!![]});return db[_0x9de4('0x59')][_0x9de4('0x4d')]({'where':{'name':'CannedAnswers','userProfileId':_0x462536[_0x9de4('0x5a')]},'raw':!![]})[_0x9de4('0x25')](function(_0x539437){if(_0x539437&&_0x539437['autoAssociation']===0x0){return db[_0x9de4('0x29')][_0x9de4('0x4e')]({'name':_0x120f26['name'],'resourceId':_0x120f26['id'],'type':_0x539437[_0x9de4('0x2c')],'sectionId':_0x539437['id']},{})[_0x9de4('0x25')](function(){return _0x418bbc;});}else{return _0x418bbc;}})[_0x9de4('0x4b')](function(_0x53015d){logger[_0x9de4('0x2a')](_0x9de4('0x5b'),_0x53015d);throw _0x53015d;});}return _0x418bbc;})['then'](respondWithResult(_0x355d4f,0xc9))[_0x9de4('0x4b')](handleError(_0x355d4f,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index b26c348..c512e4e 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 _0x9931=['define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./cannedAnswer.attributes'];(function(_0x1b026e,_0x1a7ec0){var _0x5bb7d8=function(_0x3207e4){while(--_0x3207e4){_0x1b026e['push'](_0x1b026e['shift']());}};_0x5bb7d8(++_0x1a7ec0);}(_0x9931,0x116));var _0x1993=function(_0x37b6bb,_0x47d128){_0x37b6bb=_0x37b6bb-0x0;var _0x7fc3b7=_0x9931[_0x37b6bb];return _0x7fc3b7;};'use strict';var _=require('lodash');var util=require(_0x1993('0x0'));var logger=require(_0x1993('0x1'))(_0x1993('0x2'));var moment=require(_0x1993('0x3'));var BPromise=require(_0x1993('0x4'));var rp=require(_0x1993('0x5'));var fs=require('fs');var path=require(_0x1993('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1993('0x7'));module['exports']=function(_0x5940ce,_0x432da3){return _0x5940ce[_0x1993('0x8')](_0x1993('0x9'),attributes,{'tableName':_0x1993('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1993('0xb'),'collate':_0x1993('0xc')});}; \ No newline at end of file +var _0xeaa7=['request-promise','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x398175,_0x363721){var _0x7cb4fc=function(_0x454fd4){while(--_0x454fd4){_0x398175['push'](_0x398175['shift']());}};_0x7cb4fc(++_0x363721);}(_0xeaa7,0x13a));var _0x7eaa=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0xeaa7[_0x11a55c];return _0x26c390;};'use strict';var _=require('lodash');var util=require(_0x7eaa('0x0'));var logger=require(_0x7eaa('0x1'))(_0x7eaa('0x2'));var moment=require(_0x7eaa('0x3'));var BPromise=require(_0x7eaa('0x4'));var rp=require(_0x7eaa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x7eaa('0x6')]=function(_0x21ce95,_0x3f0a3e){return _0x21ce95[_0x7eaa('0x7')](_0x7eaa('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7eaa('0x9'),'collate':_0x7eaa('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 3ea22e9..3891807 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(_0x2cb678,_0x1e099a){var _0x9116bf=function(_0x3ff8c5){while(--_0x3ff8c5){_0x2cb678['push'](_0x2cb678['shift']());}};_0x9116bf(++_0x1e099a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x227a73,_0xb55b36){var _0x99dc57=function(_0x14ffa3){while(--_0x14ffa3){_0x227a73['push'](_0x227a73['shift']());}};_0x99dc57(++_0xb55b36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 2a21f49..1a8e836 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 _0x8dc7=['get','index','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./cannedAnswer.controller'];(function(_0x50619a,_0x325b23){var _0x1364cc=function(_0x500412){while(--_0x500412){_0x50619a['push'](_0x50619a['shift']());}};_0x1364cc(++_0x325b23);}(_0x8dc7,0x1e9));var _0x78dc=function(_0x21d4a6,_0x52293a){_0x21d4a6=_0x21d4a6-0x0;var _0x2826d8=_0x8dc7[_0x21d4a6];return _0x2826d8;};'use strict';var multer=require(_0x78dc('0x0'));var util=require('util');var path=require(_0x78dc('0x1'));var timeout=require(_0x78dc('0x2'));var express=require('express');var router=express[_0x78dc('0x3')]();var fs_extra=require(_0x78dc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x78dc('0x5'));var controller=require(_0x78dc('0x6'));router[_0x78dc('0x7')]('/',auth['isAuthenticated'](),controller[_0x78dc('0x8')]);router['get']('/:id',auth[_0x78dc('0x9')](),controller[_0x78dc('0xa')]);router[_0x78dc('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x78dc('0xc')]('/:id',auth[_0x78dc('0x9')](),controller['update']);router[_0x78dc('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x78dc('0xe')]);module[_0x78dc('0xf')]=router; \ No newline at end of file +var _0x9ae7=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','path'];(function(_0x31157d,_0x4ce3e2){var _0x48a2ab=function(_0x347894){while(--_0x347894){_0x31157d['push'](_0x31157d['shift']());}};_0x48a2ab(++_0x4ce3e2);}(_0x9ae7,0x8e));var _0x79ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ae7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x79ae('0x0'));var util=require('util');var path=require(_0x79ae('0x1'));var timeout=require(_0x79ae('0x2'));var express=require(_0x79ae('0x3'));var router=express[_0x79ae('0x4')]();var fs_extra=require(_0x79ae('0x5'));var auth=require(_0x79ae('0x6'));var interaction=require(_0x79ae('0x7'));var config=require('../../config/environment');var controller=require(_0x79ae('0x8'));router['get']('/',auth[_0x79ae('0x9')](),controller[_0x79ae('0xa')]);router['get'](_0x79ae('0xb'),auth[_0x79ae('0x9')](),controller[_0x79ae('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x79ae('0xd')]);router[_0x79ae('0xe')](_0x79ae('0xb'),auth[_0x79ae('0x9')](),controller['update']);router[_0x79ae('0xf')]('/:id',auth[_0x79ae('0x9')](),controller[_0x79ae('0x10')]);module[_0x79ae('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index e398015..18e9901 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 _0x804e=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x588006,_0x4ba6c1){var _0x552598=function(_0x2e2115){while(--_0x2e2115){_0x588006['push'](_0x588006['shift']());}};_0x552598(++_0x4ba6c1);}(_0x804e,0x6e));var _0xe804=function(_0x5b28a6,_0x3d3210){_0x5b28a6=_0x5b28a6-0x0;var _0x22fd9b=_0x804e[_0x5b28a6];return _0x22fd9b;};'use strict';var Sequelize=require(_0xe804('0x0'));module[_0xe804('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xe804('0x2')},'clid':{'type':Sequelize[_0xe804('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xe804('0x3')]},'channel':{'type':Sequelize[_0xe804('0x3')]},'dstchannel':{'type':Sequelize[_0xe804('0x3')]},'lastapp':{'type':Sequelize[_0xe804('0x3')]},'lastdata':{'type':Sequelize[_0xe804('0x3')]},'duration':{'type':Sequelize[_0xe804('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe804('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe804('0x3')]},'amaflags':{'type':Sequelize[_0xe804('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe804('0x3')]},'userfield':{'type':Sequelize[_0xe804('0x3')]},'uniqueid':{'type':Sequelize[_0xe804('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xe804('0x3')]},'type':{'type':Sequelize[_0xe804('0x3')]},'tag':{'type':Sequelize[_0xe804('0x3')]}}; \ No newline at end of file +var _0x7b10=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b10,0x1ac));var _0x07b1=function(_0x268db2,_0x136711){_0x268db2=_0x268db2-0x0;var _0x1d77c7=_0x7b10[_0x268db2];return _0x1d77c7;};'use strict';var Sequelize=require(_0x07b1('0x0'));module[_0x07b1('0x1')]={'calldate':{'type':Sequelize[_0x07b1('0x2')],'allowNull':![],'defaultValue':_0x07b1('0x3')},'clid':{'type':Sequelize[_0x07b1('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x07b1('0x4')]},'dcontext':{'type':Sequelize[_0x07b1('0x4')]},'channel':{'type':Sequelize[_0x07b1('0x4')]},'dstchannel':{'type':Sequelize[_0x07b1('0x4')]},'lastapp':{'type':Sequelize[_0x07b1('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x07b1('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x07b1('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x07b1('0x4')]},'amaflags':{'type':Sequelize[_0x07b1('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x07b1('0x4')]},'userfield':{'type':Sequelize[_0x07b1('0x4')]},'uniqueid':{'type':Sequelize[_0x07b1('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x07b1('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 50c34ea..1253ae5 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 _0x85d0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x85d0,0x164));var _0x085d=function(_0x128104,_0x1667f1){_0x128104=_0x128104-0x0;var _0x5d5a74=_0x85d0[_0x128104];return _0x5d5a74;};'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(_0x085d('0x0'));var moment=require(_0x085d('0x1'));var BPromise=require(_0x085d('0x2'));var Mustache=require(_0x085d('0x3'));var util=require(_0x085d('0x4'));var path=require(_0x085d('0x5'));var sox=require('sox');var csv=require(_0x085d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085d('0x7'));var _=require(_0x085d('0x8'));var squel=require(_0x085d('0x9'));var crypto=require('crypto');var jsforce=require(_0x085d('0xa'));var deskjs=require(_0x085d('0xb'));var toCsv=require(_0x085d('0x6'));var querystring=require(_0x085d('0xc'));var Papa=require(_0x085d('0xd'));var Redis=require(_0x085d('0xe'));var authService=require(_0x085d('0xf'));var qs=require(_0x085d('0x10'));var as=require(_0x085d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x085d('0x12'))(_0x085d('0x13'));var utils=require(_0x085d('0x14'));var config=require(_0x085d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x085d('0x16'))['db'];function respondWithStatusCode(_0x2bd6ae,_0x5c6c27){_0x5c6c27=_0x5c6c27||0xcc;return function(_0x2e0714){if(_0x2e0714){return _0x2bd6ae[_0x085d('0x17')](_0x5c6c27);}return _0x2bd6ae[_0x085d('0x18')](_0x5c6c27)[_0x085d('0x19')]();};}function respondWithResult(_0x5a5252,_0x4b87b9){_0x4b87b9=_0x4b87b9||0xc8;return function(_0x19ce18){if(_0x19ce18){return _0x5a5252['status'](_0x4b87b9)['json'](_0x19ce18);}};}function respondWithFilteredResult(_0x267374,_0x334263){return function(_0x1d041b){if(_0x1d041b){var _0x5f8e18=typeof _0x334263[_0x085d('0x1a')]==='undefined'&&typeof _0x334263[_0x085d('0x1b')]===_0x085d('0x1c');var _0x1efea9=_0x1d041b[_0x085d('0x1d')];var _0x3e566f=_0x5f8e18?0x0:_0x334263[_0x085d('0x1a')];var _0x5c046e=_0x5f8e18?_0x1d041b[_0x085d('0x1d')]:_0x334263[_0x085d('0x1a')]+_0x334263['limit'];var _0xba531c;if(_0x5c046e>=_0x1efea9){_0x5c046e=_0x1efea9;_0xba531c=0xc8;}else{_0xba531c=0xce;}_0x267374[_0x085d('0x18')](_0xba531c);return _0x267374[_0x085d('0x1e')](_0x085d('0x1f'),_0x3e566f+'-'+_0x5c046e+'/'+_0x1efea9)[_0x085d('0x20')](_0x1d041b);}return null;};}function patchUpdates(_0x54eff1){return function(_0xb9d0ad){try{jsonpatch[_0x085d('0x21')](_0xb9d0ad,_0x54eff1,!![]);}catch(_0x39a85e){return BPromise[_0x085d('0x22')](_0x39a85e);}return _0xb9d0ad['save']();};}function saveUpdates(_0x5b3f9c,_0x4cdb11){return function(_0x2b7cdc){if(_0x2b7cdc){return _0x2b7cdc[_0x085d('0x23')](_0x5b3f9c)[_0x085d('0x24')](function(_0x10aa9d){return _0x10aa9d;});}return null;};}function removeEntity(_0x4715d6,_0x17dafb){return function(_0x576d95){if(_0x576d95){return _0x576d95[_0x085d('0x25')]()[_0x085d('0x24')](function(){_0x4715d6[_0x085d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cddc,_0x290658){return function(_0xbacfbc){if(!_0xbacfbc){_0x38cddc[_0x085d('0x17')](0x194);}return _0xbacfbc;};}function handleError(_0x300295,_0x4b9032){_0x4b9032=_0x4b9032||0x1f4;return function(_0x5e5228){logger['error'](_0x5e5228[_0x085d('0x26')]);if(_0x5e5228[_0x085d('0x27')]){delete _0x5e5228[_0x085d('0x27')];}_0x300295['status'](_0x4b9032)[_0x085d('0x28')](_0x5e5228);};}exports[_0x085d('0x29')]=function(_0x3faf6b,_0x5c7849){var _0x2f670c={},_0x2eae2c={},_0x3f905d={'count':0x0,'rows':[]};var _0x26aa90=_['map'](db[_0x085d('0x2a')][_0x085d('0x2b')],function(_0x494070){return{'name':_0x494070[_0x085d('0x2c')],'type':_0x494070[_0x085d('0x2d')]['key']};});_0x2eae2c[_0x085d('0x2e')]=_[_0x085d('0x2f')](_0x26aa90,_0x085d('0x27'));_0x2eae2c['query']=_[_0x085d('0x30')](_0x3faf6b[_0x085d('0x31')]);_0x2eae2c[_0x085d('0x32')]=_['intersection'](_0x2eae2c[_0x085d('0x2e')],_0x2eae2c['query']);_0x2f670c[_0x085d('0x33')]=_[_0x085d('0x34')](_0x2eae2c[_0x085d('0x2e')],qs[_0x085d('0x35')](_0x3faf6b['query'][_0x085d('0x35')]));_0x2f670c[_0x085d('0x33')]=_0x2f670c[_0x085d('0x33')][_0x085d('0x36')]?_0x2f670c['attributes']:_0x2eae2c['model'];if(!_0x3faf6b[_0x085d('0x31')][_0x085d('0x37')](_0x085d('0x38'))){_0x2f670c[_0x085d('0x1b')]=qs[_0x085d('0x1b')](_0x3faf6b[_0x085d('0x31')][_0x085d('0x1b')]);_0x2f670c[_0x085d('0x1a')]=qs[_0x085d('0x1a')](_0x3faf6b['query'][_0x085d('0x1a')]);}_0x2f670c[_0x085d('0x39')]=qs['sort'](_0x3faf6b[_0x085d('0x31')]['sort']);_0x2f670c[_0x085d('0x3a')]=qs[_0x085d('0x32')](_['pick'](_0x3faf6b[_0x085d('0x31')],_0x2eae2c[_0x085d('0x32')]),_0x26aa90);if(_0x3faf6b[_0x085d('0x31')][_0x085d('0x3b')]){_0x2f670c[_0x085d('0x3a')]=_['merge'](_0x2f670c[_0x085d('0x3a')],{'$or':_['map'](_0x26aa90,function(_0x5d52be){if(_0x5d52be[_0x085d('0x2d')]!==_0x085d('0x3c')){var _0x31ee22={};_0x31ee22[_0x5d52be[_0x085d('0x27')]]={'$like':'%'+_0x3faf6b[_0x085d('0x31')]['filter']+'%'};return _0x31ee22;}})});}_0x2f670c=_[_0x085d('0x3d')]({},_0x2f670c,_0x3faf6b['options']);var _0x3a8646={'where':_0x2f670c[_0x085d('0x3a')]};return db[_0x085d('0x2a')]['count'](_0x3a8646)[_0x085d('0x24')](function(_0x55d81a){_0x3f905d[_0x085d('0x1d')]=_0x55d81a;if(_0x3faf6b[_0x085d('0x31')]['includeAll']){_0x2f670c[_0x085d('0x3e')]=[{'all':!![]}];}return db[_0x085d('0x2a')][_0x085d('0x3f')](_0x2f670c);})['then'](function(_0x56428e){_0x3f905d[_0x085d('0x40')]=_0x56428e;return _0x3f905d;})[_0x085d('0x24')](respondWithFilteredResult(_0x5c7849,_0x2f670c))[_0x085d('0x41')](handleError(_0x5c7849,null));};exports[_0x085d('0x42')]=function(_0x177f7d,_0x367a32){var _0x27e1c7={'raw':!![],'where':{'id':_0x177f7d[_0x085d('0x43')]['id']}},_0x120980={};_0x120980[_0x085d('0x2e')]=_['keys'](db['Cdr'][_0x085d('0x2b')]);_0x120980[_0x085d('0x31')]=_[_0x085d('0x30')](_0x177f7d[_0x085d('0x31')]);_0x120980[_0x085d('0x32')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],_0x120980[_0x085d('0x31')]);_0x27e1c7[_0x085d('0x33')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],qs['fields'](_0x177f7d[_0x085d('0x31')][_0x085d('0x35')]));_0x27e1c7[_0x085d('0x33')]=_0x27e1c7[_0x085d('0x33')][_0x085d('0x36')]?_0x27e1c7['attributes']:_0x120980[_0x085d('0x2e')];if(_0x177f7d['query'][_0x085d('0x44')]){_0x27e1c7['include']=[{'all':!![]}];}_0x27e1c7=_['merge']({},_0x27e1c7,_0x177f7d[_0x085d('0x45')]);return db[_0x085d('0x2a')][_0x085d('0x46')](_0x27e1c7)[_0x085d('0x24')](handleEntityNotFound(_0x367a32,null))[_0x085d('0x24')](respondWithResult(_0x367a32,null))['catch'](handleError(_0x367a32,null));};exports['create']=function(_0x547723,_0x580b91){return db['Cdr'][_0x085d('0x47')](_0x547723[_0x085d('0x48')],{})['then'](respondWithResult(_0x580b91,0xc9))[_0x085d('0x41')](handleError(_0x580b91,null));};exports['update']=function(_0x5df4cf,_0x415a4b){if(_0x5df4cf[_0x085d('0x48')]['id']){delete _0x5df4cf[_0x085d('0x48')]['id'];}return db[_0x085d('0x2a')]['find']({'where':{'id':_0x5df4cf[_0x085d('0x43')]['id']}})['then'](handleEntityNotFound(_0x415a4b,null))[_0x085d('0x24')](saveUpdates(_0x5df4cf[_0x085d('0x48')],null))['then'](respondWithResult(_0x415a4b,null))[_0x085d('0x41')](handleError(_0x415a4b,null));};exports[_0x085d('0x25')]=function(_0x298f6f,_0x37b56c){return db['Cdr'][_0x085d('0x46')]({'where':{'id':_0x298f6f['params']['id']}})[_0x085d('0x24')](handleEntityNotFound(_0x37b56c,null))['then'](removeEntity(_0x37b56c,null))['catch'](handleError(_0x37b56c,null));};exports[_0x085d('0x49')]=function(_0x41e3e0,_0x236368){return db[_0x085d('0x2a')][_0x085d('0x49')]()[_0x085d('0x24')](respondWithResult(_0x236368,null))[_0x085d('0x41')](handleError(_0x236368,null));}; \ No newline at end of file +var _0xcb66=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','end','name','send','index','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','find','create','body','catch','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0xcb66,0x19f));var _0x6cb6=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0xcb66[_0x4db46b];return _0x565be8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cb6('0x0'));var zipdir=require(_0x6cb6('0x1'));var jsonpatch=require(_0x6cb6('0x2'));var rp=require(_0x6cb6('0x3'));var moment=require(_0x6cb6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6cb6('0x5'));var util=require(_0x6cb6('0x6'));var path=require(_0x6cb6('0x7'));var sox=require(_0x6cb6('0x8'));var csv=require(_0x6cb6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cb6('0xa'));var squel=require(_0x6cb6('0xb'));var crypto=require(_0x6cb6('0xc'));var jsforce=require(_0x6cb6('0xd'));var deskjs=require(_0x6cb6('0xe'));var toCsv=require(_0x6cb6('0x9'));var querystring=require(_0x6cb6('0xf'));var Papa=require(_0x6cb6('0x10'));var Redis=require(_0x6cb6('0x11'));var authService=require(_0x6cb6('0x12'));var qs=require(_0x6cb6('0x13'));var as=require(_0x6cb6('0x14'));var hardwareService=require(_0x6cb6('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6cb6('0x16'));var db=require(_0x6cb6('0x17'))['db'];function respondWithStatusCode(_0xad49d9,_0x2604e7){_0x2604e7=_0x2604e7||0xcc;return function(_0x585233){if(_0x585233){return _0xad49d9[_0x6cb6('0x18')](_0x2604e7);}return _0xad49d9[_0x6cb6('0x19')](_0x2604e7)['end']();};}function respondWithResult(_0x1e5468,_0x14a581){_0x14a581=_0x14a581||0xc8;return function(_0x5af476){if(_0x5af476){return _0x1e5468[_0x6cb6('0x19')](_0x14a581)[_0x6cb6('0x1a')](_0x5af476);}};}function respondWithFilteredResult(_0x492629,_0x5ab865){return function(_0x505b4d){if(_0x505b4d){var _0x5dd4cd=typeof _0x5ab865[_0x6cb6('0x1b')]===_0x6cb6('0x1c')&&typeof _0x5ab865[_0x6cb6('0x1d')]===_0x6cb6('0x1c');var _0x432e48=_0x505b4d[_0x6cb6('0x1e')];var _0x5b8a17=_0x5dd4cd?0x0:_0x5ab865[_0x6cb6('0x1b')];var _0xc0bdea=_0x5dd4cd?_0x505b4d['count']:_0x5ab865['offset']+_0x5ab865['limit'];var _0x5b5dab;if(_0xc0bdea>=_0x432e48){_0xc0bdea=_0x432e48;_0x5b5dab=0xc8;}else{_0x5b5dab=0xce;}_0x492629['status'](_0x5b5dab);return _0x492629['set'](_0x6cb6('0x1f'),_0x5b8a17+'-'+_0xc0bdea+'/'+_0x432e48)[_0x6cb6('0x1a')](_0x505b4d);}return null;};}function patchUpdates(_0x407455){return function(_0x2d41c4){try{jsonpatch[_0x6cb6('0x20')](_0x2d41c4,_0x407455,!![]);}catch(_0x5e14c8){return BPromise['reject'](_0x5e14c8);}return _0x2d41c4[_0x6cb6('0x21')]();};}function saveUpdates(_0x1d35d1,_0x1c4bcd){return function(_0x153915){if(_0x153915){return _0x153915['update'](_0x1d35d1)[_0x6cb6('0x22')](function(_0x19837e){return _0x19837e;});}return null;};}function removeEntity(_0x58a6ed,_0x5ad4f2){return function(_0xea5ee5){if(_0xea5ee5){return _0xea5ee5['destroy']()[_0x6cb6('0x22')](function(){_0x58a6ed[_0x6cb6('0x19')](0xcc)[_0x6cb6('0x23')]();});}};}function handleEntityNotFound(_0x18ecb9,_0x299830){return function(_0x16db1d){if(!_0x16db1d){_0x18ecb9[_0x6cb6('0x18')](0x194);}return _0x16db1d;};}function handleError(_0xcae6af,_0x1cc1ed){_0x1cc1ed=_0x1cc1ed||0x1f4;return function(_0x112e47){logger['error'](_0x112e47['stack']);if(_0x112e47['name']){delete _0x112e47[_0x6cb6('0x24')];}_0xcae6af[_0x6cb6('0x19')](_0x1cc1ed)[_0x6cb6('0x25')](_0x112e47);};}exports[_0x6cb6('0x26')]=function(_0x1f8c9d,_0x3b62e6){var _0x57cd74={},_0x124291={},_0x4d4ad9={'count':0x0,'rows':[]};var _0x2b2c4b=_['map'](db[_0x6cb6('0x27')][_0x6cb6('0x28')],function(_0x32c373){return{'name':_0x32c373['fieldName'],'type':_0x32c373[_0x6cb6('0x29')][_0x6cb6('0x2a')]};});_0x124291[_0x6cb6('0x2b')]=_['map'](_0x2b2c4b,_0x6cb6('0x24'));_0x124291[_0x6cb6('0x2c')]=_[_0x6cb6('0x2d')](_0x1f8c9d['query']);_0x124291[_0x6cb6('0x2e')]=_[_0x6cb6('0x2f')](_0x124291['model'],_0x124291[_0x6cb6('0x2c')]);_0x57cd74[_0x6cb6('0x30')]=_[_0x6cb6('0x2f')](_0x124291[_0x6cb6('0x2b')],qs[_0x6cb6('0x31')](_0x1f8c9d[_0x6cb6('0x2c')][_0x6cb6('0x31')]));_0x57cd74[_0x6cb6('0x30')]=_0x57cd74[_0x6cb6('0x30')][_0x6cb6('0x32')]?_0x57cd74['attributes']:_0x124291[_0x6cb6('0x2b')];if(!_0x1f8c9d[_0x6cb6('0x2c')][_0x6cb6('0x33')](_0x6cb6('0x34'))){_0x57cd74['limit']=qs['limit'](_0x1f8c9d['query'][_0x6cb6('0x1d')]);_0x57cd74[_0x6cb6('0x1b')]=qs[_0x6cb6('0x1b')](_0x1f8c9d[_0x6cb6('0x2c')][_0x6cb6('0x1b')]);}_0x57cd74[_0x6cb6('0x35')]=qs[_0x6cb6('0x36')](_0x1f8c9d[_0x6cb6('0x2c')]['sort']);_0x57cd74[_0x6cb6('0x37')]=qs['filters'](_[_0x6cb6('0x38')](_0x1f8c9d[_0x6cb6('0x2c')],_0x124291[_0x6cb6('0x2e')]),_0x2b2c4b);if(_0x1f8c9d[_0x6cb6('0x2c')][_0x6cb6('0x39')]){_0x57cd74[_0x6cb6('0x37')]=_[_0x6cb6('0x3a')](_0x57cd74['where'],{'$or':_[_0x6cb6('0x3b')](_0x2b2c4b,function(_0x58a304){if(_0x58a304[_0x6cb6('0x29')]!==_0x6cb6('0x3c')){var _0x3bb13d={};_0x3bb13d[_0x58a304['name']]={'$like':'%'+_0x1f8c9d['query'][_0x6cb6('0x39')]+'%'};return _0x3bb13d;}})});}_0x57cd74=_['merge']({},_0x57cd74,_0x1f8c9d[_0x6cb6('0x3d')]);var _0x296a3b={'where':_0x57cd74[_0x6cb6('0x37')]};return db[_0x6cb6('0x27')][_0x6cb6('0x1e')](_0x296a3b)[_0x6cb6('0x22')](function(_0x3652ca){_0x4d4ad9['count']=_0x3652ca;if(_0x1f8c9d[_0x6cb6('0x2c')][_0x6cb6('0x3e')]){_0x57cd74['include']=[{'all':!![]}];}return db[_0x6cb6('0x27')][_0x6cb6('0x3f')](_0x57cd74);})[_0x6cb6('0x22')](function(_0x31a391){_0x4d4ad9[_0x6cb6('0x40')]=_0x31a391;return _0x4d4ad9;})[_0x6cb6('0x22')](respondWithFilteredResult(_0x3b62e6,_0x57cd74))['catch'](handleError(_0x3b62e6,null));};exports['show']=function(_0x1f4e94,_0x5d3770){var _0x588ea4={'raw':!![],'where':{'id':_0x1f4e94['params']['id']}},_0x605673={};_0x605673[_0x6cb6('0x2b')]=_[_0x6cb6('0x2d')](db['Cdr']['rawAttributes']);_0x605673[_0x6cb6('0x2c')]=_['keys'](_0x1f4e94[_0x6cb6('0x2c')]);_0x605673[_0x6cb6('0x2e')]=_['intersection'](_0x605673[_0x6cb6('0x2b')],_0x605673[_0x6cb6('0x2c')]);_0x588ea4['attributes']=_[_0x6cb6('0x2f')](_0x605673['model'],qs[_0x6cb6('0x31')](_0x1f4e94[_0x6cb6('0x2c')]['fields']));_0x588ea4[_0x6cb6('0x30')]=_0x588ea4[_0x6cb6('0x30')]['length']?_0x588ea4['attributes']:_0x605673[_0x6cb6('0x2b')];if(_0x1f4e94[_0x6cb6('0x2c')][_0x6cb6('0x3e')]){_0x588ea4['include']=[{'all':!![]}];}_0x588ea4=_[_0x6cb6('0x3a')]({},_0x588ea4,_0x1f4e94[_0x6cb6('0x3d')]);return db['Cdr'][_0x6cb6('0x41')](_0x588ea4)[_0x6cb6('0x22')](handleEntityNotFound(_0x5d3770,null))[_0x6cb6('0x22')](respondWithResult(_0x5d3770,null))['catch'](handleError(_0x5d3770,null));};exports[_0x6cb6('0x42')]=function(_0x4444a4,_0x42dc72){return db[_0x6cb6('0x27')][_0x6cb6('0x42')](_0x4444a4[_0x6cb6('0x43')],{})['then'](respondWithResult(_0x42dc72,0xc9))[_0x6cb6('0x44')](handleError(_0x42dc72,null));};exports['update']=function(_0x4c3a3a,_0x29cb39){if(_0x4c3a3a[_0x6cb6('0x43')]['id']){delete _0x4c3a3a['body']['id'];}return db[_0x6cb6('0x27')]['find']({'where':{'id':_0x4c3a3a[_0x6cb6('0x45')]['id']}})[_0x6cb6('0x22')](handleEntityNotFound(_0x29cb39,null))[_0x6cb6('0x22')](saveUpdates(_0x4c3a3a['body'],null))[_0x6cb6('0x22')](respondWithResult(_0x29cb39,null))[_0x6cb6('0x44')](handleError(_0x29cb39,null));};exports[_0x6cb6('0x46')]=function(_0x567d52,_0x2668a3){return db['Cdr'][_0x6cb6('0x41')]({'where':{'id':_0x567d52[_0x6cb6('0x45')]['id']}})[_0x6cb6('0x22')](handleEntityNotFound(_0x2668a3,null))['then'](removeEntity(_0x2668a3,null))['catch'](handleError(_0x2668a3,null));};exports[_0x6cb6('0x47')]=function(_0x3dca6c,_0x1d12da){return db['Cdr'][_0x6cb6('0x47')]()[_0x6cb6('0x22')](respondWithResult(_0x1d12da,null))[_0x6cb6('0x44')](handleError(_0x1d12da,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index b47c4ef..4a1a925 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(_0x281023,_0x360d57){var _0x30b440=function(_0x157342){while(--_0x157342){_0x281023['push'](_0x281023['shift']());}};_0x30b440(++_0x360d57);}(_0x7a54,0x106));var _0x47a5=function(_0x5705e9,_0x3c550c){_0x5705e9=_0x5705e9-0x0;var _0x1283c2=_0x7a54[_0x5705e9];return _0x1283c2;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5431d5,_0x580386){var _0x542470=function(_0x2c8969){while(--_0x2c8969){_0x5431d5['push'](_0x5431d5['shift']());}};_0x542470(++_0x580386);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 3db2c04..4655a27 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 _0x4470=['result','catch','lodash','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x58cbdc,_0x16bb11){var _0x5d6f3d=function(_0x539ea7){while(--_0x539ea7){_0x58cbdc['push'](_0x58cbdc['shift']());}};_0x5d6f3d(++_0x16bb11);}(_0x4470,0xda));var _0x0447=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0x4470[_0x146a97];return _0x259d5c;};'use strict';var _=require(_0x0447('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0447('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0447('0x2'))['db'];var utils=require(_0x0447('0x3'));var logger=require('../../config/logger')(_0x0447('0x4'));var config=require(_0x0447('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0447('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eb763,_0x3b049f,_0xbbda8e){return new BPromise(function(_0x10e33d,_0x214e75){return client['request'](_0x1eb763,_0xbbda8e)[_0x0447('0x7')](function(_0xd7f8ac){logger[_0x0447('0x8')](_0x0447('0x9'),_0x3b049f,'request\x20sent');logger[_0x0447('0xa')](_0x0447('0xb'),_0x3b049f,_0x0447('0xc'),JSON['stringify'](_0xd7f8ac));if(_0xd7f8ac['error']){if(_0xd7f8ac[_0x0447('0xd')][_0x0447('0xe')]===0x1f4){logger[_0x0447('0xd')](_0x0447('0x9'),_0x3b049f,_0xd7f8ac[_0x0447('0xd')][_0x0447('0xf')]);return _0x214e75(_0xd7f8ac[_0x0447('0xd')]['message']);}logger[_0x0447('0xd')](_0x0447('0x9'),_0x3b049f,_0xd7f8ac[_0x0447('0xd')][_0x0447('0xf')]);return _0x10e33d(_0xd7f8ac[_0x0447('0xd')]['message']);}else{logger[_0x0447('0x8')]('Cdr,\x20%s,\x20%s',_0x3b049f,_0x0447('0xc'));_0x10e33d(_0xd7f8ac[_0x0447('0x10')]['message']);}})[_0x0447('0x11')](function(_0x93114a){logger['error'](_0x0447('0x9'),_0x3b049f,_0x93114a);_0x214e75(_0x93114a);});});} \ No newline at end of file +var _0xd81d=['lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xd81d,0x1e4));var _0xdd81=function(_0x32f181,_0x2c8c66){_0x32f181=_0x32f181-0x0;var _0x5b4745=_0xd81d[_0x32f181];return _0x5b4745;};'use strict';var _=require(_0xdd81('0x0'));var util=require('util');var moment=require(_0xdd81('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd81('0x3'))['db'];var utils=require(_0xdd81('0x4'));var logger=require(_0xdd81('0x5'))(_0xdd81('0x6'));var config=require(_0xdd81('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd81('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e1c46,_0x26ddc7,_0x5f4af6){return new BPromise(function(_0x603e7a,_0x4c1f1c){return client[_0xdd81('0x9')](_0x1e1c46,_0x5f4af6)[_0xdd81('0xa')](function(_0x338330){logger[_0xdd81('0xb')](_0xdd81('0xc'),_0x26ddc7,_0xdd81('0xd'));logger[_0xdd81('0xe')](_0xdd81('0xf'),_0x26ddc7,_0xdd81('0xd'),JSON[_0xdd81('0x10')](_0x338330));if(_0x338330['error']){if(_0x338330['error'][_0xdd81('0x11')]===0x1f4){logger[_0xdd81('0x12')](_0xdd81('0xc'),_0x26ddc7,_0x338330['error']['message']);return _0x4c1f1c(_0x338330[_0xdd81('0x12')][_0xdd81('0x13')]);}logger[_0xdd81('0x12')](_0xdd81('0xc'),_0x26ddc7,_0x338330[_0xdd81('0x12')][_0xdd81('0x13')]);return _0x603e7a(_0x338330[_0xdd81('0x12')][_0xdd81('0x13')]);}else{logger[_0xdd81('0xb')](_0xdd81('0xc'),_0x26ddc7,'request\x20sent');_0x603e7a(_0x338330[_0xdd81('0x14')][_0xdd81('0x13')]);}})[_0xdd81('0x15')](function(_0x2493cb){logger[_0xdd81('0x12')](_0xdd81('0xc'),_0x26ddc7,_0x2493cb);_0x4c1f1c(_0x2493cb);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index a687bd6..ad79669 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 _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(_0x4a450a,_0x54d42f){var _0x28baf9=function(_0x5cb70a){while(--_0x5cb70a){_0x4a450a['push'](_0x4a450a['shift']());}};_0x28baf9(++_0x54d42f);}(_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('./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 +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(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 09dc367..ff63720 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 _0x11df=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x377844,_0x31eb42){var _0x58ac10=function(_0x2735a7){while(--_0x2735a7){_0x377844['push'](_0x377844['shift']());}};_0x58ac10(++_0x31eb42);}(_0x11df,0x1df));var _0xf11d=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x11df[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0xf11d('0x0'));module[_0xf11d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf11d('0x2')],'allowNull':![],'defaultValue':_0xf11d('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf11d('0x2')]},'interval':{'type':Sequelize[_0xf11d('0x2')],'defaultValue':_0xf11d('0x4')}}; \ No newline at end of file +var _0xb81e=['TEXT','*,*,*,*','STRING','noop'];(function(_0x57c2eb,_0x1a2432){var _0x2d62b4=function(_0x5995f5){while(--_0x5995f5){_0x57c2eb['push'](_0x57c2eb['shift']());}};_0x2d62b4(++_0x1a2432);}(_0xb81e,0xee));var _0xeb81=function(_0x385df1,_0x39ca6c){_0x385df1=_0x385df1-0x0;var _0x3ee07e=_0xb81e[_0x385df1];return _0x3ee07e;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xeb81('0x0')],'allowNull':![],'defaultValue':_0xeb81('0x1')},'appdata':{'type':Sequelize[_0xeb81('0x2')]()},'description':{'type':Sequelize[_0xeb81('0x0')]},'interval':{'type':Sequelize[_0xeb81('0x0')],'defaultValue':_0xeb81('0x3')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 8b97561..009041f 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 _0x9c5e=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','show','params','model','keys','rawAttributes','filters','intersection','query','attributes','fields','includeAll','include','merge','options','ChatApplication','body','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x209ef6,_0x4427da){var _0x50c003=function(_0x1c23bc){while(--_0x1c23bc){_0x209ef6['push'](_0x209ef6['shift']());}};_0x50c003(++_0x4427da);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x2d714a,_0x3a4c1e){_0x2d714a=_0x2d714a-0x0;var _0x2b6ed7=_0x9c5e[_0x2d714a];return _0x2b6ed7;};'use strict';var emlformat=require(_0xe9c5('0x0'));var rimraf=require(_0xe9c5('0x1'));var zipdir=require(_0xe9c5('0x2'));var jsonpatch=require(_0xe9c5('0x3'));var rp=require(_0xe9c5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9c5('0x5'));var path=require(_0xe9c5('0x6'));var sox=require('sox');var csv=require(_0xe9c5('0x7'));var ejs=require(_0xe9c5('0x8'));var fs=require('fs');var fs_extra=require(_0xe9c5('0x9'));var _=require(_0xe9c5('0xa'));var squel=require('squel');var crypto=require(_0xe9c5('0xb'));var jsforce=require(_0xe9c5('0xc'));var deskjs=require(_0xe9c5('0xd'));var toCsv=require(_0xe9c5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9c5('0xe'));var authService=require(_0xe9c5('0xf'));var qs=require(_0xe9c5('0x10'));var as=require(_0xe9c5('0x11'));var hardwareService=require(_0xe9c5('0x12'));var logger=require(_0xe9c5('0x13'))(_0xe9c5('0x14'));var utils=require(_0xe9c5('0x15'));var config=require(_0xe9c5('0x16'));var licenseUtil=require(_0xe9c5('0x17'));var db=require(_0xe9c5('0x18'))['db'];function respondWithStatusCode(_0x27f3e1,_0x471401){_0x471401=_0x471401||0xcc;return function(_0x25ff11){if(_0x25ff11){return _0x27f3e1[_0xe9c5('0x19')](_0x471401);}return _0x27f3e1[_0xe9c5('0x1a')](_0x471401)['end']();};}function respondWithResult(_0x3cce36,_0xe98b11){_0xe98b11=_0xe98b11||0xc8;return function(_0x5eb474){if(_0x5eb474){return _0x3cce36[_0xe9c5('0x1a')](_0xe98b11)[_0xe9c5('0x1b')](_0x5eb474);}};}function respondWithFilteredResult(_0x232584,_0x5d8236){return function(_0x163253){if(_0x163253){var _0x14eb41=typeof _0x5d8236['offset']===_0xe9c5('0x1c')&&typeof _0x5d8236[_0xe9c5('0x1d')]===_0xe9c5('0x1c');var _0x154390=_0x163253[_0xe9c5('0x1e')];var _0x4d9c7d=_0x14eb41?0x0:_0x5d8236[_0xe9c5('0x1f')];var _0x1cecae=_0x14eb41?_0x163253[_0xe9c5('0x1e')]:_0x5d8236[_0xe9c5('0x1f')]+_0x5d8236['limit'];var _0x26492a;if(_0x1cecae>=_0x154390){_0x1cecae=_0x154390;_0x26492a=0xc8;}else{_0x26492a=0xce;}_0x232584[_0xe9c5('0x1a')](_0x26492a);return _0x232584[_0xe9c5('0x20')](_0xe9c5('0x21'),_0x4d9c7d+'-'+_0x1cecae+'/'+_0x154390)[_0xe9c5('0x1b')](_0x163253);}return null;};}function patchUpdates(_0x58fbad){return function(_0x51e860){try{jsonpatch[_0xe9c5('0x22')](_0x51e860,_0x58fbad,!![]);}catch(_0x57818d){return BPromise[_0xe9c5('0x23')](_0x57818d);}return _0x51e860[_0xe9c5('0x24')]();};}function saveUpdates(_0x21b02a,_0x4d16bc){return function(_0x5750ff){if(_0x5750ff){return _0x5750ff[_0xe9c5('0x25')](_0x21b02a)[_0xe9c5('0x26')](function(_0x37fb90){return _0x37fb90;});}return null;};}function removeEntity(_0x189a13,_0x34a7c8){return function(_0x245161){if(_0x245161){return _0x245161[_0xe9c5('0x27')]()[_0xe9c5('0x26')](function(){_0x189a13[_0xe9c5('0x1a')](0xcc)[_0xe9c5('0x28')]();});}};}function handleEntityNotFound(_0x5a3caa,_0x5c8bb7){return function(_0x250e1c){if(!_0x250e1c){_0x5a3caa[_0xe9c5('0x19')](0x194);}return _0x250e1c;};}function handleError(_0x298dca,_0x3bf679){_0x3bf679=_0x3bf679||0x1f4;return function(_0x33fe71){logger[_0xe9c5('0x29')](_0x33fe71['stack']);if(_0x33fe71[_0xe9c5('0x2a')]){delete _0x33fe71['name'];}_0x298dca[_0xe9c5('0x1a')](_0x3bf679)['send'](_0x33fe71);};}exports[_0xe9c5('0x2b')]=function(_0x2112a6,_0x52d008){var _0x36d145={'raw':!![],'where':{'id':_0x2112a6[_0xe9c5('0x2c')]['id']}},_0x46d253={};_0x46d253[_0xe9c5('0x2d')]=_[_0xe9c5('0x2e')](db['ChatApplication'][_0xe9c5('0x2f')]);_0x46d253['query']=_[_0xe9c5('0x2e')](_0x2112a6['query']);_0x46d253[_0xe9c5('0x30')]=_[_0xe9c5('0x31')](_0x46d253[_0xe9c5('0x2d')],_0x46d253[_0xe9c5('0x32')]);_0x36d145[_0xe9c5('0x33')]=_['intersection'](_0x46d253[_0xe9c5('0x2d')],qs[_0xe9c5('0x34')](_0x2112a6[_0xe9c5('0x32')][_0xe9c5('0x34')]));_0x36d145[_0xe9c5('0x33')]=_0x36d145['attributes']['length']?_0x36d145[_0xe9c5('0x33')]:_0x46d253[_0xe9c5('0x2d')];if(_0x2112a6[_0xe9c5('0x32')][_0xe9c5('0x35')]){_0x36d145[_0xe9c5('0x36')]=[{'all':!![]}];}_0x36d145=_[_0xe9c5('0x37')]({},_0x36d145,_0x2112a6[_0xe9c5('0x38')]);return db[_0xe9c5('0x39')]['find'](_0x36d145)[_0xe9c5('0x26')](handleEntityNotFound(_0x52d008,null))[_0xe9c5('0x26')](respondWithResult(_0x52d008,null))['catch'](handleError(_0x52d008,null));};exports[_0xe9c5('0x25')]=function(_0x4e4828,_0x340905){if(_0x4e4828[_0xe9c5('0x3a')]['id']){delete _0x4e4828[_0xe9c5('0x3a')]['id'];}return db[_0xe9c5('0x39')][_0xe9c5('0x3b')]({'where':{'id':_0x4e4828[_0xe9c5('0x2c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x340905,null))[_0xe9c5('0x26')](saveUpdates(_0x4e4828[_0xe9c5('0x3a')],null))[_0xe9c5('0x26')](respondWithResult(_0x340905,null))[_0xe9c5('0x3c')](handleError(_0x340905,null));};exports[_0xe9c5('0x27')]=function(_0x33680c,_0x3aae58){return db[_0xe9c5('0x39')][_0xe9c5('0x3b')]({'where':{'id':_0x33680c[_0xe9c5('0x2c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x3aae58,null))[_0xe9c5('0x26')](removeEntity(_0x3aae58,null))['catch'](handleError(_0x3aae58,null));}; \ No newline at end of file +var _0x94d2=['destroy','error','stack','name','show','params','model','keys','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','options','ChatApplication','catch','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x5a766f,_0x135d23){var _0xebfcf3=function(_0x1d5bb5){while(--_0x1d5bb5){_0x5a766f['push'](_0x5a766f['shift']());}};_0xebfcf3(++_0x135d23);}(_0x94d2,0x1cd));var _0x294d=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x94d2[_0x1b2ff7];return _0x31656a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x294d('0x0'));var jsonpatch=require(_0x294d('0x1'));var rp=require(_0x294d('0x2'));var moment=require(_0x294d('0x3'));var BPromise=require(_0x294d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x294d('0x5'));var sox=require(_0x294d('0x6'));var csv=require(_0x294d('0x7'));var ejs=require(_0x294d('0x8'));var fs=require('fs');var fs_extra=require(_0x294d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x294d('0xa'));var jsforce=require(_0x294d('0xb'));var deskjs=require(_0x294d('0xc'));var toCsv=require(_0x294d('0x7'));var querystring=require(_0x294d('0xd'));var Papa=require('papaparse');var Redis=require(_0x294d('0xe'));var authService=require(_0x294d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x294d('0x10'));var hardwareService=require(_0x294d('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x294d('0x12'));var config=require(_0x294d('0x13'));var licenseUtil=require(_0x294d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d44ba,_0x3f0f3a){_0x3f0f3a=_0x3f0f3a||0xcc;return function(_0x4119da){if(_0x4119da){return _0x3d44ba[_0x294d('0x15')](_0x3f0f3a);}return _0x3d44ba['status'](_0x3f0f3a)[_0x294d('0x16')]();};}function respondWithResult(_0x49c38f,_0x5adc9c){_0x5adc9c=_0x5adc9c||0xc8;return function(_0xed0e10){if(_0xed0e10){return _0x49c38f[_0x294d('0x17')](_0x5adc9c)[_0x294d('0x18')](_0xed0e10);}};}function respondWithFilteredResult(_0x28f7f6,_0x4bf3ae){return function(_0x42d290){if(_0x42d290){var _0x4fddfe=typeof _0x4bf3ae['offset']==='undefined'&&typeof _0x4bf3ae['limit']===_0x294d('0x19');var _0x15dce0=_0x42d290[_0x294d('0x1a')];var _0x46d9c5=_0x4fddfe?0x0:_0x4bf3ae[_0x294d('0x1b')];var _0x26563e=_0x4fddfe?_0x42d290[_0x294d('0x1a')]:_0x4bf3ae[_0x294d('0x1b')]+_0x4bf3ae['limit'];var _0x3ccc78;if(_0x26563e>=_0x15dce0){_0x26563e=_0x15dce0;_0x3ccc78=0xc8;}else{_0x3ccc78=0xce;}_0x28f7f6[_0x294d('0x17')](_0x3ccc78);return _0x28f7f6['set'](_0x294d('0x1c'),_0x46d9c5+'-'+_0x26563e+'/'+_0x15dce0)[_0x294d('0x18')](_0x42d290);}return null;};}function patchUpdates(_0x429da3){return function(_0xffe147){try{jsonpatch[_0x294d('0x1d')](_0xffe147,_0x429da3,!![]);}catch(_0x31fd1c){return BPromise[_0x294d('0x1e')](_0x31fd1c);}return _0xffe147[_0x294d('0x1f')]();};}function saveUpdates(_0x82ad78,_0x11df11){return function(_0x419717){if(_0x419717){return _0x419717[_0x294d('0x20')](_0x82ad78)[_0x294d('0x21')](function(_0x2b2a1e){return _0x2b2a1e;});}return null;};}function removeEntity(_0x4aa60,_0x524ff2){return function(_0x546a59){if(_0x546a59){return _0x546a59[_0x294d('0x22')]()[_0x294d('0x21')](function(){_0x4aa60[_0x294d('0x17')](0xcc)[_0x294d('0x16')]();});}};}function handleEntityNotFound(_0x1cf383,_0x1ba06c){return function(_0x4da072){if(!_0x4da072){_0x1cf383[_0x294d('0x15')](0x194);}return _0x4da072;};}function handleError(_0x5cac01,_0x4670ae){_0x4670ae=_0x4670ae||0x1f4;return function(_0x233212){logger[_0x294d('0x23')](_0x233212[_0x294d('0x24')]);if(_0x233212[_0x294d('0x25')]){delete _0x233212[_0x294d('0x25')];}_0x5cac01[_0x294d('0x17')](_0x4670ae)['send'](_0x233212);};}exports[_0x294d('0x26')]=function(_0x2b2072,_0x37cf9f){var _0x340ae5={'raw':!![],'where':{'id':_0x2b2072[_0x294d('0x27')]['id']}},_0xdfcde1={};_0xdfcde1[_0x294d('0x28')]=_[_0x294d('0x29')](db['ChatApplication'][_0x294d('0x2a')]);_0xdfcde1[_0x294d('0x2b')]=_[_0x294d('0x29')](_0x2b2072[_0x294d('0x2b')]);_0xdfcde1['filters']=_['intersection'](_0xdfcde1[_0x294d('0x28')],_0xdfcde1[_0x294d('0x2b')]);_0x340ae5[_0x294d('0x2c')]=_[_0x294d('0x2d')](_0xdfcde1[_0x294d('0x28')],qs[_0x294d('0x2e')](_0x2b2072[_0x294d('0x2b')][_0x294d('0x2e')]));_0x340ae5[_0x294d('0x2c')]=_0x340ae5['attributes'][_0x294d('0x2f')]?_0x340ae5[_0x294d('0x2c')]:_0xdfcde1[_0x294d('0x28')];if(_0x2b2072['query'][_0x294d('0x30')]){_0x340ae5[_0x294d('0x31')]=[{'all':!![]}];}_0x340ae5=_['merge']({},_0x340ae5,_0x2b2072[_0x294d('0x32')]);return db[_0x294d('0x33')]['find'](_0x340ae5)['then'](handleEntityNotFound(_0x37cf9f,null))[_0x294d('0x21')](respondWithResult(_0x37cf9f,null))[_0x294d('0x34')](handleError(_0x37cf9f,null));};exports[_0x294d('0x20')]=function(_0x5260a5,_0x37aa78){if(_0x5260a5[_0x294d('0x35')]['id']){delete _0x5260a5[_0x294d('0x35')]['id'];}return db[_0x294d('0x33')][_0x294d('0x36')]({'where':{'id':_0x5260a5[_0x294d('0x27')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x37aa78,null))[_0x294d('0x21')](saveUpdates(_0x5260a5[_0x294d('0x35')],null))[_0x294d('0x21')](respondWithResult(_0x37aa78,null))[_0x294d('0x34')](handleError(_0x37aa78,null));};exports[_0x294d('0x22')]=function(_0x496941,_0x3e9576){return db[_0x294d('0x33')][_0x294d('0x36')]({'where':{'id':_0x496941['params']['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x3e9576,null))[_0x294d('0x21')](removeEntity(_0x3e9576,null))[_0x294d('0x34')](handleError(_0x3e9576,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 76788c6..5fd33a6 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 _0xbc17=['rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path'];(function(_0x382dd1,_0x448bec){var _0x2109bd=function(_0x5e1091){while(--_0x5e1091){_0x382dd1['push'](_0x382dd1['shift']());}};_0x2109bd(++_0x448bec);}(_0xbc17,0x1ab));var _0x7bc1=function(_0xeead8a,_0x3d2400){_0xeead8a=_0xeead8a-0x0;var _0x24742c=_0xbc17[_0xeead8a];return _0x24742c;};'use strict';var _=require(_0x7bc1('0x0'));var util=require(_0x7bc1('0x1'));var logger=require('../../config/logger')(_0x7bc1('0x2'));var moment=require(_0x7bc1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7bc1('0x4'));var rimraf=require(_0x7bc1('0x5'));var config=require('../../config/environment');var attributes=require(_0x7bc1('0x6'));module['exports']=function(_0xba4fa8,_0xcecb62){return _0xba4fa8[_0x7bc1('0x7')](_0x7bc1('0x8'),attributes,{'tableName':_0x7bc1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7bc1('0xa'),'collate':_0x7bc1('0xb')});}; \ No newline at end of file +var _0xe43c=['path','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x52dfb2,_0x1a7a8e){var _0xf5b55b=function(_0x392f19){while(--_0x392f19){_0x52dfb2['push'](_0x52dfb2['shift']());}};_0xf5b55b(++_0x1a7a8e);}(_0xe43c,0x180));var _0xce43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe43c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xce43('0x0'));var util=require(_0xce43('0x1'));var logger=require(_0xce43('0x2'))(_0xce43('0x3'));var moment=require(_0xce43('0x4'));var BPromise=require(_0xce43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce43('0x6'));var rimraf=require('rimraf');var config=require(_0xce43('0x7'));var attributes=require(_0xce43('0x8'));module[_0xce43('0x9')]=function(_0x3557d0,_0x5d6e5c){return _0x3557d0[_0xce43('0xa')]('ChatApplication',attributes,{'tableName':_0xce43('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xce43('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index b0b8c8d..2993889 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 _0xb2f3=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x33d4a2,_0x2baaf4){var _0x2c793f=function(_0x414303){while(--_0x414303){_0x33d4a2['push'](_0x33d4a2['shift']());}};_0x2c793f(++_0x2baaf4);}(_0xb2f3,0xfb));var _0x3b2f=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xb2f3[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3b2f('0x2'));var fs=require('fs');var Redis=require(_0x3b2f('0x3'));var db=require(_0x3b2f('0x4'))['db'];var utils=require(_0x3b2f('0x5'));var logger=require(_0x3b2f('0x6'))(_0x3b2f('0x7'));var config=require(_0x3b2f('0x8'));var jayson=require(_0x3b2f('0x9'));var client=jayson[_0x3b2f('0xa')][_0x3b2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48c8a3,_0x49e8ae,_0x5c517f){return new BPromise(function(_0x2f7653,_0x5ed471){return client[_0x3b2f('0xc')](_0x48c8a3,_0x5c517f)[_0x3b2f('0xd')](function(_0x58a802){logger[_0x3b2f('0xe')](_0x3b2f('0xf'),_0x49e8ae,_0x3b2f('0x10'));logger[_0x3b2f('0x11')](_0x3b2f('0x12'),_0x49e8ae,'request\x20sent',JSON[_0x3b2f('0x13')](_0x58a802));if(_0x58a802[_0x3b2f('0x14')]){if(_0x58a802[_0x3b2f('0x14')][_0x3b2f('0x15')]===0x1f4){logger['error'](_0x3b2f('0xf'),_0x49e8ae,_0x58a802[_0x3b2f('0x14')]['message']);return _0x5ed471(_0x58a802['error']['message']);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x49e8ae,_0x58a802['error'][_0x3b2f('0x16')]);return _0x2f7653(_0x58a802['error'][_0x3b2f('0x16')]);}else{logger[_0x3b2f('0xe')]('ChatApplication,\x20%s,\x20%s',_0x49e8ae,_0x3b2f('0x10'));_0x2f7653(_0x58a802[_0x3b2f('0x17')][_0x3b2f('0x16')]);}})[_0x3b2f('0x18')](function(_0x16e9ea){logger[_0x3b2f('0x14')](_0x3b2f('0xf'),_0x49e8ae,_0x16e9ea);_0x5ed471(_0x16e9ea);});});} \ No newline at end of file +var _0x0f4b=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0f4b,0x99));var _0xb0f4=function(_0x597087,_0x588022){_0x597087=_0x597087-0x0;var _0x29f39c=_0x0f4b[_0x597087];return _0x29f39c;};'use strict';var _=require(_0xb0f4('0x0'));var util=require(_0xb0f4('0x1'));var moment=require(_0xb0f4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0f4('0x3'));var fs=require('fs');var Redis=require(_0xb0f4('0x4'));var db=require(_0xb0f4('0x5'))['db'];var utils=require(_0xb0f4('0x6'));var logger=require(_0xb0f4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb0f4('0x8')][_0xb0f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2606df,_0x584cb3,_0x2d1443){return new BPromise(function(_0xb86859,_0x2cfa11){return client[_0xb0f4('0xa')](_0x2606df,_0x2d1443)[_0xb0f4('0xb')](function(_0x388062){logger[_0xb0f4('0xc')](_0xb0f4('0xd'),_0x584cb3,_0xb0f4('0xe'));logger[_0xb0f4('0xf')](_0xb0f4('0x10'),_0x584cb3,'request\x20sent',JSON[_0xb0f4('0x11')](_0x388062));if(_0x388062[_0xb0f4('0x12')]){if(_0x388062['error'][_0xb0f4('0x13')]===0x1f4){logger[_0xb0f4('0x12')](_0xb0f4('0xd'),_0x584cb3,_0x388062[_0xb0f4('0x12')][_0xb0f4('0x14')]);return _0x2cfa11(_0x388062[_0xb0f4('0x12')][_0xb0f4('0x14')]);}logger['error'](_0xb0f4('0xd'),_0x584cb3,_0x388062[_0xb0f4('0x12')][_0xb0f4('0x14')]);return _0xb86859(_0x388062[_0xb0f4('0x12')][_0xb0f4('0x14')]);}else{logger[_0xb0f4('0xc')](_0xb0f4('0xd'),_0x584cb3,_0xb0f4('0xe'));_0xb86859(_0x388062['result']['message']);}})[_0xb0f4('0x15')](function(_0x494b9b){logger[_0xb0f4('0x12')](_0xb0f4('0xd'),_0x584cb3,_0x494b9b);_0x2cfa11(_0x494b9b);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 1daa62f..0d563f3 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 _0x14cc=['delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','put','isAuthenticated'];(function(_0x77b4a4,_0xbdb59d){var _0x3f0d95=function(_0x196d79){while(--_0x196d79){_0x77b4a4['push'](_0x77b4a4['shift']());}};_0x3f0d95(++_0xbdb59d);}(_0x14cc,0xa7));var _0xc14c=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0x14cc[_0x11e03f];return _0x5666fe;};'use strict';var multer=require(_0xc14c('0x0'));var util=require(_0xc14c('0x1'));var path=require('path');var timeout=require(_0xc14c('0x2'));var express=require('express');var router=express[_0xc14c('0x3')]();var fs_extra=require(_0xc14c('0x4'));var auth=require(_0xc14c('0x5'));var interaction=require(_0xc14c('0x6'));var config=require(_0xc14c('0x7'));var controller=require('./chatApplication.controller');router[_0xc14c('0x8')](_0xc14c('0x9'),auth['isAuthenticated'](),controller[_0xc14c('0xa')]);router[_0xc14c('0xb')](_0xc14c('0x9'),auth[_0xc14c('0xc')](),controller['update']);router[_0xc14c('0xd')](_0xc14c('0x9'),auth[_0xc14c('0xc')](),controller['destroy']);module[_0xc14c('0xe')]=router; \ No newline at end of file +var _0xc865=['./chatApplication.controller','get','/:id','isAuthenticated','update','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1e97e9,_0x19fa53){var _0x15555d=function(_0x112663){while(--_0x112663){_0x1e97e9['push'](_0x1e97e9['shift']());}};_0x15555d(++_0x19fa53);}(_0xc865,0x1c3));var _0x5c86=function(_0x207c70,_0x503f52){_0x207c70=_0x207c70-0x0;var _0x33f5df=_0xc865[_0x207c70];return _0x33f5df;};'use strict';var multer=require('multer');var util=require(_0x5c86('0x0'));var path=require('path');var timeout=require(_0x5c86('0x1'));var express=require(_0x5c86('0x2'));var router=express[_0x5c86('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5c86('0x4'));var config=require('../../config/environment');var controller=require(_0x5c86('0x5'));router[_0x5c86('0x6')](_0x5c86('0x7'),auth[_0x5c86('0x8')](),controller['show']);router['put'](_0x5c86('0x7'),auth['isAuthenticated'](),controller[_0x5c86('0x9')]);router[_0x5c86('0xa')](_0x5c86('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x5c86('0xb')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index cfa4453..95f10d6 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 _0x6829=['sequelize','exports'];(function(_0xe58f48,_0x3cf2ea){var _0x3297bc=function(_0xf46e13){while(--_0xf46e13){_0xe58f48['push'](_0xe58f48['shift']());}};_0x3297bc(++_0x3cf2ea);}(_0x6829,0x14c));var _0x9682=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6829[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x9682('0x0'));module[_0x9682('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x782b=['BOOLEAN','STRING'];(function(_0x47de9a,_0x40cf23){var _0x4b9d6c=function(_0x507054){while(--_0x507054){_0x47de9a['push'](_0x47de9a['shift']());}};_0x4b9d6c(++_0x40cf23);}(_0x782b,0x89));var _0xb782=function(_0x5c0d9a,_0x15d908){_0x5c0d9a=_0x5c0d9a-0x0;var _0x35a6ed=_0x782b[_0x5c0d9a];return _0x35a6ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb782('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb782('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 332719c..eaf7ed0 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 _0x5eea=['ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','end','sendStatus','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','ChatInternalMessage','user','addMembers'];(function(_0x2af627,_0x33d47f){var _0x14eda9=function(_0x38679a){while(--_0x38679a){_0x2af627['push'](_0x2af627['shift']());}};_0x14eda9(++_0x33d47f);}(_0x5eea,0x12c));var _0xa5ee=function(_0x5807d5,_0x96e4b){_0x5807d5=_0x5807d5-0x0;var _0x15aa80=_0x5eea[_0x5807d5];return _0x15aa80;};'use strict';var emlformat=require(_0xa5ee('0x0'));var rimraf=require(_0xa5ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa5ee('0x2'));var rp=require(_0xa5ee('0x3'));var moment=require(_0xa5ee('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa5ee('0x5'));var sox=require(_0xa5ee('0x6'));var csv=require(_0xa5ee('0x7'));var ejs=require(_0xa5ee('0x8'));var fs=require('fs');var fs_extra=require(_0xa5ee('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa5ee('0xa'));var jsforce=require(_0xa5ee('0xb'));var deskjs=require(_0xa5ee('0xc'));var toCsv=require(_0xa5ee('0x7'));var querystring=require(_0xa5ee('0xd'));var Papa=require(_0xa5ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa5ee('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa5ee('0x10'));var hardwareService=require(_0xa5ee('0x11'));var logger=require(_0xa5ee('0x12'))('api');var utils=require(_0xa5ee('0x13'));var config=require(_0xa5ee('0x14'));var licenseUtil=require(_0xa5ee('0x15'));var db=require(_0xa5ee('0x16'))['db'];config['redis']=_[_0xa5ee('0x17')](config[_0xa5ee('0x18')],{'host':_0xa5ee('0x19'),'port':0x18eb});var socket=require(_0xa5ee('0x1a'))(new Redis(config['redis']));require(_0xa5ee('0x1b'))[_0xa5ee('0x1c')](socket);function respondWithStatusCode(_0x47f772,_0x5f3774){_0x5f3774=_0x5f3774||0xcc;return function(_0x725bd){if(_0x725bd){return _0x47f772['sendStatus'](_0x5f3774);}return _0x47f772[_0xa5ee('0x1d')](_0x5f3774)['end']();};}function respondWithResult(_0x2ad95f,_0x561ff4){_0x561ff4=_0x561ff4||0xc8;return function(_0x270e11){if(_0x270e11){return _0x2ad95f[_0xa5ee('0x1d')](_0x561ff4)['json'](_0x270e11);}};}function respondWithFilteredResult(_0x15ab57,_0x4e5043){return function(_0x292c4f){if(_0x292c4f){var _0x3a56a6=typeof _0x4e5043['offset']===_0xa5ee('0x1e')&&typeof _0x4e5043[_0xa5ee('0x1f')]==='undefined';var _0x3a5c5f=_0x292c4f[_0xa5ee('0x20')];var _0x11a8ca=_0x3a56a6?0x0:_0x4e5043[_0xa5ee('0x21')];var _0x57e46b=_0x3a56a6?_0x292c4f[_0xa5ee('0x20')]:_0x4e5043['offset']+_0x4e5043['limit'];var _0xdec5;if(_0x57e46b>=_0x3a5c5f){_0x57e46b=_0x3a5c5f;_0xdec5=0xc8;}else{_0xdec5=0xce;}_0x15ab57[_0xa5ee('0x1d')](_0xdec5);return _0x15ab57[_0xa5ee('0x22')](_0xa5ee('0x23'),_0x11a8ca+'-'+_0x57e46b+'/'+_0x3a5c5f)[_0xa5ee('0x24')](_0x292c4f);}return null;};}function patchUpdates(_0x3f45d3){return function(_0x5af67d){try{jsonpatch[_0xa5ee('0x25')](_0x5af67d,_0x3f45d3,!![]);}catch(_0x4bf73b){return BPromise[_0xa5ee('0x26')](_0x4bf73b);}return _0x5af67d[_0xa5ee('0x27')]();};}function saveUpdates(_0x2c2f30,_0x32f9b8){return function(_0x467771){if(_0x467771){return _0x467771['update'](_0x2c2f30)[_0xa5ee('0x28')](function(_0x4af839){return _0x4af839;});}return null;};}function removeEntity(_0x556594,_0x3c9456){return function(_0x564cc0){if(_0x564cc0){return _0x564cc0[_0xa5ee('0x29')]()['then'](function(){_0x556594[_0xa5ee('0x1d')](0xcc)[_0xa5ee('0x2a')]();});}};}function handleEntityNotFound(_0x1d9b54,_0x46ec83){return function(_0x52395a){if(!_0x52395a){_0x1d9b54[_0xa5ee('0x2b')](0x194);}return _0x52395a;};}function handleError(_0x332ebe,_0x2056de){_0x2056de=_0x2056de||0x1f4;return function(_0x375192){logger['error'](_0x375192[_0xa5ee('0x2c')]);if(_0x375192[_0xa5ee('0x2d')]){delete _0x375192[_0xa5ee('0x2d')];}_0x332ebe[_0xa5ee('0x1d')](_0x2056de)[_0xa5ee('0x2e')](_0x375192);};}exports[_0xa5ee('0x2f')]=function(_0x722c,_0x11907c){var _0x4f7842={},_0x3e3e04={},_0x2f7433={'count':0x0,'rows':[]};var _0x95753a=_[_0xa5ee('0x30')](db[_0xa5ee('0x31')][_0xa5ee('0x32')],function(_0x519607){return{'name':_0x519607['fieldName'],'type':_0x519607[_0xa5ee('0x33')][_0xa5ee('0x34')]};});_0x3e3e04[_0xa5ee('0x35')]=_[_0xa5ee('0x30')](_0x95753a,'name');_0x3e3e04[_0xa5ee('0x36')]=_[_0xa5ee('0x37')](_0x722c[_0xa5ee('0x36')]);_0x3e3e04[_0xa5ee('0x38')]=_['intersection'](_0x3e3e04[_0xa5ee('0x35')],_0x3e3e04[_0xa5ee('0x36')]);_0x4f7842[_0xa5ee('0x39')]=_[_0xa5ee('0x3a')](_0x3e3e04[_0xa5ee('0x35')],qs[_0xa5ee('0x3b')](_0x722c[_0xa5ee('0x36')][_0xa5ee('0x3b')]));_0x4f7842['attributes']=_0x4f7842[_0xa5ee('0x39')][_0xa5ee('0x3c')]?_0x4f7842[_0xa5ee('0x39')]:_0x3e3e04[_0xa5ee('0x35')];if(!_0x722c[_0xa5ee('0x36')][_0xa5ee('0x3d')](_0xa5ee('0x3e'))){_0x4f7842[_0xa5ee('0x1f')]=qs['limit'](_0x722c[_0xa5ee('0x36')][_0xa5ee('0x1f')]);_0x4f7842[_0xa5ee('0x21')]=qs[_0xa5ee('0x21')](_0x722c['query']['offset']);}_0x4f7842[_0xa5ee('0x3f')]=qs['sort'](_0x722c[_0xa5ee('0x36')][_0xa5ee('0x40')]);_0x4f7842[_0xa5ee('0x41')]=qs[_0xa5ee('0x38')](_[_0xa5ee('0x42')](_0x722c[_0xa5ee('0x36')],_0x3e3e04[_0xa5ee('0x38')]),_0x95753a);if(_0x722c[_0xa5ee('0x36')][_0xa5ee('0x43')]){_0x4f7842[_0xa5ee('0x41')]=_['merge'](_0x4f7842[_0xa5ee('0x41')],{'$or':_[_0xa5ee('0x30')](_0x95753a,function(_0x1a4705){if(_0x1a4705[_0xa5ee('0x33')]!==_0xa5ee('0x44')){var _0xb2a4fa={};_0xb2a4fa[_0x1a4705[_0xa5ee('0x2d')]]={'$like':'%'+_0x722c[_0xa5ee('0x36')][_0xa5ee('0x43')]+'%'};return _0xb2a4fa;}})});}_0x4f7842=_[_0xa5ee('0x45')]({},_0x4f7842,_0x722c['options']);var _0x33654d={'where':_0x4f7842[_0xa5ee('0x41')]};return db[_0xa5ee('0x31')][_0xa5ee('0x20')](_0x33654d)['then'](function(_0x4907d4){_0x2f7433[_0xa5ee('0x20')]=_0x4907d4;if(_0x722c['query'][_0xa5ee('0x46')]){_0x4f7842[_0xa5ee('0x47')]=[{'all':!![]}];}return db[_0xa5ee('0x31')][_0xa5ee('0x48')](_0x4f7842);})[_0xa5ee('0x28')](function(_0x22d739){_0x2f7433['rows']=_0x22d739;return _0x2f7433;})[_0xa5ee('0x28')](respondWithFilteredResult(_0x11907c,_0x4f7842))[_0xa5ee('0x49')](handleError(_0x11907c,null));};exports[_0xa5ee('0x4a')]=function(_0x23571c,_0x53c86a){var _0x54bb96={'raw':!![],'where':{'id':_0x23571c[_0xa5ee('0x4b')]['id']}},_0x3b6e2d={};_0x3b6e2d[_0xa5ee('0x35')]=_[_0xa5ee('0x37')](db[_0xa5ee('0x31')][_0xa5ee('0x32')]);_0x3b6e2d[_0xa5ee('0x36')]=_[_0xa5ee('0x37')](_0x23571c[_0xa5ee('0x36')]);_0x3b6e2d['filters']=_[_0xa5ee('0x3a')](_0x3b6e2d['model'],_0x3b6e2d['query']);_0x54bb96[_0xa5ee('0x39')]=_[_0xa5ee('0x3a')](_0x3b6e2d[_0xa5ee('0x35')],qs[_0xa5ee('0x3b')](_0x23571c[_0xa5ee('0x36')][_0xa5ee('0x3b')]));_0x54bb96[_0xa5ee('0x39')]=_0x54bb96[_0xa5ee('0x39')][_0xa5ee('0x3c')]?_0x54bb96[_0xa5ee('0x39')]:_0x3b6e2d['model'];if(_0x23571c['query'][_0xa5ee('0x46')]){_0x54bb96[_0xa5ee('0x47')]=[{'all':!![]}];}_0x54bb96=_[_0xa5ee('0x45')]({},_0x54bb96,_0x23571c[_0xa5ee('0x4c')]);return db[_0xa5ee('0x31')][_0xa5ee('0x4d')](_0x54bb96)[_0xa5ee('0x28')](handleEntityNotFound(_0x53c86a,null))[_0xa5ee('0x28')](respondWithResult(_0x53c86a,null))[_0xa5ee('0x49')](handleError(_0x53c86a,null));};exports[_0xa5ee('0x4e')]=function(_0x5340b4,_0x59ffa3){return db[_0xa5ee('0x31')][_0xa5ee('0x4e')](_0x5340b4[_0xa5ee('0x4f')],{})[_0xa5ee('0x28')](respondWithResult(_0x59ffa3,0xc9))['catch'](handleError(_0x59ffa3,null));};exports['update']=function(_0x525ca9,_0x467ab6){if(_0x525ca9[_0xa5ee('0x4f')]['id']){delete _0x525ca9['body']['id'];}return db[_0xa5ee('0x31')]['find']({'where':{'id':_0x525ca9['params']['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x467ab6,null))[_0xa5ee('0x28')](saveUpdates(_0x525ca9[_0xa5ee('0x4f')],null))[_0xa5ee('0x28')](respondWithResult(_0x467ab6,null))[_0xa5ee('0x49')](handleError(_0x467ab6,null));};exports[_0xa5ee('0x29')]=function(_0x16b7f3,_0x99d2a6){return db[_0xa5ee('0x31')][_0xa5ee('0x4d')]({'where':{'id':_0x16b7f3['params']['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x99d2a6,null))[_0xa5ee('0x28')](removeEntity(_0x99d2a6,null))[_0xa5ee('0x49')](handleError(_0x99d2a6,null));};exports['describe']=function(_0x5e2299,_0x390d13){return db[_0xa5ee('0x31')][_0xa5ee('0x50')]()[_0xa5ee('0x28')](respondWithResult(_0x390d13,null))[_0xa5ee('0x49')](handleError(_0x390d13,null));};exports['getUnread']=function(_0x3f61a8,_0x3b3ebe,_0x426dcf){return db[_0xa5ee('0x51')][_0xa5ee('0x20')]({'where':{'ChatGroupId':_0x3f61a8[_0xa5ee('0x4b')]['id'],'ToId':_0x3f61a8[_0xa5ee('0x52')]['id'],'read':![]}})[_0xa5ee('0x28')](function(_0x55949b){return{'id':_['toInteger'](_0x3f61a8['params']['id']),'count':_0x55949b};})['then'](respondWithResult(_0x3b3ebe,null))['catch'](handleError(_0x3b3ebe,null));};exports[_0xa5ee('0x53')]=function(_0x2a7614,_0x1dce9e,_0xfa5668){return db[_0xa5ee('0x31')][_0xa5ee('0x4d')]({'where':{'id':_0x2a7614['params']['id']}})['then'](handleEntityNotFound(_0x1dce9e,null))['then'](function(_0x389a5b){if(_0x389a5b){return _0x389a5b[_0xa5ee('0x53')](_0x2a7614[_0xa5ee('0x4f')][_0xa5ee('0x54')],_[_0xa5ee('0x55')](_0x2a7614[_0xa5ee('0x4f')],[_0xa5ee('0x54'),'id'])||{});}})[_0xa5ee('0x28')](respondWithResult(_0x1dce9e,null))[_0xa5ee('0x49')](handleError(_0x1dce9e,null));};exports[_0xa5ee('0x56')]=function(_0x31f605,_0x5b6ad0,_0x1643d4){var _0x2f8f01={};var _0x291e82={};var _0xe73c8a;var _0x28d05c;return db['ChatGroup'][_0xa5ee('0x57')]({'where':{'id':_0x31f605['params']['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x5b6ad0,null))['then'](function(_0x4a2428){if(_0x4a2428){_0xe73c8a=_0x4a2428;_0x291e82[_0xa5ee('0x35')]=_['keys'](db[_0xa5ee('0x58')]['rawAttributes']);_0x291e82[_0xa5ee('0x36')]=_['keys'](_0x31f605['query']);_0x291e82[_0xa5ee('0x38')]=_[_0xa5ee('0x3a')](_0x291e82[_0xa5ee('0x35')],_0x291e82[_0xa5ee('0x36')]);_0x2f8f01['attributes']=_[_0xa5ee('0x3a')](_0x291e82[_0xa5ee('0x35')],qs[_0xa5ee('0x3b')](_0x31f605['query'][_0xa5ee('0x3b')]));_0x2f8f01[_0xa5ee('0x39')]=_0x2f8f01[_0xa5ee('0x39')][_0xa5ee('0x3c')]?_0x2f8f01[_0xa5ee('0x39')]:_0x291e82['model'];_0x2f8f01[_0xa5ee('0x3f')]=qs[_0xa5ee('0x40')](_0x31f605[_0xa5ee('0x36')][_0xa5ee('0x40')]);_0x2f8f01[_0xa5ee('0x41')]=qs[_0xa5ee('0x38')](_[_0xa5ee('0x42')](_0x31f605[_0xa5ee('0x36')],_0x291e82['filters']));if(_0x31f605['query'][_0xa5ee('0x43')]){_0x2f8f01['where']=_[_0xa5ee('0x45')](_0x2f8f01['where'],{'$or':_[_0xa5ee('0x30')](_0x2f8f01[_0xa5ee('0x39')],function(_0x4d796f){var _0x72f77={};_0x72f77[_0x4d796f]={'$like':'%'+_0x31f605[_0xa5ee('0x36')][_0xa5ee('0x43')]+'%'};return _0x72f77;})});}_0x2f8f01=_[_0xa5ee('0x45')]({},_0x2f8f01,_0x31f605[_0xa5ee('0x4c')]);return _0xe73c8a[_0xa5ee('0x56')](_0x2f8f01);}})[_0xa5ee('0x28')](function(_0x561b4f){if(_0x561b4f){_0x28d05c=_0x561b4f[_0xa5ee('0x3c')];if(!_0x31f605[_0xa5ee('0x36')]['hasOwnProperty'](_0xa5ee('0x3e'))){_0x2f8f01['limit']=qs[_0xa5ee('0x1f')](_0x31f605['query']['limit']);_0x2f8f01['offset']=qs[_0xa5ee('0x21')](_0x31f605[_0xa5ee('0x36')][_0xa5ee('0x21')]);}return _0xe73c8a['getMembers'](_0x2f8f01);}})[_0xa5ee('0x28')](function(_0x454d3b){if(_0x454d3b){return _0x454d3b?{'count':_0x28d05c,'rows':_0x454d3b}:null;}})[_0xa5ee('0x28')](respondWithResult(_0x5b6ad0,null))[_0xa5ee('0x49')](handleError(_0x5b6ad0,null));};exports[_0xa5ee('0x59')]=function(_0x48fdee,_0x39b065,_0x19dffc){return db[_0xa5ee('0x31')][_0xa5ee('0x4d')]({'where':{'id':_0x48fdee[_0xa5ee('0x4b')]['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x39b065,null))[_0xa5ee('0x28')](function(_0x54b575){if(_0x54b575){return _0x54b575[_0xa5ee('0x59')](_0x48fdee[_0xa5ee('0x36')][_0xa5ee('0x54')]);}})[_0xa5ee('0x28')](respondWithStatusCode(_0x39b065,null))[_0xa5ee('0x49')](handleError(_0x39b065,null));};exports[_0xa5ee('0x5a')]=function(_0x1d0bef,_0x2cb03d,_0x16d605){if(_0x1d0bef[_0xa5ee('0x4f')]['id']){delete _0x1d0bef[_0xa5ee('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1d0bef[_0xa5ee('0x4b')]['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x2cb03d,null))[_0xa5ee('0x28')](function(_0x354fdb){if(_0x354fdb){_0x1d0bef[_0xa5ee('0x4f')][_0xa5ee('0x5b')]=_0x354fdb['id'];return db[_0xa5ee('0x51')][_0xa5ee('0x4e')](_0x1d0bef[_0xa5ee('0x4f')]);}})[_0xa5ee('0x28')](respondWithResult(_0x2cb03d,null))[_0xa5ee('0x49')](handleError(_0x2cb03d,null));};exports['getMessages']=function(_0x14f010,_0x544d77,_0x479e42){var _0x7ee050={};var _0x579465={};var _0x84de6a;var _0x546e36;return db[_0xa5ee('0x31')][_0xa5ee('0x57')]({'where':{'id':_0x14f010['params']['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x544d77,null))[_0xa5ee('0x28')](function(_0x258edb){if(_0x258edb){_0x84de6a=_0x258edb;_0x579465[_0xa5ee('0x35')]=_['keys'](db[_0xa5ee('0x51')][_0xa5ee('0x32')]);_0x579465[_0xa5ee('0x36')]=_[_0xa5ee('0x37')](_0x14f010['query']);_0x579465[_0xa5ee('0x38')]=_[_0xa5ee('0x3a')](_0x579465['model'],_0x579465['query']);_0x7ee050[_0xa5ee('0x39')]=_[_0xa5ee('0x3a')](_0x579465['model'],qs[_0xa5ee('0x3b')](_0x14f010[_0xa5ee('0x36')]['fields']));_0x7ee050[_0xa5ee('0x39')]=_0x7ee050[_0xa5ee('0x39')]['length']?_0x7ee050[_0xa5ee('0x39')]:_0x579465[_0xa5ee('0x35')];_0x7ee050['order']=qs['sort'](_0x14f010['query']['sort']);_0x7ee050[_0xa5ee('0x41')]=qs['filters'](_[_0xa5ee('0x42')](_0x14f010[_0xa5ee('0x36')],_0x579465[_0xa5ee('0x38')]));if(_0x14f010[_0xa5ee('0x36')]['filter']){_0x7ee050['where']=_[_0xa5ee('0x45')](_0x7ee050['where'],{'$or':_[_0xa5ee('0x30')](_0x7ee050[_0xa5ee('0x39')],function(_0xb519f8){var _0x4c870c={};_0x4c870c[_0xb519f8]={'$like':'%'+_0x14f010[_0xa5ee('0x36')]['filter']+'%'};return _0x4c870c;})});}if(_0x14f010['query'][_0xa5ee('0x5c')]){var _0x2f4800=_0x14f010[_0xa5ee('0x36')][_0xa5ee('0x5c')]['split'](',');var _0x1966a7={};_0x1966a7[_0x2f4800[0x0]]={'$gte':moment(_0x2f4800[0x1])[_0xa5ee('0x5d')](_0xa5ee('0x5e'))};_0x7ee050[_0xa5ee('0x41')]=_[_0xa5ee('0x45')](_0x7ee050[_0xa5ee('0x41')],_0x1966a7);}_0x7ee050=_[_0xa5ee('0x45')]({},_0x7ee050,_0x14f010[_0xa5ee('0x4c')]);return _0x84de6a[_0xa5ee('0x5f')](_0x7ee050);}})['then'](function(_0x411e5d){if(_0x411e5d){_0x546e36=_0x411e5d['length'];if(!_0x14f010['query'][_0xa5ee('0x3d')](_0xa5ee('0x3e'))){_0x7ee050[_0xa5ee('0x1f')]=qs['limit'](_0x14f010['query'][_0xa5ee('0x1f')]);_0x7ee050[_0xa5ee('0x21')]=qs[_0xa5ee('0x21')](_0x14f010['query'][_0xa5ee('0x21')]);}return _0x84de6a['getMessages'](_0x7ee050);}})[_0xa5ee('0x28')](function(_0x2bd3e0){if(_0x2bd3e0){return _0x2bd3e0?{'count':_0x546e36,'rows':_0x2bd3e0}:null;}})[_0xa5ee('0x28')](respondWithResult(_0x544d77,null))['catch'](handleError(_0x544d77,null));}; \ No newline at end of file +var _0x284e=['undefined','count','set','Content-Range','apply','save','then','destroy','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','update','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','merge','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','$gte','split','format','getMessages','eml-format','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','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','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit'];(function(_0x38dd04,_0x498e08){var _0x3dca03=function(_0x2c628d){while(--_0x2c628d){_0x38dd04['push'](_0x38dd04['shift']());}};_0x3dca03(++_0x498e08);}(_0x284e,0x1b8));var _0xe284=function(_0x1344f8,_0x40f4fd){_0x1344f8=_0x1344f8-0x0;var _0x3f9e17=_0x284e[_0x1344f8];return _0x3f9e17;};'use strict';var emlformat=require(_0xe284('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe284('0x1'));var jsonpatch=require(_0xe284('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe284('0x3'));var util=require('util');var path=require(_0xe284('0x4'));var sox=require(_0xe284('0x5'));var csv=require(_0xe284('0x6'));var ejs=require(_0xe284('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe284('0x8'));var crypto=require(_0xe284('0x9'));var jsforce=require(_0xe284('0xa'));var deskjs=require(_0xe284('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe284('0xc'));var Redis=require(_0xe284('0xd'));var authService=require(_0xe284('0xe'));var qs=require(_0xe284('0xf'));var as=require(_0xe284('0x10'));var hardwareService=require(_0xe284('0x11'));var logger=require(_0xe284('0x12'))(_0xe284('0x13'));var utils=require(_0xe284('0x14'));var config=require(_0xe284('0x15'));var licenseUtil=require(_0xe284('0x16'));var db=require(_0xe284('0x17'))['db'];config['redis']=_[_0xe284('0x18')](config[_0xe284('0x19')],{'host':_0xe284('0x1a'),'port':0x18eb});var socket=require(_0xe284('0x1b'))(new Redis(config[_0xe284('0x19')]));require('./chatGroup.socket')[_0xe284('0x1c')](socket);function respondWithStatusCode(_0x2e438c,_0x3b3b50){_0x3b3b50=_0x3b3b50||0xcc;return function(_0x37b3db){if(_0x37b3db){return _0x2e438c[_0xe284('0x1d')](_0x3b3b50);}return _0x2e438c[_0xe284('0x1e')](_0x3b3b50)[_0xe284('0x1f')]();};}function respondWithResult(_0x5bfac5,_0x5216b9){_0x5216b9=_0x5216b9||0xc8;return function(_0x12b132){if(_0x12b132){return _0x5bfac5['status'](_0x5216b9)[_0xe284('0x20')](_0x12b132);}};}function respondWithFilteredResult(_0x54934a,_0x116c29){return function(_0x1df140){if(_0x1df140){var _0x2424eb=typeof _0x116c29[_0xe284('0x21')]==='undefined'&&typeof _0x116c29[_0xe284('0x22')]===_0xe284('0x23');var _0x17e3e0=_0x1df140[_0xe284('0x24')];var _0x42bcce=_0x2424eb?0x0:_0x116c29[_0xe284('0x21')];var _0x4e73ab=_0x2424eb?_0x1df140[_0xe284('0x24')]:_0x116c29[_0xe284('0x21')]+_0x116c29[_0xe284('0x22')];var _0x395136;if(_0x4e73ab>=_0x17e3e0){_0x4e73ab=_0x17e3e0;_0x395136=0xc8;}else{_0x395136=0xce;}_0x54934a[_0xe284('0x1e')](_0x395136);return _0x54934a[_0xe284('0x25')](_0xe284('0x26'),_0x42bcce+'-'+_0x4e73ab+'/'+_0x17e3e0)[_0xe284('0x20')](_0x1df140);}return null;};}function patchUpdates(_0x2f3be7){return function(_0x11c9d6){try{jsonpatch[_0xe284('0x27')](_0x11c9d6,_0x2f3be7,!![]);}catch(_0x3750ed){return BPromise['reject'](_0x3750ed);}return _0x11c9d6[_0xe284('0x28')]();};}function saveUpdates(_0x24af82,_0x10cbdc){return function(_0x177a0e){if(_0x177a0e){return _0x177a0e['update'](_0x24af82)[_0xe284('0x29')](function(_0x44543){return _0x44543;});}return null;};}function removeEntity(_0x44274b,_0x539f4f){return function(_0x5b7e5d){if(_0x5b7e5d){return _0x5b7e5d[_0xe284('0x2a')]()[_0xe284('0x29')](function(){_0x44274b[_0xe284('0x1e')](0xcc)[_0xe284('0x1f')]();});}};}function handleEntityNotFound(_0x33cad5,_0x313f31){return function(_0x526547){if(!_0x526547){_0x33cad5[_0xe284('0x1d')](0x194);}return _0x526547;};}function handleError(_0x3713e5,_0x217761){_0x217761=_0x217761||0x1f4;return function(_0x59d74c){logger['error'](_0x59d74c['stack']);if(_0x59d74c[_0xe284('0x2b')]){delete _0x59d74c[_0xe284('0x2b')];}_0x3713e5[_0xe284('0x1e')](_0x217761)[_0xe284('0x2c')](_0x59d74c);};}exports[_0xe284('0x2d')]=function(_0x420686,_0x287914){var _0x3c53f4={},_0xf72ad9={},_0x9a805b={'count':0x0,'rows':[]};var _0x21f2c3=_[_0xe284('0x2e')](db[_0xe284('0x2f')][_0xe284('0x30')],function(_0x2ce5d9){return{'name':_0x2ce5d9[_0xe284('0x31')],'type':_0x2ce5d9[_0xe284('0x32')]['key']};});_0xf72ad9['model']=_['map'](_0x21f2c3,_0xe284('0x2b'));_0xf72ad9[_0xe284('0x33')]=_[_0xe284('0x34')](_0x420686[_0xe284('0x33')]);_0xf72ad9[_0xe284('0x35')]=_[_0xe284('0x36')](_0xf72ad9[_0xe284('0x37')],_0xf72ad9[_0xe284('0x33')]);_0x3c53f4[_0xe284('0x38')]=_[_0xe284('0x36')](_0xf72ad9[_0xe284('0x37')],qs[_0xe284('0x39')](_0x420686[_0xe284('0x33')]['fields']));_0x3c53f4[_0xe284('0x38')]=_0x3c53f4[_0xe284('0x38')][_0xe284('0x3a')]?_0x3c53f4[_0xe284('0x38')]:_0xf72ad9[_0xe284('0x37')];if(!_0x420686[_0xe284('0x33')]['hasOwnProperty']('nolimit')){_0x3c53f4[_0xe284('0x22')]=qs[_0xe284('0x22')](_0x420686[_0xe284('0x33')]['limit']);_0x3c53f4['offset']=qs[_0xe284('0x21')](_0x420686[_0xe284('0x33')]['offset']);}_0x3c53f4[_0xe284('0x3b')]=qs[_0xe284('0x3c')](_0x420686['query']['sort']);_0x3c53f4[_0xe284('0x3d')]=qs[_0xe284('0x35')](_[_0xe284('0x3e')](_0x420686['query'],_0xf72ad9[_0xe284('0x35')]),_0x21f2c3);if(_0x420686['query'][_0xe284('0x3f')]){_0x3c53f4['where']=_['merge'](_0x3c53f4[_0xe284('0x3d')],{'$or':_[_0xe284('0x2e')](_0x21f2c3,function(_0x408c96){if(_0x408c96['type']!==_0xe284('0x40')){var _0x8db404={};_0x8db404[_0x408c96[_0xe284('0x2b')]]={'$like':'%'+_0x420686[_0xe284('0x33')]['filter']+'%'};return _0x8db404;}})});}_0x3c53f4=_['merge']({},_0x3c53f4,_0x420686[_0xe284('0x41')]);var _0x2528f6={'where':_0x3c53f4[_0xe284('0x3d')]};return db['ChatGroup'][_0xe284('0x24')](_0x2528f6)[_0xe284('0x29')](function(_0x4bb30e){_0x9a805b['count']=_0x4bb30e;if(_0x420686[_0xe284('0x33')][_0xe284('0x42')]){_0x3c53f4['include']=[{'all':!![]}];}return db[_0xe284('0x2f')][_0xe284('0x43')](_0x3c53f4);})['then'](function(_0xc2bca3){_0x9a805b['rows']=_0xc2bca3;return _0x9a805b;})['then'](respondWithFilteredResult(_0x287914,_0x3c53f4))[_0xe284('0x44')](handleError(_0x287914,null));};exports[_0xe284('0x45')]=function(_0x1fd30d,_0x43b5e0){var _0x25ac1a={'raw':!![],'where':{'id':_0x1fd30d[_0xe284('0x46')]['id']}},_0x377446={};_0x377446[_0xe284('0x37')]=_[_0xe284('0x34')](db[_0xe284('0x2f')][_0xe284('0x30')]);_0x377446['query']=_['keys'](_0x1fd30d[_0xe284('0x33')]);_0x377446[_0xe284('0x35')]=_['intersection'](_0x377446[_0xe284('0x37')],_0x377446[_0xe284('0x33')]);_0x25ac1a[_0xe284('0x38')]=_['intersection'](_0x377446['model'],qs[_0xe284('0x39')](_0x1fd30d[_0xe284('0x33')][_0xe284('0x39')]));_0x25ac1a[_0xe284('0x38')]=_0x25ac1a[_0xe284('0x38')][_0xe284('0x3a')]?_0x25ac1a[_0xe284('0x38')]:_0x377446['model'];if(_0x1fd30d['query'][_0xe284('0x42')]){_0x25ac1a['include']=[{'all':!![]}];}_0x25ac1a=_['merge']({},_0x25ac1a,_0x1fd30d[_0xe284('0x41')]);return db[_0xe284('0x2f')][_0xe284('0x47')](_0x25ac1a)[_0xe284('0x29')](handleEntityNotFound(_0x43b5e0,null))[_0xe284('0x29')](respondWithResult(_0x43b5e0,null))[_0xe284('0x44')](handleError(_0x43b5e0,null));};exports[_0xe284('0x48')]=function(_0x3b8dd7,_0x424aff){return db[_0xe284('0x2f')][_0xe284('0x48')](_0x3b8dd7[_0xe284('0x49')],{})['then'](respondWithResult(_0x424aff,0xc9))[_0xe284('0x44')](handleError(_0x424aff,null));};exports[_0xe284('0x4a')]=function(_0x3749b4,_0x28165c){if(_0x3749b4[_0xe284('0x49')]['id']){delete _0x3749b4[_0xe284('0x49')]['id'];}return db[_0xe284('0x2f')][_0xe284('0x47')]({'where':{'id':_0x3749b4[_0xe284('0x46')]['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x28165c,null))[_0xe284('0x29')](saveUpdates(_0x3749b4[_0xe284('0x49')],null))[_0xe284('0x29')](respondWithResult(_0x28165c,null))[_0xe284('0x44')](handleError(_0x28165c,null));};exports[_0xe284('0x2a')]=function(_0x14b93a,_0x426db8){return db[_0xe284('0x2f')][_0xe284('0x47')]({'where':{'id':_0x14b93a['params']['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x426db8,null))[_0xe284('0x29')](removeEntity(_0x426db8,null))['catch'](handleError(_0x426db8,null));};exports[_0xe284('0x4b')]=function(_0x557ed1,_0x36f0b6){return db[_0xe284('0x2f')]['describe']()['then'](respondWithResult(_0x36f0b6,null))['catch'](handleError(_0x36f0b6,null));};exports[_0xe284('0x4c')]=function(_0x2c60b9,_0x5962f1,_0x59c09d){return db[_0xe284('0x4d')][_0xe284('0x24')]({'where':{'ChatGroupId':_0x2c60b9[_0xe284('0x46')]['id'],'ToId':_0x2c60b9[_0xe284('0x4e')]['id'],'read':![]}})['then'](function(_0x3e4e34){return{'id':_['toInteger'](_0x2c60b9[_0xe284('0x46')]['id']),'count':_0x3e4e34};})[_0xe284('0x29')](respondWithResult(_0x5962f1,null))['catch'](handleError(_0x5962f1,null));};exports[_0xe284('0x4f')]=function(_0x509d32,_0x345a9a,_0x14b3d9){return db['ChatGroup'][_0xe284('0x47')]({'where':{'id':_0x509d32['params']['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x345a9a,null))[_0xe284('0x29')](function(_0x9ed047){if(_0x9ed047){return _0x9ed047[_0xe284('0x4f')](_0x509d32[_0xe284('0x49')][_0xe284('0x50')],_[_0xe284('0x51')](_0x509d32[_0xe284('0x49')],[_0xe284('0x50'),'id'])||{});}})['then'](respondWithResult(_0x345a9a,null))[_0xe284('0x44')](handleError(_0x345a9a,null));};exports[_0xe284('0x52')]=function(_0x53fd98,_0x1ccf95,_0x453148){var _0x507f5c={};var _0x2a83a7={};var _0x34a519;var _0x54f572;return db[_0xe284('0x2f')][_0xe284('0x53')]({'where':{'id':_0x53fd98[_0xe284('0x46')]['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x1ccf95,null))['then'](function(_0x55be6f){if(_0x55be6f){_0x34a519=_0x55be6f;_0x2a83a7['model']=_[_0xe284('0x34')](db[_0xe284('0x54')][_0xe284('0x30')]);_0x2a83a7['query']=_['keys'](_0x53fd98[_0xe284('0x33')]);_0x2a83a7[_0xe284('0x35')]=_[_0xe284('0x36')](_0x2a83a7[_0xe284('0x37')],_0x2a83a7['query']);_0x507f5c[_0xe284('0x38')]=_[_0xe284('0x36')](_0x2a83a7[_0xe284('0x37')],qs[_0xe284('0x39')](_0x53fd98[_0xe284('0x33')][_0xe284('0x39')]));_0x507f5c[_0xe284('0x38')]=_0x507f5c['attributes']['length']?_0x507f5c['attributes']:_0x2a83a7[_0xe284('0x37')];_0x507f5c['order']=qs['sort'](_0x53fd98[_0xe284('0x33')][_0xe284('0x3c')]);_0x507f5c['where']=qs[_0xe284('0x35')](_[_0xe284('0x3e')](_0x53fd98[_0xe284('0x33')],_0x2a83a7[_0xe284('0x35')]));if(_0x53fd98['query'][_0xe284('0x3f')]){_0x507f5c[_0xe284('0x3d')]=_[_0xe284('0x55')](_0x507f5c[_0xe284('0x3d')],{'$or':_[_0xe284('0x2e')](_0x507f5c[_0xe284('0x38')],function(_0x5523a8){var _0x3da42f={};_0x3da42f[_0x5523a8]={'$like':'%'+_0x53fd98['query'][_0xe284('0x3f')]+'%'};return _0x3da42f;})});}_0x507f5c=_[_0xe284('0x55')]({},_0x507f5c,_0x53fd98[_0xe284('0x41')]);return _0x34a519[_0xe284('0x52')](_0x507f5c);}})[_0xe284('0x29')](function(_0x5c0ca1){if(_0x5c0ca1){_0x54f572=_0x5c0ca1[_0xe284('0x3a')];if(!_0x53fd98[_0xe284('0x33')][_0xe284('0x56')](_0xe284('0x57'))){_0x507f5c[_0xe284('0x22')]=qs['limit'](_0x53fd98[_0xe284('0x33')][_0xe284('0x22')]);_0x507f5c[_0xe284('0x21')]=qs[_0xe284('0x21')](_0x53fd98[_0xe284('0x33')][_0xe284('0x21')]);}return _0x34a519[_0xe284('0x52')](_0x507f5c);}})[_0xe284('0x29')](function(_0x1f598f){if(_0x1f598f){return _0x1f598f?{'count':_0x54f572,'rows':_0x1f598f}:null;}})[_0xe284('0x29')](respondWithResult(_0x1ccf95,null))[_0xe284('0x44')](handleError(_0x1ccf95,null));};exports[_0xe284('0x58')]=function(_0x30a0a1,_0xe0f5b,_0x482205){return db[_0xe284('0x2f')][_0xe284('0x47')]({'where':{'id':_0x30a0a1[_0xe284('0x46')]['id']}})[_0xe284('0x29')](handleEntityNotFound(_0xe0f5b,null))[_0xe284('0x29')](function(_0x224d5c){if(_0x224d5c){return _0x224d5c[_0xe284('0x58')](_0x30a0a1[_0xe284('0x33')][_0xe284('0x50')]);}})[_0xe284('0x29')](respondWithStatusCode(_0xe0f5b,null))['catch'](handleError(_0xe0f5b,null));};exports[_0xe284('0x59')]=function(_0x2d27b7,_0x4a69ae,_0x310ee0){if(_0x2d27b7['body']['id']){delete _0x2d27b7[_0xe284('0x49')]['id'];}return db[_0xe284('0x2f')][_0xe284('0x47')]({'where':{'id':_0x2d27b7['params']['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x4a69ae,null))['then'](function(_0x3b53ae){if(_0x3b53ae){_0x2d27b7[_0xe284('0x49')][_0xe284('0x5a')]=_0x3b53ae['id'];return db[_0xe284('0x4d')]['create'](_0x2d27b7[_0xe284('0x49')]);}})[_0xe284('0x29')](respondWithResult(_0x4a69ae,null))[_0xe284('0x44')](handleError(_0x4a69ae,null));};exports['getMessages']=function(_0x32c3e2,_0x509e88,_0x447eae){var _0x1d6772={};var _0x31607e={};var _0x4c5135;var _0xd3c4bd;return db[_0xe284('0x2f')][_0xe284('0x53')]({'where':{'id':_0x32c3e2['params']['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x509e88,null))[_0xe284('0x29')](function(_0x19a920){if(_0x19a920){_0x4c5135=_0x19a920;_0x31607e[_0xe284('0x37')]=_[_0xe284('0x34')](db[_0xe284('0x4d')][_0xe284('0x30')]);_0x31607e['query']=_['keys'](_0x32c3e2[_0xe284('0x33')]);_0x31607e[_0xe284('0x35')]=_['intersection'](_0x31607e['model'],_0x31607e[_0xe284('0x33')]);_0x1d6772[_0xe284('0x38')]=_[_0xe284('0x36')](_0x31607e[_0xe284('0x37')],qs[_0xe284('0x39')](_0x32c3e2[_0xe284('0x33')]['fields']));_0x1d6772[_0xe284('0x38')]=_0x1d6772[_0xe284('0x38')][_0xe284('0x3a')]?_0x1d6772[_0xe284('0x38')]:_0x31607e[_0xe284('0x37')];_0x1d6772['order']=qs['sort'](_0x32c3e2['query']['sort']);_0x1d6772[_0xe284('0x3d')]=qs[_0xe284('0x35')](_['pick'](_0x32c3e2[_0xe284('0x33')],_0x31607e['filters']));if(_0x32c3e2['query'][_0xe284('0x3f')]){_0x1d6772['where']=_[_0xe284('0x55')](_0x1d6772[_0xe284('0x3d')],{'$or':_[_0xe284('0x2e')](_0x1d6772[_0xe284('0x38')],function(_0x52f2be){var _0x4e5301={};_0x4e5301[_0x52f2be]={'$like':'%'+_0x32c3e2[_0xe284('0x33')]['filter']+'%'};return _0x4e5301;})});}if(_0x32c3e2[_0xe284('0x33')][_0xe284('0x5b')]){var _0x23e134=_0x32c3e2[_0xe284('0x33')][_0xe284('0x5b')][_0xe284('0x5c')](',');var _0x3ec486={};_0x3ec486[_0x23e134[0x0]]={'$gte':moment(_0x23e134[0x1])[_0xe284('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d6772[_0xe284('0x3d')]=_[_0xe284('0x55')](_0x1d6772['where'],_0x3ec486);}_0x1d6772=_[_0xe284('0x55')]({},_0x1d6772,_0x32c3e2[_0xe284('0x41')]);return _0x4c5135[_0xe284('0x5e')](_0x1d6772);}})['then'](function(_0xef48fb){if(_0xef48fb){_0xd3c4bd=_0xef48fb[_0xe284('0x3a')];if(!_0x32c3e2[_0xe284('0x33')][_0xe284('0x56')](_0xe284('0x57'))){_0x1d6772[_0xe284('0x22')]=qs[_0xe284('0x22')](_0x32c3e2['query'][_0xe284('0x22')]);_0x1d6772['offset']=qs['offset'](_0x32c3e2[_0xe284('0x33')]['offset']);}return _0x4c5135[_0xe284('0x5e')](_0x1d6772);}})[_0xe284('0x29')](function(_0x3229cd){if(_0x3229cd){return _0x3229cd?{'count':_0xd3c4bd,'rows':_0x3229cd}:null;}})[_0xe284('0x29')](respondWithResult(_0x509e88,null))[_0xe284('0x44')](handleError(_0x509e88,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 1747bf5..3a9c67e 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 _0x12b6=['events','../../mysqldb','save','remove','emit','hook','exports'];(function(_0x6534a0,_0x475ba5){var _0x2a279a=function(_0x4871e6){while(--_0x4871e6){_0x6534a0['push'](_0x6534a0['shift']());}};_0x2a279a(++_0x475ba5);}(_0x12b6,0x1b9));var _0x612b=function(_0x269aac,_0x426352){_0x269aac=_0x269aac-0x0;var _0x52f530=_0x12b6[_0x269aac];return _0x52f530;};'use strict';var EventEmitter=require(_0x612b('0x0'));var ChatGroup=require(_0x612b('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x612b('0x2'),'afterUpdate':'update','afterDestroy':_0x612b('0x3')};function emitEvent(_0x39113d){return function(_0x489cb0,_0x317928,_0x1d70a7){ChatGroupEvents['emit'](_0x39113d+':'+_0x489cb0['id'],_0x489cb0);ChatGroupEvents[_0x612b('0x4')](_0x39113d,_0x489cb0);_0x1d70a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x612b('0x5')](e,emitEvent(event));}}module[_0x612b('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x847f=['hook','exports','events','../../mysqldb','setMaxListeners','save','hasOwnProperty'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x847f,0xb8));var _0xf847=function(_0x27125a,_0x252d0d){_0x27125a=_0x27125a-0x0;var _0x391f7a=_0x847f[_0x27125a];return _0x391f7a;};'use strict';var EventEmitter=require(_0xf847('0x0'));var ChatGroup=require(_0xf847('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf847('0x2')](0x0);var events={'afterCreate':_0xf847('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x50e00b){return function(_0x8d0a9c,_0x4fe7b9,_0x3299b1){ChatGroupEvents['emit'](_0x50e00b+':'+_0x8d0a9c['id'],_0x8d0a9c);ChatGroupEvents['emit'](_0x50e00b,_0x8d0a9c);_0x3299b1(null);};}for(var e in events){if(events[_0xf847('0x4')](e)){var event=events[e];ChatGroup[_0xf847('0x5')](e,emitEvent(event));}}module[_0xf847('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index c69f08c..f3be36f 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 _0x492f=['define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ba46e,_0x35da73){var _0x39bdba=function(_0x5e9d2b){while(--_0x5e9d2b){_0x3ba46e['push'](_0x3ba46e['shift']());}};_0x39bdba(++_0x35da73);}(_0x492f,0xb7));var _0xf492=function(_0xb62ac5,_0x2da758){_0xb62ac5=_0xb62ac5-0x0;var _0x1d63ec=_0x492f[_0xb62ac5];return _0x1d63ec;};'use strict';var _=require(_0xf492('0x0'));var util=require('util');var logger=require(_0xf492('0x1'))(_0xf492('0x2'));var moment=require(_0xf492('0x3'));var BPromise=require(_0xf492('0x4'));var rp=require(_0xf492('0x5'));var fs=require('fs');var path=require(_0xf492('0x6'));var rimraf=require(_0xf492('0x7'));var config=require(_0xf492('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x3b0691,_0x2aee3f){return _0x3b0691[_0xf492('0x9')](_0xf492('0xa'),attributes,{'tableName':_0xf492('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff47=['bluebird','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','moment'];(function(_0x415e37,_0x35dff9){var _0x29153d=function(_0x1e3af2){while(--_0x1e3af2){_0x415e37['push'](_0x415e37['shift']());}};_0x29153d(++_0x35dff9);}(_0xff47,0x13d));var _0x7ff4=function(_0x1dc2b4,_0x573a04){_0x1dc2b4=_0x1dc2b4-0x0;var _0x18af92=_0xff47[_0x1dc2b4];return _0x18af92;};'use strict';var _=require(_0x7ff4('0x0'));var util=require('util');var logger=require(_0x7ff4('0x1'))('api');var moment=require(_0x7ff4('0x2'));var BPromise=require(_0x7ff4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7ff4('0x4'));var attributes=require(_0x7ff4('0x5'));module[_0x7ff4('0x6')]=function(_0x3f4fe2,_0x5b6c4e){return _0x3f4fe2[_0x7ff4('0x7')](_0x7ff4('0x8'),attributes,{'tableName':_0x7ff4('0x9'),'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 3012b97..8cffe65 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 _0xb833=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb833,0x105));var _0x3b83=function(_0x111b47,_0x455ba7){_0x111b47=_0x111b47-0x0;var _0x2c8cf3=_0xb833[_0x111b47];return _0x2c8cf3;};'use strict';var _=require(_0x3b83('0x0'));var util=require(_0x3b83('0x1'));var moment=require(_0x3b83('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b83('0x3'));var fs=require('fs');var Redis=require(_0x3b83('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b83('0x5'));var logger=require(_0x3b83('0x6'))(_0x3b83('0x7'));var config=require(_0x3b83('0x8'));var jayson=require(_0x3b83('0x9'));var client=jayson['client'][_0x3b83('0xa')]({'port':0x232a});config[_0x3b83('0xb')]=_['defaults'](config[_0x3b83('0xb')],{'host':_0x3b83('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b83('0xb')]));require(_0x3b83('0xd'))[_0x3b83('0xe')](socket);function respondWithRpcPromise(_0x8cec17,_0x4a7ce6,_0x371511){return new BPromise(function(_0x10c369,_0x532a3b){return client[_0x3b83('0xf')](_0x8cec17,_0x371511)['then'](function(_0x19aa94){logger[_0x3b83('0x10')](_0x3b83('0x11'),_0x4a7ce6,'request\x20sent');logger['debug'](_0x3b83('0x12'),_0x4a7ce6,_0x3b83('0x13'),JSON[_0x3b83('0x14')](_0x19aa94));if(_0x19aa94[_0x3b83('0x15')]){if(_0x19aa94[_0x3b83('0x15')][_0x3b83('0x16')]===0x1f4){logger[_0x3b83('0x15')]('ChatGroup,\x20%s,\x20%s',_0x4a7ce6,_0x19aa94[_0x3b83('0x15')][_0x3b83('0x17')]);return _0x532a3b(_0x19aa94['error'][_0x3b83('0x17')]);}logger[_0x3b83('0x15')](_0x3b83('0x11'),_0x4a7ce6,_0x19aa94['error'][_0x3b83('0x17')]);return _0x10c369(_0x19aa94[_0x3b83('0x15')][_0x3b83('0x17')]);}else{logger[_0x3b83('0x10')](_0x3b83('0x11'),_0x4a7ce6,_0x3b83('0x13'));_0x10c369(_0x19aa94[_0x3b83('0x18')][_0x3b83('0x17')]);}})[_0x3b83('0x19')](function(_0x14ba00){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4a7ce6,_0x14ba00);_0x532a3b(_0x14ba00);});});} \ No newline at end of file +var _0xcd3a=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x32eb18,_0x332131){var _0x5d9f6c=function(_0x56cd9b){while(--_0x56cd9b){_0x32eb18['push'](_0x32eb18['shift']());}};_0x5d9f6c(++_0x332131);}(_0xcd3a,0xcf));var _0xacd3=function(_0x14253d,_0x5e5b44){_0x14253d=_0x14253d-0x0;var _0x1ab618=_0xcd3a[_0x14253d];return _0x1ab618;};'use strict';var _=require(_0xacd3('0x0'));var util=require(_0xacd3('0x1'));var moment=require(_0xacd3('0x2'));var BPromise=require(_0xacd3('0x3'));var rs=require(_0xacd3('0x4'));var fs=require('fs');var Redis=require(_0xacd3('0x5'));var db=require(_0xacd3('0x6'))['db'];var utils=require(_0xacd3('0x7'));var logger=require('../../config/logger')(_0xacd3('0x8'));var config=require(_0xacd3('0x9'));var jayson=require(_0xacd3('0xa'));var client=jayson[_0xacd3('0xb')]['http']({'port':0x232a});config['redis']=_[_0xacd3('0xc')](config[_0xacd3('0xd')],{'host':_0xacd3('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacd3('0xd')]));require(_0xacd3('0xf'))[_0xacd3('0x10')](socket);function respondWithRpcPromise(_0x2b5702,_0x5c0e56,_0x106fee){return new BPromise(function(_0x5c85b5,_0x29d379){return client[_0xacd3('0x11')](_0x2b5702,_0x106fee)[_0xacd3('0x12')](function(_0x198184){logger['info'](_0xacd3('0x13'),_0x5c0e56,_0xacd3('0x14'));logger[_0xacd3('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5c0e56,'request\x20sent',JSON[_0xacd3('0x16')](_0x198184));if(_0x198184[_0xacd3('0x17')]){if(_0x198184['error'][_0xacd3('0x18')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5c0e56,_0x198184[_0xacd3('0x17')][_0xacd3('0x19')]);return _0x29d379(_0x198184['error'][_0xacd3('0x19')]);}logger[_0xacd3('0x17')](_0xacd3('0x13'),_0x5c0e56,_0x198184['error'][_0xacd3('0x19')]);return _0x5c85b5(_0x198184[_0xacd3('0x17')]['message']);}else{logger[_0xacd3('0x1a')](_0xacd3('0x13'),_0x5c0e56,_0xacd3('0x14'));_0x5c85b5(_0x198184[_0xacd3('0x1b')][_0xacd3('0x19')]);}})[_0xacd3('0x1c')](function(_0x477b60){logger[_0xacd3('0x17')]('ChatGroup,\x20%s,\x20%s',_0x5c0e56,_0x477b60);_0x29d379(_0x477b60);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index e203c09..94a5a1d 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 _0xfec9=['removeListener','register','length','./chatGroup.events','save','remove','update','emit'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xfec9,0xeb));var _0x9fec=function(_0xa2ba12,_0x3430e3){_0xa2ba12=_0xa2ba12-0x0;var _0x3e32d3=_0xfec9[_0xa2ba12];return _0x3e32d3;};'use strict';var ChatGroupEvents=require(_0x9fec('0x0'));var events=[_0x9fec('0x1'),_0x9fec('0x2'),_0x9fec('0x3')];function createListener(_0x51e5e5,_0x148c8f){return function(_0x2ef68c){_0x148c8f[_0x9fec('0x4')](_0x51e5e5,_0x2ef68c);};}function removeListener(_0x1faf0b,_0x1973de){return function(){ChatGroupEvents[_0x9fec('0x5')](_0x1faf0b,_0x1973de);};}exports[_0x9fec('0x6')]=function(_0x41b14e){for(var _0x4f2691=0x0,_0x5488c8=events[_0x9fec('0x7')];_0x4f2691<_0x5488c8;_0x4f2691++){var _0xfabdea=events[_0x4f2691];var _0x5c0eeb=createListener('chatGroup:'+_0xfabdea,_0x41b14e);ChatGroupEvents['on'](_0xfabdea,_0x5c0eeb);}}; \ No newline at end of file +var _0xb96d=['remove','update','emit','removeListener','register','length','./chatGroup.events','save'];(function(_0x529fd0,_0x17a79b){var _0x11ad54=function(_0x22964e){while(--_0x22964e){_0x529fd0['push'](_0x529fd0['shift']());}};_0x11ad54(++_0x17a79b);}(_0xb96d,0x1d6));var _0xdb96=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0xb96d[_0x29d6e6];return _0xc75ff0;};'use strict';var ChatGroupEvents=require(_0xdb96('0x0'));var events=[_0xdb96('0x1'),_0xdb96('0x2'),_0xdb96('0x3')];function createListener(_0x51338c,_0x1d3fce){return function(_0x36192b){_0x1d3fce[_0xdb96('0x4')](_0x51338c,_0x36192b);};}function removeListener(_0x360852,_0x337129){return function(){ChatGroupEvents[_0xdb96('0x5')](_0x360852,_0x337129);};}exports[_0xdb96('0x6')]=function(_0x49279f){for(var _0x318232=0x0,_0x11722b=events[_0xdb96('0x7')];_0x318232<_0x11722b;_0x318232++){var _0xc8df95=events[_0x318232];var _0x429e3a=createListener('chatGroup:'+_0xc8df95,_0x49279f);ChatGroupEvents['on'](_0xc8df95,_0x429e3a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index e0acd03..9813a78 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 _0x2d5d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x6bb245,_0x5802b8){var _0x2333c8=function(_0xc4869b){while(--_0xc4869b){_0x6bb245['push'](_0x6bb245['shift']());}};_0x2333c8(++_0x5802b8);}(_0x2d5d,0x1db));var _0xd2d5=function(_0x5e5f0f,_0x3a98bd){_0x5e5f0f=_0x5e5f0f-0x0;var _0x4eb83d=_0x2d5d[_0x5e5f0f];return _0x4eb83d;};'use strict';var multer=require(_0xd2d5('0x0'));var util=require(_0xd2d5('0x1'));var path=require('path');var timeout=require(_0xd2d5('0x2'));var express=require(_0xd2d5('0x3'));var router=express[_0xd2d5('0x4')]();var fs_extra=require(_0xd2d5('0x5'));var auth=require(_0xd2d5('0x6'));var interaction=require(_0xd2d5('0x7'));var config=require(_0xd2d5('0x8'));var controller=require(_0xd2d5('0x9'));router[_0xd2d5('0xa')]('/',auth[_0xd2d5('0xb')](),controller[_0xd2d5('0xc')]);router['get'](_0xd2d5('0xd'),auth[_0xd2d5('0xb')](),controller[_0xd2d5('0xe')]);router[_0xd2d5('0xa')]('/:id',auth[_0xd2d5('0xb')](),controller[_0xd2d5('0xf')]);router[_0xd2d5('0xa')]('/:id/unread',auth[_0xd2d5('0xb')](),controller[_0xd2d5('0x10')]);router[_0xd2d5('0xa')](_0xd2d5('0x11'),auth['isAuthenticated'](),controller[_0xd2d5('0x12')]);router[_0xd2d5('0xa')](_0xd2d5('0x13'),auth['isAuthenticated'](),controller[_0xd2d5('0x14')]);router[_0xd2d5('0x15')]('/',auth['isAuthenticated'](),controller[_0xd2d5('0x16')]);router[_0xd2d5('0x15')](_0xd2d5('0x11'),auth[_0xd2d5('0xb')](),controller[_0xd2d5('0x17')]);router[_0xd2d5('0x15')](_0xd2d5('0x13'),auth[_0xd2d5('0xb')](),controller[_0xd2d5('0x18')]);router[_0xd2d5('0x19')](_0xd2d5('0x1a'),auth[_0xd2d5('0xb')](),controller[_0xd2d5('0x1b')]);router[_0xd2d5('0x1c')](_0xd2d5('0x1a'),auth[_0xd2d5('0xb')](),controller['destroy']);router[_0xd2d5('0x1c')](_0xd2d5('0x11'),auth[_0xd2d5('0xb')](),controller['removeMembers']);module[_0xd2d5('0x1d')]=router; \ No newline at end of file +var _0xe292=['index','/describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','delete','destroy','removeMembers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x5a435c,_0x455012){var _0x31a14f=function(_0xa6ffcd){while(--_0xa6ffcd){_0x5a435c['push'](_0x5a435c['shift']());}};_0x31a14f(++_0x455012);}(_0xe292,0x144));var _0x2e29=function(_0x1580fe,_0x17a64c){_0x1580fe=_0x1580fe-0x0;var _0x510c7b=_0xe292[_0x1580fe];return _0x510c7b;};'use strict';var multer=require(_0x2e29('0x0'));var util=require('util');var path=require(_0x2e29('0x1'));var timeout=require(_0x2e29('0x2'));var express=require(_0x2e29('0x3'));var router=express[_0x2e29('0x4')]();var fs_extra=require(_0x2e29('0x5'));var auth=require(_0x2e29('0x6'));var interaction=require(_0x2e29('0x7'));var config=require(_0x2e29('0x8'));var controller=require(_0x2e29('0x9'));router[_0x2e29('0xa')]('/',auth[_0x2e29('0xb')](),controller[_0x2e29('0xc')]);router[_0x2e29('0xa')](_0x2e29('0xd'),auth[_0x2e29('0xb')](),controller['describe']);router[_0x2e29('0xa')](_0x2e29('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2e29('0xf'),auth['isAuthenticated'](),controller[_0x2e29('0x10')]);router['get'](_0x2e29('0x11'),auth[_0x2e29('0xb')](),controller[_0x2e29('0x12')]);router[_0x2e29('0xa')](_0x2e29('0x13'),auth[_0x2e29('0xb')](),controller[_0x2e29('0x14')]);router[_0x2e29('0x15')]('/',auth[_0x2e29('0xb')](),controller['create']);router['post'](_0x2e29('0x11'),auth['isAuthenticated'](),controller[_0x2e29('0x16')]);router[_0x2e29('0x15')](_0x2e29('0x13'),auth[_0x2e29('0xb')](),controller[_0x2e29('0x17')]);router['put'](_0x2e29('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x2e29('0x18')](_0x2e29('0xe'),auth[_0x2e29('0xb')](),controller[_0x2e29('0x19')]);router['delete'](_0x2e29('0x11'),auth['isAuthenticated'](),controller[_0x2e29('0x1a')]);module[_0x2e29('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 0e88336..2e9bf4d 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 _0x8cc8=['DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x5d5ebf,_0x498a7c){var _0x1db3e8=function(_0x13f44c){while(--_0x13f44c){_0x5d5ebf['push'](_0x5d5ebf['shift']());}};_0x1db3e8(++_0x498a7c);}(_0x8cc8,0x177));var _0x88cc=function(_0x1688e9,_0x2f3588){_0x1688e9=_0x1688e9-0x0;var _0x5727ac=_0x8cc8[_0x1688e9];return _0x5727ac;};'use strict';var Sequelize=require(_0x88cc('0x0'));module[_0x88cc('0x1')]={'closed':{'type':Sequelize[_0x88cc('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x88cc('0x3')]},'ratingType':{'type':Sequelize[_0x88cc('0x4')](_0x88cc('0x5'),_0x88cc('0x6')),'defaultValue':_0x88cc('0x5')},'ratingMessage':{'type':Sequelize[_0x88cc('0x7')]},'pathTranscript':{'type':Sequelize[_0x88cc('0x7')]},'mailTranscript':{'type':Sequelize[_0x88cc('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x88cc('0x9')]},'disposition':{'type':Sequelize[_0x88cc('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x88cc('0x8')]},'browserName':{'type':Sequelize[_0x88cc('0x8')]},'browserVersion':{'type':Sequelize[_0x88cc('0x8')]},'osName':{'type':Sequelize[_0x88cc('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x88cc('0x8')]},'deviceVendor':{'type':Sequelize[_0x88cc('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x88cc('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x88cc('0x7')](_0x88cc('0xa'))},'read1stAt':{'type':Sequelize[_0x88cc('0x9')]},'lastMsgAt':{'type':Sequelize[_0x88cc('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x88cc('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x88cc('0x8')]},'customerPort':{'type':Sequelize[_0x88cc('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x88cc('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x88cc('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xdb94=['long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','STRING','TEXT'];(function(_0x8f2c7a,_0x2fb180){var _0x212e6d=function(_0x2f20b0){while(--_0x2f20b0){_0x8f2c7a['push'](_0x8f2c7a['shift']());}};_0x212e6d(++_0x2fb180);}(_0xdb94,0xab));var _0x4db9=function(_0x105a64,_0x53ab60){_0x105a64=_0x105a64-0x0;var _0x32b896=_0xdb94[_0x105a64];return _0x32b896;};'use strict';var Sequelize=require(_0x4db9('0x0'));module[_0x4db9('0x1')]={'closed':{'type':Sequelize[_0x4db9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4db9('0x3')]},'ratingType':{'type':Sequelize[_0x4db9('0x4')]('star',_0x4db9('0x5')),'defaultValue':_0x4db9('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x4db9('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4db9('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4db9('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x4db9('0x7')]},'osName':{'type':Sequelize[_0x4db9('0x7')]},'osVersion':{'type':Sequelize[_0x4db9('0x7')]},'deviceModel':{'type':Sequelize[_0x4db9('0x7')]},'deviceVendor':{'type':Sequelize[_0x4db9('0x7')]},'deviceType':{'type':Sequelize[_0x4db9('0x7')]},'referer':{'type':Sequelize[_0x4db9('0x8')]},'customerIp':{'type':Sequelize[_0x4db9('0x7')]},'formData':{'type':Sequelize[_0x4db9('0x8')](_0x4db9('0x9'))},'read1stAt':{'type':Sequelize[_0x4db9('0xa')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4db9('0x4')]('in',_0x4db9('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x4db9('0x8')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 9d47c35..5aaf625 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 _0x4024=['ChatInteractionId','push','all','rows','show','params','include','options','create','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','hasOwnProperty','sort','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','getMyMessages','includeAgent','addTags','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Account','get','mkdirSync','Chat','Owner','N.A.','closed','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','end','status','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','sendStatus','name','render','merge','agent','interaction','account','Users','TagIds','Tags','split','forEach','catch','map','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','text','body','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy'];(function(_0x3b3d58,_0x45589b){var _0x34c359=function(_0x13036f){while(--_0x13036f){_0x3b3d58['push'](_0x3b3d58['shift']());}};_0x34c359(++_0x45589b);}(_0x4024,0x89));var _0x4402=function(_0x581174,_0x41e3ce){_0x581174=_0x581174-0x0;var _0x132336=_0x4024[_0x581174];return _0x132336;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x4402('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4402('0xf'))(_0x4402('0x10'));var utils=require('../../config/utils');var config=require(_0x4402('0x11'));var licenseUtil=require(_0x4402('0x12'));var db=require(_0x4402('0x13'))['db'];config['redis']=_[_0x4402('0x14')](config[_0x4402('0x15')],{'host':_0x4402('0x16'),'port':0x18eb});var socket=require(_0x4402('0x17'))(new Redis(config[_0x4402('0x15')]));require(_0x4402('0x18'))[_0x4402('0x19')](socket);var jayson=require(_0x4402('0x1a'));var client=jayson[_0x4402('0x1b')][_0x4402('0x1c')]({'port':0x232b});var client9004=jayson[_0x4402('0x1b')][_0x4402('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2a2ce8,_0x19fe7b,_0xfd9853,_0x30c390){return new BPromise(function(_0x399c24,_0x25e88b){var _0x186c22=_0x30c390||client;return _0x186c22[_0x4402('0x1d')](_0x2a2ce8,_0xfd9853)['then'](function(_0x494389){logger[_0x4402('0x1e')](_0x4402('0x1f'),_0x19fe7b,'request\x20sent');logger[_0x4402('0x20')](_0x4402('0x21'),_0x19fe7b,'request\x20sent',JSON[_0x4402('0x22')](_0x494389));if(_0x494389['error']){if(_0x494389['error'][_0x4402('0x23')]===0x1f4){logger[_0x4402('0x24')](_0x4402('0x1f'),_0x19fe7b,_0x494389['error'][_0x4402('0x25')]);return _0x25e88b(_0x494389['error']['message']);}logger[_0x4402('0x24')](_0x4402('0x1f'),_0x19fe7b,_0x494389[_0x4402('0x24')][_0x4402('0x25')]);return _0x399c24(_0x494389[_0x4402('0x24')][_0x4402('0x25')]);}else{logger[_0x4402('0x1e')](_0x4402('0x1f'),_0x19fe7b,_0x4402('0x26'));_0x399c24(_0x494389['result'][_0x4402('0x25')]);}})['catch'](function(_0x3733cd){logger[_0x4402('0x24')](_0x4402('0x1f'),_0x19fe7b,_0x3733cd);_0x25e88b(_0x3733cd);});});}function respondWithStatusCode(_0x211424,_0x5a43d0){_0x5a43d0=_0x5a43d0||0xcc;return function(_0x15c19f){if(_0x15c19f){return _0x211424['sendStatus'](_0x5a43d0);}return _0x211424['status'](_0x5a43d0)[_0x4402('0x27')]();};}function respondWithResult(_0x395e49,_0x327d60){_0x327d60=_0x327d60||0xc8;return function(_0xabf61b){if(_0xabf61b){return _0x395e49[_0x4402('0x28')](_0x327d60)['json'](_0xabf61b);}};}function respondWithFilteredResult(_0x41de44,_0x52e625){return function(_0x71da2f){if(_0x71da2f){var _0x1e2340=typeof _0x52e625[_0x4402('0x29')]==='undefined'&&typeof _0x52e625[_0x4402('0x2a')]===_0x4402('0x2b');var _0x316239=_0x71da2f[_0x4402('0x2c')];var _0x2526d1=_0x1e2340?0x0:_0x52e625[_0x4402('0x29')];var _0x1189b8=_0x1e2340?_0x71da2f[_0x4402('0x2c')]:_0x52e625[_0x4402('0x29')]+_0x52e625[_0x4402('0x2a')];var _0xcea26b;if(_0x1189b8>=_0x316239){_0x1189b8=_0x316239;_0xcea26b=0xc8;}else{_0xcea26b=0xce;}_0x41de44['status'](_0xcea26b);return _0x41de44[_0x4402('0x2d')]('Content-Range',_0x2526d1+'-'+_0x1189b8+'/'+_0x316239)[_0x4402('0x2e')](_0x71da2f);}return null;};}function patchUpdates(_0x554096){return function(_0x2dea0f){try{jsonpatch[_0x4402('0x2f')](_0x2dea0f,_0x554096,!![]);}catch(_0x145003){return BPromise[_0x4402('0x30')](_0x145003);}return _0x2dea0f[_0x4402('0x31')]();};}function saveUpdates(_0x480781,_0x3a60af){return function(_0x3fa7ae){if(_0x3fa7ae){return _0x3fa7ae[_0x4402('0x32')](_0x480781)['then'](function(_0x331c75){return _0x331c75;});}return null;};}function removeEntity(_0x3383e3,_0x535e1d){return function(_0x2db1fe){if(_0x2db1fe){return _0x2db1fe[_0x4402('0x33')]()[_0x4402('0x34')](function(){_0x3383e3[_0x4402('0x28')](0xcc)[_0x4402('0x27')]();});}};}function handleEntityNotFound(_0x235f30,_0x1e67ac){return function(_0x6e9fb7){if(!_0x6e9fb7){_0x235f30[_0x4402('0x35')](0x194);}return _0x6e9fb7;};}function handleError(_0x5c819a,_0x2995b6){_0x2995b6=_0x2995b6||0x1f4;return function(_0x28fee8){logger[_0x4402('0x24')](_0x28fee8['stack']);if(_0x28fee8[_0x4402('0x36')]){delete _0x28fee8[_0x4402('0x36')];}_0x5c819a['status'](_0x2995b6)['send'](_0x28fee8);};}function getMustacheRender(_0x2b9d51,_0x5b7c2e){return Mustache[_0x4402('0x37')](_0x2b9d51,_[_0x4402('0x38')](_0x5b7c2e['body'],{'contact':_0x5b7c2e['contact'],'message':_0x5b7c2e['message'],'agent':_0x5b7c2e[_0x4402('0x39')],'interaction':_0x5b7c2e[_0x4402('0x3a')],'account':_0x5b7c2e[_0x4402('0x3b')]}))||'';}function getInteractionUsers(_0x3fd8ce,_0x52af0d){return new BPromise(function(_0x20579c,_0x7d5f2a){try{if(_0x52af0d[_0x3fd8ce['id']]){_0x3fd8ce[_0x4402('0x3c')]=_['map'](_0x52af0d[_0x3fd8ce['id']],function(_0x2b92b7){return{'id':_0x2b92b7['id'],'fullname':_0x2b92b7['fullname']};});}}catch(_0x6e328a){_0x7d5f2a(_0x6e328a);}_0x20579c(_0x3fd8ce);});}function getInteractionTags(_0x3ef31d,_0x5c74b1){return new BPromise(function(_0x16ef2e,_0x529526){try{if(_0x3ef31d[_0x4402('0x3d')]){_0x3ef31d[_0x4402('0x3e')]=[];_0x3ef31d['TagIds'][_0x4402('0x3f')](',')[_0x4402('0x40')](function(_0x250f09){_0x3ef31d[_0x4402('0x3e')]['push'](_0x5c74b1[_0x250f09]);});}delete _0x3ef31d['TagIds'];}catch(_0x2cda0a){_0x529526(_0x2cda0a);}_0x16ef2e(_0x3ef31d);});}function updateChatInteraction(_0x47a3a3,_0x3a589b,_0x2a6d78){return new BPromise(function(_0xb9cf85,_0x2e2391){return getInteractionUsers(_0x47a3a3,_0x2a6d78)[_0x4402('0x34')](function(_0x455a62){return getInteractionTags(_0x455a62,_0x3a589b);})[_0x4402('0x34')](function(_0x390169){_0xb9cf85(_0x390169);})[_0x4402('0x41')](function(_0x42812b){_0x2e2391(_0x42812b);});});}exports['index']=function(_0x14b94b,_0x3236fc){var _0x5e7872={},_0x214eec={},_0x370878={'count':0x0,'rows':[]};var _0x50552a=_[_0x4402('0x42')](db[_0x4402('0x43')][_0x4402('0x44')],function(_0x3278fc){return{'name':_0x3278fc[_0x4402('0x45')],'type':_0x3278fc['type'][_0x4402('0x46')]};});_0x214eec[_0x4402('0x47')]=_[_0x4402('0x42')](_0x50552a,_0x4402('0x36'));_0x214eec[_0x4402('0x48')]=_[_0x4402('0x49')](_0x14b94b[_0x4402('0x48')]);_0x214eec[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x214eec[_0x4402('0x47')],_0x214eec[_0x4402('0x48')]);_0x5e7872['attributes']=_[_0x4402('0x4b')](_0x214eec['model'],qs[_0x4402('0x4c')](_0x14b94b[_0x4402('0x48')]['fields']));_0x5e7872[_0x4402('0x4d')]=_0x5e7872[_0x4402('0x4d')][_0x4402('0x4e')]?_0x5e7872[_0x4402('0x4d')]:_0x214eec[_0x4402('0x47')];if(!_0x14b94b[_0x4402('0x48')]['hasOwnProperty'](_0x4402('0x4f'))){_0x5e7872[_0x4402('0x2a')]=qs[_0x4402('0x2a')](_0x14b94b[_0x4402('0x48')][_0x4402('0x2a')]);_0x5e7872[_0x4402('0x29')]=qs[_0x4402('0x29')](_0x14b94b[_0x4402('0x48')][_0x4402('0x29')]);}_0x5e7872['order']=qs['sort'](_0x14b94b['query']['sort']);_0x5e7872[_0x4402('0x50')]=qs[_0x4402('0x4a')](_[_0x4402('0x51')](_0x14b94b[_0x4402('0x48')],_0x214eec['filters']),_0x50552a);var _0x169bb2=[];var _0x12d6de=squel[_0x4402('0x52')]()[_0x4402('0x53')]('id')[_0x4402('0x53')](_0x4402('0x36'))[_0x4402('0x53')]('color')[_0x4402('0x54')](_0x4402('0x55'));var _0x38e6d1=squel[_0x4402('0x52')]()[_0x4402('0x53')](_0x4402('0x56'))['field'](_0x4402('0x57'))[_0x4402('0x53')](_0x4402('0x58'))[_0x4402('0x54')](_0x4402('0x59'),'ui')[_0x4402('0x5a')](_0x4402('0x5b'),'u','u.id\x20=\x20ui.UserId');var _0x48e138=squel[_0x4402('0x52')]()[_0x4402('0x54')](_0x4402('0x5c'),'i')['left_join']('cm_contacts','c',_0x4402('0x5d'))[_0x4402('0x5a')](_0x4402('0x5b'),'o',_0x4402('0x5e'))[_0x4402('0x5a')](_0x4402('0x5f'),'a',_0x4402('0x60'))[_0x4402('0x5a')](_0x4402('0x61'),'me',_0x4402('0x62'))[_0x4402('0x5a')](_0x4402('0x63'),'it',_0x4402('0x64'))['left_join'](_0x4402('0x55'),'t','t.id\x20=\x20it.TagId');var _0xe4530a=squel['expr']();var _0x3fb9f0=[];var _0x1e5891=squel[_0x4402('0x65')]();var _0x31e36c;if(_0x14b94b[_0x4402('0x48')][_0x4402('0x66')]){_0x31e36c=as['parseSearch'](_0x14b94b[_0x4402('0x48')][_0x4402('0x66')]);var _0xa390ce=_0x31e36c[_0x4402('0x67')];for(var _0xb341ab=0x0;_0xb341ab<_0x31e36c['conditions'][_0x4402('0x4e')];_0xb341ab++){var _0x31d993=_0x31e36c[_0x4402('0x68')][_0xb341ab];var _0xc15c0b='i';var _0x309077=_[_0x4402('0x69')](_0x50552a,[_0x4402('0x36'),_0x31d993[_0x4402('0x53')]]);if(!_0x309077){switch(_0x31d993['field']){case _0x4402('0x6a'):if(_0x31d993[_0x4402('0x6b')]==0x1){_0x48e138['having']('`'+_0x31d993[_0x4402('0x53')]+_0x4402('0x6c'));}else{_0x48e138['having']('`'+_0x31d993['field']+_0x4402('0x6d'));}break;case _0x4402('0x6e'):if(_0x31d993[_0x4402('0x6f')]==='$substring'){if(_0x31d993[_0x4402('0x6b')][_0x4402('0x3f')]('\x20')[_0x4402('0x4e')]>0x1){_0xe4530a[_0xa390ce]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4402('0x70')](_0x31d993[_0x4402('0x6b')]),null);}else{var _0xdde09f='%'+_0x31d993['value']+'%';_0xe4530a[_0xa390ce](_0x4402('0x71'),_0xdde09f,_0xdde09f,_0xdde09f);}}else{_0x309077=_[_0x4402('0x69')](_0x50552a,['name','ContactId']);_0x31d993[_0x4402('0x53')]='ContactId';_0x53e553=as[_0x4402('0x72')](_0xc15c0b,_0x309077[_0x4402('0x73')],_0x31d993);_0xe4530a[_0xa390ce](_0x53e553['text'],_0x53e553['value'][_0x4402('0x74')],_0x53e553[_0x4402('0x6b')][_0x4402('0x27')]);}break;case _0x4402('0x75'):var _0x4ac95e=_0x31d993[_0x4402('0x6b')][_0x4402('0x3f')](',')[_0x4402('0x42')](function(_0x168095){return Number(_0x168095);});_0x4ac95e[_0x4402('0x40')](function(_0x26b1ad){_0x1e5891['or'](_0x4402('0x76'),'%,'+_0x26b1ad+',%');});_0x3fb9f0=_['union'](_0x3fb9f0,_0x4ac95e);break;case _0x4402('0x77'):if(_0x31d993[_0x4402('0x6f')]==='$substring'){_0xe4530a[_0xa390ce]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x31d993[_0x4402('0x6b')]+'%',null);}else{_0x309077=_['find'](_0x50552a,[_0x4402('0x36'),'UserId']);_0x31d993[_0x4402('0x53')]=_0x4402('0x78');_0x53e553=as[_0x4402('0x72')](_0xc15c0b,_0x309077[_0x4402('0x73')],_0x31d993);_0xe4530a[_0xa390ce](_0x53e553[_0x4402('0x79')],_0x53e553[_0x4402('0x6b')][_0x4402('0x74')],_0x53e553[_0x4402('0x6b')][_0x4402('0x27')]);}break;case _0x4402('0x7a'):_0x53e553=as[_0x4402('0x72')]('me',null,_0x31d993);_0xe4530a[_0xa390ce](_0x53e553[_0x4402('0x79')],_0x53e553[_0x4402('0x6b')][_0x4402('0x74')],_0x53e553[_0x4402('0x6b')][_0x4402('0x27')]);break;}}else{var _0x53e553=as[_0x4402('0x72')](_0xc15c0b,_0x309077[_0x4402('0x73')],_0x31d993);_0xe4530a[_0xa390ce](_0x53e553[_0x4402('0x79')],_0x53e553['value'][_0x4402('0x74')],_0x53e553['value'][_0x4402('0x27')]);}}}else{var _0x1b1147=_(_0x14b94b[_0x4402('0x48')])[_0x4402('0x49')]()['map'](function(_0xac8513){return _['some'](_0x50552a,[_0x4402('0x36'),_0xac8513])?_0xac8513:undefined;})[_0x4402('0x7b')]()[_0x4402('0x6b')]();if(!_['isEmpty'](_0x1b1147)){_0x1b1147[_0x4402('0x40')](function(_0x4c98eb){if(_0x4c98eb===_0x4402('0x7c')){_0x48e138[_0x4402('0x50')](_0x4402('0x7d'),[][_0x4402('0x7e')](_0x14b94b[_0x4402('0x48')][_0x4c98eb]));}else if(_0x4c98eb===_0x4402('0x7f')){var _0x19b427=JSON[_0x4402('0x80')](_0x14b94b[_0x4402('0x48')][_0x4c98eb])['$gte'];var _0x44d806=JSON[_0x4402('0x80')](_0x14b94b[_0x4402('0x48')][_0x4c98eb])[_0x4402('0x81')];_0x48e138[_0x4402('0x50')](_0x4402('0x82'),_0x19b427,_0x44d806);}else{if(_0x14b94b[_0x4402('0x48')][_0x4c98eb]===_0x4402('0x83')){_0x48e138[_0x4402('0x50')]('i.'+_0x4c98eb+'\x20IS\x20NULL');}else{_0x48e138[_0x4402('0x50')]('i.'+_0x4c98eb+_0x4402('0x84'),_0x14b94b[_0x4402('0x48')][_0x4c98eb]);}}});}if(_0x14b94b['query'][_0x4402('0x85')]){if(_0x14b94b['query'][_0x4402('0x85')]==0x1){_0x48e138['having'](_0x4402('0x86'));}else{_0x48e138[_0x4402('0x87')]('`unreadMessages`\x20>\x200');}}if(_0x14b94b[_0x4402('0x48')]['tag']){_0x3fb9f0=_[_0x4402('0x88')](_0x14b94b[_0x4402('0x48')]['tag'])?_0x14b94b[_0x4402('0x48')][_0x4402('0x89')]:new Array(_0x14b94b['query'][_0x4402('0x89')]);_0x3fb9f0[_0x4402('0x40')](function(_0x4f0915){_0x1e5891['or'](_0x4402('0x76'),'%,'+_0x4f0915+',%');});}if(_0x14b94b[_0x4402('0x48')][_0x4402('0x8a')]){var _0x12b834=_0x14b94b[_0x4402('0x48')][_0x4402('0x8a')][_0x4402('0x8b')]('\x5c','\x5c\x5c')[_0x4402('0x8b')](/'/g,'\x27\x27');if(qs[_0x4402('0x8c')](_0x12b834)){_0xe4530a['or'](_0x4402('0x8d'),_0x12b834+'%');}else{_0xe4530a['or'](_0x4402('0x8e'),qs[_0x4402('0x70')](_0x12b834))['or'](_0x4402('0x8f'),_0x12b834+'%');}}}_0x48e138[_0x4402('0x50')](_0xe4530a);_0x48e138['group'](_0x4402('0x90'));var _0xc3914e={'type':db['Sequelize'][_0x4402('0x91')]['SELECT'],'raw':!![]};var _0x2c7ff5=_0x48e138[_0x4402('0x92')]();_0x2c7ff5[_0x4402('0x53')]('i.id');_0x2c7ff5[_0x4402('0x53')](_0x4402('0x93'),_0x4402('0x6a'));if(_0x5e7872['order']){_0x5e7872[_0x4402('0x94')][_0x4402('0x40')](function(_0x179eb4){var _0x1a0a6f=_0x179eb4[0x0]==='contactName'?_0x179eb4[0x0]:'i.'+_0x179eb4[0x0];_0x48e138[_0x4402('0x94')](_0x1a0a6f,_0x179eb4[0x1]===_0x4402('0x95')?![]:!![]);});}if(!_[_0x4402('0x96')](_0x3fb9f0)){_0x48e138[_0x4402('0x87')](_0x1e5891);_0x2c7ff5[_0x4402('0x50')](_0x4402('0x97'),_0x3fb9f0);}BPromise[_0x4402('0x98')]()[_0x4402('0x34')](function(){if(!_0x31e36c){if(_0x14b94b[_0x4402('0x48')][_0x4402('0x7c')])return;_0x2c7ff5[_0x4402('0x50')](_0x4402('0x99'));_0x48e138[_0x4402('0x50')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x14b94b[_0x4402('0x9a')][_0x4402('0x9b')]!==_0x4402('0x39'))return;return _0x14b94b[_0x4402('0x9a')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x284b52){if(_[_0x4402('0x96')](_0x284b52)){_0x2c7ff5[_0x4402('0x50')](_0x4402('0x9c'));_0x48e138['where'](_0x4402('0x9c'));}else{_0x2c7ff5[_0x4402('0x50')]('i.ChatWebsiteId\x20IN\x20?',_[_0x4402('0x42')](_0x284b52,'id'));_0x48e138[_0x4402('0x50')](_0x4402('0x7d'),_[_0x4402('0x42')](_0x284b52,'id'));}});})[_0x4402('0x34')](function(){if(_0x14b94b['user'][_0x4402('0x9b')]===_0x4402('0x39')&&!_0x31e36c&&!_0x14b94b[_0x4402('0x48')][_0x4402('0x7c')])return[];return db[_0x4402('0x9d')][_0x4402('0x48')](_0x2c7ff5[_0x4402('0x9e')](),_0xc3914e);})['then'](function(_0x218640){_0x370878[_0x4402('0x2c')]=_0x218640[_0x4402('0x4e')];if(_0x370878[_0x4402('0x2c')]===0x0)return[];return db[_0x4402('0x9d')]['query'](_0x12d6de[_0x4402('0x9e')](),_0xc3914e)[_0x4402('0x34')](function(_0x572e21){_0x169bb2=_[_0x4402('0x9f')](_0x572e21,'id');_0xc3914e=_['merge'](_0xc3914e,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14b94b[_0x4402('0x48')]['fields']){_0x5e7872[_0x4402('0x4d')]['forEach'](function(_0x51e85d){_0x48e138[_0x4402('0x53')]('i.'+_0x51e85d);});}else{_0x48e138[_0x4402('0x53')](_0x4402('0x93'),_0x4402('0x6a'));_0x48e138[_0x4402('0x53')](_0x4402('0xa0'),'Account.key');_0x48e138[_0x4402('0x53')](_0x4402('0xa1'),'Account.mandatoryDisposition');_0x48e138[_0x4402('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','contactName');_0x48e138[_0x4402('0x53')]('i.*');_0x48e138[_0x4402('0x53')](_0x4402('0xa2'),_0x4402('0xa3'));_0x48e138[_0x4402('0x53')](_0x4402('0xa4'),'Contact.lastName');_0x48e138['field'](_0x4402('0xa5'),_0x4402('0xa6'));_0x48e138['field'](_0x4402('0xa7'),_0x4402('0xa8'));_0x48e138[_0x4402('0x53')](_0x4402('0xa9'),_0x4402('0xaa'));_0x48e138[_0x4402('0x53')]('c.fax','Contact.fax');_0x48e138[_0x4402('0x53')](_0x4402('0xab'),_0x4402('0xac'));_0x48e138[_0x4402('0x53')](_0x4402('0xad'),_0x4402('0xae'));_0x48e138['field'](_0x4402('0xaf'),_0x4402('0x3d'));}if(_0x5e7872[_0x4402('0x2a')])_0x48e138[_0x4402('0x2a')](_0x5e7872[_0x4402('0x2a')]);if(_0x5e7872['offset'])_0x48e138[_0x4402('0x29')](_0x5e7872[_0x4402('0x29')]);return db[_0x4402('0x9d')][_0x4402('0x48')](_0x48e138[_0x4402('0x9e')](),_0xc3914e);})[_0x4402('0x34')](function(_0x518b0b){if(_0x518b0b['length']>0x0)_0x38e6d1[_0x4402('0x50')]('ui.ChatInteractionId\x20IN\x20?',_[_0x4402('0x42')](_0x518b0b,'id'));return db[_0x4402('0x9d')][_0x4402('0x48')](_0x38e6d1[_0x4402('0x9e')](),_0xc3914e)[_0x4402('0x34')](function(_0x25b3ee){var _0x70bdbd=_[_0x4402('0xb0')](_0x25b3ee,_0x4402('0xb1'));var _0x23306f=[];_0x518b0b[_0x4402('0x40')](function(_0x425a1b){_0x23306f[_0x4402('0xb2')](updateChatInteraction(_0x425a1b,_0x169bb2,_0x70bdbd));});return BPromise[_0x4402('0xb3')](_0x23306f);});});})[_0x4402('0x34')](function(_0x1ba5a1){_0x370878[_0x4402('0xb4')]=_0x1ba5a1;return _0x370878;})[_0x4402('0x34')](respondWithFilteredResult(_0x3236fc,_0x5e7872))[_0x4402('0x41')](handleError(_0x3236fc,null));};exports[_0x4402('0xb5')]=function(_0xe37b11,_0x385b8e){var _0x418070={'raw':![],'where':{'id':_0xe37b11[_0x4402('0xb6')]['id']}},_0x47a76a={};_0x47a76a[_0x4402('0x47')]=_[_0x4402('0x49')](db[_0x4402('0x43')][_0x4402('0x44')]);_0x47a76a[_0x4402('0x48')]=_['keys'](_0xe37b11['query']);_0x47a76a[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x47a76a[_0x4402('0x47')],_0x47a76a['query']);_0x418070['attributes']=_['intersection'](_0x47a76a['model'],qs[_0x4402('0x4c')](_0xe37b11[_0x4402('0x48')][_0x4402('0x4c')]));_0x418070['attributes']=_0x418070[_0x4402('0x4d')][_0x4402('0x4e')]?_0x418070[_0x4402('0x4d')]:_0x47a76a['model'];if(_0xe37b11[_0x4402('0x48')]['includeAll']){_0x418070[_0x4402('0xb7')]=[{'all':!![]}];}_0x418070=_[_0x4402('0x38')]({},_0x418070,_0xe37b11[_0x4402('0xb8')]);return db[_0x4402('0x43')][_0x4402('0x69')](_0x418070)[_0x4402('0x34')](handleEntityNotFound(_0x385b8e,null))['then'](respondWithResult(_0x385b8e,null))[_0x4402('0x41')](handleError(_0x385b8e,null));};exports[_0x4402('0xb9')]=function(_0x3ac6b9,_0x55c3fd){return db[_0x4402('0x43')]['create'](_0x3ac6b9[_0x4402('0x7a')],{})[_0x4402('0x34')](respondWithResult(_0x55c3fd,0xc9))[_0x4402('0x41')](handleError(_0x55c3fd,null));};exports[_0x4402('0x32')]=function(_0x54d6dc,_0x91c49){if(_0x54d6dc[_0x4402('0x7a')]['id']){delete _0x54d6dc[_0x4402('0x7a')]['id'];}return db[_0x4402('0x43')][_0x4402('0x69')]({'where':{'id':_0x54d6dc['params']['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x91c49,null))[_0x4402('0x34')](saveUpdates(_0x54d6dc['body'],null))['then'](respondWithResult(_0x91c49,null))['catch'](handleError(_0x91c49,null));};exports[_0x4402('0x33')]=function(_0x42b774,_0x246ff2){return db[_0x4402('0x43')]['find']({'where':{'id':_0x42b774[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x246ff2,null))[_0x4402('0x34')](removeEntity(_0x246ff2,null))[_0x4402('0x41')](handleError(_0x246ff2,null));};exports['describe']=function(_0x2a3361,_0x2949ce){return db[_0x4402('0x43')]['describe']()['then'](respondWithResult(_0x2949ce,null))['catch'](handleError(_0x2949ce,null));};exports[_0x4402('0xba')]=function(_0x48bf30,_0x17c5c2){var _0x35c16f=_0x48bf30[_0x4402('0xb6')]['id'];var _0x117911;var _0x87ae2a;var _0xd604a5;return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x35c16f}})[_0x4402('0x34')](function(_0x423f83){_0x117911=_0x423f83;return db[_0x4402('0xbc')][_0x4402('0xbb')]({'where':{'id':_0x423f83[_0x4402('0x7c')]},'attributes':['id',_0x4402('0xbd'),'vidaooEscalation',_0x4402('0xbe'),_0x4402('0xbf'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x57fd83){if(_0x57fd83&&_0x57fd83[_0x4402('0xbd')]&&_0x57fd83['vidaooEscalation']){_0x87ae2a=_0x57fd83;var _0x47aa8b={'interaction':{'id':_0x35c16f},'agent':{'id':_0x48bf30[_0x4402('0x9a')]['id'],'name':_0x48bf30[_0x4402('0x9a')]['name'],'fullname':_0x48bf30[_0x4402('0x9a')][_0x4402('0xc0')],'email':_0x48bf30[_0x4402('0x9a')][_0x4402('0xc1')]},'contact':_0x48bf30['body'][_0x4402('0xc2')],'account':_0x48bf30[_0x4402('0x7a')][_0x4402('0x3b')]};var _0x286500={'rejectUnauthorized':![],'method':_0x4402('0xc3'),'url':_0x4402('0xc4'),'headers':{'X-APIKEY':_0x57fd83[_0x4402('0xbd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x48bf30[_0x4402('0x9a')][_0x4402('0xc1')]],'buttons':null,'topic':_0x87ae2a['vidaooTopic'],'note':_[_0x4402('0xc5')](_0x87ae2a[_0x4402('0xbf')])?null:getMustacheRender(_0x87ae2a[_0x4402('0xbf')],_0x47aa8b),'metadata':null},'redirect':_0x4402('0xc6'),'json':!![]};try{if(!_['isNull'](_0x87ae2a[_0x4402('0xc7')])){var _0x4bf0ff=getMustacheRender(_0x87ae2a[_0x4402('0xc7')],_0x47aa8b);var _0x29ffd4=JSON['parse'](_0x4bf0ff);_0x286500['body'][_0x4402('0xc8')]=_0x29ffd4;}}catch(_0x173f64){throw new db[(_0x4402('0xc9'))][(_0x4402('0xca'))](_0x4402('0xcb'));}return rp(_0x286500);}else{throw new db[(_0x4402('0xc9'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x4402('0x34')](function(_0x54e61e){_0xd604a5=_0x54e61e;if(_0xd604a5['id']){var _0xc47081={'body':_0xd604a5[_0x4402('0xcc')],'ChatWebsiteId':_0x87ae2a['id'],'ChatInteractionId':_0x117911['id'],'direction':_0x4402('0xcd'),'UserId':_0x48bf30[_0x4402('0x9a')]['id']};return db['ChatMessage'][_0x4402('0xb9')](_0xc47081,{});}else{throw new db[(_0x4402('0xc9'))][(_0x4402('0xca'))](_0x4402('0xce'));}})[_0x4402('0x34')](function(){return _0x117911[_0x4402('0xcf')]({'vidaooSessionId':_0xd604a5['id']});})['then'](respondWithResult(_0x17c5c2,null))['catch'](handleError(_0x17c5c2,null));};exports[_0x4402('0xd0')]=function(_0x5a768b,_0x38d7b5){if(_0x5a768b[_0x4402('0x7a')]['id']){delete _0x5a768b['body']['id'];}return db[_0x4402('0x43')]['find']({'where':{'id':_0x5a768b[_0x4402('0xb6')]['id']},'include':[{'model':db[_0x4402('0xd1')],'as':_0x4402('0x6e')}]})['then'](handleEntityNotFound(_0x38d7b5,null))[_0x4402('0x34')](saveUpdates(_0x5a768b['body'],null))[_0x4402('0x34')](respondWithResult(_0x38d7b5,null))[_0x4402('0x41')](handleError(_0x38d7b5,null));};exports[_0x4402('0xd2')]=function(_0x1fc790,_0xaaf390,_0x53be9e){if(_0x1fc790['body']['id']){delete _0x1fc790[_0x4402('0x7a')]['id'];}return db['ChatInteraction'][_0x4402('0x69')]({'where':{'id':_0x1fc790[_0x4402('0xb6')]['id']}})['then'](function(_0x50d453){if(!_0x50d453){logger[_0x4402('0x24')](_0x4402('0xd3'),_0x4402('0xd2'),0x194,_0x4402('0xd4'));_0xaaf390[_0x4402('0x35')](0x194);}else{if(_0x50d453[_0x4402('0x78')]){throw new db[(_0x4402('0xc9'))][(_0x4402('0xca'))]('Interaction\x20already\x20assigned');}}return _0x50d453;})['then'](function(_0xf3be9){if(_0xf3be9){return _0xf3be9[_0x4402('0x32')]({'closed':_0x1fc790[_0x4402('0x7a')]['closed'],'disposition':_0x1fc790[_0x4402('0x7a')]['disposition']})[_0x4402('0x34')](function(_0x1237a3){return _0x1237a3;});}})[_0x4402('0x34')](function(_0x4a0fd9){return respondWithRpcPromise(_0x4402('0xd5'),_0x4402('0xd2'),_0x1fc790['body'],client9004);})[_0x4402('0x34')](respondWithResult(_0xaaf390,null))[_0x4402('0x41')](handleError(_0xaaf390,null));};exports[_0x4402('0xd6')]=function(_0x8c436d,_0x15e9d3,_0xa0d1ee){_0x8c436d[_0x4402('0x7a')][_0x4402('0x36')]=_0x8c436d[_0x4402('0xd7')][_0x4402('0xd8')];_0x8c436d[_0x4402('0x7a')][_0x4402('0xd9')]=_0x8c436d['file'][_0x4402('0xda')];_0x8c436d[_0x4402('0x7a')][_0x4402('0x73')]=_0x8c436d[_0x4402('0xd7')][_0x4402('0xdb')];return db[_0x4402('0xdc')][_0x4402('0xb9')](_0x8c436d[_0x4402('0x7a')])[_0x4402('0x34')](respondWithResult(_0x15e9d3,0xc9))['catch'](handleError(_0x15e9d3,null));};exports[_0x4402('0xdd')]=function(_0x113451,_0x338e97,_0x4c6d4e){return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x113451['params']['id']},'raw':!![]})[_0x4402('0x34')](handleEntityNotFound(_0x338e97,null))[_0x4402('0x34')](function(_0x491a8e){if(_0x491a8e){if(_0x491a8e['closed']){return _0x338e97[_0x4402('0x28')](0x193)[_0x4402('0x2e')]({'status':0x193,'message':_0x4402('0xde')});}return db[_0x4402('0xdc')]['findOne']({'where':{'id':_0x113451[_0x4402('0x48')]['attachId']},'raw':!![]})[_0x4402('0x34')](handleEntityNotFound(_0x338e97,null));}})[_0x4402('0x34')](function(_0x171672){if(_0x171672){var _0xdbd1c8=_0x171672[_0x4402('0xdf')]!==null;var _0x5d190e=path[_0x4402('0xe0')](config[_0x4402('0xe1')],_0x4402('0xe2'));if(_0xdbd1c8){_0x5d190e=path[_0x4402('0xe0')](_0x5d190e,_0x4402('0xe3'));}var _0x23de88=path[_0x4402('0xe0')](_0x5d190e,_0x171672[_0x4402('0xd9')]);return _0x338e97[_0x4402('0xe4')](_0x23de88);}})[_0x4402('0x41')](handleError(_0x338e97,null));};exports[_0x4402('0xe5')]=function(_0x55274b,_0x2afc41){var _0x1c5cad=null;var _0x3b8f77=null;var _0x2b3b75=null;var _0x1ba411=null;if(_0x55274b[_0x4402('0x7a')]['id']){delete _0x55274b[_0x4402('0x7a')]['id'];}if(_0x55274b[_0x4402('0x7a')][_0x4402('0xe6')]){_0x1ba411=path[_0x4402('0xe0')](config['root'],_0x4402('0xe7'),util[_0x4402('0xe8')](_0x4402('0xe9'),Date['now']()));_0x55274b[_0x4402('0x7a')][_0x4402('0xea')]=_0x1ba411;}return db['ChatInteraction'][_0x4402('0x69')]({'where':{'id':_0x55274b[_0x4402('0xb6')]['id']},'include':[{'model':db[_0x4402('0xeb')],'as':_0x4402('0xec'),'include':[{'model':db[_0x4402('0x77')],'as':_0x4402('0x77')}]}]})[_0x4402('0x34')](handleEntityNotFound(_0x2afc41,null))[_0x4402('0x34')](saveUpdates(_0x55274b[_0x4402('0x7a')],null))[_0x4402('0x34')](function(_0x2d86c7){if(_0x2d86c7){_0x1c5cad=_0x2d86c7;return db['ChatWebsite'][_0x4402('0x69')]({'where':{'id':_0x1c5cad[_0x4402('0x7c')]}});}})[_0x4402('0x34')](function(_0x47837e){if(_0x47837e){_0x2b3b75=_0x47837e;return db[_0x4402('0xd1')][_0x4402('0x69')]({'where':{'id':_0x1c5cad[_0x4402('0xed')]}});}})[_0x4402('0x34')](function(_0x259c23){if(_0x259c23){_0x3b8f77=_0x259c23;if(_0x1ba411){var _0x535d83=null;for(var _0x2f3d6e=0x1;_0x2f3d6e<_0x1c5cad['Messages'][_0x4402('0x4e')];++_0x2f3d6e){_0x535d83=_0x1c5cad[_0x4402('0xec')][_0x2f3d6e];var _0x395d17=_0x535d83[_0x4402('0x78')]?util[_0x4402('0xe8')](_0x4402('0xee'),_0x2b3b75[_0x4402('0xef')],_0x535d83[_0x4402('0x78')]):_0x4402('0xf0');var _0x51bdf7=_0x55274b[_0x4402('0x7a')]['customer']||util[_0x4402('0xe8')](_0x4402('0xee'),_0x4402('0xf1'),_0x535d83[_0x4402('0xed')]);switch(_0x2b3b75[_0x4402('0xf2')]){case _0x4402('0xf3'):_0x395d17=_0x535d83['UserId']?util[_0x4402('0xe8')]('%s%d',_0x2b3b75[_0x4402('0xef')],_0x535d83['UserId']):_0x4402('0xf0');break;case _0x4402('0xf4'):_0x395d17=_0x535d83[_0x4402('0x78')]?_0x535d83[_0x4402('0x77')][_0x4402('0xf5')]||_0x535d83[_0x4402('0x77')][_0x4402('0xc0')]:_0x4402('0xf0');break;case _0x4402('0xf6'):_0x395d17=_0x535d83['UserId']?_0x535d83[_0x4402('0x77')]['fullname']:'System';break;default:_0x395d17=_0x535d83['UserId']?util[_0x4402('0xe8')](_0x4402('0xee'),_0x2b3b75[_0x4402('0xef')],_0x535d83['UserId']):_0x4402('0xf0');}var _0x1accec=util[_0x4402('0xe8')](_0x4402('0xf7'),moment(_0x535d83[_0x4402('0x7f')])[_0x4402('0xe8')](_0x4402('0xf8')),_0x535d83[_0x4402('0xf9')]==='in'?_0x51bdf7:_0x395d17,_0x535d83[_0x4402('0x7a')]);if(!_0x535d83[_0x4402('0xfa')]){fs[_0x4402('0xfb')](_0x1ba411,_0x1accec);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4402('0xfc')],'as':_0x4402('0xfd'),'raw':!![]}]});}}})[_0x4402('0x34')](function(_0x23dbb4){if(_0x23dbb4&&_0x23dbb4[_0x4402('0xfd')]&&_0x55274b['body']){var _0x494b72={'tls':{'rejectUnauthorized':![]}};if(_0x23dbb4[_0x4402('0xfd')][_0x4402('0xfe')]){_0x494b72[_0x4402('0xfe')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0xfe')];}else{_0x494b72[_0x4402('0xff')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0xff')];_0x494b72[_0x4402('0x100')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0x100')];_0x494b72[_0x4402('0x101')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0x101')];}if(_0x23dbb4[_0x4402('0xfd')][_0x4402('0x102')]){_0x494b72[_0x4402('0x103')]={'user':_0x23dbb4[_0x4402('0xfd')][_0x4402('0x9a')],'pass':_0x23dbb4[_0x4402('0xfd')][_0x4402('0x104')]};}return respondWithRpcPromise(_0x4402('0x105'),_0x4402('0x106'),{'account':_0x494b72,'message':{'from':util[_0x4402('0xe8')](_0x4402('0x107'),_0x23dbb4[_0x4402('0x36')],_0x23dbb4['email']||_0x23dbb4[_0x4402('0xfd')][_0x4402('0x9a')]),'to':_0x55274b[_0x4402('0x7a')][_0x4402('0xe6')],'subject':_0x4402('0x108'),'text':util[_0x4402('0xe8')](_0x4402('0x109'),_0x55274b[_0x4402('0x7a')][_0x4402('0xe6')]),'attachments':[{'path':_0x1ba411}]}})['then'](function(){return _0x1c5cad;})[_0x4402('0x41')](function(_0x3ba561){console[_0x4402('0x24')](_0x3ba561);});}else{return _0x1c5cad;}})[_0x4402('0x34')](respondWithStatusCode(_0x2afc41,0xc8))[_0x4402('0x41')](handleError(_0x2afc41,null));};exports[_0x4402('0x10a')]=function(_0x10f917,_0x1155d1,_0x17c1ee){return db['ChatMessage'][_0x4402('0x69')]({'where':{'id':_0x10f917[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x1155d1,null))[_0x4402('0x34')](function(_0x37ea8d){if(_0x37ea8d){return _0x37ea8d[_0x4402('0x10a')](_0x10f917[_0x4402('0x7a')]['ids'],_[_0x4402('0x10b')](_0x10f917[_0x4402('0x7a')],['ids','id'])||{});}})[_0x4402('0x34')](respondWithResult(_0x1155d1,null))[_0x4402('0x41')](handleError(_0x1155d1,null));};exports[_0x4402('0x10c')]=function(_0x3e78da,_0x1bf636,_0x44b095){var _0x2433a1={'raw':![],'where':{}};var _0x4069cf={};var _0x7be513={'count':0x0,'rows':[]};return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x3e78da[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x1bf636,null))[_0x4402('0x34')](function(_0x1f2219){if(_0x1f2219){_0x4069cf[_0x4402('0x47')]=_[_0x4402('0x49')](db[_0x4402('0xeb')][_0x4402('0x44')]);_0x4069cf[_0x4402('0x48')]=_[_0x4402('0x49')](_0x3e78da[_0x4402('0x48')]);_0x4069cf[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x4069cf[_0x4402('0x47')],_0x4069cf[_0x4402('0x48')]);_0x2433a1[_0x4402('0x4d')]=_[_0x4402('0x4b')](_0x4069cf[_0x4402('0x47')],qs[_0x4402('0x4c')](_0x3e78da[_0x4402('0x48')]['fields']));_0x2433a1[_0x4402('0x4d')]=_0x2433a1['attributes']['length']?_0x2433a1[_0x4402('0x4d')]:_0x4069cf[_0x4402('0x47')];if(!_0x3e78da[_0x4402('0x48')][_0x4402('0x10d')](_0x4402('0x4f'))){_0x2433a1['limit']=qs[_0x4402('0x2a')](_0x3e78da[_0x4402('0x48')][_0x4402('0x2a')]);_0x2433a1['offset']=qs[_0x4402('0x29')](_0x3e78da[_0x4402('0x48')][_0x4402('0x29')]);}_0x2433a1[_0x4402('0x94')]=qs['sort'](_0x3e78da[_0x4402('0x48')][_0x4402('0x10e')]);_0x2433a1['where']=qs['filters'](_['pick'](_0x3e78da['query'],_0x4069cf[_0x4402('0x4a')]));_0x2433a1[_0x4402('0x50')][_0x4402('0xb1')]=_0x1f2219['id'];if(_0x3e78da['query'][_0x4402('0x8a')]){_0x2433a1[_0x4402('0x50')]=_[_0x4402('0x38')](_0x2433a1['where'],{'$or':_[_0x4402('0x42')](_0x2433a1[_0x4402('0x4d')],function(_0x2466a1){var _0x55ed20={};_0x55ed20[_0x2466a1]={'$like':'%'+_0x3e78da[_0x4402('0x48')][_0x4402('0x8a')]+'%'};return _0x55ed20;})});}if(_0x3e78da['query'][_0x4402('0x10f')]){var _0x335d93=_0x3e78da[_0x4402('0x48')][_0x4402('0x10f')]['split'](',');var _0x3aebf6={};_0x3aebf6[_0x335d93[0x0]]={'$gte':moment(_0x335d93[0x1])['format'](_0x4402('0x110'))};_0x2433a1['where']=_['merge'](_0x2433a1[_0x4402('0x50')],_0x3aebf6);}_0x2433a1=_[_0x4402('0x38')]({},_0x2433a1,_0x3e78da[_0x4402('0xb8')]);return db[_0x4402('0xeb')][_0x4402('0x2c')]({'where':_0x2433a1[_0x4402('0x50')]})[_0x4402('0x34')](function(_0x87e1c){_0x7be513['count']=_0x87e1c;if(_0x3e78da[_0x4402('0x48')][_0x4402('0x111')]){_0x2433a1[_0x4402('0xb7')]=[{'all':!![]}];}return db[_0x4402('0xeb')][_0x4402('0x112')](_0x2433a1);})['then'](function(_0x20b540){_0x7be513['rows']=_0x20b540;return _0x7be513;});}})[_0x4402('0x34')](respondWithFilteredResult(_0x1bf636,_0x2433a1))[_0x4402('0x41')](handleError(_0x1bf636,null));};exports[_0x4402('0x113')]=function(_0x516583,_0x182827,_0x284292){var _0x579bab={'where':{}},_0x30cdd6={},_0x1ac943={'count':0x0,'rows':[]};return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x516583[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x182827,null))[_0x4402('0x34')](function(_0xe8f398){if(_0xe8f398){_0x30cdd6[_0x4402('0x47')]=_[_0x4402('0x49')](db[_0x4402('0xeb')][_0x4402('0x44')]);_0x30cdd6[_0x4402('0x48')]=_[_0x4402('0x49')](_0x516583['query']);_0x30cdd6[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x30cdd6[_0x4402('0x47')],_0x30cdd6[_0x4402('0x48')]);_0x579bab[_0x4402('0x4d')]=_[_0x4402('0x4b')](_0x30cdd6[_0x4402('0x47')],qs[_0x4402('0x4c')](_0x516583['query'][_0x4402('0x4c')]));_0x579bab[_0x4402('0x4d')]=_0x579bab[_0x4402('0x4d')]['length']?_0x579bab[_0x4402('0x4d')]:_0x30cdd6[_0x4402('0x47')];if(!_0x516583[_0x4402('0x48')][_0x4402('0x10d')](_0x4402('0x4f'))){_0x579bab[_0x4402('0x2a')]=qs[_0x4402('0x2a')](_0x516583['query']['limit']);_0x579bab[_0x4402('0x29')]=qs[_0x4402('0x29')](_0x516583[_0x4402('0x48')][_0x4402('0x29')]);}_0x579bab[_0x4402('0x94')]=qs['sort'](_0x516583[_0x4402('0x48')][_0x4402('0x10e')]);_0x579bab[_0x4402('0x50')]=qs['filters'](_[_0x4402('0x51')](_0x516583['query'],_0x30cdd6[_0x4402('0x4a')]));_0x579bab[_0x4402('0x50')][_0x4402('0xb1')]=_0xe8f398['id'];if(_0x516583[_0x4402('0x48')]['filter']){_0x579bab[_0x4402('0x50')]=_[_0x4402('0x38')](_0x579bab[_0x4402('0x50')],{'$or':_[_0x4402('0x42')](_0x579bab[_0x4402('0x4d')],function(_0x3adad4){var _0x207b70={};_0x207b70[_0x3adad4]={'$like':'%'+_0x516583['query']['filter']+'%'};return _0x207b70;})});}_0x579bab[_0x4402('0x50')][_0x4402('0xfa')]=![];if(_0x516583[_0x4402('0x48')]['id']){_0x579bab['where']['id']={'$gt':_0x516583[_0x4402('0x48')]['id']};}_0x579bab=_[_0x4402('0x38')]({},_0x579bab,_0x516583[_0x4402('0xb8')]);return db['ChatMessage'][_0x4402('0x2c')]({'where':_0x579bab['where']})[_0x4402('0x34')](function(_0x2903fd){_0x1ac943[_0x4402('0x2c')]=_0x2903fd;_0x579bab['include']=[];if(_0x516583[_0x4402('0x48')][_0x4402('0x114')]){_0x579bab['include']['push']({'model':db['User'],'as':'User','attributes':['id',_0x4402('0xc0'),'alias']});}if(_0x516583['query'][_0x4402('0x111')]){_0x579bab['include']=[{'all':!![]}];}return db[_0x4402('0xeb')][_0x4402('0x112')](_0x579bab);})['then'](function(_0x230904){_0x1ac943[_0x4402('0xb4')]=_0x230904;return _0x1ac943;});}})[_0x4402('0x34')](respondWithFilteredResult(_0x182827,_0x579bab))['catch'](handleError(_0x182827,null));};exports[_0x4402('0x115')]=function(_0x5f42bc,_0x50999c,_0xc4375e){return db['ChatInteraction'][_0x4402('0x69')]({'where':{'id':_0x5f42bc['params']['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x50999c,null))[_0x4402('0x34')](function(_0x21a6d2){if(_0x21a6d2){return _0x21a6d2[_0x4402('0x116')](_0x5f42bc[_0x4402('0x7a')][_0x4402('0x117')],_[_0x4402('0x10b')](_0x5f42bc[_0x4402('0x7a')],[_0x4402('0x117'),'id'])||{})[_0x4402('0x118')](function(){return db[_0x4402('0x75')][_0x4402('0x112')]({'attributes':['id',_0x4402('0x36'),_0x4402('0x119')],'where':{'id':_0x5f42bc[_0x4402('0x7a')]['ids']}});})[_0x4402('0x34')](function(_0x132621){socket[_0x4402('0x11a')](_0x4402('0x11b'),{'id':Number(_0x5f42bc[_0x4402('0xb6')]['id']),'tags':_0x132621||[]});return{'id':Number(_0x5f42bc[_0x4402('0xb6')]['id']),'tags':_0x132621||[]};});}})[_0x4402('0x34')](respondWithResult(_0x50999c,null))[_0x4402('0x41')](handleError(_0x50999c,null));};exports[_0x4402('0x11c')]=function(_0x4e0ae2,_0x21e2c8,_0x1845d8){return db[_0x4402('0x43')]['find']({'where':{'id':_0x4e0ae2[_0x4402('0xb6')]['id']}})['then'](handleEntityNotFound(_0x21e2c8,null))[_0x4402('0x34')](function(_0x424e93){if(_0x424e93){return _0x424e93[_0x4402('0x11c')](_0x4e0ae2[_0x4402('0x48')]['ids']);}})[_0x4402('0x34')](respondWithStatusCode(_0x21e2c8,null))['catch'](handleError(_0x21e2c8,null));};exports[_0x4402('0xe4')]=function(_0x4cb0bf,_0x2a586e){var _0x5325a7=moment()[_0x4402('0x11d')]()['toString']();var _0x157060=path[_0x4402('0xe0')](config[_0x4402('0xe1')],_0x4402('0x11e'),_0x4402('0x11f'),_0x4402('0x120'));var _0x2ead56=path[_0x4402('0xe0')](config['root'],_0x4402('0x11e'),_0x4402('0x11f'),_0x4402('0x121'));var _0x31d19c=path[_0x4402('0xe0')](_0x157060,_0x5325a7);var _0x1675b2=util[_0x4402('0xe8')](_0x4402('0x122'),_0x4cb0bf['params']['id'],_0x5325a7);var _0xe5e2f3=path[_0x4402('0xe0')](_0x157060,_0x1675b2);var _0x22c8a1=[];_0x22c8a1[_0x4402('0xb2')]({'model':db[_0x4402('0x77')],'as':_0x4402('0x77'),'attributes':['id',_0x4402('0xc0')],'raw':!![]});_0x22c8a1[_0x4402('0xb2')]({'model':db[_0x4402('0xd1')],'as':_0x4402('0x6e'),'attributes':['id',_0x4402('0x123'),'lastName'],'raw':!![]});if(_0x4cb0bf[_0x4402('0x48')]['attachments']){_0x22c8a1[_0x4402('0xb2')]({'model':db[_0x4402('0xdc')],'as':_0x4402('0xdc'),'raw':!![]});}var _0x177297=[{'model':db['ChatMessage'],'as':_0x4402('0xec'),'attributes':['id','body',_0x4402('0x7f'),'direction',_0x4402('0xfa'),_0x4402('0x85')],'include':_0x22c8a1}];_0x177297[_0x4402('0xb2')]({'model':db[_0x4402('0xbc')],'as':_0x4402('0x124'),'attributes':['id',_0x4402('0x36')]});_0x177297[_0x4402('0xb2')]({'model':db[_0x4402('0x77')],'as':'Owner','attributes':['id',_0x4402('0xc0')]});return db[_0x4402('0x43')][_0x4402('0x69')]({'where':{'id':_0x4cb0bf[_0x4402('0xb6')]['id']},'include':_0x177297})[_0x4402('0x34')](handleEntityNotFound(_0x2a586e,null))[_0x4402('0x34')](function(_0x140207){if(_0x140207){var _0x1d2478=_0x140207[_0x4402('0x125')]({'plain':!![]});fs[_0x4402('0x126')](_0x31d19c);var _0x286a77={'channel':_0x4402('0x127'),'account':_0x1d2478[_0x4402('0x124')][_0x4402('0x36')],'agent':_0x1d2478['Owner']?_0x1d2478[_0x4402('0x128')][_0x4402('0xc0')]:_0x4402('0x129'),'createdAt':moment(_0x1d2478[_0x4402('0x7f')])[_0x4402('0xe8')](_0x4402('0x110'))[_0x4402('0x9e')](),'closedAt':_0x1d2478[_0x4402('0x12a')]?moment(_0x1d2478['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4402('0x9e')]():'','disposition':_0x1d2478['disposition'],'chatInfo':{'browser':_0x1d2478[_0x4402('0x12b')],'os':_0x1d2478['osName'],'referer':_0x1d2478[_0x4402('0x12c')],'customerIp':_0x1d2478[_0x4402('0x12d')],'customerPort':_0x1d2478[_0x4402('0x12e')]?_0x1d2478['customerPort']:_0x4402('0x129')},'messages':_(_0x1d2478[_0x4402('0xec')])[_0x4402('0x12f')]()[_0x4402('0x8a')]({'secret':![]})['map'](function(_0x633496){if(_0x633496[_0x4402('0xdc')]){var _0x5862a7=path[_0x4402('0xe0')](_0x2ead56,_0x633496['Attachment'][_0x4402('0xd9')]);if(fs[_0x4402('0x130')](_0x5862a7)){fs[_0x4402('0x131')](_0x5862a7)[_0x4402('0x132')](fs[_0x4402('0x133')](path[_0x4402('0xe0')](_0x31d19c,_0x633496[_0x4402('0xdc')][_0x4402('0xd9')])));}}return{'date':moment(_0x633496[_0x4402('0x7f')])[_0x4402('0xe8')](_0x4402('0x110'))[_0x4402('0x9e')](),'sender':_0x633496['direction']===_0x4402('0xcd')?_0x633496[_0x4402('0x77')]?_0x633496[_0x4402('0x77')][_0x4402('0xc0')]:_0x4402('0xf0'):_0x633496['Contact'][_0x4402('0x123')]+(_0x633496[_0x4402('0x6e')][_0x4402('0x134')]?'\x20'+_0x633496[_0x4402('0x6e')][_0x4402('0x134')]:''),'body':_0x633496[_0x4402('0xdc')]?_0x633496[_0x4402('0xdc')]['basename']:_0x633496[_0x4402('0x7a')],'direction':_0x633496['direction']===_0x4402('0xcd')?'A':'C','secret':_0x633496[_0x4402('0xfa')],'read':_0x633496[_0x4402('0x85')],'attachment':_0x633496['Attachment']};})[_0x4402('0x6b')]()};return ejs[_0x4402('0x135')](path[_0x4402('0xe0')](config[_0x4402('0xe1')],_0x4402('0x11e'),'views','downloadInteraction.ejs'),{'interaction':_0x286a77})['then'](function(_0x5b8cd8){var _0x3fc6b3=path[_0x4402('0xe0')](_0x31d19c,'transcript-'+_0x1d2478['id']+'-'+_0x5325a7+_0x4402('0x136'));var _0x15bbe1={'path':_0x3fc6b3,'channel':_0x4402('0x127'),'interactionId':_0x1d2478['id']};return pdf[_0x4402('0x137')](_0x5b8cd8,_0x15bbe1);})[_0x4402('0x34')](function(){return new BPromise(function(_0x303680,_0x281eaa){zipdir(_0x31d19c,{'saveTo':_0xe5e2f3},function(_0x1baf42,_0x3d743e){if(_0x1baf42)return _0x281eaa(_0x1baf42);return _0x303680(_0x3d743e);});})[_0x4402('0x34')](function(){return new BPromise(function(_0x5ad41f,_0xbeb577){rimraf(_0x31d19c,function(_0x8c8f01){if(_0x8c8f01)_0xbeb577(_0x8c8f01);return _0x5ad41f();});});})[_0x4402('0x34')](function(){return _0x2a586e[_0x4402('0xe4')](_0xe5e2f3,_0x1675b2,function(_0xc36aed){if(_0xc36aed){console['log'](_0x4402('0x138'),_0xc36aed);}else{fs[_0x4402('0x139')](_0xe5e2f3);}});});});}else{return _0x2a586e[_0x4402('0x35')](0xc8);}})[_0x4402('0x41')](handleError(_0x2a586e,null));}; \ No newline at end of file +var _0xb10b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','update','stack','name','send','body','contact','interaction','account','Users','map','fullname','TagIds','Tags','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_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','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','operator','$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?','find','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','buildExpression','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','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','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','catch','show','params','keys','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','close','mailTranscript','root','now','Messages','format','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','includeAgent','alias','findAll','setTags','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','disposition','osName','referer','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x2f4d7f,_0x62f4b7){var _0x147ba1=function(_0x14ef36){while(--_0x14ef36){_0x2f4d7f['push'](_0x2f4d7f['shift']());}};_0x147ba1(++_0x62f4b7);}(_0xb10b,0x12a));var _0xbb10=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0xb10b[_0x541a67];return _0x45da2a;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xbb10('0x13'));var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))('api');var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb10('0x17'));var db=require(_0xbb10('0x18'))['db'];config[_0xbb10('0x19')]=_[_0xbb10('0x1a')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))[_0xbb10('0x1d')](socket);var jayson=require(_0xbb10('0x1e'));var client=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232b});var client9004=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x3e26f4,_0x2b184e,_0x4a2bfc,_0x2eca0f){return new BPromise(function(_0x1145f1,_0x133ac2){var _0x42db98=_0x2eca0f||client;return _0x42db98[_0xbb10('0x21')](_0x3e26f4,_0x4a2bfc)[_0xbb10('0x22')](function(_0x575cca){logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x2b184e,_0xbb10('0x25'));logger['debug'](_0xbb10('0x26'),_0x2b184e,_0xbb10('0x25'),JSON[_0xbb10('0x27')](_0x575cca));if(_0x575cca[_0xbb10('0x28')]){if(_0x575cca[_0xbb10('0x28')][_0xbb10('0x29')]===0x1f4){logger['error'](_0xbb10('0x24'),_0x2b184e,_0x575cca[_0xbb10('0x28')]['message']);return _0x133ac2(_0x575cca['error'][_0xbb10('0x2a')]);}logger[_0xbb10('0x28')](_0xbb10('0x24'),_0x2b184e,_0x575cca[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x1145f1(_0x575cca[_0xbb10('0x28')][_0xbb10('0x2a')]);}else{logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x2b184e,_0xbb10('0x25'));_0x1145f1(_0x575cca[_0xbb10('0x2b')][_0xbb10('0x2a')]);}})['catch'](function(_0x4fedac){logger['error'](_0xbb10('0x24'),_0x2b184e,_0x4fedac);_0x133ac2(_0x4fedac);});});}function respondWithStatusCode(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0xcc;return function(_0x4e25ff){if(_0x4e25ff){return _0x3c5ae7[_0xbb10('0x2c')](_0x2c89b9);}return _0x3c5ae7[_0xbb10('0x2d')](_0x2c89b9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xc8;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9)['json'](_0x20d946);}};}function respondWithFilteredResult(_0x3796c7,_0x21ac54){return function(_0xfc3595){if(_0xfc3595){var _0x2e0249=typeof _0x21ac54[_0xbb10('0x2f')]===_0xbb10('0x30')&&typeof _0x21ac54['limit']===_0xbb10('0x30');var _0x4ee02e=_0xfc3595[_0xbb10('0x31')];var _0x56f2da=_0x2e0249?0x0:_0x21ac54[_0xbb10('0x2f')];var _0x1dcc9c=_0x2e0249?_0xfc3595[_0xbb10('0x31')]:_0x21ac54['offset']+_0x21ac54['limit'];var _0x4c3744;if(_0x1dcc9c>=_0x4ee02e){_0x1dcc9c=_0x4ee02e;_0x4c3744=0xc8;}else{_0x4c3744=0xce;}_0x3796c7[_0xbb10('0x2d')](_0x4c3744);return _0x3796c7['set'](_0xbb10('0x32'),_0x56f2da+'-'+_0x1dcc9c+'/'+_0x4ee02e)[_0xbb10('0x33')](_0xfc3595);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x22')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x22')](function(){_0x188cbd[_0xbb10('0x2d')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x28')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}function getMustacheRender(_0x25d72f,_0x52de31){return Mustache['render'](_0x25d72f,_['merge'](_0x52de31[_0xbb10('0x3a')],{'contact':_0x52de31[_0xbb10('0x3b')],'message':_0x52de31[_0xbb10('0x2a')],'agent':_0x52de31['agent'],'interaction':_0x52de31[_0xbb10('0x3c')],'account':_0x52de31[_0xbb10('0x3d')]}))||'';}function getInteractionUsers(_0x4345f3,_0x4d1a83){return new BPromise(function(_0x17b6c5,_0x12238a){try{if(_0x4d1a83[_0x4345f3['id']]){_0x4345f3[_0xbb10('0x3e')]=_[_0xbb10('0x3f')](_0x4d1a83[_0x4345f3['id']],function(_0x4f1cdd){return{'id':_0x4f1cdd['id'],'fullname':_0x4f1cdd[_0xbb10('0x40')]};});}}catch(_0x110eb5){_0x12238a(_0x110eb5);}_0x17b6c5(_0x4345f3);});}function getInteractionTags(_0x5835fd,_0xe2040f){return new BPromise(function(_0x2e3214,_0x44d6ae){try{if(_0x5835fd[_0xbb10('0x41')]){_0x5835fd[_0xbb10('0x42')]=[];_0x5835fd[_0xbb10('0x41')]['split'](',')[_0xbb10('0x43')](function(_0x1c7fae){_0x5835fd[_0xbb10('0x42')][_0xbb10('0x44')](_0xe2040f[_0x1c7fae]);});}delete _0x5835fd['TagIds'];}catch(_0x3fff6c){_0x44d6ae(_0x3fff6c);}_0x2e3214(_0x5835fd);});}function updateChatInteraction(_0x331751,_0x23dc18,_0x403beb){return new BPromise(function(_0x5e2cfa,_0x351484){return getInteractionUsers(_0x331751,_0x403beb)[_0xbb10('0x22')](function(_0x54ac18){return getInteractionTags(_0x54ac18,_0x23dc18);})['then'](function(_0x38d78f){_0x5e2cfa(_0x38d78f);})['catch'](function(_0x318984){_0x351484(_0x318984);});});}exports[_0xbb10('0x45')]=function(_0x4c66d8,_0x366608){var _0x1d82bf={},_0x474e99={},_0x5cf4f8={'count':0x0,'rows':[]};var _0x2dd02b=_[_0xbb10('0x3f')](db[_0xbb10('0x46')][_0xbb10('0x47')],function(_0x36e1fa){return{'name':_0x36e1fa[_0xbb10('0x48')],'type':_0x36e1fa[_0xbb10('0x49')][_0xbb10('0x4a')]};});_0x474e99[_0xbb10('0x4b')]=_[_0xbb10('0x3f')](_0x2dd02b,_0xbb10('0x38'));_0x474e99[_0xbb10('0x4c')]=_['keys'](_0x4c66d8[_0xbb10('0x4c')]);_0x474e99[_0xbb10('0x4d')]=_['intersection'](_0x474e99[_0xbb10('0x4b')],_0x474e99[_0xbb10('0x4c')]);_0x1d82bf[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x474e99[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x4c66d8[_0xbb10('0x4c')]['fields']));_0x1d82bf['attributes']=_0x1d82bf[_0xbb10('0x4e')][_0xbb10('0x51')]?_0x1d82bf[_0xbb10('0x4e')]:_0x474e99['model'];if(!_0x4c66d8['query'][_0xbb10('0x52')](_0xbb10('0x53'))){_0x1d82bf[_0xbb10('0x54')]=qs[_0xbb10('0x54')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x54')]);_0x1d82bf[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x2f')]);}_0x1d82bf['order']=qs['sort'](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x1d82bf[_0xbb10('0x56')]=qs[_0xbb10('0x4d')](_[_0xbb10('0x57')](_0x4c66d8[_0xbb10('0x4c')],_0x474e99[_0xbb10('0x4d')]),_0x2dd02b);var _0x445870=[];var _0x1c0d8f=squel[_0xbb10('0x58')]()[_0xbb10('0x59')]('id')[_0xbb10('0x59')](_0xbb10('0x38'))[_0xbb10('0x59')](_0xbb10('0x5a'))['from'](_0xbb10('0x5b'));var _0x5bd44d=squel[_0xbb10('0x58')]()[_0xbb10('0x59')](_0xbb10('0x5c'))[_0xbb10('0x59')](_0xbb10('0x5d'))[_0xbb10('0x59')](_0xbb10('0x5e'))[_0xbb10('0x5f')](_0xbb10('0x60'),'ui')[_0xbb10('0x61')](_0xbb10('0x62'),'u',_0xbb10('0x63'));var _0x1d49e1=squel[_0xbb10('0x58')]()[_0xbb10('0x5f')]('chat_interactions','i')[_0xbb10('0x61')](_0xbb10('0x64'),'c',_0xbb10('0x65'))[_0xbb10('0x61')](_0xbb10('0x62'),'o',_0xbb10('0x66'))['left_join'](_0xbb10('0x67'),'a',_0xbb10('0x68'))[_0xbb10('0x61')](_0xbb10('0x69'),'me',_0xbb10('0x6a'))[_0xbb10('0x61')](_0xbb10('0x6b'),'it',_0xbb10('0x6c'))[_0xbb10('0x61')](_0xbb10('0x5b'),'t',_0xbb10('0x6d'));var _0x2a1ce1=squel[_0xbb10('0x6e')]();var _0x4e7fac=[];var _0x4ea1a6=squel[_0xbb10('0x6e')]();var _0x3e6338;if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x6f')]){_0x3e6338=as['parseSearch'](_0x4c66d8['query'][_0xbb10('0x6f')]);var _0xaf2cc3=_0x3e6338[_0xbb10('0x70')];for(var _0x2dd150=0x0;_0x2dd150<_0x3e6338[_0xbb10('0x71')][_0xbb10('0x51')];_0x2dd150++){var _0x45c0dc=_0x3e6338['conditions'][_0x2dd150];var _0x117e84='i';var _0x216cff=_['find'](_0x2dd02b,['name',_0x45c0dc['field']]);if(!_0x216cff){switch(_0x45c0dc[_0xbb10('0x59')]){case _0xbb10('0x72'):if(_0x45c0dc[_0xbb10('0x73')]==0x1){_0x1d49e1['having']('`'+_0x45c0dc['field']+'`\x20=\x200');}else{_0x1d49e1[_0xbb10('0x74')]('`'+_0x45c0dc[_0xbb10('0x59')]+_0xbb10('0x75'));}break;case'Contact':if(_0x45c0dc[_0xbb10('0x76')]===_0xbb10('0x77')){if(_0x45c0dc['value']['split']('\x20')[_0xbb10('0x51')]>0x1){_0x2a1ce1[_0xaf2cc3](_0xbb10('0x78'),qs[_0xbb10('0x79')](_0x45c0dc[_0xbb10('0x73')]),null);}else{var _0x54b7c5='%'+_0x45c0dc[_0xbb10('0x73')]+'%';_0x2a1ce1[_0xaf2cc3](_0xbb10('0x7a'),_0x54b7c5,_0x54b7c5,_0x54b7c5);}}else{_0x216cff=_[_0xbb10('0x7b')](_0x2dd02b,['name',_0xbb10('0x7c')]);_0x45c0dc[_0xbb10('0x59')]=_0xbb10('0x7c');_0x329da7=as['buildExpression'](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}break;case _0xbb10('0x7f'):var _0x108e5b=_0x45c0dc[_0xbb10('0x73')]['split'](',')[_0xbb10('0x3f')](function(_0x277fe7){return Number(_0x277fe7);});_0x108e5b[_0xbb10('0x43')](function(_0x2ceb3e){_0x4ea1a6['or'](_0xbb10('0x80'),'%,'+_0x2ceb3e+',%');});_0x4e7fac=_[_0xbb10('0x81')](_0x4e7fac,_0x108e5b);break;case _0xbb10('0x82'):if(_0x45c0dc['operator']==='$substring'){_0x2a1ce1[_0xaf2cc3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x45c0dc[_0xbb10('0x73')]+'%',null);}else{_0x216cff=_[_0xbb10('0x7b')](_0x2dd02b,[_0xbb10('0x38'),'UserId']);_0x45c0dc['field']=_0xbb10('0x83');_0x329da7=as[_0xbb10('0x84')](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}break;case _0xbb10('0x3a'):_0x329da7=as[_0xbb10('0x84')]('me',null,_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')]['start'],_0x329da7['value']['end']);break;}}else{var _0x329da7=as[_0xbb10('0x84')](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}}}else{var _0x4bc316=_(_0x4c66d8['query'])['keys']()[_0xbb10('0x3f')](function(_0x13040d){return _[_0xbb10('0x85')](_0x2dd02b,[_0xbb10('0x38'),_0x13040d])?_0x13040d:undefined;})['compact']()[_0xbb10('0x73')]();if(!_['isEmpty'](_0x4bc316)){_0x4bc316['forEach'](function(_0x165fe9){if(_0x165fe9===_0xbb10('0x86')){_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x87'),[][_0xbb10('0x88')](_0x4c66d8['query'][_0x165fe9]));}else if(_0x165fe9===_0xbb10('0x89')){var _0x19fcec=JSON[_0xbb10('0x8a')](_0x4c66d8[_0xbb10('0x4c')][_0x165fe9])[_0xbb10('0x8b')];var _0x27f42f=JSON[_0xbb10('0x8a')](_0x4c66d8['query'][_0x165fe9])[_0xbb10('0x8c')];_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x8d'),_0x19fcec,_0x27f42f);}else{if(_0x4c66d8[_0xbb10('0x4c')][_0x165fe9]===_0xbb10('0x8e')){_0x1d49e1[_0xbb10('0x56')]('i.'+_0x165fe9+_0xbb10('0x8f'));}else{_0x1d49e1[_0xbb10('0x56')]('i.'+_0x165fe9+'\x20=\x20?',_0x4c66d8[_0xbb10('0x4c')][_0x165fe9]);}}});}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x90')]){if(_0x4c66d8['query']['read']==0x1){_0x1d49e1['having'](_0xbb10('0x91'));}else{_0x1d49e1['having']('`unreadMessages`\x20>\x200');}}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]){_0x4e7fac=_[_0xbb10('0x93')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')])?_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]:new Array(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]);_0x4e7fac['forEach'](function(_0x318a14){_0x4ea1a6['or'](_0xbb10('0x80'),'%,'+_0x318a14+',%');});}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x94')]){var _0x5c8eb8=_0x4c66d8['query'][_0xbb10('0x94')][_0xbb10('0x95')]('\x5c','\x5c\x5c')[_0xbb10('0x95')](/'/g,'\x27\x27');if(qs[_0xbb10('0x96')](_0x5c8eb8)){_0x2a1ce1['or']('i.id\x20LIKE\x20?',_0x5c8eb8+'%');}else{_0x2a1ce1['or'](_0xbb10('0x97'),qs[_0xbb10('0x79')](_0x5c8eb8))['or'](_0xbb10('0x98'),_0x5c8eb8+'%');}}}_0x1d49e1[_0xbb10('0x56')](_0x2a1ce1);_0x1d49e1[_0xbb10('0x99')]('i.id');var _0x5f0691={'type':db[_0xbb10('0x9a')][_0xbb10('0x9b')][_0xbb10('0x9c')],'raw':!![]};var _0x5239da=_0x1d49e1[_0xbb10('0x9d')]();_0x5239da[_0xbb10('0x59')]('i.id');_0x5239da['field'](_0xbb10('0x9e'),_0xbb10('0x72'));if(_0x1d82bf[_0xbb10('0x9f')]){_0x1d82bf['order'][_0xbb10('0x43')](function(_0x3a17fc){var _0xfbb365=_0x3a17fc[0x0]===_0xbb10('0xa0')?_0x3a17fc[0x0]:'i.'+_0x3a17fc[0x0];_0x1d49e1[_0xbb10('0x9f')](_0xfbb365,_0x3a17fc[0x1]===_0xbb10('0xa1')?![]:!![]);});}if(!_[_0xbb10('0xa2')](_0x4e7fac)){_0x1d49e1[_0xbb10('0x74')](_0x4ea1a6);_0x5239da[_0xbb10('0x56')]('t.id\x20IN\x20?',_0x4e7fac);}BPromise[_0xbb10('0xa3')]()[_0xbb10('0x22')](function(){if(!_0x3e6338){if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x86')])return;_0x5239da[_0xbb10('0x56')](_0xbb10('0xa4'));_0x1d49e1[_0xbb10('0x56')](_0xbb10('0xa4'));return;}if(_0x4c66d8[_0xbb10('0xa5')][_0xbb10('0xa6')]!==_0xbb10('0xa7'))return;return _0x4c66d8[_0xbb10('0xa5')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0xe1fc51){if(_[_0xbb10('0xa2')](_0xe1fc51)){_0x5239da[_0xbb10('0x56')](_0xbb10('0xa8'));_0x1d49e1[_0xbb10('0x56')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x5239da[_0xbb10('0x56')](_0xbb10('0x87'),_[_0xbb10('0x3f')](_0xe1fc51,'id'));_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x87'),_[_0xbb10('0x3f')](_0xe1fc51,'id'));}});})['then'](function(){if(_0x4c66d8[_0xbb10('0xa5')][_0xbb10('0xa6')]==='agent'&&!_0x3e6338&&!_0x4c66d8[_0xbb10('0x4c')]['ChatWebsiteId'])return[];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x5239da[_0xbb10('0xaa')](),_0x5f0691);})[_0xbb10('0x22')](function(_0x3a4a6e){_0x5cf4f8['count']=_0x3a4a6e[_0xbb10('0x51')];if(_0x5cf4f8['count']===0x0)return[];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x1c0d8f['toString'](),_0x5f0691)['then'](function(_0x415407){_0x445870=_[_0xbb10('0xab')](_0x415407,'id');_0x5f0691=_[_0xbb10('0xac')](_0x5f0691,{'model':db[_0xbb10('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x50')]){_0x1d82bf[_0xbb10('0x4e')][_0xbb10('0x43')](function(_0x252ab8){_0x1d49e1[_0xbb10('0x59')]('i.'+_0x252ab8);});}else{_0x1d49e1[_0xbb10('0x59')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbb10('0x72'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xad'),_0xbb10('0xae'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xaf'),_0xbb10('0xb0'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb1'),_0xbb10('0xa0'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb2'));_0x1d49e1['field'](_0xbb10('0xb3'),'Contact.firstName');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb4'),_0xbb10('0xb5'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb6'),'Contact.email');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb7'),_0xbb10('0xb8'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb9'),_0xbb10('0xba'));_0x1d49e1['field']('c.fax',_0xbb10('0xbb'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbc'),'Owner.fullname');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbd'),'Owner.internal');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbe'),'TagIds');}if(_0x1d82bf[_0xbb10('0x54')])_0x1d49e1['limit'](_0x1d82bf[_0xbb10('0x54')]);if(_0x1d82bf[_0xbb10('0x2f')])_0x1d49e1['offset'](_0x1d82bf[_0xbb10('0x2f')]);return db[_0xbb10('0xa9')]['query'](_0x1d49e1['toString'](),_0x5f0691);})[_0xbb10('0x22')](function(_0x13ae83){if(_0x13ae83[_0xbb10('0x51')]>0x0)_0x5bd44d[_0xbb10('0x56')](_0xbb10('0xbf'),_['map'](_0x13ae83,'id'));return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x5bd44d[_0xbb10('0xaa')](),_0x5f0691)['then'](function(_0xd68afa){var _0x4f90e6=_[_0xbb10('0xc0')](_0xd68afa,_0xbb10('0xc1'));var _0x44a3e1=[];_0x13ae83[_0xbb10('0x43')](function(_0x1f55d3){_0x44a3e1[_0xbb10('0x44')](updateChatInteraction(_0x1f55d3,_0x445870,_0x4f90e6));});return BPromise[_0xbb10('0xc2')](_0x44a3e1);});});})['then'](function(_0x4fc544){_0x5cf4f8[_0xbb10('0xc3')]=_0x4fc544;return _0x5cf4f8;})[_0xbb10('0x22')](respondWithFilteredResult(_0x366608,_0x1d82bf))[_0xbb10('0xc4')](handleError(_0x366608,null));};exports[_0xbb10('0xc5')]=function(_0x20b585,_0x363b81){var _0x1cccec={'raw':![],'where':{'id':_0x20b585[_0xbb10('0xc6')]['id']}},_0x1674f7={};_0x1674f7[_0xbb10('0x4b')]=_[_0xbb10('0xc7')](db[_0xbb10('0x46')][_0xbb10('0x47')]);_0x1674f7['query']=_[_0xbb10('0xc7')](_0x20b585[_0xbb10('0x4c')]);_0x1674f7[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x1674f7[_0xbb10('0x4b')],_0x1674f7[_0xbb10('0x4c')]);_0x1cccec[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1674f7[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x20b585[_0xbb10('0x4c')]['fields']));_0x1cccec[_0xbb10('0x4e')]=_0x1cccec['attributes'][_0xbb10('0x51')]?_0x1cccec[_0xbb10('0x4e')]:_0x1674f7[_0xbb10('0x4b')];if(_0x20b585[_0xbb10('0x4c')][_0xbb10('0xc8')]){_0x1cccec[_0xbb10('0xc9')]=[{'all':!![]}];}_0x1cccec=_['merge']({},_0x1cccec,_0x20b585[_0xbb10('0xca')]);return db['ChatInteraction'][_0xbb10('0x7b')](_0x1cccec)[_0xbb10('0x22')](handleEntityNotFound(_0x363b81,null))[_0xbb10('0x22')](respondWithResult(_0x363b81,null))[_0xbb10('0xc4')](handleError(_0x363b81,null));};exports[_0xbb10('0xcb')]=function(_0x31907e,_0x4f06c){return db[_0xbb10('0x46')][_0xbb10('0xcb')](_0x31907e[_0xbb10('0x3a')],{})[_0xbb10('0x22')](respondWithResult(_0x4f06c,0xc9))[_0xbb10('0xc4')](handleError(_0x4f06c,null));};exports['update']=function(_0x3696b3,_0x516520){if(_0x3696b3[_0xbb10('0x3a')]['id']){delete _0x3696b3[_0xbb10('0x3a')]['id'];}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x3696b3[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x516520,null))[_0xbb10('0x22')](saveUpdates(_0x3696b3['body'],null))[_0xbb10('0x22')](respondWithResult(_0x516520,null))['catch'](handleError(_0x516520,null));};exports['destroy']=function(_0x1513e0,_0x35cbb9){return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x1513e0[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x35cbb9,null))['then'](removeEntity(_0x35cbb9,null))[_0xbb10('0xc4')](handleError(_0x35cbb9,null));};exports[_0xbb10('0xcc')]=function(_0x39aa9e,_0xb1b7c8){return db[_0xbb10('0x46')][_0xbb10('0xcc')]()['then'](respondWithResult(_0xb1b7c8,null))[_0xbb10('0xc4')](handleError(_0xb1b7c8,null));};exports[_0xbb10('0xcd')]=function(_0xb7c454,_0xa8b7c3){var _0x31718f=_0xb7c454[_0xbb10('0xc6')]['id'];var _0x2764e1;var _0x5e405b;var _0x33a43e;return db['ChatInteraction'][_0xbb10('0xce')]({'where':{'id':_0x31718f}})['then'](function(_0x4c8b68){_0x2764e1=_0x4c8b68;return db[_0xbb10('0xcf')][_0xbb10('0xce')]({'where':{'id':_0x4c8b68[_0xbb10('0x86')]},'attributes':['id',_0xbb10('0xd0'),_0xbb10('0xd1'),'vidaooTopic',_0xbb10('0xd2'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x4dd138){if(_0x4dd138&&_0x4dd138[_0xbb10('0xd0')]&&_0x4dd138[_0xbb10('0xd1')]){_0x5e405b=_0x4dd138;var _0x1b9012={'interaction':{'id':_0x31718f},'agent':{'id':_0xb7c454[_0xbb10('0xa5')]['id'],'name':_0xb7c454[_0xbb10('0xa5')]['name'],'fullname':_0xb7c454[_0xbb10('0xa5')][_0xbb10('0x40')],'email':_0xb7c454[_0xbb10('0xa5')][_0xbb10('0xd3')]},'contact':_0xb7c454[_0xbb10('0x3a')][_0xbb10('0x3b')],'account':_0xb7c454[_0xbb10('0x3a')]['account']};var _0x4c95c2={'rejectUnauthorized':![],'method':'POST','url':_0xbb10('0xd4'),'headers':{'X-APIKEY':_0x4dd138[_0xbb10('0xd0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xb7c454[_0xbb10('0xa5')][_0xbb10('0xd3')]],'buttons':null,'topic':_0x5e405b[_0xbb10('0xd5')],'note':_[_0xbb10('0xd6')](_0x5e405b[_0xbb10('0xd2')])?null:getMustacheRender(_0x5e405b[_0xbb10('0xd2')],_0x1b9012),'metadata':null},'redirect':_0xbb10('0xd7'),'json':!![]};try{if(!_[_0xbb10('0xd6')](_0x5e405b['vidaooMetadata'])){var _0x58295f=getMustacheRender(_0x5e405b['vidaooMetadata'],_0x1b9012);var _0x3d4b89=JSON[_0xbb10('0x8a')](_0x58295f);_0x4c95c2[_0xbb10('0x3a')]['metadata']=_0x3d4b89;}}catch(_0x2bfa8e){throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xd9'));}return rp(_0x4c95c2);}else{throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x356660){_0x33a43e=_0x356660;if(_0x33a43e['id']){var _0x48889b={'body':_0x33a43e[_0xbb10('0xda')],'ChatWebsiteId':_0x5e405b['id'],'ChatInteractionId':_0x2764e1['id'],'direction':_0xbb10('0xdb'),'UserId':_0xb7c454[_0xbb10('0xa5')]['id']};return db[_0xbb10('0xdc')][_0xbb10('0xcb')](_0x48889b,{});}else{throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xdd'));}})[_0xbb10('0x22')](function(){return _0x2764e1[_0xbb10('0xde')]({'vidaooSessionId':_0x33a43e['id']});})['then'](respondWithResult(_0xa8b7c3,null))[_0xbb10('0xc4')](handleError(_0xa8b7c3,null));};exports['customUpdate']=function(_0x27bed2,_0x5547fa){if(_0x27bed2[_0xbb10('0x3a')]['id']){delete _0x27bed2[_0xbb10('0x3a')]['id'];}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x27bed2['params']['id']},'include':[{'model':db[_0xbb10('0xdf')],'as':'Contact'}]})[_0xbb10('0x22')](handleEntityNotFound(_0x5547fa,null))[_0xbb10('0x22')](saveUpdates(_0x27bed2[_0xbb10('0x3a')],null))['then'](respondWithResult(_0x5547fa,null))[_0xbb10('0xc4')](handleError(_0x5547fa,null));};exports[_0xbb10('0xe0')]=function(_0x140173,_0x18a44f,_0x11d31b){if(_0x140173[_0xbb10('0x3a')]['id']){delete _0x140173['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x140173[_0xbb10('0xc6')]['id']}})['then'](function(_0x318908){if(!_0x318908){logger['error'](_0xbb10('0xe1'),_0xbb10('0xe0'),0x194,_0xbb10('0xe2'));_0x18a44f['sendStatus'](0x194);}else{if(_0x318908['UserId']){throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xe3'));}}return _0x318908;})['then'](function(_0x440108){if(_0x440108){return _0x440108[_0xbb10('0x36')]({'closed':_0x140173[_0xbb10('0x3a')]['closed'],'disposition':_0x140173['body']['disposition']})[_0xbb10('0x22')](function(_0x55aa03){return _0x55aa03;});}})[_0xbb10('0x22')](function(_0x1c2c95){return respondWithRpcPromise(_0xbb10('0xe4'),_0xbb10('0xe0'),_0x140173[_0xbb10('0x3a')],client9004);})[_0xbb10('0x22')](respondWithResult(_0x18a44f,null))[_0xbb10('0xc4')](handleError(_0x18a44f,null));};exports[_0xbb10('0xe5')]=function(_0x2746eb,_0x431792,_0x2e2710){_0x2746eb['body'][_0xbb10('0x38')]=_0x2746eb[_0xbb10('0xe6')]['originalname'];_0x2746eb[_0xbb10('0x3a')]['basename']=_0x2746eb['file'][_0xbb10('0xe7')];_0x2746eb[_0xbb10('0x3a')][_0xbb10('0x49')]=_0x2746eb[_0xbb10('0xe6')][_0xbb10('0xe8')];return db['Attachment'][_0xbb10('0xcb')](_0x2746eb[_0xbb10('0x3a')])['then'](respondWithResult(_0x431792,0xc9))[_0xbb10('0xc4')](handleError(_0x431792,null));};exports[_0xbb10('0xe9')]=function(_0x5a82e7,_0x424c96,_0x4c769b){return db[_0xbb10('0x46')][_0xbb10('0xce')]({'where':{'id':_0x5a82e7[_0xbb10('0xc6')]['id']},'raw':!![]})[_0xbb10('0x22')](handleEntityNotFound(_0x424c96,null))[_0xbb10('0x22')](function(_0x20b312){if(_0x20b312){if(_0x20b312[_0xbb10('0xea')]){return _0x424c96['status'](0x193)[_0xbb10('0x33')]({'status':0x193,'message':_0xbb10('0xeb')});}return db[_0xbb10('0xec')][_0xbb10('0xce')]({'where':{'id':_0x5a82e7[_0xbb10('0x4c')][_0xbb10('0xed')]},'raw':!![]})['then'](handleEntityNotFound(_0x424c96,null));}})['then'](function(_0x5a40e8){if(_0x5a40e8){var _0x23849e=_0x5a40e8[_0xbb10('0xee')]!==null;var _0x3e1a86=path[_0xbb10('0xef')](config['root'],_0xbb10('0xf0'));if(_0x23849e){_0x3e1a86=path[_0xbb10('0xef')](_0x3e1a86,_0xbb10('0xf1'));}var _0x577d27=path['join'](_0x3e1a86,_0x5a40e8[_0xbb10('0xf2')]);return _0x424c96['download'](_0x577d27);}})[_0xbb10('0xc4')](handleError(_0x424c96,null));};exports[_0xbb10('0xf3')]=function(_0xb9bc5a,_0x42276f){var _0x425505=null;var _0xcb61bb=null;var _0x1fe250=null;var _0x57933f=null;if(_0xb9bc5a[_0xbb10('0x3a')]['id']){delete _0xb9bc5a[_0xbb10('0x3a')]['id'];}if(_0xb9bc5a['body'][_0xbb10('0xf4')]){_0x57933f=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date[_0xbb10('0xf6')]()));_0xb9bc5a[_0xbb10('0x3a')]['pathTranscript']=_0x57933f;}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0xb9bc5a[_0xbb10('0xc6')]['id']},'include':[{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xf7'),'include':[{'model':db[_0xbb10('0x82')],'as':_0xbb10('0x82')}]}]})['then'](handleEntityNotFound(_0x42276f,null))[_0xbb10('0x22')](saveUpdates(_0xb9bc5a['body'],null))['then'](function(_0x4aa0d7){if(_0x4aa0d7){_0x425505=_0x4aa0d7;return db[_0xbb10('0xcf')][_0xbb10('0x7b')]({'where':{'id':_0x425505['ChatWebsiteId']}});}})[_0xbb10('0x22')](function(_0x49f324){if(_0x49f324){_0x1fe250=_0x49f324;return db[_0xbb10('0xdf')][_0xbb10('0x7b')]({'where':{'id':_0x425505[_0xbb10('0x7c')]}});}})['then'](function(_0x4d10ea){if(_0x4d10ea){_0xcb61bb=_0x4d10ea;if(_0x57933f){var _0x447c0d=null;for(var _0x502e73=0x1;_0x502e73<_0x425505[_0xbb10('0xf7')][_0xbb10('0x51')];++_0x502e73){_0x447c0d=_0x425505['Messages'][_0x502e73];var _0x50cd00=_0x447c0d[_0xbb10('0x83')]?util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0x1fe250['agentAlias'],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');var _0x22f153=_0xb9bc5a['body'][_0xbb10('0xfb')]||util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0xbb10('0xfc'),_0x447c0d[_0xbb10('0x7c')]);switch(_0x1fe250[_0xbb10('0xfd')]){case _0xbb10('0xfe'):_0x50cd00=_0x447c0d[_0xbb10('0x83')]?util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0x1fe250[_0xbb10('0xff')],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');break;case'agent_alias':_0x50cd00=_0x447c0d['UserId']?_0x447c0d[_0xbb10('0x82')]['alias']||_0x447c0d[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa');break;case'agent_fullname':_0x50cd00=_0x447c0d[_0xbb10('0x83')]?_0x447c0d[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa');break;default:_0x50cd00=_0x447c0d[_0xbb10('0x83')]?util['format'](_0xbb10('0xf9'),_0x1fe250[_0xbb10('0xff')],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');}var _0x150d4c=util[_0xbb10('0xf8')]('[%s]\x20%s:\x20%s\x0a',moment(_0x447c0d[_0xbb10('0x89')])[_0xbb10('0xf8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x447c0d[_0xbb10('0x100')]==='in'?_0x22f153:_0x50cd00,_0x447c0d[_0xbb10('0x3a')]);if(!_0x447c0d[_0xbb10('0x101')]){fs[_0xbb10('0x102')](_0x57933f,_0x150d4c);}}return db[_0xbb10('0x103')][_0xbb10('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0xbb10('0x104')],'as':_0xbb10('0x105'),'raw':!![]}]});}}})[_0xbb10('0x22')](function(_0x33d1b7){if(_0x33d1b7&&_0x33d1b7[_0xbb10('0x105')]&&_0xb9bc5a[_0xbb10('0x3a')]){var _0x1db646={'tls':{'rejectUnauthorized':![]}};if(_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x106')]){_0x1db646['service']=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x106')];}else{_0x1db646['host']=_0x33d1b7['Smtp'][_0xbb10('0x107')];_0x1db646[_0xbb10('0x108')]=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x108')];_0x1db646[_0xbb10('0x109')]=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x109')];}if(_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x10a')]){_0x1db646['auth']={'user':_0x33d1b7['Smtp']['user'],'pass':_0x33d1b7['Smtp']['pass']};}return respondWithRpcPromise('SendMail',_0xbb10('0x10b'),{'account':_0x1db646,'message':{'from':util[_0xbb10('0xf8')](_0xbb10('0x10c'),_0x33d1b7[_0xbb10('0x38')],_0x33d1b7['email']||_0x33d1b7[_0xbb10('0x105')][_0xbb10('0xa5')]),'to':_0xb9bc5a[_0xbb10('0x3a')][_0xbb10('0xf4')],'subject':'Mail\x20Transcript','text':util['format'](_0xbb10('0x10d'),_0xb9bc5a[_0xbb10('0x3a')]['mailTranscript']),'attachments':[{'path':_0x57933f}]}})['then'](function(){return _0x425505;})[_0xbb10('0xc4')](function(_0xf1371a){console[_0xbb10('0x28')](_0xf1371a);});}else{return _0x425505;}})[_0xbb10('0x22')](respondWithStatusCode(_0x42276f,0xc8))[_0xbb10('0xc4')](handleError(_0x42276f,null));};exports['addMessage']=function(_0x4744f4,_0x5382e9,_0x4c97b9){return db[_0xbb10('0xdc')][_0xbb10('0x7b')]({'where':{'id':_0x4744f4[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5382e9,null))[_0xbb10('0x22')](function(_0x21c0fd){if(_0x21c0fd){return _0x21c0fd['addMessage'](_0x4744f4[_0xbb10('0x3a')][_0xbb10('0x10e')],_[_0xbb10('0x10f')](_0x4744f4[_0xbb10('0x3a')],[_0xbb10('0x10e'),'id'])||{});}})[_0xbb10('0x22')](respondWithResult(_0x5382e9,null))[_0xbb10('0xc4')](handleError(_0x5382e9,null));};exports[_0xbb10('0x110')]=function(_0x233d5e,_0x16f3ce,_0xbae19c){var _0x26f4b0={'raw':![],'where':{}};var _0x1dbf7b={};var _0x117e95={'count':0x0,'rows':[]};return db[_0xbb10('0x46')][_0xbb10('0xce')]({'where':{'id':_0x233d5e[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x16f3ce,null))[_0xbb10('0x22')](function(_0x43a203){if(_0x43a203){_0x1dbf7b[_0xbb10('0x4b')]=_[_0xbb10('0xc7')](db['ChatMessage'][_0xbb10('0x47')]);_0x1dbf7b['query']=_[_0xbb10('0xc7')](_0x233d5e[_0xbb10('0x4c')]);_0x1dbf7b[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x1dbf7b[_0xbb10('0x4b')],_0x1dbf7b['query']);_0x26f4b0['attributes']=_['intersection'](_0x1dbf7b[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x233d5e['query'][_0xbb10('0x50')]));_0x26f4b0[_0xbb10('0x4e')]=_0x26f4b0[_0xbb10('0x4e')]['length']?_0x26f4b0[_0xbb10('0x4e')]:_0x1dbf7b[_0xbb10('0x4b')];if(!_0x233d5e[_0xbb10('0x4c')]['hasOwnProperty'](_0xbb10('0x53'))){_0x26f4b0['limit']=qs[_0xbb10('0x54')](_0x233d5e['query']['limit']);_0x26f4b0['offset']=qs['offset'](_0x233d5e['query']['offset']);}_0x26f4b0[_0xbb10('0x9f')]=qs[_0xbb10('0x55')](_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x26f4b0['where']=qs[_0xbb10('0x4d')](_[_0xbb10('0x57')](_0x233d5e[_0xbb10('0x4c')],_0x1dbf7b[_0xbb10('0x4d')]));_0x26f4b0[_0xbb10('0x56')][_0xbb10('0xc1')]=_0x43a203['id'];if(_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x94')]){_0x26f4b0[_0xbb10('0x56')]=_[_0xbb10('0xac')](_0x26f4b0['where'],{'$or':_[_0xbb10('0x3f')](_0x26f4b0[_0xbb10('0x4e')],function(_0x288ccc){var _0x5c5ecc={};_0x5c5ecc[_0x288ccc]={'$like':'%'+_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x94')]+'%'};return _0x5c5ecc;})});}if(_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x8b')]){var _0x5b2292=_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x8b')][_0xbb10('0x111')](',');var _0x22ec50={};_0x22ec50[_0x5b2292[0x0]]={'$gte':moment(_0x5b2292[0x1])[_0xbb10('0xf8')](_0xbb10('0x112'))};_0x26f4b0[_0xbb10('0x56')]=_[_0xbb10('0xac')](_0x26f4b0[_0xbb10('0x56')],_0x22ec50);}_0x26f4b0=_[_0xbb10('0xac')]({},_0x26f4b0,_0x233d5e[_0xbb10('0xca')]);return db['ChatMessage'][_0xbb10('0x31')]({'where':_0x26f4b0[_0xbb10('0x56')]})['then'](function(_0x5eb1fb){_0x117e95[_0xbb10('0x31')]=_0x5eb1fb;if(_0x233d5e[_0xbb10('0x4c')]['includeAll']){_0x26f4b0[_0xbb10('0xc9')]=[{'all':!![]}];}return db[_0xbb10('0xdc')]['findAll'](_0x26f4b0);})[_0xbb10('0x22')](function(_0x42441e){_0x117e95[_0xbb10('0xc3')]=_0x42441e;return _0x117e95;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x16f3ce,_0x26f4b0))[_0xbb10('0xc4')](handleError(_0x16f3ce,null));};exports['getMyMessages']=function(_0x4fc260,_0x5a502c,_0xaeaa51){var _0x4db9ad={'where':{}},_0x43deea={},_0x53e73e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbb10('0xce')]({'where':{'id':_0x4fc260[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5a502c,null))[_0xbb10('0x22')](function(_0x2527f4){if(_0x2527f4){_0x43deea[_0xbb10('0x4b')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x43deea[_0xbb10('0x4c')]=_[_0xbb10('0xc7')](_0x4fc260[_0xbb10('0x4c')]);_0x43deea[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x43deea[_0xbb10('0x4b')],_0x43deea[_0xbb10('0x4c')]);_0x4db9ad['attributes']=_[_0xbb10('0x4f')](_0x43deea[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x4fc260[_0xbb10('0x4c')]['fields']));_0x4db9ad[_0xbb10('0x4e')]=_0x4db9ad['attributes']['length']?_0x4db9ad[_0xbb10('0x4e')]:_0x43deea[_0xbb10('0x4b')];if(!_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x52')](_0xbb10('0x53'))){_0x4db9ad[_0xbb10('0x54')]=qs['limit'](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x54')]);_0x4db9ad[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x2f')]);}_0x4db9ad[_0xbb10('0x9f')]=qs['sort'](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x4db9ad[_0xbb10('0x56')]=qs['filters'](_['pick'](_0x4fc260[_0xbb10('0x4c')],_0x43deea[_0xbb10('0x4d')]));_0x4db9ad[_0xbb10('0x56')][_0xbb10('0xc1')]=_0x2527f4['id'];if(_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x94')]){_0x4db9ad[_0xbb10('0x56')]=_['merge'](_0x4db9ad[_0xbb10('0x56')],{'$or':_[_0xbb10('0x3f')](_0x4db9ad[_0xbb10('0x4e')],function(_0x55ba78){var _0x5e195a={};_0x5e195a[_0x55ba78]={'$like':'%'+_0x4fc260['query']['filter']+'%'};return _0x5e195a;})});}_0x4db9ad[_0xbb10('0x56')][_0xbb10('0x101')]=![];if(_0x4fc260[_0xbb10('0x4c')]['id']){_0x4db9ad[_0xbb10('0x56')]['id']={'$gt':_0x4fc260['query']['id']};}_0x4db9ad=_[_0xbb10('0xac')]({},_0x4db9ad,_0x4fc260['options']);return db[_0xbb10('0xdc')][_0xbb10('0x31')]({'where':_0x4db9ad[_0xbb10('0x56')]})[_0xbb10('0x22')](function(_0xa16287){_0x53e73e[_0xbb10('0x31')]=_0xa16287;_0x4db9ad[_0xbb10('0xc9')]=[];if(_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x113')]){_0x4db9ad[_0xbb10('0xc9')][_0xbb10('0x44')]({'model':db[_0xbb10('0x82')],'as':'User','attributes':['id',_0xbb10('0x40'),_0xbb10('0x114')]});}if(_0x4fc260[_0xbb10('0x4c')]['includeAll']){_0x4db9ad[_0xbb10('0xc9')]=[{'all':!![]}];}return db['ChatMessage'][_0xbb10('0x115')](_0x4db9ad);})[_0xbb10('0x22')](function(_0x280119){_0x53e73e[_0xbb10('0xc3')]=_0x280119;return _0x53e73e;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x5a502c,_0x4db9ad))['catch'](handleError(_0x5a502c,null));};exports['addTags']=function(_0x842d94,_0x4cf5cc,_0x553bb8){return db[_0xbb10('0x46')]['find']({'where':{'id':_0x842d94[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4cf5cc,null))[_0xbb10('0x22')](function(_0x4469c4){if(_0x4469c4){return _0x4469c4[_0xbb10('0x116')](_0x842d94[_0xbb10('0x3a')][_0xbb10('0x10e')],_[_0xbb10('0x10f')](_0x842d94['body'],[_0xbb10('0x10e'),'id'])||{})['spread'](function(){return db[_0xbb10('0x7f')]['findAll']({'attributes':['id',_0xbb10('0x38'),_0xbb10('0x5a')],'where':{'id':_0x842d94['body'][_0xbb10('0x10e')]}});})[_0xbb10('0x22')](function(_0x1bb072){socket['emit'](_0xbb10('0x117'),{'id':Number(_0x842d94[_0xbb10('0xc6')]['id']),'tags':_0x1bb072||[]});return{'id':Number(_0x842d94[_0xbb10('0xc6')]['id']),'tags':_0x1bb072||[]};});}})['then'](respondWithResult(_0x4cf5cc,null))[_0xbb10('0xc4')](handleError(_0x4cf5cc,null));};exports[_0xbb10('0x118')]=function(_0x46df90,_0x4b781e,_0x3e6756){return db['ChatInteraction'][_0xbb10('0x7b')]({'where':{'id':_0x46df90[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4b781e,null))[_0xbb10('0x22')](function(_0x583a3e){if(_0x583a3e){return _0x583a3e[_0xbb10('0x118')](_0x46df90[_0xbb10('0x4c')][_0xbb10('0x10e')]);}})[_0xbb10('0x22')](respondWithStatusCode(_0x4b781e,null))[_0xbb10('0xc4')](handleError(_0x4b781e,null));};exports['download']=function(_0x4b10ed,_0x40b5da){var _0x4739a6=moment()[_0xbb10('0x119')]()['toString']();var _0x3d5870=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],_0xbb10('0x11a'),_0xbb10('0x11b'),_0xbb10('0x11c'));var _0x81d970=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],'server',_0xbb10('0x11b'),_0xbb10('0x11d'));var _0x4102af=path[_0xbb10('0xef')](_0x3d5870,_0x4739a6);var _0x4d49a7=util[_0xbb10('0xf8')](_0xbb10('0x11e'),_0x4b10ed[_0xbb10('0xc6')]['id'],_0x4739a6);var _0x59fef2=path['join'](_0x3d5870,_0x4d49a7);var _0x3b45c4=[];_0x3b45c4['push']({'model':db[_0xbb10('0x82')],'as':'User','attributes':['id',_0xbb10('0x40')],'raw':!![]});_0x3b45c4[_0xbb10('0x44')]({'model':db[_0xbb10('0xdf')],'as':_0xbb10('0x11f'),'attributes':['id',_0xbb10('0x120'),_0xbb10('0x121')],'raw':!![]});if(_0x4b10ed[_0xbb10('0x4c')]['attachments']){_0x3b45c4[_0xbb10('0x44')]({'model':db[_0xbb10('0xec')],'as':_0xbb10('0xec'),'raw':!![]});}var _0x2807d2=[{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xf7'),'attributes':['id','body',_0xbb10('0x89'),_0xbb10('0x100'),_0xbb10('0x101'),_0xbb10('0x90')],'include':_0x3b45c4}];_0x2807d2[_0xbb10('0x44')]({'model':db[_0xbb10('0xcf')],'as':_0xbb10('0x122'),'attributes':['id','name']});_0x2807d2[_0xbb10('0x44')]({'model':db[_0xbb10('0x82')],'as':_0xbb10('0x123'),'attributes':['id','fullname']});return db[_0xbb10('0x46')]['find']({'where':{'id':_0x4b10ed[_0xbb10('0xc6')]['id']},'include':_0x2807d2})[_0xbb10('0x22')](handleEntityNotFound(_0x40b5da,null))[_0xbb10('0x22')](function(_0x58a447){if(_0x58a447){var _0x50fa4e=_0x58a447[_0xbb10('0x124')]({'plain':!![]});fs[_0xbb10('0x125')](_0x4102af);var _0xbb410e={'channel':_0xbb10('0x126'),'account':_0x50fa4e[_0xbb10('0x122')][_0xbb10('0x38')],'agent':_0x50fa4e[_0xbb10('0x123')]?_0x50fa4e[_0xbb10('0x123')][_0xbb10('0x40')]:_0xbb10('0x127'),'createdAt':moment(_0x50fa4e[_0xbb10('0x89')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbb10('0xaa')](),'closedAt':_0x50fa4e[_0xbb10('0xea')]?moment(_0x50fa4e['closedAt'])['format'](_0xbb10('0x112'))[_0xbb10('0xaa')]():'','disposition':_0x50fa4e[_0xbb10('0x128')],'chatInfo':{'browser':_0x50fa4e['browserName'],'os':_0x50fa4e[_0xbb10('0x129')],'referer':_0x50fa4e[_0xbb10('0x12a')],'customerIp':_0x50fa4e['customerIp'],'customerPort':_0x50fa4e[_0xbb10('0x12b')]?_0x50fa4e[_0xbb10('0x12b')]:'N.A.'},'messages':_(_0x50fa4e['Messages'])[_0xbb10('0x12c')]()[_0xbb10('0x94')]({'secret':![]})[_0xbb10('0x3f')](function(_0x5cab64){if(_0x5cab64['Attachment']){var _0x58ee41=path[_0xbb10('0xef')](_0x81d970,_0x5cab64['Attachment'][_0xbb10('0xf2')]);if(fs[_0xbb10('0x12d')](_0x58ee41)){fs['createReadStream'](_0x58ee41)[_0xbb10('0x12e')](fs[_0xbb10('0x12f')](path[_0xbb10('0xef')](_0x4102af,_0x5cab64[_0xbb10('0xec')]['basename'])));}}return{'date':moment(_0x5cab64[_0xbb10('0x89')])['format'](_0xbb10('0x112'))[_0xbb10('0xaa')](),'sender':_0x5cab64[_0xbb10('0x100')]===_0xbb10('0xdb')?_0x5cab64[_0xbb10('0x82')]?_0x5cab64[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa'):_0x5cab64['Contact'][_0xbb10('0x120')]+(_0x5cab64[_0xbb10('0x11f')][_0xbb10('0x121')]?'\x20'+_0x5cab64[_0xbb10('0x11f')]['lastName']:''),'body':_0x5cab64['Attachment']?_0x5cab64[_0xbb10('0xec')][_0xbb10('0xf2')]:_0x5cab64[_0xbb10('0x3a')],'direction':_0x5cab64[_0xbb10('0x100')]==='out'?'A':'C','secret':_0x5cab64[_0xbb10('0x101')],'read':_0x5cab64[_0xbb10('0x90')],'attachment':_0x5cab64['Attachment']};})[_0xbb10('0x73')]()};return ejs['renderFile'](path['join'](config[_0xbb10('0xf5')],_0xbb10('0x11a'),_0xbb10('0x130'),_0xbb10('0x131')),{'interaction':_0xbb410e})[_0xbb10('0x22')](function(_0x4aa76a){var _0x38403e=path[_0xbb10('0xef')](_0x4102af,_0xbb10('0x132')+_0x50fa4e['id']+'-'+_0x4739a6+_0xbb10('0x133'));var _0x1b7274={'path':_0x38403e,'channel':_0xbb10('0x126'),'interactionId':_0x50fa4e['id']};return pdf[_0xbb10('0x134')](_0x4aa76a,_0x1b7274);})[_0xbb10('0x22')](function(){return new BPromise(function(_0x34f4d6,_0x254b6e){zipdir(_0x4102af,{'saveTo':_0x59fef2},function(_0x368adb,_0xef4ccf){if(_0x368adb)return _0x254b6e(_0x368adb);return _0x34f4d6(_0xef4ccf);});})[_0xbb10('0x22')](function(){return new BPromise(function(_0x9fcc26,_0x111fd4){rimraf(_0x4102af,function(_0x256ce9){if(_0x256ce9)_0x111fd4(_0x256ce9);return _0x9fcc26();});});})[_0xbb10('0x22')](function(){return _0x40b5da[_0xbb10('0x135')](_0x59fef2,_0x4d49a7,function(_0x27e0c5){if(_0x27e0c5){console[_0xbb10('0x136')](_0xbb10('0x137'),_0x27e0c5);}else{fs[_0xbb10('0x138')](_0x59fef2);}});});});}else{return _0x40b5da[_0xbb10('0x2c')](0xc8);}})[_0xbb10('0xc4')](handleError(_0x40b5da,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index f06e8e4..cd062cf 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 _0x8b6f=['ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','catch','hook','exports','events','ChatInteraction'];(function(_0x2f7ee1,_0x238541){var _0x298295=function(_0x124360){while(--_0x124360){_0x2f7ee1['push'](_0x2f7ee1['shift']());}};_0x298295(++_0x238541);}(_0x8b6f,0xa8));var _0xf8b6=function(_0x119ded,_0x497e72){_0x119ded=_0x119ded-0x0;var _0x22108b=_0x8b6f[_0x119ded];return _0x22108b;};'use strict';var EventEmitter=require(_0xf8b6('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xf8b6('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xf8b6('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf8b6('0x3')](0x0);var events={'afterCreate':_0xf8b6('0x4'),'afterUpdate':_0xf8b6('0x5'),'afterDestroy':_0xf8b6('0x6')};function emitEvent(_0x3514a6){return function(_0x5bc9d1,_0x53ab74,_0x3c3589){_0x5bc9d1[_0xf8b6('0x7')]({'attributes':['id'],'raw':!![]})[_0xf8b6('0x8')](function(_0x347c0c){_0x5bc9d1[_0xf8b6('0x9')](_0xf8b6('0xa'),_0x347c0c[_0xf8b6('0xb')](function(_0x401bb0){return{'id':_0x401bb0['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5bc9d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf8b6('0x8')](function(_0x272a5e){_0x5bc9d1[_0xf8b6('0x9')](_0xf8b6('0xc'),_0x272a5e[_0xf8b6('0xd')]);ChatInteractionEvents['emit'](_0x3514a6+':'+_0x5bc9d1['id'],_0x5bc9d1);ChatInteractionEvents['emit'](_0x3514a6,_0x5bc9d1);_0x3c3589(null);})[_0xf8b6('0xe')](_0x3c3589(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xf8b6('0xf')](e,emitEvent(event));}}module[_0xf8b6('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xc474=['remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc474,0xfa));var _0x4c47=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xc474[_0x4a53d];return _0x27410e;};'use strict';var EventEmitter=require(_0x4c47('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x4c47('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4c47('0x2')](0x0);var events={'afterCreate':_0x4c47('0x3'),'afterUpdate':_0x4c47('0x4'),'afterDestroy':_0x4c47('0x5')};function emitEvent(_0x39781a){return function(_0x45e89a,_0x19ef61,_0x547555){_0x45e89a[_0x4c47('0x6')]({'attributes':['id'],'raw':!![]})[_0x4c47('0x7')](function(_0x478301){_0x45e89a[_0x4c47('0x8')](_0x4c47('0x9'),_0x478301[_0x4c47('0xa')](function(_0xf48715){return{'id':_0xf48715['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x45e89a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4c47('0x7')](function(_0x4e9eed){_0x45e89a['setDataValue']('unreadMessages',_0x4e9eed[_0x4c47('0xb')]);ChatInteractionEvents[_0x4c47('0xc')](_0x39781a+':'+_0x45e89a['id'],_0x45e89a);ChatInteractionEvents['emit'](_0x39781a,_0x45e89a);_0x547555(null);})[_0x4c47('0xd')](_0x547555(null));};}for(var e in events){if(events[_0x4c47('0xe')](e)){var event=events[e];ChatInteraction[_0x4c47('0xf')](e,emitEvent(event));}}module[_0x4c47('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 676ba33..926ec2b 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 _0x7232=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','chat_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util'];(function(_0xdf5c3e,_0x32b9ec){var _0x19454f=function(_0x117c12){while(--_0x117c12){_0xdf5c3e['push'](_0xdf5c3e['shift']());}};_0x19454f(++_0x32b9ec);}(_0x7232,0x1b0));var _0x2723=function(_0x1fc508,_0xc233c1){_0x1fc508=_0x1fc508-0x0;var _0x352275=_0x7232[_0x1fc508];return _0x352275;};'use strict';var _=require(_0x2723('0x0'));var util=require(_0x2723('0x1'));var logger=require(_0x2723('0x2'))('api');var moment=require(_0x2723('0x3'));var BPromise=require(_0x2723('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2723('0x5'));var rimraf=require(_0x2723('0x6'));var config=require(_0x2723('0x7'));var attributes=require(_0x2723('0x8'));module['exports']=function(_0x199f00,_0x5395e1){return _0x199f00['define'](_0x2723('0x9'),attributes,{'tableName':_0x2723('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x283374,_0x3d1276,_0x24cd29){if(_0x283374['changed'](_0x2723('0xb'))){_0x283374['closedAt']=moment()['format'](_0x2723('0xc'));}_0x24cd29(null,_0x283374);}},'charset':_0x2723('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa306=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x3454ba,_0x777f81){var _0x42f42c=function(_0x273591){while(--_0x273591){_0x3454ba['push'](_0x3454ba['shift']());}};_0x42f42c(++_0x777f81);}(_0xa306,0xd0));var _0x6a30=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0xa306[_0x31ced5];return _0x10d9e5;};'use strict';var _=require(_0x6a30('0x0'));var util=require('util');var logger=require(_0x6a30('0x1'))(_0x6a30('0x2'));var moment=require(_0x6a30('0x3'));var BPromise=require(_0x6a30('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a30('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6a30('0x6'));module[_0x6a30('0x7')]=function(_0x56fd46,_0x529feb){return _0x56fd46[_0x6a30('0x8')](_0x6a30('0x9'),attributes,{'tableName':_0x6a30('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52d88e,_0x559dfe,_0x1ebf69){if(_0x52d88e[_0x6a30('0xb')](_0x6a30('0xc'))){_0x52d88e[_0x6a30('0xd')]=moment()[_0x6a30('0xe')](_0x6a30('0xf'));}_0x1ebf69(null,_0x52d88e);}},'charset':_0x6a30('0x10'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 4e4af2a..b0258f8 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 _0x31cf=['result','catch','ChatInteraction','update','body','raw','options','where','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','omit','AddTags','lodash','util','bluebird','ioredis','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x31cf,0x1d5));var _0xf31c=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x31cf[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xf31c('0x0'));var util=require(_0xf31c('0x1'));var moment=require('moment');var BPromise=require(_0xf31c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf31c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf31c('0x4'));var config=require('../../config/environment');var jayson=require(_0xf31c('0x5'));var client=jayson['client'][_0xf31c('0x6')]({'port':0x232a});config[_0xf31c('0x7')]=_['defaults'](config[_0xf31c('0x7')],{'host':_0xf31c('0x8'),'port':0x18eb});var socket=require(_0xf31c('0x9'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x322a18,_0x2e6bc6,_0x42ca0c){return new BPromise(function(_0x1df152,_0x443591){return client[_0xf31c('0xa')](_0x322a18,_0x42ca0c)[_0xf31c('0xb')](function(_0x71f1ed){logger[_0xf31c('0xc')](_0xf31c('0xd'),_0x2e6bc6,'request\x20sent');logger[_0xf31c('0xe')](_0xf31c('0xf'),_0x2e6bc6,_0xf31c('0x10'),JSON[_0xf31c('0x11')](_0x71f1ed));if(_0x71f1ed[_0xf31c('0x12')]){if(_0x71f1ed['error'][_0xf31c('0x13')]===0x1f4){logger[_0xf31c('0x12')](_0xf31c('0xd'),_0x2e6bc6,_0x71f1ed[_0xf31c('0x12')]['message']);return _0x443591(_0x71f1ed[_0xf31c('0x12')][_0xf31c('0x14')]);}logger[_0xf31c('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x2e6bc6,_0x71f1ed[_0xf31c('0x12')][_0xf31c('0x14')]);return _0x1df152(_0x71f1ed[_0xf31c('0x12')][_0xf31c('0x14')]);}else{logger[_0xf31c('0xc')](_0xf31c('0xd'),_0x2e6bc6,_0xf31c('0x10'));_0x1df152(_0x71f1ed[_0xf31c('0x15')][_0xf31c('0x14')]);}})[_0xf31c('0x16')](function(_0xd6bc6b){logger[_0xf31c('0x12')](_0xf31c('0xd'),_0x2e6bc6,_0xd6bc6b);_0x443591(_0xd6bc6b);});});}exports['UpdateChatInteraction']=function(_0x4430f8){var _0x32c2cd=this;return new Promise(function(_0x3ee2ec,_0x3a11da){return db[_0xf31c('0x17')][_0xf31c('0x18')](_0x4430f8[_0xf31c('0x19')],{'raw':_0x4430f8['options']?_0x4430f8['options'][_0xf31c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4430f8[_0xf31c('0x1b')]?_0x4430f8[_0xf31c('0x1b')][_0xf31c('0x1c')]||null:null,'attributes':_0x4430f8[_0xf31c('0x1b')]?_0x4430f8[_0xf31c('0x1b')]['attributes']||null:null,'limit':_0x4430f8[_0xf31c('0x1b')]?_0x4430f8[_0xf31c('0x1b')]['limit']||null:null})[_0xf31c('0xb')](function(_0x10cca3){logger[_0xf31c('0xc')](_0xf31c('0x1d'),_0x4430f8);logger[_0xf31c('0xe')](_0xf31c('0x1d'),_0x4430f8,JSON[_0xf31c('0x11')](_0x10cca3));_0x3ee2ec(_0x10cca3);})[_0xf31c('0x16')](function(_0x39461a){logger[_0xf31c('0x12')]('UpdateChatInteraction',_0x39461a['message'],_0x4430f8);_0x3a11da(_0x32c2cd[_0xf31c('0x12')](0x1f4,_0x39461a[_0xf31c('0x14')]));});});};exports[_0xf31c('0x1e')]=function(_0x4b13a9){return new Promise(function(_0x471112,_0x5eccbd){return db[_0xf31c('0x17')]['find']({'where':_0x4b13a9[_0xf31c('0x1b')]?_0x4b13a9[_0xf31c('0x1b')][_0xf31c('0x1c')]||null:null})[_0xf31c('0xb')](function(_0x56ad9c){if(_0x56ad9c){return _0x56ad9c[_0xf31c('0x1f')](_0x4b13a9[_0xf31c('0x19')][_0xf31c('0x20')],_[_0xf31c('0x21')](_0x4b13a9[_0xf31c('0x19')],[_0xf31c('0x20'),'id'])||{});}})['spread'](function(_0x364abd){logger[_0xf31c('0xc')](_0xf31c('0x22'),_0x4b13a9);logger[_0xf31c('0xe')](_0xf31c('0x22'),_0x4b13a9,JSON[_0xf31c('0x11')](_0x364abd));_0x471112(_0x364abd);})['catch'](function(_0x147475){logger[_0xf31c('0x12')](_0xf31c('0x22'),_0x147475[_0xf31c('0x14')],_0x4b13a9);_0x5eccbd(_this[_0xf31c('0x12')](0x1f4,_0x147475[_0xf31c('0x14')]));});});}; \ No newline at end of file +var _0x93c6=['body','options','raw','where','limit','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update'];(function(_0x11da31,_0x5d576f){var _0x6bb4c8=function(_0x1680a3){while(--_0x1680a3){_0x11da31['push'](_0x11da31['shift']());}};_0x6bb4c8(++_0x5d576f);}(_0x93c6,0x88));var _0x693c=function(_0x5d18fc,_0x1de58d){_0x5d18fc=_0x5d18fc-0x0;var _0x2444dd=_0x93c6[_0x5d18fc];return _0x2444dd;};'use strict';var _=require(_0x693c('0x0'));var util=require(_0x693c('0x1'));var moment=require(_0x693c('0x2'));var BPromise=require(_0x693c('0x3'));var rs=require(_0x693c('0x4'));var fs=require('fs');var Redis=require(_0x693c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x693c('0x6'));var logger=require(_0x693c('0x7'))(_0x693c('0x8'));var config=require(_0x693c('0x9'));var jayson=require(_0x693c('0xa'));var client=jayson[_0x693c('0xb')][_0x693c('0xc')]({'port':0x232a});config[_0x693c('0xd')]=_[_0x693c('0xe')](config[_0x693c('0xd')],{'host':_0x693c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x693c('0xd')]));require(_0x693c('0x10'))[_0x693c('0x11')](socket);function respondWithRpcPromise(_0x577f32,_0x5f26ce,_0x33d2f7){return new BPromise(function(_0x31e357,_0x1c1c69){return client[_0x693c('0x12')](_0x577f32,_0x33d2f7)[_0x693c('0x13')](function(_0x5e94ff){logger[_0x693c('0x14')](_0x693c('0x15'),_0x5f26ce,_0x693c('0x16'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5f26ce,_0x693c('0x16'),JSON[_0x693c('0x17')](_0x5e94ff));if(_0x5e94ff['error']){if(_0x5e94ff[_0x693c('0x18')][_0x693c('0x19')]===0x1f4){logger[_0x693c('0x18')](_0x693c('0x15'),_0x5f26ce,_0x5e94ff['error'][_0x693c('0x1a')]);return _0x1c1c69(_0x5e94ff[_0x693c('0x18')]['message']);}logger['error'](_0x693c('0x15'),_0x5f26ce,_0x5e94ff[_0x693c('0x18')]['message']);return _0x31e357(_0x5e94ff[_0x693c('0x18')][_0x693c('0x1a')]);}else{logger[_0x693c('0x14')](_0x693c('0x15'),_0x5f26ce,_0x693c('0x16'));_0x31e357(_0x5e94ff[_0x693c('0x1b')]['message']);}})[_0x693c('0x1c')](function(_0x3cf1b0){logger['error'](_0x693c('0x15'),_0x5f26ce,_0x3cf1b0);_0x1c1c69(_0x3cf1b0);});});}exports[_0x693c('0x1d')]=function(_0x21aa18){var _0x2c8a6d=this;return new Promise(function(_0xca7140,_0x2ba1d5){return db[_0x693c('0x1e')][_0x693c('0x1f')](_0x21aa18[_0x693c('0x20')],{'raw':_0x21aa18[_0x693c('0x21')]?_0x21aa18[_0x693c('0x21')][_0x693c('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21aa18[_0x693c('0x21')]?_0x21aa18[_0x693c('0x21')][_0x693c('0x23')]||null:null,'attributes':_0x21aa18[_0x693c('0x21')]?_0x21aa18[_0x693c('0x21')]['attributes']||null:null,'limit':_0x21aa18[_0x693c('0x21')]?_0x21aa18[_0x693c('0x21')][_0x693c('0x24')]||null:null})[_0x693c('0x13')](function(_0x2e2db7){logger[_0x693c('0x14')](_0x693c('0x1d'),_0x21aa18);logger['debug'](_0x693c('0x1d'),_0x21aa18,JSON[_0x693c('0x17')](_0x2e2db7));_0xca7140(_0x2e2db7);})[_0x693c('0x1c')](function(_0x5284fb){logger[_0x693c('0x18')]('UpdateChatInteraction',_0x5284fb['message'],_0x21aa18);_0x2ba1d5(_0x2c8a6d[_0x693c('0x18')](0x1f4,_0x5284fb[_0x693c('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x5d8b2d){return new Promise(function(_0x3090e6,_0x5d6622){return db[_0x693c('0x1e')][_0x693c('0x25')]({'where':_0x5d8b2d[_0x693c('0x21')]?_0x5d8b2d[_0x693c('0x21')][_0x693c('0x23')]||null:null})['then'](function(_0x54fcce){if(_0x54fcce){return _0x54fcce[_0x693c('0x26')](_0x5d8b2d[_0x693c('0x20')][_0x693c('0x27')],_[_0x693c('0x28')](_0x5d8b2d[_0x693c('0x20')],[_0x693c('0x27'),'id'])||{});}})['spread'](function(_0x1245b6){logger[_0x693c('0x14')](_0x693c('0x29'),_0x5d8b2d);logger['debug']('AddTags',_0x5d8b2d,JSON[_0x693c('0x17')](_0x1245b6));_0x3090e6(_0x1245b6);})['catch'](function(_0x12afe1){logger[_0x693c('0x18')]('AddTags',_0x12afe1[_0x693c('0x1a')],_0x5d8b2d);_0x5d6622(_this[_0x693c('0x18')](0x1f4,_0x12afe1[_0x693c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 17e2f34..713a797 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 _0x550e=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x550e,0x9d));var _0xe550=function(_0x10e85b,_0x36db62){_0x10e85b=_0x10e85b-0x0;var _0x521052=_0x550e[_0x10e85b];return _0x521052;};'use strict';var ChatInteractionEvents=require(_0xe550('0x0'));var events=[_0xe550('0x1'),_0xe550('0x2'),_0xe550('0x3')];function createListener(_0x5d169c,_0x35ff5e){return function(_0x1b5207){_0x35ff5e['emit'](_0x5d169c,_0x1b5207);};}function removeListener(_0x52273a,_0x31517a){return function(){ChatInteractionEvents[_0xe550('0x4')](_0x52273a,_0x31517a);};}exports[_0xe550('0x5')]=function(_0x2674cb){for(var _0x5f0d53=0x0,_0x48b255=events[_0xe550('0x6')];_0x5f0d53<_0x48b255;_0x5f0d53++){var _0x3f0319=events[_0x5f0d53];var _0x587434=createListener(_0xe550('0x7')+_0x3f0319,_0x2674cb);ChatInteractionEvents['on'](_0x3f0319,_0x587434);}}; \ No newline at end of file +var _0x5458=['register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x3d84ae,_0x56cf1c){var _0x499806=function(_0x117534){while(--_0x117534){_0x3d84ae['push'](_0x3d84ae['shift']());}};_0x499806(++_0x56cf1c);}(_0x5458,0x1d7));var _0x8545=function(_0x4fd7b2,_0x753108){_0x4fd7b2=_0x4fd7b2-0x0;var _0x3ea112=_0x5458[_0x4fd7b2];return _0x3ea112;};'use strict';var ChatInteractionEvents=require(_0x8545('0x0'));var events=[_0x8545('0x1'),_0x8545('0x2'),_0x8545('0x3')];function createListener(_0x4f3961,_0x4eaacb){return function(_0x5a7ab7){_0x4eaacb[_0x8545('0x4')](_0x4f3961,_0x5a7ab7);};}function removeListener(_0x77a398,_0x3e5b3c){return function(){ChatInteractionEvents[_0x8545('0x5')](_0x77a398,_0x3e5b3c);};}exports[_0x8545('0x6')]=function(_0x2cebbb){for(var _0x3c53d0=0x0,_0x5bb9e=events[_0x8545('0x7')];_0x3c53d0<_0x5bb9e;_0x3c53d0++){var _0x17e822=events[_0x3c53d0];var _0x410082=createListener(_0x8545('0x8')+_0x17e822,_0x2cebbb);ChatInteractionEvents['on'](_0x17e822,_0x410082);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 522bc66..48754aa 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 _0x84a0=['/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','now','originalname','/:id/attachment_upload','single','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','update','customUpdate','abandon','/:id/close','destroy','delete','/:id/tags','removeTags','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages'];(function(_0x2af754,_0x1e90c6){var _0x4e033e=function(_0x1920fa){while(--_0x1920fa){_0x2af754['push'](_0x2af754['shift']());}};_0x4e033e(++_0x1e90c6);}(_0x84a0,0xf1));var _0x084a=function(_0x491903,_0x2e5a65){_0x491903=_0x491903-0x0;var _0x179dd8=_0x84a0[_0x491903];return _0x179dd8;};'use strict';var multer=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var path=require(_0x084a('0x2'));var timeout=require(_0x084a('0x3'));var express=require(_0x084a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x084a('0x5'));var interaction=require(_0x084a('0x6'));var config=require(_0x084a('0x7'));var controller=require('./chatInteraction.controller');router[_0x084a('0x8')]('/',auth[_0x084a('0x9')](),controller[_0x084a('0xa')]);router[_0x084a('0x8')]('/describe',auth[_0x084a('0x9')](),controller['describe']);router[_0x084a('0x8')](_0x084a('0xb'),auth[_0x084a('0xc')](),controller['show']);router[_0x084a('0x8')]('/:id/attachment_download',auth[_0x084a('0xc')](),controller[_0x084a('0xd')]);router[_0x084a('0x8')](_0x084a('0xe'),auth[_0x084a('0x9')](),controller[_0x084a('0xf')]);router[_0x084a('0x8')](_0x084a('0x10'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x084a('0x8')](_0x084a('0x11'),auth[_0x084a('0x9')](),controller[_0x084a('0x12')]);router[_0x084a('0x13')]('/',auth[_0x084a('0x9')](),controller['create']);router[_0x084a('0x13')](_0x084a('0x14'),auth[_0x084a('0x9')](),controller[_0x084a('0x15')]);var upload=multer({'storage':multer[_0x084a('0x16')]({'destination':function(_0x4abb31,_0x3b6f5f,_0x476f10){_0x476f10(null,path[_0x084a('0x17')](config['root'],_0x084a('0x18')));},'filename':function(_0x5cc023,_0x4c17ba,_0x59d020){_0x59d020(null,util['format']('%s-%s',Date[_0x084a('0x19')](),_0x4c17ba[_0x084a('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x084a('0x13')](_0x084a('0x1b'),upload[_0x084a('0x1c')]('file'),controller[_0x084a('0x1d')]);router[_0x084a('0x13')](_0x084a('0xe'),auth[_0x084a('0xc')](),controller['addMessage']);router[_0x084a('0x13')]('/:id/tags',auth[_0x084a('0x9')](),interaction[_0x084a('0x1e')](_0x084a('0x1f'),_0x084a('0x20')),controller[_0x084a('0x21')]);router[_0x084a('0x22')](_0x084a('0xb'),auth[_0x084a('0x9')](),interaction[_0x084a('0x1e')](_0x084a('0x1f'),'chatinteraction:update'),controller[_0x084a('0x23')]);router[_0x084a('0x22')]('/:id/custom_update',controller[_0x084a('0x24')]);router[_0x084a('0x22')]('/:id/abandon',auth[_0x084a('0xc')](),controller[_0x084a('0x25')]);router[_0x084a('0x22')](_0x084a('0x26'),controller['close']);router['delete'](_0x084a('0xb'),auth[_0x084a('0x9')](),interaction[_0x084a('0x1e')]('chat','chatinteraction:destroy'),controller[_0x084a('0x27')]);router[_0x084a('0x28')](_0x084a('0x29'),auth[_0x084a('0x9')](),controller[_0x084a('0x2a')]);module['exports']=router; \ No newline at end of file +var _0x3553=['delete','chatinteraction:destroy','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','customUpdate','/:id/abandon','/:id/close','close'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x3553,0xc7));var _0x3355=function(_0x144051,_0xde7701){_0x144051=_0x144051-0x0;var _0x1c0dc1=_0x3553[_0x144051];return _0x1c0dc1;};'use strict';var multer=require('multer');var util=require(_0x3355('0x0'));var path=require(_0x3355('0x1'));var timeout=require('connect-timeout');var express=require(_0x3355('0x2'));var router=express['Router']();var fs_extra=require(_0x3355('0x3'));var auth=require(_0x3355('0x4'));var interaction=require(_0x3355('0x5'));var config=require('../../config/environment');var controller=require(_0x3355('0x6'));router[_0x3355('0x7')]('/',auth['isAuthenticated'](),controller[_0x3355('0x8')]);router['get'](_0x3355('0x9'),auth[_0x3355('0xa')](),controller[_0x3355('0xb')]);router['get'](_0x3355('0xc'),auth[_0x3355('0xd')](),controller[_0x3355('0xe')]);router['get'](_0x3355('0xf'),auth[_0x3355('0xd')](),controller[_0x3355('0x10')]);router['get'](_0x3355('0x11'),auth['isAuthenticated'](),controller[_0x3355('0x12')]);router[_0x3355('0x7')](_0x3355('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x3355('0x14')]);router[_0x3355('0x7')](_0x3355('0x15'),auth[_0x3355('0xa')](),controller[_0x3355('0x16')]);router[_0x3355('0x17')]('/',auth[_0x3355('0xa')](),controller['create']);router[_0x3355('0x17')](_0x3355('0x18'),auth[_0x3355('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x3355('0x19')]({'destination':function(_0x2ae531,_0x40071a,_0x526f20){_0x526f20(null,path[_0x3355('0x1a')](config['root'],_0x3355('0x1b')));},'filename':function(_0x52efce,_0x218abf,_0x476067){_0x476067(null,util[_0x3355('0x1c')]('%s-%s',Date[_0x3355('0x1d')](),_0x218abf[_0x3355('0x1e')][_0x3355('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3355('0x17')](_0x3355('0x20'),upload['single'](_0x3355('0x21')),controller[_0x3355('0x22')]);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x3355('0x23')]);router[_0x3355('0x17')](_0x3355('0x24'),auth['isAuthenticated'](),interaction[_0x3355('0x25')](_0x3355('0x26'),_0x3355('0x27')),controller[_0x3355('0x28')]);router[_0x3355('0x29')](_0x3355('0xc'),auth[_0x3355('0xa')](),interaction['tracked'](_0x3355('0x26'),'chatinteraction:update'),controller['update']);router[_0x3355('0x29')]('/:id/custom_update',controller[_0x3355('0x2a')]);router[_0x3355('0x29')](_0x3355('0x2b'),auth[_0x3355('0xd')](),controller['abandon']);router[_0x3355('0x29')](_0x3355('0x2c'),controller[_0x3355('0x2d')]);router[_0x3355('0x2e')](_0x3355('0xc'),auth[_0x3355('0xa')](),interaction[_0x3355('0x25')](_0x3355('0x26'),_0x3355('0x2f')),controller[_0x3355('0x30')]);router['delete'](_0x3355('0x24'),auth[_0x3355('0xa')](),controller['removeTags']);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 a671cef..87013a7 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 _0xa614=['INTEGER','medium'];(function(_0x48cda9,_0x575113){var _0xe47e76=function(_0x502303){while(--_0x502303){_0x48cda9['push'](_0x48cda9['shift']());}};_0xe47e76(++_0x575113);}(_0xa614,0x1b9));var _0x4a61=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0xa614[_0x528575];return _0x3063b7;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x4a61('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4a61('0x1')]}}; \ No newline at end of file +var _0x0ede=['INTEGER','BOOLEAN'];(function(_0x50c0a0,_0x29e026){var _0x561aa7=function(_0x453ed3){while(--_0x453ed3){_0x50c0a0['push'](_0x50c0a0['shift']());}};_0x561aa7(++_0x29e026);}(_0x0ede,0x119));var _0xe0ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ede[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0ed('0x0')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe0ed('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 1e28cad..36b6cc0 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 _0x9f1b=['VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','messages','createdAt','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','offset','undefined','count','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','index','ChatInternalMessage','type','key','model','map','keys','query','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','describe','get','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','user','fullname','role','internal','online','lastLoginAt','showWebBar','-online'];(function(_0x1f6e85,_0x46ac39){var _0x1c9d9f=function(_0x2ba5dc){while(--_0x2ba5dc){_0x1f6e85['push'](_0x1f6e85['shift']());}};_0x1c9d9f(++_0x46ac39);}(_0x9f1b,0x1a3));var _0xb9f1=function(_0x4f8daa,_0x5bc6fc){_0x4f8daa=_0x4f8daa-0x0;var _0x393ad=_0x9f1b[_0x4f8daa];return _0x393ad;};'use strict';var emlformat=require(_0xb9f1('0x0'));var rimraf=require(_0xb9f1('0x1'));var zipdir=require(_0xb9f1('0x2'));var jsonpatch=require(_0xb9f1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb9f1('0x4'));var Mustache=require(_0xb9f1('0x5'));var util=require(_0xb9f1('0x6'));var path=require('path');var sox=require(_0xb9f1('0x7'));var csv=require(_0xb9f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9f1('0x9'));var _=require(_0xb9f1('0xa'));var squel=require('squel');var crypto=require(_0xb9f1('0xb'));var jsforce=require(_0xb9f1('0xc'));var deskjs=require(_0xb9f1('0xd'));var toCsv=require(_0xb9f1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb9f1('0xe'));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(_0xb9f1('0xf'));var licenseUtil=require(_0xb9f1('0x10'));var db=require('../../mysqldb')['db'];config[_0xb9f1('0x11')]=_[_0xb9f1('0x12')](config['redis'],{'host':_0xb9f1('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9f1('0x11')]));require(_0xb9f1('0x14'))[_0xb9f1('0x15')](socket);function respondWithStatusCode(_0x3a4ad8,_0x46257e){_0x46257e=_0x46257e||0xcc;return function(_0x5c5e26){if(_0x5c5e26){return _0x3a4ad8[_0xb9f1('0x16')](_0x46257e);}return _0x3a4ad8['status'](_0x46257e)['end']();};}function respondWithResult(_0x2868aa,_0x23dd2b){_0x23dd2b=_0x23dd2b||0xc8;return function(_0x5bb37e){if(_0x5bb37e){return _0x2868aa[_0xb9f1('0x17')](_0x23dd2b)['json'](_0x5bb37e);}};}function respondWithFilteredResult(_0x1c8586,_0xc156fd){return function(_0x5b877e){if(_0x5b877e){var _0x7db9eb=typeof _0xc156fd[_0xb9f1('0x18')]===_0xb9f1('0x19')&&typeof _0xc156fd['limit']===_0xb9f1('0x19');var _0x259c6b=_0x5b877e[_0xb9f1('0x1a')];var _0x5ebeab=_0x7db9eb?0x0:_0xc156fd[_0xb9f1('0x18')];var _0x378d3c=_0x7db9eb?_0x5b877e['count']:_0xc156fd[_0xb9f1('0x18')]+_0xc156fd['limit'];var _0x33436d;if(_0x378d3c>=_0x259c6b){_0x378d3c=_0x259c6b;_0x33436d=0xc8;}else{_0x33436d=0xce;}_0x1c8586[_0xb9f1('0x17')](_0x33436d);return _0x1c8586['set'](_0xb9f1('0x1b'),_0x5ebeab+'-'+_0x378d3c+'/'+_0x259c6b)[_0xb9f1('0x1c')](_0x5b877e);}return null;};}function patchUpdates(_0xa0e544){return function(_0x12e14a){try{jsonpatch['apply'](_0x12e14a,_0xa0e544,!![]);}catch(_0x41937f){return BPromise[_0xb9f1('0x1d')](_0x41937f);}return _0x12e14a[_0xb9f1('0x1e')]();};}function saveUpdates(_0x5aed94,_0xc182e){return function(_0x1ea418){if(_0x1ea418){return _0x1ea418[_0xb9f1('0x1f')](_0x5aed94)['then'](function(_0x5c84cc){return _0x5c84cc;});}return null;};}function removeEntity(_0x591c30,_0xc1631d){return function(_0x2765c7){if(_0x2765c7){return _0x2765c7[_0xb9f1('0x20')]()[_0xb9f1('0x21')](function(){_0x591c30[_0xb9f1('0x17')](0xcc)[_0xb9f1('0x22')]();});}};}function handleEntityNotFound(_0x1bf846,_0x524871){return function(_0xd71d82){if(!_0xd71d82){_0x1bf846[_0xb9f1('0x16')](0x194);}return _0xd71d82;};}function handleError(_0x4432ce,_0x56c0f1){_0x56c0f1=_0x56c0f1||0x1f4;return function(_0x5d3875){logger[_0xb9f1('0x23')](_0x5d3875[_0xb9f1('0x24')]);if(_0x5d3875[_0xb9f1('0x25')]){delete _0x5d3875['name'];}_0x4432ce[_0xb9f1('0x17')](_0x56c0f1)['send'](_0x5d3875);};}exports[_0xb9f1('0x26')]=function(_0x4c4b25,_0x23d2c7){var _0x463dd2={},_0x4984c6={},_0xc82e19={'count':0x0,'rows':[]};var _0x248274=_['map'](db[_0xb9f1('0x27')]['rawAttributes'],function(_0x471fac){return{'name':_0x471fac['fieldName'],'type':_0x471fac[_0xb9f1('0x28')][_0xb9f1('0x29')]};});_0x4984c6[_0xb9f1('0x2a')]=_[_0xb9f1('0x2b')](_0x248274,_0xb9f1('0x25'));_0x4984c6['query']=_[_0xb9f1('0x2c')](_0x4c4b25['query']);_0x4984c6['filters']=_['intersection'](_0x4984c6['model'],_0x4984c6[_0xb9f1('0x2d')]);_0x463dd2[_0xb9f1('0x2e')]=_[_0xb9f1('0x2f')](_0x4984c6[_0xb9f1('0x2a')],qs[_0xb9f1('0x30')](_0x4c4b25[_0xb9f1('0x2d')]['fields']));_0x463dd2[_0xb9f1('0x2e')]=_0x463dd2[_0xb9f1('0x2e')][_0xb9f1('0x31')]?_0x463dd2[_0xb9f1('0x2e')]:_0x4984c6['model'];if(!_0x4c4b25[_0xb9f1('0x2d')]['hasOwnProperty'](_0xb9f1('0x32'))){_0x463dd2[_0xb9f1('0x33')]=qs[_0xb9f1('0x33')](_0x4c4b25[_0xb9f1('0x2d')]['limit']);_0x463dd2[_0xb9f1('0x18')]=qs[_0xb9f1('0x18')](_0x4c4b25[_0xb9f1('0x2d')][_0xb9f1('0x18')]);}_0x463dd2[_0xb9f1('0x34')]=qs[_0xb9f1('0x35')](_0x4c4b25[_0xb9f1('0x2d')]['sort']);_0x463dd2[_0xb9f1('0x36')]=qs['filters'](_[_0xb9f1('0x37')](_0x4c4b25[_0xb9f1('0x2d')],_0x4984c6[_0xb9f1('0x38')]),_0x248274);if(_0x4c4b25[_0xb9f1('0x2d')][_0xb9f1('0x39')]){_0x463dd2['where']=_['merge'](_0x463dd2[_0xb9f1('0x36')],{'$or':_['map'](_0x248274,function(_0x55b26a){if(_0x55b26a[_0xb9f1('0x28')]!==_0xb9f1('0x3a')){var _0x2993c9={};_0x2993c9[_0x55b26a[_0xb9f1('0x25')]]={'$like':'%'+_0x4c4b25[_0xb9f1('0x2d')][_0xb9f1('0x39')]+'%'};return _0x2993c9;}})});}_0x463dd2=_[_0xb9f1('0x3b')]({},_0x463dd2,_0x4c4b25[_0xb9f1('0x3c')]);var _0x57a5b0={'where':_0x463dd2[_0xb9f1('0x36')]};return db[_0xb9f1('0x27')]['count'](_0x57a5b0)[_0xb9f1('0x21')](function(_0x48e9e8){_0xc82e19['count']=_0x48e9e8;if(_0x4c4b25[_0xb9f1('0x2d')][_0xb9f1('0x3d')]){_0x463dd2[_0xb9f1('0x3e')]=[{'all':!![]}];}return db[_0xb9f1('0x27')][_0xb9f1('0x3f')](_0x463dd2);})[_0xb9f1('0x21')](function(_0x20db73){_0xc82e19[_0xb9f1('0x40')]=_0x20db73;return _0xc82e19;})[_0xb9f1('0x21')](respondWithFilteredResult(_0x23d2c7,_0x463dd2))[_0xb9f1('0x41')](handleError(_0x23d2c7,null));};exports['show']=function(_0x466e08,_0x30e442){var _0x4b7ab9={'raw':!![],'where':{'id':_0x466e08['params']['id']}},_0x2cf74c={};_0x2cf74c[_0xb9f1('0x2a')]=_[_0xb9f1('0x2c')](db[_0xb9f1('0x27')][_0xb9f1('0x42')]);_0x2cf74c[_0xb9f1('0x2d')]=_[_0xb9f1('0x2c')](_0x466e08[_0xb9f1('0x2d')]);_0x2cf74c[_0xb9f1('0x38')]=_[_0xb9f1('0x2f')](_0x2cf74c[_0xb9f1('0x2a')],_0x2cf74c[_0xb9f1('0x2d')]);_0x4b7ab9[_0xb9f1('0x2e')]=_[_0xb9f1('0x2f')](_0x2cf74c[_0xb9f1('0x2a')],qs[_0xb9f1('0x30')](_0x466e08[_0xb9f1('0x2d')]['fields']));_0x4b7ab9[_0xb9f1('0x2e')]=_0x4b7ab9[_0xb9f1('0x2e')]['length']?_0x4b7ab9[_0xb9f1('0x2e')]:_0x2cf74c[_0xb9f1('0x2a')];if(_0x466e08['query'][_0xb9f1('0x3d')]){_0x4b7ab9[_0xb9f1('0x3e')]=[{'all':!![]}];}_0x4b7ab9=_[_0xb9f1('0x3b')]({},_0x4b7ab9,_0x466e08[_0xb9f1('0x3c')]);return db[_0xb9f1('0x27')][_0xb9f1('0x43')](_0x4b7ab9)[_0xb9f1('0x21')](handleEntityNotFound(_0x30e442,null))[_0xb9f1('0x21')](respondWithResult(_0x30e442,null))[_0xb9f1('0x41')](handleError(_0x30e442,null));};exports[_0xb9f1('0x44')]=function(_0x13fd73,_0x316a75){return db[_0xb9f1('0x27')][_0xb9f1('0x44')](_0x13fd73[_0xb9f1('0x45')],{})[_0xb9f1('0x21')](respondWithResult(_0x316a75,0xc9))[_0xb9f1('0x41')](handleError(_0x316a75,null));};exports[_0xb9f1('0x1f')]=function(_0x272e8b,_0xbf21e2){if(_0x272e8b[_0xb9f1('0x45')]['id']){delete _0x272e8b[_0xb9f1('0x45')]['id'];}return db['ChatInternalMessage'][_0xb9f1('0x43')]({'where':{'id':_0x272e8b[_0xb9f1('0x46')]['id']}})['then'](handleEntityNotFound(_0xbf21e2,null))[_0xb9f1('0x21')](saveUpdates(_0x272e8b[_0xb9f1('0x45')],null))['then'](respondWithResult(_0xbf21e2,null))[_0xb9f1('0x41')](handleError(_0xbf21e2,null));};exports[_0xb9f1('0x20')]=function(_0x2de198,_0x15c639){return db['ChatInternalMessage'][_0xb9f1('0x43')]({'where':{'id':_0x2de198[_0xb9f1('0x46')]['id']}})['then'](handleEntityNotFound(_0x15c639,null))[_0xb9f1('0x21')](removeEntity(_0x15c639,null))[_0xb9f1('0x41')](handleError(_0x15c639,null));};exports[_0xb9f1('0x47')]=function(_0x2100fd,_0x426ab3){return db[_0xb9f1('0x27')][_0xb9f1('0x47')]()[_0xb9f1('0x21')](respondWithResult(_0x426ab3,null))['catch'](handleError(_0x426ab3,null));};function wrapUser(_0x551b9a){return function(_0x3e92e4){var _0x22255b=_0x551b9a[_0xb9f1('0x48')]({'plain':!![]});_0x22255b['messages']=[];if(_0x3e92e4){_0x22255b['lastMessageAt']=_0x3e92e4['createdAt'];_0x22255b['lastMessage']=_0x3e92e4;}else{_0x22255b[_0xb9f1('0x49')]=moment(0x0)['format'](_0xb9f1('0x4a'));_0x22255b[_0xb9f1('0x4b')]={};}return _0x22255b;};}exports[_0xb9f1('0x4c')]=function(_0x9ce191,_0x55d20d,_0x4fb317){var _0x3f4eb7=[];return db['User'][_0xb9f1('0x3f')]({'where':{'role':[_0xb9f1('0x4d'),'admin',_0xb9f1('0x4e')]},'attributes':['id',_0xb9f1('0x4f'),'name',_0xb9f1('0x50'),'userpic',_0xb9f1('0x51'),_0xb9f1('0x52'),_0xb9f1('0x53'),'allowmessenger',_0xb9f1('0x54')],'order':qs[_0xb9f1('0x35')](_0xb9f1('0x55')),'include':[{'model':db[_0xb9f1('0x56')],'as':_0xb9f1('0x57'),'attributes':['id',_0xb9f1('0x25'),'type'],'through':{'attributes':[]}}]})[_0xb9f1('0x21')](function(_0x44dbdb){if(_0x44dbdb){var _0x533309=_0x9ce191[_0xb9f1('0x4e')][_0xb9f1('0x48')]({'plain':!![]});if(!_0x533309)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x533309[_0xb9f1('0x50')]===_0xb9f1('0x4e')){return db[_0xb9f1('0x58')][_0xb9f1('0x43')]({'where':{'name':_0xb9f1('0x59'),'userProfileId':_0x533309[_0xb9f1('0x5a')]},'raw':!![]})[_0xb9f1('0x21')](function(_0x10f9c7){if(_0x10f9c7){if(_0x10f9c7[_0xb9f1('0x5b')]===0x0){return db[_0xb9f1('0x5c')][_0xb9f1('0x3f')]({'where':{'sectionId':_0x10f9c7['id']},'raw':!![]})[_0xb9f1('0x21')](function(_0x54f33b){var _0x3afbf6=[];if(_[_0xb9f1('0x5d')](_0x54f33b)){_0x3afbf6=_[_0xb9f1('0x39')](_0x44dbdb,function(_0x491388){if(_0x491388[_0xb9f1('0x50')]!==_0xb9f1('0x4d')){return _0x491388;}});return _0x3afbf6;}else{for(var _0x883b1c=0x0;_0x883b1c<_0x44dbdb[_0xb9f1('0x31')];_0x883b1c++){var _0x12212f=_0x44dbdb[_0x883b1c];if(_0x12212f[_0xb9f1('0x50')]===_0xb9f1('0x4d')){var _0x37ba19=_[_0xb9f1('0x43')](_0x54f33b,function(_0x5e1bd4){return _0x5e1bd4[_0xb9f1('0x5e')]===_0x12212f['id'];});if(_0x37ba19)_0x3afbf6['push'](_0x12212f);}else{_0x3afbf6['push'](_0x12212f);}}return _0x3afbf6;}});}else{return _0x44dbdb;}}else{var _0x489334=_[_0xb9f1('0x39')](_0x44dbdb,function(_0x14335b){if(_0x14335b[_0xb9f1('0x50')]!==_0xb9f1('0x4d')){return _0x14335b;}});return _0x489334;}});}else{return _0x44dbdb;}}})['then'](function(_0x1089f5){var _0x35771e=[];if(_0x1089f5){_0x3f4eb7=_0x1089f5;for(var _0x25d057=0x0;_0x25d057<_0x1089f5['length'];_0x25d057+=0x1){_0x3f4eb7[_0x25d057][_0xb9f1('0x5f')]=[];_0x35771e['push'](db['ChatInternalMessage'][_0xb9f1('0x43')]({'where':{'FromId':[_0x9ce191[_0xb9f1('0x4e')]['id'],_0x1089f5[_0x25d057]['id']],'ToId':[_0x9ce191[_0xb9f1('0x4e')]['id'],_0x1089f5[_0x25d057]['id']],'ChatGroupId':null},'attributes':['id',_0xb9f1('0x60'),_0xb9f1('0x61'),_0xb9f1('0x62'),_0xb9f1('0x63'),_0xb9f1('0x45')],'order':qs[_0xb9f1('0x35')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb9f1('0x21')](wrapUser(_0x1089f5[_0x25d057])));}return BPromise[_0xb9f1('0x64')](_0x35771e);}return[];})[_0xb9f1('0x21')](function(_0x3eb4dc){return{'rows':_0x3eb4dc,'count':_0x3eb4dc[_0xb9f1('0x31')]};})[_0xb9f1('0x21')](respondWithResult(_0x55d20d,null))['catch'](handleError(_0x55d20d,null));}; \ No newline at end of file +var _0x6fbf=['save','update','then','destroy','end','error','name','send','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','limit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','keys','intersection','includeAll','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','getUsers','agent','admin','user','fullname','userpic','internal','lastLoginAt','showWebBar','-online','VoiceQueues','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0x1f1876,_0x53c2f8){var _0xf5ba8c=function(_0x3748e5){while(--_0x3748e5){_0x1f1876['push'](_0x1f1876['shift']());}};_0xf5ba8c(++_0x53c2f8);}(_0x6fbf,0x11d));var _0xf6fb=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x6fbf[_0x137d1d];return _0x485108;};'use strict';var emlformat=require(_0xf6fb('0x0'));var rimraf=require(_0xf6fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6fb('0x2'));var rp=require(_0xf6fb('0x3'));var moment=require(_0xf6fb('0x4'));var BPromise=require(_0xf6fb('0x5'));var Mustache=require('mustache');var util=require(_0xf6fb('0x6'));var path=require(_0xf6fb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf6fb('0x8'));var fs=require('fs');var fs_extra=require(_0xf6fb('0x9'));var _=require(_0xf6fb('0xa'));var squel=require(_0xf6fb('0xb'));var crypto=require(_0xf6fb('0xc'));var jsforce=require(_0xf6fb('0xd'));var deskjs=require(_0xf6fb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf6fb('0xf'));var Papa=require(_0xf6fb('0x10'));var Redis=require(_0xf6fb('0x11'));var authService=require(_0xf6fb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf6fb('0x13'));var hardwareService=require(_0xf6fb('0x14'));var logger=require(_0xf6fb('0x15'))(_0xf6fb('0x16'));var utils=require(_0xf6fb('0x17'));var config=require(_0xf6fb('0x18'));var licenseUtil=require(_0xf6fb('0x19'));var db=require(_0xf6fb('0x1a'))['db'];config[_0xf6fb('0x1b')]=_[_0xf6fb('0x1c')](config['redis'],{'host':_0xf6fb('0x1d'),'port':0x18eb});var socket=require(_0xf6fb('0x1e'))(new Redis(config[_0xf6fb('0x1b')]));require(_0xf6fb('0x1f'))['register'](socket);function respondWithStatusCode(_0x10e883,_0x18ccd5){_0x18ccd5=_0x18ccd5||0xcc;return function(_0x2f6892){if(_0x2f6892){return _0x10e883[_0xf6fb('0x20')](_0x18ccd5);}return _0x10e883[_0xf6fb('0x21')](_0x18ccd5)['end']();};}function respondWithResult(_0x3cf911,_0x179b55){_0x179b55=_0x179b55||0xc8;return function(_0x51f586){if(_0x51f586){return _0x3cf911[_0xf6fb('0x21')](_0x179b55)[_0xf6fb('0x22')](_0x51f586);}};}function respondWithFilteredResult(_0x51549c,_0x3d5a35){return function(_0x3f6a1f){if(_0x3f6a1f){var _0x5e4eb5=typeof _0x3d5a35[_0xf6fb('0x23')]===_0xf6fb('0x24')&&typeof _0x3d5a35['limit']===_0xf6fb('0x24');var _0x4f30b6=_0x3f6a1f[_0xf6fb('0x25')];var _0x313919=_0x5e4eb5?0x0:_0x3d5a35['offset'];var _0x4a00bf=_0x5e4eb5?_0x3f6a1f[_0xf6fb('0x25')]:_0x3d5a35[_0xf6fb('0x23')]+_0x3d5a35['limit'];var _0x192fb8;if(_0x4a00bf>=_0x4f30b6){_0x4a00bf=_0x4f30b6;_0x192fb8=0xc8;}else{_0x192fb8=0xce;}_0x51549c[_0xf6fb('0x21')](_0x192fb8);return _0x51549c[_0xf6fb('0x26')](_0xf6fb('0x27'),_0x313919+'-'+_0x4a00bf+'/'+_0x4f30b6)[_0xf6fb('0x22')](_0x3f6a1f);}return null;};}function patchUpdates(_0x46132d){return function(_0x5294a6){try{jsonpatch[_0xf6fb('0x28')](_0x5294a6,_0x46132d,!![]);}catch(_0x3462b9){return BPromise[_0xf6fb('0x29')](_0x3462b9);}return _0x5294a6[_0xf6fb('0x2a')]();};}function saveUpdates(_0x945a23,_0xcf6d49){return function(_0x34c5b5){if(_0x34c5b5){return _0x34c5b5[_0xf6fb('0x2b')](_0x945a23)[_0xf6fb('0x2c')](function(_0x1bb41e){return _0x1bb41e;});}return null;};}function removeEntity(_0x21cb5b,_0x1d1f39){return function(_0x40d98e){if(_0x40d98e){return _0x40d98e[_0xf6fb('0x2d')]()[_0xf6fb('0x2c')](function(){_0x21cb5b[_0xf6fb('0x21')](0xcc)[_0xf6fb('0x2e')]();});}};}function handleEntityNotFound(_0x4c6a34,_0x51a9a7){return function(_0x5c478b){if(!_0x5c478b){_0x4c6a34['sendStatus'](0x194);}return _0x5c478b;};}function handleError(_0x353371,_0x2d8eb2){_0x2d8eb2=_0x2d8eb2||0x1f4;return function(_0x3854c9){logger[_0xf6fb('0x2f')](_0x3854c9['stack']);if(_0x3854c9[_0xf6fb('0x30')]){delete _0x3854c9[_0xf6fb('0x30')];}_0x353371[_0xf6fb('0x21')](_0x2d8eb2)[_0xf6fb('0x31')](_0x3854c9);};}exports['index']=function(_0x2f3321,_0x36e848){var _0x4b54e0={},_0x12d944={},_0x470793={'count':0x0,'rows':[]};var _0x5e48ed=_[_0xf6fb('0x32')](db[_0xf6fb('0x33')][_0xf6fb('0x34')],function(_0x4a613d){return{'name':_0x4a613d[_0xf6fb('0x35')],'type':_0x4a613d['type'][_0xf6fb('0x36')]};});_0x12d944[_0xf6fb('0x37')]=_[_0xf6fb('0x32')](_0x5e48ed,_0xf6fb('0x30'));_0x12d944[_0xf6fb('0x38')]=_['keys'](_0x2f3321[_0xf6fb('0x38')]);_0x12d944[_0xf6fb('0x39')]=_['intersection'](_0x12d944[_0xf6fb('0x37')],_0x12d944['query']);_0x4b54e0[_0xf6fb('0x3a')]=_['intersection'](_0x12d944[_0xf6fb('0x37')],qs[_0xf6fb('0x3b')](_0x2f3321[_0xf6fb('0x38')][_0xf6fb('0x3b')]));_0x4b54e0[_0xf6fb('0x3a')]=_0x4b54e0[_0xf6fb('0x3a')][_0xf6fb('0x3c')]?_0x4b54e0[_0xf6fb('0x3a')]:_0x12d944[_0xf6fb('0x37')];if(!_0x2f3321[_0xf6fb('0x38')]['hasOwnProperty']('nolimit')){_0x4b54e0[_0xf6fb('0x3d')]=qs[_0xf6fb('0x3d')](_0x2f3321[_0xf6fb('0x38')][_0xf6fb('0x3d')]);_0x4b54e0[_0xf6fb('0x23')]=qs['offset'](_0x2f3321['query'][_0xf6fb('0x23')]);}_0x4b54e0[_0xf6fb('0x3e')]=qs[_0xf6fb('0x3f')](_0x2f3321[_0xf6fb('0x38')][_0xf6fb('0x3f')]);_0x4b54e0[_0xf6fb('0x40')]=qs[_0xf6fb('0x39')](_['pick'](_0x2f3321[_0xf6fb('0x38')],_0x12d944[_0xf6fb('0x39')]),_0x5e48ed);if(_0x2f3321['query'][_0xf6fb('0x41')]){_0x4b54e0[_0xf6fb('0x40')]=_[_0xf6fb('0x42')](_0x4b54e0[_0xf6fb('0x40')],{'$or':_[_0xf6fb('0x32')](_0x5e48ed,function(_0x1cad53){if(_0x1cad53[_0xf6fb('0x43')]!==_0xf6fb('0x44')){var _0x170002={};_0x170002[_0x1cad53[_0xf6fb('0x30')]]={'$like':'%'+_0x2f3321[_0xf6fb('0x38')][_0xf6fb('0x41')]+'%'};return _0x170002;}})});}_0x4b54e0=_[_0xf6fb('0x42')]({},_0x4b54e0,_0x2f3321[_0xf6fb('0x45')]);var _0x238495={'where':_0x4b54e0[_0xf6fb('0x40')]};return db[_0xf6fb('0x33')][_0xf6fb('0x25')](_0x238495)[_0xf6fb('0x2c')](function(_0x17ab5b){_0x470793['count']=_0x17ab5b;if(_0x2f3321['query']['includeAll']){_0x4b54e0[_0xf6fb('0x46')]=[{'all':!![]}];}return db[_0xf6fb('0x33')][_0xf6fb('0x47')](_0x4b54e0);})[_0xf6fb('0x2c')](function(_0x436899){_0x470793[_0xf6fb('0x48')]=_0x436899;return _0x470793;})[_0xf6fb('0x2c')](respondWithFilteredResult(_0x36e848,_0x4b54e0))[_0xf6fb('0x49')](handleError(_0x36e848,null));};exports['show']=function(_0x511127,_0x4e39fd){var _0x25f910={'raw':!![],'where':{'id':_0x511127[_0xf6fb('0x4a')]['id']}},_0x384ba9={};_0x384ba9[_0xf6fb('0x37')]=_[_0xf6fb('0x4b')](db['ChatInternalMessage'][_0xf6fb('0x34')]);_0x384ba9[_0xf6fb('0x38')]=_[_0xf6fb('0x4b')](_0x511127[_0xf6fb('0x38')]);_0x384ba9[_0xf6fb('0x39')]=_[_0xf6fb('0x4c')](_0x384ba9['model'],_0x384ba9[_0xf6fb('0x38')]);_0x25f910[_0xf6fb('0x3a')]=_[_0xf6fb('0x4c')](_0x384ba9['model'],qs[_0xf6fb('0x3b')](_0x511127[_0xf6fb('0x38')][_0xf6fb('0x3b')]));_0x25f910[_0xf6fb('0x3a')]=_0x25f910[_0xf6fb('0x3a')][_0xf6fb('0x3c')]?_0x25f910[_0xf6fb('0x3a')]:_0x384ba9[_0xf6fb('0x37')];if(_0x511127[_0xf6fb('0x38')][_0xf6fb('0x4d')]){_0x25f910[_0xf6fb('0x46')]=[{'all':!![]}];}_0x25f910=_[_0xf6fb('0x42')]({},_0x25f910,_0x511127['options']);return db['ChatInternalMessage'][_0xf6fb('0x4e')](_0x25f910)[_0xf6fb('0x2c')](handleEntityNotFound(_0x4e39fd,null))[_0xf6fb('0x2c')](respondWithResult(_0x4e39fd,null))[_0xf6fb('0x49')](handleError(_0x4e39fd,null));};exports[_0xf6fb('0x4f')]=function(_0x33ea97,_0x8e3fd4){return db[_0xf6fb('0x33')][_0xf6fb('0x4f')](_0x33ea97[_0xf6fb('0x50')],{})[_0xf6fb('0x2c')](respondWithResult(_0x8e3fd4,0xc9))[_0xf6fb('0x49')](handleError(_0x8e3fd4,null));};exports[_0xf6fb('0x2b')]=function(_0x550274,_0x3f1c8b){if(_0x550274[_0xf6fb('0x50')]['id']){delete _0x550274[_0xf6fb('0x50')]['id'];}return db[_0xf6fb('0x33')][_0xf6fb('0x4e')]({'where':{'id':_0x550274[_0xf6fb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f1c8b,null))[_0xf6fb('0x2c')](saveUpdates(_0x550274[_0xf6fb('0x50')],null))['then'](respondWithResult(_0x3f1c8b,null))[_0xf6fb('0x49')](handleError(_0x3f1c8b,null));};exports[_0xf6fb('0x2d')]=function(_0x252a6a,_0x537a62){return db['ChatInternalMessage'][_0xf6fb('0x4e')]({'where':{'id':_0x252a6a[_0xf6fb('0x4a')]['id']}})[_0xf6fb('0x2c')](handleEntityNotFound(_0x537a62,null))[_0xf6fb('0x2c')](removeEntity(_0x537a62,null))[_0xf6fb('0x49')](handleError(_0x537a62,null));};exports[_0xf6fb('0x51')]=function(_0x3be39f,_0x45f674){return db[_0xf6fb('0x33')][_0xf6fb('0x51')]()[_0xf6fb('0x2c')](respondWithResult(_0x45f674,null))['catch'](handleError(_0x45f674,null));};function wrapUser(_0x53b0a8){return function(_0x34c953){var _0x488e61=_0x53b0a8[_0xf6fb('0x52')]({'plain':!![]});_0x488e61['messages']=[];if(_0x34c953){_0x488e61[_0xf6fb('0x53')]=_0x34c953[_0xf6fb('0x54')];_0x488e61[_0xf6fb('0x55')]=_0x34c953;}else{_0x488e61['lastMessageAt']=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x488e61[_0xf6fb('0x55')]={};}return _0x488e61;};}exports[_0xf6fb('0x56')]=function(_0x157baf,_0x5db440,_0x2bbb66){var _0x1ce3d3=[];return db['User'][_0xf6fb('0x47')]({'where':{'role':[_0xf6fb('0x57'),_0xf6fb('0x58'),_0xf6fb('0x59')]},'attributes':['id',_0xf6fb('0x5a'),_0xf6fb('0x30'),'role',_0xf6fb('0x5b'),_0xf6fb('0x5c'),'online',_0xf6fb('0x5d'),'allowmessenger',_0xf6fb('0x5e')],'order':qs[_0xf6fb('0x3f')](_0xf6fb('0x5f')),'include':[{'model':db['VoiceQueue'],'as':_0xf6fb('0x60'),'attributes':['id',_0xf6fb('0x30'),_0xf6fb('0x43')],'through':{'attributes':[]}}]})[_0xf6fb('0x2c')](function(_0x1be8fb){if(_0x1be8fb){var _0x5ccc5e=_0x157baf[_0xf6fb('0x59')][_0xf6fb('0x52')]({'plain':!![]});if(!_0x5ccc5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ccc5e[_0xf6fb('0x61')]===_0xf6fb('0x59')){return db[_0xf6fb('0x62')][_0xf6fb('0x4e')]({'where':{'name':_0xf6fb('0x63'),'userProfileId':_0x5ccc5e['userProfileId']},'raw':!![]})[_0xf6fb('0x2c')](function(_0x1dd05a){if(_0x1dd05a){if(_0x1dd05a[_0xf6fb('0x64')]===0x0){return db[_0xf6fb('0x65')][_0xf6fb('0x47')]({'where':{'sectionId':_0x1dd05a['id']},'raw':!![]})['then'](function(_0x2afe00){var _0x13b231=[];if(_[_0xf6fb('0x66')](_0x2afe00)){_0x13b231=_[_0xf6fb('0x41')](_0x1be8fb,function(_0x3fc14b){if(_0x3fc14b[_0xf6fb('0x61')]!=='agent'){return _0x3fc14b;}});return _0x13b231;}else{for(var _0x58e273=0x0;_0x58e273<_0x1be8fb[_0xf6fb('0x3c')];_0x58e273++){var _0x2fa617=_0x1be8fb[_0x58e273];if(_0x2fa617[_0xf6fb('0x61')]===_0xf6fb('0x57')){var _0x145634=_[_0xf6fb('0x4e')](_0x2afe00,function(_0x322829){return _0x322829[_0xf6fb('0x67')]===_0x2fa617['id'];});if(_0x145634)_0x13b231[_0xf6fb('0x68')](_0x2fa617);}else{_0x13b231[_0xf6fb('0x68')](_0x2fa617);}}return _0x13b231;}});}else{return _0x1be8fb;}}else{var _0x1dc214=_['filter'](_0x1be8fb,function(_0x4aa93c){if(_0x4aa93c[_0xf6fb('0x61')]!==_0xf6fb('0x57')){return _0x4aa93c;}});return _0x1dc214;}});}else{return _0x1be8fb;}}})[_0xf6fb('0x2c')](function(_0x576b86){var _0x46dbe6=[];if(_0x576b86){_0x1ce3d3=_0x576b86;for(var _0x1ccce1=0x0;_0x1ccce1<_0x576b86[_0xf6fb('0x3c')];_0x1ccce1+=0x1){_0x1ce3d3[_0x1ccce1][_0xf6fb('0x69')]=[];_0x46dbe6['push'](db[_0xf6fb('0x33')]['find']({'where':{'FromId':[_0x157baf[_0xf6fb('0x59')]['id'],_0x576b86[_0x1ccce1]['id']],'ToId':[_0x157baf[_0xf6fb('0x59')]['id'],_0x576b86[_0x1ccce1]['id']],'ChatGroupId':null},'attributes':['id',_0xf6fb('0x54'),'FromId',_0xf6fb('0x6a'),'read',_0xf6fb('0x50')],'order':qs[_0xf6fb('0x3f')](_0xf6fb('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x576b86[_0x1ccce1])));}return BPromise[_0xf6fb('0x6c')](_0x46dbe6);}return[];})[_0xf6fb('0x2c')](function(_0x38e996){return{'rows':_0x38e996,'count':_0x38e996['length']};})[_0xf6fb('0x2c')](respondWithResult(_0x5db440,null))[_0xf6fb('0x49')](handleError(_0x5db440,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 41ffb50..041bdbf 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 _0xe978=['exports','events','../../mysqldb','ChatInternalMessage','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe978,0x191));var _0x8e97=function(_0x60255,_0x2cc8ad){_0x60255=_0x60255-0x0;var _0x4a31da=_0xe978[_0x60255];return _0x4a31da;};'use strict';var EventEmitter=require(_0x8e97('0x0'));var ChatInternalMessage=require(_0x8e97('0x1'))['db'][_0x8e97('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e97('0x3'),'afterUpdate':_0x8e97('0x4'),'afterDestroy':_0x8e97('0x5')};function emitEvent(_0x2ff2ff){return function(_0x130627,_0x49efb3,_0x530533){ChatInternalMessageEvents[_0x8e97('0x6')](_0x2ff2ff+':'+_0x130627['id'],_0x130627);ChatInternalMessageEvents[_0x8e97('0x6')](_0x2ff2ff,_0x130627);_0x530533(null);};}for(var e in events){if(events[_0x8e97('0x7')](e)){var event=events[e];ChatInternalMessage[_0x8e97('0x8')](e,emitEvent(event));}}module[_0x8e97('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x3c42=['emit','hook','ChatInternalMessage','save'];(function(_0x4ce4dc,_0x264735){var _0x1c5e8d=function(_0x21feb1){while(--_0x21feb1){_0x4ce4dc['push'](_0x4ce4dc['shift']());}};_0x1c5e8d(++_0x264735);}(_0x3c42,0x1ee));var _0x23c4=function(_0x12adf0,_0x320e4e){_0x12adf0=_0x12adf0-0x0;var _0x46a439=_0x3c42[_0x12adf0];return _0x46a439;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x23c4('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x23c4('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x320354){return function(_0x295219,_0x4bd5c8,_0x3175e3){ChatInternalMessageEvents[_0x23c4('0x2')](_0x320354+':'+_0x295219['id'],_0x295219);ChatInternalMessageEvents[_0x23c4('0x2')](_0x320354,_0x295219);_0x3175e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x23c4('0x3')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index a4c3e70..068eb0f 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 _0xc045=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x50d471,_0x2d9086){var _0x214900=function(_0x413fa1){while(--_0x413fa1){_0x50d471['push'](_0x50d471['shift']());}};_0x214900(++_0x2d9086);}(_0xc045,0x8d));var _0x5c04=function(_0x384c23,_0x30cd65){_0x384c23=_0x384c23-0x0;var _0x1fdf67=_0xc045[_0x384c23];return _0x1fdf67;};'use strict';var _=require(_0x5c04('0x0'));var util=require(_0x5c04('0x1'));var logger=require(_0x5c04('0x2'))('api');var moment=require(_0x5c04('0x3'));var BPromise=require(_0x5c04('0x4'));var rp=require(_0x5c04('0x5'));var fs=require('fs');var path=require(_0x5c04('0x6'));var rimraf=require(_0x5c04('0x7'));var config=require(_0x5c04('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0x5c04('0x9')]=function(_0xc2cd88,_0x5ccc69){return _0xc2cd88[_0x5c04('0xa')](_0x5c04('0xb'),attributes,{'tableName':_0x5c04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5c04('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0e53=['util','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','utf8mb4'];(function(_0x58b5d7,_0x79ca8a){var _0x817269=function(_0x58dd9f){while(--_0x58dd9f){_0x58b5d7['push'](_0x58b5d7['shift']());}};_0x817269(++_0x79ca8a);}(_0x0e53,0x1c0));var _0x30e5=function(_0x4ba7eb,_0x27a677){_0x4ba7eb=_0x4ba7eb-0x0;var _0x7e002b=_0x0e53[_0x4ba7eb];return _0x7e002b;};'use strict';var _=require('lodash');var util=require(_0x30e5('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x30e5('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x30e5('0x2'));var rimraf=require(_0x30e5('0x3'));var config=require(_0x30e5('0x4'));var attributes=require(_0x30e5('0x5'));module['exports']=function(_0xcd1a73,_0x277ad8){return _0xcd1a73['define'](_0x30e5('0x6'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x30e5('0x7'),'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 05d8b70..864e8a7 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 _0xd8e0=['ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd8e0,0x111));var _0x0d8e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xd8e0[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x0d8e('0x0'));var util=require(_0x0d8e('0x1'));var moment=require(_0x0d8e('0x2'));var BPromise=require(_0x0d8e('0x3'));var rs=require(_0x0d8e('0x4'));var fs=require('fs');var Redis=require(_0x0d8e('0x5'));var db=require(_0x0d8e('0x6'))['db'];var utils=require(_0x0d8e('0x7'));var logger=require(_0x0d8e('0x8'))(_0x0d8e('0x9'));var config=require(_0x0d8e('0xa'));var jayson=require(_0x0d8e('0xb'));var client=jayson[_0x0d8e('0xc')][_0x0d8e('0xd')]({'port':0x232a});config[_0x0d8e('0xe')]=_[_0x0d8e('0xf')](config[_0x0d8e('0xe')],{'host':_0x0d8e('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d8e('0xe')]));require(_0x0d8e('0x11'))[_0x0d8e('0x12')](socket);function respondWithRpcPromise(_0xfa6994,_0x5950ad,_0x1f2f5b){return new BPromise(function(_0x3a252c,_0x26e4c9){return client[_0x0d8e('0x13')](_0xfa6994,_0x1f2f5b)[_0x0d8e('0x14')](function(_0x596df4){logger[_0x0d8e('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x5950ad,_0x0d8e('0x16'));logger[_0x0d8e('0x17')](_0x0d8e('0x18'),_0x5950ad,_0x0d8e('0x16'),JSON[_0x0d8e('0x19')](_0x596df4));if(_0x596df4[_0x0d8e('0x1a')]){if(_0x596df4[_0x0d8e('0x1a')]['code']===0x1f4){logger['error'](_0x0d8e('0x1b'),_0x5950ad,_0x596df4['error'][_0x0d8e('0x1c')]);return _0x26e4c9(_0x596df4[_0x0d8e('0x1a')][_0x0d8e('0x1c')]);}logger[_0x0d8e('0x1a')](_0x0d8e('0x1b'),_0x5950ad,_0x596df4[_0x0d8e('0x1a')]['message']);return _0x3a252c(_0x596df4[_0x0d8e('0x1a')][_0x0d8e('0x1c')]);}else{logger['info'](_0x0d8e('0x1b'),_0x5950ad,'request\x20sent');_0x3a252c(_0x596df4[_0x0d8e('0x1d')][_0x0d8e('0x1c')]);}})['catch'](function(_0x4fc808){logger[_0x0d8e('0x1a')](_0x0d8e('0x1b'),_0x5950ad,_0x4fc808);_0x26e4c9(_0x4fc808);});});} \ No newline at end of file +var _0x590b=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x590b,0x1cc));var _0xb590=function(_0x54363d,_0x161cf6){_0x54363d=_0x54363d-0x0;var _0x50edf4=_0x590b[_0x54363d];return _0x50edf4;};'use strict';var _=require(_0xb590('0x0'));var util=require(_0xb590('0x1'));var moment=require(_0xb590('0x2'));var BPromise=require(_0xb590('0x3'));var rs=require(_0xb590('0x4'));var fs=require('fs');var Redis=require(_0xb590('0x5'));var db=require(_0xb590('0x6'))['db'];var utils=require(_0xb590('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xb590('0x8'));var jayson=require(_0xb590('0x9'));var client=jayson[_0xb590('0xa')][_0xb590('0xb')]({'port':0x232a});config[_0xb590('0xc')]=_[_0xb590('0xd')](config[_0xb590('0xc')],{'host':_0xb590('0xe'),'port':0x18eb});var socket=require(_0xb590('0xf'))(new Redis(config['redis']));require(_0xb590('0x10'))['register'](socket);function respondWithRpcPromise(_0x1f965a,_0x2fb4d6,_0x170cff){return new BPromise(function(_0x321b18,_0x337c99){return client['request'](_0x1f965a,_0x170cff)['then'](function(_0x469924){logger[_0xb590('0x11')](_0xb590('0x12'),_0x2fb4d6,_0xb590('0x13'));logger[_0xb590('0x14')](_0xb590('0x15'),_0x2fb4d6,'request\x20sent',JSON[_0xb590('0x16')](_0x469924));if(_0x469924[_0xb590('0x17')]){if(_0x469924['error']['code']===0x1f4){logger['error'](_0xb590('0x12'),_0x2fb4d6,_0x469924[_0xb590('0x17')][_0xb590('0x18')]);return _0x337c99(_0x469924[_0xb590('0x17')][_0xb590('0x18')]);}logger[_0xb590('0x17')](_0xb590('0x12'),_0x2fb4d6,_0x469924[_0xb590('0x17')][_0xb590('0x18')]);return _0x321b18(_0x469924['error']['message']);}else{logger[_0xb590('0x11')](_0xb590('0x12'),_0x2fb4d6,_0xb590('0x13'));_0x321b18(_0x469924[_0xb590('0x19')][_0xb590('0x18')]);}})[_0xb590('0x1a')](function(_0x1fb67b){logger['error'](_0xb590('0x12'),_0x2fb4d6,_0x1fb67b);_0x337c99(_0x1fb67b);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 3f24e84..ce8cf7a 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 _0xbd5d=['chatInternalMessage:','./chatInternalMessage.events','length'];(function(_0x22dbca,_0xbc4079){var _0x191a37=function(_0x1ac360){while(--_0x1ac360){_0x22dbca['push'](_0x22dbca['shift']());}};_0x191a37(++_0xbc4079);}(_0xbd5d,0x88));var _0xdbd5=function(_0x4a34e8,_0x37b3d1){_0x4a34e8=_0x4a34e8-0x0;var _0x13304f=_0xbd5d[_0x4a34e8];return _0x13304f;};'use strict';var ChatInternalMessageEvents=require(_0xdbd5('0x0'));var events=['save','remove','update'];function createListener(_0x411e29,_0x446604){return function(_0x1fcc42){_0x446604['emit'](_0x411e29,_0x1fcc42);};}function removeListener(_0x57e82,_0x4e7bd2){return function(){ChatInternalMessageEvents['removeListener'](_0x57e82,_0x4e7bd2);};}exports['register']=function(_0x476794){for(var _0x4eed8e=0x0,_0x1d563f=events[_0xdbd5('0x1')];_0x4eed8e<_0x1d563f;_0x4eed8e++){var _0x128f4b=events[_0x4eed8e];var _0xabbb4c=createListener(_0xdbd5('0x2')+_0x128f4b,_0x476794);ChatInternalMessageEvents['on'](_0x128f4b,_0xabbb4c);}}; \ No newline at end of file +var _0xd5cc=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x1ad258,_0x508d58){var _0x2a6b4a=function(_0x3bf0fe){while(--_0x3bf0fe){_0x1ad258['push'](_0x1ad258['shift']());}};_0x2a6b4a(++_0x508d58);}(_0xd5cc,0x17d));var _0xcd5c=function(_0x22ec55,_0x382deb){_0x22ec55=_0x22ec55-0x0;var _0x179c23=_0xd5cc[_0x22ec55];return _0x179c23;};'use strict';var ChatInternalMessageEvents=require(_0xcd5c('0x0'));var events=['save',_0xcd5c('0x1'),_0xcd5c('0x2')];function createListener(_0xc776a3,_0x1a6284){return function(_0x3bd4ba){_0x1a6284[_0xcd5c('0x3')](_0xc776a3,_0x3bd4ba);};}function removeListener(_0x3f6c84,_0x4cc893){return function(){ChatInternalMessageEvents[_0xcd5c('0x4')](_0x3f6c84,_0x4cc893);};}exports[_0xcd5c('0x5')]=function(_0x38d0e0){for(var _0x2b6a76=0x0,_0x3fd452=events[_0xcd5c('0x6')];_0x2b6a76<_0x3fd452;_0x2b6a76++){var _0x3f62e0=events[_0x2b6a76];var _0x391b23=createListener(_0xcd5c('0x7')+_0x3f62e0,_0x38d0e0);ChatInternalMessageEvents['on'](_0x3f62e0,_0x391b23);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index cc3febe..e9f1e26 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 _0x658f=['destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post','create','put','update','delete'];(function(_0x5924d7,_0x2a20a0){var _0xf025a=function(_0x225776){while(--_0x225776){_0x5924d7['push'](_0x5924d7['shift']());}};_0xf025a(++_0x2a20a0);}(_0x658f,0x94));var _0xf658=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x658f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf658('0x0'));var util=require(_0xf658('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf658('0x2'));var router=express[_0xf658('0x3')]();var fs_extra=require(_0xf658('0x4'));var auth=require(_0xf658('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf658('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xf658('0x7')]('/',auth[_0xf658('0x8')](),controller[_0xf658('0x9')]);router[_0xf658('0x7')](_0xf658('0xa'),auth[_0xf658('0x8')](),controller[_0xf658('0xb')]);router[_0xf658('0x7')]('/users',auth[_0xf658('0x8')](),controller[_0xf658('0xc')]);router['get'](_0xf658('0xd'),auth['isAuthenticated'](),controller[_0xf658('0xe')]);router[_0xf658('0xf')]('/',auth[_0xf658('0x8')](),controller[_0xf658('0x10')]);router[_0xf658('0x11')]('/:id',controller[_0xf658('0x12')]);router[_0xf658('0x13')](_0xf658('0xd'),auth[_0xf658('0x8')](),controller[_0xf658('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd451=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x42db3e,_0x4e0e33){var _0x1c86e2=function(_0xf701de){while(--_0xf701de){_0x42db3e['push'](_0x42db3e['shift']());}};_0x1c86e2(++_0x4e0e33);}(_0xd451,0x195));var _0x1d45=function(_0x1f783d,_0x33876d){_0x1f783d=_0x1f783d-0x0;var _0xbb8303=_0xd451[_0x1f783d];return _0xbb8303;};'use strict';var multer=require(_0x1d45('0x0'));var util=require(_0x1d45('0x1'));var path=require(_0x1d45('0x2'));var timeout=require(_0x1d45('0x3'));var express=require(_0x1d45('0x4'));var router=express[_0x1d45('0x5')]();var fs_extra=require(_0x1d45('0x6'));var auth=require(_0x1d45('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1d45('0x8'));var controller=require(_0x1d45('0x9'));router[_0x1d45('0xa')]('/',auth[_0x1d45('0xb')](),controller[_0x1d45('0xc')]);router[_0x1d45('0xa')](_0x1d45('0xd'),auth[_0x1d45('0xb')](),controller[_0x1d45('0xe')]);router[_0x1d45('0xa')]('/users',auth[_0x1d45('0xb')](),controller[_0x1d45('0xf')]);router[_0x1d45('0xa')](_0x1d45('0x10'),auth[_0x1d45('0xb')](),controller[_0x1d45('0x11')]);router[_0x1d45('0x12')]('/',auth[_0x1d45('0xb')](),controller[_0x1d45('0x13')]);router[_0x1d45('0x14')](_0x1d45('0x10'),controller[_0x1d45('0x15')]);router['delete'](_0x1d45('0x10'),auth[_0x1d45('0xb')](),controller[_0x1d45('0x16')]);module[_0x1d45('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index e360621..1823c5c 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 _0xfef3=['sequelize','TEXT','BOOLEAN','out','STRING'];(function(_0x2ff739,_0x1c8e0f){var _0x12dc13=function(_0x26fc97){while(--_0x26fc97){_0x2ff739['push'](_0x2ff739['shift']());}};_0x12dc13(++_0x1c8e0f);}(_0xfef3,0x118));var _0x3fef=function(_0x5ea002,_0x31ce12){_0x5ea002=_0x5ea002-0x0;var _0x31e822=_0xfef3[_0x5ea002];return _0x31e822;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'body':{'type':Sequelize[_0x3fef('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3fef('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3fef('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3fef('0x3')),'defaultValue':_0x3fef('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3fef('0x4')]},'providerResponse':{'type':Sequelize[_0x3fef('0x1')]}}; \ No newline at end of file +var _0x88c3=['DATE','STRING','sequelize','TEXT','BOOLEAN','out'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x88c3,0x1ee));var _0x388c=function(_0x35d192,_0x3556f6){_0x35d192=_0x35d192-0x0;var _0x1c0638=_0x88c3[_0x35d192];return _0x1c0638;};'use strict';var Sequelize=require(_0x388c('0x0'));module['exports']={'body':{'type':Sequelize[_0x388c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x388c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x388c('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x388c('0x4')]},'providerName':{'type':Sequelize[_0x388c('0x5')]},'providerResponse':{'type':Sequelize[_0x388c('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 1e70d7c..083244b 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','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','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x11dcd5,_0x2a2582){var _0x1a8677=function(_0x2c7d30){while(--_0x2c7d30){_0x11dcd5['push'](_0x11dcd5['shift']());}};_0x1a8677(++_0x2a2582);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file +var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','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','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x13ad07,_0x29bed6){var _0x3c0ddd=function(_0x5a5500){while(--_0x5a5500){_0x13ad07['push'](_0x13ad07['shift']());}};_0x3c0ddd(++_0x29bed6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index d3bfa4c..137472f 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 _0xbc6e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4bcc27,_0x21a49d){var _0x4ce671=function(_0x32a180){while(--_0x32a180){_0x4bcc27['push'](_0x4bcc27['shift']());}};_0x4ce671(++_0x21a49d);}(_0xbc6e,0xf2));var _0xebc6=function(_0x51177b,_0x2a085d){_0x51177b=_0x51177b-0x0;var _0x3d16ad=_0xbc6e[_0x51177b];return _0x3d16ad;};'use strict';var EventEmitter=require(_0xebc6('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xebc6('0x1')](0x0);var events={'afterCreate':_0xebc6('0x2'),'afterUpdate':_0xebc6('0x3'),'afterDestroy':_0xebc6('0x4')};function emitEvent(_0x5eafab){return function(_0x3cc9fc,_0x4d6e6c,_0x2f3706){ChatMessageEvents[_0xebc6('0x5')](_0x5eafab+':'+_0x3cc9fc['id'],_0x3cc9fc);ChatMessageEvents[_0xebc6('0x5')](_0x5eafab,_0x3cc9fc);_0x2f3706(null);};}for(var e in events){if(events[_0xebc6('0x6')](e)){var event=events[e];ChatMessage[_0xebc6('0x7')](e,emitEvent(event));}}module[_0xebc6('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xf7c2=['emit','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x3f87b3,_0x584a90){var _0x6c3822=function(_0x9b0b5c){while(--_0x9b0b5c){_0x3f87b3['push'](_0x3f87b3['shift']());}};_0x6c3822(++_0x584a90);}(_0xf7c2,0x9a));var _0x2f7c=function(_0x22ea66,_0x30123a){_0x22ea66=_0x22ea66-0x0;var _0x529757=_0xf7c2[_0x22ea66];return _0x529757;};'use strict';var EventEmitter=require(_0x2f7c('0x0'));var ChatMessage=require(_0x2f7c('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2f7c('0x2')](0x0);var events={'afterCreate':_0x2f7c('0x3'),'afterUpdate':_0x2f7c('0x4'),'afterDestroy':_0x2f7c('0x5')};function emitEvent(_0x11cddf){return function(_0x6af83c,_0x39f661,_0x48f739){ChatMessageEvents['emit'](_0x11cddf+':'+_0x6af83c['id'],_0x6af83c);ChatMessageEvents[_0x2f7c('0x6')](_0x11cddf,_0x6af83c);_0x48f739(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x2f7c('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 32b710a..1f48a07 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 _0x3c5d=['moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','out','isNil','UserId','findOne','ChatInteractionId','update','createdAt','toLowerCase','lodash','util','../../config/logger'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0x3c5d,0x7f));var _0xd3c5=function(_0x527567,_0x2ec732){_0x527567=_0x527567-0x0;var _0x14d154=_0x3c5d[_0x527567];return _0x14d154;};'use strict';var _=require(_0xd3c5('0x0'));var util=require(_0xd3c5('0x1'));var logger=require(_0xd3c5('0x2'))('api');var moment=require(_0xd3c5('0x3'));var BPromise=require(_0xd3c5('0x4'));var rp=require(_0xd3c5('0x5'));var fs=require('fs');var path=require(_0xd3c5('0x6'));var rimraf=require('rimraf');var config=require(_0xd3c5('0x7'));var attributes=require(_0xd3c5('0x8'));module[_0xd3c5('0x9')]=function(_0x1ee332,_0x1569f){return _0x1ee332[_0xd3c5('0xa')](_0xd3c5('0xb'),attributes,{'tableName':_0xd3c5('0xc'),'paranoid':![],'indexes':[{'name':_0xd3c5('0xd'),'fields':[_0xd3c5('0xe')],'type':_0xd3c5('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x25d1bf,_0xf80ea6,_0x2f968e){var _0x1e0db8=_0x1ee332['models'];var _0x414367=_0x25d1bf[_0xd3c5('0x10')]({'plain':!![]});if(_0x414367['direction']['toLowerCase']()==='in'||_0x414367[_0xd3c5('0x11')]['toLowerCase']()===_0xd3c5('0x12')&&!_0x414367['secret']&&!_[_0xd3c5('0x13')](_0x414367[_0xd3c5('0x14')])){_0x1e0db8['ChatInteraction'][_0xd3c5('0x15')]({'where':{'id':_0x414367[_0xd3c5('0x16')]}})['then'](function(_0x31a779){if(_0x31a779){_0x31a779[_0xd3c5('0x17')]({'lastMsgAt':_0x414367[_0xd3c5('0x18')],'lastMsgDirection':_0x414367[_0xd3c5('0x11')][_0xd3c5('0x19')]()});}})['catch'](function(_0x463d78){console['error'](_0x463d78);});}_0x2f968e();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xadae=['exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','../../config/environment'];(function(_0x549853,_0x5c07ec){var _0x549671=function(_0x3f1a3b){while(--_0x3f1a3b){_0x549853['push'](_0x549853['shift']());}};_0x549671(++_0x5c07ec);}(_0xadae,0x134));var _0xeada=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xadae[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xeada('0x0'));var util=require(_0xeada('0x1'));var logger=require(_0xeada('0x2'))('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(_0xeada('0x3'));var attributes=require('./chatMessage.attributes');module[_0xeada('0x4')]=function(_0x5ef766,_0x5967e6){return _0x5ef766['define'](_0xeada('0x5'),attributes,{'tableName':_0xeada('0x6'),'paranoid':![],'indexes':[{'name':_0xeada('0x7'),'fields':[_0xeada('0x8')],'type':_0xeada('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x195f55,_0x389142,_0x6674fd){var _0x137583=_0x5ef766[_0xeada('0xa')];var _0x285f12=_0x195f55[_0xeada('0xb')]({'plain':!![]});if(_0x285f12[_0xeada('0xc')]['toLowerCase']()==='in'||_0x285f12['direction'][_0xeada('0xd')]()===_0xeada('0xe')&&!_0x285f12[_0xeada('0xf')]&&!_[_0xeada('0x10')](_0x285f12[_0xeada('0x11')])){_0x137583['ChatInteraction'][_0xeada('0x12')]({'where':{'id':_0x285f12[_0xeada('0x13')]}})[_0xeada('0x14')](function(_0x476f24){if(_0x476f24){_0x476f24[_0xeada('0x15')]({'lastMsgAt':_0x285f12['createdAt'],'lastMsgDirection':_0x285f12[_0xeada('0xc')]['toLowerCase']()});}})['catch'](function(_0x51f7b6){console['error'](_0x51f7b6);});}_0x6674fd();}},'charset':_0xeada('0x16'),'collate':_0xeada('0x17')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index b401d38..f245a80 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 _0xc2a9=['catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','register','request','then','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result'];(function(_0x328d46,_0x438f65){var _0x5665e6=function(_0x1e8524){while(--_0x1e8524){_0x328d46['push'](_0x328d46['shift']());}};_0x5665e6(++_0x438f65);}(_0xc2a9,0x82));var _0x9c2a=function(_0x548624,_0x28cde1){_0x548624=_0x548624-0x0;var _0x518d2d=_0xc2a9[_0x548624];return _0x518d2d;};'use strict';var _=require(_0x9c2a('0x0'));var util=require(_0x9c2a('0x1'));var moment=require('moment');var BPromise=require(_0x9c2a('0x2'));var rs=require(_0x9c2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c2a('0x4'))['db'];var utils=require(_0x9c2a('0x5'));var logger=require(_0x9c2a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9c2a('0x7'));var client=jayson[_0x9c2a('0x8')][_0x9c2a('0x9')]({'port':0x232a});config['redis']=_[_0x9c2a('0xa')](config[_0x9c2a('0xb')],{'host':_0x9c2a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c2a('0xb')]));require('./chatMessage.socket')[_0x9c2a('0xd')](socket);function respondWithRpcPromise(_0x4b2c10,_0x5e3997,_0x2f20ba){return new BPromise(function(_0x311b23,_0x5eb9ca){return client[_0x9c2a('0xe')](_0x4b2c10,_0x2f20ba)[_0x9c2a('0xf')](function(_0xac9db2){logger['info']('ChatMessage,\x20%s,\x20%s',_0x5e3997,_0x9c2a('0x10'));logger[_0x9c2a('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5e3997,_0x9c2a('0x10'),JSON[_0x9c2a('0x12')](_0xac9db2));if(_0xac9db2[_0x9c2a('0x13')]){if(_0xac9db2['error'][_0x9c2a('0x14')]===0x1f4){logger['error'](_0x9c2a('0x15'),_0x5e3997,_0xac9db2['error']['message']);return _0x5eb9ca(_0xac9db2['error'][_0x9c2a('0x16')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x5e3997,_0xac9db2[_0x9c2a('0x13')]['message']);return _0x311b23(_0xac9db2[_0x9c2a('0x13')]['message']);}else{logger[_0x9c2a('0x17')](_0x9c2a('0x15'),_0x5e3997,_0x9c2a('0x10'));_0x311b23(_0xac9db2[_0x9c2a('0x18')]['message']);}})[_0x9c2a('0x19')](function(_0x10e202){logger[_0x9c2a('0x13')](_0x9c2a('0x15'),_0x5e3997,_0x10e202);_0x5eb9ca(_0x10e202);});});}exports[_0x9c2a('0x1a')]=function(_0x5a6a88){var _0x5a4725=this;return new Promise(function(_0xc824e4,_0x5e691f){return db[_0x9c2a('0x1b')]['create'](_0x5a6a88[_0x9c2a('0x1c')],{'raw':_0x5a6a88['options']?_0x5a6a88[_0x9c2a('0x1d')][_0x9c2a('0x1e')]===undefined?!![]:![]:!![]})[_0x9c2a('0xf')](function(_0x15ee9c){logger['info'](_0x9c2a('0x1a'),_0x5a6a88);logger[_0x9c2a('0x11')](_0x9c2a('0x1a'),_0x5a6a88,JSON[_0x9c2a('0x12')](_0x15ee9c));_0xc824e4(_0x15ee9c);})[_0x9c2a('0x19')](function(_0x403592){logger['error'](_0x9c2a('0x1a'),_0x403592[_0x9c2a('0x16')],_0x5a6a88);_0x5e691f(_0x5a4725[_0x9c2a('0x13')](0x1f4,_0x403592[_0x9c2a('0x16')]));});});}; \ No newline at end of file +var _0x936b=['lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw'];(function(_0x14a585,_0x42fc19){var _0x3b1ebe=function(_0x18f0df){while(--_0x18f0df){_0x14a585['push'](_0x14a585['shift']());}};_0x3b1ebe(++_0x42fc19);}(_0x936b,0x179));var _0xb936=function(_0x576898,_0x119dff){_0x576898=_0x576898-0x0;var _0x425d72=_0x936b[_0x576898];return _0x425d72;};'use strict';var _=require(_0xb936('0x0'));var util=require('util');var moment=require(_0xb936('0x1'));var BPromise=require(_0xb936('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb936('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb936('0x4'));var config=require(_0xb936('0x5'));var jayson=require(_0xb936('0x6'));var client=jayson[_0xb936('0x7')]['http']({'port':0x232a});config[_0xb936('0x8')]=_[_0xb936('0x9')](config[_0xb936('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb936('0xa'))(new Redis(config[_0xb936('0x8')]));require('./chatMessage.socket')[_0xb936('0xb')](socket);function respondWithRpcPromise(_0x11eb4f,_0x26d22c,_0x23bbde){return new BPromise(function(_0x559d30,_0x3cf58b){return client['request'](_0x11eb4f,_0x23bbde)[_0xb936('0xc')](function(_0x3a0da2){logger['info']('ChatMessage,\x20%s,\x20%s',_0x26d22c,_0xb936('0xd'));logger[_0xb936('0xe')](_0xb936('0xf'),_0x26d22c,_0xb936('0xd'),JSON[_0xb936('0x10')](_0x3a0da2));if(_0x3a0da2[_0xb936('0x11')]){if(_0x3a0da2[_0xb936('0x11')][_0xb936('0x12')]===0x1f4){logger[_0xb936('0x11')](_0xb936('0x13'),_0x26d22c,_0x3a0da2[_0xb936('0x11')][_0xb936('0x14')]);return _0x3cf58b(_0x3a0da2['error'][_0xb936('0x14')]);}logger[_0xb936('0x11')](_0xb936('0x13'),_0x26d22c,_0x3a0da2[_0xb936('0x11')]['message']);return _0x559d30(_0x3a0da2[_0xb936('0x11')][_0xb936('0x14')]);}else{logger[_0xb936('0x15')](_0xb936('0x13'),_0x26d22c,_0xb936('0xd'));_0x559d30(_0x3a0da2[_0xb936('0x16')][_0xb936('0x14')]);}})[_0xb936('0x17')](function(_0x29a8bb){logger[_0xb936('0x11')](_0xb936('0x13'),_0x26d22c,_0x29a8bb);_0x3cf58b(_0x29a8bb);});});}exports[_0xb936('0x18')]=function(_0x1351b3){var _0x5797f8=this;return new Promise(function(_0x16d42e,_0x1d3852){return db[_0xb936('0x19')]['create'](_0x1351b3[_0xb936('0x1a')],{'raw':_0x1351b3['options']?_0x1351b3[_0xb936('0x1b')][_0xb936('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x72ad8b){logger[_0xb936('0x15')]('CreateChatMessage',_0x1351b3);logger['debug']('CreateChatMessage',_0x1351b3,JSON['stringify'](_0x72ad8b));_0x16d42e(_0x72ad8b);})[_0xb936('0x17')](function(_0x51fce8){logger[_0xb936('0x11')](_0xb936('0x18'),_0x51fce8[_0xb936('0x14')],_0x1351b3);_0x1d3852(_0x5797f8['error'](0x1f4,_0x51fce8[_0xb936('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 57a43f1..cee3be2 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 _0x4b19=['remove','update','emit','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x48ac40,_0x1e3beb){var _0x55df02=function(_0x5e27d6){while(--_0x5e27d6){_0x48ac40['push'](_0x48ac40['shift']());}};_0x55df02(++_0x1e3beb);}(_0x4b19,0x195));var _0x94b1=function(_0x4eed12,_0x1faabc){_0x4eed12=_0x4eed12-0x0;var _0x44d939=_0x4b19[_0x4eed12];return _0x44d939;};'use strict';var ChatMessageEvents=require(_0x94b1('0x0'));var events=['save',_0x94b1('0x1'),_0x94b1('0x2')];function createListener(_0x221ab3,_0x577f52){return function(_0x1ffdb7){_0x577f52[_0x94b1('0x3')](_0x221ab3,_0x1ffdb7);};}function removeListener(_0x2240b9,_0x4f607f){return function(){ChatMessageEvents[_0x94b1('0x4')](_0x2240b9,_0x4f607f);};}exports[_0x94b1('0x5')]=function(_0x52d6c1){for(var _0x24df76=0x0,_0x110a52=events['length'];_0x24df76<_0x110a52;_0x24df76++){var _0x40c69c=events[_0x24df76];var _0x201a02=createListener(_0x94b1('0x6')+_0x40c69c,_0x52d6c1);ChatMessageEvents['on'](_0x40c69c,_0x201a02);}}; \ No newline at end of file +var _0xf725=['./chatMessage.events','save','remove','update','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf725,0x7e));var _0x5f72=function(_0x4c81e0,_0x2ae328){_0x4c81e0=_0x4c81e0-0x0;var _0x5ace0e=_0xf725[_0x4c81e0];return _0x5ace0e;};'use strict';var ChatMessageEvents=require(_0x5f72('0x0'));var events=[_0x5f72('0x1'),_0x5f72('0x2'),_0x5f72('0x3')];function createListener(_0x1ab380,_0x2fb465){return function(_0x3f7b69){_0x2fb465[_0x5f72('0x4')](_0x1ab380,_0x3f7b69);};}function removeListener(_0x4200ff,_0x17a5bc){return function(){ChatMessageEvents['removeListener'](_0x4200ff,_0x17a5bc);};}exports[_0x5f72('0x5')]=function(_0x14a92d){for(var _0x3f2ca7=0x0,_0x193393=events[_0x5f72('0x6')];_0x3f2ca7<_0x193393;_0x3f2ca7++){var _0x4961d1=events[_0x3f2ca7];var _0x158aa3=createListener('chatMessage:'+_0x4961d1,_0x14a92d);ChatMessageEvents['on'](_0x4961d1,_0x158aa3);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index b0f19c2..21f5855 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 _0x5fd4=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x52d5da,_0x9d7b25){var _0x34aa1a=function(_0x17ea7d){while(--_0x17ea7d){_0x52d5da['push'](_0x52d5da['shift']());}};_0x34aa1a(++_0x9d7b25);}(_0x5fd4,0x113));var _0x45fd=function(_0x304809,_0x18167b){_0x304809=_0x304809-0x0;var _0x3e2656=_0x5fd4[_0x304809];return _0x3e2656;};'use strict';var multer=require(_0x45fd('0x0'));var util=require('util');var path=require(_0x45fd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x45fd('0x2')]();var fs_extra=require(_0x45fd('0x3'));var auth=require(_0x45fd('0x4'));var interaction=require(_0x45fd('0x5'));var config=require(_0x45fd('0x6'));var controller=require(_0x45fd('0x7'));router[_0x45fd('0x8')]('/',auth[_0x45fd('0x9')](),controller[_0x45fd('0xa')]);router[_0x45fd('0x8')](_0x45fd('0xb'),auth[_0x45fd('0x9')](),controller[_0x45fd('0xc')]);router[_0x45fd('0x8')](_0x45fd('0xd'),auth['isAuthenticated'](),controller[_0x45fd('0xe')]);router[_0x45fd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x45fd('0x10')]('chat',_0x45fd('0x11')),controller[_0x45fd('0x12')]);router[_0x45fd('0x13')](_0x45fd('0xd'),controller[_0x45fd('0x14')]);router['put'](_0x45fd('0x15'),auth[_0x45fd('0x9')](),controller[_0x45fd('0x16')]);router[_0x45fd('0x13')](_0x45fd('0x17'),auth[_0x45fd('0x9')](),controller[_0x45fd('0x18')]);router[_0x45fd('0x19')]('/:id',auth[_0x45fd('0x9')](),controller[_0x45fd('0x1a')]);module[_0x45fd('0x1b')]=router; \ No newline at end of file +var _0x8765=['get','isAuthenticated','describe','/:id','show','post','chat','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller'];(function(_0x595604,_0x2cc998){var _0x1466f3=function(_0x4e1d9b){while(--_0x4e1d9b){_0x595604['push'](_0x595604['shift']());}};_0x1466f3(++_0x2cc998);}(_0x8765,0xc6));var _0x5876=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8765[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x5876('0x0'));var util=require(_0x5876('0x1'));var path=require(_0x5876('0x2'));var timeout=require(_0x5876('0x3'));var express=require(_0x5876('0x4'));var router=express[_0x5876('0x5')]();var fs_extra=require(_0x5876('0x6'));var auth=require(_0x5876('0x7'));var interaction=require(_0x5876('0x8'));var config=require('../../config/environment');var controller=require(_0x5876('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5876('0xa')]('/describe',auth[_0x5876('0xb')](),controller[_0x5876('0xc')]);router[_0x5876('0xa')](_0x5876('0xd'),auth[_0x5876('0xb')](),controller[_0x5876('0xe')]);router[_0x5876('0xf')]('/',auth[_0x5876('0xb')](),interaction['tracked'](_0x5876('0x10'),'chatmessage:create'),controller[_0x5876('0x11')]);router[_0x5876('0x12')](_0x5876('0xd'),controller[_0x5876('0x13')]);router['put'](_0x5876('0x14'),auth[_0x5876('0xb')](),controller['accept']);router[_0x5876('0x12')](_0x5876('0x15'),auth[_0x5876('0xb')](),controller[_0x5876('0x16')]);router[_0x5876('0x17')](_0x5876('0xd'),auth[_0x5876('0xb')](),controller[_0x5876('0x18')]);module[_0x5876('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 261f386..87a3d05 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 _0x6290=['TEXT','sequelize'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x6290,0xf9));var _0x0629=function(_0x3e90cb,_0x505903){_0x3e90cb=_0x3e90cb-0x0;var _0x2c886f=_0x6290[_0x3e90cb];return _0x2c886f;};'use strict';var Sequelize=require(_0x0629('0x0'));module['exports']={'body':{'type':Sequelize[_0x0629('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x7533=['medium','TEXT'];(function(_0x56b98e,_0x2225f0){var _0x474f84=function(_0x58f6c7){while(--_0x58f6c7){_0x56b98e['push'](_0x56b98e['shift']());}};_0x474f84(++_0x2225f0);}(_0x7533,0x1b3));var _0x3753=function(_0x1bedfd,_0x3d34c2){_0x1bedfd=_0x1bedfd-0x0;var _0x1716d2=_0x7533[_0x1bedfd];return _0x1716d2;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3753('0x0')](_0x3753('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index e924e23..bfc6642 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x579db3,_0x78f868){var _0x562ff0=function(_0x5490c0){while(--_0x5490c0){_0x579db3['push'](_0x579db3['shift']());}};_0x562ff0(++_0x78f868);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x253f38,_0x2d0a33){var _0x5cac53=function(_0x2dbde4){while(--_0x2dbde4){_0x253f38['push'](_0x253f38['shift']());}};_0x5cac53(++_0x2d0a33);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 741dde8..5074bba 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 _0xb0f1=['util','api','moment','bluebird','request-promise','path','rimraf','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x1b2489,_0x4f2740){var _0x45104c=function(_0x57e698){while(--_0x57e698){_0x1b2489['push'](_0x1b2489['shift']());}};_0x45104c(++_0x4f2740);}(_0xb0f1,0x134));var _0x1b0f=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0xb0f1[_0x35d4e9];return _0x5c2770;};'use strict';var _=require('lodash');var util=require(_0x1b0f('0x0'));var logger=require('../../config/logger')(_0x1b0f('0x1'));var moment=require(_0x1b0f('0x2'));var BPromise=require(_0x1b0f('0x3'));var rp=require(_0x1b0f('0x4'));var fs=require('fs');var path=require(_0x1b0f('0x5'));var rimraf=require(_0x1b0f('0x6'));var config=require('../../config/environment');var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x2c9a9f,_0x56c4a6){return _0x2c9a9f[_0x1b0f('0x7')](_0x1b0f('0x8'),attributes,{'tableName':_0x1b0f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1b0f('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8fff=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x16c763,_0x46a958){var _0x492039=function(_0x4539d5){while(--_0x4539d5){_0x16c763['push'](_0x16c763['shift']());}};_0x492039(++_0x46a958);}(_0x8fff,0x116));var _0xf8ff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8fff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf8ff('0x0'));var util=require(_0xf8ff('0x1'));var logger=require('../../config/logger')(_0xf8ff('0x2'));var moment=require(_0xf8ff('0x3'));var BPromise=require(_0xf8ff('0x4'));var rp=require(_0xf8ff('0x5'));var fs=require('fs');var path=require(_0xf8ff('0x6'));var rimraf=require(_0xf8ff('0x7'));var config=require(_0xf8ff('0x8'));var attributes=require(_0xf8ff('0x9'));module[_0xf8ff('0xa')]=function(_0x3496f9,_0x120b9d){return _0x3496f9['define']('ChatOfflineMessage',attributes,{'tableName':_0xf8ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf8ff('0xc'),'collate':_0xf8ff('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 33a40e5..ad83637 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 _0x1930=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x24064c,_0x423efe){var _0x2b95a0=function(_0x36817f){while(--_0x36817f){_0x24064c['push'](_0x24064c['shift']());}};_0x2b95a0(++_0x423efe);}(_0x1930,0xcc));var _0x0193=function(_0x1bf8e8,_0x3a2b43){_0x1bf8e8=_0x1bf8e8-0x0;var _0x5715c0=_0x1930[_0x1bf8e8];return _0x5715c0;};'use strict';var _=require('lodash');var util=require(_0x0193('0x0'));var moment=require(_0x0193('0x1'));var BPromise=require(_0x0193('0x2'));var rs=require(_0x0193('0x3'));var fs=require('fs');var Redis=require(_0x0193('0x4'));var db=require(_0x0193('0x5'))['db'];var utils=require(_0x0193('0x6'));var logger=require(_0x0193('0x7'))(_0x0193('0x8'));var config=require(_0x0193('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0193('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f6ea7,_0x5815ce,_0x2de696){return new BPromise(function(_0x5dcd09,_0xd57d8b){return client[_0x0193('0xb')](_0x2f6ea7,_0x2de696)[_0x0193('0xc')](function(_0x112aec){logger[_0x0193('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5815ce,'request\x20sent');logger['debug'](_0x0193('0xe'),_0x5815ce,_0x0193('0xf'),JSON[_0x0193('0x10')](_0x112aec));if(_0x112aec[_0x0193('0x11')]){if(_0x112aec['error'][_0x0193('0x12')]===0x1f4){logger[_0x0193('0x11')](_0x0193('0x13'),_0x5815ce,_0x112aec[_0x0193('0x11')][_0x0193('0x14')]);return _0xd57d8b(_0x112aec[_0x0193('0x11')][_0x0193('0x14')]);}logger[_0x0193('0x11')](_0x0193('0x13'),_0x5815ce,_0x112aec[_0x0193('0x11')][_0x0193('0x14')]);return _0x5dcd09(_0x112aec[_0x0193('0x11')][_0x0193('0x14')]);}else{logger[_0x0193('0xd')](_0x0193('0x13'),_0x5815ce,'request\x20sent');_0x5dcd09(_0x112aec[_0x0193('0x15')][_0x0193('0x14')]);}})[_0x0193('0x16')](function(_0x27be32){logger[_0x0193('0x11')](_0x0193('0x13'),_0x5815ce,_0x27be32);_0xd57d8b(_0x27be32);});});} \ No newline at end of file +var _0xc090=['info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x1b222a,_0x4643d3){var _0x11745a=function(_0x28fa4a){while(--_0x28fa4a){_0x1b222a['push'](_0x1b222a['shift']());}};_0x11745a(++_0x4643d3);}(_0xc090,0x129));var _0x0c09=function(_0xb6316b,_0x2eb4a2){_0xb6316b=_0xb6316b-0x0;var _0x16b932=_0xc090[_0xb6316b];return _0x16b932;};'use strict';var _=require('lodash');var util=require(_0x0c09('0x0'));var moment=require(_0x0c09('0x1'));var BPromise=require(_0x0c09('0x2'));var rs=require(_0x0c09('0x3'));var fs=require('fs');var Redis=require(_0x0c09('0x4'));var db=require(_0x0c09('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c09('0x6'))(_0x0c09('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c09('0x8'));var client=jayson[_0x0c09('0x9')][_0x0c09('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x168f10,_0x5e3dfb,_0x1123a3){return new BPromise(function(_0x2fa89c,_0x150d88){return client['request'](_0x168f10,_0x1123a3)['then'](function(_0x402120){logger[_0x0c09('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5e3dfb,_0x0c09('0xc'));logger[_0x0c09('0xd')](_0x0c09('0xe'),_0x5e3dfb,'request\x20sent',JSON[_0x0c09('0xf')](_0x402120));if(_0x402120['error']){if(_0x402120[_0x0c09('0x10')][_0x0c09('0x11')]===0x1f4){logger[_0x0c09('0x10')](_0x0c09('0x12'),_0x5e3dfb,_0x402120[_0x0c09('0x10')][_0x0c09('0x13')]);return _0x150d88(_0x402120[_0x0c09('0x10')][_0x0c09('0x13')]);}logger[_0x0c09('0x10')](_0x0c09('0x12'),_0x5e3dfb,_0x402120['error'][_0x0c09('0x13')]);return _0x2fa89c(_0x402120[_0x0c09('0x10')][_0x0c09('0x13')]);}else{logger[_0x0c09('0xb')](_0x0c09('0x12'),_0x5e3dfb,_0x0c09('0xc'));_0x2fa89c(_0x402120[_0x0c09('0x14')][_0x0c09('0x13')]);}})[_0x0c09('0x15')](function(_0x1f3b94){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5e3dfb,_0x1f3b94);_0x150d88(_0x1f3b94);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 0dead8e..c6867a2 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 _0xf971=['put','update','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./chatOfflineMessage.controller','/describe','describe','get','/:id','isAuthenticated','post'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf971,0x1ad));var _0x1f97=function(_0x5bd05f,_0x27641d){_0x5bd05f=_0x5bd05f-0x0;var _0x13c333=_0xf971[_0x5bd05f];return _0x13c333;};'use strict';var multer=require(_0x1f97('0x0'));var util=require(_0x1f97('0x1'));var path=require(_0x1f97('0x2'));var timeout=require(_0x1f97('0x3'));var express=require(_0x1f97('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1f97('0x5'));var controller=require(_0x1f97('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1f97('0x7'),auth['isAuthenticated'](),controller[_0x1f97('0x8')]);router[_0x1f97('0x9')](_0x1f97('0xa'),auth[_0x1f97('0xb')](),controller['show']);router[_0x1f97('0xc')]('/',auth[_0x1f97('0xb')](),controller['create']);router[_0x1f97('0xd')]('/:id',auth[_0x1f97('0xb')](),controller[_0x1f97('0xe')]);router['delete'](_0x1f97('0xa'),auth[_0x1f97('0xb')](),controller[_0x1f97('0xf')]);module[_0x1f97('0x10')]=router; \ No newline at end of file +var _0xac1c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x158c7e,_0x2da006){var _0x155379=function(_0x35af46){while(--_0x35af46){_0x158c7e['push'](_0x158c7e['shift']());}};_0x155379(++_0x2da006);}(_0xac1c,0xa0));var _0xcac1=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xac1c[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xcac1('0x0'));var util=require('util');var path=require(_0xcac1('0x1'));var timeout=require(_0xcac1('0x2'));var express=require(_0xcac1('0x3'));var router=express[_0xcac1('0x4')]();var fs_extra=require(_0xcac1('0x5'));var auth=require(_0xcac1('0x6'));var interaction=require(_0xcac1('0x7'));var config=require(_0xcac1('0x8'));var controller=require(_0xcac1('0x9'));router[_0xcac1('0xa')]('/',auth[_0xcac1('0xb')](),controller[_0xcac1('0xc')]);router[_0xcac1('0xa')](_0xcac1('0xd'),auth['isAuthenticated'](),controller[_0xcac1('0xe')]);router[_0xcac1('0xa')]('/:id',auth[_0xcac1('0xb')](),controller[_0xcac1('0xf')]);router['post']('/',auth[_0xcac1('0xb')](),controller[_0xcac1('0x10')]);router[_0xcac1('0x11')](_0xcac1('0x12'),auth[_0xcac1('0xb')](),controller[_0xcac1('0x13')]);router[_0xcac1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xcac1('0x15')]);module[_0xcac1('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 d3c66c7..305a8b3 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 _0x96e0=['INTEGER','sequelize','exports','mouseOver','timeout','STRING'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x96e0,0x145));var _0x096e=function(_0x3c4742,_0x531db9){_0x3c4742=_0x3c4742-0x0;var _0x25a043=_0x96e0[_0x3c4742];return _0x25a043;};'use strict';var Sequelize=require(_0x096e('0x0'));module[_0x096e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x096e('0x2'),_0x096e('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x096e('0x4')]},'timeout':{'type':Sequelize[_0x096e('0x5')]}}; \ No newline at end of file +var _0x8e7c=['sequelize','ENUM','mouseOver','timeout','STRING','INTEGER'];(function(_0x4fc4fb,_0x2c3677){var _0x237d21=function(_0x5c1aeb){while(--_0x5c1aeb){_0x4fc4fb['push'](_0x4fc4fb['shift']());}};_0x237d21(++_0x2c3677);}(_0x8e7c,0xa8));var _0xc8e7=function(_0x2626a3,_0x3c0a9f){_0x2626a3=_0x2626a3-0x0;var _0x1a0d17=_0x8e7c[_0x2626a3];return _0x1a0d17;};'use strict';var Sequelize=require(_0xc8e7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc8e7('0x1')](_0xc8e7('0x2'),_0xc8e7('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xc8e7('0x4')]},'timeout':{'type':Sequelize[_0xc8e7('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 04f0cb4..3b4c735 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 _0xb4c7=['jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','include','merge','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x42e781,_0xcbb802){var _0x465a2b=function(_0x3f5936){while(--_0x3f5936){_0x42e781['push'](_0x42e781['shift']());}};_0x465a2b(++_0xcbb802);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x35007a,_0x3e14e8){_0x35007a=_0x35007a-0x0;var _0x267842=_0xb4c7[_0x35007a];return _0x267842;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={'raw':!![],'where':{'id':_0x2552f9[_0x7b4c('0x30')]['id']}},_0x3585cd={};_0x3585cd[_0x7b4c('0x31')]=_[_0x7b4c('0x32')](db[_0x7b4c('0x33')][_0x7b4c('0x34')]);_0x3585cd[_0x7b4c('0x35')]=_[_0x7b4c('0x32')](_0x2552f9[_0x7b4c('0x35')]);_0x3585cd['filters']=_['intersection'](_0x3585cd['model'],_0x3585cd[_0x7b4c('0x35')]);_0x9a799b[_0x7b4c('0x36')]=_[_0x7b4c('0x37')](_0x3585cd[_0x7b4c('0x31')],qs['fields'](_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x38')]));_0x9a799b['attributes']=_0x9a799b[_0x7b4c('0x36')]['length']?_0x9a799b[_0x7b4c('0x36')]:_0x3585cd[_0x7b4c('0x31')];if(_0x2552f9[_0x7b4c('0x35')]['includeAll']){_0x9a799b[_0x7b4c('0x39')]=[{'all':!![]}];}_0x9a799b=_[_0x7b4c('0x3a')]({},_0x9a799b,_0x2552f9['options']);return db[_0x7b4c('0x33')][_0x7b4c('0x3b')](_0x9a799b)[_0x7b4c('0x29')](handleEntityNotFound(_0x3e4a46,null))[_0x7b4c('0x29')](respondWithResult(_0x3e4a46,null))['catch'](handleError(_0x3e4a46,null));};exports['create']=function(_0x1325c1,_0x460fd4){return db['ChatProactiveAction'][_0x7b4c('0x3c')](_0x1325c1['body'],{})['then'](respondWithResult(_0x460fd4,0xc9))[_0x7b4c('0x3d')](handleError(_0x460fd4,null));};exports[_0x7b4c('0x28')]=function(_0x39d69a,_0x250901){if(_0x39d69a['body']['id']){delete _0x39d69a[_0x7b4c('0x3e')]['id'];}return db[_0x7b4c('0x33')][_0x7b4c('0x3b')]({'where':{'id':_0x39d69a[_0x7b4c('0x30')]['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x250901,null))[_0x7b4c('0x29')](saveUpdates(_0x39d69a[_0x7b4c('0x3e')],null))['then'](respondWithResult(_0x250901,null))['catch'](handleError(_0x250901,null));};exports[_0x7b4c('0x2a')]=function(_0x37f136,_0x31ef1e){return db[_0x7b4c('0x33')][_0x7b4c('0x3b')]({'where':{'id':_0x37f136['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x31ef1e,null))[_0x7b4c('0x29')](removeEntity(_0x31ef1e,null))[_0x7b4c('0x3d')](handleError(_0x31ef1e,null));}; \ No newline at end of file +var _0x4ab0=['undefined','limit','count','set','Content-Range','apply','reject','destroy','then','sendStatus','error','stack','name','send','params','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','catch','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','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','status','end','offset'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x4ab0,0xd5));var _0x04ab=function(_0x17be96,_0x1aa8bf){_0x17be96=_0x17be96-0x0;var _0x17d987=_0x4ab0[_0x17be96];return _0x17d987;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04ab('0x0'));var zipdir=require(_0x04ab('0x1'));var jsonpatch=require(_0x04ab('0x2'));var rp=require(_0x04ab('0x3'));var moment=require(_0x04ab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04ab('0x5'));var path=require(_0x04ab('0x6'));var sox=require('sox');var csv=require(_0x04ab('0x7'));var ejs=require(_0x04ab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04ab('0x9'));var squel=require(_0x04ab('0xa'));var crypto=require(_0x04ab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04ab('0xc'));var toCsv=require(_0x04ab('0x7'));var querystring=require(_0x04ab('0xd'));var Papa=require(_0x04ab('0xe'));var Redis=require('ioredis');var authService=require(_0x04ab('0xf'));var qs=require(_0x04ab('0x10'));var as=require(_0x04ab('0x11'));var hardwareService=require(_0x04ab('0x12'));var logger=require('../../config/logger')(_0x04ab('0x13'));var utils=require(_0x04ab('0x14'));var config=require(_0x04ab('0x15'));var licenseUtil=require(_0x04ab('0x16'));var db=require(_0x04ab('0x17'))['db'];function respondWithStatusCode(_0x386d0a,_0x4a6b39){_0x4a6b39=_0x4a6b39||0xcc;return function(_0x710503){if(_0x710503){return _0x386d0a['sendStatus'](_0x4a6b39);}return _0x386d0a[_0x04ab('0x18')](_0x4a6b39)[_0x04ab('0x19')]();};}function respondWithResult(_0x2abdf8,_0x428798){_0x428798=_0x428798||0xc8;return function(_0x4f0da1){if(_0x4f0da1){return _0x2abdf8['status'](_0x428798)['json'](_0x4f0da1);}};}function respondWithFilteredResult(_0x103ca8,_0x3cee44){return function(_0x149fd2){if(_0x149fd2){var _0x2b10b0=typeof _0x3cee44[_0x04ab('0x1a')]===_0x04ab('0x1b')&&typeof _0x3cee44[_0x04ab('0x1c')]===_0x04ab('0x1b');var _0x1f3251=_0x149fd2[_0x04ab('0x1d')];var _0x5ce43c=_0x2b10b0?0x0:_0x3cee44[_0x04ab('0x1a')];var _0x83ab27=_0x2b10b0?_0x149fd2[_0x04ab('0x1d')]:_0x3cee44[_0x04ab('0x1a')]+_0x3cee44[_0x04ab('0x1c')];var _0x10669a;if(_0x83ab27>=_0x1f3251){_0x83ab27=_0x1f3251;_0x10669a=0xc8;}else{_0x10669a=0xce;}_0x103ca8[_0x04ab('0x18')](_0x10669a);return _0x103ca8[_0x04ab('0x1e')](_0x04ab('0x1f'),_0x5ce43c+'-'+_0x83ab27+'/'+_0x1f3251)['json'](_0x149fd2);}return null;};}function patchUpdates(_0x75a04e){return function(_0x4a6679){try{jsonpatch[_0x04ab('0x20')](_0x4a6679,_0x75a04e,!![]);}catch(_0x1d04c2){return BPromise[_0x04ab('0x21')](_0x1d04c2);}return _0x4a6679['save']();};}function saveUpdates(_0x15a36b,_0x1c08f4){return function(_0xf6275e){if(_0xf6275e){return _0xf6275e['update'](_0x15a36b)['then'](function(_0xc8358e){return _0xc8358e;});}return null;};}function removeEntity(_0x2f614a,_0x5885bd){return function(_0x551583){if(_0x551583){return _0x551583[_0x04ab('0x22')]()[_0x04ab('0x23')](function(){_0x2f614a[_0x04ab('0x18')](0xcc)[_0x04ab('0x19')]();});}};}function handleEntityNotFound(_0x26bb81,_0xa3838a){return function(_0x21d9b7){if(!_0x21d9b7){_0x26bb81[_0x04ab('0x24')](0x194);}return _0x21d9b7;};}function handleError(_0x222557,_0x5cf1e5){_0x5cf1e5=_0x5cf1e5||0x1f4;return function(_0x86bf80){logger[_0x04ab('0x25')](_0x86bf80[_0x04ab('0x26')]);if(_0x86bf80[_0x04ab('0x27')]){delete _0x86bf80['name'];}_0x222557['status'](_0x5cf1e5)[_0x04ab('0x28')](_0x86bf80);};}exports['show']=function(_0x404eae,_0x30db64){var _0x2e069d={'raw':!![],'where':{'id':_0x404eae[_0x04ab('0x29')]['id']}},_0x3c25fb={};_0x3c25fb['model']=_['keys'](db[_0x04ab('0x2a')][_0x04ab('0x2b')]);_0x3c25fb[_0x04ab('0x2c')]=_[_0x04ab('0x2d')](_0x404eae[_0x04ab('0x2c')]);_0x3c25fb[_0x04ab('0x2e')]=_[_0x04ab('0x2f')](_0x3c25fb[_0x04ab('0x30')],_0x3c25fb[_0x04ab('0x2c')]);_0x2e069d[_0x04ab('0x31')]=_[_0x04ab('0x2f')](_0x3c25fb[_0x04ab('0x30')],qs[_0x04ab('0x32')](_0x404eae['query'][_0x04ab('0x32')]));_0x2e069d[_0x04ab('0x31')]=_0x2e069d['attributes'][_0x04ab('0x33')]?_0x2e069d[_0x04ab('0x31')]:_0x3c25fb['model'];if(_0x404eae[_0x04ab('0x2c')][_0x04ab('0x34')]){_0x2e069d['include']=[{'all':!![]}];}_0x2e069d=_[_0x04ab('0x35')]({},_0x2e069d,_0x404eae[_0x04ab('0x36')]);return db[_0x04ab('0x2a')][_0x04ab('0x37')](_0x2e069d)[_0x04ab('0x23')](handleEntityNotFound(_0x30db64,null))[_0x04ab('0x23')](respondWithResult(_0x30db64,null))['catch'](handleError(_0x30db64,null));};exports[_0x04ab('0x38')]=function(_0x3f4d83,_0x2ad8ee){return db['ChatProactiveAction'][_0x04ab('0x38')](_0x3f4d83['body'],{})['then'](respondWithResult(_0x2ad8ee,0xc9))[_0x04ab('0x39')](handleError(_0x2ad8ee,null));};exports[_0x04ab('0x3a')]=function(_0x5569ba,_0x40995c){if(_0x5569ba['body']['id']){delete _0x5569ba[_0x04ab('0x3b')]['id'];}return db[_0x04ab('0x2a')][_0x04ab('0x37')]({'where':{'id':_0x5569ba[_0x04ab('0x29')]['id']}})[_0x04ab('0x23')](handleEntityNotFound(_0x40995c,null))[_0x04ab('0x23')](saveUpdates(_0x5569ba[_0x04ab('0x3b')],null))[_0x04ab('0x23')](respondWithResult(_0x40995c,null))[_0x04ab('0x39')](handleError(_0x40995c,null));};exports[_0x04ab('0x22')]=function(_0x2b79f8,_0x3f145){return db['ChatProactiveAction'][_0x04ab('0x37')]({'where':{'id':_0x2b79f8[_0x04ab('0x29')]['id']}})['then'](handleEntityNotFound(_0x3f145,null))['then'](removeEntity(_0x3f145,null))[_0x04ab('0x39')](handleError(_0x3f145,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index e6e6fbe..4c75843 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 _0xd609=['rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3f3574,_0x5dcb34){var _0x46019d=function(_0x210337){while(--_0x210337){_0x3f3574['push'](_0x3f3574['shift']());}};_0x46019d(++_0x5dcb34);}(_0xd609,0x1ef));var _0x9d60=function(_0x3a8fbd,_0x59c0d0){_0x3a8fbd=_0x3a8fbd-0x0;var _0x2b61da=_0xd609[_0x3a8fbd];return _0x2b61da;};'use strict';var _=require(_0x9d60('0x0'));var util=require(_0x9d60('0x1'));var logger=require(_0x9d60('0x2'))('api');var moment=require(_0x9d60('0x3'));var BPromise=require(_0x9d60('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9d60('0x5'));var config=require('../../config/environment');var attributes=require(_0x9d60('0x6'));module[_0x9d60('0x7')]=function(_0xdcb75f,_0x470aa8){return _0xdcb75f['define'](_0x9d60('0x8'),attributes,{'tableName':_0x9d60('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32cf=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x3072ee,_0x40b136){var _0x47041d=function(_0x47c8ee){while(--_0x47c8ee){_0x3072ee['push'](_0x3072ee['shift']());}};_0x47041d(++_0x40b136);}(_0x32cf,0x9c));var _0xf32c=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x32cf[_0x43a37c];return _0x5d1d40;};'use strict';var _=require(_0xf32c('0x0'));var util=require(_0xf32c('0x1'));var logger=require(_0xf32c('0x2'))(_0xf32c('0x3'));var moment=require(_0xf32c('0x4'));var BPromise=require(_0xf32c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf32c('0x6'));var rimraf=require(_0xf32c('0x7'));var config=require(_0xf32c('0x8'));var attributes=require(_0xf32c('0x9'));module[_0xf32c('0xa')]=function(_0x46b9eb,_0x42fa78){return _0x46b9eb[_0xf32c('0xb')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','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 4e85e52..497c3d3 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 _0x4790=['code','error','ChatProactiveAction,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','debug'];(function(_0x12f79e,_0x192a7d){var _0x12f25f=function(_0x8f89eb){while(--_0x8f89eb){_0x12f79e['push'](_0x12f79e['shift']());}};_0x12f25f(++_0x192a7d);}(_0x4790,0x1ab));var _0x0479=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x4790[_0x4cc280];return _0x16ed24;};'use strict';var _=require(_0x0479('0x0'));var util=require(_0x0479('0x1'));var moment=require(_0x0479('0x2'));var BPromise=require('bluebird');var rs=require(_0x0479('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0479('0x4'))['db'];var utils=require(_0x0479('0x5'));var logger=require(_0x0479('0x6'))('rpc');var config=require(_0x0479('0x7'));var jayson=require(_0x0479('0x8'));var client=jayson[_0x0479('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x154ef4,_0x450cc6,_0x5eb18c){return new BPromise(function(_0x39ce51,_0x13b150){return client['request'](_0x154ef4,_0x5eb18c)[_0x0479('0xa')](function(_0x1b9516){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x450cc6,_0x0479('0xb'));logger[_0x0479('0xc')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x450cc6,_0x0479('0xb'),JSON['stringify'](_0x1b9516));if(_0x1b9516['error']){if(_0x1b9516['error'][_0x0479('0xd')]===0x1f4){logger[_0x0479('0xe')](_0x0479('0xf'),_0x450cc6,_0x1b9516[_0x0479('0xe')][_0x0479('0x10')]);return _0x13b150(_0x1b9516['error']['message']);}logger[_0x0479('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x450cc6,_0x1b9516[_0x0479('0xe')][_0x0479('0x10')]);return _0x39ce51(_0x1b9516[_0x0479('0xe')][_0x0479('0x10')]);}else{logger[_0x0479('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x450cc6,_0x0479('0xb'));_0x39ce51(_0x1b9516[_0x0479('0x12')][_0x0479('0x10')]);}})[_0x0479('0x13')](function(_0x3a2ff6){logger[_0x0479('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x450cc6,_0x3a2ff6);_0x13b150(_0x3a2ff6);});});} \ No newline at end of file +var _0xc94a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0xc94a,0x1b4));var _0xac94=function(_0x574257,_0x156faf){_0x574257=_0x574257-0x0;var _0x2de793=_0xc94a[_0x574257];return _0x2de793;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xac94('0x0'));var rs=require(_0xac94('0x1'));var fs=require('fs');var Redis=require(_0xac94('0x2'));var db=require(_0xac94('0x3'))['db'];var utils=require(_0xac94('0x4'));var logger=require(_0xac94('0x5'))(_0xac94('0x6'));var config=require(_0xac94('0x7'));var jayson=require(_0xac94('0x8'));var client=jayson['client'][_0xac94('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cbe38,_0x326044,_0x7c1c7a){return new BPromise(function(_0x2284ab,_0x2c2bef){return client[_0xac94('0xa')](_0x2cbe38,_0x7c1c7a)['then'](function(_0x41a5f4){logger[_0xac94('0xb')](_0xac94('0xc'),_0x326044,'request\x20sent');logger[_0xac94('0xd')](_0xac94('0xe'),_0x326044,_0xac94('0xf'),JSON[_0xac94('0x10')](_0x41a5f4));if(_0x41a5f4[_0xac94('0x11')]){if(_0x41a5f4['error'][_0xac94('0x12')]===0x1f4){logger['error'](_0xac94('0xc'),_0x326044,_0x41a5f4['error']['message']);return _0x2c2bef(_0x41a5f4[_0xac94('0x11')][_0xac94('0x13')]);}logger[_0xac94('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x326044,_0x41a5f4[_0xac94('0x11')][_0xac94('0x13')]);return _0x2284ab(_0x41a5f4['error'][_0xac94('0x13')]);}else{logger[_0xac94('0xb')](_0xac94('0xc'),_0x326044,_0xac94('0xf'));_0x2284ab(_0x41a5f4['result'][_0xac94('0x13')]);}})['catch'](function(_0x8b31c7){logger['error'](_0xac94('0xc'),_0x326044,_0x8b31c7);_0x2c2bef(_0x8b31c7);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index a835d1b..3f13d9e 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 _0x5fc3=['create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','show','isAuthenticated'];(function(_0x1434b7,_0x120c08){var _0x3a20a5=function(_0xd845d8){while(--_0xd845d8){_0x1434b7['push'](_0x1434b7['shift']());}};_0x3a20a5(++_0x120c08);}(_0x5fc3,0xa8));var _0x35fc=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0x5fc3[_0x35bd6c];return _0x2f421d;};'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')]('/:id',auth['isAuthenticated'](),controller[_0x35fc('0xa')]);router['post']('/',auth[_0x35fc('0xb')](),controller[_0x35fc('0xc')]);router[_0x35fc('0xd')](_0x35fc('0xe'),auth[_0x35fc('0xb')](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xb')](),controller[_0x35fc('0x11')]);module['exports']=router; \ No newline at end of file +var _0x425d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x425d,0x1e0));var _0xd425=function(_0x568669,_0x166190){_0x568669=_0x568669-0x0;var _0x45a6e7=_0x425d[_0x568669];return _0x45a6e7;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0xc')]);router[_0xd425('0xd')]('/',auth['isAuthenticated'](),controller[_0xd425('0xe')]);router[_0xd425('0xf')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x10')]);router[_0xd425('0x11')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x12')]);module[_0xd425('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 3cabcfa..bfa7431 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 _0x1df9=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x675246,_0x1d0878){var _0x59e2c7=function(_0x2d3d74){while(--_0x2d3d74){_0x675246['push'](_0x675246['shift']());}};_0x59e2c7(++_0x1d0878);}(_0x1df9,0x178));var _0x91df=function(_0x422b9e,_0x37325d){_0x422b9e=_0x422b9e-0x0;var _0x23dc6e=_0x1df9[_0x422b9e];return _0x23dc6e;};'use strict';var Sequelize=require(_0x91df('0x0'));module['exports']={'name':{'type':Sequelize[_0x91df('0x1')],'unique':_0x91df('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x91df('0x1')]},'timeout':{'type':Sequelize[_0x91df('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x91df('0x4')](_0x91df('0x5'),_0x91df('0x6'),_0x91df('0x7'))}}; \ No newline at end of file +var _0xbb21=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x289abe,_0x4c67e3){var _0x8e39d8=function(_0x2c77f4){while(--_0x2c77f4){_0x289abe['push'](_0x289abe['shift']());}};_0x8e39d8(++_0x4c67e3);}(_0xbb21,0x183));var _0x1bb2=function(_0x44cf3a,_0x204f76){_0x44cf3a=_0x44cf3a-0x0;var _0x3fabc6=_0xbb21[_0x44cf3a];return _0x3fabc6;};'use strict';var Sequelize=require('sequelize');module[_0x1bb2('0x0')]={'name':{'type':Sequelize[_0x1bb2('0x1')],'unique':_0x1bb2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1bb2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1bb2('0x4')]('rrmemory',_0x1bb2('0x5'),_0x1bb2('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 111f063..7601836 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 _0x1c55=['emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','lodash','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../mysqldb','redis','defaults','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','end','json','offset','undefined','limit','count','set','save','destroy','then','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach'];(function(_0x4a673b,_0x5c121c){var _0x1145e5=function(_0x3970ed){while(--_0x3970ed){_0x4a673b['push'](_0x4a673b['shift']());}};_0x1145e5(++_0x5c121c);}(_0x1c55,0xad));var _0x51c5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1c55[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x51c5('0x0'));var rimraf=require(_0x51c5('0x1'));var zipdir=require(_0x51c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51c5('0x3'));var moment=require(_0x51c5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x51c5('0x5'));var sox=require(_0x51c5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x51c5('0x7'));var squel=require('squel');var crypto=require(_0x51c5('0x8'));var jsforce=require(_0x51c5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x51c5('0xa'));var querystring=require(_0x51c5('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x51c5('0xc'));var qs=require(_0x51c5('0xd'));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('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x51c5('0xe'))['db'];config[_0x51c5('0xf')]=_[_0x51c5('0x10')](config[_0x51c5('0xf')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51c5('0xf')]));require('./chatQueue.socket')[_0x51c5('0x11')](socket);var jayson=require(_0x51c5('0x12'));var client=jayson[_0x51c5('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e423c,_0x5c472f,_0x5d01be,_0x536853){return new BPromise(function(_0x59160b,_0x193a93){var _0x2bda47=_0x536853||client;return _0x2bda47[_0x51c5('0x14')](_0x5e423c,_0x5d01be)['then'](function(_0x57abb4){logger[_0x51c5('0x15')](_0x51c5('0x16'),_0x5c472f,_0x51c5('0x17'));logger['debug'](_0x51c5('0x18'),_0x5c472f,'request\x20sent',JSON[_0x51c5('0x19')](_0x57abb4));if(_0x57abb4[_0x51c5('0x1a')]){if(_0x57abb4[_0x51c5('0x1a')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5c472f,_0x57abb4[_0x51c5('0x1a')]['message']);return _0x193a93(_0x57abb4['error'][_0x51c5('0x1b')]);}logger[_0x51c5('0x1a')](_0x51c5('0x16'),_0x5c472f,_0x57abb4[_0x51c5('0x1a')]['message']);return _0x59160b(_0x57abb4['error'][_0x51c5('0x1b')]);}else{logger[_0x51c5('0x15')](_0x51c5('0x16'),_0x5c472f,_0x51c5('0x17'));_0x59160b(_0x57abb4['result'][_0x51c5('0x1b')]);}})['catch'](function(_0x3f7c3c){logger['error'](_0x51c5('0x16'),_0x5c472f,_0x3f7c3c);_0x193a93(_0x3f7c3c);});});}function respondWithStatusCode(_0x717903,_0x4633d7){_0x4633d7=_0x4633d7||0xcc;return function(_0x419862){if(_0x419862){return _0x717903[_0x51c5('0x1c')](_0x4633d7);}return _0x717903[_0x51c5('0x1d')](_0x4633d7)[_0x51c5('0x1e')]();};}function respondWithResult(_0x345d17,_0x5f8465){_0x5f8465=_0x5f8465||0xc8;return function(_0x280679){if(_0x280679){return _0x345d17[_0x51c5('0x1d')](_0x5f8465)[_0x51c5('0x1f')](_0x280679);}};}function respondWithFilteredResult(_0x1b20e5,_0x547260){return function(_0x564c95){if(_0x564c95){var _0x57cf3f=typeof _0x547260[_0x51c5('0x20')]===_0x51c5('0x21')&&typeof _0x547260[_0x51c5('0x22')]==='undefined';var _0x475f45=_0x564c95[_0x51c5('0x23')];var _0x1cf5fb=_0x57cf3f?0x0:_0x547260[_0x51c5('0x20')];var _0xee54b7=_0x57cf3f?_0x564c95[_0x51c5('0x23')]:_0x547260['offset']+_0x547260[_0x51c5('0x22')];var _0x4ba832;if(_0xee54b7>=_0x475f45){_0xee54b7=_0x475f45;_0x4ba832=0xc8;}else{_0x4ba832=0xce;}_0x1b20e5[_0x51c5('0x1d')](_0x4ba832);return _0x1b20e5[_0x51c5('0x24')]('Content-Range',_0x1cf5fb+'-'+_0xee54b7+'/'+_0x475f45)[_0x51c5('0x1f')](_0x564c95);}return null;};}function patchUpdates(_0x11c52d){return function(_0x15243c){try{jsonpatch['apply'](_0x15243c,_0x11c52d,!![]);}catch(_0xe38196){return BPromise['reject'](_0xe38196);}return _0x15243c[_0x51c5('0x25')]();};}function saveUpdates(_0x199147,_0x556d47){return function(_0x1d74a9){if(_0x1d74a9){return _0x1d74a9['update'](_0x199147)['then'](function(_0x1ffaa1){return _0x1ffaa1;});}return null;};}function removeEntity(_0x4668e4,_0x32c869){return function(_0x44ac1b){if(_0x44ac1b){return _0x44ac1b[_0x51c5('0x26')]()[_0x51c5('0x27')](function(){var _0x81569c=_0x44ac1b[_0x51c5('0x28')]({'plain':!![]});var _0x5c852c=_0x51c5('0x29');return db[_0x51c5('0x2a')]['destroy']({'where':{'type':_0x5c852c,'resourceId':_0x81569c['id']}})[_0x51c5('0x27')](function(){return _0x44ac1b;});})['then'](function(){_0x4668e4[_0x51c5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ce199,_0x37525b){return function(_0x38b1a6){if(!_0x38b1a6){_0x2ce199[_0x51c5('0x1c')](0x194);}return _0x38b1a6;};}function handleError(_0x4823e7,_0x2b177b){_0x2b177b=_0x2b177b||0x1f4;return function(_0x229496){logger[_0x51c5('0x1a')](_0x229496[_0x51c5('0x2b')]);if(_0x229496[_0x51c5('0x2c')]){delete _0x229496[_0x51c5('0x2c')];}_0x4823e7['status'](_0x2b177b)[_0x51c5('0x2d')](_0x229496);};}exports[_0x51c5('0x2e')]=function(_0x347dfd,_0x13bd98){var _0x94baac={},_0xf6b277={},_0x210eac={'count':0x0,'rows':[]};var _0x26ac93=_['map'](db[_0x51c5('0x2f')][_0x51c5('0x30')],function(_0x567af6){return{'name':_0x567af6[_0x51c5('0x31')],'type':_0x567af6[_0x51c5('0x32')][_0x51c5('0x33')]};});_0xf6b277[_0x51c5('0x34')]=_['map'](_0x26ac93,'name');_0xf6b277[_0x51c5('0x35')]=_[_0x51c5('0x36')](_0x347dfd['query']);_0xf6b277['filters']=_[_0x51c5('0x37')](_0xf6b277['model'],_0xf6b277[_0x51c5('0x35')]);_0x94baac[_0x51c5('0x38')]=_[_0x51c5('0x37')](_0xf6b277[_0x51c5('0x34')],qs['fields'](_0x347dfd[_0x51c5('0x35')]['fields']));_0x94baac[_0x51c5('0x38')]=_0x94baac[_0x51c5('0x38')][_0x51c5('0x39')]?_0x94baac['attributes']:_0xf6b277[_0x51c5('0x34')];if(!_0x347dfd[_0x51c5('0x35')]['hasOwnProperty'](_0x51c5('0x3a'))){_0x94baac[_0x51c5('0x22')]=qs['limit'](_0x347dfd[_0x51c5('0x35')][_0x51c5('0x22')]);_0x94baac[_0x51c5('0x20')]=qs[_0x51c5('0x20')](_0x347dfd[_0x51c5('0x35')][_0x51c5('0x20')]);}_0x94baac[_0x51c5('0x3b')]=qs[_0x51c5('0x3c')](_0x347dfd['query'][_0x51c5('0x3c')]);_0x94baac[_0x51c5('0x3d')]=qs[_0x51c5('0x3e')](_[_0x51c5('0x3f')](_0x347dfd[_0x51c5('0x35')],_0xf6b277['filters']),_0x26ac93);if(_0x347dfd['query'][_0x51c5('0x40')]){_0x94baac[_0x51c5('0x3d')]=_[_0x51c5('0x41')](_0x94baac[_0x51c5('0x3d')],{'$or':_[_0x51c5('0x42')](_0x26ac93,function(_0x4cd2a4){if(_0x4cd2a4[_0x51c5('0x32')]!==_0x51c5('0x43')){var _0x5af58e={};_0x5af58e[_0x4cd2a4[_0x51c5('0x2c')]]={'$like':'%'+_0x347dfd['query'][_0x51c5('0x40')]+'%'};return _0x5af58e;}})});}_0x94baac=_[_0x51c5('0x41')]({},_0x94baac,_0x347dfd[_0x51c5('0x44')]);var _0x2f10b1={'where':_0x94baac[_0x51c5('0x3d')]};return db[_0x51c5('0x2f')][_0x51c5('0x23')](_0x2f10b1)[_0x51c5('0x27')](function(_0x5ab274){_0x210eac[_0x51c5('0x23')]=_0x5ab274;if(_0x347dfd['query'][_0x51c5('0x45')]){_0x94baac[_0x51c5('0x46')]=[{'all':!![]}];}return db['ChatQueue'][_0x51c5('0x47')](_0x94baac);})[_0x51c5('0x27')](function(_0x1cca77){_0x210eac[_0x51c5('0x48')]=_0x1cca77;return _0x210eac;})[_0x51c5('0x27')](respondWithFilteredResult(_0x13bd98,_0x94baac))[_0x51c5('0x49')](handleError(_0x13bd98,null));};exports[_0x51c5('0x4a')]=function(_0x3f4667,_0x19b2af){var _0x1ce0ea={'raw':!![],'where':{'id':_0x3f4667[_0x51c5('0x4b')]['id']}},_0x5247e5={};_0x5247e5[_0x51c5('0x34')]=_[_0x51c5('0x36')](db[_0x51c5('0x2f')][_0x51c5('0x30')]);_0x5247e5[_0x51c5('0x35')]=_[_0x51c5('0x36')](_0x3f4667['query']);_0x5247e5[_0x51c5('0x3e')]=_[_0x51c5('0x37')](_0x5247e5[_0x51c5('0x34')],_0x5247e5[_0x51c5('0x35')]);_0x1ce0ea[_0x51c5('0x38')]=_['intersection'](_0x5247e5[_0x51c5('0x34')],qs[_0x51c5('0x4c')](_0x3f4667['query'][_0x51c5('0x4c')]));_0x1ce0ea[_0x51c5('0x38')]=_0x1ce0ea[_0x51c5('0x38')][_0x51c5('0x39')]?_0x1ce0ea[_0x51c5('0x38')]:_0x5247e5[_0x51c5('0x34')];if(_0x3f4667[_0x51c5('0x35')]['includeAll']){_0x1ce0ea[_0x51c5('0x46')]=[{'all':!![]}];}_0x1ce0ea=_[_0x51c5('0x41')]({},_0x1ce0ea,_0x3f4667[_0x51c5('0x44')]);return db[_0x51c5('0x2f')][_0x51c5('0x4d')](_0x1ce0ea)[_0x51c5('0x27')](handleEntityNotFound(_0x19b2af,null))[_0x51c5('0x27')](respondWithResult(_0x19b2af,null))[_0x51c5('0x49')](handleError(_0x19b2af,null));};exports[_0x51c5('0x4e')]=function(_0x7eecb9,_0x52ec96){return db['ChatQueue'][_0x51c5('0x4e')](_0x7eecb9[_0x51c5('0x4f')],{})[_0x51c5('0x27')](function(_0x2430ea){var _0x2f25be=_0x7eecb9[_0x51c5('0x50')]['get']({'plain':!![]});if(!_0x2f25be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f25be[_0x51c5('0x51')]===_0x51c5('0x50')){var _0xd766a3=_0x2430ea[_0x51c5('0x28')]({'plain':!![]});var _0x396235=_0x51c5('0x29');return db[_0x51c5('0x52')]['find']({'where':{'name':_0x396235,'userProfileId':_0x2f25be[_0x51c5('0x53')]},'raw':!![]})[_0x51c5('0x27')](function(_0x299df6){if(_0x299df6&&_0x299df6[_0x51c5('0x54')]===0x0){return db[_0x51c5('0x2a')]['create']({'name':_0xd766a3[_0x51c5('0x2c')],'resourceId':_0xd766a3['id'],'type':_0x299df6[_0x51c5('0x2c')],'sectionId':_0x299df6['id']},{})[_0x51c5('0x27')](function(){return _0x2430ea;});}else{return _0x2430ea;}})[_0x51c5('0x49')](function(_0x174025){logger[_0x51c5('0x1a')](_0x51c5('0x55'),_0x174025);throw _0x174025;});}return _0x2430ea;})['then'](respondWithResult(_0x52ec96,0xc9))['catch'](handleError(_0x52ec96,null));};exports[_0x51c5('0x56')]=function(_0x143257,_0x318aeb){if(_0x143257[_0x51c5('0x4f')]['id']){delete _0x143257['body']['id'];}return db[_0x51c5('0x2f')][_0x51c5('0x4d')]({'where':{'id':_0x143257['params']['id']}})['then'](handleEntityNotFound(_0x318aeb,null))[_0x51c5('0x27')](saveUpdates(_0x143257[_0x51c5('0x4f')],null))[_0x51c5('0x27')](respondWithResult(_0x318aeb,null))[_0x51c5('0x49')](handleError(_0x318aeb,null));};exports['destroy']=function(_0x20efdd,_0x8db438){return db[_0x51c5('0x2f')][_0x51c5('0x4d')]({'where':{'id':_0x20efdd[_0x51c5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8db438,null))['then'](removeEntity(_0x8db438,null))[_0x51c5('0x49')](handleError(_0x8db438,null));};exports[_0x51c5('0x57')]=function(_0x3cf994,_0x44cca2){return db[_0x51c5('0x2f')][_0x51c5('0x57')]()['then'](respondWithResult(_0x44cca2,null))[_0x51c5('0x49')](handleError(_0x44cca2,null));};exports['getMembers']=function(_0x4c04cd,_0x47b8ff,_0x426d79){var _0x46ad8f={'raw':!![],'where':{}},_0x4ebe2e={},_0x5da3fb;return db['ChatQueue'][_0x51c5('0x58')]({'where':{'id':_0x4c04cd[_0x51c5('0x4b')]['id']}})[_0x51c5('0x27')](handleEntityNotFound(_0x47b8ff,null))[_0x51c5('0x27')](function(_0x5b37ce){if(_0x5b37ce){_0x5da3fb=_0x5b37ce['get']({'plain':!![]});_0x4ebe2e[_0x51c5('0x34')]=_['keys'](db[_0x51c5('0x59')][_0x51c5('0x30')]);_0x4ebe2e[_0x51c5('0x35')]=_[_0x51c5('0x36')](_0x4c04cd[_0x51c5('0x35')]);_0x4ebe2e[_0x51c5('0x3e')]=_['intersection'](_0x4ebe2e[_0x51c5('0x34')],_0x4ebe2e['query']);_0x46ad8f[_0x51c5('0x38')]=_[_0x51c5('0x37')](_0x4ebe2e[_0x51c5('0x34')],qs[_0x51c5('0x4c')](_0x4c04cd[_0x51c5('0x35')][_0x51c5('0x4c')]));_0x46ad8f[_0x51c5('0x38')]=_0x46ad8f[_0x51c5('0x38')][_0x51c5('0x39')]?_0x46ad8f[_0x51c5('0x38')]:_0x4ebe2e['model'];if(!_0x4c04cd['query'][_0x51c5('0x5a')](_0x51c5('0x3a'))){_0x46ad8f[_0x51c5('0x22')]=qs[_0x51c5('0x22')](_0x4c04cd[_0x51c5('0x35')]['limit']);_0x46ad8f[_0x51c5('0x20')]=qs[_0x51c5('0x20')](_0x4c04cd['query'][_0x51c5('0x20')]);}_0x46ad8f[_0x51c5('0x3b')]=qs[_0x51c5('0x3c')](_0x4c04cd[_0x51c5('0x35')][_0x51c5('0x3c')]);_0x46ad8f[_0x51c5('0x3d')]=qs[_0x51c5('0x3e')](_['pick'](_0x4c04cd[_0x51c5('0x35')],_0x4ebe2e[_0x51c5('0x3e')]));_0x46ad8f['where'][_0x51c5('0x5b')]=_0x5b37ce['id'];if(_0x4c04cd[_0x51c5('0x35')][_0x51c5('0x40')]){_0x46ad8f[_0x51c5('0x3d')]=_[_0x51c5('0x41')](_0x46ad8f['where'],{'$or':_[_0x51c5('0x42')](_0x46ad8f[_0x51c5('0x38')],function(_0x23f0a7){var _0x717675={};_0x717675[_0x23f0a7]={'$like':'%'+_0x4c04cd[_0x51c5('0x35')][_0x51c5('0x40')]+'%'};return _0x717675;})});}_0x46ad8f=_[_0x51c5('0x41')]({},_0x46ad8f,_0x4c04cd[_0x51c5('0x44')]);return db['UserChatQueue'][_0x51c5('0x47')](_0x46ad8f);}})[_0x51c5('0x27')](function(_0x1e8d18){if(_0x1e8d18){return db[_0x51c5('0x5c')]['findAndCountAll']({'where':{'id':_['map'](_0x1e8d18,_0x51c5('0x5d')),'role':_0x51c5('0x5e')},'attributes':['id',_0x51c5('0x2c'),_0x51c5('0x5f'),_0x51c5('0x60'),_0x51c5('0x61')]});}})['then'](function(_0x5d4573){if(_0x5d4573){return{'count':_0x5d4573[_0x51c5('0x23')],'rows':_[_0x51c5('0x42')](_0x5d4573[_0x51c5('0x48')],function(_0x5b64de){return{'membername':_0x5b64de['name'],'UserId':_0x5b64de['id'],'queue_name':_0x5da3fb['name'],'ChatQueueId':_0x5da3fb['id'],'interface':util[_0x51c5('0x62')]('%s/%s',_0x51c5('0x63'),_0x5b64de[_0x51c5('0x2c')]),'penalty':0x0,'paused':_0x5b64de[_0x51c5('0x5f')],'createdAt':_0x5b64de[_0x51c5('0x61')],'updatedAt':_0x5b64de[_0x51c5('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x47b8ff,_0x46ad8f))[_0x51c5('0x49')](handleError(_0x47b8ff,null));};exports[_0x51c5('0x64')]=function(_0x2807f4,_0x47c372,_0x1e8148){var _0x1bea6a={};var _0x347f8e={};var _0x5396c2;var _0x5e560f;return db[_0x51c5('0x2f')][_0x51c5('0x58')]({'where':{'id':_0x2807f4['params']['id']}})[_0x51c5('0x27')](handleEntityNotFound(_0x47c372,null))['then'](function(_0xde8ca4){if(_0xde8ca4){_0x5396c2=_0xde8ca4;_0x347f8e[_0x51c5('0x34')]=_[_0x51c5('0x36')](db['Team'][_0x51c5('0x30')]);_0x347f8e[_0x51c5('0x35')]=_[_0x51c5('0x36')](_0x2807f4['query']);_0x347f8e[_0x51c5('0x3e')]=_[_0x51c5('0x37')](_0x347f8e[_0x51c5('0x34')],_0x347f8e[_0x51c5('0x35')]);_0x1bea6a[_0x51c5('0x38')]=_['intersection'](_0x347f8e[_0x51c5('0x34')],qs[_0x51c5('0x4c')](_0x2807f4[_0x51c5('0x35')][_0x51c5('0x4c')]));_0x1bea6a[_0x51c5('0x38')]=_0x1bea6a['attributes'][_0x51c5('0x39')]?_0x1bea6a[_0x51c5('0x38')]:_0x347f8e[_0x51c5('0x34')];_0x1bea6a[_0x51c5('0x3b')]=qs[_0x51c5('0x3c')](_0x2807f4[_0x51c5('0x35')][_0x51c5('0x3c')]);_0x1bea6a[_0x51c5('0x3d')]=qs['filters'](_[_0x51c5('0x3f')](_0x2807f4[_0x51c5('0x35')],_0x347f8e[_0x51c5('0x3e')]));if(_0x2807f4[_0x51c5('0x35')][_0x51c5('0x40')]){_0x1bea6a[_0x51c5('0x3d')]=_[_0x51c5('0x41')](_0x1bea6a[_0x51c5('0x3d')],{'$or':_[_0x51c5('0x42')](_0x1bea6a[_0x51c5('0x38')],function(_0xdec595){var _0x42a5c5={};_0x42a5c5[_0xdec595]={'$like':'%'+_0x2807f4[_0x51c5('0x35')][_0x51c5('0x40')]+'%'};return _0x42a5c5;})});}_0x1bea6a=_[_0x51c5('0x41')]({},_0x1bea6a,_0x2807f4[_0x51c5('0x44')]);return _0x5396c2['getTeams'](_0x1bea6a);}})[_0x51c5('0x27')](function(_0x1deb8e){if(_0x1deb8e){_0x5e560f=_0x1deb8e[_0x51c5('0x39')];if(!_0x2807f4[_0x51c5('0x35')][_0x51c5('0x5a')](_0x51c5('0x3a'))){_0x1bea6a['limit']=qs[_0x51c5('0x22')](_0x2807f4['query'][_0x51c5('0x22')]);_0x1bea6a['offset']=qs[_0x51c5('0x20')](_0x2807f4[_0x51c5('0x35')][_0x51c5('0x20')]);}return _0x5396c2['getTeams'](_0x1bea6a);}})[_0x51c5('0x27')](function(_0x1ada78){if(_0x1ada78){return _0x1ada78?{'count':_0x5e560f,'rows':_0x1ada78}:null;}})[_0x51c5('0x27')](respondWithResult(_0x47c372,null))['catch'](handleError(_0x47c372,null));};exports[_0x51c5('0x65')]=function(_0x25e114,_0x333ef3,_0x589ce7){var _0x18c27b=_0x25e114[_0x51c5('0x4f')][_0x51c5('0x66')];return db[_0x51c5('0x67')][_0x51c5('0x47')]({'where':{'id':_0x18c27b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x51c5('0x68'),'attributes':['id','name',_0x51c5('0x69'),_0x51c5('0x6a'),_0x51c5('0x6b')],'raw':!![]}]})['then'](function(_0x40dc3c){if(_0x40dc3c){var _0x2cd8d0=_[_0x51c5('0x6c')](_0x40dc3c,function(_0x5b610a){var _0x58626f=_0x5b610a[_0x51c5('0x28')]({'plain':!![]});return _0x58626f[_0x51c5('0x68')];});return db[_0x51c5('0x2f')][_0x51c5('0x4d')]({'where':{'id':_0x25e114[_0x51c5('0x4b')]['id']}})[_0x51c5('0x27')](function(_0x11ca66){return db[_0x51c5('0x6d')]['transaction'](function(_0x4ef956){return _0x11ca66[_0x51c5('0x65')](_0x18c27b,{'transaction':_0x4ef956})[_0x51c5('0x27')](function(){return BPromise[_0x51c5('0x6e')](_0x2cd8d0,function(_0x407f06){return db[_0x51c5('0x59')][_0x51c5('0x6f')]({'where':{'UserId':_0x407f06['id'],'ChatQueueId':_0x25e114['params']['id']},'transaction':_0x4ef956});});})['then'](function(){_0x2cd8d0[_0x51c5('0x70')](function(_0x3f07e3){socket[_0x51c5('0x71')](_0x51c5('0x72'),{'UserId':_0x3f07e3['id'],'ChatQueueId':_0x11ca66['id']});});});});});}})[_0x51c5('0x27')](respondWithStatusCode(_0x333ef3,null))['catch'](handleError(_0x333ef3,null));};exports[_0x51c5('0x73')]=function(_0x374b18,_0x3d83f6,_0x4bd698){return db[_0x51c5('0x67')][_0x51c5('0x47')]({'where':{'id':_0x374b18[_0x51c5('0x35')][_0x51c5('0x66')]},'attributes':['id'],'include':[{'model':db[_0x51c5('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x51c5('0x27')](handleEntityNotFound(_0x3d83f6,null))['then'](function(_0x56d82d){var _0x2cbb7c=_[_0x51c5('0x42')](_0x56d82d,'id');var _0x192b74=[];var _0x418a0f=[];var _0x2cb550=squel[_0x51c5('0x74')]();_0x2cb550[_0x51c5('0x75')](_0x51c5('0x76'))[_0x51c5('0x77')](_0x51c5('0x78'),'tq')[_0x51c5('0x79')](_0x51c5('0x7a'),'ut',_0x51c5('0x7b'))[_0x51c5('0x3d')](_0x51c5('0x7c'),_0x374b18[_0x51c5('0x4b')]['id']);for(var _0x5c417d=0x0;_0x5c417d<_0x56d82d['length'];_0x5c417d+=0x1){let _0x48fdc4=_0x56d82d[_0x5c417d];for(var _0x4af97c=0x0;_0x4af97c<_0x48fdc4[_0x51c5('0x68')][_0x51c5('0x39')];_0x4af97c+=0x1){let _0x2acc23=_0x48fdc4[_0x51c5('0x68')][_0x4af97c];var _0x188fa1=_0x2cb550[_0x51c5('0x7d')]();_0x188fa1[_0x51c5('0x3d')]('ut.UserId\x20=\x20?',_0x2acc23['id']);_0x418a0f['push'](db[_0x51c5('0x6d')][_0x51c5('0x35')](_0x188fa1[_0x51c5('0x7e')](),{'type':db[_0x51c5('0x6d')][_0x51c5('0x7f')][_0x51c5('0x80')]})['then'](function(_0x590828){if(_0x590828[_0x51c5('0x39')]===0x1){return _0x2acc23['id'];}else{var _0x174689=_[_0x51c5('0x81')](_[_0x51c5('0x42')](_0x590828,_0x51c5('0x82')),function(_0x56a6d2){return _[_0x51c5('0x83')](_0x2cbb7c,_0x56a6d2);});if(_0x174689){return _0x2acc23['id'];}}}));}}return BPromise[_0x51c5('0x84')](_0x418a0f)[_0x51c5('0x27')](function(_0x22eeac){_0x192b74=_(_0x192b74)[_0x51c5('0x85')](_0x22eeac)[_0x51c5('0x86')]()[_0x51c5('0x87')]();return db[_0x51c5('0x2f')]['find']({'where':{'id':_0x374b18[_0x51c5('0x4b')]['id']}})[_0x51c5('0x27')](function(_0x3615cd){return db[_0x51c5('0x6d')]['transaction'](function(_0x4e491e){return _0x3615cd['removeTeams'](_0x374b18[_0x51c5('0x35')][_0x51c5('0x66')],{'transaction':_0x4e491e})['then'](function(){if(!_[_0x51c5('0x88')](_0x192b74)){return _0x3615cd[_0x51c5('0x89')](_0x192b74,{'transaction':_0x4e491e});}})[_0x51c5('0x27')](function(){_0x192b74['forEach'](function(_0xb1e6f8){socket[_0x51c5('0x71')](_0x51c5('0x8a'),{'UserId':_0xb1e6f8,'ChatQueueId':_0x3615cd['id']});});});});});});})[_0x51c5('0x27')](respondWithStatusCode(_0x3d83f6,null))[_0x51c5('0x49')](handleError(_0x3d83f6,null));};exports[_0x51c5('0x8b')]=function(_0x30521a,_0x2d80ad,_0xa0d121){return db[_0x51c5('0x2f')][_0x51c5('0x4d')]({'where':{'id':_0x30521a[_0x51c5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2d80ad,null))[_0x51c5('0x27')](function(_0x6e7d8c){if(_0x6e7d8c){return _0x6e7d8c[_0x51c5('0x8b')](_0x30521a[_0x51c5('0x4f')][_0x51c5('0x66')],_[_0x51c5('0x8c')](_0x30521a[_0x51c5('0x4f')],[_0x51c5('0x66'),'id'])||{})[_0x51c5('0x8d')](function(_0x4a439a){for(var _0x4cc630=0x0;_0x4cc630<_0x30521a[_0x51c5('0x4f')]['ids'][_0x51c5('0x39')];_0x4cc630+=0x1){socket[_0x51c5('0x71')](_0x51c5('0x72'),{'UserId':Number(_0x30521a[_0x51c5('0x4f')]['ids'][_0x4cc630]),'ChatQueueId':Number(_0x30521a[_0x51c5('0x4b')]['id'])});}return _0x4a439a;});}})['then'](respondWithResult(_0x2d80ad,null))[_0x51c5('0x49')](handleError(_0x2d80ad,null));};exports[_0x51c5('0x89')]=function(_0x19adb0,_0x597e07,_0x4e7507){return db[_0x51c5('0x2f')][_0x51c5('0x4d')]({'where':{'id':_0x19adb0[_0x51c5('0x4b')]['id']}})[_0x51c5('0x27')](handleEntityNotFound(_0x597e07,null))['then'](function(_0x2e75e2){if(_0x2e75e2){return _0x2e75e2['removeAgents'](_0x19adb0[_0x51c5('0x35')][_0x51c5('0x66')])[_0x51c5('0x27')](function(){if(_['isArray'](_0x19adb0['query'][_0x51c5('0x66')])){for(var _0x4c5b30=0x0;_0x4c5b30<_0x19adb0['query'][_0x51c5('0x66')][_0x51c5('0x39')];_0x4c5b30+=0x1){socket['emit'](_0x51c5('0x8a'),{'UserId':Number(_0x19adb0[_0x51c5('0x35')][_0x51c5('0x66')][_0x4c5b30]),'ChatQueueId':Number(_0x19adb0[_0x51c5('0x4b')]['id'])});}}else{socket['emit'](_0x51c5('0x8a'),{'UserId':Number(_0x19adb0[_0x51c5('0x35')][_0x51c5('0x66')]),'ChatQueueId':Number(_0x19adb0[_0x51c5('0x4b')]['id'])});}});}})[_0x51c5('0x27')](respondWithStatusCode(_0x597e07,null))[_0x51c5('0x49')](handleError(_0x597e07,null));};exports[_0x51c5('0x8e')]=function(_0x203cf2,_0x51fb36,_0x17d59d){var _0x5368af={};var _0x7598ac={};var _0x2b3192;var _0x431463;return db[_0x51c5('0x2f')][_0x51c5('0x58')]({'where':{'id':_0x203cf2[_0x51c5('0x4b')]['id']}})[_0x51c5('0x27')](handleEntityNotFound(_0x51fb36,null))[_0x51c5('0x27')](function(_0x412b54){if(_0x412b54){_0x2b3192=_0x412b54;_0x7598ac[_0x51c5('0x34')]=_[_0x51c5('0x36')](db[_0x51c5('0x5c')][_0x51c5('0x30')]);_0x7598ac[_0x51c5('0x35')]=_[_0x51c5('0x36')](_0x203cf2['query']);_0x7598ac[_0x51c5('0x3e')]=_[_0x51c5('0x37')](_0x7598ac[_0x51c5('0x34')],_0x7598ac[_0x51c5('0x35')]);_0x5368af[_0x51c5('0x38')]=_['intersection'](_0x7598ac[_0x51c5('0x34')],qs['fields'](_0x203cf2[_0x51c5('0x35')][_0x51c5('0x4c')]));_0x5368af[_0x51c5('0x38')]=_0x5368af['attributes'][_0x51c5('0x39')]?_0x5368af['attributes']:_0x7598ac[_0x51c5('0x34')];_0x5368af[_0x51c5('0x3b')]=qs[_0x51c5('0x3c')](_0x203cf2['query'][_0x51c5('0x3c')]);_0x5368af[_0x51c5('0x3d')]=qs[_0x51c5('0x3e')](_[_0x51c5('0x3f')](_0x203cf2['query'],_0x7598ac[_0x51c5('0x3e')]));if(_0x203cf2[_0x51c5('0x35')][_0x51c5('0x40')]){_0x5368af[_0x51c5('0x3d')]=_['merge'](_0x5368af[_0x51c5('0x3d')],{'$or':_[_0x51c5('0x42')](_0x5368af[_0x51c5('0x38')],function(_0x13733d){var _0x32797b={};_0x32797b[_0x13733d]={'$like':'%'+_0x203cf2[_0x51c5('0x35')][_0x51c5('0x40')]+'%'};return _0x32797b;})});}_0x5368af=_[_0x51c5('0x41')]({},_0x5368af,_0x203cf2[_0x51c5('0x44')]);return _0x2b3192[_0x51c5('0x8e')](_0x5368af);}})[_0x51c5('0x27')](function(_0x42d28f){if(_0x42d28f){_0x431463=_0x42d28f[_0x51c5('0x39')];if(!_0x203cf2[_0x51c5('0x35')][_0x51c5('0x5a')](_0x51c5('0x3a'))){_0x5368af['limit']=qs[_0x51c5('0x22')](_0x203cf2[_0x51c5('0x35')][_0x51c5('0x22')]);_0x5368af[_0x51c5('0x20')]=qs['offset'](_0x203cf2[_0x51c5('0x35')][_0x51c5('0x20')]);}return _0x2b3192['getAgents'](_0x5368af);}})[_0x51c5('0x27')](function(_0x5a04a9){if(_0x5a04a9){return _0x5a04a9?{'count':_0x431463,'rows':_0x5a04a9}:null;}})['then'](respondWithResult(_0x51fb36,null))[_0x51c5('0x49')](handleError(_0x51fb36,null));}; \ No newline at end of file +var _0x1053=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','pick','ChatQueueId','User','UserId','agent','chatPause','updatedAt','format','SIP','getTeams','addTeams','ids','Team','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','includeAll','include','findAll','rows','show','keys','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x1053,0x163));var _0x3105=function(_0x51d99b,_0x40f96f){_0x51d99b=_0x51d99b-0x0;var _0x359a78=_0x1053[_0x51d99b];return _0x359a78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3105('0x0'));var zipdir=require(_0x3105('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3105('0x2'));var moment=require(_0x3105('0x3'));var BPromise=require(_0x3105('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3105('0x5'));var sox=require(_0x3105('0x6'));var csv=require(_0x3105('0x7'));var ejs=require(_0x3105('0x8'));var fs=require('fs');var fs_extra=require(_0x3105('0x9'));var _=require(_0x3105('0xa'));var squel=require(_0x3105('0xb'));var crypto=require(_0x3105('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3105('0xd'));var toCsv=require(_0x3105('0x7'));var querystring=require(_0x3105('0xe'));var Papa=require(_0x3105('0xf'));var Redis=require(_0x3105('0x10'));var authService=require(_0x3105('0x11'));var qs=require(_0x3105('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3105('0x13'));var logger=require(_0x3105('0x14'))(_0x3105('0x15'));var utils=require(_0x3105('0x16'));var config=require(_0x3105('0x17'));var licenseUtil=require(_0x3105('0x18'));var db=require(_0x3105('0x19'))['db'];config[_0x3105('0x1a')]=_['defaults'](config[_0x3105('0x1a')],{'host':_0x3105('0x1b'),'port':0x18eb});var socket=require(_0x3105('0x1c'))(new Redis(config[_0x3105('0x1a')]));require(_0x3105('0x1d'))['register'](socket);var jayson=require(_0x3105('0x1e'));var client=jayson[_0x3105('0x1f')][_0x3105('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x45fd2c,_0xf7428,_0x4cc8c5,_0x57e4bc){return new BPromise(function(_0x3ba8c1,_0x190896){var _0x5039af=_0x57e4bc||client;return _0x5039af['request'](_0x45fd2c,_0x4cc8c5)[_0x3105('0x21')](function(_0x41a4bc){logger[_0x3105('0x22')](_0x3105('0x23'),_0xf7428,'request\x20sent');logger[_0x3105('0x24')](_0x3105('0x25'),_0xf7428,_0x3105('0x26'),JSON[_0x3105('0x27')](_0x41a4bc));if(_0x41a4bc[_0x3105('0x28')]){if(_0x41a4bc[_0x3105('0x28')][_0x3105('0x29')]===0x1f4){logger[_0x3105('0x28')](_0x3105('0x23'),_0xf7428,_0x41a4bc[_0x3105('0x28')][_0x3105('0x2a')]);return _0x190896(_0x41a4bc['error']['message']);}logger[_0x3105('0x28')](_0x3105('0x23'),_0xf7428,_0x41a4bc[_0x3105('0x28')]['message']);return _0x3ba8c1(_0x41a4bc[_0x3105('0x28')][_0x3105('0x2a')]);}else{logger[_0x3105('0x22')](_0x3105('0x23'),_0xf7428,_0x3105('0x26'));_0x3ba8c1(_0x41a4bc['result'][_0x3105('0x2a')]);}})[_0x3105('0x2b')](function(_0x27462c){logger[_0x3105('0x28')](_0x3105('0x23'),_0xf7428,_0x27462c);_0x190896(_0x27462c);});});}function respondWithStatusCode(_0x5c52b4,_0x5eac47){_0x5eac47=_0x5eac47||0xcc;return function(_0x335973){if(_0x335973){return _0x5c52b4['sendStatus'](_0x5eac47);}return _0x5c52b4[_0x3105('0x2c')](_0x5eac47)[_0x3105('0x2d')]();};}function respondWithResult(_0x5e2c79,_0x1eb493){_0x1eb493=_0x1eb493||0xc8;return function(_0x55752e){if(_0x55752e){return _0x5e2c79['status'](_0x1eb493)[_0x3105('0x2e')](_0x55752e);}};}function respondWithFilteredResult(_0x24e7ab,_0xbda9f){return function(_0xb75b03){if(_0xb75b03){var _0x33625a=typeof _0xbda9f[_0x3105('0x2f')]===_0x3105('0x30')&&typeof _0xbda9f[_0x3105('0x31')]===_0x3105('0x30');var _0x156539=_0xb75b03[_0x3105('0x32')];var _0x401593=_0x33625a?0x0:_0xbda9f[_0x3105('0x2f')];var _0x19dbb4=_0x33625a?_0xb75b03[_0x3105('0x32')]:_0xbda9f[_0x3105('0x2f')]+_0xbda9f['limit'];var _0x5781bf;if(_0x19dbb4>=_0x156539){_0x19dbb4=_0x156539;_0x5781bf=0xc8;}else{_0x5781bf=0xce;}_0x24e7ab[_0x3105('0x2c')](_0x5781bf);return _0x24e7ab[_0x3105('0x33')](_0x3105('0x34'),_0x401593+'-'+_0x19dbb4+'/'+_0x156539)[_0x3105('0x2e')](_0xb75b03);}return null;};}function patchUpdates(_0x30b306){return function(_0x44ef1c){try{jsonpatch[_0x3105('0x35')](_0x44ef1c,_0x30b306,!![]);}catch(_0x8e7f31){return BPromise[_0x3105('0x36')](_0x8e7f31);}return _0x44ef1c['save']();};}function saveUpdates(_0x464bdd,_0x117bf9){return function(_0x476f19){if(_0x476f19){return _0x476f19['update'](_0x464bdd)[_0x3105('0x21')](function(_0x2b5e1d){return _0x2b5e1d;});}return null;};}function removeEntity(_0x137ab5,_0x539869){return function(_0x3f5cee){if(_0x3f5cee){return _0x3f5cee['destroy']()[_0x3105('0x21')](function(){var _0x4b7b24=_0x3f5cee[_0x3105('0x37')]({'plain':!![]});var _0x255a8e=_0x3105('0x38');return db[_0x3105('0x39')]['destroy']({'where':{'type':_0x255a8e,'resourceId':_0x4b7b24['id']}})[_0x3105('0x21')](function(){return _0x3f5cee;});})[_0x3105('0x21')](function(){_0x137ab5[_0x3105('0x2c')](0xcc)[_0x3105('0x2d')]();});}};}function handleEntityNotFound(_0x4e1b1f,_0x20ae2a){return function(_0x41e4d8){if(!_0x41e4d8){_0x4e1b1f[_0x3105('0x3a')](0x194);}return _0x41e4d8;};}function handleError(_0x1da3a8,_0x4434fc){_0x4434fc=_0x4434fc||0x1f4;return function(_0x34a05a){logger['error'](_0x34a05a[_0x3105('0x3b')]);if(_0x34a05a[_0x3105('0x3c')]){delete _0x34a05a[_0x3105('0x3c')];}_0x1da3a8['status'](_0x4434fc)[_0x3105('0x3d')](_0x34a05a);};}exports['index']=function(_0x22c95c,_0x141fd2){var _0x338376={},_0x26283c={},_0x56e965={'count':0x0,'rows':[]};var _0x1274d1=_[_0x3105('0x3e')](db[_0x3105('0x3f')][_0x3105('0x40')],function(_0x47b509){return{'name':_0x47b509[_0x3105('0x41')],'type':_0x47b509[_0x3105('0x42')][_0x3105('0x43')]};});_0x26283c[_0x3105('0x44')]=_['map'](_0x1274d1,_0x3105('0x3c'));_0x26283c['query']=_['keys'](_0x22c95c[_0x3105('0x45')]);_0x26283c[_0x3105('0x46')]=_[_0x3105('0x47')](_0x26283c[_0x3105('0x44')],_0x26283c[_0x3105('0x45')]);_0x338376[_0x3105('0x48')]=_[_0x3105('0x47')](_0x26283c['model'],qs[_0x3105('0x49')](_0x22c95c[_0x3105('0x45')]['fields']));_0x338376['attributes']=_0x338376[_0x3105('0x48')][_0x3105('0x4a')]?_0x338376[_0x3105('0x48')]:_0x26283c[_0x3105('0x44')];if(!_0x22c95c[_0x3105('0x45')]['hasOwnProperty'](_0x3105('0x4b'))){_0x338376['limit']=qs['limit'](_0x22c95c[_0x3105('0x45')][_0x3105('0x31')]);_0x338376[_0x3105('0x2f')]=qs[_0x3105('0x2f')](_0x22c95c[_0x3105('0x45')][_0x3105('0x2f')]);}_0x338376[_0x3105('0x4c')]=qs[_0x3105('0x4d')](_0x22c95c[_0x3105('0x45')][_0x3105('0x4d')]);_0x338376[_0x3105('0x4e')]=qs[_0x3105('0x46')](_['pick'](_0x22c95c['query'],_0x26283c[_0x3105('0x46')]),_0x1274d1);if(_0x22c95c[_0x3105('0x45')][_0x3105('0x4f')]){_0x338376[_0x3105('0x4e')]=_['merge'](_0x338376[_0x3105('0x4e')],{'$or':_['map'](_0x1274d1,function(_0x1ae4f0){if(_0x1ae4f0['type']!=='VIRTUAL'){var _0x497bfa={};_0x497bfa[_0x1ae4f0[_0x3105('0x3c')]]={'$like':'%'+_0x22c95c[_0x3105('0x45')][_0x3105('0x4f')]+'%'};return _0x497bfa;}})});}_0x338376=_['merge']({},_0x338376,_0x22c95c['options']);var _0x38f790={'where':_0x338376[_0x3105('0x4e')]};return db[_0x3105('0x3f')][_0x3105('0x32')](_0x38f790)[_0x3105('0x21')](function(_0x10f425){_0x56e965[_0x3105('0x32')]=_0x10f425;if(_0x22c95c[_0x3105('0x45')][_0x3105('0x50')]){_0x338376[_0x3105('0x51')]=[{'all':!![]}];}return db[_0x3105('0x3f')][_0x3105('0x52')](_0x338376);})[_0x3105('0x21')](function(_0x4204fe){_0x56e965[_0x3105('0x53')]=_0x4204fe;return _0x56e965;})[_0x3105('0x21')](respondWithFilteredResult(_0x141fd2,_0x338376))['catch'](handleError(_0x141fd2,null));};exports[_0x3105('0x54')]=function(_0x38fea5,_0x3fdccd){var _0x4e5ca9={'raw':!![],'where':{'id':_0x38fea5['params']['id']}},_0x345f32={};_0x345f32[_0x3105('0x44')]=_[_0x3105('0x55')](db[_0x3105('0x3f')][_0x3105('0x40')]);_0x345f32[_0x3105('0x45')]=_['keys'](_0x38fea5[_0x3105('0x45')]);_0x345f32[_0x3105('0x46')]=_['intersection'](_0x345f32['model'],_0x345f32['query']);_0x4e5ca9[_0x3105('0x48')]=_[_0x3105('0x47')](_0x345f32[_0x3105('0x44')],qs[_0x3105('0x49')](_0x38fea5[_0x3105('0x45')][_0x3105('0x49')]));_0x4e5ca9[_0x3105('0x48')]=_0x4e5ca9['attributes'][_0x3105('0x4a')]?_0x4e5ca9[_0x3105('0x48')]:_0x345f32[_0x3105('0x44')];if(_0x38fea5['query'][_0x3105('0x50')]){_0x4e5ca9[_0x3105('0x51')]=[{'all':!![]}];}_0x4e5ca9=_[_0x3105('0x56')]({},_0x4e5ca9,_0x38fea5[_0x3105('0x57')]);return db[_0x3105('0x3f')][_0x3105('0x58')](_0x4e5ca9)[_0x3105('0x21')](handleEntityNotFound(_0x3fdccd,null))['then'](respondWithResult(_0x3fdccd,null))[_0x3105('0x2b')](handleError(_0x3fdccd,null));};exports[_0x3105('0x59')]=function(_0x2ffff7,_0x5493e2){return db[_0x3105('0x3f')]['create'](_0x2ffff7['body'],{})[_0x3105('0x21')](function(_0x3bbb2f){var _0x589039=_0x2ffff7[_0x3105('0x5a')][_0x3105('0x37')]({'plain':!![]});if(!_0x589039)throw new Error(_0x3105('0x5b'));if(_0x589039[_0x3105('0x5c')]===_0x3105('0x5a')){var _0x3bf7eb=_0x3bbb2f[_0x3105('0x37')]({'plain':!![]});var _0x325f19=_0x3105('0x38');return db[_0x3105('0x5d')]['find']({'where':{'name':_0x325f19,'userProfileId':_0x589039['userProfileId']},'raw':!![]})[_0x3105('0x21')](function(_0x472a03){if(_0x472a03&&_0x472a03[_0x3105('0x5e')]===0x0){return db[_0x3105('0x39')][_0x3105('0x59')]({'name':_0x3bf7eb[_0x3105('0x3c')],'resourceId':_0x3bf7eb['id'],'type':_0x472a03['name'],'sectionId':_0x472a03['id']},{})[_0x3105('0x21')](function(){return _0x3bbb2f;});}else{return _0x3bbb2f;}})['catch'](function(_0x779b48){logger[_0x3105('0x28')](_0x3105('0x5f'),_0x779b48);throw _0x779b48;});}return _0x3bbb2f;})['then'](respondWithResult(_0x5493e2,0xc9))['catch'](handleError(_0x5493e2,null));};exports[_0x3105('0x60')]=function(_0x5c8f6c,_0x1d1735){if(_0x5c8f6c['body']['id']){delete _0x5c8f6c['body']['id'];}return db[_0x3105('0x3f')][_0x3105('0x58')]({'where':{'id':_0x5c8f6c['params']['id']}})['then'](handleEntityNotFound(_0x1d1735,null))[_0x3105('0x21')](saveUpdates(_0x5c8f6c[_0x3105('0x61')],null))['then'](respondWithResult(_0x1d1735,null))[_0x3105('0x2b')](handleError(_0x1d1735,null));};exports[_0x3105('0x62')]=function(_0x3f3143,_0x237f26){return db['ChatQueue'][_0x3105('0x58')]({'where':{'id':_0x3f3143[_0x3105('0x63')]['id']}})[_0x3105('0x21')](handleEntityNotFound(_0x237f26,null))['then'](removeEntity(_0x237f26,null))[_0x3105('0x2b')](handleError(_0x237f26,null));};exports[_0x3105('0x64')]=function(_0x44c97f,_0x4d97e2){return db[_0x3105('0x3f')]['describe']()['then'](respondWithResult(_0x4d97e2,null))['catch'](handleError(_0x4d97e2,null));};exports[_0x3105('0x65')]=function(_0x4907f8,_0x1cf24d,_0x805f17){var _0x46d987={'raw':!![],'where':{}},_0x399e0a={},_0x426634;return db[_0x3105('0x3f')][_0x3105('0x66')]({'where':{'id':_0x4907f8[_0x3105('0x63')]['id']}})['then'](handleEntityNotFound(_0x1cf24d,null))[_0x3105('0x21')](function(_0x297b1e){if(_0x297b1e){_0x426634=_0x297b1e[_0x3105('0x37')]({'plain':!![]});_0x399e0a[_0x3105('0x44')]=_[_0x3105('0x55')](db[_0x3105('0x67')][_0x3105('0x40')]);_0x399e0a['query']=_[_0x3105('0x55')](_0x4907f8[_0x3105('0x45')]);_0x399e0a[_0x3105('0x46')]=_[_0x3105('0x47')](_0x399e0a[_0x3105('0x44')],_0x399e0a['query']);_0x46d987['attributes']=_[_0x3105('0x47')](_0x399e0a[_0x3105('0x44')],qs[_0x3105('0x49')](_0x4907f8['query']['fields']));_0x46d987['attributes']=_0x46d987[_0x3105('0x48')][_0x3105('0x4a')]?_0x46d987[_0x3105('0x48')]:_0x399e0a[_0x3105('0x44')];if(!_0x4907f8[_0x3105('0x45')][_0x3105('0x68')](_0x3105('0x4b'))){_0x46d987[_0x3105('0x31')]=qs[_0x3105('0x31')](_0x4907f8['query'][_0x3105('0x31')]);_0x46d987['offset']=qs[_0x3105('0x2f')](_0x4907f8[_0x3105('0x45')][_0x3105('0x2f')]);}_0x46d987[_0x3105('0x4c')]=qs['sort'](_0x4907f8[_0x3105('0x45')][_0x3105('0x4d')]);_0x46d987['where']=qs[_0x3105('0x46')](_[_0x3105('0x69')](_0x4907f8[_0x3105('0x45')],_0x399e0a['filters']));_0x46d987[_0x3105('0x4e')][_0x3105('0x6a')]=_0x297b1e['id'];if(_0x4907f8[_0x3105('0x45')][_0x3105('0x4f')]){_0x46d987[_0x3105('0x4e')]=_[_0x3105('0x56')](_0x46d987[_0x3105('0x4e')],{'$or':_[_0x3105('0x3e')](_0x46d987[_0x3105('0x48')],function(_0x446ecc){var _0x9e7524={};_0x9e7524[_0x446ecc]={'$like':'%'+_0x4907f8[_0x3105('0x45')]['filter']+'%'};return _0x9e7524;})});}_0x46d987=_['merge']({},_0x46d987,_0x4907f8[_0x3105('0x57')]);return db[_0x3105('0x67')]['findAll'](_0x46d987);}})[_0x3105('0x21')](function(_0x18bf2c){if(_0x18bf2c){return db[_0x3105('0x6b')]['findAndCountAll']({'where':{'id':_[_0x3105('0x3e')](_0x18bf2c,_0x3105('0x6c')),'role':_0x3105('0x6d')},'attributes':['id',_0x3105('0x3c'),_0x3105('0x6e'),_0x3105('0x6f'),'createdAt']});}})[_0x3105('0x21')](function(_0x4d0931){if(_0x4d0931){return{'count':_0x4d0931['count'],'rows':_[_0x3105('0x3e')](_0x4d0931['rows'],function(_0x340bf7){return{'membername':_0x340bf7[_0x3105('0x3c')],'UserId':_0x340bf7['id'],'queue_name':_0x426634[_0x3105('0x3c')],'ChatQueueId':_0x426634['id'],'interface':util[_0x3105('0x70')]('%s/%s',_0x3105('0x71'),_0x340bf7[_0x3105('0x3c')]),'penalty':0x0,'paused':_0x340bf7[_0x3105('0x6e')],'createdAt':_0x340bf7['createdAt'],'updatedAt':_0x340bf7[_0x3105('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3105('0x21')](respondWithFilteredResult(_0x1cf24d,_0x46d987))[_0x3105('0x2b')](handleError(_0x1cf24d,null));};exports[_0x3105('0x72')]=function(_0x37352e,_0x28afb1,_0x4d7566){var _0x8a0444={};var _0xb55fdb={};var _0x30316f;var _0x2d70f3;return db[_0x3105('0x3f')][_0x3105('0x66')]({'where':{'id':_0x37352e[_0x3105('0x63')]['id']}})[_0x3105('0x21')](handleEntityNotFound(_0x28afb1,null))[_0x3105('0x21')](function(_0x32cc80){if(_0x32cc80){_0x30316f=_0x32cc80;_0xb55fdb[_0x3105('0x44')]=_['keys'](db['Team'][_0x3105('0x40')]);_0xb55fdb['query']=_['keys'](_0x37352e[_0x3105('0x45')]);_0xb55fdb[_0x3105('0x46')]=_[_0x3105('0x47')](_0xb55fdb[_0x3105('0x44')],_0xb55fdb[_0x3105('0x45')]);_0x8a0444[_0x3105('0x48')]=_[_0x3105('0x47')](_0xb55fdb['model'],qs['fields'](_0x37352e['query'][_0x3105('0x49')]));_0x8a0444[_0x3105('0x48')]=_0x8a0444[_0x3105('0x48')]['length']?_0x8a0444[_0x3105('0x48')]:_0xb55fdb['model'];_0x8a0444[_0x3105('0x4c')]=qs[_0x3105('0x4d')](_0x37352e[_0x3105('0x45')][_0x3105('0x4d')]);_0x8a0444[_0x3105('0x4e')]=qs['filters'](_['pick'](_0x37352e[_0x3105('0x45')],_0xb55fdb[_0x3105('0x46')]));if(_0x37352e[_0x3105('0x45')]['filter']){_0x8a0444[_0x3105('0x4e')]=_[_0x3105('0x56')](_0x8a0444[_0x3105('0x4e')],{'$or':_['map'](_0x8a0444[_0x3105('0x48')],function(_0xcec602){var _0x2e992b={};_0x2e992b[_0xcec602]={'$like':'%'+_0x37352e[_0x3105('0x45')]['filter']+'%'};return _0x2e992b;})});}_0x8a0444=_[_0x3105('0x56')]({},_0x8a0444,_0x37352e['options']);return _0x30316f[_0x3105('0x72')](_0x8a0444);}})[_0x3105('0x21')](function(_0x5aa869){if(_0x5aa869){_0x2d70f3=_0x5aa869[_0x3105('0x4a')];if(!_0x37352e[_0x3105('0x45')][_0x3105('0x68')](_0x3105('0x4b'))){_0x8a0444[_0x3105('0x31')]=qs['limit'](_0x37352e[_0x3105('0x45')]['limit']);_0x8a0444[_0x3105('0x2f')]=qs[_0x3105('0x2f')](_0x37352e[_0x3105('0x45')]['offset']);}return _0x30316f[_0x3105('0x72')](_0x8a0444);}})[_0x3105('0x21')](function(_0x109a05){if(_0x109a05){return _0x109a05?{'count':_0x2d70f3,'rows':_0x109a05}:null;}})[_0x3105('0x21')](respondWithResult(_0x28afb1,null))[_0x3105('0x2b')](handleError(_0x28afb1,null));};exports[_0x3105('0x73')]=function(_0x59f5db,_0x518897,_0x7a66a6){var _0x2091ff=_0x59f5db['body'][_0x3105('0x74')];return db[_0x3105('0x75')][_0x3105('0x52')]({'where':{'id':_0x2091ff},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x3105('0x76'),_0x3105('0x77'),_0x3105('0x78')],'raw':!![]}]})[_0x3105('0x21')](function(_0x3b3a82){if(_0x3b3a82){var _0x510218=_[_0x3105('0x79')](_0x3b3a82,function(_0xf19676){var _0x46e742=_0xf19676['get']({'plain':!![]});return _0x46e742[_0x3105('0x7a')];});return db[_0x3105('0x3f')][_0x3105('0x58')]({'where':{'id':_0x59f5db[_0x3105('0x63')]['id']}})['then'](function(_0x533de0){return db['sequelize'][_0x3105('0x7b')](function(_0x2b1524){return _0x533de0[_0x3105('0x73')](_0x2091ff,{'transaction':_0x2b1524})['then'](function(){return BPromise[_0x3105('0x7c')](_0x510218,function(_0x1df23e){return db['UserChatQueue'][_0x3105('0x7d')]({'where':{'UserId':_0x1df23e['id'],'ChatQueueId':_0x59f5db[_0x3105('0x63')]['id']},'transaction':_0x2b1524});});})[_0x3105('0x21')](function(){_0x510218[_0x3105('0x7e')](function(_0x2c3bd5){socket[_0x3105('0x7f')]('userChatQueue:save',{'UserId':_0x2c3bd5['id'],'ChatQueueId':_0x533de0['id']});});});});});}})[_0x3105('0x21')](respondWithStatusCode(_0x518897,null))['catch'](handleError(_0x518897,null));};exports[_0x3105('0x80')]=function(_0x3c9622,_0x2fb1ea,_0x43c32f){return db[_0x3105('0x75')][_0x3105('0x52')]({'where':{'id':_0x3c9622[_0x3105('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3105('0x6b')],'as':_0x3105('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2fb1ea,null))[_0x3105('0x21')](function(_0x58f676){var _0x28a718=_[_0x3105('0x3e')](_0x58f676,'id');var _0x529c3d=[];var _0x4726a8=[];var _0x2e62f3=squel['select']();_0x2e62f3[_0x3105('0x81')](_0x3105('0x82'))[_0x3105('0x83')](_0x3105('0x84'),'tq')['join']('user_has_teams','ut',_0x3105('0x85'))[_0x3105('0x4e')]('ChatQueueId\x20=\x20?',_0x3c9622['params']['id']);for(var _0x3167c6=0x0;_0x3167c6<_0x58f676[_0x3105('0x4a')];_0x3167c6+=0x1){let _0x51065c=_0x58f676[_0x3167c6];for(var _0x30a26a=0x0;_0x30a26a<_0x51065c['Agents']['length'];_0x30a26a+=0x1){let _0x37f2d0=_0x51065c[_0x3105('0x7a')][_0x30a26a];var _0x236155=_0x2e62f3[_0x3105('0x86')]();_0x236155['where']('ut.UserId\x20=\x20?',_0x37f2d0['id']);_0x4726a8[_0x3105('0x87')](db[_0x3105('0x88')][_0x3105('0x45')](_0x236155[_0x3105('0x89')](),{'type':db[_0x3105('0x88')][_0x3105('0x8a')][_0x3105('0x8b')]})['then'](function(_0x308de7){if(_0x308de7[_0x3105('0x4a')]===0x1){return _0x37f2d0['id'];}else{var _0x52ad00=_[_0x3105('0x8c')](_[_0x3105('0x3e')](_0x308de7,'TeamId'),function(_0x58a36d){return _[_0x3105('0x8d')](_0x28a718,_0x58a36d);});if(_0x52ad00){return _0x37f2d0['id'];}}}));}}return BPromise[_0x3105('0x8e')](_0x4726a8)[_0x3105('0x21')](function(_0x3b61d3){_0x529c3d=_(_0x529c3d)['union'](_0x3b61d3)['compact']()[_0x3105('0x8f')]();return db['ChatQueue'][_0x3105('0x58')]({'where':{'id':_0x3c9622[_0x3105('0x63')]['id']}})[_0x3105('0x21')](function(_0x4097d4){return db['sequelize'][_0x3105('0x7b')](function(_0x3be1ab){return _0x4097d4[_0x3105('0x80')](_0x3c9622[_0x3105('0x45')][_0x3105('0x74')],{'transaction':_0x3be1ab})[_0x3105('0x21')](function(){if(!_[_0x3105('0x90')](_0x529c3d)){return _0x4097d4[_0x3105('0x91')](_0x529c3d,{'transaction':_0x3be1ab});}})[_0x3105('0x21')](function(){_0x529c3d[_0x3105('0x7e')](function(_0x576a22){socket['emit'](_0x3105('0x92'),{'UserId':_0x576a22,'ChatQueueId':_0x4097d4['id']});});});});});});})[_0x3105('0x21')](respondWithStatusCode(_0x2fb1ea,null))['catch'](handleError(_0x2fb1ea,null));};exports[_0x3105('0x93')]=function(_0x7da054,_0x48cfe5,_0x1c4c66){return db[_0x3105('0x3f')][_0x3105('0x58')]({'where':{'id':_0x7da054[_0x3105('0x63')]['id']}})['then'](handleEntityNotFound(_0x48cfe5,null))['then'](function(_0x1a2695){if(_0x1a2695){return _0x1a2695[_0x3105('0x93')](_0x7da054[_0x3105('0x61')][_0x3105('0x74')],_['omit'](_0x7da054[_0x3105('0x61')],[_0x3105('0x74'),'id'])||{})[_0x3105('0x94')](function(_0x401364){for(var _0x22da98=0x0;_0x22da98<_0x7da054[_0x3105('0x61')]['ids'][_0x3105('0x4a')];_0x22da98+=0x1){socket[_0x3105('0x7f')]('userChatQueue:save',{'UserId':Number(_0x7da054[_0x3105('0x61')][_0x3105('0x74')][_0x22da98]),'ChatQueueId':Number(_0x7da054['params']['id'])});}return _0x401364;});}})[_0x3105('0x21')](respondWithResult(_0x48cfe5,null))[_0x3105('0x2b')](handleError(_0x48cfe5,null));};exports[_0x3105('0x91')]=function(_0x4c7c0c,_0x4ae6e9,_0x53d324){return db['ChatQueue'][_0x3105('0x58')]({'where':{'id':_0x4c7c0c['params']['id']}})['then'](handleEntityNotFound(_0x4ae6e9,null))['then'](function(_0x46dd59){if(_0x46dd59){return _0x46dd59[_0x3105('0x91')](_0x4c7c0c[_0x3105('0x45')][_0x3105('0x74')])[_0x3105('0x21')](function(){if(_['isArray'](_0x4c7c0c['query']['ids'])){for(var _0x2a1ed6=0x0;_0x2a1ed6<_0x4c7c0c[_0x3105('0x45')][_0x3105('0x74')][_0x3105('0x4a')];_0x2a1ed6+=0x1){socket[_0x3105('0x7f')](_0x3105('0x92'),{'UserId':Number(_0x4c7c0c[_0x3105('0x45')][_0x3105('0x74')][_0x2a1ed6]),'ChatQueueId':Number(_0x4c7c0c[_0x3105('0x63')]['id'])});}}else{socket[_0x3105('0x7f')]('userChatQueue:remove',{'UserId':Number(_0x4c7c0c[_0x3105('0x45')]['ids']),'ChatQueueId':Number(_0x4c7c0c[_0x3105('0x63')]['id'])});}});}})[_0x3105('0x21')](respondWithStatusCode(_0x4ae6e9,null))[_0x3105('0x2b')](handleError(_0x4ae6e9,null));};exports[_0x3105('0x95')]=function(_0x567b3c,_0x16d2e9,_0x1712a1){var _0x46e9b9={};var _0x35c032={};var _0x261297;var _0x21221b;return db[_0x3105('0x3f')][_0x3105('0x66')]({'where':{'id':_0x567b3c['params']['id']}})[_0x3105('0x21')](handleEntityNotFound(_0x16d2e9,null))['then'](function(_0x203092){if(_0x203092){_0x261297=_0x203092;_0x35c032['model']=_[_0x3105('0x55')](db[_0x3105('0x6b')][_0x3105('0x40')]);_0x35c032['query']=_[_0x3105('0x55')](_0x567b3c[_0x3105('0x45')]);_0x35c032[_0x3105('0x46')]=_[_0x3105('0x47')](_0x35c032[_0x3105('0x44')],_0x35c032[_0x3105('0x45')]);_0x46e9b9['attributes']=_[_0x3105('0x47')](_0x35c032[_0x3105('0x44')],qs['fields'](_0x567b3c['query'][_0x3105('0x49')]));_0x46e9b9['attributes']=_0x46e9b9[_0x3105('0x48')][_0x3105('0x4a')]?_0x46e9b9[_0x3105('0x48')]:_0x35c032[_0x3105('0x44')];_0x46e9b9[_0x3105('0x4c')]=qs['sort'](_0x567b3c['query'][_0x3105('0x4d')]);_0x46e9b9['where']=qs['filters'](_[_0x3105('0x69')](_0x567b3c[_0x3105('0x45')],_0x35c032[_0x3105('0x46')]));if(_0x567b3c[_0x3105('0x45')][_0x3105('0x4f')]){_0x46e9b9[_0x3105('0x4e')]=_[_0x3105('0x56')](_0x46e9b9['where'],{'$or':_['map'](_0x46e9b9[_0x3105('0x48')],function(_0xdb9a3a){var _0x4c3f01={};_0x4c3f01[_0xdb9a3a]={'$like':'%'+_0x567b3c[_0x3105('0x45')]['filter']+'%'};return _0x4c3f01;})});}_0x46e9b9=_['merge']({},_0x46e9b9,_0x567b3c['options']);return _0x261297[_0x3105('0x95')](_0x46e9b9);}})[_0x3105('0x21')](function(_0x5bb221){if(_0x5bb221){_0x21221b=_0x5bb221['length'];if(!_0x567b3c[_0x3105('0x45')][_0x3105('0x68')](_0x3105('0x4b'))){_0x46e9b9[_0x3105('0x31')]=qs[_0x3105('0x31')](_0x567b3c[_0x3105('0x45')][_0x3105('0x31')]);_0x46e9b9[_0x3105('0x2f')]=qs['offset'](_0x567b3c[_0x3105('0x45')]['offset']);}return _0x261297[_0x3105('0x95')](_0x46e9b9);}})[_0x3105('0x21')](function(_0x1fb0ad){if(_0x1fb0ad){return _0x1fb0ad?{'count':_0x21221b,'rows':_0x1fb0ad}:null;}})[_0x3105('0x21')](respondWithResult(_0x16d2e9,null))[_0x3105('0x2b')](handleError(_0x16d2e9,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 755e53b..18df898 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 _0x0efb=['save','remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0efb,0x16d));var _0xb0ef=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0x0efb[_0x35b7d4];return _0x4e8cee;};'use strict';var EventEmitter=require(_0xb0ef('0x0'));var ChatQueue=require(_0xb0ef('0x1'))['db'][_0xb0ef('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb0ef('0x3')](0x0);var events={'afterCreate':_0xb0ef('0x4'),'afterUpdate':'update','afterDestroy':_0xb0ef('0x5')};function emitEvent(_0x5cd579){return function(_0xf2bc2f,_0x499b5f,_0x251257){ChatQueueEvents[_0xb0ef('0x6')](_0x5cd579+':'+_0xf2bc2f['id'],_0xf2bc2f);ChatQueueEvents[_0xb0ef('0x6')](_0x5cd579,_0xf2bc2f);_0x251257(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xb0ef('0x7')](e,emitEvent(event));}}module[_0xb0ef('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x9ac8=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x247453,_0x33d99d){var _0x5dd474=function(_0x501a0e){while(--_0x501a0e){_0x247453['push'](_0x247453['shift']());}};_0x5dd474(++_0x33d99d);}(_0x9ac8,0x184));var _0x89ac=function(_0x2b22fc,_0x55e38c){_0x2b22fc=_0x2b22fc-0x0;var _0x542b07=_0x9ac8[_0x2b22fc];return _0x542b07;};'use strict';var EventEmitter=require(_0x89ac('0x0'));var ChatQueue=require(_0x89ac('0x1'))['db'][_0x89ac('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x89ac('0x3'),'afterUpdate':_0x89ac('0x4'),'afterDestroy':_0x89ac('0x5')};function emitEvent(_0x32a208){return function(_0x3eb597,_0x3d0aa8,_0x494d3f){ChatQueueEvents[_0x89ac('0x6')](_0x32a208+':'+_0x3eb597['id'],_0x3eb597);ChatQueueEvents[_0x89ac('0x6')](_0x32a208,_0x3eb597);_0x494d3f(null);};}for(var e in events){if(events[_0x89ac('0x7')](e)){var event=events[e];ChatQueue[_0x89ac('0x8')](e,emitEvent(event));}}module[_0x89ac('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0d448dd..7adffaf 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 _0x0b2c=['bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','lodash','api','moment'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x0b2c,0x101));var _0xc0b2=function(_0x415423,_0x3d8720){_0x415423=_0x415423-0x0;var _0x2b3362=_0x0b2c[_0x415423];return _0x2b3362;};'use strict';var _=require(_0xc0b2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc0b2('0x1'));var moment=require(_0xc0b2('0x2'));var BPromise=require(_0xc0b2('0x3'));var rp=require(_0xc0b2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0b2('0x5'));var config=require(_0xc0b2('0x6'));var attributes=require(_0xc0b2('0x7'));module['exports']=function(_0x2be264,_0x36ab42){return _0x2be264[_0xc0b2('0x8')](_0xc0b2('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbab=['chat_queues','lodash','util','../../config/logger','moment','rimraf','../../config/environment','exports','define','ChatQueue'];(function(_0x2730f5,_0x3395e1){var _0x45b1b0=function(_0x5ffdf7){while(--_0x5ffdf7){_0x2730f5['push'](_0x2730f5['shift']());}};_0x45b1b0(++_0x3395e1);}(_0xdbab,0x97));var _0xbdba=function(_0x283a81,_0x42f033){_0x283a81=_0x283a81-0x0;var _0x57533f=_0xdbab[_0x283a81];return _0x57533f;};'use strict';var _=require(_0xbdba('0x0'));var util=require(_0xbdba('0x1'));var logger=require(_0xbdba('0x2'))('api');var moment=require(_0xbdba('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbdba('0x4'));var config=require(_0xbdba('0x5'));var attributes=require('./chatQueue.attributes');module[_0xbdba('0x6')]=function(_0x3652ce,_0x32c965){return _0x3652ce[_0xbdba('0x7')](_0xbdba('0x8'),attributes,{'tableName':_0xbdba('0x9'),'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 56e9e51..1b4d1d2 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 _0xa6ea=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','then','debug','find','raw','ShowChatQueue','lodash','util','moment','bluebird'];(function(_0x4e930d,_0x5573bc){var _0x30d8ff=function(_0x5797bb){while(--_0x5797bb){_0x4e930d['push'](_0x4e930d['shift']());}};_0x30d8ff(++_0x5573bc);}(_0xa6ea,0x122));var _0xaa6e=function(_0x3394d5,_0x556227){_0x3394d5=_0x3394d5-0x0;var _0x14f441=_0xa6ea[_0x3394d5];return _0x14f441;};'use strict';var _=require(_0xaa6e('0x0'));var util=require(_0xaa6e('0x1'));var moment=require(_0xaa6e('0x2'));var BPromise=require(_0xaa6e('0x3'));var rs=require(_0xaa6e('0x4'));var fs=require('fs');var Redis=require(_0xaa6e('0x5'));var db=require(_0xaa6e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa6e('0x7'))(_0xaa6e('0x8'));var config=require(_0xaa6e('0x9'));var jayson=require(_0xaa6e('0xa'));var client=jayson[_0xaa6e('0xb')]['http']({'port':0x232a});config['redis']=_[_0xaa6e('0xc')](config[_0xaa6e('0xd')],{'host':_0xaa6e('0xe'),'port':0x18eb});var socket=require(_0xaa6e('0xf'))(new Redis(config[_0xaa6e('0xd')]));require(_0xaa6e('0x10'))[_0xaa6e('0x11')](socket);function respondWithRpcPromise(_0x50c23c,_0x357240,_0x4cb51b){return new BPromise(function(_0x534cb5,_0x3fc93b){return client['request'](_0x50c23c,_0x4cb51b)['then'](function(_0x3fbdc5){logger[_0xaa6e('0x12')]('ChatQueue,\x20%s,\x20%s',_0x357240,_0xaa6e('0x13'));logger['debug'](_0xaa6e('0x14'),_0x357240,_0xaa6e('0x13'),JSON[_0xaa6e('0x15')](_0x3fbdc5));if(_0x3fbdc5[_0xaa6e('0x16')]){if(_0x3fbdc5[_0xaa6e('0x16')][_0xaa6e('0x17')]===0x1f4){logger[_0xaa6e('0x16')](_0xaa6e('0x18'),_0x357240,_0x3fbdc5[_0xaa6e('0x16')]['message']);return _0x3fc93b(_0x3fbdc5[_0xaa6e('0x16')][_0xaa6e('0x19')]);}logger[_0xaa6e('0x16')]('ChatQueue,\x20%s,\x20%s',_0x357240,_0x3fbdc5[_0xaa6e('0x16')][_0xaa6e('0x19')]);return _0x534cb5(_0x3fbdc5[_0xaa6e('0x16')][_0xaa6e('0x19')]);}else{logger['info'](_0xaa6e('0x18'),_0x357240,_0xaa6e('0x13'));_0x534cb5(_0x3fbdc5[_0xaa6e('0x1a')][_0xaa6e('0x19')]);}})[_0xaa6e('0x1b')](function(_0x1e80f6){logger['error'](_0xaa6e('0x18'),_0x357240,_0x1e80f6);_0x3fc93b(_0x1e80f6);});});}exports[_0xaa6e('0x1c')]=function(_0x42d03b){var _0x48ca71=this;return new Promise(function(_0x22d985,_0x1c517c){return db[_0xaa6e('0x1d')]['findAll']({'raw':_0x42d03b[_0xaa6e('0x1e')]?_0x42d03b[_0xaa6e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x42d03b['options']?_0x42d03b['options'][_0xaa6e('0x1f')]||null:null,'attributes':_0x42d03b[_0xaa6e('0x1e')]?_0x42d03b[_0xaa6e('0x1e')][_0xaa6e('0x20')]||null:null,'limit':_0x42d03b['options']?_0x42d03b[_0xaa6e('0x1e')][_0xaa6e('0x21')]||null:null,'include':_0x42d03b[_0xaa6e('0x1e')]?_0x42d03b[_0xaa6e('0x1e')][_0xaa6e('0x22')]?_[_0xaa6e('0x23')](_0x42d03b[_0xaa6e('0x1e')][_0xaa6e('0x22')],function(_0x116c92){return{'model':db[_0x116c92[_0xaa6e('0x24')]],'as':_0x116c92['as'],'attributes':_0x116c92['attributes'],'include':_0x116c92[_0xaa6e('0x22')]?_[_0xaa6e('0x23')](_0x116c92[_0xaa6e('0x22')],function(_0x521402){return{'model':db[_0x521402['model']],'as':_0x521402['as'],'attributes':_0x521402[_0xaa6e('0x20')],'include':_0x521402[_0xaa6e('0x22')]?_[_0xaa6e('0x23')](_0x521402[_0xaa6e('0x22')],function(_0x40c76a){return{'model':db[_0x40c76a[_0xaa6e('0x24')]],'as':_0x40c76a['as'],'attributes':_0x40c76a['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa6e('0x25')](function(_0x21262a){logger['info'](_0xaa6e('0x1c'),_0x42d03b);logger[_0xaa6e('0x26')]('GetChatQueue',_0x42d03b,JSON[_0xaa6e('0x15')](_0x21262a));_0x22d985(_0x21262a);})[_0xaa6e('0x1b')](function(_0x2ddec4){logger['error'](_0xaa6e('0x1c'),_0x2ddec4[_0xaa6e('0x19')],_0x42d03b);_0x1c517c(_0x48ca71[_0xaa6e('0x16')](0x1f4,_0x2ddec4[_0xaa6e('0x19')]));});});};exports['ShowChatQueue']=function(_0x34eb9b){var _0x4176aa=this;return new Promise(function(_0x126a07,_0x258793){return db[_0xaa6e('0x1d')][_0xaa6e('0x27')]({'raw':_0x34eb9b[_0xaa6e('0x1e')]?_0x34eb9b['options'][_0xaa6e('0x28')]===undefined?!![]:![]:!![],'where':_0x34eb9b[_0xaa6e('0x1e')]?_0x34eb9b[_0xaa6e('0x1e')][_0xaa6e('0x1f')]||null:null,'attributes':_0x34eb9b[_0xaa6e('0x1e')]?_0x34eb9b[_0xaa6e('0x1e')][_0xaa6e('0x20')]||null:null,'include':_0x34eb9b[_0xaa6e('0x1e')]?_0x34eb9b[_0xaa6e('0x1e')][_0xaa6e('0x22')]?_['map'](_0x34eb9b[_0xaa6e('0x1e')][_0xaa6e('0x22')],function(_0x2e9911){return{'model':db[_0x2e9911[_0xaa6e('0x24')]],'as':_0x2e9911['as'],'attributes':_0x2e9911[_0xaa6e('0x20')],'include':_0x2e9911[_0xaa6e('0x22')]?_['map'](_0x2e9911[_0xaa6e('0x22')],function(_0x56c24b){return{'model':db[_0x56c24b[_0xaa6e('0x24')]],'as':_0x56c24b['as'],'attributes':_0x56c24b['attributes'],'include':_0x56c24b['include']?_['map'](_0x56c24b[_0xaa6e('0x22')],function(_0x5b9b2d){return{'model':db[_0x5b9b2d[_0xaa6e('0x24')]],'as':_0x5b9b2d['as'],'attributes':_0x5b9b2d[_0xaa6e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1546b6){logger['info'](_0xaa6e('0x29'),_0x34eb9b);logger[_0xaa6e('0x26')](_0xaa6e('0x29'),_0x34eb9b,JSON['stringify'](_0x1546b6));_0x126a07(_0x1546b6);})[_0xaa6e('0x1b')](function(_0x183597){logger[_0xaa6e('0x16')](_0xaa6e('0x29'),_0x183597[_0xaa6e('0x19')],_0x34eb9b);_0x258793(_0x4176aa['error'](0x1f4,_0x183597[_0xaa6e('0x19')]));});});}; \ No newline at end of file +var _0xa282=['client','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowChatQueue','ChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xa282,0x189));var _0x2a28=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa282[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x2a28('0x0'));var util=require(_0x2a28('0x1'));var moment=require(_0x2a28('0x2'));var BPromise=require(_0x2a28('0x3'));var rs=require(_0x2a28('0x4'));var fs=require('fs');var Redis=require(_0x2a28('0x5'));var db=require(_0x2a28('0x6'))['db'];var utils=require(_0x2a28('0x7'));var logger=require(_0x2a28('0x8'))(_0x2a28('0x9'));var config=require(_0x2a28('0xa'));var jayson=require(_0x2a28('0xb'));var client=jayson[_0x2a28('0xc')]['http']({'port':0x232a});config['redis']=_[_0x2a28('0xd')](config[_0x2a28('0xe')],{'host':_0x2a28('0xf'),'port':0x18eb});var socket=require(_0x2a28('0x10'))(new Redis(config['redis']));require(_0x2a28('0x11'))[_0x2a28('0x12')](socket);function respondWithRpcPromise(_0x2fb466,_0x1b602e,_0x253357){return new BPromise(function(_0x30c4d3,_0x478842){return client[_0x2a28('0x13')](_0x2fb466,_0x253357)['then'](function(_0x1d4e90){logger['info'](_0x2a28('0x14'),_0x1b602e,_0x2a28('0x15'));logger[_0x2a28('0x16')](_0x2a28('0x17'),_0x1b602e,_0x2a28('0x15'),JSON[_0x2a28('0x18')](_0x1d4e90));if(_0x1d4e90[_0x2a28('0x19')]){if(_0x1d4e90['error'][_0x2a28('0x1a')]===0x1f4){logger[_0x2a28('0x19')](_0x2a28('0x14'),_0x1b602e,_0x1d4e90[_0x2a28('0x19')][_0x2a28('0x1b')]);return _0x478842(_0x1d4e90['error'][_0x2a28('0x1b')]);}logger[_0x2a28('0x19')]('ChatQueue,\x20%s,\x20%s',_0x1b602e,_0x1d4e90[_0x2a28('0x19')][_0x2a28('0x1b')]);return _0x30c4d3(_0x1d4e90[_0x2a28('0x19')]['message']);}else{logger[_0x2a28('0x1c')](_0x2a28('0x14'),_0x1b602e,_0x2a28('0x15'));_0x30c4d3(_0x1d4e90[_0x2a28('0x1d')][_0x2a28('0x1b')]);}})[_0x2a28('0x1e')](function(_0x1d3ecf){logger[_0x2a28('0x19')](_0x2a28('0x14'),_0x1b602e,_0x1d3ecf);_0x478842(_0x1d3ecf);});});}exports[_0x2a28('0x1f')]=function(_0xab245){var _0x320b4=this;return new Promise(function(_0x11d3e5,_0x38f256){return db['ChatQueue'][_0x2a28('0x20')]({'raw':_0xab245[_0x2a28('0x21')]?_0xab245[_0x2a28('0x21')][_0x2a28('0x22')]===undefined?!![]:![]:!![],'where':_0xab245[_0x2a28('0x21')]?_0xab245[_0x2a28('0x21')][_0x2a28('0x23')]||null:null,'attributes':_0xab245[_0x2a28('0x21')]?_0xab245[_0x2a28('0x21')][_0x2a28('0x24')]||null:null,'limit':_0xab245[_0x2a28('0x21')]?_0xab245[_0x2a28('0x21')][_0x2a28('0x25')]||null:null,'include':_0xab245[_0x2a28('0x21')]?_0xab245[_0x2a28('0x21')][_0x2a28('0x26')]?_[_0x2a28('0x27')](_0xab245[_0x2a28('0x21')][_0x2a28('0x26')],function(_0xb7db8e){return{'model':db[_0xb7db8e[_0x2a28('0x28')]],'as':_0xb7db8e['as'],'attributes':_0xb7db8e['attributes'],'include':_0xb7db8e[_0x2a28('0x26')]?_[_0x2a28('0x27')](_0xb7db8e[_0x2a28('0x26')],function(_0x4ed138){return{'model':db[_0x4ed138['model']],'as':_0x4ed138['as'],'attributes':_0x4ed138[_0x2a28('0x24')],'include':_0x4ed138[_0x2a28('0x26')]?_[_0x2a28('0x27')](_0x4ed138[_0x2a28('0x26')],function(_0x406d3e){return{'model':db[_0x406d3e['model']],'as':_0x406d3e['as'],'attributes':_0x406d3e[_0x2a28('0x24')]};}):[]};}):[]};}):[]:[]})[_0x2a28('0x29')](function(_0x1ba395){logger[_0x2a28('0x1c')](_0x2a28('0x1f'),_0xab245);logger[_0x2a28('0x16')](_0x2a28('0x1f'),_0xab245,JSON['stringify'](_0x1ba395));_0x11d3e5(_0x1ba395);})[_0x2a28('0x1e')](function(_0x2e2ada){logger[_0x2a28('0x19')]('GetChatQueue',_0x2e2ada[_0x2a28('0x1b')],_0xab245);_0x38f256(_0x320b4['error'](0x1f4,_0x2e2ada[_0x2a28('0x1b')]));});});};exports[_0x2a28('0x2a')]=function(_0x3ad0fc){var _0x25deba=this;return new Promise(function(_0x3ca5f5,_0x1fd6d5){return db[_0x2a28('0x2b')][_0x2a28('0x2c')]({'raw':_0x3ad0fc['options']?_0x3ad0fc['options'][_0x2a28('0x22')]===undefined?!![]:![]:!![],'where':_0x3ad0fc['options']?_0x3ad0fc[_0x2a28('0x21')]['where']||null:null,'attributes':_0x3ad0fc[_0x2a28('0x21')]?_0x3ad0fc[_0x2a28('0x21')][_0x2a28('0x24')]||null:null,'include':_0x3ad0fc[_0x2a28('0x21')]?_0x3ad0fc['options'][_0x2a28('0x26')]?_['map'](_0x3ad0fc[_0x2a28('0x21')][_0x2a28('0x26')],function(_0x3d69fd){return{'model':db[_0x3d69fd['model']],'as':_0x3d69fd['as'],'attributes':_0x3d69fd[_0x2a28('0x24')],'include':_0x3d69fd[_0x2a28('0x26')]?_[_0x2a28('0x27')](_0x3d69fd[_0x2a28('0x26')],function(_0x2efb50){return{'model':db[_0x2efb50[_0x2a28('0x28')]],'as':_0x2efb50['as'],'attributes':_0x2efb50[_0x2a28('0x24')],'include':_0x2efb50[_0x2a28('0x26')]?_[_0x2a28('0x27')](_0x2efb50[_0x2a28('0x26')],function(_0x4f3824){return{'model':db[_0x4f3824[_0x2a28('0x28')]],'as':_0x4f3824['as'],'attributes':_0x4f3824[_0x2a28('0x24')]};}):[]};}):[]};}):[]:[]})[_0x2a28('0x29')](function(_0x169b81){logger[_0x2a28('0x1c')](_0x2a28('0x2a'),_0x3ad0fc);logger[_0x2a28('0x16')](_0x2a28('0x2a'),_0x3ad0fc,JSON['stringify'](_0x169b81));_0x3ca5f5(_0x169b81);})[_0x2a28('0x1e')](function(_0x6d2e76){logger[_0x2a28('0x19')]('ShowChatQueue',_0x6d2e76[_0x2a28('0x1b')],_0x3ad0fc);_0x1fd6d5(_0x25deba[_0x2a28('0x19')](0x1f4,_0x6d2e76['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index fc2c3cb..9a65b57 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 _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x1ac989,_0x3e5ea6){var _0x16a80b=function(_0x509c64){while(--_0x509c64){_0x1ac989['push'](_0x1ac989['shift']());}};_0x16a80b(++_0x3e5ea6);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x137bdd,_0x43a31f){_0x137bdd=_0x137bdd-0x0;var _0x2656a5=_0x4c6d[_0x137bdd];return _0x2656a5;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}}; \ No newline at end of file +var _0xbec5=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','update'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xbec5,0xe5));var _0x5bec=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xbec5[_0x5cb1af];return _0x8d7940;};'use strict';var ChatQueueEvents=require(_0x5bec('0x0'));var events=[_0x5bec('0x1'),'remove',_0x5bec('0x2')];function createListener(_0x38c81a,_0x276b9e){return function(_0x3859a1){_0x276b9e[_0x5bec('0x3')](_0x38c81a,_0x3859a1);};}function removeListener(_0x4ee982,_0x1f8933){return function(){ChatQueueEvents[_0x5bec('0x4')](_0x4ee982,_0x1f8933);};}exports[_0x5bec('0x5')]=function(_0x4aaac6){for(var _0x3ed67a=0x0,_0x28a427=events[_0x5bec('0x6')];_0x3ed67a<_0x28a427;_0x3ed67a++){var _0x406e65=events[_0x3ed67a];var _0x43d96e=createListener(_0x5bec('0x7')+_0x406e65,_0x4aaac6);ChatQueueEvents['on'](_0x406e65,_0x43d96e);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index c640c76..4473b72 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 _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(_0x225074,_0x1abb16){var _0x3fb50c=function(_0xf22c61){while(--_0xf22c61){_0x225074['push'](_0x225074['shift']());}};_0x3fb50c(++_0x1abb16);}(_0xe14b,0x93));var _0xbe14=function(_0x176b0c,_0x321afe){_0x176b0c=_0x176b0c-0x0;var _0x434f3d=_0xe14b[_0x176b0c];return _0x434f3d;};'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 +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x14c2e0,_0x1fb177){var _0x5a0569=function(_0x4410ef){while(--_0x4410ef){_0x14c2e0['push'](_0x14c2e0['shift']());}};_0x5a0569(++_0x1fb177);}(_0x814b,0x1a2));var _0xb814=function(_0x190c49,_0x103457){_0x190c49=_0x190c49-0x0;var _0x475b9a=_0x814b[_0x190c49];return _0x475b9a;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index b9e6447..4d66cc6 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 _0xe630=['DATE','moment','sequelize','exports','STRING'];(function(_0x51d477,_0x2349ae){var _0x127b0d=function(_0x4b46b6){while(--_0x4b46b6){_0x51d477['push'](_0x51d477['shift']());}};_0x127b0d(++_0x2349ae);}(_0xe630,0x65));var _0x0e63=function(_0x3a6731,_0x3cf5f7){_0x3a6731=_0x3a6731-0x0;var _0x68e232=_0xe630[_0x3a6731];return _0x68e232;};'use strict';var moment=require(_0x0e63('0x0'));var Sequelize=require(_0x0e63('0x1'));module[_0x0e63('0x2')]={'uniqueid':{'type':Sequelize[_0x0e63('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0e63('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0e63('0x4')]},'acceptAt':{'type':Sequelize[_0x0e63('0x4')]},'exitAt':{'type':Sequelize[_0x0e63('0x4')]},'reason':{'type':Sequelize[_0x0e63('0x3')]}}; \ No newline at end of file +var _0x9534=['exports','STRING','DATE','moment','sequelize'];(function(_0x437e7d,_0x5bde91){var _0x1d2b5b=function(_0x107a7d){while(--_0x107a7d){_0x437e7d['push'](_0x437e7d['shift']());}};_0x1d2b5b(++_0x5bde91);}(_0x9534,0xc6));var _0x4953=function(_0x3479af,_0x41f5a8){_0x3479af=_0x3479af-0x0;var _0xea457c=_0x9534[_0x3479af];return _0xea457c;};'use strict';var moment=require(_0x4953('0x0'));var Sequelize=require(_0x4953('0x1'));module[_0x4953('0x2')]={'uniqueid':{'type':Sequelize[_0x4953('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4953('0x4')]},'leaveAt':{'type':Sequelize[_0x4953('0x4')]},'acceptAt':{'type':Sequelize[_0x4953('0x4')]},'exitAt':{'type':Sequelize[_0x4953('0x4')]},'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 0dee7b4..742660d 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 _0x63d4=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','findAll','rows','show','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils'];(function(_0x3b3331,_0x420c2f){var _0x214e10=function(_0x5f4c27){while(--_0x5f4c27){_0x3b3331['push'](_0x3b3331['shift']());}};_0x214e10(++_0x420c2f);}(_0x63d4,0x117));var _0x463d=function(_0x3d97c6,_0x2a3020){_0x3d97c6=_0x3d97c6-0x0;var _0x2e2da1=_0x63d4[_0x3d97c6];return _0x2e2da1;};'use strict';var emlformat=require(_0x463d('0x0'));var rimraf=require(_0x463d('0x1'));var zipdir=require(_0x463d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x463d('0x3'));var moment=require(_0x463d('0x4'));var BPromise=require(_0x463d('0x5'));var Mustache=require(_0x463d('0x6'));var util=require(_0x463d('0x7'));var path=require('path');var sox=require(_0x463d('0x8'));var csv=require(_0x463d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x463d('0xa'));var _=require(_0x463d('0xb'));var squel=require(_0x463d('0xc'));var crypto=require(_0x463d('0xd'));var jsforce=require(_0x463d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x463d('0x9'));var querystring=require('querystring');var Papa=require(_0x463d('0xf'));var Redis=require(_0x463d('0x10'));var authService=require(_0x463d('0x11'));var qs=require(_0x463d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x463d('0x13'))('api');var utils=require(_0x463d('0x14'));var config=require(_0x463d('0x15'));var licenseUtil=require(_0x463d('0x16'));var db=require(_0x463d('0x17'))['db'];function respondWithStatusCode(_0x1ac050,_0x15d6ca){_0x15d6ca=_0x15d6ca||0xcc;return function(_0x39834c){if(_0x39834c){return _0x1ac050['sendStatus'](_0x15d6ca);}return _0x1ac050[_0x463d('0x18')](_0x15d6ca)[_0x463d('0x19')]();};}function respondWithResult(_0x436dba,_0x5d82ad){_0x5d82ad=_0x5d82ad||0xc8;return function(_0x8956d3){if(_0x8956d3){return _0x436dba[_0x463d('0x18')](_0x5d82ad)[_0x463d('0x1a')](_0x8956d3);}};}function respondWithFilteredResult(_0x1932e6,_0x37b3f6){return function(_0x46896c){if(_0x46896c){var _0x53c8c6=typeof _0x37b3f6[_0x463d('0x1b')]==='undefined'&&typeof _0x37b3f6[_0x463d('0x1c')]===_0x463d('0x1d');var _0x3c8154=_0x46896c[_0x463d('0x1e')];var _0x408f47=_0x53c8c6?0x0:_0x37b3f6[_0x463d('0x1b')];var _0x48df3c=_0x53c8c6?_0x46896c[_0x463d('0x1e')]:_0x37b3f6[_0x463d('0x1b')]+_0x37b3f6[_0x463d('0x1c')];var _0x2f813d;if(_0x48df3c>=_0x3c8154){_0x48df3c=_0x3c8154;_0x2f813d=0xc8;}else{_0x2f813d=0xce;}_0x1932e6[_0x463d('0x18')](_0x2f813d);return _0x1932e6[_0x463d('0x1f')](_0x463d('0x20'),_0x408f47+'-'+_0x48df3c+'/'+_0x3c8154)[_0x463d('0x1a')](_0x46896c);}return null;};}function patchUpdates(_0x27c4a3){return function(_0x622b48){try{jsonpatch[_0x463d('0x21')](_0x622b48,_0x27c4a3,!![]);}catch(_0xda9541){return BPromise[_0x463d('0x22')](_0xda9541);}return _0x622b48[_0x463d('0x23')]();};}function saveUpdates(_0x458789,_0x5670fc){return function(_0x19e3eb){if(_0x19e3eb){return _0x19e3eb['update'](_0x458789)[_0x463d('0x24')](function(_0x1a2756){return _0x1a2756;});}return null;};}function removeEntity(_0x541aa9,_0x5d16ad){return function(_0x3fc748){if(_0x3fc748){return _0x3fc748[_0x463d('0x25')]()['then'](function(){_0x541aa9[_0x463d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1379ef,_0x35e562){return function(_0x3f10b3){if(!_0x3f10b3){_0x1379ef['sendStatus'](0x194);}return _0x3f10b3;};}function handleError(_0x592748,_0x4627c0){_0x4627c0=_0x4627c0||0x1f4;return function(_0x3763a2){logger[_0x463d('0x26')](_0x3763a2[_0x463d('0x27')]);if(_0x3763a2[_0x463d('0x28')]){delete _0x3763a2[_0x463d('0x28')];}_0x592748['status'](_0x4627c0)['send'](_0x3763a2);};}exports[_0x463d('0x29')]=function(_0x5cf437,_0x5358bb){var _0x45165d={},_0x33305d={},_0x440921={'count':0x0,'rows':[]};var _0x540e9c=_[_0x463d('0x2a')](db[_0x463d('0x2b')][_0x463d('0x2c')],function(_0x236ebb){return{'name':_0x236ebb[_0x463d('0x2d')],'type':_0x236ebb['type'][_0x463d('0x2e')]};});_0x33305d[_0x463d('0x2f')]=_['map'](_0x540e9c,_0x463d('0x28'));_0x33305d['query']=_[_0x463d('0x30')](_0x5cf437[_0x463d('0x31')]);_0x33305d[_0x463d('0x32')]=_[_0x463d('0x33')](_0x33305d[_0x463d('0x2f')],_0x33305d['query']);_0x45165d[_0x463d('0x34')]=_[_0x463d('0x33')](_0x33305d[_0x463d('0x2f')],qs[_0x463d('0x35')](_0x5cf437[_0x463d('0x31')][_0x463d('0x35')]));_0x45165d[_0x463d('0x34')]=_0x45165d[_0x463d('0x34')][_0x463d('0x36')]?_0x45165d[_0x463d('0x34')]:_0x33305d[_0x463d('0x2f')];if(!_0x5cf437[_0x463d('0x31')][_0x463d('0x37')](_0x463d('0x38'))){_0x45165d[_0x463d('0x1c')]=qs['limit'](_0x5cf437[_0x463d('0x31')][_0x463d('0x1c')]);_0x45165d[_0x463d('0x1b')]=qs[_0x463d('0x1b')](_0x5cf437[_0x463d('0x31')][_0x463d('0x1b')]);}_0x45165d[_0x463d('0x39')]=qs[_0x463d('0x3a')](_0x5cf437[_0x463d('0x31')][_0x463d('0x3a')]);_0x45165d[_0x463d('0x3b')]=qs['filters'](_['pick'](_0x5cf437[_0x463d('0x31')],_0x33305d[_0x463d('0x32')]),_0x540e9c);if(_0x5cf437['query'][_0x463d('0x3c')]){_0x45165d['where']=_['merge'](_0x45165d[_0x463d('0x3b')],{'$or':_['map'](_0x540e9c,function(_0x2eab3d){if(_0x2eab3d[_0x463d('0x3d')]!=='VIRTUAL'){var _0x3485dc={};_0x3485dc[_0x2eab3d[_0x463d('0x28')]]={'$like':'%'+_0x5cf437[_0x463d('0x31')][_0x463d('0x3c')]+'%'};return _0x3485dc;}})});}_0x45165d=_[_0x463d('0x3e')]({},_0x45165d,_0x5cf437[_0x463d('0x3f')]);var _0x1d1d67={'where':_0x45165d['where']};return db['ChatQueueReport'][_0x463d('0x1e')](_0x1d1d67)[_0x463d('0x24')](function(_0x41145e){_0x440921['count']=_0x41145e;if(_0x5cf437['query'][_0x463d('0x40')]){_0x45165d['include']=[{'all':!![]}];}return db[_0x463d('0x2b')][_0x463d('0x41')](_0x45165d);})[_0x463d('0x24')](function(_0x36b532){_0x440921[_0x463d('0x42')]=_0x36b532;return _0x440921;})[_0x463d('0x24')](respondWithFilteredResult(_0x5358bb,_0x45165d))['catch'](handleError(_0x5358bb,null));};exports[_0x463d('0x43')]=function(_0x498286,_0xd2232e){var _0x3b261d={'raw':!![],'where':{'id':_0x498286['params']['id']}},_0x5e4976={};_0x5e4976[_0x463d('0x2f')]=_[_0x463d('0x30')](db['ChatQueueReport']['rawAttributes']);_0x5e4976[_0x463d('0x31')]=_['keys'](_0x498286[_0x463d('0x31')]);_0x5e4976[_0x463d('0x32')]=_[_0x463d('0x33')](_0x5e4976[_0x463d('0x2f')],_0x5e4976[_0x463d('0x31')]);_0x3b261d['attributes']=_[_0x463d('0x33')](_0x5e4976[_0x463d('0x2f')],qs[_0x463d('0x35')](_0x498286[_0x463d('0x31')][_0x463d('0x35')]));_0x3b261d[_0x463d('0x34')]=_0x3b261d[_0x463d('0x34')][_0x463d('0x36')]?_0x3b261d['attributes']:_0x5e4976[_0x463d('0x2f')];if(_0x498286['query']['includeAll']){_0x3b261d['include']=[{'all':!![]}];}_0x3b261d=_['merge']({},_0x3b261d,_0x498286[_0x463d('0x3f')]);return db[_0x463d('0x2b')][_0x463d('0x44')](_0x3b261d)[_0x463d('0x24')](handleEntityNotFound(_0xd2232e,null))[_0x463d('0x24')](respondWithResult(_0xd2232e,null))[_0x463d('0x45')](handleError(_0xd2232e,null));};exports[_0x463d('0x46')]=function(_0x533d80,_0x24d179){return db['ChatQueueReport'][_0x463d('0x46')](_0x533d80[_0x463d('0x47')],{})[_0x463d('0x24')](respondWithResult(_0x24d179,0xc9))[_0x463d('0x45')](handleError(_0x24d179,null));};exports[_0x463d('0x48')]=function(_0x29d10c,_0x14b54f){if(_0x29d10c[_0x463d('0x47')]['id']){delete _0x29d10c[_0x463d('0x47')]['id'];}return db['ChatQueueReport'][_0x463d('0x44')]({'where':{'id':_0x29d10c[_0x463d('0x49')]['id']}})[_0x463d('0x24')](handleEntityNotFound(_0x14b54f,null))['then'](saveUpdates(_0x29d10c['body'],null))[_0x463d('0x24')](respondWithResult(_0x14b54f,null))['catch'](handleError(_0x14b54f,null));};exports[_0x463d('0x25')]=function(_0x41152f,_0x18f7b3){return db['ChatQueueReport'][_0x463d('0x44')]({'where':{'id':_0x41152f[_0x463d('0x49')]['id']}})['then'](handleEntityNotFound(_0x18f7b3,null))['then'](removeEntity(_0x18f7b3,null))[_0x463d('0x45')](handleError(_0x18f7b3,null));};exports[_0x463d('0x4a')]=function(_0x217e9c,_0x1efc1f){return db[_0x463d('0x2b')][_0x463d('0x4a')]()[_0x463d('0x24')](respondWithResult(_0x1efc1f,null))[_0x463d('0x45')](handleError(_0x1efc1f,null));}; \ No newline at end of file +var _0x870d=['includeAll','findAll','rows','catch','show','keys','intersection','include','find','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','stack','name','index','rawAttributes','map','query','filters','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','ChatQueueReport'];(function(_0x2940d6,_0x2becba){var _0x5dbf83=function(_0x1ab32e){while(--_0x1ab32e){_0x2940d6['push'](_0x2940d6['shift']());}};_0x5dbf83(++_0x2becba);}(_0x870d,0xde));var _0xd870=function(_0x197503,_0x52ded5){_0x197503=_0x197503-0x0;var _0x2afe95=_0x870d[_0x197503];return _0x2afe95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd870('0x0'));var zipdir=require(_0xd870('0x1'));var jsonpatch=require(_0xd870('0x2'));var rp=require(_0xd870('0x3'));var moment=require(_0xd870('0x4'));var BPromise=require(_0xd870('0x5'));var Mustache=require('mustache');var util=require(_0xd870('0x6'));var path=require(_0xd870('0x7'));var sox=require(_0xd870('0x8'));var csv=require(_0xd870('0x9'));var ejs=require(_0xd870('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd870('0xb'));var squel=require(_0xd870('0xc'));var crypto=require(_0xd870('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd870('0x9'));var querystring=require(_0xd870('0xe'));var Papa=require(_0xd870('0xf'));var Redis=require(_0xd870('0x10'));var authService=require(_0xd870('0x11'));var qs=require(_0xd870('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd870('0x13'))(_0xd870('0x14'));var utils=require(_0xd870('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd870('0x16'));var db=require(_0xd870('0x17'))['db'];function respondWithStatusCode(_0x51137f,_0xd66446){_0xd66446=_0xd66446||0xcc;return function(_0x434193){if(_0x434193){return _0x51137f['sendStatus'](_0xd66446);}return _0x51137f[_0xd870('0x18')](_0xd66446)['end']();};}function respondWithResult(_0x34e325,_0x161fde){_0x161fde=_0x161fde||0xc8;return function(_0x424f06){if(_0x424f06){return _0x34e325[_0xd870('0x18')](_0x161fde)['json'](_0x424f06);}};}function respondWithFilteredResult(_0x1929ef,_0xb2308b){return function(_0x57708e){if(_0x57708e){var _0x14e306=typeof _0xb2308b[_0xd870('0x19')]===_0xd870('0x1a')&&typeof _0xb2308b['limit']===_0xd870('0x1a');var _0xc1f658=_0x57708e['count'];var _0x2b7286=_0x14e306?0x0:_0xb2308b[_0xd870('0x19')];var _0x4ed8da=_0x14e306?_0x57708e[_0xd870('0x1b')]:_0xb2308b[_0xd870('0x19')]+_0xb2308b['limit'];var _0x2e33a2;if(_0x4ed8da>=_0xc1f658){_0x4ed8da=_0xc1f658;_0x2e33a2=0xc8;}else{_0x2e33a2=0xce;}_0x1929ef[_0xd870('0x18')](_0x2e33a2);return _0x1929ef[_0xd870('0x1c')](_0xd870('0x1d'),_0x2b7286+'-'+_0x4ed8da+'/'+_0xc1f658)['json'](_0x57708e);}return null;};}function patchUpdates(_0x53fade){return function(_0x3ea237){try{jsonpatch[_0xd870('0x1e')](_0x3ea237,_0x53fade,!![]);}catch(_0x4dd75e){return BPromise['reject'](_0x4dd75e);}return _0x3ea237[_0xd870('0x1f')]();};}function saveUpdates(_0x1300c,_0xc3e06b){return function(_0x247b90){if(_0x247b90){return _0x247b90[_0xd870('0x20')](_0x1300c)[_0xd870('0x21')](function(_0x134b84){return _0x134b84;});}return null;};}function removeEntity(_0x549b1e,_0x945d1){return function(_0x44787d){if(_0x44787d){return _0x44787d[_0xd870('0x22')]()[_0xd870('0x21')](function(){_0x549b1e[_0xd870('0x18')](0xcc)[_0xd870('0x23')]();});}};}function handleEntityNotFound(_0x3dbf19,_0xf22ff7){return function(_0x2fa5bd){if(!_0x2fa5bd){_0x3dbf19['sendStatus'](0x194);}return _0x2fa5bd;};}function handleError(_0x50d66f,_0x3fcb68){_0x3fcb68=_0x3fcb68||0x1f4;return function(_0x201c8f){logger['error'](_0x201c8f[_0xd870('0x24')]);if(_0x201c8f[_0xd870('0x25')]){delete _0x201c8f[_0xd870('0x25')];}_0x50d66f[_0xd870('0x18')](_0x3fcb68)['send'](_0x201c8f);};}exports[_0xd870('0x26')]=function(_0x401c9d,_0x5bfead){var _0x4413ad={},_0x5ed1d5={},_0x1efd8d={'count':0x0,'rows':[]};var _0x4ccbdb=_['map'](db['ChatQueueReport'][_0xd870('0x27')],function(_0x1061c5){return{'name':_0x1061c5['fieldName'],'type':_0x1061c5['type']['key']};});_0x5ed1d5['model']=_[_0xd870('0x28')](_0x4ccbdb,'name');_0x5ed1d5[_0xd870('0x29')]=_['keys'](_0x401c9d['query']);_0x5ed1d5[_0xd870('0x2a')]=_['intersection'](_0x5ed1d5[_0xd870('0x2b')],_0x5ed1d5[_0xd870('0x29')]);_0x4413ad[_0xd870('0x2c')]=_['intersection'](_0x5ed1d5[_0xd870('0x2b')],qs['fields'](_0x401c9d[_0xd870('0x29')][_0xd870('0x2d')]));_0x4413ad['attributes']=_0x4413ad[_0xd870('0x2c')][_0xd870('0x2e')]?_0x4413ad[_0xd870('0x2c')]:_0x5ed1d5[_0xd870('0x2b')];if(!_0x401c9d[_0xd870('0x29')]['hasOwnProperty'](_0xd870('0x2f'))){_0x4413ad['limit']=qs[_0xd870('0x30')](_0x401c9d[_0xd870('0x29')]['limit']);_0x4413ad[_0xd870('0x19')]=qs['offset'](_0x401c9d[_0xd870('0x29')][_0xd870('0x19')]);}_0x4413ad[_0xd870('0x31')]=qs[_0xd870('0x32')](_0x401c9d[_0xd870('0x29')][_0xd870('0x32')]);_0x4413ad[_0xd870('0x33')]=qs['filters'](_[_0xd870('0x34')](_0x401c9d[_0xd870('0x29')],_0x5ed1d5[_0xd870('0x2a')]),_0x4ccbdb);if(_0x401c9d['query'][_0xd870('0x35')]){_0x4413ad[_0xd870('0x33')]=_[_0xd870('0x36')](_0x4413ad[_0xd870('0x33')],{'$or':_['map'](_0x4ccbdb,function(_0x55daa8){if(_0x55daa8[_0xd870('0x37')]!==_0xd870('0x38')){var _0x171590={};_0x171590[_0x55daa8[_0xd870('0x25')]]={'$like':'%'+_0x401c9d[_0xd870('0x29')]['filter']+'%'};return _0x171590;}})});}_0x4413ad=_[_0xd870('0x36')]({},_0x4413ad,_0x401c9d['options']);var _0x326762={'where':_0x4413ad[_0xd870('0x33')]};return db[_0xd870('0x39')]['count'](_0x326762)['then'](function(_0x516332){_0x1efd8d[_0xd870('0x1b')]=_0x516332;if(_0x401c9d[_0xd870('0x29')][_0xd870('0x3a')]){_0x4413ad['include']=[{'all':!![]}];}return db[_0xd870('0x39')][_0xd870('0x3b')](_0x4413ad);})[_0xd870('0x21')](function(_0x5e04be){_0x1efd8d[_0xd870('0x3c')]=_0x5e04be;return _0x1efd8d;})['then'](respondWithFilteredResult(_0x5bfead,_0x4413ad))[_0xd870('0x3d')](handleError(_0x5bfead,null));};exports[_0xd870('0x3e')]=function(_0x389278,_0x53291d){var _0x3adbe4={'raw':!![],'where':{'id':_0x389278['params']['id']}},_0x5ead29={};_0x5ead29[_0xd870('0x2b')]=_[_0xd870('0x3f')](db[_0xd870('0x39')][_0xd870('0x27')]);_0x5ead29[_0xd870('0x29')]=_['keys'](_0x389278[_0xd870('0x29')]);_0x5ead29['filters']=_[_0xd870('0x40')](_0x5ead29[_0xd870('0x2b')],_0x5ead29[_0xd870('0x29')]);_0x3adbe4[_0xd870('0x2c')]=_[_0xd870('0x40')](_0x5ead29[_0xd870('0x2b')],qs[_0xd870('0x2d')](_0x389278[_0xd870('0x29')][_0xd870('0x2d')]));_0x3adbe4[_0xd870('0x2c')]=_0x3adbe4[_0xd870('0x2c')][_0xd870('0x2e')]?_0x3adbe4[_0xd870('0x2c')]:_0x5ead29[_0xd870('0x2b')];if(_0x389278[_0xd870('0x29')][_0xd870('0x3a')]){_0x3adbe4[_0xd870('0x41')]=[{'all':!![]}];}_0x3adbe4=_[_0xd870('0x36')]({},_0x3adbe4,_0x389278['options']);return db['ChatQueueReport'][_0xd870('0x42')](_0x3adbe4)[_0xd870('0x21')](handleEntityNotFound(_0x53291d,null))['then'](respondWithResult(_0x53291d,null))[_0xd870('0x3d')](handleError(_0x53291d,null));};exports['create']=function(_0x428c5f,_0x255ba5){return db['ChatQueueReport']['create'](_0x428c5f[_0xd870('0x43')],{})['then'](respondWithResult(_0x255ba5,0xc9))[_0xd870('0x3d')](handleError(_0x255ba5,null));};exports[_0xd870('0x20')]=function(_0x1c6635,_0x3459b1){if(_0x1c6635[_0xd870('0x43')]['id']){delete _0x1c6635[_0xd870('0x43')]['id'];}return db[_0xd870('0x39')]['find']({'where':{'id':_0x1c6635[_0xd870('0x44')]['id']}})[_0xd870('0x21')](handleEntityNotFound(_0x3459b1,null))[_0xd870('0x21')](saveUpdates(_0x1c6635[_0xd870('0x43')],null))[_0xd870('0x21')](respondWithResult(_0x3459b1,null))[_0xd870('0x3d')](handleError(_0x3459b1,null));};exports[_0xd870('0x22')]=function(_0x4ca6a6,_0x49ef39){return db[_0xd870('0x39')]['find']({'where':{'id':_0x4ca6a6[_0xd870('0x44')]['id']}})[_0xd870('0x21')](handleEntityNotFound(_0x49ef39,null))[_0xd870('0x21')](removeEntity(_0x49ef39,null))[_0xd870('0x3d')](handleError(_0x49ef39,null));};exports[_0xd870('0x45')]=function(_0x439e12,_0x477ee5){return db['ChatQueueReport'][_0xd870('0x45')]()[_0xd870('0x21')](respondWithResult(_0x477ee5,null))[_0xd870('0x3d')](handleError(_0x477ee5,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index a6a8381..84ecbb2 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x3b3750,_0x28f3b8){var _0x1b9e8b=function(_0xaf75c3){while(--_0xaf75c3){_0x3b3750['push'](_0x3b3750['shift']());}};_0x1b9e8b(++_0x28f3b8);}(_0xb10b,0x12a));var _0xbb10=function(_0x12742e,_0x43f6fa){_0x12742e=_0x12742e-0x0;var _0x173452=_0xb10b[_0x12742e];return _0x173452;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x31e147,_0x146784){var _0x4fead9=function(_0x5f4b96){while(--_0x5f4b96){_0x31e147['push'](_0x31e147['shift']());}};_0x4fead9(++_0x146784);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb7e7[_0x5d4607];return _0x5e4a86;};'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_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index e1651f7..7f25198 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 _0x917a=['http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','limit','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x38dff0,_0x2a9eef){var _0x5ed1be=function(_0x263715){while(--_0x263715){_0x38dff0['push'](_0x38dff0['shift']());}};_0x5ed1be(++_0x2a9eef);}(_0x917a,0x173));var _0xa917=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x917a[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa917('0x0'));var BPromise=require(_0xa917('0x1'));var rs=require(_0xa917('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa917('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa917('0x4'))(_0xa917('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa917('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3be995,_0x1fe3a0,_0x24ab73){return new BPromise(function(_0x4d3b0d,_0x58530d){return client[_0xa917('0x7')](_0x3be995,_0x24ab73)[_0xa917('0x8')](function(_0x4f8a58){logger[_0xa917('0x9')](_0xa917('0xa'),_0x1fe3a0,_0xa917('0xb'));logger[_0xa917('0xc')](_0xa917('0xd'),_0x1fe3a0,_0xa917('0xb'),JSON[_0xa917('0xe')](_0x4f8a58));if(_0x4f8a58[_0xa917('0xf')]){if(_0x4f8a58[_0xa917('0xf')][_0xa917('0x10')]===0x1f4){logger[_0xa917('0xf')](_0xa917('0xa'),_0x1fe3a0,_0x4f8a58[_0xa917('0xf')][_0xa917('0x11')]);return _0x58530d(_0x4f8a58[_0xa917('0xf')][_0xa917('0x11')]);}logger[_0xa917('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x1fe3a0,_0x4f8a58[_0xa917('0xf')][_0xa917('0x11')]);return _0x4d3b0d(_0x4f8a58[_0xa917('0xf')]['message']);}else{logger[_0xa917('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x1fe3a0,'request\x20sent');_0x4d3b0d(_0x4f8a58[_0xa917('0x12')][_0xa917('0x11')]);}})['catch'](function(_0x20619a){logger[_0xa917('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x1fe3a0,_0x20619a);_0x58530d(_0x20619a);});});}exports[_0xa917('0x13')]=function(_0x557742){var _0x3bcfd0=this;return new Promise(function(_0x4940bc,_0x410917){return db[_0xa917('0x14')][_0xa917('0x15')](_0x557742[_0xa917('0x16')],{'raw':_0x557742[_0xa917('0x17')]?_0x557742[_0xa917('0x17')][_0xa917('0x18')]===undefined?!![]:![]:!![]})[_0xa917('0x8')](function(_0x413686){logger[_0xa917('0x9')](_0xa917('0x13'),_0x557742);logger[_0xa917('0xc')](_0xa917('0x13'),_0x557742,JSON['stringify'](_0x413686));_0x4940bc(_0x413686);})[_0xa917('0x19')](function(_0x3f75a9){logger['error'](_0xa917('0x13'),_0x3f75a9[_0xa917('0x11')],_0x557742);_0x410917(_0x3bcfd0[_0xa917('0xf')](0x1f4,_0x3f75a9[_0xa917('0x11')]));});});};exports[_0xa917('0x1a')]=function(_0x3234e7){var _0x279f29=this;return new Promise(function(_0x50d6f2,_0x23161a){return db[_0xa917('0x14')][_0xa917('0x1b')](_0x3234e7[_0xa917('0x16')],{'raw':_0x3234e7[_0xa917('0x17')]?_0x3234e7[_0xa917('0x17')][_0xa917('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3234e7[_0xa917('0x17')]?_0x3234e7['options']['where']||null:null,'attributes':_0x3234e7[_0xa917('0x17')]?_0x3234e7[_0xa917('0x17')]['attributes']||null:null,'limit':_0x3234e7[_0xa917('0x17')]?_0x3234e7['options'][_0xa917('0x1c')]||null:null})[_0xa917('0x8')](function(_0x1ccfc0){logger[_0xa917('0x9')](_0xa917('0x1a'),_0x3234e7);logger[_0xa917('0xc')](_0xa917('0x1a'),_0x3234e7,JSON[_0xa917('0xe')](_0x1ccfc0));_0x50d6f2(_0x1ccfc0);})['catch'](function(_0x3d2696){logger[_0xa917('0xf')](_0xa917('0x1a'),_0x3d2696['message'],_0x3234e7);_0x23161a(_0x279f29[_0xa917('0xf')](0x1f4,_0x3d2696['message']));});});}; \ No newline at end of file +var _0xee7f=['attributes','limit','UpdateChatQueueReport','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','body','options','raw','update','where'];(function(_0x8261bb,_0x48e718){var _0x530867=function(_0x4b2b4e){while(--_0x4b2b4e){_0x8261bb['push'](_0x8261bb['shift']());}};_0x530867(++_0x48e718);}(_0xee7f,0xc3));var _0xfee7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xee7f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfee7('0x0'));var BPromise=require(_0xfee7('0x1'));var rs=require(_0xfee7('0x2'));var fs=require('fs');var Redis=require(_0xfee7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfee7('0x4'));var logger=require(_0xfee7('0x5'))(_0xfee7('0x6'));var config=require(_0xfee7('0x7'));var jayson=require(_0xfee7('0x8'));var client=jayson[_0xfee7('0x9')][_0xfee7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x482abf,_0x309e13,_0x216bfe){return new BPromise(function(_0x481f0e,_0x326255){return client[_0xfee7('0xb')](_0x482abf,_0x216bfe)[_0xfee7('0xc')](function(_0x40515e){logger[_0xfee7('0xd')](_0xfee7('0xe'),_0x309e13,_0xfee7('0xf'));logger[_0xfee7('0x10')](_0xfee7('0x11'),_0x309e13,_0xfee7('0xf'),JSON[_0xfee7('0x12')](_0x40515e));if(_0x40515e['error']){if(_0x40515e[_0xfee7('0x13')][_0xfee7('0x14')]===0x1f4){logger[_0xfee7('0x13')](_0xfee7('0xe'),_0x309e13,_0x40515e[_0xfee7('0x13')][_0xfee7('0x15')]);return _0x326255(_0x40515e[_0xfee7('0x13')]['message']);}logger['error'](_0xfee7('0xe'),_0x309e13,_0x40515e['error'][_0xfee7('0x15')]);return _0x481f0e(_0x40515e[_0xfee7('0x13')][_0xfee7('0x15')]);}else{logger[_0xfee7('0xd')](_0xfee7('0xe'),_0x309e13,_0xfee7('0xf'));_0x481f0e(_0x40515e['result'][_0xfee7('0x15')]);}})[_0xfee7('0x16')](function(_0x374fc0){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x309e13,_0x374fc0);_0x326255(_0x374fc0);});});}exports[_0xfee7('0x17')]=function(_0x329711){var _0x5295b1=this;return new Promise(function(_0x41e841,_0x18dde8){return db['ChatQueueReport']['create'](_0x329711[_0xfee7('0x18')],{'raw':_0x329711[_0xfee7('0x19')]?_0x329711[_0xfee7('0x19')][_0xfee7('0x1a')]===undefined?!![]:![]:!![]})[_0xfee7('0xc')](function(_0x555442){logger[_0xfee7('0xd')](_0xfee7('0x17'),_0x329711);logger[_0xfee7('0x10')](_0xfee7('0x17'),_0x329711,JSON['stringify'](_0x555442));_0x41e841(_0x555442);})[_0xfee7('0x16')](function(_0x58e8c1){logger[_0xfee7('0x13')](_0xfee7('0x17'),_0x58e8c1['message'],_0x329711);_0x18dde8(_0x5295b1[_0xfee7('0x13')](0x1f4,_0x58e8c1[_0xfee7('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x367a4e){var _0x157e86=this;return new Promise(function(_0x1a0a3a,_0x1c31dd){return db['ChatQueueReport'][_0xfee7('0x1b')](_0x367a4e[_0xfee7('0x18')],{'raw':_0x367a4e[_0xfee7('0x19')]?_0x367a4e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x367a4e[_0xfee7('0x19')]?_0x367a4e[_0xfee7('0x19')][_0xfee7('0x1c')]||null:null,'attributes':_0x367a4e[_0xfee7('0x19')]?_0x367a4e[_0xfee7('0x19')][_0xfee7('0x1d')]||null:null,'limit':_0x367a4e['options']?_0x367a4e[_0xfee7('0x19')][_0xfee7('0x1e')]||null:null})['then'](function(_0x70f036){logger[_0xfee7('0xd')](_0xfee7('0x1f'),_0x367a4e);logger[_0xfee7('0x10')](_0xfee7('0x1f'),_0x367a4e,JSON[_0xfee7('0x12')](_0x70f036));_0x1a0a3a(_0x70f036);})['catch'](function(_0x52c90e){logger[_0xfee7('0x13')](_0xfee7('0x1f'),_0x52c90e['message'],_0x367a4e);_0x1c31dd(_0x157e86['error'](0x1f4,_0x52c90e['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 56556f5..bb744b7 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 _0xb926=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x3baa0e,_0x3df81a){var _0x432af7=function(_0x390d31){while(--_0x390d31){_0x3baa0e['push'](_0x3baa0e['shift']());}};_0x432af7(++_0x3df81a);}(_0xb926,0x121));var _0x6b92=function(_0x49fc8f,_0x10c63e){_0x49fc8f=_0x49fc8f-0x0;var _0x1a338f=_0xb926[_0x49fc8f];return _0x1a338f;};'use strict';var multer=require(_0x6b92('0x0'));var util=require(_0x6b92('0x1'));var path=require(_0x6b92('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b92('0x3'));var router=express[_0x6b92('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6b92('0x5'));var interaction=require(_0x6b92('0x6'));var config=require(_0x6b92('0x7'));var controller=require('./chatQueueReport.controller');router[_0x6b92('0x8')]('/',auth[_0x6b92('0x9')](),controller[_0x6b92('0xa')]);router[_0x6b92('0x8')](_0x6b92('0xb'),auth[_0x6b92('0x9')](),controller[_0x6b92('0xc')]);router['get'](_0x6b92('0xd'),auth[_0x6b92('0x9')](),controller[_0x6b92('0xe')]);router[_0x6b92('0xf')]('/',auth[_0x6b92('0x9')](),controller[_0x6b92('0x10')]);router['put']('/:id',auth[_0x6b92('0x9')](),controller[_0x6b92('0x11')]);router[_0x6b92('0x12')](_0x6b92('0xd'),auth['isAuthenticated'](),controller[_0x6b92('0x13')]);module[_0x6b92('0x14')]=router; \ No newline at end of file +var _0x3e15=['show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','/:id'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x3e15,0xd8));var _0x53e1=function(_0x433cf1,_0x454307){_0x433cf1=_0x433cf1-0x0;var _0x149e64=_0x3e15[_0x433cf1];return _0x149e64;};'use strict';var multer=require(_0x53e1('0x0'));var util=require(_0x53e1('0x1'));var path=require(_0x53e1('0x2'));var timeout=require(_0x53e1('0x3'));var express=require(_0x53e1('0x4'));var router=express[_0x53e1('0x5')]();var fs_extra=require(_0x53e1('0x6'));var auth=require(_0x53e1('0x7'));var interaction=require(_0x53e1('0x8'));var config=require(_0x53e1('0x9'));var controller=require(_0x53e1('0xa'));router[_0x53e1('0xb')]('/',auth[_0x53e1('0xc')](),controller['index']);router[_0x53e1('0xb')](_0x53e1('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x53e1('0xb')](_0x53e1('0xe'),auth[_0x53e1('0xc')](),controller[_0x53e1('0xf')]);router[_0x53e1('0x10')]('/',auth['isAuthenticated'](),controller[_0x53e1('0x11')]);router[_0x53e1('0x12')](_0x53e1('0xe'),auth[_0x53e1('0xc')](),controller['update']);router[_0x53e1('0x13')](_0x53e1('0xe'),auth[_0x53e1('0xc')](),controller[_0x53e1('0x14')]);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 90bdb2d..60c707b 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5ebbe0,_0x2cc634){var _0x240399=function(_0x3dade1){while(--_0x3dade1){_0x5ebbe0['push'](_0x5ebbe0['shift']());}};_0x240399(++_0x2cc634);}(_0xaa88,0x137));var _0x8aa8=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0xaa88[_0x3e32a8];return _0x2997b0;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3e88da,_0xbadca6){var _0xf768d8=function(_0x352054){while(--_0x352054){_0x3e88da['push'](_0x3e88da['shift']());}};_0xf768d8(++_0xbadca6);}(_0xedd9,0xfc));var _0x9edd=function(_0x28212d,_0x449ce4){_0x28212d=_0x28212d-0x0;var _0x15aca7=_0xedd9[_0x28212d];return _0x15aca7;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 19b9943..062ddf8 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 _0x6662=['model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection'];(function(_0x34d95d,_0x5b503d){var _0x302ea6=function(_0x3f71ff){while(--_0x3f71ff){_0x34d95d['push'](_0x34d95d['shift']());}};_0x302ea6(++_0x5b503d);}(_0x6662,0xaf));var _0x2666=function(_0x38a040,_0x1cb9c3){_0x38a040=_0x38a040-0x0;var _0x50e92f=_0x6662[_0x38a040];return _0x50e92f;};'use strict';var emlformat=require(_0x2666('0x0'));var rimraf=require(_0x2666('0x1'));var zipdir=require(_0x2666('0x2'));var jsonpatch=require(_0x2666('0x3'));var rp=require(_0x2666('0x4'));var moment=require(_0x2666('0x5'));var BPromise=require(_0x2666('0x6'));var Mustache=require(_0x2666('0x7'));var util=require(_0x2666('0x8'));var path=require(_0x2666('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2666('0xa'));var _=require('lodash');var squel=require(_0x2666('0xb'));var crypto=require('crypto');var jsforce=require(_0x2666('0xc'));var deskjs=require(_0x2666('0xd'));var toCsv=require(_0x2666('0xe'));var querystring=require(_0x2666('0xf'));var Papa=require('papaparse');var Redis=require(_0x2666('0x10'));var authService=require(_0x2666('0x11'));var qs=require(_0x2666('0x12'));var as=require(_0x2666('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2666('0x14'))(_0x2666('0x15'));var utils=require(_0x2666('0x16'));var config=require(_0x2666('0x17'));var licenseUtil=require(_0x2666('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x113e92,_0x238394){_0x238394=_0x238394||0xcc;return function(_0x224c90){if(_0x224c90){return _0x113e92[_0x2666('0x19')](_0x238394);}return _0x113e92[_0x2666('0x1a')](_0x238394)[_0x2666('0x1b')]();};}function respondWithResult(_0x5d9a77,_0x2e9da6){_0x2e9da6=_0x2e9da6||0xc8;return function(_0x2fa166){if(_0x2fa166){return _0x5d9a77[_0x2666('0x1a')](_0x2e9da6)[_0x2666('0x1c')](_0x2fa166);}};}function respondWithFilteredResult(_0x2013a9,_0x4de2bf){return function(_0x571c58){if(_0x571c58){var _0x35684d=typeof _0x4de2bf['offset']===_0x2666('0x1d')&&typeof _0x4de2bf[_0x2666('0x1e')]===_0x2666('0x1d');var _0x5df833=_0x571c58[_0x2666('0x1f')];var _0x26a4ff=_0x35684d?0x0:_0x4de2bf[_0x2666('0x20')];var _0x460dfc=_0x35684d?_0x571c58[_0x2666('0x1f')]:_0x4de2bf[_0x2666('0x20')]+_0x4de2bf[_0x2666('0x1e')];var _0x5198b2;if(_0x460dfc>=_0x5df833){_0x460dfc=_0x5df833;_0x5198b2=0xc8;}else{_0x5198b2=0xce;}_0x2013a9[_0x2666('0x1a')](_0x5198b2);return _0x2013a9[_0x2666('0x21')](_0x2666('0x22'),_0x26a4ff+'-'+_0x460dfc+'/'+_0x5df833)['json'](_0x571c58);}return null;};}function patchUpdates(_0xe0ce37){return function(_0x35c378){try{jsonpatch['apply'](_0x35c378,_0xe0ce37,!![]);}catch(_0x4aff82){return BPromise[_0x2666('0x23')](_0x4aff82);}return _0x35c378[_0x2666('0x24')]();};}function saveUpdates(_0x1e57c2,_0x364e70){return function(_0x346005){if(_0x346005){return _0x346005[_0x2666('0x25')](_0x1e57c2)[_0x2666('0x26')](function(_0x3a42ec){return _0x3a42ec;});}return null;};}function removeEntity(_0x53b07b,_0x46ef6b){return function(_0x52e937){if(_0x52e937){return _0x52e937[_0x2666('0x27')]()[_0x2666('0x26')](function(){_0x53b07b['status'](0xcc)[_0x2666('0x1b')]();});}};}function handleEntityNotFound(_0x97f05e,_0x2d44f2){return function(_0x1091b5){if(!_0x1091b5){_0x97f05e[_0x2666('0x19')](0x194);}return _0x1091b5;};}function handleError(_0xeed8c,_0xe30b34){_0xe30b34=_0xe30b34||0x1f4;return function(_0x3890cf){logger[_0x2666('0x28')](_0x3890cf[_0x2666('0x29')]);if(_0x3890cf[_0x2666('0x2a')]){delete _0x3890cf['name'];}_0xeed8c[_0x2666('0x1a')](_0xe30b34)[_0x2666('0x2b')](_0x3890cf);};}exports[_0x2666('0x2c')]=function(_0x14628,_0x879360){var _0x2609e2={},_0x3ad694={},_0x3c6230={'count':0x0,'rows':[]};var _0x44c0ef=_[_0x2666('0x2d')](db['ChatTransferReport'][_0x2666('0x2e')],function(_0x21c230){return{'name':_0x21c230[_0x2666('0x2f')],'type':_0x21c230[_0x2666('0x30')]['key']};});_0x3ad694['model']=_[_0x2666('0x2d')](_0x44c0ef,_0x2666('0x2a'));_0x3ad694[_0x2666('0x31')]=_[_0x2666('0x32')](_0x14628[_0x2666('0x31')]);_0x3ad694[_0x2666('0x33')]=_[_0x2666('0x34')](_0x3ad694[_0x2666('0x35')],_0x3ad694[_0x2666('0x31')]);_0x2609e2['attributes']=_[_0x2666('0x34')](_0x3ad694[_0x2666('0x35')],qs[_0x2666('0x36')](_0x14628[_0x2666('0x31')][_0x2666('0x36')]));_0x2609e2[_0x2666('0x37')]=_0x2609e2[_0x2666('0x37')][_0x2666('0x38')]?_0x2609e2[_0x2666('0x37')]:_0x3ad694[_0x2666('0x35')];if(!_0x14628['query'][_0x2666('0x39')]('nolimit')){_0x2609e2[_0x2666('0x1e')]=qs[_0x2666('0x1e')](_0x14628[_0x2666('0x31')][_0x2666('0x1e')]);_0x2609e2[_0x2666('0x20')]=qs[_0x2666('0x20')](_0x14628[_0x2666('0x31')]['offset']);}_0x2609e2[_0x2666('0x3a')]=qs[_0x2666('0x3b')](_0x14628[_0x2666('0x31')]['sort']);_0x2609e2[_0x2666('0x3c')]=qs[_0x2666('0x33')](_[_0x2666('0x3d')](_0x14628[_0x2666('0x31')],_0x3ad694[_0x2666('0x33')]),_0x44c0ef);if(_0x14628[_0x2666('0x31')][_0x2666('0x3e')]){_0x2609e2[_0x2666('0x3c')]=_[_0x2666('0x3f')](_0x2609e2[_0x2666('0x3c')],{'$or':_[_0x2666('0x2d')](_0x44c0ef,function(_0x38e07f){if(_0x38e07f['type']!==_0x2666('0x40')){var _0x555c53={};_0x555c53[_0x38e07f[_0x2666('0x2a')]]={'$like':'%'+_0x14628[_0x2666('0x31')]['filter']+'%'};return _0x555c53;}})});}_0x2609e2=_[_0x2666('0x3f')]({},_0x2609e2,_0x14628[_0x2666('0x41')]);var _0xfe3db={'where':_0x2609e2[_0x2666('0x3c')]};return db[_0x2666('0x42')]['count'](_0xfe3db)['then'](function(_0x49267f){_0x3c6230['count']=_0x49267f;if(_0x14628['query'][_0x2666('0x43')]){_0x2609e2[_0x2666('0x44')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x2666('0x45')](_0x2609e2);})[_0x2666('0x26')](function(_0x39d76e){_0x3c6230['rows']=_0x39d76e;return _0x3c6230;})[_0x2666('0x26')](respondWithFilteredResult(_0x879360,_0x2609e2))[_0x2666('0x46')](handleError(_0x879360,null));};exports['show']=function(_0x4b8011,_0x4bf3ce){var _0x337ef9={'raw':!![],'where':{'id':_0x4b8011[_0x2666('0x47')]['id']}},_0x2ef539={};_0x2ef539[_0x2666('0x35')]=_['keys'](db['ChatTransferReport'][_0x2666('0x2e')]);_0x2ef539[_0x2666('0x31')]=_[_0x2666('0x32')](_0x4b8011[_0x2666('0x31')]);_0x2ef539[_0x2666('0x33')]=_[_0x2666('0x34')](_0x2ef539['model'],_0x2ef539[_0x2666('0x31')]);_0x337ef9[_0x2666('0x37')]=_[_0x2666('0x34')](_0x2ef539[_0x2666('0x35')],qs[_0x2666('0x36')](_0x4b8011[_0x2666('0x31')][_0x2666('0x36')]));_0x337ef9[_0x2666('0x37')]=_0x337ef9[_0x2666('0x37')][_0x2666('0x38')]?_0x337ef9[_0x2666('0x37')]:_0x2ef539[_0x2666('0x35')];if(_0x4b8011[_0x2666('0x31')]['includeAll']){_0x337ef9['include']=[{'all':!![]}];}_0x337ef9=_[_0x2666('0x3f')]({},_0x337ef9,_0x4b8011['options']);return db[_0x2666('0x42')][_0x2666('0x48')](_0x337ef9)[_0x2666('0x26')](handleEntityNotFound(_0x4bf3ce,null))['then'](respondWithResult(_0x4bf3ce,null))[_0x2666('0x46')](handleError(_0x4bf3ce,null));};exports[_0x2666('0x49')]=function(_0x5587da,_0x24ebb8){return db['ChatTransferReport']['create'](_0x5587da[_0x2666('0x4a')],{})[_0x2666('0x26')](respondWithResult(_0x24ebb8,0xc9))['catch'](handleError(_0x24ebb8,null));};exports[_0x2666('0x25')]=function(_0x3c2d1e,_0x1d1e4f){if(_0x3c2d1e[_0x2666('0x4a')]['id']){delete _0x3c2d1e['body']['id'];}return db[_0x2666('0x42')][_0x2666('0x48')]({'where':{'id':_0x3c2d1e[_0x2666('0x47')]['id']}})[_0x2666('0x26')](handleEntityNotFound(_0x1d1e4f,null))['then'](saveUpdates(_0x3c2d1e[_0x2666('0x4a')],null))[_0x2666('0x26')](respondWithResult(_0x1d1e4f,null))[_0x2666('0x46')](handleError(_0x1d1e4f,null));};exports['destroy']=function(_0x2e243a,_0x4ff844){return db[_0x2666('0x42')][_0x2666('0x48')]({'where':{'id':_0x2e243a[_0x2666('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ff844,null))[_0x2666('0x26')](removeEntity(_0x4ff844,null))[_0x2666('0x46')](handleError(_0x4ff844,null));};exports[_0x2666('0x4b')]=function(_0x54145c,_0x1e86db){return db[_0x2666('0x42')][_0x2666('0x4b')]()[_0x2666('0x26')](respondWithResult(_0x1e86db,null))['catch'](handleError(_0x1e86db,null));}; \ No newline at end of file +var _0x5840=['pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5840,0x1cd));var _0x0584=function(_0x5efd4d,_0x428f2e){_0x5efd4d=_0x5efd4d-0x0;var _0x5d3540=_0x5840[_0x5efd4d];return _0x5d3540;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0584('0x0'));var zipdir=require(_0x0584('0x1'));var jsonpatch=require(_0x0584('0x2'));var rp=require(_0x0584('0x3'));var moment=require(_0x0584('0x4'));var BPromise=require(_0x0584('0x5'));var Mustache=require('mustache');var util=require(_0x0584('0x6'));var path=require('path');var sox=require(_0x0584('0x7'));var csv=require(_0x0584('0x8'));var ejs=require(_0x0584('0x9'));var fs=require('fs');var fs_extra=require(_0x0584('0xa'));var _=require('lodash');var squel=require(_0x0584('0xb'));var crypto=require('crypto');var jsforce=require(_0x0584('0xc'));var deskjs=require(_0x0584('0xd'));var toCsv=require(_0x0584('0x8'));var querystring=require(_0x0584('0xe'));var Papa=require(_0x0584('0xf'));var Redis=require('ioredis');var authService=require(_0x0584('0x10'));var qs=require(_0x0584('0x11'));var as=require(_0x0584('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x0584('0x13'));var config=require(_0x0584('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e20cc,_0x538921){_0x538921=_0x538921||0xcc;return function(_0x50ba2e){if(_0x50ba2e){return _0x4e20cc['sendStatus'](_0x538921);}return _0x4e20cc[_0x0584('0x15')](_0x538921)[_0x0584('0x16')]();};}function respondWithResult(_0x32d484,_0x1a1f7b){_0x1a1f7b=_0x1a1f7b||0xc8;return function(_0x1b9ee6){if(_0x1b9ee6){return _0x32d484[_0x0584('0x15')](_0x1a1f7b)['json'](_0x1b9ee6);}};}function respondWithFilteredResult(_0x77aef0,_0x5adac2){return function(_0x426dc9){if(_0x426dc9){var _0x32c7e5=typeof _0x5adac2[_0x0584('0x17')]===_0x0584('0x18')&&typeof _0x5adac2[_0x0584('0x19')]===_0x0584('0x18');var _0x369391=_0x426dc9[_0x0584('0x1a')];var _0x2a002d=_0x32c7e5?0x0:_0x5adac2[_0x0584('0x17')];var _0x4d74bb=_0x32c7e5?_0x426dc9['count']:_0x5adac2['offset']+_0x5adac2['limit'];var _0x3d2663;if(_0x4d74bb>=_0x369391){_0x4d74bb=_0x369391;_0x3d2663=0xc8;}else{_0x3d2663=0xce;}_0x77aef0[_0x0584('0x15')](_0x3d2663);return _0x77aef0[_0x0584('0x1b')](_0x0584('0x1c'),_0x2a002d+'-'+_0x4d74bb+'/'+_0x369391)[_0x0584('0x1d')](_0x426dc9);}return null;};}function patchUpdates(_0x2f2c54){return function(_0x5310db){try{jsonpatch['apply'](_0x5310db,_0x2f2c54,!![]);}catch(_0x5d113c){return BPromise[_0x0584('0x1e')](_0x5d113c);}return _0x5310db[_0x0584('0x1f')]();};}function saveUpdates(_0x431124,_0x5cba69){return function(_0x3ffa47){if(_0x3ffa47){return _0x3ffa47[_0x0584('0x20')](_0x431124)[_0x0584('0x21')](function(_0xa3c003){return _0xa3c003;});}return null;};}function removeEntity(_0x1a7ba9,_0x8bae74){return function(_0x13fbb7){if(_0x13fbb7){return _0x13fbb7[_0x0584('0x22')]()['then'](function(){_0x1a7ba9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cdcf6,_0x56f5cc){return function(_0x55e28f){if(!_0x55e28f){_0x3cdcf6[_0x0584('0x23')](0x194);}return _0x55e28f;};}function handleError(_0x156994,_0x3cedb0){_0x3cedb0=_0x3cedb0||0x1f4;return function(_0x39a0b1){logger['error'](_0x39a0b1[_0x0584('0x24')]);if(_0x39a0b1[_0x0584('0x25')]){delete _0x39a0b1[_0x0584('0x25')];}_0x156994[_0x0584('0x15')](_0x3cedb0)[_0x0584('0x26')](_0x39a0b1);};}exports[_0x0584('0x27')]=function(_0x28b51c,_0x1911a8){var _0x64fb74={},_0x139ad7={},_0x41b36e={'count':0x0,'rows':[]};var _0x46d6c4=_[_0x0584('0x28')](db[_0x0584('0x29')][_0x0584('0x2a')],function(_0x1323a3){return{'name':_0x1323a3[_0x0584('0x2b')],'type':_0x1323a3['type'][_0x0584('0x2c')]};});_0x139ad7['model']=_[_0x0584('0x28')](_0x46d6c4,_0x0584('0x25'));_0x139ad7[_0x0584('0x2d')]=_[_0x0584('0x2e')](_0x28b51c[_0x0584('0x2d')]);_0x139ad7[_0x0584('0x2f')]=_[_0x0584('0x30')](_0x139ad7[_0x0584('0x31')],_0x139ad7[_0x0584('0x2d')]);_0x64fb74[_0x0584('0x32')]=_[_0x0584('0x30')](_0x139ad7[_0x0584('0x31')],qs['fields'](_0x28b51c['query'][_0x0584('0x33')]));_0x64fb74[_0x0584('0x32')]=_0x64fb74[_0x0584('0x32')]['length']?_0x64fb74[_0x0584('0x32')]:_0x139ad7[_0x0584('0x31')];if(!_0x28b51c[_0x0584('0x2d')][_0x0584('0x34')](_0x0584('0x35'))){_0x64fb74['limit']=qs[_0x0584('0x19')](_0x28b51c[_0x0584('0x2d')]['limit']);_0x64fb74[_0x0584('0x17')]=qs[_0x0584('0x17')](_0x28b51c['query'][_0x0584('0x17')]);}_0x64fb74[_0x0584('0x36')]=qs[_0x0584('0x37')](_0x28b51c[_0x0584('0x2d')][_0x0584('0x37')]);_0x64fb74[_0x0584('0x38')]=qs[_0x0584('0x2f')](_[_0x0584('0x39')](_0x28b51c[_0x0584('0x2d')],_0x139ad7[_0x0584('0x2f')]),_0x46d6c4);if(_0x28b51c[_0x0584('0x2d')][_0x0584('0x3a')]){_0x64fb74[_0x0584('0x38')]=_[_0x0584('0x3b')](_0x64fb74[_0x0584('0x38')],{'$or':_['map'](_0x46d6c4,function(_0x5bb269){if(_0x5bb269[_0x0584('0x3c')]!==_0x0584('0x3d')){var _0x367a1a={};_0x367a1a[_0x5bb269[_0x0584('0x25')]]={'$like':'%'+_0x28b51c[_0x0584('0x2d')][_0x0584('0x3a')]+'%'};return _0x367a1a;}})});}_0x64fb74=_['merge']({},_0x64fb74,_0x28b51c[_0x0584('0x3e')]);var _0x4f8d9a={'where':_0x64fb74[_0x0584('0x38')]};return db[_0x0584('0x29')]['count'](_0x4f8d9a)[_0x0584('0x21')](function(_0x34ce68){_0x41b36e['count']=_0x34ce68;if(_0x28b51c['query'][_0x0584('0x3f')]){_0x64fb74[_0x0584('0x40')]=[{'all':!![]}];}return db[_0x0584('0x29')][_0x0584('0x41')](_0x64fb74);})[_0x0584('0x21')](function(_0x4f8bb4){_0x41b36e['rows']=_0x4f8bb4;return _0x41b36e;})[_0x0584('0x21')](respondWithFilteredResult(_0x1911a8,_0x64fb74))[_0x0584('0x42')](handleError(_0x1911a8,null));};exports[_0x0584('0x43')]=function(_0x5acd7f,_0x27b816){var _0x3c45ae={'raw':!![],'where':{'id':_0x5acd7f[_0x0584('0x44')]['id']}},_0x4d4166={};_0x4d4166[_0x0584('0x31')]=_[_0x0584('0x2e')](db[_0x0584('0x29')][_0x0584('0x2a')]);_0x4d4166['query']=_['keys'](_0x5acd7f[_0x0584('0x2d')]);_0x4d4166[_0x0584('0x2f')]=_[_0x0584('0x30')](_0x4d4166[_0x0584('0x31')],_0x4d4166[_0x0584('0x2d')]);_0x3c45ae[_0x0584('0x32')]=_[_0x0584('0x30')](_0x4d4166['model'],qs[_0x0584('0x33')](_0x5acd7f['query'][_0x0584('0x33')]));_0x3c45ae[_0x0584('0x32')]=_0x3c45ae[_0x0584('0x32')][_0x0584('0x45')]?_0x3c45ae[_0x0584('0x32')]:_0x4d4166[_0x0584('0x31')];if(_0x5acd7f[_0x0584('0x2d')]['includeAll']){_0x3c45ae['include']=[{'all':!![]}];}_0x3c45ae=_[_0x0584('0x3b')]({},_0x3c45ae,_0x5acd7f['options']);return db[_0x0584('0x29')][_0x0584('0x46')](_0x3c45ae)[_0x0584('0x21')](handleEntityNotFound(_0x27b816,null))[_0x0584('0x21')](respondWithResult(_0x27b816,null))[_0x0584('0x42')](handleError(_0x27b816,null));};exports[_0x0584('0x47')]=function(_0x42bc90,_0x26e746){return db[_0x0584('0x29')][_0x0584('0x47')](_0x42bc90['body'],{})[_0x0584('0x21')](respondWithResult(_0x26e746,0xc9))[_0x0584('0x42')](handleError(_0x26e746,null));};exports[_0x0584('0x20')]=function(_0x3de69e,_0x417415){if(_0x3de69e['body']['id']){delete _0x3de69e[_0x0584('0x48')]['id'];}return db[_0x0584('0x29')]['find']({'where':{'id':_0x3de69e['params']['id']}})[_0x0584('0x21')](handleEntityNotFound(_0x417415,null))['then'](saveUpdates(_0x3de69e[_0x0584('0x48')],null))[_0x0584('0x21')](respondWithResult(_0x417415,null))[_0x0584('0x42')](handleError(_0x417415,null));};exports['destroy']=function(_0x24816e,_0x5f4413){return db[_0x0584('0x29')]['find']({'where':{'id':_0x24816e[_0x0584('0x44')]['id']}})['then'](handleEntityNotFound(_0x5f4413,null))['then'](removeEntity(_0x5f4413,null))[_0x0584('0x42')](handleError(_0x5f4413,null));};exports[_0x0584('0x49')]=function(_0x3c2b9d,_0x356f26){return db['ChatTransferReport'][_0x0584('0x49')]()[_0x0584('0x21')](respondWithResult(_0x356f26,null))[_0x0584('0x42')](handleError(_0x356f26,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 2483b7c..126dc1f 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 _0x1948=['../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5c0570,_0x6adc25){var _0x3611ca=function(_0x4065ab){while(--_0x4065ab){_0x5c0570['push'](_0x5c0570['shift']());}};_0x3611ca(++_0x6adc25);}(_0x1948,0x71));var _0x8194=function(_0xb5a41,_0x200edb){_0xb5a41=_0xb5a41-0x0;var _0x6d1194=_0x1948[_0xb5a41];return _0x6d1194;};'use strict';var _=require(_0x8194('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8194('0x1'));var moment=require(_0x8194('0x2'));var BPromise=require(_0x8194('0x3'));var rp=require(_0x8194('0x4'));var fs=require('fs');var path=require(_0x8194('0x5'));var rimraf=require(_0x8194('0x6'));var config=require(_0x8194('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x8194('0x8')]=function(_0x4bed85,_0x58ce03){return _0x4bed85['define'](_0x8194('0x9'),attributes,{'tableName':_0x8194('0xa'),'paranoid':![],'indexes':[{'name':_0x8194('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x12f5=['uniqueid','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x42299,_0x5e65cc){var _0xd2ebd1=function(_0x5486c1){while(--_0x5486c1){_0x42299['push'](_0x42299['shift']());}};_0xd2ebd1(++_0x5e65cc);}(_0x12f5,0x1c4));var _0x512f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x12f5[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x512f('0x0'));var util=require(_0x512f('0x1'));var logger=require(_0x512f('0x2'))('api');var moment=require(_0x512f('0x3'));var BPromise=require('bluebird');var rp=require(_0x512f('0x4'));var fs=require('fs');var path=require(_0x512f('0x5'));var rimraf=require('rimraf');var config=require(_0x512f('0x6'));var attributes=require(_0x512f('0x7'));module[_0x512f('0x8')]=function(_0xf873bd,_0x147363){return _0xf873bd[_0x512f('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x512f('0xa'),'fields':[_0x512f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index cdb4399..5309726 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 _0x822b=['client','http','request','then','info','request\x20sent','debug','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x17afd2,_0x4deb5e){var _0x3c7fec=function(_0x10a031){while(--_0x10a031){_0x17afd2['push'](_0x17afd2['shift']());}};_0x3c7fec(++_0x4deb5e);}(_0x822b,0x183));var _0xb822=function(_0x58f923,_0x2ac4a7){_0x58f923=_0x58f923-0x0;var _0x12088c=_0x822b[_0x58f923];return _0x12088c;};'use strict';var _=require(_0xb822('0x0'));var util=require(_0xb822('0x1'));var moment=require(_0xb822('0x2'));var BPromise=require(_0xb822('0x3'));var rs=require(_0xb822('0x4'));var fs=require('fs');var Redis=require(_0xb822('0x5'));var db=require(_0xb822('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb822('0x7'));var config=require('../../config/environment');var jayson=require(_0xb822('0x8'));var client=jayson[_0xb822('0x9')][_0xb822('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38b1d6,_0x9b03a1,_0x5968ff){return new BPromise(function(_0x4db15f,_0x3669db){return client[_0xb822('0xb')](_0x38b1d6,_0x5968ff)[_0xb822('0xc')](function(_0x2005fb){logger[_0xb822('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x9b03a1,_0xb822('0xe'));logger[_0xb822('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x9b03a1,_0xb822('0xe'),JSON['stringify'](_0x2005fb));if(_0x2005fb[_0xb822('0x10')]){if(_0x2005fb[_0xb822('0x10')][_0xb822('0x11')]===0x1f4){logger[_0xb822('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x9b03a1,_0x2005fb[_0xb822('0x10')][_0xb822('0x12')]);return _0x3669db(_0x2005fb['error']['message']);}logger[_0xb822('0x10')](_0xb822('0x13'),_0x9b03a1,_0x2005fb[_0xb822('0x10')][_0xb822('0x12')]);return _0x4db15f(_0x2005fb[_0xb822('0x10')][_0xb822('0x12')]);}else{logger['info'](_0xb822('0x13'),_0x9b03a1,'request\x20sent');_0x4db15f(_0x2005fb[_0xb822('0x14')][_0xb822('0x12')]);}})[_0xb822('0x15')](function(_0x4c860f){logger[_0xb822('0x10')](_0xb822('0x13'),_0x9b03a1,_0x4c860f);_0x3669db(_0x4c860f);});});} \ No newline at end of file +var _0x2130=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x37026d,_0x4323ad){var _0x4c2c88=function(_0x507a94){while(--_0x507a94){_0x37026d['push'](_0x37026d['shift']());}};_0x4c2c88(++_0x4323ad);}(_0x2130,0xf7));var _0x0213=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x2130[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x0213('0x0'));var util=require(_0x0213('0x1'));var moment=require('moment');var BPromise=require(_0x0213('0x2'));var rs=require(_0x0213('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0213('0x4'))['db'];var utils=require(_0x0213('0x5'));var logger=require(_0x0213('0x6'))(_0x0213('0x7'));var config=require('../../config/environment');var jayson=require(_0x0213('0x8'));var client=jayson[_0x0213('0x9')][_0x0213('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bfd1c,_0x48b9f9,_0x53291){return new BPromise(function(_0x5d2aee,_0x387bb9){return client['request'](_0x2bfd1c,_0x53291)[_0x0213('0xb')](function(_0x561bff){logger[_0x0213('0xc')](_0x0213('0xd'),_0x48b9f9,_0x0213('0xe'));logger[_0x0213('0xf')](_0x0213('0x10'),_0x48b9f9,_0x0213('0xe'),JSON[_0x0213('0x11')](_0x561bff));if(_0x561bff[_0x0213('0x12')]){if(_0x561bff[_0x0213('0x12')]['code']===0x1f4){logger[_0x0213('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x48b9f9,_0x561bff['error'][_0x0213('0x13')]);return _0x387bb9(_0x561bff['error'][_0x0213('0x13')]);}logger['error'](_0x0213('0xd'),_0x48b9f9,_0x561bff[_0x0213('0x12')][_0x0213('0x13')]);return _0x5d2aee(_0x561bff[_0x0213('0x12')][_0x0213('0x13')]);}else{logger[_0x0213('0xc')](_0x0213('0xd'),_0x48b9f9,_0x0213('0xe'));_0x5d2aee(_0x561bff[_0x0213('0x14')][_0x0213('0x13')]);}})['catch'](function(_0x37ee63){logger[_0x0213('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x48b9f9,_0x37ee63);_0x387bb9(_0x37ee63);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 93648a7..b9b0bc4 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 _0xa76b=['put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0xf6cfb4,_0x395579){var _0x2d3841=function(_0x14acca){while(--_0x14acca){_0xf6cfb4['push'](_0xf6cfb4['shift']());}};_0x2d3841(++_0x395579);}(_0xa76b,0x17e));var _0xba76=function(_0x31c9d9,_0x4b8036){_0x31c9d9=_0x31c9d9-0x0;var _0x594d55=_0xa76b[_0x31c9d9];return _0x594d55;};'use strict';var multer=require(_0xba76('0x0'));var util=require('util');var path=require(_0xba76('0x1'));var timeout=require(_0xba76('0x2'));var express=require(_0xba76('0x3'));var router=express[_0xba76('0x4')]();var fs_extra=require(_0xba76('0x5'));var auth=require(_0xba76('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xba76('0x7'));var controller=require(_0xba76('0x8'));router[_0xba76('0x9')]('/',auth[_0xba76('0xa')](),controller[_0xba76('0xb')]);router[_0xba76('0x9')](_0xba76('0xc'),auth['isAuthenticated'](),controller[_0xba76('0xd')]);router[_0xba76('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba76('0xe')]);router[_0xba76('0xf')]('/',auth[_0xba76('0xa')](),controller[_0xba76('0x10')]);router[_0xba76('0x11')](_0xba76('0x12'),auth[_0xba76('0xa')](),controller['update']);router['delete'](_0xba76('0x12'),auth[_0xba76('0xa')](),controller[_0xba76('0x13')]);module[_0xba76('0x14')]=router; \ No newline at end of file +var _0xc802=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','get','isAuthenticated','describe','show','post','create','put','update','/:id','destroy','multer','util'];(function(_0x354d5c,_0x1c35f4){var _0x1a8b66=function(_0x40b980){while(--_0x40b980){_0x354d5c['push'](_0x354d5c['shift']());}};_0x1a8b66(++_0x1c35f4);}(_0xc802,0x1f2));var _0x2c80=function(_0x5ed846,_0x5e2ca8){_0x5ed846=_0x5ed846-0x0;var _0x567083=_0xc802[_0x5ed846];return _0x567083;};'use strict';var multer=require(_0x2c80('0x0'));var util=require(_0x2c80('0x1'));var path=require(_0x2c80('0x2'));var timeout=require(_0x2c80('0x3'));var express=require(_0x2c80('0x4'));var router=express[_0x2c80('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2c80('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2c80('0x7'));var controller=require(_0x2c80('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2c80('0x9')]);router[_0x2c80('0xa')]('/describe',auth[_0x2c80('0xb')](),controller[_0x2c80('0xc')]);router[_0x2c80('0xa')]('/:id',auth[_0x2c80('0xb')](),controller[_0x2c80('0xd')]);router[_0x2c80('0xe')]('/',auth[_0x2c80('0xb')](),controller[_0x2c80('0xf')]);router[_0x2c80('0x10')]('/:id',auth[_0x2c80('0xb')](),controller[_0x2c80('0x11')]);router['delete'](_0x2c80('0x12'),auth['isAuthenticated'](),controller[_0x2c80('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 98c3114..b6b9047 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 _0x279a=['email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','star','input','name','text','getDataValue','onlineForm','parse','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x279a,0x1c7));var _0xa279=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x279a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa279('0x0'));module[_0xa279('0x1')]={'name':{'type':Sequelize[_0xa279('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa279('0x3')},'description':{'type':Sequelize[_0xa279('0x2')]},'mapKey':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x4')},'key':{'type':Sequelize[_0xa279('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x5')},'customerAlias':{'type':Sequelize[_0xa279('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa279('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa279('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa279('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa279('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xa279('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa279('0xa')]('rounded','squared'),'defaultValue':_0xa279('0xb')},'header_online':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0xc')},'start_chat_button':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa279('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa279('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xa279('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa279('0x10')]},'closingQuestion':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x13')},'noteTitle':{'type':Sequelize[_0xa279('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x14')},'closingMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa279('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x16')},'ratingType':{'type':Sequelize[_0xa279('0xa')]('star',_0xa279('0x17')),'defaultValue':_0xa279('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xa279('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa279('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa279('0x19'),'variable':null,'config':{'placeholder':_0xa279('0x1a'),'type':_0xa279('0x1b'),'required':!![]},'props':{'title':_0xa279('0x1a'),'helpText':''}},{'type':_0xa279('0x19'),'props':{'title':_0xa279('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa279('0x4'),'type':_0xa279('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa279('0x1c')](_0xa279('0x1d'))?JSON[_0xa279('0x1e')](this[_0xa279('0x1c')]('onlineForm')):{};},'set':function(_0x107f1f){return this['setDataValue']('onlineForm',JSON[_0xa279('0x1f')](_0x107f1f));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa279('0x1f')]({'items':[{'type':_0xa279('0x19'),'props':{'title':_0xa279('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa279('0x4'),'type':_0xa279('0x4')},'variable':null},{'type':_0xa279('0x20'),'config':{'placeholder':_0xa279('0x21')},'props':{'title':_0xa279('0x21'),'helpText':_0xa279('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xa279('0x1c')](_0xa279('0x23'))?JSON[_0xa279('0x1e')](this[_0xa279('0x1c')](_0xa279('0x23'))):{};},'set':function(_0x195659){return this['setDataValue'](_0xa279('0x23'),JSON['stringify'](_0x195659));}},'token':{'type':Sequelize[_0xa279('0x2')],'defaultValue':function(){return rs[_0xa279('0x24')]();}},'autoclose':{'type':Sequelize[_0xa279('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa279('0x2')]},'forwardOffline':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa279('0x2')]},'waitingTitle':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x25')},'waitingMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x27')},'offlineMessageBody':{'type':Sequelize[_0xa279('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xa279('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x28')},'skipUnmanaged':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x29')},'sendUnmanaged':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa279('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xa279('0x10')],'defaultValue':function(){return _0xa279('0x2a');}},'notificationSound':{'type':Sequelize[_0xa279('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa279('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa279('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xa279('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x2b')},'defaultTitle':{'type':Sequelize[_0xa279('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa279('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa279('0x2')],'allowNull':![],'defaultValue':_0xa279('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa279('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa279('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa279('0x8')],'comment':_0xa279('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa279('0x2f'),'set':function(_0x45a3c6){if(!_0x45a3c6)this[_0xa279('0x30')]('mandatoryDispositionPauseId',null);this[_0xa279('0x30')](_0xa279('0x31'),_0x45a3c6);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa279('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa279('0x2')],'allowNull':![],'defaultValue':_0xa279('0x32')},'vidaooNote':{'type':Sequelize[_0xa279('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa279('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa279('0x10')]}}; \ No newline at end of file +var _0xff02=['Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','onlineForm','getDataValue','textarea','Leave\x20your\x20comments','parse','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.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','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','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat'];(function(_0x1ac5e1,_0x43a483){var _0x3ae80e=function(_0x234518){while(--_0x234518){_0x1ac5e1['push'](_0x1ac5e1['shift']());}};_0x3ae80e(++_0x43a483);}(_0xff02,0x12f));var _0x2ff0=function(_0x2e4f74,_0x4c9771){_0x2e4f74=_0x2e4f74-0x0;var _0x2540c3=_0xff02[_0x2e4f74];return _0x2540c3;};'use strict';var Sequelize=require(_0x2ff0('0x0'));var rs=require(_0x2ff0('0x1'));module[_0x2ff0('0x2')]={'name':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'unique':_0x2ff0('0x4')},'description':{'type':Sequelize[_0x2ff0('0x3')]},'mapKey':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2ff0('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'defaultValue':_0x2ff0('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'defaultValue':_0x2ff0('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2ff0('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2ff0('0x3')]},'animation':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2ff0('0xb')](_0x2ff0('0xc'),'squared'),'defaultValue':_0x2ff0('0xc')},'header_online':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0xd')},'start_chat_button':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0xe')},'offline_chat_button':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0xf')},'header_offline':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x10')},'download_transcript':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x2ff0('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2ff0('0x12')]},'closingQuestion':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2ff0('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x14')},'noteTitle':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x15')},'placeholderMessage':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2ff0('0x17')},'closingMessageButton':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0xf')},'skipMessageButton':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x18')},'conditionAgreement':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x19')},'ratingType':{'type':Sequelize['ENUM'](_0x2ff0('0x1a'),_0x2ff0('0x1b')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2ff0('0x12')],'defaultValue':function(){return JSON[_0x2ff0('0x1c')]({'items':[{'type':_0x2ff0('0x1d'),'variable':null,'config':{'placeholder':_0x2ff0('0x1e'),'type':_0x2ff0('0x1f'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x2ff0('0x1d'),'props':{'title':_0x2ff0('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2ff0('0x5'),'type':_0x2ff0('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x2ff0('0x20'))?JSON['parse'](this[_0x2ff0('0x21')]('onlineForm')):{};},'set':function(_0x27e7c8){return this['setDataValue']('onlineForm',JSON[_0x2ff0('0x1c')](_0x27e7c8));}},'offlineForm':{'type':Sequelize[_0x2ff0('0x12')],'defaultValue':function(){return JSON[_0x2ff0('0x1c')]({'items':[{'type':_0x2ff0('0x1d'),'props':{'title':_0x2ff0('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2ff0('0x5'),'type':_0x2ff0('0x5')},'variable':null},{'type':_0x2ff0('0x22'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x2ff0('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x2ff0('0x21')]('offlineForm')?JSON[_0x2ff0('0x24')](this[_0x2ff0('0x21')](_0x2ff0('0x25'))):{};},'set':function(_0x5b8154){return this['setDataValue'](_0x2ff0('0x25'),JSON['stringify'](_0x5b8154));}},'token':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':function(){return rs[_0x2ff0('0x26')]();}},'autoclose':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2ff0('0x3')]},'waitingTitle':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x27')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2ff0('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x29')},'skipUnmanaged':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x18')},'sendUnmanaged':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2ff0('0x12')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2ff0('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2ff0('0x2a');}},'notificationSound':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x2ff0('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x2c')},'defaultTitle':{'type':Sequelize[_0x2ff0('0x3')]},'customerAvatar':{'type':Sequelize[_0x2ff0('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2ff0('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'defaultValue':_0x2ff0('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2ff0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2ff0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2ff0('0x9')],'comment':_0x2ff0('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![],'comment':_0x2ff0('0x30'),'set':function(_0xcf9a84){if(!_0xcf9a84)this[_0x2ff0('0x31')](_0x2ff0('0x32'),null);this[_0x2ff0('0x31')]('mandatoryDisposition',_0xcf9a84);}},'vidaooEscalation':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2ff0('0x3')]},'vidaooTopic':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'defaultValue':_0x2ff0('0x33')},'vidaooNote':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':function(){return _0x2ff0('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2ff0('0x12')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 238694b..a62ffaf 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 _0x85ce=['ids','addAnswer','CannedAnswer','rawAttributes','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','updatedAt','CompanyId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','defaults','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','files','no\x20available\x20attributes','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','server','attachments','basename','Attachment','bulkCreate','MailServerOut','forwardOffline','forwardOfflineAddress','service','Smtp','host','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','mimetype','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','offline-chat','addInteraction','getInteractions','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','render','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','Disposition','findOne','nolimit','ChatWebsiteId','include','findAll','removeDispositions'];(function(_0x1e1c3f,_0x34eedb){var _0x5c3a05=function(_0x1c756d){while(--_0x1c756d){_0x1e1c3f['push'](_0x1e1c3f['shift']());}};_0x5c3a05(++_0x34eedb);}(_0x85ce,0xc9));var _0xe85c=function(_0x3d6cb1,_0x5289ce){_0x3d6cb1=_0x3d6cb1-0x0;var _0x22f035=_0x85ce[_0x3d6cb1];return _0x22f035;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe85c('0x0'));var jsonpatch=require(_0xe85c('0x1'));var rp=require(_0xe85c('0x2'));var moment=require(_0xe85c('0x3'));var BPromise=require(_0xe85c('0x4'));var Mustache=require(_0xe85c('0x5'));var util=require(_0xe85c('0x6'));var path=require(_0xe85c('0x7'));var sox=require('sox');var csv=require(_0xe85c('0x8'));var ejs=require(_0xe85c('0x9'));var fs=require('fs');var fs_extra=require(_0xe85c('0xa'));var _=require(_0xe85c('0xb'));var squel=require('squel');var crypto=require(_0xe85c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe85c('0x8'));var querystring=require(_0xe85c('0xd'));var Papa=require(_0xe85c('0xe'));var Redis=require(_0xe85c('0xf'));var authService=require(_0xe85c('0x10'));var qs=require(_0xe85c('0x11'));var as=require(_0xe85c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe85c('0x13'));var utils=require(_0xe85c('0x14'));var config=require(_0xe85c('0x15'));var licenseUtil=require(_0xe85c('0x16'));var db=require(_0xe85c('0x17'))['db'];config['redis']=_['defaults'](config[_0xe85c('0x18')],{'host':_0xe85c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe85c('0x18')]));require('./chatWebsite.socket')[_0xe85c('0x1a')](socket);var jayson=require(_0xe85c('0x1b'));var client=jayson[_0xe85c('0x1c')][_0xe85c('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xe85c('0x1d')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xe85c('0x1c')][_0xe85c('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x5b25e1,_0x2ab2fe,_0x46f1b3,_0x1b7739){return new BPromise(function(_0x228664,_0x10c169){var _0x26337a=_0x1b7739||client;return _0x26337a[_0xe85c('0x1e')](_0x5b25e1,_0x46f1b3)[_0xe85c('0x1f')](function(_0x448412){logger['info'](_0xe85c('0x20'),_0x2ab2fe,_0xe85c('0x21'));logger[_0xe85c('0x22')](_0xe85c('0x23'),_0x2ab2fe,'request\x20sent',JSON['stringify'](_0x448412));if(_0x448412[_0xe85c('0x24')]){if(_0x448412[_0xe85c('0x24')][_0xe85c('0x25')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2ab2fe,_0x448412[_0xe85c('0x24')][_0xe85c('0x26')]);return _0x10c169(_0x448412[_0xe85c('0x24')][_0xe85c('0x26')]);}logger[_0xe85c('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x2ab2fe,_0x448412[_0xe85c('0x24')][_0xe85c('0x26')]);return _0x228664(_0x448412['error']['message']);}else{logger[_0xe85c('0x27')](_0xe85c('0x20'),_0x2ab2fe,_0xe85c('0x21'));_0x228664(_0x448412[_0xe85c('0x28')]['message']);}})[_0xe85c('0x29')](function(_0x55ebbc){logger[_0xe85c('0x24')](_0xe85c('0x20'),_0x2ab2fe,_0x55ebbc);_0x10c169(_0x55ebbc);});});}function respondWithStatusCode(_0x35fa41,_0x9c2fae){_0x9c2fae=_0x9c2fae||0xcc;return function(_0x1adb9d){if(_0x1adb9d){return _0x35fa41[_0xe85c('0x2a')](_0x9c2fae);}return _0x35fa41[_0xe85c('0x2b')](_0x9c2fae)[_0xe85c('0x2c')]();};}function respondWithResult(_0x139493,_0x31ef23){_0x31ef23=_0x31ef23||0xc8;return function(_0x17e5cb){if(_0x17e5cb){return _0x139493[_0xe85c('0x2b')](_0x31ef23)['json'](_0x17e5cb);}};}function respondWithFilteredResult(_0x155a7e,_0x5017ab){return function(_0x3467d0){if(_0x3467d0){var _0x26ecb3=typeof _0x5017ab['offset']===_0xe85c('0x2d')&&typeof _0x5017ab[_0xe85c('0x2e')]===_0xe85c('0x2d');var _0x4311db=_0x3467d0[_0xe85c('0x2f')];var _0x25fb88=_0x26ecb3?0x0:_0x5017ab[_0xe85c('0x30')];var _0xac67e6=_0x26ecb3?_0x3467d0[_0xe85c('0x2f')]:_0x5017ab[_0xe85c('0x30')]+_0x5017ab[_0xe85c('0x2e')];var _0x40ae74;if(_0xac67e6>=_0x4311db){_0xac67e6=_0x4311db;_0x40ae74=0xc8;}else{_0x40ae74=0xce;}_0x155a7e[_0xe85c('0x2b')](_0x40ae74);return _0x155a7e[_0xe85c('0x31')](_0xe85c('0x32'),_0x25fb88+'-'+_0xac67e6+'/'+_0x4311db)[_0xe85c('0x33')](_0x3467d0);}return null;};}function patchUpdates(_0x4ed158){return function(_0x22b1d2){try{jsonpatch[_0xe85c('0x34')](_0x22b1d2,_0x4ed158,!![]);}catch(_0x513e64){return BPromise['reject'](_0x513e64);}return _0x22b1d2[_0xe85c('0x35')]();};}function saveUpdates(_0x5a228a,_0x261bcc){return function(_0x8f39e6){if(_0x8f39e6){return _0x8f39e6['update'](_0x5a228a)[_0xe85c('0x1f')](function(_0x2f7ef1){return _0x2f7ef1;});}return null;};}function removeEntity(_0x5032da,_0x39e280){return function(_0x119884){if(_0x119884){return _0x119884[_0xe85c('0x36')]()[_0xe85c('0x1f')](function(){var _0x215639=_0x119884[_0xe85c('0x37')]({'plain':!![]});var _0x118528='ChatWebsites';return db[_0xe85c('0x38')][_0xe85c('0x36')]({'where':{'type':_0x118528,'resourceId':_0x215639['id']}})[_0xe85c('0x1f')](function(){return _0x119884;});})[_0xe85c('0x1f')](function(){_0x5032da[_0xe85c('0x2b')](0xcc)[_0xe85c('0x2c')]();});}};}function handleEntityNotFound(_0x3729cf,_0x5e56ae){return function(_0x12b901){if(!_0x12b901){_0x3729cf[_0xe85c('0x2a')](0x194);}return _0x12b901;};}function handleError(_0x478d06,_0x1003bf){_0x1003bf=_0x1003bf||0x1f4;return function(_0x175017){logger[_0xe85c('0x24')](_0x175017[_0xe85c('0x39')]);if(_0x175017[_0xe85c('0x3a')]){delete _0x175017[_0xe85c('0x3a')];}_0x478d06[_0xe85c('0x2b')](_0x1003bf)[_0xe85c('0x3b')](_0x175017);};}exports[_0xe85c('0x3c')]=function(_0x1d5374,_0x4d51d8){var _0xbdef2a={'include':[{'model':db[_0xe85c('0x3d')],'as':_0xe85c('0x3e')}]},_0xd67420={},_0x295b26={'count':0x0,'rows':[]};var _0x745a8f=_[_0xe85c('0x3f')](db[_0xe85c('0x40')]['rawAttributes'],function(_0x2d8d7e){return{'name':_0x2d8d7e[_0xe85c('0x41')],'type':_0x2d8d7e[_0xe85c('0x42')][_0xe85c('0x43')]};});_0xd67420[_0xe85c('0x44')]=_[_0xe85c('0x3f')](_0x745a8f,_0xe85c('0x3a'));_0xd67420['query']=_[_0xe85c('0x45')](_0x1d5374[_0xe85c('0x46')]);_0xd67420[_0xe85c('0x47')]=_['intersection'](_0xd67420['model'],_0xd67420[_0xe85c('0x46')]);_0xbdef2a['attributes']=_['intersection'](_0xd67420['model'],qs['fields'](_0x1d5374[_0xe85c('0x46')][_0xe85c('0x48')]));_0xbdef2a[_0xe85c('0x49')]=_0xbdef2a[_0xe85c('0x49')][_0xe85c('0x4a')]?_0xbdef2a['attributes']:_0xd67420[_0xe85c('0x44')];if(!_0x1d5374[_0xe85c('0x46')][_0xe85c('0x4b')]('nolimit')){_0xbdef2a[_0xe85c('0x2e')]=qs[_0xe85c('0x2e')](_0x1d5374['query'][_0xe85c('0x2e')]);_0xbdef2a[_0xe85c('0x30')]=qs['offset'](_0x1d5374[_0xe85c('0x46')]['offset']);}_0xbdef2a[_0xe85c('0x4c')]=qs[_0xe85c('0x4d')](_0x1d5374[_0xe85c('0x46')][_0xe85c('0x4d')]);_0xbdef2a['where']=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0x1d5374[_0xe85c('0x46')],_0xd67420[_0xe85c('0x47')]),_0x745a8f);if(_0x1d5374[_0xe85c('0x46')][_0xe85c('0x4f')]){_0xbdef2a[_0xe85c('0x50')]=_[_0xe85c('0x51')](_0xbdef2a['where'],{'$or':_[_0xe85c('0x3f')](_0x745a8f,function(_0x4c56fa){if(_0x4c56fa['type']!==_0xe85c('0x52')){var _0x105d46={};_0x105d46[_0x4c56fa[_0xe85c('0x3a')]]={'$like':'%'+_0x1d5374[_0xe85c('0x46')][_0xe85c('0x4f')]+'%'};return _0x105d46;}})});}_0xbdef2a=_[_0xe85c('0x51')]({},_0xbdef2a,_0x1d5374[_0xe85c('0x53')]);var _0x1e19be={'where':_0xbdef2a[_0xe85c('0x50')]};return db[_0xe85c('0x40')][_0xe85c('0x2f')](_0x1e19be)['then'](function(_0x33cb6c){_0x295b26[_0xe85c('0x2f')]=_0x33cb6c;if(_0x1d5374[_0xe85c('0x46')][_0xe85c('0x54')]){_0xbdef2a['include']=[{'all':!![]}];}return db[_0xe85c('0x40')]['findAll'](_0xbdef2a);})[_0xe85c('0x1f')](function(_0x412327){_0x295b26[_0xe85c('0x55')]=_0x412327;return _0x295b26;})[_0xe85c('0x1f')](respondWithFilteredResult(_0x4d51d8,_0xbdef2a))[_0xe85c('0x29')](handleError(_0x4d51d8,null));};exports[_0xe85c('0x56')]=function(_0x3e49d9,_0x5b2237){var _0x3351a8={'raw':![],'where':{'id':_0x3e49d9[_0xe85c('0x57')]['id']},'include':[{'model':db[_0xe85c('0x3d')],'as':_0xe85c('0x3e')}]},_0x25ea70={};_0x25ea70[_0xe85c('0x44')]=_[_0xe85c('0x45')](db['ChatWebsite']['rawAttributes']);_0x25ea70[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0x3e49d9[_0xe85c('0x46')]);_0x25ea70[_0xe85c('0x47')]=_['intersection'](_0x25ea70[_0xe85c('0x44')],_0x25ea70['query']);_0x3351a8[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x25ea70[_0xe85c('0x44')],qs[_0xe85c('0x48')](_0x3e49d9['query']['fields']));_0x3351a8[_0xe85c('0x49')]=_0x3351a8[_0xe85c('0x49')][_0xe85c('0x4a')]?_0x3351a8[_0xe85c('0x49')]:_0x25ea70[_0xe85c('0x44')];if(_0x3e49d9[_0xe85c('0x46')][_0xe85c('0x54')]){_0x3351a8['include']=[{'all':!![]}];}_0x3351a8=_[_0xe85c('0x51')]({},_0x3351a8,_0x3e49d9[_0xe85c('0x53')]);return db[_0xe85c('0x40')][_0xe85c('0x59')](_0x3351a8)['then'](handleEntityNotFound(_0x5b2237,null))['then'](respondWithResult(_0x5b2237,null))['catch'](handleError(_0x5b2237,null));};exports[_0xe85c('0x5a')]=function(_0x10d738,_0x2d41be){return db[_0xe85c('0x40')][_0xe85c('0x5a')](_0x10d738['body'],{})[_0xe85c('0x1f')](function(_0x4e8763){var _0x563408=_0x10d738[_0xe85c('0x5b')][_0xe85c('0x37')]({'plain':!![]});if(!_0x563408)throw new Error(_0xe85c('0x5c'));if(_0x563408[_0xe85c('0x5d')]===_0xe85c('0x5b')){var _0x374f2b=_0x4e8763['get']({'plain':!![]});var _0x48a7ab='ChatWebsites';return db[_0xe85c('0x5e')][_0xe85c('0x59')]({'where':{'name':_0x48a7ab,'userProfileId':_0x563408[_0xe85c('0x5f')]},'raw':!![]})[_0xe85c('0x1f')](function(_0x4e38eb){if(_0x4e38eb&&_0x4e38eb[_0xe85c('0x60')]===0x0){return db['UserProfileResource'][_0xe85c('0x5a')]({'name':_0x374f2b[_0xe85c('0x3a')],'resourceId':_0x374f2b['id'],'type':_0x4e38eb[_0xe85c('0x3a')],'sectionId':_0x4e38eb['id']},{})[_0xe85c('0x1f')](function(){return _0x4e8763;});}else{return _0x4e8763;}})['catch'](function(_0x4514e1){logger[_0xe85c('0x24')](_0xe85c('0x61'),_0x4514e1);throw _0x4514e1;});}return _0x4e8763;})['then'](respondWithResult(_0x2d41be,0xc9))[_0xe85c('0x29')](handleError(_0x2d41be,null));};exports[_0xe85c('0x62')]=function(_0x1f71f2,_0x5ef7ed){if(_0x1f71f2[_0xe85c('0x63')]['id']){delete _0x1f71f2[_0xe85c('0x63')]['id'];}return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x1f71f2[_0xe85c('0x57')]['id']},'include':[{'model':db[_0xe85c('0x3d')],'as':_0xe85c('0x3e')}]})['then'](handleEntityNotFound(_0x5ef7ed,null))['then'](saveUpdates(_0x1f71f2[_0xe85c('0x63')],null))[_0xe85c('0x1f')](respondWithResult(_0x5ef7ed,null))[_0xe85c('0x29')](handleError(_0x5ef7ed,null));};exports['destroy']=function(_0x1f32c5,_0x1398d9){return db['ChatWebsite'][_0xe85c('0x59')]({'where':{'id':_0x1f32c5[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x1398d9,null))[_0xe85c('0x1f')](removeEntity(_0x1398d9,null))[_0xe85c('0x29')](handleError(_0x1398d9,null));};exports[_0xe85c('0x64')]=function(_0x295eab,_0x488f89){return db[_0xe85c('0x40')][_0xe85c('0x64')]()['then'](respondWithResult(_0x488f89,null))['catch'](handleError(_0x488f89,null));};exports[_0xe85c('0x65')]=function(_0x2faf45,_0x71698c,_0xc6cb90){if(_0x2faf45[_0xe85c('0x63')]['id']){delete _0x2faf45[_0xe85c('0x63')]['id'];}return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x2faf45[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x71698c,null))['then'](function(_0x438f8f){if(_0x438f8f){_0x2faf45[_0xe85c('0x63')]['ChatWebsiteId']=_0x438f8f['id'];return db[_0xe85c('0x66')][_0xe85c('0x5a')](_0x2faf45['body']);}})[_0xe85c('0x1f')](respondWithResult(_0x71698c,null))[_0xe85c('0x29')](handleError(_0x71698c,null));};exports['getDispositions']=function(_0x492b05,_0x38eb12,_0x542e19){var _0xe91adc={'raw':![],'where':{}};var _0x553497={};var _0x551840={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe85c('0x67')]({'where':{'id':_0x492b05[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x38eb12,null))['then'](function(_0x3f0ef7){if(_0x3f0ef7){_0x553497['model']=_[_0xe85c('0x45')](db[_0xe85c('0x66')]['rawAttributes']);_0x553497[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0x492b05[_0xe85c('0x46')]);_0x553497['filters']=_[_0xe85c('0x58')](_0x553497[_0xe85c('0x44')],_0x553497['query']);_0xe91adc['attributes']=_[_0xe85c('0x58')](_0x553497[_0xe85c('0x44')],qs[_0xe85c('0x48')](_0x492b05['query'][_0xe85c('0x48')]));_0xe91adc[_0xe85c('0x49')]=_0xe91adc[_0xe85c('0x49')]['length']?_0xe91adc[_0xe85c('0x49')]:_0x553497[_0xe85c('0x44')];if(!_0x492b05['query'][_0xe85c('0x4b')](_0xe85c('0x68'))){_0xe91adc[_0xe85c('0x2e')]=qs['limit'](_0x492b05['query'][_0xe85c('0x2e')]);_0xe91adc[_0xe85c('0x30')]=qs[_0xe85c('0x30')](_0x492b05[_0xe85c('0x46')]['offset']);}_0xe91adc[_0xe85c('0x4c')]=qs[_0xe85c('0x4d')](_0x492b05[_0xe85c('0x46')][_0xe85c('0x4d')]);_0xe91adc[_0xe85c('0x50')]=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0x492b05[_0xe85c('0x46')],_0x553497[_0xe85c('0x47')]));_0xe91adc[_0xe85c('0x50')][_0xe85c('0x69')]=_0x3f0ef7['id'];if(_0x492b05[_0xe85c('0x46')][_0xe85c('0x4f')]){_0xe91adc[_0xe85c('0x50')]=_[_0xe85c('0x51')](_0xe91adc['where'],{'$or':_[_0xe85c('0x3f')](_0xe91adc[_0xe85c('0x49')],function(_0x3e62bf){var _0x3c9008={};_0x3c9008[_0x3e62bf]={'$like':'%'+_0x492b05['query'][_0xe85c('0x4f')]+'%'};return _0x3c9008;})});}_0xe91adc=_[_0xe85c('0x51')]({},_0xe91adc,_0x492b05['options']);return db['Disposition'][_0xe85c('0x2f')]({'where':_0xe91adc[_0xe85c('0x50')]})[_0xe85c('0x1f')](function(_0x127d28){_0x551840['count']=_0x127d28;if(_0x492b05[_0xe85c('0x46')][_0xe85c('0x54')]){_0xe91adc[_0xe85c('0x6a')]=[{'all':!![]}];}return db[_0xe85c('0x66')][_0xe85c('0x6b')](_0xe91adc);})['then'](function(_0x304e77){_0x551840[_0xe85c('0x55')]=_0x304e77;return _0x551840;});}})[_0xe85c('0x1f')](respondWithFilteredResult(_0x38eb12,_0xe91adc))[_0xe85c('0x29')](handleError(_0x38eb12,null));};exports[_0xe85c('0x6c')]=function(_0x4a9ea5,_0x3ec681,_0x19ed0a){return db['ChatWebsite'][_0xe85c('0x59')]({'where':{'id':_0x4a9ea5[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x3ec681,null))['then'](function(_0x5e4b7e){if(_0x5e4b7e){return _0x5e4b7e[_0xe85c('0x6c')](_0x4a9ea5[_0xe85c('0x46')][_0xe85c('0x6d')]);}})[_0xe85c('0x1f')](respondWithStatusCode(_0x3ec681,null))[_0xe85c('0x29')](handleError(_0x3ec681,null));};exports[_0xe85c('0x6e')]=function(_0x4377ca,_0x40209e,_0x34a7be){if(_0x4377ca[_0xe85c('0x63')]['id']){delete _0x4377ca['body']['id'];}return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x4377ca[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x40209e,null))[_0xe85c('0x1f')](function(_0xf26ec){if(_0xf26ec){_0x4377ca[_0xe85c('0x63')][_0xe85c('0x69')]=_0xf26ec['id'];return db['CannedAnswer'][_0xe85c('0x5a')](_0x4377ca[_0xe85c('0x63')]);}})['then'](respondWithResult(_0x40209e,null))[_0xe85c('0x29')](handleError(_0x40209e,null));};exports['getAnswers']=function(_0x3be416,_0xbc979,_0x494f4d){var _0xbfe396={'raw':![],'where':{}};var _0x1a2449={};var _0x55d4bb={'count':0x0,'rows':[]};return db[_0xe85c('0x40')]['findOne']({'where':{'id':_0x3be416[_0xe85c('0x57')]['id']}})['then'](handleEntityNotFound(_0xbc979,null))[_0xe85c('0x1f')](function(_0x5d6f03){if(_0x5d6f03){_0x1a2449[_0xe85c('0x44')]=_[_0xe85c('0x45')](db[_0xe85c('0x6f')][_0xe85c('0x70')]);_0x1a2449['query']=_[_0xe85c('0x45')](_0x3be416['query']);_0x1a2449[_0xe85c('0x47')]=_[_0xe85c('0x58')](_0x1a2449[_0xe85c('0x44')],_0x1a2449[_0xe85c('0x46')]);_0xbfe396['attributes']=_[_0xe85c('0x58')](_0x1a2449['model'],qs[_0xe85c('0x48')](_0x3be416[_0xe85c('0x46')][_0xe85c('0x48')]));_0xbfe396['attributes']=_0xbfe396[_0xe85c('0x49')]['length']?_0xbfe396[_0xe85c('0x49')]:_0x1a2449[_0xe85c('0x44')];if(!_0x3be416['query'][_0xe85c('0x4b')](_0xe85c('0x68'))){_0xbfe396['limit']=qs[_0xe85c('0x2e')](_0x3be416['query'][_0xe85c('0x2e')]);_0xbfe396[_0xe85c('0x30')]=qs[_0xe85c('0x30')](_0x3be416['query'][_0xe85c('0x30')]);}_0xbfe396['order']=qs[_0xe85c('0x4d')](_0x3be416[_0xe85c('0x46')]['sort']);_0xbfe396[_0xe85c('0x50')]=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0x3be416[_0xe85c('0x46')],_0x1a2449[_0xe85c('0x47')]));_0xbfe396[_0xe85c('0x50')]['ChatWebsiteId']=_0x5d6f03['id'];if(_0x3be416[_0xe85c('0x46')][_0xe85c('0x4f')]){_0xbfe396[_0xe85c('0x50')]=_[_0xe85c('0x51')](_0xbfe396[_0xe85c('0x50')],{'$or':_[_0xe85c('0x3f')](_0xbfe396[_0xe85c('0x49')],function(_0x4c9d24){var _0x4f92bf={};_0x4f92bf[_0x4c9d24]={'$like':'%'+_0x3be416[_0xe85c('0x46')][_0xe85c('0x4f')]+'%'};return _0x4f92bf;})});}_0xbfe396=_['merge']({},_0xbfe396,_0x3be416[_0xe85c('0x53')]);return db[_0xe85c('0x6f')]['count']({'where':_0xbfe396[_0xe85c('0x50')]})['then'](function(_0x27db95){_0x55d4bb[_0xe85c('0x2f')]=_0x27db95;if(_0x3be416[_0xe85c('0x46')][_0xe85c('0x54')]){_0xbfe396[_0xe85c('0x6a')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0xbfe396);})[_0xe85c('0x1f')](function(_0x195f33){_0x55d4bb[_0xe85c('0x55')]=_0x195f33;return _0x55d4bb;});}})[_0xe85c('0x1f')](respondWithFilteredResult(_0xbc979,_0xbfe396))[_0xe85c('0x29')](handleError(_0xbc979,null));};exports[_0xe85c('0x71')]=function(_0x2158c0,_0x34fa51,_0x1324d0){return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x2158c0[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x34fa51,null))['then'](function(_0x4107fd){if(_0x4107fd){return _0x4107fd[_0xe85c('0x71')](_0x2158c0[_0xe85c('0x46')][_0xe85c('0x6d')]);}})['then'](respondWithStatusCode(_0x34fa51,null))[_0xe85c('0x29')](handleError(_0x34fa51,null));};exports[_0xe85c('0x72')]=function(_0x1179b3,_0x38310f,_0x37a7de){_0x1179b3[_0xe85c('0x63')][_0xe85c('0x73')]=_0x1179b3[_0xe85c('0x74')][_0xe85c('0x75')];return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x1179b3[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x38310f,null))[_0xe85c('0x1f')](saveUpdates(_0x1179b3[_0xe85c('0x63')],null))['then'](respondWithResult(_0x38310f,null))[_0xe85c('0x29')](handleError(_0x38310f,null));};exports[_0xe85c('0x76')]=function(_0x5d7e5e,_0x2d965b,_0x4fe281){_0x5d7e5e['body']['agentAvatar']=_0x5d7e5e[_0xe85c('0x74')][_0xe85c('0x75')];return db[_0xe85c('0x40')]['find']({'where':{'id':_0x5d7e5e[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x2d965b,null))['then'](saveUpdates(_0x5d7e5e[_0xe85c('0x63')],null))[_0xe85c('0x1f')](respondWithResult(_0x2d965b,null))[_0xe85c('0x29')](handleError(_0x2d965b,null));};exports[_0xe85c('0x77')]=function(_0x526d53,_0x482687,_0x47028c){_0x526d53['body'][_0xe85c('0x78')]=_0x526d53[_0xe85c('0x74')][_0xe85c('0x75')];return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x526d53[_0xe85c('0x57')]['id']}})['then'](handleEntityNotFound(_0x482687,null))[_0xe85c('0x1f')](saveUpdates(_0x526d53[_0xe85c('0x63')],null))[_0xe85c('0x1f')](respondWithResult(_0x482687,null))[_0xe85c('0x29')](handleError(_0x482687,null));};exports[_0xe85c('0x79')]=function(_0x21fd27,_0x145961,_0x35a9cf){_0x21fd27[_0xe85c('0x63')][_0xe85c('0x7a')]=_0x21fd27['file']['filename'];return db['ChatWebsite'][_0xe85c('0x59')]({'where':{'id':_0x21fd27[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x145961,null))[_0xe85c('0x1f')](saveUpdates(_0x21fd27['body'],null))['then'](respondWithResult(_0x145961,null))[_0xe85c('0x29')](handleError(_0x145961,null));};exports[_0xe85c('0x7b')]=function(_0x26edbd,_0x453347,_0x44ef05){var _0x1bba0b=path[_0xe85c('0x7c')](config['root'],'server/files/images/logos/default_logo.svg');var _0x2db29b={'where':{'id':_0x26edbd[_0xe85c('0x57')]['id']},'attributes':['id',_0xe85c('0x73')],'raw':!![]};var _0x3ec763=![];return require(_0xe85c('0x16'))[_0xe85c('0x7d')]()[_0xe85c('0x1f')](function(_0x542ad8){if(_0x542ad8){_0x3ec763=_0x542ad8[_0xe85c('0x7e')];}})[_0xe85c('0x1f')](function(){return db['ChatWebsite']['find'](_0x2db29b);})[_0xe85c('0x1f')](handleEntityNotFound(_0x453347,null))[_0xe85c('0x1f')](function(_0xff8912){if(_0xff8912){if(!_[_0xe85c('0x7f')](_0xff8912[_0xe85c('0x73')])){if(fs[_0xe85c('0x80')](path[_0xe85c('0x7c')](config['root'],'server/files/images/logos/',_0xff8912[_0xe85c('0x73')]))&&_0x3ec763){_0x1bba0b=path['join'](config[_0xe85c('0x81')],_0xe85c('0x82'),_0xff8912[_0xe85c('0x73')]);}}return _0x453347[_0xe85c('0x83')](_0x1bba0b);}})['catch'](handleError(_0x453347,null));};exports[_0xe85c('0x84')]=function(_0x305428,_0x48a225,_0x5c6099){var _0x4dd6bd=path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x85'));var _0x1a6d3a={'where':{'id':_0x305428[_0xe85c('0x57')]['id']},'attributes':['id',_0xe85c('0x86')],'raw':!![]};return db[_0xe85c('0x40')][_0xe85c('0x59')](_0x1a6d3a)[_0xe85c('0x1f')](handleEntityNotFound(_0x48a225,null))[_0xe85c('0x1f')](function(_0x1cf380){if(_0x1cf380){if(!_[_0xe85c('0x7f')](_0x1cf380['agentAvatar'])){if(fs[_0xe85c('0x80')](path['join'](config[_0xe85c('0x81')],_0xe85c('0x87'),_0x1cf380[_0xe85c('0x86')]))){_0x4dd6bd=path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x87'),_0x1cf380[_0xe85c('0x86')]);}}return _0x48a225[_0xe85c('0x83')](_0x4dd6bd);}})[_0xe85c('0x29')](handleError(_0x48a225,null));};exports['getCustomerAvatar']=function(_0xf68d1a,_0x8480db,_0x3a3355){var _0x3b40f7=path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x88'));var _0x2624d5={'where':{'id':_0xf68d1a[_0xe85c('0x57')]['id']},'attributes':['id',_0xe85c('0x78'),'showCustomerAvatar'],'raw':!![]};return db[_0xe85c('0x40')][_0xe85c('0x59')](_0x2624d5)[_0xe85c('0x1f')](handleEntityNotFound(_0x8480db,null))['then'](function(_0x1b7e72){if(_0x1b7e72){if(!_['isNil'](_0x1b7e72[_0xe85c('0x78')])){if(fs['existsSync'](path[_0xe85c('0x7c')](config['root'],_0xe85c('0x87'),_0x1b7e72[_0xe85c('0x78')]))&&_0x1b7e72[_0xe85c('0x89')]){_0x3b40f7=path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x87'),_0x1b7e72['customerAvatar']);}}return _0x8480db[_0xe85c('0x83')](_0x3b40f7);}})['catch'](handleError(_0x8480db,null));};exports[_0xe85c('0x8a')]=function(_0x3b9d30,_0x3b3883,_0x5be7d6){var _0x38acc4=path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x8b'));var _0x386e24={'where':{'id':_0x3b9d30[_0xe85c('0x57')]['id']},'attributes':['id',_0xe85c('0x7a')],'raw':!![]};return db[_0xe85c('0x40')]['find'](_0x386e24)['then'](handleEntityNotFound(_0x3b3883,null))['then'](function(_0x3c829b){if(_0x3c829b){if(!_[_0xe85c('0x7f')](_0x3c829b[_0xe85c('0x7a')])){if(fs['existsSync'](path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x87'),_0x3c829b[_0xe85c('0x7a')]))){_0x38acc4=path[_0xe85c('0x7c')](config['root'],'server/files/images/avatars/',_0x3c829b['systemAvatar']);}}return _0x3b3883[_0xe85c('0x83')](_0x38acc4);}})[_0xe85c('0x29')](handleError(_0x3b3883,null));};exports[_0xe85c('0x8c')]=function(_0x2be5e1,_0x27da3c,_0x220086){var _0x393aed=require(_0xe85c('0x8d'));var _0x1d739a=new _0x393aed();var _0x319038=_0x1d739a[_0xe85c('0x8e')](_0x2be5e1[_0xe85c('0x8f')]['user-agent'])[_0xe85c('0x90')]();var _0x172a5a={'body':_0x2be5e1[_0xe85c('0x63')],'channel':_0xe85c('0x91')};var _0x232202=[];var _0x12c824=[];var _0x34c454={};var _0x1e64cb=![];return db[_0xe85c('0x92')][_0xe85c('0x64')]()[_0xe85c('0x1f')](function(_0x45647d){if(!_0x45647d){throw new db[(_0xe85c('0x93'))]['ValidationError']('no\x20available\x20attributes');}_0x232202=_['difference'](_['keys'](_0x45647d),['createdAt',_0xe85c('0x94')]);_0x12c824=_['difference'](_[_0xe85c('0x45')](_0x45647d),['createdAt','updatedAt',_0xe85c('0x95'),'ListId']);if(_0x2be5e1[_0xe85c('0x63')]['id']){delete _0x2be5e1[_0xe85c('0x63')]['id'];}if(_[_0xe85c('0x7f')](_0x2be5e1[_0xe85c('0x63')]['from'])){throw new db[(_0xe85c('0x93'))][(_0xe85c('0x96'))](_0xe85c('0x97'));}if(_[_0xe85c('0x7f')](_0x2be5e1[_0xe85c('0x63')]['body'])||_0x2be5e1[_0xe85c('0x63')]['body']===''){throw new db[(_0xe85c('0x93'))][(_0xe85c('0x96'))](_0xe85c('0x98'));}if(_[_0xe85c('0x7f')](_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x99')])){throw new db[(_0xe85c('0x93'))]['ValidationError'](_0xe85c('0x9a')+_0x12c824);}if(!_[_0xe85c('0x9b')](_0x12c824,_0x2be5e1[_0xe85c('0x63')]['mapKey'])){throw new db[(_0xe85c('0x93'))][(_0xe85c('0x96'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x12c824);}_0x34c454[_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x99')]]=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x9c')];})[_0xe85c('0x1f')](function(){return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x2be5e1[_0xe85c('0x57')]['id']},'include':[{'model':db[_0xe85c('0x9d')],'as':_0xe85c('0x9e'),'include':[{'model':db[_0xe85c('0x92')],'as':_0xe85c('0x9f'),'where':_0x34c454,'limit':0x1,'order':[[_0xe85c('0x94'),_0xe85c('0xa0')]]}]},{'model':db[_0xe85c('0xa1')],'as':_0xe85c('0xa2')}]});})[_0xe85c('0x1f')](handleEntityNotFound(_0x27da3c,null))[_0xe85c('0x1f')](function(_0x4f6081){if(_0x4f6081&&_0x4f6081[_0xe85c('0x9e')]){_0x172a5a[_0xe85c('0xa3')]=_0x4f6081;_0x172a5a[_0xe85c('0xa4')]=_0x4f6081[_0xe85c('0xa2')];_0x172a5a[_0xe85c('0xa5')]=_0x4f6081['List'];_0x172a5a[_0xe85c('0xa4')]=_[_0xe85c('0xa6')](_0x172a5a[_0xe85c('0xa4')],[_0xe85c('0xa7')],[_0xe85c('0xa8')]);if(_0x172a5a[_0xe85c('0xa3')][_0xe85c('0xa2')]){delete _0x172a5a[_0xe85c('0xa3')]['Applications'];}if(_0x172a5a[_0xe85c('0xa3')][_0xe85c('0x9e')]&&_0x172a5a['account']['List'][_0xe85c('0x9f')][_0xe85c('0x4a')]){return _0x172a5a[_0xe85c('0xa3')][_0xe85c('0x9e')][_0xe85c('0x9f')][0x0];}var _0x5536d9=_[_0xe85c('0xa9')](_0x2be5e1['body'],{'firstName':_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x9c')],'ListId':_0x4f6081[_0xe85c('0xaa')]});_0x5536d9[_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x99')]]=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x9c')];return db[_0xe85c('0x92')]['create'](_0x5536d9,{'fields':_0x232202,'raw':!![]});}})[_0xe85c('0x1f')](handleEntityNotFound(_0x27da3c,null))['then'](function(_0x339737){_0x172a5a['contact']=_0x339737;var _0x35006b=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xab')];if(_0x2be5e1[_0xe85c('0x8f')][_0xe85c('0xac')]){_0x35006b=_0x2be5e1[_0xe85c('0x8f')][_0xe85c('0xac')];}else if(_0x2be5e1['headers'][_0xe85c('0xad')]){_0x35006b=_[_0xe85c('0xae')](_0x2be5e1[_0xe85c('0x8f')][_0xe85c('0xad')][_0xe85c('0xaf')](','));}if(_0x339737){var _0x206a9f={'ContactId':_0x339737['id'],'ChatWebsiteId':_0x2be5e1[_0xe85c('0x57')]['id'],'from':(_0x339737[_0xe85c('0xb0')]||'')+'\x20'+(_0x339737[_0xe85c('0xb1')]||''),'customerIp':_0x35006b,'customerPort':_0x2be5e1[_0xe85c('0x8f')][_0xe85c('0xb2')]?_0x2be5e1[_0xe85c('0x8f')]['x-real-port']:null,'referer':_0x2be5e1[_0xe85c('0x63')]['referer'],'browserName':_0x319038[_0xe85c('0xb3')][_0xe85c('0x3a')]&&_0x319038[_0xe85c('0xb3')]['version']?util[_0xe85c('0xb4')](_0xe85c('0xb5'),_0x319038[_0xe85c('0xb3')][_0xe85c('0x3a')],_0x319038[_0xe85c('0xb3')][_0xe85c('0xb6')]):_0xe85c('0xb7'),'browserVersion':_0x319038[_0xe85c('0xb3')][_0xe85c('0xb6')]||_0xe85c('0xb7'),'osName':util[_0xe85c('0xb4')](_0xe85c('0xb5'),_0x319038['os'][_0xe85c('0x3a')],_0x319038['os'][_0xe85c('0xb6')]),'osVersion':_0x319038['os']['version'],'deviceModel':_0x319038[_0xe85c('0xb8')]['model']&&_0x319038['device'][_0xe85c('0xb9')]?util[_0xe85c('0xb4')](_0xe85c('0xba'),_0x319038[_0xe85c('0xb8')][_0xe85c('0x44')],_0x319038[_0xe85c('0xb8')][_0xe85c('0xb9')],_0x319038[_0xe85c('0xb8')][_0xe85c('0x42')]):null,'deviceVendor':_0x319038[_0xe85c('0xb8')][_0xe85c('0xb9')],'deviceType':_0x319038[_0xe85c('0xb8')][_0xe85c('0x42')],'formData':JSON[_0xe85c('0xbb')](_0x2be5e1[_0xe85c('0x63')])};var _0x96a093={'ChatWebsiteId':_0x2be5e1[_0xe85c('0x57')]['id'],'closed':![]};if(_0x2be5e1[_0xe85c('0x63')]['threadId']){_0x96a093[_0xe85c('0xbc')]=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xbc')];return db[_0xe85c('0xbd')]['find']({'where':_0x96a093})[_0xe85c('0x1f')](function(_0x5db680){if(_0x5db680){return[_0x5db680,![]];}_0x206a9f[_0xe85c('0xbc')]=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xbc')];_0x206a9f[_0xe85c('0xbe')]=_0x2be5e1[_0xe85c('0x63')]['externalUrl'];return db[_0xe85c('0xbd')][_0xe85c('0x5a')](_0x206a9f)['then'](function(_0x279a3f){return[_0x279a3f,!![]];});});}_0x96a093[_0xe85c('0xbf')]=_0x339737['id'];if(_0x2be5e1['body'][_0xe85c('0xc0')]&&_0x2be5e1[_0xe85c('0x63')]['interaction']['id']){_0x96a093['id']=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xc0')]['id'];return db['ChatInteraction']['find']({'where':_0x96a093})[_0xe85c('0x1f')](function(_0x2600cf){if(_0x2600cf){return[_0x2600cf,![]];}return db[_0xe85c('0xbd')][_0xe85c('0x5a')](_0x206a9f)[_0xe85c('0x1f')](function(_0x5d3038){return[_0x5d3038,!![]];});});}return db['ChatInteraction'][_0xe85c('0x5a')](_0x206a9f)['then'](function(_0x3dbdf8){return[_0x3dbdf8,!![]];});}})[_0xe85c('0xc1')](function(_0x4aabf1,_0x363542){if(_0x4aabf1){_0x1e64cb=_0x363542;if(!_0x363542){var _0x42bd3b={'from':(_0x172a5a[_0xe85c('0xc2')]['firstName']||'')+'\x20'+(_0x172a5a[_0xe85c('0xc2')]['lastName']||'')};if(_0x2be5e1[_0xe85c('0x63')]['threadId']&&_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xc3')]&&_0x2be5e1['body'][_0xe85c('0xbc')]!=_0x2be5e1[_0xe85c('0x63')]['messageId']){_0x42bd3b['threadId']=_0x2be5e1['body']['messageId'];}return _0x4aabf1[_0xe85c('0x62')](_0x42bd3b);}else{return _0x4aabf1;}}})[_0xe85c('0x1f')](function(_0x392f42){_0x172a5a[_0xe85c('0xc0')]=_0x392f42[_0xe85c('0x37')]({'plain':!![]});_0x172a5a['interaction'][_0xe85c('0xc4')]=_0x1e64cb;if(_0x172a5a[_0xe85c('0xc0')][_0xe85c('0xc4')]){if(_0x172a5a['account']['autoclose']){_0x172a5a[_0xe85c('0xa4')][_0xe85c('0xc5')]({'id':0x0,'priority':_0x172a5a[_0xe85c('0xa4')][_0xe85c('0x4a')]+0x1,'app':_0xe85c('0xc6'),'appdata':_0xe85c('0xc7'),'interval':_0xe85c('0xc8')});}}return db[_0xe85c('0xc9')][_0xe85c('0x5a')]({'body':_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x63')],'ChatWebsiteId':_0x2be5e1['params']['id'],'ChatInteractionId':_0x392f42['id'],'direction':'in','ContactId':_0x172a5a[_0xe85c('0xc2')]['id'],'AttachmentId':_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xca')]});})[_0xe85c('0x1f')](function(_0x1db627){_0x172a5a['message']=_0x1db627;if(_0x172a5a['interaction'][_0xe85c('0xcb')]){return db[_0xe85c('0xcc')][_0xe85c('0x59')]({'attributes':['id',_0xe85c('0x3a')],'where':{'id':_0x172a5a[_0xe85c('0xc0')][_0xe85c('0xcb')]}})[_0xe85c('0x1f')](function(_0x4033ee){if(_0x4033ee){_0x172a5a['applications'][_0xe85c('0xcd')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4033ee[_0xe85c('0x3a')]+','+(_0x172a5a[_0xe85c('0xa3')][_0xe85c('0xce')]||0xa),'interval':_0xe85c('0xc8')});_0x172a5a[_0xe85c('0xcf')]=!![];}return respondWithRpcPromise('Start',_0xe85c('0xd0'),_0x172a5a);});}return respondWithRpcPromise('Start','startRouting',_0x172a5a);})[_0xe85c('0x1f')](function(_0x4ff4ee){respondWithRpcPromise(_0xe85c('0xd1'),_0xe85c('0xd1'),{'event':_0xe85c('0x8c'),'message':_0x4ff4ee},client9002);return _0x4ff4ee;})['then'](respondWithResult(_0x27da3c,null))['catch'](handleError(_0x27da3c,null));};exports[_0xe85c('0xd2')]=function(_0x381e05,_0x1965b6,_0x38247e){var _0x6d43a8,_0x47d9d8,_0x28ba90;var _0xac82b6=[];var _0x3d7bb6=[];var _0x39f10a={};var _0x2b9905=_0x381e05[_0xe85c('0xd3')]||[];var _0x4ae76c=[];var _0x3c66e6;return db[_0xe85c('0x92')][_0xe85c('0x64')]()[_0xe85c('0x1f')](function(_0x17140e){if(!_0x17140e){throw new db['Sequelize']['ValidationError'](_0xe85c('0xd4'));}_0x3d7bb6=_['difference'](_[_0xe85c('0x45')](_0x17140e),[_0xe85c('0xd5'),_0xe85c('0x94')]);_0xac82b6=_['difference'](_[_0xe85c('0x45')](_0x17140e),[_0xe85c('0xd5'),_0xe85c('0x94'),_0xe85c('0x95'),_0xe85c('0xaa')]);if(_0x381e05[_0xe85c('0x63')]['id']){delete _0x381e05[_0xe85c('0x63')]['id'];}if(_[_0xe85c('0x7f')](_0x381e05[_0xe85c('0x63')]['from'])){throw _0x1965b6[_0xe85c('0x2b')](0x1f4)[_0xe85c('0x3b')](new db['Sequelize']['ValidationError'](_0xe85c('0x97')));}if(_[_0xe85c('0x7f')](_0x381e05['body'][_0xe85c('0x63')])||_0x381e05['body'][_0xe85c('0x63')]===''){throw _0x1965b6[_0xe85c('0x2b')](0x1f4)[_0xe85c('0x3b')](new db[(_0xe85c('0x93'))][(_0xe85c('0x96'))](_0xe85c('0x98')));}if(_[_0xe85c('0x7f')](_0x381e05[_0xe85c('0x63')][_0xe85c('0xd6')])){throw _0x1965b6[_0xe85c('0x2b')](0x1f4)[_0xe85c('0x3b')](new db['Sequelize']['ValidationError'](_0xe85c('0xd7')+_0xac82b6));}if(!_['includes'](_0xac82b6,_0x381e05['body'][_0xe85c('0xd6')])){throw _0x1965b6[_0xe85c('0x2b')](0x1f4)['send'](new db[(_0xe85c('0x93'))][(_0xe85c('0x96'))](_0xe85c('0xd8')+_0xac82b6));}_0x39f10a[_0x381e05[_0xe85c('0x63')][_0xe85c('0xd6')]]=_0x381e05[_0xe85c('0x63')]['from'];})[_0xe85c('0x1f')](function(){return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x381e05['params']['id']},'include':[{'model':db[_0xe85c('0x9d')],'as':_0xe85c('0x9e')},{'model':db['MailAccount'],'as':_0xe85c('0xd9')}]});})[_0xe85c('0x1f')](handleEntityNotFound(_0x1965b6,null))['then'](function(_0x1d9217){if(_0x1d9217&&_0x1d9217['List']){_0x47d9d8=_0x1d9217;var _0x1a6a3a=_[_0xe85c('0xa9')](_0x381e05[_0xe85c('0x63')],{'firstName':_0x381e05['body']['from'],'phone':_0x381e05[_0xe85c('0x63')][_0xe85c('0x9c')],'ListId':_0x1d9217[_0xe85c('0xaa')]});_0x1a6a3a[_0x381e05[_0xe85c('0x63')][_0xe85c('0xd6')]]=_0x381e05[_0xe85c('0x63')]['from'];return db[_0xe85c('0x92')][_0xe85c('0xda')]({'where':_0x39f10a,'defaults':_0x1a6a3a});}})[_0xe85c('0xc1')](function(_0x5017ea){if(_0x5017ea){_0x28ba90=_0x5017ea;var _0x1b6929=fs['readFileSync'](path['join'](config[_0xe85c('0x81')],_0xe85c('0xdb')),_0xe85c('0xdc'));var _0x147780=ejs['render'](_0x1b6929,{'body':_[_0xe85c('0xdd')](_0x381e05[_0xe85c('0x63')]['body']),'bodyTitle':_0x47d9d8[_0xe85c('0xde')]});return db[_0xe85c('0xdf')][_0xe85c('0x5a')]({'body':_0x147780,'ContactId':_0x5017ea['id'],'ChatWebsiteId':_0x47d9d8['id']});}})[_0xe85c('0x1f')](function(_0x4699ea){_0x3c66e6=_0x4699ea;if(_0x2b9905['length']){var _0x38d9b7=_0x2b9905['map'](function(_0x34cb32){return{'name':_0x34cb32['originalname'],'basename':_0x34cb32[_0xe85c('0x75')],'type':_0x34cb32['mimetype'],'ChatOfflineMessageId':_0x4699ea['id']};});_0x4ae76c=_0x38d9b7[_0xe85c('0x3f')](_0x2e539d=>{var _0x17e807={'filename':_0x2e539d['name'],'path':path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0xe0'),'files',_0xe85c('0xe1'),'offline-chat',_0x2e539d[_0xe85c('0xe2')])};return _0x17e807;});if(!_0x47d9d8['openNewInteraction']){return db['sequelize']['transaction'](function(_0x201738){return db[_0xe85c('0xe3')][_0xe85c('0xe4')](_0x38d9b7,{'transaction':_0x201738});});}}})[_0xe85c('0x1f')](function(){if(_0x3c66e6){_0x6d43a8=_0x3c66e6;return db[_0xe85c('0xd9')][_0xe85c('0x67')]({'where':{'active':!![]},'include':[{'model':db[_0xe85c('0xe5')],'as':'Smtp','raw':!![]}]});}})[_0xe85c('0x1f')](function(_0x18872c){if(_0x18872c&&_0x18872c['Smtp']&&_0x47d9d8[_0xe85c('0xe6')]&&_0x47d9d8[_0xe85c('0xe7')]){var _0x32faa2={'tls':{'rejectUnauthorized':![]}};if(_0x18872c['Smtp'][_0xe85c('0xe8')]){_0x32faa2[_0xe85c('0xe8')]=_0x18872c[_0xe85c('0xe9')]['service'];}else{_0x32faa2['host']=_0x18872c['Smtp'][_0xe85c('0xea')];_0x32faa2['port']=_0x18872c[_0xe85c('0xe9')]['port'];_0x32faa2[_0xe85c('0xeb')]=_0x18872c[_0xe85c('0xe9')][_0xe85c('0xeb')];}if(_0x18872c['Smtp'][_0xe85c('0xec')]){_0x32faa2['auth']={'user':_0x18872c[_0xe85c('0xe9')]['user'],'pass':_0x18872c[_0xe85c('0xe9')]['pass']};}return respondWithRpcPromise(_0xe85c('0xed'),_0xe85c('0xee'),{'account':_0x32faa2,'message':{'from':util[_0xe85c('0xb4')](_0xe85c('0xef'),_0x18872c[_0xe85c('0x3a')],_0x18872c[_0xe85c('0xf0')]||_0x18872c[_0xe85c('0xe9')]['user']),'to':_0x47d9d8['forwardOfflineAddress'],'subject':_0x47d9d8[_0xe85c('0xf1')],'html':_0x6d43a8['body'],'attachments':_0x4ae76c}},client9003)[_0xe85c('0x1f')](function(){return _0x6d43a8;})[_0xe85c('0x29')](function(_0x2c229b){console['error'](_0x2c229b);});}})[_0xe85c('0x1f')](function(){if(_0x47d9d8&&_0x47d9d8[_0xe85c('0xf2')]&&_0x47d9d8['MailAccountId']){var _0x46ea8b=[];if(_0x2b9905['length']){_0x46ea8b=_0x2b9905[_0xe85c('0x3f')](function(_0x3c7df5){return{'name':_0x3c7df5['originalname'],'basename':_0x3c7df5[_0xe85c('0x75')],'type':_0x3c7df5[_0xe85c('0xf3')],'ChatOfflineMessageId':_0x3c66e6['id']};});}var _0x5b625a;if(!_['isNil'](_0x47d9d8[_0xe85c('0xf4')])){var _0x22a38d=_[_0xe85c('0x3f')](_0x381e05[_0xe85c('0x63')],function(_0x35f94f){return _0x35f94f;});var _0x516fa0=_[_0xe85c('0xf5')](_0x22a38d)[0x0];var _0x223136=_[_0xe85c('0xf6')](_0x516fa0,function(_0x374ddc){return _0x374ddc;});_0x5b625a=_0x223136[0x1][_0x47d9d8[_0xe85c('0xf4')]];}var _0x28d6e2={'from':_0x28ba90[_0xe85c('0xf0')],'firstName':_0x28ba90['firstName'],'lastName':_0x28ba90[_0xe85c('0xb1')],'mapKey':'email','message':{'from':_0x28ba90[_0xe85c('0xf0')],'to':_0x47d9d8[_0xe85c('0xd9')][_0xe85c('0xf0')],'cc':'','subject':_['isNil'](_0x5b625a)?_0x47d9d8['offlineMessageSubject']:_0x5b625a,'messageId':'','sentAt':new Date(),'attach':_0x46ea8b[_0xe85c('0x4a')],'attachments':_0x46ea8b,'originChannel':'Chat','ChatWebsiteId':_0x47d9d8['id'],'ChatOfflineMessageId':_0x6d43a8['id'],'originTo':_0x47d9d8[_0xe85c('0xd9')][_0xe85c('0xf0')]},'body':_0x6d43a8['body']};var _0x1064b6={'account':{'id':_0x47d9d8['MailAccountId']},'body':_0x28d6e2,'log':_0xe85c('0xf7')};return respondWithRpcPromise(_0xe85c('0xf7'),_0xe85c('0xf8'),_0x1064b6,client9001)[_0xe85c('0x1f')](function(){return _0x6d43a8;})[_0xe85c('0x29')](function(_0x489ff3){console[_0xe85c('0x24')](_0x489ff3);});}return;})[_0xe85c('0x1f')](function(){if(_0x6d43a8){return _0x6d43a8;}})['then'](respondWithResult(_0x1965b6,null))[_0xe85c('0x29')](function(_0x4cf739){console[_0xe85c('0x24')](_0xe85c('0x29'),_0x4cf739);for(var _0x665f87 of _0x2b9905){var _0x28e438=path[_0xe85c('0x7c')](config['root'],_0xe85c('0xe0'),_0xe85c('0xd3'),_0xe85c('0xe1'),_0xe85c('0xf9'),_0x665f87[_0xe85c('0x75')]);fs_extra['remove'](_0x28e438)[_0xe85c('0x29')](function(_0x3f5f0d){console['error']('Could\x20not\x20remove\x20attachment\x20file',_0x28e438,_0x3f5f0d);});}});};exports[_0xe85c('0xfa')]=function(_0x49951a,_0x38f6a0,_0x1aef3a){return db[_0xe85c('0xbd')][_0xe85c('0x59')]({'where':{'id':_0x49951a[_0xe85c('0x57')]['id']}})['then'](handleEntityNotFound(_0x38f6a0,null))[_0xe85c('0x1f')](function(_0x1acd44){if(_0x1acd44){return _0x1acd44[_0xe85c('0xfa')](_0x49951a[_0xe85c('0x63')]['ids'],_['omit'](_0x49951a[_0xe85c('0x63')],['ids','id'])||{});}})[_0xe85c('0x1f')](respondWithResult(_0x38f6a0,null))[_0xe85c('0x29')](handleError(_0x38f6a0,null));};exports[_0xe85c('0xfb')]=function(_0x2b3249,_0x53d00d,_0xa79fad){var _0x13c32d={'raw':![],'where':{}};var _0x560a3b={};var _0x20107d={'count':0x0,'rows':[]};return db[_0xe85c('0x40')]['findOne']({'where':{'id':_0x2b3249[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x53d00d,null))[_0xe85c('0x1f')](function(_0x46dc23){if(_0x46dc23){_0x560a3b[_0xe85c('0x44')]=_['keys'](db[_0xe85c('0xbd')][_0xe85c('0x70')]);_0x560a3b[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0x2b3249['query']);_0x560a3b['filters']=_['intersection'](_0x560a3b['model'],_0x560a3b[_0xe85c('0x46')]);_0x13c32d[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x560a3b[_0xe85c('0x44')],qs[_0xe85c('0x48')](_0x2b3249['query'][_0xe85c('0x48')]));_0x13c32d['attributes']=_0x13c32d[_0xe85c('0x49')][_0xe85c('0x4a')]?_0x13c32d[_0xe85c('0x49')]:_0x560a3b[_0xe85c('0x44')];if(!_0x2b3249[_0xe85c('0x46')][_0xe85c('0x4b')]('nolimit')){_0x13c32d[_0xe85c('0x2e')]=qs[_0xe85c('0x2e')](_0x2b3249[_0xe85c('0x46')][_0xe85c('0x2e')]);_0x13c32d['offset']=qs['offset'](_0x2b3249['query'][_0xe85c('0x30')]);}_0x13c32d[_0xe85c('0x4c')]=qs[_0xe85c('0x4d')](_0x2b3249[_0xe85c('0x46')][_0xe85c('0x4d')]);_0x13c32d[_0xe85c('0x50')]=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0x2b3249['query'],_0x560a3b['filters']));_0x13c32d[_0xe85c('0x50')][_0xe85c('0x69')]=_0x46dc23['id'];if(_0x2b3249[_0xe85c('0x46')][_0xe85c('0x4f')]){_0x13c32d[_0xe85c('0x50')]=_['merge'](_0x13c32d[_0xe85c('0x50')],{'$or':_['map'](_0x13c32d[_0xe85c('0x49')],function(_0x128883){var _0x178ef7={};_0x178ef7[_0x128883]={'$like':'%'+_0x2b3249['query']['filter']+'%'};return _0x178ef7;})});}_0x13c32d=_[_0xe85c('0x51')]({},_0x13c32d,_0x2b3249['options']);return db['ChatInteraction'][_0xe85c('0x2f')]({'where':_0x13c32d['where']})['then'](function(_0x5acea6){_0x20107d['count']=_0x5acea6;if(_0x2b3249['query'][_0xe85c('0x54')]){_0x13c32d['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xe85c('0xcc')],'as':_0xe85c('0xfc'),'attributes':[_0xe85c('0x3a'),_0xe85c('0xfd'),_0xe85c('0xfe')],'required':![]},{'model':db['Tag'],'as':_0xe85c('0xff'),'attributes':['id',_0xe85c('0x3a'),_0xe85c('0x100')],'where':_0x2b3249[_0xe85c('0x46')][_0xe85c('0x101')]?{'id':_0x2b3249[_0xe85c('0x46')][_0xe85c('0x101')]}:undefined,'required':_0x2b3249[_0xe85c('0x46')][_0xe85c('0x101')]?!![]:![]}];}return db[_0xe85c('0xbd')][_0xe85c('0x6b')](_0x13c32d);})['then'](function(_0x15cda6){_0x20107d[_0xe85c('0x55')]=_0x15cda6;return _0x20107d;});}})[_0xe85c('0x1f')](respondWithFilteredResult(_0x53d00d,_0x13c32d))[_0xe85c('0x29')](handleError(_0x53d00d,null));};function iftimePromise(_0x8fac35,_0x408880){return respondWithRpcPromise(_0xe85c('0x102'),_0xe85c('0x103'),{'command':_0x408880[_0xe85c('0x104')]?util[_0xe85c('0xb4')](_0xe85c('0x105'),_0x8fac35[_0xe85c('0x106')],_0x408880['timezone']):util[_0xe85c('0xb4')](_0xe85c('0x107'),_0x8fac35[_0xe85c('0x106')])},client9002)[_0xe85c('0x1f')](function(_0x1676ab){var _0x55a9c7=_0x1676ab&&_0x1676ab[_0xe85c('0x108')](_0xe85c('0x109'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x408880['id'],_0x8fac35['id'],_0x8fac35[_0xe85c('0x106')],_0x55a9c7?_0xe85c('0x10a'):_0xe85c('0x10b'),_0x408880[_0xe85c('0x104')]?_0x408880[_0xe85c('0x104')]:_0xe85c('0x10c'));return _0x55a9c7;})[_0xe85c('0x29')](function(_0x132db6){logger[_0xe85c('0x24')](_0xe85c('0x10d'),_0x408880['id'],_0x8fac35['id'],_0x8fac35['interval'],util[_0xe85c('0x10e')](_0x132db6,{'showHidden':![],'depth':null}),_0x408880[_0xe85c('0x104')]?_0x408880[_0xe85c('0x104')]:_0xe85c('0x10c'));return![];});}exports['getSnippet']=function(_0x3db119,_0x188d56,_0x7b648a){var _0x34560f=0x0;var _0x1488b1=0x0;var _0x391821=![];var _0x808e5;var _0xe8aeaf;return db['ChatWebsite']['find']({'where':{'id':_0x3db119['params']['id']},'include':[{'model':db['Interval'],'as':_0xe85c('0x10f'),'include':[{'model':db[_0xe85c('0x10f')],'as':_0xe85c('0x110'),'attributes':['id',_0xe85c('0x106')],'raw':!![]}]}]})[_0xe85c('0x1f')](handleEntityNotFound(_0x188d56,null))[_0xe85c('0x1f')](function(_0x418165){if(_0x418165){_0x808e5=_0x418165;return _0x418165[_0xe85c('0x111')]({'raw':!![]});}})['then'](function(_0x1b0ff9){if(_0x808e5){if(_0x1b0ff9){_0xe8aeaf=_0x1b0ff9;}}return require(_0xe85c('0x16'))[_0xe85c('0x7d')]();})[_0xe85c('0x1f')](function(_0x871ee1){if(_0x871ee1){_0x1488b1=_0x871ee1[_0xe85c('0x112')];_0x391821=_0x871ee1[_0xe85c('0x7e')];}})[_0xe85c('0x1f')](function(){return db[_0xe85c('0xbd')][_0xe85c('0x2f')]({'where':{'closed':![]}});})[_0xe85c('0x1f')](function(_0x1c1204){_0x34560f=_0x1c1204;if(_0x1488b1&&_0x1c1204>_0x1488b1){return db[_0xe85c('0x113')][_0xe85c('0x67')]({'where':{'id':0x1}})['then'](function(_0x42ec17){if(_0x42ec17){_0x42ec17[_0xe85c('0x114')](_0xe85c('0x115'));}});}})[_0xe85c('0x1f')](function(){if(_0x808e5[_0xe85c('0x10f')]&&_0x808e5['Interval'][_0xe85c('0x110')]){var _0x31fa39=[];for(var _0x53dc5c=0x0;_0x53dc5c<_0x808e5[_0xe85c('0x10f')][_0xe85c('0x110')][_0xe85c('0x4a')];_0x53dc5c++){var _0x3e1bb1=_0x808e5[_0xe85c('0x10f')][_0xe85c('0x110')][_0x53dc5c]['get']({'plain':!![]});_0x31fa39[_0xe85c('0xc5')](iftimePromise(_0x3e1bb1,_0x808e5));}return BPromise['all'](_0x31fa39)['then'](function(_0x44c205){return _[_0xe85c('0x116')](_0x44c205);});}else{return!![];}})[_0xe85c('0x1f')](function(_0x3e6cff){var _0x33166f=fs[_0xe85c('0x117')](path['join'](config[_0xe85c('0x81')],_0xe85c('0x118')),_0xe85c('0xdc'));var _0x5f05d1={'remote':_0x808e5[_0xe85c('0x119')],'query':querystring[_0xe85c('0xbb')](_[_0xe85c('0x51')](_0x808e5[_0xe85c('0x37')]({'plain':!![]}),{'customerIp':_0x3db119[_0xe85c('0x8f')][_0xe85c('0xad')]||_0x3db119[_0xe85c('0x8f')][_0xe85c('0x11a')]||_0x3db119[_0xe85c('0x11b')][_0xe85c('0x11c')]||_0x3db119['ip'],'referer':_0x3db119['headers'][_0xe85c('0x11d')],'openedInteractions':_0x34560f,'maxInteractions':_0x1488b1,'virtual':_0x391821[_0xe85c('0x112')],'online':_0x3e6cff,'custom':_0x391821}))['replace'](/'/g,'\x5c\x27')};_0x188d56[_0xe85c('0x3b')](ejs[_0xe85c('0x11e')](Mustache[_0xe85c('0x11e')](_0x33166f,_0x5f05d1),{'proactiveActions':_0xe8aeaf,'alignment':_0x808e5['alignment'],'verticalAlignment':_0x808e5['verticalAlignment'],'div_color':_0x808e5[_0xe85c('0x100')],'text_color':_0x808e5['textColor'],'button_color':_0x808e5[_0xe85c('0x11f')],'background_color':_0x808e5[_0xe85c('0x120')]}));})[_0xe85c('0x29')](handleError(_0x188d56,null));};exports[_0xe85c('0x121')]=function(_0x3cc04b,_0x2906cd,_0x22eb49){return db[_0xe85c('0x40')][_0xe85c('0x67')]({'where':{'id':_0x3cc04b['params']['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x2906cd,null))[_0xe85c('0x1f')](function(_0x5afbe3){if(_0x5afbe3){return db['sequelize']['transaction'](function(_0x3172b7){return db[_0xe85c('0xa1')][_0xe85c('0x36')]({'where':{'ChatWebsiteId':_0x3cc04b[_0xe85c('0x57')]['id']},'transaction':_0x3172b7})[_0xe85c('0x1f')](function(_0x1b3bfa){var _0x563a7f=_[_0xe85c('0x3f')](_0x3cc04b[_0xe85c('0x63')],function(_0x441eb8){_0x441eb8[_0xe85c('0x69')]=_0x3cc04b[_0xe85c('0x57')]['id'];return _0x441eb8;});return db[_0xe85c('0xa1')]['bulkCreate'](_0x563a7f,{'transaction':_0x3172b7});});})['then'](function(){return db[_0xe85c('0xa1')][_0xe85c('0x122')]({'where':{'ChatWebsiteId':_0x3cc04b['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x2906cd,null))[_0xe85c('0x29')](handleError(_0x2906cd,null));};exports[_0xe85c('0x123')]=function(_0xcdbab9,_0x42394d,_0x3ec2c4){var _0x5d949c={};var _0x2e4e0d={};var _0x585942;var _0x11072e;return db[_0xe85c('0x40')][_0xe85c('0x67')]({'where':{'id':_0xcdbab9[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x42394d,null))[_0xe85c('0x1f')](function(_0x236f75){if(_0x236f75){_0x585942=_0x236f75;_0x2e4e0d[_0xe85c('0x44')]=_[_0xe85c('0x45')](db['ChatApplication']['rawAttributes']);_0x2e4e0d[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0xcdbab9['query']);_0x2e4e0d[_0xe85c('0x47')]=_[_0xe85c('0x58')](_0x2e4e0d['model'],_0x2e4e0d[_0xe85c('0x46')]);_0x5d949c[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x2e4e0d[_0xe85c('0x44')],qs['fields'](_0xcdbab9['query'][_0xe85c('0x48')]));_0x5d949c['attributes']=_0x5d949c[_0xe85c('0x49')][_0xe85c('0x4a')]?_0x5d949c[_0xe85c('0x49')]:_0x2e4e0d[_0xe85c('0x44')];_0x5d949c[_0xe85c('0x4c')]=qs[_0xe85c('0x4d')](_0xcdbab9[_0xe85c('0x46')]['sort']);_0x5d949c[_0xe85c('0x50')]=qs['filters'](_[_0xe85c('0x4e')](_0xcdbab9[_0xe85c('0x46')],_0x2e4e0d[_0xe85c('0x47')]));if(_0xcdbab9[_0xe85c('0x46')][_0xe85c('0x4f')]){_0x5d949c['where']=_[_0xe85c('0x51')](_0x5d949c[_0xe85c('0x50')],{'$or':_['map'](_0x5d949c[_0xe85c('0x49')],function(_0x271004){var _0xd8b449={};_0xd8b449[_0x271004]={'$like':'%'+_0xcdbab9[_0xe85c('0x46')]['filter']+'%'};return _0xd8b449;})});}_0x5d949c=_['merge']({},_0x5d949c,_0xcdbab9['options']);return _0x585942[_0xe85c('0x123')](_0x5d949c);}})[_0xe85c('0x1f')](function(_0x1139ce){if(_0x1139ce){_0x11072e=_0x1139ce[_0xe85c('0x4a')];if(!_0xcdbab9[_0xe85c('0x46')]['hasOwnProperty']('nolimit')){_0x5d949c[_0xe85c('0x2e')]=qs[_0xe85c('0x2e')](_0xcdbab9['query'][_0xe85c('0x2e')]);_0x5d949c['offset']=qs[_0xe85c('0x30')](_0xcdbab9[_0xe85c('0x46')]['offset']);}return _0x585942[_0xe85c('0x123')](_0x5d949c);}})['then'](function(_0x4f1ad8){if(_0x4f1ad8){return _0x4f1ad8?{'count':_0x11072e,'rows':_0x4f1ad8}:null;}})[_0xe85c('0x1f')](respondWithResult(_0x42394d,null))[_0xe85c('0x29')](handleError(_0x42394d,null));};exports[_0xe85c('0x124')]=function(_0x54d2aa,_0xaab4de,_0x460e37){return db[_0xe85c('0x125')][_0xe85c('0x59')]({'where':{'id':_0x54d2aa[_0xe85c('0x57')]['id']}})['then'](handleEntityNotFound(_0xaab4de,null))[_0xe85c('0x1f')](function(_0x58f008){if(_0x58f008){return _0x58f008[_0xe85c('0x124')](_0x54d2aa['body'][_0xe85c('0x6d')],_[_0xe85c('0x126')](_0x54d2aa[_0xe85c('0x63')],[_0xe85c('0x6d'),'id'])||{});}})['then'](respondWithResult(_0xaab4de,null))['catch'](handleError(_0xaab4de,null));};exports[_0xe85c('0x111')]=function(_0xbb0e22,_0x48b894,_0x1745c8){var _0x77127f={};var _0x111d88={};var _0x13a71b;var _0xe7261a;return db['ChatWebsite'][_0xe85c('0x67')]({'where':{'id':_0xbb0e22[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x48b894,null))[_0xe85c('0x1f')](function(_0x763e5f){if(_0x763e5f){_0x13a71b=_0x763e5f;_0x111d88[_0xe85c('0x44')]=_[_0xe85c('0x45')](db['ChatProactiveAction'][_0xe85c('0x70')]);_0x111d88['query']=_[_0xe85c('0x45')](_0xbb0e22[_0xe85c('0x46')]);_0x111d88[_0xe85c('0x47')]=_[_0xe85c('0x58')](_0x111d88['model'],_0x111d88[_0xe85c('0x46')]);_0x77127f[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x111d88[_0xe85c('0x44')],qs[_0xe85c('0x48')](_0xbb0e22[_0xe85c('0x46')][_0xe85c('0x48')]));_0x77127f[_0xe85c('0x49')]=_0x77127f['attributes']['length']?_0x77127f[_0xe85c('0x49')]:_0x111d88[_0xe85c('0x44')];_0x77127f[_0xe85c('0x4c')]=qs[_0xe85c('0x4d')](_0xbb0e22['query'][_0xe85c('0x4d')]);_0x77127f[_0xe85c('0x50')]=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0xbb0e22[_0xe85c('0x46')],_0x111d88[_0xe85c('0x47')]));if(_0xbb0e22[_0xe85c('0x46')][_0xe85c('0x4f')]){_0x77127f[_0xe85c('0x50')]=_['merge'](_0x77127f['where'],{'$or':_[_0xe85c('0x3f')](_0x77127f[_0xe85c('0x49')],function(_0x265839){var _0x424771={};_0x424771[_0x265839]={'$like':'%'+_0xbb0e22[_0xe85c('0x46')][_0xe85c('0x4f')]+'%'};return _0x424771;})});}_0x77127f=_['merge']({},_0x77127f,_0xbb0e22[_0xe85c('0x53')]);return _0x13a71b['getProactiveActions'](_0x77127f);}})['then'](function(_0x39d810){if(_0x39d810){_0xe7261a=_0x39d810[_0xe85c('0x4a')];if(!_0xbb0e22[_0xe85c('0x46')][_0xe85c('0x4b')](_0xe85c('0x68'))){_0x77127f['limit']=qs['limit'](_0xbb0e22[_0xe85c('0x46')][_0xe85c('0x2e')]);_0x77127f[_0xe85c('0x30')]=qs[_0xe85c('0x30')](_0xbb0e22[_0xe85c('0x46')]['offset']);}return _0x13a71b[_0xe85c('0x111')](_0x77127f);}})[_0xe85c('0x1f')](function(_0x5568b4){if(_0x5568b4){return _0x5568b4?{'count':_0xe7261a,'rows':_0x5568b4}:null;}})['then'](respondWithResult(_0x48b894,null))[_0xe85c('0x29')](handleError(_0x48b894,null));};exports['getFields']=function(_0x3ec073,_0x5af8ff,_0x1f3e6a){var _0x1eadcf=_0x3ec073[_0xe85c('0x46')]['online']===_0xe85c('0x127')?_0xe85c('0x128'):_0xe85c('0x129');return db['ChatWebsite'][_0xe85c('0x59')]({'attributes':['id',_0x1eadcf],'where':{'id':_0x3ec073[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x5af8ff,null))[_0xe85c('0x1f')](function(_0x372b33){if(_0x372b33){var _0x1abec8=_0x372b33[_0x1eadcf];var _0x6b8bdc=_0x1abec8&&_0x1abec8[_0xe85c('0x12a')]?_0x1abec8[_0xe85c('0x12a')]:[];_0x5af8ff[_0xe85c('0x3b')]({'fromKey':_[_0xe85c('0x7f')](_0x1abec8[_0xe85c('0x12b')])?undefined:_0x1abec8['fromKey'],'count':_0x6b8bdc['length'],'rows':_0x6b8bdc});}})[_0xe85c('0x29')](handleError(_0x5af8ff,null));};exports[_0xe85c('0x12c')]=function(_0x2e081c,_0x161cba,_0x464694){var _0x153d3a={'raw':![],'where':{}};var _0x30feda={};var _0x26f0fa={'count':0x0,'rows':[]};return db[_0xe85c('0x40')][_0xe85c('0x67')]({'where':{'id':_0x2e081c[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x161cba,null))[_0xe85c('0x1f')](function(_0x10ad34){if(_0x10ad34){_0x30feda[_0xe85c('0x44')]=_['keys'](db[_0xe85c('0xdf')][_0xe85c('0x70')]);_0x30feda[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0x2e081c[_0xe85c('0x46')]);_0x30feda[_0xe85c('0x47')]=_[_0xe85c('0x58')](_0x30feda[_0xe85c('0x44')],_0x30feda[_0xe85c('0x46')]);_0x153d3a[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x30feda['model'],qs[_0xe85c('0x48')](_0x2e081c['query'][_0xe85c('0x48')]));_0x153d3a[_0xe85c('0x49')]=_0x153d3a[_0xe85c('0x49')]['length']?_0x153d3a['attributes']:_0x30feda[_0xe85c('0x44')];if(!_0x2e081c[_0xe85c('0x46')]['hasOwnProperty'](_0xe85c('0x68'))){_0x153d3a[_0xe85c('0x2e')]=qs[_0xe85c('0x2e')](_0x2e081c[_0xe85c('0x46')]['limit']);_0x153d3a[_0xe85c('0x30')]=qs['offset'](_0x2e081c[_0xe85c('0x46')]['offset']);}_0x153d3a['order']=qs[_0xe85c('0x4d')](_0x2e081c[_0xe85c('0x46')]['sort']);_0x153d3a[_0xe85c('0x50')]=qs['filters'](_[_0xe85c('0x4e')](_0x2e081c['query'],_0x30feda['filters']));_0x153d3a[_0xe85c('0x50')][_0xe85c('0x69')]=_0x10ad34['id'];if(_0x2e081c[_0xe85c('0x46')]['filter']){_0x153d3a[_0xe85c('0x50')]=_[_0xe85c('0x51')](_0x153d3a['where'],{'$or':_[_0xe85c('0x3f')](_0x153d3a[_0xe85c('0x49')],function(_0x160939){var _0x53c9fe={};_0x53c9fe[_0x160939]={'$like':'%'+_0x2e081c[_0xe85c('0x46')][_0xe85c('0x4f')]+'%'};return _0x53c9fe;})});}_0x153d3a=_['merge']({},_0x153d3a,_0x2e081c[_0xe85c('0x53')]);return db[_0xe85c('0xdf')][_0xe85c('0x2f')]({'where':_0x153d3a[_0xe85c('0x50')]})[_0xe85c('0x1f')](function(_0x5d93c2){_0x26f0fa[_0xe85c('0x2f')]=_0x5d93c2;if(_0x2e081c[_0xe85c('0x46')][_0xe85c('0x54')]){_0x153d3a[_0xe85c('0x6a')]=[{'all':!![]}];}else{_0x153d3a[_0xe85c('0x6a')]=[{'model':db[_0xe85c('0x92')],'as':_0xe85c('0x12d'),'required':![]},{'model':db[_0xe85c('0xe3')],'as':_0xe85c('0x12e'),'required':![]}];}return db['ChatOfflineMessage'][_0xe85c('0x6b')](_0x153d3a);})['then'](function(_0x4c8fde){_0x26f0fa[_0xe85c('0x55')]=_0x4c8fde;return _0x26f0fa;});}})[_0xe85c('0x1f')](respondWithFilteredResult(_0x161cba,_0x153d3a))[_0xe85c('0x29')](handleError(_0x161cba,null));};exports[_0xe85c('0x12f')]=function(_0x51a00f,_0x159edd,_0x5963f1){return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x51a00f['params']['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x159edd,null))[_0xe85c('0x1f')](function(_0x40309e){if(_0x40309e){return _0x40309e['addAgents'](_0x51a00f[_0xe85c('0x63')][_0xe85c('0x6d')],_[_0xe85c('0x126')](_0x51a00f[_0xe85c('0x63')],[_0xe85c('0x6d'),'id'])||{})['spread'](function(_0x1a0cde){for(var _0x351580=0x0;_0x351580<_0x51a00f['body']['ids'][_0xe85c('0x4a')];_0x351580+=0x1){socket['emit'](_0xe85c('0x130'),{'UserId':Number(_0x51a00f['body']['ids'][_0x351580]),'ChatWebsiteId':Number(_0x51a00f[_0xe85c('0x57')]['id'])});}return _0x1a0cde;});}})[_0xe85c('0x1f')](respondWithResult(_0x159edd,null))[_0xe85c('0x29')](handleError(_0x159edd,null));};exports[_0xe85c('0x131')]=function(_0x3512c7,_0x1d05e2,_0x4a889b){return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x3512c7[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x1d05e2,null))[_0xe85c('0x1f')](function(_0x253a4f){if(_0x253a4f){return _0x253a4f['removeAgents'](_0x3512c7[_0xe85c('0x46')][_0xe85c('0x6d')])[_0xe85c('0x1f')](function(){if(_[_0xe85c('0x132')](_0x3512c7['query'][_0xe85c('0x6d')])){for(var _0x139a28=0x0;_0x139a28<_0x3512c7[_0xe85c('0x46')][_0xe85c('0x6d')][_0xe85c('0x4a')];_0x139a28+=0x1){socket[_0xe85c('0x133')]('userChatWebsite:remove',{'UserId':Number(_0x3512c7[_0xe85c('0x46')][_0xe85c('0x6d')][_0x139a28]),'ChatWebsiteId':Number(_0x3512c7[_0xe85c('0x57')]['id'])});}}else{socket[_0xe85c('0x133')](_0xe85c('0x134'),{'UserId':Number(_0x3512c7[_0xe85c('0x46')]['ids']),'ChatWebsiteId':Number(_0x3512c7[_0xe85c('0x57')]['id'])});}});}})[_0xe85c('0x1f')](respondWithStatusCode(_0x1d05e2,null))[_0xe85c('0x29')](handleError(_0x1d05e2,null));};exports[_0xe85c('0x135')]=function(_0x5aee50,_0x2382e9,_0x5620a5){var _0x4d4209={};var _0x276d8d={};var _0x574232;var _0x5eb090;return db[_0xe85c('0x40')][_0xe85c('0x67')]({'where':{'id':_0x5aee50[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x2382e9,null))['then'](function(_0x440af1){if(_0x440af1){_0x574232=_0x440af1;_0x276d8d['model']=_[_0xe85c('0x45')](db[_0xe85c('0xcc')][_0xe85c('0x70')]);_0x276d8d[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0x5aee50[_0xe85c('0x46')]);_0x276d8d[_0xe85c('0x47')]=_['intersection'](_0x276d8d[_0xe85c('0x44')],_0x276d8d[_0xe85c('0x46')]);_0x4d4209[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x276d8d['model'],qs[_0xe85c('0x48')](_0x5aee50[_0xe85c('0x46')][_0xe85c('0x48')]));_0x4d4209[_0xe85c('0x49')]=_0x4d4209[_0xe85c('0x49')][_0xe85c('0x4a')]?_0x4d4209[_0xe85c('0x49')]:_0x276d8d[_0xe85c('0x44')];_0x4d4209['order']=qs[_0xe85c('0x4d')](_0x5aee50['query']['sort']);_0x4d4209[_0xe85c('0x50')]=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0x5aee50[_0xe85c('0x46')],_0x276d8d[_0xe85c('0x47')]));if(_0x5aee50[_0xe85c('0x46')]['filter']){_0x4d4209[_0xe85c('0x50')]=_['merge'](_0x4d4209['where'],{'$or':_[_0xe85c('0x3f')](_0x4d4209[_0xe85c('0x49')],function(_0x1b0e4f){var _0x12682e={};_0x12682e[_0x1b0e4f]={'$like':'%'+_0x5aee50['query'][_0xe85c('0x4f')]+'%'};return _0x12682e;})});}_0x4d4209=_[_0xe85c('0x51')]({},_0x4d4209,_0x5aee50[_0xe85c('0x53')]);return _0x574232[_0xe85c('0x135')](_0x4d4209);}})[_0xe85c('0x1f')](function(_0x132d81){if(_0x132d81){_0x5eb090=_0x132d81[_0xe85c('0x4a')];if(!_0x5aee50[_0xe85c('0x46')][_0xe85c('0x4b')](_0xe85c('0x68'))){_0x4d4209[_0xe85c('0x2e')]=qs[_0xe85c('0x2e')](_0x5aee50[_0xe85c('0x46')][_0xe85c('0x2e')]);_0x4d4209[_0xe85c('0x30')]=qs['offset'](_0x5aee50['query'][_0xe85c('0x30')]);}return _0x574232[_0xe85c('0x135')](_0x4d4209);}})[_0xe85c('0x1f')](function(_0x50565f){if(_0x50565f){return _0x50565f?{'count':_0x5eb090,'rows':_0x50565f}:null;}})[_0xe85c('0x1f')](respondWithResult(_0x2382e9,null))[_0xe85c('0x29')](handleError(_0x2382e9,null));}; \ No newline at end of file +var _0x2563=['openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','sendMail','email','offlineMessageSubject','subjectOffline','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','getLicense','custom','License','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','color_button','transaction','ChatApplication','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatWebsite.socket','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','include','findAll','rows','catch','show','params','mandatoryDispositionPause','keys','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','describe','ChatWebsiteId','Disposition','getDispositions','findOne','order','options','removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','DESC','Applications','applications','list','orderBy','asc','account','defaults','CmContact','contact','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','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','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0x2563,0x182));var _0x3256=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2563[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3256('0x0'));var rimraf=require(_0x3256('0x1'));var zipdir=require(_0x3256('0x2'));var jsonpatch=require(_0x3256('0x3'));var rp=require(_0x3256('0x4'));var moment=require(_0x3256('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3256('0x6'));var util=require('util');var path=require(_0x3256('0x7'));var sox=require(_0x3256('0x8'));var csv=require(_0x3256('0x9'));var ejs=require(_0x3256('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3256('0xb'));var crypto=require(_0x3256('0xc'));var jsforce=require(_0x3256('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3256('0x9'));var querystring=require(_0x3256('0xe'));var Papa=require(_0x3256('0xf'));var Redis=require('ioredis');var authService=require(_0x3256('0x10'));var qs=require(_0x3256('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3256('0x12'))(_0x3256('0x13'));var utils=require(_0x3256('0x14'));var config=require(_0x3256('0x15'));var licenseUtil=require(_0x3256('0x16'));var db=require('../../mysqldb')['db'];config[_0x3256('0x17')]=_['defaults'](config[_0x3256('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3256('0x18'))(new Redis(config['redis']));require(_0x3256('0x19'))['register'](socket);var jayson=require(_0x3256('0x1a'));var client=jayson['client'][_0x3256('0x1b')]({'port':0x232c});var client9002=jayson[_0x3256('0x1c')][_0x3256('0x1b')]({'port':0x232a});var client9003=jayson[_0x3256('0x1c')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x2ceb70,_0x28dadb,_0x394ba3,_0x4e51a0){return new BPromise(function(_0x351e97,_0x1754af){var _0x12243f=_0x4e51a0||client;return _0x12243f[_0x3256('0x1d')](_0x2ceb70,_0x394ba3)[_0x3256('0x1e')](function(_0xdc2334){logger[_0x3256('0x1f')](_0x3256('0x20'),_0x28dadb,_0x3256('0x21'));logger[_0x3256('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x28dadb,_0x3256('0x21'),JSON[_0x3256('0x23')](_0xdc2334));if(_0xdc2334[_0x3256('0x24')]){if(_0xdc2334[_0x3256('0x24')][_0x3256('0x25')]===0x1f4){logger[_0x3256('0x24')](_0x3256('0x20'),_0x28dadb,_0xdc2334[_0x3256('0x24')][_0x3256('0x26')]);return _0x1754af(_0xdc2334[_0x3256('0x24')][_0x3256('0x26')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x28dadb,_0xdc2334['error'][_0x3256('0x26')]);return _0x351e97(_0xdc2334[_0x3256('0x24')][_0x3256('0x26')]);}else{logger[_0x3256('0x1f')](_0x3256('0x20'),_0x28dadb,_0x3256('0x21'));_0x351e97(_0xdc2334[_0x3256('0x27')][_0x3256('0x26')]);}})['catch'](function(_0x2a8d8d){logger['error'](_0x3256('0x20'),_0x28dadb,_0x2a8d8d);_0x1754af(_0x2a8d8d);});});}function respondWithStatusCode(_0x3a3915,_0x47cb98){_0x47cb98=_0x47cb98||0xcc;return function(_0x112bf5){if(_0x112bf5){return _0x3a3915[_0x3256('0x28')](_0x47cb98);}return _0x3a3915[_0x3256('0x29')](_0x47cb98)[_0x3256('0x2a')]();};}function respondWithResult(_0x2e21fc,_0x207c5d){_0x207c5d=_0x207c5d||0xc8;return function(_0x51ffaa){if(_0x51ffaa){return _0x2e21fc[_0x3256('0x29')](_0x207c5d)[_0x3256('0x2b')](_0x51ffaa);}};}function respondWithFilteredResult(_0x58e24a,_0x57d36e){return function(_0x22e3b1){if(_0x22e3b1){var _0x5d20ea=typeof _0x57d36e['offset']===_0x3256('0x2c')&&typeof _0x57d36e[_0x3256('0x2d')]===_0x3256('0x2c');var _0x1d597b=_0x22e3b1[_0x3256('0x2e')];var _0x4b1d5c=_0x5d20ea?0x0:_0x57d36e[_0x3256('0x2f')];var _0x2620c7=_0x5d20ea?_0x22e3b1[_0x3256('0x2e')]:_0x57d36e[_0x3256('0x2f')]+_0x57d36e[_0x3256('0x2d')];var _0x59900b;if(_0x2620c7>=_0x1d597b){_0x2620c7=_0x1d597b;_0x59900b=0xc8;}else{_0x59900b=0xce;}_0x58e24a[_0x3256('0x29')](_0x59900b);return _0x58e24a[_0x3256('0x30')](_0x3256('0x31'),_0x4b1d5c+'-'+_0x2620c7+'/'+_0x1d597b)[_0x3256('0x2b')](_0x22e3b1);}return null;};}function patchUpdates(_0x182193){return function(_0x339582){try{jsonpatch[_0x3256('0x32')](_0x339582,_0x182193,!![]);}catch(_0x51b9c5){return BPromise['reject'](_0x51b9c5);}return _0x339582['save']();};}function saveUpdates(_0x2d6deb,_0x27f7cf){return function(_0x3e0890){if(_0x3e0890){return _0x3e0890[_0x3256('0x33')](_0x2d6deb)['then'](function(_0x37b84d){return _0x37b84d;});}return null;};}function removeEntity(_0x283be1,_0x2dc911){return function(_0x5cbd9d){if(_0x5cbd9d){return _0x5cbd9d[_0x3256('0x34')]()[_0x3256('0x1e')](function(){var _0x437d68=_0x5cbd9d['get']({'plain':!![]});var _0x4b2227=_0x3256('0x35');return db[_0x3256('0x36')][_0x3256('0x34')]({'where':{'type':_0x4b2227,'resourceId':_0x437d68['id']}})[_0x3256('0x1e')](function(){return _0x5cbd9d;});})[_0x3256('0x1e')](function(){_0x283be1[_0x3256('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f983b,_0x3910db){return function(_0x229204){if(!_0x229204){_0x3f983b[_0x3256('0x28')](0x194);}return _0x229204;};}function handleError(_0x538dff,_0x16cdbc){_0x16cdbc=_0x16cdbc||0x1f4;return function(_0x32c6f2){logger['error'](_0x32c6f2[_0x3256('0x37')]);if(_0x32c6f2['name']){delete _0x32c6f2[_0x3256('0x38')];}_0x538dff['status'](_0x16cdbc)[_0x3256('0x39')](_0x32c6f2);};}exports['index']=function(_0x4ffdb1,_0x2372fc){var _0x56b82e={'include':[{'model':db[_0x3256('0x3a')],'as':'mandatoryDispositionPause'}]},_0x3862c4={},_0xed50a={'count':0x0,'rows':[]};var _0x12a1cf=_[_0x3256('0x3b')](db[_0x3256('0x3c')][_0x3256('0x3d')],function(_0x4a85c8){return{'name':_0x4a85c8[_0x3256('0x3e')],'type':_0x4a85c8[_0x3256('0x3f')][_0x3256('0x40')]};});_0x3862c4['model']=_[_0x3256('0x3b')](_0x12a1cf,'name');_0x3862c4[_0x3256('0x41')]=_['keys'](_0x4ffdb1[_0x3256('0x41')]);_0x3862c4[_0x3256('0x42')]=_['intersection'](_0x3862c4[_0x3256('0x43')],_0x3862c4['query']);_0x56b82e[_0x3256('0x44')]=_[_0x3256('0x45')](_0x3862c4[_0x3256('0x43')],qs[_0x3256('0x46')](_0x4ffdb1[_0x3256('0x41')][_0x3256('0x46')]));_0x56b82e[_0x3256('0x44')]=_0x56b82e[_0x3256('0x44')][_0x3256('0x47')]?_0x56b82e['attributes']:_0x3862c4['model'];if(!_0x4ffdb1[_0x3256('0x41')][_0x3256('0x48')](_0x3256('0x49'))){_0x56b82e[_0x3256('0x2d')]=qs[_0x3256('0x2d')](_0x4ffdb1[_0x3256('0x41')]['limit']);_0x56b82e[_0x3256('0x2f')]=qs[_0x3256('0x2f')](_0x4ffdb1['query'][_0x3256('0x2f')]);}_0x56b82e['order']=qs[_0x3256('0x4a')](_0x4ffdb1[_0x3256('0x41')][_0x3256('0x4a')]);_0x56b82e[_0x3256('0x4b')]=qs['filters'](_[_0x3256('0x4c')](_0x4ffdb1[_0x3256('0x41')],_0x3862c4[_0x3256('0x42')]),_0x12a1cf);if(_0x4ffdb1[_0x3256('0x41')]['filter']){_0x56b82e[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x56b82e[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x12a1cf,function(_0x4f9c86){if(_0x4f9c86[_0x3256('0x3f')]!=='VIRTUAL'){var _0x4be596={};_0x4be596[_0x4f9c86[_0x3256('0x38')]]={'$like':'%'+_0x4ffdb1[_0x3256('0x41')][_0x3256('0x4e')]+'%'};return _0x4be596;}})});}_0x56b82e=_[_0x3256('0x4d')]({},_0x56b82e,_0x4ffdb1['options']);var _0x2f0943={'where':_0x56b82e[_0x3256('0x4b')]};return db[_0x3256('0x3c')]['count'](_0x2f0943)['then'](function(_0x51ef92){_0xed50a[_0x3256('0x2e')]=_0x51ef92;if(_0x4ffdb1['query']['includeAll']){_0x56b82e[_0x3256('0x4f')]=[{'all':!![]}];}return db[_0x3256('0x3c')][_0x3256('0x50')](_0x56b82e);})[_0x3256('0x1e')](function(_0x25ef94){_0xed50a[_0x3256('0x51')]=_0x25ef94;return _0xed50a;})[_0x3256('0x1e')](respondWithFilteredResult(_0x2372fc,_0x56b82e))[_0x3256('0x52')](handleError(_0x2372fc,null));};exports[_0x3256('0x53')]=function(_0x406af6,_0x5af65d){var _0x1505de={'raw':![],'where':{'id':_0x406af6[_0x3256('0x54')]['id']},'include':[{'model':db[_0x3256('0x3a')],'as':_0x3256('0x55')}]},_0x3bafc1={};_0x3bafc1['model']=_[_0x3256('0x56')](db['ChatWebsite'][_0x3256('0x3d')]);_0x3bafc1[_0x3256('0x41')]=_[_0x3256('0x56')](_0x406af6['query']);_0x3bafc1[_0x3256('0x42')]=_[_0x3256('0x45')](_0x3bafc1[_0x3256('0x43')],_0x3bafc1['query']);_0x1505de[_0x3256('0x44')]=_[_0x3256('0x45')](_0x3bafc1['model'],qs[_0x3256('0x46')](_0x406af6[_0x3256('0x41')][_0x3256('0x46')]));_0x1505de[_0x3256('0x44')]=_0x1505de[_0x3256('0x44')][_0x3256('0x47')]?_0x1505de[_0x3256('0x44')]:_0x3bafc1[_0x3256('0x43')];if(_0x406af6[_0x3256('0x41')][_0x3256('0x57')]){_0x1505de['include']=[{'all':!![]}];}_0x1505de=_[_0x3256('0x4d')]({},_0x1505de,_0x406af6['options']);return db['ChatWebsite'][_0x3256('0x58')](_0x1505de)[_0x3256('0x1e')](handleEntityNotFound(_0x5af65d,null))[_0x3256('0x1e')](respondWithResult(_0x5af65d,null))[_0x3256('0x52')](handleError(_0x5af65d,null));};exports[_0x3256('0x59')]=function(_0x5cfc1c,_0x23f39e){return db[_0x3256('0x3c')][_0x3256('0x59')](_0x5cfc1c[_0x3256('0x5a')],{})[_0x3256('0x1e')](function(_0x5da708){var _0x3af3f8=_0x5cfc1c[_0x3256('0x5b')][_0x3256('0x5c')]({'plain':!![]});if(!_0x3af3f8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3af3f8[_0x3256('0x5d')]==='user'){var _0x3ff570=_0x5da708[_0x3256('0x5c')]({'plain':!![]});var _0x4c98b4='ChatWebsites';return db[_0x3256('0x5e')][_0x3256('0x58')]({'where':{'name':_0x4c98b4,'userProfileId':_0x3af3f8[_0x3256('0x5f')]},'raw':!![]})[_0x3256('0x1e')](function(_0x32a09d){if(_0x32a09d&&_0x32a09d['autoAssociation']===0x0){return db[_0x3256('0x36')][_0x3256('0x59')]({'name':_0x3ff570[_0x3256('0x38')],'resourceId':_0x3ff570['id'],'type':_0x32a09d[_0x3256('0x38')],'sectionId':_0x32a09d['id']},{})[_0x3256('0x1e')](function(){return _0x5da708;});}else{return _0x5da708;}})['catch'](function(_0x110cb6){logger[_0x3256('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x110cb6);throw _0x110cb6;});}return _0x5da708;})[_0x3256('0x1e')](respondWithResult(_0x23f39e,0xc9))['catch'](handleError(_0x23f39e,null));};exports[_0x3256('0x33')]=function(_0xcfd1e8,_0x2caf9f){if(_0xcfd1e8[_0x3256('0x5a')]['id']){delete _0xcfd1e8[_0x3256('0x5a')]['id'];}return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0xcfd1e8['params']['id']},'include':[{'model':db[_0x3256('0x3a')],'as':_0x3256('0x55')}]})[_0x3256('0x1e')](handleEntityNotFound(_0x2caf9f,null))[_0x3256('0x1e')](saveUpdates(_0xcfd1e8[_0x3256('0x5a')],null))[_0x3256('0x1e')](respondWithResult(_0x2caf9f,null))[_0x3256('0x52')](handleError(_0x2caf9f,null));};exports['destroy']=function(_0x132470,_0x1e84fb){return db['ChatWebsite'][_0x3256('0x58')]({'where':{'id':_0x132470[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x1e84fb,null))[_0x3256('0x1e')](removeEntity(_0x1e84fb,null))[_0x3256('0x52')](handleError(_0x1e84fb,null));};exports[_0x3256('0x60')]=function(_0x386b5a,_0x840ccb){return db[_0x3256('0x3c')][_0x3256('0x60')]()[_0x3256('0x1e')](respondWithResult(_0x840ccb,null))['catch'](handleError(_0x840ccb,null));};exports['addDisposition']=function(_0x4b647b,_0x22aee9,_0x488ba7){if(_0x4b647b[_0x3256('0x5a')]['id']){delete _0x4b647b[_0x3256('0x5a')]['id'];}return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x4b647b[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x22aee9,null))[_0x3256('0x1e')](function(_0x559bc7){if(_0x559bc7){_0x4b647b[_0x3256('0x5a')][_0x3256('0x61')]=_0x559bc7['id'];return db[_0x3256('0x62')][_0x3256('0x59')](_0x4b647b['body']);}})[_0x3256('0x1e')](respondWithResult(_0x22aee9,null))[_0x3256('0x52')](handleError(_0x22aee9,null));};exports[_0x3256('0x63')]=function(_0x1aabd1,_0x5f18cc,_0xd1f55){var _0x4ba77c={'raw':![],'where':{}};var _0x4063b8={};var _0xd13029={'count':0x0,'rows':[]};return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x1aabd1[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x5f18cc,null))[_0x3256('0x1e')](function(_0x3c6f86){if(_0x3c6f86){_0x4063b8[_0x3256('0x43')]=_[_0x3256('0x56')](db[_0x3256('0x62')][_0x3256('0x3d')]);_0x4063b8[_0x3256('0x41')]=_[_0x3256('0x56')](_0x1aabd1['query']);_0x4063b8[_0x3256('0x42')]=_[_0x3256('0x45')](_0x4063b8[_0x3256('0x43')],_0x4063b8[_0x3256('0x41')]);_0x4ba77c[_0x3256('0x44')]=_[_0x3256('0x45')](_0x4063b8['model'],qs[_0x3256('0x46')](_0x1aabd1[_0x3256('0x41')][_0x3256('0x46')]));_0x4ba77c[_0x3256('0x44')]=_0x4ba77c[_0x3256('0x44')][_0x3256('0x47')]?_0x4ba77c[_0x3256('0x44')]:_0x4063b8[_0x3256('0x43')];if(!_0x1aabd1['query'][_0x3256('0x48')]('nolimit')){_0x4ba77c['limit']=qs['limit'](_0x1aabd1[_0x3256('0x41')][_0x3256('0x2d')]);_0x4ba77c[_0x3256('0x2f')]=qs[_0x3256('0x2f')](_0x1aabd1[_0x3256('0x41')][_0x3256('0x2f')]);}_0x4ba77c[_0x3256('0x65')]=qs[_0x3256('0x4a')](_0x1aabd1[_0x3256('0x41')][_0x3256('0x4a')]);_0x4ba77c[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x1aabd1[_0x3256('0x41')],_0x4063b8[_0x3256('0x42')]));_0x4ba77c[_0x3256('0x4b')]['ChatWebsiteId']=_0x3c6f86['id'];if(_0x1aabd1[_0x3256('0x41')][_0x3256('0x4e')]){_0x4ba77c[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x4ba77c[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x4ba77c[_0x3256('0x44')],function(_0x4bbc32){var _0x1aa174={};_0x1aa174[_0x4bbc32]={'$like':'%'+_0x1aabd1[_0x3256('0x41')][_0x3256('0x4e')]+'%'};return _0x1aa174;})});}_0x4ba77c=_[_0x3256('0x4d')]({},_0x4ba77c,_0x1aabd1[_0x3256('0x66')]);return db[_0x3256('0x62')]['count']({'where':_0x4ba77c[_0x3256('0x4b')]})[_0x3256('0x1e')](function(_0x3fc02a){_0xd13029[_0x3256('0x2e')]=_0x3fc02a;if(_0x1aabd1[_0x3256('0x41')][_0x3256('0x57')]){_0x4ba77c['include']=[{'all':!![]}];}return db[_0x3256('0x62')][_0x3256('0x50')](_0x4ba77c);})[_0x3256('0x1e')](function(_0x481efe){_0xd13029[_0x3256('0x51')]=_0x481efe;return _0xd13029;});}})[_0x3256('0x1e')](respondWithFilteredResult(_0x5f18cc,_0x4ba77c))['catch'](handleError(_0x5f18cc,null));};exports[_0x3256('0x67')]=function(_0x450279,_0x5464cc,_0x4bed17){return db[_0x3256('0x3c')]['find']({'where':{'id':_0x450279[_0x3256('0x54')]['id']}})['then'](handleEntityNotFound(_0x5464cc,null))[_0x3256('0x1e')](function(_0x26363c){if(_0x26363c){return _0x26363c[_0x3256('0x67')](_0x450279[_0x3256('0x41')][_0x3256('0x68')]);}})[_0x3256('0x1e')](respondWithStatusCode(_0x5464cc,null))[_0x3256('0x52')](handleError(_0x5464cc,null));};exports['addAnswer']=function(_0x1e0a5f,_0x372913,_0x5c98eb){if(_0x1e0a5f[_0x3256('0x5a')]['id']){delete _0x1e0a5f[_0x3256('0x5a')]['id'];}return db[_0x3256('0x3c')]['find']({'where':{'id':_0x1e0a5f['params']['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x372913,null))[_0x3256('0x1e')](function(_0x5763ff){if(_0x5763ff){_0x1e0a5f[_0x3256('0x5a')][_0x3256('0x61')]=_0x5763ff['id'];return db[_0x3256('0x69')][_0x3256('0x59')](_0x1e0a5f[_0x3256('0x5a')]);}})[_0x3256('0x1e')](respondWithResult(_0x372913,null))[_0x3256('0x52')](handleError(_0x372913,null));};exports['getAnswers']=function(_0x53cbbb,_0x3c8f0c,_0x469670){var _0x2bd321={'raw':![],'where':{}};var _0x4e55a5={};var _0x28dbc4={'count':0x0,'rows':[]};return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x53cbbb[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x3c8f0c,null))[_0x3256('0x1e')](function(_0x25524d){if(_0x25524d){_0x4e55a5[_0x3256('0x43')]=_['keys'](db['CannedAnswer'][_0x3256('0x3d')]);_0x4e55a5[_0x3256('0x41')]=_[_0x3256('0x56')](_0x53cbbb['query']);_0x4e55a5[_0x3256('0x42')]=_[_0x3256('0x45')](_0x4e55a5['model'],_0x4e55a5[_0x3256('0x41')]);_0x2bd321[_0x3256('0x44')]=_['intersection'](_0x4e55a5[_0x3256('0x43')],qs[_0x3256('0x46')](_0x53cbbb[_0x3256('0x41')]['fields']));_0x2bd321[_0x3256('0x44')]=_0x2bd321['attributes'][_0x3256('0x47')]?_0x2bd321[_0x3256('0x44')]:_0x4e55a5[_0x3256('0x43')];if(!_0x53cbbb[_0x3256('0x41')][_0x3256('0x48')]('nolimit')){_0x2bd321['limit']=qs[_0x3256('0x2d')](_0x53cbbb['query'][_0x3256('0x2d')]);_0x2bd321['offset']=qs[_0x3256('0x2f')](_0x53cbbb[_0x3256('0x41')][_0x3256('0x2f')]);}_0x2bd321['order']=qs['sort'](_0x53cbbb[_0x3256('0x41')][_0x3256('0x4a')]);_0x2bd321[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x53cbbb[_0x3256('0x41')],_0x4e55a5['filters']));_0x2bd321['where']['ChatWebsiteId']=_0x25524d['id'];if(_0x53cbbb['query'][_0x3256('0x4e')]){_0x2bd321[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x2bd321[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x2bd321[_0x3256('0x44')],function(_0x45b320){var _0x375d47={};_0x375d47[_0x45b320]={'$like':'%'+_0x53cbbb['query']['filter']+'%'};return _0x375d47;})});}_0x2bd321=_['merge']({},_0x2bd321,_0x53cbbb[_0x3256('0x66')]);return db['CannedAnswer'][_0x3256('0x2e')]({'where':_0x2bd321[_0x3256('0x4b')]})[_0x3256('0x1e')](function(_0x37485e){_0x28dbc4[_0x3256('0x2e')]=_0x37485e;if(_0x53cbbb[_0x3256('0x41')][_0x3256('0x57')]){_0x2bd321['include']=[{'all':!![]}];}return db[_0x3256('0x69')][_0x3256('0x50')](_0x2bd321);})[_0x3256('0x1e')](function(_0x34bf4c){_0x28dbc4[_0x3256('0x51')]=_0x34bf4c;return _0x28dbc4;});}})[_0x3256('0x1e')](respondWithFilteredResult(_0x3c8f0c,_0x2bd321))[_0x3256('0x52')](handleError(_0x3c8f0c,null));};exports['removeAnswers']=function(_0x31a908,_0x52d9db,_0x19629c){return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x31a908['params']['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x52d9db,null))[_0x3256('0x1e')](function(_0x1d72f7){if(_0x1d72f7){return _0x1d72f7[_0x3256('0x6a')](_0x31a908[_0x3256('0x41')][_0x3256('0x68')]);}})[_0x3256('0x1e')](respondWithStatusCode(_0x52d9db,null))['catch'](handleError(_0x52d9db,null));};exports[_0x3256('0x6b')]=function(_0x371429,_0x4a4293,_0x5cd6e1){_0x371429['body'][_0x3256('0x6c')]=_0x371429[_0x3256('0x6d')][_0x3256('0x6e')];return db['ChatWebsite'][_0x3256('0x58')]({'where':{'id':_0x371429['params']['id']}})['then'](handleEntityNotFound(_0x4a4293,null))['then'](saveUpdates(_0x371429[_0x3256('0x5a')],null))[_0x3256('0x1e')](respondWithResult(_0x4a4293,null))[_0x3256('0x52')](handleError(_0x4a4293,null));};exports['addAvatar']=function(_0x2b8e50,_0x226499,_0x5c8941){_0x2b8e50[_0x3256('0x5a')][_0x3256('0x6f')]=_0x2b8e50[_0x3256('0x6d')][_0x3256('0x6e')];return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x2b8e50[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x226499,null))['then'](saveUpdates(_0x2b8e50[_0x3256('0x5a')],null))['then'](respondWithResult(_0x226499,null))[_0x3256('0x52')](handleError(_0x226499,null));};exports[_0x3256('0x70')]=function(_0x42b3d0,_0x64e81f,_0x24cfff){_0x42b3d0['body'][_0x3256('0x71')]=_0x42b3d0[_0x3256('0x6d')]['filename'];return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x42b3d0[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x64e81f,null))['then'](saveUpdates(_0x42b3d0[_0x3256('0x5a')],null))[_0x3256('0x1e')](respondWithResult(_0x64e81f,null))[_0x3256('0x52')](handleError(_0x64e81f,null));};exports[_0x3256('0x72')]=function(_0x2d3827,_0x19a2fe,_0x376184){_0x2d3827[_0x3256('0x5a')]['systemAvatar']=_0x2d3827[_0x3256('0x6d')]['filename'];return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x2d3827[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x19a2fe,null))[_0x3256('0x1e')](saveUpdates(_0x2d3827['body'],null))['then'](respondWithResult(_0x19a2fe,null))[_0x3256('0x52')](handleError(_0x19a2fe,null));};exports[_0x3256('0x73')]=function(_0x44740a,_0x1894b3,_0x13fff4){var _0x523e5d=path[_0x3256('0x74')](config['root'],_0x3256('0x75'));var _0x21a82d={'where':{'id':_0x44740a[_0x3256('0x54')]['id']},'attributes':['id',_0x3256('0x6c')],'raw':!![]};var _0xf95e3=![];return require(_0x3256('0x16'))['getLicense']()['then'](function(_0xc2edf9){if(_0xc2edf9){_0xf95e3=_0xc2edf9['custom'];}})[_0x3256('0x1e')](function(){return db[_0x3256('0x3c')]['find'](_0x21a82d);})['then'](handleEntityNotFound(_0x1894b3,null))[_0x3256('0x1e')](function(_0x139f7a){if(_0x139f7a){if(!_[_0x3256('0x76')](_0x139f7a[_0x3256('0x6c')])){if(fs[_0x3256('0x77')](path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x79'),_0x139f7a[_0x3256('0x6c')]))&&_0xf95e3){_0x523e5d=path[_0x3256('0x74')](config['root'],'server/files/images/logos/',_0x139f7a[_0x3256('0x6c')]);}}return _0x1894b3[_0x3256('0x7a')](_0x523e5d);}})['catch'](handleError(_0x1894b3,null));};exports[_0x3256('0x7b')]=function(_0x5ab6cc,_0x16666d,_0x30634f){var _0xcbe899=path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x7c'));var _0x2eedb1={'where':{'id':_0x5ab6cc[_0x3256('0x54')]['id']},'attributes':['id',_0x3256('0x6f')],'raw':!![]};return db['ChatWebsite'][_0x3256('0x58')](_0x2eedb1)[_0x3256('0x1e')](handleEntityNotFound(_0x16666d,null))[_0x3256('0x1e')](function(_0x93f517){if(_0x93f517){if(!_[_0x3256('0x76')](_0x93f517[_0x3256('0x6f')])){if(fs[_0x3256('0x77')](path['join'](config[_0x3256('0x78')],'server/files/images/avatars/',_0x93f517[_0x3256('0x6f')]))){_0xcbe899=path['join'](config[_0x3256('0x78')],'server/files/images/avatars/',_0x93f517[_0x3256('0x6f')]);}}return _0x16666d['download'](_0xcbe899);}})[_0x3256('0x52')](handleError(_0x16666d,null));};exports[_0x3256('0x7d')]=function(_0x248587,_0x4ef400,_0x39fe2f){var _0xb41c7b=path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x7e'));var _0x160f78={'where':{'id':_0x248587[_0x3256('0x54')]['id']},'attributes':['id',_0x3256('0x71'),_0x3256('0x7f')],'raw':!![]};return db[_0x3256('0x3c')][_0x3256('0x58')](_0x160f78)[_0x3256('0x1e')](handleEntityNotFound(_0x4ef400,null))[_0x3256('0x1e')](function(_0x4c3c13){if(_0x4c3c13){if(!_[_0x3256('0x76')](_0x4c3c13[_0x3256('0x71')])){if(fs[_0x3256('0x77')](path['join'](config[_0x3256('0x78')],_0x3256('0x80'),_0x4c3c13[_0x3256('0x71')]))&&_0x4c3c13[_0x3256('0x7f')]){_0xb41c7b=path['join'](config[_0x3256('0x78')],_0x3256('0x80'),_0x4c3c13[_0x3256('0x71')]);}}return _0x4ef400[_0x3256('0x7a')](_0xb41c7b);}})[_0x3256('0x52')](handleError(_0x4ef400,null));};exports[_0x3256('0x81')]=function(_0x2077b7,_0x5e95ee,_0x372107){var _0x41cc31=path['join'](config[_0x3256('0x78')],_0x3256('0x82'));var _0x5b2b98={'where':{'id':_0x2077b7[_0x3256('0x54')]['id']},'attributes':['id',_0x3256('0x83')],'raw':!![]};return db[_0x3256('0x3c')][_0x3256('0x58')](_0x5b2b98)[_0x3256('0x1e')](handleEntityNotFound(_0x5e95ee,null))[_0x3256('0x1e')](function(_0x14b608){if(_0x14b608){if(!_[_0x3256('0x76')](_0x14b608[_0x3256('0x83')])){if(fs[_0x3256('0x77')](path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x80'),_0x14b608[_0x3256('0x83')]))){_0x41cc31=path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x80'),_0x14b608[_0x3256('0x83')]);}}return _0x5e95ee[_0x3256('0x7a')](_0x41cc31);}})['catch'](handleError(_0x5e95ee,null));};exports[_0x3256('0x84')]=function(_0x38db9d,_0x3b44e7,_0x58fe33){var _0x1942ab=require(_0x3256('0x85'));var _0x917c11=new _0x1942ab();var _0x47c9f9=_0x917c11[_0x3256('0x86')](_0x38db9d['headers'][_0x3256('0x87')])[_0x3256('0x88')]();var _0x1503ee={'body':_0x38db9d[_0x3256('0x5a')],'channel':_0x3256('0x89')};var _0x4676a3=[];var _0x2fa144=[];var _0x5f4f93={};var _0xd9a862=![];return db['CmContact']['describe']()[_0x3256('0x1e')](function(_0x307b1c){if(!_0x307b1c){throw new db[(_0x3256('0x8a'))][(_0x3256('0x8b'))](_0x3256('0x8c'));}_0x4676a3=_['difference'](_['keys'](_0x307b1c),[_0x3256('0x8d'),_0x3256('0x8e')]);_0x2fa144=_[_0x3256('0x8f')](_[_0x3256('0x56')](_0x307b1c),[_0x3256('0x8d'),_0x3256('0x8e'),_0x3256('0x90'),_0x3256('0x91')]);if(_0x38db9d['body']['id']){delete _0x38db9d[_0x3256('0x5a')]['id'];}if(_['isNil'](_0x38db9d['body'][_0x3256('0x92')])){throw new db[(_0x3256('0x8a'))]['ValidationError'](_0x3256('0x93'));}if(_['isNil'](_0x38db9d['body'][_0x3256('0x5a')])||_0x38db9d['body'][_0x3256('0x5a')]===''){throw new db[(_0x3256('0x8a'))][(_0x3256('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3256('0x76')](_0x38db9d[_0x3256('0x5a')]['mapKey'])){throw new db['Sequelize'][(_0x3256('0x8b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2fa144);}if(!_[_0x3256('0x94')](_0x2fa144,_0x38db9d[_0x3256('0x5a')]['mapKey'])){throw new db[(_0x3256('0x8a'))][(_0x3256('0x8b'))](_0x3256('0x95')+_0x2fa144);}_0x5f4f93[_0x38db9d[_0x3256('0x5a')][_0x3256('0x96')]]=_0x38db9d['body'][_0x3256('0x92')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x38db9d[_0x3256('0x54')]['id']},'include':[{'model':db[_0x3256('0x97')],'as':_0x3256('0x98'),'include':[{'model':db['CmContact'],'as':_0x3256('0x99'),'where':_0x5f4f93,'limit':0x1,'order':[[_0x3256('0x8e'),_0x3256('0x9a')]]}]},{'model':db['ChatApplication'],'as':_0x3256('0x9b')}]});})[_0x3256('0x1e')](handleEntityNotFound(_0x3b44e7,null))[_0x3256('0x1e')](function(_0x1aa37f){if(_0x1aa37f&&_0x1aa37f['List']){_0x1503ee['account']=_0x1aa37f;_0x1503ee[_0x3256('0x9c')]=_0x1aa37f[_0x3256('0x9b')];_0x1503ee[_0x3256('0x9d')]=_0x1aa37f[_0x3256('0x98')];_0x1503ee[_0x3256('0x9c')]=_[_0x3256('0x9e')](_0x1503ee[_0x3256('0x9c')],['priority'],[_0x3256('0x9f')]);if(_0x1503ee[_0x3256('0xa0')][_0x3256('0x9b')]){delete _0x1503ee['account'][_0x3256('0x9b')];}if(_0x1503ee[_0x3256('0xa0')][_0x3256('0x98')]&&_0x1503ee['account'][_0x3256('0x98')][_0x3256('0x99')][_0x3256('0x47')]){return _0x1503ee[_0x3256('0xa0')][_0x3256('0x98')][_0x3256('0x99')][0x0];}var _0x1d0660=_[_0x3256('0xa1')](_0x38db9d['body'],{'firstName':_0x38db9d[_0x3256('0x5a')]['from'],'ListId':_0x1aa37f[_0x3256('0x91')]});_0x1d0660[_0x38db9d[_0x3256('0x5a')]['mapKey']]=_0x38db9d[_0x3256('0x5a')][_0x3256('0x92')];return db[_0x3256('0xa2')][_0x3256('0x59')](_0x1d0660,{'fields':_0x4676a3,'raw':!![]});}})[_0x3256('0x1e')](handleEntityNotFound(_0x3b44e7,null))['then'](function(_0x492050){_0x1503ee[_0x3256('0xa3')]=_0x492050;var _0x54cf13=_0x38db9d['body']['customerIp'];if(_0x38db9d[_0x3256('0xa4')][_0x3256('0xa5')]){_0x54cf13=_0x38db9d['headers']['cf-connecting-ip'];}else if(_0x38db9d[_0x3256('0xa4')][_0x3256('0xa6')]){_0x54cf13=_[_0x3256('0xa7')](_0x38db9d[_0x3256('0xa4')][_0x3256('0xa6')][_0x3256('0xa8')](','));}if(_0x492050){var _0x566c9c={'ContactId':_0x492050['id'],'ChatWebsiteId':_0x38db9d['params']['id'],'from':(_0x492050[_0x3256('0xa9')]||'')+'\x20'+(_0x492050[_0x3256('0xaa')]||''),'customerIp':_0x54cf13,'customerPort':_0x38db9d['headers']['x-real-port']?_0x38db9d[_0x3256('0xa4')][_0x3256('0xab')]:null,'referer':_0x38db9d[_0x3256('0x5a')][_0x3256('0xac')],'browserName':_0x47c9f9['browser'][_0x3256('0x38')]&&_0x47c9f9[_0x3256('0xad')][_0x3256('0xae')]?util[_0x3256('0xaf')](_0x3256('0xb0'),_0x47c9f9[_0x3256('0xad')][_0x3256('0x38')],_0x47c9f9[_0x3256('0xad')][_0x3256('0xae')]):_0x3256('0xb1'),'browserVersion':_0x47c9f9['browser']['version']||'unknown','osName':util[_0x3256('0xaf')](_0x3256('0xb0'),_0x47c9f9['os']['name'],_0x47c9f9['os'][_0x3256('0xae')]),'osVersion':_0x47c9f9['os'][_0x3256('0xae')],'deviceModel':_0x47c9f9[_0x3256('0xb2')][_0x3256('0x43')]&&_0x47c9f9[_0x3256('0xb2')]['vendor']?util[_0x3256('0xaf')](_0x3256('0xb3'),_0x47c9f9[_0x3256('0xb2')]['model'],_0x47c9f9[_0x3256('0xb2')]['vendor'],_0x47c9f9[_0x3256('0xb2')][_0x3256('0x3f')]):null,'deviceVendor':_0x47c9f9[_0x3256('0xb2')][_0x3256('0xb4')],'deviceType':_0x47c9f9[_0x3256('0xb2')][_0x3256('0x3f')],'formData':JSON[_0x3256('0x23')](_0x38db9d[_0x3256('0x5a')])};var _0x3ad65a={'ChatWebsiteId':_0x38db9d[_0x3256('0x54')]['id'],'closed':![]};if(_0x38db9d[_0x3256('0x5a')][_0x3256('0xb5')]){_0x3ad65a[_0x3256('0xb5')]=_0x38db9d['body']['threadId'];return db['ChatInteraction']['find']({'where':_0x3ad65a})['then'](function(_0x591f5c){if(_0x591f5c){return[_0x591f5c,![]];}_0x566c9c[_0x3256('0xb5')]=_0x38db9d[_0x3256('0x5a')][_0x3256('0xb5')];_0x566c9c[_0x3256('0xb6')]=_0x38db9d[_0x3256('0x5a')][_0x3256('0xb6')];return db[_0x3256('0xb7')][_0x3256('0x59')](_0x566c9c)[_0x3256('0x1e')](function(_0x3b55f6){return[_0x3b55f6,!![]];});});}_0x3ad65a['ContactId']=_0x492050['id'];if(_0x38db9d[_0x3256('0x5a')][_0x3256('0xb8')]&&_0x38db9d[_0x3256('0x5a')][_0x3256('0xb8')]['id']){_0x3ad65a['id']=_0x38db9d['body'][_0x3256('0xb8')]['id'];return db[_0x3256('0xb7')]['find']({'where':_0x3ad65a})['then'](function(_0x68048b){if(_0x68048b){return[_0x68048b,![]];}return db[_0x3256('0xb7')][_0x3256('0x59')](_0x566c9c)[_0x3256('0x1e')](function(_0x29c4e5){return[_0x29c4e5,!![]];});});}return db[_0x3256('0xb7')][_0x3256('0x59')](_0x566c9c)[_0x3256('0x1e')](function(_0x25e7fd){return[_0x25e7fd,!![]];});}})[_0x3256('0xb9')](function(_0x415e17,_0x17210f){if(_0x415e17){_0xd9a862=_0x17210f;if(!_0x17210f){var _0x43bafb={'from':(_0x1503ee[_0x3256('0xa3')][_0x3256('0xa9')]||'')+'\x20'+(_0x1503ee[_0x3256('0xa3')][_0x3256('0xaa')]||'')};if(_0x38db9d[_0x3256('0x5a')][_0x3256('0xb5')]&&_0x38db9d['body'][_0x3256('0xba')]&&_0x38db9d[_0x3256('0x5a')][_0x3256('0xb5')]!=_0x38db9d[_0x3256('0x5a')][_0x3256('0xba')]){_0x43bafb[_0x3256('0xb5')]=_0x38db9d[_0x3256('0x5a')][_0x3256('0xba')];}return _0x415e17[_0x3256('0x33')](_0x43bafb);}else{return _0x415e17;}}})[_0x3256('0x1e')](function(_0x1a504e){_0x1503ee[_0x3256('0xb8')]=_0x1a504e[_0x3256('0x5c')]({'plain':!![]});_0x1503ee['interaction'][_0x3256('0xbb')]=_0xd9a862;if(_0x1503ee['interaction']['created']){if(_0x1503ee[_0x3256('0xa0')][_0x3256('0xbc')]){_0x1503ee[_0x3256('0x9c')][_0x3256('0xbd')]({'id':0x0,'priority':_0x1503ee[_0x3256('0x9c')][_0x3256('0x47')]+0x1,'app':_0x3256('0xbe'),'appdata':_0x3256('0xbf'),'interval':_0x3256('0xc0')});}}return db[_0x3256('0xc1')][_0x3256('0x59')]({'body':_0x38db9d[_0x3256('0x5a')]['body'],'ChatWebsiteId':_0x38db9d[_0x3256('0x54')]['id'],'ChatInteractionId':_0x1a504e['id'],'direction':'in','ContactId':_0x1503ee[_0x3256('0xa3')]['id'],'AttachmentId':_0x38db9d[_0x3256('0x5a')][_0x3256('0xc2')]});})['then'](function(_0x1e61ee){_0x1503ee[_0x3256('0x26')]=_0x1e61ee;if(_0x1503ee[_0x3256('0xb8')][_0x3256('0xc3')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x1503ee[_0x3256('0xb8')][_0x3256('0xc3')]}})['then'](function(_0x1a545d){if(_0x1a545d){_0x1503ee[_0x3256('0x9c')][_0x3256('0xc4')]({'id':0x0,'priority':0x0,'app':_0x3256('0xc5'),'appdata':_0x1a545d[_0x3256('0x38')]+','+(_0x1503ee[_0x3256('0xa0')][_0x3256('0xc6')]||0xa),'interval':'*,*,*,*'});_0x1503ee[_0x3256('0xc7')]=!![];}return respondWithRpcPromise(_0x3256('0xc8'),'startRouting',_0x1503ee);});}return respondWithRpcPromise(_0x3256('0xc8'),_0x3256('0xc9'),_0x1503ee);})[_0x3256('0x1e')](function(_0x8f1ea9){respondWithRpcPromise(_0x3256('0xca'),_0x3256('0xca'),{'event':_0x3256('0x84'),'message':_0x8f1ea9},client9002);return _0x8f1ea9;})['then'](respondWithResult(_0x3b44e7,null))['catch'](handleError(_0x3b44e7,null));};exports[_0x3256('0xcb')]=function(_0x5a6f32,_0x4eee1e,_0x381919){var _0x10cbf2,_0x233fc8,_0x459ff0;var _0x46fa79=[];var _0x154ad6=[];var _0xaed7db={};var _0x4d880f=_0x5a6f32[_0x3256('0xcc')]||[];var _0x663949=[];var _0x470eda;return db[_0x3256('0xa2')][_0x3256('0x60')]()[_0x3256('0x1e')](function(_0x1fd0a2){if(!_0x1fd0a2){throw new db[(_0x3256('0x8a'))][(_0x3256('0x8b'))](_0x3256('0x8c'));}_0x154ad6=_[_0x3256('0x8f')](_[_0x3256('0x56')](_0x1fd0a2),['createdAt',_0x3256('0x8e')]);_0x46fa79=_[_0x3256('0x8f')](_[_0x3256('0x56')](_0x1fd0a2),[_0x3256('0x8d'),_0x3256('0x8e'),'CompanyId',_0x3256('0x91')]);if(_0x5a6f32[_0x3256('0x5a')]['id']){delete _0x5a6f32[_0x3256('0x5a')]['id'];}if(_[_0x3256('0x76')](_0x5a6f32[_0x3256('0x5a')]['from'])){throw _0x4eee1e[_0x3256('0x29')](0x1f4)[_0x3256('0x39')](new db['Sequelize']['ValidationError'](_0x3256('0x93')));}if(_[_0x3256('0x76')](_0x5a6f32[_0x3256('0x5a')][_0x3256('0x5a')])||_0x5a6f32['body'][_0x3256('0x5a')]===''){throw _0x4eee1e['status'](0x1f4)[_0x3256('0x39')](new db['Sequelize'][(_0x3256('0x8b'))](_0x3256('0xcd')));}if(_['isNil'](_0x5a6f32[_0x3256('0x5a')][_0x3256('0xce')])){throw _0x4eee1e[_0x3256('0x29')](0x1f4)[_0x3256('0x39')](new db['Sequelize']['ValidationError'](_0x3256('0xcf')+_0x46fa79));}if(!_[_0x3256('0x94')](_0x46fa79,_0x5a6f32[_0x3256('0x5a')][_0x3256('0xce')])){throw _0x4eee1e[_0x3256('0x29')](0x1f4)[_0x3256('0x39')](new db[(_0x3256('0x8a'))]['ValidationError'](_0x3256('0xd0')+_0x46fa79));}_0xaed7db[_0x5a6f32[_0x3256('0x5a')][_0x3256('0xce')]]=_0x5a6f32[_0x3256('0x5a')][_0x3256('0x92')];})[_0x3256('0x1e')](function(){return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x5a6f32[_0x3256('0x54')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x3256('0xd1')],'as':_0x3256('0xd1')}]});})[_0x3256('0x1e')](handleEntityNotFound(_0x4eee1e,null))[_0x3256('0x1e')](function(_0x215ca5){if(_0x215ca5&&_0x215ca5['List']){_0x233fc8=_0x215ca5;var _0x73d64a=_[_0x3256('0xa1')](_0x5a6f32[_0x3256('0x5a')],{'firstName':_0x5a6f32[_0x3256('0x5a')][_0x3256('0x92')],'phone':_0x5a6f32[_0x3256('0x5a')][_0x3256('0x92')],'ListId':_0x215ca5['ListId']});_0x73d64a[_0x5a6f32['body'][_0x3256('0xce')]]=_0x5a6f32[_0x3256('0x5a')][_0x3256('0x92')];return db[_0x3256('0xa2')][_0x3256('0xd2')]({'where':_0xaed7db,'defaults':_0x73d64a});}})['spread'](function(_0x573cd9){if(_0x573cd9){_0x459ff0=_0x573cd9;var _0x598721=fs[_0x3256('0xd3')](path[_0x3256('0x74')](config['root'],_0x3256('0xd4')),_0x3256('0xd5'));var _0x20b4b7=ejs[_0x3256('0xd6')](_0x598721,{'body':_[_0x3256('0xd7')](_0x5a6f32[_0x3256('0x5a')][_0x3256('0x5a')]),'bodyTitle':_0x233fc8[_0x3256('0xd8')]});return db[_0x3256('0xd9')][_0x3256('0x59')]({'body':_0x20b4b7,'ContactId':_0x573cd9['id'],'ChatWebsiteId':_0x233fc8['id']});}})['then'](function(_0x2a2d13){_0x470eda=_0x2a2d13;if(_0x4d880f[_0x3256('0x47')]){var _0x5f50bd=_0x4d880f['map'](function(_0x42508f){return{'name':_0x42508f[_0x3256('0xda')],'basename':_0x42508f['filename'],'type':_0x42508f[_0x3256('0xdb')],'ChatOfflineMessageId':_0x2a2d13['id']};});_0x663949=_0x5f50bd[_0x3256('0x3b')](_0x4edf95=>{var _0x479a03={'filename':_0x4edf95[_0x3256('0x38')],'path':path['join'](config[_0x3256('0x78')],_0x3256('0xdc'),_0x3256('0xcc'),_0x3256('0xdd'),_0x3256('0xde'),_0x4edf95[_0x3256('0xdf')])};return _0x479a03;});if(!_0x233fc8[_0x3256('0xe0')]){return db[_0x3256('0xe1')]['transaction'](function(_0x4eb54a){return db[_0x3256('0xe2')][_0x3256('0xe3')](_0x5f50bd,{'transaction':_0x4eb54a});});}}})['then'](function(){if(_0x470eda){_0x10cbf2=_0x470eda;return db[_0x3256('0xd1')][_0x3256('0x64')]({'where':{'active':!![]},'include':[{'model':db[_0x3256('0xe4')],'as':_0x3256('0xe5'),'raw':!![]}]});}})[_0x3256('0x1e')](function(_0x4d574e){if(_0x4d574e&&_0x4d574e['Smtp']&&_0x233fc8[_0x3256('0xe6')]&&_0x233fc8[_0x3256('0xe7')]){var _0x500ce1={'tls':{'rejectUnauthorized':![]}};if(_0x4d574e[_0x3256('0xe5')][_0x3256('0xe8')]){_0x500ce1[_0x3256('0xe8')]=_0x4d574e[_0x3256('0xe5')][_0x3256('0xe8')];}else{_0x500ce1[_0x3256('0xe9')]=_0x4d574e[_0x3256('0xe5')]['host'];_0x500ce1[_0x3256('0xea')]=_0x4d574e[_0x3256('0xe5')][_0x3256('0xea')];_0x500ce1[_0x3256('0xeb')]=_0x4d574e['Smtp'][_0x3256('0xeb')];}if(_0x4d574e[_0x3256('0xe5')]['authentication']){_0x500ce1[_0x3256('0xec')]={'user':_0x4d574e[_0x3256('0xe5')][_0x3256('0x5b')],'pass':_0x4d574e[_0x3256('0xe5')]['pass']};}return respondWithRpcPromise('SendMail',_0x3256('0xed'),{'account':_0x500ce1,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x4d574e[_0x3256('0x38')],_0x4d574e[_0x3256('0xee')]||_0x4d574e['Smtp'][_0x3256('0x5b')]),'to':_0x233fc8['forwardOfflineAddress'],'subject':_0x233fc8[_0x3256('0xef')],'html':_0x10cbf2[_0x3256('0x5a')],'attachments':_0x663949}},client9003)[_0x3256('0x1e')](function(){return _0x10cbf2;})['catch'](function(_0x7351e3){console[_0x3256('0x24')](_0x7351e3);});}})['then'](function(){if(_0x233fc8&&_0x233fc8[_0x3256('0xe0')]&&_0x233fc8['MailAccountId']){var _0x1c8065=[];if(_0x4d880f[_0x3256('0x47')]){_0x1c8065=_0x4d880f[_0x3256('0x3b')](function(_0x33f8c1){return{'name':_0x33f8c1[_0x3256('0xda')],'basename':_0x33f8c1[_0x3256('0x6e')],'type':_0x33f8c1[_0x3256('0xdb')],'ChatOfflineMessageId':_0x470eda['id']};});}var _0x2f3198;if(!_[_0x3256('0x76')](_0x233fc8[_0x3256('0xf0')])){var _0x4bc83c=_[_0x3256('0x3b')](_0x5a6f32[_0x3256('0x5a')],function(_0x4d88d7){return _0x4d88d7;});var _0x1bb59b=_['toPairsIn'](_0x4bc83c)[0x0];var _0x20f530=_['mapValues'](_0x1bb59b,function(_0x256d78){return _0x256d78;});_0x2f3198=_0x20f530[0x1][_0x233fc8[_0x3256('0xf0')]];}var _0x53dcdc={'from':_0x459ff0[_0x3256('0xee')],'firstName':_0x459ff0[_0x3256('0xa9')],'lastName':_0x459ff0[_0x3256('0xaa')],'mapKey':'email','message':{'from':_0x459ff0['email'],'to':_0x233fc8[_0x3256('0xd1')][_0x3256('0xee')],'cc':'','subject':_[_0x3256('0x76')](_0x2f3198)?_0x233fc8[_0x3256('0xef')]:_0x2f3198,'messageId':'','sentAt':new Date(),'attach':_0x1c8065[_0x3256('0x47')],'attachments':_0x1c8065,'originChannel':_0x3256('0xf1'),'ChatWebsiteId':_0x233fc8['id'],'ChatOfflineMessageId':_0x10cbf2['id'],'originTo':_0x233fc8['MailAccount'][_0x3256('0xee')]},'body':_0x10cbf2[_0x3256('0x5a')]};var _0x50df33={'account':{'id':_0x233fc8[_0x3256('0xf2')]},'body':_0x53dcdc,'log':_0x3256('0xf3')};return respondWithRpcPromise(_0x3256('0xf3'),_0x3256('0xf4'),_0x50df33,client9001)[_0x3256('0x1e')](function(){return _0x10cbf2;})[_0x3256('0x52')](function(_0x5edb86){console[_0x3256('0x24')](_0x5edb86);});}return;})['then'](function(){if(_0x10cbf2){return _0x10cbf2;}})[_0x3256('0x1e')](respondWithResult(_0x4eee1e,null))['catch'](function(_0x36ba02){console[_0x3256('0x24')](_0x3256('0x52'),_0x36ba02);for(var _0x479862 of _0x4d880f){var _0x48651d=path['join'](config[_0x3256('0x78')],'server',_0x3256('0xcc'),'attachments',_0x3256('0xde'),_0x479862[_0x3256('0x6e')]);fs_extra[_0x3256('0xf5')](_0x48651d)[_0x3256('0x52')](function(_0x236d64){console[_0x3256('0x24')]('Could\x20not\x20remove\x20attachment\x20file',_0x48651d,_0x236d64);});}});};exports['addInteraction']=function(_0x4360b5,_0x229858,_0x3468ad){return db['ChatInteraction'][_0x3256('0x58')]({'where':{'id':_0x4360b5['params']['id']}})['then'](handleEntityNotFound(_0x229858,null))['then'](function(_0x399a81){if(_0x399a81){return _0x399a81[_0x3256('0xf6')](_0x4360b5['body'][_0x3256('0x68')],_[_0x3256('0xf7')](_0x4360b5['body'],[_0x3256('0x68'),'id'])||{});}})[_0x3256('0x1e')](respondWithResult(_0x229858,null))[_0x3256('0x52')](handleError(_0x229858,null));};exports[_0x3256('0xf8')]=function(_0x450719,_0x15b088,_0xaf5f56){var _0x269118={'raw':![],'where':{}};var _0x5007ba={};var _0x4d84b9={'count':0x0,'rows':[]};return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x450719[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x15b088,null))[_0x3256('0x1e')](function(_0x5d343e){if(_0x5d343e){_0x5007ba['model']=_[_0x3256('0x56')](db[_0x3256('0xb7')][_0x3256('0x3d')]);_0x5007ba['query']=_[_0x3256('0x56')](_0x450719['query']);_0x5007ba[_0x3256('0x42')]=_[_0x3256('0x45')](_0x5007ba['model'],_0x5007ba[_0x3256('0x41')]);_0x269118[_0x3256('0x44')]=_['intersection'](_0x5007ba[_0x3256('0x43')],qs['fields'](_0x450719['query']['fields']));_0x269118['attributes']=_0x269118[_0x3256('0x44')][_0x3256('0x47')]?_0x269118[_0x3256('0x44')]:_0x5007ba[_0x3256('0x43')];if(!_0x450719['query']['hasOwnProperty'](_0x3256('0x49'))){_0x269118['limit']=qs[_0x3256('0x2d')](_0x450719[_0x3256('0x41')][_0x3256('0x2d')]);_0x269118[_0x3256('0x2f')]=qs['offset'](_0x450719[_0x3256('0x41')][_0x3256('0x2f')]);}_0x269118['order']=qs[_0x3256('0x4a')](_0x450719[_0x3256('0x41')][_0x3256('0x4a')]);_0x269118['where']=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x450719[_0x3256('0x41')],_0x5007ba[_0x3256('0x42')]));_0x269118[_0x3256('0x4b')][_0x3256('0x61')]=_0x5d343e['id'];if(_0x450719[_0x3256('0x41')]['filter']){_0x269118[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x269118[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x269118[_0x3256('0x44')],function(_0x18aefa){var _0x3ed588={};_0x3ed588[_0x18aefa]={'$like':'%'+_0x450719[_0x3256('0x41')][_0x3256('0x4e')]+'%'};return _0x3ed588;})});}_0x269118=_[_0x3256('0x4d')]({},_0x269118,_0x450719[_0x3256('0x66')]);return db[_0x3256('0xb7')][_0x3256('0x2e')]({'where':_0x269118[_0x3256('0x4b')]})['then'](function(_0x57f8fb){_0x4d84b9[_0x3256('0x2e')]=_0x57f8fb;if(_0x450719['query'][_0x3256('0x57')]){_0x269118[_0x3256('0x4f')]=[{'model':db[_0x3256('0xa2')],'as':_0x3256('0xf9'),'required':![]},{'model':db[_0x3256('0xfa')],'as':_0x3256('0xfb'),'attributes':['name',_0x3256('0xfc'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x3256('0xfd'),'attributes':['id',_0x3256('0x38'),_0x3256('0xfe')],'where':_0x450719[_0x3256('0x41')]['tag']?{'id':_0x450719[_0x3256('0x41')]['tag']}:undefined,'required':_0x450719['query'][_0x3256('0xff')]?!![]:![]}];}return db['ChatInteraction'][_0x3256('0x50')](_0x269118);})[_0x3256('0x1e')](function(_0x4d6fe6){_0x4d84b9[_0x3256('0x51')]=_0x4d6fe6;return _0x4d84b9;});}})[_0x3256('0x1e')](respondWithFilteredResult(_0x15b088,_0x269118))[_0x3256('0x52')](handleError(_0x15b088,null));};function iftimePromise(_0x24f00f,_0x352aa9){return respondWithRpcPromise(_0x3256('0x100'),_0x3256('0x101'),{'command':_0x352aa9[_0x3256('0x102')]?util[_0x3256('0xaf')](_0x3256('0x103'),_0x24f00f['interval'],_0x352aa9[_0x3256('0x102')]):util[_0x3256('0xaf')](_0x3256('0x104'),_0x24f00f[_0x3256('0x105')])},client9002)[_0x3256('0x1e')](function(_0xcbfe47){var _0x44f49d=_0xcbfe47&&_0xcbfe47['indexOf']('true')>=0x0?!![]:![];logger[_0x3256('0x1f')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x352aa9['id'],_0x24f00f['id'],_0x24f00f[_0x3256('0x105')],_0x44f49d?_0x3256('0x106'):_0x3256('0x107'),_0x352aa9[_0x3256('0x102')]?_0x352aa9[_0x3256('0x102')]:_0x3256('0x108'));return _0x44f49d;})[_0x3256('0x52')](function(_0x14149c){logger[_0x3256('0x24')](_0x3256('0x109'),_0x352aa9['id'],_0x24f00f['id'],_0x24f00f[_0x3256('0x105')],util[_0x3256('0x10a')](_0x14149c,{'showHidden':![],'depth':null}),_0x352aa9['timezone']?_0x352aa9[_0x3256('0x102')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x5ba3ad,_0x422bc4,_0x10d4a7){var _0x3567fe=0x0;var _0x3b4d7f=0x0;var _0x11e641=![];var _0xc9a6fe;var _0x2506cf;return db[_0x3256('0x3c')]['find']({'where':{'id':_0x5ba3ad[_0x3256('0x54')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x3256('0x10b')],'as':_0x3256('0x10c'),'attributes':['id',_0x3256('0x105')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x422bc4,null))[_0x3256('0x1e')](function(_0x3a01f4){if(_0x3a01f4){_0xc9a6fe=_0x3a01f4;return _0x3a01f4[_0x3256('0x10d')]({'raw':!![]});}})['then'](function(_0x38c9a1){if(_0xc9a6fe){if(_0x38c9a1){_0x2506cf=_0x38c9a1;}}return require(_0x3256('0x16'))[_0x3256('0x10e')]();})[_0x3256('0x1e')](function(_0x476bed){if(_0x476bed){_0x3b4d7f=_0x476bed['virtual'];_0x11e641=_0x476bed[_0x3256('0x10f')];}})['then'](function(){return db[_0x3256('0xb7')][_0x3256('0x2e')]({'where':{'closed':![]}});})[_0x3256('0x1e')](function(_0x4e35fa){_0x3567fe=_0x4e35fa;if(_0x3b4d7f&&_0x4e35fa>_0x3b4d7f){return db[_0x3256('0x110')][_0x3256('0x64')]({'where':{'id':0x1}})[_0x3256('0x1e')](function(_0x4e72c2){if(_0x4e72c2){_0x4e72c2['increment']('chatLicenseExceeded');}});}})[_0x3256('0x1e')](function(){if(_0xc9a6fe['Interval']&&_0xc9a6fe['Interval'][_0x3256('0x10c')]){var _0x455e6c=[];for(var _0x58660a=0x0;_0x58660a<_0xc9a6fe[_0x3256('0x10b')][_0x3256('0x10c')][_0x3256('0x47')];_0x58660a++){var _0x48206c=_0xc9a6fe['Interval']['Intervals'][_0x58660a][_0x3256('0x5c')]({'plain':!![]});_0x455e6c['push'](iftimePromise(_0x48206c,_0xc9a6fe));}return BPromise[_0x3256('0x111')](_0x455e6c)[_0x3256('0x1e')](function(_0x511ed5){return _[_0x3256('0x112')](_0x511ed5);});}else{return!![];}})['then'](function(_0x2e4121){var _0x291151=fs[_0x3256('0xd3')](path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x113')),_0x3256('0xd5'));var _0x2149a1={'remote':_0xc9a6fe[_0x3256('0x114')],'query':querystring[_0x3256('0x23')](_['merge'](_0xc9a6fe[_0x3256('0x5c')]({'plain':!![]}),{'customerIp':_0x5ba3ad[_0x3256('0xa4')][_0x3256('0xa6')]||_0x5ba3ad[_0x3256('0xa4')][_0x3256('0x115')]||_0x5ba3ad[_0x3256('0x116')][_0x3256('0x117')]||_0x5ba3ad['ip'],'referer':_0x5ba3ad['headers'][_0x3256('0xac')],'openedInteractions':_0x3567fe,'maxInteractions':_0x3b4d7f,'virtual':_0x11e641[_0x3256('0x118')],'online':_0x2e4121,'custom':_0x11e641}))[_0x3256('0x119')](/'/g,'\x5c\x27')};_0x422bc4['send'](ejs[_0x3256('0xd6')](Mustache['render'](_0x291151,_0x2149a1),{'proactiveActions':_0x2506cf,'alignment':_0xc9a6fe[_0x3256('0x11a')],'verticalAlignment':_0xc9a6fe[_0x3256('0x11b')],'div_color':_0xc9a6fe['color'],'text_color':_0xc9a6fe['textColor'],'button_color':_0xc9a6fe[_0x3256('0x11c')],'background_color':_0xc9a6fe['backgroundColor']}));})[_0x3256('0x52')](handleError(_0x422bc4,null));};exports['addApplications']=function(_0x342e26,_0x4c5e64,_0x1bc136){return db['ChatWebsite'][_0x3256('0x64')]({'where':{'id':_0x342e26['params']['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x4c5e64,null))['then'](function(_0x2e24a5){if(_0x2e24a5){return db['sequelize'][_0x3256('0x11d')](function(_0x1e4efb){return db[_0x3256('0x11e')][_0x3256('0x34')]({'where':{'ChatWebsiteId':_0x342e26[_0x3256('0x54')]['id']},'transaction':_0x1e4efb})[_0x3256('0x1e')](function(_0x446ba5){var _0x257b3f=_[_0x3256('0x3b')](_0x342e26['body'],function(_0x561d3d){_0x561d3d['ChatWebsiteId']=_0x342e26[_0x3256('0x54')]['id'];return _0x561d3d;});return db[_0x3256('0x11e')][_0x3256('0xe3')](_0x257b3f,{'transaction':_0x1e4efb});});})[_0x3256('0x1e')](function(){return db['ChatApplication'][_0x3256('0x11f')]({'where':{'ChatWebsiteId':_0x342e26[_0x3256('0x54')]['id']},'order':'priority'});});}})[_0x3256('0x1e')](respondWithResult(_0x4c5e64,null))['catch'](handleError(_0x4c5e64,null));};exports[_0x3256('0x120')]=function(_0x7ecf31,_0x3ffd9b,_0x2cbcff){var _0x3dc0d3={};var _0x58a681={};var _0x37a5e9;var _0x3870fe;return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x7ecf31[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x3ffd9b,null))[_0x3256('0x1e')](function(_0x37f02d){if(_0x37f02d){_0x37a5e9=_0x37f02d;_0x58a681[_0x3256('0x43')]=_[_0x3256('0x56')](db[_0x3256('0x11e')][_0x3256('0x3d')]);_0x58a681[_0x3256('0x41')]=_[_0x3256('0x56')](_0x7ecf31[_0x3256('0x41')]);_0x58a681[_0x3256('0x42')]=_[_0x3256('0x45')](_0x58a681[_0x3256('0x43')],_0x58a681['query']);_0x3dc0d3[_0x3256('0x44')]=_[_0x3256('0x45')](_0x58a681[_0x3256('0x43')],qs['fields'](_0x7ecf31[_0x3256('0x41')][_0x3256('0x46')]));_0x3dc0d3[_0x3256('0x44')]=_0x3dc0d3[_0x3256('0x44')][_0x3256('0x47')]?_0x3dc0d3['attributes']:_0x58a681[_0x3256('0x43')];_0x3dc0d3[_0x3256('0x65')]=qs[_0x3256('0x4a')](_0x7ecf31[_0x3256('0x41')][_0x3256('0x4a')]);_0x3dc0d3[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x7ecf31[_0x3256('0x41')],_0x58a681[_0x3256('0x42')]));if(_0x7ecf31[_0x3256('0x41')][_0x3256('0x4e')]){_0x3dc0d3[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x3dc0d3[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x3dc0d3['attributes'],function(_0x4d0f3d){var _0x3f1472={};_0x3f1472[_0x4d0f3d]={'$like':'%'+_0x7ecf31['query'][_0x3256('0x4e')]+'%'};return _0x3f1472;})});}_0x3dc0d3=_[_0x3256('0x4d')]({},_0x3dc0d3,_0x7ecf31['options']);return _0x37a5e9[_0x3256('0x120')](_0x3dc0d3);}})[_0x3256('0x1e')](function(_0x472bf9){if(_0x472bf9){_0x3870fe=_0x472bf9[_0x3256('0x47')];if(!_0x7ecf31[_0x3256('0x41')][_0x3256('0x48')]('nolimit')){_0x3dc0d3['limit']=qs[_0x3256('0x2d')](_0x7ecf31[_0x3256('0x41')][_0x3256('0x2d')]);_0x3dc0d3[_0x3256('0x2f')]=qs[_0x3256('0x2f')](_0x7ecf31[_0x3256('0x41')]['offset']);}return _0x37a5e9[_0x3256('0x120')](_0x3dc0d3);}})[_0x3256('0x1e')](function(_0x3afa09){if(_0x3afa09){return _0x3afa09?{'count':_0x3870fe,'rows':_0x3afa09}:null;}})['then'](respondWithResult(_0x3ffd9b,null))[_0x3256('0x52')](handleError(_0x3ffd9b,null));};exports[_0x3256('0x121')]=function(_0x43b2d7,_0x5632d2,_0xf3397d){return db['chatProactiveAction'][_0x3256('0x58')]({'where':{'id':_0x43b2d7[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x5632d2,null))['then'](function(_0x50ed67){if(_0x50ed67){return _0x50ed67[_0x3256('0x121')](_0x43b2d7[_0x3256('0x5a')][_0x3256('0x68')],_[_0x3256('0xf7')](_0x43b2d7[_0x3256('0x5a')],['ids','id'])||{});}})[_0x3256('0x1e')](respondWithResult(_0x5632d2,null))[_0x3256('0x52')](handleError(_0x5632d2,null));};exports[_0x3256('0x10d')]=function(_0x490ae7,_0x2db02d,_0x385fc4){var _0x5e75df={};var _0x3397e6={};var _0x4e8ab2;var _0x2ecacd;return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x490ae7[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x2db02d,null))[_0x3256('0x1e')](function(_0x55ef80){if(_0x55ef80){_0x4e8ab2=_0x55ef80;_0x3397e6[_0x3256('0x43')]=_['keys'](db[_0x3256('0x122')]['rawAttributes']);_0x3397e6[_0x3256('0x41')]=_[_0x3256('0x56')](_0x490ae7[_0x3256('0x41')]);_0x3397e6[_0x3256('0x42')]=_[_0x3256('0x45')](_0x3397e6['model'],_0x3397e6['query']);_0x5e75df[_0x3256('0x44')]=_[_0x3256('0x45')](_0x3397e6[_0x3256('0x43')],qs[_0x3256('0x46')](_0x490ae7[_0x3256('0x41')][_0x3256('0x46')]));_0x5e75df['attributes']=_0x5e75df[_0x3256('0x44')][_0x3256('0x47')]?_0x5e75df['attributes']:_0x3397e6[_0x3256('0x43')];_0x5e75df['order']=qs[_0x3256('0x4a')](_0x490ae7[_0x3256('0x41')][_0x3256('0x4a')]);_0x5e75df[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x490ae7['query'],_0x3397e6[_0x3256('0x42')]));if(_0x490ae7[_0x3256('0x41')][_0x3256('0x4e')]){_0x5e75df[_0x3256('0x4b')]=_['merge'](_0x5e75df[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x5e75df[_0x3256('0x44')],function(_0x365c36){var _0x26364e={};_0x26364e[_0x365c36]={'$like':'%'+_0x490ae7['query']['filter']+'%'};return _0x26364e;})});}_0x5e75df=_[_0x3256('0x4d')]({},_0x5e75df,_0x490ae7['options']);return _0x4e8ab2[_0x3256('0x10d')](_0x5e75df);}})['then'](function(_0x442449){if(_0x442449){_0x2ecacd=_0x442449[_0x3256('0x47')];if(!_0x490ae7[_0x3256('0x41')][_0x3256('0x48')](_0x3256('0x49'))){_0x5e75df[_0x3256('0x2d')]=qs['limit'](_0x490ae7[_0x3256('0x41')][_0x3256('0x2d')]);_0x5e75df[_0x3256('0x2f')]=qs[_0x3256('0x2f')](_0x490ae7[_0x3256('0x41')][_0x3256('0x2f')]);}return _0x4e8ab2['getProactiveActions'](_0x5e75df);}})[_0x3256('0x1e')](function(_0x5dab2b){if(_0x5dab2b){return _0x5dab2b?{'count':_0x2ecacd,'rows':_0x5dab2b}:null;}})['then'](respondWithResult(_0x2db02d,null))[_0x3256('0x52')](handleError(_0x2db02d,null));};exports[_0x3256('0x123')]=function(_0x206956,_0x5e5886,_0x5e1cca){var _0x144483=_0x206956['query'][_0x3256('0x124')]==='false'?_0x3256('0x125'):_0x3256('0x126');return db['ChatWebsite'][_0x3256('0x58')]({'attributes':['id',_0x144483],'where':{'id':_0x206956[_0x3256('0x54')]['id']}})['then'](handleEntityNotFound(_0x5e5886,null))[_0x3256('0x1e')](function(_0x8bdae4){if(_0x8bdae4){var _0x151b37=_0x8bdae4[_0x144483];var _0x4e4d0c=_0x151b37&&_0x151b37[_0x3256('0x127')]?_0x151b37[_0x3256('0x127')]:[];_0x5e5886['send']({'fromKey':_[_0x3256('0x76')](_0x151b37[_0x3256('0x128')])?undefined:_0x151b37[_0x3256('0x128')],'count':_0x4e4d0c[_0x3256('0x47')],'rows':_0x4e4d0c});}})[_0x3256('0x52')](handleError(_0x5e5886,null));};exports[_0x3256('0x129')]=function(_0x540e0c,_0x39d21c,_0x28f78c){var _0x1d2f44={'raw':![],'where':{}};var _0x51787c={};var _0x3aedce={'count':0x0,'rows':[]};return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x540e0c[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x39d21c,null))['then'](function(_0x43011f){if(_0x43011f){_0x51787c[_0x3256('0x43')]=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x51787c[_0x3256('0x41')]=_[_0x3256('0x56')](_0x540e0c[_0x3256('0x41')]);_0x51787c[_0x3256('0x42')]=_[_0x3256('0x45')](_0x51787c[_0x3256('0x43')],_0x51787c['query']);_0x1d2f44[_0x3256('0x44')]=_[_0x3256('0x45')](_0x51787c['model'],qs[_0x3256('0x46')](_0x540e0c[_0x3256('0x41')][_0x3256('0x46')]));_0x1d2f44[_0x3256('0x44')]=_0x1d2f44[_0x3256('0x44')][_0x3256('0x47')]?_0x1d2f44[_0x3256('0x44')]:_0x51787c[_0x3256('0x43')];if(!_0x540e0c[_0x3256('0x41')][_0x3256('0x48')](_0x3256('0x49'))){_0x1d2f44['limit']=qs[_0x3256('0x2d')](_0x540e0c[_0x3256('0x41')][_0x3256('0x2d')]);_0x1d2f44[_0x3256('0x2f')]=qs[_0x3256('0x2f')](_0x540e0c['query']['offset']);}_0x1d2f44[_0x3256('0x65')]=qs['sort'](_0x540e0c[_0x3256('0x41')][_0x3256('0x4a')]);_0x1d2f44[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x540e0c[_0x3256('0x41')],_0x51787c[_0x3256('0x42')]));_0x1d2f44[_0x3256('0x4b')]['ChatWebsiteId']=_0x43011f['id'];if(_0x540e0c[_0x3256('0x41')][_0x3256('0x4e')]){_0x1d2f44[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x1d2f44['where'],{'$or':_[_0x3256('0x3b')](_0x1d2f44[_0x3256('0x44')],function(_0x538960){var _0x3fc4d3={};_0x3fc4d3[_0x538960]={'$like':'%'+_0x540e0c[_0x3256('0x41')]['filter']+'%'};return _0x3fc4d3;})});}_0x1d2f44=_[_0x3256('0x4d')]({},_0x1d2f44,_0x540e0c[_0x3256('0x66')]);return db['ChatOfflineMessage'][_0x3256('0x2e')]({'where':_0x1d2f44['where']})['then'](function(_0x136421){_0x3aedce[_0x3256('0x2e')]=_0x136421;if(_0x540e0c[_0x3256('0x41')][_0x3256('0x57')]){_0x1d2f44[_0x3256('0x4f')]=[{'all':!![]}];}else{_0x1d2f44[_0x3256('0x4f')]=[{'model':db[_0x3256('0xa2')],'as':_0x3256('0xf9'),'required':![]},{'model':db[_0x3256('0xe2')],'as':_0x3256('0x12a'),'required':![]}];}return db[_0x3256('0xd9')][_0x3256('0x50')](_0x1d2f44);})[_0x3256('0x1e')](function(_0xa8cdef){_0x3aedce[_0x3256('0x51')]=_0xa8cdef;return _0x3aedce;});}})[_0x3256('0x1e')](respondWithFilteredResult(_0x39d21c,_0x1d2f44))[_0x3256('0x52')](handleError(_0x39d21c,null));};exports[_0x3256('0x12b')]=function(_0x5e6ce7,_0x554254,_0x100035){return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x5e6ce7[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x554254,null))[_0x3256('0x1e')](function(_0x3a72c4){if(_0x3a72c4){return _0x3a72c4[_0x3256('0x12b')](_0x5e6ce7[_0x3256('0x5a')][_0x3256('0x68')],_[_0x3256('0xf7')](_0x5e6ce7[_0x3256('0x5a')],[_0x3256('0x68'),'id'])||{})[_0x3256('0xb9')](function(_0x1bb4b6){for(var _0x16c5c7=0x0;_0x16c5c7<_0x5e6ce7[_0x3256('0x5a')][_0x3256('0x68')][_0x3256('0x47')];_0x16c5c7+=0x1){socket[_0x3256('0x12c')](_0x3256('0x12d'),{'UserId':Number(_0x5e6ce7[_0x3256('0x5a')][_0x3256('0x68')][_0x16c5c7]),'ChatWebsiteId':Number(_0x5e6ce7[_0x3256('0x54')]['id'])});}return _0x1bb4b6;});}})['then'](respondWithResult(_0x554254,null))[_0x3256('0x52')](handleError(_0x554254,null));};exports[_0x3256('0x12e')]=function(_0x1573ba,_0x3e0e13,_0x428ba3){return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x1573ba[_0x3256('0x54')]['id']}})['then'](handleEntityNotFound(_0x3e0e13,null))[_0x3256('0x1e')](function(_0x52fe2a){if(_0x52fe2a){return _0x52fe2a[_0x3256('0x12e')](_0x1573ba[_0x3256('0x41')][_0x3256('0x68')])[_0x3256('0x1e')](function(){if(_['isArray'](_0x1573ba[_0x3256('0x41')]['ids'])){for(var _0x1b0a6b=0x0;_0x1b0a6b<_0x1573ba[_0x3256('0x41')][_0x3256('0x68')]['length'];_0x1b0a6b+=0x1){socket['emit'](_0x3256('0x12f'),{'UserId':Number(_0x1573ba[_0x3256('0x41')][_0x3256('0x68')][_0x1b0a6b]),'ChatWebsiteId':Number(_0x1573ba[_0x3256('0x54')]['id'])});}}else{socket[_0x3256('0x12c')](_0x3256('0x12f'),{'UserId':Number(_0x1573ba[_0x3256('0x41')]['ids']),'ChatWebsiteId':Number(_0x1573ba[_0x3256('0x54')]['id'])});}});}})[_0x3256('0x1e')](respondWithStatusCode(_0x3e0e13,null))['catch'](handleError(_0x3e0e13,null));};exports[_0x3256('0x130')]=function(_0xf66eac,_0x156cf8,_0x4aaa99){var _0x262dae={};var _0x4e20c0={};var _0x4c4305;var _0x5c5216;return db['ChatWebsite']['findOne']({'where':{'id':_0xf66eac[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x156cf8,null))['then'](function(_0x48c9d8){if(_0x48c9d8){_0x4c4305=_0x48c9d8;_0x4e20c0[_0x3256('0x43')]=_[_0x3256('0x56')](db['User'][_0x3256('0x3d')]);_0x4e20c0['query']=_['keys'](_0xf66eac[_0x3256('0x41')]);_0x4e20c0[_0x3256('0x42')]=_[_0x3256('0x45')](_0x4e20c0[_0x3256('0x43')],_0x4e20c0[_0x3256('0x41')]);_0x262dae['attributes']=_[_0x3256('0x45')](_0x4e20c0[_0x3256('0x43')],qs[_0x3256('0x46')](_0xf66eac[_0x3256('0x41')][_0x3256('0x46')]));_0x262dae['attributes']=_0x262dae[_0x3256('0x44')]['length']?_0x262dae[_0x3256('0x44')]:_0x4e20c0[_0x3256('0x43')];_0x262dae[_0x3256('0x65')]=qs[_0x3256('0x4a')](_0xf66eac[_0x3256('0x41')][_0x3256('0x4a')]);_0x262dae[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0xf66eac[_0x3256('0x41')],_0x4e20c0[_0x3256('0x42')]));if(_0xf66eac[_0x3256('0x41')][_0x3256('0x4e')]){_0x262dae['where']=_[_0x3256('0x4d')](_0x262dae[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x262dae[_0x3256('0x44')],function(_0x5576c5){var _0x47f7b0={};_0x47f7b0[_0x5576c5]={'$like':'%'+_0xf66eac['query']['filter']+'%'};return _0x47f7b0;})});}_0x262dae=_[_0x3256('0x4d')]({},_0x262dae,_0xf66eac[_0x3256('0x66')]);return _0x4c4305[_0x3256('0x130')](_0x262dae);}})[_0x3256('0x1e')](function(_0x33073e){if(_0x33073e){_0x5c5216=_0x33073e[_0x3256('0x47')];if(!_0xf66eac[_0x3256('0x41')][_0x3256('0x48')](_0x3256('0x49'))){_0x262dae[_0x3256('0x2d')]=qs[_0x3256('0x2d')](_0xf66eac[_0x3256('0x41')][_0x3256('0x2d')]);_0x262dae['offset']=qs[_0x3256('0x2f')](_0xf66eac[_0x3256('0x41')]['offset']);}return _0x4c4305[_0x3256('0x130')](_0x262dae);}})['then'](function(_0x8332df){if(_0x8332df){return _0x8332df?{'count':_0x5c5216,'rows':_0x8332df}:null;}})[_0x3256('0x1e')](respondWithResult(_0x156cf8,null))['catch'](handleError(_0x156cf8,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 8d3f0ef..44f87be 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 _0x61a5=['events','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1f31fa,_0x5e96a){var _0x1b50ba=function(_0x4cbe5b){while(--_0x4cbe5b){_0x1f31fa['push'](_0x1f31fa['shift']());}};_0x1b50ba(++_0x5e96a);}(_0x61a5,0xf0));var _0x561a=function(_0x3f1861,_0x7b4285){_0x3f1861=_0x3f1861-0x0;var _0x7ca70a=_0x61a5[_0x3f1861];return _0x7ca70a;};'use strict';var EventEmitter=require(_0x561a('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x561a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x561a('0x2')](0x0);var events={'afterCreate':_0x561a('0x3'),'afterUpdate':_0x561a('0x4'),'afterDestroy':_0x561a('0x5')};function emitEvent(_0x58f636){return function(_0xe92b4d,_0x33c0f5,_0x5b9ca9){ChatWebsiteEvents[_0x561a('0x6')](_0x58f636+':'+_0xe92b4d['id'],_0xe92b4d);ChatWebsiteEvents[_0x561a('0x6')](_0x58f636,_0xe92b4d);_0x5b9ca9(null);};}for(var e in events){if(events[_0x561a('0x7')](e)){var event=events[e];ChatWebsite[_0x561a('0x8')](e,emitEvent(event));}}module[_0x561a('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x0ef0=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x18eb51,_0x2106a6){var _0x168a91=function(_0x1239ec){while(--_0x1239ec){_0x18eb51['push'](_0x18eb51['shift']());}};_0x168a91(++_0x2106a6);}(_0x0ef0,0x80));var _0x00ef=function(_0xbbcb36,_0x586383){_0xbbcb36=_0xbbcb36-0x0;var _0x4278ff=_0x0ef0[_0xbbcb36];return _0x4278ff;};'use strict';var EventEmitter=require(_0x00ef('0x0'));var ChatWebsite=require(_0x00ef('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x00ef('0x2')](0x0);var events={'afterCreate':_0x00ef('0x3'),'afterUpdate':_0x00ef('0x4'),'afterDestroy':_0x00ef('0x5')};function emitEvent(_0xd4ab59){return function(_0x92e0b,_0x53bad3,_0x5743e8){ChatWebsiteEvents[_0x00ef('0x6')](_0xd4ab59+':'+_0x92e0b['id'],_0x92e0b);ChatWebsiteEvents[_0x00ef('0x6')](_0xd4ab59,_0x92e0b);_0x5743e8(null);};}for(var e in events){if(events[_0x00ef('0x7')](e)){var event=events[e];ChatWebsite[_0x00ef('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 7275ed6..d209c41 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 _0x0f8e=['api','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','util','../../config/logger'];(function(_0x298303,_0x15c755){var _0x220db0=function(_0x12fa67){while(--_0x12fa67){_0x298303['push'](_0x298303['shift']());}};_0x220db0(++_0x15c755);}(_0x0f8e,0x1c1));var _0xe0f8=function(_0x15f590,_0x42b288){_0x15f590=_0x15f590-0x0;var _0x53671c=_0x0f8e[_0x15f590];return _0x53671c;};'use strict';var _=require('lodash');var util=require(_0xe0f8('0x0'));var logger=require(_0xe0f8('0x1'))(_0xe0f8('0x2'));var moment=require('moment');var BPromise=require(_0xe0f8('0x3'));var rp=require(_0xe0f8('0x4'));var fs=require('fs');var path=require(_0xe0f8('0x5'));var rimraf=require(_0xe0f8('0x6'));var config=require('../../config/environment');var attributes=require(_0xe0f8('0x7'));module[_0xe0f8('0x8')]=function(_0x140c64,_0x4e5256){return _0x140c64['define'](_0xe0f8('0x9'),attributes,{'tableName':_0xe0f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb141=['request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird'];(function(_0x1cfa05,_0x1e866c){var _0xbfed13=function(_0x1f92f7){while(--_0x1f92f7){_0x1cfa05['push'](_0x1cfa05['shift']());}};_0xbfed13(++_0x1e866c);}(_0xb141,0xff));var _0x1b14=function(_0x2d0733,_0x5a1e06){_0x2d0733=_0x2d0733-0x0;var _0x50ad90=_0xb141[_0x2d0733];return _0x50ad90;};'use strict';var _=require('lodash');var util=require(_0x1b14('0x0'));var logger=require(_0x1b14('0x1'))(_0x1b14('0x2'));var moment=require(_0x1b14('0x3'));var BPromise=require(_0x1b14('0x4'));var rp=require(_0x1b14('0x5'));var fs=require('fs');var path=require(_0x1b14('0x6'));var rimraf=require(_0x1b14('0x7'));var config=require(_0x1b14('0x8'));var attributes=require('./chatWebsite.attributes');module[_0x1b14('0x9')]=function(_0x4c4d84,_0x17dc71){return _0x4c4d84[_0x1b14('0xa')](_0x1b14('0xb'),attributes,{'tableName':_0x1b14('0xc'),'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 bec1283..dc6583e 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 _0x49bd=['socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x3a027d,_0x43f542){var _0x886d73=function(_0x404a3b){while(--_0x404a3b){_0x3a027d['push'](_0x3a027d['shift']());}};_0x886d73(++_0x43f542);}(_0x49bd,0x1c5));var _0xd49b=function(_0x5ab37c,_0x9ff9e5){_0x5ab37c=_0x5ab37c-0x0;var _0x1657ef=_0x49bd[_0x5ab37c];return _0x1657ef;};'use strict';var _=require(_0xd49b('0x0'));var util=require(_0xd49b('0x1'));var moment=require(_0xd49b('0x2'));var BPromise=require(_0xd49b('0x3'));var rs=require(_0xd49b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd49b('0x5'))['db'];var utils=require(_0xd49b('0x6'));var logger=require(_0xd49b('0x7'))(_0xd49b('0x8'));var config=require('../../config/environment');var jayson=require(_0xd49b('0x9'));var client=jayson[_0xd49b('0xa')][_0xd49b('0xb')]({'port':0x232a});config['redis']=_[_0xd49b('0xc')](config[_0xd49b('0xd')],{'host':_0xd49b('0xe'),'port':0x18eb});var socket=require(_0xd49b('0xf'))(new Redis(config[_0xd49b('0xd')]));require(_0xd49b('0x10'))[_0xd49b('0x11')](socket);function respondWithRpcPromise(_0x1fff22,_0x464fbb,_0x499088){return new BPromise(function(_0x115fbe,_0x36dd4b){return client[_0xd49b('0x12')](_0x1fff22,_0x499088)['then'](function(_0x4ccc2b){logger['info'](_0xd49b('0x13'),_0x464fbb,_0xd49b('0x14'));logger[_0xd49b('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x464fbb,_0xd49b('0x14'),JSON['stringify'](_0x4ccc2b));if(_0x4ccc2b['error']){if(_0x4ccc2b['error']['code']===0x1f4){logger[_0xd49b('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x464fbb,_0x4ccc2b[_0xd49b('0x16')][_0xd49b('0x17')]);return _0x36dd4b(_0x4ccc2b[_0xd49b('0x16')][_0xd49b('0x17')]);}logger['error'](_0xd49b('0x13'),_0x464fbb,_0x4ccc2b[_0xd49b('0x16')][_0xd49b('0x17')]);return _0x115fbe(_0x4ccc2b[_0xd49b('0x16')][_0xd49b('0x17')]);}else{logger[_0xd49b('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x464fbb,'request\x20sent');_0x115fbe(_0x4ccc2b[_0xd49b('0x19')][_0xd49b('0x17')]);}})['catch'](function(_0x300609){logger[_0xd49b('0x16')](_0xd49b('0x13'),_0x464fbb,_0x300609);_0x36dd4b(_0x300609);});});} \ No newline at end of file +var _0x1ac3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x370157,_0x11077f){var _0x5495c6=function(_0x3f21d8){while(--_0x3f21d8){_0x370157['push'](_0x370157['shift']());}};_0x5495c6(++_0x11077f);}(_0x1ac3,0x13f));var _0x31ac=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x1ac3[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x31ac('0x0'));var util=require('util');var moment=require(_0x31ac('0x1'));var BPromise=require('bluebird');var rs=require(_0x31ac('0x2'));var fs=require('fs');var Redis=require(_0x31ac('0x3'));var db=require(_0x31ac('0x4'))['db'];var utils=require(_0x31ac('0x5'));var logger=require(_0x31ac('0x6'))(_0x31ac('0x7'));var config=require(_0x31ac('0x8'));var jayson=require(_0x31ac('0x9'));var client=jayson[_0x31ac('0xa')]['http']({'port':0x232a});config[_0x31ac('0xb')]=_[_0x31ac('0xc')](config[_0x31ac('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x31ac('0xd'))(new Redis(config[_0x31ac('0xb')]));require(_0x31ac('0xe'))[_0x31ac('0xf')](socket);function respondWithRpcPromise(_0x581261,_0x4726c2,_0x154cac){return new BPromise(function(_0x21ad1e,_0x1cfd8d){return client['request'](_0x581261,_0x154cac)[_0x31ac('0x10')](function(_0x13b6f8){logger[_0x31ac('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4726c2,'request\x20sent');logger[_0x31ac('0x12')](_0x31ac('0x13'),_0x4726c2,_0x31ac('0x14'),JSON[_0x31ac('0x15')](_0x13b6f8));if(_0x13b6f8[_0x31ac('0x16')]){if(_0x13b6f8[_0x31ac('0x16')][_0x31ac('0x17')]===0x1f4){logger[_0x31ac('0x16')](_0x31ac('0x18'),_0x4726c2,_0x13b6f8[_0x31ac('0x16')]['message']);return _0x1cfd8d(_0x13b6f8['error'][_0x31ac('0x19')]);}logger[_0x31ac('0x16')](_0x31ac('0x18'),_0x4726c2,_0x13b6f8[_0x31ac('0x16')][_0x31ac('0x19')]);return _0x21ad1e(_0x13b6f8[_0x31ac('0x16')][_0x31ac('0x19')]);}else{logger[_0x31ac('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4726c2,_0x31ac('0x14'));_0x21ad1e(_0x13b6f8['result'][_0x31ac('0x19')]);}})[_0x31ac('0x1a')](function(_0x2c1532){logger['error'](_0x31ac('0x18'),_0x4726c2,_0x2c1532);_0x1cfd8d(_0x2c1532);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 0a9954f..c4749ef 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 _0x41bb=['remove','update','emit','removeListener','length','./chatWebsite.events','save'];(function(_0x385770,_0xc1b263){var _0x293745=function(_0x363c9c){while(--_0x363c9c){_0x385770['push'](_0x385770['shift']());}};_0x293745(++_0xc1b263);}(_0x41bb,0xc9));var _0xb41b=function(_0x23e2bb,_0xd82b6d){_0x23e2bb=_0x23e2bb-0x0;var _0x2dd8ed=_0x41bb[_0x23e2bb];return _0x2dd8ed;};'use strict';var ChatWebsiteEvents=require(_0xb41b('0x0'));var events=[_0xb41b('0x1'),_0xb41b('0x2'),_0xb41b('0x3')];function createListener(_0x1891b7,_0x27f8cc){return function(_0x58d1e3){_0x27f8cc[_0xb41b('0x4')](_0x1891b7,_0x58d1e3);};}function removeListener(_0x497840,_0x1b4841){return function(){ChatWebsiteEvents[_0xb41b('0x5')](_0x497840,_0x1b4841);};}exports['register']=function(_0x11c357){for(var _0x534434=0x0,_0x5d41f0=events[_0xb41b('0x6')];_0x534434<_0x5d41f0;_0x534434++){var _0x5c67ef=events[_0x534434];var _0x1c067b=createListener('chatWebsite:'+_0x5c67ef,_0x11c357);ChatWebsiteEvents['on'](_0x5c67ef,_0x1c067b);}}; \ No newline at end of file +var _0x33df=['chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','register'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x33df,0xe8));var _0xf33d=function(_0x4a9a17,_0x273a09){_0x4a9a17=_0x4a9a17-0x0;var _0x30e831=_0x33df[_0x4a9a17];return _0x30e831;};'use strict';var ChatWebsiteEvents=require(_0xf33d('0x0'));var events=[_0xf33d('0x1'),_0xf33d('0x2'),'update'];function createListener(_0x5ed991,_0x56e54a){return function(_0x784518){_0x56e54a[_0xf33d('0x3')](_0x5ed991,_0x784518);};}function removeListener(_0x39bc46,_0x28cdc4){return function(){ChatWebsiteEvents[_0xf33d('0x4')](_0x39bc46,_0x28cdc4);};}exports[_0xf33d('0x5')]=function(_0x3faa4d){for(var _0x44d3e1=0x0,_0x28ca1b=events['length'];_0x44d3e1<_0x28ca1b;_0x44d3e1++){var _0x4cc46a=events[_0x44d3e1];var _0x42d525=createListener(_0xf33d('0x6')+_0x4cc46a,_0x3faa4d);ChatWebsiteEvents['on'](_0x4cc46a,_0x42d525);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 67fd3f9..9017043 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 _0x8485=['getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','root','now','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x8485,0xb9));var _0x5848=function(_0x4d8cef,_0x513893){_0x4d8cef=_0x4d8cef-0x0;var _0x31a519=_0x8485[_0x4d8cef];return _0x31a519;};'use strict';var multer=require(_0x5848('0x0'));var util=require('util');var path=require(_0x5848('0x1'));var timeout=require(_0x5848('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5848('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5848('0x4'));var config=require(_0x5848('0x5'));var controller=require(_0x5848('0x6'));router[_0x5848('0x7')]('/',auth[_0x5848('0x8')](),controller[_0x5848('0x9')]);router[_0x5848('0x7')]('/describe',auth[_0x5848('0x8')](),controller[_0x5848('0xa')]);router[_0x5848('0x7')](_0x5848('0xb'),auth[_0x5848('0x8')](),controller[_0x5848('0xc')]);router[_0x5848('0x7')](_0x5848('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x5848('0x7')]('/:id/canned_answers',auth[_0x5848('0x8')](),controller[_0x5848('0xe')]);router[_0x5848('0x7')](_0x5848('0xf'),controller[_0x5848('0x10')]);router['get'](_0x5848('0x11'),controller[_0x5848('0x12')]);router[_0x5848('0x7')](_0x5848('0x13'),controller['getCustomerAvatar']);router[_0x5848('0x7')](_0x5848('0x14'),controller['getSystemAvatar']);router[_0x5848('0x7')](_0x5848('0x15'),auth[_0x5848('0x8')](),controller[_0x5848('0x16')]);router['get'](_0x5848('0x17'),controller[_0x5848('0x18')]);router[_0x5848('0x7')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x5848('0x7')](_0x5848('0x19'),auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x5848('0x1a'),controller[_0x5848('0x1b')]);router[_0x5848('0x7')](_0x5848('0x1c'),auth[_0x5848('0x8')](),controller['getOfflineMessages']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x5848('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5848('0x1e')]);router[_0x5848('0x1f')](_0x5848('0xd'),auth[_0x5848('0x8')](),controller[_0x5848('0x20')]);router['post'](_0x5848('0x21'),auth['isAuthenticated'](),controller[_0x5848('0x22')]);var upload=multer({'storage':multer[_0x5848('0x23')]({'destination':function(_0x530b9c,_0x48b50a,_0x79df24){_0x79df24(null,path[_0x5848('0x24')](config['root'],_0x5848('0x25')));},'filename':function(_0x14877e,_0x68faf6,_0x25d523){_0x25d523(null,util[_0x5848('0x26')](_0x5848('0x27'),Date['now'](),_0x68faf6[_0x5848('0x28')]));}})});router['post'](_0x5848('0xf'),upload[_0x5848('0x29')](_0x5848('0x2a')),controller[_0x5848('0x2b')]);var upload=multer({'storage':multer[_0x5848('0x23')]({'destination':function(_0x557487,_0xe19bde,_0x5120b5){_0x5120b5(null,path[_0x5848('0x24')](config[_0x5848('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x78c2ff,_0x674dd4,_0x4a7ee7){_0x4a7ee7(null,util['format'](_0x5848('0x27'),Date[_0x5848('0x2d')](),_0x674dd4[_0x5848('0x28')]));}})});router[_0x5848('0x1f')](_0x5848('0x11'),upload[_0x5848('0x29')](_0x5848('0x2a')),controller[_0x5848('0x2e')]);var upload=multer({'storage':multer[_0x5848('0x23')]({'destination':function(_0x5a5a48,_0x825ee5,_0x38d7c8){_0x38d7c8(null,path[_0x5848('0x24')](config[_0x5848('0x2c')],_0x5848('0x2f')));},'filename':function(_0x5376b4,_0x503045,_0x4c515b){_0x4c515b(null,util[_0x5848('0x26')](_0x5848('0x27'),Date[_0x5848('0x2d')](),_0x503045[_0x5848('0x28')]));}})});router[_0x5848('0x1f')]('/:id/customer_avatar',upload[_0x5848('0x29')](_0x5848('0x2a')),controller[_0x5848('0x30')]);var upload=multer({'storage':multer[_0x5848('0x23')]({'destination':function(_0x11bf03,_0x18adde,_0x4572bd){_0x4572bd(null,path[_0x5848('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3ca36a,_0x23295e,_0x2f7f53){_0x2f7f53(null,util[_0x5848('0x26')]('%s-%s',Date[_0x5848('0x2d')](),_0x23295e[_0x5848('0x28')]));}})});router['post'](_0x5848('0x14'),upload[_0x5848('0x29')](_0x5848('0x2a')),controller[_0x5848('0x31')]);router[_0x5848('0x1f')](_0x5848('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x5848('0x23')]({'destination':function(_0x16a37f,_0x1fdfad,_0x42eea9){const _0x3f5240=path[_0x5848('0x24')](config[_0x5848('0x2c')],_0x5848('0x33'),_0x5848('0x34'),'offline-chat');fs_extra[_0x5848('0x35')](_0x3f5240,function(){_0x42eea9(null,_0x3f5240);});},'filename':function(_0x814d8e,_0x570eff,_0x50c6d8){const _0x2af2e0=_0x570eff[_0x5848('0x28')][_0x5848('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x29546a=path[_0x5848('0x37')](_0x2af2e0);const _0x32085a=Date[_0x5848('0x2d')]()+'-'+_0x2af2e0[_0x5848('0x36')](_0x29546a,'')+_0x29546a;_0x50c6d8(null,_0x32085a);}})});router[_0x5848('0x1f')](_0x5848('0x38'),offlineUploadMulter['any'](),controller[_0x5848('0x39')]);router[_0x5848('0x1f')](_0x5848('0x15'),auth[_0x5848('0x8')](),controller[_0x5848('0x3a')]);router[_0x5848('0x1f')](_0x5848('0x3b'),auth[_0x5848('0x8')](),controller[_0x5848('0x3c')]);router[_0x5848('0x1f')](_0x5848('0x19'),auth[_0x5848('0x8')](),controller[_0x5848('0x3d')]);router[_0x5848('0x1f')](_0x5848('0x3e'),auth['isAuthenticated'](),controller[_0x5848('0x3f')]);router[_0x5848('0x40')]('/:id',auth[_0x5848('0x8')](),controller['update']);router[_0x5848('0x41')](_0x5848('0xb'),auth[_0x5848('0x8')](),controller[_0x5848('0x42')]);router[_0x5848('0x41')](_0x5848('0xd'),auth[_0x5848('0x8')](),controller[_0x5848('0x43')]);router['delete'](_0x5848('0x21'),auth[_0x5848('0x8')](),controller['removeAnswers']);router[_0x5848('0x41')](_0x5848('0x3e'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x5848('0x44')]=router; \ No newline at end of file +var _0xbe67=['join','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','/:id/interactions','addApplications','/:id/proactive_actions','addAgents','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','format','addCustomerAvatar'];(function(_0x2666b3,_0x18481e){var _0x2ab92a=function(_0x3139c9){while(--_0x3139c9){_0x2666b3['push'](_0x2666b3['shift']());}};_0x2ab92a(++_0x18481e);}(_0xbe67,0x1be));var _0x7be6=function(_0x415648,_0x34761f){_0x415648=_0x415648-0x0;var _0x5c8ded=_0xbe67[_0x415648];return _0x5c8ded;};'use strict';var multer=require(_0x7be6('0x0'));var util=require(_0x7be6('0x1'));var path=require(_0x7be6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7be6('0x3'));var auth=require(_0x7be6('0x4'));var interaction=require(_0x7be6('0x5'));var config=require(_0x7be6('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x7be6('0x7')](),controller[_0x7be6('0x8')]);router[_0x7be6('0x9')](_0x7be6('0xa'),auth[_0x7be6('0x7')](),controller['describe']);router['get'](_0x7be6('0xb'),auth[_0x7be6('0x7')](),controller[_0x7be6('0xc')]);router[_0x7be6('0x9')](_0x7be6('0xd'),auth[_0x7be6('0x7')](),controller[_0x7be6('0xe')]);router[_0x7be6('0x9')](_0x7be6('0xf'),auth[_0x7be6('0x7')](),controller[_0x7be6('0x10')]);router['get'](_0x7be6('0x11'),controller[_0x7be6('0x12')]);router[_0x7be6('0x9')](_0x7be6('0x13'),controller[_0x7be6('0x14')]);router['get'](_0x7be6('0x15'),controller[_0x7be6('0x16')]);router[_0x7be6('0x9')](_0x7be6('0x17'),controller[_0x7be6('0x18')]);router[_0x7be6('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x7be6('0x9')](_0x7be6('0x19'),controller[_0x7be6('0x1a')]);router[_0x7be6('0x9')](_0x7be6('0x1b'),auth[_0x7be6('0x7')](),controller[_0x7be6('0x1c')]);router['get']('/:id/proactive_actions',auth[_0x7be6('0x7')](),controller[_0x7be6('0x1d')]);router[_0x7be6('0x9')](_0x7be6('0x1e'),controller[_0x7be6('0x1f')]);router[_0x7be6('0x9')](_0x7be6('0x20'),auth[_0x7be6('0x7')](),controller[_0x7be6('0x21')]);router[_0x7be6('0x9')](_0x7be6('0x22'),auth['isAuthenticated'](),controller[_0x7be6('0x23')]);router[_0x7be6('0x24')]('/',auth['isAuthenticated'](),controller[_0x7be6('0x25')]);router[_0x7be6('0x24')]('/:id/dispositions',auth[_0x7be6('0x7')](),controller[_0x7be6('0x26')]);router[_0x7be6('0x24')](_0x7be6('0xf'),auth[_0x7be6('0x7')](),controller[_0x7be6('0x27')]);var upload=multer({'storage':multer[_0x7be6('0x28')]({'destination':function(_0x317bd7,_0x386aba,_0x1f6b3a){_0x1f6b3a(null,path['join'](config[_0x7be6('0x29')],'server/files/images/logos/'));},'filename':function(_0x46e511,_0xac4aa8,_0x342a69){_0x342a69(null,util['format'](_0x7be6('0x2a'),Date[_0x7be6('0x2b')](),_0xac4aa8[_0x7be6('0x2c')]));}})});router[_0x7be6('0x24')]('/:id/logo',upload[_0x7be6('0x2d')](_0x7be6('0x2e')),controller[_0x7be6('0x2f')]);var upload=multer({'storage':multer[_0x7be6('0x28')]({'destination':function(_0x35cfc4,_0x2f12c1,_0x5a4978){_0x5a4978(null,path['join'](config[_0x7be6('0x29')],_0x7be6('0x30')));},'filename':function(_0x1480b0,_0x4caf04,_0x4107ec){_0x4107ec(null,util[_0x7be6('0x31')](_0x7be6('0x2a'),Date[_0x7be6('0x2b')](),_0x4caf04[_0x7be6('0x2c')]));}})});router['post']('/:id/avatar',upload[_0x7be6('0x2d')](_0x7be6('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x492a5d,_0x159a3d,_0x1faf1e){_0x1faf1e(null,path['join'](config[_0x7be6('0x29')],_0x7be6('0x30')));},'filename':function(_0x8f2b0c,_0x22c21c,_0x3655a2){_0x3655a2(null,util[_0x7be6('0x31')]('%s-%s',Date[_0x7be6('0x2b')](),_0x22c21c[_0x7be6('0x2c')]));}})});router[_0x7be6('0x24')](_0x7be6('0x15'),upload['single'](_0x7be6('0x2e')),controller[_0x7be6('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d3dfb,_0x6b67e4,_0x3d2088){_0x3d2088(null,path[_0x7be6('0x33')](config[_0x7be6('0x29')],_0x7be6('0x30')));},'filename':function(_0x43a43,_0x519025,_0x4522c0){_0x4522c0(null,util[_0x7be6('0x31')]('%s-%s',Date[_0x7be6('0x2b')](),_0x519025['originalname']));}})});router[_0x7be6('0x24')]('/:id/system_avatar',upload[_0x7be6('0x2d')](_0x7be6('0x2e')),controller['addSystemAvatar']);router[_0x7be6('0x24')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x7be6('0x28')]({'destination':function(_0x406bb3,_0x37a2d7,_0x25f019){const _0x4282d1=path[_0x7be6('0x33')](config['root'],_0x7be6('0x34'),_0x7be6('0x35'),_0x7be6('0x36'));fs_extra[_0x7be6('0x37')](_0x4282d1,function(){_0x25f019(null,_0x4282d1);});},'filename':function(_0x2a63e5,_0x48ce01,_0x4b2a5c){const _0x36b4ad=_0x48ce01[_0x7be6('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1ec921=path['extname'](_0x36b4ad);const _0x16efee=Date[_0x7be6('0x2b')]()+'-'+_0x36b4ad[_0x7be6('0x38')](_0x1ec921,'')+_0x1ec921;_0x4b2a5c(null,_0x16efee);}})});router['post'](_0x7be6('0x39'),offlineUploadMulter[_0x7be6('0x3a')](),controller[_0x7be6('0x3b')]);router['post'](_0x7be6('0x3c'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x7be6('0x24')](_0x7be6('0x1b'),auth['isAuthenticated'](),controller[_0x7be6('0x3d')]);router[_0x7be6('0x24')](_0x7be6('0x3e'),auth[_0x7be6('0x7')](),controller['addProactiveActions']);router['post'](_0x7be6('0x22'),auth['isAuthenticated'](),controller[_0x7be6('0x3f')]);router[_0x7be6('0x40')]('/:id',auth[_0x7be6('0x7')](),controller[_0x7be6('0x41')]);router['delete']('/:id',auth[_0x7be6('0x7')](),controller[_0x7be6('0x42')]);router[_0x7be6('0x43')](_0x7be6('0xd'),auth[_0x7be6('0x7')](),controller['removeDispositions']);router['delete'](_0x7be6('0xf'),auth[_0x7be6('0x7')](),controller[_0x7be6('0x44')]);router[_0x7be6('0x43')]('/:id/users',auth['isAuthenticated'](),controller[_0x7be6('0x45')]);module[_0x7be6('0x46')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 2ade878..d4ef56f 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 _0xdfa0=['Google','sequelize','STRING','ENUM'];(function(_0x3a2e8c,_0x4001d3){var _0x588177=function(_0x2dbc02){while(--_0x2dbc02){_0x3a2e8c['push'](_0x3a2e8c['shift']());}};_0x588177(++_0x4001d3);}(_0xdfa0,0x69));var _0x0dfa=function(_0x4ddd00,_0xc967a9){_0x4ddd00=_0x4ddd00-0x0;var _0x4bc6cc=_0xdfa0[_0x4ddd00];return _0x4bc6cc;};'use strict';var Sequelize=require(_0x0dfa('0x0'));module['exports']={'name':{'type':Sequelize[_0x0dfa('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0dfa('0x2')]('AmazonAWS',_0x0dfa('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x0dfa('0x1')]},'data2':{'type':Sequelize[_0x0dfa('0x1')]}}; \ No newline at end of file +var _0x4e47=['ENUM','AmazonAWS','Google','STRING'];(function(_0x21973a,_0xef5df8){var _0x2fb112=function(_0x4cf4fb){while(--_0x4cf4fb){_0x21973a['push'](_0x21973a['shift']());}};_0x2fb112(++_0xef5df8);}(_0x4e47,0x17f));var _0x74e4=function(_0x488389,_0x31e284){_0x488389=_0x488389-0x0;var _0x5b28ac=_0x4e47[_0x488389];return _0x5b28ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x74e4('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x74e4('0x1')](_0x74e4('0x2'),_0x74e4('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x74e4('0x0')]},'data2':{'type':Sequelize[_0x74e4('0x0')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 818d25d..bad5b3f 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x475f2a,_0x37633d){var _0x211cb5=function(_0x559b8c){while(--_0x559b8c){_0x475f2a['push'](_0x475f2a['shift']());}};_0x211cb5(++_0x37633d);}(_0x2ef3,0xba));var _0x32ef=function(_0x3da750,_0x2db72e){_0x3da750=_0x3da750-0x0;var _0x4d144c=_0x2ef3[_0x3da750];return _0x4d144c;};'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'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file +var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3faf85,_0x272107){var _0x496c38=function(_0x4500b0){while(--_0x4500b0){_0x3faf85['push'](_0x3faf85['shift']());}};_0x496c38(++_0x272107);}(_0x2ef3,0xba));var _0x32ef=function(_0x3c53b4,_0x242a4c){_0x3c53b4=_0x3c53b4-0x0;var _0x2e1c4a=_0x2ef3[_0x3c53b4];return _0x2e1c4a;};'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'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index cd6021c..cd08ad2 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 _0xbb8f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x78586c,_0x266910){var _0x1bd392=function(_0xd7bb3e){while(--_0xd7bb3e){_0x78586c['push'](_0x78586c['shift']());}};_0x1bd392(++_0x266910);}(_0xbb8f,0x99));var _0xfbb8=function(_0x21bba8,_0x37840e){_0x21bba8=_0x21bba8-0x0;var _0x5d1263=_0xbb8f[_0x21bba8];return _0x5d1263;};'use strict';var _=require(_0xfbb8('0x0'));var util=require('util');var logger=require(_0xfbb8('0x1'))(_0xfbb8('0x2'));var moment=require(_0xfbb8('0x3'));var BPromise=require(_0xfbb8('0x4'));var rp=require(_0xfbb8('0x5'));var fs=require('fs');var path=require(_0xfbb8('0x6'));var rimraf=require(_0xfbb8('0x7'));var config=require(_0xfbb8('0x8'));var attributes=require(_0xfbb8('0x9'));module[_0xfbb8('0xa')]=function(_0x3722cc,_0x11ccce){return _0x3722cc[_0xfbb8('0xb')](_0xfbb8('0xc'),attributes,{'tableName':_0xfbb8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b72=['CloudProvider','cloud_providers','lodash','util','api','moment','request-promise','path','rimraf','./cloudProvider.attributes','exports','define'];(function(_0xb4a44b,_0xb8870c){var _0x583792=function(_0x37cbdc){while(--_0x37cbdc){_0xb4a44b['push'](_0xb4a44b['shift']());}};_0x583792(++_0xb8870c);}(_0x2b72,0x13a));var _0x22b7=function(_0x18b4e8,_0x30e9e1){_0x18b4e8=_0x18b4e8-0x0;var _0x4b6265=_0x2b72[_0x18b4e8];return _0x4b6265;};'use strict';var _=require(_0x22b7('0x0'));var util=require(_0x22b7('0x1'));var logger=require('../../config/logger')(_0x22b7('0x2'));var moment=require(_0x22b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x22b7('0x4'));var fs=require('fs');var path=require(_0x22b7('0x5'));var rimraf=require(_0x22b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x22b7('0x7'));module[_0x22b7('0x8')]=function(_0x2727a3,_0x5dcfd5){return _0x2727a3[_0x22b7('0x9')](_0x22b7('0xa'),attributes,{'tableName':_0x22b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 0444ab3..08a076c 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 _0x4c50=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x5d4618,_0x2c2057){var _0x389418=function(_0x1f5fc6){while(--_0x1f5fc6){_0x5d4618['push'](_0x5d4618['shift']());}};_0x389418(++_0x2c2057);}(_0x4c50,0x10f));var _0x04c5=function(_0x526f36,_0x19aadb){_0x526f36=_0x526f36-0x0;var _0x3746e6=_0x4c50[_0x526f36];return _0x3746e6;};'use strict';var _=require(_0x04c5('0x0'));var util=require(_0x04c5('0x1'));var moment=require(_0x04c5('0x2'));var BPromise=require(_0x04c5('0x3'));var rs=require(_0x04c5('0x4'));var fs=require('fs');var Redis=require(_0x04c5('0x5'));var db=require(_0x04c5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x04c5('0x7'));var config=require(_0x04c5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04c5('0x9')][_0x04c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22535c,_0x34961a,_0x1fb2db){return new BPromise(function(_0x40a846,_0x411e7f){return client[_0x04c5('0xb')](_0x22535c,_0x1fb2db)['then'](function(_0x4ebad1){logger['info'](_0x04c5('0xc'),_0x34961a,_0x04c5('0xd'));logger[_0x04c5('0xe')](_0x04c5('0xf'),_0x34961a,_0x04c5('0xd'),JSON[_0x04c5('0x10')](_0x4ebad1));if(_0x4ebad1[_0x04c5('0x11')]){if(_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x12')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x34961a,_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x13')]);return _0x411e7f(_0x4ebad1['error'][_0x04c5('0x13')]);}logger[_0x04c5('0x11')](_0x04c5('0xc'),_0x34961a,_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x13')]);return _0x40a846(_0x4ebad1['error']['message']);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x34961a,'request\x20sent');_0x40a846(_0x4ebad1[_0x04c5('0x14')]['message']);}})['catch'](function(_0x1ee3a0){logger[_0x04c5('0x11')]('CloudProvider,\x20%s,\x20%s',_0x34961a,_0x1ee3a0);_0x411e7f(_0x1ee3a0);});});} \ No newline at end of file +var _0x1122=['CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2d7bc0,_0x10d7b7){var _0x58fe96=function(_0x6eab7c){while(--_0x6eab7c){_0x2d7bc0['push'](_0x2d7bc0['shift']());}};_0x58fe96(++_0x10d7b7);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2112('0x0'));var util=require('util');var moment=require(_0x2112('0x1'));var BPromise=require(_0x2112('0x2'));var rs=require(_0x2112('0x3'));var fs=require('fs');var Redis=require(_0x2112('0x4'));var db=require(_0x2112('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2112('0x6'));var config=require('../../config/environment');var jayson=require(_0x2112('0x7'));var client=jayson[_0x2112('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcca285,_0x2ad731,_0x3f0a81){return new BPromise(function(_0x272bdb,_0x4190c7){return client[_0x2112('0x9')](_0xcca285,_0x3f0a81)[_0x2112('0xa')](function(_0x2f7142){logger[_0x2112('0xb')]('CloudProvider,\x20%s,\x20%s',_0x2ad731,_0x2112('0xc'));logger[_0x2112('0xd')](_0x2112('0xe'),_0x2ad731,_0x2112('0xc'),JSON['stringify'](_0x2f7142));if(_0x2f7142[_0x2112('0xf')]){if(_0x2f7142[_0x2112('0xf')][_0x2112('0x10')]===0x1f4){logger[_0x2112('0xf')](_0x2112('0x11'),_0x2ad731,_0x2f7142[_0x2112('0xf')][_0x2112('0x12')]);return _0x4190c7(_0x2f7142['error'][_0x2112('0x12')]);}logger['error'](_0x2112('0x11'),_0x2ad731,_0x2f7142[_0x2112('0xf')]['message']);return _0x272bdb(_0x2f7142[_0x2112('0xf')]['message']);}else{logger[_0x2112('0xb')]('CloudProvider,\x20%s,\x20%s',_0x2ad731,_0x2112('0xc'));_0x272bdb(_0x2f7142[_0x2112('0x13')]['message']);}})[_0x2112('0x14')](function(_0x4db5c3){logger[_0x2112('0xf')]('CloudProvider,\x20%s,\x20%s',_0x2ad731,_0x4db5c3);_0x4190c7(_0x4db5c3);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index d0fbbb2..fe905cb 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 _0xcabf=['show','create','put','update','delete','exports','multer','util','Router','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x19fda2,_0x5de19b){var _0xb362d4=function(_0x9c9bd4){while(--_0x9c9bd4){_0x19fda2['push'](_0x19fda2['shift']());}};_0xb362d4(++_0x5de19b);}(_0xcabf,0x102));var _0xfcab=function(_0x5da11c,_0x17a50d){_0x5da11c=_0x5da11c-0x0;var _0x960ebf=_0xcabf[_0x5da11c];return _0x960ebf;};'use strict';var multer=require(_0xfcab('0x0'));var util=require(_0xfcab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfcab('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfcab('0x3'));var controller=require('./cloudProvider.controller');router[_0xfcab('0x4')]('/',auth[_0xfcab('0x5')](),controller[_0xfcab('0x6')]);router['get'](_0xfcab('0x7'),auth[_0xfcab('0x5')](),controller[_0xfcab('0x8')]);router['post']('/',auth[_0xfcab('0x5')](),controller[_0xfcab('0x9')]);router[_0xfcab('0xa')](_0xfcab('0x7'),auth['isAuthenticated'](),controller[_0xfcab('0xb')]);router[_0xfcab('0xc')]('/:id',auth[_0xfcab('0x5')](),controller['destroy']);module[_0xfcab('0xd')]=router; \ No newline at end of file +var _0xc26f=['../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','isAuthenticated','/:id','post','create','update','delete','destroy','multer','util','connect-timeout','fs-extra'];(function(_0x33759d,_0x1442ba){var _0x368ed7=function(_0x28868d){while(--_0x28868d){_0x33759d['push'](_0x33759d['shift']());}};_0x368ed7(++_0x1442ba);}(_0xc26f,0xdd));var _0xfc26=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc26f[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xfc26('0x0'));var util=require(_0xfc26('0x1'));var path=require('path');var timeout=require(_0xfc26('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfc26('0x3'));var auth=require(_0xfc26('0x4'));var interaction=require(_0xfc26('0x5'));var config=require('../../config/environment');var controller=require(_0xfc26('0x6'));router[_0xfc26('0x7')]('/',auth[_0xfc26('0x8')](),controller['index']);router[_0xfc26('0x7')](_0xfc26('0x9'),auth[_0xfc26('0x8')](),controller['show']);router[_0xfc26('0xa')]('/',auth[_0xfc26('0x8')](),controller[_0xfc26('0xb')]);router['put']('/:id',auth[_0xfc26('0x8')](),controller[_0xfc26('0xc')]);router[_0xfc26('0xd')]('/:id',auth[_0xfc26('0x8')](),controller[_0xfc26('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index a86199b..ac98eb2 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 _0x1fa7=['STRING','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1fa7,0x151));var _0x71fa=function(_0xe5d44f,_0x11d790){_0xe5d44f=_0xe5d44f-0x0;var _0x5e91ab=_0x1fa7[_0xe5d44f];return _0x5e91ab;};'use strict';var Sequelize=require('sequelize');module[_0x71fa('0x0')]={'name':{'type':Sequelize[_0x71fa('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x71fa('0x1')]},'website':{'type':Sequelize[_0x71fa('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x71fa('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x71fa('0x1')]},'postalCode':{'type':Sequelize[_0x71fa('0x1')]},'city':{'type':Sequelize[_0x71fa('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x71fa('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x71fa('0x1')]},'sStreet':{'type':Sequelize[_0x71fa('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x71fa('0x1')]},'description':{'type':Sequelize[_0x71fa('0x1')]}}; \ No newline at end of file +var _0x177d=['sequelize','exports','STRING','name'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x177d,0x68));var _0xd177=function(_0x1cb7ea,_0x2496df){_0x1cb7ea=_0x1cb7ea-0x0;var _0x17991f=_0x177d[_0x1cb7ea];return _0x17991f;};'use strict';var Sequelize=require(_0xd177('0x0'));module[_0xd177('0x1')]={'name':{'type':Sequelize[_0xd177('0x2')],'unique':_0xd177('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd177('0x2')]},'companyId':{'type':Sequelize[_0xd177('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xd177('0x2')]},'type':{'type':Sequelize[_0xd177('0x2')]},'street':{'type':Sequelize[_0xd177('0x2')]},'postalCode':{'type':Sequelize[_0xd177('0x2')]},'city':{'type':Sequelize[_0xd177('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd177('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd177('0x2')]},'sStreet':{'type':Sequelize[_0xd177('0x2')]},'sPostalCode':{'type':Sequelize[_0xd177('0x2')]},'sCity':{'type':Sequelize[_0xd177('0x2')]},'sCountry':{'type':Sequelize[_0xd177('0x2')]},'description':{'type':Sequelize[_0xd177('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index bcd3db3..968a72a 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 _0xbc22=['offset','set','json','apply','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','filter','merge','includeAll','include','rows','catch','show','rawAttributes','length','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addContacts','CmContact','params','ids','getContacts','order','map','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','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','sendStatus','status','end','undefined','limit','count'];(function(_0xc0c68,_0x254415){var _0x2d965f=function(_0x173c22){while(--_0x173c22){_0xc0c68['push'](_0xc0c68['shift']());}};_0x2d965f(++_0x254415);}(_0xbc22,0x131));var _0x2bc2=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0xbc22[_0x187279];return _0x3da59d;};'use strict';var emlformat=require(_0x2bc2('0x0'));var rimraf=require(_0x2bc2('0x1'));var zipdir=require(_0x2bc2('0x2'));var jsonpatch=require(_0x2bc2('0x3'));var rp=require(_0x2bc2('0x4'));var moment=require(_0x2bc2('0x5'));var BPromise=require(_0x2bc2('0x6'));var Mustache=require('mustache');var util=require(_0x2bc2('0x7'));var path=require(_0x2bc2('0x8'));var sox=require(_0x2bc2('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2bc2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2bc2('0xb'));var deskjs=require(_0x2bc2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2bc2('0xd'));var Papa=require(_0x2bc2('0xe'));var Redis=require(_0x2bc2('0xf'));var authService=require(_0x2bc2('0x10'));var qs=require(_0x2bc2('0x11'));var as=require(_0x2bc2('0x12'));var hardwareService=require(_0x2bc2('0x13'));var logger=require(_0x2bc2('0x14'))(_0x2bc2('0x15'));var utils=require(_0x2bc2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2bc2('0x17'));var db=require(_0x2bc2('0x18'))['db'];function respondWithStatusCode(_0x5a16fe,_0x175251){_0x175251=_0x175251||0xcc;return function(_0x132177){if(_0x132177){return _0x5a16fe[_0x2bc2('0x19')](_0x175251);}return _0x5a16fe[_0x2bc2('0x1a')](_0x175251)[_0x2bc2('0x1b')]();};}function respondWithResult(_0x4bad4b,_0x2d0510){_0x2d0510=_0x2d0510||0xc8;return function(_0x503713){if(_0x503713){return _0x4bad4b[_0x2bc2('0x1a')](_0x2d0510)['json'](_0x503713);}};}function respondWithFilteredResult(_0x1233b2,_0x31f218){return function(_0x5860cc){if(_0x5860cc){var _0x54b5c4=typeof _0x31f218['offset']===_0x2bc2('0x1c')&&typeof _0x31f218[_0x2bc2('0x1d')]==='undefined';var _0xfbd7d9=_0x5860cc[_0x2bc2('0x1e')];var _0x53d4ac=_0x54b5c4?0x0:_0x31f218['offset'];var _0x2886c5=_0x54b5c4?_0x5860cc[_0x2bc2('0x1e')]:_0x31f218[_0x2bc2('0x1f')]+_0x31f218[_0x2bc2('0x1d')];var _0x4ff222;if(_0x2886c5>=_0xfbd7d9){_0x2886c5=_0xfbd7d9;_0x4ff222=0xc8;}else{_0x4ff222=0xce;}_0x1233b2['status'](_0x4ff222);return _0x1233b2[_0x2bc2('0x20')]('Content-Range',_0x53d4ac+'-'+_0x2886c5+'/'+_0xfbd7d9)[_0x2bc2('0x21')](_0x5860cc);}return null;};}function patchUpdates(_0x73b73a){return function(_0x25bf1d){try{jsonpatch[_0x2bc2('0x22')](_0x25bf1d,_0x73b73a,!![]);}catch(_0x14b0cd){return BPromise['reject'](_0x14b0cd);}return _0x25bf1d['save']();};}function saveUpdates(_0x852a71,_0x3d7fc6){return function(_0x534b46){if(_0x534b46){return _0x534b46['update'](_0x852a71)[_0x2bc2('0x23')](function(_0x4e3b44){return _0x4e3b44;});}return null;};}function removeEntity(_0x38d32a,_0x3c50f2){return function(_0x2f4c5d){if(_0x2f4c5d){return _0x2f4c5d[_0x2bc2('0x24')]()[_0x2bc2('0x23')](function(){var _0x5717da=_0x2f4c5d[_0x2bc2('0x25')]({'plain':!![]});var _0xeed6a9=_0x2bc2('0x26');return db[_0x2bc2('0x27')][_0x2bc2('0x24')]({'where':{'type':_0xeed6a9,'resourceId':_0x5717da['id']}})['then'](function(){return _0x2f4c5d;});})[_0x2bc2('0x23')](function(){_0x38d32a['status'](0xcc)[_0x2bc2('0x1b')]();});}};}function handleEntityNotFound(_0x4325f3,_0x25e73f){return function(_0x187d33){if(!_0x187d33){_0x4325f3[_0x2bc2('0x19')](0x194);}return _0x187d33;};}function handleError(_0x5065d9,_0x3406af){_0x3406af=_0x3406af||0x1f4;return function(_0x8306c1){logger[_0x2bc2('0x28')](_0x8306c1[_0x2bc2('0x29')]);if(_0x8306c1[_0x2bc2('0x2a')]){delete _0x8306c1[_0x2bc2('0x2a')];}_0x5065d9[_0x2bc2('0x1a')](_0x3406af)[_0x2bc2('0x2b')](_0x8306c1);};}exports[_0x2bc2('0x2c')]=function(_0xa1284f,_0xb7d6fc){var _0x52cfae={},_0xe8c700={},_0x57d6c9={'count':0x0,'rows':[]};return db[_0x2bc2('0x2d')]['describe']()['then'](function(_0x2fea74){_0xe8c700[_0x2bc2('0x2e')]=_['keys'](_0x2fea74);_0xe8c700[_0x2bc2('0x2f')]=_[_0x2bc2('0x30')](_0xa1284f[_0x2bc2('0x2f')]);_0xe8c700[_0x2bc2('0x31')]=_['intersection'](_0xe8c700[_0x2bc2('0x2e')],_0xe8c700[_0x2bc2('0x2f')]);_0x52cfae[_0x2bc2('0x32')]=_[_0x2bc2('0x33')](_0xe8c700['model'],qs[_0x2bc2('0x34')](_0xa1284f[_0x2bc2('0x2f')]['fields']));_0x52cfae[_0x2bc2('0x32')]=_0x52cfae[_0x2bc2('0x32')]['length']?_0x52cfae[_0x2bc2('0x32')]:_0xe8c700[_0x2bc2('0x2e')];if(!_0xa1284f['query']['hasOwnProperty'](_0x2bc2('0x35'))){_0x52cfae[_0x2bc2('0x1d')]=qs[_0x2bc2('0x1d')](_0xa1284f[_0x2bc2('0x2f')]['limit']);_0x52cfae[_0x2bc2('0x1f')]=qs[_0x2bc2('0x1f')](_0xa1284f[_0x2bc2('0x2f')]['offset']);}_0x52cfae['order']=qs[_0x2bc2('0x36')](_0xa1284f['query'][_0x2bc2('0x36')]);_0x52cfae[_0x2bc2('0x37')]=qs[_0x2bc2('0x31')](_['pick'](_0xa1284f[_0x2bc2('0x2f')],_0xe8c700['filters']),_0x2fea74);if(_0xa1284f[_0x2bc2('0x2f')]['filter']){_0x52cfae[_0x2bc2('0x37')]=_['merge'](_0x52cfae[_0x2bc2('0x37')],{'$or':_['map'](_0x52cfae[_0x2bc2('0x32')],function(_0x4153e6){var _0x448640={};_0x448640[_0x4153e6]={'$like':'%'+_0xa1284f[_0x2bc2('0x2f')][_0x2bc2('0x38')]+'%'};return _0x448640;})});}_0x52cfae=_[_0x2bc2('0x39')]({},_0x52cfae,_0xa1284f['options']);var _0x228da5={'where':_0x52cfae[_0x2bc2('0x37')]};return db['CmCompany'][_0x2bc2('0x1e')](_0x228da5)[_0x2bc2('0x23')](function(_0x23511b){_0x57d6c9[_0x2bc2('0x1e')]=_0x23511b;if(_0xa1284f[_0x2bc2('0x2f')][_0x2bc2('0x3a')]){_0x52cfae[_0x2bc2('0x3b')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x52cfae);})[_0x2bc2('0x23')](function(_0x2e0261){_0x57d6c9[_0x2bc2('0x3c')]=_0x2e0261;return _0x57d6c9;})[_0x2bc2('0x23')](respondWithFilteredResult(_0xb7d6fc,_0x52cfae))[_0x2bc2('0x3d')](handleError(_0xb7d6fc,null));})[_0x2bc2('0x3d')](handleError(_0xb7d6fc,null));};exports[_0x2bc2('0x3e')]=function(_0x52f59e,_0x38bb5c){var _0x1342f3={'raw':![],'where':{'id':_0x52f59e['params']['id']}},_0x517794={};_0x517794[_0x2bc2('0x2e')]=_[_0x2bc2('0x30')](db[_0x2bc2('0x2d')][_0x2bc2('0x3f')]);_0x517794[_0x2bc2('0x2f')]=_[_0x2bc2('0x30')](_0x52f59e[_0x2bc2('0x2f')]);_0x517794[_0x2bc2('0x31')]=_[_0x2bc2('0x33')](_0x517794[_0x2bc2('0x2e')],_0x517794[_0x2bc2('0x2f')]);_0x1342f3[_0x2bc2('0x32')]=_['intersection'](_0x517794[_0x2bc2('0x2e')],qs[_0x2bc2('0x34')](_0x52f59e[_0x2bc2('0x2f')][_0x2bc2('0x34')]));_0x1342f3['attributes']=_0x1342f3[_0x2bc2('0x32')][_0x2bc2('0x40')]?_0x1342f3['attributes']:_0x517794[_0x2bc2('0x2e')];if(_0x52f59e[_0x2bc2('0x2f')]['includeAll']){_0x1342f3[_0x2bc2('0x3b')]=[{'all':!![]}];}_0x1342f3=_['merge']({},_0x1342f3,_0x52f59e[_0x2bc2('0x41')]);return db[_0x2bc2('0x2d')][_0x2bc2('0x42')](_0x1342f3)[_0x2bc2('0x23')](handleEntityNotFound(_0x38bb5c,null))[_0x2bc2('0x23')](respondWithResult(_0x38bb5c,null))[_0x2bc2('0x3d')](handleError(_0x38bb5c,null));};exports['create']=function(_0x4421ff,_0x361329){return db['CmCompany'][_0x2bc2('0x43')](_0x4421ff['body'],{})[_0x2bc2('0x23')](function(_0x1c34cd){var _0x2c916a=_0x4421ff['user'][_0x2bc2('0x25')]({'plain':!![]});if(!_0x2c916a)throw new Error(_0x2bc2('0x44'));if(_0x2c916a[_0x2bc2('0x45')]==='user'){var _0x4d58ee=_0x1c34cd[_0x2bc2('0x25')]({'plain':!![]});var _0x57e784=_0x2bc2('0x26');return db['UserProfileSection'][_0x2bc2('0x42')]({'where':{'name':_0x57e784,'userProfileId':_0x2c916a[_0x2bc2('0x46')]},'raw':!![]})[_0x2bc2('0x23')](function(_0x4a025b){if(_0x4a025b&&_0x4a025b[_0x2bc2('0x47')]===0x0){return db[_0x2bc2('0x27')]['create']({'name':_0x4d58ee[_0x2bc2('0x2a')],'resourceId':_0x4d58ee['id'],'type':_0x4a025b['name'],'sectionId':_0x4a025b['id']},{})[_0x2bc2('0x23')](function(){return _0x1c34cd;});}else{return _0x1c34cd;}})[_0x2bc2('0x3d')](function(_0x27cc1e){logger[_0x2bc2('0x28')](_0x2bc2('0x48'),_0x27cc1e);throw _0x27cc1e;});}return _0x1c34cd;})['then'](respondWithResult(_0x361329,0xc9))[_0x2bc2('0x3d')](handleError(_0x361329,null));};exports[_0x2bc2('0x49')]=function(_0x3a5b4d,_0x582571){if(_0x3a5b4d[_0x2bc2('0x4a')]['id']){delete _0x3a5b4d[_0x2bc2('0x4a')]['id'];}return db[_0x2bc2('0x2d')][_0x2bc2('0x42')]({'where':{'id':_0x3a5b4d['params']['id']}})['then'](handleEntityNotFound(_0x582571,null))[_0x2bc2('0x23')](saveUpdates(_0x3a5b4d[_0x2bc2('0x4a')],null))[_0x2bc2('0x23')](respondWithResult(_0x582571,null))[_0x2bc2('0x3d')](handleError(_0x582571,null));};exports[_0x2bc2('0x24')]=function(_0x9e266,_0x2796b5){return db[_0x2bc2('0x2d')][_0x2bc2('0x42')]({'where':{'id':_0x9e266['params']['id']}})[_0x2bc2('0x23')](handleEntityNotFound(_0x2796b5,null))[_0x2bc2('0x23')](removeEntity(_0x2796b5,null))[_0x2bc2('0x3d')](handleError(_0x2796b5,null));};exports[_0x2bc2('0x4b')]=function(_0x9baad9,_0xe22bfe){return db['CmCompany'][_0x2bc2('0x4b')]()['then'](respondWithResult(_0xe22bfe,null))['catch'](handleError(_0xe22bfe,null));};exports[_0x2bc2('0x4c')]=function(_0x4714af,_0x7ca9b3,_0x1944de){return db[_0x2bc2('0x4d')]['find']({'where':{'id':_0x4714af[_0x2bc2('0x4e')]['id']}})[_0x2bc2('0x23')](handleEntityNotFound(_0x7ca9b3,null))[_0x2bc2('0x23')](function(_0x268178){if(_0x268178){return _0x268178[_0x2bc2('0x4c')](_0x4714af[_0x2bc2('0x4a')]['ids'],_['omit'](_0x4714af[_0x2bc2('0x4a')],[_0x2bc2('0x4f'),'id'])||{});}})[_0x2bc2('0x23')](respondWithResult(_0x7ca9b3,null))[_0x2bc2('0x3d')](handleError(_0x7ca9b3,null));};exports[_0x2bc2('0x50')]=function(_0x5d41a6,_0xbabe64,_0x22c844){var _0x9f9a7a={};var _0x2c5a0e={};var _0x1eee1e;var _0x30e3c6;return db[_0x2bc2('0x2d')]['findOne']({'where':{'id':_0x5d41a6['params']['id']}})[_0x2bc2('0x23')](handleEntityNotFound(_0xbabe64,null))[_0x2bc2('0x23')](function(_0xc7c089){if(_0xc7c089){_0x1eee1e=_0xc7c089;_0x2c5a0e[_0x2bc2('0x2e')]=_[_0x2bc2('0x30')](db['CmContact'][_0x2bc2('0x3f')]);_0x2c5a0e['query']=_[_0x2bc2('0x30')](_0x5d41a6[_0x2bc2('0x2f')]);_0x2c5a0e['filters']=_['intersection'](_0x2c5a0e[_0x2bc2('0x2e')],_0x2c5a0e[_0x2bc2('0x2f')]);_0x9f9a7a[_0x2bc2('0x32')]=_[_0x2bc2('0x33')](_0x2c5a0e[_0x2bc2('0x2e')],qs[_0x2bc2('0x34')](_0x5d41a6['query'][_0x2bc2('0x34')]));_0x9f9a7a[_0x2bc2('0x32')]=_0x9f9a7a[_0x2bc2('0x32')][_0x2bc2('0x40')]?_0x9f9a7a[_0x2bc2('0x32')]:_0x2c5a0e[_0x2bc2('0x2e')];_0x9f9a7a[_0x2bc2('0x51')]=qs[_0x2bc2('0x36')](_0x5d41a6[_0x2bc2('0x2f')][_0x2bc2('0x36')]);_0x9f9a7a[_0x2bc2('0x37')]=qs['filters'](_['pick'](_0x5d41a6[_0x2bc2('0x2f')],_0x2c5a0e[_0x2bc2('0x31')]));if(_0x5d41a6[_0x2bc2('0x2f')][_0x2bc2('0x38')]){_0x9f9a7a[_0x2bc2('0x37')]=_[_0x2bc2('0x39')](_0x9f9a7a[_0x2bc2('0x37')],{'$or':_[_0x2bc2('0x52')](_0x9f9a7a['attributes'],function(_0x25d423){var _0x59aab7={};_0x59aab7[_0x25d423]={'$like':'%'+_0x5d41a6[_0x2bc2('0x2f')][_0x2bc2('0x38')]+'%'};return _0x59aab7;})});}_0x9f9a7a=_[_0x2bc2('0x39')]({},_0x9f9a7a,_0x5d41a6['options']);return _0x1eee1e[_0x2bc2('0x50')](_0x9f9a7a);}})['then'](function(_0x5d531f){if(_0x5d531f){_0x30e3c6=_0x5d531f[_0x2bc2('0x40')];if(!_0x5d41a6[_0x2bc2('0x2f')][_0x2bc2('0x53')](_0x2bc2('0x35'))){_0x9f9a7a[_0x2bc2('0x1d')]=qs['limit'](_0x5d41a6['query']['limit']);_0x9f9a7a[_0x2bc2('0x1f')]=qs['offset'](_0x5d41a6[_0x2bc2('0x2f')][_0x2bc2('0x1f')]);}return _0x1eee1e['getContacts'](_0x9f9a7a);}})[_0x2bc2('0x23')](function(_0x599fc5){if(_0x599fc5){return _0x599fc5?{'count':_0x30e3c6,'rows':_0x599fc5}:null;}})['then'](respondWithResult(_0xbabe64,null))[_0x2bc2('0x3d')](handleError(_0xbabe64,null));}; \ No newline at end of file +var _0xf999=['find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','ids','omit','CmContact','map','getContacts','eml-format','rimraf','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','show','params','rawAttributes','merge'];(function(_0x5204e2,_0x29981c){var _0x5c51e9=function(_0x206ea1){while(--_0x206ea1){_0x5204e2['push'](_0x5204e2['shift']());}};_0x5c51e9(++_0x29981c);}(_0xf999,0x160));var _0x9f99=function(_0x5af480,_0xf286a2){_0x5af480=_0x5af480-0x0;var _0x50520f=_0xf999[_0x5af480];return _0x50520f;};'use strict';var emlformat=require(_0x9f99('0x0'));var rimraf=require(_0x9f99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9f99('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9f99('0x3'));var util=require('util');var path=require('path');var sox=require(_0x9f99('0x4'));var csv=require(_0x9f99('0x5'));var ejs=require(_0x9f99('0x6'));var fs=require('fs');var fs_extra=require(_0x9f99('0x7'));var _=require(_0x9f99('0x8'));var squel=require(_0x9f99('0x9'));var crypto=require(_0x9f99('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9f99('0xb'));var toCsv=require(_0x9f99('0x5'));var querystring=require(_0x9f99('0xc'));var Papa=require(_0x9f99('0xd'));var Redis=require(_0x9f99('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9f99('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f99('0x10'));var logger=require(_0x9f99('0x11'))(_0x9f99('0x12'));var utils=require('../../config/utils');var config=require(_0x9f99('0x13'));var licenseUtil=require(_0x9f99('0x14'));var db=require(_0x9f99('0x15'))['db'];function respondWithStatusCode(_0x1b05ed,_0x443d20){_0x443d20=_0x443d20||0xcc;return function(_0x5332a1){if(_0x5332a1){return _0x1b05ed[_0x9f99('0x16')](_0x443d20);}return _0x1b05ed[_0x9f99('0x17')](_0x443d20)[_0x9f99('0x18')]();};}function respondWithResult(_0x34a754,_0x32d9bc){_0x32d9bc=_0x32d9bc||0xc8;return function(_0x4323e2){if(_0x4323e2){return _0x34a754[_0x9f99('0x17')](_0x32d9bc)[_0x9f99('0x19')](_0x4323e2);}};}function respondWithFilteredResult(_0x201eb7,_0xc4f1ed){return function(_0x5d5460){if(_0x5d5460){var _0x594d9b=typeof _0xc4f1ed[_0x9f99('0x1a')]===_0x9f99('0x1b')&&typeof _0xc4f1ed[_0x9f99('0x1c')]===_0x9f99('0x1b');var _0x172561=_0x5d5460[_0x9f99('0x1d')];var _0x22e090=_0x594d9b?0x0:_0xc4f1ed[_0x9f99('0x1a')];var _0x5ea2e9=_0x594d9b?_0x5d5460[_0x9f99('0x1d')]:_0xc4f1ed[_0x9f99('0x1a')]+_0xc4f1ed[_0x9f99('0x1c')];var _0x4ec6ec;if(_0x5ea2e9>=_0x172561){_0x5ea2e9=_0x172561;_0x4ec6ec=0xc8;}else{_0x4ec6ec=0xce;}_0x201eb7[_0x9f99('0x17')](_0x4ec6ec);return _0x201eb7['set'](_0x9f99('0x1e'),_0x22e090+'-'+_0x5ea2e9+'/'+_0x172561)[_0x9f99('0x19')](_0x5d5460);}return null;};}function patchUpdates(_0x4f1c18){return function(_0x3a50ef){try{jsonpatch['apply'](_0x3a50ef,_0x4f1c18,!![]);}catch(_0x22c6ac){return BPromise[_0x9f99('0x1f')](_0x22c6ac);}return _0x3a50ef['save']();};}function saveUpdates(_0x276412,_0x1b8975){return function(_0x2b155e){if(_0x2b155e){return _0x2b155e[_0x9f99('0x20')](_0x276412)[_0x9f99('0x21')](function(_0x27f977){return _0x27f977;});}return null;};}function removeEntity(_0x2ec325,_0xb0b42b){return function(_0x2aa9f4){if(_0x2aa9f4){return _0x2aa9f4[_0x9f99('0x22')]()[_0x9f99('0x21')](function(){var _0x419361=_0x2aa9f4[_0x9f99('0x23')]({'plain':!![]});var _0x5de981=_0x9f99('0x24');return db[_0x9f99('0x25')]['destroy']({'where':{'type':_0x5de981,'resourceId':_0x419361['id']}})[_0x9f99('0x21')](function(){return _0x2aa9f4;});})['then'](function(){_0x2ec325[_0x9f99('0x17')](0xcc)[_0x9f99('0x18')]();});}};}function handleEntityNotFound(_0x50a9c6,_0x3ebad7){return function(_0x1d31ac){if(!_0x1d31ac){_0x50a9c6[_0x9f99('0x16')](0x194);}return _0x1d31ac;};}function handleError(_0x499ed7,_0x81bc6d){_0x81bc6d=_0x81bc6d||0x1f4;return function(_0x47fd1f){logger[_0x9f99('0x26')](_0x47fd1f[_0x9f99('0x27')]);if(_0x47fd1f['name']){delete _0x47fd1f[_0x9f99('0x28')];}_0x499ed7[_0x9f99('0x17')](_0x81bc6d)[_0x9f99('0x29')](_0x47fd1f);};}exports[_0x9f99('0x2a')]=function(_0x46ef9d,_0x4a2c8d){var _0x36a8e3={},_0x4c86b3={},_0x1d9f12={'count':0x0,'rows':[]};return db[_0x9f99('0x2b')][_0x9f99('0x2c')]()[_0x9f99('0x21')](function(_0x28b59a){_0x4c86b3[_0x9f99('0x2d')]=_[_0x9f99('0x2e')](_0x28b59a);_0x4c86b3[_0x9f99('0x2f')]=_[_0x9f99('0x2e')](_0x46ef9d[_0x9f99('0x2f')]);_0x4c86b3[_0x9f99('0x30')]=_[_0x9f99('0x31')](_0x4c86b3[_0x9f99('0x2d')],_0x4c86b3['query']);_0x36a8e3[_0x9f99('0x32')]=_['intersection'](_0x4c86b3[_0x9f99('0x2d')],qs[_0x9f99('0x33')](_0x46ef9d['query']['fields']));_0x36a8e3[_0x9f99('0x32')]=_0x36a8e3[_0x9f99('0x32')][_0x9f99('0x34')]?_0x36a8e3['attributes']:_0x4c86b3['model'];if(!_0x46ef9d['query'][_0x9f99('0x35')](_0x9f99('0x36'))){_0x36a8e3['limit']=qs[_0x9f99('0x1c')](_0x46ef9d[_0x9f99('0x2f')][_0x9f99('0x1c')]);_0x36a8e3[_0x9f99('0x1a')]=qs[_0x9f99('0x1a')](_0x46ef9d['query'][_0x9f99('0x1a')]);}_0x36a8e3[_0x9f99('0x37')]=qs[_0x9f99('0x38')](_0x46ef9d['query'][_0x9f99('0x38')]);_0x36a8e3[_0x9f99('0x39')]=qs['filters'](_[_0x9f99('0x3a')](_0x46ef9d[_0x9f99('0x2f')],_0x4c86b3[_0x9f99('0x30')]),_0x28b59a);if(_0x46ef9d['query']['filter']){_0x36a8e3[_0x9f99('0x39')]=_['merge'](_0x36a8e3[_0x9f99('0x39')],{'$or':_['map'](_0x36a8e3[_0x9f99('0x32')],function(_0x2860d0){var _0x4a91c6={};_0x4a91c6[_0x2860d0]={'$like':'%'+_0x46ef9d[_0x9f99('0x2f')][_0x9f99('0x3b')]+'%'};return _0x4a91c6;})});}_0x36a8e3=_['merge']({},_0x36a8e3,_0x46ef9d[_0x9f99('0x3c')]);var _0x29c858={'where':_0x36a8e3[_0x9f99('0x39')]};return db[_0x9f99('0x2b')][_0x9f99('0x1d')](_0x29c858)['then'](function(_0x138839){_0x1d9f12['count']=_0x138839;if(_0x46ef9d[_0x9f99('0x2f')][_0x9f99('0x3d')]){_0x36a8e3[_0x9f99('0x3e')]=[{'all':!![]}];}return db[_0x9f99('0x2b')][_0x9f99('0x3f')](_0x36a8e3);})[_0x9f99('0x21')](function(_0x493512){_0x1d9f12['rows']=_0x493512;return _0x1d9f12;})[_0x9f99('0x21')](respondWithFilteredResult(_0x4a2c8d,_0x36a8e3))['catch'](handleError(_0x4a2c8d,null));})['catch'](handleError(_0x4a2c8d,null));};exports[_0x9f99('0x40')]=function(_0x4342cc,_0x293913){var _0x3ab2c0={'raw':![],'where':{'id':_0x4342cc[_0x9f99('0x41')]['id']}},_0x53933f={};_0x53933f[_0x9f99('0x2d')]=_[_0x9f99('0x2e')](db['CmCompany'][_0x9f99('0x42')]);_0x53933f[_0x9f99('0x2f')]=_[_0x9f99('0x2e')](_0x4342cc[_0x9f99('0x2f')]);_0x53933f[_0x9f99('0x30')]=_[_0x9f99('0x31')](_0x53933f[_0x9f99('0x2d')],_0x53933f[_0x9f99('0x2f')]);_0x3ab2c0[_0x9f99('0x32')]=_[_0x9f99('0x31')](_0x53933f[_0x9f99('0x2d')],qs[_0x9f99('0x33')](_0x4342cc['query']['fields']));_0x3ab2c0[_0x9f99('0x32')]=_0x3ab2c0[_0x9f99('0x32')][_0x9f99('0x34')]?_0x3ab2c0[_0x9f99('0x32')]:_0x53933f[_0x9f99('0x2d')];if(_0x4342cc['query']['includeAll']){_0x3ab2c0[_0x9f99('0x3e')]=[{'all':!![]}];}_0x3ab2c0=_[_0x9f99('0x43')]({},_0x3ab2c0,_0x4342cc[_0x9f99('0x3c')]);return db[_0x9f99('0x2b')][_0x9f99('0x44')](_0x3ab2c0)[_0x9f99('0x21')](handleEntityNotFound(_0x293913,null))[_0x9f99('0x21')](respondWithResult(_0x293913,null))[_0x9f99('0x45')](handleError(_0x293913,null));};exports['create']=function(_0x2dab81,_0x5ac698){return db['CmCompany']['create'](_0x2dab81['body'],{})[_0x9f99('0x21')](function(_0x46f691){var _0x1d8fa8=_0x2dab81[_0x9f99('0x46')][_0x9f99('0x23')]({'plain':!![]});if(!_0x1d8fa8)throw new Error(_0x9f99('0x47'));if(_0x1d8fa8[_0x9f99('0x48')]===_0x9f99('0x46')){var _0x551db5=_0x46f691[_0x9f99('0x23')]({'plain':!![]});var _0x5eb175=_0x9f99('0x24');return db[_0x9f99('0x49')][_0x9f99('0x44')]({'where':{'name':_0x5eb175,'userProfileId':_0x1d8fa8['userProfileId']},'raw':!![]})[_0x9f99('0x21')](function(_0x2a0069){if(_0x2a0069&&_0x2a0069[_0x9f99('0x4a')]===0x0){return db[_0x9f99('0x25')][_0x9f99('0x4b')]({'name':_0x551db5[_0x9f99('0x28')],'resourceId':_0x551db5['id'],'type':_0x2a0069['name'],'sectionId':_0x2a0069['id']},{})['then'](function(){return _0x46f691;});}else{return _0x46f691;}})[_0x9f99('0x45')](function(_0x343345){logger['error'](_0x9f99('0x4c'),_0x343345);throw _0x343345;});}return _0x46f691;})[_0x9f99('0x21')](respondWithResult(_0x5ac698,0xc9))[_0x9f99('0x45')](handleError(_0x5ac698,null));};exports[_0x9f99('0x20')]=function(_0x36bd25,_0x1a00a6){if(_0x36bd25[_0x9f99('0x4d')]['id']){delete _0x36bd25[_0x9f99('0x4d')]['id'];}return db['CmCompany'][_0x9f99('0x44')]({'where':{'id':_0x36bd25[_0x9f99('0x41')]['id']}})[_0x9f99('0x21')](handleEntityNotFound(_0x1a00a6,null))[_0x9f99('0x21')](saveUpdates(_0x36bd25[_0x9f99('0x4d')],null))[_0x9f99('0x21')](respondWithResult(_0x1a00a6,null))['catch'](handleError(_0x1a00a6,null));};exports[_0x9f99('0x22')]=function(_0x1c0366,_0x1f93da){return db[_0x9f99('0x2b')][_0x9f99('0x44')]({'where':{'id':_0x1c0366[_0x9f99('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f93da,null))['then'](removeEntity(_0x1f93da,null))[_0x9f99('0x45')](handleError(_0x1f93da,null));};exports[_0x9f99('0x2c')]=function(_0x401aec,_0x5f037e){return db['CmCompany'][_0x9f99('0x2c')]()['then'](respondWithResult(_0x5f037e,null))[_0x9f99('0x45')](handleError(_0x5f037e,null));};exports['addContacts']=function(_0x2541d6,_0x4e3102,_0x2011ea){return db['CmContact'][_0x9f99('0x44')]({'where':{'id':_0x2541d6[_0x9f99('0x41')]['id']}})[_0x9f99('0x21')](handleEntityNotFound(_0x4e3102,null))[_0x9f99('0x21')](function(_0x190219){if(_0x190219){return _0x190219[_0x9f99('0x4e')](_0x2541d6[_0x9f99('0x4d')][_0x9f99('0x4f')],_[_0x9f99('0x50')](_0x2541d6[_0x9f99('0x4d')],[_0x9f99('0x4f'),'id'])||{});}})[_0x9f99('0x21')](respondWithResult(_0x4e3102,null))[_0x9f99('0x45')](handleError(_0x4e3102,null));};exports['getContacts']=function(_0x48140b,_0x69ea9,_0x24383f){var _0x15ca22={};var _0x4bbcb6={};var _0x2e88f8;var _0x40b194;return db['CmCompany']['findOne']({'where':{'id':_0x48140b[_0x9f99('0x41')]['id']}})['then'](handleEntityNotFound(_0x69ea9,null))['then'](function(_0x2572ac){if(_0x2572ac){_0x2e88f8=_0x2572ac;_0x4bbcb6[_0x9f99('0x2d')]=_['keys'](db[_0x9f99('0x51')][_0x9f99('0x42')]);_0x4bbcb6['query']=_[_0x9f99('0x2e')](_0x48140b[_0x9f99('0x2f')]);_0x4bbcb6[_0x9f99('0x30')]=_[_0x9f99('0x31')](_0x4bbcb6['model'],_0x4bbcb6['query']);_0x15ca22['attributes']=_[_0x9f99('0x31')](_0x4bbcb6['model'],qs[_0x9f99('0x33')](_0x48140b['query'][_0x9f99('0x33')]));_0x15ca22[_0x9f99('0x32')]=_0x15ca22[_0x9f99('0x32')][_0x9f99('0x34')]?_0x15ca22[_0x9f99('0x32')]:_0x4bbcb6['model'];_0x15ca22['order']=qs['sort'](_0x48140b[_0x9f99('0x2f')][_0x9f99('0x38')]);_0x15ca22['where']=qs[_0x9f99('0x30')](_['pick'](_0x48140b[_0x9f99('0x2f')],_0x4bbcb6['filters']));if(_0x48140b[_0x9f99('0x2f')][_0x9f99('0x3b')]){_0x15ca22[_0x9f99('0x39')]=_['merge'](_0x15ca22[_0x9f99('0x39')],{'$or':_[_0x9f99('0x52')](_0x15ca22[_0x9f99('0x32')],function(_0x35a13e){var _0x4c3250={};_0x4c3250[_0x35a13e]={'$like':'%'+_0x48140b['query'][_0x9f99('0x3b')]+'%'};return _0x4c3250;})});}_0x15ca22=_['merge']({},_0x15ca22,_0x48140b[_0x9f99('0x3c')]);return _0x2e88f8[_0x9f99('0x53')](_0x15ca22);}})['then'](function(_0x308dac){if(_0x308dac){_0x40b194=_0x308dac[_0x9f99('0x34')];if(!_0x48140b[_0x9f99('0x2f')][_0x9f99('0x35')](_0x9f99('0x36'))){_0x15ca22['limit']=qs[_0x9f99('0x1c')](_0x48140b[_0x9f99('0x2f')]['limit']);_0x15ca22[_0x9f99('0x1a')]=qs[_0x9f99('0x1a')](_0x48140b[_0x9f99('0x2f')][_0x9f99('0x1a')]);}return _0x2e88f8['getContacts'](_0x15ca22);}})[_0x9f99('0x21')](function(_0x44550d){if(_0x44550d){return _0x44550d?{'count':_0x40b194,'rows':_0x44550d}:null;}})[_0x9f99('0x21')](respondWithResult(_0x69ea9,null))[_0x9f99('0x45')](handleError(_0x69ea9,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index a3d2347..a5e1b21 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 _0x1d07=['CmCompany','lodash','util','api','bluebird','request-promise','path','./cmCompany.attributes','exports'];(function(_0x5da396,_0x3242cd){var _0x5928e2=function(_0x1d1716){while(--_0x1d1716){_0x5da396['push'](_0x5da396['shift']());}};_0x5928e2(++_0x3242cd);}(_0x1d07,0x184));var _0x71d0=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x1d07[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x71d0('0x0'));var util=require(_0x71d0('0x1'));var logger=require('../../config/logger')(_0x71d0('0x2'));var moment=require('moment');var BPromise=require(_0x71d0('0x3'));var rp=require(_0x71d0('0x4'));var fs=require('fs');var path=require(_0x71d0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x71d0('0x6'));module[_0x71d0('0x7')]=function(_0x3b685c,_0x25b9fd){return _0x3b685c['define'](_0x71d0('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad99=['CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cmCompany.attributes'];(function(_0x2f9a4a,_0x93573e){var _0x1529f7=function(_0x206bfe){while(--_0x206bfe){_0x2f9a4a['push'](_0x2f9a4a['shift']());}};_0x1529f7(++_0x93573e);}(_0xad99,0xd3));var _0x9ad9=function(_0x475a8,_0x589d16){_0x475a8=_0x475a8-0x0;var _0x224501=_0xad99[_0x475a8];return _0x224501;};'use strict';var _=require(_0x9ad9('0x0'));var util=require(_0x9ad9('0x1'));var logger=require(_0x9ad9('0x2'))(_0x9ad9('0x3'));var moment=require(_0x9ad9('0x4'));var BPromise=require('bluebird');var rp=require(_0x9ad9('0x5'));var fs=require('fs');var path=require(_0x9ad9('0x6'));var rimraf=require(_0x9ad9('0x7'));var config=require('../../config/environment');var attributes=require(_0x9ad9('0x8'));module['exports']=function(_0x5c4027,_0x317e0a){return _0x5c4027['define'](_0x9ad9('0x9'),attributes,{'tableName':_0x9ad9('0xa'),'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 66686d5..62abe30 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 _0x4292=['http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x6a0c92,_0x241b17){var _0x546bb3=function(_0x1937d1){while(--_0x1937d1){_0x6a0c92['push'](_0x6a0c92['shift']());}};_0x546bb3(++_0x241b17);}(_0x4292,0x1b0));var _0x2429=function(_0x33e314,_0x43532){_0x33e314=_0x33e314-0x0;var _0x54a323=_0x4292[_0x33e314];return _0x54a323;};'use strict';var _=require(_0x2429('0x0'));var util=require('util');var moment=require(_0x2429('0x1'));var BPromise=require('bluebird');var rs=require(_0x2429('0x2'));var fs=require('fs');var Redis=require(_0x2429('0x3'));var db=require(_0x2429('0x4'))['db'];var utils=require(_0x2429('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2429('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2429('0x7')][_0x2429('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f68e3,_0x299251,_0x466c2f){return new BPromise(function(_0x4ca88d,_0x1c9980){return client[_0x2429('0x9')](_0x1f68e3,_0x466c2f)[_0x2429('0xa')](function(_0x53d1b5){logger[_0x2429('0xb')](_0x2429('0xc'),_0x299251,_0x2429('0xd'));logger[_0x2429('0xe')](_0x2429('0xf'),_0x299251,_0x2429('0xd'),JSON[_0x2429('0x10')](_0x53d1b5));if(_0x53d1b5[_0x2429('0x11')]){if(_0x53d1b5[_0x2429('0x11')][_0x2429('0x12')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x299251,_0x53d1b5[_0x2429('0x11')][_0x2429('0x13')]);return _0x1c9980(_0x53d1b5[_0x2429('0x11')][_0x2429('0x13')]);}logger[_0x2429('0x11')](_0x2429('0xc'),_0x299251,_0x53d1b5[_0x2429('0x11')][_0x2429('0x13')]);return _0x4ca88d(_0x53d1b5[_0x2429('0x11')][_0x2429('0x13')]);}else{logger[_0x2429('0xb')](_0x2429('0xc'),_0x299251,_0x2429('0xd'));_0x4ca88d(_0x53d1b5[_0x2429('0x14')][_0x2429('0x13')]);}})[_0x2429('0x15')](function(_0xc59ae1){logger[_0x2429('0x11')](_0x2429('0xc'),_0x299251,_0xc59ae1);_0x1c9980(_0xc59ae1);});});} \ No newline at end of file +var _0x7ec1=['info','CmCompany,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x4ba4de,_0x5294d3){var _0x161c98=function(_0x334d44){while(--_0x334d44){_0x4ba4de['push'](_0x4ba4de['shift']());}};_0x161c98(++_0x5294d3);}(_0x7ec1,0x1d0));var _0x17ec=function(_0x292f12,_0x525719){_0x292f12=_0x292f12-0x0;var _0x1171a0=_0x7ec1[_0x292f12];return _0x1171a0;};'use strict';var _=require('lodash');var util=require(_0x17ec('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x17ec('0x1'));var fs=require('fs');var Redis=require(_0x17ec('0x2'));var db=require(_0x17ec('0x3'))['db'];var utils=require(_0x17ec('0x4'));var logger=require(_0x17ec('0x5'))(_0x17ec('0x6'));var config=require(_0x17ec('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x17ec('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36b509,_0x182ed6,_0x96f65d){return new BPromise(function(_0x570f78,_0x9b1da2){return client[_0x17ec('0x9')](_0x36b509,_0x96f65d)[_0x17ec('0xa')](function(_0xe4c24e){logger[_0x17ec('0xb')](_0x17ec('0xc'),_0x182ed6,_0x17ec('0xd'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x182ed6,_0x17ec('0xd'),JSON[_0x17ec('0xe')](_0xe4c24e));if(_0xe4c24e['error']){if(_0xe4c24e[_0x17ec('0xf')][_0x17ec('0x10')]===0x1f4){logger['error'](_0x17ec('0xc'),_0x182ed6,_0xe4c24e[_0x17ec('0xf')][_0x17ec('0x11')]);return _0x9b1da2(_0xe4c24e[_0x17ec('0xf')]['message']);}logger['error'](_0x17ec('0xc'),_0x182ed6,_0xe4c24e[_0x17ec('0xf')][_0x17ec('0x11')]);return _0x570f78(_0xe4c24e[_0x17ec('0xf')]['message']);}else{logger[_0x17ec('0xb')](_0x17ec('0xc'),_0x182ed6,_0x17ec('0xd'));_0x570f78(_0xe4c24e['result']['message']);}})[_0x17ec('0x12')](function(_0xadcee4){logger[_0x17ec('0xf')](_0x17ec('0xc'),_0x182ed6,_0xadcee4);_0x9b1da2(_0xadcee4);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 7ee7005..9d8909f 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 _0x24cd=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update'];(function(_0x12137b,_0x368aa4){var _0x2ec2b3=function(_0x3b0faf){while(--_0x3b0faf){_0x12137b['push'](_0x12137b['shift']());}};_0x2ec2b3(++_0x368aa4);}(_0x24cd,0x17a));var _0xd24c=function(_0x4dc9e6,_0x3ed04a){_0x4dc9e6=_0x4dc9e6-0x0;var _0x4bbdcb=_0x24cd[_0x4dc9e6];return _0x4bbdcb;};'use strict';var multer=require('multer');var util=require(_0xd24c('0x0'));var path=require(_0xd24c('0x1'));var timeout=require(_0xd24c('0x2'));var express=require(_0xd24c('0x3'));var router=express[_0xd24c('0x4')]();var fs_extra=require(_0xd24c('0x5'));var auth=require(_0xd24c('0x6'));var interaction=require(_0xd24c('0x7'));var config=require(_0xd24c('0x8'));var controller=require(_0xd24c('0x9'));router[_0xd24c('0xa')]('/',auth[_0xd24c('0xb')](),controller[_0xd24c('0xc')]);router[_0xd24c('0xa')]('/describe',auth[_0xd24c('0xb')](),controller[_0xd24c('0xd')]);router[_0xd24c('0xa')](_0xd24c('0xe'),auth['isAuthenticated'](),controller[_0xd24c('0xf')]);router[_0xd24c('0xa')](_0xd24c('0x10'),auth[_0xd24c('0xb')](),controller[_0xd24c('0x11')]);router[_0xd24c('0x12')]('/',auth[_0xd24c('0xb')](),controller[_0xd24c('0x13')]);router[_0xd24c('0x12')](_0xd24c('0x10'),auth[_0xd24c('0xb')](),controller[_0xd24c('0x14')]);router['put'](_0xd24c('0xe'),auth[_0xd24c('0xb')](),controller[_0xd24c('0x15')]);router[_0xd24c('0x16')]('/:id',auth[_0xd24c('0xb')](),controller[_0xd24c('0x17')]);module[_0xd24c('0x18')]=router; \ No newline at end of file +var _0xbcec=['/describe','isAuthenticated','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmCompany.controller','get'];(function(_0x537ef7,_0x1bd866){var _0x603c2e=function(_0x5a1cfa){while(--_0x5a1cfa){_0x537ef7['push'](_0x537ef7['shift']());}};_0x603c2e(++_0x1bd866);}(_0xbcec,0xbd));var _0xcbce=function(_0x84a97e,_0x59f2f2){_0x84a97e=_0x84a97e-0x0;var _0x3f980b=_0xbcec[_0x84a97e];return _0x3f980b;};'use strict';var multer=require('multer');var util=require(_0xcbce('0x0'));var path=require(_0xcbce('0x1'));var timeout=require(_0xcbce('0x2'));var express=require(_0xcbce('0x3'));var router=express[_0xcbce('0x4')]();var fs_extra=require(_0xcbce('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcbce('0x6'));var config=require('../../config/environment');var controller=require(_0xcbce('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xcbce('0x8')](_0xcbce('0x9'),auth[_0xcbce('0xa')](),controller['describe']);router[_0xcbce('0x8')](_0xcbce('0xb'),auth[_0xcbce('0xa')](),controller[_0xcbce('0xc')]);router[_0xcbce('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xcbce('0xd')]);router[_0xcbce('0xe')]('/',auth[_0xcbce('0xa')](),controller[_0xcbce('0xf')]);router['post'](_0xcbce('0x10'),auth[_0xcbce('0xa')](),controller[_0xcbce('0x11')]);router[_0xcbce('0x12')](_0xcbce('0xb'),auth[_0xcbce('0xa')](),controller[_0xcbce('0x13')]);router[_0xcbce('0x14')](_0xcbce('0xb'),auth[_0xcbce('0xa')](),controller[_0xcbce('0x15')]);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 dab212c..ff69cc5 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 _0x6195=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x7ce51e,_0x251618){var _0xfd7e9a=function(_0x4a0b27){while(--_0x4a0b27){_0x7ce51e['push'](_0x7ce51e['shift']());}};_0xfd7e9a(++_0x251618);}(_0x6195,0xf9));var _0x5619=function(_0x3a5061,_0x17cb02){_0x3a5061=_0x3a5061-0x0;var _0x310beb=_0x6195[_0x3a5061];return _0x310beb;};'use strict';var _=require(_0x5619('0x0'));var Sequelize=require(_0x5619('0x1'));module[_0x5619('0x2')]={'firstName':{'type':Sequelize[_0x5619('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5619('0x3')]},'street':{'type':Sequelize[_0x5619('0x3')]},'postalCode':{'type':Sequelize[_0x5619('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x5619('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5619('0x3')]},'description':{'type':Sequelize[_0x5619('0x4')]},'phone':{'type':Sequelize[_0x5619('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x5619('0x3')]},'email':{'type':Sequelize[_0x5619('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x5619('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x5619('0x3')]},'wechat':{'type':Sequelize[_0x5619('0x3')]},'telegram':{'type':Sequelize[_0x5619('0x3')]},'UserId':{'type':Sequelize[_0x5619('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5619('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5619('0x7')],'defaultValue':Sequelize[_0x5619('0x8')]}}; \ No newline at end of file +var _0x6bbc=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x19671a,_0x456e1e){var _0x33b179=function(_0xc26cc0){while(--_0xc26cc0){_0x19671a['push'](_0x19671a['shift']());}};_0x33b179(++_0x456e1e);}(_0x6bbc,0x1bd));var _0xc6bb=function(_0x485d47,_0x323593){_0x485d47=_0x485d47-0x0;var _0x342cb0=_0x6bbc[_0x485d47];return _0x342cb0;};'use strict';var _=require(_0xc6bb('0x0'));var Sequelize=require(_0xc6bb('0x1'));module[_0xc6bb('0x2')]={'firstName':{'type':Sequelize[_0xc6bb('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc6bb('0x3')]},'street':{'type':Sequelize[_0xc6bb('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc6bb('0x3')]},'country':{'type':Sequelize[_0xc6bb('0x3')]},'dateOfBirth':{'type':Sequelize[_0xc6bb('0x3')]},'description':{'type':Sequelize[_0xc6bb('0x4')]},'phone':{'type':Sequelize[_0xc6bb('0x3')]},'mobile':{'type':Sequelize[_0xc6bb('0x3')]},'fax':{'type':Sequelize[_0xc6bb('0x3')]},'email':{'type':Sequelize[_0xc6bb('0x3')]},'url':{'type':Sequelize[_0xc6bb('0x3')]},'facebook':{'type':Sequelize[_0xc6bb('0x3')]},'fb_data':{'type':Sequelize[_0xc6bb('0x3')]},'twitter':{'type':Sequelize[_0xc6bb('0x3')]},'skype':{'type':Sequelize[_0xc6bb('0x3')]},'teams':{'type':Sequelize[_0xc6bb('0x3')]},'viber':{'type':Sequelize[_0xc6bb('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xc6bb('0x3')]},'telegram':{'type':Sequelize[_0xc6bb('0x3')]},'UserId':{'type':Sequelize[_0xc6bb('0x5')]},'priority':{'type':Sequelize[_0xc6bb('0x5')](0x2)[_0xc6bb('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc6bb('0x7')],'defaultValue':Sequelize[_0xc6bb('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index f9eaf34..1b8f39b 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 _0x03fc=['Tags','push','rows','catch','destroy','find','params','describe','cf_','columnName','displayName','values','merge','body','get','tags','join','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','bulkCreate','each','duplicates','ListId','spread','$and','CmCustomField','findAll','omit','format','cf_%d','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','CmHopper','rawAttributes','options','getTags','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','CmHopperFinal','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\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','fork','CompanyId','File\x20uploaded\x20correctly!','createReadStream','parse','meta','import','binding','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','UserId','fullname','alias','startCase','Website','disposition','Account','browserName','customerIp','customerPort','deviceModel','osName','ratingType','referer','subject','substatus','Interaction','findAndCountAll','Owner','flatten','sortBy','slice','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./cmContact.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','keys','length','startsWith','findOne','trimStart','all','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','select','field','color','from','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','parseSearch','sqlOperator','conditions','Tag','value','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','castTo','buildExpression','text','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','QueryTypes','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','map','toString','keyBy','CmContact','c.id','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03fc,0x96));var _0xc03f=function(_0x450576,_0x27d6c6){_0x450576=_0x450576-0x0;var _0x49013e=_0x03fc[_0x450576];return _0x49013e;};'use strict';var emlformat=require(_0xc03f('0x0'));var rimraf=require(_0xc03f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc03f('0x2'));var rp=require(_0xc03f('0x3'));var moment=require(_0xc03f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc03f('0x5'));var util=require('util');var path=require(_0xc03f('0x6'));var sox=require(_0xc03f('0x7'));var csv=require('to-csv');var ejs=require(_0xc03f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc03f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc03f('0xa'));var deskjs=require(_0xc03f('0xb'));var toCsv=require(_0xc03f('0xc'));var querystring=require(_0xc03f('0xd'));var Papa=require('papaparse');var Redis=require(_0xc03f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc03f('0xf'));var as=require(_0xc03f('0x10'));var hardwareService=require(_0xc03f('0x11'));var logger=require('../../config/logger')(_0xc03f('0x12'));var utils=require('../../config/utils');var config=require(_0xc03f('0x13'));var licenseUtil=require(_0xc03f('0x14'));var db=require(_0xc03f('0x15'))['db'];config['redis']=_[_0xc03f('0x16')](config[_0xc03f('0x17')],{'host':_0xc03f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc03f('0x17')]));require(_0xc03f('0x19'))[_0xc03f('0x1a')](socket);function respondWithStatusCode(_0x113ccd,_0xdda846){_0xdda846=_0xdda846||0xcc;return function(_0x445776){if(_0x445776){return _0x113ccd[_0xc03f('0x1b')](_0xdda846);}return _0x113ccd[_0xc03f('0x1c')](_0xdda846)[_0xc03f('0x1d')]();};}function respondWithResult(_0x11e667,_0x410012){_0x410012=_0x410012||0xc8;return function(_0x3f19ac){if(_0x3f19ac){return _0x11e667[_0xc03f('0x1c')](_0x410012)['json'](_0x3f19ac);}};}function respondWithFilteredResult(_0x30fcf1,_0x355927){return function(_0xb9e0a5){if(_0xb9e0a5){var _0x9bedee=typeof _0x355927[_0xc03f('0x1e')]==='undefined'&&typeof _0x355927['limit']===_0xc03f('0x1f');var _0x565602=_0xb9e0a5['count'];var _0x307c99=_0x9bedee?0x0:_0x355927[_0xc03f('0x1e')];var _0x21568b=_0x9bedee?_0xb9e0a5[_0xc03f('0x20')]:_0x355927[_0xc03f('0x1e')]+_0x355927[_0xc03f('0x21')];var _0x540769;if(_0x21568b>=_0x565602){_0x21568b=_0x565602;_0x540769=0xc8;}else{_0x540769=0xce;}_0x30fcf1[_0xc03f('0x1c')](_0x540769);return _0x30fcf1[_0xc03f('0x22')](_0xc03f('0x23'),_0x307c99+'-'+_0x21568b+'/'+_0x565602)[_0xc03f('0x24')](_0xb9e0a5);}return null;};}function patchUpdates(_0x4936bc){return function(_0x312bae){try{jsonpatch[_0xc03f('0x25')](_0x312bae,_0x4936bc,!![]);}catch(_0x3e1680){return BPromise[_0xc03f('0x26')](_0x3e1680);}return _0x312bae[_0xc03f('0x27')]();};}function saveUpdates(_0x25dad3,_0x32a5a5){return function(_0x401036){if(_0x401036){return _0x401036['update'](_0x25dad3)['then'](function(_0x3be9a9){return _0x3be9a9;});}return null;};}function removeEntity(_0x331d31,_0x65d0b){return function(_0x2847f){if(_0x2847f){return _0x2847f['destroy']()[_0xc03f('0x28')](function(){_0x331d31['status'](0xcc)[_0xc03f('0x1d')]();});}};}function handleEntityNotFound(_0x30a5d1,_0x2d14bb){return function(_0x3972fa){if(!_0x3972fa){_0x30a5d1[_0xc03f('0x1b')](0x194);}return _0x3972fa;};}function handleError(_0x374077,_0x134c84){_0x134c84=_0x134c84||0x1f4;return function(_0x23ba79){logger[_0xc03f('0x29')](_0x23ba79[_0xc03f('0x2a')]);if(_0x23ba79['name']){delete _0x23ba79[_0xc03f('0x2b')];}_0x374077[_0xc03f('0x1c')](_0x134c84)[_0xc03f('0x2c')](_0x23ba79);};}exports[_0xc03f('0x2d')]=function(_0x503852,_0x487b58){var _0x17143e={},_0x482b65={},_0x4465a1={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0xc03f('0x28')](function(_0x58a679){var _0x31dbdb=[];for(var _0x573f15=0x0;_0x573f150x1){_0x5c5310['or'](_0xc03f('0x67'),qs[_0xc03f('0x68')](_0xe1169f),null);}else{if(qs[_0xc03f('0x69')](_0xe1169f)){_0x5c5310['or'](_0xc03f('0x6a'),_0xe1169f+'%');_0x5c5310['or'](_0xc03f('0x6b'),_0xe1169f+'%');_0x5c5310['or'](_0xc03f('0x6c'),_0xe1169f+'%');_0x5c5310['or']('c.fax\x20LIKE\x20?',_0xe1169f+'%');}else if(qs['isEmail'](_0xe1169f)){_0x5c5310['or'](_0xc03f('0x6d'),_0xe1169f+'%');}else{_0x5c5310['or'](_0xc03f('0x6e'),'%'+_0xe1169f+'%');_0x5c5310['or'](_0xc03f('0x6f'),'%'+_0xe1169f+'%');_0x5c5310['or'](_0xc03f('0x6d'),'%'+_0xe1169f+'%');}}}}_0x13ed25[_0xc03f('0x49')](_0x5c5310);_0x13ed25['group']('c.id');var _0x375482={'type':db['Sequelize'][_0xc03f('0x70')][_0xc03f('0x71')],'raw':!![]};var _0x1e9db4=_0x13ed25[_0xc03f('0x72')]()[_0xc03f('0x40')]('c.id');if(_0x17143e[_0xc03f('0x73')]){_0x17143e['order'][_0xc03f('0x52')](function(_0x3229fc){_0x13ed25[_0xc03f('0x73')]('c.'+_0x3229fc[0x0],_0x3229fc[0x1]===_0xc03f('0x74')?![]:!![]);});}if(!_[_0xc03f('0x5e')](_0x4126d2)){_0x13ed25[_0xc03f('0x75')](_0x213226);_0x1e9db4[_0xc03f('0x49')](_0xc03f('0x76'),_0x4126d2);}BPromise[_0xc03f('0x77')]()[_0xc03f('0x28')](function(){if(!_0x21d431)return;if(_0x503852[_0xc03f('0x78')][_0xc03f('0x79')]!==_0xc03f('0x7a'))return;if(!_[_0xc03f('0x7b')](_0x21d431['conditions'],[_0xc03f('0x40'),_0xc03f('0x55')])){return _0x503852[_0xc03f('0x78')][_0xc03f('0x7c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x97b9e3){if(_['isEmpty'](_0x97b9e3)){_0x1e9db4[_0xc03f('0x49')](_0xc03f('0x7d'));_0x13ed25[_0xc03f('0x49')](_0xc03f('0x7d'));}else{_0x1e9db4[_0xc03f('0x49')](_0xc03f('0x5f'),_[_0xc03f('0x7e')](_0x97b9e3,'id'));_0x13ed25[_0xc03f('0x49')](_0xc03f('0x5f'),_[_0xc03f('0x7e')](_0x97b9e3,'id'));}});}})[_0xc03f('0x28')](function(){if(_0x503852[_0xc03f('0x78')][_0xc03f('0x79')]==='agent'&&!_0x21d431&&!_0x503852[_0xc03f('0x36')]['ListId'])return[];return db['sequelize'][_0xc03f('0x36')](_0x1e9db4[_0xc03f('0x7f')](),_0x375482);})[_0xc03f('0x28')](function(_0x247b75){_0x4465a1[_0xc03f('0x20')]=_0x247b75['length'];if(_0x4465a1[_0xc03f('0x20')]===0x0)return[];return db['sequelize'][_0xc03f('0x36')](_0x3004cf[_0xc03f('0x7f')](),_0x375482)[_0xc03f('0x28')](function(_0x5cc7ad){_0x102066=_[_0xc03f('0x80')](_0x5cc7ad,'id');_0x375482=_['merge'](_0x375482,{'model':db[_0xc03f('0x81')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x503852['query'][_0xc03f('0x3a')]){_0x17143e[_0xc03f('0x38')]['forEach'](function(_0x5b355e){_0x13ed25[_0xc03f('0x40')]('c.'+_0x5b355e);});}else{_0x13ed25[_0xc03f('0x40')](_0xc03f('0x82'));_0x13ed25[_0xc03f('0x40')](_0xc03f('0x83'));_0x13ed25[_0xc03f('0x40')](_0xc03f('0x84'));_0x13ed25[_0xc03f('0x40')](_0xc03f('0x85'));_0x13ed25['field'](_0xc03f('0x86'));_0x13ed25[_0xc03f('0x40')]('c.fax');_0x13ed25['field'](_0xc03f('0x87'));_0x13ed25['field'](_0xc03f('0x88'));_0x13ed25[_0xc03f('0x40')](_0xc03f('0x89'));_0x13ed25[_0xc03f('0x40')](_0xc03f('0x8a'));_0x13ed25[_0xc03f('0x40')](_0xc03f('0x8b'));_0x13ed25['field'](_0xc03f('0x8c'),_0xc03f('0x8d'));}if(_0x17143e[_0xc03f('0x21')])_0x13ed25['limit'](_0x17143e[_0xc03f('0x21')]);if(_0x17143e[_0xc03f('0x1e')])_0x13ed25[_0xc03f('0x1e')](_0x17143e[_0xc03f('0x1e')]);return db[_0xc03f('0x8e')][_0xc03f('0x36')](_0x13ed25['toString'](),_0x375482);});})[_0xc03f('0x28')](function(_0x36f09c){_0x36f09c[_0xc03f('0x52')](function(_0x5ba37b){if(_0x5ba37b['TagIds']){_0x5ba37b[_0xc03f('0x8f')]=[];_0x5ba37b[_0xc03f('0x8d')]['split'](',')[_0xc03f('0x52')](function(_0x1f7a26){_0x5ba37b['Tags'][_0xc03f('0x90')](_0x102066[_0x1f7a26]);});}delete _0x5ba37b[_0xc03f('0x8d')];});_0x4465a1[_0xc03f('0x91')]=_0x36f09c;return _0x4465a1;})[_0xc03f('0x28')](respondWithFilteredResult(_0x487b58,_0x17143e));})[_0xc03f('0x92')](handleError(_0x487b58,null));};exports[_0xc03f('0x93')]=function(_0x5b5ac4,_0x399de0){return db[_0xc03f('0x81')][_0xc03f('0x94')]({'where':{'id':_0x5b5ac4[_0xc03f('0x95')]['id']}})[_0xc03f('0x28')](handleEntityNotFound(_0x399de0,null))[_0xc03f('0x28')](removeEntity(_0x399de0,null))[_0xc03f('0x92')](handleError(_0x399de0,null));};exports['describe']=function(_0x13549c,_0x15a4f3){return db[_0xc03f('0x81')][_0xc03f('0x96')]()[_0xc03f('0x28')](function(_0x156b2c){delete _0x156b2c['tags'];for(var _0x106b73=0x0;_0x106b73=_0x1d1e21){_0x10b221=_0x1d1e21;_0x8ddb9d=0xc8;}else{_0x8ddb9d=0xce;}_0x1e33a4[_0x43d2('0x1c')](_0x8ddb9d);return _0x1e33a4['set'](_0x43d2('0x21'),_0xe3e28c+'-'+_0x10b221+'/'+_0x1d1e21)['json'](_0x12154e);}return null;};}function patchUpdates(_0x44eb3d){return function(_0x1825af){try{jsonpatch[_0x43d2('0x22')](_0x1825af,_0x44eb3d,!![]);}catch(_0x3d4323){return BPromise[_0x43d2('0x23')](_0x3d4323);}return _0x1825af[_0x43d2('0x24')]();};}function saveUpdates(_0xc0388a,_0x4d38d8){return function(_0x58779c){if(_0x58779c){return _0x58779c[_0x43d2('0x25')](_0xc0388a)['then'](function(_0x47d45f){return _0x47d45f;});}return null;};}function removeEntity(_0x38c4b7,_0x4e3b1b){return function(_0xcbb2c3){if(_0xcbb2c3){return _0xcbb2c3[_0x43d2('0x26')]()[_0x43d2('0x27')](function(){_0x38c4b7[_0x43d2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11ea56,_0x11917f){return function(_0x55634c){if(!_0x55634c){_0x11ea56[_0x43d2('0x1a')](0x194);}return _0x55634c;};}function handleError(_0xfd401b,_0x597658){_0x597658=_0x597658||0x1f4;return function(_0x2e2bc6){logger[_0x43d2('0x28')](_0x2e2bc6['stack']);if(_0x2e2bc6[_0x43d2('0x29')]){delete _0x2e2bc6[_0x43d2('0x29')];}_0xfd401b[_0x43d2('0x1c')](_0x597658)[_0x43d2('0x2a')](_0x2e2bc6);};}exports[_0x43d2('0x2b')]=function(_0x337114,_0x4aa22d){var _0x5ddb10={},_0x252453={},_0x43e556={'count':0x0,'rows':[]};return db[_0x43d2('0x2c')][_0x43d2('0x2d')]()[_0x43d2('0x27')](function(_0x48c512){var _0x456f1f=[];for(var _0x1cb115=0x0;_0x1cb1150x1){_0x10143e['or'](_0x43d2('0x69'),qs['getFullTextValue'](_0x239d38),null);}else{if(qs['isNumeric'](_0x239d38)){_0x10143e['or'](_0x43d2('0x6a'),_0x239d38+'%');_0x10143e['or']('c.phone\x20LIKE\x20?',_0x239d38+'%');_0x10143e['or'](_0x43d2('0x6b'),_0x239d38+'%');_0x10143e['or'](_0x43d2('0x6c'),_0x239d38+'%');}else if(qs['isEmail'](_0x239d38)){_0x10143e['or'](_0x43d2('0x6d'),_0x239d38+'%');}else{_0x10143e['or'](_0x43d2('0x6e'),'%'+_0x239d38+'%');_0x10143e['or']('c.lastName\x20LIKE\x20?','%'+_0x239d38+'%');_0x10143e['or']('c.email\x20LIKE\x20?','%'+_0x239d38+'%');}}}}_0x4dba54[_0x43d2('0x3d')](_0x10143e);_0x4dba54[_0x43d2('0x6f')](_0x43d2('0x70'));var _0x8611b8={'type':db[_0x43d2('0x71')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3ce283=_0x4dba54[_0x43d2('0x72')]()[_0x43d2('0x40')]('c.id');if(_0x5ddb10['order']){_0x5ddb10[_0x43d2('0x3b')]['forEach'](function(_0x1cb573){_0x4dba54[_0x43d2('0x3b')]('c.'+_0x1cb573[0x0],_0x1cb573[0x1]===_0x43d2('0x73')?![]:!![]);});}if(!_[_0x43d2('0x62')](_0xdda4af)){_0x4dba54['having'](_0x5acda9);_0x3ce283[_0x43d2('0x3d')]('t.id\x20IN\x20?',_0xdda4af);}BPromise[_0x43d2('0x74')]()['then'](function(){if(!_0xd3cbe3)return;if(_0x337114[_0x43d2('0x75')][_0x43d2('0x76')]!==_0x43d2('0x77'))return;if(!_[_0x43d2('0x78')](_0xd3cbe3[_0x43d2('0x4d')],[_0x43d2('0x40'),_0x43d2('0x79')])){return _0x337114['user'][_0x43d2('0x7a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1093f8){if(_[_0x43d2('0x62')](_0x1093f8)){_0x3ce283[_0x43d2('0x3d')]('c.ListId\x20IS\x20NULL');_0x4dba54[_0x43d2('0x3d')]('c.ListId\x20IS\x20NULL');}else{_0x3ce283[_0x43d2('0x3d')](_0x43d2('0x64'),_[_0x43d2('0x5d')](_0x1093f8,'id'));_0x4dba54['where'](_0x43d2('0x64'),_[_0x43d2('0x5d')](_0x1093f8,'id'));}});}})[_0x43d2('0x27')](function(){if(_0x337114[_0x43d2('0x75')][_0x43d2('0x76')]===_0x43d2('0x77')&&!_0xd3cbe3&&!_0x337114[_0x43d2('0x37')][_0x43d2('0x63')])return[];return db['sequelize'][_0x43d2('0x37')](_0x3ce283['toString'](),_0x8611b8);})[_0x43d2('0x27')](function(_0x187a4c){_0x43e556[_0x43d2('0x20')]=_0x187a4c[_0x43d2('0x2f')];if(_0x43e556['count']===0x0)return[];return db['sequelize'][_0x43d2('0x37')](_0x51750c['toString'](),_0x8611b8)[_0x43d2('0x27')](function(_0x43452b){_0x5bec5b=_[_0x43d2('0x7b')](_0x43452b,'id');_0x8611b8=_[_0x43d2('0x7c')](_0x8611b8,{'model':db[_0x43d2('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x337114['query']['fields']){_0x5ddb10['attributes'][_0x43d2('0x51')](function(_0x187245){_0x4dba54[_0x43d2('0x40')]('c.'+_0x187245);});}else{_0x4dba54[_0x43d2('0x40')](_0x43d2('0x70'));_0x4dba54['field'](_0x43d2('0x7d'));_0x4dba54['field'](_0x43d2('0x7e'));_0x4dba54[_0x43d2('0x40')](_0x43d2('0x7f'));_0x4dba54[_0x43d2('0x40')](_0x43d2('0x80'));_0x4dba54['field'](_0x43d2('0x81'));_0x4dba54[_0x43d2('0x40')](_0x43d2('0x82'));_0x4dba54['field'](_0x43d2('0x83'));_0x4dba54[_0x43d2('0x40')](_0x43d2('0x84'));_0x4dba54['field'](_0x43d2('0x85'));_0x4dba54[_0x43d2('0x40')](_0x43d2('0x86'));_0x4dba54[_0x43d2('0x40')](_0x43d2('0x87'),_0x43d2('0x88'));}if(_0x5ddb10['limit'])_0x4dba54['limit'](_0x5ddb10[_0x43d2('0x1f')]);if(_0x5ddb10['offset'])_0x4dba54[_0x43d2('0x1d')](_0x5ddb10[_0x43d2('0x1d')]);return db[_0x43d2('0x89')]['query'](_0x4dba54[_0x43d2('0x8a')](),_0x8611b8);});})[_0x43d2('0x27')](function(_0x17272c){_0x17272c[_0x43d2('0x51')](function(_0x59eb80){if(_0x59eb80['TagIds']){_0x59eb80[_0x43d2('0x8b')]=[];_0x59eb80[_0x43d2('0x88')][_0x43d2('0x50')](',')[_0x43d2('0x51')](function(_0x157097){_0x59eb80['Tags'][_0x43d2('0x61')](_0x5bec5b[_0x157097]);});}delete _0x59eb80[_0x43d2('0x88')];});_0x43e556['rows']=_0x17272c;return _0x43e556;})[_0x43d2('0x27')](respondWithFilteredResult(_0x4aa22d,_0x5ddb10));})[_0x43d2('0x8c')](handleError(_0x4aa22d,null));};exports[_0x43d2('0x26')]=function(_0x517baf,_0x54f0d6){return db[_0x43d2('0x2c')][_0x43d2('0x8d')]({'where':{'id':_0x517baf[_0x43d2('0x8e')]['id']}})[_0x43d2('0x27')](handleEntityNotFound(_0x54f0d6,null))[_0x43d2('0x27')](removeEntity(_0x54f0d6,null))[_0x43d2('0x8c')](handleError(_0x54f0d6,null));};exports[_0x43d2('0x2d')]=function(_0x361d4b,_0x4ca836){return db[_0x43d2('0x2c')][_0x43d2('0x2d')]()[_0x43d2('0x27')](function(_0x27f3b1){delete _0x27f3b1[_0x43d2('0x8f')];for(var _0x56d61d=0x0;_0x56d61d{}\s\\|]/g,'-');_0x53eea1(null,util[_0xdf59('0x24')](_0xdf59('0x25'),path[_0xdf59('0x26')](_0x4c9952[_0xdf59('0x22')],path[_0xdf59('0x27')](_0x4c9952['originalname'])),Date[_0xdf59('0x28')](),path[_0xdf59('0x27')](_0x4c9952[_0xdf59('0x22')])));}})});router[_0xdf59('0x1a')]('/csv',upload['single']('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0xdf59('0x1e')]({'destination':function(_0x4eb362,_0x48c46a,_0x23e924){_0x23e924(null,path[_0xdf59('0x1f')](config[_0xdf59('0x20')],'server/files/tmp'));},'filename':function(_0x3fcb22,_0x4eb427,_0x467bed){_0x4eb427[_0xdf59('0x22')]=_0x4eb427[_0xdf59('0x22')][_0xdf59('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x467bed(null,util[_0xdf59('0x24')](_0xdf59('0x25'),path['basename'](_0x4eb427[_0xdf59('0x22')],path['extname'](_0x4eb427[_0xdf59('0x22')])),Date[_0xdf59('0x28')](),path['extname'](_0x4eb427['originalname'])));}})});router['post']('/upload',upload[_0xdf59('0x29')](_0xdf59('0x2a')),controller[_0xdf59('0x2b')]);router[_0xdf59('0x1a')](_0xdf59('0x2c'),auth[_0xdf59('0xc')](),controller[_0xdf59('0x2d')]);router[_0xdf59('0x2e')]('/:id',auth[_0xdf59('0xc')](),controller['update']);router[_0xdf59('0x2f')]('/:id',auth[_0xdf59('0xc')](),controller['destroy']);module[_0xdf59('0x30')]=router; \ No newline at end of file +var _0x3823=['update','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','/merge','merge','create','/create_many','bulkCreate','/:id/tags','setTags','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','uploadCsv','diskStorage','join','/upload','post','/upload/:id','import','put'];(function(_0x83415,_0x2d4a51){var _0x48d09c=function(_0x1b5a95){while(--_0x1b5a95){_0x83415['push'](_0x83415['shift']());}};_0x48d09c(++_0x2d4a51);}(_0x3823,0x1e1));var _0x3382=function(_0x51db20,_0x5a355e){_0x51db20=_0x51db20-0x0;var _0x310abe=_0x3823[_0x51db20];return _0x310abe;};'use strict';var multer=require('multer');var util=require(_0x3382('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3382('0x1')]();var fs_extra=require(_0x3382('0x2'));var auth=require(_0x3382('0x3'));var interaction=require(_0x3382('0x4'));var config=require(_0x3382('0x5'));var controller=require(_0x3382('0x6'));router[_0x3382('0x7')]('/',auth[_0x3382('0x8')](),controller[_0x3382('0x9')]);router[_0x3382('0x7')](_0x3382('0xa'),auth[_0x3382('0x8')](),controller[_0x3382('0xb')]);router[_0x3382('0x7')](_0x3382('0xc'),auth[_0x3382('0x8')](),controller[_0x3382('0xd')]);router[_0x3382('0x7')]('/:id/tags',auth[_0x3382('0x8')](),controller[_0x3382('0xe')]);router[_0x3382('0x7')](_0x3382('0xf'),auth[_0x3382('0x8')](),controller[_0x3382('0x10')]);router[_0x3382('0x7')](_0x3382('0x11'),auth['isAuthenticated'](),controller[_0x3382('0x12')]);router[_0x3382('0x7')](_0x3382('0x13'),auth[_0x3382('0x8')](),controller[_0x3382('0x14')]);router[_0x3382('0x7')]('/:id/jscripty_sessions',auth[_0x3382('0x8')](),controller[_0x3382('0x15')]);router[_0x3382('0x7')]('/:id/journey',auth[_0x3382('0x8')](),controller['getJourney']);router['post'](_0x3382('0x16'),auth[_0x3382('0x8')](),controller[_0x3382('0x17')]);router['post']('/',auth[_0x3382('0x8')](),controller[_0x3382('0x18')]);router['post'](_0x3382('0x19'),auth[_0x3382('0x8')](),controller[_0x3382('0x1a')]);router['post'](_0x3382('0x1b'),auth[_0x3382('0x8')](),controller[_0x3382('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4a7204,_0x236352,_0x3e2634){_0x3e2634(null,path['join'](config[_0x3382('0x1d')],_0x3382('0x1e')));},'filename':function(_0xdf6427,_0x389a77,_0x532a2f){_0x389a77['originalname']=_0x389a77[_0x3382('0x1f')][_0x3382('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x532a2f(null,util[_0x3382('0x21')](_0x3382('0x22'),path[_0x3382('0x23')](_0x389a77[_0x3382('0x1f')],path[_0x3382('0x24')](_0x389a77['originalname'])),Date[_0x3382('0x25')](),path[_0x3382('0x24')](_0x389a77[_0x3382('0x1f')])));}})});router['post'](_0x3382('0x26'),upload[_0x3382('0x27')](_0x3382('0x28')),controller[_0x3382('0x29')]);var upload=multer({'storage':multer[_0x3382('0x2a')]({'destination':function(_0x3d1a23,_0x172810,_0x2af609){_0x2af609(null,path[_0x3382('0x2b')](config[_0x3382('0x1d')],_0x3382('0x1e')));},'filename':function(_0x59f34c,_0x14ea16,_0x216505){_0x14ea16[_0x3382('0x1f')]=_0x14ea16['originalname'][_0x3382('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x216505(null,util[_0x3382('0x21')](_0x3382('0x22'),path[_0x3382('0x23')](_0x14ea16['originalname'],path['extname'](_0x14ea16['originalname'])),Date[_0x3382('0x25')](),path[_0x3382('0x24')](_0x14ea16[_0x3382('0x1f')])));}})});router['post'](_0x3382('0x2c'),upload[_0x3382('0x27')](_0x3382('0x28')),controller['upload']);router[_0x3382('0x2d')](_0x3382('0x2e'),auth['isAuthenticated'](),controller[_0x3382('0x2f')]);router[_0x3382('0x30')](_0x3382('0xc'),auth[_0x3382('0x8')](),controller[_0x3382('0x31')]);router[_0x3382('0x32')](_0x3382('0xc'),auth[_0x3382('0x8')](),controller[_0x3382('0x33')]);module[_0x3382('0x34')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 6effe92..7747136 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 _0x5122=['lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','type','select','parse','values','stringify','BOOLEAN','voice','sequelize'];(function(_0x493e9b,_0x31877f){var _0x55027f=function(_0x138aa5){while(--_0x138aa5){_0x493e9b['push'](_0x493e9b['shift']());}};_0x55027f(++_0x31877f);}(_0x5122,0x14f));var _0x2512=function(_0x4bb1b3,_0x446a44){_0x4bb1b3=_0x4bb1b3-0x0;var _0x6b3651=_0x5122[_0x4bb1b3];return _0x6b3651;};'use strict';var Sequelize=require(_0x2512('0x0'));var _=require(_0x2512('0x1'));module['exports']={'name':{'type':Sequelize[_0x2512('0x2')],'get':function(_0x164946){return this[_0x2512('0x3')](_0x2512('0x4'));}},'alias':{'type':Sequelize[_0x2512('0x5')],'allowNull':![],'set':function(_0x490884){this[_0x2512('0x6')]('alias',_0x490884?_0x490884:this[_0x2512('0x3')]('name'));}},'type':{'type':Sequelize[_0x2512('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x2512('0x7')](_0x2512('0x8')),'get':function(){if(this['getDataValue'](_0x2512('0x9'))===_0x2512('0xa')){return JSON[_0x2512('0xb')](this[_0x2512('0x3')](_0x2512('0xc')));}else{return this['getDataValue'](_0x2512('0xc'));}},'set':function(_0x50343b){if(Array['isArray'](_0x50343b)){this['setDataValue'](_0x2512('0xc'),JSON[_0x2512('0xd')](_0x50343b));}else{this[_0x2512('0x6')]('values',_0x50343b);}}},'required':{'type':Sequelize[_0x2512('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x2512('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x2512('0xf'))}}; \ No newline at end of file +var _0xac65=['VIRTUAL','getDataValue','alias','name','TEXT','long','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','exports'];(function(_0x29fb88,_0xb6d9f2){var _0x2b9dd7=function(_0x2e76fe){while(--_0x2e76fe){_0x29fb88['push'](_0x29fb88['shift']());}};_0x2b9dd7(++_0xb6d9f2);}(_0xac65,0xa3));var _0x5ac6=function(_0x4f687f,_0x2a28d4){_0x4f687f=_0x4f687f-0x0;var _0xa3371c=_0xac65[_0x4f687f];return _0xa3371c;};'use strict';var Sequelize=require(_0x5ac6('0x0'));var _=require('lodash');module[_0x5ac6('0x1')]={'name':{'type':Sequelize[_0x5ac6('0x2')],'get':function(_0x2422f6){return this[_0x5ac6('0x3')](_0x5ac6('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3a124f){this['setDataValue'](_0x5ac6('0x4'),_0x3a124f?_0x3a124f:this[_0x5ac6('0x3')](_0x5ac6('0x5')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x5ac6('0x6')](_0x5ac6('0x7')),'get':function(){if(this[_0x5ac6('0x3')]('type')==='select'){return JSON['parse'](this['getDataValue'](_0x5ac6('0x8')));}else{return this[_0x5ac6('0x3')](_0x5ac6('0x8'));}},'set':function(_0x1a0c69){if(Array[_0x5ac6('0x9')](_0x1a0c69)){this[_0x5ac6('0xa')](_0x5ac6('0x8'),JSON[_0x5ac6('0xb')](_0x1a0c69));}else{this[_0x5ac6('0xa')](_0x5ac6('0x8'),_0x1a0c69);}}},'required':{'type':Sequelize[_0x5ac6('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x5ac6('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x5ac6('0xd')](_0x5ac6('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 7d78643..4ed553f 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 _0x1a8a=['fieldName','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','catch','show','params','length','find','body','create','sequelize','transaction','TEXT','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmCustomField','rawAttributes'];(function(_0x567ef4,_0x10a870){var _0x481cd6=function(_0x1c8cf8){while(--_0x1c8cf8){_0x567ef4['push'](_0x567ef4['shift']());}};_0x481cd6(++_0x10a870);}(_0x1a8a,0x191));var _0xa1a8=function(_0x277607,_0x345a06){_0x277607=_0x277607-0x0;var _0x15fe23=_0x1a8a[_0x277607];return _0x15fe23;};'use strict';var emlformat=require(_0xa1a8('0x0'));var rimraf=require(_0xa1a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1a8('0x2'));var rp=require('request-promise');var moment=require(_0xa1a8('0x3'));var BPromise=require(_0xa1a8('0x4'));var Mustache=require(_0xa1a8('0x5'));var util=require(_0xa1a8('0x6'));var path=require(_0xa1a8('0x7'));var sox=require(_0xa1a8('0x8'));var csv=require(_0xa1a8('0x9'));var ejs=require(_0xa1a8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa1a8('0xb'));var jsforce=require(_0xa1a8('0xc'));var deskjs=require(_0xa1a8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa1a8('0xe'));var Papa=require(_0xa1a8('0xf'));var Redis=require(_0xa1a8('0x10'));var authService=require(_0xa1a8('0x11'));var qs=require(_0xa1a8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1a8('0x13'));var logger=require(_0xa1a8('0x14'))(_0xa1a8('0x15'));var utils=require(_0xa1a8('0x16'));var config=require(_0xa1a8('0x17'));var licenseUtil=require(_0xa1a8('0x18'));var db=require(_0xa1a8('0x19'))['db'];function respondWithStatusCode(_0x185692,_0x4f2fe1){_0x4f2fe1=_0x4f2fe1||0xcc;return function(_0x2c350b){if(_0x2c350b){return _0x185692[_0xa1a8('0x1a')](_0x4f2fe1);}return _0x185692[_0xa1a8('0x1b')](_0x4f2fe1)[_0xa1a8('0x1c')]();};}function respondWithResult(_0x1b5991,_0xe9aa6e){_0xe9aa6e=_0xe9aa6e||0xc8;return function(_0x341a0a){if(_0x341a0a){return _0x1b5991[_0xa1a8('0x1b')](_0xe9aa6e)[_0xa1a8('0x1d')](_0x341a0a);}};}function respondWithFilteredResult(_0x3cad46,_0x131691){return function(_0x12be5a){if(_0x12be5a){var _0x29bf64=typeof _0x131691[_0xa1a8('0x1e')]===_0xa1a8('0x1f')&&typeof _0x131691[_0xa1a8('0x20')]===_0xa1a8('0x1f');var _0x1db174=_0x12be5a[_0xa1a8('0x21')];var _0x5009cc=_0x29bf64?0x0:_0x131691[_0xa1a8('0x1e')];var _0x5b26b1=_0x29bf64?_0x12be5a[_0xa1a8('0x21')]:_0x131691[_0xa1a8('0x1e')]+_0x131691[_0xa1a8('0x20')];var _0x1b181f;if(_0x5b26b1>=_0x1db174){_0x5b26b1=_0x1db174;_0x1b181f=0xc8;}else{_0x1b181f=0xce;}_0x3cad46[_0xa1a8('0x1b')](_0x1b181f);return _0x3cad46[_0xa1a8('0x22')](_0xa1a8('0x23'),_0x5009cc+'-'+_0x5b26b1+'/'+_0x1db174)['json'](_0x12be5a);}return null;};}function patchUpdates(_0x193484){return function(_0x45a6b6){try{jsonpatch[_0xa1a8('0x24')](_0x45a6b6,_0x193484,!![]);}catch(_0x53f4c7){return BPromise[_0xa1a8('0x25')](_0x53f4c7);}return _0x45a6b6[_0xa1a8('0x26')]();};}function saveUpdates(_0x4e983a,_0x1eb753){return function(_0x5094d6){if(_0x5094d6){return _0x5094d6[_0xa1a8('0x27')](_0x4e983a)[_0xa1a8('0x28')](function(_0x36facb){return _0x36facb;});}return null;};}function removeEntity(_0x32d0d9,_0x25bd69){return function(_0x2e7380){if(_0x2e7380){return _0x2e7380[_0xa1a8('0x29')]()[_0xa1a8('0x28')](function(){_0x32d0d9[_0xa1a8('0x1b')](0xcc)[_0xa1a8('0x1c')]();});}};}function handleEntityNotFound(_0xa406,_0x31e33c){return function(_0x2e9770){if(!_0x2e9770){_0xa406['sendStatus'](0x194);}return _0x2e9770;};}function handleError(_0x41083c,_0x76fe32){_0x76fe32=_0x76fe32||0x1f4;return function(_0x13c817){logger['error'](_0x13c817[_0xa1a8('0x2a')]);if(_0x13c817[_0xa1a8('0x2b')]){delete _0x13c817[_0xa1a8('0x2b')];}_0x41083c[_0xa1a8('0x1b')](_0x76fe32)[_0xa1a8('0x2c')](_0x13c817);};}exports[_0xa1a8('0x2d')]=function(_0x1c0e6b,_0x38aa4d){var _0x54c43d={},_0x5ccdf6={},_0x3175d5={'count':0x0,'rows':[]};var _0x1023c3=_[_0xa1a8('0x2e')](db[_0xa1a8('0x2f')][_0xa1a8('0x30')],function(_0x5bd15a){return{'name':_0x5bd15a[_0xa1a8('0x31')],'type':_0x5bd15a[_0xa1a8('0x32')][_0xa1a8('0x33')]};});_0x5ccdf6[_0xa1a8('0x34')]=_[_0xa1a8('0x35')](_['map'](_0x1023c3,_0xa1a8('0x2b')),[_0xa1a8('0x2b')]);_0x5ccdf6[_0xa1a8('0x36')]=_[_0xa1a8('0x37')](_0x1c0e6b[_0xa1a8('0x36')]);_0x5ccdf6[_0xa1a8('0x38')]=_['intersection'](_0x5ccdf6[_0xa1a8('0x34')],_0x5ccdf6[_0xa1a8('0x36')]);_0x54c43d[_0xa1a8('0x39')]=_[_0xa1a8('0x3a')](_0x5ccdf6[_0xa1a8('0x34')],qs[_0xa1a8('0x3b')](_0x1c0e6b[_0xa1a8('0x36')][_0xa1a8('0x3b')]));_0x54c43d[_0xa1a8('0x39')]=_0x54c43d[_0xa1a8('0x39')]['length']?_0x54c43d[_0xa1a8('0x39')]:_0x5ccdf6['model'];if(!_0x1c0e6b['query'][_0xa1a8('0x3c')](_0xa1a8('0x3d'))){_0x54c43d[_0xa1a8('0x20')]=qs[_0xa1a8('0x20')](_0x1c0e6b['query']['limit']);_0x54c43d[_0xa1a8('0x1e')]=qs[_0xa1a8('0x1e')](_0x1c0e6b[_0xa1a8('0x36')][_0xa1a8('0x1e')]);}_0x54c43d[_0xa1a8('0x3e')]=qs[_0xa1a8('0x3f')](_0x1c0e6b[_0xa1a8('0x36')]['sort']);_0x54c43d[_0xa1a8('0x40')]=qs[_0xa1a8('0x38')](_[_0xa1a8('0x41')](_0x1c0e6b[_0xa1a8('0x36')],_0x5ccdf6[_0xa1a8('0x38')]),_0x1023c3);if(_0x1c0e6b[_0xa1a8('0x36')][_0xa1a8('0x42')]){_0x54c43d[_0xa1a8('0x40')]=_['merge'](_0x54c43d[_0xa1a8('0x40')],{'$or':_['map'](_0x1023c3,function(_0x5273a3){if(_0x5273a3[_0xa1a8('0x32')]!==_0xa1a8('0x43')){var _0x442b02={};_0x442b02[_0x5273a3['name']]={'$like':'%'+_0x1c0e6b['query']['filter']+'%'};return _0x442b02;}})});}_0x54c43d=_['merge']({},_0x54c43d,_0x1c0e6b['options']);var _0x31f33c={'where':_0x54c43d[_0xa1a8('0x40')]};return db['CmCustomField']['count'](_0x31f33c)[_0xa1a8('0x28')](function(_0x13e22c){_0x3175d5[_0xa1a8('0x21')]=_0x13e22c;if(_0x1c0e6b['query'][_0xa1a8('0x44')]){_0x54c43d[_0xa1a8('0x45')]=[{'all':!![]}];}return db[_0xa1a8('0x2f')][_0xa1a8('0x46')](_0x54c43d);})[_0xa1a8('0x28')](function(_0x53f630){_0x3175d5['rows']=_0x53f630;return _0x3175d5;})['then'](respondWithFilteredResult(_0x38aa4d,_0x54c43d))[_0xa1a8('0x47')](handleError(_0x38aa4d,null));};exports[_0xa1a8('0x48')]=function(_0x38debb,_0x5ede2c){var _0x818ba8={'raw':!![],'where':{'id':_0x38debb[_0xa1a8('0x49')]['id']}},_0x7cb18e={};_0x7cb18e[_0xa1a8('0x34')]=_[_0xa1a8('0x37')](db[_0xa1a8('0x2f')][_0xa1a8('0x30')]);_0x7cb18e[_0xa1a8('0x36')]=_['keys'](_0x38debb[_0xa1a8('0x36')]);_0x7cb18e['filters']=_[_0xa1a8('0x3a')](_0x7cb18e[_0xa1a8('0x34')],_0x7cb18e['query']);_0x818ba8[_0xa1a8('0x39')]=_[_0xa1a8('0x3a')](_0x7cb18e[_0xa1a8('0x34')],qs['fields'](_0x38debb[_0xa1a8('0x36')][_0xa1a8('0x3b')]));_0x818ba8[_0xa1a8('0x39')]=_0x818ba8['attributes'][_0xa1a8('0x4a')]?_0x818ba8['attributes']:_0x7cb18e[_0xa1a8('0x34')];if(_0x38debb[_0xa1a8('0x36')][_0xa1a8('0x44')]){_0x818ba8['include']=[{'all':!![]}];}_0x818ba8=_['merge']({},_0x818ba8,_0x38debb['options']);return db[_0xa1a8('0x2f')][_0xa1a8('0x4b')](_0x818ba8)[_0xa1a8('0x28')](handleEntityNotFound(_0x5ede2c,null))[_0xa1a8('0x28')](respondWithResult(_0x5ede2c,null))[_0xa1a8('0x47')](handleError(_0x5ede2c,null));};exports[_0xa1a8('0x27')]=function(_0x3310c2,_0x358689){if(_0x3310c2[_0xa1a8('0x4c')]['id']){delete _0x3310c2[_0xa1a8('0x4c')]['id'];}return db[_0xa1a8('0x2f')]['find']({'where':{'id':_0x3310c2[_0xa1a8('0x49')]['id']}})[_0xa1a8('0x28')](handleEntityNotFound(_0x358689,null))['then'](saveUpdates(_0x3310c2[_0xa1a8('0x4c')],null))[_0xa1a8('0x28')](respondWithResult(_0x358689,null))[_0xa1a8('0x47')](handleError(_0x358689,null));};exports[_0xa1a8('0x29')]=function(_0x4693f7,_0x4390f2){return db[_0xa1a8('0x2f')]['find']({'where':{'id':_0x4693f7['params']['id']}})[_0xa1a8('0x28')](handleEntityNotFound(_0x4390f2,null))['then'](removeEntity(_0x4390f2,null))[_0xa1a8('0x47')](handleError(_0x4390f2,null));};exports[_0xa1a8('0x4d')]=function(_0x27acf4,_0x2dc5e9){var _0x19f8b8;return db[_0xa1a8('0x4e')][_0xa1a8('0x4f')](function(_0x5b9625){return db['CmCustomField'][_0xa1a8('0x4d')](_0x27acf4[_0xa1a8('0x4c')],{'transaction':_0x5b9625})[_0xa1a8('0x28')](function(_0x2f55c2){_0x19f8b8=_0x2f55c2;var _0x14a4de={'type':db['Sequelize'][_0xa1a8('0x50')],'transaction':_0x5b9625};switch(_0x27acf4[_0xa1a8('0x4c')][_0xa1a8('0x32')]){case'text':_0x14a4de[_0xa1a8('0x32')]=db['Sequelize'][_0xa1a8('0x50')];break;case'number':_0x14a4de[_0xa1a8('0x32')]=db[_0xa1a8('0x51')][_0xa1a8('0x52')];break;case _0xa1a8('0x53'):_0x14a4de[_0xa1a8('0x32')]=db[_0xa1a8('0x51')][_0xa1a8('0x54')];_0x14a4de[_0xa1a8('0x55')]=![];break;default:}return db[_0xa1a8('0x4e')][_0xa1a8('0x56')][_0xa1a8('0x57')](_0xa1a8('0x58'),util['format'](_0xa1a8('0x59'),_0x19f8b8['id']),_0x14a4de);})[_0xa1a8('0x28')](function(){return _0x19f8b8;});})[_0xa1a8('0x28')](respondWithResult(_0x2dc5e9,0xc9))[_0xa1a8('0x47')](handleError(_0x2dc5e9,null));}; \ No newline at end of file +var _0x97bf=['sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','body','create','sequelize','transaction','TEXT','Sequelize','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../mysqldb','sendStatus','status','end','limit','count','offset','set','json','reject','update','then','destroy','stack','name','send','index','map','CmCustomField','type','key','model','query','intersection','fields','length','attributes','hasOwnProperty','order'];(function(_0x38889b,_0x6cf56b){var _0x4b3c97=function(_0x5acfaf){while(--_0x5acfaf){_0x38889b['push'](_0x38889b['shift']());}};_0x4b3c97(++_0x6cf56b);}(_0x97bf,0x74));var _0xf97b=function(_0x8c1f70,_0x1e3ee7){_0x8c1f70=_0x8c1f70-0x0;var _0x3ac123=_0x97bf[_0x8c1f70];return _0x3ac123;};'use strict';var emlformat=require(_0xf97b('0x0'));var rimraf=require(_0xf97b('0x1'));var zipdir=require(_0xf97b('0x2'));var jsonpatch=require(_0xf97b('0x3'));var rp=require(_0xf97b('0x4'));var moment=require(_0xf97b('0x5'));var BPromise=require(_0xf97b('0x6'));var Mustache=require(_0xf97b('0x7'));var util=require(_0xf97b('0x8'));var path=require(_0xf97b('0x9'));var sox=require(_0xf97b('0xa'));var csv=require(_0xf97b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf97b('0xc'));var _=require('lodash');var squel=require(_0xf97b('0xd'));var crypto=require(_0xf97b('0xe'));var jsforce=require(_0xf97b('0xf'));var deskjs=require(_0xf97b('0x10'));var toCsv=require(_0xf97b('0xb'));var querystring=require(_0xf97b('0x11'));var Papa=require(_0xf97b('0x12'));var Redis=require(_0xf97b('0x13'));var authService=require(_0xf97b('0x14'));var qs=require(_0xf97b('0x15'));var as=require(_0xf97b('0x16'));var hardwareService=require(_0xf97b('0x17'));var logger=require(_0xf97b('0x18'))(_0xf97b('0x19'));var utils=require(_0xf97b('0x1a'));var config=require(_0xf97b('0x1b'));var licenseUtil=require(_0xf97b('0x1c'));var db=require(_0xf97b('0x1d'))['db'];function respondWithStatusCode(_0x398c97,_0xb932b6){_0xb932b6=_0xb932b6||0xcc;return function(_0x5c7f5b){if(_0x5c7f5b){return _0x398c97[_0xf97b('0x1e')](_0xb932b6);}return _0x398c97[_0xf97b('0x1f')](_0xb932b6)[_0xf97b('0x20')]();};}function respondWithResult(_0x52392e,_0x18a301){_0x18a301=_0x18a301||0xc8;return function(_0x5b9af9){if(_0x5b9af9){return _0x52392e['status'](_0x18a301)['json'](_0x5b9af9);}};}function respondWithFilteredResult(_0x336117,_0x339898){return function(_0x2617a1){if(_0x2617a1){var _0x193e01=typeof _0x339898['offset']==='undefined'&&typeof _0x339898[_0xf97b('0x21')]==='undefined';var _0x158992=_0x2617a1[_0xf97b('0x22')];var _0xab5eca=_0x193e01?0x0:_0x339898[_0xf97b('0x23')];var _0x7b3500=_0x193e01?_0x2617a1[_0xf97b('0x22')]:_0x339898['offset']+_0x339898[_0xf97b('0x21')];var _0x22c990;if(_0x7b3500>=_0x158992){_0x7b3500=_0x158992;_0x22c990=0xc8;}else{_0x22c990=0xce;}_0x336117['status'](_0x22c990);return _0x336117[_0xf97b('0x24')]('Content-Range',_0xab5eca+'-'+_0x7b3500+'/'+_0x158992)[_0xf97b('0x25')](_0x2617a1);}return null;};}function patchUpdates(_0x3a401c){return function(_0x3586ba){try{jsonpatch['apply'](_0x3586ba,_0x3a401c,!![]);}catch(_0x2ee6ff){return BPromise[_0xf97b('0x26')](_0x2ee6ff);}return _0x3586ba['save']();};}function saveUpdates(_0x483bc6,_0x4d675b){return function(_0x43affe){if(_0x43affe){return _0x43affe[_0xf97b('0x27')](_0x483bc6)[_0xf97b('0x28')](function(_0x560771){return _0x560771;});}return null;};}function removeEntity(_0x256474,_0x5a6c01){return function(_0x160d86){if(_0x160d86){return _0x160d86[_0xf97b('0x29')]()[_0xf97b('0x28')](function(){_0x256474[_0xf97b('0x1f')](0xcc)[_0xf97b('0x20')]();});}};}function handleEntityNotFound(_0x43023d,_0x5ce5a9){return function(_0x538b5a){if(!_0x538b5a){_0x43023d['sendStatus'](0x194);}return _0x538b5a;};}function handleError(_0x1ac73b,_0x199a86){_0x199a86=_0x199a86||0x1f4;return function(_0x595b41){logger['error'](_0x595b41[_0xf97b('0x2a')]);if(_0x595b41[_0xf97b('0x2b')]){delete _0x595b41[_0xf97b('0x2b')];}_0x1ac73b[_0xf97b('0x1f')](_0x199a86)[_0xf97b('0x2c')](_0x595b41);};}exports[_0xf97b('0x2d')]=function(_0x53d6e0,_0x3e99fb){var _0x286b03={},_0x4a9183={},_0x9cc1bc={'count':0x0,'rows':[]};var _0x2549a0=_[_0xf97b('0x2e')](db[_0xf97b('0x2f')]['rawAttributes'],function(_0x54a118){return{'name':_0x54a118['fieldName'],'type':_0x54a118[_0xf97b('0x30')][_0xf97b('0x31')]};});_0x4a9183[_0xf97b('0x32')]=_['differenceBy'](_[_0xf97b('0x2e')](_0x2549a0,_0xf97b('0x2b')),[_0xf97b('0x2b')]);_0x4a9183['query']=_['keys'](_0x53d6e0[_0xf97b('0x33')]);_0x4a9183['filters']=_[_0xf97b('0x34')](_0x4a9183[_0xf97b('0x32')],_0x4a9183[_0xf97b('0x33')]);_0x286b03['attributes']=_[_0xf97b('0x34')](_0x4a9183['model'],qs[_0xf97b('0x35')](_0x53d6e0['query'][_0xf97b('0x35')]));_0x286b03['attributes']=_0x286b03['attributes'][_0xf97b('0x36')]?_0x286b03[_0xf97b('0x37')]:_0x4a9183[_0xf97b('0x32')];if(!_0x53d6e0[_0xf97b('0x33')][_0xf97b('0x38')]('nolimit')){_0x286b03['limit']=qs[_0xf97b('0x21')](_0x53d6e0[_0xf97b('0x33')][_0xf97b('0x21')]);_0x286b03[_0xf97b('0x23')]=qs[_0xf97b('0x23')](_0x53d6e0['query'][_0xf97b('0x23')]);}_0x286b03[_0xf97b('0x39')]=qs[_0xf97b('0x3a')](_0x53d6e0['query'][_0xf97b('0x3a')]);_0x286b03[_0xf97b('0x3b')]=qs[_0xf97b('0x3c')](_[_0xf97b('0x3d')](_0x53d6e0[_0xf97b('0x33')],_0x4a9183[_0xf97b('0x3c')]),_0x2549a0);if(_0x53d6e0[_0xf97b('0x33')][_0xf97b('0x3e')]){_0x286b03[_0xf97b('0x3b')]=_[_0xf97b('0x3f')](_0x286b03[_0xf97b('0x3b')],{'$or':_[_0xf97b('0x2e')](_0x2549a0,function(_0x3f6ac8){if(_0x3f6ac8[_0xf97b('0x30')]!==_0xf97b('0x40')){var _0x24f887={};_0x24f887[_0x3f6ac8[_0xf97b('0x2b')]]={'$like':'%'+_0x53d6e0[_0xf97b('0x33')][_0xf97b('0x3e')]+'%'};return _0x24f887;}})});}_0x286b03=_[_0xf97b('0x3f')]({},_0x286b03,_0x53d6e0['options']);var _0x317ce9={'where':_0x286b03[_0xf97b('0x3b')]};return db[_0xf97b('0x2f')][_0xf97b('0x22')](_0x317ce9)[_0xf97b('0x28')](function(_0x3fc15a){_0x9cc1bc[_0xf97b('0x22')]=_0x3fc15a;if(_0x53d6e0[_0xf97b('0x33')][_0xf97b('0x41')]){_0x286b03[_0xf97b('0x42')]=[{'all':!![]}];}return db['CmCustomField'][_0xf97b('0x43')](_0x286b03);})[_0xf97b('0x28')](function(_0x215e7b){_0x9cc1bc[_0xf97b('0x44')]=_0x215e7b;return _0x9cc1bc;})['then'](respondWithFilteredResult(_0x3e99fb,_0x286b03))[_0xf97b('0x45')](handleError(_0x3e99fb,null));};exports['show']=function(_0x3ee74a,_0x374b38){var _0x39b31a={'raw':!![],'where':{'id':_0x3ee74a[_0xf97b('0x46')]['id']}},_0x47a552={};_0x47a552[_0xf97b('0x32')]=_[_0xf97b('0x47')](db[_0xf97b('0x2f')]['rawAttributes']);_0x47a552[_0xf97b('0x33')]=_[_0xf97b('0x47')](_0x3ee74a['query']);_0x47a552[_0xf97b('0x3c')]=_['intersection'](_0x47a552[_0xf97b('0x32')],_0x47a552['query']);_0x39b31a[_0xf97b('0x37')]=_[_0xf97b('0x34')](_0x47a552[_0xf97b('0x32')],qs[_0xf97b('0x35')](_0x3ee74a[_0xf97b('0x33')][_0xf97b('0x35')]));_0x39b31a[_0xf97b('0x37')]=_0x39b31a[_0xf97b('0x37')][_0xf97b('0x36')]?_0x39b31a[_0xf97b('0x37')]:_0x47a552['model'];if(_0x3ee74a[_0xf97b('0x33')]['includeAll']){_0x39b31a[_0xf97b('0x42')]=[{'all':!![]}];}_0x39b31a=_[_0xf97b('0x3f')]({},_0x39b31a,_0x3ee74a[_0xf97b('0x48')]);return db[_0xf97b('0x2f')][_0xf97b('0x49')](_0x39b31a)[_0xf97b('0x28')](handleEntityNotFound(_0x374b38,null))[_0xf97b('0x28')](respondWithResult(_0x374b38,null))[_0xf97b('0x45')](handleError(_0x374b38,null));};exports[_0xf97b('0x27')]=function(_0x2564f2,_0x2b897a){if(_0x2564f2[_0xf97b('0x4a')]['id']){delete _0x2564f2[_0xf97b('0x4a')]['id'];}return db[_0xf97b('0x2f')][_0xf97b('0x49')]({'where':{'id':_0x2564f2['params']['id']}})[_0xf97b('0x28')](handleEntityNotFound(_0x2b897a,null))[_0xf97b('0x28')](saveUpdates(_0x2564f2['body'],null))[_0xf97b('0x28')](respondWithResult(_0x2b897a,null))[_0xf97b('0x45')](handleError(_0x2b897a,null));};exports[_0xf97b('0x29')]=function(_0x4528bf,_0x43399e){return db[_0xf97b('0x2f')][_0xf97b('0x49')]({'where':{'id':_0x4528bf[_0xf97b('0x46')]['id']}})['then'](handleEntityNotFound(_0x43399e,null))[_0xf97b('0x28')](removeEntity(_0x43399e,null))[_0xf97b('0x45')](handleError(_0x43399e,null));};exports[_0xf97b('0x4b')]=function(_0x2dfd57,_0x2aaca1){var _0x1d31ca;return db[_0xf97b('0x4c')][_0xf97b('0x4d')](function(_0x2c1871){return db[_0xf97b('0x2f')][_0xf97b('0x4b')](_0x2dfd57['body'],{'transaction':_0x2c1871})[_0xf97b('0x28')](function(_0x3a6b83){_0x1d31ca=_0x3a6b83;var _0x514c61={'type':db['Sequelize'][_0xf97b('0x4e')],'transaction':_0x2c1871};switch(_0x2dfd57[_0xf97b('0x4a')][_0xf97b('0x30')]){case'text':_0x514c61[_0xf97b('0x30')]=db[_0xf97b('0x4f')]['TEXT'];break;case'number':_0x514c61[_0xf97b('0x30')]=db['Sequelize'][_0xf97b('0x50')];break;case _0xf97b('0x51'):_0x514c61[_0xf97b('0x30')]=db[_0xf97b('0x4f')]['BOOLEAN'];_0x514c61[_0xf97b('0x52')]=![];break;default:}return db[_0xf97b('0x4c')][_0xf97b('0x53')][_0xf97b('0x54')](_0xf97b('0x55'),util[_0xf97b('0x56')]('cf_%d',_0x1d31ca['id']),_0x514c61);})['then'](function(){return _0x1d31ca;});})[_0xf97b('0x28')](respondWithResult(_0x2aaca1,0xc9))[_0xf97b('0x45')](handleError(_0x2aaca1,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index fdeaec5..cadeb87 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 _0x63a6=['moment','bluebird','path','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','util','../../config/logger','api'];(function(_0x537fd3,_0x120947){var _0x163abe=function(_0x2ed5af){while(--_0x2ed5af){_0x537fd3['push'](_0x537fd3['shift']());}};_0x163abe(++_0x120947);}(_0x63a6,0x173));var _0x663a=function(_0x12a62c,_0xc9c41a){_0x12a62c=_0x12a62c-0x0;var _0x268a58=_0x63a6[_0x12a62c];return _0x268a58;};'use strict';var _=require('lodash');var util=require(_0x663a('0x0'));var logger=require(_0x663a('0x1'))(_0x663a('0x2'));var moment=require(_0x663a('0x3'));var BPromise=require(_0x663a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x663a('0x5'));var rimraf=require('rimraf');var config=require(_0x663a('0x6'));var attributes=require(_0x663a('0x7'));module[_0x663a('0x8')]=function(_0xbf01af,_0x24e107){return _0xbf01af['define'](_0x663a('0x9'),attributes,{'tableName':_0x663a('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ca3=['moment','path','rimraf','../../config/environment','exports','define','CmCustomField','lodash','util','../../config/logger'];(function(_0x47e31c,_0xeef541){var _0x46794f=function(_0x4ee891){while(--_0x4ee891){_0x47e31c['push'](_0x47e31c['shift']());}};_0x46794f(++_0xeef541);}(_0x7ca3,0x115));var _0x37ca=function(_0x83f529,_0x3d55d7){_0x83f529=_0x83f529-0x0;var _0x4383b8=_0x7ca3[_0x83f529];return _0x4383b8;};'use strict';var _=require(_0x37ca('0x0'));var util=require(_0x37ca('0x1'));var logger=require(_0x37ca('0x2'))('api');var moment=require(_0x37ca('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x37ca('0x4'));var rimraf=require(_0x37ca('0x5'));var config=require(_0x37ca('0x6'));var attributes=require('./cmCustomField.attributes');module[_0x37ca('0x7')]=function(_0x187c15,_0xa7872b){return _0x187c15[_0x37ca('0x8')](_0x37ca('0x9'),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 db28e7b..1eb6220 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 _0x9ee3=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','CmCustomField,\x20%s,\x20%s','message','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9ee3,0x109));var _0x39ee=function(_0x366848,_0x160d72){_0x366848=_0x366848-0x0;var _0x19d370=_0x9ee3[_0x366848];return _0x19d370;};'use strict';var _=require('lodash');var util=require(_0x39ee('0x0'));var moment=require(_0x39ee('0x1'));var BPromise=require(_0x39ee('0x2'));var rs=require(_0x39ee('0x3'));var fs=require('fs');var Redis=require(_0x39ee('0x4'));var db=require(_0x39ee('0x5'))['db'];var utils=require(_0x39ee('0x6'));var logger=require(_0x39ee('0x7'))(_0x39ee('0x8'));var config=require(_0x39ee('0x9'));var jayson=require(_0x39ee('0xa'));var client=jayson[_0x39ee('0xb')][_0x39ee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40ada5,_0x2ff428,_0x17a7b8){return new BPromise(function(_0x4c5977,_0x113c46){return client['request'](_0x40ada5,_0x17a7b8)[_0x39ee('0xd')](function(_0x2a4ca9){logger[_0x39ee('0xe')]('CmCustomField,\x20%s,\x20%s',_0x2ff428,_0x39ee('0xf'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x2ff428,_0x39ee('0xf'),JSON[_0x39ee('0x10')](_0x2a4ca9));if(_0x2a4ca9[_0x39ee('0x11')]){if(_0x2a4ca9[_0x39ee('0x11')]['code']===0x1f4){logger[_0x39ee('0x11')](_0x39ee('0x12'),_0x2ff428,_0x2a4ca9[_0x39ee('0x11')][_0x39ee('0x13')]);return _0x113c46(_0x2a4ca9['error']['message']);}logger[_0x39ee('0x11')]('CmCustomField,\x20%s,\x20%s',_0x2ff428,_0x2a4ca9[_0x39ee('0x11')][_0x39ee('0x13')]);return _0x4c5977(_0x2a4ca9[_0x39ee('0x11')][_0x39ee('0x13')]);}else{logger[_0x39ee('0xe')](_0x39ee('0x12'),_0x2ff428,'request\x20sent');_0x4c5977(_0x2a4ca9[_0x39ee('0x14')][_0x39ee('0x13')]);}})[_0x39ee('0x15')](function(_0x3ef49e){logger[_0x39ee('0x11')](_0x39ee('0x12'),_0x2ff428,_0x3ef49e);_0x113c46(_0x3ef49e);});});} \ No newline at end of file +var _0x1716=['error','code','message','info','catch','lodash','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1d70ed,_0x3e4f0a){var _0x189e62=function(_0x9ee3a2){while(--_0x9ee3a2){_0x1d70ed['push'](_0x1d70ed['shift']());}};_0x189e62(++_0x3e4f0a);}(_0x1716,0x122));var _0x6171=function(_0x22d9a2,_0x528b43){_0x22d9a2=_0x22d9a2-0x0;var _0xd59353=_0x1716[_0x22d9a2];return _0xd59353;};'use strict';var _=require(_0x6171('0x0'));var util=require('util');var moment=require(_0x6171('0x1'));var BPromise=require('bluebird');var rs=require(_0x6171('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6171('0x3'))(_0x6171('0x4'));var config=require(_0x6171('0x5'));var jayson=require(_0x6171('0x6'));var client=jayson['client'][_0x6171('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3bbece,_0x8ff657,_0x51c03c){return new BPromise(function(_0xfe9c9,_0x435f51){return client[_0x6171('0x8')](_0x3bbece,_0x51c03c)[_0x6171('0x9')](function(_0x255b30){logger['info'](_0x6171('0xa'),_0x8ff657,_0x6171('0xb'));logger[_0x6171('0xc')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x8ff657,'request\x20sent',JSON[_0x6171('0xd')](_0x255b30));if(_0x255b30[_0x6171('0xe')]){if(_0x255b30['error'][_0x6171('0xf')]===0x1f4){logger['error'](_0x6171('0xa'),_0x8ff657,_0x255b30[_0x6171('0xe')][_0x6171('0x10')]);return _0x435f51(_0x255b30[_0x6171('0xe')]['message']);}logger[_0x6171('0xe')](_0x6171('0xa'),_0x8ff657,_0x255b30[_0x6171('0xe')][_0x6171('0x10')]);return _0xfe9c9(_0x255b30['error'][_0x6171('0x10')]);}else{logger[_0x6171('0x11')](_0x6171('0xa'),_0x8ff657,_0x6171('0xb'));_0xfe9c9(_0x255b30['result']['message']);}})[_0x6171('0x12')](function(_0x5e5d0b){logger['error'](_0x6171('0xa'),_0x8ff657,_0x5e5d0b);_0x435f51(_0x5e5d0b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 566ac2d..140bc96 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 _0x91e6=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','/:id'];(function(_0x457ef8,_0x1a19ae){var _0x596c56=function(_0x3b3b8f){while(--_0x3b3b8f){_0x457ef8['push'](_0x457ef8['shift']());}};_0x596c56(++_0x1a19ae);}(_0x91e6,0x123));var _0x691e=function(_0x85dd7a,_0x550ca3){_0x85dd7a=_0x85dd7a-0x0;var _0xd803c7=_0x91e6[_0x85dd7a];return _0xd803c7;};'use strict';var multer=require(_0x691e('0x0'));var util=require(_0x691e('0x1'));var path=require(_0x691e('0x2'));var timeout=require(_0x691e('0x3'));var express=require(_0x691e('0x4'));var router=express[_0x691e('0x5')]();var fs_extra=require(_0x691e('0x6'));var auth=require(_0x691e('0x7'));var interaction=require(_0x691e('0x8'));var config=require('../../config/environment');var controller=require(_0x691e('0x9'));router[_0x691e('0xa')]('/',auth[_0x691e('0xb')](),controller['index']);router[_0x691e('0xa')](_0x691e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x691e('0xd')]('/',auth['isAuthenticated'](),controller[_0x691e('0xe')]);router[_0x691e('0xf')](_0x691e('0xc'),auth[_0x691e('0xb')](),controller['update']);router[_0x691e('0x10')](_0x691e('0xc'),auth[_0x691e('0xb')](),controller[_0x691e('0x11')]);module[_0x691e('0x12')]=router; \ No newline at end of file +var _0xaa3f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','util','path'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x429230,_0x5a85ca){_0x429230=_0x429230-0x0;var _0x330b27=_0xaa3f[_0x429230];return _0x330b27;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var fs_extra=require(_0xfaa3('0x6'));var auth=require(_0xfaa3('0x7'));var interaction=require(_0xfaa3('0x8'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xfaa3('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0xa')]);router[_0xfaa3('0x9')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0xd')]);router[_0xfaa3('0xe')]('/',auth[_0xfaa3('0xc')](),controller['create']);router[_0xfaa3('0xf')](_0xfaa3('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfaa3('0x10')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x11')]);module[_0xfaa3('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 76e237a..00f8c65 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 _0xfe33=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','STRING','DATE','format'];(function(_0x274e23,_0x13d210){var _0xb36116=function(_0x54a292){while(--_0x54a292){_0x274e23['push'](_0x274e23['shift']());}};_0xb36116(++_0x13d210);}(_0xfe33,0x13d));var _0x3fe3=function(_0x4b7d87,_0x238711){_0x4b7d87=_0x4b7d87-0x0;var _0x3b9f82=_0xfe33[_0x4b7d87];return _0x3b9f82;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x3fe3('0x0')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3fe3('0x1')],'defaultValue':moment()[_0x3fe3('0x2')](_0x3fe3('0x3'))},'countbusyretry':{'type':Sequelize[_0x3fe3('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3fe3('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3fe3('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3fe3('0x0')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3fe3('0x1')]},'priority':{'type':Sequelize[_0x3fe3('0x4')](0x2)[_0x3fe3('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3fe3('0x5')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3fe3('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x3fe3('0x4')],'unique':_0x3fe3('0x7')},'UserId':{'type':Sequelize[_0x3fe3('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x3fe3('0x4')],'unique':_0x3fe3('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x3fe3('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3fe3('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x575c=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','exports','STRING'];(function(_0x58381c,_0x3b9374){var _0x1a7440=function(_0x2bc7f1){while(--_0x2bc7f1){_0x58381c['push'](_0x58381c['shift']());}};_0x1a7440(++_0x3b9374);}(_0x575c,0x116));var _0xc575=function(_0x23a06f,_0x450ab3){_0x23a06f=_0x23a06f-0x0;var _0xa9a09a=_0x575c[_0x23a06f];return _0xa9a09a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xc575('0x0')]={'phone':{'type':Sequelize[_0xc575('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xc575('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc575('0x3')],'defaultValue':moment()[_0xc575('0x4')](_0xc575('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc575('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc575('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc575('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc575('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc575('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc575('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc575('0x6')],'unique':_0xc575('0x7')},'ListId':{'type':Sequelize[_0xc575('0x6')],'unique':_0xc575('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xc575('0x7')},'CampaignId':{'type':Sequelize[_0xc575('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc575('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc575('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc575('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 30316c8..bc3f20f 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 _0xe550=['pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','state','statedesc','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','finally','CmHopperFinal','create','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Company','Queue','update','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','then','destroy','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','key','keys','query','filters','intersection','model','concat','$or','$gt','$gte','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x4ce3b6,_0x1512d6){var _0x3f3bbb=function(_0x372c89){while(--_0x372c89){_0x4ce3b6['push'](_0x4ce3b6['shift']());}};_0x3f3bbb(++_0x1512d6);}(_0xe550,0xdc));var _0x0e55=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe550[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0e55('0x0'));var rimraf=require(_0x0e55('0x1'));var zipdir=require(_0x0e55('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e55('0x3'));var moment=require(_0x0e55('0x4'));var BPromise=require(_0x0e55('0x5'));var Mustache=require('mustache');var util=require(_0x0e55('0x6'));var path=require(_0x0e55('0x7'));var sox=require(_0x0e55('0x8'));var csv=require(_0x0e55('0x9'));var ejs=require(_0x0e55('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e55('0xb'));var squel=require('squel');var crypto=require(_0x0e55('0xc'));var jsforce=require(_0x0e55('0xd'));var deskjs=require(_0x0e55('0xe'));var toCsv=require(_0x0e55('0x9'));var querystring=require(_0x0e55('0xf'));var Papa=require(_0x0e55('0x10'));var Redis=require(_0x0e55('0x11'));var authService=require(_0x0e55('0x12'));var qs=require(_0x0e55('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e55('0x14'));var logger=require('../../config/logger')(_0x0e55('0x15'));var utils=require(_0x0e55('0x16'));var config=require(_0x0e55('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e55('0x18'))['db'];function respondWithStatusCode(_0xd08243,_0x382589){_0x382589=_0x382589||0xcc;return function(_0x57f91c){if(_0x57f91c){return _0xd08243[_0x0e55('0x19')](_0x382589);}return _0xd08243[_0x0e55('0x1a')](_0x382589)[_0x0e55('0x1b')]();};}function respondWithResult(_0x347a75,_0x1ddd68){_0x1ddd68=_0x1ddd68||0xc8;return function(_0x5ceb2f){if(_0x5ceb2f){return _0x347a75[_0x0e55('0x1a')](_0x1ddd68)['json'](_0x5ceb2f);}};}function respondWithFilteredResult(_0xa81763,_0x286e06){return function(_0x9c0292){if(_0x9c0292){var _0x50505a=typeof _0x286e06['offset']===_0x0e55('0x1c')&&typeof _0x286e06['limit']==='undefined';var _0xb7b760=_0x9c0292['count'];var _0x23bbeb=_0x50505a?0x0:_0x286e06['offset'];var _0x4b53f9=_0x50505a?_0x9c0292[_0x0e55('0x1d')]:_0x286e06[_0x0e55('0x1e')]+_0x286e06[_0x0e55('0x1f')];var _0x150aec;if(_0x4b53f9>=_0xb7b760){_0x4b53f9=_0xb7b760;_0x150aec=0xc8;}else{_0x150aec=0xce;}_0xa81763['status'](_0x150aec);return _0xa81763[_0x0e55('0x20')](_0x0e55('0x21'),_0x23bbeb+'-'+_0x4b53f9+'/'+_0xb7b760)[_0x0e55('0x22')](_0x9c0292);}return null;};}function patchUpdates(_0x277f32){return function(_0x17cd32){try{jsonpatch[_0x0e55('0x23')](_0x17cd32,_0x277f32,!![]);}catch(_0x5e26f0){return BPromise['reject'](_0x5e26f0);}return _0x17cd32['save']();};}function saveUpdates(_0x1acff9,_0x15028e){return function(_0x216b02){if(_0x216b02){return _0x216b02['update'](_0x1acff9)[_0x0e55('0x24')](function(_0x21eee8){return _0x21eee8;});}return null;};}function removeEntity(_0x573e20,_0x4ae709){return function(_0x1818f1){if(_0x1818f1){return _0x1818f1[_0x0e55('0x25')]()['then'](function(){_0x573e20[_0x0e55('0x1a')](0xcc)[_0x0e55('0x1b')]();});}};}function handleEntityNotFound(_0x4b6c39,_0x5b59ae){return function(_0x37ce13){if(!_0x37ce13){_0x4b6c39[_0x0e55('0x19')](0x194);}return _0x37ce13;};}function handleError(_0x50c6c5,_0x5b4d92){_0x5b4d92=_0x5b4d92||0x1f4;return function(_0x582893){logger[_0x0e55('0x26')](_0x582893[_0x0e55('0x27')]);if(_0x582893[_0x0e55('0x28')]){delete _0x582893[_0x0e55('0x28')];}_0x50c6c5['status'](_0x5b4d92)['send'](_0x582893);};}exports[_0x0e55('0x29')]=function(_0x4f64ea,_0x244e09){var _0x495a09={},_0x224ec8={},_0x1e75cf={'count':0x0,'rows':[]};var _0x900dea=_[_0x0e55('0x2a')](db[_0x0e55('0x2b')][_0x0e55('0x2c')],function(_0x3f704a){return{'name':_0x3f704a[_0x0e55('0x2d')],'type':_0x3f704a['type'][_0x0e55('0x2e')]};});_0x224ec8['model']=_[_0x0e55('0x2a')](_0x900dea,_0x0e55('0x28'));_0x224ec8['query']=_[_0x0e55('0x2f')](_0x4f64ea[_0x0e55('0x30')]);_0x224ec8[_0x0e55('0x31')]=_[_0x0e55('0x32')](_0x224ec8[_0x0e55('0x33')],_0x224ec8['query']);_0x224ec8[_0x0e55('0x31')]=_[_0x0e55('0x34')](_0x224ec8[_0x0e55('0x31')],['$and',_0x0e55('0x35'),_0x0e55('0x36'),_0x0e55('0x37'),'$lt',_0x0e55('0x38'),'$ne',_0x0e55('0x39'),_0x0e55('0x3a'),_0x0e55('0x3b'),_0x0e55('0x3c'),_0x0e55('0x3d'),_0x0e55('0x3e'),'$like',_0x0e55('0x3f'),_0x0e55('0x40'),_0x0e55('0x41'),'$like',_0x0e55('0x42'),_0x0e55('0x43'),_0x0e55('0x44'),_0x0e55('0x45')]);_0x495a09['attributes']=_[_0x0e55('0x32')](_0x224ec8[_0x0e55('0x33')],qs[_0x0e55('0x46')](_0x4f64ea[_0x0e55('0x30')][_0x0e55('0x46')]));_0x495a09['attributes']=_0x495a09['attributes']['length']?_0x495a09[_0x0e55('0x47')]:_0x224ec8[_0x0e55('0x33')];if(!_0x4f64ea[_0x0e55('0x30')][_0x0e55('0x48')](_0x0e55('0x49'))){_0x495a09[_0x0e55('0x1f')]=qs['limit'](_0x4f64ea[_0x0e55('0x30')][_0x0e55('0x1f')]);_0x495a09[_0x0e55('0x1e')]=qs[_0x0e55('0x1e')](_0x4f64ea['query']['offset']);}_0x495a09[_0x0e55('0x4a')]=qs['sort'](_0x4f64ea[_0x0e55('0x30')][_0x0e55('0x4b')]);_0x495a09['where']=qs[_0x0e55('0x31')](_[_0x0e55('0x4c')](_0x4f64ea['query'],_0x224ec8[_0x0e55('0x31')]),_0x900dea);if(_0x4f64ea[_0x0e55('0x30')][_0x0e55('0x4d')]){_0x495a09[_0x0e55('0x4e')]=_['merge'](_0x495a09[_0x0e55('0x4e')],{'$or':_[_0x0e55('0x2a')](_0x900dea,function(_0x2e8a77){if(_0x2e8a77[_0x0e55('0x4f')]!==_0x0e55('0x50')){var _0x315501={};_0x315501[_0x2e8a77[_0x0e55('0x28')]]={'$like':'%'+_0x4f64ea[_0x0e55('0x30')][_0x0e55('0x4d')]+'%'};return _0x315501;}})});}_0x495a09=_[_0x0e55('0x51')]({},_0x495a09,_0x4f64ea[_0x0e55('0x52')]);var _0x29376b={'where':_0x495a09[_0x0e55('0x4e')]};return db['CmHopper'][_0x0e55('0x1d')](_0x29376b)[_0x0e55('0x24')](function(_0x4e93bd){_0x1e75cf[_0x0e55('0x1d')]=_0x4e93bd;if(_0x4f64ea['query'][_0x0e55('0x53')]){_0x495a09[_0x0e55('0x54')]=[{'all':!![]}];}return db[_0x0e55('0x2b')][_0x0e55('0x55')](_0x495a09);})[_0x0e55('0x24')](function(_0x45f5a0){_0x1e75cf[_0x0e55('0x56')]=_0x45f5a0;return _0x1e75cf;})['then'](respondWithFilteredResult(_0x244e09,_0x495a09))[_0x0e55('0x57')](handleError(_0x244e09,null));};exports[_0x0e55('0x58')]=function(_0xfabd4e,_0xf98623){var _0x2dd5a9={'raw':!![],'where':{'id':_0xfabd4e[_0x0e55('0x59')]['id']}},_0x1419d9={};_0x1419d9[_0x0e55('0x33')]=_[_0x0e55('0x2f')](db[_0x0e55('0x2b')][_0x0e55('0x2c')]);_0x1419d9['query']=_[_0x0e55('0x2f')](_0xfabd4e[_0x0e55('0x30')]);_0x1419d9[_0x0e55('0x31')]=_[_0x0e55('0x32')](_0x1419d9[_0x0e55('0x33')],_0x1419d9[_0x0e55('0x30')]);_0x2dd5a9['attributes']=_['intersection'](_0x1419d9[_0x0e55('0x33')],qs[_0x0e55('0x46')](_0xfabd4e[_0x0e55('0x30')][_0x0e55('0x46')]));_0x2dd5a9[_0x0e55('0x47')]=_0x2dd5a9[_0x0e55('0x47')][_0x0e55('0x5a')]?_0x2dd5a9['attributes']:_0x1419d9[_0x0e55('0x33')];if(_0xfabd4e[_0x0e55('0x30')][_0x0e55('0x53')]){_0x2dd5a9[_0x0e55('0x54')]=[{'all':!![]}];}_0x2dd5a9=_[_0x0e55('0x51')]({},_0x2dd5a9,_0xfabd4e[_0x0e55('0x52')]);return db[_0x0e55('0x2b')][_0x0e55('0x5b')](_0x2dd5a9)['then'](handleEntityNotFound(_0xf98623,null))[_0x0e55('0x24')](respondWithResult(_0xf98623,null))[_0x0e55('0x57')](handleError(_0xf98623,null));};exports['create']=function(_0x50f093,_0x32998a){return db['CmHopper']['create'](_0x50f093['body'],{})[_0x0e55('0x24')](respondWithResult(_0x32998a,0xc9))['catch'](handleError(_0x32998a,null));};exports['update']=function(_0x4db9f6,_0x4dfc1f){if(_0x4db9f6[_0x0e55('0x5c')]['id']){delete _0x4db9f6[_0x0e55('0x5c')]['id'];}return db[_0x0e55('0x2b')]['find']({'where':{'id':_0x4db9f6['params']['id']}})['then'](handleEntityNotFound(_0x4dfc1f,null))[_0x0e55('0x24')](saveUpdates(_0x4db9f6['body'],null))['then'](respondWithResult(_0x4dfc1f,null))['catch'](handleError(_0x4dfc1f,null));};exports[_0x0e55('0x5d')]=function(_0x19c8ee,_0x1e9b0f){return db[_0x0e55('0x2b')][_0x0e55('0x5d')]()['then'](respondWithResult(_0x1e9b0f,null))[_0x0e55('0x57')](handleError(_0x1e9b0f,null));};exports[_0x0e55('0x25')]=function(_0x5ebe8e,_0x2a9d3a){var _0x12a90f;return db[_0x0e55('0x2b')][_0x0e55('0x5b')]({'where':{'id':_0x5ebe8e['params']['id']}})[_0x0e55('0x24')](handleEntityNotFound(_0x2a9d3a,null))['then'](function(_0x5f4690){if(_0x5f4690){return _0x5f4690[_0x0e55('0x25')]()[_0x0e55('0x24')](function(_0x3a27c1){return _0x3a27c1;});}})[_0x0e55('0x24')](function(_0x462031){_0x12a90f=_0x462031;if(_0x462031){if(_0x462031[_0x0e55('0x5e')]||_0x462031[_0x0e55('0x5f')]){return db[_0x462031['VoiceQueueId']?_0x0e55('0x60'):_0x0e55('0x61')]['find']({'where':{'id':_0x462031['VoiceQueueId']?_0x462031[_0x0e55('0x5e')]:_0x462031['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x0e55('0x24')](function(_0x17c569){var _0x348f60={};if(_0x17c569){_[_0x0e55('0x51')](_0x348f60,_['omit'](_0x12a90f[_0x0e55('0x62')],[_0x0e55('0x63'),'updatedAt','id']));_0x348f60[_0x0e55('0x64')]=0x15;_0x348f60[_0x0e55('0x65')]=_0x0e55('0x66');_0x348f60[_0x0e55('0x67')]=_0x17c569[_0x0e55('0x28')];_0x348f60[_0x0e55('0x68')]=_0x5ebe8e['user']['name'];_0x348f60[_0x0e55('0x69')]=_0x5ebe8e[_0x0e55('0x6a')]['id'];_0x348f60['deleted']=!![];_0x348f60[_0x0e55('0x6b')]=moment()[_0x0e55('0x6c')](_0x0e55('0x6d'));_0x348f60[_0x0e55('0x6e')]=_0x12a90f[_0x0e55('0x6f')];_0x348f60[_0x0e55('0x70')]=_0x12a90f['VoiceQueueId']?_0x0e55('0x71'):_0x0e55('0x72');return db[_0x0e55('0x73')][_0x0e55('0x5b')]({'where':{'id':_0x348f60[_0x0e55('0x74')]},'attributes':[_0x0e55('0x75'),_0x0e55('0x76')]})[_0x0e55('0x24')](function(_0x328046){if(!_['isNil'](_0x2a9d3a)&&!_[_0x0e55('0x77')](_0x328046[_0x0e55('0x75')])){_0x348f60['calleridname']=_0x328046[_0x0e55('0x75')];if(!_['isNil'](_0x328046['lastName'])){_0x348f60['calleridname']+='\x20'+_0x328046[_0x0e55('0x76')];}}})[_0x0e55('0x78')](function(){return db[_0x0e55('0x79')][_0x0e55('0x7a')](_0x348f60);});}})[_0x0e55('0x24')](function(){return _0x2a9d3a[_0x0e55('0x1a')](0xcc)['end']();})[_0x0e55('0x57')](handleError(_0x2a9d3a,null));};exports['getPreview']=function(_0x16631e,_0x413fe6,_0x13352b){var _0x59651c=[];return db[_0x0e55('0x73')][_0x0e55('0x5d')]()['then'](function(_0x250a92){_0x59651c=_[_0x0e55('0x2f')](_0x250a92);return _0x16631e['user']['getVoiceQueues']({'where':{'type':_0x0e55('0x7b'),'dialActive':!![],'dialMethod':_0x0e55('0x7c')},'attributes':['id',_0x0e55('0x7d')],'raw':!![]});})[_0x0e55('0x24')](function(_0xacd552){if(_0xacd552&&_0xacd552[_0x0e55('0x5a')]){return db[_0x0e55('0x7e')][_0x0e55('0x7f')](function(_0x2cf30b){var _0xf5f612={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0e55('0x6c')](_0x0e55('0x6d'))},'VoiceQueueId':{'$in':_[_0x0e55('0x2a')](_0xacd552,'id')},'$or':[{'UserId':null},{'UserId':_0x16631e[_0x0e55('0x6a')]['id']}]};var _0x26aebe=[];if(_0x16631e['body'][_0x0e55('0x80')]&&_0x16631e[_0x0e55('0x5c')]['direction']===_0x0e55('0x81')){if(!_[_0x0e55('0x82')](_0x16631e[_0x0e55('0x5c')][_0x0e55('0x83')])){_0xf5f612['id']={'$in':_0x16631e['body'][_0x0e55('0x83')]};}_0x26aebe=[[_0x0e55('0x84'),'ASC'],[_0x0e55('0x85'),_0xacd552[0x0][_0x0e55('0x7d')]===_0x0e55('0x86')?_0x0e55('0x87'):_0x0e55('0x86')],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x0e55('0x82')](_0x16631e['body'][_0x0e55('0x83')])){_0xf5f612['id']={'$notIn':_0x16631e[_0x0e55('0x5c')]['hopperIds']};}_0x26aebe=[[_0x0e55('0x84'),_0x0e55('0x87')],['scheduledAt',_0xacd552[0x0][_0x0e55('0x7d')]],db['sequelize']['literal'](_0x0e55('0x88')),['id',_0x0e55('0x86')]];}return db[_0x0e55('0x2b')][_0x0e55('0x89')]({'attributes':['id',_0x0e55('0x8a')],'where':_0xf5f612,'order':_0x26aebe,'transaction':_0x2cf30b,'lock':_0x2cf30b[_0x0e55('0x8b')]['UPDATE'],'include':[{'model':db[_0x0e55('0x73')],'as':'Contact','attributes':_0x59651c,'include':[{'model':db['CmCompany'],'as':_0x0e55('0x8c'),'attributes':['id',_0x0e55('0x28')]}]},{'model':db['CmList'],'as':'List','attributes':['id','name']},{'model':db[_0x0e55('0x60')],'as':_0x0e55('0x8d'),'attributes':['id',_0x0e55('0x28'),'dialActive']}]})[_0x0e55('0x24')](function(_0x16f40d){if(_0x16f40d){return _0x16f40d[_0x0e55('0x8e')]({'UserId':_0x16631e['user']['id']},{'transaction':_0x2cf30b});}});});}})[_0x0e55('0x24')](handleEntityNotFound(_0x413fe6,null))[_0x0e55('0x24')](respondWithResult(_0x413fe6,null))[_0x0e55('0x57')](handleError(_0x413fe6,null));};exports[_0x0e55('0x8f')]=function(_0x133003,_0x177d4c,_0xf79f46){return _0x133003[_0x0e55('0x6a')][_0x0e55('0x90')]({'where':{'type':_0x0e55('0x7b'),'dialActive':!![],'dialMethod':_0x0e55('0x7c')},'attributes':['id'],'raw':!![]})[_0x0e55('0x24')](function(_0x3d9675){if(_0x3d9675&&_0x3d9675[_0x0e55('0x5a')]){return db[_0x0e55('0x2b')][_0x0e55('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x0e55('0x6d'))},'VoiceQueueId':{'$in':_[_0x0e55('0x2a')](_0x3d9675,'id')},'$or':[{'UserId':null},{'UserId':_0x133003['user']['id']}]}});}return 0x0;})['then'](function(_0x3e1e14){if(!_[_0x0e55('0x77')](_0x3e1e14)&&_[_0x0e55('0x91')](_0x3e1e14)){return _0x177d4c['status'](0xc8)[_0x0e55('0x22')]({'contacts':_0x3e1e14});}else{logger[_0x0e55('0x26')](_0x0e55('0x92'),_0x0e55('0x8f'),0x194,_0x0e55('0x93'));_0x177d4c[_0x0e55('0x19')](0x194);}})[_0x0e55('0x57')](handleError(_0x177d4c,null));}; \ No newline at end of file +var _0x6050=['$in','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','options','find','catch','create','body','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','dataValues','createdAt','state','statedesc','campaign','membername','user','deleted','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','finally','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','format','direction','isEmpty','hopperIds','priority','scheduledAt','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','fast-json-patch','request-promise','moment','bluebird','path','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','CmHopper','key','query','keys','filters','intersection','model','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween'];(function(_0x37a584,_0xa570c){var _0x1e46b7=function(_0x3882d8){while(--_0x3882d8){_0x37a584['push'](_0x37a584['shift']());}};_0x1e46b7(++_0xa570c);}(_0x6050,0x177));var _0x0605=function(_0x55b7dc,_0x4e0179){_0x55b7dc=_0x55b7dc-0x0;var _0x2af5f4=_0x6050[_0x55b7dc];return _0x2af5f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0605('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0605('0x1'));var rp=require(_0x0605('0x2'));var moment=require(_0x0605('0x3'));var BPromise=require(_0x0605('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0605('0x5'));var sox=require('sox');var csv=require(_0x0605('0x6'));var ejs=require(_0x0605('0x7'));var fs=require('fs');var fs_extra=require(_0x0605('0x8'));var _=require(_0x0605('0x9'));var squel=require(_0x0605('0xa'));var crypto=require(_0x0605('0xb'));var jsforce=require(_0x0605('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0605('0x6'));var querystring=require('querystring');var Papa=require(_0x0605('0xd'));var Redis=require(_0x0605('0xe'));var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))('api');var utils=require(_0x0605('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0605('0x15'));var db=require(_0x0605('0x16'))['db'];function respondWithStatusCode(_0x32c614,_0x32d103){_0x32d103=_0x32d103||0xcc;return function(_0x5e2c0b){if(_0x5e2c0b){return _0x32c614[_0x0605('0x17')](_0x32d103);}return _0x32c614[_0x0605('0x18')](_0x32d103)[_0x0605('0x19')]();};}function respondWithResult(_0x5a9f22,_0x52716b){_0x52716b=_0x52716b||0xc8;return function(_0x9c6e8a){if(_0x9c6e8a){return _0x5a9f22['status'](_0x52716b)[_0x0605('0x1a')](_0x9c6e8a);}};}function respondWithFilteredResult(_0x52b1d9,_0x400324){return function(_0x39b82d){if(_0x39b82d){var _0x3f0187=typeof _0x400324[_0x0605('0x1b')]===_0x0605('0x1c')&&typeof _0x400324[_0x0605('0x1d')]===_0x0605('0x1c');var _0x35e538=_0x39b82d[_0x0605('0x1e')];var _0x1806dc=_0x3f0187?0x0:_0x400324[_0x0605('0x1b')];var _0x205e2b=_0x3f0187?_0x39b82d[_0x0605('0x1e')]:_0x400324[_0x0605('0x1b')]+_0x400324[_0x0605('0x1d')];var _0x76843a;if(_0x205e2b>=_0x35e538){_0x205e2b=_0x35e538;_0x76843a=0xc8;}else{_0x76843a=0xce;}_0x52b1d9['status'](_0x76843a);return _0x52b1d9[_0x0605('0x1f')](_0x0605('0x20'),_0x1806dc+'-'+_0x205e2b+'/'+_0x35e538)[_0x0605('0x1a')](_0x39b82d);}return null;};}function patchUpdates(_0x5b869e){return function(_0x1f4544){try{jsonpatch['apply'](_0x1f4544,_0x5b869e,!![]);}catch(_0xcf4f74){return BPromise[_0x0605('0x21')](_0xcf4f74);}return _0x1f4544[_0x0605('0x22')]();};}function saveUpdates(_0xf31b9d,_0x5d465b){return function(_0x1e8990){if(_0x1e8990){return _0x1e8990[_0x0605('0x23')](_0xf31b9d)[_0x0605('0x24')](function(_0x36a474){return _0x36a474;});}return null;};}function removeEntity(_0x58a377,_0x1465ae){return function(_0x1e2556){if(_0x1e2556){return _0x1e2556['destroy']()[_0x0605('0x24')](function(){_0x58a377['status'](0xcc)[_0x0605('0x19')]();});}};}function handleEntityNotFound(_0x55cec9,_0x4bc451){return function(_0x41d825){if(!_0x41d825){_0x55cec9['sendStatus'](0x194);}return _0x41d825;};}function handleError(_0x526057,_0x42e1fb){_0x42e1fb=_0x42e1fb||0x1f4;return function(_0x4523b6){logger[_0x0605('0x25')](_0x4523b6[_0x0605('0x26')]);if(_0x4523b6[_0x0605('0x27')]){delete _0x4523b6[_0x0605('0x27')];}_0x526057[_0x0605('0x18')](_0x42e1fb)[_0x0605('0x28')](_0x4523b6);};}exports[_0x0605('0x29')]=function(_0x3a4df8,_0x2bc518){var _0x5e9df4={},_0x4a544a={},_0x172f72={'count':0x0,'rows':[]};var _0x5b1628=_[_0x0605('0x2a')](db[_0x0605('0x2b')]['rawAttributes'],function(_0x42c76f){return{'name':_0x42c76f['fieldName'],'type':_0x42c76f['type'][_0x0605('0x2c')]};});_0x4a544a['model']=_[_0x0605('0x2a')](_0x5b1628,_0x0605('0x27'));_0x4a544a[_0x0605('0x2d')]=_[_0x0605('0x2e')](_0x3a4df8[_0x0605('0x2d')]);_0x4a544a[_0x0605('0x2f')]=_[_0x0605('0x30')](_0x4a544a[_0x0605('0x31')],_0x4a544a[_0x0605('0x2d')]);_0x4a544a[_0x0605('0x2f')]=_[_0x0605('0x32')](_0x4a544a['filters'],['$and',_0x0605('0x33'),_0x0605('0x34'),_0x0605('0x35'),_0x0605('0x36'),_0x0605('0x37'),_0x0605('0x38'),_0x0605('0x39'),_0x0605('0x3a'),'$between',_0x0605('0x3b'),_0x0605('0x3c'),'$notIn','$like','$notLike',_0x0605('0x3d'),_0x0605('0x3e'),_0x0605('0x3f'),_0x0605('0x40'),_0x0605('0x41'),_0x0605('0x42'),_0x0605('0x43')]);_0x5e9df4[_0x0605('0x44')]=_[_0x0605('0x30')](_0x4a544a['model'],qs['fields'](_0x3a4df8[_0x0605('0x2d')][_0x0605('0x45')]));_0x5e9df4[_0x0605('0x44')]=_0x5e9df4[_0x0605('0x44')][_0x0605('0x46')]?_0x5e9df4[_0x0605('0x44')]:_0x4a544a[_0x0605('0x31')];if(!_0x3a4df8['query'][_0x0605('0x47')](_0x0605('0x48'))){_0x5e9df4[_0x0605('0x1d')]=qs['limit'](_0x3a4df8[_0x0605('0x2d')][_0x0605('0x1d')]);_0x5e9df4['offset']=qs[_0x0605('0x1b')](_0x3a4df8[_0x0605('0x2d')][_0x0605('0x1b')]);}_0x5e9df4[_0x0605('0x49')]=qs[_0x0605('0x4a')](_0x3a4df8['query']['sort']);_0x5e9df4[_0x0605('0x4b')]=qs[_0x0605('0x2f')](_[_0x0605('0x4c')](_0x3a4df8[_0x0605('0x2d')],_0x4a544a['filters']),_0x5b1628);if(_0x3a4df8[_0x0605('0x2d')][_0x0605('0x4d')]){_0x5e9df4[_0x0605('0x4b')]=_[_0x0605('0x4e')](_0x5e9df4['where'],{'$or':_[_0x0605('0x2a')](_0x5b1628,function(_0x278e76){if(_0x278e76[_0x0605('0x4f')]!==_0x0605('0x50')){var _0x3dd98e={};_0x3dd98e[_0x278e76['name']]={'$like':'%'+_0x3a4df8['query'][_0x0605('0x4d')]+'%'};return _0x3dd98e;}})});}_0x5e9df4=_['merge']({},_0x5e9df4,_0x3a4df8['options']);var _0x17294f={'where':_0x5e9df4[_0x0605('0x4b')]};return db[_0x0605('0x2b')]['count'](_0x17294f)[_0x0605('0x24')](function(_0xf4f6b4){_0x172f72[_0x0605('0x1e')]=_0xf4f6b4;if(_0x3a4df8[_0x0605('0x2d')][_0x0605('0x51')]){_0x5e9df4[_0x0605('0x52')]=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x53')](_0x5e9df4);})[_0x0605('0x24')](function(_0x3505d3){_0x172f72[_0x0605('0x54')]=_0x3505d3;return _0x172f72;})['then'](respondWithFilteredResult(_0x2bc518,_0x5e9df4))['catch'](handleError(_0x2bc518,null));};exports['show']=function(_0x2bcf67,_0x443692){var _0x5af6ce={'raw':!![],'where':{'id':_0x2bcf67[_0x0605('0x55')]['id']}},_0x1270ec={};_0x1270ec[_0x0605('0x31')]=_[_0x0605('0x2e')](db[_0x0605('0x2b')]['rawAttributes']);_0x1270ec['query']=_[_0x0605('0x2e')](_0x2bcf67[_0x0605('0x2d')]);_0x1270ec[_0x0605('0x2f')]=_[_0x0605('0x30')](_0x1270ec[_0x0605('0x31')],_0x1270ec['query']);_0x5af6ce['attributes']=_[_0x0605('0x30')](_0x1270ec[_0x0605('0x31')],qs[_0x0605('0x45')](_0x2bcf67[_0x0605('0x2d')]['fields']));_0x5af6ce[_0x0605('0x44')]=_0x5af6ce[_0x0605('0x44')]['length']?_0x5af6ce[_0x0605('0x44')]:_0x1270ec[_0x0605('0x31')];if(_0x2bcf67['query']['includeAll']){_0x5af6ce[_0x0605('0x52')]=[{'all':!![]}];}_0x5af6ce=_[_0x0605('0x4e')]({},_0x5af6ce,_0x2bcf67[_0x0605('0x56')]);return db[_0x0605('0x2b')][_0x0605('0x57')](_0x5af6ce)['then'](handleEntityNotFound(_0x443692,null))[_0x0605('0x24')](respondWithResult(_0x443692,null))[_0x0605('0x58')](handleError(_0x443692,null));};exports[_0x0605('0x59')]=function(_0x206d66,_0x1cdb67){return db['CmHopper'][_0x0605('0x59')](_0x206d66[_0x0605('0x5a')],{})['then'](respondWithResult(_0x1cdb67,0xc9))[_0x0605('0x58')](handleError(_0x1cdb67,null));};exports[_0x0605('0x23')]=function(_0x1f21ca,_0x19f637){if(_0x1f21ca[_0x0605('0x5a')]['id']){delete _0x1f21ca['body']['id'];}return db['CmHopper'][_0x0605('0x57')]({'where':{'id':_0x1f21ca['params']['id']}})[_0x0605('0x24')](handleEntityNotFound(_0x19f637,null))[_0x0605('0x24')](saveUpdates(_0x1f21ca['body'],null))['then'](respondWithResult(_0x19f637,null))[_0x0605('0x58')](handleError(_0x19f637,null));};exports[_0x0605('0x5b')]=function(_0x104489,_0x3b5f3f){return db[_0x0605('0x2b')]['describe']()['then'](respondWithResult(_0x3b5f3f,null))[_0x0605('0x58')](handleError(_0x3b5f3f,null));};exports[_0x0605('0x5c')]=function(_0x25fb32,_0x2a5675){var _0x5840e0;return db[_0x0605('0x2b')][_0x0605('0x57')]({'where':{'id':_0x25fb32[_0x0605('0x55')]['id']}})[_0x0605('0x24')](handleEntityNotFound(_0x2a5675,null))[_0x0605('0x24')](function(_0x1043b7){if(_0x1043b7){return _0x1043b7[_0x0605('0x5c')]()[_0x0605('0x24')](function(_0x506e91){return _0x506e91;});}})['then'](function(_0x31be28){_0x5840e0=_0x31be28;if(_0x31be28){if(_0x31be28[_0x0605('0x5d')]||_0x31be28['CampaignId']){return db[_0x31be28[_0x0605('0x5d')]?_0x0605('0x5e'):_0x0605('0x5f')][_0x0605('0x57')]({'where':{'id':_0x31be28[_0x0605('0x5d')]?_0x31be28[_0x0605('0x5d')]:_0x31be28['CampaignId']},'attributes':['id',_0x0605('0x27')],'raw':!![]});}}})[_0x0605('0x24')](function(_0x5b1197){var _0x5ed0a7={};if(_0x5b1197){_[_0x0605('0x4e')](_0x5ed0a7,_['omit'](_0x5840e0[_0x0605('0x60')],[_0x0605('0x61'),'updatedAt','id']));_0x5ed0a7[_0x0605('0x62')]=0x15;_0x5ed0a7[_0x0605('0x63')]='deleted';_0x5ed0a7[_0x0605('0x64')]=_0x5b1197[_0x0605('0x27')];_0x5ed0a7[_0x0605('0x65')]=_0x25fb32[_0x0605('0x66')][_0x0605('0x27')];_0x5ed0a7['UserId']=_0x25fb32[_0x0605('0x66')]['id'];_0x5ed0a7[_0x0605('0x67')]=!![];_0x5ed0a7[_0x0605('0x68')]=moment()['format'](_0x0605('0x69'));_0x5ed0a7[_0x0605('0x6a')]=_0x5840e0['phone'];_0x5ed0a7[_0x0605('0x6b')]=_0x5840e0[_0x0605('0x5d')]?_0x0605('0x6c'):_0x0605('0x6d');return db[_0x0605('0x6e')][_0x0605('0x57')]({'where':{'id':_0x5ed0a7['ContactId']},'attributes':[_0x0605('0x6f'),_0x0605('0x70')]})['then'](function(_0x1b3c8c){if(!_[_0x0605('0x71')](_0x2a5675)&&!_[_0x0605('0x71')](_0x1b3c8c[_0x0605('0x6f')])){_0x5ed0a7['calleridname']=_0x1b3c8c[_0x0605('0x6f')];if(!_[_0x0605('0x71')](_0x1b3c8c[_0x0605('0x70')])){_0x5ed0a7['calleridname']+='\x20'+_0x1b3c8c[_0x0605('0x70')];}}})[_0x0605('0x72')](function(){return db['CmHopperFinal'][_0x0605('0x59')](_0x5ed0a7);});}})[_0x0605('0x24')](function(){return _0x2a5675['status'](0xcc)[_0x0605('0x19')]();})['catch'](handleError(_0x2a5675,null));};exports[_0x0605('0x73')]=function(_0x3b9492,_0x27718,_0x5880cc){var _0x19a9ce=[];return db[_0x0605('0x6e')]['describe']()[_0x0605('0x24')](function(_0x3a7923){_0x19a9ce=_[_0x0605('0x2e')](_0x3a7923);return _0x3b9492['user'][_0x0605('0x74')]({'where':{'type':_0x0605('0x75'),'dialActive':!![],'dialMethod':_0x0605('0x76')},'attributes':['id',_0x0605('0x77')],'raw':!![]});})[_0x0605('0x24')](function(_0x18992a){if(_0x18992a&&_0x18992a[_0x0605('0x46')]){return db[_0x0605('0x78')][_0x0605('0x79')](function(_0x4ed772){var _0x41ef3a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0605('0x7a')](_0x0605('0x69'))},'VoiceQueueId':{'$in':_[_0x0605('0x2a')](_0x18992a,'id')},'$or':[{'UserId':null},{'UserId':_0x3b9492['user']['id']}]};var _0x119b9a=[];if(_0x3b9492[_0x0605('0x5a')][_0x0605('0x7b')]&&_0x3b9492[_0x0605('0x5a')][_0x0605('0x7b')]==='prev'){if(!_[_0x0605('0x7c')](_0x3b9492[_0x0605('0x5a')]['hopperIds'])){_0x41ef3a['id']={'$in':_0x3b9492[_0x0605('0x5a')][_0x0605('0x7d')]};}_0x119b9a=[[_0x0605('0x7e'),'ASC'],[_0x0605('0x7f'),_0x18992a[0x0][_0x0605('0x77')]===_0x0605('0x80')?_0x0605('0x81'):_0x0605('0x80')],db['sequelize']['literal'](_0x0605('0x82')),['id',_0x0605('0x81')]];}else{if(!_[_0x0605('0x7c')](_0x3b9492[_0x0605('0x5a')][_0x0605('0x7d')])){_0x41ef3a['id']={'$notIn':_0x3b9492['body'][_0x0605('0x7d')]};}_0x119b9a=[[_0x0605('0x7e'),'DESC'],[_0x0605('0x7f'),_0x18992a[0x0][_0x0605('0x77')]],db[_0x0605('0x78')][_0x0605('0x83')](_0x0605('0x84')),['id',_0x0605('0x80')]];}return db[_0x0605('0x2b')][_0x0605('0x85')]({'attributes':['id','scheduledat'],'where':_0x41ef3a,'order':_0x119b9a,'transaction':_0x4ed772,'lock':_0x4ed772[_0x0605('0x86')][_0x0605('0x87')],'include':[{'model':db[_0x0605('0x6e')],'as':'Contact','attributes':_0x19a9ce,'include':[{'model':db[_0x0605('0x88')],'as':_0x0605('0x89'),'attributes':['id',_0x0605('0x27')]}]},{'model':db[_0x0605('0x8a')],'as':_0x0605('0x8b'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x0605('0x8c'),'attributes':['id',_0x0605('0x27'),_0x0605('0x8d')]}]})['then'](function(_0x2fc82e){if(_0x2fc82e){return _0x2fc82e[_0x0605('0x23')]({'UserId':_0x3b9492[_0x0605('0x66')]['id']},{'transaction':_0x4ed772});}});});}})['then'](handleEntityNotFound(_0x27718,null))[_0x0605('0x24')](respondWithResult(_0x27718,null))[_0x0605('0x58')](handleError(_0x27718,null));};exports['getOpenContacts']=function(_0x396d82,_0x2bbf3a,_0x3e574b){return _0x396d82['user'][_0x0605('0x74')]({'where':{'type':_0x0605('0x75'),'dialActive':!![],'dialMethod':_0x0605('0x76')},'attributes':['id'],'raw':!![]})['then'](function(_0x2e55e6){if(_0x2e55e6&&_0x2e55e6[_0x0605('0x46')]){return db[_0x0605('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0605('0x7a')](_0x0605('0x69'))},'VoiceQueueId':{'$in':_[_0x0605('0x2a')](_0x2e55e6,'id')},'$or':[{'UserId':null},{'UserId':_0x396d82[_0x0605('0x66')]['id']}]}});}return 0x0;})[_0x0605('0x24')](function(_0x28a4f8){if(!_[_0x0605('0x71')](_0x28a4f8)&&_[_0x0605('0x8e')](_0x28a4f8)){return _0x2bbf3a[_0x0605('0x18')](0xc8)[_0x0605('0x1a')]({'contacts':_0x28a4f8});}else{logger[_0x0605('0x25')](_0x0605('0x8f'),'getOpenContacts',0x194,_0x0605('0x90'));_0x2bbf3a[_0x0605('0x17')](0x194);}})[_0x0605('0x58')](handleError(_0x2bbf3a,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 09e90b7..ccb6b32 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 _0x1261=['path','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa79171,_0x17cfc4){var _0x4d3b2e=function(_0x529a18){while(--_0x529a18){_0xa79171['push'](_0xa79171['shift']());}};_0x4d3b2e(++_0x17cfc4);}(_0x1261,0x144));var _0x1126=function(_0x134058,_0x423995){_0x134058=_0x134058-0x0;var _0x14a1a9=_0x1261[_0x134058];return _0x14a1a9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('CmHopper',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]},{'name':_0x1126('0xd'),'fields':[_0x1126('0xd')]},{'name':'priority','fields':[_0x1126('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33af=['request-promise','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','moment','bluebird'];(function(_0x324366,_0x2ec482){var _0x21fae2=function(_0x30162e){while(--_0x30162e){_0x324366['push'](_0x324366['shift']());}};_0x21fae2(++_0x2ec482);}(_0x33af,0xec));var _0xf33a=function(_0xafcf00,_0x4429a3){_0xafcf00=_0xafcf00-0x0;var _0x513af4=_0x33af[_0xafcf00];return _0x513af4;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require(_0xf33a('0x2'));var BPromise=require(_0xf33a('0x3'));var rp=require(_0xf33a('0x4'));var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf33a('0x7'));module[_0xf33a('0x8')]=function(_0x583e54,_0xc0dd13){return _0x583e54[_0xf33a('0x9')](_0xf33a('0xa'),attributes,{'tableName':_0xf33a('0xb'),'paranoid':![],'indexes':[{'name':_0xf33a('0xc'),'fields':[_0xf33a('0xc')]},{'name':'phone','fields':[_0xf33a('0xd')]},{'name':_0xf33a('0xe'),'fields':[_0xf33a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 54b985b..2a2f9c1 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 _0x6fa2=['stringify','error','message','info','result','catch','GetCmHopper','CmHopper','options','raw','where','limit','include','map','attributes','model','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','voicePause','length','UserId','push','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','findAll','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s'];(function(_0x429370,_0x46ff4c){var _0x41a3ad=function(_0x47d51e){while(--_0x47d51e){_0x429370['push'](_0x429370['shift']());}};_0x41a3ad(++_0x46ff4c);}(_0x6fa2,0x196));var _0x26fa=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6fa2[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x26fa('0x0'));var util=require(_0x26fa('0x1'));var moment=require(_0x26fa('0x2'));var BPromise=require(_0x26fa('0x3'));var rs=require(_0x26fa('0x4'));var fs=require('fs');var Redis=require(_0x26fa('0x5'));var db=require(_0x26fa('0x6'))['db'];var utils=require(_0x26fa('0x7'));var logger=require(_0x26fa('0x8'))(_0x26fa('0x9'));var config=require(_0x26fa('0xa'));var jayson=require(_0x26fa('0xb'));var client=jayson[_0x26fa('0xc')][_0x26fa('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x169383,_0x2b3a76,_0x251fc4){return new BPromise(function(_0x365b81,_0x3ad91f){return client[_0x26fa('0xe')](_0x169383,_0x251fc4)[_0x26fa('0xf')](function(_0x43cdca){logger['info'](_0x26fa('0x10'),_0x2b3a76,_0x26fa('0x11'));logger[_0x26fa('0x12')](_0x26fa('0x13'),_0x2b3a76,'request\x20sent',JSON[_0x26fa('0x14')](_0x43cdca));if(_0x43cdca[_0x26fa('0x15')]){if(_0x43cdca[_0x26fa('0x15')]['code']===0x1f4){logger[_0x26fa('0x15')](_0x26fa('0x10'),_0x2b3a76,_0x43cdca[_0x26fa('0x15')]['message']);return _0x3ad91f(_0x43cdca[_0x26fa('0x15')][_0x26fa('0x16')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x2b3a76,_0x43cdca[_0x26fa('0x15')][_0x26fa('0x16')]);return _0x365b81(_0x43cdca[_0x26fa('0x15')][_0x26fa('0x16')]);}else{logger[_0x26fa('0x17')](_0x26fa('0x10'),_0x2b3a76,'request\x20sent');_0x365b81(_0x43cdca[_0x26fa('0x18')][_0x26fa('0x16')]);}})[_0x26fa('0x19')](function(_0x3a824c){logger[_0x26fa('0x15')](_0x26fa('0x10'),_0x2b3a76,_0x3a824c);_0x3ad91f(_0x3a824c);});});}exports[_0x26fa('0x1a')]=function(_0x5697bf){var _0x53e365=this;return new Promise(function(_0x370fdb,_0x28c43b){return db[_0x26fa('0x1b')]['findAll']({'raw':_0x5697bf[_0x26fa('0x1c')]?_0x5697bf[_0x26fa('0x1c')][_0x26fa('0x1d')]===undefined?!![]:![]:!![],'where':_0x5697bf['options']?_0x5697bf['options'][_0x26fa('0x1e')]||null:null,'attributes':_0x5697bf[_0x26fa('0x1c')]?_0x5697bf['options']['attributes']||null:null,'limit':_0x5697bf[_0x26fa('0x1c')]?_0x5697bf['options'][_0x26fa('0x1f')]||null:null,'include':_0x5697bf['options']?_0x5697bf['options'][_0x26fa('0x20')]?_[_0x26fa('0x21')](_0x5697bf[_0x26fa('0x1c')][_0x26fa('0x20')],function(_0x161956){return{'model':db[_0x161956['model']],'as':_0x161956['as'],'attributes':_0x161956[_0x26fa('0x22')],'include':_0x161956[_0x26fa('0x20')]?_[_0x26fa('0x21')](_0x161956['include'],function(_0x2a542e){return{'model':db[_0x2a542e[_0x26fa('0x23')]],'as':_0x2a542e['as'],'attributes':_0x2a542e[_0x26fa('0x22')],'include':_0x2a542e[_0x26fa('0x20')]?_[_0x26fa('0x21')](_0x2a542e[_0x26fa('0x20')],function(_0x3a1218){return{'model':db[_0x3a1218['model']],'as':_0x3a1218['as'],'attributes':_0x3a1218['attributes']};}):[]};}):[]};}):[]:[]})[_0x26fa('0xf')](function(_0x76aeff){logger[_0x26fa('0x17')]('GetCmHopper',_0x5697bf);logger[_0x26fa('0x12')](_0x26fa('0x1a'),_0x5697bf,JSON['stringify'](_0x76aeff));_0x370fdb(_0x76aeff);})[_0x26fa('0x19')](function(_0x548bfb){logger[_0x26fa('0x15')]('GetCmHopper',_0x548bfb[_0x26fa('0x16')],_0x5697bf);_0x28c43b(_0x53e365[_0x26fa('0x15')](0x1f4,_0x548bfb[_0x26fa('0x16')]));});});};exports[_0x26fa('0x24')]=function(_0x564c84){var _0x178c98=this;return new Promise(function(_0xfd42f8,_0x413a06){return db[_0x26fa('0x1b')]['find']({'raw':_0x564c84['options']?_0x564c84[_0x26fa('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x564c84[_0x26fa('0x1c')]?_0x564c84[_0x26fa('0x1c')][_0x26fa('0x1e')]||null:null,'attributes':_0x564c84[_0x26fa('0x1c')]?_0x564c84[_0x26fa('0x1c')][_0x26fa('0x22')]||null:null,'include':_0x564c84[_0x26fa('0x1c')]?_0x564c84[_0x26fa('0x1c')][_0x26fa('0x20')]?_[_0x26fa('0x21')](_0x564c84[_0x26fa('0x1c')][_0x26fa('0x20')],function(_0x8701fd){return{'model':db[_0x8701fd[_0x26fa('0x23')]],'as':_0x8701fd['as'],'attributes':_0x8701fd[_0x26fa('0x22')],'include':_0x8701fd['include']?_[_0x26fa('0x21')](_0x8701fd[_0x26fa('0x20')],function(_0x1fc25f){return{'model':db[_0x1fc25f[_0x26fa('0x23')]],'as':_0x1fc25f['as'],'attributes':_0x1fc25f[_0x26fa('0x22')],'include':_0x1fc25f[_0x26fa('0x20')]?_[_0x26fa('0x21')](_0x1fc25f[_0x26fa('0x20')],function(_0x3c4f3b){return{'model':db[_0x3c4f3b[_0x26fa('0x23')]],'as':_0x3c4f3b['as'],'attributes':_0x3c4f3b['attributes']};}):[]};}):[]};}):[]:[]})[_0x26fa('0xf')](function(_0x133ab4){logger[_0x26fa('0x17')](_0x26fa('0x24'),_0x564c84);logger[_0x26fa('0x12')](_0x26fa('0x24'),_0x564c84,JSON[_0x26fa('0x14')](_0x133ab4));_0xfd42f8(_0x133ab4);})['catch'](function(_0x109a29){logger[_0x26fa('0x15')](_0x26fa('0x24'),_0x109a29['message'],_0x564c84);_0x413a06(_0x178c98['error'](0x1f4,_0x109a29[_0x26fa('0x16')]));});});};exports[_0x26fa('0x25')]=function(_0x90356d){var _0x39ee8a=this;return new Promise(function(_0x5a6f00,_0x30c6c0){return db[_0x26fa('0x1b')][_0x26fa('0x26')](_0x90356d[_0x26fa('0x27')],{'raw':_0x90356d[_0x26fa('0x1c')]?_0x90356d['options'][_0x26fa('0x1d')]===undefined?!![]:![]:!![]})[_0x26fa('0xf')](function(_0x183334){logger[_0x26fa('0x17')](_0x26fa('0x25'),_0x90356d);logger[_0x26fa('0x12')](_0x26fa('0x25'),_0x90356d,JSON[_0x26fa('0x14')](_0x183334));_0x5a6f00(_0x183334);})[_0x26fa('0x19')](function(_0x3be127){logger[_0x26fa('0x15')](_0x26fa('0x25'),_0x3be127[_0x26fa('0x16')],_0x90356d);_0x30c6c0(_0x39ee8a[_0x26fa('0x15')](0x1f4,_0x3be127['message']));});});};exports[_0x26fa('0x28')]=function(_0x31fd72){var _0x367334=this;return new Promise(function(_0x3dab73,_0x49c837){return db[_0x26fa('0x1b')][_0x26fa('0x29')](_0x31fd72[_0x26fa('0x27')],{'raw':_0x31fd72[_0x26fa('0x1c')]?_0x31fd72['options'][_0x26fa('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31fd72['options']?_0x31fd72[_0x26fa('0x1c')][_0x26fa('0x1e')]||null:null,'attributes':_0x31fd72[_0x26fa('0x1c')]?_0x31fd72['options'][_0x26fa('0x22')]||null:null,'limit':_0x31fd72[_0x26fa('0x1c')]?_0x31fd72['options'][_0x26fa('0x1f')]||null:null})[_0x26fa('0xf')](function(_0x2e878b){logger['info'](_0x26fa('0x28'),_0x31fd72);logger[_0x26fa('0x12')](_0x26fa('0x28'),_0x31fd72,JSON[_0x26fa('0x14')](_0x2e878b));_0x3dab73(_0x2e878b);})['catch'](function(_0x48cbb2){logger[_0x26fa('0x15')](_0x26fa('0x28'),_0x48cbb2[_0x26fa('0x16')],_0x31fd72);_0x49c837(_0x367334[_0x26fa('0x15')](0x1f4,_0x48cbb2[_0x26fa('0x16')]));});});};exports[_0x26fa('0x2a')]=function(_0x5e8016){var _0x6cb20=this;return new Promise(function(_0x49f2ff,_0x32c47e){return db[_0x26fa('0x1b')]['destroy']({'where':_0x5e8016[_0x26fa('0x1c')]?_0x5e8016[_0x26fa('0x1c')][_0x26fa('0x1e')]||null:null})[_0x26fa('0xf')](function(_0x1271f2){logger['info'](_0x26fa('0x2a'),_0x5e8016);logger[_0x26fa('0x12')](_0x26fa('0x2a'),_0x5e8016,JSON[_0x26fa('0x14')](_0x1271f2));_0x49f2ff(_0x1271f2);})['catch'](function(_0x2eb7b4){logger[_0x26fa('0x15')](_0x26fa('0x2a'),_0x2eb7b4[_0x26fa('0x16')],_0x5e8016);_0x32c47e(_0x6cb20[_0x26fa('0x15')](0x1f4,_0x2eb7b4['message']));});});};exports[_0x26fa('0x2b')]=function(_0x3fc28a){var _0x5965b8=this;return new Promise(function(_0x5c95f1,_0x48a7c5){return db[_0x26fa('0x2c')][_0x26fa('0x2d')]()[_0x26fa('0xf')](function(_0x1ee1cc){return db[_0x26fa('0x2e')][_0x26fa('0x2f')](function(_0x430456){return db['CmHopper']['findAll']({'where':_0x3fc28a[_0x26fa('0x1c')]?_0x3fc28a[_0x26fa('0x1c')]['where']||null:null,'attributes':_0x3fc28a['options']?_0x3fc28a[_0x26fa('0x1c')]['attributes']||null:null,'limit':_0x3fc28a[_0x26fa('0x1c')]?_0x3fc28a['options'][_0x26fa('0x1f')]||null:null,'order':_0x3fc28a[_0x26fa('0x1c')]?_0x3fc28a[_0x26fa('0x1c')][_0x26fa('0x30')]||null:null,'transaction':_0x430456,'lock':_0x430456[_0x26fa('0x31')][_0x26fa('0x32')],'include':[{'model':db[_0x26fa('0x2c')],'as':_0x26fa('0x33'),'attributes':_[_0x26fa('0x34')](_0x1ee1cc)},{'model':db[_0x26fa('0x35')],'as':_0x26fa('0x36'),'attributes':['id','name',_0x26fa('0x37')]}]})['then'](function(_0x22cc8e){var _0x317b97=[];var _0x2b82d2=[];for(var _0x559a04=0x0;_0x559a04<_0x22cc8e[_0x26fa('0x38')];_0x559a04+=0x1){var _0xc76042=_0x22cc8e[_0x559a04][_0x26fa('0x39')];if(_0xc76042===null){_0x317b97[_0x26fa('0x3a')](_0x22cc8e[_0x559a04][_0x26fa('0x29')](_0x3fc28a[_0x26fa('0x27')],{'transaction':_0x430456}));}else if(!_0x2b82d2['includes'](_0xc76042)){_0x2b82d2[_0x26fa('0x3a')](_0xc76042);_0x317b97[_0x26fa('0x3a')](_0x22cc8e[_0x559a04][_0x26fa('0x29')](_0x3fc28a[_0x26fa('0x27')],{'transaction':_0x430456}));}}return BPromise['all'](_0x317b97);});})['then'](function(_0x38f0b3){logger['info'](_0x26fa('0x2b'),_0x3fc28a);logger[_0x26fa('0x12')]('GetContactDialer',_0x3fc28a,JSON[_0x26fa('0x14')](_0x38f0b3));_0x5c95f1(_0x38f0b3);})[_0x26fa('0x19')](function(_0x415f23){logger['error']('GetContactDialer',_0x415f23[_0x26fa('0x16')],_0x3fc28a);_0x48a7c5(_0x5965b8[_0x26fa('0x15')](0x1f4,_0x415f23[_0x26fa('0x16')]));});});});};exports[_0x26fa('0x3b')]=function(_0x48b892){var _0x1f0ca4=this;return new Promise(function(_0x57832e,_0xa95999){return db['sequelize'][_0x26fa('0x2f')](function(_0x882622){return db[_0x26fa('0x3c')]['create'](_0x48b892[_0x26fa('0x27')],{'raw':_0x48b892[_0x26fa('0x1c')]?_0x48b892['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x882622})[_0x26fa('0xf')](function(){return db[_0x26fa('0x1b')]['destroy']({'where':_0x48b892['options']?_0x48b892['options'][_0x26fa('0x1e')]||null:null,'transaction':_0x882622});});})[_0x26fa('0xf')](function(_0x29fb02){logger['info'](_0x26fa('0x3b'),_0x48b892);logger[_0x26fa('0x12')](_0x26fa('0x3b'),_0x48b892,JSON[_0x26fa('0x14')](_0x29fb02));_0x57832e(_0x29fb02);})[_0x26fa('0x19')](function(_0x9f70c6){logger['error'](_0x26fa('0x3b'),_0x9f70c6[_0x26fa('0x16')],_0x48b892);_0xa95999(_0x1f0ca4['error'](0x1f4,_0x9f70c6[_0x26fa('0x16')]));});});};exports[_0x26fa('0x3d')]=function(_0x1c2ed9){var _0x3f9b26=this;return new Promise(function(_0x2a4e69,_0x4bbadf){return db[_0x26fa('0x1b')][_0x26fa('0x3e')]({'raw':_0x1c2ed9[_0x26fa('0x1c')]?_0x1c2ed9['options'][_0x26fa('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c2ed9[_0x26fa('0x1c')]?_0x1c2ed9[_0x26fa('0x1c')][_0x26fa('0x1e')]||null:null,'attributes':[[db[_0x26fa('0x2e')]['fn'](_0x26fa('0x3f'),db['sequelize']['fn']('IF',db['sequelize'][_0x26fa('0x40')]('`scheduledat`\x20>=\x20'+util[_0x26fa('0x41')](_0x26fa('0x42'),moment()['format'](_0x26fa('0x43')))+'\x20,\x201,\x20null'))),_0x26fa('0x44')]]})[_0x26fa('0xf')](function(_0x56b17f){logger[_0x26fa('0x17')](_0x26fa('0x3d'),_0x1c2ed9);logger['debug']('CountReScheduled',_0x1c2ed9,JSON[_0x26fa('0x14')](_0x56b17f));_0x2a4e69(_0x56b17f);})[_0x26fa('0x19')](function(_0x291630){logger['error']('CountReScheduled',_0x291630[_0x26fa('0x16')],_0x1c2ed9);_0x4bbadf(_0x3f9b26[_0x26fa('0x15')](0x1f4,_0x291630['message']));});});};exports[_0x26fa('0x45')]=function(_0x831b13){var _0x4edaef=this;return new Promise(function(_0x429429,_0xda9521){return db[_0x26fa('0x2c')][_0x26fa('0x2d')]()['then'](function(_0x556a2a){return db[_0x26fa('0x2e')]['transaction'](function(_0x444fe0){return db[_0x26fa('0x1b')][_0x26fa('0x3e')]({'where':_0x831b13[_0x26fa('0x1c')]?_0x831b13[_0x26fa('0x1c')][_0x26fa('0x1e')]||null:null,'attributes':_0x831b13[_0x26fa('0x1c')]?_0x831b13['options'][_0x26fa('0x22')]||null:null,'limit':0x1,'order':_0x831b13[_0x26fa('0x1c')]?_0x831b13[_0x26fa('0x1c')][_0x26fa('0x30')]||null:null,'group':db[_0x26fa('0x1b')][_0x26fa('0x39')],'transaction':_0x444fe0,'lock':_0x444fe0['LOCK'][_0x26fa('0x32')],'include':_0x831b13[_0x26fa('0x1c')]?_0x831b13[_0x26fa('0x1c')][_0x26fa('0x20')]?_['map'](_0x831b13['options'][_0x26fa('0x20')],function(_0x279777){return{'model':db[_0x279777['model']],'as':_0x279777['as'],'attributes':_0x279777[_0x26fa('0x22')],'include':_0x279777[_0x26fa('0x20')]?_[_0x26fa('0x21')](_0x279777[_0x26fa('0x20')],function(_0x3426f9){return{'model':db[_0x3426f9[_0x26fa('0x23')]],'as':_0x3426f9['as'],'attributes':_0x3426f9[_0x26fa('0x22')],'include':_0x3426f9[_0x26fa('0x20')]?_['map'](_0x3426f9['include'],function(_0x4ddb0a){return{'model':db[_0x4ddb0a['model']],'as':_0x4ddb0a['as'],'attributes':_0x4ddb0a['attributes']};}):[]};}):[]};}):[]:[]})[_0x26fa('0xf')](function(_0x2f5529){var _0x556be0=[];for(var _0x3e37cc=0x0;_0x3e37cc<_0x2f5529[_0x26fa('0x38')];_0x3e37cc+=0x1){_0x556be0[_0x26fa('0x3a')](_0x2f5529[_0x3e37cc][_0x26fa('0x29')](_0x831b13[_0x26fa('0x27')],{'transaction':_0x444fe0}));}return BPromise['all'](_0x556be0);});})['then'](function(_0x5dcfcf){logger[_0x26fa('0x17')](_0x26fa('0x45'),_0x831b13);logger[_0x26fa('0x12')](_0x26fa('0x45'),_0x831b13,JSON[_0x26fa('0x14')](_0x5dcfcf));_0x429429(_0x5dcfcf);})[_0x26fa('0x19')](function(_0x506e28){logger[_0x26fa('0x15')](_0x26fa('0x45'),_0x506e28[_0x26fa('0x16')],_0x831b13);_0xda9521(_0x4edaef['error'](0x1f4,_0x506e28[_0x26fa('0x16')]));});});});};exports[_0x26fa('0x46')]=function(_0x276aa7){var _0x4649a7=this;return new Promise(function(_0x3b9755,_0x28dca3){db[_0x26fa('0x2c')]['describe']()[_0x26fa('0xf')](function(_0x394061){return db[_0x26fa('0x1b')][_0x26fa('0x3e')]({'raw':_0x276aa7[_0x26fa('0x1c')]?_0x276aa7[_0x26fa('0x1c')][_0x26fa('0x1d')]===undefined?!![]:![]:!![],'where':_0x276aa7['options']?_0x276aa7[_0x26fa('0x1c')][_0x26fa('0x1e')]||null:null,'attributes':_0x276aa7[_0x26fa('0x1c')]?_0x276aa7[_0x26fa('0x1c')][_0x26fa('0x22')]||null:null,'limit':_0x276aa7['options']?_0x276aa7['options'][_0x26fa('0x1f')]||null:null,'include':_0x276aa7[_0x26fa('0x1c')]?_0x276aa7['options']['include']?_['map'](_0x276aa7[_0x26fa('0x1c')]['include'],function(_0x48ddb6){return{'model':db[_0x48ddb6[_0x26fa('0x23')]],'as':_0x48ddb6['as'],'attributes':_0x48ddb6['as']===_0x26fa('0x33')?_[_0x26fa('0x34')](_0x394061):_0x48ddb6[_0x26fa('0x22')],'include':_0x48ddb6[_0x26fa('0x20')]?_[_0x26fa('0x21')](_0x48ddb6[_0x26fa('0x20')],function(_0x4ae41e){return{'model':db[_0x4ae41e[_0x26fa('0x23')]],'as':_0x4ae41e['as'],'attributes':_0x4ae41e[_0x26fa('0x22')],'include':_0x4ae41e[_0x26fa('0x20')]?_[_0x26fa('0x21')](_0x4ae41e[_0x26fa('0x20')],function(_0x3ae21c){return{'model':db[_0x3ae21c[_0x26fa('0x23')]],'as':_0x3ae21c['as'],'attributes':_0x3ae21c['attributes']};}):[]};}):[]};}):[]:[]})[_0x26fa('0xf')](function(_0x2dab03){logger[_0x26fa('0x17')]('GetCmHopper',_0x276aa7);logger[_0x26fa('0x12')]('GetCmHopper',_0x276aa7,JSON['stringify'](_0x2dab03));_0x3b9755(_0x2dab03);})[_0x26fa('0x19')](function(_0x350c1c){logger[_0x26fa('0x15')]('GetCmHopper',_0x350c1c['message'],_0x276aa7);_0x28dca3(_0x4649a7['error'](0x1f4,_0x350c1c['message']));});});});}; \ No newline at end of file +var _0x29b3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','map','include','model','info','catch','ShowCmHopper','find','raw','create','body','debug','CreateCmHopper','update','UpdateCmHopper','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','UPDATE','Contact','User','name','voicePause','length','UserId','includes','push','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','LOCK','GetContactRecallMe','keys','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x331352,_0x329457){var _0x448f0a=function(_0x2c7cee){while(--_0x2c7cee){_0x331352['push'](_0x331352['shift']());}};_0x448f0a(++_0x329457);}(_0x29b3,0x11a));var _0x329b=function(_0x31de83,_0xf24103){_0x31de83=_0x31de83-0x0;var _0x4ddcb2=_0x29b3[_0x31de83];return _0x4ddcb2;};'use strict';var _=require(_0x329b('0x0'));var util=require(_0x329b('0x1'));var moment=require(_0x329b('0x2'));var BPromise=require(_0x329b('0x3'));var rs=require(_0x329b('0x4'));var fs=require('fs');var Redis=require(_0x329b('0x5'));var db=require(_0x329b('0x6'))['db'];var utils=require(_0x329b('0x7'));var logger=require(_0x329b('0x8'))(_0x329b('0x9'));var config=require(_0x329b('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x329b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37274e,_0x24c079,_0x2913ba){return new BPromise(function(_0x4b42c6,_0x3d7859){return client[_0x329b('0xc')](_0x37274e,_0x2913ba)[_0x329b('0xd')](function(_0x36dda2){logger['info'](_0x329b('0xe'),_0x24c079,_0x329b('0xf'));logger['debug'](_0x329b('0x10'),_0x24c079,'request\x20sent',JSON[_0x329b('0x11')](_0x36dda2));if(_0x36dda2[_0x329b('0x12')]){if(_0x36dda2[_0x329b('0x12')]['code']===0x1f4){logger[_0x329b('0x12')](_0x329b('0xe'),_0x24c079,_0x36dda2['error'][_0x329b('0x13')]);return _0x3d7859(_0x36dda2[_0x329b('0x12')][_0x329b('0x13')]);}logger[_0x329b('0x12')](_0x329b('0xe'),_0x24c079,_0x36dda2[_0x329b('0x12')][_0x329b('0x13')]);return _0x4b42c6(_0x36dda2['error']['message']);}else{logger['info'](_0x329b('0xe'),_0x24c079,_0x329b('0xf'));_0x4b42c6(_0x36dda2[_0x329b('0x14')][_0x329b('0x13')]);}})['catch'](function(_0x9c70a9){logger[_0x329b('0x12')]('CmHopper,\x20%s,\x20%s',_0x24c079,_0x9c70a9);_0x3d7859(_0x9c70a9);});});}exports[_0x329b('0x15')]=function(_0x413ff2){var _0x2b598d=this;return new Promise(function(_0x3f8ec5,_0x932601){return db[_0x329b('0x16')][_0x329b('0x17')]({'raw':_0x413ff2[_0x329b('0x18')]?_0x413ff2['options']['raw']===undefined?!![]:![]:!![],'where':_0x413ff2['options']?_0x413ff2[_0x329b('0x18')][_0x329b('0x19')]||null:null,'attributes':_0x413ff2[_0x329b('0x18')]?_0x413ff2['options'][_0x329b('0x1a')]||null:null,'limit':_0x413ff2[_0x329b('0x18')]?_0x413ff2[_0x329b('0x18')][_0x329b('0x1b')]||null:null,'include':_0x413ff2[_0x329b('0x18')]?_0x413ff2[_0x329b('0x18')]['include']?_[_0x329b('0x1c')](_0x413ff2[_0x329b('0x18')][_0x329b('0x1d')],function(_0xc36005){return{'model':db[_0xc36005[_0x329b('0x1e')]],'as':_0xc36005['as'],'attributes':_0xc36005['attributes'],'include':_0xc36005['include']?_[_0x329b('0x1c')](_0xc36005[_0x329b('0x1d')],function(_0x5a2535){return{'model':db[_0x5a2535[_0x329b('0x1e')]],'as':_0x5a2535['as'],'attributes':_0x5a2535[_0x329b('0x1a')],'include':_0x5a2535[_0x329b('0x1d')]?_[_0x329b('0x1c')](_0x5a2535[_0x329b('0x1d')],function(_0x4c203c){return{'model':db[_0x4c203c['model']],'as':_0x4c203c['as'],'attributes':_0x4c203c[_0x329b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x329b('0xd')](function(_0x2fcb71){logger[_0x329b('0x1f')](_0x329b('0x15'),_0x413ff2);logger['debug']('GetCmHopper',_0x413ff2,JSON[_0x329b('0x11')](_0x2fcb71));_0x3f8ec5(_0x2fcb71);})[_0x329b('0x20')](function(_0x5d1ef0){logger['error'](_0x329b('0x15'),_0x5d1ef0[_0x329b('0x13')],_0x413ff2);_0x932601(_0x2b598d[_0x329b('0x12')](0x1f4,_0x5d1ef0[_0x329b('0x13')]));});});};exports[_0x329b('0x21')]=function(_0x58685a){var _0x307ce9=this;return new Promise(function(_0x3d7ed5,_0x1ae3e3){return db[_0x329b('0x16')][_0x329b('0x22')]({'raw':_0x58685a[_0x329b('0x18')]?_0x58685a['options'][_0x329b('0x23')]===undefined?!![]:![]:!![],'where':_0x58685a[_0x329b('0x18')]?_0x58685a[_0x329b('0x18')]['where']||null:null,'attributes':_0x58685a[_0x329b('0x18')]?_0x58685a['options'][_0x329b('0x1a')]||null:null,'include':_0x58685a[_0x329b('0x18')]?_0x58685a[_0x329b('0x18')][_0x329b('0x1d')]?_['map'](_0x58685a['options'][_0x329b('0x1d')],function(_0x473a3c){return{'model':db[_0x473a3c['model']],'as':_0x473a3c['as'],'attributes':_0x473a3c[_0x329b('0x1a')],'include':_0x473a3c['include']?_[_0x329b('0x1c')](_0x473a3c[_0x329b('0x1d')],function(_0x15d2da){return{'model':db[_0x15d2da['model']],'as':_0x15d2da['as'],'attributes':_0x15d2da[_0x329b('0x1a')],'include':_0x15d2da[_0x329b('0x1d')]?_[_0x329b('0x1c')](_0x15d2da[_0x329b('0x1d')],function(_0xa7a602){return{'model':db[_0xa7a602[_0x329b('0x1e')]],'as':_0xa7a602['as'],'attributes':_0xa7a602['attributes']};}):[]};}):[]};}):[]:[]})[_0x329b('0xd')](function(_0x3e4dc0){logger[_0x329b('0x1f')]('ShowCmHopper',_0x58685a);logger['debug'](_0x329b('0x21'),_0x58685a,JSON[_0x329b('0x11')](_0x3e4dc0));_0x3d7ed5(_0x3e4dc0);})['catch'](function(_0x95959c){logger[_0x329b('0x12')](_0x329b('0x21'),_0x95959c['message'],_0x58685a);_0x1ae3e3(_0x307ce9[_0x329b('0x12')](0x1f4,_0x95959c[_0x329b('0x13')]));});});};exports['CreateCmHopper']=function(_0x5d824e){var _0x396e9b=this;return new Promise(function(_0x3aef93,_0x1ce580){return db[_0x329b('0x16')][_0x329b('0x24')](_0x5d824e[_0x329b('0x25')],{'raw':_0x5d824e['options']?_0x5d824e[_0x329b('0x18')][_0x329b('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x14958f){logger[_0x329b('0x1f')]('CreateCmHopper',_0x5d824e);logger[_0x329b('0x26')](_0x329b('0x27'),_0x5d824e,JSON[_0x329b('0x11')](_0x14958f));_0x3aef93(_0x14958f);})['catch'](function(_0x4e4525){logger['error'](_0x329b('0x27'),_0x4e4525[_0x329b('0x13')],_0x5d824e);_0x1ce580(_0x396e9b['error'](0x1f4,_0x4e4525[_0x329b('0x13')]));});});};exports['UpdateCmHopper']=function(_0x43c40a){var _0x39a4f8=this;return new Promise(function(_0x2388aa,_0x55c80e){return db[_0x329b('0x16')][_0x329b('0x28')](_0x43c40a[_0x329b('0x25')],{'raw':_0x43c40a[_0x329b('0x18')]?_0x43c40a[_0x329b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43c40a[_0x329b('0x18')]?_0x43c40a['options'][_0x329b('0x19')]||null:null,'attributes':_0x43c40a['options']?_0x43c40a['options'][_0x329b('0x1a')]||null:null,'limit':_0x43c40a[_0x329b('0x18')]?_0x43c40a[_0x329b('0x18')]['limit']||null:null})[_0x329b('0xd')](function(_0x1e888f){logger[_0x329b('0x1f')]('UpdateCmHopper',_0x43c40a);logger['debug'](_0x329b('0x29'),_0x43c40a,JSON['stringify'](_0x1e888f));_0x2388aa(_0x1e888f);})[_0x329b('0x20')](function(_0x18e01a){logger[_0x329b('0x12')](_0x329b('0x29'),_0x18e01a[_0x329b('0x13')],_0x43c40a);_0x55c80e(_0x39a4f8[_0x329b('0x12')](0x1f4,_0x18e01a[_0x329b('0x13')]));});});};exports[_0x329b('0x2a')]=function(_0x1d9010){var _0x595875=this;return new Promise(function(_0x1719b2,_0xd503f8){return db[_0x329b('0x16')]['destroy']({'where':_0x1d9010[_0x329b('0x18')]?_0x1d9010[_0x329b('0x18')][_0x329b('0x19')]||null:null})[_0x329b('0xd')](function(_0x916aee){logger[_0x329b('0x1f')](_0x329b('0x2a'),_0x1d9010);logger[_0x329b('0x26')](_0x329b('0x2a'),_0x1d9010,JSON[_0x329b('0x11')](_0x916aee));_0x1719b2(_0x916aee);})[_0x329b('0x20')](function(_0x1789b1){logger[_0x329b('0x12')]('DestroyCmHopper',_0x1789b1[_0x329b('0x13')],_0x1d9010);_0xd503f8(_0x595875[_0x329b('0x12')](0x1f4,_0x1789b1[_0x329b('0x13')]));});});};exports[_0x329b('0x2b')]=function(_0x48c858){var _0xe5663c=this;return new Promise(function(_0x1af12c,_0x2d2c7b){return db[_0x329b('0x2c')][_0x329b('0x2d')]()['then'](function(_0x267d1b){return db[_0x329b('0x2e')][_0x329b('0x2f')](function(_0x5dd18d){return db['CmHopper'][_0x329b('0x17')]({'where':_0x48c858['options']?_0x48c858[_0x329b('0x18')][_0x329b('0x19')]||null:null,'attributes':_0x48c858[_0x329b('0x18')]?_0x48c858[_0x329b('0x18')][_0x329b('0x1a')]||null:null,'limit':_0x48c858[_0x329b('0x18')]?_0x48c858[_0x329b('0x18')][_0x329b('0x1b')]||null:null,'order':_0x48c858[_0x329b('0x18')]?_0x48c858[_0x329b('0x18')][_0x329b('0x30')]||null:null,'transaction':_0x5dd18d,'lock':_0x5dd18d['LOCK'][_0x329b('0x31')],'include':[{'model':db[_0x329b('0x2c')],'as':_0x329b('0x32'),'attributes':_['keys'](_0x267d1b)},{'model':db[_0x329b('0x33')],'as':'Agent','attributes':['id',_0x329b('0x34'),_0x329b('0x35')]}]})[_0x329b('0xd')](function(_0x34707c){var _0x35d1d1=[];var _0x2e9988=[];for(var _0x4f29d2=0x0;_0x4f29d2<_0x34707c[_0x329b('0x36')];_0x4f29d2+=0x1){var _0x47d0ed=_0x34707c[_0x4f29d2][_0x329b('0x37')];if(_0x47d0ed===null){_0x35d1d1['push'](_0x34707c[_0x4f29d2][_0x329b('0x28')](_0x48c858[_0x329b('0x25')],{'transaction':_0x5dd18d}));}else if(!_0x2e9988[_0x329b('0x38')](_0x47d0ed)){_0x2e9988[_0x329b('0x39')](_0x47d0ed);_0x35d1d1[_0x329b('0x39')](_0x34707c[_0x4f29d2][_0x329b('0x28')](_0x48c858[_0x329b('0x25')],{'transaction':_0x5dd18d}));}}return BPromise[_0x329b('0x3a')](_0x35d1d1);});})['then'](function(_0x106d9e){logger[_0x329b('0x1f')](_0x329b('0x2b'),_0x48c858);logger[_0x329b('0x26')](_0x329b('0x2b'),_0x48c858,JSON[_0x329b('0x11')](_0x106d9e));_0x1af12c(_0x106d9e);})[_0x329b('0x20')](function(_0x4c277e){logger[_0x329b('0x12')](_0x329b('0x2b'),_0x4c277e['message'],_0x48c858);_0x2d2c7b(_0xe5663c[_0x329b('0x12')](0x1f4,_0x4c277e[_0x329b('0x13')]));});});});};exports[_0x329b('0x3b')]=function(_0x178116){var _0x4b0e7d=this;return new Promise(function(_0x3e171a,_0x44f417){return db['sequelize'][_0x329b('0x2f')](function(_0x33a09f){return db[_0x329b('0x3c')]['create'](_0x178116['body'],{'raw':_0x178116[_0x329b('0x18')]?_0x178116[_0x329b('0x18')]['raw']===undefined?!![]:![]:!![],'transaction':_0x33a09f})[_0x329b('0xd')](function(){return db[_0x329b('0x16')]['destroy']({'where':_0x178116['options']?_0x178116[_0x329b('0x18')][_0x329b('0x19')]||null:null,'transaction':_0x33a09f});});})[_0x329b('0xd')](function(_0x226bdc){logger[_0x329b('0x1f')](_0x329b('0x3b'),_0x178116);logger[_0x329b('0x26')](_0x329b('0x3b'),_0x178116,JSON[_0x329b('0x11')](_0x226bdc));_0x3e171a(_0x226bdc);})[_0x329b('0x20')](function(_0x4e03c1){logger['error'](_0x329b('0x3b'),_0x4e03c1[_0x329b('0x13')],_0x178116);_0x44f417(_0x4b0e7d[_0x329b('0x12')](0x1f4,_0x4e03c1['message']));});});};exports[_0x329b('0x3d')]=function(_0x51cd13){var _0x331af6=this;return new Promise(function(_0x28a92f,_0x312f8d){return db[_0x329b('0x16')][_0x329b('0x17')]({'raw':_0x51cd13[_0x329b('0x18')]?_0x51cd13[_0x329b('0x18')][_0x329b('0x23')]===undefined?!![]:![]:!![],'where':_0x51cd13[_0x329b('0x18')]?_0x51cd13[_0x329b('0x18')][_0x329b('0x19')]||null:null,'attributes':[[db[_0x329b('0x2e')]['fn'](_0x329b('0x3e'),db['sequelize']['fn']('IF',db['sequelize'][_0x329b('0x3f')](_0x329b('0x40')+util[_0x329b('0x41')](_0x329b('0x42'),moment()[_0x329b('0x41')](_0x329b('0x43')))+_0x329b('0x44')))),'contactsRescheduled']]})[_0x329b('0xd')](function(_0x359367){logger[_0x329b('0x1f')]('CountReScheduled',_0x51cd13);logger[_0x329b('0x26')]('CountReScheduled',_0x51cd13,JSON[_0x329b('0x11')](_0x359367));_0x28a92f(_0x359367);})['catch'](function(_0x353511){logger[_0x329b('0x12')](_0x329b('0x3d'),_0x353511[_0x329b('0x13')],_0x51cd13);_0x312f8d(_0x331af6['error'](0x1f4,_0x353511[_0x329b('0x13')]));});});};exports['GetContactRecallMe']=function(_0x2e7910){var _0x45f8f1=this;return new Promise(function(_0x3440f5,_0x4b9ca8){return db[_0x329b('0x2c')][_0x329b('0x2d')]()[_0x329b('0xd')](function(_0x5cf4e7){return db['sequelize']['transaction'](function(_0x41d3a8){return db[_0x329b('0x16')]['findAll']({'where':_0x2e7910[_0x329b('0x18')]?_0x2e7910['options']['where']||null:null,'attributes':_0x2e7910[_0x329b('0x18')]?_0x2e7910[_0x329b('0x18')][_0x329b('0x1a')]||null:null,'limit':0x1,'order':_0x2e7910[_0x329b('0x18')]?_0x2e7910[_0x329b('0x18')][_0x329b('0x30')]||null:null,'group':db[_0x329b('0x16')][_0x329b('0x37')],'transaction':_0x41d3a8,'lock':_0x41d3a8[_0x329b('0x45')][_0x329b('0x31')],'include':_0x2e7910[_0x329b('0x18')]?_0x2e7910[_0x329b('0x18')]['include']?_[_0x329b('0x1c')](_0x2e7910['options'][_0x329b('0x1d')],function(_0x4eab00){return{'model':db[_0x4eab00[_0x329b('0x1e')]],'as':_0x4eab00['as'],'attributes':_0x4eab00[_0x329b('0x1a')],'include':_0x4eab00['include']?_['map'](_0x4eab00[_0x329b('0x1d')],function(_0x5819e7){return{'model':db[_0x5819e7['model']],'as':_0x5819e7['as'],'attributes':_0x5819e7['attributes'],'include':_0x5819e7[_0x329b('0x1d')]?_[_0x329b('0x1c')](_0x5819e7[_0x329b('0x1d')],function(_0x165567){return{'model':db[_0x165567[_0x329b('0x1e')]],'as':_0x165567['as'],'attributes':_0x165567[_0x329b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x329b('0xd')](function(_0x205377){var _0x586580=[];for(var _0xee3063=0x0;_0xee3063<_0x205377[_0x329b('0x36')];_0xee3063+=0x1){_0x586580[_0x329b('0x39')](_0x205377[_0xee3063]['update'](_0x2e7910[_0x329b('0x25')],{'transaction':_0x41d3a8}));}return BPromise[_0x329b('0x3a')](_0x586580);});})[_0x329b('0xd')](function(_0x423b9){logger['info'](_0x329b('0x46'),_0x2e7910);logger[_0x329b('0x26')](_0x329b('0x46'),_0x2e7910,JSON[_0x329b('0x11')](_0x423b9));_0x3440f5(_0x423b9);})[_0x329b('0x20')](function(_0x23315a){logger[_0x329b('0x12')](_0x329b('0x46'),_0x23315a[_0x329b('0x13')],_0x2e7910);_0x4b9ca8(_0x45f8f1[_0x329b('0x12')](0x1f4,_0x23315a['message']));});});});};exports['GetCmHopperPreview']=function(_0x34dfdd){var _0x4477db=this;return new Promise(function(_0x1ecb2a,_0x116d1d){db['CmContact'][_0x329b('0x2d')]()[_0x329b('0xd')](function(_0x279275){return db[_0x329b('0x16')][_0x329b('0x17')]({'raw':_0x34dfdd['options']?_0x34dfdd[_0x329b('0x18')][_0x329b('0x23')]===undefined?!![]:![]:!![],'where':_0x34dfdd[_0x329b('0x18')]?_0x34dfdd[_0x329b('0x18')]['where']||null:null,'attributes':_0x34dfdd['options']?_0x34dfdd[_0x329b('0x18')]['attributes']||null:null,'limit':_0x34dfdd[_0x329b('0x18')]?_0x34dfdd[_0x329b('0x18')][_0x329b('0x1b')]||null:null,'include':_0x34dfdd['options']?_0x34dfdd[_0x329b('0x18')][_0x329b('0x1d')]?_[_0x329b('0x1c')](_0x34dfdd[_0x329b('0x18')][_0x329b('0x1d')],function(_0x5b917a){return{'model':db[_0x5b917a[_0x329b('0x1e')]],'as':_0x5b917a['as'],'attributes':_0x5b917a['as']===_0x329b('0x32')?_[_0x329b('0x47')](_0x279275):_0x5b917a[_0x329b('0x1a')],'include':_0x5b917a[_0x329b('0x1d')]?_[_0x329b('0x1c')](_0x5b917a[_0x329b('0x1d')],function(_0x413765){return{'model':db[_0x413765[_0x329b('0x1e')]],'as':_0x413765['as'],'attributes':_0x413765[_0x329b('0x1a')],'include':_0x413765['include']?_[_0x329b('0x1c')](_0x413765[_0x329b('0x1d')],function(_0x355b15){return{'model':db[_0x355b15[_0x329b('0x1e')]],'as':_0x355b15['as'],'attributes':_0x355b15[_0x329b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f5493){logger['info']('GetCmHopper',_0x34dfdd);logger['debug'](_0x329b('0x15'),_0x34dfdd,JSON[_0x329b('0x11')](_0x2f5493));_0x1ecb2a(_0x2f5493);})[_0x329b('0x20')](function(_0x594cd7){logger[_0x329b('0x12')](_0x329b('0x15'),_0x594cd7[_0x329b('0x13')],_0x34dfdd);_0x116d1d(_0x4477db['error'](0x1f4,_0x594cd7[_0x329b('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 4a0ce33..0a71724 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 _0x9bd1=['describe','/opencontacts','getOpenContacts','/:id','post','create','/preview','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','/describe'];(function(_0x13c296,_0x1a5a14){var _0x274484=function(_0xf2d433){while(--_0xf2d433){_0x13c296['push'](_0x13c296['shift']());}};_0x274484(++_0x1a5a14);}(_0x9bd1,0x155));var _0x19bd=function(_0x4a2cd4,_0x379bc6){_0x4a2cd4=_0x4a2cd4-0x0;var _0x2a687d=_0x9bd1[_0x4a2cd4];return _0x2a687d;};'use strict';var multer=require(_0x19bd('0x0'));var util=require(_0x19bd('0x1'));var path=require(_0x19bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x19bd('0x3'));var router=express[_0x19bd('0x4')]();var fs_extra=require(_0x19bd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x19bd('0x6'));var config=require('../../config/environment');var controller=require(_0x19bd('0x7'));router[_0x19bd('0x8')]('/',auth[_0x19bd('0x9')](),controller['index']);router['get'](_0x19bd('0xa'),auth['isAuthenticated'](),controller[_0x19bd('0xb')]);router[_0x19bd('0x8')](_0x19bd('0xc'),auth[_0x19bd('0x9')](),controller[_0x19bd('0xd')]);router[_0x19bd('0x8')](_0x19bd('0xe'),auth[_0x19bd('0x9')](),controller['show']);router[_0x19bd('0xf')]('/',auth['isAuthenticated'](),controller[_0x19bd('0x10')]);router[_0x19bd('0xf')](_0x19bd('0x11'),auth[_0x19bd('0x9')](),controller['getPreview']);router[_0x19bd('0x12')](_0x19bd('0xe'),auth[_0x19bd('0x9')](),controller[_0x19bd('0x13')]);router[_0x19bd('0x14')](_0x19bd('0xe'),auth['isAuthenticated'](),controller[_0x19bd('0x15')]);module['exports']=router; \ No newline at end of file +var _0x29be=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','/:id','show','create','post','/preview','getPreview','put','update','destroy','multer','util','connect-timeout','express'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x29be,0xdd));var _0xe29b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x29be[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xe29b('0x0'));var util=require(_0xe29b('0x1'));var path=require('path');var timeout=require(_0xe29b('0x2'));var express=require(_0xe29b('0x3'));var router=express[_0xe29b('0x4')]();var fs_extra=require(_0xe29b('0x5'));var auth=require(_0xe29b('0x6'));var interaction=require(_0xe29b('0x7'));var config=require(_0xe29b('0x8'));var controller=require(_0xe29b('0x9'));router[_0xe29b('0xa')]('/',auth[_0xe29b('0xb')](),controller[_0xe29b('0xc')]);router['get']('/describe',auth[_0xe29b('0xb')](),controller[_0xe29b('0xd')]);router[_0xe29b('0xa')](_0xe29b('0xe'),auth['isAuthenticated'](),controller[_0xe29b('0xf')]);router[_0xe29b('0xa')](_0xe29b('0x10'),auth[_0xe29b('0xb')](),controller[_0xe29b('0x11')]);router['post']('/',auth[_0xe29b('0xb')](),controller[_0xe29b('0x12')]);router[_0xe29b('0x13')](_0xe29b('0x14'),auth['isAuthenticated'](),controller[_0xe29b('0x15')]);router[_0xe29b('0x16')](_0xe29b('0x10'),auth['isAuthenticated'](),controller[_0xe29b('0x17')]);router['delete']('/:id',auth[_0xe29b('0xb')](),controller[_0xe29b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9cb736f..c7ee5de 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 _0xfb15=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xfb15,0x12f));var _0x5fb1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfb15[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0x5fb1('0x0'));var Sequelize=require(_0x5fb1('0x1'));module[_0x5fb1('0x2')]={'phone':{'type':Sequelize[_0x5fb1('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x5fb1('0x4')],'unique':_0x5fb1('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x5fb1('0x5')},'VoiceQueueId':{'type':Sequelize[_0x5fb1('0x4')],'unique':_0x5fb1('0x5')}}; \ No newline at end of file +var _0xb35d=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb35d,0x14b));var _0xdb35=function(_0x47794f,_0x12c9b3){_0x47794f=_0x47794f-0x0;var _0x2ca51d=_0xb35d[_0x47794f];return _0x2ca51d;};'use strict';var moment=require(_0xdb35('0x0'));var Sequelize=require(_0xdb35('0x1'));module[_0xdb35('0x2')]={'phone':{'type':Sequelize[_0xdb35('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xdb35('0x4')],'unique':_0xdb35('0x5')},'ListId':{'type':Sequelize[_0xdb35('0x4')],'unique':_0xdb35('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xdb35('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index eab2e40..7ac6065 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 _0x8c30=['index','map','CmHopperBlack','fieldName','type','key','model','query','attributes','fields','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','length','find','update','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','save','then','stack','name','send'];(function(_0x3fc501,_0x2c62f1){var _0x400f71=function(_0x5bff40){while(--_0x5bff40){_0x3fc501['push'](_0x3fc501['shift']());}};_0x400f71(++_0x2c62f1);}(_0x8c30,0x18f));var _0x08c3=function(_0x33ff24,_0x95ea7c){_0x33ff24=_0x33ff24-0x0;var _0x4c823a=_0x8c30[_0x33ff24];return _0x4c823a;};'use strict';var emlformat=require(_0x08c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x08c3('0x1'));var jsonpatch=require(_0x08c3('0x2'));var rp=require(_0x08c3('0x3'));var moment=require(_0x08c3('0x4'));var BPromise=require(_0x08c3('0x5'));var Mustache=require(_0x08c3('0x6'));var util=require(_0x08c3('0x7'));var path=require(_0x08c3('0x8'));var sox=require(_0x08c3('0x9'));var csv=require('to-csv');var ejs=require(_0x08c3('0xa'));var fs=require('fs');var fs_extra=require(_0x08c3('0xb'));var _=require(_0x08c3('0xc'));var squel=require('squel');var crypto=require(_0x08c3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x08c3('0xe'));var querystring=require(_0x08c3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x08c3('0x10'));var qs=require(_0x08c3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08c3('0x12'));var logger=require(_0x08c3('0x13'))(_0x08c3('0x14'));var utils=require(_0x08c3('0x15'));var config=require(_0x08c3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x08c3('0x17'))['db'];function respondWithStatusCode(_0x3d2686,_0x388337){_0x388337=_0x388337||0xcc;return function(_0x194896){if(_0x194896){return _0x3d2686[_0x08c3('0x18')](_0x388337);}return _0x3d2686['status'](_0x388337)[_0x08c3('0x19')]();};}function respondWithResult(_0x189e96,_0x416b92){_0x416b92=_0x416b92||0xc8;return function(_0x40d511){if(_0x40d511){return _0x189e96[_0x08c3('0x1a')](_0x416b92)[_0x08c3('0x1b')](_0x40d511);}};}function respondWithFilteredResult(_0x6bfb49,_0x591d59){return function(_0x8aba58){if(_0x8aba58){var _0x3ac8bd=typeof _0x591d59['offset']===_0x08c3('0x1c')&&typeof _0x591d59[_0x08c3('0x1d')]==='undefined';var _0x5d93fa=_0x8aba58[_0x08c3('0x1e')];var _0x542f0a=_0x3ac8bd?0x0:_0x591d59[_0x08c3('0x1f')];var _0x80062=_0x3ac8bd?_0x8aba58[_0x08c3('0x1e')]:_0x591d59[_0x08c3('0x1f')]+_0x591d59[_0x08c3('0x1d')];var _0x2499b8;if(_0x80062>=_0x5d93fa){_0x80062=_0x5d93fa;_0x2499b8=0xc8;}else{_0x2499b8=0xce;}_0x6bfb49['status'](_0x2499b8);return _0x6bfb49[_0x08c3('0x20')]('Content-Range',_0x542f0a+'-'+_0x80062+'/'+_0x5d93fa)[_0x08c3('0x1b')](_0x8aba58);}return null;};}function patchUpdates(_0x21e8fa){return function(_0x5373c1){try{jsonpatch['apply'](_0x5373c1,_0x21e8fa,!![]);}catch(_0x25f639){return BPromise[_0x08c3('0x21')](_0x25f639);}return _0x5373c1[_0x08c3('0x22')]();};}function saveUpdates(_0x2d3f92,_0x17f014){return function(_0x25a2ed){if(_0x25a2ed){return _0x25a2ed['update'](_0x2d3f92)[_0x08c3('0x23')](function(_0x48e5d4){return _0x48e5d4;});}return null;};}function removeEntity(_0x430b2a,_0x31d266){return function(_0x51ce56){if(_0x51ce56){return _0x51ce56['destroy']()[_0x08c3('0x23')](function(){_0x430b2a[_0x08c3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x292e38,_0x4e2964){return function(_0x386e40){if(!_0x386e40){_0x292e38[_0x08c3('0x18')](0x194);}return _0x386e40;};}function handleError(_0x4bc4a8,_0x1e8056){_0x1e8056=_0x1e8056||0x1f4;return function(_0x4ab59c){logger['error'](_0x4ab59c[_0x08c3('0x24')]);if(_0x4ab59c['name']){delete _0x4ab59c[_0x08c3('0x25')];}_0x4bc4a8[_0x08c3('0x1a')](_0x1e8056)[_0x08c3('0x26')](_0x4ab59c);};}exports[_0x08c3('0x27')]=function(_0x36d86e,_0x1c5285){var _0x48d539={},_0x3cbe54={},_0x556e87={'count':0x0,'rows':[]};var _0x3b93e8=_[_0x08c3('0x28')](db[_0x08c3('0x29')]['rawAttributes'],function(_0x1346e7){return{'name':_0x1346e7[_0x08c3('0x2a')],'type':_0x1346e7[_0x08c3('0x2b')][_0x08c3('0x2c')]};});_0x3cbe54[_0x08c3('0x2d')]=_[_0x08c3('0x28')](_0x3b93e8,_0x08c3('0x25'));_0x3cbe54[_0x08c3('0x2e')]=_['keys'](_0x36d86e[_0x08c3('0x2e')]);_0x3cbe54['filters']=_['intersection'](_0x3cbe54['model'],_0x3cbe54[_0x08c3('0x2e')]);_0x48d539[_0x08c3('0x2f')]=_['intersection'](_0x3cbe54[_0x08c3('0x2d')],qs[_0x08c3('0x30')](_0x36d86e[_0x08c3('0x2e')][_0x08c3('0x30')]));_0x48d539['attributes']=_0x48d539['attributes']['length']?_0x48d539[_0x08c3('0x2f')]:_0x3cbe54['model'];if(!_0x36d86e[_0x08c3('0x2e')][_0x08c3('0x31')]('nolimit')){_0x48d539[_0x08c3('0x1d')]=qs[_0x08c3('0x1d')](_0x36d86e[_0x08c3('0x2e')][_0x08c3('0x1d')]);_0x48d539[_0x08c3('0x1f')]=qs[_0x08c3('0x1f')](_0x36d86e[_0x08c3('0x2e')][_0x08c3('0x1f')]);}_0x48d539[_0x08c3('0x32')]=qs[_0x08c3('0x33')](_0x36d86e['query'][_0x08c3('0x33')]);_0x48d539[_0x08c3('0x34')]=qs['filters'](_['pick'](_0x36d86e[_0x08c3('0x2e')],_0x3cbe54[_0x08c3('0x35')]),_0x3b93e8);if(_0x36d86e['query']['filter']){_0x48d539[_0x08c3('0x34')]=_[_0x08c3('0x36')](_0x48d539[_0x08c3('0x34')],{'$or':_[_0x08c3('0x28')](_0x3b93e8,function(_0x2b7702){if(_0x2b7702['type']!==_0x08c3('0x37')){var _0x2044e6={};_0x2044e6[_0x2b7702[_0x08c3('0x25')]]={'$like':'%'+_0x36d86e[_0x08c3('0x2e')]['filter']+'%'};return _0x2044e6;}})});}_0x48d539=_[_0x08c3('0x36')]({},_0x48d539,_0x36d86e[_0x08c3('0x38')]);var _0x564027={'where':_0x48d539[_0x08c3('0x34')]};return db[_0x08c3('0x29')][_0x08c3('0x1e')](_0x564027)[_0x08c3('0x23')](function(_0x441949){_0x556e87['count']=_0x441949;if(_0x36d86e[_0x08c3('0x2e')][_0x08c3('0x39')]){_0x48d539[_0x08c3('0x3a')]=[{'all':!![]}];}return db[_0x08c3('0x29')][_0x08c3('0x3b')](_0x48d539);})['then'](function(_0xc260df){_0x556e87[_0x08c3('0x3c')]=_0xc260df;return _0x556e87;})['then'](respondWithFilteredResult(_0x1c5285,_0x48d539))[_0x08c3('0x3d')](handleError(_0x1c5285,null));};exports[_0x08c3('0x3e')]=function(_0x3d1987,_0x48b832){var _0x13b2ed={'raw':!![],'where':{'id':_0x3d1987[_0x08c3('0x3f')]['id']}},_0xc26442={};_0xc26442[_0x08c3('0x2d')]=_[_0x08c3('0x40')](db['CmHopperBlack'][_0x08c3('0x41')]);_0xc26442[_0x08c3('0x2e')]=_['keys'](_0x3d1987['query']);_0xc26442['filters']=_[_0x08c3('0x42')](_0xc26442[_0x08c3('0x2d')],_0xc26442['query']);_0x13b2ed['attributes']=_[_0x08c3('0x42')](_0xc26442[_0x08c3('0x2d')],qs[_0x08c3('0x30')](_0x3d1987['query'][_0x08c3('0x30')]));_0x13b2ed[_0x08c3('0x2f')]=_0x13b2ed[_0x08c3('0x2f')][_0x08c3('0x43')]?_0x13b2ed[_0x08c3('0x2f')]:_0xc26442[_0x08c3('0x2d')];if(_0x3d1987[_0x08c3('0x2e')]['includeAll']){_0x13b2ed[_0x08c3('0x3a')]=[{'all':!![]}];}_0x13b2ed=_[_0x08c3('0x36')]({},_0x13b2ed,_0x3d1987[_0x08c3('0x38')]);return db[_0x08c3('0x29')][_0x08c3('0x44')](_0x13b2ed)[_0x08c3('0x23')](handleEntityNotFound(_0x48b832,null))[_0x08c3('0x23')](respondWithResult(_0x48b832,null))['catch'](handleError(_0x48b832,null));};exports[_0x08c3('0x45')]=function(_0x482019,_0x263dd7){if(_0x482019[_0x08c3('0x46')]['id']){delete _0x482019[_0x08c3('0x46')]['id'];}return db[_0x08c3('0x29')]['find']({'where':{'id':_0x482019[_0x08c3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x263dd7,null))[_0x08c3('0x23')](saveUpdates(_0x482019[_0x08c3('0x46')],null))['then'](respondWithResult(_0x263dd7,null))[_0x08c3('0x3d')](handleError(_0x263dd7,null));};exports[_0x08c3('0x47')]=function(_0x970ac3,_0x923c06){return db[_0x08c3('0x29')][_0x08c3('0x44')]({'where':{'id':_0x970ac3[_0x08c3('0x3f')]['id']}})[_0x08c3('0x23')](handleEntityNotFound(_0x923c06,null))[_0x08c3('0x23')](removeEntity(_0x923c06,null))[_0x08c3('0x3d')](handleError(_0x923c06,null));};exports[_0x08c3('0x48')]=function(_0x5b50e0,_0x2ca115){return db[_0x08c3('0x29')][_0x08c3('0x48')]()[_0x08c3('0x23')](respondWithResult(_0x2ca115,null))[_0x08c3('0x3d')](handleError(_0x2ca115,null));}; \ No newline at end of file +var _0xc935=['jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','reject','destroy','then','error','stack','name','send','map','CmHopperBlack','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc935,0x10a));var _0x5c93=function(_0x3e9341,_0x34e3dc){_0x3e9341=_0x3e9341-0x0;var _0x23bbdb=_0xc935[_0x3e9341];return _0x23bbdb;};'use strict';var emlformat=require(_0x5c93('0x0'));var rimraf=require(_0x5c93('0x1'));var zipdir=require(_0x5c93('0x2'));var jsonpatch=require(_0x5c93('0x3'));var rp=require(_0x5c93('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5c93('0x5'));var util=require(_0x5c93('0x6'));var path=require('path');var sox=require(_0x5c93('0x7'));var csv=require(_0x5c93('0x8'));var ejs=require(_0x5c93('0x9'));var fs=require('fs');var fs_extra=require(_0x5c93('0xa'));var _=require(_0x5c93('0xb'));var squel=require(_0x5c93('0xc'));var crypto=require(_0x5c93('0xd'));var jsforce=require(_0x5c93('0xe'));var deskjs=require(_0x5c93('0xf'));var toCsv=require(_0x5c93('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5c93('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c93('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c93('0x12'))(_0x5c93('0x13'));var utils=require(_0x5c93('0x14'));var config=require(_0x5c93('0x15'));var licenseUtil=require(_0x5c93('0x16'));var db=require(_0x5c93('0x17'))['db'];function respondWithStatusCode(_0x135c9a,_0x461da2){_0x461da2=_0x461da2||0xcc;return function(_0x3eb478){if(_0x3eb478){return _0x135c9a[_0x5c93('0x18')](_0x461da2);}return _0x135c9a['status'](_0x461da2)['end']();};}function respondWithResult(_0x1ff8d2,_0x3028fa){_0x3028fa=_0x3028fa||0xc8;return function(_0x579110){if(_0x579110){return _0x1ff8d2[_0x5c93('0x19')](_0x3028fa)[_0x5c93('0x1a')](_0x579110);}};}function respondWithFilteredResult(_0x5d21c9,_0x14e4d6){return function(_0x3a2a19){if(_0x3a2a19){var _0x1d49f4=typeof _0x14e4d6[_0x5c93('0x1b')]===_0x5c93('0x1c')&&typeof _0x14e4d6['limit']==='undefined';var _0x5508ee=_0x3a2a19[_0x5c93('0x1d')];var _0x3e5117=_0x1d49f4?0x0:_0x14e4d6[_0x5c93('0x1b')];var _0x258ee7=_0x1d49f4?_0x3a2a19['count']:_0x14e4d6['offset']+_0x14e4d6[_0x5c93('0x1e')];var _0x1b7cf8;if(_0x258ee7>=_0x5508ee){_0x258ee7=_0x5508ee;_0x1b7cf8=0xc8;}else{_0x1b7cf8=0xce;}_0x5d21c9[_0x5c93('0x19')](_0x1b7cf8);return _0x5d21c9['set']('Content-Range',_0x3e5117+'-'+_0x258ee7+'/'+_0x5508ee)[_0x5c93('0x1a')](_0x3a2a19);}return null;};}function patchUpdates(_0x3ba2d1){return function(_0x431041){try{jsonpatch[_0x5c93('0x1f')](_0x431041,_0x3ba2d1,!![]);}catch(_0xce1807){return BPromise[_0x5c93('0x20')](_0xce1807);}return _0x431041['save']();};}function saveUpdates(_0x508a2f,_0x399082){return function(_0x52e9e5){if(_0x52e9e5){return _0x52e9e5['update'](_0x508a2f)['then'](function(_0x35200f){return _0x35200f;});}return null;};}function removeEntity(_0x4e69ca,_0x24aac5){return function(_0x209607){if(_0x209607){return _0x209607[_0x5c93('0x21')]()[_0x5c93('0x22')](function(){_0x4e69ca[_0x5c93('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27c80c,_0x5be8e0){return function(_0x43d1f2){if(!_0x43d1f2){_0x27c80c[_0x5c93('0x18')](0x194);}return _0x43d1f2;};}function handleError(_0x37679b,_0x181176){_0x181176=_0x181176||0x1f4;return function(_0x320735){logger[_0x5c93('0x23')](_0x320735[_0x5c93('0x24')]);if(_0x320735['name']){delete _0x320735[_0x5c93('0x25')];}_0x37679b[_0x5c93('0x19')](_0x181176)[_0x5c93('0x26')](_0x320735);};}exports['index']=function(_0x47eb87,_0x38e545){var _0x47ab32={},_0x31d024={},_0x3d0cc8={'count':0x0,'rows':[]};var _0x15034f=_[_0x5c93('0x27')](db[_0x5c93('0x28')][_0x5c93('0x29')],function(_0x195c52){return{'name':_0x195c52['fieldName'],'type':_0x195c52[_0x5c93('0x2a')][_0x5c93('0x2b')]};});_0x31d024['model']=_[_0x5c93('0x27')](_0x15034f,_0x5c93('0x25'));_0x31d024[_0x5c93('0x2c')]=_[_0x5c93('0x2d')](_0x47eb87['query']);_0x31d024[_0x5c93('0x2e')]=_['intersection'](_0x31d024[_0x5c93('0x2f')],_0x31d024[_0x5c93('0x2c')]);_0x47ab32[_0x5c93('0x30')]=_[_0x5c93('0x31')](_0x31d024[_0x5c93('0x2f')],qs[_0x5c93('0x32')](_0x47eb87[_0x5c93('0x2c')][_0x5c93('0x32')]));_0x47ab32['attributes']=_0x47ab32[_0x5c93('0x30')][_0x5c93('0x33')]?_0x47ab32[_0x5c93('0x30')]:_0x31d024[_0x5c93('0x2f')];if(!_0x47eb87[_0x5c93('0x2c')][_0x5c93('0x34')](_0x5c93('0x35'))){_0x47ab32[_0x5c93('0x1e')]=qs[_0x5c93('0x1e')](_0x47eb87[_0x5c93('0x2c')][_0x5c93('0x1e')]);_0x47ab32[_0x5c93('0x1b')]=qs['offset'](_0x47eb87[_0x5c93('0x2c')][_0x5c93('0x1b')]);}_0x47ab32[_0x5c93('0x36')]=qs[_0x5c93('0x37')](_0x47eb87[_0x5c93('0x2c')][_0x5c93('0x37')]);_0x47ab32[_0x5c93('0x38')]=qs['filters'](_['pick'](_0x47eb87['query'],_0x31d024['filters']),_0x15034f);if(_0x47eb87['query'][_0x5c93('0x39')]){_0x47ab32[_0x5c93('0x38')]=_[_0x5c93('0x3a')](_0x47ab32[_0x5c93('0x38')],{'$or':_[_0x5c93('0x27')](_0x15034f,function(_0x320445){if(_0x320445['type']!==_0x5c93('0x3b')){var _0x42d594={};_0x42d594[_0x320445['name']]={'$like':'%'+_0x47eb87['query'][_0x5c93('0x39')]+'%'};return _0x42d594;}})});}_0x47ab32=_[_0x5c93('0x3a')]({},_0x47ab32,_0x47eb87[_0x5c93('0x3c')]);var _0x4f3e88={'where':_0x47ab32[_0x5c93('0x38')]};return db[_0x5c93('0x28')][_0x5c93('0x1d')](_0x4f3e88)[_0x5c93('0x22')](function(_0x217ecf){_0x3d0cc8[_0x5c93('0x1d')]=_0x217ecf;if(_0x47eb87[_0x5c93('0x2c')][_0x5c93('0x3d')]){_0x47ab32[_0x5c93('0x3e')]=[{'all':!![]}];}return db[_0x5c93('0x28')][_0x5c93('0x3f')](_0x47ab32);})[_0x5c93('0x22')](function(_0x40c104){_0x3d0cc8[_0x5c93('0x40')]=_0x40c104;return _0x3d0cc8;})[_0x5c93('0x22')](respondWithFilteredResult(_0x38e545,_0x47ab32))[_0x5c93('0x41')](handleError(_0x38e545,null));};exports['show']=function(_0x4b29bc,_0x3320b9){var _0x3d7a53={'raw':!![],'where':{'id':_0x4b29bc[_0x5c93('0x42')]['id']}},_0x6ea1f8={};_0x6ea1f8[_0x5c93('0x2f')]=_[_0x5c93('0x2d')](db['CmHopperBlack'][_0x5c93('0x29')]);_0x6ea1f8['query']=_[_0x5c93('0x2d')](_0x4b29bc['query']);_0x6ea1f8['filters']=_['intersection'](_0x6ea1f8[_0x5c93('0x2f')],_0x6ea1f8[_0x5c93('0x2c')]);_0x3d7a53[_0x5c93('0x30')]=_['intersection'](_0x6ea1f8[_0x5c93('0x2f')],qs['fields'](_0x4b29bc['query'][_0x5c93('0x32')]));_0x3d7a53[_0x5c93('0x30')]=_0x3d7a53[_0x5c93('0x30')]['length']?_0x3d7a53['attributes']:_0x6ea1f8[_0x5c93('0x2f')];if(_0x4b29bc[_0x5c93('0x2c')][_0x5c93('0x3d')]){_0x3d7a53[_0x5c93('0x3e')]=[{'all':!![]}];}_0x3d7a53=_[_0x5c93('0x3a')]({},_0x3d7a53,_0x4b29bc[_0x5c93('0x3c')]);return db['CmHopperBlack'][_0x5c93('0x43')](_0x3d7a53)['then'](handleEntityNotFound(_0x3320b9,null))['then'](respondWithResult(_0x3320b9,null))[_0x5c93('0x41')](handleError(_0x3320b9,null));};exports['update']=function(_0x4aeec2,_0x5cdda0){if(_0x4aeec2[_0x5c93('0x44')]['id']){delete _0x4aeec2['body']['id'];}return db[_0x5c93('0x28')][_0x5c93('0x43')]({'where':{'id':_0x4aeec2['params']['id']}})[_0x5c93('0x22')](handleEntityNotFound(_0x5cdda0,null))['then'](saveUpdates(_0x4aeec2[_0x5c93('0x44')],null))[_0x5c93('0x22')](respondWithResult(_0x5cdda0,null))[_0x5c93('0x41')](handleError(_0x5cdda0,null));};exports[_0x5c93('0x21')]=function(_0x5a0cd6,_0x45b9ab){return db[_0x5c93('0x28')]['find']({'where':{'id':_0x5a0cd6['params']['id']}})[_0x5c93('0x22')](handleEntityNotFound(_0x45b9ab,null))[_0x5c93('0x22')](removeEntity(_0x45b9ab,null))[_0x5c93('0x41')](handleError(_0x45b9ab,null));};exports[_0x5c93('0x45')]=function(_0x537478,_0x1e71dd){return db[_0x5c93('0x28')][_0x5c93('0x45')]()[_0x5c93('0x22')](respondWithResult(_0x1e71dd,null))[_0x5c93('0x41')](handleError(_0x1e71dd,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index bc8765b..f86781b 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 _0x28ec=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x32b5c9,_0x112a49){var _0x19219c=function(_0x4161d9){while(--_0x4161d9){_0x32b5c9['push'](_0x32b5c9['shift']());}};_0x19219c(++_0x112a49);}(_0x28ec,0x15d));var _0xc28e=function(_0x454408,_0x22fdf4){_0x454408=_0x454408-0x0;var _0x25b5cf=_0x28ec[_0x454408];return _0x25b5cf;};'use strict';var _=require(_0xc28e('0x0'));var util=require(_0xc28e('0x1'));var logger=require(_0xc28e('0x2'))(_0xc28e('0x3'));var moment=require(_0xc28e('0x4'));var BPromise=require(_0xc28e('0x5'));var rp=require(_0xc28e('0x6'));var fs=require('fs');var path=require(_0xc28e('0x7'));var rimraf=require(_0xc28e('0x8'));var config=require('../../config/environment');var attributes=require(_0xc28e('0x9'));module[_0xc28e('0xa')]=function(_0x27cd6e,_0x492480){return _0x27cd6e[_0xc28e('0xb')](_0xc28e('0xc'),attributes,{'tableName':_0xc28e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7098=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x3ea136,_0x300c41){var _0x49f36d=function(_0x524220){while(--_0x524220){_0x3ea136['push'](_0x3ea136['shift']());}};_0x49f36d(++_0x300c41);}(_0x7098,0x171));var _0x8709=function(_0x30e8f5,_0x1c0007){_0x30e8f5=_0x30e8f5-0x0;var _0x468a11=_0x7098[_0x30e8f5];return _0x468a11;};'use strict';var _=require(_0x8709('0x0'));var util=require('util');var logger=require(_0x8709('0x1'))('api');var moment=require(_0x8709('0x2'));var BPromise=require(_0x8709('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8709('0x4'));var config=require(_0x8709('0x5'));var attributes=require(_0x8709('0x6'));module[_0x8709('0x7')]=function(_0x1eb4db,_0x226094){return _0x1eb4db['define'](_0x8709('0x8'),attributes,{'tableName':_0x8709('0x9'),'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 a75df4f..636a77f 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 _0x65a7=['map','model','GetCmHopperBlack','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','util','moment','randomstring','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CmHopperBlack','options','raw','where','attributes','limit','include'];(function(_0x5cced0,_0x2a363f){var _0x38781=function(_0x24cf82){while(--_0x24cf82){_0x5cced0['push'](_0x5cced0['shift']());}};_0x38781(++_0x2a363f);}(_0x65a7,0x6a));var _0x765a=function(_0x1c03d7,_0x225081){_0x1c03d7=_0x1c03d7-0x0;var _0x29a2a4=_0x65a7[_0x1c03d7];return _0x29a2a4;};'use strict';var _=require('lodash');var util=require(_0x765a('0x0'));var moment=require(_0x765a('0x1'));var BPromise=require('bluebird');var rs=require(_0x765a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x765a('0x3'));var config=require('../../config/environment');var jayson=require(_0x765a('0x4'));var client=jayson[_0x765a('0x5')][_0x765a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x48424e,_0x154a03,_0x39fcd1){return new BPromise(function(_0x1ac9d4,_0x45e276){return client[_0x765a('0x7')](_0x48424e,_0x39fcd1)[_0x765a('0x8')](function(_0x57235f){logger[_0x765a('0x9')](_0x765a('0xa'),_0x154a03,_0x765a('0xb'));logger[_0x765a('0xc')](_0x765a('0xd'),_0x154a03,'request\x20sent',JSON[_0x765a('0xe')](_0x57235f));if(_0x57235f[_0x765a('0xf')]){if(_0x57235f[_0x765a('0xf')][_0x765a('0x10')]===0x1f4){logger[_0x765a('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x154a03,_0x57235f[_0x765a('0xf')][_0x765a('0x11')]);return _0x45e276(_0x57235f[_0x765a('0xf')]['message']);}logger[_0x765a('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x154a03,_0x57235f[_0x765a('0xf')][_0x765a('0x11')]);return _0x1ac9d4(_0x57235f[_0x765a('0xf')][_0x765a('0x11')]);}else{logger[_0x765a('0x9')](_0x765a('0xa'),_0x154a03,_0x765a('0xb'));_0x1ac9d4(_0x57235f['result'][_0x765a('0x11')]);}})[_0x765a('0x12')](function(_0x2d09cc){logger[_0x765a('0xf')](_0x765a('0xa'),_0x154a03,_0x2d09cc);_0x45e276(_0x2d09cc);});});}exports['GetCmHopperBlack']=function(_0x1a2e5b){var _0x57f286=this;return new Promise(function(_0x13d74e,_0x9f1135){return db[_0x765a('0x13')]['findAll']({'raw':_0x1a2e5b[_0x765a('0x14')]?_0x1a2e5b[_0x765a('0x14')][_0x765a('0x15')]===undefined?!![]:![]:!![],'where':_0x1a2e5b[_0x765a('0x14')]?_0x1a2e5b['options'][_0x765a('0x16')]||null:null,'attributes':_0x1a2e5b[_0x765a('0x14')]?_0x1a2e5b[_0x765a('0x14')][_0x765a('0x17')]||null:null,'limit':_0x1a2e5b[_0x765a('0x14')]?_0x1a2e5b['options'][_0x765a('0x18')]||null:null,'include':_0x1a2e5b[_0x765a('0x14')]?_0x1a2e5b['options'][_0x765a('0x19')]?_[_0x765a('0x1a')](_0x1a2e5b['options'][_0x765a('0x19')],function(_0x143eaa){return{'model':db[_0x143eaa[_0x765a('0x1b')]],'as':_0x143eaa['as'],'attributes':_0x143eaa[_0x765a('0x17')],'include':_0x143eaa['include']?_[_0x765a('0x1a')](_0x143eaa['include'],function(_0x2e7ca3){return{'model':db[_0x2e7ca3[_0x765a('0x1b')]],'as':_0x2e7ca3['as'],'attributes':_0x2e7ca3[_0x765a('0x17')],'include':_0x2e7ca3[_0x765a('0x19')]?_[_0x765a('0x1a')](_0x2e7ca3[_0x765a('0x19')],function(_0x19ba6b){return{'model':db[_0x19ba6b[_0x765a('0x1b')]],'as':_0x19ba6b['as'],'attributes':_0x19ba6b[_0x765a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x765a('0x8')](function(_0x3ed570){logger[_0x765a('0x9')](_0x765a('0x1c'),_0x1a2e5b);logger['debug'](_0x765a('0x1c'),_0x1a2e5b,JSON[_0x765a('0xe')](_0x3ed570));_0x13d74e(_0x3ed570);})[_0x765a('0x12')](function(_0x3b85e5){logger[_0x765a('0xf')](_0x765a('0x1c'),_0x3b85e5[_0x765a('0x11')],_0x1a2e5b);_0x9f1135(_0x57f286[_0x765a('0xf')](0x1f4,_0x3b85e5['message']));});});};exports[_0x765a('0x1d')]=function(_0x5f3608){var _0x41cc27=this;return new Promise(function(_0x513ad0,_0x128a4d){return db[_0x765a('0x13')][_0x765a('0x1e')](_0x5f3608[_0x765a('0x1f')],{'raw':_0x5f3608[_0x765a('0x14')]?_0x5f3608[_0x765a('0x14')][_0x765a('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f3608['options']?_0x5f3608[_0x765a('0x14')]['where']||null:null,'attributes':_0x5f3608['options']?_0x5f3608[_0x765a('0x14')][_0x765a('0x17')]||null:null,'limit':_0x5f3608['options']?_0x5f3608[_0x765a('0x14')][_0x765a('0x18')]||null:null})[_0x765a('0x8')](function(_0x2671d0){logger[_0x765a('0x9')](_0x765a('0x1d'),_0x5f3608);logger[_0x765a('0xc')](_0x765a('0x1d'),_0x5f3608,JSON[_0x765a('0xe')](_0x2671d0));_0x513ad0(_0x2671d0);})[_0x765a('0x12')](function(_0x4d5599){logger[_0x765a('0xf')](_0x765a('0x1d'),_0x4d5599[_0x765a('0x11')],_0x5f3608);_0x128a4d(_0x41cc27[_0x765a('0xf')](0x1f4,_0x4d5599[_0x765a('0x11')]));});});};exports[_0x765a('0x20')]=function(_0xa4324a){var _0x4cc8fb=this;return new Promise(function(_0x2c24d6,_0x5db4d9){return db[_0x765a('0x13')]['destroy']({'where':_0xa4324a[_0x765a('0x14')]?_0xa4324a[_0x765a('0x14')][_0x765a('0x16')]||null:null})[_0x765a('0x8')](function(_0x335017){logger['info'](_0x765a('0x20'),_0xa4324a);logger[_0x765a('0xc')]('DestroyCmHopperBlack',_0xa4324a,JSON['stringify'](_0x335017));_0x2c24d6(_0x335017);})[_0x765a('0x12')](function(_0x3ebc4b){logger[_0x765a('0xf')](_0x765a('0x20'),_0x3ebc4b['message'],_0xa4324a);_0x5db4d9(_0x4cc8fb[_0x765a('0xf')](0x1f4,_0x3ebc4b[_0x765a('0x11')]));});});}; \ No newline at end of file +var _0x2547=['attributes','limit','map','include','model','debug','stringify','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2547,0xc5));var _0x7254=function(_0x5a55ba,_0x5cb7e6){_0x5a55ba=_0x5a55ba-0x0;var _0x4c1f2d=_0x2547[_0x5a55ba];return _0x4c1f2d;};'use strict';var _=require(_0x7254('0x0'));var util=require(_0x7254('0x1'));var moment=require('moment');var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7254('0x7'));var jayson=require(_0x7254('0x8'));var client=jayson[_0x7254('0x9')][_0x7254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53e159,_0x2ecdbb,_0x3a21ad){return new BPromise(function(_0x12b17d,_0x1b8a4e){return client[_0x7254('0xb')](_0x53e159,_0x3a21ad)[_0x7254('0xc')](function(_0xca1474){logger[_0x7254('0xd')](_0x7254('0xe'),_0x2ecdbb,'request\x20sent');logger['debug'](_0x7254('0xf'),_0x2ecdbb,'request\x20sent',JSON['stringify'](_0xca1474));if(_0xca1474[_0x7254('0x10')]){if(_0xca1474[_0x7254('0x10')]['code']===0x1f4){logger[_0x7254('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x2ecdbb,_0xca1474[_0x7254('0x10')][_0x7254('0x11')]);return _0x1b8a4e(_0xca1474[_0x7254('0x10')][_0x7254('0x11')]);}logger[_0x7254('0x10')](_0x7254('0xe'),_0x2ecdbb,_0xca1474[_0x7254('0x10')][_0x7254('0x11')]);return _0x12b17d(_0xca1474['error'][_0x7254('0x11')]);}else{logger[_0x7254('0xd')](_0x7254('0xe'),_0x2ecdbb,'request\x20sent');_0x12b17d(_0xca1474[_0x7254('0x12')][_0x7254('0x11')]);}})[_0x7254('0x13')](function(_0x1cfc05){logger[_0x7254('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x2ecdbb,_0x1cfc05);_0x1b8a4e(_0x1cfc05);});});}exports[_0x7254('0x14')]=function(_0x311444){var _0x154c9b=this;return new Promise(function(_0x410ce1,_0x575e4){return db[_0x7254('0x15')][_0x7254('0x16')]({'raw':_0x311444[_0x7254('0x17')]?_0x311444[_0x7254('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x311444[_0x7254('0x17')]?_0x311444[_0x7254('0x17')][_0x7254('0x18')]||null:null,'attributes':_0x311444['options']?_0x311444['options'][_0x7254('0x19')]||null:null,'limit':_0x311444[_0x7254('0x17')]?_0x311444[_0x7254('0x17')][_0x7254('0x1a')]||null:null,'include':_0x311444[_0x7254('0x17')]?_0x311444[_0x7254('0x17')]['include']?_[_0x7254('0x1b')](_0x311444['options'][_0x7254('0x1c')],function(_0x1d4f64){return{'model':db[_0x1d4f64[_0x7254('0x1d')]],'as':_0x1d4f64['as'],'attributes':_0x1d4f64[_0x7254('0x19')],'include':_0x1d4f64['include']?_[_0x7254('0x1b')](_0x1d4f64['include'],function(_0x429ff7){return{'model':db[_0x429ff7[_0x7254('0x1d')]],'as':_0x429ff7['as'],'attributes':_0x429ff7[_0x7254('0x19')],'include':_0x429ff7['include']?_[_0x7254('0x1b')](_0x429ff7[_0x7254('0x1c')],function(_0x3fd2ce){return{'model':db[_0x3fd2ce[_0x7254('0x1d')]],'as':_0x3fd2ce['as'],'attributes':_0x3fd2ce[_0x7254('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7254('0xc')](function(_0x1f0be0){logger['info']('GetCmHopperBlack',_0x311444);logger[_0x7254('0x1e')](_0x7254('0x14'),_0x311444,JSON[_0x7254('0x1f')](_0x1f0be0));_0x410ce1(_0x1f0be0);})[_0x7254('0x13')](function(_0xc80b9f){logger['error'](_0x7254('0x14'),_0xc80b9f[_0x7254('0x11')],_0x311444);_0x575e4(_0x154c9b[_0x7254('0x10')](0x1f4,_0xc80b9f[_0x7254('0x11')]));});});};exports[_0x7254('0x20')]=function(_0x87a7fa){var _0x4af5ad=this;return new Promise(function(_0x35bd5e,_0x248226){return db['CmHopperBlack'][_0x7254('0x21')](_0x87a7fa[_0x7254('0x22')],{'raw':_0x87a7fa[_0x7254('0x17')]?_0x87a7fa[_0x7254('0x17')][_0x7254('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x87a7fa['options']?_0x87a7fa[_0x7254('0x17')]['where']||null:null,'attributes':_0x87a7fa[_0x7254('0x17')]?_0x87a7fa[_0x7254('0x17')]['attributes']||null:null,'limit':_0x87a7fa['options']?_0x87a7fa[_0x7254('0x17')][_0x7254('0x1a')]||null:null})['then'](function(_0x2e6da9){logger[_0x7254('0xd')](_0x7254('0x20'),_0x87a7fa);logger[_0x7254('0x1e')](_0x7254('0x20'),_0x87a7fa,JSON[_0x7254('0x1f')](_0x2e6da9));_0x35bd5e(_0x2e6da9);})[_0x7254('0x13')](function(_0x4696ab){logger['error']('UpdateCmHopperBlack',_0x4696ab['message'],_0x87a7fa);_0x248226(_0x4af5ad[_0x7254('0x10')](0x1f4,_0x4696ab['message']));});});};exports[_0x7254('0x24')]=function(_0x2575f0){var _0x14c7ce=this;return new Promise(function(_0x2b6653,_0x1d7b8c){return db[_0x7254('0x15')]['destroy']({'where':_0x2575f0[_0x7254('0x17')]?_0x2575f0[_0x7254('0x17')][_0x7254('0x18')]||null:null})[_0x7254('0xc')](function(_0x227b52){logger[_0x7254('0xd')](_0x7254('0x24'),_0x2575f0);logger[_0x7254('0x1e')](_0x7254('0x24'),_0x2575f0,JSON['stringify'](_0x227b52));_0x2b6653(_0x227b52);})[_0x7254('0x13')](function(_0x15be06){logger[_0x7254('0x10')](_0x7254('0x24'),_0x15be06['message'],_0x2575f0);_0x1d7b8c(_0x14c7ce[_0x7254('0x10')](0x1f4,_0x15be06['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index fd135fd..3d95033 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 _0x5162=['/:id','show','update','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','/describe','isAuthenticated','describe'];(function(_0x434801,_0xc8db49){var _0x225431=function(_0x5462d3){while(--_0x5462d3){_0x434801['push'](_0x434801['shift']());}};_0x225431(++_0xc8db49);}(_0x5162,0x103));var _0x2516=function(_0x3b4455,_0x3e4395){_0x3b4455=_0x3b4455-0x0;var _0x34dd09=_0x5162[_0x3b4455];return _0x34dd09;};'use strict';var multer=require(_0x2516('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2516('0x1')]();var fs_extra=require(_0x2516('0x2'));var auth=require(_0x2516('0x3'));var interaction=require(_0x2516('0x4'));var config=require(_0x2516('0x5'));var controller=require(_0x2516('0x6'));router[_0x2516('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2516('0x8'),auth[_0x2516('0x9')](),controller[_0x2516('0xa')]);router[_0x2516('0x7')](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xc')]);router['put'](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2516('0xe')]=router; \ No newline at end of file +var _0xeff8=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','update','exports','multer'];(function(_0x44cf57,_0x13a9e4){var _0x3b9f1d=function(_0x26aa91){while(--_0x26aa91){_0x44cf57['push'](_0x44cf57['shift']());}};_0x3b9f1d(++_0x13a9e4);}(_0xeff8,0x186));var _0x8eff=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xeff8[_0x1b5aea];return _0x15cfc6;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get']('/',auth[_0x8eff('0x9')](),controller[_0x8eff('0xa')]);router[_0x8eff('0xb')](_0x8eff('0xc'),auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xb')](_0x8eff('0xe'),auth[_0x8eff('0x9')](),controller['show']);router['put'](_0x8eff('0xe'),auth[_0x8eff('0x9')](),controller[_0x8eff('0xf')]);router['delete'](_0x8eff('0xe'),auth[_0x8eff('0x9')](),controller['destroy']);module[_0x8eff('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 6bd268d..286cba3 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 _0xa479=['INTEGER','STRING','DATE','getDataValue','followuptime','diff','seconds','setDataValue','dispositionat','BOOLEAN','sequelize','moment','exports'];(function(_0x2ad748,_0x556bf6){var _0x244b22=function(_0x179e9){while(--_0x179e9){_0x2ad748['push'](_0x2ad748['shift']());}};_0x244b22(++_0x556bf6);}(_0xa479,0x72));var _0x9a47=function(_0x178af7,_0x16a17c){_0x178af7=_0x178af7-0x0;var _0x46ea16=_0xa479[_0x178af7];return _0x46ea16;};'use strict';var Sequelize=require(_0x9a47('0x0'));var moment=require(_0x9a47('0x1'));module[_0x9a47('0x2')]={'state':{'type':Sequelize[_0x9a47('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x9a47('0x4')]},'scheduledat':{'type':Sequelize[_0x9a47('0x5')]},'countbusyretry':{'type':Sequelize[_0x9a47('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9a47('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9a47('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9a47('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x9a47('0x4')]},'originatecalleridname':{'type':Sequelize[_0x9a47('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9a47('0x4')]},'starttime':{'type':Sequelize[_0x9a47('0x5')]},'responsetime':{'type':Sequelize[_0x9a47('0x5')]},'answertime':{'type':Sequelize[_0x9a47('0x5')]},'droptime':{'type':Sequelize[_0x9a47('0x5')]},'endtime':{'type':Sequelize[_0x9a47('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9a47('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x9a47('0x4')]},'campaigntype':{'type':Sequelize[_0x9a47('0x4')]},'membername':{'type':Sequelize[_0x9a47('0x4')]},'reason':{'type':Sequelize[_0x9a47('0x4')]},'disposition':{'type':Sequelize[_0x9a47('0x4')]},'secondDisposition':{'type':Sequelize[_0x9a47('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9a47('0x4')]},'dispositionat':{'type':Sequelize[_0x9a47('0x5')],'set':function(_0x1b1d6b){var _0x1bf342=this[_0x9a47('0x6')]('endtime');if(_0x1bf342&&_0x1b1d6b){this['setDataValue'](_0x9a47('0x7'),moment(_0x1b1d6b)[_0x9a47('0x8')](moment(_0x1bf342),_0x9a47('0x9')));}return this[_0x9a47('0xa')](_0x9a47('0xb'),_0x1b1d6b);}},'amd':{'type':Sequelize[_0x9a47('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9a47('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9a47('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9a47('0x5')]},'callback':{'type':Sequelize[_0x9a47('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9a47('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x9a47('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9a47('0x5')]},'recallme':{'type':Sequelize[_0x9a47('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9a47('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x9a47('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9a47('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9a47('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9a47('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6d05=['setDataValue','followuptime','diff','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x3156dc,_0x34bc35){var _0x1acfa3=function(_0x369f3d){while(--_0x369f3d){_0x3156dc['push'](_0x3156dc['shift']());}};_0x1acfa3(++_0x34bc35);}(_0x6d05,0xd5));var _0x56d0=function(_0x75c3a2,_0x4a0b4b){_0x75c3a2=_0x75c3a2-0x0;var _0x278d62=_0x6d05[_0x75c3a2];return _0x278d62;};'use strict';var Sequelize=require(_0x56d0('0x0'));var moment=require(_0x56d0('0x1'));module[_0x56d0('0x2')]={'state':{'type':Sequelize[_0x56d0('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x56d0('0x4')]},'scheduledat':{'type':Sequelize[_0x56d0('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x56d0('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x56d0('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x56d0('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x56d0('0x4')]},'calleridnum':{'type':Sequelize[_0x56d0('0x4')]},'calleridname':{'type':Sequelize[_0x56d0('0x4')]},'starttime':{'type':Sequelize[_0x56d0('0x5')]},'responsetime':{'type':Sequelize[_0x56d0('0x5')]},'answertime':{'type':Sequelize[_0x56d0('0x5')]},'droptime':{'type':Sequelize[_0x56d0('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x56d0('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x56d0('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x56d0('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x56d0('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x56d0('0x4')]},'reason':{'type':Sequelize[_0x56d0('0x4')]},'disposition':{'type':Sequelize[_0x56d0('0x4')]},'secondDisposition':{'type':Sequelize[_0x56d0('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x56d0('0x5')],'set':function(_0x3493c9){var _0x47d85a=this[_0x56d0('0x6')](_0x56d0('0x7'));if(_0x47d85a&&_0x3493c9){this[_0x56d0('0x8')](_0x56d0('0x9'),moment(_0x3493c9)[_0x56d0('0xa')](moment(_0x47d85a),'seconds'));}return this['setDataValue'](_0x56d0('0xb'),_0x3493c9);}},'amd':{'type':Sequelize[_0x56d0('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x56d0('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x56d0('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x56d0('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x56d0('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x56d0('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x56d0('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x56d0('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x56d0('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x56d0('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x56d0('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x56d0('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x56d0('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 831beeb..e6ff7a0 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 _0xf61e=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','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','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','describe','update','body','uniqueid','params','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','cm_hopper','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','fromQuery','ContactId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','checkContactHopper','findOne','eml-format'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xf61e,0x191));var _0xef61=function(_0xfbabf8,_0x425cab){_0xfbabf8=_0xfbabf8-0x0;var _0x335ef3=_0xf61e[_0xfbabf8];return _0x335ef3;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['CmHopperFinal']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':!![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')]()['then'](respondWithResult(_0x47b09d,null))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x13d0f8,_0x2904e0){if(_0x13d0f8[_0xef61('0x4a')][_0xef61('0x4b')]){delete _0x13d0f8[_0xef61('0x4a')]['uniqueid'];}return db[_0xef61('0x30')]['find']({'where':{'uniqueid':_0x13d0f8[_0xef61('0x4c')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x2904e0,null))[_0xef61('0x28')](saveUpdates(_0x13d0f8[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x2904e0,null))[_0xef61('0x45')](handleError(_0x2904e0,null));};exports[_0xef61('0x4d')]=function(_0x1565c7,_0x264877,_0x4af2f3){return db[_0xef61('0x30')][_0xef61('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x1565c7['params']['id']},'attributes':[[db['sequelize']['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db['sequelize'][_0xef61('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xef61('0x51')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')]('`state`\x20=\x203,\x201,\x20null'))),_0xef61('0x52')],[db[_0xef61('0x4f')]['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xef61('0x53')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xef61('0x54')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x55')))),_0xef61('0x56')],[db['sequelize']['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x57')))),_0xef61('0x58')],[db['sequelize']['fn'](_0xef61('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0xef61('0x50')](_0xef61('0x59')))),_0xef61('0x5a')],[db['sequelize']['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5b')))),_0xef61('0x5c')]]})[_0xef61('0x28')](handleEntityNotFound(_0x264877,null))[_0xef61('0x28')](respondWithResult(_0x264877,null))[_0xef61('0x45')](handleError(_0x264877,null));};exports[_0xef61('0x5d')]=function(_0x5507ee,_0x15a8c5,_0x4b26e6){return db['CmHopperFinal'][_0xef61('0x44')]({'raw':![],'where':{'CampaignId':_0x5507ee[_0xef61('0x4c')]['id']},'attributes':[[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xef61('0x51')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5e')))),_0xef61('0x52')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db['sequelize'][_0xef61('0x50')](_0xef61('0x5f')))),'busyContacts'],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x60')))),_0xef61('0x54')],[db[_0xef61('0x4f')]['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xef61('0x56')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db['sequelize']['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x57')))),_0xef61('0x58')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x59')))),_0xef61('0x5a')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5b')))),_0xef61('0x5c')]]})['then'](handleEntityNotFound(_0x15a8c5,null))[_0xef61('0x28')](respondWithResult(_0x15a8c5,null))[_0xef61('0x45')](handleError(_0x15a8c5,null));};exports[_0xef61('0x61')]=function(_0x5ab4fe,_0x38117b,_0x346752){return db['VoiceQueue'][_0xef61('0x47')]({'where':{'id':_0x5ab4fe[_0xef61('0x4c')]['id']}})['then'](handleEntityNotFound(_0x38117b,null))[_0xef61('0x28')](function(_0x54777a){var _0xe62ec2;if(_0x54777a){_0xe62ec2=squel[_0xef61('0x62')]()['into'](_0xef61('0x63'))['fromQuery']([_0xef61('0x64'),_0xef61('0x65'),'ContactId','ListId',_0xef61('0x66'),_0xef61('0x67'),_0xef61('0x68')],squel[_0xef61('0x69')]()[_0xef61('0x6a')]('ANY_VALUE(calleridnum)',_0xef61('0x64'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x65'))[_0xef61('0x6a')](_0xef61('0x6c'),'ContactId')[_0xef61('0x6a')]('ANY_VALUE(ListId)',_0xef61('0x6d'))[_0xef61('0x6a')](_0xef61('0x6e'),_0xef61('0x66'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x67'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x68'))[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')]('VoiceQueueId\x20=\x20?',_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x72'),_0x5ab4fe['body'][_0xef61('0x73')]['toString']())['where'](_0xef61('0x74'))['where'](_0xef61('0x75'),squel['select']()['field'](_0xef61('0x64'))[_0xef61('0x6f')]('cm_hopper')[_0xef61('0x3d')]('VoiceQueueId\x20=\x20?',_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]()))[_0xef61('0x3d')](_0xef61('0x75'),squel['select']()[_0xef61('0x6a')]('calleridnum')[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')](_0xef61('0x76'),_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x77')))[_0xef61('0x78')]('ContactId'))[_0xef61('0x71')]();return db['sequelize'][_0xef61('0x34')](_0xe62ec2);}return[];})[_0xef61('0x28')](respondWithResult(_0x38117b,null))['catch'](handleError(_0x38117b,null));};exports[_0xef61('0x79')]=function(_0x5b86e4,_0x52f7c5,_0x465fb5){return db[_0xef61('0x7a')]['find']({'where':{'id':_0x5b86e4[_0xef61('0x4c')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x52f7c5,null))['then'](function(_0x352633){var _0x2cb8a8;if(_0x352633){_0x2cb8a8=squel['insert']()[_0xef61('0x7b')]('cm_hopper')[_0xef61('0x7c')]([_0xef61('0x64'),_0xef61('0x65'),_0xef61('0x7d'),'ListId',_0xef61('0x7e'),_0xef61('0x67'),_0xef61('0x68')],squel['select']()[_0xef61('0x6a')](_0xef61('0x7f'),'phone')['field'](_0xef61('0x6b'),_0xef61('0x65'))[_0xef61('0x6a')](_0xef61('0x6c'),_0xef61('0x7d'))[_0xef61('0x6a')](_0xef61('0x80'),_0xef61('0x6d'))[_0xef61('0x6a')](_0xef61('0x81'),_0xef61('0x7e'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x67'))[_0xef61('0x6a')](_0xef61('0x6b'),'updatedAt')[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')](_0xef61('0x82'),_0x5b86e4[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x72'),_0x5b86e4[_0xef61('0x4a')][_0xef61('0x73')][_0xef61('0x71')]())[_0xef61('0x3d')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xef61('0x3d')](_0xef61('0x75'),squel['select']()[_0xef61('0x6a')](_0xef61('0x64'))[_0xef61('0x6f')](_0xef61('0x63'))[_0xef61('0x3d')]('CampaignId\x20=\x20?',_0x5b86e4[_0xef61('0x4c')]['id']['toString']()))[_0xef61('0x3d')](_0xef61('0x75'),squel[_0xef61('0x69')]()[_0xef61('0x6a')](_0xef61('0x83'))[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')]('CampaignId\x20=\x20?',_0x5b86e4[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x77')))[_0xef61('0x78')](_0xef61('0x7d')))[_0xef61('0x71')]();return db[_0xef61('0x4f')][_0xef61('0x34')](_0x2cb8a8);}return[];})['then'](respondWithResult(_0x52f7c5,null))[_0xef61('0x45')](handleError(_0x52f7c5,null));};exports[_0xef61('0x84')]=function(_0x22006a,_0x317c4a,_0x5d8ee9){return db['CmHopper'][_0xef61('0x85')]({'where':{'VoiceQueueId':_0x22006a[_0xef61('0x4a')][_0xef61('0x66')],'CampaignId':_0x22006a[_0xef61('0x4a')][_0xef61('0x7e')],'ContactId':_0x22006a[_0xef61('0x4a')][_0xef61('0x7d')]}})['then'](handleEntityNotFound(_0x317c4a,null))[_0xef61('0x28')](function(_0x660c71){if(_0x660c71){return _0x660c71;}return null;})[_0xef61('0x28')](respondWithResult(_0x317c4a,null))[_0xef61('0x45')](handleError(_0x317c4a,null));}; \ No newline at end of file +var _0xd8fb=['updatedAt','select','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','toString','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','keys','include','options','find','describe','body','uniqueid','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','reCallContacts','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt'];(function(_0x89e963,_0x25a348){var _0x556241=function(_0x59a635){while(--_0x59a635){_0x89e963['push'](_0x89e963['shift']());}};_0x556241(++_0x25a348);}(_0xd8fb,0x99));var _0xbd8f=function(_0x110294,_0x57ed3d){_0x110294=_0x110294-0x0;var _0x2e225e=_0xd8fb[_0x110294];return _0x2e225e;};'use strict';var emlformat=require(_0xbd8f('0x0'));var rimraf=require(_0xbd8f('0x1'));var zipdir=require(_0xbd8f('0x2'));var jsonpatch=require(_0xbd8f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd8f('0x4'));var util=require(_0xbd8f('0x5'));var path=require('path');var sox=require(_0xbd8f('0x6'));var csv=require(_0xbd8f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd8f('0x8'));var _=require('lodash');var squel=require(_0xbd8f('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd8f('0xa'));var deskjs=require(_0xbd8f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd8f('0xc'));var Redis=require(_0xbd8f('0xd'));var authService=require(_0xbd8f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbd8f('0xf'));var hardwareService=require(_0xbd8f('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xbd8f('0x11'));var config=require(_0xbd8f('0x12'));var licenseUtil=require(_0xbd8f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x230988,_0x159f09){_0x159f09=_0x159f09||0xcc;return function(_0x39be16){if(_0x39be16){return _0x230988[_0xbd8f('0x14')](_0x159f09);}return _0x230988[_0xbd8f('0x15')](_0x159f09)[_0xbd8f('0x16')]();};}function respondWithResult(_0x37d4d5,_0x29ffe8){_0x29ffe8=_0x29ffe8||0xc8;return function(_0x14606c){if(_0x14606c){return _0x37d4d5['status'](_0x29ffe8)[_0xbd8f('0x17')](_0x14606c);}};}function respondWithFilteredResult(_0x829fb2,_0xa57e91){return function(_0x10d72e){if(_0x10d72e){var _0x4da96f=typeof _0xa57e91[_0xbd8f('0x18')]===_0xbd8f('0x19')&&typeof _0xa57e91['limit']===_0xbd8f('0x19');var _0xf5e7a=_0x10d72e['count'];var _0x4435b9=_0x4da96f?0x0:_0xa57e91[_0xbd8f('0x18')];var _0x47d317=_0x4da96f?_0x10d72e['count']:_0xa57e91[_0xbd8f('0x18')]+_0xa57e91['limit'];var _0x5705c5;if(_0x47d317>=_0xf5e7a){_0x47d317=_0xf5e7a;_0x5705c5=0xc8;}else{_0x5705c5=0xce;}_0x829fb2[_0xbd8f('0x15')](_0x5705c5);return _0x829fb2['set'](_0xbd8f('0x1a'),_0x4435b9+'-'+_0x47d317+'/'+_0xf5e7a)[_0xbd8f('0x17')](_0x10d72e);}return null;};}function patchUpdates(_0xb47c8e){return function(_0x897f25){try{jsonpatch[_0xbd8f('0x1b')](_0x897f25,_0xb47c8e,!![]);}catch(_0x20cab7){return BPromise[_0xbd8f('0x1c')](_0x20cab7);}return _0x897f25[_0xbd8f('0x1d')]();};}function saveUpdates(_0x2fbe3b,_0x775acc){return function(_0xfe4048){if(_0xfe4048){return _0xfe4048[_0xbd8f('0x1e')](_0x2fbe3b)[_0xbd8f('0x1f')](function(_0x15c4a9){return _0x15c4a9;});}return null;};}function removeEntity(_0x320ede,_0xd11ae){return function(_0x395b1b){if(_0x395b1b){return _0x395b1b['destroy']()[_0xbd8f('0x1f')](function(){_0x320ede[_0xbd8f('0x15')](0xcc)[_0xbd8f('0x16')]();});}};}function handleEntityNotFound(_0x2f3df7,_0xa88414){return function(_0x2257fd){if(!_0x2257fd){_0x2f3df7[_0xbd8f('0x14')](0x194);}return _0x2257fd;};}function handleError(_0x264e62,_0x4ea554){_0x4ea554=_0x4ea554||0x1f4;return function(_0x40cb43){logger[_0xbd8f('0x20')](_0x40cb43['stack']);if(_0x40cb43[_0xbd8f('0x21')]){delete _0x40cb43['name'];}_0x264e62[_0xbd8f('0x15')](_0x4ea554)[_0xbd8f('0x22')](_0x40cb43);};}exports[_0xbd8f('0x23')]=function(_0x202126,_0x2aefa2){var _0x247b07={},_0x4c4431={},_0x166de7={'count':0x0,'rows':[]};var _0x14f3cb=_[_0xbd8f('0x24')](db[_0xbd8f('0x25')][_0xbd8f('0x26')],function(_0x2ac26f){return{'name':_0x2ac26f[_0xbd8f('0x27')],'type':_0x2ac26f['type'][_0xbd8f('0x28')]};});_0x4c4431[_0xbd8f('0x29')]=_[_0xbd8f('0x24')](_0x14f3cb,_0xbd8f('0x21'));_0x4c4431['query']=_['keys'](_0x202126[_0xbd8f('0x2a')]);_0x4c4431[_0xbd8f('0x2b')]=_[_0xbd8f('0x2c')](_0x4c4431[_0xbd8f('0x29')],_0x4c4431['query']);_0x247b07[_0xbd8f('0x2d')]=_[_0xbd8f('0x2c')](_0x4c4431[_0xbd8f('0x29')],qs[_0xbd8f('0x2e')](_0x202126[_0xbd8f('0x2a')]['fields']));_0x247b07[_0xbd8f('0x2d')]=_0x247b07[_0xbd8f('0x2d')][_0xbd8f('0x2f')]?_0x247b07[_0xbd8f('0x2d')]:_0x4c4431[_0xbd8f('0x29')];if(!_0x202126['query'][_0xbd8f('0x30')]('nolimit')){_0x247b07[_0xbd8f('0x31')]=qs[_0xbd8f('0x31')](_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x31')]);_0x247b07[_0xbd8f('0x18')]=qs[_0xbd8f('0x18')](_0x202126['query']['offset']);}_0x247b07['order']=qs[_0xbd8f('0x32')](_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x32')]);_0x247b07[_0xbd8f('0x33')]=qs[_0xbd8f('0x2b')](_[_0xbd8f('0x34')](_0x202126[_0xbd8f('0x2a')],_0x4c4431[_0xbd8f('0x2b')]),_0x14f3cb);if(_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x35')]){_0x247b07[_0xbd8f('0x33')]=_[_0xbd8f('0x36')](_0x247b07[_0xbd8f('0x33')],{'$or':_[_0xbd8f('0x24')](_0x14f3cb,function(_0x391d45){if(_0x391d45['type']!==_0xbd8f('0x37')){var _0x4181e0={};_0x4181e0[_0x391d45['name']]={'$like':'%'+_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x35')]+'%'};return _0x4181e0;}})});}_0x247b07=_[_0xbd8f('0x36')]({},_0x247b07,_0x202126['options']);var _0x21da54={'where':_0x247b07['where']};return db[_0xbd8f('0x25')][_0xbd8f('0x38')](_0x21da54)[_0xbd8f('0x1f')](function(_0x4f2ebc){_0x166de7[_0xbd8f('0x38')]=_0x4f2ebc;if(_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x39')]){_0x247b07['include']=[{'all':!![]}];}return db[_0xbd8f('0x25')][_0xbd8f('0x3a')](_0x247b07);})[_0xbd8f('0x1f')](function(_0x351027){_0x166de7[_0xbd8f('0x3b')]=_0x351027;return _0x166de7;})[_0xbd8f('0x1f')](respondWithFilteredResult(_0x2aefa2,_0x247b07))[_0xbd8f('0x3c')](handleError(_0x2aefa2,null));};exports[_0xbd8f('0x3d')]=function(_0x14b768,_0x5e1e77){var _0x52c62b={'raw':!![],'where':{'id':_0x14b768[_0xbd8f('0x3e')]['id']}},_0x2907a3={};_0x2907a3[_0xbd8f('0x29')]=_[_0xbd8f('0x3f')](db['CmHopperFinal'][_0xbd8f('0x26')]);_0x2907a3[_0xbd8f('0x2a')]=_[_0xbd8f('0x3f')](_0x14b768[_0xbd8f('0x2a')]);_0x2907a3[_0xbd8f('0x2b')]=_['intersection'](_0x2907a3['model'],_0x2907a3[_0xbd8f('0x2a')]);_0x52c62b['attributes']=_[_0xbd8f('0x2c')](_0x2907a3[_0xbd8f('0x29')],qs[_0xbd8f('0x2e')](_0x14b768[_0xbd8f('0x2a')][_0xbd8f('0x2e')]));_0x52c62b[_0xbd8f('0x2d')]=_0x52c62b[_0xbd8f('0x2d')][_0xbd8f('0x2f')]?_0x52c62b['attributes']:_0x2907a3[_0xbd8f('0x29')];if(_0x14b768[_0xbd8f('0x2a')][_0xbd8f('0x39')]){_0x52c62b[_0xbd8f('0x40')]=[{'all':!![]}];}_0x52c62b=_[_0xbd8f('0x36')]({},_0x52c62b,_0x14b768[_0xbd8f('0x41')]);return db[_0xbd8f('0x25')][_0xbd8f('0x42')](_0x52c62b)['then'](handleEntityNotFound(_0x5e1e77,null))[_0xbd8f('0x1f')](respondWithResult(_0x5e1e77,null))[_0xbd8f('0x3c')](handleError(_0x5e1e77,null));};exports[_0xbd8f('0x43')]=function(_0x1f12dd,_0x2fdbd0){return db[_0xbd8f('0x25')][_0xbd8f('0x43')]()[_0xbd8f('0x1f')](respondWithResult(_0x2fdbd0,null))[_0xbd8f('0x3c')](handleError(_0x2fdbd0,null));};exports[_0xbd8f('0x1e')]=function(_0x406741,_0x255c59){if(_0x406741[_0xbd8f('0x44')][_0xbd8f('0x45')]){delete _0x406741[_0xbd8f('0x44')][_0xbd8f('0x45')];}return db[_0xbd8f('0x25')][_0xbd8f('0x42')]({'where':{'uniqueid':_0x406741[_0xbd8f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x255c59,null))[_0xbd8f('0x1f')](saveUpdates(_0x406741[_0xbd8f('0x44')],null))[_0xbd8f('0x1f')](respondWithResult(_0x255c59,null))[_0xbd8f('0x3c')](handleError(_0x255c59,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x1b38ad,_0x5a33c5,_0x9bfe93){return db[_0xbd8f('0x25')][_0xbd8f('0x3a')]({'raw':![],'where':{'VoiceQueueId':_0x1b38ad[_0xbd8f('0x3e')]['id']},'attributes':[[db['sequelize']['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x49')))),_0xbd8f('0x4a')],[db['sequelize']['fn'](_0xbd8f('0x46'),db['sequelize']['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x4b')))),_0xbd8f('0x4c')],[db[_0xbd8f('0x47')]['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')]('`state`\x20=\x205,\x201,\x20null'))),_0xbd8f('0x4d')],[db['sequelize']['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db['sequelize'][_0xbd8f('0x48')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x4e')))),_0xbd8f('0x4f')],[db['sequelize']['fn']('COUNT',db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x50')))),_0xbd8f('0x51')],[db['sequelize']['fn'](_0xbd8f('0x46'),db['sequelize']['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x52')))),'reCallContacts'],[db[_0xbd8f('0x47')]['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0xbd8f('0x53')]]})['then'](handleEntityNotFound(_0x5a33c5,null))[_0xbd8f('0x1f')](respondWithResult(_0x5a33c5,null))[_0xbd8f('0x3c')](handleError(_0x5a33c5,null));};exports[_0xbd8f('0x54')]=function(_0x93452d,_0x4a86a9,_0x5ea275){return db[_0xbd8f('0x25')][_0xbd8f('0x3a')]({'raw':![],'where':{'CampaignId':_0x93452d[_0xbd8f('0x3e')]['id']},'attributes':[[db[_0xbd8f('0x47')]['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x49')))),_0xbd8f('0x4a')],[db[_0xbd8f('0x47')]['fn']('COUNT',db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x4b')))),_0xbd8f('0x4c')],[db[_0xbd8f('0x47')]['fn']('COUNT',db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xbd8f('0x4d')],[db[_0xbd8f('0x47')]['fn'](_0xbd8f('0x46'),db['sequelize']['fn']('IF',db['sequelize'][_0xbd8f('0x48')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbd8f('0x47')]['literal'](_0xbd8f('0x4e')))),_0xbd8f('0x4f')],[db['sequelize']['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x50')))),'abandonedContacts'],[db['sequelize']['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x52')))),_0xbd8f('0x55')],[db['sequelize']['fn']('COUNT',db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')]['literal'](_0xbd8f('0x56')))),_0xbd8f('0x53')]]})['then'](handleEntityNotFound(_0x4a86a9,null))[_0xbd8f('0x1f')](respondWithResult(_0x4a86a9,null))[_0xbd8f('0x3c')](handleError(_0x4a86a9,null));};exports[_0xbd8f('0x57')]=function(_0x5a8c8f,_0x5c04d9,_0x2407e7){return db[_0xbd8f('0x58')][_0xbd8f('0x42')]({'where':{'id':_0x5a8c8f[_0xbd8f('0x3e')]['id']}})[_0xbd8f('0x1f')](handleEntityNotFound(_0x5c04d9,null))['then'](function(_0x200718){var _0x27ec14;if(_0x200718){_0x27ec14=squel[_0xbd8f('0x59')]()[_0xbd8f('0x5a')](_0xbd8f('0x5b'))[_0xbd8f('0x5c')]([_0xbd8f('0x5d'),_0xbd8f('0x5e'),_0xbd8f('0x5f'),_0xbd8f('0x60'),_0xbd8f('0x61'),_0xbd8f('0x62'),_0xbd8f('0x63')],squel[_0xbd8f('0x64')]()[_0xbd8f('0x65')](_0xbd8f('0x66'),_0xbd8f('0x5d'))[_0xbd8f('0x65')]('NOW()',_0xbd8f('0x5e'))[_0xbd8f('0x65')](_0xbd8f('0x67'),_0xbd8f('0x5f'))[_0xbd8f('0x65')](_0xbd8f('0x68'),'ListId')['field'](_0xbd8f('0x69'),_0xbd8f('0x61'))['field'](_0xbd8f('0x6a'),'createdAt')[_0xbd8f('0x65')](_0xbd8f('0x6a'),_0xbd8f('0x63'))[_0xbd8f('0x6b')]('cm_hopper_final')[_0xbd8f('0x33')](_0xbd8f('0x6c'),_0x5a8c8f[_0xbd8f('0x3e')]['id']['toString']())[_0xbd8f('0x33')](_0xbd8f('0x6d'),_0x5a8c8f[_0xbd8f('0x44')][_0xbd8f('0x6e')]['toString']())[_0xbd8f('0x33')](_0xbd8f('0x6f'))[_0xbd8f('0x33')](_0xbd8f('0x70'),squel[_0xbd8f('0x64')]()[_0xbd8f('0x65')](_0xbd8f('0x5d'))[_0xbd8f('0x6b')]('cm_hopper')[_0xbd8f('0x33')]('VoiceQueueId\x20=\x20?',_0x5a8c8f[_0xbd8f('0x3e')]['id']['toString']()))[_0xbd8f('0x33')](_0xbd8f('0x70'),squel['select']()[_0xbd8f('0x65')](_0xbd8f('0x71'))[_0xbd8f('0x6b')](_0xbd8f('0x72'))['where'](_0xbd8f('0x6c'),_0x5a8c8f[_0xbd8f('0x3e')]['id'][_0xbd8f('0x73')]())[_0xbd8f('0x33')]('state\x20=\x204'))['group'](_0xbd8f('0x5f')))[_0xbd8f('0x73')]();return db[_0xbd8f('0x47')][_0xbd8f('0x2a')](_0x27ec14);}return[];})[_0xbd8f('0x1f')](respondWithResult(_0x5c04d9,null))['catch'](handleError(_0x5c04d9,null));};exports[_0xbd8f('0x74')]=function(_0x13314f,_0x328bd6,_0x11a05a){return db[_0xbd8f('0x75')]['find']({'where':{'id':_0x13314f['params']['id']}})['then'](handleEntityNotFound(_0x328bd6,null))[_0xbd8f('0x1f')](function(_0x5df0e1){var _0x535869;if(_0x5df0e1){_0x535869=squel['insert']()[_0xbd8f('0x5a')](_0xbd8f('0x5b'))[_0xbd8f('0x5c')]([_0xbd8f('0x5d'),_0xbd8f('0x5e'),_0xbd8f('0x5f'),_0xbd8f('0x60'),_0xbd8f('0x76'),'createdAt',_0xbd8f('0x63')],squel[_0xbd8f('0x64')]()[_0xbd8f('0x65')]('ANY_VALUE(calleridnum)',_0xbd8f('0x5d'))[_0xbd8f('0x65')](_0xbd8f('0x6a'),_0xbd8f('0x5e'))[_0xbd8f('0x65')](_0xbd8f('0x67'),_0xbd8f('0x5f'))[_0xbd8f('0x65')](_0xbd8f('0x68'),_0xbd8f('0x60'))['field'](_0xbd8f('0x77'),_0xbd8f('0x76'))[_0xbd8f('0x65')]('NOW()',_0xbd8f('0x62'))['field'](_0xbd8f('0x6a'),_0xbd8f('0x63'))[_0xbd8f('0x6b')](_0xbd8f('0x72'))[_0xbd8f('0x33')]('CampaignId\x20=\x20?',_0x13314f[_0xbd8f('0x3e')]['id'][_0xbd8f('0x73')]())[_0xbd8f('0x33')](_0xbd8f('0x6d'),_0x13314f[_0xbd8f('0x44')][_0xbd8f('0x6e')]['toString']())[_0xbd8f('0x33')](_0xbd8f('0x6f'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xbd8f('0x64')]()['field']('phone')['from'](_0xbd8f('0x5b'))[_0xbd8f('0x33')](_0xbd8f('0x78'),_0x13314f[_0xbd8f('0x3e')]['id']['toString']()))[_0xbd8f('0x33')](_0xbd8f('0x70'),squel['select']()['field'](_0xbd8f('0x71'))['from'](_0xbd8f('0x72'))['where']('CampaignId\x20=\x20?',_0x13314f[_0xbd8f('0x3e')]['id'][_0xbd8f('0x73')]())[_0xbd8f('0x33')](_0xbd8f('0x79')))[_0xbd8f('0x7a')]('ContactId'))[_0xbd8f('0x73')]();return db[_0xbd8f('0x47')][_0xbd8f('0x2a')](_0x535869);}return[];})['then'](respondWithResult(_0x328bd6,null))[_0xbd8f('0x3c')](handleError(_0x328bd6,null));};exports[_0xbd8f('0x7b')]=function(_0x38d1a6,_0x31b92c,_0x11fb11){return db[_0xbd8f('0x7c')][_0xbd8f('0x7d')]({'where':{'VoiceQueueId':_0x38d1a6[_0xbd8f('0x44')][_0xbd8f('0x61')],'CampaignId':_0x38d1a6[_0xbd8f('0x44')]['CampaignId'],'ContactId':_0x38d1a6['body']['ContactId']}})['then'](handleEntityNotFound(_0x31b92c,null))[_0xbd8f('0x1f')](function(_0x3ff503){if(_0x3ff503){return _0x3ff503;}return null;})['then'](respondWithResult(_0x31b92c,null))['catch'](handleError(_0x31b92c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index de6cd25..80ad9d2 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 _0xee41=['../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xee41,0xbd));var _0x1ee4=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xee41[_0x55f8b4];return _0x2475f9;};'use strict';var _=require('lodash');var util=require(_0x1ee4('0x0'));var logger=require(_0x1ee4('0x1'))(_0x1ee4('0x2'));var moment=require('moment');var BPromise=require(_0x1ee4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ee4('0x4'));var rimraf=require(_0x1ee4('0x5'));var config=require(_0x1ee4('0x6'));var attributes=require(_0x1ee4('0x7'));module[_0x1ee4('0x8')]=function(_0x15f3aa,_0x2e37ec){return _0x15f3aa['define'](_0x1ee4('0x9'),attributes,{'tableName':_0x1ee4('0xa'),'paranoid':![],'indexes':[{'name':_0x1ee4('0xb'),'fields':[_0x1ee4('0xb')]},{'name':_0x1ee4('0xc'),'fields':[_0x1ee4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x21d8=['bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x34e4a0,_0x1fd446){var _0x3ead3e=function(_0x47adec){while(--_0x47adec){_0x34e4a0['push'](_0x34e4a0['shift']());}};_0x3ead3e(++_0x1fd446);}(_0x21d8,0x91));var _0x821d=function(_0x908de7,_0x21e550){_0x908de7=_0x908de7-0x0;var _0x391718=_0x21d8[_0x908de7];return _0x391718;};'use strict';var _=require(_0x821d('0x0'));var util=require(_0x821d('0x1'));var logger=require(_0x821d('0x2'))(_0x821d('0x3'));var moment=require(_0x821d('0x4'));var BPromise=require(_0x821d('0x5'));var rp=require(_0x821d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x821d('0x7'));var config=require(_0x821d('0x8'));var attributes=require(_0x821d('0x9'));module[_0x821d('0xa')]=function(_0x34c825,_0x3c4689){return _0x34c825[_0x821d('0xb')]('CmHopperFinal',attributes,{'tableName':_0x821d('0xc'),'paranoid':![],'indexes':[{'name':_0x821d('0xd'),'fields':['calleridnum']},{'name':_0x821d('0xe'),'fields':[_0x821d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index fa10f98..a7c3bf1 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(_0x2bd2d9,_0x530fc0){var _0x406a2f=function(_0x2e3029){while(--_0x2e3029){_0x2bd2d9['push'](_0x2bd2d9['shift']());}};_0x406a2f(++_0x530fc0);}(_0xb10b,0x12a));var _0xbb10=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xb10b[_0xc82d1a];return _0x32fad2;};'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(_0x20244d,_0x143894){var _0x50d712=function(_0x15c451){while(--_0x15c451){_0x20244d['push'](_0x20244d['shift']());}};_0x50d712(++_0x143894);}(_0xb10b,0x12a));var _0xbb10=function(_0x3b8bb3,_0x29136d){_0x3b8bb3=_0x3b8bb3-0x0;var _0x420eb8=_0xb10b[_0x3b8bb3];return _0x420eb8;};'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 81a0e09..1c7cdde 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 _0x56e7=['countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','/voice/queue/countAttributes/:id'];(function(_0x4efeb8,_0x5cb049){var _0x4f1e3a=function(_0x2ce084){while(--_0x2ce084){_0x4efeb8['push'](_0x4efeb8['shift']());}};_0x4f1e3a(++_0x5cb049);}(_0x56e7,0x93));var _0x756e=function(_0x3f7761,_0x1094b0){_0x3f7761=_0x3f7761-0x0;var _0x10d894=_0x56e7[_0x3f7761];return _0x10d894;};'use strict';var multer=require(_0x756e('0x0'));var util=require(_0x756e('0x1'));var path=require(_0x756e('0x2'));var timeout=require(_0x756e('0x3'));var express=require(_0x756e('0x4'));var router=express[_0x756e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x756e('0x6'));var interaction=require(_0x756e('0x7'));var config=require(_0x756e('0x8'));var controller=require('./cmHopperFinal.controller');router[_0x756e('0x9')]('/',auth[_0x756e('0xa')](),controller['index']);router['get'](_0x756e('0xb'),auth[_0x756e('0xa')](),controller['describe']);router['get']('/:id',auth[_0x756e('0xa')](),controller[_0x756e('0xc')]);router[_0x756e('0x9')](_0x756e('0xd'),auth[_0x756e('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x756e('0x9')]('/campaign/countAttributes/:id',auth[_0x756e('0xa')](),controller[_0x756e('0xe')]);router[_0x756e('0xf')]('/voice/queue/moveContacts/:id',auth[_0x756e('0xa')](),controller[_0x756e('0x10')]);router[_0x756e('0xf')]('/voice/campaign/moveContacts/:id',auth[_0x756e('0xa')](),controller[_0x756e('0x11')]);router[_0x756e('0xf')](_0x756e('0x12'),auth[_0x756e('0xa')](),controller[_0x756e('0x13')]);router['put'](_0x756e('0x14'),auth[_0x756e('0xa')](),controller[_0x756e('0x15')]);module[_0x756e('0x16')]=router; \ No newline at end of file +var _0x9500=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','/describe','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','put','update','exports'];(function(_0x1a2ed1,_0x14112f){var _0x2d6176=function(_0x20901d){while(--_0x20901d){_0x1a2ed1['push'](_0x1a2ed1['shift']());}};_0x2d6176(++_0x14112f);}(_0x9500,0xb6));var _0x0950=function(_0x57c173,_0x2512c3){_0x57c173=_0x57c173-0x0;var _0x1b7077=_0x9500[_0x57c173];return _0x1b7077;};'use strict';var multer=require(_0x0950('0x0'));var util=require(_0x0950('0x1'));var path=require(_0x0950('0x2'));var timeout=require(_0x0950('0x3'));var express=require(_0x0950('0x4'));var router=express[_0x0950('0x5')]();var fs_extra=require(_0x0950('0x6'));var auth=require(_0x0950('0x7'));var interaction=require(_0x0950('0x8'));var config=require(_0x0950('0x9'));var controller=require(_0x0950('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0950('0xb')](_0x0950('0xc'),auth[_0x0950('0xd')](),controller['describe']);router[_0x0950('0xb')](_0x0950('0xe'),auth['isAuthenticated'](),controller[_0x0950('0xf')]);router[_0x0950('0xb')](_0x0950('0x10'),auth[_0x0950('0xd')](),controller[_0x0950('0x11')]);router['get'](_0x0950('0x12'),auth['isAuthenticated'](),controller[_0x0950('0x13')]);router[_0x0950('0x14')](_0x0950('0x15'),auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router['post']('/voice/campaign/moveContacts/:id',auth[_0x0950('0xd')](),controller[_0x0950('0x16')]);router[_0x0950('0x14')]('/checkContactHopper',auth['isAuthenticated'](),controller['checkContactHopper']);router[_0x0950('0x17')](_0x0950('0xe'),auth[_0x0950('0xd')](),controller[_0x0950('0x18')]);module[_0x0950('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index a1847cf..ecdfea7 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 _0xf2a3=['STRING','DATE','BOOLEAN','INTEGER'];(function(_0x56c40d,_0x2249f8){var _0xc14a36=function(_0x125157){while(--_0x125157){_0x56c40d['push'](_0x56c40d['shift']());}};_0xc14a36(++_0x2249f8);}(_0xf2a3,0x19f));var _0x3f2a=function(_0x13f3af,_0x2ac326){_0x13f3af=_0x13f3af-0x0;var _0xda3c9f=_0xf2a3[_0x13f3af];return _0xda3c9f;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x3f2a('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x3f2a('0x1')]},'scheduledat':{'type':Sequelize[_0x3f2a('0x2')]},'countbusyretry':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3f2a('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x3f2a('0x1')]},'originatecalleridname':{'type':Sequelize[_0x3f2a('0x1')]},'calleridnum':{'type':Sequelize[_0x3f2a('0x1')]},'calleridname':{'type':Sequelize[_0x3f2a('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x3f2a('0x2')]},'droptime':{'type':Sequelize[_0x3f2a('0x2')]},'endtime':{'type':Sequelize[_0x3f2a('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x3f2a('0x1')]},'campaigntype':{'type':Sequelize[_0x3f2a('0x1')]},'membername':{'type':Sequelize[_0x3f2a('0x1')]},'reason':{'type':Sequelize[_0x3f2a('0x1')]},'amd':{'type':Sequelize[_0x3f2a('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3f2a('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x3f2a('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3f2a('0x2')]},'recallme':{'type':Sequelize[_0x3f2a('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x3f2a('0x2')]},'edited':{'type':Sequelize[_0x3f2a('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3f2a('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe23a=['INTEGER','BOOLEAN','sequelize','STRING','DATE'];(function(_0x33cad7,_0x492026){var _0x381d4a=function(_0x41bc73){while(--_0x41bc73){_0x33cad7['push'](_0x33cad7['shift']());}};_0x381d4a(++_0x492026);}(_0xe23a,0xde));var _0xae23=function(_0x2e6dee,_0x1a61b0){_0x2e6dee=_0x2e6dee-0x0;var _0x47706=_0xe23a[_0x2e6dee];return _0x47706;};'use strict';var Sequelize=require(_0xae23('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xae23('0x1')]},'scheduledat':{'type':Sequelize[_0xae23('0x2')]},'countbusyretry':{'type':Sequelize[_0xae23('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xae23('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xae23('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xae23('0x1')]},'originatecalleridname':{'type':Sequelize[_0xae23('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xae23('0x2')]},'responsetime':{'type':Sequelize[_0xae23('0x2')]},'answertime':{'type':Sequelize[_0xae23('0x2')]},'droptime':{'type':Sequelize[_0xae23('0x2')]},'endtime':{'type':Sequelize[_0xae23('0x2')]},'ringtime':{'type':Sequelize[_0xae23('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xae23('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xae23('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xae23('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xae23('0x1')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xae23('0x1')]},'reason':{'type':Sequelize[_0xae23('0x1')]},'amd':{'type':Sequelize[_0xae23('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xae23('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xae23('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xae23('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xae23('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xae23('0x2')]},'edited':{'type':Sequelize[_0xae23('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xae23('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xae23('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xae23('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xae23('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 9d14acf..a880270 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 _0xed84=['uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','describe'];(function(_0x1ce269,_0x20ec6e){var _0x3c66e0=function(_0x115c45){while(--_0x115c45){_0x1ce269['push'](_0x1ce269['shift']());}};_0x3c66e0(++_0x20ec6e);}(_0xed84,0x97));var _0x4ed8=function(_0x2fd910,_0x1074cf){_0x2fd910=_0x2fd910-0x0;var _0x50fed8=_0xed84[_0x2fd910];return _0x50fed8;};'use strict';var emlformat=require(_0x4ed8('0x0'));var rimraf=require(_0x4ed8('0x1'));var zipdir=require(_0x4ed8('0x2'));var jsonpatch=require(_0x4ed8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ed8('0x4'));var Mustache=require(_0x4ed8('0x5'));var util=require(_0x4ed8('0x6'));var path=require(_0x4ed8('0x7'));var sox=require(_0x4ed8('0x8'));var csv=require(_0x4ed8('0x9'));var ejs=require(_0x4ed8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ed8('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ed8('0xc'));var toCsv=require(_0x4ed8('0x9'));var querystring=require(_0x4ed8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4ed8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4ed8('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ed8('0x10'))(_0x4ed8('0x11'));var utils=require(_0x4ed8('0x12'));var config=require(_0x4ed8('0x13'));var licenseUtil=require(_0x4ed8('0x14'));var db=require(_0x4ed8('0x15'))['db'];function respondWithStatusCode(_0x1328bc,_0x2a7aec){_0x2a7aec=_0x2a7aec||0xcc;return function(_0x260e49){if(_0x260e49){return _0x1328bc['sendStatus'](_0x2a7aec);}return _0x1328bc[_0x4ed8('0x16')](_0x2a7aec)['end']();};}function respondWithResult(_0x4ccb12,_0x5d2e04){_0x5d2e04=_0x5d2e04||0xc8;return function(_0x301765){if(_0x301765){return _0x4ccb12[_0x4ed8('0x16')](_0x5d2e04)[_0x4ed8('0x17')](_0x301765);}};}function respondWithFilteredResult(_0x425c22,_0x1eefb8){return function(_0x25fffc){if(_0x25fffc){var _0x4af4ba=typeof _0x1eefb8[_0x4ed8('0x18')]===_0x4ed8('0x19')&&typeof _0x1eefb8[_0x4ed8('0x1a')]==='undefined';var _0xe8668d=_0x25fffc['count'];var _0x33d0bc=_0x4af4ba?0x0:_0x1eefb8[_0x4ed8('0x18')];var _0x57b07e=_0x4af4ba?_0x25fffc[_0x4ed8('0x1b')]:_0x1eefb8[_0x4ed8('0x18')]+_0x1eefb8[_0x4ed8('0x1a')];var _0x304e36;if(_0x57b07e>=_0xe8668d){_0x57b07e=_0xe8668d;_0x304e36=0xc8;}else{_0x304e36=0xce;}_0x425c22[_0x4ed8('0x16')](_0x304e36);return _0x425c22[_0x4ed8('0x1c')](_0x4ed8('0x1d'),_0x33d0bc+'-'+_0x57b07e+'/'+_0xe8668d)[_0x4ed8('0x17')](_0x25fffc);}return null;};}function patchUpdates(_0x53fdf0){return function(_0x3bed89){try{jsonpatch[_0x4ed8('0x1e')](_0x3bed89,_0x53fdf0,!![]);}catch(_0xac47){return BPromise[_0x4ed8('0x1f')](_0xac47);}return _0x3bed89['save']();};}function saveUpdates(_0x351a40,_0x2f53c6){return function(_0xa1aa58){if(_0xa1aa58){return _0xa1aa58[_0x4ed8('0x20')](_0x351a40)[_0x4ed8('0x21')](function(_0x415821){return _0x415821;});}return null;};}function removeEntity(_0x4113b9,_0x4447a0){return function(_0x4fccec){if(_0x4fccec){return _0x4fccec['destroy']()[_0x4ed8('0x21')](function(){_0x4113b9[_0x4ed8('0x16')](0xcc)[_0x4ed8('0x22')]();});}};}function handleEntityNotFound(_0x3d38de,_0x25048f){return function(_0x15aa05){if(!_0x15aa05){_0x3d38de['sendStatus'](0x194);}return _0x15aa05;};}function handleError(_0xcefca7,_0xcecad7){_0xcecad7=_0xcecad7||0x1f4;return function(_0xc9e488){logger[_0x4ed8('0x23')](_0xc9e488[_0x4ed8('0x24')]);if(_0xc9e488[_0x4ed8('0x25')]){delete _0xc9e488['name'];}_0xcefca7[_0x4ed8('0x16')](_0xcecad7)[_0x4ed8('0x26')](_0xc9e488);};}exports[_0x4ed8('0x27')]=function(_0xef73a8,_0x396e14){var _0x162c22={},_0x338851={},_0x1dac02={'count':0x0,'rows':[]};var _0x42be83=_[_0x4ed8('0x28')](db[_0x4ed8('0x29')][_0x4ed8('0x2a')],function(_0x11c876){return{'name':_0x11c876[_0x4ed8('0x2b')],'type':_0x11c876[_0x4ed8('0x2c')][_0x4ed8('0x2d')]};});_0x338851['model']=_[_0x4ed8('0x28')](_0x42be83,_0x4ed8('0x25'));_0x338851[_0x4ed8('0x2e')]=_['keys'](_0xef73a8[_0x4ed8('0x2e')]);_0x338851[_0x4ed8('0x2f')]=_[_0x4ed8('0x30')](_0x338851[_0x4ed8('0x31')],_0x338851[_0x4ed8('0x2e')]);_0x162c22[_0x4ed8('0x32')]=_[_0x4ed8('0x30')](_0x338851[_0x4ed8('0x31')],qs[_0x4ed8('0x33')](_0xef73a8[_0x4ed8('0x2e')][_0x4ed8('0x33')]));_0x162c22[_0x4ed8('0x32')]=_0x162c22[_0x4ed8('0x32')][_0x4ed8('0x34')]?_0x162c22[_0x4ed8('0x32')]:_0x338851['model'];if(!_0xef73a8[_0x4ed8('0x2e')]['hasOwnProperty'](_0x4ed8('0x35'))){_0x162c22[_0x4ed8('0x1a')]=qs[_0x4ed8('0x1a')](_0xef73a8[_0x4ed8('0x2e')]['limit']);_0x162c22[_0x4ed8('0x18')]=qs[_0x4ed8('0x18')](_0xef73a8[_0x4ed8('0x2e')]['offset']);}_0x162c22[_0x4ed8('0x36')]=qs[_0x4ed8('0x37')](_0xef73a8['query'][_0x4ed8('0x37')]);_0x162c22[_0x4ed8('0x38')]=qs[_0x4ed8('0x2f')](_[_0x4ed8('0x39')](_0xef73a8[_0x4ed8('0x2e')],_0x338851['filters']),_0x42be83);if(_0xef73a8['query'][_0x4ed8('0x3a')]){_0x162c22[_0x4ed8('0x38')]=_[_0x4ed8('0x3b')](_0x162c22[_0x4ed8('0x38')],{'$or':_[_0x4ed8('0x28')](_0x42be83,function(_0x41520f){if(_0x41520f[_0x4ed8('0x2c')]!==_0x4ed8('0x3c')){var _0x9f0431={};_0x9f0431[_0x41520f['name']]={'$like':'%'+_0xef73a8['query']['filter']+'%'};return _0x9f0431;}})});}_0x162c22=_[_0x4ed8('0x3b')]({},_0x162c22,_0xef73a8[_0x4ed8('0x3d')]);var _0x62fc83={'where':_0x162c22['where']};return db[_0x4ed8('0x29')][_0x4ed8('0x1b')](_0x62fc83)[_0x4ed8('0x21')](function(_0x3d5982){_0x1dac02[_0x4ed8('0x1b')]=_0x3d5982;if(_0xef73a8[_0x4ed8('0x2e')]['includeAll']){_0x162c22['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x4ed8('0x3e')](_0x162c22);})[_0x4ed8('0x21')](function(_0x4b7ee6){_0x1dac02[_0x4ed8('0x3f')]=_0x4b7ee6;return _0x1dac02;})[_0x4ed8('0x21')](respondWithFilteredResult(_0x396e14,_0x162c22))[_0x4ed8('0x40')](handleError(_0x396e14,null));};exports[_0x4ed8('0x41')]=function(_0x5233d1,_0x490903){var _0xf95595={'raw':!![],'where':{'id':_0x5233d1[_0x4ed8('0x42')]['id']}},_0x1785c2={};_0x1785c2['model']=_['keys'](db[_0x4ed8('0x29')][_0x4ed8('0x2a')]);_0x1785c2[_0x4ed8('0x2e')]=_[_0x4ed8('0x43')](_0x5233d1[_0x4ed8('0x2e')]);_0x1785c2[_0x4ed8('0x2f')]=_[_0x4ed8('0x30')](_0x1785c2[_0x4ed8('0x31')],_0x1785c2[_0x4ed8('0x2e')]);_0xf95595[_0x4ed8('0x32')]=_[_0x4ed8('0x30')](_0x1785c2[_0x4ed8('0x31')],qs['fields'](_0x5233d1[_0x4ed8('0x2e')][_0x4ed8('0x33')]));_0xf95595[_0x4ed8('0x32')]=_0xf95595[_0x4ed8('0x32')][_0x4ed8('0x34')]?_0xf95595[_0x4ed8('0x32')]:_0x1785c2[_0x4ed8('0x31')];if(_0x5233d1[_0x4ed8('0x2e')][_0x4ed8('0x44')]){_0xf95595[_0x4ed8('0x45')]=[{'all':!![]}];}_0xf95595=_[_0x4ed8('0x3b')]({},_0xf95595,_0x5233d1[_0x4ed8('0x3d')]);return db[_0x4ed8('0x29')][_0x4ed8('0x46')](_0xf95595)[_0x4ed8('0x21')](handleEntityNotFound(_0x490903,null))[_0x4ed8('0x21')](respondWithResult(_0x490903,null))['catch'](handleError(_0x490903,null));};exports['create']=function(_0x21e837,_0x5b9e58){return db[_0x4ed8('0x29')][_0x4ed8('0x47')](_0x21e837[_0x4ed8('0x48')],{})['then'](respondWithResult(_0x5b9e58,0xc9))[_0x4ed8('0x40')](handleError(_0x5b9e58,null));};exports[_0x4ed8('0x49')]=function(_0xb0372e,_0x28bf43){return db[_0x4ed8('0x29')]['describe']()['then'](respondWithResult(_0x28bf43,null))[_0x4ed8('0x40')](handleError(_0x28bf43,null));};exports['update']=function(_0x3ae5b5,_0x1dc8ca){if(_0x3ae5b5[_0x4ed8('0x48')][_0x4ed8('0x4a')]){delete _0x3ae5b5[_0x4ed8('0x48')]['uniqueid'];}return db[_0x4ed8('0x29')][_0x4ed8('0x46')]({'where':{'uniqueid':_0x3ae5b5[_0x4ed8('0x42')]['id']}})['then'](handleEntityNotFound(_0x1dc8ca,null))['then'](saveUpdates(_0x3ae5b5[_0x4ed8('0x48')],null))[_0x4ed8('0x21')](respondWithResult(_0x1dc8ca,null))[_0x4ed8('0x40')](handleError(_0x1dc8ca,null));}; \ No newline at end of file +var _0xb49c=['model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','uniqueid','eml-format','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key'];(function(_0x1600c7,_0x25caf0){var _0x2fffc9=function(_0x55e01b){while(--_0x55e01b){_0x1600c7['push'](_0x1600c7['shift']());}};_0x2fffc9(++_0x25caf0);}(_0xb49c,0x66));var _0xcb49=function(_0x36c21b,_0x3d305c){_0x36c21b=_0x36c21b-0x0;var _0x101bf1=_0xb49c[_0x36c21b];return _0x101bf1;};'use strict';var emlformat=require(_0xcb49('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcb49('0x1'));var rp=require(_0xcb49('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcb49('0x3'));var util=require('util');var path=require(_0xcb49('0x4'));var sox=require(_0xcb49('0x5'));var csv=require('to-csv');var ejs=require(_0xcb49('0x6'));var fs=require('fs');var fs_extra=require(_0xcb49('0x7'));var _=require(_0xcb49('0x8'));var squel=require(_0xcb49('0x9'));var crypto=require('crypto');var jsforce=require(_0xcb49('0xa'));var deskjs=require(_0xcb49('0xb'));var toCsv=require(_0xcb49('0xc'));var querystring=require(_0xcb49('0xd'));var Papa=require('papaparse');var Redis=require(_0xcb49('0xe'));var authService=require(_0xcb49('0xf'));var qs=require(_0xcb49('0x10'));var as=require(_0xcb49('0x11'));var hardwareService=require(_0xcb49('0x12'));var logger=require(_0xcb49('0x13'))(_0xcb49('0x14'));var utils=require(_0xcb49('0x15'));var config=require(_0xcb49('0x16'));var licenseUtil=require(_0xcb49('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x356060,_0x4fbe02){_0x4fbe02=_0x4fbe02||0xcc;return function(_0x488477){if(_0x488477){return _0x356060[_0xcb49('0x18')](_0x4fbe02);}return _0x356060['status'](_0x4fbe02)[_0xcb49('0x19')]();};}function respondWithResult(_0x2ddcd0,_0x401168){_0x401168=_0x401168||0xc8;return function(_0x4a969e){if(_0x4a969e){return _0x2ddcd0[_0xcb49('0x1a')](_0x401168)[_0xcb49('0x1b')](_0x4a969e);}};}function respondWithFilteredResult(_0x28728f,_0x1c0d15){return function(_0x435424){if(_0x435424){var _0x679979=typeof _0x1c0d15[_0xcb49('0x1c')]===_0xcb49('0x1d')&&typeof _0x1c0d15[_0xcb49('0x1e')]===_0xcb49('0x1d');var _0x2d0455=_0x435424['count'];var _0x35ab31=_0x679979?0x0:_0x1c0d15[_0xcb49('0x1c')];var _0x3dbba4=_0x679979?_0x435424[_0xcb49('0x1f')]:_0x1c0d15[_0xcb49('0x1c')]+_0x1c0d15[_0xcb49('0x1e')];var _0x586d3b;if(_0x3dbba4>=_0x2d0455){_0x3dbba4=_0x2d0455;_0x586d3b=0xc8;}else{_0x586d3b=0xce;}_0x28728f[_0xcb49('0x1a')](_0x586d3b);return _0x28728f['set'](_0xcb49('0x20'),_0x35ab31+'-'+_0x3dbba4+'/'+_0x2d0455)[_0xcb49('0x1b')](_0x435424);}return null;};}function patchUpdates(_0x289e43){return function(_0x14affe){try{jsonpatch[_0xcb49('0x21')](_0x14affe,_0x289e43,!![]);}catch(_0x3b26e8){return BPromise['reject'](_0x3b26e8);}return _0x14affe[_0xcb49('0x22')]();};}function saveUpdates(_0x5e1a6c,_0x1ad59c){return function(_0x3b765b){if(_0x3b765b){return _0x3b765b[_0xcb49('0x23')](_0x5e1a6c)['then'](function(_0x5dcf04){return _0x5dcf04;});}return null;};}function removeEntity(_0x268884,_0xb9e620){return function(_0x42a5eb){if(_0x42a5eb){return _0x42a5eb[_0xcb49('0x24')]()[_0xcb49('0x25')](function(){_0x268884[_0xcb49('0x1a')](0xcc)[_0xcb49('0x19')]();});}};}function handleEntityNotFound(_0x2d5259,_0x39acd3){return function(_0x35db13){if(!_0x35db13){_0x2d5259[_0xcb49('0x18')](0x194);}return _0x35db13;};}function handleError(_0x414d1c,_0x4faad9){_0x4faad9=_0x4faad9||0x1f4;return function(_0x27947a){logger[_0xcb49('0x26')](_0x27947a[_0xcb49('0x27')]);if(_0x27947a[_0xcb49('0x28')]){delete _0x27947a[_0xcb49('0x28')];}_0x414d1c['status'](_0x4faad9)['send'](_0x27947a);};}exports[_0xcb49('0x29')]=function(_0x4d488,_0x1315e4){var _0xe6f538={},_0xc063d9={},_0x547ff0={'count':0x0,'rows':[]};var _0x54e799=_[_0xcb49('0x2a')](db[_0xcb49('0x2b')][_0xcb49('0x2c')],function(_0x127107){return{'name':_0x127107[_0xcb49('0x2d')],'type':_0x127107[_0xcb49('0x2e')][_0xcb49('0x2f')]};});_0xc063d9[_0xcb49('0x30')]=_[_0xcb49('0x2a')](_0x54e799,_0xcb49('0x28'));_0xc063d9['query']=_[_0xcb49('0x31')](_0x4d488[_0xcb49('0x32')]);_0xc063d9['filters']=_[_0xcb49('0x33')](_0xc063d9[_0xcb49('0x30')],_0xc063d9['query']);_0xe6f538[_0xcb49('0x34')]=_[_0xcb49('0x33')](_0xc063d9[_0xcb49('0x30')],qs[_0xcb49('0x35')](_0x4d488['query']['fields']));_0xe6f538[_0xcb49('0x34')]=_0xe6f538[_0xcb49('0x34')][_0xcb49('0x36')]?_0xe6f538[_0xcb49('0x34')]:_0xc063d9['model'];if(!_0x4d488[_0xcb49('0x32')]['hasOwnProperty'](_0xcb49('0x37'))){_0xe6f538[_0xcb49('0x1e')]=qs['limit'](_0x4d488[_0xcb49('0x32')]['limit']);_0xe6f538[_0xcb49('0x1c')]=qs[_0xcb49('0x1c')](_0x4d488[_0xcb49('0x32')]['offset']);}_0xe6f538[_0xcb49('0x38')]=qs[_0xcb49('0x39')](_0x4d488[_0xcb49('0x32')][_0xcb49('0x39')]);_0xe6f538[_0xcb49('0x3a')]=qs[_0xcb49('0x3b')](_[_0xcb49('0x3c')](_0x4d488[_0xcb49('0x32')],_0xc063d9['filters']),_0x54e799);if(_0x4d488['query']['filter']){_0xe6f538['where']=_[_0xcb49('0x3d')](_0xe6f538[_0xcb49('0x3a')],{'$or':_['map'](_0x54e799,function(_0x182ad3){if(_0x182ad3['type']!==_0xcb49('0x3e')){var _0x139745={};_0x139745[_0x182ad3[_0xcb49('0x28')]]={'$like':'%'+_0x4d488[_0xcb49('0x32')]['filter']+'%'};return _0x139745;}})});}_0xe6f538=_[_0xcb49('0x3d')]({},_0xe6f538,_0x4d488[_0xcb49('0x3f')]);var _0x4d281e={'where':_0xe6f538[_0xcb49('0x3a')]};return db[_0xcb49('0x2b')][_0xcb49('0x1f')](_0x4d281e)['then'](function(_0x10a796){_0x547ff0[_0xcb49('0x1f')]=_0x10a796;if(_0x4d488[_0xcb49('0x32')][_0xcb49('0x40')]){_0xe6f538[_0xcb49('0x41')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xe6f538);})[_0xcb49('0x25')](function(_0x48a856){_0x547ff0[_0xcb49('0x42')]=_0x48a856;return _0x547ff0;})[_0xcb49('0x25')](respondWithFilteredResult(_0x1315e4,_0xe6f538))[_0xcb49('0x43')](handleError(_0x1315e4,null));};exports[_0xcb49('0x44')]=function(_0x2325f5,_0x2846a5){var _0x42225a={'raw':!![],'where':{'id':_0x2325f5[_0xcb49('0x45')]['id']}},_0x56a91d={};_0x56a91d['model']=_[_0xcb49('0x31')](db['CmHopperHistory'][_0xcb49('0x2c')]);_0x56a91d[_0xcb49('0x32')]=_[_0xcb49('0x31')](_0x2325f5[_0xcb49('0x32')]);_0x56a91d['filters']=_[_0xcb49('0x33')](_0x56a91d[_0xcb49('0x30')],_0x56a91d[_0xcb49('0x32')]);_0x42225a[_0xcb49('0x34')]=_['intersection'](_0x56a91d[_0xcb49('0x30')],qs[_0xcb49('0x35')](_0x2325f5[_0xcb49('0x32')]['fields']));_0x42225a[_0xcb49('0x34')]=_0x42225a[_0xcb49('0x34')][_0xcb49('0x36')]?_0x42225a[_0xcb49('0x34')]:_0x56a91d[_0xcb49('0x30')];if(_0x2325f5[_0xcb49('0x32')][_0xcb49('0x40')]){_0x42225a[_0xcb49('0x41')]=[{'all':!![]}];}_0x42225a=_['merge']({},_0x42225a,_0x2325f5[_0xcb49('0x3f')]);return db[_0xcb49('0x2b')][_0xcb49('0x46')](_0x42225a)[_0xcb49('0x25')](handleEntityNotFound(_0x2846a5,null))[_0xcb49('0x25')](respondWithResult(_0x2846a5,null))[_0xcb49('0x43')](handleError(_0x2846a5,null));};exports[_0xcb49('0x47')]=function(_0x3ba2e8,_0x381f8f){return db[_0xcb49('0x2b')][_0xcb49('0x47')](_0x3ba2e8[_0xcb49('0x48')],{})[_0xcb49('0x25')](respondWithResult(_0x381f8f,0xc9))[_0xcb49('0x43')](handleError(_0x381f8f,null));};exports[_0xcb49('0x49')]=function(_0x36c2de,_0x58a48d){return db[_0xcb49('0x2b')]['describe']()['then'](respondWithResult(_0x58a48d,null))['catch'](handleError(_0x58a48d,null));};exports['update']=function(_0x39757b,_0x179946){if(_0x39757b['body'][_0xcb49('0x4a')]){delete _0x39757b['body'][_0xcb49('0x4a')];}return db[_0xcb49('0x2b')][_0xcb49('0x46')]({'where':{'uniqueid':_0x39757b[_0xcb49('0x45')]['id']}})[_0xcb49('0x25')](handleEntityNotFound(_0x179946,null))['then'](saveUpdates(_0x39757b[_0xcb49('0x48')],null))[_0xcb49('0x25')](respondWithResult(_0x179946,null))[_0xcb49('0x43')](handleError(_0x179946,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7b7b87a..fbb86b9 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 _0xff01=['request-promise','path','../../config/environment','exports','cm_hopper_history','endtime','uniqueid','lodash','util','api','bluebird'];(function(_0x238a68,_0x1587b3){var _0x415da7=function(_0x119f17){while(--_0x119f17){_0x238a68['push'](_0x238a68['shift']());}};_0x415da7(++_0x1587b3);}(_0xff01,0xb7));var _0x1ff0=function(_0xa19129,_0x41e40c){_0xa19129=_0xa19129-0x0;var _0x145c9b=_0xff01[_0xa19129];return _0x145c9b;};'use strict';var _=require(_0x1ff0('0x0'));var util=require(_0x1ff0('0x1'));var logger=require('../../config/logger')(_0x1ff0('0x2'));var moment=require('moment');var BPromise=require(_0x1ff0('0x3'));var rp=require(_0x1ff0('0x4'));var fs=require('fs');var path=require(_0x1ff0('0x5'));var rimraf=require('rimraf');var config=require(_0x1ff0('0x6'));var attributes=require('./cmHopperHistory.attributes');module[_0x1ff0('0x7')]=function(_0x4fd1b6,_0x3f8ca1){return _0x4fd1b6['define']('CmHopperHistory',attributes,{'tableName':_0x1ff0('0x8'),'paranoid':![],'indexes':[{'name':_0x1ff0('0x9'),'fields':['endtime']},{'name':_0x1ff0('0xa'),'fields':[_0x1ff0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94e6=['bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','endtime','lodash','../../config/logger','api','moment'];(function(_0x3617a5,_0x20863a){var _0x5ee893=function(_0x382888){while(--_0x382888){_0x3617a5['push'](_0x3617a5['shift']());}};_0x5ee893(++_0x20863a);}(_0x94e6,0x194));var _0x694e=function(_0x83c61f,_0x584a19){_0x83c61f=_0x83c61f-0x0;var _0x5cf1d2=_0x94e6[_0x83c61f];return _0x5cf1d2;};'use strict';var _=require(_0x694e('0x0'));var util=require('util');var logger=require(_0x694e('0x1'))(_0x694e('0x2'));var moment=require(_0x694e('0x3'));var BPromise=require(_0x694e('0x4'));var rp=require(_0x694e('0x5'));var fs=require('fs');var path=require(_0x694e('0x6'));var rimraf=require('rimraf');var config=require(_0x694e('0x7'));var attributes=require(_0x694e('0x8'));module['exports']=function(_0x59abaf,_0x43238f){return _0x59abaf[_0x694e('0x9')](_0x694e('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x694e('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 393499c..59e03c0 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 _0xee64=['../../config/utils','../../config/logger','client','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CmHopperHistory','create','body','options','raw','then','CreateCmHopperHistory','debug','AvgHandleTime','findAll','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','where','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\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','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xe2a1aa,_0x525d7b){var _0x5a8362=function(_0x39aece){while(--_0x39aece){_0xe2a1aa['push'](_0xe2a1aa['shift']());}};_0x5a8362(++_0x525d7b);}(_0xee64,0x14d));var _0x4ee6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee64[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4ee6('0x0'));var util=require(_0x4ee6('0x1'));var moment=require(_0x4ee6('0x2'));var BPromise=require(_0x4ee6('0x3'));var rs=require(_0x4ee6('0x4'));var fs=require('fs');var Redis=require(_0x4ee6('0x5'));var db=require(_0x4ee6('0x6'))['db'];var utils=require(_0x4ee6('0x7'));var logger=require(_0x4ee6('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4ee6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e2374,_0x55e889,_0x53756f){return new BPromise(function(_0x57d90a,_0x17afbe){return client['request'](_0x2e2374,_0x53756f)['then'](function(_0x14131c){logger[_0x4ee6('0xa')](_0x4ee6('0xb'),_0x55e889,_0x4ee6('0xc'));logger['debug'](_0x4ee6('0xd'),_0x55e889,_0x4ee6('0xc'),JSON[_0x4ee6('0xe')](_0x14131c));if(_0x14131c[_0x4ee6('0xf')]){if(_0x14131c[_0x4ee6('0xf')][_0x4ee6('0x10')]===0x1f4){logger[_0x4ee6('0xf')](_0x4ee6('0xb'),_0x55e889,_0x14131c[_0x4ee6('0xf')]['message']);return _0x17afbe(_0x14131c['error'][_0x4ee6('0x11')]);}logger[_0x4ee6('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x55e889,_0x14131c[_0x4ee6('0xf')][_0x4ee6('0x11')]);return _0x57d90a(_0x14131c['error']['message']);}else{logger[_0x4ee6('0xa')](_0x4ee6('0xb'),_0x55e889,'request\x20sent');_0x57d90a(_0x14131c['result'][_0x4ee6('0x11')]);}})[_0x4ee6('0x12')](function(_0xe79049){logger[_0x4ee6('0xf')](_0x4ee6('0xb'),_0x55e889,_0xe79049);_0x17afbe(_0xe79049);});});}exports['CreateCmHopperHistory']=function(_0x253ce0){var _0x1d1cad=this;return new Promise(function(_0x42a1c5,_0x5984d8){return db[_0x4ee6('0x13')][_0x4ee6('0x14')](_0x253ce0[_0x4ee6('0x15')],{'raw':_0x253ce0[_0x4ee6('0x16')]?_0x253ce0[_0x4ee6('0x16')][_0x4ee6('0x17')]===undefined?!![]:![]:!![]})[_0x4ee6('0x18')](function(_0x16df0a){logger['info'](_0x4ee6('0x19'),_0x253ce0);logger[_0x4ee6('0x1a')](_0x4ee6('0x19'),_0x253ce0,JSON['stringify'](_0x16df0a));_0x42a1c5(_0x16df0a);})[_0x4ee6('0x12')](function(_0x5e5786){logger[_0x4ee6('0xf')]('CreateCmHopperHistory',_0x5e5786[_0x4ee6('0x11')],_0x253ce0);_0x5984d8(_0x1d1cad[_0x4ee6('0xf')](0x1f4,_0x5e5786[_0x4ee6('0x11')]));});});};exports[_0x4ee6('0x1b')]=function(_0x324cd4){var _0x5d09bb=this;return new Promise(function(_0x284742,_0x43755e){return db[_0x4ee6('0x13')][_0x4ee6('0x1c')]({'raw':_0x324cd4[_0x4ee6('0x16')]?_0x324cd4[_0x4ee6('0x16')][_0x4ee6('0x17')]===undefined?!![]:![]:!![],'where':_0x324cd4[_0x4ee6('0x16')]?_0x324cd4[_0x4ee6('0x16')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')][_0x4ee6('0x1f')]('id')),_0x4ee6('0x20')],[db['sequelize']['fn']('COUNT',db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x22')))),_0x4ee6('0x23')],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x25'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')]['literal'](_0x4ee6('0x26')))),_0x4ee6('0x27')],[db['sequelize']['fn'](_0x4ee6('0x25'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x28')))),_0x4ee6('0x29')]]})['then'](function(_0x565dff){logger['info'](_0x4ee6('0x1b'),_0x324cd4);logger['debug'](_0x4ee6('0x1b'),_0x324cd4,JSON[_0x4ee6('0xe')](_0x565dff));_0x284742(_0x565dff);})['catch'](function(_0x115fc6){logger[_0x4ee6('0xf')](_0x4ee6('0x1b'),_0x115fc6[_0x4ee6('0x11')],_0x324cd4);_0x43755e(_0x5d09bb[_0x4ee6('0xf')](0x1f4,_0x115fc6['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x1132d4){var _0x203723=this;return new Promise(function(_0x498dec,_0x2b7527){return db['CmHopperHistory']['findAll']({'raw':_0x1132d4[_0x4ee6('0x16')]?_0x1132d4[_0x4ee6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1132d4[_0x4ee6('0x16')]?_0x1132d4[_0x4ee6('0x16')][_0x4ee6('0x2a')]||null:null,'attributes':[[_0x4ee6('0x2b'),_0x4ee6('0x2c')],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db['sequelize']['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x4ee6('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x4ee6('0x21')](_0x4ee6('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db['sequelize']['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x22')))),_0x4ee6('0x2f')],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')]['literal'](_0x4ee6('0x30')))),_0x4ee6('0x31')],[db['sequelize']['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x32')))),'outboundCongestionCallsDay'],[db[_0x4ee6('0x1e')]['fn']('COUNT',db[_0x4ee6('0x1e')]['fn']('IF',db['sequelize'][_0x4ee6('0x21')](_0x4ee6('0x33')))),_0x4ee6('0x34')],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x36')))),_0x4ee6('0x37')],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')]['literal'](_0x4ee6('0x38')))),_0x4ee6('0x39')],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x3a')))),'outboundRejectCallsDay'],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x4ee6('0x3b')],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x3c')))),_0x4ee6('0x3d')],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x3e')))),_0x4ee6('0x3f')]],'group':[_0x4ee6('0x2b')]})[_0x4ee6('0x18')](function(_0x4c9627){logger[_0x4ee6('0xa')](_0x4ee6('0x40'),_0x1132d4);logger[_0x4ee6('0x1a')](_0x4ee6('0x40'),_0x1132d4,JSON['stringify'](_0x4c9627));_0x498dec(_0x4c9627);})[_0x4ee6('0x12')](function(_0x10bafc){logger[_0x4ee6('0xf')]('GetVoiceQueueHopperHistory',_0x10bafc[_0x4ee6('0x11')],_0x1132d4);_0x2b7527(_0x203723[_0x4ee6('0xf')](0x1f4,_0x10bafc[_0x4ee6('0x11')]));});});};exports[_0x4ee6('0x41')]=function(_0x13126a){var _0x25d21c=this;return new Promise(function(_0x177b33,_0x315f1c){return db['CmHopperHistory'][_0x4ee6('0x1c')]({'raw':_0x13126a[_0x4ee6('0x16')]?_0x13126a[_0x4ee6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x13126a[_0x4ee6('0x16')]?_0x13126a[_0x4ee6('0x16')][_0x4ee6('0x2a')]||null:null,'attributes':[[_0x4ee6('0x2b'),_0x4ee6('0x2c')],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')][_0x4ee6('0x1f')]('id')),_0x4ee6('0x42')],[db[_0x4ee6('0x1e')]['fn'](_0x4ee6('0x1d'),db[_0x4ee6('0x1e')]['fn']('IF',db[_0x4ee6('0x1e')][_0x4ee6('0x21')](_0x4ee6('0x22')))),_0x4ee6('0x43')]],'group':['campaign']})[_0x4ee6('0x18')](function(_0x4f2773){logger[_0x4ee6('0xa')](_0x4ee6('0x41'),_0x13126a);logger['debug'](_0x4ee6('0x41'),_0x13126a,JSON[_0x4ee6('0xe')](_0x4f2773));_0x177b33(_0x4f2773);})[_0x4ee6('0x12')](function(_0x5e121d){logger['error'](_0x4ee6('0x41'),_0x5e121d[_0x4ee6('0x11')],_0x13126a);_0x315f1c(_0x25d21c[_0x4ee6('0xf')](0x1f4,_0x5e121d[_0x4ee6('0x11')]));});});}; \ No newline at end of file +var _0xde71=['outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','`state`\x20=\x204,\x201,\x20null','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','CmHopperHistory,\x20%s,\x20%s','message','catch','create','options','CreateCmHopperHistory','findAll','raw','where','sequelize','COUNT','col','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','CmHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x48b5a2,_0x5014c7){var _0xc7f542=function(_0xa288f5){while(--_0xa288f5){_0x48b5a2['push'](_0x48b5a2['shift']());}};_0xc7f542(++_0x5014c7);}(_0xde71,0x1c1));var _0x1de7=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0xde71[_0x31295c];return _0x2c150e;};'use strict';var _=require(_0x1de7('0x0'));var util=require(_0x1de7('0x1'));var moment=require(_0x1de7('0x2'));var BPromise=require(_0x1de7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1de7('0x4'));var db=require(_0x1de7('0x5'))['db'];var utils=require(_0x1de7('0x6'));var logger=require(_0x1de7('0x7'))(_0x1de7('0x8'));var config=require(_0x1de7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1de7('0xa')][_0x1de7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8efed1,_0x1c92d9,_0x3a2f08){return new BPromise(function(_0x58a35f,_0x52940d){return client[_0x1de7('0xc')](_0x8efed1,_0x3a2f08)[_0x1de7('0xd')](function(_0x37383f){logger[_0x1de7('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x1c92d9,'request\x20sent');logger[_0x1de7('0xf')](_0x1de7('0x10'),_0x1c92d9,_0x1de7('0x11'),JSON[_0x1de7('0x12')](_0x37383f));if(_0x37383f['error']){if(_0x37383f['error'][_0x1de7('0x13')]===0x1f4){logger[_0x1de7('0x14')](_0x1de7('0x15'),_0x1c92d9,_0x37383f[_0x1de7('0x14')][_0x1de7('0x16')]);return _0x52940d(_0x37383f[_0x1de7('0x14')][_0x1de7('0x16')]);}logger[_0x1de7('0x14')](_0x1de7('0x15'),_0x1c92d9,_0x37383f['error'][_0x1de7('0x16')]);return _0x58a35f(_0x37383f['error']['message']);}else{logger['info'](_0x1de7('0x15'),_0x1c92d9,_0x1de7('0x11'));_0x58a35f(_0x37383f['result']['message']);}})[_0x1de7('0x17')](function(_0x2592c1){logger[_0x1de7('0x14')](_0x1de7('0x15'),_0x1c92d9,_0x2592c1);_0x52940d(_0x2592c1);});});}exports['CreateCmHopperHistory']=function(_0x1630d9){var _0x1bc2f7=this;return new Promise(function(_0x305c3a,_0x3b75d4){return db['CmHopperHistory'][_0x1de7('0x18')](_0x1630d9['body'],{'raw':_0x1630d9[_0x1de7('0x19')]?_0x1630d9[_0x1de7('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x24d123){logger[_0x1de7('0xe')](_0x1de7('0x1a'),_0x1630d9);logger['debug'](_0x1de7('0x1a'),_0x1630d9,JSON[_0x1de7('0x12')](_0x24d123));_0x305c3a(_0x24d123);})['catch'](function(_0xffd5cd){logger[_0x1de7('0x14')](_0x1de7('0x1a'),_0xffd5cd[_0x1de7('0x16')],_0x1630d9);_0x3b75d4(_0x1bc2f7[_0x1de7('0x14')](0x1f4,_0xffd5cd['message']));});});};exports['AvgHandleTime']=function(_0x574a06){var _0x32c80b=this;return new Promise(function(_0x5da0b2,_0x41b3d7){return db['CmHopperHistory'][_0x1de7('0x1b')]({'raw':_0x574a06[_0x1de7('0x19')]?_0x574a06[_0x1de7('0x19')][_0x1de7('0x1c')]===undefined?!![]:![]:!![],'where':_0x574a06[_0x1de7('0x19')]?_0x574a06['options'][_0x1de7('0x1d')]||null:null,'attributes':[[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db['sequelize'][_0x1de7('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x1de7('0x22')],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db['sequelize'][_0x1de7('0x21')](_0x1de7('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x24')))),_0x1de7('0x25')],[db['sequelize']['fn'](_0x1de7('0x26'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x27')))),_0x1de7('0x28')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x26'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x29')))),_0x1de7('0x2a')]]})[_0x1de7('0xd')](function(_0x5eb0f2){logger['info'](_0x1de7('0x2b'),_0x574a06);logger[_0x1de7('0xf')](_0x1de7('0x2b'),_0x574a06,JSON[_0x1de7('0x12')](_0x5eb0f2));_0x5da0b2(_0x5eb0f2);})[_0x1de7('0x17')](function(_0x35d0cf){logger['error']('AvgHandleTime',_0x35d0cf[_0x1de7('0x16')],_0x574a06);_0x41b3d7(_0x32c80b['error'](0x1f4,_0x35d0cf[_0x1de7('0x16')]));});});};exports[_0x1de7('0x2c')]=function(_0x368da5){var _0x2db375=this;return new Promise(function(_0x24c8a9,_0x432ac2){return db[_0x1de7('0x2d')][_0x1de7('0x1b')]({'raw':_0x368da5[_0x1de7('0x19')]?_0x368da5[_0x1de7('0x19')][_0x1de7('0x1c')]===undefined?!![]:![]:!![],'where':_0x368da5[_0x1de7('0x19')]?_0x368da5[_0x1de7('0x19')][_0x1de7('0x1d')]||null:null,'attributes':[[_0x1de7('0x2e'),'name'],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x2f')))),'outboundNoSuchCallsDay'],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x30')))),_0x1de7('0x31')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x1de7('0x32')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x33')))),_0x1de7('0x34')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x35')))),_0x1de7('0x36')],[db['sequelize']['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x37')))),_0x1de7('0x38')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x39')))),_0x1de7('0x3a')],[db['sequelize']['fn'](_0x1de7('0x1f'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x3b')))),'outboundUnknownCallsDay'],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0x1de7('0x3c')],[db[_0x1de7('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x3d')))),_0x1de7('0x3e')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db['sequelize'][_0x1de7('0x21')](_0x1de7('0x3f')))),_0x1de7('0x40')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x41')))),_0x1de7('0x42')],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x43')))),_0x1de7('0x40')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x44')))),_0x1de7('0x45')]],'group':[_0x1de7('0x2e')]})['then'](function(_0x4a799b){logger[_0x1de7('0xe')](_0x1de7('0x2c'),_0x368da5);logger['debug'](_0x1de7('0x2c'),_0x368da5,JSON['stringify'](_0x4a799b));_0x24c8a9(_0x4a799b);})['catch'](function(_0x41bf29){logger[_0x1de7('0x14')](_0x1de7('0x2c'),_0x41bf29['message'],_0x368da5);_0x432ac2(_0x2db375[_0x1de7('0x14')](0x1f4,_0x41bf29[_0x1de7('0x16')]));});});};exports[_0x1de7('0x46')]=function(_0x3a23b7){var _0x579321=this;return new Promise(function(_0x15b26e,_0x2d140d){return db['CmHopperHistory'][_0x1de7('0x1b')]({'raw':_0x3a23b7[_0x1de7('0x19')]?_0x3a23b7[_0x1de7('0x19')][_0x1de7('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a23b7[_0x1de7('0x19')]?_0x3a23b7[_0x1de7('0x19')][_0x1de7('0x1d')]||null:null,'attributes':[[_0x1de7('0x2e'),_0x1de7('0x47')],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')][_0x1de7('0x20')]('id')),_0x1de7('0x48')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x49')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x1de7('0xd')](function(_0x38ac74){logger['info'](_0x1de7('0x46'),_0x3a23b7);logger[_0x1de7('0xf')](_0x1de7('0x46'),_0x3a23b7,JSON['stringify'](_0x38ac74));_0x15b26e(_0x38ac74);})[_0x1de7('0x17')](function(_0x4b2f5a){logger['error'](_0x1de7('0x46'),_0x4b2f5a['message'],_0x3a23b7);_0x2d140d(_0x579321[_0x1de7('0x14')](0x1f4,_0x4b2f5a[_0x1de7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index fdffb2d..6bc1c22 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 _0x5020=['put','/:id','update','exports','multer','util','Router','fs-extra','../../components/auth/service','get','/describe','isAuthenticated','describe','show'];(function(_0xf013a7,_0x2aa909){var _0x48ea27=function(_0xa453a0){while(--_0xa453a0){_0xf013a7['push'](_0xf013a7['shift']());}};_0x48ea27(++_0x2aa909);}(_0x5020,0x18c));var _0x0502=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5020[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x0502('0x0'));var util=require(_0x0502('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0502('0x2')]();var fs_extra=require(_0x0502('0x3'));var auth=require(_0x0502('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0x0502('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0502('0x5')](_0x0502('0x6'),auth[_0x0502('0x7')](),controller[_0x0502('0x8')]);router[_0x0502('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x0502('0x9')]);router['post']('/',auth[_0x0502('0x7')](),controller['create']);router[_0x0502('0xa')](_0x0502('0xb'),auth[_0x0502('0x7')](),controller[_0x0502('0xc')]);module[_0x0502('0xd')]=router; \ No newline at end of file +var _0x96d3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','get','describe','/:id','show','post','create','put','update','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0x96d3,0xcc));var _0x396d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x96d3[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x396d('0x0'));var path=require(_0x396d('0x1'));var timeout=require(_0x396d('0x2'));var express=require('express');var router=express[_0x396d('0x3')]();var fs_extra=require(_0x396d('0x4'));var auth=require(_0x396d('0x5'));var interaction=require(_0x396d('0x6'));var config=require(_0x396d('0x7'));var controller=require(_0x396d('0x8'));router['get']('/',auth[_0x396d('0x9')](),controller['index']);router[_0x396d('0xa')]('/describe',auth[_0x396d('0x9')](),controller[_0x396d('0xb')]);router[_0x396d('0xa')](_0x396d('0xc'),auth[_0x396d('0x9')](),controller[_0x396d('0xd')]);router[_0x396d('0xe')]('/',auth[_0x396d('0x9')](),controller[_0x396d('0xf')]);router[_0x396d('0x10')]('/:id',auth[_0x396d('0x9')](),controller[_0x396d('0x11')]);module[_0x396d('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 79706e2..c11347e 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 _0x8ece=['name','sequelize','exports','STRING'];(function(_0x4a4fda,_0x170e26){var _0x5a2511=function(_0x47d6ea){while(--_0x47d6ea){_0x4a4fda['push'](_0x4a4fda['shift']());}};_0x5a2511(++_0x170e26);}(_0x8ece,0x195));var _0xe8ec=function(_0x126a77,_0x253795){_0x126a77=_0x126a77-0x0;var _0x4a73ea=_0x8ece[_0x126a77];return _0x4a73ea;};'use strict';var Sequelize=require(_0xe8ec('0x0'));module[_0xe8ec('0x1')]={'name':{'type':Sequelize[_0xe8ec('0x2')],'unique':_0xe8ec('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb31a=['sequelize','exports','STRING','name'];(function(_0x28d1c7,_0x20ef51){var _0x584a72=function(_0x4fabed){while(--_0x4fabed){_0x28d1c7['push'](_0x28d1c7['shift']());}};_0x584a72(++_0x20ef51);}(_0xb31a,0xd4));var _0xab31=function(_0x15cfbf,_0x58c837){_0x15cfbf=_0x15cfbf-0x0;var _0x126890=_0xb31a[_0x15cfbf];return _0x126890;};'use strict';var Sequelize=require(_0xab31('0x0'));module[_0xab31('0x1')]={'name':{'type':Sequelize[_0xab31('0x2')],'unique':_0xab31('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xab31('0x2')]},'dialPrefix':{'type':Sequelize[_0xab31('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 197fbc8..05de9fe 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 _0xa079=['pick','removeDispositions','tags','isArray','push','each','CmContact','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','raw','getContacts','getContactsCsv','cf_%d','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','text/csv','addCustomField','sequelize','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','cm_contacts','cf_%s','addAgents','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','UserProfileResource','error','name','map','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','CmList','findAll','rows','params','keys','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Lists','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','length'];(function(_0x53af32,_0x26b017){var _0xc370b8=function(_0x5e6080){while(--_0x5e6080){_0x53af32['push'](_0x53af32['shift']());}};_0xc370b8(++_0x26b017);}(_0xa079,0x1d4));var _0x9a07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa079[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9a07('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a07('0x1'));var jsonpatch=require(_0x9a07('0x2'));var rp=require(_0x9a07('0x3'));var moment=require(_0x9a07('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9a07('0x5'));var util=require(_0x9a07('0x6'));var path=require(_0x9a07('0x7'));var sox=require('sox');var csv=require(_0x9a07('0x8'));var ejs=require(_0x9a07('0x9'));var fs=require('fs');var fs_extra=require(_0x9a07('0xa'));var _=require(_0x9a07('0xb'));var squel=require('squel');var crypto=require(_0x9a07('0xc'));var jsforce=require(_0x9a07('0xd'));var deskjs=require(_0x9a07('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9a07('0xf'));var qs=require(_0x9a07('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a07('0x11'))('api');var utils=require(_0x9a07('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9a07('0x13'));var db=require(_0x9a07('0x14'))['db'];config[_0x9a07('0x15')]=_['defaults'](config[_0x9a07('0x15')],{'host':_0x9a07('0x16'),'port':0x18eb});var socket=require(_0x9a07('0x17'))(new Redis(config[_0x9a07('0x15')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x2d9799,_0x5eadda){_0x5eadda=_0x5eadda||0xcc;return function(_0x2d8e32){if(_0x2d8e32){return _0x2d9799[_0x9a07('0x18')](_0x5eadda);}return _0x2d9799[_0x9a07('0x19')](_0x5eadda)[_0x9a07('0x1a')]();};}function respondWithResult(_0x1f22e1,_0x2f9ad3){_0x2f9ad3=_0x2f9ad3||0xc8;return function(_0x494f55){if(_0x494f55){return _0x1f22e1[_0x9a07('0x19')](_0x2f9ad3)['json'](_0x494f55);}};}function respondWithFilteredResult(_0x531ce7,_0x3d5300){return function(_0x3b43bf){if(_0x3b43bf){var _0x53d6c9=typeof _0x3d5300[_0x9a07('0x1b')]===_0x9a07('0x1c')&&typeof _0x3d5300[_0x9a07('0x1d')]==='undefined';var _0x38e900=_0x3b43bf[_0x9a07('0x1e')];var _0x1ff67c=_0x53d6c9?0x0:_0x3d5300[_0x9a07('0x1b')];var _0x1b2d90=_0x53d6c9?_0x3b43bf['count']:_0x3d5300['offset']+_0x3d5300[_0x9a07('0x1d')];var _0x18ca03;if(_0x1b2d90>=_0x38e900){_0x1b2d90=_0x38e900;_0x18ca03=0xc8;}else{_0x18ca03=0xce;}_0x531ce7['status'](_0x18ca03);return _0x531ce7[_0x9a07('0x1f')](_0x9a07('0x20'),_0x1ff67c+'-'+_0x1b2d90+'/'+_0x38e900)[_0x9a07('0x21')](_0x3b43bf);}return null;};}function patchUpdates(_0x1a3021){return function(_0x465161){try{jsonpatch[_0x9a07('0x22')](_0x465161,_0x1a3021,!![]);}catch(_0x5e2661){return BPromise[_0x9a07('0x23')](_0x5e2661);}return _0x465161[_0x9a07('0x24')]();};}function saveUpdates(_0x122e82,_0x21a8c5){return function(_0x1bf073){if(_0x1bf073){return _0x1bf073[_0x9a07('0x25')](_0x122e82)['then'](function(_0x2c21df){return _0x2c21df;});}return null;};}function removeEntity(_0x42db74,_0x44df8b){return function(_0x599144){if(_0x599144){return _0x599144[_0x9a07('0x26')]()[_0x9a07('0x27')](function(){var _0x335005=_0x599144['get']({'plain':!![]});var _0x4deabf='Lists';return db[_0x9a07('0x28')][_0x9a07('0x26')]({'where':{'type':_0x4deabf,'resourceId':_0x335005['id']}})[_0x9a07('0x27')](function(){return _0x599144;});})[_0x9a07('0x27')](function(){_0x42db74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d2113,_0x101258){return function(_0x3ca852){if(!_0x3ca852){_0x5d2113['sendStatus'](0x194);}return _0x3ca852;};}function handleError(_0x31b34f,_0x3183b2){_0x3183b2=_0x3183b2||0x1f4;return function(_0x1b1651){logger[_0x9a07('0x29')](_0x1b1651['stack']);if(_0x1b1651['name']){delete _0x1b1651[_0x9a07('0x2a')];}_0x31b34f[_0x9a07('0x19')](_0x3183b2)['send'](_0x1b1651);};}exports['index']=function(_0x923641,_0x4d1966){var _0x3e185a={},_0x3ece19={},_0x13e6ae={'count':0x0,'rows':[]};var _0x35d6c7=_[_0x9a07('0x2b')](db['CmList'][_0x9a07('0x2c')],function(_0x109f20){return{'name':_0x109f20['fieldName'],'type':_0x109f20[_0x9a07('0x2d')][_0x9a07('0x2e')]};});_0x3ece19[_0x9a07('0x2f')]=_[_0x9a07('0x2b')](_0x35d6c7,_0x9a07('0x2a'));_0x3ece19[_0x9a07('0x30')]=_['keys'](_0x923641[_0x9a07('0x30')]);_0x3ece19['filters']=_[_0x9a07('0x31')](_0x3ece19[_0x9a07('0x2f')],_0x3ece19[_0x9a07('0x30')]);_0x3e185a[_0x9a07('0x32')]=_[_0x9a07('0x31')](_0x3ece19[_0x9a07('0x2f')],qs[_0x9a07('0x33')](_0x923641[_0x9a07('0x30')][_0x9a07('0x33')]));_0x3e185a[_0x9a07('0x32')]=_0x3e185a[_0x9a07('0x32')]['length']?_0x3e185a[_0x9a07('0x32')]:_0x3ece19[_0x9a07('0x2f')];if(!_0x923641['query'][_0x9a07('0x34')](_0x9a07('0x35'))){_0x3e185a['limit']=qs[_0x9a07('0x1d')](_0x923641[_0x9a07('0x30')][_0x9a07('0x1d')]);_0x3e185a[_0x9a07('0x1b')]=qs[_0x9a07('0x1b')](_0x923641[_0x9a07('0x30')][_0x9a07('0x1b')]);}_0x3e185a[_0x9a07('0x36')]=qs[_0x9a07('0x37')](_0x923641[_0x9a07('0x30')][_0x9a07('0x37')]);_0x3e185a[_0x9a07('0x38')]=qs[_0x9a07('0x39')](_['pick'](_0x923641[_0x9a07('0x30')],_0x3ece19['filters']),_0x35d6c7);if(_0x923641['query'][_0x9a07('0x3a')]){_0x3e185a[_0x9a07('0x38')]=_[_0x9a07('0x3b')](_0x3e185a['where'],{'$or':_['map'](_0x35d6c7,function(_0xbb39ba){if(_0xbb39ba[_0x9a07('0x2d')]!==_0x9a07('0x3c')){var _0x981f8d={};_0x981f8d[_0xbb39ba[_0x9a07('0x2a')]]={'$like':'%'+_0x923641[_0x9a07('0x30')][_0x9a07('0x3a')]+'%'};return _0x981f8d;}})});}_0x3e185a=_[_0x9a07('0x3b')]({},_0x3e185a,_0x923641[_0x9a07('0x3d')]);var _0x1cb55a={'where':_0x3e185a['where']};return db[_0x9a07('0x3e')][_0x9a07('0x1e')](_0x1cb55a)['then'](function(_0x563df0){_0x13e6ae[_0x9a07('0x1e')]=_0x563df0;if(_0x923641[_0x9a07('0x30')]['includeAll']){_0x3e185a['include']=[{'all':!![]}];}return db[_0x9a07('0x3e')][_0x9a07('0x3f')](_0x3e185a);})[_0x9a07('0x27')](function(_0x260342){_0x13e6ae[_0x9a07('0x40')]=_0x260342;return _0x13e6ae;})[_0x9a07('0x27')](respondWithFilteredResult(_0x4d1966,_0x3e185a))['catch'](handleError(_0x4d1966,null));};exports['show']=function(_0x56db03,_0x37acb0){var _0x3c84a2={'raw':![],'where':{'id':_0x56db03[_0x9a07('0x41')]['id']}},_0x12fe62={};_0x12fe62[_0x9a07('0x2f')]=_[_0x9a07('0x42')](db['CmList']['rawAttributes']);_0x12fe62[_0x9a07('0x30')]=_['keys'](_0x56db03[_0x9a07('0x30')]);_0x12fe62[_0x9a07('0x39')]=_[_0x9a07('0x31')](_0x12fe62[_0x9a07('0x2f')],_0x12fe62[_0x9a07('0x30')]);_0x3c84a2[_0x9a07('0x32')]=_[_0x9a07('0x31')](_0x12fe62[_0x9a07('0x2f')],qs[_0x9a07('0x33')](_0x56db03[_0x9a07('0x30')]['fields']));_0x3c84a2[_0x9a07('0x32')]=_0x3c84a2['attributes']['length']?_0x3c84a2['attributes']:_0x12fe62['model'];if(_0x56db03[_0x9a07('0x30')][_0x9a07('0x43')]){_0x3c84a2[_0x9a07('0x44')]=[{'all':!![]}];}_0x3c84a2=_[_0x9a07('0x3b')]({},_0x3c84a2,_0x56db03[_0x9a07('0x3d')]);return db[_0x9a07('0x3e')][_0x9a07('0x45')](_0x3c84a2)[_0x9a07('0x27')](handleEntityNotFound(_0x37acb0,null))[_0x9a07('0x27')](respondWithResult(_0x37acb0,null))[_0x9a07('0x46')](handleError(_0x37acb0,null));};exports[_0x9a07('0x47')]=function(_0x43f55e,_0x573903){return db[_0x9a07('0x3e')][_0x9a07('0x47')](_0x43f55e[_0x9a07('0x48')],{})[_0x9a07('0x27')](function(_0x187ae1){var _0x250a65=_0x43f55e[_0x9a07('0x49')]['get']({'plain':!![]});if(!_0x250a65)throw new Error(_0x9a07('0x4a'));if(_0x250a65[_0x9a07('0x4b')]===_0x9a07('0x49')){var _0x23472e=_0x187ae1[_0x9a07('0x4c')]({'plain':!![]});var _0xd76c66=_0x9a07('0x4d');return db[_0x9a07('0x4e')]['find']({'where':{'name':_0xd76c66,'userProfileId':_0x250a65['userProfileId']},'raw':!![]})[_0x9a07('0x27')](function(_0x5c7f15){if(_0x5c7f15&&_0x5c7f15[_0x9a07('0x4f')]===0x0){return db[_0x9a07('0x28')][_0x9a07('0x47')]({'name':_0x23472e[_0x9a07('0x2a')],'resourceId':_0x23472e['id'],'type':_0x5c7f15[_0x9a07('0x2a')],'sectionId':_0x5c7f15['id']},{})[_0x9a07('0x27')](function(){return _0x187ae1;});}else{return _0x187ae1;}})['catch'](function(_0x215978){logger[_0x9a07('0x29')](_0x9a07('0x50'),_0x215978);throw _0x215978;});}return _0x187ae1;})[_0x9a07('0x27')](respondWithResult(_0x573903,0xc9))['catch'](handleError(_0x573903,null));};exports[_0x9a07('0x25')]=function(_0x22f25d,_0x3e4655){if(_0x22f25d[_0x9a07('0x48')]['id']){delete _0x22f25d[_0x9a07('0x48')]['id'];}return db[_0x9a07('0x3e')][_0x9a07('0x45')]({'where':{'id':_0x22f25d['params']['id']}})[_0x9a07('0x27')](handleEntityNotFound(_0x3e4655,null))[_0x9a07('0x27')](saveUpdates(_0x22f25d[_0x9a07('0x48')],null))[_0x9a07('0x27')](respondWithResult(_0x3e4655,null))[_0x9a07('0x46')](handleError(_0x3e4655,null));};exports[_0x9a07('0x26')]=function(_0x4082af,_0x2be21e){return db['CmList'][_0x9a07('0x45')]({'where':{'id':_0x4082af[_0x9a07('0x41')]['id']}})['then'](handleEntityNotFound(_0x2be21e,null))['then'](removeEntity(_0x2be21e,null))[_0x9a07('0x46')](handleError(_0x2be21e,null));};exports[_0x9a07('0x51')]=function(_0x29415a,_0x50aed1){return db[_0x9a07('0x3e')][_0x9a07('0x51')]()[_0x9a07('0x27')](respondWithResult(_0x50aed1,null))[_0x9a07('0x46')](handleError(_0x50aed1,null));};exports[_0x9a07('0x52')]=function(_0x42e3c8,_0x990b6a,_0x52c581){if(_0x42e3c8[_0x9a07('0x48')]['id']){delete _0x42e3c8[_0x9a07('0x48')]['id'];}return db[_0x9a07('0x3e')][_0x9a07('0x45')]({'where':{'id':_0x42e3c8['params']['id']}})[_0x9a07('0x27')](handleEntityNotFound(_0x990b6a,null))[_0x9a07('0x27')](function(_0x3bf6be){if(_0x3bf6be){_0x42e3c8[_0x9a07('0x48')][_0x9a07('0x53')]=_0x3bf6be['id'];return db['Disposition']['create'](_0x42e3c8[_0x9a07('0x48')]);}})[_0x9a07('0x27')](respondWithResult(_0x990b6a,null))[_0x9a07('0x46')](handleError(_0x990b6a,null));};exports[_0x9a07('0x54')]=function(_0x4843e9,_0x4528db,_0x4b2e9e){var _0x11e668={'raw':![],'where':{}};var _0x196e74={};var _0x180fb4={'count':0x0,'rows':[]};return db[_0x9a07('0x3e')][_0x9a07('0x55')]({'where':{'id':_0x4843e9[_0x9a07('0x41')]['id']}})[_0x9a07('0x27')](handleEntityNotFound(_0x4528db,null))['then'](function(_0x3820f1){if(_0x3820f1){_0x196e74['model']=_[_0x9a07('0x42')](db[_0x9a07('0x56')]['rawAttributes']);_0x196e74['query']=_[_0x9a07('0x42')](_0x4843e9[_0x9a07('0x30')]);_0x196e74['filters']=_['intersection'](_0x196e74[_0x9a07('0x2f')],_0x196e74[_0x9a07('0x30')]);_0x11e668[_0x9a07('0x32')]=_[_0x9a07('0x31')](_0x196e74['model'],qs[_0x9a07('0x33')](_0x4843e9[_0x9a07('0x30')][_0x9a07('0x33')]));_0x11e668[_0x9a07('0x32')]=_0x11e668['attributes'][_0x9a07('0x57')]?_0x11e668[_0x9a07('0x32')]:_0x196e74['model'];if(!_0x4843e9[_0x9a07('0x30')][_0x9a07('0x34')]('nolimit')){_0x11e668[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x4843e9[_0x9a07('0x30')][_0x9a07('0x1d')]);_0x11e668[_0x9a07('0x1b')]=qs[_0x9a07('0x1b')](_0x4843e9[_0x9a07('0x30')][_0x9a07('0x1b')]);}_0x11e668[_0x9a07('0x36')]=qs[_0x9a07('0x37')](_0x4843e9[_0x9a07('0x30')][_0x9a07('0x37')]);_0x11e668[_0x9a07('0x38')]=qs[_0x9a07('0x39')](_[_0x9a07('0x58')](_0x4843e9[_0x9a07('0x30')],_0x196e74[_0x9a07('0x39')]));_0x11e668[_0x9a07('0x38')][_0x9a07('0x53')]=_0x3820f1['id'];if(_0x4843e9[_0x9a07('0x30')][_0x9a07('0x3a')]){_0x11e668['where']=_[_0x9a07('0x3b')](_0x11e668[_0x9a07('0x38')],{'$or':_[_0x9a07('0x2b')](_0x11e668[_0x9a07('0x32')],function(_0x5b4b46){var _0x1d5bc3={};_0x1d5bc3[_0x5b4b46]={'$like':'%'+_0x4843e9['query'][_0x9a07('0x3a')]+'%'};return _0x1d5bc3;})});}_0x11e668=_[_0x9a07('0x3b')]({},_0x11e668,_0x4843e9[_0x9a07('0x3d')]);return db[_0x9a07('0x56')][_0x9a07('0x1e')]({'where':_0x11e668[_0x9a07('0x38')]})[_0x9a07('0x27')](function(_0x50a5b2){_0x180fb4[_0x9a07('0x1e')]=_0x50a5b2;if(_0x4843e9[_0x9a07('0x30')]['includeAll']){_0x11e668[_0x9a07('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x9a07('0x3f')](_0x11e668);})[_0x9a07('0x27')](function(_0x56036d){_0x180fb4[_0x9a07('0x40')]=_0x56036d;return _0x180fb4;});}})[_0x9a07('0x27')](respondWithFilteredResult(_0x4528db,_0x11e668))[_0x9a07('0x46')](handleError(_0x4528db,null));};exports['removeDispositions']=function(_0x5bbb95,_0x549056,_0x2bfddf){return db[_0x9a07('0x3e')]['find']({'where':{'id':_0x5bbb95[_0x9a07('0x41')]['id']}})[_0x9a07('0x27')](handleEntityNotFound(_0x549056,null))['then'](function(_0x23a609){if(_0x23a609){return _0x23a609[_0x9a07('0x59')](_0x5bbb95[_0x9a07('0x30')]['ids']);}})[_0x9a07('0x27')](respondWithStatusCode(_0x549056,null))['catch'](handleError(_0x549056,null));};exports['addContacts']=function(_0x3ae157,_0x33ac90,_0x29d04c){return db[_0x9a07('0x3e')]['find']({'where':{'id':_0x3ae157[_0x9a07('0x41')]['id']}})[_0x9a07('0x27')](handleEntityNotFound(_0x33ac90,null))[_0x9a07('0x27')](function(_0xd74e7a){if(_0xd74e7a){var _0x461bf1=[];var _0x416ce1={'success':[],'errors':[]};return db['CmContact'][_0x9a07('0x51')]()['then'](function(_0x57f4cd){if(_0x3ae157[_0x9a07('0x48')][_0x9a07('0x5a')]&&_['isArray'](_0x3ae157[_0x9a07('0x48')][_0x9a07('0x5a')])){if(_0x3ae157[_0x9a07('0x48')]['tags'][_0x9a07('0x57')]){_0x3ae157[_0x9a07('0x48')][_0x9a07('0x5a')]=_0x3ae157['body'][_0x9a07('0x5a')]['join'](';')+';';}else{_0x3ae157[_0x9a07('0x48')][_0x9a07('0x5a')]=null;}}else{_0x3ae157[_0x9a07('0x48')]['tags']=null;}if(_0x3ae157[_0x9a07('0x48')]&&_[_0x9a07('0x5b')](_0x3ae157[_0x9a07('0x48')])){for(var _0x225091=0x0;_0x225091<_0x3ae157['body'][_0x9a07('0x57')];_0x225091+=0x1){_0x3ae157[_0x9a07('0x48')][_0x225091][_0x9a07('0x53')]=_0x3ae157[_0x9a07('0x41')]['id'];_0x461bf1[_0x9a07('0x5c')](_0x3ae157[_0x9a07('0x48')][_0x225091]);}return BPromise[_0x9a07('0x5d')](_0x461bf1,function(_0x3cd68d){return db[_0x9a07('0x5e')][_0x9a07('0x47')](_[_0x9a07('0x5f')](_0x3cd68d,[_0x9a07('0x60'),'id'])||{},{'fields':_[_0x9a07('0x42')](_0x57f4cd),'raw':!![]})[_0x9a07('0x27')](function(_0x18bd2c){_0x416ce1[_0x9a07('0x61')][_0x9a07('0x5c')](_0x18bd2c[_0x9a07('0x62')]);})[_0x9a07('0x46')](function(_0x17eb2c){_0x416ce1[_0x9a07('0x63')][_0x9a07('0x5c')]({'data':_0x3cd68d,'error':_0x17eb2c[_0x9a07('0x64')]});});})['then'](function(_0x58c9fc){return _0x416ce1;})[_0x9a07('0x46')](function(_0x54f5b4){return _0x54f5b4;});}else{_0x33ac90[_0x9a07('0x19')](0x190)[_0x9a07('0x21')]({'message':_0x9a07('0x65')});}});}})[_0x9a07('0x27')](respondWithResult(_0x33ac90,null))['catch'](handleError(_0x33ac90,null));};exports['getContacts']=function(_0x4a0ba7,_0x307e1e,_0xec249){var _0x2cc3fc;return db[_0x9a07('0x3e')][_0x9a07('0x45')]({'where':{'id':_0x4a0ba7[_0x9a07('0x41')]['id']},'include':[{'model':db[_0x9a07('0x66')],'as':_0x9a07('0x67')}]})[_0x9a07('0x27')](handleEntityNotFound(_0x307e1e,null))[_0x9a07('0x27')](function(_0x1d0042){if(_0x1d0042){_0x2cc3fc=_0x1d0042;return db[_0x9a07('0x5e')]['rawAttributes'];}})[_0x9a07('0x27')](function(_0x1aa2f5){if(_0x1aa2f5){var _0x43a320={};var _0x44be61={};_0x44be61['model']=_[_0x9a07('0x68')](_['keys'](_0x1aa2f5),_[_0x9a07('0x2b')](_0x2cc3fc[_0x9a07('0x67')],function(_0x6b6da2){return util[_0x9a07('0x69')]('cf_%d',_0x6b6da2['id']);}));_0x44be61[_0x9a07('0x30')]=_['keys'](_0x4a0ba7[_0x9a07('0x30')]);_0x44be61[_0x9a07('0x39')]=_['intersection'](_0x44be61[_0x9a07('0x2f')],_0x44be61[_0x9a07('0x30')]);_0x43a320[_0x9a07('0x32')]=_[_0x9a07('0x31')](_0x44be61[_0x9a07('0x2f')],qs['fields'](_0x4a0ba7[_0x9a07('0x30')][_0x9a07('0x33')]));_0x43a320['attributes']=_0x43a320['attributes'][_0x9a07('0x57')]?_0x43a320[_0x9a07('0x32')]:_0x44be61[_0x9a07('0x2f')];if(!_0x4a0ba7['query'][_0x9a07('0x34')]('nolimit')){_0x43a320['limit']=qs[_0x9a07('0x1d')](_0x4a0ba7[_0x9a07('0x30')][_0x9a07('0x1d')]);_0x43a320[_0x9a07('0x1b')]=qs['offset'](_0x4a0ba7['query'][_0x9a07('0x1b')]);}_0x43a320[_0x9a07('0x36')]=qs[_0x9a07('0x37')](_0x4a0ba7[_0x9a07('0x30')][_0x9a07('0x37')]);_0x43a320[_0x9a07('0x38')]=qs[_0x9a07('0x39')](_['pick'](_0x4a0ba7[_0x9a07('0x30')],_0x44be61['filters']));_0x43a320[_0x9a07('0x6a')]=!![];if(_0x4a0ba7[_0x9a07('0x30')]['filter']){_0x43a320['where']=_['merge'](_0x43a320[_0x9a07('0x38')],{'$or':_[_0x9a07('0x2b')](_0x43a320[_0x9a07('0x32')],function(_0x59e6fa){var _0x16b598={};_0x16b598[_0x59e6fa]={'$like':'%'+_0x4a0ba7[_0x9a07('0x30')]['filter']+'%'};return _0x16b598;})});}_0x43a320=_[_0x9a07('0x3b')]({},_0x43a320,_0x4a0ba7[_0x9a07('0x3d')]);return _0x2cc3fc[_0x9a07('0x6b')](_0x43a320);}})['then'](respondWithResult(_0x307e1e,null))[_0x9a07('0x46')](handleError(_0x307e1e,null));};exports[_0x9a07('0x6c')]=function(_0x4e60f6,_0x279b34,_0x598a82){var _0xfef6f4;return db[_0x9a07('0x3e')][_0x9a07('0x45')]({'where':{'id':_0x4e60f6[_0x9a07('0x41')]['id']},'include':[{'model':db[_0x9a07('0x66')],'as':'CustomFields'}]})[_0x9a07('0x27')](handleEntityNotFound(_0x279b34,null))[_0x9a07('0x27')](function(_0xef4a4a){if(_0xef4a4a){_0xfef6f4=_0xef4a4a;return db[_0x9a07('0x5e')][_0x9a07('0x2c')];}})[_0x9a07('0x27')](function(_0x4a68b4){if(_0x4a68b4){var _0x49c95a={};var _0x419c4f={};_0x419c4f[_0x9a07('0x2f')]=_[_0x9a07('0x68')](_[_0x9a07('0x42')](_0x4a68b4),_['map'](_0xfef6f4[_0x9a07('0x67')],function(_0x1dcb31){return util[_0x9a07('0x69')](_0x9a07('0x6d'),_0x1dcb31['id']);}));_0x419c4f[_0x9a07('0x30')]=_[_0x9a07('0x42')](_0x4e60f6['query']);_0x419c4f[_0x9a07('0x39')]=_[_0x9a07('0x31')](_0x419c4f[_0x9a07('0x2f')],_0x419c4f[_0x9a07('0x30')]);_0x49c95a['attributes']=_[_0x9a07('0x31')](_0x419c4f[_0x9a07('0x2f')],qs['fields'](_0x4e60f6[_0x9a07('0x30')][_0x9a07('0x33')]));_0x49c95a[_0x9a07('0x32')]=_0x49c95a['attributes'][_0x9a07('0x57')]?_0x49c95a[_0x9a07('0x32')]:_0x419c4f['model'];if(!_0x4e60f6['query']['hasOwnProperty']('nolimit')){_0x49c95a['limit']=qs[_0x9a07('0x1d')](_0x4e60f6['query']['limit']);_0x49c95a[_0x9a07('0x1b')]=qs['offset'](_0x4e60f6[_0x9a07('0x30')][_0x9a07('0x1b')]);}_0x49c95a[_0x9a07('0x36')]=qs[_0x9a07('0x37')](_0x4e60f6['query']['sort']);_0x49c95a[_0x9a07('0x38')]=qs['filters'](_[_0x9a07('0x58')](_0x4e60f6[_0x9a07('0x30')],_0x419c4f[_0x9a07('0x39')]));_0x49c95a['raw']=!![];if(_0x4e60f6[_0x9a07('0x30')][_0x9a07('0x3a')]){_0x49c95a['where']=_[_0x9a07('0x3b')](_0x49c95a[_0x9a07('0x38')],{'$or':_['map'](_0x49c95a[_0x9a07('0x32')],function(_0x2a07f4){var _0x1c5569={};_0x1c5569[_0x2a07f4]={'$like':'%'+_0x4e60f6[_0x9a07('0x30')][_0x9a07('0x3a')]+'%'};return _0x1c5569;})});}_0x49c95a=_['merge']({},_0x49c95a,_0x4e60f6[_0x9a07('0x3d')]);return _0xfef6f4[_0x9a07('0x6b')](_0x49c95a);}})['then'](function(_0x2bb3ef){if(!_[_0x9a07('0x6e')](_0x2bb3ef)){var _0x1a8798=toCsv(_0x2bb3ef);var _0x283f46=Date[_0x9a07('0x6f')]();fs[_0x9a07('0x70')](util['format'](_0x9a07('0x71'),_0xfef6f4['id'],_0x283f46),_0x1a8798);_0x279b34['setHeader'](_0x9a07('0x72'),_0x9a07('0x73')+util[_0x9a07('0x69')](_0x9a07('0x74'),_0xfef6f4['id'],_0x283f46));_0x279b34[_0x9a07('0x75')]('Content-type',_0x9a07('0x76'));return _0x279b34['download'](util[_0x9a07('0x69')](_0x9a07('0x71'),_0xfef6f4['id'],_0x283f46));}else{return _0x279b34[_0x9a07('0x18')](0xcc);}})['catch'](handleError(_0x279b34,null));};exports[_0x9a07('0x77')]=function(_0x593ca5,_0x458bd1,_0x42448e){var _0x3817ff;delete _0x593ca5[_0x9a07('0x48')]['id'];return db['CmList'][_0x9a07('0x55')]({'where':{'id':_0x593ca5[_0x9a07('0x41')]['id']}})[_0x9a07('0x27')](handleEntityNotFound(_0x458bd1,null))[_0x9a07('0x27')](function(_0x1788b2){if(_0x1788b2){return db[_0x9a07('0x78')]['transaction'](function(_0x65488d){return db[_0x9a07('0x66')]['create'](_0x593ca5[_0x9a07('0x48')],{'transaction':_0x65488d})[_0x9a07('0x27')](function(_0x1346dd){_0x3817ff=_0x1346dd;return _0x1788b2[_0x9a07('0x79')](_0x1346dd,{'transaction':_0x65488d});})[_0x9a07('0x27')](function(){var _0x5474df={'type':db[_0x9a07('0x7a')]['TEXT'],'transaction':_0x65488d};switch(_0x593ca5[_0x9a07('0x48')][_0x9a07('0x2d')]){case _0x9a07('0x7b'):_0x5474df[_0x9a07('0x2d')]=db[_0x9a07('0x7a')][_0x9a07('0x7c')];break;case _0x9a07('0x7d'):_0x5474df[_0x9a07('0x2d')]=db['Sequelize'][_0x9a07('0x7e')];break;case _0x9a07('0x7f'):_0x5474df['type']=db['Sequelize'][_0x9a07('0x80')];_0x5474df['defaultValue']=![];break;default:}return db['sequelize'][_0x9a07('0x81')]['addColumn'](_0x9a07('0x82'),util[_0x9a07('0x69')](_0x9a07('0x83'),_0x3817ff['id']),_0x5474df);})[_0x9a07('0x27')](function(){return _0x3817ff;});});}})[_0x9a07('0x27')](respondWithResult(_0x458bd1,null))[_0x9a07('0x46')](handleError(_0x458bd1,null));};exports['getCustomFields']=function(_0x2e25f4,_0x5c38d9,_0x247c3d){var _0xca452c={};var _0x285b8b={};var _0x511ff1;var _0x106cfe;return db[_0x9a07('0x3e')]['findOne']({'where':{'id':_0x2e25f4[_0x9a07('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c38d9,null))[_0x9a07('0x27')](function(_0x2872a3){if(_0x2872a3){_0x511ff1=_0x2872a3;_0x285b8b['model']=_[_0x9a07('0x42')](db[_0x9a07('0x66')][_0x9a07('0x2c')]);_0x285b8b[_0x9a07('0x30')]=_[_0x9a07('0x42')](_0x2e25f4['query']);_0x285b8b[_0x9a07('0x39')]=_[_0x9a07('0x31')](_0x285b8b[_0x9a07('0x2f')],_0x285b8b['query']);_0xca452c[_0x9a07('0x32')]=_[_0x9a07('0x31')](_0x285b8b[_0x9a07('0x2f')],qs[_0x9a07('0x33')](_0x2e25f4['query'][_0x9a07('0x33')]));_0xca452c[_0x9a07('0x32')]=_0xca452c['attributes'][_0x9a07('0x57')]?_0xca452c[_0x9a07('0x32')]:_0x285b8b[_0x9a07('0x2f')];_0xca452c[_0x9a07('0x36')]=qs[_0x9a07('0x37')](_0x2e25f4[_0x9a07('0x30')][_0x9a07('0x37')]);_0xca452c['where']=qs[_0x9a07('0x39')](_[_0x9a07('0x58')](_0x2e25f4[_0x9a07('0x30')],_0x285b8b['filters']));_0xca452c['where']=_[_0x9a07('0x3b')](_0xca452c[_0x9a07('0x38')],{'$or':[{'ListId':_0x2872a3['id']},{'ListId':null}]});if(_0x2e25f4[_0x9a07('0x30')][_0x9a07('0x3a')]){_0xca452c[_0x9a07('0x38')]=_['merge'](_0xca452c[_0x9a07('0x38')],{'$or':_[_0x9a07('0x2b')](_0xca452c['attributes'],function(_0x200839){var _0x62d42e={};_0x62d42e[_0x200839]={'$like':'%'+_0x2e25f4[_0x9a07('0x30')][_0x9a07('0x3a')]+'%'};return _0x62d42e;})});}_0xca452c=_[_0x9a07('0x3b')]({},_0xca452c,_0x2e25f4[_0x9a07('0x3d')]);return db[_0x9a07('0x66')]['findAndCountAll'](_0xca452c);}})[_0x9a07('0x27')](respondWithResult(_0x5c38d9,null))['catch'](handleError(_0x5c38d9,null));};exports[_0x9a07('0x84')]=function(_0x1328b7,_0x281c2f,_0x3630a9){return db[_0x9a07('0x3e')][_0x9a07('0x45')]({'where':{'id':_0x1328b7[_0x9a07('0x41')]['id']}})[_0x9a07('0x27')](handleEntityNotFound(_0x281c2f,null))[_0x9a07('0x27')](function(_0x2cf295){if(_0x2cf295){return _0x2cf295['addAgents'](_0x1328b7[_0x9a07('0x48')]['ids'],_['omit'](_0x1328b7['body'],['ids','id'])||{})['spread'](function(_0x36ce66){for(var _0x1d61ab=0x0;_0x1d61ab<_0x1328b7[_0x9a07('0x48')][_0x9a07('0x60')][_0x9a07('0x57')];_0x1d61ab+=0x1){socket['emit'](_0x9a07('0x85'),{'UserId':Number(_0x1328b7[_0x9a07('0x48')][_0x9a07('0x60')][_0x1d61ab]),'CmListId':Number(_0x1328b7[_0x9a07('0x41')]['id'])});}return _0x36ce66;});}})[_0x9a07('0x27')](respondWithResult(_0x281c2f,null))[_0x9a07('0x46')](handleError(_0x281c2f,null));};exports['removeAgents']=function(_0xa77151,_0x4419ac,_0x175002){return db['CmList'][_0x9a07('0x45')]({'where':{'id':_0xa77151[_0x9a07('0x41')]['id']}})[_0x9a07('0x27')](handleEntityNotFound(_0x4419ac,null))[_0x9a07('0x27')](function(_0x8ad757){if(_0x8ad757){return _0x8ad757[_0x9a07('0x86')](_0xa77151[_0x9a07('0x30')][_0x9a07('0x60')])[_0x9a07('0x27')](function(){if(_[_0x9a07('0x5b')](_0xa77151[_0x9a07('0x30')][_0x9a07('0x60')])){for(var _0x286442=0x0;_0x286442<_0xa77151[_0x9a07('0x30')][_0x9a07('0x60')][_0x9a07('0x57')];_0x286442+=0x1){socket[_0x9a07('0x87')](_0x9a07('0x88'),{'UserId':Number(_0xa77151[_0x9a07('0x30')][_0x9a07('0x60')][_0x286442]),'CmListId':Number(_0xa77151['params']['id'])});}}else{socket[_0x9a07('0x87')](_0x9a07('0x88'),{'UserId':Number(_0xa77151[_0x9a07('0x30')][_0x9a07('0x60')]),'CmListId':Number(_0xa77151[_0x9a07('0x41')]['id'])});}});}})[_0x9a07('0x27')](respondWithStatusCode(_0x4419ac,null))[_0x9a07('0x46')](handleError(_0x4419ac,null));};exports[_0x9a07('0x89')]=function(_0x24a5c7,_0x2180bd,_0x33df8a){var _0x417d99={};var _0x1da028={};var _0x39254c;var _0x2e4745;return db[_0x9a07('0x3e')]['findOne']({'where':{'id':_0x24a5c7['params']['id']}})[_0x9a07('0x27')](handleEntityNotFound(_0x2180bd,null))[_0x9a07('0x27')](function(_0x58a44f){if(_0x58a44f){_0x39254c=_0x58a44f;_0x1da028[_0x9a07('0x2f')]=_['keys'](db[_0x9a07('0x8a')][_0x9a07('0x2c')]);_0x1da028['query']=_['keys'](_0x24a5c7[_0x9a07('0x30')]);_0x1da028[_0x9a07('0x39')]=_[_0x9a07('0x31')](_0x1da028[_0x9a07('0x2f')],_0x1da028[_0x9a07('0x30')]);_0x417d99[_0x9a07('0x32')]=_[_0x9a07('0x31')](_0x1da028['model'],qs[_0x9a07('0x33')](_0x24a5c7[_0x9a07('0x30')][_0x9a07('0x33')]));_0x417d99['attributes']=_0x417d99[_0x9a07('0x32')][_0x9a07('0x57')]?_0x417d99['attributes']:_0x1da028[_0x9a07('0x2f')];_0x417d99[_0x9a07('0x36')]=qs[_0x9a07('0x37')](_0x24a5c7['query'][_0x9a07('0x37')]);_0x417d99[_0x9a07('0x38')]=qs['filters'](_[_0x9a07('0x58')](_0x24a5c7[_0x9a07('0x30')],_0x1da028[_0x9a07('0x39')]));if(_0x24a5c7[_0x9a07('0x30')][_0x9a07('0x3a')]){_0x417d99[_0x9a07('0x38')]=_['merge'](_0x417d99['where'],{'$or':_[_0x9a07('0x2b')](_0x417d99[_0x9a07('0x32')],function(_0x37c8ee){var _0x39475e={};_0x39475e[_0x37c8ee]={'$like':'%'+_0x24a5c7['query'][_0x9a07('0x3a')]+'%'};return _0x39475e;})});}_0x417d99=_[_0x9a07('0x3b')]({},_0x417d99,_0x24a5c7[_0x9a07('0x3d')]);return _0x39254c[_0x9a07('0x89')](_0x417d99);}})['then'](function(_0x33a062){if(_0x33a062){_0x2e4745=_0x33a062[_0x9a07('0x57')];if(!_0x24a5c7['query']['hasOwnProperty'](_0x9a07('0x35'))){_0x417d99[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x24a5c7[_0x9a07('0x30')][_0x9a07('0x1d')]);_0x417d99[_0x9a07('0x1b')]=qs[_0x9a07('0x1b')](_0x24a5c7[_0x9a07('0x30')][_0x9a07('0x1b')]);}return _0x39254c[_0x9a07('0x89')](_0x417d99);}})[_0x9a07('0x27')](function(_0x1989af){if(_0x1989af){return _0x1989af?{'count':_0x2e4745,'rows':_0x1989af}:null;}})['then'](respondWithResult(_0x2180bd,null))[_0x9a07('0x46')](handleError(_0x2180bd,null));}; \ No newline at end of file +var _0xa1ef=['raw','getContactsCsv','CmCustomField','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','addCustomFields','Sequelize','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','Lists','UserProfileResource','destroy','end','error','stack','name','index','map','CmList','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','catch','show','params','include','options','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','addDisposition','ListId','Disposition','findOne','rawAttributes','filter','findAll','rows','removeDispositions','addContacts','CmContact','isArray','tags','push','each','ids','success','dataValues','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xa1ef,0xb0));var _0xfa1e=function(_0x105b3a,_0x3f146c){_0x105b3a=_0x105b3a-0x0;var _0x561a8f=_0xa1ef[_0x105b3a];return _0x561a8f;};'use strict';var emlformat=require(_0xfa1e('0x0'));var rimraf=require(_0xfa1e('0x1'));var zipdir=require(_0xfa1e('0x2'));var jsonpatch=require(_0xfa1e('0x3'));var rp=require(_0xfa1e('0x4'));var moment=require(_0xfa1e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfa1e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfa1e('0x7'));var ejs=require(_0xfa1e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa1e('0x9'));var squel=require(_0xfa1e('0xa'));var crypto=require(_0xfa1e('0xb'));var jsforce=require(_0xfa1e('0xc'));var deskjs=require(_0xfa1e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfa1e('0xe'));var qs=require(_0xfa1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa1e('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xfa1e('0x11'));var config=require(_0xfa1e('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa1e('0x13'))['db'];config[_0xfa1e('0x14')]=_[_0xfa1e('0x15')](config[_0xfa1e('0x14')],{'host':_0xfa1e('0x16'),'port':0x18eb});var socket=require(_0xfa1e('0x17'))(new Redis(config[_0xfa1e('0x14')]));require(_0xfa1e('0x18'))[_0xfa1e('0x19')](socket);function respondWithStatusCode(_0x1663b8,_0x5b76ea){_0x5b76ea=_0x5b76ea||0xcc;return function(_0x42ccbe){if(_0x42ccbe){return _0x1663b8[_0xfa1e('0x1a')](_0x5b76ea);}return _0x1663b8[_0xfa1e('0x1b')](_0x5b76ea)['end']();};}function respondWithResult(_0x8573bd,_0x11eed5){_0x11eed5=_0x11eed5||0xc8;return function(_0x1b2eda){if(_0x1b2eda){return _0x8573bd[_0xfa1e('0x1b')](_0x11eed5)[_0xfa1e('0x1c')](_0x1b2eda);}};}function respondWithFilteredResult(_0x5addbe,_0x48edc3){return function(_0x4e1af5){if(_0x4e1af5){var _0x4ec8d5=typeof _0x48edc3[_0xfa1e('0x1d')]===_0xfa1e('0x1e')&&typeof _0x48edc3[_0xfa1e('0x1f')]===_0xfa1e('0x1e');var _0xbc6eb4=_0x4e1af5[_0xfa1e('0x20')];var _0x3748fd=_0x4ec8d5?0x0:_0x48edc3[_0xfa1e('0x1d')];var _0x47d51c=_0x4ec8d5?_0x4e1af5['count']:_0x48edc3[_0xfa1e('0x1d')]+_0x48edc3[_0xfa1e('0x1f')];var _0x10730d;if(_0x47d51c>=_0xbc6eb4){_0x47d51c=_0xbc6eb4;_0x10730d=0xc8;}else{_0x10730d=0xce;}_0x5addbe[_0xfa1e('0x1b')](_0x10730d);return _0x5addbe['set'](_0xfa1e('0x21'),_0x3748fd+'-'+_0x47d51c+'/'+_0xbc6eb4)['json'](_0x4e1af5);}return null;};}function patchUpdates(_0x18b09c){return function(_0x52d009){try{jsonpatch[_0xfa1e('0x22')](_0x52d009,_0x18b09c,!![]);}catch(_0x22c7f8){return BPromise['reject'](_0x22c7f8);}return _0x52d009[_0xfa1e('0x23')]();};}function saveUpdates(_0x208f4e,_0x2a08c0){return function(_0x4fe25d){if(_0x4fe25d){return _0x4fe25d[_0xfa1e('0x24')](_0x208f4e)[_0xfa1e('0x25')](function(_0x22eafa){return _0x22eafa;});}return null;};}function removeEntity(_0x5033fa,_0x5e204d){return function(_0x24514f){if(_0x24514f){return _0x24514f['destroy']()[_0xfa1e('0x25')](function(){var _0x59b826=_0x24514f['get']({'plain':!![]});var _0x367ae0=_0xfa1e('0x26');return db[_0xfa1e('0x27')][_0xfa1e('0x28')]({'where':{'type':_0x367ae0,'resourceId':_0x59b826['id']}})[_0xfa1e('0x25')](function(){return _0x24514f;});})[_0xfa1e('0x25')](function(){_0x5033fa[_0xfa1e('0x1b')](0xcc)[_0xfa1e('0x29')]();});}};}function handleEntityNotFound(_0x43c544,_0x26bb6d){return function(_0x5dfee4){if(!_0x5dfee4){_0x43c544['sendStatus'](0x194);}return _0x5dfee4;};}function handleError(_0x4606f4,_0x432a5c){_0x432a5c=_0x432a5c||0x1f4;return function(_0x2134cb){logger[_0xfa1e('0x2a')](_0x2134cb[_0xfa1e('0x2b')]);if(_0x2134cb[_0xfa1e('0x2c')]){delete _0x2134cb['name'];}_0x4606f4[_0xfa1e('0x1b')](_0x432a5c)['send'](_0x2134cb);};}exports[_0xfa1e('0x2d')]=function(_0x1ba3a6,_0x3df56f){var _0x28d70a={},_0xb9efd4={},_0x574ea6={'count':0x0,'rows':[]};var _0x5196e1=_[_0xfa1e('0x2e')](db[_0xfa1e('0x2f')]['rawAttributes'],function(_0x4947fb){return{'name':_0x4947fb['fieldName'],'type':_0x4947fb[_0xfa1e('0x30')][_0xfa1e('0x31')]};});_0xb9efd4[_0xfa1e('0x32')]=_[_0xfa1e('0x2e')](_0x5196e1,'name');_0xb9efd4[_0xfa1e('0x33')]=_[_0xfa1e('0x34')](_0x1ba3a6[_0xfa1e('0x33')]);_0xb9efd4[_0xfa1e('0x35')]=_[_0xfa1e('0x36')](_0xb9efd4[_0xfa1e('0x32')],_0xb9efd4[_0xfa1e('0x33')]);_0x28d70a[_0xfa1e('0x37')]=_[_0xfa1e('0x36')](_0xb9efd4[_0xfa1e('0x32')],qs[_0xfa1e('0x38')](_0x1ba3a6['query']['fields']));_0x28d70a[_0xfa1e('0x37')]=_0x28d70a[_0xfa1e('0x37')][_0xfa1e('0x39')]?_0x28d70a[_0xfa1e('0x37')]:_0xb9efd4['model'];if(!_0x1ba3a6[_0xfa1e('0x33')][_0xfa1e('0x3a')](_0xfa1e('0x3b'))){_0x28d70a['limit']=qs[_0xfa1e('0x1f')](_0x1ba3a6['query']['limit']);_0x28d70a[_0xfa1e('0x1d')]=qs[_0xfa1e('0x1d')](_0x1ba3a6['query'][_0xfa1e('0x1d')]);}_0x28d70a[_0xfa1e('0x3c')]=qs[_0xfa1e('0x3d')](_0x1ba3a6[_0xfa1e('0x33')]['sort']);_0x28d70a[_0xfa1e('0x3e')]=qs[_0xfa1e('0x35')](_[_0xfa1e('0x3f')](_0x1ba3a6['query'],_0xb9efd4['filters']),_0x5196e1);if(_0x1ba3a6['query']['filter']){_0x28d70a[_0xfa1e('0x3e')]=_['merge'](_0x28d70a[_0xfa1e('0x3e')],{'$or':_[_0xfa1e('0x2e')](_0x5196e1,function(_0x37b3b1){if(_0x37b3b1[_0xfa1e('0x30')]!=='VIRTUAL'){var _0x5bbcf0={};_0x5bbcf0[_0x37b3b1[_0xfa1e('0x2c')]]={'$like':'%'+_0x1ba3a6['query']['filter']+'%'};return _0x5bbcf0;}})});}_0x28d70a=_[_0xfa1e('0x40')]({},_0x28d70a,_0x1ba3a6['options']);var _0x715fd2={'where':_0x28d70a[_0xfa1e('0x3e')]};return db[_0xfa1e('0x2f')][_0xfa1e('0x20')](_0x715fd2)[_0xfa1e('0x25')](function(_0x5126ca){_0x574ea6[_0xfa1e('0x20')]=_0x5126ca;if(_0x1ba3a6[_0xfa1e('0x33')][_0xfa1e('0x41')]){_0x28d70a['include']=[{'all':!![]}];}return db[_0xfa1e('0x2f')]['findAll'](_0x28d70a);})[_0xfa1e('0x25')](function(_0x5981a2){_0x574ea6['rows']=_0x5981a2;return _0x574ea6;})[_0xfa1e('0x25')](respondWithFilteredResult(_0x3df56f,_0x28d70a))[_0xfa1e('0x42')](handleError(_0x3df56f,null));};exports[_0xfa1e('0x43')]=function(_0x5d07aa,_0x592b4d){var _0x931f9={'raw':![],'where':{'id':_0x5d07aa[_0xfa1e('0x44')]['id']}},_0xe4f5ad={};_0xe4f5ad[_0xfa1e('0x32')]=_['keys'](db[_0xfa1e('0x2f')]['rawAttributes']);_0xe4f5ad[_0xfa1e('0x33')]=_[_0xfa1e('0x34')](_0x5d07aa[_0xfa1e('0x33')]);_0xe4f5ad[_0xfa1e('0x35')]=_[_0xfa1e('0x36')](_0xe4f5ad[_0xfa1e('0x32')],_0xe4f5ad[_0xfa1e('0x33')]);_0x931f9[_0xfa1e('0x37')]=_[_0xfa1e('0x36')](_0xe4f5ad[_0xfa1e('0x32')],qs['fields'](_0x5d07aa[_0xfa1e('0x33')][_0xfa1e('0x38')]));_0x931f9[_0xfa1e('0x37')]=_0x931f9[_0xfa1e('0x37')]['length']?_0x931f9[_0xfa1e('0x37')]:_0xe4f5ad[_0xfa1e('0x32')];if(_0x5d07aa[_0xfa1e('0x33')]['includeAll']){_0x931f9[_0xfa1e('0x45')]=[{'all':!![]}];}_0x931f9=_[_0xfa1e('0x40')]({},_0x931f9,_0x5d07aa[_0xfa1e('0x46')]);return db['CmList'][_0xfa1e('0x47')](_0x931f9)[_0xfa1e('0x25')](handleEntityNotFound(_0x592b4d,null))['then'](respondWithResult(_0x592b4d,null))[_0xfa1e('0x42')](handleError(_0x592b4d,null));};exports[_0xfa1e('0x48')]=function(_0x46c6f9,_0xa6ec3e){return db['CmList'][_0xfa1e('0x48')](_0x46c6f9[_0xfa1e('0x49')],{})[_0xfa1e('0x25')](function(_0x4b9f28){var _0x420cad=_0x46c6f9[_0xfa1e('0x4a')]['get']({'plain':!![]});if(!_0x420cad)throw new Error(_0xfa1e('0x4b'));if(_0x420cad[_0xfa1e('0x4c')]===_0xfa1e('0x4a')){var _0x53dc20=_0x4b9f28['get']({'plain':!![]});var _0x34b8da=_0xfa1e('0x26');return db[_0xfa1e('0x4d')][_0xfa1e('0x47')]({'where':{'name':_0x34b8da,'userProfileId':_0x420cad[_0xfa1e('0x4e')]},'raw':!![]})[_0xfa1e('0x25')](function(_0x32871b){if(_0x32871b&&_0x32871b[_0xfa1e('0x4f')]===0x0){return db[_0xfa1e('0x27')]['create']({'name':_0x53dc20['name'],'resourceId':_0x53dc20['id'],'type':_0x32871b[_0xfa1e('0x2c')],'sectionId':_0x32871b['id']},{})[_0xfa1e('0x25')](function(){return _0x4b9f28;});}else{return _0x4b9f28;}})[_0xfa1e('0x42')](function(_0x3d7aef){logger['error'](_0xfa1e('0x50'),_0x3d7aef);throw _0x3d7aef;});}return _0x4b9f28;})[_0xfa1e('0x25')](respondWithResult(_0xa6ec3e,0xc9))[_0xfa1e('0x42')](handleError(_0xa6ec3e,null));};exports[_0xfa1e('0x24')]=function(_0x1d942b,_0x40ec8){if(_0x1d942b[_0xfa1e('0x49')]['id']){delete _0x1d942b[_0xfa1e('0x49')]['id'];}return db[_0xfa1e('0x2f')]['find']({'where':{'id':_0x1d942b[_0xfa1e('0x44')]['id']}})[_0xfa1e('0x25')](handleEntityNotFound(_0x40ec8,null))[_0xfa1e('0x25')](saveUpdates(_0x1d942b[_0xfa1e('0x49')],null))[_0xfa1e('0x25')](respondWithResult(_0x40ec8,null))[_0xfa1e('0x42')](handleError(_0x40ec8,null));};exports[_0xfa1e('0x28')]=function(_0xa363ef,_0x4c9a03){return db[_0xfa1e('0x2f')]['find']({'where':{'id':_0xa363ef[_0xfa1e('0x44')]['id']}})[_0xfa1e('0x25')](handleEntityNotFound(_0x4c9a03,null))[_0xfa1e('0x25')](removeEntity(_0x4c9a03,null))[_0xfa1e('0x42')](handleError(_0x4c9a03,null));};exports['describe']=function(_0x1e6601,_0x1cb3f2){return db['CmList'][_0xfa1e('0x51')]()[_0xfa1e('0x25')](respondWithResult(_0x1cb3f2,null))[_0xfa1e('0x42')](handleError(_0x1cb3f2,null));};exports[_0xfa1e('0x52')]=function(_0x45f5ba,_0x16ddb2,_0x2f10b0){if(_0x45f5ba[_0xfa1e('0x49')]['id']){delete _0x45f5ba[_0xfa1e('0x49')]['id'];}return db[_0xfa1e('0x2f')]['find']({'where':{'id':_0x45f5ba[_0xfa1e('0x44')]['id']}})[_0xfa1e('0x25')](handleEntityNotFound(_0x16ddb2,null))[_0xfa1e('0x25')](function(_0x47ac40){if(_0x47ac40){_0x45f5ba[_0xfa1e('0x49')][_0xfa1e('0x53')]=_0x47ac40['id'];return db[_0xfa1e('0x54')][_0xfa1e('0x48')](_0x45f5ba[_0xfa1e('0x49')]);}})[_0xfa1e('0x25')](respondWithResult(_0x16ddb2,null))['catch'](handleError(_0x16ddb2,null));};exports['getDispositions']=function(_0x13702e,_0x2558d9,_0x41c3a4){var _0x1f31fe={'raw':![],'where':{}};var _0x19f371={};var _0x33cf3c={'count':0x0,'rows':[]};return db['CmList'][_0xfa1e('0x55')]({'where':{'id':_0x13702e[_0xfa1e('0x44')]['id']}})[_0xfa1e('0x25')](handleEntityNotFound(_0x2558d9,null))[_0xfa1e('0x25')](function(_0xd6701b){if(_0xd6701b){_0x19f371['model']=_[_0xfa1e('0x34')](db[_0xfa1e('0x54')][_0xfa1e('0x56')]);_0x19f371['query']=_[_0xfa1e('0x34')](_0x13702e[_0xfa1e('0x33')]);_0x19f371[_0xfa1e('0x35')]=_[_0xfa1e('0x36')](_0x19f371['model'],_0x19f371[_0xfa1e('0x33')]);_0x1f31fe[_0xfa1e('0x37')]=_[_0xfa1e('0x36')](_0x19f371[_0xfa1e('0x32')],qs['fields'](_0x13702e[_0xfa1e('0x33')][_0xfa1e('0x38')]));_0x1f31fe[_0xfa1e('0x37')]=_0x1f31fe[_0xfa1e('0x37')][_0xfa1e('0x39')]?_0x1f31fe[_0xfa1e('0x37')]:_0x19f371[_0xfa1e('0x32')];if(!_0x13702e['query'][_0xfa1e('0x3a')]('nolimit')){_0x1f31fe[_0xfa1e('0x1f')]=qs['limit'](_0x13702e['query'][_0xfa1e('0x1f')]);_0x1f31fe[_0xfa1e('0x1d')]=qs['offset'](_0x13702e[_0xfa1e('0x33')][_0xfa1e('0x1d')]);}_0x1f31fe[_0xfa1e('0x3c')]=qs[_0xfa1e('0x3d')](_0x13702e['query'][_0xfa1e('0x3d')]);_0x1f31fe[_0xfa1e('0x3e')]=qs[_0xfa1e('0x35')](_['pick'](_0x13702e[_0xfa1e('0x33')],_0x19f371[_0xfa1e('0x35')]));_0x1f31fe[_0xfa1e('0x3e')][_0xfa1e('0x53')]=_0xd6701b['id'];if(_0x13702e[_0xfa1e('0x33')][_0xfa1e('0x57')]){_0x1f31fe['where']=_[_0xfa1e('0x40')](_0x1f31fe[_0xfa1e('0x3e')],{'$or':_[_0xfa1e('0x2e')](_0x1f31fe[_0xfa1e('0x37')],function(_0x2a1115){var _0x523fa0={};_0x523fa0[_0x2a1115]={'$like':'%'+_0x13702e['query'][_0xfa1e('0x57')]+'%'};return _0x523fa0;})});}_0x1f31fe=_['merge']({},_0x1f31fe,_0x13702e[_0xfa1e('0x46')]);return db['Disposition']['count']({'where':_0x1f31fe[_0xfa1e('0x3e')]})[_0xfa1e('0x25')](function(_0x395a0f){_0x33cf3c[_0xfa1e('0x20')]=_0x395a0f;if(_0x13702e['query'][_0xfa1e('0x41')]){_0x1f31fe[_0xfa1e('0x45')]=[{'all':!![]}];}return db[_0xfa1e('0x54')][_0xfa1e('0x58')](_0x1f31fe);})[_0xfa1e('0x25')](function(_0x18e567){_0x33cf3c[_0xfa1e('0x59')]=_0x18e567;return _0x33cf3c;});}})['then'](respondWithFilteredResult(_0x2558d9,_0x1f31fe))[_0xfa1e('0x42')](handleError(_0x2558d9,null));};exports['removeDispositions']=function(_0x2b7d83,_0x3d4b6c,_0x1a2e3e){return db[_0xfa1e('0x2f')][_0xfa1e('0x47')]({'where':{'id':_0x2b7d83['params']['id']}})['then'](handleEntityNotFound(_0x3d4b6c,null))[_0xfa1e('0x25')](function(_0xe4f54f){if(_0xe4f54f){return _0xe4f54f[_0xfa1e('0x5a')](_0x2b7d83[_0xfa1e('0x33')]['ids']);}})[_0xfa1e('0x25')](respondWithStatusCode(_0x3d4b6c,null))[_0xfa1e('0x42')](handleError(_0x3d4b6c,null));};exports[_0xfa1e('0x5b')]=function(_0x1a1626,_0x286d5a,_0x589163){return db['CmList'][_0xfa1e('0x47')]({'where':{'id':_0x1a1626[_0xfa1e('0x44')]['id']}})[_0xfa1e('0x25')](handleEntityNotFound(_0x286d5a,null))[_0xfa1e('0x25')](function(_0x2441f5){if(_0x2441f5){var _0x56c4e2=[];var _0x8bb69b={'success':[],'errors':[]};return db[_0xfa1e('0x5c')]['describe']()[_0xfa1e('0x25')](function(_0x519b9d){if(_0x1a1626['body']['tags']&&_[_0xfa1e('0x5d')](_0x1a1626[_0xfa1e('0x49')][_0xfa1e('0x5e')])){if(_0x1a1626['body'][_0xfa1e('0x5e')][_0xfa1e('0x39')]){_0x1a1626[_0xfa1e('0x49')]['tags']=_0x1a1626[_0xfa1e('0x49')][_0xfa1e('0x5e')]['join'](';')+';';}else{_0x1a1626[_0xfa1e('0x49')][_0xfa1e('0x5e')]=null;}}else{_0x1a1626[_0xfa1e('0x49')]['tags']=null;}if(_0x1a1626[_0xfa1e('0x49')]&&_[_0xfa1e('0x5d')](_0x1a1626['body'])){for(var _0x45ffbf=0x0;_0x45ffbf<_0x1a1626[_0xfa1e('0x49')]['length'];_0x45ffbf+=0x1){_0x1a1626['body'][_0x45ffbf][_0xfa1e('0x53')]=_0x1a1626[_0xfa1e('0x44')]['id'];_0x56c4e2[_0xfa1e('0x5f')](_0x1a1626[_0xfa1e('0x49')][_0x45ffbf]);}return BPromise[_0xfa1e('0x60')](_0x56c4e2,function(_0x5d1178){return db['CmContact'][_0xfa1e('0x48')](_['omit'](_0x5d1178,[_0xfa1e('0x61'),'id'])||{},{'fields':_['keys'](_0x519b9d),'raw':!![]})['then'](function(_0x390db6){_0x8bb69b[_0xfa1e('0x62')][_0xfa1e('0x5f')](_0x390db6[_0xfa1e('0x63')]);})['catch'](function(_0x486c5b){_0x8bb69b['errors'][_0xfa1e('0x5f')]({'data':_0x5d1178,'error':_0x486c5b['message']});});})[_0xfa1e('0x25')](function(_0x423146){return _0x8bb69b;})[_0xfa1e('0x42')](function(_0x101050){return _0x101050;});}else{_0x286d5a['status'](0x190)[_0xfa1e('0x1c')]({'message':_0xfa1e('0x64')});}});}})['then'](respondWithResult(_0x286d5a,null))[_0xfa1e('0x42')](handleError(_0x286d5a,null));};exports[_0xfa1e('0x65')]=function(_0x5eac5f,_0x425c01,_0xf9deef){var _0x1579b5;return db[_0xfa1e('0x2f')][_0xfa1e('0x47')]({'where':{'id':_0x5eac5f[_0xfa1e('0x44')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xfa1e('0x66')}]})[_0xfa1e('0x25')](handleEntityNotFound(_0x425c01,null))[_0xfa1e('0x25')](function(_0x3867d7){if(_0x3867d7){_0x1579b5=_0x3867d7;return db['CmContact']['rawAttributes'];}})['then'](function(_0xc36875){if(_0xc36875){var _0x2a5a75={};var _0x44bd42={};_0x44bd42['model']=_[_0xfa1e('0x67')](_['keys'](_0xc36875),_[_0xfa1e('0x2e')](_0x1579b5[_0xfa1e('0x66')],function(_0x108fc8){return util[_0xfa1e('0x68')](_0xfa1e('0x69'),_0x108fc8['id']);}));_0x44bd42[_0xfa1e('0x33')]=_['keys'](_0x5eac5f['query']);_0x44bd42[_0xfa1e('0x35')]=_[_0xfa1e('0x36')](_0x44bd42['model'],_0x44bd42[_0xfa1e('0x33')]);_0x2a5a75[_0xfa1e('0x37')]=_[_0xfa1e('0x36')](_0x44bd42['model'],qs[_0xfa1e('0x38')](_0x5eac5f['query'][_0xfa1e('0x38')]));_0x2a5a75[_0xfa1e('0x37')]=_0x2a5a75[_0xfa1e('0x37')][_0xfa1e('0x39')]?_0x2a5a75[_0xfa1e('0x37')]:_0x44bd42[_0xfa1e('0x32')];if(!_0x5eac5f[_0xfa1e('0x33')]['hasOwnProperty'](_0xfa1e('0x3b'))){_0x2a5a75[_0xfa1e('0x1f')]=qs[_0xfa1e('0x1f')](_0x5eac5f[_0xfa1e('0x33')][_0xfa1e('0x1f')]);_0x2a5a75['offset']=qs[_0xfa1e('0x1d')](_0x5eac5f[_0xfa1e('0x33')][_0xfa1e('0x1d')]);}_0x2a5a75[_0xfa1e('0x3c')]=qs['sort'](_0x5eac5f['query'][_0xfa1e('0x3d')]);_0x2a5a75[_0xfa1e('0x3e')]=qs[_0xfa1e('0x35')](_[_0xfa1e('0x3f')](_0x5eac5f[_0xfa1e('0x33')],_0x44bd42[_0xfa1e('0x35')]));_0x2a5a75[_0xfa1e('0x6a')]=!![];if(_0x5eac5f['query'][_0xfa1e('0x57')]){_0x2a5a75[_0xfa1e('0x3e')]=_[_0xfa1e('0x40')](_0x2a5a75['where'],{'$or':_[_0xfa1e('0x2e')](_0x2a5a75[_0xfa1e('0x37')],function(_0x3d5003){var _0x171e46={};_0x171e46[_0x3d5003]={'$like':'%'+_0x5eac5f[_0xfa1e('0x33')][_0xfa1e('0x57')]+'%'};return _0x171e46;})});}_0x2a5a75=_['merge']({},_0x2a5a75,_0x5eac5f[_0xfa1e('0x46')]);return _0x1579b5[_0xfa1e('0x65')](_0x2a5a75);}})[_0xfa1e('0x25')](respondWithResult(_0x425c01,null))[_0xfa1e('0x42')](handleError(_0x425c01,null));};exports[_0xfa1e('0x6b')]=function(_0x501715,_0x40b8f8,_0x4d932d){var _0x174794;return db[_0xfa1e('0x2f')]['find']({'where':{'id':_0x501715[_0xfa1e('0x44')]['id']},'include':[{'model':db[_0xfa1e('0x6c')],'as':'CustomFields'}]})[_0xfa1e('0x25')](handleEntityNotFound(_0x40b8f8,null))[_0xfa1e('0x25')](function(_0x3b26e1){if(_0x3b26e1){_0x174794=_0x3b26e1;return db[_0xfa1e('0x5c')][_0xfa1e('0x56')];}})[_0xfa1e('0x25')](function(_0x6603ce){if(_0x6603ce){var _0x51dc9a={};var _0x12d55c={};_0x12d55c[_0xfa1e('0x32')]=_['concat'](_['keys'](_0x6603ce),_[_0xfa1e('0x2e')](_0x174794[_0xfa1e('0x66')],function(_0xc62497){return util['format'](_0xfa1e('0x69'),_0xc62497['id']);}));_0x12d55c[_0xfa1e('0x33')]=_[_0xfa1e('0x34')](_0x501715['query']);_0x12d55c[_0xfa1e('0x35')]=_[_0xfa1e('0x36')](_0x12d55c[_0xfa1e('0x32')],_0x12d55c[_0xfa1e('0x33')]);_0x51dc9a[_0xfa1e('0x37')]=_[_0xfa1e('0x36')](_0x12d55c[_0xfa1e('0x32')],qs['fields'](_0x501715[_0xfa1e('0x33')][_0xfa1e('0x38')]));_0x51dc9a[_0xfa1e('0x37')]=_0x51dc9a[_0xfa1e('0x37')][_0xfa1e('0x39')]?_0x51dc9a[_0xfa1e('0x37')]:_0x12d55c[_0xfa1e('0x32')];if(!_0x501715[_0xfa1e('0x33')][_0xfa1e('0x3a')](_0xfa1e('0x3b'))){_0x51dc9a[_0xfa1e('0x1f')]=qs[_0xfa1e('0x1f')](_0x501715[_0xfa1e('0x33')][_0xfa1e('0x1f')]);_0x51dc9a[_0xfa1e('0x1d')]=qs['offset'](_0x501715[_0xfa1e('0x33')][_0xfa1e('0x1d')]);}_0x51dc9a['order']=qs[_0xfa1e('0x3d')](_0x501715[_0xfa1e('0x33')]['sort']);_0x51dc9a[_0xfa1e('0x3e')]=qs[_0xfa1e('0x35')](_[_0xfa1e('0x3f')](_0x501715['query'],_0x12d55c[_0xfa1e('0x35')]));_0x51dc9a[_0xfa1e('0x6a')]=!![];if(_0x501715[_0xfa1e('0x33')][_0xfa1e('0x57')]){_0x51dc9a[_0xfa1e('0x3e')]=_[_0xfa1e('0x40')](_0x51dc9a['where'],{'$or':_[_0xfa1e('0x2e')](_0x51dc9a[_0xfa1e('0x37')],function(_0x1f2444){var _0x26059d={};_0x26059d[_0x1f2444]={'$like':'%'+_0x501715[_0xfa1e('0x33')][_0xfa1e('0x57')]+'%'};return _0x26059d;})});}_0x51dc9a=_[_0xfa1e('0x40')]({},_0x51dc9a,_0x501715[_0xfa1e('0x46')]);return _0x174794[_0xfa1e('0x65')](_0x51dc9a);}})[_0xfa1e('0x25')](function(_0x452b55){if(!_['isEmpty'](_0x452b55)){var _0x485ada=toCsv(_0x452b55);var _0xa7a7a9=Date[_0xfa1e('0x6d')]();fs[_0xfa1e('0x6e')](util[_0xfa1e('0x68')](_0xfa1e('0x6f'),_0x174794['id'],_0xa7a7a9),_0x485ada);_0x40b8f8[_0xfa1e('0x70')](_0xfa1e('0x71'),_0xfa1e('0x72')+util[_0xfa1e('0x68')](_0xfa1e('0x73'),_0x174794['id'],_0xa7a7a9));_0x40b8f8[_0xfa1e('0x70')](_0xfa1e('0x74'),_0xfa1e('0x75'));return _0x40b8f8[_0xfa1e('0x76')](util[_0xfa1e('0x68')]('/tmp/list_%d_%s.csv',_0x174794['id'],_0xa7a7a9));}else{return _0x40b8f8['sendStatus'](0xcc);}})[_0xfa1e('0x42')](handleError(_0x40b8f8,null));};exports['addCustomField']=function(_0x14f033,_0x12623e,_0x238f73){var _0x27a992;delete _0x14f033[_0xfa1e('0x49')]['id'];return db[_0xfa1e('0x2f')][_0xfa1e('0x55')]({'where':{'id':_0x14f033['params']['id']}})[_0xfa1e('0x25')](handleEntityNotFound(_0x12623e,null))[_0xfa1e('0x25')](function(_0x4d5cc7){if(_0x4d5cc7){return db[_0xfa1e('0x77')][_0xfa1e('0x78')](function(_0x3ca899){return db['CmCustomField']['create'](_0x14f033[_0xfa1e('0x49')],{'transaction':_0x3ca899})['then'](function(_0x517bd7){_0x27a992=_0x517bd7;return _0x4d5cc7[_0xfa1e('0x79')](_0x517bd7,{'transaction':_0x3ca899});})['then'](function(){var _0x18ff6a={'type':db[_0xfa1e('0x7a')]['TEXT'],'transaction':_0x3ca899};switch(_0x14f033['body'][_0xfa1e('0x30')]){case _0xfa1e('0x7b'):_0x18ff6a[_0xfa1e('0x30')]=db[_0xfa1e('0x7a')]['TEXT'];break;case _0xfa1e('0x7c'):_0x18ff6a[_0xfa1e('0x30')]=db['Sequelize'][_0xfa1e('0x7d')];break;case _0xfa1e('0x7e'):_0x18ff6a[_0xfa1e('0x30')]=db[_0xfa1e('0x7a')][_0xfa1e('0x7f')];_0x18ff6a[_0xfa1e('0x80')]=![];break;default:}return db[_0xfa1e('0x77')][_0xfa1e('0x81')][_0xfa1e('0x82')](_0xfa1e('0x83'),util['format'](_0xfa1e('0x84'),_0x27a992['id']),_0x18ff6a);})['then'](function(){return _0x27a992;});});}})[_0xfa1e('0x25')](respondWithResult(_0x12623e,null))[_0xfa1e('0x42')](handleError(_0x12623e,null));};exports[_0xfa1e('0x85')]=function(_0x108b22,_0x14d226,_0x58b386){var _0x2afe1c={};var _0x14510b={};var _0x2e9795;var _0x39ee56;return db[_0xfa1e('0x2f')][_0xfa1e('0x55')]({'where':{'id':_0x108b22[_0xfa1e('0x44')]['id']}})[_0xfa1e('0x25')](handleEntityNotFound(_0x14d226,null))[_0xfa1e('0x25')](function(_0x1cecd0){if(_0x1cecd0){_0x2e9795=_0x1cecd0;_0x14510b[_0xfa1e('0x32')]=_[_0xfa1e('0x34')](db[_0xfa1e('0x6c')][_0xfa1e('0x56')]);_0x14510b[_0xfa1e('0x33')]=_[_0xfa1e('0x34')](_0x108b22[_0xfa1e('0x33')]);_0x14510b[_0xfa1e('0x35')]=_[_0xfa1e('0x36')](_0x14510b[_0xfa1e('0x32')],_0x14510b[_0xfa1e('0x33')]);_0x2afe1c[_0xfa1e('0x37')]=_[_0xfa1e('0x36')](_0x14510b[_0xfa1e('0x32')],qs[_0xfa1e('0x38')](_0x108b22[_0xfa1e('0x33')][_0xfa1e('0x38')]));_0x2afe1c[_0xfa1e('0x37')]=_0x2afe1c[_0xfa1e('0x37')][_0xfa1e('0x39')]?_0x2afe1c['attributes']:_0x14510b[_0xfa1e('0x32')];_0x2afe1c[_0xfa1e('0x3c')]=qs[_0xfa1e('0x3d')](_0x108b22[_0xfa1e('0x33')][_0xfa1e('0x3d')]);_0x2afe1c[_0xfa1e('0x3e')]=qs[_0xfa1e('0x35')](_[_0xfa1e('0x3f')](_0x108b22[_0xfa1e('0x33')],_0x14510b['filters']));_0x2afe1c[_0xfa1e('0x3e')]=_['merge'](_0x2afe1c[_0xfa1e('0x3e')],{'$or':[{'ListId':_0x1cecd0['id']},{'ListId':null}]});if(_0x108b22[_0xfa1e('0x33')][_0xfa1e('0x57')]){_0x2afe1c[_0xfa1e('0x3e')]=_[_0xfa1e('0x40')](_0x2afe1c[_0xfa1e('0x3e')],{'$or':_[_0xfa1e('0x2e')](_0x2afe1c[_0xfa1e('0x37')],function(_0x96f894){var _0x5026f4={};_0x5026f4[_0x96f894]={'$like':'%'+_0x108b22[_0xfa1e('0x33')][_0xfa1e('0x57')]+'%'};return _0x5026f4;})});}_0x2afe1c=_[_0xfa1e('0x40')]({},_0x2afe1c,_0x108b22['options']);return db['CmCustomField'][_0xfa1e('0x86')](_0x2afe1c);}})['then'](respondWithResult(_0x14d226,null))[_0xfa1e('0x42')](handleError(_0x14d226,null));};exports[_0xfa1e('0x87')]=function(_0x2d1f36,_0x5f3b82,_0x35769f){return db[_0xfa1e('0x2f')][_0xfa1e('0x47')]({'where':{'id':_0x2d1f36[_0xfa1e('0x44')]['id']}})[_0xfa1e('0x25')](handleEntityNotFound(_0x5f3b82,null))[_0xfa1e('0x25')](function(_0x459166){if(_0x459166){return _0x459166[_0xfa1e('0x87')](_0x2d1f36[_0xfa1e('0x49')][_0xfa1e('0x61')],_['omit'](_0x2d1f36[_0xfa1e('0x49')],['ids','id'])||{})[_0xfa1e('0x88')](function(_0x43c874){for(var _0x4011c9=0x0;_0x4011c9<_0x2d1f36[_0xfa1e('0x49')]['ids'][_0xfa1e('0x39')];_0x4011c9+=0x1){socket[_0xfa1e('0x89')]('userCmList:save',{'UserId':Number(_0x2d1f36['body'][_0xfa1e('0x61')][_0x4011c9]),'CmListId':Number(_0x2d1f36[_0xfa1e('0x44')]['id'])});}return _0x43c874;});}})[_0xfa1e('0x25')](respondWithResult(_0x5f3b82,null))['catch'](handleError(_0x5f3b82,null));};exports[_0xfa1e('0x8a')]=function(_0x4aa219,_0x162884,_0x1beb13){return db[_0xfa1e('0x2f')][_0xfa1e('0x47')]({'where':{'id':_0x4aa219[_0xfa1e('0x44')]['id']}})['then'](handleEntityNotFound(_0x162884,null))['then'](function(_0x3309d3){if(_0x3309d3){return _0x3309d3['removeAgents'](_0x4aa219['query'][_0xfa1e('0x61')])[_0xfa1e('0x25')](function(){if(_['isArray'](_0x4aa219[_0xfa1e('0x33')][_0xfa1e('0x61')])){for(var _0x3c7b49=0x0;_0x3c7b49<_0x4aa219[_0xfa1e('0x33')][_0xfa1e('0x61')][_0xfa1e('0x39')];_0x3c7b49+=0x1){socket[_0xfa1e('0x89')](_0xfa1e('0x8b'),{'UserId':Number(_0x4aa219[_0xfa1e('0x33')]['ids'][_0x3c7b49]),'CmListId':Number(_0x4aa219[_0xfa1e('0x44')]['id'])});}}else{socket[_0xfa1e('0x89')](_0xfa1e('0x8b'),{'UserId':Number(_0x4aa219[_0xfa1e('0x33')][_0xfa1e('0x61')]),'CmListId':Number(_0x4aa219['params']['id'])});}});}})[_0xfa1e('0x25')](respondWithStatusCode(_0x162884,null))[_0xfa1e('0x42')](handleError(_0x162884,null));};exports[_0xfa1e('0x8c')]=function(_0x5d8a9e,_0x20d91b,_0x4dba63){var _0x77321e={};var _0x1e3897={};var _0x47e8d2;var _0x5633c5;return db[_0xfa1e('0x2f')][_0xfa1e('0x55')]({'where':{'id':_0x5d8a9e[_0xfa1e('0x44')]['id']}})['then'](handleEntityNotFound(_0x20d91b,null))[_0xfa1e('0x25')](function(_0x35b7a4){if(_0x35b7a4){_0x47e8d2=_0x35b7a4;_0x1e3897[_0xfa1e('0x32')]=_[_0xfa1e('0x34')](db['User']['rawAttributes']);_0x1e3897[_0xfa1e('0x33')]=_[_0xfa1e('0x34')](_0x5d8a9e['query']);_0x1e3897['filters']=_[_0xfa1e('0x36')](_0x1e3897[_0xfa1e('0x32')],_0x1e3897['query']);_0x77321e[_0xfa1e('0x37')]=_[_0xfa1e('0x36')](_0x1e3897[_0xfa1e('0x32')],qs[_0xfa1e('0x38')](_0x5d8a9e['query'][_0xfa1e('0x38')]));_0x77321e['attributes']=_0x77321e[_0xfa1e('0x37')][_0xfa1e('0x39')]?_0x77321e[_0xfa1e('0x37')]:_0x1e3897[_0xfa1e('0x32')];_0x77321e[_0xfa1e('0x3c')]=qs[_0xfa1e('0x3d')](_0x5d8a9e['query'][_0xfa1e('0x3d')]);_0x77321e['where']=qs[_0xfa1e('0x35')](_[_0xfa1e('0x3f')](_0x5d8a9e[_0xfa1e('0x33')],_0x1e3897['filters']));if(_0x5d8a9e[_0xfa1e('0x33')][_0xfa1e('0x57')]){_0x77321e[_0xfa1e('0x3e')]=_[_0xfa1e('0x40')](_0x77321e[_0xfa1e('0x3e')],{'$or':_[_0xfa1e('0x2e')](_0x77321e['attributes'],function(_0x20f9aa){var _0x5eb9ac={};_0x5eb9ac[_0x20f9aa]={'$like':'%'+_0x5d8a9e['query'][_0xfa1e('0x57')]+'%'};return _0x5eb9ac;})});}_0x77321e=_[_0xfa1e('0x40')]({},_0x77321e,_0x5d8a9e[_0xfa1e('0x46')]);return _0x47e8d2[_0xfa1e('0x8c')](_0x77321e);}})[_0xfa1e('0x25')](function(_0x5a2e4f){if(_0x5a2e4f){_0x5633c5=_0x5a2e4f[_0xfa1e('0x39')];if(!_0x5d8a9e['query'][_0xfa1e('0x3a')]('nolimit')){_0x77321e[_0xfa1e('0x1f')]=qs['limit'](_0x5d8a9e[_0xfa1e('0x33')][_0xfa1e('0x1f')]);_0x77321e[_0xfa1e('0x1d')]=qs['offset'](_0x5d8a9e[_0xfa1e('0x33')][_0xfa1e('0x1d')]);}return _0x47e8d2['getAgents'](_0x77321e);}})[_0xfa1e('0x25')](function(_0x51e7ac){if(_0x51e7ac){return _0x51e7ac?{'count':_0x5633c5,'rows':_0x51e7ac}:null;}})['then'](respondWithResult(_0x20d91b,null))[_0xfa1e('0x42')](handleError(_0x20d91b,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index d7b0f3e..c2ebbea 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x5fc3[_0x54b283];return _0x2462b3;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x5d2ba1,_0x569801){_0x5d2ba1=_0x5d2ba1-0x0;var _0x23e59c=_0x326f[_0x5d2ba1];return _0x23e59c;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 7cdbf87..f286f74 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 _0xb58b=['CmList','cm_lists','util','../../config/logger','api','bluebird','request-promise','rimraf','./cmList.attributes','exports','define'];(function(_0x5823a7,_0x3cc2d7){var _0x4f1d86=function(_0x26ff02){while(--_0x26ff02){_0x5823a7['push'](_0x5823a7['shift']());}};_0x4f1d86(++_0x3cc2d7);}(_0xb58b,0x1f1));var _0xbb58=function(_0x3ce77e,_0x1d2c06){_0x3ce77e=_0x3ce77e-0x0;var _0x359ea4=_0xb58b[_0x3ce77e];return _0x359ea4;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var logger=require(_0xbb58('0x1'))(_0xbb58('0x2'));var moment=require('moment');var BPromise=require(_0xbb58('0x3'));var rp=require(_0xbb58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb58('0x5'));var config=require('../../config/environment');var attributes=require(_0xbb58('0x6'));module[_0xbb58('0x7')]=function(_0x33fe85,_0x5cf8b1){return _0x33fe85[_0xbb58('0x8')](_0xbb58('0x9'),attributes,{'tableName':_0xbb58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./cmList.attributes','exports','define','cm_lists','../../config/logger','api','moment','bluebird','path'];(function(_0xecd971,_0x4e183d){var _0x4c97dd=function(_0x3f5b1c){while(--_0x3f5b1c){_0xecd971['push'](_0xecd971['shift']());}};_0x4c97dd(++_0x4e183d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0xcb91[_0x29e35f];return _0x266b74;};'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')]('CmList',attributes,{'tableName':_0x1cb9('0x9'),'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 1323c52..c03d710 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 _0xfd32=['error','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x10d670,_0x178996){var _0x20d6f8=function(_0x4a4b87){while(--_0x4a4b87){_0x10d670['push'](_0x10d670['shift']());}};_0x20d6f8(++_0x178996);}(_0xfd32,0x1c5));var _0x2fd3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd32[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2fd3('0x0'));var util=require(_0x2fd3('0x1'));var moment=require(_0x2fd3('0x2'));var BPromise=require(_0x2fd3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fd3('0x4'))['db'];var utils=require(_0x2fd3('0x5'));var logger=require('../../config/logger')(_0x2fd3('0x6'));var config=require(_0x2fd3('0x7'));var jayson=require(_0x2fd3('0x8'));var client=jayson['client'][_0x2fd3('0x9')]({'port':0x232a});config[_0x2fd3('0xa')]=_[_0x2fd3('0xb')](config[_0x2fd3('0xa')],{'host':_0x2fd3('0xc'),'port':0x18eb});var socket=require(_0x2fd3('0xd'))(new Redis(config[_0x2fd3('0xa')]));require(_0x2fd3('0xe'))[_0x2fd3('0xf')](socket);function respondWithRpcPromise(_0x118ce6,_0x17d5cd,_0x490978){return new BPromise(function(_0x4b8caa,_0x16c050){return client[_0x2fd3('0x10')](_0x118ce6,_0x490978)[_0x2fd3('0x11')](function(_0x5cc06e){logger[_0x2fd3('0x12')]('CmList,\x20%s,\x20%s',_0x17d5cd,_0x2fd3('0x13'));logger[_0x2fd3('0x14')](_0x2fd3('0x15'),_0x17d5cd,_0x2fd3('0x13'),JSON[_0x2fd3('0x16')](_0x5cc06e));if(_0x5cc06e[_0x2fd3('0x17')]){if(_0x5cc06e['error']['code']===0x1f4){logger['error'](_0x2fd3('0x18'),_0x17d5cd,_0x5cc06e[_0x2fd3('0x17')][_0x2fd3('0x19')]);return _0x16c050(_0x5cc06e[_0x2fd3('0x17')][_0x2fd3('0x19')]);}logger[_0x2fd3('0x17')](_0x2fd3('0x18'),_0x17d5cd,_0x5cc06e[_0x2fd3('0x17')][_0x2fd3('0x19')]);return _0x4b8caa(_0x5cc06e[_0x2fd3('0x17')][_0x2fd3('0x19')]);}else{logger[_0x2fd3('0x12')](_0x2fd3('0x18'),_0x17d5cd,_0x2fd3('0x13'));_0x4b8caa(_0x5cc06e[_0x2fd3('0x1a')]['message']);}})[_0x2fd3('0x1b')](function(_0x29735e){logger['error']('CmList,\x20%s,\x20%s',_0x17d5cd,_0x29735e);_0x16c050(_0x29735e);});});} \ No newline at end of file +var _0x489a=['then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./cmList.socket','register','request'];(function(_0x1e235e,_0x994b77){var _0x1e8e94=function(_0x4a9e2c){while(--_0x4a9e2c){_0x1e235e['push'](_0x1e235e['shift']());}};_0x1e8e94(++_0x994b77);}(_0x489a,0xc7));var _0xa489=function(_0x5ebe34,_0x421337){_0x5ebe34=_0x5ebe34-0x0;var _0x36a3ee=_0x489a[_0x5ebe34];return _0x36a3ee;};'use strict';var _=require('lodash');var util=require(_0xa489('0x0'));var moment=require(_0xa489('0x1'));var BPromise=require(_0xa489('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa489('0x3'));var db=require(_0xa489('0x4'))['db'];var utils=require(_0xa489('0x5'));var logger=require(_0xa489('0x6'))(_0xa489('0x7'));var config=require('../../config/environment');var jayson=require(_0xa489('0x8'));var client=jayson[_0xa489('0x9')]['http']({'port':0x232a});config['redis']=_[_0xa489('0xa')](config['redis'],{'host':_0xa489('0xb'),'port':0x18eb});var socket=require(_0xa489('0xc'))(new Redis(config[_0xa489('0xd')]));require(_0xa489('0xe'))[_0xa489('0xf')](socket);function respondWithRpcPromise(_0xf7e351,_0x397b6b,_0x32433d){return new BPromise(function(_0x37854e,_0x5d13c6){return client[_0xa489('0x10')](_0xf7e351,_0x32433d)[_0xa489('0x11')](function(_0x1807cd){logger[_0xa489('0x12')](_0xa489('0x13'),_0x397b6b,_0xa489('0x14'));logger[_0xa489('0x15')](_0xa489('0x16'),_0x397b6b,_0xa489('0x14'),JSON[_0xa489('0x17')](_0x1807cd));if(_0x1807cd[_0xa489('0x18')]){if(_0x1807cd[_0xa489('0x18')][_0xa489('0x19')]===0x1f4){logger[_0xa489('0x18')](_0xa489('0x13'),_0x397b6b,_0x1807cd['error'][_0xa489('0x1a')]);return _0x5d13c6(_0x1807cd[_0xa489('0x18')][_0xa489('0x1a')]);}logger[_0xa489('0x18')](_0xa489('0x13'),_0x397b6b,_0x1807cd[_0xa489('0x18')][_0xa489('0x1a')]);return _0x37854e(_0x1807cd['error']['message']);}else{logger[_0xa489('0x12')](_0xa489('0x13'),_0x397b6b,_0xa489('0x14'));_0x37854e(_0x1807cd['result'][_0xa489('0x1a')]);}})['catch'](function(_0x499f5e){logger[_0xa489('0x18')](_0xa489('0x13'),_0x397b6b,_0x499f5e);_0x5d13c6(_0x499f5e);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 4b5cf9e..66dcbba 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 _0x692b=['./cmList.events','remove','update','emit','removeListener','register','length','cmList:'];(function(_0x119d25,_0x588c8){var _0x39cf30=function(_0x31c68c){while(--_0x31c68c){_0x119d25['push'](_0x119d25['shift']());}};_0x39cf30(++_0x588c8);}(_0x692b,0xb0));var _0xb692=function(_0x4af8e5,_0x5ae8fe){_0x4af8e5=_0x4af8e5-0x0;var _0x6d5554=_0x692b[_0x4af8e5];return _0x6d5554;};'use strict';var CmListEvents=require(_0xb692('0x0'));var events=['save',_0xb692('0x1'),_0xb692('0x2')];function createListener(_0x4650a6,_0x4baf1c){return function(_0x468a0f){_0x4baf1c[_0xb692('0x3')](_0x4650a6,_0x468a0f);};}function removeListener(_0x69ac5e,_0x369ac8){return function(){CmListEvents[_0xb692('0x4')](_0x69ac5e,_0x369ac8);};}exports[_0xb692('0x5')]=function(_0x2f7c6d){for(var _0x27372d=0x0,_0x24fa13=events[_0xb692('0x6')];_0x27372d<_0x24fa13;_0x27372d++){var _0x49db51=events[_0x27372d];var _0x42c14c=createListener(_0xb692('0x7')+_0x49db51,_0x2f7c6d);CmListEvents['on'](_0x49db51,_0x42c14c);}}; \ No newline at end of file +var _0x9771=['cmList:','save','remove','update','removeListener','length'];(function(_0xc8a02c,_0x4809d3){var _0x3d89da=function(_0x5903d8){while(--_0x5903d8){_0xc8a02c['push'](_0xc8a02c['shift']());}};_0x3d89da(++_0x4809d3);}(_0x9771,0xc1));var _0x1977=function(_0x58a579,_0x3fb984){_0x58a579=_0x58a579-0x0;var _0x587781=_0x9771[_0x58a579];return _0x587781;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x1977('0x0'),_0x1977('0x1'),_0x1977('0x2')];function createListener(_0x5c7585,_0x368fd9){return function(_0x5d97ef){_0x368fd9['emit'](_0x5c7585,_0x5d97ef);};}function removeListener(_0xa773df,_0x6adc35){return function(){CmListEvents[_0x1977('0x3')](_0xa773df,_0x6adc35);};}exports['register']=function(_0x14fb57){for(var _0x3b1573=0x0,_0x177b01=events[_0x1977('0x4')];_0x3b1573<_0x177b01;_0x3b1573++){var _0x2587bb=events[_0x3b1573];var _0x4248de=createListener(_0x1977('0x5')+_0x2587bb,_0x14fb57);CmListEvents['on'](_0x2587bb,_0x4248de);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index bbdd08a..55dbf3a 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 _0x828d=['/:id','getDispositions','/:id/contacts','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','describe'];(function(_0x4c062e,_0x20f461){var _0x16e86e=function(_0x5b88c2){while(--_0x5b88c2){_0x4c062e['push'](_0x4c062e['shift']());}};_0x16e86e(++_0x20f461);}(_0x828d,0xb7));var _0xd828=function(_0x1ae71f,_0x5e890f){_0x1ae71f=_0x1ae71f-0x0;var _0x17857e=_0x828d[_0x1ae71f];return _0x17857e;};'use strict';var multer=require(_0xd828('0x0'));var util=require(_0xd828('0x1'));var path=require(_0xd828('0x2'));var timeout=require(_0xd828('0x3'));var express=require(_0xd828('0x4'));var router=express[_0xd828('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd828('0x6'));var config=require(_0xd828('0x7'));var controller=require(_0xd828('0x8'));router[_0xd828('0x9')]('/',auth[_0xd828('0xa')](),controller[_0xd828('0xb')]);router[_0xd828('0x9')]('/describe',auth[_0xd828('0xa')](),controller[_0xd828('0xc')]);router[_0xd828('0x9')](_0xd828('0xd'),auth[_0xd828('0xa')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd828('0xe')]);router[_0xd828('0x9')](_0xd828('0xf'),auth['isAuthenticated'](),controller['getContacts']);router[_0xd828('0x9')]('/:id/contacts/csv',auth[_0xd828('0xa')](),controller['getContactsCsv']);router['get'](_0xd828('0x10'),auth[_0xd828('0xa')](),controller[_0xd828('0x11')]);router[_0xd828('0x9')](_0xd828('0x12'),auth[_0xd828('0xa')](),controller[_0xd828('0x13')]);router[_0xd828('0x14')]('/',auth['isAuthenticated'](),controller[_0xd828('0x15')]);router[_0xd828('0x14')]('/:id/dispositions',auth[_0xd828('0xa')](),controller[_0xd828('0x16')]);router[_0xd828('0x14')](_0xd828('0xf'),auth[_0xd828('0xa')](),controller[_0xd828('0x17')]);router[_0xd828('0x14')](_0xd828('0x10'),auth['isAuthenticated'](),controller[_0xd828('0x18')]);router[_0xd828('0x14')]('/:id/users',auth[_0xd828('0xa')](),controller['addAgents']);router[_0xd828('0x19')](_0xd828('0xd'),auth[_0xd828('0xa')](),controller['update']);router[_0xd828('0x1a')](_0xd828('0xd'),auth['isAuthenticated'](),controller[_0xd828('0x1b')]);router[_0xd828('0x1a')]('/:id/dispositions',auth[_0xd828('0xa')](),controller['removeDispositions']);router[_0xd828('0x1a')](_0xd828('0x12'),auth[_0xd828('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xed70=['/:id/users','getAgents','post','create','addContacts','addCustomField','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','isAuthenticated','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields'];(function(_0x4ab9a2,_0x1fdbca){var _0x10d7d7=function(_0x21d124){while(--_0x21d124){_0x4ab9a2['push'](_0x4ab9a2['shift']());}};_0x10d7d7(++_0x1fdbca);}(_0xed70,0x75));var _0x0ed7=function(_0x3e3e56,_0x59a258){_0x3e3e56=_0x3e3e56-0x0;var _0x5a935e=_0xed70[_0x3e3e56];return _0x5a935e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0ed7('0x0'));var timeout=require(_0x0ed7('0x1'));var express=require(_0x0ed7('0x2'));var router=express[_0x0ed7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0ed7('0x4'));var interaction=require(_0x0ed7('0x5'));var config=require(_0x0ed7('0x6'));var controller=require(_0x0ed7('0x7'));router[_0x0ed7('0x8')]('/',auth['isAuthenticated'](),controller[_0x0ed7('0x9')]);router[_0x0ed7('0x8')]('/describe',auth[_0x0ed7('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0ed7('0xb')]);router['get'](_0x0ed7('0xc'),auth['isAuthenticated'](),controller[_0x0ed7('0xd')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x0ed7('0xe')]);router['get'](_0x0ed7('0xf'),auth[_0x0ed7('0xa')](),controller[_0x0ed7('0x10')]);router[_0x0ed7('0x8')](_0x0ed7('0x11'),auth[_0x0ed7('0xa')](),controller[_0x0ed7('0x12')]);router[_0x0ed7('0x8')](_0x0ed7('0x13'),auth['isAuthenticated'](),controller[_0x0ed7('0x14')]);router[_0x0ed7('0x15')]('/',auth[_0x0ed7('0xa')](),controller[_0x0ed7('0x16')]);router['post']('/:id/dispositions',auth[_0x0ed7('0xa')](),controller['addDisposition']);router[_0x0ed7('0x15')]('/:id/contacts',auth[_0x0ed7('0xa')](),controller[_0x0ed7('0x17')]);router[_0x0ed7('0x15')]('/:id/fields',auth[_0x0ed7('0xa')](),controller[_0x0ed7('0x18')]);router[_0x0ed7('0x15')](_0x0ed7('0x13'),auth['isAuthenticated'](),controller[_0x0ed7('0x19')]);router[_0x0ed7('0x1a')](_0x0ed7('0x1b'),auth[_0x0ed7('0xa')](),controller[_0x0ed7('0x1c')]);router[_0x0ed7('0x1d')](_0x0ed7('0x1b'),auth[_0x0ed7('0xa')](),controller[_0x0ed7('0x1e')]);router['delete'](_0x0ed7('0xc'),auth[_0x0ed7('0xa')](),controller[_0x0ed7('0x1f')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x0ed7('0x20')]);module[_0x0ed7('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 252bada..6b66e16 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 _0xcce0=['VIRTUAL','getDataValue','STRING','sequelize','exports'];(function(_0x1542af,_0x54e629){var _0x79868c=function(_0x352732){while(--_0x352732){_0x1542af['push'](_0x1542af['shift']());}};_0x79868c(++_0x54e629);}(_0xcce0,0x71));var _0x0cce=function(_0x2f1de4,_0x2eb22a){_0x2f1de4=_0x2f1de4-0x0;var _0x15c699=_0xcce0[_0x2f1de4];return _0x15c699;};'use strict';var Sequelize=require(_0x0cce('0x0'));module[_0x0cce('0x1')]={'name':{'type':Sequelize[_0x0cce('0x2')],'get':function(_0xb521f6){return this[_0x0cce('0x3')]('field');}},'field':{'type':Sequelize[_0x0cce('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x0cce('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xfe81=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0xfe81,0xa3));var _0x1fe8=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0xfe81[_0x30a31e];return _0x170879;};'use strict';var Sequelize=require(_0x1fe8('0x0'));module[_0x1fe8('0x1')]={'name':{'type':Sequelize[_0x1fe8('0x2')],'get':function(_0x417acd){return this[_0x1fe8('0x3')](_0x1fe8('0x4'));}},'field':{'type':Sequelize[_0x1fe8('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x1fe8('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x1fe8('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 993f517..17cea37 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(_0x255630,_0x5aa76e){var _0x580e48=function(_0x20db16){while(--_0x20db16){_0x255630['push'](_0x255630['shift']());}};_0x580e48(++_0x5aa76e);}(_0x7a54,0x106));var _0x47a5=function(_0x1f4ed2,_0x51eb95){_0x1f4ed2=_0x1f4ed2-0x0;var _0x354a6d=_0x7a54[_0x1f4ed2];return _0x354a6d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x328ec5,_0x16df6d){var _0x428e77=function(_0x45bf80){while(--_0x45bf80){_0x328ec5['push'](_0x328ec5['shift']());}};_0x428e77(++_0x16df6d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 42317cc..e384245 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 _0xf4fe=['tools_conditions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xf4fe,0x115));var _0xef4f=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf4fe[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xef4f('0x0'));var util=require(_0xef4f('0x1'));var logger=require('../../config/logger')(_0xef4f('0x2'));var moment=require(_0xef4f('0x3'));var BPromise=require(_0xef4f('0x4'));var rp=require(_0xef4f('0x5'));var fs=require('fs');var path=require(_0xef4f('0x6'));var rimraf=require(_0xef4f('0x7'));var config=require(_0xef4f('0x8'));var attributes=require('./condition.attributes');module[_0xef4f('0x9')]=function(_0x16105e,_0x1aef4e){return _0x16105e[_0xef4f('0xa')]('Condition',attributes,{'tableName':_0xef4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd45d=['tools_conditions','util','api','moment','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','Condition'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd45d,0xe8));var _0xdd45=function(_0x5b84d1,_0x387330){_0x5b84d1=_0x5b84d1-0x0;var _0x598650=_0xd45d[_0x5b84d1];return _0x598650;};'use strict';var _=require('lodash');var util=require(_0xdd45('0x0'));var logger=require('../../config/logger')(_0xdd45('0x1'));var moment=require(_0xdd45('0x2'));var BPromise=require('bluebird');var rp=require(_0xdd45('0x3'));var fs=require('fs');var path=require(_0xdd45('0x4'));var rimraf=require(_0xdd45('0x5'));var config=require(_0xdd45('0x6'));var attributes=require(_0xdd45('0x7'));module[_0xdd45('0x8')]=function(_0x84edfb,_0x4c6d23){return _0x84edfb['define'](_0xdd45('0x9'),attributes,{'tableName':_0xdd45('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 f1b024b..c3e0531 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 _0x400c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x400c,0x94));var _0xc400=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x400c[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xc400('0x0'));var util=require('util');var moment=require(_0xc400('0x1'));var BPromise=require(_0xc400('0x2'));var rs=require(_0xc400('0x3'));var fs=require('fs');var Redis=require(_0xc400('0x4'));var db=require(_0xc400('0x5'))['db'];var utils=require(_0xc400('0x6'));var logger=require(_0xc400('0x7'))(_0xc400('0x8'));var config=require(_0xc400('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc400('0xa')][_0xc400('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb05be8,_0x2bdabb,_0x565fff){return new BPromise(function(_0x301b30,_0x41040c){return client[_0xc400('0xc')](_0xb05be8,_0x565fff)[_0xc400('0xd')](function(_0x49c0bb){logger[_0xc400('0xe')](_0xc400('0xf'),_0x2bdabb,'request\x20sent');logger[_0xc400('0x10')](_0xc400('0x11'),_0x2bdabb,'request\x20sent',JSON[_0xc400('0x12')](_0x49c0bb));if(_0x49c0bb[_0xc400('0x13')]){if(_0x49c0bb[_0xc400('0x13')][_0xc400('0x14')]===0x1f4){logger[_0xc400('0x13')]('Condition,\x20%s,\x20%s',_0x2bdabb,_0x49c0bb[_0xc400('0x13')]['message']);return _0x41040c(_0x49c0bb[_0xc400('0x13')][_0xc400('0x15')]);}logger[_0xc400('0x13')](_0xc400('0xf'),_0x2bdabb,_0x49c0bb[_0xc400('0x13')][_0xc400('0x15')]);return _0x301b30(_0x49c0bb[_0xc400('0x13')]['message']);}else{logger[_0xc400('0xe')](_0xc400('0xf'),_0x2bdabb,_0xc400('0x16'));_0x301b30(_0x49c0bb[_0xc400('0x17')][_0xc400('0x15')]);}})[_0xc400('0x18')](function(_0x354b66){logger[_0xc400('0x13')]('Condition,\x20%s,\x20%s',_0x2bdabb,_0x354b66);_0x41040c(_0x354b66);});});} \ No newline at end of file +var _0x1653=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x43e19a,_0x3127f2){var _0x35099e=function(_0x3bbc47){while(--_0x3bbc47){_0x43e19a['push'](_0x43e19a['shift']());}};_0x35099e(++_0x3127f2);}(_0x1653,0x17a));var _0x3165=function(_0x20e5c3,_0x41470c){_0x20e5c3=_0x20e5c3-0x0;var _0x401520=_0x1653[_0x20e5c3];return _0x401520;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3165('0x0'));var BPromise=require('bluebird');var rs=require(_0x3165('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3165('0x2'))['db'];var utils=require(_0x3165('0x3'));var logger=require(_0x3165('0x4'))(_0x3165('0x5'));var config=require(_0x3165('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3165('0x7')][_0x3165('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3da8c0,_0x34f566,_0x48621d){return new BPromise(function(_0x193fb6,_0x250c48){return client[_0x3165('0x9')](_0x3da8c0,_0x48621d)[_0x3165('0xa')](function(_0xbc570b){logger['info'](_0x3165('0xb'),_0x34f566,_0x3165('0xc'));logger['debug'](_0x3165('0xd'),_0x34f566,_0x3165('0xc'),JSON[_0x3165('0xe')](_0xbc570b));if(_0xbc570b['error']){if(_0xbc570b[_0x3165('0xf')][_0x3165('0x10')]===0x1f4){logger[_0x3165('0xf')](_0x3165('0xb'),_0x34f566,_0xbc570b[_0x3165('0xf')]['message']);return _0x250c48(_0xbc570b[_0x3165('0xf')][_0x3165('0x11')]);}logger[_0x3165('0xf')](_0x3165('0xb'),_0x34f566,_0xbc570b['error'][_0x3165('0x11')]);return _0x193fb6(_0xbc570b[_0x3165('0xf')][_0x3165('0x11')]);}else{logger[_0x3165('0x12')](_0x3165('0xb'),_0x34f566,_0x3165('0xc'));_0x193fb6(_0xbc570b[_0x3165('0x13')][_0x3165('0x11')]);}})[_0x3165('0x14')](function(_0x2d7849){logger['error']('Condition,\x20%s,\x20%s',_0x34f566,_0x2d7849);_0x250c48(_0x2d7849);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 70882bb..2797473 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 _0x72f8=['path','connect-timeout','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','util'];(function(_0x1c1509,_0x2dfa81){var _0xf11b7=function(_0x17949e){while(--_0x17949e){_0x1c1509['push'](_0x1c1509['shift']());}};_0xf11b7(++_0x2dfa81);}(_0x72f8,0x107));var _0x872f=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0x72f8[_0x47242d];return _0x30273a;};'use strict';var multer=require('multer');var util=require(_0x872f('0x0'));var path=require(_0x872f('0x1'));var timeout=require(_0x872f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x872f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x872f('0x4'));var controller=require(_0x872f('0x5'));router[_0x872f('0x6')](_0x872f('0x7'),auth[_0x872f('0x8')](),controller[_0x872f('0x9')]);router[_0x872f('0xa')](_0x872f('0x7'),auth[_0x872f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd2e0=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./condition.controller','update','delete','/:id','isAuthenticated','destroy','exports','multer'];(function(_0x1fd450,_0x42cbf6){var _0x4cb0a5=function(_0x1384d4){while(--_0x1384d4){_0x1fd450['push'](_0x1fd450['shift']());}};_0x4cb0a5(++_0x42cbf6);}(_0xd2e0,0xe0));var _0x0d2e=function(_0x3e465b,_0x3ac185){_0x3e465b=_0x3e465b-0x0;var _0x277d88=_0xd2e0[_0x3e465b];return _0x277d88;};'use strict';var multer=require(_0x0d2e('0x0'));var util=require(_0x0d2e('0x1'));var path=require(_0x0d2e('0x2'));var timeout=require(_0x0d2e('0x3'));var express=require(_0x0d2e('0x4'));var router=express[_0x0d2e('0x5')]();var fs_extra=require(_0x0d2e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0d2e('0x7'));var config=require('../../config/environment');var controller=require(_0x0d2e('0x8'));router['put']('/:id',auth['isAuthenticated'](),controller[_0x0d2e('0x9')]);router[_0x0d2e('0xa')](_0x0d2e('0xb'),auth[_0x0d2e('0xc')](),controller[_0x0d2e('0xd')]);module[_0x0d2e('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 6abf562..1c39296 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 _0x0713=['STRING','name'];(function(_0x5a06a7,_0x502a10){var _0x54c123=function(_0x2ebcb3){while(--_0x2ebcb3){_0x5a06a7['push'](_0x5a06a7['shift']());}};_0x54c123(++_0x502a10);}(_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 _0xb7e7=['STRING','sequelize'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xb7e7[_0x38ced4];return _0x547c07;};'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 4db76cc..36c1a96 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 _0x238a=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','then','UserProfileResource','destroy','end','error','stack','name','send','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','CustomDashboards','UserProfileSection','update','iframe','attrUrl','attrs','value','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','length','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x22cc9a,_0xda386f){var _0x1d98d3=function(_0x560ed6){while(--_0x560ed6){_0x22cc9a['push'](_0x22cc9a['shift']());}};_0x1d98d3(++_0xda386f);}(_0x238a,0x71));var _0xa238=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0x238a[_0x289e64];return _0x30246c;};'use strict';var emlformat=require(_0xa238('0x0'));var rimraf=require(_0xa238('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa238('0x2'));var rp=require(_0xa238('0x3'));var moment=require(_0xa238('0x4'));var BPromise=require(_0xa238('0x5'));var Mustache=require(_0xa238('0x6'));var util=require(_0xa238('0x7'));var path=require('path');var sox=require(_0xa238('0x8'));var csv=require(_0xa238('0x9'));var ejs=require(_0xa238('0xa'));var fs=require('fs');var fs_extra=require(_0xa238('0xb'));var _=require(_0xa238('0xc'));var squel=require(_0xa238('0xd'));var crypto=require(_0xa238('0xe'));var jsforce=require(_0xa238('0xf'));var deskjs=require(_0xa238('0x10'));var toCsv=require(_0xa238('0x9'));var querystring=require(_0xa238('0x11'));var Papa=require(_0xa238('0x12'));var Redis=require(_0xa238('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa238('0x14'));var hardwareService=require(_0xa238('0x15'));var logger=require('../../config/logger')(_0xa238('0x16'));var utils=require(_0xa238('0x17'));var config=require(_0xa238('0x18'));var licenseUtil=require(_0xa238('0x19'));var db=require('../../mysqldb')['db'];config[_0xa238('0x1a')]=_[_0xa238('0x1b')](config[_0xa238('0x1a')],{'host':_0xa238('0x1c'),'port':0x18eb});var socket=require(_0xa238('0x1d'))(new Redis(config['redis']));require('./dashboard.socket')[_0xa238('0x1e')](socket);function respondWithStatusCode(_0x4edf95,_0x2fcb0d){_0x2fcb0d=_0x2fcb0d||0xcc;return function(_0x534420){if(_0x534420){return _0x4edf95[_0xa238('0x1f')](_0x2fcb0d);}return _0x4edf95[_0xa238('0x20')](_0x2fcb0d)['end']();};}function respondWithResult(_0x58a38f,_0x21a7fd){_0x21a7fd=_0x21a7fd||0xc8;return function(_0x1fa94c){if(_0x1fa94c){return _0x58a38f[_0xa238('0x20')](_0x21a7fd)[_0xa238('0x21')](_0x1fa94c);}};}function respondWithFilteredResult(_0x50fade,_0x4831c8){return function(_0x3564c1){if(_0x3564c1){var _0x55515b=typeof _0x4831c8[_0xa238('0x22')]===_0xa238('0x23')&&typeof _0x4831c8['limit']===_0xa238('0x23');var _0x324b7b=_0x3564c1['count'];var _0x3ee591=_0x55515b?0x0:_0x4831c8[_0xa238('0x22')];var _0x2bb188=_0x55515b?_0x3564c1[_0xa238('0x24')]:_0x4831c8[_0xa238('0x22')]+_0x4831c8[_0xa238('0x25')];var _0x2a030;if(_0x2bb188>=_0x324b7b){_0x2bb188=_0x324b7b;_0x2a030=0xc8;}else{_0x2a030=0xce;}_0x50fade['status'](_0x2a030);return _0x50fade[_0xa238('0x26')]('Content-Range',_0x3ee591+'-'+_0x2bb188+'/'+_0x324b7b)[_0xa238('0x21')](_0x3564c1);}return null;};}function patchUpdates(_0x43d3bc){return function(_0x849f7f){try{jsonpatch[_0xa238('0x27')](_0x849f7f,_0x43d3bc,!![]);}catch(_0x281179){return BPromise[_0xa238('0x28')](_0x281179);}return _0x849f7f[_0xa238('0x29')]();};}function saveUpdates(_0x12eefa,_0x44969a){return function(_0x2db937){if(_0x2db937){return _0x2db937['update'](_0x12eefa)[_0xa238('0x2a')](function(_0x4016b4){return _0x4016b4;});}return null;};}function removeEntity(_0x285b54,_0x38fa19){return function(_0x5035fd){if(_0x5035fd){return _0x5035fd['destroy']()[_0xa238('0x2a')](function(){var _0x6692d0=_0x5035fd['get']({'plain':!![]});var _0x485020='CustomDashboards';return db[_0xa238('0x2b')][_0xa238('0x2c')]({'where':{'type':_0x485020,'resourceId':_0x6692d0['id']}})['then'](function(){return _0x5035fd;});})[_0xa238('0x2a')](function(){_0x285b54[_0xa238('0x20')](0xcc)[_0xa238('0x2d')]();});}};}function handleEntityNotFound(_0x489d0d,_0x4b0298){return function(_0x33fe3f){if(!_0x33fe3f){_0x489d0d[_0xa238('0x1f')](0x194);}return _0x33fe3f;};}function handleError(_0x5a5966,_0x3b998a){_0x3b998a=_0x3b998a||0x1f4;return function(_0x33a86c){logger[_0xa238('0x2e')](_0x33a86c[_0xa238('0x2f')]);if(_0x33a86c[_0xa238('0x30')]){delete _0x33a86c[_0xa238('0x30')];}_0x5a5966['status'](_0x3b998a)[_0xa238('0x31')](_0x33a86c);};}exports['index']=function(_0x1ca765,_0x35e350){var _0x3fdb22={},_0x3243cf={},_0x3735c2={'count':0x0,'rows':[]};var _0x98c960=_[_0xa238('0x32')](db[_0xa238('0x33')][_0xa238('0x34')],function(_0x1b882c){return{'name':_0x1b882c[_0xa238('0x35')],'type':_0x1b882c[_0xa238('0x36')][_0xa238('0x37')]};});_0x3243cf['model']=_[_0xa238('0x32')](_0x98c960,_0xa238('0x30'));_0x3243cf[_0xa238('0x38')]=_[_0xa238('0x39')](_0x1ca765[_0xa238('0x38')]);_0x3243cf[_0xa238('0x3a')]=_[_0xa238('0x3b')](_0x3243cf[_0xa238('0x3c')],_0x3243cf[_0xa238('0x38')]);_0x3fdb22['attributes']=_[_0xa238('0x3b')](_0x3243cf[_0xa238('0x3c')],qs[_0xa238('0x3d')](_0x1ca765[_0xa238('0x38')]['fields']));_0x3fdb22[_0xa238('0x3e')]=_0x3fdb22[_0xa238('0x3e')]['length']?_0x3fdb22[_0xa238('0x3e')]:_0x3243cf[_0xa238('0x3c')];if(!_0x1ca765[_0xa238('0x38')][_0xa238('0x3f')](_0xa238('0x40'))){_0x3fdb22[_0xa238('0x25')]=qs[_0xa238('0x25')](_0x1ca765[_0xa238('0x38')][_0xa238('0x25')]);_0x3fdb22['offset']=qs[_0xa238('0x22')](_0x1ca765[_0xa238('0x38')][_0xa238('0x22')]);}_0x3fdb22[_0xa238('0x41')]=qs[_0xa238('0x42')](_0x1ca765[_0xa238('0x38')][_0xa238('0x42')]);_0x3fdb22[_0xa238('0x43')]=qs['filters'](_[_0xa238('0x44')](_0x1ca765[_0xa238('0x38')],_0x3243cf[_0xa238('0x3a')]),_0x98c960);if(_0x1ca765[_0xa238('0x38')][_0xa238('0x45')]){_0x3fdb22[_0xa238('0x43')]=_[_0xa238('0x46')](_0x3fdb22['where'],{'$or':_[_0xa238('0x32')](_0x98c960,function(_0x157b97){if(_0x157b97['type']!==_0xa238('0x47')){var _0x26597f={};_0x26597f[_0x157b97[_0xa238('0x30')]]={'$like':'%'+_0x1ca765[_0xa238('0x38')]['filter']+'%'};return _0x26597f;}})});}_0x3fdb22=_[_0xa238('0x46')]({},_0x3fdb22,_0x1ca765[_0xa238('0x48')]);var _0x2c8261={'where':_0x3fdb22[_0xa238('0x43')]};return db[_0xa238('0x33')][_0xa238('0x24')](_0x2c8261)[_0xa238('0x2a')](function(_0x13bd0a){_0x3735c2[_0xa238('0x24')]=_0x13bd0a;if(_0x1ca765[_0xa238('0x38')][_0xa238('0x49')]){_0x3fdb22[_0xa238('0x4a')]=[{'all':!![]}];}return db[_0xa238('0x33')]['findAll'](_0x3fdb22);})[_0xa238('0x2a')](function(_0x4abadd){_0x3735c2[_0xa238('0x4b')]=_0x4abadd;return _0x3735c2;})['then'](respondWithFilteredResult(_0x35e350,_0x3fdb22))[_0xa238('0x4c')](handleError(_0x35e350,null));};exports[_0xa238('0x4d')]=function(_0x2998b5,_0x370daf){var _0x1975a2={'raw':![],'where':{'id':_0x2998b5[_0xa238('0x4e')]['id']}},_0x1a1ee8={};_0x1a1ee8[_0xa238('0x3c')]=_[_0xa238('0x39')](db[_0xa238('0x33')]['rawAttributes']);_0x1a1ee8['query']=_[_0xa238('0x39')](_0x2998b5[_0xa238('0x38')]);_0x1a1ee8['filters']=_['intersection'](_0x1a1ee8['model'],_0x1a1ee8['query']);_0x1975a2[_0xa238('0x3e')]=_[_0xa238('0x3b')](_0x1a1ee8[_0xa238('0x3c')],qs['fields'](_0x2998b5[_0xa238('0x38')][_0xa238('0x3d')]));_0x1975a2[_0xa238('0x3e')]=_0x1975a2['attributes']['length']?_0x1975a2[_0xa238('0x3e')]:_0x1a1ee8[_0xa238('0x3c')];if(_0x2998b5[_0xa238('0x38')][_0xa238('0x49')]){_0x1975a2[_0xa238('0x4a')]=[{'all':!![]}];}_0x1975a2=_[_0xa238('0x46')]({},_0x1975a2,_0x2998b5['options']);return db['Dashboard'][_0xa238('0x4f')](_0x1975a2)[_0xa238('0x2a')](handleEntityNotFound(_0x370daf,null))[_0xa238('0x2a')](respondWithResult(_0x370daf,null))[_0xa238('0x4c')](handleError(_0x370daf,null));};exports[_0xa238('0x50')]=function(_0x57ae15,_0x5cdd4e){return db[_0xa238('0x33')][_0xa238('0x50')](_0x57ae15[_0xa238('0x51')],{})['then'](function(_0x3b3325){var _0x177d39=_0x57ae15[_0xa238('0x52')][_0xa238('0x53')]({'plain':!![]});if(!_0x177d39)throw new Error(_0xa238('0x54'));if(_0x177d39[_0xa238('0x55')]===_0xa238('0x52')){var _0x495cb2=_0x3b3325[_0xa238('0x53')]({'plain':!![]});var _0x257c89='CustomDashboards';return db['UserProfileSection'][_0xa238('0x4f')]({'where':{'name':_0x257c89,'userProfileId':_0x177d39[_0xa238('0x56')]},'raw':!![]})[_0xa238('0x2a')](function(_0x4c38a9){if(_0x4c38a9&&_0x4c38a9[_0xa238('0x57')]===0x0){return db[_0xa238('0x2b')][_0xa238('0x50')]({'name':_0x495cb2['name'],'resourceId':_0x495cb2['id'],'type':_0x4c38a9[_0xa238('0x30')],'sectionId':_0x4c38a9['id']},{})['then'](function(){return _0x3b3325;});}else{return _0x3b3325;}})['catch'](function(_0x292ccd){logger['error'](_0xa238('0x58'),_0x292ccd);throw _0x292ccd;});}return _0x3b3325;})[_0xa238('0x2a')](respondWithResult(_0x5cdd4e,0xc9))[_0xa238('0x4c')](handleError(_0x5cdd4e,null));};exports[_0xa238('0x59')]=function(_0x60ea22,_0x2bef30){var _0x4d085a={'where':{'id':_0x60ea22[_0xa238('0x4e')]['id']}},_0x1bf9e3={};_0x1bf9e3['model']=_[_0xa238('0x39')](db[_0xa238('0x33')]['rawAttributes']);_0x4d085a[_0xa238('0x3e')]=_['intersection'](_0x1bf9e3[_0xa238('0x3c')],qs[_0xa238('0x3d')](_0x60ea22[_0xa238('0x38')][_0xa238('0x3d')]));_0x4d085a['attributes']=_0x4d085a['attributes']['length']?_0x4d085a[_0xa238('0x3e')]:_0x1bf9e3['model'];if(_0x60ea22['query'][_0xa238('0x49')]){_0x4d085a[_0xa238('0x4a')]=[{'all':!![]}];}_0x4d085a=_[_0xa238('0x46')]({},_0x4d085a,_0x60ea22[_0xa238('0x48')]);return db[_0xa238('0x33')]['find'](_0x4d085a)[_0xa238('0x2a')](handleEntityNotFound(_0x2bef30,null))[_0xa238('0x2a')](function(_0x96c56){if(_0x96c56){var _0x2c1edf=_0x96c56[_0xa238('0x53')]({'plain':!![]});_0x2c1edf=qs[_0xa238('0x5a')](_0x2c1edf,['id',_0xa238('0x5b'),_0xa238('0x5c')]);_0x60ea22[_0xa238('0x51')]=_[_0xa238('0x5a')](_0x60ea22[_0xa238('0x51')],['id','createdAt',_0xa238('0x5c')]);return db['Dashboard'][_0xa238('0x50')](_['merge'](_0x2c1edf,_0x60ea22['body']),{'include':_0x60ea22[_0xa238('0x38')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x5e745d){var _0x3fe8de=_0x60ea22['user'][_0xa238('0x53')]({'plain':!![]});if(!_0x3fe8de)throw new Error(_0xa238('0x54'));if(_0x3fe8de[_0xa238('0x55')]===_0xa238('0x52')){var _0x18010c=_0x5e745d[_0xa238('0x53')]({'plain':!![]});var _0x170d4b=_0xa238('0x5d');return db[_0xa238('0x5e')][_0xa238('0x4f')]({'where':{'name':_0x170d4b,'userProfileId':_0x3fe8de['userProfileId']},'raw':!![]})[_0xa238('0x2a')](function(_0x32529f){if(_0x32529f&&_0x32529f[_0xa238('0x57')]===0x0){return db[_0xa238('0x2b')][_0xa238('0x50')]({'name':_0x18010c[_0xa238('0x30')],'resourceId':_0x18010c['id'],'type':_0x32529f[_0xa238('0x30')],'sectionId':_0x32529f['id']},{})[_0xa238('0x2a')](function(){return _0x5e745d;});}else{return _0x5e745d;}})[_0xa238('0x4c')](function(_0x4cd2d9){logger[_0xa238('0x2e')](_0xa238('0x58'),_0x4cd2d9);throw _0x4cd2d9;});}return _0x5e745d;});}})[_0xa238('0x2a')](respondWithResult(_0x2bef30,0xc9))[_0xa238('0x4c')](handleError(_0x2bef30,null));};exports[_0xa238('0x5f')]=function(_0x1b33fa,_0x338cfd){if(_0x1b33fa['body']['id']){delete _0x1b33fa[_0xa238('0x51')]['id'];}return db[_0xa238('0x33')][_0xa238('0x4f')]({'where':{'id':_0x1b33fa['params']['id']}})[_0xa238('0x2a')](handleEntityNotFound(_0x338cfd,null))[_0xa238('0x2a')](saveUpdates(_0x1b33fa[_0xa238('0x51')],null))[_0xa238('0x2a')](respondWithResult(_0x338cfd,null))[_0xa238('0x4c')](handleError(_0x338cfd,null));};exports[_0xa238('0x2c')]=function(_0x4ac5f3,_0x144fba){return db['Dashboard'][_0xa238('0x4f')]({'where':{'id':_0x4ac5f3['params']['id']}})[_0xa238('0x2a')](handleEntityNotFound(_0x144fba,null))[_0xa238('0x2a')](removeEntity(_0x144fba,null))[_0xa238('0x4c')](handleError(_0x144fba,null));};function widgetAttributes(_0x4fc026){try{switch(_0x4fc026[_0xa238('0x36')]){case _0xa238('0x60'):return[{'name':_0xa238('0x61'),'value':_0x4fc026[_0xa238('0x61')]||(_0x4fc026[_0xa238('0x62')]&&_0x4fc026['attrs'][0x0]?_0x4fc026[_0xa238('0x62')][0x0][_0xa238('0x63')]:undefined)||'https://'}];case _0xa238('0x64'):return[{'name':'attrPath','value':_0x4fc026['attrPath']||(_0x4fc026[_0xa238('0x62')]&&_0x4fc026[_0xa238('0x62')][0x0]?_0x4fc026[_0xa238('0x62')][0x0][_0xa238('0x63')]:undefined)||''}];case _0xa238('0x65'):return[{'name':'attrHourFormat','value':_0x4fc026[_0xa238('0x66')]||(_0x4fc026['attrs']&&_0x4fc026[_0xa238('0x62')][0x0]?_0x4fc026[_0xa238('0x62')][0x0][_0xa238('0x63')]:undefined)||_0xa238('0x67')},{'name':'attrTimezone','value':_0x4fc026[_0xa238('0x68')]||(_0x4fc026['attrs']&&_0x4fc026[_0xa238('0x62')][0x1]?_0x4fc026['attrs'][0x1][_0xa238('0x63')]:undefined)||_0xa238('0x69')},{'name':_0xa238('0x6a'),'value':_0x4fc026[_0xa238('0x6a')]||(_0x4fc026['attrs']&&_0x4fc026[_0xa238('0x62')][0x2]?_0x4fc026[_0xa238('0x62')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xa238('0x6b'),'value':_0x4fc026[_0xa238('0x6b')]||(_0x4fc026['attrs']&&_0x4fc026[_0xa238('0x62')][0x0]?_0x4fc026[_0xa238('0x62')][0x0][_0xa238('0x63')]:undefined)||_0xa238('0x6c')},{'name':_0xa238('0x6d'),'value':_0x4fc026['attrVoiceQueues']||(_0x4fc026['attrs']&&_0x4fc026[_0xa238('0x62')][0x1]?_0x4fc026[_0xa238('0x62')][0x1][_0xa238('0x63')]:undefined)||[]},{'name':'attrFontSize','value':_0x4fc026[_0xa238('0x6a')]||(_0x4fc026[_0xa238('0x62')]&&_0x4fc026['attrs'][0x2]?_0x4fc026[_0xa238('0x62')][0x2][_0xa238('0x63')]:undefined)||0x14}];case _0xa238('0x6e'):case'pie-chart':return[{'name':_0xa238('0x6f'),'value':_0x4fc026['attrSerie1']||(_0x4fc026['attrs']&&_0x4fc026[_0xa238('0x62')][0x0]?_0x4fc026[_0xa238('0x62')][0x0][_0xa238('0x63')]:undefined)||_0xa238('0x6c')},{'name':_0xa238('0x70'),'value':_0x4fc026[_0xa238('0x70')]||(_0x4fc026[_0xa238('0x62')]&&_0x4fc026['attrs'][0x1]?_0x4fc026[_0xa238('0x62')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x4fc026['attrSerie3']||(_0x4fc026[_0xa238('0x62')]&&_0x4fc026[_0xa238('0x62')][0x2]?_0x4fc026[_0xa238('0x62')][0x2][_0xa238('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4fc026[_0xa238('0x6d')]||(_0x4fc026[_0xa238('0x62')]&&_0x4fc026[_0xa238('0x62')][0x3]?_0x4fc026[_0xa238('0x62')][0x3]['value']:undefined)||[]}];case _0xa238('0x71'):return[{'name':_0xa238('0x72'),'type':_0x4fc026[_0xa238('0x73')]||(_0x4fc026[_0xa238('0x62')]&&_0x4fc026['attrs'][0x0]?_0x4fc026[_0xa238('0x62')][0x0][_0xa238('0x36')]:undefined)||null,'value':_0x4fc026[_0xa238('0x72')]||(_0x4fc026[_0xa238('0x62')]&&_0x4fc026[_0xa238('0x62')][0x0]?_0x4fc026[_0xa238('0x62')][0x0][_0xa238('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x4fc026[_0xa238('0x74')]||(_0x4fc026[_0xa238('0x62')]&&_0x4fc026[_0xa238('0x62')][0x1]?_0x4fc026[_0xa238('0x62')][0x1][_0xa238('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x5bff24){logger[_0xa238('0x2e')](_0xa238('0x75'),JSON[_0xa238('0x76')](_0x5bff24));return[];}}exports[_0xa238('0x77')]=function(_0x383878,_0x557648,_0x5ed818){if(_0x383878[_0xa238('0x51')]['id']){delete _0x383878[_0xa238('0x51')]['id'];}return db[_0xa238('0x33')][_0xa238('0x4f')]({'where':{'id':_0x383878['params']['id']}})[_0xa238('0x2a')](handleEntityNotFound(_0x557648,null))[_0xa238('0x2a')](function(_0x5b737c){if(_0x5b737c){_0x383878[_0xa238('0x51')][_0xa238('0x78')]=_0x5b737c['id'];_0x383878[_0xa238('0x51')][_0xa238('0x62')]=widgetAttributes(_0x383878['body']);return db[_0xa238('0x79')][_0xa238('0x50')](_0x383878['body']);}})[_0xa238('0x2a')](respondWithResult(_0x557648,null))[_0xa238('0x4c')](handleError(_0x557648,null));};exports[_0xa238('0x7a')]=function(_0x2918a8,_0x15ac42,_0x5d8ea3){var _0x513eac={};var _0x1c1ca6={};var _0x3a78dd;var _0x256b13;return db['Dashboard']['findOne']({'where':{'id':_0x2918a8[_0xa238('0x4e')]['id']}})['then'](handleEntityNotFound(_0x15ac42,null))[_0xa238('0x2a')](function(_0x16ef08){if(_0x16ef08){_0x3a78dd=_0x16ef08;_0x1c1ca6['model']=_[_0xa238('0x39')](db[_0xa238('0x79')][_0xa238('0x34')]);_0x1c1ca6[_0xa238('0x38')]=_[_0xa238('0x39')](_0x2918a8['query']);_0x1c1ca6['filters']=_[_0xa238('0x3b')](_0x1c1ca6[_0xa238('0x3c')],_0x1c1ca6[_0xa238('0x38')]);_0x513eac[_0xa238('0x3e')]=_['intersection'](_0x1c1ca6['model'],qs['fields'](_0x2918a8[_0xa238('0x38')][_0xa238('0x3d')]));_0x513eac[_0xa238('0x3e')]=_0x513eac[_0xa238('0x3e')][_0xa238('0x7b')]?_0x513eac[_0xa238('0x3e')]:_0x1c1ca6[_0xa238('0x3c')];_0x513eac[_0xa238('0x41')]=qs[_0xa238('0x42')](_0x2918a8[_0xa238('0x38')]['sort']);_0x513eac[_0xa238('0x43')]=qs['filters'](_[_0xa238('0x44')](_0x2918a8[_0xa238('0x38')],_0x1c1ca6[_0xa238('0x3a')]));if(_0x2918a8[_0xa238('0x38')][_0xa238('0x45')]){_0x513eac[_0xa238('0x43')]=_[_0xa238('0x46')](_0x513eac[_0xa238('0x43')],{'$or':_[_0xa238('0x32')](_0x513eac['attributes'],function(_0x567a67){var _0x345003={};_0x345003[_0x567a67]={'$like':'%'+_0x2918a8[_0xa238('0x38')][_0xa238('0x45')]+'%'};return _0x345003;})});}_0x513eac=_['merge']({},_0x513eac,_0x2918a8['options']);return _0x3a78dd['getItems'](_0x513eac);}})[_0xa238('0x2a')](function(_0x515e33){if(_0x515e33){_0x256b13=_0x515e33[_0xa238('0x7b')];if(!_0x2918a8[_0xa238('0x38')][_0xa238('0x3f')]('nolimit')){_0x513eac[_0xa238('0x25')]=qs['limit'](_0x2918a8['query'][_0xa238('0x25')]);_0x513eac['offset']=qs[_0xa238('0x22')](_0x2918a8[_0xa238('0x38')][_0xa238('0x22')]);}return _0x3a78dd['getItems'](_0x513eac);}})[_0xa238('0x2a')](function(_0x15ea8d){if(_0x15ea8d){return _0x15ea8d?{'count':_0x256b13,'rows':_0x15ea8d}:null;}})[_0xa238('0x2a')](respondWithResult(_0x15ac42,null))[_0xa238('0x4c')](handleError(_0x15ac42,null));}; \ No newline at end of file +var _0x6457=['../../config/license/util','../../mysqldb','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','merge','VIRTUAL','filter','Dashboard','includeAll','include','rows','show','params','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','clone','omit','createdAt','updatedAt','body','autoAssociation','error','iframe','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','sort','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment'];(function(_0x3b4b20,_0x247cdf){var _0x25bb98=function(_0x1424b1){while(--_0x1424b1){_0x3b4b20['push'](_0x3b4b20['shift']());}};_0x25bb98(++_0x247cdf);}(_0x6457,0x67));var _0x7645=function(_0x5d16cc,_0x5c3690){_0x5d16cc=_0x5d16cc-0x0;var _0x131784=_0x6457[_0x5d16cc];return _0x131784;};'use strict';var emlformat=require(_0x7645('0x0'));var rimraf=require(_0x7645('0x1'));var zipdir=require(_0x7645('0x2'));var jsonpatch=require(_0x7645('0x3'));var rp=require('request-promise');var moment=require(_0x7645('0x4'));var BPromise=require(_0x7645('0x5'));var Mustache=require(_0x7645('0x6'));var util=require(_0x7645('0x7'));var path=require(_0x7645('0x8'));var sox=require(_0x7645('0x9'));var csv=require(_0x7645('0xa'));var ejs=require(_0x7645('0xb'));var fs=require('fs');var fs_extra=require(_0x7645('0xc'));var _=require(_0x7645('0xd'));var squel=require(_0x7645('0xe'));var crypto=require(_0x7645('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7645('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7645('0x11'));var Papa=require(_0x7645('0x12'));var Redis=require('ioredis');var authService=require(_0x7645('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7645('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7645('0x15'));var utils=require('../../config/utils');var config=require(_0x7645('0x16'));var licenseUtil=require(_0x7645('0x17'));var db=require(_0x7645('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7645('0x19'),'port':0x18eb});var socket=require(_0x7645('0x1a'))(new Redis(config['redis']));require('./dashboard.socket')[_0x7645('0x1b')](socket);function respondWithStatusCode(_0x578da9,_0x552658){_0x552658=_0x552658||0xcc;return function(_0x25fb68){if(_0x25fb68){return _0x578da9[_0x7645('0x1c')](_0x552658);}return _0x578da9['status'](_0x552658)[_0x7645('0x1d')]();};}function respondWithResult(_0x1bfee8,_0x44b19a){_0x44b19a=_0x44b19a||0xc8;return function(_0x38d9be){if(_0x38d9be){return _0x1bfee8[_0x7645('0x1e')](_0x44b19a)[_0x7645('0x1f')](_0x38d9be);}};}function respondWithFilteredResult(_0x45b478,_0x434c6e){return function(_0x3945b6){if(_0x3945b6){var _0x15733c=typeof _0x434c6e[_0x7645('0x20')]===_0x7645('0x21')&&typeof _0x434c6e[_0x7645('0x22')]===_0x7645('0x21');var _0x5b11a0=_0x3945b6[_0x7645('0x23')];var _0xab8e=_0x15733c?0x0:_0x434c6e[_0x7645('0x20')];var _0x23bbcc=_0x15733c?_0x3945b6[_0x7645('0x23')]:_0x434c6e[_0x7645('0x20')]+_0x434c6e['limit'];var _0x507311;if(_0x23bbcc>=_0x5b11a0){_0x23bbcc=_0x5b11a0;_0x507311=0xc8;}else{_0x507311=0xce;}_0x45b478[_0x7645('0x1e')](_0x507311);return _0x45b478[_0x7645('0x24')](_0x7645('0x25'),_0xab8e+'-'+_0x23bbcc+'/'+_0x5b11a0)[_0x7645('0x1f')](_0x3945b6);}return null;};}function patchUpdates(_0x27464e){return function(_0x45fd35){try{jsonpatch[_0x7645('0x26')](_0x45fd35,_0x27464e,!![]);}catch(_0x3e28d1){return BPromise[_0x7645('0x27')](_0x3e28d1);}return _0x45fd35[_0x7645('0x28')]();};}function saveUpdates(_0x16a101,_0x135d2e){return function(_0x4099da){if(_0x4099da){return _0x4099da[_0x7645('0x29')](_0x16a101)[_0x7645('0x2a')](function(_0x47ed43){return _0x47ed43;});}return null;};}function removeEntity(_0x525da5,_0x208d48){return function(_0x15b07d){if(_0x15b07d){return _0x15b07d['destroy']()['then'](function(){var _0x289377=_0x15b07d[_0x7645('0x2b')]({'plain':!![]});var _0x28d8d2=_0x7645('0x2c');return db[_0x7645('0x2d')][_0x7645('0x2e')]({'where':{'type':_0x28d8d2,'resourceId':_0x289377['id']}})[_0x7645('0x2a')](function(){return _0x15b07d;});})[_0x7645('0x2a')](function(){_0x525da5[_0x7645('0x1e')](0xcc)[_0x7645('0x1d')]();});}};}function handleEntityNotFound(_0x6b0e13,_0x44d604){return function(_0xed9b9e){if(!_0xed9b9e){_0x6b0e13['sendStatus'](0x194);}return _0xed9b9e;};}function handleError(_0x5ca1eb,_0x5c5691){_0x5c5691=_0x5c5691||0x1f4;return function(_0x1f0f17){logger['error'](_0x1f0f17[_0x7645('0x2f')]);if(_0x1f0f17['name']){delete _0x1f0f17[_0x7645('0x30')];}_0x5ca1eb[_0x7645('0x1e')](_0x5c5691)[_0x7645('0x31')](_0x1f0f17);};}exports[_0x7645('0x32')]=function(_0x244fd9,_0x5436dc){var _0x2bc4fd={},_0x1303a3={},_0x5c57f9={'count':0x0,'rows':[]};var _0x255cd4=_[_0x7645('0x33')](db['Dashboard'][_0x7645('0x34')],function(_0x39c6be){return{'name':_0x39c6be[_0x7645('0x35')],'type':_0x39c6be[_0x7645('0x36')][_0x7645('0x37')]};});_0x1303a3[_0x7645('0x38')]=_[_0x7645('0x33')](_0x255cd4,'name');_0x1303a3[_0x7645('0x39')]=_[_0x7645('0x3a')](_0x244fd9[_0x7645('0x39')]);_0x1303a3[_0x7645('0x3b')]=_[_0x7645('0x3c')](_0x1303a3['model'],_0x1303a3[_0x7645('0x39')]);_0x2bc4fd[_0x7645('0x3d')]=_[_0x7645('0x3c')](_0x1303a3['model'],qs[_0x7645('0x3e')](_0x244fd9[_0x7645('0x39')][_0x7645('0x3e')]));_0x2bc4fd[_0x7645('0x3d')]=_0x2bc4fd[_0x7645('0x3d')][_0x7645('0x3f')]?_0x2bc4fd[_0x7645('0x3d')]:_0x1303a3['model'];if(!_0x244fd9[_0x7645('0x39')]['hasOwnProperty'](_0x7645('0x40'))){_0x2bc4fd[_0x7645('0x22')]=qs[_0x7645('0x22')](_0x244fd9['query'][_0x7645('0x22')]);_0x2bc4fd[_0x7645('0x20')]=qs[_0x7645('0x20')](_0x244fd9[_0x7645('0x39')][_0x7645('0x20')]);}_0x2bc4fd[_0x7645('0x41')]=qs['sort'](_0x244fd9[_0x7645('0x39')]['sort']);_0x2bc4fd[_0x7645('0x42')]=qs[_0x7645('0x3b')](_[_0x7645('0x43')](_0x244fd9[_0x7645('0x39')],_0x1303a3[_0x7645('0x3b')]),_0x255cd4);if(_0x244fd9['query']['filter']){_0x2bc4fd[_0x7645('0x42')]=_[_0x7645('0x44')](_0x2bc4fd[_0x7645('0x42')],{'$or':_['map'](_0x255cd4,function(_0xb6615){if(_0xb6615['type']!==_0x7645('0x45')){var _0x56ae03={};_0x56ae03[_0xb6615[_0x7645('0x30')]]={'$like':'%'+_0x244fd9[_0x7645('0x39')][_0x7645('0x46')]+'%'};return _0x56ae03;}})});}_0x2bc4fd=_[_0x7645('0x44')]({},_0x2bc4fd,_0x244fd9['options']);var _0x4c7747={'where':_0x2bc4fd[_0x7645('0x42')]};return db[_0x7645('0x47')][_0x7645('0x23')](_0x4c7747)[_0x7645('0x2a')](function(_0x52c4f5){_0x5c57f9[_0x7645('0x23')]=_0x52c4f5;if(_0x244fd9[_0x7645('0x39')][_0x7645('0x48')]){_0x2bc4fd[_0x7645('0x49')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x2bc4fd);})[_0x7645('0x2a')](function(_0xab683){_0x5c57f9[_0x7645('0x4a')]=_0xab683;return _0x5c57f9;})['then'](respondWithFilteredResult(_0x5436dc,_0x2bc4fd))['catch'](handleError(_0x5436dc,null));};exports[_0x7645('0x4b')]=function(_0x4ee828,_0x57bf2c){var _0x91764={'raw':![],'where':{'id':_0x4ee828[_0x7645('0x4c')]['id']}},_0x136ab1={};_0x136ab1['model']=_[_0x7645('0x3a')](db[_0x7645('0x47')][_0x7645('0x34')]);_0x136ab1[_0x7645('0x39')]=_[_0x7645('0x3a')](_0x4ee828[_0x7645('0x39')]);_0x136ab1[_0x7645('0x3b')]=_[_0x7645('0x3c')](_0x136ab1['model'],_0x136ab1[_0x7645('0x39')]);_0x91764[_0x7645('0x3d')]=_[_0x7645('0x3c')](_0x136ab1['model'],qs[_0x7645('0x3e')](_0x4ee828[_0x7645('0x39')][_0x7645('0x3e')]));_0x91764['attributes']=_0x91764[_0x7645('0x3d')]['length']?_0x91764[_0x7645('0x3d')]:_0x136ab1['model'];if(_0x4ee828['query'][_0x7645('0x48')]){_0x91764[_0x7645('0x49')]=[{'all':!![]}];}_0x91764=_[_0x7645('0x44')]({},_0x91764,_0x4ee828[_0x7645('0x4d')]);return db['Dashboard'][_0x7645('0x4e')](_0x91764)['then'](handleEntityNotFound(_0x57bf2c,null))['then'](respondWithResult(_0x57bf2c,null))[_0x7645('0x4f')](handleError(_0x57bf2c,null));};exports[_0x7645('0x50')]=function(_0x575054,_0x5f9810){return db[_0x7645('0x47')]['create'](_0x575054['body'],{})['then'](function(_0x5ece36){var _0xf6b98f=_0x575054[_0x7645('0x51')]['get']({'plain':!![]});if(!_0xf6b98f)throw new Error(_0x7645('0x52'));if(_0xf6b98f[_0x7645('0x53')]===_0x7645('0x51')){var _0x1fec9e=_0x5ece36[_0x7645('0x2b')]({'plain':!![]});var _0x4e0b69=_0x7645('0x2c');return db[_0x7645('0x54')][_0x7645('0x4e')]({'where':{'name':_0x4e0b69,'userProfileId':_0xf6b98f[_0x7645('0x55')]},'raw':!![]})[_0x7645('0x2a')](function(_0x2c0c9a){if(_0x2c0c9a&&_0x2c0c9a['autoAssociation']===0x0){return db[_0x7645('0x2d')][_0x7645('0x50')]({'name':_0x1fec9e[_0x7645('0x30')],'resourceId':_0x1fec9e['id'],'type':_0x2c0c9a[_0x7645('0x30')],'sectionId':_0x2c0c9a['id']},{})[_0x7645('0x2a')](function(){return _0x5ece36;});}else{return _0x5ece36;}})[_0x7645('0x4f')](function(_0x80a9bf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x80a9bf);throw _0x80a9bf;});}return _0x5ece36;})[_0x7645('0x2a')](respondWithResult(_0x5f9810,0xc9))['catch'](handleError(_0x5f9810,null));};exports[_0x7645('0x56')]=function(_0x460690,_0x167adb){var _0x2a57d4={'where':{'id':_0x460690['params']['id']}},_0x54f89c={};_0x54f89c['model']=_[_0x7645('0x3a')](db[_0x7645('0x47')][_0x7645('0x34')]);_0x2a57d4[_0x7645('0x3d')]=_[_0x7645('0x3c')](_0x54f89c[_0x7645('0x38')],qs['fields'](_0x460690[_0x7645('0x39')][_0x7645('0x3e')]));_0x2a57d4[_0x7645('0x3d')]=_0x2a57d4['attributes']['length']?_0x2a57d4[_0x7645('0x3d')]:_0x54f89c[_0x7645('0x38')];if(_0x460690[_0x7645('0x39')][_0x7645('0x48')]){_0x2a57d4[_0x7645('0x49')]=[{'all':!![]}];}_0x2a57d4=_[_0x7645('0x44')]({},_0x2a57d4,_0x460690[_0x7645('0x4d')]);return db['Dashboard'][_0x7645('0x4e')](_0x2a57d4)['then'](handleEntityNotFound(_0x167adb,null))[_0x7645('0x2a')](function(_0x831503){if(_0x831503){var _0x58c165=_0x831503[_0x7645('0x2b')]({'plain':!![]});_0x58c165=qs[_0x7645('0x57')](_0x58c165,['id',_0x7645('0x58'),_0x7645('0x59')]);_0x460690[_0x7645('0x5a')]=_[_0x7645('0x57')](_0x460690[_0x7645('0x5a')],['id',_0x7645('0x58'),_0x7645('0x59')]);return db[_0x7645('0x47')]['create'](_[_0x7645('0x44')](_0x58c165,_0x460690[_0x7645('0x5a')]),{'include':_0x460690['query'][_0x7645('0x48')]?[{'all':!![]}]:undefined})[_0x7645('0x2a')](function(_0x4a4e70){var _0x16fd06=_0x460690[_0x7645('0x51')][_0x7645('0x2b')]({'plain':!![]});if(!_0x16fd06)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16fd06[_0x7645('0x53')]==='user'){var _0x5935f2=_0x4a4e70[_0x7645('0x2b')]({'plain':!![]});var _0x2c7b71=_0x7645('0x2c');return db[_0x7645('0x54')][_0x7645('0x4e')]({'where':{'name':_0x2c7b71,'userProfileId':_0x16fd06[_0x7645('0x55')]},'raw':!![]})['then'](function(_0x2aa6e0){if(_0x2aa6e0&&_0x2aa6e0[_0x7645('0x5b')]===0x0){return db[_0x7645('0x2d')][_0x7645('0x50')]({'name':_0x5935f2['name'],'resourceId':_0x5935f2['id'],'type':_0x2aa6e0[_0x7645('0x30')],'sectionId':_0x2aa6e0['id']},{})[_0x7645('0x2a')](function(){return _0x4a4e70;});}else{return _0x4a4e70;}})['catch'](function(_0x94f8ff){logger[_0x7645('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x94f8ff);throw _0x94f8ff;});}return _0x4a4e70;});}})[_0x7645('0x2a')](respondWithResult(_0x167adb,0xc9))[_0x7645('0x4f')](handleError(_0x167adb,null));};exports['update']=function(_0x303103,_0x44bd97){if(_0x303103[_0x7645('0x5a')]['id']){delete _0x303103['body']['id'];}return db[_0x7645('0x47')][_0x7645('0x4e')]({'where':{'id':_0x303103[_0x7645('0x4c')]['id']}})[_0x7645('0x2a')](handleEntityNotFound(_0x44bd97,null))[_0x7645('0x2a')](saveUpdates(_0x303103[_0x7645('0x5a')],null))[_0x7645('0x2a')](respondWithResult(_0x44bd97,null))[_0x7645('0x4f')](handleError(_0x44bd97,null));};exports[_0x7645('0x2e')]=function(_0x3ae3bc,_0x4250ed){return db['Dashboard']['find']({'where':{'id':_0x3ae3bc[_0x7645('0x4c')]['id']}})[_0x7645('0x2a')](handleEntityNotFound(_0x4250ed,null))[_0x7645('0x2a')](removeEntity(_0x4250ed,null))[_0x7645('0x4f')](handleError(_0x4250ed,null));};function widgetAttributes(_0x206301){try{switch(_0x206301['type']){case _0x7645('0x5d'):return[{'name':'attrUrl','value':_0x206301['attrUrl']||(_0x206301['attrs']&&_0x206301[_0x7645('0x5e')][0x0]?_0x206301[_0x7645('0x5e')][0x0]['value']:undefined)||_0x7645('0x5f')}];case _0x7645('0x60'):return[{'name':'attrPath','value':_0x206301[_0x7645('0x61')]||(_0x206301[_0x7645('0x5e')]&&_0x206301['attrs'][0x0]?_0x206301[_0x7645('0x5e')][0x0][_0x7645('0x62')]:undefined)||''}];case _0x7645('0x63'):return[{'name':_0x7645('0x64'),'value':_0x206301[_0x7645('0x64')]||(_0x206301[_0x7645('0x5e')]&&_0x206301['attrs'][0x0]?_0x206301[_0x7645('0x5e')][0x0]['value']:undefined)||_0x7645('0x65')},{'name':_0x7645('0x66'),'value':_0x206301[_0x7645('0x66')]||(_0x206301['attrs']&&_0x206301[_0x7645('0x5e')][0x1]?_0x206301[_0x7645('0x5e')][0x1][_0x7645('0x62')]:undefined)||_0x7645('0x67')},{'name':_0x7645('0x68'),'value':_0x206301[_0x7645('0x68')]||(_0x206301[_0x7645('0x5e')]&&_0x206301[_0x7645('0x5e')][0x2]?_0x206301[_0x7645('0x5e')][0x2][_0x7645('0x62')]:undefined)||0xc}];case _0x7645('0x69'):return[{'name':'attrMetric','value':_0x206301[_0x7645('0x6a')]||(_0x206301[_0x7645('0x5e')]&&_0x206301['attrs'][0x0]?_0x206301[_0x7645('0x5e')][0x0]['value']:undefined)||'total'},{'name':_0x7645('0x6b'),'value':_0x206301['attrVoiceQueues']||(_0x206301['attrs']&&_0x206301[_0x7645('0x5e')][0x1]?_0x206301[_0x7645('0x5e')][0x1][_0x7645('0x62')]:undefined)||[]},{'name':'attrFontSize','value':_0x206301['attrFontSize']||(_0x206301[_0x7645('0x5e')]&&_0x206301[_0x7645('0x5e')][0x2]?_0x206301[_0x7645('0x5e')][0x2]['value']:undefined)||0x14}];case _0x7645('0x6c'):case _0x7645('0x6d'):return[{'name':_0x7645('0x6e'),'value':_0x206301['attrSerie1']||(_0x206301[_0x7645('0x5e')]&&_0x206301[_0x7645('0x5e')][0x0]?_0x206301['attrs'][0x0][_0x7645('0x62')]:undefined)||_0x7645('0x6f')},{'name':'attrSerie2','value':_0x206301[_0x7645('0x70')]||(_0x206301[_0x7645('0x5e')]&&_0x206301['attrs'][0x1]?_0x206301[_0x7645('0x5e')][0x1][_0x7645('0x62')]:undefined)||null},{'name':'attrSerie3','value':_0x206301[_0x7645('0x71')]||(_0x206301[_0x7645('0x5e')]&&_0x206301[_0x7645('0x5e')][0x2]?_0x206301[_0x7645('0x5e')][0x2]['value']:undefined)||null},{'name':_0x7645('0x6b'),'value':_0x206301[_0x7645('0x6b')]||(_0x206301['attrs']&&_0x206301[_0x7645('0x5e')][0x3]?_0x206301['attrs'][0x3][_0x7645('0x62')]:undefined)||[]}];case _0x7645('0x72'):return[{'name':'attrReport','type':_0x206301[_0x7645('0x73')]||(_0x206301['attrs']&&_0x206301['attrs'][0x0]?_0x206301['attrs'][0x0][_0x7645('0x36')]:undefined)||null,'value':_0x206301[_0x7645('0x74')]||(_0x206301['attrs']&&_0x206301[_0x7645('0x5e')][0x0]?_0x206301[_0x7645('0x5e')][0x0][_0x7645('0x62')]:undefined)||null},{'name':_0x7645('0x75'),'value':_0x206301['attrRefresh']||(_0x206301[_0x7645('0x5e')]&&_0x206301[_0x7645('0x5e')][0x1]?_0x206301['attrs'][0x1][_0x7645('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x437e73){logger[_0x7645('0x5c')](_0x7645('0x76'),JSON[_0x7645('0x77')](_0x437e73));return[];}}exports['addItem']=function(_0x1494e8,_0x54bec4,_0x4888ca){if(_0x1494e8[_0x7645('0x5a')]['id']){delete _0x1494e8[_0x7645('0x5a')]['id'];}return db[_0x7645('0x47')][_0x7645('0x4e')]({'where':{'id':_0x1494e8[_0x7645('0x4c')]['id']}})[_0x7645('0x2a')](handleEntityNotFound(_0x54bec4,null))[_0x7645('0x2a')](function(_0x531b3b){if(_0x531b3b){_0x1494e8[_0x7645('0x5a')][_0x7645('0x78')]=_0x531b3b['id'];_0x1494e8[_0x7645('0x5a')][_0x7645('0x5e')]=widgetAttributes(_0x1494e8['body']);return db[_0x7645('0x79')][_0x7645('0x50')](_0x1494e8[_0x7645('0x5a')]);}})[_0x7645('0x2a')](respondWithResult(_0x54bec4,null))[_0x7645('0x4f')](handleError(_0x54bec4,null));};exports[_0x7645('0x7a')]=function(_0x236bf7,_0x4040e8,_0x280382){var _0x170968={};var _0x10e436={};var _0x4efc3e;var _0x5a4f2c;return db[_0x7645('0x47')][_0x7645('0x7b')]({'where':{'id':_0x236bf7[_0x7645('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4040e8,null))[_0x7645('0x2a')](function(_0x15cbe7){if(_0x15cbe7){_0x4efc3e=_0x15cbe7;_0x10e436['model']=_[_0x7645('0x3a')](db['DashboardItem'][_0x7645('0x34')]);_0x10e436['query']=_['keys'](_0x236bf7[_0x7645('0x39')]);_0x10e436[_0x7645('0x3b')]=_[_0x7645('0x3c')](_0x10e436[_0x7645('0x38')],_0x10e436[_0x7645('0x39')]);_0x170968[_0x7645('0x3d')]=_[_0x7645('0x3c')](_0x10e436[_0x7645('0x38')],qs[_0x7645('0x3e')](_0x236bf7[_0x7645('0x39')][_0x7645('0x3e')]));_0x170968[_0x7645('0x3d')]=_0x170968['attributes']['length']?_0x170968[_0x7645('0x3d')]:_0x10e436[_0x7645('0x38')];_0x170968[_0x7645('0x41')]=qs[_0x7645('0x7c')](_0x236bf7[_0x7645('0x39')][_0x7645('0x7c')]);_0x170968[_0x7645('0x42')]=qs[_0x7645('0x3b')](_[_0x7645('0x43')](_0x236bf7[_0x7645('0x39')],_0x10e436[_0x7645('0x3b')]));if(_0x236bf7[_0x7645('0x39')]['filter']){_0x170968['where']=_[_0x7645('0x44')](_0x170968[_0x7645('0x42')],{'$or':_['map'](_0x170968[_0x7645('0x3d')],function(_0x26d689){var _0x14a355={};_0x14a355[_0x26d689]={'$like':'%'+_0x236bf7[_0x7645('0x39')][_0x7645('0x46')]+'%'};return _0x14a355;})});}_0x170968=_['merge']({},_0x170968,_0x236bf7[_0x7645('0x4d')]);return _0x4efc3e[_0x7645('0x7a')](_0x170968);}})[_0x7645('0x2a')](function(_0x1e9867){if(_0x1e9867){_0x5a4f2c=_0x1e9867[_0x7645('0x3f')];if(!_0x236bf7[_0x7645('0x39')][_0x7645('0x7d')]('nolimit')){_0x170968[_0x7645('0x22')]=qs['limit'](_0x236bf7['query'][_0x7645('0x22')]);_0x170968['offset']=qs[_0x7645('0x20')](_0x236bf7['query']['offset']);}return _0x4efc3e[_0x7645('0x7a')](_0x170968);}})[_0x7645('0x2a')](function(_0x55ef3f){if(_0x55ef3f){return _0x55ef3f?{'count':_0x5a4f2c,'rows':_0x55ef3f}:null;}})[_0x7645('0x2a')](respondWithResult(_0x4040e8,null))[_0x7645('0x4f')](handleError(_0x4040e8,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 96cb8b4..c80cfcd 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 _0x7172=['update','remove','emit','hook','exports','Dashboard','save'];(function(_0x57014b,_0x360c0f){var _0x2b258a=function(_0x52c4a3){while(--_0x52c4a3){_0x57014b['push'](_0x57014b['shift']());}};_0x2b258a(++_0x360c0f);}(_0x7172,0x1ef));var _0x2717=function(_0x4b25bb,_0x2a86e9){_0x4b25bb=_0x4b25bb-0x0;var _0x19c1ba=_0x7172[_0x4b25bb];return _0x19c1ba;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x2717('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2717('0x1'),'afterUpdate':_0x2717('0x2'),'afterDestroy':_0x2717('0x3')};function emitEvent(_0x349ec6){return function(_0x772f4,_0x283b00,_0x2b3c58){DashboardEvents[_0x2717('0x4')](_0x349ec6+':'+_0x772f4['id'],_0x772f4);DashboardEvents[_0x2717('0x4')](_0x349ec6,_0x772f4);_0x2b3c58(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x2717('0x5')](e,emitEvent(event));}}module[_0x2717('0x6')]=DashboardEvents; \ No newline at end of file +var _0x9d67=['update','emit','hook','exports','events','../../mysqldb'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x9d67,0xe8));var _0x79d6=function(_0x5e2191,_0x36a2b4){_0x5e2191=_0x5e2191-0x0;var _0x34265a=_0x9d67[_0x5e2191];return _0x34265a;};'use strict';var EventEmitter=require(_0x79d6('0x0'));var Dashboard=require(_0x79d6('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x79d6('0x2'),'afterDestroy':'remove'};function emitEvent(_0x30879a){return function(_0x10aa4b,_0x3aad68,_0x280061){DashboardEvents[_0x79d6('0x3')](_0x30879a+':'+_0x10aa4b['id'],_0x10aa4b);DashboardEvents[_0x79d6('0x3')](_0x30879a,_0x10aa4b);_0x280061(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x79d6('0x4')](e,emitEvent(event));}}module[_0x79d6('0x5')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 245d664..b531fb6 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 _0x2938=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./dashboard.attributes','define','Dashboard'];(function(_0x36a69c,_0x3d8f2b){var _0x38bc87=function(_0x514aee){while(--_0x514aee){_0x36a69c['push'](_0x36a69c['shift']());}};_0x38bc87(++_0x3d8f2b);}(_0x2938,0xb0));var _0x8293=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2938[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8293('0x0'));var util=require('util');var logger=require(_0x8293('0x1'))(_0x8293('0x2'));var moment=require(_0x8293('0x3'));var BPromise=require(_0x8293('0x4'));var rp=require(_0x8293('0x5'));var fs=require('fs');var path=require(_0x8293('0x6'));var rimraf=require(_0x8293('0x7'));var config=require('../../config/environment');var attributes=require(_0x8293('0x8'));module['exports']=function(_0x37d7a0,_0x3db329){return _0x37d7a0[_0x8293('0x9')](_0x8293('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x132f=['moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash','util','../../config/logger','api'];(function(_0x2a5d41,_0x4ef191){var _0x52e99f=function(_0x2b9ab4){while(--_0x2b9ab4){_0x2a5d41['push'](_0x2a5d41['shift']());}};_0x52e99f(++_0x4ef191);}(_0x132f,0x182));var _0xf132=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x132f[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0xf132('0x0'));var util=require(_0xf132('0x1'));var logger=require(_0xf132('0x2'))(_0xf132('0x3'));var moment=require(_0xf132('0x4'));var BPromise=require(_0xf132('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf132('0x6'));var rimraf=require(_0xf132('0x7'));var config=require(_0xf132('0x8'));var attributes=require(_0xf132('0x9'));module[_0xf132('0xa')]=function(_0x5e0f2b,_0x925b1a){return _0x5e0f2b[_0xf132('0xb')]('Dashboard',attributes,{'tableName':_0xf132('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index add2300..67fd05a 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 _0x2bd9=['lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x2bd9,0x64));var _0x92bd=function(_0x55f20f,_0x5255e6){_0x55f20f=_0x55f20f-0x0;var _0x4cae24=_0x2bd9[_0x55f20f];return _0x4cae24;};'use strict';var _=require(_0x92bd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x92bd('0x1'));var rs=require(_0x92bd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92bd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x92bd('0x4'))(_0x92bd('0x5'));var config=require(_0x92bd('0x6'));var jayson=require(_0x92bd('0x7'));var client=jayson['client'][_0x92bd('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x92bd('0x9'),'port':0x18eb});var socket=require(_0x92bd('0xa'))(new Redis(config[_0x92bd('0xb')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x44bfbf,_0x16d845,_0x2cd9b2){return new BPromise(function(_0x5a1410,_0x2e0fc4){return client[_0x92bd('0xc')](_0x44bfbf,_0x2cd9b2)[_0x92bd('0xd')](function(_0xa2b4e9){logger[_0x92bd('0xe')](_0x92bd('0xf'),_0x16d845,_0x92bd('0x10'));logger[_0x92bd('0x11')](_0x92bd('0x12'),_0x16d845,_0x92bd('0x10'),JSON[_0x92bd('0x13')](_0xa2b4e9));if(_0xa2b4e9[_0x92bd('0x14')]){if(_0xa2b4e9['error'][_0x92bd('0x15')]===0x1f4){logger['error'](_0x92bd('0xf'),_0x16d845,_0xa2b4e9['error'][_0x92bd('0x16')]);return _0x2e0fc4(_0xa2b4e9[_0x92bd('0x14')][_0x92bd('0x16')]);}logger[_0x92bd('0x14')](_0x92bd('0xf'),_0x16d845,_0xa2b4e9[_0x92bd('0x14')][_0x92bd('0x16')]);return _0x5a1410(_0xa2b4e9[_0x92bd('0x14')][_0x92bd('0x16')]);}else{logger[_0x92bd('0xe')](_0x92bd('0xf'),_0x16d845,_0x92bd('0x10'));_0x5a1410(_0xa2b4e9[_0x92bd('0x17')][_0x92bd('0x16')]);}})[_0x92bd('0x18')](function(_0x2fa279){logger['error'](_0x92bd('0xf'),_0x16d845,_0x2fa279);_0x2e0fc4(_0x2fa279);});});} \ No newline at end of file +var _0x01d7=['info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then'];(function(_0x39a3ac,_0x415c6d){var _0x2bc0cc=function(_0x44c5fa){while(--_0x44c5fa){_0x39a3ac['push'](_0x39a3ac['shift']());}};_0x2bc0cc(++_0x415c6d);}(_0x01d7,0x185));var _0x701d=function(_0x4c528e,_0x2bfd9c){_0x4c528e=_0x4c528e-0x0;var _0x4bca5c=_0x01d7[_0x4c528e];return _0x4bca5c;};'use strict';var _=require(_0x701d('0x0'));var util=require(_0x701d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x701d('0x2'));var fs=require('fs');var Redis=require(_0x701d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x701d('0x4'))(_0x701d('0x5'));var config=require('../../config/environment');var jayson=require(_0x701d('0x6'));var client=jayson[_0x701d('0x7')][_0x701d('0x8')]({'port':0x232a});config[_0x701d('0x9')]=_['defaults'](config[_0x701d('0x9')],{'host':_0x701d('0xa'),'port':0x18eb});var socket=require(_0x701d('0xb'))(new Redis(config[_0x701d('0x9')]));require(_0x701d('0xc'))[_0x701d('0xd')](socket);function respondWithRpcPromise(_0x2068f9,_0x65bc09,_0x355a19){return new BPromise(function(_0x43491d,_0x573095){return client[_0x701d('0xe')](_0x2068f9,_0x355a19)[_0x701d('0xf')](function(_0x254abf){logger[_0x701d('0x10')](_0x701d('0x11'),_0x65bc09,_0x701d('0x12'));logger[_0x701d('0x13')](_0x701d('0x14'),_0x65bc09,_0x701d('0x12'),JSON[_0x701d('0x15')](_0x254abf));if(_0x254abf[_0x701d('0x16')]){if(_0x254abf[_0x701d('0x16')][_0x701d('0x17')]===0x1f4){logger['error'](_0x701d('0x11'),_0x65bc09,_0x254abf[_0x701d('0x16')][_0x701d('0x18')]);return _0x573095(_0x254abf['error']['message']);}logger[_0x701d('0x16')](_0x701d('0x11'),_0x65bc09,_0x254abf[_0x701d('0x16')][_0x701d('0x18')]);return _0x43491d(_0x254abf[_0x701d('0x16')][_0x701d('0x18')]);}else{logger[_0x701d('0x10')](_0x701d('0x11'),_0x65bc09,'request\x20sent');_0x43491d(_0x254abf[_0x701d('0x19')][_0x701d('0x18')]);}})[_0x701d('0x1a')](function(_0x302436){logger['error'](_0x701d('0x11'),_0x65bc09,_0x302436);_0x573095(_0x302436);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 4c7a134..c4a5c30 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 _0x5724=['removeListener','register','length','./dashboard.events','remove'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x5724,0x1a7));var _0x4572=function(_0x16c4c4,_0xd3153b){_0x16c4c4=_0x16c4c4-0x0;var _0xd04663=_0x5724[_0x16c4c4];return _0xd04663;};'use strict';var DashboardEvents=require(_0x4572('0x0'));var events=['save',_0x4572('0x1'),'update'];function createListener(_0x8879d0,_0x48bded){return function(_0x324e14){_0x48bded['emit'](_0x8879d0,_0x324e14);};}function removeListener(_0x3ec23d,_0x456442){return function(){DashboardEvents[_0x4572('0x2')](_0x3ec23d,_0x456442);};}exports[_0x4572('0x3')]=function(_0x196665){for(var _0x1f34d7=0x0,_0x3482a8=events[_0x4572('0x4')];_0x1f34d7<_0x3482a8;_0x1f34d7++){var _0x2b26b8=events[_0x1f34d7];var _0x5e1f46=createListener('dashboard:'+_0x2b26b8,_0x196665);DashboardEvents['on'](_0x2b26b8,_0x5e1f46);}}; \ No newline at end of file +var _0x53d2=['update','emit','removeListener','register','length','dashboard:','./dashboard.events','save','remove'];(function(_0x44a22c,_0x586042){var _0x4707dd=function(_0x193e2f){while(--_0x193e2f){_0x44a22c['push'](_0x44a22c['shift']());}};_0x4707dd(++_0x586042);}(_0x53d2,0xba));var _0x253d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d2[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardEvents=require(_0x253d('0x0'));var events=[_0x253d('0x1'),_0x253d('0x2'),_0x253d('0x3')];function createListener(_0xd3b004,_0x43375c){return function(_0x2c491c){_0x43375c[_0x253d('0x4')](_0xd3b004,_0x2c491c);};}function removeListener(_0xbb00f4,_0x4cc6fc){return function(){DashboardEvents[_0x253d('0x5')](_0xbb00f4,_0x4cc6fc);};}exports[_0x253d('0x6')]=function(_0x3db5a6){for(var _0xef546d=0x0,_0x38a38c=events[_0x253d('0x7')];_0xef546d<_0x38a38c;_0xef546d++){var _0x58751d=events[_0xef546d];var _0x10d0d3=createListener(_0x253d('0x8')+_0x58751d,_0x3db5a6);DashboardEvents['on'](_0x58751d,_0x10d0d3);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 6adeb8e..d818c73 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 _0xe721=['show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index'];(function(_0x44e4af,_0xc77cfb){var _0x288203=function(_0x51a210){while(--_0x51a210){_0x44e4af['push'](_0x44e4af['shift']());}};_0x288203(++_0xc77cfb);}(_0xe721,0xe6));var _0x1e72=function(_0x56574a,_0x230873){_0x56574a=_0x56574a-0x0;var _0x3b9fed=_0xe721[_0x56574a];return _0x3b9fed;};'use strict';var multer=require(_0x1e72('0x0'));var util=require(_0x1e72('0x1'));var path=require('path');var timeout=require(_0x1e72('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e72('0x3'));var auth=require(_0x1e72('0x4'));var interaction=require(_0x1e72('0x5'));var config=require('../../config/environment');var controller=require(_0x1e72('0x6'));router[_0x1e72('0x7')]('/',auth[_0x1e72('0x8')](),controller[_0x1e72('0x9')]);router['get']('/:id',auth[_0x1e72('0x8')](),controller[_0x1e72('0xa')]);router['get'](_0x1e72('0xb'),auth[_0x1e72('0x8')](),controller[_0x1e72('0xc')]);router[_0x1e72('0xd')]('/',auth['isAuthenticated'](),controller[_0x1e72('0xe')]);router['post'](_0x1e72('0xf'),auth[_0x1e72('0x8')](),controller[_0x1e72('0x10')]);router[_0x1e72('0xd')](_0x1e72('0xb'),auth[_0x1e72('0x8')](),controller[_0x1e72('0x11')]);router[_0x1e72('0x12')](_0x1e72('0x13'),auth[_0x1e72('0x8')](),controller[_0x1e72('0x14')]);router[_0x1e72('0x15')](_0x1e72('0x13'),auth['isAuthenticated'](),controller[_0x1e72('0x16')]);module[_0x1e72('0x17')]=router; \ No newline at end of file +var _0xba75=['destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','/:id/items','getItems','post','create','/:id/clone','clone','put','update','delete'];(function(_0x48cad7,_0x2e578a){var _0x3e75db=function(_0x4177ed){while(--_0x4177ed){_0x48cad7['push'](_0x48cad7['shift']());}};_0x3e75db(++_0x2e578a);}(_0xba75,0x161));var _0x5ba7=function(_0x4bf0bc,_0x2c6490){_0x4bf0bc=_0x4bf0bc-0x0;var _0x223837=_0xba75[_0x4bf0bc];return _0x223837;};'use strict';var multer=require(_0x5ba7('0x0'));var util=require(_0x5ba7('0x1'));var path=require(_0x5ba7('0x2'));var timeout=require(_0x5ba7('0x3'));var express=require(_0x5ba7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5ba7('0x5'));var config=require(_0x5ba7('0x6'));var controller=require(_0x5ba7('0x7'));router[_0x5ba7('0x8')]('/',auth[_0x5ba7('0x9')](),controller[_0x5ba7('0xa')]);router[_0x5ba7('0x8')](_0x5ba7('0xb'),auth[_0x5ba7('0x9')](),controller['show']);router['get'](_0x5ba7('0xc'),auth[_0x5ba7('0x9')](),controller[_0x5ba7('0xd')]);router[_0x5ba7('0xe')]('/',auth[_0x5ba7('0x9')](),controller[_0x5ba7('0xf')]);router[_0x5ba7('0xe')](_0x5ba7('0x10'),auth[_0x5ba7('0x9')](),controller[_0x5ba7('0x11')]);router['post'](_0x5ba7('0xc'),auth[_0x5ba7('0x9')](),controller['addItem']);router[_0x5ba7('0x12')]('/:id',auth[_0x5ba7('0x9')](),controller[_0x5ba7('0x13')]);router[_0x5ba7('0x14')](_0x5ba7('0xb'),auth[_0x5ba7('0x9')](),controller[_0x5ba7('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index df62bf4..a0eb816 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 _0x687b=['sequelize','squel','lodash','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','STRING','#ffffff','#2196f3'];(function(_0x1f932e,_0x1e623b){var _0x39898e=function(_0x218cd1){while(--_0x218cd1){_0x1f932e['push'](_0x1f932e['shift']());}};_0x39898e(++_0x1e623b);}(_0x687b,0x14a));var _0xb687=function(_0x3a5da5,_0x58eaa0){_0x3a5da5=_0x3a5da5-0x0;var _0x2de0e5=_0x687b[_0x3a5da5];return _0x2de0e5;};'use strict';var Sequelize=require(_0xb687('0x0'));var squel=require(_0xb687('0x1'));var _=require(_0xb687('0x2'));module[_0xb687('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5')),'get':function(){try{return JSON[_0xb687('0x6')](this[_0xb687('0x7')](_0xb687('0x8')));}catch(_0x194c55){return[];}},'set':function(_0x16ccf3){try{this[_0xb687('0x9')](_0xb687('0x8'),JSON[_0xb687('0xa')](_0x16ccf3));}catch(_0x48942b){this[_0xb687('0x9')](_0xb687('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb687('0xb')]},'col':{'type':Sequelize[_0xb687('0xb')]},'background':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb687('0xc')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x187d=['stringify','INTEGER','#ffffff','sequelize','lodash','exports','STRING','TEXT','long','getDataValue','attrs','setDataValue'];(function(_0x420a56,_0x45c974){var _0x19dc8d=function(_0x4027a5){while(--_0x4027a5){_0x420a56['push'](_0x420a56['shift']());}};_0x19dc8d(++_0x45c974);}(_0x187d,0x93));var _0xd187=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x187d[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0xd187('0x0'));var squel=require('squel');var _=require(_0xd187('0x1'));module[_0xd187('0x2')]={'title':{'type':Sequelize[_0xd187('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd187('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xd187('0x4')](_0xd187('0x5')),'get':function(){try{return JSON['parse'](this[_0xd187('0x6')](_0xd187('0x7')));}catch(_0x4ebc8d){return[];}},'set':function(_0x1d2533){try{this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')](_0x1d2533));}catch(_0x28ce2f){this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xd187('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd187('0xa')]},'col':{'type':Sequelize[_0xd187('0xa')]},'background':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':_0xd187('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd187('0x3')]},'titleFontSize':{'type':Sequelize[_0xd187('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 4464c5a..7cdf415 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 _0xc631=['includeAll','include','merge','DashboardItem','catch','find','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','body','create','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','send','show','keys','rawAttributes','query','filters','intersection','model','attributes','fields'];(function(_0x1c5d33,_0x5b1eac){var _0x3d4ac8=function(_0x466221){while(--_0x466221){_0x1c5d33['push'](_0x1c5d33['shift']());}};_0x3d4ac8(++_0x5b1eac);}(_0xc631,0x82));var _0x1c63=function(_0x109c82,_0x3b9af8){_0x109c82=_0x109c82-0x0;var _0x2ee709=_0xc631[_0x109c82];return _0x2ee709;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c63('0x0'));var zipdir=require(_0x1c63('0x1'));var jsonpatch=require(_0x1c63('0x2'));var rp=require(_0x1c63('0x3'));var moment=require(_0x1c63('0x4'));var BPromise=require(_0x1c63('0x5'));var Mustache=require(_0x1c63('0x6'));var util=require(_0x1c63('0x7'));var path=require(_0x1c63('0x8'));var sox=require(_0x1c63('0x9'));var csv=require('to-csv');var ejs=require(_0x1c63('0xa'));var fs=require('fs');var fs_extra=require(_0x1c63('0xb'));var _=require(_0x1c63('0xc'));var squel=require(_0x1c63('0xd'));var crypto=require(_0x1c63('0xe'));var jsforce=require(_0x1c63('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1c63('0x10'));var querystring=require(_0x1c63('0x11'));var Papa=require(_0x1c63('0x12'));var Redis=require(_0x1c63('0x13'));var authService=require(_0x1c63('0x14'));var qs=require(_0x1c63('0x15'));var as=require(_0x1c63('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1c63('0x17'));var utils=require(_0x1c63('0x18'));var config=require(_0x1c63('0x19'));var licenseUtil=require(_0x1c63('0x1a'));var db=require(_0x1c63('0x1b'))['db'];config[_0x1c63('0x1c')]=_[_0x1c63('0x1d')](config[_0x1c63('0x1c')],{'host':_0x1c63('0x1e'),'port':0x18eb});var socket=require(_0x1c63('0x1f'))(new Redis(config['redis']));require(_0x1c63('0x20'))['register'](socket);function respondWithStatusCode(_0x1de79a,_0x1468bd){_0x1468bd=_0x1468bd||0xcc;return function(_0x3f0afd){if(_0x3f0afd){return _0x1de79a[_0x1c63('0x21')](_0x1468bd);}return _0x1de79a[_0x1c63('0x22')](_0x1468bd)[_0x1c63('0x23')]();};}function respondWithResult(_0x131eca,_0x5a852e){_0x5a852e=_0x5a852e||0xc8;return function(_0x518953){if(_0x518953){return _0x131eca[_0x1c63('0x22')](_0x5a852e)[_0x1c63('0x24')](_0x518953);}};}function respondWithFilteredResult(_0x5a6fc1,_0x4d4cc1){return function(_0x645a90){if(_0x645a90){var _0x55a94e=typeof _0x4d4cc1[_0x1c63('0x25')]===_0x1c63('0x26')&&typeof _0x4d4cc1[_0x1c63('0x27')]===_0x1c63('0x26');var _0x45d5cb=_0x645a90[_0x1c63('0x28')];var _0x4d3beb=_0x55a94e?0x0:_0x4d4cc1[_0x1c63('0x25')];var _0x567f90=_0x55a94e?_0x645a90['count']:_0x4d4cc1[_0x1c63('0x25')]+_0x4d4cc1[_0x1c63('0x27')];var _0x3f88e2;if(_0x567f90>=_0x45d5cb){_0x567f90=_0x45d5cb;_0x3f88e2=0xc8;}else{_0x3f88e2=0xce;}_0x5a6fc1[_0x1c63('0x22')](_0x3f88e2);return _0x5a6fc1[_0x1c63('0x29')](_0x1c63('0x2a'),_0x4d3beb+'-'+_0x567f90+'/'+_0x45d5cb)[_0x1c63('0x24')](_0x645a90);}return null;};}function patchUpdates(_0x534b24){return function(_0x257fd7){try{jsonpatch['apply'](_0x257fd7,_0x534b24,!![]);}catch(_0xec8500){return BPromise[_0x1c63('0x2b')](_0xec8500);}return _0x257fd7[_0x1c63('0x2c')]();};}function saveUpdates(_0x120394,_0x41d5ae){return function(_0x2b525f){if(_0x2b525f){return _0x2b525f['update'](_0x120394)['then'](function(_0x171d2a){return _0x171d2a;});}return null;};}function removeEntity(_0x3a0d3a,_0x15894d){return function(_0x1d2072){if(_0x1d2072){return _0x1d2072[_0x1c63('0x2d')]()[_0x1c63('0x2e')](function(){_0x3a0d3a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35cc59,_0x5562d6){return function(_0x480020){if(!_0x480020){_0x35cc59[_0x1c63('0x21')](0x194);}return _0x480020;};}function handleError(_0xc85e63,_0xb4e5e1){_0xb4e5e1=_0xb4e5e1||0x1f4;return function(_0x245288){logger[_0x1c63('0x2f')](_0x245288['stack']);if(_0x245288['name']){delete _0x245288['name'];}_0xc85e63[_0x1c63('0x22')](_0xb4e5e1)[_0x1c63('0x30')](_0x245288);};}exports[_0x1c63('0x31')]=function(_0x1d1dd2,_0x12b6f5){var _0x41c66c={'raw':![],'where':{'id':_0x1d1dd2['params']['id']}},_0x1db553={};_0x1db553['model']=_[_0x1c63('0x32')](db['DashboardItem'][_0x1c63('0x33')]);_0x1db553[_0x1c63('0x34')]=_['keys'](_0x1d1dd2['query']);_0x1db553[_0x1c63('0x35')]=_[_0x1c63('0x36')](_0x1db553[_0x1c63('0x37')],_0x1db553[_0x1c63('0x34')]);_0x41c66c[_0x1c63('0x38')]=_[_0x1c63('0x36')](_0x1db553[_0x1c63('0x37')],qs[_0x1c63('0x39')](_0x1d1dd2[_0x1c63('0x34')][_0x1c63('0x39')]));_0x41c66c[_0x1c63('0x38')]=_0x41c66c[_0x1c63('0x38')]['length']?_0x41c66c[_0x1c63('0x38')]:_0x1db553[_0x1c63('0x37')];if(_0x1d1dd2[_0x1c63('0x34')][_0x1c63('0x3a')]){_0x41c66c[_0x1c63('0x3b')]=[{'all':!![]}];}_0x41c66c=_[_0x1c63('0x3c')]({},_0x41c66c,_0x1d1dd2['options']);return db[_0x1c63('0x3d')]['find'](_0x41c66c)[_0x1c63('0x2e')](handleEntityNotFound(_0x12b6f5,null))[_0x1c63('0x2e')](respondWithResult(_0x12b6f5,null))[_0x1c63('0x3e')](handleError(_0x12b6f5,null));};exports['destroy']=function(_0x4bde33,_0x4a41fb){return db['DashboardItem'][_0x1c63('0x3f')]({'where':{'id':_0x4bde33['params']['id']}})[_0x1c63('0x2e')](handleEntityNotFound(_0x4a41fb,null))[_0x1c63('0x2e')](removeEntity(_0x4a41fb,null))[_0x1c63('0x3e')](handleError(_0x4a41fb,null));};function widgetAttributes(_0x1b6c39){try{switch(_0x1b6c39[_0x1c63('0x40')]){case _0x1c63('0x41'):return[{'name':_0x1c63('0x42'),'value':_0x1b6c39[_0x1c63('0x42')]||(_0x1b6c39[_0x1c63('0x43')]&&_0x1b6c39['attrs'][0x0]?_0x1b6c39[_0x1c63('0x43')][0x0][_0x1c63('0x44')]:undefined)||_0x1c63('0x45')}];case _0x1c63('0x46'):return[{'name':'attrPath','value':_0x1b6c39[_0x1c63('0x47')]||(_0x1b6c39['attrs']&&_0x1b6c39[_0x1c63('0x43')][0x0]?_0x1b6c39[_0x1c63('0x43')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x1c63('0x48'),'value':_0x1b6c39['attrHourFormat']||(_0x1b6c39[_0x1c63('0x43')]&&_0x1b6c39[_0x1c63('0x43')][0x0]?_0x1b6c39[_0x1c63('0x43')][0x0][_0x1c63('0x44')]:undefined)||_0x1c63('0x49')},{'name':_0x1c63('0x4a'),'value':_0x1b6c39[_0x1c63('0x4a')]||(_0x1b6c39[_0x1c63('0x43')]&&_0x1b6c39[_0x1c63('0x43')][0x1]?_0x1b6c39[_0x1c63('0x43')][0x1][_0x1c63('0x44')]:undefined)||_0x1c63('0x4b')},{'name':'attrFontSize','value':_0x1b6c39[_0x1c63('0x4c')]||(_0x1b6c39['attrs']&&_0x1b6c39['attrs'][0x2]?_0x1b6c39[_0x1c63('0x43')][0x2][_0x1c63('0x44')]:undefined)||0xc}];case'counter':return[{'name':_0x1c63('0x4d'),'value':_0x1b6c39[_0x1c63('0x4d')]||(_0x1b6c39['attrs']&&_0x1b6c39['attrs'][0x0]?_0x1b6c39[_0x1c63('0x43')][0x0][_0x1c63('0x44')]:undefined)||_0x1c63('0x4e')},{'name':'attrVoiceQueues','value':_0x1b6c39[_0x1c63('0x4f')]||(_0x1b6c39['attrs']&&_0x1b6c39[_0x1c63('0x43')][0x1]?_0x1b6c39[_0x1c63('0x43')][0x1][_0x1c63('0x44')]:undefined)||[]},{'name':_0x1c63('0x4c'),'value':_0x1b6c39[_0x1c63('0x4c')]||(_0x1b6c39['attrs']&&_0x1b6c39[_0x1c63('0x43')][0x2]?_0x1b6c39['attrs'][0x2][_0x1c63('0x44')]:undefined)||0x14}];case _0x1c63('0x50'):case _0x1c63('0x51'):return[{'name':'attrSerie1','value':_0x1b6c39[_0x1c63('0x52')]||(_0x1b6c39[_0x1c63('0x43')]&&_0x1b6c39[_0x1c63('0x43')][0x0]?_0x1b6c39['attrs'][0x0][_0x1c63('0x44')]:undefined)||_0x1c63('0x4e')},{'name':'attrSerie2','value':_0x1b6c39[_0x1c63('0x53')]||(_0x1b6c39[_0x1c63('0x43')]&&_0x1b6c39[_0x1c63('0x43')][0x1]?_0x1b6c39[_0x1c63('0x43')][0x1]['value']:undefined)||null},{'name':_0x1c63('0x54'),'value':_0x1b6c39[_0x1c63('0x54')]||(_0x1b6c39[_0x1c63('0x43')]&&_0x1b6c39[_0x1c63('0x43')][0x2]?_0x1b6c39[_0x1c63('0x43')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x1b6c39[_0x1c63('0x4f')]||(_0x1b6c39[_0x1c63('0x43')]&&_0x1b6c39[_0x1c63('0x43')][0x3]?_0x1b6c39[_0x1c63('0x43')][0x3][_0x1c63('0x44')]:undefined)||[]}];case _0x1c63('0x55'):return[{'name':_0x1c63('0x56'),'type':_0x1b6c39[_0x1c63('0x57')]||(_0x1b6c39['attrs']&&_0x1b6c39[_0x1c63('0x43')][0x0]?_0x1b6c39['attrs'][0x0]['type']:undefined)||null,'value':_0x1b6c39[_0x1c63('0x56')]||(_0x1b6c39[_0x1c63('0x43')]&&_0x1b6c39[_0x1c63('0x43')][0x0]?_0x1b6c39['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x1b6c39[_0x1c63('0x58')]||(_0x1b6c39['attrs']&&_0x1b6c39[_0x1c63('0x43')][0x1]?_0x1b6c39['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5383a3){logger['error']('widgetAttributes:\x20%s',JSON[_0x1c63('0x59')](_0x5383a3));return[];}}exports['create']=function(_0xcd265b,_0x1790b2){if(_0xcd265b['body']){_0xcd265b[_0x1c63('0x5a')]['attrs']=widgetAttributes(_0xcd265b[_0x1c63('0x5a')]);}return db[_0x1c63('0x3d')][_0x1c63('0x5b')](_0xcd265b['body'],{})[_0x1c63('0x2e')](respondWithResult(_0x1790b2,0xc9))[_0x1c63('0x3e')](handleError(_0x1790b2,null));};exports[_0x1c63('0x5c')]=function(_0x2dabe2,_0x196f26){if(_0x2dabe2['body']['id']){delete _0x2dabe2[_0x1c63('0x5a')]['id'];}_0x2dabe2[_0x1c63('0x5a')][_0x1c63('0x43')]=widgetAttributes(_0x2dabe2[_0x1c63('0x5a')]);return db[_0x1c63('0x3d')][_0x1c63('0x3f')]({'where':{'id':_0x2dabe2[_0x1c63('0x5d')]['id']}})[_0x1c63('0x2e')](handleEntityNotFound(_0x196f26,null))[_0x1c63('0x2e')](saveUpdates(_0x2dabe2[_0x1c63('0x5a')],null))[_0x1c63('0x2e')](respondWithResult(_0x196f26,null))['catch'](handleError(_0x196f26,null));}; \ No newline at end of file +var _0x485a=['web-report','attrReport','reportType','attrRefresh','error','stringify','create','body','update','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','save','destroy','then','name','send','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','DashboardItem','catch','find','type','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3'];(function(_0x1a20da,_0x226076){var _0x1c7969=function(_0x247116){while(--_0x247116){_0x1a20da['push'](_0x1a20da['shift']());}};_0x1c7969(++_0x226076);}(_0x485a,0x1d0));var _0xa485=function(_0x2d6d0f,_0x3cf2a5){_0x2d6d0f=_0x2d6d0f-0x0;var _0xd2bee6=_0x485a[_0x2d6d0f];return _0xd2bee6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa485('0x0'));var zipdir=require(_0xa485('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa485('0x2'));var moment=require(_0xa485('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa485('0x4'));var util=require(_0xa485('0x5'));var path=require('path');var sox=require(_0xa485('0x6'));var csv=require(_0xa485('0x7'));var ejs=require(_0xa485('0x8'));var fs=require('fs');var fs_extra=require(_0xa485('0x9'));var _=require(_0xa485('0xa'));var squel=require(_0xa485('0xb'));var crypto=require(_0xa485('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa485('0xd'));var toCsv=require(_0xa485('0x7'));var querystring=require(_0xa485('0xe'));var Papa=require('papaparse');var Redis=require(_0xa485('0xf'));var authService=require(_0xa485('0x10'));var qs=require(_0xa485('0x11'));var as=require(_0xa485('0x12'));var hardwareService=require(_0xa485('0x13'));var logger=require(_0xa485('0x14'))(_0xa485('0x15'));var utils=require(_0xa485('0x16'));var config=require(_0xa485('0x17'));var licenseUtil=require(_0xa485('0x18'));var db=require(_0xa485('0x19'))['db'];config[_0xa485('0x1a')]=_['defaults'](config[_0xa485('0x1a')],{'host':_0xa485('0x1b'),'port':0x18eb});var socket=require(_0xa485('0x1c'))(new Redis(config['redis']));require(_0xa485('0x1d'))[_0xa485('0x1e')](socket);function respondWithStatusCode(_0x1d04b6,_0x18d91b){_0x18d91b=_0x18d91b||0xcc;return function(_0x575f28){if(_0x575f28){return _0x1d04b6[_0xa485('0x1f')](_0x18d91b);}return _0x1d04b6[_0xa485('0x20')](_0x18d91b)[_0xa485('0x21')]();};}function respondWithResult(_0x199bb9,_0x5738ff){_0x5738ff=_0x5738ff||0xc8;return function(_0x3c4c46){if(_0x3c4c46){return _0x199bb9['status'](_0x5738ff)[_0xa485('0x22')](_0x3c4c46);}};}function respondWithFilteredResult(_0x5eca60,_0xd3011a){return function(_0x4f4c8f){if(_0x4f4c8f){var _0x3253ca=typeof _0xd3011a['offset']===_0xa485('0x23')&&typeof _0xd3011a['limit']===_0xa485('0x23');var _0x1dde49=_0x4f4c8f[_0xa485('0x24')];var _0xa609d4=_0x3253ca?0x0:_0xd3011a[_0xa485('0x25')];var _0x564c82=_0x3253ca?_0x4f4c8f[_0xa485('0x24')]:_0xd3011a[_0xa485('0x25')]+_0xd3011a[_0xa485('0x26')];var _0x367037;if(_0x564c82>=_0x1dde49){_0x564c82=_0x1dde49;_0x367037=0xc8;}else{_0x367037=0xce;}_0x5eca60[_0xa485('0x20')](_0x367037);return _0x5eca60[_0xa485('0x27')](_0xa485('0x28'),_0xa609d4+'-'+_0x564c82+'/'+_0x1dde49)[_0xa485('0x22')](_0x4f4c8f);}return null;};}function patchUpdates(_0x1e5b8a){return function(_0xa1fc82){try{jsonpatch['apply'](_0xa1fc82,_0x1e5b8a,!![]);}catch(_0x194a08){return BPromise['reject'](_0x194a08);}return _0xa1fc82[_0xa485('0x29')]();};}function saveUpdates(_0x556400,_0x40e880){return function(_0x490631){if(_0x490631){return _0x490631['update'](_0x556400)['then'](function(_0x38730c){return _0x38730c;});}return null;};}function removeEntity(_0x3d1e08,_0x454bb3){return function(_0x47bb45){if(_0x47bb45){return _0x47bb45[_0xa485('0x2a')]()[_0xa485('0x2b')](function(){_0x3d1e08[_0xa485('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26bb11,_0x550348){return function(_0x4333d1){if(!_0x4333d1){_0x26bb11[_0xa485('0x1f')](0x194);}return _0x4333d1;};}function handleError(_0x326c1c,_0x4c5a82){_0x4c5a82=_0x4c5a82||0x1f4;return function(_0x30ed23){logger['error'](_0x30ed23['stack']);if(_0x30ed23['name']){delete _0x30ed23[_0xa485('0x2c')];}_0x326c1c[_0xa485('0x20')](_0x4c5a82)[_0xa485('0x2d')](_0x30ed23);};}exports[_0xa485('0x2e')]=function(_0x388338,_0x424b6c){var _0x5ae20b={'raw':![],'where':{'id':_0x388338[_0xa485('0x2f')]['id']}},_0x502352={};_0x502352[_0xa485('0x30')]=_[_0xa485('0x31')](db['DashboardItem']['rawAttributes']);_0x502352['query']=_['keys'](_0x388338[_0xa485('0x32')]);_0x502352[_0xa485('0x33')]=_[_0xa485('0x34')](_0x502352['model'],_0x502352['query']);_0x5ae20b[_0xa485('0x35')]=_[_0xa485('0x34')](_0x502352[_0xa485('0x30')],qs[_0xa485('0x36')](_0x388338[_0xa485('0x32')][_0xa485('0x36')]));_0x5ae20b[_0xa485('0x35')]=_0x5ae20b[_0xa485('0x35')][_0xa485('0x37')]?_0x5ae20b[_0xa485('0x35')]:_0x502352['model'];if(_0x388338['query'][_0xa485('0x38')]){_0x5ae20b[_0xa485('0x39')]=[{'all':!![]}];}_0x5ae20b=_[_0xa485('0x3a')]({},_0x5ae20b,_0x388338[_0xa485('0x3b')]);return db[_0xa485('0x3c')]['find'](_0x5ae20b)['then'](handleEntityNotFound(_0x424b6c,null))[_0xa485('0x2b')](respondWithResult(_0x424b6c,null))[_0xa485('0x3d')](handleError(_0x424b6c,null));};exports['destroy']=function(_0x29a472,_0x4819df){return db[_0xa485('0x3c')][_0xa485('0x3e')]({'where':{'id':_0x29a472['params']['id']}})[_0xa485('0x2b')](handleEntityNotFound(_0x4819df,null))['then'](removeEntity(_0x4819df,null))['catch'](handleError(_0x4819df,null));};function widgetAttributes(_0x56a36d){try{switch(_0x56a36d[_0xa485('0x3f')]){case'iframe':return[{'name':_0xa485('0x40'),'value':_0x56a36d[_0xa485('0x40')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d[_0xa485('0x41')][0x0]?_0x56a36d['attrs'][0x0][_0xa485('0x42')]:undefined)||'https://'}];case'custom':return[{'name':_0xa485('0x43'),'value':_0x56a36d[_0xa485('0x43')]||(_0x56a36d['attrs']&&_0x56a36d[_0xa485('0x41')][0x0]?_0x56a36d[_0xa485('0x41')][0x0]['value']:undefined)||''}];case _0xa485('0x44'):return[{'name':_0xa485('0x45'),'value':_0x56a36d[_0xa485('0x45')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d['attrs'][0x0]?_0x56a36d[_0xa485('0x41')][0x0]['value']:undefined)||_0xa485('0x46')},{'name':_0xa485('0x47'),'value':_0x56a36d[_0xa485('0x47')]||(_0x56a36d['attrs']&&_0x56a36d[_0xa485('0x41')][0x1]?_0x56a36d[_0xa485('0x41')][0x1]['value']:undefined)||_0xa485('0x48')},{'name':_0xa485('0x49'),'value':_0x56a36d[_0xa485('0x49')]||(_0x56a36d['attrs']&&_0x56a36d[_0xa485('0x41')][0x2]?_0x56a36d[_0xa485('0x41')][0x2][_0xa485('0x42')]:undefined)||0xc}];case _0xa485('0x4a'):return[{'name':'attrMetric','value':_0x56a36d[_0xa485('0x4b')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d['attrs'][0x0]?_0x56a36d[_0xa485('0x41')][0x0][_0xa485('0x42')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x56a36d[_0xa485('0x4c')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d[_0xa485('0x41')][0x1]?_0x56a36d[_0xa485('0x41')][0x1]['value']:undefined)||[]},{'name':_0xa485('0x49'),'value':_0x56a36d[_0xa485('0x49')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d[_0xa485('0x41')][0x2]?_0x56a36d[_0xa485('0x41')][0x2][_0xa485('0x42')]:undefined)||0x14}];case _0xa485('0x4d'):case'pie-chart':return[{'name':'attrSerie1','value':_0x56a36d[_0xa485('0x4e')]||(_0x56a36d['attrs']&&_0x56a36d['attrs'][0x0]?_0x56a36d[_0xa485('0x41')][0x0][_0xa485('0x42')]:undefined)||_0xa485('0x4f')},{'name':_0xa485('0x50'),'value':_0x56a36d[_0xa485('0x50')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d[_0xa485('0x41')][0x1]?_0x56a36d['attrs'][0x1]['value']:undefined)||null},{'name':_0xa485('0x51'),'value':_0x56a36d[_0xa485('0x51')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d['attrs'][0x2]?_0x56a36d[_0xa485('0x41')][0x2][_0xa485('0x42')]:undefined)||null},{'name':_0xa485('0x4c'),'value':_0x56a36d[_0xa485('0x4c')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d[_0xa485('0x41')][0x3]?_0x56a36d[_0xa485('0x41')][0x3][_0xa485('0x42')]:undefined)||[]}];case _0xa485('0x52'):return[{'name':_0xa485('0x53'),'type':_0x56a36d[_0xa485('0x54')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d[_0xa485('0x41')][0x0]?_0x56a36d[_0xa485('0x41')][0x0]['type']:undefined)||null,'value':_0x56a36d[_0xa485('0x53')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d[_0xa485('0x41')][0x0]?_0x56a36d['attrs'][0x0][_0xa485('0x42')]:undefined)||null},{'name':'attrRefresh','value':_0x56a36d[_0xa485('0x55')]||(_0x56a36d[_0xa485('0x41')]&&_0x56a36d[_0xa485('0x41')][0x1]?_0x56a36d[_0xa485('0x41')][0x1][_0xa485('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x3f0a14){logger[_0xa485('0x56')]('widgetAttributes:\x20%s',JSON[_0xa485('0x57')](_0x3f0a14));return[];}}exports[_0xa485('0x58')]=function(_0x212b1e,_0x4ccc45){if(_0x212b1e['body']){_0x212b1e['body']['attrs']=widgetAttributes(_0x212b1e[_0xa485('0x59')]);}return db[_0xa485('0x3c')][_0xa485('0x58')](_0x212b1e[_0xa485('0x59')],{})[_0xa485('0x2b')](respondWithResult(_0x4ccc45,0xc9))[_0xa485('0x3d')](handleError(_0x4ccc45,null));};exports[_0xa485('0x5a')]=function(_0x52b93f,_0x1d2f62){if(_0x52b93f[_0xa485('0x59')]['id']){delete _0x52b93f['body']['id'];}_0x52b93f[_0xa485('0x59')]['attrs']=widgetAttributes(_0x52b93f['body']);return db[_0xa485('0x3c')][_0xa485('0x3e')]({'where':{'id':_0x52b93f['params']['id']}})['then'](handleEntityNotFound(_0x1d2f62,null))[_0xa485('0x2b')](saveUpdates(_0x52b93f[_0xa485('0x59')],null))[_0xa485('0x2b')](respondWithResult(_0x1d2f62,null))['catch'](handleError(_0x1d2f62,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index aaa7fe8..4a05897 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 _0x5a13=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x35b7c6,_0x7adb8e){var _0x40422e=function(_0x136762){while(--_0x136762){_0x35b7c6['push'](_0x35b7c6['shift']());}};_0x40422e(++_0x7adb8e);}(_0x5a13,0x145));var _0x35a1=function(_0x4dbd99,_0x580d62){_0x4dbd99=_0x4dbd99-0x0;var _0x5fd90c=_0x5a13[_0x4dbd99];return _0x5fd90c;};'use strict';var EventEmitter=require(_0x35a1('0x0'));var DashboardItem=require(_0x35a1('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x35a1('0x2')](0x0);var events={'afterCreate':_0x35a1('0x3'),'afterUpdate':_0x35a1('0x4'),'afterDestroy':_0x35a1('0x5')};function emitEvent(_0x135bd){return function(_0xcbad2f,_0x233e91,_0x57d474){DashboardItemEvents[_0x35a1('0x6')](_0x135bd+':'+_0xcbad2f['id'],_0xcbad2f);DashboardItemEvents[_0x35a1('0x6')](_0x135bd,_0xcbad2f);_0x57d474(null);};}for(var e in events){if(events[_0x35a1('0x7')](e)){var event=events[e];DashboardItem[_0x35a1('0x8')](e,emitEvent(event));}}module[_0x35a1('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0xdedd=['emit','hasOwnProperty','hook','events','../../mysqldb','DashboardItem','setMaxListeners','update','remove'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xdedd,0x1a1));var _0xdded=function(_0x3d3aad,_0x5e595f){_0x3d3aad=_0x3d3aad-0x0;var _0xba87ce=_0xdedd[_0x3d3aad];return _0xba87ce;};'use strict';var EventEmitter=require(_0xdded('0x0'));var DashboardItem=require(_0xdded('0x1'))['db'][_0xdded('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xdded('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdded('0x4'),'afterDestroy':_0xdded('0x5')};function emitEvent(_0x5047f){return function(_0x381a87,_0x5312e4,_0x587db1){DashboardItemEvents[_0xdded('0x6')](_0x5047f+':'+_0x381a87['id'],_0x381a87);DashboardItemEvents[_0xdded('0x6')](_0x5047f,_0x381a87);_0x587db1(null);};}for(var e in events){if(events[_0xdded('0x7')](e)){var event=events[e];DashboardItem[_0xdded('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index d119f8b..4939ce7 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 _0x9a47=['bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','lodash','../../config/logger','api','moment'];(function(_0x2fb169,_0x46de58){var _0xc6e241=function(_0x439842){while(--_0x439842){_0x2fb169['push'](_0x2fb169['shift']());}};_0xc6e241(++_0x46de58);}(_0x9a47,0x14c));var _0x79a4=function(_0x283b6e,_0x4953be){_0x283b6e=_0x283b6e-0x0;var _0x47217e=_0x9a47[_0x283b6e];return _0x47217e;};'use strict';var _=require(_0x79a4('0x0'));var util=require('util');var logger=require(_0x79a4('0x1'))(_0x79a4('0x2'));var moment=require(_0x79a4('0x3'));var BPromise=require(_0x79a4('0x4'));var rp=require(_0x79a4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79a4('0x6'));var config=require(_0x79a4('0x7'));var attributes=require(_0x79a4('0x8'));module[_0x79a4('0x9')]=function(_0x43662b,_0x1a9037){return _0x43662b[_0x79a4('0xa')](_0x79a4('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7762=['rimraf','../../config/environment','exports','DashboardItem','dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x7762,0x17b));var _0x2776=function(_0x140333,_0x3cf55b){_0x140333=_0x140333-0x0;var _0x329cef=_0x7762[_0x140333];return _0x329cef;};'use strict';var _=require(_0x2776('0x0'));var util=require(_0x2776('0x1'));var logger=require(_0x2776('0x2'))('api');var moment=require(_0x2776('0x3'));var BPromise=require(_0x2776('0x4'));var rp=require(_0x2776('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2776('0x6'));var config=require(_0x2776('0x7'));var attributes=require('./dashboardItem.attributes');module[_0x2776('0x8')]=function(_0x489e72,_0x4eefcf){return _0x489e72['define'](_0x2776('0x9'),attributes,{'tableName':_0x2776('0xa'),'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 61f1fb5..9e9bc11 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 _0x0fc6=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent'];(function(_0x44e78e,_0x5f2ba5){var _0xff1bb2=function(_0x1dc6a8){while(--_0x1dc6a8){_0x44e78e['push'](_0x44e78e['shift']());}};_0xff1bb2(++_0x5f2ba5);}(_0x0fc6,0x83));var _0x60fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0fc6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x60fc('0x0'));var util=require(_0x60fc('0x1'));var moment=require(_0x60fc('0x2'));var BPromise=require(_0x60fc('0x3'));var rs=require(_0x60fc('0x4'));var fs=require('fs');var Redis=require(_0x60fc('0x5'));var db=require(_0x60fc('0x6'))['db'];var utils=require(_0x60fc('0x7'));var logger=require('../../config/logger')(_0x60fc('0x8'));var config=require(_0x60fc('0x9'));var jayson=require(_0x60fc('0xa'));var client=jayson[_0x60fc('0xb')][_0x60fc('0xc')]({'port':0x232a});config['redis']=_[_0x60fc('0xd')](config[_0x60fc('0xe')],{'host':_0x60fc('0xf'),'port':0x18eb});var socket=require(_0x60fc('0x10'))(new Redis(config[_0x60fc('0xe')]));require(_0x60fc('0x11'))[_0x60fc('0x12')](socket);function respondWithRpcPromise(_0x3c9c15,_0x339aa4,_0x28280f){return new BPromise(function(_0x27aa57,_0x450191){return client[_0x60fc('0x13')](_0x3c9c15,_0x28280f)[_0x60fc('0x14')](function(_0x13ed65){logger[_0x60fc('0x15')](_0x60fc('0x16'),_0x339aa4,_0x60fc('0x17'));logger[_0x60fc('0x18')](_0x60fc('0x19'),_0x339aa4,'request\x20sent',JSON['stringify'](_0x13ed65));if(_0x13ed65[_0x60fc('0x1a')]){if(_0x13ed65[_0x60fc('0x1a')][_0x60fc('0x1b')]===0x1f4){logger[_0x60fc('0x1a')](_0x60fc('0x16'),_0x339aa4,_0x13ed65[_0x60fc('0x1a')][_0x60fc('0x1c')]);return _0x450191(_0x13ed65[_0x60fc('0x1a')][_0x60fc('0x1c')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x339aa4,_0x13ed65[_0x60fc('0x1a')][_0x60fc('0x1c')]);return _0x27aa57(_0x13ed65['error'][_0x60fc('0x1c')]);}else{logger['info'](_0x60fc('0x16'),_0x339aa4,_0x60fc('0x17'));_0x27aa57(_0x13ed65[_0x60fc('0x1d')][_0x60fc('0x1c')]);}})[_0x60fc('0x1e')](function(_0x452ee0){logger['error']('DashboardItem,\x20%s,\x20%s',_0x339aa4,_0x452ee0);_0x450191(_0x452ee0);});});} \ No newline at end of file +var _0x1b49=['moment','randomstring','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x6e1ca,_0x178893){var _0xa06bf3=function(_0x42b656){while(--_0x42b656){_0x6e1ca['push'](_0x6e1ca['shift']());}};_0xa06bf3(++_0x178893);}(_0x1b49,0x144));var _0x91b4=function(_0x5c12ba,_0x229eee){_0x5c12ba=_0x5c12ba-0x0;var _0x4ed0fa=_0x1b49[_0x5c12ba];return _0x4ed0fa;};'use strict';var _=require('lodash');var util=require(_0x91b4('0x0'));var moment=require(_0x91b4('0x1'));var BPromise=require('bluebird');var rs=require(_0x91b4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x91b4('0x3'));var config=require(_0x91b4('0x4'));var jayson=require(_0x91b4('0x5'));var client=jayson[_0x91b4('0x6')]['http']({'port':0x232a});config[_0x91b4('0x7')]=_[_0x91b4('0x8')](config['redis'],{'host':_0x91b4('0x9'),'port':0x18eb});var socket=require(_0x91b4('0xa'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x91b4('0xb')](socket);function respondWithRpcPromise(_0x3b3708,_0x117e89,_0x4d504c){return new BPromise(function(_0x2c6d14,_0x3eafaf){return client[_0x91b4('0xc')](_0x3b3708,_0x4d504c)[_0x91b4('0xd')](function(_0x460e34){logger[_0x91b4('0xe')](_0x91b4('0xf'),_0x117e89,_0x91b4('0x10'));logger[_0x91b4('0x11')](_0x91b4('0x12'),_0x117e89,_0x91b4('0x10'),JSON[_0x91b4('0x13')](_0x460e34));if(_0x460e34[_0x91b4('0x14')]){if(_0x460e34[_0x91b4('0x14')][_0x91b4('0x15')]===0x1f4){logger[_0x91b4('0x14')](_0x91b4('0xf'),_0x117e89,_0x460e34[_0x91b4('0x14')][_0x91b4('0x16')]);return _0x3eafaf(_0x460e34['error'][_0x91b4('0x16')]);}logger['error'](_0x91b4('0xf'),_0x117e89,_0x460e34[_0x91b4('0x14')]['message']);return _0x2c6d14(_0x460e34[_0x91b4('0x14')][_0x91b4('0x16')]);}else{logger['info'](_0x91b4('0xf'),_0x117e89,_0x91b4('0x10'));_0x2c6d14(_0x460e34[_0x91b4('0x17')][_0x91b4('0x16')]);}})[_0x91b4('0x18')](function(_0x3051c7){logger['error']('DashboardItem,\x20%s,\x20%s',_0x117e89,_0x3051c7);_0x3eafaf(_0x3051c7);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 1645ac5..d968277 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 _0x37ae=['removeListener','register','length','./dashboardItem.events','save','remove','update','emit'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x37ae,0x7b));var _0xe37a=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0x37ae[_0x31b5b2];return _0x364f13;};'use strict';var DashboardItemEvents=require(_0xe37a('0x0'));var events=[_0xe37a('0x1'),_0xe37a('0x2'),_0xe37a('0x3')];function createListener(_0x53b766,_0x36fc56){return function(_0x27858b){_0x36fc56[_0xe37a('0x4')](_0x53b766,_0x27858b);};}function removeListener(_0x420773,_0x2b6aad){return function(){DashboardItemEvents[_0xe37a('0x5')](_0x420773,_0x2b6aad);};}exports[_0xe37a('0x6')]=function(_0x23456f){for(var _0x257fcd=0x0,_0x2c9892=events[_0xe37a('0x7')];_0x257fcd<_0x2c9892;_0x257fcd++){var _0x26e1ee=events[_0x257fcd];var _0xd0a411=createListener('dashboardItem:'+_0x26e1ee,_0x23456f);DashboardItemEvents['on'](_0x26e1ee,_0xd0a411);}}; \ No newline at end of file +var _0x004f=['remove','update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x4370c7,_0x5dbfb0){var _0xce78a9=function(_0x157b2c){while(--_0x157b2c){_0x4370c7['push'](_0x4370c7['shift']());}};_0xce78a9(++_0x5dbfb0);}(_0x004f,0x166));var _0xf004=function(_0x1111fb,_0x2d2efb){_0x1111fb=_0x1111fb-0x0;var _0x4087c3=_0x004f[_0x1111fb];return _0x4087c3;};'use strict';var DashboardItemEvents=require(_0xf004('0x0'));var events=[_0xf004('0x1'),_0xf004('0x2'),_0xf004('0x3')];function createListener(_0x27c2e8,_0x4d558e){return function(_0x4b87fa){_0x4d558e[_0xf004('0x4')](_0x27c2e8,_0x4b87fa);};}function removeListener(_0xbf8cbf,_0x36d506){return function(){DashboardItemEvents[_0xf004('0x5')](_0xbf8cbf,_0x36d506);};}exports[_0xf004('0x6')]=function(_0xf3d0a4){for(var _0x491386=0x0,_0x491e19=events[_0xf004('0x7')];_0x491386<_0x491e19;_0x491386++){var _0x568408=events[_0x491386];var _0x50945d=createListener(_0xf004('0x8')+_0x568408,_0xf3d0a4);DashboardItemEvents['on'](_0x568408,_0x50945d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 92f2e8c..4048ea9 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 _0xc68a=['put','update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','create'];(function(_0x547bb6,_0x2d6f27){var _0x1a9154=function(_0x18080f){while(--_0x18080f){_0x547bb6['push'](_0x547bb6['shift']());}};_0x1a9154(++_0x2d6f27);}(_0xc68a,0xf4));var _0xac68=function(_0x2ba1b2,_0x1d4370){_0x2ba1b2=_0x2ba1b2-0x0;var _0x23345e=_0xc68a[_0x2ba1b2];return _0x23345e;};'use strict';var multer=require(_0xac68('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xac68('0x1'));var express=require(_0xac68('0x2'));var router=express['Router']();var fs_extra=require(_0xac68('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xac68('0x4'));var config=require(_0xac68('0x5'));var controller=require(_0xac68('0x6'));router[_0xac68('0x7')](_0xac68('0x8'),auth[_0xac68('0x9')](),controller[_0xac68('0xa')]);router['post']('/',auth[_0xac68('0x9')](),controller[_0xac68('0xb')]);router[_0xac68('0xc')]('/:id',auth[_0xac68('0x9')](),controller[_0xac68('0xd')]);router['delete'](_0xac68('0x8'),auth['isAuthenticated'](),controller[_0xac68('0xe')]);module[_0xac68('0xf')]=router; \ No newline at end of file +var _0x8259=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','show','post','create','put','update','/:id','isAuthenticated'];(function(_0x200a4c,_0x10084a){var _0x9e90ef=function(_0x52678a){while(--_0x52678a){_0x200a4c['push'](_0x200a4c['shift']());}};_0x9e90ef(++_0x10084a);}(_0x8259,0xbd));var _0x9825=function(_0x33e9bf,_0x41823d){_0x33e9bf=_0x33e9bf-0x0;var _0x52ff43=_0x8259[_0x33e9bf];return _0x52ff43;};'use strict';var multer=require('multer');var util=require(_0x9825('0x0'));var path=require(_0x9825('0x1'));var timeout=require(_0x9825('0x2'));var express=require(_0x9825('0x3'));var router=express['Router']();var fs_extra=require(_0x9825('0x4'));var auth=require(_0x9825('0x5'));var interaction=require(_0x9825('0x6'));var config=require('../../config/environment');var controller=require(_0x9825('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x9825('0x8')]);router[_0x9825('0x9')]('/',auth['isAuthenticated'](),controller[_0x9825('0xa')]);router[_0x9825('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x9825('0xc')]);router['delete'](_0x9825('0xd'),auth[_0x9825('0xe')](),controller[_0x9825('0xf')]);module[_0x9825('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 24d813b..987e6f0 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 _0x6bcf=['exports','STRING','ENUM','first','third','sequelize'];(function(_0xda01a0,_0xccbad5){var _0x4919b6=function(_0x5b458a){while(--_0x5b458a){_0xda01a0['push'](_0xda01a0['shift']());}};_0x4919b6(++_0xccbad5);}(_0x6bcf,0xa7));var _0xf6bc=function(_0x4d24f8,_0x186320){_0x4d24f8=_0x4d24f8-0x0;var _0x135250=_0x6bcf[_0x4d24f8];return _0x135250;};'use strict';var Sequelize=require(_0xf6bc('0x0'));module[_0xf6bc('0x1')]={'name':{'type':Sequelize[_0xf6bc('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xf6bc('0x3')](_0xf6bc('0x4'),'second',_0xf6bc('0x5')),'allowNull':![],'defaultValue':_0xf6bc('0x4')},'description':{'type':Sequelize[_0xf6bc('0x2')]}}; \ No newline at end of file +var _0x79fc=['second','sequelize','exports','STRING','ENUM','first'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x79fc,0x9d));var _0xc79f=function(_0x40e0eb,_0x51f9a5){_0x40e0eb=_0x40e0eb-0x0;var _0x3b11ee=_0x79fc[_0x40e0eb];return _0x3b11ee;};'use strict';var Sequelize=require(_0xc79f('0x0'));module[_0xc79f('0x1')]={'name':{'type':Sequelize[_0xc79f('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xc79f('0x3')](_0xc79f('0x4'),_0xc79f('0x5'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xc79f('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index a826b92..763d76d 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 _0x303f=['order','sort','pick','filter','where','VIRTUAL','merge','options','Disposition','includeAll','include','findAll','rows','catch','show','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','destroy','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','get','Dispositions','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x16e0f5,_0x4ec0f3){var _0x4839d5=function(_0x296b8f){while(--_0x296b8f){_0x16e0f5['push'](_0x16e0f5['shift']());}};_0x4839d5(++_0x4ec0f3);}(_0x303f,0xbe));var _0xf303=function(_0x3ab031,_0x3fc7dd){_0x3ab031=_0x3ab031-0x0;var _0x33572e=_0x303f[_0x3ab031];return _0x33572e;};'use strict';var emlformat=require(_0xf303('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf303('0x1'));var rp=require(_0xf303('0x2'));var moment=require(_0xf303('0x3'));var BPromise=require(_0xf303('0x4'));var Mustache=require(_0xf303('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf303('0x6'));var csv=require(_0xf303('0x7'));var ejs=require(_0xf303('0x8'));var fs=require('fs');var fs_extra=require(_0xf303('0x9'));var _=require(_0xf303('0xa'));var squel=require(_0xf303('0xb'));var crypto=require('crypto');var jsforce=require(_0xf303('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf303('0xd'));var Papa=require(_0xf303('0xe'));var Redis=require('ioredis');var authService=require(_0xf303('0xf'));var qs=require(_0xf303('0x10'));var as=require(_0xf303('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf303('0x12'))(_0xf303('0x13'));var utils=require(_0xf303('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf303('0x15'));var db=require(_0xf303('0x16'))['db'];function respondWithStatusCode(_0x19d3c6,_0x219e0f){_0x219e0f=_0x219e0f||0xcc;return function(_0xe071f3){if(_0xe071f3){return _0x19d3c6[_0xf303('0x17')](_0x219e0f);}return _0x19d3c6[_0xf303('0x18')](_0x219e0f)[_0xf303('0x19')]();};}function respondWithResult(_0x37075d,_0x11af1b){_0x11af1b=_0x11af1b||0xc8;return function(_0x3a811f){if(_0x3a811f){return _0x37075d[_0xf303('0x18')](_0x11af1b)[_0xf303('0x1a')](_0x3a811f);}};}function respondWithFilteredResult(_0x58df2c,_0x4602da){return function(_0x2444cf){if(_0x2444cf){var _0xacad3e=typeof _0x4602da[_0xf303('0x1b')]===_0xf303('0x1c')&&typeof _0x4602da[_0xf303('0x1d')]==='undefined';var _0xabc7e7=_0x2444cf[_0xf303('0x1e')];var _0x260d23=_0xacad3e?0x0:_0x4602da['offset'];var _0x411a31=_0xacad3e?_0x2444cf[_0xf303('0x1e')]:_0x4602da[_0xf303('0x1b')]+_0x4602da[_0xf303('0x1d')];var _0x4bf835;if(_0x411a31>=_0xabc7e7){_0x411a31=_0xabc7e7;_0x4bf835=0xc8;}else{_0x4bf835=0xce;}_0x58df2c[_0xf303('0x18')](_0x4bf835);return _0x58df2c['set'](_0xf303('0x1f'),_0x260d23+'-'+_0x411a31+'/'+_0xabc7e7)[_0xf303('0x1a')](_0x2444cf);}return null;};}function patchUpdates(_0x2e33d0){return function(_0x4662cb){try{jsonpatch[_0xf303('0x20')](_0x4662cb,_0x2e33d0,!![]);}catch(_0x12ccb5){return BPromise['reject'](_0x12ccb5);}return _0x4662cb[_0xf303('0x21')]();};}function saveUpdates(_0x2d277e,_0xb0e551){return function(_0x301972){if(_0x301972){return _0x301972['update'](_0x2d277e)[_0xf303('0x22')](function(_0x3b089b){return _0x3b089b;});}return null;};}function removeEntity(_0x1b2532,_0x5cf111){return function(_0x546e9c){if(_0x546e9c){return _0x546e9c['destroy']()[_0xf303('0x22')](function(){var _0x480002=_0x546e9c[_0xf303('0x23')]({'plain':!![]});var _0x31ad26=_0xf303('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x31ad26,'resourceId':_0x480002['id']}})[_0xf303('0x22')](function(){return _0x546e9c;});})[_0xf303('0x22')](function(){_0x1b2532['status'](0xcc)[_0xf303('0x19')]();});}};}function handleEntityNotFound(_0x3305ef,_0xe45ea8){return function(_0x1a6464){if(!_0x1a6464){_0x3305ef['sendStatus'](0x194);}return _0x1a6464;};}function handleError(_0xbb5713,_0x223b02){_0x223b02=_0x223b02||0x1f4;return function(_0x33268d){logger[_0xf303('0x25')](_0x33268d[_0xf303('0x26')]);if(_0x33268d[_0xf303('0x27')]){delete _0x33268d['name'];}_0xbb5713['status'](_0x223b02)[_0xf303('0x28')](_0x33268d);};}exports[_0xf303('0x29')]=function(_0x390ef7,_0x301979){var _0x54cdf1={},_0x3c059b={},_0x578ef7={'count':0x0,'rows':[]};var _0x59170c=_['map'](db['Disposition'][_0xf303('0x2a')],function(_0x3acaba){return{'name':_0x3acaba['fieldName'],'type':_0x3acaba[_0xf303('0x2b')][_0xf303('0x2c')]};});_0x3c059b[_0xf303('0x2d')]=_[_0xf303('0x2e')](_0x59170c,_0xf303('0x27'));_0x3c059b[_0xf303('0x2f')]=_[_0xf303('0x30')](_0x390ef7[_0xf303('0x2f')]);_0x3c059b[_0xf303('0x31')]=_[_0xf303('0x32')](_0x3c059b['model'],_0x3c059b[_0xf303('0x2f')]);_0x54cdf1[_0xf303('0x33')]=_[_0xf303('0x32')](_0x3c059b[_0xf303('0x2d')],qs[_0xf303('0x34')](_0x390ef7[_0xf303('0x2f')]['fields']));_0x54cdf1[_0xf303('0x33')]=_0x54cdf1[_0xf303('0x33')][_0xf303('0x35')]?_0x54cdf1[_0xf303('0x33')]:_0x3c059b[_0xf303('0x2d')];if(!_0x390ef7['query'][_0xf303('0x36')](_0xf303('0x37'))){_0x54cdf1[_0xf303('0x1d')]=qs[_0xf303('0x1d')](_0x390ef7[_0xf303('0x2f')]['limit']);_0x54cdf1[_0xf303('0x1b')]=qs[_0xf303('0x1b')](_0x390ef7[_0xf303('0x2f')][_0xf303('0x1b')]);}_0x54cdf1[_0xf303('0x38')]=qs[_0xf303('0x39')](_0x390ef7[_0xf303('0x2f')][_0xf303('0x39')]);_0x54cdf1['where']=qs[_0xf303('0x31')](_[_0xf303('0x3a')](_0x390ef7['query'],_0x3c059b[_0xf303('0x31')]),_0x59170c);if(_0x390ef7['query'][_0xf303('0x3b')]){_0x54cdf1[_0xf303('0x3c')]=_['merge'](_0x54cdf1[_0xf303('0x3c')],{'$or':_['map'](_0x59170c,function(_0x5d04fb){if(_0x5d04fb[_0xf303('0x2b')]!==_0xf303('0x3d')){var _0xa4b12d={};_0xa4b12d[_0x5d04fb[_0xf303('0x27')]]={'$like':'%'+_0x390ef7[_0xf303('0x2f')][_0xf303('0x3b')]+'%'};return _0xa4b12d;}})});}_0x54cdf1=_[_0xf303('0x3e')]({},_0x54cdf1,_0x390ef7[_0xf303('0x3f')]);var _0x1a8adc={'where':_0x54cdf1['where']};return db[_0xf303('0x40')][_0xf303('0x1e')](_0x1a8adc)[_0xf303('0x22')](function(_0x287091){_0x578ef7['count']=_0x287091;if(_0x390ef7[_0xf303('0x2f')][_0xf303('0x41')]){_0x54cdf1[_0xf303('0x42')]=[{'all':!![]}];}return db[_0xf303('0x40')][_0xf303('0x43')](_0x54cdf1);})[_0xf303('0x22')](function(_0x4598dd){_0x578ef7[_0xf303('0x44')]=_0x4598dd;return _0x578ef7;})[_0xf303('0x22')](respondWithFilteredResult(_0x301979,_0x54cdf1))[_0xf303('0x45')](handleError(_0x301979,null));};exports[_0xf303('0x46')]=function(_0x2bdadb,_0x1ce9c8){var _0x5b021d={'raw':!![],'where':{'id':_0x2bdadb['params']['id']}},_0x480a9b={};_0x480a9b['model']=_[_0xf303('0x30')](db[_0xf303('0x40')][_0xf303('0x2a')]);_0x480a9b[_0xf303('0x2f')]=_[_0xf303('0x30')](_0x2bdadb[_0xf303('0x2f')]);_0x480a9b[_0xf303('0x31')]=_[_0xf303('0x32')](_0x480a9b[_0xf303('0x2d')],_0x480a9b[_0xf303('0x2f')]);_0x5b021d['attributes']=_['intersection'](_0x480a9b['model'],qs['fields'](_0x2bdadb[_0xf303('0x2f')][_0xf303('0x34')]));_0x5b021d[_0xf303('0x33')]=_0x5b021d[_0xf303('0x33')][_0xf303('0x35')]?_0x5b021d[_0xf303('0x33')]:_0x480a9b[_0xf303('0x2d')];if(_0x2bdadb[_0xf303('0x2f')][_0xf303('0x41')]){_0x5b021d[_0xf303('0x42')]=[{'all':!![]}];}_0x5b021d=_[_0xf303('0x3e')]({},_0x5b021d,_0x2bdadb[_0xf303('0x3f')]);return db[_0xf303('0x40')]['find'](_0x5b021d)[_0xf303('0x22')](handleEntityNotFound(_0x1ce9c8,null))[_0xf303('0x22')](respondWithResult(_0x1ce9c8,null))['catch'](handleError(_0x1ce9c8,null));};exports[_0xf303('0x47')]=function(_0x53f5da,_0x449bd0){return db[_0xf303('0x40')][_0xf303('0x47')](_0x53f5da['body'],{})[_0xf303('0x22')](function(_0x1a15ee){var _0x479925=_0x53f5da['user'][_0xf303('0x23')]({'plain':!![]});if(!_0x479925)throw new Error(_0xf303('0x48'));if(_0x479925[_0xf303('0x49')]==='user'){var _0x59bb42=_0x1a15ee[_0xf303('0x23')]({'plain':!![]});var _0xa5e680='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0xa5e680,'userProfileId':_0x479925[_0xf303('0x4a')]},'raw':!![]})[_0xf303('0x22')](function(_0x516384){if(_0x516384&&_0x516384[_0xf303('0x4b')]===0x0){return db[_0xf303('0x4c')][_0xf303('0x47')]({'name':_0x59bb42['name'],'resourceId':_0x59bb42['id'],'type':_0x516384[_0xf303('0x27')],'sectionId':_0x516384['id']},{})[_0xf303('0x22')](function(){return _0x1a15ee;});}else{return _0x1a15ee;}})[_0xf303('0x45')](function(_0x36f8fb){logger['error'](_0xf303('0x4d'),_0x36f8fb);throw _0x36f8fb;});}return _0x1a15ee;})[_0xf303('0x22')](respondWithResult(_0x449bd0,0xc9))[_0xf303('0x45')](handleError(_0x449bd0,null));};exports['update']=function(_0x290ff8,_0x5b7a2b){if(_0x290ff8[_0xf303('0x4e')]['id']){delete _0x290ff8[_0xf303('0x4e')]['id'];}return db[_0xf303('0x40')][_0xf303('0x4f')]({'where':{'id':_0x290ff8['params']['id']}})['then'](handleEntityNotFound(_0x5b7a2b,null))['then'](saveUpdates(_0x290ff8[_0xf303('0x4e')],null))[_0xf303('0x22')](respondWithResult(_0x5b7a2b,null))[_0xf303('0x45')](handleError(_0x5b7a2b,null));};exports[_0xf303('0x50')]=function(_0x1d2249,_0x76bbc){return db['Disposition'][_0xf303('0x4f')]({'where':{'id':_0x1d2249[_0xf303('0x51')]['id']}})[_0xf303('0x22')](handleEntityNotFound(_0x76bbc,null))[_0xf303('0x22')](removeEntity(_0x76bbc,null))[_0xf303('0x45')](handleError(_0x76bbc,null));}; \ No newline at end of file +var _0x3a67=['fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','Disposition','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','index','map','rawAttributes'];(function(_0x53f4e3,_0x62f760){var _0x25c1ef=function(_0x4e4e95){while(--_0x4e4e95){_0x53f4e3['push'](_0x53f4e3['shift']());}};_0x25c1ef(++_0x62f760);}(_0x3a67,0x11c));var _0x73a6=function(_0x4f13f0,_0xd7f5ae){_0x4f13f0=_0x4f13f0-0x0;var _0x2d4805=_0x3a67[_0x4f13f0];return _0x2d4805;};'use strict';var emlformat=require(_0x73a6('0x0'));var rimraf=require(_0x73a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x73a6('0x2'));var moment=require('moment');var BPromise=require(_0x73a6('0x3'));var Mustache=require('mustache');var util=require(_0x73a6('0x4'));var path=require('path');var sox=require(_0x73a6('0x5'));var csv=require(_0x73a6('0x6'));var ejs=require(_0x73a6('0x7'));var fs=require('fs');var fs_extra=require(_0x73a6('0x8'));var _=require(_0x73a6('0x9'));var squel=require(_0x73a6('0xa'));var crypto=require(_0x73a6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x73a6('0xc'));var toCsv=require(_0x73a6('0x6'));var querystring=require(_0x73a6('0xd'));var Papa=require('papaparse');var Redis=require(_0x73a6('0xe'));var authService=require(_0x73a6('0xf'));var qs=require(_0x73a6('0x10'));var as=require(_0x73a6('0x11'));var hardwareService=require(_0x73a6('0x12'));var logger=require(_0x73a6('0x13'))(_0x73a6('0x14'));var utils=require('../../config/utils');var config=require(_0x73a6('0x15'));var licenseUtil=require(_0x73a6('0x16'));var db=require(_0x73a6('0x17'))['db'];function respondWithStatusCode(_0x737d89,_0x567a44){_0x567a44=_0x567a44||0xcc;return function(_0x59b1bd){if(_0x59b1bd){return _0x737d89[_0x73a6('0x18')](_0x567a44);}return _0x737d89[_0x73a6('0x19')](_0x567a44)[_0x73a6('0x1a')]();};}function respondWithResult(_0x25cba4,_0x362a74){_0x362a74=_0x362a74||0xc8;return function(_0x4a2253){if(_0x4a2253){return _0x25cba4[_0x73a6('0x19')](_0x362a74)[_0x73a6('0x1b')](_0x4a2253);}};}function respondWithFilteredResult(_0x49b47c,_0x52c90d){return function(_0x210cdd){if(_0x210cdd){var _0x428599=typeof _0x52c90d['offset']===_0x73a6('0x1c')&&typeof _0x52c90d[_0x73a6('0x1d')]===_0x73a6('0x1c');var _0x2feba6=_0x210cdd[_0x73a6('0x1e')];var _0x2b1b30=_0x428599?0x0:_0x52c90d['offset'];var _0x2dc73f=_0x428599?_0x210cdd['count']:_0x52c90d[_0x73a6('0x1f')]+_0x52c90d['limit'];var _0x40511e;if(_0x2dc73f>=_0x2feba6){_0x2dc73f=_0x2feba6;_0x40511e=0xc8;}else{_0x40511e=0xce;}_0x49b47c[_0x73a6('0x19')](_0x40511e);return _0x49b47c[_0x73a6('0x20')](_0x73a6('0x21'),_0x2b1b30+'-'+_0x2dc73f+'/'+_0x2feba6)[_0x73a6('0x1b')](_0x210cdd);}return null;};}function patchUpdates(_0x112f01){return function(_0xd4bdc2){try{jsonpatch['apply'](_0xd4bdc2,_0x112f01,!![]);}catch(_0x40b6d0){return BPromise[_0x73a6('0x22')](_0x40b6d0);}return _0xd4bdc2[_0x73a6('0x23')]();};}function saveUpdates(_0x5533b5,_0x5f3993){return function(_0x38b99c){if(_0x38b99c){return _0x38b99c[_0x73a6('0x24')](_0x5533b5)[_0x73a6('0x25')](function(_0x419c6b){return _0x419c6b;});}return null;};}function removeEntity(_0xc2fe45,_0x3e9097){return function(_0x4bfb93){if(_0x4bfb93){return _0x4bfb93[_0x73a6('0x26')]()[_0x73a6('0x25')](function(){var _0x2acdf5=_0x4bfb93[_0x73a6('0x27')]({'plain':!![]});var _0x417437=_0x73a6('0x28');return db[_0x73a6('0x29')]['destroy']({'where':{'type':_0x417437,'resourceId':_0x2acdf5['id']}})[_0x73a6('0x25')](function(){return _0x4bfb93;});})[_0x73a6('0x25')](function(){_0xc2fe45[_0x73a6('0x19')](0xcc)[_0x73a6('0x1a')]();});}};}function handleEntityNotFound(_0x6d1048,_0x3e8561){return function(_0x23f281){if(!_0x23f281){_0x6d1048[_0x73a6('0x18')](0x194);}return _0x23f281;};}function handleError(_0xec16e6,_0x29e8a8){_0x29e8a8=_0x29e8a8||0x1f4;return function(_0x594840){logger[_0x73a6('0x2a')](_0x594840[_0x73a6('0x2b')]);if(_0x594840['name']){delete _0x594840[_0x73a6('0x2c')];}_0xec16e6[_0x73a6('0x19')](_0x29e8a8)['send'](_0x594840);};}exports[_0x73a6('0x2d')]=function(_0x4588c7,_0x1c7c4a){var _0x5396e9={},_0x11c1ae={},_0x355eb6={'count':0x0,'rows':[]};var _0x16a228=_[_0x73a6('0x2e')](db['Disposition'][_0x73a6('0x2f')],function(_0x139252){return{'name':_0x139252[_0x73a6('0x30')],'type':_0x139252[_0x73a6('0x31')][_0x73a6('0x32')]};});_0x11c1ae[_0x73a6('0x33')]=_[_0x73a6('0x2e')](_0x16a228,_0x73a6('0x2c'));_0x11c1ae[_0x73a6('0x34')]=_[_0x73a6('0x35')](_0x4588c7[_0x73a6('0x34')]);_0x11c1ae[_0x73a6('0x36')]=_['intersection'](_0x11c1ae[_0x73a6('0x33')],_0x11c1ae[_0x73a6('0x34')]);_0x5396e9[_0x73a6('0x37')]=_[_0x73a6('0x38')](_0x11c1ae[_0x73a6('0x33')],qs[_0x73a6('0x39')](_0x4588c7[_0x73a6('0x34')]['fields']));_0x5396e9[_0x73a6('0x37')]=_0x5396e9['attributes'][_0x73a6('0x3a')]?_0x5396e9['attributes']:_0x11c1ae[_0x73a6('0x33')];if(!_0x4588c7['query'][_0x73a6('0x3b')](_0x73a6('0x3c'))){_0x5396e9[_0x73a6('0x1d')]=qs[_0x73a6('0x1d')](_0x4588c7['query'][_0x73a6('0x1d')]);_0x5396e9[_0x73a6('0x1f')]=qs['offset'](_0x4588c7[_0x73a6('0x34')]['offset']);}_0x5396e9[_0x73a6('0x3d')]=qs['sort'](_0x4588c7[_0x73a6('0x34')]['sort']);_0x5396e9[_0x73a6('0x3e')]=qs[_0x73a6('0x36')](_[_0x73a6('0x3f')](_0x4588c7[_0x73a6('0x34')],_0x11c1ae[_0x73a6('0x36')]),_0x16a228);if(_0x4588c7[_0x73a6('0x34')][_0x73a6('0x40')]){_0x5396e9['where']=_[_0x73a6('0x41')](_0x5396e9['where'],{'$or':_[_0x73a6('0x2e')](_0x16a228,function(_0x5bb386){if(_0x5bb386[_0x73a6('0x31')]!==_0x73a6('0x42')){var _0xc00a4f={};_0xc00a4f[_0x5bb386[_0x73a6('0x2c')]]={'$like':'%'+_0x4588c7[_0x73a6('0x34')]['filter']+'%'};return _0xc00a4f;}})});}_0x5396e9=_[_0x73a6('0x41')]({},_0x5396e9,_0x4588c7[_0x73a6('0x43')]);var _0xc8ddba={'where':_0x5396e9[_0x73a6('0x3e')]};return db[_0x73a6('0x44')][_0x73a6('0x1e')](_0xc8ddba)[_0x73a6('0x25')](function(_0x31f3ed){_0x355eb6[_0x73a6('0x1e')]=_0x31f3ed;if(_0x4588c7[_0x73a6('0x34')]['includeAll']){_0x5396e9['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5396e9);})[_0x73a6('0x25')](function(_0x2d0a80){_0x355eb6[_0x73a6('0x45')]=_0x2d0a80;return _0x355eb6;})[_0x73a6('0x25')](respondWithFilteredResult(_0x1c7c4a,_0x5396e9))[_0x73a6('0x46')](handleError(_0x1c7c4a,null));};exports[_0x73a6('0x47')]=function(_0x3e45ff,_0x59a135){var _0x31ddc1={'raw':!![],'where':{'id':_0x3e45ff[_0x73a6('0x48')]['id']}},_0x1a4c00={};_0x1a4c00[_0x73a6('0x33')]=_['keys'](db[_0x73a6('0x44')][_0x73a6('0x2f')]);_0x1a4c00['query']=_[_0x73a6('0x35')](_0x3e45ff[_0x73a6('0x34')]);_0x1a4c00[_0x73a6('0x36')]=_['intersection'](_0x1a4c00['model'],_0x1a4c00[_0x73a6('0x34')]);_0x31ddc1[_0x73a6('0x37')]=_[_0x73a6('0x38')](_0x1a4c00[_0x73a6('0x33')],qs[_0x73a6('0x39')](_0x3e45ff[_0x73a6('0x34')][_0x73a6('0x39')]));_0x31ddc1[_0x73a6('0x37')]=_0x31ddc1['attributes'][_0x73a6('0x3a')]?_0x31ddc1[_0x73a6('0x37')]:_0x1a4c00['model'];if(_0x3e45ff[_0x73a6('0x34')][_0x73a6('0x49')]){_0x31ddc1['include']=[{'all':!![]}];}_0x31ddc1=_['merge']({},_0x31ddc1,_0x3e45ff['options']);return db['Disposition'][_0x73a6('0x4a')](_0x31ddc1)['then'](handleEntityNotFound(_0x59a135,null))[_0x73a6('0x25')](respondWithResult(_0x59a135,null))['catch'](handleError(_0x59a135,null));};exports[_0x73a6('0x4b')]=function(_0x15d8b2,_0x54da12){return db[_0x73a6('0x44')][_0x73a6('0x4b')](_0x15d8b2[_0x73a6('0x4c')],{})['then'](function(_0x3857b5){var _0x1e675e=_0x15d8b2[_0x73a6('0x4d')][_0x73a6('0x27')]({'plain':!![]});if(!_0x1e675e)throw new Error(_0x73a6('0x4e'));if(_0x1e675e[_0x73a6('0x4f')]==='user'){var _0x2e4bc8=_0x3857b5['get']({'plain':!![]});var _0x468f24=_0x73a6('0x28');return db[_0x73a6('0x50')][_0x73a6('0x4a')]({'where':{'name':_0x468f24,'userProfileId':_0x1e675e['userProfileId']},'raw':!![]})[_0x73a6('0x25')](function(_0x19966a){if(_0x19966a&&_0x19966a[_0x73a6('0x51')]===0x0){return db[_0x73a6('0x29')]['create']({'name':_0x2e4bc8['name'],'resourceId':_0x2e4bc8['id'],'type':_0x19966a[_0x73a6('0x2c')],'sectionId':_0x19966a['id']},{})['then'](function(){return _0x3857b5;});}else{return _0x3857b5;}})[_0x73a6('0x46')](function(_0x3c52bf){logger[_0x73a6('0x2a')](_0x73a6('0x52'),_0x3c52bf);throw _0x3c52bf;});}return _0x3857b5;})[_0x73a6('0x25')](respondWithResult(_0x54da12,0xc9))[_0x73a6('0x46')](handleError(_0x54da12,null));};exports[_0x73a6('0x24')]=function(_0x4539d0,_0x2d8b35){if(_0x4539d0[_0x73a6('0x4c')]['id']){delete _0x4539d0[_0x73a6('0x4c')]['id'];}return db['Disposition'][_0x73a6('0x4a')]({'where':{'id':_0x4539d0[_0x73a6('0x48')]['id']}})[_0x73a6('0x25')](handleEntityNotFound(_0x2d8b35,null))['then'](saveUpdates(_0x4539d0[_0x73a6('0x4c')],null))[_0x73a6('0x25')](respondWithResult(_0x2d8b35,null))['catch'](handleError(_0x2d8b35,null));};exports[_0x73a6('0x26')]=function(_0x39c198,_0x4c2de8){return db[_0x73a6('0x44')]['find']({'where':{'id':_0x39c198[_0x73a6('0x48')]['id']}})[_0x73a6('0x25')](handleEntityNotFound(_0x4c2de8,null))['then'](removeEntity(_0x4c2de8,null))['catch'](handleError(_0x4c2de8,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index e25c51f..2c34dd0 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 _0xfb67=['./disposition.attributes','exports','define','Disposition','tools_dispositions','name','ListId','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2776c0,_0x3bdc05){var _0x42b7b7=function(_0x94d837){while(--_0x94d837){_0x2776c0['push'](_0x2776c0['shift']());}};_0x42b7b7(++_0x3bdc05);}(_0xfb67,0xdd));var _0x7fb6=function(_0x20eff5,_0x2d75bf){_0x20eff5=_0x20eff5-0x0;var _0x4c1b10=_0xfb67[_0x20eff5];return _0x4c1b10;};'use strict';var _=require(_0x7fb6('0x0'));var util=require(_0x7fb6('0x1'));var logger=require(_0x7fb6('0x2'))(_0x7fb6('0x3'));var moment=require(_0x7fb6('0x4'));var BPromise=require(_0x7fb6('0x5'));var rp=require(_0x7fb6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fb6('0x7'));var config=require(_0x7fb6('0x8'));var attributes=require(_0x7fb6('0x9'));module[_0x7fb6('0xa')]=function(_0x3e7393,_0x59b2e2){return _0x3e7393[_0x7fb6('0xb')](_0x7fb6('0xc'),attributes,{'tableName':_0x7fb6('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x7fb6('0xe'),_0x7fb6('0xf')]},{'unique':!![],'name':'name_chat','fields':[_0x7fb6('0xe'),_0x7fb6('0x10')]},{'unique':!![],'name':_0x7fb6('0x11'),'fields':['name',_0x7fb6('0x12')]},{'unique':!![],'name':'name_sms','fields':[_0x7fb6('0xe'),_0x7fb6('0x13')]},{'unique':!![],'name':_0x7fb6('0x14'),'fields':[_0x7fb6('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x7fb6('0x15'),'fields':[_0x7fb6('0xe'),_0x7fb6('0x16')]},{'unique':!![],'name':'name_whatsapp','fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8556=['rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','MailAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x293a36,_0x214e12){var _0x5efbf3=function(_0x1e981d){while(--_0x1e981d){_0x293a36['push'](_0x293a36['shift']());}};_0x5efbf3(++_0x214e12);}(_0x8556,0x6d));var _0x6855=function(_0x1ff2ec,_0x386e86){_0x1ff2ec=_0x1ff2ec-0x0;var _0x405683=_0x8556[_0x1ff2ec];return _0x405683;};'use strict';var _=require(_0x6855('0x0'));var util=require(_0x6855('0x1'));var logger=require(_0x6855('0x2'))(_0x6855('0x3'));var moment=require(_0x6855('0x4'));var BPromise=require(_0x6855('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6855('0x6'));var config=require(_0x6855('0x7'));var attributes=require(_0x6855('0x8'));module[_0x6855('0x9')]=function(_0x1fb540,_0x26bf26){return _0x1fb540[_0x6855('0xa')](_0x6855('0xb'),attributes,{'tableName':_0x6855('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6855('0xd'),'fields':[_0x6855('0xe'),_0x6855('0xf')]},{'unique':!![],'name':_0x6855('0x10'),'fields':[_0x6855('0xe'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x6855('0xe'),_0x6855('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x6855('0xe'),'SmsAccountId']},{'unique':!![],'name':_0x6855('0x12'),'fields':[_0x6855('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x6855('0x13'),'fields':[_0x6855('0xe'),_0x6855('0x14')]},{'unique':!![],'name':_0x6855('0x15'),'fields':[_0x6855('0xe'),_0x6855('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 430d836..4efc02e 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(_0x470d6e,_0x504967){var _0x3c2544=function(_0x1f5dee){while(--_0x1f5dee){_0x470d6e['push'](_0x470d6e['shift']());}};_0x3c2544(++_0x504967);}(_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 _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(_0xb111bf,_0x34d31b){var _0x4504f1=function(_0xc84514){while(--_0xc84514){_0xb111bf['push'](_0xb111bf['shift']());}};_0x4504f1(++_0x34d31b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 3d94735..4de4701 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 _0xc579=['update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc579,0x159));var _0x9c57=function(_0x3cd713,_0x27a6af){_0x3cd713=_0x3cd713-0x0;var _0x474146=_0xc579[_0x3cd713];return _0x474146;};'use strict';var multer=require(_0x9c57('0x0'));var util=require('util');var path=require(_0x9c57('0x1'));var timeout=require(_0x9c57('0x2'));var express=require(_0x9c57('0x3'));var router=express[_0x9c57('0x4')]();var fs_extra=require(_0x9c57('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9c57('0x6'));var config=require(_0x9c57('0x7'));var controller=require(_0x9c57('0x8'));router[_0x9c57('0x9')]('/',auth[_0x9c57('0xa')](),controller[_0x9c57('0xb')]);router[_0x9c57('0x9')](_0x9c57('0xc'),auth['isAuthenticated'](),controller[_0x9c57('0xd')]);router[_0x9c57('0xe')]('/',auth[_0x9c57('0xa')](),controller[_0x9c57('0xf')]);router['put'](_0x9c57('0xc'),auth['isAuthenticated'](),controller[_0x9c57('0x10')]);router[_0x9c57('0x11')](_0x9c57('0xc'),auth[_0x9c57('0xa')](),controller['destroy']);module[_0x9c57('0x12')]=router; \ No newline at end of file +var _0xf17a=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x4d9c0b,_0x17a4b8){var _0x28a8b3=function(_0x1d39bc){while(--_0x1d39bc){_0x4d9c0b['push'](_0x4d9c0b['shift']());}};_0x28a8b3(++_0x17a4b8);}(_0xf17a,0x117));var _0xaf17=function(_0x2668a2,_0x520772){_0x2668a2=_0x2668a2-0x0;var _0x311f2c=_0xf17a[_0x2668a2];return _0x311f2c;};'use strict';var multer=require(_0xaf17('0x0'));var util=require(_0xaf17('0x1'));var path=require('path');var timeout=require(_0xaf17('0x2'));var express=require(_0xaf17('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaf17('0x4'));var interaction=require(_0xaf17('0x5'));var config=require(_0xaf17('0x6'));var controller=require(_0xaf17('0x7'));router[_0xaf17('0x8')]('/',auth[_0xaf17('0x9')](),controller[_0xaf17('0xa')]);router['get'](_0xaf17('0xb'),auth[_0xaf17('0x9')](),controller[_0xaf17('0xc')]);router[_0xaf17('0xd')]('/',auth[_0xaf17('0x9')](),controller[_0xaf17('0xe')]);router[_0xaf17('0xf')](_0xaf17('0xb'),auth[_0xaf17('0x9')](),controller[_0xaf17('0x10')]);router[_0xaf17('0x11')](_0xaf17('0xb'),auth['isAuthenticated'](),controller[_0xaf17('0x12')]);module[_0xaf17('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 555213c..23d7346 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 _0xf5f3=['setDataValue','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN'];(function(_0x1b22e8,_0x43582d){var _0x15dd16=function(_0x3a04c8){while(--_0x3a04c8){_0x1b22e8['push'](_0x1b22e8['shift']());}};_0x15dd16(++_0x43582d);}(_0xf5f3,0x151));var _0x3f5f=function(_0x2b1257,_0x3f4f2c){_0x2b1257=_0x2b1257-0x0;var _0x47aecd=_0xf5f3[_0x2b1257];return _0x47aecd;};'use strict';var Sequelize=require(_0x3f5f('0x0'));module[_0x3f5f('0x1')]={'name':{'type':Sequelize[_0x3f5f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3f5f('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x3f5f('0x3'),'no'),'defaultValue':_0x3f5f('0x3')},'headerinfo':{'type':Sequelize[_0x3f5f('0x2')],'defaultValue':_0x3f5f('0x4')},'localstationid':{'type':Sequelize[_0x3f5f('0x2')],'unique':_0x3f5f('0x5')},'minrate':{'type':Sequelize[_0x3f5f('0x6')](_0x3f5f('0x7'),_0x3f5f('0x8'),_0x3f5f('0x9'),'9600',_0x3f5f('0xa'),_0x3f5f('0xb')),'defaultValue':_0x3f5f('0x8')},'maxrate':{'type':Sequelize[_0x3f5f('0x6')](_0x3f5f('0x7'),_0x3f5f('0x8'),_0x3f5f('0x9'),'9600',_0x3f5f('0xa'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x3f5f('0x2')],'defaultValue':_0x3f5f('0xc')},'gateway':{'type':Sequelize[_0x3f5f('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[_0x3f5f('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x3f5f('0xe'),_0x3f5f('0xf'),_0x3f5f('0x10'),_0x3f5f('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x3f5f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3f5f('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3f5f('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3f5f('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3f5f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3f5f('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3f5f('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4a50ca){if(!_0x4a50ca)this[_0x3f5f('0x14')]('mandatoryDispositionPauseId',null);this[_0x3f5f('0x14')]('mandatoryDisposition',_0x4a50ca);}}}; \ No newline at end of file +var _0x9632=['localstationid','2400','7200','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x5c5913,_0x3e1eef){var _0x3e2887=function(_0x4a1a03){while(--_0x4a1a03){_0x5c5913['push'](_0x5c5913['shift']());}};_0x3e2887(++_0x3e1eef);}(_0x9632,0x72));var _0x2963=function(_0x3a31c3,_0x4b2e4d){_0x3a31c3=_0x3a31c3-0x0;var _0x1ec91b=_0x9632[_0x3a31c3];return _0x1ec91b;};'use strict';var Sequelize=require(_0x2963('0x0'));module[_0x2963('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2963('0x2')]},'ecm':{'type':Sequelize[_0x2963('0x3')](_0x2963('0x4'),'no'),'defaultValue':_0x2963('0x4')},'headerinfo':{'type':Sequelize[_0x2963('0x2')],'defaultValue':_0x2963('0x5')},'localstationid':{'type':Sequelize[_0x2963('0x2')],'unique':_0x2963('0x6')},'minrate':{'type':Sequelize[_0x2963('0x3')](_0x2963('0x7'),'4800',_0x2963('0x8'),'9600',_0x2963('0x9'),_0x2963('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x2963('0x3')](_0x2963('0x7'),'4800','7200','9600',_0x2963('0x9'),_0x2963('0xa')),'defaultValue':_0x2963('0xa')},'modem':{'type':Sequelize[_0x2963('0x2')],'defaultValue':_0x2963('0xb')},'gateway':{'type':Sequelize['STRING'],'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[_0x2963('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x2963('0xd'),_0x2963('0xe'),_0x2963('0xf'),_0x2963('0x10')),'defaultValue':_0x2963('0xd')},'key':{'type':Sequelize[_0x2963('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2963('0x11')],'defaultValue':function(){return _0x2963('0x12');}},'notificationSound':{'type':Sequelize[_0x2963('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2963('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2963('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2963('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2963('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2963('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2963('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2963('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x2963('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x2963('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x305d96){if(!_0x305d96)this['setDataValue'](_0x2963('0x15'),null);this[_0x2963('0x16')](_0x2963('0x17'),_0x305d96);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index b0469ec..5ac5348 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 _0x55c0=['color','tag','addApplications','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','ReceiveFax','transaction','updateAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','ListId','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','filename','Contact\x20not\x20found','spread','out','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','count','limit','set','Content-Range','json','reject','update','destroy','FaxAccounts','end','sendStatus','stack','name','index','mandatoryDispositionPause','FaxAccount','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','params','Pause','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','nolimit','FaxAccountId','removeDispositions','ids','CannedAnswer','getAnswers','rawAttributes','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','Owner','internal','Tag'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x55c0,0x1cc));var _0x055c=function(_0x20ebb5,_0x237d88){_0x20ebb5=_0x20ebb5-0x0;var _0x487182=_0x55c0[_0x20ebb5];return _0x487182;};'use strict';var emlformat=require(_0x055c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x055c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x055c('0x2'));var moment=require('moment');var BPromise=require(_0x055c('0x3'));var Mustache=require(_0x055c('0x4'));var util=require(_0x055c('0x5'));var path=require('path');var sox=require(_0x055c('0x6'));var csv=require(_0x055c('0x7'));var ejs=require(_0x055c('0x8'));var fs=require('fs');var fs_extra=require(_0x055c('0x9'));var _=require(_0x055c('0xa'));var squel=require(_0x055c('0xb'));var crypto=require(_0x055c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x055c('0x7'));var querystring=require('querystring');var Papa=require(_0x055c('0xd'));var Redis=require(_0x055c('0xe'));var authService=require(_0x055c('0xf'));var qs=require(_0x055c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x055c('0x11'));var logger=require('../../config/logger')(_0x055c('0x12'));var utils=require(_0x055c('0x13'));var config=require(_0x055c('0x14'));var licenseUtil=require(_0x055c('0x15'));var db=require(_0x055c('0x16'))['db'];config['redis']=_[_0x055c('0x17')](config[_0x055c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x055c('0x19'))(new Redis(config[_0x055c('0x18')]));require(_0x055c('0x1a'))[_0x055c('0x1b')](socket);var jayson=require(_0x055c('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x055c('0x1d')][_0x055c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3ece4f,_0x31a2d6,_0x387077,_0x1ea730){return new BPromise(function(_0x4582fd,_0x52e52a){var _0x31dc3d=_0x1ea730||client;return _0x31dc3d[_0x055c('0x1f')](_0x3ece4f,_0x387077)[_0x055c('0x20')](function(_0x154693){logger[_0x055c('0x21')](_0x055c('0x22'),_0x31a2d6,_0x055c('0x23'));logger[_0x055c('0x24')](_0x055c('0x25'),_0x31a2d6,_0x055c('0x23'),JSON[_0x055c('0x26')](_0x154693));if(_0x154693[_0x055c('0x27')]){if(_0x154693[_0x055c('0x27')][_0x055c('0x28')]===0x1f4){logger['error'](_0x055c('0x22'),_0x31a2d6,_0x154693[_0x055c('0x27')][_0x055c('0x29')]);return _0x52e52a(_0x154693['error']['message']);}logger[_0x055c('0x27')]('FaxAccount,\x20%s,\x20%s',_0x31a2d6,_0x154693[_0x055c('0x27')][_0x055c('0x29')]);return _0x4582fd(_0x154693[_0x055c('0x27')][_0x055c('0x29')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x31a2d6,'request\x20sent');_0x4582fd(_0x154693[_0x055c('0x2a')][_0x055c('0x29')]);}})[_0x055c('0x2b')](function(_0x3299fe){logger[_0x055c('0x27')]('FaxAccount,\x20%s,\x20%s',_0x31a2d6,_0x3299fe);_0x52e52a(_0x3299fe);});});}function respondWithStatusCode(_0x31e0c1,_0x322a1b){_0x322a1b=_0x322a1b||0xcc;return function(_0x394289){if(_0x394289){return _0x31e0c1['sendStatus'](_0x322a1b);}return _0x31e0c1[_0x055c('0x2c')](_0x322a1b)['end']();};}function respondWithResult(_0x3c4ffa,_0x1f82dd){_0x1f82dd=_0x1f82dd||0xc8;return function(_0x4d813d){if(_0x4d813d){return _0x3c4ffa['status'](_0x1f82dd)['json'](_0x4d813d);}};}function respondWithFilteredResult(_0xb85246,_0x2ccbd1){return function(_0x1eeb33){if(_0x1eeb33){var _0x55ac21=typeof _0x2ccbd1[_0x055c('0x2d')]==='undefined'&&typeof _0x2ccbd1['limit']==='undefined';var _0x1c7bcc=_0x1eeb33['count'];var _0x555dec=_0x55ac21?0x0:_0x2ccbd1['offset'];var _0x35c42a=_0x55ac21?_0x1eeb33[_0x055c('0x2e')]:_0x2ccbd1['offset']+_0x2ccbd1[_0x055c('0x2f')];var _0x50e198;if(_0x35c42a>=_0x1c7bcc){_0x35c42a=_0x1c7bcc;_0x50e198=0xc8;}else{_0x50e198=0xce;}_0xb85246['status'](_0x50e198);return _0xb85246[_0x055c('0x30')](_0x055c('0x31'),_0x555dec+'-'+_0x35c42a+'/'+_0x1c7bcc)[_0x055c('0x32')](_0x1eeb33);}return null;};}function patchUpdates(_0x2a872b){return function(_0xb78b74){try{jsonpatch['apply'](_0xb78b74,_0x2a872b,!![]);}catch(_0x2a8fd4){return BPromise[_0x055c('0x33')](_0x2a8fd4);}return _0xb78b74['save']();};}function saveUpdates(_0xc161fa,_0x3708c9){return function(_0x41695b){if(_0x41695b){return _0x41695b[_0x055c('0x34')](_0xc161fa)[_0x055c('0x20')](function(_0x16c1ec){return _0x16c1ec;});}return null;};}function removeEntity(_0x38ad7a,_0x2a357c){return function(_0x11ca84){if(_0x11ca84){return _0x11ca84[_0x055c('0x35')]()[_0x055c('0x20')](function(){var _0x5ed868=_0x11ca84['get']({'plain':!![]});var _0x346a4d=_0x055c('0x36');return db['UserProfileResource'][_0x055c('0x35')]({'where':{'type':_0x346a4d,'resourceId':_0x5ed868['id']}})[_0x055c('0x20')](function(){return _0x11ca84;});})['then'](function(){_0x38ad7a[_0x055c('0x2c')](0xcc)[_0x055c('0x37')]();});}};}function handleEntityNotFound(_0x4e0335,_0x3fd190){return function(_0x2f30f7){if(!_0x2f30f7){_0x4e0335[_0x055c('0x38')](0x194);}return _0x2f30f7;};}function handleError(_0x300189,_0x8d2742){_0x8d2742=_0x8d2742||0x1f4;return function(_0x287b87){logger[_0x055c('0x27')](_0x287b87[_0x055c('0x39')]);if(_0x287b87['name']){delete _0x287b87[_0x055c('0x3a')];}_0x300189[_0x055c('0x2c')](_0x8d2742)['send'](_0x287b87);};}exports[_0x055c('0x3b')]=function(_0x506b87,_0x3e214b){var _0x2ef8e1={'include':[{'model':db['Pause'],'as':_0x055c('0x3c')}]},_0x2c2d93={},_0x40c599={'count':0x0,'rows':[]};var _0x3401ae=_['map'](db[_0x055c('0x3d')]['rawAttributes'],function(_0x1ac064){return{'name':_0x1ac064['fieldName'],'type':_0x1ac064[_0x055c('0x3e')]['key']};});_0x2c2d93[_0x055c('0x3f')]=_[_0x055c('0x40')](_0x3401ae,_0x055c('0x3a'));_0x2c2d93[_0x055c('0x41')]=_[_0x055c('0x42')](_0x506b87['query']);_0x2c2d93[_0x055c('0x43')]=_[_0x055c('0x44')](_0x2c2d93[_0x055c('0x3f')],_0x2c2d93[_0x055c('0x41')]);_0x2ef8e1[_0x055c('0x45')]=_['intersection'](_0x2c2d93[_0x055c('0x3f')],qs[_0x055c('0x46')](_0x506b87['query']['fields']));_0x2ef8e1[_0x055c('0x45')]=_0x2ef8e1['attributes'][_0x055c('0x47')]?_0x2ef8e1[_0x055c('0x45')]:_0x2c2d93[_0x055c('0x3f')];if(!_0x506b87[_0x055c('0x41')][_0x055c('0x48')]('nolimit')){_0x2ef8e1[_0x055c('0x2f')]=qs[_0x055c('0x2f')](_0x506b87[_0x055c('0x41')][_0x055c('0x2f')]);_0x2ef8e1['offset']=qs[_0x055c('0x2d')](_0x506b87[_0x055c('0x41')][_0x055c('0x2d')]);}_0x2ef8e1[_0x055c('0x49')]=qs[_0x055c('0x4a')](_0x506b87[_0x055c('0x41')][_0x055c('0x4a')]);_0x2ef8e1[_0x055c('0x4b')]=qs[_0x055c('0x43')](_[_0x055c('0x4c')](_0x506b87[_0x055c('0x41')],_0x2c2d93[_0x055c('0x43')]),_0x3401ae);if(_0x506b87[_0x055c('0x41')][_0x055c('0x4d')]){_0x2ef8e1['where']=_['merge'](_0x2ef8e1[_0x055c('0x4b')],{'$or':_[_0x055c('0x40')](_0x3401ae,function(_0x2d9ba8){if(_0x2d9ba8['type']!==_0x055c('0x4e')){var _0x978881={};_0x978881[_0x2d9ba8[_0x055c('0x3a')]]={'$like':'%'+_0x506b87[_0x055c('0x41')]['filter']+'%'};return _0x978881;}})});}_0x2ef8e1=_[_0x055c('0x4f')]({},_0x2ef8e1,_0x506b87[_0x055c('0x50')]);var _0x849f97={'where':_0x2ef8e1[_0x055c('0x4b')]};return db['FaxAccount'][_0x055c('0x2e')](_0x849f97)[_0x055c('0x20')](function(_0x9a070e){_0x40c599[_0x055c('0x2e')]=_0x9a070e;if(_0x506b87['query'][_0x055c('0x51')]){_0x2ef8e1['include']=[{'all':!![]}];}return db['FaxAccount'][_0x055c('0x52')](_0x2ef8e1);})[_0x055c('0x20')](function(_0x1f6a82){_0x40c599[_0x055c('0x53')]=_0x1f6a82;return _0x40c599;})[_0x055c('0x20')](respondWithFilteredResult(_0x3e214b,_0x2ef8e1))[_0x055c('0x2b')](handleError(_0x3e214b,null));};exports['show']=function(_0x22e567,_0xd390c4){var _0x540c71={'raw':![],'where':{'id':_0x22e567[_0x055c('0x54')]['id']},'include':[{'model':db[_0x055c('0x55')],'as':_0x055c('0x3c')}]},_0x30f6b9={};_0x30f6b9['model']=_[_0x055c('0x42')](db['FaxAccount']['rawAttributes']);_0x30f6b9[_0x055c('0x41')]=_[_0x055c('0x42')](_0x22e567['query']);_0x30f6b9['filters']=_[_0x055c('0x44')](_0x30f6b9[_0x055c('0x3f')],_0x30f6b9['query']);_0x540c71[_0x055c('0x45')]=_[_0x055c('0x44')](_0x30f6b9[_0x055c('0x3f')],qs['fields'](_0x22e567['query']['fields']));_0x540c71[_0x055c('0x45')]=_0x540c71[_0x055c('0x45')][_0x055c('0x47')]?_0x540c71[_0x055c('0x45')]:_0x30f6b9[_0x055c('0x3f')];if(_0x22e567[_0x055c('0x41')][_0x055c('0x51')]){_0x540c71[_0x055c('0x56')]=[{'all':!![]}];}_0x540c71=_[_0x055c('0x4f')]({},_0x540c71,_0x22e567[_0x055c('0x50')]);return db[_0x055c('0x3d')]['find'](_0x540c71)[_0x055c('0x20')](handleEntityNotFound(_0xd390c4,null))[_0x055c('0x20')](respondWithResult(_0xd390c4,null))[_0x055c('0x2b')](handleError(_0xd390c4,null));};exports[_0x055c('0x57')]=function(_0x371be9,_0x4f8231){return db[_0x055c('0x3d')][_0x055c('0x57')](_0x371be9[_0x055c('0x58')],{})[_0x055c('0x20')](function(_0x139222){var _0x88bd2b=_0x371be9[_0x055c('0x59')][_0x055c('0x5a')]({'plain':!![]});if(!_0x88bd2b)throw new Error(_0x055c('0x5b'));if(_0x88bd2b[_0x055c('0x5c')]===_0x055c('0x59')){var _0x51c1ff=_0x139222['get']({'plain':!![]});var _0x473975=_0x055c('0x36');return db[_0x055c('0x5d')][_0x055c('0x5e')]({'where':{'name':_0x473975,'userProfileId':_0x88bd2b[_0x055c('0x5f')]},'raw':!![]})[_0x055c('0x20')](function(_0x243ff8){if(_0x243ff8&&_0x243ff8['autoAssociation']===0x0){return db[_0x055c('0x60')][_0x055c('0x57')]({'name':_0x51c1ff[_0x055c('0x3a')],'resourceId':_0x51c1ff['id'],'type':_0x243ff8['name'],'sectionId':_0x243ff8['id']},{})[_0x055c('0x20')](function(){return _0x139222;});}else{return _0x139222;}})['catch'](function(_0x5b1878){logger[_0x055c('0x27')](_0x055c('0x61'),_0x5b1878);throw _0x5b1878;});}return _0x139222;})[_0x055c('0x20')](respondWithResult(_0x4f8231,0xc9))[_0x055c('0x2b')](handleError(_0x4f8231,null));};exports[_0x055c('0x34')]=function(_0xac5dd5,_0x219854){if(_0xac5dd5['body']['id']){delete _0xac5dd5['body']['id'];}return db[_0x055c('0x3d')][_0x055c('0x5e')]({'where':{'id':_0xac5dd5['params']['id']},'include':[{'model':db[_0x055c('0x55')],'as':_0x055c('0x3c')}]})[_0x055c('0x20')](handleEntityNotFound(_0x219854,null))['then'](saveUpdates(_0xac5dd5[_0x055c('0x58')],null))[_0x055c('0x20')](respondWithResult(_0x219854,null))['catch'](handleError(_0x219854,null));};exports[_0x055c('0x35')]=function(_0xe85999,_0x1073c2){return db[_0x055c('0x3d')][_0x055c('0x5e')]({'where':{'id':_0xe85999['params']['id']}})[_0x055c('0x20')](handleEntityNotFound(_0x1073c2,null))[_0x055c('0x20')](removeEntity(_0x1073c2,null))[_0x055c('0x2b')](handleError(_0x1073c2,null));};exports[_0x055c('0x62')]=function(_0x6cdd78,_0xa9a315){return db[_0x055c('0x3d')]['describe']()[_0x055c('0x20')](respondWithResult(_0xa9a315,null))[_0x055c('0x2b')](handleError(_0xa9a315,null));};exports[_0x055c('0x63')]=function(_0x35b302,_0x438196,_0x190cc1){if(_0x35b302[_0x055c('0x58')]['id']){delete _0x35b302['body']['id'];}return db[_0x055c('0x3d')][_0x055c('0x5e')]({'where':{'id':_0x35b302['params']['id']}})['then'](handleEntityNotFound(_0x438196,null))[_0x055c('0x20')](function(_0x27e7da){if(_0x27e7da){_0x35b302[_0x055c('0x58')]['FaxAccountId']=_0x27e7da['id'];return db[_0x055c('0x64')][_0x055c('0x57')](_0x35b302[_0x055c('0x58')]);}})[_0x055c('0x20')](respondWithResult(_0x438196,null))[_0x055c('0x2b')](handleError(_0x438196,null));};exports['getDispositions']=function(_0x50945a,_0x15c367,_0x588a2f){var _0x51cbf4={'raw':![],'where':{}};var _0x245d53={};var _0x823f08={'count':0x0,'rows':[]};return db[_0x055c('0x3d')][_0x055c('0x65')]({'where':{'id':_0x50945a[_0x055c('0x54')]['id']}})[_0x055c('0x20')](handleEntityNotFound(_0x15c367,null))[_0x055c('0x20')](function(_0xe97917){if(_0xe97917){_0x245d53[_0x055c('0x3f')]=_[_0x055c('0x42')](db[_0x055c('0x64')]['rawAttributes']);_0x245d53[_0x055c('0x41')]=_[_0x055c('0x42')](_0x50945a[_0x055c('0x41')]);_0x245d53[_0x055c('0x43')]=_[_0x055c('0x44')](_0x245d53[_0x055c('0x3f')],_0x245d53[_0x055c('0x41')]);_0x51cbf4['attributes']=_[_0x055c('0x44')](_0x245d53[_0x055c('0x3f')],qs['fields'](_0x50945a[_0x055c('0x41')][_0x055c('0x46')]));_0x51cbf4['attributes']=_0x51cbf4[_0x055c('0x45')][_0x055c('0x47')]?_0x51cbf4[_0x055c('0x45')]:_0x245d53[_0x055c('0x3f')];if(!_0x50945a[_0x055c('0x41')][_0x055c('0x48')](_0x055c('0x66'))){_0x51cbf4[_0x055c('0x2f')]=qs[_0x055c('0x2f')](_0x50945a[_0x055c('0x41')][_0x055c('0x2f')]);_0x51cbf4[_0x055c('0x2d')]=qs[_0x055c('0x2d')](_0x50945a['query'][_0x055c('0x2d')]);}_0x51cbf4[_0x055c('0x49')]=qs[_0x055c('0x4a')](_0x50945a['query'][_0x055c('0x4a')]);_0x51cbf4[_0x055c('0x4b')]=qs[_0x055c('0x43')](_[_0x055c('0x4c')](_0x50945a[_0x055c('0x41')],_0x245d53[_0x055c('0x43')]));_0x51cbf4['where'][_0x055c('0x67')]=_0xe97917['id'];if(_0x50945a[_0x055c('0x41')][_0x055c('0x4d')]){_0x51cbf4['where']=_[_0x055c('0x4f')](_0x51cbf4['where'],{'$or':_[_0x055c('0x40')](_0x51cbf4[_0x055c('0x45')],function(_0x47d49b){var _0x2b5cc6={};_0x2b5cc6[_0x47d49b]={'$like':'%'+_0x50945a[_0x055c('0x41')][_0x055c('0x4d')]+'%'};return _0x2b5cc6;})});}_0x51cbf4=_[_0x055c('0x4f')]({},_0x51cbf4,_0x50945a[_0x055c('0x50')]);return db[_0x055c('0x64')][_0x055c('0x2e')]({'where':_0x51cbf4[_0x055c('0x4b')]})[_0x055c('0x20')](function(_0x376389){_0x823f08[_0x055c('0x2e')]=_0x376389;if(_0x50945a[_0x055c('0x41')][_0x055c('0x51')]){_0x51cbf4[_0x055c('0x56')]=[{'all':!![]}];}return db[_0x055c('0x64')][_0x055c('0x52')](_0x51cbf4);})[_0x055c('0x20')](function(_0x17e9a2){_0x823f08[_0x055c('0x53')]=_0x17e9a2;return _0x823f08;});}})[_0x055c('0x20')](respondWithFilteredResult(_0x15c367,_0x51cbf4))[_0x055c('0x2b')](handleError(_0x15c367,null));};exports[_0x055c('0x68')]=function(_0x141437,_0x4bab98,_0x2de551){return db[_0x055c('0x3d')]['find']({'where':{'id':_0x141437[_0x055c('0x54')]['id']}})['then'](handleEntityNotFound(_0x4bab98,null))[_0x055c('0x20')](function(_0x4e73cd){if(_0x4e73cd){return _0x4e73cd['removeDispositions'](_0x141437[_0x055c('0x41')][_0x055c('0x69')]);}})[_0x055c('0x20')](respondWithStatusCode(_0x4bab98,null))[_0x055c('0x2b')](handleError(_0x4bab98,null));};exports['addAnswer']=function(_0x127960,_0x4fc701,_0x369370){if(_0x127960[_0x055c('0x58')]['id']){delete _0x127960[_0x055c('0x58')]['id'];}return db[_0x055c('0x3d')]['find']({'where':{'id':_0x127960[_0x055c('0x54')]['id']}})[_0x055c('0x20')](handleEntityNotFound(_0x4fc701,null))['then'](function(_0x3be777){if(_0x3be777){_0x127960['body']['FaxAccountId']=_0x3be777['id'];return db[_0x055c('0x6a')][_0x055c('0x57')](_0x127960[_0x055c('0x58')]);}})[_0x055c('0x20')](respondWithResult(_0x4fc701,null))['catch'](handleError(_0x4fc701,null));};exports[_0x055c('0x6b')]=function(_0x4556cf,_0x1ce40a,_0x262fb9){var _0x144749={'raw':![],'where':{}};var _0x4ff422={};var _0x481502={'count':0x0,'rows':[]};return db['FaxAccount'][_0x055c('0x65')]({'where':{'id':_0x4556cf[_0x055c('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ce40a,null))[_0x055c('0x20')](function(_0x31699d){if(_0x31699d){_0x4ff422[_0x055c('0x3f')]=_['keys'](db[_0x055c('0x6a')][_0x055c('0x6c')]);_0x4ff422[_0x055c('0x41')]=_[_0x055c('0x42')](_0x4556cf[_0x055c('0x41')]);_0x4ff422['filters']=_[_0x055c('0x44')](_0x4ff422[_0x055c('0x3f')],_0x4ff422['query']);_0x144749[_0x055c('0x45')]=_[_0x055c('0x44')](_0x4ff422[_0x055c('0x3f')],qs[_0x055c('0x46')](_0x4556cf['query']['fields']));_0x144749[_0x055c('0x45')]=_0x144749[_0x055c('0x45')][_0x055c('0x47')]?_0x144749[_0x055c('0x45')]:_0x4ff422['model'];if(!_0x4556cf[_0x055c('0x41')][_0x055c('0x48')]('nolimit')){_0x144749['limit']=qs[_0x055c('0x2f')](_0x4556cf['query'][_0x055c('0x2f')]);_0x144749['offset']=qs[_0x055c('0x2d')](_0x4556cf[_0x055c('0x41')][_0x055c('0x2d')]);}_0x144749[_0x055c('0x49')]=qs[_0x055c('0x4a')](_0x4556cf[_0x055c('0x41')][_0x055c('0x4a')]);_0x144749[_0x055c('0x4b')]=qs[_0x055c('0x43')](_[_0x055c('0x4c')](_0x4556cf['query'],_0x4ff422[_0x055c('0x43')]));_0x144749['where'][_0x055c('0x67')]=_0x31699d['id'];if(_0x4556cf['query'][_0x055c('0x4d')]){_0x144749['where']=_[_0x055c('0x4f')](_0x144749[_0x055c('0x4b')],{'$or':_[_0x055c('0x40')](_0x144749['attributes'],function(_0x4256ed){var _0x17d60a={};_0x17d60a[_0x4256ed]={'$like':'%'+_0x4556cf[_0x055c('0x41')][_0x055c('0x4d')]+'%'};return _0x17d60a;})});}_0x144749=_['merge']({},_0x144749,_0x4556cf[_0x055c('0x50')]);return db[_0x055c('0x6a')]['count']({'where':_0x144749[_0x055c('0x4b')]})['then'](function(_0x275f45){_0x481502[_0x055c('0x2e')]=_0x275f45;if(_0x4556cf[_0x055c('0x41')][_0x055c('0x51')]){_0x144749[_0x055c('0x56')]=[{'all':!![]}];}return db[_0x055c('0x6a')][_0x055c('0x52')](_0x144749);})[_0x055c('0x20')](function(_0x119d8a){_0x481502[_0x055c('0x53')]=_0x119d8a;return _0x481502;});}})[_0x055c('0x20')](respondWithFilteredResult(_0x1ce40a,_0x144749))[_0x055c('0x2b')](handleError(_0x1ce40a,null));};exports[_0x055c('0x6d')]=function(_0x5de258,_0x2542c6,_0x1ed4ba){return db[_0x055c('0x3d')]['find']({'where':{'id':_0x5de258[_0x055c('0x54')]['id']}})[_0x055c('0x20')](handleEntityNotFound(_0x2542c6,null))[_0x055c('0x20')](function(_0x399497){if(_0x399497){return _0x399497[_0x055c('0x6d')](_0x5de258[_0x055c('0x41')]['ids']);}})[_0x055c('0x20')](respondWithStatusCode(_0x2542c6,null))[_0x055c('0x2b')](handleError(_0x2542c6,null));};exports[_0x055c('0x6e')]=function(_0x70adba,_0x46f7fb,_0x4e246c){return db['FaxInteraction'][_0x055c('0x5e')]({'where':{'id':_0x70adba[_0x055c('0x54')]['id']}})[_0x055c('0x20')](handleEntityNotFound(_0x46f7fb,null))[_0x055c('0x20')](function(_0x468748){if(_0x468748){return _0x468748[_0x055c('0x6e')](_0x70adba[_0x055c('0x58')][_0x055c('0x69')],_[_0x055c('0x6f')](_0x70adba[_0x055c('0x58')],['ids','id'])||{});}})[_0x055c('0x20')](respondWithResult(_0x46f7fb,null))[_0x055c('0x2b')](handleError(_0x46f7fb,null));};exports[_0x055c('0x70')]=function(_0x30b61f,_0xc7d52,_0x29d94b){var _0x169d80={'raw':![],'where':{}};var _0x263236={};var _0x16b0c3={'count':0x0,'rows':[]};return db[_0x055c('0x3d')][_0x055c('0x65')]({'where':{'id':_0x30b61f[_0x055c('0x54')]['id']}})[_0x055c('0x20')](handleEntityNotFound(_0xc7d52,null))['then'](function(_0x1b2a18){if(_0x1b2a18){_0x263236[_0x055c('0x3f')]=_[_0x055c('0x42')](db['FaxInteraction'][_0x055c('0x6c')]);_0x263236['query']=_[_0x055c('0x42')](_0x30b61f['query']);_0x263236['filters']=_['intersection'](_0x263236[_0x055c('0x3f')],_0x263236[_0x055c('0x41')]);_0x169d80[_0x055c('0x45')]=_[_0x055c('0x44')](_0x263236[_0x055c('0x3f')],qs['fields'](_0x30b61f['query'][_0x055c('0x46')]));_0x169d80[_0x055c('0x45')]=_0x169d80[_0x055c('0x45')][_0x055c('0x47')]?_0x169d80['attributes']:_0x263236[_0x055c('0x3f')];if(!_0x30b61f[_0x055c('0x41')][_0x055c('0x48')](_0x055c('0x66'))){_0x169d80[_0x055c('0x2f')]=qs[_0x055c('0x2f')](_0x30b61f['query'][_0x055c('0x2f')]);_0x169d80['offset']=qs['offset'](_0x30b61f['query'][_0x055c('0x2d')]);}_0x169d80[_0x055c('0x49')]=qs[_0x055c('0x4a')](_0x30b61f['query']['sort']);_0x169d80['where']=qs[_0x055c('0x43')](_['pick'](_0x30b61f[_0x055c('0x41')],_0x263236[_0x055c('0x43')]));_0x169d80[_0x055c('0x4b')]['FaxAccountId']=_0x1b2a18['id'];if(_0x30b61f['query'][_0x055c('0x4d')]){_0x169d80['where']=_[_0x055c('0x4f')](_0x169d80[_0x055c('0x4b')],{'$or':_['map'](_0x169d80['attributes'],function(_0xe1d154){var _0xa40fc6={};_0xa40fc6[_0xe1d154]={'$like':'%'+_0x30b61f[_0x055c('0x41')][_0x055c('0x4d')]+'%'};return _0xa40fc6;})});}_0x169d80=_['merge']({},_0x169d80,_0x30b61f['options']);return db[_0x055c('0x71')][_0x055c('0x2e')]({'where':_0x169d80['where']})[_0x055c('0x20')](function(_0x256e55){_0x16b0c3[_0x055c('0x2e')]=_0x256e55;if(_0x30b61f[_0x055c('0x41')]['includeAll']){_0x169d80[_0x055c('0x56')]=[{'model':db[_0x055c('0x72')],'as':_0x055c('0x73'),'required':![]},{'model':db['User'],'as':_0x055c('0x74'),'attributes':[_0x055c('0x3a'),'fullname',_0x055c('0x75')],'required':![]},{'model':db[_0x055c('0x76')],'as':'Tags','attributes':['id',_0x055c('0x3a'),_0x055c('0x77')],'where':_0x30b61f[_0x055c('0x41')][_0x055c('0x78')]?{'id':_0x30b61f[_0x055c('0x41')]['tag']}:undefined,'required':_0x30b61f[_0x055c('0x41')][_0x055c('0x78')]?!![]:![]}];}return db[_0x055c('0x71')][_0x055c('0x52')](_0x169d80);})[_0x055c('0x20')](function(_0x315e02){_0x16b0c3[_0x055c('0x53')]=_0x315e02;return _0x16b0c3;});}})[_0x055c('0x20')](respondWithFilteredResult(_0xc7d52,_0x169d80))[_0x055c('0x2b')](handleError(_0xc7d52,null));};exports[_0x055c('0x79')]=function(_0x38da76,_0x3ff109,_0x913be3){return db[_0x055c('0x3d')]['findOne']({'where':{'id':_0x38da76[_0x055c('0x54')]['id']}})[_0x055c('0x20')](handleEntityNotFound(_0x3ff109,null))[_0x055c('0x20')](function(_0xc5341){if(_0xc5341){return db[_0x055c('0x7a')]['transaction'](function(_0x48e5a2){return db[_0x055c('0x7b')]['destroy']({'where':{'FaxAccountId':_0x38da76[_0x055c('0x54')]['id']},'transaction':_0x48e5a2})[_0x055c('0x20')](function(_0x54b0e0){var _0x4010c3=_[_0x055c('0x40')](_0x38da76[_0x055c('0x58')],function(_0x27e8c4){_0x27e8c4['FaxAccountId']=_0x38da76['params']['id'];return _0x27e8c4;});return db['FaxApplication'][_0x055c('0x7c')](_0x4010c3,{'transaction':_0x48e5a2});});})['then'](function(){return db[_0x055c('0x7b')][_0x055c('0x7d')]({'where':{'FaxAccountId':_0x38da76[_0x055c('0x54')]['id']},'order':_0x055c('0x7e')});});}})[_0x055c('0x20')](respondWithResult(_0x3ff109,null))[_0x055c('0x2b')](handleError(_0x3ff109,null));};exports[_0x055c('0x7f')]=function(_0x3fa3d3,_0x5f456c,_0x39d693){var _0x436c6e={};var _0x464e0a={};var _0x1985d9;var _0x2688ec;return db[_0x055c('0x3d')][_0x055c('0x65')]({'where':{'id':_0x3fa3d3['params']['id']}})['then'](handleEntityNotFound(_0x5f456c,null))[_0x055c('0x20')](function(_0x2386d0){if(_0x2386d0){_0x1985d9=_0x2386d0;_0x464e0a[_0x055c('0x3f')]=_[_0x055c('0x42')](db[_0x055c('0x7b')][_0x055c('0x6c')]);_0x464e0a[_0x055c('0x41')]=_[_0x055c('0x42')](_0x3fa3d3[_0x055c('0x41')]);_0x464e0a[_0x055c('0x43')]=_['intersection'](_0x464e0a[_0x055c('0x3f')],_0x464e0a[_0x055c('0x41')]);_0x436c6e[_0x055c('0x45')]=_[_0x055c('0x44')](_0x464e0a[_0x055c('0x3f')],qs[_0x055c('0x46')](_0x3fa3d3[_0x055c('0x41')][_0x055c('0x46')]));_0x436c6e[_0x055c('0x45')]=_0x436c6e[_0x055c('0x45')]['length']?_0x436c6e[_0x055c('0x45')]:_0x464e0a['model'];_0x436c6e['order']=qs[_0x055c('0x4a')](_0x3fa3d3[_0x055c('0x41')][_0x055c('0x4a')]);_0x436c6e[_0x055c('0x4b')]=qs['filters'](_[_0x055c('0x4c')](_0x3fa3d3[_0x055c('0x41')],_0x464e0a[_0x055c('0x43')]));if(_0x3fa3d3['query']['filter']){_0x436c6e[_0x055c('0x4b')]=_[_0x055c('0x4f')](_0x436c6e[_0x055c('0x4b')],{'$or':_[_0x055c('0x40')](_0x436c6e[_0x055c('0x45')],function(_0x26ac2c){var _0x1d2fed={};_0x1d2fed[_0x26ac2c]={'$like':'%'+_0x3fa3d3[_0x055c('0x41')]['filter']+'%'};return _0x1d2fed;})});}_0x436c6e=_[_0x055c('0x4f')]({},_0x436c6e,_0x3fa3d3[_0x055c('0x50')]);return _0x1985d9[_0x055c('0x7f')](_0x436c6e);}})[_0x055c('0x20')](function(_0x38d05e){if(_0x38d05e){_0x2688ec=_0x38d05e[_0x055c('0x47')];if(!_0x3fa3d3[_0x055c('0x41')][_0x055c('0x48')](_0x055c('0x66'))){_0x436c6e[_0x055c('0x2f')]=qs[_0x055c('0x2f')](_0x3fa3d3[_0x055c('0x41')][_0x055c('0x2f')]);_0x436c6e[_0x055c('0x2d')]=qs[_0x055c('0x2d')](_0x3fa3d3[_0x055c('0x41')][_0x055c('0x2d')]);}return _0x1985d9[_0x055c('0x7f')](_0x436c6e);}})['then'](function(_0x2841f2){if(_0x2841f2){return _0x2841f2?{'count':_0x2688ec,'rows':_0x2841f2}:null;}})[_0x055c('0x20')](respondWithResult(_0x5f456c,null))[_0x055c('0x2b')](handleError(_0x5f456c,null));};function Extension(_0x4ed79b,_0x41dd2d,_0x4d51fd,_0xbe861c){this[_0x055c('0x80')]='from-voip-provider';this[_0x055c('0x81')]=_0x4ed79b[_0x055c('0x82')];this['app']=_0xbe861c;this['type']='system';this[_0x055c('0x83')]='Fax\x20Extension';this[_0x055c('0x67')]=_0x4ed79b['id'];this['priority']=_0x41dd2d;this[_0x055c('0x84')]=_0x4d51fd;}function createExtensionsReciveFax(_0x1b54ab){var _0x538f65=0x1;var _0x58ae8d=[];_0x58ae8d[_0x055c('0x85')](new Extension(_0x1b54ab,_0x538f65,'',_0x055c('0x86')));_0x538f65+=0x1;_0x58ae8d[_0x055c('0x85')](new Extension(_0x1b54ab,_0x538f65,_0x055c('0x87'),_0x055c('0x88')));_0x538f65+=0x1;for(var _0x450a03 in _0x1b54ab){if(_0x1b54ab[_0x055c('0x48')](_0x450a03)&&(_0x450a03===_0x055c('0x89')||_0x450a03===_0x055c('0x82')||_0x450a03===_0x055c('0x8a')||_0x450a03===_0x055c('0x8b')||_0x450a03===_0x055c('0x8c')||_0x450a03==='maxrate'||_0x450a03===_0x055c('0x8d')||_0x450a03===_0x055c('0x8e')||_0x450a03===_0x055c('0x8f'))){_0x58ae8d[_0x055c('0x85')](new Extension(_0x1b54ab,_0x538f65,_0x055c('0x90')+_0x450a03+')='+_0x1b54ab[_0x450a03],_0x055c('0x88')));_0x538f65+=0x1;}}_0x58ae8d[_0x055c('0x85')](new Extension(_0x1b54ab,_0x538f65,'6','Wait'));_0x538f65+=0x1;_0x58ae8d['push'](new Extension(_0x1b54ab,_0x538f65,'/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',_0x055c('0x91')));_0x538f65=0x0;return _0x58ae8d;}exports['addAccountApplications']=function(_0x55462b,_0xd6ac4,_0x46c8d0){var _0x4dd14b;return db['sequelize'][_0x055c('0x92')](function(_0x1746a4){return db['FaxAccount']['create'](_0x55462b[_0x055c('0x58')],{'transaction':_0x1746a4})['then'](function(_0x4e30b5){_0x4dd14b=_0x4e30b5[_0x055c('0x5a')]({'plain':!![]});return db['VoiceExtension'][_0x055c('0x7c')](createExtensionsReciveFax(_0x4dd14b),{'transaction':_0x1746a4});});})[_0x055c('0x20')](function(){return _0x4dd14b;})['then'](respondWithResult(_0xd6ac4,null))[_0x055c('0x2b')](handleError(_0xd6ac4,null));};exports[_0x055c('0x93')]=function(_0x3e7486,_0x335661,_0xc98194){var _0x12ace7;return db['sequelize']['transaction'](function(_0x157b8e){return db[_0x055c('0x3d')][_0x055c('0x34')](_0x3e7486[_0x055c('0x58')],{'where':{'id':_0x3e7486['body']['id']},'transaction':_0x157b8e})[_0x055c('0x20')](function(_0xafab68){return db[_0x055c('0x94')][_0x055c('0x35')]({'where':{'FaxAccountId':_0x3e7486[_0x055c('0x58')]['id']},'transaction':_0x157b8e})[_0x055c('0x20')](function(_0x5073e4){return db['VoiceExtension'][_0x055c('0x7c')](createExtensionsReciveFax(_[_0x055c('0x6f')](_0x3e7486['body'],[_0x055c('0x95'),_0x055c('0x96'),_0x055c('0x97'),_0x055c('0x98'),'TrunkId',_0x055c('0x99')])),{'transaction':_0x157b8e});});});})['then'](function(){return db[_0x055c('0x3d')]['findById'](_0x3e7486[_0x055c('0x58')]['id']);})[_0x055c('0x20')](respondWithResult(_0x335661,null))['catch'](handleError(_0x335661,null));};exports['getMessages']=function(_0x32cf5a,_0x58f457,_0x49ac61){var _0x523fda={'raw':!![],'where':{}};var _0x105f29={};var _0x5c4d92={'count':0x0,'rows':[]};return db[_0x055c('0x3d')][_0x055c('0x65')]({'where':{'id':_0x32cf5a[_0x055c('0x54')]['id']}})[_0x055c('0x20')](handleEntityNotFound(_0x58f457,null))[_0x055c('0x20')](function(_0x3adcfd){if(_0x3adcfd){_0x105f29[_0x055c('0x3f')]=_['keys'](db[_0x055c('0x9a')][_0x055c('0x6c')]);_0x105f29[_0x055c('0x41')]=_[_0x055c('0x42')](_0x32cf5a[_0x055c('0x41')]);_0x105f29[_0x055c('0x43')]=_['intersection'](_0x105f29[_0x055c('0x3f')],_0x105f29[_0x055c('0x41')]);_0x523fda[_0x055c('0x45')]=_[_0x055c('0x44')](_0x105f29[_0x055c('0x3f')],qs['fields'](_0x32cf5a[_0x055c('0x41')][_0x055c('0x46')]));_0x523fda['attributes']=_0x523fda[_0x055c('0x45')]['length']?_0x523fda[_0x055c('0x45')]:_0x105f29[_0x055c('0x3f')];if(!_0x32cf5a['query'][_0x055c('0x48')](_0x055c('0x66'))){_0x523fda[_0x055c('0x2f')]=qs[_0x055c('0x2f')](_0x32cf5a[_0x055c('0x41')][_0x055c('0x2f')]);_0x523fda[_0x055c('0x2d')]=qs[_0x055c('0x2d')](_0x32cf5a[_0x055c('0x41')][_0x055c('0x2d')]);}_0x523fda[_0x055c('0x49')]=qs['sort'](_0x32cf5a[_0x055c('0x41')][_0x055c('0x4a')]);_0x523fda[_0x055c('0x4b')]=qs['filters'](_[_0x055c('0x4c')](_0x32cf5a['query'],_0x105f29[_0x055c('0x43')]));_0x523fda[_0x055c('0x4b')][_0x055c('0x67')]=_0x3adcfd['id'];if(_0x32cf5a[_0x055c('0x41')][_0x055c('0x4d')]){_0x523fda[_0x055c('0x4b')]=_[_0x055c('0x4f')](_0x523fda[_0x055c('0x4b')],{'$or':_[_0x055c('0x40')](_0x523fda[_0x055c('0x45')],function(_0x5766ea){var _0x244375={};_0x244375[_0x5766ea]={'$like':'%'+_0x32cf5a[_0x055c('0x41')][_0x055c('0x4d')]+'%'};return _0x244375;})});}if(_0x32cf5a[_0x055c('0x41')]['$gte']){var _0x419927=_0x32cf5a['query'][_0x055c('0x9b')][_0x055c('0x9c')](',');var _0x41495f={};_0x41495f[_0x419927[0x0]]={'$gte':moment(_0x419927[0x1])[_0x055c('0x9d')](_0x055c('0x9e'))};_0x523fda[_0x055c('0x4b')]=_['merge'](_0x523fda[_0x055c('0x4b')],_0x41495f);}_0x523fda=_[_0x055c('0x4f')]({},_0x523fda,_0x32cf5a['options']);return db[_0x055c('0x9a')][_0x055c('0x2e')]({'where':_0x523fda[_0x055c('0x4b')]})[_0x055c('0x20')](function(_0x1e3608){_0x5c4d92['count']=_0x1e3608;if(_0x32cf5a['query'][_0x055c('0x51')]){_0x523fda[_0x055c('0x56')]=[{'all':!![]}];}return db[_0x055c('0x9a')][_0x055c('0x52')](_0x523fda);})[_0x055c('0x20')](function(_0xb3f861){_0x5c4d92['rows']=_0xb3f861;return _0x5c4d92;});}})[_0x055c('0x20')](respondWithFilteredResult(_0x58f457,_0x523fda))[_0x055c('0x2b')](handleError(_0x58f457,null));};exports[_0x055c('0x9f')]=function(_0x507476,_0x28aae8,_0x39ff9f){var _0x5a7c38,_0x37f81b={},_0x400b87;if(_0x507476['body']['to']){_0x400b87=_0x507476[_0x055c('0x58')]['to'][0x0];}return db[_0x055c('0x3d')][_0x055c('0x5e')]({'where':{'id':_0x507476[_0x055c('0x54')]['id']},'include':[{'model':db[_0x055c('0xa0')],'as':_0x055c('0xa1'),'include':[{'model':db[_0x055c('0x72')],'as':_0x055c('0xa2'),'where':{'fax':_0x400b87},'limit':0x1,'order':[['updatedAt',_0x055c('0xa3')]]}]}]})[_0x055c('0x20')](handleEntityNotFound(_0x28aae8,null))[_0x055c('0x20')](function(_0x4b133e){_0x5a7c38=_0x4b133e;if(_0x507476['body']['attachments']&&_0x507476[_0x055c('0x58')][_0x055c('0xa4')]['length']){for(var _0x1a9815=0x0;_0x1a9815<_0x507476[_0x055c('0x58')][_0x055c('0xa4')][_0x055c('0x47')];_0x1a9815+=0x1){_0x507476[_0x055c('0x58')][_0x055c('0xa4')][_0x1a9815]={'filename':_0x507476[_0x055c('0x58')]['attachments'][_0x1a9815][_0x055c('0x3a')],'id':_0x507476['body'][_0x055c('0xa4')][_0x1a9815]['id'],'path':path[_0x055c('0xa5')](config[_0x055c('0xa6')],_0x055c('0xa7'),_0x507476[_0x055c('0x58')][_0x055c('0xa4')][_0x1a9815][_0x055c('0xa8')])};}}return respondWithRpcPromise(_0x055c('0xa9'),_0x055c('0xa9'),{'FaxAccountId':_[_0x055c('0xaa')](_0x507476[_0x055c('0x54')]['id'])?undefined:_0x507476[_0x055c('0x54')]['id'],'path':_[_0x055c('0xaa')](_0x507476[_0x055c('0x58')][_0x055c('0xa4')][0x0]['path'])?undefined:_0x507476[_0x055c('0x58')]['attachments'][0x0][_0x055c('0xab')],'fax':_[_0x055c('0xaa')](_0x507476[_0x055c('0x58')]['to'][0x0])?undefined:_0x507476['body']['to'][0x0]},client9002);})[_0x055c('0x20')](function(){if(_0x5a7c38){if(_['isNil'](_0x507476[_0x055c('0x58')][_0x055c('0xac')])){_0x507476['body'][_0x055c('0xac')]=util['format'](_0x055c('0xad'),_0x5a7c38[_0x055c('0x3a')],_0x5a7c38[_0x055c('0xae')]);}if(_0x5a7c38[_0x055c('0xa1')]){if(_0x5a7c38['List'][_0x055c('0xa2')][_0x055c('0x47')]){return _0x5a7c38[_0x055c('0xa1')][_0x055c('0xa2')][0x0];}else{return db[_0x055c('0x72')][_0x055c('0x57')](_[_0x055c('0x17')](_0x507476[_0x055c('0x58')],{'firstName':_0x507476['body']['to'][0x0],'phone':_0x507476['body']['to'][0x0],'fax':_0x507476[_0x055c('0x58')]['to'][0x0],'ListId':_0x5a7c38['ListId']}));}}else{throw new Error(_0x055c('0xaf'));}}else{throw new Error(_0x055c('0xb0'));}})[_0x055c('0x20')](function(_0x38ed3d){if(_0x38ed3d){return db[_0x055c('0x71')][_0x055c('0x5e')]({'where':{'ContactId':_0x38ed3d['id'],'closed':![],'FaxAccountId':_0x5a7c38['id']}})[_0x055c('0x20')](function(_0x4d4f2a){if(_0x4d4f2a){return[_0x4d4f2a,![]];}return db[_0x055c('0x71')][_0x055c('0x57')]({'UserId':_0x507476[_0x055c('0x59')]['id'],'ContactId':_0x38ed3d['id'],'FaxAccountId':_0x5a7c38['id'],'fax':_0x507476[_0x055c('0x58')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x055c('0x4f')](_0x507476[_0x055c('0x58')],{'read':![],'body':_0x507476[_0x055c('0x58')][_0x055c('0xa4')][0x0][_0x055c('0xb1')],'FaxAccountId':_0x5a7c38['id'],'UserId':_0x507476[_0x055c('0x59')]['id'],'ContactId':_0x38ed3d['id'],'AttachmentId':_0x507476[_0x055c('0x58')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x055c('0x9a')],'as':'Messages'}]})['then'](function(_0xf7f2f3){return[_0xf7f2f3,!![]];});});}else{throw new Error(_0x055c('0xb2'));}})[_0x055c('0xb3')](function(_0x3b5ab2,_0x3bb217){if(_0x3bb217){return _0x3b5ab2;}return db[_0x055c('0x9a')][_0x055c('0x57')]({'direction':_0x055c('0xb4'),'read':![],'body':_0x507476[_0x055c('0x58')]['attachments'][0x0][_0x055c('0xb1')],'FaxAccountId':_0x5a7c38['id'],'FaxInteractionId':_0x3b5ab2['id'],'UserId':_0x507476[_0x055c('0x59')]['id'],'ContactId':_0x3b5ab2['ContactId'],'AttachmentId':_0x507476[_0x055c('0x58')][_0x055c('0xa4')][0x0]['id']})['then'](function(_0x369a9e){_0x3b5ab2['dataValues'][_0x055c('0xb5')]=[];_0x3b5ab2[_0x055c('0xb6')][_0x055c('0xb5')][_0x055c('0x85')](_0x369a9e['dataValues']);return _0x3b5ab2;});})[_0x055c('0x20')](function(_0x4181fb){respondWithRpcPromise(_0x055c('0xb7'),_0x055c('0xb7'),{'FaxAccountId':_['isNil'](_0x507476[_0x055c('0x54')]['id'])?undefined:_0x507476[_0x055c('0x54')]['id'],'path':_[_0x055c('0xaa')](_0x507476[_0x055c('0x58')][_0x055c('0xa4')][0x0][_0x055c('0xab')])?undefined:_0x507476[_0x055c('0x58')][_0x055c('0xa4')][0x0][_0x055c('0xab')],'fax':_[_0x055c('0xaa')](_0x507476['body']['to'][0x0])?undefined:_0x507476[_0x055c('0x58')]['to'][0x0],'AttachmentId':_0x507476['body'][_0x055c('0xa4')][0x0]['id']},client9002)[_0x055c('0x20')](function(_0x324a53){logger['info'](_0x055c('0xb8'),_0x324a53);})['catch'](function(_0x310874){logger['info'](_0x055c('0xb8'),_0x310874);});return _0x4181fb;})['then'](respondWithResult(_0x28aae8,null))[_0x055c('0x2b')](handleError(_0x28aae8,null));};exports[_0x055c('0xb9')]=function(_0x369d17,_0x3b9c19,_0x4adf71){return db[_0x055c('0x3d')][_0x055c('0x5e')]({'where':{'id':_0x369d17[_0x055c('0x54')]['id']}})[_0x055c('0x20')](handleEntityNotFound(_0x3b9c19,null))[_0x055c('0x20')](function(_0x43672c){if(_0x43672c){return _0x43672c[_0x055c('0xb9')](_0x369d17[_0x055c('0x58')][_0x055c('0x69')],_[_0x055c('0x6f')](_0x369d17[_0x055c('0x58')],[_0x055c('0x69'),'id'])||{})['spread'](function(_0xf23074){for(var _0xfe6a41=0x0;_0xfe6a41<_0x369d17[_0x055c('0x58')]['ids']['length'];_0xfe6a41+=0x1){socket[_0x055c('0xba')](_0x055c('0xbb'),{'UserId':Number(_0x369d17[_0x055c('0x58')][_0x055c('0x69')][_0xfe6a41]),'FaxAccountId':Number(_0x369d17['params']['id'])});}return _0xf23074;});}})[_0x055c('0x20')](respondWithResult(_0x3b9c19,null))['catch'](handleError(_0x3b9c19,null));};exports['removeAgents']=function(_0x5afff7,_0x42331b,_0x30d6ad){return db[_0x055c('0x3d')][_0x055c('0x5e')]({'where':{'id':_0x5afff7['params']['id']}})[_0x055c('0x20')](handleEntityNotFound(_0x42331b,null))[_0x055c('0x20')](function(_0x50061b){if(_0x50061b){return _0x50061b[_0x055c('0xbc')](_0x5afff7[_0x055c('0x41')]['ids'])[_0x055c('0x20')](function(){if(_[_0x055c('0xbd')](_0x5afff7[_0x055c('0x41')][_0x055c('0x69')])){for(var _0x207d34=0x0;_0x207d34<_0x5afff7['query'][_0x055c('0x69')]['length'];_0x207d34+=0x1){socket[_0x055c('0xba')](_0x055c('0xbe'),{'UserId':Number(_0x5afff7['query'][_0x055c('0x69')][_0x207d34]),'FaxAccountId':Number(_0x5afff7['params']['id'])});}}else{socket[_0x055c('0xba')](_0x055c('0xbe'),{'UserId':Number(_0x5afff7[_0x055c('0x41')][_0x055c('0x69')]),'FaxAccountId':Number(_0x5afff7[_0x055c('0x54')]['id'])});}});}})[_0x055c('0x20')](respondWithStatusCode(_0x42331b,null))[_0x055c('0x2b')](handleError(_0x42331b,null));};exports[_0x055c('0xbf')]=function(_0x4abaa4,_0x2bb36c,_0x3b3deb){var _0x144bb4={};var _0x4c7697={};var _0x16eeaa;var _0x2fbc68;return db[_0x055c('0x3d')]['findOne']({'where':{'id':_0x4abaa4[_0x055c('0x54')]['id']}})['then'](handleEntityNotFound(_0x2bb36c,null))['then'](function(_0xa52b64){if(_0xa52b64){_0x16eeaa=_0xa52b64;_0x4c7697['model']=_[_0x055c('0x42')](db[_0x055c('0xc0')][_0x055c('0x6c')]);_0x4c7697[_0x055c('0x41')]=_[_0x055c('0x42')](_0x4abaa4[_0x055c('0x41')]);_0x4c7697[_0x055c('0x43')]=_[_0x055c('0x44')](_0x4c7697[_0x055c('0x3f')],_0x4c7697[_0x055c('0x41')]);_0x144bb4[_0x055c('0x45')]=_[_0x055c('0x44')](_0x4c7697['model'],qs[_0x055c('0x46')](_0x4abaa4[_0x055c('0x41')]['fields']));_0x144bb4['attributes']=_0x144bb4[_0x055c('0x45')]['length']?_0x144bb4[_0x055c('0x45')]:_0x4c7697[_0x055c('0x3f')];_0x144bb4[_0x055c('0x49')]=qs[_0x055c('0x4a')](_0x4abaa4['query'][_0x055c('0x4a')]);_0x144bb4[_0x055c('0x4b')]=qs[_0x055c('0x43')](_['pick'](_0x4abaa4['query'],_0x4c7697[_0x055c('0x43')]));if(_0x4abaa4[_0x055c('0x41')]['filter']){_0x144bb4[_0x055c('0x4b')]=_[_0x055c('0x4f')](_0x144bb4[_0x055c('0x4b')],{'$or':_[_0x055c('0x40')](_0x144bb4[_0x055c('0x45')],function(_0x35e76e){var _0x2a31b4={};_0x2a31b4[_0x35e76e]={'$like':'%'+_0x4abaa4[_0x055c('0x41')]['filter']+'%'};return _0x2a31b4;})});}_0x144bb4=_[_0x055c('0x4f')]({},_0x144bb4,_0x4abaa4[_0x055c('0x50')]);return _0x16eeaa[_0x055c('0xbf')](_0x144bb4);}})[_0x055c('0x20')](function(_0x4059d0){if(_0x4059d0){_0x2fbc68=_0x4059d0[_0x055c('0x47')];if(!_0x4abaa4[_0x055c('0x41')]['hasOwnProperty'](_0x055c('0x66'))){_0x144bb4['limit']=qs[_0x055c('0x2f')](_0x4abaa4['query'][_0x055c('0x2f')]);_0x144bb4[_0x055c('0x2d')]=qs[_0x055c('0x2d')](_0x4abaa4['query'][_0x055c('0x2d')]);}return _0x16eeaa[_0x055c('0xbf')](_0x144bb4);}})['then'](function(_0x4788ee){if(_0x4788ee){return _0x4788ee?{'count':_0x2fbc68,'rows':_0x4788ee}:null;}})[_0x055c('0x20')](respondWithResult(_0x2bb36c,null))[_0x055c('0x2b')](handleError(_0x2bb36c,null));}; \ No newline at end of file +var _0x94a6=['Contact\x20not\x20found','spread','filename','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','show','params','Pause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','faxdetect','maxrate','minrate','t38timeout','FAXOPT(','Wait','/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','ReceiveFax','VoiceExtension','tech','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','FaxInteraction','out'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x94a6,0x191));var _0x694a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94a6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x694a('0x0'));var rimraf=require(_0x694a('0x1'));var zipdir=require(_0x694a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x694a('0x3'));var moment=require(_0x694a('0x4'));var BPromise=require(_0x694a('0x5'));var Mustache=require(_0x694a('0x6'));var util=require(_0x694a('0x7'));var path=require(_0x694a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x694a('0x9'));var fs=require('fs');var fs_extra=require(_0x694a('0xa'));var _=require(_0x694a('0xb'));var squel=require(_0x694a('0xc'));var crypto=require('crypto');var jsforce=require(_0x694a('0xd'));var deskjs=require(_0x694a('0xe'));var toCsv=require(_0x694a('0xf'));var querystring=require(_0x694a('0x10'));var Papa=require(_0x694a('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x694a('0x12'));var hardwareService=require(_0x694a('0x13'));var logger=require(_0x694a('0x14'))(_0x694a('0x15'));var utils=require(_0x694a('0x16'));var config=require(_0x694a('0x17'));var licenseUtil=require(_0x694a('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x694a('0x19')](config[_0x694a('0x1a')],{'host':_0x694a('0x1b'),'port':0x18eb});var socket=require(_0x694a('0x1c'))(new Redis(config[_0x694a('0x1a')]));require(_0x694a('0x1d'))[_0x694a('0x1e')](socket);var jayson=require(_0x694a('0x1f'));var client=jayson['client'][_0x694a('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x694a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1bfc53,_0x2b5059,_0x2f295f,_0x136806){return new BPromise(function(_0x40be18,_0x15ebe8){var _0x2ccc1f=_0x136806||client;return _0x2ccc1f[_0x694a('0x21')](_0x1bfc53,_0x2f295f)[_0x694a('0x22')](function(_0x32a958){logger[_0x694a('0x23')]('FaxAccount,\x20%s,\x20%s',_0x2b5059,_0x694a('0x24'));logger['debug'](_0x694a('0x25'),_0x2b5059,_0x694a('0x24'),JSON[_0x694a('0x26')](_0x32a958));if(_0x32a958['error']){if(_0x32a958[_0x694a('0x27')][_0x694a('0x28')]===0x1f4){logger[_0x694a('0x27')](_0x694a('0x29'),_0x2b5059,_0x32a958['error']['message']);return _0x15ebe8(_0x32a958['error'][_0x694a('0x2a')]);}logger['error'](_0x694a('0x29'),_0x2b5059,_0x32a958[_0x694a('0x27')][_0x694a('0x2a')]);return _0x40be18(_0x32a958['error']['message']);}else{logger['info'](_0x694a('0x29'),_0x2b5059,_0x694a('0x24'));_0x40be18(_0x32a958[_0x694a('0x2b')][_0x694a('0x2a')]);}})[_0x694a('0x2c')](function(_0x9258df){logger[_0x694a('0x27')](_0x694a('0x29'),_0x2b5059,_0x9258df);_0x15ebe8(_0x9258df);});});}function respondWithStatusCode(_0xbaec1f,_0x33d7a4){_0x33d7a4=_0x33d7a4||0xcc;return function(_0x3e130a){if(_0x3e130a){return _0xbaec1f['sendStatus'](_0x33d7a4);}return _0xbaec1f['status'](_0x33d7a4)[_0x694a('0x2d')]();};}function respondWithResult(_0x565394,_0x598a1e){_0x598a1e=_0x598a1e||0xc8;return function(_0xecdc1a){if(_0xecdc1a){return _0x565394[_0x694a('0x2e')](_0x598a1e)[_0x694a('0x2f')](_0xecdc1a);}};}function respondWithFilteredResult(_0x21193,_0x5b1ad5){return function(_0x1b20cf){if(_0x1b20cf){var _0x2bdab7=typeof _0x5b1ad5[_0x694a('0x30')]===_0x694a('0x31')&&typeof _0x5b1ad5[_0x694a('0x32')]==='undefined';var _0x472fd8=_0x1b20cf[_0x694a('0x33')];var _0x5f44b9=_0x2bdab7?0x0:_0x5b1ad5[_0x694a('0x30')];var _0x5ccd31=_0x2bdab7?_0x1b20cf[_0x694a('0x33')]:_0x5b1ad5[_0x694a('0x30')]+_0x5b1ad5[_0x694a('0x32')];var _0x2e0e37;if(_0x5ccd31>=_0x472fd8){_0x5ccd31=_0x472fd8;_0x2e0e37=0xc8;}else{_0x2e0e37=0xce;}_0x21193[_0x694a('0x2e')](_0x2e0e37);return _0x21193[_0x694a('0x34')]('Content-Range',_0x5f44b9+'-'+_0x5ccd31+'/'+_0x472fd8)[_0x694a('0x2f')](_0x1b20cf);}return null;};}function patchUpdates(_0xe23daf){return function(_0x159439){try{jsonpatch[_0x694a('0x35')](_0x159439,_0xe23daf,!![]);}catch(_0x29c2be){return BPromise['reject'](_0x29c2be);}return _0x159439[_0x694a('0x36')]();};}function saveUpdates(_0x186872,_0x2e53cd){return function(_0x597892){if(_0x597892){return _0x597892[_0x694a('0x37')](_0x186872)[_0x694a('0x22')](function(_0x1925c6){return _0x1925c6;});}return null;};}function removeEntity(_0x191836,_0x5f56ad){return function(_0x2b0eb5){if(_0x2b0eb5){return _0x2b0eb5[_0x694a('0x38')]()[_0x694a('0x22')](function(){var _0x39316c=_0x2b0eb5[_0x694a('0x39')]({'plain':!![]});var _0x446ffe=_0x694a('0x3a');return db[_0x694a('0x3b')]['destroy']({'where':{'type':_0x446ffe,'resourceId':_0x39316c['id']}})[_0x694a('0x22')](function(){return _0x2b0eb5;});})[_0x694a('0x22')](function(){_0x191836[_0x694a('0x2e')](0xcc)[_0x694a('0x2d')]();});}};}function handleEntityNotFound(_0x5c9a28,_0x5452a0){return function(_0x23721d){if(!_0x23721d){_0x5c9a28[_0x694a('0x3c')](0x194);}return _0x23721d;};}function handleError(_0x42da80,_0x564f6d){_0x564f6d=_0x564f6d||0x1f4;return function(_0x598930){logger[_0x694a('0x27')](_0x598930['stack']);if(_0x598930[_0x694a('0x3d')]){delete _0x598930[_0x694a('0x3d')];}_0x42da80[_0x694a('0x2e')](_0x564f6d)[_0x694a('0x3e')](_0x598930);};}exports[_0x694a('0x3f')]=function(_0x4230ec,_0x4fdca9){var _0x4fc068={'include':[{'model':db['Pause'],'as':_0x694a('0x40')}]},_0x11c210={},_0x3fa6e1={'count':0x0,'rows':[]};var _0x9e3497=_[_0x694a('0x41')](db[_0x694a('0x42')][_0x694a('0x43')],function(_0x415c48){return{'name':_0x415c48['fieldName'],'type':_0x415c48['type'][_0x694a('0x44')]};});_0x11c210[_0x694a('0x45')]=_[_0x694a('0x41')](_0x9e3497,_0x694a('0x3d'));_0x11c210[_0x694a('0x46')]=_[_0x694a('0x47')](_0x4230ec[_0x694a('0x46')]);_0x11c210[_0x694a('0x48')]=_[_0x694a('0x49')](_0x11c210[_0x694a('0x45')],_0x11c210[_0x694a('0x46')]);_0x4fc068[_0x694a('0x4a')]=_[_0x694a('0x49')](_0x11c210[_0x694a('0x45')],qs[_0x694a('0x4b')](_0x4230ec[_0x694a('0x46')][_0x694a('0x4b')]));_0x4fc068['attributes']=_0x4fc068['attributes'][_0x694a('0x4c')]?_0x4fc068[_0x694a('0x4a')]:_0x11c210[_0x694a('0x45')];if(!_0x4230ec[_0x694a('0x46')][_0x694a('0x4d')]('nolimit')){_0x4fc068[_0x694a('0x32')]=qs['limit'](_0x4230ec[_0x694a('0x46')][_0x694a('0x32')]);_0x4fc068[_0x694a('0x30')]=qs['offset'](_0x4230ec[_0x694a('0x46')]['offset']);}_0x4fc068[_0x694a('0x4e')]=qs[_0x694a('0x4f')](_0x4230ec[_0x694a('0x46')][_0x694a('0x4f')]);_0x4fc068['where']=qs[_0x694a('0x48')](_[_0x694a('0x50')](_0x4230ec[_0x694a('0x46')],_0x11c210[_0x694a('0x48')]),_0x9e3497);if(_0x4230ec[_0x694a('0x46')][_0x694a('0x51')]){_0x4fc068[_0x694a('0x52')]=_[_0x694a('0x53')](_0x4fc068['where'],{'$or':_['map'](_0x9e3497,function(_0x591ce8){if(_0x591ce8['type']!=='VIRTUAL'){var _0x4b3dcc={};_0x4b3dcc[_0x591ce8[_0x694a('0x3d')]]={'$like':'%'+_0x4230ec['query'][_0x694a('0x51')]+'%'};return _0x4b3dcc;}})});}_0x4fc068=_[_0x694a('0x53')]({},_0x4fc068,_0x4230ec[_0x694a('0x54')]);var _0xfd4033={'where':_0x4fc068[_0x694a('0x52')]};return db[_0x694a('0x42')]['count'](_0xfd4033)[_0x694a('0x22')](function(_0x5bb38c){_0x3fa6e1['count']=_0x5bb38c;if(_0x4230ec['query'][_0x694a('0x55')]){_0x4fc068['include']=[{'all':!![]}];}return db['FaxAccount'][_0x694a('0x56')](_0x4fc068);})[_0x694a('0x22')](function(_0x162a08){_0x3fa6e1[_0x694a('0x57')]=_0x162a08;return _0x3fa6e1;})[_0x694a('0x22')](respondWithFilteredResult(_0x4fdca9,_0x4fc068))[_0x694a('0x2c')](handleError(_0x4fdca9,null));};exports[_0x694a('0x58')]=function(_0xf722aa,_0x54dc09){var _0x5b0134={'raw':![],'where':{'id':_0xf722aa[_0x694a('0x59')]['id']},'include':[{'model':db[_0x694a('0x5a')],'as':_0x694a('0x40')}]},_0x34c3a5={};_0x34c3a5[_0x694a('0x45')]=_[_0x694a('0x47')](db[_0x694a('0x42')][_0x694a('0x43')]);_0x34c3a5['query']=_['keys'](_0xf722aa[_0x694a('0x46')]);_0x34c3a5[_0x694a('0x48')]=_[_0x694a('0x49')](_0x34c3a5[_0x694a('0x45')],_0x34c3a5[_0x694a('0x46')]);_0x5b0134[_0x694a('0x4a')]=_['intersection'](_0x34c3a5[_0x694a('0x45')],qs['fields'](_0xf722aa[_0x694a('0x46')][_0x694a('0x4b')]));_0x5b0134[_0x694a('0x4a')]=_0x5b0134[_0x694a('0x4a')][_0x694a('0x4c')]?_0x5b0134[_0x694a('0x4a')]:_0x34c3a5['model'];if(_0xf722aa[_0x694a('0x46')][_0x694a('0x55')]){_0x5b0134[_0x694a('0x5b')]=[{'all':!![]}];}_0x5b0134=_['merge']({},_0x5b0134,_0xf722aa[_0x694a('0x54')]);return db[_0x694a('0x42')][_0x694a('0x5c')](_0x5b0134)[_0x694a('0x22')](handleEntityNotFound(_0x54dc09,null))[_0x694a('0x22')](respondWithResult(_0x54dc09,null))[_0x694a('0x2c')](handleError(_0x54dc09,null));};exports[_0x694a('0x5d')]=function(_0x17e625,_0x45ccba){return db['FaxAccount'][_0x694a('0x5d')](_0x17e625[_0x694a('0x5e')],{})[_0x694a('0x22')](function(_0x446dcb){var _0x1b1f4b=_0x17e625[_0x694a('0x5f')]['get']({'plain':!![]});if(!_0x1b1f4b)throw new Error(_0x694a('0x60'));if(_0x1b1f4b[_0x694a('0x61')]===_0x694a('0x5f')){var _0x22d722=_0x446dcb[_0x694a('0x39')]({'plain':!![]});var _0x52e0ca=_0x694a('0x3a');return db[_0x694a('0x62')][_0x694a('0x5c')]({'where':{'name':_0x52e0ca,'userProfileId':_0x1b1f4b[_0x694a('0x63')]},'raw':!![]})[_0x694a('0x22')](function(_0x152818){if(_0x152818&&_0x152818['autoAssociation']===0x0){return db['UserProfileResource'][_0x694a('0x5d')]({'name':_0x22d722['name'],'resourceId':_0x22d722['id'],'type':_0x152818[_0x694a('0x3d')],'sectionId':_0x152818['id']},{})['then'](function(){return _0x446dcb;});}else{return _0x446dcb;}})['catch'](function(_0x453bed){logger[_0x694a('0x27')](_0x694a('0x64'),_0x453bed);throw _0x453bed;});}return _0x446dcb;})[_0x694a('0x22')](respondWithResult(_0x45ccba,0xc9))[_0x694a('0x2c')](handleError(_0x45ccba,null));};exports['update']=function(_0x5d8ee7,_0x435b90){if(_0x5d8ee7[_0x694a('0x5e')]['id']){delete _0x5d8ee7[_0x694a('0x5e')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x5d8ee7[_0x694a('0x59')]['id']},'include':[{'model':db[_0x694a('0x5a')],'as':_0x694a('0x40')}]})['then'](handleEntityNotFound(_0x435b90,null))['then'](saveUpdates(_0x5d8ee7['body'],null))[_0x694a('0x22')](respondWithResult(_0x435b90,null))['catch'](handleError(_0x435b90,null));};exports['destroy']=function(_0x2cb87e,_0x386035){return db['FaxAccount'][_0x694a('0x5c')]({'where':{'id':_0x2cb87e[_0x694a('0x59')]['id']}})['then'](handleEntityNotFound(_0x386035,null))[_0x694a('0x22')](removeEntity(_0x386035,null))[_0x694a('0x2c')](handleError(_0x386035,null));};exports['describe']=function(_0x3a5cc2,_0x4bd4ab){return db[_0x694a('0x42')][_0x694a('0x65')]()['then'](respondWithResult(_0x4bd4ab,null))[_0x694a('0x2c')](handleError(_0x4bd4ab,null));};exports[_0x694a('0x66')]=function(_0x4076e8,_0x288cbb,_0xe4a16f){if(_0x4076e8[_0x694a('0x5e')]['id']){delete _0x4076e8[_0x694a('0x5e')]['id'];}return db[_0x694a('0x42')][_0x694a('0x5c')]({'where':{'id':_0x4076e8[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x288cbb,null))[_0x694a('0x22')](function(_0x3623dc){if(_0x3623dc){_0x4076e8[_0x694a('0x5e')][_0x694a('0x67')]=_0x3623dc['id'];return db['Disposition'][_0x694a('0x5d')](_0x4076e8['body']);}})[_0x694a('0x22')](respondWithResult(_0x288cbb,null))['catch'](handleError(_0x288cbb,null));};exports[_0x694a('0x68')]=function(_0x4dd293,_0x4139ab,_0x4d1e4d){var _0x56bf31={'raw':![],'where':{}};var _0x1e589e={};var _0x28f1dc={'count':0x0,'rows':[]};return db[_0x694a('0x42')][_0x694a('0x69')]({'where':{'id':_0x4dd293[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x4139ab,null))['then'](function(_0x9f6113){if(_0x9f6113){_0x1e589e[_0x694a('0x45')]=_['keys'](db[_0x694a('0x6a')]['rawAttributes']);_0x1e589e[_0x694a('0x46')]=_[_0x694a('0x47')](_0x4dd293[_0x694a('0x46')]);_0x1e589e[_0x694a('0x48')]=_['intersection'](_0x1e589e[_0x694a('0x45')],_0x1e589e[_0x694a('0x46')]);_0x56bf31[_0x694a('0x4a')]=_[_0x694a('0x49')](_0x1e589e['model'],qs[_0x694a('0x4b')](_0x4dd293[_0x694a('0x46')]['fields']));_0x56bf31[_0x694a('0x4a')]=_0x56bf31['attributes'][_0x694a('0x4c')]?_0x56bf31[_0x694a('0x4a')]:_0x1e589e['model'];if(!_0x4dd293[_0x694a('0x46')][_0x694a('0x4d')](_0x694a('0x6b'))){_0x56bf31[_0x694a('0x32')]=qs[_0x694a('0x32')](_0x4dd293[_0x694a('0x46')]['limit']);_0x56bf31['offset']=qs[_0x694a('0x30')](_0x4dd293[_0x694a('0x46')][_0x694a('0x30')]);}_0x56bf31[_0x694a('0x4e')]=qs[_0x694a('0x4f')](_0x4dd293[_0x694a('0x46')]['sort']);_0x56bf31['where']=qs[_0x694a('0x48')](_[_0x694a('0x50')](_0x4dd293[_0x694a('0x46')],_0x1e589e[_0x694a('0x48')]));_0x56bf31[_0x694a('0x52')][_0x694a('0x67')]=_0x9f6113['id'];if(_0x4dd293['query']['filter']){_0x56bf31[_0x694a('0x52')]=_[_0x694a('0x53')](_0x56bf31[_0x694a('0x52')],{'$or':_['map'](_0x56bf31[_0x694a('0x4a')],function(_0x34e0d5){var _0x17d60b={};_0x17d60b[_0x34e0d5]={'$like':'%'+_0x4dd293[_0x694a('0x46')][_0x694a('0x51')]+'%'};return _0x17d60b;})});}_0x56bf31=_[_0x694a('0x53')]({},_0x56bf31,_0x4dd293['options']);return db[_0x694a('0x6a')][_0x694a('0x33')]({'where':_0x56bf31[_0x694a('0x52')]})['then'](function(_0xfcf2e8){_0x28f1dc[_0x694a('0x33')]=_0xfcf2e8;if(_0x4dd293['query']['includeAll']){_0x56bf31[_0x694a('0x5b')]=[{'all':!![]}];}return db[_0x694a('0x6a')]['findAll'](_0x56bf31);})[_0x694a('0x22')](function(_0x20d5fc){_0x28f1dc[_0x694a('0x57')]=_0x20d5fc;return _0x28f1dc;});}})['then'](respondWithFilteredResult(_0x4139ab,_0x56bf31))[_0x694a('0x2c')](handleError(_0x4139ab,null));};exports[_0x694a('0x6c')]=function(_0x2596a2,_0x23ac12,_0x1157c0){return db[_0x694a('0x42')][_0x694a('0x5c')]({'where':{'id':_0x2596a2[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x23ac12,null))['then'](function(_0x9462c1){if(_0x9462c1){return _0x9462c1[_0x694a('0x6c')](_0x2596a2[_0x694a('0x46')][_0x694a('0x6d')]);}})['then'](respondWithStatusCode(_0x23ac12,null))[_0x694a('0x2c')](handleError(_0x23ac12,null));};exports[_0x694a('0x6e')]=function(_0x329f65,_0x237582,_0x21aa95){if(_0x329f65['body']['id']){delete _0x329f65[_0x694a('0x5e')]['id'];}return db[_0x694a('0x42')]['find']({'where':{'id':_0x329f65[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x237582,null))[_0x694a('0x22')](function(_0x4d0b44){if(_0x4d0b44){_0x329f65[_0x694a('0x5e')]['FaxAccountId']=_0x4d0b44['id'];return db['CannedAnswer'][_0x694a('0x5d')](_0x329f65[_0x694a('0x5e')]);}})[_0x694a('0x22')](respondWithResult(_0x237582,null))[_0x694a('0x2c')](handleError(_0x237582,null));};exports[_0x694a('0x6f')]=function(_0x3317ef,_0x1283cf,_0x27515e){var _0x37049b={'raw':![],'where':{}};var _0x95df55={};var _0x19be76={'count':0x0,'rows':[]};return db[_0x694a('0x42')]['findOne']({'where':{'id':_0x3317ef[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x1283cf,null))['then'](function(_0xd5e910){if(_0xd5e910){_0x95df55['model']=_[_0x694a('0x47')](db['CannedAnswer'][_0x694a('0x43')]);_0x95df55[_0x694a('0x46')]=_['keys'](_0x3317ef['query']);_0x95df55[_0x694a('0x48')]=_[_0x694a('0x49')](_0x95df55[_0x694a('0x45')],_0x95df55[_0x694a('0x46')]);_0x37049b[_0x694a('0x4a')]=_[_0x694a('0x49')](_0x95df55[_0x694a('0x45')],qs[_0x694a('0x4b')](_0x3317ef['query'][_0x694a('0x4b')]));_0x37049b['attributes']=_0x37049b['attributes'][_0x694a('0x4c')]?_0x37049b[_0x694a('0x4a')]:_0x95df55['model'];if(!_0x3317ef[_0x694a('0x46')][_0x694a('0x4d')](_0x694a('0x6b'))){_0x37049b[_0x694a('0x32')]=qs['limit'](_0x3317ef[_0x694a('0x46')][_0x694a('0x32')]);_0x37049b[_0x694a('0x30')]=qs[_0x694a('0x30')](_0x3317ef[_0x694a('0x46')][_0x694a('0x30')]);}_0x37049b[_0x694a('0x4e')]=qs[_0x694a('0x4f')](_0x3317ef['query'][_0x694a('0x4f')]);_0x37049b[_0x694a('0x52')]=qs['filters'](_['pick'](_0x3317ef[_0x694a('0x46')],_0x95df55['filters']));_0x37049b[_0x694a('0x52')][_0x694a('0x67')]=_0xd5e910['id'];if(_0x3317ef[_0x694a('0x46')][_0x694a('0x51')]){_0x37049b['where']=_[_0x694a('0x53')](_0x37049b[_0x694a('0x52')],{'$or':_[_0x694a('0x41')](_0x37049b[_0x694a('0x4a')],function(_0x179b1d){var _0x2553d6={};_0x2553d6[_0x179b1d]={'$like':'%'+_0x3317ef[_0x694a('0x46')]['filter']+'%'};return _0x2553d6;})});}_0x37049b=_[_0x694a('0x53')]({},_0x37049b,_0x3317ef[_0x694a('0x54')]);return db[_0x694a('0x70')][_0x694a('0x33')]({'where':_0x37049b[_0x694a('0x52')]})[_0x694a('0x22')](function(_0x1e7513){_0x19be76['count']=_0x1e7513;if(_0x3317ef[_0x694a('0x46')]['includeAll']){_0x37049b[_0x694a('0x5b')]=[{'all':!![]}];}return db[_0x694a('0x70')][_0x694a('0x56')](_0x37049b);})[_0x694a('0x22')](function(_0x11a93d){_0x19be76['rows']=_0x11a93d;return _0x19be76;});}})[_0x694a('0x22')](respondWithFilteredResult(_0x1283cf,_0x37049b))[_0x694a('0x2c')](handleError(_0x1283cf,null));};exports['removeAnswers']=function(_0x4300ae,_0x1e741d,_0x5cf520){return db['FaxAccount'][_0x694a('0x5c')]({'where':{'id':_0x4300ae[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x1e741d,null))['then'](function(_0x155bed){if(_0x155bed){return _0x155bed[_0x694a('0x71')](_0x4300ae[_0x694a('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x1e741d,null))[_0x694a('0x2c')](handleError(_0x1e741d,null));};exports[_0x694a('0x72')]=function(_0x1bd8fe,_0x3b9665,_0x16ca6a){return db['FaxInteraction'][_0x694a('0x5c')]({'where':{'id':_0x1bd8fe[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x3b9665,null))[_0x694a('0x22')](function(_0x34126d){if(_0x34126d){return _0x34126d['addInteraction'](_0x1bd8fe['body']['ids'],_[_0x694a('0x73')](_0x1bd8fe['body'],[_0x694a('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x3b9665,null))['catch'](handleError(_0x3b9665,null));};exports[_0x694a('0x74')]=function(_0x571348,_0x1842fb,_0xd8ee28){var _0x583c95={'raw':![],'where':{}};var _0x283b33={};var _0x13410e={'count':0x0,'rows':[]};return db[_0x694a('0x42')][_0x694a('0x69')]({'where':{'id':_0x571348[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x1842fb,null))[_0x694a('0x22')](function(_0x597d26){if(_0x597d26){_0x283b33['model']=_[_0x694a('0x47')](db['FaxInteraction']['rawAttributes']);_0x283b33[_0x694a('0x46')]=_[_0x694a('0x47')](_0x571348[_0x694a('0x46')]);_0x283b33['filters']=_[_0x694a('0x49')](_0x283b33[_0x694a('0x45')],_0x283b33[_0x694a('0x46')]);_0x583c95[_0x694a('0x4a')]=_[_0x694a('0x49')](_0x283b33['model'],qs[_0x694a('0x4b')](_0x571348[_0x694a('0x46')][_0x694a('0x4b')]));_0x583c95['attributes']=_0x583c95[_0x694a('0x4a')][_0x694a('0x4c')]?_0x583c95[_0x694a('0x4a')]:_0x283b33[_0x694a('0x45')];if(!_0x571348[_0x694a('0x46')]['hasOwnProperty']('nolimit')){_0x583c95[_0x694a('0x32')]=qs['limit'](_0x571348[_0x694a('0x46')]['limit']);_0x583c95[_0x694a('0x30')]=qs[_0x694a('0x30')](_0x571348[_0x694a('0x46')][_0x694a('0x30')]);}_0x583c95[_0x694a('0x4e')]=qs[_0x694a('0x4f')](_0x571348[_0x694a('0x46')][_0x694a('0x4f')]);_0x583c95[_0x694a('0x52')]=qs[_0x694a('0x48')](_[_0x694a('0x50')](_0x571348['query'],_0x283b33[_0x694a('0x48')]));_0x583c95[_0x694a('0x52')]['FaxAccountId']=_0x597d26['id'];if(_0x571348[_0x694a('0x46')][_0x694a('0x51')]){_0x583c95[_0x694a('0x52')]=_[_0x694a('0x53')](_0x583c95['where'],{'$or':_[_0x694a('0x41')](_0x583c95[_0x694a('0x4a')],function(_0x392deb){var _0x261e3f={};_0x261e3f[_0x392deb]={'$like':'%'+_0x571348[_0x694a('0x46')][_0x694a('0x51')]+'%'};return _0x261e3f;})});}_0x583c95=_['merge']({},_0x583c95,_0x571348[_0x694a('0x54')]);return db['FaxInteraction'][_0x694a('0x33')]({'where':_0x583c95[_0x694a('0x52')]})['then'](function(_0x1cafee){_0x13410e['count']=_0x1cafee;if(_0x571348[_0x694a('0x46')]['includeAll']){_0x583c95[_0x694a('0x5b')]=[{'model':db[_0x694a('0x75')],'as':_0x694a('0x76'),'required':![]},{'model':db[_0x694a('0x77')],'as':_0x694a('0x78'),'attributes':['name',_0x694a('0x79'),_0x694a('0x7a')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x694a('0x3d'),'color'],'where':_0x571348[_0x694a('0x46')][_0x694a('0x7b')]?{'id':_0x571348[_0x694a('0x46')][_0x694a('0x7b')]}:undefined,'required':_0x571348['query']['tag']?!![]:![]}];}return db['FaxInteraction'][_0x694a('0x56')](_0x583c95);})[_0x694a('0x22')](function(_0x17251){_0x13410e['rows']=_0x17251;return _0x13410e;});}})[_0x694a('0x22')](respondWithFilteredResult(_0x1842fb,_0x583c95))[_0x694a('0x2c')](handleError(_0x1842fb,null));};exports['addApplications']=function(_0x432d7f,_0x1cc64f,_0xf26ece){return db[_0x694a('0x42')][_0x694a('0x69')]({'where':{'id':_0x432d7f[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x1cc64f,null))[_0x694a('0x22')](function(_0x1be1d7){if(_0x1be1d7){return db[_0x694a('0x7c')][_0x694a('0x7d')](function(_0x5851a0){return db[_0x694a('0x7e')][_0x694a('0x38')]({'where':{'FaxAccountId':_0x432d7f[_0x694a('0x59')]['id']},'transaction':_0x5851a0})[_0x694a('0x22')](function(_0x389e45){var _0x5b17b8=_[_0x694a('0x41')](_0x432d7f[_0x694a('0x5e')],function(_0x268628){_0x268628[_0x694a('0x67')]=_0x432d7f[_0x694a('0x59')]['id'];return _0x268628;});return db[_0x694a('0x7e')][_0x694a('0x7f')](_0x5b17b8,{'transaction':_0x5851a0});});})[_0x694a('0x22')](function(){return db['FaxApplication'][_0x694a('0x80')]({'where':{'FaxAccountId':_0x432d7f['params']['id']},'order':'priority'});});}})[_0x694a('0x22')](respondWithResult(_0x1cc64f,null))[_0x694a('0x2c')](handleError(_0x1cc64f,null));};exports['getApplications']=function(_0x44b469,_0x5e9e1c,_0x2e2e72){var _0x2af295={};var _0x2975fc={};var _0x5bd34d;var _0x25f337;return db[_0x694a('0x42')]['findOne']({'where':{'id':_0x44b469[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x5e9e1c,null))[_0x694a('0x22')](function(_0x1e828e){if(_0x1e828e){_0x5bd34d=_0x1e828e;_0x2975fc['model']=_['keys'](db['FaxApplication'][_0x694a('0x43')]);_0x2975fc[_0x694a('0x46')]=_[_0x694a('0x47')](_0x44b469[_0x694a('0x46')]);_0x2975fc['filters']=_[_0x694a('0x49')](_0x2975fc[_0x694a('0x45')],_0x2975fc[_0x694a('0x46')]);_0x2af295[_0x694a('0x4a')]=_[_0x694a('0x49')](_0x2975fc['model'],qs[_0x694a('0x4b')](_0x44b469[_0x694a('0x46')][_0x694a('0x4b')]));_0x2af295[_0x694a('0x4a')]=_0x2af295[_0x694a('0x4a')]['length']?_0x2af295[_0x694a('0x4a')]:_0x2975fc[_0x694a('0x45')];_0x2af295[_0x694a('0x4e')]=qs[_0x694a('0x4f')](_0x44b469[_0x694a('0x46')][_0x694a('0x4f')]);_0x2af295[_0x694a('0x52')]=qs[_0x694a('0x48')](_[_0x694a('0x50')](_0x44b469[_0x694a('0x46')],_0x2975fc[_0x694a('0x48')]));if(_0x44b469[_0x694a('0x46')][_0x694a('0x51')]){_0x2af295[_0x694a('0x52')]=_[_0x694a('0x53')](_0x2af295[_0x694a('0x52')],{'$or':_[_0x694a('0x41')](_0x2af295[_0x694a('0x4a')],function(_0x54241b){var _0x2f8c64={};_0x2f8c64[_0x54241b]={'$like':'%'+_0x44b469[_0x694a('0x46')][_0x694a('0x51')]+'%'};return _0x2f8c64;})});}_0x2af295=_[_0x694a('0x53')]({},_0x2af295,_0x44b469['options']);return _0x5bd34d['getApplications'](_0x2af295);}})['then'](function(_0x4b3293){if(_0x4b3293){_0x25f337=_0x4b3293['length'];if(!_0x44b469[_0x694a('0x46')][_0x694a('0x4d')](_0x694a('0x6b'))){_0x2af295['limit']=qs[_0x694a('0x32')](_0x44b469[_0x694a('0x46')]['limit']);_0x2af295[_0x694a('0x30')]=qs[_0x694a('0x30')](_0x44b469[_0x694a('0x46')][_0x694a('0x30')]);}return _0x5bd34d[_0x694a('0x81')](_0x2af295);}})[_0x694a('0x22')](function(_0x3f5b6f){if(_0x3f5b6f){return _0x3f5b6f?{'count':_0x25f337,'rows':_0x3f5b6f}:null;}})['then'](respondWithResult(_0x5e9e1c,null))['catch'](handleError(_0x5e9e1c,null));};function Extension(_0x590a77,_0x3b4191,_0x491c60,_0x5eefa9){this[_0x694a('0x82')]=_0x694a('0x83');this[_0x694a('0x84')]=_0x590a77[_0x694a('0x85')];this['app']=_0x5eefa9;this['type']=_0x694a('0x86');this[_0x694a('0x87')]=_0x694a('0x88');this['FaxAccountId']=_0x590a77['id'];this[_0x694a('0x89')]=_0x3b4191;this[_0x694a('0x8a')]=_0x491c60;}function createExtensionsReciveFax(_0x50a5bd){var _0x4e5944=0x1;var _0x1da1c3=[];_0x1da1c3[_0x694a('0x8b')](new Extension(_0x50a5bd,_0x4e5944,'',_0x694a('0x8c')));_0x4e5944+=0x1;_0x1da1c3['push'](new Extension(_0x50a5bd,_0x4e5944,_0x694a('0x8d'),_0x694a('0x8e')));_0x4e5944+=0x1;for(var _0x24f754 in _0x50a5bd){if(_0x50a5bd[_0x694a('0x4d')](_0x24f754)&&(_0x24f754==='ecm'||_0x24f754==='localstationid'||_0x24f754==='gateway'||_0x24f754===_0x694a('0x8f')||_0x24f754==='headerinfo'||_0x24f754===_0x694a('0x90')||_0x24f754===_0x694a('0x91')||_0x24f754==='modem'||_0x24f754===_0x694a('0x92'))){_0x1da1c3[_0x694a('0x8b')](new Extension(_0x50a5bd,_0x4e5944,_0x694a('0x93')+_0x24f754+')='+_0x50a5bd[_0x24f754],_0x694a('0x8e')));_0x4e5944+=0x1;}}_0x1da1c3['push'](new Extension(_0x50a5bd,_0x4e5944,'6',_0x694a('0x94')));_0x4e5944+=0x1;_0x1da1c3['push'](new Extension(_0x50a5bd,_0x4e5944,_0x694a('0x95'),_0x694a('0x96')));_0x4e5944=0x0;return _0x1da1c3;}exports['addAccountApplications']=function(_0x557224,_0xd56059,_0x25f862){var _0xd84be2;return db[_0x694a('0x7c')][_0x694a('0x7d')](function(_0x46d793){return db[_0x694a('0x42')][_0x694a('0x5d')](_0x557224[_0x694a('0x5e')],{'transaction':_0x46d793})[_0x694a('0x22')](function(_0x4c22c3){_0xd84be2=_0x4c22c3[_0x694a('0x39')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0xd84be2),{'transaction':_0x46d793});});})[_0x694a('0x22')](function(){return _0xd84be2;})[_0x694a('0x22')](respondWithResult(_0xd56059,null))[_0x694a('0x2c')](handleError(_0xd56059,null));};exports['updateAccountApplications']=function(_0x3d292a,_0x2aef90,_0x3309a7){var _0x86bec2;return db[_0x694a('0x7c')][_0x694a('0x7d')](function(_0x116f66){return db[_0x694a('0x42')][_0x694a('0x37')](_0x3d292a[_0x694a('0x5e')],{'where':{'id':_0x3d292a['body']['id']},'transaction':_0x116f66})[_0x694a('0x22')](function(_0x543bd9){return db[_0x694a('0x97')][_0x694a('0x38')]({'where':{'FaxAccountId':_0x3d292a[_0x694a('0x5e')]['id']},'transaction':_0x116f66})[_0x694a('0x22')](function(_0x37cc4a){return db[_0x694a('0x97')][_0x694a('0x7f')](createExtensionsReciveFax(_['omit'](_0x3d292a['body'],[_0x694a('0x98'),_0x694a('0x44'),'createdAt',_0x694a('0x99'),_0x694a('0x9a'),_0x694a('0x9b')])),{'transaction':_0x116f66});});});})[_0x694a('0x22')](function(){return db[_0x694a('0x42')][_0x694a('0x9c')](_0x3d292a[_0x694a('0x5e')]['id']);})[_0x694a('0x22')](respondWithResult(_0x2aef90,null))[_0x694a('0x2c')](handleError(_0x2aef90,null));};exports[_0x694a('0x9d')]=function(_0x530bb0,_0x54867a,_0x3885b5){var _0x4bf66d={'raw':!![],'where':{}};var _0x5208e7={};var _0x59a6cb={'count':0x0,'rows':[]};return db[_0x694a('0x42')][_0x694a('0x69')]({'where':{'id':_0x530bb0[_0x694a('0x59')]['id']}})['then'](handleEntityNotFound(_0x54867a,null))[_0x694a('0x22')](function(_0xf590f8){if(_0xf590f8){_0x5208e7[_0x694a('0x45')]=_['keys'](db[_0x694a('0x9e')][_0x694a('0x43')]);_0x5208e7[_0x694a('0x46')]=_['keys'](_0x530bb0[_0x694a('0x46')]);_0x5208e7[_0x694a('0x48')]=_[_0x694a('0x49')](_0x5208e7[_0x694a('0x45')],_0x5208e7[_0x694a('0x46')]);_0x4bf66d[_0x694a('0x4a')]=_[_0x694a('0x49')](_0x5208e7[_0x694a('0x45')],qs['fields'](_0x530bb0['query'][_0x694a('0x4b')]));_0x4bf66d[_0x694a('0x4a')]=_0x4bf66d[_0x694a('0x4a')][_0x694a('0x4c')]?_0x4bf66d[_0x694a('0x4a')]:_0x5208e7[_0x694a('0x45')];if(!_0x530bb0[_0x694a('0x46')][_0x694a('0x4d')]('nolimit')){_0x4bf66d[_0x694a('0x32')]=qs[_0x694a('0x32')](_0x530bb0[_0x694a('0x46')][_0x694a('0x32')]);_0x4bf66d[_0x694a('0x30')]=qs[_0x694a('0x30')](_0x530bb0[_0x694a('0x46')][_0x694a('0x30')]);}_0x4bf66d[_0x694a('0x4e')]=qs[_0x694a('0x4f')](_0x530bb0[_0x694a('0x46')][_0x694a('0x4f')]);_0x4bf66d[_0x694a('0x52')]=qs[_0x694a('0x48')](_['pick'](_0x530bb0[_0x694a('0x46')],_0x5208e7[_0x694a('0x48')]));_0x4bf66d[_0x694a('0x52')][_0x694a('0x67')]=_0xf590f8['id'];if(_0x530bb0[_0x694a('0x46')]['filter']){_0x4bf66d[_0x694a('0x52')]=_[_0x694a('0x53')](_0x4bf66d[_0x694a('0x52')],{'$or':_['map'](_0x4bf66d[_0x694a('0x4a')],function(_0x103ae9){var _0x578f14={};_0x578f14[_0x103ae9]={'$like':'%'+_0x530bb0['query']['filter']+'%'};return _0x578f14;})});}if(_0x530bb0[_0x694a('0x46')][_0x694a('0x9f')]){var _0x1072b1=_0x530bb0[_0x694a('0x46')]['$gte'][_0x694a('0xa0')](',');var _0x2531eb={};_0x2531eb[_0x1072b1[0x0]]={'$gte':moment(_0x1072b1[0x1])[_0x694a('0xa1')](_0x694a('0xa2'))};_0x4bf66d[_0x694a('0x52')]=_[_0x694a('0x53')](_0x4bf66d[_0x694a('0x52')],_0x2531eb);}_0x4bf66d=_[_0x694a('0x53')]({},_0x4bf66d,_0x530bb0['options']);return db[_0x694a('0x9e')][_0x694a('0x33')]({'where':_0x4bf66d[_0x694a('0x52')]})[_0x694a('0x22')](function(_0x34cb3e){_0x59a6cb[_0x694a('0x33')]=_0x34cb3e;if(_0x530bb0[_0x694a('0x46')][_0x694a('0x55')]){_0x4bf66d[_0x694a('0x5b')]=[{'all':!![]}];}return db[_0x694a('0x9e')][_0x694a('0x56')](_0x4bf66d);})[_0x694a('0x22')](function(_0x2f462){_0x59a6cb[_0x694a('0x57')]=_0x2f462;return _0x59a6cb;});}})[_0x694a('0x22')](respondWithFilteredResult(_0x54867a,_0x4bf66d))['catch'](handleError(_0x54867a,null));};exports[_0x694a('0x3e')]=function(_0x13d0d4,_0x4d0d10,_0x5a419d){var _0x593ef3,_0x34d01a={},_0x3fe0ef;if(_0x13d0d4[_0x694a('0x5e')]['to']){_0x3fe0ef=_0x13d0d4[_0x694a('0x5e')]['to'][0x0];}return db[_0x694a('0x42')][_0x694a('0x5c')]({'where':{'id':_0x13d0d4[_0x694a('0x59')]['id']},'include':[{'model':db[_0x694a('0xa3')],'as':'List','include':[{'model':db[_0x694a('0x75')],'as':'Contacts','where':{'fax':_0x3fe0ef},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x4d0d10,null))[_0x694a('0x22')](function(_0x48ce2d){_0x593ef3=_0x48ce2d;if(_0x13d0d4['body']['attachments']&&_0x13d0d4[_0x694a('0x5e')][_0x694a('0xa4')][_0x694a('0x4c')]){for(var _0x4f9ff1=0x0;_0x4f9ff1<_0x13d0d4[_0x694a('0x5e')][_0x694a('0xa4')][_0x694a('0x4c')];_0x4f9ff1+=0x1){_0x13d0d4[_0x694a('0x5e')][_0x694a('0xa4')][_0x4f9ff1]={'filename':_0x13d0d4['body']['attachments'][_0x4f9ff1][_0x694a('0x3d')],'id':_0x13d0d4[_0x694a('0x5e')][_0x694a('0xa4')][_0x4f9ff1]['id'],'path':path['join'](config[_0x694a('0xa5')],_0x694a('0xa6'),_0x13d0d4['body']['attachments'][_0x4f9ff1][_0x694a('0xa7')])};}}return respondWithRpcPromise('CheckAfterSend',_0x694a('0xa8'),{'FaxAccountId':_['isNil'](_0x13d0d4[_0x694a('0x59')]['id'])?undefined:_0x13d0d4[_0x694a('0x59')]['id'],'path':_[_0x694a('0xa9')](_0x13d0d4[_0x694a('0x5e')]['attachments'][0x0][_0x694a('0x8')])?undefined:_0x13d0d4[_0x694a('0x5e')][_0x694a('0xa4')][0x0][_0x694a('0x8')],'fax':_['isNil'](_0x13d0d4['body']['to'][0x0])?undefined:_0x13d0d4[_0x694a('0x5e')]['to'][0x0]},client9002);})[_0x694a('0x22')](function(){if(_0x593ef3){if(_[_0x694a('0xa9')](_0x13d0d4[_0x694a('0x5e')]['from'])){_0x13d0d4[_0x694a('0x5e')][_0x694a('0xaa')]=util['format']('\x22%s\x22\x20<%s>',_0x593ef3[_0x694a('0x3d')],_0x593ef3[_0x694a('0xab')]);}if(_0x593ef3[_0x694a('0xac')]){if(_0x593ef3[_0x694a('0xac')][_0x694a('0xad')]['length']){return _0x593ef3[_0x694a('0xac')][_0x694a('0xad')][0x0];}else{return db[_0x694a('0x75')][_0x694a('0x5d')](_[_0x694a('0x19')](_0x13d0d4[_0x694a('0x5e')],{'firstName':_0x13d0d4[_0x694a('0x5e')]['to'][0x0],'phone':_0x13d0d4['body']['to'][0x0],'fax':_0x13d0d4[_0x694a('0x5e')]['to'][0x0],'ListId':_0x593ef3['ListId']}));}}else{throw new Error(_0x694a('0xae'));}}else{throw new Error(_0x694a('0xaf'));}})[_0x694a('0x22')](function(_0x1c405e){if(_0x1c405e){return db[_0x694a('0xb0')]['find']({'where':{'ContactId':_0x1c405e['id'],'closed':![],'FaxAccountId':_0x593ef3['id']}})[_0x694a('0x22')](function(_0x585141){if(_0x585141){return[_0x585141,![]];}return db[_0x694a('0xb0')][_0x694a('0x5d')]({'UserId':_0x13d0d4[_0x694a('0x5f')]['id'],'ContactId':_0x1c405e['id'],'FaxAccountId':_0x593ef3['id'],'fax':_0x13d0d4[_0x694a('0x5e')]['to'][0x0],'firstMsgDirection':_0x694a('0xb1'),'Messages':[_['merge'](_0x13d0d4['body'],{'read':![],'body':_0x13d0d4[_0x694a('0x5e')][_0x694a('0xa4')][0x0]['filename'],'FaxAccountId':_0x593ef3['id'],'UserId':_0x13d0d4['user']['id'],'ContactId':_0x1c405e['id'],'AttachmentId':_0x13d0d4[_0x694a('0x5e')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x694a('0x9e')],'as':'Messages'}]})[_0x694a('0x22')](function(_0xa83b06){return[_0xa83b06,!![]];});});}else{throw new Error(_0x694a('0xb2'));}})[_0x694a('0xb3')](function(_0x43a405,_0x2c489a){if(_0x2c489a){return _0x43a405;}return db[_0x694a('0x9e')][_0x694a('0x5d')]({'direction':_0x694a('0xb1'),'read':![],'body':_0x13d0d4['body'][_0x694a('0xa4')][0x0][_0x694a('0xb4')],'FaxAccountId':_0x593ef3['id'],'FaxInteractionId':_0x43a405['id'],'UserId':_0x13d0d4[_0x694a('0x5f')]['id'],'ContactId':_0x43a405[_0x694a('0xb5')],'AttachmentId':_0x13d0d4['body'][_0x694a('0xa4')][0x0]['id']})[_0x694a('0x22')](function(_0x693c36){_0x43a405[_0x694a('0xb6')][_0x694a('0xb7')]=[];_0x43a405[_0x694a('0xb6')][_0x694a('0xb7')][_0x694a('0x8b')](_0x693c36[_0x694a('0xb6')]);return _0x43a405;});})[_0x694a('0x22')](function(_0x5708b9){respondWithRpcPromise(_0x694a('0xb8'),'SendFax',{'FaxAccountId':_['isNil'](_0x13d0d4[_0x694a('0x59')]['id'])?undefined:_0x13d0d4['params']['id'],'path':_[_0x694a('0xa9')](_0x13d0d4[_0x694a('0x5e')][_0x694a('0xa4')][0x0][_0x694a('0x8')])?undefined:_0x13d0d4[_0x694a('0x5e')][_0x694a('0xa4')][0x0][_0x694a('0x8')],'fax':_[_0x694a('0xa9')](_0x13d0d4['body']['to'][0x0])?undefined:_0x13d0d4['body']['to'][0x0],'AttachmentId':_0x13d0d4[_0x694a('0x5e')][_0x694a('0xa4')][0x0]['id']},client9002)['then'](function(_0x5e4460){logger[_0x694a('0x23')](_0x694a('0xb9'),_0x5e4460);})['catch'](function(_0x11d2f7){logger[_0x694a('0x23')](_0x694a('0xb9'),_0x11d2f7);});return _0x5708b9;})[_0x694a('0x22')](respondWithResult(_0x4d0d10,null))[_0x694a('0x2c')](handleError(_0x4d0d10,null));};exports[_0x694a('0xba')]=function(_0x5ea744,_0x3bd2b5,_0x40cb0d){return db[_0x694a('0x42')][_0x694a('0x5c')]({'where':{'id':_0x5ea744[_0x694a('0x59')]['id']}})[_0x694a('0x22')](handleEntityNotFound(_0x3bd2b5,null))['then'](function(_0x5a7ad1){if(_0x5a7ad1){return _0x5a7ad1[_0x694a('0xba')](_0x5ea744[_0x694a('0x5e')]['ids'],_[_0x694a('0x73')](_0x5ea744['body'],[_0x694a('0x6d'),'id'])||{})[_0x694a('0xb3')](function(_0xad37){for(var _0x47ef1e=0x0;_0x47ef1e<_0x5ea744[_0x694a('0x5e')]['ids'][_0x694a('0x4c')];_0x47ef1e+=0x1){socket[_0x694a('0xbb')](_0x694a('0xbc'),{'UserId':Number(_0x5ea744['body'][_0x694a('0x6d')][_0x47ef1e]),'FaxAccountId':Number(_0x5ea744['params']['id'])});}return _0xad37;});}})[_0x694a('0x22')](respondWithResult(_0x3bd2b5,null))[_0x694a('0x2c')](handleError(_0x3bd2b5,null));};exports[_0x694a('0xbd')]=function(_0x55818d,_0x25a0bf,_0x474c2f){return db['FaxAccount']['find']({'where':{'id':_0x55818d[_0x694a('0x59')]['id']}})['then'](handleEntityNotFound(_0x25a0bf,null))[_0x694a('0x22')](function(_0x32a5a7){if(_0x32a5a7){return _0x32a5a7[_0x694a('0xbd')](_0x55818d['query'][_0x694a('0x6d')])[_0x694a('0x22')](function(){if(_[_0x694a('0xbe')](_0x55818d[_0x694a('0x46')]['ids'])){for(var _0x1950c0=0x0;_0x1950c0<_0x55818d[_0x694a('0x46')][_0x694a('0x6d')][_0x694a('0x4c')];_0x1950c0+=0x1){socket['emit'](_0x694a('0xbf'),{'UserId':Number(_0x55818d[_0x694a('0x46')]['ids'][_0x1950c0]),'FaxAccountId':Number(_0x55818d['params']['id'])});}}else{socket['emit'](_0x694a('0xbf'),{'UserId':Number(_0x55818d[_0x694a('0x46')][_0x694a('0x6d')]),'FaxAccountId':Number(_0x55818d[_0x694a('0x59')]['id'])});}});}})[_0x694a('0x22')](respondWithStatusCode(_0x25a0bf,null))[_0x694a('0x2c')](handleError(_0x25a0bf,null));};exports['getAgents']=function(_0x2f8085,_0x1e421d,_0x49e27f){var _0x2e733d={};var _0x44a6d6={};var _0x4ab0b6;var _0x291b07;return db[_0x694a('0x42')]['findOne']({'where':{'id':_0x2f8085[_0x694a('0x59')]['id']}})['then'](handleEntityNotFound(_0x1e421d,null))[_0x694a('0x22')](function(_0x4631db){if(_0x4631db){_0x4ab0b6=_0x4631db;_0x44a6d6[_0x694a('0x45')]=_['keys'](db[_0x694a('0x77')][_0x694a('0x43')]);_0x44a6d6[_0x694a('0x46')]=_[_0x694a('0x47')](_0x2f8085[_0x694a('0x46')]);_0x44a6d6[_0x694a('0x48')]=_[_0x694a('0x49')](_0x44a6d6[_0x694a('0x45')],_0x44a6d6[_0x694a('0x46')]);_0x2e733d['attributes']=_[_0x694a('0x49')](_0x44a6d6[_0x694a('0x45')],qs['fields'](_0x2f8085['query'][_0x694a('0x4b')]));_0x2e733d[_0x694a('0x4a')]=_0x2e733d[_0x694a('0x4a')][_0x694a('0x4c')]?_0x2e733d['attributes']:_0x44a6d6['model'];_0x2e733d[_0x694a('0x4e')]=qs[_0x694a('0x4f')](_0x2f8085[_0x694a('0x46')][_0x694a('0x4f')]);_0x2e733d[_0x694a('0x52')]=qs[_0x694a('0x48')](_[_0x694a('0x50')](_0x2f8085['query'],_0x44a6d6[_0x694a('0x48')]));if(_0x2f8085[_0x694a('0x46')][_0x694a('0x51')]){_0x2e733d[_0x694a('0x52')]=_[_0x694a('0x53')](_0x2e733d[_0x694a('0x52')],{'$or':_[_0x694a('0x41')](_0x2e733d[_0x694a('0x4a')],function(_0x246f47){var _0x19b4bc={};_0x19b4bc[_0x246f47]={'$like':'%'+_0x2f8085[_0x694a('0x46')]['filter']+'%'};return _0x19b4bc;})});}_0x2e733d=_[_0x694a('0x53')]({},_0x2e733d,_0x2f8085[_0x694a('0x54')]);return _0x4ab0b6[_0x694a('0xc0')](_0x2e733d);}})[_0x694a('0x22')](function(_0x5e35c3){if(_0x5e35c3){_0x291b07=_0x5e35c3['length'];if(!_0x2f8085['query'][_0x694a('0x4d')]('nolimit')){_0x2e733d[_0x694a('0x32')]=qs[_0x694a('0x32')](_0x2f8085[_0x694a('0x46')][_0x694a('0x32')]);_0x2e733d[_0x694a('0x30')]=qs[_0x694a('0x30')](_0x2f8085[_0x694a('0x46')][_0x694a('0x30')]);}return _0x4ab0b6[_0x694a('0xc0')](_0x2e733d);}})[_0x694a('0x22')](function(_0x5a424d){if(_0x5a424d){return _0x5a424d?{'count':_0x291b07,'rows':_0x5a424d}:null;}})['then'](respondWithResult(_0x1e421d,null))[_0x694a('0x2c')](handleError(_0x1e421d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index ef75e88..f992494 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 _0x33a5=['emit','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x33a5,0x125));var _0x533a=function(_0x35f02d,_0x1e24e9){_0x35f02d=_0x35f02d-0x0;var _0x299593=_0x33a5[_0x35f02d];return _0x299593;};'use strict';var EventEmitter=require(_0x533a('0x0'));var FaxAccount=require(_0x533a('0x1'))['db'][_0x533a('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x533a('0x3')](0x0);var events={'afterCreate':_0x533a('0x4'),'afterUpdate':_0x533a('0x5'),'afterDestroy':_0x533a('0x6')};function emitEvent(_0x50db4f){return function(_0x95b42,_0x16b2da,_0x24ade8){FaxAccountEvents[_0x533a('0x7')](_0x50db4f+':'+_0x95b42['id'],_0x95b42);FaxAccountEvents[_0x533a('0x7')](_0x50db4f,_0x95b42);_0x24ade8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x533a('0x8')](e,emitEvent(event));}}module[_0x533a('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x1a58=['exports','events','FaxAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x1f6e83,_0x1b8b02){var _0x58b9d8=function(_0x252e7c){while(--_0x252e7c){_0x1f6e83['push'](_0x1f6e83['shift']());}};_0x58b9d8(++_0x1b8b02);}(_0x1a58,0x17b));var _0x81a5=function(_0x17e9b0,_0x3dc934){_0x17e9b0=_0x17e9b0-0x0;var _0x2bc59f=_0x1a58[_0x17e9b0];return _0x2bc59f;};'use strict';var EventEmitter=require(_0x81a5('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x81a5('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x81a5('0x2')](0x0);var events={'afterCreate':_0x81a5('0x3'),'afterUpdate':_0x81a5('0x4'),'afterDestroy':_0x81a5('0x5')};function emitEvent(_0x5b96eb){return function(_0x57dc14,_0xb12256,_0x25441c){FaxAccountEvents[_0x81a5('0x6')](_0x5b96eb+':'+_0x57dc14['id'],_0x57dc14);FaxAccountEvents['emit'](_0x5b96eb,_0x57dc14);_0x25441c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x81a5('0x7')](e,emitEvent(event));}}module[_0x81a5('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 07f5a50..d69f897 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 _0xb078=['rimraf','../../config/environment','./faxAccount.attributes','define','fax_accounts','lodash','util','../../config/logger','moment'];(function(_0x4f75b5,_0x4db76d){var _0x5c263b=function(_0x31e622){while(--_0x31e622){_0x4f75b5['push'](_0x4f75b5['shift']());}};_0x5c263b(++_0x4db76d);}(_0xb078,0xa7));var _0x8b07=function(_0x154005,_0x211db9){_0x154005=_0x154005-0x0;var _0x124e8a=_0xb078[_0x154005];return _0x124e8a;};'use strict';var _=require(_0x8b07('0x0'));var util=require(_0x8b07('0x1'));var logger=require(_0x8b07('0x2'))('api');var moment=require(_0x8b07('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8b07('0x4'));var config=require(_0x8b07('0x5'));var attributes=require(_0x8b07('0x6'));module['exports']=function(_0x404c29,_0xd177ea){return _0x404c29[_0x8b07('0x7')]('FaxAccount',attributes,{'tableName':_0x8b07('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7ab=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','api','moment'];(function(_0x402282,_0x615de3){var _0x4f65af=function(_0x4a20f7){while(--_0x4a20f7){_0x402282['push'](_0x402282['shift']());}};_0x4f65af(++_0x615de3);}(_0xe7ab,0x168));var _0xbe7a=function(_0x6a1c13,_0x239142){_0x6a1c13=_0x6a1c13-0x0;var _0x4301a5=_0xe7ab[_0x6a1c13];return _0x4301a5;};'use strict';var _=require(_0xbe7a('0x0'));var util=require('util');var logger=require(_0xbe7a('0x1'))(_0xbe7a('0x2'));var moment=require(_0xbe7a('0x3'));var BPromise=require(_0xbe7a('0x4'));var rp=require(_0xbe7a('0x5'));var fs=require('fs');var path=require(_0xbe7a('0x6'));var rimraf=require(_0xbe7a('0x7'));var config=require(_0xbe7a('0x8'));var attributes=require('./faxAccount.attributes');module[_0xbe7a('0x9')]=function(_0x56d03a,_0x5dee19){return _0x56d03a[_0xbe7a('0xa')](_0xbe7a('0xb'),attributes,{'tableName':_0xbe7a('0xc'),'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 fc9ab25..54d1706 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 _0xcce9=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','updatedAt','DESC','Applications','get','applications','list','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./faxAccount.socket','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxAccount,\x20%s,\x20%s','message','result','FaxAccount','findAll','options','raw','where','attributes','limit','map','model','include','GetFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x1fe5b0,_0x1de371){var _0x485ea8=function(_0x3b7d07){while(--_0x3b7d07){_0x1fe5b0['push'](_0x1fe5b0['shift']());}};_0x485ea8(++_0x1de371);}(_0xcce9,0x1ec));var _0x9cce=function(_0x2ec0de,_0x4d7304){_0x2ec0de=_0x2ec0de-0x0;var _0x21535d=_0xcce9[_0x2ec0de];return _0x21535d;};'use strict';var _=require(_0x9cce('0x0'));var util=require('util');var moment=require(_0x9cce('0x1'));var BPromise=require(_0x9cce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cce('0x3'));var db=require(_0x9cce('0x4'))['db'];var utils=require(_0x9cce('0x5'));var logger=require('../../config/logger')(_0x9cce('0x6'));var config=require(_0x9cce('0x7'));var jayson=require(_0x9cce('0x8'));var client=jayson[_0x9cce('0x9')][_0x9cce('0xa')]({'port':0x232c});config['redis']=_[_0x9cce('0xb')](config['redis'],{'host':_0x9cce('0xc'),'port':0x18eb});var socket=require(_0x9cce('0xd'))(new Redis(config['redis']));require(_0x9cce('0xe'))['register'](socket);function respondWithRpcPromise(_0x4115a2,_0x8aa9f7,_0x58cb64){return new BPromise(function(_0x5b8677,_0x4b3f54){return client['request'](_0x4115a2,_0x58cb64)[_0x9cce('0xf')](function(_0x15c045){logger[_0x9cce('0x10')]('FaxAccount,\x20%s,\x20%s',_0x8aa9f7,'request\x20sent');logger[_0x9cce('0x11')](_0x9cce('0x12'),_0x8aa9f7,_0x9cce('0x13'),JSON[_0x9cce('0x14')](_0x15c045));if(_0x15c045[_0x9cce('0x15')]){if(_0x15c045['error']['code']===0x1f4){logger[_0x9cce('0x15')](_0x9cce('0x16'),_0x8aa9f7,_0x15c045['error']['message']);return _0x4b3f54(_0x15c045[_0x9cce('0x15')]['message']);}logger[_0x9cce('0x15')](_0x9cce('0x16'),_0x8aa9f7,_0x15c045[_0x9cce('0x15')][_0x9cce('0x17')]);return _0x5b8677(_0x15c045[_0x9cce('0x15')][_0x9cce('0x17')]);}else{logger['info'](_0x9cce('0x16'),_0x8aa9f7,_0x9cce('0x13'));_0x5b8677(_0x15c045[_0x9cce('0x18')][_0x9cce('0x17')]);}})['catch'](function(_0x8eb2e){logger[_0x9cce('0x15')]('FaxAccount,\x20%s,\x20%s',_0x8aa9f7,_0x8eb2e);_0x4b3f54(_0x8eb2e);});});}exports['GetFaxAccount']=function(_0x449b48){var _0x28a411=this;return new Promise(function(_0xae8446,_0x1231ca){return db[_0x9cce('0x19')][_0x9cce('0x1a')]({'raw':_0x449b48[_0x9cce('0x1b')]?_0x449b48[_0x9cce('0x1b')][_0x9cce('0x1c')]===undefined?!![]:![]:!![],'where':_0x449b48['options']?_0x449b48['options'][_0x9cce('0x1d')]||null:null,'attributes':_0x449b48[_0x9cce('0x1b')]?_0x449b48['options'][_0x9cce('0x1e')]||null:null,'limit':_0x449b48[_0x9cce('0x1b')]?_0x449b48[_0x9cce('0x1b')][_0x9cce('0x1f')]||null:null,'include':_0x449b48[_0x9cce('0x1b')]?_0x449b48[_0x9cce('0x1b')]['include']?_[_0x9cce('0x20')](_0x449b48['options']['include'],function(_0x18bf97){return{'model':db[_0x18bf97[_0x9cce('0x21')]],'as':_0x18bf97['as'],'attributes':_0x18bf97[_0x9cce('0x1e')],'include':_0x18bf97[_0x9cce('0x22')]?_[_0x9cce('0x20')](_0x18bf97[_0x9cce('0x22')],function(_0x3da44c){return{'model':db[_0x3da44c[_0x9cce('0x21')]],'as':_0x3da44c['as'],'attributes':_0x3da44c[_0x9cce('0x1e')],'include':_0x3da44c[_0x9cce('0x22')]?_[_0x9cce('0x20')](_0x3da44c['include'],function(_0x42f8e6){return{'model':db[_0x42f8e6[_0x9cce('0x21')]],'as':_0x42f8e6['as'],'attributes':_0x42f8e6['attributes']};}):[]};}):[]};}):[]:[]})[_0x9cce('0xf')](function(_0x508aec){logger[_0x9cce('0x10')]('GetFaxAccount',_0x449b48);logger[_0x9cce('0x11')]('GetFaxAccount',_0x449b48,JSON[_0x9cce('0x14')](_0x508aec));_0xae8446(_0x508aec);})['catch'](function(_0x225a3e){logger[_0x9cce('0x15')](_0x9cce('0x23'),_0x225a3e[_0x9cce('0x17')],_0x449b48);_0x1231ca(_0x28a411[_0x9cce('0x15')](0x1f4,_0x225a3e[_0x9cce('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x1f379c,_0xd398f9,_0x46cb94){var _0x16d4c2=this;return new Promise(function(_0x50cdc7,_0x950ca3){var _0x306e29={'body':_0x1f379c[_0x9cce('0x24')],'channel':_0x9cce('0x25')};var _0x1cb1dd=[];var _0xa0b3b=[];var _0x5aeaf6={};return db[_0x9cce('0x26')][_0x9cce('0x27')]()[_0x9cce('0xf')](function(_0x5209f3){if(!_0x5209f3){throw new db[(_0x9cce('0x28'))][(_0x9cce('0x29'))](_0x9cce('0x2a'));}_0x1cb1dd=_['difference'](_['keys'](_0x5209f3),[_0x9cce('0x2b'),'updatedAt']);_0xa0b3b=_[_0x9cce('0x2c')](_['keys'](_0x5209f3),[_0x9cce('0x2b'),'updatedAt',_0x9cce('0x2d'),_0x9cce('0x2e')]);if(_0x1f379c[_0x9cce('0x24')]['id']){delete _0x1f379c[_0x9cce('0x24')]['id'];}if(_['isNil'](_0x1f379c[_0x9cce('0x24')][_0x9cce('0x2f')])){throw new db[(_0x9cce('0x28'))][(_0x9cce('0x29'))](_0x9cce('0x30'));}if(_[_0x9cce('0x31')](_0x1f379c[_0x9cce('0x24')][_0x9cce('0x24')])||_0x1f379c[_0x9cce('0x24')][_0x9cce('0x24')]===''){throw new db[(_0x9cce('0x28'))]['ValidationError'](_0x9cce('0x32'));}if(_[_0x9cce('0x31')](_0x1f379c['body'][_0x9cce('0x33')])){throw new db[(_0x9cce('0x28'))][(_0x9cce('0x29'))](_0x9cce('0x34')+_0xa0b3b);}if(!_[_0x9cce('0x35')](_0xa0b3b,_0x1f379c[_0x9cce('0x24')]['mapKey'])){throw new db[(_0x9cce('0x28'))]['ValidationError'](_0x9cce('0x36')+_0xa0b3b);}_0x5aeaf6[_0x1f379c[_0x9cce('0x24')]['mapKey']]=_0x1f379c['body'][_0x9cce('0x2f')];})['then'](function(){return db[_0x9cce('0x19')][_0x9cce('0x37')]({'where':{'id':_0x1f379c[_0x9cce('0x38')]['id']},'include':[{'model':db[_0x9cce('0x39')],'as':_0x9cce('0x3a'),'include':[{'model':db['CmContact'],'as':_0x9cce('0x3b'),'where':_0x5aeaf6,'limit':0x1,'order':[[_0x9cce('0x3c'),_0x9cce('0x3d')]]}]},{'model':db['FaxApplication'],'as':_0x9cce('0x3e')}]});})['then'](function(_0x591edc){if(_0x591edc&&_0x591edc[_0x9cce('0x3a')]){var _0x56d5fd=_0x591edc[_0x9cce('0x3f')]({'plain':!![]});_0x306e29['account']=_0x56d5fd;_0x306e29[_0x9cce('0x40')]=_0x56d5fd[_0x9cce('0x3e')];_0x306e29[_0x9cce('0x41')]=_0x56d5fd[_0x9cce('0x3a')];_0x306e29['applications']=_[_0x9cce('0x42')](_0x306e29['applications'],[_0x9cce('0x43')],[_0x9cce('0x44')]);if(_0x306e29[_0x9cce('0x38')][_0x9cce('0x3e')]){delete _0x306e29[_0x9cce('0x38')]['Applications'];}if(_0x306e29[_0x9cce('0x38')]['List']&&_0x306e29[_0x9cce('0x38')]['List'][_0x9cce('0x3b')][_0x9cce('0x45')]){return _0x306e29['account'][_0x9cce('0x3a')][_0x9cce('0x3b')][0x0];}var _0x40f3d1=_[_0x9cce('0xb')](_0x1f379c[_0x9cce('0x24')],{'firstName':_0x1f379c[_0x9cce('0x24')][_0x9cce('0x2f')],'ListId':_0x56d5fd[_0x9cce('0x2e')]});_0x40f3d1[_0x1f379c[_0x9cce('0x24')][_0x9cce('0x33')]]=_0x1f379c[_0x9cce('0x24')][_0x9cce('0x2f')];return db[_0x9cce('0x26')][_0x9cce('0x46')](_0x40f3d1,{'fields':_0x1cb1dd,'raw':!![]});}})['then'](function(_0x2089d6){_0x306e29[_0x9cce('0x47')]=_0x2089d6;if(_0x2089d6){var _0x1f8a8f={'ContactId':_0x2089d6['id'],'FaxAccountId':_0x1f379c['account']['id'],'fax':_0x2089d6['fax']};return db[_0x9cce('0x48')][_0x9cce('0x37')]({'where':{'ContactId':_0x2089d6['id'],'closed':![],'FaxAccountId':_0x1f379c[_0x9cce('0x38')]['id']}})[_0x9cce('0xf')](function(_0x4ea9d6){if(_0x4ea9d6){return[_0x4ea9d6,![]];}return db['FaxInteraction'][_0x9cce('0x46')](_0x1f8a8f)[_0x9cce('0xf')](function(_0x51b5e3){return[_0x51b5e3,!![]];});});}else{throw new Error(_0x9cce('0x49'));}})[_0x9cce('0x4a')](function(_0x81cf1e,_0x4416ee){var _0x501e9b=_0x81cf1e[_0x9cce('0x3f')]({'plain':!![]});if(_0x4416ee){if(_0x306e29['account']['autoclose']){_0x306e29[_0x9cce('0x40')][_0x9cce('0x4b')]({'id':0x0,'priority':_0x306e29[_0x9cce('0x40')][_0x9cce('0x45')]+0x1,'app':_0x9cce('0x4c'),'appdata':_0x9cce('0x4d'),'interval':_0x9cce('0x4e')});}_0x501e9b['created']=!![];}else{_0x501e9b[_0x9cce('0x4f')]=![];}_0x306e29[_0x9cce('0x50')]=_0x501e9b;return db[_0x9cce('0x51')][_0x9cce('0x46')]({'body':_0x1f379c[_0x9cce('0x24')][_0x9cce('0x24')],'FaxAccountId':_0x1f379c[_0x9cce('0x38')]['id'],'FaxInteractionId':_0x81cf1e['id'],'direction':'in','ContactId':_0x81cf1e[_0x9cce('0x52')],'AttachmentId':_0x1f379c[_0x9cce('0x24')]['AttachmentId']});})[_0x9cce('0xf')](function(_0x9e6f8c){_0x306e29['message']=_0x9e6f8c;if(_0x306e29['interaction']['UserId']){return db[_0x9cce('0x53')][_0x9cce('0x37')]({'attributes':['id',_0x9cce('0x54')],'where':{'id':_0x306e29[_0x9cce('0x50')]['UserId']}})[_0x9cce('0xf')](function(_0x2f8919){if(_0x2f8919){_0x306e29[_0x9cce('0x40')][_0x9cce('0x55')]({'id':0x0,'priority':0x0,'app':_0x9cce('0x56'),'appdata':_0x2f8919['name']+','+(_0x306e29['account'][_0x9cce('0x57')]||0xa),'interval':_0x9cce('0x4e')});}return respondWithRpcPromise('Start','startRouting',_0x306e29);});}return respondWithRpcPromise(_0x9cce('0x58'),_0x9cce('0x59'),_0x306e29);})['then'](function(_0x238a47){_0x50cdc7(_0x238a47);})[_0x9cce('0x5a')](function(_0x4b3d7b){_0x950ca3(_0x16d4c2[_0x9cce('0x15')](0x1f4,_0x4b3d7b[_0x9cce('0x17')]));});});}; \ No newline at end of file +var _0x4e61=['CmContact','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','isNil','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','FaxAccount','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','priority','create','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','length','unmanaged','*,*,*,*','interaction','ContactId','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./faxAccount.socket','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetFaxAccount','findAll','options','raw','attributes','include','map','model','stringify','NotifyFaxAccount','body'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x4e61,0x1e1));var _0x14e6=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x4e61[_0x2112d4];return _0x434972;};'use strict';var _=require('lodash');var util=require(_0x14e6('0x0'));var moment=require(_0x14e6('0x1'));var BPromise=require(_0x14e6('0x2'));var rs=require(_0x14e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x14e6('0x4'));var logger=require('../../config/logger')(_0x14e6('0x5'));var config=require('../../config/environment');var jayson=require(_0x14e6('0x6'));var client=jayson[_0x14e6('0x7')]['http']({'port':0x232c});config[_0x14e6('0x8')]=_[_0x14e6('0x9')](config[_0x14e6('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x14e6('0xa'))(new Redis(config[_0x14e6('0x8')]));require(_0x14e6('0xb'))['register'](socket);function respondWithRpcPromise(_0x98c1bc,_0x1c5bf2,_0x12318e){return new BPromise(function(_0x346a3e,_0x3b27d4){return client[_0x14e6('0xc')](_0x98c1bc,_0x12318e)[_0x14e6('0xd')](function(_0x277587){logger[_0x14e6('0xe')]('FaxAccount,\x20%s,\x20%s',_0x1c5bf2,'request\x20sent');logger[_0x14e6('0xf')](_0x14e6('0x10'),_0x1c5bf2,'request\x20sent',JSON['stringify'](_0x277587));if(_0x277587[_0x14e6('0x11')]){if(_0x277587['error'][_0x14e6('0x12')]===0x1f4){logger['error'](_0x14e6('0x13'),_0x1c5bf2,_0x277587['error'][_0x14e6('0x14')]);return _0x3b27d4(_0x277587[_0x14e6('0x11')]['message']);}logger[_0x14e6('0x11')](_0x14e6('0x13'),_0x1c5bf2,_0x277587[_0x14e6('0x11')][_0x14e6('0x14')]);return _0x346a3e(_0x277587[_0x14e6('0x11')]['message']);}else{logger[_0x14e6('0xe')](_0x14e6('0x13'),_0x1c5bf2,_0x14e6('0x15'));_0x346a3e(_0x277587[_0x14e6('0x16')][_0x14e6('0x14')]);}})[_0x14e6('0x17')](function(_0x330fe2){logger[_0x14e6('0x11')](_0x14e6('0x13'),_0x1c5bf2,_0x330fe2);_0x3b27d4(_0x330fe2);});});}exports[_0x14e6('0x18')]=function(_0x40ccd4){var _0x254b41=this;return new Promise(function(_0x299b23,_0x442e40){return db['FaxAccount'][_0x14e6('0x19')]({'raw':_0x40ccd4[_0x14e6('0x1a')]?_0x40ccd4['options'][_0x14e6('0x1b')]===undefined?!![]:![]:!![],'where':_0x40ccd4[_0x14e6('0x1a')]?_0x40ccd4[_0x14e6('0x1a')]['where']||null:null,'attributes':_0x40ccd4['options']?_0x40ccd4['options'][_0x14e6('0x1c')]||null:null,'limit':_0x40ccd4[_0x14e6('0x1a')]?_0x40ccd4[_0x14e6('0x1a')]['limit']||null:null,'include':_0x40ccd4[_0x14e6('0x1a')]?_0x40ccd4[_0x14e6('0x1a')][_0x14e6('0x1d')]?_[_0x14e6('0x1e')](_0x40ccd4[_0x14e6('0x1a')][_0x14e6('0x1d')],function(_0x13ade9){return{'model':db[_0x13ade9[_0x14e6('0x1f')]],'as':_0x13ade9['as'],'attributes':_0x13ade9[_0x14e6('0x1c')],'include':_0x13ade9[_0x14e6('0x1d')]?_[_0x14e6('0x1e')](_0x13ade9['include'],function(_0x4aeda8){return{'model':db[_0x4aeda8['model']],'as':_0x4aeda8['as'],'attributes':_0x4aeda8[_0x14e6('0x1c')],'include':_0x4aeda8[_0x14e6('0x1d')]?_[_0x14e6('0x1e')](_0x4aeda8[_0x14e6('0x1d')],function(_0x9ce564){return{'model':db[_0x9ce564['model']],'as':_0x9ce564['as'],'attributes':_0x9ce564[_0x14e6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x14e6('0xd')](function(_0x22a2dc){logger[_0x14e6('0xe')](_0x14e6('0x18'),_0x40ccd4);logger[_0x14e6('0xf')](_0x14e6('0x18'),_0x40ccd4,JSON[_0x14e6('0x20')](_0x22a2dc));_0x299b23(_0x22a2dc);})[_0x14e6('0x17')](function(_0x5b1697){logger[_0x14e6('0x11')]('GetFaxAccount',_0x5b1697[_0x14e6('0x14')],_0x40ccd4);_0x442e40(_0x254b41[_0x14e6('0x11')](0x1f4,_0x5b1697[_0x14e6('0x14')]));});});};exports[_0x14e6('0x21')]=function(_0x3db750,_0xdf9a67,_0xfee684){var _0x18ab81=this;return new Promise(function(_0x1b063a,_0xcd4635){var _0x2fa6ae={'body':_0x3db750[_0x14e6('0x22')],'channel':'fax'};var _0x2a671c=[];var _0xb14f60=[];var _0x5335c8={};return db[_0x14e6('0x23')]['describe']()[_0x14e6('0xd')](function(_0x337981){if(!_0x337981){throw new db[(_0x14e6('0x24'))]['ValidationError'](_0x14e6('0x25'));}_0x2a671c=_[_0x14e6('0x26')](_[_0x14e6('0x27')](_0x337981),[_0x14e6('0x28'),_0x14e6('0x29')]);_0xb14f60=_['difference'](_[_0x14e6('0x27')](_0x337981),[_0x14e6('0x28'),_0x14e6('0x29'),_0x14e6('0x2a'),_0x14e6('0x2b')]);if(_0x3db750[_0x14e6('0x22')]['id']){delete _0x3db750[_0x14e6('0x22')]['id'];}if(_['isNil'](_0x3db750[_0x14e6('0x22')][_0x14e6('0x2c')])){throw new db[(_0x14e6('0x24'))][(_0x14e6('0x2d'))](_0x14e6('0x2e'));}if(_[_0x14e6('0x2f')](_0x3db750[_0x14e6('0x22')][_0x14e6('0x22')])||_0x3db750[_0x14e6('0x22')][_0x14e6('0x22')]===''){throw new db['Sequelize'][(_0x14e6('0x2d'))](_0x14e6('0x30'));}if(_[_0x14e6('0x2f')](_0x3db750['body'][_0x14e6('0x31')])){throw new db[(_0x14e6('0x24'))][(_0x14e6('0x2d'))](_0x14e6('0x32')+_0xb14f60);}if(!_[_0x14e6('0x33')](_0xb14f60,_0x3db750[_0x14e6('0x22')][_0x14e6('0x31')])){throw new db[(_0x14e6('0x24'))]['ValidationError'](_0x14e6('0x34')+_0xb14f60);}_0x5335c8[_0x3db750[_0x14e6('0x22')][_0x14e6('0x31')]]=_0x3db750['body'][_0x14e6('0x2c')];})['then'](function(){return db[_0x14e6('0x35')][_0x14e6('0x36')]({'where':{'id':_0x3db750[_0x14e6('0x37')]['id']},'include':[{'model':db[_0x14e6('0x38')],'as':_0x14e6('0x39'),'include':[{'model':db[_0x14e6('0x23')],'as':_0x14e6('0x3a'),'where':_0x5335c8,'limit':0x1,'order':[[_0x14e6('0x29'),_0x14e6('0x3b')]]}]},{'model':db[_0x14e6('0x3c')],'as':_0x14e6('0x3d')}]});})[_0x14e6('0xd')](function(_0x5b5b0e){if(_0x5b5b0e&&_0x5b5b0e[_0x14e6('0x39')]){var _0x4a5630=_0x5b5b0e[_0x14e6('0x3e')]({'plain':!![]});_0x2fa6ae['account']=_0x4a5630;_0x2fa6ae[_0x14e6('0x3f')]=_0x4a5630['Applications'];_0x2fa6ae[_0x14e6('0x40')]=_0x4a5630['List'];_0x2fa6ae[_0x14e6('0x3f')]=_['orderBy'](_0x2fa6ae['applications'],[_0x14e6('0x41')],['asc']);if(_0x2fa6ae['account'][_0x14e6('0x3d')]){delete _0x2fa6ae['account'][_0x14e6('0x3d')];}if(_0x2fa6ae['account'][_0x14e6('0x39')]&&_0x2fa6ae[_0x14e6('0x37')][_0x14e6('0x39')][_0x14e6('0x3a')]['length']){return _0x2fa6ae['account']['List']['Contacts'][0x0];}var _0x3e1ffc=_[_0x14e6('0x9')](_0x3db750[_0x14e6('0x22')],{'firstName':_0x3db750[_0x14e6('0x22')][_0x14e6('0x2c')],'ListId':_0x4a5630[_0x14e6('0x2b')]});_0x3e1ffc[_0x3db750[_0x14e6('0x22')][_0x14e6('0x31')]]=_0x3db750[_0x14e6('0x22')][_0x14e6('0x2c')];return db[_0x14e6('0x23')][_0x14e6('0x42')](_0x3e1ffc,{'fields':_0x2a671c,'raw':!![]});}})[_0x14e6('0xd')](function(_0x4071f0){_0x2fa6ae[_0x14e6('0x43')]=_0x4071f0;if(_0x4071f0){var _0x5bbaa0={'ContactId':_0x4071f0['id'],'FaxAccountId':_0x3db750['account']['id'],'fax':_0x4071f0[_0x14e6('0x44')]};return db[_0x14e6('0x45')][_0x14e6('0x36')]({'where':{'ContactId':_0x4071f0['id'],'closed':![],'FaxAccountId':_0x3db750[_0x14e6('0x37')]['id']}})[_0x14e6('0xd')](function(_0x136096){if(_0x136096){return[_0x136096,![]];}return db['FaxInteraction'][_0x14e6('0x42')](_0x5bbaa0)[_0x14e6('0xd')](function(_0x1fef23){return[_0x1fef23,!![]];});});}else{throw new Error(_0x14e6('0x46'));}})[_0x14e6('0x47')](function(_0x252f32,_0x383cf3){var _0x506a22=_0x252f32['get']({'plain':!![]});if(_0x383cf3){if(_0x2fa6ae[_0x14e6('0x37')][_0x14e6('0x48')]){_0x2fa6ae['applications']['push']({'id':0x0,'priority':_0x2fa6ae[_0x14e6('0x3f')][_0x14e6('0x49')]+0x1,'app':'close','appdata':_0x14e6('0x4a'),'interval':_0x14e6('0x4b')});}_0x506a22['created']=!![];}else{_0x506a22['created']=![];}_0x2fa6ae[_0x14e6('0x4c')]=_0x506a22;return db['FaxMessage'][_0x14e6('0x42')]({'body':_0x3db750['body']['body'],'FaxAccountId':_0x3db750[_0x14e6('0x37')]['id'],'FaxInteractionId':_0x252f32['id'],'direction':'in','ContactId':_0x252f32[_0x14e6('0x4d')],'AttachmentId':_0x3db750[_0x14e6('0x22')][_0x14e6('0x4e')]});})['then'](function(_0x5c2120){_0x2fa6ae['message']=_0x5c2120;if(_0x2fa6ae[_0x14e6('0x4c')][_0x14e6('0x4f')]){return db[_0x14e6('0x50')][_0x14e6('0x36')]({'attributes':['id',_0x14e6('0x51')],'where':{'id':_0x2fa6ae[_0x14e6('0x4c')][_0x14e6('0x4f')]}})[_0x14e6('0xd')](function(_0x442140){if(_0x442140){_0x2fa6ae[_0x14e6('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x14e6('0x52'),'appdata':_0x442140[_0x14e6('0x51')]+','+(_0x2fa6ae['account'][_0x14e6('0x53')]||0xa),'interval':_0x14e6('0x4b')});}return respondWithRpcPromise('Start','startRouting',_0x2fa6ae);});}return respondWithRpcPromise(_0x14e6('0x54'),_0x14e6('0x55'),_0x2fa6ae);})['then'](function(_0x532c12){_0x1b063a(_0x532c12);})[_0x14e6('0x17')](function(_0xbccead){_0xcd4635(_0x18ab81[_0x14e6('0x11')](0x1f4,_0xbccead[_0x14e6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 686e618..0e11091 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 _0xa9e6=['faxAccount:','emit','register'];(function(_0x529053,_0x557824){var _0x169a1b=function(_0x4f6bac){while(--_0x4f6bac){_0x529053['push'](_0x529053['shift']());}};_0x169a1b(++_0x557824);}(_0xa9e6,0xac));var _0x6a9e=function(_0x174ff6,_0x193dca){_0x174ff6=_0x174ff6-0x0;var _0xae7bc6=_0xa9e6[_0x174ff6];return _0xae7bc6;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save','remove','update'];function createListener(_0x533e56,_0xda0513){return function(_0x55327a){_0xda0513[_0x6a9e('0x0')](_0x533e56,_0x55327a);};}function removeListener(_0x3d71f4,_0x3f2cf5){return function(){FaxAccountEvents['removeListener'](_0x3d71f4,_0x3f2cf5);};}exports[_0x6a9e('0x1')]=function(_0x2df661){for(var _0x215f58=0x0,_0x18dbb9=events['length'];_0x215f58<_0x18dbb9;_0x215f58++){var _0x2f7ca6=events[_0x215f58];var _0x48f59c=createListener(_0x6a9e('0x2')+_0x2f7ca6,_0x2df661);FaxAccountEvents['on'](_0x2f7ca6,_0x48f59c);}}; \ No newline at end of file +var _0xd9b0=['./faxAccount.events','save','remove','update','emit','register','faxAccount:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd9b0,0x15e));var _0x0d9b=function(_0x4e340d,_0x227f30){_0x4e340d=_0x4e340d-0x0;var _0x322209=_0xd9b0[_0x4e340d];return _0x322209;};'use strict';var FaxAccountEvents=require(_0x0d9b('0x0'));var events=[_0x0d9b('0x1'),_0x0d9b('0x2'),_0x0d9b('0x3')];function createListener(_0x5e84d7,_0x5bb613){return function(_0x328d2c){_0x5bb613[_0x0d9b('0x4')](_0x5e84d7,_0x328d2c);};}function removeListener(_0x59122c,_0x52e0ec){return function(){FaxAccountEvents['removeListener'](_0x59122c,_0x52e0ec);};}exports[_0x0d9b('0x5')]=function(_0x3dba45){for(var _0x35ee80=0x0,_0x54a5e4=events['length'];_0x35ee80<_0x54a5e4;_0x35ee80++){var _0xa36779=events[_0x35ee80];var _0x401aac=createListener(_0x0d9b('0x6')+_0xa36779,_0x3dba45);FaxAccountEvents['on'](_0xa36779,_0x401aac);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index fa1b5d3..f0a569f 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(_0x4953dc,_0x383cde){var _0x4caa29=function(_0x460f00){while(--_0x460f00){_0x4953dc['push'](_0x4953dc['shift']());}};_0x4caa29(++_0x383cde);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x573a47,_0x1e909b){var _0x4b232e=function(_0x198995){while(--_0x198995){_0x573a47['push'](_0x573a47['shift']());}};_0x4b232e(++_0x1e909b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 4690ec7..0745ade 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 _0x2f76=['sequelize','exports','INTEGER','STRING','*,*,*,*'];(function(_0x2259cc,_0x56dcf1){var _0x43f121=function(_0x1a5fbc){while(--_0x1a5fbc){_0x2259cc['push'](_0x2259cc['shift']());}};_0x43f121(++_0x56dcf1);}(_0x2f76,0x18b));var _0x62f7=function(_0x9db63a,_0x61fa67){_0x9db63a=_0x9db63a-0x0;var _0x436cf9=_0x2f76[_0x9db63a];return _0x436cf9;};'use strict';var Sequelize=require(_0x62f7('0x0'));module[_0x62f7('0x1')]={'priority':{'type':Sequelize[_0x62f7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x62f7('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x62f7('0x3')]},'interval':{'type':Sequelize[_0x62f7('0x3')],'defaultValue':_0x62f7('0x4')}}; \ No newline at end of file +var _0xfdd0=['*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x1839c9,_0x4ec3cc){var _0x1e5e5c=function(_0x25272d){while(--_0x25272d){_0x1839c9['push'](_0x1839c9['shift']());}};_0x1e5e5c(++_0x4ec3cc);}(_0xfdd0,0xd8));var _0x0fdd=function(_0x59566d,_0x3640b7){_0x59566d=_0x59566d-0x0;var _0x139267=_0xfdd0[_0x59566d];return _0x139267;};'use strict';var Sequelize=require(_0x0fdd('0x0'));module[_0x0fdd('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0fdd('0x2')],'allowNull':![],'defaultValue':_0x0fdd('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0fdd('0x2')]},'interval':{'type':Sequelize[_0x0fdd('0x2')],'defaultValue':_0x0fdd('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b1514f9..16cc3ef 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 _0x9389=['FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','name','send','index','map'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9389,0x18f));var _0x9938=function(_0x18cbc1,_0x425afa){_0x18cbc1=_0x18cbc1-0x0;var _0x411185=_0x9389[_0x18cbc1];return _0x411185;};'use strict';var emlformat=require(_0x9938('0x0'));var rimraf=require(_0x9938('0x1'));var zipdir=require(_0x9938('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9938('0x3'));var moment=require(_0x9938('0x4'));var BPromise=require(_0x9938('0x5'));var Mustache=require(_0x9938('0x6'));var util=require(_0x9938('0x7'));var path=require(_0x9938('0x8'));var sox=require(_0x9938('0x9'));var csv=require(_0x9938('0xa'));var ejs=require(_0x9938('0xb'));var fs=require('fs');var fs_extra=require(_0x9938('0xc'));var _=require('lodash');var squel=require(_0x9938('0xd'));var crypto=require('crypto');var jsforce=require(_0x9938('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9938('0xa'));var querystring=require(_0x9938('0xf'));var Papa=require(_0x9938('0x10'));var Redis=require(_0x9938('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9938('0x12'));var as=require(_0x9938('0x13'));var hardwareService=require(_0x9938('0x14'));var logger=require(_0x9938('0x15'))(_0x9938('0x16'));var utils=require('../../config/utils');var config=require(_0x9938('0x17'));var licenseUtil=require(_0x9938('0x18'));var db=require(_0x9938('0x19'))['db'];function respondWithStatusCode(_0x2bf4a3,_0x3d5bfa){_0x3d5bfa=_0x3d5bfa||0xcc;return function(_0x445b09){if(_0x445b09){return _0x2bf4a3[_0x9938('0x1a')](_0x3d5bfa);}return _0x2bf4a3[_0x9938('0x1b')](_0x3d5bfa)[_0x9938('0x1c')]();};}function respondWithResult(_0x205ce0,_0x5e7368){_0x5e7368=_0x5e7368||0xc8;return function(_0x42104d){if(_0x42104d){return _0x205ce0[_0x9938('0x1b')](_0x5e7368)[_0x9938('0x1d')](_0x42104d);}};}function respondWithFilteredResult(_0x3c3531,_0x2afe43){return function(_0x5728d9){if(_0x5728d9){var _0xbc8798=typeof _0x2afe43['offset']===_0x9938('0x1e')&&typeof _0x2afe43['limit']==='undefined';var _0x3b967c=_0x5728d9[_0x9938('0x1f')];var _0x3a5f2f=_0xbc8798?0x0:_0x2afe43['offset'];var _0x5a6446=_0xbc8798?_0x5728d9['count']:_0x2afe43[_0x9938('0x20')]+_0x2afe43[_0x9938('0x21')];var _0x3a3aa5;if(_0x5a6446>=_0x3b967c){_0x5a6446=_0x3b967c;_0x3a3aa5=0xc8;}else{_0x3a3aa5=0xce;}_0x3c3531[_0x9938('0x1b')](_0x3a3aa5);return _0x3c3531[_0x9938('0x22')](_0x9938('0x23'),_0x3a5f2f+'-'+_0x5a6446+'/'+_0x3b967c)[_0x9938('0x1d')](_0x5728d9);}return null;};}function patchUpdates(_0x1a3d1a){return function(_0x430fbc){try{jsonpatch['apply'](_0x430fbc,_0x1a3d1a,!![]);}catch(_0x339949){return BPromise[_0x9938('0x24')](_0x339949);}return _0x430fbc['save']();};}function saveUpdates(_0x35eefc,_0x1c8fc6){return function(_0x27db99){if(_0x27db99){return _0x27db99[_0x9938('0x25')](_0x35eefc)[_0x9938('0x26')](function(_0x75bfdc){return _0x75bfdc;});}return null;};}function removeEntity(_0x24d2ef,_0x3ef51f){return function(_0xd4411e){if(_0xd4411e){return _0xd4411e[_0x9938('0x27')]()[_0x9938('0x26')](function(){_0x24d2ef[_0x9938('0x1b')](0xcc)[_0x9938('0x1c')]();});}};}function handleEntityNotFound(_0x24e2ac,_0x46944e){return function(_0x5ab3e6){if(!_0x5ab3e6){_0x24e2ac['sendStatus'](0x194);}return _0x5ab3e6;};}function handleError(_0x222dc9,_0x138c50){_0x138c50=_0x138c50||0x1f4;return function(_0x361ec6){logger[_0x9938('0x28')](_0x361ec6['stack']);if(_0x361ec6[_0x9938('0x29')]){delete _0x361ec6[_0x9938('0x29')];}_0x222dc9[_0x9938('0x1b')](_0x138c50)[_0x9938('0x2a')](_0x361ec6);};}exports[_0x9938('0x2b')]=function(_0x598d16,_0x2e2307){var _0x1dba6a={},_0x2ac4eb={},_0x5b9bdd={'count':0x0,'rows':[]};var _0x2c94ad=_[_0x9938('0x2c')](db[_0x9938('0x2d')][_0x9938('0x2e')],function(_0x2fe789){return{'name':_0x2fe789[_0x9938('0x2f')],'type':_0x2fe789[_0x9938('0x30')][_0x9938('0x31')]};});_0x2ac4eb[_0x9938('0x32')]=_[_0x9938('0x2c')](_0x2c94ad,_0x9938('0x29'));_0x2ac4eb[_0x9938('0x33')]=_[_0x9938('0x34')](_0x598d16['query']);_0x2ac4eb['filters']=_[_0x9938('0x35')](_0x2ac4eb['model'],_0x2ac4eb[_0x9938('0x33')]);_0x1dba6a[_0x9938('0x36')]=_[_0x9938('0x35')](_0x2ac4eb[_0x9938('0x32')],qs[_0x9938('0x37')](_0x598d16[_0x9938('0x33')][_0x9938('0x37')]));_0x1dba6a['attributes']=_0x1dba6a[_0x9938('0x36')][_0x9938('0x38')]?_0x1dba6a[_0x9938('0x36')]:_0x2ac4eb[_0x9938('0x32')];if(!_0x598d16[_0x9938('0x33')]['hasOwnProperty']('nolimit')){_0x1dba6a['limit']=qs['limit'](_0x598d16[_0x9938('0x33')][_0x9938('0x21')]);_0x1dba6a[_0x9938('0x20')]=qs[_0x9938('0x20')](_0x598d16[_0x9938('0x33')][_0x9938('0x20')]);}_0x1dba6a[_0x9938('0x39')]=qs[_0x9938('0x3a')](_0x598d16[_0x9938('0x33')][_0x9938('0x3a')]);_0x1dba6a[_0x9938('0x3b')]=qs['filters'](_[_0x9938('0x3c')](_0x598d16[_0x9938('0x33')],_0x2ac4eb[_0x9938('0x3d')]),_0x2c94ad);if(_0x598d16[_0x9938('0x33')][_0x9938('0x3e')]){_0x1dba6a['where']=_[_0x9938('0x3f')](_0x1dba6a[_0x9938('0x3b')],{'$or':_[_0x9938('0x2c')](_0x2c94ad,function(_0x528552){if(_0x528552['type']!=='VIRTUAL'){var _0x16d5f4={};_0x16d5f4[_0x528552['name']]={'$like':'%'+_0x598d16[_0x9938('0x33')]['filter']+'%'};return _0x16d5f4;}})});}_0x1dba6a=_[_0x9938('0x3f')]({},_0x1dba6a,_0x598d16[_0x9938('0x40')]);var _0x34f928={'where':_0x1dba6a[_0x9938('0x3b')]};return db['FaxApplication'][_0x9938('0x1f')](_0x34f928)[_0x9938('0x26')](function(_0x4e155a){_0x5b9bdd[_0x9938('0x1f')]=_0x4e155a;if(_0x598d16[_0x9938('0x33')]['includeAll']){_0x1dba6a[_0x9938('0x41')]=[{'all':!![]}];}return db['FaxApplication'][_0x9938('0x42')](_0x1dba6a);})[_0x9938('0x26')](function(_0x27cfe9){_0x5b9bdd[_0x9938('0x43')]=_0x27cfe9;return _0x5b9bdd;})[_0x9938('0x26')](respondWithFilteredResult(_0x2e2307,_0x1dba6a))[_0x9938('0x44')](handleError(_0x2e2307,null));};exports[_0x9938('0x45')]=function(_0x4ba516,_0x3f7e4a){var _0x23c8de={'raw':!![],'where':{'id':_0x4ba516[_0x9938('0x46')]['id']}},_0x5a9149={};_0x5a9149[_0x9938('0x32')]=_[_0x9938('0x34')](db[_0x9938('0x2d')][_0x9938('0x2e')]);_0x5a9149['query']=_[_0x9938('0x34')](_0x4ba516['query']);_0x5a9149[_0x9938('0x3d')]=_[_0x9938('0x35')](_0x5a9149[_0x9938('0x32')],_0x5a9149[_0x9938('0x33')]);_0x23c8de['attributes']=_[_0x9938('0x35')](_0x5a9149[_0x9938('0x32')],qs[_0x9938('0x37')](_0x4ba516[_0x9938('0x33')][_0x9938('0x37')]));_0x23c8de[_0x9938('0x36')]=_0x23c8de[_0x9938('0x36')][_0x9938('0x38')]?_0x23c8de[_0x9938('0x36')]:_0x5a9149[_0x9938('0x32')];if(_0x4ba516[_0x9938('0x33')][_0x9938('0x47')]){_0x23c8de[_0x9938('0x41')]=[{'all':!![]}];}_0x23c8de=_[_0x9938('0x3f')]({},_0x23c8de,_0x4ba516[_0x9938('0x40')]);return db[_0x9938('0x2d')]['find'](_0x23c8de)[_0x9938('0x26')](handleEntityNotFound(_0x3f7e4a,null))[_0x9938('0x26')](respondWithResult(_0x3f7e4a,null))[_0x9938('0x44')](handleError(_0x3f7e4a,null));};exports['create']=function(_0x454190,_0x3edb4e){return db[_0x9938('0x2d')][_0x9938('0x48')](_0x454190[_0x9938('0x49')],{})[_0x9938('0x26')](respondWithResult(_0x3edb4e,0xc9))[_0x9938('0x44')](handleError(_0x3edb4e,null));};exports[_0x9938('0x25')]=function(_0x1106dc,_0x486d92){if(_0x1106dc[_0x9938('0x49')]['id']){delete _0x1106dc[_0x9938('0x49')]['id'];}return db[_0x9938('0x2d')]['find']({'where':{'id':_0x1106dc[_0x9938('0x46')]['id']}})[_0x9938('0x26')](handleEntityNotFound(_0x486d92,null))[_0x9938('0x26')](saveUpdates(_0x1106dc[_0x9938('0x49')],null))[_0x9938('0x26')](respondWithResult(_0x486d92,null))[_0x9938('0x44')](handleError(_0x486d92,null));};exports['destroy']=function(_0x3a6265,_0x58d508){return db['FaxApplication']['find']({'where':{'id':_0x3a6265[_0x9938('0x46')]['id']}})[_0x9938('0x26')](handleEntityNotFound(_0x58d508,null))[_0x9938('0x26')](removeEntity(_0x58d508,null))[_0x9938('0x44')](handleError(_0x58d508,null));}; \ No newline at end of file +var _0x56f5=['../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','end','error','name','send','index','map','FaxApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x39cc4c,_0x184236){var _0x524221=function(_0x3e94c3){while(--_0x3e94c3){_0x39cc4c['push'](_0x39cc4c['shift']());}};_0x524221(++_0x184236);}(_0x56f5,0x105));var _0x556f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x56f5[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x556f('0x0'));var rimraf=require(_0x556f('0x1'));var zipdir=require(_0x556f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x556f('0x3'));var moment=require(_0x556f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x556f('0x5'));var csv=require('to-csv');var ejs=require(_0x556f('0x6'));var fs=require('fs');var fs_extra=require(_0x556f('0x7'));var _=require(_0x556f('0x8'));var squel=require(_0x556f('0x9'));var crypto=require(_0x556f('0xa'));var jsforce=require(_0x556f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x556f('0xc'));var querystring=require(_0x556f('0xd'));var Papa=require(_0x556f('0xe'));var Redis=require(_0x556f('0xf'));var authService=require(_0x556f('0x10'));var qs=require(_0x556f('0x11'));var as=require(_0x556f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x556f('0x13'))('api');var utils=require(_0x556f('0x14'));var config=require(_0x556f('0x15'));var licenseUtil=require(_0x556f('0x16'));var db=require(_0x556f('0x17'))['db'];function respondWithStatusCode(_0x83cc88,_0x55cb31){_0x55cb31=_0x55cb31||0xcc;return function(_0x5b0550){if(_0x5b0550){return _0x83cc88[_0x556f('0x18')](_0x55cb31);}return _0x83cc88[_0x556f('0x19')](_0x55cb31)['end']();};}function respondWithResult(_0x4d8297,_0x3ffcb3){_0x3ffcb3=_0x3ffcb3||0xc8;return function(_0x3a7a4a){if(_0x3a7a4a){return _0x4d8297[_0x556f('0x19')](_0x3ffcb3)['json'](_0x3a7a4a);}};}function respondWithFilteredResult(_0x681a1d,_0x44fc67){return function(_0x8fe6d4){if(_0x8fe6d4){var _0x149acc=typeof _0x44fc67[_0x556f('0x1a')]===_0x556f('0x1b')&&typeof _0x44fc67[_0x556f('0x1c')]===_0x556f('0x1b');var _0x223113=_0x8fe6d4[_0x556f('0x1d')];var _0x50a4ea=_0x149acc?0x0:_0x44fc67[_0x556f('0x1a')];var _0x222652=_0x149acc?_0x8fe6d4['count']:_0x44fc67[_0x556f('0x1a')]+_0x44fc67[_0x556f('0x1c')];var _0x498f96;if(_0x222652>=_0x223113){_0x222652=_0x223113;_0x498f96=0xc8;}else{_0x498f96=0xce;}_0x681a1d[_0x556f('0x19')](_0x498f96);return _0x681a1d[_0x556f('0x1e')](_0x556f('0x1f'),_0x50a4ea+'-'+_0x222652+'/'+_0x223113)[_0x556f('0x20')](_0x8fe6d4);}return null;};}function patchUpdates(_0x461ced){return function(_0x1d84d8){try{jsonpatch[_0x556f('0x21')](_0x1d84d8,_0x461ced,!![]);}catch(_0x159cbc){return BPromise[_0x556f('0x22')](_0x159cbc);}return _0x1d84d8['save']();};}function saveUpdates(_0x59b552,_0xf866b0){return function(_0x1f02ad){if(_0x1f02ad){return _0x1f02ad[_0x556f('0x23')](_0x59b552)[_0x556f('0x24')](function(_0x1a3917){return _0x1a3917;});}return null;};}function removeEntity(_0x8c2d2c,_0x53198d){return function(_0x1e19b9){if(_0x1e19b9){return _0x1e19b9[_0x556f('0x25')]()[_0x556f('0x24')](function(){_0x8c2d2c[_0x556f('0x19')](0xcc)[_0x556f('0x26')]();});}};}function handleEntityNotFound(_0x8b5231,_0x2e38b2){return function(_0x23f11f){if(!_0x23f11f){_0x8b5231[_0x556f('0x18')](0x194);}return _0x23f11f;};}function handleError(_0x1e9987,_0x38cbc9){_0x38cbc9=_0x38cbc9||0x1f4;return function(_0x4f9bcc){logger[_0x556f('0x27')](_0x4f9bcc['stack']);if(_0x4f9bcc[_0x556f('0x28')]){delete _0x4f9bcc[_0x556f('0x28')];}_0x1e9987[_0x556f('0x19')](_0x38cbc9)[_0x556f('0x29')](_0x4f9bcc);};}exports[_0x556f('0x2a')]=function(_0x1d63f0,_0x20ae34){var _0xbdabfd={},_0xb05fe8={},_0x4d2620={'count':0x0,'rows':[]};var _0x10c911=_[_0x556f('0x2b')](db[_0x556f('0x2c')][_0x556f('0x2d')],function(_0x5eb33b){return{'name':_0x5eb33b[_0x556f('0x2e')],'type':_0x5eb33b['type'][_0x556f('0x2f')]};});_0xb05fe8[_0x556f('0x30')]=_[_0x556f('0x2b')](_0x10c911,_0x556f('0x28'));_0xb05fe8[_0x556f('0x31')]=_[_0x556f('0x32')](_0x1d63f0[_0x556f('0x31')]);_0xb05fe8[_0x556f('0x33')]=_[_0x556f('0x34')](_0xb05fe8[_0x556f('0x30')],_0xb05fe8[_0x556f('0x31')]);_0xbdabfd[_0x556f('0x35')]=_[_0x556f('0x34')](_0xb05fe8[_0x556f('0x30')],qs['fields'](_0x1d63f0[_0x556f('0x31')][_0x556f('0x36')]));_0xbdabfd['attributes']=_0xbdabfd[_0x556f('0x35')][_0x556f('0x37')]?_0xbdabfd[_0x556f('0x35')]:_0xb05fe8[_0x556f('0x30')];if(!_0x1d63f0[_0x556f('0x31')][_0x556f('0x38')](_0x556f('0x39'))){_0xbdabfd[_0x556f('0x1c')]=qs['limit'](_0x1d63f0['query'][_0x556f('0x1c')]);_0xbdabfd[_0x556f('0x1a')]=qs['offset'](_0x1d63f0['query'][_0x556f('0x1a')]);}_0xbdabfd['order']=qs[_0x556f('0x3a')](_0x1d63f0['query']['sort']);_0xbdabfd[_0x556f('0x3b')]=qs['filters'](_['pick'](_0x1d63f0[_0x556f('0x31')],_0xb05fe8[_0x556f('0x33')]),_0x10c911);if(_0x1d63f0['query'][_0x556f('0x3c')]){_0xbdabfd['where']=_[_0x556f('0x3d')](_0xbdabfd[_0x556f('0x3b')],{'$or':_[_0x556f('0x2b')](_0x10c911,function(_0xfad923){if(_0xfad923['type']!==_0x556f('0x3e')){var _0x1ded57={};_0x1ded57[_0xfad923[_0x556f('0x28')]]={'$like':'%'+_0x1d63f0['query'][_0x556f('0x3c')]+'%'};return _0x1ded57;}})});}_0xbdabfd=_[_0x556f('0x3d')]({},_0xbdabfd,_0x1d63f0['options']);var _0x4cd9d0={'where':_0xbdabfd[_0x556f('0x3b')]};return db['FaxApplication'][_0x556f('0x1d')](_0x4cd9d0)[_0x556f('0x24')](function(_0x19f23c){_0x4d2620[_0x556f('0x1d')]=_0x19f23c;if(_0x1d63f0['query'][_0x556f('0x3f')]){_0xbdabfd[_0x556f('0x40')]=[{'all':!![]}];}return db[_0x556f('0x2c')]['findAll'](_0xbdabfd);})['then'](function(_0x38f22b){_0x4d2620['rows']=_0x38f22b;return _0x4d2620;})['then'](respondWithFilteredResult(_0x20ae34,_0xbdabfd))[_0x556f('0x41')](handleError(_0x20ae34,null));};exports[_0x556f('0x42')]=function(_0x4feae9,_0x449cfe){var _0xd0a0b={'raw':!![],'where':{'id':_0x4feae9[_0x556f('0x43')]['id']}},_0x5c0d09={};_0x5c0d09[_0x556f('0x30')]=_['keys'](db[_0x556f('0x2c')]['rawAttributes']);_0x5c0d09['query']=_[_0x556f('0x32')](_0x4feae9['query']);_0x5c0d09[_0x556f('0x33')]=_[_0x556f('0x34')](_0x5c0d09['model'],_0x5c0d09[_0x556f('0x31')]);_0xd0a0b[_0x556f('0x35')]=_[_0x556f('0x34')](_0x5c0d09[_0x556f('0x30')],qs['fields'](_0x4feae9[_0x556f('0x31')][_0x556f('0x36')]));_0xd0a0b['attributes']=_0xd0a0b[_0x556f('0x35')][_0x556f('0x37')]?_0xd0a0b[_0x556f('0x35')]:_0x5c0d09[_0x556f('0x30')];if(_0x4feae9['query'][_0x556f('0x3f')]){_0xd0a0b[_0x556f('0x40')]=[{'all':!![]}];}_0xd0a0b=_[_0x556f('0x3d')]({},_0xd0a0b,_0x4feae9['options']);return db[_0x556f('0x2c')][_0x556f('0x44')](_0xd0a0b)[_0x556f('0x24')](handleEntityNotFound(_0x449cfe,null))[_0x556f('0x24')](respondWithResult(_0x449cfe,null))[_0x556f('0x41')](handleError(_0x449cfe,null));};exports[_0x556f('0x45')]=function(_0x559388,_0x5d9b1d){return db[_0x556f('0x2c')][_0x556f('0x45')](_0x559388[_0x556f('0x46')],{})['then'](respondWithResult(_0x5d9b1d,0xc9))[_0x556f('0x41')](handleError(_0x5d9b1d,null));};exports[_0x556f('0x23')]=function(_0x592631,_0x227109){if(_0x592631['body']['id']){delete _0x592631[_0x556f('0x46')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x592631[_0x556f('0x43')]['id']}})[_0x556f('0x24')](handleEntityNotFound(_0x227109,null))[_0x556f('0x24')](saveUpdates(_0x592631['body'],null))[_0x556f('0x24')](respondWithResult(_0x227109,null))['catch'](handleError(_0x227109,null));};exports[_0x556f('0x25')]=function(_0x5d7b24,_0x5d1bb9){return db[_0x556f('0x2c')][_0x556f('0x44')]({'where':{'id':_0x5d7b24[_0x556f('0x43')]['id']}})[_0x556f('0x24')](handleEntityNotFound(_0x5d1bb9,null))[_0x556f('0x24')](removeEntity(_0x5d1bb9,null))[_0x556f('0x41')](handleError(_0x5d1bb9,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 56fdbb7..668dbbc 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 _0x01b9=['exports','define','FaxApplication','fax_applications','utf8mb4','util','../../config/logger','moment','request-promise','path','rimraf','./faxApplication.attributes'];(function(_0x455f76,_0x33e5c1){var _0x596b43=function(_0x25753b){while(--_0x25753b){_0x455f76['push'](_0x455f76['shift']());}};_0x596b43(++_0x33e5c1);}(_0x01b9,0x7d));var _0x901b=function(_0x4b49e0,_0x376a9e){_0x4b49e0=_0x4b49e0-0x0;var _0x52f8e7=_0x01b9[_0x4b49e0];return _0x52f8e7;};'use strict';var _=require('lodash');var util=require(_0x901b('0x0'));var logger=require(_0x901b('0x1'))('api');var moment=require(_0x901b('0x2'));var BPromise=require('bluebird');var rp=require(_0x901b('0x3'));var fs=require('fs');var path=require(_0x901b('0x4'));var rimraf=require(_0x901b('0x5'));var config=require('../../config/environment');var attributes=require(_0x901b('0x6'));module[_0x901b('0x7')]=function(_0x5e0eaa,_0x3dbb8c){return _0x5e0eaa[_0x901b('0x8')](_0x901b('0x9'),attributes,{'tableName':_0x901b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x901b('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5040=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x629775,_0x125f3b){var _0x1963cc=function(_0x4ae2f2){while(--_0x4ae2f2){_0x629775['push'](_0x629775['shift']());}};_0x1963cc(++_0x125f3b);}(_0x5040,0x14f));var _0x0504=function(_0x2a8759,_0x2118e0){_0x2a8759=_0x2a8759-0x0;var _0x4c96e4=_0x5040[_0x2a8759];return _0x4c96e4;};'use strict';var _=require(_0x0504('0x0'));var util=require('util');var logger=require(_0x0504('0x1'))(_0x0504('0x2'));var moment=require(_0x0504('0x3'));var BPromise=require(_0x0504('0x4'));var rp=require(_0x0504('0x5'));var fs=require('fs');var path=require(_0x0504('0x6'));var rimraf=require(_0x0504('0x7'));var config=require(_0x0504('0x8'));var attributes=require('./faxApplication.attributes');module[_0x0504('0x9')]=function(_0x149771,_0x38455e){return _0x149771[_0x0504('0xa')]('FaxApplication',attributes,{'tableName':_0x0504('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0504('0xc'),'collate':_0x0504('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index fdfe97a..267352e 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 _0x3cdb=['UpdateFaxApplication','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','FaxApplication','update','body','options','raw','where','attributes','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cdb,0x17b));var _0xb3cd=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x3cdb[_0x496333];return _0x44256e;};'use strict';var _=require(_0xb3cd('0x0'));var util=require('util');var moment=require(_0xb3cd('0x1'));var BPromise=require(_0xb3cd('0x2'));var rs=require(_0xb3cd('0x3'));var fs=require('fs');var Redis=require(_0xb3cd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb3cd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb3cd('0x6'));var client=jayson[_0xb3cd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36e94f,_0x4d8247,_0x4c0ce0){return new BPromise(function(_0x29d136,_0x49fc8f){return client[_0xb3cd('0x8')](_0x36e94f,_0x4c0ce0)[_0xb3cd('0x9')](function(_0x28a87f){logger[_0xb3cd('0xa')](_0xb3cd('0xb'),_0x4d8247,_0xb3cd('0xc'));logger[_0xb3cd('0xd')](_0xb3cd('0xe'),_0x4d8247,_0xb3cd('0xc'),JSON['stringify'](_0x28a87f));if(_0x28a87f[_0xb3cd('0xf')]){if(_0x28a87f[_0xb3cd('0xf')][_0xb3cd('0x10')]===0x1f4){logger[_0xb3cd('0xf')](_0xb3cd('0xb'),_0x4d8247,_0x28a87f[_0xb3cd('0xf')][_0xb3cd('0x11')]);return _0x49fc8f(_0x28a87f[_0xb3cd('0xf')][_0xb3cd('0x11')]);}logger[_0xb3cd('0xf')](_0xb3cd('0xb'),_0x4d8247,_0x28a87f[_0xb3cd('0xf')][_0xb3cd('0x11')]);return _0x29d136(_0x28a87f[_0xb3cd('0xf')][_0xb3cd('0x11')]);}else{logger[_0xb3cd('0xa')](_0xb3cd('0xb'),_0x4d8247,_0xb3cd('0xc'));_0x29d136(_0x28a87f[_0xb3cd('0x12')]['message']);}})['catch'](function(_0x356023){logger[_0xb3cd('0xf')](_0xb3cd('0xb'),_0x4d8247,_0x356023);_0x49fc8f(_0x356023);});});}exports['UpdateFaxApplication']=function(_0x5eede4){var _0x24aa97=this;return new Promise(function(_0x198af4,_0x11754a){return db[_0xb3cd('0x13')][_0xb3cd('0x14')](_0x5eede4[_0xb3cd('0x15')],{'raw':_0x5eede4['options']?_0x5eede4[_0xb3cd('0x16')][_0xb3cd('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eede4[_0xb3cd('0x16')]?_0x5eede4[_0xb3cd('0x16')][_0xb3cd('0x18')]||null:null,'attributes':_0x5eede4[_0xb3cd('0x16')]?_0x5eede4['options'][_0xb3cd('0x19')]||null:null,'limit':_0x5eede4[_0xb3cd('0x16')]?_0x5eede4[_0xb3cd('0x16')][_0xb3cd('0x1a')]||null:null})[_0xb3cd('0x9')](function(_0x3a38b7){logger['info'](_0xb3cd('0x1b'),_0x5eede4);logger[_0xb3cd('0xd')](_0xb3cd('0x1b'),_0x5eede4,JSON['stringify'](_0x3a38b7));_0x198af4(_0x3a38b7);})[_0xb3cd('0x1c')](function(_0x13d115){logger[_0xb3cd('0xf')](_0xb3cd('0x1b'),_0x13d115[_0xb3cd('0x11')],_0x5eede4);_0x11754a(_0x24aa97['error'](0x1f4,_0x13d115['message']));});});}; \ No newline at end of file +var _0xfd7b=['request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxApplication','update','options','attributes','info','UpdateFaxApplication','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FaxApplication,\x20%s,\x20%s'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0xfd7b,0x1b3));var _0xbfd7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfd7b[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xbfd7('0x0'));var moment=require(_0xbfd7('0x1'));var BPromise=require('bluebird');var rs=require(_0xbfd7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfd7('0x3'))['db'];var utils=require(_0xbfd7('0x4'));var logger=require(_0xbfd7('0x5'))(_0xbfd7('0x6'));var config=require(_0xbfd7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbfd7('0x8')][_0xbfd7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d98e3,_0x2cda4e,_0x30e2d0){return new BPromise(function(_0x2f1d38,_0x3e1ab3){return client[_0xbfd7('0xa')](_0x4d98e3,_0x30e2d0)[_0xbfd7('0xb')](function(_0x185637){logger['info'](_0xbfd7('0xc'),_0x2cda4e,_0xbfd7('0xd'));logger[_0xbfd7('0xe')](_0xbfd7('0xf'),_0x2cda4e,_0xbfd7('0xd'),JSON[_0xbfd7('0x10')](_0x185637));if(_0x185637[_0xbfd7('0x11')]){if(_0x185637[_0xbfd7('0x11')][_0xbfd7('0x12')]===0x1f4){logger[_0xbfd7('0x11')](_0xbfd7('0xc'),_0x2cda4e,_0x185637['error'][_0xbfd7('0x13')]);return _0x3e1ab3(_0x185637[_0xbfd7('0x11')][_0xbfd7('0x13')]);}logger[_0xbfd7('0x11')]('FaxApplication,\x20%s,\x20%s',_0x2cda4e,_0x185637[_0xbfd7('0x11')][_0xbfd7('0x13')]);return _0x2f1d38(_0x185637[_0xbfd7('0x11')][_0xbfd7('0x13')]);}else{logger['info'](_0xbfd7('0xc'),_0x2cda4e,'request\x20sent');_0x2f1d38(_0x185637[_0xbfd7('0x14')]['message']);}})['catch'](function(_0x3a7d33){logger[_0xbfd7('0x11')]('FaxApplication,\x20%s,\x20%s',_0x2cda4e,_0x3a7d33);_0x3e1ab3(_0x3a7d33);});});}exports['UpdateFaxApplication']=function(_0x3646e0){var _0x481d67=this;return new Promise(function(_0x2c78fb,_0x240590){return db[_0xbfd7('0x15')][_0xbfd7('0x16')](_0x3646e0['body'],{'raw':_0x3646e0[_0xbfd7('0x17')]?_0x3646e0[_0xbfd7('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3646e0['options']?_0x3646e0[_0xbfd7('0x17')]['where']||null:null,'attributes':_0x3646e0[_0xbfd7('0x17')]?_0x3646e0[_0xbfd7('0x17')][_0xbfd7('0x18')]||null:null,'limit':_0x3646e0[_0xbfd7('0x17')]?_0x3646e0['options']['limit']||null:null})[_0xbfd7('0xb')](function(_0x71dd88){logger[_0xbfd7('0x19')](_0xbfd7('0x1a'),_0x3646e0);logger[_0xbfd7('0xe')](_0xbfd7('0x1a'),_0x3646e0,JSON[_0xbfd7('0x10')](_0x71dd88));_0x2c78fb(_0x71dd88);})[_0xbfd7('0x1b')](function(_0x389fd8){logger[_0xbfd7('0x11')](_0xbfd7('0x1a'),_0x389fd8['message'],_0x3646e0);_0x240590(_0x481d67['error'](0x1f4,_0x389fd8[_0xbfd7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index e586a53..54d7cc3 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 _0x8603=['../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x157d23,_0x4027b9){var _0x5b93cc=function(_0x18af99){while(--_0x18af99){_0x157d23['push'](_0x157d23['shift']());}};_0x5b93cc(++_0x4027b9);}(_0x8603,0x190));var _0x3860=function(_0x3e435a,_0x6dd0de){_0x3e435a=_0x3e435a-0x0;var _0x419ed0=_0x8603[_0x3e435a];return _0x419ed0;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file +var _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xb688,0xcf));var _0x8b68=function(_0x223009,_0x14c52f){_0x223009=_0x223009-0x0;var _0x4c1ec9=_0xb688[_0x223009];return _0x4c1ec9;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 82f0c8a..04e4261 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 _0xd22d=['sequelize','BOOLEAN','DATE','STRING'];(function(_0x961a37,_0x33bdca){var _0x1ebd1b=function(_0x5bfd31){while(--_0x5bfd31){_0x961a37['push'](_0x961a37['shift']());}};_0x1ebd1b(++_0x33bdca);}(_0xd22d,0x1a8));var _0xdd22=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0xd22d[_0x43b08];return _0x5e05f4;};'use strict';var Sequelize=require(_0xdd22('0x0'));module['exports']={'closed':{'type':Sequelize[_0xdd22('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdd22('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdd22('0x3')]},'thirdDisposition':{'type':Sequelize[_0xdd22('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xdd22('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdd22('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x077e=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x077e,0x1f4));var _0xe077=function(_0x2d3349,_0x1c2398){_0x2d3349=_0x2d3349-0x0;var _0x70cbe5=_0x077e[_0x2d3349];return _0x70cbe5;};'use strict';var Sequelize=require(_0xe077('0x0'));module[_0xe077('0x1')]={'closed':{'type':Sequelize[_0xe077('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe077('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe077('0x3')]},'note':{'type':Sequelize[_0xe077('0x3')]},'read1stAt':{'type':Sequelize[_0xe077('0x4')]},'fax':{'type':Sequelize[_0xe077('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xe077('0x5')]('in',_0xe077('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe077('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xe077('0x5')]('in',_0xe077('0x6')),'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 62f5e05..54f3565 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 _0x5588=['ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','catch','index','FaxInteraction','rawAttributes','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','operator','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?','find','ContactId','buildExpression','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','text','keys','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','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','i.*','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','rows','intersection','include','options','create','body','params','addMessage','ids','findOne','FaxMessage','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','color','emit','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x13ba66,_0x55c8f0){var _0x5d573a=function(_0x512ee1){while(--_0x512ee1){_0x13ba66['push'](_0x13ba66['shift']());}};_0x5d573a(++_0x55c8f0);}(_0x5588,0x1b0));var _0x8558=function(_0x3709c2,_0x25f19e){_0x3709c2=_0x3709c2-0x0;var _0x4b09df=_0x5588[_0x3709c2];return _0x4b09df;};'use strict';var emlformat=require(_0x8558('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8558('0x1'));var moment=require(_0x8558('0x2'));var BPromise=require(_0x8558('0x3'));var Mustache=require(_0x8558('0x4'));var util=require(_0x8558('0x5'));var path=require(_0x8558('0x6'));var sox=require(_0x8558('0x7'));var csv=require('to-csv');var ejs=require(_0x8558('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8558('0x9'));var squel=require(_0x8558('0xa'));var crypto=require(_0x8558('0xb'));var jsforce=require(_0x8558('0xc'));var deskjs=require(_0x8558('0xd'));var toCsv=require(_0x8558('0xe'));var querystring=require(_0x8558('0xf'));var Papa=require('papaparse');var Redis=require(_0x8558('0x10'));var authService=require(_0x8558('0x11'));var qs=require(_0x8558('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8558('0x13'));var logger=require(_0x8558('0x14'))(_0x8558('0x15'));var utils=require('../../config/utils');var config=require(_0x8558('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8558('0x17'))['db'];config[_0x8558('0x18')]=_[_0x8558('0x19')](config['redis'],{'host':_0x8558('0x1a'),'port':0x18eb});var socket=require(_0x8558('0x1b'))(new Redis(config[_0x8558('0x18')]));require(_0x8558('0x1c'))[_0x8558('0x1d')](socket);function respondWithStatusCode(_0x1489ee,_0x12dc83){_0x12dc83=_0x12dc83||0xcc;return function(_0x16060e){if(_0x16060e){return _0x1489ee[_0x8558('0x1e')](_0x12dc83);}return _0x1489ee[_0x8558('0x1f')](_0x12dc83)['end']();};}function respondWithResult(_0x4b247e,_0x4addf4){_0x4addf4=_0x4addf4||0xc8;return function(_0x5646ba){if(_0x5646ba){return _0x4b247e[_0x8558('0x1f')](_0x4addf4)[_0x8558('0x20')](_0x5646ba);}};}function respondWithFilteredResult(_0xdbe062,_0x287c3a){return function(_0x30d26b){if(_0x30d26b){var _0x24d026=typeof _0x287c3a[_0x8558('0x21')]==='undefined'&&typeof _0x287c3a[_0x8558('0x22')]===_0x8558('0x23');var _0x2767cb=_0x30d26b[_0x8558('0x24')];var _0x532718=_0x24d026?0x0:_0x287c3a['offset'];var _0x29d7bf=_0x24d026?_0x30d26b['count']:_0x287c3a[_0x8558('0x21')]+_0x287c3a[_0x8558('0x22')];var _0x259d2a;if(_0x29d7bf>=_0x2767cb){_0x29d7bf=_0x2767cb;_0x259d2a=0xc8;}else{_0x259d2a=0xce;}_0xdbe062[_0x8558('0x1f')](_0x259d2a);return _0xdbe062[_0x8558('0x25')](_0x8558('0x26'),_0x532718+'-'+_0x29d7bf+'/'+_0x2767cb)[_0x8558('0x20')](_0x30d26b);}return null;};}function patchUpdates(_0x5072d6){return function(_0x26a672){try{jsonpatch[_0x8558('0x27')](_0x26a672,_0x5072d6,!![]);}catch(_0x44d11d){return BPromise[_0x8558('0x28')](_0x44d11d);}return _0x26a672['save']();};}function saveUpdates(_0x2393fa,_0x3a4d59){return function(_0x3e6778){if(_0x3e6778){return _0x3e6778[_0x8558('0x29')](_0x2393fa)[_0x8558('0x2a')](function(_0x4ce30a){return _0x4ce30a;});}return null;};}function removeEntity(_0x98c66f,_0x57d392){return function(_0x4a9eca){if(_0x4a9eca){return _0x4a9eca[_0x8558('0x2b')]()[_0x8558('0x2a')](function(){_0x98c66f[_0x8558('0x1f')](0xcc)[_0x8558('0x2c')]();});}};}function handleEntityNotFound(_0xcd45db,_0x1a592d){return function(_0x18d6bd){if(!_0x18d6bd){_0xcd45db[_0x8558('0x1e')](0x194);}return _0x18d6bd;};}function handleError(_0x65af5,_0x4bc332){_0x4bc332=_0x4bc332||0x1f4;return function(_0x114095){logger[_0x8558('0x2d')](_0x114095[_0x8558('0x2e')]);if(_0x114095['name']){delete _0x114095[_0x8558('0x2f')];}_0x65af5[_0x8558('0x1f')](_0x4bc332)[_0x8558('0x30')](_0x114095);};}function getInteractionUsers(_0x53a75e,_0x56bc65){return new BPromise(function(_0x10577c,_0x4bd44e){try{if(_0x56bc65[_0x53a75e['id']]){_0x53a75e[_0x8558('0x31')]=_[_0x8558('0x32')](_0x56bc65[_0x53a75e['id']],function(_0x53dde7){return{'id':_0x53dde7['id'],'fullname':_0x53dde7[_0x8558('0x33')]};});}}catch(_0x3684a1){_0x4bd44e(_0x3684a1);}_0x10577c(_0x53a75e);});}function getInteractionTags(_0x1a9e09,_0x207ddb){return new BPromise(function(_0x151078,_0x3ed142){try{if(_0x1a9e09[_0x8558('0x34')]){_0x1a9e09[_0x8558('0x35')]=[];_0x1a9e09['TagIds'][_0x8558('0x36')](',')[_0x8558('0x37')](function(_0x44cad1){_0x1a9e09[_0x8558('0x35')]['push'](_0x207ddb[_0x44cad1]);});}delete _0x1a9e09[_0x8558('0x34')];}catch(_0x3dd33f){_0x3ed142(_0x3dd33f);}_0x151078(_0x1a9e09);});}function updateFaxInteraction(_0x507c60,_0x5087fd,_0x4825e1){return new BPromise(function(_0x31e6eb,_0x598474){return getInteractionUsers(_0x507c60,_0x4825e1)['then'](function(_0x8114cf){return getInteractionTags(_0x8114cf,_0x5087fd);})[_0x8558('0x2a')](function(_0x294573){_0x31e6eb(_0x294573);})[_0x8558('0x38')](function(_0x313d5e){_0x598474(_0x313d5e);});});}exports[_0x8558('0x39')]=function(_0x4ec359,_0x2af79c){var _0x17949a={},_0x4e0929={},_0x38a65e={'count':0x0,'rows':[]};var _0x4ac717=_[_0x8558('0x32')](db[_0x8558('0x3a')][_0x8558('0x3b')],function(_0x17e066){return{'name':_0x17e066['fieldName'],'type':_0x17e066['type'][_0x8558('0x3c')]};});_0x4e0929[_0x8558('0x3d')]=_[_0x8558('0x32')](_0x4ac717,_0x8558('0x2f'));_0x4e0929['query']=_['keys'](_0x4ec359[_0x8558('0x3e')]);_0x4e0929[_0x8558('0x3f')]=_['intersection'](_0x4e0929['model'],_0x4e0929[_0x8558('0x3e')]);_0x17949a[_0x8558('0x40')]=_['intersection'](_0x4e0929[_0x8558('0x3d')],qs[_0x8558('0x41')](_0x4ec359[_0x8558('0x3e')][_0x8558('0x41')]));_0x17949a['attributes']=_0x17949a[_0x8558('0x40')][_0x8558('0x42')]?_0x17949a['attributes']:_0x4e0929[_0x8558('0x3d')];if(!_0x4ec359[_0x8558('0x3e')][_0x8558('0x43')]('nolimit')){_0x17949a[_0x8558('0x22')]=qs[_0x8558('0x22')](_0x4ec359[_0x8558('0x3e')][_0x8558('0x22')]);_0x17949a['offset']=qs[_0x8558('0x21')](_0x4ec359[_0x8558('0x3e')][_0x8558('0x21')]);}_0x17949a[_0x8558('0x44')]=qs[_0x8558('0x45')](_0x4ec359[_0x8558('0x3e')]['sort']);_0x17949a[_0x8558('0x46')]=qs[_0x8558('0x3f')](_[_0x8558('0x47')](_0x4ec359['query'],_0x4e0929[_0x8558('0x3f')]),_0x4ac717);var _0x270042=[];var _0x11fb57=squel[_0x8558('0x48')]()['field']('id')[_0x8558('0x49')]('name')[_0x8558('0x49')]('color')[_0x8558('0x4a')](_0x8558('0x4b'));var _0x2af5f0=squel[_0x8558('0x48')]()[_0x8558('0x49')]('u.id')[_0x8558('0x49')](_0x8558('0x4c'))['field'](_0x8558('0x4d'))[_0x8558('0x4a')](_0x8558('0x4e'),'ui')['left_join'](_0x8558('0x4f'),'u',_0x8558('0x50'));var _0x3d5217=squel['select']()[_0x8558('0x4a')](_0x8558('0x51'),'i')['left_join'](_0x8558('0x52'),'c',_0x8558('0x53'))['left_join'](_0x8558('0x4f'),'o',_0x8558('0x54'))[_0x8558('0x55')](_0x8558('0x56'),'a',_0x8558('0x57'))[_0x8558('0x55')](_0x8558('0x58'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x8558('0x55')](_0x8558('0x59'),'it',_0x8558('0x5a'))['left_join'](_0x8558('0x4b'),'t',_0x8558('0x5b'));var _0x2d1655=squel[_0x8558('0x5c')]();var _0x1b64ec=[];var _0x2c6a33=squel[_0x8558('0x5c')]();var _0x3e07f5;if(_0x4ec359[_0x8558('0x3e')][_0x8558('0x5d')]){_0x3e07f5=as[_0x8558('0x5e')](_0x4ec359[_0x8558('0x3e')]['search']);var _0x2f0416=_0x3e07f5[_0x8558('0x5f')];for(var _0x3a1c54=0x0;_0x3a1c54<_0x3e07f5[_0x8558('0x60')]['length'];_0x3a1c54++){var _0xcaa9d4=_0x3e07f5[_0x8558('0x60')][_0x3a1c54];var _0x154202='i';var _0x3b5fc2=_['find'](_0x4ac717,['name',_0xcaa9d4[_0x8558('0x49')]]);if(!_0x3b5fc2){switch(_0xcaa9d4[_0x8558('0x49')]){case _0x8558('0x61'):if(_0xcaa9d4[_0x8558('0x62')]==0x1){_0x3d5217[_0x8558('0x63')]('`'+_0xcaa9d4[_0x8558('0x49')]+'`\x20=\x200');}else{_0x3d5217[_0x8558('0x63')]('`'+_0xcaa9d4[_0x8558('0x49')]+_0x8558('0x64'));}break;case'Contact':if(_0xcaa9d4[_0x8558('0x65')]==='$substring'){if(_0xcaa9d4[_0x8558('0x62')][_0x8558('0x36')]('\x20')['length']>0x1){_0x2d1655[_0x2f0416](_0x8558('0x66'),qs[_0x8558('0x67')](_0xcaa9d4['value']),null);}else{var _0x3913cf='%'+_0xcaa9d4['value']+'%';_0x2d1655[_0x2f0416](_0x8558('0x68'),_0x3913cf,_0x3913cf,_0x3913cf);}}else{_0x3b5fc2=_[_0x8558('0x69')](_0x4ac717,[_0x8558('0x2f'),_0x8558('0x6a')]);_0xcaa9d4['field']='ContactId';_0x57bc5d=as[_0x8558('0x6b')](_0x154202,_0x3b5fc2['type'],_0xcaa9d4);_0x2d1655[_0x2f0416](_0x57bc5d['text'],_0x57bc5d['value'][_0x8558('0x6c')],_0x57bc5d[_0x8558('0x62')][_0x8558('0x2c')]);}break;case _0x8558('0x6d'):var _0x5704a0=_0xcaa9d4['value'][_0x8558('0x36')](',')[_0x8558('0x32')](function(_0x578cdb){return Number(_0x578cdb);});_0x5704a0[_0x8558('0x37')](function(_0x5bbac0){_0x2c6a33['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5bbac0+',%');});_0x1b64ec=_[_0x8558('0x6e')](_0x1b64ec,_0x5704a0);break;case _0x8558('0x6f'):if(_0xcaa9d4[_0x8558('0x65')]==='$substring'){_0x2d1655[_0x2f0416](_0x8558('0x70'),'%'+_0xcaa9d4['value']+'%',null);}else{_0x3b5fc2=_[_0x8558('0x69')](_0x4ac717,[_0x8558('0x2f'),_0x8558('0x71')]);_0xcaa9d4['field']=_0x8558('0x71');_0x57bc5d=as[_0x8558('0x6b')](_0x154202,_0x3b5fc2[_0x8558('0x72')],_0xcaa9d4);_0x2d1655[_0x2f0416](_0x57bc5d['text'],_0x57bc5d[_0x8558('0x62')][_0x8558('0x6c')],_0x57bc5d[_0x8558('0x62')]['end']);}break;case'body':_0x57bc5d=as[_0x8558('0x6b')]('me',null,_0xcaa9d4);_0x2d1655[_0x2f0416](_0x57bc5d[_0x8558('0x73')],_0x57bc5d[_0x8558('0x62')][_0x8558('0x6c')],_0x57bc5d[_0x8558('0x62')][_0x8558('0x2c')]);break;}}else{var _0x57bc5d=as['buildExpression'](_0x154202,_0x3b5fc2[_0x8558('0x72')],_0xcaa9d4);_0x2d1655[_0x2f0416](_0x57bc5d['text'],_0x57bc5d[_0x8558('0x62')][_0x8558('0x6c')],_0x57bc5d['value'][_0x8558('0x2c')]);}}}else{var _0x1fa86b=_(_0x4ec359[_0x8558('0x3e')])[_0x8558('0x74')]()[_0x8558('0x32')](function(_0x31af69){return _['some'](_0x4ac717,[_0x8558('0x2f'),_0x31af69])?_0x31af69:undefined;})[_0x8558('0x75')]()[_0x8558('0x62')]();if(!_[_0x8558('0x76')](_0x1fa86b)){_0x1fa86b[_0x8558('0x37')](function(_0x2f666c){if(_0x2f666c===_0x8558('0x77')){_0x3d5217[_0x8558('0x46')](_0x8558('0x78'),[][_0x8558('0x79')](_0x4ec359[_0x8558('0x3e')][_0x2f666c]));}else if(_0x2f666c==='createdAt'){var _0x2fa4e7=JSON[_0x8558('0x7a')](_0x4ec359[_0x8558('0x3e')][_0x2f666c])[_0x8558('0x7b')];var _0x35add9=JSON[_0x8558('0x7a')](_0x4ec359[_0x8558('0x3e')][_0x2f666c])[_0x8558('0x7c')];_0x3d5217['where'](_0x8558('0x7d'),_0x2fa4e7,_0x35add9);}else{if(_0x4ec359[_0x8558('0x3e')][_0x2f666c]===_0x8558('0x7e')){_0x3d5217[_0x8558('0x46')]('i.'+_0x2f666c+_0x8558('0x7f'));}else{_0x3d5217['where']('i.'+_0x2f666c+'\x20=\x20?',_0x4ec359[_0x8558('0x3e')][_0x2f666c]);}}});}if(_0x4ec359[_0x8558('0x3e')][_0x8558('0x80')]){if(_0x4ec359[_0x8558('0x3e')][_0x8558('0x80')]==0x1){_0x3d5217[_0x8558('0x63')](_0x8558('0x81'));}else{_0x3d5217[_0x8558('0x63')](_0x8558('0x82'));}}if(_0x4ec359[_0x8558('0x3e')][_0x8558('0x83')]){_0x1b64ec=_[_0x8558('0x84')](_0x4ec359['query'][_0x8558('0x83')])?_0x4ec359[_0x8558('0x3e')]['tag']:new Array(_0x4ec359[_0x8558('0x3e')]['tag']);_0x1b64ec['forEach'](function(_0x415f6b){_0x2c6a33['or'](_0x8558('0x85'),'%,'+_0x415f6b+',%');});}if(_0x4ec359[_0x8558('0x3e')]['filter']){var _0x33315e=_0x4ec359[_0x8558('0x3e')][_0x8558('0x86')][_0x8558('0x87')]('\x5c','\x5c\x5c')[_0x8558('0x87')](/'/g,'\x27\x27');if(qs[_0x8558('0x88')](_0x33315e)){_0x2d1655['or'](_0x8558('0x89'),_0x33315e+'%')['or'](_0x8558('0x8a'),_0x33315e+'%');}_0x2d1655['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x33315e+'%');}}_0x3d5217['where'](_0x2d1655);_0x3d5217[_0x8558('0x8b')](_0x8558('0x8c'));var _0x5d66fe={'type':db[_0x8558('0x8d')][_0x8558('0x8e')]['SELECT'],'raw':!![]};var _0x2a9d11=_0x3d5217[_0x8558('0x8f')]();_0x2a9d11['field'](_0x8558('0x8c'));_0x2a9d11[_0x8558('0x49')](_0x8558('0x90'),'unreadMessages');if(_0x17949a[_0x8558('0x44')]){_0x17949a['order'][_0x8558('0x37')](function(_0x53b3ca){var _0x57f306=_0x53b3ca[0x0]===_0x8558('0x91')?_0x53b3ca[0x0]:'i.'+_0x53b3ca[0x0];_0x3d5217['order'](_0x57f306,_0x53b3ca[0x1]===_0x8558('0x92')?![]:!![]);});}if(!_['isEmpty'](_0x1b64ec)){_0x3d5217[_0x8558('0x63')](_0x2c6a33);_0x2a9d11[_0x8558('0x46')]('t.id\x20IN\x20?',_0x1b64ec);}BPromise[_0x8558('0x93')]()['then'](function(){if(!_0x3e07f5){if(_0x4ec359[_0x8558('0x3e')][_0x8558('0x77')])return;_0x2a9d11[_0x8558('0x46')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x3d5217[_0x8558('0x46')](_0x8558('0x94'));return;}if(_0x4ec359[_0x8558('0x95')][_0x8558('0x96')]!=='agent')return;return _0x4ec359[_0x8558('0x95')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x8558('0x2a')](function(_0x9d2f41){if(_[_0x8558('0x76')](_0x9d2f41)){_0x2a9d11['where'](_0x8558('0x97'));_0x3d5217['where'](_0x8558('0x97'));}else{_0x2a9d11[_0x8558('0x46')](_0x8558('0x78'),_[_0x8558('0x32')](_0x9d2f41,'id'));_0x3d5217[_0x8558('0x46')]('i.FaxAccountId\x20IN\x20?',_[_0x8558('0x32')](_0x9d2f41,'id'));}});})[_0x8558('0x2a')](function(){if(_0x4ec359[_0x8558('0x95')][_0x8558('0x96')]===_0x8558('0x98')&&!_0x3e07f5&&!_0x4ec359[_0x8558('0x3e')][_0x8558('0x77')])return[];return db[_0x8558('0x99')][_0x8558('0x3e')](_0x2a9d11[_0x8558('0x9a')](),_0x5d66fe);})[_0x8558('0x2a')](function(_0xdd817a){_0x38a65e[_0x8558('0x24')]=_0xdd817a[_0x8558('0x42')];if(_0x38a65e[_0x8558('0x24')]===0x0)return[];return db[_0x8558('0x99')][_0x8558('0x3e')](_0x11fb57['toString'](),_0x5d66fe)[_0x8558('0x2a')](function(_0x50173d){_0x270042=_[_0x8558('0x9b')](_0x50173d,'id');_0x5d66fe=_[_0x8558('0x9c')](_0x5d66fe,{'model':db[_0x8558('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4ec359[_0x8558('0x3e')][_0x8558('0x41')]){_0x17949a[_0x8558('0x40')][_0x8558('0x37')](function(_0x13f4a6){_0x3d5217[_0x8558('0x49')]('i.'+_0x13f4a6);});}else{_0x3d5217[_0x8558('0x49')](_0x8558('0x90'),'unreadMessages');_0x3d5217['field']('a.key',_0x8558('0x9d'));_0x3d5217[_0x8558('0x49')]('a.mandatoryDisposition',_0x8558('0x9e'));_0x3d5217['field'](_0x8558('0x9f'),_0x8558('0x91'));_0x3d5217[_0x8558('0x49')](_0x8558('0xa0'));_0x3d5217[_0x8558('0x49')]('c.firstName','Contact.firstName');_0x3d5217['field'](_0x8558('0xa1'),_0x8558('0xa2'));_0x3d5217[_0x8558('0x49')](_0x8558('0xa3'),'Contact.email');_0x3d5217[_0x8558('0x49')]('c.phone',_0x8558('0xa4'));_0x3d5217[_0x8558('0x49')](_0x8558('0xa5'),_0x8558('0xa6'));_0x3d5217[_0x8558('0x49')]('c.fax',_0x8558('0xa7'));_0x3d5217[_0x8558('0x49')](_0x8558('0xa8'),_0x8558('0xa9'));_0x3d5217[_0x8558('0x49')](_0x8558('0xaa'),_0x8558('0xab'));_0x3d5217[_0x8558('0x49')](_0x8558('0xac'),_0x8558('0x34'));}if(_0x17949a[_0x8558('0x22')])_0x3d5217[_0x8558('0x22')](_0x17949a[_0x8558('0x22')]);if(_0x17949a['offset'])_0x3d5217[_0x8558('0x21')](_0x17949a[_0x8558('0x21')]);return db[_0x8558('0x99')][_0x8558('0x3e')](_0x3d5217['toString'](),_0x5d66fe);})[_0x8558('0x2a')](function(_0x26b5c0){if(_0x26b5c0[_0x8558('0x42')]>0x0)_0x2af5f0['where'](_0x8558('0xad'),_[_0x8558('0x32')](_0x26b5c0,'id'));return db[_0x8558('0x99')][_0x8558('0x3e')](_0x2af5f0[_0x8558('0x9a')](),_0x5d66fe)[_0x8558('0x2a')](function(_0x340f7a){var _0x565f23=_[_0x8558('0xae')](_0x340f7a,_0x8558('0xaf'));var _0x580ce1=[];_0x26b5c0['forEach'](function(_0x1494a4){_0x580ce1[_0x8558('0xb0')](updateFaxInteraction(_0x1494a4,_0x270042,_0x565f23));});return BPromise[_0x8558('0xb1')](_0x580ce1);});});})[_0x8558('0x2a')](function(_0x46e8e0){_0x38a65e[_0x8558('0xb2')]=_0x46e8e0;return _0x38a65e;})[_0x8558('0x2a')](respondWithFilteredResult(_0x2af79c,_0x17949a))[_0x8558('0x38')](handleError(_0x2af79c,null));};exports['show']=function(_0x23a720,_0x309968){var _0x150e18={'raw':![],'where':{'id':_0x23a720['params']['id']}},_0x1e185f={};_0x1e185f['model']=_['keys'](db[_0x8558('0x3a')][_0x8558('0x3b')]);_0x1e185f[_0x8558('0x3e')]=_['keys'](_0x23a720[_0x8558('0x3e')]);_0x1e185f[_0x8558('0x3f')]=_[_0x8558('0xb3')](_0x1e185f[_0x8558('0x3d')],_0x1e185f[_0x8558('0x3e')]);_0x150e18[_0x8558('0x40')]=_[_0x8558('0xb3')](_0x1e185f['model'],qs[_0x8558('0x41')](_0x23a720[_0x8558('0x3e')][_0x8558('0x41')]));_0x150e18[_0x8558('0x40')]=_0x150e18[_0x8558('0x40')][_0x8558('0x42')]?_0x150e18['attributes']:_0x1e185f['model'];if(_0x23a720[_0x8558('0x3e')]['includeAll']){_0x150e18[_0x8558('0xb4')]=[{'all':!![]}];}_0x150e18=_[_0x8558('0x9c')]({},_0x150e18,_0x23a720[_0x8558('0xb5')]);return db[_0x8558('0x3a')][_0x8558('0x69')](_0x150e18)[_0x8558('0x2a')](handleEntityNotFound(_0x309968,null))[_0x8558('0x2a')](respondWithResult(_0x309968,null))[_0x8558('0x38')](handleError(_0x309968,null));};exports[_0x8558('0xb6')]=function(_0x328e79,_0x3177fd){return db['FaxInteraction']['create'](_0x328e79['body'],{})[_0x8558('0x2a')](respondWithResult(_0x3177fd,0xc9))[_0x8558('0x38')](handleError(_0x3177fd,null));};exports[_0x8558('0x29')]=function(_0x242e56,_0x93c177){if(_0x242e56[_0x8558('0xb7')]['id']){delete _0x242e56[_0x8558('0xb7')]['id'];}return db[_0x8558('0x3a')][_0x8558('0x69')]({'where':{'id':_0x242e56['params']['id']}})[_0x8558('0x2a')](handleEntityNotFound(_0x93c177,null))[_0x8558('0x2a')](saveUpdates(_0x242e56[_0x8558('0xb7')],null))[_0x8558('0x2a')](respondWithResult(_0x93c177,null))[_0x8558('0x38')](handleError(_0x93c177,null));};exports[_0x8558('0x2b')]=function(_0x32ef0b,_0x47ca28){return db['FaxInteraction']['find']({'where':{'id':_0x32ef0b[_0x8558('0xb8')]['id']}})[_0x8558('0x2a')](handleEntityNotFound(_0x47ca28,null))['then'](removeEntity(_0x47ca28,null))[_0x8558('0x38')](handleError(_0x47ca28,null));};exports['describe']=function(_0x4b6368,_0x2b6b3e){return db[_0x8558('0x3a')]['describe']()[_0x8558('0x2a')](respondWithResult(_0x2b6b3e,null))[_0x8558('0x38')](handleError(_0x2b6b3e,null));};exports[_0x8558('0xb9')]=function(_0xe3198a,_0x48dcf5,_0x8fbe64){return db['FaxMessage'][_0x8558('0x69')]({'where':{'id':_0xe3198a['params']['id']}})[_0x8558('0x2a')](handleEntityNotFound(_0x48dcf5,null))[_0x8558('0x2a')](function(_0x11cf0d){if(_0x11cf0d){return _0x11cf0d[_0x8558('0xb9')](_0xe3198a[_0x8558('0xb7')][_0x8558('0xba')],_['omit'](_0xe3198a[_0x8558('0xb7')],['ids','id'])||{});}})[_0x8558('0x2a')](respondWithResult(_0x48dcf5,null))[_0x8558('0x38')](handleError(_0x48dcf5,null));};exports['getMessages']=function(_0x50bbb5,_0x39ff20,_0x5db6d7){var _0x1e6147={'raw':![],'where':{}};var _0x5629a3={};var _0x287496={'count':0x0,'rows':[]};return db[_0x8558('0x3a')][_0x8558('0xbb')]({'where':{'id':_0x50bbb5[_0x8558('0xb8')]['id']}})['then'](handleEntityNotFound(_0x39ff20,null))['then'](function(_0x260c77){if(_0x260c77){_0x5629a3[_0x8558('0x3d')]=_['keys'](db[_0x8558('0xbc')][_0x8558('0x3b')]);_0x5629a3[_0x8558('0x3e')]=_['keys'](_0x50bbb5[_0x8558('0x3e')]);_0x5629a3['filters']=_[_0x8558('0xb3')](_0x5629a3[_0x8558('0x3d')],_0x5629a3[_0x8558('0x3e')]);_0x1e6147['attributes']=_[_0x8558('0xb3')](_0x5629a3[_0x8558('0x3d')],qs[_0x8558('0x41')](_0x50bbb5['query']['fields']));_0x1e6147['attributes']=_0x1e6147[_0x8558('0x40')][_0x8558('0x42')]?_0x1e6147[_0x8558('0x40')]:_0x5629a3[_0x8558('0x3d')];if(!_0x50bbb5[_0x8558('0x3e')][_0x8558('0x43')](_0x8558('0xbd'))){_0x1e6147[_0x8558('0x22')]=qs[_0x8558('0x22')](_0x50bbb5[_0x8558('0x3e')][_0x8558('0x22')]);_0x1e6147['offset']=qs[_0x8558('0x21')](_0x50bbb5[_0x8558('0x3e')][_0x8558('0x21')]);}_0x1e6147[_0x8558('0x44')]=qs[_0x8558('0x45')](_0x50bbb5[_0x8558('0x3e')][_0x8558('0x45')]);_0x1e6147['where']=qs['filters'](_[_0x8558('0x47')](_0x50bbb5[_0x8558('0x3e')],_0x5629a3[_0x8558('0x3f')]));_0x1e6147[_0x8558('0x46')][_0x8558('0xaf')]=_0x260c77['id'];if(_0x50bbb5[_0x8558('0x3e')][_0x8558('0x86')]){_0x1e6147[_0x8558('0x46')]=_[_0x8558('0x9c')](_0x1e6147[_0x8558('0x46')],{'$or':_[_0x8558('0x32')](_0x1e6147['attributes'],function(_0x16fc6f){var _0x101c4a={};_0x101c4a[_0x16fc6f]={'$like':'%'+_0x50bbb5['query'][_0x8558('0x86')]+'%'};return _0x101c4a;})});}if(_0x50bbb5[_0x8558('0x3e')][_0x8558('0x7b')]){var _0x30d01f=_0x50bbb5[_0x8558('0x3e')]['$gte'][_0x8558('0x36')](',');var _0x20b157={};_0x20b157[_0x30d01f[0x0]]={'$gte':moment(_0x30d01f[0x1])[_0x8558('0xbe')](_0x8558('0xbf'))};_0x1e6147['where']=_[_0x8558('0x9c')](_0x1e6147[_0x8558('0x46')],_0x20b157);}_0x1e6147=_['merge']({},_0x1e6147,_0x50bbb5['options']);return db[_0x8558('0xbc')][_0x8558('0x24')]({'where':_0x1e6147[_0x8558('0x46')]})[_0x8558('0x2a')](function(_0x4d5563){_0x287496[_0x8558('0x24')]=_0x4d5563;if(_0x50bbb5[_0x8558('0x3e')]['includeAll']){_0x1e6147[_0x8558('0xb4')]=[{'all':!![]}];}return db['FaxMessage'][_0x8558('0xc0')](_0x1e6147);})[_0x8558('0x2a')](function(_0x183991){_0x287496['rows']=_0x183991;return _0x287496;});}})['then'](respondWithFilteredResult(_0x39ff20,_0x1e6147))[_0x8558('0x38')](handleError(_0x39ff20,null));};exports[_0x8558('0xc1')]=function(_0x339819,_0x53d8b9,_0x38562c){return db[_0x8558('0x3a')][_0x8558('0x69')]({'where':{'id':_0x339819['params']['id']}})[_0x8558('0x2a')](handleEntityNotFound(_0x53d8b9,null))[_0x8558('0x2a')](function(_0x27b980){if(_0x27b980){return _0x27b980[_0x8558('0xc2')](_0x339819[_0x8558('0xb7')][_0x8558('0xba')],_[_0x8558('0xc3')](_0x339819[_0x8558('0xb7')],[_0x8558('0xba'),'id'])||{})[_0x8558('0xc4')](function(){return db['Tag'][_0x8558('0xc0')]({'attributes':['id',_0x8558('0x2f'),_0x8558('0xc5')],'where':{'id':_0x339819[_0x8558('0xb7')]['ids']}});})[_0x8558('0x2a')](function(_0x4f9e3e){socket[_0x8558('0xc6')]('faxInteractionTags:save',{'id':Number(_0x339819['params']['id']),'tags':_0x4f9e3e||[]});return{'id':Number(_0x339819[_0x8558('0xb8')]['id']),'tags':_0x4f9e3e||[]};});}})[_0x8558('0x2a')](respondWithResult(_0x53d8b9,null))[_0x8558('0x38')](handleError(_0x53d8b9,null));};exports['removeTags']=function(_0x16a759,_0x594957,_0xf8508f){return db[_0x8558('0x3a')][_0x8558('0x69')]({'where':{'id':_0x16a759['params']['id']}})[_0x8558('0x2a')](handleEntityNotFound(_0x594957,null))[_0x8558('0x2a')](function(_0x43720c){if(_0x43720c){return _0x43720c[_0x8558('0xc7')](_0x16a759[_0x8558('0x3e')][_0x8558('0xba')]);}})['then'](respondWithStatusCode(_0x594957,null))[_0x8558('0x38')](handleError(_0x594957,null));};exports['download']=function(_0xd45670,_0x8d258c){var _0x362126=moment()[_0x8558('0xc8')]()['toString']();var _0x40ab9e=path[_0x8558('0xc9')](config[_0x8558('0xca')],_0x8558('0xcb'),_0x8558('0xcc'),_0x8558('0xcd'));var _0x37772c=path['join'](config[_0x8558('0xca')],_0x8558('0xcb'),_0x8558('0xcc'),_0x8558('0xce'));var _0x20230c=path[_0x8558('0xc9')](_0x40ab9e,_0x362126);var _0x439fa2=util[_0x8558('0xbe')](_0x8558('0xcf'),_0xd45670[_0x8558('0xb8')]['id'],_0x362126);var _0x1cd37e=path['join'](_0x40ab9e,_0x439fa2);var _0x36b226=[];_0x36b226[_0x8558('0xb0')]({'model':db['Attachment'],'as':_0x8558('0xd0'),'raw':!![]});var _0x47d639=[{'model':db['FaxMessage'],'as':_0x8558('0xd1'),'attributes':['id',_0x8558('0xb7'),_0x8558('0xd2')],'include':_0x36b226}];return db['FaxInteraction'][_0x8558('0x69')]({'where':{'id':_0xd45670['params']['id']},'include':_0x47d639})[_0x8558('0x2a')](handleEntityNotFound(_0x8d258c,null))['then'](function(_0x55f803){if(_0x55f803&&_0x55f803[_0x8558('0xd1')]){var _0x4a2c3d=_0x55f803[_0x8558('0xd3')]({'plain':!![]});fs[_0x8558('0xd4')](_0x20230c);for(var _0x1eaa92=0x0;_0x1eaa92<_0x4a2c3d[_0x8558('0xd1')][_0x8558('0x42')];_0x1eaa92++){var _0x2341b4=_0x4a2c3d[_0x8558('0xd1')][_0x1eaa92][_0x8558('0xd0')];if(_0x2341b4){var _0x2b4fb0=path[_0x8558('0xc9')](_0x37772c,_0x2341b4[_0x8558('0xd5')]);if(fs['existsSync'](_0x2b4fb0)){fs[_0x8558('0xd6')](_0x2b4fb0)[_0x8558('0xd7')](fs[_0x8558('0xd8')](path[_0x8558('0xc9')](_0x20230c,_0x2341b4[_0x8558('0xd5')])));}}}return BPromise[_0x8558('0x93')]()[_0x8558('0x2a')](function(){return new BPromise(function(_0x5e4e54,_0x48a586){zipdir(_0x20230c,{'saveTo':_0x1cd37e},function(_0x13b26f,_0x1c91f0){if(_0x13b26f)return _0x48a586(_0x13b26f);return _0x5e4e54(_0x1c91f0);});})[_0x8558('0x2a')](function(){return new BPromise(function(_0x3af7e0,_0x2f7f3c){rimraf(_0x20230c,function(_0x345cf4){if(_0x345cf4)_0x2f7f3c(_0x345cf4);return _0x3af7e0();});});})[_0x8558('0x2a')](function(){return _0x8d258c['download'](_0x1cd37e,_0x439fa2,function(_0x511841){if(_0x511841){console[_0x8558('0xd9')](_0x8558('0xda'),_0x511841);}else{fs[_0x8558('0xdb')](_0x1cd37e);}});});});}else{return _0x8d258c[_0x8558('0x1e')](0xc8);}})['catch'](handleError(_0x8d258c,null));}; \ No newline at end of file +var _0x0710=['socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','undefined','count','offset','limit','Content-Range','save','update','then','end','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','FaxInteraction','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','user_has_fax_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.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','having','`\x20=\x200','Contact','operator','$substring','value','getFullTextValue','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','i.id','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','i.FaxAccountId\x20IS\x20NULL','role','FaxAccountId','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','show','params','filters','includeAll','include','options','create','destroy','describe','addMessage','FaxMessage','ids','omit','findOne','hasOwnProperty','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','Tag','emit','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','existsSync','pipe','basename','log','err','unlinkSync','eml-format','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x294690,_0xf512ca){var _0x27219c=function(_0x48dc79){while(--_0x48dc79){_0x294690['push'](_0x294690['shift']());}};_0x27219c(++_0xf512ca);}(_0x0710,0xb7));var _0x0071=function(_0x36828e,_0x1e401c){_0x36828e=_0x36828e-0x0;var _0x129fe3=_0x0710[_0x36828e];return _0x129fe3;};'use strict';var emlformat=require(_0x0071('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0071('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0071('0x2'));var util=require(_0x0071('0x3'));var path=require(_0x0071('0x4'));var sox=require(_0x0071('0x5'));var csv=require(_0x0071('0x6'));var ejs=require(_0x0071('0x7'));var fs=require('fs');var fs_extra=require(_0x0071('0x8'));var _=require(_0x0071('0x9'));var squel=require(_0x0071('0xa'));var crypto=require(_0x0071('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0071('0xc'));var toCsv=require(_0x0071('0x6'));var querystring=require(_0x0071('0xd'));var Papa=require(_0x0071('0xe'));var Redis=require(_0x0071('0xf'));var authService=require(_0x0071('0x10'));var qs=require(_0x0071('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0071('0x12'));var logger=require(_0x0071('0x13'))('api');var utils=require(_0x0071('0x14'));var config=require(_0x0071('0x15'));var licenseUtil=require(_0x0071('0x16'));var db=require(_0x0071('0x17'))['db'];config[_0x0071('0x18')]=_[_0x0071('0x19')](config[_0x0071('0x18')],{'host':_0x0071('0x1a'),'port':0x18eb});var socket=require(_0x0071('0x1b'))(new Redis(config[_0x0071('0x18')]));require(_0x0071('0x1c'))[_0x0071('0x1d')](socket);function respondWithStatusCode(_0x5f5758,_0x3b17e7){_0x3b17e7=_0x3b17e7||0xcc;return function(_0x9af0b){if(_0x9af0b){return _0x5f5758[_0x0071('0x1e')](_0x3b17e7);}return _0x5f5758[_0x0071('0x1f')](_0x3b17e7)['end']();};}function respondWithResult(_0x2cab66,_0x43ef50){_0x43ef50=_0x43ef50||0xc8;return function(_0x137113){if(_0x137113){return _0x2cab66[_0x0071('0x1f')](_0x43ef50)[_0x0071('0x20')](_0x137113);}};}function respondWithFilteredResult(_0xb89f4c,_0x389a18){return function(_0x1439e8){if(_0x1439e8){var _0x5e1117=typeof _0x389a18['offset']===_0x0071('0x21')&&typeof _0x389a18['limit']==='undefined';var _0x4dd367=_0x1439e8[_0x0071('0x22')];var _0x12ce44=_0x5e1117?0x0:_0x389a18[_0x0071('0x23')];var _0x5b30e0=_0x5e1117?_0x1439e8[_0x0071('0x22')]:_0x389a18[_0x0071('0x23')]+_0x389a18[_0x0071('0x24')];var _0x3ed622;if(_0x5b30e0>=_0x4dd367){_0x5b30e0=_0x4dd367;_0x3ed622=0xc8;}else{_0x3ed622=0xce;}_0xb89f4c['status'](_0x3ed622);return _0xb89f4c['set'](_0x0071('0x25'),_0x12ce44+'-'+_0x5b30e0+'/'+_0x4dd367)[_0x0071('0x20')](_0x1439e8);}return null;};}function patchUpdates(_0x2d9067){return function(_0xe3aae3){try{jsonpatch['apply'](_0xe3aae3,_0x2d9067,!![]);}catch(_0x1302d4){return BPromise['reject'](_0x1302d4);}return _0xe3aae3[_0x0071('0x26')]();};}function saveUpdates(_0x188cb1,_0x1fe35d){return function(_0x5eb413){if(_0x5eb413){return _0x5eb413[_0x0071('0x27')](_0x188cb1)[_0x0071('0x28')](function(_0x21e932){return _0x21e932;});}return null;};}function removeEntity(_0x15f274,_0x7314b7){return function(_0x52d7ed){if(_0x52d7ed){return _0x52d7ed['destroy']()['then'](function(){_0x15f274[_0x0071('0x1f')](0xcc)[_0x0071('0x29')]();});}};}function handleEntityNotFound(_0x59c702,_0x535074){return function(_0x339037){if(!_0x339037){_0x59c702['sendStatus'](0x194);}return _0x339037;};}function handleError(_0x4149e4,_0x519484){_0x519484=_0x519484||0x1f4;return function(_0x302a81){logger[_0x0071('0x2a')](_0x302a81[_0x0071('0x2b')]);if(_0x302a81['name']){delete _0x302a81[_0x0071('0x2c')];}_0x4149e4[_0x0071('0x1f')](_0x519484)['send'](_0x302a81);};}function getInteractionUsers(_0x49d16a,_0x13fec0){return new BPromise(function(_0x2a1eab,_0x424d0d){try{if(_0x13fec0[_0x49d16a['id']]){_0x49d16a[_0x0071('0x2d')]=_[_0x0071('0x2e')](_0x13fec0[_0x49d16a['id']],function(_0x2b8f7a){return{'id':_0x2b8f7a['id'],'fullname':_0x2b8f7a[_0x0071('0x2f')]};});}}catch(_0x232809){_0x424d0d(_0x232809);}_0x2a1eab(_0x49d16a);});}function getInteractionTags(_0x211309,_0x356ffe){return new BPromise(function(_0xc50821,_0x2705d4){try{if(_0x211309[_0x0071('0x30')]){_0x211309[_0x0071('0x31')]=[];_0x211309[_0x0071('0x30')][_0x0071('0x32')](',')[_0x0071('0x33')](function(_0x14b00a){_0x211309['Tags'][_0x0071('0x34')](_0x356ffe[_0x14b00a]);});}delete _0x211309['TagIds'];}catch(_0x93aedc){_0x2705d4(_0x93aedc);}_0xc50821(_0x211309);});}function updateFaxInteraction(_0x126a2a,_0x14c281,_0x396b09){return new BPromise(function(_0x592163,_0x11a3f1){return getInteractionUsers(_0x126a2a,_0x396b09)['then'](function(_0x525637){return getInteractionTags(_0x525637,_0x14c281);})['then'](function(_0x465a7d){_0x592163(_0x465a7d);})[_0x0071('0x35')](function(_0x2b7f54){_0x11a3f1(_0x2b7f54);});});}exports['index']=function(_0x36010b,_0x3983d0){var _0x524833={},_0x252299={},_0x2e0e4d={'count':0x0,'rows':[]};var _0x4f1ef3=_[_0x0071('0x2e')](db[_0x0071('0x36')][_0x0071('0x37')],function(_0x1e9d54){return{'name':_0x1e9d54['fieldName'],'type':_0x1e9d54[_0x0071('0x38')]['key']};});_0x252299[_0x0071('0x39')]=_[_0x0071('0x2e')](_0x4f1ef3,_0x0071('0x2c'));_0x252299[_0x0071('0x3a')]=_[_0x0071('0x3b')](_0x36010b['query']);_0x252299['filters']=_[_0x0071('0x3c')](_0x252299[_0x0071('0x39')],_0x252299[_0x0071('0x3a')]);_0x524833[_0x0071('0x3d')]=_[_0x0071('0x3c')](_0x252299[_0x0071('0x39')],qs[_0x0071('0x3e')](_0x36010b[_0x0071('0x3a')][_0x0071('0x3e')]));_0x524833[_0x0071('0x3d')]=_0x524833[_0x0071('0x3d')][_0x0071('0x3f')]?_0x524833['attributes']:_0x252299[_0x0071('0x39')];if(!_0x36010b[_0x0071('0x3a')]['hasOwnProperty'](_0x0071('0x40'))){_0x524833['limit']=qs[_0x0071('0x24')](_0x36010b[_0x0071('0x3a')]['limit']);_0x524833['offset']=qs['offset'](_0x36010b[_0x0071('0x3a')][_0x0071('0x23')]);}_0x524833['order']=qs[_0x0071('0x41')](_0x36010b[_0x0071('0x3a')][_0x0071('0x41')]);_0x524833[_0x0071('0x42')]=qs['filters'](_[_0x0071('0x43')](_0x36010b[_0x0071('0x3a')],_0x252299['filters']),_0x4f1ef3);var _0x169452=[];var _0x33d2ff=squel['select']()[_0x0071('0x44')]('id')[_0x0071('0x44')](_0x0071('0x2c'))['field'](_0x0071('0x45'))[_0x0071('0x46')](_0x0071('0x47'));var _0x485f3a=squel[_0x0071('0x48')]()[_0x0071('0x44')](_0x0071('0x49'))[_0x0071('0x44')](_0x0071('0x4a'))['field']('ui.FaxInteractionId')[_0x0071('0x46')](_0x0071('0x4b'),'ui')[_0x0071('0x4c')](_0x0071('0x4d'),'u',_0x0071('0x4e'));var _0x4427d8=squel[_0x0071('0x48')]()[_0x0071('0x46')]('fax_interactions','i')[_0x0071('0x4c')](_0x0071('0x4f'),'c',_0x0071('0x50'))['left_join']('users','o',_0x0071('0x51'))[_0x0071('0x4c')]('fax_accounts','a',_0x0071('0x52'))[_0x0071('0x4c')](_0x0071('0x53'),'me',_0x0071('0x54'))['left_join'](_0x0071('0x55'),'it',_0x0071('0x56'))[_0x0071('0x4c')](_0x0071('0x47'),'t','t.id\x20=\x20it.TagId');var _0x58c24d=squel[_0x0071('0x57')]();var _0xc367eb=[];var _0x433e24=squel['expr']();var _0xa8b0ab;if(_0x36010b['query'][_0x0071('0x58')]){_0xa8b0ab=as[_0x0071('0x59')](_0x36010b[_0x0071('0x3a')][_0x0071('0x58')]);var _0x187c8=_0xa8b0ab['sqlOperator'];for(var _0x527d93=0x0;_0x527d93<_0xa8b0ab[_0x0071('0x5a')]['length'];_0x527d93++){var _0x4ea123=_0xa8b0ab[_0x0071('0x5a')][_0x527d93];var _0x11bf6e='i';var _0x3284d0=_[_0x0071('0x5b')](_0x4f1ef3,['name',_0x4ea123[_0x0071('0x44')]]);if(!_0x3284d0){switch(_0x4ea123[_0x0071('0x44')]){case'unreadMessages':if(_0x4ea123['value']==0x1){_0x4427d8[_0x0071('0x5c')]('`'+_0x4ea123[_0x0071('0x44')]+_0x0071('0x5d'));}else{_0x4427d8[_0x0071('0x5c')]('`'+_0x4ea123[_0x0071('0x44')]+'`\x20>\x200');}break;case _0x0071('0x5e'):if(_0x4ea123[_0x0071('0x5f')]===_0x0071('0x60')){if(_0x4ea123[_0x0071('0x61')][_0x0071('0x32')]('\x20')[_0x0071('0x3f')]>0x1){_0x58c24d[_0x187c8]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0071('0x62')](_0x4ea123['value']),null);}else{var _0x53a167='%'+_0x4ea123[_0x0071('0x61')]+'%';_0x58c24d[_0x187c8]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x53a167,_0x53a167,_0x53a167);}}else{_0x3284d0=_[_0x0071('0x5b')](_0x4f1ef3,[_0x0071('0x2c'),_0x0071('0x63')]);_0x4ea123['field']=_0x0071('0x63');_0x398cd1=as[_0x0071('0x64')](_0x11bf6e,_0x3284d0['type'],_0x4ea123);_0x58c24d[_0x187c8](_0x398cd1[_0x0071('0x65')],_0x398cd1['value']['start'],_0x398cd1[_0x0071('0x61')][_0x0071('0x29')]);}break;case'Tag':var _0x353777=_0x4ea123['value'][_0x0071('0x32')](',')[_0x0071('0x2e')](function(_0x3868df){return Number(_0x3868df);});_0x353777[_0x0071('0x33')](function(_0x54223a){_0x433e24['or'](_0x0071('0x66'),'%,'+_0x54223a+',%');});_0xc367eb=_[_0x0071('0x67')](_0xc367eb,_0x353777);break;case _0x0071('0x68'):if(_0x4ea123[_0x0071('0x5f')]===_0x0071('0x60')){_0x58c24d[_0x187c8](_0x0071('0x69'),'%'+_0x4ea123['value']+'%',null);}else{_0x3284d0=_[_0x0071('0x5b')](_0x4f1ef3,[_0x0071('0x2c'),'UserId']);_0x4ea123[_0x0071('0x44')]=_0x0071('0x6a');_0x398cd1=as['buildExpression'](_0x11bf6e,_0x3284d0[_0x0071('0x38')],_0x4ea123);_0x58c24d[_0x187c8](_0x398cd1[_0x0071('0x65')],_0x398cd1['value'][_0x0071('0x6b')],_0x398cd1[_0x0071('0x61')][_0x0071('0x29')]);}break;case _0x0071('0x6c'):_0x398cd1=as[_0x0071('0x64')]('me',null,_0x4ea123);_0x58c24d[_0x187c8](_0x398cd1[_0x0071('0x65')],_0x398cd1['value'][_0x0071('0x6b')],_0x398cd1['value'][_0x0071('0x29')]);break;}}else{var _0x398cd1=as['buildExpression'](_0x11bf6e,_0x3284d0[_0x0071('0x38')],_0x4ea123);_0x58c24d[_0x187c8](_0x398cd1['text'],_0x398cd1[_0x0071('0x61')][_0x0071('0x6b')],_0x398cd1[_0x0071('0x61')][_0x0071('0x29')]);}}}else{var _0x254f18=_(_0x36010b[_0x0071('0x3a')])[_0x0071('0x3b')]()['map'](function(_0x503d2d){return _['some'](_0x4f1ef3,[_0x0071('0x2c'),_0x503d2d])?_0x503d2d:undefined;})[_0x0071('0x6d')]()[_0x0071('0x61')]();if(!_[_0x0071('0x6e')](_0x254f18)){_0x254f18[_0x0071('0x33')](function(_0x525c84){if(_0x525c84==='FaxAccountId'){_0x4427d8[_0x0071('0x42')](_0x0071('0x6f'),[][_0x0071('0x70')](_0x36010b[_0x0071('0x3a')][_0x525c84]));}else if(_0x525c84===_0x0071('0x71')){var _0x2f236e=JSON[_0x0071('0x72')](_0x36010b[_0x0071('0x3a')][_0x525c84])[_0x0071('0x73')];var _0x20a6a4=JSON[_0x0071('0x72')](_0x36010b['query'][_0x525c84])[_0x0071('0x74')];_0x4427d8[_0x0071('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2f236e,_0x20a6a4);}else{if(_0x36010b[_0x0071('0x3a')][_0x525c84]===_0x0071('0x75')){_0x4427d8[_0x0071('0x42')]('i.'+_0x525c84+_0x0071('0x76'));}else{_0x4427d8['where']('i.'+_0x525c84+_0x0071('0x77'),_0x36010b[_0x0071('0x3a')][_0x525c84]);}}});}if(_0x36010b['query']['read']){if(_0x36010b[_0x0071('0x3a')]['read']==0x1){_0x4427d8[_0x0071('0x5c')](_0x0071('0x78'));}else{_0x4427d8['having'](_0x0071('0x79'));}}if(_0x36010b[_0x0071('0x3a')][_0x0071('0x7a')]){_0xc367eb=_[_0x0071('0x7b')](_0x36010b[_0x0071('0x3a')]['tag'])?_0x36010b[_0x0071('0x3a')][_0x0071('0x7a')]:new Array(_0x36010b[_0x0071('0x3a')]['tag']);_0xc367eb[_0x0071('0x33')](function(_0x30f253){_0x433e24['or'](_0x0071('0x66'),'%,'+_0x30f253+',%');});}if(_0x36010b[_0x0071('0x3a')]['filter']){var _0x41da94=_0x36010b[_0x0071('0x3a')][_0x0071('0x7c')][_0x0071('0x7d')]('\x5c','\x5c\x5c')[_0x0071('0x7d')](/'/g,'\x27\x27');if(qs[_0x0071('0x7e')](_0x41da94)){_0x58c24d['or'](_0x0071('0x7f'),_0x41da94+'%')['or']('i.fax\x20LIKE\x20?',_0x41da94+'%');}_0x58c24d['or'](_0x0071('0x80'),_0x41da94+'%');}}_0x4427d8[_0x0071('0x42')](_0x58c24d);_0x4427d8['group']('i.id');var _0x30abf5={'type':db[_0x0071('0x81')][_0x0071('0x82')][_0x0071('0x83')],'raw':!![]};var _0x51e9ce=_0x4427d8['clone']();_0x51e9ce[_0x0071('0x44')](_0x0071('0x84'));_0x51e9ce[_0x0071('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0071('0x85'));if(_0x524833[_0x0071('0x86')]){_0x524833[_0x0071('0x86')][_0x0071('0x33')](function(_0x46a3e7){var _0x4b8041=_0x46a3e7[0x0]===_0x0071('0x87')?_0x46a3e7[0x0]:'i.'+_0x46a3e7[0x0];_0x4427d8[_0x0071('0x86')](_0x4b8041,_0x46a3e7[0x1]===_0x0071('0x88')?![]:!![]);});}if(!_[_0x0071('0x6e')](_0xc367eb)){_0x4427d8[_0x0071('0x5c')](_0x433e24);_0x51e9ce[_0x0071('0x42')](_0x0071('0x89'),_0xc367eb);}BPromise[_0x0071('0x8a')]()[_0x0071('0x28')](function(){if(!_0xa8b0ab){if(_0x36010b['query']['FaxAccountId'])return;_0x51e9ce[_0x0071('0x42')](_0x0071('0x8b'));_0x4427d8['where'](_0x0071('0x8b'));return;}if(_0x36010b[_0x0071('0x8c')]['role']!==_0x0071('0x8d'))return;return _0x36010b[_0x0071('0x8c')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x0071('0x28')](function(_0x580d31){if(_[_0x0071('0x6e')](_0x580d31)){_0x51e9ce[_0x0071('0x42')](_0x0071('0x8e'));_0x4427d8[_0x0071('0x42')](_0x0071('0x8e'));}else{_0x51e9ce[_0x0071('0x42')](_0x0071('0x6f'),_[_0x0071('0x2e')](_0x580d31,'id'));_0x4427d8['where']('i.FaxAccountId\x20IN\x20?',_[_0x0071('0x2e')](_0x580d31,'id'));}});})[_0x0071('0x28')](function(){if(_0x36010b[_0x0071('0x8c')][_0x0071('0x8f')]===_0x0071('0x8d')&&!_0xa8b0ab&&!_0x36010b[_0x0071('0x3a')][_0x0071('0x90')])return[];return db[_0x0071('0x91')][_0x0071('0x3a')](_0x51e9ce['toString'](),_0x30abf5);})['then'](function(_0x1123dd){_0x2e0e4d['count']=_0x1123dd[_0x0071('0x3f')];if(_0x2e0e4d[_0x0071('0x22')]===0x0)return[];return db[_0x0071('0x91')][_0x0071('0x3a')](_0x33d2ff[_0x0071('0x92')](),_0x30abf5)[_0x0071('0x28')](function(_0x57eda5){_0x169452=_['keyBy'](_0x57eda5,'id');_0x30abf5=_[_0x0071('0x93')](_0x30abf5,{'model':db[_0x0071('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x36010b[_0x0071('0x3a')][_0x0071('0x3e')]){_0x524833[_0x0071('0x3d')]['forEach'](function(_0x23101a){_0x4427d8[_0x0071('0x44')]('i.'+_0x23101a);});}else{_0x4427d8[_0x0071('0x44')](_0x0071('0x94'),'unreadMessages');_0x4427d8[_0x0071('0x44')]('a.key',_0x0071('0x95'));_0x4427d8[_0x0071('0x44')](_0x0071('0x96'),_0x0071('0x97'));_0x4427d8['field'](_0x0071('0x98'),'contactName');_0x4427d8[_0x0071('0x44')](_0x0071('0x99'));_0x4427d8[_0x0071('0x44')]('c.firstName',_0x0071('0x9a'));_0x4427d8['field'](_0x0071('0x9b'),_0x0071('0x9c'));_0x4427d8[_0x0071('0x44')](_0x0071('0x9d'),_0x0071('0x9e'));_0x4427d8[_0x0071('0x44')](_0x0071('0x9f'),_0x0071('0xa0'));_0x4427d8['field'](_0x0071('0xa1'),_0x0071('0xa2'));_0x4427d8[_0x0071('0x44')](_0x0071('0xa3'),'Contact.fax');_0x4427d8[_0x0071('0x44')](_0x0071('0xa4'),'Owner.fullname');_0x4427d8[_0x0071('0x44')]('o.internal',_0x0071('0xa5'));_0x4427d8['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0071('0x30'));}if(_0x524833[_0x0071('0x24')])_0x4427d8['limit'](_0x524833[_0x0071('0x24')]);if(_0x524833['offset'])_0x4427d8[_0x0071('0x23')](_0x524833[_0x0071('0x23')]);return db['sequelize'][_0x0071('0x3a')](_0x4427d8[_0x0071('0x92')](),_0x30abf5);})[_0x0071('0x28')](function(_0xbfc1cf){if(_0xbfc1cf[_0x0071('0x3f')]>0x0)_0x485f3a['where'](_0x0071('0xa6'),_[_0x0071('0x2e')](_0xbfc1cf,'id'));return db['sequelize']['query'](_0x485f3a['toString'](),_0x30abf5)['then'](function(_0x1f2a09){var _0x4c964b=_[_0x0071('0xa7')](_0x1f2a09,'FaxInteractionId');var _0x343656=[];_0xbfc1cf[_0x0071('0x33')](function(_0x1f0fdd){_0x343656[_0x0071('0x34')](updateFaxInteraction(_0x1f0fdd,_0x169452,_0x4c964b));});return BPromise[_0x0071('0xa8')](_0x343656);});});})['then'](function(_0xf0a471){_0x2e0e4d[_0x0071('0xa9')]=_0xf0a471;return _0x2e0e4d;})[_0x0071('0x28')](respondWithFilteredResult(_0x3983d0,_0x524833))[_0x0071('0x35')](handleError(_0x3983d0,null));};exports[_0x0071('0xaa')]=function(_0x5678d5,_0x174f05){var _0x18dc2c={'raw':![],'where':{'id':_0x5678d5[_0x0071('0xab')]['id']}},_0xfe2a32={};_0xfe2a32['model']=_['keys'](db['FaxInteraction'][_0x0071('0x37')]);_0xfe2a32[_0x0071('0x3a')]=_[_0x0071('0x3b')](_0x5678d5['query']);_0xfe2a32[_0x0071('0xac')]=_[_0x0071('0x3c')](_0xfe2a32[_0x0071('0x39')],_0xfe2a32[_0x0071('0x3a')]);_0x18dc2c[_0x0071('0x3d')]=_[_0x0071('0x3c')](_0xfe2a32[_0x0071('0x39')],qs[_0x0071('0x3e')](_0x5678d5[_0x0071('0x3a')][_0x0071('0x3e')]));_0x18dc2c[_0x0071('0x3d')]=_0x18dc2c[_0x0071('0x3d')][_0x0071('0x3f')]?_0x18dc2c['attributes']:_0xfe2a32[_0x0071('0x39')];if(_0x5678d5[_0x0071('0x3a')][_0x0071('0xad')]){_0x18dc2c[_0x0071('0xae')]=[{'all':!![]}];}_0x18dc2c=_[_0x0071('0x93')]({},_0x18dc2c,_0x5678d5[_0x0071('0xaf')]);return db[_0x0071('0x36')][_0x0071('0x5b')](_0x18dc2c)['then'](handleEntityNotFound(_0x174f05,null))[_0x0071('0x28')](respondWithResult(_0x174f05,null))['catch'](handleError(_0x174f05,null));};exports[_0x0071('0xb0')]=function(_0x16e6f0,_0x4606eb){return db[_0x0071('0x36')][_0x0071('0xb0')](_0x16e6f0['body'],{})['then'](respondWithResult(_0x4606eb,0xc9))[_0x0071('0x35')](handleError(_0x4606eb,null));};exports[_0x0071('0x27')]=function(_0x3f8b35,_0x1e0240){if(_0x3f8b35[_0x0071('0x6c')]['id']){delete _0x3f8b35[_0x0071('0x6c')]['id'];}return db[_0x0071('0x36')][_0x0071('0x5b')]({'where':{'id':_0x3f8b35[_0x0071('0xab')]['id']}})[_0x0071('0x28')](handleEntityNotFound(_0x1e0240,null))[_0x0071('0x28')](saveUpdates(_0x3f8b35['body'],null))[_0x0071('0x28')](respondWithResult(_0x1e0240,null))[_0x0071('0x35')](handleError(_0x1e0240,null));};exports[_0x0071('0xb1')]=function(_0x225959,_0x3d9246){return db[_0x0071('0x36')][_0x0071('0x5b')]({'where':{'id':_0x225959['params']['id']}})[_0x0071('0x28')](handleEntityNotFound(_0x3d9246,null))[_0x0071('0x28')](removeEntity(_0x3d9246,null))['catch'](handleError(_0x3d9246,null));};exports[_0x0071('0xb2')]=function(_0x5f541d,_0x1045cf){return db[_0x0071('0x36')]['describe']()[_0x0071('0x28')](respondWithResult(_0x1045cf,null))[_0x0071('0x35')](handleError(_0x1045cf,null));};exports[_0x0071('0xb3')]=function(_0x55c803,_0x3c3716,_0x3948c0){return db[_0x0071('0xb4')][_0x0071('0x5b')]({'where':{'id':_0x55c803[_0x0071('0xab')]['id']}})[_0x0071('0x28')](handleEntityNotFound(_0x3c3716,null))[_0x0071('0x28')](function(_0x1f8d32){if(_0x1f8d32){return _0x1f8d32['addMessage'](_0x55c803[_0x0071('0x6c')][_0x0071('0xb5')],_[_0x0071('0xb6')](_0x55c803['body'],['ids','id'])||{});}})[_0x0071('0x28')](respondWithResult(_0x3c3716,null))['catch'](handleError(_0x3c3716,null));};exports['getMessages']=function(_0x2c8a3d,_0x2ca51e,_0x276dec){var _0x285b2a={'raw':![],'where':{}};var _0xd49edc={};var _0x4259de={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x0071('0xb7')]({'where':{'id':_0x2c8a3d[_0x0071('0xab')]['id']}})[_0x0071('0x28')](handleEntityNotFound(_0x2ca51e,null))[_0x0071('0x28')](function(_0x38a147){if(_0x38a147){_0xd49edc[_0x0071('0x39')]=_[_0x0071('0x3b')](db[_0x0071('0xb4')][_0x0071('0x37')]);_0xd49edc[_0x0071('0x3a')]=_['keys'](_0x2c8a3d[_0x0071('0x3a')]);_0xd49edc[_0x0071('0xac')]=_[_0x0071('0x3c')](_0xd49edc[_0x0071('0x39')],_0xd49edc[_0x0071('0x3a')]);_0x285b2a[_0x0071('0x3d')]=_[_0x0071('0x3c')](_0xd49edc['model'],qs[_0x0071('0x3e')](_0x2c8a3d[_0x0071('0x3a')][_0x0071('0x3e')]));_0x285b2a[_0x0071('0x3d')]=_0x285b2a['attributes'][_0x0071('0x3f')]?_0x285b2a[_0x0071('0x3d')]:_0xd49edc[_0x0071('0x39')];if(!_0x2c8a3d['query'][_0x0071('0xb8')]('nolimit')){_0x285b2a[_0x0071('0x24')]=qs[_0x0071('0x24')](_0x2c8a3d['query'][_0x0071('0x24')]);_0x285b2a[_0x0071('0x23')]=qs['offset'](_0x2c8a3d[_0x0071('0x3a')]['offset']);}_0x285b2a[_0x0071('0x86')]=qs[_0x0071('0x41')](_0x2c8a3d[_0x0071('0x3a')][_0x0071('0x41')]);_0x285b2a[_0x0071('0x42')]=qs['filters'](_[_0x0071('0x43')](_0x2c8a3d[_0x0071('0x3a')],_0xd49edc[_0x0071('0xac')]));_0x285b2a[_0x0071('0x42')][_0x0071('0xb9')]=_0x38a147['id'];if(_0x2c8a3d[_0x0071('0x3a')][_0x0071('0x7c')]){_0x285b2a[_0x0071('0x42')]=_[_0x0071('0x93')](_0x285b2a['where'],{'$or':_[_0x0071('0x2e')](_0x285b2a[_0x0071('0x3d')],function(_0x5c04eb){var _0x43809f={};_0x43809f[_0x5c04eb]={'$like':'%'+_0x2c8a3d[_0x0071('0x3a')][_0x0071('0x7c')]+'%'};return _0x43809f;})});}if(_0x2c8a3d[_0x0071('0x3a')][_0x0071('0x73')]){var _0x588a10=_0x2c8a3d['query'][_0x0071('0x73')]['split'](',');var _0x47cc4d={};_0x47cc4d[_0x588a10[0x0]]={'$gte':moment(_0x588a10[0x1])[_0x0071('0xba')](_0x0071('0xbb'))};_0x285b2a[_0x0071('0x42')]=_[_0x0071('0x93')](_0x285b2a[_0x0071('0x42')],_0x47cc4d);}_0x285b2a=_[_0x0071('0x93')]({},_0x285b2a,_0x2c8a3d['options']);return db[_0x0071('0xb4')][_0x0071('0x22')]({'where':_0x285b2a[_0x0071('0x42')]})[_0x0071('0x28')](function(_0x559057){_0x4259de['count']=_0x559057;if(_0x2c8a3d[_0x0071('0x3a')]['includeAll']){_0x285b2a[_0x0071('0xae')]=[{'all':!![]}];}return db['FaxMessage'][_0x0071('0xbc')](_0x285b2a);})[_0x0071('0x28')](function(_0x5d88db){_0x4259de[_0x0071('0xa9')]=_0x5d88db;return _0x4259de;});}})[_0x0071('0x28')](respondWithFilteredResult(_0x2ca51e,_0x285b2a))[_0x0071('0x35')](handleError(_0x2ca51e,null));};exports[_0x0071('0xbd')]=function(_0x5a7191,_0x23c044,_0x5be327){return db[_0x0071('0x36')]['find']({'where':{'id':_0x5a7191[_0x0071('0xab')]['id']}})['then'](handleEntityNotFound(_0x23c044,null))['then'](function(_0x289d40){if(_0x289d40){return _0x289d40['setTags'](_0x5a7191[_0x0071('0x6c')][_0x0071('0xb5')],_[_0x0071('0xb6')](_0x5a7191[_0x0071('0x6c')],[_0x0071('0xb5'),'id'])||{})['spread'](function(){return db[_0x0071('0xbe')][_0x0071('0xbc')]({'attributes':['id',_0x0071('0x2c'),_0x0071('0x45')],'where':{'id':_0x5a7191[_0x0071('0x6c')][_0x0071('0xb5')]}});})[_0x0071('0x28')](function(_0x5e234c){socket[_0x0071('0xbf')]('faxInteractionTags:save',{'id':Number(_0x5a7191[_0x0071('0xab')]['id']),'tags':_0x5e234c||[]});return{'id':Number(_0x5a7191[_0x0071('0xab')]['id']),'tags':_0x5e234c||[]};});}})[_0x0071('0x28')](respondWithResult(_0x23c044,null))[_0x0071('0x35')](handleError(_0x23c044,null));};exports['removeTags']=function(_0x1fbeff,_0x153c60,_0x5075dc){return db['FaxInteraction'][_0x0071('0x5b')]({'where':{'id':_0x1fbeff[_0x0071('0xab')]['id']}})[_0x0071('0x28')](handleEntityNotFound(_0x153c60,null))[_0x0071('0x28')](function(_0xf3335f){if(_0xf3335f){return _0xf3335f[_0x0071('0xc0')](_0x1fbeff[_0x0071('0x3a')][_0x0071('0xb5')]);}})[_0x0071('0x28')](respondWithStatusCode(_0x153c60,null))[_0x0071('0x35')](handleError(_0x153c60,null));};exports['download']=function(_0x33e6cd,_0x333988){var _0x4405be=moment()[_0x0071('0xc1')]()[_0x0071('0x92')]();var _0x4067fc=path[_0x0071('0xc2')](config[_0x0071('0xc3')],_0x0071('0xc4'),_0x0071('0xc5'),'tmp');var _0x421b6b=path['join'](config[_0x0071('0xc3')],_0x0071('0xc4'),_0x0071('0xc5'),_0x0071('0xc6'));var _0x11f7a9=path[_0x0071('0xc2')](_0x4067fc,_0x4405be);var _0x41da0f=util[_0x0071('0xba')](_0x0071('0xc7'),_0x33e6cd['params']['id'],_0x4405be);var _0x28d630=path[_0x0071('0xc2')](_0x4067fc,_0x41da0f);var _0x12bb9a=[];_0x12bb9a[_0x0071('0x34')]({'model':db[_0x0071('0xc8')],'as':_0x0071('0xc8'),'raw':!![]});var _0x4d489c=[{'model':db[_0x0071('0xb4')],'as':_0x0071('0xc9'),'attributes':['id',_0x0071('0x6c'),_0x0071('0x71')],'include':_0x12bb9a}];return db['FaxInteraction']['find']({'where':{'id':_0x33e6cd['params']['id']},'include':_0x4d489c})[_0x0071('0x28')](handleEntityNotFound(_0x333988,null))[_0x0071('0x28')](function(_0x5b732f){if(_0x5b732f&&_0x5b732f[_0x0071('0xc9')]){var _0x481b24=_0x5b732f[_0x0071('0xca')]({'plain':!![]});fs[_0x0071('0xcb')](_0x11f7a9);for(var _0x2c3d7b=0x0;_0x2c3d7b<_0x481b24[_0x0071('0xc9')]['length'];_0x2c3d7b++){var _0xa847ee=_0x481b24['Messages'][_0x2c3d7b]['Attachment'];if(_0xa847ee){var _0x257eaa=path[_0x0071('0xc2')](_0x421b6b,_0xa847ee['basename']);if(fs[_0x0071('0xcc')](_0x257eaa)){fs['createReadStream'](_0x257eaa)[_0x0071('0xcd')](fs['createWriteStream'](path[_0x0071('0xc2')](_0x11f7a9,_0xa847ee[_0x0071('0xce')])));}}}return BPromise['resolve']()[_0x0071('0x28')](function(){return new BPromise(function(_0x54934f,_0x1c6995){zipdir(_0x11f7a9,{'saveTo':_0x28d630},function(_0x4f849d,_0x558c9f){if(_0x4f849d)return _0x1c6995(_0x4f849d);return _0x54934f(_0x558c9f);});})[_0x0071('0x28')](function(){return new BPromise(function(_0x2fee28,_0x535775){rimraf(_0x11f7a9,function(_0x5e59e8){if(_0x5e59e8)_0x535775(_0x5e59e8);return _0x2fee28();});});})[_0x0071('0x28')](function(){return _0x333988['download'](_0x28d630,_0x41da0f,function(_0x26493b){if(_0x26493b){console[_0x0071('0xcf')](_0x0071('0xd0'),_0x26493b);}else{fs[_0x0071('0xd1')](_0x28d630);}});});});}else{return _0x333988[_0x0071('0x1e')](0xc8);}})[_0x0071('0x35')](handleError(_0x333988,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 12cb5cf..2275a19 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 _0x1304=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update','remove','getUsers'];(function(_0x1f8a2a,_0x906b0f){var _0x4dcaa7=function(_0x55098d){while(--_0x55098d){_0x1f8a2a['push'](_0x1f8a2a['shift']());}};_0x4dcaa7(++_0x906b0f);}(_0x1304,0x1ba));var _0x4130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1304[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4130('0x0'));var FaxInteraction=require(_0x4130('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x4130('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4130('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4130('0x3'),'afterDestroy':_0x4130('0x4')};function emitEvent(_0x2a94ff){return function(_0x3cd66c,_0xd2a525,_0x4cf878){_0x3cd66c[_0x4130('0x5')]({'attributes':['id'],'raw':!![]})[_0x4130('0x6')](function(_0x59a5bb){_0x3cd66c[_0x4130('0x7')](_0x4130('0x8'),_0x59a5bb[_0x4130('0x9')](function(_0xdf9d05){return{'id':_0xdf9d05['id']};}));return FaxMessage[_0x4130('0xa')]({'where':{'FaxInteractionId':_0x3cd66c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4130('0x6')](function(_0x39278b){_0x3cd66c[_0x4130('0x7')](_0x4130('0xb'),_0x39278b[_0x4130('0xc')]);FaxInteractionEvents[_0x4130('0xd')](_0x2a94ff+':'+_0x3cd66c['id'],_0x3cd66c);FaxInteractionEvents['emit'](_0x2a94ff,_0x3cd66c);_0x4cf878(null);})['catch'](_0x4cf878(null));};}for(var e in events){if(events[_0x4130('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x4130('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x20cf=['findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users'];(function(_0x5431ef,_0x41def0){var _0x204901=function(_0x34bf04){while(--_0x34bf04){_0x5431ef['push'](_0x5431ef['shift']());}};_0x204901(++_0x41def0);}(_0x20cf,0x115));var _0xf20c=function(_0x3c7e51,_0x38d61d){_0x3c7e51=_0x3c7e51-0x0;var _0xd681e0=_0x20cf[_0x3c7e51];return _0xd681e0;};'use strict';var EventEmitter=require(_0xf20c('0x0'));var FaxInteraction=require(_0xf20c('0x1'))['db'][_0xf20c('0x2')];var FaxMessage=require(_0xf20c('0x1'))['db'][_0xf20c('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf20c('0x4')](0x0);var events={'afterCreate':_0xf20c('0x5'),'afterUpdate':'update','afterDestroy':_0xf20c('0x6')};function emitEvent(_0x21a952){return function(_0x367568,_0x371ccc,_0x393147){_0x367568[_0xf20c('0x7')]({'attributes':['id'],'raw':!![]})[_0xf20c('0x8')](function(_0xe9a560){_0x367568[_0xf20c('0x9')](_0xf20c('0xa'),_0xe9a560['map'](function(_0x2a5ad4){return{'id':_0x2a5ad4['id']};}));return FaxMessage[_0xf20c('0xb')]({'where':{'FaxInteractionId':_0x367568['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf20c('0x8')](function(_0x1f8f78){_0x367568[_0xf20c('0x9')](_0xf20c('0xc'),_0x1f8f78['length']);FaxInteractionEvents[_0xf20c('0xd')](_0x21a952+':'+_0x367568['id'],_0x367568);FaxInteractionEvents['emit'](_0x21a952,_0x367568);_0x393147(null);})[_0xf20c('0xe')](_0x393147(null));};}for(var e in events){if(events[_0xf20c('0xf')](e)){var event=events[e];FaxInteraction[_0xf20c('0x10')](e,emitEvent(event));}}module[_0xf20c('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 3a0701f..e3bf1de 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 _0x9e29=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','path','rimraf','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','closed'];(function(_0x2b9ae3,_0xd6d709){var _0x4e18a2=function(_0x397406){while(--_0x397406){_0x2b9ae3['push'](_0x2b9ae3['shift']());}};_0x4e18a2(++_0xd6d709);}(_0x9e29,0xd5));var _0x99e2=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x9e29[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x99e2('0x0'));var util=require('util');var logger=require(_0x99e2('0x1'))(_0x99e2('0x2'));var moment=require('moment');var BPromise=require(_0x99e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99e2('0x4'));var rimraf=require(_0x99e2('0x5'));var config=require('../../config/environment');var attributes=require(_0x99e2('0x6'));module['exports']=function(_0x2b2b45,_0x54e29d){return _0x2b2b45[_0x99e2('0x7')](_0x99e2('0x8'),attributes,{'tableName':_0x99e2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x359c24,_0x13d103,_0x382e60){if(_0x359c24['changed'](_0x99e2('0xa'))){_0x359c24[_0x99e2('0xb')]=moment()[_0x99e2('0xc')](_0x99e2('0xd'));}_0x382e60(null,_0x359c24);}}});}; \ No newline at end of file +var _0x7b77=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x1a6572,_0x4b6b55){var _0x1c33a5=function(_0x9818f5){while(--_0x9818f5){_0x1a6572['push'](_0x1a6572['shift']());}};_0x1c33a5(++_0x4b6b55);}(_0x7b77,0x179));var _0x77b7=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x7b77[_0x45d1fd];return _0xd0e542;};'use strict';var _=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var logger=require(_0x77b7('0x2'))(_0x77b7('0x3'));var moment=require('moment');var BPromise=require(_0x77b7('0x4'));var rp=require(_0x77b7('0x5'));var fs=require('fs');var path=require(_0x77b7('0x6'));var rimraf=require('rimraf');var config=require(_0x77b7('0x7'));var attributes=require(_0x77b7('0x8'));module[_0x77b7('0x9')]=function(_0x3d97f0,_0x4556c1){return _0x3d97f0[_0x77b7('0xa')]('FaxInteraction',attributes,{'tableName':_0x77b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32b8ab,_0x33d439,_0x4abf3a){if(_0x32b8ab[_0x77b7('0xc')]('closed')){_0x32b8ab['closedAt']=moment()['format'](_0x77b7('0xd'));}_0x4abf3a(null,_0x32b8ab);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 1fbffe5..032619d 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 _0xdb6c=['options','raw','where','attributes','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body'];(function(_0x5da841,_0x9f830c){var _0xba8f82=function(_0x1913ce){while(--_0x1913ce){_0x5da841['push'](_0x5da841['shift']());}};_0xba8f82(++_0x9f830c);}(_0xdb6c,0xe1));var _0xcdb6=function(_0x8703db,_0x3dd1bf){_0x8703db=_0x8703db-0x0;var _0x1d411f=_0xdb6c[_0x8703db];return _0x1d411f;};'use strict';var _=require(_0xcdb6('0x0'));var util=require(_0xcdb6('0x1'));var moment=require(_0xcdb6('0x2'));var BPromise=require(_0xcdb6('0x3'));var rs=require(_0xcdb6('0x4'));var fs=require('fs');var Redis=require(_0xcdb6('0x5'));var db=require(_0xcdb6('0x6'))['db'];var utils=require(_0xcdb6('0x7'));var logger=require(_0xcdb6('0x8'))('rpc');var config=require(_0xcdb6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcdb6('0xa')]['http']({'port':0x232a});config[_0xcdb6('0xb')]=_[_0xcdb6('0xc')](config[_0xcdb6('0xb')],{'host':_0xcdb6('0xd'),'port':0x18eb});var socket=require(_0xcdb6('0xe'))(new Redis(config[_0xcdb6('0xb')]));require('./faxInteraction.socket')[_0xcdb6('0xf')](socket);function respondWithRpcPromise(_0x41f80d,_0x1db1a,_0x103a84){return new BPromise(function(_0x371ec0,_0x1c2164){return client[_0xcdb6('0x10')](_0x41f80d,_0x103a84)[_0xcdb6('0x11')](function(_0x16750b){logger[_0xcdb6('0x12')](_0xcdb6('0x13'),_0x1db1a,'request\x20sent');logger[_0xcdb6('0x14')](_0xcdb6('0x15'),_0x1db1a,_0xcdb6('0x16'),JSON[_0xcdb6('0x17')](_0x16750b));if(_0x16750b[_0xcdb6('0x18')]){if(_0x16750b[_0xcdb6('0x18')][_0xcdb6('0x19')]===0x1f4){logger[_0xcdb6('0x18')](_0xcdb6('0x13'),_0x1db1a,_0x16750b[_0xcdb6('0x18')][_0xcdb6('0x1a')]);return _0x1c2164(_0x16750b['error'][_0xcdb6('0x1a')]);}logger[_0xcdb6('0x18')](_0xcdb6('0x13'),_0x1db1a,_0x16750b[_0xcdb6('0x18')]['message']);return _0x371ec0(_0x16750b[_0xcdb6('0x18')][_0xcdb6('0x1a')]);}else{logger[_0xcdb6('0x12')](_0xcdb6('0x13'),_0x1db1a,'request\x20sent');_0x371ec0(_0x16750b[_0xcdb6('0x1b')][_0xcdb6('0x1a')]);}})[_0xcdb6('0x1c')](function(_0x24f3b4){logger['error'](_0xcdb6('0x13'),_0x1db1a,_0x24f3b4);_0x1c2164(_0x24f3b4);});});}exports[_0xcdb6('0x1d')]=function(_0x1626cd){var _0x58b473=this;return new Promise(function(_0x76290e,_0x5ebcef){return db[_0xcdb6('0x1e')][_0xcdb6('0x1f')](_0x1626cd[_0xcdb6('0x20')],{'raw':_0x1626cd[_0xcdb6('0x21')]?_0x1626cd[_0xcdb6('0x21')][_0xcdb6('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1626cd['options']?_0x1626cd[_0xcdb6('0x21')][_0xcdb6('0x23')]||null:null,'attributes':_0x1626cd[_0xcdb6('0x21')]?_0x1626cd[_0xcdb6('0x21')][_0xcdb6('0x24')]||null:null,'limit':_0x1626cd[_0xcdb6('0x21')]?_0x1626cd[_0xcdb6('0x21')]['limit']||null:null})[_0xcdb6('0x11')](function(_0x4d5d4c){logger[_0xcdb6('0x12')](_0xcdb6('0x1d'),_0x1626cd);logger[_0xcdb6('0x14')]('UpdateFaxInteraction',_0x1626cd,JSON[_0xcdb6('0x17')](_0x4d5d4c));_0x76290e(_0x4d5d4c);})['catch'](function(_0x546869){logger[_0xcdb6('0x18')]('UpdateFaxInteraction',_0x546869['message'],_0x1626cd);_0x5ebcef(_0x58b473[_0xcdb6('0x18')](0x1f4,_0x546869[_0xcdb6('0x1a')]));});});};exports[_0xcdb6('0x25')]=function(_0x592aa4){return new Promise(function(_0x522f1d,_0x264d18){return db['FaxInteraction'][_0xcdb6('0x26')]({'where':_0x592aa4[_0xcdb6('0x21')]?_0x592aa4[_0xcdb6('0x21')][_0xcdb6('0x23')]||null:null})[_0xcdb6('0x11')](function(_0x220fd5){if(_0x220fd5){return _0x220fd5[_0xcdb6('0x27')](_0x592aa4['body'][_0xcdb6('0x28')],_[_0xcdb6('0x29')](_0x592aa4[_0xcdb6('0x20')],[_0xcdb6('0x28'),'id'])||{});}})['spread'](function(_0x50998a){logger[_0xcdb6('0x12')]('AddTags',_0x592aa4);logger[_0xcdb6('0x14')](_0xcdb6('0x2a'),_0x592aa4,JSON['stringify'](_0x50998a));_0x522f1d(_0x50998a);})['catch'](function(_0x4b76c2){logger['error'](_0xcdb6('0x2a'),_0x4b76c2[_0xcdb6('0x1a')],_0x592aa4);_0x264d18(_this['error'](0x1f4,_0x4b76c2[_0xcdb6('0x1a')]));});});}; \ No newline at end of file +var _0xcf92=['attributes','limit','AddTagsToFaxInteraction','find','where','addTags','ids','omit','body','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','then','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xcf92,0x86));var _0x2cf9=function(_0x185f3f,_0x2923ef){_0x185f3f=_0x185f3f-0x0;var _0x465cf8=_0xcf92[_0x185f3f];return _0x465cf8;};'use strict';var _=require(_0x2cf9('0x0'));var util=require(_0x2cf9('0x1'));var moment=require('moment');var BPromise=require(_0x2cf9('0x2'));var rs=require(_0x2cf9('0x3'));var fs=require('fs');var Redis=require(_0x2cf9('0x4'));var db=require(_0x2cf9('0x5'))['db'];var utils=require(_0x2cf9('0x6'));var logger=require(_0x2cf9('0x7'))(_0x2cf9('0x8'));var config=require(_0x2cf9('0x9'));var jayson=require(_0x2cf9('0xa'));var client=jayson[_0x2cf9('0xb')][_0x2cf9('0xc')]({'port':0x232a});config[_0x2cf9('0xd')]=_[_0x2cf9('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2cf9('0xd')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x437320,_0x5d7201,_0x2bdc3b){return new BPromise(function(_0x37bd14,_0x34d740){return client['request'](_0x437320,_0x2bdc3b)[_0x2cf9('0xf')](function(_0x17f1c4){logger[_0x2cf9('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x5d7201,'request\x20sent');logger[_0x2cf9('0x11')](_0x2cf9('0x12'),_0x5d7201,_0x2cf9('0x13'),JSON[_0x2cf9('0x14')](_0x17f1c4));if(_0x17f1c4[_0x2cf9('0x15')]){if(_0x17f1c4[_0x2cf9('0x15')]['code']===0x1f4){logger[_0x2cf9('0x15')](_0x2cf9('0x16'),_0x5d7201,_0x17f1c4[_0x2cf9('0x15')][_0x2cf9('0x17')]);return _0x34d740(_0x17f1c4[_0x2cf9('0x15')][_0x2cf9('0x17')]);}logger[_0x2cf9('0x15')](_0x2cf9('0x16'),_0x5d7201,_0x17f1c4[_0x2cf9('0x15')][_0x2cf9('0x17')]);return _0x37bd14(_0x17f1c4[_0x2cf9('0x15')][_0x2cf9('0x17')]);}else{logger['info'](_0x2cf9('0x16'),_0x5d7201,_0x2cf9('0x13'));_0x37bd14(_0x17f1c4[_0x2cf9('0x18')]['message']);}})[_0x2cf9('0x19')](function(_0x37ec08){logger[_0x2cf9('0x15')](_0x2cf9('0x16'),_0x5d7201,_0x37ec08);_0x34d740(_0x37ec08);});});}exports[_0x2cf9('0x1a')]=function(_0x20031a){var _0x4ac052=this;return new Promise(function(_0x31e56a,_0x241526){return db[_0x2cf9('0x1b')][_0x2cf9('0x1c')](_0x20031a['body'],{'raw':_0x20031a[_0x2cf9('0x1d')]?_0x20031a[_0x2cf9('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20031a[_0x2cf9('0x1d')]?_0x20031a[_0x2cf9('0x1d')]['where']||null:null,'attributes':_0x20031a['options']?_0x20031a[_0x2cf9('0x1d')][_0x2cf9('0x1e')]||null:null,'limit':_0x20031a['options']?_0x20031a[_0x2cf9('0x1d')][_0x2cf9('0x1f')]||null:null})['then'](function(_0x4ccfd8){logger[_0x2cf9('0x10')](_0x2cf9('0x1a'),_0x20031a);logger[_0x2cf9('0x11')](_0x2cf9('0x1a'),_0x20031a,JSON[_0x2cf9('0x14')](_0x4ccfd8));_0x31e56a(_0x4ccfd8);})['catch'](function(_0x59636e){logger[_0x2cf9('0x15')](_0x2cf9('0x1a'),_0x59636e[_0x2cf9('0x17')],_0x20031a);_0x241526(_0x4ac052['error'](0x1f4,_0x59636e[_0x2cf9('0x17')]));});});};exports[_0x2cf9('0x20')]=function(_0x4cf86d){return new Promise(function(_0x3dc178,_0x355d77){return db['FaxInteraction'][_0x2cf9('0x21')]({'where':_0x4cf86d[_0x2cf9('0x1d')]?_0x4cf86d[_0x2cf9('0x1d')][_0x2cf9('0x22')]||null:null})['then'](function(_0x554853){if(_0x554853){return _0x554853[_0x2cf9('0x23')](_0x4cf86d['body'][_0x2cf9('0x24')],_[_0x2cf9('0x25')](_0x4cf86d[_0x2cf9('0x26')],[_0x2cf9('0x24'),'id'])||{});}})[_0x2cf9('0x27')](function(_0x28e657){logger[_0x2cf9('0x10')](_0x2cf9('0x28'),_0x4cf86d);logger[_0x2cf9('0x11')](_0x2cf9('0x28'),_0x4cf86d,JSON['stringify'](_0x28e657));_0x3dc178(_0x28e657);})[_0x2cf9('0x19')](function(_0x9ef0ad){logger[_0x2cf9('0x15')]('AddTags',_0x9ef0ad['message'],_0x4cf86d);_0x355d77(_this['error'](0x1f4,_0x9ef0ad[_0x2cf9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 50db8cd..6c30704 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 _0xbb02=['emit','removeListener','register','length','./faxInteraction.events','save','remove'];(function(_0x247f75,_0x14445e){var _0x485c3f=function(_0x6e1cf0){while(--_0x6e1cf0){_0x247f75['push'](_0x247f75['shift']());}};_0x485c3f(++_0x14445e);}(_0xbb02,0x123));var _0x2bb0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbb02[_0x4b369d];return _0x571a98;};'use strict';var FaxInteractionEvents=require(_0x2bb0('0x0'));var events=[_0x2bb0('0x1'),_0x2bb0('0x2'),'update'];function createListener(_0x3675c8,_0x1aa6b4){return function(_0x565dcc){_0x1aa6b4[_0x2bb0('0x3')](_0x3675c8,_0x565dcc);};}function removeListener(_0x14395b,_0x40e97e){return function(){FaxInteractionEvents[_0x2bb0('0x4')](_0x14395b,_0x40e97e);};}exports[_0x2bb0('0x5')]=function(_0x70c907){for(var _0xcb48b7=0x0,_0x49ff68=events[_0x2bb0('0x6')];_0xcb48b7<_0x49ff68;_0xcb48b7++){var _0x22cc32=events[_0xcb48b7];var _0x4bab7d=createListener('faxInteraction:'+_0x22cc32,_0x70c907);FaxInteractionEvents['on'](_0x22cc32,_0x4bab7d);}}; \ No newline at end of file +var _0x3777=['remove','update','removeListener','register','./faxInteraction.events','save'];(function(_0x49221b,_0x206f1f){var _0x359429=function(_0x3a8c96){while(--_0x3a8c96){_0x49221b['push'](_0x49221b['shift']());}};_0x359429(++_0x206f1f);}(_0x3777,0x124));var _0x7377=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x3777[_0x173d7e];return _0x2220d6;};'use strict';var FaxInteractionEvents=require(_0x7377('0x0'));var events=[_0x7377('0x1'),_0x7377('0x2'),_0x7377('0x3')];function createListener(_0x41ba50,_0x3a5458){return function(_0x3a5ac5){_0x3a5458['emit'](_0x41ba50,_0x3a5ac5);};}function removeListener(_0x1f125c,_0x4b2a9d){return function(){FaxInteractionEvents[_0x7377('0x4')](_0x1f125c,_0x4b2a9d);};}exports[_0x7377('0x5')]=function(_0x2ce462){for(var _0x5777d6=0x0,_0x23ad84=events['length'];_0x5777d6<_0x23ad84;_0x5777d6++){var _0x2f4448=events[_0x5777d6];var _0x2cf5c1=createListener('faxInteraction:'+_0x2f4448,_0x2ce462);FaxInteractionEvents['on'](_0x2f4448,_0x2cf5c1);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 43b79cf..24ce6b9 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 _0xba25=['put','fax','faxinteraction:update','update','destroy','delete','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags'];(function(_0x5248ad,_0x513775){var _0x842bd8=function(_0x11a938){while(--_0x11a938){_0x5248ad['push'](_0x5248ad['shift']());}};_0x842bd8(++_0x513775);}(_0xba25,0x194));var _0x5ba2=function(_0x1324eb,_0x5129d8){_0x1324eb=_0x1324eb-0x0;var _0x521d88=_0xba25[_0x1324eb];return _0x521d88;};'use strict';var multer=require('multer');var util=require(_0x5ba2('0x0'));var path=require(_0x5ba2('0x1'));var timeout=require(_0x5ba2('0x2'));var express=require(_0x5ba2('0x3'));var router=express[_0x5ba2('0x4')]();var fs_extra=require(_0x5ba2('0x5'));var auth=require(_0x5ba2('0x6'));var interaction=require(_0x5ba2('0x7'));var config=require(_0x5ba2('0x8'));var controller=require('./faxInteraction.controller');router[_0x5ba2('0x9')]('/',auth['isAuthenticated'](),controller[_0x5ba2('0xa')]);router[_0x5ba2('0x9')]('/describe',auth[_0x5ba2('0xb')](),controller[_0x5ba2('0xc')]);router[_0x5ba2('0x9')](_0x5ba2('0xd'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x5ba2('0xf')]);router['get'](_0x5ba2('0x10'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0x11')]);router[_0x5ba2('0x12')]('/',auth[_0x5ba2('0xb')](),controller[_0x5ba2('0x13')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x5ba2('0x14')]);router[_0x5ba2('0x12')](_0x5ba2('0x15'),auth[_0x5ba2('0xb')](),interaction[_0x5ba2('0x16')]('fax',_0x5ba2('0x17')),controller[_0x5ba2('0x18')]);router[_0x5ba2('0x19')](_0x5ba2('0xd'),auth[_0x5ba2('0xb')](),interaction[_0x5ba2('0x16')](_0x5ba2('0x1a'),_0x5ba2('0x1b')),controller[_0x5ba2('0x1c')]);router['delete'](_0x5ba2('0xd'),auth[_0x5ba2('0xb')](),interaction[_0x5ba2('0x16')](_0x5ba2('0x1a'),'faxinteraction:destroy'),controller[_0x5ba2('0x1d')]);router[_0x5ba2('0x1e')](_0x5ba2('0x15'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0x1f')]);module[_0x5ba2('0x20')]=router; \ No newline at end of file +var _0x32a6=['/:id/download','download','post','create','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','faxinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages'];(function(_0x31db51,_0x4557c3){var _0x5233f0=function(_0x36e381){while(--_0x36e381){_0x31db51['push'](_0x31db51['shift']());}};_0x5233f0(++_0x4557c3);}(_0x32a6,0x108));var _0x632a=function(_0x3df519,_0xed17c6){_0x3df519=_0x3df519-0x0;var _0xd01f66=_0x32a6[_0x3df519];return _0xd01f66;};'use strict';var multer=require(_0x632a('0x0'));var util=require('util');var path=require(_0x632a('0x1'));var timeout=require(_0x632a('0x2'));var express=require('express');var router=express[_0x632a('0x3')]();var fs_extra=require(_0x632a('0x4'));var auth=require(_0x632a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x632a('0x6'));var controller=require(_0x632a('0x7'));router[_0x632a('0x8')]('/',auth[_0x632a('0x9')](),controller[_0x632a('0xa')]);router[_0x632a('0x8')](_0x632a('0xb'),auth['isAuthenticated'](),controller[_0x632a('0xc')]);router[_0x632a('0x8')](_0x632a('0xd'),auth[_0x632a('0x9')](),controller['show']);router[_0x632a('0x8')](_0x632a('0xe'),auth[_0x632a('0x9')](),controller['getMessages']);router[_0x632a('0x8')](_0x632a('0xf'),auth[_0x632a('0x9')](),controller[_0x632a('0x10')]);router[_0x632a('0x11')]('/',auth[_0x632a('0x9')](),controller[_0x632a('0x12')]);router['post']('/:id/messages',auth[_0x632a('0x9')](),controller['addMessage']);router[_0x632a('0x11')]('/:id/tags',auth[_0x632a('0x9')](),interaction[_0x632a('0x13')]('fax',_0x632a('0x14')),controller[_0x632a('0x15')]);router[_0x632a('0x16')](_0x632a('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x632a('0x17'),_0x632a('0x18')),controller['update']);router['delete'](_0x632a('0xd'),auth[_0x632a('0x9')](),interaction[_0x632a('0x13')](_0x632a('0x17'),_0x632a('0x19')),controller[_0x632a('0x1a')]);router[_0x632a('0x1b')](_0x632a('0x1c'),auth['isAuthenticated'](),controller[_0x632a('0x1d')]);module[_0x632a('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 20957c7..728d076 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 _0xdad2=['out','DATE','exports','TEXT','BOOLEAN','ENUM'];(function(_0x122e16,_0x2aee15){var _0x505165=function(_0x4071f7){while(--_0x4071f7){_0x122e16['push'](_0x122e16['shift']());}};_0x505165(++_0x2aee15);}(_0xdad2,0x14c));var _0x2dad=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xdad2[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require('sequelize');module[_0x2dad('0x0')]={'body':{'type':Sequelize[_0x2dad('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2dad('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2dad('0x3')]('in',_0x2dad('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x2dad('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2dad('0x5')]}}; \ No newline at end of file +var _0xb647=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x261a1a,_0x269ddd){var _0x3ce41f=function(_0x4eae33){while(--_0x4eae33){_0x261a1a['push'](_0x261a1a['shift']());}};_0x3ce41f(++_0x269ddd);}(_0xb647,0xdb));var _0x7b64=function(_0x4945a0,_0x44ee37){_0x4945a0=_0x4945a0-0x0;var _0xbb98a6=_0xb647[_0x4945a0];return _0xbb98a6;};'use strict';var Sequelize=require(_0x7b64('0x0'));module[_0x7b64('0x1')]={'body':{'type':Sequelize[_0x7b64('0x2')](_0x7b64('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7b64('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7b64('0x5')]('in',_0x7b64('0x6')),'defaultValue':_0x7b64('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x7b64('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index a988505..0972482 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 _0xdab1=['describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','FaxInteraction','FaxInteractionId','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','json','undefined','limit','count','status','set','Content-Range','apply','reject','update','destroy','end','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','body','find'];(function(_0x4005fe,_0x1fc3c1){var _0x50022d=function(_0x2ce718){while(--_0x2ce718){_0x4005fe['push'](_0x4005fe['shift']());}};_0x50022d(++_0x1fc3c1);}(_0xdab1,0x1e9));var _0x1dab=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xdab1[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1dab('0x0'));var zipdir=require(_0x1dab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1dab('0x2'));var moment=require(_0x1dab('0x3'));var BPromise=require(_0x1dab('0x4'));var Mustache=require(_0x1dab('0x5'));var util=require(_0x1dab('0x6'));var path=require(_0x1dab('0x7'));var sox=require(_0x1dab('0x8'));var csv=require(_0x1dab('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1dab('0xa'));var _=require(_0x1dab('0xb'));var squel=require('squel');var crypto=require(_0x1dab('0xc'));var jsforce=require(_0x1dab('0xd'));var deskjs=require(_0x1dab('0xe'));var toCsv=require(_0x1dab('0x9'));var querystring=require('querystring');var Papa=require(_0x1dab('0xf'));var Redis=require('ioredis');var authService=require(_0x1dab('0x10'));var qs=require(_0x1dab('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1dab('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1dab('0x13'));var licenseUtil=require(_0x1dab('0x14'));var db=require(_0x1dab('0x15'))['db'];config['redis']=_[_0x1dab('0x16')](config[_0x1dab('0x17')],{'host':_0x1dab('0x18'),'port':0x18eb});var socket=require(_0x1dab('0x19'))(new Redis(config[_0x1dab('0x17')]));require('./faxMessage.socket')[_0x1dab('0x1a')](socket);var jayson=require(_0x1dab('0x1b'));var client=jayson[_0x1dab('0x1c')][_0x1dab('0x1d')]({'port':0x232c});var client9002=jayson[_0x1dab('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53a442,_0x3b5073,_0x3dd601,_0x26f9d5){return new BPromise(function(_0x1e0726,_0x496ca9){var _0x8a9dd1=_0x26f9d5||client;return _0x8a9dd1['request'](_0x53a442,_0x3dd601)[_0x1dab('0x1e')](function(_0x5b97d0){logger[_0x1dab('0x1f')](_0x1dab('0x20'),_0x3b5073,_0x1dab('0x21'));logger[_0x1dab('0x22')](_0x1dab('0x23'),_0x3b5073,_0x1dab('0x21'),JSON['stringify'](_0x5b97d0));if(_0x5b97d0[_0x1dab('0x24')]){if(_0x5b97d0[_0x1dab('0x24')][_0x1dab('0x25')]===0x1f4){logger['error'](_0x1dab('0x20'),_0x3b5073,_0x5b97d0[_0x1dab('0x24')][_0x1dab('0x26')]);return _0x496ca9(_0x5b97d0[_0x1dab('0x24')]['message']);}logger[_0x1dab('0x24')](_0x1dab('0x20'),_0x3b5073,_0x5b97d0[_0x1dab('0x24')][_0x1dab('0x26')]);return _0x1e0726(_0x5b97d0[_0x1dab('0x24')][_0x1dab('0x26')]);}else{logger['info'](_0x1dab('0x20'),_0x3b5073,_0x1dab('0x21'));_0x1e0726(_0x5b97d0['result'][_0x1dab('0x26')]);}})[_0x1dab('0x27')](function(_0xff0035){logger[_0x1dab('0x24')](_0x1dab('0x20'),_0x3b5073,_0xff0035);_0x496ca9(_0xff0035);});});}function respondWithStatusCode(_0x431cd5,_0x334d5f){_0x334d5f=_0x334d5f||0xcc;return function(_0x2fd9be){if(_0x2fd9be){return _0x431cd5['sendStatus'](_0x334d5f);}return _0x431cd5['status'](_0x334d5f)['end']();};}function respondWithResult(_0x2077cc,_0xea714c){_0xea714c=_0xea714c||0xc8;return function(_0x5763b2){if(_0x5763b2){return _0x2077cc['status'](_0xea714c)[_0x1dab('0x28')](_0x5763b2);}};}function respondWithFilteredResult(_0x1557db,_0x146a80){return function(_0xb7c0cd){if(_0xb7c0cd){var _0x406a7d=typeof _0x146a80['offset']===_0x1dab('0x29')&&typeof _0x146a80[_0x1dab('0x2a')]===_0x1dab('0x29');var _0x49eed8=_0xb7c0cd[_0x1dab('0x2b')];var _0x4fc733=_0x406a7d?0x0:_0x146a80['offset'];var _0x9a279b=_0x406a7d?_0xb7c0cd[_0x1dab('0x2b')]:_0x146a80['offset']+_0x146a80[_0x1dab('0x2a')];var _0x241b57;if(_0x9a279b>=_0x49eed8){_0x9a279b=_0x49eed8;_0x241b57=0xc8;}else{_0x241b57=0xce;}_0x1557db[_0x1dab('0x2c')](_0x241b57);return _0x1557db[_0x1dab('0x2d')](_0x1dab('0x2e'),_0x4fc733+'-'+_0x9a279b+'/'+_0x49eed8)['json'](_0xb7c0cd);}return null;};}function patchUpdates(_0x11d3e8){return function(_0x1f7dfe){try{jsonpatch[_0x1dab('0x2f')](_0x1f7dfe,_0x11d3e8,!![]);}catch(_0x390368){return BPromise[_0x1dab('0x30')](_0x390368);}return _0x1f7dfe['save']();};}function saveUpdates(_0x25544c,_0x3f4157){return function(_0x4c51c2){if(_0x4c51c2){return _0x4c51c2[_0x1dab('0x31')](_0x25544c)[_0x1dab('0x1e')](function(_0x2a141c){return _0x2a141c;});}return null;};}function removeEntity(_0x1a5507,_0x3d59dd){return function(_0xfa1e9e){if(_0xfa1e9e){return _0xfa1e9e[_0x1dab('0x32')]()[_0x1dab('0x1e')](function(){_0x1a5507[_0x1dab('0x2c')](0xcc)[_0x1dab('0x33')]();});}};}function handleEntityNotFound(_0x13f7de,_0x733cc3){return function(_0x4ad7f0){if(!_0x4ad7f0){_0x13f7de['sendStatus'](0x194);}return _0x4ad7f0;};}function handleError(_0x3bdbe1,_0x309f0d){_0x309f0d=_0x309f0d||0x1f4;return function(_0x5863ec){logger[_0x1dab('0x24')](_0x5863ec[_0x1dab('0x34')]);if(_0x5863ec[_0x1dab('0x35')]){delete _0x5863ec[_0x1dab('0x35')];}_0x3bdbe1[_0x1dab('0x2c')](_0x309f0d)['send'](_0x5863ec);};}exports[_0x1dab('0x36')]=function(_0x461750,_0x5d9f36){var _0x53d7d5={},_0x12ab12={},_0x7e4b81={'count':0x0,'rows':[]};var _0x5a956c=_[_0x1dab('0x37')](db[_0x1dab('0x38')][_0x1dab('0x39')],function(_0x327f80){return{'name':_0x327f80[_0x1dab('0x3a')],'type':_0x327f80[_0x1dab('0x3b')][_0x1dab('0x3c')]};});_0x12ab12[_0x1dab('0x3d')]=_[_0x1dab('0x37')](_0x5a956c,_0x1dab('0x35'));_0x12ab12[_0x1dab('0x3e')]=_[_0x1dab('0x3f')](_0x461750[_0x1dab('0x3e')]);_0x12ab12[_0x1dab('0x40')]=_['intersection'](_0x12ab12[_0x1dab('0x3d')],_0x12ab12[_0x1dab('0x3e')]);_0x53d7d5[_0x1dab('0x41')]=_[_0x1dab('0x42')](_0x12ab12[_0x1dab('0x3d')],qs[_0x1dab('0x43')](_0x461750[_0x1dab('0x3e')][_0x1dab('0x43')]));_0x53d7d5['attributes']=_0x53d7d5[_0x1dab('0x41')]['length']?_0x53d7d5[_0x1dab('0x41')]:_0x12ab12[_0x1dab('0x3d')];if(!_0x461750[_0x1dab('0x3e')][_0x1dab('0x44')](_0x1dab('0x45'))){_0x53d7d5[_0x1dab('0x2a')]=qs[_0x1dab('0x2a')](_0x461750[_0x1dab('0x3e')]['limit']);_0x53d7d5['offset']=qs[_0x1dab('0x46')](_0x461750[_0x1dab('0x3e')]['offset']);}_0x53d7d5['order']=qs[_0x1dab('0x47')](_0x461750[_0x1dab('0x3e')]['sort']);_0x53d7d5[_0x1dab('0x48')]=qs[_0x1dab('0x40')](_[_0x1dab('0x49')](_0x461750[_0x1dab('0x3e')],_0x12ab12['filters']),_0x5a956c);if(_0x461750[_0x1dab('0x3e')][_0x1dab('0x4a')]){_0x53d7d5[_0x1dab('0x48')]=_[_0x1dab('0x4b')](_0x53d7d5[_0x1dab('0x48')],{'$or':_['map'](_0x5a956c,function(_0x1f9d82){if(_0x1f9d82[_0x1dab('0x3b')]!==_0x1dab('0x4c')){var _0x508a63={};_0x508a63[_0x1f9d82[_0x1dab('0x35')]]={'$like':'%'+_0x461750['query'][_0x1dab('0x4a')]+'%'};return _0x508a63;}})});}_0x53d7d5=_[_0x1dab('0x4b')]({},_0x53d7d5,_0x461750[_0x1dab('0x4d')]);var _0x5afbd9={'where':_0x53d7d5[_0x1dab('0x48')]};return db[_0x1dab('0x38')][_0x1dab('0x2b')](_0x5afbd9)[_0x1dab('0x1e')](function(_0xf7cb5f){_0x7e4b81[_0x1dab('0x2b')]=_0xf7cb5f;if(_0x461750[_0x1dab('0x3e')][_0x1dab('0x4e')]){_0x53d7d5['include']=[{'all':!![]}];}return db[_0x1dab('0x38')][_0x1dab('0x4f')](_0x53d7d5);})['then'](function(_0x4bc528){_0x7e4b81[_0x1dab('0x50')]=_0x4bc528;return _0x7e4b81;})[_0x1dab('0x1e')](respondWithFilteredResult(_0x5d9f36,_0x53d7d5))['catch'](handleError(_0x5d9f36,null));};exports[_0x1dab('0x51')]=function(_0xb8fa23,_0x284302){var _0x568109={'raw':!![],'where':{'id':_0xb8fa23[_0x1dab('0x52')]['id']}},_0x6f374d={};_0x6f374d[_0x1dab('0x3d')]=_[_0x1dab('0x3f')](db['FaxMessage']['rawAttributes']);_0x6f374d['query']=_[_0x1dab('0x3f')](_0xb8fa23[_0x1dab('0x3e')]);_0x6f374d[_0x1dab('0x40')]=_[_0x1dab('0x42')](_0x6f374d[_0x1dab('0x3d')],_0x6f374d['query']);_0x568109[_0x1dab('0x41')]=_['intersection'](_0x6f374d[_0x1dab('0x3d')],qs[_0x1dab('0x43')](_0xb8fa23[_0x1dab('0x3e')][_0x1dab('0x43')]));_0x568109[_0x1dab('0x41')]=_0x568109[_0x1dab('0x41')][_0x1dab('0x53')]?_0x568109[_0x1dab('0x41')]:_0x6f374d[_0x1dab('0x3d')];if(_0xb8fa23['query']['includeAll']){_0x568109[_0x1dab('0x54')]=[{'all':!![]}];}_0x568109=_[_0x1dab('0x4b')]({},_0x568109,_0xb8fa23[_0x1dab('0x4d')]);return db['FaxMessage']['find'](_0x568109)[_0x1dab('0x1e')](handleEntityNotFound(_0x284302,null))['then'](respondWithResult(_0x284302,null))[_0x1dab('0x27')](handleError(_0x284302,null));};exports[_0x1dab('0x31')]=function(_0x56e62a,_0x1cc575){if(_0x56e62a[_0x1dab('0x55')]['id']){delete _0x56e62a[_0x1dab('0x55')]['id'];}return db[_0x1dab('0x38')]['find']({'where':{'id':_0x56e62a[_0x1dab('0x52')]['id']}})[_0x1dab('0x1e')](handleEntityNotFound(_0x1cc575,null))[_0x1dab('0x1e')](saveUpdates(_0x56e62a['body'],null))[_0x1dab('0x1e')](respondWithResult(_0x1cc575,null))[_0x1dab('0x27')](handleError(_0x1cc575,null));};exports[_0x1dab('0x32')]=function(_0x29102a,_0x2d4514){return db[_0x1dab('0x38')][_0x1dab('0x56')]({'where':{'id':_0x29102a[_0x1dab('0x52')]['id']}})[_0x1dab('0x1e')](handleEntityNotFound(_0x2d4514,null))[_0x1dab('0x1e')](removeEntity(_0x2d4514,null))['catch'](handleError(_0x2d4514,null));};exports['describe']=function(_0x5c6f80,_0x101df3){return db['FaxMessage'][_0x1dab('0x57')]()['then'](respondWithResult(_0x101df3,null))[_0x1dab('0x27')](handleError(_0x101df3,null));};var interaction_log=require(_0x1dab('0x58'))(_0x1dab('0x59'));exports[_0x1dab('0x5a')]=function(_0x4f703a,_0x4a78f6,_0x4a4852){var _0x4ecbc9={'agent':{},'channel':_0x1dab('0x5b')};if(_0x4f703a['body']['id']){delete _0x4f703a[_0x1dab('0x55')]['id'];}_0x4f703a[_0x1dab('0x55')][_0x1dab('0x5c')]=!![];_0x4f703a[_0x1dab('0x55')][_0x1dab('0x5d')]=moment()[_0x1dab('0x5e')](_0x1dab('0x5f'));_0x4f703a[_0x1dab('0x55')]['UserId']=_0x4f703a[_0x1dab('0x55')][_0x1dab('0x60')]||_0x4f703a[_0x1dab('0x61')]['id'];_0x4ecbc9[_0x1dab('0x62')]['id']=_0x4f703a['body'][_0x1dab('0x60')];return db['FaxMessage'][_0x1dab('0x56')]({'where':{'id':_0x4f703a[_0x1dab('0x52')]['id'],'UserId':null}})[_0x1dab('0x1e')](handleEntityNotFound(_0x4a78f6,null))[_0x1dab('0x1e')](saveUpdates(_0x4f703a[_0x1dab('0x55')],null))[_0x1dab('0x1e')](function(_0x9e7b9d){if(_0x9e7b9d){_0x4ecbc9[_0x1dab('0x26')]=_0x9e7b9d[_0x1dab('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x1dab('0x56')]({'where':{'id':_0x9e7b9d['FaxInteractionId']}});}return null;})[_0x1dab('0x1e')](handleEntityNotFound(_0x4a78f6,null))[_0x1dab('0x1e')](function(_0x58d514){if(_0x58d514){return _0x58d514[_0x1dab('0x31')]({'UserId':_0x4f703a[_0x1dab('0x55')][_0x1dab('0x60')],'read1stAt':_[_0x1dab('0x64')](_0x58d514[_0x1dab('0x65')])?moment()[_0x1dab('0x5e')](_0x1dab('0x5f')):undefined});}return null;})[_0x1dab('0x1e')](function(_0x3f252e){if(_0x3f252e){_0x4ecbc9[_0x1dab('0x66')]=_0x3f252e[_0x1dab('0x63')]({'plain':!![]});interaction_log[_0x1dab('0x1f')](_0x1dab('0x67'),_0x4f703a['user']['id'],_0x4f703a[_0x1dab('0x61')][_0x1dab('0x35')],_0x4f703a[_0x1dab('0x61')][_0x1dab('0x68')],_0x4ecbc9['interaction']['id'],_0x4f703a['body']?JSON[_0x1dab('0x69')](_0x4f703a[_0x1dab('0x55')]):'null');return respondWithRpcPromise(_0x1dab('0x6a'),_0x1dab('0x6b'),_0x4ecbc9);}return null;})['then'](function(_0x2ed3be){var _0x217f7d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2ed3be['message'][_0x1dab('0x6c')];return db['sequelize'][_0x1dab('0x3e')](_0x217f7d,{'type':db[_0x1dab('0x6d')][_0x1dab('0x6e')][_0x1dab('0x6f')],'raw':!![]})['then'](function(_0x21ea99){return _0x21ea99;});})['then'](function(_0xc94952){if(_0xc94952){_0x4ecbc9[_0x1dab('0x26')]['contact']=_0xc94952[0x0];if(!_0x4f703a[_0x1dab('0x55')]['UserId'])return;return db[_0x1dab('0x70')][_0x1dab('0x56')]({'where':{'id':_0x4f703a[_0x1dab('0x55')]['UserId'],'role':_0x1dab('0x62')},'attributes':['id',_0x1dab('0x35'),_0x1dab('0x71'),_0x1dab('0x72'),_0x1dab('0x73')],'raw':!![]});}return null;})['then'](function(_0x38ffcd){if(!_0x38ffcd)return null;_0x4ecbc9[_0x1dab('0x26')][_0x1dab('0x62')]=_0x38ffcd;return _0x4ecbc9;})['then'](function(_0x3be774){if(_0x3be774){if(_0x4f703a['body'][_0x1dab('0x74')]){_0x4ecbc9[_0x1dab('0x26')][_0x1dab('0x75')]=util[_0x1dab('0x5e')](_0x1dab('0x76'),_0x4f703a['user']['name']);_0x4ecbc9[_0x1dab('0x26')][_0x1dab('0x77')]=_0x4ecbc9[_0x1dab('0x77')];_0x4ecbc9['message'][_0x1dab('0x78')]=_0x1dab('0x5a');return respondWithRpcPromise(_0x1dab('0x79'),'EventManager',{'event':'acceptmessage','message':_0x4ecbc9['message']},client9002)[_0x1dab('0x1e')](function(){return _0x4ecbc9;});}return _0x4ecbc9;}return null;})[_0x1dab('0x1e')](respondWithResult(_0x4a78f6,null))[_0x1dab('0x27')](handleError(_0x4a78f6,null));};var interaction_log=require(_0x1dab('0x58'))(_0x1dab('0x59'));exports[_0x1dab('0x30')]=function(_0x3f7f3a,_0x264207,_0x316b66){var _0x4c0c72={'agent':{},'channel':_0x1dab('0x5b')};if(_0x3f7f3a[_0x1dab('0x55')]['id']){delete _0x3f7f3a[_0x1dab('0x55')]['id'];}_0x3f7f3a[_0x1dab('0x55')][_0x1dab('0x60')]=_0x3f7f3a['body'][_0x1dab('0x60')]||_0x3f7f3a[_0x1dab('0x61')]['id'];_0x4c0c72[_0x1dab('0x62')]['id']=_0x3f7f3a['body'][_0x1dab('0x60')];return db[_0x1dab('0x38')][_0x1dab('0x56')]({'where':{'id':_0x3f7f3a[_0x1dab('0x52')]['id'],'UserId':null}})[_0x1dab('0x1e')](handleEntityNotFound(_0x264207,null))[_0x1dab('0x1e')](function(_0x5e4d11){if(_0x5e4d11){_0x4c0c72[_0x1dab('0x26')]=_0x5e4d11['get']({'plain':!![]});return db[_0x1dab('0x7a')][_0x1dab('0x56')]({'where':{'id':_0x5e4d11[_0x1dab('0x7b')]}});}return null;})[_0x1dab('0x1e')](handleEntityNotFound(_0x264207,null))[_0x1dab('0x1e')](function(_0x3607e3){if(_0x3607e3){_0x4c0c72[_0x1dab('0x66')]=_0x3607e3[_0x1dab('0x63')]({'plain':!![]});interaction_log[_0x1dab('0x1f')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3f7f3a[_0x1dab('0x61')]['id'],_0x3f7f3a[_0x1dab('0x61')]['name'],_0x3f7f3a[_0x1dab('0x61')][_0x1dab('0x68')],_0x4c0c72[_0x1dab('0x66')]['id'],_0x3f7f3a[_0x1dab('0x55')]?JSON[_0x1dab('0x69')](_0x3f7f3a[_0x1dab('0x55')]):'null');return respondWithRpcPromise(_0x1dab('0x7c'),'rejectMessage',_0x4c0c72);}return null;})[_0x1dab('0x1e')](function(_0x92f6b2){var _0x30c201=_0x1dab('0x7d')+_0x92f6b2[_0x1dab('0x26')][_0x1dab('0x6c')];return db[_0x1dab('0x7e')][_0x1dab('0x3e')](_0x30c201,{'type':db[_0x1dab('0x6d')][_0x1dab('0x6e')]['SELECT'],'raw':!![]})[_0x1dab('0x1e')](function(_0x4f94ff){return _0x4f94ff;});})['then'](function(_0x5c998a){if(_0x5c998a){_0x4c0c72[_0x1dab('0x26')][_0x1dab('0x7f')]=_0x5c998a[0x0];if(!_0x3f7f3a[_0x1dab('0x55')][_0x1dab('0x60')])return;return db[_0x1dab('0x70')][_0x1dab('0x56')]({'where':{'id':_0x3f7f3a[_0x1dab('0x55')][_0x1dab('0x60')],'role':_0x1dab('0x62')},'attributes':['id','name',_0x1dab('0x71'),_0x1dab('0x72'),_0x1dab('0x73')],'raw':!![]});}return null;})[_0x1dab('0x1e')](function(_0x321395){if(!_0x321395)return null;_0x4c0c72[_0x1dab('0x26')][_0x1dab('0x62')]=_0x321395;return _0x4c0c72;})[_0x1dab('0x1e')](function(_0x30cebe){if(_0x30cebe){_0x30cebe[_0x1dab('0x26')][_0x1dab('0x75')]=util[_0x1dab('0x5e')](_0x1dab('0x76'),_0x3f7f3a['user'][_0x1dab('0x35')]);_0x30cebe[_0x1dab('0x26')]['channel']=_0x4c0c72[_0x1dab('0x77')];_0x30cebe[_0x1dab('0x26')][_0x1dab('0x78')]=_0x1dab('0x30');respondWithRpcPromise(_0x1dab('0x79'),_0x1dab('0x79'),{'event':_0x1dab('0x80'),'message':_0x30cebe[_0x1dab('0x26')]},client9002);return _0x4c0c72;}return null;})[_0x1dab('0x1e')](respondWithResult(_0x264207,null))[_0x1dab('0x27')](handleError(_0x264207,null));};exports[_0x1dab('0x81')]=function(_0x1efd1f,_0x2c5cc9){var _0x2b9081;return db[_0x1dab('0x38')][_0x1dab('0x81')](_0x1efd1f[_0x1dab('0x55')],{})[_0x1dab('0x1e')](function(_0x4ee827){_0x2b9081=_0x4ee827;return db[_0x1dab('0x82')][_0x1dab('0x83')]({'where':{'id':_0x2b9081[_0x1dab('0x6c')]}});})[_0x1dab('0x1e')](function(_0x5b631c){if(_['isNil'](_0x5b631c)){return;}else{_0x2b9081[_0x1dab('0x5b')]=_0x5b631c[_0x1dab('0x5b')];return db[_0x1dab('0x84')]['findOne']({'where':{'id':_0x2b9081[_0x1dab('0x85')]}});}})['then'](function(_0x3be17a){return respondWithRpcPromise(_0x1dab('0x86'),_0x1dab('0x86'),{'FaxAccountId':_['isNil'](_0x1efd1f['body'])?undefined:_0x1efd1f['body'][_0x1dab('0x87')],'path':_[_0x1dab('0x64')](_0x3be17a)?undefined:util[_0x1dab('0x5e')](_0x1dab('0x88'),_0x3be17a[_0x1dab('0x89')]),'fax':_[_0x1dab('0x64')](_0x2b9081[_0x1dab('0x5b')])?undefined:_0x2b9081[_0x1dab('0x5b')],'AttachmentId':_0x2b9081[_0x1dab('0x85')]},client9002);})[_0x1dab('0x1e')](respondWithResult(_0x2c5cc9,0xc9))[_0x1dab('0x27')](handleError(_0x2c5cc9,null));};exports[_0x1dab('0x8a')]=function(_0x31e507,_0x3b66a2){var _0x233c3a=path[_0x1dab('0x8b')](config[_0x1dab('0x8c')],_0x1dab('0x8d'),_0x1dab('0x8e'),_0x1dab('0x8f'));return db[_0x1dab('0x38')][_0x1dab('0x56')]({'where':{'id':_0x31e507[_0x1dab('0x52')]['id']},'include':[{'model':db['Attachment'],'as':_0x1dab('0x84')}]})[_0x1dab('0x1e')](handleEntityNotFound(_0x3b66a2,null))[_0x1dab('0x1e')](function(_0x5a72f9){if(_0x5a72f9){return _0x3b66a2[_0x1dab('0x8a')](path[_0x1dab('0x8b')](_0x233c3a,_0x5a72f9[_0x1dab('0x84')][_0x1dab('0x89')]));}})['catch'](handleError(_0x3b66a2,null));}; \ No newline at end of file +var _0x9d48=['join','root','server','files','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','destroy','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL','merge','includeAll','rows','params','include','find','body','describe','fax-interactions','accept','fax','read','readAt','UserId','user','agent','get','FaxInteraction','FaxInteractionId','update','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','format','SIP/%s','channel','event','EventManager','acceptmessage','RejectMessage','ContactId','SELECT','interface','rejectmessage','create','CmContact','findOne','Attachment','SendFax','FaxAccountId','basename','AttachmentId','download'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0x9d48,0x92));var _0x89d4=function(_0x1cfc39,_0x1d3913){_0x1cfc39=_0x1cfc39-0x0;var _0x957a28=_0x9d48[_0x1cfc39];return _0x957a28;};'use strict';var emlformat=require(_0x89d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89d4('0x2'));var moment=require(_0x89d4('0x3'));var BPromise=require(_0x89d4('0x4'));var Mustache=require(_0x89d4('0x5'));var util=require(_0x89d4('0x6'));var path=require('path');var sox=require(_0x89d4('0x7'));var csv=require(_0x89d4('0x8'));var ejs=require(_0x89d4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89d4('0xa'));var squel=require(_0x89d4('0xb'));var crypto=require(_0x89d4('0xc'));var jsforce=require(_0x89d4('0xd'));var deskjs=require(_0x89d4('0xe'));var toCsv=require(_0x89d4('0x8'));var querystring=require(_0x89d4('0xf'));var Papa=require(_0x89d4('0x10'));var Redis=require(_0x89d4('0x11'));var authService=require(_0x89d4('0x12'));var qs=require(_0x89d4('0x13'));var as=require(_0x89d4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x89d4('0x15'))(_0x89d4('0x16'));var utils=require('../../config/utils');var config=require(_0x89d4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x89d4('0x18'))['db'];config[_0x89d4('0x19')]=_[_0x89d4('0x1a')](config[_0x89d4('0x19')],{'host':_0x89d4('0x1b'),'port':0x18eb});var socket=require(_0x89d4('0x1c'))(new Redis(config[_0x89d4('0x19')]));require('./faxMessage.socket')[_0x89d4('0x1d')](socket);var jayson=require(_0x89d4('0x1e'));var client=jayson[_0x89d4('0x1f')][_0x89d4('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x89d4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x125fa0,_0x2f0b92,_0x195b5a,_0x1c08fc){return new BPromise(function(_0x3e54fa,_0x219f11){var _0x3c53d0=_0x1c08fc||client;return _0x3c53d0[_0x89d4('0x21')](_0x125fa0,_0x195b5a)[_0x89d4('0x22')](function(_0x41f237){logger['info']('FaxMessage,\x20%s,\x20%s',_0x2f0b92,_0x89d4('0x23'));logger[_0x89d4('0x24')](_0x89d4('0x25'),_0x2f0b92,_0x89d4('0x23'),JSON[_0x89d4('0x26')](_0x41f237));if(_0x41f237['error']){if(_0x41f237[_0x89d4('0x27')][_0x89d4('0x28')]===0x1f4){logger[_0x89d4('0x27')](_0x89d4('0x29'),_0x2f0b92,_0x41f237[_0x89d4('0x27')]['message']);return _0x219f11(_0x41f237[_0x89d4('0x27')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x2f0b92,_0x41f237[_0x89d4('0x27')][_0x89d4('0x2a')]);return _0x3e54fa(_0x41f237['error'][_0x89d4('0x2a')]);}else{logger[_0x89d4('0x2b')](_0x89d4('0x29'),_0x2f0b92,_0x89d4('0x23'));_0x3e54fa(_0x41f237['result'][_0x89d4('0x2a')]);}})[_0x89d4('0x2c')](function(_0x5e0817){logger['error']('FaxMessage,\x20%s,\x20%s',_0x2f0b92,_0x5e0817);_0x219f11(_0x5e0817);});});}function respondWithStatusCode(_0x1e264a,_0x4a5ea4){_0x4a5ea4=_0x4a5ea4||0xcc;return function(_0x4970b8){if(_0x4970b8){return _0x1e264a[_0x89d4('0x2d')](_0x4a5ea4);}return _0x1e264a[_0x89d4('0x2e')](_0x4a5ea4)[_0x89d4('0x2f')]();};}function respondWithResult(_0x5c702d,_0x3ac992){_0x3ac992=_0x3ac992||0xc8;return function(_0xbefaa3){if(_0xbefaa3){return _0x5c702d['status'](_0x3ac992)[_0x89d4('0x30')](_0xbefaa3);}};}function respondWithFilteredResult(_0x1cad4a,_0x40be93){return function(_0x242a1c){if(_0x242a1c){var _0x5ba893=typeof _0x40be93[_0x89d4('0x31')]==='undefined'&&typeof _0x40be93['limit']===_0x89d4('0x32');var _0x53b601=_0x242a1c[_0x89d4('0x33')];var _0x88b0d8=_0x5ba893?0x0:_0x40be93['offset'];var _0x4ede79=_0x5ba893?_0x242a1c['count']:_0x40be93[_0x89d4('0x31')]+_0x40be93['limit'];var _0xdfbcf3;if(_0x4ede79>=_0x53b601){_0x4ede79=_0x53b601;_0xdfbcf3=0xc8;}else{_0xdfbcf3=0xce;}_0x1cad4a[_0x89d4('0x2e')](_0xdfbcf3);return _0x1cad4a[_0x89d4('0x34')](_0x89d4('0x35'),_0x88b0d8+'-'+_0x4ede79+'/'+_0x53b601)[_0x89d4('0x30')](_0x242a1c);}return null;};}function patchUpdates(_0x22fc15){return function(_0x29f9fc){try{jsonpatch[_0x89d4('0x36')](_0x29f9fc,_0x22fc15,!![]);}catch(_0x4b7fc6){return BPromise[_0x89d4('0x37')](_0x4b7fc6);}return _0x29f9fc['save']();};}function saveUpdates(_0x32d367,_0x4eb800){return function(_0x4d117c){if(_0x4d117c){return _0x4d117c['update'](_0x32d367)[_0x89d4('0x22')](function(_0x214e53){return _0x214e53;});}return null;};}function removeEntity(_0x327297,_0xa89c6b){return function(_0x9137c0){if(_0x9137c0){return _0x9137c0[_0x89d4('0x38')]()['then'](function(){_0x327297[_0x89d4('0x2e')](0xcc)[_0x89d4('0x2f')]();});}};}function handleEntityNotFound(_0x4645e8,_0x16f8d0){return function(_0x2a2520){if(!_0x2a2520){_0x4645e8[_0x89d4('0x2d')](0x194);}return _0x2a2520;};}function handleError(_0xce4400,_0x215deb){_0x215deb=_0x215deb||0x1f4;return function(_0x49630c){logger['error'](_0x49630c[_0x89d4('0x39')]);if(_0x49630c[_0x89d4('0x3a')]){delete _0x49630c[_0x89d4('0x3a')];}_0xce4400['status'](_0x215deb)['send'](_0x49630c);};}exports[_0x89d4('0x3b')]=function(_0x161615,_0x489153){var _0x390de6={},_0x2f0e76={},_0x503ab7={'count':0x0,'rows':[]};var _0x340c78=_[_0x89d4('0x3c')](db[_0x89d4('0x3d')][_0x89d4('0x3e')],function(_0x4a5fb0){return{'name':_0x4a5fb0[_0x89d4('0x3f')],'type':_0x4a5fb0[_0x89d4('0x40')]['key']};});_0x2f0e76['model']=_[_0x89d4('0x3c')](_0x340c78,_0x89d4('0x3a'));_0x2f0e76[_0x89d4('0x41')]=_[_0x89d4('0x42')](_0x161615[_0x89d4('0x41')]);_0x2f0e76[_0x89d4('0x43')]=_['intersection'](_0x2f0e76['model'],_0x2f0e76[_0x89d4('0x41')]);_0x390de6[_0x89d4('0x44')]=_[_0x89d4('0x45')](_0x2f0e76[_0x89d4('0x46')],qs['fields'](_0x161615[_0x89d4('0x41')][_0x89d4('0x47')]));_0x390de6[_0x89d4('0x44')]=_0x390de6[_0x89d4('0x44')][_0x89d4('0x48')]?_0x390de6[_0x89d4('0x44')]:_0x2f0e76['model'];if(!_0x161615[_0x89d4('0x41')][_0x89d4('0x49')]('nolimit')){_0x390de6[_0x89d4('0x4a')]=qs[_0x89d4('0x4a')](_0x161615[_0x89d4('0x41')][_0x89d4('0x4a')]);_0x390de6[_0x89d4('0x31')]=qs['offset'](_0x161615['query'][_0x89d4('0x31')]);}_0x390de6[_0x89d4('0x4b')]=qs['sort'](_0x161615[_0x89d4('0x41')][_0x89d4('0x4c')]);_0x390de6[_0x89d4('0x4d')]=qs['filters'](_['pick'](_0x161615[_0x89d4('0x41')],_0x2f0e76[_0x89d4('0x43')]),_0x340c78);if(_0x161615[_0x89d4('0x41')][_0x89d4('0x4e')]){_0x390de6[_0x89d4('0x4d')]=_['merge'](_0x390de6['where'],{'$or':_[_0x89d4('0x3c')](_0x340c78,function(_0x4ac33f){if(_0x4ac33f[_0x89d4('0x40')]!==_0x89d4('0x4f')){var _0x14b4ca={};_0x14b4ca[_0x4ac33f[_0x89d4('0x3a')]]={'$like':'%'+_0x161615[_0x89d4('0x41')][_0x89d4('0x4e')]+'%'};return _0x14b4ca;}})});}_0x390de6=_[_0x89d4('0x50')]({},_0x390de6,_0x161615['options']);var _0xeb7c4={'where':_0x390de6[_0x89d4('0x4d')]};return db[_0x89d4('0x3d')][_0x89d4('0x33')](_0xeb7c4)[_0x89d4('0x22')](function(_0x461865){_0x503ab7[_0x89d4('0x33')]=_0x461865;if(_0x161615[_0x89d4('0x41')][_0x89d4('0x51')]){_0x390de6['include']=[{'all':!![]}];}return db[_0x89d4('0x3d')]['findAll'](_0x390de6);})[_0x89d4('0x22')](function(_0x209ceb){_0x503ab7[_0x89d4('0x52')]=_0x209ceb;return _0x503ab7;})[_0x89d4('0x22')](respondWithFilteredResult(_0x489153,_0x390de6))['catch'](handleError(_0x489153,null));};exports['show']=function(_0x3dd365,_0x37f871){var _0x45cf12={'raw':!![],'where':{'id':_0x3dd365[_0x89d4('0x53')]['id']}},_0x3273e1={};_0x3273e1[_0x89d4('0x46')]=_[_0x89d4('0x42')](db['FaxMessage'][_0x89d4('0x3e')]);_0x3273e1[_0x89d4('0x41')]=_['keys'](_0x3dd365['query']);_0x3273e1['filters']=_[_0x89d4('0x45')](_0x3273e1['model'],_0x3273e1['query']);_0x45cf12['attributes']=_[_0x89d4('0x45')](_0x3273e1[_0x89d4('0x46')],qs[_0x89d4('0x47')](_0x3dd365[_0x89d4('0x41')][_0x89d4('0x47')]));_0x45cf12['attributes']=_0x45cf12[_0x89d4('0x44')][_0x89d4('0x48')]?_0x45cf12[_0x89d4('0x44')]:_0x3273e1[_0x89d4('0x46')];if(_0x3dd365[_0x89d4('0x41')]['includeAll']){_0x45cf12[_0x89d4('0x54')]=[{'all':!![]}];}_0x45cf12=_[_0x89d4('0x50')]({},_0x45cf12,_0x3dd365['options']);return db['FaxMessage'][_0x89d4('0x55')](_0x45cf12)['then'](handleEntityNotFound(_0x37f871,null))[_0x89d4('0x22')](respondWithResult(_0x37f871,null))['catch'](handleError(_0x37f871,null));};exports['update']=function(_0x50afdb,_0x2042b7){if(_0x50afdb[_0x89d4('0x56')]['id']){delete _0x50afdb[_0x89d4('0x56')]['id'];}return db['FaxMessage'][_0x89d4('0x55')]({'where':{'id':_0x50afdb['params']['id']}})[_0x89d4('0x22')](handleEntityNotFound(_0x2042b7,null))[_0x89d4('0x22')](saveUpdates(_0x50afdb[_0x89d4('0x56')],null))[_0x89d4('0x22')](respondWithResult(_0x2042b7,null))[_0x89d4('0x2c')](handleError(_0x2042b7,null));};exports['destroy']=function(_0x2cf124,_0x211e46){return db['FaxMessage'][_0x89d4('0x55')]({'where':{'id':_0x2cf124[_0x89d4('0x53')]['id']}})[_0x89d4('0x22')](handleEntityNotFound(_0x211e46,null))[_0x89d4('0x22')](removeEntity(_0x211e46,null))[_0x89d4('0x2c')](handleError(_0x211e46,null));};exports[_0x89d4('0x57')]=function(_0x15b8fe,_0x292f22){return db[_0x89d4('0x3d')][_0x89d4('0x57')]()[_0x89d4('0x22')](respondWithResult(_0x292f22,null))[_0x89d4('0x2c')](handleError(_0x292f22,null));};var interaction_log=require(_0x89d4('0x15'))(_0x89d4('0x58'));exports[_0x89d4('0x59')]=function(_0x2c9a79,_0x473669,_0x486188){var _0x1b00c7={'agent':{},'channel':_0x89d4('0x5a')};if(_0x2c9a79[_0x89d4('0x56')]['id']){delete _0x2c9a79[_0x89d4('0x56')]['id'];}_0x2c9a79[_0x89d4('0x56')][_0x89d4('0x5b')]=!![];_0x2c9a79[_0x89d4('0x56')][_0x89d4('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2c9a79[_0x89d4('0x56')][_0x89d4('0x5d')]=_0x2c9a79[_0x89d4('0x56')][_0x89d4('0x5d')]||_0x2c9a79[_0x89d4('0x5e')]['id'];_0x1b00c7[_0x89d4('0x5f')]['id']=_0x2c9a79[_0x89d4('0x56')][_0x89d4('0x5d')];return db['FaxMessage'][_0x89d4('0x55')]({'where':{'id':_0x2c9a79[_0x89d4('0x53')]['id'],'UserId':null}})[_0x89d4('0x22')](handleEntityNotFound(_0x473669,null))['then'](saveUpdates(_0x2c9a79[_0x89d4('0x56')],null))[_0x89d4('0x22')](function(_0x2856e7){if(_0x2856e7){_0x1b00c7[_0x89d4('0x2a')]=_0x2856e7[_0x89d4('0x60')]({'plain':!![]});return db[_0x89d4('0x61')][_0x89d4('0x55')]({'where':{'id':_0x2856e7[_0x89d4('0x62')]}});}return null;})[_0x89d4('0x22')](handleEntityNotFound(_0x473669,null))[_0x89d4('0x22')](function(_0x46529b){if(_0x46529b){return _0x46529b[_0x89d4('0x63')]({'UserId':_0x2c9a79['body']['UserId'],'read1stAt':_[_0x89d4('0x64')](_0x46529b[_0x89d4('0x65')])?moment()['format'](_0x89d4('0x66')):undefined});}return null;})[_0x89d4('0x22')](function(_0x2e77ef){if(_0x2e77ef){_0x1b00c7['interaction']=_0x2e77ef['get']({'plain':!![]});interaction_log[_0x89d4('0x2b')](_0x89d4('0x67'),_0x2c9a79[_0x89d4('0x5e')]['id'],_0x2c9a79[_0x89d4('0x5e')]['name'],_0x2c9a79[_0x89d4('0x5e')][_0x89d4('0x68')],_0x1b00c7[_0x89d4('0x69')]['id'],_0x2c9a79[_0x89d4('0x56')]?JSON[_0x89d4('0x26')](_0x2c9a79[_0x89d4('0x56')]):_0x89d4('0x6a'));return respondWithRpcPromise(_0x89d4('0x6b'),_0x89d4('0x6c'),_0x1b00c7);}return null;})[_0x89d4('0x22')](function(_0x54cc49){var _0x1ffcc3=_0x89d4('0x6d')+_0x54cc49[_0x89d4('0x2a')]['ContactId'];return db[_0x89d4('0x6e')][_0x89d4('0x41')](_0x1ffcc3,{'type':db['Sequelize'][_0x89d4('0x6f')]['SELECT'],'raw':!![]})[_0x89d4('0x22')](function(_0x18d2d1){return _0x18d2d1;});})[_0x89d4('0x22')](function(_0xe80a90){if(_0xe80a90){_0x1b00c7[_0x89d4('0x2a')][_0x89d4('0x70')]=_0xe80a90[0x0];if(!_0x2c9a79[_0x89d4('0x56')][_0x89d4('0x5d')])return;return db[_0x89d4('0x71')][_0x89d4('0x55')]({'where':{'id':_0x2c9a79[_0x89d4('0x56')][_0x89d4('0x5d')],'role':_0x89d4('0x5f')},'attributes':['id',_0x89d4('0x3a'),_0x89d4('0x72'),_0x89d4('0x73'),_0x89d4('0x74')],'raw':!![]});}return null;})['then'](function(_0x1ea2ae){if(!_0x1ea2ae)return null;_0x1b00c7['message'][_0x89d4('0x5f')]=_0x1ea2ae;return _0x1b00c7;})['then'](function(_0x40fe46){if(_0x40fe46){if(_0x2c9a79['body'][_0x89d4('0x75')]){_0x1b00c7[_0x89d4('0x2a')]['interface']=util[_0x89d4('0x76')](_0x89d4('0x77'),_0x2c9a79['user'][_0x89d4('0x3a')]);_0x1b00c7[_0x89d4('0x2a')][_0x89d4('0x78')]=_0x1b00c7[_0x89d4('0x78')];_0x1b00c7['message'][_0x89d4('0x79')]='accept';return respondWithRpcPromise(_0x89d4('0x7a'),_0x89d4('0x7a'),{'event':_0x89d4('0x7b'),'message':_0x1b00c7[_0x89d4('0x2a')]},client9002)[_0x89d4('0x22')](function(){return _0x1b00c7;});}return _0x1b00c7;}return null;})[_0x89d4('0x22')](respondWithResult(_0x473669,null))[_0x89d4('0x2c')](handleError(_0x473669,null));};var interaction_log=require('../../config/logger')(_0x89d4('0x58'));exports[_0x89d4('0x37')]=function(_0x555458,_0xf3127e,_0x15a699){var _0x3bc808={'agent':{},'channel':'fax'};if(_0x555458['body']['id']){delete _0x555458[_0x89d4('0x56')]['id'];}_0x555458['body'][_0x89d4('0x5d')]=_0x555458[_0x89d4('0x56')][_0x89d4('0x5d')]||_0x555458['user']['id'];_0x3bc808['agent']['id']=_0x555458[_0x89d4('0x56')]['UserId'];return db['FaxMessage']['find']({'where':{'id':_0x555458[_0x89d4('0x53')]['id'],'UserId':null}})[_0x89d4('0x22')](handleEntityNotFound(_0xf3127e,null))[_0x89d4('0x22')](function(_0x5d41d6){if(_0x5d41d6){_0x3bc808[_0x89d4('0x2a')]=_0x5d41d6[_0x89d4('0x60')]({'plain':!![]});return db[_0x89d4('0x61')]['find']({'where':{'id':_0x5d41d6[_0x89d4('0x62')]}});}return null;})[_0x89d4('0x22')](handleEntityNotFound(_0xf3127e,null))['then'](function(_0x52c0d8){if(_0x52c0d8){_0x3bc808['interaction']=_0x52c0d8[_0x89d4('0x60')]({'plain':!![]});interaction_log[_0x89d4('0x2b')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x555458[_0x89d4('0x5e')]['id'],_0x555458['user']['name'],_0x555458[_0x89d4('0x5e')][_0x89d4('0x68')],_0x3bc808[_0x89d4('0x69')]['id'],_0x555458[_0x89d4('0x56')]?JSON['stringify'](_0x555458[_0x89d4('0x56')]):_0x89d4('0x6a'));return respondWithRpcPromise(_0x89d4('0x7c'),'rejectMessage',_0x3bc808);}return null;})[_0x89d4('0x22')](function(_0x2fba05){var _0x49167e=_0x89d4('0x6d')+_0x2fba05[_0x89d4('0x2a')][_0x89d4('0x7d')];return db[_0x89d4('0x6e')]['query'](_0x49167e,{'type':db['Sequelize'][_0x89d4('0x6f')][_0x89d4('0x7e')],'raw':!![]})[_0x89d4('0x22')](function(_0x285b22){return _0x285b22;});})['then'](function(_0x2131ec){if(_0x2131ec){_0x3bc808[_0x89d4('0x2a')][_0x89d4('0x70')]=_0x2131ec[0x0];if(!_0x555458[_0x89d4('0x56')]['UserId'])return;return db[_0x89d4('0x71')][_0x89d4('0x55')]({'where':{'id':_0x555458[_0x89d4('0x56')]['UserId'],'role':'agent'},'attributes':['id','name',_0x89d4('0x72'),_0x89d4('0x73'),_0x89d4('0x74')],'raw':!![]});}return null;})[_0x89d4('0x22')](function(_0x5117d3){if(!_0x5117d3)return null;_0x3bc808[_0x89d4('0x2a')]['agent']=_0x5117d3;return _0x3bc808;})[_0x89d4('0x22')](function(_0x117955){if(_0x117955){_0x117955['message'][_0x89d4('0x7f')]=util['format']('SIP/%s',_0x555458[_0x89d4('0x5e')][_0x89d4('0x3a')]);_0x117955[_0x89d4('0x2a')][_0x89d4('0x78')]=_0x3bc808[_0x89d4('0x78')];_0x117955['message']['event']=_0x89d4('0x37');respondWithRpcPromise('EventManager',_0x89d4('0x7a'),{'event':_0x89d4('0x80'),'message':_0x117955[_0x89d4('0x2a')]},client9002);return _0x3bc808;}return null;})[_0x89d4('0x22')](respondWithResult(_0xf3127e,null))[_0x89d4('0x2c')](handleError(_0xf3127e,null));};exports[_0x89d4('0x81')]=function(_0x593c19,_0x57cfc4){var _0x4dd032;return db[_0x89d4('0x3d')][_0x89d4('0x81')](_0x593c19['body'],{})[_0x89d4('0x22')](function(_0x5023dd){_0x4dd032=_0x5023dd;return db[_0x89d4('0x82')][_0x89d4('0x83')]({'where':{'id':_0x4dd032[_0x89d4('0x7d')]}});})[_0x89d4('0x22')](function(_0x4e86a3){if(_[_0x89d4('0x64')](_0x4e86a3)){return;}else{_0x4dd032[_0x89d4('0x5a')]=_0x4e86a3[_0x89d4('0x5a')];return db[_0x89d4('0x84')][_0x89d4('0x83')]({'where':{'id':_0x4dd032['AttachmentId']}});}})['then'](function(_0x247c96){return respondWithRpcPromise(_0x89d4('0x85'),_0x89d4('0x85'),{'FaxAccountId':_[_0x89d4('0x64')](_0x593c19[_0x89d4('0x56')])?undefined:_0x593c19[_0x89d4('0x56')][_0x89d4('0x86')],'path':_[_0x89d4('0x64')](_0x247c96)?undefined:util[_0x89d4('0x76')]('/var/opt/motion2/server/files/attachments/%s',_0x247c96[_0x89d4('0x87')]),'fax':_[_0x89d4('0x64')](_0x4dd032[_0x89d4('0x5a')])?undefined:_0x4dd032[_0x89d4('0x5a')],'AttachmentId':_0x4dd032[_0x89d4('0x88')]},client9002);})['then'](respondWithResult(_0x57cfc4,0xc9))[_0x89d4('0x2c')](handleError(_0x57cfc4,null));};exports[_0x89d4('0x89')]=function(_0x383b7f,_0xb6bc63){var _0x34a4f9=path[_0x89d4('0x8a')](config[_0x89d4('0x8b')],_0x89d4('0x8c'),_0x89d4('0x8d'),'attachments');return db[_0x89d4('0x3d')][_0x89d4('0x55')]({'where':{'id':_0x383b7f[_0x89d4('0x53')]['id']},'include':[{'model':db[_0x89d4('0x84')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0xb6bc63,null))[_0x89d4('0x22')](function(_0x5514d0){if(_0x5514d0){return _0xb6bc63[_0x89d4('0x89')](path['join'](_0x34a4f9,_0x5514d0[_0x89d4('0x84')][_0x89d4('0x87')]));}})[_0x89d4('0x2c')](handleError(_0xb6bc63,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 2a41a33..ada4f3c 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 _0x2d06=['FaxMessage','setMaxListeners','save','remove','emit','hook','exports','../../mysqldb'];(function(_0x1d0035,_0x45354b){var _0x310e3a=function(_0x2004f0){while(--_0x2004f0){_0x1d0035['push'](_0x1d0035['shift']());}};_0x310e3a(++_0x45354b);}(_0x2d06,0x157));var _0x62d0=function(_0x2e4eba,_0x7d62da){_0x2e4eba=_0x2e4eba-0x0;var _0x12d5a7=_0x2d06[_0x2e4eba];return _0x12d5a7;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x62d0('0x0'))['db'][_0x62d0('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x62d0('0x2')](0x0);var events={'afterCreate':_0x62d0('0x3'),'afterUpdate':'update','afterDestroy':_0x62d0('0x4')};function emitEvent(_0x32be50){return function(_0x2487bb,_0x984713,_0x5cf315){FaxMessageEvents[_0x62d0('0x5')](_0x32be50+':'+_0x2487bb['id'],_0x2487bb);FaxMessageEvents[_0x62d0('0x5')](_0x32be50,_0x2487bb);_0x5cf315(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x62d0('0x6')](e,emitEvent(event));}}module[_0x62d0('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0xf963=['emit','hook','exports','events','setMaxListeners','save'];(function(_0x51666b,_0x48e537){var _0x1858fa=function(_0x578ff0){while(--_0x578ff0){_0x51666b['push'](_0x51666b['shift']());}};_0x1858fa(++_0x48e537);}(_0xf963,0x11d));var _0x3f96=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xf963[_0x56482c];return _0x5aae7a;};'use strict';var EventEmitter=require(_0x3f96('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3f96('0x1')](0x0);var events={'afterCreate':_0x3f96('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f30a1){return function(_0x1e7cb9,_0x3a6815,_0x1a91ab){FaxMessageEvents['emit'](_0x1f30a1+':'+_0x1e7cb9['id'],_0x1e7cb9);FaxMessageEvents[_0x3f96('0x3')](_0x1f30a1,_0x1e7cb9);_0x1a91ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x3f96('0x4')](e,emitEvent(event));}}module[_0x3f96('0x5')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index c94727d..2999f8a 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 _0x7bf3=['request-promise','path','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','models','get','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird'];(function(_0xa721a5,_0x55a92c){var _0x5511d0=function(_0x5a8dea){while(--_0x5a8dea){_0xa721a5['push'](_0xa721a5['shift']());}};_0x5511d0(++_0x55a92c);}(_0x7bf3,0x119));var _0x37bf=function(_0x27d978,_0x1b8927){_0x27d978=_0x27d978-0x0;var _0x373d25=_0x7bf3[_0x27d978];return _0x373d25;};'use strict';var _=require(_0x37bf('0x0'));var util=require(_0x37bf('0x1'));var logger=require(_0x37bf('0x2'))('api');var moment=require(_0x37bf('0x3'));var BPromise=require(_0x37bf('0x4'));var rp=require(_0x37bf('0x5'));var fs=require('fs');var path=require(_0x37bf('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x37bf('0x7'));module[_0x37bf('0x8')]=function(_0x3eee7d,_0x1a9846){return _0x3eee7d[_0x37bf('0x9')]('FaxMessage',attributes,{'tableName':_0x37bf('0xa'),'paranoid':![],'indexes':[{'name':_0x37bf('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36c656,_0x58fa06,_0x239b2f){var _0x31681b=_0x3eee7d[_0x37bf('0xc')];var _0x139bac=_0x36c656[_0x37bf('0xd')]({'plain':!![]});if(_0x139bac['direction']['toLowerCase']()==='in'||_0x139bac['direction'][_0x37bf('0xe')]()===_0x37bf('0xf')&&!_0x139bac['secret']&&!_[_0x37bf('0x10')](_0x139bac[_0x37bf('0x11')])){_0x31681b[_0x37bf('0x12')][_0x37bf('0x13')]({'where':{'id':_0x139bac[_0x37bf('0x14')]}})['then'](function(_0x542b9f){if(_0x542b9f){_0x542b9f[_0x37bf('0x15')]({'lastMsgAt':_0x139bac[_0x37bf('0x16')],'lastMsgDirection':_0x139bac['direction'][_0x37bf('0xe')]()});}})[_0x37bf('0x17')](function(_0x3151ef){console[_0x37bf('0x18')](_0x3151ef);});}_0x239b2f();}},'charset':_0x37bf('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8d3d=['exports','define','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./faxMessage.attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8d3d,0x116));var _0xd8d3=function(_0x214045,_0x144c95){_0x214045=_0x214045-0x0;var _0x49df3b=_0x8d3d[_0x214045];return _0x49df3b;};'use strict';var _=require(_0xd8d3('0x0'));var util=require(_0xd8d3('0x1'));var logger=require(_0xd8d3('0x2'))('api');var moment=require(_0xd8d3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8d3('0x4'));var rimraf=require(_0xd8d3('0x5'));var config=require(_0xd8d3('0x6'));var attributes=require(_0xd8d3('0x7'));module[_0xd8d3('0x8')]=function(_0x1e1c5d,_0x3a3672){return _0x1e1c5d[_0xd8d3('0x9')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xd8d3('0xa'),'fields':[_0xd8d3('0xb')],'type':_0xd8d3('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x418058,_0x2432c6,_0x505a4b){var _0x3ec61f=_0x1e1c5d[_0xd8d3('0xd')];var _0x22696a=_0x418058['get']({'plain':!![]});if(_0x22696a[_0xd8d3('0xe')][_0xd8d3('0xf')]()==='in'||_0x22696a[_0xd8d3('0xe')][_0xd8d3('0xf')]()===_0xd8d3('0x10')&&!_0x22696a['secret']&&!_['isNil'](_0x22696a['UserId'])){_0x3ec61f[_0xd8d3('0x11')][_0xd8d3('0x12')]({'where':{'id':_0x22696a[_0xd8d3('0x13')]}})[_0xd8d3('0x14')](function(_0x506854){if(_0x506854){_0x506854[_0xd8d3('0x15')]({'lastMsgAt':_0x22696a[_0xd8d3('0x16')],'lastMsgDirection':_0x22696a[_0xd8d3('0xe')][_0xd8d3('0xf')]()});}})[_0xd8d3('0x17')](function(_0x46b709){console[_0xd8d3('0x18')](_0x46b709);});}_0x505a4b();}},'charset':'utf8mb4','collate':_0xd8d3('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 9e2d0ac..abab339 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 _0xed1f=['jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','CreateFaxMessage','FaxMessage','create','body','options','raw','info','catch','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed1f,0x6a));var _0xfed1=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xed1f[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});config[_0xfed1('0xe')]=_[_0xfed1('0xf')](config[_0xfed1('0xe')],{'host':_0xfed1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfed1('0xe')]));require(_0xfed1('0x11'))['register'](socket);function respondWithRpcPromise(_0x1414be,_0x7bf48c,_0x4a564e){return new BPromise(function(_0x3ce017,_0x48c338){return client[_0xfed1('0x12')](_0x1414be,_0x4a564e)[_0xfed1('0x13')](function(_0x4a8369){logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));logger['debug'](_0xfed1('0x16'),_0x7bf48c,'request\x20sent',JSON['stringify'](_0x4a8369));if(_0x4a8369[_0xfed1('0x17')]){if(_0x4a8369[_0xfed1('0x17')]['code']===0x1f4){logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369['error'][_0xfed1('0x18')]);return _0x48c338(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369[_0xfed1('0x17')]['message']);return _0x3ce017(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}else{logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));_0x3ce017(_0x4a8369['result']['message']);}})['catch'](function(_0x1e5afb){logger['error'](_0xfed1('0x14'),_0x7bf48c,_0x1e5afb);_0x48c338(_0x1e5afb);});});}exports[_0xfed1('0x19')]=function(_0x51a860){var _0x94cb84=this;return new Promise(function(_0x65f14b,_0x59ee9d){return db[_0xfed1('0x1a')][_0xfed1('0x1b')](_0x51a860[_0xfed1('0x1c')],{'raw':_0x51a860[_0xfed1('0x1d')]?_0x51a860['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x446558){logger[_0xfed1('0x1f')](_0xfed1('0x19'),_0x51a860);logger['debug'](_0xfed1('0x19'),_0x51a860,JSON['stringify'](_0x446558));_0x65f14b(_0x446558);})[_0xfed1('0x20')](function(_0x2793b7){logger[_0xfed1('0x17')](_0xfed1('0x19'),_0x2793b7[_0xfed1('0x18')],_0x51a860);_0x59ee9d(_0x94cb84[_0xfed1('0x17')](0x1f4,_0x2793b7['message']));});});};exports[_0xfed1('0x21')]=function(_0xcb1cdc){var _0x49072b=this;return new Promise(function(_0x1d6c72,_0x2b9dd2){return db[_0xfed1('0x1a')][_0xfed1('0x22')](_0xcb1cdc[_0xfed1('0x1c')],{'raw':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')]['where']||null:null,'attributes':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')][_0xfed1('0x23')]||null:null,'limit':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x24')]||null:null})[_0xfed1('0x13')](function(_0x13f414){logger[_0xfed1('0x1f')](_0xfed1('0x21'),_0xcb1cdc);logger[_0xfed1('0x25')]('UpdateFaxMessage',_0xcb1cdc,JSON[_0xfed1('0x26')](_0x13f414));_0x1d6c72(_0x13f414);})[_0xfed1('0x20')](function(_0x4fc309){logger['error'](_0xfed1('0x21'),_0x4fc309[_0xfed1('0x18')],_0xcb1cdc);_0x2b9dd2(_0x49072b[_0xfed1('0x17')](0x1f4,_0x4fc309[_0xfed1('0x18')]));});});}; \ No newline at end of file +var _0x9957=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','body','options','raw','CreateFaxMessage','catch','UpdateFaxMessage','FaxMessage','where','attributes','lodash'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('FaxMessage,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['CreateFaxMessage']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['FaxMessage']['create'](_0x3ec178[_0x7995('0x1c')],{'raw':_0x3ec178[_0x7995('0x1d')]?_0x3ec178[_0x7995('0x1d')][_0x7995('0x1e')]===undefined?!![]:![]:!![]})[_0x7995('0x12')](function(_0x1c278a){logger['info'](_0x7995('0x1f'),_0x3ec178);logger[_0x7995('0x15')](_0x7995('0x1f'),_0x3ec178,JSON[_0x7995('0x17')](_0x1c278a));_0x4cbe10(_0x1c278a);})[_0x7995('0x20')](function(_0x13bc35){logger[_0x7995('0x18')](_0x7995('0x1f'),_0x13bc35['message'],_0x3ec178);_0x3a9b54(_0x3d463e[_0x7995('0x18')](0x1f4,_0x13bc35[_0x7995('0x19')]));});});};exports[_0x7995('0x21')]=function(_0x268ce7){var _0x3a3fcf=this;return new Promise(function(_0x2a307e,_0x56691a){return db[_0x7995('0x22')]['update'](_0x268ce7[_0x7995('0x1c')],{'raw':_0x268ce7[_0x7995('0x1d')]?_0x268ce7[_0x7995('0x1d')][_0x7995('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x268ce7[_0x7995('0x1d')]?_0x268ce7['options'][_0x7995('0x23')]||null:null,'attributes':_0x268ce7['options']?_0x268ce7[_0x7995('0x1d')][_0x7995('0x24')]||null:null,'limit':_0x268ce7[_0x7995('0x1d')]?_0x268ce7['options']['limit']||null:null})['then'](function(_0x3573be){logger[_0x7995('0x1a')](_0x7995('0x21'),_0x268ce7);logger[_0x7995('0x15')](_0x7995('0x21'),_0x268ce7,JSON[_0x7995('0x17')](_0x3573be));_0x2a307e(_0x3573be);})['catch'](function(_0x481c74){logger[_0x7995('0x18')]('UpdateFaxMessage',_0x481c74[_0x7995('0x19')],_0x268ce7);_0x56691a(_0x3a3fcf[_0x7995('0x18')](0x1f4,_0x481c74[_0x7995('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 24298bf..2ac8b42 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 _0x7554=['faxMessage:','save','remove','update','emit','length'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7554,0xbb));var _0x4755=function(_0x3f0dc2,_0x3352f4){_0x3f0dc2=_0x3f0dc2-0x0;var _0x37686b=_0x7554[_0x3f0dc2];return _0x37686b;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x4755('0x0'),_0x4755('0x1'),_0x4755('0x2')];function createListener(_0x22dd88,_0x49f58c){return function(_0x2227f4){_0x49f58c[_0x4755('0x3')](_0x22dd88,_0x2227f4);};}function removeListener(_0x257724,_0x3c5d79){return function(){FaxMessageEvents['removeListener'](_0x257724,_0x3c5d79);};}exports['register']=function(_0x88f550){for(var _0x5de89a=0x0,_0x57d9aa=events[_0x4755('0x4')];_0x5de89a<_0x57d9aa;_0x5de89a++){var _0x2a50a6=events[_0x5de89a];var _0x13fd39=createListener(_0x4755('0x5')+_0x2a50a6,_0x88f550);FaxMessageEvents['on'](_0x2a50a6,_0x13fd39);}}; \ No newline at end of file +var _0xb804=['update','removeListener','register','./faxMessage.events','save','remove'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb804,0x1d7));var _0x4b80=function(_0x5679a4,_0x1f420b){_0x5679a4=_0x5679a4-0x0;var _0x397109=_0xb804[_0x5679a4];return _0x397109;};'use strict';var FaxMessageEvents=require(_0x4b80('0x0'));var events=[_0x4b80('0x1'),_0x4b80('0x2'),_0x4b80('0x3')];function createListener(_0x3e8db3,_0x48ff18){return function(_0x4fa897){_0x48ff18['emit'](_0x3e8db3,_0x4fa897);};}function removeListener(_0x428742,_0x29a3a5){return function(){FaxMessageEvents[_0x4b80('0x4')](_0x428742,_0x29a3a5);};}exports[_0x4b80('0x5')]=function(_0x235131){for(var _0x2d617f=0x0,_0x2d4cfe=events['length'];_0x2d617f<_0x2d4cfe;_0x2d617f++){var _0x11506d=events[_0x2d617f];var _0x4d2fac=createListener('faxMessage:'+_0x11506d,_0x235131);FaxMessageEvents['on'](_0x11506d,_0x4d2fac);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 0513072..a9ff183 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(_0x28fbe3,_0x4ac6f8){var _0x45db6a=function(_0x296ecb){while(--_0x296ecb){_0x28fbe3['push'](_0x28fbe3['shift']());}};_0x45db6a(++_0x4ac6f8);}(_0x0565,0xf2));var _0x5056=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x0565[_0x725b8e];return _0x43ac45;};'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 _0xbee3=['update','/:id/accept','accept','/:id/reject','reject','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/download','download','post','fax','create','put'];(function(_0x99f811,_0x44d59e){var _0x37ba7f=function(_0x3f3961){while(--_0x3f3961){_0x99f811['push'](_0x99f811['shift']());}};_0x37ba7f(++_0x44d59e);}(_0xbee3,0xd5));var _0x3bee=function(_0x5e0c01,_0x5924c7){_0x5e0c01=_0x5e0c01-0x0;var _0x14ff45=_0xbee3[_0x5e0c01];return _0x14ff45;};'use strict';var multer=require('multer');var util=require(_0x3bee('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3bee('0x1'));var router=express[_0x3bee('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3bee('0x3'));var interaction=require(_0x3bee('0x4'));var config=require(_0x3bee('0x5'));var controller=require('./faxMessage.controller');router[_0x3bee('0x6')]('/',auth[_0x3bee('0x7')](),controller['index']);router[_0x3bee('0x6')](_0x3bee('0x8'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x9')]);router[_0x3bee('0x6')](_0x3bee('0xa'),auth[_0x3bee('0x7')](),controller['show']);router[_0x3bee('0x6')](_0x3bee('0xb'),auth[_0x3bee('0x7')](),controller[_0x3bee('0xc')]);router[_0x3bee('0xd')]('/',auth[_0x3bee('0x7')](),interaction['tracked'](_0x3bee('0xe'),'faxmessage:create'),controller[_0x3bee('0xf')]);router[_0x3bee('0x10')](_0x3bee('0xa'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x11')]);router[_0x3bee('0x10')](_0x3bee('0x12'),auth['isAuthenticated'](),controller[_0x3bee('0x13')]);router[_0x3bee('0x10')](_0x3bee('0x14'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x15')]);router['delete']('/:id',auth[_0x3bee('0x7')](),controller['destroy']);module[_0x3bee('0x16')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 97cda83..f7e72d1 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 _0xd301=['rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER','ENUM'];(function(_0x7457fe,_0x564a5e){var _0x57a6e4=function(_0x566577){while(--_0x566577){_0x7457fe['push'](_0x7457fe['shift']());}};_0x57a6e4(++_0x564a5e);}(_0xd301,0x145));var _0x1d30=function(_0x34365b,_0x418c5a){_0x34365b=_0x34365b-0x0;var _0x12d73a=_0xd301[_0x34365b];return _0x12d73a;};'use strict';var Sequelize=require(_0x1d30('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1d30('0x1')]},'timeout':{'type':Sequelize[_0x1d30('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1d30('0x3')](_0x1d30('0x4'),_0x1d30('0x5'),_0x1d30('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x1d30('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x20e0=['beepall','roundrobin','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x354635,_0x1a8e2a){var _0x27e1e2=function(_0x1ebd35){while(--_0x1ebd35){_0x354635['push'](_0x354635['shift']());}};_0x27e1e2(++_0x1a8e2a);}(_0x20e0,0xc6));var _0x020e=function(_0x39424b,_0x9531ca){_0x39424b=_0x39424b-0x0;var _0x545cf0=_0x20e0[_0x39424b];return _0x545cf0;};'use strict';var Sequelize=require('sequelize');module[_0x020e('0x0')]={'name':{'type':Sequelize[_0x020e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x020e('0x1')]},'timeout':{'type':Sequelize[_0x020e('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x020e('0x3')](_0x020e('0x4'),_0x020e('0x5'),_0x020e('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x020e('0x2')],'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 c7e2c76..88db796 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 _0x0df3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','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','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','get','FaxQueues','UserProfileResource','destroy','error','name','send','index','map','FaxQueue','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','findAll','User','UserId','faxPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','removeTeams','select','field','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','emit','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0df3,0x88));var _0x30df=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x0df3[_0x2f3ecd];return _0xffdc44;};'use strict';var emlformat=require(_0x30df('0x0'));var rimraf=require(_0x30df('0x1'));var zipdir=require(_0x30df('0x2'));var jsonpatch=require(_0x30df('0x3'));var rp=require(_0x30df('0x4'));var moment=require(_0x30df('0x5'));var BPromise=require(_0x30df('0x6'));var Mustache=require(_0x30df('0x7'));var util=require(_0x30df('0x8'));var path=require('path');var sox=require(_0x30df('0x9'));var csv=require(_0x30df('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30df('0xb'));var squel=require(_0x30df('0xc'));var crypto=require(_0x30df('0xd'));var jsforce=require(_0x30df('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x30df('0xf'));var Papa=require(_0x30df('0x10'));var Redis=require(_0x30df('0x11'));var authService=require(_0x30df('0x12'));var qs=require(_0x30df('0x13'));var as=require(_0x30df('0x14'));var hardwareService=require(_0x30df('0x15'));var logger=require(_0x30df('0x16'))(_0x30df('0x17'));var utils=require(_0x30df('0x18'));var config=require(_0x30df('0x19'));var licenseUtil=require(_0x30df('0x1a'));var db=require(_0x30df('0x1b'))['db'];config[_0x30df('0x1c')]=_[_0x30df('0x1d')](config[_0x30df('0x1c')],{'host':_0x30df('0x1e'),'port':0x18eb});var socket=require(_0x30df('0x1f'))(new Redis(config['redis']));require(_0x30df('0x20'))['register'](socket);function respondWithStatusCode(_0x39226b,_0x44fb31){_0x44fb31=_0x44fb31||0xcc;return function(_0x4a0966){if(_0x4a0966){return _0x39226b[_0x30df('0x21')](_0x44fb31);}return _0x39226b[_0x30df('0x22')](_0x44fb31)[_0x30df('0x23')]();};}function respondWithResult(_0x5e865b,_0x450c4c){_0x450c4c=_0x450c4c||0xc8;return function(_0x475cf4){if(_0x475cf4){return _0x5e865b[_0x30df('0x22')](_0x450c4c)[_0x30df('0x24')](_0x475cf4);}};}function respondWithFilteredResult(_0x1ef31a,_0x3496e7){return function(_0x29324b){if(_0x29324b){var _0xc3acb3=typeof _0x3496e7[_0x30df('0x25')]===_0x30df('0x26')&&typeof _0x3496e7[_0x30df('0x27')]==='undefined';var _0x4f8143=_0x29324b[_0x30df('0x28')];var _0x174917=_0xc3acb3?0x0:_0x3496e7['offset'];var _0x2894d5=_0xc3acb3?_0x29324b[_0x30df('0x28')]:_0x3496e7[_0x30df('0x25')]+_0x3496e7[_0x30df('0x27')];var _0x30fe23;if(_0x2894d5>=_0x4f8143){_0x2894d5=_0x4f8143;_0x30fe23=0xc8;}else{_0x30fe23=0xce;}_0x1ef31a['status'](_0x30fe23);return _0x1ef31a[_0x30df('0x29')]('Content-Range',_0x174917+'-'+_0x2894d5+'/'+_0x4f8143)[_0x30df('0x24')](_0x29324b);}return null;};}function patchUpdates(_0x224263){return function(_0x484cdf){try{jsonpatch[_0x30df('0x2a')](_0x484cdf,_0x224263,!![]);}catch(_0x472870){return BPromise['reject'](_0x472870);}return _0x484cdf[_0x30df('0x2b')]();};}function saveUpdates(_0x5373ab,_0x3cf783){return function(_0x1eb8af){if(_0x1eb8af){return _0x1eb8af[_0x30df('0x2c')](_0x5373ab)[_0x30df('0x2d')](function(_0x368bf2){return _0x368bf2;});}return null;};}function removeEntity(_0x222c67,_0x17ad28){return function(_0xf5877e){if(_0xf5877e){return _0xf5877e['destroy']()[_0x30df('0x2d')](function(){var _0x42ae57=_0xf5877e[_0x30df('0x2e')]({'plain':!![]});var _0x14a213=_0x30df('0x2f');return db[_0x30df('0x30')][_0x30df('0x31')]({'where':{'type':_0x14a213,'resourceId':_0x42ae57['id']}})[_0x30df('0x2d')](function(){return _0xf5877e;});})[_0x30df('0x2d')](function(){_0x222c67[_0x30df('0x22')](0xcc)[_0x30df('0x23')]();});}};}function handleEntityNotFound(_0x24d9ca,_0x4bb0aa){return function(_0x3e59a9){if(!_0x3e59a9){_0x24d9ca['sendStatus'](0x194);}return _0x3e59a9;};}function handleError(_0x3726e6,_0xa82c5a){_0xa82c5a=_0xa82c5a||0x1f4;return function(_0x411b1d){logger[_0x30df('0x32')](_0x411b1d['stack']);if(_0x411b1d[_0x30df('0x33')]){delete _0x411b1d[_0x30df('0x33')];}_0x3726e6['status'](_0xa82c5a)[_0x30df('0x34')](_0x411b1d);};}exports[_0x30df('0x35')]=function(_0x43bebb,_0x76bce8){var _0xb7f369={},_0x8dbf8={},_0x4f29b1={'count':0x0,'rows':[]};var _0x3183be=_[_0x30df('0x36')](db[_0x30df('0x37')][_0x30df('0x38')],function(_0x4b7911){return{'name':_0x4b7911['fieldName'],'type':_0x4b7911[_0x30df('0x39')]['key']};});_0x8dbf8[_0x30df('0x3a')]=_['map'](_0x3183be,_0x30df('0x33'));_0x8dbf8[_0x30df('0x3b')]=_[_0x30df('0x3c')](_0x43bebb[_0x30df('0x3b')]);_0x8dbf8[_0x30df('0x3d')]=_['intersection'](_0x8dbf8['model'],_0x8dbf8['query']);_0xb7f369[_0x30df('0x3e')]=_[_0x30df('0x3f')](_0x8dbf8['model'],qs['fields'](_0x43bebb[_0x30df('0x3b')][_0x30df('0x40')]));_0xb7f369[_0x30df('0x3e')]=_0xb7f369[_0x30df('0x3e')]['length']?_0xb7f369[_0x30df('0x3e')]:_0x8dbf8[_0x30df('0x3a')];if(!_0x43bebb[_0x30df('0x3b')]['hasOwnProperty'](_0x30df('0x41'))){_0xb7f369[_0x30df('0x27')]=qs[_0x30df('0x27')](_0x43bebb[_0x30df('0x3b')][_0x30df('0x27')]);_0xb7f369[_0x30df('0x25')]=qs[_0x30df('0x25')](_0x43bebb['query']['offset']);}_0xb7f369[_0x30df('0x42')]=qs[_0x30df('0x43')](_0x43bebb[_0x30df('0x3b')][_0x30df('0x43')]);_0xb7f369[_0x30df('0x44')]=qs[_0x30df('0x3d')](_[_0x30df('0x45')](_0x43bebb[_0x30df('0x3b')],_0x8dbf8[_0x30df('0x3d')]),_0x3183be);if(_0x43bebb[_0x30df('0x3b')][_0x30df('0x46')]){_0xb7f369[_0x30df('0x44')]=_[_0x30df('0x47')](_0xb7f369[_0x30df('0x44')],{'$or':_['map'](_0x3183be,function(_0x48e7f5){if(_0x48e7f5[_0x30df('0x39')]!==_0x30df('0x48')){var _0x66b570={};_0x66b570[_0x48e7f5[_0x30df('0x33')]]={'$like':'%'+_0x43bebb['query'][_0x30df('0x46')]+'%'};return _0x66b570;}})});}_0xb7f369=_['merge']({},_0xb7f369,_0x43bebb[_0x30df('0x49')]);var _0x500ab6={'where':_0xb7f369['where']};return db['FaxQueue']['count'](_0x500ab6)[_0x30df('0x2d')](function(_0x192fe0){_0x4f29b1['count']=_0x192fe0;if(_0x43bebb['query']['includeAll']){_0xb7f369['include']=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0xb7f369);})[_0x30df('0x2d')](function(_0x11c022){_0x4f29b1[_0x30df('0x4a')]=_0x11c022;return _0x4f29b1;})['then'](respondWithFilteredResult(_0x76bce8,_0xb7f369))[_0x30df('0x4b')](handleError(_0x76bce8,null));};exports[_0x30df('0x4c')]=function(_0x4b415b,_0x312fbd){var _0x53a91d={'raw':!![],'where':{'id':_0x4b415b[_0x30df('0x4d')]['id']}},_0x47a3bc={};_0x47a3bc[_0x30df('0x3a')]=_[_0x30df('0x3c')](db[_0x30df('0x37')][_0x30df('0x38')]);_0x47a3bc['query']=_[_0x30df('0x3c')](_0x4b415b[_0x30df('0x3b')]);_0x47a3bc[_0x30df('0x3d')]=_[_0x30df('0x3f')](_0x47a3bc[_0x30df('0x3a')],_0x47a3bc[_0x30df('0x3b')]);_0x53a91d['attributes']=_[_0x30df('0x3f')](_0x47a3bc[_0x30df('0x3a')],qs[_0x30df('0x40')](_0x4b415b[_0x30df('0x3b')][_0x30df('0x40')]));_0x53a91d[_0x30df('0x3e')]=_0x53a91d[_0x30df('0x3e')][_0x30df('0x4e')]?_0x53a91d[_0x30df('0x3e')]:_0x47a3bc[_0x30df('0x3a')];if(_0x4b415b[_0x30df('0x3b')][_0x30df('0x4f')]){_0x53a91d['include']=[{'all':!![]}];}_0x53a91d=_[_0x30df('0x47')]({},_0x53a91d,_0x4b415b[_0x30df('0x49')]);return db[_0x30df('0x37')][_0x30df('0x50')](_0x53a91d)['then'](handleEntityNotFound(_0x312fbd,null))[_0x30df('0x2d')](respondWithResult(_0x312fbd,null))[_0x30df('0x4b')](handleError(_0x312fbd,null));};exports[_0x30df('0x51')]=function(_0x3a1138,_0x1f772d){return db['FaxQueue']['create'](_0x3a1138[_0x30df('0x52')],{})[_0x30df('0x2d')](function(_0x5e36e8){var _0x2a9f1f=_0x3a1138[_0x30df('0x53')][_0x30df('0x2e')]({'plain':!![]});if(!_0x2a9f1f)throw new Error(_0x30df('0x54'));if(_0x2a9f1f[_0x30df('0x55')]===_0x30df('0x53')){var _0x4cefb7=_0x5e36e8[_0x30df('0x2e')]({'plain':!![]});var _0x3630ee='FaxQueues';return db['UserProfileSection'][_0x30df('0x50')]({'where':{'name':_0x3630ee,'userProfileId':_0x2a9f1f['userProfileId']},'raw':!![]})['then'](function(_0x173ea4){if(_0x173ea4&&_0x173ea4[_0x30df('0x56')]===0x0){return db[_0x30df('0x30')][_0x30df('0x51')]({'name':_0x4cefb7['name'],'resourceId':_0x4cefb7['id'],'type':_0x173ea4[_0x30df('0x33')],'sectionId':_0x173ea4['id']},{})[_0x30df('0x2d')](function(){return _0x5e36e8;});}else{return _0x5e36e8;}})[_0x30df('0x4b')](function(_0x45cfdd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45cfdd);throw _0x45cfdd;});}return _0x5e36e8;})[_0x30df('0x2d')](respondWithResult(_0x1f772d,0xc9))['catch'](handleError(_0x1f772d,null));};exports[_0x30df('0x2c')]=function(_0x539703,_0x340dc0){if(_0x539703['body']['id']){delete _0x539703[_0x30df('0x52')]['id'];}return db[_0x30df('0x37')][_0x30df('0x50')]({'where':{'id':_0x539703[_0x30df('0x4d')]['id']}})['then'](handleEntityNotFound(_0x340dc0,null))[_0x30df('0x2d')](saveUpdates(_0x539703[_0x30df('0x52')],null))[_0x30df('0x2d')](respondWithResult(_0x340dc0,null))['catch'](handleError(_0x340dc0,null));};exports[_0x30df('0x31')]=function(_0x445c69,_0x36bbe0){return db[_0x30df('0x37')][_0x30df('0x50')]({'where':{'id':_0x445c69['params']['id']}})[_0x30df('0x2d')](handleEntityNotFound(_0x36bbe0,null))[_0x30df('0x2d')](removeEntity(_0x36bbe0,null))[_0x30df('0x4b')](handleError(_0x36bbe0,null));};exports[_0x30df('0x57')]=function(_0x49706f,_0x293d8b){return db[_0x30df('0x37')][_0x30df('0x57')]()[_0x30df('0x2d')](respondWithResult(_0x293d8b,null))[_0x30df('0x4b')](handleError(_0x293d8b,null));};exports[_0x30df('0x58')]=function(_0x146b1d,_0x3e967d,_0x30f06b){var _0x1ea8c3={'raw':!![],'where':{}},_0x3cf246={},_0x1a44cd;return db['FaxQueue'][_0x30df('0x59')]({'where':{'id':_0x146b1d[_0x30df('0x4d')]['id']}})[_0x30df('0x2d')](handleEntityNotFound(_0x3e967d,null))['then'](function(_0x5c1dc4){if(_0x5c1dc4){_0x1a44cd=_0x5c1dc4[_0x30df('0x2e')]({'plain':!![]});_0x3cf246[_0x30df('0x3a')]=_[_0x30df('0x3c')](db[_0x30df('0x5a')][_0x30df('0x38')]);_0x3cf246[_0x30df('0x3b')]=_['keys'](_0x146b1d[_0x30df('0x3b')]);_0x3cf246['filters']=_[_0x30df('0x3f')](_0x3cf246[_0x30df('0x3a')],_0x3cf246[_0x30df('0x3b')]);_0x1ea8c3[_0x30df('0x3e')]=_['intersection'](_0x3cf246[_0x30df('0x3a')],qs['fields'](_0x146b1d[_0x30df('0x3b')][_0x30df('0x40')]));_0x1ea8c3[_0x30df('0x3e')]=_0x1ea8c3[_0x30df('0x3e')][_0x30df('0x4e')]?_0x1ea8c3[_0x30df('0x3e')]:_0x3cf246[_0x30df('0x3a')];if(!_0x146b1d[_0x30df('0x3b')][_0x30df('0x5b')](_0x30df('0x41'))){_0x1ea8c3[_0x30df('0x27')]=qs['limit'](_0x146b1d[_0x30df('0x3b')][_0x30df('0x27')]);_0x1ea8c3['offset']=qs[_0x30df('0x25')](_0x146b1d[_0x30df('0x3b')]['offset']);}_0x1ea8c3[_0x30df('0x42')]=qs['sort'](_0x146b1d[_0x30df('0x3b')][_0x30df('0x43')]);_0x1ea8c3['where']=qs[_0x30df('0x3d')](_[_0x30df('0x45')](_0x146b1d[_0x30df('0x3b')],_0x3cf246[_0x30df('0x3d')]));_0x1ea8c3[_0x30df('0x44')]['FaxQueueId']=_0x5c1dc4['id'];if(_0x146b1d[_0x30df('0x3b')][_0x30df('0x46')]){_0x1ea8c3['where']=_[_0x30df('0x47')](_0x1ea8c3[_0x30df('0x44')],{'$or':_[_0x30df('0x36')](_0x1ea8c3[_0x30df('0x3e')],function(_0x2a1d14){var _0x30019b={};_0x30019b[_0x2a1d14]={'$like':'%'+_0x146b1d[_0x30df('0x3b')][_0x30df('0x46')]+'%'};return _0x30019b;})});}_0x1ea8c3=_[_0x30df('0x47')]({},_0x1ea8c3,_0x146b1d[_0x30df('0x49')]);return db[_0x30df('0x5a')][_0x30df('0x5c')](_0x1ea8c3);}})[_0x30df('0x2d')](function(_0x57ed68){if(_0x57ed68){return db[_0x30df('0x5d')]['findAndCountAll']({'where':{'id':_[_0x30df('0x36')](_0x57ed68,_0x30df('0x5e')),'role':'agent'},'attributes':['id','name',_0x30df('0x5f'),_0x30df('0x60'),_0x30df('0x61')]});}})[_0x30df('0x2d')](function(_0x1d98ce){if(_0x1d98ce){return{'count':_0x1d98ce[_0x30df('0x28')],'rows':_[_0x30df('0x36')](_0x1d98ce[_0x30df('0x4a')],function(_0x58fbd7){return{'membername':_0x58fbd7[_0x30df('0x33')],'UserId':_0x58fbd7['id'],'queue_name':_0x1a44cd[_0x30df('0x33')],'FaxQueueId':_0x1a44cd['id'],'interface':util['format']('%s/%s',_0x30df('0x62'),_0x58fbd7[_0x30df('0x33')]),'penalty':0x0,'paused':_0x58fbd7['faxPause'],'createdAt':_0x58fbd7[_0x30df('0x61')],'updatedAt':_0x58fbd7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x30df('0x2d')](respondWithFilteredResult(_0x3e967d,_0x1ea8c3))[_0x30df('0x4b')](handleError(_0x3e967d,null));};exports[_0x30df('0x63')]=function(_0x4266a0,_0x408b2b,_0x4e559e){var _0x53632a={};var _0x549be2={};var _0x18e5ac;var _0x4d5e55;return db['FaxQueue'][_0x30df('0x59')]({'where':{'id':_0x4266a0[_0x30df('0x4d')]['id']}})[_0x30df('0x2d')](handleEntityNotFound(_0x408b2b,null))['then'](function(_0x27275e){if(_0x27275e){_0x18e5ac=_0x27275e;_0x549be2[_0x30df('0x3a')]=_['keys'](db[_0x30df('0x64')][_0x30df('0x38')]);_0x549be2['query']=_[_0x30df('0x3c')](_0x4266a0[_0x30df('0x3b')]);_0x549be2[_0x30df('0x3d')]=_['intersection'](_0x549be2[_0x30df('0x3a')],_0x549be2[_0x30df('0x3b')]);_0x53632a[_0x30df('0x3e')]=_[_0x30df('0x3f')](_0x549be2[_0x30df('0x3a')],qs['fields'](_0x4266a0[_0x30df('0x3b')]['fields']));_0x53632a['attributes']=_0x53632a[_0x30df('0x3e')][_0x30df('0x4e')]?_0x53632a[_0x30df('0x3e')]:_0x549be2[_0x30df('0x3a')];_0x53632a[_0x30df('0x42')]=qs[_0x30df('0x43')](_0x4266a0[_0x30df('0x3b')][_0x30df('0x43')]);_0x53632a[_0x30df('0x44')]=qs[_0x30df('0x3d')](_[_0x30df('0x45')](_0x4266a0[_0x30df('0x3b')],_0x549be2[_0x30df('0x3d')]));if(_0x4266a0[_0x30df('0x3b')][_0x30df('0x46')]){_0x53632a['where']=_['merge'](_0x53632a[_0x30df('0x44')],{'$or':_['map'](_0x53632a[_0x30df('0x3e')],function(_0x1cc122){var _0x5bde30={};_0x5bde30[_0x1cc122]={'$like':'%'+_0x4266a0[_0x30df('0x3b')][_0x30df('0x46')]+'%'};return _0x5bde30;})});}_0x53632a=_[_0x30df('0x47')]({},_0x53632a,_0x4266a0[_0x30df('0x49')]);return _0x18e5ac['getTeams'](_0x53632a);}})[_0x30df('0x2d')](function(_0x3dd034){if(_0x3dd034){_0x4d5e55=_0x3dd034[_0x30df('0x4e')];if(!_0x4266a0[_0x30df('0x3b')][_0x30df('0x5b')](_0x30df('0x41'))){_0x53632a[_0x30df('0x27')]=qs['limit'](_0x4266a0[_0x30df('0x3b')][_0x30df('0x27')]);_0x53632a[_0x30df('0x25')]=qs[_0x30df('0x25')](_0x4266a0[_0x30df('0x3b')][_0x30df('0x25')]);}return _0x18e5ac['getTeams'](_0x53632a);}})[_0x30df('0x2d')](function(_0x3f1a40){if(_0x3f1a40){return _0x3f1a40?{'count':_0x4d5e55,'rows':_0x3f1a40}:null;}})['then'](respondWithResult(_0x408b2b,null))[_0x30df('0x4b')](handleError(_0x408b2b,null));};exports[_0x30df('0x65')]=function(_0x4bf0ee,_0x26638f,_0x252286){var _0x4004fd=_0x4bf0ee[_0x30df('0x52')][_0x30df('0x66')];return db['Team'][_0x30df('0x5c')]({'where':{'id':_0x4004fd},'attributes':['id'],'include':[{'model':db[_0x30df('0x5d')],'as':_0x30df('0x67'),'attributes':['id','name','online',_0x30df('0x68'),_0x30df('0x69')],'raw':!![]}]})[_0x30df('0x2d')](function(_0x280580){if(_0x280580){var _0xe2107a=_[_0x30df('0x6a')](_0x280580,function(_0x23931b){var _0x354d8c=_0x23931b[_0x30df('0x2e')]({'plain':!![]});return _0x354d8c[_0x30df('0x67')];});return db[_0x30df('0x37')][_0x30df('0x50')]({'where':{'id':_0x4bf0ee[_0x30df('0x4d')]['id']}})[_0x30df('0x2d')](function(_0x4f72b4){return db[_0x30df('0x6b')][_0x30df('0x6c')](function(_0xc50a32){return _0x4f72b4[_0x30df('0x65')](_0x4004fd,{'transaction':_0xc50a32})[_0x30df('0x2d')](function(){return BPromise[_0x30df('0x6d')](_0xe2107a,function(_0x5ceed3){return db[_0x30df('0x5a')][_0x30df('0x6e')]({'where':{'UserId':_0x5ceed3['id'],'FaxQueueId':_0x4bf0ee[_0x30df('0x4d')]['id']},'transaction':_0xc50a32});});})[_0x30df('0x2d')](function(){_0xe2107a['forEach'](function(_0x649c58){socket['emit']('userFaxQueue:save',{'UserId':_0x649c58['id'],'FaxQueueId':_0x4f72b4['id']});});});});});}})['then'](respondWithStatusCode(_0x26638f,null))[_0x30df('0x4b')](handleError(_0x26638f,null));};exports[_0x30df('0x6f')]=function(_0x3d051d,_0x4abba6,_0x583d60){return db['Team'][_0x30df('0x5c')]({'where':{'id':_0x3d051d[_0x30df('0x3b')][_0x30df('0x66')]},'attributes':['id'],'include':[{'model':db[_0x30df('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x30df('0x2d')](handleEntityNotFound(_0x4abba6,null))['then'](function(_0x14c0a9){var _0x508f7a=_[_0x30df('0x36')](_0x14c0a9,'id');var _0x16eb06=[];var _0x1a6663=[];var _0x462f75=squel[_0x30df('0x70')]();_0x462f75[_0x30df('0x71')](_0x30df('0x72'))['from'](_0x30df('0x73'),'tq')['join'](_0x30df('0x74'),'ut',_0x30df('0x75'))['where'](_0x30df('0x76'),_0x3d051d[_0x30df('0x4d')]['id']);for(var _0x1b7d24=0x0;_0x1b7d24<_0x14c0a9[_0x30df('0x4e')];_0x1b7d24+=0x1){let _0xd949f6=_0x14c0a9[_0x1b7d24];for(var _0xdfea1f=0x0;_0xdfea1f<_0xd949f6[_0x30df('0x67')]['length'];_0xdfea1f+=0x1){let _0x19565f=_0xd949f6[_0x30df('0x67')][_0xdfea1f];var _0x275f27=_0x462f75[_0x30df('0x77')]();_0x275f27[_0x30df('0x44')](_0x30df('0x78'),_0x19565f['id']);_0x1a6663[_0x30df('0x79')](db[_0x30df('0x6b')][_0x30df('0x3b')](_0x275f27[_0x30df('0x7a')](),{'type':db[_0x30df('0x6b')]['QueryTypes']['SELECT']})[_0x30df('0x2d')](function(_0x479b31){if(_0x479b31[_0x30df('0x4e')]===0x1){return _0x19565f['id'];}else{var _0x578e3a=_[_0x30df('0x7b')](_[_0x30df('0x36')](_0x479b31,_0x30df('0x7c')),function(_0x1f1af6){return _[_0x30df('0x7d')](_0x508f7a,_0x1f1af6);});if(_0x578e3a){return _0x19565f['id'];}}}));}}return BPromise['all'](_0x1a6663)['then'](function(_0x5684b8){_0x16eb06=_(_0x16eb06)[_0x30df('0x7e')](_0x5684b8)[_0x30df('0x7f')]()[_0x30df('0x80')]();return db[_0x30df('0x37')][_0x30df('0x50')]({'where':{'id':_0x3d051d[_0x30df('0x4d')]['id']}})[_0x30df('0x2d')](function(_0x3f6681){return db[_0x30df('0x6b')][_0x30df('0x6c')](function(_0x53c2ac){return _0x3f6681['removeTeams'](_0x3d051d[_0x30df('0x3b')][_0x30df('0x66')],{'transaction':_0x53c2ac})['then'](function(){if(!_[_0x30df('0x81')](_0x16eb06)){return _0x3f6681[_0x30df('0x82')](_0x16eb06,{'transaction':_0x53c2ac});}})[_0x30df('0x2d')](function(){_0x16eb06[_0x30df('0x83')](function(_0x1b4a17){socket[_0x30df('0x84')]('userFaxQueue:remove',{'UserId':_0x1b4a17,'FaxQueueId':_0x3f6681['id']});});});});});});})[_0x30df('0x2d')](respondWithStatusCode(_0x4abba6,null))[_0x30df('0x4b')](handleError(_0x4abba6,null));};exports['addAgents']=function(_0x50e799,_0x4e9024,_0x281d48){return db['FaxQueue'][_0x30df('0x50')]({'where':{'id':_0x50e799['params']['id']}})[_0x30df('0x2d')](handleEntityNotFound(_0x4e9024,null))[_0x30df('0x2d')](function(_0x1a03d4){if(_0x1a03d4){return _0x1a03d4[_0x30df('0x85')](_0x50e799['body'][_0x30df('0x66')],_['omit'](_0x50e799[_0x30df('0x52')],[_0x30df('0x66'),'id'])||{})[_0x30df('0x86')](function(_0x2868d1){for(var _0x58e803=0x0;_0x58e803<_0x50e799[_0x30df('0x52')][_0x30df('0x66')][_0x30df('0x4e')];_0x58e803+=0x1){socket[_0x30df('0x84')]('userFaxQueue:save',{'UserId':Number(_0x50e799[_0x30df('0x52')][_0x30df('0x66')][_0x58e803]),'FaxQueueId':Number(_0x50e799['params']['id'])});}return _0x2868d1;});}})['then'](respondWithResult(_0x4e9024,null))[_0x30df('0x4b')](handleError(_0x4e9024,null));};exports[_0x30df('0x82')]=function(_0x3c5556,_0x413693,_0x24cdc7){return db[_0x30df('0x37')][_0x30df('0x50')]({'where':{'id':_0x3c5556['params']['id']}})[_0x30df('0x2d')](handleEntityNotFound(_0x413693,null))[_0x30df('0x2d')](function(_0xb79f34){if(_0xb79f34){return _0xb79f34[_0x30df('0x82')](_0x3c5556[_0x30df('0x3b')][_0x30df('0x66')])[_0x30df('0x2d')](function(){if(_[_0x30df('0x87')](_0x3c5556[_0x30df('0x3b')]['ids'])){for(var _0x10f976=0x0;_0x10f976<_0x3c5556['query'][_0x30df('0x66')]['length'];_0x10f976+=0x1){socket[_0x30df('0x84')](_0x30df('0x88'),{'UserId':Number(_0x3c5556['query'][_0x30df('0x66')][_0x10f976]),'FaxQueueId':Number(_0x3c5556[_0x30df('0x4d')]['id'])});}}else{socket[_0x30df('0x84')](_0x30df('0x88'),{'UserId':Number(_0x3c5556[_0x30df('0x3b')][_0x30df('0x66')]),'FaxQueueId':Number(_0x3c5556[_0x30df('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x413693,null))[_0x30df('0x4b')](handleError(_0x413693,null));};exports['getAgents']=function(_0x1e1d38,_0x487464,_0x1d9aa3){var _0x3ce214={};var _0x4457d2={};var _0x28d213;var _0x2faa4b;return db[_0x30df('0x37')][_0x30df('0x59')]({'where':{'id':_0x1e1d38[_0x30df('0x4d')]['id']}})['then'](handleEntityNotFound(_0x487464,null))[_0x30df('0x2d')](function(_0x4e2951){if(_0x4e2951){_0x28d213=_0x4e2951;_0x4457d2[_0x30df('0x3a')]=_[_0x30df('0x3c')](db[_0x30df('0x5d')][_0x30df('0x38')]);_0x4457d2['query']=_[_0x30df('0x3c')](_0x1e1d38[_0x30df('0x3b')]);_0x4457d2[_0x30df('0x3d')]=_[_0x30df('0x3f')](_0x4457d2[_0x30df('0x3a')],_0x4457d2['query']);_0x3ce214[_0x30df('0x3e')]=_[_0x30df('0x3f')](_0x4457d2[_0x30df('0x3a')],qs['fields'](_0x1e1d38[_0x30df('0x3b')][_0x30df('0x40')]));_0x3ce214['attributes']=_0x3ce214['attributes']['length']?_0x3ce214[_0x30df('0x3e')]:_0x4457d2['model'];_0x3ce214['order']=qs[_0x30df('0x43')](_0x1e1d38['query'][_0x30df('0x43')]);_0x3ce214[_0x30df('0x44')]=qs[_0x30df('0x3d')](_['pick'](_0x1e1d38[_0x30df('0x3b')],_0x4457d2['filters']));if(_0x1e1d38['query'][_0x30df('0x46')]){_0x3ce214['where']=_[_0x30df('0x47')](_0x3ce214[_0x30df('0x44')],{'$or':_[_0x30df('0x36')](_0x3ce214[_0x30df('0x3e')],function(_0x3580b7){var _0x1a9c31={};_0x1a9c31[_0x3580b7]={'$like':'%'+_0x1e1d38[_0x30df('0x3b')][_0x30df('0x46')]+'%'};return _0x1a9c31;})});}_0x3ce214=_[_0x30df('0x47')]({},_0x3ce214,_0x1e1d38[_0x30df('0x49')]);return _0x28d213[_0x30df('0x89')](_0x3ce214);}})[_0x30df('0x2d')](function(_0x105d55){if(_0x105d55){_0x2faa4b=_0x105d55[_0x30df('0x4e')];if(!_0x1e1d38[_0x30df('0x3b')][_0x30df('0x5b')]('nolimit')){_0x3ce214[_0x30df('0x27')]=qs[_0x30df('0x27')](_0x1e1d38[_0x30df('0x3b')]['limit']);_0x3ce214['offset']=qs['offset'](_0x1e1d38[_0x30df('0x3b')][_0x30df('0x25')]);}return _0x28d213[_0x30df('0x89')](_0x3ce214);}})['then'](function(_0x4759f1){if(_0x4759f1){return _0x4759f1?{'count':_0x2faa4b,'rows':_0x4759f1}:null;}})['then'](respondWithResult(_0x487464,null))['catch'](handleError(_0x487464,null));}; \ No newline at end of file +var _0x2a25=['userFaxQueue:save','removeTeams','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','order','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','get','FaxQueues','error','stack','name','send','index','FaxQueue','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','map','VIRTUAL','merge','include','findAll','rows','catch','params','rawAttributes','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','pick','FaxQueueId','User','UserId','agent','createdAt','%s/%s','SIP','updatedAt','Team','getTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','UserFaxQueue','forEach','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a25,0xa4));var _0x52a2=function(_0xe71be4,_0x2bd1e9){_0xe71be4=_0xe71be4-0x0;var _0xf5aaee=_0x2a25[_0xe71be4];return _0xf5aaee;};'use strict';var emlformat=require(_0x52a2('0x0'));var rimraf=require(_0x52a2('0x1'));var zipdir=require(_0x52a2('0x2'));var jsonpatch=require(_0x52a2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x52a2('0x4'));var Mustache=require('mustache');var util=require(_0x52a2('0x5'));var path=require(_0x52a2('0x6'));var sox=require('sox');var csv=require(_0x52a2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x52a2('0x8'));var _=require(_0x52a2('0x9'));var squel=require(_0x52a2('0xa'));var crypto=require(_0x52a2('0xb'));var jsforce=require(_0x52a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x52a2('0x7'));var querystring=require('querystring');var Papa=require(_0x52a2('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x52a2('0xe'));var as=require(_0x52a2('0xf'));var hardwareService=require(_0x52a2('0x10'));var logger=require('../../config/logger')(_0x52a2('0x11'));var utils=require('../../config/utils');var config=require(_0x52a2('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x52a2('0x13')](config[_0x52a2('0x14')],{'host':_0x52a2('0x15'),'port':0x18eb});var socket=require(_0x52a2('0x16'))(new Redis(config['redis']));require(_0x52a2('0x17'))[_0x52a2('0x18')](socket);function respondWithStatusCode(_0x6f54d0,_0x1eadbf){_0x1eadbf=_0x1eadbf||0xcc;return function(_0x2ebbac){if(_0x2ebbac){return _0x6f54d0[_0x52a2('0x19')](_0x1eadbf);}return _0x6f54d0['status'](_0x1eadbf)[_0x52a2('0x1a')]();};}function respondWithResult(_0x2b390f,_0x111eb9){_0x111eb9=_0x111eb9||0xc8;return function(_0x2ef556){if(_0x2ef556){return _0x2b390f[_0x52a2('0x1b')](_0x111eb9)[_0x52a2('0x1c')](_0x2ef556);}};}function respondWithFilteredResult(_0x31d7e9,_0x395fdb){return function(_0x522460){if(_0x522460){var _0xafc26e=typeof _0x395fdb[_0x52a2('0x1d')]===_0x52a2('0x1e')&&typeof _0x395fdb[_0x52a2('0x1f')]===_0x52a2('0x1e');var _0x5dc669=_0x522460[_0x52a2('0x20')];var _0x18e086=_0xafc26e?0x0:_0x395fdb[_0x52a2('0x1d')];var _0x3c4a6f=_0xafc26e?_0x522460[_0x52a2('0x20')]:_0x395fdb[_0x52a2('0x1d')]+_0x395fdb[_0x52a2('0x1f')];var _0x4eb2e2;if(_0x3c4a6f>=_0x5dc669){_0x3c4a6f=_0x5dc669;_0x4eb2e2=0xc8;}else{_0x4eb2e2=0xce;}_0x31d7e9[_0x52a2('0x1b')](_0x4eb2e2);return _0x31d7e9['set'](_0x52a2('0x21'),_0x18e086+'-'+_0x3c4a6f+'/'+_0x5dc669)[_0x52a2('0x1c')](_0x522460);}return null;};}function patchUpdates(_0x1855a5){return function(_0x17e00c){try{jsonpatch['apply'](_0x17e00c,_0x1855a5,!![]);}catch(_0x22bef4){return BPromise[_0x52a2('0x22')](_0x22bef4);}return _0x17e00c[_0x52a2('0x23')]();};}function saveUpdates(_0x3537ed,_0x18ae1c){return function(_0x1f987d){if(_0x1f987d){return _0x1f987d[_0x52a2('0x24')](_0x3537ed)[_0x52a2('0x25')](function(_0x4d6931){return _0x4d6931;});}return null;};}function removeEntity(_0xa3e4f0,_0x3d363e){return function(_0x546a4e){if(_0x546a4e){return _0x546a4e['destroy']()[_0x52a2('0x25')](function(){var _0x391a6c=_0x546a4e[_0x52a2('0x26')]({'plain':!![]});var _0x523742=_0x52a2('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x523742,'resourceId':_0x391a6c['id']}})[_0x52a2('0x25')](function(){return _0x546a4e;});})[_0x52a2('0x25')](function(){_0xa3e4f0[_0x52a2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4964b6,_0x4ff61d){return function(_0x5ce42b){if(!_0x5ce42b){_0x4964b6[_0x52a2('0x19')](0x194);}return _0x5ce42b;};}function handleError(_0x72af5b,_0x3a287a){_0x3a287a=_0x3a287a||0x1f4;return function(_0x90b41c){logger[_0x52a2('0x28')](_0x90b41c[_0x52a2('0x29')]);if(_0x90b41c[_0x52a2('0x2a')]){delete _0x90b41c[_0x52a2('0x2a')];}_0x72af5b[_0x52a2('0x1b')](_0x3a287a)[_0x52a2('0x2b')](_0x90b41c);};}exports[_0x52a2('0x2c')]=function(_0x361e32,_0x14f8d9){var _0x40cdb3={},_0x2c2d88={},_0x5634cf={'count':0x0,'rows':[]};var _0x4bdebd=_['map'](db[_0x52a2('0x2d')]['rawAttributes'],function(_0x353dff){return{'name':_0x353dff['fieldName'],'type':_0x353dff[_0x52a2('0x2e')][_0x52a2('0x2f')]};});_0x2c2d88['model']=_['map'](_0x4bdebd,_0x52a2('0x2a'));_0x2c2d88[_0x52a2('0x30')]=_[_0x52a2('0x31')](_0x361e32[_0x52a2('0x30')]);_0x2c2d88[_0x52a2('0x32')]=_[_0x52a2('0x33')](_0x2c2d88[_0x52a2('0x34')],_0x2c2d88[_0x52a2('0x30')]);_0x40cdb3['attributes']=_[_0x52a2('0x33')](_0x2c2d88[_0x52a2('0x34')],qs[_0x52a2('0x35')](_0x361e32[_0x52a2('0x30')][_0x52a2('0x35')]));_0x40cdb3[_0x52a2('0x36')]=_0x40cdb3[_0x52a2('0x36')][_0x52a2('0x37')]?_0x40cdb3['attributes']:_0x2c2d88[_0x52a2('0x34')];if(!_0x361e32['query'][_0x52a2('0x38')](_0x52a2('0x39'))){_0x40cdb3[_0x52a2('0x1f')]=qs[_0x52a2('0x1f')](_0x361e32[_0x52a2('0x30')]['limit']);_0x40cdb3['offset']=qs['offset'](_0x361e32[_0x52a2('0x30')][_0x52a2('0x1d')]);}_0x40cdb3['order']=qs[_0x52a2('0x3a')](_0x361e32[_0x52a2('0x30')][_0x52a2('0x3a')]);_0x40cdb3[_0x52a2('0x3b')]=qs[_0x52a2('0x32')](_['pick'](_0x361e32[_0x52a2('0x30')],_0x2c2d88[_0x52a2('0x32')]),_0x4bdebd);if(_0x361e32[_0x52a2('0x30')][_0x52a2('0x3c')]){_0x40cdb3[_0x52a2('0x3b')]=_['merge'](_0x40cdb3[_0x52a2('0x3b')],{'$or':_[_0x52a2('0x3d')](_0x4bdebd,function(_0x6ed0df){if(_0x6ed0df[_0x52a2('0x2e')]!==_0x52a2('0x3e')){var _0x2cb421={};_0x2cb421[_0x6ed0df[_0x52a2('0x2a')]]={'$like':'%'+_0x361e32[_0x52a2('0x30')][_0x52a2('0x3c')]+'%'};return _0x2cb421;}})});}_0x40cdb3=_[_0x52a2('0x3f')]({},_0x40cdb3,_0x361e32['options']);var _0x320355={'where':_0x40cdb3[_0x52a2('0x3b')]};return db[_0x52a2('0x2d')][_0x52a2('0x20')](_0x320355)[_0x52a2('0x25')](function(_0x2288ec){_0x5634cf['count']=_0x2288ec;if(_0x361e32[_0x52a2('0x30')]['includeAll']){_0x40cdb3[_0x52a2('0x40')]=[{'all':!![]}];}return db[_0x52a2('0x2d')][_0x52a2('0x41')](_0x40cdb3);})[_0x52a2('0x25')](function(_0x3e6ae9){_0x5634cf[_0x52a2('0x42')]=_0x3e6ae9;return _0x5634cf;})['then'](respondWithFilteredResult(_0x14f8d9,_0x40cdb3))[_0x52a2('0x43')](handleError(_0x14f8d9,null));};exports['show']=function(_0x39e397,_0x50c490){var _0x4bfd65={'raw':!![],'where':{'id':_0x39e397[_0x52a2('0x44')]['id']}},_0x20baef={};_0x20baef[_0x52a2('0x34')]=_[_0x52a2('0x31')](db[_0x52a2('0x2d')][_0x52a2('0x45')]);_0x20baef[_0x52a2('0x30')]=_[_0x52a2('0x31')](_0x39e397['query']);_0x20baef[_0x52a2('0x32')]=_[_0x52a2('0x33')](_0x20baef['model'],_0x20baef[_0x52a2('0x30')]);_0x4bfd65['attributes']=_[_0x52a2('0x33')](_0x20baef[_0x52a2('0x34')],qs['fields'](_0x39e397['query'][_0x52a2('0x35')]));_0x4bfd65[_0x52a2('0x36')]=_0x4bfd65[_0x52a2('0x36')][_0x52a2('0x37')]?_0x4bfd65[_0x52a2('0x36')]:_0x20baef[_0x52a2('0x34')];if(_0x39e397[_0x52a2('0x30')]['includeAll']){_0x4bfd65[_0x52a2('0x40')]=[{'all':!![]}];}_0x4bfd65=_[_0x52a2('0x3f')]({},_0x4bfd65,_0x39e397[_0x52a2('0x46')]);return db[_0x52a2('0x2d')][_0x52a2('0x47')](_0x4bfd65)['then'](handleEntityNotFound(_0x50c490,null))[_0x52a2('0x25')](respondWithResult(_0x50c490,null))[_0x52a2('0x43')](handleError(_0x50c490,null));};exports[_0x52a2('0x48')]=function(_0x15ebe1,_0x15ffa8){return db[_0x52a2('0x2d')]['create'](_0x15ebe1['body'],{})[_0x52a2('0x25')](function(_0x525b61){var _0x57c700=_0x15ebe1['user']['get']({'plain':!![]});if(!_0x57c700)throw new Error(_0x52a2('0x49'));if(_0x57c700['role']===_0x52a2('0x4a')){var _0x55e3cd=_0x525b61[_0x52a2('0x26')]({'plain':!![]});var _0x5d83dd=_0x52a2('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x5d83dd,'userProfileId':_0x57c700['userProfileId']},'raw':!![]})[_0x52a2('0x25')](function(_0x2bdd21){if(_0x2bdd21&&_0x2bdd21[_0x52a2('0x4b')]===0x0){return db[_0x52a2('0x4c')][_0x52a2('0x48')]({'name':_0x55e3cd[_0x52a2('0x2a')],'resourceId':_0x55e3cd['id'],'type':_0x2bdd21[_0x52a2('0x2a')],'sectionId':_0x2bdd21['id']},{})[_0x52a2('0x25')](function(){return _0x525b61;});}else{return _0x525b61;}})['catch'](function(_0x3f2bf2){logger[_0x52a2('0x28')](_0x52a2('0x4d'),_0x3f2bf2);throw _0x3f2bf2;});}return _0x525b61;})[_0x52a2('0x25')](respondWithResult(_0x15ffa8,0xc9))['catch'](handleError(_0x15ffa8,null));};exports[_0x52a2('0x24')]=function(_0x3d5ca4,_0x698d95){if(_0x3d5ca4[_0x52a2('0x4e')]['id']){delete _0x3d5ca4[_0x52a2('0x4e')]['id'];}return db[_0x52a2('0x2d')][_0x52a2('0x47')]({'where':{'id':_0x3d5ca4[_0x52a2('0x44')]['id']}})[_0x52a2('0x25')](handleEntityNotFound(_0x698d95,null))[_0x52a2('0x25')](saveUpdates(_0x3d5ca4[_0x52a2('0x4e')],null))[_0x52a2('0x25')](respondWithResult(_0x698d95,null))['catch'](handleError(_0x698d95,null));};exports[_0x52a2('0x4f')]=function(_0x1f8bb4,_0x460fde){return db[_0x52a2('0x2d')][_0x52a2('0x47')]({'where':{'id':_0x1f8bb4[_0x52a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x460fde,null))[_0x52a2('0x25')](removeEntity(_0x460fde,null))['catch'](handleError(_0x460fde,null));};exports[_0x52a2('0x50')]=function(_0x349d45,_0xbea8d9){return db['FaxQueue'][_0x52a2('0x50')]()[_0x52a2('0x25')](respondWithResult(_0xbea8d9,null))[_0x52a2('0x43')](handleError(_0xbea8d9,null));};exports[_0x52a2('0x51')]=function(_0x5671be,_0x5832a7,_0x4f4b1b){var _0x5b776d={'raw':!![],'where':{}},_0x9c6e3c={},_0x517f99;return db[_0x52a2('0x2d')][_0x52a2('0x52')]({'where':{'id':_0x5671be[_0x52a2('0x44')]['id']}})[_0x52a2('0x25')](handleEntityNotFound(_0x5832a7,null))[_0x52a2('0x25')](function(_0x188d6e){if(_0x188d6e){_0x517f99=_0x188d6e['get']({'plain':!![]});_0x9c6e3c[_0x52a2('0x34')]=_[_0x52a2('0x31')](db['UserFaxQueue'][_0x52a2('0x45')]);_0x9c6e3c[_0x52a2('0x30')]=_['keys'](_0x5671be[_0x52a2('0x30')]);_0x9c6e3c[_0x52a2('0x32')]=_[_0x52a2('0x33')](_0x9c6e3c[_0x52a2('0x34')],_0x9c6e3c['query']);_0x5b776d[_0x52a2('0x36')]=_['intersection'](_0x9c6e3c['model'],qs[_0x52a2('0x35')](_0x5671be[_0x52a2('0x30')][_0x52a2('0x35')]));_0x5b776d[_0x52a2('0x36')]=_0x5b776d[_0x52a2('0x36')][_0x52a2('0x37')]?_0x5b776d[_0x52a2('0x36')]:_0x9c6e3c[_0x52a2('0x34')];if(!_0x5671be[_0x52a2('0x30')][_0x52a2('0x38')](_0x52a2('0x39'))){_0x5b776d['limit']=qs[_0x52a2('0x1f')](_0x5671be[_0x52a2('0x30')][_0x52a2('0x1f')]);_0x5b776d[_0x52a2('0x1d')]=qs[_0x52a2('0x1d')](_0x5671be[_0x52a2('0x30')][_0x52a2('0x1d')]);}_0x5b776d['order']=qs[_0x52a2('0x3a')](_0x5671be['query'][_0x52a2('0x3a')]);_0x5b776d[_0x52a2('0x3b')]=qs[_0x52a2('0x32')](_[_0x52a2('0x53')](_0x5671be[_0x52a2('0x30')],_0x9c6e3c['filters']));_0x5b776d[_0x52a2('0x3b')][_0x52a2('0x54')]=_0x188d6e['id'];if(_0x5671be[_0x52a2('0x30')]['filter']){_0x5b776d['where']=_['merge'](_0x5b776d[_0x52a2('0x3b')],{'$or':_['map'](_0x5b776d['attributes'],function(_0x2653b1){var _0x859986={};_0x859986[_0x2653b1]={'$like':'%'+_0x5671be[_0x52a2('0x30')][_0x52a2('0x3c')]+'%'};return _0x859986;})});}_0x5b776d=_[_0x52a2('0x3f')]({},_0x5b776d,_0x5671be[_0x52a2('0x46')]);return db['UserFaxQueue'][_0x52a2('0x41')](_0x5b776d);}})['then'](function(_0x17cd7e){if(_0x17cd7e){return db[_0x52a2('0x55')]['findAndCountAll']({'where':{'id':_['map'](_0x17cd7e,_0x52a2('0x56')),'role':_0x52a2('0x57')},'attributes':['id',_0x52a2('0x2a'),'faxPause','updatedAt',_0x52a2('0x58')]});}})['then'](function(_0x2fcf82){if(_0x2fcf82){return{'count':_0x2fcf82['count'],'rows':_['map'](_0x2fcf82['rows'],function(_0x305e66){return{'membername':_0x305e66['name'],'UserId':_0x305e66['id'],'queue_name':_0x517f99['name'],'FaxQueueId':_0x517f99['id'],'interface':util['format'](_0x52a2('0x59'),_0x52a2('0x5a'),_0x305e66[_0x52a2('0x2a')]),'penalty':0x0,'paused':_0x305e66['faxPause'],'createdAt':_0x305e66[_0x52a2('0x58')],'updatedAt':_0x305e66[_0x52a2('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x52a2('0x25')](respondWithFilteredResult(_0x5832a7,_0x5b776d))[_0x52a2('0x43')](handleError(_0x5832a7,null));};exports['getTeams']=function(_0x1a9ded,_0x35b05e,_0x215bc8){var _0x3fad3f={};var _0x1715ad={};var _0x554d7e;var _0x22d884;return db[_0x52a2('0x2d')][_0x52a2('0x52')]({'where':{'id':_0x1a9ded[_0x52a2('0x44')]['id']}})[_0x52a2('0x25')](handleEntityNotFound(_0x35b05e,null))[_0x52a2('0x25')](function(_0x4ad87e){if(_0x4ad87e){_0x554d7e=_0x4ad87e;_0x1715ad[_0x52a2('0x34')]=_[_0x52a2('0x31')](db[_0x52a2('0x5c')][_0x52a2('0x45')]);_0x1715ad[_0x52a2('0x30')]=_[_0x52a2('0x31')](_0x1a9ded[_0x52a2('0x30')]);_0x1715ad[_0x52a2('0x32')]=_[_0x52a2('0x33')](_0x1715ad[_0x52a2('0x34')],_0x1715ad['query']);_0x3fad3f[_0x52a2('0x36')]=_[_0x52a2('0x33')](_0x1715ad[_0x52a2('0x34')],qs[_0x52a2('0x35')](_0x1a9ded['query'][_0x52a2('0x35')]));_0x3fad3f[_0x52a2('0x36')]=_0x3fad3f[_0x52a2('0x36')][_0x52a2('0x37')]?_0x3fad3f[_0x52a2('0x36')]:_0x1715ad[_0x52a2('0x34')];_0x3fad3f['order']=qs[_0x52a2('0x3a')](_0x1a9ded[_0x52a2('0x30')]['sort']);_0x3fad3f[_0x52a2('0x3b')]=qs['filters'](_[_0x52a2('0x53')](_0x1a9ded[_0x52a2('0x30')],_0x1715ad[_0x52a2('0x32')]));if(_0x1a9ded['query'][_0x52a2('0x3c')]){_0x3fad3f[_0x52a2('0x3b')]=_['merge'](_0x3fad3f['where'],{'$or':_[_0x52a2('0x3d')](_0x3fad3f[_0x52a2('0x36')],function(_0x5c13c5){var _0x44d879={};_0x44d879[_0x5c13c5]={'$like':'%'+_0x1a9ded[_0x52a2('0x30')][_0x52a2('0x3c')]+'%'};return _0x44d879;})});}_0x3fad3f=_[_0x52a2('0x3f')]({},_0x3fad3f,_0x1a9ded[_0x52a2('0x46')]);return _0x554d7e[_0x52a2('0x5d')](_0x3fad3f);}})[_0x52a2('0x25')](function(_0x422f22){if(_0x422f22){_0x22d884=_0x422f22[_0x52a2('0x37')];if(!_0x1a9ded[_0x52a2('0x30')][_0x52a2('0x38')]('nolimit')){_0x3fad3f[_0x52a2('0x1f')]=qs[_0x52a2('0x1f')](_0x1a9ded[_0x52a2('0x30')]['limit']);_0x3fad3f['offset']=qs['offset'](_0x1a9ded['query']['offset']);}return _0x554d7e[_0x52a2('0x5d')](_0x3fad3f);}})['then'](function(_0x157b9f){if(_0x157b9f){return _0x157b9f?{'count':_0x22d884,'rows':_0x157b9f}:null;}})[_0x52a2('0x25')](respondWithResult(_0x35b05e,null))[_0x52a2('0x43')](handleError(_0x35b05e,null));};exports['addTeams']=function(_0x44aedf,_0x3697b5,_0x44b15e){var _0xac603=_0x44aedf['body'][_0x52a2('0x5e')];return db[_0x52a2('0x5c')][_0x52a2('0x41')]({'where':{'id':_0xac603},'attributes':['id'],'include':[{'model':db[_0x52a2('0x55')],'as':_0x52a2('0x5f'),'attributes':['id',_0x52a2('0x2a'),_0x52a2('0x60'),_0x52a2('0x61'),'interface'],'raw':!![]}]})['then'](function(_0x2c1f2f){if(_0x2c1f2f){var _0x1b945b=_[_0x52a2('0x62')](_0x2c1f2f,function(_0x1475d7){var _0x461673=_0x1475d7[_0x52a2('0x26')]({'plain':!![]});return _0x461673[_0x52a2('0x5f')];});return db[_0x52a2('0x2d')][_0x52a2('0x47')]({'where':{'id':_0x44aedf['params']['id']}})['then'](function(_0x3a9429){return db[_0x52a2('0x63')][_0x52a2('0x64')](function(_0x14d471){return _0x3a9429[_0x52a2('0x65')](_0xac603,{'transaction':_0x14d471})[_0x52a2('0x25')](function(){return BPromise[_0x52a2('0x66')](_0x1b945b,function(_0x242783){return db[_0x52a2('0x67')]['findOrCreate']({'where':{'UserId':_0x242783['id'],'FaxQueueId':_0x44aedf[_0x52a2('0x44')]['id']},'transaction':_0x14d471});});})[_0x52a2('0x25')](function(){_0x1b945b[_0x52a2('0x68')](function(_0xfe4944){socket[_0x52a2('0x69')](_0x52a2('0x6a'),{'UserId':_0xfe4944['id'],'FaxQueueId':_0x3a9429['id']});});});});});}})[_0x52a2('0x25')](respondWithStatusCode(_0x3697b5,null))['catch'](handleError(_0x3697b5,null));};exports[_0x52a2('0x6b')]=function(_0x26a78c,_0x277c14,_0x55845e){return db[_0x52a2('0x5c')][_0x52a2('0x41')]({'where':{'id':_0x26a78c[_0x52a2('0x30')][_0x52a2('0x5e')]},'attributes':['id'],'include':[{'model':db[_0x52a2('0x55')],'as':_0x52a2('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x52a2('0x25')](handleEntityNotFound(_0x277c14,null))[_0x52a2('0x25')](function(_0x310fd4){var _0xab0d2=_[_0x52a2('0x3d')](_0x310fd4,'id');var _0x14b2e8=[];var _0x42d706=[];var _0x2e8668=squel['select']();_0x2e8668[_0x52a2('0x6c')](_0x52a2('0x6d'))[_0x52a2('0x6e')](_0x52a2('0x6f'),'tq')[_0x52a2('0x70')](_0x52a2('0x71'),'ut',_0x52a2('0x72'))['where'](_0x52a2('0x73'),_0x26a78c[_0x52a2('0x44')]['id']);for(var _0x540812=0x0;_0x540812<_0x310fd4[_0x52a2('0x37')];_0x540812+=0x1){let _0x289837=_0x310fd4[_0x540812];for(var _0xe5e5b6=0x0;_0xe5e5b6<_0x289837[_0x52a2('0x5f')]['length'];_0xe5e5b6+=0x1){let _0x31bfa9=_0x289837[_0x52a2('0x5f')][_0xe5e5b6];var _0x1f0304=_0x2e8668[_0x52a2('0x74')]();_0x1f0304[_0x52a2('0x3b')](_0x52a2('0x75'),_0x31bfa9['id']);_0x42d706['push'](db[_0x52a2('0x63')]['query'](_0x1f0304[_0x52a2('0x76')](),{'type':db[_0x52a2('0x63')]['QueryTypes'][_0x52a2('0x77')]})['then'](function(_0x5dbee7){if(_0x5dbee7['length']===0x1){return _0x31bfa9['id'];}else{var _0x372a94=_[_0x52a2('0x78')](_['map'](_0x5dbee7,_0x52a2('0x79')),function(_0x512c0b){return _[_0x52a2('0x7a')](_0xab0d2,_0x512c0b);});if(_0x372a94){return _0x31bfa9['id'];}}}));}}return BPromise['all'](_0x42d706)[_0x52a2('0x25')](function(_0x1069b6){_0x14b2e8=_(_0x14b2e8)[_0x52a2('0x7b')](_0x1069b6)[_0x52a2('0x7c')]()[_0x52a2('0x7d')]();return db[_0x52a2('0x2d')][_0x52a2('0x47')]({'where':{'id':_0x26a78c[_0x52a2('0x44')]['id']}})['then'](function(_0x49deac){return db[_0x52a2('0x63')][_0x52a2('0x64')](function(_0x4537d2){return _0x49deac[_0x52a2('0x6b')](_0x26a78c[_0x52a2('0x30')]['ids'],{'transaction':_0x4537d2})[_0x52a2('0x25')](function(){if(!_[_0x52a2('0x7e')](_0x14b2e8)){return _0x49deac[_0x52a2('0x7f')](_0x14b2e8,{'transaction':_0x4537d2});}})[_0x52a2('0x25')](function(){_0x14b2e8['forEach'](function(_0x586425){socket[_0x52a2('0x69')](_0x52a2('0x80'),{'UserId':_0x586425,'FaxQueueId':_0x49deac['id']});});});});});});})[_0x52a2('0x25')](respondWithStatusCode(_0x277c14,null))[_0x52a2('0x43')](handleError(_0x277c14,null));};exports['addAgents']=function(_0x195b74,_0x26632e,_0x263e91){return db['FaxQueue'][_0x52a2('0x47')]({'where':{'id':_0x195b74[_0x52a2('0x44')]['id']}})[_0x52a2('0x25')](handleEntityNotFound(_0x26632e,null))[_0x52a2('0x25')](function(_0x2c69ec){if(_0x2c69ec){return _0x2c69ec[_0x52a2('0x81')](_0x195b74[_0x52a2('0x4e')]['ids'],_[_0x52a2('0x82')](_0x195b74[_0x52a2('0x4e')],[_0x52a2('0x5e'),'id'])||{})[_0x52a2('0x83')](function(_0x5ca2ab){for(var _0x11a108=0x0;_0x11a108<_0x195b74['body']['ids'][_0x52a2('0x37')];_0x11a108+=0x1){socket[_0x52a2('0x69')](_0x52a2('0x6a'),{'UserId':Number(_0x195b74[_0x52a2('0x4e')][_0x52a2('0x5e')][_0x11a108]),'FaxQueueId':Number(_0x195b74[_0x52a2('0x44')]['id'])});}return _0x5ca2ab;});}})['then'](respondWithResult(_0x26632e,null))[_0x52a2('0x43')](handleError(_0x26632e,null));};exports[_0x52a2('0x7f')]=function(_0x6a7232,_0x4dcf66,_0x1a5092){return db['FaxQueue'][_0x52a2('0x47')]({'where':{'id':_0x6a7232[_0x52a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x4dcf66,null))[_0x52a2('0x25')](function(_0x3dda40){if(_0x3dda40){return _0x3dda40[_0x52a2('0x7f')](_0x6a7232[_0x52a2('0x30')][_0x52a2('0x5e')])['then'](function(){if(_[_0x52a2('0x84')](_0x6a7232[_0x52a2('0x30')]['ids'])){for(var _0x4ac3fe=0x0;_0x4ac3fe<_0x6a7232[_0x52a2('0x30')]['ids'][_0x52a2('0x37')];_0x4ac3fe+=0x1){socket[_0x52a2('0x69')](_0x52a2('0x80'),{'UserId':Number(_0x6a7232['query'][_0x52a2('0x5e')][_0x4ac3fe]),'FaxQueueId':Number(_0x6a7232[_0x52a2('0x44')]['id'])});}}else{socket[_0x52a2('0x69')](_0x52a2('0x80'),{'UserId':Number(_0x6a7232[_0x52a2('0x30')][_0x52a2('0x5e')]),'FaxQueueId':Number(_0x6a7232[_0x52a2('0x44')]['id'])});}});}})[_0x52a2('0x25')](respondWithStatusCode(_0x4dcf66,null))[_0x52a2('0x43')](handleError(_0x4dcf66,null));};exports[_0x52a2('0x85')]=function(_0x48cabc,_0x53192b,_0xe71219){var _0x4e8659={};var _0x1d593d={};var _0x4c5132;var _0x1320b6;return db['FaxQueue'][_0x52a2('0x52')]({'where':{'id':_0x48cabc[_0x52a2('0x44')]['id']}})[_0x52a2('0x25')](handleEntityNotFound(_0x53192b,null))[_0x52a2('0x25')](function(_0x2e5b7b){if(_0x2e5b7b){_0x4c5132=_0x2e5b7b;_0x1d593d[_0x52a2('0x34')]=_['keys'](db[_0x52a2('0x55')][_0x52a2('0x45')]);_0x1d593d['query']=_[_0x52a2('0x31')](_0x48cabc[_0x52a2('0x30')]);_0x1d593d[_0x52a2('0x32')]=_[_0x52a2('0x33')](_0x1d593d[_0x52a2('0x34')],_0x1d593d['query']);_0x4e8659[_0x52a2('0x36')]=_['intersection'](_0x1d593d[_0x52a2('0x34')],qs[_0x52a2('0x35')](_0x48cabc[_0x52a2('0x30')]['fields']));_0x4e8659['attributes']=_0x4e8659[_0x52a2('0x36')][_0x52a2('0x37')]?_0x4e8659[_0x52a2('0x36')]:_0x1d593d[_0x52a2('0x34')];_0x4e8659[_0x52a2('0x86')]=qs[_0x52a2('0x3a')](_0x48cabc['query']['sort']);_0x4e8659['where']=qs[_0x52a2('0x32')](_[_0x52a2('0x53')](_0x48cabc[_0x52a2('0x30')],_0x1d593d[_0x52a2('0x32')]));if(_0x48cabc[_0x52a2('0x30')]['filter']){_0x4e8659[_0x52a2('0x3b')]=_[_0x52a2('0x3f')](_0x4e8659[_0x52a2('0x3b')],{'$or':_[_0x52a2('0x3d')](_0x4e8659[_0x52a2('0x36')],function(_0x43f025){var _0x432db3={};_0x432db3[_0x43f025]={'$like':'%'+_0x48cabc[_0x52a2('0x30')][_0x52a2('0x3c')]+'%'};return _0x432db3;})});}_0x4e8659=_[_0x52a2('0x3f')]({},_0x4e8659,_0x48cabc['options']);return _0x4c5132[_0x52a2('0x85')](_0x4e8659);}})['then'](function(_0x5c359c){if(_0x5c359c){_0x1320b6=_0x5c359c[_0x52a2('0x37')];if(!_0x48cabc[_0x52a2('0x30')][_0x52a2('0x38')]('nolimit')){_0x4e8659[_0x52a2('0x1f')]=qs[_0x52a2('0x1f')](_0x48cabc[_0x52a2('0x30')]['limit']);_0x4e8659['offset']=qs[_0x52a2('0x1d')](_0x48cabc[_0x52a2('0x30')][_0x52a2('0x1d')]);}return _0x4c5132[_0x52a2('0x85')](_0x4e8659);}})[_0x52a2('0x25')](function(_0x1ef33b){if(_0x1ef33b){return _0x1ef33b?{'count':_0x1320b6,'rows':_0x1ef33b}:null;}})[_0x52a2('0x25')](respondWithResult(_0x53192b,null))[_0x52a2('0x43')](handleError(_0x53192b,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 22e0df1..ab1418b 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 _0x9e89=['events','../../mysqldb','update','emit','hasOwnProperty','hook','exports'];(function(_0x291d28,_0x5df027){var _0x3ca3ce=function(_0x420b88){while(--_0x420b88){_0x291d28['push'](_0x291d28['shift']());}};_0x3ca3ce(++_0x5df027);}(_0x9e89,0x12d));var _0x99e8=function(_0x56c620,_0x14e7da){_0x56c620=_0x56c620-0x0;var _0x33b8cc=_0x9e89[_0x56c620];return _0x33b8cc;};'use strict';var EventEmitter=require(_0x99e8('0x0'));var FaxQueue=require(_0x99e8('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x99e8('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4e59fe){return function(_0x94b60,_0x2b4f86,_0x35cfb6){FaxQueueEvents[_0x99e8('0x3')](_0x4e59fe+':'+_0x94b60['id'],_0x94b60);FaxQueueEvents[_0x99e8('0x3')](_0x4e59fe,_0x94b60);_0x35cfb6(null);};}for(var e in events){if(events[_0x99e8('0x4')](e)){var event=events[e];FaxQueue[_0x99e8('0x5')](e,emitEvent(event));}}module[_0x99e8('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0x68b9=['exports','save','remove','emit','hasOwnProperty'];(function(_0x1b1b68,_0x2e8007){var _0x4dc185=function(_0x3b7587){while(--_0x3b7587){_0x1b1b68['push'](_0x1b1b68['shift']());}};_0x4dc185(++_0x2e8007);}(_0x68b9,0x187));var _0x968b=function(_0x4f3f71,_0x1e35ce){_0x4f3f71=_0x4f3f71-0x0;var _0x559c25=_0x68b9[_0x4f3f71];return _0x559c25;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x968b('0x0'),'afterUpdate':'update','afterDestroy':_0x968b('0x1')};function emitEvent(_0x5e3bca){return function(_0x5d3548,_0x53ee0e,_0x3fdacb){FaxQueueEvents['emit'](_0x5e3bca+':'+_0x5d3548['id'],_0x5d3548);FaxQueueEvents[_0x968b('0x2')](_0x5e3bca,_0x5d3548);_0x3fdacb(null);};}for(var e in events){if(events[_0x968b('0x3')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x968b('0x4')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 09ec8f4..3d278f9 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 _0x3b1a=['rimraf','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x34d82c,_0x5f06ba){var _0x4c252f=function(_0x16c992){while(--_0x16c992){_0x34d82c['push'](_0x34d82c['shift']());}};_0x4c252f(++_0x5f06ba);}(_0x3b1a,0x14a));var _0xa3b1=function(_0x113982,_0x597be2){_0x113982=_0x113982-0x0;var _0x13ff92=_0x3b1a[_0x113982];return _0x13ff92;};'use strict';var _=require(_0xa3b1('0x0'));var util=require(_0xa3b1('0x1'));var logger=require('../../config/logger')(_0xa3b1('0x2'));var moment=require(_0xa3b1('0x3'));var BPromise=require(_0xa3b1('0x4'));var rp=require(_0xa3b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa3b1('0x6'));var config=require('../../config/environment');var attributes=require(_0xa3b1('0x7'));module[_0xa3b1('0x8')]=function(_0x214f02,_0x3cc1a9){return _0x214f02[_0xa3b1('0x9')](_0xa3b1('0xa'),attributes,{'tableName':_0xa3b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf432=['path','rimraf','../../config/environment','./faxQueue.attributes','define','fax_queues','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3e6906,_0x3979f){var _0x5a5194=function(_0x16baff){while(--_0x16baff){_0x3e6906['push'](_0x3e6906['shift']());}};_0x5a5194(++_0x3979f);}(_0xf432,0x187));var _0x2f43=function(_0x21d0e6,_0x5a7aa6){_0x21d0e6=_0x21d0e6-0x0;var _0x1cc2d1=_0xf432[_0x21d0e6];return _0x1cc2d1;};'use strict';var _=require('lodash');var util=require(_0x2f43('0x0'));var logger=require(_0x2f43('0x1'))('api');var moment=require(_0x2f43('0x2'));var BPromise=require(_0x2f43('0x3'));var rp=require(_0x2f43('0x4'));var fs=require('fs');var path=require(_0x2f43('0x5'));var rimraf=require(_0x2f43('0x6'));var config=require(_0x2f43('0x7'));var attributes=require(_0x2f43('0x8'));module['exports']=function(_0x54ceac,_0x4e343a){return _0x54ceac[_0x2f43('0x9')]('FaxQueue',attributes,{'tableName':_0x2f43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index c7fd9e7..8d5f501 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 _0xd2cd=['register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','FaxQueue,\x20%s,\x20%s','result','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxQueue','ShowFaxQueue','find','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxQueue.socket'];(function(_0x460666,_0x24bfa0){var _0x555cbf=function(_0x3b4743){while(--_0x3b4743){_0x460666['push'](_0x460666['shift']());}};_0x555cbf(++_0x24bfa0);}(_0xd2cd,0x96));var _0xdd2c=function(_0x2af47e,_0x1d2a86){_0x2af47e=_0x2af47e-0x0;var _0x5bca26=_0xd2cd[_0x2af47e];return _0x5bca26;};'use strict';var _=require('lodash');var util=require(_0xdd2c('0x0'));var moment=require('moment');var BPromise=require(_0xdd2c('0x1'));var rs=require(_0xdd2c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd2c('0x3'))['db'];var utils=require(_0xdd2c('0x4'));var logger=require(_0xdd2c('0x5'))(_0xdd2c('0x6'));var config=require(_0xdd2c('0x7'));var jayson=require(_0xdd2c('0x8'));var client=jayson[_0xdd2c('0x9')]['http']({'port':0x232a});config[_0xdd2c('0xa')]=_['defaults'](config[_0xdd2c('0xa')],{'host':_0xdd2c('0xb'),'port':0x18eb});var socket=require(_0xdd2c('0xc'))(new Redis(config[_0xdd2c('0xa')]));require(_0xdd2c('0xd'))[_0xdd2c('0xe')](socket);function respondWithRpcPromise(_0x3e5778,_0x4820cb,_0x33877a){return new BPromise(function(_0x56619b,_0x42d993){return client[_0xdd2c('0xf')](_0x3e5778,_0x33877a)[_0xdd2c('0x10')](function(_0x48ecc1){logger[_0xdd2c('0x11')]('FaxQueue,\x20%s,\x20%s',_0x4820cb,_0xdd2c('0x12'));logger[_0xdd2c('0x13')](_0xdd2c('0x14'),_0x4820cb,_0xdd2c('0x12'),JSON[_0xdd2c('0x15')](_0x48ecc1));if(_0x48ecc1['error']){if(_0x48ecc1['error'][_0xdd2c('0x16')]===0x1f4){logger[_0xdd2c('0x17')]('FaxQueue,\x20%s,\x20%s',_0x4820cb,_0x48ecc1[_0xdd2c('0x17')][_0xdd2c('0x18')]);return _0x42d993(_0x48ecc1[_0xdd2c('0x17')][_0xdd2c('0x18')]);}logger[_0xdd2c('0x17')](_0xdd2c('0x19'),_0x4820cb,_0x48ecc1[_0xdd2c('0x17')][_0xdd2c('0x18')]);return _0x56619b(_0x48ecc1['error'][_0xdd2c('0x18')]);}else{logger['info'](_0xdd2c('0x19'),_0x4820cb,_0xdd2c('0x12'));_0x56619b(_0x48ecc1[_0xdd2c('0x1a')]['message']);}})[_0xdd2c('0x1b')](function(_0x102e6d){logger[_0xdd2c('0x17')](_0xdd2c('0x19'),_0x4820cb,_0x102e6d);_0x42d993(_0x102e6d);});});}exports['GetFaxQueue']=function(_0xb4b8c0){var _0x6ff4bc=this;return new Promise(function(_0x20ca2f,_0x4eebbd){return db[_0xdd2c('0x1c')][_0xdd2c('0x1d')]({'raw':_0xb4b8c0[_0xdd2c('0x1e')]?_0xb4b8c0[_0xdd2c('0x1e')][_0xdd2c('0x1f')]===undefined?!![]:![]:!![],'where':_0xb4b8c0[_0xdd2c('0x1e')]?_0xb4b8c0[_0xdd2c('0x1e')][_0xdd2c('0x20')]||null:null,'attributes':_0xb4b8c0[_0xdd2c('0x1e')]?_0xb4b8c0[_0xdd2c('0x1e')][_0xdd2c('0x21')]||null:null,'limit':_0xb4b8c0[_0xdd2c('0x1e')]?_0xb4b8c0[_0xdd2c('0x1e')][_0xdd2c('0x22')]||null:null,'include':_0xb4b8c0[_0xdd2c('0x1e')]?_0xb4b8c0[_0xdd2c('0x1e')][_0xdd2c('0x23')]?_[_0xdd2c('0x24')](_0xb4b8c0[_0xdd2c('0x1e')][_0xdd2c('0x23')],function(_0x3a14dc){return{'model':db[_0x3a14dc[_0xdd2c('0x25')]],'as':_0x3a14dc['as'],'attributes':_0x3a14dc[_0xdd2c('0x21')],'include':_0x3a14dc[_0xdd2c('0x23')]?_[_0xdd2c('0x24')](_0x3a14dc[_0xdd2c('0x23')],function(_0x5ec8c9){return{'model':db[_0x5ec8c9[_0xdd2c('0x25')]],'as':_0x5ec8c9['as'],'attributes':_0x5ec8c9[_0xdd2c('0x21')],'include':_0x5ec8c9[_0xdd2c('0x23')]?_['map'](_0x5ec8c9[_0xdd2c('0x23')],function(_0x81698a){return{'model':db[_0x81698a[_0xdd2c('0x25')]],'as':_0x81698a['as'],'attributes':_0x81698a['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd2c('0x10')](function(_0x2b4baf){logger[_0xdd2c('0x11')](_0xdd2c('0x26'),_0xb4b8c0);logger[_0xdd2c('0x13')](_0xdd2c('0x26'),_0xb4b8c0,JSON['stringify'](_0x2b4baf));_0x20ca2f(_0x2b4baf);})[_0xdd2c('0x1b')](function(_0x1ce915){logger[_0xdd2c('0x17')](_0xdd2c('0x26'),_0x1ce915[_0xdd2c('0x18')],_0xb4b8c0);_0x4eebbd(_0x6ff4bc[_0xdd2c('0x17')](0x1f4,_0x1ce915['message']));});});};exports[_0xdd2c('0x27')]=function(_0x3bab8c){var _0x85b01=this;return new Promise(function(_0x1f128d,_0xab3571){return db[_0xdd2c('0x1c')][_0xdd2c('0x28')]({'raw':_0x3bab8c['options']?_0x3bab8c[_0xdd2c('0x1e')][_0xdd2c('0x1f')]===undefined?!![]:![]:!![],'where':_0x3bab8c[_0xdd2c('0x1e')]?_0x3bab8c[_0xdd2c('0x1e')]['where']||null:null,'attributes':_0x3bab8c[_0xdd2c('0x1e')]?_0x3bab8c[_0xdd2c('0x1e')][_0xdd2c('0x21')]||null:null,'include':_0x3bab8c[_0xdd2c('0x1e')]?_0x3bab8c[_0xdd2c('0x1e')][_0xdd2c('0x23')]?_[_0xdd2c('0x24')](_0x3bab8c[_0xdd2c('0x1e')][_0xdd2c('0x23')],function(_0x46e6fc){return{'model':db[_0x46e6fc['model']],'as':_0x46e6fc['as'],'attributes':_0x46e6fc[_0xdd2c('0x21')],'include':_0x46e6fc['include']?_[_0xdd2c('0x24')](_0x46e6fc[_0xdd2c('0x23')],function(_0x5ba694){return{'model':db[_0x5ba694['model']],'as':_0x5ba694['as'],'attributes':_0x5ba694[_0xdd2c('0x21')],'include':_0x5ba694[_0xdd2c('0x23')]?_['map'](_0x5ba694[_0xdd2c('0x23')],function(_0x5bf42f){return{'model':db[_0x5bf42f['model']],'as':_0x5bf42f['as'],'attributes':_0x5bf42f[_0xdd2c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xdd2c('0x10')](function(_0x28df9c){logger[_0xdd2c('0x11')](_0xdd2c('0x27'),_0x3bab8c);logger[_0xdd2c('0x13')](_0xdd2c('0x27'),_0x3bab8c,JSON[_0xdd2c('0x15')](_0x28df9c));_0x1f128d(_0x28df9c);})[_0xdd2c('0x1b')](function(_0xd85e2c){logger[_0xdd2c('0x17')](_0xdd2c('0x27'),_0xd85e2c[_0xdd2c('0x18')],_0x3bab8c);_0xab3571(_0x85b01[_0xdd2c('0x17')](0x1f4,_0xd85e2c[_0xdd2c('0x18')]));});});}; \ No newline at end of file +var _0x4ef4=['http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowFaxQueue','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x402c8f,_0x30cc1d){var _0x11e809=function(_0x4ccfa3){while(--_0x4ccfa3){_0x402c8f['push'](_0x402c8f['shift']());}};_0x11e809(++_0x30cc1d);}(_0x4ef4,0x1ed));var _0x44ef=function(_0x5e429d,_0x2aad4e){_0x5e429d=_0x5e429d-0x0;var _0x2c962e=_0x4ef4[_0x5e429d];return _0x2c962e;};'use strict';var _=require(_0x44ef('0x0'));var util=require(_0x44ef('0x1'));var moment=require(_0x44ef('0x2'));var BPromise=require(_0x44ef('0x3'));var rs=require(_0x44ef('0x4'));var fs=require('fs');var Redis=require(_0x44ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x44ef('0x6'));var logger=require(_0x44ef('0x7'))('rpc');var config=require(_0x44ef('0x8'));var jayson=require(_0x44ef('0x9'));var client=jayson[_0x44ef('0xa')][_0x44ef('0xb')]({'port':0x232a});config[_0x44ef('0xc')]=_['defaults'](config[_0x44ef('0xc')],{'host':_0x44ef('0xd'),'port':0x18eb});var socket=require(_0x44ef('0xe'))(new Redis(config[_0x44ef('0xc')]));require(_0x44ef('0xf'))[_0x44ef('0x10')](socket);function respondWithRpcPromise(_0x38b7e4,_0x105168,_0x1ab205){return new BPromise(function(_0x392a65,_0x27462d){return client[_0x44ef('0x11')](_0x38b7e4,_0x1ab205)[_0x44ef('0x12')](function(_0x452ca5){logger['info'](_0x44ef('0x13'),_0x105168,'request\x20sent');logger[_0x44ef('0x14')](_0x44ef('0x15'),_0x105168,_0x44ef('0x16'),JSON[_0x44ef('0x17')](_0x452ca5));if(_0x452ca5[_0x44ef('0x18')]){if(_0x452ca5[_0x44ef('0x18')]['code']===0x1f4){logger[_0x44ef('0x18')](_0x44ef('0x13'),_0x105168,_0x452ca5[_0x44ef('0x18')][_0x44ef('0x19')]);return _0x27462d(_0x452ca5['error'][_0x44ef('0x19')]);}logger['error'](_0x44ef('0x13'),_0x105168,_0x452ca5['error'][_0x44ef('0x19')]);return _0x392a65(_0x452ca5[_0x44ef('0x18')][_0x44ef('0x19')]);}else{logger[_0x44ef('0x1a')](_0x44ef('0x13'),_0x105168,_0x44ef('0x16'));_0x392a65(_0x452ca5[_0x44ef('0x1b')][_0x44ef('0x19')]);}})['catch'](function(_0x46249e){logger[_0x44ef('0x18')](_0x44ef('0x13'),_0x105168,_0x46249e);_0x27462d(_0x46249e);});});}exports[_0x44ef('0x1c')]=function(_0x30ad13){var _0x112218=this;return new Promise(function(_0x141ed6,_0x1f5593){return db[_0x44ef('0x1d')][_0x44ef('0x1e')]({'raw':_0x30ad13[_0x44ef('0x1f')]?_0x30ad13['options'][_0x44ef('0x20')]===undefined?!![]:![]:!![],'where':_0x30ad13[_0x44ef('0x1f')]?_0x30ad13[_0x44ef('0x1f')][_0x44ef('0x21')]||null:null,'attributes':_0x30ad13[_0x44ef('0x1f')]?_0x30ad13['options'][_0x44ef('0x22')]||null:null,'limit':_0x30ad13['options']?_0x30ad13[_0x44ef('0x1f')][_0x44ef('0x23')]||null:null,'include':_0x30ad13[_0x44ef('0x1f')]?_0x30ad13['options']['include']?_['map'](_0x30ad13[_0x44ef('0x1f')][_0x44ef('0x24')],function(_0x4a2341){return{'model':db[_0x4a2341[_0x44ef('0x25')]],'as':_0x4a2341['as'],'attributes':_0x4a2341[_0x44ef('0x22')],'include':_0x4a2341[_0x44ef('0x24')]?_['map'](_0x4a2341[_0x44ef('0x24')],function(_0x46e802){return{'model':db[_0x46e802[_0x44ef('0x25')]],'as':_0x46e802['as'],'attributes':_0x46e802[_0x44ef('0x22')],'include':_0x46e802[_0x44ef('0x24')]?_[_0x44ef('0x26')](_0x46e802[_0x44ef('0x24')],function(_0x4da2d4){return{'model':db[_0x4da2d4[_0x44ef('0x25')]],'as':_0x4da2d4['as'],'attributes':_0x4da2d4['attributes']};}):[]};}):[]};}):[]:[]})[_0x44ef('0x12')](function(_0x3862db){logger[_0x44ef('0x1a')]('GetFaxQueue',_0x30ad13);logger[_0x44ef('0x14')](_0x44ef('0x1c'),_0x30ad13,JSON['stringify'](_0x3862db));_0x141ed6(_0x3862db);})['catch'](function(_0x2953e1){logger[_0x44ef('0x18')](_0x44ef('0x1c'),_0x2953e1['message'],_0x30ad13);_0x1f5593(_0x112218[_0x44ef('0x18')](0x1f4,_0x2953e1[_0x44ef('0x19')]));});});};exports[_0x44ef('0x27')]=function(_0x5b5305){var _0x19c31d=this;return new Promise(function(_0x353a54,_0x5af3c7){return db[_0x44ef('0x1d')][_0x44ef('0x28')]({'raw':_0x5b5305[_0x44ef('0x1f')]?_0x5b5305[_0x44ef('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5b5305[_0x44ef('0x1f')]?_0x5b5305[_0x44ef('0x1f')][_0x44ef('0x21')]||null:null,'attributes':_0x5b5305[_0x44ef('0x1f')]?_0x5b5305['options'][_0x44ef('0x22')]||null:null,'include':_0x5b5305[_0x44ef('0x1f')]?_0x5b5305[_0x44ef('0x1f')][_0x44ef('0x24')]?_[_0x44ef('0x26')](_0x5b5305['options']['include'],function(_0x301b65){return{'model':db[_0x301b65[_0x44ef('0x25')]],'as':_0x301b65['as'],'attributes':_0x301b65[_0x44ef('0x22')],'include':_0x301b65[_0x44ef('0x24')]?_[_0x44ef('0x26')](_0x301b65[_0x44ef('0x24')],function(_0x951af6){return{'model':db[_0x951af6[_0x44ef('0x25')]],'as':_0x951af6['as'],'attributes':_0x951af6[_0x44ef('0x22')],'include':_0x951af6[_0x44ef('0x24')]?_[_0x44ef('0x26')](_0x951af6[_0x44ef('0x24')],function(_0x362e87){return{'model':db[_0x362e87[_0x44ef('0x25')]],'as':_0x362e87['as'],'attributes':_0x362e87[_0x44ef('0x22')]};}):[]};}):[]};}):[]:[]})[_0x44ef('0x12')](function(_0xdb515f){logger[_0x44ef('0x1a')](_0x44ef('0x27'),_0x5b5305);logger['debug'](_0x44ef('0x27'),_0x5b5305,JSON[_0x44ef('0x17')](_0xdb515f));_0x353a54(_0xdb515f);})[_0x44ef('0x29')](function(_0x2082a8){logger[_0x44ef('0x18')](_0x44ef('0x27'),_0x2082a8[_0x44ef('0x19')],_0x5b5305);_0x5af3c7(_0x19c31d[_0x44ef('0x18')](0x1f4,_0x2082a8[_0x44ef('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 1ed5e0d..667eb2b 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 _0x60c2=['removeListener','register','length','save','remove','update','emit'];(function(_0x258a42,_0x5e11d1){var _0x470826=function(_0x8b34a8){while(--_0x8b34a8){_0x258a42['push'](_0x258a42['shift']());}};_0x470826(++_0x5e11d1);}(_0x60c2,0x8f));var _0x260c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x60c2[_0x502c7d];return _0x30b7ed;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x260c('0x0'),_0x260c('0x1'),_0x260c('0x2')];function createListener(_0x3ad4c5,_0x2f5bc8){return function(_0x759b92){_0x2f5bc8[_0x260c('0x3')](_0x3ad4c5,_0x759b92);};}function removeListener(_0x309bde,_0x17a599){return function(){FaxQueueEvents[_0x260c('0x4')](_0x309bde,_0x17a599);};}exports[_0x260c('0x5')]=function(_0x13c7d0){for(var _0x558b0c=0x0,_0x14fab2=events[_0x260c('0x6')];_0x558b0c<_0x14fab2;_0x558b0c++){var _0x3b432d=events[_0x558b0c];var _0xf22c37=createListener('faxQueue:'+_0x3b432d,_0x13c7d0);FaxQueueEvents['on'](_0x3b432d,_0xf22c37);}}; \ No newline at end of file +var _0xb5a3=['./faxQueue.events','remove','update','emit','register','length','faxQueue:'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xb5a3,0x93));var _0x3b5a=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0xb5a3[_0xe1b5f6];return _0x44636e;};'use strict';var FaxQueueEvents=require(_0x3b5a('0x0'));var events=['save',_0x3b5a('0x1'),_0x3b5a('0x2')];function createListener(_0xd618b1,_0x2d628f){return function(_0xb1ea71){_0x2d628f[_0x3b5a('0x3')](_0xd618b1,_0xb1ea71);};}function removeListener(_0x4c00ef,_0xcbceb1){return function(){FaxQueueEvents['removeListener'](_0x4c00ef,_0xcbceb1);};}exports[_0x3b5a('0x4')]=function(_0x493153){for(var _0x282b0f=0x0,_0xff57a9=events[_0x3b5a('0x5')];_0x282b0f<_0xff57a9;_0x282b0f++){var _0x4ad8a4=events[_0x282b0f];var _0x2d1158=createListener(_0x3b5a('0x6')+_0x4ad8a4,_0x493153);FaxQueueEvents['on'](_0x4ad8a4,_0x2d1158);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index fab2224..c7a158d 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 _0x430c=['post','create','/:id/teams','/:id/users','addAgents','put','destroy','delete','removeAgents','multer','connect-timeout','express','Router','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getAgents'];(function(_0x239eaf,_0x1968b4){var _0x8863f7=function(_0x1b34d7){while(--_0x1b34d7){_0x239eaf['push'](_0x239eaf['shift']());}};_0x8863f7(++_0x1968b4);}(_0x430c,0x1a1));var _0xc430=function(_0x33dcf7,_0x3d5390){_0x33dcf7=_0x33dcf7-0x0;var _0x542d4e=_0x430c[_0x33dcf7];return _0x542d4e;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();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(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0x5')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0x5')]('/:id/teams',auth[_0xc430('0x8')](),controller['getTeams']);router[_0xc430('0x5')]('/:id/users',auth[_0xc430('0x8')](),controller[_0xc430('0xe')]);router[_0xc430('0xf')]('/',auth[_0xc430('0x8')](),controller[_0xc430('0x10')]);router[_0xc430('0xf')](_0xc430('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0xc430('0xf')](_0xc430('0x12'),auth[_0xc430('0x8')](),controller[_0xc430('0x13')]);router[_0xc430('0x14')]('/:id',auth[_0xc430('0x8')](),controller['update']);router['delete'](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0x15')]);router['delete']('/:id/teams',auth[_0xc430('0x8')](),controller['removeTeams']);router[_0xc430('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0xc430('0x17')]);module['exports']=router; \ No newline at end of file +var _0x5d58=['put','update','delete','destroy','removeTeams','removeAgents','exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams'];(function(_0x310fe7,_0x447a9d){var _0x29db45=function(_0x2d98a8){while(--_0x2d98a8){_0x310fe7['push'](_0x310fe7['shift']());}};_0x29db45(++_0x447a9d);}(_0x5d58,0x187));var _0x85d5=function(_0x543c6e,_0x136002){_0x543c6e=_0x543c6e-0x0;var _0x2a5959=_0x5d58[_0x543c6e];return _0x2a5959;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./faxQueue.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/describe',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0x4')](_0x85d5('0xa'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x85d5('0xb'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xc')]);router[_0x85d5('0x4')](_0x85d5('0xd'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x85d5('0xf')](_0x85d5('0xb'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x10')]);router[_0x85d5('0xf')](_0x85d5('0xd'),auth[_0x85d5('0x5')](),controller['addAgents']);router[_0x85d5('0x11')](_0x85d5('0x8'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x12')]);router[_0x85d5('0x13')](_0x85d5('0x8'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x14')]);router[_0x85d5('0x13')](_0x85d5('0xb'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x15')]);router[_0x85d5('0x13')](_0x85d5('0xd'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x16')]);module[_0x85d5('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 79056f1..da4c2d9 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 _0x5ad6=['DATE','moment','STRING'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x5ad6,0xfd));var _0x65ad=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0x5ad6[_0x1678c8];return _0x387aa9;};'use strict';var moment=require(_0x65ad('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x65ad('0x1')]},'joinAt':{'type':Sequelize[_0x65ad('0x2')]},'leaveAt':{'type':Sequelize[_0x65ad('0x2')]},'acceptAt':{'type':Sequelize[_0x65ad('0x2')]},'exitAt':{'type':Sequelize[_0x65ad('0x2')]},'reason':{'type':Sequelize[_0x65ad('0x1')]}}; \ No newline at end of file +var _0x7e06=['sequelize','exports','STRING','DATE'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x7e06,0x1b0));var _0x67e0=function(_0x447c76,_0x194561){_0x447c76=_0x447c76-0x0;var _0x42a959=_0x7e06[_0x447c76];return _0x42a959;};'use strict';var moment=require('moment');var Sequelize=require(_0x67e0('0x0'));module[_0x67e0('0x1')]={'uniqueid':{'type':Sequelize[_0x67e0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x67e0('0x2')]},'joinAt':{'type':Sequelize[_0x67e0('0x3')]},'leaveAt':{'type':Sequelize[_0x67e0('0x3')]},'acceptAt':{'type':Sequelize[_0x67e0('0x3')]},'exitAt':{'type':Sequelize[_0x67e0('0x3')]},'reason':{'type':Sequelize[_0x67e0('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index c7b7d6f..6d665ca 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 _0x7846=['merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter'];(function(_0x378f89,_0x13f5c7){var _0x3239d5=function(_0xd0423c){while(--_0xd0423c){_0x378f89['push'](_0x378f89['shift']());}};_0x3239d5(++_0x13f5c7);}(_0x7846,0xf4));var _0x6784=function(_0xb7a459,_0xc13228){_0xb7a459=_0xb7a459-0x0;var _0x104ab5=_0x7846[_0xb7a459];return _0x104ab5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6784('0x0'));var zipdir=require(_0x6784('0x1'));var jsonpatch=require(_0x6784('0x2'));var rp=require(_0x6784('0x3'));var moment=require(_0x6784('0x4'));var BPromise=require(_0x6784('0x5'));var Mustache=require('mustache');var util=require(_0x6784('0x6'));var path=require(_0x6784('0x7'));var sox=require(_0x6784('0x8'));var csv=require(_0x6784('0x9'));var ejs=require(_0x6784('0xa'));var fs=require('fs');var fs_extra=require(_0x6784('0xb'));var _=require(_0x6784('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6784('0xd'));var deskjs=require(_0x6784('0xe'));var toCsv=require(_0x6784('0x9'));var querystring=require(_0x6784('0xf'));var Papa=require(_0x6784('0x10'));var Redis=require(_0x6784('0x11'));var authService=require(_0x6784('0x12'));var qs=require(_0x6784('0x13'));var as=require(_0x6784('0x14'));var hardwareService=require(_0x6784('0x15'));var logger=require(_0x6784('0x16'))(_0x6784('0x17'));var utils=require(_0x6784('0x18'));var config=require(_0x6784('0x19'));var licenseUtil=require(_0x6784('0x1a'));var db=require(_0x6784('0x1b'))['db'];function respondWithStatusCode(_0x5a43c1,_0x221cb8){_0x221cb8=_0x221cb8||0xcc;return function(_0x42cd0f){if(_0x42cd0f){return _0x5a43c1[_0x6784('0x1c')](_0x221cb8);}return _0x5a43c1[_0x6784('0x1d')](_0x221cb8)['end']();};}function respondWithResult(_0x18b8a9,_0x681759){_0x681759=_0x681759||0xc8;return function(_0x62426d){if(_0x62426d){return _0x18b8a9[_0x6784('0x1d')](_0x681759)[_0x6784('0x1e')](_0x62426d);}};}function respondWithFilteredResult(_0x18929b,_0x474511){return function(_0x32eaf2){if(_0x32eaf2){var _0x1db6be=typeof _0x474511[_0x6784('0x1f')]===_0x6784('0x20')&&typeof _0x474511['limit']===_0x6784('0x20');var _0x575d8=_0x32eaf2[_0x6784('0x21')];var _0x2fd8a2=_0x1db6be?0x0:_0x474511['offset'];var _0x23f32e=_0x1db6be?_0x32eaf2[_0x6784('0x21')]:_0x474511[_0x6784('0x1f')]+_0x474511[_0x6784('0x22')];var _0x338067;if(_0x23f32e>=_0x575d8){_0x23f32e=_0x575d8;_0x338067=0xc8;}else{_0x338067=0xce;}_0x18929b['status'](_0x338067);return _0x18929b[_0x6784('0x23')](_0x6784('0x24'),_0x2fd8a2+'-'+_0x23f32e+'/'+_0x575d8)['json'](_0x32eaf2);}return null;};}function patchUpdates(_0x3f4178){return function(_0x2eeed8){try{jsonpatch[_0x6784('0x25')](_0x2eeed8,_0x3f4178,!![]);}catch(_0x461ced){return BPromise['reject'](_0x461ced);}return _0x2eeed8[_0x6784('0x26')]();};}function saveUpdates(_0x225a9e,_0x581690){return function(_0x37aea3){if(_0x37aea3){return _0x37aea3[_0x6784('0x27')](_0x225a9e)[_0x6784('0x28')](function(_0x305d64){return _0x305d64;});}return null;};}function removeEntity(_0x3cdfe2,_0x140a38){return function(_0x5452a8){if(_0x5452a8){return _0x5452a8[_0x6784('0x29')]()[_0x6784('0x28')](function(){_0x3cdfe2[_0x6784('0x1d')](0xcc)[_0x6784('0x2a')]();});}};}function handleEntityNotFound(_0x4ac355,_0x13598e){return function(_0x4a1b2b){if(!_0x4a1b2b){_0x4ac355[_0x6784('0x1c')](0x194);}return _0x4a1b2b;};}function handleError(_0x4db985,_0x3a287a){_0x3a287a=_0x3a287a||0x1f4;return function(_0x543c14){logger['error'](_0x543c14['stack']);if(_0x543c14[_0x6784('0x2b')]){delete _0x543c14[_0x6784('0x2b')];}_0x4db985[_0x6784('0x1d')](_0x3a287a)[_0x6784('0x2c')](_0x543c14);};}exports[_0x6784('0x2d')]=function(_0x280b56,_0x497fab){var _0x17537d={},_0x4b296b={},_0x569e31={'count':0x0,'rows':[]};var _0x5b5048=_[_0x6784('0x2e')](db[_0x6784('0x2f')][_0x6784('0x30')],function(_0x2036d6){return{'name':_0x2036d6[_0x6784('0x31')],'type':_0x2036d6['type'][_0x6784('0x32')]};});_0x4b296b[_0x6784('0x33')]=_[_0x6784('0x2e')](_0x5b5048,_0x6784('0x2b'));_0x4b296b[_0x6784('0x34')]=_[_0x6784('0x35')](_0x280b56['query']);_0x4b296b[_0x6784('0x36')]=_['intersection'](_0x4b296b['model'],_0x4b296b[_0x6784('0x34')]);_0x17537d[_0x6784('0x37')]=_[_0x6784('0x38')](_0x4b296b[_0x6784('0x33')],qs['fields'](_0x280b56[_0x6784('0x34')][_0x6784('0x39')]));_0x17537d[_0x6784('0x37')]=_0x17537d[_0x6784('0x37')][_0x6784('0x3a')]?_0x17537d[_0x6784('0x37')]:_0x4b296b[_0x6784('0x33')];if(!_0x280b56[_0x6784('0x34')]['hasOwnProperty']('nolimit')){_0x17537d[_0x6784('0x22')]=qs['limit'](_0x280b56[_0x6784('0x34')]['limit']);_0x17537d[_0x6784('0x1f')]=qs['offset'](_0x280b56[_0x6784('0x34')]['offset']);}_0x17537d[_0x6784('0x3b')]=qs[_0x6784('0x3c')](_0x280b56['query']['sort']);_0x17537d[_0x6784('0x3d')]=qs[_0x6784('0x36')](_[_0x6784('0x3e')](_0x280b56['query'],_0x4b296b['filters']),_0x5b5048);if(_0x280b56['query'][_0x6784('0x3f')]){_0x17537d[_0x6784('0x3d')]=_[_0x6784('0x40')](_0x17537d[_0x6784('0x3d')],{'$or':_[_0x6784('0x2e')](_0x5b5048,function(_0x54b0d0){if(_0x54b0d0[_0x6784('0x41')]!==_0x6784('0x42')){var _0x29060e={};_0x29060e[_0x54b0d0[_0x6784('0x2b')]]={'$like':'%'+_0x280b56[_0x6784('0x34')][_0x6784('0x3f')]+'%'};return _0x29060e;}})});}_0x17537d=_['merge']({},_0x17537d,_0x280b56[_0x6784('0x43')]);var _0x87118f={'where':_0x17537d[_0x6784('0x3d')]};return db[_0x6784('0x2f')][_0x6784('0x21')](_0x87118f)[_0x6784('0x28')](function(_0x31bff6){_0x569e31[_0x6784('0x21')]=_0x31bff6;if(_0x280b56[_0x6784('0x34')][_0x6784('0x44')]){_0x17537d[_0x6784('0x45')]=[{'all':!![]}];}return db[_0x6784('0x2f')]['findAll'](_0x17537d);})['then'](function(_0x11e22d){_0x569e31[_0x6784('0x46')]=_0x11e22d;return _0x569e31;})['then'](respondWithFilteredResult(_0x497fab,_0x17537d))[_0x6784('0x47')](handleError(_0x497fab,null));};exports[_0x6784('0x48')]=function(_0x185c0d,_0xbff90b){var _0xc8532a={'raw':!![],'where':{'id':_0x185c0d['params']['id']}},_0x2ccb02={};_0x2ccb02['model']=_[_0x6784('0x35')](db['FaxQueueReport'][_0x6784('0x30')]);_0x2ccb02[_0x6784('0x34')]=_[_0x6784('0x35')](_0x185c0d['query']);_0x2ccb02[_0x6784('0x36')]=_[_0x6784('0x38')](_0x2ccb02[_0x6784('0x33')],_0x2ccb02[_0x6784('0x34')]);_0xc8532a['attributes']=_[_0x6784('0x38')](_0x2ccb02['model'],qs['fields'](_0x185c0d[_0x6784('0x34')][_0x6784('0x39')]));_0xc8532a['attributes']=_0xc8532a['attributes'][_0x6784('0x3a')]?_0xc8532a[_0x6784('0x37')]:_0x2ccb02[_0x6784('0x33')];if(_0x185c0d['query'][_0x6784('0x44')]){_0xc8532a[_0x6784('0x45')]=[{'all':!![]}];}_0xc8532a=_['merge']({},_0xc8532a,_0x185c0d[_0x6784('0x43')]);return db[_0x6784('0x2f')][_0x6784('0x49')](_0xc8532a)['then'](handleEntityNotFound(_0xbff90b,null))[_0x6784('0x28')](respondWithResult(_0xbff90b,null))[_0x6784('0x47')](handleError(_0xbff90b,null));};exports[_0x6784('0x4a')]=function(_0x285ac0,_0x104967){return db[_0x6784('0x2f')][_0x6784('0x4a')](_0x285ac0[_0x6784('0x4b')],{})[_0x6784('0x28')](respondWithResult(_0x104967,0xc9))[_0x6784('0x47')](handleError(_0x104967,null));};exports['update']=function(_0x4c332e,_0x3955c7){if(_0x4c332e[_0x6784('0x4b')]['id']){delete _0x4c332e[_0x6784('0x4b')]['id'];}return db['FaxQueueReport'][_0x6784('0x49')]({'where':{'id':_0x4c332e['params']['id']}})[_0x6784('0x28')](handleEntityNotFound(_0x3955c7,null))[_0x6784('0x28')](saveUpdates(_0x4c332e['body'],null))[_0x6784('0x28')](respondWithResult(_0x3955c7,null))['catch'](handleError(_0x3955c7,null));};exports['destroy']=function(_0x3f3715,_0x504f0f){return db[_0x6784('0x2f')][_0x6784('0x49')]({'where':{'id':_0x3f3715['params']['id']}})['then'](handleEntityNotFound(_0x504f0f,null))[_0x6784('0x28')](removeEntity(_0x504f0f,null))[_0x6784('0x47')](handleError(_0x504f0f,null));};exports['describe']=function(_0x2f9c41,_0x453f09){return db[_0x6784('0x2f')][_0x6784('0x4c')]()[_0x6784('0x28')](respondWithResult(_0x453f09,null))[_0x6784('0x47')](handleError(_0x453f09,null));}; \ No newline at end of file +var _0x8482=['count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','filter','merge','options','findAll','rows','show','length','includeAll','include','find','create','body','catch','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined'];(function(_0x205df0,_0x3b8a15){var _0x14fe94=function(_0x4664f7){while(--_0x4664f7){_0x205df0['push'](_0x205df0['shift']());}};_0x14fe94(++_0x3b8a15);}(_0x8482,0x14e));var _0x2848=function(_0x2fede2,_0x24e0eb){_0x2fede2=_0x2fede2-0x0;var _0x59ce33=_0x8482[_0x2fede2];return _0x59ce33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2848('0x0'));var zipdir=require(_0x2848('0x1'));var jsonpatch=require(_0x2848('0x2'));var rp=require(_0x2848('0x3'));var moment=require(_0x2848('0x4'));var BPromise=require(_0x2848('0x5'));var Mustache=require(_0x2848('0x6'));var util=require(_0x2848('0x7'));var path=require(_0x2848('0x8'));var sox=require(_0x2848('0x9'));var csv=require('to-csv');var ejs=require(_0x2848('0xa'));var fs=require('fs');var fs_extra=require(_0x2848('0xb'));var _=require('lodash');var squel=require(_0x2848('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2848('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2848('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2848('0xf'));var as=require(_0x2848('0x10'));var hardwareService=require(_0x2848('0x11'));var logger=require(_0x2848('0x12'))(_0x2848('0x13'));var utils=require(_0x2848('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2848('0x15'))['db'];function respondWithStatusCode(_0x465380,_0xf0658d){_0xf0658d=_0xf0658d||0xcc;return function(_0x566a0b){if(_0x566a0b){return _0x465380[_0x2848('0x16')](_0xf0658d);}return _0x465380[_0x2848('0x17')](_0xf0658d)[_0x2848('0x18')]();};}function respondWithResult(_0x5e64c7,_0xbddd26){_0xbddd26=_0xbddd26||0xc8;return function(_0x501a0e){if(_0x501a0e){return _0x5e64c7[_0x2848('0x17')](_0xbddd26)['json'](_0x501a0e);}};}function respondWithFilteredResult(_0x1002d2,_0xeba65b){return function(_0x6600c5){if(_0x6600c5){var _0x59f39a=typeof _0xeba65b['offset']==='undefined'&&typeof _0xeba65b['limit']===_0x2848('0x19');var _0x1acd41=_0x6600c5[_0x2848('0x1a')];var _0x46755c=_0x59f39a?0x0:_0xeba65b[_0x2848('0x1b')];var _0x3b4eeb=_0x59f39a?_0x6600c5[_0x2848('0x1a')]:_0xeba65b[_0x2848('0x1b')]+_0xeba65b[_0x2848('0x1c')];var _0x193ffa;if(_0x3b4eeb>=_0x1acd41){_0x3b4eeb=_0x1acd41;_0x193ffa=0xc8;}else{_0x193ffa=0xce;}_0x1002d2[_0x2848('0x17')](_0x193ffa);return _0x1002d2['set'](_0x2848('0x1d'),_0x46755c+'-'+_0x3b4eeb+'/'+_0x1acd41)[_0x2848('0x1e')](_0x6600c5);}return null;};}function patchUpdates(_0x1a1f79){return function(_0x5748ae){try{jsonpatch[_0x2848('0x1f')](_0x5748ae,_0x1a1f79,!![]);}catch(_0x1f67a7){return BPromise[_0x2848('0x20')](_0x1f67a7);}return _0x5748ae[_0x2848('0x21')]();};}function saveUpdates(_0x3b99a2,_0x555279){return function(_0x3dd7db){if(_0x3dd7db){return _0x3dd7db[_0x2848('0x22')](_0x3b99a2)[_0x2848('0x23')](function(_0x436709){return _0x436709;});}return null;};}function removeEntity(_0xea4128,_0x40f510){return function(_0x5f38e2){if(_0x5f38e2){return _0x5f38e2[_0x2848('0x24')]()['then'](function(){_0xea4128[_0x2848('0x17')](0xcc)[_0x2848('0x18')]();});}};}function handleEntityNotFound(_0x2d936a,_0x4517d3){return function(_0x51c924){if(!_0x51c924){_0x2d936a[_0x2848('0x16')](0x194);}return _0x51c924;};}function handleError(_0xecd4f4,_0xdba069){_0xdba069=_0xdba069||0x1f4;return function(_0x2dc32e){logger[_0x2848('0x25')](_0x2dc32e[_0x2848('0x26')]);if(_0x2dc32e[_0x2848('0x27')]){delete _0x2dc32e['name'];}_0xecd4f4['status'](_0xdba069)['send'](_0x2dc32e);};}exports[_0x2848('0x28')]=function(_0x18df37,_0x3b9c0d){var _0x3f915b={},_0x189701={},_0x528825={'count':0x0,'rows':[]};var _0x4c9685=_['map'](db[_0x2848('0x29')][_0x2848('0x2a')],function(_0x1ff601){return{'name':_0x1ff601[_0x2848('0x2b')],'type':_0x1ff601[_0x2848('0x2c')][_0x2848('0x2d')]};});_0x189701[_0x2848('0x2e')]=_[_0x2848('0x2f')](_0x4c9685,_0x2848('0x27'));_0x189701[_0x2848('0x30')]=_[_0x2848('0x31')](_0x18df37['query']);_0x189701[_0x2848('0x32')]=_[_0x2848('0x33')](_0x189701[_0x2848('0x2e')],_0x189701[_0x2848('0x30')]);_0x3f915b['attributes']=_[_0x2848('0x33')](_0x189701[_0x2848('0x2e')],qs[_0x2848('0x34')](_0x18df37[_0x2848('0x30')]['fields']));_0x3f915b['attributes']=_0x3f915b['attributes']['length']?_0x3f915b[_0x2848('0x35')]:_0x189701[_0x2848('0x2e')];if(!_0x18df37['query']['hasOwnProperty'](_0x2848('0x36'))){_0x3f915b[_0x2848('0x1c')]=qs[_0x2848('0x1c')](_0x18df37[_0x2848('0x30')][_0x2848('0x1c')]);_0x3f915b['offset']=qs[_0x2848('0x1b')](_0x18df37[_0x2848('0x30')][_0x2848('0x1b')]);}_0x3f915b['order']=qs[_0x2848('0x37')](_0x18df37[_0x2848('0x30')][_0x2848('0x37')]);_0x3f915b[_0x2848('0x38')]=qs[_0x2848('0x32')](_['pick'](_0x18df37['query'],_0x189701[_0x2848('0x32')]),_0x4c9685);if(_0x18df37[_0x2848('0x30')][_0x2848('0x39')]){_0x3f915b[_0x2848('0x38')]=_[_0x2848('0x3a')](_0x3f915b[_0x2848('0x38')],{'$or':_['map'](_0x4c9685,function(_0x489ed8){if(_0x489ed8['type']!=='VIRTUAL'){var _0x5c3d4e={};_0x5c3d4e[_0x489ed8[_0x2848('0x27')]]={'$like':'%'+_0x18df37['query'][_0x2848('0x39')]+'%'};return _0x5c3d4e;}})});}_0x3f915b=_['merge']({},_0x3f915b,_0x18df37[_0x2848('0x3b')]);var _0x24af01={'where':_0x3f915b[_0x2848('0x38')]};return db['FaxQueueReport'][_0x2848('0x1a')](_0x24af01)[_0x2848('0x23')](function(_0x368ef1){_0x528825[_0x2848('0x1a')]=_0x368ef1;if(_0x18df37[_0x2848('0x30')]['includeAll']){_0x3f915b['include']=[{'all':!![]}];}return db[_0x2848('0x29')][_0x2848('0x3c')](_0x3f915b);})[_0x2848('0x23')](function(_0xfe7e37){_0x528825[_0x2848('0x3d')]=_0xfe7e37;return _0x528825;})[_0x2848('0x23')](respondWithFilteredResult(_0x3b9c0d,_0x3f915b))['catch'](handleError(_0x3b9c0d,null));};exports[_0x2848('0x3e')]=function(_0x5ef41f,_0x3208f2){var _0x56d0fa={'raw':!![],'where':{'id':_0x5ef41f['params']['id']}},_0x32f51a={};_0x32f51a['model']=_['keys'](db['FaxQueueReport'][_0x2848('0x2a')]);_0x32f51a[_0x2848('0x30')]=_[_0x2848('0x31')](_0x5ef41f[_0x2848('0x30')]);_0x32f51a[_0x2848('0x32')]=_[_0x2848('0x33')](_0x32f51a[_0x2848('0x2e')],_0x32f51a[_0x2848('0x30')]);_0x56d0fa[_0x2848('0x35')]=_['intersection'](_0x32f51a[_0x2848('0x2e')],qs[_0x2848('0x34')](_0x5ef41f[_0x2848('0x30')]['fields']));_0x56d0fa[_0x2848('0x35')]=_0x56d0fa[_0x2848('0x35')][_0x2848('0x3f')]?_0x56d0fa[_0x2848('0x35')]:_0x32f51a[_0x2848('0x2e')];if(_0x5ef41f['query'][_0x2848('0x40')]){_0x56d0fa[_0x2848('0x41')]=[{'all':!![]}];}_0x56d0fa=_[_0x2848('0x3a')]({},_0x56d0fa,_0x5ef41f[_0x2848('0x3b')]);return db['FaxQueueReport'][_0x2848('0x42')](_0x56d0fa)[_0x2848('0x23')](handleEntityNotFound(_0x3208f2,null))[_0x2848('0x23')](respondWithResult(_0x3208f2,null))['catch'](handleError(_0x3208f2,null));};exports[_0x2848('0x43')]=function(_0xf6c69,_0x53420b){return db['FaxQueueReport'][_0x2848('0x43')](_0xf6c69[_0x2848('0x44')],{})[_0x2848('0x23')](respondWithResult(_0x53420b,0xc9))[_0x2848('0x45')](handleError(_0x53420b,null));};exports[_0x2848('0x22')]=function(_0x4e4b1e,_0x35ed61){if(_0x4e4b1e[_0x2848('0x44')]['id']){delete _0x4e4b1e[_0x2848('0x44')]['id'];}return db[_0x2848('0x29')][_0x2848('0x42')]({'where':{'id':_0x4e4b1e[_0x2848('0x46')]['id']}})[_0x2848('0x23')](handleEntityNotFound(_0x35ed61,null))[_0x2848('0x23')](saveUpdates(_0x4e4b1e[_0x2848('0x44')],null))[_0x2848('0x23')](respondWithResult(_0x35ed61,null))[_0x2848('0x45')](handleError(_0x35ed61,null));};exports[_0x2848('0x24')]=function(_0xe8e50,_0x1a8946){return db[_0x2848('0x29')][_0x2848('0x42')]({'where':{'id':_0xe8e50[_0x2848('0x46')]['id']}})[_0x2848('0x23')](handleEntityNotFound(_0x1a8946,null))[_0x2848('0x23')](removeEntity(_0x1a8946,null))[_0x2848('0x45')](handleError(_0x1a8946,null));};exports['describe']=function(_0x2814a2,_0x3b996e){return db['FaxQueueReport'][_0x2848('0x47')]()[_0x2848('0x23')](respondWithResult(_0x3b996e,null))['catch'](handleError(_0x3b996e,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 49da55b..35d414c 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 _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x30e124,_0x16241f){var _0x49503b=function(_0x1f02ca){while(--_0x1f02ca){_0x30e124['push'](_0x30e124['shift']());}};_0x49503b(++_0x16241f);}(_0xabce,0x103));var _0xeabc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xabce[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x24bf6f,_0x2214f4){var _0xef9adb=function(_0x54a0fe){while(--_0x54a0fe){_0x24bf6f['push'](_0x24bf6f['shift']());}};_0xef9adb(++_0x2214f4);}(_0x5fab,0x177));var _0xb5fa=function(_0x320e1f,_0x1ada5e){_0x320e1f=_0x320e1f-0x0;var _0x1c7ae2=_0x5fab[_0x320e1f];return _0x1c7ae2;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 741a1b3..8eff6e4 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 _0x8fb7=['FaxQueueReport','create','options','CreateFaxQueueReport','update','body','raw','where','attributes','limit','UpdateFaxQueueReport','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x1429b7,_0x51a982){var _0x1f870b=function(_0x436b36){while(--_0x436b36){_0x1429b7['push'](_0x1429b7['shift']());}};_0x1f870b(++_0x51a982);}(_0x8fb7,0x72));var _0x78fb=function(_0x37b180,_0x56ed65){_0x37b180=_0x37b180-0x0;var _0x1c51cf=_0x8fb7[_0x37b180];return _0x1c51cf;};'use strict';var _=require(_0x78fb('0x0'));var util=require(_0x78fb('0x1'));var moment=require(_0x78fb('0x2'));var BPromise=require('bluebird');var rs=require(_0x78fb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78fb('0x4'))['db'];var utils=require(_0x78fb('0x5'));var logger=require('../../config/logger')(_0x78fb('0x6'));var config=require(_0x78fb('0x7'));var jayson=require(_0x78fb('0x8'));var client=jayson[_0x78fb('0x9')][_0x78fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x519f7c,_0x553faa,_0x55f5bf){return new BPromise(function(_0x5d38e2,_0x3011d3){return client[_0x78fb('0xb')](_0x519f7c,_0x55f5bf)[_0x78fb('0xc')](function(_0x59e579){logger[_0x78fb('0xd')](_0x78fb('0xe'),_0x553faa,_0x78fb('0xf'));logger[_0x78fb('0x10')](_0x78fb('0x11'),_0x553faa,_0x78fb('0xf'),JSON[_0x78fb('0x12')](_0x59e579));if(_0x59e579['error']){if(_0x59e579['error'][_0x78fb('0x13')]===0x1f4){logger[_0x78fb('0x14')](_0x78fb('0xe'),_0x553faa,_0x59e579[_0x78fb('0x14')][_0x78fb('0x15')]);return _0x3011d3(_0x59e579['error'][_0x78fb('0x15')]);}logger[_0x78fb('0x14')](_0x78fb('0xe'),_0x553faa,_0x59e579[_0x78fb('0x14')][_0x78fb('0x15')]);return _0x5d38e2(_0x59e579[_0x78fb('0x14')][_0x78fb('0x15')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x553faa,_0x78fb('0xf'));_0x5d38e2(_0x59e579['result'][_0x78fb('0x15')]);}})['catch'](function(_0x181a82){logger[_0x78fb('0x14')](_0x78fb('0xe'),_0x553faa,_0x181a82);_0x3011d3(_0x181a82);});});}exports['CreateFaxQueueReport']=function(_0x1cf52a){var _0x3de5e2=this;return new Promise(function(_0x308153,_0x569435){return db[_0x78fb('0x16')][_0x78fb('0x17')](_0x1cf52a['body'],{'raw':_0x1cf52a[_0x78fb('0x18')]?_0x1cf52a[_0x78fb('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x78fb('0xc')](function(_0x486ecd){logger[_0x78fb('0xd')](_0x78fb('0x19'),_0x1cf52a);logger[_0x78fb('0x10')](_0x78fb('0x19'),_0x1cf52a,JSON[_0x78fb('0x12')](_0x486ecd));_0x308153(_0x486ecd);})['catch'](function(_0x1785c9){logger[_0x78fb('0x14')](_0x78fb('0x19'),_0x1785c9[_0x78fb('0x15')],_0x1cf52a);_0x569435(_0x3de5e2['error'](0x1f4,_0x1785c9[_0x78fb('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0x8a4291){var _0x59914f=this;return new Promise(function(_0x27bfac,_0x189cbd){return db[_0x78fb('0x16')][_0x78fb('0x1a')](_0x8a4291[_0x78fb('0x1b')],{'raw':_0x8a4291['options']?_0x8a4291['options'][_0x78fb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8a4291[_0x78fb('0x18')]?_0x8a4291['options'][_0x78fb('0x1d')]||null:null,'attributes':_0x8a4291[_0x78fb('0x18')]?_0x8a4291[_0x78fb('0x18')][_0x78fb('0x1e')]||null:null,'limit':_0x8a4291['options']?_0x8a4291['options'][_0x78fb('0x1f')]||null:null})['then'](function(_0x233d9c){logger[_0x78fb('0xd')](_0x78fb('0x20'),_0x8a4291);logger[_0x78fb('0x10')]('UpdateFaxQueueReport',_0x8a4291,JSON[_0x78fb('0x12')](_0x233d9c));_0x27bfac(_0x233d9c);})[_0x78fb('0x21')](function(_0x221e48){logger[_0x78fb('0x14')](_0x78fb('0x20'),_0x221e48[_0x78fb('0x15')],_0x8a4291);_0x189cbd(_0x59914f[_0x78fb('0x14')](0x1f4,_0x221e48[_0x78fb('0x15')]));});});}; \ No newline at end of file +var _0x47dc=['code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','util','moment','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1325c2,_0x547793){var _0x174007=function(_0x5df622){while(--_0x5df622){_0x1325c2['push'](_0x1325c2['shift']());}};_0x174007(++_0x547793);}(_0x47dc,0xaf));var _0xc47d=function(_0x5cf873,_0x13c209){_0x5cf873=_0x5cf873-0x0;var _0x39eabc=_0x47dc[_0x5cf873];return _0x39eabc;};'use strict';var _=require('lodash');var util=require(_0xc47d('0x0'));var moment=require(_0xc47d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc47d('0x2'));var db=require(_0xc47d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc47d('0x4'));var jayson=require(_0xc47d('0x5'));var client=jayson[_0xc47d('0x6')][_0xc47d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1e28cd,_0x32f034,_0x37cbb7){return new BPromise(function(_0x5cb653,_0x1ccf8c){return client[_0xc47d('0x8')](_0x1e28cd,_0x37cbb7)[_0xc47d('0x9')](function(_0x50f3ad){logger[_0xc47d('0xa')](_0xc47d('0xb'),_0x32f034,_0xc47d('0xc'));logger[_0xc47d('0xd')](_0xc47d('0xe'),_0x32f034,'request\x20sent',JSON[_0xc47d('0xf')](_0x50f3ad));if(_0x50f3ad[_0xc47d('0x10')]){if(_0x50f3ad[_0xc47d('0x10')][_0xc47d('0x11')]===0x1f4){logger[_0xc47d('0x10')](_0xc47d('0xb'),_0x32f034,_0x50f3ad['error']['message']);return _0x1ccf8c(_0x50f3ad['error'][_0xc47d('0x12')]);}logger[_0xc47d('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x32f034,_0x50f3ad['error'][_0xc47d('0x12')]);return _0x5cb653(_0x50f3ad['error'][_0xc47d('0x12')]);}else{logger['info'](_0xc47d('0xb'),_0x32f034,_0xc47d('0xc'));_0x5cb653(_0x50f3ad[_0xc47d('0x13')]['message']);}})[_0xc47d('0x14')](function(_0x5ba1dd){logger['error'](_0xc47d('0xb'),_0x32f034,_0x5ba1dd);_0x1ccf8c(_0x5ba1dd);});});}exports[_0xc47d('0x15')]=function(_0x20c413){var _0x28e825=this;return new Promise(function(_0x5b4711,_0x65163){return db[_0xc47d('0x16')][_0xc47d('0x17')](_0x20c413[_0xc47d('0x18')],{'raw':_0x20c413['options']?_0x20c413[_0xc47d('0x19')][_0xc47d('0x1a')]===undefined?!![]:![]:!![]})[_0xc47d('0x9')](function(_0x4a55bd){logger[_0xc47d('0xa')](_0xc47d('0x15'),_0x20c413);logger[_0xc47d('0xd')](_0xc47d('0x15'),_0x20c413,JSON['stringify'](_0x4a55bd));_0x5b4711(_0x4a55bd);})[_0xc47d('0x14')](function(_0x627b0a){logger['error']('CreateFaxQueueReport',_0x627b0a[_0xc47d('0x12')],_0x20c413);_0x65163(_0x28e825[_0xc47d('0x10')](0x1f4,_0x627b0a['message']));});});};exports[_0xc47d('0x1b')]=function(_0x40eb6b){var _0x1a2d8b=this;return new Promise(function(_0x102cb6,_0x5a2f30){return db[_0xc47d('0x16')][_0xc47d('0x1c')](_0x40eb6b['body'],{'raw':_0x40eb6b['options']?_0x40eb6b[_0xc47d('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40eb6b[_0xc47d('0x19')]?_0x40eb6b[_0xc47d('0x19')][_0xc47d('0x1d')]||null:null,'attributes':_0x40eb6b['options']?_0x40eb6b[_0xc47d('0x19')][_0xc47d('0x1e')]||null:null,'limit':_0x40eb6b['options']?_0x40eb6b[_0xc47d('0x19')][_0xc47d('0x1f')]||null:null})[_0xc47d('0x9')](function(_0x25afc6){logger[_0xc47d('0xa')]('UpdateFaxQueueReport',_0x40eb6b);logger['debug']('UpdateFaxQueueReport',_0x40eb6b,JSON[_0xc47d('0xf')](_0x25afc6));_0x102cb6(_0x25afc6);})['catch'](function(_0x1bdb12){logger[_0xc47d('0x10')]('UpdateFaxQueueReport',_0x1bdb12[_0xc47d('0x12')],_0x40eb6b);_0x5a2f30(_0x1a2d8b['error'](0x1f4,_0x1bdb12[_0xc47d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index a5900ef..bafba4f 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 _0x9d5f=['destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','create','put','update','/:id'];(function(_0x125072,_0x5e3aeb){var _0x516136=function(_0x4d8adb){while(--_0x4d8adb){_0x125072['push'](_0x125072['shift']());}};_0x516136(++_0x5e3aeb);}(_0x9d5f,0x1de));var _0xf9d5=function(_0x353c02,_0x4f6765){_0x353c02=_0x353c02-0x0;var _0x419e3a=_0x9d5f[_0x353c02];return _0x419e3a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf9d5('0x0'));var timeout=require(_0xf9d5('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf9d5('0x2'));var auth=require(_0xf9d5('0x3'));var interaction=require(_0xf9d5('0x4'));var config=require(_0xf9d5('0x5'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0xf9d5('0x6')](),controller[_0xf9d5('0x7')]);router['get'](_0xf9d5('0x8'),auth[_0xf9d5('0x6')](),controller[_0xf9d5('0x9')]);router[_0xf9d5('0xa')]('/:id',auth[_0xf9d5('0x6')](),controller['show']);router['post']('/',auth[_0xf9d5('0x6')](),controller[_0xf9d5('0xb')]);router[_0xf9d5('0xc')]('/:id',auth[_0xf9d5('0x6')](),controller[_0xf9d5('0xd')]);router['delete'](_0xf9d5('0xe'),auth[_0xf9d5('0x6')](),controller[_0xf9d5('0xf')]);module[_0xf9d5('0x10')]=router; \ No newline at end of file +var _0x2ee1=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x2ee1,0x187));var _0x12ee=function(_0x2305f6,_0xae8fed){_0x2305f6=_0x2305f6-0x0;var _0x553a5c=_0x2ee1[_0x2305f6];return _0x553a5c;};'use strict';var multer=require('multer');var util=require(_0x12ee('0x0'));var path=require('path');var timeout=require(_0x12ee('0x1'));var express=require(_0x12ee('0x2'));var router=express['Router']();var fs_extra=require(_0x12ee('0x3'));var auth=require(_0x12ee('0x4'));var interaction=require(_0x12ee('0x5'));var config=require(_0x12ee('0x6'));var controller=require('./faxQueueReport.controller');router[_0x12ee('0x7')]('/',auth[_0x12ee('0x8')](),controller[_0x12ee('0x9')]);router['get'](_0x12ee('0xa'),auth[_0x12ee('0x8')](),controller['describe']);router[_0x12ee('0x7')](_0x12ee('0xb'),auth[_0x12ee('0x8')](),controller[_0x12ee('0xc')]);router[_0x12ee('0xd')]('/',auth[_0x12ee('0x8')](),controller[_0x12ee('0xe')]);router['put'](_0x12ee('0xb'),auth[_0x12ee('0x8')](),controller[_0x12ee('0xf')]);router[_0x12ee('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 8b7ce57..1708cec 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3c2e4e,_0x357207){var _0x773c58=function(_0x131231){while(--_0x131231){_0x3c2e4e['push'](_0x3c2e4e['shift']());}};_0x773c58(++_0x357207);}(_0x008c,0x188));var _0xc008=function(_0x49e66,_0x43f4b9){_0x49e66=_0x49e66-0x0;var _0x545549=_0x008c[_0x49e66];return _0x545549;};'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 +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x1c9c24,_0x2a517b){var _0x349c69=function(_0x259ff7){while(--_0x259ff7){_0x1c9c24['push'](_0x1c9c24['shift']());}};_0x349c69(++_0x2a517b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3211f3,_0x56d39a){_0x3211f3=_0x3211f3-0x0;var _0x101e88=_0xb43b[_0x3211f3];return _0x101e88;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 68847be..e3c0f2e 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 _0x5b6a=['Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','FaxTransferReport','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','find','create','catch','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0xb43d1b,_0x3935cf){var _0x4aafca=function(_0x3b26d2){while(--_0x3b26d2){_0xb43d1b['push'](_0xb43d1b['shift']());}};_0x4aafca(++_0x3935cf);}(_0x5b6a,0xbb));var _0xa5b6=function(_0x219197,_0x495225){_0x219197=_0x219197-0x0;var _0x3ec02c=_0x5b6a[_0x219197];return _0x3ec02c;};'use strict';var emlformat=require(_0xa5b6('0x0'));var rimraf=require(_0xa5b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa5b6('0x2'));var rp=require('request-promise');var moment=require(_0xa5b6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa5b6('0x4'));var util=require(_0xa5b6('0x5'));var path=require(_0xa5b6('0x6'));var sox=require(_0xa5b6('0x7'));var csv=require(_0xa5b6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5b6('0x9'));var _=require('lodash');var squel=require(_0xa5b6('0xa'));var crypto=require(_0xa5b6('0xb'));var jsforce=require(_0xa5b6('0xc'));var deskjs=require(_0xa5b6('0xd'));var toCsv=require(_0xa5b6('0x8'));var querystring=require(_0xa5b6('0xe'));var Papa=require(_0xa5b6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa5b6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5b6('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa5b6('0x12'));var db=require(_0xa5b6('0x13'))['db'];function respondWithStatusCode(_0x4dd631,_0xbb2666){_0xbb2666=_0xbb2666||0xcc;return function(_0x155caa){if(_0x155caa){return _0x4dd631[_0xa5b6('0x14')](_0xbb2666);}return _0x4dd631['status'](_0xbb2666)[_0xa5b6('0x15')]();};}function respondWithResult(_0x323e0b,_0x273679){_0x273679=_0x273679||0xc8;return function(_0x4545a0){if(_0x4545a0){return _0x323e0b[_0xa5b6('0x16')](_0x273679)[_0xa5b6('0x17')](_0x4545a0);}};}function respondWithFilteredResult(_0x2619a4,_0x2467c6){return function(_0x2282ba){if(_0x2282ba){var _0x432b8b=typeof _0x2467c6[_0xa5b6('0x18')]===_0xa5b6('0x19')&&typeof _0x2467c6[_0xa5b6('0x1a')]==='undefined';var _0x1b32b4=_0x2282ba['count'];var _0x3c5280=_0x432b8b?0x0:_0x2467c6['offset'];var _0x21c1b1=_0x432b8b?_0x2282ba[_0xa5b6('0x1b')]:_0x2467c6[_0xa5b6('0x18')]+_0x2467c6[_0xa5b6('0x1a')];var _0x4f968e;if(_0x21c1b1>=_0x1b32b4){_0x21c1b1=_0x1b32b4;_0x4f968e=0xc8;}else{_0x4f968e=0xce;}_0x2619a4[_0xa5b6('0x16')](_0x4f968e);return _0x2619a4[_0xa5b6('0x1c')](_0xa5b6('0x1d'),_0x3c5280+'-'+_0x21c1b1+'/'+_0x1b32b4)['json'](_0x2282ba);}return null;};}function patchUpdates(_0x4c6204){return function(_0x56ba5c){try{jsonpatch[_0xa5b6('0x1e')](_0x56ba5c,_0x4c6204,!![]);}catch(_0x54f33d){return BPromise[_0xa5b6('0x1f')](_0x54f33d);}return _0x56ba5c[_0xa5b6('0x20')]();};}function saveUpdates(_0x3e1eaa,_0x48c103){return function(_0x519c33){if(_0x519c33){return _0x519c33['update'](_0x3e1eaa)[_0xa5b6('0x21')](function(_0x1ed79b){return _0x1ed79b;});}return null;};}function removeEntity(_0x5e133d,_0x20c6b0){return function(_0x3841e8){if(_0x3841e8){return _0x3841e8[_0xa5b6('0x22')]()[_0xa5b6('0x21')](function(){_0x5e133d[_0xa5b6('0x16')](0xcc)[_0xa5b6('0x15')]();});}};}function handleEntityNotFound(_0x4c76de,_0x177643){return function(_0x24bd0b){if(!_0x24bd0b){_0x4c76de[_0xa5b6('0x14')](0x194);}return _0x24bd0b;};}function handleError(_0x5df23b,_0x2aad04){_0x2aad04=_0x2aad04||0x1f4;return function(_0x2e6f35){logger[_0xa5b6('0x23')](_0x2e6f35['stack']);if(_0x2e6f35['name']){delete _0x2e6f35[_0xa5b6('0x24')];}_0x5df23b[_0xa5b6('0x16')](_0x2aad04)[_0xa5b6('0x25')](_0x2e6f35);};}exports[_0xa5b6('0x26')]=function(_0x16424b,_0xdd42c2){var _0x4c8011={},_0x256dcc={},_0x1ed948={'count':0x0,'rows':[]};var _0x3ae5b0=_[_0xa5b6('0x27')](db[_0xa5b6('0x28')][_0xa5b6('0x29')],function(_0x64848e){return{'name':_0x64848e['fieldName'],'type':_0x64848e['type'][_0xa5b6('0x2a')]};});_0x256dcc[_0xa5b6('0x2b')]=_[_0xa5b6('0x27')](_0x3ae5b0,'name');_0x256dcc[_0xa5b6('0x2c')]=_[_0xa5b6('0x2d')](_0x16424b[_0xa5b6('0x2c')]);_0x256dcc[_0xa5b6('0x2e')]=_['intersection'](_0x256dcc['model'],_0x256dcc['query']);_0x4c8011[_0xa5b6('0x2f')]=_[_0xa5b6('0x30')](_0x256dcc[_0xa5b6('0x2b')],qs['fields'](_0x16424b[_0xa5b6('0x2c')][_0xa5b6('0x31')]));_0x4c8011[_0xa5b6('0x2f')]=_0x4c8011[_0xa5b6('0x2f')][_0xa5b6('0x32')]?_0x4c8011[_0xa5b6('0x2f')]:_0x256dcc[_0xa5b6('0x2b')];if(!_0x16424b['query'][_0xa5b6('0x33')](_0xa5b6('0x34'))){_0x4c8011[_0xa5b6('0x1a')]=qs[_0xa5b6('0x1a')](_0x16424b[_0xa5b6('0x2c')][_0xa5b6('0x1a')]);_0x4c8011[_0xa5b6('0x18')]=qs[_0xa5b6('0x18')](_0x16424b[_0xa5b6('0x2c')][_0xa5b6('0x18')]);}_0x4c8011[_0xa5b6('0x35')]=qs[_0xa5b6('0x36')](_0x16424b[_0xa5b6('0x2c')]['sort']);_0x4c8011[_0xa5b6('0x37')]=qs['filters'](_[_0xa5b6('0x38')](_0x16424b[_0xa5b6('0x2c')],_0x256dcc[_0xa5b6('0x2e')]),_0x3ae5b0);if(_0x16424b[_0xa5b6('0x2c')][_0xa5b6('0x39')]){_0x4c8011['where']=_[_0xa5b6('0x3a')](_0x4c8011[_0xa5b6('0x37')],{'$or':_['map'](_0x3ae5b0,function(_0x414fe6){if(_0x414fe6[_0xa5b6('0x3b')]!=='VIRTUAL'){var _0x513771={};_0x513771[_0x414fe6[_0xa5b6('0x24')]]={'$like':'%'+_0x16424b['query']['filter']+'%'};return _0x513771;}})});}_0x4c8011=_[_0xa5b6('0x3a')]({},_0x4c8011,_0x16424b[_0xa5b6('0x3c')]);var _0x3913f5={'where':_0x4c8011[_0xa5b6('0x37')]};return db[_0xa5b6('0x28')]['count'](_0x3913f5)['then'](function(_0x4d4a35){_0x1ed948[_0xa5b6('0x1b')]=_0x4d4a35;if(_0x16424b['query'][_0xa5b6('0x3d')]){_0x4c8011[_0xa5b6('0x3e')]=[{'all':!![]}];}return db[_0xa5b6('0x28')][_0xa5b6('0x3f')](_0x4c8011);})[_0xa5b6('0x21')](function(_0x3fde9f){_0x1ed948[_0xa5b6('0x40')]=_0x3fde9f;return _0x1ed948;})['then'](respondWithFilteredResult(_0xdd42c2,_0x4c8011))['catch'](handleError(_0xdd42c2,null));};exports[_0xa5b6('0x41')]=function(_0x21c884,_0x12f40a){var _0x283ad5={'raw':!![],'where':{'id':_0x21c884[_0xa5b6('0x42')]['id']}},_0x37ec55={};_0x37ec55[_0xa5b6('0x2b')]=_[_0xa5b6('0x2d')](db[_0xa5b6('0x28')]['rawAttributes']);_0x37ec55['query']=_[_0xa5b6('0x2d')](_0x21c884[_0xa5b6('0x2c')]);_0x37ec55[_0xa5b6('0x2e')]=_[_0xa5b6('0x30')](_0x37ec55[_0xa5b6('0x2b')],_0x37ec55[_0xa5b6('0x2c')]);_0x283ad5[_0xa5b6('0x2f')]=_[_0xa5b6('0x30')](_0x37ec55[_0xa5b6('0x2b')],qs['fields'](_0x21c884[_0xa5b6('0x2c')]['fields']));_0x283ad5[_0xa5b6('0x2f')]=_0x283ad5[_0xa5b6('0x2f')][_0xa5b6('0x32')]?_0x283ad5['attributes']:_0x37ec55[_0xa5b6('0x2b')];if(_0x21c884[_0xa5b6('0x2c')][_0xa5b6('0x3d')]){_0x283ad5['include']=[{'all':!![]}];}_0x283ad5=_['merge']({},_0x283ad5,_0x21c884[_0xa5b6('0x3c')]);return db['FaxTransferReport'][_0xa5b6('0x43')](_0x283ad5)['then'](handleEntityNotFound(_0x12f40a,null))[_0xa5b6('0x21')](respondWithResult(_0x12f40a,null))['catch'](handleError(_0x12f40a,null));};exports[_0xa5b6('0x44')]=function(_0x1880e5,_0x375af1){return db[_0xa5b6('0x28')][_0xa5b6('0x44')](_0x1880e5['body'],{})[_0xa5b6('0x21')](respondWithResult(_0x375af1,0xc9))[_0xa5b6('0x45')](handleError(_0x375af1,null));};exports['update']=function(_0x4c093c,_0x26b740){if(_0x4c093c[_0xa5b6('0x46')]['id']){delete _0x4c093c['body']['id'];}return db[_0xa5b6('0x28')][_0xa5b6('0x43')]({'where':{'id':_0x4c093c[_0xa5b6('0x42')]['id']}})['then'](handleEntityNotFound(_0x26b740,null))[_0xa5b6('0x21')](saveUpdates(_0x4c093c[_0xa5b6('0x46')],null))[_0xa5b6('0x21')](respondWithResult(_0x26b740,null))['catch'](handleError(_0x26b740,null));};exports[_0xa5b6('0x22')]=function(_0x2051ce,_0x5bebb4){return db[_0xa5b6('0x28')][_0xa5b6('0x43')]({'where':{'id':_0x2051ce[_0xa5b6('0x42')]['id']}})['then'](handleEntityNotFound(_0x5bebb4,null))[_0xa5b6('0x21')](removeEntity(_0x5bebb4,null))['catch'](handleError(_0x5bebb4,null));};exports[_0xa5b6('0x47')]=function(_0x49c412,_0xe3dadd){return db[_0xa5b6('0x28')][_0xa5b6('0x47')]()[_0xa5b6('0x21')](respondWithResult(_0xe3dadd,null))[_0xa5b6('0x45')](handleError(_0xe3dadd,null));}; \ No newline at end of file +var _0x6e60=['map','FaxTransferReport','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','count','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','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','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','end','error','stack','name','send'];(function(_0x268aa9,_0x4f3582){var _0x5c5bc4=function(_0x59a160){while(--_0x59a160){_0x268aa9['push'](_0x268aa9['shift']());}};_0x5c5bc4(++_0x4f3582);}(_0x6e60,0xc3));var _0x06e6=function(_0x543696,_0x80a066){_0x543696=_0x543696-0x0;var _0x4f25ce=_0x6e60[_0x543696];return _0x4f25ce;};'use strict';var emlformat=require(_0x06e6('0x0'));var rimraf=require(_0x06e6('0x1'));var zipdir=require(_0x06e6('0x2'));var jsonpatch=require(_0x06e6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x06e6('0x4'));var Mustache=require(_0x06e6('0x5'));var util=require(_0x06e6('0x6'));var path=require(_0x06e6('0x7'));var sox=require(_0x06e6('0x8'));var csv=require(_0x06e6('0x9'));var ejs=require(_0x06e6('0xa'));var fs=require('fs');var fs_extra=require(_0x06e6('0xb'));var _=require(_0x06e6('0xc'));var squel=require(_0x06e6('0xd'));var crypto=require(_0x06e6('0xe'));var jsforce=require(_0x06e6('0xf'));var deskjs=require(_0x06e6('0x10'));var toCsv=require(_0x06e6('0x9'));var querystring=require(_0x06e6('0x11'));var Papa=require(_0x06e6('0x12'));var Redis=require('ioredis');var authService=require(_0x06e6('0x13'));var qs=require(_0x06e6('0x14'));var as=require(_0x06e6('0x15'));var hardwareService=require(_0x06e6('0x16'));var logger=require('../../config/logger')(_0x06e6('0x17'));var utils=require(_0x06e6('0x18'));var config=require(_0x06e6('0x19'));var licenseUtil=require(_0x06e6('0x1a'));var db=require(_0x06e6('0x1b'))['db'];function respondWithStatusCode(_0x14a37c,_0x15b1cf){_0x15b1cf=_0x15b1cf||0xcc;return function(_0x48aa44){if(_0x48aa44){return _0x14a37c[_0x06e6('0x1c')](_0x15b1cf);}return _0x14a37c[_0x06e6('0x1d')](_0x15b1cf)['end']();};}function respondWithResult(_0x3f509a,_0x2c8ac4){_0x2c8ac4=_0x2c8ac4||0xc8;return function(_0x16a45c){if(_0x16a45c){return _0x3f509a[_0x06e6('0x1d')](_0x2c8ac4)[_0x06e6('0x1e')](_0x16a45c);}};}function respondWithFilteredResult(_0x51fc38,_0x30730){return function(_0x1becaa){if(_0x1becaa){var _0x5f1327=typeof _0x30730[_0x06e6('0x1f')]===_0x06e6('0x20')&&typeof _0x30730[_0x06e6('0x21')]===_0x06e6('0x20');var _0x1b2d02=_0x1becaa['count'];var _0x371f85=_0x5f1327?0x0:_0x30730['offset'];var _0x27d4cf=_0x5f1327?_0x1becaa['count']:_0x30730[_0x06e6('0x1f')]+_0x30730[_0x06e6('0x21')];var _0x2e8d40;if(_0x27d4cf>=_0x1b2d02){_0x27d4cf=_0x1b2d02;_0x2e8d40=0xc8;}else{_0x2e8d40=0xce;}_0x51fc38[_0x06e6('0x1d')](_0x2e8d40);return _0x51fc38[_0x06e6('0x22')](_0x06e6('0x23'),_0x371f85+'-'+_0x27d4cf+'/'+_0x1b2d02)[_0x06e6('0x1e')](_0x1becaa);}return null;};}function patchUpdates(_0x7f0928){return function(_0x5aed8f){try{jsonpatch['apply'](_0x5aed8f,_0x7f0928,!![]);}catch(_0x42e935){return BPromise[_0x06e6('0x24')](_0x42e935);}return _0x5aed8f[_0x06e6('0x25')]();};}function saveUpdates(_0x426f80,_0x5a0810){return function(_0x4f674f){if(_0x4f674f){return _0x4f674f[_0x06e6('0x26')](_0x426f80)[_0x06e6('0x27')](function(_0x398341){return _0x398341;});}return null;};}function removeEntity(_0x4b22cd,_0x73b389){return function(_0x4a34cc){if(_0x4a34cc){return _0x4a34cc['destroy']()[_0x06e6('0x27')](function(){_0x4b22cd['status'](0xcc)[_0x06e6('0x28')]();});}};}function handleEntityNotFound(_0x46ccce,_0x10513d){return function(_0x41af0c){if(!_0x41af0c){_0x46ccce['sendStatus'](0x194);}return _0x41af0c;};}function handleError(_0x32563f,_0x2bfb30){_0x2bfb30=_0x2bfb30||0x1f4;return function(_0x5bece6){logger[_0x06e6('0x29')](_0x5bece6[_0x06e6('0x2a')]);if(_0x5bece6[_0x06e6('0x2b')]){delete _0x5bece6[_0x06e6('0x2b')];}_0x32563f['status'](_0x2bfb30)[_0x06e6('0x2c')](_0x5bece6);};}exports['index']=function(_0x5b0249,_0x25e12c){var _0x5e347d={},_0x4958bd={},_0x1ea02b={'count':0x0,'rows':[]};var _0x5d36a8=_[_0x06e6('0x2d')](db[_0x06e6('0x2e')]['rawAttributes'],function(_0x2e72e7){return{'name':_0x2e72e7['fieldName'],'type':_0x2e72e7['type'][_0x06e6('0x2f')]};});_0x4958bd[_0x06e6('0x30')]=_[_0x06e6('0x2d')](_0x5d36a8,'name');_0x4958bd[_0x06e6('0x31')]=_[_0x06e6('0x32')](_0x5b0249[_0x06e6('0x31')]);_0x4958bd[_0x06e6('0x33')]=_['intersection'](_0x4958bd['model'],_0x4958bd[_0x06e6('0x31')]);_0x5e347d[_0x06e6('0x34')]=_[_0x06e6('0x35')](_0x4958bd[_0x06e6('0x30')],qs['fields'](_0x5b0249[_0x06e6('0x31')][_0x06e6('0x36')]));_0x5e347d[_0x06e6('0x34')]=_0x5e347d[_0x06e6('0x34')]['length']?_0x5e347d['attributes']:_0x4958bd[_0x06e6('0x30')];if(!_0x5b0249['query'][_0x06e6('0x37')](_0x06e6('0x38'))){_0x5e347d['limit']=qs[_0x06e6('0x21')](_0x5b0249[_0x06e6('0x31')][_0x06e6('0x21')]);_0x5e347d[_0x06e6('0x1f')]=qs['offset'](_0x5b0249[_0x06e6('0x31')][_0x06e6('0x1f')]);}_0x5e347d[_0x06e6('0x39')]=qs[_0x06e6('0x3a')](_0x5b0249[_0x06e6('0x31')][_0x06e6('0x3a')]);_0x5e347d[_0x06e6('0x3b')]=qs[_0x06e6('0x33')](_['pick'](_0x5b0249[_0x06e6('0x31')],_0x4958bd[_0x06e6('0x33')]),_0x5d36a8);if(_0x5b0249[_0x06e6('0x31')][_0x06e6('0x3c')]){_0x5e347d[_0x06e6('0x3b')]=_[_0x06e6('0x3d')](_0x5e347d['where'],{'$or':_[_0x06e6('0x2d')](_0x5d36a8,function(_0x5ce02d){if(_0x5ce02d[_0x06e6('0x3e')]!==_0x06e6('0x3f')){var _0x589e0c={};_0x589e0c[_0x5ce02d[_0x06e6('0x2b')]]={'$like':'%'+_0x5b0249[_0x06e6('0x31')][_0x06e6('0x3c')]+'%'};return _0x589e0c;}})});}_0x5e347d=_['merge']({},_0x5e347d,_0x5b0249['options']);var _0x391f80={'where':_0x5e347d[_0x06e6('0x3b')]};return db[_0x06e6('0x2e')][_0x06e6('0x40')](_0x391f80)[_0x06e6('0x27')](function(_0x11b9b6){_0x1ea02b[_0x06e6('0x40')]=_0x11b9b6;if(_0x5b0249[_0x06e6('0x31')]['includeAll']){_0x5e347d[_0x06e6('0x41')]=[{'all':!![]}];}return db[_0x06e6('0x2e')][_0x06e6('0x42')](_0x5e347d);})[_0x06e6('0x27')](function(_0x422213){_0x1ea02b[_0x06e6('0x43')]=_0x422213;return _0x1ea02b;})[_0x06e6('0x27')](respondWithFilteredResult(_0x25e12c,_0x5e347d))[_0x06e6('0x44')](handleError(_0x25e12c,null));};exports[_0x06e6('0x45')]=function(_0x29d2c8,_0x58e51f){var _0x137224={'raw':!![],'where':{'id':_0x29d2c8[_0x06e6('0x46')]['id']}},_0x2e1daf={};_0x2e1daf['model']=_[_0x06e6('0x32')](db[_0x06e6('0x2e')][_0x06e6('0x47')]);_0x2e1daf[_0x06e6('0x31')]=_['keys'](_0x29d2c8[_0x06e6('0x31')]);_0x2e1daf[_0x06e6('0x33')]=_[_0x06e6('0x35')](_0x2e1daf[_0x06e6('0x30')],_0x2e1daf[_0x06e6('0x31')]);_0x137224[_0x06e6('0x34')]=_[_0x06e6('0x35')](_0x2e1daf['model'],qs[_0x06e6('0x36')](_0x29d2c8[_0x06e6('0x31')][_0x06e6('0x36')]));_0x137224[_0x06e6('0x34')]=_0x137224[_0x06e6('0x34')][_0x06e6('0x48')]?_0x137224['attributes']:_0x2e1daf[_0x06e6('0x30')];if(_0x29d2c8[_0x06e6('0x31')][_0x06e6('0x49')]){_0x137224[_0x06e6('0x41')]=[{'all':!![]}];}_0x137224=_[_0x06e6('0x3d')]({},_0x137224,_0x29d2c8[_0x06e6('0x4a')]);return db[_0x06e6('0x2e')][_0x06e6('0x4b')](_0x137224)[_0x06e6('0x27')](handleEntityNotFound(_0x58e51f,null))['then'](respondWithResult(_0x58e51f,null))[_0x06e6('0x44')](handleError(_0x58e51f,null));};exports[_0x06e6('0x4c')]=function(_0x363834,_0x1aa3dd){return db['FaxTransferReport'][_0x06e6('0x4c')](_0x363834[_0x06e6('0x4d')],{})[_0x06e6('0x27')](respondWithResult(_0x1aa3dd,0xc9))[_0x06e6('0x44')](handleError(_0x1aa3dd,null));};exports['update']=function(_0x50bcd4,_0x2b34ee){if(_0x50bcd4['body']['id']){delete _0x50bcd4['body']['id'];}return db[_0x06e6('0x2e')]['find']({'where':{'id':_0x50bcd4[_0x06e6('0x46')]['id']}})[_0x06e6('0x27')](handleEntityNotFound(_0x2b34ee,null))[_0x06e6('0x27')](saveUpdates(_0x50bcd4[_0x06e6('0x4d')],null))[_0x06e6('0x27')](respondWithResult(_0x2b34ee,null))[_0x06e6('0x44')](handleError(_0x2b34ee,null));};exports[_0x06e6('0x4e')]=function(_0x97110a,_0x44f003){return db[_0x06e6('0x2e')][_0x06e6('0x4b')]({'where':{'id':_0x97110a['params']['id']}})[_0x06e6('0x27')](handleEntityNotFound(_0x44f003,null))[_0x06e6('0x27')](removeEntity(_0x44f003,null))[_0x06e6('0x44')](handleError(_0x44f003,null));};exports[_0x06e6('0x4f')]=function(_0x1aa5ee,_0x1cb0dc){return db['FaxTransferReport'][_0x06e6('0x4f')]()[_0x06e6('0x27')](respondWithResult(_0x1cb0dc,null))[_0x06e6('0x44')](handleError(_0x1cb0dc,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index ee5d245..6d94c00 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 _0xaa55=['report_fax_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0xaa55,0x183));var _0x5aa5=function(_0x54dfb0,_0x31aedf){_0x54dfb0=_0x54dfb0-0x0;var _0x173fe9=_0xaa55[_0x54dfb0];return _0x173fe9;};'use strict';var _=require('lodash');var util=require(_0x5aa5('0x0'));var logger=require(_0x5aa5('0x1'))(_0x5aa5('0x2'));var moment=require(_0x5aa5('0x3'));var BPromise=require(_0x5aa5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5aa5('0x5'));var config=require(_0x5aa5('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x5aa5('0x7')]=function(_0x53764b,_0x603d33){return _0x53764b[_0x5aa5('0x8')]('FaxTransferReport',attributes,{'tableName':_0x5aa5('0x9'),'paranoid':![],'indexes':[{'name':_0x5aa5('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x142c=['exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x42a6cd,_0x5cc6a4){var _0x3854c4=function(_0xe4a6ed){while(--_0xe4a6ed){_0x42a6cd['push'](_0x42a6cd['shift']());}};_0x3854c4(++_0x5cc6a4);}(_0x142c,0x163));var _0xc142=function(_0x5baee9,_0x416e7c){_0x5baee9=_0x5baee9-0x0;var _0x419234=_0x142c[_0x5baee9];return _0x419234;};'use strict';var _=require(_0xc142('0x0'));var util=require(_0xc142('0x1'));var logger=require(_0xc142('0x2'))(_0xc142('0x3'));var moment=require(_0xc142('0x4'));var BPromise=require(_0xc142('0x5'));var rp=require(_0xc142('0x6'));var fs=require('fs');var path=require(_0xc142('0x7'));var rimraf=require(_0xc142('0x8'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0xc142('0x9')]=function(_0x583735,_0x531f02){return _0x583735[_0xc142('0xa')]('FaxTransferReport',attributes,{'tableName':_0xc142('0xb'),'paranoid':![],'indexes':[{'name':_0xc142('0xc'),'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 19b57df..15d3e25 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 _0xd486=['stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x9b1fd6,_0x15a735){var _0x37920d=function(_0x14cc2c){while(--_0x14cc2c){_0x9b1fd6['push'](_0x9b1fd6['shift']());}};_0x37920d(++_0x15a735);}(_0xd486,0xcd));var _0x6d48=function(_0x50b458,_0x1d7850){_0x50b458=_0x50b458-0x0;var _0x43437c=_0xd486[_0x50b458];return _0x43437c;};'use strict';var _=require('lodash');var util=require(_0x6d48('0x0'));var moment=require(_0x6d48('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d48('0x2'));var fs=require('fs');var Redis=require(_0x6d48('0x3'));var db=require(_0x6d48('0x4'))['db'];var utils=require(_0x6d48('0x5'));var logger=require('../../config/logger')(_0x6d48('0x6'));var config=require('../../config/environment');var jayson=require(_0x6d48('0x7'));var client=jayson['client'][_0x6d48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x595930,_0x5dc7ac,_0x5286eb){return new BPromise(function(_0x44d754,_0x159c33){return client[_0x6d48('0x9')](_0x595930,_0x5286eb)[_0x6d48('0xa')](function(_0x33d9a3){logger[_0x6d48('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x5dc7ac,_0x6d48('0xc'));logger[_0x6d48('0xd')](_0x6d48('0xe'),_0x5dc7ac,_0x6d48('0xc'),JSON[_0x6d48('0xf')](_0x33d9a3));if(_0x33d9a3['error']){if(_0x33d9a3[_0x6d48('0x10')][_0x6d48('0x11')]===0x1f4){logger[_0x6d48('0x10')](_0x6d48('0x12'),_0x5dc7ac,_0x33d9a3[_0x6d48('0x10')]['message']);return _0x159c33(_0x33d9a3[_0x6d48('0x10')][_0x6d48('0x13')]);}logger['error'](_0x6d48('0x12'),_0x5dc7ac,_0x33d9a3[_0x6d48('0x10')]['message']);return _0x44d754(_0x33d9a3['error']['message']);}else{logger['info'](_0x6d48('0x12'),_0x5dc7ac,'request\x20sent');_0x44d754(_0x33d9a3[_0x6d48('0x14')]['message']);}})[_0x6d48('0x15')](function(_0x1ae723){logger[_0x6d48('0x10')](_0x6d48('0x12'),_0x5dc7ac,_0x1ae723);_0x159c33(_0x1ae723);});});} \ No newline at end of file +var _0x314c=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x2e6141,_0x3a472e){var _0x132d19=function(_0x4ab5fc){while(--_0x4ab5fc){_0x2e6141['push'](_0x2e6141['shift']());}};_0x132d19(++_0x3a472e);}(_0x314c,0x17a));var _0xc314=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x314c[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xc314('0x0'));var util=require(_0xc314('0x1'));var moment=require(_0xc314('0x2'));var BPromise=require('bluebird');var rs=require(_0xc314('0x3'));var fs=require('fs');var Redis=require(_0xc314('0x4'));var db=require(_0xc314('0x5'))['db'];var utils=require(_0xc314('0x6'));var logger=require(_0xc314('0x7'))('rpc');var config=require(_0xc314('0x8'));var jayson=require(_0xc314('0x9'));var client=jayson[_0xc314('0xa')][_0xc314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x165f59,_0x50ca52,_0x7eae71){return new BPromise(function(_0x5a37ec,_0xdd6673){return client['request'](_0x165f59,_0x7eae71)['then'](function(_0x34f644){logger[_0xc314('0xc')](_0xc314('0xd'),_0x50ca52,_0xc314('0xe'));logger[_0xc314('0xf')](_0xc314('0x10'),_0x50ca52,_0xc314('0xe'),JSON['stringify'](_0x34f644));if(_0x34f644[_0xc314('0x11')]){if(_0x34f644[_0xc314('0x11')][_0xc314('0x12')]===0x1f4){logger['error'](_0xc314('0xd'),_0x50ca52,_0x34f644[_0xc314('0x11')][_0xc314('0x13')]);return _0xdd6673(_0x34f644[_0xc314('0x11')][_0xc314('0x13')]);}logger[_0xc314('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x50ca52,_0x34f644[_0xc314('0x11')][_0xc314('0x13')]);return _0x5a37ec(_0x34f644['error']['message']);}else{logger[_0xc314('0xc')](_0xc314('0xd'),_0x50ca52,_0xc314('0xe'));_0x5a37ec(_0x34f644['result']['message']);}})[_0xc314('0x14')](function(_0xf522cc){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x50ca52,_0xf522cc);_0xdd6673(_0xf522cc);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index b49683c..4e65181 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 _0x893f=['index','/describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated'];(function(_0x3de030,_0x287b37){var _0x3fbb84=function(_0xd35029){while(--_0xd35029){_0x3de030['push'](_0x3de030['shift']());}};_0x3fbb84(++_0x287b37);}(_0x893f,0x16e));var _0xf893=function(_0x4ac3ca,_0x36fde3){_0x4ac3ca=_0x4ac3ca-0x0;var _0x319d6e=_0x893f[_0x4ac3ca];return _0x319d6e;};'use strict';var multer=require(_0xf893('0x0'));var util=require(_0xf893('0x1'));var path=require(_0xf893('0x2'));var timeout=require(_0xf893('0x3'));var express=require(_0xf893('0x4'));var router=express[_0xf893('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf893('0x6'));var interaction=require(_0xf893('0x7'));var config=require(_0xf893('0x8'));var controller=require(_0xf893('0x9'));router[_0xf893('0xa')]('/',auth[_0xf893('0xb')](),controller[_0xf893('0xc')]);router[_0xf893('0xa')](_0xf893('0xd'),auth[_0xf893('0xb')](),controller['describe']);router['get'](_0xf893('0xe'),auth[_0xf893('0xb')](),controller[_0xf893('0xf')]);router[_0xf893('0x10')]('/',auth[_0xf893('0xb')](),controller[_0xf893('0x11')]);router['put']('/:id',auth[_0xf893('0xb')](),controller[_0xf893('0x12')]);router['delete'](_0xf893('0xe'),auth[_0xf893('0xb')](),controller[_0xf893('0x13')]);module[_0xf893('0x14')]=router; \ No newline at end of file +var _0x21cb=['./faxTransferReport.controller','get','isAuthenticated','index','describe','post','create','put','/:id','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2f6acc,_0x4c35ab){var _0xc775bc=function(_0x173504){while(--_0x173504){_0x2f6acc['push'](_0x2f6acc['shift']());}};_0xc775bc(++_0x4c35ab);}(_0x21cb,0x1cd));var _0xb21c=function(_0x2aa5d3,_0x320c98){_0x2aa5d3=_0x2aa5d3-0x0;var _0x597975=_0x21cb[_0x2aa5d3];return _0x597975;};'use strict';var multer=require(_0xb21c('0x0'));var util=require('util');var path=require(_0xb21c('0x1'));var timeout=require(_0xb21c('0x2'));var express=require(_0xb21c('0x3'));var router=express[_0xb21c('0x4')]();var fs_extra=require(_0xb21c('0x5'));var auth=require(_0xb21c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb21c('0x7'));router[_0xb21c('0x8')]('/',auth[_0xb21c('0x9')](),controller[_0xb21c('0xa')]);router[_0xb21c('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xb21c('0xb')]);router[_0xb21c('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb21c('0xc')]('/',auth[_0xb21c('0x9')](),controller[_0xb21c('0xd')]);router[_0xb21c('0xe')](_0xb21c('0xf'),auth[_0xb21c('0x9')](),controller[_0xb21c('0x10')]);router['delete'](_0xb21c('0xf'),auth[_0xb21c('0x9')](),controller[_0xb21c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 7c65ed7..c33eb10 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 _0x394e=['/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x2f333c,_0xb839ab){var _0x3adbc4=function(_0x11c531){while(--_0x11c531){_0x2f333c['push'](_0x2f333c['shift']());}};_0x3adbc4(++_0xb839ab);}(_0x394e,0x147));var _0xe394=function(_0x3a45cc,_0x48b29c){_0x3a45cc=_0x3a45cc-0x0;var _0xad0f1b=_0x394e[_0x3a45cc];return _0xad0f1b;};'use strict';var multer=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var path=require(_0xe394('0x2'));var timeout=require(_0xe394('0x3'));var express=require('express');var router=express[_0xe394('0x4')]();var fs_extra=require(_0xe394('0x5'));var auth=require(_0xe394('0x6'));var interaction=require(_0xe394('0x7'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0xe394('0x8')]('/',auth[_0xe394('0x9')](),controller[_0xe394('0xa')]);router[_0xe394('0x8')](_0xe394('0xb'),auth[_0xe394('0x9')](),controller[_0xe394('0xc')]);router['get'](_0xe394('0xd'),auth[_0xe394('0x9')](),controller['getConfigurations']);router[_0xe394('0x8')](_0xe394('0xe'),auth[_0xe394('0x9')](),controller[_0xe394('0xf')]);router[_0xe394('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe394('0x10')]('/:id/configurations',auth[_0xe394('0x9')](),controller[_0xe394('0x11')]);router[_0xe394('0x12')]('/:id',auth[_0xe394('0x9')](),controller['update']);router[_0xe394('0x13')]('/:id',auth[_0xe394('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8ebc=['/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ebc,0x70));var _0xc8eb=function(_0x5d3898,_0x489f5d){_0x5d3898=_0x5d3898-0x0;var _0x233dc9=_0x8ebc[_0x5d3898];return _0x233dc9;};'use strict';var multer=require(_0xc8eb('0x0'));var util=require(_0xc8eb('0x1'));var path=require(_0xc8eb('0x2'));var timeout=require(_0xc8eb('0x3'));var express=require(_0xc8eb('0x4'));var router=express['Router']();var fs_extra=require(_0xc8eb('0x5'));var auth=require(_0xc8eb('0x6'));var interaction=require(_0xc8eb('0x7'));var config=require(_0xc8eb('0x8'));var controller=require(_0xc8eb('0x9'));router[_0xc8eb('0xa')]('/',auth[_0xc8eb('0xb')](),controller[_0xc8eb('0xc')]);router[_0xc8eb('0xa')](_0xc8eb('0xd'),auth[_0xc8eb('0xb')](),controller['show']);router[_0xc8eb('0xa')](_0xc8eb('0xe'),auth['isAuthenticated'](),controller[_0xc8eb('0xf')]);router[_0xc8eb('0xa')](_0xc8eb('0x10'),auth[_0xc8eb('0xb')](),controller[_0xc8eb('0x11')]);router[_0xc8eb('0x12')]('/',auth[_0xc8eb('0xb')](),controller[_0xc8eb('0x13')]);router[_0xc8eb('0x12')]('/:id/configurations',auth[_0xc8eb('0xb')](),controller[_0xc8eb('0x14')]);router[_0xc8eb('0x15')](_0xc8eb('0xd'),auth[_0xc8eb('0xb')](),controller[_0xc8eb('0x16')]);router[_0xc8eb('0x17')]('/:id',auth[_0xc8eb('0xb')](),controller[_0xc8eb('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index ebf3e44..7c34697 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 _0x2134=['ENUM','integrationTab','newTab','exports','STRING','basic'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0x2134,0x69));var _0x4213=function(_0x1f99cf,_0x5d4618){_0x1f99cf=_0x1f99cf-0x0;var _0x7eb0cf=_0x2134[_0x1f99cf];return _0x7eb0cf;};'use strict';var Sequelize=require('sequelize');module[_0x4213('0x0')]={'name':{'type':Sequelize[_0x4213('0x1')]},'description':{'type':Sequelize[_0x4213('0x1')]},'username':{'type':Sequelize[_0x4213('0x1')]},'remoteUri':{'type':Sequelize[_0x4213('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x4213('0x2')),'defaultValue':_0x4213('0x2')},'password':{'type':Sequelize[_0x4213('0x1')]},'consumerKey':{'type':Sequelize[_0x4213('0x1')]},'consumerSecret':{'type':Sequelize[_0x4213('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x4213('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4213('0x3')](_0x4213('0x4'),_0x4213('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x7ea9=['integrationTab','newTab','exports','STRING','basic'];(function(_0x3da2ad,_0x88e4b6){var _0x2f665d=function(_0x4d0fa1){while(--_0x4d0fa1){_0x3da2ad['push'](_0x3da2ad['shift']());}};_0x2f665d(++_0x88e4b6);}(_0x7ea9,0x110));var _0x97ea=function(_0x1cd597,_0x860c7e){_0x1cd597=_0x1cd597-0x0;var _0xce52f3=_0x7ea9[_0x1cd597];return _0xce52f3;};'use strict';var Sequelize=require('sequelize');module[_0x97ea('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x97ea('0x1')]},'username':{'type':Sequelize[_0x97ea('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x97ea('0x2')),'defaultValue':_0x97ea('0x2')},'password':{'type':Sequelize[_0x97ea('0x1')]},'consumerKey':{'type':Sequelize[_0x97ea('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x97ea('0x1')]},'tokenSecret':{'type':Sequelize[_0x97ea('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x97ea('0x3'),_0x97ea('0x4')),'defaultValue':_0x97ea('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 9e4464e..c150191 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 _0x660d=['util','path','to-csv','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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','reject','save','update','destroy','error','stack','name','index','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','options','DeskAccount','then','includeAll','include','findAll','show','params','catch','create','body','find','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','username','consumerKey','consumerSecret','token','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','Basic\x20%s','%s:%s','password','toString','base64','concat','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','eml-format','rimraf','zip-dir','bluebird','mustache'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x660d,0x6e));var _0xd660=function(_0x30063a,_0x4a55c8){_0x30063a=_0x30063a-0x0;var _0x2024d2=_0x660d[_0x30063a];return _0x2024d2;};'use strict';var emlformat=require(_0xd660('0x0'));var rimraf=require(_0xd660('0x1'));var zipdir=require(_0xd660('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd660('0x3'));var Mustache=require(_0xd660('0x4'));var util=require(_0xd660('0x5'));var path=require(_0xd660('0x6'));var sox=require('sox');var csv=require(_0xd660('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd660('0x8'));var _=require(_0xd660('0x9'));var squel=require(_0xd660('0xa'));var crypto=require(_0xd660('0xb'));var jsforce=require(_0xd660('0xc'));var deskjs=require(_0xd660('0xd'));var toCsv=require(_0xd660('0x7'));var querystring=require(_0xd660('0xe'));var Papa=require(_0xd660('0xf'));var Redis=require('ioredis');var authService=require(_0xd660('0x10'));var qs=require(_0xd660('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd660('0x12'));var logger=require(_0xd660('0x13'))(_0xd660('0x14'));var utils=require(_0xd660('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd660('0x16'));var db=require(_0xd660('0x17'))['db'];var integrations=require(_0xd660('0x18'));function respondWithStatusCode(_0x3b2956,_0x2bb7aa){_0x2bb7aa=_0x2bb7aa||0xcc;return function(_0x7a518e){if(_0x7a518e){return _0x3b2956[_0xd660('0x19')](_0x2bb7aa);}return _0x3b2956[_0xd660('0x1a')](_0x2bb7aa)[_0xd660('0x1b')]();};}function respondWithResult(_0x14080e,_0x43eb9d){_0x43eb9d=_0x43eb9d||0xc8;return function(_0x4b3a36){if(_0x4b3a36){return _0x14080e['status'](_0x43eb9d)['json'](_0x4b3a36);}};}function respondWithFilteredResult(_0x1326ae,_0x401bfc){return function(_0x4339c4){if(_0x4339c4){var _0x2babf6=typeof _0x401bfc['offset']==='undefined'&&typeof _0x401bfc[_0xd660('0x1c')]===_0xd660('0x1d');var _0x5cc772=_0x4339c4['count'];var _0x56dfd3=_0x2babf6?0x0:_0x401bfc[_0xd660('0x1e')];var _0x52ff01=_0x2babf6?_0x4339c4[_0xd660('0x1f')]:_0x401bfc[_0xd660('0x1e')]+_0x401bfc[_0xd660('0x1c')];var _0x14f249;if(_0x52ff01>=_0x5cc772){_0x52ff01=_0x5cc772;_0x14f249=0xc8;}else{_0x14f249=0xce;}_0x1326ae[_0xd660('0x1a')](_0x14f249);return _0x1326ae[_0xd660('0x20')](_0xd660('0x21'),_0x56dfd3+'-'+_0x52ff01+'/'+_0x5cc772)[_0xd660('0x22')](_0x4339c4);}return null;};}function patchUpdates(_0x4f112a){return function(_0x2b7507){try{jsonpatch['apply'](_0x2b7507,_0x4f112a,!![]);}catch(_0x140200){return BPromise[_0xd660('0x23')](_0x140200);}return _0x2b7507[_0xd660('0x24')]();};}function saveUpdates(_0x56f5d1,_0xfe3aba){return function(_0x12f9f3){if(_0x12f9f3){return _0x12f9f3[_0xd660('0x25')](_0x56f5d1)['then'](function(_0x1f4723){return _0x1f4723;});}return null;};}function removeEntity(_0x28c354,_0x3ac322){return function(_0xb11b8a){if(_0xb11b8a){return _0xb11b8a[_0xd660('0x26')]()['then'](function(){_0x28c354[_0xd660('0x1a')](0xcc)[_0xd660('0x1b')]();});}};}function handleEntityNotFound(_0x444b7f,_0x4bcac2){return function(_0x1c06ef){if(!_0x1c06ef){_0x444b7f[_0xd660('0x19')](0x194);}return _0x1c06ef;};}function handleError(_0x22117c,_0xd4efc2){_0xd4efc2=_0xd4efc2||0x1f4;return function(_0x251406){logger[_0xd660('0x27')](_0x251406[_0xd660('0x28')]);if(_0x251406[_0xd660('0x29')]){delete _0x251406[_0xd660('0x29')];}_0x22117c[_0xd660('0x1a')](_0xd4efc2)['send'](_0x251406);};}exports[_0xd660('0x2a')]=function(_0x29f2c8,_0x253bf2){var _0x3bb6f6={},_0x2c865c={},_0x28ef09={'count':0x0,'rows':[]};var _0x805048=_[_0xd660('0x2b')](db['DeskAccount'][_0xd660('0x2c')],function(_0x42de1e){return{'name':_0x42de1e['fieldName'],'type':_0x42de1e['type'][_0xd660('0x2d')]};});_0x2c865c[_0xd660('0x2e')]=_[_0xd660('0x2b')](_0x805048,_0xd660('0x29'));_0x2c865c[_0xd660('0x2f')]=_[_0xd660('0x30')](_0x29f2c8[_0xd660('0x2f')]);_0x2c865c['filters']=_[_0xd660('0x31')](_0x2c865c['model'],_0x2c865c[_0xd660('0x2f')]);_0x3bb6f6[_0xd660('0x32')]=_[_0xd660('0x31')](_0x2c865c['model'],qs[_0xd660('0x33')](_0x29f2c8[_0xd660('0x2f')]['fields']));_0x3bb6f6[_0xd660('0x32')]=_0x3bb6f6[_0xd660('0x32')][_0xd660('0x34')]?_0x3bb6f6[_0xd660('0x32')]:_0x2c865c['model'];if(!_0x29f2c8[_0xd660('0x2f')][_0xd660('0x35')](_0xd660('0x36'))){_0x3bb6f6[_0xd660('0x1c')]=qs[_0xd660('0x1c')](_0x29f2c8[_0xd660('0x2f')][_0xd660('0x1c')]);_0x3bb6f6[_0xd660('0x1e')]=qs[_0xd660('0x1e')](_0x29f2c8[_0xd660('0x2f')]['offset']);}_0x3bb6f6[_0xd660('0x37')]=qs[_0xd660('0x38')](_0x29f2c8[_0xd660('0x2f')][_0xd660('0x38')]);_0x3bb6f6[_0xd660('0x39')]=qs[_0xd660('0x3a')](_['pick'](_0x29f2c8[_0xd660('0x2f')],_0x2c865c['filters']),_0x805048);if(_0x29f2c8[_0xd660('0x2f')][_0xd660('0x3b')]){_0x3bb6f6['where']=_[_0xd660('0x3c')](_0x3bb6f6[_0xd660('0x39')],{'$or':_['map'](_0x805048,function(_0x2e3641){if(_0x2e3641[_0xd660('0x3d')]!=='VIRTUAL'){var _0xdec552={};_0xdec552[_0x2e3641[_0xd660('0x29')]]={'$like':'%'+_0x29f2c8['query'][_0xd660('0x3b')]+'%'};return _0xdec552;}})});}_0x3bb6f6=_[_0xd660('0x3c')]({},_0x3bb6f6,_0x29f2c8[_0xd660('0x3e')]);var _0x1d987d={'where':_0x3bb6f6[_0xd660('0x39')]};return db[_0xd660('0x3f')][_0xd660('0x1f')](_0x1d987d)[_0xd660('0x40')](function(_0x55ee0c){_0x28ef09[_0xd660('0x1f')]=_0x55ee0c;if(_0x29f2c8['query'][_0xd660('0x41')]){_0x3bb6f6[_0xd660('0x42')]=[{'all':!![]}];}return db[_0xd660('0x3f')][_0xd660('0x43')](_0x3bb6f6);})[_0xd660('0x40')](function(_0x3cb00f){_0x28ef09['rows']=_0x3cb00f;return _0x28ef09;})[_0xd660('0x40')](respondWithFilteredResult(_0x253bf2,_0x3bb6f6))['catch'](handleError(_0x253bf2,null));};exports[_0xd660('0x44')]=function(_0x2c1bd2,_0x1f91b8){var _0x9630aa={'raw':![],'where':{'id':_0x2c1bd2[_0xd660('0x45')]['id']}},_0x2a601c={};_0x2a601c['model']=_[_0xd660('0x30')](db[_0xd660('0x3f')][_0xd660('0x2c')]);_0x2a601c[_0xd660('0x2f')]=_[_0xd660('0x30')](_0x2c1bd2['query']);_0x2a601c[_0xd660('0x3a')]=_[_0xd660('0x31')](_0x2a601c[_0xd660('0x2e')],_0x2a601c[_0xd660('0x2f')]);_0x9630aa[_0xd660('0x32')]=_[_0xd660('0x31')](_0x2a601c[_0xd660('0x2e')],qs[_0xd660('0x33')](_0x2c1bd2[_0xd660('0x2f')][_0xd660('0x33')]));_0x9630aa['attributes']=_0x9630aa['attributes']['length']?_0x9630aa['attributes']:_0x2a601c[_0xd660('0x2e')];if(_0x2c1bd2[_0xd660('0x2f')][_0xd660('0x41')]){_0x9630aa['include']=[{'all':!![]}];}_0x9630aa=_['merge']({},_0x9630aa,_0x2c1bd2[_0xd660('0x3e')]);return db['DeskAccount']['find'](_0x9630aa)[_0xd660('0x40')](handleEntityNotFound(_0x1f91b8,null))[_0xd660('0x40')](respondWithResult(_0x1f91b8,null))[_0xd660('0x46')](handleError(_0x1f91b8,null));};exports[_0xd660('0x47')]=function(_0x29ac1a,_0xf8daa8){return db[_0xd660('0x3f')][_0xd660('0x47')](_0x29ac1a['body'],{})[_0xd660('0x40')](respondWithResult(_0xf8daa8,0xc9))[_0xd660('0x46')](handleError(_0xf8daa8,null));};exports[_0xd660('0x25')]=function(_0x1d44df,_0x2260b7){if(_0x1d44df[_0xd660('0x48')]['id']){delete _0x1d44df['body']['id'];}return db[_0xd660('0x3f')][_0xd660('0x49')]({'where':{'id':_0x1d44df[_0xd660('0x45')]['id']}})['then'](handleEntityNotFound(_0x2260b7,null))[_0xd660('0x40')](saveUpdates(_0x1d44df[_0xd660('0x48')],null))['then'](respondWithResult(_0x2260b7,null))[_0xd660('0x46')](handleError(_0x2260b7,null));};exports[_0xd660('0x26')]=function(_0x4bac9f,_0x7a315d){return db[_0xd660('0x3f')]['find']({'where':{'id':_0x4bac9f[_0xd660('0x45')]['id']}})[_0xd660('0x40')](handleEntityNotFound(_0x7a315d,null))['then'](removeEntity(_0x7a315d,null))[_0xd660('0x46')](handleError(_0x7a315d,null));};exports[_0xd660('0x4a')]=function(_0x408491,_0x4ae3fb,_0x34f649){var _0x4e1ebf={};var _0x45f7c6={};var _0x325885;var _0x2a9855;return db[_0xd660('0x3f')][_0xd660('0x4b')]({'where':{'id':_0x408491[_0xd660('0x45')]['id']}})[_0xd660('0x40')](handleEntityNotFound(_0x4ae3fb,null))[_0xd660('0x40')](function(_0x12e9ac){if(_0x12e9ac){_0x325885=_0x12e9ac;_0x45f7c6[_0xd660('0x2e')]=_['keys'](db[_0xd660('0x4c')][_0xd660('0x2c')]);_0x45f7c6[_0xd660('0x2f')]=_[_0xd660('0x30')](_0x408491[_0xd660('0x2f')]);_0x45f7c6[_0xd660('0x3a')]=_[_0xd660('0x31')](_0x45f7c6['model'],_0x45f7c6[_0xd660('0x2f')]);_0x4e1ebf[_0xd660('0x32')]=_[_0xd660('0x31')](_0x45f7c6[_0xd660('0x2e')],qs[_0xd660('0x33')](_0x408491[_0xd660('0x2f')][_0xd660('0x33')]));_0x4e1ebf[_0xd660('0x32')]=_0x4e1ebf[_0xd660('0x32')][_0xd660('0x34')]?_0x4e1ebf[_0xd660('0x32')]:_0x45f7c6[_0xd660('0x2e')];_0x4e1ebf[_0xd660('0x37')]=qs[_0xd660('0x38')](_0x408491[_0xd660('0x2f')][_0xd660('0x38')]);_0x4e1ebf[_0xd660('0x39')]=qs['filters'](_['pick'](_0x408491['query'],_0x45f7c6[_0xd660('0x3a')]));if(_0x408491[_0xd660('0x2f')]['filter']){_0x4e1ebf[_0xd660('0x39')]=_[_0xd660('0x3c')](_0x4e1ebf[_0xd660('0x39')],{'$or':_['map'](_0x4e1ebf[_0xd660('0x32')],function(_0x16ab9a){var _0x515b9f={};_0x515b9f[_0x16ab9a]={'$like':'%'+_0x408491[_0xd660('0x2f')]['filter']+'%'};return _0x515b9f;})});}_0x4e1ebf=_[_0xd660('0x3c')]({},_0x4e1ebf,_0x408491[_0xd660('0x3e')]);return _0x325885[_0xd660('0x4a')](_0x4e1ebf);}})[_0xd660('0x40')](function(_0x534e6e){if(_0x534e6e){_0x2a9855=_0x534e6e['length'];if(!_0x408491[_0xd660('0x2f')][_0xd660('0x35')](_0xd660('0x36'))){_0x4e1ebf[_0xd660('0x1c')]=qs[_0xd660('0x1c')](_0x408491[_0xd660('0x2f')][_0xd660('0x1c')]);_0x4e1ebf[_0xd660('0x1e')]=qs[_0xd660('0x1e')](_0x408491[_0xd660('0x2f')][_0xd660('0x1e')]);}return _0x325885[_0xd660('0x4a')](_0x4e1ebf);}})[_0xd660('0x40')](function(_0xc654cb){if(_0xc654cb){return _0xc654cb?{'count':_0x2a9855,'rows':_0xc654cb}:null;}})[_0xd660('0x40')](respondWithResult(_0x4ae3fb,null))[_0xd660('0x46')](handleError(_0x4ae3fb,null));};exports[_0xd660('0x4d')]=function(_0x273ca9,_0x1f063d,_0x41c233){if(_0x273ca9[_0xd660('0x48')]['id']){delete _0x273ca9[_0xd660('0x48')]['id'];}return db['DeskAccount'][_0xd660('0x4b')]({'where':{'id':_0x273ca9[_0xd660('0x45')]['id']}})[_0xd660('0x40')](handleEntityNotFound(_0x1f063d,null))[_0xd660('0x40')](function(_0x4798e2){if(_0x4798e2){_0x273ca9[_0xd660('0x48')][_0xd660('0x4e')]=_0x4798e2['id'];_0x273ca9[_0xd660('0x48')][_0xd660('0x4f')]=integrations['getSubjects'](_0x273ca9[_0xd660('0x48')][_0xd660('0x50')],_0x273ca9[_0xd660('0x48')][_0xd660('0x3d')]);_0x273ca9['body'][_0xd660('0x51')]=integrations[_0xd660('0x52')](_0x273ca9[_0xd660('0x48')]['channel'],_0x273ca9['body']['type']);return db['DeskConfiguration']['create'](_0x273ca9[_0xd660('0x48')],{'include':[{'model':db[_0xd660('0x53')],'as':'Subjects'},{'model':db[_0xd660('0x53')],'as':'Descriptions'}]});}return null;})[_0xd660('0x40')](respondWithResult(_0x1f063d,null))['catch'](handleError(_0x1f063d,null));};exports['getFields']=function(_0x59954a,_0x280511,_0x579338){var _0x1f39ae=[{'name':_0xd660('0x54'),'label':_0xd660('0x54'),'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 _0x5351fd='';return db[_0xd660('0x3f')]['findOne']({'where':{'id':_0x59954a[_0xd660('0x45')]['id']},'attributes':['id',_0xd660('0x55'),'authType',_0xd660('0x56'),'password',_0xd660('0x57'),_0xd660('0x58'),_0xd660('0x59'),'tokenSecret']})[_0xd660('0x40')](handleEntityNotFound(_0x280511,null))[_0xd660('0x40')](function(_0x4380d4){if(_0x4380d4){_0x5351fd=_0x4380d4['remoteUri'];var _0x2d18c0=_0x5351fd['slice'](-0x1);if(_0x2d18c0==='/'){_0x5351fd=_0x5351fd[_0xd660('0x5a')](0x0,_0x5351fd[_0xd660('0x5b')](_0x2d18c0));}var _0x223eba={'method':_0xd660('0x5c'),'uri':util[_0xd660('0x5d')](_0xd660('0x5e'),_0x5351fd),'headers':{'Content-Type':_0xd660('0x5f'),'Accept':'application/json'},'json':!![]};if(_0x4380d4[_0xd660('0x60')]===_0xd660('0x61')){_0x223eba[_0xd660('0x62')][_0xd660('0x63')]=util[_0xd660('0x5d')](_0xd660('0x64'),new Buffer(util['format'](_0xd660('0x65'),_0x4380d4[_0xd660('0x56')],_0x4380d4[_0xd660('0x66')]))[_0xd660('0x67')](_0xd660('0x68')));}return rp(_0x223eba)[_0xd660('0x40')](function(_0x531644){return _0x1f39ae[_0xd660('0x69')](_[_0xd660('0x2b')](_0x531644[_0xd660('0x6a')][_0xd660('0x6b')],function(_0xa73ef4){return{'id':_0xa73ef4['name'],'name':_0xa73ef4[_0xd660('0x29')],'type':_0xa73ef4['type'],'active':_0xa73ef4['active'],'label':_0xa73ef4[_0xd660('0x6c')],'custom':!![]};}));});}})[_0xd660('0x40')](function(_0x23c65b){return{'count':_0x23c65b[_0xd660('0x34')],'rows':_0x23c65b};})[_0xd660('0x40')](respondWithResult(_0x280511,null))[_0xd660('0x46')](function(_0x40946f){var _0x15a617=_0x59954a[_0xd660('0x2f')][_0xd660('0x6d')]?0x1f4:_0x40946f[_0xd660('0x6e')]||0x1f4;logger['error'](_0xd660('0x6f'),_0xd660('0x70'),_0x15a617,JSON[_0xd660('0x71')](_0x40946f));delete _0x40946f[_0xd660('0x29')];if(_0x15a617===0x191){_0x15a617=0x190;}_0x280511[_0xd660('0x1a')](_0x15a617)[_0xd660('0x72')](_0x59954a[_0xd660('0x2f')][_0xd660('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x40946f['statusCode']}:_0x40946f);});}; \ No newline at end of file +var _0x2942=['find','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','create','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','slice','substring','lastIndexOf','GET','format','application/json','basic','Basic\x20%s','%s:%s','toString','concat','map','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params'];(function(_0x48771b,_0x46a461){var _0x3996c6=function(_0x1bf0c0){while(--_0x1bf0c0){_0x48771b['push'](_0x48771b['shift']());}};_0x3996c6(++_0x46a461);}(_0x2942,0x9b));var _0x2294=function(_0x3271f5,_0x510ea1){_0x3271f5=_0x3271f5-0x0;var _0x18ac61=_0x2942[_0x3271f5];return _0x18ac61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2294('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2294('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2294('0x2'));var Mustache=require(_0x2294('0x3'));var util=require(_0x2294('0x4'));var path=require(_0x2294('0x5'));var sox=require('sox');var csv=require(_0x2294('0x6'));var ejs=require(_0x2294('0x7'));var fs=require('fs');var fs_extra=require(_0x2294('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2294('0x9'));var jsforce=require(_0x2294('0xa'));var deskjs=require(_0x2294('0xb'));var toCsv=require(_0x2294('0x6'));var querystring=require(_0x2294('0xc'));var Papa=require(_0x2294('0xd'));var Redis=require(_0x2294('0xe'));var authService=require(_0x2294('0xf'));var qs=require(_0x2294('0x10'));var as=require(_0x2294('0x11'));var hardwareService=require(_0x2294('0x12'));var logger=require(_0x2294('0x13'))(_0x2294('0x14'));var utils=require('../../config/utils');var config=require(_0x2294('0x15'));var licenseUtil=require(_0x2294('0x16'));var db=require(_0x2294('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1577cc,_0x2a5a1f){_0x2a5a1f=_0x2a5a1f||0xcc;return function(_0xea6bb6){if(_0xea6bb6){return _0x1577cc[_0x2294('0x18')](_0x2a5a1f);}return _0x1577cc['status'](_0x2a5a1f)[_0x2294('0x19')]();};}function respondWithResult(_0x30bc53,_0x337b41){_0x337b41=_0x337b41||0xc8;return function(_0x4dab89){if(_0x4dab89){return _0x30bc53[_0x2294('0x1a')](_0x337b41)['json'](_0x4dab89);}};}function respondWithFilteredResult(_0x4111bd,_0x2db769){return function(_0x567443){if(_0x567443){var _0x345aaf=typeof _0x2db769[_0x2294('0x1b')]===_0x2294('0x1c')&&typeof _0x2db769[_0x2294('0x1d')]===_0x2294('0x1c');var _0x33882c=_0x567443['count'];var _0xdf834d=_0x345aaf?0x0:_0x2db769[_0x2294('0x1b')];var _0x54a38e=_0x345aaf?_0x567443['count']:_0x2db769[_0x2294('0x1b')]+_0x2db769[_0x2294('0x1d')];var _0x5edc65;if(_0x54a38e>=_0x33882c){_0x54a38e=_0x33882c;_0x5edc65=0xc8;}else{_0x5edc65=0xce;}_0x4111bd['status'](_0x5edc65);return _0x4111bd[_0x2294('0x1e')](_0x2294('0x1f'),_0xdf834d+'-'+_0x54a38e+'/'+_0x33882c)[_0x2294('0x20')](_0x567443);}return null;};}function patchUpdates(_0x25e261){return function(_0x3d3a16){try{jsonpatch[_0x2294('0x21')](_0x3d3a16,_0x25e261,!![]);}catch(_0x5eb3d8){return BPromise[_0x2294('0x22')](_0x5eb3d8);}return _0x3d3a16['save']();};}function saveUpdates(_0x2818af,_0x54fa8e){return function(_0x172229){if(_0x172229){return _0x172229[_0x2294('0x23')](_0x2818af)[_0x2294('0x24')](function(_0xaaecc9){return _0xaaecc9;});}return null;};}function removeEntity(_0x2eb249,_0x2bb08c){return function(_0x197f8b){if(_0x197f8b){return _0x197f8b[_0x2294('0x25')]()[_0x2294('0x24')](function(){_0x2eb249[_0x2294('0x1a')](0xcc)[_0x2294('0x19')]();});}};}function handleEntityNotFound(_0x25fb98,_0x1ec770){return function(_0x48e7ae){if(!_0x48e7ae){_0x25fb98[_0x2294('0x18')](0x194);}return _0x48e7ae;};}function handleError(_0xab161,_0x3091f4){_0x3091f4=_0x3091f4||0x1f4;return function(_0x3b51fd){logger[_0x2294('0x26')](_0x3b51fd['stack']);if(_0x3b51fd[_0x2294('0x27')]){delete _0x3b51fd[_0x2294('0x27')];}_0xab161[_0x2294('0x1a')](_0x3091f4)[_0x2294('0x28')](_0x3b51fd);};}exports[_0x2294('0x29')]=function(_0x1c8861,_0x126c43){var _0x56d5b3={},_0x4f0b9f={},_0x399c1a={'count':0x0,'rows':[]};var _0x131e63=_['map'](db[_0x2294('0x2a')][_0x2294('0x2b')],function(_0x566c31){return{'name':_0x566c31[_0x2294('0x2c')],'type':_0x566c31[_0x2294('0x2d')][_0x2294('0x2e')]};});_0x4f0b9f[_0x2294('0x2f')]=_['map'](_0x131e63,'name');_0x4f0b9f['query']=_[_0x2294('0x30')](_0x1c8861[_0x2294('0x31')]);_0x4f0b9f['filters']=_[_0x2294('0x32')](_0x4f0b9f[_0x2294('0x2f')],_0x4f0b9f[_0x2294('0x31')]);_0x56d5b3['attributes']=_[_0x2294('0x32')](_0x4f0b9f['model'],qs[_0x2294('0x33')](_0x1c8861['query'][_0x2294('0x33')]));_0x56d5b3[_0x2294('0x34')]=_0x56d5b3[_0x2294('0x34')][_0x2294('0x35')]?_0x56d5b3[_0x2294('0x34')]:_0x4f0b9f['model'];if(!_0x1c8861[_0x2294('0x31')][_0x2294('0x36')](_0x2294('0x37'))){_0x56d5b3[_0x2294('0x1d')]=qs[_0x2294('0x1d')](_0x1c8861[_0x2294('0x31')]['limit']);_0x56d5b3[_0x2294('0x1b')]=qs[_0x2294('0x1b')](_0x1c8861[_0x2294('0x31')]['offset']);}_0x56d5b3[_0x2294('0x38')]=qs['sort'](_0x1c8861['query'][_0x2294('0x39')]);_0x56d5b3[_0x2294('0x3a')]=qs[_0x2294('0x3b')](_[_0x2294('0x3c')](_0x1c8861[_0x2294('0x31')],_0x4f0b9f[_0x2294('0x3b')]),_0x131e63);if(_0x1c8861[_0x2294('0x31')][_0x2294('0x3d')]){_0x56d5b3['where']=_[_0x2294('0x3e')](_0x56d5b3[_0x2294('0x3a')],{'$or':_['map'](_0x131e63,function(_0x4032fe){if(_0x4032fe['type']!==_0x2294('0x3f')){var _0x3f812f={};_0x3f812f[_0x4032fe['name']]={'$like':'%'+_0x1c8861[_0x2294('0x31')]['filter']+'%'};return _0x3f812f;}})});}_0x56d5b3=_['merge']({},_0x56d5b3,_0x1c8861[_0x2294('0x40')]);var _0x4c9a71={'where':_0x56d5b3['where']};return db[_0x2294('0x2a')]['count'](_0x4c9a71)[_0x2294('0x24')](function(_0x1574ac){_0x399c1a[_0x2294('0x41')]=_0x1574ac;if(_0x1c8861[_0x2294('0x31')][_0x2294('0x42')]){_0x56d5b3[_0x2294('0x43')]=[{'all':!![]}];}return db[_0x2294('0x2a')][_0x2294('0x44')](_0x56d5b3);})[_0x2294('0x24')](function(_0x3da2cd){_0x399c1a[_0x2294('0x45')]=_0x3da2cd;return _0x399c1a;})[_0x2294('0x24')](respondWithFilteredResult(_0x126c43,_0x56d5b3))[_0x2294('0x46')](handleError(_0x126c43,null));};exports[_0x2294('0x47')]=function(_0x2031cd,_0x4fee01){var _0x231d6b={'raw':![],'where':{'id':_0x2031cd[_0x2294('0x48')]['id']}},_0x196dab={};_0x196dab[_0x2294('0x2f')]=_[_0x2294('0x30')](db[_0x2294('0x2a')][_0x2294('0x2b')]);_0x196dab[_0x2294('0x31')]=_['keys'](_0x2031cd[_0x2294('0x31')]);_0x196dab['filters']=_[_0x2294('0x32')](_0x196dab['model'],_0x196dab[_0x2294('0x31')]);_0x231d6b[_0x2294('0x34')]=_[_0x2294('0x32')](_0x196dab[_0x2294('0x2f')],qs[_0x2294('0x33')](_0x2031cd[_0x2294('0x31')][_0x2294('0x33')]));_0x231d6b['attributes']=_0x231d6b[_0x2294('0x34')]['length']?_0x231d6b[_0x2294('0x34')]:_0x196dab['model'];if(_0x2031cd[_0x2294('0x31')][_0x2294('0x42')]){_0x231d6b[_0x2294('0x43')]=[{'all':!![]}];}_0x231d6b=_[_0x2294('0x3e')]({},_0x231d6b,_0x2031cd[_0x2294('0x40')]);return db['DeskAccount'][_0x2294('0x49')](_0x231d6b)[_0x2294('0x24')](handleEntityNotFound(_0x4fee01,null))[_0x2294('0x24')](respondWithResult(_0x4fee01,null))[_0x2294('0x46')](handleError(_0x4fee01,null));};exports['create']=function(_0x20304b,_0x33d84e){return db[_0x2294('0x2a')]['create'](_0x20304b[_0x2294('0x4a')],{})[_0x2294('0x24')](respondWithResult(_0x33d84e,0xc9))[_0x2294('0x46')](handleError(_0x33d84e,null));};exports[_0x2294('0x23')]=function(_0x1db3e8,_0x290f56){if(_0x1db3e8[_0x2294('0x4a')]['id']){delete _0x1db3e8[_0x2294('0x4a')]['id'];}return db['DeskAccount'][_0x2294('0x49')]({'where':{'id':_0x1db3e8[_0x2294('0x48')]['id']}})[_0x2294('0x24')](handleEntityNotFound(_0x290f56,null))[_0x2294('0x24')](saveUpdates(_0x1db3e8['body'],null))[_0x2294('0x24')](respondWithResult(_0x290f56,null))['catch'](handleError(_0x290f56,null));};exports[_0x2294('0x25')]=function(_0x2b2974,_0x2e4900){return db[_0x2294('0x2a')][_0x2294('0x49')]({'where':{'id':_0x2b2974[_0x2294('0x48')]['id']}})[_0x2294('0x24')](handleEntityNotFound(_0x2e4900,null))[_0x2294('0x24')](removeEntity(_0x2e4900,null))[_0x2294('0x46')](handleError(_0x2e4900,null));};exports[_0x2294('0x4b')]=function(_0x5ecac2,_0x818c6a,_0x4379c3){var _0x29723d={};var _0x4f31d4={};var _0x25d742;var _0x2f5439;return db[_0x2294('0x2a')][_0x2294('0x4c')]({'where':{'id':_0x5ecac2[_0x2294('0x48')]['id']}})[_0x2294('0x24')](handleEntityNotFound(_0x818c6a,null))[_0x2294('0x24')](function(_0x89c068){if(_0x89c068){_0x25d742=_0x89c068;_0x4f31d4['model']=_[_0x2294('0x30')](db[_0x2294('0x4d')][_0x2294('0x2b')]);_0x4f31d4[_0x2294('0x31')]=_[_0x2294('0x30')](_0x5ecac2['query']);_0x4f31d4[_0x2294('0x3b')]=_[_0x2294('0x32')](_0x4f31d4[_0x2294('0x2f')],_0x4f31d4[_0x2294('0x31')]);_0x29723d['attributes']=_[_0x2294('0x32')](_0x4f31d4[_0x2294('0x2f')],qs[_0x2294('0x33')](_0x5ecac2[_0x2294('0x31')][_0x2294('0x33')]));_0x29723d[_0x2294('0x34')]=_0x29723d[_0x2294('0x34')]['length']?_0x29723d[_0x2294('0x34')]:_0x4f31d4['model'];_0x29723d[_0x2294('0x38')]=qs[_0x2294('0x39')](_0x5ecac2[_0x2294('0x31')][_0x2294('0x39')]);_0x29723d[_0x2294('0x3a')]=qs[_0x2294('0x3b')](_[_0x2294('0x3c')](_0x5ecac2[_0x2294('0x31')],_0x4f31d4[_0x2294('0x3b')]));if(_0x5ecac2[_0x2294('0x31')][_0x2294('0x3d')]){_0x29723d[_0x2294('0x3a')]=_['merge'](_0x29723d[_0x2294('0x3a')],{'$or':_['map'](_0x29723d[_0x2294('0x34')],function(_0x1accd7){var _0x5038f7={};_0x5038f7[_0x1accd7]={'$like':'%'+_0x5ecac2[_0x2294('0x31')][_0x2294('0x3d')]+'%'};return _0x5038f7;})});}_0x29723d=_['merge']({},_0x29723d,_0x5ecac2[_0x2294('0x40')]);return _0x25d742['getConfigurations'](_0x29723d);}})[_0x2294('0x24')](function(_0xc4ab68){if(_0xc4ab68){_0x2f5439=_0xc4ab68[_0x2294('0x35')];if(!_0x5ecac2[_0x2294('0x31')][_0x2294('0x36')](_0x2294('0x37'))){_0x29723d['limit']=qs[_0x2294('0x1d')](_0x5ecac2[_0x2294('0x31')]['limit']);_0x29723d[_0x2294('0x1b')]=qs[_0x2294('0x1b')](_0x5ecac2[_0x2294('0x31')][_0x2294('0x1b')]);}return _0x25d742[_0x2294('0x4b')](_0x29723d);}})[_0x2294('0x24')](function(_0x58245c){if(_0x58245c){return _0x58245c?{'count':_0x2f5439,'rows':_0x58245c}:null;}})['then'](respondWithResult(_0x818c6a,null))[_0x2294('0x46')](handleError(_0x818c6a,null));};exports[_0x2294('0x4e')]=function(_0x3bd06b,_0x1dde73,_0x4395b4){if(_0x3bd06b['body']['id']){delete _0x3bd06b[_0x2294('0x4a')]['id'];}return db[_0x2294('0x2a')][_0x2294('0x4c')]({'where':{'id':_0x3bd06b[_0x2294('0x48')]['id']}})[_0x2294('0x24')](handleEntityNotFound(_0x1dde73,null))[_0x2294('0x24')](function(_0x51f752){if(_0x51f752){_0x3bd06b['body'][_0x2294('0x4f')]=_0x51f752['id'];_0x3bd06b['body'][_0x2294('0x50')]=integrations[_0x2294('0x51')](_0x3bd06b[_0x2294('0x4a')][_0x2294('0x52')],_0x3bd06b[_0x2294('0x4a')][_0x2294('0x2d')]);_0x3bd06b['body']['Descriptions']=integrations[_0x2294('0x53')](_0x3bd06b[_0x2294('0x4a')][_0x2294('0x52')],_0x3bd06b[_0x2294('0x4a')][_0x2294('0x2d')]);return db[_0x2294('0x4d')][_0x2294('0x54')](_0x3bd06b[_0x2294('0x4a')],{'include':[{'model':db[_0x2294('0x55')],'as':_0x2294('0x50')},{'model':db[_0x2294('0x55')],'as':_0x2294('0x56')}]});}return null;})['then'](respondWithResult(_0x1dde73,null))[_0x2294('0x46')](handleError(_0x1dde73,null));};exports[_0x2294('0x57')]=function(_0x20f69b,_0x514857,_0x38b7e9){var _0x67e34a=[{'name':'priority','label':_0x2294('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 _0x389e3f='';return db[_0x2294('0x2a')][_0x2294('0x4c')]({'where':{'id':_0x20f69b[_0x2294('0x48')]['id']},'attributes':['id',_0x2294('0x59'),_0x2294('0x5a'),_0x2294('0x5b'),_0x2294('0x5c'),_0x2294('0x5d'),'consumerSecret','token','tokenSecret']})[_0x2294('0x24')](handleEntityNotFound(_0x514857,null))[_0x2294('0x24')](function(_0x2d044c){if(_0x2d044c){_0x389e3f=_0x2d044c['remoteUri'];var _0x4305f3=_0x389e3f[_0x2294('0x5e')](-0x1);if(_0x4305f3==='/'){_0x389e3f=_0x389e3f[_0x2294('0x5f')](0x0,_0x389e3f[_0x2294('0x60')](_0x4305f3));}var _0x1ffeb9={'method':_0x2294('0x61'),'uri':util[_0x2294('0x62')]('%s/custom_fields',_0x389e3f),'headers':{'Content-Type':_0x2294('0x63'),'Accept':_0x2294('0x63')},'json':!![]};if(_0x2d044c[_0x2294('0x5a')]===_0x2294('0x64')){_0x1ffeb9['headers']['Authorization']=util[_0x2294('0x62')](_0x2294('0x65'),new Buffer(util[_0x2294('0x62')](_0x2294('0x66'),_0x2d044c[_0x2294('0x5b')],_0x2d044c['password']))[_0x2294('0x67')]('base64'));}return rp(_0x1ffeb9)['then'](function(_0x331a66){return _0x67e34a[_0x2294('0x68')](_[_0x2294('0x69')](_0x331a66['_embedded'][_0x2294('0x6a')],function(_0x10adb5){return{'id':_0x10adb5[_0x2294('0x27')],'name':_0x10adb5[_0x2294('0x27')],'type':_0x10adb5['type'],'active':_0x10adb5[_0x2294('0x6b')],'label':_0x10adb5[_0x2294('0x6c')],'custom':!![]};}));});}})[_0x2294('0x24')](function(_0x2964c0){return{'count':_0x2964c0[_0x2294('0x35')],'rows':_0x2964c0};})[_0x2294('0x24')](respondWithResult(_0x514857,null))[_0x2294('0x46')](function(_0x9ba293){var _0x52b580=_0x20f69b[_0x2294('0x31')]['test']?0x1f4:_0x9ba293[_0x2294('0x6d')]||0x1f4;logger[_0x2294('0x26')](_0x2294('0x6e'),_0x2294('0x57'),_0x52b580,JSON[_0x2294('0x6f')](_0x9ba293));delete _0x9ba293[_0x2294('0x27')];if(_0x52b580===0x191){_0x52b580=0x190;}_0x514857['status'](_0x52b580)[_0x2294('0x28')](_0x20f69b[_0x2294('0x31')][_0x2294('0x70')]?{'message':_0x2294('0x71'),'statusCode':_0x9ba293[_0x2294('0x6d')]}:_0x9ba293);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d59ed70..2da88c5 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 _0x804f=['request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api'];(function(_0x16c2b1,_0x36a70c){var _0x199ac4=function(_0x2f1802){while(--_0x2f1802){_0x16c2b1['push'](_0x16c2b1['shift']());}};_0x199ac4(++_0x36a70c);}(_0x804f,0x158));var _0xf804=function(_0x3d3ef7,_0x5616c2){_0x3d3ef7=_0x3d3ef7-0x0;var _0x99c02f=_0x804f[_0x3d3ef7];return _0x99c02f;};'use strict';var _=require(_0xf804('0x0'));var util=require(_0xf804('0x1'));var logger=require(_0xf804('0x2'))(_0xf804('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf804('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf804('0x5'));var config=require(_0xf804('0x6'));var attributes=require(_0xf804('0x7'));var integrations=require(_0xf804('0x8'));module['exports']=function(_0x5e5e48,_0x12472a){return _0x5e5e48[_0xf804('0x9')](_0xf804('0xa'),attributes,{'tableName':_0xf804('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa035=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','int_desk_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa035,0x179));var _0x5a03=function(_0x4be9bf,_0xeeade9){_0x4be9bf=_0x4be9bf-0x0;var _0x2388b6=_0xa035[_0x4be9bf];return _0x2388b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a03('0x0'))(_0x5a03('0x1'));var moment=require(_0x5a03('0x2'));var BPromise=require(_0x5a03('0x3'));var rp=require(_0x5a03('0x4'));var fs=require('fs');var path=require(_0x5a03('0x5'));var rimraf=require(_0x5a03('0x6'));var config=require(_0x5a03('0x7'));var attributes=require(_0x5a03('0x8'));var integrations=require(_0x5a03('0x9'));module['exports']=function(_0x4e5c19,_0x5146b7){return _0x4e5c19[_0x5a03('0xa')]('DeskAccount',attributes,{'tableName':_0x5a03('0xb'),'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 e258a09..9aa9238 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 _0xa6bf=['GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x496b02,_0x4cf688){var _0x358680=function(_0x3e103f){while(--_0x3e103f){_0x496b02['push'](_0x496b02['shift']());}};_0x358680(++_0x4cf688);}(_0xa6bf,0x76));var _0xfa6b=function(_0x4fdadb,_0x4bbdc9){_0x4fdadb=_0x4fdadb-0x0;var _0x212abd=_0xa6bf[_0x4fdadb];return _0x212abd;};'use strict';var _=require(_0xfa6b('0x0'));var util=require(_0xfa6b('0x1'));var moment=require(_0xfa6b('0x2'));var BPromise=require(_0xfa6b('0x3'));var rs=require(_0xfa6b('0x4'));var fs=require('fs');var Redis=require(_0xfa6b('0x5'));var db=require(_0xfa6b('0x6'))['db'];var utils=require(_0xfa6b('0x7'));var logger=require(_0xfa6b('0x8'))('rpc');var config=require(_0xfa6b('0x9'));var jayson=require(_0xfa6b('0xa'));var client=jayson[_0xfa6b('0xb')][_0xfa6b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3cb264,_0x13c118,_0x98280b){return new BPromise(function(_0x3bc531,_0x21395b){return client['request'](_0x3cb264,_0x98280b)['then'](function(_0x2f5cc){logger[_0xfa6b('0xd')](_0xfa6b('0xe'),_0x13c118,_0xfa6b('0xf'));logger[_0xfa6b('0x10')](_0xfa6b('0x11'),_0x13c118,_0xfa6b('0xf'),JSON['stringify'](_0x2f5cc));if(_0x2f5cc[_0xfa6b('0x12')]){if(_0x2f5cc[_0xfa6b('0x12')]['code']===0x1f4){logger[_0xfa6b('0x12')](_0xfa6b('0xe'),_0x13c118,_0x2f5cc[_0xfa6b('0x12')]['message']);return _0x21395b(_0x2f5cc[_0xfa6b('0x12')]['message']);}logger[_0xfa6b('0x12')](_0xfa6b('0xe'),_0x13c118,_0x2f5cc[_0xfa6b('0x12')][_0xfa6b('0x13')]);return _0x3bc531(_0x2f5cc[_0xfa6b('0x12')][_0xfa6b('0x13')]);}else{logger[_0xfa6b('0xd')](_0xfa6b('0xe'),_0x13c118,_0xfa6b('0xf'));_0x3bc531(_0x2f5cc[_0xfa6b('0x14')][_0xfa6b('0x13')]);}})[_0xfa6b('0x15')](function(_0x5483ee){logger['error'](_0xfa6b('0xe'),_0x13c118,_0x5483ee);_0x21395b(_0x5483ee);});});}exports[_0xfa6b('0x16')]=function(_0x42efa1){var _0x412c00=this;return new Promise(function(_0x4b4801,_0x1dc8f3){return db[_0xfa6b('0x17')][_0xfa6b('0x18')]({'raw':_0x42efa1['options']?_0x42efa1[_0xfa6b('0x19')][_0xfa6b('0x1a')]===undefined?!![]:![]:!![],'where':_0x42efa1[_0xfa6b('0x19')]?_0x42efa1['options'][_0xfa6b('0x1b')]||null:null,'attributes':_0x42efa1[_0xfa6b('0x19')]?_0x42efa1['options'][_0xfa6b('0x1c')]||null:null,'limit':_0x42efa1['options']?_0x42efa1['options'][_0xfa6b('0x1d')]||null:null,'include':_0x42efa1[_0xfa6b('0x19')]?_0x42efa1[_0xfa6b('0x19')][_0xfa6b('0x1e')]?_[_0xfa6b('0x1f')](_0x42efa1['options']['include'],function(_0x7d4907){return{'model':db[_0x7d4907['model']],'as':_0x7d4907['as'],'attributes':_0x7d4907[_0xfa6b('0x1c')],'include':_0x7d4907[_0xfa6b('0x1e')]?_[_0xfa6b('0x1f')](_0x7d4907[_0xfa6b('0x1e')],function(_0x35bed5){return{'model':db[_0x35bed5[_0xfa6b('0x20')]],'as':_0x35bed5['as'],'attributes':_0x35bed5['attributes'],'include':_0x35bed5['include']?_['map'](_0x35bed5[_0xfa6b('0x1e')],function(_0x5bcefa){return{'model':db[_0x5bcefa[_0xfa6b('0x20')]],'as':_0x5bcefa['as'],'attributes':_0x5bcefa[_0xfa6b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5538dd){logger['info'](_0xfa6b('0x16'),_0x42efa1);logger[_0xfa6b('0x10')]('GetDeskAccount',_0x42efa1,JSON[_0xfa6b('0x21')](_0x5538dd));_0x4b4801(_0x5538dd);})['catch'](function(_0x15b996){logger['error'](_0xfa6b('0x16'),_0x15b996[_0xfa6b('0x13')],_0x42efa1);_0x1dc8f3(_0x412c00[_0xfa6b('0x12')](0x1f4,_0x15b996[_0xfa6b('0x13')]));});});};exports[_0xfa6b('0x22')]=function(_0x559ce5){var _0x224a30=this;return new Promise(function(_0x5fe51,_0x314323){return db['DeskAccount']['find']({'raw':_0x559ce5[_0xfa6b('0x19')]?_0x559ce5['options']['raw']===undefined?!![]:![]:!![],'where':_0x559ce5[_0xfa6b('0x19')]?_0x559ce5[_0xfa6b('0x19')][_0xfa6b('0x1b')]||null:null,'attributes':_0x559ce5[_0xfa6b('0x19')]?_0x559ce5[_0xfa6b('0x19')][_0xfa6b('0x1c')]||null:null,'include':_0x559ce5[_0xfa6b('0x19')]?_0x559ce5[_0xfa6b('0x19')]['include']?_[_0xfa6b('0x1f')](_0x559ce5[_0xfa6b('0x19')]['include'],function(_0x574f7d){return{'model':db[_0x574f7d[_0xfa6b('0x20')]],'as':_0x574f7d['as'],'attributes':_0x574f7d[_0xfa6b('0x1c')],'include':_0x574f7d[_0xfa6b('0x1e')]?_['map'](_0x574f7d['include'],function(_0x111a91){return{'model':db[_0x111a91['model']],'as':_0x111a91['as'],'attributes':_0x111a91[_0xfa6b('0x1c')],'include':_0x111a91[_0xfa6b('0x1e')]?_['map'](_0x111a91[_0xfa6b('0x1e')],function(_0x33e1bb){return{'model':db[_0x33e1bb[_0xfa6b('0x20')]],'as':_0x33e1bb['as'],'attributes':_0x33e1bb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x260b0c){logger['info'](_0xfa6b('0x22'),_0x559ce5);logger['debug'](_0xfa6b('0x22'),_0x559ce5,JSON['stringify'](_0x260b0c));_0x5fe51(_0x260b0c);})['catch'](function(_0x336d8f){logger['error'](_0xfa6b('0x22'),_0x336d8f[_0xfa6b('0x13')],_0x559ce5);_0x314323(_0x224a30[_0xfa6b('0x12')](0x1f4,_0x336d8f[_0xfa6b('0x13')]));});});}; \ No newline at end of file +var _0x47b0=['model','ShowDeskAccount','find','raw','debug','util','moment','randomstring','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','include','map'];(function(_0x3f4f05,_0x55b135){var _0x3ad4d2=function(_0x207e5b){while(--_0x207e5b){_0x3f4f05['push'](_0x3f4f05['shift']());}};_0x3ad4d2(++_0x55b135);}(_0x47b0,0x1f4));var _0x047b=function(_0x3246a6,_0x2a685a){_0x3246a6=_0x3246a6-0x0;var _0x1df64d=_0x47b0[_0x3246a6];return _0x1df64d;};'use strict';var _=require('lodash');var util=require(_0x047b('0x0'));var moment=require(_0x047b('0x1'));var BPromise=require('bluebird');var rs=require(_0x047b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x047b('0x3'));var config=require(_0x047b('0x4'));var jayson=require(_0x047b('0x5'));var client=jayson[_0x047b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43e19f,_0x2332ba,_0x2cb988){return new BPromise(function(_0x3b5c8a,_0x28a043){return client[_0x047b('0x7')](_0x43e19f,_0x2cb988)[_0x047b('0x8')](function(_0x36b1df){logger[_0x047b('0x9')](_0x047b('0xa'),_0x2332ba,_0x047b('0xb'));logger['debug'](_0x047b('0xc'),_0x2332ba,'request\x20sent',JSON[_0x047b('0xd')](_0x36b1df));if(_0x36b1df[_0x047b('0xe')]){if(_0x36b1df['error'][_0x047b('0xf')]===0x1f4){logger['error'](_0x047b('0xa'),_0x2332ba,_0x36b1df[_0x047b('0xe')][_0x047b('0x10')]);return _0x28a043(_0x36b1df[_0x047b('0xe')][_0x047b('0x10')]);}logger[_0x047b('0xe')](_0x047b('0xa'),_0x2332ba,_0x36b1df[_0x047b('0xe')]['message']);return _0x3b5c8a(_0x36b1df['error'][_0x047b('0x10')]);}else{logger[_0x047b('0x9')](_0x047b('0xa'),_0x2332ba,_0x047b('0xb'));_0x3b5c8a(_0x36b1df[_0x047b('0x11')][_0x047b('0x10')]);}})[_0x047b('0x12')](function(_0x286e9f){logger[_0x047b('0xe')](_0x047b('0xa'),_0x2332ba,_0x286e9f);_0x28a043(_0x286e9f);});});}exports[_0x047b('0x13')]=function(_0x164c78){var _0x773318=this;return new Promise(function(_0x4938e6,_0x2d25d9){return db[_0x047b('0x14')][_0x047b('0x15')]({'raw':_0x164c78['options']?_0x164c78[_0x047b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x164c78[_0x047b('0x16')]?_0x164c78[_0x047b('0x16')][_0x047b('0x17')]||null:null,'attributes':_0x164c78[_0x047b('0x16')]?_0x164c78['options'][_0x047b('0x18')]||null:null,'limit':_0x164c78['options']?_0x164c78[_0x047b('0x16')][_0x047b('0x19')]||null:null,'include':_0x164c78[_0x047b('0x16')]?_0x164c78[_0x047b('0x16')][_0x047b('0x1a')]?_[_0x047b('0x1b')](_0x164c78['options'][_0x047b('0x1a')],function(_0x29274f){return{'model':db[_0x29274f[_0x047b('0x1c')]],'as':_0x29274f['as'],'attributes':_0x29274f['attributes'],'include':_0x29274f[_0x047b('0x1a')]?_['map'](_0x29274f[_0x047b('0x1a')],function(_0x11b7ec){return{'model':db[_0x11b7ec[_0x047b('0x1c')]],'as':_0x11b7ec['as'],'attributes':_0x11b7ec[_0x047b('0x18')],'include':_0x11b7ec[_0x047b('0x1a')]?_[_0x047b('0x1b')](_0x11b7ec[_0x047b('0x1a')],function(_0x58cec5){return{'model':db[_0x58cec5[_0x047b('0x1c')]],'as':_0x58cec5['as'],'attributes':_0x58cec5[_0x047b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x047b('0x8')](function(_0x29809d){logger['info'](_0x047b('0x13'),_0x164c78);logger['debug']('GetDeskAccount',_0x164c78,JSON[_0x047b('0xd')](_0x29809d));_0x4938e6(_0x29809d);})[_0x047b('0x12')](function(_0x588b74){logger[_0x047b('0xe')](_0x047b('0x13'),_0x588b74['message'],_0x164c78);_0x2d25d9(_0x773318[_0x047b('0xe')](0x1f4,_0x588b74[_0x047b('0x10')]));});});};exports[_0x047b('0x1d')]=function(_0x424b82){var _0x326eb3=this;return new Promise(function(_0x3fc52f,_0x1e1672){return db['DeskAccount'][_0x047b('0x1e')]({'raw':_0x424b82[_0x047b('0x16')]?_0x424b82[_0x047b('0x16')][_0x047b('0x1f')]===undefined?!![]:![]:!![],'where':_0x424b82['options']?_0x424b82[_0x047b('0x16')]['where']||null:null,'attributes':_0x424b82[_0x047b('0x16')]?_0x424b82[_0x047b('0x16')][_0x047b('0x18')]||null:null,'include':_0x424b82[_0x047b('0x16')]?_0x424b82[_0x047b('0x16')]['include']?_[_0x047b('0x1b')](_0x424b82['options'][_0x047b('0x1a')],function(_0x412534){return{'model':db[_0x412534[_0x047b('0x1c')]],'as':_0x412534['as'],'attributes':_0x412534[_0x047b('0x18')],'include':_0x412534[_0x047b('0x1a')]?_[_0x047b('0x1b')](_0x412534[_0x047b('0x1a')],function(_0x5a80dc){return{'model':db[_0x5a80dc[_0x047b('0x1c')]],'as':_0x5a80dc['as'],'attributes':_0x5a80dc[_0x047b('0x18')],'include':_0x5a80dc[_0x047b('0x1a')]?_[_0x047b('0x1b')](_0x5a80dc[_0x047b('0x1a')],function(_0x339a48){return{'model':db[_0x339a48[_0x047b('0x1c')]],'as':_0x339a48['as'],'attributes':_0x339a48[_0x047b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x047b('0x8')](function(_0xdf00b3){logger[_0x047b('0x9')](_0x047b('0x1d'),_0x424b82);logger[_0x047b('0x20')](_0x047b('0x1d'),_0x424b82,JSON[_0x047b('0xd')](_0xdf00b3));_0x3fc52f(_0xdf00b3);})[_0x047b('0x12')](function(_0x2f4c9b){logger[_0x047b('0xe')](_0x047b('0x1d'),_0x2f4c9b[_0x047b('0x10')],_0x424b82);_0x1e1672(_0x326eb3[_0x047b('0xe')](0x1f4,_0x2f4c9b['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 4b84d09..55eb5b4 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 _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1c9c67,_0x29be55){var _0x3e59c9=function(_0x538b0a){while(--_0x538b0a){_0x1c9c67['push'](_0x1c9c67['shift']());}};_0x3e59c9(++_0x29be55);}(_0x008c,0x188));var _0xc008=function(_0x470e3f,_0x3b513d){_0x470e3f=_0x470e3f-0x0;var _0x4fd22b=_0x008c[_0x470e3f];return _0x4fd22b;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x339fa7,_0x2f7bb8){var _0x274de6=function(_0xac0839){while(--_0xac0839){_0x339fa7['push'](_0x339fa7['shift']());}};_0x274de6(++_0x2f7bb8);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a15ce,_0x5f0345){_0x3a15ce=_0x3a15ce-0x0;var _0x57cd6b=_0xedd9[_0x3a15ce];return _0x57cd6b;};'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');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index e999a94..c2e2791 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 _0x74fc=['STRING','sequelize','exports'];(function(_0x4a0ce4,_0x122a45){var _0x1bab7a=function(_0x4642b6){while(--_0x4642b6){_0x4a0ce4['push'](_0x4a0ce4['shift']());}};_0x1bab7a(++_0x122a45);}(_0x74fc,0x18d));var _0xc74f=function(_0x1cb577,_0x1a0fc1){_0x1cb577=_0x1cb577-0x0;var _0x2963a5=_0x74fc[_0x1cb577];return _0x2963a5;};'use strict';var Sequelize=require(_0xc74f('0x0'));module[_0xc74f('0x1')]={'name':{'type':Sequelize[_0xc74f('0x2')]},'description':{'type':Sequelize[_0xc74f('0x2')]}}; \ No newline at end of file +var _0xb280=['STRING','sequelize'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xb280,0x73));var _0x0b28=function(_0x59d4ab,_0x8ac099){_0x59d4ab=_0x59d4ab-0x0;var _0x5d5bc4=_0xb280[_0x59d4ab];return _0x5d5bc4;};'use strict';var Sequelize=require(_0x0b28('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b28('0x1')]},'description':{'type':Sequelize[_0x0b28('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 205ed26..604c494 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 _0x7cae=['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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','apply','reject','save','update','then','destroy','error','stack','send','index','map','DeskConfiguration','rawAttributes','type','key','name','keys','query','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','options','include','findAll','rows','catch','includeAll','merge','find','create','body','params','getFields','findOne','DeskField','length','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x7cae,0x1b2));var _0xe7ca=function(_0x4722ae,_0x57d118){_0x4722ae=_0x4722ae-0x0;var _0x32c256=_0x7cae[_0x4722ae];return _0x32c256;};'use strict';var emlformat=require(_0xe7ca('0x0'));var rimraf=require(_0xe7ca('0x1'));var zipdir=require(_0xe7ca('0x2'));var jsonpatch=require(_0xe7ca('0x3'));var rp=require(_0xe7ca('0x4'));var moment=require(_0xe7ca('0x5'));var BPromise=require(_0xe7ca('0x6'));var Mustache=require(_0xe7ca('0x7'));var util=require(_0xe7ca('0x8'));var path=require(_0xe7ca('0x9'));var sox=require(_0xe7ca('0xa'));var csv=require(_0xe7ca('0xb'));var ejs=require(_0xe7ca('0xc'));var fs=require('fs');var fs_extra=require(_0xe7ca('0xd'));var _=require(_0xe7ca('0xe'));var squel=require(_0xe7ca('0xf'));var crypto=require('crypto');var jsforce=require(_0xe7ca('0x10'));var deskjs=require(_0xe7ca('0x11'));var toCsv=require(_0xe7ca('0xb'));var querystring=require(_0xe7ca('0x12'));var Papa=require(_0xe7ca('0x13'));var Redis=require(_0xe7ca('0x14'));var authService=require(_0xe7ca('0x15'));var qs=require(_0xe7ca('0x16'));var as=require(_0xe7ca('0x17'));var hardwareService=require(_0xe7ca('0x18'));var logger=require(_0xe7ca('0x19'))(_0xe7ca('0x1a'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe7ca('0x1b'));var db=require(_0xe7ca('0x1c'))['db'];function respondWithStatusCode(_0x43f556,_0x596590){_0x596590=_0x596590||0xcc;return function(_0x76c597){if(_0x76c597){return _0x43f556[_0xe7ca('0x1d')](_0x596590);}return _0x43f556[_0xe7ca('0x1e')](_0x596590)[_0xe7ca('0x1f')]();};}function respondWithResult(_0x286b5f,_0x38f731){_0x38f731=_0x38f731||0xc8;return function(_0x52de8b){if(_0x52de8b){return _0x286b5f[_0xe7ca('0x1e')](_0x38f731)[_0xe7ca('0x20')](_0x52de8b);}};}function respondWithFilteredResult(_0x2723e6,_0x473c12){return function(_0x131783){if(_0x131783){var _0x54094f=typeof _0x473c12[_0xe7ca('0x21')]===_0xe7ca('0x22')&&typeof _0x473c12['limit']===_0xe7ca('0x22');var _0x48d6b6=_0x131783[_0xe7ca('0x23')];var _0x3ec102=_0x54094f?0x0:_0x473c12['offset'];var _0x394c14=_0x54094f?_0x131783['count']:_0x473c12[_0xe7ca('0x21')]+_0x473c12['limit'];var _0x23a560;if(_0x394c14>=_0x48d6b6){_0x394c14=_0x48d6b6;_0x23a560=0xc8;}else{_0x23a560=0xce;}_0x2723e6['status'](_0x23a560);return _0x2723e6['set']('Content-Range',_0x3ec102+'-'+_0x394c14+'/'+_0x48d6b6)[_0xe7ca('0x20')](_0x131783);}return null;};}function patchUpdates(_0x9e9e5d){return function(_0x1baa71){try{jsonpatch[_0xe7ca('0x24')](_0x1baa71,_0x9e9e5d,!![]);}catch(_0x2af847){return BPromise[_0xe7ca('0x25')](_0x2af847);}return _0x1baa71[_0xe7ca('0x26')]();};}function saveUpdates(_0x50b1e3,_0x37f2e2){return function(_0x43c7aa){if(_0x43c7aa){return _0x43c7aa[_0xe7ca('0x27')](_0x50b1e3)[_0xe7ca('0x28')](function(_0x483992){return _0x483992;});}return null;};}function removeEntity(_0x90e5a1,_0x4902f6){return function(_0x5a857c){if(_0x5a857c){return _0x5a857c[_0xe7ca('0x29')]()[_0xe7ca('0x28')](function(){_0x90e5a1[_0xe7ca('0x1e')](0xcc)[_0xe7ca('0x1f')]();});}};}function handleEntityNotFound(_0x5a76e7,_0x18f399){return function(_0x11b5db){if(!_0x11b5db){_0x5a76e7[_0xe7ca('0x1d')](0x194);}return _0x11b5db;};}function handleError(_0x407f44,_0x3e6b71){_0x3e6b71=_0x3e6b71||0x1f4;return function(_0x116771){logger[_0xe7ca('0x2a')](_0x116771[_0xe7ca('0x2b')]);if(_0x116771['name']){delete _0x116771['name'];}_0x407f44[_0xe7ca('0x1e')](_0x3e6b71)[_0xe7ca('0x2c')](_0x116771);};}exports[_0xe7ca('0x2d')]=function(_0x2d9929,_0x251a5a){var _0x4a0020={},_0x3aaaa4={},_0x155dcd={'count':0x0,'rows':[]};var _0x172d1c=_[_0xe7ca('0x2e')](db[_0xe7ca('0x2f')][_0xe7ca('0x30')],function(_0x2754a1){return{'name':_0x2754a1['fieldName'],'type':_0x2754a1[_0xe7ca('0x31')][_0xe7ca('0x32')]};});_0x3aaaa4['model']=_[_0xe7ca('0x2e')](_0x172d1c,_0xe7ca('0x33'));_0x3aaaa4['query']=_[_0xe7ca('0x34')](_0x2d9929[_0xe7ca('0x35')]);_0x3aaaa4[_0xe7ca('0x36')]=_[_0xe7ca('0x37')](_0x3aaaa4[_0xe7ca('0x38')],_0x3aaaa4[_0xe7ca('0x35')]);_0x4a0020[_0xe7ca('0x39')]=_[_0xe7ca('0x37')](_0x3aaaa4[_0xe7ca('0x38')],qs[_0xe7ca('0x3a')](_0x2d9929[_0xe7ca('0x35')][_0xe7ca('0x3a')]));_0x4a0020[_0xe7ca('0x39')]=_0x4a0020[_0xe7ca('0x39')]['length']?_0x4a0020[_0xe7ca('0x39')]:_0x3aaaa4[_0xe7ca('0x38')];if(!_0x2d9929[_0xe7ca('0x35')]['hasOwnProperty'](_0xe7ca('0x3b'))){_0x4a0020['limit']=qs[_0xe7ca('0x3c')](_0x2d9929[_0xe7ca('0x35')][_0xe7ca('0x3c')]);_0x4a0020[_0xe7ca('0x21')]=qs[_0xe7ca('0x21')](_0x2d9929[_0xe7ca('0x35')][_0xe7ca('0x21')]);}_0x4a0020[_0xe7ca('0x3d')]=qs[_0xe7ca('0x3e')](_0x2d9929[_0xe7ca('0x35')][_0xe7ca('0x3e')]);_0x4a0020[_0xe7ca('0x3f')]=qs['filters'](_[_0xe7ca('0x40')](_0x2d9929[_0xe7ca('0x35')],_0x3aaaa4[_0xe7ca('0x36')]),_0x172d1c);if(_0x2d9929['query']['filter']){_0x4a0020[_0xe7ca('0x3f')]=_['merge'](_0x4a0020[_0xe7ca('0x3f')],{'$or':_['map'](_0x172d1c,function(_0x52822a){if(_0x52822a[_0xe7ca('0x31')]!==_0xe7ca('0x41')){var _0x203328={};_0x203328[_0x52822a['name']]={'$like':'%'+_0x2d9929['query'][_0xe7ca('0x42')]+'%'};return _0x203328;}})});}_0x4a0020=_['merge']({},_0x4a0020,_0x2d9929[_0xe7ca('0x43')]);var _0x298613={'where':_0x4a0020[_0xe7ca('0x3f')]};return db[_0xe7ca('0x2f')][_0xe7ca('0x23')](_0x298613)[_0xe7ca('0x28')](function(_0x569b9d){_0x155dcd['count']=_0x569b9d;if(_0x2d9929['query']['includeAll']){_0x4a0020[_0xe7ca('0x44')]=[{'all':!![]}];}return db[_0xe7ca('0x2f')][_0xe7ca('0x45')](_0x4a0020);})[_0xe7ca('0x28')](function(_0x18a798){_0x155dcd[_0xe7ca('0x46')]=_0x18a798;return _0x155dcd;})[_0xe7ca('0x28')](respondWithFilteredResult(_0x251a5a,_0x4a0020))[_0xe7ca('0x47')](handleError(_0x251a5a,null));};exports['show']=function(_0x2b8567,_0x454f14){var _0x4992a4={'raw':![],'where':{'id':_0x2b8567['params']['id']}},_0x209c39={};_0x209c39[_0xe7ca('0x38')]=_[_0xe7ca('0x34')](db[_0xe7ca('0x2f')][_0xe7ca('0x30')]);_0x209c39['query']=_['keys'](_0x2b8567['query']);_0x209c39[_0xe7ca('0x36')]=_[_0xe7ca('0x37')](_0x209c39['model'],_0x209c39[_0xe7ca('0x35')]);_0x4992a4[_0xe7ca('0x39')]=_[_0xe7ca('0x37')](_0x209c39['model'],qs[_0xe7ca('0x3a')](_0x2b8567[_0xe7ca('0x35')][_0xe7ca('0x3a')]));_0x4992a4[_0xe7ca('0x39')]=_0x4992a4[_0xe7ca('0x39')]['length']?_0x4992a4[_0xe7ca('0x39')]:_0x209c39[_0xe7ca('0x38')];if(_0x2b8567[_0xe7ca('0x35')][_0xe7ca('0x48')]){_0x4992a4['include']=[{'all':!![]}];}_0x4992a4=_[_0xe7ca('0x49')]({},_0x4992a4,_0x2b8567[_0xe7ca('0x43')]);return db['DeskConfiguration'][_0xe7ca('0x4a')](_0x4992a4)[_0xe7ca('0x28')](handleEntityNotFound(_0x454f14,null))[_0xe7ca('0x28')](respondWithResult(_0x454f14,null))[_0xe7ca('0x47')](handleError(_0x454f14,null));};exports[_0xe7ca('0x4b')]=function(_0xd618c0,_0x105f27){return db['DeskConfiguration'][_0xe7ca('0x4b')](_0xd618c0['body'],{})[_0xe7ca('0x28')](respondWithResult(_0x105f27,0xc9))[_0xe7ca('0x47')](handleError(_0x105f27,null));};exports['update']=function(_0x4bb6a9,_0x13f274){if(_0x4bb6a9[_0xe7ca('0x4c')]['id']){delete _0x4bb6a9[_0xe7ca('0x4c')]['id'];}return db[_0xe7ca('0x2f')][_0xe7ca('0x4a')]({'where':{'id':_0x4bb6a9[_0xe7ca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x13f274,null))['then'](saveUpdates(_0x4bb6a9[_0xe7ca('0x4c')],null))[_0xe7ca('0x28')](respondWithResult(_0x13f274,null))[_0xe7ca('0x47')](handleError(_0x13f274,null));};exports[_0xe7ca('0x29')]=function(_0x1d50bf,_0xbdc079){return db['DeskConfiguration']['find']({'where':{'id':_0x1d50bf[_0xe7ca('0x4d')]['id']}})[_0xe7ca('0x28')](handleEntityNotFound(_0xbdc079,null))[_0xe7ca('0x28')](removeEntity(_0xbdc079,null))[_0xe7ca('0x47')](handleError(_0xbdc079,null));};exports[_0xe7ca('0x4e')]=function(_0x2483e4,_0x3b2031,_0x2924c5){var _0x52118c={};var _0x3e7ca4={};var _0x50388f;var _0x4188ee;return db['DeskConfiguration'][_0xe7ca('0x4f')]({'where':{'id':_0x2483e4[_0xe7ca('0x4d')]['id']}})[_0xe7ca('0x28')](handleEntityNotFound(_0x3b2031,null))['then'](function(_0xea81dd){if(_0xea81dd){_0x50388f=_0xea81dd;_0x3e7ca4[_0xe7ca('0x38')]=_[_0xe7ca('0x34')](db[_0xe7ca('0x50')][_0xe7ca('0x30')]);_0x3e7ca4[_0xe7ca('0x35')]=_[_0xe7ca('0x34')](_0x2483e4[_0xe7ca('0x35')]);_0x3e7ca4['filters']=_['intersection'](_0x3e7ca4[_0xe7ca('0x38')],_0x3e7ca4[_0xe7ca('0x35')]);_0x52118c[_0xe7ca('0x39')]=_[_0xe7ca('0x37')](_0x3e7ca4[_0xe7ca('0x38')],qs[_0xe7ca('0x3a')](_0x2483e4[_0xe7ca('0x35')][_0xe7ca('0x3a')]));_0x52118c[_0xe7ca('0x39')]=_0x52118c['attributes']['length']?_0x52118c[_0xe7ca('0x39')]:_0x3e7ca4[_0xe7ca('0x38')];_0x52118c[_0xe7ca('0x3d')]=qs[_0xe7ca('0x3e')](_0x2483e4[_0xe7ca('0x35')][_0xe7ca('0x3e')]);_0x52118c[_0xe7ca('0x3f')]=qs['filters'](_['pick'](_0x2483e4[_0xe7ca('0x35')],_0x3e7ca4[_0xe7ca('0x36')]));if(_0x2483e4['query'][_0xe7ca('0x42')]){_0x52118c[_0xe7ca('0x3f')]=_['merge'](_0x52118c[_0xe7ca('0x3f')],{'$or':_[_0xe7ca('0x2e')](_0x52118c[_0xe7ca('0x39')],function(_0x2fb2e8){var _0x4abe58={};_0x4abe58[_0x2fb2e8]={'$like':'%'+_0x2483e4[_0xe7ca('0x35')][_0xe7ca('0x42')]+'%'};return _0x4abe58;})});}_0x52118c=_[_0xe7ca('0x49')]({},_0x52118c,_0x2483e4[_0xe7ca('0x43')]);return _0x50388f['getFields'](_0x52118c);}})[_0xe7ca('0x28')](function(_0x33caef){if(_0x33caef){_0x4188ee=_0x33caef[_0xe7ca('0x51')];if(!_0x2483e4[_0xe7ca('0x35')][_0xe7ca('0x52')](_0xe7ca('0x3b'))){_0x52118c[_0xe7ca('0x3c')]=qs[_0xe7ca('0x3c')](_0x2483e4['query']['limit']);_0x52118c['offset']=qs[_0xe7ca('0x21')](_0x2483e4[_0xe7ca('0x35')][_0xe7ca('0x21')]);}return _0x50388f['getFields'](_0x52118c);}})[_0xe7ca('0x28')](function(_0x3d63d8){if(_0x3d63d8){return _0x3d63d8?{'count':_0x4188ee,'rows':_0x3d63d8}:null;}})[_0xe7ca('0x28')](respondWithResult(_0x3b2031,null))[_0xe7ca('0x47')](handleError(_0x3b2031,null));};exports['getSubjects']=function(_0x176d8e,_0xab7fd6,_0x4a97be){var _0x461737={};var _0x25f61e={};var _0x18d87b;var _0x428446;return db['DeskConfiguration']['findOne']({'where':{'id':_0x176d8e[_0xe7ca('0x4d')]['id']}})['then'](handleEntityNotFound(_0xab7fd6,null))[_0xe7ca('0x28')](function(_0x263892){if(_0x263892){_0x18d87b=_0x263892;_0x25f61e[_0xe7ca('0x38')]=_[_0xe7ca('0x34')](db['DeskField'][_0xe7ca('0x30')]);_0x25f61e[_0xe7ca('0x35')]=_[_0xe7ca('0x34')](_0x176d8e[_0xe7ca('0x35')]);_0x25f61e['filters']=_[_0xe7ca('0x37')](_0x25f61e[_0xe7ca('0x38')],_0x25f61e[_0xe7ca('0x35')]);_0x461737[_0xe7ca('0x39')]=_['intersection'](_0x25f61e['model'],qs[_0xe7ca('0x3a')](_0x176d8e[_0xe7ca('0x35')]['fields']));_0x461737['attributes']=_0x461737[_0xe7ca('0x39')][_0xe7ca('0x51')]?_0x461737[_0xe7ca('0x39')]:_0x25f61e[_0xe7ca('0x38')];_0x461737[_0xe7ca('0x3d')]=qs[_0xe7ca('0x3e')](_0x176d8e[_0xe7ca('0x35')][_0xe7ca('0x3e')]);_0x461737[_0xe7ca('0x3f')]=qs[_0xe7ca('0x36')](_[_0xe7ca('0x40')](_0x176d8e['query'],_0x25f61e[_0xe7ca('0x36')]));if(_0x176d8e[_0xe7ca('0x35')][_0xe7ca('0x42')]){_0x461737[_0xe7ca('0x3f')]=_[_0xe7ca('0x49')](_0x461737[_0xe7ca('0x3f')],{'$or':_[_0xe7ca('0x2e')](_0x461737[_0xe7ca('0x39')],function(_0x144dd1){var _0x29d625={};_0x29d625[_0x144dd1]={'$like':'%'+_0x176d8e[_0xe7ca('0x35')][_0xe7ca('0x42')]+'%'};return _0x29d625;})});}_0x461737=_['merge']({},_0x461737,_0x176d8e[_0xe7ca('0x43')]);return _0x18d87b['getSubjects'](_0x461737);}})[_0xe7ca('0x28')](function(_0x1e80e0){if(_0x1e80e0){_0x428446=_0x1e80e0[_0xe7ca('0x51')];if(!_0x176d8e[_0xe7ca('0x35')][_0xe7ca('0x52')](_0xe7ca('0x3b'))){_0x461737[_0xe7ca('0x3c')]=qs[_0xe7ca('0x3c')](_0x176d8e[_0xe7ca('0x35')]['limit']);_0x461737[_0xe7ca('0x21')]=qs[_0xe7ca('0x21')](_0x176d8e[_0xe7ca('0x35')][_0xe7ca('0x21')]);}return _0x18d87b[_0xe7ca('0x53')](_0x461737);}})['then'](function(_0x3ecde3){if(_0x3ecde3){return _0x3ecde3?{'count':_0x428446,'rows':_0x3ecde3}:null;}})['then'](respondWithResult(_0xab7fd6,null))['catch'](handleError(_0xab7fd6,null));};exports[_0xe7ca('0x54')]=function(_0xc0baa3,_0x508bc8,_0xdaf730){var _0x2a84c8={};var _0x181352={};var _0xad641f;var _0xff96fd;return db['DeskConfiguration'][_0xe7ca('0x4f')]({'where':{'id':_0xc0baa3[_0xe7ca('0x4d')]['id']}})[_0xe7ca('0x28')](handleEntityNotFound(_0x508bc8,null))[_0xe7ca('0x28')](function(_0x5343df){if(_0x5343df){_0xad641f=_0x5343df;_0x181352[_0xe7ca('0x38')]=_[_0xe7ca('0x34')](db['DeskField'][_0xe7ca('0x30')]);_0x181352[_0xe7ca('0x35')]=_['keys'](_0xc0baa3[_0xe7ca('0x35')]);_0x181352['filters']=_[_0xe7ca('0x37')](_0x181352['model'],_0x181352['query']);_0x2a84c8[_0xe7ca('0x39')]=_[_0xe7ca('0x37')](_0x181352[_0xe7ca('0x38')],qs['fields'](_0xc0baa3[_0xe7ca('0x35')][_0xe7ca('0x3a')]));_0x2a84c8['attributes']=_0x2a84c8[_0xe7ca('0x39')][_0xe7ca('0x51')]?_0x2a84c8[_0xe7ca('0x39')]:_0x181352[_0xe7ca('0x38')];_0x2a84c8[_0xe7ca('0x3d')]=qs[_0xe7ca('0x3e')](_0xc0baa3[_0xe7ca('0x35')][_0xe7ca('0x3e')]);_0x2a84c8[_0xe7ca('0x3f')]=qs[_0xe7ca('0x36')](_['pick'](_0xc0baa3['query'],_0x181352[_0xe7ca('0x36')]));if(_0xc0baa3['query'][_0xe7ca('0x42')]){_0x2a84c8['where']=_[_0xe7ca('0x49')](_0x2a84c8[_0xe7ca('0x3f')],{'$or':_[_0xe7ca('0x2e')](_0x2a84c8[_0xe7ca('0x39')],function(_0x3226d0){var _0x595ced={};_0x595ced[_0x3226d0]={'$like':'%'+_0xc0baa3['query'][_0xe7ca('0x42')]+'%'};return _0x595ced;})});}_0x2a84c8=_['merge']({},_0x2a84c8,_0xc0baa3['options']);return _0xad641f['getDescriptions'](_0x2a84c8);}})['then'](function(_0x58290a){if(_0x58290a){_0xff96fd=_0x58290a[_0xe7ca('0x51')];if(!_0xc0baa3[_0xe7ca('0x35')][_0xe7ca('0x52')]('nolimit')){_0x2a84c8[_0xe7ca('0x3c')]=qs[_0xe7ca('0x3c')](_0xc0baa3[_0xe7ca('0x35')][_0xe7ca('0x3c')]);_0x2a84c8[_0xe7ca('0x21')]=qs[_0xe7ca('0x21')](_0xc0baa3[_0xe7ca('0x35')][_0xe7ca('0x21')]);}return _0xad641f[_0xe7ca('0x54')](_0x2a84c8);}})[_0xe7ca('0x28')](function(_0x363454){if(_0x363454){return _0x363454?{'count':_0xff96fd,'rows':_0x363454}:null;}})[_0xe7ca('0x28')](respondWithResult(_0x508bc8,null))[_0xe7ca('0x47')](handleError(_0x508bc8,null));};exports[_0xe7ca('0x55')]=function(_0x1a994c,_0xf715de,_0x41b021){var _0x81a151={};var _0x3c4ece={};var _0x20bdfc;var _0x2edb15;return db[_0xe7ca('0x2f')]['findOne']({'where':{'id':_0x1a994c[_0xe7ca('0x4d')]['id']}})[_0xe7ca('0x28')](handleEntityNotFound(_0xf715de,null))['then'](function(_0x47e74d){if(_0x47e74d){_0x20bdfc=_0x47e74d;_0x3c4ece['model']=_[_0xe7ca('0x34')](db[_0xe7ca('0x56')][_0xe7ca('0x30')]);_0x3c4ece[_0xe7ca('0x35')]=_[_0xe7ca('0x34')](_0x1a994c[_0xe7ca('0x35')]);_0x3c4ece[_0xe7ca('0x36')]=_['intersection'](_0x3c4ece[_0xe7ca('0x38')],_0x3c4ece[_0xe7ca('0x35')]);_0x81a151[_0xe7ca('0x39')]=_[_0xe7ca('0x37')](_0x3c4ece[_0xe7ca('0x38')],qs[_0xe7ca('0x3a')](_0x1a994c['query'][_0xe7ca('0x3a')]));_0x81a151['attributes']=_0x81a151[_0xe7ca('0x39')][_0xe7ca('0x51')]?_0x81a151[_0xe7ca('0x39')]:_0x3c4ece[_0xe7ca('0x38')];_0x81a151[_0xe7ca('0x3d')]=qs['sort'](_0x1a994c['query'][_0xe7ca('0x3e')]);_0x81a151[_0xe7ca('0x3f')]=qs['filters'](_[_0xe7ca('0x40')](_0x1a994c[_0xe7ca('0x35')],_0x3c4ece[_0xe7ca('0x36')]));if(_0x1a994c[_0xe7ca('0x35')][_0xe7ca('0x42')]){_0x81a151[_0xe7ca('0x3f')]=_[_0xe7ca('0x49')](_0x81a151[_0xe7ca('0x3f')],{'$or':_['map'](_0x81a151[_0xe7ca('0x39')],function(_0x17f4ea){var _0x507334={};_0x507334[_0x17f4ea]={'$like':'%'+_0x1a994c[_0xe7ca('0x35')][_0xe7ca('0x42')]+'%'};return _0x507334;})});}_0x81a151=_[_0xe7ca('0x49')]({},_0x81a151,_0x1a994c[_0xe7ca('0x43')]);return _0x20bdfc[_0xe7ca('0x55')](_0x81a151);}})[_0xe7ca('0x28')](function(_0x2ddbd6){if(_0x2ddbd6){_0x2edb15=_0x2ddbd6['length'];if(!_0x1a994c[_0xe7ca('0x35')]['hasOwnProperty']('nolimit')){_0x81a151[_0xe7ca('0x3c')]=qs[_0xe7ca('0x3c')](_0x1a994c[_0xe7ca('0x35')]['limit']);_0x81a151[_0xe7ca('0x21')]=qs[_0xe7ca('0x21')](_0x1a994c['query'][_0xe7ca('0x21')]);}return _0x20bdfc[_0xe7ca('0x55')](_0x81a151);}})[_0xe7ca('0x28')](function(_0x3d3d27){if(_0x3d3d27){return _0x3d3d27?{'count':_0x2edb15,'rows':_0x3d3d27}:null;}})['then'](respondWithResult(_0xf715de,null))[_0xe7ca('0x47')](handleError(_0xf715de,null));};exports[_0xe7ca('0x57')]=function(_0x28f31f,_0x486a64,_0x3b4e78){if(_0x28f31f['body']['id']){delete _0x28f31f[_0xe7ca('0x4c')]['id'];}return db[_0xe7ca('0x2f')][_0xe7ca('0x4f')]({'where':{'id':_0x28f31f[_0xe7ca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x486a64,null))[_0xe7ca('0x28')](function(_0x2760c7){if(_0x2760c7){return _0x2760c7[_0xe7ca('0x57')](_0x28f31f[_0xe7ca('0x4c')][_0xe7ca('0x58')]||[]);}return null;})[_0xe7ca('0x28')](respondWithResult(_0x486a64,null))[_0xe7ca('0x47')](handleError(_0x486a64,null));}; \ No newline at end of file +var _0x105c=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','getFields','findOne','pick','getSubjects','getDescriptions','DeskField','getTags','Tag','setTags','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter'];(function(_0x15462b,_0x4fcf41){var _0x2295fe=function(_0x981be0){while(--_0x981be0){_0x15462b['push'](_0x15462b['shift']());}};_0x2295fe(++_0x4fcf41);}(_0x105c,0x1ca));var _0xc105=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x105c[_0x1fafa5];return _0xcf08c9;};'use strict';var emlformat=require(_0xc105('0x0'));var rimraf=require(_0xc105('0x1'));var zipdir=require(_0xc105('0x2'));var jsonpatch=require(_0xc105('0x3'));var rp=require(_0xc105('0x4'));var moment=require(_0xc105('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc105('0x6'));var util=require(_0xc105('0x7'));var path=require(_0xc105('0x8'));var sox=require(_0xc105('0x9'));var csv=require(_0xc105('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc105('0xb'));var _=require(_0xc105('0xc'));var squel=require(_0xc105('0xd'));var crypto=require(_0xc105('0xe'));var jsforce=require(_0xc105('0xf'));var deskjs=require(_0xc105('0x10'));var toCsv=require(_0xc105('0xa'));var querystring=require(_0xc105('0x11'));var Papa=require('papaparse');var Redis=require(_0xc105('0x12'));var authService=require(_0xc105('0x13'));var qs=require(_0xc105('0x14'));var as=require(_0xc105('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc105('0x16'))('api');var utils=require(_0xc105('0x17'));var config=require(_0xc105('0x18'));var licenseUtil=require(_0xc105('0x19'));var db=require(_0xc105('0x1a'))['db'];function respondWithStatusCode(_0x3acd7d,_0x3dfea0){_0x3dfea0=_0x3dfea0||0xcc;return function(_0x21a9fb){if(_0x21a9fb){return _0x3acd7d['sendStatus'](_0x3dfea0);}return _0x3acd7d[_0xc105('0x1b')](_0x3dfea0)['end']();};}function respondWithResult(_0x5cf019,_0x3ab842){_0x3ab842=_0x3ab842||0xc8;return function(_0x32572c){if(_0x32572c){return _0x5cf019[_0xc105('0x1b')](_0x3ab842)[_0xc105('0x1c')](_0x32572c);}};}function respondWithFilteredResult(_0xe37fe4,_0x2204bf){return function(_0x2ea8f7){if(_0x2ea8f7){var _0x4fd8c7=typeof _0x2204bf[_0xc105('0x1d')]==='undefined'&&typeof _0x2204bf[_0xc105('0x1e')]===_0xc105('0x1f');var _0x46e99f=_0x2ea8f7[_0xc105('0x20')];var _0x2314b7=_0x4fd8c7?0x0:_0x2204bf[_0xc105('0x1d')];var _0x37a190=_0x4fd8c7?_0x2ea8f7['count']:_0x2204bf['offset']+_0x2204bf[_0xc105('0x1e')];var _0x5e6575;if(_0x37a190>=_0x46e99f){_0x37a190=_0x46e99f;_0x5e6575=0xc8;}else{_0x5e6575=0xce;}_0xe37fe4[_0xc105('0x1b')](_0x5e6575);return _0xe37fe4[_0xc105('0x21')](_0xc105('0x22'),_0x2314b7+'-'+_0x37a190+'/'+_0x46e99f)[_0xc105('0x1c')](_0x2ea8f7);}return null;};}function patchUpdates(_0x3c84c4){return function(_0x425441){try{jsonpatch[_0xc105('0x23')](_0x425441,_0x3c84c4,!![]);}catch(_0x14e819){return BPromise['reject'](_0x14e819);}return _0x425441[_0xc105('0x24')]();};}function saveUpdates(_0x3144e3,_0x5ac4ef){return function(_0xb17bdb){if(_0xb17bdb){return _0xb17bdb[_0xc105('0x25')](_0x3144e3)['then'](function(_0x16b5ab){return _0x16b5ab;});}return null;};}function removeEntity(_0x5bd606,_0x223e02){return function(_0xd316b){if(_0xd316b){return _0xd316b[_0xc105('0x26')]()[_0xc105('0x27')](function(){_0x5bd606[_0xc105('0x1b')](0xcc)[_0xc105('0x28')]();});}};}function handleEntityNotFound(_0x500540,_0x164bb8){return function(_0x248289){if(!_0x248289){_0x500540[_0xc105('0x29')](0x194);}return _0x248289;};}function handleError(_0x22632d,_0x126694){_0x126694=_0x126694||0x1f4;return function(_0x23a05d){logger[_0xc105('0x2a')](_0x23a05d[_0xc105('0x2b')]);if(_0x23a05d[_0xc105('0x2c')]){delete _0x23a05d['name'];}_0x22632d[_0xc105('0x1b')](_0x126694)[_0xc105('0x2d')](_0x23a05d);};}exports[_0xc105('0x2e')]=function(_0x56c8e6,_0x203059){var _0x3d45ed={},_0x49cfba={},_0x46bb7c={'count':0x0,'rows':[]};var _0x5828fb=_[_0xc105('0x2f')](db[_0xc105('0x30')][_0xc105('0x31')],function(_0x2bce0a){return{'name':_0x2bce0a['fieldName'],'type':_0x2bce0a[_0xc105('0x32')]['key']};});_0x49cfba[_0xc105('0x33')]=_[_0xc105('0x2f')](_0x5828fb,_0xc105('0x2c'));_0x49cfba[_0xc105('0x34')]=_['keys'](_0x56c8e6[_0xc105('0x34')]);_0x49cfba['filters']=_['intersection'](_0x49cfba['model'],_0x49cfba[_0xc105('0x34')]);_0x3d45ed[_0xc105('0x35')]=_[_0xc105('0x36')](_0x49cfba['model'],qs[_0xc105('0x37')](_0x56c8e6[_0xc105('0x34')][_0xc105('0x37')]));_0x3d45ed[_0xc105('0x35')]=_0x3d45ed[_0xc105('0x35')][_0xc105('0x38')]?_0x3d45ed[_0xc105('0x35')]:_0x49cfba['model'];if(!_0x56c8e6[_0xc105('0x34')][_0xc105('0x39')](_0xc105('0x3a'))){_0x3d45ed[_0xc105('0x1e')]=qs[_0xc105('0x1e')](_0x56c8e6[_0xc105('0x34')]['limit']);_0x3d45ed['offset']=qs[_0xc105('0x1d')](_0x56c8e6['query'][_0xc105('0x1d')]);}_0x3d45ed[_0xc105('0x3b')]=qs[_0xc105('0x3c')](_0x56c8e6[_0xc105('0x34')][_0xc105('0x3c')]);_0x3d45ed[_0xc105('0x3d')]=qs[_0xc105('0x3e')](_['pick'](_0x56c8e6[_0xc105('0x34')],_0x49cfba[_0xc105('0x3e')]),_0x5828fb);if(_0x56c8e6[_0xc105('0x34')][_0xc105('0x3f')]){_0x3d45ed[_0xc105('0x3d')]=_[_0xc105('0x40')](_0x3d45ed['where'],{'$or':_['map'](_0x5828fb,function(_0x5afeac){if(_0x5afeac[_0xc105('0x32')]!==_0xc105('0x41')){var _0x3d0d19={};_0x3d0d19[_0x5afeac[_0xc105('0x2c')]]={'$like':'%'+_0x56c8e6[_0xc105('0x34')][_0xc105('0x3f')]+'%'};return _0x3d0d19;}})});}_0x3d45ed=_[_0xc105('0x40')]({},_0x3d45ed,_0x56c8e6[_0xc105('0x42')]);var _0x264de4={'where':_0x3d45ed[_0xc105('0x3d')]};return db[_0xc105('0x30')][_0xc105('0x20')](_0x264de4)[_0xc105('0x27')](function(_0x32b43c){_0x46bb7c[_0xc105('0x20')]=_0x32b43c;if(_0x56c8e6[_0xc105('0x34')][_0xc105('0x43')]){_0x3d45ed[_0xc105('0x44')]=[{'all':!![]}];}return db[_0xc105('0x30')][_0xc105('0x45')](_0x3d45ed);})[_0xc105('0x27')](function(_0x3e0e65){_0x46bb7c[_0xc105('0x46')]=_0x3e0e65;return _0x46bb7c;})['then'](respondWithFilteredResult(_0x203059,_0x3d45ed))['catch'](handleError(_0x203059,null));};exports[_0xc105('0x47')]=function(_0x4cb53d,_0x19eb09){var _0x2358f4={'raw':![],'where':{'id':_0x4cb53d[_0xc105('0x48')]['id']}},_0x2ff416={};_0x2ff416[_0xc105('0x33')]=_[_0xc105('0x49')](db[_0xc105('0x30')][_0xc105('0x31')]);_0x2ff416['query']=_[_0xc105('0x49')](_0x4cb53d[_0xc105('0x34')]);_0x2ff416[_0xc105('0x3e')]=_[_0xc105('0x36')](_0x2ff416[_0xc105('0x33')],_0x2ff416[_0xc105('0x34')]);_0x2358f4[_0xc105('0x35')]=_[_0xc105('0x36')](_0x2ff416[_0xc105('0x33')],qs['fields'](_0x4cb53d['query'][_0xc105('0x37')]));_0x2358f4[_0xc105('0x35')]=_0x2358f4['attributes'][_0xc105('0x38')]?_0x2358f4[_0xc105('0x35')]:_0x2ff416[_0xc105('0x33')];if(_0x4cb53d[_0xc105('0x34')][_0xc105('0x43')]){_0x2358f4[_0xc105('0x44')]=[{'all':!![]}];}_0x2358f4=_[_0xc105('0x40')]({},_0x2358f4,_0x4cb53d[_0xc105('0x42')]);return db[_0xc105('0x30')][_0xc105('0x4a')](_0x2358f4)[_0xc105('0x27')](handleEntityNotFound(_0x19eb09,null))[_0xc105('0x27')](respondWithResult(_0x19eb09,null))[_0xc105('0x4b')](handleError(_0x19eb09,null));};exports['create']=function(_0x310785,_0x3a9e73){return db['DeskConfiguration'][_0xc105('0x4c')](_0x310785['body'],{})[_0xc105('0x27')](respondWithResult(_0x3a9e73,0xc9))[_0xc105('0x4b')](handleError(_0x3a9e73,null));};exports[_0xc105('0x25')]=function(_0x5ca541,_0x4181f7){if(_0x5ca541[_0xc105('0x4d')]['id']){delete _0x5ca541[_0xc105('0x4d')]['id'];}return db[_0xc105('0x30')]['find']({'where':{'id':_0x5ca541[_0xc105('0x48')]['id']}})['then'](handleEntityNotFound(_0x4181f7,null))['then'](saveUpdates(_0x5ca541[_0xc105('0x4d')],null))[_0xc105('0x27')](respondWithResult(_0x4181f7,null))[_0xc105('0x4b')](handleError(_0x4181f7,null));};exports[_0xc105('0x26')]=function(_0x5ae5d1,_0x812c60){return db['DeskConfiguration'][_0xc105('0x4a')]({'where':{'id':_0x5ae5d1['params']['id']}})[_0xc105('0x27')](handleEntityNotFound(_0x812c60,null))[_0xc105('0x27')](removeEntity(_0x812c60,null))[_0xc105('0x4b')](handleError(_0x812c60,null));};exports[_0xc105('0x4e')]=function(_0x2f7f0c,_0xd48132,_0x4c078d){var _0x577b84={};var _0x22c87b={};var _0x13a3f0;var _0x33543f;return db[_0xc105('0x30')][_0xc105('0x4f')]({'where':{'id':_0x2f7f0c[_0xc105('0x48')]['id']}})[_0xc105('0x27')](handleEntityNotFound(_0xd48132,null))[_0xc105('0x27')](function(_0x4bfac7){if(_0x4bfac7){_0x13a3f0=_0x4bfac7;_0x22c87b['model']=_[_0xc105('0x49')](db['DeskField']['rawAttributes']);_0x22c87b[_0xc105('0x34')]=_[_0xc105('0x49')](_0x2f7f0c[_0xc105('0x34')]);_0x22c87b['filters']=_[_0xc105('0x36')](_0x22c87b['model'],_0x22c87b[_0xc105('0x34')]);_0x577b84['attributes']=_['intersection'](_0x22c87b[_0xc105('0x33')],qs[_0xc105('0x37')](_0x2f7f0c[_0xc105('0x34')][_0xc105('0x37')]));_0x577b84['attributes']=_0x577b84[_0xc105('0x35')][_0xc105('0x38')]?_0x577b84[_0xc105('0x35')]:_0x22c87b[_0xc105('0x33')];_0x577b84[_0xc105('0x3b')]=qs[_0xc105('0x3c')](_0x2f7f0c[_0xc105('0x34')][_0xc105('0x3c')]);_0x577b84[_0xc105('0x3d')]=qs[_0xc105('0x3e')](_[_0xc105('0x50')](_0x2f7f0c[_0xc105('0x34')],_0x22c87b[_0xc105('0x3e')]));if(_0x2f7f0c[_0xc105('0x34')]['filter']){_0x577b84['where']=_['merge'](_0x577b84[_0xc105('0x3d')],{'$or':_[_0xc105('0x2f')](_0x577b84[_0xc105('0x35')],function(_0x8512af){var _0x265889={};_0x265889[_0x8512af]={'$like':'%'+_0x2f7f0c[_0xc105('0x34')][_0xc105('0x3f')]+'%'};return _0x265889;})});}_0x577b84=_['merge']({},_0x577b84,_0x2f7f0c['options']);return _0x13a3f0[_0xc105('0x4e')](_0x577b84);}})[_0xc105('0x27')](function(_0x3504dc){if(_0x3504dc){_0x33543f=_0x3504dc[_0xc105('0x38')];if(!_0x2f7f0c[_0xc105('0x34')][_0xc105('0x39')]('nolimit')){_0x577b84[_0xc105('0x1e')]=qs[_0xc105('0x1e')](_0x2f7f0c[_0xc105('0x34')][_0xc105('0x1e')]);_0x577b84['offset']=qs[_0xc105('0x1d')](_0x2f7f0c[_0xc105('0x34')][_0xc105('0x1d')]);}return _0x13a3f0['getFields'](_0x577b84);}})[_0xc105('0x27')](function(_0x33e52c){if(_0x33e52c){return _0x33e52c?{'count':_0x33543f,'rows':_0x33e52c}:null;}})[_0xc105('0x27')](respondWithResult(_0xd48132,null))['catch'](handleError(_0xd48132,null));};exports[_0xc105('0x51')]=function(_0x57f7db,_0x197799,_0xa287d7){var _0x3244da={};var _0x1e3cfd={};var _0xdd4e7e;var _0x20af48;return db['DeskConfiguration'][_0xc105('0x4f')]({'where':{'id':_0x57f7db[_0xc105('0x48')]['id']}})[_0xc105('0x27')](handleEntityNotFound(_0x197799,null))['then'](function(_0x1ee77c){if(_0x1ee77c){_0xdd4e7e=_0x1ee77c;_0x1e3cfd[_0xc105('0x33')]=_[_0xc105('0x49')](db['DeskField']['rawAttributes']);_0x1e3cfd[_0xc105('0x34')]=_[_0xc105('0x49')](_0x57f7db[_0xc105('0x34')]);_0x1e3cfd['filters']=_[_0xc105('0x36')](_0x1e3cfd[_0xc105('0x33')],_0x1e3cfd['query']);_0x3244da[_0xc105('0x35')]=_['intersection'](_0x1e3cfd['model'],qs[_0xc105('0x37')](_0x57f7db['query'][_0xc105('0x37')]));_0x3244da[_0xc105('0x35')]=_0x3244da[_0xc105('0x35')][_0xc105('0x38')]?_0x3244da['attributes']:_0x1e3cfd['model'];_0x3244da[_0xc105('0x3b')]=qs[_0xc105('0x3c')](_0x57f7db[_0xc105('0x34')][_0xc105('0x3c')]);_0x3244da[_0xc105('0x3d')]=qs['filters'](_[_0xc105('0x50')](_0x57f7db['query'],_0x1e3cfd['filters']));if(_0x57f7db[_0xc105('0x34')][_0xc105('0x3f')]){_0x3244da['where']=_[_0xc105('0x40')](_0x3244da[_0xc105('0x3d')],{'$or':_['map'](_0x3244da[_0xc105('0x35')],function(_0x4ad5a8){var _0xb412f6={};_0xb412f6[_0x4ad5a8]={'$like':'%'+_0x57f7db[_0xc105('0x34')]['filter']+'%'};return _0xb412f6;})});}_0x3244da=_[_0xc105('0x40')]({},_0x3244da,_0x57f7db[_0xc105('0x42')]);return _0xdd4e7e['getSubjects'](_0x3244da);}})[_0xc105('0x27')](function(_0x5a1b8f){if(_0x5a1b8f){_0x20af48=_0x5a1b8f[_0xc105('0x38')];if(!_0x57f7db['query'][_0xc105('0x39')](_0xc105('0x3a'))){_0x3244da[_0xc105('0x1e')]=qs[_0xc105('0x1e')](_0x57f7db['query'][_0xc105('0x1e')]);_0x3244da[_0xc105('0x1d')]=qs['offset'](_0x57f7db[_0xc105('0x34')][_0xc105('0x1d')]);}return _0xdd4e7e['getSubjects'](_0x3244da);}})[_0xc105('0x27')](function(_0x47b10a){if(_0x47b10a){return _0x47b10a?{'count':_0x20af48,'rows':_0x47b10a}:null;}})[_0xc105('0x27')](respondWithResult(_0x197799,null))[_0xc105('0x4b')](handleError(_0x197799,null));};exports[_0xc105('0x52')]=function(_0x44b1c4,_0xf10b6c,_0x1f743e){var _0x581261={};var _0x1a65f1={};var _0x34dfa6;var _0x44d8ce;return db[_0xc105('0x30')]['findOne']({'where':{'id':_0x44b1c4['params']['id']}})[_0xc105('0x27')](handleEntityNotFound(_0xf10b6c,null))[_0xc105('0x27')](function(_0x143738){if(_0x143738){_0x34dfa6=_0x143738;_0x1a65f1[_0xc105('0x33')]=_[_0xc105('0x49')](db[_0xc105('0x53')][_0xc105('0x31')]);_0x1a65f1['query']=_[_0xc105('0x49')](_0x44b1c4[_0xc105('0x34')]);_0x1a65f1[_0xc105('0x3e')]=_[_0xc105('0x36')](_0x1a65f1[_0xc105('0x33')],_0x1a65f1[_0xc105('0x34')]);_0x581261[_0xc105('0x35')]=_['intersection'](_0x1a65f1['model'],qs[_0xc105('0x37')](_0x44b1c4[_0xc105('0x34')][_0xc105('0x37')]));_0x581261[_0xc105('0x35')]=_0x581261[_0xc105('0x35')][_0xc105('0x38')]?_0x581261[_0xc105('0x35')]:_0x1a65f1[_0xc105('0x33')];_0x581261[_0xc105('0x3b')]=qs[_0xc105('0x3c')](_0x44b1c4[_0xc105('0x34')]['sort']);_0x581261[_0xc105('0x3d')]=qs[_0xc105('0x3e')](_[_0xc105('0x50')](_0x44b1c4[_0xc105('0x34')],_0x1a65f1[_0xc105('0x3e')]));if(_0x44b1c4[_0xc105('0x34')][_0xc105('0x3f')]){_0x581261[_0xc105('0x3d')]=_[_0xc105('0x40')](_0x581261[_0xc105('0x3d')],{'$or':_[_0xc105('0x2f')](_0x581261[_0xc105('0x35')],function(_0x480e16){var _0x39ef27={};_0x39ef27[_0x480e16]={'$like':'%'+_0x44b1c4[_0xc105('0x34')][_0xc105('0x3f')]+'%'};return _0x39ef27;})});}_0x581261=_[_0xc105('0x40')]({},_0x581261,_0x44b1c4[_0xc105('0x42')]);return _0x34dfa6['getDescriptions'](_0x581261);}})[_0xc105('0x27')](function(_0x37def1){if(_0x37def1){_0x44d8ce=_0x37def1[_0xc105('0x38')];if(!_0x44b1c4['query']['hasOwnProperty'](_0xc105('0x3a'))){_0x581261[_0xc105('0x1e')]=qs[_0xc105('0x1e')](_0x44b1c4[_0xc105('0x34')][_0xc105('0x1e')]);_0x581261[_0xc105('0x1d')]=qs[_0xc105('0x1d')](_0x44b1c4[_0xc105('0x34')][_0xc105('0x1d')]);}return _0x34dfa6[_0xc105('0x52')](_0x581261);}})[_0xc105('0x27')](function(_0x471065){if(_0x471065){return _0x471065?{'count':_0x44d8ce,'rows':_0x471065}:null;}})[_0xc105('0x27')](respondWithResult(_0xf10b6c,null))[_0xc105('0x4b')](handleError(_0xf10b6c,null));};exports[_0xc105('0x54')]=function(_0x20ee68,_0x29a131,_0xef05ef){var _0x1184fe={};var _0x5336be={};var _0x5862bf;var _0x58edb2;return db[_0xc105('0x30')][_0xc105('0x4f')]({'where':{'id':_0x20ee68[_0xc105('0x48')]['id']}})['then'](handleEntityNotFound(_0x29a131,null))['then'](function(_0x53b328){if(_0x53b328){_0x5862bf=_0x53b328;_0x5336be[_0xc105('0x33')]=_[_0xc105('0x49')](db[_0xc105('0x55')][_0xc105('0x31')]);_0x5336be[_0xc105('0x34')]=_['keys'](_0x20ee68['query']);_0x5336be[_0xc105('0x3e')]=_[_0xc105('0x36')](_0x5336be[_0xc105('0x33')],_0x5336be['query']);_0x1184fe['attributes']=_[_0xc105('0x36')](_0x5336be[_0xc105('0x33')],qs['fields'](_0x20ee68[_0xc105('0x34')][_0xc105('0x37')]));_0x1184fe[_0xc105('0x35')]=_0x1184fe[_0xc105('0x35')]['length']?_0x1184fe['attributes']:_0x5336be['model'];_0x1184fe['order']=qs[_0xc105('0x3c')](_0x20ee68[_0xc105('0x34')][_0xc105('0x3c')]);_0x1184fe['where']=qs[_0xc105('0x3e')](_[_0xc105('0x50')](_0x20ee68[_0xc105('0x34')],_0x5336be[_0xc105('0x3e')]));if(_0x20ee68[_0xc105('0x34')][_0xc105('0x3f')]){_0x1184fe[_0xc105('0x3d')]=_['merge'](_0x1184fe[_0xc105('0x3d')],{'$or':_[_0xc105('0x2f')](_0x1184fe['attributes'],function(_0x17e549){var _0x10790d={};_0x10790d[_0x17e549]={'$like':'%'+_0x20ee68[_0xc105('0x34')][_0xc105('0x3f')]+'%'};return _0x10790d;})});}_0x1184fe=_['merge']({},_0x1184fe,_0x20ee68[_0xc105('0x42')]);return _0x5862bf[_0xc105('0x54')](_0x1184fe);}})[_0xc105('0x27')](function(_0x1aeb6d){if(_0x1aeb6d){_0x58edb2=_0x1aeb6d['length'];if(!_0x20ee68[_0xc105('0x34')][_0xc105('0x39')](_0xc105('0x3a'))){_0x1184fe[_0xc105('0x1e')]=qs[_0xc105('0x1e')](_0x20ee68['query']['limit']);_0x1184fe['offset']=qs[_0xc105('0x1d')](_0x20ee68[_0xc105('0x34')][_0xc105('0x1d')]);}return _0x5862bf[_0xc105('0x54')](_0x1184fe);}})[_0xc105('0x27')](function(_0x534728){if(_0x534728){return _0x534728?{'count':_0x58edb2,'rows':_0x534728}:null;}})[_0xc105('0x27')](respondWithResult(_0x29a131,null))[_0xc105('0x4b')](handleError(_0x29a131,null));};exports[_0xc105('0x56')]=function(_0x186e8b,_0x29ffdc,_0x45d96f){if(_0x186e8b[_0xc105('0x4d')]['id']){delete _0x186e8b[_0xc105('0x4d')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x186e8b[_0xc105('0x48')]['id']}})[_0xc105('0x27')](handleEntityNotFound(_0x29ffdc,null))[_0xc105('0x27')](function(_0x4a9e37){if(_0x4a9e37){return _0x4a9e37[_0xc105('0x56')](_0x186e8b[_0xc105('0x4d')]['ids']||[]);}return null;})['then'](respondWithResult(_0x29ffdc,null))[_0xc105('0x4b')](handleError(_0x29ffdc,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 5f36eef..71af053 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 _0xcfd2=['./intDeskConfiguration.attributes','DeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3f2790,_0x4b03ff){var _0x5e7773=function(_0x8062ec){while(--_0x8062ec){_0x3f2790['push'](_0x3f2790['shift']());}};_0x5e7773(++_0x4b03ff);}(_0xcfd2,0xe9));var _0x2cfd=function(_0x1ba2e5,_0xbcc3fb){_0x1ba2e5=_0x1ba2e5-0x0;var _0x2b8957=_0xcfd2[_0x1ba2e5];return _0x2b8957;};'use strict';var _=require(_0x2cfd('0x0'));var util=require(_0x2cfd('0x1'));var logger=require(_0x2cfd('0x2'))(_0x2cfd('0x3'));var moment=require(_0x2cfd('0x4'));var BPromise=require(_0x2cfd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cfd('0x6'));var rimraf=require(_0x2cfd('0x7'));var config=require(_0x2cfd('0x8'));var attributes=require(_0x2cfd('0x9'));module['exports']=function(_0x3c901c,_0x2e9553){return _0x3c901c['define'](_0x2cfd('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x613f=['int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0xf8429f,_0x2cc589){var _0x2b4b97=function(_0x257397){while(--_0x257397){_0xf8429f['push'](_0xf8429f['shift']());}};_0x2b4b97(++_0x2cc589);}(_0x613f,0x6d));var _0xf613=function(_0x286888,_0x2236c5){_0x286888=_0x286888-0x0;var _0x5f24d3=_0x613f[_0x286888];return _0x5f24d3;};'use strict';var _=require(_0xf613('0x0'));var util=require(_0xf613('0x1'));var logger=require(_0xf613('0x2'))(_0xf613('0x3'));var moment=require(_0xf613('0x4'));var BPromise=require(_0xf613('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf613('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf613('0x7'));module[_0xf613('0x8')]=function(_0x42f40d,_0x28a9a4){return _0x42f40d[_0xf613('0x9')](_0xf613('0xa'),attributes,{'tableName':_0xf613('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 8ae1085..a574e42 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 _0x11e3=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2064ec,_0x359b63){var _0x31a60a=function(_0x860a22){while(--_0x860a22){_0x2064ec['push'](_0x2064ec['shift']());}};_0x31a60a(++_0x359b63);}(_0x11e3,0x6f));var _0x311e=function(_0x6f64d1,_0x1cc95a){_0x6f64d1=_0x6f64d1-0x0;var _0x1bc1f5=_0x11e3[_0x6f64d1];return _0x1bc1f5;};'use strict';var _=require(_0x311e('0x0'));var util=require(_0x311e('0x1'));var moment=require(_0x311e('0x2'));var BPromise=require(_0x311e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x311e('0x4'));var db=require(_0x311e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x311e('0x6'))(_0x311e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x311e('0x8')][_0x311e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x433af7,_0xd80072,_0x287bc8){return new BPromise(function(_0x7152cf,_0x3364d0){return client[_0x311e('0xa')](_0x433af7,_0x287bc8)[_0x311e('0xb')](function(_0x329b2e){logger[_0x311e('0xc')](_0x311e('0xd'),_0xd80072,_0x311e('0xe'));logger['debug'](_0x311e('0xf'),_0xd80072,'request\x20sent',JSON[_0x311e('0x10')](_0x329b2e));if(_0x329b2e[_0x311e('0x11')]){if(_0x329b2e[_0x311e('0x11')][_0x311e('0x12')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0xd80072,_0x329b2e[_0x311e('0x11')]['message']);return _0x3364d0(_0x329b2e['error'][_0x311e('0x13')]);}logger[_0x311e('0x11')](_0x311e('0xd'),_0xd80072,_0x329b2e[_0x311e('0x11')][_0x311e('0x13')]);return _0x7152cf(_0x329b2e[_0x311e('0x11')]['message']);}else{logger[_0x311e('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0xd80072,'request\x20sent');_0x7152cf(_0x329b2e[_0x311e('0x14')]['message']);}})[_0x311e('0x15')](function(_0x5df264){logger[_0x311e('0x11')](_0x311e('0xd'),_0xd80072,_0x5df264);_0x3364d0(_0x5df264);});});} \ No newline at end of file +var _0x0268=['message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x590218,_0x5bd329){var _0x2c0a0f=function(_0x2a57dd){while(--_0x2a57dd){_0x590218['push'](_0x590218['shift']());}};_0x2c0a0f(++_0x5bd329);}(_0x0268,0x17e));var _0x8026=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x0268[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x8026('0x0'));var util=require('util');var moment=require(_0x8026('0x1'));var BPromise=require(_0x8026('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8026('0x3'));var db=require(_0x8026('0x4'))['db'];var utils=require(_0x8026('0x5'));var logger=require(_0x8026('0x6'))(_0x8026('0x7'));var config=require('../../config/environment');var jayson=require(_0x8026('0x8'));var client=jayson[_0x8026('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2573a8,_0x2881ea,_0x38e49e){return new BPromise(function(_0xaf6f84,_0x1119f0){return client[_0x8026('0xa')](_0x2573a8,_0x38e49e)[_0x8026('0xb')](function(_0x1d5d8f){logger[_0x8026('0xc')](_0x8026('0xd'),_0x2881ea,_0x8026('0xe'));logger[_0x8026('0xf')](_0x8026('0x10'),_0x2881ea,'request\x20sent',JSON['stringify'](_0x1d5d8f));if(_0x1d5d8f['error']){if(_0x1d5d8f[_0x8026('0x11')]['code']===0x1f4){logger[_0x8026('0x11')](_0x8026('0xd'),_0x2881ea,_0x1d5d8f[_0x8026('0x11')][_0x8026('0x12')]);return _0x1119f0(_0x1d5d8f[_0x8026('0x11')][_0x8026('0x12')]);}logger[_0x8026('0x11')](_0x8026('0xd'),_0x2881ea,_0x1d5d8f[_0x8026('0x11')][_0x8026('0x12')]);return _0xaf6f84(_0x1d5d8f[_0x8026('0x11')][_0x8026('0x12')]);}else{logger[_0x8026('0xc')](_0x8026('0xd'),_0x2881ea,_0x8026('0xe'));_0xaf6f84(_0x1d5d8f[_0x8026('0x13')][_0x8026('0x12')]);}})['catch'](function(_0x5df96d){logger[_0x8026('0x11')](_0x8026('0xd'),_0x2881ea,_0x5df96d);_0x1119f0(_0x5df96d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 22dd8a0..f702359 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 _0xfce9=['../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','post','put','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0xfce9,0x66));var _0x9fce=function(_0x358653,_0xa1d9be){_0x358653=_0x358653-0x0;var _0x1178ae=_0xfce9[_0x358653];return _0x1178ae;};'use strict';var multer=require(_0x9fce('0x0'));var util=require('util');var path=require(_0x9fce('0x1'));var timeout=require(_0x9fce('0x2'));var express=require(_0x9fce('0x3'));var router=express[_0x9fce('0x4')]();var fs_extra=require(_0x9fce('0x5'));var auth=require(_0x9fce('0x6'));var interaction=require(_0x9fce('0x7'));var config=require('../../config/environment');var controller=require(_0x9fce('0x8'));router[_0x9fce('0x9')]('/',auth[_0x9fce('0xa')](),controller[_0x9fce('0xb')]);router['get']('/:id',auth[_0x9fce('0xa')](),controller['show']);router[_0x9fce('0xc')]('/',auth[_0x9fce('0xa')](),controller['create']);router[_0x9fce('0xd')]('/:id',auth[_0x9fce('0xa')](),controller[_0x9fce('0xe')]);router[_0x9fce('0xf')](_0x9fce('0x10'),auth[_0x9fce('0xa')](),controller[_0x9fce('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfc6d=['multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports'];(function(_0xe55053,_0x149b3d){var _0x5bc0b8=function(_0x3bf14f){while(--_0x3bf14f){_0xe55053['push'](_0xe55053['shift']());}};_0x5bc0b8(++_0x149b3d);}(_0xfc6d,0x1e6));var _0xdfc6=function(_0x5f4a39,_0x4831bd){_0x5f4a39=_0x5f4a39-0x0;var _0x31f117=_0xfc6d[_0x5f4a39];return _0x31f117;};'use strict';var multer=require(_0xdfc6('0x0'));var util=require(_0xdfc6('0x1'));var path=require(_0xdfc6('0x2'));var timeout=require(_0xdfc6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdfc6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdfc6('0x5'));var config=require(_0xdfc6('0x6'));var controller=require('./intDeskField.controller');router[_0xdfc6('0x7')]('/',auth['isAuthenticated'](),controller[_0xdfc6('0x8')]);router[_0xdfc6('0x7')](_0xdfc6('0x9'),auth[_0xdfc6('0xa')](),controller[_0xdfc6('0xb')]);router[_0xdfc6('0xc')]('/',auth[_0xdfc6('0xa')](),controller[_0xdfc6('0xd')]);router[_0xdfc6('0xe')](_0xdfc6('0x9'),auth[_0xdfc6('0xa')](),controller[_0xdfc6('0xf')]);router[_0xdfc6('0x10')](_0xdfc6('0x9'),auth[_0xdfc6('0xa')](),controller['destroy']);module[_0xdfc6('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 f906cda..0a2dd07 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 _0xe7ab=['STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x5b60fd,_0x25edc8){var _0x44d2c2=function(_0x79edbb){while(--_0x79edbb){_0x5b60fd['push'](_0x5b60fd['shift']());}};_0x44d2c2(++_0x25edc8);}(_0xe7ab,0x80));var _0xbe7a=function(_0x255a00,_0x60ef58){_0x255a00=_0x255a00-0x0;var _0x58b9a6=_0xe7ab[_0x255a00];return _0x58b9a6;};'use strict';var Sequelize=require('sequelize');module[_0xbe7a('0x0')]={'type':{'type':Sequelize[_0xbe7a('0x1')](_0xbe7a('0x2'),_0xbe7a('0x3'),'customVariable','keyValue','picklist'),'defaultValue':_0xbe7a('0x2')},'content':{'type':Sequelize[_0xbe7a('0x4')]},'key':{'type':Sequelize[_0xbe7a('0x4')]},'keyType':{'type':Sequelize[_0xbe7a('0x1')](_0xbe7a('0x2'),_0xbe7a('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbe7a('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf1ea=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf1ea,0x1c7));var _0xaf1e=function(_0x7179a0,_0x2c25c2){_0x7179a0=_0x7179a0-0x0;var _0x5e2c30=_0xf1ea[_0x7179a0];return _0x5e2c30;};'use strict';var Sequelize=require('sequelize');module[_0xaf1e('0x0')]={'type':{'type':Sequelize[_0xaf1e('0x1')](_0xaf1e('0x2'),_0xaf1e('0x3'),_0xaf1e('0x4'),_0xaf1e('0x5'),'picklist'),'defaultValue':_0xaf1e('0x2')},'content':{'type':Sequelize[_0xaf1e('0x6')]},'key':{'type':Sequelize[_0xaf1e('0x6')]},'keyType':{'type':Sequelize[_0xaf1e('0x1')](_0xaf1e('0x2'),_0xaf1e('0x3'),_0xaf1e('0x4'))},'keyContent':{'type':Sequelize[_0xaf1e('0x6')]},'idField':{'type':Sequelize[_0xaf1e('0x6')]},'nameField':{'type':Sequelize[_0xaf1e('0x6')]},'customField':{'type':Sequelize[_0xaf1e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaf1e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 84d6024..a4d428c 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 _0x2bae=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','DeskField','rawAttributes','type','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','intersection','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe2ba('0x0'));var rimraf=require(_0xe2ba('0x1'));var zipdir=require(_0xe2ba('0x2'));var jsonpatch=require(_0xe2ba('0x3'));var rp=require(_0xe2ba('0x4'));var moment=require(_0xe2ba('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe2ba('0x6'));var util=require('util');var path=require(_0xe2ba('0x7'));var sox=require('sox');var csv=require(_0xe2ba('0x8'));var ejs=require(_0xe2ba('0x9'));var fs=require('fs');var fs_extra=require(_0xe2ba('0xa'));var _=require('lodash');var squel=require(_0xe2ba('0xb'));var crypto=require(_0xe2ba('0xc'));var jsforce=require(_0xe2ba('0xd'));var deskjs=require(_0xe2ba('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe2ba('0xf'));var Redis=require(_0xe2ba('0x10'));var authService=require(_0xe2ba('0x11'));var qs=require(_0xe2ba('0x12'));var as=require(_0xe2ba('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2ba('0x14'))(_0xe2ba('0x15'));var utils=require(_0xe2ba('0x16'));var config=require(_0xe2ba('0x17'));var licenseUtil=require(_0xe2ba('0x18'));var db=require(_0xe2ba('0x19'))['db'];function respondWithStatusCode(_0x2ab70c,_0x9e154c){_0x9e154c=_0x9e154c||0xcc;return function(_0x2da78d){if(_0x2da78d){return _0x2ab70c[_0xe2ba('0x1a')](_0x9e154c);}return _0x2ab70c[_0xe2ba('0x1b')](_0x9e154c)['end']();};}function respondWithResult(_0x13c591,_0x1b1dac){_0x1b1dac=_0x1b1dac||0xc8;return function(_0x5f48a2){if(_0x5f48a2){return _0x13c591[_0xe2ba('0x1b')](_0x1b1dac)[_0xe2ba('0x1c')](_0x5f48a2);}};}function respondWithFilteredResult(_0x1ecee0,_0x1d2547){return function(_0x718656){if(_0x718656){var _0x4a30ce=typeof _0x1d2547[_0xe2ba('0x1d')]===_0xe2ba('0x1e')&&typeof _0x1d2547[_0xe2ba('0x1f')]==='undefined';var _0x246aef=_0x718656[_0xe2ba('0x20')];var _0x3108fd=_0x4a30ce?0x0:_0x1d2547[_0xe2ba('0x1d')];var _0x10825d=_0x4a30ce?_0x718656[_0xe2ba('0x20')]:_0x1d2547[_0xe2ba('0x1d')]+_0x1d2547[_0xe2ba('0x1f')];var _0x12c934;if(_0x10825d>=_0x246aef){_0x10825d=_0x246aef;_0x12c934=0xc8;}else{_0x12c934=0xce;}_0x1ecee0[_0xe2ba('0x1b')](_0x12c934);return _0x1ecee0[_0xe2ba('0x21')]('Content-Range',_0x3108fd+'-'+_0x10825d+'/'+_0x246aef)[_0xe2ba('0x1c')](_0x718656);}return null;};}function patchUpdates(_0x382ccb){return function(_0x482829){try{jsonpatch[_0xe2ba('0x22')](_0x482829,_0x382ccb,!![]);}catch(_0x4dffdb){return BPromise[_0xe2ba('0x23')](_0x4dffdb);}return _0x482829[_0xe2ba('0x24')]();};}function saveUpdates(_0x3c8359,_0x5eed81){return function(_0x55ea9a){if(_0x55ea9a){return _0x55ea9a[_0xe2ba('0x25')](_0x3c8359)[_0xe2ba('0x26')](function(_0x4d696b){return _0x4d696b;});}return null;};}function removeEntity(_0x5ed37f,_0x5dcfa5){return function(_0x86b154){if(_0x86b154){return _0x86b154[_0xe2ba('0x27')]()[_0xe2ba('0x26')](function(){_0x5ed37f[_0xe2ba('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40d9b4,_0x1b0601){return function(_0x5e6a76){if(!_0x5e6a76){_0x40d9b4[_0xe2ba('0x1a')](0x194);}return _0x5e6a76;};}function handleError(_0x31905b,_0x46eff9){_0x46eff9=_0x46eff9||0x1f4;return function(_0x38db6d){logger[_0xe2ba('0x28')](_0x38db6d[_0xe2ba('0x29')]);if(_0x38db6d[_0xe2ba('0x2a')]){delete _0x38db6d[_0xe2ba('0x2a')];}_0x31905b['status'](_0x46eff9)[_0xe2ba('0x2b')](_0x38db6d);};}exports['index']=function(_0x33840d,_0x520eb3){var _0x172334={},_0x1c8882={},_0x30d5c0={'count':0x0,'rows':[]};var _0x4fde3f=_['map'](db[_0xe2ba('0x2c')][_0xe2ba('0x2d')],function(_0x3d7f12){return{'name':_0x3d7f12['fieldName'],'type':_0x3d7f12[_0xe2ba('0x2e')][_0xe2ba('0x2f')]};});_0x1c8882[_0xe2ba('0x30')]=_[_0xe2ba('0x31')](_0x4fde3f,_0xe2ba('0x2a'));_0x1c8882[_0xe2ba('0x32')]=_[_0xe2ba('0x33')](_0x33840d['query']);_0x1c8882[_0xe2ba('0x34')]=_['intersection'](_0x1c8882[_0xe2ba('0x30')],_0x1c8882[_0xe2ba('0x32')]);_0x172334['attributes']=_['intersection'](_0x1c8882[_0xe2ba('0x30')],qs['fields'](_0x33840d[_0xe2ba('0x32')][_0xe2ba('0x35')]));_0x172334[_0xe2ba('0x36')]=_0x172334[_0xe2ba('0x36')][_0xe2ba('0x37')]?_0x172334[_0xe2ba('0x36')]:_0x1c8882[_0xe2ba('0x30')];if(!_0x33840d[_0xe2ba('0x32')][_0xe2ba('0x38')](_0xe2ba('0x39'))){_0x172334[_0xe2ba('0x1f')]=qs[_0xe2ba('0x1f')](_0x33840d[_0xe2ba('0x32')][_0xe2ba('0x1f')]);_0x172334['offset']=qs[_0xe2ba('0x1d')](_0x33840d[_0xe2ba('0x32')][_0xe2ba('0x1d')]);}_0x172334[_0xe2ba('0x3a')]=qs[_0xe2ba('0x3b')](_0x33840d[_0xe2ba('0x32')][_0xe2ba('0x3b')]);_0x172334[_0xe2ba('0x3c')]=qs['filters'](_[_0xe2ba('0x3d')](_0x33840d[_0xe2ba('0x32')],_0x1c8882[_0xe2ba('0x34')]),_0x4fde3f);if(_0x33840d[_0xe2ba('0x32')][_0xe2ba('0x3e')]){_0x172334[_0xe2ba('0x3c')]=_[_0xe2ba('0x3f')](_0x172334['where'],{'$or':_[_0xe2ba('0x31')](_0x4fde3f,function(_0x55aa55){if(_0x55aa55[_0xe2ba('0x2e')]!==_0xe2ba('0x40')){var _0x2366d0={};_0x2366d0[_0x55aa55[_0xe2ba('0x2a')]]={'$like':'%'+_0x33840d[_0xe2ba('0x32')][_0xe2ba('0x3e')]+'%'};return _0x2366d0;}})});}_0x172334=_[_0xe2ba('0x3f')]({},_0x172334,_0x33840d[_0xe2ba('0x41')]);var _0x231d7b={'where':_0x172334['where']};return db[_0xe2ba('0x2c')][_0xe2ba('0x20')](_0x231d7b)[_0xe2ba('0x26')](function(_0x26242f){_0x30d5c0[_0xe2ba('0x20')]=_0x26242f;if(_0x33840d[_0xe2ba('0x32')][_0xe2ba('0x42')]){_0x172334[_0xe2ba('0x43')]=[{'all':!![]}];}return db[_0xe2ba('0x2c')]['findAll'](_0x172334);})[_0xe2ba('0x26')](function(_0x5966b3){_0x30d5c0[_0xe2ba('0x44')]=_0x5966b3;return _0x30d5c0;})[_0xe2ba('0x26')](respondWithFilteredResult(_0x520eb3,_0x172334))['catch'](handleError(_0x520eb3,null));};exports['show']=function(_0x2a0e8a,_0x1f5a72){var _0x519c69={'raw':!![],'where':{'id':_0x2a0e8a[_0xe2ba('0x45')]['id']}},_0x1dc9dd={};_0x1dc9dd[_0xe2ba('0x30')]=_['keys'](db[_0xe2ba('0x2c')]['rawAttributes']);_0x1dc9dd[_0xe2ba('0x32')]=_['keys'](_0x2a0e8a[_0xe2ba('0x32')]);_0x1dc9dd[_0xe2ba('0x34')]=_[_0xe2ba('0x46')](_0x1dc9dd['model'],_0x1dc9dd[_0xe2ba('0x32')]);_0x519c69[_0xe2ba('0x36')]=_[_0xe2ba('0x46')](_0x1dc9dd[_0xe2ba('0x30')],qs[_0xe2ba('0x35')](_0x2a0e8a[_0xe2ba('0x32')][_0xe2ba('0x35')]));_0x519c69[_0xe2ba('0x36')]=_0x519c69[_0xe2ba('0x36')][_0xe2ba('0x37')]?_0x519c69[_0xe2ba('0x36')]:_0x1dc9dd[_0xe2ba('0x30')];if(_0x2a0e8a[_0xe2ba('0x32')][_0xe2ba('0x42')]){_0x519c69[_0xe2ba('0x43')]=[{'all':!![]}];}_0x519c69=_[_0xe2ba('0x3f')]({},_0x519c69,_0x2a0e8a[_0xe2ba('0x41')]);return db['DeskField'][_0xe2ba('0x47')](_0x519c69)[_0xe2ba('0x26')](handleEntityNotFound(_0x1f5a72,null))['then'](respondWithResult(_0x1f5a72,null))[_0xe2ba('0x48')](handleError(_0x1f5a72,null));};exports['create']=function(_0x584f5e,_0x3b2b00){return db['DeskField'][_0xe2ba('0x49')](_0x584f5e[_0xe2ba('0x4a')],{})[_0xe2ba('0x26')](respondWithResult(_0x3b2b00,0xc9))[_0xe2ba('0x48')](handleError(_0x3b2b00,null));};exports['update']=function(_0x5abb6b,_0x26e7e5){if(_0x5abb6b[_0xe2ba('0x4a')]['id']){delete _0x5abb6b[_0xe2ba('0x4a')]['id'];}return db[_0xe2ba('0x2c')][_0xe2ba('0x47')]({'where':{'id':_0x5abb6b[_0xe2ba('0x45')]['id']}})['then'](handleEntityNotFound(_0x26e7e5,null))[_0xe2ba('0x26')](saveUpdates(_0x5abb6b[_0xe2ba('0x4a')],null))[_0xe2ba('0x26')](respondWithResult(_0x26e7e5,null))[_0xe2ba('0x48')](handleError(_0x26e7e5,null));};exports[_0xe2ba('0x27')]=function(_0x5a1b24,_0x3468e5){return db[_0xe2ba('0x2c')][_0xe2ba('0x47')]({'where':{'id':_0x5a1b24['params']['id']}})[_0xe2ba('0x26')](handleEntityNotFound(_0x3468e5,null))[_0xe2ba('0x26')](removeEntity(_0x3468e5,null))['catch'](handleError(_0x3468e5,null));}; \ No newline at end of file +var _0xf066=['lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','name','index','map','DeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','then','rows','show','params','includeAll','find','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xf066,0x1a4));var _0x6f06=function(_0x4c4ca2,_0x30d812){_0x4c4ca2=_0x4c4ca2-0x0;var _0x17dac3=_0xf066[_0x4c4ca2];return _0x17dac3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f06('0x0'));var zipdir=require(_0x6f06('0x1'));var jsonpatch=require(_0x6f06('0x2'));var rp=require(_0x6f06('0x3'));var moment=require(_0x6f06('0x4'));var BPromise=require(_0x6f06('0x5'));var Mustache=require(_0x6f06('0x6'));var util=require(_0x6f06('0x7'));var path=require('path');var sox=require(_0x6f06('0x8'));var csv=require(_0x6f06('0x9'));var ejs=require(_0x6f06('0xa'));var fs=require('fs');var fs_extra=require(_0x6f06('0xb'));var _=require(_0x6f06('0xc'));var squel=require('squel');var crypto=require(_0x6f06('0xd'));var jsforce=require(_0x6f06('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6f06('0x9'));var querystring=require(_0x6f06('0xf'));var Papa=require(_0x6f06('0x10'));var Redis=require('ioredis');var authService=require(_0x6f06('0x11'));var qs=require(_0x6f06('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f06('0x13'));var logger=require('../../config/logger')(_0x6f06('0x14'));var utils=require(_0x6f06('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6f06('0x16'));var db=require(_0x6f06('0x17'))['db'];function respondWithStatusCode(_0x2090cd,_0x1e450b){_0x1e450b=_0x1e450b||0xcc;return function(_0x44fa5d){if(_0x44fa5d){return _0x2090cd[_0x6f06('0x18')](_0x1e450b);}return _0x2090cd['status'](_0x1e450b)[_0x6f06('0x19')]();};}function respondWithResult(_0x289780,_0x45c879){_0x45c879=_0x45c879||0xc8;return function(_0x4da917){if(_0x4da917){return _0x289780[_0x6f06('0x1a')](_0x45c879)[_0x6f06('0x1b')](_0x4da917);}};}function respondWithFilteredResult(_0x15eb18,_0x3d9747){return function(_0x16ba56){if(_0x16ba56){var _0x13375a=typeof _0x3d9747[_0x6f06('0x1c')]===_0x6f06('0x1d')&&typeof _0x3d9747[_0x6f06('0x1e')]==='undefined';var _0x23a72f=_0x16ba56[_0x6f06('0x1f')];var _0x2da046=_0x13375a?0x0:_0x3d9747['offset'];var _0x3df5e5=_0x13375a?_0x16ba56[_0x6f06('0x1f')]:_0x3d9747['offset']+_0x3d9747[_0x6f06('0x1e')];var _0x3280d2;if(_0x3df5e5>=_0x23a72f){_0x3df5e5=_0x23a72f;_0x3280d2=0xc8;}else{_0x3280d2=0xce;}_0x15eb18[_0x6f06('0x1a')](_0x3280d2);return _0x15eb18[_0x6f06('0x20')](_0x6f06('0x21'),_0x2da046+'-'+_0x3df5e5+'/'+_0x23a72f)['json'](_0x16ba56);}return null;};}function patchUpdates(_0x740244){return function(_0x20636f){try{jsonpatch['apply'](_0x20636f,_0x740244,!![]);}catch(_0x3592d5){return BPromise[_0x6f06('0x22')](_0x3592d5);}return _0x20636f[_0x6f06('0x23')]();};}function saveUpdates(_0x71b9d8,_0x38452b){return function(_0x741a4a){if(_0x741a4a){return _0x741a4a[_0x6f06('0x24')](_0x71b9d8)['then'](function(_0xf2ebca){return _0xf2ebca;});}return null;};}function removeEntity(_0x2cfdc4,_0x3faa0){return function(_0x52df81){if(_0x52df81){return _0x52df81[_0x6f06('0x25')]()['then'](function(){_0x2cfdc4[_0x6f06('0x1a')](0xcc)[_0x6f06('0x19')]();});}};}function handleEntityNotFound(_0x6a0a06,_0xa62058){return function(_0x1ac421){if(!_0x1ac421){_0x6a0a06[_0x6f06('0x18')](0x194);}return _0x1ac421;};}function handleError(_0x46e5fd,_0x4fee12){_0x4fee12=_0x4fee12||0x1f4;return function(_0x3c1709){logger[_0x6f06('0x26')](_0x3c1709['stack']);if(_0x3c1709[_0x6f06('0x27')]){delete _0x3c1709[_0x6f06('0x27')];}_0x46e5fd[_0x6f06('0x1a')](_0x4fee12)['send'](_0x3c1709);};}exports[_0x6f06('0x28')]=function(_0x54d0b9,_0x1a3640){var _0x3dafcb={},_0x510d3d={},_0x607254={'count':0x0,'rows':[]};var _0x20cc7d=_[_0x6f06('0x29')](db[_0x6f06('0x2a')][_0x6f06('0x2b')],function(_0x3447e3){return{'name':_0x3447e3[_0x6f06('0x2c')],'type':_0x3447e3['type'][_0x6f06('0x2d')]};});_0x510d3d[_0x6f06('0x2e')]=_[_0x6f06('0x29')](_0x20cc7d,'name');_0x510d3d[_0x6f06('0x2f')]=_[_0x6f06('0x30')](_0x54d0b9['query']);_0x510d3d[_0x6f06('0x31')]=_[_0x6f06('0x32')](_0x510d3d[_0x6f06('0x2e')],_0x510d3d[_0x6f06('0x2f')]);_0x3dafcb[_0x6f06('0x33')]=_['intersection'](_0x510d3d[_0x6f06('0x2e')],qs[_0x6f06('0x34')](_0x54d0b9[_0x6f06('0x2f')][_0x6f06('0x34')]));_0x3dafcb[_0x6f06('0x33')]=_0x3dafcb[_0x6f06('0x33')][_0x6f06('0x35')]?_0x3dafcb['attributes']:_0x510d3d[_0x6f06('0x2e')];if(!_0x54d0b9[_0x6f06('0x2f')][_0x6f06('0x36')]('nolimit')){_0x3dafcb['limit']=qs[_0x6f06('0x1e')](_0x54d0b9['query'][_0x6f06('0x1e')]);_0x3dafcb[_0x6f06('0x1c')]=qs[_0x6f06('0x1c')](_0x54d0b9[_0x6f06('0x2f')]['offset']);}_0x3dafcb['order']=qs[_0x6f06('0x37')](_0x54d0b9[_0x6f06('0x2f')]['sort']);_0x3dafcb[_0x6f06('0x38')]=qs['filters'](_[_0x6f06('0x39')](_0x54d0b9[_0x6f06('0x2f')],_0x510d3d[_0x6f06('0x31')]),_0x20cc7d);if(_0x54d0b9[_0x6f06('0x2f')][_0x6f06('0x3a')]){_0x3dafcb[_0x6f06('0x38')]=_[_0x6f06('0x3b')](_0x3dafcb[_0x6f06('0x38')],{'$or':_[_0x6f06('0x29')](_0x20cc7d,function(_0x1bdc53){if(_0x1bdc53[_0x6f06('0x3c')]!==_0x6f06('0x3d')){var _0x42dc05={};_0x42dc05[_0x1bdc53[_0x6f06('0x27')]]={'$like':'%'+_0x54d0b9['query'][_0x6f06('0x3a')]+'%'};return _0x42dc05;}})});}_0x3dafcb=_[_0x6f06('0x3b')]({},_0x3dafcb,_0x54d0b9[_0x6f06('0x3e')]);var _0x2fcfdf={'where':_0x3dafcb[_0x6f06('0x38')]};return db[_0x6f06('0x2a')][_0x6f06('0x1f')](_0x2fcfdf)[_0x6f06('0x3f')](function(_0x16b8cc){_0x607254[_0x6f06('0x1f')]=_0x16b8cc;if(_0x54d0b9[_0x6f06('0x2f')]['includeAll']){_0x3dafcb['include']=[{'all':!![]}];}return db['DeskField']['findAll'](_0x3dafcb);})[_0x6f06('0x3f')](function(_0x2be98c){_0x607254[_0x6f06('0x40')]=_0x2be98c;return _0x607254;})[_0x6f06('0x3f')](respondWithFilteredResult(_0x1a3640,_0x3dafcb))['catch'](handleError(_0x1a3640,null));};exports[_0x6f06('0x41')]=function(_0x2004d9,_0x104efe){var _0xdbfce4={'raw':!![],'where':{'id':_0x2004d9[_0x6f06('0x42')]['id']}},_0x585043={};_0x585043[_0x6f06('0x2e')]=_[_0x6f06('0x30')](db[_0x6f06('0x2a')]['rawAttributes']);_0x585043[_0x6f06('0x2f')]=_[_0x6f06('0x30')](_0x2004d9[_0x6f06('0x2f')]);_0x585043[_0x6f06('0x31')]=_[_0x6f06('0x32')](_0x585043[_0x6f06('0x2e')],_0x585043[_0x6f06('0x2f')]);_0xdbfce4[_0x6f06('0x33')]=_['intersection'](_0x585043[_0x6f06('0x2e')],qs[_0x6f06('0x34')](_0x2004d9['query']['fields']));_0xdbfce4[_0x6f06('0x33')]=_0xdbfce4[_0x6f06('0x33')][_0x6f06('0x35')]?_0xdbfce4['attributes']:_0x585043[_0x6f06('0x2e')];if(_0x2004d9[_0x6f06('0x2f')][_0x6f06('0x43')]){_0xdbfce4['include']=[{'all':!![]}];}_0xdbfce4=_[_0x6f06('0x3b')]({},_0xdbfce4,_0x2004d9[_0x6f06('0x3e')]);return db[_0x6f06('0x2a')][_0x6f06('0x44')](_0xdbfce4)[_0x6f06('0x3f')](handleEntityNotFound(_0x104efe,null))[_0x6f06('0x3f')](respondWithResult(_0x104efe,null))['catch'](handleError(_0x104efe,null));};exports[_0x6f06('0x45')]=function(_0x2003da,_0x107221){return db[_0x6f06('0x2a')][_0x6f06('0x45')](_0x2003da[_0x6f06('0x46')],{})[_0x6f06('0x3f')](respondWithResult(_0x107221,0xc9))[_0x6f06('0x47')](handleError(_0x107221,null));};exports[_0x6f06('0x24')]=function(_0xf5dfd8,_0xa2c2be){if(_0xf5dfd8['body']['id']){delete _0xf5dfd8[_0x6f06('0x46')]['id'];}return db[_0x6f06('0x2a')][_0x6f06('0x44')]({'where':{'id':_0xf5dfd8[_0x6f06('0x42')]['id']}})[_0x6f06('0x3f')](handleEntityNotFound(_0xa2c2be,null))[_0x6f06('0x3f')](saveUpdates(_0xf5dfd8['body'],null))[_0x6f06('0x3f')](respondWithResult(_0xa2c2be,null))[_0x6f06('0x47')](handleError(_0xa2c2be,null));};exports['destroy']=function(_0x4fa547,_0x108ada){return db['DeskField'][_0x6f06('0x44')]({'where':{'id':_0x4fa547[_0x6f06('0x42')]['id']}})[_0x6f06('0x3f')](handleEntityNotFound(_0x108ada,null))[_0x6f06('0x3f')](removeEntity(_0x108ada,null))['catch'](handleError(_0x108ada,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 3d0eab3..05b09e2 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 _0x51c1=['int_desk_fields','desk_unique_index','FieldId','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDeskField.attributes','DeskField'];(function(_0xf64500,_0x410815){var _0x58a6e0=function(_0x1fee17){while(--_0x1fee17){_0xf64500['push'](_0xf64500['shift']());}};_0x58a6e0(++_0x410815);}(_0x51c1,0x1dc));var _0x151c=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x51c1[_0x18a79d];return _0x4f8848;};'use strict';var _=require('lodash');var util=require(_0x151c('0x0'));var logger=require(_0x151c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x151c('0x2'));var rp=require(_0x151c('0x3'));var fs=require('fs');var path=require(_0x151c('0x4'));var rimraf=require(_0x151c('0x5'));var config=require('../../config/environment');var attributes=require(_0x151c('0x6'));module['exports']=function(_0x50a7e3,_0x1edcd1){return _0x50a7e3['define'](_0x151c('0x7'),attributes,{'tableName':_0x151c('0x8'),'paranoid':![],'indexes':[{'name':_0x151c('0x9'),'fields':['idField',_0x151c('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f19=['DeskField','int_desk_fields','desk_unique_index','idField','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x105d53,_0x680ba0){var _0x344f5e=function(_0x6b3d43){while(--_0x6b3d43){_0x105d53['push'](_0x105d53['shift']());}};_0x344f5e(++_0x680ba0);}(_0x5f19,0x9e));var _0x95f1=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x5f19[_0x44b3bd];return _0x1efc4a;};'use strict';var _=require(_0x95f1('0x0'));var util=require('util');var logger=require(_0x95f1('0x1'))(_0x95f1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x95f1('0x3'));var fs=require('fs');var path=require(_0x95f1('0x4'));var rimraf=require(_0x95f1('0x5'));var config=require(_0x95f1('0x6'));var attributes=require(_0x95f1('0x7'));module[_0x95f1('0x8')]=function(_0x217042,_0x4bbb28){return _0x217042[_0x95f1('0x9')](_0x95f1('0xa'),attributes,{'tableName':_0x95f1('0xb'),'paranoid':![],'indexes':[{'name':_0x95f1('0xc'),'fields':[_0x95f1('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 caa1e27..61f0136 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 _0xc77d=['client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2a0137,_0x4c4ec4){var _0xaf5173=function(_0x4e5597){while(--_0x4e5597){_0x2a0137['push'](_0x2a0137['shift']());}};_0xaf5173(++_0x4c4ec4);}(_0xc77d,0x182));var _0xdc77=function(_0x46f2f5,_0x5a222d){_0x46f2f5=_0x46f2f5-0x0;var _0x5da818=_0xc77d[_0x46f2f5];return _0x5da818;};'use strict';var _=require(_0xdc77('0x0'));var util=require(_0xdc77('0x1'));var moment=require(_0xdc77('0x2'));var BPromise=require(_0xdc77('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc77('0x4'));var db=require(_0xdc77('0x5'))['db'];var utils=require(_0xdc77('0x6'));var logger=require(_0xdc77('0x7'))('rpc');var config=require(_0xdc77('0x8'));var jayson=require(_0xdc77('0x9'));var client=jayson[_0xdc77('0xa')][_0xdc77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ccbd7,_0x5d8a45,_0x2d68f6){return new BPromise(function(_0x2c7f88,_0x59cce8){return client[_0xdc77('0xc')](_0x1ccbd7,_0x2d68f6)[_0xdc77('0xd')](function(_0x553b0e){logger[_0xdc77('0xe')](_0xdc77('0xf'),_0x5d8a45,_0xdc77('0x10'));logger[_0xdc77('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x5d8a45,_0xdc77('0x10'),JSON[_0xdc77('0x12')](_0x553b0e));if(_0x553b0e['error']){if(_0x553b0e['error'][_0xdc77('0x13')]===0x1f4){logger[_0xdc77('0x14')](_0xdc77('0xf'),_0x5d8a45,_0x553b0e[_0xdc77('0x14')][_0xdc77('0x15')]);return _0x59cce8(_0x553b0e[_0xdc77('0x14')][_0xdc77('0x15')]);}logger['error'](_0xdc77('0xf'),_0x5d8a45,_0x553b0e[_0xdc77('0x14')][_0xdc77('0x15')]);return _0x2c7f88(_0x553b0e[_0xdc77('0x14')][_0xdc77('0x15')]);}else{logger['info'](_0xdc77('0xf'),_0x5d8a45,'request\x20sent');_0x2c7f88(_0x553b0e['result'][_0xdc77('0x15')]);}})['catch'](function(_0x4ef302){logger[_0xdc77('0x14')](_0xdc77('0xf'),_0x5d8a45,_0x4ef302);_0x59cce8(_0x4ef302);});});} \ No newline at end of file +var _0x3d88=['DeskField,\x20%s,\x20%s,\x20%s','stringify','error','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0x175987,_0x25d234){var _0x1533fe=function(_0x48a327){while(--_0x48a327){_0x175987['push'](_0x175987['shift']());}};_0x1533fe(++_0x25d234);}(_0x3d88,0x16f));var _0x83d8=function(_0x4982cd,_0x5042c4){_0x4982cd=_0x4982cd-0x0;var _0x7771f4=_0x3d88[_0x4982cd];return _0x7771f4;};'use strict';var _=require(_0x83d8('0x0'));var util=require(_0x83d8('0x1'));var moment=require('moment');var BPromise=require(_0x83d8('0x2'));var rs=require(_0x83d8('0x3'));var fs=require('fs');var Redis=require(_0x83d8('0x4'));var db=require(_0x83d8('0x5'))['db'];var utils=require(_0x83d8('0x6'));var logger=require(_0x83d8('0x7'))(_0x83d8('0x8'));var config=require(_0x83d8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x83d8('0xa')][_0x83d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21843e,_0x7c7fea,_0x1bbfd0){return new BPromise(function(_0x22bfd7,_0x22246c){return client[_0x83d8('0xc')](_0x21843e,_0x1bbfd0)[_0x83d8('0xd')](function(_0xb68059){logger[_0x83d8('0xe')]('DeskField,\x20%s,\x20%s',_0x7c7fea,_0x83d8('0xf'));logger[_0x83d8('0x10')](_0x83d8('0x11'),_0x7c7fea,_0x83d8('0xf'),JSON[_0x83d8('0x12')](_0xb68059));if(_0xb68059[_0x83d8('0x13')]){if(_0xb68059[_0x83d8('0x13')]['code']===0x1f4){logger['error'](_0x83d8('0x14'),_0x7c7fea,_0xb68059['error'][_0x83d8('0x15')]);return _0x22246c(_0xb68059[_0x83d8('0x13')][_0x83d8('0x15')]);}logger[_0x83d8('0x13')](_0x83d8('0x14'),_0x7c7fea,_0xb68059[_0x83d8('0x13')][_0x83d8('0x15')]);return _0x22bfd7(_0xb68059[_0x83d8('0x13')]['message']);}else{logger[_0x83d8('0xe')](_0x83d8('0x14'),_0x7c7fea,'request\x20sent');_0x22bfd7(_0xb68059[_0x83d8('0x16')]['message']);}})[_0x83d8('0x17')](function(_0x54a67f){logger[_0x83d8('0x13')](_0x83d8('0x14'),_0x7c7fea,_0x54a67f);_0x22246c(_0x54a67f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 2ce8fcd..e43a9d7 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 _0x7d08=['getConfigurations','/:id/fields','post','create','addConfiguration','put','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x7d08,0x198));var _0x87d0=function(_0x219099,_0x5e5c91){_0x219099=_0x219099-0x0;var _0x59078b=_0x7d08[_0x219099];return _0x59078b;};'use strict';var multer=require(_0x87d0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x87d0('0x1'));var express=require('express');var router=express[_0x87d0('0x2')]();var fs_extra=require(_0x87d0('0x3'));var auth=require(_0x87d0('0x4'));var interaction=require(_0x87d0('0x5'));var config=require('../../config/environment');var controller=require(_0x87d0('0x6'));router[_0x87d0('0x7')]('/',auth[_0x87d0('0x8')](),controller['index']);router[_0x87d0('0x7')](_0x87d0('0x9'),auth[_0x87d0('0x8')](),controller[_0x87d0('0xa')]);router['get'](_0x87d0('0xb'),auth[_0x87d0('0x8')](),controller[_0x87d0('0xc')]);router['get'](_0x87d0('0xd'),auth[_0x87d0('0x8')](),controller['getFields']);router[_0x87d0('0xe')]('/',auth[_0x87d0('0x8')](),controller[_0x87d0('0xf')]);router['post'](_0x87d0('0xb'),auth[_0x87d0('0x8')](),controller[_0x87d0('0x10')]);router[_0x87d0('0x11')]('/:id',auth[_0x87d0('0x8')](),controller[_0x87d0('0x12')]);router['delete'](_0x87d0('0x9'),auth[_0x87d0('0x8')](),controller[_0x87d0('0x13')]);module[_0x87d0('0x14')]=router; \ No newline at end of file +var _0x8b14=['getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id'];(function(_0x54e74d,_0x4283e4){var _0x2cf5db=function(_0xd86906){while(--_0xd86906){_0x54e74d['push'](_0x54e74d['shift']());}};_0x2cf5db(++_0x4283e4);}(_0x8b14,0x9a));var _0x48b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8b14[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x48b1('0x0'));var util=require(_0x48b1('0x1'));var path=require(_0x48b1('0x2'));var timeout=require(_0x48b1('0x3'));var express=require(_0x48b1('0x4'));var router=express[_0x48b1('0x5')]();var fs_extra=require(_0x48b1('0x6'));var auth=require(_0x48b1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x48b1('0x8'));var controller=require(_0x48b1('0x9'));router[_0x48b1('0xa')]('/',auth[_0x48b1('0xb')](),controller[_0x48b1('0xc')]);router[_0x48b1('0xa')](_0x48b1('0xd'),auth[_0x48b1('0xb')](),controller['show']);router[_0x48b1('0xa')]('/:id/configurations',auth[_0x48b1('0xb')](),controller[_0x48b1('0xe')]);router['get'](_0x48b1('0xf'),auth[_0x48b1('0xb')](),controller[_0x48b1('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x48b1('0x11')]);router['post'](_0x48b1('0x12'),auth[_0x48b1('0xb')](),controller[_0x48b1('0x13')]);router[_0x48b1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x48b1('0x15')]);router[_0x48b1('0x16')](_0x48b1('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x48b1('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a2b2f7f..9cfe38c 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 _0x4cac=['sequelize','STRING'];(function(_0x31bbcb,_0x49f2d5){var _0x55dac1=function(_0x1baefd){while(--_0x1baefd){_0x31bbcb['push'](_0x31bbcb['shift']());}};_0x55dac1(++_0x49f2d5);}(_0x4cac,0x120));var _0xc4ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4cac[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc4ca('0x0'));module['exports']={'name':{'type':Sequelize[_0xc4ca('0x1')]},'username':{'type':Sequelize[_0xc4ca('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc4ca('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc4ca('0x1')]},'clientSecret':{'type':Sequelize[_0xc4ca('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xc4ca('0x1')]}}; \ No newline at end of file +var _0x48ac=['exports','STRING'];(function(_0x5b2b52,_0x2887c3){var _0x1d432f=function(_0x284a99){while(--_0x284a99){_0x5b2b52['push'](_0x5b2b52['shift']());}};_0x1d432f(++_0x2887c3);}(_0x48ac,0xe0));var _0xc48a=function(_0x70be74,_0x1fcbd4){_0x70be74=_0x70be74-0x0;var _0x3b900b=_0x48ac[_0x70be74];return _0x3b900b;};'use strict';var Sequelize=require('sequelize');module[_0xc48a('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc48a('0x1')]},'password':{'type':Sequelize[_0xc48a('0x1')]},'remoteUri':{'type':Sequelize[_0xc48a('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc48a('0x1')]},'clientSecret':{'type':Sequelize[_0xc48a('0x1')]},'serverUrl':{'type':Sequelize[_0xc48a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc48a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index e96f67c..a46924f 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 _0xe062=['Options','Label',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','true','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','includeAll','include','findAll','rows','show','params','keys','intersection','options','find','catch','create','body','Dynamics365Configuration','order','merge','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','overriddencreatedon','owneridname','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','isNil','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet'];(function(_0x17cca1,_0x4cd1f6){var _0x2a1d4a=function(_0x33c8a1){while(--_0x33c8a1){_0x17cca1['push'](_0x17cca1['shift']());}};_0x2a1d4a(++_0x4cd1f6);}(_0xe062,0xd5));var _0x2e06=function(_0x1c9d09,_0x428f08){_0x1c9d09=_0x1c9d09-0x0;var _0x3de494=_0xe062[_0x1c9d09];return _0x3de494;};'use strict';var emlformat=require(_0x2e06('0x0'));var rimraf=require(_0x2e06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e06('0x2'));var rp=require(_0x2e06('0x3'));var moment=require(_0x2e06('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2e06('0x5'));var path=require(_0x2e06('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e06('0x7'));var fs=require('fs');var fs_extra=require(_0x2e06('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2e06('0x9'));var jsforce=require(_0x2e06('0xa'));var deskjs=require(_0x2e06('0xb'));var toCsv=require(_0x2e06('0xc'));var querystring=require(_0x2e06('0xd'));var Papa=require(_0x2e06('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2e06('0xf'));var as=require(_0x2e06('0x10'));var hardwareService=require(_0x2e06('0x11'));var logger=require('../../config/logger')(_0x2e06('0x12'));var utils=require(_0x2e06('0x13'));var config=require(_0x2e06('0x14'));var licenseUtil=require(_0x2e06('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2e06('0x16'));function respondWithStatusCode(_0x11520b,_0x542f63){_0x542f63=_0x542f63||0xcc;return function(_0xd781db){if(_0xd781db){return _0x11520b[_0x2e06('0x17')](_0x542f63);}return _0x11520b['status'](_0x542f63)[_0x2e06('0x18')]();};}function respondWithResult(_0x2a3a2a,_0x9a3ab4){_0x9a3ab4=_0x9a3ab4||0xc8;return function(_0x25909a){if(_0x25909a){return _0x2a3a2a[_0x2e06('0x19')](_0x9a3ab4)[_0x2e06('0x1a')](_0x25909a);}};}function respondWithFilteredResult(_0x5e4795,_0x3b307d){return function(_0x330e5e){if(_0x330e5e){var _0x210e11=typeof _0x3b307d[_0x2e06('0x1b')]===_0x2e06('0x1c')&&typeof _0x3b307d[_0x2e06('0x1d')]===_0x2e06('0x1c');var _0xb67ba8=_0x330e5e[_0x2e06('0x1e')];var _0x4fd048=_0x210e11?0x0:_0x3b307d[_0x2e06('0x1b')];var _0x45052c=_0x210e11?_0x330e5e['count']:_0x3b307d[_0x2e06('0x1b')]+_0x3b307d[_0x2e06('0x1d')];var _0x2c2320;if(_0x45052c>=_0xb67ba8){_0x45052c=_0xb67ba8;_0x2c2320=0xc8;}else{_0x2c2320=0xce;}_0x5e4795[_0x2e06('0x19')](_0x2c2320);return _0x5e4795[_0x2e06('0x1f')](_0x2e06('0x20'),_0x4fd048+'-'+_0x45052c+'/'+_0xb67ba8)[_0x2e06('0x1a')](_0x330e5e);}return null;};}function patchUpdates(_0x38ec0f){return function(_0xf95487){try{jsonpatch[_0x2e06('0x21')](_0xf95487,_0x38ec0f,!![]);}catch(_0x358cf6){return BPromise[_0x2e06('0x22')](_0x358cf6);}return _0xf95487[_0x2e06('0x23')]();};}function saveUpdates(_0x2a31d7,_0x27d028){return function(_0x38b5db){if(_0x38b5db){return _0x38b5db[_0x2e06('0x24')](_0x2a31d7)[_0x2e06('0x25')](function(_0x4963eb){return _0x4963eb;});}return null;};}function removeEntity(_0x21eea1,_0x1c1e6f){return function(_0x74e8e6){if(_0x74e8e6){return _0x74e8e6[_0x2e06('0x26')]()[_0x2e06('0x25')](function(){_0x21eea1[_0x2e06('0x19')](0xcc)[_0x2e06('0x18')]();});}};}function handleEntityNotFound(_0x1ed50e,_0x202338){return function(_0x4a0dbc){if(!_0x4a0dbc){_0x1ed50e[_0x2e06('0x17')](0x194);}return _0x4a0dbc;};}function handleError(_0x123daf,_0xdcb6f8){_0xdcb6f8=_0xdcb6f8||0x1f4;return function(_0x3d1011){logger[_0x2e06('0x27')](_0x3d1011['stack']);if(_0x3d1011[_0x2e06('0x28')]){delete _0x3d1011['name'];}_0x123daf[_0x2e06('0x19')](_0xdcb6f8)[_0x2e06('0x29')](_0x3d1011);};}exports['index']=function(_0x149901,_0x18f703){var _0x3ff289={},_0x5116f1={},_0x5a48f6={'count':0x0,'rows':[]};var _0x2cb75f=_[_0x2e06('0x2a')](db[_0x2e06('0x2b')][_0x2e06('0x2c')],function(_0x394619){return{'name':_0x394619[_0x2e06('0x2d')],'type':_0x394619[_0x2e06('0x2e')][_0x2e06('0x2f')]};});_0x5116f1[_0x2e06('0x30')]=_['map'](_0x2cb75f,'name');_0x5116f1['query']=_['keys'](_0x149901[_0x2e06('0x31')]);_0x5116f1[_0x2e06('0x32')]=_['intersection'](_0x5116f1[_0x2e06('0x30')],_0x5116f1[_0x2e06('0x31')]);_0x3ff289[_0x2e06('0x33')]=_['intersection'](_0x5116f1[_0x2e06('0x30')],qs[_0x2e06('0x34')](_0x149901['query'][_0x2e06('0x34')]));_0x3ff289[_0x2e06('0x33')]=_0x3ff289[_0x2e06('0x33')][_0x2e06('0x35')]?_0x3ff289['attributes']:_0x5116f1[_0x2e06('0x30')];if(!_0x149901[_0x2e06('0x31')][_0x2e06('0x36')](_0x2e06('0x37'))){_0x3ff289['limit']=qs[_0x2e06('0x1d')](_0x149901[_0x2e06('0x31')]['limit']);_0x3ff289['offset']=qs['offset'](_0x149901[_0x2e06('0x31')]['offset']);}_0x3ff289['order']=qs[_0x2e06('0x38')](_0x149901[_0x2e06('0x31')][_0x2e06('0x38')]);_0x3ff289['where']=qs[_0x2e06('0x32')](_['pick'](_0x149901[_0x2e06('0x31')],_0x5116f1['filters']),_0x2cb75f);if(_0x149901[_0x2e06('0x31')][_0x2e06('0x39')]){_0x3ff289['where']=_['merge'](_0x3ff289[_0x2e06('0x3a')],{'$or':_[_0x2e06('0x2a')](_0x2cb75f,function(_0x1eb25a){if(_0x1eb25a[_0x2e06('0x2e')]!=='VIRTUAL'){var _0x453bc={};_0x453bc[_0x1eb25a['name']]={'$like':'%'+_0x149901['query'][_0x2e06('0x39')]+'%'};return _0x453bc;}})});}_0x3ff289=_['merge']({},_0x3ff289,_0x149901['options']);var _0x253b32={'where':_0x3ff289[_0x2e06('0x3a')]};return db[_0x2e06('0x2b')][_0x2e06('0x1e')](_0x253b32)[_0x2e06('0x25')](function(_0x1d9895){_0x5a48f6[_0x2e06('0x1e')]=_0x1d9895;if(_0x149901[_0x2e06('0x31')][_0x2e06('0x3b')]){_0x3ff289[_0x2e06('0x3c')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x2e06('0x3d')](_0x3ff289);})[_0x2e06('0x25')](function(_0x403741){_0x5a48f6[_0x2e06('0x3e')]=_0x403741;return _0x5a48f6;})[_0x2e06('0x25')](respondWithFilteredResult(_0x18f703,_0x3ff289))['catch'](handleError(_0x18f703,null));};exports[_0x2e06('0x3f')]=function(_0x3ca31c,_0x4a4c20){var _0x4fbc3b={'raw':![],'where':{'id':_0x3ca31c[_0x2e06('0x40')]['id']}},_0x9206ab={};_0x9206ab[_0x2e06('0x30')]=_[_0x2e06('0x41')](db['Dynamics365Account'][_0x2e06('0x2c')]);_0x9206ab['query']=_[_0x2e06('0x41')](_0x3ca31c['query']);_0x9206ab[_0x2e06('0x32')]=_[_0x2e06('0x42')](_0x9206ab[_0x2e06('0x30')],_0x9206ab['query']);_0x4fbc3b[_0x2e06('0x33')]=_[_0x2e06('0x42')](_0x9206ab['model'],qs[_0x2e06('0x34')](_0x3ca31c[_0x2e06('0x31')][_0x2e06('0x34')]));_0x4fbc3b[_0x2e06('0x33')]=_0x4fbc3b[_0x2e06('0x33')]['length']?_0x4fbc3b[_0x2e06('0x33')]:_0x9206ab[_0x2e06('0x30')];if(_0x3ca31c[_0x2e06('0x31')]['includeAll']){_0x4fbc3b[_0x2e06('0x3c')]=[{'all':!![]}];}_0x4fbc3b=_['merge']({},_0x4fbc3b,_0x3ca31c[_0x2e06('0x43')]);return db['Dynamics365Account'][_0x2e06('0x44')](_0x4fbc3b)['then'](handleEntityNotFound(_0x4a4c20,null))[_0x2e06('0x25')](respondWithResult(_0x4a4c20,null))[_0x2e06('0x45')](handleError(_0x4a4c20,null));};exports['create']=function(_0x111509,_0x50a7a1){return db[_0x2e06('0x2b')][_0x2e06('0x46')](_0x111509[_0x2e06('0x47')],{})['then'](respondWithResult(_0x50a7a1,0xc9))[_0x2e06('0x45')](handleError(_0x50a7a1,null));};exports['update']=function(_0x1de5dd,_0x5975e5){if(_0x1de5dd[_0x2e06('0x47')]['id']){delete _0x1de5dd[_0x2e06('0x47')]['id'];}return db[_0x2e06('0x2b')][_0x2e06('0x44')]({'where':{'id':_0x1de5dd['params']['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0x5975e5,null))[_0x2e06('0x25')](saveUpdates(_0x1de5dd['body'],null))['then'](respondWithResult(_0x5975e5,null))[_0x2e06('0x45')](handleError(_0x5975e5,null));};exports['destroy']=function(_0x132a78,_0x11a5be){return db['Dynamics365Account'][_0x2e06('0x44')]({'where':{'id':_0x132a78[_0x2e06('0x40')]['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0x11a5be,null))[_0x2e06('0x25')](removeEntity(_0x11a5be,null))[_0x2e06('0x45')](handleError(_0x11a5be,null));};exports['getConfigurations']=function(_0x55fa1a,_0x222452,_0x139d97){var _0x25ceff={};var _0x2c55e5={};var _0x4dc278;var _0x1d8bb8;return db[_0x2e06('0x2b')]['findOne']({'where':{'id':_0x55fa1a[_0x2e06('0x40')]['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0x222452,null))['then'](function(_0x5ba6ec){if(_0x5ba6ec){_0x4dc278=_0x5ba6ec;_0x2c55e5[_0x2e06('0x30')]=_[_0x2e06('0x41')](db[_0x2e06('0x48')][_0x2e06('0x2c')]);_0x2c55e5[_0x2e06('0x31')]=_['keys'](_0x55fa1a['query']);_0x2c55e5['filters']=_[_0x2e06('0x42')](_0x2c55e5[_0x2e06('0x30')],_0x2c55e5[_0x2e06('0x31')]);_0x25ceff[_0x2e06('0x33')]=_['intersection'](_0x2c55e5['model'],qs['fields'](_0x55fa1a[_0x2e06('0x31')][_0x2e06('0x34')]));_0x25ceff['attributes']=_0x25ceff[_0x2e06('0x33')]['length']?_0x25ceff[_0x2e06('0x33')]:_0x2c55e5[_0x2e06('0x30')];_0x25ceff[_0x2e06('0x49')]=qs[_0x2e06('0x38')](_0x55fa1a[_0x2e06('0x31')][_0x2e06('0x38')]);_0x25ceff[_0x2e06('0x3a')]=qs[_0x2e06('0x32')](_['pick'](_0x55fa1a[_0x2e06('0x31')],_0x2c55e5[_0x2e06('0x32')]));if(_0x55fa1a['query'][_0x2e06('0x39')]){_0x25ceff['where']=_[_0x2e06('0x4a')](_0x25ceff[_0x2e06('0x3a')],{'$or':_[_0x2e06('0x2a')](_0x25ceff[_0x2e06('0x33')],function(_0x4385fd){var _0x4dbbd4={};_0x4dbbd4[_0x4385fd]={'$like':'%'+_0x55fa1a['query'][_0x2e06('0x39')]+'%'};return _0x4dbbd4;})});}_0x25ceff=_['merge']({},_0x25ceff,_0x55fa1a[_0x2e06('0x43')]);return _0x4dc278[_0x2e06('0x4b')](_0x25ceff);}})[_0x2e06('0x25')](function(_0x5ada47){if(_0x5ada47){_0x1d8bb8=_0x5ada47['length'];if(!_0x55fa1a['query']['hasOwnProperty'](_0x2e06('0x37'))){_0x25ceff[_0x2e06('0x1d')]=qs[_0x2e06('0x1d')](_0x55fa1a['query'][_0x2e06('0x1d')]);_0x25ceff['offset']=qs[_0x2e06('0x1b')](_0x55fa1a[_0x2e06('0x31')][_0x2e06('0x1b')]);}return _0x4dc278[_0x2e06('0x4b')](_0x25ceff);}})['then'](function(_0xe785ca){if(_0xe785ca){return _0xe785ca?{'count':_0x1d8bb8,'rows':_0xe785ca}:null;}})[_0x2e06('0x25')](respondWithResult(_0x222452,null))[_0x2e06('0x45')](handleError(_0x222452,null));};exports[_0x2e06('0x4c')]=function(_0x309a5f,_0x136876,_0x4e8366){if(_0x309a5f[_0x2e06('0x47')]['id']){delete _0x309a5f[_0x2e06('0x47')]['id'];}return db['Dynamics365Account'][_0x2e06('0x4d')]({'where':{'id':_0x309a5f[_0x2e06('0x40')]['id']}})['then'](handleEntityNotFound(_0x136876,null))[_0x2e06('0x25')](function(_0x2cac99){if(_0x2cac99){_0x309a5f[_0x2e06('0x47')][_0x2e06('0x4e')]=_0x2cac99['id'];_0x309a5f['body'][_0x2e06('0x4f')]=integrations['getSubjects'](_0x309a5f[_0x2e06('0x47')][_0x2e06('0x50')],_0x309a5f['body'][_0x2e06('0x2e')]);_0x309a5f[_0x2e06('0x47')][_0x2e06('0x51')]=integrations[_0x2e06('0x52')](_0x309a5f['body']['channel'],_0x309a5f[_0x2e06('0x47')]['type']);return db[_0x2e06('0x48')][_0x2e06('0x46')](_0x309a5f['body'],{'include':[{'model':db[_0x2e06('0x53')],'as':_0x2e06('0x4f')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x2e06('0x25')](respondWithResult(_0x136876,null))['catch'](handleError(_0x136876,null));};exports[_0x2e06('0x54')]=function(_0x11453d,_0x17e4bd,_0x1369e6){var _0xe5e2d8=_0x11453d[_0x2e06('0x31')][_0x2e06('0x55')];var _0x193205=_0xe5e2d8===_0x2e06('0x56')?_0x2e06('0x57'):_0x2e06('0x58');var _0x1d7e5c='';var _0x3bc2b1='';var _0x58acbc='';var _0x13c83c='';var _0x457354='';var _0x28304a='';var _0x1cfe10='';var _0x1ab6b0='';var _0x14c20f=['title','description','customerid','ownerid',_0x2e06('0x59'),_0x2e06('0x5a'),_0x2e06('0x5b'),_0x2e06('0x5c'),_0x2e06('0x5d'),_0x2e06('0x5e')];var _0x198a86=[_0x2e06('0x5f'),_0x2e06('0x60'),_0x2e06('0x61'),_0x2e06('0x62'),_0x2e06('0x63'),'contactidyominame',_0x2e06('0x64'),_0x2e06('0x65'),_0x2e06('0x66'),_0x2e06('0x67'),_0x2e06('0x68'),_0x2e06('0x69'),_0x2e06('0x6a'),_0x2e06('0x6b'),_0x2e06('0x6c'),_0x2e06('0x6d'),_0x2e06('0x6e'),_0x2e06('0x6f'),_0x2e06('0x70'),'entitlementidname',_0x2e06('0x71'),_0x2e06('0x72'),_0x2e06('0x73'),_0x2e06('0x74'),_0x2e06('0x75'),_0x2e06('0x76'),_0x2e06('0x77'),_0x2e06('0x78'),_0x2e06('0x79'),'lastonholdtime','masteridname','modifiedbyexternalpartyname',_0x2e06('0x7a'),_0x2e06('0x7b'),_0x2e06('0x7c'),_0x2e06('0x7d'),_0x2e06('0x7e'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x2e06('0x7f'),'numberofchildincidents','onholdtime',_0x2e06('0x80'),_0x2e06('0x81'),'owneridtype',_0x2e06('0x82'),'parentcaseidname',_0x2e06('0x83'),_0x2e06('0x84'),_0x2e06('0x85'),_0x2e06('0x86'),'productserialnumber',_0x2e06('0x87'),_0x2e06('0x88'),_0x2e06('0x89'),_0x2e06('0x8a'),'responsiblecontactidyominame',_0x2e06('0x8b'),'slainvokedidname','slaname',_0x2e06('0x8c'),'statecode','statuscode',_0x2e06('0x8d'),_0x2e06('0x8e'),_0x2e06('0x8f'),_0x2e06('0x90'),'traversedpath',_0x2e06('0x91'),_0x2e06('0x92')];var _0x346cda=_0x14c20f[_0x2e06('0x93')](_0x198a86);return db[_0x2e06('0x2b')][_0x2e06('0x4d')]({'where':{'id':_0x11453d[_0x2e06('0x40')]['id']},'attributes':['id',_0x2e06('0x94'),_0x2e06('0x95'),_0x2e06('0x96'),_0x2e06('0x97'),_0x2e06('0x98'),_0x2e06('0x99')]})[_0x2e06('0x25')](handleEntityNotFound(_0x17e4bd,null))[_0x2e06('0x25')](function(_0x2a7218){if(_0x2a7218){_0x1ab6b0=_0x2a7218[_0x2e06('0x96')];var _0x41d705=_0x1ab6b0[_0x2e06('0x9a')](-0x1);if(_0x41d705==='/'){_0x1ab6b0=_0x1ab6b0[_0x2e06('0x9b')](0x0,_0x1ab6b0[_0x2e06('0x9c')](_0x41d705));}_0x1cfe10=util[_0x2e06('0x9d')]('%s/api/data/v9.0/',_0x1ab6b0);var _0x1ec792={'method':_0x2e06('0x9e'),'uri':_0x2e06('0x9f')+_0x2a7218['tenantId']+_0x2e06('0xa0'),'form':{'client_id':_0x2a7218['clientId'],'resource':_0x1ab6b0,'username':_0x2a7218['username'],'password':_0x2a7218[_0x2e06('0x95')],'grant_type':_0x2e06('0x95'),'client_secret':_0x2a7218['clientSecret']},'json':!![]};return rp(_0x1ec792);}})[_0x2e06('0x25')](function(_0x3685d5){_0x28304a=_0x3685d5[_0x2e06('0xa1')];var _0xf211b={'method':'GET','uri':encodeURI(_0x1cfe10+_0x2e06('0xa2')+_0x193205+'\x27'),'headers':{'Authorization':_0x2e06('0xa3')+_0x28304a,'If-None-Match':null,'OData-Version':_0x2e06('0xa4')},'json':!![]};return rp(_0xf211b);})[_0x2e06('0x25')](function(_0x297dd8){var _0x4dc4aa=_0x297dd8[_0x2e06('0xa5')][0x0];var _0x28b892=_0x4dc4aa[_0x2e06('0xa6')];var _0x16c0f6={'method':_0x2e06('0xa7'),'uri':_0x1cfe10+_0x2e06('0xa8')+_0x28b892+_0x2e06('0xa9'),'headers':{'Authorization':_0x2e06('0xa3')+_0x28304a,'If-None-Match':null,'OData-Version':_0x2e06('0xa4')},'json':!![]};return rp(_0x16c0f6);})[_0x2e06('0x25')](function(_0x52c774){_0x1d7e5c=_0x52c774;_0x3bc2b1=_0x1d7e5c[_0x2e06('0xaa')];_0x3bc2b1=_[_0x2e06('0xab')](_0x3bc2b1,function(_0x17e6ff){return!_0x346cda[_0x2e06('0xac')](_0x17e6ff[_0x2e06('0xad')]);});var _0x4cd833=[];var _0x34094a=[];_0x3bc2b1[_0x2e06('0xae')](function(_0x50a366){if(_0x50a366[_0x2e06('0xaf')]){var _0x46fcb8=_0x50a366[_0x2e06('0xaf')]['substring'](_0x50a366[_0x2e06('0xaf')][_0x2e06('0x9c')]('.')+0x1);if(_0x46fcb8==='PicklistAttributeMetadata'){_0x4cd833[_0x2e06('0xb0')](getSelectList(_0x1cfe10,_0xe5e2d8,_0x34094a,_0x1d7e5c[_0x2e06('0xa6')],_0x50a366[_0x2e06('0xa6')],_0x28304a));}}});return Promise['all'](_0x4cd833);})[_0x2e06('0x25')](function(_0x15f0b5){_0x58acbc=_0x15f0b5[0x0];var _0xdeb315=[];var _0x2c74da=[];_0x3bc2b1['forEach'](function(_0xf02b8d){if(!_[_0x2e06('0xb1')](_0xf02b8d[_0x2e06('0xaf')])){var _0xeae7b6=_0xf02b8d[_0x2e06('0xaf')][_0x2e06('0x9b')](_0xf02b8d[_0x2e06('0xaf')][_0x2e06('0x9c')]('.')+0x1);if(_0xeae7b6===_0x2e06('0xb2')){_0xdeb315[_0x2e06('0xb0')](getBooleanList(_0x1cfe10,_0xe5e2d8,_0x2c74da,_0x1d7e5c[_0x2e06('0xa6')],_0xf02b8d[_0x2e06('0xa6')],_0x28304a));}}});return Promise[_0x2e06('0xb3')](_0xdeb315);})['then'](function(_0x2b513e){_0x13c83c=_0x2b513e[0x0];var _0x5ba3e0=[];var _0x4fc406=[];_0x3bc2b1[_0x2e06('0xae')](function(_0x32eeb3){if(_0x32eeb3[_0x2e06('0xaf')]){var _0x3dc893=_0x32eeb3[_0x2e06('0xaf')][_0x2e06('0x9b')](_0x32eeb3[_0x2e06('0xaf')][_0x2e06('0x9c')]('.')+0x1);if(_0x3dc893===_0x2e06('0xb4')||_0x3dc893===_0x2e06('0xb5')||_0x3dc893===_0x2e06('0xb6')||_0x3dc893==='IntegerAttributeMetadata'||_0x3dc893===_0x2e06('0xb7')||_0x3dc893===_0x2e06('0xb8')||_0x3dc893===_0x2e06('0xb9')||_0x3dc893===_0x2e06('0xba')||_0x3dc893==='StateAttributeMetadata'||_0x3dc893===_0x2e06('0xbb')){_0x5ba3e0[_0x2e06('0xb0')](getInputList(_0x1cfe10,_0xe5e2d8,_0x3dc893,_0x4fc406,_0x1d7e5c['MetadataId'],_0x32eeb3[_0x2e06('0xa6')],_0x28304a));}}});return Promise[_0x2e06('0xb3')](_0x5ba3e0);})['then'](function(_0x1f0571){_0x457354=_0x1f0571[0x0];var _0x3e5f2c=_0x58acbc[_0x2e06('0x93')](_0x13c83c)[_0x2e06('0x93')](_0x457354);var _0x2cd9e1={'count':_0x3e5f2c['length'],'rows':_0x3e5f2c};return _0x2cd9e1;})[_0x2e06('0x25')](respondWithResult(_0x17e4bd,null))[_0x2e06('0x45')](function(_0x90ce4){var _0xb7ba5=_0x11453d['query'][_0x2e06('0xbc')]?0x1f4:_0x90ce4[_0x2e06('0xbd')]||0x1f4;logger[_0x2e06('0x27')](_0x90ce4['stack']);delete _0x90ce4['name'];if(_0xb7ba5===0x191){_0xb7ba5=0x190;}_0x17e4bd[_0x2e06('0x19')](_0xb7ba5)[_0x2e06('0x29')](_0x11453d[_0x2e06('0x31')][_0x2e06('0xbc')]?{'message':'Wrong\x20credentials','statusCode':_0x90ce4[_0x2e06('0xbd')]}:_0x90ce4);});};function getSelectList(_0x78815,_0x11bb7a,_0x5ced86,_0x4a570b,_0x34f02d,_0x307660){var _0x2d03c4={'method':'GET','uri':_0x78815+_0x2e06('0xa8')+_0x4a570b+')/Attributes('+_0x34f02d+_0x2e06('0xbe')+_0x2e06('0xbf'),'headers':{'Authorization':_0x2e06('0xa3')+_0x307660,'If-None-Match':null,'OData-Version':_0x2e06('0xa4')},'json':!![]};return rp(_0x2d03c4)[_0x2e06('0x25')](function(_0x49553d){var _0x5b9e4f=[];var _0x2b1f75=_0x49553d[_0x2e06('0xc0')][_0x2e06('0xc1')];_0x2b1f75[_0x2e06('0xae')](function(_0x386d84){_0x5b9e4f[_0x2e06('0xb0')]({'name':_0x386d84[_0x2e06('0xc2')]['UserLocalizedLabel'][_0x2e06('0xc2')],'value':String(_0x386d84['Value'])});});var _0x492a36={'id':_0x11bb7a+'_'+_0x49553d[_0x2e06('0xad')],'name':_0x49553d['DisplayName']['UserLocalizedLabel'][_0x2e06('0xc2')],'custom':![],'options':_0x5b9e4f};_0x5ced86[_0x2e06('0xb0')](_0x492a36);return _0x5ced86;});}function getBooleanList(_0x331c6,_0x1039b1,_0x48f6be,_0x4f9944,_0x69cd94,_0xf2d164){var _0x13bfb1={'method':_0x2e06('0xa7'),'uri':_0x331c6+'EntityDefinitions('+_0x4f9944+_0x2e06('0xc3')+_0x69cd94+_0x2e06('0xc4'),'headers':{'Authorization':_0x2e06('0xa3')+_0xf2d164,'If-None-Match':null,'OData-Version':_0x2e06('0xa4')},'json':!![]};return rp(_0x13bfb1)['then'](function(_0x3fd245){var _0x44b9e4=[];_0x44b9e4[_0x2e06('0xb0')]({'name':_0x3fd245[_0x2e06('0xc0')][_0x2e06('0xc5')][_0x2e06('0xc2')][_0x2e06('0xc6')][_0x2e06('0xc2')],'value':_0x2e06('0xc7')},{'name':_0x3fd245['OptionSet']['FalseOption'][_0x2e06('0xc2')][_0x2e06('0xc6')]['Label'],'value':'false'});var _0x109172={'id':_0x1039b1+'_'+_0x3fd245['LogicalName'],'name':_0x3fd245[_0x2e06('0xc8')][_0x2e06('0xc6')][_0x2e06('0xc2')],'custom':![],'options':_0x44b9e4};_0x48f6be[_0x2e06('0xb0')](_0x109172);return _0x48f6be;});}function getInputList(_0x39cbce,_0x202e1d,_0x3593bf,_0x389d7a,_0x4abaa9,_0x4035c3,_0x3c0bcd){var _0x4f44b9={'method':_0x2e06('0xa7'),'uri':_0x39cbce+_0x2e06('0xa8')+_0x4abaa9+')/Attributes('+_0x4035c3+_0x2e06('0xc9')+_0x3593bf+_0x2e06('0xca'),'headers':{'Authorization':_0x2e06('0xa3')+_0x3c0bcd,'If-None-Match':null,'OData-Version':_0x2e06('0xa4')},'json':!![]};return rp(_0x4f44b9)[_0x2e06('0x25')](function(_0x59215a){var _0x4ec97b={'id':_0x202e1d+'_'+_0x59215a[_0x2e06('0xad')],'name':_0x59215a['DisplayName']['UserLocalizedLabel']?_0x59215a['DisplayName'][_0x2e06('0xc6')][_0x2e06('0xc2')]:_0x59215a[_0x2e06('0xad')],'custom':![],'options':[]};_0x389d7a[_0x2e06('0xb0')](_0x4ec97b);return _0x389d7a;});} \ No newline at end of file +var _0x6611=['Wrong\x20credentials','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','name','send','index','map','Dynamics365Account','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','includeAll','include','rows','catch','rawAttributes','options','find','create','body','params','destroy','getConfigurations','findOne','Dynamics365Configuration','sort','merge','addConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','Dynamics365Field','ticketType','incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','phonecall_activity_parties','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolvebykpiidname','responseby','sentimentvalue','slaname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','GET','Bearer\x20','value','MetadataId','EntityDefinitions(','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','isNil','BooleanAttributeMetadata','push','all','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack'];(function(_0x27830a,_0x4e8504){var _0x32ccc3=function(_0x1e17f3){while(--_0x1e17f3){_0x27830a['push'](_0x27830a['shift']());}};_0x32ccc3(++_0x4e8504);}(_0x6611,0xdd));var _0x1661=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6611[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1661('0x0'));var zipdir=require(_0x1661('0x1'));var jsonpatch=require(_0x1661('0x2'));var rp=require(_0x1661('0x3'));var moment=require(_0x1661('0x4'));var BPromise=require(_0x1661('0x5'));var Mustache=require(_0x1661('0x6'));var util=require(_0x1661('0x7'));var path=require(_0x1661('0x8'));var sox=require(_0x1661('0x9'));var csv=require(_0x1661('0xa'));var ejs=require(_0x1661('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1661('0xc'));var crypto=require(_0x1661('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1661('0xa'));var querystring=require(_0x1661('0xe'));var Papa=require(_0x1661('0xf'));var Redis=require(_0x1661('0x10'));var authService=require(_0x1661('0x11'));var qs=require(_0x1661('0x12'));var as=require(_0x1661('0x13'));var hardwareService=require(_0x1661('0x14'));var logger=require('../../config/logger')(_0x1661('0x15'));var utils=require(_0x1661('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1661('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1661('0x18'));function respondWithStatusCode(_0x394706,_0x36086e){_0x36086e=_0x36086e||0xcc;return function(_0x382848){if(_0x382848){return _0x394706[_0x1661('0x19')](_0x36086e);}return _0x394706[_0x1661('0x1a')](_0x36086e)[_0x1661('0x1b')]();};}function respondWithResult(_0x19b259,_0x2febb5){_0x2febb5=_0x2febb5||0xc8;return function(_0x18d32b){if(_0x18d32b){return _0x19b259[_0x1661('0x1a')](_0x2febb5)[_0x1661('0x1c')](_0x18d32b);}};}function respondWithFilteredResult(_0x1c38d6,_0x535eb1){return function(_0x5c3935){if(_0x5c3935){var _0x30ada9=typeof _0x535eb1[_0x1661('0x1d')]==='undefined'&&typeof _0x535eb1[_0x1661('0x1e')]===_0x1661('0x1f');var _0x39489d=_0x5c3935[_0x1661('0x20')];var _0x4edbfc=_0x30ada9?0x0:_0x535eb1[_0x1661('0x1d')];var _0x55fd5d=_0x30ada9?_0x5c3935[_0x1661('0x20')]:_0x535eb1['offset']+_0x535eb1[_0x1661('0x1e')];var _0x2938c9;if(_0x55fd5d>=_0x39489d){_0x55fd5d=_0x39489d;_0x2938c9=0xc8;}else{_0x2938c9=0xce;}_0x1c38d6['status'](_0x2938c9);return _0x1c38d6[_0x1661('0x21')]('Content-Range',_0x4edbfc+'-'+_0x55fd5d+'/'+_0x39489d)[_0x1661('0x1c')](_0x5c3935);}return null;};}function patchUpdates(_0x33f760){return function(_0x23d06f){try{jsonpatch[_0x1661('0x22')](_0x23d06f,_0x33f760,!![]);}catch(_0x1f1a08){return BPromise[_0x1661('0x23')](_0x1f1a08);}return _0x23d06f[_0x1661('0x24')]();};}function saveUpdates(_0x4c625a,_0x5917c4){return function(_0x41244d){if(_0x41244d){return _0x41244d[_0x1661('0x25')](_0x4c625a)[_0x1661('0x26')](function(_0x2cb559){return _0x2cb559;});}return null;};}function removeEntity(_0x38c00c,_0x5c3d41){return function(_0x9c92af){if(_0x9c92af){return _0x9c92af['destroy']()[_0x1661('0x26')](function(){_0x38c00c[_0x1661('0x1a')](0xcc)[_0x1661('0x1b')]();});}};}function handleEntityNotFound(_0x1240f6,_0x48b807){return function(_0x211533){if(!_0x211533){_0x1240f6[_0x1661('0x19')](0x194);}return _0x211533;};}function handleError(_0x33af77,_0x53e919){_0x53e919=_0x53e919||0x1f4;return function(_0x13153c){logger[_0x1661('0x27')](_0x13153c['stack']);if(_0x13153c[_0x1661('0x28')]){delete _0x13153c['name'];}_0x33af77[_0x1661('0x1a')](_0x53e919)[_0x1661('0x29')](_0x13153c);};}exports[_0x1661('0x2a')]=function(_0x1e0e07,_0x35a5b3){var _0x3eb848={},_0x42886a={},_0x16a9c8={'count':0x0,'rows':[]};var _0x515480=_[_0x1661('0x2b')](db[_0x1661('0x2c')]['rawAttributes'],function(_0x4ee574){return{'name':_0x4ee574[_0x1661('0x2d')],'type':_0x4ee574['type'][_0x1661('0x2e')]};});_0x42886a[_0x1661('0x2f')]=_['map'](_0x515480,_0x1661('0x28'));_0x42886a[_0x1661('0x30')]=_[_0x1661('0x31')](_0x1e0e07[_0x1661('0x30')]);_0x42886a[_0x1661('0x32')]=_[_0x1661('0x33')](_0x42886a['model'],_0x42886a[_0x1661('0x30')]);_0x3eb848[_0x1661('0x34')]=_['intersection'](_0x42886a[_0x1661('0x2f')],qs[_0x1661('0x35')](_0x1e0e07['query'][_0x1661('0x35')]));_0x3eb848['attributes']=_0x3eb848[_0x1661('0x34')][_0x1661('0x36')]?_0x3eb848[_0x1661('0x34')]:_0x42886a[_0x1661('0x2f')];if(!_0x1e0e07[_0x1661('0x30')][_0x1661('0x37')](_0x1661('0x38'))){_0x3eb848['limit']=qs[_0x1661('0x1e')](_0x1e0e07[_0x1661('0x30')][_0x1661('0x1e')]);_0x3eb848[_0x1661('0x1d')]=qs['offset'](_0x1e0e07[_0x1661('0x30')][_0x1661('0x1d')]);}_0x3eb848[_0x1661('0x39')]=qs['sort'](_0x1e0e07[_0x1661('0x30')]['sort']);_0x3eb848['where']=qs['filters'](_[_0x1661('0x3a')](_0x1e0e07[_0x1661('0x30')],_0x42886a[_0x1661('0x32')]),_0x515480);if(_0x1e0e07[_0x1661('0x30')][_0x1661('0x3b')]){_0x3eb848[_0x1661('0x3c')]=_['merge'](_0x3eb848[_0x1661('0x3c')],{'$or':_[_0x1661('0x2b')](_0x515480,function(_0x21f793){if(_0x21f793['type']!==_0x1661('0x3d')){var _0x958ae={};_0x958ae[_0x21f793[_0x1661('0x28')]]={'$like':'%'+_0x1e0e07[_0x1661('0x30')][_0x1661('0x3b')]+'%'};return _0x958ae;}})});}_0x3eb848=_['merge']({},_0x3eb848,_0x1e0e07['options']);var _0x58025d={'where':_0x3eb848[_0x1661('0x3c')]};return db[_0x1661('0x2c')][_0x1661('0x20')](_0x58025d)[_0x1661('0x26')](function(_0x3f15a5){_0x16a9c8[_0x1661('0x20')]=_0x3f15a5;if(_0x1e0e07[_0x1661('0x30')][_0x1661('0x3e')]){_0x3eb848[_0x1661('0x3f')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x3eb848);})[_0x1661('0x26')](function(_0x48694b){_0x16a9c8[_0x1661('0x40')]=_0x48694b;return _0x16a9c8;})[_0x1661('0x26')](respondWithFilteredResult(_0x35a5b3,_0x3eb848))[_0x1661('0x41')](handleError(_0x35a5b3,null));};exports['show']=function(_0x1bf869,_0x1b085c){var _0x3703dd={'raw':![],'where':{'id':_0x1bf869['params']['id']}},_0x8b7f45={};_0x8b7f45['model']=_[_0x1661('0x31')](db[_0x1661('0x2c')][_0x1661('0x42')]);_0x8b7f45['query']=_[_0x1661('0x31')](_0x1bf869[_0x1661('0x30')]);_0x8b7f45[_0x1661('0x32')]=_[_0x1661('0x33')](_0x8b7f45[_0x1661('0x2f')],_0x8b7f45[_0x1661('0x30')]);_0x3703dd['attributes']=_[_0x1661('0x33')](_0x8b7f45[_0x1661('0x2f')],qs[_0x1661('0x35')](_0x1bf869[_0x1661('0x30')][_0x1661('0x35')]));_0x3703dd[_0x1661('0x34')]=_0x3703dd[_0x1661('0x34')][_0x1661('0x36')]?_0x3703dd['attributes']:_0x8b7f45[_0x1661('0x2f')];if(_0x1bf869[_0x1661('0x30')][_0x1661('0x3e')]){_0x3703dd[_0x1661('0x3f')]=[{'all':!![]}];}_0x3703dd=_['merge']({},_0x3703dd,_0x1bf869[_0x1661('0x43')]);return db[_0x1661('0x2c')][_0x1661('0x44')](_0x3703dd)[_0x1661('0x26')](handleEntityNotFound(_0x1b085c,null))[_0x1661('0x26')](respondWithResult(_0x1b085c,null))[_0x1661('0x41')](handleError(_0x1b085c,null));};exports[_0x1661('0x45')]=function(_0x5d5456,_0x33c237){return db['Dynamics365Account']['create'](_0x5d5456['body'],{})[_0x1661('0x26')](respondWithResult(_0x33c237,0xc9))[_0x1661('0x41')](handleError(_0x33c237,null));};exports[_0x1661('0x25')]=function(_0x22f25d,_0x4b0f41){if(_0x22f25d[_0x1661('0x46')]['id']){delete _0x22f25d[_0x1661('0x46')]['id'];}return db[_0x1661('0x2c')][_0x1661('0x44')]({'where':{'id':_0x22f25d[_0x1661('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b0f41,null))[_0x1661('0x26')](saveUpdates(_0x22f25d[_0x1661('0x46')],null))[_0x1661('0x26')](respondWithResult(_0x4b0f41,null))[_0x1661('0x41')](handleError(_0x4b0f41,null));};exports[_0x1661('0x48')]=function(_0x5f11b1,_0x4bb128){return db[_0x1661('0x2c')][_0x1661('0x44')]({'where':{'id':_0x5f11b1[_0x1661('0x47')]['id']}})[_0x1661('0x26')](handleEntityNotFound(_0x4bb128,null))[_0x1661('0x26')](removeEntity(_0x4bb128,null))[_0x1661('0x41')](handleError(_0x4bb128,null));};exports[_0x1661('0x49')]=function(_0x2fc545,_0x571f34,_0x3bc03c){var _0x4ce4da={};var _0x374f05={};var _0x2e0dc6;var _0xf08345;return db[_0x1661('0x2c')][_0x1661('0x4a')]({'where':{'id':_0x2fc545[_0x1661('0x47')]['id']}})[_0x1661('0x26')](handleEntityNotFound(_0x571f34,null))[_0x1661('0x26')](function(_0x176021){if(_0x176021){_0x2e0dc6=_0x176021;_0x374f05[_0x1661('0x2f')]=_[_0x1661('0x31')](db[_0x1661('0x4b')][_0x1661('0x42')]);_0x374f05[_0x1661('0x30')]=_[_0x1661('0x31')](_0x2fc545['query']);_0x374f05['filters']=_[_0x1661('0x33')](_0x374f05[_0x1661('0x2f')],_0x374f05[_0x1661('0x30')]);_0x4ce4da[_0x1661('0x34')]=_['intersection'](_0x374f05['model'],qs[_0x1661('0x35')](_0x2fc545[_0x1661('0x30')][_0x1661('0x35')]));_0x4ce4da[_0x1661('0x34')]=_0x4ce4da[_0x1661('0x34')][_0x1661('0x36')]?_0x4ce4da[_0x1661('0x34')]:_0x374f05[_0x1661('0x2f')];_0x4ce4da[_0x1661('0x39')]=qs[_0x1661('0x4c')](_0x2fc545[_0x1661('0x30')]['sort']);_0x4ce4da[_0x1661('0x3c')]=qs[_0x1661('0x32')](_[_0x1661('0x3a')](_0x2fc545[_0x1661('0x30')],_0x374f05[_0x1661('0x32')]));if(_0x2fc545[_0x1661('0x30')][_0x1661('0x3b')]){_0x4ce4da[_0x1661('0x3c')]=_[_0x1661('0x4d')](_0x4ce4da[_0x1661('0x3c')],{'$or':_[_0x1661('0x2b')](_0x4ce4da[_0x1661('0x34')],function(_0x42e268){var _0x1ee71d={};_0x1ee71d[_0x42e268]={'$like':'%'+_0x2fc545[_0x1661('0x30')][_0x1661('0x3b')]+'%'};return _0x1ee71d;})});}_0x4ce4da=_[_0x1661('0x4d')]({},_0x4ce4da,_0x2fc545[_0x1661('0x43')]);return _0x2e0dc6['getConfigurations'](_0x4ce4da);}})[_0x1661('0x26')](function(_0x586739){if(_0x586739){_0xf08345=_0x586739[_0x1661('0x36')];if(!_0x2fc545[_0x1661('0x30')]['hasOwnProperty']('nolimit')){_0x4ce4da['limit']=qs['limit'](_0x2fc545[_0x1661('0x30')][_0x1661('0x1e')]);_0x4ce4da[_0x1661('0x1d')]=qs['offset'](_0x2fc545[_0x1661('0x30')][_0x1661('0x1d')]);}return _0x2e0dc6[_0x1661('0x49')](_0x4ce4da);}})['then'](function(_0x532278){if(_0x532278){return _0x532278?{'count':_0xf08345,'rows':_0x532278}:null;}})[_0x1661('0x26')](respondWithResult(_0x571f34,null))[_0x1661('0x41')](handleError(_0x571f34,null));};exports[_0x1661('0x4e')]=function(_0x451ac9,_0x44326f,_0x2f67e3){if(_0x451ac9[_0x1661('0x46')]['id']){delete _0x451ac9[_0x1661('0x46')]['id'];}return db[_0x1661('0x2c')]['findOne']({'where':{'id':_0x451ac9[_0x1661('0x47')]['id']}})['then'](handleEntityNotFound(_0x44326f,null))[_0x1661('0x26')](function(_0x2455b3){if(_0x2455b3){_0x451ac9['body'][_0x1661('0x4f')]=_0x2455b3['id'];_0x451ac9[_0x1661('0x46')][_0x1661('0x50')]=integrations['getSubjects'](_0x451ac9[_0x1661('0x46')][_0x1661('0x51')],_0x451ac9[_0x1661('0x46')][_0x1661('0x52')]);_0x451ac9[_0x1661('0x46')][_0x1661('0x53')]=integrations[_0x1661('0x54')](_0x451ac9[_0x1661('0x46')][_0x1661('0x51')],_0x451ac9[_0x1661('0x46')][_0x1661('0x52')]);return db[_0x1661('0x4b')][_0x1661('0x45')](_0x451ac9[_0x1661('0x46')],{'include':[{'model':db[_0x1661('0x55')],'as':_0x1661('0x50')},{'model':db[_0x1661('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x44326f,null))[_0x1661('0x41')](handleError(_0x44326f,null));};exports['getFields']=function(_0x487991,_0x823c21,_0x5c545e){var _0x4067f9=_0x487991['query'][_0x1661('0x56')];var _0x26ab73=_0x4067f9===_0x1661('0x57')?'Incident':_0x1661('0x58');var _0x133ade='';var _0x47c7bb='';var _0x23bd22='';var _0x534c5b='';var _0x3462a5='';var _0x393bcf='';var _0x6ac0eb='';var _0x2f3bfa='';var _0x49ff1=[_0x1661('0x59'),_0x1661('0x5a'),_0x1661('0x5b'),_0x1661('0x5c'),_0x1661('0x5d'),'subject',_0x1661('0x5e'),_0x1661('0x5f'),'directioncode',_0x1661('0x60')];var _0x5b9b41=['accountidname','accountidyominame',_0x1661('0x61'),_0x1661('0x62'),_0x1661('0x63'),_0x1661('0x64'),_0x1661('0x65'),_0x1661('0x66'),_0x1661('0x67'),'createdbyexternalpartyyominame',_0x1661('0x68'),_0x1661('0x69'),_0x1661('0x6a'),_0x1661('0x6b'),_0x1661('0x6c'),_0x1661('0x6d'),_0x1661('0x6e'),'customeridyominame',_0x1661('0x6f'),'entitlementidname',_0x1661('0x70'),'entityimage_url',_0x1661('0x71'),_0x1661('0x72'),_0x1661('0x73'),_0x1661('0x74'),_0x1661('0x75'),_0x1661('0x76'),_0x1661('0x77'),'lastonholdtime',_0x1661('0x78'),'modifiedbyexternalpartyname',_0x1661('0x79'),_0x1661('0x7a'),_0x1661('0x7b'),_0x1661('0x7c'),'modifiedonbehalfbyname',_0x1661('0x7d'),_0x1661('0x7e'),'msdyn_iotalertname',_0x1661('0x7f'),_0x1661('0x80'),_0x1661('0x81'),_0x1661('0x82'),'owneridtype',_0x1661('0x83'),_0x1661('0x84'),_0x1661('0x85'),_0x1661('0x86'),'prioritycodename',_0x1661('0x87'),_0x1661('0x88'),'resolveby',_0x1661('0x89'),_0x1661('0x8a'),'responsiblecontactidname','responsiblecontactidyominame',_0x1661('0x8b'),'slainvokedidname',_0x1661('0x8c'),_0x1661('0x8d'),'statecode','statuscode',_0x1661('0x8e'),_0x1661('0x8f'),_0x1661('0x90'),_0x1661('0x91'),_0x1661('0x92'),_0x1661('0x93'),_0x1661('0x94')];var _0x1df90e=_0x49ff1[_0x1661('0x95')](_0x5b9b41);return db['Dynamics365Account'][_0x1661('0x4a')]({'where':{'id':_0x487991[_0x1661('0x47')]['id']},'attributes':['id',_0x1661('0x96'),_0x1661('0x97'),_0x1661('0x98'),'tenantId',_0x1661('0x99'),_0x1661('0x9a')]})[_0x1661('0x26')](handleEntityNotFound(_0x823c21,null))[_0x1661('0x26')](function(_0x212d98){if(_0x212d98){_0x2f3bfa=_0x212d98[_0x1661('0x98')];var _0x521075=_0x2f3bfa[_0x1661('0x9b')](-0x1);if(_0x521075==='/'){_0x2f3bfa=_0x2f3bfa[_0x1661('0x9c')](0x0,_0x2f3bfa[_0x1661('0x9d')](_0x521075));}_0x6ac0eb=util['format']('%s/api/data/v9.0/',_0x2f3bfa);var _0x257b94={'method':'POST','uri':_0x1661('0x9e')+_0x212d98[_0x1661('0x9f')]+_0x1661('0xa0'),'form':{'client_id':_0x212d98[_0x1661('0x99')],'resource':_0x2f3bfa,'username':_0x212d98[_0x1661('0x96')],'password':_0x212d98[_0x1661('0x97')],'grant_type':_0x1661('0x97'),'client_secret':_0x212d98[_0x1661('0x9a')]},'json':!![]};return rp(_0x257b94);}})[_0x1661('0x26')](function(_0x368264){_0x393bcf=_0x368264[_0x1661('0xa1')];var _0x436403={'method':_0x1661('0xa2'),'uri':encodeURI(_0x6ac0eb+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x26ab73+'\x27'),'headers':{'Authorization':_0x1661('0xa3')+_0x393bcf,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x436403);})[_0x1661('0x26')](function(_0x20c216){var _0x29a97c=_0x20c216[_0x1661('0xa4')][0x0];var _0x5e7592=_0x29a97c[_0x1661('0xa5')];var _0x3a5157={'method':_0x1661('0xa2'),'uri':_0x6ac0eb+_0x1661('0xa6')+_0x5e7592+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x1661('0xa3')+_0x393bcf,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3a5157);})['then'](function(_0x10542c){_0x133ade=_0x10542c;_0x47c7bb=_0x133ade['Attributes'];_0x47c7bb=_[_0x1661('0xa7')](_0x47c7bb,function(_0x1c6ff1){return!_0x1df90e[_0x1661('0xa8')](_0x1c6ff1[_0x1661('0xa9')]);});var _0x31c370=[];var _0x13b33b=[];_0x47c7bb[_0x1661('0xaa')](function(_0x1cdce3){if(_0x1cdce3[_0x1661('0xab')]){var _0x27b8a7=_0x1cdce3['@odata.type']['substring'](_0x1cdce3[_0x1661('0xab')][_0x1661('0x9d')]('.')+0x1);if(_0x27b8a7===_0x1661('0xac')){_0x31c370['push'](getSelectList(_0x6ac0eb,_0x4067f9,_0x13b33b,_0x133ade['MetadataId'],_0x1cdce3['MetadataId'],_0x393bcf));}}});return Promise['all'](_0x31c370);})['then'](function(_0x198111){_0x23bd22=_0x198111[0x0];var _0x23e798=[];var _0x2919db=[];_0x47c7bb[_0x1661('0xaa')](function(_0x2659b4){if(!_[_0x1661('0xad')](_0x2659b4['@odata.type'])){var _0x3eab78=_0x2659b4[_0x1661('0xab')][_0x1661('0x9c')](_0x2659b4[_0x1661('0xab')][_0x1661('0x9d')]('.')+0x1);if(_0x3eab78===_0x1661('0xae')){_0x23e798[_0x1661('0xaf')](getBooleanList(_0x6ac0eb,_0x4067f9,_0x2919db,_0x133ade[_0x1661('0xa5')],_0x2659b4[_0x1661('0xa5')],_0x393bcf));}}});return Promise[_0x1661('0xb0')](_0x23e798);})['then'](function(_0x379479){_0x534c5b=_0x379479[0x0];var _0x473186=[];var _0x56570d=[];_0x47c7bb[_0x1661('0xaa')](function(_0x1e9fcc){if(_0x1e9fcc['@odata.type']){var _0x193457=_0x1e9fcc[_0x1661('0xab')][_0x1661('0x9c')](_0x1e9fcc['@odata.type']['lastIndexOf']('.')+0x1);if(_0x193457===_0x1661('0xb1')||_0x193457===_0x1661('0xb2')||_0x193457==='BigIntAttributeMetadata'||_0x193457===_0x1661('0xb3')||_0x193457===_0x1661('0xb4')||_0x193457===_0x1661('0xb5')||_0x193457===_0x1661('0xb6')||_0x193457===_0x1661('0xb7')||_0x193457===_0x1661('0xb8')||_0x193457===_0x1661('0xb9')){_0x473186['push'](getInputList(_0x6ac0eb,_0x4067f9,_0x193457,_0x56570d,_0x133ade[_0x1661('0xa5')],_0x1e9fcc[_0x1661('0xa5')],_0x393bcf));}}});return Promise[_0x1661('0xb0')](_0x473186);})[_0x1661('0x26')](function(_0x1d0751){_0x3462a5=_0x1d0751[0x0];var _0x1dc941=_0x23bd22[_0x1661('0x95')](_0x534c5b)[_0x1661('0x95')](_0x3462a5);var _0x3caf63={'count':_0x1dc941[_0x1661('0x36')],'rows':_0x1dc941};return _0x3caf63;})[_0x1661('0x26')](respondWithResult(_0x823c21,null))[_0x1661('0x41')](function(_0xb78b0c){var _0x43048a=_0x487991['query'][_0x1661('0xba')]?0x1f4:_0xb78b0c[_0x1661('0xbb')]||0x1f4;logger['error'](_0xb78b0c[_0x1661('0xbc')]);delete _0xb78b0c[_0x1661('0x28')];if(_0x43048a===0x191){_0x43048a=0x190;}_0x823c21[_0x1661('0x1a')](_0x43048a)['send'](_0x487991['query'][_0x1661('0xba')]?{'message':_0x1661('0xbd'),'statusCode':_0xb78b0c['statusCode']}:_0xb78b0c);});};function getSelectList(_0x4f5016,_0x25a742,_0x335d24,_0x255d4f,_0x26044e,_0x2703b3){var _0x1e3736={'method':_0x1661('0xa2'),'uri':_0x4f5016+_0x1661('0xa6')+_0x255d4f+')/Attributes('+_0x26044e+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x1661('0xbe'),'headers':{'Authorization':_0x1661('0xa3')+_0x2703b3,'If-None-Match':null,'OData-Version':_0x1661('0xbf')},'json':!![]};return rp(_0x1e3736)['then'](function(_0x3fb076){var _0x3c8ab2=[];var _0x39b0cf=_0x3fb076[_0x1661('0xc0')][_0x1661('0xc1')];_0x39b0cf['forEach'](function(_0xba6ce3){_0x3c8ab2[_0x1661('0xaf')]({'name':_0xba6ce3[_0x1661('0xc2')][_0x1661('0xc3')][_0x1661('0xc2')],'value':String(_0xba6ce3[_0x1661('0xc4')])});});var _0x427b6f={'id':_0x25a742+'_'+_0x3fb076[_0x1661('0xa9')],'name':_0x3fb076[_0x1661('0xc5')]['UserLocalizedLabel'][_0x1661('0xc2')],'custom':![],'options':_0x3c8ab2};_0x335d24[_0x1661('0xaf')](_0x427b6f);return _0x335d24;});}function getBooleanList(_0x24f2c4,_0x14d8ba,_0x3a59c0,_0x56818d,_0x2b0573,_0x3ba121){var _0x583014={'method':'GET','uri':_0x24f2c4+'EntityDefinitions('+_0x56818d+_0x1661('0xc6')+_0x2b0573+_0x1661('0xc7'),'headers':{'Authorization':_0x1661('0xa3')+_0x3ba121,'If-None-Match':null,'OData-Version':_0x1661('0xbf')},'json':!![]};return rp(_0x583014)[_0x1661('0x26')](function(_0x257872){var _0x2c0451=[];_0x2c0451[_0x1661('0xaf')]({'name':_0x257872[_0x1661('0xc0')][_0x1661('0xc8')]['Label'][_0x1661('0xc3')][_0x1661('0xc2')],'value':'true'},{'name':_0x257872['OptionSet'][_0x1661('0xc9')]['Label'][_0x1661('0xc3')]['Label'],'value':_0x1661('0xca')});var _0x118871={'id':_0x14d8ba+'_'+_0x257872[_0x1661('0xa9')],'name':_0x257872[_0x1661('0xc5')][_0x1661('0xc3')]['Label'],'custom':![],'options':_0x2c0451};_0x3a59c0[_0x1661('0xaf')](_0x118871);return _0x3a59c0;});}function getInputList(_0x382c02,_0x5888a5,_0xf16e5b,_0x5c998c,_0x3b44d8,_0x1dbb45,_0x4372f6){var _0x313afe={'method':'GET','uri':_0x382c02+_0x1661('0xa6')+_0x3b44d8+_0x1661('0xc6')+_0x1dbb45+_0x1661('0xcb')+_0xf16e5b+_0x1661('0xcc'),'headers':{'Authorization':_0x1661('0xa3')+_0x4372f6,'If-None-Match':null,'OData-Version':_0x1661('0xbf')},'json':!![]};return rp(_0x313afe)['then'](function(_0x41a8c9){var _0x244345={'id':_0x5888a5+'_'+_0x41a8c9[_0x1661('0xa9')],'name':_0x41a8c9[_0x1661('0xc5')][_0x1661('0xc3')]?_0x41a8c9[_0x1661('0xc5')][_0x1661('0xc3')]['Label']:_0x41a8c9['LogicalName'],'custom':![],'options':[]};_0x5c998c['push'](_0x244345);return _0x5c998c;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 9f3240b..cdbcd59 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 _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x40901c,_0x14050f){var _0x1376f5=function(_0x4dda9a){while(--_0x4dda9a){_0x40901c['push'](_0x40901c['shift']());}};_0x1376f5(++_0x14050f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xb7e7[_0x47a349];return _0x18ab75;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x2551e9,_0x9018bc){var _0x386bab=function(_0x190ceb){while(--_0x190ceb){_0x2551e9['push'](_0x2551e9['shift']());}};_0x386bab(++_0x9018bc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index f2f2850..c50c390 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 _0xc5fc=['result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','map','include','model','attributes','ShowDynamics365Account','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5b2382,_0x487a93){var _0x387935=function(_0x192831){while(--_0x192831){_0x5b2382['push'](_0x5b2382['shift']());}};_0x387935(++_0x487a93);}(_0xc5fc,0x14d));var _0xcc5f=function(_0x4d8f0b,_0x4a156c){_0x4d8f0b=_0x4d8f0b-0x0;var _0x281e84=_0xc5fc[_0x4d8f0b];return _0x281e84;};'use strict';var _=require(_0xcc5f('0x0'));var util=require(_0xcc5f('0x1'));var moment=require(_0xcc5f('0x2'));var BPromise=require('bluebird');var rs=require(_0xcc5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc5f('0x4'))['db'];var utils=require(_0xcc5f('0x5'));var logger=require(_0xcc5f('0x6'))('rpc');var config=require(_0xcc5f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcc5f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fc124,_0x1b4470,_0x185713){return new BPromise(function(_0x2f3e10,_0x4362dc){return client[_0xcc5f('0x9')](_0x4fc124,_0x185713)[_0xcc5f('0xa')](function(_0x1ca343){logger[_0xcc5f('0xb')](_0xcc5f('0xc'),_0x1b4470,_0xcc5f('0xd'));logger[_0xcc5f('0xe')](_0xcc5f('0xf'),_0x1b4470,_0xcc5f('0xd'),JSON[_0xcc5f('0x10')](_0x1ca343));if(_0x1ca343['error']){if(_0x1ca343[_0xcc5f('0x11')]['code']===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x1b4470,_0x1ca343[_0xcc5f('0x11')][_0xcc5f('0x12')]);return _0x4362dc(_0x1ca343['error'][_0xcc5f('0x12')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x1b4470,_0x1ca343[_0xcc5f('0x11')][_0xcc5f('0x12')]);return _0x2f3e10(_0x1ca343[_0xcc5f('0x11')][_0xcc5f('0x12')]);}else{logger[_0xcc5f('0xb')](_0xcc5f('0xc'),_0x1b4470,'request\x20sent');_0x2f3e10(_0x1ca343[_0xcc5f('0x13')][_0xcc5f('0x12')]);}})[_0xcc5f('0x14')](function(_0x2f0afa){logger[_0xcc5f('0x11')](_0xcc5f('0xc'),_0x1b4470,_0x2f0afa);_0x4362dc(_0x2f0afa);});});}exports[_0xcc5f('0x15')]=function(_0x55de30){var _0x35c29e=this;return new Promise(function(_0xe354a3,_0x2e33c9){return db[_0xcc5f('0x16')][_0xcc5f('0x17')]({'raw':_0x55de30[_0xcc5f('0x18')]?_0x55de30[_0xcc5f('0x18')][_0xcc5f('0x19')]===undefined?!![]:![]:!![],'where':_0x55de30[_0xcc5f('0x18')]?_0x55de30[_0xcc5f('0x18')][_0xcc5f('0x1a')]||null:null,'attributes':_0x55de30[_0xcc5f('0x18')]?_0x55de30[_0xcc5f('0x18')]['attributes']||null:null,'limit':_0x55de30[_0xcc5f('0x18')]?_0x55de30[_0xcc5f('0x18')]['limit']||null:null,'include':_0x55de30[_0xcc5f('0x18')]?_0x55de30[_0xcc5f('0x18')]['include']?_[_0xcc5f('0x1b')](_0x55de30[_0xcc5f('0x18')][_0xcc5f('0x1c')],function(_0x402c03){return{'model':db[_0x402c03[_0xcc5f('0x1d')]],'as':_0x402c03['as'],'attributes':_0x402c03[_0xcc5f('0x1e')],'include':_0x402c03['include']?_[_0xcc5f('0x1b')](_0x402c03[_0xcc5f('0x1c')],function(_0x4e16f1){return{'model':db[_0x4e16f1['model']],'as':_0x4e16f1['as'],'attributes':_0x4e16f1['attributes'],'include':_0x4e16f1[_0xcc5f('0x1c')]?_[_0xcc5f('0x1b')](_0x4e16f1[_0xcc5f('0x1c')],function(_0x4f4f8b){return{'model':db[_0x4f4f8b[_0xcc5f('0x1d')]],'as':_0x4f4f8b['as'],'attributes':_0x4f4f8b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x49a142){logger['info']('GetDynamics365Account',_0x55de30);logger[_0xcc5f('0xe')](_0xcc5f('0x15'),_0x55de30,JSON[_0xcc5f('0x10')](_0x49a142));_0xe354a3(_0x49a142);})['catch'](function(_0x213ff5){logger[_0xcc5f('0x11')](_0xcc5f('0x15'),_0x213ff5[_0xcc5f('0x12')],_0x55de30);_0x2e33c9(_0x35c29e['error'](0x1f4,_0x213ff5['message']));});});};exports[_0xcc5f('0x1f')]=function(_0x4186d7){var _0xe068bd=this;return new Promise(function(_0x2a2210,_0x204ff9){return db[_0xcc5f('0x16')]['find']({'raw':_0x4186d7[_0xcc5f('0x18')]?_0x4186d7[_0xcc5f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4186d7[_0xcc5f('0x18')]?_0x4186d7[_0xcc5f('0x18')][_0xcc5f('0x1a')]||null:null,'attributes':_0x4186d7[_0xcc5f('0x18')]?_0x4186d7[_0xcc5f('0x18')][_0xcc5f('0x1e')]||null:null,'include':_0x4186d7[_0xcc5f('0x18')]?_0x4186d7[_0xcc5f('0x18')][_0xcc5f('0x1c')]?_[_0xcc5f('0x1b')](_0x4186d7['options'][_0xcc5f('0x1c')],function(_0x42aaa6){return{'model':db[_0x42aaa6[_0xcc5f('0x1d')]],'as':_0x42aaa6['as'],'attributes':_0x42aaa6[_0xcc5f('0x1e')],'include':_0x42aaa6['include']?_[_0xcc5f('0x1b')](_0x42aaa6[_0xcc5f('0x1c')],function(_0x396d75){return{'model':db[_0x396d75[_0xcc5f('0x1d')]],'as':_0x396d75['as'],'attributes':_0x396d75['attributes'],'include':_0x396d75[_0xcc5f('0x1c')]?_[_0xcc5f('0x1b')](_0x396d75[_0xcc5f('0x1c')],function(_0x3ba340){return{'model':db[_0x3ba340[_0xcc5f('0x1d')]],'as':_0x3ba340['as'],'attributes':_0x3ba340[_0xcc5f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e8a70){logger[_0xcc5f('0xb')](_0xcc5f('0x1f'),_0x4186d7);logger[_0xcc5f('0xe')](_0xcc5f('0x1f'),_0x4186d7,JSON[_0xcc5f('0x10')](_0x3e8a70));_0x2a2210(_0x3e8a70);})['catch'](function(_0x299c3e){logger[_0xcc5f('0x11')](_0xcc5f('0x1f'),_0x299c3e[_0xcc5f('0x12')],_0x4186d7);_0x204ff9(_0xe068bd[_0xcc5f('0x11')](0x1f4,_0x299c3e[_0xcc5f('0x12')]));});});}; \ No newline at end of file +var _0x31a2=['request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','then','debug','ShowDynamics365Account','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x31a2,0x10d));var _0x231a=function(_0x270eca,_0x4c6cff){_0x270eca=_0x270eca-0x0;var _0x6d4e66=_0x31a2[_0x270eca];return _0x6d4e66;};'use strict';var _=require(_0x231a('0x0'));var util=require('util');var moment=require(_0x231a('0x1'));var BPromise=require(_0x231a('0x2'));var rs=require(_0x231a('0x3'));var fs=require('fs');var Redis=require(_0x231a('0x4'));var db=require(_0x231a('0x5'))['db'];var utils=require(_0x231a('0x6'));var logger=require(_0x231a('0x7'))('rpc');var config=require(_0x231a('0x8'));var jayson=require(_0x231a('0x9'));var client=jayson['client'][_0x231a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x460795,_0x1bf5e2,_0x19a61d){return new BPromise(function(_0x5c3032,_0x54704f){return client[_0x231a('0xb')](_0x460795,_0x19a61d)['then'](function(_0x112ccf){logger[_0x231a('0xc')](_0x231a('0xd'),_0x1bf5e2,_0x231a('0xe'));logger['debug'](_0x231a('0xf'),_0x1bf5e2,_0x231a('0xe'),JSON[_0x231a('0x10')](_0x112ccf));if(_0x112ccf['error']){if(_0x112ccf[_0x231a('0x11')][_0x231a('0x12')]===0x1f4){logger[_0x231a('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x1bf5e2,_0x112ccf[_0x231a('0x11')][_0x231a('0x13')]);return _0x54704f(_0x112ccf[_0x231a('0x11')][_0x231a('0x13')]);}logger[_0x231a('0x11')](_0x231a('0xd'),_0x1bf5e2,_0x112ccf['error'][_0x231a('0x13')]);return _0x5c3032(_0x112ccf[_0x231a('0x11')][_0x231a('0x13')]);}else{logger[_0x231a('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x1bf5e2,_0x231a('0xe'));_0x5c3032(_0x112ccf[_0x231a('0x14')][_0x231a('0x13')]);}})[_0x231a('0x15')](function(_0x4c5d45){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x1bf5e2,_0x4c5d45);_0x54704f(_0x4c5d45);});});}exports[_0x231a('0x16')]=function(_0x434a10){var _0x457668=this;return new Promise(function(_0x4a7c2e,_0xf0e892){return db[_0x231a('0x17')][_0x231a('0x18')]({'raw':_0x434a10[_0x231a('0x19')]?_0x434a10[_0x231a('0x19')][_0x231a('0x1a')]===undefined?!![]:![]:!![],'where':_0x434a10['options']?_0x434a10['options'][_0x231a('0x1b')]||null:null,'attributes':_0x434a10[_0x231a('0x19')]?_0x434a10[_0x231a('0x19')][_0x231a('0x1c')]||null:null,'limit':_0x434a10[_0x231a('0x19')]?_0x434a10['options']['limit']||null:null,'include':_0x434a10[_0x231a('0x19')]?_0x434a10['options'][_0x231a('0x1d')]?_[_0x231a('0x1e')](_0x434a10[_0x231a('0x19')][_0x231a('0x1d')],function(_0x103d0a){return{'model':db[_0x103d0a[_0x231a('0x1f')]],'as':_0x103d0a['as'],'attributes':_0x103d0a[_0x231a('0x1c')],'include':_0x103d0a['include']?_[_0x231a('0x1e')](_0x103d0a[_0x231a('0x1d')],function(_0x20d687){return{'model':db[_0x20d687[_0x231a('0x1f')]],'as':_0x20d687['as'],'attributes':_0x20d687['attributes'],'include':_0x20d687['include']?_['map'](_0x20d687[_0x231a('0x1d')],function(_0x3f464d){return{'model':db[_0x3f464d[_0x231a('0x1f')]],'as':_0x3f464d['as'],'attributes':_0x3f464d[_0x231a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x231a('0x20')](function(_0x3092be){logger[_0x231a('0xc')]('GetDynamics365Account',_0x434a10);logger[_0x231a('0x21')](_0x231a('0x16'),_0x434a10,JSON['stringify'](_0x3092be));_0x4a7c2e(_0x3092be);})['catch'](function(_0x236f36){logger['error'](_0x231a('0x16'),_0x236f36[_0x231a('0x13')],_0x434a10);_0xf0e892(_0x457668[_0x231a('0x11')](0x1f4,_0x236f36[_0x231a('0x13')]));});});};exports[_0x231a('0x22')]=function(_0x17ed54){var _0x1ea4c5=this;return new Promise(function(_0x542e9f,_0xfcd8f3){return db[_0x231a('0x17')]['find']({'raw':_0x17ed54['options']?_0x17ed54['options'][_0x231a('0x1a')]===undefined?!![]:![]:!![],'where':_0x17ed54[_0x231a('0x19')]?_0x17ed54['options']['where']||null:null,'attributes':_0x17ed54[_0x231a('0x19')]?_0x17ed54[_0x231a('0x19')]['attributes']||null:null,'include':_0x17ed54[_0x231a('0x19')]?_0x17ed54[_0x231a('0x19')][_0x231a('0x1d')]?_[_0x231a('0x1e')](_0x17ed54[_0x231a('0x19')][_0x231a('0x1d')],function(_0x415bbb){return{'model':db[_0x415bbb[_0x231a('0x1f')]],'as':_0x415bbb['as'],'attributes':_0x415bbb[_0x231a('0x1c')],'include':_0x415bbb[_0x231a('0x1d')]?_[_0x231a('0x1e')](_0x415bbb[_0x231a('0x1d')],function(_0x459479){return{'model':db[_0x459479[_0x231a('0x1f')]],'as':_0x459479['as'],'attributes':_0x459479[_0x231a('0x1c')],'include':_0x459479['include']?_['map'](_0x459479[_0x231a('0x1d')],function(_0x36d0b0){return{'model':db[_0x36d0b0['model']],'as':_0x36d0b0['as'],'attributes':_0x36d0b0[_0x231a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x231a('0x20')](function(_0x29ae4e){logger[_0x231a('0xc')](_0x231a('0x22'),_0x17ed54);logger[_0x231a('0x21')]('ShowDynamics365Account',_0x17ed54,JSON[_0x231a('0x10')](_0x29ae4e));_0x542e9f(_0x29ae4e);})[_0x231a('0x15')](function(_0x140ef1){logger[_0x231a('0x11')](_0x231a('0x22'),_0x140ef1[_0x231a('0x13')],_0x17ed54);_0xfcd8f3(_0x1ea4c5[_0x231a('0x11')](0x1f4,_0x140ef1['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 018840b..b203101 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 _0xa02f=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x42d345,_0x32963b){var _0x45a331=function(_0x18f50a){while(--_0x18f50a){_0x42d345['push'](_0x42d345['shift']());}};_0x45a331(++_0x32963b);}(_0xa02f,0xce));var _0xfa02=function(_0x25a9a6,_0x378dd6){_0x25a9a6=_0x25a9a6-0x0;var _0x40741b=_0xa02f[_0x25a9a6];return _0x40741b;};'use strict';var multer=require('multer');var util=require(_0xfa02('0x0'));var path=require(_0xfa02('0x1'));var timeout=require(_0xfa02('0x2'));var express=require(_0xfa02('0x3'));var router=express['Router']();var fs_extra=require(_0xfa02('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfa02('0x5'));var config=require(_0xfa02('0x6'));var controller=require(_0xfa02('0x7'));router[_0xfa02('0x8')]('/',auth[_0xfa02('0x9')](),controller['index']);router[_0xfa02('0x8')](_0xfa02('0xa'),auth[_0xfa02('0x9')](),controller[_0xfa02('0xb')]);router['get'](_0xfa02('0xc'),auth[_0xfa02('0x9')](),controller[_0xfa02('0xd')]);router['get'](_0xfa02('0xe'),auth[_0xfa02('0x9')](),controller[_0xfa02('0xf')]);router['get'](_0xfa02('0x10'),auth[_0xfa02('0x9')](),controller[_0xfa02('0x11')]);router[_0xfa02('0x12')]('/',auth[_0xfa02('0x9')](),controller[_0xfa02('0x13')]);router[_0xfa02('0x14')](_0xfa02('0xa'),auth[_0xfa02('0x9')](),controller[_0xfa02('0x15')]);router[_0xfa02('0x16')](_0xfa02('0xa'),auth[_0xfa02('0x9')](),controller[_0xfa02('0x17')]);module[_0xfa02('0x18')]=router; \ No newline at end of file +var _0x9f12=['destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete'];(function(_0x10f254,_0xcbab0){var _0x178547=function(_0x4148ba){while(--_0x4148ba){_0x10f254['push'](_0x10f254['shift']());}};_0x178547(++_0xcbab0);}(_0x9f12,0xe8));var _0x29f1=function(_0x11a05f,_0x38a6af){_0x11a05f=_0x11a05f-0x0;var _0xdfea63=_0x9f12[_0x11a05f];return _0xdfea63;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x29f1('0x0'));var timeout=require(_0x29f1('0x1'));var express=require(_0x29f1('0x2'));var router=express[_0x29f1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x29f1('0x4'));var interaction=require(_0x29f1('0x5'));var config=require(_0x29f1('0x6'));var controller=require(_0x29f1('0x7'));router[_0x29f1('0x8')]('/',auth[_0x29f1('0x9')](),controller['index']);router[_0x29f1('0x8')](_0x29f1('0xa'),auth[_0x29f1('0x9')](),controller[_0x29f1('0xb')]);router['get']('/:id/fields',auth[_0x29f1('0x9')](),controller[_0x29f1('0xc')]);router[_0x29f1('0x8')](_0x29f1('0xd'),auth[_0x29f1('0x9')](),controller[_0x29f1('0xe')]);router[_0x29f1('0x8')](_0x29f1('0xf'),auth['isAuthenticated'](),controller[_0x29f1('0x10')]);router[_0x29f1('0x11')]('/',auth[_0x29f1('0x9')](),controller['create']);router[_0x29f1('0x12')](_0x29f1('0xa'),auth[_0x29f1('0x9')](),controller[_0x29f1('0x13')]);router[_0x29f1('0x14')](_0x29f1('0xa'),auth[_0x29f1('0x9')](),controller[_0x29f1('0x15')]);module[_0x29f1('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 2ea2324..cb7127f 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 _0xd511=['incident','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd511,0x10f));var _0x1d51=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd511[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1d51('0x0'));module['exports']={'name':{'type':Sequelize[_0x1d51('0x1')]},'description':{'type':Sequelize[_0x1d51('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x1d51('0x2'),'phonecall'),'defaultValue':_0x1d51('0x2')}}; \ No newline at end of file +var _0x0835=['STRING','ENUM','incident','exports'];(function(_0x523e09,_0xb598ae){var _0x1c6782=function(_0x2d8977){while(--_0x2d8977){_0x523e09['push'](_0x523e09['shift']());}};_0x1c6782(++_0xb598ae);}(_0x0835,0x17b));var _0x5083=function(_0xd5b9d0,_0x2e7764){_0xd5b9d0=_0xd5b9d0-0x0;var _0x1d1d1f=_0x0835[_0xd5b9d0];return _0x1d1d1f;};'use strict';var Sequelize=require('sequelize');module[_0x5083('0x0')]={'name':{'type':Sequelize[_0x5083('0x1')]},'description':{'type':Sequelize[_0x5083('0x1')]},'ticketType':{'type':Sequelize[_0x5083('0x2')](_0x5083('0x3'),'phonecall'),'defaultValue':_0x5083('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ce523ec..032dfc9 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 _0x1095=['VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','getFields','Dynamics365Field','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','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','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x296db0,_0x386561){var _0x3dfc52=function(_0x514e42){while(--_0x514e42){_0x296db0['push'](_0x296db0['shift']());}};_0x3dfc52(++_0x386561);}(_0x1095,0xf7));var _0x5109=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x1095[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5109('0x0'));var zipdir=require(_0x5109('0x1'));var jsonpatch=require(_0x5109('0x2'));var rp=require(_0x5109('0x3'));var moment=require(_0x5109('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5109('0x5'));var util=require(_0x5109('0x6'));var path=require('path');var sox=require(_0x5109('0x7'));var csv=require(_0x5109('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5109('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5109('0xa'));var toCsv=require(_0x5109('0x8'));var querystring=require(_0x5109('0xb'));var Papa=require(_0x5109('0xc'));var Redis=require(_0x5109('0xd'));var authService=require(_0x5109('0xe'));var qs=require(_0x5109('0xf'));var as=require(_0x5109('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5109('0x11'))(_0x5109('0x12'));var utils=require(_0x5109('0x13'));var config=require(_0x5109('0x14'));var licenseUtil=require(_0x5109('0x15'));var db=require(_0x5109('0x16'))['db'];function respondWithStatusCode(_0x128780,_0x224e83){_0x224e83=_0x224e83||0xcc;return function(_0x31948e){if(_0x31948e){return _0x128780[_0x5109('0x17')](_0x224e83);}return _0x128780[_0x5109('0x18')](_0x224e83)[_0x5109('0x19')]();};}function respondWithResult(_0x5d74bb,_0x16181c){_0x16181c=_0x16181c||0xc8;return function(_0x25f29b){if(_0x25f29b){return _0x5d74bb[_0x5109('0x18')](_0x16181c)['json'](_0x25f29b);}};}function respondWithFilteredResult(_0x369709,_0x3b8f13){return function(_0x137bcd){if(_0x137bcd){var _0xedf740=typeof _0x3b8f13[_0x5109('0x1a')]===_0x5109('0x1b')&&typeof _0x3b8f13['limit']===_0x5109('0x1b');var _0x1e501e=_0x137bcd['count'];var _0x5229b4=_0xedf740?0x0:_0x3b8f13['offset'];var _0x3f41d0=_0xedf740?_0x137bcd[_0x5109('0x1c')]:_0x3b8f13[_0x5109('0x1a')]+_0x3b8f13[_0x5109('0x1d')];var _0x19fd2a;if(_0x3f41d0>=_0x1e501e){_0x3f41d0=_0x1e501e;_0x19fd2a=0xc8;}else{_0x19fd2a=0xce;}_0x369709[_0x5109('0x18')](_0x19fd2a);return _0x369709['set'](_0x5109('0x1e'),_0x5229b4+'-'+_0x3f41d0+'/'+_0x1e501e)['json'](_0x137bcd);}return null;};}function patchUpdates(_0x5b1aa4){return function(_0x3b943d){try{jsonpatch[_0x5109('0x1f')](_0x3b943d,_0x5b1aa4,!![]);}catch(_0x234872){return BPromise[_0x5109('0x20')](_0x234872);}return _0x3b943d[_0x5109('0x21')]();};}function saveUpdates(_0x171f3c,_0x1a1705){return function(_0xf08423){if(_0xf08423){return _0xf08423[_0x5109('0x22')](_0x171f3c)[_0x5109('0x23')](function(_0x1c31e7){return _0x1c31e7;});}return null;};}function removeEntity(_0x45a95a,_0x4f9bf9){return function(_0x577fea){if(_0x577fea){return _0x577fea['destroy']()[_0x5109('0x23')](function(){_0x45a95a[_0x5109('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b9980,_0x412add){return function(_0x27cf09){if(!_0x27cf09){_0x3b9980[_0x5109('0x17')](0x194);}return _0x27cf09;};}function handleError(_0x170c28,_0x46e910){_0x46e910=_0x46e910||0x1f4;return function(_0x521634){logger[_0x5109('0x24')](_0x521634[_0x5109('0x25')]);if(_0x521634[_0x5109('0x26')]){delete _0x521634[_0x5109('0x26')];}_0x170c28[_0x5109('0x18')](_0x46e910)[_0x5109('0x27')](_0x521634);};}exports['index']=function(_0x50d68f,_0x296b3d){var _0x13fac1={},_0x1409e4={},_0x56b0ef={'count':0x0,'rows':[]};var _0x303957=_[_0x5109('0x28')](db[_0x5109('0x29')][_0x5109('0x2a')],function(_0x3a4b30){return{'name':_0x3a4b30[_0x5109('0x2b')],'type':_0x3a4b30[_0x5109('0x2c')][_0x5109('0x2d')]};});_0x1409e4[_0x5109('0x2e')]=_[_0x5109('0x28')](_0x303957,_0x5109('0x26'));_0x1409e4[_0x5109('0x2f')]=_['keys'](_0x50d68f[_0x5109('0x2f')]);_0x1409e4[_0x5109('0x30')]=_[_0x5109('0x31')](_0x1409e4[_0x5109('0x2e')],_0x1409e4[_0x5109('0x2f')]);_0x13fac1[_0x5109('0x32')]=_['intersection'](_0x1409e4[_0x5109('0x2e')],qs[_0x5109('0x33')](_0x50d68f[_0x5109('0x2f')][_0x5109('0x33')]));_0x13fac1[_0x5109('0x32')]=_0x13fac1[_0x5109('0x32')][_0x5109('0x34')]?_0x13fac1[_0x5109('0x32')]:_0x1409e4[_0x5109('0x2e')];if(!_0x50d68f[_0x5109('0x2f')][_0x5109('0x35')](_0x5109('0x36'))){_0x13fac1[_0x5109('0x1d')]=qs['limit'](_0x50d68f['query'][_0x5109('0x1d')]);_0x13fac1['offset']=qs['offset'](_0x50d68f['query'][_0x5109('0x1a')]);}_0x13fac1[_0x5109('0x37')]=qs[_0x5109('0x38')](_0x50d68f[_0x5109('0x2f')][_0x5109('0x38')]);_0x13fac1[_0x5109('0x39')]=qs['filters'](_[_0x5109('0x3a')](_0x50d68f[_0x5109('0x2f')],_0x1409e4[_0x5109('0x30')]),_0x303957);if(_0x50d68f[_0x5109('0x2f')][_0x5109('0x3b')]){_0x13fac1[_0x5109('0x39')]=_[_0x5109('0x3c')](_0x13fac1[_0x5109('0x39')],{'$or':_[_0x5109('0x28')](_0x303957,function(_0x3205a7){if(_0x3205a7[_0x5109('0x2c')]!==_0x5109('0x3d')){var _0x3ec5d3={};_0x3ec5d3[_0x3205a7[_0x5109('0x26')]]={'$like':'%'+_0x50d68f[_0x5109('0x2f')][_0x5109('0x3b')]+'%'};return _0x3ec5d3;}})});}_0x13fac1=_['merge']({},_0x13fac1,_0x50d68f[_0x5109('0x3e')]);var _0x51f60a={'where':_0x13fac1[_0x5109('0x39')]};return db[_0x5109('0x29')][_0x5109('0x1c')](_0x51f60a)[_0x5109('0x23')](function(_0x3f0ec1){_0x56b0ef[_0x5109('0x1c')]=_0x3f0ec1;if(_0x50d68f[_0x5109('0x2f')][_0x5109('0x3f')]){_0x13fac1[_0x5109('0x40')]=[{'all':!![]}];}return db[_0x5109('0x29')]['findAll'](_0x13fac1);})[_0x5109('0x23')](function(_0x33c700){_0x56b0ef['rows']=_0x33c700;return _0x56b0ef;})[_0x5109('0x23')](respondWithFilteredResult(_0x296b3d,_0x13fac1))[_0x5109('0x41')](handleError(_0x296b3d,null));};exports[_0x5109('0x42')]=function(_0x55fb99,_0x624e1d){var _0x1fa7b8={'raw':![],'where':{'id':_0x55fb99[_0x5109('0x43')]['id']}},_0x57be16={};_0x57be16['model']=_[_0x5109('0x44')](db[_0x5109('0x29')][_0x5109('0x2a')]);_0x57be16[_0x5109('0x2f')]=_[_0x5109('0x44')](_0x55fb99[_0x5109('0x2f')]);_0x57be16[_0x5109('0x30')]=_[_0x5109('0x31')](_0x57be16[_0x5109('0x2e')],_0x57be16[_0x5109('0x2f')]);_0x1fa7b8[_0x5109('0x32')]=_[_0x5109('0x31')](_0x57be16['model'],qs[_0x5109('0x33')](_0x55fb99[_0x5109('0x2f')]['fields']));_0x1fa7b8[_0x5109('0x32')]=_0x1fa7b8[_0x5109('0x32')][_0x5109('0x34')]?_0x1fa7b8['attributes']:_0x57be16['model'];if(_0x55fb99[_0x5109('0x2f')][_0x5109('0x3f')]){_0x1fa7b8[_0x5109('0x40')]=[{'all':!![]}];}_0x1fa7b8=_[_0x5109('0x3c')]({},_0x1fa7b8,_0x55fb99[_0x5109('0x3e')]);return db[_0x5109('0x29')][_0x5109('0x45')](_0x1fa7b8)['then'](handleEntityNotFound(_0x624e1d,null))[_0x5109('0x23')](respondWithResult(_0x624e1d,null))[_0x5109('0x41')](handleError(_0x624e1d,null));};exports[_0x5109('0x46')]=function(_0x351302,_0x28deca){return db[_0x5109('0x29')][_0x5109('0x46')](_0x351302['body'],{})[_0x5109('0x23')](respondWithResult(_0x28deca,0xc9))[_0x5109('0x41')](handleError(_0x28deca,null));};exports[_0x5109('0x22')]=function(_0x2d6937,_0x28d78b){if(_0x2d6937[_0x5109('0x47')]['id']){delete _0x2d6937[_0x5109('0x47')]['id'];}return db[_0x5109('0x29')][_0x5109('0x45')]({'where':{'id':_0x2d6937[_0x5109('0x43')]['id']}})['then'](handleEntityNotFound(_0x28d78b,null))[_0x5109('0x23')](saveUpdates(_0x2d6937[_0x5109('0x47')],null))[_0x5109('0x23')](respondWithResult(_0x28d78b,null))[_0x5109('0x41')](handleError(_0x28d78b,null));};exports[_0x5109('0x48')]=function(_0x56a739,_0x397710){return db['Dynamics365Configuration']['find']({'where':{'id':_0x56a739[_0x5109('0x43')]['id']}})['then'](handleEntityNotFound(_0x397710,null))[_0x5109('0x23')](removeEntity(_0x397710,null))[_0x5109('0x41')](handleError(_0x397710,null));};exports[_0x5109('0x49')]=function(_0x17be76,_0xdc537d,_0xc6b2e1){var _0x552a6e={};var _0x2dfedc={};var _0x4b784a;var _0x435f2b;return db[_0x5109('0x29')]['findOne']({'where':{'id':_0x17be76[_0x5109('0x43')]['id']}})['then'](handleEntityNotFound(_0xdc537d,null))[_0x5109('0x23')](function(_0x5f42ff){if(_0x5f42ff){_0x4b784a=_0x5f42ff;_0x2dfedc[_0x5109('0x2e')]=_['keys'](db[_0x5109('0x4a')]['rawAttributes']);_0x2dfedc[_0x5109('0x2f')]=_[_0x5109('0x44')](_0x17be76[_0x5109('0x2f')]);_0x2dfedc[_0x5109('0x30')]=_['intersection'](_0x2dfedc[_0x5109('0x2e')],_0x2dfedc[_0x5109('0x2f')]);_0x552a6e[_0x5109('0x32')]=_[_0x5109('0x31')](_0x2dfedc[_0x5109('0x2e')],qs[_0x5109('0x33')](_0x17be76[_0x5109('0x2f')][_0x5109('0x33')]));_0x552a6e[_0x5109('0x32')]=_0x552a6e[_0x5109('0x32')][_0x5109('0x34')]?_0x552a6e[_0x5109('0x32')]:_0x2dfedc['model'];_0x552a6e[_0x5109('0x37')]=qs[_0x5109('0x38')](_0x17be76[_0x5109('0x2f')][_0x5109('0x38')]);_0x552a6e[_0x5109('0x39')]=qs[_0x5109('0x30')](_[_0x5109('0x3a')](_0x17be76[_0x5109('0x2f')],_0x2dfedc[_0x5109('0x30')]));if(_0x17be76['query'][_0x5109('0x3b')]){_0x552a6e[_0x5109('0x39')]=_[_0x5109('0x3c')](_0x552a6e[_0x5109('0x39')],{'$or':_['map'](_0x552a6e[_0x5109('0x32')],function(_0x37ed35){var _0x2dc7c7={};_0x2dc7c7[_0x37ed35]={'$like':'%'+_0x17be76['query'][_0x5109('0x3b')]+'%'};return _0x2dc7c7;})});}_0x552a6e=_['merge']({},_0x552a6e,_0x17be76[_0x5109('0x3e')]);return _0x4b784a['getFields'](_0x552a6e);}})[_0x5109('0x23')](function(_0xaa9368){if(_0xaa9368){_0x435f2b=_0xaa9368['length'];if(!_0x17be76[_0x5109('0x2f')][_0x5109('0x35')](_0x5109('0x36'))){_0x552a6e[_0x5109('0x1d')]=qs[_0x5109('0x1d')](_0x17be76[_0x5109('0x2f')][_0x5109('0x1d')]);_0x552a6e[_0x5109('0x1a')]=qs[_0x5109('0x1a')](_0x17be76['query'][_0x5109('0x1a')]);}return _0x4b784a[_0x5109('0x49')](_0x552a6e);}})[_0x5109('0x23')](function(_0x8b317a){if(_0x8b317a){return _0x8b317a?{'count':_0x435f2b,'rows':_0x8b317a}:null;}})[_0x5109('0x23')](respondWithResult(_0xdc537d,null))[_0x5109('0x41')](handleError(_0xdc537d,null));};exports['getSubjects']=function(_0x12b2b7,_0x2fe699,_0x394a2f){var _0x382dc7={};var _0x51741b={};var _0x53209a;var _0x587948;return db[_0x5109('0x29')]['findOne']({'where':{'id':_0x12b2b7[_0x5109('0x43')]['id']}})[_0x5109('0x23')](handleEntityNotFound(_0x2fe699,null))[_0x5109('0x23')](function(_0x4d604b){if(_0x4d604b){_0x53209a=_0x4d604b;_0x51741b[_0x5109('0x2e')]=_[_0x5109('0x44')](db[_0x5109('0x4a')][_0x5109('0x2a')]);_0x51741b[_0x5109('0x2f')]=_[_0x5109('0x44')](_0x12b2b7[_0x5109('0x2f')]);_0x51741b[_0x5109('0x30')]=_[_0x5109('0x31')](_0x51741b[_0x5109('0x2e')],_0x51741b[_0x5109('0x2f')]);_0x382dc7['attributes']=_['intersection'](_0x51741b[_0x5109('0x2e')],qs[_0x5109('0x33')](_0x12b2b7['query'][_0x5109('0x33')]));_0x382dc7[_0x5109('0x32')]=_0x382dc7[_0x5109('0x32')][_0x5109('0x34')]?_0x382dc7['attributes']:_0x51741b[_0x5109('0x2e')];_0x382dc7[_0x5109('0x37')]=qs['sort'](_0x12b2b7[_0x5109('0x2f')][_0x5109('0x38')]);_0x382dc7['where']=qs[_0x5109('0x30')](_[_0x5109('0x3a')](_0x12b2b7['query'],_0x51741b[_0x5109('0x30')]));if(_0x12b2b7[_0x5109('0x2f')][_0x5109('0x3b')]){_0x382dc7[_0x5109('0x39')]=_['merge'](_0x382dc7[_0x5109('0x39')],{'$or':_['map'](_0x382dc7['attributes'],function(_0x41bc8c){var _0x12d7c4={};_0x12d7c4[_0x41bc8c]={'$like':'%'+_0x12b2b7[_0x5109('0x2f')][_0x5109('0x3b')]+'%'};return _0x12d7c4;})});}_0x382dc7=_[_0x5109('0x3c')]({},_0x382dc7,_0x12b2b7[_0x5109('0x3e')]);return _0x53209a[_0x5109('0x4b')](_0x382dc7);}})[_0x5109('0x23')](function(_0x35a212){if(_0x35a212){_0x587948=_0x35a212[_0x5109('0x34')];if(!_0x12b2b7[_0x5109('0x2f')]['hasOwnProperty'](_0x5109('0x36'))){_0x382dc7['limit']=qs['limit'](_0x12b2b7[_0x5109('0x2f')][_0x5109('0x1d')]);_0x382dc7[_0x5109('0x1a')]=qs[_0x5109('0x1a')](_0x12b2b7['query'][_0x5109('0x1a')]);}return _0x53209a['getSubjects'](_0x382dc7);}})[_0x5109('0x23')](function(_0x189228){if(_0x189228){return _0x189228?{'count':_0x587948,'rows':_0x189228}:null;}})[_0x5109('0x23')](respondWithResult(_0x2fe699,null))[_0x5109('0x41')](handleError(_0x2fe699,null));};exports['getDescriptions']=function(_0x5e175d,_0x10b683,_0x6e3e32){var _0x132588={};var _0x3d4219={};var _0x18164c;var _0x4221e6;return db[_0x5109('0x29')]['findOne']({'where':{'id':_0x5e175d[_0x5109('0x43')]['id']}})[_0x5109('0x23')](handleEntityNotFound(_0x10b683,null))[_0x5109('0x23')](function(_0x4fc359){if(_0x4fc359){_0x18164c=_0x4fc359;_0x3d4219[_0x5109('0x2e')]=_[_0x5109('0x44')](db[_0x5109('0x4a')][_0x5109('0x2a')]);_0x3d4219[_0x5109('0x2f')]=_['keys'](_0x5e175d[_0x5109('0x2f')]);_0x3d4219[_0x5109('0x30')]=_[_0x5109('0x31')](_0x3d4219[_0x5109('0x2e')],_0x3d4219[_0x5109('0x2f')]);_0x132588[_0x5109('0x32')]=_[_0x5109('0x31')](_0x3d4219[_0x5109('0x2e')],qs['fields'](_0x5e175d[_0x5109('0x2f')]['fields']));_0x132588[_0x5109('0x32')]=_0x132588[_0x5109('0x32')]['length']?_0x132588['attributes']:_0x3d4219['model'];_0x132588[_0x5109('0x37')]=qs[_0x5109('0x38')](_0x5e175d[_0x5109('0x2f')]['sort']);_0x132588[_0x5109('0x39')]=qs['filters'](_[_0x5109('0x3a')](_0x5e175d['query'],_0x3d4219[_0x5109('0x30')]));if(_0x5e175d[_0x5109('0x2f')][_0x5109('0x3b')]){_0x132588[_0x5109('0x39')]=_[_0x5109('0x3c')](_0x132588[_0x5109('0x39')],{'$or':_[_0x5109('0x28')](_0x132588[_0x5109('0x32')],function(_0x395364){var _0x2c8243={};_0x2c8243[_0x395364]={'$like':'%'+_0x5e175d[_0x5109('0x2f')][_0x5109('0x3b')]+'%'};return _0x2c8243;})});}_0x132588=_[_0x5109('0x3c')]({},_0x132588,_0x5e175d[_0x5109('0x3e')]);return _0x18164c[_0x5109('0x4c')](_0x132588);}})[_0x5109('0x23')](function(_0x2c85ff){if(_0x2c85ff){_0x4221e6=_0x2c85ff[_0x5109('0x34')];if(!_0x5e175d[_0x5109('0x2f')][_0x5109('0x35')]('nolimit')){_0x132588['limit']=qs[_0x5109('0x1d')](_0x5e175d['query'][_0x5109('0x1d')]);_0x132588['offset']=qs[_0x5109('0x1a')](_0x5e175d[_0x5109('0x2f')][_0x5109('0x1a')]);}return _0x18164c[_0x5109('0x4c')](_0x132588);}})[_0x5109('0x23')](function(_0x2003d4){if(_0x2003d4){return _0x2003d4?{'count':_0x4221e6,'rows':_0x2003d4}:null;}})[_0x5109('0x23')](respondWithResult(_0x10b683,null))[_0x5109('0x41')](handleError(_0x10b683,null));}; \ No newline at end of file +var _0x2eac=['rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','catch','create','update','find','body','getFields','findOne','Dynamics365Field','pick','getSubjects','getDescriptions','options','nolimit','eml-format'];(function(_0x93ed4,_0x7f163e){var _0x2612f1=function(_0x205290){while(--_0x205290){_0x93ed4['push'](_0x93ed4['shift']());}};_0x2612f1(++_0x7f163e);}(_0x2eac,0x19e));var _0xc2ea=function(_0x22e723,_0x4370ee){_0x22e723=_0x22e723-0x0;var _0x52fde1=_0x2eac[_0x22e723];return _0x52fde1;};'use strict';var emlformat=require(_0xc2ea('0x0'));var rimraf=require(_0xc2ea('0x1'));var zipdir=require(_0xc2ea('0x2'));var jsonpatch=require(_0xc2ea('0x3'));var rp=require(_0xc2ea('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc2ea('0x5'));var util=require(_0xc2ea('0x6'));var path=require(_0xc2ea('0x7'));var sox=require('sox');var csv=require(_0xc2ea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc2ea('0x9'));var _=require(_0xc2ea('0xa'));var squel=require('squel');var crypto=require(_0xc2ea('0xb'));var jsforce=require(_0xc2ea('0xc'));var deskjs=require(_0xc2ea('0xd'));var toCsv=require(_0xc2ea('0x8'));var querystring=require(_0xc2ea('0xe'));var Papa=require(_0xc2ea('0xf'));var Redis=require(_0xc2ea('0x10'));var authService=require(_0xc2ea('0x11'));var qs=require(_0xc2ea('0x12'));var as=require(_0xc2ea('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc2ea('0x14'))(_0xc2ea('0x15'));var utils=require('../../config/utils');var config=require(_0xc2ea('0x16'));var licenseUtil=require(_0xc2ea('0x17'));var db=require(_0xc2ea('0x18'))['db'];function respondWithStatusCode(_0x3b16e6,_0x5741a0){_0x5741a0=_0x5741a0||0xcc;return function(_0x355114){if(_0x355114){return _0x3b16e6[_0xc2ea('0x19')](_0x5741a0);}return _0x3b16e6[_0xc2ea('0x1a')](_0x5741a0)[_0xc2ea('0x1b')]();};}function respondWithResult(_0x3c36b7,_0x59b657){_0x59b657=_0x59b657||0xc8;return function(_0x134b09){if(_0x134b09){return _0x3c36b7['status'](_0x59b657)[_0xc2ea('0x1c')](_0x134b09);}};}function respondWithFilteredResult(_0x585efd,_0x2b48d4){return function(_0x154ba2){if(_0x154ba2){var _0x3922df=typeof _0x2b48d4[_0xc2ea('0x1d')]===_0xc2ea('0x1e')&&typeof _0x2b48d4[_0xc2ea('0x1f')]===_0xc2ea('0x1e');var _0x2324c6=_0x154ba2['count'];var _0x1d435c=_0x3922df?0x0:_0x2b48d4[_0xc2ea('0x1d')];var _0x22ba2c=_0x3922df?_0x154ba2[_0xc2ea('0x20')]:_0x2b48d4['offset']+_0x2b48d4['limit'];var _0x4a3141;if(_0x22ba2c>=_0x2324c6){_0x22ba2c=_0x2324c6;_0x4a3141=0xc8;}else{_0x4a3141=0xce;}_0x585efd[_0xc2ea('0x1a')](_0x4a3141);return _0x585efd[_0xc2ea('0x21')](_0xc2ea('0x22'),_0x1d435c+'-'+_0x22ba2c+'/'+_0x2324c6)[_0xc2ea('0x1c')](_0x154ba2);}return null;};}function patchUpdates(_0x40508b){return function(_0x18f857){try{jsonpatch['apply'](_0x18f857,_0x40508b,!![]);}catch(_0x8f008e){return BPromise[_0xc2ea('0x23')](_0x8f008e);}return _0x18f857['save']();};}function saveUpdates(_0x3378fa,_0x42de02){return function(_0x2521f2){if(_0x2521f2){return _0x2521f2['update'](_0x3378fa)[_0xc2ea('0x24')](function(_0x33e8d6){return _0x33e8d6;});}return null;};}function removeEntity(_0x57b2ee,_0x4a8bf7){return function(_0x5006d3){if(_0x5006d3){return _0x5006d3[_0xc2ea('0x25')]()['then'](function(){_0x57b2ee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x580d0c,_0x447f8f){return function(_0x22d899){if(!_0x22d899){_0x580d0c[_0xc2ea('0x19')](0x194);}return _0x22d899;};}function handleError(_0x35eee1,_0x11b7f5){_0x11b7f5=_0x11b7f5||0x1f4;return function(_0x5a30e7){logger[_0xc2ea('0x26')](_0x5a30e7[_0xc2ea('0x27')]);if(_0x5a30e7[_0xc2ea('0x28')]){delete _0x5a30e7['name'];}_0x35eee1[_0xc2ea('0x1a')](_0x11b7f5)[_0xc2ea('0x29')](_0x5a30e7);};}exports[_0xc2ea('0x2a')]=function(_0xa69c2a,_0x4a01d3){var _0x4fc823={},_0x22e451={},_0x33d9df={'count':0x0,'rows':[]};var _0x17e5a6=_['map'](db[_0xc2ea('0x2b')][_0xc2ea('0x2c')],function(_0x4a5e69){return{'name':_0x4a5e69[_0xc2ea('0x2d')],'type':_0x4a5e69[_0xc2ea('0x2e')][_0xc2ea('0x2f')]};});_0x22e451[_0xc2ea('0x30')]=_[_0xc2ea('0x31')](_0x17e5a6,_0xc2ea('0x28'));_0x22e451[_0xc2ea('0x32')]=_['keys'](_0xa69c2a[_0xc2ea('0x32')]);_0x22e451[_0xc2ea('0x33')]=_[_0xc2ea('0x34')](_0x22e451[_0xc2ea('0x30')],_0x22e451[_0xc2ea('0x32')]);_0x4fc823['attributes']=_[_0xc2ea('0x34')](_0x22e451[_0xc2ea('0x30')],qs[_0xc2ea('0x35')](_0xa69c2a[_0xc2ea('0x32')]['fields']));_0x4fc823[_0xc2ea('0x36')]=_0x4fc823['attributes'][_0xc2ea('0x37')]?_0x4fc823[_0xc2ea('0x36')]:_0x22e451['model'];if(!_0xa69c2a[_0xc2ea('0x32')][_0xc2ea('0x38')]('nolimit')){_0x4fc823[_0xc2ea('0x1f')]=qs[_0xc2ea('0x1f')](_0xa69c2a[_0xc2ea('0x32')][_0xc2ea('0x1f')]);_0x4fc823[_0xc2ea('0x1d')]=qs['offset'](_0xa69c2a[_0xc2ea('0x32')]['offset']);}_0x4fc823[_0xc2ea('0x39')]=qs[_0xc2ea('0x3a')](_0xa69c2a[_0xc2ea('0x32')][_0xc2ea('0x3a')]);_0x4fc823[_0xc2ea('0x3b')]=qs[_0xc2ea('0x33')](_['pick'](_0xa69c2a[_0xc2ea('0x32')],_0x22e451['filters']),_0x17e5a6);if(_0xa69c2a[_0xc2ea('0x32')][_0xc2ea('0x3c')]){_0x4fc823['where']=_[_0xc2ea('0x3d')](_0x4fc823[_0xc2ea('0x3b')],{'$or':_['map'](_0x17e5a6,function(_0x630ce){if(_0x630ce['type']!==_0xc2ea('0x3e')){var _0x1bd652={};_0x1bd652[_0x630ce[_0xc2ea('0x28')]]={'$like':'%'+_0xa69c2a[_0xc2ea('0x32')][_0xc2ea('0x3c')]+'%'};return _0x1bd652;}})});}_0x4fc823=_[_0xc2ea('0x3d')]({},_0x4fc823,_0xa69c2a['options']);var _0x536085={'where':_0x4fc823[_0xc2ea('0x3b')]};return db[_0xc2ea('0x2b')]['count'](_0x536085)['then'](function(_0x17e72a){_0x33d9df['count']=_0x17e72a;if(_0xa69c2a[_0xc2ea('0x32')][_0xc2ea('0x3f')]){_0x4fc823[_0xc2ea('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xc2ea('0x41')](_0x4fc823);})[_0xc2ea('0x24')](function(_0x28160f){_0x33d9df[_0xc2ea('0x42')]=_0x28160f;return _0x33d9df;})[_0xc2ea('0x24')](respondWithFilteredResult(_0x4a01d3,_0x4fc823))['catch'](handleError(_0x4a01d3,null));};exports[_0xc2ea('0x43')]=function(_0x4872cf,_0x127c75){var _0x42db22={'raw':![],'where':{'id':_0x4872cf[_0xc2ea('0x44')]['id']}},_0x4a3497={};_0x4a3497[_0xc2ea('0x30')]=_[_0xc2ea('0x45')](db['Dynamics365Configuration'][_0xc2ea('0x2c')]);_0x4a3497[_0xc2ea('0x32')]=_['keys'](_0x4872cf['query']);_0x4a3497[_0xc2ea('0x33')]=_[_0xc2ea('0x34')](_0x4a3497[_0xc2ea('0x30')],_0x4a3497[_0xc2ea('0x32')]);_0x42db22[_0xc2ea('0x36')]=_['intersection'](_0x4a3497[_0xc2ea('0x30')],qs[_0xc2ea('0x35')](_0x4872cf[_0xc2ea('0x32')]['fields']));_0x42db22[_0xc2ea('0x36')]=_0x42db22[_0xc2ea('0x36')][_0xc2ea('0x37')]?_0x42db22[_0xc2ea('0x36')]:_0x4a3497[_0xc2ea('0x30')];if(_0x4872cf[_0xc2ea('0x32')]['includeAll']){_0x42db22[_0xc2ea('0x40')]=[{'all':!![]}];}_0x42db22=_[_0xc2ea('0x3d')]({},_0x42db22,_0x4872cf['options']);return db['Dynamics365Configuration']['find'](_0x42db22)[_0xc2ea('0x24')](handleEntityNotFound(_0x127c75,null))['then'](respondWithResult(_0x127c75,null))[_0xc2ea('0x46')](handleError(_0x127c75,null));};exports[_0xc2ea('0x47')]=function(_0x4cab3a,_0x1a2e9f){return db['Dynamics365Configuration'][_0xc2ea('0x47')](_0x4cab3a['body'],{})['then'](respondWithResult(_0x1a2e9f,0xc9))['catch'](handleError(_0x1a2e9f,null));};exports[_0xc2ea('0x48')]=function(_0x1903f6,_0x3880f9){if(_0x1903f6['body']['id']){delete _0x1903f6['body']['id'];}return db[_0xc2ea('0x2b')][_0xc2ea('0x49')]({'where':{'id':_0x1903f6[_0xc2ea('0x44')]['id']}})['then'](handleEntityNotFound(_0x3880f9,null))[_0xc2ea('0x24')](saveUpdates(_0x1903f6[_0xc2ea('0x4a')],null))[_0xc2ea('0x24')](respondWithResult(_0x3880f9,null))[_0xc2ea('0x46')](handleError(_0x3880f9,null));};exports[_0xc2ea('0x25')]=function(_0x57115b,_0x3279d3){return db[_0xc2ea('0x2b')]['find']({'where':{'id':_0x57115b[_0xc2ea('0x44')]['id']}})[_0xc2ea('0x24')](handleEntityNotFound(_0x3279d3,null))['then'](removeEntity(_0x3279d3,null))['catch'](handleError(_0x3279d3,null));};exports[_0xc2ea('0x4b')]=function(_0x5dac69,_0x3eb1ec,_0x40ec9c){var _0x5a5e41={};var _0x543f9b={};var _0x573e68;var _0x47e222;return db[_0xc2ea('0x2b')][_0xc2ea('0x4c')]({'where':{'id':_0x5dac69[_0xc2ea('0x44')]['id']}})[_0xc2ea('0x24')](handleEntityNotFound(_0x3eb1ec,null))['then'](function(_0x1020b5){if(_0x1020b5){_0x573e68=_0x1020b5;_0x543f9b['model']=_[_0xc2ea('0x45')](db[_0xc2ea('0x4d')][_0xc2ea('0x2c')]);_0x543f9b['query']=_[_0xc2ea('0x45')](_0x5dac69[_0xc2ea('0x32')]);_0x543f9b[_0xc2ea('0x33')]=_[_0xc2ea('0x34')](_0x543f9b['model'],_0x543f9b['query']);_0x5a5e41['attributes']=_['intersection'](_0x543f9b['model'],qs[_0xc2ea('0x35')](_0x5dac69['query'][_0xc2ea('0x35')]));_0x5a5e41['attributes']=_0x5a5e41[_0xc2ea('0x36')]['length']?_0x5a5e41[_0xc2ea('0x36')]:_0x543f9b[_0xc2ea('0x30')];_0x5a5e41['order']=qs['sort'](_0x5dac69[_0xc2ea('0x32')][_0xc2ea('0x3a')]);_0x5a5e41['where']=qs[_0xc2ea('0x33')](_[_0xc2ea('0x4e')](_0x5dac69['query'],_0x543f9b[_0xc2ea('0x33')]));if(_0x5dac69[_0xc2ea('0x32')]['filter']){_0x5a5e41['where']=_[_0xc2ea('0x3d')](_0x5a5e41[_0xc2ea('0x3b')],{'$or':_[_0xc2ea('0x31')](_0x5a5e41[_0xc2ea('0x36')],function(_0x361d54){var _0x1fd89c={};_0x1fd89c[_0x361d54]={'$like':'%'+_0x5dac69['query'][_0xc2ea('0x3c')]+'%'};return _0x1fd89c;})});}_0x5a5e41=_['merge']({},_0x5a5e41,_0x5dac69['options']);return _0x573e68[_0xc2ea('0x4b')](_0x5a5e41);}})[_0xc2ea('0x24')](function(_0x10597a){if(_0x10597a){_0x47e222=_0x10597a['length'];if(!_0x5dac69[_0xc2ea('0x32')][_0xc2ea('0x38')]('nolimit')){_0x5a5e41['limit']=qs[_0xc2ea('0x1f')](_0x5dac69['query'][_0xc2ea('0x1f')]);_0x5a5e41[_0xc2ea('0x1d')]=qs[_0xc2ea('0x1d')](_0x5dac69[_0xc2ea('0x32')][_0xc2ea('0x1d')]);}return _0x573e68['getFields'](_0x5a5e41);}})[_0xc2ea('0x24')](function(_0x457d72){if(_0x457d72){return _0x457d72?{'count':_0x47e222,'rows':_0x457d72}:null;}})['then'](respondWithResult(_0x3eb1ec,null))[_0xc2ea('0x46')](handleError(_0x3eb1ec,null));};exports[_0xc2ea('0x4f')]=function(_0x296b8e,_0x8bca8d,_0x1e83e6){var _0x38ae22={};var _0x413f63={};var _0x3740bb;var _0x380acd;return db[_0xc2ea('0x2b')][_0xc2ea('0x4c')]({'where':{'id':_0x296b8e[_0xc2ea('0x44')]['id']}})[_0xc2ea('0x24')](handleEntityNotFound(_0x8bca8d,null))[_0xc2ea('0x24')](function(_0x47e669){if(_0x47e669){_0x3740bb=_0x47e669;_0x413f63[_0xc2ea('0x30')]=_[_0xc2ea('0x45')](db[_0xc2ea('0x4d')][_0xc2ea('0x2c')]);_0x413f63[_0xc2ea('0x32')]=_[_0xc2ea('0x45')](_0x296b8e[_0xc2ea('0x32')]);_0x413f63['filters']=_[_0xc2ea('0x34')](_0x413f63[_0xc2ea('0x30')],_0x413f63['query']);_0x38ae22['attributes']=_[_0xc2ea('0x34')](_0x413f63[_0xc2ea('0x30')],qs['fields'](_0x296b8e[_0xc2ea('0x32')][_0xc2ea('0x35')]));_0x38ae22[_0xc2ea('0x36')]=_0x38ae22[_0xc2ea('0x36')][_0xc2ea('0x37')]?_0x38ae22[_0xc2ea('0x36')]:_0x413f63['model'];_0x38ae22['order']=qs[_0xc2ea('0x3a')](_0x296b8e[_0xc2ea('0x32')][_0xc2ea('0x3a')]);_0x38ae22[_0xc2ea('0x3b')]=qs[_0xc2ea('0x33')](_['pick'](_0x296b8e[_0xc2ea('0x32')],_0x413f63[_0xc2ea('0x33')]));if(_0x296b8e[_0xc2ea('0x32')]['filter']){_0x38ae22[_0xc2ea('0x3b')]=_[_0xc2ea('0x3d')](_0x38ae22['where'],{'$or':_[_0xc2ea('0x31')](_0x38ae22[_0xc2ea('0x36')],function(_0x28d961){var _0x4b5e7a={};_0x4b5e7a[_0x28d961]={'$like':'%'+_0x296b8e[_0xc2ea('0x32')]['filter']+'%'};return _0x4b5e7a;})});}_0x38ae22=_[_0xc2ea('0x3d')]({},_0x38ae22,_0x296b8e['options']);return _0x3740bb[_0xc2ea('0x4f')](_0x38ae22);}})['then'](function(_0x4f940d){if(_0x4f940d){_0x380acd=_0x4f940d['length'];if(!_0x296b8e['query'][_0xc2ea('0x38')]('nolimit')){_0x38ae22[_0xc2ea('0x1f')]=qs[_0xc2ea('0x1f')](_0x296b8e['query'][_0xc2ea('0x1f')]);_0x38ae22['offset']=qs['offset'](_0x296b8e[_0xc2ea('0x32')][_0xc2ea('0x1d')]);}return _0x3740bb[_0xc2ea('0x4f')](_0x38ae22);}})[_0xc2ea('0x24')](function(_0x36f92e){if(_0x36f92e){return _0x36f92e?{'count':_0x380acd,'rows':_0x36f92e}:null;}})[_0xc2ea('0x24')](respondWithResult(_0x8bca8d,null))[_0xc2ea('0x46')](handleError(_0x8bca8d,null));};exports[_0xc2ea('0x50')]=function(_0x12cc3f,_0x39547b,_0x262178){var _0x3e77c4={};var _0x47204c={};var _0x2e56b4;var _0x864af;return db[_0xc2ea('0x2b')][_0xc2ea('0x4c')]({'where':{'id':_0x12cc3f[_0xc2ea('0x44')]['id']}})[_0xc2ea('0x24')](handleEntityNotFound(_0x39547b,null))[_0xc2ea('0x24')](function(_0x3f41ef){if(_0x3f41ef){_0x2e56b4=_0x3f41ef;_0x47204c[_0xc2ea('0x30')]=_[_0xc2ea('0x45')](db[_0xc2ea('0x4d')][_0xc2ea('0x2c')]);_0x47204c[_0xc2ea('0x32')]=_[_0xc2ea('0x45')](_0x12cc3f[_0xc2ea('0x32')]);_0x47204c[_0xc2ea('0x33')]=_[_0xc2ea('0x34')](_0x47204c[_0xc2ea('0x30')],_0x47204c[_0xc2ea('0x32')]);_0x3e77c4[_0xc2ea('0x36')]=_[_0xc2ea('0x34')](_0x47204c[_0xc2ea('0x30')],qs[_0xc2ea('0x35')](_0x12cc3f[_0xc2ea('0x32')][_0xc2ea('0x35')]));_0x3e77c4['attributes']=_0x3e77c4[_0xc2ea('0x36')][_0xc2ea('0x37')]?_0x3e77c4[_0xc2ea('0x36')]:_0x47204c[_0xc2ea('0x30')];_0x3e77c4[_0xc2ea('0x39')]=qs[_0xc2ea('0x3a')](_0x12cc3f[_0xc2ea('0x32')][_0xc2ea('0x3a')]);_0x3e77c4[_0xc2ea('0x3b')]=qs['filters'](_[_0xc2ea('0x4e')](_0x12cc3f[_0xc2ea('0x32')],_0x47204c[_0xc2ea('0x33')]));if(_0x12cc3f[_0xc2ea('0x32')][_0xc2ea('0x3c')]){_0x3e77c4[_0xc2ea('0x3b')]=_['merge'](_0x3e77c4[_0xc2ea('0x3b')],{'$or':_[_0xc2ea('0x31')](_0x3e77c4['attributes'],function(_0x3f7ef2){var _0x539ce3={};_0x539ce3[_0x3f7ef2]={'$like':'%'+_0x12cc3f[_0xc2ea('0x32')][_0xc2ea('0x3c')]+'%'};return _0x539ce3;})});}_0x3e77c4=_[_0xc2ea('0x3d')]({},_0x3e77c4,_0x12cc3f[_0xc2ea('0x51')]);return _0x2e56b4['getDescriptions'](_0x3e77c4);}})[_0xc2ea('0x24')](function(_0x1fd982){if(_0x1fd982){_0x864af=_0x1fd982['length'];if(!_0x12cc3f['query'][_0xc2ea('0x38')](_0xc2ea('0x52'))){_0x3e77c4['limit']=qs[_0xc2ea('0x1f')](_0x12cc3f['query'][_0xc2ea('0x1f')]);_0x3e77c4[_0xc2ea('0x1d')]=qs[_0xc2ea('0x1d')](_0x12cc3f[_0xc2ea('0x32')][_0xc2ea('0x1d')]);}return _0x2e56b4[_0xc2ea('0x50')](_0x3e77c4);}})[_0xc2ea('0x24')](function(_0x137f2d){if(_0x137f2d){return _0x137f2d?{'count':_0x864af,'rows':_0x137f2d}:null;}})[_0xc2ea('0x24')](respondWithResult(_0x39547b,null))[_0xc2ea('0x46')](handleError(_0x39547b,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 3c44c4e..6298707 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 _0xb4e6=['path','rimraf','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x8686bd,_0x227947){var _0x3e7f2f=function(_0x6ebc2c){while(--_0x6ebc2c){_0x8686bd['push'](_0x8686bd['shift']());}};_0x3e7f2f(++_0x227947);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x9edfd5,_0x286486){_0x9edfd5=_0x9edfd5-0x0;var _0x330738=_0xb4e6[_0x9edfd5];return _0x330738;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','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(_0x59dc9e,_0x10cf0e){var _0x543383=function(_0x58d74d){while(--_0x58d74d){_0x59dc9e['push'](_0x59dc9e['shift']());}};_0x543383(++_0x10cf0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 1cbe43d..62a8b9c 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 _0x49ed=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x45c1aa,_0x2ad5c8){var _0x298eec=function(_0x37c781){while(--_0x37c781){_0x45c1aa['push'](_0x45c1aa['shift']());}};_0x298eec(++_0x2ad5c8);}(_0x49ed,0x189));var _0xd49e=function(_0x3df57e,_0x2bb480){_0x3df57e=_0x3df57e-0x0;var _0x132552=_0x49ed[_0x3df57e];return _0x132552;};'use strict';var _=require('lodash');var util=require(_0xd49e('0x0'));var moment=require(_0xd49e('0x1'));var BPromise=require(_0xd49e('0x2'));var rs=require(_0xd49e('0x3'));var fs=require('fs');var Redis=require(_0xd49e('0x4'));var db=require(_0xd49e('0x5'))['db'];var utils=require(_0xd49e('0x6'));var logger=require(_0xd49e('0x7'))(_0xd49e('0x8'));var config=require(_0xd49e('0x9'));var jayson=require(_0xd49e('0xa'));var client=jayson[_0xd49e('0xb')][_0xd49e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe3b7f3,_0x3b5d48,_0x42b6af){return new BPromise(function(_0x29cfca,_0x13d91c){return client[_0xd49e('0xd')](_0xe3b7f3,_0x42b6af)[_0xd49e('0xe')](function(_0x428b2f){logger['info'](_0xd49e('0xf'),_0x3b5d48,'request\x20sent');logger[_0xd49e('0x10')](_0xd49e('0x11'),_0x3b5d48,_0xd49e('0x12'),JSON[_0xd49e('0x13')](_0x428b2f));if(_0x428b2f[_0xd49e('0x14')]){if(_0x428b2f['error'][_0xd49e('0x15')]===0x1f4){logger[_0xd49e('0x14')](_0xd49e('0xf'),_0x3b5d48,_0x428b2f[_0xd49e('0x14')][_0xd49e('0x16')]);return _0x13d91c(_0x428b2f[_0xd49e('0x14')][_0xd49e('0x16')]);}logger['error'](_0xd49e('0xf'),_0x3b5d48,_0x428b2f['error'][_0xd49e('0x16')]);return _0x29cfca(_0x428b2f[_0xd49e('0x14')]['message']);}else{logger[_0xd49e('0x17')](_0xd49e('0xf'),_0x3b5d48,_0xd49e('0x12'));_0x29cfca(_0x428b2f[_0xd49e('0x18')][_0xd49e('0x16')]);}})['catch'](function(_0x2f1333){logger['error'](_0xd49e('0xf'),_0x3b5d48,_0x2f1333);_0x13d91c(_0x2f1333);});});} \ No newline at end of file +var _0x4bf8=['http','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','code','Dynamics365Configuration,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x205fa0,_0xb2bca8){var _0x3b9b23=function(_0x5629bb){while(--_0x5629bb){_0x205fa0['push'](_0x205fa0['shift']());}};_0x3b9b23(++_0xb2bca8);}(_0x4bf8,0x1ef));var _0x84bf=function(_0x4a57d5,_0x5e7093){_0x4a57d5=_0x4a57d5-0x0;var _0x2e210a=_0x4bf8[_0x4a57d5];return _0x2e210a;};'use strict';var _=require(_0x84bf('0x0'));var util=require('util');var moment=require(_0x84bf('0x1'));var BPromise=require(_0x84bf('0x2'));var rs=require(_0x84bf('0x3'));var fs=require('fs');var Redis=require(_0x84bf('0x4'));var db=require(_0x84bf('0x5'))['db'];var utils=require(_0x84bf('0x6'));var logger=require(_0x84bf('0x7'))(_0x84bf('0x8'));var config=require(_0x84bf('0x9'));var jayson=require(_0x84bf('0xa'));var client=jayson['client'][_0x84bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x403412,_0x57149f,_0x2ef1d8){return new BPromise(function(_0x240335,_0x402594){return client['request'](_0x403412,_0x2ef1d8)['then'](function(_0x452ce1){logger[_0x84bf('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x57149f,_0x84bf('0xd'));logger[_0x84bf('0xe')](_0x84bf('0xf'),_0x57149f,'request\x20sent',JSON['stringify'](_0x452ce1));if(_0x452ce1['error']){if(_0x452ce1['error'][_0x84bf('0x10')]===0x1f4){logger['error'](_0x84bf('0x11'),_0x57149f,_0x452ce1[_0x84bf('0x12')][_0x84bf('0x13')]);return _0x402594(_0x452ce1[_0x84bf('0x12')][_0x84bf('0x13')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x57149f,_0x452ce1['error'][_0x84bf('0x13')]);return _0x240335(_0x452ce1[_0x84bf('0x12')][_0x84bf('0x13')]);}else{logger[_0x84bf('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x57149f,_0x84bf('0xd'));_0x240335(_0x452ce1[_0x84bf('0x14')][_0x84bf('0x13')]);}})[_0x84bf('0x15')](function(_0x30a157){logger[_0x84bf('0x12')](_0x84bf('0x11'),_0x57149f,_0x30a157);_0x402594(_0x30a157);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 91474f1..52ffbe6 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 _0x778e=['../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x403c57,_0x280a51){var _0x35fa69=function(_0x13a356){while(--_0x13a356){_0x403c57['push'](_0x403c57['shift']());}};_0x35fa69(++_0x280a51);}(_0x778e,0xd3));var _0xe778=function(_0x721da2,_0x3cb98c){_0x721da2=_0x721da2-0x0;var _0x432ab1=_0x778e[_0x721da2];return _0x432ab1;};'use strict';var multer=require('multer');var util=require(_0xe778('0x0'));var path=require(_0xe778('0x1'));var timeout=require(_0xe778('0x2'));var express=require(_0xe778('0x3'));var router=express['Router']();var fs_extra=require(_0xe778('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe778('0x5'));var config=require(_0xe778('0x6'));var controller=require(_0xe778('0x7'));router[_0xe778('0x8')]('/',auth[_0xe778('0x9')](),controller[_0xe778('0xa')]);router[_0xe778('0x8')](_0xe778('0xb'),auth['isAuthenticated'](),controller[_0xe778('0xc')]);router[_0xe778('0xd')]('/',auth[_0xe778('0x9')](),controller['create']);router[_0xe778('0xe')](_0xe778('0xb'),auth[_0xe778('0x9')](),controller[_0xe778('0xf')]);router[_0xe778('0x10')]('/:id',auth[_0xe778('0x9')](),controller[_0xe778('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb288=['fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post','create','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb288,0x1f3));var _0x8b28=function(_0x440a3d,_0x2ae549){_0x440a3d=_0x440a3d-0x0;var _0x4d56c6=_0xb288[_0x440a3d];return _0x4d56c6;};'use strict';var multer=require('multer');var util=require(_0x8b28('0x0'));var path=require(_0x8b28('0x1'));var timeout=require(_0x8b28('0x2'));var express=require(_0x8b28('0x3'));var router=express[_0x8b28('0x4')]();var fs_extra=require(_0x8b28('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b28('0x6'));var config=require(_0x8b28('0x7'));var controller=require(_0x8b28('0x8'));router[_0x8b28('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b28('0xa')]);router['get'](_0x8b28('0xb'),auth[_0x8b28('0xc')](),controller[_0x8b28('0xd')]);router[_0x8b28('0xe')]('/',auth[_0x8b28('0xc')](),controller[_0x8b28('0xf')]);router['put']('/:id',auth[_0x8b28('0xc')](),controller['update']);router[_0x8b28('0x10')](_0x8b28('0xb'),auth[_0x8b28('0xc')](),controller[_0x8b28('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index dc3b1ae..199ec14 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 _0xb4d2=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x3d760c,_0x3600e1){var _0x399178=function(_0x4db7eb){while(--_0x4db7eb){_0x3d760c['push'](_0x3d760c['shift']());}};_0x399178(++_0x3600e1);}(_0xb4d2,0x1c5));var _0x2b4d=function(_0x326bf8,_0xc6a626){_0x326bf8=_0x326bf8-0x0;var _0x50fb1e=_0xb4d2[_0x326bf8];return _0x50fb1e;};'use strict';var Sequelize=require(_0x2b4d('0x0'));module[_0x2b4d('0x1')]={'type':{'type':Sequelize[_0x2b4d('0x2')]('string',_0x2b4d('0x3'),_0x2b4d('0x4'),_0x2b4d('0x5'),_0x2b4d('0x6')),'defaultValue':_0x2b4d('0x7')},'content':{'type':Sequelize[_0x2b4d('0x8')]},'key':{'type':Sequelize[_0x2b4d('0x8')]},'keyType':{'type':Sequelize[_0x2b4d('0x2')]('string',_0x2b4d('0x3'),_0x2b4d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2b4d('0x8')]},'customField':{'type':Sequelize[_0x2b4d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2b4d('0x8')]}}; \ No newline at end of file +var _0x0aef=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x163ba5,_0x17d024){var _0x14ee35=function(_0x591859){while(--_0x591859){_0x163ba5['push'](_0x163ba5['shift']());}};_0x14ee35(++_0x17d024);}(_0x0aef,0x1c8));var _0xf0ae=function(_0x43149d,_0x1a717e){_0x43149d=_0x43149d-0x0;var _0x4d4203=_0x0aef[_0x43149d];return _0x4d4203;};'use strict';var Sequelize=require(_0xf0ae('0x0'));module[_0xf0ae('0x1')]={'type':{'type':Sequelize[_0xf0ae('0x2')](_0xf0ae('0x3'),_0xf0ae('0x4'),_0xf0ae('0x5'),_0xf0ae('0x6'),_0xf0ae('0x7')),'defaultValue':_0xf0ae('0x3')},'content':{'type':Sequelize[_0xf0ae('0x8')]},'key':{'type':Sequelize[_0xf0ae('0x8')]},'keyType':{'type':Sequelize[_0xf0ae('0x2')](_0xf0ae('0x3'),_0xf0ae('0x4'),_0xf0ae('0x5'))},'keyContent':{'type':Sequelize[_0xf0ae('0x8')]},'idField':{'type':Sequelize[_0xf0ae('0x8')]},'nameField':{'type':Sequelize[_0xf0ae('0x8')]},'customField':{'type':Sequelize[_0xf0ae('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf0ae('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 83f9250..caaeb02 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 _0x166f=['index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','Dynamics365Field','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','error','stack','name','send'];(function(_0xdbdef0,_0xafc02c){var _0x13dedb=function(_0x28a2d9){while(--_0x28a2d9){_0xdbdef0['push'](_0xdbdef0['shift']());}};_0x13dedb(++_0xafc02c);}(_0x166f,0x198));var _0xf166=function(_0x3b228f,_0x2a9777){_0x3b228f=_0x3b228f-0x0;var _0x30c30e=_0x166f[_0x3b228f];return _0x30c30e;};'use strict';var emlformat=require(_0xf166('0x0'));var rimraf=require(_0xf166('0x1'));var zipdir=require(_0xf166('0x2'));var jsonpatch=require(_0xf166('0x3'));var rp=require(_0xf166('0x4'));var moment=require(_0xf166('0x5'));var BPromise=require(_0xf166('0x6'));var Mustache=require(_0xf166('0x7'));var util=require('util');var path=require(_0xf166('0x8'));var sox=require(_0xf166('0x9'));var csv=require(_0xf166('0xa'));var ejs=require(_0xf166('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf166('0xc'));var crypto=require('crypto');var jsforce=require(_0xf166('0xd'));var deskjs=require(_0xf166('0xe'));var toCsv=require(_0xf166('0xa'));var querystring=require(_0xf166('0xf'));var Papa=require(_0xf166('0x10'));var Redis=require(_0xf166('0x11'));var authService=require(_0xf166('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf166('0x13'));var logger=require(_0xf166('0x14'))(_0xf166('0x15'));var utils=require(_0xf166('0x16'));var config=require(_0xf166('0x17'));var licenseUtil=require(_0xf166('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x315bbb,_0x175c8e){_0x175c8e=_0x175c8e||0xcc;return function(_0x116120){if(_0x116120){return _0x315bbb[_0xf166('0x19')](_0x175c8e);}return _0x315bbb[_0xf166('0x1a')](_0x175c8e)[_0xf166('0x1b')]();};}function respondWithResult(_0x3f6b7e,_0x1301ec){_0x1301ec=_0x1301ec||0xc8;return function(_0x5de6fb){if(_0x5de6fb){return _0x3f6b7e[_0xf166('0x1a')](_0x1301ec)[_0xf166('0x1c')](_0x5de6fb);}};}function respondWithFilteredResult(_0x9254af,_0x2e6a8b){return function(_0x1ecfaa){if(_0x1ecfaa){var _0x5125ec=typeof _0x2e6a8b[_0xf166('0x1d')]==='undefined'&&typeof _0x2e6a8b[_0xf166('0x1e')]===_0xf166('0x1f');var _0x18c631=_0x1ecfaa[_0xf166('0x20')];var _0x1e87ac=_0x5125ec?0x0:_0x2e6a8b[_0xf166('0x1d')];var _0x33e01a=_0x5125ec?_0x1ecfaa['count']:_0x2e6a8b[_0xf166('0x1d')]+_0x2e6a8b[_0xf166('0x1e')];var _0x2db4be;if(_0x33e01a>=_0x18c631){_0x33e01a=_0x18c631;_0x2db4be=0xc8;}else{_0x2db4be=0xce;}_0x9254af[_0xf166('0x1a')](_0x2db4be);return _0x9254af[_0xf166('0x21')](_0xf166('0x22'),_0x1e87ac+'-'+_0x33e01a+'/'+_0x18c631)[_0xf166('0x1c')](_0x1ecfaa);}return null;};}function patchUpdates(_0x12a9d4){return function(_0x374d13){try{jsonpatch['apply'](_0x374d13,_0x12a9d4,!![]);}catch(_0x3e8557){return BPromise[_0xf166('0x23')](_0x3e8557);}return _0x374d13['save']();};}function saveUpdates(_0x2b1369,_0x5bf6cc){return function(_0x18699c){if(_0x18699c){return _0x18699c['update'](_0x2b1369)[_0xf166('0x24')](function(_0x8c8805){return _0x8c8805;});}return null;};}function removeEntity(_0xaf19b5,_0x3b2c8c){return function(_0x524b8c){if(_0x524b8c){return _0x524b8c[_0xf166('0x25')]()[_0xf166('0x24')](function(){_0xaf19b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a3931,_0x5a3b37){return function(_0x43393a){if(!_0x43393a){_0x3a3931[_0xf166('0x19')](0x194);}return _0x43393a;};}function handleError(_0x10b064,_0xa992ca){_0xa992ca=_0xa992ca||0x1f4;return function(_0x478b27){logger[_0xf166('0x26')](_0x478b27[_0xf166('0x27')]);if(_0x478b27[_0xf166('0x28')]){delete _0x478b27['name'];}_0x10b064[_0xf166('0x1a')](_0xa992ca)[_0xf166('0x29')](_0x478b27);};}exports[_0xf166('0x2a')]=function(_0x467a77,_0x392771){var _0x3fc451={},_0x5d3344={},_0x26fed9={'count':0x0,'rows':[]};var _0x529c26=_[_0xf166('0x2b')](db['Dynamics365Field']['rawAttributes'],function(_0x240c78){return{'name':_0x240c78[_0xf166('0x2c')],'type':_0x240c78[_0xf166('0x2d')][_0xf166('0x2e')]};});_0x5d3344[_0xf166('0x2f')]=_[_0xf166('0x2b')](_0x529c26,_0xf166('0x28'));_0x5d3344[_0xf166('0x30')]=_[_0xf166('0x31')](_0x467a77[_0xf166('0x30')]);_0x5d3344['filters']=_[_0xf166('0x32')](_0x5d3344['model'],_0x5d3344['query']);_0x3fc451['attributes']=_[_0xf166('0x32')](_0x5d3344[_0xf166('0x2f')],qs[_0xf166('0x33')](_0x467a77[_0xf166('0x30')]['fields']));_0x3fc451[_0xf166('0x34')]=_0x3fc451[_0xf166('0x34')][_0xf166('0x35')]?_0x3fc451['attributes']:_0x5d3344['model'];if(!_0x467a77['query'][_0xf166('0x36')]('nolimit')){_0x3fc451[_0xf166('0x1e')]=qs[_0xf166('0x1e')](_0x467a77[_0xf166('0x30')][_0xf166('0x1e')]);_0x3fc451[_0xf166('0x1d')]=qs['offset'](_0x467a77[_0xf166('0x30')]['offset']);}_0x3fc451[_0xf166('0x37')]=qs[_0xf166('0x38')](_0x467a77[_0xf166('0x30')][_0xf166('0x38')]);_0x3fc451[_0xf166('0x39')]=qs[_0xf166('0x3a')](_[_0xf166('0x3b')](_0x467a77['query'],_0x5d3344['filters']),_0x529c26);if(_0x467a77[_0xf166('0x30')][_0xf166('0x3c')]){_0x3fc451[_0xf166('0x39')]=_[_0xf166('0x3d')](_0x3fc451[_0xf166('0x39')],{'$or':_[_0xf166('0x2b')](_0x529c26,function(_0xe371e0){if(_0xe371e0[_0xf166('0x2d')]!==_0xf166('0x3e')){var _0x39e227={};_0x39e227[_0xe371e0['name']]={'$like':'%'+_0x467a77[_0xf166('0x30')][_0xf166('0x3c')]+'%'};return _0x39e227;}})});}_0x3fc451=_[_0xf166('0x3d')]({},_0x3fc451,_0x467a77[_0xf166('0x3f')]);var _0x2ca93a={'where':_0x3fc451[_0xf166('0x39')]};return db['Dynamics365Field'][_0xf166('0x20')](_0x2ca93a)[_0xf166('0x24')](function(_0x5a56b0){_0x26fed9[_0xf166('0x20')]=_0x5a56b0;if(_0x467a77[_0xf166('0x30')][_0xf166('0x40')]){_0x3fc451[_0xf166('0x41')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xf166('0x42')](_0x3fc451);})[_0xf166('0x24')](function(_0x3b303a){_0x26fed9[_0xf166('0x43')]=_0x3b303a;return _0x26fed9;})[_0xf166('0x24')](respondWithFilteredResult(_0x392771,_0x3fc451))['catch'](handleError(_0x392771,null));};exports[_0xf166('0x44')]=function(_0x51a5f0,_0xadf5e2){var _0x296582={'raw':!![],'where':{'id':_0x51a5f0[_0xf166('0x45')]['id']}},_0x51fe4c={};_0x51fe4c[_0xf166('0x2f')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x51fe4c[_0xf166('0x30')]=_[_0xf166('0x31')](_0x51a5f0['query']);_0x51fe4c[_0xf166('0x3a')]=_['intersection'](_0x51fe4c[_0xf166('0x2f')],_0x51fe4c[_0xf166('0x30')]);_0x296582[_0xf166('0x34')]=_[_0xf166('0x32')](_0x51fe4c[_0xf166('0x2f')],qs[_0xf166('0x33')](_0x51a5f0[_0xf166('0x30')][_0xf166('0x33')]));_0x296582[_0xf166('0x34')]=_0x296582[_0xf166('0x34')]['length']?_0x296582['attributes']:_0x51fe4c[_0xf166('0x2f')];if(_0x51a5f0['query'][_0xf166('0x40')]){_0x296582[_0xf166('0x41')]=[{'all':!![]}];}_0x296582=_[_0xf166('0x3d')]({},_0x296582,_0x51a5f0[_0xf166('0x3f')]);return db['Dynamics365Field']['find'](_0x296582)[_0xf166('0x24')](handleEntityNotFound(_0xadf5e2,null))[_0xf166('0x24')](respondWithResult(_0xadf5e2,null))[_0xf166('0x46')](handleError(_0xadf5e2,null));};exports[_0xf166('0x47')]=function(_0x56d162,_0x24c767){return db['Dynamics365Field'][_0xf166('0x47')](_0x56d162[_0xf166('0x48')],{})['then'](respondWithResult(_0x24c767,0xc9))[_0xf166('0x46')](handleError(_0x24c767,null));};exports['update']=function(_0x6a9ccc,_0x42cd7f){if(_0x6a9ccc[_0xf166('0x48')]['id']){delete _0x6a9ccc[_0xf166('0x48')]['id'];}return db[_0xf166('0x49')][_0xf166('0x4a')]({'where':{'id':_0x6a9ccc[_0xf166('0x45')]['id']}})[_0xf166('0x24')](handleEntityNotFound(_0x42cd7f,null))[_0xf166('0x24')](saveUpdates(_0x6a9ccc[_0xf166('0x48')],null))['then'](respondWithResult(_0x42cd7f,null))[_0xf166('0x46')](handleError(_0x42cd7f,null));};exports[_0xf166('0x25')]=function(_0x3a2de1,_0x3f05f9){return db[_0xf166('0x49')][_0xf166('0x4a')]({'where':{'id':_0x3a2de1[_0xf166('0x45')]['id']}})[_0xf166('0x24')](handleEntityNotFound(_0x3f05f9,null))[_0xf166('0x24')](removeEntity(_0x3f05f9,null))[_0xf166('0x46')](handleError(_0x3f05f9,null));}; \ No newline at end of file +var _0x6786=['bluebird','util','sox','to-csv','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/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Field','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','options','find','create','body','destroy','params','rimraf','zip-dir','request-promise','moment'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x6786,0x114));var _0x6678=function(_0x4e0359,_0x205155){_0x4e0359=_0x4e0359-0x0;var _0x450f0a=_0x6786[_0x4e0359];return _0x450f0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6678('0x0'));var zipdir=require(_0x6678('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6678('0x2'));var moment=require(_0x6678('0x3'));var BPromise=require(_0x6678('0x4'));var Mustache=require('mustache');var util=require(_0x6678('0x5'));var path=require('path');var sox=require(_0x6678('0x6'));var csv=require(_0x6678('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6678('0x8'));var squel=require('squel');var crypto=require(_0x6678('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6678('0xa'));var toCsv=require(_0x6678('0x7'));var querystring=require(_0x6678('0xb'));var Papa=require(_0x6678('0xc'));var Redis=require(_0x6678('0xd'));var authService=require(_0x6678('0xe'));var qs=require(_0x6678('0xf'));var as=require(_0x6678('0x10'));var hardwareService=require(_0x6678('0x11'));var logger=require(_0x6678('0x12'))(_0x6678('0x13'));var utils=require(_0x6678('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6678('0x15'));var db=require(_0x6678('0x16'))['db'];function respondWithStatusCode(_0x2d71c4,_0xf99f9c){_0xf99f9c=_0xf99f9c||0xcc;return function(_0x4a505d){if(_0x4a505d){return _0x2d71c4[_0x6678('0x17')](_0xf99f9c);}return _0x2d71c4[_0x6678('0x18')](_0xf99f9c)[_0x6678('0x19')]();};}function respondWithResult(_0x585d90,_0x4b45bf){_0x4b45bf=_0x4b45bf||0xc8;return function(_0x4c0a7f){if(_0x4c0a7f){return _0x585d90[_0x6678('0x18')](_0x4b45bf)[_0x6678('0x1a')](_0x4c0a7f);}};}function respondWithFilteredResult(_0x1fd1f6,_0x376e0b){return function(_0x5d7e9f){if(_0x5d7e9f){var _0x1ff7be=typeof _0x376e0b['offset']===_0x6678('0x1b')&&typeof _0x376e0b[_0x6678('0x1c')]===_0x6678('0x1b');var _0x46ae15=_0x5d7e9f['count'];var _0x401623=_0x1ff7be?0x0:_0x376e0b['offset'];var _0x361668=_0x1ff7be?_0x5d7e9f[_0x6678('0x1d')]:_0x376e0b['offset']+_0x376e0b[_0x6678('0x1c')];var _0x29344f;if(_0x361668>=_0x46ae15){_0x361668=_0x46ae15;_0x29344f=0xc8;}else{_0x29344f=0xce;}_0x1fd1f6[_0x6678('0x18')](_0x29344f);return _0x1fd1f6[_0x6678('0x1e')]('Content-Range',_0x401623+'-'+_0x361668+'/'+_0x46ae15)[_0x6678('0x1a')](_0x5d7e9f);}return null;};}function patchUpdates(_0x3a3e10){return function(_0x166d5f){try{jsonpatch['apply'](_0x166d5f,_0x3a3e10,!![]);}catch(_0x120641){return BPromise[_0x6678('0x1f')](_0x120641);}return _0x166d5f[_0x6678('0x20')]();};}function saveUpdates(_0x39a5fa,_0x4dad60){return function(_0x2ec066){if(_0x2ec066){return _0x2ec066[_0x6678('0x21')](_0x39a5fa)[_0x6678('0x22')](function(_0x1abbab){return _0x1abbab;});}return null;};}function removeEntity(_0x330c6b,_0x18ae13){return function(_0x5d6994){if(_0x5d6994){return _0x5d6994['destroy']()['then'](function(){_0x330c6b[_0x6678('0x18')](0xcc)[_0x6678('0x19')]();});}};}function handleEntityNotFound(_0x188f21,_0x57849a){return function(_0x5ef5aa){if(!_0x5ef5aa){_0x188f21[_0x6678('0x17')](0x194);}return _0x5ef5aa;};}function handleError(_0x282493,_0x551f68){_0x551f68=_0x551f68||0x1f4;return function(_0x2dd8b8){logger[_0x6678('0x23')](_0x2dd8b8[_0x6678('0x24')]);if(_0x2dd8b8['name']){delete _0x2dd8b8[_0x6678('0x25')];}_0x282493[_0x6678('0x18')](_0x551f68)[_0x6678('0x26')](_0x2dd8b8);};}exports[_0x6678('0x27')]=function(_0x1e224f,_0x383437){var _0x3ca4e4={},_0x116ba2={},_0xdca249={'count':0x0,'rows':[]};var _0x3680a6=_[_0x6678('0x28')](db[_0x6678('0x29')]['rawAttributes'],function(_0x5c4f05){return{'name':_0x5c4f05['fieldName'],'type':_0x5c4f05[_0x6678('0x2a')][_0x6678('0x2b')]};});_0x116ba2[_0x6678('0x2c')]=_['map'](_0x3680a6,'name');_0x116ba2['query']=_['keys'](_0x1e224f[_0x6678('0x2d')]);_0x116ba2[_0x6678('0x2e')]=_[_0x6678('0x2f')](_0x116ba2[_0x6678('0x2c')],_0x116ba2['query']);_0x3ca4e4[_0x6678('0x30')]=_['intersection'](_0x116ba2[_0x6678('0x2c')],qs[_0x6678('0x31')](_0x1e224f[_0x6678('0x2d')][_0x6678('0x31')]));_0x3ca4e4[_0x6678('0x30')]=_0x3ca4e4['attributes'][_0x6678('0x32')]?_0x3ca4e4[_0x6678('0x30')]:_0x116ba2[_0x6678('0x2c')];if(!_0x1e224f[_0x6678('0x2d')][_0x6678('0x33')](_0x6678('0x34'))){_0x3ca4e4['limit']=qs['limit'](_0x1e224f['query']['limit']);_0x3ca4e4['offset']=qs[_0x6678('0x35')](_0x1e224f[_0x6678('0x2d')][_0x6678('0x35')]);}_0x3ca4e4[_0x6678('0x36')]=qs[_0x6678('0x37')](_0x1e224f[_0x6678('0x2d')][_0x6678('0x37')]);_0x3ca4e4[_0x6678('0x38')]=qs[_0x6678('0x2e')](_['pick'](_0x1e224f[_0x6678('0x2d')],_0x116ba2[_0x6678('0x2e')]),_0x3680a6);if(_0x1e224f[_0x6678('0x2d')][_0x6678('0x39')]){_0x3ca4e4[_0x6678('0x38')]=_['merge'](_0x3ca4e4['where'],{'$or':_[_0x6678('0x28')](_0x3680a6,function(_0x4eccef){if(_0x4eccef[_0x6678('0x2a')]!==_0x6678('0x3a')){var _0xdb508={};_0xdb508[_0x4eccef[_0x6678('0x25')]]={'$like':'%'+_0x1e224f['query'][_0x6678('0x39')]+'%'};return _0xdb508;}})});}_0x3ca4e4=_[_0x6678('0x3b')]({},_0x3ca4e4,_0x1e224f['options']);var _0x625118={'where':_0x3ca4e4['where']};return db['Dynamics365Field'][_0x6678('0x1d')](_0x625118)['then'](function(_0x2e9b59){_0xdca249[_0x6678('0x1d')]=_0x2e9b59;if(_0x1e224f[_0x6678('0x2d')][_0x6678('0x3c')]){_0x3ca4e4[_0x6678('0x3d')]=[{'all':!![]}];}return db[_0x6678('0x29')][_0x6678('0x3e')](_0x3ca4e4);})[_0x6678('0x22')](function(_0x43c0d0){_0xdca249['rows']=_0x43c0d0;return _0xdca249;})['then'](respondWithFilteredResult(_0x383437,_0x3ca4e4))[_0x6678('0x3f')](handleError(_0x383437,null));};exports['show']=function(_0x4effab,_0x40984a){var _0x2d7f8f={'raw':!![],'where':{'id':_0x4effab['params']['id']}},_0x455fa5={};_0x455fa5['model']=_['keys'](db[_0x6678('0x29')]['rawAttributes']);_0x455fa5['query']=_['keys'](_0x4effab['query']);_0x455fa5['filters']=_[_0x6678('0x2f')](_0x455fa5[_0x6678('0x2c')],_0x455fa5[_0x6678('0x2d')]);_0x2d7f8f[_0x6678('0x30')]=_[_0x6678('0x2f')](_0x455fa5['model'],qs[_0x6678('0x31')](_0x4effab[_0x6678('0x2d')][_0x6678('0x31')]));_0x2d7f8f[_0x6678('0x30')]=_0x2d7f8f['attributes'][_0x6678('0x32')]?_0x2d7f8f['attributes']:_0x455fa5['model'];if(_0x4effab[_0x6678('0x2d')][_0x6678('0x3c')]){_0x2d7f8f[_0x6678('0x3d')]=[{'all':!![]}];}_0x2d7f8f=_['merge']({},_0x2d7f8f,_0x4effab[_0x6678('0x40')]);return db[_0x6678('0x29')][_0x6678('0x41')](_0x2d7f8f)['then'](handleEntityNotFound(_0x40984a,null))[_0x6678('0x22')](respondWithResult(_0x40984a,null))['catch'](handleError(_0x40984a,null));};exports[_0x6678('0x42')]=function(_0x214ca6,_0x587db2){return db[_0x6678('0x29')][_0x6678('0x42')](_0x214ca6[_0x6678('0x43')],{})['then'](respondWithResult(_0x587db2,0xc9))['catch'](handleError(_0x587db2,null));};exports[_0x6678('0x21')]=function(_0x53f983,_0x9a2b22){if(_0x53f983[_0x6678('0x43')]['id']){delete _0x53f983[_0x6678('0x43')]['id'];}return db[_0x6678('0x29')]['find']({'where':{'id':_0x53f983['params']['id']}})['then'](handleEntityNotFound(_0x9a2b22,null))['then'](saveUpdates(_0x53f983[_0x6678('0x43')],null))[_0x6678('0x22')](respondWithResult(_0x9a2b22,null))[_0x6678('0x3f')](handleError(_0x9a2b22,null));};exports[_0x6678('0x44')]=function(_0x3003e2,_0x156fbe){return db[_0x6678('0x29')][_0x6678('0x41')]({'where':{'id':_0x3003e2[_0x6678('0x45')]['id']}})['then'](handleEntityNotFound(_0x156fbe,null))[_0x6678('0x22')](removeEntity(_0x156fbe,null))[_0x6678('0x3f')](handleError(_0x156fbe,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 6984963..ef2707b 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 _0x734b=['Dynamics365Field','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0x734b,0x189));var _0xb734=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x734b[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0xb734('0x0'));var util=require(_0xb734('0x1'));var logger=require(_0xb734('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb734('0x3'));var rp=require(_0xb734('0x4'));var fs=require('fs');var path=require(_0xb734('0x5'));var rimraf=require(_0xb734('0x6'));var config=require(_0xb734('0x7'));var attributes=require('./intDynamics365Field.attributes');module[_0xb734('0x8')]=function(_0xb6d4a4,_0x2a6194){return _0xb6d4a4[_0xb734('0x9')](_0xb734('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xb734('0xb'),_0xb734('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x302a=['exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x302a,0x1e6));var _0xa302=function(_0x15899b,_0x1c888a){_0x15899b=_0x15899b-0x0;var _0x2383b9=_0x302a[_0x15899b];return _0x2383b9;};'use strict';var _=require(_0xa302('0x0'));var util=require(_0xa302('0x1'));var logger=require(_0xa302('0x2'))(_0xa302('0x3'));var moment=require(_0xa302('0x4'));var BPromise=require('bluebird');var rp=require(_0xa302('0x5'));var fs=require('fs');var path=require(_0xa302('0x6'));var rimraf=require(_0xa302('0x7'));var config=require(_0xa302('0x8'));var attributes=require(_0xa302('0x9'));module[_0xa302('0xa')]=function(_0x2e7699,_0x166c2a){return _0x2e7699[_0xa302('0xb')](_0xa302('0xc'),attributes,{'tableName':_0xa302('0xd'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xa302('0xe'),_0xa302('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 4a138aa..cabd6a1 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 _0xd8ac=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x42919a,_0xc47bf2){var _0x2e8eb3=function(_0x4c7ee4){while(--_0x4c7ee4){_0x42919a['push'](_0x42919a['shift']());}};_0x2e8eb3(++_0xc47bf2);}(_0xd8ac,0x8a));var _0xcd8a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd8ac[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xcd8a('0x0'));var util=require(_0xcd8a('0x1'));var moment=require(_0xcd8a('0x2'));var BPromise=require(_0xcd8a('0x3'));var rs=require(_0xcd8a('0x4'));var fs=require('fs');var Redis=require(_0xcd8a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd8a('0x6'));var logger=require('../../config/logger')(_0xcd8a('0x7'));var config=require(_0xcd8a('0x8'));var jayson=require(_0xcd8a('0x9'));var client=jayson[_0xcd8a('0xa')][_0xcd8a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18b470,_0x56d2d7,_0x28fa86){return new BPromise(function(_0x1dfcbb,_0x186ce1){return client[_0xcd8a('0xc')](_0x18b470,_0x28fa86)[_0xcd8a('0xd')](function(_0x281a42){logger[_0xcd8a('0xe')](_0xcd8a('0xf'),_0x56d2d7,_0xcd8a('0x10'));logger[_0xcd8a('0x11')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x56d2d7,_0xcd8a('0x10'),JSON[_0xcd8a('0x12')](_0x281a42));if(_0x281a42[_0xcd8a('0x13')]){if(_0x281a42[_0xcd8a('0x13')][_0xcd8a('0x14')]===0x1f4){logger[_0xcd8a('0x13')](_0xcd8a('0xf'),_0x56d2d7,_0x281a42[_0xcd8a('0x13')][_0xcd8a('0x15')]);return _0x186ce1(_0x281a42[_0xcd8a('0x13')][_0xcd8a('0x15')]);}logger[_0xcd8a('0x13')](_0xcd8a('0xf'),_0x56d2d7,_0x281a42[_0xcd8a('0x13')][_0xcd8a('0x15')]);return _0x1dfcbb(_0x281a42['error']['message']);}else{logger[_0xcd8a('0xe')](_0xcd8a('0xf'),_0x56d2d7,_0xcd8a('0x10'));_0x1dfcbb(_0x281a42[_0xcd8a('0x16')]['message']);}})['catch'](function(_0x2846c3){logger[_0xcd8a('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x56d2d7,_0x2846c3);_0x186ce1(_0x2846c3);});});} \ No newline at end of file +var _0x58a3=['client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x35e3d1,_0x584659){var _0x4943a6=function(_0x33d078){while(--_0x33d078){_0x35e3d1['push'](_0x35e3d1['shift']());}};_0x4943a6(++_0x584659);}(_0x58a3,0x73));var _0x358a=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x58a3[_0x39e164];return _0x13fa6b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x358a('0x0'));var rs=require(_0x358a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x358a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x358a('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x358a('0x4'));var client=jayson[_0x358a('0x5')][_0x358a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x26612c,_0x44cc3f,_0x64626f){return new BPromise(function(_0x35838e,_0x2508b5){return client[_0x358a('0x7')](_0x26612c,_0x64626f)[_0x358a('0x8')](function(_0x275f7a){logger[_0x358a('0x9')](_0x358a('0xa'),_0x44cc3f,_0x358a('0xb'));logger[_0x358a('0xc')](_0x358a('0xd'),_0x44cc3f,_0x358a('0xb'),JSON[_0x358a('0xe')](_0x275f7a));if(_0x275f7a['error']){if(_0x275f7a['error'][_0x358a('0xf')]===0x1f4){logger[_0x358a('0x10')](_0x358a('0xa'),_0x44cc3f,_0x275f7a[_0x358a('0x10')]['message']);return _0x2508b5(_0x275f7a[_0x358a('0x10')][_0x358a('0x11')]);}logger[_0x358a('0x10')](_0x358a('0xa'),_0x44cc3f,_0x275f7a[_0x358a('0x10')][_0x358a('0x11')]);return _0x35838e(_0x275f7a[_0x358a('0x10')][_0x358a('0x11')]);}else{logger['info'](_0x358a('0xa'),_0x44cc3f,_0x358a('0xb'));_0x35838e(_0x275f7a[_0x358a('0x12')][_0x358a('0x11')]);}})[_0x358a('0x13')](function(_0x595d11){logger[_0x358a('0x10')](_0x358a('0xa'),_0x44cc3f,_0x595d11);_0x2508b5(_0x595d11);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index cbf53c4..ac8e9d2 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 _0xcb48=['isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get'];(function(_0x10e76c,_0xb868f6){var _0x1becd7=function(_0x33191f){while(--_0x33191f){_0x10e76c['push'](_0x10e76c['shift']());}};_0x1becd7(++_0xb868f6);}(_0xcb48,0x6d));var _0x8cb4=function(_0xe121d1,_0x4f70a9){_0xe121d1=_0xe121d1-0x0;var _0x26818f=_0xcb48[_0xe121d1];return _0x26818f;};'use strict';var multer=require(_0x8cb4('0x0'));var util=require(_0x8cb4('0x1'));var path=require(_0x8cb4('0x2'));var timeout=require(_0x8cb4('0x3'));var express=require(_0x8cb4('0x4'));var router=express[_0x8cb4('0x5')]();var fs_extra=require(_0x8cb4('0x6'));var auth=require(_0x8cb4('0x7'));var interaction=require(_0x8cb4('0x8'));var config=require('../../config/environment');var controller=require(_0x8cb4('0x9'));router[_0x8cb4('0xa')]('/',auth[_0x8cb4('0xb')](),controller[_0x8cb4('0xc')]);router[_0x8cb4('0xa')](_0x8cb4('0xd'),auth['isAuthenticated'](),controller[_0x8cb4('0xe')]);router[_0x8cb4('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8cb4('0xf')]);router[_0x8cb4('0xa')](_0x8cb4('0x10'),auth[_0x8cb4('0xb')](),controller['getFields']);router[_0x8cb4('0x11')]('/',auth[_0x8cb4('0xb')](),controller[_0x8cb4('0x12')]);router[_0x8cb4('0x11')](_0x8cb4('0x13'),auth[_0x8cb4('0xb')](),controller['addConfiguration']);router[_0x8cb4('0x14')](_0x8cb4('0xd'),auth[_0x8cb4('0xb')](),controller[_0x8cb4('0x15')]);router[_0x8cb4('0x16')]('/:id',auth[_0x8cb4('0xb')](),controller['destroy']);module[_0x8cb4('0x17')]=router; \ No newline at end of file +var _0x3c82=['path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0x3c82,0x157));var _0x23c8=function(_0x28ea86,_0x15dee1){_0x28ea86=_0x28ea86-0x0;var _0x45bf56=_0x3c82[_0x28ea86];return _0x45bf56;};'use strict';var multer=require(_0x23c8('0x0'));var util=require(_0x23c8('0x1'));var path=require(_0x23c8('0x2'));var timeout=require(_0x23c8('0x3'));var express=require(_0x23c8('0x4'));var router=express['Router']();var fs_extra=require(_0x23c8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x23c8('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0x23c8('0x7')]('/',auth[_0x23c8('0x8')](),controller[_0x23c8('0x9')]);router[_0x23c8('0x7')](_0x23c8('0xa'),auth[_0x23c8('0x8')](),controller[_0x23c8('0xb')]);router[_0x23c8('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x23c8('0xc')]);router['get'](_0x23c8('0xd'),auth[_0x23c8('0x8')](),controller[_0x23c8('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x23c8('0xf')]);router['post'](_0x23c8('0x10'),auth['isAuthenticated'](),controller[_0x23c8('0x11')]);router[_0x23c8('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x23c8('0x13')]);router[_0x23c8('0x14')]('/:id',auth[_0x23c8('0x8')](),controller[_0x23c8('0x15')]);module[_0x23c8('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 7605460..b42dc94 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 _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x52429d,_0x226326){var _0x19759c=function(_0x44a11b){while(--_0x44a11b){_0x52429d['push'](_0x52429d['shift']());}};_0x19759c(++_0x226326);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x47da79,_0x586ee3){_0x47da79=_0x47da79-0x0;var _0x455a0f=_0x4e2e[_0x47da79];return _0x455a0f;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa456=['STRING','username','sequelize','exports'];(function(_0x1b0a9f,_0x49e369){var _0x1c6650=function(_0x2d7335){while(--_0x2d7335){_0x1b0a9f['push'](_0x1b0a9f['shift']());}};_0x1c6650(++_0x49e369);}(_0xa456,0x142));var _0x6a45=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xa456[_0x476bf4];return _0x788ffe;};'use strict';var Sequelize=require(_0x6a45('0x0'));module[_0x6a45('0x1')]={'name':{'type':Sequelize[_0x6a45('0x2')]},'description':{'type':Sequelize[_0x6a45('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6a45('0x3')},'apiKey':{'type':Sequelize[_0x6a45('0x2')]},'remoteUri':{'type':Sequelize[_0x6a45('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6a45('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 948102b..35a5b7c 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 _0x2ca5=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','rows','params','find','catch','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','group','source','remove','includes','default','custom_dropdown','label','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x2ca5,0x108));var _0x52ca=function(_0xc812a0,_0x37a9d3){_0xc812a0=_0xc812a0-0x0;var _0x14f339=_0x2ca5[_0xc812a0];return _0x14f339;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52ca('0x0'));var zipdir=require(_0x52ca('0x1'));var jsonpatch=require(_0x52ca('0x2'));var rp=require('request-promise');var moment=require(_0x52ca('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x52ca('0x4'));var path=require(_0x52ca('0x5'));var sox=require(_0x52ca('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x52ca('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x52ca('0x8'));var deskjs=require(_0x52ca('0x9'));var toCsv=require(_0x52ca('0xa'));var querystring=require(_0x52ca('0xb'));var Papa=require(_0x52ca('0xc'));var Redis=require(_0x52ca('0xd'));var authService=require(_0x52ca('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x52ca('0xf'));var hardwareService=require(_0x52ca('0x10'));var logger=require(_0x52ca('0x11'))(_0x52ca('0x12'));var utils=require(_0x52ca('0x13'));var config=require(_0x52ca('0x14'));var licenseUtil=require(_0x52ca('0x15'));var db=require(_0x52ca('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x630ea2,_0x3471f8){_0x3471f8=_0x3471f8||0xcc;return function(_0x31a9a8){if(_0x31a9a8){return _0x630ea2[_0x52ca('0x17')](_0x3471f8);}return _0x630ea2[_0x52ca('0x18')](_0x3471f8)[_0x52ca('0x19')]();};}function respondWithResult(_0x12982b,_0x42ec50){_0x42ec50=_0x42ec50||0xc8;return function(_0x36d0e8){if(_0x36d0e8){return _0x12982b['status'](_0x42ec50)['json'](_0x36d0e8);}};}function respondWithFilteredResult(_0x26e83b,_0x83f3bb){return function(_0x10f302){if(_0x10f302){var _0x8d230=typeof _0x83f3bb[_0x52ca('0x1a')]===_0x52ca('0x1b')&&typeof _0x83f3bb[_0x52ca('0x1c')]===_0x52ca('0x1b');var _0x3442f1=_0x10f302[_0x52ca('0x1d')];var _0x390cef=_0x8d230?0x0:_0x83f3bb['offset'];var _0x328ae3=_0x8d230?_0x10f302[_0x52ca('0x1d')]:_0x83f3bb[_0x52ca('0x1a')]+_0x83f3bb[_0x52ca('0x1c')];var _0x3fc685;if(_0x328ae3>=_0x3442f1){_0x328ae3=_0x3442f1;_0x3fc685=0xc8;}else{_0x3fc685=0xce;}_0x26e83b[_0x52ca('0x18')](_0x3fc685);return _0x26e83b[_0x52ca('0x1e')](_0x52ca('0x1f'),_0x390cef+'-'+_0x328ae3+'/'+_0x3442f1)[_0x52ca('0x20')](_0x10f302);}return null;};}function patchUpdates(_0x9b383a){return function(_0x4492ca){try{jsonpatch['apply'](_0x4492ca,_0x9b383a,!![]);}catch(_0x2d139f){return BPromise[_0x52ca('0x21')](_0x2d139f);}return _0x4492ca[_0x52ca('0x22')]();};}function saveUpdates(_0x1e5d58,_0x42bf69){return function(_0x2ea090){if(_0x2ea090){return _0x2ea090[_0x52ca('0x23')](_0x1e5d58)['then'](function(_0x3d100a){return _0x3d100a;});}return null;};}function removeEntity(_0xc2a75f,_0x3719ad){return function(_0x18f919){if(_0x18f919){return _0x18f919[_0x52ca('0x24')]()[_0x52ca('0x25')](function(){_0xc2a75f[_0x52ca('0x18')](0xcc)[_0x52ca('0x19')]();});}};}function handleEntityNotFound(_0x54b05e,_0x4f9ed4){return function(_0x303464){if(!_0x303464){_0x54b05e['sendStatus'](0x194);}return _0x303464;};}function handleError(_0x27cc1f,_0x1b67d8){_0x1b67d8=_0x1b67d8||0x1f4;return function(_0x5c4abc){logger[_0x52ca('0x26')](_0x5c4abc[_0x52ca('0x27')]);if(_0x5c4abc[_0x52ca('0x28')]){delete _0x5c4abc[_0x52ca('0x28')];}_0x27cc1f['status'](_0x1b67d8)[_0x52ca('0x29')](_0x5c4abc);};}exports[_0x52ca('0x2a')]=function(_0x551dea,_0x4e9a2a){var _0x25ea10={},_0x55f177={},_0x1b1d8f={'count':0x0,'rows':[]};var _0x18fea7=_[_0x52ca('0x2b')](db[_0x52ca('0x2c')][_0x52ca('0x2d')],function(_0x161e78){return{'name':_0x161e78[_0x52ca('0x2e')],'type':_0x161e78[_0x52ca('0x2f')][_0x52ca('0x30')]};});_0x55f177['model']=_[_0x52ca('0x2b')](_0x18fea7,_0x52ca('0x28'));_0x55f177[_0x52ca('0x31')]=_[_0x52ca('0x32')](_0x551dea['query']);_0x55f177[_0x52ca('0x33')]=_[_0x52ca('0x34')](_0x55f177[_0x52ca('0x35')],_0x55f177[_0x52ca('0x31')]);_0x25ea10[_0x52ca('0x36')]=_['intersection'](_0x55f177[_0x52ca('0x35')],qs[_0x52ca('0x37')](_0x551dea[_0x52ca('0x31')][_0x52ca('0x37')]));_0x25ea10[_0x52ca('0x36')]=_0x25ea10['attributes'][_0x52ca('0x38')]?_0x25ea10[_0x52ca('0x36')]:_0x55f177[_0x52ca('0x35')];if(!_0x551dea[_0x52ca('0x31')][_0x52ca('0x39')](_0x52ca('0x3a'))){_0x25ea10[_0x52ca('0x1c')]=qs['limit'](_0x551dea[_0x52ca('0x31')]['limit']);_0x25ea10[_0x52ca('0x1a')]=qs[_0x52ca('0x1a')](_0x551dea[_0x52ca('0x31')][_0x52ca('0x1a')]);}_0x25ea10[_0x52ca('0x3b')]=qs['sort'](_0x551dea[_0x52ca('0x31')][_0x52ca('0x3c')]);_0x25ea10[_0x52ca('0x3d')]=qs['filters'](_[_0x52ca('0x3e')](_0x551dea[_0x52ca('0x31')],_0x55f177[_0x52ca('0x33')]),_0x18fea7);if(_0x551dea[_0x52ca('0x31')][_0x52ca('0x3f')]){_0x25ea10[_0x52ca('0x3d')]=_['merge'](_0x25ea10[_0x52ca('0x3d')],{'$or':_[_0x52ca('0x2b')](_0x18fea7,function(_0x4c9d69){if(_0x4c9d69[_0x52ca('0x2f')]!==_0x52ca('0x40')){var _0x2d892c={};_0x2d892c[_0x4c9d69[_0x52ca('0x28')]]={'$like':'%'+_0x551dea[_0x52ca('0x31')][_0x52ca('0x3f')]+'%'};return _0x2d892c;}})});}_0x25ea10=_[_0x52ca('0x41')]({},_0x25ea10,_0x551dea[_0x52ca('0x42')]);var _0xea976c={'where':_0x25ea10['where']};return db[_0x52ca('0x2c')]['count'](_0xea976c)[_0x52ca('0x25')](function(_0x110ca7){_0x1b1d8f[_0x52ca('0x1d')]=_0x110ca7;if(_0x551dea[_0x52ca('0x31')]['includeAll']){_0x25ea10['include']=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x25ea10);})[_0x52ca('0x25')](function(_0x3b6954){_0x1b1d8f[_0x52ca('0x43')]=_0x3b6954;return _0x1b1d8f;})[_0x52ca('0x25')](respondWithFilteredResult(_0x4e9a2a,_0x25ea10))['catch'](handleError(_0x4e9a2a,null));};exports['show']=function(_0x1e8d16,_0x2c5787){var _0xd756d9={'raw':![],'where':{'id':_0x1e8d16[_0x52ca('0x44')]['id']}},_0x2afa53={};_0x2afa53[_0x52ca('0x35')]=_[_0x52ca('0x32')](db[_0x52ca('0x2c')][_0x52ca('0x2d')]);_0x2afa53[_0x52ca('0x31')]=_[_0x52ca('0x32')](_0x1e8d16['query']);_0x2afa53[_0x52ca('0x33')]=_['intersection'](_0x2afa53['model'],_0x2afa53[_0x52ca('0x31')]);_0xd756d9[_0x52ca('0x36')]=_[_0x52ca('0x34')](_0x2afa53['model'],qs[_0x52ca('0x37')](_0x1e8d16[_0x52ca('0x31')][_0x52ca('0x37')]));_0xd756d9[_0x52ca('0x36')]=_0xd756d9['attributes'][_0x52ca('0x38')]?_0xd756d9[_0x52ca('0x36')]:_0x2afa53['model'];if(_0x1e8d16[_0x52ca('0x31')]['includeAll']){_0xd756d9['include']=[{'all':!![]}];}_0xd756d9=_['merge']({},_0xd756d9,_0x1e8d16['options']);return db[_0x52ca('0x2c')][_0x52ca('0x45')](_0xd756d9)[_0x52ca('0x25')](handleEntityNotFound(_0x2c5787,null))['then'](respondWithResult(_0x2c5787,null))[_0x52ca('0x46')](handleError(_0x2c5787,null));};exports[_0x52ca('0x47')]=function(_0x2070f1,_0x471e35){return db[_0x52ca('0x2c')][_0x52ca('0x47')](_0x2070f1[_0x52ca('0x48')],{})[_0x52ca('0x25')](respondWithResult(_0x471e35,0xc9))[_0x52ca('0x46')](handleError(_0x471e35,null));};exports[_0x52ca('0x23')]=function(_0x1f65e2,_0x4cf6b1){if(_0x1f65e2[_0x52ca('0x48')]['id']){delete _0x1f65e2[_0x52ca('0x48')]['id'];}return db[_0x52ca('0x2c')][_0x52ca('0x45')]({'where':{'id':_0x1f65e2[_0x52ca('0x44')]['id']}})[_0x52ca('0x25')](handleEntityNotFound(_0x4cf6b1,null))[_0x52ca('0x25')](saveUpdates(_0x1f65e2[_0x52ca('0x48')],null))['then'](respondWithResult(_0x4cf6b1,null))['catch'](handleError(_0x4cf6b1,null));};exports['destroy']=function(_0x580cad,_0x4f5d18){return db[_0x52ca('0x2c')][_0x52ca('0x45')]({'where':{'id':_0x580cad[_0x52ca('0x44')]['id']}})[_0x52ca('0x25')](handleEntityNotFound(_0x4f5d18,null))['then'](removeEntity(_0x4f5d18,null))[_0x52ca('0x46')](handleError(_0x4f5d18,null));};exports[_0x52ca('0x49')]=function(_0x3e4b9e,_0x570b60,_0x264693){var _0x47cdc9={};var _0x465776={};var _0xd2957e;var _0x43d750;return db[_0x52ca('0x2c')]['findOne']({'where':{'id':_0x3e4b9e['params']['id']}})[_0x52ca('0x25')](handleEntityNotFound(_0x570b60,null))[_0x52ca('0x25')](function(_0x2d1a93){if(_0x2d1a93){_0xd2957e=_0x2d1a93;_0x465776[_0x52ca('0x35')]=_[_0x52ca('0x32')](db['FreshdeskConfiguration'][_0x52ca('0x2d')]);_0x465776[_0x52ca('0x31')]=_[_0x52ca('0x32')](_0x3e4b9e[_0x52ca('0x31')]);_0x465776[_0x52ca('0x33')]=_['intersection'](_0x465776['model'],_0x465776[_0x52ca('0x31')]);_0x47cdc9['attributes']=_['intersection'](_0x465776[_0x52ca('0x35')],qs[_0x52ca('0x37')](_0x3e4b9e[_0x52ca('0x31')][_0x52ca('0x37')]));_0x47cdc9[_0x52ca('0x36')]=_0x47cdc9[_0x52ca('0x36')][_0x52ca('0x38')]?_0x47cdc9[_0x52ca('0x36')]:_0x465776[_0x52ca('0x35')];_0x47cdc9[_0x52ca('0x3b')]=qs['sort'](_0x3e4b9e[_0x52ca('0x31')][_0x52ca('0x3c')]);_0x47cdc9[_0x52ca('0x3d')]=qs[_0x52ca('0x33')](_[_0x52ca('0x3e')](_0x3e4b9e[_0x52ca('0x31')],_0x465776[_0x52ca('0x33')]));if(_0x3e4b9e[_0x52ca('0x31')][_0x52ca('0x3f')]){_0x47cdc9[_0x52ca('0x3d')]=_['merge'](_0x47cdc9['where'],{'$or':_[_0x52ca('0x2b')](_0x47cdc9[_0x52ca('0x36')],function(_0x9de4e8){var _0x32bf1c={};_0x32bf1c[_0x9de4e8]={'$like':'%'+_0x3e4b9e[_0x52ca('0x31')]['filter']+'%'};return _0x32bf1c;})});}_0x47cdc9=_[_0x52ca('0x41')]({},_0x47cdc9,_0x3e4b9e[_0x52ca('0x42')]);return _0xd2957e['getConfigurations'](_0x47cdc9);}})['then'](function(_0x4ed6b5){if(_0x4ed6b5){_0x43d750=_0x4ed6b5[_0x52ca('0x38')];if(!_0x3e4b9e[_0x52ca('0x31')][_0x52ca('0x39')](_0x52ca('0x3a'))){_0x47cdc9[_0x52ca('0x1c')]=qs[_0x52ca('0x1c')](_0x3e4b9e[_0x52ca('0x31')]['limit']);_0x47cdc9[_0x52ca('0x1a')]=qs[_0x52ca('0x1a')](_0x3e4b9e[_0x52ca('0x31')][_0x52ca('0x1a')]);}return _0xd2957e[_0x52ca('0x49')](_0x47cdc9);}})[_0x52ca('0x25')](function(_0x411505){if(_0x411505){return _0x411505?{'count':_0x43d750,'rows':_0x411505}:null;}})['then'](respondWithResult(_0x570b60,null))[_0x52ca('0x46')](handleError(_0x570b60,null));};exports[_0x52ca('0x4a')]=function(_0x355a23,_0x172dd3,_0xe83173){if(_0x355a23[_0x52ca('0x48')]['id']){delete _0x355a23[_0x52ca('0x48')]['id'];}return db[_0x52ca('0x2c')][_0x52ca('0x4b')]({'where':{'id':_0x355a23['params']['id']}})[_0x52ca('0x25')](handleEntityNotFound(_0x172dd3,null))['then'](function(_0x4599b9){if(_0x4599b9){_0x355a23[_0x52ca('0x48')][_0x52ca('0x4c')]=_0x4599b9['id'];_0x355a23[_0x52ca('0x48')][_0x52ca('0x4d')]=integrations[_0x52ca('0x4e')](_0x355a23[_0x52ca('0x48')][_0x52ca('0x4f')],_0x355a23[_0x52ca('0x48')][_0x52ca('0x2f')]);_0x355a23['body'][_0x52ca('0x50')]=integrations['getDescriptions'](_0x355a23[_0x52ca('0x48')][_0x52ca('0x4f')],_0x355a23[_0x52ca('0x48')][_0x52ca('0x2f')]);return db['FreshdeskConfiguration']['create'](_0x355a23[_0x52ca('0x48')],{'include':[{'model':db['FreshdeskField'],'as':_0x52ca('0x4d')},{'model':db[_0x52ca('0x51')],'as':_0x52ca('0x50')}]});}return null;})[_0x52ca('0x25')](respondWithResult(_0x172dd3,null))[_0x52ca('0x46')](handleError(_0x172dd3,null));};exports[_0x52ca('0x52')]=function(_0x47c88a,_0x5b4a94,_0x36c7ce){var _0x2681b0='';return db[_0x52ca('0x2c')][_0x52ca('0x4b')]({'where':{'id':_0x47c88a[_0x52ca('0x44')]['id']},'attributes':['id',_0x52ca('0x53'),_0x52ca('0x54')]})[_0x52ca('0x25')](handleEntityNotFound(_0x5b4a94,null))[_0x52ca('0x25')](function(_0xab57b0){if(_0xab57b0){_0x2681b0=_0xab57b0['remoteUri'];var _0x1588a5=_0x2681b0[_0x52ca('0x55')](-0x1);if(_0x1588a5==='/'){_0x2681b0=_0x2681b0['substring'](0x0,_0x2681b0[_0x52ca('0x56')](_0x1588a5));}return rp({'method':'GET','uri':util[_0x52ca('0x57')]('%s/%s',_0x2681b0,_0x52ca('0x58')),'headers':{'Authorization':util[_0x52ca('0x57')](_0x52ca('0x59'),new Buffer(util[_0x52ca('0x57')](_0x52ca('0x5a'),_0xab57b0[_0x52ca('0x54')]))[_0x52ca('0x5b')](_0x52ca('0x5c')))},'json':!![]});}})['then'](function(_0x1ec0da){if(_0x1ec0da){var _0x1b208a=['requester','subject','agent','description',_0x52ca('0x18'),'priority',_0x52ca('0x5d'),_0x52ca('0x5e'),'ticket_type',_0x52ca('0x5d'),'company'];_[_0x52ca('0x5f')](_0x1ec0da,function(_0x3259f3){return _0x1b208a[_0x52ca('0x60')](_0x3259f3[_0x52ca('0x28')])||!_0x3259f3[_0x52ca('0x61')]&&_0x3259f3[_0x52ca('0x2f')]!=='custom_text'&&_0x3259f3[_0x52ca('0x2f')]!==_0x52ca('0x62');});return{'count':_0x1ec0da[_0x52ca('0x38')],'rows':_[_0x52ca('0x2b')](_0x1ec0da,function(_0x268088){return{'id':_0x268088[_0x52ca('0x28')],'name':_0x268088[_0x52ca('0x63')],'custom':!_0x268088['default'],'options':_0x268088[_0x52ca('0x64')]?_[_0x52ca('0x2b')](_0x268088[_0x52ca('0x64')],function(_0xfca5fd){return{'name':_[_0x52ca('0x65')](_0xfca5fd),'value':_0xfca5fd};}):[]};})};}})[_0x52ca('0x25')](respondWithResult(_0x5b4a94,null))['catch'](function(_0x159cee){var _0x5ba5e1=_0x47c88a['query']['test']?0x1f4:_0x159cee['statusCode']||0x1f4;logger[_0x52ca('0x26')](_0x52ca('0x66'),_0x52ca('0x52'),_0x5ba5e1,JSON['stringify'](_0x159cee));delete _0x159cee['name'];if(_0x5ba5e1===0x191){_0x5ba5e1=0x190;}_0x5b4a94[_0x52ca('0x18')](_0x5ba5e1)[_0x52ca('0x29')](_0x47c88a[_0x52ca('0x31')][_0x52ca('0x67')]?{'message':_0x52ca('0x68'),'statusCode':_0x159cee[_0x52ca('0x69')]}:_0x159cee);});}; \ No newline at end of file +var _0xb299=['attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','catch','show','params','keys','create','find','getConfigurations','findOne','FreshdeskConfiguration','nolimit','addConfiguration','body','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','agent','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','intersection','query'];(function(_0x35ea6b,_0x191de4){var _0x1fae2a=function(_0x4b8432){while(--_0x4b8432){_0x35ea6b['push'](_0x35ea6b['shift']());}};_0x1fae2a(++_0x191de4);}(_0xb299,0x19b));var _0x9b29=function(_0x17c6b3,_0x2e2f27){_0x17c6b3=_0x17c6b3-0x0;var _0x26d493=_0xb299[_0x17c6b3];return _0x26d493;};'use strict';var emlformat=require(_0x9b29('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b29('0x1'));var jsonpatch=require(_0x9b29('0x2'));var rp=require(_0x9b29('0x3'));var moment=require(_0x9b29('0x4'));var BPromise=require(_0x9b29('0x5'));var Mustache=require(_0x9b29('0x6'));var util=require(_0x9b29('0x7'));var path=require('path');var sox=require(_0x9b29('0x8'));var csv=require(_0x9b29('0x9'));var ejs=require(_0x9b29('0xa'));var fs=require('fs');var fs_extra=require(_0x9b29('0xb'));var _=require(_0x9b29('0xc'));var squel=require(_0x9b29('0xd'));var crypto=require(_0x9b29('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9b29('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b29('0x10'));var Redis=require(_0x9b29('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9b29('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b29('0x13'));var logger=require(_0x9b29('0x14'))(_0x9b29('0x15'));var utils=require('../../config/utils');var config=require(_0x9b29('0x16'));var licenseUtil=require(_0x9b29('0x17'));var db=require(_0x9b29('0x18'))['db'];var integrations=require(_0x9b29('0x19'));function respondWithStatusCode(_0x35da05,_0x353308){_0x353308=_0x353308||0xcc;return function(_0x2479a2){if(_0x2479a2){return _0x35da05[_0x9b29('0x1a')](_0x353308);}return _0x35da05[_0x9b29('0x1b')](_0x353308)[_0x9b29('0x1c')]();};}function respondWithResult(_0x370f86,_0x292a5f){_0x292a5f=_0x292a5f||0xc8;return function(_0x355806){if(_0x355806){return _0x370f86[_0x9b29('0x1b')](_0x292a5f)[_0x9b29('0x1d')](_0x355806);}};}function respondWithFilteredResult(_0x2e5976,_0x4773c3){return function(_0x45b857){if(_0x45b857){var _0x31d9a1=typeof _0x4773c3[_0x9b29('0x1e')]===_0x9b29('0x1f')&&typeof _0x4773c3[_0x9b29('0x20')]==='undefined';var _0x48d3b4=_0x45b857['count'];var _0xf8967d=_0x31d9a1?0x0:_0x4773c3[_0x9b29('0x1e')];var _0x24d45d=_0x31d9a1?_0x45b857[_0x9b29('0x21')]:_0x4773c3[_0x9b29('0x1e')]+_0x4773c3[_0x9b29('0x20')];var _0x12c2e4;if(_0x24d45d>=_0x48d3b4){_0x24d45d=_0x48d3b4;_0x12c2e4=0xc8;}else{_0x12c2e4=0xce;}_0x2e5976[_0x9b29('0x1b')](_0x12c2e4);return _0x2e5976[_0x9b29('0x22')](_0x9b29('0x23'),_0xf8967d+'-'+_0x24d45d+'/'+_0x48d3b4)['json'](_0x45b857);}return null;};}function patchUpdates(_0x598d3f){return function(_0xdebf3e){try{jsonpatch[_0x9b29('0x24')](_0xdebf3e,_0x598d3f,!![]);}catch(_0x7b8615){return BPromise[_0x9b29('0x25')](_0x7b8615);}return _0xdebf3e[_0x9b29('0x26')]();};}function saveUpdates(_0x389f27,_0x90a182){return function(_0x3ab389){if(_0x3ab389){return _0x3ab389[_0x9b29('0x27')](_0x389f27)[_0x9b29('0x28')](function(_0x4802f7){return _0x4802f7;});}return null;};}function removeEntity(_0x1d6743,_0x1861a4){return function(_0xeebf6c){if(_0xeebf6c){return _0xeebf6c['destroy']()[_0x9b29('0x28')](function(){_0x1d6743['status'](0xcc)[_0x9b29('0x1c')]();});}};}function handleEntityNotFound(_0x3d05fc,_0x48b85d){return function(_0x4ef61f){if(!_0x4ef61f){_0x3d05fc[_0x9b29('0x1a')](0x194);}return _0x4ef61f;};}function handleError(_0x405f2d,_0x50ea3d){_0x50ea3d=_0x50ea3d||0x1f4;return function(_0x3fa7b6){logger[_0x9b29('0x29')](_0x3fa7b6['stack']);if(_0x3fa7b6[_0x9b29('0x2a')]){delete _0x3fa7b6[_0x9b29('0x2a')];}_0x405f2d[_0x9b29('0x1b')](_0x50ea3d)[_0x9b29('0x2b')](_0x3fa7b6);};}exports[_0x9b29('0x2c')]=function(_0x49025f,_0x25a000){var _0x3cee24={},_0x36fb08={},_0x386c65={'count':0x0,'rows':[]};var _0x512e71=_[_0x9b29('0x2d')](db[_0x9b29('0x2e')][_0x9b29('0x2f')],function(_0x2fe6a5){return{'name':_0x2fe6a5[_0x9b29('0x30')],'type':_0x2fe6a5[_0x9b29('0x31')][_0x9b29('0x32')]};});_0x36fb08['model']=_[_0x9b29('0x2d')](_0x512e71,_0x9b29('0x2a'));_0x36fb08['query']=_['keys'](_0x49025f['query']);_0x36fb08['filters']=_[_0x9b29('0x33')](_0x36fb08['model'],_0x36fb08[_0x9b29('0x34')]);_0x3cee24[_0x9b29('0x35')]=_[_0x9b29('0x33')](_0x36fb08[_0x9b29('0x36')],qs[_0x9b29('0x37')](_0x49025f[_0x9b29('0x34')][_0x9b29('0x37')]));_0x3cee24['attributes']=_0x3cee24['attributes'][_0x9b29('0x38')]?_0x3cee24[_0x9b29('0x35')]:_0x36fb08[_0x9b29('0x36')];if(!_0x49025f[_0x9b29('0x34')][_0x9b29('0x39')]('nolimit')){_0x3cee24[_0x9b29('0x20')]=qs['limit'](_0x49025f['query'][_0x9b29('0x20')]);_0x3cee24[_0x9b29('0x1e')]=qs[_0x9b29('0x1e')](_0x49025f[_0x9b29('0x34')][_0x9b29('0x1e')]);}_0x3cee24[_0x9b29('0x3a')]=qs[_0x9b29('0x3b')](_0x49025f[_0x9b29('0x34')]['sort']);_0x3cee24[_0x9b29('0x3c')]=qs[_0x9b29('0x3d')](_[_0x9b29('0x3e')](_0x49025f[_0x9b29('0x34')],_0x36fb08[_0x9b29('0x3d')]),_0x512e71);if(_0x49025f[_0x9b29('0x34')][_0x9b29('0x3f')]){_0x3cee24[_0x9b29('0x3c')]=_[_0x9b29('0x40')](_0x3cee24[_0x9b29('0x3c')],{'$or':_[_0x9b29('0x2d')](_0x512e71,function(_0x1b7250){if(_0x1b7250[_0x9b29('0x31')]!=='VIRTUAL'){var _0x3a4699={};_0x3a4699[_0x1b7250[_0x9b29('0x2a')]]={'$like':'%'+_0x49025f[_0x9b29('0x34')]['filter']+'%'};return _0x3a4699;}})});}_0x3cee24=_[_0x9b29('0x40')]({},_0x3cee24,_0x49025f[_0x9b29('0x41')]);var _0x3620d9={'where':_0x3cee24['where']};return db[_0x9b29('0x2e')]['count'](_0x3620d9)[_0x9b29('0x28')](function(_0x8e91ed){_0x386c65['count']=_0x8e91ed;if(_0x49025f['query'][_0x9b29('0x42')]){_0x3cee24[_0x9b29('0x43')]=[{'all':!![]}];}return db[_0x9b29('0x2e')]['findAll'](_0x3cee24);})[_0x9b29('0x28')](function(_0x5a79fa){_0x386c65['rows']=_0x5a79fa;return _0x386c65;})[_0x9b29('0x28')](respondWithFilteredResult(_0x25a000,_0x3cee24))[_0x9b29('0x44')](handleError(_0x25a000,null));};exports[_0x9b29('0x45')]=function(_0x2d6be6,_0x59c3b0){var _0x6e0a00={'raw':![],'where':{'id':_0x2d6be6[_0x9b29('0x46')]['id']}},_0x116cb0={};_0x116cb0[_0x9b29('0x36')]=_['keys'](db['FreshdeskAccount'][_0x9b29('0x2f')]);_0x116cb0[_0x9b29('0x34')]=_[_0x9b29('0x47')](_0x2d6be6['query']);_0x116cb0[_0x9b29('0x3d')]=_[_0x9b29('0x33')](_0x116cb0[_0x9b29('0x36')],_0x116cb0['query']);_0x6e0a00[_0x9b29('0x35')]=_[_0x9b29('0x33')](_0x116cb0[_0x9b29('0x36')],qs[_0x9b29('0x37')](_0x2d6be6[_0x9b29('0x34')]['fields']));_0x6e0a00[_0x9b29('0x35')]=_0x6e0a00[_0x9b29('0x35')][_0x9b29('0x38')]?_0x6e0a00['attributes']:_0x116cb0[_0x9b29('0x36')];if(_0x2d6be6[_0x9b29('0x34')][_0x9b29('0x42')]){_0x6e0a00['include']=[{'all':!![]}];}_0x6e0a00=_[_0x9b29('0x40')]({},_0x6e0a00,_0x2d6be6[_0x9b29('0x41')]);return db[_0x9b29('0x2e')]['find'](_0x6e0a00)['then'](handleEntityNotFound(_0x59c3b0,null))['then'](respondWithResult(_0x59c3b0,null))[_0x9b29('0x44')](handleError(_0x59c3b0,null));};exports[_0x9b29('0x48')]=function(_0x31fcf9,_0x13d87d){return db[_0x9b29('0x2e')]['create'](_0x31fcf9['body'],{})[_0x9b29('0x28')](respondWithResult(_0x13d87d,0xc9))[_0x9b29('0x44')](handleError(_0x13d87d,null));};exports[_0x9b29('0x27')]=function(_0x50500e,_0x43508a){if(_0x50500e['body']['id']){delete _0x50500e['body']['id'];}return db[_0x9b29('0x2e')][_0x9b29('0x49')]({'where':{'id':_0x50500e[_0x9b29('0x46')]['id']}})[_0x9b29('0x28')](handleEntityNotFound(_0x43508a,null))[_0x9b29('0x28')](saveUpdates(_0x50500e['body'],null))['then'](respondWithResult(_0x43508a,null))['catch'](handleError(_0x43508a,null));};exports['destroy']=function(_0x2eb99c,_0x225c55){return db[_0x9b29('0x2e')][_0x9b29('0x49')]({'where':{'id':_0x2eb99c[_0x9b29('0x46')]['id']}})[_0x9b29('0x28')](handleEntityNotFound(_0x225c55,null))['then'](removeEntity(_0x225c55,null))[_0x9b29('0x44')](handleError(_0x225c55,null));};exports[_0x9b29('0x4a')]=function(_0x1fd72a,_0x4b53b2,_0x2088b9){var _0x193287={};var _0xab0b76={};var _0x16206c;var _0x3ac328;return db[_0x9b29('0x2e')][_0x9b29('0x4b')]({'where':{'id':_0x1fd72a[_0x9b29('0x46')]['id']}})[_0x9b29('0x28')](handleEntityNotFound(_0x4b53b2,null))['then'](function(_0x46484c){if(_0x46484c){_0x16206c=_0x46484c;_0xab0b76[_0x9b29('0x36')]=_[_0x9b29('0x47')](db[_0x9b29('0x4c')][_0x9b29('0x2f')]);_0xab0b76[_0x9b29('0x34')]=_[_0x9b29('0x47')](_0x1fd72a[_0x9b29('0x34')]);_0xab0b76[_0x9b29('0x3d')]=_[_0x9b29('0x33')](_0xab0b76[_0x9b29('0x36')],_0xab0b76[_0x9b29('0x34')]);_0x193287[_0x9b29('0x35')]=_['intersection'](_0xab0b76['model'],qs[_0x9b29('0x37')](_0x1fd72a[_0x9b29('0x34')]['fields']));_0x193287[_0x9b29('0x35')]=_0x193287[_0x9b29('0x35')][_0x9b29('0x38')]?_0x193287[_0x9b29('0x35')]:_0xab0b76[_0x9b29('0x36')];_0x193287[_0x9b29('0x3a')]=qs[_0x9b29('0x3b')](_0x1fd72a[_0x9b29('0x34')]['sort']);_0x193287['where']=qs[_0x9b29('0x3d')](_[_0x9b29('0x3e')](_0x1fd72a[_0x9b29('0x34')],_0xab0b76[_0x9b29('0x3d')]));if(_0x1fd72a['query'][_0x9b29('0x3f')]){_0x193287[_0x9b29('0x3c')]=_[_0x9b29('0x40')](_0x193287[_0x9b29('0x3c')],{'$or':_[_0x9b29('0x2d')](_0x193287[_0x9b29('0x35')],function(_0x82e152){var _0x297b75={};_0x297b75[_0x82e152]={'$like':'%'+_0x1fd72a[_0x9b29('0x34')][_0x9b29('0x3f')]+'%'};return _0x297b75;})});}_0x193287=_[_0x9b29('0x40')]({},_0x193287,_0x1fd72a['options']);return _0x16206c[_0x9b29('0x4a')](_0x193287);}})['then'](function(_0x28c5e9){if(_0x28c5e9){_0x3ac328=_0x28c5e9['length'];if(!_0x1fd72a[_0x9b29('0x34')][_0x9b29('0x39')](_0x9b29('0x4d'))){_0x193287[_0x9b29('0x20')]=qs[_0x9b29('0x20')](_0x1fd72a[_0x9b29('0x34')][_0x9b29('0x20')]);_0x193287[_0x9b29('0x1e')]=qs['offset'](_0x1fd72a[_0x9b29('0x34')][_0x9b29('0x1e')]);}return _0x16206c[_0x9b29('0x4a')](_0x193287);}})[_0x9b29('0x28')](function(_0x5a68b5){if(_0x5a68b5){return _0x5a68b5?{'count':_0x3ac328,'rows':_0x5a68b5}:null;}})[_0x9b29('0x28')](respondWithResult(_0x4b53b2,null))[_0x9b29('0x44')](handleError(_0x4b53b2,null));};exports[_0x9b29('0x4e')]=function(_0x3e9ff8,_0x1c37ad,_0x11036f){if(_0x3e9ff8[_0x9b29('0x4f')]['id']){delete _0x3e9ff8[_0x9b29('0x4f')]['id'];}return db[_0x9b29('0x2e')][_0x9b29('0x4b')]({'where':{'id':_0x3e9ff8['params']['id']}})[_0x9b29('0x28')](handleEntityNotFound(_0x1c37ad,null))[_0x9b29('0x28')](function(_0x478838){if(_0x478838){_0x3e9ff8[_0x9b29('0x4f')]['AccountId']=_0x478838['id'];_0x3e9ff8[_0x9b29('0x4f')][_0x9b29('0x50')]=integrations[_0x9b29('0x51')](_0x3e9ff8[_0x9b29('0x4f')][_0x9b29('0x52')],_0x3e9ff8[_0x9b29('0x4f')][_0x9b29('0x31')]);_0x3e9ff8[_0x9b29('0x4f')]['Descriptions']=integrations[_0x9b29('0x53')](_0x3e9ff8[_0x9b29('0x4f')]['channel'],_0x3e9ff8['body'][_0x9b29('0x31')]);return db[_0x9b29('0x4c')][_0x9b29('0x48')](_0x3e9ff8['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x9b29('0x50')},{'model':db[_0x9b29('0x54')],'as':_0x9b29('0x55')}]});}return null;})[_0x9b29('0x28')](respondWithResult(_0x1c37ad,null))[_0x9b29('0x44')](handleError(_0x1c37ad,null));};exports['getFields']=function(_0x4248af,_0x4cd0bb,_0x48aa19){var _0x18eb00='';return db['FreshdeskAccount'][_0x9b29('0x4b')]({'where':{'id':_0x4248af[_0x9b29('0x46')]['id']},'attributes':['id',_0x9b29('0x56'),_0x9b29('0x57')]})[_0x9b29('0x28')](handleEntityNotFound(_0x4cd0bb,null))[_0x9b29('0x28')](function(_0x196bb1){if(_0x196bb1){_0x18eb00=_0x196bb1[_0x9b29('0x56')];var _0x5563f7=_0x18eb00[_0x9b29('0x58')](-0x1);if(_0x5563f7==='/'){_0x18eb00=_0x18eb00[_0x9b29('0x59')](0x0,_0x18eb00['lastIndexOf'](_0x5563f7));}return rp({'method':_0x9b29('0x5a'),'uri':util[_0x9b29('0x5b')](_0x9b29('0x5c'),_0x18eb00,_0x9b29('0x5d')),'headers':{'Authorization':util[_0x9b29('0x5b')](_0x9b29('0x5e'),new Buffer(util[_0x9b29('0x5b')](_0x9b29('0x5f'),_0x196bb1[_0x9b29('0x57')]))[_0x9b29('0x60')](_0x9b29('0x61')))},'json':!![]});}})[_0x9b29('0x28')](function(_0x514921){if(_0x514921){var _0x5d931b=[_0x9b29('0x62'),'subject',_0x9b29('0x63'),'description',_0x9b29('0x1b'),'priority',_0x9b29('0x64'),_0x9b29('0x65'),_0x9b29('0x66'),_0x9b29('0x64'),'company'];_[_0x9b29('0x67')](_0x514921,function(_0x2332e7){return _0x5d931b[_0x9b29('0x68')](_0x2332e7[_0x9b29('0x2a')])||!_0x2332e7[_0x9b29('0x69')]&&_0x2332e7[_0x9b29('0x31')]!==_0x9b29('0x6a')&&_0x2332e7[_0x9b29('0x31')]!==_0x9b29('0x6b');});return{'count':_0x514921[_0x9b29('0x38')],'rows':_['map'](_0x514921,function(_0x37e6f0){return{'id':_0x37e6f0['name'],'name':_0x37e6f0[_0x9b29('0x6c')],'custom':!_0x37e6f0['default'],'options':_0x37e6f0['choices']?_[_0x9b29('0x2d')](_0x37e6f0[_0x9b29('0x6d')],function(_0x10c151){return{'name':_[_0x9b29('0x6e')](_0x10c151),'value':_0x10c151};}):[]};})};}})['then'](respondWithResult(_0x4cd0bb,null))[_0x9b29('0x44')](function(_0x43cdf2){var _0x3a00fc=_0x4248af[_0x9b29('0x34')][_0x9b29('0x6f')]?0x1f4:_0x43cdf2[_0x9b29('0x70')]||0x1f4;logger['error'](_0x9b29('0x71'),_0x9b29('0x72'),_0x3a00fc,JSON[_0x9b29('0x73')](_0x43cdf2));delete _0x43cdf2[_0x9b29('0x2a')];if(_0x3a00fc===0x191){_0x3a00fc=0x190;}_0x4cd0bb['status'](_0x3a00fc)[_0x9b29('0x2b')](_0x4248af[_0x9b29('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x43cdf2[_0x9b29('0x70')]}:_0x43cdf2);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index cec6d8a..ff75fb4 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 _0x2762=['exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration'];(function(_0x583ca5,_0x511bc3){var _0x386847=function(_0x229300){while(--_0x229300){_0x583ca5['push'](_0x583ca5['shift']());}};_0x386847(++_0x511bc3);}(_0x2762,0x115));var _0x2276=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2762[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2276('0x0'));var util=require(_0x2276('0x1'));var logger=require('../../config/logger')(_0x2276('0x2'));var moment=require(_0x2276('0x3'));var BPromise=require(_0x2276('0x4'));var rp=require(_0x2276('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2276('0x6'));var attributes=require(_0x2276('0x7'));var integrations=require(_0x2276('0x8'));module[_0x2276('0x9')]=function(_0x5c0bb9,_0x53914c){return _0x5c0bb9[_0x2276('0xa')](_0x2276('0xb'),attributes,{'tableName':_0x2276('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5437=['int_freshdesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x2a2228,_0x66b18f){var _0x13c647=function(_0x4d30d2){while(--_0x4d30d2){_0x2a2228['push'](_0x2a2228['shift']());}};_0x13c647(++_0x66b18f);}(_0x5437,0xaa));var _0x7543=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x5437[_0x525af9];return _0x129fbf;};'use strict';var _=require('lodash');var util=require(_0x7543('0x0'));var logger=require(_0x7543('0x1'))(_0x7543('0x2'));var moment=require(_0x7543('0x3'));var BPromise=require(_0x7543('0x4'));var rp=require(_0x7543('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7543('0x6'));var config=require(_0x7543('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x7543('0x8'));module[_0x7543('0x9')]=function(_0x1a3f35,_0x10e4de){return _0x1a3f35[_0x7543('0xa')](_0x7543('0xb'),attributes,{'tableName':_0x7543('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 9b9c0a9..5325a87 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 _0xe134=['../../config/environment','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','limit','include','map','model','attributes','ShowFreshdeskAccount','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x40d97c,_0x5c0276){var _0x5307a3=function(_0x4c2ac2){while(--_0x4c2ac2){_0x40d97c['push'](_0x40d97c['shift']());}};_0x5307a3(++_0x5c0276);}(_0xe134,0x102));var _0x4e13=function(_0x10e1ce,_0x1f28eb){_0x10e1ce=_0x10e1ce-0x0;var _0x5be2ea=_0xe134[_0x10e1ce];return _0x5be2ea;};'use strict';var _=require(_0x4e13('0x0'));var util=require('util');var moment=require(_0x4e13('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e13('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e13('0x3'))['db'];var utils=require(_0x4e13('0x4'));var logger=require('../../config/logger')(_0x4e13('0x5'));var config=require(_0x4e13('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4e13('0x7')][_0x4e13('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44421c,_0x1331da,_0xd57201){return new BPromise(function(_0x396aec,_0x122717){return client[_0x4e13('0x9')](_0x44421c,_0xd57201)[_0x4e13('0xa')](function(_0x3e6a34){logger[_0x4e13('0xb')](_0x4e13('0xc'),_0x1331da,_0x4e13('0xd'));logger[_0x4e13('0xe')](_0x4e13('0xf'),_0x1331da,_0x4e13('0xd'),JSON[_0x4e13('0x10')](_0x3e6a34));if(_0x3e6a34[_0x4e13('0x11')]){if(_0x3e6a34[_0x4e13('0x11')][_0x4e13('0x12')]===0x1f4){logger[_0x4e13('0x11')](_0x4e13('0xc'),_0x1331da,_0x3e6a34[_0x4e13('0x11')]['message']);return _0x122717(_0x3e6a34['error'][_0x4e13('0x13')]);}logger[_0x4e13('0x11')](_0x4e13('0xc'),_0x1331da,_0x3e6a34['error'][_0x4e13('0x13')]);return _0x396aec(_0x3e6a34[_0x4e13('0x11')][_0x4e13('0x13')]);}else{logger[_0x4e13('0xb')](_0x4e13('0xc'),_0x1331da,'request\x20sent');_0x396aec(_0x3e6a34[_0x4e13('0x14')][_0x4e13('0x13')]);}})[_0x4e13('0x15')](function(_0x56b703){logger[_0x4e13('0x11')](_0x4e13('0xc'),_0x1331da,_0x56b703);_0x122717(_0x56b703);});});}exports[_0x4e13('0x16')]=function(_0x47a459){var _0x40cfc9=this;return new Promise(function(_0x5ddfac,_0x4c78a0){return db[_0x4e13('0x17')]['findAll']({'raw':_0x47a459[_0x4e13('0x18')]?_0x47a459[_0x4e13('0x18')][_0x4e13('0x19')]===undefined?!![]:![]:!![],'where':_0x47a459['options']?_0x47a459[_0x4e13('0x18')][_0x4e13('0x1a')]||null:null,'attributes':_0x47a459[_0x4e13('0x18')]?_0x47a459[_0x4e13('0x18')]['attributes']||null:null,'limit':_0x47a459[_0x4e13('0x18')]?_0x47a459[_0x4e13('0x18')][_0x4e13('0x1b')]||null:null,'include':_0x47a459['options']?_0x47a459['options'][_0x4e13('0x1c')]?_[_0x4e13('0x1d')](_0x47a459[_0x4e13('0x18')]['include'],function(_0x2569c5){return{'model':db[_0x2569c5[_0x4e13('0x1e')]],'as':_0x2569c5['as'],'attributes':_0x2569c5[_0x4e13('0x1f')],'include':_0x2569c5[_0x4e13('0x1c')]?_[_0x4e13('0x1d')](_0x2569c5[_0x4e13('0x1c')],function(_0x414c96){return{'model':db[_0x414c96['model']],'as':_0x414c96['as'],'attributes':_0x414c96[_0x4e13('0x1f')],'include':_0x414c96[_0x4e13('0x1c')]?_[_0x4e13('0x1d')](_0x414c96[_0x4e13('0x1c')],function(_0xf312a6){return{'model':db[_0xf312a6[_0x4e13('0x1e')]],'as':_0xf312a6['as'],'attributes':_0xf312a6[_0x4e13('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4e13('0xa')](function(_0x46ed04){logger[_0x4e13('0xb')]('GetFreshdeskAccount',_0x47a459);logger[_0x4e13('0xe')]('GetFreshdeskAccount',_0x47a459,JSON[_0x4e13('0x10')](_0x46ed04));_0x5ddfac(_0x46ed04);})[_0x4e13('0x15')](function(_0x5ec15d){logger['error']('GetFreshdeskAccount',_0x5ec15d[_0x4e13('0x13')],_0x47a459);_0x4c78a0(_0x40cfc9['error'](0x1f4,_0x5ec15d[_0x4e13('0x13')]));});});};exports['ShowFreshdeskAccount']=function(_0x9ec73e){var _0x48e74=this;return new Promise(function(_0x1ce508,_0x54843b){return db[_0x4e13('0x17')]['find']({'raw':_0x9ec73e[_0x4e13('0x18')]?_0x9ec73e[_0x4e13('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x9ec73e[_0x4e13('0x18')]?_0x9ec73e[_0x4e13('0x18')]['where']||null:null,'attributes':_0x9ec73e[_0x4e13('0x18')]?_0x9ec73e['options'][_0x4e13('0x1f')]||null:null,'include':_0x9ec73e['options']?_0x9ec73e[_0x4e13('0x18')][_0x4e13('0x1c')]?_[_0x4e13('0x1d')](_0x9ec73e[_0x4e13('0x18')][_0x4e13('0x1c')],function(_0x3e1270){return{'model':db[_0x3e1270[_0x4e13('0x1e')]],'as':_0x3e1270['as'],'attributes':_0x3e1270[_0x4e13('0x1f')],'include':_0x3e1270['include']?_[_0x4e13('0x1d')](_0x3e1270['include'],function(_0x2b93f0){return{'model':db[_0x2b93f0[_0x4e13('0x1e')]],'as':_0x2b93f0['as'],'attributes':_0x2b93f0[_0x4e13('0x1f')],'include':_0x2b93f0[_0x4e13('0x1c')]?_[_0x4e13('0x1d')](_0x2b93f0['include'],function(_0x49579d){return{'model':db[_0x49579d[_0x4e13('0x1e')]],'as':_0x49579d['as'],'attributes':_0x49579d[_0x4e13('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4e13('0xa')](function(_0x232670){logger[_0x4e13('0xb')](_0x4e13('0x20'),_0x9ec73e);logger[_0x4e13('0xe')]('ShowFreshdeskAccount',_0x9ec73e,JSON[_0x4e13('0x10')](_0x232670));_0x1ce508(_0x232670);})[_0x4e13('0x15')](function(_0x55e85b){logger[_0x4e13('0x11')](_0x4e13('0x20'),_0x55e85b['message'],_0x9ec73e);_0x54843b(_0x48e74[_0x4e13('0x11')](0x1f4,_0x55e85b['message']));});});}; \ No newline at end of file +var _0xd218=['where','attributes','limit','include','map','model','ShowFreshdeskAccount','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw'];(function(_0x118da9,_0x21a9f8){var _0x31d18c=function(_0x4ca6ef){while(--_0x4ca6ef){_0x118da9['push'](_0x118da9['shift']());}};_0x31d18c(++_0x21a9f8);}(_0xd218,0x64));var _0x8d21=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xd218[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x8d21('0x0'));var util=require('util');var moment=require(_0x8d21('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d21('0x2'));var fs=require('fs');var Redis=require(_0x8d21('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8d21('0x4'))('rpc');var config=require(_0x8d21('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8d21('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f85d5,_0x129e73,_0x1fc103){return new BPromise(function(_0x5a3b59,_0x5851c5){return client[_0x8d21('0x7')](_0x4f85d5,_0x1fc103)[_0x8d21('0x8')](function(_0x3433e2){logger[_0x8d21('0x9')](_0x8d21('0xa'),_0x129e73,_0x8d21('0xb'));logger[_0x8d21('0xc')](_0x8d21('0xd'),_0x129e73,_0x8d21('0xb'),JSON['stringify'](_0x3433e2));if(_0x3433e2[_0x8d21('0xe')]){if(_0x3433e2[_0x8d21('0xe')][_0x8d21('0xf')]===0x1f4){logger[_0x8d21('0xe')](_0x8d21('0xa'),_0x129e73,_0x3433e2[_0x8d21('0xe')][_0x8d21('0x10')]);return _0x5851c5(_0x3433e2[_0x8d21('0xe')][_0x8d21('0x10')]);}logger[_0x8d21('0xe')](_0x8d21('0xa'),_0x129e73,_0x3433e2[_0x8d21('0xe')][_0x8d21('0x10')]);return _0x5a3b59(_0x3433e2[_0x8d21('0xe')][_0x8d21('0x10')]);}else{logger[_0x8d21('0x9')](_0x8d21('0xa'),_0x129e73,_0x8d21('0xb'));_0x5a3b59(_0x3433e2[_0x8d21('0x11')]['message']);}})[_0x8d21('0x12')](function(_0x583fc1){logger['error'](_0x8d21('0xa'),_0x129e73,_0x583fc1);_0x5851c5(_0x583fc1);});});}exports[_0x8d21('0x13')]=function(_0x5cc710){var _0x2a374c=this;return new Promise(function(_0x357a96,_0xb09867){return db[_0x8d21('0x14')][_0x8d21('0x15')]({'raw':_0x5cc710[_0x8d21('0x16')]?_0x5cc710[_0x8d21('0x16')][_0x8d21('0x17')]===undefined?!![]:![]:!![],'where':_0x5cc710[_0x8d21('0x16')]?_0x5cc710[_0x8d21('0x16')][_0x8d21('0x18')]||null:null,'attributes':_0x5cc710['options']?_0x5cc710['options'][_0x8d21('0x19')]||null:null,'limit':_0x5cc710[_0x8d21('0x16')]?_0x5cc710['options'][_0x8d21('0x1a')]||null:null,'include':_0x5cc710[_0x8d21('0x16')]?_0x5cc710['options'][_0x8d21('0x1b')]?_[_0x8d21('0x1c')](_0x5cc710['options'][_0x8d21('0x1b')],function(_0x203402){return{'model':db[_0x203402[_0x8d21('0x1d')]],'as':_0x203402['as'],'attributes':_0x203402[_0x8d21('0x19')],'include':_0x203402['include']?_[_0x8d21('0x1c')](_0x203402['include'],function(_0x38ae45){return{'model':db[_0x38ae45[_0x8d21('0x1d')]],'as':_0x38ae45['as'],'attributes':_0x38ae45['attributes'],'include':_0x38ae45[_0x8d21('0x1b')]?_[_0x8d21('0x1c')](_0x38ae45[_0x8d21('0x1b')],function(_0xa4cc1d){return{'model':db[_0xa4cc1d[_0x8d21('0x1d')]],'as':_0xa4cc1d['as'],'attributes':_0xa4cc1d[_0x8d21('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8d21('0x8')](function(_0x201458){logger['info'](_0x8d21('0x13'),_0x5cc710);logger['debug']('GetFreshdeskAccount',_0x5cc710,JSON['stringify'](_0x201458));_0x357a96(_0x201458);})[_0x8d21('0x12')](function(_0x382d0d){logger['error'](_0x8d21('0x13'),_0x382d0d[_0x8d21('0x10')],_0x5cc710);_0xb09867(_0x2a374c['error'](0x1f4,_0x382d0d['message']));});});};exports['ShowFreshdeskAccount']=function(_0x1f8694){var _0x3a3644=this;return new Promise(function(_0x5f4c32,_0x5c6574){return db[_0x8d21('0x14')]['find']({'raw':_0x1f8694[_0x8d21('0x16')]?_0x1f8694[_0x8d21('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1f8694[_0x8d21('0x16')]?_0x1f8694[_0x8d21('0x16')]['where']||null:null,'attributes':_0x1f8694[_0x8d21('0x16')]?_0x1f8694[_0x8d21('0x16')][_0x8d21('0x19')]||null:null,'include':_0x1f8694[_0x8d21('0x16')]?_0x1f8694[_0x8d21('0x16')][_0x8d21('0x1b')]?_[_0x8d21('0x1c')](_0x1f8694[_0x8d21('0x16')][_0x8d21('0x1b')],function(_0x24348a){return{'model':db[_0x24348a[_0x8d21('0x1d')]],'as':_0x24348a['as'],'attributes':_0x24348a[_0x8d21('0x19')],'include':_0x24348a['include']?_[_0x8d21('0x1c')](_0x24348a['include'],function(_0x20fd9a){return{'model':db[_0x20fd9a[_0x8d21('0x1d')]],'as':_0x20fd9a['as'],'attributes':_0x20fd9a[_0x8d21('0x19')],'include':_0x20fd9a[_0x8d21('0x1b')]?_[_0x8d21('0x1c')](_0x20fd9a['include'],function(_0x2ae30e){return{'model':db[_0x2ae30e[_0x8d21('0x1d')]],'as':_0x2ae30e['as'],'attributes':_0x2ae30e[_0x8d21('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8d21('0x8')](function(_0x44a51b){logger['info'](_0x8d21('0x1e'),_0x1f8694);logger['debug'](_0x8d21('0x1e'),_0x1f8694,JSON['stringify'](_0x44a51b));_0x5f4c32(_0x44a51b);})[_0x8d21('0x12')](function(_0x3de1d9){logger['error'](_0x8d21('0x1e'),_0x3de1d9[_0x8d21('0x10')],_0x1f8694);_0x5c6574(_0x3a3644[_0x8d21('0xe')](0x1f4,_0x3de1d9[_0x8d21('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 2ca81e4..5341ff3 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 _0xa7ee=['put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x82fa71,_0x11b921){var _0x262198=function(_0x413ce8){while(--_0x413ce8){_0x82fa71['push'](_0x82fa71['shift']());}};_0x262198(++_0x11b921);}(_0xa7ee,0xdb));var _0xea7e=function(_0x1d3fdc,_0x2b5c54){_0x1d3fdc=_0x1d3fdc-0x0;var _0x128bb0=_0xa7ee[_0x1d3fdc];return _0x128bb0;};'use strict';var multer=require(_0xea7e('0x0'));var util=require('util');var path=require(_0xea7e('0x1'));var timeout=require(_0xea7e('0x2'));var express=require(_0xea7e('0x3'));var router=express[_0xea7e('0x4')]();var fs_extra=require(_0xea7e('0x5'));var auth=require(_0xea7e('0x6'));var interaction=require(_0xea7e('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0xea7e('0x8')]('/',auth[_0xea7e('0x9')](),controller[_0xea7e('0xa')]);router[_0xea7e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xea7e('0xb')]);router[_0xea7e('0x8')](_0xea7e('0xc'),auth[_0xea7e('0x9')](),controller[_0xea7e('0xd')]);router[_0xea7e('0x8')](_0xea7e('0xe'),auth[_0xea7e('0x9')](),controller['getSubjects']);router[_0xea7e('0x8')](_0xea7e('0xf'),auth[_0xea7e('0x9')](),controller['getDescriptions']);router['get'](_0xea7e('0x10'),auth[_0xea7e('0x9')](),controller[_0xea7e('0x11')]);router[_0xea7e('0x12')]('/',auth['isAuthenticated'](),controller[_0xea7e('0x13')]);router[_0xea7e('0x12')](_0xea7e('0x10'),auth['isAuthenticated'](),controller[_0xea7e('0x14')]);router[_0xea7e('0x15')]('/:id',auth[_0xea7e('0x9')](),controller[_0xea7e('0x16')]);router['delete']('/:id',auth[_0xea7e('0x9')](),controller['destroy']);module[_0xea7e('0x17')]=router; \ No newline at end of file +var _0xf972=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf972,0xd5));var _0x2f97=function(_0x436d54,_0x4caf80){_0x436d54=_0x436d54-0x0;var _0x40dba1=_0xf972[_0x436d54];return _0x40dba1;};'use strict';var multer=require(_0x2f97('0x0'));var util=require(_0x2f97('0x1'));var path=require(_0x2f97('0x2'));var timeout=require(_0x2f97('0x3'));var express=require('express');var router=express[_0x2f97('0x4')]();var fs_extra=require(_0x2f97('0x5'));var auth=require(_0x2f97('0x6'));var interaction=require(_0x2f97('0x7'));var config=require(_0x2f97('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x2f97('0x9')]('/',auth[_0x2f97('0xa')](),controller[_0x2f97('0xb')]);router[_0x2f97('0x9')](_0x2f97('0xc'),auth[_0x2f97('0xa')](),controller[_0x2f97('0xd')]);router[_0x2f97('0x9')]('/:id/fields',auth[_0x2f97('0xa')](),controller[_0x2f97('0xe')]);router[_0x2f97('0x9')](_0x2f97('0xf'),auth[_0x2f97('0xa')](),controller['getSubjects']);router[_0x2f97('0x9')](_0x2f97('0x10'),auth[_0x2f97('0xa')](),controller[_0x2f97('0x11')]);router['get'](_0x2f97('0x12'),auth[_0x2f97('0xa')](),controller['getTags']);router[_0x2f97('0x13')]('/',auth['isAuthenticated'](),controller[_0x2f97('0x14')]);router[_0x2f97('0x13')]('/:id/tags',auth[_0x2f97('0xa')](),controller[_0x2f97('0x15')]);router[_0x2f97('0x16')](_0x2f97('0xc'),auth[_0x2f97('0xa')](),controller[_0x2f97('0x17')]);router[_0x2f97('0x18')]('/:id',auth[_0x2f97('0xa')](),controller[_0x2f97('0x19')]);module[_0x2f97('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 5236643..86ed42b 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 _0x0649=['STRING','sequelize'];(function(_0x5ee029,_0x19f641){var _0x25942f=function(_0x574bf9){while(--_0x574bf9){_0x5ee029['push'](_0x5ee029['shift']());}};_0x25942f(++_0x19f641);}(_0x0649,0x10f));var _0x9064=function(_0x31234b,_0x307db9){_0x31234b=_0x31234b-0x0;var _0x395c91=_0x0649[_0x31234b];return _0x395c91;};'use strict';var Sequelize=require(_0x9064('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9064('0x1')]}}; \ No newline at end of file +var _0xb890=['STRING','sequelize','exports'];(function(_0x3bcbac,_0x19199d){var _0x5bafb8=function(_0x39751d){while(--_0x39751d){_0x3bcbac['push'](_0x3bcbac['shift']());}};_0x5bafb8(++_0x19199d);}(_0xb890,0xc7));var _0x0b89=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb890[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0b89('0x0'));module[_0x0b89('0x1')]={'name':{'type':Sequelize[_0x0b89('0x2')]},'description':{'type':Sequelize[_0x0b89('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index c557b36..426f2e9 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 _0xb4e8=['lodash','crypto','jsforce','papaparse','ioredis','../../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','apply','then','destroy','stack','name','send','index','fieldName','type','key','model','map','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','find','create','body','getFields','findOne','FreshdeskField','pick','filter','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb4e8,0x13a));var _0x8b4e=function(_0x591414,_0x11f91d){_0x591414=_0x591414-0x0;var _0x3e6ea0=_0xb4e8[_0x591414];return _0x3e6ea0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b4e('0x0'));var zipdir=require(_0x8b4e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b4e('0x2'));var moment=require('moment');var BPromise=require(_0x8b4e('0x3'));var Mustache=require(_0x8b4e('0x4'));var util=require(_0x8b4e('0x5'));var path=require(_0x8b4e('0x6'));var sox=require('sox');var csv=require(_0x8b4e('0x7'));var ejs=require(_0x8b4e('0x8'));var fs=require('fs');var fs_extra=require(_0x8b4e('0x9'));var _=require(_0x8b4e('0xa'));var squel=require('squel');var crypto=require(_0x8b4e('0xb'));var jsforce=require(_0x8b4e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b4e('0x7'));var querystring=require('querystring');var Papa=require(_0x8b4e('0xd'));var Redis=require(_0x8b4e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8b4e('0xf'));var as=require(_0x8b4e('0x10'));var hardwareService=require(_0x8b4e('0x11'));var logger=require('../../config/logger')(_0x8b4e('0x12'));var utils=require(_0x8b4e('0x13'));var config=require(_0x8b4e('0x14'));var licenseUtil=require(_0x8b4e('0x15'));var db=require(_0x8b4e('0x16'))['db'];function respondWithStatusCode(_0x304940,_0x256119){_0x256119=_0x256119||0xcc;return function(_0x4da13e){if(_0x4da13e){return _0x304940[_0x8b4e('0x17')](_0x256119);}return _0x304940[_0x8b4e('0x18')](_0x256119)[_0x8b4e('0x19')]();};}function respondWithResult(_0x20a00b,_0xcf1f8b){_0xcf1f8b=_0xcf1f8b||0xc8;return function(_0x35231b){if(_0x35231b){return _0x20a00b['status'](_0xcf1f8b)[_0x8b4e('0x1a')](_0x35231b);}};}function respondWithFilteredResult(_0x225bd8,_0x1b62c4){return function(_0x439979){if(_0x439979){var _0x20c258=typeof _0x1b62c4[_0x8b4e('0x1b')]===_0x8b4e('0x1c')&&typeof _0x1b62c4[_0x8b4e('0x1d')]===_0x8b4e('0x1c');var _0x530992=_0x439979[_0x8b4e('0x1e')];var _0x24a287=_0x20c258?0x0:_0x1b62c4['offset'];var _0x357c4f=_0x20c258?_0x439979['count']:_0x1b62c4[_0x8b4e('0x1b')]+_0x1b62c4[_0x8b4e('0x1d')];var _0x4df435;if(_0x357c4f>=_0x530992){_0x357c4f=_0x530992;_0x4df435=0xc8;}else{_0x4df435=0xce;}_0x225bd8[_0x8b4e('0x18')](_0x4df435);return _0x225bd8['set']('Content-Range',_0x24a287+'-'+_0x357c4f+'/'+_0x530992)[_0x8b4e('0x1a')](_0x439979);}return null;};}function patchUpdates(_0x5a35ec){return function(_0x3ab095){try{jsonpatch[_0x8b4e('0x1f')](_0x3ab095,_0x5a35ec,!![]);}catch(_0x1709ed){return BPromise['reject'](_0x1709ed);}return _0x3ab095['save']();};}function saveUpdates(_0x1cdb16,_0x5d11b9){return function(_0x42068f){if(_0x42068f){return _0x42068f['update'](_0x1cdb16)[_0x8b4e('0x20')](function(_0x28f03d){return _0x28f03d;});}return null;};}function removeEntity(_0x407f78,_0x45caf7){return function(_0x578ee1){if(_0x578ee1){return _0x578ee1[_0x8b4e('0x21')]()[_0x8b4e('0x20')](function(){_0x407f78[_0x8b4e('0x18')](0xcc)[_0x8b4e('0x19')]();});}};}function handleEntityNotFound(_0x425aeb,_0x565ae0){return function(_0x5160ed){if(!_0x5160ed){_0x425aeb[_0x8b4e('0x17')](0x194);}return _0x5160ed;};}function handleError(_0x3f7fa4,_0x6dc92c){_0x6dc92c=_0x6dc92c||0x1f4;return function(_0xa1edec){logger['error'](_0xa1edec[_0x8b4e('0x22')]);if(_0xa1edec['name']){delete _0xa1edec[_0x8b4e('0x23')];}_0x3f7fa4['status'](_0x6dc92c)[_0x8b4e('0x24')](_0xa1edec);};}exports[_0x8b4e('0x25')]=function(_0x468c50,_0x1c31a3){var _0x7c8647={},_0x1a49f1={},_0x3b86bf={'count':0x0,'rows':[]};var _0x5d9c9d=_['map'](db['FreshdeskConfiguration']['rawAttributes'],function(_0x324821){return{'name':_0x324821[_0x8b4e('0x26')],'type':_0x324821[_0x8b4e('0x27')][_0x8b4e('0x28')]};});_0x1a49f1[_0x8b4e('0x29')]=_[_0x8b4e('0x2a')](_0x5d9c9d,_0x8b4e('0x23'));_0x1a49f1['query']=_[_0x8b4e('0x2b')](_0x468c50[_0x8b4e('0x2c')]);_0x1a49f1[_0x8b4e('0x2d')]=_['intersection'](_0x1a49f1[_0x8b4e('0x29')],_0x1a49f1[_0x8b4e('0x2c')]);_0x7c8647[_0x8b4e('0x2e')]=_['intersection'](_0x1a49f1['model'],qs[_0x8b4e('0x2f')](_0x468c50['query'][_0x8b4e('0x2f')]));_0x7c8647[_0x8b4e('0x2e')]=_0x7c8647[_0x8b4e('0x2e')]['length']?_0x7c8647[_0x8b4e('0x2e')]:_0x1a49f1['model'];if(!_0x468c50[_0x8b4e('0x2c')][_0x8b4e('0x30')](_0x8b4e('0x31'))){_0x7c8647[_0x8b4e('0x1d')]=qs['limit'](_0x468c50[_0x8b4e('0x2c')][_0x8b4e('0x1d')]);_0x7c8647[_0x8b4e('0x1b')]=qs['offset'](_0x468c50[_0x8b4e('0x2c')]['offset']);}_0x7c8647[_0x8b4e('0x32')]=qs[_0x8b4e('0x33')](_0x468c50[_0x8b4e('0x2c')][_0x8b4e('0x33')]);_0x7c8647['where']=qs[_0x8b4e('0x2d')](_['pick'](_0x468c50[_0x8b4e('0x2c')],_0x1a49f1[_0x8b4e('0x2d')]),_0x5d9c9d);if(_0x468c50[_0x8b4e('0x2c')]['filter']){_0x7c8647['where']=_[_0x8b4e('0x34')](_0x7c8647[_0x8b4e('0x35')],{'$or':_[_0x8b4e('0x2a')](_0x5d9c9d,function(_0x53d7c2){if(_0x53d7c2[_0x8b4e('0x27')]!==_0x8b4e('0x36')){var _0x2a426d={};_0x2a426d[_0x53d7c2['name']]={'$like':'%'+_0x468c50['query']['filter']+'%'};return _0x2a426d;}})});}_0x7c8647=_[_0x8b4e('0x34')]({},_0x7c8647,_0x468c50[_0x8b4e('0x37')]);var _0x374a74={'where':_0x7c8647[_0x8b4e('0x35')]};return db[_0x8b4e('0x38')][_0x8b4e('0x1e')](_0x374a74)[_0x8b4e('0x20')](function(_0x12a4f7){_0x3b86bf[_0x8b4e('0x1e')]=_0x12a4f7;if(_0x468c50['query'][_0x8b4e('0x39')]){_0x7c8647[_0x8b4e('0x3a')]=[{'all':!![]}];}return db[_0x8b4e('0x38')][_0x8b4e('0x3b')](_0x7c8647);})['then'](function(_0x410faf){_0x3b86bf[_0x8b4e('0x3c')]=_0x410faf;return _0x3b86bf;})[_0x8b4e('0x20')](respondWithFilteredResult(_0x1c31a3,_0x7c8647))[_0x8b4e('0x3d')](handleError(_0x1c31a3,null));};exports[_0x8b4e('0x3e')]=function(_0x13f521,_0x4c559c){var _0x3dd236={'raw':![],'where':{'id':_0x13f521[_0x8b4e('0x3f')]['id']}},_0x270078={};_0x270078[_0x8b4e('0x29')]=_[_0x8b4e('0x2b')](db[_0x8b4e('0x38')][_0x8b4e('0x40')]);_0x270078[_0x8b4e('0x2c')]=_[_0x8b4e('0x2b')](_0x13f521[_0x8b4e('0x2c')]);_0x270078[_0x8b4e('0x2d')]=_['intersection'](_0x270078[_0x8b4e('0x29')],_0x270078['query']);_0x3dd236[_0x8b4e('0x2e')]=_[_0x8b4e('0x41')](_0x270078['model'],qs[_0x8b4e('0x2f')](_0x13f521[_0x8b4e('0x2c')][_0x8b4e('0x2f')]));_0x3dd236[_0x8b4e('0x2e')]=_0x3dd236['attributes'][_0x8b4e('0x42')]?_0x3dd236[_0x8b4e('0x2e')]:_0x270078[_0x8b4e('0x29')];if(_0x13f521[_0x8b4e('0x2c')][_0x8b4e('0x39')]){_0x3dd236[_0x8b4e('0x3a')]=[{'all':!![]}];}_0x3dd236=_[_0x8b4e('0x34')]({},_0x3dd236,_0x13f521[_0x8b4e('0x37')]);return db[_0x8b4e('0x38')][_0x8b4e('0x43')](_0x3dd236)[_0x8b4e('0x20')](handleEntityNotFound(_0x4c559c,null))[_0x8b4e('0x20')](respondWithResult(_0x4c559c,null))[_0x8b4e('0x3d')](handleError(_0x4c559c,null));};exports[_0x8b4e('0x44')]=function(_0x461bd7,_0x292d71){return db[_0x8b4e('0x38')][_0x8b4e('0x44')](_0x461bd7[_0x8b4e('0x45')],{})[_0x8b4e('0x20')](respondWithResult(_0x292d71,0xc9))[_0x8b4e('0x3d')](handleError(_0x292d71,null));};exports['update']=function(_0x1549a4,_0x19dd39){if(_0x1549a4['body']['id']){delete _0x1549a4['body']['id'];}return db[_0x8b4e('0x38')][_0x8b4e('0x43')]({'where':{'id':_0x1549a4[_0x8b4e('0x3f')]['id']}})[_0x8b4e('0x20')](handleEntityNotFound(_0x19dd39,null))['then'](saveUpdates(_0x1549a4[_0x8b4e('0x45')],null))[_0x8b4e('0x20')](respondWithResult(_0x19dd39,null))[_0x8b4e('0x3d')](handleError(_0x19dd39,null));};exports[_0x8b4e('0x21')]=function(_0x21e88b,_0x1fce44){return db[_0x8b4e('0x38')][_0x8b4e('0x43')]({'where':{'id':_0x21e88b[_0x8b4e('0x3f')]['id']}})[_0x8b4e('0x20')](handleEntityNotFound(_0x1fce44,null))['then'](removeEntity(_0x1fce44,null))[_0x8b4e('0x3d')](handleError(_0x1fce44,null));};exports[_0x8b4e('0x46')]=function(_0x57147f,_0x185241,_0x22f0a5){var _0x4812c4={};var _0x302123={};var _0x3d4ad3;var _0x429a22;return db['FreshdeskConfiguration'][_0x8b4e('0x47')]({'where':{'id':_0x57147f['params']['id']}})[_0x8b4e('0x20')](handleEntityNotFound(_0x185241,null))[_0x8b4e('0x20')](function(_0x471ced){if(_0x471ced){_0x3d4ad3=_0x471ced;_0x302123['model']=_[_0x8b4e('0x2b')](db[_0x8b4e('0x48')]['rawAttributes']);_0x302123[_0x8b4e('0x2c')]=_[_0x8b4e('0x2b')](_0x57147f[_0x8b4e('0x2c')]);_0x302123['filters']=_['intersection'](_0x302123[_0x8b4e('0x29')],_0x302123[_0x8b4e('0x2c')]);_0x4812c4[_0x8b4e('0x2e')]=_[_0x8b4e('0x41')](_0x302123[_0x8b4e('0x29')],qs[_0x8b4e('0x2f')](_0x57147f[_0x8b4e('0x2c')][_0x8b4e('0x2f')]));_0x4812c4[_0x8b4e('0x2e')]=_0x4812c4[_0x8b4e('0x2e')][_0x8b4e('0x42')]?_0x4812c4[_0x8b4e('0x2e')]:_0x302123['model'];_0x4812c4['order']=qs[_0x8b4e('0x33')](_0x57147f[_0x8b4e('0x2c')][_0x8b4e('0x33')]);_0x4812c4[_0x8b4e('0x35')]=qs[_0x8b4e('0x2d')](_[_0x8b4e('0x49')](_0x57147f[_0x8b4e('0x2c')],_0x302123[_0x8b4e('0x2d')]));if(_0x57147f['query'][_0x8b4e('0x4a')]){_0x4812c4['where']=_[_0x8b4e('0x34')](_0x4812c4[_0x8b4e('0x35')],{'$or':_[_0x8b4e('0x2a')](_0x4812c4['attributes'],function(_0x683fa1){var _0xe150d2={};_0xe150d2[_0x683fa1]={'$like':'%'+_0x57147f[_0x8b4e('0x2c')]['filter']+'%'};return _0xe150d2;})});}_0x4812c4=_[_0x8b4e('0x34')]({},_0x4812c4,_0x57147f[_0x8b4e('0x37')]);return _0x3d4ad3[_0x8b4e('0x46')](_0x4812c4);}})[_0x8b4e('0x20')](function(_0x24e3c3){if(_0x24e3c3){_0x429a22=_0x24e3c3['length'];if(!_0x57147f['query'][_0x8b4e('0x30')](_0x8b4e('0x31'))){_0x4812c4[_0x8b4e('0x1d')]=qs[_0x8b4e('0x1d')](_0x57147f[_0x8b4e('0x2c')]['limit']);_0x4812c4['offset']=qs[_0x8b4e('0x1b')](_0x57147f[_0x8b4e('0x2c')][_0x8b4e('0x1b')]);}return _0x3d4ad3[_0x8b4e('0x46')](_0x4812c4);}})[_0x8b4e('0x20')](function(_0x4e18a4){if(_0x4e18a4){return _0x4e18a4?{'count':_0x429a22,'rows':_0x4e18a4}:null;}})['then'](respondWithResult(_0x185241,null))['catch'](handleError(_0x185241,null));};exports[_0x8b4e('0x4b')]=function(_0x9f921,_0x5bb053,_0x401926){var _0x13c679={};var _0x3d7655={};var _0x553dfa;var _0x2745eb;return db[_0x8b4e('0x38')][_0x8b4e('0x47')]({'where':{'id':_0x9f921[_0x8b4e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5bb053,null))[_0x8b4e('0x20')](function(_0x13cedd){if(_0x13cedd){_0x553dfa=_0x13cedd;_0x3d7655[_0x8b4e('0x29')]=_[_0x8b4e('0x2b')](db[_0x8b4e('0x48')][_0x8b4e('0x40')]);_0x3d7655[_0x8b4e('0x2c')]=_[_0x8b4e('0x2b')](_0x9f921[_0x8b4e('0x2c')]);_0x3d7655[_0x8b4e('0x2d')]=_[_0x8b4e('0x41')](_0x3d7655['model'],_0x3d7655[_0x8b4e('0x2c')]);_0x13c679[_0x8b4e('0x2e')]=_['intersection'](_0x3d7655[_0x8b4e('0x29')],qs['fields'](_0x9f921[_0x8b4e('0x2c')][_0x8b4e('0x2f')]));_0x13c679[_0x8b4e('0x2e')]=_0x13c679[_0x8b4e('0x2e')]['length']?_0x13c679['attributes']:_0x3d7655[_0x8b4e('0x29')];_0x13c679['order']=qs[_0x8b4e('0x33')](_0x9f921[_0x8b4e('0x2c')]['sort']);_0x13c679['where']=qs[_0x8b4e('0x2d')](_[_0x8b4e('0x49')](_0x9f921[_0x8b4e('0x2c')],_0x3d7655[_0x8b4e('0x2d')]));if(_0x9f921[_0x8b4e('0x2c')][_0x8b4e('0x4a')]){_0x13c679['where']=_[_0x8b4e('0x34')](_0x13c679[_0x8b4e('0x35')],{'$or':_['map'](_0x13c679[_0x8b4e('0x2e')],function(_0x394aa0){var _0x41106e={};_0x41106e[_0x394aa0]={'$like':'%'+_0x9f921[_0x8b4e('0x2c')][_0x8b4e('0x4a')]+'%'};return _0x41106e;})});}_0x13c679=_[_0x8b4e('0x34')]({},_0x13c679,_0x9f921[_0x8b4e('0x37')]);return _0x553dfa[_0x8b4e('0x4b')](_0x13c679);}})[_0x8b4e('0x20')](function(_0x101932){if(_0x101932){_0x2745eb=_0x101932[_0x8b4e('0x42')];if(!_0x9f921[_0x8b4e('0x2c')][_0x8b4e('0x30')]('nolimit')){_0x13c679[_0x8b4e('0x1d')]=qs['limit'](_0x9f921[_0x8b4e('0x2c')][_0x8b4e('0x1d')]);_0x13c679[_0x8b4e('0x1b')]=qs[_0x8b4e('0x1b')](_0x9f921[_0x8b4e('0x2c')]['offset']);}return _0x553dfa[_0x8b4e('0x4b')](_0x13c679);}})['then'](function(_0x37e7c7){if(_0x37e7c7){return _0x37e7c7?{'count':_0x2745eb,'rows':_0x37e7c7}:null;}})[_0x8b4e('0x20')](respondWithResult(_0x5bb053,null))[_0x8b4e('0x3d')](handleError(_0x5bb053,null));};exports['getDescriptions']=function(_0x1c5245,_0x2aca1a,_0x469723){var _0x5db6bd={};var _0x29a8c2={};var _0x1e1f13;var _0x3bcbaa;return db['FreshdeskConfiguration'][_0x8b4e('0x47')]({'where':{'id':_0x1c5245['params']['id']}})[_0x8b4e('0x20')](handleEntityNotFound(_0x2aca1a,null))[_0x8b4e('0x20')](function(_0x4b3b8a){if(_0x4b3b8a){_0x1e1f13=_0x4b3b8a;_0x29a8c2[_0x8b4e('0x29')]=_['keys'](db['FreshdeskField'][_0x8b4e('0x40')]);_0x29a8c2['query']=_[_0x8b4e('0x2b')](_0x1c5245[_0x8b4e('0x2c')]);_0x29a8c2[_0x8b4e('0x2d')]=_['intersection'](_0x29a8c2[_0x8b4e('0x29')],_0x29a8c2[_0x8b4e('0x2c')]);_0x5db6bd['attributes']=_[_0x8b4e('0x41')](_0x29a8c2[_0x8b4e('0x29')],qs[_0x8b4e('0x2f')](_0x1c5245['query'][_0x8b4e('0x2f')]));_0x5db6bd[_0x8b4e('0x2e')]=_0x5db6bd[_0x8b4e('0x2e')][_0x8b4e('0x42')]?_0x5db6bd[_0x8b4e('0x2e')]:_0x29a8c2[_0x8b4e('0x29')];_0x5db6bd[_0x8b4e('0x32')]=qs['sort'](_0x1c5245['query'][_0x8b4e('0x33')]);_0x5db6bd[_0x8b4e('0x35')]=qs['filters'](_['pick'](_0x1c5245[_0x8b4e('0x2c')],_0x29a8c2[_0x8b4e('0x2d')]));if(_0x1c5245[_0x8b4e('0x2c')][_0x8b4e('0x4a')]){_0x5db6bd[_0x8b4e('0x35')]=_[_0x8b4e('0x34')](_0x5db6bd[_0x8b4e('0x35')],{'$or':_[_0x8b4e('0x2a')](_0x5db6bd[_0x8b4e('0x2e')],function(_0x4fd93b){var _0x56ef1f={};_0x56ef1f[_0x4fd93b]={'$like':'%'+_0x1c5245[_0x8b4e('0x2c')][_0x8b4e('0x4a')]+'%'};return _0x56ef1f;})});}_0x5db6bd=_[_0x8b4e('0x34')]({},_0x5db6bd,_0x1c5245['options']);return _0x1e1f13['getDescriptions'](_0x5db6bd);}})[_0x8b4e('0x20')](function(_0x1e39b1){if(_0x1e39b1){_0x3bcbaa=_0x1e39b1['length'];if(!_0x1c5245[_0x8b4e('0x2c')][_0x8b4e('0x30')]('nolimit')){_0x5db6bd['limit']=qs[_0x8b4e('0x1d')](_0x1c5245[_0x8b4e('0x2c')][_0x8b4e('0x1d')]);_0x5db6bd[_0x8b4e('0x1b')]=qs[_0x8b4e('0x1b')](_0x1c5245[_0x8b4e('0x2c')][_0x8b4e('0x1b')]);}return _0x1e1f13[_0x8b4e('0x4c')](_0x5db6bd);}})[_0x8b4e('0x20')](function(_0x127369){if(_0x127369){return _0x127369?{'count':_0x3bcbaa,'rows':_0x127369}:null;}})['then'](respondWithResult(_0x2aca1a,null))[_0x8b4e('0x3d')](handleError(_0x2aca1a,null));};exports[_0x8b4e('0x4d')]=function(_0x25e06a,_0x57ecb8,_0x568e3e){var _0x2dc069={};var _0x18c2b2={};var _0x2706c3;var _0x353edf;return db['FreshdeskConfiguration'][_0x8b4e('0x47')]({'where':{'id':_0x25e06a[_0x8b4e('0x3f')]['id']}})[_0x8b4e('0x20')](handleEntityNotFound(_0x57ecb8,null))['then'](function(_0x3b5f4f){if(_0x3b5f4f){_0x2706c3=_0x3b5f4f;_0x18c2b2[_0x8b4e('0x29')]=_[_0x8b4e('0x2b')](db[_0x8b4e('0x4e')][_0x8b4e('0x40')]);_0x18c2b2[_0x8b4e('0x2c')]=_['keys'](_0x25e06a[_0x8b4e('0x2c')]);_0x18c2b2[_0x8b4e('0x2d')]=_['intersection'](_0x18c2b2[_0x8b4e('0x29')],_0x18c2b2[_0x8b4e('0x2c')]);_0x2dc069[_0x8b4e('0x2e')]=_['intersection'](_0x18c2b2['model'],qs['fields'](_0x25e06a[_0x8b4e('0x2c')][_0x8b4e('0x2f')]));_0x2dc069[_0x8b4e('0x2e')]=_0x2dc069[_0x8b4e('0x2e')][_0x8b4e('0x42')]?_0x2dc069[_0x8b4e('0x2e')]:_0x18c2b2['model'];_0x2dc069[_0x8b4e('0x32')]=qs[_0x8b4e('0x33')](_0x25e06a[_0x8b4e('0x2c')]['sort']);_0x2dc069[_0x8b4e('0x35')]=qs[_0x8b4e('0x2d')](_[_0x8b4e('0x49')](_0x25e06a[_0x8b4e('0x2c')],_0x18c2b2[_0x8b4e('0x2d')]));if(_0x25e06a[_0x8b4e('0x2c')][_0x8b4e('0x4a')]){_0x2dc069[_0x8b4e('0x35')]=_[_0x8b4e('0x34')](_0x2dc069['where'],{'$or':_[_0x8b4e('0x2a')](_0x2dc069[_0x8b4e('0x2e')],function(_0x157b98){var _0x669b22={};_0x669b22[_0x157b98]={'$like':'%'+_0x25e06a[_0x8b4e('0x2c')][_0x8b4e('0x4a')]+'%'};return _0x669b22;})});}_0x2dc069=_['merge']({},_0x2dc069,_0x25e06a['options']);return _0x2706c3['getTags'](_0x2dc069);}})[_0x8b4e('0x20')](function(_0xde3093){if(_0xde3093){_0x353edf=_0xde3093[_0x8b4e('0x42')];if(!_0x25e06a[_0x8b4e('0x2c')][_0x8b4e('0x30')](_0x8b4e('0x31'))){_0x2dc069[_0x8b4e('0x1d')]=qs['limit'](_0x25e06a[_0x8b4e('0x2c')][_0x8b4e('0x1d')]);_0x2dc069[_0x8b4e('0x1b')]=qs[_0x8b4e('0x1b')](_0x25e06a['query'][_0x8b4e('0x1b')]);}return _0x2706c3[_0x8b4e('0x4d')](_0x2dc069);}})[_0x8b4e('0x20')](function(_0x4acad1){if(_0x4acad1){return _0x4acad1?{'count':_0x353edf,'rows':_0x4acad1}:null;}})['then'](respondWithResult(_0x57ecb8,null))['catch'](handleError(_0x57ecb8,null));};exports['setTags']=function(_0x77bd2b,_0x3622c3,_0x34edf2){if(_0x77bd2b[_0x8b4e('0x45')]['id']){delete _0x77bd2b['body']['id'];}return db['FreshdeskConfiguration'][_0x8b4e('0x47')]({'where':{'id':_0x77bd2b[_0x8b4e('0x3f')]['id']}})[_0x8b4e('0x20')](handleEntityNotFound(_0x3622c3,null))[_0x8b4e('0x20')](function(_0x1b5a4e){if(_0x1b5a4e){return _0x1b5a4e[_0x8b4e('0x4f')](_0x77bd2b[_0x8b4e('0x45')][_0x8b4e('0x50')]||[]);}return null;})[_0x8b4e('0x20')](respondWithResult(_0x3622c3,null))[_0x8b4e('0x3d')](handleError(_0x3622c3,null));}; \ No newline at end of file +var _0x07f9=['destroy','end','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','find','create','body','params','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','save','update','then'];(function(_0x45ba6a,_0xa4862a){var _0x1dbbea=function(_0x5b1483){while(--_0x5b1483){_0x45ba6a['push'](_0x45ba6a['shift']());}};_0x1dbbea(++_0xa4862a);}(_0x07f9,0x11e));var _0x907f=function(_0x1d7c1e,_0x515252){_0x1d7c1e=_0x1d7c1e-0x0;var _0x2d1742=_0x07f9[_0x1d7c1e];return _0x2d1742;};'use strict';var emlformat=require(_0x907f('0x0'));var rimraf=require(_0x907f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x907f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x907f('0x3'));var Mustache=require('mustache');var util=require(_0x907f('0x4'));var path=require(_0x907f('0x5'));var sox=require('sox');var csv=require(_0x907f('0x6'));var ejs=require(_0x907f('0x7'));var fs=require('fs');var fs_extra=require(_0x907f('0x8'));var _=require(_0x907f('0x9'));var squel=require(_0x907f('0xa'));var crypto=require(_0x907f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x907f('0x6'));var querystring=require(_0x907f('0xc'));var Papa=require(_0x907f('0xd'));var Redis=require(_0x907f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x907f('0xf'));var as=require(_0x907f('0x10'));var hardwareService=require(_0x907f('0x11'));var logger=require('../../config/logger')(_0x907f('0x12'));var utils=require(_0x907f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x907f('0x14'));var db=require(_0x907f('0x15'))['db'];function respondWithStatusCode(_0x466469,_0x152459){_0x152459=_0x152459||0xcc;return function(_0x32b7de){if(_0x32b7de){return _0x466469[_0x907f('0x16')](_0x152459);}return _0x466469['status'](_0x152459)['end']();};}function respondWithResult(_0xf480f7,_0x441e71){_0x441e71=_0x441e71||0xc8;return function(_0x5cbeb7){if(_0x5cbeb7){return _0xf480f7['status'](_0x441e71)['json'](_0x5cbeb7);}};}function respondWithFilteredResult(_0x12bebd,_0x4fb9d2){return function(_0x1bab7f){if(_0x1bab7f){var _0x5456fb=typeof _0x4fb9d2[_0x907f('0x17')]===_0x907f('0x18')&&typeof _0x4fb9d2[_0x907f('0x19')]==='undefined';var _0x1c0637=_0x1bab7f[_0x907f('0x1a')];var _0x1b710c=_0x5456fb?0x0:_0x4fb9d2[_0x907f('0x17')];var _0x231e82=_0x5456fb?_0x1bab7f[_0x907f('0x1a')]:_0x4fb9d2['offset']+_0x4fb9d2['limit'];var _0x4f52bf;if(_0x231e82>=_0x1c0637){_0x231e82=_0x1c0637;_0x4f52bf=0xc8;}else{_0x4f52bf=0xce;}_0x12bebd[_0x907f('0x1b')](_0x4f52bf);return _0x12bebd[_0x907f('0x1c')](_0x907f('0x1d'),_0x1b710c+'-'+_0x231e82+'/'+_0x1c0637)[_0x907f('0x1e')](_0x1bab7f);}return null;};}function patchUpdates(_0x16065f){return function(_0xbd8119){try{jsonpatch['apply'](_0xbd8119,_0x16065f,!![]);}catch(_0x4655ad){return BPromise['reject'](_0x4655ad);}return _0xbd8119[_0x907f('0x1f')]();};}function saveUpdates(_0x5ae0db,_0x1d71a0){return function(_0x52c126){if(_0x52c126){return _0x52c126[_0x907f('0x20')](_0x5ae0db)[_0x907f('0x21')](function(_0x365984){return _0x365984;});}return null;};}function removeEntity(_0x364dd9,_0x524b90){return function(_0xba2ef){if(_0xba2ef){return _0xba2ef[_0x907f('0x22')]()[_0x907f('0x21')](function(){_0x364dd9[_0x907f('0x1b')](0xcc)[_0x907f('0x23')]();});}};}function handleEntityNotFound(_0x36e5b4,_0x244671){return function(_0x2508e5){if(!_0x2508e5){_0x36e5b4['sendStatus'](0x194);}return _0x2508e5;};}function handleError(_0x42f391,_0x1ba9d3){_0x1ba9d3=_0x1ba9d3||0x1f4;return function(_0x337fa5){logger['error'](_0x337fa5['stack']);if(_0x337fa5[_0x907f('0x24')]){delete _0x337fa5[_0x907f('0x24')];}_0x42f391[_0x907f('0x1b')](_0x1ba9d3)[_0x907f('0x25')](_0x337fa5);};}exports[_0x907f('0x26')]=function(_0x355d1c,_0xbf373f){var _0x4f8754={},_0x2791bb={},_0x21003c={'count':0x0,'rows':[]};var _0x2b8628=_[_0x907f('0x27')](db[_0x907f('0x28')][_0x907f('0x29')],function(_0x42b12d){return{'name':_0x42b12d[_0x907f('0x2a')],'type':_0x42b12d['type'][_0x907f('0x2b')]};});_0x2791bb[_0x907f('0x2c')]=_[_0x907f('0x27')](_0x2b8628,_0x907f('0x24'));_0x2791bb[_0x907f('0x2d')]=_[_0x907f('0x2e')](_0x355d1c['query']);_0x2791bb[_0x907f('0x2f')]=_[_0x907f('0x30')](_0x2791bb[_0x907f('0x2c')],_0x2791bb[_0x907f('0x2d')]);_0x4f8754['attributes']=_[_0x907f('0x30')](_0x2791bb[_0x907f('0x2c')],qs['fields'](_0x355d1c[_0x907f('0x2d')][_0x907f('0x31')]));_0x4f8754[_0x907f('0x32')]=_0x4f8754[_0x907f('0x32')][_0x907f('0x33')]?_0x4f8754[_0x907f('0x32')]:_0x2791bb[_0x907f('0x2c')];if(!_0x355d1c[_0x907f('0x2d')][_0x907f('0x34')](_0x907f('0x35'))){_0x4f8754['limit']=qs[_0x907f('0x19')](_0x355d1c[_0x907f('0x2d')][_0x907f('0x19')]);_0x4f8754[_0x907f('0x17')]=qs[_0x907f('0x17')](_0x355d1c[_0x907f('0x2d')][_0x907f('0x17')]);}_0x4f8754[_0x907f('0x36')]=qs['sort'](_0x355d1c[_0x907f('0x2d')][_0x907f('0x37')]);_0x4f8754[_0x907f('0x38')]=qs[_0x907f('0x2f')](_[_0x907f('0x39')](_0x355d1c[_0x907f('0x2d')],_0x2791bb[_0x907f('0x2f')]),_0x2b8628);if(_0x355d1c[_0x907f('0x2d')]['filter']){_0x4f8754[_0x907f('0x38')]=_[_0x907f('0x3a')](_0x4f8754['where'],{'$or':_[_0x907f('0x27')](_0x2b8628,function(_0x30db19){if(_0x30db19[_0x907f('0x3b')]!==_0x907f('0x3c')){var _0xf98c4b={};_0xf98c4b[_0x30db19[_0x907f('0x24')]]={'$like':'%'+_0x355d1c['query'][_0x907f('0x3d')]+'%'};return _0xf98c4b;}})});}_0x4f8754=_[_0x907f('0x3a')]({},_0x4f8754,_0x355d1c[_0x907f('0x3e')]);var _0x252a70={'where':_0x4f8754[_0x907f('0x38')]};return db[_0x907f('0x28')][_0x907f('0x1a')](_0x252a70)[_0x907f('0x21')](function(_0x49890d){_0x21003c[_0x907f('0x1a')]=_0x49890d;if(_0x355d1c[_0x907f('0x2d')][_0x907f('0x3f')]){_0x4f8754[_0x907f('0x40')]=[{'all':!![]}];}return db[_0x907f('0x28')][_0x907f('0x41')](_0x4f8754);})['then'](function(_0x46662f){_0x21003c['rows']=_0x46662f;return _0x21003c;})[_0x907f('0x21')](respondWithFilteredResult(_0xbf373f,_0x4f8754))[_0x907f('0x42')](handleError(_0xbf373f,null));};exports[_0x907f('0x43')]=function(_0xa7d26c,_0x3b6434){var _0x5452a1={'raw':![],'where':{'id':_0xa7d26c['params']['id']}},_0x3cdcba={};_0x3cdcba[_0x907f('0x2c')]=_['keys'](db[_0x907f('0x28')][_0x907f('0x29')]);_0x3cdcba[_0x907f('0x2d')]=_[_0x907f('0x2e')](_0xa7d26c['query']);_0x3cdcba['filters']=_['intersection'](_0x3cdcba[_0x907f('0x2c')],_0x3cdcba[_0x907f('0x2d')]);_0x5452a1[_0x907f('0x32')]=_['intersection'](_0x3cdcba[_0x907f('0x2c')],qs[_0x907f('0x31')](_0xa7d26c[_0x907f('0x2d')][_0x907f('0x31')]));_0x5452a1[_0x907f('0x32')]=_0x5452a1[_0x907f('0x32')][_0x907f('0x33')]?_0x5452a1[_0x907f('0x32')]:_0x3cdcba[_0x907f('0x2c')];if(_0xa7d26c['query']['includeAll']){_0x5452a1[_0x907f('0x40')]=[{'all':!![]}];}_0x5452a1=_[_0x907f('0x3a')]({},_0x5452a1,_0xa7d26c[_0x907f('0x3e')]);return db[_0x907f('0x28')][_0x907f('0x44')](_0x5452a1)[_0x907f('0x21')](handleEntityNotFound(_0x3b6434,null))['then'](respondWithResult(_0x3b6434,null))['catch'](handleError(_0x3b6434,null));};exports[_0x907f('0x45')]=function(_0x5ebb38,_0x22d58d){return db[_0x907f('0x28')][_0x907f('0x45')](_0x5ebb38[_0x907f('0x46')],{})[_0x907f('0x21')](respondWithResult(_0x22d58d,0xc9))['catch'](handleError(_0x22d58d,null));};exports[_0x907f('0x20')]=function(_0x4297c9,_0x16ffb7){if(_0x4297c9[_0x907f('0x46')]['id']){delete _0x4297c9[_0x907f('0x46')]['id'];}return db[_0x907f('0x28')][_0x907f('0x44')]({'where':{'id':_0x4297c9[_0x907f('0x47')]['id']}})['then'](handleEntityNotFound(_0x16ffb7,null))[_0x907f('0x21')](saveUpdates(_0x4297c9[_0x907f('0x46')],null))[_0x907f('0x21')](respondWithResult(_0x16ffb7,null))[_0x907f('0x42')](handleError(_0x16ffb7,null));};exports['destroy']=function(_0x30d8e0,_0x5cdc6a){return db[_0x907f('0x28')][_0x907f('0x44')]({'where':{'id':_0x30d8e0['params']['id']}})[_0x907f('0x21')](handleEntityNotFound(_0x5cdc6a,null))[_0x907f('0x21')](removeEntity(_0x5cdc6a,null))[_0x907f('0x42')](handleError(_0x5cdc6a,null));};exports[_0x907f('0x48')]=function(_0x3ba0,_0x35e9c8,_0x2db5f0){var _0x3df5c7={};var _0x109176={};var _0xa4c877;var _0x1f7352;return db[_0x907f('0x28')][_0x907f('0x49')]({'where':{'id':_0x3ba0['params']['id']}})['then'](handleEntityNotFound(_0x35e9c8,null))['then'](function(_0x911488){if(_0x911488){_0xa4c877=_0x911488;_0x109176['model']=_['keys'](db[_0x907f('0x4a')][_0x907f('0x29')]);_0x109176[_0x907f('0x2d')]=_['keys'](_0x3ba0['query']);_0x109176[_0x907f('0x2f')]=_[_0x907f('0x30')](_0x109176[_0x907f('0x2c')],_0x109176[_0x907f('0x2d')]);_0x3df5c7[_0x907f('0x32')]=_[_0x907f('0x30')](_0x109176['model'],qs['fields'](_0x3ba0['query'][_0x907f('0x31')]));_0x3df5c7[_0x907f('0x32')]=_0x3df5c7['attributes'][_0x907f('0x33')]?_0x3df5c7[_0x907f('0x32')]:_0x109176[_0x907f('0x2c')];_0x3df5c7[_0x907f('0x36')]=qs['sort'](_0x3ba0['query'][_0x907f('0x37')]);_0x3df5c7[_0x907f('0x38')]=qs[_0x907f('0x2f')](_[_0x907f('0x39')](_0x3ba0[_0x907f('0x2d')],_0x109176[_0x907f('0x2f')]));if(_0x3ba0['query'][_0x907f('0x3d')]){_0x3df5c7[_0x907f('0x38')]=_['merge'](_0x3df5c7[_0x907f('0x38')],{'$or':_[_0x907f('0x27')](_0x3df5c7[_0x907f('0x32')],function(_0x4f5b22){var _0x5783ee={};_0x5783ee[_0x4f5b22]={'$like':'%'+_0x3ba0[_0x907f('0x2d')]['filter']+'%'};return _0x5783ee;})});}_0x3df5c7=_['merge']({},_0x3df5c7,_0x3ba0[_0x907f('0x3e')]);return _0xa4c877[_0x907f('0x48')](_0x3df5c7);}})[_0x907f('0x21')](function(_0x48f0b8){if(_0x48f0b8){_0x1f7352=_0x48f0b8[_0x907f('0x33')];if(!_0x3ba0[_0x907f('0x2d')]['hasOwnProperty'](_0x907f('0x35'))){_0x3df5c7[_0x907f('0x19')]=qs[_0x907f('0x19')](_0x3ba0[_0x907f('0x2d')][_0x907f('0x19')]);_0x3df5c7['offset']=qs['offset'](_0x3ba0[_0x907f('0x2d')][_0x907f('0x17')]);}return _0xa4c877['getFields'](_0x3df5c7);}})[_0x907f('0x21')](function(_0x24f156){if(_0x24f156){return _0x24f156?{'count':_0x1f7352,'rows':_0x24f156}:null;}})[_0x907f('0x21')](respondWithResult(_0x35e9c8,null))[_0x907f('0x42')](handleError(_0x35e9c8,null));};exports[_0x907f('0x4b')]=function(_0x2daff6,_0x4305e1,_0x1530d5){var _0x5393b3={};var _0x2fe6f2={};var _0x2cf0c4;var _0x5d1d97;return db[_0x907f('0x28')][_0x907f('0x49')]({'where':{'id':_0x2daff6[_0x907f('0x47')]['id']}})[_0x907f('0x21')](handleEntityNotFound(_0x4305e1,null))[_0x907f('0x21')](function(_0x58a9be){if(_0x58a9be){_0x2cf0c4=_0x58a9be;_0x2fe6f2[_0x907f('0x2c')]=_[_0x907f('0x2e')](db[_0x907f('0x4a')][_0x907f('0x29')]);_0x2fe6f2[_0x907f('0x2d')]=_[_0x907f('0x2e')](_0x2daff6[_0x907f('0x2d')]);_0x2fe6f2[_0x907f('0x2f')]=_[_0x907f('0x30')](_0x2fe6f2[_0x907f('0x2c')],_0x2fe6f2[_0x907f('0x2d')]);_0x5393b3[_0x907f('0x32')]=_[_0x907f('0x30')](_0x2fe6f2[_0x907f('0x2c')],qs['fields'](_0x2daff6[_0x907f('0x2d')][_0x907f('0x31')]));_0x5393b3['attributes']=_0x5393b3['attributes']['length']?_0x5393b3['attributes']:_0x2fe6f2[_0x907f('0x2c')];_0x5393b3[_0x907f('0x36')]=qs[_0x907f('0x37')](_0x2daff6[_0x907f('0x2d')]['sort']);_0x5393b3['where']=qs[_0x907f('0x2f')](_[_0x907f('0x39')](_0x2daff6[_0x907f('0x2d')],_0x2fe6f2['filters']));if(_0x2daff6['query'][_0x907f('0x3d')]){_0x5393b3[_0x907f('0x38')]=_[_0x907f('0x3a')](_0x5393b3['where'],{'$or':_[_0x907f('0x27')](_0x5393b3[_0x907f('0x32')],function(_0x4df386){var _0x103eb2={};_0x103eb2[_0x4df386]={'$like':'%'+_0x2daff6[_0x907f('0x2d')][_0x907f('0x3d')]+'%'};return _0x103eb2;})});}_0x5393b3=_[_0x907f('0x3a')]({},_0x5393b3,_0x2daff6[_0x907f('0x3e')]);return _0x2cf0c4[_0x907f('0x4b')](_0x5393b3);}})[_0x907f('0x21')](function(_0x5cad20){if(_0x5cad20){_0x5d1d97=_0x5cad20[_0x907f('0x33')];if(!_0x2daff6[_0x907f('0x2d')][_0x907f('0x34')](_0x907f('0x35'))){_0x5393b3[_0x907f('0x19')]=qs[_0x907f('0x19')](_0x2daff6[_0x907f('0x2d')][_0x907f('0x19')]);_0x5393b3['offset']=qs['offset'](_0x2daff6['query'][_0x907f('0x17')]);}return _0x2cf0c4[_0x907f('0x4b')](_0x5393b3);}})[_0x907f('0x21')](function(_0x252657){if(_0x252657){return _0x252657?{'count':_0x5d1d97,'rows':_0x252657}:null;}})['then'](respondWithResult(_0x4305e1,null))[_0x907f('0x42')](handleError(_0x4305e1,null));};exports[_0x907f('0x4c')]=function(_0x399c4f,_0x34b5cb,_0x768f41){var _0x14a9e9={};var _0x3ae702={};var _0x475229;var _0x1fc490;return db[_0x907f('0x28')][_0x907f('0x49')]({'where':{'id':_0x399c4f[_0x907f('0x47')]['id']}})[_0x907f('0x21')](handleEntityNotFound(_0x34b5cb,null))[_0x907f('0x21')](function(_0x244a0c){if(_0x244a0c){_0x475229=_0x244a0c;_0x3ae702[_0x907f('0x2c')]=_[_0x907f('0x2e')](db[_0x907f('0x4a')][_0x907f('0x29')]);_0x3ae702[_0x907f('0x2d')]=_[_0x907f('0x2e')](_0x399c4f[_0x907f('0x2d')]);_0x3ae702[_0x907f('0x2f')]=_[_0x907f('0x30')](_0x3ae702[_0x907f('0x2c')],_0x3ae702['query']);_0x14a9e9['attributes']=_[_0x907f('0x30')](_0x3ae702[_0x907f('0x2c')],qs[_0x907f('0x31')](_0x399c4f[_0x907f('0x2d')][_0x907f('0x31')]));_0x14a9e9[_0x907f('0x32')]=_0x14a9e9[_0x907f('0x32')][_0x907f('0x33')]?_0x14a9e9['attributes']:_0x3ae702[_0x907f('0x2c')];_0x14a9e9[_0x907f('0x36')]=qs['sort'](_0x399c4f[_0x907f('0x2d')][_0x907f('0x37')]);_0x14a9e9[_0x907f('0x38')]=qs[_0x907f('0x2f')](_[_0x907f('0x39')](_0x399c4f[_0x907f('0x2d')],_0x3ae702[_0x907f('0x2f')]));if(_0x399c4f[_0x907f('0x2d')]['filter']){_0x14a9e9[_0x907f('0x38')]=_[_0x907f('0x3a')](_0x14a9e9[_0x907f('0x38')],{'$or':_[_0x907f('0x27')](_0x14a9e9[_0x907f('0x32')],function(_0x694103){var _0x1a0841={};_0x1a0841[_0x694103]={'$like':'%'+_0x399c4f['query']['filter']+'%'};return _0x1a0841;})});}_0x14a9e9=_['merge']({},_0x14a9e9,_0x399c4f[_0x907f('0x3e')]);return _0x475229[_0x907f('0x4c')](_0x14a9e9);}})['then'](function(_0x392062){if(_0x392062){_0x1fc490=_0x392062[_0x907f('0x33')];if(!_0x399c4f[_0x907f('0x2d')][_0x907f('0x34')](_0x907f('0x35'))){_0x14a9e9[_0x907f('0x19')]=qs[_0x907f('0x19')](_0x399c4f['query']['limit']);_0x14a9e9[_0x907f('0x17')]=qs[_0x907f('0x17')](_0x399c4f['query'][_0x907f('0x17')]);}return _0x475229[_0x907f('0x4c')](_0x14a9e9);}})[_0x907f('0x21')](function(_0x51d8a2){if(_0x51d8a2){return _0x51d8a2?{'count':_0x1fc490,'rows':_0x51d8a2}:null;}})[_0x907f('0x21')](respondWithResult(_0x34b5cb,null))['catch'](handleError(_0x34b5cb,null));};exports[_0x907f('0x4d')]=function(_0x5da128,_0x4a38ab,_0x3043a7){var _0x18d9e3={};var _0x5636f8={};var _0xc592;var _0x39f331;return db[_0x907f('0x28')][_0x907f('0x49')]({'where':{'id':_0x5da128[_0x907f('0x47')]['id']}})[_0x907f('0x21')](handleEntityNotFound(_0x4a38ab,null))[_0x907f('0x21')](function(_0x48c8b8){if(_0x48c8b8){_0xc592=_0x48c8b8;_0x5636f8[_0x907f('0x2c')]=_[_0x907f('0x2e')](db[_0x907f('0x4e')][_0x907f('0x29')]);_0x5636f8[_0x907f('0x2d')]=_[_0x907f('0x2e')](_0x5da128[_0x907f('0x2d')]);_0x5636f8[_0x907f('0x2f')]=_[_0x907f('0x30')](_0x5636f8['model'],_0x5636f8['query']);_0x18d9e3[_0x907f('0x32')]=_[_0x907f('0x30')](_0x5636f8['model'],qs['fields'](_0x5da128[_0x907f('0x2d')][_0x907f('0x31')]));_0x18d9e3['attributes']=_0x18d9e3[_0x907f('0x32')][_0x907f('0x33')]?_0x18d9e3[_0x907f('0x32')]:_0x5636f8[_0x907f('0x2c')];_0x18d9e3[_0x907f('0x36')]=qs[_0x907f('0x37')](_0x5da128['query']['sort']);_0x18d9e3[_0x907f('0x38')]=qs[_0x907f('0x2f')](_['pick'](_0x5da128[_0x907f('0x2d')],_0x5636f8[_0x907f('0x2f')]));if(_0x5da128[_0x907f('0x2d')]['filter']){_0x18d9e3[_0x907f('0x38')]=_[_0x907f('0x3a')](_0x18d9e3['where'],{'$or':_['map'](_0x18d9e3[_0x907f('0x32')],function(_0x30c388){var _0xd61d66={};_0xd61d66[_0x30c388]={'$like':'%'+_0x5da128['query'][_0x907f('0x3d')]+'%'};return _0xd61d66;})});}_0x18d9e3=_[_0x907f('0x3a')]({},_0x18d9e3,_0x5da128['options']);return _0xc592['getTags'](_0x18d9e3);}})['then'](function(_0x104849){if(_0x104849){_0x39f331=_0x104849[_0x907f('0x33')];if(!_0x5da128[_0x907f('0x2d')][_0x907f('0x34')](_0x907f('0x35'))){_0x18d9e3['limit']=qs['limit'](_0x5da128['query'][_0x907f('0x19')]);_0x18d9e3['offset']=qs['offset'](_0x5da128['query'][_0x907f('0x17')]);}return _0xc592[_0x907f('0x4d')](_0x18d9e3);}})['then'](function(_0x2f53c0){if(_0x2f53c0){return _0x2f53c0?{'count':_0x39f331,'rows':_0x2f53c0}:null;}})['then'](respondWithResult(_0x4a38ab,null))[_0x907f('0x42')](handleError(_0x4a38ab,null));};exports[_0x907f('0x4f')]=function(_0x226ed1,_0x4da063,_0x2e1c2c){if(_0x226ed1['body']['id']){delete _0x226ed1[_0x907f('0x46')]['id'];}return db[_0x907f('0x28')][_0x907f('0x49')]({'where':{'id':_0x226ed1[_0x907f('0x47')]['id']}})[_0x907f('0x21')](handleEntityNotFound(_0x4da063,null))[_0x907f('0x21')](function(_0x3fcc18){if(_0x3fcc18){return _0x3fcc18[_0x907f('0x4f')](_0x226ed1[_0x907f('0x46')]['ids']||[]);}return null;})[_0x907f('0x21')](respondWithResult(_0x4da063,null))[_0x907f('0x42')](handleError(_0x4da063,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 1024ade..bed668e 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 _0x523c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','../../config/logger'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0x523c,0x1b8));var _0xc523=function(_0x26774d,_0x41b4d8){_0x26774d=_0x26774d-0x0;var _0x2bedef=_0x523c[_0x26774d];return _0x2bedef;};'use strict';var _=require(_0xc523('0x0'));var util=require('util');var logger=require(_0xc523('0x1'))(_0xc523('0x2'));var moment=require(_0xc523('0x3'));var BPromise=require(_0xc523('0x4'));var rp=require(_0xc523('0x5'));var fs=require('fs');var path=require(_0xc523('0x6'));var rimraf=require(_0xc523('0x7'));var config=require(_0xc523('0x8'));var attributes=require(_0xc523('0x9'));module[_0xc523('0xa')]=function(_0x4ccf2c,_0x17f4f7){return _0x4ccf2c[_0xc523('0xb')]('FreshdeskConfiguration',attributes,{'tableName':_0xc523('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x717a=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','util','bluebird','request-promise','rimraf'];(function(_0x1f7392,_0x19c591){var _0x3e28d9=function(_0x446901){while(--_0x446901){_0x1f7392['push'](_0x1f7392['shift']());}};_0x3e28d9(++_0x19c591);}(_0x717a,0x1c7));var _0xa717=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0x717a[_0x5a6961];return _0x4af0a6;};'use strict';var _=require('lodash');var util=require(_0xa717('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa717('0x1'));var rp=require(_0xa717('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa717('0x3'));var config=require(_0xa717('0x4'));var attributes=require(_0xa717('0x5'));module[_0xa717('0x6')]=function(_0x1b6a5b,_0x7ecea){return _0x1b6a5b[_0xa717('0x7')](_0xa717('0x8'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 285da9d..ee9b30e 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 _0xf84f=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x38413b,_0x134a69){var _0x24ccea=function(_0x495a58){while(--_0x495a58){_0x38413b['push'](_0x38413b['shift']());}};_0x24ccea(++_0x134a69);}(_0xf84f,0x127));var _0xff84=function(_0x1b8f47,_0x39fd81){_0x1b8f47=_0x1b8f47-0x0;var _0x7c0a43=_0xf84f[_0x1b8f47];return _0x7c0a43;};'use strict';var _=require(_0xff84('0x0'));var util=require(_0xff84('0x1'));var moment=require(_0xff84('0x2'));var BPromise=require(_0xff84('0x3'));var rs=require(_0xff84('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff84('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xff84('0x6'))(_0xff84('0x7'));var config=require(_0xff84('0x8'));var jayson=require(_0xff84('0x9'));var client=jayson[_0xff84('0xa')][_0xff84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a3466,_0x3d5bde,_0x2e1f45){return new BPromise(function(_0x312189,_0x28647c){return client[_0xff84('0xc')](_0x2a3466,_0x2e1f45)[_0xff84('0xd')](function(_0x5d634d){logger[_0xff84('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d5bde,_0xff84('0xf'));logger[_0xff84('0x10')](_0xff84('0x11'),_0x3d5bde,'request\x20sent',JSON[_0xff84('0x12')](_0x5d634d));if(_0x5d634d[_0xff84('0x13')]){if(_0x5d634d[_0xff84('0x13')]['code']===0x1f4){logger[_0xff84('0x13')](_0xff84('0x14'),_0x3d5bde,_0x5d634d[_0xff84('0x13')][_0xff84('0x15')]);return _0x28647c(_0x5d634d[_0xff84('0x13')][_0xff84('0x15')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d5bde,_0x5d634d['error'][_0xff84('0x15')]);return _0x312189(_0x5d634d[_0xff84('0x13')][_0xff84('0x15')]);}else{logger[_0xff84('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d5bde,'request\x20sent');_0x312189(_0x5d634d[_0xff84('0x16')][_0xff84('0x15')]);}})[_0xff84('0x17')](function(_0x2f78dc){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d5bde,_0x2f78dc);_0x28647c(_0x2f78dc);});});} \ No newline at end of file +var _0x24cf=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x39b39a,_0x4e84b3){var _0x3e54af=function(_0x171514){while(--_0x171514){_0x39b39a['push'](_0x39b39a['shift']());}};_0x3e54af(++_0x4e84b3);}(_0x24cf,0xe6));var _0xf24c=function(_0x479d81,_0x11e0ff){_0x479d81=_0x479d81-0x0;var _0x37e937=_0x24cf[_0x479d81];return _0x37e937;};'use strict';var _=require(_0xf24c('0x0'));var util=require(_0xf24c('0x1'));var moment=require(_0xf24c('0x2'));var BPromise=require(_0xf24c('0x3'));var rs=require(_0xf24c('0x4'));var fs=require('fs');var Redis=require(_0xf24c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf24c('0x6'));var logger=require('../../config/logger')(_0xf24c('0x7'));var config=require(_0xf24c('0x8'));var jayson=require(_0xf24c('0x9'));var client=jayson['client'][_0xf24c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8ca79a,_0x365105,_0x3eb33c){return new BPromise(function(_0x4948c1,_0xebe15d){return client[_0xf24c('0xb')](_0x8ca79a,_0x3eb33c)[_0xf24c('0xc')](function(_0x1d8722){logger[_0xf24c('0xd')](_0xf24c('0xe'),_0x365105,_0xf24c('0xf'));logger['debug'](_0xf24c('0x10'),_0x365105,_0xf24c('0xf'),JSON['stringify'](_0x1d8722));if(_0x1d8722[_0xf24c('0x11')]){if(_0x1d8722['error'][_0xf24c('0x12')]===0x1f4){logger[_0xf24c('0x11')](_0xf24c('0xe'),_0x365105,_0x1d8722[_0xf24c('0x11')][_0xf24c('0x13')]);return _0xebe15d(_0x1d8722[_0xf24c('0x11')][_0xf24c('0x13')]);}logger[_0xf24c('0x11')](_0xf24c('0xe'),_0x365105,_0x1d8722['error'][_0xf24c('0x13')]);return _0x4948c1(_0x1d8722[_0xf24c('0x11')][_0xf24c('0x13')]);}else{logger[_0xf24c('0xd')](_0xf24c('0xe'),_0x365105,_0xf24c('0xf'));_0x4948c1(_0x1d8722[_0xf24c('0x14')]['message']);}})['catch'](function(_0x52d5c9){logger[_0xf24c('0x11')](_0xf24c('0xe'),_0x365105,_0x52d5c9);_0xebe15d(_0x52d5c9);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index bca51a7..02163f8 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 _0x3fb7=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','index','get','/:id','isAuthenticated','show','create'];(function(_0x50de6d,_0xf6c1e){var _0x5c6eb1=function(_0x1048ba){while(--_0x1048ba){_0x50de6d['push'](_0x50de6d['shift']());}};_0x5c6eb1(++_0xf6c1e);}(_0x3fb7,0x1d3));var _0x73fb=function(_0x5c7cf9,_0x48bc0f){_0x5c7cf9=_0x5c7cf9-0x0;var _0x2497d7=_0x3fb7[_0x5c7cf9];return _0x2497d7;};'use strict';var multer=require(_0x73fb('0x0'));var util=require(_0x73fb('0x1'));var path=require(_0x73fb('0x2'));var timeout=require(_0x73fb('0x3'));var express=require('express');var router=express[_0x73fb('0x4')]();var fs_extra=require(_0x73fb('0x5'));var auth=require(_0x73fb('0x6'));var interaction=require(_0x73fb('0x7'));var config=require(_0x73fb('0x8'));var controller=require(_0x73fb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x73fb('0xa')]);router[_0x73fb('0xb')](_0x73fb('0xc'),auth[_0x73fb('0xd')](),controller[_0x73fb('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x73fb('0xf')]);router[_0x73fb('0x10')](_0x73fb('0xc'),auth[_0x73fb('0xd')](),controller[_0x73fb('0x11')]);router[_0x73fb('0x12')]('/:id',auth[_0x73fb('0xd')](),controller[_0x73fb('0x13')]);module[_0x73fb('0x14')]=router; \ No newline at end of file +var _0xc5ce=['create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','post'];(function(_0x593dc5,_0x44b1ee){var _0x2977cd=function(_0x178a2d){while(--_0x178a2d){_0x593dc5['push'](_0x593dc5['shift']());}};_0x2977cd(++_0x44b1ee);}(_0xc5ce,0x15a));var _0xec5c=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc5ce[_0x1969a7];return _0x3d665f;};'use strict';var multer=require(_0xec5c('0x0'));var util=require(_0xec5c('0x1'));var path=require(_0xec5c('0x2'));var timeout=require(_0xec5c('0x3'));var express=require(_0xec5c('0x4'));var router=express[_0xec5c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xec5c('0x6'));var interaction=require(_0xec5c('0x7'));var config=require(_0xec5c('0x8'));var controller=require(_0xec5c('0x9'));router[_0xec5c('0xa')]('/',auth[_0xec5c('0xb')](),controller[_0xec5c('0xc')]);router[_0xec5c('0xa')]('/:id',auth[_0xec5c('0xb')](),controller['show']);router[_0xec5c('0xd')]('/',auth['isAuthenticated'](),controller[_0xec5c('0xe')]);router[_0xec5c('0xf')](_0xec5c('0x10'),auth[_0xec5c('0xb')](),controller[_0xec5c('0x11')]);router['delete'](_0xec5c('0x10'),auth['isAuthenticated'](),controller[_0xec5c('0x12')]);module[_0xec5c('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index e92966c..4dffb50 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 _0xd9b0=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x412b2a,_0x11fb8a){var _0x5872e3=function(_0x202191){while(--_0x202191){_0x412b2a['push'](_0x412b2a['shift']());}};_0x5872e3(++_0x11fb8a);}(_0xd9b0,0x154));var _0x0d9b=function(_0x4d9485,_0x4f47c9){_0x4d9485=_0x4d9485-0x0;var _0x2f08dd=_0xd9b0[_0x4d9485];return _0x2f08dd;};'use strict';var Sequelize=require(_0x0d9b('0x0'));module[_0x0d9b('0x1')]={'type':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x3'),_0x0d9b('0x4'),_0x0d9b('0x5'),_0x0d9b('0x6'),_0x0d9b('0x7')),'defaultValue':_0x0d9b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0d9b('0x8')]},'keyType':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x3'),_0x0d9b('0x4'),_0x0d9b('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0d9b('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0d9b('0x8')]}}; \ No newline at end of file +var _0x272d=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x5ce948,_0x5946f2){var _0x348c4b=function(_0x4ad9ec){while(--_0x4ad9ec){_0x5ce948['push'](_0x5ce948['shift']());}};_0x348c4b(++_0x5946f2);}(_0x272d,0x91));var _0xd272=function(_0x3fd32f,_0x588235){_0x3fd32f=_0x3fd32f-0x0;var _0xa55282=_0x272d[_0x3fd32f];return _0xa55282;};'use strict';var Sequelize=require('sequelize');module[_0xd272('0x0')]={'type':{'type':Sequelize[_0xd272('0x1')](_0xd272('0x2'),_0xd272('0x3'),_0xd272('0x4'),_0xd272('0x5'),_0xd272('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd272('0x7')]},'key':{'type':Sequelize[_0xd272('0x7')]},'keyType':{'type':Sequelize[_0xd272('0x1')](_0xd272('0x2'),_0xd272('0x3'),_0xd272('0x4'))},'keyContent':{'type':Sequelize[_0xd272('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd272('0x7')]},'customField':{'type':Sequelize[_0xd272('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd272('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index ff01506..8fe7a95 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 _0x7794=['status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','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'];(function(_0x2d5155,_0x54a71d){var _0x18aab3=function(_0x5d12cf){while(--_0x5d12cf){_0x2d5155['push'](_0x2d5155['shift']());}};_0x18aab3(++_0x54a71d);}(_0x7794,0x7b));var _0x4779=function(_0x234a8a,_0x1f4b01){_0x234a8a=_0x234a8a-0x0;var _0x333eb8=_0x7794[_0x234a8a];return _0x333eb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4779('0x0'));var zipdir=require(_0x4779('0x1'));var jsonpatch=require(_0x4779('0x2'));var rp=require(_0x4779('0x3'));var moment=require('moment');var BPromise=require(_0x4779('0x4'));var Mustache=require(_0x4779('0x5'));var util=require('util');var path=require(_0x4779('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4779('0x7'));var _=require(_0x4779('0x8'));var squel=require('squel');var crypto=require(_0x4779('0x9'));var jsforce=require(_0x4779('0xa'));var deskjs=require(_0x4779('0xb'));var toCsv=require(_0x4779('0xc'));var querystring=require(_0x4779('0xd'));var Papa=require(_0x4779('0xe'));var Redis=require(_0x4779('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4779('0x10'));var as=require(_0x4779('0x11'));var hardwareService=require(_0x4779('0x12'));var logger=require(_0x4779('0x13'))(_0x4779('0x14'));var utils=require(_0x4779('0x15'));var config=require(_0x4779('0x16'));var licenseUtil=require(_0x4779('0x17'));var db=require(_0x4779('0x18'))['db'];function respondWithStatusCode(_0x13c989,_0x50e17e){_0x50e17e=_0x50e17e||0xcc;return function(_0x5b1219){if(_0x5b1219){return _0x13c989['sendStatus'](_0x50e17e);}return _0x13c989[_0x4779('0x19')](_0x50e17e)[_0x4779('0x1a')]();};}function respondWithResult(_0xb9a06f,_0xddf5cd){_0xddf5cd=_0xddf5cd||0xc8;return function(_0x4fe370){if(_0x4fe370){return _0xb9a06f[_0x4779('0x19')](_0xddf5cd)[_0x4779('0x1b')](_0x4fe370);}};}function respondWithFilteredResult(_0x4d71a0,_0x599deb){return function(_0x1dbbe1){if(_0x1dbbe1){var _0x2de2be=typeof _0x599deb[_0x4779('0x1c')]===_0x4779('0x1d')&&typeof _0x599deb['limit']==='undefined';var _0x445e0b=_0x1dbbe1[_0x4779('0x1e')];var _0x19fbb6=_0x2de2be?0x0:_0x599deb['offset'];var _0x3dbe70=_0x2de2be?_0x1dbbe1['count']:_0x599deb[_0x4779('0x1c')]+_0x599deb[_0x4779('0x1f')];var _0x478fa5;if(_0x3dbe70>=_0x445e0b){_0x3dbe70=_0x445e0b;_0x478fa5=0xc8;}else{_0x478fa5=0xce;}_0x4d71a0[_0x4779('0x19')](_0x478fa5);return _0x4d71a0['set'](_0x4779('0x20'),_0x19fbb6+'-'+_0x3dbe70+'/'+_0x445e0b)[_0x4779('0x1b')](_0x1dbbe1);}return null;};}function patchUpdates(_0x143ef6){return function(_0x298e25){try{jsonpatch[_0x4779('0x21')](_0x298e25,_0x143ef6,!![]);}catch(_0x1ce270){return BPromise['reject'](_0x1ce270);}return _0x298e25[_0x4779('0x22')]();};}function saveUpdates(_0x4f2158,_0x4ad246){return function(_0xd983f0){if(_0xd983f0){return _0xd983f0[_0x4779('0x23')](_0x4f2158)[_0x4779('0x24')](function(_0x2b7ab6){return _0x2b7ab6;});}return null;};}function removeEntity(_0x555cd6,_0x152887){return function(_0x29a39a){if(_0x29a39a){return _0x29a39a[_0x4779('0x25')]()['then'](function(){_0x555cd6[_0x4779('0x19')](0xcc)[_0x4779('0x1a')]();});}};}function handleEntityNotFound(_0x577b13,_0x1ce2d2){return function(_0x38af24){if(!_0x38af24){_0x577b13['sendStatus'](0x194);}return _0x38af24;};}function handleError(_0x20db7e,_0x277f55){_0x277f55=_0x277f55||0x1f4;return function(_0x211af1){logger[_0x4779('0x26')](_0x211af1[_0x4779('0x27')]);if(_0x211af1[_0x4779('0x28')]){delete _0x211af1[_0x4779('0x28')];}_0x20db7e[_0x4779('0x19')](_0x277f55)['send'](_0x211af1);};}exports[_0x4779('0x29')]=function(_0x1607a5,_0xb028f){var _0x28a261={},_0x8b4c42={},_0x40fb18={'count':0x0,'rows':[]};var _0x13ec28=_[_0x4779('0x2a')](db['FreshdeskField']['rawAttributes'],function(_0x179717){return{'name':_0x179717[_0x4779('0x2b')],'type':_0x179717[_0x4779('0x2c')][_0x4779('0x2d')]};});_0x8b4c42[_0x4779('0x2e')]=_['map'](_0x13ec28,_0x4779('0x28'));_0x8b4c42[_0x4779('0x2f')]=_[_0x4779('0x30')](_0x1607a5[_0x4779('0x2f')]);_0x8b4c42['filters']=_['intersection'](_0x8b4c42[_0x4779('0x2e')],_0x8b4c42['query']);_0x28a261[_0x4779('0x31')]=_[_0x4779('0x32')](_0x8b4c42[_0x4779('0x2e')],qs[_0x4779('0x33')](_0x1607a5[_0x4779('0x2f')][_0x4779('0x33')]));_0x28a261[_0x4779('0x31')]=_0x28a261[_0x4779('0x31')][_0x4779('0x34')]?_0x28a261[_0x4779('0x31')]:_0x8b4c42[_0x4779('0x2e')];if(!_0x1607a5[_0x4779('0x2f')]['hasOwnProperty']('nolimit')){_0x28a261[_0x4779('0x1f')]=qs['limit'](_0x1607a5[_0x4779('0x2f')]['limit']);_0x28a261[_0x4779('0x1c')]=qs[_0x4779('0x1c')](_0x1607a5[_0x4779('0x2f')][_0x4779('0x1c')]);}_0x28a261[_0x4779('0x35')]=qs['sort'](_0x1607a5['query'][_0x4779('0x36')]);_0x28a261[_0x4779('0x37')]=qs[_0x4779('0x38')](_[_0x4779('0x39')](_0x1607a5[_0x4779('0x2f')],_0x8b4c42[_0x4779('0x38')]),_0x13ec28);if(_0x1607a5[_0x4779('0x2f')][_0x4779('0x3a')]){_0x28a261[_0x4779('0x37')]=_[_0x4779('0x3b')](_0x28a261[_0x4779('0x37')],{'$or':_[_0x4779('0x2a')](_0x13ec28,function(_0x88603f){if(_0x88603f[_0x4779('0x2c')]!==_0x4779('0x3c')){var _0x1a2c16={};_0x1a2c16[_0x88603f[_0x4779('0x28')]]={'$like':'%'+_0x1607a5[_0x4779('0x2f')][_0x4779('0x3a')]+'%'};return _0x1a2c16;}})});}_0x28a261=_['merge']({},_0x28a261,_0x1607a5[_0x4779('0x3d')]);var _0x58ca36={'where':_0x28a261[_0x4779('0x37')]};return db[_0x4779('0x3e')][_0x4779('0x1e')](_0x58ca36)[_0x4779('0x24')](function(_0xc9873e){_0x40fb18[_0x4779('0x1e')]=_0xc9873e;if(_0x1607a5['query'][_0x4779('0x3f')]){_0x28a261['include']=[{'all':!![]}];}return db[_0x4779('0x3e')][_0x4779('0x40')](_0x28a261);})[_0x4779('0x24')](function(_0x3a3589){_0x40fb18[_0x4779('0x41')]=_0x3a3589;return _0x40fb18;})[_0x4779('0x24')](respondWithFilteredResult(_0xb028f,_0x28a261))['catch'](handleError(_0xb028f,null));};exports[_0x4779('0x42')]=function(_0x5cdc2b,_0x20abf7){var _0x3f1889={'raw':!![],'where':{'id':_0x5cdc2b['params']['id']}},_0x2e60ab={};_0x2e60ab[_0x4779('0x2e')]=_[_0x4779('0x30')](db[_0x4779('0x3e')][_0x4779('0x43')]);_0x2e60ab[_0x4779('0x2f')]=_[_0x4779('0x30')](_0x5cdc2b[_0x4779('0x2f')]);_0x2e60ab[_0x4779('0x38')]=_[_0x4779('0x32')](_0x2e60ab[_0x4779('0x2e')],_0x2e60ab[_0x4779('0x2f')]);_0x3f1889[_0x4779('0x31')]=_[_0x4779('0x32')](_0x2e60ab[_0x4779('0x2e')],qs[_0x4779('0x33')](_0x5cdc2b['query']['fields']));_0x3f1889[_0x4779('0x31')]=_0x3f1889[_0x4779('0x31')][_0x4779('0x34')]?_0x3f1889[_0x4779('0x31')]:_0x2e60ab[_0x4779('0x2e')];if(_0x5cdc2b[_0x4779('0x2f')][_0x4779('0x3f')]){_0x3f1889[_0x4779('0x44')]=[{'all':!![]}];}_0x3f1889=_['merge']({},_0x3f1889,_0x5cdc2b[_0x4779('0x3d')]);return db[_0x4779('0x3e')][_0x4779('0x45')](_0x3f1889)[_0x4779('0x24')](handleEntityNotFound(_0x20abf7,null))[_0x4779('0x24')](respondWithResult(_0x20abf7,null))[_0x4779('0x46')](handleError(_0x20abf7,null));};exports['create']=function(_0x7f419c,_0x39ecb5){return db[_0x4779('0x3e')][_0x4779('0x47')](_0x7f419c[_0x4779('0x48')],{})['then'](respondWithResult(_0x39ecb5,0xc9))[_0x4779('0x46')](handleError(_0x39ecb5,null));};exports[_0x4779('0x23')]=function(_0x3873d4,_0x4a1040){if(_0x3873d4[_0x4779('0x48')]['id']){delete _0x3873d4['body']['id'];}return db[_0x4779('0x3e')][_0x4779('0x45')]({'where':{'id':_0x3873d4[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a1040,null))[_0x4779('0x24')](saveUpdates(_0x3873d4['body'],null))[_0x4779('0x24')](respondWithResult(_0x4a1040,null))[_0x4779('0x46')](handleError(_0x4a1040,null));};exports[_0x4779('0x25')]=function(_0x58e14e,_0x5dfdb7){return db['FreshdeskField'][_0x4779('0x45')]({'where':{'id':_0x58e14e[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x5dfdb7,null))[_0x4779('0x24')](removeEntity(_0x5dfdb7,null))[_0x4779('0x46')](handleError(_0x5dfdb7,null));}; \ No newline at end of file +var _0x2e54=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','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','apply','reject','save','then','error','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x4207f4,_0x1f778b){var _0x29a621=function(_0xa6f5b7){while(--_0xa6f5b7){_0x4207f4['push'](_0x4207f4['shift']());}};_0x29a621(++_0x1f778b);}(_0x2e54,0x1dd));var _0x42e5=function(_0x282455,_0x4f5e3d){_0x282455=_0x282455-0x0;var _0x14e262=_0x2e54[_0x282455];return _0x14e262;};'use strict';var emlformat=require(_0x42e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42e5('0x1'));var rp=require(_0x42e5('0x2'));var moment=require(_0x42e5('0x3'));var BPromise=require(_0x42e5('0x4'));var Mustache=require(_0x42e5('0x5'));var util=require(_0x42e5('0x6'));var path=require(_0x42e5('0x7'));var sox=require('sox');var csv=require(_0x42e5('0x8'));var ejs=require(_0x42e5('0x9'));var fs=require('fs');var fs_extra=require(_0x42e5('0xa'));var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x8'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var as=require(_0x42e5('0x12'));var hardwareService=require(_0x42e5('0x13'));var logger=require(_0x42e5('0x14'))('api');var utils=require(_0x42e5('0x15'));var config=require(_0x42e5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x42e5('0x17'))['db'];function respondWithStatusCode(_0x12385d,_0x4530ba){_0x4530ba=_0x4530ba||0xcc;return function(_0x41598d){if(_0x41598d){return _0x12385d[_0x42e5('0x18')](_0x4530ba);}return _0x12385d[_0x42e5('0x19')](_0x4530ba)[_0x42e5('0x1a')]();};}function respondWithResult(_0x96fae2,_0x447648){_0x447648=_0x447648||0xc8;return function(_0x23957f){if(_0x23957f){return _0x96fae2['status'](_0x447648)[_0x42e5('0x1b')](_0x23957f);}};}function respondWithFilteredResult(_0x1d8e52,_0x4034bd){return function(_0x388300){if(_0x388300){var _0x2f4999=typeof _0x4034bd[_0x42e5('0x1c')]===_0x42e5('0x1d')&&typeof _0x4034bd[_0x42e5('0x1e')]===_0x42e5('0x1d');var _0x3c7b79=_0x388300[_0x42e5('0x1f')];var _0x38282d=_0x2f4999?0x0:_0x4034bd[_0x42e5('0x1c')];var _0x23fe09=_0x2f4999?_0x388300['count']:_0x4034bd[_0x42e5('0x1c')]+_0x4034bd['limit'];var _0x5f4428;if(_0x23fe09>=_0x3c7b79){_0x23fe09=_0x3c7b79;_0x5f4428=0xc8;}else{_0x5f4428=0xce;}_0x1d8e52[_0x42e5('0x19')](_0x5f4428);return _0x1d8e52[_0x42e5('0x20')]('Content-Range',_0x38282d+'-'+_0x23fe09+'/'+_0x3c7b79)[_0x42e5('0x1b')](_0x388300);}return null;};}function patchUpdates(_0x39a3e2){return function(_0x1c2169){try{jsonpatch[_0x42e5('0x21')](_0x1c2169,_0x39a3e2,!![]);}catch(_0x1150f4){return BPromise[_0x42e5('0x22')](_0x1150f4);}return _0x1c2169[_0x42e5('0x23')]();};}function saveUpdates(_0x58eee5,_0x4da508){return function(_0x283d44){if(_0x283d44){return _0x283d44['update'](_0x58eee5)[_0x42e5('0x24')](function(_0x2e9574){return _0x2e9574;});}return null;};}function removeEntity(_0x37d10e,_0x49490f){return function(_0x32380f){if(_0x32380f){return _0x32380f['destroy']()[_0x42e5('0x24')](function(){_0x37d10e[_0x42e5('0x19')](0xcc)[_0x42e5('0x1a')]();});}};}function handleEntityNotFound(_0x275c80,_0x4638bc){return function(_0x4f52b2){if(!_0x4f52b2){_0x275c80['sendStatus'](0x194);}return _0x4f52b2;};}function handleError(_0x3115e4,_0x534a26){_0x534a26=_0x534a26||0x1f4;return function(_0x56f812){logger[_0x42e5('0x25')](_0x56f812['stack']);if(_0x56f812[_0x42e5('0x26')]){delete _0x56f812[_0x42e5('0x26')];}_0x3115e4[_0x42e5('0x19')](_0x534a26)[_0x42e5('0x27')](_0x56f812);};}exports[_0x42e5('0x28')]=function(_0x2f1edc,_0x59a46b){var _0x3e2ea5={},_0x201d9e={},_0x39f763={'count':0x0,'rows':[]};var _0x2c53d4=_[_0x42e5('0x29')](db[_0x42e5('0x2a')][_0x42e5('0x2b')],function(_0x282cbf){return{'name':_0x282cbf[_0x42e5('0x2c')],'type':_0x282cbf[_0x42e5('0x2d')][_0x42e5('0x2e')]};});_0x201d9e[_0x42e5('0x2f')]=_[_0x42e5('0x29')](_0x2c53d4,'name');_0x201d9e[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0x2f1edc[_0x42e5('0x30')]);_0x201d9e[_0x42e5('0x32')]=_['intersection'](_0x201d9e['model'],_0x201d9e[_0x42e5('0x30')]);_0x3e2ea5['attributes']=_[_0x42e5('0x33')](_0x201d9e['model'],qs[_0x42e5('0x34')](_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x34')]));_0x3e2ea5['attributes']=_0x3e2ea5[_0x42e5('0x35')][_0x42e5('0x36')]?_0x3e2ea5['attributes']:_0x201d9e[_0x42e5('0x2f')];if(!_0x2f1edc['query'][_0x42e5('0x37')](_0x42e5('0x38'))){_0x3e2ea5[_0x42e5('0x1e')]=qs[_0x42e5('0x1e')](_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x1e')]);_0x3e2ea5[_0x42e5('0x1c')]=qs['offset'](_0x2f1edc['query'][_0x42e5('0x1c')]);}_0x3e2ea5[_0x42e5('0x39')]=qs[_0x42e5('0x3a')](_0x2f1edc['query']['sort']);_0x3e2ea5['where']=qs['filters'](_[_0x42e5('0x3b')](_0x2f1edc[_0x42e5('0x30')],_0x201d9e[_0x42e5('0x32')]),_0x2c53d4);if(_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x3c')]){_0x3e2ea5[_0x42e5('0x3d')]=_[_0x42e5('0x3e')](_0x3e2ea5[_0x42e5('0x3d')],{'$or':_['map'](_0x2c53d4,function(_0x260413){if(_0x260413['type']!==_0x42e5('0x3f')){var _0x343363={};_0x343363[_0x260413[_0x42e5('0x26')]]={'$like':'%'+_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x3c')]+'%'};return _0x343363;}})});}_0x3e2ea5=_[_0x42e5('0x3e')]({},_0x3e2ea5,_0x2f1edc[_0x42e5('0x40')]);var _0x5ab9b8={'where':_0x3e2ea5[_0x42e5('0x3d')]};return db[_0x42e5('0x2a')]['count'](_0x5ab9b8)[_0x42e5('0x24')](function(_0x5e8f96){_0x39f763['count']=_0x5e8f96;if(_0x2f1edc['query'][_0x42e5('0x41')]){_0x3e2ea5[_0x42e5('0x42')]=[{'all':!![]}];}return db[_0x42e5('0x2a')][_0x42e5('0x43')](_0x3e2ea5);})[_0x42e5('0x24')](function(_0x77aa22){_0x39f763[_0x42e5('0x44')]=_0x77aa22;return _0x39f763;})['then'](respondWithFilteredResult(_0x59a46b,_0x3e2ea5))[_0x42e5('0x45')](handleError(_0x59a46b,null));};exports[_0x42e5('0x46')]=function(_0x5bec97,_0x398b73){var _0x1c697a={'raw':!![],'where':{'id':_0x5bec97[_0x42e5('0x47')]['id']}},_0x5db771={};_0x5db771[_0x42e5('0x2f')]=_[_0x42e5('0x31')](db[_0x42e5('0x2a')][_0x42e5('0x2b')]);_0x5db771['query']=_[_0x42e5('0x31')](_0x5bec97[_0x42e5('0x30')]);_0x5db771[_0x42e5('0x32')]=_[_0x42e5('0x33')](_0x5db771['model'],_0x5db771[_0x42e5('0x30')]);_0x1c697a[_0x42e5('0x35')]=_[_0x42e5('0x33')](_0x5db771[_0x42e5('0x2f')],qs[_0x42e5('0x34')](_0x5bec97[_0x42e5('0x30')][_0x42e5('0x34')]));_0x1c697a[_0x42e5('0x35')]=_0x1c697a['attributes'][_0x42e5('0x36')]?_0x1c697a['attributes']:_0x5db771['model'];if(_0x5bec97[_0x42e5('0x30')][_0x42e5('0x41')]){_0x1c697a[_0x42e5('0x42')]=[{'all':!![]}];}_0x1c697a=_[_0x42e5('0x3e')]({},_0x1c697a,_0x5bec97[_0x42e5('0x40')]);return db[_0x42e5('0x2a')][_0x42e5('0x48')](_0x1c697a)['then'](handleEntityNotFound(_0x398b73,null))[_0x42e5('0x24')](respondWithResult(_0x398b73,null))[_0x42e5('0x45')](handleError(_0x398b73,null));};exports[_0x42e5('0x49')]=function(_0x21a047,_0x1086b2){return db[_0x42e5('0x2a')][_0x42e5('0x49')](_0x21a047[_0x42e5('0x4a')],{})['then'](respondWithResult(_0x1086b2,0xc9))[_0x42e5('0x45')](handleError(_0x1086b2,null));};exports[_0x42e5('0x4b')]=function(_0x3616f4,_0x48757e){if(_0x3616f4[_0x42e5('0x4a')]['id']){delete _0x3616f4[_0x42e5('0x4a')]['id'];}return db[_0x42e5('0x2a')][_0x42e5('0x48')]({'where':{'id':_0x3616f4[_0x42e5('0x47')]['id']}})['then'](handleEntityNotFound(_0x48757e,null))[_0x42e5('0x24')](saveUpdates(_0x3616f4['body'],null))[_0x42e5('0x24')](respondWithResult(_0x48757e,null))[_0x42e5('0x45')](handleError(_0x48757e,null));};exports[_0x42e5('0x4c')]=function(_0x48b63b,_0x50f59c){return db['FreshdeskField'][_0x42e5('0x48')]({'where':{'id':_0x48b63b[_0x42e5('0x47')]['id']}})[_0x42e5('0x24')](handleEntityNotFound(_0x50f59c,null))[_0x42e5('0x24')](removeEntity(_0x50f59c,null))['catch'](handleError(_0x50f59c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 2ffd83e..6557aa1 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 _0x65d9=['./intFreshdeskField.attributes','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x47d7ec,_0x17f197){var _0x98674a=function(_0x4f7db3){while(--_0x4f7db3){_0x47d7ec['push'](_0x47d7ec['shift']());}};_0x98674a(++_0x17f197);}(_0x65d9,0x1bf));var _0x965d=function(_0x23d6cf,_0x4c8015){_0x23d6cf=_0x23d6cf-0x0;var _0xeb1057=_0x65d9[_0x23d6cf];return _0xeb1057;};'use strict';var _=require(_0x965d('0x0'));var util=require(_0x965d('0x1'));var logger=require(_0x965d('0x2'))('api');var moment=require(_0x965d('0x3'));var BPromise=require(_0x965d('0x4'));var rp=require(_0x965d('0x5'));var fs=require('fs');var path=require(_0x965d('0x6'));var rimraf=require(_0x965d('0x7'));var config=require('../../config/environment');var attributes=require(_0x965d('0x8'));module['exports']=function(_0x758c4d,_0x36fe2c){return _0x758c4d['define']('FreshdeskField',attributes,{'tableName':_0x965d('0x9'),'paranoid':![],'indexes':[{'name':_0x965d('0xa'),'fields':[_0x965d('0xb'),_0x965d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdff5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId'];(function(_0x288aac,_0x4e35d5){var _0x277495=function(_0x108d89){while(--_0x108d89){_0x288aac['push'](_0x288aac['shift']());}};_0x277495(++_0x4e35d5);}(_0xdff5,0x100));var _0x5dff=function(_0xce58e0,_0x2a85da){_0xce58e0=_0xce58e0-0x0;var _0x17f4b5=_0xdff5[_0xce58e0];return _0x17f4b5;};'use strict';var _=require('lodash');var util=require(_0x5dff('0x0'));var logger=require(_0x5dff('0x1'))(_0x5dff('0x2'));var moment=require(_0x5dff('0x3'));var BPromise=require(_0x5dff('0x4'));var rp=require(_0x5dff('0x5'));var fs=require('fs');var path=require(_0x5dff('0x6'));var rimraf=require(_0x5dff('0x7'));var config=require(_0x5dff('0x8'));var attributes=require(_0x5dff('0x9'));module[_0x5dff('0xa')]=function(_0x490fdd,_0x5999bc){return _0x490fdd[_0x5dff('0xb')]('FreshdeskField',attributes,{'tableName':_0x5dff('0xc'),'paranoid':![],'indexes':[{'name':_0x5dff('0xd'),'fields':[_0x5dff('0xe'),_0x5dff('0xf')],'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 783380c..20a1f47 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 _0x8e2e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x28e5f2,_0x54c4eb){var _0x50fdb1=function(_0x3ab402){while(--_0x3ab402){_0x28e5f2['push'](_0x28e5f2['shift']());}};_0x50fdb1(++_0x54c4eb);}(_0x8e2e,0xb6));var _0xe8e2=function(_0x37bed5,_0x4fcea4){_0x37bed5=_0x37bed5-0x0;var _0xfd86c3=_0x8e2e[_0x37bed5];return _0xfd86c3;};'use strict';var _=require(_0xe8e2('0x0'));var util=require(_0xe8e2('0x1'));var moment=require('moment');var BPromise=require(_0xe8e2('0x2'));var rs=require(_0xe8e2('0x3'));var fs=require('fs');var Redis=require(_0xe8e2('0x4'));var db=require(_0xe8e2('0x5'))['db'];var utils=require(_0xe8e2('0x6'));var logger=require('../../config/logger')(_0xe8e2('0x7'));var config=require(_0xe8e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8e2('0x9')][_0xe8e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bf221,_0x2c6e8d,_0x2851fe){return new BPromise(function(_0x1cf144,_0x34597d){return client[_0xe8e2('0xb')](_0x1bf221,_0x2851fe)[_0xe8e2('0xc')](function(_0x53db51){logger[_0xe8e2('0xd')](_0xe8e2('0xe'),_0x2c6e8d,'request\x20sent');logger[_0xe8e2('0xf')](_0xe8e2('0x10'),_0x2c6e8d,_0xe8e2('0x11'),JSON[_0xe8e2('0x12')](_0x53db51));if(_0x53db51['error']){if(_0x53db51[_0xe8e2('0x13')][_0xe8e2('0x14')]===0x1f4){logger['error'](_0xe8e2('0xe'),_0x2c6e8d,_0x53db51[_0xe8e2('0x13')]['message']);return _0x34597d(_0x53db51[_0xe8e2('0x13')][_0xe8e2('0x15')]);}logger[_0xe8e2('0x13')](_0xe8e2('0xe'),_0x2c6e8d,_0x53db51[_0xe8e2('0x13')]['message']);return _0x1cf144(_0x53db51['error'][_0xe8e2('0x15')]);}else{logger[_0xe8e2('0xd')](_0xe8e2('0xe'),_0x2c6e8d,'request\x20sent');_0x1cf144(_0x53db51['result'][_0xe8e2('0x15')]);}})[_0xe8e2('0x16')](function(_0x386101){logger['error'](_0xe8e2('0xe'),_0x2c6e8d,_0x386101);_0x34597d(_0x386101);});});} \ No newline at end of file +var _0x2472=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util'];(function(_0x226391,_0x58d432){var _0x58f2b6=function(_0x51e1d0){while(--_0x51e1d0){_0x226391['push'](_0x226391['shift']());}};_0x58f2b6(++_0x58d432);}(_0x2472,0x8a));var _0x2247=function(_0x58e6ab,_0xd89ded){_0x58e6ab=_0x58e6ab-0x0;var _0x56f318=_0x2472[_0x58e6ab];return _0x56f318;};'use strict';var _=require(_0x2247('0x0'));var util=require(_0x2247('0x1'));var moment=require('moment');var BPromise=require(_0x2247('0x2'));var rs=require(_0x2247('0x3'));var fs=require('fs');var Redis=require(_0x2247('0x4'));var db=require(_0x2247('0x5'))['db'];var utils=require(_0x2247('0x6'));var logger=require('../../config/logger')(_0x2247('0x7'));var config=require('../../config/environment');var jayson=require(_0x2247('0x8'));var client=jayson[_0x2247('0x9')][_0x2247('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x122963,_0x186995,_0x56fe21){return new BPromise(function(_0x237045,_0x5ad98a){return client[_0x2247('0xb')](_0x122963,_0x56fe21)['then'](function(_0x4d88b6){logger[_0x2247('0xc')](_0x2247('0xd'),_0x186995,'request\x20sent');logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x186995,_0x2247('0xe'),JSON['stringify'](_0x4d88b6));if(_0x4d88b6[_0x2247('0xf')]){if(_0x4d88b6[_0x2247('0xf')][_0x2247('0x10')]===0x1f4){logger['error'](_0x2247('0xd'),_0x186995,_0x4d88b6[_0x2247('0xf')][_0x2247('0x11')]);return _0x5ad98a(_0x4d88b6[_0x2247('0xf')][_0x2247('0x11')]);}logger[_0x2247('0xf')](_0x2247('0xd'),_0x186995,_0x4d88b6[_0x2247('0xf')]['message']);return _0x237045(_0x4d88b6['error'][_0x2247('0x11')]);}else{logger[_0x2247('0xc')](_0x2247('0xd'),_0x186995,_0x2247('0xe'));_0x237045(_0x4d88b6[_0x2247('0x12')][_0x2247('0x11')]);}})[_0x2247('0x13')](function(_0x1f38c4){logger[_0x2247('0xf')](_0x2247('0xd'),_0x186995,_0x1f38c4);_0x5ad98a(_0x1f38c4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index ca44bfc..cee92d0 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 _0x6324=['isAuthenticated','index','show','getConfigurations','getFields','post','create','/:id/configurations','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x4d3055,_0x280ae7){var _0x4722f6=function(_0x53fa64){while(--_0x53fa64){_0x4d3055['push'](_0x4d3055['shift']());}};_0x4722f6(++_0x280ae7);}(_0x6324,0x142));var _0x4632=function(_0x564e9f,_0x225a15){_0x564e9f=_0x564e9f-0x0;var _0x3a9f3e=_0x6324[_0x564e9f];return _0x3a9f3e;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id/configurations',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/fields',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0xd')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0xe')]);router[_0x4632('0xd')](_0x4632('0xf'),auth[_0x4632('0x8')](),controller['addConfiguration']);router[_0x4632('0x10')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0x11')]);router[_0x4632('0x12')](_0x4632('0x13'),auth['isAuthenticated'](),controller[_0x4632('0x14')]);module[_0x4632('0x15')]=router; \ No newline at end of file +var _0xefda=['update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getFields','post','create','addConfiguration','put'];(function(_0xe7ee5f,_0x239c63){var _0x459e06=function(_0x5ac7a1){while(--_0x5ac7a1){_0xe7ee5f['push'](_0xe7ee5f['shift']());}};_0x459e06(++_0x239c63);}(_0xefda,0x96));var _0xaefd=function(_0x5ba9de,_0x4a867e){_0x5ba9de=_0x5ba9de-0x0;var _0x46b1d2=_0xefda[_0x5ba9de];return _0x46b1d2;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0xe')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0xe')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);router[_0xaefd('0x11')](_0xaefd('0xa'),auth['isAuthenticated'](),controller[_0xaefd('0x12')]);router['delete'](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x13')]);module[_0xaefd('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index a4c93a2..1a82c28 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 _0xb016=['remoteUri','sequelize','exports','STRING'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0xb016,0x159));var _0x6b01=function(_0x567630,_0x5f3f62){_0x567630=_0x567630-0x0;var _0x1f602a=_0xb016[_0x567630];return _0x1f602a;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b01('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'serverUrl':{'type':Sequelize[_0x6b01('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe820=['sequelize','STRING','username'];(function(_0x4b3be8,_0x13acd6){var _0xc9d66=function(_0x3b147f){while(--_0x3b147f){_0x4b3be8['push'](_0x4b3be8['shift']());}};_0xc9d66(++_0x13acd6);}(_0xe820,0xd2));var _0x0e82=function(_0xe70803,_0x4139a0){_0xe70803=_0xe70803-0x0;var _0x3a3178=_0xe820[_0xe70803];return _0x3a3178;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0e82('0x2')},'apiKey':{'type':Sequelize[_0x0e82('0x1')]},'remoteUri':{'type':Sequelize[_0x0e82('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 9018b3b..74fb24d 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 _0xc675=['getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','stack','name','send','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','type','filter','FreshsalesAccount','includeAll','findAll','rows','catch','show','params','keys','options','find','create','body','update','destroy','getConfigurations','FreshsalesConfiguration','pick','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','username','remoteUri','apiKey','lastIndexOf','%s%s','test','statusCode'];(function(_0x10311c,_0x171751){var _0x1b5658=function(_0x22bcbd){while(--_0x22bcbd){_0x10311c['push'](_0x10311c['shift']());}};_0x1b5658(++_0x171751);}(_0xc675,0x11e));var _0x5c67=function(_0x5446d1,_0x11450a){_0x5446d1=_0x5446d1-0x0;var _0x29f2ea=_0xc675[_0x5446d1];return _0x29f2ea;};'use strict';var emlformat=require(_0x5c67('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5c67('0x1'));var rp=require(_0x5c67('0x2'));var moment=require('moment');var BPromise=require(_0x5c67('0x3'));var Mustache=require(_0x5c67('0x4'));var util=require(_0x5c67('0x5'));var path=require(_0x5c67('0x6'));var sox=require('sox');var csv=require(_0x5c67('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c67('0x8'));var _=require(_0x5c67('0x9'));var squel=require(_0x5c67('0xa'));var crypto=require(_0x5c67('0xb'));var jsforce=require(_0x5c67('0xc'));var deskjs=require(_0x5c67('0xd'));var toCsv=require(_0x5c67('0x7'));var querystring=require(_0x5c67('0xe'));var Papa=require(_0x5c67('0xf'));var Redis=require(_0x5c67('0x10'));var authService=require(_0x5c67('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c67('0x12'))(_0x5c67('0x13'));var utils=require(_0x5c67('0x14'));var config=require(_0x5c67('0x15'));var licenseUtil=require(_0x5c67('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5c67('0x17'));function respondWithStatusCode(_0x4a85e3,_0x4622e9){_0x4622e9=_0x4622e9||0xcc;return function(_0x20d0af){if(_0x20d0af){return _0x4a85e3[_0x5c67('0x18')](_0x4622e9);}return _0x4a85e3[_0x5c67('0x19')](_0x4622e9)[_0x5c67('0x1a')]();};}function respondWithResult(_0x4eafa7,_0x2684d6){_0x2684d6=_0x2684d6||0xc8;return function(_0x5a25bd){if(_0x5a25bd){return _0x4eafa7['status'](_0x2684d6)['json'](_0x5a25bd);}};}function respondWithFilteredResult(_0x5b90f1,_0x26cc1f){return function(_0x8f967){if(_0x8f967){var _0x135740=typeof _0x26cc1f[_0x5c67('0x1b')]===_0x5c67('0x1c')&&typeof _0x26cc1f[_0x5c67('0x1d')]===_0x5c67('0x1c');var _0x178eb4=_0x8f967[_0x5c67('0x1e')];var _0x31ab6d=_0x135740?0x0:_0x26cc1f[_0x5c67('0x1b')];var _0x2eebf6=_0x135740?_0x8f967['count']:_0x26cc1f[_0x5c67('0x1b')]+_0x26cc1f[_0x5c67('0x1d')];var _0x297141;if(_0x2eebf6>=_0x178eb4){_0x2eebf6=_0x178eb4;_0x297141=0xc8;}else{_0x297141=0xce;}_0x5b90f1[_0x5c67('0x19')](_0x297141);return _0x5b90f1[_0x5c67('0x1f')](_0x5c67('0x20'),_0x31ab6d+'-'+_0x2eebf6+'/'+_0x178eb4)['json'](_0x8f967);}return null;};}function patchUpdates(_0x5bd82e){return function(_0x342849){try{jsonpatch['apply'](_0x342849,_0x5bd82e,!![]);}catch(_0x38d890){return BPromise[_0x5c67('0x21')](_0x38d890);}return _0x342849[_0x5c67('0x22')]();};}function saveUpdates(_0x3d044c,_0x2cc15e){return function(_0xf22e8f){if(_0xf22e8f){return _0xf22e8f['update'](_0x3d044c)[_0x5c67('0x23')](function(_0x3c0efd){return _0x3c0efd;});}return null;};}function removeEntity(_0xb570fa,_0x542e78){return function(_0x53b979){if(_0x53b979){return _0x53b979['destroy']()['then'](function(){_0xb570fa[_0x5c67('0x19')](0xcc)[_0x5c67('0x1a')]();});}};}function handleEntityNotFound(_0x1bfea9,_0x4d80d3){return function(_0x2c9c0d){if(!_0x2c9c0d){_0x1bfea9['sendStatus'](0x194);}return _0x2c9c0d;};}function handleError(_0x1381b5,_0x5a8fd4){_0x5a8fd4=_0x5a8fd4||0x1f4;return function(_0x51ecea){logger[_0x5c67('0x24')](_0x51ecea[_0x5c67('0x25')]);if(_0x51ecea[_0x5c67('0x26')]){delete _0x51ecea[_0x5c67('0x26')];}_0x1381b5[_0x5c67('0x19')](_0x5a8fd4)[_0x5c67('0x27')](_0x51ecea);};}exports['index']=function(_0x65070d,_0x31ca26){var _0x2614bd={},_0x39bd49={},_0x5e2e23={'count':0x0,'rows':[]};var _0x1546ed=_['map'](db['FreshsalesAccount'][_0x5c67('0x28')],function(_0x4737be){return{'name':_0x4737be[_0x5c67('0x29')],'type':_0x4737be['type']['key']};});_0x39bd49[_0x5c67('0x2a')]=_[_0x5c67('0x2b')](_0x1546ed,_0x5c67('0x26'));_0x39bd49[_0x5c67('0x2c')]=_['keys'](_0x65070d[_0x5c67('0x2c')]);_0x39bd49[_0x5c67('0x2d')]=_[_0x5c67('0x2e')](_0x39bd49[_0x5c67('0x2a')],_0x39bd49[_0x5c67('0x2c')]);_0x2614bd[_0x5c67('0x2f')]=_['intersection'](_0x39bd49['model'],qs[_0x5c67('0x30')](_0x65070d[_0x5c67('0x2c')][_0x5c67('0x30')]));_0x2614bd[_0x5c67('0x2f')]=_0x2614bd[_0x5c67('0x2f')][_0x5c67('0x31')]?_0x2614bd[_0x5c67('0x2f')]:_0x39bd49[_0x5c67('0x2a')];if(!_0x65070d['query']['hasOwnProperty'](_0x5c67('0x32'))){_0x2614bd[_0x5c67('0x1d')]=qs['limit'](_0x65070d['query'][_0x5c67('0x1d')]);_0x2614bd['offset']=qs[_0x5c67('0x1b')](_0x65070d['query'][_0x5c67('0x1b')]);}_0x2614bd[_0x5c67('0x33')]=qs[_0x5c67('0x34')](_0x65070d['query'][_0x5c67('0x34')]);_0x2614bd['where']=qs[_0x5c67('0x2d')](_['pick'](_0x65070d[_0x5c67('0x2c')],_0x39bd49[_0x5c67('0x2d')]),_0x1546ed);if(_0x65070d[_0x5c67('0x2c')]['filter']){_0x2614bd[_0x5c67('0x35')]=_[_0x5c67('0x36')](_0x2614bd[_0x5c67('0x35')],{'$or':_[_0x5c67('0x2b')](_0x1546ed,function(_0x32522f){if(_0x32522f[_0x5c67('0x37')]!=='VIRTUAL'){var _0x1bb7c8={};_0x1bb7c8[_0x32522f[_0x5c67('0x26')]]={'$like':'%'+_0x65070d['query'][_0x5c67('0x38')]+'%'};return _0x1bb7c8;}})});}_0x2614bd=_['merge']({},_0x2614bd,_0x65070d['options']);var _0x27f8f1={'where':_0x2614bd[_0x5c67('0x35')]};return db[_0x5c67('0x39')][_0x5c67('0x1e')](_0x27f8f1)[_0x5c67('0x23')](function(_0x481320){_0x5e2e23[_0x5c67('0x1e')]=_0x481320;if(_0x65070d['query'][_0x5c67('0x3a')]){_0x2614bd['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x5c67('0x3b')](_0x2614bd);})[_0x5c67('0x23')](function(_0x125e3b){_0x5e2e23[_0x5c67('0x3c')]=_0x125e3b;return _0x5e2e23;})[_0x5c67('0x23')](respondWithFilteredResult(_0x31ca26,_0x2614bd))[_0x5c67('0x3d')](handleError(_0x31ca26,null));};exports[_0x5c67('0x3e')]=function(_0x1727ac,_0x17bac2){var _0x1c59fb={'raw':![],'where':{'id':_0x1727ac[_0x5c67('0x3f')]['id']}},_0x1a0a3c={};_0x1a0a3c[_0x5c67('0x2a')]=_[_0x5c67('0x40')](db[_0x5c67('0x39')][_0x5c67('0x28')]);_0x1a0a3c[_0x5c67('0x2c')]=_[_0x5c67('0x40')](_0x1727ac['query']);_0x1a0a3c[_0x5c67('0x2d')]=_[_0x5c67('0x2e')](_0x1a0a3c['model'],_0x1a0a3c[_0x5c67('0x2c')]);_0x1c59fb[_0x5c67('0x2f')]=_[_0x5c67('0x2e')](_0x1a0a3c['model'],qs['fields'](_0x1727ac[_0x5c67('0x2c')][_0x5c67('0x30')]));_0x1c59fb[_0x5c67('0x2f')]=_0x1c59fb['attributes']['length']?_0x1c59fb[_0x5c67('0x2f')]:_0x1a0a3c[_0x5c67('0x2a')];if(_0x1727ac[_0x5c67('0x2c')][_0x5c67('0x3a')]){_0x1c59fb['include']=[{'all':!![]}];}_0x1c59fb=_[_0x5c67('0x36')]({},_0x1c59fb,_0x1727ac[_0x5c67('0x41')]);return db[_0x5c67('0x39')][_0x5c67('0x42')](_0x1c59fb)[_0x5c67('0x23')](handleEntityNotFound(_0x17bac2,null))[_0x5c67('0x23')](respondWithResult(_0x17bac2,null))['catch'](handleError(_0x17bac2,null));};exports[_0x5c67('0x43')]=function(_0xf8491c,_0xcffe34){return db[_0x5c67('0x39')][_0x5c67('0x43')](_0xf8491c[_0x5c67('0x44')],{})['then'](respondWithResult(_0xcffe34,0xc9))[_0x5c67('0x3d')](handleError(_0xcffe34,null));};exports[_0x5c67('0x45')]=function(_0x1050c9,_0x16be73){if(_0x1050c9[_0x5c67('0x44')]['id']){delete _0x1050c9['body']['id'];}return db['FreshsalesAccount'][_0x5c67('0x42')]({'where':{'id':_0x1050c9['params']['id']}})[_0x5c67('0x23')](handleEntityNotFound(_0x16be73,null))[_0x5c67('0x23')](saveUpdates(_0x1050c9[_0x5c67('0x44')],null))['then'](respondWithResult(_0x16be73,null))[_0x5c67('0x3d')](handleError(_0x16be73,null));};exports[_0x5c67('0x46')]=function(_0x2258be,_0x26951c){return db[_0x5c67('0x39')][_0x5c67('0x42')]({'where':{'id':_0x2258be[_0x5c67('0x3f')]['id']}})[_0x5c67('0x23')](handleEntityNotFound(_0x26951c,null))[_0x5c67('0x23')](removeEntity(_0x26951c,null))['catch'](handleError(_0x26951c,null));};exports[_0x5c67('0x47')]=function(_0x578c2b,_0x366105,_0x765682){var _0x239bc8={};var _0x296722={};var _0x4c6dc1;var _0xc7eeb7;return db[_0x5c67('0x39')]['findOne']({'where':{'id':_0x578c2b['params']['id']}})[_0x5c67('0x23')](handleEntityNotFound(_0x366105,null))[_0x5c67('0x23')](function(_0x1e8b7c){if(_0x1e8b7c){_0x4c6dc1=_0x1e8b7c;_0x296722[_0x5c67('0x2a')]=_['keys'](db[_0x5c67('0x48')][_0x5c67('0x28')]);_0x296722[_0x5c67('0x2c')]=_[_0x5c67('0x40')](_0x578c2b[_0x5c67('0x2c')]);_0x296722['filters']=_['intersection'](_0x296722[_0x5c67('0x2a')],_0x296722[_0x5c67('0x2c')]);_0x239bc8[_0x5c67('0x2f')]=_[_0x5c67('0x2e')](_0x296722[_0x5c67('0x2a')],qs[_0x5c67('0x30')](_0x578c2b['query'][_0x5c67('0x30')]));_0x239bc8[_0x5c67('0x2f')]=_0x239bc8['attributes'][_0x5c67('0x31')]?_0x239bc8[_0x5c67('0x2f')]:_0x296722[_0x5c67('0x2a')];_0x239bc8[_0x5c67('0x33')]=qs[_0x5c67('0x34')](_0x578c2b[_0x5c67('0x2c')][_0x5c67('0x34')]);_0x239bc8['where']=qs[_0x5c67('0x2d')](_[_0x5c67('0x49')](_0x578c2b[_0x5c67('0x2c')],_0x296722['filters']));if(_0x578c2b[_0x5c67('0x2c')][_0x5c67('0x38')]){_0x239bc8[_0x5c67('0x35')]=_[_0x5c67('0x36')](_0x239bc8['where'],{'$or':_[_0x5c67('0x2b')](_0x239bc8[_0x5c67('0x2f')],function(_0x157c8e){var _0x500bb4={};_0x500bb4[_0x157c8e]={'$like':'%'+_0x578c2b[_0x5c67('0x2c')][_0x5c67('0x38')]+'%'};return _0x500bb4;})});}_0x239bc8=_['merge']({},_0x239bc8,_0x578c2b[_0x5c67('0x41')]);return _0x4c6dc1[_0x5c67('0x47')](_0x239bc8);}})['then'](function(_0xe21278){if(_0xe21278){_0xc7eeb7=_0xe21278['length'];if(!_0x578c2b[_0x5c67('0x2c')][_0x5c67('0x4a')](_0x5c67('0x32'))){_0x239bc8[_0x5c67('0x1d')]=qs['limit'](_0x578c2b[_0x5c67('0x2c')][_0x5c67('0x1d')]);_0x239bc8[_0x5c67('0x1b')]=qs['offset'](_0x578c2b[_0x5c67('0x2c')][_0x5c67('0x1b')]);}return _0x4c6dc1[_0x5c67('0x47')](_0x239bc8);}})[_0x5c67('0x23')](function(_0x480b01){if(_0x480b01){return _0x480b01?{'count':_0xc7eeb7,'rows':_0x480b01}:null;}})['then'](respondWithResult(_0x366105,null))[_0x5c67('0x3d')](handleError(_0x366105,null));};exports[_0x5c67('0x4b')]=function(_0x32bf3c,_0x1d2ae0,_0xf53ee2){if(_0x32bf3c[_0x5c67('0x44')]['id']){delete _0x32bf3c['body']['id'];}return db[_0x5c67('0x39')][_0x5c67('0x4c')]({'where':{'id':_0x32bf3c[_0x5c67('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1d2ae0,null))[_0x5c67('0x23')](function(_0x244782){if(_0x244782){_0x32bf3c['body'][_0x5c67('0x4d')]=_0x244782['id'];_0x32bf3c[_0x5c67('0x44')][_0x5c67('0x4e')]=integrations[_0x5c67('0x4f')](_0x32bf3c['body'][_0x5c67('0x50')],_0x32bf3c[_0x5c67('0x44')][_0x5c67('0x37')]);_0x32bf3c[_0x5c67('0x44')][_0x5c67('0x51')]=integrations['getDescriptions'](_0x32bf3c[_0x5c67('0x44')][_0x5c67('0x50')],_0x32bf3c[_0x5c67('0x44')][_0x5c67('0x37')]);return db[_0x5c67('0x48')][_0x5c67('0x43')](_0x32bf3c[_0x5c67('0x44')],{'include':[{'model':db[_0x5c67('0x52')],'as':'Subjects'},{'model':db[_0x5c67('0x52')],'as':_0x5c67('0x51')}]});}return null;})[_0x5c67('0x23')](respondWithResult(_0x1d2ae0,null))[_0x5c67('0x3d')](handleError(_0x1d2ae0,null));};exports['getFields']=function(_0x3faf9f,_0x313779,_0x3baf25){var _0x346d7b='';var _0xbaed6e='';return db[_0x5c67('0x39')][_0x5c67('0x4c')]({'where':{'id':_0x3faf9f[_0x5c67('0x3f')]['id']},'attributes':['id',_0x5c67('0x53'),_0x5c67('0x54'),_0x5c67('0x55')]})[_0x5c67('0x23')](handleEntityNotFound(_0x313779,null))[_0x5c67('0x23')](function(_0x4a83ee){if(_0x4a83ee){_0xbaed6e=_0x4a83ee[_0x5c67('0x53')];_0x346d7b=_0x4a83ee[_0x5c67('0x54')];var _0x24cdd6=_0x4a83ee['remoteUri']['slice'](-0x1);if(_0x24cdd6==='/'){_0x346d7b=_0x346d7b['substring'](0x0,_0x346d7b[_0x5c67('0x56')](_0x24cdd6));}return rp({'method':'GET','uri':util['format'](_0x5c67('0x57'),_0x346d7b,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x4a83ee[_0x5c67('0x55')]},'json':!![]});}})['then'](function(_0x76c055){if(_0x76c055){var _0x2e3bda=_0x76c055['users'];var _0x5d130e=![];var _0x381ca8=null;for(_0x381ca8=0x0;_0x381ca8<_0x2e3bda[_0x5c67('0x31')];_0x381ca8++){if(_0x2e3bda[_0x381ca8]['email']===_0xbaed6e){_0x5d130e=!![];}}if(_0x5d130e){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x5c67('0x23')](respondWithResult(_0x313779,null))[_0x5c67('0x3d')](function(_0x41cb5b){var _0x5bc161=_0x3faf9f['query'][_0x5c67('0x58')]?0x1f4:_0x41cb5b[_0x5c67('0x59')]||0x1f4;logger[_0x5c67('0x24')](_0x5c67('0x5a'),_0x5c67('0x5b'),_0x5bc161,JSON[_0x5c67('0x5c')](_0x41cb5b));delete _0x41cb5b[_0x5c67('0x26')];if(_0x5bc161===0x191){_0x5bc161=0x190;}_0x313779[_0x5c67('0x19')](_0x5bc161)[_0x5c67('0x27')](_0x3faf9f[_0x5c67('0x2c')][_0x5c67('0x58')]?{'message':_0x5c67('0x5d'),'statusCode':_0x41cb5b[_0x5c67('0x59')]}:_0x41cb5b);});}; \ No newline at end of file +var _0x90ec=['Content-Range','apply','save','update','then','destroy','error','stack','name','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','nolimit','addConfiguration','AccountId','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','apiKey','username','remoteUri','slice','substring','GET','format','Token\x20token=','users','email','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','set'];(function(_0x4b74e3,_0x4b2ce5){var _0x285b1e=function(_0x3ac6c3){while(--_0x3ac6c3){_0x4b74e3['push'](_0x4b74e3['shift']());}};_0x285b1e(++_0x4b2ce5);}(_0x90ec,0x1d4));var _0xc90e=function(_0x91d2a0,_0x14c5b6){_0x91d2a0=_0x91d2a0-0x0;var _0x55acd0=_0x90ec[_0x91d2a0];return _0x55acd0;};'use strict';var emlformat=require(_0xc90e('0x0'));var rimraf=require(_0xc90e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc90e('0x2'));var rp=require(_0xc90e('0x3'));var moment=require(_0xc90e('0x4'));var BPromise=require(_0xc90e('0x5'));var Mustache=require(_0xc90e('0x6'));var util=require('util');var path=require(_0xc90e('0x7'));var sox=require(_0xc90e('0x8'));var csv=require(_0xc90e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc90e('0xa'));var _=require('lodash');var squel=require(_0xc90e('0xb'));var crypto=require(_0xc90e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc90e('0xd'));var toCsv=require(_0xc90e('0x9'));var querystring=require(_0xc90e('0xe'));var Papa=require(_0xc90e('0xf'));var Redis=require(_0xc90e('0x10'));var authService=require(_0xc90e('0x11'));var qs=require(_0xc90e('0x12'));var as=require(_0xc90e('0x13'));var hardwareService=require(_0xc90e('0x14'));var logger=require('../../config/logger')(_0xc90e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xc90e('0x16'));function respondWithStatusCode(_0x41d560,_0x5cef50){_0x5cef50=_0x5cef50||0xcc;return function(_0x37321a){if(_0x37321a){return _0x41d560[_0xc90e('0x17')](_0x5cef50);}return _0x41d560['status'](_0x5cef50)[_0xc90e('0x18')]();};}function respondWithResult(_0x40e989,_0x274876){_0x274876=_0x274876||0xc8;return function(_0x2758bb){if(_0x2758bb){return _0x40e989[_0xc90e('0x19')](_0x274876)[_0xc90e('0x1a')](_0x2758bb);}};}function respondWithFilteredResult(_0x53e2e1,_0x16050f){return function(_0x2ada5a){if(_0x2ada5a){var _0x4ff295=typeof _0x16050f[_0xc90e('0x1b')]==='undefined'&&typeof _0x16050f[_0xc90e('0x1c')]===_0xc90e('0x1d');var _0x558b22=_0x2ada5a[_0xc90e('0x1e')];var _0xe0e0bc=_0x4ff295?0x0:_0x16050f[_0xc90e('0x1b')];var _0x54e957=_0x4ff295?_0x2ada5a['count']:_0x16050f['offset']+_0x16050f[_0xc90e('0x1c')];var _0x147120;if(_0x54e957>=_0x558b22){_0x54e957=_0x558b22;_0x147120=0xc8;}else{_0x147120=0xce;}_0x53e2e1[_0xc90e('0x19')](_0x147120);return _0x53e2e1[_0xc90e('0x1f')](_0xc90e('0x20'),_0xe0e0bc+'-'+_0x54e957+'/'+_0x558b22)['json'](_0x2ada5a);}return null;};}function patchUpdates(_0x469f0d){return function(_0x556954){try{jsonpatch[_0xc90e('0x21')](_0x556954,_0x469f0d,!![]);}catch(_0x3cf47c){return BPromise['reject'](_0x3cf47c);}return _0x556954[_0xc90e('0x22')]();};}function saveUpdates(_0x134760,_0x957d1e){return function(_0x114042){if(_0x114042){return _0x114042[_0xc90e('0x23')](_0x134760)[_0xc90e('0x24')](function(_0x1a25bc){return _0x1a25bc;});}return null;};}function removeEntity(_0x136187,_0x1cff73){return function(_0x52aa00){if(_0x52aa00){return _0x52aa00[_0xc90e('0x25')]()[_0xc90e('0x24')](function(){_0x136187[_0xc90e('0x19')](0xcc)[_0xc90e('0x18')]();});}};}function handleEntityNotFound(_0x3371aa,_0x59d731){return function(_0x2e4d0c){if(!_0x2e4d0c){_0x3371aa[_0xc90e('0x17')](0x194);}return _0x2e4d0c;};}function handleError(_0x2ba549,_0x4fde04){_0x4fde04=_0x4fde04||0x1f4;return function(_0x3a30c7){logger[_0xc90e('0x26')](_0x3a30c7[_0xc90e('0x27')]);if(_0x3a30c7[_0xc90e('0x28')]){delete _0x3a30c7[_0xc90e('0x28')];}_0x2ba549[_0xc90e('0x19')](_0x4fde04)['send'](_0x3a30c7);};}exports['index']=function(_0x31e405,_0x550e8f){var _0xe8bae9={},_0xae20be={},_0x1baedc={'count':0x0,'rows':[]};var _0x404eef=_[_0xc90e('0x29')](db[_0xc90e('0x2a')][_0xc90e('0x2b')],function(_0x50e0d7){return{'name':_0x50e0d7[_0xc90e('0x2c')],'type':_0x50e0d7[_0xc90e('0x2d')]['key']};});_0xae20be[_0xc90e('0x2e')]=_['map'](_0x404eef,_0xc90e('0x28'));_0xae20be[_0xc90e('0x2f')]=_[_0xc90e('0x30')](_0x31e405[_0xc90e('0x2f')]);_0xae20be[_0xc90e('0x31')]=_[_0xc90e('0x32')](_0xae20be[_0xc90e('0x2e')],_0xae20be[_0xc90e('0x2f')]);_0xe8bae9[_0xc90e('0x33')]=_['intersection'](_0xae20be['model'],qs[_0xc90e('0x34')](_0x31e405[_0xc90e('0x2f')][_0xc90e('0x34')]));_0xe8bae9[_0xc90e('0x33')]=_0xe8bae9[_0xc90e('0x33')][_0xc90e('0x35')]?_0xe8bae9[_0xc90e('0x33')]:_0xae20be[_0xc90e('0x2e')];if(!_0x31e405[_0xc90e('0x2f')][_0xc90e('0x36')]('nolimit')){_0xe8bae9[_0xc90e('0x1c')]=qs[_0xc90e('0x1c')](_0x31e405[_0xc90e('0x2f')][_0xc90e('0x1c')]);_0xe8bae9['offset']=qs['offset'](_0x31e405['query'][_0xc90e('0x1b')]);}_0xe8bae9[_0xc90e('0x37')]=qs[_0xc90e('0x38')](_0x31e405[_0xc90e('0x2f')][_0xc90e('0x38')]);_0xe8bae9['where']=qs[_0xc90e('0x31')](_[_0xc90e('0x39')](_0x31e405[_0xc90e('0x2f')],_0xae20be[_0xc90e('0x31')]),_0x404eef);if(_0x31e405[_0xc90e('0x2f')][_0xc90e('0x3a')]){_0xe8bae9[_0xc90e('0x3b')]=_[_0xc90e('0x3c')](_0xe8bae9[_0xc90e('0x3b')],{'$or':_[_0xc90e('0x29')](_0x404eef,function(_0x39f241){if(_0x39f241[_0xc90e('0x2d')]!==_0xc90e('0x3d')){var _0x5421b6={};_0x5421b6[_0x39f241[_0xc90e('0x28')]]={'$like':'%'+_0x31e405[_0xc90e('0x2f')]['filter']+'%'};return _0x5421b6;}})});}_0xe8bae9=_['merge']({},_0xe8bae9,_0x31e405[_0xc90e('0x3e')]);var _0x53e484={'where':_0xe8bae9[_0xc90e('0x3b')]};return db[_0xc90e('0x2a')]['count'](_0x53e484)[_0xc90e('0x24')](function(_0x4d7911){_0x1baedc['count']=_0x4d7911;if(_0x31e405[_0xc90e('0x2f')]['includeAll']){_0xe8bae9['include']=[{'all':!![]}];}return db[_0xc90e('0x2a')][_0xc90e('0x3f')](_0xe8bae9);})['then'](function(_0x3f1de7){_0x1baedc[_0xc90e('0x40')]=_0x3f1de7;return _0x1baedc;})[_0xc90e('0x24')](respondWithFilteredResult(_0x550e8f,_0xe8bae9))[_0xc90e('0x41')](handleError(_0x550e8f,null));};exports[_0xc90e('0x42')]=function(_0x25b5da,_0x3f194a){var _0x25a7d6={'raw':![],'where':{'id':_0x25b5da[_0xc90e('0x43')]['id']}},_0x486bc7={};_0x486bc7['model']=_['keys'](db[_0xc90e('0x2a')]['rawAttributes']);_0x486bc7[_0xc90e('0x2f')]=_['keys'](_0x25b5da[_0xc90e('0x2f')]);_0x486bc7[_0xc90e('0x31')]=_[_0xc90e('0x32')](_0x486bc7[_0xc90e('0x2e')],_0x486bc7[_0xc90e('0x2f')]);_0x25a7d6[_0xc90e('0x33')]=_[_0xc90e('0x32')](_0x486bc7[_0xc90e('0x2e')],qs[_0xc90e('0x34')](_0x25b5da['query'][_0xc90e('0x34')]));_0x25a7d6[_0xc90e('0x33')]=_0x25a7d6[_0xc90e('0x33')][_0xc90e('0x35')]?_0x25a7d6['attributes']:_0x486bc7[_0xc90e('0x2e')];if(_0x25b5da[_0xc90e('0x2f')][_0xc90e('0x44')]){_0x25a7d6['include']=[{'all':!![]}];}_0x25a7d6=_[_0xc90e('0x3c')]({},_0x25a7d6,_0x25b5da['options']);return db[_0xc90e('0x2a')]['find'](_0x25a7d6)[_0xc90e('0x24')](handleEntityNotFound(_0x3f194a,null))['then'](respondWithResult(_0x3f194a,null))[_0xc90e('0x41')](handleError(_0x3f194a,null));};exports[_0xc90e('0x45')]=function(_0x3812ed,_0x324a04){return db[_0xc90e('0x2a')][_0xc90e('0x45')](_0x3812ed[_0xc90e('0x46')],{})[_0xc90e('0x24')](respondWithResult(_0x324a04,0xc9))['catch'](handleError(_0x324a04,null));};exports[_0xc90e('0x23')]=function(_0x3de64f,_0x58eed6){if(_0x3de64f['body']['id']){delete _0x3de64f[_0xc90e('0x46')]['id'];}return db['FreshsalesAccount'][_0xc90e('0x47')]({'where':{'id':_0x3de64f[_0xc90e('0x43')]['id']}})[_0xc90e('0x24')](handleEntityNotFound(_0x58eed6,null))[_0xc90e('0x24')](saveUpdates(_0x3de64f[_0xc90e('0x46')],null))['then'](respondWithResult(_0x58eed6,null))[_0xc90e('0x41')](handleError(_0x58eed6,null));};exports[_0xc90e('0x25')]=function(_0x496b00,_0x2f6d54){return db['FreshsalesAccount'][_0xc90e('0x47')]({'where':{'id':_0x496b00['params']['id']}})[_0xc90e('0x24')](handleEntityNotFound(_0x2f6d54,null))[_0xc90e('0x24')](removeEntity(_0x2f6d54,null))[_0xc90e('0x41')](handleError(_0x2f6d54,null));};exports[_0xc90e('0x48')]=function(_0xc7d60f,_0x3b8ec8,_0xa8b8b6){var _0x25b48f={};var _0x2697a1={};var _0x1cca00;var _0x10b7e8;return db[_0xc90e('0x2a')][_0xc90e('0x49')]({'where':{'id':_0xc7d60f[_0xc90e('0x43')]['id']}})[_0xc90e('0x24')](handleEntityNotFound(_0x3b8ec8,null))[_0xc90e('0x24')](function(_0x49467d){if(_0x49467d){_0x1cca00=_0x49467d;_0x2697a1[_0xc90e('0x2e')]=_[_0xc90e('0x30')](db[_0xc90e('0x4a')][_0xc90e('0x2b')]);_0x2697a1[_0xc90e('0x2f')]=_[_0xc90e('0x30')](_0xc7d60f[_0xc90e('0x2f')]);_0x2697a1['filters']=_[_0xc90e('0x32')](_0x2697a1['model'],_0x2697a1[_0xc90e('0x2f')]);_0x25b48f[_0xc90e('0x33')]=_[_0xc90e('0x32')](_0x2697a1[_0xc90e('0x2e')],qs[_0xc90e('0x34')](_0xc7d60f['query'][_0xc90e('0x34')]));_0x25b48f[_0xc90e('0x33')]=_0x25b48f['attributes'][_0xc90e('0x35')]?_0x25b48f[_0xc90e('0x33')]:_0x2697a1[_0xc90e('0x2e')];_0x25b48f[_0xc90e('0x37')]=qs['sort'](_0xc7d60f['query'][_0xc90e('0x38')]);_0x25b48f[_0xc90e('0x3b')]=qs[_0xc90e('0x31')](_[_0xc90e('0x39')](_0xc7d60f[_0xc90e('0x2f')],_0x2697a1['filters']));if(_0xc7d60f[_0xc90e('0x2f')][_0xc90e('0x3a')]){_0x25b48f['where']=_['merge'](_0x25b48f[_0xc90e('0x3b')],{'$or':_[_0xc90e('0x29')](_0x25b48f[_0xc90e('0x33')],function(_0x36512b){var _0x5a3274={};_0x5a3274[_0x36512b]={'$like':'%'+_0xc7d60f[_0xc90e('0x2f')][_0xc90e('0x3a')]+'%'};return _0x5a3274;})});}_0x25b48f=_[_0xc90e('0x3c')]({},_0x25b48f,_0xc7d60f[_0xc90e('0x3e')]);return _0x1cca00[_0xc90e('0x48')](_0x25b48f);}})[_0xc90e('0x24')](function(_0x171938){if(_0x171938){_0x10b7e8=_0x171938[_0xc90e('0x35')];if(!_0xc7d60f['query'][_0xc90e('0x36')](_0xc90e('0x4b'))){_0x25b48f[_0xc90e('0x1c')]=qs[_0xc90e('0x1c')](_0xc7d60f[_0xc90e('0x2f')]['limit']);_0x25b48f[_0xc90e('0x1b')]=qs[_0xc90e('0x1b')](_0xc7d60f[_0xc90e('0x2f')]['offset']);}return _0x1cca00['getConfigurations'](_0x25b48f);}})[_0xc90e('0x24')](function(_0x52691a){if(_0x52691a){return _0x52691a?{'count':_0x10b7e8,'rows':_0x52691a}:null;}})[_0xc90e('0x24')](respondWithResult(_0x3b8ec8,null))['catch'](handleError(_0x3b8ec8,null));};exports[_0xc90e('0x4c')]=function(_0x323e47,_0x26b89b,_0x36946f){if(_0x323e47[_0xc90e('0x46')]['id']){delete _0x323e47[_0xc90e('0x46')]['id'];}return db[_0xc90e('0x2a')][_0xc90e('0x49')]({'where':{'id':_0x323e47[_0xc90e('0x43')]['id']}})[_0xc90e('0x24')](handleEntityNotFound(_0x26b89b,null))[_0xc90e('0x24')](function(_0x22ee16){if(_0x22ee16){_0x323e47['body'][_0xc90e('0x4d')]=_0x22ee16['id'];_0x323e47['body']['Subjects']=integrations['getSubjects'](_0x323e47['body'][_0xc90e('0x4e')],_0x323e47[_0xc90e('0x46')]['type']);_0x323e47[_0xc90e('0x46')][_0xc90e('0x4f')]=integrations[_0xc90e('0x50')](_0x323e47[_0xc90e('0x46')][_0xc90e('0x4e')],_0x323e47[_0xc90e('0x46')]['type']);return db[_0xc90e('0x4a')][_0xc90e('0x45')](_0x323e47[_0xc90e('0x46')],{'include':[{'model':db[_0xc90e('0x51')],'as':_0xc90e('0x52')},{'model':db[_0xc90e('0x51')],'as':'Descriptions'}]});}return null;})[_0xc90e('0x24')](respondWithResult(_0x26b89b,null))['catch'](handleError(_0x26b89b,null));};exports[_0xc90e('0x53')]=function(_0x592924,_0x5c96c9,_0x247f6a){var _0x2b02f1='';var _0x51f714='';return db[_0xc90e('0x2a')]['findOne']({'where':{'id':_0x592924['params']['id']},'attributes':['id','username','remoteUri',_0xc90e('0x54')]})[_0xc90e('0x24')](handleEntityNotFound(_0x5c96c9,null))['then'](function(_0x104288){if(_0x104288){_0x51f714=_0x104288[_0xc90e('0x55')];_0x2b02f1=_0x104288[_0xc90e('0x56')];var _0xb4bb6a=_0x104288[_0xc90e('0x56')][_0xc90e('0x57')](-0x1);if(_0xb4bb6a==='/'){_0x2b02f1=_0x2b02f1[_0xc90e('0x58')](0x0,_0x2b02f1['lastIndexOf'](_0xb4bb6a));}return rp({'method':_0xc90e('0x59'),'uri':util[_0xc90e('0x5a')]('%s%s',_0x2b02f1,'/api/selector/owners'),'headers':{'Authorization':_0xc90e('0x5b')+_0x104288['apiKey']},'json':!![]});}})['then'](function(_0x1df4de){if(_0x1df4de){var _0x3f44f0=_0x1df4de[_0xc90e('0x5c')];var _0x16a95f=![];var _0x1fb4c5=null;for(_0x1fb4c5=0x0;_0x1fb4c5<_0x3f44f0[_0xc90e('0x35')];_0x1fb4c5++){if(_0x3f44f0[_0x1fb4c5][_0xc90e('0x5d')]===_0x51f714){_0x16a95f=!![];}}if(_0x16a95f){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xc90e('0x24')](respondWithResult(_0x5c96c9,null))[_0xc90e('0x41')](function(_0x56f2be){var _0x29619f=_0x592924[_0xc90e('0x2f')][_0xc90e('0x5e')]?0x1f4:_0x56f2be['statusCode']||0x1f4;logger['error'](_0xc90e('0x5f'),'getFields',_0x29619f,JSON[_0xc90e('0x60')](_0x56f2be));delete _0x56f2be[_0xc90e('0x28')];if(_0x29619f===0x191){_0x29619f=0x190;}_0x5c96c9[_0xc90e('0x19')](_0x29619f)[_0xc90e('0x61')](_0x592924['query'][_0xc90e('0x5e')]?{'message':_0xc90e('0x62'),'statusCode':_0x56f2be[_0xc90e('0x63')]}:_0x56f2be);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index e4a70ca..ae5a4a0 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 _0x2d72=['exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0x2d72,0xa8));var _0x22d7=function(_0x322c86,_0x4fbc29){_0x322c86=_0x322c86-0x0;var _0x326ad9=_0x2d72[_0x322c86];return _0x326ad9;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));var integrations=require(_0x22d7('0xb'));module[_0x22d7('0xc')]=function(_0x100426,_0x52a3e3){return _0x100426[_0x22d7('0xd')](_0x22d7('0xe'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2196f5,_0x46c5b1){var _0x58eed9=function(_0x34ea74){while(--_0x34ea74){_0x2196f5['push'](_0x2196f5['shift']());}};_0x58eed9(++_0x46c5b1);}(_0x4975,0x86));var _0x5497=function(_0x5b0bda,_0xdce4d7){_0x5b0bda=_0x5b0bda-0x0;var _0x4720e6=_0x4975[_0x5b0bda];return _0x4720e6;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));var integrations=require(_0x5497('0xa'));module['exports']=function(_0x37e48d,_0x4f563d){return _0x37e48d[_0x5497('0xb')](_0x5497('0xc'),attributes,{'tableName':_0x5497('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 8364af0..6f3854f 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 _0x323f=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','options','where','attributes','include','map','model','catch','ShowFreshsalesAccount','find','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x3e44c9,_0x175083){var _0x1ca567=function(_0x204dcb){while(--_0x204dcb){_0x3e44c9['push'](_0x3e44c9['shift']());}};_0x1ca567(++_0x175083);}(_0x323f,0x1ee));var _0xf323=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x323f[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var moment=require('moment');var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require(_0xf323('0x4'))['db'];var utils=require(_0xf323('0x5'));var logger=require(_0xf323('0x6'))(_0xf323('0x7'));var config=require(_0xf323('0x8'));var jayson=require(_0xf323('0x9'));var client=jayson[_0xf323('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb9a667,_0x444cba,_0x1af70d){return new BPromise(function(_0x2c8271,_0x8abeac){return client[_0xf323('0xb')](_0xb9a667,_0x1af70d)[_0xf323('0xc')](function(_0x2b24a2){logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));logger[_0xf323('0x10')](_0xf323('0x11'),_0x444cba,_0xf323('0xf'),JSON[_0xf323('0x12')](_0x2b24a2));if(_0x2b24a2[_0xf323('0x13')]){if(_0x2b24a2[_0xf323('0x13')]['code']===0x1f4){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')]['message']);return _0x8abeac(_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);}logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);return _0x2c8271(_0x2b24a2['error']['message']);}else{logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));_0x2c8271(_0x2b24a2[_0xf323('0x15')][_0xf323('0x14')]);}})['catch'](function(_0xd6c25){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0xd6c25);_0x8abeac(_0xd6c25);});});}exports[_0xf323('0x16')]=function(_0x49b115){var _0x2db977=this;return new Promise(function(_0x272aec,_0x1a459d){return db[_0xf323('0x17')]['findAll']({'raw':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')][_0xf323('0x19')]||null:null,'attributes':_0x49b115[_0xf323('0x18')]?_0x49b115['options'][_0xf323('0x1a')]||null:null,'limit':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')]['limit']||null:null,'include':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')][_0xf323('0x1b')]?_[_0xf323('0x1c')](_0x49b115[_0xf323('0x18')][_0xf323('0x1b')],function(_0x189b23){return{'model':db[_0x189b23[_0xf323('0x1d')]],'as':_0x189b23['as'],'attributes':_0x189b23[_0xf323('0x1a')],'include':_0x189b23['include']?_[_0xf323('0x1c')](_0x189b23[_0xf323('0x1b')],function(_0x33dc52){return{'model':db[_0x33dc52[_0xf323('0x1d')]],'as':_0x33dc52['as'],'attributes':_0x33dc52[_0xf323('0x1a')],'include':_0x33dc52[_0xf323('0x1b')]?_['map'](_0x33dc52[_0xf323('0x1b')],function(_0x56ce33){return{'model':db[_0x56ce33[_0xf323('0x1d')]],'as':_0x56ce33['as'],'attributes':_0x56ce33[_0xf323('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46663b){logger[_0xf323('0xd')](_0xf323('0x16'),_0x49b115);logger[_0xf323('0x10')](_0xf323('0x16'),_0x49b115,JSON['stringify'](_0x46663b));_0x272aec(_0x46663b);})[_0xf323('0x1e')](function(_0x34b536){logger[_0xf323('0x13')](_0xf323('0x16'),_0x34b536[_0xf323('0x14')],_0x49b115);_0x1a459d(_0x2db977[_0xf323('0x13')](0x1f4,_0x34b536[_0xf323('0x14')]));});});};exports[_0xf323('0x1f')]=function(_0x139adc){var _0x52300b=this;return new Promise(function(_0x3f23cf,_0x15187c){return db[_0xf323('0x17')][_0xf323('0x20')]({'raw':_0x139adc[_0xf323('0x18')]?_0x139adc['options'][_0xf323('0x21')]===undefined?!![]:![]:!![],'where':_0x139adc[_0xf323('0x18')]?_0x139adc[_0xf323('0x18')][_0xf323('0x19')]||null:null,'attributes':_0x139adc[_0xf323('0x18')]?_0x139adc['options'][_0xf323('0x1a')]||null:null,'include':_0x139adc[_0xf323('0x18')]?_0x139adc[_0xf323('0x18')][_0xf323('0x1b')]?_['map'](_0x139adc[_0xf323('0x18')]['include'],function(_0x372c47){return{'model':db[_0x372c47[_0xf323('0x1d')]],'as':_0x372c47['as'],'attributes':_0x372c47['attributes'],'include':_0x372c47[_0xf323('0x1b')]?_['map'](_0x372c47[_0xf323('0x1b')],function(_0x4a49d2){return{'model':db[_0x4a49d2[_0xf323('0x1d')]],'as':_0x4a49d2['as'],'attributes':_0x4a49d2['attributes'],'include':_0x4a49d2[_0xf323('0x1b')]?_[_0xf323('0x1c')](_0x4a49d2['include'],function(_0x4964a5){return{'model':db[_0x4964a5['model']],'as':_0x4964a5['as'],'attributes':_0x4964a5[_0xf323('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf323('0xc')](function(_0x79e636){logger[_0xf323('0xd')](_0xf323('0x1f'),_0x139adc);logger['debug']('ShowFreshsalesAccount',_0x139adc,JSON['stringify'](_0x79e636));_0x3f23cf(_0x79e636);})[_0xf323('0x1e')](function(_0x59fee2){logger[_0xf323('0x13')]('ShowFreshsalesAccount',_0x59fee2[_0xf323('0x14')],_0x139adc);_0x15187c(_0x52300b[_0xf323('0x13')](0x1f4,_0x59fee2[_0xf323('0x14')]));});});}; \ No newline at end of file +var _0x781d=['model','map','GetFreshsalesAccount','find','ShowFreshsalesAccount','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x781d,0x14a));var _0xd781=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x781d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});}exports['GetFreshsalesAccount']=function(_0x1407fc){var _0x3f2922=this;return new Promise(function(_0x395d9c,_0x2f1273){return db[_0xd781('0x17')][_0xd781('0x18')]({'raw':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')][_0xd781('0x1a')]||null:null,'attributes':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')][_0xd781('0x1b')]||null:null,'limit':_0x1407fc[_0xd781('0x19')]?_0x1407fc['options'][_0xd781('0x1c')]||null:null,'include':_0x1407fc['options']?_0x1407fc['options'][_0xd781('0x1d')]?_['map'](_0x1407fc[_0xd781('0x19')][_0xd781('0x1d')],function(_0x395087){return{'model':db[_0x395087[_0xd781('0x1e')]],'as':_0x395087['as'],'attributes':_0x395087[_0xd781('0x1b')],'include':_0x395087[_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x395087[_0xd781('0x1d')],function(_0x10940b){return{'model':db[_0x10940b['model']],'as':_0x10940b['as'],'attributes':_0x10940b['attributes'],'include':_0x10940b[_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x10940b[_0xd781('0x1d')],function(_0x57b41e){return{'model':db[_0x57b41e[_0xd781('0x1e')]],'as':_0x57b41e['as'],'attributes':_0x57b41e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e29c8){logger['info'](_0xd781('0x20'),_0x1407fc);logger[_0xd781('0xf')]('GetFreshsalesAccount',_0x1407fc,JSON['stringify'](_0x1e29c8));_0x395d9c(_0x1e29c8);})[_0xd781('0x16')](function(_0x5b0464){logger[_0xd781('0x11')]('GetFreshsalesAccount',_0x5b0464[_0xd781('0x13')],_0x1407fc);_0x2f1273(_0x3f2922[_0xd781('0x11')](0x1f4,_0x5b0464['message']));});});};exports['ShowFreshsalesAccount']=function(_0x432d14){var _0x29e81a=this;return new Promise(function(_0x1c7d83,_0x5a389c){return db['FreshsalesAccount'][_0xd781('0x21')]({'raw':_0x432d14[_0xd781('0x19')]?_0x432d14[_0xd781('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1a')]||null:null,'attributes':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1b')]||null:null,'include':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x432d14[_0xd781('0x19')]['include'],function(_0x23dffb){return{'model':db[_0x23dffb[_0xd781('0x1e')]],'as':_0x23dffb['as'],'attributes':_0x23dffb[_0xd781('0x1b')],'include':_0x23dffb[_0xd781('0x1d')]?_['map'](_0x23dffb[_0xd781('0x1d')],function(_0x3f20e2){return{'model':db[_0x3f20e2['model']],'as':_0x3f20e2['as'],'attributes':_0x3f20e2[_0xd781('0x1b')],'include':_0x3f20e2['include']?_[_0xd781('0x1f')](_0x3f20e2[_0xd781('0x1d')],function(_0x57fdb6){return{'model':db[_0x57fdb6[_0xd781('0x1e')]],'as':_0x57fdb6['as'],'attributes':_0x57fdb6[_0xd781('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a29b7){logger['info'](_0xd781('0x22'),_0x432d14);logger[_0xd781('0xf')]('ShowFreshsalesAccount',_0x432d14,JSON[_0xd781('0x23')](_0x2a29b7));_0x1c7d83(_0x2a29b7);})[_0xd781('0x16')](function(_0x5651de){logger[_0xd781('0x11')](_0xd781('0x22'),_0x5651de[_0xd781('0x13')],_0x432d14);_0x5a389c(_0x29e81a['error'](0x1f4,_0x5651de[_0xd781('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 290ce8c..8f63b72 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 _0xf7f7=['../../config/environment','./intFreshsalesConfiguration.controller','get','/:id','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','getFields','post','create','put','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x9de7db,_0xdf6a08){var _0x347b10=function(_0x2fb2db){while(--_0x2fb2db){_0x9de7db['push'](_0x9de7db['shift']());}};_0x347b10(++_0xdf6a08);}(_0xf7f7,0x117));var _0x7f7f=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0xf7f7[_0x4f3b2d];return _0x3dddfa;};'use strict';var multer=require(_0x7f7f('0x0'));var util=require(_0x7f7f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7f7f('0x2'));var router=express[_0x7f7f('0x3')]();var fs_extra=require(_0x7f7f('0x4'));var auth=require(_0x7f7f('0x5'));var interaction=require(_0x7f7f('0x6'));var config=require(_0x7f7f('0x7'));var controller=require(_0x7f7f('0x8'));router[_0x7f7f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7f7f('0xa'),auth[_0x7f7f('0xb')](),controller[_0x7f7f('0xc')]);router[_0x7f7f('0x9')](_0x7f7f('0xd'),auth[_0x7f7f('0xb')](),controller[_0x7f7f('0xe')]);router[_0x7f7f('0x9')]('/:id/descriptions',auth[_0x7f7f('0xb')](),controller[_0x7f7f('0xf')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x7f7f('0x10')]);router[_0x7f7f('0x11')]('/',auth[_0x7f7f('0xb')](),controller[_0x7f7f('0x12')]);router[_0x7f7f('0x13')](_0x7f7f('0xa'),auth[_0x7f7f('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7f7f('0x14')]);module[_0x7f7f('0x15')]=router; \ No newline at end of file +var _0x8f9a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','put','update','delete','destroy','exports','multer','util'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x8f9a,0x1d9));var _0xa8f9=function(_0x12f451,_0x3b618f){_0x12f451=_0x12f451-0x0;var _0x5e9589=_0x8f9a[_0x12f451];return _0x5e9589;};'use strict';var multer=require(_0xa8f9('0x0'));var util=require(_0xa8f9('0x1'));var path=require('path');var timeout=require(_0xa8f9('0x2'));var express=require(_0xa8f9('0x3'));var router=express[_0xa8f9('0x4')]();var fs_extra=require(_0xa8f9('0x5'));var auth=require(_0xa8f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa8f9('0x7'));var controller=require(_0xa8f9('0x8'));router[_0xa8f9('0x9')]('/',auth[_0xa8f9('0xa')](),controller[_0xa8f9('0xb')]);router[_0xa8f9('0x9')](_0xa8f9('0xc'),auth['isAuthenticated'](),controller[_0xa8f9('0xd')]);router[_0xa8f9('0x9')](_0xa8f9('0xe'),auth[_0xa8f9('0xa')](),controller[_0xa8f9('0xf')]);router[_0xa8f9('0x9')](_0xa8f9('0x10'),auth[_0xa8f9('0xa')](),controller[_0xa8f9('0x11')]);router[_0xa8f9('0x9')](_0xa8f9('0x12'),auth['isAuthenticated'](),controller['getFields']);router[_0xa8f9('0x13')]('/',auth[_0xa8f9('0xa')](),controller['create']);router[_0xa8f9('0x14')](_0xa8f9('0xc'),auth[_0xa8f9('0xa')](),controller[_0xa8f9('0x15')]);router[_0xa8f9('0x16')](_0xa8f9('0xc'),auth[_0xa8f9('0xa')](),controller[_0xa8f9('0x17')]);module[_0xa8f9('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 345e9e6..67ba2b1 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 _0xfa85=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa85,0x173));var _0x5fa8=function(_0x273580,_0x100883){_0x273580=_0x273580-0x0;var _0x511d5a=_0xfa85[_0x273580];return _0x511d5a;};'use strict';var Sequelize=require('sequelize');module[_0x5fa8('0x0')]={'name':{'type':Sequelize[_0x5fa8('0x1')]},'description':{'type':Sequelize[_0x5fa8('0x1')]}}; \ No newline at end of file +var _0x22d0=['sequelize','exports','STRING'];(function(_0xf0a9d0,_0x5719b3){var _0x52a56d=function(_0x45e682){while(--_0x45e682){_0xf0a9d0['push'](_0xf0a9d0['shift']());}};_0x52a56d(++_0x5719b3);}(_0x22d0,0x1d1));var _0x022d=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0x22d0[_0x384231];return _0x2480bf;};'use strict';var Sequelize=require(_0x022d('0x0'));module[_0x022d('0x1')]={'name':{'type':Sequelize[_0x022d('0x2')]},'description':{'type':Sequelize[_0x022d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 580f6b8..5198057 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 _0x5ebb=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FreshsalesConfiguration','includeAll','include','findAll','catch','show','params','intersection','create','body','find','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','zip-dir','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5ab0fb,_0x355be1){var _0x15761a=function(_0x32f808){while(--_0x32f808){_0x5ab0fb['push'](_0x5ab0fb['shift']());}};_0x15761a(++_0x355be1);}(_0x5ebb,0xde));var _0xb5eb=function(_0x4b4358,_0x557225){_0x4b4358=_0x4b4358-0x0;var _0x4c4923=_0x5ebb[_0x4b4358];return _0x4c4923;};'use strict';var emlformat=require(_0xb5eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb5eb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb5eb('0x2'));var Mustache=require(_0xb5eb('0x3'));var util=require(_0xb5eb('0x4'));var path=require(_0xb5eb('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5eb('0x6'));var _=require('lodash');var squel=require(_0xb5eb('0x7'));var crypto=require(_0xb5eb('0x8'));var jsforce=require(_0xb5eb('0x9'));var deskjs=require(_0xb5eb('0xa'));var toCsv=require(_0xb5eb('0xb'));var querystring=require(_0xb5eb('0xc'));var Papa=require('papaparse');var Redis=require(_0xb5eb('0xd'));var authService=require(_0xb5eb('0xe'));var qs=require(_0xb5eb('0xf'));var as=require(_0xb5eb('0x10'));var hardwareService=require(_0xb5eb('0x11'));var logger=require(_0xb5eb('0x12'))(_0xb5eb('0x13'));var utils=require(_0xb5eb('0x14'));var config=require(_0xb5eb('0x15'));var licenseUtil=require(_0xb5eb('0x16'));var db=require(_0xb5eb('0x17'))['db'];function respondWithStatusCode(_0x328244,_0x18ef3e){_0x18ef3e=_0x18ef3e||0xcc;return function(_0xebb813){if(_0xebb813){return _0x328244[_0xb5eb('0x18')](_0x18ef3e);}return _0x328244[_0xb5eb('0x19')](_0x18ef3e)[_0xb5eb('0x1a')]();};}function respondWithResult(_0x46032d,_0x40fe51){_0x40fe51=_0x40fe51||0xc8;return function(_0x18d4a9){if(_0x18d4a9){return _0x46032d[_0xb5eb('0x19')](_0x40fe51)[_0xb5eb('0x1b')](_0x18d4a9);}};}function respondWithFilteredResult(_0x5a78ba,_0x4dfe45){return function(_0xe20e0c){if(_0xe20e0c){var _0x228706=typeof _0x4dfe45['offset']===_0xb5eb('0x1c')&&typeof _0x4dfe45[_0xb5eb('0x1d')]==='undefined';var _0x35a132=_0xe20e0c['count'];var _0x5b580a=_0x228706?0x0:_0x4dfe45[_0xb5eb('0x1e')];var _0x40079a=_0x228706?_0xe20e0c[_0xb5eb('0x1f')]:_0x4dfe45[_0xb5eb('0x1e')]+_0x4dfe45['limit'];var _0x1dd976;if(_0x40079a>=_0x35a132){_0x40079a=_0x35a132;_0x1dd976=0xc8;}else{_0x1dd976=0xce;}_0x5a78ba[_0xb5eb('0x19')](_0x1dd976);return _0x5a78ba['set'](_0xb5eb('0x20'),_0x5b580a+'-'+_0x40079a+'/'+_0x35a132)[_0xb5eb('0x1b')](_0xe20e0c);}return null;};}function patchUpdates(_0x2f90b2){return function(_0x760839){try{jsonpatch[_0xb5eb('0x21')](_0x760839,_0x2f90b2,!![]);}catch(_0x43da54){return BPromise['reject'](_0x43da54);}return _0x760839[_0xb5eb('0x22')]();};}function saveUpdates(_0x5c0619,_0xb4c245){return function(_0x45767e){if(_0x45767e){return _0x45767e[_0xb5eb('0x23')](_0x5c0619)[_0xb5eb('0x24')](function(_0x3def53){return _0x3def53;});}return null;};}function removeEntity(_0x47cd1a,_0x43f3e8){return function(_0x58dc01){if(_0x58dc01){return _0x58dc01[_0xb5eb('0x25')]()[_0xb5eb('0x24')](function(){_0x47cd1a['status'](0xcc)[_0xb5eb('0x1a')]();});}};}function handleEntityNotFound(_0x46c74b,_0x34fb51){return function(_0x46e982){if(!_0x46e982){_0x46c74b['sendStatus'](0x194);}return _0x46e982;};}function handleError(_0x2f7af8,_0x3fdb86){_0x3fdb86=_0x3fdb86||0x1f4;return function(_0x55cb28){logger[_0xb5eb('0x26')](_0x55cb28[_0xb5eb('0x27')]);if(_0x55cb28[_0xb5eb('0x28')]){delete _0x55cb28[_0xb5eb('0x28')];}_0x2f7af8[_0xb5eb('0x19')](_0x3fdb86)[_0xb5eb('0x29')](_0x55cb28);};}exports[_0xb5eb('0x2a')]=function(_0x856c3f,_0x45bfc3){var _0x20915c={},_0x6e9427={},_0x4a11da={'count':0x0,'rows':[]};var _0x5f1b89=_[_0xb5eb('0x2b')](db['FreshsalesConfiguration'][_0xb5eb('0x2c')],function(_0x2c2aca){return{'name':_0x2c2aca[_0xb5eb('0x2d')],'type':_0x2c2aca[_0xb5eb('0x2e')][_0xb5eb('0x2f')]};});_0x6e9427[_0xb5eb('0x30')]=_[_0xb5eb('0x2b')](_0x5f1b89,_0xb5eb('0x28'));_0x6e9427[_0xb5eb('0x31')]=_[_0xb5eb('0x32')](_0x856c3f[_0xb5eb('0x31')]);_0x6e9427['filters']=_['intersection'](_0x6e9427['model'],_0x6e9427[_0xb5eb('0x31')]);_0x20915c[_0xb5eb('0x33')]=_['intersection'](_0x6e9427[_0xb5eb('0x30')],qs[_0xb5eb('0x34')](_0x856c3f['query'][_0xb5eb('0x34')]));_0x20915c[_0xb5eb('0x33')]=_0x20915c['attributes'][_0xb5eb('0x35')]?_0x20915c[_0xb5eb('0x33')]:_0x6e9427['model'];if(!_0x856c3f[_0xb5eb('0x31')]['hasOwnProperty'](_0xb5eb('0x36'))){_0x20915c[_0xb5eb('0x1d')]=qs['limit'](_0x856c3f[_0xb5eb('0x31')][_0xb5eb('0x1d')]);_0x20915c[_0xb5eb('0x1e')]=qs[_0xb5eb('0x1e')](_0x856c3f[_0xb5eb('0x31')][_0xb5eb('0x1e')]);}_0x20915c[_0xb5eb('0x37')]=qs[_0xb5eb('0x38')](_0x856c3f[_0xb5eb('0x31')][_0xb5eb('0x38')]);_0x20915c[_0xb5eb('0x39')]=qs[_0xb5eb('0x3a')](_[_0xb5eb('0x3b')](_0x856c3f['query'],_0x6e9427['filters']),_0x5f1b89);if(_0x856c3f[_0xb5eb('0x31')][_0xb5eb('0x3c')]){_0x20915c[_0xb5eb('0x39')]=_[_0xb5eb('0x3d')](_0x20915c['where'],{'$or':_[_0xb5eb('0x2b')](_0x5f1b89,function(_0x30d342){if(_0x30d342[_0xb5eb('0x2e')]!==_0xb5eb('0x3e')){var _0x2289e8={};_0x2289e8[_0x30d342['name']]={'$like':'%'+_0x856c3f[_0xb5eb('0x31')]['filter']+'%'};return _0x2289e8;}})});}_0x20915c=_[_0xb5eb('0x3d')]({},_0x20915c,_0x856c3f[_0xb5eb('0x3f')]);var _0x231746={'where':_0x20915c[_0xb5eb('0x39')]};return db[_0xb5eb('0x40')][_0xb5eb('0x1f')](_0x231746)[_0xb5eb('0x24')](function(_0x5154b5){_0x4a11da[_0xb5eb('0x1f')]=_0x5154b5;if(_0x856c3f[_0xb5eb('0x31')][_0xb5eb('0x41')]){_0x20915c[_0xb5eb('0x42')]=[{'all':!![]}];}return db[_0xb5eb('0x40')][_0xb5eb('0x43')](_0x20915c);})[_0xb5eb('0x24')](function(_0x3fd3a6){_0x4a11da['rows']=_0x3fd3a6;return _0x4a11da;})[_0xb5eb('0x24')](respondWithFilteredResult(_0x45bfc3,_0x20915c))[_0xb5eb('0x44')](handleError(_0x45bfc3,null));};exports[_0xb5eb('0x45')]=function(_0x49a72a,_0xe41961){var _0x178da5={'raw':![],'where':{'id':_0x49a72a[_0xb5eb('0x46')]['id']}},_0x670200={};_0x670200[_0xb5eb('0x30')]=_[_0xb5eb('0x32')](db[_0xb5eb('0x40')][_0xb5eb('0x2c')]);_0x670200['query']=_[_0xb5eb('0x32')](_0x49a72a[_0xb5eb('0x31')]);_0x670200[_0xb5eb('0x3a')]=_[_0xb5eb('0x47')](_0x670200['model'],_0x670200[_0xb5eb('0x31')]);_0x178da5[_0xb5eb('0x33')]=_[_0xb5eb('0x47')](_0x670200[_0xb5eb('0x30')],qs[_0xb5eb('0x34')](_0x49a72a[_0xb5eb('0x31')][_0xb5eb('0x34')]));_0x178da5[_0xb5eb('0x33')]=_0x178da5[_0xb5eb('0x33')][_0xb5eb('0x35')]?_0x178da5[_0xb5eb('0x33')]:_0x670200[_0xb5eb('0x30')];if(_0x49a72a['query']['includeAll']){_0x178da5[_0xb5eb('0x42')]=[{'all':!![]}];}_0x178da5=_[_0xb5eb('0x3d')]({},_0x178da5,_0x49a72a[_0xb5eb('0x3f')]);return db['FreshsalesConfiguration']['find'](_0x178da5)[_0xb5eb('0x24')](handleEntityNotFound(_0xe41961,null))[_0xb5eb('0x24')](respondWithResult(_0xe41961,null))[_0xb5eb('0x44')](handleError(_0xe41961,null));};exports[_0xb5eb('0x48')]=function(_0x97e8ce,_0x1c3e15){return db[_0xb5eb('0x40')][_0xb5eb('0x48')](_0x97e8ce[_0xb5eb('0x49')],{})[_0xb5eb('0x24')](respondWithResult(_0x1c3e15,0xc9))[_0xb5eb('0x44')](handleError(_0x1c3e15,null));};exports[_0xb5eb('0x23')]=function(_0x3646f1,_0xd4e2a1){if(_0x3646f1[_0xb5eb('0x49')]['id']){delete _0x3646f1[_0xb5eb('0x49')]['id'];}return db['FreshsalesConfiguration'][_0xb5eb('0x4a')]({'where':{'id':_0x3646f1[_0xb5eb('0x46')]['id']}})[_0xb5eb('0x24')](handleEntityNotFound(_0xd4e2a1,null))[_0xb5eb('0x24')](saveUpdates(_0x3646f1[_0xb5eb('0x49')],null))['then'](respondWithResult(_0xd4e2a1,null))['catch'](handleError(_0xd4e2a1,null));};exports[_0xb5eb('0x25')]=function(_0xc96920,_0x430f7d){return db[_0xb5eb('0x40')][_0xb5eb('0x4a')]({'where':{'id':_0xc96920[_0xb5eb('0x46')]['id']}})[_0xb5eb('0x24')](handleEntityNotFound(_0x430f7d,null))[_0xb5eb('0x24')](removeEntity(_0x430f7d,null))[_0xb5eb('0x44')](handleError(_0x430f7d,null));};exports[_0xb5eb('0x4b')]=function(_0x47445e,_0x5cfd00,_0xcaa21e){var _0x54f295={};var _0x203821={};var _0x3c2dc2;var _0x3d8a56;return db[_0xb5eb('0x40')][_0xb5eb('0x4c')]({'where':{'id':_0x47445e[_0xb5eb('0x46')]['id']}})['then'](handleEntityNotFound(_0x5cfd00,null))[_0xb5eb('0x24')](function(_0x30e5e9){if(_0x30e5e9){_0x3c2dc2=_0x30e5e9;_0x203821[_0xb5eb('0x30')]=_[_0xb5eb('0x32')](db[_0xb5eb('0x4d')][_0xb5eb('0x2c')]);_0x203821[_0xb5eb('0x31')]=_[_0xb5eb('0x32')](_0x47445e[_0xb5eb('0x31')]);_0x203821['filters']=_[_0xb5eb('0x47')](_0x203821[_0xb5eb('0x30')],_0x203821[_0xb5eb('0x31')]);_0x54f295[_0xb5eb('0x33')]=_[_0xb5eb('0x47')](_0x203821[_0xb5eb('0x30')],qs[_0xb5eb('0x34')](_0x47445e[_0xb5eb('0x31')][_0xb5eb('0x34')]));_0x54f295[_0xb5eb('0x33')]=_0x54f295[_0xb5eb('0x33')][_0xb5eb('0x35')]?_0x54f295[_0xb5eb('0x33')]:_0x203821[_0xb5eb('0x30')];_0x54f295[_0xb5eb('0x37')]=qs['sort'](_0x47445e[_0xb5eb('0x31')][_0xb5eb('0x38')]);_0x54f295[_0xb5eb('0x39')]=qs[_0xb5eb('0x3a')](_[_0xb5eb('0x3b')](_0x47445e[_0xb5eb('0x31')],_0x203821[_0xb5eb('0x3a')]));if(_0x47445e[_0xb5eb('0x31')]['filter']){_0x54f295[_0xb5eb('0x39')]=_[_0xb5eb('0x3d')](_0x54f295[_0xb5eb('0x39')],{'$or':_['map'](_0x54f295[_0xb5eb('0x33')],function(_0xad346c){var _0x8fcfc4={};_0x8fcfc4[_0xad346c]={'$like':'%'+_0x47445e['query'][_0xb5eb('0x3c')]+'%'};return _0x8fcfc4;})});}_0x54f295=_[_0xb5eb('0x3d')]({},_0x54f295,_0x47445e[_0xb5eb('0x3f')]);return _0x3c2dc2['getSubjects'](_0x54f295);}})['then'](function(_0x54e7dc){if(_0x54e7dc){_0x3d8a56=_0x54e7dc[_0xb5eb('0x35')];if(!_0x47445e['query'][_0xb5eb('0x4e')](_0xb5eb('0x36'))){_0x54f295[_0xb5eb('0x1d')]=qs[_0xb5eb('0x1d')](_0x47445e['query'][_0xb5eb('0x1d')]);_0x54f295[_0xb5eb('0x1e')]=qs['offset'](_0x47445e[_0xb5eb('0x31')][_0xb5eb('0x1e')]);}return _0x3c2dc2[_0xb5eb('0x4b')](_0x54f295);}})[_0xb5eb('0x24')](function(_0x4191f0){if(_0x4191f0){return _0x4191f0?{'count':_0x3d8a56,'rows':_0x4191f0}:null;}})[_0xb5eb('0x24')](respondWithResult(_0x5cfd00,null))[_0xb5eb('0x44')](handleError(_0x5cfd00,null));};exports['getDescriptions']=function(_0x413461,_0x1d3c2f,_0x6e2c54){var _0x47371b={};var _0x3071cb={};var _0x1fa3cb;var _0x4fd2b8;return db['FreshsalesConfiguration'][_0xb5eb('0x4c')]({'where':{'id':_0x413461[_0xb5eb('0x46')]['id']}})[_0xb5eb('0x24')](handleEntityNotFound(_0x1d3c2f,null))[_0xb5eb('0x24')](function(_0x38db20){if(_0x38db20){_0x1fa3cb=_0x38db20;_0x3071cb[_0xb5eb('0x30')]=_[_0xb5eb('0x32')](db[_0xb5eb('0x4d')]['rawAttributes']);_0x3071cb[_0xb5eb('0x31')]=_[_0xb5eb('0x32')](_0x413461['query']);_0x3071cb['filters']=_['intersection'](_0x3071cb['model'],_0x3071cb[_0xb5eb('0x31')]);_0x47371b[_0xb5eb('0x33')]=_[_0xb5eb('0x47')](_0x3071cb[_0xb5eb('0x30')],qs[_0xb5eb('0x34')](_0x413461['query'][_0xb5eb('0x34')]));_0x47371b[_0xb5eb('0x33')]=_0x47371b['attributes'][_0xb5eb('0x35')]?_0x47371b[_0xb5eb('0x33')]:_0x3071cb[_0xb5eb('0x30')];_0x47371b[_0xb5eb('0x37')]=qs[_0xb5eb('0x38')](_0x413461[_0xb5eb('0x31')][_0xb5eb('0x38')]);_0x47371b[_0xb5eb('0x39')]=qs[_0xb5eb('0x3a')](_[_0xb5eb('0x3b')](_0x413461['query'],_0x3071cb[_0xb5eb('0x3a')]));if(_0x413461[_0xb5eb('0x31')]['filter']){_0x47371b[_0xb5eb('0x39')]=_[_0xb5eb('0x3d')](_0x47371b[_0xb5eb('0x39')],{'$or':_[_0xb5eb('0x2b')](_0x47371b[_0xb5eb('0x33')],function(_0x3c90f9){var _0x3d2b41={};_0x3d2b41[_0x3c90f9]={'$like':'%'+_0x413461[_0xb5eb('0x31')][_0xb5eb('0x3c')]+'%'};return _0x3d2b41;})});}_0x47371b=_[_0xb5eb('0x3d')]({},_0x47371b,_0x413461[_0xb5eb('0x3f')]);return _0x1fa3cb['getDescriptions'](_0x47371b);}})['then'](function(_0x56820e){if(_0x56820e){_0x4fd2b8=_0x56820e[_0xb5eb('0x35')];if(!_0x413461[_0xb5eb('0x31')]['hasOwnProperty'](_0xb5eb('0x36'))){_0x47371b[_0xb5eb('0x1d')]=qs[_0xb5eb('0x1d')](_0x413461[_0xb5eb('0x31')]['limit']);_0x47371b[_0xb5eb('0x1e')]=qs[_0xb5eb('0x1e')](_0x413461[_0xb5eb('0x31')][_0xb5eb('0x1e')]);}return _0x1fa3cb[_0xb5eb('0x4f')](_0x47371b);}})[_0xb5eb('0x24')](function(_0x23db94){if(_0x23db94){return _0x23db94?{'count':_0x4fd2b8,'rows':_0x23db94}:null;}})[_0xb5eb('0x24')](respondWithResult(_0x1d3c2f,null))[_0xb5eb('0x44')](handleError(_0x1d3c2f,null));};exports[_0xb5eb('0x50')]=function(_0x24fee0,_0x3fb50b,_0x2a9a0e){var _0x3a33c3={};var _0x572908={};var _0x318ca0;var _0x5c2614;return db[_0xb5eb('0x40')]['findOne']({'where':{'id':_0x24fee0['params']['id']}})[_0xb5eb('0x24')](handleEntityNotFound(_0x3fb50b,null))[_0xb5eb('0x24')](function(_0x815d0e){if(_0x815d0e){_0x318ca0=_0x815d0e;_0x572908[_0xb5eb('0x30')]=_[_0xb5eb('0x32')](db['FreshsalesField'][_0xb5eb('0x2c')]);_0x572908[_0xb5eb('0x31')]=_[_0xb5eb('0x32')](_0x24fee0[_0xb5eb('0x31')]);_0x572908[_0xb5eb('0x3a')]=_[_0xb5eb('0x47')](_0x572908[_0xb5eb('0x30')],_0x572908[_0xb5eb('0x31')]);_0x3a33c3[_0xb5eb('0x33')]=_[_0xb5eb('0x47')](_0x572908[_0xb5eb('0x30')],qs[_0xb5eb('0x34')](_0x24fee0[_0xb5eb('0x31')][_0xb5eb('0x34')]));_0x3a33c3[_0xb5eb('0x33')]=_0x3a33c3[_0xb5eb('0x33')]['length']?_0x3a33c3[_0xb5eb('0x33')]:_0x572908[_0xb5eb('0x30')];_0x3a33c3[_0xb5eb('0x37')]=qs[_0xb5eb('0x38')](_0x24fee0[_0xb5eb('0x31')][_0xb5eb('0x38')]);_0x3a33c3[_0xb5eb('0x39')]=qs[_0xb5eb('0x3a')](_[_0xb5eb('0x3b')](_0x24fee0[_0xb5eb('0x31')],_0x572908['filters']));if(_0x24fee0[_0xb5eb('0x31')]['filter']){_0x3a33c3[_0xb5eb('0x39')]=_[_0xb5eb('0x3d')](_0x3a33c3[_0xb5eb('0x39')],{'$or':_[_0xb5eb('0x2b')](_0x3a33c3['attributes'],function(_0x4bdaad){var _0x44b535={};_0x44b535[_0x4bdaad]={'$like':'%'+_0x24fee0[_0xb5eb('0x31')][_0xb5eb('0x3c')]+'%'};return _0x44b535;})});}_0x3a33c3=_['merge']({},_0x3a33c3,_0x24fee0[_0xb5eb('0x3f')]);return _0x318ca0['getFields'](_0x3a33c3);}})[_0xb5eb('0x24')](function(_0x355f5a){if(_0x355f5a){_0x5c2614=_0x355f5a['length'];if(!_0x24fee0['query']['hasOwnProperty'](_0xb5eb('0x36'))){_0x3a33c3[_0xb5eb('0x1d')]=qs[_0xb5eb('0x1d')](_0x24fee0[_0xb5eb('0x31')]['limit']);_0x3a33c3[_0xb5eb('0x1e')]=qs[_0xb5eb('0x1e')](_0x24fee0[_0xb5eb('0x31')]['offset']);}return _0x318ca0[_0xb5eb('0x50')](_0x3a33c3);}})[_0xb5eb('0x24')](function(_0xb7dd3){if(_0xb7dd3){return _0xb7dd3?{'count':_0x5c2614,'rows':_0xb7dd3}:null;}})[_0xb5eb('0x24')](respondWithResult(_0x3fb50b,null))[_0xb5eb('0x44')](handleError(_0x3fb50b,null));}; \ No newline at end of file +var _0x4b84=['mustache','to-csv','ejs','fs-extra','squel','crypto','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','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','include','findAll','rows','catch','show','params','merge','find','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','zip-dir','request-promise','moment'];(function(_0xe57c3e,_0xfd381f){var _0x3b22b5=function(_0x1955d0){while(--_0x1955d0){_0xe57c3e['push'](_0xe57c3e['shift']());}};_0x3b22b5(++_0xfd381f);}(_0x4b84,0x96));var _0x44b8=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x4b84[_0x4e5552];return _0x60a338;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x44b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require(_0x44b8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x44b8('0x5'));var ejs=require(_0x44b8('0x6'));var fs=require('fs');var fs_extra=require(_0x44b8('0x7'));var _=require('lodash');var squel=require(_0x44b8('0x8'));var crypto=require(_0x44b8('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x44b8('0x5'));var querystring=require(_0x44b8('0xa'));var Papa=require(_0x44b8('0xb'));var Redis=require('ioredis');var authService=require(_0x44b8('0xc'));var qs=require(_0x44b8('0xd'));var as=require(_0x44b8('0xe'));var hardwareService=require(_0x44b8('0xf'));var logger=require(_0x44b8('0x10'))(_0x44b8('0x11'));var utils=require(_0x44b8('0x12'));var config=require(_0x44b8('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x14'))['db'];function respondWithStatusCode(_0x4e1400,_0x201f4b){_0x201f4b=_0x201f4b||0xcc;return function(_0x353307){if(_0x353307){return _0x4e1400[_0x44b8('0x15')](_0x201f4b);}return _0x4e1400[_0x44b8('0x16')](_0x201f4b)[_0x44b8('0x17')]();};}function respondWithResult(_0x404601,_0x3e5f1f){_0x3e5f1f=_0x3e5f1f||0xc8;return function(_0x5a18db){if(_0x5a18db){return _0x404601[_0x44b8('0x16')](_0x3e5f1f)[_0x44b8('0x18')](_0x5a18db);}};}function respondWithFilteredResult(_0x16ecb5,_0x2fbb57){return function(_0x4065de){if(_0x4065de){var _0xce865d=typeof _0x2fbb57[_0x44b8('0x19')]===_0x44b8('0x1a')&&typeof _0x2fbb57[_0x44b8('0x1b')]===_0x44b8('0x1a');var _0x50a13c=_0x4065de[_0x44b8('0x1c')];var _0x361d7d=_0xce865d?0x0:_0x2fbb57[_0x44b8('0x19')];var _0x397a72=_0xce865d?_0x4065de[_0x44b8('0x1c')]:_0x2fbb57[_0x44b8('0x19')]+_0x2fbb57[_0x44b8('0x1b')];var _0xc44831;if(_0x397a72>=_0x50a13c){_0x397a72=_0x50a13c;_0xc44831=0xc8;}else{_0xc44831=0xce;}_0x16ecb5[_0x44b8('0x16')](_0xc44831);return _0x16ecb5['set'](_0x44b8('0x1d'),_0x361d7d+'-'+_0x397a72+'/'+_0x50a13c)[_0x44b8('0x18')](_0x4065de);}return null;};}function patchUpdates(_0x1f81ba){return function(_0x5ede34){try{jsonpatch[_0x44b8('0x1e')](_0x5ede34,_0x1f81ba,!![]);}catch(_0x126327){return BPromise[_0x44b8('0x1f')](_0x126327);}return _0x5ede34[_0x44b8('0x20')]();};}function saveUpdates(_0x36bf42,_0x5ea388){return function(_0xe6c7cf){if(_0xe6c7cf){return _0xe6c7cf[_0x44b8('0x21')](_0x36bf42)['then'](function(_0x17e371){return _0x17e371;});}return null;};}function removeEntity(_0x214cd2,_0x4127fb){return function(_0x304dbb){if(_0x304dbb){return _0x304dbb[_0x44b8('0x22')]()[_0x44b8('0x23')](function(){_0x214cd2[_0x44b8('0x16')](0xcc)[_0x44b8('0x17')]();});}};}function handleEntityNotFound(_0x6713ee,_0x3956f6){return function(_0x281d4f){if(!_0x281d4f){_0x6713ee['sendStatus'](0x194);}return _0x281d4f;};}function handleError(_0xf918b4,_0x652bcc){_0x652bcc=_0x652bcc||0x1f4;return function(_0x4ed7d3){logger[_0x44b8('0x24')](_0x4ed7d3[_0x44b8('0x25')]);if(_0x4ed7d3[_0x44b8('0x26')]){delete _0x4ed7d3[_0x44b8('0x26')];}_0xf918b4[_0x44b8('0x16')](_0x652bcc)['send'](_0x4ed7d3);};}exports[_0x44b8('0x27')]=function(_0x119eff,_0x26f22e){var _0x425de9={},_0x22753b={},_0x8c7fdc={'count':0x0,'rows':[]};var _0x17d854=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x565843){return{'name':_0x565843[_0x44b8('0x2b')],'type':_0x565843['type'][_0x44b8('0x2c')]};});_0x22753b[_0x44b8('0x2d')]=_[_0x44b8('0x28')](_0x17d854,_0x44b8('0x26'));_0x22753b[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x119eff['query']);_0x22753b[_0x44b8('0x30')]=_['intersection'](_0x22753b['model'],_0x22753b[_0x44b8('0x2e')]);_0x425de9[_0x44b8('0x31')]=_[_0x44b8('0x32')](_0x22753b[_0x44b8('0x2d')],qs[_0x44b8('0x33')](_0x119eff[_0x44b8('0x2e')]['fields']));_0x425de9['attributes']=_0x425de9[_0x44b8('0x31')][_0x44b8('0x34')]?_0x425de9['attributes']:_0x22753b[_0x44b8('0x2d')];if(!_0x119eff['query']['hasOwnProperty'](_0x44b8('0x35'))){_0x425de9[_0x44b8('0x1b')]=qs[_0x44b8('0x1b')](_0x119eff[_0x44b8('0x2e')][_0x44b8('0x1b')]);_0x425de9[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x119eff[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x425de9[_0x44b8('0x36')]=qs[_0x44b8('0x37')](_0x119eff[_0x44b8('0x2e')][_0x44b8('0x37')]);_0x425de9[_0x44b8('0x38')]=qs['filters'](_[_0x44b8('0x39')](_0x119eff[_0x44b8('0x2e')],_0x22753b[_0x44b8('0x30')]),_0x17d854);if(_0x119eff[_0x44b8('0x2e')][_0x44b8('0x3a')]){_0x425de9[_0x44b8('0x38')]=_['merge'](_0x425de9[_0x44b8('0x38')],{'$or':_[_0x44b8('0x28')](_0x17d854,function(_0x1cc8bc){if(_0x1cc8bc[_0x44b8('0x3b')]!==_0x44b8('0x3c')){var _0x2995a2={};_0x2995a2[_0x1cc8bc[_0x44b8('0x26')]]={'$like':'%'+_0x119eff[_0x44b8('0x2e')]['filter']+'%'};return _0x2995a2;}})});}_0x425de9=_['merge']({},_0x425de9,_0x119eff[_0x44b8('0x3d')]);var _0x4d1a68={'where':_0x425de9['where']};return db[_0x44b8('0x29')][_0x44b8('0x1c')](_0x4d1a68)[_0x44b8('0x23')](function(_0x50beee){_0x8c7fdc['count']=_0x50beee;if(_0x119eff[_0x44b8('0x2e')]['includeAll']){_0x425de9[_0x44b8('0x3e')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x44b8('0x3f')](_0x425de9);})[_0x44b8('0x23')](function(_0x4e90cb){_0x8c7fdc[_0x44b8('0x40')]=_0x4e90cb;return _0x8c7fdc;})['then'](respondWithFilteredResult(_0x26f22e,_0x425de9))[_0x44b8('0x41')](handleError(_0x26f22e,null));};exports[_0x44b8('0x42')]=function(_0x496951,_0xf1b652){var _0x36a318={'raw':![],'where':{'id':_0x496951[_0x44b8('0x43')]['id']}},_0xd360df={};_0xd360df['model']=_[_0x44b8('0x2f')](db[_0x44b8('0x29')]['rawAttributes']);_0xd360df['query']=_['keys'](_0x496951[_0x44b8('0x2e')]);_0xd360df['filters']=_[_0x44b8('0x32')](_0xd360df['model'],_0xd360df[_0x44b8('0x2e')]);_0x36a318[_0x44b8('0x31')]=_[_0x44b8('0x32')](_0xd360df[_0x44b8('0x2d')],qs[_0x44b8('0x33')](_0x496951[_0x44b8('0x2e')][_0x44b8('0x33')]));_0x36a318[_0x44b8('0x31')]=_0x36a318['attributes'][_0x44b8('0x34')]?_0x36a318[_0x44b8('0x31')]:_0xd360df[_0x44b8('0x2d')];if(_0x496951[_0x44b8('0x2e')]['includeAll']){_0x36a318[_0x44b8('0x3e')]=[{'all':!![]}];}_0x36a318=_[_0x44b8('0x44')]({},_0x36a318,_0x496951['options']);return db[_0x44b8('0x29')][_0x44b8('0x45')](_0x36a318)['then'](handleEntityNotFound(_0xf1b652,null))[_0x44b8('0x23')](respondWithResult(_0xf1b652,null))[_0x44b8('0x41')](handleError(_0xf1b652,null));};exports['create']=function(_0x143dfa,_0x445172){return db[_0x44b8('0x29')]['create'](_0x143dfa[_0x44b8('0x46')],{})[_0x44b8('0x23')](respondWithResult(_0x445172,0xc9))[_0x44b8('0x41')](handleError(_0x445172,null));};exports[_0x44b8('0x21')]=function(_0x1836ca,_0x49890b){if(_0x1836ca['body']['id']){delete _0x1836ca[_0x44b8('0x46')]['id'];}return db[_0x44b8('0x29')][_0x44b8('0x45')]({'where':{'id':_0x1836ca[_0x44b8('0x43')]['id']}})[_0x44b8('0x23')](handleEntityNotFound(_0x49890b,null))[_0x44b8('0x23')](saveUpdates(_0x1836ca[_0x44b8('0x46')],null))[_0x44b8('0x23')](respondWithResult(_0x49890b,null))[_0x44b8('0x41')](handleError(_0x49890b,null));};exports['destroy']=function(_0x568dbe,_0x4a1a69){return db[_0x44b8('0x29')][_0x44b8('0x45')]({'where':{'id':_0x568dbe[_0x44b8('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a1a69,null))[_0x44b8('0x23')](removeEntity(_0x4a1a69,null))[_0x44b8('0x41')](handleError(_0x4a1a69,null));};exports[_0x44b8('0x47')]=function(_0x425c4a,_0xa4d963,_0x17f76d){var _0x28e943={};var _0x275698={};var _0x18ff69;var _0x359cf9;return db[_0x44b8('0x29')][_0x44b8('0x48')]({'where':{'id':_0x425c4a[_0x44b8('0x43')]['id']}})['then'](handleEntityNotFound(_0xa4d963,null))[_0x44b8('0x23')](function(_0x33dbae){if(_0x33dbae){_0x18ff69=_0x33dbae;_0x275698['model']=_[_0x44b8('0x2f')](db[_0x44b8('0x49')][_0x44b8('0x2a')]);_0x275698[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x425c4a[_0x44b8('0x2e')]);_0x275698[_0x44b8('0x30')]=_[_0x44b8('0x32')](_0x275698[_0x44b8('0x2d')],_0x275698[_0x44b8('0x2e')]);_0x28e943[_0x44b8('0x31')]=_[_0x44b8('0x32')](_0x275698[_0x44b8('0x2d')],qs[_0x44b8('0x33')](_0x425c4a[_0x44b8('0x2e')][_0x44b8('0x33')]));_0x28e943[_0x44b8('0x31')]=_0x28e943[_0x44b8('0x31')][_0x44b8('0x34')]?_0x28e943['attributes']:_0x275698['model'];_0x28e943['order']=qs[_0x44b8('0x37')](_0x425c4a[_0x44b8('0x2e')][_0x44b8('0x37')]);_0x28e943[_0x44b8('0x38')]=qs['filters'](_[_0x44b8('0x39')](_0x425c4a[_0x44b8('0x2e')],_0x275698[_0x44b8('0x30')]));if(_0x425c4a[_0x44b8('0x2e')]['filter']){_0x28e943[_0x44b8('0x38')]=_[_0x44b8('0x44')](_0x28e943['where'],{'$or':_[_0x44b8('0x28')](_0x28e943[_0x44b8('0x31')],function(_0x398a89){var _0x4bc94f={};_0x4bc94f[_0x398a89]={'$like':'%'+_0x425c4a[_0x44b8('0x2e')]['filter']+'%'};return _0x4bc94f;})});}_0x28e943=_['merge']({},_0x28e943,_0x425c4a['options']);return _0x18ff69[_0x44b8('0x47')](_0x28e943);}})[_0x44b8('0x23')](function(_0x3451b5){if(_0x3451b5){_0x359cf9=_0x3451b5['length'];if(!_0x425c4a['query'][_0x44b8('0x4a')](_0x44b8('0x35'))){_0x28e943['limit']=qs[_0x44b8('0x1b')](_0x425c4a[_0x44b8('0x2e')][_0x44b8('0x1b')]);_0x28e943['offset']=qs[_0x44b8('0x19')](_0x425c4a['query'][_0x44b8('0x19')]);}return _0x18ff69[_0x44b8('0x47')](_0x28e943);}})[_0x44b8('0x23')](function(_0x2ef761){if(_0x2ef761){return _0x2ef761?{'count':_0x359cf9,'rows':_0x2ef761}:null;}})[_0x44b8('0x23')](respondWithResult(_0xa4d963,null))[_0x44b8('0x41')](handleError(_0xa4d963,null));};exports['getDescriptions']=function(_0x3149b2,_0x16abe9,_0x202562){var _0x438f3b={};var _0x39f999={};var _0x126699;var _0x18ec40;return db[_0x44b8('0x29')][_0x44b8('0x48')]({'where':{'id':_0x3149b2[_0x44b8('0x43')]['id']}})['then'](handleEntityNotFound(_0x16abe9,null))[_0x44b8('0x23')](function(_0x1e818d){if(_0x1e818d){_0x126699=_0x1e818d;_0x39f999['model']=_[_0x44b8('0x2f')](db[_0x44b8('0x49')][_0x44b8('0x2a')]);_0x39f999[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x3149b2[_0x44b8('0x2e')]);_0x39f999[_0x44b8('0x30')]=_['intersection'](_0x39f999['model'],_0x39f999[_0x44b8('0x2e')]);_0x438f3b[_0x44b8('0x31')]=_[_0x44b8('0x32')](_0x39f999[_0x44b8('0x2d')],qs['fields'](_0x3149b2['query']['fields']));_0x438f3b[_0x44b8('0x31')]=_0x438f3b[_0x44b8('0x31')]['length']?_0x438f3b[_0x44b8('0x31')]:_0x39f999[_0x44b8('0x2d')];_0x438f3b[_0x44b8('0x36')]=qs[_0x44b8('0x37')](_0x3149b2[_0x44b8('0x2e')]['sort']);_0x438f3b['where']=qs[_0x44b8('0x30')](_[_0x44b8('0x39')](_0x3149b2['query'],_0x39f999['filters']));if(_0x3149b2['query']['filter']){_0x438f3b[_0x44b8('0x38')]=_[_0x44b8('0x44')](_0x438f3b[_0x44b8('0x38')],{'$or':_[_0x44b8('0x28')](_0x438f3b['attributes'],function(_0x5542b7){var _0x4af1e3={};_0x4af1e3[_0x5542b7]={'$like':'%'+_0x3149b2[_0x44b8('0x2e')]['filter']+'%'};return _0x4af1e3;})});}_0x438f3b=_[_0x44b8('0x44')]({},_0x438f3b,_0x3149b2[_0x44b8('0x3d')]);return _0x126699[_0x44b8('0x4b')](_0x438f3b);}})[_0x44b8('0x23')](function(_0x419cf6){if(_0x419cf6){_0x18ec40=_0x419cf6[_0x44b8('0x34')];if(!_0x3149b2[_0x44b8('0x2e')][_0x44b8('0x4a')](_0x44b8('0x35'))){_0x438f3b[_0x44b8('0x1b')]=qs[_0x44b8('0x1b')](_0x3149b2[_0x44b8('0x2e')]['limit']);_0x438f3b[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x3149b2[_0x44b8('0x2e')][_0x44b8('0x19')]);}return _0x126699[_0x44b8('0x4b')](_0x438f3b);}})[_0x44b8('0x23')](function(_0xd7af84){if(_0xd7af84){return _0xd7af84?{'count':_0x18ec40,'rows':_0xd7af84}:null;}})[_0x44b8('0x23')](respondWithResult(_0x16abe9,null))[_0x44b8('0x41')](handleError(_0x16abe9,null));};exports['getFields']=function(_0x273991,_0x12b1d4,_0x3b1218){var _0x7b306b={};var _0x1196f8={};var _0x515395;var _0x16775d;return db[_0x44b8('0x29')]['findOne']({'where':{'id':_0x273991[_0x44b8('0x43')]['id']}})[_0x44b8('0x23')](handleEntityNotFound(_0x12b1d4,null))[_0x44b8('0x23')](function(_0x4e9188){if(_0x4e9188){_0x515395=_0x4e9188;_0x1196f8[_0x44b8('0x2d')]=_[_0x44b8('0x2f')](db[_0x44b8('0x49')][_0x44b8('0x2a')]);_0x1196f8['query']=_[_0x44b8('0x2f')](_0x273991[_0x44b8('0x2e')]);_0x1196f8[_0x44b8('0x30')]=_[_0x44b8('0x32')](_0x1196f8[_0x44b8('0x2d')],_0x1196f8['query']);_0x7b306b[_0x44b8('0x31')]=_[_0x44b8('0x32')](_0x1196f8[_0x44b8('0x2d')],qs[_0x44b8('0x33')](_0x273991[_0x44b8('0x2e')][_0x44b8('0x33')]));_0x7b306b['attributes']=_0x7b306b[_0x44b8('0x31')][_0x44b8('0x34')]?_0x7b306b[_0x44b8('0x31')]:_0x1196f8[_0x44b8('0x2d')];_0x7b306b[_0x44b8('0x36')]=qs[_0x44b8('0x37')](_0x273991[_0x44b8('0x2e')][_0x44b8('0x37')]);_0x7b306b['where']=qs[_0x44b8('0x30')](_[_0x44b8('0x39')](_0x273991[_0x44b8('0x2e')],_0x1196f8[_0x44b8('0x30')]));if(_0x273991[_0x44b8('0x2e')][_0x44b8('0x3a')]){_0x7b306b['where']=_[_0x44b8('0x44')](_0x7b306b[_0x44b8('0x38')],{'$or':_['map'](_0x7b306b[_0x44b8('0x31')],function(_0x1686ac){var _0x4e21f8={};_0x4e21f8[_0x1686ac]={'$like':'%'+_0x273991['query'][_0x44b8('0x3a')]+'%'};return _0x4e21f8;})});}_0x7b306b=_['merge']({},_0x7b306b,_0x273991[_0x44b8('0x3d')]);return _0x515395[_0x44b8('0x4c')](_0x7b306b);}})[_0x44b8('0x23')](function(_0x9c3f7f){if(_0x9c3f7f){_0x16775d=_0x9c3f7f['length'];if(!_0x273991[_0x44b8('0x2e')][_0x44b8('0x4a')](_0x44b8('0x35'))){_0x7b306b[_0x44b8('0x1b')]=qs[_0x44b8('0x1b')](_0x273991[_0x44b8('0x2e')]['limit']);_0x7b306b['offset']=qs['offset'](_0x273991[_0x44b8('0x2e')][_0x44b8('0x19')]);}return _0x515395['getFields'](_0x7b306b);}})[_0x44b8('0x23')](function(_0xde88b2){if(_0xde88b2){return _0xde88b2?{'count':_0x16775d,'rows':_0xde88b2}:null;}})[_0x44b8('0x23')](respondWithResult(_0x12b1d4,null))['catch'](handleError(_0x12b1d4,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index a5f28f9..b2d5d3a 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 _0xde8d=['bluebird','path','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','moment'];(function(_0x52d477,_0x39e29b){var _0x5da74f=function(_0x7d7dfb){while(--_0x7d7dfb){_0x52d477['push'](_0x52d477['shift']());}};_0x5da74f(++_0x39e29b);}(_0xde8d,0x189));var _0xdde8=function(_0x46b9f8,_0x216a13){_0x46b9f8=_0x46b9f8-0x0;var _0x194a9d=_0xde8d[_0x46b9f8];return _0x194a9d;};'use strict';var _=require(_0xdde8('0x0'));var util=require('util');var logger=require(_0xdde8('0x1'))('api');var moment=require(_0xdde8('0x2'));var BPromise=require(_0xdde8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdde8('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdde8('0x5'));module[_0xdde8('0x6')]=function(_0x4effb3,_0x51fd09){return _0x4effb3['define'](_0xdde8('0x7'),attributes,{'tableName':_0xdde8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec8b=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshsalesConfiguration.attributes','exports','int_freshsales_configurations','lodash','util'];(function(_0x580a59,_0x21266c){var _0x19da51=function(_0x772ac8){while(--_0x772ac8){_0x580a59['push'](_0x580a59['shift']());}};_0x19da51(++_0x21266c);}(_0xec8b,0x169));var _0xbec8=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xec8b[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0xbec8('0x0'));var util=require(_0xbec8('0x1'));var logger=require(_0xbec8('0x2'))(_0xbec8('0x3'));var moment=require(_0xbec8('0x4'));var BPromise=require(_0xbec8('0x5'));var rp=require(_0xbec8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbec8('0x7'));var attributes=require(_0xbec8('0x8'));module[_0xbec8('0x9')]=function(_0x1bf65c,_0x20e9ce){return _0x1bf65c['define']('FreshsalesConfiguration',attributes,{'tableName':_0xbec8('0xa'),'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 9d4ab10..255d968 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 _0x7ea7=['error','message','FreshsalesConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify'];(function(_0x39157f,_0x3d8c1e){var _0x1ae4e2=function(_0x3429af){while(--_0x3429af){_0x39157f['push'](_0x39157f['shift']());}};_0x1ae4e2(++_0x3d8c1e);}(_0x7ea7,0x83));var _0x77ea=function(_0x28f32c,_0x4cc342){_0x28f32c=_0x28f32c-0x0;var _0x355402=_0x7ea7[_0x28f32c];return _0x355402;};'use strict';var _=require(_0x77ea('0x0'));var util=require(_0x77ea('0x1'));var moment=require(_0x77ea('0x2'));var BPromise=require('bluebird');var rs=require(_0x77ea('0x3'));var fs=require('fs');var Redis=require(_0x77ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x77ea('0x5'));var logger=require(_0x77ea('0x6'))(_0x77ea('0x7'));var config=require(_0x77ea('0x8'));var jayson=require(_0x77ea('0x9'));var client=jayson[_0x77ea('0xa')][_0x77ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb21c6e,_0x16c25c,_0x7fea69){return new BPromise(function(_0x506eb1,_0x5d4d55){return client['request'](_0xb21c6e,_0x7fea69)[_0x77ea('0xc')](function(_0x5ea49d){logger[_0x77ea('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x16c25c,'request\x20sent');logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x16c25c,_0x77ea('0xe'),JSON[_0x77ea('0xf')](_0x5ea49d));if(_0x5ea49d['error']){if(_0x5ea49d[_0x77ea('0x10')]['code']===0x1f4){logger[_0x77ea('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x16c25c,_0x5ea49d[_0x77ea('0x10')][_0x77ea('0x11')]);return _0x5d4d55(_0x5ea49d['error']['message']);}logger[_0x77ea('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x16c25c,_0x5ea49d[_0x77ea('0x10')][_0x77ea('0x11')]);return _0x506eb1(_0x5ea49d['error'][_0x77ea('0x11')]);}else{logger[_0x77ea('0xd')](_0x77ea('0x12'),_0x16c25c,_0x77ea('0xe'));_0x506eb1(_0x5ea49d[_0x77ea('0x13')][_0x77ea('0x11')]);}})[_0x77ea('0x14')](function(_0x392b33){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x16c25c,_0x392b33);_0x5d4d55(_0x392b33);});});} \ No newline at end of file +var _0xf194=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x3107e7,_0x259bc1){var _0x1f97bc=function(_0x495e40){while(--_0x495e40){_0x3107e7['push'](_0x3107e7['shift']());}};_0x1f97bc(++_0x259bc1);}(_0xf194,0xd8));var _0x4f19=function(_0x118302,_0x25be4){_0x118302=_0x118302-0x0;var _0x574e61=_0xf194[_0x118302];return _0x574e61;};'use strict';var _=require(_0x4f19('0x0'));var util=require(_0x4f19('0x1'));var moment=require(_0x4f19('0x2'));var BPromise=require(_0x4f19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f19('0x4'));var db=require(_0x4f19('0x5'))['db'];var utils=require(_0x4f19('0x6'));var logger=require(_0x4f19('0x7'))(_0x4f19('0x8'));var config=require(_0x4f19('0x9'));var jayson=require(_0x4f19('0xa'));var client=jayson[_0x4f19('0xb')][_0x4f19('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c8b4a,_0x5a94c3,_0x19bdda){return new BPromise(function(_0x2b5cdf,_0x1583d4){return client[_0x4f19('0xd')](_0x3c8b4a,_0x19bdda)[_0x4f19('0xe')](function(_0xfecb43){logger[_0x4f19('0xf')](_0x4f19('0x10'),_0x5a94c3,_0x4f19('0x11'));logger[_0x4f19('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5a94c3,'request\x20sent',JSON[_0x4f19('0x13')](_0xfecb43));if(_0xfecb43[_0x4f19('0x14')]){if(_0xfecb43[_0x4f19('0x14')][_0x4f19('0x15')]===0x1f4){logger[_0x4f19('0x14')](_0x4f19('0x10'),_0x5a94c3,_0xfecb43[_0x4f19('0x14')][_0x4f19('0x16')]);return _0x1583d4(_0xfecb43[_0x4f19('0x14')]['message']);}logger[_0x4f19('0x14')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5a94c3,_0xfecb43[_0x4f19('0x14')][_0x4f19('0x16')]);return _0x2b5cdf(_0xfecb43[_0x4f19('0x14')][_0x4f19('0x16')]);}else{logger[_0x4f19('0xf')](_0x4f19('0x10'),_0x5a94c3,'request\x20sent');_0x2b5cdf(_0xfecb43['result']['message']);}})[_0x4f19('0x17')](function(_0x2f43b0){logger[_0x4f19('0x14')](_0x4f19('0x10'),_0x5a94c3,_0x2f43b0);_0x1583d4(_0x2f43b0);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 2426ba1..a740fff 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 _0x4ea3=['multer','util','path','connect-timeout','Router','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','post','create','destroy'];(function(_0xcb0eb2,_0x3906bf){var _0xbab9b8=function(_0x24fa8a){while(--_0x24fa8a){_0xcb0eb2['push'](_0xcb0eb2['shift']());}};_0xbab9b8(++_0x3906bf);}(_0x4ea3,0x70));var _0x34ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4ea3[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x34ea('0x6'));router[_0x34ea('0x7')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0x9')]);router[_0x34ea('0x7')](_0x34ea('0xa'),auth[_0x34ea('0x8')](),controller['show']);router[_0x34ea('0xb')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0xc')]);router['put'](_0x34ea('0xa'),auth[_0x34ea('0x8')](),controller['update']);router['delete'](_0x34ea('0xa'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xd')]);module['exports']=router; \ No newline at end of file +var _0x4a81=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x3d3734,_0x11b20e){var _0x214b3a=function(_0x5b658e){while(--_0x5b658e){_0x3d3734['push'](_0x3d3734['shift']());}};_0x214b3a(++_0x11b20e);}(_0x4a81,0x1b7));var _0x14a8=function(_0x48312a,_0x41cc3e){_0x48312a=_0x48312a-0x0;var _0x1d1ff0=_0x4a81[_0x48312a];return _0x1d1ff0;};'use strict';var multer=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var path=require(_0x14a8('0x2'));var timeout=require(_0x14a8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x14a8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x14a8('0x5'));var config=require(_0x14a8('0x6'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x14a8('0x7')](),controller['index']);router[_0x14a8('0x8')]('/:id',auth[_0x14a8('0x7')](),controller[_0x14a8('0x9')]);router[_0x14a8('0xa')]('/',auth[_0x14a8('0x7')](),controller[_0x14a8('0xb')]);router['put']('/:id',auth[_0x14a8('0x7')](),controller[_0x14a8('0xc')]);router[_0x14a8('0xd')]('/:id',auth[_0x14a8('0x7')](),controller[_0x14a8('0xe')]);module[_0x14a8('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 7f98277..ad3287e 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 _0x3556=['customVariable','sequelize','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x589280,_0x46a0f2){var _0x499aad=function(_0x5255fe){while(--_0x5255fe){_0x589280['push'](_0x589280['shift']());}};_0x499aad(++_0x46a0f2);}(_0x3556,0x81));var _0x6355=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x3556[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x6355('0x0'));module['exports']={'type':{'type':Sequelize[_0x6355('0x1')](_0x6355('0x2'),_0x6355('0x3'),'customVariable',_0x6355('0x4'),_0x6355('0x5')),'defaultValue':_0x6355('0x2')},'content':{'type':Sequelize[_0x6355('0x6')]},'key':{'type':Sequelize[_0x6355('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x6355('0x2'),_0x6355('0x3'),_0x6355('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6355('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdf25=['STRING','ENUM','string','variable','customVariable','picklist'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdf25,0x1c3));var _0x5df2=function(_0x47eaff,_0x502553){_0x47eaff=_0x47eaff-0x0;var _0x53103e=_0xdf25[_0x47eaff];return _0x53103e;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5df2('0x0')](_0x5df2('0x1'),_0x5df2('0x2'),_0x5df2('0x3'),'keyValue',_0x5df2('0x4')),'defaultValue':_0x5df2('0x1')},'content':{'type':Sequelize[_0x5df2('0x5')]},'key':{'type':Sequelize[_0x5df2('0x5')]},'keyType':{'type':Sequelize[_0x5df2('0x0')]('string',_0x5df2('0x2'),_0x5df2('0x3'))},'keyContent':{'type':Sequelize[_0x5df2('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5df2('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 34f4478..8840487 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 _0x5368=['destroy','end','error','stack','name','send','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','include','findAll','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','then'];(function(_0x1f9870,_0x4b1669){var _0x54086a=function(_0x43c13f){while(--_0x43c13f){_0x1f9870['push'](_0x1f9870['shift']());}};_0x54086a(++_0x4b1669);}(_0x5368,0x1c8));var _0x8536=function(_0x3fbd2e,_0x573106){_0x3fbd2e=_0x3fbd2e-0x0;var _0x2c14a1=_0x5368[_0x3fbd2e];return _0x2c14a1;};'use strict';var emlformat=require(_0x8536('0x0'));var rimraf=require(_0x8536('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8536('0x2'));var rp=require(_0x8536('0x3'));var moment=require(_0x8536('0x4'));var BPromise=require(_0x8536('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8536('0x6'));var csv=require(_0x8536('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8536('0x8'));var squel=require(_0x8536('0x9'));var crypto=require(_0x8536('0xa'));var jsforce=require(_0x8536('0xb'));var deskjs=require(_0x8536('0xc'));var toCsv=require(_0x8536('0x7'));var querystring=require(_0x8536('0xd'));var Papa=require('papaparse');var Redis=require(_0x8536('0xe'));var authService=require(_0x8536('0xf'));var qs=require(_0x8536('0x10'));var as=require(_0x8536('0x11'));var hardwareService=require(_0x8536('0x12'));var logger=require(_0x8536('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8536('0x14'));var licenseUtil=require(_0x8536('0x15'));var db=require(_0x8536('0x16'))['db'];function respondWithStatusCode(_0x5349be,_0x4653f2){_0x4653f2=_0x4653f2||0xcc;return function(_0x1d46a8){if(_0x1d46a8){return _0x5349be[_0x8536('0x17')](_0x4653f2);}return _0x5349be[_0x8536('0x18')](_0x4653f2)['end']();};}function respondWithResult(_0x2eb2c9,_0xa8eb7f){_0xa8eb7f=_0xa8eb7f||0xc8;return function(_0x3b0aeb){if(_0x3b0aeb){return _0x2eb2c9[_0x8536('0x18')](_0xa8eb7f)[_0x8536('0x19')](_0x3b0aeb);}};}function respondWithFilteredResult(_0x5cb099,_0x108011){return function(_0x342c75){if(_0x342c75){var _0x549f83=typeof _0x108011['offset']===_0x8536('0x1a')&&typeof _0x108011[_0x8536('0x1b')]==='undefined';var _0x199df1=_0x342c75[_0x8536('0x1c')];var _0x4a31c3=_0x549f83?0x0:_0x108011[_0x8536('0x1d')];var _0x3dbf2=_0x549f83?_0x342c75['count']:_0x108011['offset']+_0x108011[_0x8536('0x1b')];var _0x113c7f;if(_0x3dbf2>=_0x199df1){_0x3dbf2=_0x199df1;_0x113c7f=0xc8;}else{_0x113c7f=0xce;}_0x5cb099['status'](_0x113c7f);return _0x5cb099['set']('Content-Range',_0x4a31c3+'-'+_0x3dbf2+'/'+_0x199df1)[_0x8536('0x19')](_0x342c75);}return null;};}function patchUpdates(_0x4774b0){return function(_0xf3532){try{jsonpatch[_0x8536('0x1e')](_0xf3532,_0x4774b0,!![]);}catch(_0x551850){return BPromise[_0x8536('0x1f')](_0x551850);}return _0xf3532[_0x8536('0x20')]();};}function saveUpdates(_0x32deb4,_0x2411ec){return function(_0xd2dd2a){if(_0xd2dd2a){return _0xd2dd2a['update'](_0x32deb4)[_0x8536('0x21')](function(_0x2633cb){return _0x2633cb;});}return null;};}function removeEntity(_0xb49a9b,_0x2d2216){return function(_0x414c36){if(_0x414c36){return _0x414c36[_0x8536('0x22')]()[_0x8536('0x21')](function(){_0xb49a9b[_0x8536('0x18')](0xcc)[_0x8536('0x23')]();});}};}function handleEntityNotFound(_0x45fd53,_0x536654){return function(_0x59b58e){if(!_0x59b58e){_0x45fd53['sendStatus'](0x194);}return _0x59b58e;};}function handleError(_0x1fe736,_0x4a8a4a){_0x4a8a4a=_0x4a8a4a||0x1f4;return function(_0xd31b0b){logger[_0x8536('0x24')](_0xd31b0b[_0x8536('0x25')]);if(_0xd31b0b[_0x8536('0x26')]){delete _0xd31b0b[_0x8536('0x26')];}_0x1fe736[_0x8536('0x18')](_0x4a8a4a)[_0x8536('0x27')](_0xd31b0b);};}exports['index']=function(_0x433a1b,_0x503cd3){var _0xfdf42f={},_0x4ab20f={},_0x4ea1b7={'count':0x0,'rows':[]};var _0x20c50b=_['map'](db[_0x8536('0x28')][_0x8536('0x29')],function(_0x3273d6){return{'name':_0x3273d6[_0x8536('0x2a')],'type':_0x3273d6[_0x8536('0x2b')][_0x8536('0x2c')]};});_0x4ab20f[_0x8536('0x2d')]=_['map'](_0x20c50b,_0x8536('0x26'));_0x4ab20f[_0x8536('0x2e')]=_[_0x8536('0x2f')](_0x433a1b[_0x8536('0x2e')]);_0x4ab20f[_0x8536('0x30')]=_[_0x8536('0x31')](_0x4ab20f['model'],_0x4ab20f[_0x8536('0x2e')]);_0xfdf42f['attributes']=_[_0x8536('0x31')](_0x4ab20f[_0x8536('0x2d')],qs[_0x8536('0x32')](_0x433a1b[_0x8536('0x2e')][_0x8536('0x32')]));_0xfdf42f[_0x8536('0x33')]=_0xfdf42f[_0x8536('0x33')][_0x8536('0x34')]?_0xfdf42f[_0x8536('0x33')]:_0x4ab20f[_0x8536('0x2d')];if(!_0x433a1b[_0x8536('0x2e')][_0x8536('0x35')](_0x8536('0x36'))){_0xfdf42f[_0x8536('0x1b')]=qs[_0x8536('0x1b')](_0x433a1b[_0x8536('0x2e')][_0x8536('0x1b')]);_0xfdf42f[_0x8536('0x1d')]=qs[_0x8536('0x1d')](_0x433a1b[_0x8536('0x2e')][_0x8536('0x1d')]);}_0xfdf42f[_0x8536('0x37')]=qs['sort'](_0x433a1b['query'][_0x8536('0x38')]);_0xfdf42f[_0x8536('0x39')]=qs[_0x8536('0x30')](_['pick'](_0x433a1b[_0x8536('0x2e')],_0x4ab20f['filters']),_0x20c50b);if(_0x433a1b[_0x8536('0x2e')][_0x8536('0x3a')]){_0xfdf42f[_0x8536('0x39')]=_[_0x8536('0x3b')](_0xfdf42f['where'],{'$or':_[_0x8536('0x3c')](_0x20c50b,function(_0x310f72){if(_0x310f72[_0x8536('0x2b')]!==_0x8536('0x3d')){var _0x534d68={};_0x534d68[_0x310f72[_0x8536('0x26')]]={'$like':'%'+_0x433a1b[_0x8536('0x2e')][_0x8536('0x3a')]+'%'};return _0x534d68;}})});}_0xfdf42f=_[_0x8536('0x3b')]({},_0xfdf42f,_0x433a1b[_0x8536('0x3e')]);var _0x48462f={'where':_0xfdf42f['where']};return db['FreshsalesField'][_0x8536('0x1c')](_0x48462f)['then'](function(_0x21bf70){_0x4ea1b7['count']=_0x21bf70;if(_0x433a1b[_0x8536('0x2e')]['includeAll']){_0xfdf42f[_0x8536('0x3f')]=[{'all':!![]}];}return db['FreshsalesField'][_0x8536('0x40')](_0xfdf42f);})['then'](function(_0x13d6b2){_0x4ea1b7['rows']=_0x13d6b2;return _0x4ea1b7;})['then'](respondWithFilteredResult(_0x503cd3,_0xfdf42f))['catch'](handleError(_0x503cd3,null));};exports['show']=function(_0x241206,_0x280704){var _0x501068={'raw':!![],'where':{'id':_0x241206['params']['id']}},_0x47c74f={};_0x47c74f['model']=_[_0x8536('0x2f')](db[_0x8536('0x28')][_0x8536('0x29')]);_0x47c74f[_0x8536('0x2e')]=_[_0x8536('0x2f')](_0x241206[_0x8536('0x2e')]);_0x47c74f[_0x8536('0x30')]=_[_0x8536('0x31')](_0x47c74f[_0x8536('0x2d')],_0x47c74f[_0x8536('0x2e')]);_0x501068[_0x8536('0x33')]=_[_0x8536('0x31')](_0x47c74f[_0x8536('0x2d')],qs['fields'](_0x241206['query'][_0x8536('0x32')]));_0x501068[_0x8536('0x33')]=_0x501068[_0x8536('0x33')]['length']?_0x501068[_0x8536('0x33')]:_0x47c74f[_0x8536('0x2d')];if(_0x241206[_0x8536('0x2e')]['includeAll']){_0x501068[_0x8536('0x3f')]=[{'all':!![]}];}_0x501068=_[_0x8536('0x3b')]({},_0x501068,_0x241206[_0x8536('0x3e')]);return db['FreshsalesField'][_0x8536('0x41')](_0x501068)[_0x8536('0x21')](handleEntityNotFound(_0x280704,null))['then'](respondWithResult(_0x280704,null))[_0x8536('0x42')](handleError(_0x280704,null));};exports[_0x8536('0x43')]=function(_0x3a3ce4,_0x89f096){return db[_0x8536('0x28')]['create'](_0x3a3ce4['body'],{})[_0x8536('0x21')](respondWithResult(_0x89f096,0xc9))['catch'](handleError(_0x89f096,null));};exports['update']=function(_0x3379de,_0x415a83){if(_0x3379de[_0x8536('0x44')]['id']){delete _0x3379de[_0x8536('0x44')]['id'];}return db[_0x8536('0x28')]['find']({'where':{'id':_0x3379de[_0x8536('0x45')]['id']}})[_0x8536('0x21')](handleEntityNotFound(_0x415a83,null))[_0x8536('0x21')](saveUpdates(_0x3379de['body'],null))[_0x8536('0x21')](respondWithResult(_0x415a83,null))[_0x8536('0x42')](handleError(_0x415a83,null));};exports[_0x8536('0x22')]=function(_0x1f5813,_0x4f2185){return db[_0x8536('0x28')][_0x8536('0x41')]({'where':{'id':_0x1f5813['params']['id']}})[_0x8536('0x21')](handleEntityNotFound(_0x4f2185,null))[_0x8536('0x21')](removeEntity(_0x4f2185,null))[_0x8536('0x42')](handleError(_0x4f2185,null));}; \ No newline at end of file +var _0x24d6=['sendStatus','name','send','index','map','FreshsalesField','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','type','merge','findAll','rows','catch','show','include','options','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x13bc50,_0x4c9aeb){var _0x44ccbb=function(_0x1de143){while(--_0x1de143){_0x13bc50['push'](_0x13bc50['shift']());}};_0x44ccbb(++_0x4c9aeb);}(_0x24d6,0x1ab));var _0x624d=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x24d6[_0x4702ee];return _0x62ca7d;};'use strict';var emlformat=require(_0x624d('0x0'));var rimraf=require(_0x624d('0x1'));var zipdir=require(_0x624d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x624d('0x3'));var moment=require(_0x624d('0x4'));var BPromise=require(_0x624d('0x5'));var Mustache=require(_0x624d('0x6'));var util=require('util');var path=require(_0x624d('0x7'));var sox=require(_0x624d('0x8'));var csv=require(_0x624d('0x9'));var ejs=require(_0x624d('0xa'));var fs=require('fs');var fs_extra=require(_0x624d('0xb'));var _=require(_0x624d('0xc'));var squel=require('squel');var crypto=require(_0x624d('0xd'));var jsforce=require(_0x624d('0xe'));var deskjs=require(_0x624d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x624d('0x10'));var Papa=require(_0x624d('0x11'));var Redis=require(_0x624d('0x12'));var authService=require(_0x624d('0x13'));var qs=require(_0x624d('0x14'));var as=require(_0x624d('0x15'));var hardwareService=require(_0x624d('0x16'));var logger=require('../../config/logger')(_0x624d('0x17'));var utils=require(_0x624d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x624d('0x19'));var db=require(_0x624d('0x1a'))['db'];function respondWithStatusCode(_0x10cdaa,_0xc49a28){_0xc49a28=_0xc49a28||0xcc;return function(_0x1826fa){if(_0x1826fa){return _0x10cdaa['sendStatus'](_0xc49a28);}return _0x10cdaa['status'](_0xc49a28)[_0x624d('0x1b')]();};}function respondWithResult(_0x1a4333,_0x4ca4a3){_0x4ca4a3=_0x4ca4a3||0xc8;return function(_0x3828da){if(_0x3828da){return _0x1a4333['status'](_0x4ca4a3)[_0x624d('0x1c')](_0x3828da);}};}function respondWithFilteredResult(_0x3ecf2c,_0x1d4098){return function(_0x3ce189){if(_0x3ce189){var _0x25e16c=typeof _0x1d4098[_0x624d('0x1d')]===_0x624d('0x1e')&&typeof _0x1d4098['limit']===_0x624d('0x1e');var _0x139a0b=_0x3ce189['count'];var _0x20232e=_0x25e16c?0x0:_0x1d4098['offset'];var _0x158821=_0x25e16c?_0x3ce189[_0x624d('0x1f')]:_0x1d4098[_0x624d('0x1d')]+_0x1d4098['limit'];var _0x8e2d42;if(_0x158821>=_0x139a0b){_0x158821=_0x139a0b;_0x8e2d42=0xc8;}else{_0x8e2d42=0xce;}_0x3ecf2c[_0x624d('0x20')](_0x8e2d42);return _0x3ecf2c[_0x624d('0x21')](_0x624d('0x22'),_0x20232e+'-'+_0x158821+'/'+_0x139a0b)[_0x624d('0x1c')](_0x3ce189);}return null;};}function patchUpdates(_0xd8cb52){return function(_0x508dc6){try{jsonpatch[_0x624d('0x23')](_0x508dc6,_0xd8cb52,!![]);}catch(_0x42a1ab){return BPromise[_0x624d('0x24')](_0x42a1ab);}return _0x508dc6[_0x624d('0x25')]();};}function saveUpdates(_0x36b449,_0x4dc884){return function(_0x15462c){if(_0x15462c){return _0x15462c[_0x624d('0x26')](_0x36b449)[_0x624d('0x27')](function(_0x30b823){return _0x30b823;});}return null;};}function removeEntity(_0x5e06db,_0x456a71){return function(_0x308765){if(_0x308765){return _0x308765[_0x624d('0x28')]()[_0x624d('0x27')](function(){_0x5e06db[_0x624d('0x20')](0xcc)[_0x624d('0x1b')]();});}};}function handleEntityNotFound(_0x434e8e,_0x32ab20){return function(_0x4d3cfa){if(!_0x4d3cfa){_0x434e8e[_0x624d('0x29')](0x194);}return _0x4d3cfa;};}function handleError(_0x2931f0,_0x3a62b0){_0x3a62b0=_0x3a62b0||0x1f4;return function(_0x40bdcc){logger['error'](_0x40bdcc['stack']);if(_0x40bdcc[_0x624d('0x2a')]){delete _0x40bdcc[_0x624d('0x2a')];}_0x2931f0[_0x624d('0x20')](_0x3a62b0)[_0x624d('0x2b')](_0x40bdcc);};}exports[_0x624d('0x2c')]=function(_0x5e545d,_0x2bea8f){var _0x65b0bc={},_0x83826a={},_0xb3a138={'count':0x0,'rows':[]};var _0x225a57=_[_0x624d('0x2d')](db[_0x624d('0x2e')][_0x624d('0x2f')],function(_0x23e615){return{'name':_0x23e615[_0x624d('0x30')],'type':_0x23e615['type'][_0x624d('0x31')]};});_0x83826a[_0x624d('0x32')]=_[_0x624d('0x2d')](_0x225a57,_0x624d('0x2a'));_0x83826a[_0x624d('0x33')]=_[_0x624d('0x34')](_0x5e545d[_0x624d('0x33')]);_0x83826a['filters']=_[_0x624d('0x35')](_0x83826a['model'],_0x83826a[_0x624d('0x33')]);_0x65b0bc['attributes']=_[_0x624d('0x35')](_0x83826a[_0x624d('0x32')],qs[_0x624d('0x36')](_0x5e545d['query'][_0x624d('0x36')]));_0x65b0bc[_0x624d('0x37')]=_0x65b0bc[_0x624d('0x37')][_0x624d('0x38')]?_0x65b0bc[_0x624d('0x37')]:_0x83826a[_0x624d('0x32')];if(!_0x5e545d['query'][_0x624d('0x39')](_0x624d('0x3a'))){_0x65b0bc[_0x624d('0x3b')]=qs['limit'](_0x5e545d[_0x624d('0x33')][_0x624d('0x3b')]);_0x65b0bc[_0x624d('0x1d')]=qs[_0x624d('0x1d')](_0x5e545d['query'][_0x624d('0x1d')]);}_0x65b0bc[_0x624d('0x3c')]=qs['sort'](_0x5e545d['query'][_0x624d('0x3d')]);_0x65b0bc['where']=qs[_0x624d('0x3e')](_[_0x624d('0x3f')](_0x5e545d[_0x624d('0x33')],_0x83826a[_0x624d('0x3e')]),_0x225a57);if(_0x5e545d[_0x624d('0x33')][_0x624d('0x40')]){_0x65b0bc[_0x624d('0x41')]=_['merge'](_0x65b0bc[_0x624d('0x41')],{'$or':_['map'](_0x225a57,function(_0x1560a4){if(_0x1560a4[_0x624d('0x42')]!=='VIRTUAL'){var _0xa9b114={};_0xa9b114[_0x1560a4['name']]={'$like':'%'+_0x5e545d['query'][_0x624d('0x40')]+'%'};return _0xa9b114;}})});}_0x65b0bc=_[_0x624d('0x43')]({},_0x65b0bc,_0x5e545d['options']);var _0x5d91d8={'where':_0x65b0bc['where']};return db[_0x624d('0x2e')][_0x624d('0x1f')](_0x5d91d8)[_0x624d('0x27')](function(_0x5ba3ea){_0xb3a138[_0x624d('0x1f')]=_0x5ba3ea;if(_0x5e545d[_0x624d('0x33')]['includeAll']){_0x65b0bc['include']=[{'all':!![]}];}return db['FreshsalesField'][_0x624d('0x44')](_0x65b0bc);})[_0x624d('0x27')](function(_0x1affea){_0xb3a138[_0x624d('0x45')]=_0x1affea;return _0xb3a138;})[_0x624d('0x27')](respondWithFilteredResult(_0x2bea8f,_0x65b0bc))[_0x624d('0x46')](handleError(_0x2bea8f,null));};exports[_0x624d('0x47')]=function(_0x435ede,_0x45b247){var _0x534a20={'raw':!![],'where':{'id':_0x435ede['params']['id']}},_0x46421f={};_0x46421f[_0x624d('0x32')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x46421f[_0x624d('0x33')]=_[_0x624d('0x34')](_0x435ede[_0x624d('0x33')]);_0x46421f[_0x624d('0x3e')]=_[_0x624d('0x35')](_0x46421f[_0x624d('0x32')],_0x46421f[_0x624d('0x33')]);_0x534a20['attributes']=_[_0x624d('0x35')](_0x46421f[_0x624d('0x32')],qs[_0x624d('0x36')](_0x435ede[_0x624d('0x33')][_0x624d('0x36')]));_0x534a20[_0x624d('0x37')]=_0x534a20[_0x624d('0x37')][_0x624d('0x38')]?_0x534a20['attributes']:_0x46421f[_0x624d('0x32')];if(_0x435ede[_0x624d('0x33')]['includeAll']){_0x534a20[_0x624d('0x48')]=[{'all':!![]}];}_0x534a20=_['merge']({},_0x534a20,_0x435ede[_0x624d('0x49')]);return db[_0x624d('0x2e')][_0x624d('0x4a')](_0x534a20)[_0x624d('0x27')](handleEntityNotFound(_0x45b247,null))[_0x624d('0x27')](respondWithResult(_0x45b247,null))[_0x624d('0x46')](handleError(_0x45b247,null));};exports['create']=function(_0x4745f0,_0x5d2a80){return db[_0x624d('0x2e')][_0x624d('0x4b')](_0x4745f0['body'],{})[_0x624d('0x27')](respondWithResult(_0x5d2a80,0xc9))['catch'](handleError(_0x5d2a80,null));};exports['update']=function(_0x384901,_0x394448){if(_0x384901['body']['id']){delete _0x384901[_0x624d('0x4c')]['id'];}return db[_0x624d('0x2e')][_0x624d('0x4a')]({'where':{'id':_0x384901[_0x624d('0x4d')]['id']}})[_0x624d('0x27')](handleEntityNotFound(_0x394448,null))[_0x624d('0x27')](saveUpdates(_0x384901[_0x624d('0x4c')],null))[_0x624d('0x27')](respondWithResult(_0x394448,null))['catch'](handleError(_0x394448,null));};exports[_0x624d('0x28')]=function(_0x3c09e,_0x18ef7c){return db[_0x624d('0x2e')]['find']({'where':{'id':_0x3c09e[_0x624d('0x4d')]['id']}})[_0x624d('0x27')](handleEntityNotFound(_0x18ef7c,null))['then'](removeEntity(_0x18ef7c,null))[_0x624d('0x46')](handleError(_0x18ef7c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index b59c630..7e82c48 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 _0x6372=['lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','freshsales_unique_index'];(function(_0x4b7e4d,_0x82d2ab){var _0x38d6af=function(_0x227432){while(--_0x227432){_0x4b7e4d['push'](_0x4b7e4d['shift']());}};_0x38d6af(++_0x82d2ab);}(_0x6372,0x1b8));var _0x2637=function(_0x41fcb6,_0x5d6fdc){_0x41fcb6=_0x41fcb6-0x0;var _0x2e55fc=_0x6372[_0x41fcb6];return _0x2e55fc;};'use strict';var _=require(_0x2637('0x0'));var util=require('util');var logger=require(_0x2637('0x1'))('api');var moment=require(_0x2637('0x2'));var BPromise=require(_0x2637('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2637('0x4'));var rimraf=require(_0x2637('0x5'));var config=require(_0x2637('0x6'));var attributes=require(_0x2637('0x7'));module[_0x2637('0x8')]=function(_0x5da891,_0x33d56c){return _0x5da891['define']('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x2637('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa880=['./intFreshsalesField.attributes','define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa880,0x106));var _0x0a88=function(_0x181fba,_0x3e23f4){_0x181fba=_0x181fba-0x0;var _0x509d8d=_0xa880[_0x181fba];return _0x509d8d;};'use strict';var _=require(_0x0a88('0x0'));var util=require(_0x0a88('0x1'));var logger=require(_0x0a88('0x2'))(_0x0a88('0x3'));var moment=require(_0x0a88('0x4'));var BPromise=require(_0x0a88('0x5'));var rp=require(_0x0a88('0x6'));var fs=require('fs');var path=require(_0x0a88('0x7'));var rimraf=require(_0x0a88('0x8'));var config=require(_0x0a88('0x9'));var attributes=require(_0x0a88('0xa'));module['exports']=function(_0x35c530,_0x2aac39){return _0x35c530[_0x0a88('0xb')](_0x0a88('0xc'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x0a88('0xd'),'fields':[_0x0a88('0xe'),_0x0a88('0xf')],'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 4468729..30b4f70 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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x2b2cd0,_0x590e25){var _0x345eb8=function(_0x292f8a){while(--_0x292f8a){_0x2b2cd0['push'](_0x2b2cd0['shift']());}};_0x345eb8(++_0x590e25);}(_0x187d,0x93));var _0xd187=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x187d[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file +var _0x7c09=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x4bdb2e,_0x53ae98){var _0x372646=function(_0x23b355){while(--_0x23b355){_0x4bdb2e['push'](_0x4bdb2e['shift']());}};_0x372646(++_0x53ae98);}(_0x7c09,0x102));var _0x97c0=function(_0xfd6e34,_0x3029ce){_0xfd6e34=_0xfd6e34-0x0;var _0x5a4dbb=_0x7c09[_0xfd6e34];return _0x5a4dbb;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var moment=require(_0x97c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c0('0x2'));var fs=require('fs');var Redis=require(_0x97c0('0x3'));var db=require(_0x97c0('0x4'))['db'];var utils=require(_0x97c0('0x5'));var logger=require(_0x97c0('0x6'))(_0x97c0('0x7'));var config=require(_0x97c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){return client['request'](_0x46fdd9,_0x2c19fa)[_0x97c0('0x9')](function(_0x4ac5f1){logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,'request\x20sent');logger['debug'](_0x97c0('0xc'),_0x42c6c7,_0x97c0('0xd'),JSON[_0x97c0('0xe')](_0x4ac5f1));if(_0x4ac5f1[_0x97c0('0xf')]){if(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x10')]===0x1f4){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x293785(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);}logger[_0x97c0('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x109bc8(_0x4ac5f1[_0x97c0('0xf')]['message']);}else{logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,_0x97c0('0xd'));_0x109bc8(_0x4ac5f1[_0x97c0('0x12')][_0x97c0('0x11')]);}})[_0x97c0('0x13')](function(_0x49c0d9){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x49c0d9);_0x293785(_0x49c0d9);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ad3e527..a4fa217 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1bd6e2,_0x4f378b){var _0x3c789e=function(_0x72912a){while(--_0x72912a){_0x1bd6e2['push'](_0x1bd6e2['shift']());}};_0x3c789e(++_0x4f378b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 _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(_0x3ac20e,_0x531e90){var _0x2a748c=function(_0xbcd504){while(--_0xbcd504){_0x3ac20e['push'](_0x3ac20e['shift']());}};_0x2a748c(++_0x531e90);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 cbd5c01..bebcf7a 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 _0xaac4=['sequelize','exports','STRING','username','integrationTab','newTab'];(function(_0x13f215,_0x55983c){var _0x1524c3=function(_0x5ded3f){while(--_0x5ded3f){_0x13f215['push'](_0x13f215['shift']());}};_0x1524c3(++_0x55983c);}(_0xaac4,0x6c));var _0x4aac=function(_0x1edf2a,_0x55c423){_0x1edf2a=_0x1edf2a-0x0;var _0x5698f0=_0xaac4[_0x1edf2a];return _0x5698f0;};'use strict';var Sequelize=require(_0x4aac('0x0'));module[_0x4aac('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4aac('0x2')]},'username':{'type':Sequelize[_0x4aac('0x2')],'unique':_0x4aac('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4aac('0x2')]},'clientId':{'type':Sequelize[_0x4aac('0x2')]},'clientSecret':{'type':Sequelize[_0x4aac('0x2')]},'securityToken':{'type':Sequelize[_0x4aac('0x2')]},'serverUrl':{'type':Sequelize[_0x4aac('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4aac('0x4'),_0x4aac('0x5')),'defaultValue':_0x4aac('0x4')}}; \ No newline at end of file +var _0x3d3d=['integrationTab','exports','STRING','username','ENUM'];(function(_0x3c91e7,_0x17fea6){var _0x381e47=function(_0x225026){while(--_0x225026){_0x3c91e7['push'](_0x3c91e7['shift']());}};_0x381e47(++_0x17fea6);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd3d3('0x0')]={'name':{'type':Sequelize[_0xd3d3('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd3d3('0x1')],'unique':_0xd3d3('0x2')},'remoteUri':{'type':Sequelize[_0xd3d3('0x1')]},'password':{'type':Sequelize[_0xd3d3('0x1')]},'clientId':{'type':Sequelize[_0xd3d3('0x1')]},'clientSecret':{'type':Sequelize[_0xd3d3('0x1')]},'securityToken':{'type':Sequelize[_0xd3d3('0x1')]},'serverUrl':{'type':Sequelize[_0xd3d3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd3d3('0x3')](_0xd3d3('0x4'),'newTab'),'defaultValue':_0xd3d3('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 40d99b4..790350a 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 _0xbe2b=['SalesforceAccount','count','include','findAll','rows','params','filters','intersection','includeAll','find','catch','create','body','update','getConfigurations','SalesforceConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','phone','remove','includes','label','custom','picklistValues','True','False','statusCode','stringify','test','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','map','query','keys','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbe2b,0xb6));var _0xbbe2=function(_0x40d1a5,_0x13ea0f){_0x40d1a5=_0x40d1a5-0x0;var _0x284cd5=_0xbe2b[_0x40d1a5];return _0x284cd5;};'use strict';var emlformat=require(_0xbbe2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbbe2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbe2('0x2'));var moment=require(_0xbbe2('0x3'));var BPromise=require(_0xbbe2('0x4'));var Mustache=require('mustache');var util=require(_0xbbe2('0x5'));var path=require(_0xbbe2('0x6'));var sox=require('sox');var csv=require(_0xbbe2('0x7'));var ejs=require(_0xbbe2('0x8'));var fs=require('fs');var fs_extra=require(_0xbbe2('0x9'));var _=require('lodash');var squel=require(_0xbbe2('0xa'));var crypto=require(_0xbbe2('0xb'));var jsforce=require(_0xbbe2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbbe2('0x7'));var querystring=require(_0xbbe2('0xd'));var Papa=require(_0xbbe2('0xe'));var Redis=require(_0xbbe2('0xf'));var authService=require(_0xbbe2('0x10'));var qs=require(_0xbbe2('0x11'));var as=require(_0xbbe2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbbe2('0x13'));var utils=require('../../config/utils');var config=require(_0xbbe2('0x14'));var licenseUtil=require(_0xbbe2('0x15'));var db=require(_0xbbe2('0x16'))['db'];var integrations=require(_0xbbe2('0x17'));function respondWithStatusCode(_0x4d5291,_0x56e345){_0x56e345=_0x56e345||0xcc;return function(_0x2df0c2){if(_0x2df0c2){return _0x4d5291[_0xbbe2('0x18')](_0x56e345);}return _0x4d5291[_0xbbe2('0x19')](_0x56e345)[_0xbbe2('0x1a')]();};}function respondWithResult(_0x14cfaf,_0x205ac5){_0x205ac5=_0x205ac5||0xc8;return function(_0x1d99c0){if(_0x1d99c0){return _0x14cfaf[_0xbbe2('0x19')](_0x205ac5)[_0xbbe2('0x1b')](_0x1d99c0);}};}function respondWithFilteredResult(_0x5e8927,_0x58532c){return function(_0x40fe5d){if(_0x40fe5d){var _0x402792=typeof _0x58532c[_0xbbe2('0x1c')]===_0xbbe2('0x1d')&&typeof _0x58532c[_0xbbe2('0x1e')]===_0xbbe2('0x1d');var _0x58173d=_0x40fe5d['count'];var _0x27b81f=_0x402792?0x0:_0x58532c[_0xbbe2('0x1c')];var _0x2e753a=_0x402792?_0x40fe5d['count']:_0x58532c[_0xbbe2('0x1c')]+_0x58532c['limit'];var _0x56fafb;if(_0x2e753a>=_0x58173d){_0x2e753a=_0x58173d;_0x56fafb=0xc8;}else{_0x56fafb=0xce;}_0x5e8927['status'](_0x56fafb);return _0x5e8927[_0xbbe2('0x1f')](_0xbbe2('0x20'),_0x27b81f+'-'+_0x2e753a+'/'+_0x58173d)[_0xbbe2('0x1b')](_0x40fe5d);}return null;};}function patchUpdates(_0x3ac102){return function(_0x1b92db){try{jsonpatch[_0xbbe2('0x21')](_0x1b92db,_0x3ac102,!![]);}catch(_0x1c3129){return BPromise['reject'](_0x1c3129);}return _0x1b92db[_0xbbe2('0x22')]();};}function saveUpdates(_0x110f6e,_0x135df3){return function(_0x7462d1){if(_0x7462d1){return _0x7462d1['update'](_0x110f6e)[_0xbbe2('0x23')](function(_0x2ae843){return _0x2ae843;});}return null;};}function removeEntity(_0x5babfc,_0x24739d){return function(_0x5b385b){if(_0x5b385b){return _0x5b385b[_0xbbe2('0x24')]()[_0xbbe2('0x23')](function(){_0x5babfc[_0xbbe2('0x19')](0xcc)[_0xbbe2('0x1a')]();});}};}function handleEntityNotFound(_0x3cc446,_0x53a54b){return function(_0x19f297){if(!_0x19f297){_0x3cc446[_0xbbe2('0x18')](0x194);}return _0x19f297;};}function handleError(_0x2d240d,_0x5f0338){_0x5f0338=_0x5f0338||0x1f4;return function(_0x14fd4d){logger[_0xbbe2('0x25')](_0x14fd4d[_0xbbe2('0x26')]);if(_0x14fd4d[_0xbbe2('0x27')]){delete _0x14fd4d[_0xbbe2('0x27')];}_0x2d240d['status'](_0x5f0338)[_0xbbe2('0x28')](_0x14fd4d);};}exports[_0xbbe2('0x29')]=function(_0x4f97e4,_0x5e081f){var _0x58a014={},_0x397395={},_0x41c359={'count':0x0,'rows':[]};var _0x5da649=_['map'](db['SalesforceAccount'][_0xbbe2('0x2a')],function(_0x13a1af){return{'name':_0x13a1af[_0xbbe2('0x2b')],'type':_0x13a1af['type']['key']};});_0x397395['model']=_[_0xbbe2('0x2c')](_0x5da649,_0xbbe2('0x27'));_0x397395[_0xbbe2('0x2d')]=_[_0xbbe2('0x2e')](_0x4f97e4[_0xbbe2('0x2d')]);_0x397395['filters']=_['intersection'](_0x397395[_0xbbe2('0x2f')],_0x397395['query']);_0x58a014[_0xbbe2('0x30')]=_['intersection'](_0x397395[_0xbbe2('0x2f')],qs[_0xbbe2('0x31')](_0x4f97e4['query'][_0xbbe2('0x31')]));_0x58a014['attributes']=_0x58a014['attributes'][_0xbbe2('0x32')]?_0x58a014[_0xbbe2('0x30')]:_0x397395[_0xbbe2('0x2f')];if(!_0x4f97e4[_0xbbe2('0x2d')]['hasOwnProperty'](_0xbbe2('0x33'))){_0x58a014[_0xbbe2('0x1e')]=qs[_0xbbe2('0x1e')](_0x4f97e4['query'][_0xbbe2('0x1e')]);_0x58a014[_0xbbe2('0x1c')]=qs[_0xbbe2('0x1c')](_0x4f97e4[_0xbbe2('0x2d')][_0xbbe2('0x1c')]);}_0x58a014[_0xbbe2('0x34')]=qs[_0xbbe2('0x35')](_0x4f97e4[_0xbbe2('0x2d')][_0xbbe2('0x35')]);_0x58a014[_0xbbe2('0x36')]=qs['filters'](_[_0xbbe2('0x37')](_0x4f97e4[_0xbbe2('0x2d')],_0x397395['filters']),_0x5da649);if(_0x4f97e4[_0xbbe2('0x2d')][_0xbbe2('0x38')]){_0x58a014[_0xbbe2('0x36')]=_[_0xbbe2('0x39')](_0x58a014[_0xbbe2('0x36')],{'$or':_[_0xbbe2('0x2c')](_0x5da649,function(_0x3c01c5){if(_0x3c01c5['type']!==_0xbbe2('0x3a')){var _0x36dbab={};_0x36dbab[_0x3c01c5[_0xbbe2('0x27')]]={'$like':'%'+_0x4f97e4['query'][_0xbbe2('0x38')]+'%'};return _0x36dbab;}})});}_0x58a014=_[_0xbbe2('0x39')]({},_0x58a014,_0x4f97e4[_0xbbe2('0x3b')]);var _0x286b3a={'where':_0x58a014[_0xbbe2('0x36')]};return db[_0xbbe2('0x3c')][_0xbbe2('0x3d')](_0x286b3a)[_0xbbe2('0x23')](function(_0x301c99){_0x41c359['count']=_0x301c99;if(_0x4f97e4[_0xbbe2('0x2d')]['includeAll']){_0x58a014[_0xbbe2('0x3e')]=[{'all':!![]}];}return db[_0xbbe2('0x3c')][_0xbbe2('0x3f')](_0x58a014);})['then'](function(_0x1379ca){_0x41c359[_0xbbe2('0x40')]=_0x1379ca;return _0x41c359;})[_0xbbe2('0x23')](respondWithFilteredResult(_0x5e081f,_0x58a014))['catch'](handleError(_0x5e081f,null));};exports['show']=function(_0x3916ea,_0x3be2a6){var _0x25fb86={'raw':![],'where':{'id':_0x3916ea[_0xbbe2('0x41')]['id']}},_0x2344e2={};_0x2344e2[_0xbbe2('0x2f')]=_[_0xbbe2('0x2e')](db['SalesforceAccount'][_0xbbe2('0x2a')]);_0x2344e2[_0xbbe2('0x2d')]=_['keys'](_0x3916ea[_0xbbe2('0x2d')]);_0x2344e2[_0xbbe2('0x42')]=_[_0xbbe2('0x43')](_0x2344e2['model'],_0x2344e2[_0xbbe2('0x2d')]);_0x25fb86['attributes']=_[_0xbbe2('0x43')](_0x2344e2['model'],qs[_0xbbe2('0x31')](_0x3916ea[_0xbbe2('0x2d')][_0xbbe2('0x31')]));_0x25fb86['attributes']=_0x25fb86[_0xbbe2('0x30')][_0xbbe2('0x32')]?_0x25fb86[_0xbbe2('0x30')]:_0x2344e2[_0xbbe2('0x2f')];if(_0x3916ea[_0xbbe2('0x2d')][_0xbbe2('0x44')]){_0x25fb86[_0xbbe2('0x3e')]=[{'all':!![]}];}_0x25fb86=_['merge']({},_0x25fb86,_0x3916ea['options']);return db[_0xbbe2('0x3c')][_0xbbe2('0x45')](_0x25fb86)['then'](handleEntityNotFound(_0x3be2a6,null))[_0xbbe2('0x23')](respondWithResult(_0x3be2a6,null))[_0xbbe2('0x46')](handleError(_0x3be2a6,null));};exports[_0xbbe2('0x47')]=function(_0x2bdd59,_0x204e30){return db[_0xbbe2('0x3c')][_0xbbe2('0x47')](_0x2bdd59[_0xbbe2('0x48')],{})['then'](respondWithResult(_0x204e30,0xc9))[_0xbbe2('0x46')](handleError(_0x204e30,null));};exports[_0xbbe2('0x49')]=function(_0x195b11,_0x1568e){if(_0x195b11[_0xbbe2('0x48')]['id']){delete _0x195b11[_0xbbe2('0x48')]['id'];}return db[_0xbbe2('0x3c')]['find']({'where':{'id':_0x195b11[_0xbbe2('0x41')]['id']}})[_0xbbe2('0x23')](handleEntityNotFound(_0x1568e,null))['then'](saveUpdates(_0x195b11[_0xbbe2('0x48')],null))[_0xbbe2('0x23')](respondWithResult(_0x1568e,null))[_0xbbe2('0x46')](handleError(_0x1568e,null));};exports[_0xbbe2('0x24')]=function(_0x4c27ea,_0x558e19){return db[_0xbbe2('0x3c')][_0xbbe2('0x45')]({'where':{'id':_0x4c27ea['params']['id']}})[_0xbbe2('0x23')](handleEntityNotFound(_0x558e19,null))[_0xbbe2('0x23')](removeEntity(_0x558e19,null))['catch'](handleError(_0x558e19,null));};exports[_0xbbe2('0x4a')]=function(_0xfaac9c,_0x234ec4,_0x5311b3){var _0x2d40cb={};var _0x409802={};var _0x398471;var _0x24dc28;return db[_0xbbe2('0x3c')]['findOne']({'where':{'id':_0xfaac9c[_0xbbe2('0x41')]['id']}})[_0xbbe2('0x23')](handleEntityNotFound(_0x234ec4,null))[_0xbbe2('0x23')](function(_0x934bb2){if(_0x934bb2){_0x398471=_0x934bb2;_0x409802[_0xbbe2('0x2f')]=_[_0xbbe2('0x2e')](db[_0xbbe2('0x4b')][_0xbbe2('0x2a')]);_0x409802[_0xbbe2('0x2d')]=_[_0xbbe2('0x2e')](_0xfaac9c[_0xbbe2('0x2d')]);_0x409802[_0xbbe2('0x42')]=_[_0xbbe2('0x43')](_0x409802[_0xbbe2('0x2f')],_0x409802[_0xbbe2('0x2d')]);_0x2d40cb[_0xbbe2('0x30')]=_['intersection'](_0x409802[_0xbbe2('0x2f')],qs[_0xbbe2('0x31')](_0xfaac9c[_0xbbe2('0x2d')][_0xbbe2('0x31')]));_0x2d40cb[_0xbbe2('0x30')]=_0x2d40cb[_0xbbe2('0x30')]['length']?_0x2d40cb[_0xbbe2('0x30')]:_0x409802[_0xbbe2('0x2f')];_0x2d40cb[_0xbbe2('0x34')]=qs[_0xbbe2('0x35')](_0xfaac9c['query'][_0xbbe2('0x35')]);_0x2d40cb['where']=qs[_0xbbe2('0x42')](_[_0xbbe2('0x37')](_0xfaac9c[_0xbbe2('0x2d')],_0x409802['filters']));if(_0xfaac9c[_0xbbe2('0x2d')][_0xbbe2('0x38')]){_0x2d40cb['where']=_['merge'](_0x2d40cb[_0xbbe2('0x36')],{'$or':_[_0xbbe2('0x2c')](_0x2d40cb[_0xbbe2('0x30')],function(_0x574bb5){var _0x4c6d6f={};_0x4c6d6f[_0x574bb5]={'$like':'%'+_0xfaac9c[_0xbbe2('0x2d')][_0xbbe2('0x38')]+'%'};return _0x4c6d6f;})});}_0x2d40cb=_[_0xbbe2('0x39')]({},_0x2d40cb,_0xfaac9c[_0xbbe2('0x3b')]);return _0x398471[_0xbbe2('0x4a')](_0x2d40cb);}})[_0xbbe2('0x23')](function(_0x75f991){if(_0x75f991){_0x24dc28=_0x75f991[_0xbbe2('0x32')];if(!_0xfaac9c['query'][_0xbbe2('0x4c')](_0xbbe2('0x33'))){_0x2d40cb[_0xbbe2('0x1e')]=qs['limit'](_0xfaac9c[_0xbbe2('0x2d')]['limit']);_0x2d40cb['offset']=qs['offset'](_0xfaac9c[_0xbbe2('0x2d')][_0xbbe2('0x1c')]);}return _0x398471['getConfigurations'](_0x2d40cb);}})[_0xbbe2('0x23')](function(_0x2e037e){if(_0x2e037e){return _0x2e037e?{'count':_0x24dc28,'rows':_0x2e037e}:null;}})[_0xbbe2('0x23')](respondWithResult(_0x234ec4,null))['catch'](handleError(_0x234ec4,null));};exports[_0xbbe2('0x4d')]=function(_0xaef2c5,_0x257e7a,_0x214d21){if(_0xaef2c5['body']['id']){delete _0xaef2c5['body']['id'];}return db[_0xbbe2('0x3c')]['findOne']({'where':{'id':_0xaef2c5['params']['id']}})[_0xbbe2('0x23')](handleEntityNotFound(_0x257e7a,null))[_0xbbe2('0x23')](function(_0x3ad240){if(_0x3ad240){_0xaef2c5[_0xbbe2('0x48')]['AccountId']=_0x3ad240['id'];_0xaef2c5[_0xbbe2('0x48')][_0xbbe2('0x4e')]=integrations[_0xbbe2('0x4f')](_0xaef2c5[_0xbbe2('0x48')][_0xbbe2('0x50')],_0xaef2c5[_0xbbe2('0x48')][_0xbbe2('0x51')]);_0xaef2c5[_0xbbe2('0x48')][_0xbbe2('0x52')]=integrations[_0xbbe2('0x53')](_0xaef2c5[_0xbbe2('0x48')][_0xbbe2('0x50')],_0xaef2c5[_0xbbe2('0x48')][_0xbbe2('0x51')]);return db[_0xbbe2('0x4b')]['create'](_0xaef2c5[_0xbbe2('0x48')],{'include':[{'model':db[_0xbbe2('0x54')],'as':_0xbbe2('0x4e')},{'model':db[_0xbbe2('0x54')],'as':_0xbbe2('0x52')}]});}return null;})[_0xbbe2('0x23')](respondWithResult(_0x257e7a,null))['catch'](handleError(_0x257e7a,null));};exports[_0xbbe2('0x55')]=function(_0x4c2176,_0x56ca24,_0x2adb55){var _0x8d2887;var _0x3202e3='';var _0x2adf87='Task';return db[_0xbbe2('0x3c')]['findOne']({'where':{'id':_0x4c2176[_0xbbe2('0x41')]['id']},'attributes':['id',_0xbbe2('0x56'),_0xbbe2('0x57'),_0xbbe2('0x58'),_0xbbe2('0x59'),_0xbbe2('0x5a'),_0xbbe2('0x5b')]})['then'](handleEntityNotFound(_0x56ca24,null))[_0xbbe2('0x23')](function(_0x5d8e2f){if(_0x5d8e2f){_0x3202e3=_0x5d8e2f[_0xbbe2('0x56')];var _0x4c77af=_0x3202e3[_0xbbe2('0x5c')](-0x1);if(_0x4c77af==='/'){_0x3202e3=_0x3202e3[_0xbbe2('0x5d')](0x0,_0x3202e3['lastIndexOf'](_0x4c77af));}_0x8d2887=new jsforce[(_0xbbe2('0x5e'))]({'oauth2':{'loginUrl':_0x3202e3,'clientId':_0x5d8e2f[_0xbbe2('0x57')],'clientSecret':_0x5d8e2f[_0xbbe2('0x58')]}});return _0x8d2887['login'](_0x5d8e2f[_0xbbe2('0x59')],_0x5d8e2f[_0xbbe2('0x5a')][_0xbbe2('0x5f')](_0x5d8e2f[_0xbbe2('0x5b')]));}})[_0xbbe2('0x23')](function(_0x234726){if(_0x234726){if(!_[_0xbbe2('0x60')](_0x4c2176[_0xbbe2('0x2d')]['ticketType'])){_0x2adf87=_0x4c2176['query'][_0xbbe2('0x61')];}return _0x8d2887[_0xbbe2('0x62')](_0x2adf87)['describe']();}})[_0xbbe2('0x23')](function(_0x12f705){var _0x31794e=[_0xbbe2('0x63'),_0xbbe2('0x64'),_0xbbe2('0x65'),_0xbbe2('0x66'),_0xbbe2('0x67'),_0xbbe2('0x68')];var _0x25b428=[_0xbbe2('0x69'),_0xbbe2('0x6a'),_0xbbe2('0x6b'),_0xbbe2('0x6c'),'email','textarea',_0xbbe2('0x6d')];if(_0x12f705){_[_0xbbe2('0x6e')](_0x12f705['fields'],function(_0x3ff44e){return _0x31794e['includes'](_0x3ff44e[_0xbbe2('0x27')])||!_0x25b428[_0xbbe2('0x6f')](_0x3ff44e[_0xbbe2('0x51')]);});return{'count':_0x12f705[_0xbbe2('0x31')][_0xbbe2('0x32')],'rows':_[_0xbbe2('0x2c')](_0x12f705[_0xbbe2('0x31')],function(_0x40bd17){return{'id':_0x40bd17[_0xbbe2('0x27')],'name':_0x40bd17[_0xbbe2('0x70')],'custom':_0x40bd17[_0xbbe2('0x71')],'options':_0x40bd17[_0xbbe2('0x72')][_0xbbe2('0x32')]>0x0?_[_0xbbe2('0x2c')](_0x40bd17['picklistValues'],function(_0x55c6e5){return{'name':_0x55c6e5[_0xbbe2('0x70')],'value':_0x55c6e5['value']};}):_0x40bd17[_0xbbe2('0x51')]=='boolean'?[{'name':_0xbbe2('0x73'),'value':'true'},{'name':_0xbbe2('0x74'),'value':'false'}]:[]};})};}})[_0xbbe2('0x23')](respondWithResult(_0x56ca24,null))[_0xbbe2('0x46')](function(_0x33bdf7){var _0x4bf13f=_0x4c2176[_0xbbe2('0x2d')]['test']?0x1f4:_0x33bdf7[_0xbbe2('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xbbe2('0x55'),_0x4bf13f,JSON[_0xbbe2('0x76')](_0x33bdf7));delete _0x33bdf7[_0xbbe2('0x27')];if(_0x4bf13f===0x191){_0x4bf13f=0x190;}_0x56ca24[_0xbbe2('0x19')](_0x4bf13f)['send'](_0x4c2176['query'][_0xbbe2('0x77')]?{'message':_0xbbe2('0x78'),'statusCode':_0x33bdf7['statusCode']}:_0x33bdf7);});}; \ No newline at end of file +var _0x1414=['statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','then','end','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','params','rawAttributes','fields','length','includeAll','find','create','body','update','destroy','SalesforceConfiguration','order','getConfigurations','findOne','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceField','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','Connection','login','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','picklist','boolean','textarea','phone','remove','label','picklistValues','value','True','true','False','false','test'];(function(_0x1d0c1a,_0x3209d2){var _0x4bee7b=function(_0x14910b){while(--_0x14910b){_0x1d0c1a['push'](_0x1d0c1a['shift']());}};_0x4bee7b(++_0x3209d2);}(_0x1414,0xf4));var _0x4141=function(_0x225b82,_0x2442a7){_0x225b82=_0x225b82-0x0;var _0x5e2def=_0x1414[_0x225b82];return _0x5e2def;};'use strict';var emlformat=require(_0x4141('0x0'));var rimraf=require(_0x4141('0x1'));var zipdir=require(_0x4141('0x2'));var jsonpatch=require(_0x4141('0x3'));var rp=require('request-promise');var moment=require(_0x4141('0x4'));var BPromise=require(_0x4141('0x5'));var Mustache=require('mustache');var util=require(_0x4141('0x6'));var path=require(_0x4141('0x7'));var sox=require('sox');var csv=require(_0x4141('0x8'));var ejs=require(_0x4141('0x9'));var fs=require('fs');var fs_extra=require(_0x4141('0xa'));var _=require(_0x4141('0xb'));var squel=require(_0x4141('0xc'));var crypto=require(_0x4141('0xd'));var jsforce=require(_0x4141('0xe'));var deskjs=require(_0x4141('0xf'));var toCsv=require(_0x4141('0x8'));var querystring=require('querystring');var Papa=require(_0x4141('0x10'));var Redis=require(_0x4141('0x11'));var authService=require(_0x4141('0x12'));var qs=require(_0x4141('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4141('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4141('0x15'));var licenseUtil=require(_0x4141('0x16'));var db=require(_0x4141('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xc9c1b4,_0x2c66d6){_0x2c66d6=_0x2c66d6||0xcc;return function(_0x50824b){if(_0x50824b){return _0xc9c1b4['sendStatus'](_0x2c66d6);}return _0xc9c1b4['status'](_0x2c66d6)['end']();};}function respondWithResult(_0x592aa8,_0x224ce2){_0x224ce2=_0x224ce2||0xc8;return function(_0x2b6e9e){if(_0x2b6e9e){return _0x592aa8[_0x4141('0x18')](_0x224ce2)['json'](_0x2b6e9e);}};}function respondWithFilteredResult(_0x45aa25,_0x22ee46){return function(_0x3e2a69){if(_0x3e2a69){var _0x27985e=typeof _0x22ee46[_0x4141('0x19')]==='undefined'&&typeof _0x22ee46[_0x4141('0x1a')]===_0x4141('0x1b');var _0x12f1c6=_0x3e2a69[_0x4141('0x1c')];var _0x5f7868=_0x27985e?0x0:_0x22ee46[_0x4141('0x19')];var _0x7ded42=_0x27985e?_0x3e2a69[_0x4141('0x1c')]:_0x22ee46[_0x4141('0x19')]+_0x22ee46[_0x4141('0x1a')];var _0x21cf74;if(_0x7ded42>=_0x12f1c6){_0x7ded42=_0x12f1c6;_0x21cf74=0xc8;}else{_0x21cf74=0xce;}_0x45aa25[_0x4141('0x18')](_0x21cf74);return _0x45aa25[_0x4141('0x1d')](_0x4141('0x1e'),_0x5f7868+'-'+_0x7ded42+'/'+_0x12f1c6)[_0x4141('0x1f')](_0x3e2a69);}return null;};}function patchUpdates(_0x1a9c65){return function(_0x21b0f9){try{jsonpatch['apply'](_0x21b0f9,_0x1a9c65,!![]);}catch(_0x508f52){return BPromise[_0x4141('0x20')](_0x508f52);}return _0x21b0f9[_0x4141('0x21')]();};}function saveUpdates(_0x4c741b,_0xe7ac52){return function(_0x27394a){if(_0x27394a){return _0x27394a['update'](_0x4c741b)[_0x4141('0x22')](function(_0xb6842d){return _0xb6842d;});}return null;};}function removeEntity(_0x1b8a21,_0x4865d0){return function(_0x4ba4b4){if(_0x4ba4b4){return _0x4ba4b4['destroy']()[_0x4141('0x22')](function(){_0x1b8a21[_0x4141('0x18')](0xcc)[_0x4141('0x23')]();});}};}function handleEntityNotFound(_0x289d91,_0xd650d6){return function(_0x37f66a){if(!_0x37f66a){_0x289d91['sendStatus'](0x194);}return _0x37f66a;};}function handleError(_0x121612,_0x47cd23){_0x47cd23=_0x47cd23||0x1f4;return function(_0x131fac){logger[_0x4141('0x24')](_0x131fac[_0x4141('0x25')]);if(_0x131fac[_0x4141('0x26')]){delete _0x131fac['name'];}_0x121612[_0x4141('0x18')](_0x47cd23)[_0x4141('0x27')](_0x131fac);};}exports[_0x4141('0x28')]=function(_0x1925cc,_0x5a00fb){var _0x5a0f52={},_0x19b4b5={},_0x2751b4={'count':0x0,'rows':[]};var _0x4f21ce=_[_0x4141('0x29')](db[_0x4141('0x2a')]['rawAttributes'],function(_0x4734eb){return{'name':_0x4734eb[_0x4141('0x2b')],'type':_0x4734eb[_0x4141('0x2c')][_0x4141('0x2d')]};});_0x19b4b5[_0x4141('0x2e')]=_['map'](_0x4f21ce,_0x4141('0x26'));_0x19b4b5['query']=_[_0x4141('0x2f')](_0x1925cc[_0x4141('0x30')]);_0x19b4b5['filters']=_[_0x4141('0x31')](_0x19b4b5[_0x4141('0x2e')],_0x19b4b5[_0x4141('0x30')]);_0x5a0f52['attributes']=_[_0x4141('0x31')](_0x19b4b5[_0x4141('0x2e')],qs['fields'](_0x1925cc[_0x4141('0x30')]['fields']));_0x5a0f52[_0x4141('0x32')]=_0x5a0f52['attributes']['length']?_0x5a0f52[_0x4141('0x32')]:_0x19b4b5[_0x4141('0x2e')];if(!_0x1925cc[_0x4141('0x30')][_0x4141('0x33')](_0x4141('0x34'))){_0x5a0f52['limit']=qs['limit'](_0x1925cc[_0x4141('0x30')][_0x4141('0x1a')]);_0x5a0f52[_0x4141('0x19')]=qs[_0x4141('0x19')](_0x1925cc[_0x4141('0x30')][_0x4141('0x19')]);}_0x5a0f52['order']=qs[_0x4141('0x35')](_0x1925cc[_0x4141('0x30')]['sort']);_0x5a0f52[_0x4141('0x36')]=qs[_0x4141('0x37')](_[_0x4141('0x38')](_0x1925cc[_0x4141('0x30')],_0x19b4b5[_0x4141('0x37')]),_0x4f21ce);if(_0x1925cc[_0x4141('0x30')][_0x4141('0x39')]){_0x5a0f52['where']=_[_0x4141('0x3a')](_0x5a0f52[_0x4141('0x36')],{'$or':_[_0x4141('0x29')](_0x4f21ce,function(_0x483ceb){if(_0x483ceb['type']!=='VIRTUAL'){var _0x3a17b9={};_0x3a17b9[_0x483ceb[_0x4141('0x26')]]={'$like':'%'+_0x1925cc['query'][_0x4141('0x39')]+'%'};return _0x3a17b9;}})});}_0x5a0f52=_[_0x4141('0x3a')]({},_0x5a0f52,_0x1925cc[_0x4141('0x3b')]);var _0x2b8569={'where':_0x5a0f52[_0x4141('0x36')]};return db[_0x4141('0x2a')][_0x4141('0x1c')](_0x2b8569)['then'](function(_0x317bf8){_0x2751b4[_0x4141('0x1c')]=_0x317bf8;if(_0x1925cc[_0x4141('0x30')]['includeAll']){_0x5a0f52[_0x4141('0x3c')]=[{'all':!![]}];}return db[_0x4141('0x2a')][_0x4141('0x3d')](_0x5a0f52);})[_0x4141('0x22')](function(_0x7ad42a){_0x2751b4[_0x4141('0x3e')]=_0x7ad42a;return _0x2751b4;})[_0x4141('0x22')](respondWithFilteredResult(_0x5a00fb,_0x5a0f52))[_0x4141('0x3f')](handleError(_0x5a00fb,null));};exports['show']=function(_0xb3cff8,_0x15afa7){var _0x47cd4d={'raw':![],'where':{'id':_0xb3cff8[_0x4141('0x40')]['id']}},_0x2fb5c8={};_0x2fb5c8['model']=_['keys'](db[_0x4141('0x2a')][_0x4141('0x41')]);_0x2fb5c8[_0x4141('0x30')]=_[_0x4141('0x2f')](_0xb3cff8[_0x4141('0x30')]);_0x2fb5c8[_0x4141('0x37')]=_[_0x4141('0x31')](_0x2fb5c8['model'],_0x2fb5c8['query']);_0x47cd4d[_0x4141('0x32')]=_[_0x4141('0x31')](_0x2fb5c8[_0x4141('0x2e')],qs[_0x4141('0x42')](_0xb3cff8['query'][_0x4141('0x42')]));_0x47cd4d[_0x4141('0x32')]=_0x47cd4d['attributes'][_0x4141('0x43')]?_0x47cd4d[_0x4141('0x32')]:_0x2fb5c8[_0x4141('0x2e')];if(_0xb3cff8[_0x4141('0x30')][_0x4141('0x44')]){_0x47cd4d['include']=[{'all':!![]}];}_0x47cd4d=_['merge']({},_0x47cd4d,_0xb3cff8[_0x4141('0x3b')]);return db[_0x4141('0x2a')][_0x4141('0x45')](_0x47cd4d)[_0x4141('0x22')](handleEntityNotFound(_0x15afa7,null))[_0x4141('0x22')](respondWithResult(_0x15afa7,null))[_0x4141('0x3f')](handleError(_0x15afa7,null));};exports[_0x4141('0x46')]=function(_0x1febe6,_0x48376b){return db[_0x4141('0x2a')][_0x4141('0x46')](_0x1febe6[_0x4141('0x47')],{})[_0x4141('0x22')](respondWithResult(_0x48376b,0xc9))[_0x4141('0x3f')](handleError(_0x48376b,null));};exports[_0x4141('0x48')]=function(_0x194db9,_0x27c03d){if(_0x194db9['body']['id']){delete _0x194db9[_0x4141('0x47')]['id'];}return db[_0x4141('0x2a')][_0x4141('0x45')]({'where':{'id':_0x194db9[_0x4141('0x40')]['id']}})['then'](handleEntityNotFound(_0x27c03d,null))[_0x4141('0x22')](saveUpdates(_0x194db9[_0x4141('0x47')],null))[_0x4141('0x22')](respondWithResult(_0x27c03d,null))[_0x4141('0x3f')](handleError(_0x27c03d,null));};exports[_0x4141('0x49')]=function(_0x204b2c,_0x34f361){return db[_0x4141('0x2a')][_0x4141('0x45')]({'where':{'id':_0x204b2c['params']['id']}})['then'](handleEntityNotFound(_0x34f361,null))['then'](removeEntity(_0x34f361,null))[_0x4141('0x3f')](handleError(_0x34f361,null));};exports['getConfigurations']=function(_0x4ce93d,_0x363e14,_0x360c85){var _0x4834e7={};var _0x47fcbc={};var _0x1da366;var _0x4a7936;return db[_0x4141('0x2a')]['findOne']({'where':{'id':_0x4ce93d[_0x4141('0x40')]['id']}})[_0x4141('0x22')](handleEntityNotFound(_0x363e14,null))[_0x4141('0x22')](function(_0x10b72e){if(_0x10b72e){_0x1da366=_0x10b72e;_0x47fcbc['model']=_[_0x4141('0x2f')](db[_0x4141('0x4a')][_0x4141('0x41')]);_0x47fcbc[_0x4141('0x30')]=_[_0x4141('0x2f')](_0x4ce93d[_0x4141('0x30')]);_0x47fcbc[_0x4141('0x37')]=_[_0x4141('0x31')](_0x47fcbc[_0x4141('0x2e')],_0x47fcbc['query']);_0x4834e7[_0x4141('0x32')]=_[_0x4141('0x31')](_0x47fcbc[_0x4141('0x2e')],qs[_0x4141('0x42')](_0x4ce93d[_0x4141('0x30')][_0x4141('0x42')]));_0x4834e7['attributes']=_0x4834e7['attributes'][_0x4141('0x43')]?_0x4834e7[_0x4141('0x32')]:_0x47fcbc[_0x4141('0x2e')];_0x4834e7[_0x4141('0x4b')]=qs[_0x4141('0x35')](_0x4ce93d[_0x4141('0x30')]['sort']);_0x4834e7[_0x4141('0x36')]=qs['filters'](_[_0x4141('0x38')](_0x4ce93d[_0x4141('0x30')],_0x47fcbc[_0x4141('0x37')]));if(_0x4ce93d[_0x4141('0x30')][_0x4141('0x39')]){_0x4834e7[_0x4141('0x36')]=_[_0x4141('0x3a')](_0x4834e7[_0x4141('0x36')],{'$or':_[_0x4141('0x29')](_0x4834e7[_0x4141('0x32')],function(_0x14cb3c){var _0x4b0b9b={};_0x4b0b9b[_0x14cb3c]={'$like':'%'+_0x4ce93d[_0x4141('0x30')][_0x4141('0x39')]+'%'};return _0x4b0b9b;})});}_0x4834e7=_[_0x4141('0x3a')]({},_0x4834e7,_0x4ce93d[_0x4141('0x3b')]);return _0x1da366[_0x4141('0x4c')](_0x4834e7);}})['then'](function(_0x5eccc8){if(_0x5eccc8){_0x4a7936=_0x5eccc8[_0x4141('0x43')];if(!_0x4ce93d[_0x4141('0x30')][_0x4141('0x33')](_0x4141('0x34'))){_0x4834e7['limit']=qs[_0x4141('0x1a')](_0x4ce93d['query'][_0x4141('0x1a')]);_0x4834e7[_0x4141('0x19')]=qs[_0x4141('0x19')](_0x4ce93d[_0x4141('0x30')][_0x4141('0x19')]);}return _0x1da366[_0x4141('0x4c')](_0x4834e7);}})[_0x4141('0x22')](function(_0x362d4e){if(_0x362d4e){return _0x362d4e?{'count':_0x4a7936,'rows':_0x362d4e}:null;}})[_0x4141('0x22')](respondWithResult(_0x363e14,null))[_0x4141('0x3f')](handleError(_0x363e14,null));};exports['addConfiguration']=function(_0x10055c,_0x85d624,_0x4ee543){if(_0x10055c[_0x4141('0x47')]['id']){delete _0x10055c['body']['id'];}return db[_0x4141('0x2a')][_0x4141('0x4d')]({'where':{'id':_0x10055c['params']['id']}})[_0x4141('0x22')](handleEntityNotFound(_0x85d624,null))[_0x4141('0x22')](function(_0x2c3351){if(_0x2c3351){_0x10055c[_0x4141('0x47')]['AccountId']=_0x2c3351['id'];_0x10055c[_0x4141('0x47')][_0x4141('0x4e')]=integrations[_0x4141('0x4f')](_0x10055c[_0x4141('0x47')]['channel'],_0x10055c[_0x4141('0x47')]['type']);_0x10055c[_0x4141('0x47')][_0x4141('0x50')]=integrations[_0x4141('0x51')](_0x10055c['body']['channel'],_0x10055c[_0x4141('0x47')][_0x4141('0x2c')]);return db['SalesforceConfiguration'][_0x4141('0x46')](_0x10055c['body'],{'include':[{'model':db[_0x4141('0x52')],'as':_0x4141('0x4e')},{'model':db[_0x4141('0x52')],'as':_0x4141('0x50')}]});}return null;})['then'](respondWithResult(_0x85d624,null))[_0x4141('0x3f')](handleError(_0x85d624,null));};exports['getFields']=function(_0x44dd04,_0x43bb76,_0x3cc7bd){var _0x3ccf2d;var _0x2e15bf='';var _0x124d93='Task';return db[_0x4141('0x2a')]['findOne']({'where':{'id':_0x44dd04['params']['id']},'attributes':['id',_0x4141('0x53'),_0x4141('0x54'),_0x4141('0x55'),_0x4141('0x56'),_0x4141('0x57'),_0x4141('0x58')]})[_0x4141('0x22')](handleEntityNotFound(_0x43bb76,null))[_0x4141('0x22')](function(_0x59ec54){if(_0x59ec54){_0x2e15bf=_0x59ec54[_0x4141('0x53')];var _0x3ad53d=_0x2e15bf['slice'](-0x1);if(_0x3ad53d==='/'){_0x2e15bf=_0x2e15bf[_0x4141('0x59')](0x0,_0x2e15bf[_0x4141('0x5a')](_0x3ad53d));}_0x3ccf2d=new jsforce[(_0x4141('0x5b'))]({'oauth2':{'loginUrl':_0x2e15bf,'clientId':_0x59ec54[_0x4141('0x54')],'clientSecret':_0x59ec54[_0x4141('0x55')]}});return _0x3ccf2d[_0x4141('0x5c')](_0x59ec54[_0x4141('0x56')],_0x59ec54[_0x4141('0x57')][_0x4141('0x5d')](_0x59ec54[_0x4141('0x58')]));}})[_0x4141('0x22')](function(_0x2224f8){if(_0x2224f8){if(!_['isNil'](_0x44dd04[_0x4141('0x30')]['ticketType'])){_0x124d93=_0x44dd04[_0x4141('0x30')][_0x4141('0x5e')];}return _0x3ccf2d[_0x4141('0x5f')](_0x124d93)[_0x4141('0x60')]();}})[_0x4141('0x22')](function(_0x314dda){var _0x341923=[_0x4141('0x61'),_0x4141('0x62'),_0x4141('0x63'),_0x4141('0x64'),_0x4141('0x65'),_0x4141('0x66')];var _0x58eda7=['string','int',_0x4141('0x67'),_0x4141('0x68'),'email',_0x4141('0x69'),_0x4141('0x6a')];if(_0x314dda){_[_0x4141('0x6b')](_0x314dda[_0x4141('0x42')],function(_0x65a7c2){return _0x341923['includes'](_0x65a7c2['name'])||!_0x58eda7['includes'](_0x65a7c2['type']);});return{'count':_0x314dda[_0x4141('0x42')][_0x4141('0x43')],'rows':_[_0x4141('0x29')](_0x314dda[_0x4141('0x42')],function(_0x23f28d){return{'id':_0x23f28d[_0x4141('0x26')],'name':_0x23f28d[_0x4141('0x6c')],'custom':_0x23f28d['custom'],'options':_0x23f28d[_0x4141('0x6d')]['length']>0x0?_[_0x4141('0x29')](_0x23f28d[_0x4141('0x6d')],function(_0x4b5dc1){return{'name':_0x4b5dc1[_0x4141('0x6c')],'value':_0x4b5dc1[_0x4141('0x6e')]};}):_0x23f28d[_0x4141('0x2c')]=='boolean'?[{'name':_0x4141('0x6f'),'value':_0x4141('0x70')},{'name':_0x4141('0x71'),'value':_0x4141('0x72')}]:[]};})};}})[_0x4141('0x22')](respondWithResult(_0x43bb76,null))[_0x4141('0x3f')](function(_0x10983e){var _0x42f857=_0x44dd04[_0x4141('0x30')][_0x4141('0x73')]?0x1f4:_0x10983e[_0x4141('0x74')]||0x1f4;logger['error'](_0x4141('0x75'),_0x4141('0x76'),_0x42f857,JSON['stringify'](_0x10983e));delete _0x10983e[_0x4141('0x26')];if(_0x42f857===0x191){_0x42f857=0x190;}_0x43bb76[_0x4141('0x18')](_0x42f857)[_0x4141('0x27')](_0x44dd04[_0x4141('0x30')][_0x4141('0x73')]?{'message':_0x4141('0x77'),'statusCode':_0x10983e[_0x4141('0x74')]}:_0x10983e);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index c13db78..b87ec42 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 _0xa142=['int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount'];(function(_0x36ae06,_0x57da2d){var _0x25ffc7=function(_0x38be3a){while(--_0x38be3a){_0x36ae06['push'](_0x36ae06['shift']());}};_0x25ffc7(++_0x57da2d);}(_0xa142,0x1eb));var _0x2a14=function(_0x47cc41,_0x11e552){_0x47cc41=_0x47cc41-0x0;var _0x580c72=_0xa142[_0x47cc41];return _0x580c72;};'use strict';var _=require('lodash');var util=require(_0x2a14('0x0'));var logger=require(_0x2a14('0x1'))(_0x2a14('0x2'));var moment=require(_0x2a14('0x3'));var BPromise=require(_0x2a14('0x4'));var rp=require(_0x2a14('0x5'));var fs=require('fs');var path=require(_0x2a14('0x6'));var rimraf=require(_0x2a14('0x7'));var config=require(_0x2a14('0x8'));var attributes=require(_0x2a14('0x9'));var integrations=require(_0x2a14('0xa'));module['exports']=function(_0x56affe,_0x46a080){return _0x56affe[_0x2a14('0xb')](_0x2a14('0xc'),attributes,{'tableName':_0x2a14('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa74e=['moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','int_salesforce_accounts','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa74e,0x8d));var _0xea74=function(_0x4eec9d,_0xb53313){_0x4eec9d=_0x4eec9d-0x0;var _0x2c261b=_0xa74e[_0x4eec9d];return _0x2c261b;};'use strict';var _=require(_0xea74('0x0'));var util=require(_0xea74('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xea74('0x2'));var BPromise=require(_0xea74('0x3'));var rp=require(_0xea74('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea74('0x5'));var config=require(_0xea74('0x6'));var attributes=require(_0xea74('0x7'));var integrations=require(_0xea74('0x8'));module['exports']=function(_0x405221,_0x2295a7){return _0x405221[_0xea74('0x9')]('SalesforceAccount',attributes,{'tableName':_0xea74('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 a00c356..a4f3183 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 _0x5951=['limit','map','include','model','ShowSalesforceAccount','SalesforceAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','attributes'];(function(_0x2b8206,_0x471abc){var _0x407970=function(_0x2b640f){while(--_0x2b640f){_0x2b8206['push'](_0x2b8206['shift']());}};_0x407970(++_0x471abc);}(_0x5951,0x17d));var _0x1595=function(_0x4fe01d,_0x413f6e){_0x4fe01d=_0x4fe01d-0x0;var _0x5b565a=_0x5951[_0x4fe01d];return _0x5b565a;};'use strict';var _=require(_0x1595('0x0'));var util=require(_0x1595('0x1'));var moment=require(_0x1595('0x2'));var BPromise=require(_0x1595('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1595('0x4'));var db=require(_0x1595('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1595('0x6'))(_0x1595('0x7'));var config=require(_0x1595('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24c4d3,_0x4e774c,_0x2612b1){return new BPromise(function(_0x5dc233,_0x5dba2c){return client[_0x1595('0x9')](_0x24c4d3,_0x2612b1)[_0x1595('0xa')](function(_0x41a9b5){logger[_0x1595('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x4e774c,_0x1595('0xc'));logger[_0x1595('0xd')](_0x1595('0xe'),_0x4e774c,_0x1595('0xc'),JSON[_0x1595('0xf')](_0x41a9b5));if(_0x41a9b5['error']){if(_0x41a9b5[_0x1595('0x10')]['code']===0x1f4){logger['error'](_0x1595('0x11'),_0x4e774c,_0x41a9b5[_0x1595('0x10')][_0x1595('0x12')]);return _0x5dba2c(_0x41a9b5['error'][_0x1595('0x12')]);}logger[_0x1595('0x10')](_0x1595('0x11'),_0x4e774c,_0x41a9b5[_0x1595('0x10')][_0x1595('0x12')]);return _0x5dc233(_0x41a9b5[_0x1595('0x10')][_0x1595('0x12')]);}else{logger[_0x1595('0xb')](_0x1595('0x11'),_0x4e774c,_0x1595('0xc'));_0x5dc233(_0x41a9b5[_0x1595('0x13')]['message']);}})[_0x1595('0x14')](function(_0x68d634){logger[_0x1595('0x10')](_0x1595('0x11'),_0x4e774c,_0x68d634);_0x5dba2c(_0x68d634);});});}exports[_0x1595('0x15')]=function(_0x128c02){var _0x452d19=this;return new Promise(function(_0x140a6b,_0x408300){return db['SalesforceAccount'][_0x1595('0x16')]({'raw':_0x128c02['options']?_0x128c02[_0x1595('0x17')][_0x1595('0x18')]===undefined?!![]:![]:!![],'where':_0x128c02[_0x1595('0x17')]?_0x128c02[_0x1595('0x17')][_0x1595('0x19')]||null:null,'attributes':_0x128c02[_0x1595('0x17')]?_0x128c02[_0x1595('0x17')][_0x1595('0x1a')]||null:null,'limit':_0x128c02[_0x1595('0x17')]?_0x128c02[_0x1595('0x17')][_0x1595('0x1b')]||null:null,'include':_0x128c02['options']?_0x128c02[_0x1595('0x17')]['include']?_[_0x1595('0x1c')](_0x128c02[_0x1595('0x17')]['include'],function(_0x5dbb85){return{'model':db[_0x5dbb85['model']],'as':_0x5dbb85['as'],'attributes':_0x5dbb85['attributes'],'include':_0x5dbb85[_0x1595('0x1d')]?_['map'](_0x5dbb85[_0x1595('0x1d')],function(_0x495500){return{'model':db[_0x495500[_0x1595('0x1e')]],'as':_0x495500['as'],'attributes':_0x495500['attributes'],'include':_0x495500[_0x1595('0x1d')]?_[_0x1595('0x1c')](_0x495500[_0x1595('0x1d')],function(_0x287031){return{'model':db[_0x287031['model']],'as':_0x287031['as'],'attributes':_0x287031[_0x1595('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a217f){logger[_0x1595('0xb')](_0x1595('0x15'),_0x128c02);logger[_0x1595('0xd')](_0x1595('0x15'),_0x128c02,JSON[_0x1595('0xf')](_0x2a217f));_0x140a6b(_0x2a217f);})[_0x1595('0x14')](function(_0x45aa99){logger[_0x1595('0x10')](_0x1595('0x15'),_0x45aa99[_0x1595('0x12')],_0x128c02);_0x408300(_0x452d19[_0x1595('0x10')](0x1f4,_0x45aa99['message']));});});};exports[_0x1595('0x1f')]=function(_0x298bdd){var _0x449e80=this;return new Promise(function(_0x19ebc5,_0x3de4c6){return db[_0x1595('0x20')][_0x1595('0x21')]({'raw':_0x298bdd[_0x1595('0x17')]?_0x298bdd[_0x1595('0x17')][_0x1595('0x18')]===undefined?!![]:![]:!![],'where':_0x298bdd[_0x1595('0x17')]?_0x298bdd['options'][_0x1595('0x19')]||null:null,'attributes':_0x298bdd[_0x1595('0x17')]?_0x298bdd[_0x1595('0x17')][_0x1595('0x1a')]||null:null,'include':_0x298bdd[_0x1595('0x17')]?_0x298bdd[_0x1595('0x17')]['include']?_[_0x1595('0x1c')](_0x298bdd[_0x1595('0x17')][_0x1595('0x1d')],function(_0x3d8232){return{'model':db[_0x3d8232[_0x1595('0x1e')]],'as':_0x3d8232['as'],'attributes':_0x3d8232[_0x1595('0x1a')],'include':_0x3d8232[_0x1595('0x1d')]?_['map'](_0x3d8232['include'],function(_0xca8b30){return{'model':db[_0xca8b30[_0x1595('0x1e')]],'as':_0xca8b30['as'],'attributes':_0xca8b30['attributes'],'include':_0xca8b30[_0x1595('0x1d')]?_[_0x1595('0x1c')](_0xca8b30[_0x1595('0x1d')],function(_0x50bf01){return{'model':db[_0x50bf01[_0x1595('0x1e')]],'as':_0x50bf01['as'],'attributes':_0x50bf01[_0x1595('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1595('0xa')](function(_0x23abb0){logger[_0x1595('0xb')](_0x1595('0x1f'),_0x298bdd);logger['debug']('ShowSalesforceAccount',_0x298bdd,JSON[_0x1595('0xf')](_0x23abb0));_0x19ebc5(_0x23abb0);})[_0x1595('0x14')](function(_0x514b){logger[_0x1595('0x10')]('ShowSalesforceAccount',_0x514b[_0x1595('0x12')],_0x298bdd);_0x3de4c6(_0x449e80[_0x1595('0x10')](0x1f4,_0x514b[_0x1595('0x12')]));});});}; \ No newline at end of file +var _0xa473=['debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','info','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa473,0x89));var _0x3a47=function(_0x60f45e,_0x22b50b){_0x60f45e=_0x60f45e-0x0;var _0x1e5209=_0xa473[_0x60f45e];return _0x1e5209;};'use strict';var _=require(_0x3a47('0x0'));var util=require(_0x3a47('0x1'));var moment=require(_0x3a47('0x2'));var BPromise=require(_0x3a47('0x3'));var rs=require(_0x3a47('0x4'));var fs=require('fs');var Redis=require(_0x3a47('0x5'));var db=require(_0x3a47('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a47('0x7'))(_0x3a47('0x8'));var config=require(_0x3a47('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3a47('0xa')][_0x3a47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57deeb,_0x4a3300,_0x4e8a87){return new BPromise(function(_0x5b698c,_0x50a4d3){return client[_0x3a47('0xc')](_0x57deeb,_0x4e8a87)['then'](function(_0x514578){logger['info'](_0x3a47('0xd'),_0x4a3300,_0x3a47('0xe'));logger[_0x3a47('0xf')](_0x3a47('0x10'),_0x4a3300,'request\x20sent',JSON[_0x3a47('0x11')](_0x514578));if(_0x514578['error']){if(_0x514578['error'][_0x3a47('0x12')]===0x1f4){logger['error'](_0x3a47('0xd'),_0x4a3300,_0x514578[_0x3a47('0x13')][_0x3a47('0x14')]);return _0x50a4d3(_0x514578[_0x3a47('0x13')][_0x3a47('0x14')]);}logger[_0x3a47('0x13')](_0x3a47('0xd'),_0x4a3300,_0x514578[_0x3a47('0x13')][_0x3a47('0x14')]);return _0x5b698c(_0x514578[_0x3a47('0x13')][_0x3a47('0x14')]);}else{logger['info'](_0x3a47('0xd'),_0x4a3300,_0x3a47('0xe'));_0x5b698c(_0x514578[_0x3a47('0x15')][_0x3a47('0x14')]);}})[_0x3a47('0x16')](function(_0x104374){logger[_0x3a47('0x13')](_0x3a47('0xd'),_0x4a3300,_0x104374);_0x50a4d3(_0x104374);});});}exports[_0x3a47('0x17')]=function(_0x44ec4d){var _0x397474=this;return new Promise(function(_0x2a4158,_0x1f6688){return db[_0x3a47('0x18')][_0x3a47('0x19')]({'raw':_0x44ec4d[_0x3a47('0x1a')]?_0x44ec4d[_0x3a47('0x1a')][_0x3a47('0x1b')]===undefined?!![]:![]:!![],'where':_0x44ec4d[_0x3a47('0x1a')]?_0x44ec4d[_0x3a47('0x1a')][_0x3a47('0x1c')]||null:null,'attributes':_0x44ec4d[_0x3a47('0x1a')]?_0x44ec4d['options']['attributes']||null:null,'limit':_0x44ec4d[_0x3a47('0x1a')]?_0x44ec4d['options'][_0x3a47('0x1d')]||null:null,'include':_0x44ec4d[_0x3a47('0x1a')]?_0x44ec4d[_0x3a47('0x1a')][_0x3a47('0x1e')]?_[_0x3a47('0x1f')](_0x44ec4d[_0x3a47('0x1a')][_0x3a47('0x1e')],function(_0x92e98a){return{'model':db[_0x92e98a[_0x3a47('0x20')]],'as':_0x92e98a['as'],'attributes':_0x92e98a[_0x3a47('0x21')],'include':_0x92e98a[_0x3a47('0x1e')]?_['map'](_0x92e98a['include'],function(_0x524d19){return{'model':db[_0x524d19[_0x3a47('0x20')]],'as':_0x524d19['as'],'attributes':_0x524d19['attributes'],'include':_0x524d19[_0x3a47('0x1e')]?_[_0x3a47('0x1f')](_0x524d19[_0x3a47('0x1e')],function(_0x370ce2){return{'model':db[_0x370ce2[_0x3a47('0x20')]],'as':_0x370ce2['as'],'attributes':_0x370ce2[_0x3a47('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3a47('0x22')](function(_0x58f514){logger[_0x3a47('0x23')]('GetSalesforceAccount',_0x44ec4d);logger[_0x3a47('0xf')](_0x3a47('0x17'),_0x44ec4d,JSON[_0x3a47('0x11')](_0x58f514));_0x2a4158(_0x58f514);})['catch'](function(_0x123a04){logger[_0x3a47('0x13')](_0x3a47('0x17'),_0x123a04[_0x3a47('0x14')],_0x44ec4d);_0x1f6688(_0x397474[_0x3a47('0x13')](0x1f4,_0x123a04[_0x3a47('0x14')]));});});};exports[_0x3a47('0x24')]=function(_0x29d12d){var _0x169e45=this;return new Promise(function(_0x28f5e0,_0x45313d){return db[_0x3a47('0x18')][_0x3a47('0x25')]({'raw':_0x29d12d['options']?_0x29d12d[_0x3a47('0x1a')][_0x3a47('0x1b')]===undefined?!![]:![]:!![],'where':_0x29d12d[_0x3a47('0x1a')]?_0x29d12d['options']['where']||null:null,'attributes':_0x29d12d[_0x3a47('0x1a')]?_0x29d12d[_0x3a47('0x1a')][_0x3a47('0x21')]||null:null,'include':_0x29d12d[_0x3a47('0x1a')]?_0x29d12d['options'][_0x3a47('0x1e')]?_[_0x3a47('0x1f')](_0x29d12d['options'][_0x3a47('0x1e')],function(_0x2e9d63){return{'model':db[_0x2e9d63[_0x3a47('0x20')]],'as':_0x2e9d63['as'],'attributes':_0x2e9d63['attributes'],'include':_0x2e9d63[_0x3a47('0x1e')]?_[_0x3a47('0x1f')](_0x2e9d63[_0x3a47('0x1e')],function(_0x47232f){return{'model':db[_0x47232f[_0x3a47('0x20')]],'as':_0x47232f['as'],'attributes':_0x47232f[_0x3a47('0x21')],'include':_0x47232f[_0x3a47('0x1e')]?_[_0x3a47('0x1f')](_0x47232f[_0x3a47('0x1e')],function(_0x8da0f3){return{'model':db[_0x8da0f3[_0x3a47('0x20')]],'as':_0x8da0f3['as'],'attributes':_0x8da0f3[_0x3a47('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcc8f16){logger['info'](_0x3a47('0x24'),_0x29d12d);logger['debug']('ShowSalesforceAccount',_0x29d12d,JSON[_0x3a47('0x11')](_0xcc8f16));_0x28f5e0(_0xcc8f16);})[_0x3a47('0x16')](function(_0x576d6d){logger[_0x3a47('0x13')](_0x3a47('0x24'),_0x576d6d[_0x3a47('0x14')],_0x29d12d);_0x45313d(_0x169e45[_0x3a47('0x13')](0x1f4,_0x576d6d[_0x3a47('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index ec2764c..02f82d9 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 _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x1e6b76,_0x4b4b55){var _0x4b1d3e=function(_0xdf9c27){while(--_0xdf9c27){_0x1e6b76['push'](_0x1e6b76['shift']());}};_0x4b1d3e(++_0x4b4b55);}(_0x7a54,0x106));var _0x47a5=function(_0x192e07,_0x3b269f){_0x192e07=_0x192e07-0x0;var _0x304758=_0x7a54[_0x192e07];return _0x304758;};'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('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x561996,_0x23faaa){var _0x74926c=function(_0x296894){while(--_0x296894){_0x561996['push'](_0x561996['shift']());}};_0x74926c(++_0x23faaa);}(_0x7a54,0x106));var _0x47a5=function(_0x411ae8,_0x42738f){_0x411ae8=_0x411ae8-0x0;var _0x42ec8b=_0x7a54[_0x411ae8];return _0x42ec8b;};'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('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index a88f19f..c8fe76c 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 _0x357e=['Case','ENUM','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','exports','STRING','Task'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x357e,0x170));var _0xe357=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x357e[_0x7e2eb0];return _0xd92de4;};'use strict';var Sequelize=require(_0xe357('0x0'));module[_0xe357('0x1')]={'name':{'type':Sequelize[_0xe357('0x2')]},'description':{'type':Sequelize[_0xe357('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xe357('0x3'),_0xe357('0x4')),'defaultValue':_0xe357('0x3')},'moduleSearch':{'type':Sequelize[_0xe357('0x5')](_0xe357('0x6'),_0xe357('0x7'),_0xe357('0x8'),_0xe357('0x9'),_0xe357('0xa')),'defaultValue':_0xe357('0x6')},'moduleCreate':{'type':Sequelize[_0xe357('0x5')](_0xe357('0xb'),_0xe357('0x7'),'lead',_0xe357('0xa')),'defaultValue':_0xe357('0x8')},'leadId':{'type':Sequelize[_0xe357('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xe357('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xe357('0x2')]}}; \ No newline at end of file +var _0x8754=['Case','contact_lead','contact','account_contact_lead','account','nothing','lead','sequelize','exports','STRING','ENUM','Task'];(function(_0x3b27a2,_0x26be85){var _0x4d0878=function(_0x39925b){while(--_0x39925b){_0x3b27a2['push'](_0x3b27a2['shift']());}};_0x4d0878(++_0x26be85);}(_0x8754,0xf7));var _0x4875=function(_0x5ec4be,_0x590f56){_0x5ec4be=_0x5ec4be-0x0;var _0x445547=_0x8754[_0x5ec4be];return _0x445547;};'use strict';var Sequelize=require(_0x4875('0x0'));module[_0x4875('0x1')]={'name':{'type':Sequelize[_0x4875('0x2')]},'description':{'type':Sequelize[_0x4875('0x2')]},'ticketType':{'type':Sequelize[_0x4875('0x3')](_0x4875('0x4'),_0x4875('0x5')),'defaultValue':_0x4875('0x4')},'moduleSearch':{'type':Sequelize[_0x4875('0x3')](_0x4875('0x6'),_0x4875('0x7'),'lead',_0x4875('0x8'),_0x4875('0x9')),'defaultValue':_0x4875('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x4875('0xa'),_0x4875('0x7'),_0x4875('0xb'),_0x4875('0x9')),'defaultValue':_0x4875('0xb')},'leadId':{'type':Sequelize[_0x4875('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x4875('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x4875('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x4875('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index ce2885f..14ed2a4 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 _0xcf95=['find','create','body','getFields','SalesforceField','order','getSubjects','getDescriptions','findOne','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','then','error','stack','name','index','map','SalesforceConfiguration','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','catch','params','rawAttributes'];(function(_0x22e094,_0x38da27){var _0xf7115b=function(_0x3e629e){while(--_0x3e629e){_0x22e094['push'](_0x22e094['shift']());}};_0xf7115b(++_0x38da27);}(_0xcf95,0xa1));var _0x5cf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf95[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5cf9('0x0'));var rimraf=require(_0x5cf9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5cf9('0x2'));var BPromise=require(_0x5cf9('0x3'));var Mustache=require(_0x5cf9('0x4'));var util=require(_0x5cf9('0x5'));var path=require('path');var sox=require(_0x5cf9('0x6'));var csv=require(_0x5cf9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5cf9('0x8'));var squel=require(_0x5cf9('0x9'));var crypto=require('crypto');var jsforce=require(_0x5cf9('0xa'));var deskjs=require(_0x5cf9('0xb'));var toCsv=require(_0x5cf9('0x7'));var querystring=require(_0x5cf9('0xc'));var Papa=require(_0x5cf9('0xd'));var Redis=require(_0x5cf9('0xe'));var authService=require(_0x5cf9('0xf'));var qs=require(_0x5cf9('0x10'));var as=require(_0x5cf9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5cf9('0x12'))(_0x5cf9('0x13'));var utils=require(_0x5cf9('0x14'));var config=require(_0x5cf9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5cf9('0x16'))['db'];function respondWithStatusCode(_0x191b90,_0x3094d9){_0x3094d9=_0x3094d9||0xcc;return function(_0x565b32){if(_0x565b32){return _0x191b90[_0x5cf9('0x17')](_0x3094d9);}return _0x191b90[_0x5cf9('0x18')](_0x3094d9)[_0x5cf9('0x19')]();};}function respondWithResult(_0x141c9e,_0x5f132e){_0x5f132e=_0x5f132e||0xc8;return function(_0xe787ae){if(_0xe787ae){return _0x141c9e[_0x5cf9('0x18')](_0x5f132e)['json'](_0xe787ae);}};}function respondWithFilteredResult(_0x576855,_0x5b8bf8){return function(_0x4cb11d){if(_0x4cb11d){var _0x184461=typeof _0x5b8bf8[_0x5cf9('0x1a')]===_0x5cf9('0x1b')&&typeof _0x5b8bf8[_0x5cf9('0x1c')]==='undefined';var _0x2fe568=_0x4cb11d[_0x5cf9('0x1d')];var _0x4ef361=_0x184461?0x0:_0x5b8bf8['offset'];var _0x17e526=_0x184461?_0x4cb11d[_0x5cf9('0x1d')]:_0x5b8bf8[_0x5cf9('0x1a')]+_0x5b8bf8[_0x5cf9('0x1c')];var _0x1b55cd;if(_0x17e526>=_0x2fe568){_0x17e526=_0x2fe568;_0x1b55cd=0xc8;}else{_0x1b55cd=0xce;}_0x576855['status'](_0x1b55cd);return _0x576855['set'](_0x5cf9('0x1e'),_0x4ef361+'-'+_0x17e526+'/'+_0x2fe568)[_0x5cf9('0x1f')](_0x4cb11d);}return null;};}function patchUpdates(_0x1f4da8){return function(_0x2865c6){try{jsonpatch['apply'](_0x2865c6,_0x1f4da8,!![]);}catch(_0x2e28c7){return BPromise[_0x5cf9('0x20')](_0x2e28c7);}return _0x2865c6[_0x5cf9('0x21')]();};}function saveUpdates(_0x3510cc,_0x5d1f80){return function(_0x2ee22a){if(_0x2ee22a){return _0x2ee22a[_0x5cf9('0x22')](_0x3510cc)['then'](function(_0x12f478){return _0x12f478;});}return null;};}function removeEntity(_0x2d153e,_0x17d689){return function(_0x2fe5f1){if(_0x2fe5f1){return _0x2fe5f1[_0x5cf9('0x23')]()[_0x5cf9('0x24')](function(){_0x2d153e[_0x5cf9('0x18')](0xcc)[_0x5cf9('0x19')]();});}};}function handleEntityNotFound(_0x2bc8c6,_0x4de284){return function(_0x46d31c){if(!_0x46d31c){_0x2bc8c6['sendStatus'](0x194);}return _0x46d31c;};}function handleError(_0x30b294,_0x1a976e){_0x1a976e=_0x1a976e||0x1f4;return function(_0x2831af){logger[_0x5cf9('0x25')](_0x2831af[_0x5cf9('0x26')]);if(_0x2831af[_0x5cf9('0x27')]){delete _0x2831af[_0x5cf9('0x27')];}_0x30b294[_0x5cf9('0x18')](_0x1a976e)['send'](_0x2831af);};}exports[_0x5cf9('0x28')]=function(_0x382c62,_0x11a939){var _0x4e029c={},_0x57fde4={},_0x2793b5={'count':0x0,'rows':[]};var _0x59b15e=_[_0x5cf9('0x29')](db[_0x5cf9('0x2a')]['rawAttributes'],function(_0x376446){return{'name':_0x376446[_0x5cf9('0x2b')],'type':_0x376446[_0x5cf9('0x2c')]['key']};});_0x57fde4[_0x5cf9('0x2d')]=_[_0x5cf9('0x29')](_0x59b15e,_0x5cf9('0x27'));_0x57fde4[_0x5cf9('0x2e')]=_[_0x5cf9('0x2f')](_0x382c62[_0x5cf9('0x2e')]);_0x57fde4['filters']=_[_0x5cf9('0x30')](_0x57fde4[_0x5cf9('0x2d')],_0x57fde4['query']);_0x4e029c[_0x5cf9('0x31')]=_['intersection'](_0x57fde4['model'],qs['fields'](_0x382c62['query'][_0x5cf9('0x32')]));_0x4e029c[_0x5cf9('0x31')]=_0x4e029c[_0x5cf9('0x31')][_0x5cf9('0x33')]?_0x4e029c[_0x5cf9('0x31')]:_0x57fde4[_0x5cf9('0x2d')];if(!_0x382c62[_0x5cf9('0x2e')][_0x5cf9('0x34')](_0x5cf9('0x35'))){_0x4e029c[_0x5cf9('0x1c')]=qs[_0x5cf9('0x1c')](_0x382c62['query'][_0x5cf9('0x1c')]);_0x4e029c[_0x5cf9('0x1a')]=qs[_0x5cf9('0x1a')](_0x382c62[_0x5cf9('0x2e')][_0x5cf9('0x1a')]);}_0x4e029c['order']=qs[_0x5cf9('0x36')](_0x382c62[_0x5cf9('0x2e')][_0x5cf9('0x36')]);_0x4e029c[_0x5cf9('0x37')]=qs['filters'](_[_0x5cf9('0x38')](_0x382c62['query'],_0x57fde4[_0x5cf9('0x39')]),_0x59b15e);if(_0x382c62[_0x5cf9('0x2e')][_0x5cf9('0x3a')]){_0x4e029c[_0x5cf9('0x37')]=_[_0x5cf9('0x3b')](_0x4e029c[_0x5cf9('0x37')],{'$or':_[_0x5cf9('0x29')](_0x59b15e,function(_0x732390){if(_0x732390['type']!=='VIRTUAL'){var _0x577478={};_0x577478[_0x732390[_0x5cf9('0x27')]]={'$like':'%'+_0x382c62[_0x5cf9('0x2e')]['filter']+'%'};return _0x577478;}})});}_0x4e029c=_[_0x5cf9('0x3b')]({},_0x4e029c,_0x382c62[_0x5cf9('0x3c')]);var _0x367e7a={'where':_0x4e029c['where']};return db[_0x5cf9('0x2a')]['count'](_0x367e7a)[_0x5cf9('0x24')](function(_0x19cdeb){_0x2793b5[_0x5cf9('0x1d')]=_0x19cdeb;if(_0x382c62[_0x5cf9('0x2e')][_0x5cf9('0x3d')]){_0x4e029c[_0x5cf9('0x3e')]=[{'all':!![]}];}return db[_0x5cf9('0x2a')]['findAll'](_0x4e029c);})[_0x5cf9('0x24')](function(_0x23e863){_0x2793b5[_0x5cf9('0x3f')]=_0x23e863;return _0x2793b5;})[_0x5cf9('0x24')](respondWithFilteredResult(_0x11a939,_0x4e029c))[_0x5cf9('0x40')](handleError(_0x11a939,null));};exports['show']=function(_0x3c8da8,_0x43d199){var _0x4b960e={'raw':![],'where':{'id':_0x3c8da8[_0x5cf9('0x41')]['id']}},_0x5cb2c0={};_0x5cb2c0[_0x5cf9('0x2d')]=_[_0x5cf9('0x2f')](db[_0x5cf9('0x2a')][_0x5cf9('0x42')]);_0x5cb2c0['query']=_[_0x5cf9('0x2f')](_0x3c8da8['query']);_0x5cb2c0[_0x5cf9('0x39')]=_['intersection'](_0x5cb2c0[_0x5cf9('0x2d')],_0x5cb2c0['query']);_0x4b960e[_0x5cf9('0x31')]=_['intersection'](_0x5cb2c0[_0x5cf9('0x2d')],qs['fields'](_0x3c8da8[_0x5cf9('0x2e')][_0x5cf9('0x32')]));_0x4b960e[_0x5cf9('0x31')]=_0x4b960e[_0x5cf9('0x31')][_0x5cf9('0x33')]?_0x4b960e[_0x5cf9('0x31')]:_0x5cb2c0[_0x5cf9('0x2d')];if(_0x3c8da8[_0x5cf9('0x2e')][_0x5cf9('0x3d')]){_0x4b960e[_0x5cf9('0x3e')]=[{'all':!![]}];}_0x4b960e=_[_0x5cf9('0x3b')]({},_0x4b960e,_0x3c8da8[_0x5cf9('0x3c')]);return db[_0x5cf9('0x2a')][_0x5cf9('0x43')](_0x4b960e)['then'](handleEntityNotFound(_0x43d199,null))['then'](respondWithResult(_0x43d199,null))[_0x5cf9('0x40')](handleError(_0x43d199,null));};exports[_0x5cf9('0x44')]=function(_0x1b7c85,_0xdcd9ba){return db[_0x5cf9('0x2a')]['create'](_0x1b7c85[_0x5cf9('0x45')],{})['then'](respondWithResult(_0xdcd9ba,0xc9))['catch'](handleError(_0xdcd9ba,null));};exports['update']=function(_0x2390a8,_0x4f6830){if(_0x2390a8[_0x5cf9('0x45')]['id']){delete _0x2390a8[_0x5cf9('0x45')]['id'];}return db[_0x5cf9('0x2a')]['find']({'where':{'id':_0x2390a8[_0x5cf9('0x41')]['id']}})[_0x5cf9('0x24')](handleEntityNotFound(_0x4f6830,null))['then'](saveUpdates(_0x2390a8[_0x5cf9('0x45')],null))['then'](respondWithResult(_0x4f6830,null))[_0x5cf9('0x40')](handleError(_0x4f6830,null));};exports['destroy']=function(_0x8dd4fe,_0x4e5769){return db['SalesforceConfiguration'][_0x5cf9('0x43')]({'where':{'id':_0x8dd4fe['params']['id']}})[_0x5cf9('0x24')](handleEntityNotFound(_0x4e5769,null))[_0x5cf9('0x24')](removeEntity(_0x4e5769,null))[_0x5cf9('0x40')](handleError(_0x4e5769,null));};exports[_0x5cf9('0x46')]=function(_0x487f9b,_0x5993d1,_0x28b448){var _0x14b79e={};var _0x255617={};var _0x447571;var _0x202de7;return db[_0x5cf9('0x2a')]['findOne']({'where':{'id':_0x487f9b[_0x5cf9('0x41')]['id']}})['then'](handleEntityNotFound(_0x5993d1,null))[_0x5cf9('0x24')](function(_0x27e634){if(_0x27e634){_0x447571=_0x27e634;_0x255617[_0x5cf9('0x2d')]=_['keys'](db[_0x5cf9('0x47')]['rawAttributes']);_0x255617['query']=_[_0x5cf9('0x2f')](_0x487f9b[_0x5cf9('0x2e')]);_0x255617[_0x5cf9('0x39')]=_[_0x5cf9('0x30')](_0x255617[_0x5cf9('0x2d')],_0x255617[_0x5cf9('0x2e')]);_0x14b79e[_0x5cf9('0x31')]=_['intersection'](_0x255617[_0x5cf9('0x2d')],qs[_0x5cf9('0x32')](_0x487f9b[_0x5cf9('0x2e')][_0x5cf9('0x32')]));_0x14b79e['attributes']=_0x14b79e['attributes'][_0x5cf9('0x33')]?_0x14b79e['attributes']:_0x255617[_0x5cf9('0x2d')];_0x14b79e[_0x5cf9('0x48')]=qs[_0x5cf9('0x36')](_0x487f9b['query']['sort']);_0x14b79e[_0x5cf9('0x37')]=qs[_0x5cf9('0x39')](_[_0x5cf9('0x38')](_0x487f9b[_0x5cf9('0x2e')],_0x255617[_0x5cf9('0x39')]));if(_0x487f9b['query'][_0x5cf9('0x3a')]){_0x14b79e[_0x5cf9('0x37')]=_[_0x5cf9('0x3b')](_0x14b79e['where'],{'$or':_[_0x5cf9('0x29')](_0x14b79e[_0x5cf9('0x31')],function(_0x3d1510){var _0x78482d={};_0x78482d[_0x3d1510]={'$like':'%'+_0x487f9b['query'][_0x5cf9('0x3a')]+'%'};return _0x78482d;})});}_0x14b79e=_['merge']({},_0x14b79e,_0x487f9b[_0x5cf9('0x3c')]);return _0x447571['getFields'](_0x14b79e);}})[_0x5cf9('0x24')](function(_0x349ad7){if(_0x349ad7){_0x202de7=_0x349ad7[_0x5cf9('0x33')];if(!_0x487f9b[_0x5cf9('0x2e')][_0x5cf9('0x34')](_0x5cf9('0x35'))){_0x14b79e['limit']=qs['limit'](_0x487f9b[_0x5cf9('0x2e')]['limit']);_0x14b79e['offset']=qs[_0x5cf9('0x1a')](_0x487f9b[_0x5cf9('0x2e')][_0x5cf9('0x1a')]);}return _0x447571[_0x5cf9('0x46')](_0x14b79e);}})[_0x5cf9('0x24')](function(_0x70bc9d){if(_0x70bc9d){return _0x70bc9d?{'count':_0x202de7,'rows':_0x70bc9d}:null;}})[_0x5cf9('0x24')](respondWithResult(_0x5993d1,null))[_0x5cf9('0x40')](handleError(_0x5993d1,null));};exports[_0x5cf9('0x49')]=function(_0x20390a,_0xbee90f,_0x727796){var _0x20f6af={};var _0x2683ee={};var _0x243bf9;var _0x1b7cf9;return db[_0x5cf9('0x2a')]['findOne']({'where':{'id':_0x20390a[_0x5cf9('0x41')]['id']}})['then'](handleEntityNotFound(_0xbee90f,null))['then'](function(_0x581012){if(_0x581012){_0x243bf9=_0x581012;_0x2683ee[_0x5cf9('0x2d')]=_['keys'](db[_0x5cf9('0x47')][_0x5cf9('0x42')]);_0x2683ee['query']=_[_0x5cf9('0x2f')](_0x20390a['query']);_0x2683ee[_0x5cf9('0x39')]=_['intersection'](_0x2683ee[_0x5cf9('0x2d')],_0x2683ee[_0x5cf9('0x2e')]);_0x20f6af['attributes']=_[_0x5cf9('0x30')](_0x2683ee[_0x5cf9('0x2d')],qs['fields'](_0x20390a[_0x5cf9('0x2e')][_0x5cf9('0x32')]));_0x20f6af[_0x5cf9('0x31')]=_0x20f6af[_0x5cf9('0x31')][_0x5cf9('0x33')]?_0x20f6af[_0x5cf9('0x31')]:_0x2683ee[_0x5cf9('0x2d')];_0x20f6af[_0x5cf9('0x48')]=qs['sort'](_0x20390a['query'][_0x5cf9('0x36')]);_0x20f6af[_0x5cf9('0x37')]=qs['filters'](_[_0x5cf9('0x38')](_0x20390a[_0x5cf9('0x2e')],_0x2683ee[_0x5cf9('0x39')]));if(_0x20390a[_0x5cf9('0x2e')][_0x5cf9('0x3a')]){_0x20f6af[_0x5cf9('0x37')]=_['merge'](_0x20f6af[_0x5cf9('0x37')],{'$or':_[_0x5cf9('0x29')](_0x20f6af[_0x5cf9('0x31')],function(_0x13faa7){var _0x1d492b={};_0x1d492b[_0x13faa7]={'$like':'%'+_0x20390a[_0x5cf9('0x2e')][_0x5cf9('0x3a')]+'%'};return _0x1d492b;})});}_0x20f6af=_['merge']({},_0x20f6af,_0x20390a['options']);return _0x243bf9[_0x5cf9('0x49')](_0x20f6af);}})['then'](function(_0xd8d8ac){if(_0xd8d8ac){_0x1b7cf9=_0xd8d8ac[_0x5cf9('0x33')];if(!_0x20390a['query'][_0x5cf9('0x34')](_0x5cf9('0x35'))){_0x20f6af[_0x5cf9('0x1c')]=qs[_0x5cf9('0x1c')](_0x20390a['query'][_0x5cf9('0x1c')]);_0x20f6af[_0x5cf9('0x1a')]=qs[_0x5cf9('0x1a')](_0x20390a[_0x5cf9('0x2e')]['offset']);}return _0x243bf9['getSubjects'](_0x20f6af);}})['then'](function(_0x516b14){if(_0x516b14){return _0x516b14?{'count':_0x1b7cf9,'rows':_0x516b14}:null;}})[_0x5cf9('0x24')](respondWithResult(_0xbee90f,null))[_0x5cf9('0x40')](handleError(_0xbee90f,null));};exports[_0x5cf9('0x4a')]=function(_0x4648ff,_0xf44125,_0x22eced){var _0x405d4b={};var _0x4be77c={};var _0xccea5a;var _0xb979d4;return db[_0x5cf9('0x2a')][_0x5cf9('0x4b')]({'where':{'id':_0x4648ff[_0x5cf9('0x41')]['id']}})[_0x5cf9('0x24')](handleEntityNotFound(_0xf44125,null))['then'](function(_0x1b780e){if(_0x1b780e){_0xccea5a=_0x1b780e;_0x4be77c[_0x5cf9('0x2d')]=_[_0x5cf9('0x2f')](db[_0x5cf9('0x47')][_0x5cf9('0x42')]);_0x4be77c[_0x5cf9('0x2e')]=_[_0x5cf9('0x2f')](_0x4648ff['query']);_0x4be77c[_0x5cf9('0x39')]=_['intersection'](_0x4be77c[_0x5cf9('0x2d')],_0x4be77c[_0x5cf9('0x2e')]);_0x405d4b[_0x5cf9('0x31')]=_[_0x5cf9('0x30')](_0x4be77c['model'],qs[_0x5cf9('0x32')](_0x4648ff['query']['fields']));_0x405d4b[_0x5cf9('0x31')]=_0x405d4b[_0x5cf9('0x31')][_0x5cf9('0x33')]?_0x405d4b[_0x5cf9('0x31')]:_0x4be77c[_0x5cf9('0x2d')];_0x405d4b['order']=qs['sort'](_0x4648ff[_0x5cf9('0x2e')][_0x5cf9('0x36')]);_0x405d4b[_0x5cf9('0x37')]=qs['filters'](_['pick'](_0x4648ff[_0x5cf9('0x2e')],_0x4be77c[_0x5cf9('0x39')]));if(_0x4648ff[_0x5cf9('0x2e')][_0x5cf9('0x3a')]){_0x405d4b[_0x5cf9('0x37')]=_['merge'](_0x405d4b['where'],{'$or':_[_0x5cf9('0x29')](_0x405d4b[_0x5cf9('0x31')],function(_0x297b0f){var _0x52f329={};_0x52f329[_0x297b0f]={'$like':'%'+_0x4648ff[_0x5cf9('0x2e')]['filter']+'%'};return _0x52f329;})});}_0x405d4b=_[_0x5cf9('0x3b')]({},_0x405d4b,_0x4648ff[_0x5cf9('0x3c')]);return _0xccea5a[_0x5cf9('0x4a')](_0x405d4b);}})[_0x5cf9('0x24')](function(_0x59e599){if(_0x59e599){_0xb979d4=_0x59e599['length'];if(!_0x4648ff[_0x5cf9('0x2e')][_0x5cf9('0x34')](_0x5cf9('0x35'))){_0x405d4b[_0x5cf9('0x1c')]=qs['limit'](_0x4648ff[_0x5cf9('0x2e')][_0x5cf9('0x1c')]);_0x405d4b['offset']=qs[_0x5cf9('0x1a')](_0x4648ff[_0x5cf9('0x2e')][_0x5cf9('0x1a')]);}return _0xccea5a['getDescriptions'](_0x405d4b);}})[_0x5cf9('0x24')](function(_0x2a0144){if(_0x2a0144){return _0x2a0144?{'count':_0xb979d4,'rows':_0x2a0144}:null;}})['then'](respondWithResult(_0xf44125,null))[_0x5cf9('0x40')](handleError(_0xf44125,null));}; \ No newline at end of file +var _0xa24e=['querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','SalesforceConfiguration','findAll','rows','catch','show','params','includeAll','find','create','body','update','destroy','getFields','findOne','SalesforceField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa24e,0x137));var _0xea24=function(_0xfba42,_0x2df074){_0xfba42=_0xfba42-0x0;var _0x245842=_0xa24e[_0xfba42];return _0x245842;};'use strict';var emlformat=require(_0xea24('0x0'));var rimraf=require(_0xea24('0x1'));var zipdir=require(_0xea24('0x2'));var jsonpatch=require(_0xea24('0x3'));var rp=require(_0xea24('0x4'));var moment=require(_0xea24('0x5'));var BPromise=require(_0xea24('0x6'));var Mustache=require(_0xea24('0x7'));var util=require(_0xea24('0x8'));var path=require('path');var sox=require(_0xea24('0x9'));var csv=require(_0xea24('0xa'));var ejs=require(_0xea24('0xb'));var fs=require('fs');var fs_extra=require(_0xea24('0xc'));var _=require(_0xea24('0xd'));var squel=require('squel');var crypto=require(_0xea24('0xe'));var jsforce=require(_0xea24('0xf'));var deskjs=require(_0xea24('0x10'));var toCsv=require(_0xea24('0xa'));var querystring=require(_0xea24('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xea24('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xea24('0x13'));var hardwareService=require(_0xea24('0x14'));var logger=require(_0xea24('0x15'))(_0xea24('0x16'));var utils=require('../../config/utils');var config=require(_0xea24('0x17'));var licenseUtil=require(_0xea24('0x18'));var db=require(_0xea24('0x19'))['db'];function respondWithStatusCode(_0x49af95,_0x2e7fc5){_0x2e7fc5=_0x2e7fc5||0xcc;return function(_0x1691a0){if(_0x1691a0){return _0x49af95[_0xea24('0x1a')](_0x2e7fc5);}return _0x49af95['status'](_0x2e7fc5)[_0xea24('0x1b')]();};}function respondWithResult(_0x51081a,_0x10b0f4){_0x10b0f4=_0x10b0f4||0xc8;return function(_0x40c878){if(_0x40c878){return _0x51081a['status'](_0x10b0f4)['json'](_0x40c878);}};}function respondWithFilteredResult(_0x31f775,_0x5baa30){return function(_0x31d222){if(_0x31d222){var _0x641291=typeof _0x5baa30[_0xea24('0x1c')]===_0xea24('0x1d')&&typeof _0x5baa30[_0xea24('0x1e')]===_0xea24('0x1d');var _0x58fd4f=_0x31d222[_0xea24('0x1f')];var _0x1eed0c=_0x641291?0x0:_0x5baa30[_0xea24('0x1c')];var _0x50dbcf=_0x641291?_0x31d222['count']:_0x5baa30[_0xea24('0x1c')]+_0x5baa30['limit'];var _0x5be60c;if(_0x50dbcf>=_0x58fd4f){_0x50dbcf=_0x58fd4f;_0x5be60c=0xc8;}else{_0x5be60c=0xce;}_0x31f775[_0xea24('0x20')](_0x5be60c);return _0x31f775[_0xea24('0x21')](_0xea24('0x22'),_0x1eed0c+'-'+_0x50dbcf+'/'+_0x58fd4f)['json'](_0x31d222);}return null;};}function patchUpdates(_0x4f7896){return function(_0x53ef15){try{jsonpatch[_0xea24('0x23')](_0x53ef15,_0x4f7896,!![]);}catch(_0x5c59d0){return BPromise[_0xea24('0x24')](_0x5c59d0);}return _0x53ef15[_0xea24('0x25')]();};}function saveUpdates(_0x3ec628,_0x11fa74){return function(_0x568b3d){if(_0x568b3d){return _0x568b3d['update'](_0x3ec628)[_0xea24('0x26')](function(_0x447e0e){return _0x447e0e;});}return null;};}function removeEntity(_0x1476f6,_0x51e361){return function(_0x24bc50){if(_0x24bc50){return _0x24bc50['destroy']()[_0xea24('0x26')](function(){_0x1476f6[_0xea24('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4617cf,_0x137385){return function(_0x35309c){if(!_0x35309c){_0x4617cf[_0xea24('0x1a')](0x194);}return _0x35309c;};}function handleError(_0x180b53,_0x5650fc){_0x5650fc=_0x5650fc||0x1f4;return function(_0x3ba1cb){logger[_0xea24('0x27')](_0x3ba1cb[_0xea24('0x28')]);if(_0x3ba1cb[_0xea24('0x29')]){delete _0x3ba1cb[_0xea24('0x29')];}_0x180b53['status'](_0x5650fc)['send'](_0x3ba1cb);};}exports['index']=function(_0x14f5fd,_0x162688){var _0x29d60b={},_0x2e8552={},_0x182fae={'count':0x0,'rows':[]};var _0x54a3f3=_[_0xea24('0x2a')](db['SalesforceConfiguration'][_0xea24('0x2b')],function(_0x1e8803){return{'name':_0x1e8803[_0xea24('0x2c')],'type':_0x1e8803[_0xea24('0x2d')][_0xea24('0x2e')]};});_0x2e8552[_0xea24('0x2f')]=_[_0xea24('0x2a')](_0x54a3f3,_0xea24('0x29'));_0x2e8552[_0xea24('0x30')]=_[_0xea24('0x31')](_0x14f5fd[_0xea24('0x30')]);_0x2e8552['filters']=_[_0xea24('0x32')](_0x2e8552['model'],_0x2e8552[_0xea24('0x30')]);_0x29d60b['attributes']=_[_0xea24('0x32')](_0x2e8552[_0xea24('0x2f')],qs[_0xea24('0x33')](_0x14f5fd[_0xea24('0x30')]['fields']));_0x29d60b[_0xea24('0x34')]=_0x29d60b[_0xea24('0x34')][_0xea24('0x35')]?_0x29d60b[_0xea24('0x34')]:_0x2e8552[_0xea24('0x2f')];if(!_0x14f5fd[_0xea24('0x30')][_0xea24('0x36')]('nolimit')){_0x29d60b[_0xea24('0x1e')]=qs['limit'](_0x14f5fd[_0xea24('0x30')][_0xea24('0x1e')]);_0x29d60b['offset']=qs[_0xea24('0x1c')](_0x14f5fd[_0xea24('0x30')][_0xea24('0x1c')]);}_0x29d60b[_0xea24('0x37')]=qs['sort'](_0x14f5fd[_0xea24('0x30')][_0xea24('0x38')]);_0x29d60b[_0xea24('0x39')]=qs[_0xea24('0x3a')](_[_0xea24('0x3b')](_0x14f5fd[_0xea24('0x30')],_0x2e8552[_0xea24('0x3a')]),_0x54a3f3);if(_0x14f5fd[_0xea24('0x30')][_0xea24('0x3c')]){_0x29d60b[_0xea24('0x39')]=_[_0xea24('0x3d')](_0x29d60b[_0xea24('0x39')],{'$or':_[_0xea24('0x2a')](_0x54a3f3,function(_0x34560a){if(_0x34560a[_0xea24('0x2d')]!=='VIRTUAL'){var _0x478e4c={};_0x478e4c[_0x34560a[_0xea24('0x29')]]={'$like':'%'+_0x14f5fd[_0xea24('0x30')][_0xea24('0x3c')]+'%'};return _0x478e4c;}})});}_0x29d60b=_['merge']({},_0x29d60b,_0x14f5fd[_0xea24('0x3e')]);var _0xdecd6e={'where':_0x29d60b['where']};return db['SalesforceConfiguration']['count'](_0xdecd6e)[_0xea24('0x26')](function(_0xbc47a1){_0x182fae['count']=_0xbc47a1;if(_0x14f5fd[_0xea24('0x30')]['includeAll']){_0x29d60b[_0xea24('0x3f')]=[{'all':!![]}];}return db[_0xea24('0x40')][_0xea24('0x41')](_0x29d60b);})[_0xea24('0x26')](function(_0x6eb18b){_0x182fae[_0xea24('0x42')]=_0x6eb18b;return _0x182fae;})['then'](respondWithFilteredResult(_0x162688,_0x29d60b))[_0xea24('0x43')](handleError(_0x162688,null));};exports[_0xea24('0x44')]=function(_0x314531,_0x6add52){var _0x3ace02={'raw':![],'where':{'id':_0x314531[_0xea24('0x45')]['id']}},_0x8bf93d={};_0x8bf93d[_0xea24('0x2f')]=_[_0xea24('0x31')](db[_0xea24('0x40')][_0xea24('0x2b')]);_0x8bf93d[_0xea24('0x30')]=_[_0xea24('0x31')](_0x314531[_0xea24('0x30')]);_0x8bf93d[_0xea24('0x3a')]=_[_0xea24('0x32')](_0x8bf93d[_0xea24('0x2f')],_0x8bf93d[_0xea24('0x30')]);_0x3ace02['attributes']=_[_0xea24('0x32')](_0x8bf93d[_0xea24('0x2f')],qs['fields'](_0x314531[_0xea24('0x30')][_0xea24('0x33')]));_0x3ace02['attributes']=_0x3ace02[_0xea24('0x34')][_0xea24('0x35')]?_0x3ace02[_0xea24('0x34')]:_0x8bf93d[_0xea24('0x2f')];if(_0x314531[_0xea24('0x30')][_0xea24('0x46')]){_0x3ace02[_0xea24('0x3f')]=[{'all':!![]}];}_0x3ace02=_[_0xea24('0x3d')]({},_0x3ace02,_0x314531['options']);return db[_0xea24('0x40')][_0xea24('0x47')](_0x3ace02)[_0xea24('0x26')](handleEntityNotFound(_0x6add52,null))['then'](respondWithResult(_0x6add52,null))[_0xea24('0x43')](handleError(_0x6add52,null));};exports['create']=function(_0x2e1141,_0x281465){return db[_0xea24('0x40')][_0xea24('0x48')](_0x2e1141[_0xea24('0x49')],{})[_0xea24('0x26')](respondWithResult(_0x281465,0xc9))['catch'](handleError(_0x281465,null));};exports[_0xea24('0x4a')]=function(_0x4f756b,_0x10c6fa){if(_0x4f756b[_0xea24('0x49')]['id']){delete _0x4f756b[_0xea24('0x49')]['id'];}return db['SalesforceConfiguration'][_0xea24('0x47')]({'where':{'id':_0x4f756b[_0xea24('0x45')]['id']}})[_0xea24('0x26')](handleEntityNotFound(_0x10c6fa,null))['then'](saveUpdates(_0x4f756b[_0xea24('0x49')],null))[_0xea24('0x26')](respondWithResult(_0x10c6fa,null))[_0xea24('0x43')](handleError(_0x10c6fa,null));};exports[_0xea24('0x4b')]=function(_0xab4a44,_0x1925fc){return db[_0xea24('0x40')][_0xea24('0x47')]({'where':{'id':_0xab4a44[_0xea24('0x45')]['id']}})[_0xea24('0x26')](handleEntityNotFound(_0x1925fc,null))[_0xea24('0x26')](removeEntity(_0x1925fc,null))['catch'](handleError(_0x1925fc,null));};exports[_0xea24('0x4c')]=function(_0x498e88,_0xc37720,_0x147919){var _0x3b1f56={};var _0x401a9d={};var _0x1fe63b;var _0x3c2eca;return db['SalesforceConfiguration'][_0xea24('0x4d')]({'where':{'id':_0x498e88['params']['id']}})[_0xea24('0x26')](handleEntityNotFound(_0xc37720,null))[_0xea24('0x26')](function(_0x268575){if(_0x268575){_0x1fe63b=_0x268575;_0x401a9d[_0xea24('0x2f')]=_[_0xea24('0x31')](db[_0xea24('0x4e')][_0xea24('0x2b')]);_0x401a9d['query']=_[_0xea24('0x31')](_0x498e88['query']);_0x401a9d[_0xea24('0x3a')]=_[_0xea24('0x32')](_0x401a9d[_0xea24('0x2f')],_0x401a9d[_0xea24('0x30')]);_0x3b1f56[_0xea24('0x34')]=_['intersection'](_0x401a9d['model'],qs['fields'](_0x498e88['query'][_0xea24('0x33')]));_0x3b1f56['attributes']=_0x3b1f56[_0xea24('0x34')]['length']?_0x3b1f56[_0xea24('0x34')]:_0x401a9d[_0xea24('0x2f')];_0x3b1f56[_0xea24('0x37')]=qs['sort'](_0x498e88[_0xea24('0x30')][_0xea24('0x38')]);_0x3b1f56[_0xea24('0x39')]=qs[_0xea24('0x3a')](_[_0xea24('0x3b')](_0x498e88[_0xea24('0x30')],_0x401a9d[_0xea24('0x3a')]));if(_0x498e88[_0xea24('0x30')][_0xea24('0x3c')]){_0x3b1f56[_0xea24('0x39')]=_[_0xea24('0x3d')](_0x3b1f56[_0xea24('0x39')],{'$or':_['map'](_0x3b1f56[_0xea24('0x34')],function(_0x2028be){var _0x276adb={};_0x276adb[_0x2028be]={'$like':'%'+_0x498e88[_0xea24('0x30')][_0xea24('0x3c')]+'%'};return _0x276adb;})});}_0x3b1f56=_[_0xea24('0x3d')]({},_0x3b1f56,_0x498e88['options']);return _0x1fe63b[_0xea24('0x4c')](_0x3b1f56);}})[_0xea24('0x26')](function(_0x45045f){if(_0x45045f){_0x3c2eca=_0x45045f[_0xea24('0x35')];if(!_0x498e88[_0xea24('0x30')][_0xea24('0x36')](_0xea24('0x4f'))){_0x3b1f56[_0xea24('0x1e')]=qs[_0xea24('0x1e')](_0x498e88['query']['limit']);_0x3b1f56['offset']=qs['offset'](_0x498e88[_0xea24('0x30')][_0xea24('0x1c')]);}return _0x1fe63b[_0xea24('0x4c')](_0x3b1f56);}})[_0xea24('0x26')](function(_0x3c0666){if(_0x3c0666){return _0x3c0666?{'count':_0x3c2eca,'rows':_0x3c0666}:null;}})[_0xea24('0x26')](respondWithResult(_0xc37720,null))[_0xea24('0x43')](handleError(_0xc37720,null));};exports[_0xea24('0x50')]=function(_0x138ebf,_0x45cf3a,_0x6bc6ef){var _0xc91ed7={};var _0x32e279={};var _0x506cde;var _0xb1aa1;return db[_0xea24('0x40')][_0xea24('0x4d')]({'where':{'id':_0x138ebf[_0xea24('0x45')]['id']}})[_0xea24('0x26')](handleEntityNotFound(_0x45cf3a,null))[_0xea24('0x26')](function(_0x173ec7){if(_0x173ec7){_0x506cde=_0x173ec7;_0x32e279[_0xea24('0x2f')]=_[_0xea24('0x31')](db[_0xea24('0x4e')]['rawAttributes']);_0x32e279[_0xea24('0x30')]=_[_0xea24('0x31')](_0x138ebf[_0xea24('0x30')]);_0x32e279['filters']=_['intersection'](_0x32e279['model'],_0x32e279[_0xea24('0x30')]);_0xc91ed7[_0xea24('0x34')]=_['intersection'](_0x32e279[_0xea24('0x2f')],qs[_0xea24('0x33')](_0x138ebf[_0xea24('0x30')][_0xea24('0x33')]));_0xc91ed7[_0xea24('0x34')]=_0xc91ed7[_0xea24('0x34')]['length']?_0xc91ed7[_0xea24('0x34')]:_0x32e279[_0xea24('0x2f')];_0xc91ed7[_0xea24('0x37')]=qs[_0xea24('0x38')](_0x138ebf['query'][_0xea24('0x38')]);_0xc91ed7[_0xea24('0x39')]=qs[_0xea24('0x3a')](_[_0xea24('0x3b')](_0x138ebf[_0xea24('0x30')],_0x32e279[_0xea24('0x3a')]));if(_0x138ebf[_0xea24('0x30')][_0xea24('0x3c')]){_0xc91ed7[_0xea24('0x39')]=_['merge'](_0xc91ed7[_0xea24('0x39')],{'$or':_['map'](_0xc91ed7[_0xea24('0x34')],function(_0x1d838e){var _0x391e13={};_0x391e13[_0x1d838e]={'$like':'%'+_0x138ebf[_0xea24('0x30')][_0xea24('0x3c')]+'%'};return _0x391e13;})});}_0xc91ed7=_[_0xea24('0x3d')]({},_0xc91ed7,_0x138ebf[_0xea24('0x3e')]);return _0x506cde['getSubjects'](_0xc91ed7);}})[_0xea24('0x26')](function(_0x86d118){if(_0x86d118){_0xb1aa1=_0x86d118[_0xea24('0x35')];if(!_0x138ebf[_0xea24('0x30')][_0xea24('0x36')](_0xea24('0x4f'))){_0xc91ed7[_0xea24('0x1e')]=qs['limit'](_0x138ebf[_0xea24('0x30')][_0xea24('0x1e')]);_0xc91ed7[_0xea24('0x1c')]=qs['offset'](_0x138ebf[_0xea24('0x30')][_0xea24('0x1c')]);}return _0x506cde[_0xea24('0x50')](_0xc91ed7);}})[_0xea24('0x26')](function(_0x271464){if(_0x271464){return _0x271464?{'count':_0xb1aa1,'rows':_0x271464}:null;}})[_0xea24('0x26')](respondWithResult(_0x45cf3a,null))[_0xea24('0x43')](handleError(_0x45cf3a,null));};exports[_0xea24('0x51')]=function(_0x46c5e2,_0x17f9e0,_0x32178b){var _0x281b41={};var _0x3b06ea={};var _0x20827b;var _0xbadd64;return db[_0xea24('0x40')][_0xea24('0x4d')]({'where':{'id':_0x46c5e2[_0xea24('0x45')]['id']}})[_0xea24('0x26')](handleEntityNotFound(_0x17f9e0,null))['then'](function(_0x3a08ce){if(_0x3a08ce){_0x20827b=_0x3a08ce;_0x3b06ea[_0xea24('0x2f')]=_['keys'](db[_0xea24('0x4e')][_0xea24('0x2b')]);_0x3b06ea[_0xea24('0x30')]=_[_0xea24('0x31')](_0x46c5e2['query']);_0x3b06ea[_0xea24('0x3a')]=_[_0xea24('0x32')](_0x3b06ea[_0xea24('0x2f')],_0x3b06ea[_0xea24('0x30')]);_0x281b41['attributes']=_['intersection'](_0x3b06ea['model'],qs['fields'](_0x46c5e2[_0xea24('0x30')][_0xea24('0x33')]));_0x281b41[_0xea24('0x34')]=_0x281b41[_0xea24('0x34')][_0xea24('0x35')]?_0x281b41[_0xea24('0x34')]:_0x3b06ea[_0xea24('0x2f')];_0x281b41[_0xea24('0x37')]=qs[_0xea24('0x38')](_0x46c5e2[_0xea24('0x30')][_0xea24('0x38')]);_0x281b41['where']=qs['filters'](_[_0xea24('0x3b')](_0x46c5e2[_0xea24('0x30')],_0x3b06ea[_0xea24('0x3a')]));if(_0x46c5e2[_0xea24('0x30')][_0xea24('0x3c')]){_0x281b41[_0xea24('0x39')]=_[_0xea24('0x3d')](_0x281b41[_0xea24('0x39')],{'$or':_[_0xea24('0x2a')](_0x281b41['attributes'],function(_0x2c8c3f){var _0x41196d={};_0x41196d[_0x2c8c3f]={'$like':'%'+_0x46c5e2[_0xea24('0x30')][_0xea24('0x3c')]+'%'};return _0x41196d;})});}_0x281b41=_[_0xea24('0x3d')]({},_0x281b41,_0x46c5e2[_0xea24('0x3e')]);return _0x20827b['getDescriptions'](_0x281b41);}})[_0xea24('0x26')](function(_0x2a2685){if(_0x2a2685){_0xbadd64=_0x2a2685[_0xea24('0x35')];if(!_0x46c5e2['query']['hasOwnProperty'](_0xea24('0x4f'))){_0x281b41[_0xea24('0x1e')]=qs[_0xea24('0x1e')](_0x46c5e2[_0xea24('0x30')]['limit']);_0x281b41[_0xea24('0x1c')]=qs[_0xea24('0x1c')](_0x46c5e2[_0xea24('0x30')][_0xea24('0x1c')]);}return _0x20827b[_0xea24('0x51')](_0x281b41);}})[_0xea24('0x26')](function(_0x3a6d27){if(_0x3a6d27){return _0x3a6d27?{'count':_0xbadd64,'rows':_0x3a6d27}:null;}})['then'](respondWithResult(_0x17f9e0,null))[_0xea24('0x43')](handleError(_0x17f9e0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 6707e2a..2cd9847 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 _0x9b90=['exports','define','SalesforceConfiguration','int_salesforce_configurations','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5c72f4,_0x4ae090){var _0x494dd3=function(_0x25bf05){while(--_0x25bf05){_0x5c72f4['push'](_0x5c72f4['shift']());}};_0x494dd3(++_0x4ae090);}(_0x9b90,0x19b));var _0x09b9=function(_0x5ab1f9,_0x3f1ffe){_0x5ab1f9=_0x5ab1f9-0x0;var _0x506fcb=_0x9b90[_0x5ab1f9];return _0x506fcb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x09b9('0x0'))('api');var moment=require(_0x09b9('0x1'));var BPromise=require(_0x09b9('0x2'));var rp=require(_0x09b9('0x3'));var fs=require('fs');var path=require(_0x09b9('0x4'));var rimraf=require(_0x09b9('0x5'));var config=require(_0x09b9('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x09b9('0x7')]=function(_0x4a13c2,_0x43ea90){return _0x4a13c2[_0x09b9('0x8')](_0x09b9('0x9'),attributes,{'tableName':_0x09b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9aa0=['path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3213f6,_0x21d9ec){var _0x483b74=function(_0x245156){while(--_0x245156){_0x3213f6['push'](_0x3213f6['shift']());}};_0x483b74(++_0x21d9ec);}(_0x9aa0,0xa1));var _0x09aa=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9aa0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x09aa('0x0'));var util=require(_0x09aa('0x1'));var logger=require(_0x09aa('0x2'))(_0x09aa('0x3'));var moment=require(_0x09aa('0x4'));var BPromise=require(_0x09aa('0x5'));var rp=require(_0x09aa('0x6'));var fs=require('fs');var path=require(_0x09aa('0x7'));var rimraf=require(_0x09aa('0x8'));var config=require(_0x09aa('0x9'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x09aa('0xa')]=function(_0x59a9dc,_0x556d15){return _0x59a9dc[_0x09aa('0xb')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index aac16a1..897ea06 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 _0x8036=['http','info','request\x20sent','debug','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xed8e74,_0x3bb4c3){var _0x335632=function(_0x44fa07){while(--_0x44fa07){_0xed8e74['push'](_0xed8e74['shift']());}};_0x335632(++_0x3bb4c3);}(_0x8036,0x105));var _0x6803=function(_0x18490c,_0x4213a9){_0x18490c=_0x18490c-0x0;var _0x229226=_0x8036[_0x18490c];return _0x229226;};'use strict';var _=require(_0x6803('0x0'));var util=require(_0x6803('0x1'));var moment=require(_0x6803('0x2'));var BPromise=require(_0x6803('0x3'));var rs=require(_0x6803('0x4'));var fs=require('fs');var Redis=require(_0x6803('0x5'));var db=require(_0x6803('0x6'))['db'];var utils=require(_0x6803('0x7'));var logger=require(_0x6803('0x8'))(_0x6803('0x9'));var config=require(_0x6803('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6803('0xb')][_0x6803('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x546a2f,_0x31361b,_0x1a50fa){return new BPromise(function(_0x424fe3,_0x338c16){return client['request'](_0x546a2f,_0x1a50fa)['then'](function(_0x1cf8b7){logger[_0x6803('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x31361b,_0x6803('0xe'));logger[_0x6803('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x31361b,_0x6803('0xe'),JSON['stringify'](_0x1cf8b7));if(_0x1cf8b7['error']){if(_0x1cf8b7[_0x6803('0x10')][_0x6803('0x11')]===0x1f4){logger['error'](_0x6803('0x12'),_0x31361b,_0x1cf8b7['error'][_0x6803('0x13')]);return _0x338c16(_0x1cf8b7[_0x6803('0x10')]['message']);}logger[_0x6803('0x10')](_0x6803('0x12'),_0x31361b,_0x1cf8b7[_0x6803('0x10')][_0x6803('0x13')]);return _0x424fe3(_0x1cf8b7[_0x6803('0x10')][_0x6803('0x13')]);}else{logger[_0x6803('0xd')](_0x6803('0x12'),_0x31361b,_0x6803('0xe'));_0x424fe3(_0x1cf8b7['result'][_0x6803('0x13')]);}})[_0x6803('0x14')](function(_0x3f0ff7){logger[_0x6803('0x10')](_0x6803('0x12'),_0x31361b,_0x3f0ff7);_0x338c16(_0x3f0ff7);});});} \ No newline at end of file +var _0xe9b5=['request\x20sent','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xe9b5,0x16e));var _0x5e9b=function(_0x30d4c5,_0x20d44a){_0x30d4c5=_0x30d4c5-0x0;var _0x5ddbc2=_0xe9b5[_0x30d4c5];return _0x5ddbc2;};'use strict';var _=require('lodash');var util=require(_0x5e9b('0x0'));var moment=require(_0x5e9b('0x1'));var BPromise=require(_0x5e9b('0x2'));var rs=require(_0x5e9b('0x3'));var fs=require('fs');var Redis=require(_0x5e9b('0x4'));var db=require(_0x5e9b('0x5'))['db'];var utils=require(_0x5e9b('0x6'));var logger=require(_0x5e9b('0x7'))(_0x5e9b('0x8'));var config=require('../../config/environment');var jayson=require(_0x5e9b('0x9'));var client=jayson['client'][_0x5e9b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfaf841,_0x7f4f72,_0x319f91){return new BPromise(function(_0x3783c6,_0x88084a){return client[_0x5e9b('0xb')](_0xfaf841,_0x319f91)['then'](function(_0xec2179){logger[_0x5e9b('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x7f4f72,'request\x20sent');logger['debug'](_0x5e9b('0xd'),_0x7f4f72,_0x5e9b('0xe'),JSON['stringify'](_0xec2179));if(_0xec2179[_0x5e9b('0xf')]){if(_0xec2179[_0x5e9b('0xf')][_0x5e9b('0x10')]===0x1f4){logger[_0x5e9b('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x7f4f72,_0xec2179['error']['message']);return _0x88084a(_0xec2179['error'][_0x5e9b('0x11')]);}logger[_0x5e9b('0xf')](_0x5e9b('0x12'),_0x7f4f72,_0xec2179[_0x5e9b('0xf')]['message']);return _0x3783c6(_0xec2179[_0x5e9b('0xf')][_0x5e9b('0x11')]);}else{logger[_0x5e9b('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x7f4f72,_0x5e9b('0xe'));_0x3783c6(_0xec2179[_0x5e9b('0x13')]['message']);}})['catch'](function(_0x49a0bd){logger[_0x5e9b('0xf')](_0x5e9b('0x12'),_0x7f4f72,_0x49a0bd);_0x88084a(_0x49a0bd);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index e4bf6cd..dbeafaa 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 _0xa6df=['delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x2eb4d8,_0xd98b65){var _0x4dcb57=function(_0x316a04){while(--_0x316a04){_0x2eb4d8['push'](_0x2eb4d8['shift']());}};_0x4dcb57(++_0xd98b65);}(_0xa6df,0x1e9));var _0xfa6d=function(_0x5da805,_0x5320d5){_0x5da805=_0x5da805-0x0;var _0x11ffb1=_0xa6df[_0x5da805];return _0x11ffb1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfa6d('0x0'));var express=require(_0xfa6d('0x1'));var router=express[_0xfa6d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfa6d('0x3'));var interaction=require(_0xfa6d('0x4'));var config=require(_0xfa6d('0x5'));var controller=require(_0xfa6d('0x6'));router[_0xfa6d('0x7')]('/',auth[_0xfa6d('0x8')](),controller['index']);router[_0xfa6d('0x7')](_0xfa6d('0x9'),auth[_0xfa6d('0x8')](),controller[_0xfa6d('0xa')]);router[_0xfa6d('0xb')]('/',auth[_0xfa6d('0x8')](),controller[_0xfa6d('0xc')]);router[_0xfa6d('0xd')](_0xfa6d('0x9'),auth[_0xfa6d('0x8')](),controller[_0xfa6d('0xe')]);router[_0xfa6d('0xf')](_0xfa6d('0x9'),auth[_0xfa6d('0x8')](),controller[_0xfa6d('0x10')]);module[_0xfa6d('0x11')]=router; \ No newline at end of file +var _0x0814=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x0814,0x145));var _0x4081=function(_0x3f9a56,_0x140559){_0x3f9a56=_0x3f9a56-0x0;var _0x4dd5fd=_0x0814[_0x3f9a56];return _0x4dd5fd;};'use strict';var multer=require(_0x4081('0x0'));var util=require(_0x4081('0x1'));var path=require(_0x4081('0x2'));var timeout=require(_0x4081('0x3'));var express=require(_0x4081('0x4'));var router=express['Router']();var fs_extra=require(_0x4081('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4081('0x6'));var config=require(_0x4081('0x7'));var controller=require(_0x4081('0x8'));router[_0x4081('0x9')]('/',auth[_0x4081('0xa')](),controller[_0x4081('0xb')]);router[_0x4081('0x9')](_0x4081('0xc'),auth['isAuthenticated'](),controller[_0x4081('0xd')]);router[_0x4081('0xe')]('/',auth[_0x4081('0xa')](),controller[_0x4081('0xf')]);router[_0x4081('0x10')](_0x4081('0xc'),auth[_0x4081('0xa')](),controller['update']);router[_0x4081('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x4081('0x12')]);module[_0x4081('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 750135d..ed03c76 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 _0x39bd=['picklist','STRING','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5cde56,_0x2b507f){var _0x184d13=function(_0x5d8549){while(--_0x5d8549){_0x5cde56['push'](_0x5cde56['shift']());}};_0x184d13(++_0x2b507f);}(_0x39bd,0x12a));var _0xd39b=function(_0x59188a,_0x1a196e){_0x59188a=_0x59188a-0x0;var _0x39ebd3=_0x39bd[_0x59188a];return _0x39ebd3;};'use strict';var Sequelize=require('sequelize');module[_0xd39b('0x0')]={'type':{'type':Sequelize[_0xd39b('0x1')](_0xd39b('0x2'),_0xd39b('0x3'),_0xd39b('0x4'),_0xd39b('0x5'),_0xd39b('0x6')),'defaultValue':_0xd39b('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd39b('0x7')]},'keyType':{'type':Sequelize[_0xd39b('0x1')]('string',_0xd39b('0x3'),_0xd39b('0x4'))},'keyContent':{'type':Sequelize[_0xd39b('0x7')]},'idField':{'type':Sequelize[_0xd39b('0x7')]},'variableName':{'type':Sequelize[_0xd39b('0x7')]}}; \ No newline at end of file +var _0x1474=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x5d1629,_0x253b93){var _0x5f219d=function(_0x286eb4){while(--_0x286eb4){_0x5d1629['push'](_0x5d1629['shift']());}};_0x5f219d(++_0x253b93);}(_0x1474,0x17a));var _0x4147=function(_0x466a1a,_0x37933b){_0x466a1a=_0x466a1a-0x0;var _0x577165=_0x1474[_0x466a1a];return _0x577165;};'use strict';var Sequelize=require(_0x4147('0x0'));module[_0x4147('0x1')]={'type':{'type':Sequelize[_0x4147('0x2')](_0x4147('0x3'),_0x4147('0x4'),_0x4147('0x5'),_0x4147('0x6'),_0x4147('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4147('0x8')]},'key':{'type':Sequelize[_0x4147('0x8')]},'keyType':{'type':Sequelize[_0x4147('0x2')](_0x4147('0x3'),_0x4147('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4147('0x8')]},'variableName':{'type':Sequelize[_0x4147('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 7c7db78..887ec38 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 _0xd603=['to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','apply','update','then','destroy','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','include','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x58d902,_0x47d2c4){var _0x23f064=function(_0x16a025){while(--_0x16a025){_0x58d902['push'](_0x58d902['shift']());}};_0x23f064(++_0x47d2c4);}(_0xd603,0x1e7));var _0x3d60=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0xd603[_0x309d93];return _0x2dd61d;};'use strict';var emlformat=require(_0x3d60('0x0'));var rimraf=require(_0x3d60('0x1'));var zipdir=require(_0x3d60('0x2'));var jsonpatch=require(_0x3d60('0x3'));var rp=require('request-promise');var moment=require(_0x3d60('0x4'));var BPromise=require(_0x3d60('0x5'));var Mustache=require(_0x3d60('0x6'));var util=require(_0x3d60('0x7'));var path=require(_0x3d60('0x8'));var sox=require(_0x3d60('0x9'));var csv=require(_0x3d60('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d60('0xb'));var _=require(_0x3d60('0xc'));var squel=require(_0x3d60('0xd'));var crypto=require(_0x3d60('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3d60('0xf'));var toCsv=require(_0x3d60('0xa'));var querystring=require(_0x3d60('0x10'));var Papa=require(_0x3d60('0x11'));var Redis=require(_0x3d60('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3d60('0x13'));var as=require(_0x3d60('0x14'));var hardwareService=require(_0x3d60('0x15'));var logger=require(_0x3d60('0x16'))('api');var utils=require(_0x3d60('0x17'));var config=require(_0x3d60('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d60('0x19'))['db'];function respondWithStatusCode(_0x507ba2,_0xcb2321){_0xcb2321=_0xcb2321||0xcc;return function(_0x1baec1){if(_0x1baec1){return _0x507ba2[_0x3d60('0x1a')](_0xcb2321);}return _0x507ba2[_0x3d60('0x1b')](_0xcb2321)[_0x3d60('0x1c')]();};}function respondWithResult(_0x5a92d8,_0x13eed6){_0x13eed6=_0x13eed6||0xc8;return function(_0x3a755a){if(_0x3a755a){return _0x5a92d8['status'](_0x13eed6)[_0x3d60('0x1d')](_0x3a755a);}};}function respondWithFilteredResult(_0xe5e9a7,_0x1af567){return function(_0x49341e){if(_0x49341e){var _0x4c639e=typeof _0x1af567['offset']===_0x3d60('0x1e')&&typeof _0x1af567['limit']===_0x3d60('0x1e');var _0x5b1e94=_0x49341e['count'];var _0x296a45=_0x4c639e?0x0:_0x1af567['offset'];var _0x5160f7=_0x4c639e?_0x49341e['count']:_0x1af567[_0x3d60('0x1f')]+_0x1af567[_0x3d60('0x20')];var _0x36b9a7;if(_0x5160f7>=_0x5b1e94){_0x5160f7=_0x5b1e94;_0x36b9a7=0xc8;}else{_0x36b9a7=0xce;}_0xe5e9a7['status'](_0x36b9a7);return _0xe5e9a7[_0x3d60('0x21')]('Content-Range',_0x296a45+'-'+_0x5160f7+'/'+_0x5b1e94)[_0x3d60('0x1d')](_0x49341e);}return null;};}function patchUpdates(_0x1f4358){return function(_0x4a9e9c){try{jsonpatch[_0x3d60('0x22')](_0x4a9e9c,_0x1f4358,!![]);}catch(_0x2d1e40){return BPromise['reject'](_0x2d1e40);}return _0x4a9e9c['save']();};}function saveUpdates(_0x34ecd8,_0x262198){return function(_0x186f3f){if(_0x186f3f){return _0x186f3f[_0x3d60('0x23')](_0x34ecd8)[_0x3d60('0x24')](function(_0x44f270){return _0x44f270;});}return null;};}function removeEntity(_0x577cf5,_0xa4e2c3){return function(_0x795440){if(_0x795440){return _0x795440[_0x3d60('0x25')]()[_0x3d60('0x24')](function(){_0x577cf5['status'](0xcc)[_0x3d60('0x1c')]();});}};}function handleEntityNotFound(_0x110327,_0x122c5e){return function(_0x220873){if(!_0x220873){_0x110327['sendStatus'](0x194);}return _0x220873;};}function handleError(_0x2b46d6,_0xc80ddb){_0xc80ddb=_0xc80ddb||0x1f4;return function(_0x387623){logger['error'](_0x387623['stack']);if(_0x387623[_0x3d60('0x26')]){delete _0x387623[_0x3d60('0x26')];}_0x2b46d6[_0x3d60('0x1b')](_0xc80ddb)[_0x3d60('0x27')](_0x387623);};}exports[_0x3d60('0x28')]=function(_0x40b4ac,_0xe1dd15){var _0x5d22f8={},_0x43b1cc={},_0x316494={'count':0x0,'rows':[]};var _0x23efd3=_[_0x3d60('0x29')](db[_0x3d60('0x2a')][_0x3d60('0x2b')],function(_0x265683){return{'name':_0x265683[_0x3d60('0x2c')],'type':_0x265683[_0x3d60('0x2d')][_0x3d60('0x2e')]};});_0x43b1cc[_0x3d60('0x2f')]=_[_0x3d60('0x29')](_0x23efd3,'name');_0x43b1cc[_0x3d60('0x30')]=_[_0x3d60('0x31')](_0x40b4ac['query']);_0x43b1cc[_0x3d60('0x32')]=_['intersection'](_0x43b1cc[_0x3d60('0x2f')],_0x43b1cc['query']);_0x5d22f8[_0x3d60('0x33')]=_[_0x3d60('0x34')](_0x43b1cc[_0x3d60('0x2f')],qs[_0x3d60('0x35')](_0x40b4ac[_0x3d60('0x30')][_0x3d60('0x35')]));_0x5d22f8['attributes']=_0x5d22f8[_0x3d60('0x33')][_0x3d60('0x36')]?_0x5d22f8[_0x3d60('0x33')]:_0x43b1cc['model'];if(!_0x40b4ac[_0x3d60('0x30')]['hasOwnProperty'](_0x3d60('0x37'))){_0x5d22f8['limit']=qs['limit'](_0x40b4ac[_0x3d60('0x30')][_0x3d60('0x20')]);_0x5d22f8[_0x3d60('0x1f')]=qs[_0x3d60('0x1f')](_0x40b4ac['query'][_0x3d60('0x1f')]);}_0x5d22f8['order']=qs[_0x3d60('0x38')](_0x40b4ac[_0x3d60('0x30')][_0x3d60('0x38')]);_0x5d22f8[_0x3d60('0x39')]=qs[_0x3d60('0x32')](_['pick'](_0x40b4ac['query'],_0x43b1cc[_0x3d60('0x32')]),_0x23efd3);if(_0x40b4ac['query']['filter']){_0x5d22f8[_0x3d60('0x39')]=_['merge'](_0x5d22f8['where'],{'$or':_[_0x3d60('0x29')](_0x23efd3,function(_0x1ec028){if(_0x1ec028[_0x3d60('0x2d')]!==_0x3d60('0x3a')){var _0x46d35f={};_0x46d35f[_0x1ec028[_0x3d60('0x26')]]={'$like':'%'+_0x40b4ac[_0x3d60('0x30')]['filter']+'%'};return _0x46d35f;}})});}_0x5d22f8=_[_0x3d60('0x3b')]({},_0x5d22f8,_0x40b4ac[_0x3d60('0x3c')]);var _0x1161e6={'where':_0x5d22f8[_0x3d60('0x39')]};return db[_0x3d60('0x2a')]['count'](_0x1161e6)[_0x3d60('0x24')](function(_0x53a227){_0x316494[_0x3d60('0x3d')]=_0x53a227;if(_0x40b4ac[_0x3d60('0x30')][_0x3d60('0x3e')]){_0x5d22f8['include']=[{'all':!![]}];}return db['SalesforceField'][_0x3d60('0x3f')](_0x5d22f8);})[_0x3d60('0x24')](function(_0x38e583){_0x316494[_0x3d60('0x40')]=_0x38e583;return _0x316494;})[_0x3d60('0x24')](respondWithFilteredResult(_0xe1dd15,_0x5d22f8))[_0x3d60('0x41')](handleError(_0xe1dd15,null));};exports[_0x3d60('0x42')]=function(_0x173fc7,_0x34694e){var _0x463b37={'raw':!![],'where':{'id':_0x173fc7['params']['id']}},_0x27404a={};_0x27404a['model']=_[_0x3d60('0x31')](db[_0x3d60('0x2a')][_0x3d60('0x2b')]);_0x27404a[_0x3d60('0x30')]=_['keys'](_0x173fc7['query']);_0x27404a[_0x3d60('0x32')]=_[_0x3d60('0x34')](_0x27404a[_0x3d60('0x2f')],_0x27404a[_0x3d60('0x30')]);_0x463b37[_0x3d60('0x33')]=_[_0x3d60('0x34')](_0x27404a[_0x3d60('0x2f')],qs[_0x3d60('0x35')](_0x173fc7[_0x3d60('0x30')][_0x3d60('0x35')]));_0x463b37[_0x3d60('0x33')]=_0x463b37['attributes'][_0x3d60('0x36')]?_0x463b37[_0x3d60('0x33')]:_0x27404a['model'];if(_0x173fc7['query'][_0x3d60('0x3e')]){_0x463b37[_0x3d60('0x43')]=[{'all':!![]}];}_0x463b37=_[_0x3d60('0x3b')]({},_0x463b37,_0x173fc7[_0x3d60('0x3c')]);return db[_0x3d60('0x2a')]['find'](_0x463b37)['then'](handleEntityNotFound(_0x34694e,null))['then'](respondWithResult(_0x34694e,null))[_0x3d60('0x41')](handleError(_0x34694e,null));};exports[_0x3d60('0x44')]=function(_0x77343d,_0x1fe02e){return db[_0x3d60('0x2a')][_0x3d60('0x44')](_0x77343d['body'],{})[_0x3d60('0x24')](respondWithResult(_0x1fe02e,0xc9))[_0x3d60('0x41')](handleError(_0x1fe02e,null));};exports[_0x3d60('0x23')]=function(_0x5a0907,_0x11a327){if(_0x5a0907[_0x3d60('0x45')]['id']){delete _0x5a0907[_0x3d60('0x45')]['id'];}return db[_0x3d60('0x2a')]['find']({'where':{'id':_0x5a0907[_0x3d60('0x46')]['id']}})[_0x3d60('0x24')](handleEntityNotFound(_0x11a327,null))[_0x3d60('0x24')](saveUpdates(_0x5a0907[_0x3d60('0x45')],null))[_0x3d60('0x24')](respondWithResult(_0x11a327,null))[_0x3d60('0x41')](handleError(_0x11a327,null));};exports[_0x3d60('0x25')]=function(_0x3a2c56,_0x1d9da4){return db[_0x3d60('0x2a')]['find']({'where':{'id':_0x3a2c56[_0x3d60('0x46')]['id']}})[_0x3d60('0x24')](handleEntityNotFound(_0x1d9da4,null))[_0x3d60('0x24')](removeEntity(_0x1d9da4,null))[_0x3d60('0x41')](handleError(_0x1d9da4,null));}; \ No newline at end of file +var _0x6a75=['pick','filters','filter','merge','VIRTUAL','includeAll','rows','catch','show','keys','include','options','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6a75,0x18c));var _0x56a7=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x6a75[_0xfa634c];return _0x73e478;};'use strict';var emlformat=require(_0x56a7('0x0'));var rimraf=require(_0x56a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x56a7('0x2'));var rp=require(_0x56a7('0x3'));var moment=require(_0x56a7('0x4'));var BPromise=require(_0x56a7('0x5'));var Mustache=require('mustache');var util=require(_0x56a7('0x6'));var path=require(_0x56a7('0x7'));var sox=require('sox');var csv=require(_0x56a7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56a7('0x9'));var _=require(_0x56a7('0xa'));var squel=require(_0x56a7('0xb'));var crypto=require(_0x56a7('0xc'));var jsforce=require(_0x56a7('0xd'));var deskjs=require(_0x56a7('0xe'));var toCsv=require(_0x56a7('0x8'));var querystring=require(_0x56a7('0xf'));var Papa=require('papaparse');var Redis=require(_0x56a7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x56a7('0x11'));var as=require(_0x56a7('0x12'));var hardwareService=require(_0x56a7('0x13'));var logger=require(_0x56a7('0x14'))(_0x56a7('0x15'));var utils=require(_0x56a7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x56a7('0x17'));var db=require(_0x56a7('0x18'))['db'];function respondWithStatusCode(_0x4c882b,_0x533e91){_0x533e91=_0x533e91||0xcc;return function(_0xd88ea8){if(_0xd88ea8){return _0x4c882b[_0x56a7('0x19')](_0x533e91);}return _0x4c882b[_0x56a7('0x1a')](_0x533e91)[_0x56a7('0x1b')]();};}function respondWithResult(_0x252dee,_0x1f1a74){_0x1f1a74=_0x1f1a74||0xc8;return function(_0x3595a9){if(_0x3595a9){return _0x252dee[_0x56a7('0x1a')](_0x1f1a74)[_0x56a7('0x1c')](_0x3595a9);}};}function respondWithFilteredResult(_0xf10721,_0x2dea9e){return function(_0x4dceba){if(_0x4dceba){var _0x536330=typeof _0x2dea9e['offset']===_0x56a7('0x1d')&&typeof _0x2dea9e[_0x56a7('0x1e')]==='undefined';var _0x40f118=_0x4dceba[_0x56a7('0x1f')];var _0x3e0f69=_0x536330?0x0:_0x2dea9e[_0x56a7('0x20')];var _0x596f60=_0x536330?_0x4dceba['count']:_0x2dea9e[_0x56a7('0x20')]+_0x2dea9e['limit'];var _0x857497;if(_0x596f60>=_0x40f118){_0x596f60=_0x40f118;_0x857497=0xc8;}else{_0x857497=0xce;}_0xf10721[_0x56a7('0x1a')](_0x857497);return _0xf10721[_0x56a7('0x21')]('Content-Range',_0x3e0f69+'-'+_0x596f60+'/'+_0x40f118)['json'](_0x4dceba);}return null;};}function patchUpdates(_0x3bec75){return function(_0x433459){try{jsonpatch[_0x56a7('0x22')](_0x433459,_0x3bec75,!![]);}catch(_0x78f931){return BPromise['reject'](_0x78f931);}return _0x433459[_0x56a7('0x23')]();};}function saveUpdates(_0x336216,_0x22658c){return function(_0x26da79){if(_0x26da79){return _0x26da79[_0x56a7('0x24')](_0x336216)[_0x56a7('0x25')](function(_0x2347e0){return _0x2347e0;});}return null;};}function removeEntity(_0x1fe9f2,_0x2b3451){return function(_0x40b63b){if(_0x40b63b){return _0x40b63b[_0x56a7('0x26')]()[_0x56a7('0x25')](function(){_0x1fe9f2['status'](0xcc)[_0x56a7('0x1b')]();});}};}function handleEntityNotFound(_0x6d50c2,_0x1d0e57){return function(_0x4e3cd0){if(!_0x4e3cd0){_0x6d50c2[_0x56a7('0x19')](0x194);}return _0x4e3cd0;};}function handleError(_0x4cb07e,_0x40a06b){_0x40a06b=_0x40a06b||0x1f4;return function(_0x156700){logger[_0x56a7('0x27')](_0x156700[_0x56a7('0x28')]);if(_0x156700[_0x56a7('0x29')]){delete _0x156700[_0x56a7('0x29')];}_0x4cb07e[_0x56a7('0x1a')](_0x40a06b)[_0x56a7('0x2a')](_0x156700);};}exports[_0x56a7('0x2b')]=function(_0x36c932,_0x42f778){var _0x48821c={},_0x52a4e0={},_0x2ef07f={'count':0x0,'rows':[]};var _0x933585=_['map'](db[_0x56a7('0x2c')][_0x56a7('0x2d')],function(_0x334289){return{'name':_0x334289[_0x56a7('0x2e')],'type':_0x334289[_0x56a7('0x2f')][_0x56a7('0x30')]};});_0x52a4e0[_0x56a7('0x31')]=_[_0x56a7('0x32')](_0x933585,'name');_0x52a4e0[_0x56a7('0x33')]=_['keys'](_0x36c932[_0x56a7('0x33')]);_0x52a4e0['filters']=_[_0x56a7('0x34')](_0x52a4e0['model'],_0x52a4e0[_0x56a7('0x33')]);_0x48821c[_0x56a7('0x35')]=_[_0x56a7('0x34')](_0x52a4e0[_0x56a7('0x31')],qs[_0x56a7('0x36')](_0x36c932[_0x56a7('0x33')][_0x56a7('0x36')]));_0x48821c[_0x56a7('0x35')]=_0x48821c[_0x56a7('0x35')][_0x56a7('0x37')]?_0x48821c[_0x56a7('0x35')]:_0x52a4e0['model'];if(!_0x36c932[_0x56a7('0x33')]['hasOwnProperty'](_0x56a7('0x38'))){_0x48821c['limit']=qs[_0x56a7('0x1e')](_0x36c932['query'][_0x56a7('0x1e')]);_0x48821c[_0x56a7('0x20')]=qs[_0x56a7('0x20')](_0x36c932[_0x56a7('0x33')][_0x56a7('0x20')]);}_0x48821c[_0x56a7('0x39')]=qs[_0x56a7('0x3a')](_0x36c932['query'][_0x56a7('0x3a')]);_0x48821c[_0x56a7('0x3b')]=qs['filters'](_[_0x56a7('0x3c')](_0x36c932[_0x56a7('0x33')],_0x52a4e0[_0x56a7('0x3d')]),_0x933585);if(_0x36c932[_0x56a7('0x33')][_0x56a7('0x3e')]){_0x48821c[_0x56a7('0x3b')]=_[_0x56a7('0x3f')](_0x48821c[_0x56a7('0x3b')],{'$or':_['map'](_0x933585,function(_0x54982a){if(_0x54982a[_0x56a7('0x2f')]!==_0x56a7('0x40')){var _0x45d377={};_0x45d377[_0x54982a[_0x56a7('0x29')]]={'$like':'%'+_0x36c932[_0x56a7('0x33')][_0x56a7('0x3e')]+'%'};return _0x45d377;}})});}_0x48821c=_[_0x56a7('0x3f')]({},_0x48821c,_0x36c932['options']);var _0x4aa2c7={'where':_0x48821c[_0x56a7('0x3b')]};return db[_0x56a7('0x2c')][_0x56a7('0x1f')](_0x4aa2c7)[_0x56a7('0x25')](function(_0x547416){_0x2ef07f[_0x56a7('0x1f')]=_0x547416;if(_0x36c932[_0x56a7('0x33')][_0x56a7('0x41')]){_0x48821c['include']=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x48821c);})[_0x56a7('0x25')](function(_0x379842){_0x2ef07f[_0x56a7('0x42')]=_0x379842;return _0x2ef07f;})[_0x56a7('0x25')](respondWithFilteredResult(_0x42f778,_0x48821c))[_0x56a7('0x43')](handleError(_0x42f778,null));};exports[_0x56a7('0x44')]=function(_0x26c210,_0x25f98f){var _0x16c9e7={'raw':!![],'where':{'id':_0x26c210['params']['id']}},_0x29b1ec={};_0x29b1ec[_0x56a7('0x31')]=_['keys'](db[_0x56a7('0x2c')][_0x56a7('0x2d')]);_0x29b1ec[_0x56a7('0x33')]=_[_0x56a7('0x45')](_0x26c210[_0x56a7('0x33')]);_0x29b1ec[_0x56a7('0x3d')]=_[_0x56a7('0x34')](_0x29b1ec[_0x56a7('0x31')],_0x29b1ec['query']);_0x16c9e7[_0x56a7('0x35')]=_[_0x56a7('0x34')](_0x29b1ec[_0x56a7('0x31')],qs[_0x56a7('0x36')](_0x26c210[_0x56a7('0x33')]['fields']));_0x16c9e7[_0x56a7('0x35')]=_0x16c9e7[_0x56a7('0x35')][_0x56a7('0x37')]?_0x16c9e7[_0x56a7('0x35')]:_0x29b1ec[_0x56a7('0x31')];if(_0x26c210[_0x56a7('0x33')][_0x56a7('0x41')]){_0x16c9e7[_0x56a7('0x46')]=[{'all':!![]}];}_0x16c9e7=_['merge']({},_0x16c9e7,_0x26c210[_0x56a7('0x47')]);return db[_0x56a7('0x2c')]['find'](_0x16c9e7)[_0x56a7('0x25')](handleEntityNotFound(_0x25f98f,null))['then'](respondWithResult(_0x25f98f,null))[_0x56a7('0x43')](handleError(_0x25f98f,null));};exports['create']=function(_0x33f656,_0x2c9b21){return db['SalesforceField'][_0x56a7('0x48')](_0x33f656[_0x56a7('0x49')],{})['then'](respondWithResult(_0x2c9b21,0xc9))[_0x56a7('0x43')](handleError(_0x2c9b21,null));};exports['update']=function(_0x198ab8,_0x4cd564){if(_0x198ab8[_0x56a7('0x49')]['id']){delete _0x198ab8[_0x56a7('0x49')]['id'];}return db[_0x56a7('0x2c')][_0x56a7('0x4a')]({'where':{'id':_0x198ab8[_0x56a7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4cd564,null))[_0x56a7('0x25')](saveUpdates(_0x198ab8[_0x56a7('0x49')],null))[_0x56a7('0x25')](respondWithResult(_0x4cd564,null))[_0x56a7('0x43')](handleError(_0x4cd564,null));};exports[_0x56a7('0x26')]=function(_0x4b6478,_0x1b6beb){return db[_0x56a7('0x2c')][_0x56a7('0x4a')]({'where':{'id':_0x4b6478[_0x56a7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1b6beb,null))[_0x56a7('0x25')](removeEntity(_0x1b6beb,null))[_0x56a7('0x43')](handleError(_0x1b6beb,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 88c25f0..1406101 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 _0x196d=['exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','path','rimraf','./intSalesforceField.attributes'];(function(_0x559e02,_0x43f1ef){var _0x32e154=function(_0x2a6d5d){while(--_0x2a6d5d){_0x559e02['push'](_0x559e02['shift']());}};_0x32e154(++_0x43f1ef);}(_0x196d,0xd9));var _0xd196=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x196d[_0x1477ef];return _0x164acd;};'use strict';var _=require(_0xd196('0x0'));var util=require(_0xd196('0x1'));var logger=require(_0xd196('0x2'))('api');var moment=require(_0xd196('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd196('0x4'));var rimraf=require(_0xd196('0x5'));var config=require('../../config/environment');var attributes=require(_0xd196('0x6'));module[_0xd196('0x7')]=function(_0x33a389,_0xd02d38){return _0x33a389[_0xd196('0x8')](_0xd196('0x9'),attributes,{'tableName':_0xd196('0xa'),'paranoid':![],'indexes':[{'name':_0xd196('0xb'),'fields':[_0xd196('0xc'),_0xd196('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f8f=['SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define'];(function(_0x29caec,_0x16b241){var _0x1b9aea=function(_0x1c4bb5){while(--_0x1c4bb5){_0x29caec['push'](_0x29caec['shift']());}};_0x1b9aea(++_0x16b241);}(_0x9f8f,0x18c));var _0xf9f8=function(_0xef1a8f,_0xa5b7ee){_0xef1a8f=_0xef1a8f-0x0;var _0xcfc9d5=_0x9f8f[_0xef1a8f];return _0xcfc9d5;};'use strict';var _=require(_0xf9f8('0x0'));var util=require(_0xf9f8('0x1'));var logger=require(_0xf9f8('0x2'))('api');var moment=require(_0xf9f8('0x3'));var BPromise=require(_0xf9f8('0x4'));var rp=require(_0xf9f8('0x5'));var fs=require('fs');var path=require(_0xf9f8('0x6'));var rimraf=require(_0xf9f8('0x7'));var config=require(_0xf9f8('0x8'));var attributes=require(_0xf9f8('0x9'));module[_0xf9f8('0xa')]=function(_0xe00fc3,_0x2c70af){return _0xe00fc3[_0xf9f8('0xb')](_0xf9f8('0xc'),attributes,{'tableName':_0xf9f8('0xd'),'paranoid':![],'indexes':[{'name':_0xf9f8('0xe'),'fields':[_0xf9f8('0xf'),_0xf9f8('0x10')],'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 10811ce..a8fc1a8 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 _0x5603=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5603,0x64));var _0x3560=function(_0x5383e7,_0x3052ee){_0x5383e7=_0x5383e7-0x0;var _0x513eb3=_0x5603[_0x5383e7];return _0x513eb3;};'use strict';var _=require(_0x3560('0x0'));var util=require(_0x3560('0x1'));var moment=require(_0x3560('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3560('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3560('0x4'));var logger=require(_0x3560('0x5'))(_0x3560('0x6'));var config=require(_0x3560('0x7'));var jayson=require(_0x3560('0x8'));var client=jayson[_0x3560('0x9')][_0x3560('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea250,_0x1fafa5,_0x385b52){return new BPromise(function(_0x34340a,_0x14c202){return client['request'](_0x4ea250,_0x385b52)[_0x3560('0xb')](function(_0x37f3eb){logger[_0x3560('0xc')]('SalesforceField,\x20%s,\x20%s',_0x1fafa5,_0x3560('0xd'));logger[_0x3560('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x1fafa5,_0x3560('0xd'),JSON[_0x3560('0xf')](_0x37f3eb));if(_0x37f3eb[_0x3560('0x10')]){if(_0x37f3eb[_0x3560('0x10')][_0x3560('0x11')]===0x1f4){logger[_0x3560('0x10')]('SalesforceField,\x20%s,\x20%s',_0x1fafa5,_0x37f3eb[_0x3560('0x10')]['message']);return _0x14c202(_0x37f3eb['error'][_0x3560('0x12')]);}logger[_0x3560('0x10')]('SalesforceField,\x20%s,\x20%s',_0x1fafa5,_0x37f3eb[_0x3560('0x10')][_0x3560('0x12')]);return _0x34340a(_0x37f3eb[_0x3560('0x10')]['message']);}else{logger[_0x3560('0xc')]('SalesforceField,\x20%s,\x20%s',_0x1fafa5,_0x3560('0xd'));_0x34340a(_0x37f3eb[_0x3560('0x13')]['message']);}})[_0x3560('0x14')](function(_0x44a81e){logger['error']('SalesforceField,\x20%s,\x20%s',_0x1fafa5,_0x44a81e);_0x14c202(_0x44a81e);});});} \ No newline at end of file +var _0x8207=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x8207,0x83));var _0x7820=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8207[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x7820('0x0'));var moment=require(_0x7820('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7820('0x2'));var db=require(_0x7820('0x3'))['db'];var utils=require(_0x7820('0x4'));var logger=require(_0x7820('0x5'))(_0x7820('0x6'));var config=require('../../config/environment');var jayson=require(_0x7820('0x7'));var client=jayson['client'][_0x7820('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44428d,_0x263b46,_0x1916f4){return new BPromise(function(_0x214070,_0x4e2586){return client[_0x7820('0x9')](_0x44428d,_0x1916f4)[_0x7820('0xa')](function(_0x1fb562){logger['info'](_0x7820('0xb'),_0x263b46,'request\x20sent');logger[_0x7820('0xc')](_0x7820('0xd'),_0x263b46,_0x7820('0xe'),JSON[_0x7820('0xf')](_0x1fb562));if(_0x1fb562['error']){if(_0x1fb562[_0x7820('0x10')][_0x7820('0x11')]===0x1f4){logger[_0x7820('0x10')](_0x7820('0xb'),_0x263b46,_0x1fb562[_0x7820('0x10')][_0x7820('0x12')]);return _0x4e2586(_0x1fb562[_0x7820('0x10')]['message']);}logger[_0x7820('0x10')](_0x7820('0xb'),_0x263b46,_0x1fb562[_0x7820('0x10')][_0x7820('0x12')]);return _0x214070(_0x1fb562[_0x7820('0x10')][_0x7820('0x12')]);}else{logger[_0x7820('0x13')](_0x7820('0xb'),_0x263b46,'request\x20sent');_0x214070(_0x1fb562[_0x7820('0x14')][_0x7820('0x12')]);}})[_0x7820('0x15')](function(_0x49c62f){logger[_0x7820('0x10')]('SalesforceField,\x20%s,\x20%s',_0x263b46,_0x49c62f);_0x4e2586(_0x49c62f);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 432d7dd..3749488 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 _0xb268=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','create','post','addConfiguration','/:id'];(function(_0x2215cc,_0x4a6f75){var _0x34ecf4=function(_0xb33077){while(--_0xb33077){_0x2215cc['push'](_0x2215cc['shift']());}};_0x34ecf4(++_0x4a6f75);}(_0xb268,0x114));var _0x8b26=function(_0x5310c7,_0x44e980){_0x5310c7=_0x5310c7-0x0;var _0x117543=_0xb268[_0x5310c7];return _0x117543;};'use strict';var multer=require(_0x8b26('0x0'));var util=require(_0x8b26('0x1'));var path=require(_0x8b26('0x2'));var timeout=require(_0x8b26('0x3'));var express=require(_0x8b26('0x4'));var router=express[_0x8b26('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8b26('0x6'));var config=require(_0x8b26('0x7'));var controller=require(_0x8b26('0x8'));router[_0x8b26('0x9')]('/',auth[_0x8b26('0xa')](),controller['index']);router[_0x8b26('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8b26('0xb')]);router[_0x8b26('0x9')](_0x8b26('0xc'),auth[_0x8b26('0xa')](),controller[_0x8b26('0xd')]);router[_0x8b26('0x9')]('/:id/fields',auth[_0x8b26('0xa')](),controller['getFields']);router['post']('/',auth[_0x8b26('0xa')](),controller[_0x8b26('0xe')]);router[_0x8b26('0xf')]('/:id/configurations',auth[_0x8b26('0xa')](),controller[_0x8b26('0x10')]);router['put'](_0x8b26('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x8b26('0x12')](_0x8b26('0x11'),auth[_0x8b26('0xa')](),controller[_0x8b26('0x13')]);module[_0x8b26('0x14')]=router; \ No newline at end of file +var _0x8e0d=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x253b37,_0x34107b){var _0x523716=function(_0x1b5fa6){while(--_0x1b5fa6){_0x253b37['push'](_0x253b37['shift']());}};_0x523716(++_0x34107b);}(_0x8e0d,0x82));var _0xd8e0=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0x8e0d[_0x3a1ea5];return _0xfac9b2;};'use strict';var multer=require(_0xd8e0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd8e0('0x1'));var express=require(_0xd8e0('0x2'));var router=express['Router']();var fs_extra=require(_0xd8e0('0x3'));var auth=require(_0xd8e0('0x4'));var interaction=require(_0xd8e0('0x5'));var config=require(_0xd8e0('0x6'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0xd8e0('0x7')](),controller[_0xd8e0('0x8')]);router[_0xd8e0('0x9')](_0xd8e0('0xa'),auth['isAuthenticated'](),controller[_0xd8e0('0xb')]);router[_0xd8e0('0x9')](_0xd8e0('0xc'),auth[_0xd8e0('0x7')](),controller[_0xd8e0('0xd')]);router['get'](_0xd8e0('0xe'),auth['isAuthenticated'](),controller[_0xd8e0('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd8e0('0x10')]);router[_0xd8e0('0x11')](_0xd8e0('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xd8e0('0x12')]('/:id',auth[_0xd8e0('0x7')](),controller['update']);router['delete']('/:id',auth[_0xd8e0('0x7')](),controller['destroy']);module[_0xd8e0('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 0371588..89ea8fa 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 _0x6929=['exports','STRING','username','remoteUri'];(function(_0x19cc94,_0x3e4faf){var _0x48386b=function(_0x37d6f3){while(--_0x37d6f3){_0x19cc94['push'](_0x19cc94['shift']());}};_0x48386b(++_0x3e4faf);}(_0x6929,0xa4));var _0x9692=function(_0x11880b,_0x129bb9){_0x11880b=_0x11880b-0x0;var _0x1a1df0=_0x6929[_0x11880b];return _0x1a1df0;};'use strict';var Sequelize=require('sequelize');module[_0x9692('0x0')]={'name':{'type':Sequelize[_0x9692('0x1')]},'description':{'type':Sequelize[_0x9692('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x9692('0x2')},'password':{'type':Sequelize[_0x9692('0x1')]},'email':{'type':Sequelize[_0x9692('0x1')]},'remoteUri':{'type':Sequelize[_0x9692('0x1')],'unique':_0x9692('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x7856=['sequelize','STRING','username','remoteUri'];(function(_0x910161,_0x4c6908){var _0x2d68d1=function(_0x2584bf){while(--_0x2584bf){_0x910161['push'](_0x910161['shift']());}};_0x2d68d1(++_0x4c6908);}(_0x7856,0x178));var _0x6785=function(_0x48965f,_0x5e02cf){_0x48965f=_0x48965f-0x0;var _0xad42e9=_0x7856[_0x48965f];return _0xad42e9;};'use strict';var Sequelize=require(_0x6785('0x0'));module['exports']={'name':{'type':Sequelize[_0x6785('0x1')]},'description':{'type':Sequelize[_0x6785('0x1')]},'username':{'type':Sequelize[_0x6785('0x1')],'unique':_0x6785('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6785('0x1')]},'remoteUri':{'type':Sequelize[_0x6785('0x1')],'unique':_0x6785('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 b49fa42..29b055c 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 _0x82a6=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','hold_reason','number','resolved_by','opened_by','user_input','sys_created_on','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','time_worked','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','problem_id','company','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','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','forEach','all','assign','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','label','push','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','Content-Range','json','reject','update','then','destroy','error','stack','send','index','ServicenowAccount','rawAttributes','fieldName','key','map','name','query','keys','filters'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x82a6,0x13e));var _0x682a=function(_0x48fe2c,_0x54f6d5){_0x48fe2c=_0x48fe2c-0x0;var _0x21fd7f=_0x82a6[_0x48fe2c];return _0x21fd7f;};'use strict';var emlformat=require(_0x682a('0x0'));var rimraf=require(_0x682a('0x1'));var zipdir=require(_0x682a('0x2'));var jsonpatch=require(_0x682a('0x3'));var rp=require(_0x682a('0x4'));var moment=require('moment');var BPromise=require(_0x682a('0x5'));var Mustache=require(_0x682a('0x6'));var util=require(_0x682a('0x7'));var path=require(_0x682a('0x8'));var sox=require(_0x682a('0x9'));var csv=require(_0x682a('0xa'));var ejs=require(_0x682a('0xb'));var fs=require('fs');var fs_extra=require(_0x682a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x682a('0xd'));var jsforce=require(_0x682a('0xe'));var deskjs=require(_0x682a('0xf'));var toCsv=require(_0x682a('0xa'));var querystring=require(_0x682a('0x10'));var Papa=require(_0x682a('0x11'));var Redis=require(_0x682a('0x12'));var authService=require(_0x682a('0x13'));var qs=require(_0x682a('0x14'));var as=require(_0x682a('0x15'));var hardwareService=require(_0x682a('0x16'));var logger=require('../../config/logger')(_0x682a('0x17'));var utils=require(_0x682a('0x18'));var config=require(_0x682a('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x682a('0x1a'));function respondWithStatusCode(_0x5b6453,_0x285215){_0x285215=_0x285215||0xcc;return function(_0x39d5d0){if(_0x39d5d0){return _0x5b6453[_0x682a('0x1b')](_0x285215);}return _0x5b6453[_0x682a('0x1c')](_0x285215)[_0x682a('0x1d')]();};}function respondWithResult(_0x47e364,_0x57b2e8){_0x57b2e8=_0x57b2e8||0xc8;return function(_0x10dadf){if(_0x10dadf){return _0x47e364[_0x682a('0x1c')](_0x57b2e8)['json'](_0x10dadf);}};}function respondWithFilteredResult(_0x4ce384,_0x3b6a50){return function(_0x17c273){if(_0x17c273){var _0x4cc9ad=typeof _0x3b6a50[_0x682a('0x1e')]===_0x682a('0x1f')&&typeof _0x3b6a50['limit']==='undefined';var _0x148cd2=_0x17c273['count'];var _0x17f669=_0x4cc9ad?0x0:_0x3b6a50[_0x682a('0x1e')];var _0x575f1b=_0x4cc9ad?_0x17c273[_0x682a('0x20')]:_0x3b6a50[_0x682a('0x1e')]+_0x3b6a50['limit'];var _0x2cedb8;if(_0x575f1b>=_0x148cd2){_0x575f1b=_0x148cd2;_0x2cedb8=0xc8;}else{_0x2cedb8=0xce;}_0x4ce384[_0x682a('0x1c')](_0x2cedb8);return _0x4ce384['set'](_0x682a('0x21'),_0x17f669+'-'+_0x575f1b+'/'+_0x148cd2)[_0x682a('0x22')](_0x17c273);}return null;};}function patchUpdates(_0x2a64cf){return function(_0x126727){try{jsonpatch['apply'](_0x126727,_0x2a64cf,!![]);}catch(_0x48d412){return BPromise[_0x682a('0x23')](_0x48d412);}return _0x126727['save']();};}function saveUpdates(_0x5d5263,_0x44ae90){return function(_0x376307){if(_0x376307){return _0x376307[_0x682a('0x24')](_0x5d5263)[_0x682a('0x25')](function(_0x3c64a4){return _0x3c64a4;});}return null;};}function removeEntity(_0x182eab,_0x20f0c0){return function(_0x431209){if(_0x431209){return _0x431209[_0x682a('0x26')]()[_0x682a('0x25')](function(){_0x182eab[_0x682a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x512f94,_0x5b2b34){return function(_0x22c101){if(!_0x22c101){_0x512f94['sendStatus'](0x194);}return _0x22c101;};}function handleError(_0x3e28cb,_0x170a21){_0x170a21=_0x170a21||0x1f4;return function(_0xfb03e0){logger[_0x682a('0x27')](_0xfb03e0[_0x682a('0x28')]);if(_0xfb03e0['name']){delete _0xfb03e0['name'];}_0x3e28cb['status'](_0x170a21)[_0x682a('0x29')](_0xfb03e0);};}exports[_0x682a('0x2a')]=function(_0x434c17,_0x51dd8c){var _0x45042e={},_0x119ea7={},_0x8aaf09={'count':0x0,'rows':[]};var _0x343cd8=_['map'](db[_0x682a('0x2b')][_0x682a('0x2c')],function(_0x58f17a){return{'name':_0x58f17a[_0x682a('0x2d')],'type':_0x58f17a['type'][_0x682a('0x2e')]};});_0x119ea7['model']=_[_0x682a('0x2f')](_0x343cd8,_0x682a('0x30'));_0x119ea7[_0x682a('0x31')]=_[_0x682a('0x32')](_0x434c17[_0x682a('0x31')]);_0x119ea7[_0x682a('0x33')]=_[_0x682a('0x34')](_0x119ea7[_0x682a('0x35')],_0x119ea7[_0x682a('0x31')]);_0x45042e[_0x682a('0x36')]=_[_0x682a('0x34')](_0x119ea7[_0x682a('0x35')],qs[_0x682a('0x37')](_0x434c17[_0x682a('0x31')]['fields']));_0x45042e['attributes']=_0x45042e[_0x682a('0x36')][_0x682a('0x38')]?_0x45042e[_0x682a('0x36')]:_0x119ea7['model'];if(!_0x434c17[_0x682a('0x31')][_0x682a('0x39')](_0x682a('0x3a'))){_0x45042e[_0x682a('0x3b')]=qs[_0x682a('0x3b')](_0x434c17[_0x682a('0x31')][_0x682a('0x3b')]);_0x45042e[_0x682a('0x1e')]=qs[_0x682a('0x1e')](_0x434c17[_0x682a('0x31')]['offset']);}_0x45042e[_0x682a('0x3c')]=qs[_0x682a('0x3d')](_0x434c17[_0x682a('0x31')][_0x682a('0x3d')]);_0x45042e[_0x682a('0x3e')]=qs[_0x682a('0x33')](_[_0x682a('0x3f')](_0x434c17['query'],_0x119ea7[_0x682a('0x33')]),_0x343cd8);if(_0x434c17[_0x682a('0x31')][_0x682a('0x40')]){_0x45042e[_0x682a('0x3e')]=_[_0x682a('0x41')](_0x45042e[_0x682a('0x3e')],{'$or':_[_0x682a('0x2f')](_0x343cd8,function(_0x343deb){if(_0x343deb[_0x682a('0x42')]!==_0x682a('0x43')){var _0xdc8c78={};_0xdc8c78[_0x343deb[_0x682a('0x30')]]={'$like':'%'+_0x434c17['query'][_0x682a('0x40')]+'%'};return _0xdc8c78;}})});}_0x45042e=_[_0x682a('0x41')]({},_0x45042e,_0x434c17[_0x682a('0x44')]);var _0x17e83d={'where':_0x45042e['where']};return db[_0x682a('0x2b')][_0x682a('0x20')](_0x17e83d)[_0x682a('0x25')](function(_0xe5b51f){_0x8aaf09['count']=_0xe5b51f;if(_0x434c17[_0x682a('0x31')][_0x682a('0x45')]){_0x45042e[_0x682a('0x46')]=[{'all':!![]}];}return db[_0x682a('0x2b')][_0x682a('0x47')](_0x45042e);})[_0x682a('0x25')](function(_0x3121e5){_0x8aaf09[_0x682a('0x48')]=_0x3121e5;return _0x8aaf09;})[_0x682a('0x25')](respondWithFilteredResult(_0x51dd8c,_0x45042e))[_0x682a('0x49')](handleError(_0x51dd8c,null));};exports[_0x682a('0x4a')]=function(_0x4df75c,_0x1e41bd){var _0x5c742e={'raw':![],'where':{'id':_0x4df75c[_0x682a('0x4b')]['id']}},_0x37867b={};_0x37867b[_0x682a('0x35')]=_[_0x682a('0x32')](db['ServicenowAccount']['rawAttributes']);_0x37867b['query']=_[_0x682a('0x32')](_0x4df75c[_0x682a('0x31')]);_0x37867b[_0x682a('0x33')]=_[_0x682a('0x34')](_0x37867b[_0x682a('0x35')],_0x37867b['query']);_0x5c742e[_0x682a('0x36')]=_[_0x682a('0x34')](_0x37867b['model'],qs[_0x682a('0x37')](_0x4df75c[_0x682a('0x31')][_0x682a('0x37')]));_0x5c742e[_0x682a('0x36')]=_0x5c742e['attributes'][_0x682a('0x38')]?_0x5c742e[_0x682a('0x36')]:_0x37867b[_0x682a('0x35')];if(_0x4df75c[_0x682a('0x31')][_0x682a('0x45')]){_0x5c742e[_0x682a('0x46')]=[{'all':!![]}];}_0x5c742e=_[_0x682a('0x41')]({},_0x5c742e,_0x4df75c[_0x682a('0x44')]);return db[_0x682a('0x2b')][_0x682a('0x4c')](_0x5c742e)[_0x682a('0x25')](handleEntityNotFound(_0x1e41bd,null))['then'](respondWithResult(_0x1e41bd,null))['catch'](handleError(_0x1e41bd,null));};exports[_0x682a('0x4d')]=function(_0xb21e62,_0x4519cc){return db[_0x682a('0x2b')]['create'](_0xb21e62[_0x682a('0x4e')],{})[_0x682a('0x25')](respondWithResult(_0x4519cc,0xc9))[_0x682a('0x49')](handleError(_0x4519cc,null));};exports[_0x682a('0x24')]=function(_0x449996,_0x2e4ee3){if(_0x449996['body']['id']){delete _0x449996[_0x682a('0x4e')]['id'];}return db[_0x682a('0x2b')]['find']({'where':{'id':_0x449996[_0x682a('0x4b')]['id']}})[_0x682a('0x25')](handleEntityNotFound(_0x2e4ee3,null))[_0x682a('0x25')](saveUpdates(_0x449996[_0x682a('0x4e')],null))['then'](respondWithResult(_0x2e4ee3,null))[_0x682a('0x49')](handleError(_0x2e4ee3,null));};exports[_0x682a('0x26')]=function(_0x47a302,_0x162638){return db[_0x682a('0x2b')]['find']({'where':{'id':_0x47a302[_0x682a('0x4b')]['id']}})[_0x682a('0x25')](handleEntityNotFound(_0x162638,null))['then'](removeEntity(_0x162638,null))[_0x682a('0x49')](handleError(_0x162638,null));};exports[_0x682a('0x4f')]=function(_0x342c48,_0x14dc32,_0x5c7221){var _0x2b54ed={};var _0x2b2b8a={};var _0x462ee0;var _0x580f83;return db[_0x682a('0x2b')][_0x682a('0x50')]({'where':{'id':_0x342c48[_0x682a('0x4b')]['id']}})[_0x682a('0x25')](handleEntityNotFound(_0x14dc32,null))[_0x682a('0x25')](function(_0x37072e){if(_0x37072e){_0x462ee0=_0x37072e;_0x2b2b8a[_0x682a('0x35')]=_[_0x682a('0x32')](db['ServicenowConfiguration']['rawAttributes']);_0x2b2b8a[_0x682a('0x31')]=_[_0x682a('0x32')](_0x342c48[_0x682a('0x31')]);_0x2b2b8a[_0x682a('0x33')]=_[_0x682a('0x34')](_0x2b2b8a[_0x682a('0x35')],_0x2b2b8a[_0x682a('0x31')]);_0x2b54ed['attributes']=_[_0x682a('0x34')](_0x2b2b8a[_0x682a('0x35')],qs[_0x682a('0x37')](_0x342c48['query']['fields']));_0x2b54ed[_0x682a('0x36')]=_0x2b54ed[_0x682a('0x36')][_0x682a('0x38')]?_0x2b54ed[_0x682a('0x36')]:_0x2b2b8a[_0x682a('0x35')];_0x2b54ed[_0x682a('0x3c')]=qs[_0x682a('0x3d')](_0x342c48[_0x682a('0x31')][_0x682a('0x3d')]);_0x2b54ed[_0x682a('0x3e')]=qs[_0x682a('0x33')](_[_0x682a('0x3f')](_0x342c48['query'],_0x2b2b8a['filters']));if(_0x342c48[_0x682a('0x31')][_0x682a('0x40')]){_0x2b54ed[_0x682a('0x3e')]=_[_0x682a('0x41')](_0x2b54ed[_0x682a('0x3e')],{'$or':_[_0x682a('0x2f')](_0x2b54ed[_0x682a('0x36')],function(_0x442b0b){var _0x11044e={};_0x11044e[_0x442b0b]={'$like':'%'+_0x342c48[_0x682a('0x31')][_0x682a('0x40')]+'%'};return _0x11044e;})});}_0x2b54ed=_[_0x682a('0x41')]({},_0x2b54ed,_0x342c48[_0x682a('0x44')]);return _0x462ee0[_0x682a('0x4f')](_0x2b54ed);}})[_0x682a('0x25')](function(_0x28faf1){if(_0x28faf1){_0x580f83=_0x28faf1[_0x682a('0x38')];if(!_0x342c48['query']['hasOwnProperty']('nolimit')){_0x2b54ed[_0x682a('0x3b')]=qs[_0x682a('0x3b')](_0x342c48[_0x682a('0x31')]['limit']);_0x2b54ed[_0x682a('0x1e')]=qs['offset'](_0x342c48['query'][_0x682a('0x1e')]);}return _0x462ee0[_0x682a('0x4f')](_0x2b54ed);}})[_0x682a('0x25')](function(_0x293947){if(_0x293947){return _0x293947?{'count':_0x580f83,'rows':_0x293947}:null;}})[_0x682a('0x25')](respondWithResult(_0x14dc32,null))[_0x682a('0x49')](handleError(_0x14dc32,null));};exports[_0x682a('0x51')]=function(_0x2eb537,_0x444c10,_0x409e9a){if(_0x2eb537[_0x682a('0x4e')]['id']){delete _0x2eb537['body']['id'];}return db[_0x682a('0x2b')][_0x682a('0x50')]({'where':{'id':_0x2eb537[_0x682a('0x4b')]['id']}})[_0x682a('0x25')](handleEntityNotFound(_0x444c10,null))[_0x682a('0x25')](function(_0x35f8da){if(_0x35f8da){_0x2eb537[_0x682a('0x4e')][_0x682a('0x52')]=_0x35f8da['id'];_0x2eb537[_0x682a('0x4e')][_0x682a('0x53')]=integrations[_0x682a('0x54')](_0x2eb537[_0x682a('0x4e')][_0x682a('0x55')],_0x2eb537[_0x682a('0x4e')]['type']);_0x2eb537[_0x682a('0x4e')][_0x682a('0x56')]=integrations[_0x682a('0x57')](_0x2eb537['body'][_0x682a('0x55')],_0x2eb537[_0x682a('0x4e')][_0x682a('0x42')]);return db['ServicenowConfiguration']['create'](_0x2eb537['body'],{'include':[{'model':db[_0x682a('0x58')],'as':_0x682a('0x53')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x682a('0x25')](respondWithResult(_0x444c10,null))[_0x682a('0x49')](handleError(_0x444c10,null));};exports[_0x682a('0x59')]=function(_0x13e8a3,_0x459e20,_0x1fc46c){var _0x15bb0b=[_0x682a('0x5a'),'hold_reason',_0x682a('0x5b'),_0x682a('0x5c'),_0x682a('0x5d'),_0x682a('0x5e'),_0x682a('0x5f'),_0x682a('0x60'),_0x682a('0x61')];var _0x4d8744=['parent',_0x682a('0x5a'),_0x682a('0x62'),_0x682a('0x63'),_0x682a('0x64'),_0x682a('0x65'),'child_incidents',_0x682a('0x66'),'approval_history',_0x682a('0x67'),_0x682a('0x68'),'sys_updated_by',_0x682a('0x69'),_0x682a('0x6a'),_0x682a('0x6b'),'sys_domain','state','sys_created_by','knowledge',_0x682a('0x3c'),_0x682a('0x6c'),_0x682a('0x6d'),'cmdb_ci',_0x682a('0x6e'),_0x682a('0x6f'),_0x682a('0x70'),_0x682a('0x71'),_0x682a('0x72'),_0x682a('0x73'),'sys_domain_path',_0x682a('0x74'),_0x682a('0x75'),'expected_start',_0x682a('0x76'),_0x682a('0x77'),_0x682a('0x78'),'work_end',_0x682a('0x79'),_0x682a('0x7a'),_0x682a('0x7b'),_0x682a('0x7c'),_0x682a('0x5c'),'work_notes',_0x682a('0x7d'),_0x682a('0x5d'),_0x682a('0x7e'),_0x682a('0x7f'),'work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration',_0x682a('0x5e'),_0x682a('0x80'),_0x682a('0x81'),_0x682a('0x82'),_0x682a('0x83'),_0x682a('0x84'),'sys_id',_0x682a('0x85'),_0x682a('0x86'),'incident_state','urgency',_0x682a('0x87'),_0x682a('0x88'),'reassignment_count',_0x682a('0x89'),_0x682a('0x8a'),'severity',_0x682a('0x8b'),_0x682a('0x8c'),_0x682a('0x8d'),_0x682a('0x8e'),_0x682a('0x8f'),_0x682a('0x90'),'reopen_count',_0x682a('0x91'),_0x682a('0x92'),_0x682a('0x93'),_0x682a('0x94'),_0x682a('0x95'),_0x682a('0x61')];var _0x1a34e8='';var _0x4ee18d='';var _0x4d7620=[];var _0x45cb54='';var _0x4a0c28='';var _0x327498=[];var _0x926243='';var _0x8a41ce='';var _0x596e0b={};var _0x475a24='';return db[_0x682a('0x2b')][_0x682a('0x50')]({'where':{'id':_0x13e8a3[_0x682a('0x4b')]['id']},'attributes':['id',_0x682a('0x96'),_0x682a('0x97'),_0x682a('0x98'),_0x682a('0x99'),_0x682a('0x9a')]})['then'](handleEntityNotFound(_0x459e20,null))[_0x682a('0x25')](function(_0x38c02e){if(_0x38c02e){_0x475a24=_0x38c02e[_0x682a('0x99')];var _0x18557b=_0x475a24[_0x682a('0x9b')](-0x1);if(_0x18557b==='/'){_0x475a24=_0x475a24[_0x682a('0x9c')](0x0,_0x475a24[_0x682a('0x9d')](_0x18557b));}_0x8a41ce=util[_0x682a('0x9e')](_0x682a('0x9f'),_0x475a24);_0x926243=util[_0x682a('0x9e')](_0x682a('0xa0'),_0x475a24);_0x596e0b={'user':_0x38c02e[_0x682a('0x96')],'pass':_0x38c02e[_0x682a('0x97')]};var _0x340013={'method':_0x682a('0xa1'),'uri':_0x8a41ce+_0x682a('0xa2'),'auth':_0x596e0b,'json':!![]};return rp(_0x340013);}})[_0x682a('0x25')](function(_0x207b23){if(_0x207b23[_0x682a('0xa3')][_0x682a('0x38')]>0x0){_0x1a34e8=_0x207b23[_0x682a('0xa3')];}console['log'](_0x682a('0xa4'),_0x1a34e8);_0x327498=[];_0x4ee18d=Object['assign']([],_0x1a34e8);_['remove'](_0x4ee18d,function(_0x5490f3){return!_0x15bb0b['includes'](_0x5490f3[_0x682a('0x30')]);});_0x4ee18d[_0x682a('0xa5')](function(_0x5aa6ea){var _0x23432d=createFieldObject(_0x926243,_0x596e0b,_0x5aa6ea['internalType'],_0x5aa6ea['name'],_0x5aa6ea['label'],![]);_0x327498['push'](_0x23432d);});return Promise[_0x682a('0xa6')](_0x327498);})[_0x682a('0x25')](function(_0x193d6a){_0x4d7620=_0x193d6a;_0x45cb54=Object[_0x682a('0xa7')]([],_0x1a34e8);console[_0x682a('0xa8')](_0x682a('0xa9'),_0x1a34e8);_['remove'](_0x45cb54,function(_0x30457f){return _0x4d8744['includes'](_0x30457f['name']);});console[_0x682a('0xa8')](_0x682a('0xaa'),_0x45cb54);_0x327498=[];_0x45cb54[_0x682a('0xa5')](function(_0xbd0db0){var _0x37f541=createFieldObject(_0x926243,_0x596e0b,_0xbd0db0[_0x682a('0xab')],_0xbd0db0[_0x682a('0x30')],_0xbd0db0[_0x682a('0xac')],!![]);_0x327498[_0x682a('0xad')](_0x37f541);});return Promise[_0x682a('0xa6')](_0x327498);})[_0x682a('0x25')](function(_0x414512){_0x4a0c28=_0x414512;var _0x57d17e=_0x4d7620['concat'](_0x4a0c28);return{'count':_0x57d17e['length'],'rows':_0x57d17e};})[_0x682a('0x25')](respondWithResult(_0x459e20,null))[_0x682a('0x49')](function(_0x4fae46){console[_0x682a('0xa8')](_0x682a('0xae')+_0x4fae46);var _0x440561=_0x13e8a3['query'][_0x682a('0xaf')]?0x1f4:_0x4fae46[_0x682a('0xb0')]||0x1f4;logger['error'](_0x4fae46[_0x682a('0x28')]);delete _0x4fae46['name'];if(_0x440561===0x191){_0x440561=0x190;}_0x459e20[_0x682a('0x1c')](_0x440561)[_0x682a('0x29')](_0x13e8a3[_0x682a('0x31')][_0x682a('0xaf')]?{'message':_0x682a('0xb1'),'statusCode':_0x4fae46['statusCode']}:_0x4fae46);});};function createFieldObject(_0x431ffe,_0x5150a1,_0x2ae897,_0x1be34c,_0x4c87aa,_0x2fdb8c){return new Promise(function(_0x249cc3,_0x3db1ed){var _0x6a67bd={'id':_0x1be34c,'name':_0x4c87aa,'custom':_0x2fdb8c};if(_0x2ae897===_0x682a('0xb2')){_0x6a67bd[_0x682a('0x44')]=[{'name':_0x682a('0xb3'),'value':_0x682a('0xb4')},{'name':_0x682a('0xb5'),'value':_0x682a('0xb6')}];_0x249cc3(_0x6a67bd);}else{var _0x29f856={'method':_0x682a('0xa1'),'uri':_0x431ffe+_0x682a('0xb7')+_0x1be34c,'auth':_0x5150a1,'json':!![]};return rp(_0x29f856)[_0x682a('0x25')](function(_0x3d4108){var _0x4a614d=[];if(_0x3d4108[_0x682a('0xa3')][_0x682a('0x38')]>0x0){_0x3d4108['result'][_0x682a('0xa5')](function(_0x57c291){if(_0x57c291['inactive']===_0x682a('0xb6')){var _0x47fda5={'name':_0x57c291[_0x682a('0xac')],'value':_0x57c291[_0x682a('0xb8')]};_0x4a614d['push'](_0x47fda5);}});}_0x6a67bd[_0x682a('0x44')]=_0x4a614d;if(_0x6a67bd[_0x682a('0x44')]['length']>0x0){_0x249cc3(_0x6a67bd);}else{if(_0x2fdb8c==![]){_0x249cc3();}else{_0x249cc3(_0x6a67bd);}}});}});} \ No newline at end of file +var _0x4b77=['result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','catch','fields','find','create','body','params','ServicenowConfiguration','order','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','Descriptions','getFields','hold_reason','knowledge','subcategory','notify','incident_state','category','parent','made_sla','caused_by','watch_list','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','user_input','sys_created_on','state','calendar_stc','closed_at','cmdb_ci','impact','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','close_code','correlation_display','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','email','serverUrl','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x4b77,0xcd));var _0x74b7=function(_0x171474,_0xf87039){_0x171474=_0x171474-0x0;var _0x3969b0=_0x4b77[_0x171474];return _0x3969b0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x74b7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b7('0x1'));var moment=require(_0x74b7('0x2'));var BPromise=require(_0x74b7('0x3'));var Mustache=require('mustache');var util=require(_0x74b7('0x4'));var path=require(_0x74b7('0x5'));var sox=require(_0x74b7('0x6'));var csv=require(_0x74b7('0x7'));var ejs=require(_0x74b7('0x8'));var fs=require('fs');var fs_extra=require(_0x74b7('0x9'));var _=require(_0x74b7('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x74b7('0xb'));var deskjs=require(_0x74b7('0xc'));var toCsv=require(_0x74b7('0x7'));var querystring=require(_0x74b7('0xd'));var Papa=require(_0x74b7('0xe'));var Redis=require(_0x74b7('0xf'));var authService=require(_0x74b7('0x10'));var qs=require(_0x74b7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b7('0x12'))(_0x74b7('0x13'));var utils=require(_0x74b7('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x74b7('0x15'))['db'];var integrations=require(_0x74b7('0x16'));function respondWithStatusCode(_0x12728a,_0x44c5b9){_0x44c5b9=_0x44c5b9||0xcc;return function(_0x1b0358){if(_0x1b0358){return _0x12728a['sendStatus'](_0x44c5b9);}return _0x12728a[_0x74b7('0x17')](_0x44c5b9)[_0x74b7('0x18')]();};}function respondWithResult(_0x4ab2e0,_0x38010d){_0x38010d=_0x38010d||0xc8;return function(_0x19b599){if(_0x19b599){return _0x4ab2e0[_0x74b7('0x17')](_0x38010d)[_0x74b7('0x19')](_0x19b599);}};}function respondWithFilteredResult(_0x3a2a40,_0x353c58){return function(_0x514417){if(_0x514417){var _0x52bcbc=typeof _0x353c58[_0x74b7('0x1a')]===_0x74b7('0x1b')&&typeof _0x353c58[_0x74b7('0x1c')]===_0x74b7('0x1b');var _0x44d2c5=_0x514417[_0x74b7('0x1d')];var _0x26cff8=_0x52bcbc?0x0:_0x353c58[_0x74b7('0x1a')];var _0x229d29=_0x52bcbc?_0x514417['count']:_0x353c58[_0x74b7('0x1a')]+_0x353c58['limit'];var _0x308be7;if(_0x229d29>=_0x44d2c5){_0x229d29=_0x44d2c5;_0x308be7=0xc8;}else{_0x308be7=0xce;}_0x3a2a40['status'](_0x308be7);return _0x3a2a40['set'](_0x74b7('0x1e'),_0x26cff8+'-'+_0x229d29+'/'+_0x44d2c5)[_0x74b7('0x19')](_0x514417);}return null;};}function patchUpdates(_0x2a5dea){return function(_0x7ec4cd){try{jsonpatch[_0x74b7('0x1f')](_0x7ec4cd,_0x2a5dea,!![]);}catch(_0x532323){return BPromise[_0x74b7('0x20')](_0x532323);}return _0x7ec4cd[_0x74b7('0x21')]();};}function saveUpdates(_0x96f0ae,_0x26964b){return function(_0x4859e3){if(_0x4859e3){return _0x4859e3[_0x74b7('0x22')](_0x96f0ae)[_0x74b7('0x23')](function(_0x506897){return _0x506897;});}return null;};}function removeEntity(_0x299ecf,_0x5acd38){return function(_0x4390d0){if(_0x4390d0){return _0x4390d0[_0x74b7('0x24')]()['then'](function(){_0x299ecf['status'](0xcc)[_0x74b7('0x18')]();});}};}function handleEntityNotFound(_0xda9b03,_0x39d041){return function(_0xfb3e2a){if(!_0xfb3e2a){_0xda9b03[_0x74b7('0x25')](0x194);}return _0xfb3e2a;};}function handleError(_0x199486,_0x403c3b){_0x403c3b=_0x403c3b||0x1f4;return function(_0x25666f){logger[_0x74b7('0x26')](_0x25666f[_0x74b7('0x27')]);if(_0x25666f[_0x74b7('0x28')]){delete _0x25666f[_0x74b7('0x28')];}_0x199486[_0x74b7('0x17')](_0x403c3b)[_0x74b7('0x29')](_0x25666f);};}exports[_0x74b7('0x2a')]=function(_0x3dd3d0,_0xca0e80){var _0x1bad54={},_0x42fba8={},_0x48623a={'count':0x0,'rows':[]};var _0x370ce2=_[_0x74b7('0x2b')](db['ServicenowAccount'][_0x74b7('0x2c')],function(_0x26bcbe){return{'name':_0x26bcbe[_0x74b7('0x2d')],'type':_0x26bcbe[_0x74b7('0x2e')]['key']};});_0x42fba8['model']=_['map'](_0x370ce2,_0x74b7('0x28'));_0x42fba8[_0x74b7('0x2f')]=_[_0x74b7('0x30')](_0x3dd3d0['query']);_0x42fba8[_0x74b7('0x31')]=_['intersection'](_0x42fba8[_0x74b7('0x32')],_0x42fba8['query']);_0x1bad54[_0x74b7('0x33')]=_[_0x74b7('0x34')](_0x42fba8['model'],qs['fields'](_0x3dd3d0[_0x74b7('0x2f')]['fields']));_0x1bad54[_0x74b7('0x33')]=_0x1bad54['attributes'][_0x74b7('0x35')]?_0x1bad54[_0x74b7('0x33')]:_0x42fba8[_0x74b7('0x32')];if(!_0x3dd3d0[_0x74b7('0x2f')][_0x74b7('0x36')](_0x74b7('0x37'))){_0x1bad54[_0x74b7('0x1c')]=qs[_0x74b7('0x1c')](_0x3dd3d0[_0x74b7('0x2f')][_0x74b7('0x1c')]);_0x1bad54['offset']=qs[_0x74b7('0x1a')](_0x3dd3d0[_0x74b7('0x2f')][_0x74b7('0x1a')]);}_0x1bad54['order']=qs[_0x74b7('0x38')](_0x3dd3d0['query'][_0x74b7('0x38')]);_0x1bad54[_0x74b7('0x39')]=qs[_0x74b7('0x31')](_[_0x74b7('0x3a')](_0x3dd3d0['query'],_0x42fba8[_0x74b7('0x31')]),_0x370ce2);if(_0x3dd3d0[_0x74b7('0x2f')][_0x74b7('0x3b')]){_0x1bad54[_0x74b7('0x39')]=_[_0x74b7('0x3c')](_0x1bad54[_0x74b7('0x39')],{'$or':_[_0x74b7('0x2b')](_0x370ce2,function(_0x35ebac){if(_0x35ebac[_0x74b7('0x2e')]!==_0x74b7('0x3d')){var _0x51dbe6={};_0x51dbe6[_0x35ebac['name']]={'$like':'%'+_0x3dd3d0['query'][_0x74b7('0x3b')]+'%'};return _0x51dbe6;}})});}_0x1bad54=_[_0x74b7('0x3c')]({},_0x1bad54,_0x3dd3d0[_0x74b7('0x3e')]);var _0xaaf989={'where':_0x1bad54[_0x74b7('0x39')]};return db[_0x74b7('0x3f')]['count'](_0xaaf989)[_0x74b7('0x23')](function(_0x30ecad){_0x48623a['count']=_0x30ecad;if(_0x3dd3d0[_0x74b7('0x2f')][_0x74b7('0x40')]){_0x1bad54[_0x74b7('0x41')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x74b7('0x42')](_0x1bad54);})[_0x74b7('0x23')](function(_0xb9e214){_0x48623a['rows']=_0xb9e214;return _0x48623a;})[_0x74b7('0x23')](respondWithFilteredResult(_0xca0e80,_0x1bad54))[_0x74b7('0x43')](handleError(_0xca0e80,null));};exports['show']=function(_0x8ea185,_0xd3a1fa){var _0x277e25={'raw':![],'where':{'id':_0x8ea185['params']['id']}},_0x1ad4f0={};_0x1ad4f0['model']=_[_0x74b7('0x30')](db[_0x74b7('0x3f')]['rawAttributes']);_0x1ad4f0['query']=_[_0x74b7('0x30')](_0x8ea185[_0x74b7('0x2f')]);_0x1ad4f0['filters']=_[_0x74b7('0x34')](_0x1ad4f0[_0x74b7('0x32')],_0x1ad4f0['query']);_0x277e25[_0x74b7('0x33')]=_[_0x74b7('0x34')](_0x1ad4f0[_0x74b7('0x32')],qs['fields'](_0x8ea185[_0x74b7('0x2f')][_0x74b7('0x44')]));_0x277e25[_0x74b7('0x33')]=_0x277e25['attributes']['length']?_0x277e25[_0x74b7('0x33')]:_0x1ad4f0[_0x74b7('0x32')];if(_0x8ea185[_0x74b7('0x2f')]['includeAll']){_0x277e25['include']=[{'all':!![]}];}_0x277e25=_[_0x74b7('0x3c')]({},_0x277e25,_0x8ea185['options']);return db['ServicenowAccount'][_0x74b7('0x45')](_0x277e25)[_0x74b7('0x23')](handleEntityNotFound(_0xd3a1fa,null))[_0x74b7('0x23')](respondWithResult(_0xd3a1fa,null))['catch'](handleError(_0xd3a1fa,null));};exports[_0x74b7('0x46')]=function(_0x554c2d,_0x174196){return db['ServicenowAccount']['create'](_0x554c2d[_0x74b7('0x47')],{})[_0x74b7('0x23')](respondWithResult(_0x174196,0xc9))[_0x74b7('0x43')](handleError(_0x174196,null));};exports[_0x74b7('0x22')]=function(_0x3e6d64,_0x204ccd){if(_0x3e6d64[_0x74b7('0x47')]['id']){delete _0x3e6d64[_0x74b7('0x47')]['id'];}return db[_0x74b7('0x3f')][_0x74b7('0x45')]({'where':{'id':_0x3e6d64['params']['id']}})[_0x74b7('0x23')](handleEntityNotFound(_0x204ccd,null))[_0x74b7('0x23')](saveUpdates(_0x3e6d64[_0x74b7('0x47')],null))['then'](respondWithResult(_0x204ccd,null))[_0x74b7('0x43')](handleError(_0x204ccd,null));};exports[_0x74b7('0x24')]=function(_0x14a78f,_0x5171a2){return db[_0x74b7('0x3f')][_0x74b7('0x45')]({'where':{'id':_0x14a78f['params']['id']}})[_0x74b7('0x23')](handleEntityNotFound(_0x5171a2,null))['then'](removeEntity(_0x5171a2,null))['catch'](handleError(_0x5171a2,null));};exports['getConfigurations']=function(_0x2a0962,_0x4afbbe,_0x3e0c83){var _0x1fa6f2={};var _0x17b9c4={};var _0x39f342;var _0x42740a;return db[_0x74b7('0x3f')]['findOne']({'where':{'id':_0x2a0962[_0x74b7('0x48')]['id']}})[_0x74b7('0x23')](handleEntityNotFound(_0x4afbbe,null))['then'](function(_0x25ad7b){if(_0x25ad7b){_0x39f342=_0x25ad7b;_0x17b9c4[_0x74b7('0x32')]=_[_0x74b7('0x30')](db[_0x74b7('0x49')][_0x74b7('0x2c')]);_0x17b9c4['query']=_['keys'](_0x2a0962[_0x74b7('0x2f')]);_0x17b9c4[_0x74b7('0x31')]=_[_0x74b7('0x34')](_0x17b9c4[_0x74b7('0x32')],_0x17b9c4[_0x74b7('0x2f')]);_0x1fa6f2[_0x74b7('0x33')]=_[_0x74b7('0x34')](_0x17b9c4['model'],qs['fields'](_0x2a0962[_0x74b7('0x2f')][_0x74b7('0x44')]));_0x1fa6f2[_0x74b7('0x33')]=_0x1fa6f2[_0x74b7('0x33')][_0x74b7('0x35')]?_0x1fa6f2['attributes']:_0x17b9c4[_0x74b7('0x32')];_0x1fa6f2[_0x74b7('0x4a')]=qs[_0x74b7('0x38')](_0x2a0962[_0x74b7('0x2f')][_0x74b7('0x38')]);_0x1fa6f2[_0x74b7('0x39')]=qs['filters'](_[_0x74b7('0x3a')](_0x2a0962['query'],_0x17b9c4[_0x74b7('0x31')]));if(_0x2a0962[_0x74b7('0x2f')][_0x74b7('0x3b')]){_0x1fa6f2[_0x74b7('0x39')]=_[_0x74b7('0x3c')](_0x1fa6f2[_0x74b7('0x39')],{'$or':_[_0x74b7('0x2b')](_0x1fa6f2[_0x74b7('0x33')],function(_0x449b81){var _0x4035c8={};_0x4035c8[_0x449b81]={'$like':'%'+_0x2a0962['query'][_0x74b7('0x3b')]+'%'};return _0x4035c8;})});}_0x1fa6f2=_[_0x74b7('0x3c')]({},_0x1fa6f2,_0x2a0962[_0x74b7('0x3e')]);return _0x39f342[_0x74b7('0x4b')](_0x1fa6f2);}})['then'](function(_0x212b96){if(_0x212b96){_0x42740a=_0x212b96['length'];if(!_0x2a0962[_0x74b7('0x2f')]['hasOwnProperty'](_0x74b7('0x37'))){_0x1fa6f2[_0x74b7('0x1c')]=qs[_0x74b7('0x1c')](_0x2a0962[_0x74b7('0x2f')][_0x74b7('0x1c')]);_0x1fa6f2[_0x74b7('0x1a')]=qs['offset'](_0x2a0962[_0x74b7('0x2f')]['offset']);}return _0x39f342[_0x74b7('0x4b')](_0x1fa6f2);}})[_0x74b7('0x23')](function(_0x4ba93e){if(_0x4ba93e){return _0x4ba93e?{'count':_0x42740a,'rows':_0x4ba93e}:null;}})[_0x74b7('0x23')](respondWithResult(_0x4afbbe,null))[_0x74b7('0x43')](handleError(_0x4afbbe,null));};exports['addConfiguration']=function(_0x597ec3,_0x3bdc81,_0x1ee1a8){if(_0x597ec3[_0x74b7('0x47')]['id']){delete _0x597ec3[_0x74b7('0x47')]['id'];}return db[_0x74b7('0x3f')][_0x74b7('0x4c')]({'where':{'id':_0x597ec3[_0x74b7('0x48')]['id']}})[_0x74b7('0x23')](handleEntityNotFound(_0x3bdc81,null))['then'](function(_0x1f9149){if(_0x1f9149){_0x597ec3[_0x74b7('0x47')][_0x74b7('0x4d')]=_0x1f9149['id'];_0x597ec3[_0x74b7('0x47')][_0x74b7('0x4e')]=integrations[_0x74b7('0x4f')](_0x597ec3[_0x74b7('0x47')][_0x74b7('0x50')],_0x597ec3[_0x74b7('0x47')][_0x74b7('0x2e')]);_0x597ec3[_0x74b7('0x47')]['Descriptions']=integrations[_0x74b7('0x51')](_0x597ec3[_0x74b7('0x47')][_0x74b7('0x50')],_0x597ec3[_0x74b7('0x47')][_0x74b7('0x2e')]);return db['ServicenowConfiguration']['create'](_0x597ec3[_0x74b7('0x47')],{'include':[{'model':db['ServicenowField'],'as':_0x74b7('0x4e')},{'model':db['ServicenowField'],'as':_0x74b7('0x52')}]});}return null;})[_0x74b7('0x23')](respondWithResult(_0x3bdc81,null))['catch'](handleError(_0x3bdc81,null));};exports[_0x74b7('0x53')]=function(_0x4045c4,_0x515fe6,_0x111a78){var _0x3a1d32=['made_sla',_0x74b7('0x54'),_0x74b7('0x55'),_0x74b7('0x56'),'close_code',_0x74b7('0x57'),_0x74b7('0x58'),'severity',_0x74b7('0x59')];var _0x164b9f=[_0x74b7('0x5a'),_0x74b7('0x5b'),_0x74b7('0x5c'),_0x74b7('0x5d'),'upon_reject',_0x74b7('0x5e'),_0x74b7('0x5f'),_0x74b7('0x54'),'approval_history',_0x74b7('0x60'),_0x74b7('0x61'),_0x74b7('0x62'),'opened_by',_0x74b7('0x63'),_0x74b7('0x64'),'sys_domain',_0x74b7('0x65'),'sys_created_by','knowledge',_0x74b7('0x4a'),_0x74b7('0x66'),_0x74b7('0x67'),_0x74b7('0x68'),'delivery_plan',_0x74b7('0x69'),'active',_0x74b7('0x6a'),_0x74b7('0x6b'),'priority',_0x74b7('0x6c'),_0x74b7('0x6d'),_0x74b7('0x6e'),_0x74b7('0x6f'),'opened_at',_0x74b7('0x70'),_0x74b7('0x71'),_0x74b7('0x72'),_0x74b7('0x73'),_0x74b7('0x74'),_0x74b7('0x75'),_0x74b7('0x76'),_0x74b7('0x56'),'work_notes',_0x74b7('0x77'),_0x74b7('0x78'),_0x74b7('0x79'),'delivery_task','work_start',_0x74b7('0x7a'),_0x74b7('0x7b'),_0x74b7('0x7c'),_0x74b7('0x7d'),_0x74b7('0x7e'),_0x74b7('0x57'),_0x74b7('0x7f'),_0x74b7('0x80'),'closed_by','follow_up',_0x74b7('0x81'),_0x74b7('0x82'),_0x74b7('0x83'),'reopened_by',_0x74b7('0x58'),_0x74b7('0x84'),_0x74b7('0x85'),_0x74b7('0x86'),_0x74b7('0x87'),_0x74b7('0x88'),_0x74b7('0x89'),_0x74b7('0x8a'),'comments',_0x74b7('0x8b'),_0x74b7('0x8c'),_0x74b7('0x8d'),_0x74b7('0x8e'),_0x74b7('0x8f'),'reopen_count',_0x74b7('0x90'),_0x74b7('0x91'),_0x74b7('0x92'),_0x74b7('0x93'),'location',_0x74b7('0x59')];var _0x2a8ee2='';var _0x3b9984='';var _0x293670=[];var _0x143b2d='';var _0x1202cd='';var _0x2af7a2=[];var _0x209a6b='';var _0x4199dc='';var _0x12c330={};var _0x485a43='';return db[_0x74b7('0x3f')][_0x74b7('0x4c')]({'where':{'id':_0x4045c4['params']['id']},'attributes':['id','username','password',_0x74b7('0x94'),'remoteUri',_0x74b7('0x95')]})['then'](handleEntityNotFound(_0x515fe6,null))[_0x74b7('0x23')](function(_0x570037){if(_0x570037){_0x485a43=_0x570037[_0x74b7('0x96')];var _0x437606=_0x485a43['slice'](-0x1);if(_0x437606==='/'){_0x485a43=_0x485a43[_0x74b7('0x97')](0x0,_0x485a43[_0x74b7('0x98')](_0x437606));}_0x4199dc=util[_0x74b7('0x99')](_0x74b7('0x9a'),_0x485a43);_0x209a6b=util['format']('%s/api/now/table/',_0x485a43);_0x12c330={'user':_0x570037['username'],'pass':_0x570037['password']};var _0x1a8ae7={'method':_0x74b7('0x9b'),'uri':_0x4199dc+_0x74b7('0x9c'),'auth':_0x12c330,'json':!![]};return rp(_0x1a8ae7);}})[_0x74b7('0x23')](function(_0x4575a1){if(_0x4575a1['result']['length']>0x0){_0x2a8ee2=_0x4575a1[_0x74b7('0x9d')];}console[_0x74b7('0x9e')](_0x74b7('0x9f'),_0x2a8ee2);_0x2af7a2=[];_0x3b9984=Object[_0x74b7('0xa0')]([],_0x2a8ee2);_[_0x74b7('0xa1')](_0x3b9984,function(_0x3f3d55){return!_0x3a1d32[_0x74b7('0xa2')](_0x3f3d55[_0x74b7('0x28')]);});_0x3b9984[_0x74b7('0xa3')](function(_0x4865fe){var _0x45e500=createFieldObject(_0x209a6b,_0x12c330,_0x4865fe[_0x74b7('0xa4')],_0x4865fe[_0x74b7('0x28')],_0x4865fe[_0x74b7('0xa5')],![]);_0x2af7a2[_0x74b7('0xa6')](_0x45e500);});return Promise[_0x74b7('0xa7')](_0x2af7a2);})[_0x74b7('0x23')](function(_0x5e85){_0x293670=_0x5e85;_0x143b2d=Object[_0x74b7('0xa0')]([],_0x2a8ee2);console['log'](_0x74b7('0xa8'),_0x2a8ee2);_[_0x74b7('0xa1')](_0x143b2d,function(_0x5513b2){return _0x164b9f[_0x74b7('0xa2')](_0x5513b2[_0x74b7('0x28')]);});console[_0x74b7('0x9e')](_0x74b7('0xa9'),_0x143b2d);_0x2af7a2=[];_0x143b2d[_0x74b7('0xa3')](function(_0x404b54){var _0x3bf86d=createFieldObject(_0x209a6b,_0x12c330,_0x404b54[_0x74b7('0xa4')],_0x404b54['name'],_0x404b54[_0x74b7('0xa5')],!![]);_0x2af7a2[_0x74b7('0xa6')](_0x3bf86d);});return Promise[_0x74b7('0xa7')](_0x2af7a2);})[_0x74b7('0x23')](function(_0x377c65){_0x1202cd=_0x377c65;var _0x9850bf=_0x293670[_0x74b7('0xaa')](_0x1202cd);return{'count':_0x9850bf[_0x74b7('0x35')],'rows':_0x9850bf};})[_0x74b7('0x23')](respondWithResult(_0x515fe6,null))[_0x74b7('0x43')](function(_0x20f270){console[_0x74b7('0x9e')](_0x74b7('0xab')+_0x20f270);var _0x27a0fc=_0x4045c4['query'][_0x74b7('0xac')]?0x1f4:_0x20f270['statusCode']||0x1f4;logger[_0x74b7('0x26')](_0x20f270['stack']);delete _0x20f270[_0x74b7('0x28')];if(_0x27a0fc===0x191){_0x27a0fc=0x190;}_0x515fe6[_0x74b7('0x17')](_0x27a0fc)[_0x74b7('0x29')](_0x4045c4[_0x74b7('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x20f270[_0x74b7('0xad')]}:_0x20f270);});};function createFieldObject(_0x22e4ef,_0x2a2f60,_0x2ee290,_0x3865b6,_0x227131,_0x4ad935){return new Promise(function(_0x14b71a,_0x1f1df1){var _0x214e2f={'id':_0x3865b6,'name':_0x227131,'custom':_0x4ad935};if(_0x2ee290===_0x74b7('0xae')){_0x214e2f[_0x74b7('0x3e')]=[{'name':'True','value':_0x74b7('0xaf')},{'name':_0x74b7('0xb0'),'value':_0x74b7('0xb1')}];_0x14b71a(_0x214e2f);}else{var _0x172727={'method':_0x74b7('0x9b'),'uri':_0x22e4ef+_0x74b7('0xb2')+_0x3865b6,'auth':_0x2a2f60,'json':!![]};return rp(_0x172727)[_0x74b7('0x23')](function(_0x23a7db){var _0x198351=[];if(_0x23a7db[_0x74b7('0x9d')][_0x74b7('0x35')]>0x0){_0x23a7db[_0x74b7('0x9d')]['forEach'](function(_0x2af764){if(_0x2af764[_0x74b7('0xb3')]===_0x74b7('0xb1')){var _0x4ddaec={'name':_0x2af764[_0x74b7('0xa5')],'value':_0x2af764[_0x74b7('0xb4')]};_0x198351[_0x74b7('0xa6')](_0x4ddaec);}});}_0x214e2f['options']=_0x198351;if(_0x214e2f['options']['length']>0x0){_0x14b71a(_0x214e2f);}else{if(_0x4ad935==![]){_0x14b71a();}else{_0x14b71a(_0x214e2f);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 118665e..e759cb4 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 _0x687b=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x195ae8,_0x53a465){var _0x26f260=function(_0x4c3ed0){while(--_0x4c3ed0){_0x195ae8['push'](_0x195ae8['shift']());}};_0x26f260(++_0x53a465);}(_0x687b,0x14a));var _0xb687=function(_0x4c894b,_0x54fa91){_0x4c894b=_0x4c894b-0x0;var _0x490258=_0x687b[_0x4c894b];return _0x490258;};'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'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('ServicenowAccount',attributes,{'tableName':_0xb687('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f47=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','int_servicenow_accounts','util'];(function(_0x216f98,_0x470c7f){var _0xea6b36=function(_0x38f18c){while(--_0x38f18c){_0x216f98['push'](_0x216f98['shift']());}};_0xea6b36(++_0x470c7f);}(_0x6f47,0xc7));var _0x76f4=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x6f47[_0x75f869];return _0x10af8b;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));var integrations=require(_0x76f4('0x7'));module['exports']=function(_0x35602f,_0xfc2405){return _0x35602f[_0x76f4('0x8')]('ServicenowAccount',attributes,{'tableName':_0x76f4('0x9'),'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 4b92ab4..e32d4bb 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 _0xae3d=['attributes','then','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','limit','include','map','model'];(function(_0x5a2818,_0x49ccf7){var _0x303d9d=function(_0x5a9b7e){while(--_0x5a9b7e){_0x5a2818['push'](_0x5a2818['shift']());}};_0x303d9d(++_0x49ccf7);}(_0xae3d,0x12c));var _0xdae3=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xae3d[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0xdae3('0x0'));var util=require(_0xdae3('0x1'));var moment=require(_0xdae3('0x2'));var BPromise=require(_0xdae3('0x3'));var rs=require(_0xdae3('0x4'));var fs=require('fs');var Redis=require(_0xdae3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdae3('0x6'));var logger=require(_0xdae3('0x7'))(_0xdae3('0x8'));var config=require(_0xdae3('0x9'));var jayson=require(_0xdae3('0xa'));var client=jayson[_0xdae3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d8b42,_0x55ae8d,_0x4166dd){return new BPromise(function(_0x182498,_0x350ad9){return client['request'](_0x2d8b42,_0x4166dd)['then'](function(_0x275236){logger[_0xdae3('0xc')](_0xdae3('0xd'),_0x55ae8d,_0xdae3('0xe'));logger[_0xdae3('0xf')](_0xdae3('0x10'),_0x55ae8d,_0xdae3('0xe'),JSON[_0xdae3('0x11')](_0x275236));if(_0x275236[_0xdae3('0x12')]){if(_0x275236['error'][_0xdae3('0x13')]===0x1f4){logger[_0xdae3('0x12')](_0xdae3('0xd'),_0x55ae8d,_0x275236[_0xdae3('0x12')][_0xdae3('0x14')]);return _0x350ad9(_0x275236['error'][_0xdae3('0x14')]);}logger[_0xdae3('0x12')](_0xdae3('0xd'),_0x55ae8d,_0x275236['error'][_0xdae3('0x14')]);return _0x182498(_0x275236['error'][_0xdae3('0x14')]);}else{logger[_0xdae3('0xc')](_0xdae3('0xd'),_0x55ae8d,_0xdae3('0xe'));_0x182498(_0x275236[_0xdae3('0x15')][_0xdae3('0x14')]);}})[_0xdae3('0x16')](function(_0x415ce3){logger[_0xdae3('0x12')](_0xdae3('0xd'),_0x55ae8d,_0x415ce3);_0x350ad9(_0x415ce3);});});}exports[_0xdae3('0x17')]=function(_0x4165a5){var _0x13fa43=this;return new Promise(function(_0x16aa45,_0x26484c){return db[_0xdae3('0x18')][_0xdae3('0x19')]({'raw':_0x4165a5[_0xdae3('0x1a')]?_0x4165a5[_0xdae3('0x1a')][_0xdae3('0x1b')]===undefined?!![]:![]:!![],'where':_0x4165a5[_0xdae3('0x1a')]?_0x4165a5[_0xdae3('0x1a')][_0xdae3('0x1c')]||null:null,'attributes':_0x4165a5[_0xdae3('0x1a')]?_0x4165a5['options']['attributes']||null:null,'limit':_0x4165a5['options']?_0x4165a5['options'][_0xdae3('0x1d')]||null:null,'include':_0x4165a5[_0xdae3('0x1a')]?_0x4165a5[_0xdae3('0x1a')][_0xdae3('0x1e')]?_[_0xdae3('0x1f')](_0x4165a5['options'][_0xdae3('0x1e')],function(_0x922746){return{'model':db[_0x922746[_0xdae3('0x20')]],'as':_0x922746['as'],'attributes':_0x922746[_0xdae3('0x21')],'include':_0x922746['include']?_[_0xdae3('0x1f')](_0x922746['include'],function(_0x14293){return{'model':db[_0x14293[_0xdae3('0x20')]],'as':_0x14293['as'],'attributes':_0x14293[_0xdae3('0x21')],'include':_0x14293['include']?_[_0xdae3('0x1f')](_0x14293[_0xdae3('0x1e')],function(_0xde5f1c){return{'model':db[_0xde5f1c['model']],'as':_0xde5f1c['as'],'attributes':_0xde5f1c[_0xdae3('0x21')]};}):[]};}):[]};}):[]:[]})[_0xdae3('0x22')](function(_0x2a8a8c){logger[_0xdae3('0xc')](_0xdae3('0x17'),_0x4165a5);logger[_0xdae3('0xf')](_0xdae3('0x17'),_0x4165a5,JSON[_0xdae3('0x11')](_0x2a8a8c));_0x16aa45(_0x2a8a8c);})[_0xdae3('0x16')](function(_0x5ce09f){logger['error'](_0xdae3('0x17'),_0x5ce09f[_0xdae3('0x14')],_0x4165a5);_0x26484c(_0x13fa43[_0xdae3('0x12')](0x1f4,_0x5ce09f[_0xdae3('0x14')]));});});};exports[_0xdae3('0x23')]=function(_0x126367){var _0x394ed4=this;return new Promise(function(_0x517407,_0x51ca03){return db[_0xdae3('0x18')][_0xdae3('0x24')]({'raw':_0x126367['options']?_0x126367['options'][_0xdae3('0x1b')]===undefined?!![]:![]:!![],'where':_0x126367['options']?_0x126367[_0xdae3('0x1a')][_0xdae3('0x1c')]||null:null,'attributes':_0x126367[_0xdae3('0x1a')]?_0x126367[_0xdae3('0x1a')][_0xdae3('0x21')]||null:null,'include':_0x126367['options']?_0x126367[_0xdae3('0x1a')][_0xdae3('0x1e')]?_[_0xdae3('0x1f')](_0x126367[_0xdae3('0x1a')][_0xdae3('0x1e')],function(_0x20ca88){return{'model':db[_0x20ca88[_0xdae3('0x20')]],'as':_0x20ca88['as'],'attributes':_0x20ca88['attributes'],'include':_0x20ca88['include']?_['map'](_0x20ca88['include'],function(_0x409f40){return{'model':db[_0x409f40['model']],'as':_0x409f40['as'],'attributes':_0x409f40['attributes'],'include':_0x409f40[_0xdae3('0x1e')]?_['map'](_0x409f40['include'],function(_0x28b47f){return{'model':db[_0x28b47f[_0xdae3('0x20')]],'as':_0x28b47f['as'],'attributes':_0x28b47f['attributes']};}):[]};}):[]};}):[]:[]})[_0xdae3('0x22')](function(_0xd77629){logger[_0xdae3('0xc')]('ShowServicenowAccount',_0x126367);logger[_0xdae3('0xf')](_0xdae3('0x23'),_0x126367,JSON[_0xdae3('0x11')](_0xd77629));_0x517407(_0xd77629);})[_0xdae3('0x16')](function(_0x272dc9){logger[_0xdae3('0x12')](_0xdae3('0x23'),_0x272dc9[_0xdae3('0x14')],_0x126367);_0x51ca03(_0x394ed4[_0xdae3('0x12')](0x1f4,_0x272dc9['message']));});});}; \ No newline at end of file +var _0x1c3b=['then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowServicenowAccount','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x1c3b,0xd1));var _0xb1c3=function(_0x588172,_0x293724){_0x588172=_0x588172-0x0;var _0x12ef02=_0x1c3b[_0x588172];return _0x12ef02;};'use strict';var _=require('lodash');var util=require(_0xb1c3('0x0'));var moment=require('moment');var BPromise=require(_0xb1c3('0x1'));var rs=require(_0xb1c3('0x2'));var fs=require('fs');var Redis=require(_0xb1c3('0x3'));var db=require(_0xb1c3('0x4'))['db'];var utils=require(_0xb1c3('0x5'));var logger=require(_0xb1c3('0x6'))(_0xb1c3('0x7'));var config=require(_0xb1c3('0x8'));var jayson=require(_0xb1c3('0x9'));var client=jayson[_0xb1c3('0xa')][_0xb1c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2814fe,_0x2b92da,_0x3bfce4){return new BPromise(function(_0x5d683b,_0x448128){return client[_0xb1c3('0xc')](_0x2814fe,_0x3bfce4)[_0xb1c3('0xd')](function(_0x76b21f){logger[_0xb1c3('0xe')](_0xb1c3('0xf'),_0x2b92da,_0xb1c3('0x10'));logger['debug'](_0xb1c3('0x11'),_0x2b92da,_0xb1c3('0x10'),JSON[_0xb1c3('0x12')](_0x76b21f));if(_0x76b21f['error']){if(_0x76b21f['error'][_0xb1c3('0x13')]===0x1f4){logger[_0xb1c3('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x2b92da,_0x76b21f[_0xb1c3('0x14')][_0xb1c3('0x15')]);return _0x448128(_0x76b21f[_0xb1c3('0x14')]['message']);}logger['error'](_0xb1c3('0xf'),_0x2b92da,_0x76b21f[_0xb1c3('0x14')]['message']);return _0x5d683b(_0x76b21f[_0xb1c3('0x14')]['message']);}else{logger['info'](_0xb1c3('0xf'),_0x2b92da,'request\x20sent');_0x5d683b(_0x76b21f[_0xb1c3('0x16')]['message']);}})[_0xb1c3('0x17')](function(_0x439954){logger[_0xb1c3('0x14')](_0xb1c3('0xf'),_0x2b92da,_0x439954);_0x448128(_0x439954);});});}exports[_0xb1c3('0x18')]=function(_0x3aa891){var _0x1a2f59=this;return new Promise(function(_0x180886,_0x58ea8f){return db[_0xb1c3('0x19')][_0xb1c3('0x1a')]({'raw':_0x3aa891[_0xb1c3('0x1b')]?_0x3aa891[_0xb1c3('0x1b')][_0xb1c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x3aa891[_0xb1c3('0x1b')]?_0x3aa891[_0xb1c3('0x1b')]['where']||null:null,'attributes':_0x3aa891[_0xb1c3('0x1b')]?_0x3aa891[_0xb1c3('0x1b')][_0xb1c3('0x1d')]||null:null,'limit':_0x3aa891[_0xb1c3('0x1b')]?_0x3aa891[_0xb1c3('0x1b')][_0xb1c3('0x1e')]||null:null,'include':_0x3aa891['options']?_0x3aa891['options'][_0xb1c3('0x1f')]?_[_0xb1c3('0x20')](_0x3aa891[_0xb1c3('0x1b')]['include'],function(_0x4bf386){return{'model':db[_0x4bf386[_0xb1c3('0x21')]],'as':_0x4bf386['as'],'attributes':_0x4bf386[_0xb1c3('0x1d')],'include':_0x4bf386[_0xb1c3('0x1f')]?_['map'](_0x4bf386[_0xb1c3('0x1f')],function(_0x42e5b5){return{'model':db[_0x42e5b5[_0xb1c3('0x21')]],'as':_0x42e5b5['as'],'attributes':_0x42e5b5[_0xb1c3('0x1d')],'include':_0x42e5b5[_0xb1c3('0x1f')]?_[_0xb1c3('0x20')](_0x42e5b5['include'],function(_0x1f2d55){return{'model':db[_0x1f2d55['model']],'as':_0x1f2d55['as'],'attributes':_0x1f2d55[_0xb1c3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb1c3('0xd')](function(_0x3009d9){logger[_0xb1c3('0xe')](_0xb1c3('0x18'),_0x3aa891);logger[_0xb1c3('0x22')]('GetServicenowAccount',_0x3aa891,JSON['stringify'](_0x3009d9));_0x180886(_0x3009d9);})[_0xb1c3('0x17')](function(_0x3cd00a){logger['error']('GetServicenowAccount',_0x3cd00a[_0xb1c3('0x15')],_0x3aa891);_0x58ea8f(_0x1a2f59['error'](0x1f4,_0x3cd00a[_0xb1c3('0x15')]));});});};exports[_0xb1c3('0x23')]=function(_0x96128d){var _0x1bda02=this;return new Promise(function(_0x59b8ce,_0x2bc01b){return db[_0xb1c3('0x19')]['find']({'raw':_0x96128d[_0xb1c3('0x1b')]?_0x96128d['options']['raw']===undefined?!![]:![]:!![],'where':_0x96128d[_0xb1c3('0x1b')]?_0x96128d['options'][_0xb1c3('0x24')]||null:null,'attributes':_0x96128d[_0xb1c3('0x1b')]?_0x96128d[_0xb1c3('0x1b')]['attributes']||null:null,'include':_0x96128d[_0xb1c3('0x1b')]?_0x96128d[_0xb1c3('0x1b')][_0xb1c3('0x1f')]?_[_0xb1c3('0x20')](_0x96128d[_0xb1c3('0x1b')]['include'],function(_0x54659f){return{'model':db[_0x54659f['model']],'as':_0x54659f['as'],'attributes':_0x54659f[_0xb1c3('0x1d')],'include':_0x54659f['include']?_[_0xb1c3('0x20')](_0x54659f[_0xb1c3('0x1f')],function(_0x5155a2){return{'model':db[_0x5155a2['model']],'as':_0x5155a2['as'],'attributes':_0x5155a2[_0xb1c3('0x1d')],'include':_0x5155a2[_0xb1c3('0x1f')]?_[_0xb1c3('0x20')](_0x5155a2[_0xb1c3('0x1f')],function(_0x43af64){return{'model':db[_0x43af64[_0xb1c3('0x21')]],'as':_0x43af64['as'],'attributes':_0x43af64[_0xb1c3('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19ac4f){logger[_0xb1c3('0xe')](_0xb1c3('0x23'),_0x96128d);logger[_0xb1c3('0x22')](_0xb1c3('0x23'),_0x96128d,JSON[_0xb1c3('0x12')](_0x19ac4f));_0x59b8ce(_0x19ac4f);})[_0xb1c3('0x17')](function(_0x4c8e5e){logger[_0xb1c3('0x14')](_0xb1c3('0x23'),_0x4c8e5e[_0xb1c3('0x15')],_0x96128d);_0x2bc01b(_0x1bda02[_0xb1c3('0x14')](0x1f4,_0x4c8e5e['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 1b52594..cfa2150 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 _0xdd17=['./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2d819b,_0x321af5){var _0x3799fd=function(_0x50090b){while(--_0x50090b){_0x2d819b['push'](_0x2d819b['shift']());}};_0x3799fd(++_0x321af5);}(_0xdd17,0xb1));var _0x7dd1=function(_0x2badee,_0xa39b95){_0x2badee=_0x2badee-0x0;var _0x3f645c=_0xdd17[_0x2badee];return _0x3f645c;};'use strict';var multer=require('multer');var util=require(_0x7dd1('0x0'));var path=require('path');var timeout=require(_0x7dd1('0x1'));var express=require(_0x7dd1('0x2'));var router=express[_0x7dd1('0x3')]();var fs_extra=require(_0x7dd1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7dd1('0x5'));var config=require(_0x7dd1('0x6'));var controller=require(_0x7dd1('0x7'));router[_0x7dd1('0x8')]('/',auth[_0x7dd1('0x9')](),controller[_0x7dd1('0xa')]);router[_0x7dd1('0x8')](_0x7dd1('0xb'),auth[_0x7dd1('0x9')](),controller[_0x7dd1('0xc')]);router['get'](_0x7dd1('0xd'),auth[_0x7dd1('0x9')](),controller[_0x7dd1('0xe')]);router[_0x7dd1('0x8')](_0x7dd1('0xf'),auth[_0x7dd1('0x9')](),controller[_0x7dd1('0x10')]);router[_0x7dd1('0x8')](_0x7dd1('0x11'),auth['isAuthenticated'](),controller[_0x7dd1('0x12')]);router[_0x7dd1('0x13')]('/',auth[_0x7dd1('0x9')](),controller[_0x7dd1('0x14')]);router['put'](_0x7dd1('0xb'),auth[_0x7dd1('0x9')](),controller[_0x7dd1('0x15')]);router['delete'](_0x7dd1('0xb'),auth[_0x7dd1('0x9')](),controller[_0x7dd1('0x16')]);module['exports']=router; \ No newline at end of file +var _0xa3b9=['index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3b9,0x6d));var _0x9a3b=function(_0x36e5f8,_0x3dca06){_0x36e5f8=_0x36e5f8-0x0;var _0x92254a=_0xa3b9[_0x36e5f8];return _0x92254a;};'use strict';var multer=require(_0x9a3b('0x0'));var util=require(_0x9a3b('0x1'));var path=require(_0x9a3b('0x2'));var timeout=require(_0x9a3b('0x3'));var express=require('express');var router=express[_0x9a3b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9a3b('0x5'));var interaction=require(_0x9a3b('0x6'));var config=require(_0x9a3b('0x7'));var controller=require(_0x9a3b('0x8'));router[_0x9a3b('0x9')]('/',auth[_0x9a3b('0xa')](),controller[_0x9a3b('0xb')]);router[_0x9a3b('0x9')](_0x9a3b('0xc'),auth['isAuthenticated'](),controller[_0x9a3b('0xd')]);router[_0x9a3b('0x9')](_0x9a3b('0xe'),auth[_0x9a3b('0xa')](),controller[_0x9a3b('0xf')]);router[_0x9a3b('0x9')](_0x9a3b('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x9a3b('0x11'),auth[_0x9a3b('0xa')](),controller[_0x9a3b('0x12')]);router[_0x9a3b('0x13')]('/',auth['isAuthenticated'](),controller[_0x9a3b('0x14')]);router[_0x9a3b('0x15')](_0x9a3b('0xc'),auth[_0x9a3b('0xa')](),controller['update']);router[_0x9a3b('0x16')](_0x9a3b('0xc'),auth['isAuthenticated'](),controller[_0x9a3b('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index ac565cf..c86c862 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 _0x47c0=['STRING','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x47c0,0x1a8));var _0x047c=function(_0x4556a0,_0x25f095){_0x4556a0=_0x4556a0-0x0;var _0x21d58c=_0x47c0[_0x4556a0];return _0x21d58c;};'use strict';var Sequelize=require(_0x047c('0x0'));module[_0x047c('0x1')]={'name':{'type':Sequelize[_0x047c('0x2')]},'description':{'type':Sequelize[_0x047c('0x2')]}}; \ No newline at end of file +var _0x91f8=['STRING','sequelize','exports'];(function(_0x3749d8,_0x106971){var _0x19d29c=function(_0x5cc0b8){while(--_0x5cc0b8){_0x3749d8['push'](_0x3749d8['shift']());}};_0x19d29c(++_0x106971);}(_0x91f8,0x124));var _0x891f=function(_0x50d471,_0x2d9086){_0x50d471=_0x50d471-0x0;var _0x214900=_0x91f8[_0x50d471];return _0x214900;};'use strict';var Sequelize=require(_0x891f('0x0'));module[_0x891f('0x1')]={'name':{'type':Sequelize[_0x891f('0x2')]},'description':{'type':Sequelize[_0x891f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index ebb590b..e1154f7 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 _0xcff9=['ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','getFields','ServicenowField','hasOwnProperty','nolimit','getSubjects','findOne','order','getDescriptions','rawAttributes','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x4b7c92,_0x38587d){var _0x22b768=function(_0x5b4901){while(--_0x5b4901){_0x4b7c92['push'](_0x4b7c92['shift']());}};_0x22b768(++_0x38587d);}(_0xcff9,0x93));var _0x9cff=function(_0x416fda,_0x102f03){_0x416fda=_0x416fda-0x0;var _0x4887d4=_0xcff9[_0x416fda];return _0x4887d4;};'use strict';var emlformat=require(_0x9cff('0x0'));var rimraf=require(_0x9cff('0x1'));var zipdir=require(_0x9cff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9cff('0x3'));var moment=require(_0x9cff('0x4'));var BPromise=require(_0x9cff('0x5'));var Mustache=require(_0x9cff('0x6'));var util=require(_0x9cff('0x7'));var path=require(_0x9cff('0x8'));var sox=require(_0x9cff('0x9'));var csv=require(_0x9cff('0xa'));var ejs=require(_0x9cff('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9cff('0xc'));var squel=require(_0x9cff('0xd'));var crypto=require('crypto');var jsforce=require(_0x9cff('0xe'));var deskjs=require(_0x9cff('0xf'));var toCsv=require(_0x9cff('0xa'));var querystring=require('querystring');var Papa=require(_0x9cff('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9cff('0x11'));var as=require(_0x9cff('0x12'));var hardwareService=require(_0x9cff('0x13'));var logger=require(_0x9cff('0x14'))(_0x9cff('0x15'));var utils=require(_0x9cff('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9cff('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3819f0,_0x56a31e){_0x56a31e=_0x56a31e||0xcc;return function(_0x244778){if(_0x244778){return _0x3819f0[_0x9cff('0x18')](_0x56a31e);}return _0x3819f0[_0x9cff('0x19')](_0x56a31e)[_0x9cff('0x1a')]();};}function respondWithResult(_0x5ceff2,_0x508bdc){_0x508bdc=_0x508bdc||0xc8;return function(_0x1bea96){if(_0x1bea96){return _0x5ceff2[_0x9cff('0x19')](_0x508bdc)['json'](_0x1bea96);}};}function respondWithFilteredResult(_0xdebd7c,_0xfccf97){return function(_0x24b08c){if(_0x24b08c){var _0x3575dd=typeof _0xfccf97['offset']===_0x9cff('0x1b')&&typeof _0xfccf97[_0x9cff('0x1c')]===_0x9cff('0x1b');var _0x2008eb=_0x24b08c['count'];var _0x48905f=_0x3575dd?0x0:_0xfccf97['offset'];var _0x221806=_0x3575dd?_0x24b08c[_0x9cff('0x1d')]:_0xfccf97[_0x9cff('0x1e')]+_0xfccf97[_0x9cff('0x1c')];var _0x4795e8;if(_0x221806>=_0x2008eb){_0x221806=_0x2008eb;_0x4795e8=0xc8;}else{_0x4795e8=0xce;}_0xdebd7c[_0x9cff('0x19')](_0x4795e8);return _0xdebd7c['set'](_0x9cff('0x1f'),_0x48905f+'-'+_0x221806+'/'+_0x2008eb)['json'](_0x24b08c);}return null;};}function patchUpdates(_0xe84656){return function(_0x36e66c){try{jsonpatch[_0x9cff('0x20')](_0x36e66c,_0xe84656,!![]);}catch(_0x2822f4){return BPromise['reject'](_0x2822f4);}return _0x36e66c[_0x9cff('0x21')]();};}function saveUpdates(_0x1f0a0c,_0xa6e8b){return function(_0x51125e){if(_0x51125e){return _0x51125e[_0x9cff('0x22')](_0x1f0a0c)[_0x9cff('0x23')](function(_0x45b42b){return _0x45b42b;});}return null;};}function removeEntity(_0x34d5ec,_0x50e425){return function(_0x27b254){if(_0x27b254){return _0x27b254[_0x9cff('0x24')]()[_0x9cff('0x23')](function(){_0x34d5ec[_0x9cff('0x19')](0xcc)[_0x9cff('0x1a')]();});}};}function handleEntityNotFound(_0x49166d,_0x9cbf7d){return function(_0x17b1f5){if(!_0x17b1f5){_0x49166d[_0x9cff('0x18')](0x194);}return _0x17b1f5;};}function handleError(_0x58af67,_0x292e46){_0x292e46=_0x292e46||0x1f4;return function(_0x1a3cf9){logger['error'](_0x1a3cf9[_0x9cff('0x25')]);if(_0x1a3cf9[_0x9cff('0x26')]){delete _0x1a3cf9[_0x9cff('0x26')];}_0x58af67[_0x9cff('0x19')](_0x292e46)[_0x9cff('0x27')](_0x1a3cf9);};}exports[_0x9cff('0x28')]=function(_0x5c6e40,_0xe157de){var _0x329e72={},_0x533611={},_0x2bb7c8={'count':0x0,'rows':[]};var _0x184f08=_[_0x9cff('0x29')](db[_0x9cff('0x2a')]['rawAttributes'],function(_0x592c35){return{'name':_0x592c35[_0x9cff('0x2b')],'type':_0x592c35[_0x9cff('0x2c')][_0x9cff('0x2d')]};});_0x533611[_0x9cff('0x2e')]=_[_0x9cff('0x29')](_0x184f08,_0x9cff('0x26'));_0x533611[_0x9cff('0x2f')]=_[_0x9cff('0x30')](_0x5c6e40['query']);_0x533611[_0x9cff('0x31')]=_[_0x9cff('0x32')](_0x533611[_0x9cff('0x2e')],_0x533611[_0x9cff('0x2f')]);_0x329e72[_0x9cff('0x33')]=_[_0x9cff('0x32')](_0x533611[_0x9cff('0x2e')],qs['fields'](_0x5c6e40[_0x9cff('0x2f')]['fields']));_0x329e72[_0x9cff('0x33')]=_0x329e72[_0x9cff('0x33')][_0x9cff('0x34')]?_0x329e72['attributes']:_0x533611[_0x9cff('0x2e')];if(!_0x5c6e40[_0x9cff('0x2f')]['hasOwnProperty']('nolimit')){_0x329e72[_0x9cff('0x1c')]=qs[_0x9cff('0x1c')](_0x5c6e40[_0x9cff('0x2f')][_0x9cff('0x1c')]);_0x329e72[_0x9cff('0x1e')]=qs['offset'](_0x5c6e40[_0x9cff('0x2f')][_0x9cff('0x1e')]);}_0x329e72['order']=qs['sort'](_0x5c6e40['query'][_0x9cff('0x35')]);_0x329e72[_0x9cff('0x36')]=qs[_0x9cff('0x31')](_[_0x9cff('0x37')](_0x5c6e40[_0x9cff('0x2f')],_0x533611[_0x9cff('0x31')]),_0x184f08);if(_0x5c6e40[_0x9cff('0x2f')][_0x9cff('0x38')]){_0x329e72[_0x9cff('0x36')]=_[_0x9cff('0x39')](_0x329e72[_0x9cff('0x36')],{'$or':_['map'](_0x184f08,function(_0x3f1230){if(_0x3f1230['type']!=='VIRTUAL'){var _0x81ceda={};_0x81ceda[_0x3f1230[_0x9cff('0x26')]]={'$like':'%'+_0x5c6e40[_0x9cff('0x2f')][_0x9cff('0x38')]+'%'};return _0x81ceda;}})});}_0x329e72=_[_0x9cff('0x39')]({},_0x329e72,_0x5c6e40[_0x9cff('0x3a')]);var _0x5b8f67={'where':_0x329e72['where']};return db[_0x9cff('0x2a')][_0x9cff('0x1d')](_0x5b8f67)['then'](function(_0x502ff7){_0x2bb7c8[_0x9cff('0x1d')]=_0x502ff7;if(_0x5c6e40['query'][_0x9cff('0x3b')]){_0x329e72['include']=[{'all':!![]}];}return db[_0x9cff('0x2a')][_0x9cff('0x3c')](_0x329e72);})[_0x9cff('0x23')](function(_0x402c21){_0x2bb7c8[_0x9cff('0x3d')]=_0x402c21;return _0x2bb7c8;})['then'](respondWithFilteredResult(_0xe157de,_0x329e72))[_0x9cff('0x3e')](handleError(_0xe157de,null));};exports[_0x9cff('0x3f')]=function(_0xad95a7,_0x3565ed){var _0x4f9265={'raw':![],'where':{'id':_0xad95a7[_0x9cff('0x40')]['id']}},_0x1c41dd={};_0x1c41dd['model']=_['keys'](db[_0x9cff('0x2a')]['rawAttributes']);_0x1c41dd[_0x9cff('0x2f')]=_[_0x9cff('0x30')](_0xad95a7[_0x9cff('0x2f')]);_0x1c41dd[_0x9cff('0x31')]=_[_0x9cff('0x32')](_0x1c41dd[_0x9cff('0x2e')],_0x1c41dd[_0x9cff('0x2f')]);_0x4f9265[_0x9cff('0x33')]=_[_0x9cff('0x32')](_0x1c41dd['model'],qs[_0x9cff('0x41')](_0xad95a7['query'][_0x9cff('0x41')]));_0x4f9265[_0x9cff('0x33')]=_0x4f9265[_0x9cff('0x33')]['length']?_0x4f9265[_0x9cff('0x33')]:_0x1c41dd['model'];if(_0xad95a7[_0x9cff('0x2f')][_0x9cff('0x3b')]){_0x4f9265[_0x9cff('0x42')]=[{'all':!![]}];}_0x4f9265=_['merge']({},_0x4f9265,_0xad95a7[_0x9cff('0x3a')]);return db['ServicenowConfiguration'][_0x9cff('0x43')](_0x4f9265)[_0x9cff('0x23')](handleEntityNotFound(_0x3565ed,null))['then'](respondWithResult(_0x3565ed,null))[_0x9cff('0x3e')](handleError(_0x3565ed,null));};exports[_0x9cff('0x44')]=function(_0x3c5566,_0x1f51e1){return db[_0x9cff('0x2a')][_0x9cff('0x44')](_0x3c5566[_0x9cff('0x45')],{})[_0x9cff('0x23')](respondWithResult(_0x1f51e1,0xc9))[_0x9cff('0x3e')](handleError(_0x1f51e1,null));};exports[_0x9cff('0x22')]=function(_0x3c2337,_0x390818){if(_0x3c2337[_0x9cff('0x45')]['id']){delete _0x3c2337[_0x9cff('0x45')]['id'];}return db['ServicenowConfiguration'][_0x9cff('0x43')]({'where':{'id':_0x3c2337[_0x9cff('0x40')]['id']}})['then'](handleEntityNotFound(_0x390818,null))[_0x9cff('0x23')](saveUpdates(_0x3c2337['body'],null))[_0x9cff('0x23')](respondWithResult(_0x390818,null))[_0x9cff('0x3e')](handleError(_0x390818,null));};exports[_0x9cff('0x24')]=function(_0x15563e,_0x1871e0){return db['ServicenowConfiguration'][_0x9cff('0x43')]({'where':{'id':_0x15563e[_0x9cff('0x40')]['id']}})[_0x9cff('0x23')](handleEntityNotFound(_0x1871e0,null))['then'](removeEntity(_0x1871e0,null))[_0x9cff('0x3e')](handleError(_0x1871e0,null));};exports[_0x9cff('0x46')]=function(_0x5880a6,_0xef881a,_0x7143c5){var _0x4f66ca={};var _0xb428ca={};var _0x1c027f;var _0x13d21d;return db[_0x9cff('0x2a')]['findOne']({'where':{'id':_0x5880a6[_0x9cff('0x40')]['id']}})[_0x9cff('0x23')](handleEntityNotFound(_0xef881a,null))[_0x9cff('0x23')](function(_0x5463d2){if(_0x5463d2){_0x1c027f=_0x5463d2;_0xb428ca[_0x9cff('0x2e')]=_[_0x9cff('0x30')](db[_0x9cff('0x47')]['rawAttributes']);_0xb428ca[_0x9cff('0x2f')]=_['keys'](_0x5880a6[_0x9cff('0x2f')]);_0xb428ca[_0x9cff('0x31')]=_[_0x9cff('0x32')](_0xb428ca[_0x9cff('0x2e')],_0xb428ca['query']);_0x4f66ca[_0x9cff('0x33')]=_[_0x9cff('0x32')](_0xb428ca[_0x9cff('0x2e')],qs[_0x9cff('0x41')](_0x5880a6[_0x9cff('0x2f')][_0x9cff('0x41')]));_0x4f66ca[_0x9cff('0x33')]=_0x4f66ca[_0x9cff('0x33')]['length']?_0x4f66ca[_0x9cff('0x33')]:_0xb428ca[_0x9cff('0x2e')];_0x4f66ca['order']=qs[_0x9cff('0x35')](_0x5880a6['query']['sort']);_0x4f66ca[_0x9cff('0x36')]=qs[_0x9cff('0x31')](_[_0x9cff('0x37')](_0x5880a6[_0x9cff('0x2f')],_0xb428ca[_0x9cff('0x31')]));if(_0x5880a6['query'][_0x9cff('0x38')]){_0x4f66ca[_0x9cff('0x36')]=_[_0x9cff('0x39')](_0x4f66ca[_0x9cff('0x36')],{'$or':_[_0x9cff('0x29')](_0x4f66ca[_0x9cff('0x33')],function(_0x3b4cae){var _0x293b89={};_0x293b89[_0x3b4cae]={'$like':'%'+_0x5880a6[_0x9cff('0x2f')][_0x9cff('0x38')]+'%'};return _0x293b89;})});}_0x4f66ca=_['merge']({},_0x4f66ca,_0x5880a6['options']);return _0x1c027f[_0x9cff('0x46')](_0x4f66ca);}})[_0x9cff('0x23')](function(_0x2e0a14){if(_0x2e0a14){_0x13d21d=_0x2e0a14['length'];if(!_0x5880a6[_0x9cff('0x2f')][_0x9cff('0x48')](_0x9cff('0x49'))){_0x4f66ca[_0x9cff('0x1c')]=qs['limit'](_0x5880a6['query'][_0x9cff('0x1c')]);_0x4f66ca['offset']=qs[_0x9cff('0x1e')](_0x5880a6[_0x9cff('0x2f')]['offset']);}return _0x1c027f['getFields'](_0x4f66ca);}})[_0x9cff('0x23')](function(_0x5a0789){if(_0x5a0789){return _0x5a0789?{'count':_0x13d21d,'rows':_0x5a0789}:null;}})[_0x9cff('0x23')](respondWithResult(_0xef881a,null))[_0x9cff('0x3e')](handleError(_0xef881a,null));};exports[_0x9cff('0x4a')]=function(_0xc4a669,_0x55120c,_0x2e070b){var _0x27b925={};var _0x42f23b={};var _0x5a06a3;var _0x44ac93;return db['ServicenowConfiguration'][_0x9cff('0x4b')]({'where':{'id':_0xc4a669[_0x9cff('0x40')]['id']}})['then'](handleEntityNotFound(_0x55120c,null))['then'](function(_0xccfc69){if(_0xccfc69){_0x5a06a3=_0xccfc69;_0x42f23b['model']=_[_0x9cff('0x30')](db['ServicenowField']['rawAttributes']);_0x42f23b['query']=_['keys'](_0xc4a669[_0x9cff('0x2f')]);_0x42f23b[_0x9cff('0x31')]=_[_0x9cff('0x32')](_0x42f23b['model'],_0x42f23b[_0x9cff('0x2f')]);_0x27b925['attributes']=_[_0x9cff('0x32')](_0x42f23b[_0x9cff('0x2e')],qs[_0x9cff('0x41')](_0xc4a669['query'][_0x9cff('0x41')]));_0x27b925[_0x9cff('0x33')]=_0x27b925[_0x9cff('0x33')][_0x9cff('0x34')]?_0x27b925['attributes']:_0x42f23b[_0x9cff('0x2e')];_0x27b925[_0x9cff('0x4c')]=qs[_0x9cff('0x35')](_0xc4a669['query']['sort']);_0x27b925['where']=qs['filters'](_[_0x9cff('0x37')](_0xc4a669['query'],_0x42f23b[_0x9cff('0x31')]));if(_0xc4a669['query'][_0x9cff('0x38')]){_0x27b925['where']=_[_0x9cff('0x39')](_0x27b925['where'],{'$or':_[_0x9cff('0x29')](_0x27b925[_0x9cff('0x33')],function(_0x415acc){var _0x1528af={};_0x1528af[_0x415acc]={'$like':'%'+_0xc4a669['query']['filter']+'%'};return _0x1528af;})});}_0x27b925=_[_0x9cff('0x39')]({},_0x27b925,_0xc4a669[_0x9cff('0x3a')]);return _0x5a06a3[_0x9cff('0x4a')](_0x27b925);}})['then'](function(_0x23a10a){if(_0x23a10a){_0x44ac93=_0x23a10a[_0x9cff('0x34')];if(!_0xc4a669['query'][_0x9cff('0x48')](_0x9cff('0x49'))){_0x27b925[_0x9cff('0x1c')]=qs['limit'](_0xc4a669[_0x9cff('0x2f')]['limit']);_0x27b925['offset']=qs[_0x9cff('0x1e')](_0xc4a669['query']['offset']);}return _0x5a06a3[_0x9cff('0x4a')](_0x27b925);}})[_0x9cff('0x23')](function(_0x2528c3){if(_0x2528c3){return _0x2528c3?{'count':_0x44ac93,'rows':_0x2528c3}:null;}})[_0x9cff('0x23')](respondWithResult(_0x55120c,null))['catch'](handleError(_0x55120c,null));};exports[_0x9cff('0x4d')]=function(_0x482cae,_0x214deb,_0x186f0d){var _0x40d659={};var _0x857fbf={};var _0x1342a2;var _0x4d4885;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x482cae[_0x9cff('0x40')]['id']}})['then'](handleEntityNotFound(_0x214deb,null))[_0x9cff('0x23')](function(_0x5cf929){if(_0x5cf929){_0x1342a2=_0x5cf929;_0x857fbf[_0x9cff('0x2e')]=_[_0x9cff('0x30')](db[_0x9cff('0x47')][_0x9cff('0x4e')]);_0x857fbf[_0x9cff('0x2f')]=_[_0x9cff('0x30')](_0x482cae[_0x9cff('0x2f')]);_0x857fbf[_0x9cff('0x31')]=_[_0x9cff('0x32')](_0x857fbf[_0x9cff('0x2e')],_0x857fbf[_0x9cff('0x2f')]);_0x40d659[_0x9cff('0x33')]=_[_0x9cff('0x32')](_0x857fbf[_0x9cff('0x2e')],qs[_0x9cff('0x41')](_0x482cae[_0x9cff('0x2f')][_0x9cff('0x41')]));_0x40d659[_0x9cff('0x33')]=_0x40d659['attributes'][_0x9cff('0x34')]?_0x40d659[_0x9cff('0x33')]:_0x857fbf[_0x9cff('0x2e')];_0x40d659[_0x9cff('0x4c')]=qs[_0x9cff('0x35')](_0x482cae[_0x9cff('0x2f')]['sort']);_0x40d659[_0x9cff('0x36')]=qs[_0x9cff('0x31')](_[_0x9cff('0x37')](_0x482cae[_0x9cff('0x2f')],_0x857fbf[_0x9cff('0x31')]));if(_0x482cae['query'][_0x9cff('0x38')]){_0x40d659['where']=_[_0x9cff('0x39')](_0x40d659[_0x9cff('0x36')],{'$or':_[_0x9cff('0x29')](_0x40d659[_0x9cff('0x33')],function(_0x2bba5c){var _0x1d1972={};_0x1d1972[_0x2bba5c]={'$like':'%'+_0x482cae[_0x9cff('0x2f')]['filter']+'%'};return _0x1d1972;})});}_0x40d659=_['merge']({},_0x40d659,_0x482cae[_0x9cff('0x3a')]);return _0x1342a2[_0x9cff('0x4d')](_0x40d659);}})[_0x9cff('0x23')](function(_0x4dc37d){if(_0x4dc37d){_0x4d4885=_0x4dc37d['length'];if(!_0x482cae[_0x9cff('0x2f')][_0x9cff('0x48')]('nolimit')){_0x40d659['limit']=qs['limit'](_0x482cae['query'][_0x9cff('0x1c')]);_0x40d659[_0x9cff('0x1e')]=qs['offset'](_0x482cae[_0x9cff('0x2f')]['offset']);}return _0x1342a2['getDescriptions'](_0x40d659);}})[_0x9cff('0x23')](function(_0x1cedf8){if(_0x1cedf8){return _0x1cedf8?{'count':_0x4d4885,'rows':_0x1cedf8}:null;}})[_0x9cff('0x23')](respondWithResult(_0x214deb,null))['catch'](handleError(_0x214deb,null));}; \ No newline at end of file +var _0xa964=['VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','getFields','ServicenowField','order','findOne','getSubjects','getDescriptions','eml-format','zip-dir','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','type'];(function(_0xe012e0,_0x5319a0){var _0x5e2d40=function(_0xf97b4c){while(--_0xf97b4c){_0xe012e0['push'](_0xe012e0['shift']());}};_0x5e2d40(++_0x5319a0);}(_0xa964,0xb6));var _0x4a96=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0xa964[_0x119280];return _0x481797;};'use strict';var emlformat=require(_0x4a96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a96('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a96('0x2'));var Mustache=require('mustache');var util=require(_0x4a96('0x3'));var path=require('path');var sox=require(_0x4a96('0x4'));var csv=require('to-csv');var ejs=require(_0x4a96('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a96('0x6'));var squel=require(_0x4a96('0x7'));var crypto=require(_0x4a96('0x8'));var jsforce=require(_0x4a96('0x9'));var deskjs=require(_0x4a96('0xa'));var toCsv=require(_0x4a96('0xb'));var querystring=require(_0x4a96('0xc'));var Papa=require(_0x4a96('0xd'));var Redis=require(_0x4a96('0xe'));var authService=require(_0x4a96('0xf'));var qs=require(_0x4a96('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a96('0x11'))('api');var utils=require(_0x4a96('0x12'));var config=require(_0x4a96('0x13'));var licenseUtil=require(_0x4a96('0x14'));var db=require(_0x4a96('0x15'))['db'];function respondWithStatusCode(_0x11e321,_0xd09cd7){_0xd09cd7=_0xd09cd7||0xcc;return function(_0x561dc5){if(_0x561dc5){return _0x11e321['sendStatus'](_0xd09cd7);}return _0x11e321['status'](_0xd09cd7)[_0x4a96('0x16')]();};}function respondWithResult(_0x24e488,_0x19848c){_0x19848c=_0x19848c||0xc8;return function(_0x11ec48){if(_0x11ec48){return _0x24e488['status'](_0x19848c)[_0x4a96('0x17')](_0x11ec48);}};}function respondWithFilteredResult(_0x3cd36d,_0x22eec6){return function(_0x415ae0){if(_0x415ae0){var _0x126bb6=typeof _0x22eec6[_0x4a96('0x18')]===_0x4a96('0x19')&&typeof _0x22eec6[_0x4a96('0x1a')]===_0x4a96('0x19');var _0x7d7ccf=_0x415ae0[_0x4a96('0x1b')];var _0x559c71=_0x126bb6?0x0:_0x22eec6[_0x4a96('0x18')];var _0xceeea8=_0x126bb6?_0x415ae0[_0x4a96('0x1b')]:_0x22eec6[_0x4a96('0x18')]+_0x22eec6['limit'];var _0x5a9107;if(_0xceeea8>=_0x7d7ccf){_0xceeea8=_0x7d7ccf;_0x5a9107=0xc8;}else{_0x5a9107=0xce;}_0x3cd36d[_0x4a96('0x1c')](_0x5a9107);return _0x3cd36d[_0x4a96('0x1d')](_0x4a96('0x1e'),_0x559c71+'-'+_0xceeea8+'/'+_0x7d7ccf)[_0x4a96('0x17')](_0x415ae0);}return null;};}function patchUpdates(_0xb9f64e){return function(_0x1164b1){try{jsonpatch[_0x4a96('0x1f')](_0x1164b1,_0xb9f64e,!![]);}catch(_0x3b200f){return BPromise[_0x4a96('0x20')](_0x3b200f);}return _0x1164b1[_0x4a96('0x21')]();};}function saveUpdates(_0x27bdcc,_0x21edd1){return function(_0x1da58e){if(_0x1da58e){return _0x1da58e[_0x4a96('0x22')](_0x27bdcc)[_0x4a96('0x23')](function(_0xc9394e){return _0xc9394e;});}return null;};}function removeEntity(_0x3bbcb7,_0xbdb718){return function(_0x42f593){if(_0x42f593){return _0x42f593[_0x4a96('0x24')]()[_0x4a96('0x23')](function(){_0x3bbcb7[_0x4a96('0x1c')](0xcc)[_0x4a96('0x16')]();});}};}function handleEntityNotFound(_0x268cb4,_0x1e94d2){return function(_0xf9449){if(!_0xf9449){_0x268cb4[_0x4a96('0x25')](0x194);}return _0xf9449;};}function handleError(_0x3e6010,_0xe150c6){_0xe150c6=_0xe150c6||0x1f4;return function(_0xafe7de){logger[_0x4a96('0x26')](_0xafe7de['stack']);if(_0xafe7de[_0x4a96('0x27')]){delete _0xafe7de['name'];}_0x3e6010[_0x4a96('0x1c')](_0xe150c6)[_0x4a96('0x28')](_0xafe7de);};}exports[_0x4a96('0x29')]=function(_0x53d57a,_0x1f6daf){var _0x160227={},_0x4c1fba={},_0x9ba5c5={'count':0x0,'rows':[]};var _0x238c3b=_[_0x4a96('0x2a')](db[_0x4a96('0x2b')][_0x4a96('0x2c')],function(_0x17c21b){return{'name':_0x17c21b[_0x4a96('0x2d')],'type':_0x17c21b['type'][_0x4a96('0x2e')]};});_0x4c1fba[_0x4a96('0x2f')]=_[_0x4a96('0x2a')](_0x238c3b,_0x4a96('0x27'));_0x4c1fba[_0x4a96('0x30')]=_[_0x4a96('0x31')](_0x53d57a[_0x4a96('0x30')]);_0x4c1fba[_0x4a96('0x32')]=_[_0x4a96('0x33')](_0x4c1fba[_0x4a96('0x2f')],_0x4c1fba[_0x4a96('0x30')]);_0x160227[_0x4a96('0x34')]=_[_0x4a96('0x33')](_0x4c1fba[_0x4a96('0x2f')],qs['fields'](_0x53d57a[_0x4a96('0x30')][_0x4a96('0x35')]));_0x160227[_0x4a96('0x34')]=_0x160227[_0x4a96('0x34')]['length']?_0x160227[_0x4a96('0x34')]:_0x4c1fba['model'];if(!_0x53d57a['query'][_0x4a96('0x36')](_0x4a96('0x37'))){_0x160227[_0x4a96('0x1a')]=qs[_0x4a96('0x1a')](_0x53d57a[_0x4a96('0x30')][_0x4a96('0x1a')]);_0x160227[_0x4a96('0x18')]=qs['offset'](_0x53d57a[_0x4a96('0x30')][_0x4a96('0x18')]);}_0x160227['order']=qs[_0x4a96('0x38')](_0x53d57a[_0x4a96('0x30')][_0x4a96('0x38')]);_0x160227['where']=qs['filters'](_[_0x4a96('0x39')](_0x53d57a[_0x4a96('0x30')],_0x4c1fba[_0x4a96('0x32')]),_0x238c3b);if(_0x53d57a[_0x4a96('0x30')][_0x4a96('0x3a')]){_0x160227[_0x4a96('0x3b')]=_['merge'](_0x160227['where'],{'$or':_['map'](_0x238c3b,function(_0x3a46d7){if(_0x3a46d7[_0x4a96('0x3c')]!==_0x4a96('0x3d')){var _0x376e03={};_0x376e03[_0x3a46d7[_0x4a96('0x27')]]={'$like':'%'+_0x53d57a[_0x4a96('0x30')][_0x4a96('0x3a')]+'%'};return _0x376e03;}})});}_0x160227=_[_0x4a96('0x3e')]({},_0x160227,_0x53d57a[_0x4a96('0x3f')]);var _0x378692={'where':_0x160227[_0x4a96('0x3b')]};return db[_0x4a96('0x2b')][_0x4a96('0x1b')](_0x378692)[_0x4a96('0x23')](function(_0x4bc080){_0x9ba5c5['count']=_0x4bc080;if(_0x53d57a['query'][_0x4a96('0x40')]){_0x160227[_0x4a96('0x41')]=[{'all':!![]}];}return db[_0x4a96('0x2b')][_0x4a96('0x42')](_0x160227);})['then'](function(_0x9190fb){_0x9ba5c5[_0x4a96('0x43')]=_0x9190fb;return _0x9ba5c5;})['then'](respondWithFilteredResult(_0x1f6daf,_0x160227))[_0x4a96('0x44')](handleError(_0x1f6daf,null));};exports[_0x4a96('0x45')]=function(_0x17a727,_0x4e1c94){var _0x5915ec={'raw':![],'where':{'id':_0x17a727['params']['id']}},_0x12f7ff={};_0x12f7ff[_0x4a96('0x2f')]=_[_0x4a96('0x31')](db[_0x4a96('0x2b')]['rawAttributes']);_0x12f7ff[_0x4a96('0x30')]=_['keys'](_0x17a727[_0x4a96('0x30')]);_0x12f7ff[_0x4a96('0x32')]=_[_0x4a96('0x33')](_0x12f7ff['model'],_0x12f7ff[_0x4a96('0x30')]);_0x5915ec[_0x4a96('0x34')]=_[_0x4a96('0x33')](_0x12f7ff[_0x4a96('0x2f')],qs['fields'](_0x17a727[_0x4a96('0x30')]['fields']));_0x5915ec[_0x4a96('0x34')]=_0x5915ec[_0x4a96('0x34')][_0x4a96('0x46')]?_0x5915ec[_0x4a96('0x34')]:_0x12f7ff[_0x4a96('0x2f')];if(_0x17a727['query'][_0x4a96('0x40')]){_0x5915ec[_0x4a96('0x41')]=[{'all':!![]}];}_0x5915ec=_['merge']({},_0x5915ec,_0x17a727[_0x4a96('0x3f')]);return db['ServicenowConfiguration'][_0x4a96('0x47')](_0x5915ec)['then'](handleEntityNotFound(_0x4e1c94,null))['then'](respondWithResult(_0x4e1c94,null))[_0x4a96('0x44')](handleError(_0x4e1c94,null));};exports[_0x4a96('0x48')]=function(_0x241b95,_0x531753){return db[_0x4a96('0x2b')][_0x4a96('0x48')](_0x241b95[_0x4a96('0x49')],{})['then'](respondWithResult(_0x531753,0xc9))[_0x4a96('0x44')](handleError(_0x531753,null));};exports[_0x4a96('0x22')]=function(_0x3a139d,_0x12933e){if(_0x3a139d[_0x4a96('0x49')]['id']){delete _0x3a139d[_0x4a96('0x49')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x3a139d[_0x4a96('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12933e,null))[_0x4a96('0x23')](saveUpdates(_0x3a139d[_0x4a96('0x49')],null))['then'](respondWithResult(_0x12933e,null))[_0x4a96('0x44')](handleError(_0x12933e,null));};exports[_0x4a96('0x24')]=function(_0x5b7b45,_0x75c4d5){return db[_0x4a96('0x2b')][_0x4a96('0x47')]({'where':{'id':_0x5b7b45[_0x4a96('0x4a')]['id']}})['then'](handleEntityNotFound(_0x75c4d5,null))['then'](removeEntity(_0x75c4d5,null))[_0x4a96('0x44')](handleError(_0x75c4d5,null));};exports[_0x4a96('0x4b')]=function(_0x1039d7,_0x5b8ebf,_0x24c18d){var _0xbc6ede={};var _0x23babf={};var _0x22bc3f;var _0x9a6104;return db[_0x4a96('0x2b')]['findOne']({'where':{'id':_0x1039d7[_0x4a96('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b8ebf,null))['then'](function(_0x720308){if(_0x720308){_0x22bc3f=_0x720308;_0x23babf[_0x4a96('0x2f')]=_[_0x4a96('0x31')](db[_0x4a96('0x4c')][_0x4a96('0x2c')]);_0x23babf['query']=_['keys'](_0x1039d7[_0x4a96('0x30')]);_0x23babf['filters']=_[_0x4a96('0x33')](_0x23babf['model'],_0x23babf[_0x4a96('0x30')]);_0xbc6ede['attributes']=_[_0x4a96('0x33')](_0x23babf[_0x4a96('0x2f')],qs[_0x4a96('0x35')](_0x1039d7['query'][_0x4a96('0x35')]));_0xbc6ede['attributes']=_0xbc6ede[_0x4a96('0x34')]['length']?_0xbc6ede[_0x4a96('0x34')]:_0x23babf[_0x4a96('0x2f')];_0xbc6ede[_0x4a96('0x4d')]=qs[_0x4a96('0x38')](_0x1039d7['query'][_0x4a96('0x38')]);_0xbc6ede[_0x4a96('0x3b')]=qs['filters'](_[_0x4a96('0x39')](_0x1039d7[_0x4a96('0x30')],_0x23babf[_0x4a96('0x32')]));if(_0x1039d7['query'][_0x4a96('0x3a')]){_0xbc6ede[_0x4a96('0x3b')]=_[_0x4a96('0x3e')](_0xbc6ede[_0x4a96('0x3b')],{'$or':_['map'](_0xbc6ede[_0x4a96('0x34')],function(_0x3f8965){var _0x3656ef={};_0x3656ef[_0x3f8965]={'$like':'%'+_0x1039d7[_0x4a96('0x30')]['filter']+'%'};return _0x3656ef;})});}_0xbc6ede=_[_0x4a96('0x3e')]({},_0xbc6ede,_0x1039d7[_0x4a96('0x3f')]);return _0x22bc3f[_0x4a96('0x4b')](_0xbc6ede);}})[_0x4a96('0x23')](function(_0x3709e3){if(_0x3709e3){_0x9a6104=_0x3709e3[_0x4a96('0x46')];if(!_0x1039d7[_0x4a96('0x30')][_0x4a96('0x36')](_0x4a96('0x37'))){_0xbc6ede[_0x4a96('0x1a')]=qs[_0x4a96('0x1a')](_0x1039d7[_0x4a96('0x30')][_0x4a96('0x1a')]);_0xbc6ede['offset']=qs[_0x4a96('0x18')](_0x1039d7[_0x4a96('0x30')][_0x4a96('0x18')]);}return _0x22bc3f['getFields'](_0xbc6ede);}})[_0x4a96('0x23')](function(_0x52890f){if(_0x52890f){return _0x52890f?{'count':_0x9a6104,'rows':_0x52890f}:null;}})[_0x4a96('0x23')](respondWithResult(_0x5b8ebf,null))[_0x4a96('0x44')](handleError(_0x5b8ebf,null));};exports['getSubjects']=function(_0xb2a23a,_0x2afb9e,_0x240b61){var _0x3c0071={};var _0x6db224={};var _0x4a6dc9;var _0x3fecf4;return db[_0x4a96('0x2b')][_0x4a96('0x4e')]({'where':{'id':_0xb2a23a[_0x4a96('0x4a')]['id']}})[_0x4a96('0x23')](handleEntityNotFound(_0x2afb9e,null))[_0x4a96('0x23')](function(_0x3a8426){if(_0x3a8426){_0x4a6dc9=_0x3a8426;_0x6db224[_0x4a96('0x2f')]=_['keys'](db['ServicenowField'][_0x4a96('0x2c')]);_0x6db224[_0x4a96('0x30')]=_[_0x4a96('0x31')](_0xb2a23a[_0x4a96('0x30')]);_0x6db224[_0x4a96('0x32')]=_[_0x4a96('0x33')](_0x6db224[_0x4a96('0x2f')],_0x6db224[_0x4a96('0x30')]);_0x3c0071[_0x4a96('0x34')]=_[_0x4a96('0x33')](_0x6db224[_0x4a96('0x2f')],qs['fields'](_0xb2a23a['query'][_0x4a96('0x35')]));_0x3c0071[_0x4a96('0x34')]=_0x3c0071[_0x4a96('0x34')]['length']?_0x3c0071[_0x4a96('0x34')]:_0x6db224[_0x4a96('0x2f')];_0x3c0071[_0x4a96('0x4d')]=qs['sort'](_0xb2a23a['query'][_0x4a96('0x38')]);_0x3c0071[_0x4a96('0x3b')]=qs[_0x4a96('0x32')](_['pick'](_0xb2a23a[_0x4a96('0x30')],_0x6db224[_0x4a96('0x32')]));if(_0xb2a23a[_0x4a96('0x30')][_0x4a96('0x3a')]){_0x3c0071[_0x4a96('0x3b')]=_[_0x4a96('0x3e')](_0x3c0071[_0x4a96('0x3b')],{'$or':_['map'](_0x3c0071[_0x4a96('0x34')],function(_0x410697){var _0x372f0b={};_0x372f0b[_0x410697]={'$like':'%'+_0xb2a23a['query'][_0x4a96('0x3a')]+'%'};return _0x372f0b;})});}_0x3c0071=_[_0x4a96('0x3e')]({},_0x3c0071,_0xb2a23a[_0x4a96('0x3f')]);return _0x4a6dc9[_0x4a96('0x4f')](_0x3c0071);}})[_0x4a96('0x23')](function(_0x417be0){if(_0x417be0){_0x3fecf4=_0x417be0[_0x4a96('0x46')];if(!_0xb2a23a[_0x4a96('0x30')]['hasOwnProperty'](_0x4a96('0x37'))){_0x3c0071[_0x4a96('0x1a')]=qs['limit'](_0xb2a23a[_0x4a96('0x30')]['limit']);_0x3c0071[_0x4a96('0x18')]=qs[_0x4a96('0x18')](_0xb2a23a[_0x4a96('0x30')]['offset']);}return _0x4a6dc9[_0x4a96('0x4f')](_0x3c0071);}})[_0x4a96('0x23')](function(_0x331e9d){if(_0x331e9d){return _0x331e9d?{'count':_0x3fecf4,'rows':_0x331e9d}:null;}})[_0x4a96('0x23')](respondWithResult(_0x2afb9e,null))['catch'](handleError(_0x2afb9e,null));};exports[_0x4a96('0x50')]=function(_0x143534,_0x3d3f39,_0x5e038d){var _0x2480db={};var _0x38ed69={};var _0x35066a;var _0x509aa6;return db[_0x4a96('0x2b')][_0x4a96('0x4e')]({'where':{'id':_0x143534[_0x4a96('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d3f39,null))['then'](function(_0x2db67a){if(_0x2db67a){_0x35066a=_0x2db67a;_0x38ed69[_0x4a96('0x2f')]=_[_0x4a96('0x31')](db[_0x4a96('0x4c')][_0x4a96('0x2c')]);_0x38ed69[_0x4a96('0x30')]=_[_0x4a96('0x31')](_0x143534['query']);_0x38ed69['filters']=_['intersection'](_0x38ed69[_0x4a96('0x2f')],_0x38ed69[_0x4a96('0x30')]);_0x2480db[_0x4a96('0x34')]=_[_0x4a96('0x33')](_0x38ed69[_0x4a96('0x2f')],qs[_0x4a96('0x35')](_0x143534[_0x4a96('0x30')]['fields']));_0x2480db[_0x4a96('0x34')]=_0x2480db['attributes'][_0x4a96('0x46')]?_0x2480db[_0x4a96('0x34')]:_0x38ed69[_0x4a96('0x2f')];_0x2480db['order']=qs['sort'](_0x143534[_0x4a96('0x30')][_0x4a96('0x38')]);_0x2480db[_0x4a96('0x3b')]=qs['filters'](_[_0x4a96('0x39')](_0x143534[_0x4a96('0x30')],_0x38ed69[_0x4a96('0x32')]));if(_0x143534[_0x4a96('0x30')][_0x4a96('0x3a')]){_0x2480db[_0x4a96('0x3b')]=_[_0x4a96('0x3e')](_0x2480db[_0x4a96('0x3b')],{'$or':_[_0x4a96('0x2a')](_0x2480db[_0x4a96('0x34')],function(_0x312ac2){var _0x10bd9e={};_0x10bd9e[_0x312ac2]={'$like':'%'+_0x143534[_0x4a96('0x30')][_0x4a96('0x3a')]+'%'};return _0x10bd9e;})});}_0x2480db=_['merge']({},_0x2480db,_0x143534[_0x4a96('0x3f')]);return _0x35066a[_0x4a96('0x50')](_0x2480db);}})['then'](function(_0x3cac11){if(_0x3cac11){_0x509aa6=_0x3cac11[_0x4a96('0x46')];if(!_0x143534['query'][_0x4a96('0x36')](_0x4a96('0x37'))){_0x2480db['limit']=qs[_0x4a96('0x1a')](_0x143534[_0x4a96('0x30')][_0x4a96('0x1a')]);_0x2480db[_0x4a96('0x18')]=qs[_0x4a96('0x18')](_0x143534[_0x4a96('0x30')][_0x4a96('0x18')]);}return _0x35066a['getDescriptions'](_0x2480db);}})[_0x4a96('0x23')](function(_0x1f3844){if(_0x1f3844){return _0x1f3844?{'count':_0x509aa6,'rows':_0x1f3844}:null;}})[_0x4a96('0x23')](respondWithResult(_0x3d3f39,null))['catch'](handleError(_0x3d3f39,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 392ebc3..9da2c7d 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 _0x69d3=['../../config/logger','moment','bluebird','rimraf','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x69d3,0xda));var _0x369d=function(_0x117c8e,_0x494684){_0x117c8e=_0x117c8e-0x0;var _0x328304=_0x69d3[_0x117c8e];return _0x328304;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var logger=require(_0x369d('0x2'))('api');var moment=require(_0x369d('0x3'));var BPromise=require(_0x369d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x369d('0x5'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0x369d('0x6')]=function(_0x2f2a53,_0x18c9f1){return _0x2f2a53[_0x369d('0x7')](_0x369d('0x8'),attributes,{'tableName':_0x369d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5523=['./intServicenowConfiguration.attributes','exports','int_servicenow_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5523,0x137));var _0x3552=function(_0x395021,_0x2a27ab){_0x395021=_0x395021-0x0;var _0x46b1c5=_0x5523[_0x395021];return _0x46b1c5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3552('0x0'))(_0x3552('0x1'));var moment=require(_0x3552('0x2'));var BPromise=require(_0x3552('0x3'));var rp=require(_0x3552('0x4'));var fs=require('fs');var path=require(_0x3552('0x5'));var rimraf=require(_0x3552('0x6'));var config=require(_0x3552('0x7'));var attributes=require(_0x3552('0x8'));module[_0x3552('0x9')]=function(_0x3225aa,_0x58385b){return _0x3225aa['define']('ServicenowConfiguration',attributes,{'tableName':_0x3552('0xa'),'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 5dcb900..5f70883 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 _0x0eee=['jayson/promise','http','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5be898,_0xc20ebc){var _0x3dfa4c=function(_0x295105){while(--_0x295105){_0x5be898['push'](_0x5be898['shift']());}};_0x3dfa4c(++_0xc20ebc);}(_0x0eee,0xb3));var _0xe0ee=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x0eee[_0x187ee1];return _0x388160;};'use strict';var _=require(_0xe0ee('0x0'));var util=require(_0xe0ee('0x1'));var moment=require(_0xe0ee('0x2'));var BPromise=require('bluebird');var rs=require(_0xe0ee('0x3'));var fs=require('fs');var Redis=require(_0xe0ee('0x4'));var db=require(_0xe0ee('0x5'))['db'];var utils=require(_0xe0ee('0x6'));var logger=require(_0xe0ee('0x7'))(_0xe0ee('0x8'));var config=require(_0xe0ee('0x9'));var jayson=require(_0xe0ee('0xa'));var client=jayson['client'][_0xe0ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x92bc36,_0xd491e2,_0x216704){return new BPromise(function(_0x5191e5,_0x538cf8){return client['request'](_0x92bc36,_0x216704)['then'](function(_0xd6ac51){logger[_0xe0ee('0xc')](_0xe0ee('0xd'),_0xd491e2,_0xe0ee('0xe'));logger[_0xe0ee('0xf')](_0xe0ee('0x10'),_0xd491e2,'request\x20sent',JSON['stringify'](_0xd6ac51));if(_0xd6ac51[_0xe0ee('0x11')]){if(_0xd6ac51['error'][_0xe0ee('0x12')]===0x1f4){logger[_0xe0ee('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0xd491e2,_0xd6ac51[_0xe0ee('0x11')][_0xe0ee('0x13')]);return _0x538cf8(_0xd6ac51[_0xe0ee('0x11')][_0xe0ee('0x13')]);}logger[_0xe0ee('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0xd491e2,_0xd6ac51[_0xe0ee('0x11')]['message']);return _0x5191e5(_0xd6ac51[_0xe0ee('0x11')][_0xe0ee('0x13')]);}else{logger[_0xe0ee('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0xd491e2,'request\x20sent');_0x5191e5(_0xd6ac51[_0xe0ee('0x14')]['message']);}})['catch'](function(_0x2bf08b){logger[_0xe0ee('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0xd491e2,_0x2bf08b);_0x538cf8(_0x2bf08b);});});} \ No newline at end of file +var _0x66da=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','code','message','error','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x430aa7,_0x22c420){var _0x2bb332=function(_0x99e139){while(--_0x99e139){_0x430aa7['push'](_0x430aa7['shift']());}};_0x2bb332(++_0x22c420);}(_0x66da,0x16f));var _0xa66d=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0x66da[_0x155c64];return _0x1f154a;};'use strict';var _=require(_0xa66d('0x0'));var util=require(_0xa66d('0x1'));var moment=require(_0xa66d('0x2'));var BPromise=require(_0xa66d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa66d('0x4'));var logger=require(_0xa66d('0x5'))(_0xa66d('0x6'));var config=require(_0xa66d('0x7'));var jayson=require(_0xa66d('0x8'));var client=jayson['client'][_0xa66d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1643d9,_0x109fc6,_0xa2baf9){return new BPromise(function(_0x2c0d83,_0x28f57f){return client[_0xa66d('0xa')](_0x1643d9,_0xa2baf9)[_0xa66d('0xb')](function(_0x7ee9c){logger[_0xa66d('0xc')](_0xa66d('0xd'),_0x109fc6,_0xa66d('0xe'));logger['debug'](_0xa66d('0xf'),_0x109fc6,_0xa66d('0xe'),JSON['stringify'](_0x7ee9c));if(_0x7ee9c['error']){if(_0x7ee9c['error'][_0xa66d('0x10')]===0x1f4){logger['error'](_0xa66d('0xd'),_0x109fc6,_0x7ee9c['error'][_0xa66d('0x11')]);return _0x28f57f(_0x7ee9c[_0xa66d('0x12')]['message']);}logger[_0xa66d('0x12')](_0xa66d('0xd'),_0x109fc6,_0x7ee9c['error'][_0xa66d('0x11')]);return _0x2c0d83(_0x7ee9c['error'][_0xa66d('0x11')]);}else{logger['info'](_0xa66d('0xd'),_0x109fc6,_0xa66d('0xe'));_0x2c0d83(_0x7ee9c['result'][_0xa66d('0x11')]);}})[_0xa66d('0x13')](function(_0x15191c){logger[_0xa66d('0x12')](_0xa66d('0xd'),_0x109fc6,_0x15191c);_0x28f57f(_0x15191c);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 61c7fea..3e92aa3 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 _0x749a=['../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','post','create','delete','destroy','path','connect-timeout','Router'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0x749a,0x169));var _0xa749=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x749a[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa749('0x0'));var timeout=require(_0xa749('0x1'));var express=require('express');var router=express[_0xa749('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa749('0x3'));var controller=require(_0xa749('0x4'));router[_0xa749('0x5')]('/',auth['isAuthenticated'](),controller[_0xa749('0x6')]);router[_0xa749('0x5')](_0xa749('0x7'),auth[_0xa749('0x8')](),controller[_0xa749('0x9')]);router[_0xa749('0xa')]('/',auth[_0xa749('0x8')](),controller[_0xa749('0xb')]);router['put']('/:id',auth[_0xa749('0x8')](),controller['update']);router[_0xa749('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xa749('0xd')]);module['exports']=router; \ No newline at end of file +var _0x16a2=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller'];(function(_0x4a9771,_0x52429b){var _0x52e0ed=function(_0x5485c0){while(--_0x5485c0){_0x4a9771['push'](_0x4a9771['shift']());}};_0x52e0ed(++_0x52429b);}(_0x16a2,0x89));var _0x216a=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0x16a2[_0x51b1a5];return _0x15c738;};'use strict';var multer=require('multer');var util=require(_0x216a('0x0'));var path=require(_0x216a('0x1'));var timeout=require(_0x216a('0x2'));var express=require(_0x216a('0x3'));var router=express[_0x216a('0x4')]();var fs_extra=require(_0x216a('0x5'));var auth=require(_0x216a('0x6'));var interaction=require(_0x216a('0x7'));var config=require(_0x216a('0x8'));var controller=require(_0x216a('0x9'));router[_0x216a('0xa')]('/',auth[_0x216a('0xb')](),controller[_0x216a('0xc')]);router[_0x216a('0xa')](_0x216a('0xd'),auth[_0x216a('0xb')](),controller[_0x216a('0xe')]);router[_0x216a('0xf')]('/',auth[_0x216a('0xb')](),controller[_0x216a('0x10')]);router[_0x216a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x216a('0x12')]);router[_0x216a('0x13')]('/:id',auth[_0x216a('0xb')](),controller['destroy']);module[_0x216a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 0b22217..ce50162 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 _0x0cbd=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x4418e0,_0x1c0477){var _0x5cafb9=function(_0xfdf38b){while(--_0xfdf38b){_0x4418e0['push'](_0x4418e0['shift']());}};_0x5cafb9(++_0x1c0477);}(_0x0cbd,0xb7));var _0xd0cb=function(_0x5a2ac2,_0x3b668d){_0x5a2ac2=_0x5a2ac2-0x0;var _0x6b558=_0x0cbd[_0x5a2ac2];return _0x6b558;};'use strict';var Sequelize=require(_0xd0cb('0x0'));module[_0xd0cb('0x1')]={'type':{'type':Sequelize[_0xd0cb('0x2')](_0xd0cb('0x3'),_0xd0cb('0x4'),_0xd0cb('0x5'),_0xd0cb('0x6'),'picklist'),'defaultValue':_0xd0cb('0x3')},'content':{'type':Sequelize[_0xd0cb('0x7')]},'key':{'type':Sequelize[_0xd0cb('0x7')]},'keyType':{'type':Sequelize[_0xd0cb('0x2')](_0xd0cb('0x3'),_0xd0cb('0x4'),_0xd0cb('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd0cb('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd0cb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x93b1=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','picklist'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x93b1,0x1ce));var _0x193b=function(_0x146ca7,_0x2b5fae){_0x146ca7=_0x146ca7-0x0;var _0x1af811=_0x93b1[_0x146ca7];return _0x1af811;};'use strict';var Sequelize=require(_0x193b('0x0'));module[_0x193b('0x1')]={'type':{'type':Sequelize[_0x193b('0x2')](_0x193b('0x3'),_0x193b('0x4'),'customVariable','keyValue',_0x193b('0x5')),'defaultValue':_0x193b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x193b('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x193b('0x3'),_0x193b('0x4'),_0x193b('0x7'))},'keyContent':{'type':Sequelize[_0x193b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x193b('0x6')]},'customField':{'type':Sequelize[_0x193b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x193b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index d74bd38..bd9247b 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 _0xcf09=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','merge','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0xe4feb6,_0x13474f){var _0x29c6ac=function(_0x8bb2f7){while(--_0x8bb2f7){_0xe4feb6['push'](_0xe4feb6['shift']());}};_0x29c6ac(++_0x13474f);}(_0xcf09,0xc8));var _0x9cf0=function(_0x1c5f66,_0x3cc252){_0x1c5f66=_0x1c5f66-0x0;var _0x156576=_0xcf09[_0x1c5f66];return _0x156576;};'use strict';var emlformat=require(_0x9cf0('0x0'));var rimraf=require(_0x9cf0('0x1'));var zipdir=require(_0x9cf0('0x2'));var jsonpatch=require(_0x9cf0('0x3'));var rp=require(_0x9cf0('0x4'));var moment=require('moment');var BPromise=require(_0x9cf0('0x5'));var Mustache=require(_0x9cf0('0x6'));var util=require(_0x9cf0('0x7'));var path=require(_0x9cf0('0x8'));var sox=require(_0x9cf0('0x9'));var csv=require(_0x9cf0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cf0('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9cf0('0xc'));var deskjs=require(_0x9cf0('0xd'));var toCsv=require(_0x9cf0('0xa'));var querystring=require(_0x9cf0('0xe'));var Papa=require(_0x9cf0('0xf'));var Redis=require(_0x9cf0('0x10'));var authService=require(_0x9cf0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9cf0('0x12'));var hardwareService=require(_0x9cf0('0x13'));var logger=require(_0x9cf0('0x14'))(_0x9cf0('0x15'));var utils=require('../../config/utils');var config=require(_0x9cf0('0x16'));var licenseUtil=require(_0x9cf0('0x17'));var db=require(_0x9cf0('0x18'))['db'];function respondWithStatusCode(_0x5a03b6,_0x436a2b){_0x436a2b=_0x436a2b||0xcc;return function(_0x862f66){if(_0x862f66){return _0x5a03b6[_0x9cf0('0x19')](_0x436a2b);}return _0x5a03b6['status'](_0x436a2b)[_0x9cf0('0x1a')]();};}function respondWithResult(_0x4f69c9,_0x56effc){_0x56effc=_0x56effc||0xc8;return function(_0x12a5e3){if(_0x12a5e3){return _0x4f69c9[_0x9cf0('0x1b')](_0x56effc)[_0x9cf0('0x1c')](_0x12a5e3);}};}function respondWithFilteredResult(_0x2b9e07,_0x44f017){return function(_0x2d08d8){if(_0x2d08d8){var _0x47734e=typeof _0x44f017[_0x9cf0('0x1d')]===_0x9cf0('0x1e')&&typeof _0x44f017[_0x9cf0('0x1f')]===_0x9cf0('0x1e');var _0x11ee04=_0x2d08d8[_0x9cf0('0x20')];var _0x118469=_0x47734e?0x0:_0x44f017['offset'];var _0x583aa7=_0x47734e?_0x2d08d8['count']:_0x44f017['offset']+_0x44f017[_0x9cf0('0x1f')];var _0x238dce;if(_0x583aa7>=_0x11ee04){_0x583aa7=_0x11ee04;_0x238dce=0xc8;}else{_0x238dce=0xce;}_0x2b9e07['status'](_0x238dce);return _0x2b9e07[_0x9cf0('0x21')](_0x9cf0('0x22'),_0x118469+'-'+_0x583aa7+'/'+_0x11ee04)[_0x9cf0('0x1c')](_0x2d08d8);}return null;};}function patchUpdates(_0x435844){return function(_0x1320ca){try{jsonpatch[_0x9cf0('0x23')](_0x1320ca,_0x435844,!![]);}catch(_0x47a551){return BPromise[_0x9cf0('0x24')](_0x47a551);}return _0x1320ca[_0x9cf0('0x25')]();};}function saveUpdates(_0x3d4029,_0x7710bc){return function(_0x23edb0){if(_0x23edb0){return _0x23edb0[_0x9cf0('0x26')](_0x3d4029)[_0x9cf0('0x27')](function(_0x23122f){return _0x23122f;});}return null;};}function removeEntity(_0x36342d,_0x1e1815){return function(_0x4f83c8){if(_0x4f83c8){return _0x4f83c8[_0x9cf0('0x28')]()[_0x9cf0('0x27')](function(){_0x36342d[_0x9cf0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x121c2d,_0x1265c0){return function(_0x3eeea1){if(!_0x3eeea1){_0x121c2d[_0x9cf0('0x19')](0x194);}return _0x3eeea1;};}function handleError(_0x5114d5,_0x264350){_0x264350=_0x264350||0x1f4;return function(_0x352a6f){logger[_0x9cf0('0x29')](_0x352a6f[_0x9cf0('0x2a')]);if(_0x352a6f['name']){delete _0x352a6f[_0x9cf0('0x2b')];}_0x5114d5[_0x9cf0('0x1b')](_0x264350)[_0x9cf0('0x2c')](_0x352a6f);};}exports[_0x9cf0('0x2d')]=function(_0x19f7bb,_0x1adb65){var _0x63afe={},_0x3b06b8={},_0x25b7ac={'count':0x0,'rows':[]};var _0x56bd93=_[_0x9cf0('0x2e')](db[_0x9cf0('0x2f')][_0x9cf0('0x30')],function(_0x1adff7){return{'name':_0x1adff7['fieldName'],'type':_0x1adff7[_0x9cf0('0x31')][_0x9cf0('0x32')]};});_0x3b06b8[_0x9cf0('0x33')]=_[_0x9cf0('0x2e')](_0x56bd93,'name');_0x3b06b8[_0x9cf0('0x34')]=_['keys'](_0x19f7bb[_0x9cf0('0x34')]);_0x3b06b8[_0x9cf0('0x35')]=_[_0x9cf0('0x36')](_0x3b06b8['model'],_0x3b06b8['query']);_0x63afe[_0x9cf0('0x37')]=_[_0x9cf0('0x36')](_0x3b06b8[_0x9cf0('0x33')],qs[_0x9cf0('0x38')](_0x19f7bb['query'][_0x9cf0('0x38')]));_0x63afe['attributes']=_0x63afe[_0x9cf0('0x37')][_0x9cf0('0x39')]?_0x63afe[_0x9cf0('0x37')]:_0x3b06b8[_0x9cf0('0x33')];if(!_0x19f7bb['query'][_0x9cf0('0x3a')](_0x9cf0('0x3b'))){_0x63afe['limit']=qs[_0x9cf0('0x1f')](_0x19f7bb['query'][_0x9cf0('0x1f')]);_0x63afe[_0x9cf0('0x1d')]=qs[_0x9cf0('0x1d')](_0x19f7bb[_0x9cf0('0x34')][_0x9cf0('0x1d')]);}_0x63afe['order']=qs[_0x9cf0('0x3c')](_0x19f7bb['query'][_0x9cf0('0x3c')]);_0x63afe['where']=qs[_0x9cf0('0x35')](_['pick'](_0x19f7bb['query'],_0x3b06b8[_0x9cf0('0x35')]),_0x56bd93);if(_0x19f7bb[_0x9cf0('0x34')][_0x9cf0('0x3d')]){_0x63afe[_0x9cf0('0x3e')]=_['merge'](_0x63afe['where'],{'$or':_['map'](_0x56bd93,function(_0x2f3501){if(_0x2f3501[_0x9cf0('0x31')]!==_0x9cf0('0x3f')){var _0x2d7c16={};_0x2d7c16[_0x2f3501['name']]={'$like':'%'+_0x19f7bb[_0x9cf0('0x34')][_0x9cf0('0x3d')]+'%'};return _0x2d7c16;}})});}_0x63afe=_['merge']({},_0x63afe,_0x19f7bb[_0x9cf0('0x40')]);var _0x3be39a={'where':_0x63afe['where']};return db[_0x9cf0('0x2f')][_0x9cf0('0x20')](_0x3be39a)[_0x9cf0('0x27')](function(_0x3b3466){_0x25b7ac[_0x9cf0('0x20')]=_0x3b3466;if(_0x19f7bb[_0x9cf0('0x34')][_0x9cf0('0x41')]){_0x63afe['include']=[{'all':!![]}];}return db['ServicenowField'][_0x9cf0('0x42')](_0x63afe);})[_0x9cf0('0x27')](function(_0x453ffb){_0x25b7ac[_0x9cf0('0x43')]=_0x453ffb;return _0x25b7ac;})[_0x9cf0('0x27')](respondWithFilteredResult(_0x1adb65,_0x63afe))[_0x9cf0('0x44')](handleError(_0x1adb65,null));};exports[_0x9cf0('0x45')]=function(_0x7c9915,_0x1a2386){var _0x4d7c9e={'raw':!![],'where':{'id':_0x7c9915['params']['id']}},_0x317184={};_0x317184['model']=_[_0x9cf0('0x46')](db[_0x9cf0('0x2f')]['rawAttributes']);_0x317184[_0x9cf0('0x34')]=_[_0x9cf0('0x46')](_0x7c9915[_0x9cf0('0x34')]);_0x317184[_0x9cf0('0x35')]=_['intersection'](_0x317184[_0x9cf0('0x33')],_0x317184[_0x9cf0('0x34')]);_0x4d7c9e[_0x9cf0('0x37')]=_[_0x9cf0('0x36')](_0x317184['model'],qs['fields'](_0x7c9915[_0x9cf0('0x34')][_0x9cf0('0x38')]));_0x4d7c9e['attributes']=_0x4d7c9e[_0x9cf0('0x37')][_0x9cf0('0x39')]?_0x4d7c9e[_0x9cf0('0x37')]:_0x317184[_0x9cf0('0x33')];if(_0x7c9915[_0x9cf0('0x34')][_0x9cf0('0x41')]){_0x4d7c9e[_0x9cf0('0x47')]=[{'all':!![]}];}_0x4d7c9e=_[_0x9cf0('0x48')]({},_0x4d7c9e,_0x7c9915[_0x9cf0('0x40')]);return db[_0x9cf0('0x2f')][_0x9cf0('0x49')](_0x4d7c9e)[_0x9cf0('0x27')](handleEntityNotFound(_0x1a2386,null))[_0x9cf0('0x27')](respondWithResult(_0x1a2386,null))[_0x9cf0('0x44')](handleError(_0x1a2386,null));};exports[_0x9cf0('0x4a')]=function(_0x263eee,_0x260b79){return db[_0x9cf0('0x2f')][_0x9cf0('0x4a')](_0x263eee[_0x9cf0('0x4b')],{})[_0x9cf0('0x27')](respondWithResult(_0x260b79,0xc9))['catch'](handleError(_0x260b79,null));};exports[_0x9cf0('0x26')]=function(_0x258537,_0x231966){if(_0x258537['body']['id']){delete _0x258537[_0x9cf0('0x4b')]['id'];}return db[_0x9cf0('0x2f')][_0x9cf0('0x49')]({'where':{'id':_0x258537[_0x9cf0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x231966,null))['then'](saveUpdates(_0x258537[_0x9cf0('0x4b')],null))[_0x9cf0('0x27')](respondWithResult(_0x231966,null))[_0x9cf0('0x44')](handleError(_0x231966,null));};exports['destroy']=function(_0x57dbc6,_0x166dbc){return db[_0x9cf0('0x2f')][_0x9cf0('0x49')]({'where':{'id':_0x57dbc6[_0x9cf0('0x4c')]['id']}})[_0x9cf0('0x27')](handleEntityNotFound(_0x166dbc,null))[_0x9cf0('0x27')](removeEntity(_0x166dbc,null))[_0x9cf0('0x44')](handleError(_0x166dbc,null));}; \ No newline at end of file +var _0x00aa=['fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','keys','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x00aa,0xe6));var _0xa00a=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x00aa[_0x1064bc];return _0x5edc45;};'use strict';var emlformat=require(_0xa00a('0x0'));var rimraf=require(_0xa00a('0x1'));var zipdir=require(_0xa00a('0x2'));var jsonpatch=require(_0xa00a('0x3'));var rp=require(_0xa00a('0x4'));var moment=require(_0xa00a('0x5'));var BPromise=require(_0xa00a('0x6'));var Mustache=require('mustache');var util=require(_0xa00a('0x7'));var path=require(_0xa00a('0x8'));var sox=require(_0xa00a('0x9'));var csv=require(_0xa00a('0xa'));var ejs=require(_0xa00a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa00a('0xc'));var squel=require('squel');var crypto=require(_0xa00a('0xd'));var jsforce=require(_0xa00a('0xe'));var deskjs=require(_0xa00a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa00a('0x10'));var Papa=require('papaparse');var Redis=require(_0xa00a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa00a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa00a('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa00a('0x14'));var licenseUtil=require(_0xa00a('0x15'));var db=require(_0xa00a('0x16'))['db'];function respondWithStatusCode(_0x10e89c,_0x5d809b){_0x5d809b=_0x5d809b||0xcc;return function(_0x155ef1){if(_0x155ef1){return _0x10e89c[_0xa00a('0x17')](_0x5d809b);}return _0x10e89c['status'](_0x5d809b)[_0xa00a('0x18')]();};}function respondWithResult(_0x450639,_0x3e0705){_0x3e0705=_0x3e0705||0xc8;return function(_0x363ed3){if(_0x363ed3){return _0x450639[_0xa00a('0x19')](_0x3e0705)[_0xa00a('0x1a')](_0x363ed3);}};}function respondWithFilteredResult(_0x56c5b7,_0x35329f){return function(_0x85153e){if(_0x85153e){var _0x5051f4=typeof _0x35329f[_0xa00a('0x1b')]===_0xa00a('0x1c')&&typeof _0x35329f[_0xa00a('0x1d')]===_0xa00a('0x1c');var _0x4f8461=_0x85153e[_0xa00a('0x1e')];var _0xaa9373=_0x5051f4?0x0:_0x35329f[_0xa00a('0x1b')];var _0x18ddd9=_0x5051f4?_0x85153e[_0xa00a('0x1e')]:_0x35329f[_0xa00a('0x1b')]+_0x35329f['limit'];var _0x153143;if(_0x18ddd9>=_0x4f8461){_0x18ddd9=_0x4f8461;_0x153143=0xc8;}else{_0x153143=0xce;}_0x56c5b7[_0xa00a('0x19')](_0x153143);return _0x56c5b7[_0xa00a('0x1f')]('Content-Range',_0xaa9373+'-'+_0x18ddd9+'/'+_0x4f8461)[_0xa00a('0x1a')](_0x85153e);}return null;};}function patchUpdates(_0x2bf02d){return function(_0x5be593){try{jsonpatch[_0xa00a('0x20')](_0x5be593,_0x2bf02d,!![]);}catch(_0x22c828){return BPromise['reject'](_0x22c828);}return _0x5be593[_0xa00a('0x21')]();};}function saveUpdates(_0x13e987,_0x256e7e){return function(_0x14f708){if(_0x14f708){return _0x14f708[_0xa00a('0x22')](_0x13e987)[_0xa00a('0x23')](function(_0x3fef3e){return _0x3fef3e;});}return null;};}function removeEntity(_0x14d27a,_0x543010){return function(_0x32d650){if(_0x32d650){return _0x32d650[_0xa00a('0x24')]()[_0xa00a('0x23')](function(){_0x14d27a[_0xa00a('0x19')](0xcc)[_0xa00a('0x18')]();});}};}function handleEntityNotFound(_0x516112,_0xc14f2b){return function(_0x536d82){if(!_0x536d82){_0x516112[_0xa00a('0x17')](0x194);}return _0x536d82;};}function handleError(_0x205f69,_0x447f8f){_0x447f8f=_0x447f8f||0x1f4;return function(_0x517453){logger['error'](_0x517453['stack']);if(_0x517453[_0xa00a('0x25')]){delete _0x517453[_0xa00a('0x25')];}_0x205f69[_0xa00a('0x19')](_0x447f8f)[_0xa00a('0x26')](_0x517453);};}exports[_0xa00a('0x27')]=function(_0x303fd6,_0x37b3db){var _0x486e18={},_0x8c8bad={},_0x56e78f={'count':0x0,'rows':[]};var _0x1333d4=_[_0xa00a('0x28')](db[_0xa00a('0x29')][_0xa00a('0x2a')],function(_0x1134b3){return{'name':_0x1134b3[_0xa00a('0x2b')],'type':_0x1134b3[_0xa00a('0x2c')][_0xa00a('0x2d')]};});_0x8c8bad['model']=_['map'](_0x1333d4,_0xa00a('0x25'));_0x8c8bad[_0xa00a('0x2e')]=_['keys'](_0x303fd6[_0xa00a('0x2e')]);_0x8c8bad[_0xa00a('0x2f')]=_[_0xa00a('0x30')](_0x8c8bad['model'],_0x8c8bad['query']);_0x486e18['attributes']=_[_0xa00a('0x30')](_0x8c8bad[_0xa00a('0x31')],qs[_0xa00a('0x32')](_0x303fd6['query'][_0xa00a('0x32')]));_0x486e18[_0xa00a('0x33')]=_0x486e18[_0xa00a('0x33')][_0xa00a('0x34')]?_0x486e18[_0xa00a('0x33')]:_0x8c8bad['model'];if(!_0x303fd6[_0xa00a('0x2e')][_0xa00a('0x35')]('nolimit')){_0x486e18['limit']=qs[_0xa00a('0x1d')](_0x303fd6['query'][_0xa00a('0x1d')]);_0x486e18[_0xa00a('0x1b')]=qs[_0xa00a('0x1b')](_0x303fd6['query']['offset']);}_0x486e18[_0xa00a('0x36')]=qs[_0xa00a('0x37')](_0x303fd6[_0xa00a('0x2e')][_0xa00a('0x37')]);_0x486e18[_0xa00a('0x38')]=qs[_0xa00a('0x2f')](_[_0xa00a('0x39')](_0x303fd6[_0xa00a('0x2e')],_0x8c8bad[_0xa00a('0x2f')]),_0x1333d4);if(_0x303fd6[_0xa00a('0x2e')]['filter']){_0x486e18[_0xa00a('0x38')]=_[_0xa00a('0x3a')](_0x486e18['where'],{'$or':_['map'](_0x1333d4,function(_0x4d4510){if(_0x4d4510[_0xa00a('0x2c')]!==_0xa00a('0x3b')){var _0x24de66={};_0x24de66[_0x4d4510['name']]={'$like':'%'+_0x303fd6['query'][_0xa00a('0x3c')]+'%'};return _0x24de66;}})});}_0x486e18=_[_0xa00a('0x3a')]({},_0x486e18,_0x303fd6[_0xa00a('0x3d')]);var _0x374c8b={'where':_0x486e18[_0xa00a('0x38')]};return db[_0xa00a('0x29')][_0xa00a('0x1e')](_0x374c8b)[_0xa00a('0x23')](function(_0x3fc85a){_0x56e78f['count']=_0x3fc85a;if(_0x303fd6['query'][_0xa00a('0x3e')]){_0x486e18[_0xa00a('0x3f')]=[{'all':!![]}];}return db[_0xa00a('0x29')]['findAll'](_0x486e18);})[_0xa00a('0x23')](function(_0x9f463a){_0x56e78f['rows']=_0x9f463a;return _0x56e78f;})[_0xa00a('0x23')](respondWithFilteredResult(_0x37b3db,_0x486e18))[_0xa00a('0x40')](handleError(_0x37b3db,null));};exports[_0xa00a('0x41')]=function(_0x176e54,_0x3e154a){var _0x2010a4={'raw':!![],'where':{'id':_0x176e54[_0xa00a('0x42')]['id']}},_0x420ad0={};_0x420ad0['model']=_['keys'](db[_0xa00a('0x29')][_0xa00a('0x2a')]);_0x420ad0[_0xa00a('0x2e')]=_[_0xa00a('0x43')](_0x176e54['query']);_0x420ad0[_0xa00a('0x2f')]=_[_0xa00a('0x30')](_0x420ad0[_0xa00a('0x31')],_0x420ad0[_0xa00a('0x2e')]);_0x2010a4[_0xa00a('0x33')]=_[_0xa00a('0x30')](_0x420ad0[_0xa00a('0x31')],qs[_0xa00a('0x32')](_0x176e54[_0xa00a('0x2e')][_0xa00a('0x32')]));_0x2010a4['attributes']=_0x2010a4[_0xa00a('0x33')]['length']?_0x2010a4['attributes']:_0x420ad0[_0xa00a('0x31')];if(_0x176e54[_0xa00a('0x2e')][_0xa00a('0x3e')]){_0x2010a4['include']=[{'all':!![]}];}_0x2010a4=_['merge']({},_0x2010a4,_0x176e54['options']);return db[_0xa00a('0x29')][_0xa00a('0x44')](_0x2010a4)[_0xa00a('0x23')](handleEntityNotFound(_0x3e154a,null))[_0xa00a('0x23')](respondWithResult(_0x3e154a,null))[_0xa00a('0x40')](handleError(_0x3e154a,null));};exports['create']=function(_0x55c87c,_0x160b84){return db['ServicenowField']['create'](_0x55c87c['body'],{})[_0xa00a('0x23')](respondWithResult(_0x160b84,0xc9))['catch'](handleError(_0x160b84,null));};exports['update']=function(_0x4828e3,_0x465873){if(_0x4828e3['body']['id']){delete _0x4828e3[_0xa00a('0x45')]['id'];}return db[_0xa00a('0x29')][_0xa00a('0x44')]({'where':{'id':_0x4828e3[_0xa00a('0x42')]['id']}})[_0xa00a('0x23')](handleEntityNotFound(_0x465873,null))[_0xa00a('0x23')](saveUpdates(_0x4828e3['body'],null))[_0xa00a('0x23')](respondWithResult(_0x465873,null))['catch'](handleError(_0x465873,null));};exports['destroy']=function(_0x5efd07,_0x16dc60){return db[_0xa00a('0x29')][_0xa00a('0x44')]({'where':{'id':_0x5efd07[_0xa00a('0x42')]['id']}})[_0xa00a('0x23')](handleEntityNotFound(_0x16dc60,null))[_0xa00a('0x23')](removeEntity(_0x16dc60,null))[_0xa00a('0x40')](handleError(_0x16dc60,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index e5a7727..2711a4c 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 _0x7417=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7417,0x112));var _0x7741=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7417[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7741('0x0'));var util=require(_0x7741('0x1'));var logger=require(_0x7741('0x2'))(_0x7741('0x3'));var moment=require(_0x7741('0x4'));var BPromise=require(_0x7741('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7741('0x6'));var rimraf=require('rimraf');var config=require(_0x7741('0x7'));var attributes=require(_0x7741('0x8'));module[_0x7741('0x9')]=function(_0x291bb0,_0x21c5a3){return _0x291bb0[_0x7741('0xa')](_0x7741('0xb'),attributes,{'tableName':_0x7741('0xc'),'paranoid':![],'indexes':[{'name':_0x7741('0xd'),'fields':[_0x7741('0xe'),_0x7741('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0bed=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','ServicenowField'];(function(_0x3018eb,_0x570c63){var _0x23131f=function(_0x33656f){while(--_0x33656f){_0x3018eb['push'](_0x3018eb['shift']());}};_0x23131f(++_0x570c63);}(_0x0bed,0x66));var _0xd0be=function(_0x3dd8f5,_0x236549){_0x3dd8f5=_0x3dd8f5-0x0;var _0x18bfd8=_0x0bed[_0x3dd8f5];return _0x18bfd8;};'use strict';var _=require('lodash');var util=require(_0xd0be('0x0'));var logger=require(_0xd0be('0x1'))(_0xd0be('0x2'));var moment=require(_0xd0be('0x3'));var BPromise=require(_0xd0be('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0be('0x5'));var rimraf=require('rimraf');var config=require(_0xd0be('0x6'));var attributes=require('./intServicenowField.attributes');module[_0xd0be('0x7')]=function(_0x512f38,_0x472f60){return _0x512f38[_0xd0be('0x8')](_0xd0be('0x9'),attributes,{'tableName':_0xd0be('0xa'),'paranoid':![],'indexes':[{'name':_0xd0be('0xb'),'fields':[_0xd0be('0xc'),_0xd0be('0xd')],'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 5927998..22c5805 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x23c284,_0x436efd){var _0x5da5ca=function(_0x5dc835){while(--_0x5dc835){_0x23c284['push'](_0x23c284['shift']());}};_0x5da5ca(++_0x436efd);}(_0xf4eb,0xec));var _0xbf4e=function(_0x28e056,_0x38a2e8){_0x28e056=_0x28e056-0x0;var _0x5e7d83=_0xf4eb[_0x28e056];return _0x5e7d83;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0xd25b59,_0x217f8a){var _0x4cab47=function(_0x26362d){while(--_0x26362d){_0xd25b59['push'](_0xd25b59['shift']());}};_0x4cab47(++_0x217f8a);}(_0xaa88,0x137));var _0x8aa8=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0xaa88[_0x2d9535];return _0xb4e710;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 0044290..8146260 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(_0x1e51f9,_0x5bebaf){var _0x2f3890=function(_0x45535a){while(--_0x45535a){_0x1e51f9['push'](_0x1e51f9['shift']());}};_0x2f3890(++_0x5bebaf);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 _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(_0x4e16b8,_0xd0d913){var _0x5b73d6=function(_0x226d78){while(--_0x226d78){_0x4e16b8['push'](_0x4e16b8['shift']());}};_0x5b73d6(++_0xd0d913);}(_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/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index c367c38..ebfdc0e 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(_0x4857e0,_0x18c55c){var _0x4ebc14=function(_0xc147d4){while(--_0xc147d4){_0x4857e0['push'](_0x4857e0['shift']());}};_0x4ebc14(++_0x18c55c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x28fb8d,_0x1bf1c0){var _0x4897ad=function(_0x4be75e){while(--_0x4be75e){_0x28fb8d['push'](_0x28fb8d['shift']());}};_0x4897ad(++_0x1bf1c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 0c6ccea..12bfce3 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 _0x0642=['statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','apply','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','length','options','find','catch','create','body','update','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','duration_hours','parent_name','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','stringify','Calls','values','remove','includes','label','endsWith','value','test'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0642,0x1dc));var _0x2064=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x0642[_0x1e4f2f];return _0xccea89;};'use strict';var emlformat=require(_0x2064('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2064('0x1'));var jsonpatch=require(_0x2064('0x2'));var rp=require(_0x2064('0x3'));var moment=require(_0x2064('0x4'));var BPromise=require(_0x2064('0x5'));var Mustache=require(_0x2064('0x6'));var util=require(_0x2064('0x7'));var path=require(_0x2064('0x8'));var sox=require('sox');var csv=require(_0x2064('0x9'));var ejs=require(_0x2064('0xa'));var fs=require('fs');var fs_extra=require(_0x2064('0xb'));var _=require(_0x2064('0xc'));var squel=require(_0x2064('0xd'));var crypto=require(_0x2064('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2064('0xf'));var toCsv=require(_0x2064('0x9'));var querystring=require(_0x2064('0x10'));var Papa=require(_0x2064('0x11'));var Redis=require(_0x2064('0x12'));var authService=require(_0x2064('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2064('0x14'));var logger=require('../../config/logger')(_0x2064('0x15'));var utils=require(_0x2064('0x16'));var config=require(_0x2064('0x17'));var licenseUtil=require(_0x2064('0x18'));var db=require(_0x2064('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4eb2a6,_0x3e1fbb){_0x3e1fbb=_0x3e1fbb||0xcc;return function(_0x333a04){if(_0x333a04){return _0x4eb2a6['sendStatus'](_0x3e1fbb);}return _0x4eb2a6[_0x2064('0x1a')](_0x3e1fbb)['end']();};}function respondWithResult(_0x3bc52e,_0x4b9bfa){_0x4b9bfa=_0x4b9bfa||0xc8;return function(_0x123c40){if(_0x123c40){return _0x3bc52e['status'](_0x4b9bfa)[_0x2064('0x1b')](_0x123c40);}};}function respondWithFilteredResult(_0x202655,_0x15e045){return function(_0x144c54){if(_0x144c54){var _0x46d373=typeof _0x15e045[_0x2064('0x1c')]===_0x2064('0x1d')&&typeof _0x15e045['limit']===_0x2064('0x1d');var _0x31f58c=_0x144c54[_0x2064('0x1e')];var _0x2e0687=_0x46d373?0x0:_0x15e045['offset'];var _0x542f11=_0x46d373?_0x144c54[_0x2064('0x1e')]:_0x15e045[_0x2064('0x1c')]+_0x15e045[_0x2064('0x1f')];var _0xb51d6a;if(_0x542f11>=_0x31f58c){_0x542f11=_0x31f58c;_0xb51d6a=0xc8;}else{_0xb51d6a=0xce;}_0x202655[_0x2064('0x1a')](_0xb51d6a);return _0x202655['set']('Content-Range',_0x2e0687+'-'+_0x542f11+'/'+_0x31f58c)[_0x2064('0x1b')](_0x144c54);}return null;};}function patchUpdates(_0x3bd41c){return function(_0x4a74a9){try{jsonpatch[_0x2064('0x20')](_0x4a74a9,_0x3bd41c,!![]);}catch(_0x2e76c1){return BPromise['reject'](_0x2e76c1);}return _0x4a74a9[_0x2064('0x21')]();};}function saveUpdates(_0x5752d2,_0x410a12){return function(_0x26c0cd){if(_0x26c0cd){return _0x26c0cd['update'](_0x5752d2)[_0x2064('0x22')](function(_0x188dfd){return _0x188dfd;});}return null;};}function removeEntity(_0x224711,_0x324a9e){return function(_0x3dbb65){if(_0x3dbb65){return _0x3dbb65[_0x2064('0x23')]()[_0x2064('0x22')](function(){_0x224711['status'](0xcc)[_0x2064('0x24')]();});}};}function handleEntityNotFound(_0x3aab66,_0x28ab76){return function(_0x30ae67){if(!_0x30ae67){_0x3aab66[_0x2064('0x25')](0x194);}return _0x30ae67;};}function handleError(_0x214e93,_0xa679ab){_0xa679ab=_0xa679ab||0x1f4;return function(_0x466ec6){logger[_0x2064('0x26')](_0x466ec6[_0x2064('0x27')]);if(_0x466ec6[_0x2064('0x28')]){delete _0x466ec6['name'];}_0x214e93[_0x2064('0x1a')](_0xa679ab)[_0x2064('0x29')](_0x466ec6);};}exports[_0x2064('0x2a')]=function(_0xeb0290,_0x1bc046){var _0x57d0c8={},_0x1e6f30={},_0x109c2c={'count':0x0,'rows':[]};var _0x99e055=_[_0x2064('0x2b')](db[_0x2064('0x2c')]['rawAttributes'],function(_0x4f09b1){return{'name':_0x4f09b1[_0x2064('0x2d')],'type':_0x4f09b1[_0x2064('0x2e')][_0x2064('0x2f')]};});_0x1e6f30[_0x2064('0x30')]=_[_0x2064('0x2b')](_0x99e055,_0x2064('0x28'));_0x1e6f30[_0x2064('0x31')]=_[_0x2064('0x32')](_0xeb0290[_0x2064('0x31')]);_0x1e6f30[_0x2064('0x33')]=_[_0x2064('0x34')](_0x1e6f30['model'],_0x1e6f30[_0x2064('0x31')]);_0x57d0c8[_0x2064('0x35')]=_[_0x2064('0x34')](_0x1e6f30[_0x2064('0x30')],qs[_0x2064('0x36')](_0xeb0290[_0x2064('0x31')]['fields']));_0x57d0c8['attributes']=_0x57d0c8[_0x2064('0x35')]['length']?_0x57d0c8[_0x2064('0x35')]:_0x1e6f30[_0x2064('0x30')];if(!_0xeb0290[_0x2064('0x31')][_0x2064('0x37')](_0x2064('0x38'))){_0x57d0c8[_0x2064('0x1f')]=qs['limit'](_0xeb0290[_0x2064('0x31')]['limit']);_0x57d0c8[_0x2064('0x1c')]=qs[_0x2064('0x1c')](_0xeb0290['query'][_0x2064('0x1c')]);}_0x57d0c8[_0x2064('0x39')]=qs[_0x2064('0x3a')](_0xeb0290['query']['sort']);_0x57d0c8[_0x2064('0x3b')]=qs[_0x2064('0x33')](_['pick'](_0xeb0290[_0x2064('0x31')],_0x1e6f30[_0x2064('0x33')]),_0x99e055);if(_0xeb0290[_0x2064('0x31')][_0x2064('0x3c')]){_0x57d0c8[_0x2064('0x3b')]=_[_0x2064('0x3d')](_0x57d0c8[_0x2064('0x3b')],{'$or':_['map'](_0x99e055,function(_0x287af5){if(_0x287af5[_0x2064('0x2e')]!==_0x2064('0x3e')){var _0x14ee07={};_0x14ee07[_0x287af5[_0x2064('0x28')]]={'$like':'%'+_0xeb0290[_0x2064('0x31')][_0x2064('0x3c')]+'%'};return _0x14ee07;}})});}_0x57d0c8=_[_0x2064('0x3d')]({},_0x57d0c8,_0xeb0290['options']);var _0xd671f0={'where':_0x57d0c8[_0x2064('0x3b')]};return db[_0x2064('0x2c')][_0x2064('0x1e')](_0xd671f0)['then'](function(_0x5455cf){_0x109c2c[_0x2064('0x1e')]=_0x5455cf;if(_0xeb0290[_0x2064('0x31')][_0x2064('0x3f')]){_0x57d0c8[_0x2064('0x40')]=[{'all':!![]}];}return db[_0x2064('0x2c')][_0x2064('0x41')](_0x57d0c8);})[_0x2064('0x22')](function(_0x359990){_0x109c2c[_0x2064('0x42')]=_0x359990;return _0x109c2c;})['then'](respondWithFilteredResult(_0x1bc046,_0x57d0c8))['catch'](handleError(_0x1bc046,null));};exports[_0x2064('0x43')]=function(_0x47331e,_0x52aa74){var _0x56ddd9={'raw':![],'where':{'id':_0x47331e[_0x2064('0x44')]['id']}},_0x4c7eb7={};_0x4c7eb7[_0x2064('0x30')]=_[_0x2064('0x32')](db[_0x2064('0x2c')][_0x2064('0x45')]);_0x4c7eb7[_0x2064('0x31')]=_[_0x2064('0x32')](_0x47331e[_0x2064('0x31')]);_0x4c7eb7[_0x2064('0x33')]=_[_0x2064('0x34')](_0x4c7eb7['model'],_0x4c7eb7[_0x2064('0x31')]);_0x56ddd9[_0x2064('0x35')]=_['intersection'](_0x4c7eb7['model'],qs['fields'](_0x47331e[_0x2064('0x31')][_0x2064('0x36')]));_0x56ddd9[_0x2064('0x35')]=_0x56ddd9[_0x2064('0x35')][_0x2064('0x46')]?_0x56ddd9['attributes']:_0x4c7eb7[_0x2064('0x30')];if(_0x47331e[_0x2064('0x31')][_0x2064('0x3f')]){_0x56ddd9[_0x2064('0x40')]=[{'all':!![]}];}_0x56ddd9=_[_0x2064('0x3d')]({},_0x56ddd9,_0x47331e[_0x2064('0x47')]);return db[_0x2064('0x2c')][_0x2064('0x48')](_0x56ddd9)[_0x2064('0x22')](handleEntityNotFound(_0x52aa74,null))['then'](respondWithResult(_0x52aa74,null))[_0x2064('0x49')](handleError(_0x52aa74,null));};exports[_0x2064('0x4a')]=function(_0x1819c9,_0x23c2ae){return db['SugarcrmAccount'][_0x2064('0x4a')](_0x1819c9[_0x2064('0x4b')],{})['then'](respondWithResult(_0x23c2ae,0xc9))[_0x2064('0x49')](handleError(_0x23c2ae,null));};exports[_0x2064('0x4c')]=function(_0x279e82,_0x493e92){if(_0x279e82[_0x2064('0x4b')]['id']){delete _0x279e82[_0x2064('0x4b')]['id'];}return db[_0x2064('0x2c')][_0x2064('0x48')]({'where':{'id':_0x279e82[_0x2064('0x44')]['id']}})[_0x2064('0x22')](handleEntityNotFound(_0x493e92,null))['then'](saveUpdates(_0x279e82[_0x2064('0x4b')],null))[_0x2064('0x22')](respondWithResult(_0x493e92,null))[_0x2064('0x49')](handleError(_0x493e92,null));};exports['destroy']=function(_0x25e554,_0x36b70b){return db['SugarcrmAccount'][_0x2064('0x48')]({'where':{'id':_0x25e554[_0x2064('0x44')]['id']}})['then'](handleEntityNotFound(_0x36b70b,null))[_0x2064('0x22')](removeEntity(_0x36b70b,null))[_0x2064('0x49')](handleError(_0x36b70b,null));};exports[_0x2064('0x4d')]=function(_0x5a47c1,_0x520e42,_0x54a2dc){var _0x4b1106={};var _0x4983a5={};var _0x5e0901;var _0x583ad4;return db[_0x2064('0x2c')][_0x2064('0x4e')]({'where':{'id':_0x5a47c1['params']['id']}})[_0x2064('0x22')](handleEntityNotFound(_0x520e42,null))[_0x2064('0x22')](function(_0x56c90f){if(_0x56c90f){_0x5e0901=_0x56c90f;_0x4983a5['model']=_[_0x2064('0x32')](db[_0x2064('0x4f')][_0x2064('0x45')]);_0x4983a5[_0x2064('0x31')]=_[_0x2064('0x32')](_0x5a47c1['query']);_0x4983a5[_0x2064('0x33')]=_[_0x2064('0x34')](_0x4983a5['model'],_0x4983a5[_0x2064('0x31')]);_0x4b1106[_0x2064('0x35')]=_[_0x2064('0x34')](_0x4983a5[_0x2064('0x30')],qs[_0x2064('0x36')](_0x5a47c1[_0x2064('0x31')][_0x2064('0x36')]));_0x4b1106[_0x2064('0x35')]=_0x4b1106[_0x2064('0x35')][_0x2064('0x46')]?_0x4b1106[_0x2064('0x35')]:_0x4983a5['model'];_0x4b1106[_0x2064('0x39')]=qs[_0x2064('0x3a')](_0x5a47c1[_0x2064('0x31')][_0x2064('0x3a')]);_0x4b1106[_0x2064('0x3b')]=qs[_0x2064('0x33')](_['pick'](_0x5a47c1[_0x2064('0x31')],_0x4983a5['filters']));if(_0x5a47c1['query'][_0x2064('0x3c')]){_0x4b1106['where']=_[_0x2064('0x3d')](_0x4b1106['where'],{'$or':_[_0x2064('0x2b')](_0x4b1106[_0x2064('0x35')],function(_0x83335f){var _0x5cce9d={};_0x5cce9d[_0x83335f]={'$like':'%'+_0x5a47c1[_0x2064('0x31')][_0x2064('0x3c')]+'%'};return _0x5cce9d;})});}_0x4b1106=_[_0x2064('0x3d')]({},_0x4b1106,_0x5a47c1[_0x2064('0x47')]);return _0x5e0901[_0x2064('0x4d')](_0x4b1106);}})[_0x2064('0x22')](function(_0x499ae9){if(_0x499ae9){_0x583ad4=_0x499ae9[_0x2064('0x46')];if(!_0x5a47c1['query'][_0x2064('0x37')](_0x2064('0x38'))){_0x4b1106[_0x2064('0x1f')]=qs[_0x2064('0x1f')](_0x5a47c1[_0x2064('0x31')][_0x2064('0x1f')]);_0x4b1106[_0x2064('0x1c')]=qs[_0x2064('0x1c')](_0x5a47c1[_0x2064('0x31')][_0x2064('0x1c')]);}return _0x5e0901[_0x2064('0x4d')](_0x4b1106);}})['then'](function(_0x4bae50){if(_0x4bae50){return _0x4bae50?{'count':_0x583ad4,'rows':_0x4bae50}:null;}})[_0x2064('0x22')](respondWithResult(_0x520e42,null))['catch'](handleError(_0x520e42,null));};exports[_0x2064('0x50')]=function(_0x2fd7d7,_0x58e933,_0xa1b509){if(_0x2fd7d7[_0x2064('0x4b')]['id']){delete _0x2fd7d7['body']['id'];}return db['SugarcrmAccount'][_0x2064('0x4e')]({'where':{'id':_0x2fd7d7[_0x2064('0x44')]['id']}})[_0x2064('0x22')](handleEntityNotFound(_0x58e933,null))[_0x2064('0x22')](function(_0x307dd1){if(_0x307dd1){_0x2fd7d7[_0x2064('0x4b')][_0x2064('0x51')]=_0x307dd1['id'];_0x2fd7d7['body'][_0x2064('0x52')]=integrations[_0x2064('0x53')](_0x2fd7d7[_0x2064('0x4b')][_0x2064('0x54')],_0x2fd7d7['body'][_0x2064('0x2e')]);_0x2fd7d7[_0x2064('0x4b')][_0x2064('0x55')]=integrations[_0x2064('0x56')](_0x2fd7d7['body'][_0x2064('0x54')],_0x2fd7d7['body'][_0x2064('0x2e')]);return db[_0x2064('0x4f')][_0x2064('0x4a')](_0x2fd7d7[_0x2064('0x4b')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x2064('0x55')}]});}return null;})[_0x2064('0x22')](respondWithResult(_0x58e933,null))[_0x2064('0x49')](handleError(_0x58e933,null));};exports['getFields']=function(_0x37987e,_0x52263c,_0x503697){var _0x2645c2='';var _0x518070=['id','name','assigned_user_id','created_by','description','date_start',_0x2064('0x57'),'duration_minutes','parent_id','parent_type',_0x2064('0x58'),'direction'];return db[_0x2064('0x2c')][_0x2064('0x4e')]({'where':{'id':_0x37987e['params']['id']},'attributes':['id','username',_0x2064('0x59'),_0x2064('0x5a')]})['then'](handleEntityNotFound(_0x52263c,null))[_0x2064('0x22')](function(_0x5f2d54){if(_0x5f2d54){_0x2645c2=_0x5f2d54[_0x2064('0x5a')];var _0x13058a=_0x2645c2[_0x2064('0x5b')](-0x1);if(_0x13058a==='/'){_0x2645c2=_0x2645c2[_0x2064('0x5c')](0x0,_0x2645c2[_0x2064('0x5d')](_0x13058a));}return rp({'method':_0x2064('0x5e'),'uri':util[_0x2064('0x5f')](_0x2064('0x60'),_0x2645c2,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2064('0x61'),'input_type':'JSON','response_type':_0x2064('0x62'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5f2d54[_0x2064('0x63')],'password':_0x5f2d54[_0x2064('0x59')],'encryption':_0x2064('0x64')},'application':_0x2064('0x65')})}});}})['then'](function(_0x3f0593){if(_0x3f0593&&_0x3f0593['name']!==_0x2064('0x66')&&_0x3f0593['name']!==_0x2064('0x67')){return rp({'method':_0x2064('0x5e'),'uri':util[_0x2064('0x5f')](_0x2064('0x60'),_0x2645c2,_0x2064('0x68')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0x2064('0x62'),'rest_data':JSON[_0x2064('0x69')]({'session':_0x3f0593['id'],'module_name':_0x2064('0x6a')})}})[_0x2064('0x22')](function(_0x481050){if(_0x481050){var _0x44f32e=_[_0x2064('0x6b')](_0x481050['module_fields']);_[_0x2064('0x6c')](_0x44f32e,function(_0x34aabb){return _0x518070[_0x2064('0x6d')](_0x34aabb[_0x2064('0x28')]);});return{'count':_0x44f32e['length'],'rows':_['map'](_0x44f32e,function(_0xbf0a03){return{'id':_0xbf0a03[_0x2064('0x28')],'name':_0xbf0a03[_0x2064('0x6e')],'custom':_[_0x2064('0x6f')](_0xbf0a03[_0x2064('0x28')],'_c')?!![]:![],'options':_0xbf0a03[_0x2064('0x47')]?_['map'](_['values'](_0xbf0a03[_0x2064('0x47')]),function(_0x1feb10){return{'name':_0x1feb10[_0x2064('0x70')],'value':_0x1feb10['name']};}):[]};})};}})[_0x2064('0x22')](respondWithResult(_0x52263c,null))[_0x2064('0x49')](function(_0x43ace5){var _0x4f172f=_0x37987e['query'][_0x2064('0x71')]?0x1f4:_0x43ace5[_0x2064('0x72')]||0x1f4;logger['error'](_0x2064('0x73'),_0x2064('0x74'),_0x4f172f,JSON[_0x2064('0x69')](_0x43ace5));delete _0x43ace5[_0x2064('0x28')];if(_0x4f172f===0x191){_0x4f172f=0x190;}_0x52263c[_0x2064('0x1a')](_0x4f172f)[_0x2064('0x29')](_0x37987e[_0x2064('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x43ace5[_0x2064('0x72')]}:_0x43ace5);});}else{var _0x501556=0x1f4;_0x52263c[_0x2064('0x1a')](_0x501556)[_0x2064('0x29')]({'message':_0x2064('0x75'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xca88=['params','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','nolimit','AccountId','getSubjects','channel','Descriptions','SugarcrmField','Subjects','getFields','created_by','description','duration_hours','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','remove','includes','endsWith','values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body'];(function(_0x285fc1,_0x36f7b1){var _0x58bf57=function(_0x2acaec){while(--_0x2acaec){_0x285fc1['push'](_0x285fc1['shift']());}};_0x58bf57(++_0x36f7b1);}(_0xca88,0xab));var _0x8ca8=function(_0x51cb02,_0x491c6d){_0x51cb02=_0x51cb02-0x0;var _0x2e6ecc=_0xca88[_0x51cb02];return _0x2e6ecc;};'use strict';var emlformat=require(_0x8ca8('0x0'));var rimraf=require(_0x8ca8('0x1'));var zipdir=require(_0x8ca8('0x2'));var jsonpatch=require(_0x8ca8('0x3'));var rp=require(_0x8ca8('0x4'));var moment=require(_0x8ca8('0x5'));var BPromise=require(_0x8ca8('0x6'));var Mustache=require('mustache');var util=require(_0x8ca8('0x7'));var path=require(_0x8ca8('0x8'));var sox=require(_0x8ca8('0x9'));var csv=require(_0x8ca8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ca8('0xb'));var _=require(_0x8ca8('0xc'));var squel=require(_0x8ca8('0xd'));var crypto=require(_0x8ca8('0xe'));var jsforce=require(_0x8ca8('0xf'));var deskjs=require(_0x8ca8('0x10'));var toCsv=require(_0x8ca8('0xa'));var querystring=require(_0x8ca8('0x11'));var Papa=require(_0x8ca8('0x12'));var Redis=require('ioredis');var authService=require(_0x8ca8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8ca8('0x14'));var hardwareService=require(_0x8ca8('0x15'));var logger=require('../../config/logger')(_0x8ca8('0x16'));var utils=require(_0x8ca8('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8ca8('0x18'))['db'];var integrations=require(_0x8ca8('0x19'));function respondWithStatusCode(_0xce41ca,_0x39df55){_0x39df55=_0x39df55||0xcc;return function(_0x35e57d){if(_0x35e57d){return _0xce41ca[_0x8ca8('0x1a')](_0x39df55);}return _0xce41ca[_0x8ca8('0x1b')](_0x39df55)[_0x8ca8('0x1c')]();};}function respondWithResult(_0x45a7be,_0x36fa47){_0x36fa47=_0x36fa47||0xc8;return function(_0x5eb87a){if(_0x5eb87a){return _0x45a7be[_0x8ca8('0x1b')](_0x36fa47)[_0x8ca8('0x1d')](_0x5eb87a);}};}function respondWithFilteredResult(_0x19e67c,_0x147929){return function(_0x20ca09){if(_0x20ca09){var _0x3cddc8=typeof _0x147929[_0x8ca8('0x1e')]===_0x8ca8('0x1f')&&typeof _0x147929[_0x8ca8('0x20')]==='undefined';var _0x5eda6b=_0x20ca09[_0x8ca8('0x21')];var _0x16f60a=_0x3cddc8?0x0:_0x147929['offset'];var _0x5e3e77=_0x3cddc8?_0x20ca09[_0x8ca8('0x21')]:_0x147929[_0x8ca8('0x1e')]+_0x147929[_0x8ca8('0x20')];var _0x58238a;if(_0x5e3e77>=_0x5eda6b){_0x5e3e77=_0x5eda6b;_0x58238a=0xc8;}else{_0x58238a=0xce;}_0x19e67c[_0x8ca8('0x1b')](_0x58238a);return _0x19e67c[_0x8ca8('0x22')](_0x8ca8('0x23'),_0x16f60a+'-'+_0x5e3e77+'/'+_0x5eda6b)[_0x8ca8('0x1d')](_0x20ca09);}return null;};}function patchUpdates(_0x15b249){return function(_0x3da610){try{jsonpatch[_0x8ca8('0x24')](_0x3da610,_0x15b249,!![]);}catch(_0x3dc11e){return BPromise[_0x8ca8('0x25')](_0x3dc11e);}return _0x3da610[_0x8ca8('0x26')]();};}function saveUpdates(_0x976d19,_0x398920){return function(_0xc14200){if(_0xc14200){return _0xc14200[_0x8ca8('0x27')](_0x976d19)[_0x8ca8('0x28')](function(_0xe50a26){return _0xe50a26;});}return null;};}function removeEntity(_0x128c7b,_0x52af95){return function(_0x396a80){if(_0x396a80){return _0x396a80[_0x8ca8('0x29')]()[_0x8ca8('0x28')](function(){_0x128c7b[_0x8ca8('0x1b')](0xcc)[_0x8ca8('0x1c')]();});}};}function handleEntityNotFound(_0x2918c0,_0x3892b4){return function(_0x43997c){if(!_0x43997c){_0x2918c0['sendStatus'](0x194);}return _0x43997c;};}function handleError(_0x472bf1,_0x5f3938){_0x5f3938=_0x5f3938||0x1f4;return function(_0x4a3756){logger[_0x8ca8('0x2a')](_0x4a3756[_0x8ca8('0x2b')]);if(_0x4a3756[_0x8ca8('0x2c')]){delete _0x4a3756[_0x8ca8('0x2c')];}_0x472bf1[_0x8ca8('0x1b')](_0x5f3938)['send'](_0x4a3756);};}exports[_0x8ca8('0x2d')]=function(_0x49afd5,_0x4cd590){var _0x51d142={},_0x51afee={},_0x4f4f19={'count':0x0,'rows':[]};var _0x1ba20f=_[_0x8ca8('0x2e')](db[_0x8ca8('0x2f')][_0x8ca8('0x30')],function(_0x32de95){return{'name':_0x32de95[_0x8ca8('0x31')],'type':_0x32de95[_0x8ca8('0x32')][_0x8ca8('0x33')]};});_0x51afee[_0x8ca8('0x34')]=_[_0x8ca8('0x2e')](_0x1ba20f,_0x8ca8('0x2c'));_0x51afee['query']=_[_0x8ca8('0x35')](_0x49afd5[_0x8ca8('0x36')]);_0x51afee[_0x8ca8('0x37')]=_[_0x8ca8('0x38')](_0x51afee[_0x8ca8('0x34')],_0x51afee['query']);_0x51d142[_0x8ca8('0x39')]=_[_0x8ca8('0x38')](_0x51afee[_0x8ca8('0x34')],qs[_0x8ca8('0x3a')](_0x49afd5[_0x8ca8('0x36')][_0x8ca8('0x3a')]));_0x51d142[_0x8ca8('0x39')]=_0x51d142[_0x8ca8('0x39')][_0x8ca8('0x3b')]?_0x51d142[_0x8ca8('0x39')]:_0x51afee[_0x8ca8('0x34')];if(!_0x49afd5['query']['hasOwnProperty']('nolimit')){_0x51d142['limit']=qs[_0x8ca8('0x20')](_0x49afd5[_0x8ca8('0x36')]['limit']);_0x51d142[_0x8ca8('0x1e')]=qs['offset'](_0x49afd5[_0x8ca8('0x36')][_0x8ca8('0x1e')]);}_0x51d142[_0x8ca8('0x3c')]=qs[_0x8ca8('0x3d')](_0x49afd5['query']['sort']);_0x51d142[_0x8ca8('0x3e')]=qs[_0x8ca8('0x37')](_[_0x8ca8('0x3f')](_0x49afd5[_0x8ca8('0x36')],_0x51afee['filters']),_0x1ba20f);if(_0x49afd5[_0x8ca8('0x36')][_0x8ca8('0x40')]){_0x51d142[_0x8ca8('0x3e')]=_[_0x8ca8('0x41')](_0x51d142[_0x8ca8('0x3e')],{'$or':_['map'](_0x1ba20f,function(_0x25c71f){if(_0x25c71f[_0x8ca8('0x32')]!==_0x8ca8('0x42')){var _0x4a030f={};_0x4a030f[_0x25c71f[_0x8ca8('0x2c')]]={'$like':'%'+_0x49afd5[_0x8ca8('0x36')][_0x8ca8('0x40')]+'%'};return _0x4a030f;}})});}_0x51d142=_['merge']({},_0x51d142,_0x49afd5[_0x8ca8('0x43')]);var _0x37c0a0={'where':_0x51d142['where']};return db[_0x8ca8('0x2f')]['count'](_0x37c0a0)[_0x8ca8('0x28')](function(_0x460558){_0x4f4f19[_0x8ca8('0x21')]=_0x460558;if(_0x49afd5[_0x8ca8('0x36')][_0x8ca8('0x44')]){_0x51d142[_0x8ca8('0x45')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x8ca8('0x46')](_0x51d142);})[_0x8ca8('0x28')](function(_0xd42bcb){_0x4f4f19[_0x8ca8('0x47')]=_0xd42bcb;return _0x4f4f19;})[_0x8ca8('0x28')](respondWithFilteredResult(_0x4cd590,_0x51d142))[_0x8ca8('0x48')](handleError(_0x4cd590,null));};exports[_0x8ca8('0x49')]=function(_0x5d4e5b,_0x3f5a53){var _0x36907e={'raw':![],'where':{'id':_0x5d4e5b['params']['id']}},_0x5721d3={};_0x5721d3[_0x8ca8('0x34')]=_[_0x8ca8('0x35')](db[_0x8ca8('0x2f')][_0x8ca8('0x30')]);_0x5721d3['query']=_[_0x8ca8('0x35')](_0x5d4e5b[_0x8ca8('0x36')]);_0x5721d3['filters']=_['intersection'](_0x5721d3[_0x8ca8('0x34')],_0x5721d3[_0x8ca8('0x36')]);_0x36907e['attributes']=_[_0x8ca8('0x38')](_0x5721d3[_0x8ca8('0x34')],qs['fields'](_0x5d4e5b[_0x8ca8('0x36')][_0x8ca8('0x3a')]));_0x36907e[_0x8ca8('0x39')]=_0x36907e[_0x8ca8('0x39')][_0x8ca8('0x3b')]?_0x36907e['attributes']:_0x5721d3['model'];if(_0x5d4e5b[_0x8ca8('0x36')]['includeAll']){_0x36907e['include']=[{'all':!![]}];}_0x36907e=_['merge']({},_0x36907e,_0x5d4e5b['options']);return db[_0x8ca8('0x2f')][_0x8ca8('0x4a')](_0x36907e)[_0x8ca8('0x28')](handleEntityNotFound(_0x3f5a53,null))[_0x8ca8('0x28')](respondWithResult(_0x3f5a53,null))[_0x8ca8('0x48')](handleError(_0x3f5a53,null));};exports[_0x8ca8('0x4b')]=function(_0x55f761,_0x5eda27){return db[_0x8ca8('0x2f')][_0x8ca8('0x4b')](_0x55f761[_0x8ca8('0x4c')],{})['then'](respondWithResult(_0x5eda27,0xc9))[_0x8ca8('0x48')](handleError(_0x5eda27,null));};exports[_0x8ca8('0x27')]=function(_0xcd534f,_0x42f7f7){if(_0xcd534f[_0x8ca8('0x4c')]['id']){delete _0xcd534f['body']['id'];}return db[_0x8ca8('0x2f')][_0x8ca8('0x4a')]({'where':{'id':_0xcd534f[_0x8ca8('0x4d')]['id']}})[_0x8ca8('0x28')](handleEntityNotFound(_0x42f7f7,null))['then'](saveUpdates(_0xcd534f[_0x8ca8('0x4c')],null))[_0x8ca8('0x28')](respondWithResult(_0x42f7f7,null))['catch'](handleError(_0x42f7f7,null));};exports[_0x8ca8('0x29')]=function(_0x29bd1e,_0x23a8f4){return db[_0x8ca8('0x2f')][_0x8ca8('0x4a')]({'where':{'id':_0x29bd1e[_0x8ca8('0x4d')]['id']}})[_0x8ca8('0x28')](handleEntityNotFound(_0x23a8f4,null))[_0x8ca8('0x28')](removeEntity(_0x23a8f4,null))[_0x8ca8('0x48')](handleError(_0x23a8f4,null));};exports[_0x8ca8('0x4e')]=function(_0x22e600,_0x193bf3,_0x2bdd19){var _0x3264a5={};var _0x47af88={};var _0x3aa8e8;var _0x1a8dde;return db[_0x8ca8('0x2f')][_0x8ca8('0x4f')]({'where':{'id':_0x22e600['params']['id']}})[_0x8ca8('0x28')](handleEntityNotFound(_0x193bf3,null))[_0x8ca8('0x28')](function(_0x2771a0){if(_0x2771a0){_0x3aa8e8=_0x2771a0;_0x47af88[_0x8ca8('0x34')]=_[_0x8ca8('0x35')](db[_0x8ca8('0x50')][_0x8ca8('0x30')]);_0x47af88[_0x8ca8('0x36')]=_[_0x8ca8('0x35')](_0x22e600[_0x8ca8('0x36')]);_0x47af88['filters']=_['intersection'](_0x47af88[_0x8ca8('0x34')],_0x47af88['query']);_0x3264a5[_0x8ca8('0x39')]=_[_0x8ca8('0x38')](_0x47af88[_0x8ca8('0x34')],qs['fields'](_0x22e600['query'][_0x8ca8('0x3a')]));_0x3264a5['attributes']=_0x3264a5[_0x8ca8('0x39')]['length']?_0x3264a5[_0x8ca8('0x39')]:_0x47af88[_0x8ca8('0x34')];_0x3264a5['order']=qs[_0x8ca8('0x3d')](_0x22e600[_0x8ca8('0x36')]['sort']);_0x3264a5[_0x8ca8('0x3e')]=qs['filters'](_[_0x8ca8('0x3f')](_0x22e600['query'],_0x47af88['filters']));if(_0x22e600[_0x8ca8('0x36')][_0x8ca8('0x40')]){_0x3264a5[_0x8ca8('0x3e')]=_['merge'](_0x3264a5[_0x8ca8('0x3e')],{'$or':_[_0x8ca8('0x2e')](_0x3264a5[_0x8ca8('0x39')],function(_0x3d5ec6){var _0x3a00a7={};_0x3a00a7[_0x3d5ec6]={'$like':'%'+_0x22e600['query'][_0x8ca8('0x40')]+'%'};return _0x3a00a7;})});}_0x3264a5=_[_0x8ca8('0x41')]({},_0x3264a5,_0x22e600['options']);return _0x3aa8e8['getConfigurations'](_0x3264a5);}})[_0x8ca8('0x28')](function(_0x5d79a5){if(_0x5d79a5){_0x1a8dde=_0x5d79a5[_0x8ca8('0x3b')];if(!_0x22e600[_0x8ca8('0x36')][_0x8ca8('0x51')](_0x8ca8('0x52'))){_0x3264a5[_0x8ca8('0x20')]=qs[_0x8ca8('0x20')](_0x22e600[_0x8ca8('0x36')]['limit']);_0x3264a5[_0x8ca8('0x1e')]=qs[_0x8ca8('0x1e')](_0x22e600[_0x8ca8('0x36')]['offset']);}return _0x3aa8e8[_0x8ca8('0x4e')](_0x3264a5);}})[_0x8ca8('0x28')](function(_0x4cdbc9){if(_0x4cdbc9){return _0x4cdbc9?{'count':_0x1a8dde,'rows':_0x4cdbc9}:null;}})[_0x8ca8('0x28')](respondWithResult(_0x193bf3,null))[_0x8ca8('0x48')](handleError(_0x193bf3,null));};exports['addConfiguration']=function(_0x3aea19,_0x55aa92,_0x411f3f){if(_0x3aea19['body']['id']){delete _0x3aea19['body']['id'];}return db[_0x8ca8('0x2f')][_0x8ca8('0x4f')]({'where':{'id':_0x3aea19['params']['id']}})[_0x8ca8('0x28')](handleEntityNotFound(_0x55aa92,null))[_0x8ca8('0x28')](function(_0x4f2718){if(_0x4f2718){_0x3aea19['body'][_0x8ca8('0x53')]=_0x4f2718['id'];_0x3aea19[_0x8ca8('0x4c')]['Subjects']=integrations[_0x8ca8('0x54')](_0x3aea19[_0x8ca8('0x4c')][_0x8ca8('0x55')],_0x3aea19[_0x8ca8('0x4c')][_0x8ca8('0x32')]);_0x3aea19[_0x8ca8('0x4c')][_0x8ca8('0x56')]=integrations['getDescriptions'](_0x3aea19[_0x8ca8('0x4c')][_0x8ca8('0x55')],_0x3aea19[_0x8ca8('0x4c')][_0x8ca8('0x32')]);return db[_0x8ca8('0x50')][_0x8ca8('0x4b')](_0x3aea19[_0x8ca8('0x4c')],{'include':[{'model':db[_0x8ca8('0x57')],'as':_0x8ca8('0x58')},{'model':db['SugarcrmField'],'as':_0x8ca8('0x56')}]});}return null;})['then'](respondWithResult(_0x55aa92,null))['catch'](handleError(_0x55aa92,null));};exports[_0x8ca8('0x59')]=function(_0x49976e,_0x103290,_0xe9bffd){var _0x3b2c5e='';var _0x294ee0=['id',_0x8ca8('0x2c'),'assigned_user_id',_0x8ca8('0x5a'),_0x8ca8('0x5b'),'date_start',_0x8ca8('0x5c'),'duration_minutes',_0x8ca8('0x5d'),_0x8ca8('0x5e'),_0x8ca8('0x5f'),_0x8ca8('0x60')];return db['SugarcrmAccount'][_0x8ca8('0x4f')]({'where':{'id':_0x49976e[_0x8ca8('0x4d')]['id']},'attributes':['id','username',_0x8ca8('0x61'),'remoteUri']})[_0x8ca8('0x28')](handleEntityNotFound(_0x103290,null))[_0x8ca8('0x28')](function(_0x4c5672){if(_0x4c5672){_0x3b2c5e=_0x4c5672[_0x8ca8('0x62')];var _0x591771=_0x3b2c5e[_0x8ca8('0x63')](-0x1);if(_0x591771==='/'){_0x3b2c5e=_0x3b2c5e[_0x8ca8('0x64')](0x0,_0x3b2c5e[_0x8ca8('0x65')](_0x591771));}return rp({'method':'POST','uri':util[_0x8ca8('0x66')](_0x8ca8('0x67'),_0x3b2c5e,_0x8ca8('0x68')),'json':!![],'form':{'method':_0x8ca8('0x69'),'input_type':_0x8ca8('0x6a'),'response_type':'JSON','rest_data':JSON[_0x8ca8('0x6b')]({'user_auth':{'user_name':_0x4c5672[_0x8ca8('0x6c')],'password':_0x4c5672['password'],'encryption':_0x8ca8('0x6d')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x8ca8('0x28')](function(_0x15a253){if(_0x15a253&&_0x15a253[_0x8ca8('0x2c')]!==_0x8ca8('0x6e')&&_0x15a253[_0x8ca8('0x2c')]!==_0x8ca8('0x6f')){return rp({'method':_0x8ca8('0x70'),'uri':util[_0x8ca8('0x66')]('%s%s',_0x3b2c5e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x8ca8('0x71'),'input_type':_0x8ca8('0x6a'),'response_type':_0x8ca8('0x6a'),'rest_data':JSON[_0x8ca8('0x6b')]({'session':_0x15a253['id'],'module_name':_0x8ca8('0x72')})}})[_0x8ca8('0x28')](function(_0x770d9c){if(_0x770d9c){var _0x1d5729=_['values'](_0x770d9c['module_fields']);_[_0x8ca8('0x73')](_0x1d5729,function(_0x3b9594){return _0x294ee0[_0x8ca8('0x74')](_0x3b9594[_0x8ca8('0x2c')]);});return{'count':_0x1d5729[_0x8ca8('0x3b')],'rows':_[_0x8ca8('0x2e')](_0x1d5729,function(_0x343614){return{'id':_0x343614[_0x8ca8('0x2c')],'name':_0x343614['label'],'custom':_[_0x8ca8('0x75')](_0x343614[_0x8ca8('0x2c')],'_c')?!![]:![],'options':_0x343614[_0x8ca8('0x43')]?_['map'](_[_0x8ca8('0x76')](_0x343614['options']),function(_0x1f9e48){return{'name':_0x1f9e48['value'],'value':_0x1f9e48[_0x8ca8('0x2c')]};}):[]};})};}})[_0x8ca8('0x28')](respondWithResult(_0x103290,null))[_0x8ca8('0x48')](function(_0x28abf6){var _0x7b775f=_0x49976e[_0x8ca8('0x36')][_0x8ca8('0x77')]?0x1f4:_0x28abf6[_0x8ca8('0x78')]||0x1f4;logger['error'](_0x8ca8('0x79'),_0x8ca8('0x59'),_0x7b775f,JSON[_0x8ca8('0x6b')](_0x28abf6));delete _0x28abf6[_0x8ca8('0x2c')];if(_0x7b775f===0x191){_0x7b775f=0x190;}_0x103290[_0x8ca8('0x1b')](_0x7b775f)['send'](_0x49976e[_0x8ca8('0x36')][_0x8ca8('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x28abf6[_0x8ca8('0x78')]}:_0x28abf6);});}else{var _0x410de5=0x1f4;_0x103290['status'](_0x410de5)[_0x8ca8('0x7a')]({'message':_0x8ca8('0x7b'),'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 413d759..50e8fc6 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 _0xb486=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb486,0x138));var _0x6b48=function(_0x152702,_0x5a9ea7){_0x152702=_0x152702-0x0;var _0x100fd6=_0xb486[_0x152702];return _0x100fd6;};'use strict';var _=require(_0x6b48('0x0'));var util=require(_0x6b48('0x1'));var logger=require('../../config/logger')(_0x6b48('0x2'));var moment=require(_0x6b48('0x3'));var BPromise=require(_0x6b48('0x4'));var rp=require(_0x6b48('0x5'));var fs=require('fs');var path=require(_0x6b48('0x6'));var rimraf=require(_0x6b48('0x7'));var config=require(_0x6b48('0x8'));var attributes=require(_0x6b48('0x9'));var integrations=require(_0x6b48('0xa'));module[_0x6b48('0xb')]=function(_0x40ae92,_0x366a50){return _0x40ae92[_0x6b48('0xc')](_0x6b48('0xd'),attributes,{'tableName':_0x6b48('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee3a=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x55d6a1,_0x4a3b75){var _0x5ef900=function(_0x2995bc){while(--_0x2995bc){_0x55d6a1['push'](_0x55d6a1['shift']());}};_0x5ef900(++_0x4a3b75);}(_0xee3a,0x13f));var _0xaee3=function(_0x1a7470,_0x513bb0){_0x1a7470=_0x1a7470-0x0;var _0x2973e2=_0xee3a[_0x1a7470];return _0x2973e2;};'use strict';var _=require(_0xaee3('0x0'));var util=require(_0xaee3('0x1'));var logger=require(_0xaee3('0x2'))('api');var moment=require(_0xaee3('0x3'));var BPromise=require(_0xaee3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaee3('0x5'));var rimraf=require(_0xaee3('0x6'));var config=require(_0xaee3('0x7'));var attributes=require(_0xaee3('0x8'));var integrations=require(_0xaee3('0x9'));module[_0xaee3('0xa')]=function(_0x1b15ed,_0x50c037){return _0x1b15ed[_0xaee3('0xb')](_0xaee3('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','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 eceeb08..c138211 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 _0xa036=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','limit','map','include','model','attributes','stringify','ShowSugarcrmAccount','raw','where','then','lodash','util','randomstring','ioredis'];(function(_0x9ca9d1,_0x512b16){var _0x1db0ca=function(_0x1278aa){while(--_0x1278aa){_0x9ca9d1['push'](_0x9ca9d1['shift']());}};_0x1db0ca(++_0x512b16);}(_0xa036,0xa1));var _0x6a03=function(_0x8f3061,_0x4fb07d){_0x8f3061=_0x8f3061-0x0;var _0x545aee=_0xa036[_0x8f3061];return _0x545aee;};'use strict';var _=require(_0x6a03('0x0'));var util=require(_0x6a03('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6a03('0x2'));var fs=require('fs');var Redis=require(_0x6a03('0x3'));var db=require(_0x6a03('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a03('0x5'))(_0x6a03('0x6'));var config=require(_0x6a03('0x7'));var jayson=require(_0x6a03('0x8'));var client=jayson[_0x6a03('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59bef1,_0x35b8e9,_0x3b163f){return new BPromise(function(_0x235f49,_0x3fb615){return client[_0x6a03('0xa')](_0x59bef1,_0x3b163f)['then'](function(_0x271fd6){logger['info'](_0x6a03('0xb'),_0x35b8e9,_0x6a03('0xc'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x35b8e9,_0x6a03('0xc'),JSON['stringify'](_0x271fd6));if(_0x271fd6[_0x6a03('0xd')]){if(_0x271fd6[_0x6a03('0xd')][_0x6a03('0xe')]===0x1f4){logger[_0x6a03('0xd')](_0x6a03('0xb'),_0x35b8e9,_0x271fd6[_0x6a03('0xd')][_0x6a03('0xf')]);return _0x3fb615(_0x271fd6['error']['message']);}logger[_0x6a03('0xd')](_0x6a03('0xb'),_0x35b8e9,_0x271fd6[_0x6a03('0xd')][_0x6a03('0xf')]);return _0x235f49(_0x271fd6[_0x6a03('0xd')][_0x6a03('0xf')]);}else{logger[_0x6a03('0x10')](_0x6a03('0xb'),_0x35b8e9,_0x6a03('0xc'));_0x235f49(_0x271fd6[_0x6a03('0x11')][_0x6a03('0xf')]);}})[_0x6a03('0x12')](function(_0x2acd7c){logger['error'](_0x6a03('0xb'),_0x35b8e9,_0x2acd7c);_0x3fb615(_0x2acd7c);});});}exports[_0x6a03('0x13')]=function(_0x4a6c7b){var _0x3669ac=this;return new Promise(function(_0x17f0e2,_0x1ba723){return db[_0x6a03('0x14')][_0x6a03('0x15')]({'raw':_0x4a6c7b[_0x6a03('0x16')]?_0x4a6c7b[_0x6a03('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4a6c7b[_0x6a03('0x16')]?_0x4a6c7b[_0x6a03('0x16')]['where']||null:null,'attributes':_0x4a6c7b[_0x6a03('0x16')]?_0x4a6c7b[_0x6a03('0x16')]['attributes']||null:null,'limit':_0x4a6c7b['options']?_0x4a6c7b['options'][_0x6a03('0x17')]||null:null,'include':_0x4a6c7b[_0x6a03('0x16')]?_0x4a6c7b['options']['include']?_[_0x6a03('0x18')](_0x4a6c7b[_0x6a03('0x16')][_0x6a03('0x19')],function(_0x24cf76){return{'model':db[_0x24cf76[_0x6a03('0x1a')]],'as':_0x24cf76['as'],'attributes':_0x24cf76['attributes'],'include':_0x24cf76['include']?_['map'](_0x24cf76[_0x6a03('0x19')],function(_0x4f2981){return{'model':db[_0x4f2981[_0x6a03('0x1a')]],'as':_0x4f2981['as'],'attributes':_0x4f2981['attributes'],'include':_0x4f2981[_0x6a03('0x19')]?_[_0x6a03('0x18')](_0x4f2981[_0x6a03('0x19')],function(_0x5b4453){return{'model':db[_0x5b4453[_0x6a03('0x1a')]],'as':_0x5b4453['as'],'attributes':_0x5b4453[_0x6a03('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54d577){logger['info'](_0x6a03('0x13'),_0x4a6c7b);logger['debug'](_0x6a03('0x13'),_0x4a6c7b,JSON[_0x6a03('0x1c')](_0x54d577));_0x17f0e2(_0x54d577);})[_0x6a03('0x12')](function(_0x14ea35){logger[_0x6a03('0xd')](_0x6a03('0x13'),_0x14ea35[_0x6a03('0xf')],_0x4a6c7b);_0x1ba723(_0x3669ac[_0x6a03('0xd')](0x1f4,_0x14ea35[_0x6a03('0xf')]));});});};exports[_0x6a03('0x1d')]=function(_0x57efcd){var _0x212833=this;return new Promise(function(_0x225646,_0x22ee90){return db[_0x6a03('0x14')]['find']({'raw':_0x57efcd[_0x6a03('0x16')]?_0x57efcd[_0x6a03('0x16')][_0x6a03('0x1e')]===undefined?!![]:![]:!![],'where':_0x57efcd[_0x6a03('0x16')]?_0x57efcd[_0x6a03('0x16')][_0x6a03('0x1f')]||null:null,'attributes':_0x57efcd[_0x6a03('0x16')]?_0x57efcd[_0x6a03('0x16')]['attributes']||null:null,'include':_0x57efcd[_0x6a03('0x16')]?_0x57efcd[_0x6a03('0x16')][_0x6a03('0x19')]?_[_0x6a03('0x18')](_0x57efcd[_0x6a03('0x16')][_0x6a03('0x19')],function(_0x183464){return{'model':db[_0x183464[_0x6a03('0x1a')]],'as':_0x183464['as'],'attributes':_0x183464[_0x6a03('0x1b')],'include':_0x183464[_0x6a03('0x19')]?_['map'](_0x183464[_0x6a03('0x19')],function(_0x525a03){return{'model':db[_0x525a03[_0x6a03('0x1a')]],'as':_0x525a03['as'],'attributes':_0x525a03[_0x6a03('0x1b')],'include':_0x525a03[_0x6a03('0x19')]?_[_0x6a03('0x18')](_0x525a03[_0x6a03('0x19')],function(_0x4020b6){return{'model':db[_0x4020b6[_0x6a03('0x1a')]],'as':_0x4020b6['as'],'attributes':_0x4020b6[_0x6a03('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6a03('0x20')](function(_0x4c1491){logger[_0x6a03('0x10')](_0x6a03('0x1d'),_0x57efcd);logger['debug']('ShowSugarcrmAccount',_0x57efcd,JSON['stringify'](_0x4c1491));_0x225646(_0x4c1491);})[_0x6a03('0x12')](function(_0x80cf3c){logger['error'](_0x6a03('0x1d'),_0x80cf3c[_0x6a03('0xf')],_0x57efcd);_0x22ee90(_0x212833[_0x6a03('0xd')](0x1f4,_0x80cf3c[_0x6a03('0xf')]));});});}; \ No newline at end of file +var _0x660a=['error','code','message','result','findAll','options','raw','where','limit','include','map','model','attributes','debug','stringify','catch','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','find','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3f29bc,_0x102fa1){var _0x253de9=function(_0x3ee168){while(--_0x3ee168){_0x3f29bc['push'](_0x3f29bc['shift']());}};_0x253de9(++_0x102fa1);}(_0x660a,0xa4));var _0xa660=function(_0x21b87c,_0x1fcc0c){_0x21b87c=_0x21b87c-0x0;var _0x54cfec=_0x660a[_0x21b87c];return _0x54cfec;};'use strict';var _=require('lodash');var util=require(_0xa660('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa660('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa660('0x2'))['db'];var utils=require(_0xa660('0x3'));var logger=require(_0xa660('0x4'))(_0xa660('0x5'));var config=require(_0xa660('0x6'));var jayson=require(_0xa660('0x7'));var client=jayson[_0xa660('0x8')][_0xa660('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x306d15,_0x3f9445,_0x23d43f){return new BPromise(function(_0x8f8c49,_0x222202){return client[_0xa660('0xa')](_0x306d15,_0x23d43f)[_0xa660('0xb')](function(_0x1afd6d){logger[_0xa660('0xc')](_0xa660('0xd'),_0x3f9445,_0xa660('0xe'));logger['debug'](_0xa660('0xf'),_0x3f9445,_0xa660('0xe'),JSON['stringify'](_0x1afd6d));if(_0x1afd6d['error']){if(_0x1afd6d[_0xa660('0x10')][_0xa660('0x11')]===0x1f4){logger[_0xa660('0x10')](_0xa660('0xd'),_0x3f9445,_0x1afd6d[_0xa660('0x10')][_0xa660('0x12')]);return _0x222202(_0x1afd6d[_0xa660('0x10')][_0xa660('0x12')]);}logger[_0xa660('0x10')](_0xa660('0xd'),_0x3f9445,_0x1afd6d[_0xa660('0x10')][_0xa660('0x12')]);return _0x8f8c49(_0x1afd6d['error'][_0xa660('0x12')]);}else{logger[_0xa660('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x3f9445,'request\x20sent');_0x8f8c49(_0x1afd6d[_0xa660('0x13')][_0xa660('0x12')]);}})['catch'](function(_0x5d6831){logger[_0xa660('0x10')](_0xa660('0xd'),_0x3f9445,_0x5d6831);_0x222202(_0x5d6831);});});}exports['GetSugarcrmAccount']=function(_0xfdd97){var _0x42eae4=this;return new Promise(function(_0x516347,_0x549fc8){return db['SugarcrmAccount'][_0xa660('0x14')]({'raw':_0xfdd97[_0xa660('0x15')]?_0xfdd97['options'][_0xa660('0x16')]===undefined?!![]:![]:!![],'where':_0xfdd97['options']?_0xfdd97[_0xa660('0x15')][_0xa660('0x17')]||null:null,'attributes':_0xfdd97[_0xa660('0x15')]?_0xfdd97['options']['attributes']||null:null,'limit':_0xfdd97['options']?_0xfdd97['options'][_0xa660('0x18')]||null:null,'include':_0xfdd97[_0xa660('0x15')]?_0xfdd97[_0xa660('0x15')][_0xa660('0x19')]?_[_0xa660('0x1a')](_0xfdd97[_0xa660('0x15')]['include'],function(_0x2e4f97){return{'model':db[_0x2e4f97[_0xa660('0x1b')]],'as':_0x2e4f97['as'],'attributes':_0x2e4f97[_0xa660('0x1c')],'include':_0x2e4f97['include']?_[_0xa660('0x1a')](_0x2e4f97['include'],function(_0x2f07e4){return{'model':db[_0x2f07e4[_0xa660('0x1b')]],'as':_0x2f07e4['as'],'attributes':_0x2f07e4[_0xa660('0x1c')],'include':_0x2f07e4['include']?_[_0xa660('0x1a')](_0x2f07e4[_0xa660('0x19')],function(_0x3c5ebe){return{'model':db[_0x3c5ebe[_0xa660('0x1b')]],'as':_0x3c5ebe['as'],'attributes':_0x3c5ebe[_0xa660('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa660('0xb')](function(_0x347849){logger[_0xa660('0xc')]('GetSugarcrmAccount',_0xfdd97);logger[_0xa660('0x1d')]('GetSugarcrmAccount',_0xfdd97,JSON[_0xa660('0x1e')](_0x347849));_0x516347(_0x347849);})[_0xa660('0x1f')](function(_0x38eba4){logger['error'](_0xa660('0x20'),_0x38eba4[_0xa660('0x12')],_0xfdd97);_0x549fc8(_0x42eae4[_0xa660('0x10')](0x1f4,_0x38eba4[_0xa660('0x12')]));});});};exports[_0xa660('0x21')]=function(_0x3f88de){var _0x499b1b=this;return new Promise(function(_0x4abd6b,_0x1aed7f){return db[_0xa660('0x22')][_0xa660('0x23')]({'raw':_0x3f88de[_0xa660('0x15')]?_0x3f88de['options'][_0xa660('0x16')]===undefined?!![]:![]:!![],'where':_0x3f88de[_0xa660('0x15')]?_0x3f88de[_0xa660('0x15')][_0xa660('0x17')]||null:null,'attributes':_0x3f88de[_0xa660('0x15')]?_0x3f88de[_0xa660('0x15')]['attributes']||null:null,'include':_0x3f88de[_0xa660('0x15')]?_0x3f88de[_0xa660('0x15')][_0xa660('0x19')]?_[_0xa660('0x1a')](_0x3f88de[_0xa660('0x15')]['include'],function(_0x30762f){return{'model':db[_0x30762f[_0xa660('0x1b')]],'as':_0x30762f['as'],'attributes':_0x30762f[_0xa660('0x1c')],'include':_0x30762f[_0xa660('0x19')]?_[_0xa660('0x1a')](_0x30762f[_0xa660('0x19')],function(_0xda717c){return{'model':db[_0xda717c['model']],'as':_0xda717c['as'],'attributes':_0xda717c[_0xa660('0x1c')],'include':_0xda717c[_0xa660('0x19')]?_[_0xa660('0x1a')](_0xda717c[_0xa660('0x19')],function(_0x1b019f){return{'model':db[_0x1b019f['model']],'as':_0x1b019f['as'],'attributes':_0x1b019f['attributes']};}):[]};}):[]};}):[]:[]})[_0xa660('0xb')](function(_0x34f90a){logger['info'](_0xa660('0x21'),_0x3f88de);logger['debug'](_0xa660('0x21'),_0x3f88de,JSON[_0xa660('0x1e')](_0x34f90a));_0x4abd6b(_0x34f90a);})[_0xa660('0x1f')](function(_0x327390){logger[_0xa660('0x10')](_0xa660('0x21'),_0x327390[_0xa660('0x12')],_0x3f88de);_0x1aed7f(_0x499b1b[_0xa660('0x10')](0x1f4,_0x327390[_0xa660('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 2ad58c2..eeaa327 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 _0x2841=['getDescriptions','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/descriptions'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x2841,0x131));var _0x1284=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x2841[_0xba1760];return _0x1f3143;};'use strict';var multer=require(_0x1284('0x0'));var util=require(_0x1284('0x1'));var path=require(_0x1284('0x2'));var timeout=require(_0x1284('0x3'));var express=require(_0x1284('0x4'));var router=express[_0x1284('0x5')]();var fs_extra=require(_0x1284('0x6'));var auth=require(_0x1284('0x7'));var interaction=require(_0x1284('0x8'));var config=require(_0x1284('0x9'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x1284('0xa')]('/',auth[_0x1284('0xb')](),controller[_0x1284('0xc')]);router['get'](_0x1284('0xd'),auth[_0x1284('0xb')](),controller[_0x1284('0xe')]);router[_0x1284('0xa')](_0x1284('0xf'),auth[_0x1284('0xb')](),controller['getFields']);router[_0x1284('0xa')]('/:id/subjects',auth[_0x1284('0xb')](),controller['getSubjects']);router[_0x1284('0xa')](_0x1284('0x10'),auth['isAuthenticated'](),controller[_0x1284('0x11')]);router[_0x1284('0x12')]('/',auth[_0x1284('0xb')](),controller[_0x1284('0x13')]);router['put'](_0x1284('0xd'),auth[_0x1284('0xb')](),controller[_0x1284('0x14')]);router[_0x1284('0x15')](_0x1284('0xd'),auth[_0x1284('0xb')](),controller['destroy']);module[_0x1284('0x16')]=router; \ No newline at end of file +var _0x4c9a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','exports','multer','util','path'];(function(_0x3efe53,_0x2b28f2){var _0x37e031=function(_0x5976b4){while(--_0x5976b4){_0x3efe53['push'](_0x3efe53['shift']());}};_0x37e031(++_0x2b28f2);}(_0x4c9a,0x110));var _0xa4c9=function(_0x5081e7,_0x1f8fca){_0x5081e7=_0x5081e7-0x0;var _0x25a674=_0x4c9a[_0x5081e7];return _0x25a674;};'use strict';var multer=require(_0xa4c9('0x0'));var util=require(_0xa4c9('0x1'));var path=require(_0xa4c9('0x2'));var timeout=require(_0xa4c9('0x3'));var express=require(_0xa4c9('0x4'));var router=express[_0xa4c9('0x5')]();var fs_extra=require(_0xa4c9('0x6'));var auth=require(_0xa4c9('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa4c9('0x8'));router[_0xa4c9('0x9')]('/',auth[_0xa4c9('0xa')](),controller[_0xa4c9('0xb')]);router[_0xa4c9('0x9')](_0xa4c9('0xc'),auth[_0xa4c9('0xa')](),controller[_0xa4c9('0xd')]);router['get'](_0xa4c9('0xe'),auth['isAuthenticated'](),controller[_0xa4c9('0xf')]);router[_0xa4c9('0x9')](_0xa4c9('0x10'),auth[_0xa4c9('0xa')](),controller[_0xa4c9('0x11')]);router[_0xa4c9('0x9')](_0xa4c9('0x12'),auth[_0xa4c9('0xa')](),controller[_0xa4c9('0x13')]);router[_0xa4c9('0x14')]('/',auth[_0xa4c9('0xa')](),controller[_0xa4c9('0x15')]);router['put'](_0xa4c9('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa4c9('0x16')]('/:id',auth[_0xa4c9('0xa')](),controller[_0xa4c9('0x17')]);module[_0xa4c9('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index eee94ab..77ed0b4 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 _0x4d88=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d88,0x9d));var _0x84d8=function(_0x5d99dd,_0x4bb40b){_0x5d99dd=_0x5d99dd-0x0;var _0x148a26=_0x4d88[_0x5d99dd];return _0x148a26;};'use strict';var Sequelize=require(_0x84d8('0x0'));module['exports']={'name':{'type':Sequelize[_0x84d8('0x1')]},'description':{'type':Sequelize[_0x84d8('0x1')]}}; \ No newline at end of file +var _0xc084=['sequelize','STRING'];(function(_0x49c0b1,_0x9921c6){var _0x17dfbe=function(_0x12d4e0){while(--_0x12d4e0){_0x49c0b1['push'](_0x49c0b1['shift']());}};_0x17dfbe(++_0x9921c6);}(_0xc084,0x18a));var _0x4c08=function(_0x5a699b,_0x1b1491){_0x5a699b=_0x5a699b-0x0;var _0x49351f=_0xc084[_0x5a699b];return _0x49351f;};'use strict';var Sequelize=require(_0x4c08('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4c08('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 217504a..98f09ab 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 _0x2cae=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','show','params','rawAttributes','catch','create','body','update','find','getFields','findOne','getSubjects','SugarcrmField','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','index','map','SugarcrmConfiguration','fieldName','type','model','query'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2cae,0x1bd));var _0xe2ca=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0x2cae[_0x11f249];return _0x5c3656;};'use strict';var emlformat=require(_0xe2ca('0x0'));var rimraf=require(_0xe2ca('0x1'));var zipdir=require(_0xe2ca('0x2'));var jsonpatch=require(_0xe2ca('0x3'));var rp=require('request-promise');var moment=require(_0xe2ca('0x4'));var BPromise=require(_0xe2ca('0x5'));var Mustache=require(_0xe2ca('0x6'));var util=require(_0xe2ca('0x7'));var path=require(_0xe2ca('0x8'));var sox=require(_0xe2ca('0x9'));var csv=require(_0xe2ca('0xa'));var ejs=require(_0xe2ca('0xb'));var fs=require('fs');var fs_extra=require(_0xe2ca('0xc'));var _=require(_0xe2ca('0xd'));var squel=require(_0xe2ca('0xe'));var crypto=require('crypto');var jsforce=require(_0xe2ca('0xf'));var deskjs=require(_0xe2ca('0x10'));var toCsv=require(_0xe2ca('0xa'));var querystring=require(_0xe2ca('0x11'));var Papa=require(_0xe2ca('0x12'));var Redis=require(_0xe2ca('0x13'));var authService=require(_0xe2ca('0x14'));var qs=require(_0xe2ca('0x15'));var as=require(_0xe2ca('0x16'));var hardwareService=require(_0xe2ca('0x17'));var logger=require(_0xe2ca('0x18'))(_0xe2ca('0x19'));var utils=require(_0xe2ca('0x1a'));var config=require(_0xe2ca('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2ca('0x1c'))['db'];function respondWithStatusCode(_0x122983,_0x5d6dba){_0x5d6dba=_0x5d6dba||0xcc;return function(_0x50b1fc){if(_0x50b1fc){return _0x122983[_0xe2ca('0x1d')](_0x5d6dba);}return _0x122983[_0xe2ca('0x1e')](_0x5d6dba)[_0xe2ca('0x1f')]();};}function respondWithResult(_0x423613,_0x35e0e5){_0x35e0e5=_0x35e0e5||0xc8;return function(_0x4c52b1){if(_0x4c52b1){return _0x423613['status'](_0x35e0e5)[_0xe2ca('0x20')](_0x4c52b1);}};}function respondWithFilteredResult(_0x2d1500,_0x2a2fe3){return function(_0x2f4264){if(_0x2f4264){var _0x157026=typeof _0x2a2fe3['offset']===_0xe2ca('0x21')&&typeof _0x2a2fe3[_0xe2ca('0x22')]===_0xe2ca('0x21');var _0x22c2e4=_0x2f4264[_0xe2ca('0x23')];var _0x8befb1=_0x157026?0x0:_0x2a2fe3['offset'];var _0x4b9a8d=_0x157026?_0x2f4264['count']:_0x2a2fe3[_0xe2ca('0x24')]+_0x2a2fe3[_0xe2ca('0x22')];var _0x47300b;if(_0x4b9a8d>=_0x22c2e4){_0x4b9a8d=_0x22c2e4;_0x47300b=0xc8;}else{_0x47300b=0xce;}_0x2d1500[_0xe2ca('0x1e')](_0x47300b);return _0x2d1500[_0xe2ca('0x25')](_0xe2ca('0x26'),_0x8befb1+'-'+_0x4b9a8d+'/'+_0x22c2e4)[_0xe2ca('0x20')](_0x2f4264);}return null;};}function patchUpdates(_0x5b488a){return function(_0x1cc32a){try{jsonpatch[_0xe2ca('0x27')](_0x1cc32a,_0x5b488a,!![]);}catch(_0x454065){return BPromise[_0xe2ca('0x28')](_0x454065);}return _0x1cc32a[_0xe2ca('0x29')]();};}function saveUpdates(_0x2bdc49,_0x40dad5){return function(_0x2428e9){if(_0x2428e9){return _0x2428e9['update'](_0x2bdc49)[_0xe2ca('0x2a')](function(_0x56e1d3){return _0x56e1d3;});}return null;};}function removeEntity(_0x217d54,_0x16ddb5){return function(_0x1838ad){if(_0x1838ad){return _0x1838ad['destroy']()[_0xe2ca('0x2a')](function(){_0x217d54['status'](0xcc)[_0xe2ca('0x1f')]();});}};}function handleEntityNotFound(_0x4dcdb1,_0x3a9330){return function(_0x4c2b2f){if(!_0x4c2b2f){_0x4dcdb1[_0xe2ca('0x1d')](0x194);}return _0x4c2b2f;};}function handleError(_0x22f2d4,_0x5bddfa){_0x5bddfa=_0x5bddfa||0x1f4;return function(_0x598ace){logger[_0xe2ca('0x2b')](_0x598ace[_0xe2ca('0x2c')]);if(_0x598ace[_0xe2ca('0x2d')]){delete _0x598ace['name'];}_0x22f2d4['status'](_0x5bddfa)['send'](_0x598ace);};}exports[_0xe2ca('0x2e')]=function(_0x35cd25,_0x3a61af){var _0x13a732={},_0x54375e={},_0x1ef3e7={'count':0x0,'rows':[]};var _0x4dd9ea=_[_0xe2ca('0x2f')](db[_0xe2ca('0x30')]['rawAttributes'],function(_0x5eac58){return{'name':_0x5eac58[_0xe2ca('0x31')],'type':_0x5eac58[_0xe2ca('0x32')]['key']};});_0x54375e[_0xe2ca('0x33')]=_[_0xe2ca('0x2f')](_0x4dd9ea,_0xe2ca('0x2d'));_0x54375e[_0xe2ca('0x34')]=_[_0xe2ca('0x35')](_0x35cd25[_0xe2ca('0x34')]);_0x54375e['filters']=_[_0xe2ca('0x36')](_0x54375e[_0xe2ca('0x33')],_0x54375e[_0xe2ca('0x34')]);_0x13a732[_0xe2ca('0x37')]=_[_0xe2ca('0x36')](_0x54375e[_0xe2ca('0x33')],qs['fields'](_0x35cd25[_0xe2ca('0x34')][_0xe2ca('0x38')]));_0x13a732[_0xe2ca('0x37')]=_0x13a732[_0xe2ca('0x37')][_0xe2ca('0x39')]?_0x13a732[_0xe2ca('0x37')]:_0x54375e[_0xe2ca('0x33')];if(!_0x35cd25[_0xe2ca('0x34')][_0xe2ca('0x3a')](_0xe2ca('0x3b'))){_0x13a732[_0xe2ca('0x22')]=qs[_0xe2ca('0x22')](_0x35cd25[_0xe2ca('0x34')][_0xe2ca('0x22')]);_0x13a732[_0xe2ca('0x24')]=qs[_0xe2ca('0x24')](_0x35cd25[_0xe2ca('0x34')]['offset']);}_0x13a732['order']=qs[_0xe2ca('0x3c')](_0x35cd25[_0xe2ca('0x34')][_0xe2ca('0x3c')]);_0x13a732[_0xe2ca('0x3d')]=qs['filters'](_[_0xe2ca('0x3e')](_0x35cd25[_0xe2ca('0x34')],_0x54375e[_0xe2ca('0x3f')]),_0x4dd9ea);if(_0x35cd25[_0xe2ca('0x34')]['filter']){_0x13a732[_0xe2ca('0x3d')]=_[_0xe2ca('0x40')](_0x13a732[_0xe2ca('0x3d')],{'$or':_[_0xe2ca('0x2f')](_0x4dd9ea,function(_0x1ea44a){if(_0x1ea44a['type']!==_0xe2ca('0x41')){var _0x2fdfa5={};_0x2fdfa5[_0x1ea44a[_0xe2ca('0x2d')]]={'$like':'%'+_0x35cd25['query'][_0xe2ca('0x42')]+'%'};return _0x2fdfa5;}})});}_0x13a732=_[_0xe2ca('0x40')]({},_0x13a732,_0x35cd25[_0xe2ca('0x43')]);var _0x44d6b5={'where':_0x13a732[_0xe2ca('0x3d')]};return db[_0xe2ca('0x30')][_0xe2ca('0x23')](_0x44d6b5)[_0xe2ca('0x2a')](function(_0x3dd75d){_0x1ef3e7[_0xe2ca('0x23')]=_0x3dd75d;if(_0x35cd25[_0xe2ca('0x34')][_0xe2ca('0x44')]){_0x13a732['include']=[{'all':!![]}];}return db[_0xe2ca('0x30')]['findAll'](_0x13a732);})[_0xe2ca('0x2a')](function(_0x586a6f){_0x1ef3e7['rows']=_0x586a6f;return _0x1ef3e7;})[_0xe2ca('0x2a')](respondWithFilteredResult(_0x3a61af,_0x13a732))['catch'](handleError(_0x3a61af,null));};exports[_0xe2ca('0x45')]=function(_0x479182,_0x144705){var _0x38f787={'raw':![],'where':{'id':_0x479182[_0xe2ca('0x46')]['id']}},_0x1f5c3e={};_0x1f5c3e['model']=_[_0xe2ca('0x35')](db[_0xe2ca('0x30')][_0xe2ca('0x47')]);_0x1f5c3e[_0xe2ca('0x34')]=_[_0xe2ca('0x35')](_0x479182[_0xe2ca('0x34')]);_0x1f5c3e[_0xe2ca('0x3f')]=_[_0xe2ca('0x36')](_0x1f5c3e[_0xe2ca('0x33')],_0x1f5c3e[_0xe2ca('0x34')]);_0x38f787[_0xe2ca('0x37')]=_['intersection'](_0x1f5c3e['model'],qs[_0xe2ca('0x38')](_0x479182[_0xe2ca('0x34')][_0xe2ca('0x38')]));_0x38f787['attributes']=_0x38f787[_0xe2ca('0x37')]['length']?_0x38f787['attributes']:_0x1f5c3e['model'];if(_0x479182[_0xe2ca('0x34')][_0xe2ca('0x44')]){_0x38f787['include']=[{'all':!![]}];}_0x38f787=_['merge']({},_0x38f787,_0x479182[_0xe2ca('0x43')]);return db['SugarcrmConfiguration']['find'](_0x38f787)['then'](handleEntityNotFound(_0x144705,null))[_0xe2ca('0x2a')](respondWithResult(_0x144705,null))[_0xe2ca('0x48')](handleError(_0x144705,null));};exports[_0xe2ca('0x49')]=function(_0x23f8d0,_0x4a609a){return db[_0xe2ca('0x30')]['create'](_0x23f8d0[_0xe2ca('0x4a')],{})[_0xe2ca('0x2a')](respondWithResult(_0x4a609a,0xc9))[_0xe2ca('0x48')](handleError(_0x4a609a,null));};exports[_0xe2ca('0x4b')]=function(_0x1356f8,_0x127c42){if(_0x1356f8[_0xe2ca('0x4a')]['id']){delete _0x1356f8[_0xe2ca('0x4a')]['id'];}return db[_0xe2ca('0x30')]['find']({'where':{'id':_0x1356f8[_0xe2ca('0x46')]['id']}})[_0xe2ca('0x2a')](handleEntityNotFound(_0x127c42,null))[_0xe2ca('0x2a')](saveUpdates(_0x1356f8['body'],null))[_0xe2ca('0x2a')](respondWithResult(_0x127c42,null))['catch'](handleError(_0x127c42,null));};exports['destroy']=function(_0x30b475,_0x283145){return db[_0xe2ca('0x30')][_0xe2ca('0x4c')]({'where':{'id':_0x30b475[_0xe2ca('0x46')]['id']}})['then'](handleEntityNotFound(_0x283145,null))['then'](removeEntity(_0x283145,null))[_0xe2ca('0x48')](handleError(_0x283145,null));};exports[_0xe2ca('0x4d')]=function(_0x519e7b,_0x2ef143,_0x2a54ab){var _0x1b2f4e={};var _0x56823a={};var _0x52b2d5;var _0x4f0398;return db[_0xe2ca('0x30')][_0xe2ca('0x4e')]({'where':{'id':_0x519e7b[_0xe2ca('0x46')]['id']}})[_0xe2ca('0x2a')](handleEntityNotFound(_0x2ef143,null))['then'](function(_0x4b42b9){if(_0x4b42b9){_0x52b2d5=_0x4b42b9;_0x56823a[_0xe2ca('0x33')]=_[_0xe2ca('0x35')](db['SugarcrmField'][_0xe2ca('0x47')]);_0x56823a['query']=_['keys'](_0x519e7b['query']);_0x56823a[_0xe2ca('0x3f')]=_[_0xe2ca('0x36')](_0x56823a[_0xe2ca('0x33')],_0x56823a[_0xe2ca('0x34')]);_0x1b2f4e[_0xe2ca('0x37')]=_[_0xe2ca('0x36')](_0x56823a[_0xe2ca('0x33')],qs[_0xe2ca('0x38')](_0x519e7b[_0xe2ca('0x34')][_0xe2ca('0x38')]));_0x1b2f4e[_0xe2ca('0x37')]=_0x1b2f4e[_0xe2ca('0x37')][_0xe2ca('0x39')]?_0x1b2f4e[_0xe2ca('0x37')]:_0x56823a[_0xe2ca('0x33')];_0x1b2f4e['order']=qs['sort'](_0x519e7b[_0xe2ca('0x34')][_0xe2ca('0x3c')]);_0x1b2f4e[_0xe2ca('0x3d')]=qs['filters'](_['pick'](_0x519e7b[_0xe2ca('0x34')],_0x56823a[_0xe2ca('0x3f')]));if(_0x519e7b['query'][_0xe2ca('0x42')]){_0x1b2f4e[_0xe2ca('0x3d')]=_[_0xe2ca('0x40')](_0x1b2f4e['where'],{'$or':_[_0xe2ca('0x2f')](_0x1b2f4e[_0xe2ca('0x37')],function(_0x2b5e30){var _0x2905fb={};_0x2905fb[_0x2b5e30]={'$like':'%'+_0x519e7b[_0xe2ca('0x34')]['filter']+'%'};return _0x2905fb;})});}_0x1b2f4e=_[_0xe2ca('0x40')]({},_0x1b2f4e,_0x519e7b[_0xe2ca('0x43')]);return _0x52b2d5[_0xe2ca('0x4d')](_0x1b2f4e);}})[_0xe2ca('0x2a')](function(_0xb87376){if(_0xb87376){_0x4f0398=_0xb87376[_0xe2ca('0x39')];if(!_0x519e7b[_0xe2ca('0x34')][_0xe2ca('0x3a')]('nolimit')){_0x1b2f4e[_0xe2ca('0x22')]=qs[_0xe2ca('0x22')](_0x519e7b[_0xe2ca('0x34')]['limit']);_0x1b2f4e[_0xe2ca('0x24')]=qs['offset'](_0x519e7b[_0xe2ca('0x34')][_0xe2ca('0x24')]);}return _0x52b2d5[_0xe2ca('0x4d')](_0x1b2f4e);}})[_0xe2ca('0x2a')](function(_0x26eb10){if(_0x26eb10){return _0x26eb10?{'count':_0x4f0398,'rows':_0x26eb10}:null;}})[_0xe2ca('0x2a')](respondWithResult(_0x2ef143,null))[_0xe2ca('0x48')](handleError(_0x2ef143,null));};exports[_0xe2ca('0x4f')]=function(_0x53f6ec,_0x8a85fa,_0x248a27){var _0x246ec3={};var _0x3725a1={};var _0x8d14a9;var _0x463218;return db[_0xe2ca('0x30')][_0xe2ca('0x4e')]({'where':{'id':_0x53f6ec[_0xe2ca('0x46')]['id']}})['then'](handleEntityNotFound(_0x8a85fa,null))[_0xe2ca('0x2a')](function(_0xb47ad5){if(_0xb47ad5){_0x8d14a9=_0xb47ad5;_0x3725a1['model']=_['keys'](db[_0xe2ca('0x50')]['rawAttributes']);_0x3725a1['query']=_['keys'](_0x53f6ec[_0xe2ca('0x34')]);_0x3725a1['filters']=_[_0xe2ca('0x36')](_0x3725a1['model'],_0x3725a1[_0xe2ca('0x34')]);_0x246ec3[_0xe2ca('0x37')]=_[_0xe2ca('0x36')](_0x3725a1[_0xe2ca('0x33')],qs[_0xe2ca('0x38')](_0x53f6ec[_0xe2ca('0x34')][_0xe2ca('0x38')]));_0x246ec3[_0xe2ca('0x37')]=_0x246ec3['attributes'][_0xe2ca('0x39')]?_0x246ec3[_0xe2ca('0x37')]:_0x3725a1[_0xe2ca('0x33')];_0x246ec3[_0xe2ca('0x51')]=qs['sort'](_0x53f6ec[_0xe2ca('0x34')]['sort']);_0x246ec3[_0xe2ca('0x3d')]=qs['filters'](_[_0xe2ca('0x3e')](_0x53f6ec[_0xe2ca('0x34')],_0x3725a1[_0xe2ca('0x3f')]));if(_0x53f6ec[_0xe2ca('0x34')][_0xe2ca('0x42')]){_0x246ec3[_0xe2ca('0x3d')]=_[_0xe2ca('0x40')](_0x246ec3[_0xe2ca('0x3d')],{'$or':_[_0xe2ca('0x2f')](_0x246ec3['attributes'],function(_0x2513b4){var _0xdfc7f1={};_0xdfc7f1[_0x2513b4]={'$like':'%'+_0x53f6ec[_0xe2ca('0x34')][_0xe2ca('0x42')]+'%'};return _0xdfc7f1;})});}_0x246ec3=_['merge']({},_0x246ec3,_0x53f6ec[_0xe2ca('0x43')]);return _0x8d14a9['getSubjects'](_0x246ec3);}})[_0xe2ca('0x2a')](function(_0x281eb9){if(_0x281eb9){_0x463218=_0x281eb9[_0xe2ca('0x39')];if(!_0x53f6ec['query']['hasOwnProperty'](_0xe2ca('0x3b'))){_0x246ec3[_0xe2ca('0x22')]=qs['limit'](_0x53f6ec[_0xe2ca('0x34')][_0xe2ca('0x22')]);_0x246ec3[_0xe2ca('0x24')]=qs['offset'](_0x53f6ec[_0xe2ca('0x34')][_0xe2ca('0x24')]);}return _0x8d14a9[_0xe2ca('0x4f')](_0x246ec3);}})[_0xe2ca('0x2a')](function(_0x3fddb1){if(_0x3fddb1){return _0x3fddb1?{'count':_0x463218,'rows':_0x3fddb1}:null;}})[_0xe2ca('0x2a')](respondWithResult(_0x8a85fa,null))['catch'](handleError(_0x8a85fa,null));};exports['getDescriptions']=function(_0x5d89a2,_0x13a10f,_0x548b86){var _0x494bc5={};var _0x2484a0={};var _0x37c2c8;var _0x5abf52;return db[_0xe2ca('0x30')][_0xe2ca('0x4e')]({'where':{'id':_0x5d89a2[_0xe2ca('0x46')]['id']}})[_0xe2ca('0x2a')](handleEntityNotFound(_0x13a10f,null))[_0xe2ca('0x2a')](function(_0x269679){if(_0x269679){_0x37c2c8=_0x269679;_0x2484a0[_0xe2ca('0x33')]=_[_0xe2ca('0x35')](db['SugarcrmField']['rawAttributes']);_0x2484a0[_0xe2ca('0x34')]=_['keys'](_0x5d89a2[_0xe2ca('0x34')]);_0x2484a0[_0xe2ca('0x3f')]=_[_0xe2ca('0x36')](_0x2484a0['model'],_0x2484a0['query']);_0x494bc5[_0xe2ca('0x37')]=_[_0xe2ca('0x36')](_0x2484a0[_0xe2ca('0x33')],qs['fields'](_0x5d89a2[_0xe2ca('0x34')][_0xe2ca('0x38')]));_0x494bc5[_0xe2ca('0x37')]=_0x494bc5['attributes'][_0xe2ca('0x39')]?_0x494bc5[_0xe2ca('0x37')]:_0x2484a0[_0xe2ca('0x33')];_0x494bc5[_0xe2ca('0x51')]=qs[_0xe2ca('0x3c')](_0x5d89a2[_0xe2ca('0x34')][_0xe2ca('0x3c')]);_0x494bc5[_0xe2ca('0x3d')]=qs[_0xe2ca('0x3f')](_[_0xe2ca('0x3e')](_0x5d89a2['query'],_0x2484a0['filters']));if(_0x5d89a2[_0xe2ca('0x34')][_0xe2ca('0x42')]){_0x494bc5['where']=_['merge'](_0x494bc5[_0xe2ca('0x3d')],{'$or':_[_0xe2ca('0x2f')](_0x494bc5[_0xe2ca('0x37')],function(_0xacbde5){var _0x34a142={};_0x34a142[_0xacbde5]={'$like':'%'+_0x5d89a2[_0xe2ca('0x34')]['filter']+'%'};return _0x34a142;})});}_0x494bc5=_[_0xe2ca('0x40')]({},_0x494bc5,_0x5d89a2[_0xe2ca('0x43')]);return _0x37c2c8[_0xe2ca('0x52')](_0x494bc5);}})[_0xe2ca('0x2a')](function(_0x473fcd){if(_0x473fcd){_0x5abf52=_0x473fcd[_0xe2ca('0x39')];if(!_0x5d89a2['query'][_0xe2ca('0x3a')](_0xe2ca('0x3b'))){_0x494bc5['limit']=qs[_0xe2ca('0x22')](_0x5d89a2[_0xe2ca('0x34')][_0xe2ca('0x22')]);_0x494bc5[_0xe2ca('0x24')]=qs[_0xe2ca('0x24')](_0x5d89a2[_0xe2ca('0x34')][_0xe2ca('0x24')]);}return _0x37c2c8[_0xe2ca('0x52')](_0x494bc5);}})['then'](function(_0x172cf6){if(_0x172cf6){return _0x172cf6?{'count':_0x5abf52,'rows':_0x172cf6}:null;}})[_0xe2ca('0x2a')](respondWithResult(_0x13a10f,null))[_0xe2ca('0x48')](handleError(_0x13a10f,null));}; \ No newline at end of file +var _0x0c50=['show','params','rawAttributes','length','create','body','find','findOne','SugarcrmField','hasOwnProperty','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SugarcrmConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0x0c50,0x1a7));var _0x00c5=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x0c50[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00c5('0x0'));var zipdir=require(_0x00c5('0x1'));var jsonpatch=require(_0x00c5('0x2'));var rp=require(_0x00c5('0x3'));var moment=require(_0x00c5('0x4'));var BPromise=require(_0x00c5('0x5'));var Mustache=require(_0x00c5('0x6'));var util=require('util');var path=require(_0x00c5('0x7'));var sox=require('sox');var csv=require(_0x00c5('0x8'));var ejs=require(_0x00c5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00c5('0xa'));var squel=require(_0x00c5('0xb'));var crypto=require(_0x00c5('0xc'));var jsforce=require(_0x00c5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x00c5('0x8'));var querystring=require('querystring');var Papa=require(_0x00c5('0xe'));var Redis=require(_0x00c5('0xf'));var authService=require(_0x00c5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x00c5('0x11'));var hardwareService=require(_0x00c5('0x12'));var logger=require(_0x00c5('0x13'))('api');var utils=require(_0x00c5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x00c5('0x15'));var db=require(_0x00c5('0x16'))['db'];function respondWithStatusCode(_0x285c15,_0x1f320f){_0x1f320f=_0x1f320f||0xcc;return function(_0xcb9eec){if(_0xcb9eec){return _0x285c15[_0x00c5('0x17')](_0x1f320f);}return _0x285c15[_0x00c5('0x18')](_0x1f320f)[_0x00c5('0x19')]();};}function respondWithResult(_0x1a013b,_0x12f67d){_0x12f67d=_0x12f67d||0xc8;return function(_0x5ecd1d){if(_0x5ecd1d){return _0x1a013b[_0x00c5('0x18')](_0x12f67d)[_0x00c5('0x1a')](_0x5ecd1d);}};}function respondWithFilteredResult(_0x2b58b9,_0x4d1681){return function(_0xd79dc3){if(_0xd79dc3){var _0x28812d=typeof _0x4d1681[_0x00c5('0x1b')]===_0x00c5('0x1c')&&typeof _0x4d1681[_0x00c5('0x1d')]===_0x00c5('0x1c');var _0x2aa0e3=_0xd79dc3['count'];var _0xb46842=_0x28812d?0x0:_0x4d1681[_0x00c5('0x1b')];var _0x2a9180=_0x28812d?_0xd79dc3['count']:_0x4d1681[_0x00c5('0x1b')]+_0x4d1681[_0x00c5('0x1d')];var _0xb7018b;if(_0x2a9180>=_0x2aa0e3){_0x2a9180=_0x2aa0e3;_0xb7018b=0xc8;}else{_0xb7018b=0xce;}_0x2b58b9[_0x00c5('0x18')](_0xb7018b);return _0x2b58b9[_0x00c5('0x1e')](_0x00c5('0x1f'),_0xb46842+'-'+_0x2a9180+'/'+_0x2aa0e3)[_0x00c5('0x1a')](_0xd79dc3);}return null;};}function patchUpdates(_0x926990){return function(_0x53d437){try{jsonpatch[_0x00c5('0x20')](_0x53d437,_0x926990,!![]);}catch(_0x44e7b3){return BPromise[_0x00c5('0x21')](_0x44e7b3);}return _0x53d437[_0x00c5('0x22')]();};}function saveUpdates(_0x20d118,_0x144ebe){return function(_0x5ed659){if(_0x5ed659){return _0x5ed659[_0x00c5('0x23')](_0x20d118)[_0x00c5('0x24')](function(_0x3492be){return _0x3492be;});}return null;};}function removeEntity(_0x54ce5f,_0x2a0264){return function(_0xf97123){if(_0xf97123){return _0xf97123[_0x00c5('0x25')]()['then'](function(){_0x54ce5f['status'](0xcc)[_0x00c5('0x19')]();});}};}function handleEntityNotFound(_0x3c8586,_0x571fae){return function(_0x393794){if(!_0x393794){_0x3c8586[_0x00c5('0x17')](0x194);}return _0x393794;};}function handleError(_0xd5f805,_0x39467f){_0x39467f=_0x39467f||0x1f4;return function(_0x40c82d){logger[_0x00c5('0x26')](_0x40c82d['stack']);if(_0x40c82d[_0x00c5('0x27')]){delete _0x40c82d[_0x00c5('0x27')];}_0xd5f805['status'](_0x39467f)[_0x00c5('0x28')](_0x40c82d);};}exports[_0x00c5('0x29')]=function(_0x4ff486,_0x2cc0a1){var _0x436f76={},_0x5d252b={},_0x4a0c27={'count':0x0,'rows':[]};var _0x18fc3d=_[_0x00c5('0x2a')](db[_0x00c5('0x2b')]['rawAttributes'],function(_0x4a2668){return{'name':_0x4a2668[_0x00c5('0x2c')],'type':_0x4a2668['type'][_0x00c5('0x2d')]};});_0x5d252b[_0x00c5('0x2e')]=_[_0x00c5('0x2a')](_0x18fc3d,_0x00c5('0x27'));_0x5d252b[_0x00c5('0x2f')]=_[_0x00c5('0x30')](_0x4ff486[_0x00c5('0x2f')]);_0x5d252b[_0x00c5('0x31')]=_[_0x00c5('0x32')](_0x5d252b['model'],_0x5d252b[_0x00c5('0x2f')]);_0x436f76[_0x00c5('0x33')]=_['intersection'](_0x5d252b[_0x00c5('0x2e')],qs[_0x00c5('0x34')](_0x4ff486[_0x00c5('0x2f')][_0x00c5('0x34')]));_0x436f76[_0x00c5('0x33')]=_0x436f76['attributes']['length']?_0x436f76[_0x00c5('0x33')]:_0x5d252b[_0x00c5('0x2e')];if(!_0x4ff486[_0x00c5('0x2f')]['hasOwnProperty'](_0x00c5('0x35'))){_0x436f76[_0x00c5('0x1d')]=qs[_0x00c5('0x1d')](_0x4ff486[_0x00c5('0x2f')][_0x00c5('0x1d')]);_0x436f76['offset']=qs['offset'](_0x4ff486[_0x00c5('0x2f')]['offset']);}_0x436f76[_0x00c5('0x36')]=qs[_0x00c5('0x37')](_0x4ff486[_0x00c5('0x2f')][_0x00c5('0x37')]);_0x436f76[_0x00c5('0x38')]=qs[_0x00c5('0x31')](_[_0x00c5('0x39')](_0x4ff486[_0x00c5('0x2f')],_0x5d252b[_0x00c5('0x31')]),_0x18fc3d);if(_0x4ff486[_0x00c5('0x2f')][_0x00c5('0x3a')]){_0x436f76[_0x00c5('0x38')]=_[_0x00c5('0x3b')](_0x436f76[_0x00c5('0x38')],{'$or':_[_0x00c5('0x2a')](_0x18fc3d,function(_0x212454){if(_0x212454[_0x00c5('0x3c')]!==_0x00c5('0x3d')){var _0x3937b2={};_0x3937b2[_0x212454[_0x00c5('0x27')]]={'$like':'%'+_0x4ff486[_0x00c5('0x2f')][_0x00c5('0x3a')]+'%'};return _0x3937b2;}})});}_0x436f76=_[_0x00c5('0x3b')]({},_0x436f76,_0x4ff486[_0x00c5('0x3e')]);var _0x1f95a0={'where':_0x436f76[_0x00c5('0x38')]};return db[_0x00c5('0x2b')][_0x00c5('0x3f')](_0x1f95a0)[_0x00c5('0x24')](function(_0x2fc91e){_0x4a0c27['count']=_0x2fc91e;if(_0x4ff486[_0x00c5('0x2f')][_0x00c5('0x40')]){_0x436f76[_0x00c5('0x41')]=[{'all':!![]}];}return db[_0x00c5('0x2b')][_0x00c5('0x42')](_0x436f76);})[_0x00c5('0x24')](function(_0x3b6023){_0x4a0c27[_0x00c5('0x43')]=_0x3b6023;return _0x4a0c27;})[_0x00c5('0x24')](respondWithFilteredResult(_0x2cc0a1,_0x436f76))[_0x00c5('0x44')](handleError(_0x2cc0a1,null));};exports[_0x00c5('0x45')]=function(_0x15864c,_0x1bece8){var _0x57670d={'raw':![],'where':{'id':_0x15864c[_0x00c5('0x46')]['id']}},_0x5f0e9a={};_0x5f0e9a[_0x00c5('0x2e')]=_[_0x00c5('0x30')](db[_0x00c5('0x2b')][_0x00c5('0x47')]);_0x5f0e9a[_0x00c5('0x2f')]=_['keys'](_0x15864c['query']);_0x5f0e9a[_0x00c5('0x31')]=_[_0x00c5('0x32')](_0x5f0e9a[_0x00c5('0x2e')],_0x5f0e9a[_0x00c5('0x2f')]);_0x57670d[_0x00c5('0x33')]=_[_0x00c5('0x32')](_0x5f0e9a[_0x00c5('0x2e')],qs[_0x00c5('0x34')](_0x15864c[_0x00c5('0x2f')]['fields']));_0x57670d[_0x00c5('0x33')]=_0x57670d[_0x00c5('0x33')][_0x00c5('0x48')]?_0x57670d['attributes']:_0x5f0e9a['model'];if(_0x15864c[_0x00c5('0x2f')]['includeAll']){_0x57670d['include']=[{'all':!![]}];}_0x57670d=_['merge']({},_0x57670d,_0x15864c['options']);return db['SugarcrmConfiguration']['find'](_0x57670d)[_0x00c5('0x24')](handleEntityNotFound(_0x1bece8,null))[_0x00c5('0x24')](respondWithResult(_0x1bece8,null))[_0x00c5('0x44')](handleError(_0x1bece8,null));};exports['create']=function(_0x484919,_0x123b12){return db['SugarcrmConfiguration'][_0x00c5('0x49')](_0x484919['body'],{})[_0x00c5('0x24')](respondWithResult(_0x123b12,0xc9))[_0x00c5('0x44')](handleError(_0x123b12,null));};exports[_0x00c5('0x23')]=function(_0x2259d6,_0x3064eb){if(_0x2259d6[_0x00c5('0x4a')]['id']){delete _0x2259d6[_0x00c5('0x4a')]['id'];}return db[_0x00c5('0x2b')][_0x00c5('0x4b')]({'where':{'id':_0x2259d6[_0x00c5('0x46')]['id']}})[_0x00c5('0x24')](handleEntityNotFound(_0x3064eb,null))[_0x00c5('0x24')](saveUpdates(_0x2259d6[_0x00c5('0x4a')],null))['then'](respondWithResult(_0x3064eb,null))[_0x00c5('0x44')](handleError(_0x3064eb,null));};exports['destroy']=function(_0x507f62,_0x181fec){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x507f62[_0x00c5('0x46')]['id']}})[_0x00c5('0x24')](handleEntityNotFound(_0x181fec,null))[_0x00c5('0x24')](removeEntity(_0x181fec,null))[_0x00c5('0x44')](handleError(_0x181fec,null));};exports['getFields']=function(_0x3bda21,_0x1bf880,_0x3fc510){var _0x71227={};var _0x2f9bca={};var _0x2086c2;var _0x2d9409;return db[_0x00c5('0x2b')][_0x00c5('0x4c')]({'where':{'id':_0x3bda21['params']['id']}})[_0x00c5('0x24')](handleEntityNotFound(_0x1bf880,null))[_0x00c5('0x24')](function(_0x4fca9e){if(_0x4fca9e){_0x2086c2=_0x4fca9e;_0x2f9bca[_0x00c5('0x2e')]=_[_0x00c5('0x30')](db[_0x00c5('0x4d')][_0x00c5('0x47')]);_0x2f9bca['query']=_[_0x00c5('0x30')](_0x3bda21[_0x00c5('0x2f')]);_0x2f9bca[_0x00c5('0x31')]=_[_0x00c5('0x32')](_0x2f9bca['model'],_0x2f9bca[_0x00c5('0x2f')]);_0x71227[_0x00c5('0x33')]=_[_0x00c5('0x32')](_0x2f9bca[_0x00c5('0x2e')],qs['fields'](_0x3bda21[_0x00c5('0x2f')]['fields']));_0x71227[_0x00c5('0x33')]=_0x71227[_0x00c5('0x33')][_0x00c5('0x48')]?_0x71227[_0x00c5('0x33')]:_0x2f9bca[_0x00c5('0x2e')];_0x71227[_0x00c5('0x36')]=qs[_0x00c5('0x37')](_0x3bda21[_0x00c5('0x2f')][_0x00c5('0x37')]);_0x71227[_0x00c5('0x38')]=qs['filters'](_[_0x00c5('0x39')](_0x3bda21[_0x00c5('0x2f')],_0x2f9bca['filters']));if(_0x3bda21['query'][_0x00c5('0x3a')]){_0x71227[_0x00c5('0x38')]=_['merge'](_0x71227[_0x00c5('0x38')],{'$or':_['map'](_0x71227['attributes'],function(_0x5b0d29){var _0xe3c368={};_0xe3c368[_0x5b0d29]={'$like':'%'+_0x3bda21['query'][_0x00c5('0x3a')]+'%'};return _0xe3c368;})});}_0x71227=_[_0x00c5('0x3b')]({},_0x71227,_0x3bda21[_0x00c5('0x3e')]);return _0x2086c2['getFields'](_0x71227);}})[_0x00c5('0x24')](function(_0x2ed1df){if(_0x2ed1df){_0x2d9409=_0x2ed1df['length'];if(!_0x3bda21[_0x00c5('0x2f')][_0x00c5('0x4e')](_0x00c5('0x35'))){_0x71227[_0x00c5('0x1d')]=qs[_0x00c5('0x1d')](_0x3bda21[_0x00c5('0x2f')][_0x00c5('0x1d')]);_0x71227['offset']=qs[_0x00c5('0x1b')](_0x3bda21[_0x00c5('0x2f')][_0x00c5('0x1b')]);}return _0x2086c2[_0x00c5('0x4f')](_0x71227);}})[_0x00c5('0x24')](function(_0x2fc893){if(_0x2fc893){return _0x2fc893?{'count':_0x2d9409,'rows':_0x2fc893}:null;}})['then'](respondWithResult(_0x1bf880,null))[_0x00c5('0x44')](handleError(_0x1bf880,null));};exports['getSubjects']=function(_0x362ea2,_0x2b9fce,_0x411b0b){var _0x5349bb={};var _0x5e574a={};var _0x46a614;var _0x17a7f3;return db[_0x00c5('0x2b')]['findOne']({'where':{'id':_0x362ea2[_0x00c5('0x46')]['id']}})[_0x00c5('0x24')](handleEntityNotFound(_0x2b9fce,null))[_0x00c5('0x24')](function(_0x156302){if(_0x156302){_0x46a614=_0x156302;_0x5e574a[_0x00c5('0x2e')]=_[_0x00c5('0x30')](db[_0x00c5('0x4d')][_0x00c5('0x47')]);_0x5e574a[_0x00c5('0x2f')]=_[_0x00c5('0x30')](_0x362ea2[_0x00c5('0x2f')]);_0x5e574a[_0x00c5('0x31')]=_[_0x00c5('0x32')](_0x5e574a['model'],_0x5e574a[_0x00c5('0x2f')]);_0x5349bb['attributes']=_[_0x00c5('0x32')](_0x5e574a[_0x00c5('0x2e')],qs[_0x00c5('0x34')](_0x362ea2['query']['fields']));_0x5349bb[_0x00c5('0x33')]=_0x5349bb[_0x00c5('0x33')][_0x00c5('0x48')]?_0x5349bb['attributes']:_0x5e574a[_0x00c5('0x2e')];_0x5349bb['order']=qs[_0x00c5('0x37')](_0x362ea2[_0x00c5('0x2f')]['sort']);_0x5349bb[_0x00c5('0x38')]=qs[_0x00c5('0x31')](_['pick'](_0x362ea2[_0x00c5('0x2f')],_0x5e574a[_0x00c5('0x31')]));if(_0x362ea2[_0x00c5('0x2f')][_0x00c5('0x3a')]){_0x5349bb['where']=_[_0x00c5('0x3b')](_0x5349bb[_0x00c5('0x38')],{'$or':_[_0x00c5('0x2a')](_0x5349bb[_0x00c5('0x33')],function(_0x3f4c9e){var _0x3bb6ce={};_0x3bb6ce[_0x3f4c9e]={'$like':'%'+_0x362ea2[_0x00c5('0x2f')]['filter']+'%'};return _0x3bb6ce;})});}_0x5349bb=_[_0x00c5('0x3b')]({},_0x5349bb,_0x362ea2['options']);return _0x46a614[_0x00c5('0x50')](_0x5349bb);}})[_0x00c5('0x24')](function(_0x4180f3){if(_0x4180f3){_0x17a7f3=_0x4180f3[_0x00c5('0x48')];if(!_0x362ea2['query'][_0x00c5('0x4e')](_0x00c5('0x35'))){_0x5349bb[_0x00c5('0x1d')]=qs[_0x00c5('0x1d')](_0x362ea2[_0x00c5('0x2f')][_0x00c5('0x1d')]);_0x5349bb[_0x00c5('0x1b')]=qs['offset'](_0x362ea2['query']['offset']);}return _0x46a614[_0x00c5('0x50')](_0x5349bb);}})[_0x00c5('0x24')](function(_0x38b044){if(_0x38b044){return _0x38b044?{'count':_0x17a7f3,'rows':_0x38b044}:null;}})[_0x00c5('0x24')](respondWithResult(_0x2b9fce,null))['catch'](handleError(_0x2b9fce,null));};exports['getDescriptions']=function(_0x45a26c,_0x4cc528,_0x316cd3){var _0x2a727b={};var _0xb735ff={};var _0x123147;var _0x191e8e;return db['SugarcrmConfiguration'][_0x00c5('0x4c')]({'where':{'id':_0x45a26c[_0x00c5('0x46')]['id']}})[_0x00c5('0x24')](handleEntityNotFound(_0x4cc528,null))[_0x00c5('0x24')](function(_0x30aa14){if(_0x30aa14){_0x123147=_0x30aa14;_0xb735ff[_0x00c5('0x2e')]=_[_0x00c5('0x30')](db[_0x00c5('0x4d')][_0x00c5('0x47')]);_0xb735ff[_0x00c5('0x2f')]=_['keys'](_0x45a26c[_0x00c5('0x2f')]);_0xb735ff[_0x00c5('0x31')]=_[_0x00c5('0x32')](_0xb735ff[_0x00c5('0x2e')],_0xb735ff['query']);_0x2a727b[_0x00c5('0x33')]=_[_0x00c5('0x32')](_0xb735ff[_0x00c5('0x2e')],qs['fields'](_0x45a26c[_0x00c5('0x2f')][_0x00c5('0x34')]));_0x2a727b[_0x00c5('0x33')]=_0x2a727b[_0x00c5('0x33')][_0x00c5('0x48')]?_0x2a727b[_0x00c5('0x33')]:_0xb735ff[_0x00c5('0x2e')];_0x2a727b[_0x00c5('0x36')]=qs[_0x00c5('0x37')](_0x45a26c['query'][_0x00c5('0x37')]);_0x2a727b[_0x00c5('0x38')]=qs[_0x00c5('0x31')](_[_0x00c5('0x39')](_0x45a26c[_0x00c5('0x2f')],_0xb735ff[_0x00c5('0x31')]));if(_0x45a26c['query']['filter']){_0x2a727b[_0x00c5('0x38')]=_['merge'](_0x2a727b[_0x00c5('0x38')],{'$or':_[_0x00c5('0x2a')](_0x2a727b[_0x00c5('0x33')],function(_0x336e0a){var _0x4b00dd={};_0x4b00dd[_0x336e0a]={'$like':'%'+_0x45a26c[_0x00c5('0x2f')]['filter']+'%'};return _0x4b00dd;})});}_0x2a727b=_['merge']({},_0x2a727b,_0x45a26c[_0x00c5('0x3e')]);return _0x123147[_0x00c5('0x51')](_0x2a727b);}})[_0x00c5('0x24')](function(_0x4c048c){if(_0x4c048c){_0x191e8e=_0x4c048c[_0x00c5('0x48')];if(!_0x45a26c[_0x00c5('0x2f')][_0x00c5('0x4e')]('nolimit')){_0x2a727b['limit']=qs[_0x00c5('0x1d')](_0x45a26c[_0x00c5('0x2f')]['limit']);_0x2a727b[_0x00c5('0x1b')]=qs[_0x00c5('0x1b')](_0x45a26c[_0x00c5('0x2f')][_0x00c5('0x1b')]);}return _0x123147[_0x00c5('0x51')](_0x2a727b);}})[_0x00c5('0x24')](function(_0x974b76){if(_0x974b76){return _0x974b76?{'count':_0x191e8e,'rows':_0x974b76}:null;}})['then'](respondWithResult(_0x4cc528,null))[_0x00c5('0x44')](handleError(_0x4cc528,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index edb2a52..dd2849a 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 _0x06d2=['request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','int_sugarcrm_configurations','util','moment','bluebird'];(function(_0x41c45f,_0x15f570){var _0x2731f3=function(_0x25ef12){while(--_0x25ef12){_0x41c45f['push'](_0x41c45f['shift']());}};_0x2731f3(++_0x15f570);}(_0x06d2,0x138));var _0x206d=function(_0x3fe6f4,_0x221e39){_0x3fe6f4=_0x3fe6f4-0x0;var _0x330489=_0x06d2[_0x3fe6f4];return _0x330489;};'use strict';var _=require('lodash');var util=require(_0x206d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x206d('0x1'));var BPromise=require(_0x206d('0x2'));var rp=require(_0x206d('0x3'));var fs=require('fs');var path=require(_0x206d('0x4'));var rimraf=require(_0x206d('0x5'));var config=require('../../config/environment');var attributes=require(_0x206d('0x6'));module[_0x206d('0x7')]=function(_0x3f9711,_0x310172){return _0x3f9711['define']('SugarcrmConfiguration',attributes,{'tableName':_0x206d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa37a=['lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x160cd7,_0x315362){var _0x4c34f2=function(_0x55c3c6){while(--_0x55c3c6){_0x160cd7['push'](_0x160cd7['shift']());}};_0x4c34f2(++_0x315362);}(_0xa37a,0x108));var _0xaa37=function(_0x380144,_0x19e06d){_0x380144=_0x380144-0x0;var _0x18e207=_0xa37a[_0x380144];return _0x18e207;};'use strict';var _=require(_0xaa37('0x0'));var util=require('util');var logger=require(_0xaa37('0x1'))('api');var moment=require(_0xaa37('0x2'));var BPromise=require(_0xaa37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa37('0x4'));var rimraf=require(_0xaa37('0x5'));var config=require(_0xaa37('0x6'));var attributes=require(_0xaa37('0x7'));module[_0xaa37('0x8')]=function(_0x20b5d1,_0x246766){return _0x20b5d1[_0xaa37('0x9')](_0xaa37('0xa'),attributes,{'tableName':_0xaa37('0xb'),'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 24e92f2..217dab8 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 _0xbca8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4e3ccd,_0x337c0a){var _0x3048e0=function(_0x565eca){while(--_0x565eca){_0x4e3ccd['push'](_0x4e3ccd['shift']());}};_0x3048e0(++_0x337c0a);}(_0xbca8,0xaa));var _0x8bca=function(_0x42a1bb,_0x28989f){_0x42a1bb=_0x42a1bb-0x0;var _0x2f41e6=_0xbca8[_0x42a1bb];return _0x2f41e6;};'use strict';var _=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var moment=require(_0x8bca('0x2'));var BPromise=require(_0x8bca('0x3'));var rs=require(_0x8bca('0x4'));var fs=require('fs');var Redis=require(_0x8bca('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8bca('0x6'))(_0x8bca('0x7'));var config=require(_0x8bca('0x8'));var jayson=require(_0x8bca('0x9'));var client=jayson[_0x8bca('0xa')][_0x8bca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x74dc84,_0x173cb9,_0x36b475){return new BPromise(function(_0x317b0d,_0x2f08b1){return client['request'](_0x74dc84,_0x36b475)[_0x8bca('0xc')](function(_0xd10cc1){logger['info'](_0x8bca('0xd'),_0x173cb9,_0x8bca('0xe'));logger[_0x8bca('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x173cb9,_0x8bca('0xe'),JSON[_0x8bca('0x10')](_0xd10cc1));if(_0xd10cc1[_0x8bca('0x11')]){if(_0xd10cc1[_0x8bca('0x11')]['code']===0x1f4){logger['error'](_0x8bca('0xd'),_0x173cb9,_0xd10cc1[_0x8bca('0x11')]['message']);return _0x2f08b1(_0xd10cc1[_0x8bca('0x11')][_0x8bca('0x12')]);}logger[_0x8bca('0x11')](_0x8bca('0xd'),_0x173cb9,_0xd10cc1[_0x8bca('0x11')][_0x8bca('0x12')]);return _0x317b0d(_0xd10cc1[_0x8bca('0x11')][_0x8bca('0x12')]);}else{logger[_0x8bca('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x173cb9,'request\x20sent');_0x317b0d(_0xd10cc1[_0x8bca('0x14')][_0x8bca('0x12')]);}})[_0x8bca('0x15')](function(_0x591773){logger[_0x8bca('0x11')](_0x8bca('0xd'),_0x173cb9,_0x591773);_0x2f08b1(_0x591773);});});} \ No newline at end of file +var _0x35c6=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x4c1338,_0x1f2b01){var _0x16c5db=function(_0x19dab6){while(--_0x19dab6){_0x4c1338['push'](_0x4c1338['shift']());}};_0x16c5db(++_0x1f2b01);}(_0x35c6,0xda));var _0x635c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x35c6[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x635c('0x0'));var util=require(_0x635c('0x1'));var moment=require(_0x635c('0x2'));var BPromise=require(_0x635c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x635c('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x635c('0x5'));var client=jayson[_0x635c('0x6')][_0x635c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2775,_0xb70b01,_0x1dd87c){return new BPromise(function(_0x4a4e7f,_0x2aaf3c){return client[_0x635c('0x8')](_0x5e2775,_0x1dd87c)[_0x635c('0x9')](function(_0xf62f03){logger[_0x635c('0xa')](_0x635c('0xb'),_0xb70b01,_0x635c('0xc'));logger[_0x635c('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xb70b01,_0x635c('0xc'),JSON[_0x635c('0xe')](_0xf62f03));if(_0xf62f03[_0x635c('0xf')]){if(_0xf62f03['error'][_0x635c('0x10')]===0x1f4){logger[_0x635c('0xf')](_0x635c('0xb'),_0xb70b01,_0xf62f03[_0x635c('0xf')]['message']);return _0x2aaf3c(_0xf62f03[_0x635c('0xf')]['message']);}logger[_0x635c('0xf')](_0x635c('0xb'),_0xb70b01,_0xf62f03[_0x635c('0xf')]['message']);return _0x4a4e7f(_0xf62f03[_0x635c('0xf')][_0x635c('0x11')]);}else{logger[_0x635c('0xa')](_0x635c('0xb'),_0xb70b01,'request\x20sent');_0x4a4e7f(_0xf62f03[_0x635c('0x12')][_0x635c('0x11')]);}})['catch'](function(_0x9e2562){logger[_0x635c('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xb70b01,_0x9e2562);_0x2aaf3c(_0x9e2562);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 49ac2b4..18266d0 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 _0x51eb=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','put','update','delete','/:id','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51eb,0xac));var _0xb51e=function(_0xc929a6,_0x4adc9e){_0xc929a6=_0xc929a6-0x0;var _0x2f8b1e=_0x51eb[_0xc929a6];return _0x2f8b1e;};'use strict';var multer=require('multer');var util=require(_0xb51e('0x0'));var path=require(_0xb51e('0x1'));var timeout=require(_0xb51e('0x2'));var express=require('express');var router=express[_0xb51e('0x3')]();var fs_extra=require(_0xb51e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb51e('0x5'));var config=require(_0xb51e('0x6'));var controller=require(_0xb51e('0x7'));router[_0xb51e('0x8')]('/',auth[_0xb51e('0x9')](),controller[_0xb51e('0xa')]);router[_0xb51e('0x8')]('/:id',auth[_0xb51e('0x9')](),controller[_0xb51e('0xb')]);router[_0xb51e('0xc')]('/',auth[_0xb51e('0x9')](),controller['create']);router[_0xb51e('0xd')]('/:id',auth[_0xb51e('0x9')](),controller[_0xb51e('0xe')]);router[_0xb51e('0xf')](_0xb51e('0x10'),auth[_0xb51e('0x9')](),controller[_0xb51e('0x11')]);module[_0xb51e('0x12')]=router; \ No newline at end of file +var _0x67e6=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x1cc961,_0x2c42ee){var _0x471d86=function(_0x44e422){while(--_0x44e422){_0x1cc961['push'](_0x1cc961['shift']());}};_0x471d86(++_0x2c42ee);}(_0x67e6,0xab));var _0x667e=function(_0x102d2b,_0x1d61d6){_0x102d2b=_0x102d2b-0x0;var _0x2bc573=_0x67e6[_0x102d2b];return _0x2bc573;};'use strict';var multer=require(_0x667e('0x0'));var util=require(_0x667e('0x1'));var path=require(_0x667e('0x2'));var timeout=require(_0x667e('0x3'));var express=require(_0x667e('0x4'));var router=express[_0x667e('0x5')]();var fs_extra=require(_0x667e('0x6'));var auth=require(_0x667e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x667e('0x8'));var controller=require(_0x667e('0x9'));router['get']('/',auth[_0x667e('0xa')](),controller[_0x667e('0xb')]);router[_0x667e('0xc')](_0x667e('0xd'),auth[_0x667e('0xa')](),controller[_0x667e('0xe')]);router[_0x667e('0xf')]('/',auth['isAuthenticated'](),controller[_0x667e('0x10')]);router[_0x667e('0x11')](_0x667e('0xd'),auth[_0x667e('0xa')](),controller['update']);router[_0x667e('0x12')](_0x667e('0xd'),auth[_0x667e('0xa')](),controller[_0x667e('0x13')]);module[_0x667e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 71b88c6..1c22c3e 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 _0xa8a8=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x181a3d,_0x5b9211){var _0x1c8483=function(_0x4c4175){while(--_0x4c4175){_0x181a3d['push'](_0x181a3d['shift']());}};_0x1c8483(++_0x5b9211);}(_0xa8a8,0x177));var _0x8a8a=function(_0x467b5e,_0xbe174d){_0x467b5e=_0x467b5e-0x0;var _0x10e5fd=_0xa8a8[_0x467b5e];return _0x10e5fd;};'use strict';var Sequelize=require(_0x8a8a('0x0'));module[_0x8a8a('0x1')]={'type':{'type':Sequelize[_0x8a8a('0x2')](_0x8a8a('0x3'),_0x8a8a('0x4'),_0x8a8a('0x5'),_0x8a8a('0x6'),_0x8a8a('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8a8a('0x8')]},'key':{'type':Sequelize[_0x8a8a('0x8')]},'keyType':{'type':Sequelize[_0x8a8a('0x2')](_0x8a8a('0x3'),_0x8a8a('0x4'),_0x8a8a('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8a8a('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a8a('0x8')]}}; \ No newline at end of file +var _0x47b5=['ENUM','picklist','string','STRING','variable','customVariable','BOOLEAN','sequelize'];(function(_0x13ba2b,_0x5702b6){var _0x33a36d=function(_0xe1f5bc){while(--_0xe1f5bc){_0x13ba2b['push'](_0x13ba2b['shift']());}};_0x33a36d(++_0x5702b6);}(_0x47b5,0x13f));var _0x547b=function(_0x3c1730,_0x430d55){_0x3c1730=_0x3c1730-0x0;var _0xa81530=_0x47b5[_0x3c1730];return _0xa81530;};'use strict';var Sequelize=require(_0x547b('0x0'));module['exports']={'type':{'type':Sequelize[_0x547b('0x1')]('string','variable','customVariable','keyValue',_0x547b('0x2')),'defaultValue':_0x547b('0x3')},'content':{'type':Sequelize[_0x547b('0x4')]},'key':{'type':Sequelize[_0x547b('0x4')]},'keyType':{'type':Sequelize[_0x547b('0x1')]('string',_0x547b('0x5'),_0x547b('0x6'))},'keyContent':{'type':Sequelize[_0x547b('0x4')]},'idField':{'type':Sequelize[_0x547b('0x4')]},'nameField':{'type':Sequelize[_0x547b('0x4')]},'customField':{'type':Sequelize[_0x547b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x547b('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 69bdd05..eb9cb33 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 _0xb522=['reject','then','end','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','include','rows','catch','params','includeAll','find','create','body','update','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','apply'];(function(_0x5962b4,_0x84be73){var _0xe6443c=function(_0x2b37d4){while(--_0x2b37d4){_0x5962b4['push'](_0x5962b4['shift']());}};_0xe6443c(++_0x84be73);}(_0xb522,0x154));var _0x2b52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb522[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2b52('0x0'));var rimraf=require(_0x2b52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b52('0x2'));var rp=require(_0x2b52('0x3'));var moment=require(_0x2b52('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2b52('0x5'));var path=require(_0x2b52('0x6'));var sox=require(_0x2b52('0x7'));var csv=require('to-csv');var ejs=require(_0x2b52('0x8'));var fs=require('fs');var fs_extra=require(_0x2b52('0x9'));var _=require(_0x2b52('0xa'));var squel=require(_0x2b52('0xb'));var crypto=require(_0x2b52('0xc'));var jsforce=require(_0x2b52('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2b52('0xe'));var querystring=require(_0x2b52('0xf'));var Papa=require(_0x2b52('0x10'));var Redis=require(_0x2b52('0x11'));var authService=require(_0x2b52('0x12'));var qs=require(_0x2b52('0x13'));var as=require(_0x2b52('0x14'));var hardwareService=require(_0x2b52('0x15'));var logger=require(_0x2b52('0x16'))(_0x2b52('0x17'));var utils=require('../../config/utils');var config=require(_0x2b52('0x18'));var licenseUtil=require(_0x2b52('0x19'));var db=require(_0x2b52('0x1a'))['db'];function respondWithStatusCode(_0x58e4f6,_0x799cde){_0x799cde=_0x799cde||0xcc;return function(_0x1f0c98){if(_0x1f0c98){return _0x58e4f6[_0x2b52('0x1b')](_0x799cde);}return _0x58e4f6[_0x2b52('0x1c')](_0x799cde)['end']();};}function respondWithResult(_0x66850c,_0x2a639f){_0x2a639f=_0x2a639f||0xc8;return function(_0x2479ab){if(_0x2479ab){return _0x66850c[_0x2b52('0x1c')](_0x2a639f)[_0x2b52('0x1d')](_0x2479ab);}};}function respondWithFilteredResult(_0x1d96d7,_0x42254b){return function(_0x2c35e5){if(_0x2c35e5){var _0xcd2168=typeof _0x42254b[_0x2b52('0x1e')]==='undefined'&&typeof _0x42254b[_0x2b52('0x1f')]===_0x2b52('0x20');var _0x4d059b=_0x2c35e5[_0x2b52('0x21')];var _0x28f246=_0xcd2168?0x0:_0x42254b[_0x2b52('0x1e')];var _0x2e5c48=_0xcd2168?_0x2c35e5[_0x2b52('0x21')]:_0x42254b[_0x2b52('0x1e')]+_0x42254b[_0x2b52('0x1f')];var _0x2e75b4;if(_0x2e5c48>=_0x4d059b){_0x2e5c48=_0x4d059b;_0x2e75b4=0xc8;}else{_0x2e75b4=0xce;}_0x1d96d7[_0x2b52('0x1c')](_0x2e75b4);return _0x1d96d7['set']('Content-Range',_0x28f246+'-'+_0x2e5c48+'/'+_0x4d059b)['json'](_0x2c35e5);}return null;};}function patchUpdates(_0x15a15d){return function(_0x50c803){try{jsonpatch[_0x2b52('0x22')](_0x50c803,_0x15a15d,!![]);}catch(_0x19dc1b){return BPromise[_0x2b52('0x23')](_0x19dc1b);}return _0x50c803['save']();};}function saveUpdates(_0x58cc6f,_0x3e3e32){return function(_0x33ffa1){if(_0x33ffa1){return _0x33ffa1['update'](_0x58cc6f)[_0x2b52('0x24')](function(_0x4039d4){return _0x4039d4;});}return null;};}function removeEntity(_0x3c8d5a,_0x41dd94){return function(_0x15ebb2){if(_0x15ebb2){return _0x15ebb2['destroy']()[_0x2b52('0x24')](function(){_0x3c8d5a[_0x2b52('0x1c')](0xcc)[_0x2b52('0x25')]();});}};}function handleEntityNotFound(_0x8baa3d,_0x9a2dbb){return function(_0x3072f9){if(!_0x3072f9){_0x8baa3d['sendStatus'](0x194);}return _0x3072f9;};}function handleError(_0x4b59d8,_0x166173){_0x166173=_0x166173||0x1f4;return function(_0x179798){logger[_0x2b52('0x26')](_0x179798[_0x2b52('0x27')]);if(_0x179798[_0x2b52('0x28')]){delete _0x179798[_0x2b52('0x28')];}_0x4b59d8['status'](_0x166173)[_0x2b52('0x29')](_0x179798);};}exports[_0x2b52('0x2a')]=function(_0x2aa190,_0x5d9072){var _0x5cca74={},_0x40405a={},_0x197bdc={'count':0x0,'rows':[]};var _0x170cdc=_['map'](db[_0x2b52('0x2b')][_0x2b52('0x2c')],function(_0x8e2317){return{'name':_0x8e2317[_0x2b52('0x2d')],'type':_0x8e2317[_0x2b52('0x2e')][_0x2b52('0x2f')]};});_0x40405a['model']=_[_0x2b52('0x30')](_0x170cdc,_0x2b52('0x28'));_0x40405a['query']=_[_0x2b52('0x31')](_0x2aa190[_0x2b52('0x32')]);_0x40405a['filters']=_[_0x2b52('0x33')](_0x40405a[_0x2b52('0x34')],_0x40405a[_0x2b52('0x32')]);_0x5cca74[_0x2b52('0x35')]=_['intersection'](_0x40405a[_0x2b52('0x34')],qs['fields'](_0x2aa190[_0x2b52('0x32')][_0x2b52('0x36')]));_0x5cca74[_0x2b52('0x35')]=_0x5cca74[_0x2b52('0x35')][_0x2b52('0x37')]?_0x5cca74[_0x2b52('0x35')]:_0x40405a[_0x2b52('0x34')];if(!_0x2aa190[_0x2b52('0x32')][_0x2b52('0x38')](_0x2b52('0x39'))){_0x5cca74[_0x2b52('0x1f')]=qs[_0x2b52('0x1f')](_0x2aa190[_0x2b52('0x32')][_0x2b52('0x1f')]);_0x5cca74['offset']=qs['offset'](_0x2aa190['query']['offset']);}_0x5cca74['order']=qs[_0x2b52('0x3a')](_0x2aa190[_0x2b52('0x32')][_0x2b52('0x3a')]);_0x5cca74[_0x2b52('0x3b')]=qs['filters'](_[_0x2b52('0x3c')](_0x2aa190[_0x2b52('0x32')],_0x40405a[_0x2b52('0x3d')]),_0x170cdc);if(_0x2aa190[_0x2b52('0x32')][_0x2b52('0x3e')]){_0x5cca74[_0x2b52('0x3b')]=_[_0x2b52('0x3f')](_0x5cca74[_0x2b52('0x3b')],{'$or':_[_0x2b52('0x30')](_0x170cdc,function(_0x3a88f4){if(_0x3a88f4[_0x2b52('0x2e')]!=='VIRTUAL'){var _0x22aa2a={};_0x22aa2a[_0x3a88f4[_0x2b52('0x28')]]={'$like':'%'+_0x2aa190[_0x2b52('0x32')][_0x2b52('0x3e')]+'%'};return _0x22aa2a;}})});}_0x5cca74=_[_0x2b52('0x3f')]({},_0x5cca74,_0x2aa190[_0x2b52('0x40')]);var _0x17c8c1={'where':_0x5cca74[_0x2b52('0x3b')]};return db[_0x2b52('0x2b')][_0x2b52('0x21')](_0x17c8c1)[_0x2b52('0x24')](function(_0x11a1b2){_0x197bdc[_0x2b52('0x21')]=_0x11a1b2;if(_0x2aa190[_0x2b52('0x32')]['includeAll']){_0x5cca74[_0x2b52('0x41')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x5cca74);})[_0x2b52('0x24')](function(_0x14a5e2){_0x197bdc[_0x2b52('0x42')]=_0x14a5e2;return _0x197bdc;})[_0x2b52('0x24')](respondWithFilteredResult(_0x5d9072,_0x5cca74))[_0x2b52('0x43')](handleError(_0x5d9072,null));};exports['show']=function(_0x47a46b,_0x302810){var _0x498efa={'raw':!![],'where':{'id':_0x47a46b[_0x2b52('0x44')]['id']}},_0x167f93={};_0x167f93[_0x2b52('0x34')]=_['keys'](db[_0x2b52('0x2b')][_0x2b52('0x2c')]);_0x167f93[_0x2b52('0x32')]=_[_0x2b52('0x31')](_0x47a46b[_0x2b52('0x32')]);_0x167f93[_0x2b52('0x3d')]=_[_0x2b52('0x33')](_0x167f93[_0x2b52('0x34')],_0x167f93[_0x2b52('0x32')]);_0x498efa['attributes']=_[_0x2b52('0x33')](_0x167f93['model'],qs[_0x2b52('0x36')](_0x47a46b[_0x2b52('0x32')][_0x2b52('0x36')]));_0x498efa[_0x2b52('0x35')]=_0x498efa['attributes'][_0x2b52('0x37')]?_0x498efa['attributes']:_0x167f93[_0x2b52('0x34')];if(_0x47a46b[_0x2b52('0x32')][_0x2b52('0x45')]){_0x498efa[_0x2b52('0x41')]=[{'all':!![]}];}_0x498efa=_[_0x2b52('0x3f')]({},_0x498efa,_0x47a46b[_0x2b52('0x40')]);return db[_0x2b52('0x2b')][_0x2b52('0x46')](_0x498efa)[_0x2b52('0x24')](handleEntityNotFound(_0x302810,null))['then'](respondWithResult(_0x302810,null))[_0x2b52('0x43')](handleError(_0x302810,null));};exports[_0x2b52('0x47')]=function(_0x57a331,_0x1be28d){return db[_0x2b52('0x2b')][_0x2b52('0x47')](_0x57a331[_0x2b52('0x48')],{})[_0x2b52('0x24')](respondWithResult(_0x1be28d,0xc9))[_0x2b52('0x43')](handleError(_0x1be28d,null));};exports[_0x2b52('0x49')]=function(_0x74f147,_0x5bc9fb){if(_0x74f147['body']['id']){delete _0x74f147['body']['id'];}return db[_0x2b52('0x2b')][_0x2b52('0x46')]({'where':{'id':_0x74f147[_0x2b52('0x44')]['id']}})[_0x2b52('0x24')](handleEntityNotFound(_0x5bc9fb,null))[_0x2b52('0x24')](saveUpdates(_0x74f147[_0x2b52('0x48')],null))[_0x2b52('0x24')](respondWithResult(_0x5bc9fb,null))['catch'](handleError(_0x5bc9fb,null));};exports[_0x2b52('0x4a')]=function(_0x4342b4,_0x562ed3){return db[_0x2b52('0x2b')][_0x2b52('0x46')]({'where':{'id':_0x4342b4['params']['id']}})[_0x2b52('0x24')](handleEntityNotFound(_0x562ed3,null))[_0x2b52('0x24')](removeEntity(_0x562ed3,null))[_0x2b52('0x43')](handleError(_0x562ed3,null));}; \ No newline at end of file +var _0x082a=['save','update','then','destroy','stack','name','map','SugarcrmField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','length','options','catch','create','body','params','find','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x082a,0x65));var _0xa082=function(_0x457b1c,_0x587a7a){_0x457b1c=_0x457b1c-0x0;var _0xebd2cd=_0x082a[_0x457b1c];return _0xebd2cd;};'use strict';var emlformat=require(_0xa082('0x0'));var rimraf=require(_0xa082('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa082('0x2'));var moment=require('moment');var BPromise=require(_0xa082('0x3'));var Mustache=require(_0xa082('0x4'));var util=require('util');var path=require(_0xa082('0x5'));var sox=require(_0xa082('0x6'));var csv=require(_0xa082('0x7'));var ejs=require(_0xa082('0x8'));var fs=require('fs');var fs_extra=require(_0xa082('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa082('0xa'));var jsforce=require(_0xa082('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa082('0x7'));var querystring=require(_0xa082('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa082('0xd'));var as=require(_0xa082('0xe'));var hardwareService=require(_0xa082('0xf'));var logger=require('../../config/logger')(_0xa082('0x10'));var utils=require('../../config/utils');var config=require(_0xa082('0x11'));var licenseUtil=require(_0xa082('0x12'));var db=require(_0xa082('0x13'))['db'];function respondWithStatusCode(_0x489f50,_0x28752b){_0x28752b=_0x28752b||0xcc;return function(_0x36160b){if(_0x36160b){return _0x489f50[_0xa082('0x14')](_0x28752b);}return _0x489f50[_0xa082('0x15')](_0x28752b)['end']();};}function respondWithResult(_0xf62cd7,_0x55149c){_0x55149c=_0x55149c||0xc8;return function(_0x1032ec){if(_0x1032ec){return _0xf62cd7[_0xa082('0x15')](_0x55149c)[_0xa082('0x16')](_0x1032ec);}};}function respondWithFilteredResult(_0x5a5703,_0x5b7d0e){return function(_0x429753){if(_0x429753){var _0x1bf219=typeof _0x5b7d0e[_0xa082('0x17')]==='undefined'&&typeof _0x5b7d0e[_0xa082('0x18')]==='undefined';var _0x11b57f=_0x429753['count'];var _0x149f97=_0x1bf219?0x0:_0x5b7d0e[_0xa082('0x17')];var _0x10966a=_0x1bf219?_0x429753[_0xa082('0x19')]:_0x5b7d0e['offset']+_0x5b7d0e[_0xa082('0x18')];var _0x25cd2c;if(_0x10966a>=_0x11b57f){_0x10966a=_0x11b57f;_0x25cd2c=0xc8;}else{_0x25cd2c=0xce;}_0x5a5703[_0xa082('0x15')](_0x25cd2c);return _0x5a5703[_0xa082('0x1a')](_0xa082('0x1b'),_0x149f97+'-'+_0x10966a+'/'+_0x11b57f)[_0xa082('0x16')](_0x429753);}return null;};}function patchUpdates(_0x2fd330){return function(_0xdbbc2b){try{jsonpatch['apply'](_0xdbbc2b,_0x2fd330,!![]);}catch(_0x4b7ead){return BPromise[_0xa082('0x1c')](_0x4b7ead);}return _0xdbbc2b[_0xa082('0x1d')]();};}function saveUpdates(_0x5b651b,_0x102587){return function(_0x5bb266){if(_0x5bb266){return _0x5bb266[_0xa082('0x1e')](_0x5b651b)[_0xa082('0x1f')](function(_0x5e9b10){return _0x5e9b10;});}return null;};}function removeEntity(_0x5d897e,_0x503482){return function(_0x533ee0){if(_0x533ee0){return _0x533ee0[_0xa082('0x20')]()[_0xa082('0x1f')](function(){_0x5d897e[_0xa082('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5830e4,_0x59ee47){return function(_0x68fbe){if(!_0x68fbe){_0x5830e4['sendStatus'](0x194);}return _0x68fbe;};}function handleError(_0x489b83,_0xd6c47b){_0xd6c47b=_0xd6c47b||0x1f4;return function(_0x20eac6){logger['error'](_0x20eac6[_0xa082('0x21')]);if(_0x20eac6[_0xa082('0x22')]){delete _0x20eac6[_0xa082('0x22')];}_0x489b83[_0xa082('0x15')](_0xd6c47b)['send'](_0x20eac6);};}exports['index']=function(_0xb235fa,_0x50b02b){var _0x3da8bf={},_0x5d6b32={},_0x37fdc4={'count':0x0,'rows':[]};var _0x1f4b25=_[_0xa082('0x23')](db[_0xa082('0x24')][_0xa082('0x25')],function(_0x55855d){return{'name':_0x55855d[_0xa082('0x26')],'type':_0x55855d[_0xa082('0x27')][_0xa082('0x28')]};});_0x5d6b32[_0xa082('0x29')]=_[_0xa082('0x23')](_0x1f4b25,_0xa082('0x22'));_0x5d6b32['query']=_[_0xa082('0x2a')](_0xb235fa[_0xa082('0x2b')]);_0x5d6b32[_0xa082('0x2c')]=_[_0xa082('0x2d')](_0x5d6b32[_0xa082('0x29')],_0x5d6b32[_0xa082('0x2b')]);_0x3da8bf['attributes']=_[_0xa082('0x2d')](_0x5d6b32['model'],qs[_0xa082('0x2e')](_0xb235fa[_0xa082('0x2b')]['fields']));_0x3da8bf['attributes']=_0x3da8bf[_0xa082('0x2f')]['length']?_0x3da8bf['attributes']:_0x5d6b32[_0xa082('0x29')];if(!_0xb235fa[_0xa082('0x2b')][_0xa082('0x30')]('nolimit')){_0x3da8bf[_0xa082('0x18')]=qs[_0xa082('0x18')](_0xb235fa[_0xa082('0x2b')][_0xa082('0x18')]);_0x3da8bf[_0xa082('0x17')]=qs['offset'](_0xb235fa['query'][_0xa082('0x17')]);}_0x3da8bf['order']=qs[_0xa082('0x31')](_0xb235fa[_0xa082('0x2b')]['sort']);_0x3da8bf[_0xa082('0x32')]=qs[_0xa082('0x2c')](_[_0xa082('0x33')](_0xb235fa[_0xa082('0x2b')],_0x5d6b32['filters']),_0x1f4b25);if(_0xb235fa[_0xa082('0x2b')][_0xa082('0x34')]){_0x3da8bf[_0xa082('0x32')]=_[_0xa082('0x35')](_0x3da8bf[_0xa082('0x32')],{'$or':_['map'](_0x1f4b25,function(_0x2a695e){if(_0x2a695e['type']!==_0xa082('0x36')){var _0x3bf751={};_0x3bf751[_0x2a695e[_0xa082('0x22')]]={'$like':'%'+_0xb235fa['query'][_0xa082('0x34')]+'%'};return _0x3bf751;}})});}_0x3da8bf=_[_0xa082('0x35')]({},_0x3da8bf,_0xb235fa['options']);var _0x5df14e={'where':_0x3da8bf[_0xa082('0x32')]};return db[_0xa082('0x24')][_0xa082('0x19')](_0x5df14e)['then'](function(_0x39febf){_0x37fdc4[_0xa082('0x19')]=_0x39febf;if(_0xb235fa[_0xa082('0x2b')][_0xa082('0x37')]){_0x3da8bf[_0xa082('0x38')]=[{'all':!![]}];}return db[_0xa082('0x24')]['findAll'](_0x3da8bf);})['then'](function(_0x2b72d5){_0x37fdc4[_0xa082('0x39')]=_0x2b72d5;return _0x37fdc4;})[_0xa082('0x1f')](respondWithFilteredResult(_0x50b02b,_0x3da8bf))['catch'](handleError(_0x50b02b,null));};exports['show']=function(_0x1e850c,_0x182755){var _0x101265={'raw':!![],'where':{'id':_0x1e850c['params']['id']}},_0x55e0c5={};_0x55e0c5[_0xa082('0x29')]=_[_0xa082('0x2a')](db['SugarcrmField'][_0xa082('0x25')]);_0x55e0c5[_0xa082('0x2b')]=_[_0xa082('0x2a')](_0x1e850c[_0xa082('0x2b')]);_0x55e0c5[_0xa082('0x2c')]=_[_0xa082('0x2d')](_0x55e0c5[_0xa082('0x29')],_0x55e0c5[_0xa082('0x2b')]);_0x101265[_0xa082('0x2f')]=_['intersection'](_0x55e0c5[_0xa082('0x29')],qs[_0xa082('0x2e')](_0x1e850c[_0xa082('0x2b')]['fields']));_0x101265['attributes']=_0x101265[_0xa082('0x2f')][_0xa082('0x3a')]?_0x101265[_0xa082('0x2f')]:_0x55e0c5['model'];if(_0x1e850c[_0xa082('0x2b')][_0xa082('0x37')]){_0x101265[_0xa082('0x38')]=[{'all':!![]}];}_0x101265=_[_0xa082('0x35')]({},_0x101265,_0x1e850c[_0xa082('0x3b')]);return db[_0xa082('0x24')]['find'](_0x101265)['then'](handleEntityNotFound(_0x182755,null))['then'](respondWithResult(_0x182755,null))[_0xa082('0x3c')](handleError(_0x182755,null));};exports[_0xa082('0x3d')]=function(_0x2ca76b,_0x4346e4){return db['SugarcrmField'][_0xa082('0x3d')](_0x2ca76b[_0xa082('0x3e')],{})[_0xa082('0x1f')](respondWithResult(_0x4346e4,0xc9))['catch'](handleError(_0x4346e4,null));};exports[_0xa082('0x1e')]=function(_0x4b3657,_0x24df78){if(_0x4b3657[_0xa082('0x3e')]['id']){delete _0x4b3657[_0xa082('0x3e')]['id'];}return db[_0xa082('0x24')]['find']({'where':{'id':_0x4b3657[_0xa082('0x3f')]['id']}})[_0xa082('0x1f')](handleEntityNotFound(_0x24df78,null))[_0xa082('0x1f')](saveUpdates(_0x4b3657[_0xa082('0x3e')],null))['then'](respondWithResult(_0x24df78,null))[_0xa082('0x3c')](handleError(_0x24df78,null));};exports[_0xa082('0x20')]=function(_0x4b50ab,_0x4f20a9){return db[_0xa082('0x24')][_0xa082('0x40')]({'where':{'id':_0x4b50ab['params']['id']}})['then'](handleEntityNotFound(_0x4f20a9,null))[_0xa082('0x1f')](removeEntity(_0x4f20a9,null))[_0xa082('0x3c')](handleError(_0x4f20a9,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index a95eeb1..e63563d 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 _0xa74d=['int_sugarcrm_fields','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField'];(function(_0x29d2d2,_0x3344){var _0x3f6476=function(_0x29c2a2){while(--_0x29c2a2){_0x29d2d2['push'](_0x29d2d2['shift']());}};_0x3f6476(++_0x3344);}(_0xa74d,0x1bc));var _0xda74=function(_0x5719d8,_0x22a01a){_0x5719d8=_0x5719d8-0x0;var _0x5b9f6b=_0xa74d[_0x5719d8];return _0x5b9f6b;};'use strict';var _=require('lodash');var util=require(_0xda74('0x0'));var logger=require(_0xda74('0x1'))(_0xda74('0x2'));var moment=require('moment');var BPromise=require(_0xda74('0x3'));var rp=require(_0xda74('0x4'));var fs=require('fs');var path=require(_0xda74('0x5'));var rimraf=require(_0xda74('0x6'));var config=require(_0xda74('0x7'));var attributes=require(_0xda74('0x8'));module['exports']=function(_0x407f67,_0x39c1f3){return _0x407f67[_0xda74('0x9')](_0xda74('0xa'),attributes,{'tableName':_0xda74('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xda74('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb103=['./intSugarcrmField.attributes','define','SugarcrmField','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0xb103,0x94));var _0x3b10=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xb103[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0x3b10('0x0'));var util=require(_0x3b10('0x1'));var logger=require(_0x3b10('0x2'))('api');var moment=require(_0x3b10('0x3'));var BPromise=require(_0x3b10('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b10('0x5'));var rimraf=require(_0x3b10('0x6'));var config=require(_0x3b10('0x7'));var attributes=require(_0x3b10('0x8'));module['exports']=function(_0x2ad008,_0x8e44b6){return _0x2ad008[_0x3b10('0x9')](_0x3b10('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x3b10('0xb'),_0x3b10('0xc')],'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 be7f20e..023e072 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 _0x450e=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3ce141,_0x3cd925){var _0x32d83a=function(_0x138bf6){while(--_0x138bf6){_0x3ce141['push'](_0x3ce141['shift']());}};_0x32d83a(++_0x3cd925);}(_0x450e,0x1d0));var _0xe450=function(_0x4a7414,_0x38cf5c){_0x4a7414=_0x4a7414-0x0;var _0x472415=_0x450e[_0x4a7414];return _0x472415;};'use strict';var _=require(_0xe450('0x0'));var util=require(_0xe450('0x1'));var moment=require(_0xe450('0x2'));var BPromise=require(_0xe450('0x3'));var rs=require(_0xe450('0x4'));var fs=require('fs');var Redis=require(_0xe450('0x5'));var db=require(_0xe450('0x6'))['db'];var utils=require(_0xe450('0x7'));var logger=require(_0xe450('0x8'))('rpc');var config=require(_0xe450('0x9'));var jayson=require(_0xe450('0xa'));var client=jayson[_0xe450('0xb')][_0xe450('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5327dd,_0x4fc4ff,_0xd7b8a8){return new BPromise(function(_0x2fa439,_0x320bef){return client['request'](_0x5327dd,_0xd7b8a8)[_0xe450('0xd')](function(_0x3fe585){logger['info'](_0xe450('0xe'),_0x4fc4ff,_0xe450('0xf'));logger['debug'](_0xe450('0x10'),_0x4fc4ff,_0xe450('0xf'),JSON['stringify'](_0x3fe585));if(_0x3fe585[_0xe450('0x11')]){if(_0x3fe585[_0xe450('0x11')][_0xe450('0x12')]===0x1f4){logger[_0xe450('0x11')](_0xe450('0xe'),_0x4fc4ff,_0x3fe585['error'][_0xe450('0x13')]);return _0x320bef(_0x3fe585[_0xe450('0x11')]['message']);}logger['error'](_0xe450('0xe'),_0x4fc4ff,_0x3fe585[_0xe450('0x11')][_0xe450('0x13')]);return _0x2fa439(_0x3fe585[_0xe450('0x11')][_0xe450('0x13')]);}else{logger[_0xe450('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x4fc4ff,_0xe450('0xf'));_0x2fa439(_0x3fe585[_0xe450('0x15')][_0xe450('0x13')]);}})[_0xe450('0x16')](function(_0x314529){logger[_0xe450('0x11')](_0xe450('0xe'),_0x4fc4ff,_0x314529);_0x320bef(_0x314529);});});} \ No newline at end of file +var _0x4d71=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment'];(function(_0x5ac056,_0xf16f9c){var _0x211960=function(_0x1bee87){while(--_0x1bee87){_0x5ac056['push'](_0x5ac056['shift']());}};_0x211960(++_0xf16f9c);}(_0x4d71,0x67));var _0x14d7=function(_0x1f0bcf,_0x2898b3){_0x1f0bcf=_0x1f0bcf-0x0;var _0x1fc8c9=_0x4d71[_0x1f0bcf];return _0x1fc8c9;};'use strict';var _=require('lodash');var util=require(_0x14d7('0x0'));var moment=require(_0x14d7('0x1'));var BPromise=require(_0x14d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x14d7('0x4'));var logger=require(_0x14d7('0x5'))(_0x14d7('0x6'));var config=require(_0x14d7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14d7('0x8')][_0x14d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x223e37,_0x16e393,_0x52945c){return new BPromise(function(_0x4a3405,_0x595a1b){return client[_0x14d7('0xa')](_0x223e37,_0x52945c)[_0x14d7('0xb')](function(_0x351719){logger['info'](_0x14d7('0xc'),_0x16e393,_0x14d7('0xd'));logger['debug'](_0x14d7('0xe'),_0x16e393,_0x14d7('0xd'),JSON[_0x14d7('0xf')](_0x351719));if(_0x351719[_0x14d7('0x10')]){if(_0x351719[_0x14d7('0x10')]['code']===0x1f4){logger[_0x14d7('0x10')](_0x14d7('0xc'),_0x16e393,_0x351719[_0x14d7('0x10')]['message']);return _0x595a1b(_0x351719['error'][_0x14d7('0x11')]);}logger[_0x14d7('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x16e393,_0x351719[_0x14d7('0x10')][_0x14d7('0x11')]);return _0x4a3405(_0x351719[_0x14d7('0x10')]['message']);}else{logger[_0x14d7('0x12')](_0x14d7('0xc'),_0x16e393,_0x14d7('0xd'));_0x4a3405(_0x351719[_0x14d7('0x13')][_0x14d7('0x11')]);}})[_0x14d7('0x14')](function(_0xd3cfc4){logger['error'](_0x14d7('0xc'),_0x16e393,_0xd3cfc4);_0x595a1b(_0xd3cfc4);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 98f5ead..831ff44 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 _0x71c8=['post','create','addConfiguration','put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x119f77,_0x3b5bc9){var _0x391c44=function(_0xc702d7){while(--_0xc702d7){_0x119f77['push'](_0x119f77['shift']());}};_0x391c44(++_0x3b5bc9);}(_0x71c8,0x149));var _0x871c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71c8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x871c('0x0'));var util=require(_0x871c('0x1'));var path=require(_0x871c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x871c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x871c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x871c('0x5'));var controller=require(_0x871c('0x6'));router[_0x871c('0x7')]('/',auth[_0x871c('0x8')](),controller[_0x871c('0x9')]);router['get'](_0x871c('0xa'),auth['isAuthenticated'](),controller[_0x871c('0xb')]);router[_0x871c('0x7')](_0x871c('0xc'),auth[_0x871c('0x8')](),controller[_0x871c('0xd')]);router[_0x871c('0x7')](_0x871c('0xe'),auth['isAuthenticated'](),controller[_0x871c('0xf')]);router[_0x871c('0x10')]('/',auth[_0x871c('0x8')](),controller[_0x871c('0x11')]);router[_0x871c('0x10')]('/:id/configurations',auth[_0x871c('0x8')](),controller[_0x871c('0x12')]);router[_0x871c('0x13')](_0x871c('0xa'),auth['isAuthenticated'](),controller[_0x871c('0x14')]);router['delete'](_0x871c('0xa'),auth[_0x871c('0x8')](),controller[_0x871c('0x15')]);module[_0x871c('0x16')]=router; \ No newline at end of file +var _0x30ff=['/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x2b7675,_0x5969c9){var _0x4c4f97=function(_0x233188){while(--_0x233188){_0x2b7675['push'](_0x2b7675['shift']());}};_0x4c4f97(++_0x5969c9);}(_0x30ff,0x6a));var _0xf30f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x30ff[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0xf30f('0x0'));var path=require(_0xf30f('0x1'));var timeout=require(_0xf30f('0x2'));var express=require(_0xf30f('0x3'));var router=express[_0xf30f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf30f('0x5'));var interaction=require(_0xf30f('0x6'));var config=require('../../config/environment');var controller=require(_0xf30f('0x7'));router[_0xf30f('0x8')]('/',auth[_0xf30f('0x9')](),controller['index']);router[_0xf30f('0x8')](_0xf30f('0xa'),auth[_0xf30f('0x9')](),controller[_0xf30f('0xb')]);router['get'](_0xf30f('0xc'),auth[_0xf30f('0x9')](),controller[_0xf30f('0xd')]);router[_0xf30f('0x8')](_0xf30f('0xe'),auth[_0xf30f('0x9')](),controller[_0xf30f('0xf')]);router[_0xf30f('0x10')]('/',auth[_0xf30f('0x9')](),controller[_0xf30f('0x11')]);router[_0xf30f('0x10')](_0xf30f('0xc'),auth['isAuthenticated'](),controller[_0xf30f('0x12')]);router[_0xf30f('0x13')](_0xf30f('0xa'),auth['isAuthenticated'](),controller[_0xf30f('0x14')]);router[_0xf30f('0x15')](_0xf30f('0xa'),auth['isAuthenticated'](),controller[_0xf30f('0x16')]);module[_0xf30f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index c09e071..0f8a645 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 _0x3c03=['sequelize','exports','STRING'];(function(_0x498c6f,_0xc1fbaa){var _0x3c6e41=function(_0x3397b2){while(--_0x3397b2){_0x498c6f['push'](_0x498c6f['shift']());}};_0x3c6e41(++_0xc1fbaa);}(_0x3c03,0x19b));var _0x33c0=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x3c03[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x33c0('0x0'));module[_0x33c0('0x1')]={'name':{'type':Sequelize[_0x33c0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x33c0('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x33c0('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x33c0('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x33c0('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe453=['HelpDesk','STRING'];(function(_0x301536,_0x1249d8){var _0x182bb0=function(_0x2cdd67){while(--_0x2cdd67){_0x301536['push'](_0x301536['shift']());}};_0x182bb0(++_0x1249d8);}(_0xe453,0x157));var _0x3e45=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xe453[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3e45('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x3e45('0x0')]},'username':{'type':Sequelize[_0x3e45('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3e45('0x0')],'allowNull':![],'defaultValue':_0x3e45('0x1')},'remoteUri':{'type':Sequelize[_0x3e45('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x3e45('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 54ba13a..2635e60 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 _0x9aa8=['Subjects','md5','getFields','description','accessKey','moduleName','slice','substring','lastIndexOf','format','GET','getchallenge','username','success','POST','login','result','describe','sessionName','owner','includes','remove','editable','startsWith','cf_','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','error','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','stack','name','send','index','map','VtigerAccount','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','destroy','getConfigurations','findOne','VtigerConfiguration','rawAttributes','order','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x9aa8,0x9a));var _0x89aa=function(_0x2d493c,_0x1992e8){_0x2d493c=_0x2d493c-0x0;var _0x406e2c=_0x9aa8[_0x2d493c];return _0x406e2c;};'use strict';var emlformat=require(_0x89aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89aa('0x1'));var jsonpatch=require(_0x89aa('0x2'));var rp=require(_0x89aa('0x3'));var moment=require(_0x89aa('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x89aa('0x5'));var csv=require(_0x89aa('0x6'));var ejs=require(_0x89aa('0x7'));var fs=require('fs');var fs_extra=require(_0x89aa('0x8'));var _=require(_0x89aa('0x9'));var squel=require(_0x89aa('0xa'));var crypto=require(_0x89aa('0xb'));var jsforce=require(_0x89aa('0xc'));var deskjs=require(_0x89aa('0xd'));var toCsv=require(_0x89aa('0x6'));var querystring=require(_0x89aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x89aa('0xf'));var authService=require(_0x89aa('0x10'));var qs=require(_0x89aa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89aa('0x12'));var logger=require(_0x89aa('0x13'))(_0x89aa('0x14'));var utils=require(_0x89aa('0x15'));var config=require(_0x89aa('0x16'));var licenseUtil=require(_0x89aa('0x17'));var db=require(_0x89aa('0x18'))['db'];var integrations=require(_0x89aa('0x19'));function respondWithStatusCode(_0x4b96ba,_0x3b1ef8){_0x3b1ef8=_0x3b1ef8||0xcc;return function(_0xf6070e){if(_0xf6070e){return _0x4b96ba[_0x89aa('0x1a')](_0x3b1ef8);}return _0x4b96ba[_0x89aa('0x1b')](_0x3b1ef8)[_0x89aa('0x1c')]();};}function respondWithResult(_0x454187,_0x42934f){_0x42934f=_0x42934f||0xc8;return function(_0x144a5c){if(_0x144a5c){return _0x454187[_0x89aa('0x1b')](_0x42934f)[_0x89aa('0x1d')](_0x144a5c);}};}function respondWithFilteredResult(_0x29ba02,_0x1a4e2c){return function(_0x562809){if(_0x562809){var _0x111912=typeof _0x1a4e2c[_0x89aa('0x1e')]===_0x89aa('0x1f')&&typeof _0x1a4e2c[_0x89aa('0x20')]===_0x89aa('0x1f');var _0x25a6d0=_0x562809[_0x89aa('0x21')];var _0x44c370=_0x111912?0x0:_0x1a4e2c['offset'];var _0x2ab7d7=_0x111912?_0x562809[_0x89aa('0x21')]:_0x1a4e2c[_0x89aa('0x1e')]+_0x1a4e2c[_0x89aa('0x20')];var _0x2e85bd;if(_0x2ab7d7>=_0x25a6d0){_0x2ab7d7=_0x25a6d0;_0x2e85bd=0xc8;}else{_0x2e85bd=0xce;}_0x29ba02[_0x89aa('0x1b')](_0x2e85bd);return _0x29ba02[_0x89aa('0x22')]('Content-Range',_0x44c370+'-'+_0x2ab7d7+'/'+_0x25a6d0)[_0x89aa('0x1d')](_0x562809);}return null;};}function patchUpdates(_0x45da7f){return function(_0x1870db){try{jsonpatch[_0x89aa('0x23')](_0x1870db,_0x45da7f,!![]);}catch(_0x193ea0){return BPromise[_0x89aa('0x24')](_0x193ea0);}return _0x1870db['save']();};}function saveUpdates(_0x31e037,_0x237a94){return function(_0x193020){if(_0x193020){return _0x193020['update'](_0x31e037)[_0x89aa('0x25')](function(_0x54e852){return _0x54e852;});}return null;};}function removeEntity(_0xb7e829,_0x402f69){return function(_0x3a78d2){if(_0x3a78d2){return _0x3a78d2['destroy']()[_0x89aa('0x25')](function(){_0xb7e829[_0x89aa('0x1b')](0xcc)[_0x89aa('0x1c')]();});}};}function handleEntityNotFound(_0x31107f,_0x3a799e){return function(_0x5d8b56){if(!_0x5d8b56){_0x31107f[_0x89aa('0x1a')](0x194);}return _0x5d8b56;};}function handleError(_0x1527de,_0x1dfa46){_0x1dfa46=_0x1dfa46||0x1f4;return function(_0x2ddf83){logger['error'](_0x2ddf83[_0x89aa('0x26')]);if(_0x2ddf83[_0x89aa('0x27')]){delete _0x2ddf83[_0x89aa('0x27')];}_0x1527de[_0x89aa('0x1b')](_0x1dfa46)[_0x89aa('0x28')](_0x2ddf83);};}exports[_0x89aa('0x29')]=function(_0x1859e5,_0x5f3904){var _0x116815={},_0x23f530={},_0x82fef2={'count':0x0,'rows':[]};var _0x1c48fa=_[_0x89aa('0x2a')](db[_0x89aa('0x2b')]['rawAttributes'],function(_0x26057e){return{'name':_0x26057e[_0x89aa('0x2c')],'type':_0x26057e[_0x89aa('0x2d')][_0x89aa('0x2e')]};});_0x23f530[_0x89aa('0x2f')]=_[_0x89aa('0x2a')](_0x1c48fa,_0x89aa('0x27'));_0x23f530['query']=_[_0x89aa('0x30')](_0x1859e5[_0x89aa('0x31')]);_0x23f530[_0x89aa('0x32')]=_['intersection'](_0x23f530['model'],_0x23f530['query']);_0x116815[_0x89aa('0x33')]=_[_0x89aa('0x34')](_0x23f530[_0x89aa('0x2f')],qs[_0x89aa('0x35')](_0x1859e5[_0x89aa('0x31')]['fields']));_0x116815[_0x89aa('0x33')]=_0x116815[_0x89aa('0x33')][_0x89aa('0x36')]?_0x116815[_0x89aa('0x33')]:_0x23f530[_0x89aa('0x2f')];if(!_0x1859e5[_0x89aa('0x31')][_0x89aa('0x37')](_0x89aa('0x38'))){_0x116815[_0x89aa('0x20')]=qs[_0x89aa('0x20')](_0x1859e5['query'][_0x89aa('0x20')]);_0x116815[_0x89aa('0x1e')]=qs[_0x89aa('0x1e')](_0x1859e5[_0x89aa('0x31')]['offset']);}_0x116815['order']=qs[_0x89aa('0x39')](_0x1859e5['query'][_0x89aa('0x39')]);_0x116815[_0x89aa('0x3a')]=qs[_0x89aa('0x32')](_[_0x89aa('0x3b')](_0x1859e5[_0x89aa('0x31')],_0x23f530['filters']),_0x1c48fa);if(_0x1859e5[_0x89aa('0x31')][_0x89aa('0x3c')]){_0x116815[_0x89aa('0x3a')]=_[_0x89aa('0x3d')](_0x116815['where'],{'$or':_['map'](_0x1c48fa,function(_0x6700ed){if(_0x6700ed[_0x89aa('0x2d')]!==_0x89aa('0x3e')){var _0x2a0fcd={};_0x2a0fcd[_0x6700ed[_0x89aa('0x27')]]={'$like':'%'+_0x1859e5[_0x89aa('0x31')][_0x89aa('0x3c')]+'%'};return _0x2a0fcd;}})});}_0x116815=_[_0x89aa('0x3d')]({},_0x116815,_0x1859e5[_0x89aa('0x3f')]);var _0x28796d={'where':_0x116815[_0x89aa('0x3a')]};return db[_0x89aa('0x2b')]['count'](_0x28796d)['then'](function(_0x4cbc82){_0x82fef2[_0x89aa('0x21')]=_0x4cbc82;if(_0x1859e5[_0x89aa('0x31')][_0x89aa('0x40')]){_0x116815['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x89aa('0x41')](_0x116815);})[_0x89aa('0x25')](function(_0xe476d6){_0x82fef2[_0x89aa('0x42')]=_0xe476d6;return _0x82fef2;})[_0x89aa('0x25')](respondWithFilteredResult(_0x5f3904,_0x116815))[_0x89aa('0x43')](handleError(_0x5f3904,null));};exports[_0x89aa('0x44')]=function(_0x359fa1,_0x543fcb){var _0x45615e={'raw':![],'where':{'id':_0x359fa1[_0x89aa('0x45')]['id']}},_0x192dcf={};_0x192dcf[_0x89aa('0x2f')]=_['keys'](db[_0x89aa('0x2b')]['rawAttributes']);_0x192dcf[_0x89aa('0x31')]=_['keys'](_0x359fa1[_0x89aa('0x31')]);_0x192dcf['filters']=_['intersection'](_0x192dcf['model'],_0x192dcf[_0x89aa('0x31')]);_0x45615e['attributes']=_[_0x89aa('0x34')](_0x192dcf[_0x89aa('0x2f')],qs[_0x89aa('0x35')](_0x359fa1[_0x89aa('0x31')]['fields']));_0x45615e[_0x89aa('0x33')]=_0x45615e[_0x89aa('0x33')][_0x89aa('0x36')]?_0x45615e[_0x89aa('0x33')]:_0x192dcf[_0x89aa('0x2f')];if(_0x359fa1['query'][_0x89aa('0x40')]){_0x45615e[_0x89aa('0x46')]=[{'all':!![]}];}_0x45615e=_[_0x89aa('0x3d')]({},_0x45615e,_0x359fa1[_0x89aa('0x3f')]);return db['VtigerAccount'][_0x89aa('0x47')](_0x45615e)[_0x89aa('0x25')](handleEntityNotFound(_0x543fcb,null))[_0x89aa('0x25')](respondWithResult(_0x543fcb,null))[_0x89aa('0x43')](handleError(_0x543fcb,null));};exports[_0x89aa('0x48')]=function(_0x7de387,_0x40ac15){return db['VtigerAccount'][_0x89aa('0x48')](_0x7de387[_0x89aa('0x49')],{})['then'](respondWithResult(_0x40ac15,0xc9))[_0x89aa('0x43')](handleError(_0x40ac15,null));};exports[_0x89aa('0x4a')]=function(_0x750b04,_0x28bf30){if(_0x750b04['body']['id']){delete _0x750b04['body']['id'];}return db[_0x89aa('0x2b')]['find']({'where':{'id':_0x750b04[_0x89aa('0x45')]['id']}})[_0x89aa('0x25')](handleEntityNotFound(_0x28bf30,null))[_0x89aa('0x25')](saveUpdates(_0x750b04['body'],null))['then'](respondWithResult(_0x28bf30,null))[_0x89aa('0x43')](handleError(_0x28bf30,null));};exports[_0x89aa('0x4b')]=function(_0x253078,_0xd339fe){return db['VtigerAccount']['find']({'where':{'id':_0x253078[_0x89aa('0x45')]['id']}})['then'](handleEntityNotFound(_0xd339fe,null))[_0x89aa('0x25')](removeEntity(_0xd339fe,null))[_0x89aa('0x43')](handleError(_0xd339fe,null));};exports[_0x89aa('0x4c')]=function(_0x28621e,_0x5c8d49,_0x1162f6){var _0x43d195={};var _0x373b11={};var _0x34bb7f;var _0x498f39;return db['VtigerAccount'][_0x89aa('0x4d')]({'where':{'id':_0x28621e['params']['id']}})['then'](handleEntityNotFound(_0x5c8d49,null))[_0x89aa('0x25')](function(_0x1f6bc6){if(_0x1f6bc6){_0x34bb7f=_0x1f6bc6;_0x373b11[_0x89aa('0x2f')]=_['keys'](db[_0x89aa('0x4e')][_0x89aa('0x4f')]);_0x373b11[_0x89aa('0x31')]=_[_0x89aa('0x30')](_0x28621e[_0x89aa('0x31')]);_0x373b11[_0x89aa('0x32')]=_[_0x89aa('0x34')](_0x373b11[_0x89aa('0x2f')],_0x373b11['query']);_0x43d195[_0x89aa('0x33')]=_[_0x89aa('0x34')](_0x373b11[_0x89aa('0x2f')],qs['fields'](_0x28621e[_0x89aa('0x31')][_0x89aa('0x35')]));_0x43d195[_0x89aa('0x33')]=_0x43d195['attributes'][_0x89aa('0x36')]?_0x43d195[_0x89aa('0x33')]:_0x373b11[_0x89aa('0x2f')];_0x43d195[_0x89aa('0x50')]=qs[_0x89aa('0x39')](_0x28621e[_0x89aa('0x31')]['sort']);_0x43d195['where']=qs[_0x89aa('0x32')](_[_0x89aa('0x3b')](_0x28621e[_0x89aa('0x31')],_0x373b11[_0x89aa('0x32')]));if(_0x28621e[_0x89aa('0x31')][_0x89aa('0x3c')]){_0x43d195[_0x89aa('0x3a')]=_['merge'](_0x43d195[_0x89aa('0x3a')],{'$or':_['map'](_0x43d195[_0x89aa('0x33')],function(_0x5c959c){var _0x364dae={};_0x364dae[_0x5c959c]={'$like':'%'+_0x28621e['query'][_0x89aa('0x3c')]+'%'};return _0x364dae;})});}_0x43d195=_['merge']({},_0x43d195,_0x28621e[_0x89aa('0x3f')]);return _0x34bb7f[_0x89aa('0x4c')](_0x43d195);}})[_0x89aa('0x25')](function(_0x236005){if(_0x236005){_0x498f39=_0x236005[_0x89aa('0x36')];if(!_0x28621e[_0x89aa('0x31')][_0x89aa('0x37')](_0x89aa('0x38'))){_0x43d195['limit']=qs['limit'](_0x28621e[_0x89aa('0x31')][_0x89aa('0x20')]);_0x43d195['offset']=qs[_0x89aa('0x1e')](_0x28621e[_0x89aa('0x31')]['offset']);}return _0x34bb7f[_0x89aa('0x4c')](_0x43d195);}})[_0x89aa('0x25')](function(_0x47c86c){if(_0x47c86c){return _0x47c86c?{'count':_0x498f39,'rows':_0x47c86c}:null;}})['then'](respondWithResult(_0x5c8d49,null))[_0x89aa('0x43')](handleError(_0x5c8d49,null));};exports[_0x89aa('0x51')]=function(_0x55428a,_0x107711,_0x23492e){if(_0x55428a[_0x89aa('0x49')]['id']){delete _0x55428a[_0x89aa('0x49')]['id'];}return db[_0x89aa('0x2b')][_0x89aa('0x4d')]({'where':{'id':_0x55428a[_0x89aa('0x45')]['id']}})[_0x89aa('0x25')](handleEntityNotFound(_0x107711,null))[_0x89aa('0x25')](function(_0x4a8e85){if(_0x4a8e85){_0x55428a[_0x89aa('0x49')][_0x89aa('0x52')]=_0x4a8e85['id'];_0x55428a['body']['Subjects']=integrations[_0x89aa('0x53')](_0x55428a['body'][_0x89aa('0x54')],_0x55428a[_0x89aa('0x49')][_0x89aa('0x2d')]);_0x55428a[_0x89aa('0x49')][_0x89aa('0x55')]=integrations[_0x89aa('0x56')](_0x55428a['body']['channel'],_0x55428a['body']['type']);return db['VtigerConfiguration'][_0x89aa('0x48')](_0x55428a[_0x89aa('0x49')],{'include':[{'model':db[_0x89aa('0x57')],'as':_0x89aa('0x58')},{'model':db[_0x89aa('0x57')],'as':_0x89aa('0x55')}]});}return null;})[_0x89aa('0x25')](respondWithResult(_0x107711,null))['catch'](handleError(_0x107711,null));};var md5=require(_0x89aa('0x59'));exports[_0x89aa('0x5a')]=function(_0x48b3a3,_0x41137c,_0x103036){var _0x17c0d4=null;var _0x44104b=null;var _0x474db4=null;var _0x5d67a3=null;var _0x292ef7='';return db[_0x89aa('0x2b')][_0x89aa('0x4d')]({'where':{'id':_0x48b3a3['params']['id']},'attributes':['id','name','username',_0x89aa('0x5b'),'moduleName','remoteUri','serverUrl',_0x89aa('0x5c')]})[_0x89aa('0x25')](handleEntityNotFound(_0x41137c,null))['then'](function(_0x398e4f){if(_0x398e4f){_0x17c0d4=_0x398e4f['username'];_0x44104b=_0x398e4f[_0x89aa('0x5c')];_0x474db4=_0x398e4f[_0x89aa('0x5d')];_0x292ef7=_0x398e4f['remoteUri'];var _0x39b013=_0x292ef7[_0x89aa('0x5e')](-0x1);if(_0x39b013==='/'){_0x292ef7=_0x292ef7[_0x89aa('0x5f')](0x0,_0x292ef7[_0x89aa('0x60')](_0x39b013));}_0x5d67a3=util[_0x89aa('0x61')]('%s/webservice.php',_0x292ef7);var _0x5aae97={'method':_0x89aa('0x62'),'uri':_0x5d67a3,'qs':{'operation':_0x89aa('0x63'),'username':_0x398e4f[_0x89aa('0x64')]},'json':!![]};return rp(_0x5aae97);}})['then'](function(_0x4c2efe){if(_0x4c2efe[_0x89aa('0x65')]){var _0x37c816={'method':_0x89aa('0x66'),'uri':_0x5d67a3,'form':{'operation':_0x89aa('0x67'),'username':_0x17c0d4,'accessKey':md5(_0x4c2efe[_0x89aa('0x68')]['token']+_0x44104b)},'json':!![]};return rp(_0x37c816);}})[_0x89aa('0x25')](function(_0x3e73ab){if(_0x3e73ab[_0x89aa('0x65')]){var _0x21cbe8={'method':'GET','uri':_0x5d67a3,'qs':{'operation':_0x89aa('0x69'),'username':_0x17c0d4,'sessionName':_0x3e73ab[_0x89aa('0x68')][_0x89aa('0x6a')],'elementType':_0x474db4},'json':!![]};return rp(_0x21cbe8);}})[_0x89aa('0x25')](function(_0x40db9f){if(_0x40db9f[_0x89aa('0x65')]){var _0x31a14e=['autogenerated','reference',_0x89aa('0x6b')];_['remove'](_0x40db9f[_0x89aa('0x68')][_0x89aa('0x35')],function(_0x12c08e){return _0x31a14e[_0x89aa('0x6c')](_0x12c08e[_0x89aa('0x2d')][_0x89aa('0x27')]);});_[_0x89aa('0x6d')](_0x40db9f['result'][_0x89aa('0x35')],function(_0x161dfa){return _0x161dfa[_0x89aa('0x6e')]==='false';});return{'count':_0x40db9f[_0x89aa('0x68')]['fields']['length'],'rows':_[_0x89aa('0x2a')](_0x40db9f['result'][_0x89aa('0x35')],function(_0x337e2d){return{'id':_0x337e2d[_0x89aa('0x27')],'name':_0x337e2d['label'],'custom':_[_0x89aa('0x6f')](_0x337e2d[_0x89aa('0x27')],_0x89aa('0x70'))?!![]:![],'options':_0x337e2d[_0x89aa('0x2d')]['name']==='picklist'&&_0x337e2d['type'][_0x89aa('0x71')]['length']>0x0?_[_0x89aa('0x2a')](_0x337e2d[_0x89aa('0x2d')][_0x89aa('0x71')],function(_0x357837){return{'name':_0x357837[_0x89aa('0x72')],'value':_0x357837[_0x89aa('0x73')]};}):[]};})};}})[_0x89aa('0x25')](respondWithResult(_0x41137c,null))[_0x89aa('0x43')](function(_0x11325f){console[_0x89aa('0x74')](_0x89aa('0x75')+_0x11325f);var _0x314865=_0x48b3a3[_0x89aa('0x31')][_0x89aa('0x76')]?0x1f4:_0x11325f[_0x89aa('0x77')]||0x1f4;logger[_0x89aa('0x78')]('getFields,\x20%s,\x20%s,\x20%s',_0x89aa('0x5a'),_0x314865,JSON['stringify'](_0x11325f));delete _0x11325f[_0x89aa('0x27')];if(_0x314865===0x191){_0x314865=0x190;}_0x41137c[_0x89aa('0x1b')](_0x314865)['send'](_0x48b3a3['query'][_0x89aa('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x11325f[_0x89aa('0x77')]}:_0x11325f);});}; \ No newline at end of file +var _0x089f=['picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','error','stack','name','send','index','VtigerAccount','fieldName','key','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','catch','show','params','keys','rawAttributes','filters','find','create','update','body','getConfigurations','findOne','VtigerConfiguration','order','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','remoteUri','accessKey','moduleName','slice','format','%s/webservice.php','getchallenge','success','POST','result','token','sessionName','autogenerated','includes','editable','false','label','startsWith'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x089f,0x7a));var _0xf089=function(_0x8fc20f,_0x299ee6){_0x8fc20f=_0x8fc20f-0x0;var _0x3edc46=_0x089f[_0x8fc20f];return _0x3edc46;};'use strict';var emlformat=require(_0xf089('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf089('0x1'));var jsonpatch=require(_0xf089('0x2'));var rp=require(_0xf089('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf089('0x4'));var util=require(_0xf089('0x5'));var path=require(_0xf089('0x6'));var sox=require(_0xf089('0x7'));var csv=require(_0xf089('0x8'));var ejs=require(_0xf089('0x9'));var fs=require('fs');var fs_extra=require(_0xf089('0xa'));var _=require('lodash');var squel=require(_0xf089('0xb'));var crypto=require(_0xf089('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf089('0xd'));var toCsv=require(_0xf089('0x8'));var querystring=require(_0xf089('0xe'));var Papa=require(_0xf089('0xf'));var Redis=require(_0xf089('0x10'));var authService=require(_0xf089('0x11'));var qs=require(_0xf089('0x12'));var as=require(_0xf089('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf089('0x14'));var config=require(_0xf089('0x15'));var licenseUtil=require(_0xf089('0x16'));var db=require(_0xf089('0x17'))['db'];var integrations=require(_0xf089('0x18'));function respondWithStatusCode(_0x3743a9,_0x37b276){_0x37b276=_0x37b276||0xcc;return function(_0x43fab9){if(_0x43fab9){return _0x3743a9[_0xf089('0x19')](_0x37b276);}return _0x3743a9['status'](_0x37b276)[_0xf089('0x1a')]();};}function respondWithResult(_0x2ecbd3,_0x8dfee4){_0x8dfee4=_0x8dfee4||0xc8;return function(_0x4a63f6){if(_0x4a63f6){return _0x2ecbd3[_0xf089('0x1b')](_0x8dfee4)[_0xf089('0x1c')](_0x4a63f6);}};}function respondWithFilteredResult(_0x4866ad,_0x33a53a){return function(_0x194445){if(_0x194445){var _0x4084cf=typeof _0x33a53a['offset']===_0xf089('0x1d')&&typeof _0x33a53a[_0xf089('0x1e')]===_0xf089('0x1d');var _0x1aa048=_0x194445[_0xf089('0x1f')];var _0x2d49d0=_0x4084cf?0x0:_0x33a53a[_0xf089('0x20')];var _0x204073=_0x4084cf?_0x194445['count']:_0x33a53a[_0xf089('0x20')]+_0x33a53a[_0xf089('0x1e')];var _0x516e5c;if(_0x204073>=_0x1aa048){_0x204073=_0x1aa048;_0x516e5c=0xc8;}else{_0x516e5c=0xce;}_0x4866ad['status'](_0x516e5c);return _0x4866ad[_0xf089('0x21')](_0xf089('0x22'),_0x2d49d0+'-'+_0x204073+'/'+_0x1aa048)[_0xf089('0x1c')](_0x194445);}return null;};}function patchUpdates(_0xaec940){return function(_0x480c66){try{jsonpatch[_0xf089('0x23')](_0x480c66,_0xaec940,!![]);}catch(_0x1ce3ac){return BPromise['reject'](_0x1ce3ac);}return _0x480c66['save']();};}function saveUpdates(_0x5a9574,_0x135c23){return function(_0x4fef1d){if(_0x4fef1d){return _0x4fef1d['update'](_0x5a9574)[_0xf089('0x24')](function(_0x529145){return _0x529145;});}return null;};}function removeEntity(_0x51c39c,_0x3ab482){return function(_0x3f97b9){if(_0x3f97b9){return _0x3f97b9[_0xf089('0x25')]()[_0xf089('0x24')](function(){_0x51c39c[_0xf089('0x1b')](0xcc)[_0xf089('0x1a')]();});}};}function handleEntityNotFound(_0x5b4582,_0x1f9a06){return function(_0x5cb3b9){if(!_0x5cb3b9){_0x5b4582[_0xf089('0x19')](0x194);}return _0x5cb3b9;};}function handleError(_0x2d7639,_0x33e7f4){_0x33e7f4=_0x33e7f4||0x1f4;return function(_0x3f76ef){logger[_0xf089('0x26')](_0x3f76ef[_0xf089('0x27')]);if(_0x3f76ef[_0xf089('0x28')]){delete _0x3f76ef[_0xf089('0x28')];}_0x2d7639['status'](_0x33e7f4)[_0xf089('0x29')](_0x3f76ef);};}exports[_0xf089('0x2a')]=function(_0x22d96d,_0x162852){var _0x2ab9f5={},_0x3f0af3={},_0x5e6114={'count':0x0,'rows':[]};var _0x1cf7f8=_['map'](db[_0xf089('0x2b')]['rawAttributes'],function(_0x2fa8d8){return{'name':_0x2fa8d8[_0xf089('0x2c')],'type':_0x2fa8d8['type'][_0xf089('0x2d')]};});_0x3f0af3[_0xf089('0x2e')]=_[_0xf089('0x2f')](_0x1cf7f8,_0xf089('0x28'));_0x3f0af3[_0xf089('0x30')]=_['keys'](_0x22d96d['query']);_0x3f0af3['filters']=_[_0xf089('0x31')](_0x3f0af3['model'],_0x3f0af3[_0xf089('0x30')]);_0x2ab9f5[_0xf089('0x32')]=_[_0xf089('0x31')](_0x3f0af3[_0xf089('0x2e')],qs[_0xf089('0x33')](_0x22d96d[_0xf089('0x30')][_0xf089('0x33')]));_0x2ab9f5[_0xf089('0x32')]=_0x2ab9f5['attributes'][_0xf089('0x34')]?_0x2ab9f5[_0xf089('0x32')]:_0x3f0af3[_0xf089('0x2e')];if(!_0x22d96d[_0xf089('0x30')]['hasOwnProperty'](_0xf089('0x35'))){_0x2ab9f5[_0xf089('0x1e')]=qs[_0xf089('0x1e')](_0x22d96d['query'][_0xf089('0x1e')]);_0x2ab9f5[_0xf089('0x20')]=qs[_0xf089('0x20')](_0x22d96d[_0xf089('0x30')][_0xf089('0x20')]);}_0x2ab9f5['order']=qs[_0xf089('0x36')](_0x22d96d[_0xf089('0x30')]['sort']);_0x2ab9f5[_0xf089('0x37')]=qs['filters'](_[_0xf089('0x38')](_0x22d96d['query'],_0x3f0af3['filters']),_0x1cf7f8);if(_0x22d96d['query'][_0xf089('0x39')]){_0x2ab9f5[_0xf089('0x37')]=_[_0xf089('0x3a')](_0x2ab9f5['where'],{'$or':_[_0xf089('0x2f')](_0x1cf7f8,function(_0x219f8c){if(_0x219f8c[_0xf089('0x3b')]!==_0xf089('0x3c')){var _0x574e93={};_0x574e93[_0x219f8c[_0xf089('0x28')]]={'$like':'%'+_0x22d96d[_0xf089('0x30')][_0xf089('0x39')]+'%'};return _0x574e93;}})});}_0x2ab9f5=_[_0xf089('0x3a')]({},_0x2ab9f5,_0x22d96d[_0xf089('0x3d')]);var _0x2385cc={'where':_0x2ab9f5['where']};return db[_0xf089('0x2b')][_0xf089('0x1f')](_0x2385cc)['then'](function(_0x1112bc){_0x5e6114['count']=_0x1112bc;if(_0x22d96d['query']['includeAll']){_0x2ab9f5['include']=[{'all':!![]}];}return db[_0xf089('0x2b')]['findAll'](_0x2ab9f5);})[_0xf089('0x24')](function(_0x5233d5){_0x5e6114['rows']=_0x5233d5;return _0x5e6114;})[_0xf089('0x24')](respondWithFilteredResult(_0x162852,_0x2ab9f5))[_0xf089('0x3e')](handleError(_0x162852,null));};exports[_0xf089('0x3f')]=function(_0x51bad4,_0x11b550){var _0x5a41c8={'raw':![],'where':{'id':_0x51bad4[_0xf089('0x40')]['id']}},_0x493eb6={};_0x493eb6[_0xf089('0x2e')]=_[_0xf089('0x41')](db[_0xf089('0x2b')][_0xf089('0x42')]);_0x493eb6[_0xf089('0x30')]=_[_0xf089('0x41')](_0x51bad4[_0xf089('0x30')]);_0x493eb6[_0xf089('0x43')]=_[_0xf089('0x31')](_0x493eb6[_0xf089('0x2e')],_0x493eb6['query']);_0x5a41c8[_0xf089('0x32')]=_['intersection'](_0x493eb6[_0xf089('0x2e')],qs['fields'](_0x51bad4[_0xf089('0x30')][_0xf089('0x33')]));_0x5a41c8[_0xf089('0x32')]=_0x5a41c8['attributes'][_0xf089('0x34')]?_0x5a41c8[_0xf089('0x32')]:_0x493eb6[_0xf089('0x2e')];if(_0x51bad4[_0xf089('0x30')]['includeAll']){_0x5a41c8['include']=[{'all':!![]}];}_0x5a41c8=_[_0xf089('0x3a')]({},_0x5a41c8,_0x51bad4[_0xf089('0x3d')]);return db[_0xf089('0x2b')][_0xf089('0x44')](_0x5a41c8)[_0xf089('0x24')](handleEntityNotFound(_0x11b550,null))[_0xf089('0x24')](respondWithResult(_0x11b550,null))[_0xf089('0x3e')](handleError(_0x11b550,null));};exports[_0xf089('0x45')]=function(_0x64f8bf,_0x9f8110){return db[_0xf089('0x2b')][_0xf089('0x45')](_0x64f8bf['body'],{})['then'](respondWithResult(_0x9f8110,0xc9))['catch'](handleError(_0x9f8110,null));};exports[_0xf089('0x46')]=function(_0x422029,_0x5203e3){if(_0x422029['body']['id']){delete _0x422029[_0xf089('0x47')]['id'];}return db[_0xf089('0x2b')]['find']({'where':{'id':_0x422029[_0xf089('0x40')]['id']}})[_0xf089('0x24')](handleEntityNotFound(_0x5203e3,null))['then'](saveUpdates(_0x422029['body'],null))[_0xf089('0x24')](respondWithResult(_0x5203e3,null))[_0xf089('0x3e')](handleError(_0x5203e3,null));};exports[_0xf089('0x25')]=function(_0xaec603,_0x308de2){return db['VtigerAccount'][_0xf089('0x44')]({'where':{'id':_0xaec603['params']['id']}})[_0xf089('0x24')](handleEntityNotFound(_0x308de2,null))[_0xf089('0x24')](removeEntity(_0x308de2,null))[_0xf089('0x3e')](handleError(_0x308de2,null));};exports[_0xf089('0x48')]=function(_0x6861aa,_0xa5a769,_0x21e903){var _0x5e7864={};var _0x3fa169={};var _0x42f197;var _0x5448d8;return db[_0xf089('0x2b')][_0xf089('0x49')]({'where':{'id':_0x6861aa[_0xf089('0x40')]['id']}})[_0xf089('0x24')](handleEntityNotFound(_0xa5a769,null))[_0xf089('0x24')](function(_0x270bbe){if(_0x270bbe){_0x42f197=_0x270bbe;_0x3fa169['model']=_[_0xf089('0x41')](db[_0xf089('0x4a')][_0xf089('0x42')]);_0x3fa169['query']=_[_0xf089('0x41')](_0x6861aa[_0xf089('0x30')]);_0x3fa169[_0xf089('0x43')]=_[_0xf089('0x31')](_0x3fa169[_0xf089('0x2e')],_0x3fa169['query']);_0x5e7864['attributes']=_['intersection'](_0x3fa169[_0xf089('0x2e')],qs[_0xf089('0x33')](_0x6861aa[_0xf089('0x30')][_0xf089('0x33')]));_0x5e7864['attributes']=_0x5e7864[_0xf089('0x32')][_0xf089('0x34')]?_0x5e7864[_0xf089('0x32')]:_0x3fa169[_0xf089('0x2e')];_0x5e7864[_0xf089('0x4b')]=qs['sort'](_0x6861aa[_0xf089('0x30')][_0xf089('0x36')]);_0x5e7864[_0xf089('0x37')]=qs[_0xf089('0x43')](_[_0xf089('0x38')](_0x6861aa[_0xf089('0x30')],_0x3fa169[_0xf089('0x43')]));if(_0x6861aa[_0xf089('0x30')]['filter']){_0x5e7864[_0xf089('0x37')]=_[_0xf089('0x3a')](_0x5e7864['where'],{'$or':_[_0xf089('0x2f')](_0x5e7864[_0xf089('0x32')],function(_0x1f6f08){var _0x33aa1c={};_0x33aa1c[_0x1f6f08]={'$like':'%'+_0x6861aa['query'][_0xf089('0x39')]+'%'};return _0x33aa1c;})});}_0x5e7864=_[_0xf089('0x3a')]({},_0x5e7864,_0x6861aa[_0xf089('0x3d')]);return _0x42f197['getConfigurations'](_0x5e7864);}})[_0xf089('0x24')](function(_0x4feff7){if(_0x4feff7){_0x5448d8=_0x4feff7[_0xf089('0x34')];if(!_0x6861aa[_0xf089('0x30')][_0xf089('0x4c')](_0xf089('0x35'))){_0x5e7864[_0xf089('0x1e')]=qs[_0xf089('0x1e')](_0x6861aa['query'][_0xf089('0x1e')]);_0x5e7864[_0xf089('0x20')]=qs['offset'](_0x6861aa[_0xf089('0x30')][_0xf089('0x20')]);}return _0x42f197[_0xf089('0x48')](_0x5e7864);}})['then'](function(_0x275303){if(_0x275303){return _0x275303?{'count':_0x5448d8,'rows':_0x275303}:null;}})[_0xf089('0x24')](respondWithResult(_0xa5a769,null))['catch'](handleError(_0xa5a769,null));};exports['addConfiguration']=function(_0x22269f,_0x306e43,_0x244456){if(_0x22269f['body']['id']){delete _0x22269f[_0xf089('0x47')]['id'];}return db['VtigerAccount'][_0xf089('0x49')]({'where':{'id':_0x22269f[_0xf089('0x40')]['id']}})[_0xf089('0x24')](handleEntityNotFound(_0x306e43,null))[_0xf089('0x24')](function(_0x1796cb){if(_0x1796cb){_0x22269f[_0xf089('0x47')][_0xf089('0x4d')]=_0x1796cb['id'];_0x22269f[_0xf089('0x47')][_0xf089('0x4e')]=integrations[_0xf089('0x4f')](_0x22269f[_0xf089('0x47')][_0xf089('0x50')],_0x22269f[_0xf089('0x47')][_0xf089('0x3b')]);_0x22269f[_0xf089('0x47')][_0xf089('0x51')]=integrations[_0xf089('0x52')](_0x22269f['body'][_0xf089('0x50')],_0x22269f[_0xf089('0x47')][_0xf089('0x3b')]);return db[_0xf089('0x4a')][_0xf089('0x45')](_0x22269f['body'],{'include':[{'model':db[_0xf089('0x53')],'as':'Subjects'},{'model':db[_0xf089('0x53')],'as':_0xf089('0x51')}]});}return null;})[_0xf089('0x24')](respondWithResult(_0x306e43,null))[_0xf089('0x3e')](handleError(_0x306e43,null));};var md5=require('md5');exports[_0xf089('0x54')]=function(_0x32afa2,_0x1f06bb,_0x35c8ec){var _0x4bc3fc=null;var _0x1af2ec=null;var _0x2f5c0=null;var _0x4249ac=null;var _0x2d3589='';return db['VtigerAccount']['findOne']({'where':{'id':_0x32afa2[_0xf089('0x40')]['id']},'attributes':['id',_0xf089('0x28'),_0xf089('0x55'),'description','moduleName',_0xf089('0x56'),'serverUrl',_0xf089('0x57')]})[_0xf089('0x24')](handleEntityNotFound(_0x1f06bb,null))[_0xf089('0x24')](function(_0x2a8f06){if(_0x2a8f06){_0x4bc3fc=_0x2a8f06[_0xf089('0x55')];_0x1af2ec=_0x2a8f06[_0xf089('0x57')];_0x2f5c0=_0x2a8f06[_0xf089('0x58')];_0x2d3589=_0x2a8f06[_0xf089('0x56')];var _0x295719=_0x2d3589[_0xf089('0x59')](-0x1);if(_0x295719==='/'){_0x2d3589=_0x2d3589['substring'](0x0,_0x2d3589['lastIndexOf'](_0x295719));}_0x4249ac=util[_0xf089('0x5a')](_0xf089('0x5b'),_0x2d3589);var _0x2983c6={'method':'GET','uri':_0x4249ac,'qs':{'operation':_0xf089('0x5c'),'username':_0x2a8f06[_0xf089('0x55')]},'json':!![]};return rp(_0x2983c6);}})[_0xf089('0x24')](function(_0x51dc6c){if(_0x51dc6c[_0xf089('0x5d')]){var _0x136086={'method':_0xf089('0x5e'),'uri':_0x4249ac,'form':{'operation':'login','username':_0x4bc3fc,'accessKey':md5(_0x51dc6c[_0xf089('0x5f')][_0xf089('0x60')]+_0x1af2ec)},'json':!![]};return rp(_0x136086);}})[_0xf089('0x24')](function(_0x315ea5){if(_0x315ea5[_0xf089('0x5d')]){var _0x142e24={'method':'GET','uri':_0x4249ac,'qs':{'operation':'describe','username':_0x4bc3fc,'sessionName':_0x315ea5['result'][_0xf089('0x61')],'elementType':_0x2f5c0},'json':!![]};return rp(_0x142e24);}})['then'](function(_0x59b3f8){if(_0x59b3f8[_0xf089('0x5d')]){var _0x4e5f4a=[_0xf089('0x62'),'reference','owner'];_['remove'](_0x59b3f8[_0xf089('0x5f')]['fields'],function(_0x2087ba){return _0x4e5f4a[_0xf089('0x63')](_0x2087ba[_0xf089('0x3b')][_0xf089('0x28')]);});_['remove'](_0x59b3f8[_0xf089('0x5f')][_0xf089('0x33')],function(_0x833022){return _0x833022[_0xf089('0x64')]===_0xf089('0x65');});return{'count':_0x59b3f8[_0xf089('0x5f')]['fields'][_0xf089('0x34')],'rows':_[_0xf089('0x2f')](_0x59b3f8[_0xf089('0x5f')][_0xf089('0x33')],function(_0x1833b8){return{'id':_0x1833b8[_0xf089('0x28')],'name':_0x1833b8[_0xf089('0x66')],'custom':_[_0xf089('0x67')](_0x1833b8['name'],'cf_')?!![]:![],'options':_0x1833b8['type'][_0xf089('0x28')]===_0xf089('0x68')&&_0x1833b8['type'][_0xf089('0x69')][_0xf089('0x34')]>0x0?_['map'](_0x1833b8[_0xf089('0x3b')][_0xf089('0x69')],function(_0xfefb60){return{'name':_0xfefb60['label'],'value':_0xfefb60[_0xf089('0x6a')]};}):[]};})};}})[_0xf089('0x24')](respondWithResult(_0x1f06bb,null))[_0xf089('0x3e')](function(_0x3ce7c0){console[_0xf089('0x6b')](_0xf089('0x6c')+_0x3ce7c0);var _0x2bb97d=_0x32afa2[_0xf089('0x30')][_0xf089('0x6d')]?0x1f4:_0x3ce7c0[_0xf089('0x6e')]||0x1f4;logger[_0xf089('0x26')](_0xf089('0x6f'),_0xf089('0x54'),_0x2bb97d,JSON['stringify'](_0x3ce7c0));delete _0x3ce7c0[_0xf089('0x28')];if(_0x2bb97d===0x191){_0x2bb97d=0x190;}_0x1f06bb[_0xf089('0x1b')](_0x2bb97d)[_0xf089('0x29')](_0x32afa2[_0xf089('0x30')][_0xf089('0x6d')]?{'message':_0xf089('0x70'),'statusCode':_0x3ce7c0[_0xf089('0x6e')]}:_0x3ce7c0);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 4d867b1..eda293a 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 _0xe1c4=['api','moment','bluebird','request-promise','path','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','util'];(function(_0x1591fc,_0x40fd0d){var _0x3eed47=function(_0x1b3c47){while(--_0x1b3c47){_0x1591fc['push'](_0x1591fc['shift']());}};_0x3eed47(++_0x40fd0d);}(_0xe1c4,0xaf));var _0x4e1c=function(_0x16957f,_0x33143b){_0x16957f=_0x16957f-0x0;var _0x155bf0=_0xe1c4[_0x16957f];return _0x155bf0;};'use strict';var _=require('lodash');var util=require(_0x4e1c('0x0'));var logger=require('../../config/logger')(_0x4e1c('0x1'));var moment=require(_0x4e1c('0x2'));var BPromise=require(_0x4e1c('0x3'));var rp=require(_0x4e1c('0x4'));var fs=require('fs');var path=require(_0x4e1c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4e1c('0x6'));var integrations=require(_0x4e1c('0x7'));module[_0x4e1c('0x8')]=function(_0x520b11,_0x1193ad){return _0x520b11[_0x4e1c('0x9')](_0x4e1c('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6453=['moment','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','exports','define','VtigerAccount','util','../../config/logger'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0x6453,0x148));var _0x3645=function(_0x1b92a6,_0x14444b){_0x1b92a6=_0x1b92a6-0x0;var _0x24be5b=_0x6453[_0x1b92a6];return _0x24be5b;};'use strict';var _=require('lodash');var util=require(_0x3645('0x0'));var logger=require(_0x3645('0x1'))('api');var moment=require(_0x3645('0x2'));var BPromise=require(_0x3645('0x3'));var rp=require(_0x3645('0x4'));var fs=require('fs');var path=require(_0x3645('0x5'));var rimraf=require(_0x3645('0x6'));var config=require('../../config/environment');var attributes=require(_0x3645('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x3645('0x8')]=function(_0x3d3552,_0x23f94d){return _0x3d3552[_0x3645('0x9')](_0x3645('0xa'),attributes,{'tableName':'int_vtiger_accounts','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 bb13b08..c3ebaf4 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 _0x7d25=['raw','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','include','map','model','then','ShowVtigerAccount','find'];(function(_0x127bb2,_0x849c5f){var _0x596034=function(_0x307a4c){while(--_0x307a4c){_0x127bb2['push'](_0x127bb2['shift']());}};_0x596034(++_0x849c5f);}(_0x7d25,0x8a));var _0x57d2=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x7d25[_0x1a7846];return _0x48049;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f43b2,_0x263d35,_0x147194){return new BPromise(function(_0x59ae87,_0x49e3e5){return client[_0x57d2('0x8')](_0x1f43b2,_0x147194)['then'](function(_0x3a1ec5){logger[_0x57d2('0x9')](_0x57d2('0xa'),_0x263d35,'request\x20sent');logger[_0x57d2('0xb')](_0x57d2('0xc'),_0x263d35,_0x57d2('0xd'),JSON[_0x57d2('0xe')](_0x3a1ec5));if(_0x3a1ec5[_0x57d2('0xf')]){if(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x10')]===0x1f4){logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);return _0x49e3e5(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);}logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')]['message']);return _0x59ae87(_0x3a1ec5['error'][_0x57d2('0x11')]);}else{logger[_0x57d2('0x9')]('VtigerAccount,\x20%s,\x20%s',_0x263d35,_0x57d2('0xd'));_0x59ae87(_0x3a1ec5[_0x57d2('0x12')]['message']);}})[_0x57d2('0x13')](function(_0x4986ad){logger[_0x57d2('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x263d35,_0x4986ad);_0x49e3e5(_0x4986ad);});});}exports[_0x57d2('0x14')]=function(_0x7d4cf1){var _0x2ecfdf=this;return new Promise(function(_0x4a94e3,_0x525cfc){return db[_0x57d2('0x15')][_0x57d2('0x16')]({'raw':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')]['where']||null:null,'attributes':_0x7d4cf1['options']?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x18')]||null:null,'limit':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x19')]||null:null,'include':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x1a')],function(_0x456fe1){return{'model':db[_0x456fe1[_0x57d2('0x1c')]],'as':_0x456fe1['as'],'attributes':_0x456fe1[_0x57d2('0x18')],'include':_0x456fe1['include']?_[_0x57d2('0x1b')](_0x456fe1[_0x57d2('0x1a')],function(_0x3c7de8){return{'model':db[_0x3c7de8[_0x57d2('0x1c')]],'as':_0x3c7de8['as'],'attributes':_0x3c7de8[_0x57d2('0x18')],'include':_0x3c7de8['include']?_[_0x57d2('0x1b')](_0x3c7de8[_0x57d2('0x1a')],function(_0x995928){return{'model':db[_0x995928[_0x57d2('0x1c')]],'as':_0x995928['as'],'attributes':_0x995928[_0x57d2('0x18')]};}):[]};}):[]};}):[]:[]})[_0x57d2('0x1d')](function(_0x9bdb11){logger['info'](_0x57d2('0x14'),_0x7d4cf1);logger[_0x57d2('0xb')](_0x57d2('0x14'),_0x7d4cf1,JSON[_0x57d2('0xe')](_0x9bdb11));_0x4a94e3(_0x9bdb11);})[_0x57d2('0x13')](function(_0x7c33f3){logger[_0x57d2('0xf')](_0x57d2('0x14'),_0x7c33f3[_0x57d2('0x11')],_0x7d4cf1);_0x525cfc(_0x2ecfdf[_0x57d2('0xf')](0x1f4,_0x7c33f3['message']));});});};exports[_0x57d2('0x1e')]=function(_0x3da926){var _0x26e052=this;return new Promise(function(_0x3e017c,_0x484597){return db[_0x57d2('0x15')][_0x57d2('0x1f')]({'raw':_0x3da926[_0x57d2('0x17')]?_0x3da926[_0x57d2('0x17')][_0x57d2('0x20')]===undefined?!![]:![]:!![],'where':_0x3da926[_0x57d2('0x17')]?_0x3da926[_0x57d2('0x17')][_0x57d2('0x21')]||null:null,'attributes':_0x3da926[_0x57d2('0x17')]?_0x3da926['options'][_0x57d2('0x18')]||null:null,'include':_0x3da926[_0x57d2('0x17')]?_0x3da926['options'][_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x3da926['options'][_0x57d2('0x1a')],function(_0x1c4ea5){return{'model':db[_0x1c4ea5[_0x57d2('0x1c')]],'as':_0x1c4ea5['as'],'attributes':_0x1c4ea5[_0x57d2('0x18')],'include':_0x1c4ea5[_0x57d2('0x1a')]?_['map'](_0x1c4ea5['include'],function(_0x581ebc){return{'model':db[_0x581ebc['model']],'as':_0x581ebc['as'],'attributes':_0x581ebc[_0x57d2('0x18')],'include':_0x581ebc[_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x581ebc[_0x57d2('0x1a')],function(_0x13beac){return{'model':db[_0x13beac['model']],'as':_0x13beac['as'],'attributes':_0x13beac[_0x57d2('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3378a6){logger[_0x57d2('0x9')](_0x57d2('0x1e'),_0x3da926);logger['debug'](_0x57d2('0x1e'),_0x3da926,JSON[_0x57d2('0xe')](_0x3378a6));_0x3e017c(_0x3378a6);})['catch'](function(_0xb33455){logger[_0x57d2('0xf')](_0x57d2('0x1e'),_0xb33455[_0x57d2('0x11')],_0x3da926);_0x484597(_0x26e052[_0x57d2('0xf')](0x1f4,_0xb33455[_0x57d2('0x11')]));});});}; \ No newline at end of file +var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','include','map','model','then','ShowVtigerAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0xcb91[_0x384231];return _0x2480bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetVtigerAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['VtigerAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowVtigerAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 80412aa..5472eae 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 _0xfc5b=['getDescriptions','post','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x63e481,_0x2e7f8d){var _0x2ad56f=function(_0x48f066){while(--_0x48f066){_0x63e481['push'](_0x63e481['shift']());}};_0x2ad56f(++_0x2e7f8d);}(_0xfc5b,0xd8));var _0xbfc5=function(_0x597e6c,_0x2700ee){_0x597e6c=_0x597e6c-0x0;var _0x5628e8=_0xfc5b[_0x597e6c];return _0x5628e8;};'use strict';var multer=require(_0xbfc5('0x0'));var util=require(_0xbfc5('0x1'));var path=require(_0xbfc5('0x2'));var timeout=require(_0xbfc5('0x3'));var express=require(_0xbfc5('0x4'));var router=express[_0xbfc5('0x5')]();var fs_extra=require(_0xbfc5('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xbfc5('0x7')]('/',auth[_0xbfc5('0x8')](),controller['index']);router[_0xbfc5('0x7')]('/:id',auth[_0xbfc5('0x8')](),controller[_0xbfc5('0x9')]);router[_0xbfc5('0x7')](_0xbfc5('0xa'),auth[_0xbfc5('0x8')](),controller[_0xbfc5('0xb')]);router[_0xbfc5('0x7')](_0xbfc5('0xc'),auth[_0xbfc5('0x8')](),controller[_0xbfc5('0xd')]);router[_0xbfc5('0x7')](_0xbfc5('0xe'),auth[_0xbfc5('0x8')](),controller[_0xbfc5('0xf')]);router[_0xbfc5('0x10')]('/',auth[_0xbfc5('0x8')](),controller['create']);router['put'](_0xbfc5('0x11'),auth['isAuthenticated'](),controller[_0xbfc5('0x12')]);router['delete'](_0xbfc5('0x11'),auth[_0xbfc5('0x8')](),controller[_0xbfc5('0x13')]);module[_0xbfc5('0x14')]=router; \ No newline at end of file +var _0x40c3=['/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','getSubjects'];(function(_0x182216,_0x3a50a0){var _0x48e881=function(_0x86e798){while(--_0x86e798){_0x182216['push'](_0x182216['shift']());}};_0x48e881(++_0x3a50a0);}(_0x40c3,0x71));var _0x340c=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x40c3[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require(_0x340c('0x0'));var util=require(_0x340c('0x1'));var path=require(_0x340c('0x2'));var timeout=require(_0x340c('0x3'));var express=require(_0x340c('0x4'));var router=express[_0x340c('0x5')]();var fs_extra=require(_0x340c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x340c('0x7'));var config=require(_0x340c('0x8'));var controller=require('./intVtigerConfiguration.controller');router[_0x340c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x340c('0x9')](_0x340c('0xa'),auth[_0x340c('0xb')](),controller['show']);router[_0x340c('0x9')]('/:id/fields',auth[_0x340c('0xb')](),controller['getFields']);router[_0x340c('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x340c('0xc')]);router[_0x340c('0x9')](_0x340c('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x340c('0xe')]('/',auth['isAuthenticated'](),controller[_0x340c('0xf')]);router[_0x340c('0x10')]('/:id',auth[_0x340c('0xb')](),controller[_0x340c('0x11')]);router[_0x340c('0x12')](_0x340c('0xa'),auth['isAuthenticated'](),controller[_0x340c('0x13')]);module[_0x340c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 6ae819c..d62b059 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 _0x7216=['exports','sequelize'];(function(_0xe0e0ec,_0xd7570a){var _0x1016a5=function(_0x433f5b){while(--_0x433f5b){_0xe0e0ec['push'](_0xe0e0ec['shift']());}};_0x1016a5(++_0xd7570a);}(_0x7216,0x1e7));var _0x6721=function(_0x170da8,_0x570526){_0x170da8=_0x170da8-0x0;var _0x1b76a0=_0x7216[_0x170da8];return _0x1b76a0;};'use strict';var Sequelize=require(_0x6721('0x0'));module[_0x6721('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1ffb=['sequelize','STRING'];(function(_0x35e117,_0x360a13){var _0x288bda=function(_0x57b8de){while(--_0x57b8de){_0x35e117['push'](_0x35e117['shift']());}};_0x288bda(++_0x360a13);}(_0x1ffb,0x1e2));var _0xb1ff=function(_0x471ceb,_0x5dc4d6){_0x471ceb=_0x471ceb-0x0;var _0x49a18d=_0x1ffb[_0x471ceb];return _0x49a18d;};'use strict';var Sequelize=require(_0xb1ff('0x0'));module['exports']={'name':{'type':Sequelize[_0xb1ff('0x1')]},'description':{'type':Sequelize[_0xb1ff('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index a443fe7..0eb990f 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 _0x715d=['request-promise','mustache','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','send','index','map','VtigerConfiguration','fieldName','type','key','name','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','getFields','findOne','params','VtigerField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3633fe,_0x74d2d6){var _0x1c9703=function(_0x420fc5){while(--_0x420fc5){_0x3633fe['push'](_0x3633fe['shift']());}};_0x1c9703(++_0x74d2d6);}(_0x715d,0x1d0));var _0xd715=function(_0x2c916b,_0x3dcbac){_0x2c916b=_0x2c916b-0x0;var _0x3d65ec=_0x715d[_0x2c916b];return _0x3d65ec;};'use strict';var emlformat=require(_0xd715('0x0'));var rimraf=require(_0xd715('0x1'));var zipdir=require(_0xd715('0x2'));var jsonpatch=require(_0xd715('0x3'));var rp=require(_0xd715('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd715('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd715('0x6'));var csv=require(_0xd715('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd715('0x8'));var squel=require('squel');var crypto=require(_0xd715('0x9'));var jsforce=require(_0xd715('0xa'));var deskjs=require(_0xd715('0xb'));var toCsv=require(_0xd715('0x7'));var querystring=require('querystring');var Papa=require(_0xd715('0xc'));var Redis=require(_0xd715('0xd'));var authService=require(_0xd715('0xe'));var qs=require(_0xd715('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd715('0x10'));var logger=require(_0xd715('0x11'))(_0xd715('0x12'));var utils=require('../../config/utils');var config=require(_0xd715('0x13'));var licenseUtil=require(_0xd715('0x14'));var db=require(_0xd715('0x15'))['db'];function respondWithStatusCode(_0x52c9ea,_0x481113){_0x481113=_0x481113||0xcc;return function(_0x4b877c){if(_0x4b877c){return _0x52c9ea[_0xd715('0x16')](_0x481113);}return _0x52c9ea[_0xd715('0x17')](_0x481113)[_0xd715('0x18')]();};}function respondWithResult(_0x258d2a,_0x5f3caf){_0x5f3caf=_0x5f3caf||0xc8;return function(_0x23600d){if(_0x23600d){return _0x258d2a['status'](_0x5f3caf)[_0xd715('0x19')](_0x23600d);}};}function respondWithFilteredResult(_0x2fcac7,_0x4356b3){return function(_0x3afa5f){if(_0x3afa5f){var _0xc6c76=typeof _0x4356b3[_0xd715('0x1a')]===_0xd715('0x1b')&&typeof _0x4356b3[_0xd715('0x1c')]===_0xd715('0x1b');var _0x27aba8=_0x3afa5f[_0xd715('0x1d')];var _0x301f05=_0xc6c76?0x0:_0x4356b3['offset'];var _0x3f375c=_0xc6c76?_0x3afa5f[_0xd715('0x1d')]:_0x4356b3[_0xd715('0x1a')]+_0x4356b3[_0xd715('0x1c')];var _0x564350;if(_0x3f375c>=_0x27aba8){_0x3f375c=_0x27aba8;_0x564350=0xc8;}else{_0x564350=0xce;}_0x2fcac7['status'](_0x564350);return _0x2fcac7[_0xd715('0x1e')](_0xd715('0x1f'),_0x301f05+'-'+_0x3f375c+'/'+_0x27aba8)['json'](_0x3afa5f);}return null;};}function patchUpdates(_0x5b6838){return function(_0x4c783a){try{jsonpatch[_0xd715('0x20')](_0x4c783a,_0x5b6838,!![]);}catch(_0x34c93f){return BPromise['reject'](_0x34c93f);}return _0x4c783a[_0xd715('0x21')]();};}function saveUpdates(_0x42d33c,_0x1b4d73){return function(_0x5e978f){if(_0x5e978f){return _0x5e978f[_0xd715('0x22')](_0x42d33c)[_0xd715('0x23')](function(_0x419ecc){return _0x419ecc;});}return null;};}function removeEntity(_0x390bdf,_0x2e9f23){return function(_0x5c11e7){if(_0x5c11e7){return _0x5c11e7['destroy']()[_0xd715('0x23')](function(){_0x390bdf[_0xd715('0x17')](0xcc)[_0xd715('0x18')]();});}};}function handleEntityNotFound(_0x178f07,_0x4a8260){return function(_0x5bd72c){if(!_0x5bd72c){_0x178f07['sendStatus'](0x194);}return _0x5bd72c;};}function handleError(_0x1995c2,_0x5919cc){_0x5919cc=_0x5919cc||0x1f4;return function(_0x3e52e9){logger[_0xd715('0x24')](_0x3e52e9[_0xd715('0x25')]);if(_0x3e52e9['name']){delete _0x3e52e9['name'];}_0x1995c2[_0xd715('0x17')](_0x5919cc)[_0xd715('0x26')](_0x3e52e9);};}exports[_0xd715('0x27')]=function(_0x915d9f,_0x463ec8){var _0x2218b1={},_0x44a2cf={},_0x373e68={'count':0x0,'rows':[]};var _0x1c14f5=_[_0xd715('0x28')](db[_0xd715('0x29')]['rawAttributes'],function(_0xab966b){return{'name':_0xab966b[_0xd715('0x2a')],'type':_0xab966b[_0xd715('0x2b')][_0xd715('0x2c')]};});_0x44a2cf['model']=_['map'](_0x1c14f5,_0xd715('0x2d'));_0x44a2cf[_0xd715('0x2e')]=_[_0xd715('0x2f')](_0x915d9f['query']);_0x44a2cf[_0xd715('0x30')]=_[_0xd715('0x31')](_0x44a2cf['model'],_0x44a2cf[_0xd715('0x2e')]);_0x2218b1[_0xd715('0x32')]=_[_0xd715('0x31')](_0x44a2cf['model'],qs[_0xd715('0x33')](_0x915d9f[_0xd715('0x2e')][_0xd715('0x33')]));_0x2218b1[_0xd715('0x32')]=_0x2218b1['attributes'][_0xd715('0x34')]?_0x2218b1['attributes']:_0x44a2cf[_0xd715('0x35')];if(!_0x915d9f['query'][_0xd715('0x36')]('nolimit')){_0x2218b1[_0xd715('0x1c')]=qs['limit'](_0x915d9f[_0xd715('0x2e')][_0xd715('0x1c')]);_0x2218b1['offset']=qs[_0xd715('0x1a')](_0x915d9f[_0xd715('0x2e')]['offset']);}_0x2218b1[_0xd715('0x37')]=qs[_0xd715('0x38')](_0x915d9f[_0xd715('0x2e')][_0xd715('0x38')]);_0x2218b1[_0xd715('0x39')]=qs[_0xd715('0x30')](_[_0xd715('0x3a')](_0x915d9f[_0xd715('0x2e')],_0x44a2cf[_0xd715('0x30')]),_0x1c14f5);if(_0x915d9f[_0xd715('0x2e')]['filter']){_0x2218b1[_0xd715('0x39')]=_[_0xd715('0x3b')](_0x2218b1[_0xd715('0x39')],{'$or':_[_0xd715('0x28')](_0x1c14f5,function(_0x2cb96e){if(_0x2cb96e[_0xd715('0x2b')]!=='VIRTUAL'){var _0x3afd69={};_0x3afd69[_0x2cb96e[_0xd715('0x2d')]]={'$like':'%'+_0x915d9f['query'][_0xd715('0x3c')]+'%'};return _0x3afd69;}})});}_0x2218b1=_[_0xd715('0x3b')]({},_0x2218b1,_0x915d9f[_0xd715('0x3d')]);var _0x2e2ee1={'where':_0x2218b1[_0xd715('0x39')]};return db[_0xd715('0x29')][_0xd715('0x1d')](_0x2e2ee1)['then'](function(_0x51a021){_0x373e68['count']=_0x51a021;if(_0x915d9f[_0xd715('0x2e')][_0xd715('0x3e')]){_0x2218b1[_0xd715('0x3f')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xd715('0x40')](_0x2218b1);})[_0xd715('0x23')](function(_0x44fba5){_0x373e68[_0xd715('0x41')]=_0x44fba5;return _0x373e68;})[_0xd715('0x23')](respondWithFilteredResult(_0x463ec8,_0x2218b1))[_0xd715('0x42')](handleError(_0x463ec8,null));};exports['show']=function(_0x3c872d,_0x4f162b){var _0x3a4b7d={'raw':![],'where':{'id':_0x3c872d['params']['id']}},_0x58e05b={};_0x58e05b[_0xd715('0x35')]=_[_0xd715('0x2f')](db[_0xd715('0x29')][_0xd715('0x43')]);_0x58e05b[_0xd715('0x2e')]=_[_0xd715('0x2f')](_0x3c872d[_0xd715('0x2e')]);_0x58e05b[_0xd715('0x30')]=_[_0xd715('0x31')](_0x58e05b['model'],_0x58e05b['query']);_0x3a4b7d[_0xd715('0x32')]=_[_0xd715('0x31')](_0x58e05b['model'],qs[_0xd715('0x33')](_0x3c872d[_0xd715('0x2e')][_0xd715('0x33')]));_0x3a4b7d[_0xd715('0x32')]=_0x3a4b7d[_0xd715('0x32')][_0xd715('0x34')]?_0x3a4b7d[_0xd715('0x32')]:_0x58e05b[_0xd715('0x35')];if(_0x3c872d[_0xd715('0x2e')][_0xd715('0x3e')]){_0x3a4b7d[_0xd715('0x3f')]=[{'all':!![]}];}_0x3a4b7d=_[_0xd715('0x3b')]({},_0x3a4b7d,_0x3c872d[_0xd715('0x3d')]);return db['VtigerConfiguration'][_0xd715('0x44')](_0x3a4b7d)[_0xd715('0x23')](handleEntityNotFound(_0x4f162b,null))[_0xd715('0x23')](respondWithResult(_0x4f162b,null))[_0xd715('0x42')](handleError(_0x4f162b,null));};exports[_0xd715('0x45')]=function(_0x51466f,_0x4290df){return db['VtigerConfiguration'][_0xd715('0x45')](_0x51466f[_0xd715('0x46')],{})[_0xd715('0x23')](respondWithResult(_0x4290df,0xc9))['catch'](handleError(_0x4290df,null));};exports[_0xd715('0x22')]=function(_0x236002,_0x32732d){if(_0x236002[_0xd715('0x46')]['id']){delete _0x236002['body']['id'];}return db[_0xd715('0x29')][_0xd715('0x44')]({'where':{'id':_0x236002['params']['id']}})[_0xd715('0x23')](handleEntityNotFound(_0x32732d,null))[_0xd715('0x23')](saveUpdates(_0x236002[_0xd715('0x46')],null))[_0xd715('0x23')](respondWithResult(_0x32732d,null))[_0xd715('0x42')](handleError(_0x32732d,null));};exports['destroy']=function(_0x321353,_0x400b3d){return db['VtigerConfiguration'][_0xd715('0x44')]({'where':{'id':_0x321353['params']['id']}})[_0xd715('0x23')](handleEntityNotFound(_0x400b3d,null))[_0xd715('0x23')](removeEntity(_0x400b3d,null))['catch'](handleError(_0x400b3d,null));};exports[_0xd715('0x47')]=function(_0x7a74f6,_0x1f24ff,_0x37bc84){var _0xe85d62={};var _0x1f9e5b={};var _0x55d8d3;var _0x3d0f2b;return db[_0xd715('0x29')][_0xd715('0x48')]({'where':{'id':_0x7a74f6[_0xd715('0x49')]['id']}})[_0xd715('0x23')](handleEntityNotFound(_0x1f24ff,null))[_0xd715('0x23')](function(_0x4f5505){if(_0x4f5505){_0x55d8d3=_0x4f5505;_0x1f9e5b[_0xd715('0x35')]=_[_0xd715('0x2f')](db[_0xd715('0x4a')]['rawAttributes']);_0x1f9e5b[_0xd715('0x2e')]=_['keys'](_0x7a74f6[_0xd715('0x2e')]);_0x1f9e5b[_0xd715('0x30')]=_[_0xd715('0x31')](_0x1f9e5b[_0xd715('0x35')],_0x1f9e5b[_0xd715('0x2e')]);_0xe85d62[_0xd715('0x32')]=_[_0xd715('0x31')](_0x1f9e5b['model'],qs[_0xd715('0x33')](_0x7a74f6['query'][_0xd715('0x33')]));_0xe85d62[_0xd715('0x32')]=_0xe85d62[_0xd715('0x32')][_0xd715('0x34')]?_0xe85d62[_0xd715('0x32')]:_0x1f9e5b[_0xd715('0x35')];_0xe85d62[_0xd715('0x37')]=qs['sort'](_0x7a74f6['query'][_0xd715('0x38')]);_0xe85d62[_0xd715('0x39')]=qs[_0xd715('0x30')](_['pick'](_0x7a74f6['query'],_0x1f9e5b[_0xd715('0x30')]));if(_0x7a74f6[_0xd715('0x2e')]['filter']){_0xe85d62[_0xd715('0x39')]=_[_0xd715('0x3b')](_0xe85d62[_0xd715('0x39')],{'$or':_[_0xd715('0x28')](_0xe85d62[_0xd715('0x32')],function(_0x15bbe6){var _0x10e064={};_0x10e064[_0x15bbe6]={'$like':'%'+_0x7a74f6[_0xd715('0x2e')]['filter']+'%'};return _0x10e064;})});}_0xe85d62=_[_0xd715('0x3b')]({},_0xe85d62,_0x7a74f6[_0xd715('0x3d')]);return _0x55d8d3[_0xd715('0x47')](_0xe85d62);}})[_0xd715('0x23')](function(_0x2238d3){if(_0x2238d3){_0x3d0f2b=_0x2238d3['length'];if(!_0x7a74f6[_0xd715('0x2e')][_0xd715('0x36')](_0xd715('0x4b'))){_0xe85d62[_0xd715('0x1c')]=qs[_0xd715('0x1c')](_0x7a74f6[_0xd715('0x2e')][_0xd715('0x1c')]);_0xe85d62[_0xd715('0x1a')]=qs[_0xd715('0x1a')](_0x7a74f6[_0xd715('0x2e')]['offset']);}return _0x55d8d3[_0xd715('0x47')](_0xe85d62);}})['then'](function(_0x353a84){if(_0x353a84){return _0x353a84?{'count':_0x3d0f2b,'rows':_0x353a84}:null;}})[_0xd715('0x23')](respondWithResult(_0x1f24ff,null))['catch'](handleError(_0x1f24ff,null));};exports[_0xd715('0x4c')]=function(_0x4f25a4,_0x3b84be,_0x4e6e06){var _0xc8394d={};var _0x2ceede={};var _0x1c0f96;var _0x5228f6;return db['VtigerConfiguration'][_0xd715('0x48')]({'where':{'id':_0x4f25a4[_0xd715('0x49')]['id']}})['then'](handleEntityNotFound(_0x3b84be,null))[_0xd715('0x23')](function(_0x4ec84e){if(_0x4ec84e){_0x1c0f96=_0x4ec84e;_0x2ceede[_0xd715('0x35')]=_[_0xd715('0x2f')](db['VtigerField']['rawAttributes']);_0x2ceede[_0xd715('0x2e')]=_[_0xd715('0x2f')](_0x4f25a4['query']);_0x2ceede[_0xd715('0x30')]=_[_0xd715('0x31')](_0x2ceede[_0xd715('0x35')],_0x2ceede['query']);_0xc8394d[_0xd715('0x32')]=_[_0xd715('0x31')](_0x2ceede[_0xd715('0x35')],qs[_0xd715('0x33')](_0x4f25a4[_0xd715('0x2e')][_0xd715('0x33')]));_0xc8394d[_0xd715('0x32')]=_0xc8394d[_0xd715('0x32')][_0xd715('0x34')]?_0xc8394d['attributes']:_0x2ceede[_0xd715('0x35')];_0xc8394d[_0xd715('0x37')]=qs[_0xd715('0x38')](_0x4f25a4['query'][_0xd715('0x38')]);_0xc8394d[_0xd715('0x39')]=qs['filters'](_[_0xd715('0x3a')](_0x4f25a4[_0xd715('0x2e')],_0x2ceede['filters']));if(_0x4f25a4[_0xd715('0x2e')][_0xd715('0x3c')]){_0xc8394d[_0xd715('0x39')]=_[_0xd715('0x3b')](_0xc8394d['where'],{'$or':_[_0xd715('0x28')](_0xc8394d[_0xd715('0x32')],function(_0xb1eda4){var _0x55446f={};_0x55446f[_0xb1eda4]={'$like':'%'+_0x4f25a4[_0xd715('0x2e')][_0xd715('0x3c')]+'%'};return _0x55446f;})});}_0xc8394d=_[_0xd715('0x3b')]({},_0xc8394d,_0x4f25a4['options']);return _0x1c0f96['getSubjects'](_0xc8394d);}})['then'](function(_0x1059d7){if(_0x1059d7){_0x5228f6=_0x1059d7[_0xd715('0x34')];if(!_0x4f25a4['query'][_0xd715('0x36')](_0xd715('0x4b'))){_0xc8394d[_0xd715('0x1c')]=qs[_0xd715('0x1c')](_0x4f25a4[_0xd715('0x2e')][_0xd715('0x1c')]);_0xc8394d[_0xd715('0x1a')]=qs[_0xd715('0x1a')](_0x4f25a4[_0xd715('0x2e')]['offset']);}return _0x1c0f96[_0xd715('0x4c')](_0xc8394d);}})[_0xd715('0x23')](function(_0x53b073){if(_0x53b073){return _0x53b073?{'count':_0x5228f6,'rows':_0x53b073}:null;}})[_0xd715('0x23')](respondWithResult(_0x3b84be,null))['catch'](handleError(_0x3b84be,null));};exports[_0xd715('0x4d')]=function(_0x24a8e5,_0x584fdd,_0x47e4df){var _0xa6459b={};var _0x166cbf={};var _0x910960;var _0xa41c63;return db[_0xd715('0x29')]['findOne']({'where':{'id':_0x24a8e5[_0xd715('0x49')]['id']}})[_0xd715('0x23')](handleEntityNotFound(_0x584fdd,null))[_0xd715('0x23')](function(_0xbf6edf){if(_0xbf6edf){_0x910960=_0xbf6edf;_0x166cbf['model']=_[_0xd715('0x2f')](db['VtigerField'][_0xd715('0x43')]);_0x166cbf['query']=_['keys'](_0x24a8e5['query']);_0x166cbf[_0xd715('0x30')]=_[_0xd715('0x31')](_0x166cbf[_0xd715('0x35')],_0x166cbf[_0xd715('0x2e')]);_0xa6459b['attributes']=_[_0xd715('0x31')](_0x166cbf['model'],qs['fields'](_0x24a8e5['query'][_0xd715('0x33')]));_0xa6459b['attributes']=_0xa6459b[_0xd715('0x32')][_0xd715('0x34')]?_0xa6459b[_0xd715('0x32')]:_0x166cbf[_0xd715('0x35')];_0xa6459b['order']=qs[_0xd715('0x38')](_0x24a8e5[_0xd715('0x2e')]['sort']);_0xa6459b['where']=qs['filters'](_[_0xd715('0x3a')](_0x24a8e5[_0xd715('0x2e')],_0x166cbf[_0xd715('0x30')]));if(_0x24a8e5[_0xd715('0x2e')][_0xd715('0x3c')]){_0xa6459b[_0xd715('0x39')]=_[_0xd715('0x3b')](_0xa6459b[_0xd715('0x39')],{'$or':_[_0xd715('0x28')](_0xa6459b[_0xd715('0x32')],function(_0x3cae2e){var _0x3e9dde={};_0x3e9dde[_0x3cae2e]={'$like':'%'+_0x24a8e5['query'][_0xd715('0x3c')]+'%'};return _0x3e9dde;})});}_0xa6459b=_['merge']({},_0xa6459b,_0x24a8e5[_0xd715('0x3d')]);return _0x910960[_0xd715('0x4d')](_0xa6459b);}})[_0xd715('0x23')](function(_0x4177e7){if(_0x4177e7){_0xa41c63=_0x4177e7['length'];if(!_0x24a8e5[_0xd715('0x2e')][_0xd715('0x36')](_0xd715('0x4b'))){_0xa6459b['limit']=qs[_0xd715('0x1c')](_0x24a8e5[_0xd715('0x2e')][_0xd715('0x1c')]);_0xa6459b[_0xd715('0x1a')]=qs[_0xd715('0x1a')](_0x24a8e5[_0xd715('0x2e')][_0xd715('0x1a')]);}return _0x910960[_0xd715('0x4d')](_0xa6459b);}})['then'](function(_0x845f57){if(_0x845f57){return _0x845f57?{'count':_0xa41c63,'rows':_0x845f57}:null;}})['then'](respondWithResult(_0x584fdd,null))[_0xd715('0x42')](handleError(_0x584fdd,null));}; \ No newline at end of file +var _0x7cda=['options','count','then','includeAll','include','findAll','rows','rawAttributes','length','catch','create','body','find','getFields','findOne','params','VtigerField','pick','getSubjects','getDescriptions','hasOwnProperty','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','destroy','error','name','send','map','VtigerConfiguration','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7cd('0x0'));var zipdir=require(_0xa7cd('0x1'));var jsonpatch=require(_0xa7cd('0x2'));var rp=require('request-promise');var moment=require(_0xa7cd('0x3'));var BPromise=require(_0xa7cd('0x4'));var Mustache=require('mustache');var util=require(_0xa7cd('0x5'));var path=require(_0xa7cd('0x6'));var sox=require(_0xa7cd('0x7'));var csv=require(_0xa7cd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa7cd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa7cd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa7cd('0xb'));var toCsv=require(_0xa7cd('0x8'));var querystring=require(_0xa7cd('0xc'));var Papa=require(_0xa7cd('0xd'));var Redis=require(_0xa7cd('0xe'));var authService=require(_0xa7cd('0xf'));var qs=require(_0xa7cd('0x10'));var as=require(_0xa7cd('0x11'));var hardwareService=require(_0xa7cd('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa7cd('0x13'));var config=require(_0xa7cd('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7cd('0x15'))['db'];function respondWithStatusCode(_0x4056ee,_0x57fb93){_0x57fb93=_0x57fb93||0xcc;return function(_0x3bbf3b){if(_0x3bbf3b){return _0x4056ee[_0xa7cd('0x16')](_0x57fb93);}return _0x4056ee[_0xa7cd('0x17')](_0x57fb93)['end']();};}function respondWithResult(_0x20c9ef,_0xff7938){_0xff7938=_0xff7938||0xc8;return function(_0x43abdf){if(_0x43abdf){return _0x20c9ef[_0xa7cd('0x17')](_0xff7938)[_0xa7cd('0x18')](_0x43abdf);}};}function respondWithFilteredResult(_0x2f53cd,_0x4e8710){return function(_0x5b2c7f){if(_0x5b2c7f){var _0x44d991=typeof _0x4e8710[_0xa7cd('0x19')]===_0xa7cd('0x1a')&&typeof _0x4e8710['limit']===_0xa7cd('0x1a');var _0x323e4b=_0x5b2c7f['count'];var _0x54b13f=_0x44d991?0x0:_0x4e8710[_0xa7cd('0x19')];var _0x2e1d4d=_0x44d991?_0x5b2c7f['count']:_0x4e8710[_0xa7cd('0x19')]+_0x4e8710[_0xa7cd('0x1b')];var _0x5b0e92;if(_0x2e1d4d>=_0x323e4b){_0x2e1d4d=_0x323e4b;_0x5b0e92=0xc8;}else{_0x5b0e92=0xce;}_0x2f53cd[_0xa7cd('0x17')](_0x5b0e92);return _0x2f53cd[_0xa7cd('0x1c')](_0xa7cd('0x1d'),_0x54b13f+'-'+_0x2e1d4d+'/'+_0x323e4b)['json'](_0x5b2c7f);}return null;};}function patchUpdates(_0x4c601c){return function(_0x57f8b4){try{jsonpatch[_0xa7cd('0x1e')](_0x57f8b4,_0x4c601c,!![]);}catch(_0x5dcd3b){return BPromise['reject'](_0x5dcd3b);}return _0x57f8b4[_0xa7cd('0x1f')]();};}function saveUpdates(_0x4dc29b,_0x2f20df){return function(_0x134612){if(_0x134612){return _0x134612['update'](_0x4dc29b)['then'](function(_0x49bd91){return _0x49bd91;});}return null;};}function removeEntity(_0x18f13a,_0x5c9891){return function(_0x242eab){if(_0x242eab){return _0x242eab[_0xa7cd('0x20')]()['then'](function(){_0x18f13a[_0xa7cd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x313e79,_0x4469eb){return function(_0x59d362){if(!_0x59d362){_0x313e79[_0xa7cd('0x16')](0x194);}return _0x59d362;};}function handleError(_0x4362a4,_0x53d3b7){_0x53d3b7=_0x53d3b7||0x1f4;return function(_0x5ba778){logger[_0xa7cd('0x21')](_0x5ba778['stack']);if(_0x5ba778[_0xa7cd('0x22')]){delete _0x5ba778['name'];}_0x4362a4[_0xa7cd('0x17')](_0x53d3b7)[_0xa7cd('0x23')](_0x5ba778);};}exports['index']=function(_0x484fdc,_0x5e384d){var _0x282f77={},_0x50b898={},_0x33fa77={'count':0x0,'rows':[]};var _0x27d159=_[_0xa7cd('0x24')](db[_0xa7cd('0x25')]['rawAttributes'],function(_0x11b7d7){return{'name':_0x11b7d7['fieldName'],'type':_0x11b7d7[_0xa7cd('0x26')][_0xa7cd('0x27')]};});_0x50b898['model']=_[_0xa7cd('0x24')](_0x27d159,_0xa7cd('0x22'));_0x50b898[_0xa7cd('0x28')]=_[_0xa7cd('0x29')](_0x484fdc[_0xa7cd('0x28')]);_0x50b898[_0xa7cd('0x2a')]=_[_0xa7cd('0x2b')](_0x50b898[_0xa7cd('0x2c')],_0x50b898[_0xa7cd('0x28')]);_0x282f77[_0xa7cd('0x2d')]=_['intersection'](_0x50b898[_0xa7cd('0x2c')],qs[_0xa7cd('0x2e')](_0x484fdc['query']['fields']));_0x282f77[_0xa7cd('0x2d')]=_0x282f77[_0xa7cd('0x2d')]['length']?_0x282f77[_0xa7cd('0x2d')]:_0x50b898[_0xa7cd('0x2c')];if(!_0x484fdc[_0xa7cd('0x28')]['hasOwnProperty'](_0xa7cd('0x2f'))){_0x282f77['limit']=qs[_0xa7cd('0x1b')](_0x484fdc[_0xa7cd('0x28')][_0xa7cd('0x1b')]);_0x282f77[_0xa7cd('0x19')]=qs['offset'](_0x484fdc['query'][_0xa7cd('0x19')]);}_0x282f77[_0xa7cd('0x30')]=qs[_0xa7cd('0x31')](_0x484fdc[_0xa7cd('0x28')][_0xa7cd('0x31')]);_0x282f77[_0xa7cd('0x32')]=qs[_0xa7cd('0x2a')](_['pick'](_0x484fdc[_0xa7cd('0x28')],_0x50b898[_0xa7cd('0x2a')]),_0x27d159);if(_0x484fdc[_0xa7cd('0x28')][_0xa7cd('0x33')]){_0x282f77[_0xa7cd('0x32')]=_[_0xa7cd('0x34')](_0x282f77[_0xa7cd('0x32')],{'$or':_[_0xa7cd('0x24')](_0x27d159,function(_0x490562){if(_0x490562[_0xa7cd('0x26')]!==_0xa7cd('0x35')){var _0x375088={};_0x375088[_0x490562[_0xa7cd('0x22')]]={'$like':'%'+_0x484fdc[_0xa7cd('0x28')][_0xa7cd('0x33')]+'%'};return _0x375088;}})});}_0x282f77=_[_0xa7cd('0x34')]({},_0x282f77,_0x484fdc[_0xa7cd('0x36')]);var _0x59aac5={'where':_0x282f77['where']};return db[_0xa7cd('0x25')][_0xa7cd('0x37')](_0x59aac5)[_0xa7cd('0x38')](function(_0x496cfb){_0x33fa77[_0xa7cd('0x37')]=_0x496cfb;if(_0x484fdc[_0xa7cd('0x28')][_0xa7cd('0x39')]){_0x282f77[_0xa7cd('0x3a')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xa7cd('0x3b')](_0x282f77);})[_0xa7cd('0x38')](function(_0x1c8958){_0x33fa77[_0xa7cd('0x3c')]=_0x1c8958;return _0x33fa77;})['then'](respondWithFilteredResult(_0x5e384d,_0x282f77))['catch'](handleError(_0x5e384d,null));};exports['show']=function(_0x3acc76,_0x42d77d){var _0x11faca={'raw':![],'where':{'id':_0x3acc76['params']['id']}},_0x54802d={};_0x54802d[_0xa7cd('0x2c')]=_[_0xa7cd('0x29')](db[_0xa7cd('0x25')][_0xa7cd('0x3d')]);_0x54802d[_0xa7cd('0x28')]=_[_0xa7cd('0x29')](_0x3acc76[_0xa7cd('0x28')]);_0x54802d[_0xa7cd('0x2a')]=_[_0xa7cd('0x2b')](_0x54802d[_0xa7cd('0x2c')],_0x54802d[_0xa7cd('0x28')]);_0x11faca[_0xa7cd('0x2d')]=_[_0xa7cd('0x2b')](_0x54802d[_0xa7cd('0x2c')],qs[_0xa7cd('0x2e')](_0x3acc76[_0xa7cd('0x28')]['fields']));_0x11faca[_0xa7cd('0x2d')]=_0x11faca[_0xa7cd('0x2d')][_0xa7cd('0x3e')]?_0x11faca[_0xa7cd('0x2d')]:_0x54802d[_0xa7cd('0x2c')];if(_0x3acc76[_0xa7cd('0x28')][_0xa7cd('0x39')]){_0x11faca['include']=[{'all':!![]}];}_0x11faca=_[_0xa7cd('0x34')]({},_0x11faca,_0x3acc76[_0xa7cd('0x36')]);return db[_0xa7cd('0x25')]['find'](_0x11faca)[_0xa7cd('0x38')](handleEntityNotFound(_0x42d77d,null))[_0xa7cd('0x38')](respondWithResult(_0x42d77d,null))[_0xa7cd('0x3f')](handleError(_0x42d77d,null));};exports[_0xa7cd('0x40')]=function(_0x119c99,_0x2a48d3){return db[_0xa7cd('0x25')][_0xa7cd('0x40')](_0x119c99[_0xa7cd('0x41')],{})['then'](respondWithResult(_0x2a48d3,0xc9))['catch'](handleError(_0x2a48d3,null));};exports['update']=function(_0x35e023,_0xf668be){if(_0x35e023[_0xa7cd('0x41')]['id']){delete _0x35e023['body']['id'];}return db[_0xa7cd('0x25')][_0xa7cd('0x42')]({'where':{'id':_0x35e023['params']['id']}})['then'](handleEntityNotFound(_0xf668be,null))['then'](saveUpdates(_0x35e023['body'],null))[_0xa7cd('0x38')](respondWithResult(_0xf668be,null))[_0xa7cd('0x3f')](handleError(_0xf668be,null));};exports[_0xa7cd('0x20')]=function(_0x11f0d0,_0xb98e4d){return db[_0xa7cd('0x25')][_0xa7cd('0x42')]({'where':{'id':_0x11f0d0['params']['id']}})[_0xa7cd('0x38')](handleEntityNotFound(_0xb98e4d,null))['then'](removeEntity(_0xb98e4d,null))[_0xa7cd('0x3f')](handleError(_0xb98e4d,null));};exports[_0xa7cd('0x43')]=function(_0x1a0e24,_0x1c8648,_0x447f99){var _0x351c94={};var _0x1490bd={};var _0x4c5a03;var _0x1c3bf0;return db[_0xa7cd('0x25')][_0xa7cd('0x44')]({'where':{'id':_0x1a0e24[_0xa7cd('0x45')]['id']}})[_0xa7cd('0x38')](handleEntityNotFound(_0x1c8648,null))[_0xa7cd('0x38')](function(_0x140ef6){if(_0x140ef6){_0x4c5a03=_0x140ef6;_0x1490bd['model']=_['keys'](db[_0xa7cd('0x46')][_0xa7cd('0x3d')]);_0x1490bd[_0xa7cd('0x28')]=_[_0xa7cd('0x29')](_0x1a0e24['query']);_0x1490bd[_0xa7cd('0x2a')]=_[_0xa7cd('0x2b')](_0x1490bd[_0xa7cd('0x2c')],_0x1490bd[_0xa7cd('0x28')]);_0x351c94['attributes']=_['intersection'](_0x1490bd['model'],qs[_0xa7cd('0x2e')](_0x1a0e24[_0xa7cd('0x28')][_0xa7cd('0x2e')]));_0x351c94[_0xa7cd('0x2d')]=_0x351c94['attributes'][_0xa7cd('0x3e')]?_0x351c94[_0xa7cd('0x2d')]:_0x1490bd[_0xa7cd('0x2c')];_0x351c94[_0xa7cd('0x30')]=qs['sort'](_0x1a0e24[_0xa7cd('0x28')][_0xa7cd('0x31')]);_0x351c94['where']=qs['filters'](_[_0xa7cd('0x47')](_0x1a0e24['query'],_0x1490bd[_0xa7cd('0x2a')]));if(_0x1a0e24[_0xa7cd('0x28')]['filter']){_0x351c94[_0xa7cd('0x32')]=_['merge'](_0x351c94['where'],{'$or':_[_0xa7cd('0x24')](_0x351c94[_0xa7cd('0x2d')],function(_0x56027d){var _0x17dbbc={};_0x17dbbc[_0x56027d]={'$like':'%'+_0x1a0e24[_0xa7cd('0x28')][_0xa7cd('0x33')]+'%'};return _0x17dbbc;})});}_0x351c94=_[_0xa7cd('0x34')]({},_0x351c94,_0x1a0e24['options']);return _0x4c5a03[_0xa7cd('0x43')](_0x351c94);}})[_0xa7cd('0x38')](function(_0x196209){if(_0x196209){_0x1c3bf0=_0x196209[_0xa7cd('0x3e')];if(!_0x1a0e24[_0xa7cd('0x28')]['hasOwnProperty'](_0xa7cd('0x2f'))){_0x351c94[_0xa7cd('0x1b')]=qs['limit'](_0x1a0e24['query']['limit']);_0x351c94[_0xa7cd('0x19')]=qs[_0xa7cd('0x19')](_0x1a0e24[_0xa7cd('0x28')]['offset']);}return _0x4c5a03[_0xa7cd('0x43')](_0x351c94);}})[_0xa7cd('0x38')](function(_0x3f55a2){if(_0x3f55a2){return _0x3f55a2?{'count':_0x1c3bf0,'rows':_0x3f55a2}:null;}})[_0xa7cd('0x38')](respondWithResult(_0x1c8648,null))['catch'](handleError(_0x1c8648,null));};exports['getSubjects']=function(_0xa12060,_0x1f40c3,_0x24f38a){var _0x43ec91={};var _0x231edd={};var _0x298fe9;var _0x265e47;return db[_0xa7cd('0x25')][_0xa7cd('0x44')]({'where':{'id':_0xa12060[_0xa7cd('0x45')]['id']}})[_0xa7cd('0x38')](handleEntityNotFound(_0x1f40c3,null))['then'](function(_0x5114af){if(_0x5114af){_0x298fe9=_0x5114af;_0x231edd['model']=_['keys'](db[_0xa7cd('0x46')][_0xa7cd('0x3d')]);_0x231edd['query']=_[_0xa7cd('0x29')](_0xa12060['query']);_0x231edd['filters']=_[_0xa7cd('0x2b')](_0x231edd[_0xa7cd('0x2c')],_0x231edd['query']);_0x43ec91[_0xa7cd('0x2d')]=_['intersection'](_0x231edd[_0xa7cd('0x2c')],qs[_0xa7cd('0x2e')](_0xa12060['query'][_0xa7cd('0x2e')]));_0x43ec91[_0xa7cd('0x2d')]=_0x43ec91[_0xa7cd('0x2d')][_0xa7cd('0x3e')]?_0x43ec91[_0xa7cd('0x2d')]:_0x231edd[_0xa7cd('0x2c')];_0x43ec91[_0xa7cd('0x30')]=qs[_0xa7cd('0x31')](_0xa12060['query']['sort']);_0x43ec91['where']=qs[_0xa7cd('0x2a')](_[_0xa7cd('0x47')](_0xa12060[_0xa7cd('0x28')],_0x231edd[_0xa7cd('0x2a')]));if(_0xa12060[_0xa7cd('0x28')][_0xa7cd('0x33')]){_0x43ec91[_0xa7cd('0x32')]=_[_0xa7cd('0x34')](_0x43ec91['where'],{'$or':_[_0xa7cd('0x24')](_0x43ec91[_0xa7cd('0x2d')],function(_0x1e0a5d){var _0x5c29fd={};_0x5c29fd[_0x1e0a5d]={'$like':'%'+_0xa12060[_0xa7cd('0x28')][_0xa7cd('0x33')]+'%'};return _0x5c29fd;})});}_0x43ec91=_[_0xa7cd('0x34')]({},_0x43ec91,_0xa12060[_0xa7cd('0x36')]);return _0x298fe9[_0xa7cd('0x48')](_0x43ec91);}})[_0xa7cd('0x38')](function(_0x115cd4){if(_0x115cd4){_0x265e47=_0x115cd4[_0xa7cd('0x3e')];if(!_0xa12060[_0xa7cd('0x28')]['hasOwnProperty']('nolimit')){_0x43ec91[_0xa7cd('0x1b')]=qs[_0xa7cd('0x1b')](_0xa12060[_0xa7cd('0x28')][_0xa7cd('0x1b')]);_0x43ec91[_0xa7cd('0x19')]=qs[_0xa7cd('0x19')](_0xa12060['query'][_0xa7cd('0x19')]);}return _0x298fe9[_0xa7cd('0x48')](_0x43ec91);}})[_0xa7cd('0x38')](function(_0x4f918e){if(_0x4f918e){return _0x4f918e?{'count':_0x265e47,'rows':_0x4f918e}:null;}})[_0xa7cd('0x38')](respondWithResult(_0x1f40c3,null))[_0xa7cd('0x3f')](handleError(_0x1f40c3,null));};exports[_0xa7cd('0x49')]=function(_0x2c92ca,_0x1ca4a2,_0x231ccb){var _0x338c7d={};var _0x2c6d55={};var _0x2f528c;var _0x35e153;return db[_0xa7cd('0x25')]['findOne']({'where':{'id':_0x2c92ca['params']['id']}})[_0xa7cd('0x38')](handleEntityNotFound(_0x1ca4a2,null))['then'](function(_0x4f9dae){if(_0x4f9dae){_0x2f528c=_0x4f9dae;_0x2c6d55[_0xa7cd('0x2c')]=_[_0xa7cd('0x29')](db[_0xa7cd('0x46')][_0xa7cd('0x3d')]);_0x2c6d55['query']=_['keys'](_0x2c92ca[_0xa7cd('0x28')]);_0x2c6d55[_0xa7cd('0x2a')]=_[_0xa7cd('0x2b')](_0x2c6d55[_0xa7cd('0x2c')],_0x2c6d55['query']);_0x338c7d[_0xa7cd('0x2d')]=_[_0xa7cd('0x2b')](_0x2c6d55[_0xa7cd('0x2c')],qs['fields'](_0x2c92ca[_0xa7cd('0x28')][_0xa7cd('0x2e')]));_0x338c7d[_0xa7cd('0x2d')]=_0x338c7d[_0xa7cd('0x2d')][_0xa7cd('0x3e')]?_0x338c7d['attributes']:_0x2c6d55[_0xa7cd('0x2c')];_0x338c7d[_0xa7cd('0x30')]=qs[_0xa7cd('0x31')](_0x2c92ca[_0xa7cd('0x28')][_0xa7cd('0x31')]);_0x338c7d['where']=qs[_0xa7cd('0x2a')](_['pick'](_0x2c92ca[_0xa7cd('0x28')],_0x2c6d55[_0xa7cd('0x2a')]));if(_0x2c92ca['query'][_0xa7cd('0x33')]){_0x338c7d[_0xa7cd('0x32')]=_['merge'](_0x338c7d[_0xa7cd('0x32')],{'$or':_[_0xa7cd('0x24')](_0x338c7d[_0xa7cd('0x2d')],function(_0x2f76b1){var _0xcf8d87={};_0xcf8d87[_0x2f76b1]={'$like':'%'+_0x2c92ca['query'][_0xa7cd('0x33')]+'%'};return _0xcf8d87;})});}_0x338c7d=_['merge']({},_0x338c7d,_0x2c92ca['options']);return _0x2f528c[_0xa7cd('0x49')](_0x338c7d);}})[_0xa7cd('0x38')](function(_0x3af7ae){if(_0x3af7ae){_0x35e153=_0x3af7ae[_0xa7cd('0x3e')];if(!_0x2c92ca[_0xa7cd('0x28')][_0xa7cd('0x4a')](_0xa7cd('0x2f'))){_0x338c7d[_0xa7cd('0x1b')]=qs['limit'](_0x2c92ca[_0xa7cd('0x28')][_0xa7cd('0x1b')]);_0x338c7d[_0xa7cd('0x19')]=qs['offset'](_0x2c92ca[_0xa7cd('0x28')][_0xa7cd('0x19')]);}return _0x2f528c[_0xa7cd('0x49')](_0x338c7d);}})[_0xa7cd('0x38')](function(_0x561f7e){if(_0x561f7e){return _0x561f7e?{'count':_0x35e153,'rows':_0x561f7e}:null;}})['then'](respondWithResult(_0x1ca4a2,null))[_0xa7cd('0x3f')](handleError(_0x1ca4a2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index a268c35..4161832 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 _0x8cf2=['bluebird','request-promise','rimraf','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x8cf2,0x8a));var _0x28cf=function(_0x2f3ca4,_0x12c681){_0x2f3ca4=_0x2f3ca4-0x0;var _0x2343ad=_0x8cf2[_0x2f3ca4];return _0x2343ad;};'use strict';var _=require(_0x28cf('0x0'));var util=require(_0x28cf('0x1'));var logger=require(_0x28cf('0x2'))(_0x28cf('0x3'));var moment=require(_0x28cf('0x4'));var BPromise=require(_0x28cf('0x5'));var rp=require(_0x28cf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28cf('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x28cf('0x8')]=function(_0x1cec0a,_0x24e7d7){return _0x1cec0a['define'](_0x28cf('0x9'),attributes,{'tableName':_0x28cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa75f=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x42e283,_0x40dfc7){var _0x2e36d6=function(_0x2a30e6){while(--_0x2a30e6){_0x42e283['push'](_0x42e283['shift']());}};_0x2e36d6(++_0x40dfc7);}(_0xa75f,0x172));var _0xfa75=function(_0x14a8d2,_0x3b47a5){_0x14a8d2=_0x14a8d2-0x0;var _0x166333=_0xa75f[_0x14a8d2];return _0x166333;};'use strict';var _=require(_0xfa75('0x0'));var util=require(_0xfa75('0x1'));var logger=require(_0xfa75('0x2'))(_0xfa75('0x3'));var moment=require(_0xfa75('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa75('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa75('0x6'));var config=require(_0xfa75('0x7'));var attributes=require(_0xfa75('0x8'));module[_0xfa75('0x9')]=function(_0xb26f4b,_0x1a5b5d){return _0xb26f4b[_0xfa75('0xa')](_0xfa75('0xb'),attributes,{'tableName':_0xfa75('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 f350a79..6338020 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 _0x7fca=['request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x7fca,0x147));var _0xa7fc=function(_0x4c1fe1,_0x238312){_0x4c1fe1=_0x4c1fe1-0x0;var _0x12e63c=_0x7fca[_0x4c1fe1];return _0x12e63c;};'use strict';var _=require(_0xa7fc('0x0'));var util=require(_0xa7fc('0x1'));var moment=require(_0xa7fc('0x2'));var BPromise=require(_0xa7fc('0x3'));var rs=require(_0xa7fc('0x4'));var fs=require('fs');var Redis=require(_0xa7fc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7fc('0x6'));var logger=require(_0xa7fc('0x7'))(_0xa7fc('0x8'));var config=require('../../config/environment');var jayson=require(_0xa7fc('0x9'));var client=jayson['client'][_0xa7fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47c2a7,_0x32ea27,_0x939d7e){return new BPromise(function(_0xc03127,_0x3210b3){return client['request'](_0x47c2a7,_0x939d7e)[_0xa7fc('0xb')](function(_0xb681d0){logger['info'](_0xa7fc('0xc'),_0x32ea27,_0xa7fc('0xd'));logger[_0xa7fc('0xe')](_0xa7fc('0xf'),_0x32ea27,_0xa7fc('0xd'),JSON['stringify'](_0xb681d0));if(_0xb681d0[_0xa7fc('0x10')]){if(_0xb681d0['error'][_0xa7fc('0x11')]===0x1f4){logger[_0xa7fc('0x10')](_0xa7fc('0xc'),_0x32ea27,_0xb681d0[_0xa7fc('0x10')][_0xa7fc('0x12')]);return _0x3210b3(_0xb681d0[_0xa7fc('0x10')][_0xa7fc('0x12')]);}logger['error'](_0xa7fc('0xc'),_0x32ea27,_0xb681d0[_0xa7fc('0x10')]['message']);return _0xc03127(_0xb681d0[_0xa7fc('0x10')][_0xa7fc('0x12')]);}else{logger['info'](_0xa7fc('0xc'),_0x32ea27,_0xa7fc('0xd'));_0xc03127(_0xb681d0[_0xa7fc('0x13')][_0xa7fc('0x12')]);}})['catch'](function(_0x592783){logger[_0xa7fc('0x10')](_0xa7fc('0xc'),_0x32ea27,_0x592783);_0x3210b3(_0x592783);});});} \ No newline at end of file +var _0xfebc=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','lodash'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0xfebc,0xfc));var _0xcfeb=function(_0x3d3fa2,_0x104433){_0x3d3fa2=_0x3d3fa2-0x0;var _0x556091=_0xfebc[_0x3d3fa2];return _0x556091;};'use strict';var _=require(_0xcfeb('0x0'));var util=require(_0xcfeb('0x1'));var moment=require('moment');var BPromise=require(_0xcfeb('0x2'));var rs=require(_0xcfeb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfeb('0x4'))['db'];var utils=require(_0xcfeb('0x5'));var logger=require(_0xcfeb('0x6'))(_0xcfeb('0x7'));var config=require('../../config/environment');var jayson=require(_0xcfeb('0x8'));var client=jayson[_0xcfeb('0x9')][_0xcfeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8bcc0d,_0x4f5e85,_0x2d3914){return new BPromise(function(_0x251f95,_0x436290){return client[_0xcfeb('0xb')](_0x8bcc0d,_0x2d3914)[_0xcfeb('0xc')](function(_0x5cd965){logger[_0xcfeb('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x4f5e85,_0xcfeb('0xe'));logger[_0xcfeb('0xf')](_0xcfeb('0x10'),_0x4f5e85,_0xcfeb('0xe'),JSON[_0xcfeb('0x11')](_0x5cd965));if(_0x5cd965['error']){if(_0x5cd965[_0xcfeb('0x12')][_0xcfeb('0x13')]===0x1f4){logger['error'](_0xcfeb('0x14'),_0x4f5e85,_0x5cd965[_0xcfeb('0x12')][_0xcfeb('0x15')]);return _0x436290(_0x5cd965[_0xcfeb('0x12')][_0xcfeb('0x15')]);}logger['error'](_0xcfeb('0x14'),_0x4f5e85,_0x5cd965[_0xcfeb('0x12')][_0xcfeb('0x15')]);return _0x251f95(_0x5cd965[_0xcfeb('0x12')]['message']);}else{logger[_0xcfeb('0xd')](_0xcfeb('0x14'),_0x4f5e85,_0xcfeb('0xe'));_0x251f95(_0x5cd965[_0xcfeb('0x16')][_0xcfeb('0x15')]);}})['catch'](function(_0x2e4648){logger[_0xcfeb('0x12')](_0xcfeb('0x14'),_0x4f5e85,_0x2e4648);_0x436290(_0x2e4648);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index ed88ac8..4154442 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 _0xbd5a=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','post','put','update','delete','destroy'];(function(_0x4826d6,_0x2cb93f){var _0x40cdc4=function(_0xe0720){while(--_0xe0720){_0x4826d6['push'](_0x4826d6['shift']());}};_0x40cdc4(++_0x2cb93f);}(_0xbd5a,0xa1));var _0xabd5=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xbd5a[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require(_0xabd5('0x0'));var util=require(_0xabd5('0x1'));var path=require(_0xabd5('0x2'));var timeout=require(_0xabd5('0x3'));var express=require(_0xabd5('0x4'));var router=express[_0xabd5('0x5')]();var fs_extra=require(_0xabd5('0x6'));var auth=require(_0xabd5('0x7'));var interaction=require(_0xabd5('0x8'));var config=require('../../config/environment');var controller=require(_0xabd5('0x9'));router[_0xabd5('0xa')]('/',auth[_0xabd5('0xb')](),controller[_0xabd5('0xc')]);router[_0xabd5('0xa')]('/:id',auth[_0xabd5('0xb')](),controller[_0xabd5('0xd')]);router[_0xabd5('0xe')]('/',auth[_0xabd5('0xb')](),controller['create']);router[_0xabd5('0xf')]('/:id',auth[_0xabd5('0xb')](),controller[_0xabd5('0x10')]);router[_0xabd5('0x11')]('/:id',auth[_0xabd5('0xb')](),controller[_0xabd5('0x12')]);module[_0xabd5('0x13')]=router; \ No newline at end of file +var _0x2ec7=['../../config/environment','./intVtigerField.controller','index','get','/:id','isAuthenticated','post','create','put','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x185ba5,_0x23ea0b){var _0x1811d2=function(_0x42ff66){while(--_0x42ff66){_0x185ba5['push'](_0x185ba5['shift']());}};_0x1811d2(++_0x23ea0b);}(_0x2ec7,0x14e));var _0x72ec=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x2ec7[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0x72ec('0x0'));var util=require('util');var path=require(_0x72ec('0x1'));var timeout=require(_0x72ec('0x2'));var express=require(_0x72ec('0x3'));var router=express[_0x72ec('0x4')]();var fs_extra=require(_0x72ec('0x5'));var auth=require(_0x72ec('0x6'));var interaction=require(_0x72ec('0x7'));var config=require(_0x72ec('0x8'));var controller=require(_0x72ec('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x72ec('0xa')]);router[_0x72ec('0xb')](_0x72ec('0xc'),auth[_0x72ec('0xd')](),controller['show']);router[_0x72ec('0xe')]('/',auth[_0x72ec('0xd')](),controller[_0x72ec('0xf')]);router[_0x72ec('0x10')](_0x72ec('0xc'),auth[_0x72ec('0xd')](),controller['update']);router['delete'](_0x72ec('0xc'),auth[_0x72ec('0xd')](),controller[_0x72ec('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 265c368..932febf 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 _0xe442=['string','STRING','BOOLEAN','exports','ENUM','variable','keyValue'];(function(_0x4c7566,_0x5d23ba){var _0x303b99=function(_0x409471){while(--_0x409471){_0x4c7566['push'](_0x4c7566['shift']());}};_0x303b99(++_0x5d23ba);}(_0xe442,0x122));var _0x2e44=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xe442[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require('sequelize');module[_0x2e44('0x0')]={'type':{'type':Sequelize[_0x2e44('0x1')]('string',_0x2e44('0x2'),'customVariable',_0x2e44('0x3'),'picklist'),'defaultValue':_0x2e44('0x4')},'content':{'type':Sequelize[_0x2e44('0x5')]},'key':{'type':Sequelize[_0x2e44('0x5')]},'keyType':{'type':Sequelize[_0x2e44('0x1')](_0x2e44('0x4'),_0x2e44('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2e44('0x5')]},'nameField':{'type':Sequelize[_0x2e44('0x5')]},'customField':{'type':Sequelize[_0x2e44('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2e44('0x5')]}}; \ No newline at end of file +var _0xdc96=['exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x40fd6d,_0x3d49f3){var _0x278fcf=function(_0x4e3346){while(--_0x4e3346){_0x40fd6d['push'](_0x40fd6d['shift']());}};_0x278fcf(++_0x3d49f3);}(_0xdc96,0xaf));var _0x6dc9=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xdc96[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module[_0x6dc9('0x0')]={'type':{'type':Sequelize[_0x6dc9('0x1')](_0x6dc9('0x2'),_0x6dc9('0x3'),_0x6dc9('0x4'),'keyValue',_0x6dc9('0x5')),'defaultValue':_0x6dc9('0x2')},'content':{'type':Sequelize[_0x6dc9('0x6')]},'key':{'type':Sequelize[_0x6dc9('0x6')]},'keyType':{'type':Sequelize[_0x6dc9('0x1')](_0x6dc9('0x2'),_0x6dc9('0x3'),_0x6dc9('0x4'))},'keyContent':{'type':Sequelize[_0x6dc9('0x6')]},'idField':{'type':Sequelize[_0x6dc9('0x6')]},'nameField':{'type':Sequelize[_0x6dc9('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index f9c05c2..0599c7d 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 _0x466b=['body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','then','error','stack','send','index','VtigerField','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','create'];(function(_0x4ae4cc,_0x457c1){var _0x1cec04=function(_0x16cefa){while(--_0x16cefa){_0x4ae4cc['push'](_0x4ae4cc['shift']());}};_0x1cec04(++_0x457c1);}(_0x466b,0x94));var _0xb466=function(_0xcd6601,_0x1e8361){_0xcd6601=_0xcd6601-0x0;var _0x3caf90=_0x466b[_0xcd6601];return _0x3caf90;};'use strict';var emlformat=require(_0xb466('0x0'));var rimraf=require(_0xb466('0x1'));var zipdir=require(_0xb466('0x2'));var jsonpatch=require(_0xb466('0x3'));var rp=require('request-promise');var moment=require(_0xb466('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb466('0x5'));var util=require('util');var path=require(_0xb466('0x6'));var sox=require(_0xb466('0x7'));var csv=require(_0xb466('0x8'));var ejs=require(_0xb466('0x9'));var fs=require('fs');var fs_extra=require(_0xb466('0xa'));var _=require(_0xb466('0xb'));var squel=require(_0xb466('0xc'));var crypto=require(_0xb466('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb466('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb466('0xf'));var Papa=require(_0xb466('0x10'));var Redis=require('ioredis');var authService=require(_0xb466('0x11'));var qs=require(_0xb466('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb466('0x13'));var logger=require('../../config/logger')(_0xb466('0x14'));var utils=require(_0xb466('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25c697,_0x2db2af){_0x2db2af=_0x2db2af||0xcc;return function(_0x4eeaf7){if(_0x4eeaf7){return _0x25c697[_0xb466('0x16')](_0x2db2af);}return _0x25c697['status'](_0x2db2af)['end']();};}function respondWithResult(_0x148c16,_0x3f6092){_0x3f6092=_0x3f6092||0xc8;return function(_0x22d286){if(_0x22d286){return _0x148c16[_0xb466('0x17')](_0x3f6092)[_0xb466('0x18')](_0x22d286);}};}function respondWithFilteredResult(_0x124d7f,_0x5deca3){return function(_0x2d4aac){if(_0x2d4aac){var _0x2ec635=typeof _0x5deca3[_0xb466('0x19')]==='undefined'&&typeof _0x5deca3[_0xb466('0x1a')]===_0xb466('0x1b');var _0x4ba9b5=_0x2d4aac['count'];var _0x468ce4=_0x2ec635?0x0:_0x5deca3['offset'];var _0xb7ce70=_0x2ec635?_0x2d4aac[_0xb466('0x1c')]:_0x5deca3['offset']+_0x5deca3['limit'];var _0x1d2977;if(_0xb7ce70>=_0x4ba9b5){_0xb7ce70=_0x4ba9b5;_0x1d2977=0xc8;}else{_0x1d2977=0xce;}_0x124d7f[_0xb466('0x17')](_0x1d2977);return _0x124d7f['set'](_0xb466('0x1d'),_0x468ce4+'-'+_0xb7ce70+'/'+_0x4ba9b5)[_0xb466('0x18')](_0x2d4aac);}return null;};}function patchUpdates(_0x49e855){return function(_0x2689ee){try{jsonpatch[_0xb466('0x1e')](_0x2689ee,_0x49e855,!![]);}catch(_0x2a42ff){return BPromise['reject'](_0x2a42ff);}return _0x2689ee[_0xb466('0x1f')]();};}function saveUpdates(_0x5b3757,_0xcec60d){return function(_0x41cebf){if(_0x41cebf){return _0x41cebf[_0xb466('0x20')](_0x5b3757)['then'](function(_0x2fe29c){return _0x2fe29c;});}return null;};}function removeEntity(_0x4f64b7,_0x5edd45){return function(_0x1f2d5b){if(_0x1f2d5b){return _0x1f2d5b[_0xb466('0x21')]()[_0xb466('0x22')](function(){_0x4f64b7[_0xb466('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39493a,_0x155a85){return function(_0x31e89f){if(!_0x31e89f){_0x39493a['sendStatus'](0x194);}return _0x31e89f;};}function handleError(_0x494d5d,_0x5bdb4b){_0x5bdb4b=_0x5bdb4b||0x1f4;return function(_0x2c6b14){logger[_0xb466('0x23')](_0x2c6b14[_0xb466('0x24')]);if(_0x2c6b14['name']){delete _0x2c6b14['name'];}_0x494d5d[_0xb466('0x17')](_0x5bdb4b)[_0xb466('0x25')](_0x2c6b14);};}exports[_0xb466('0x26')]=function(_0x2ec002,_0x2c4df6){var _0x3ac64e={},_0x282aaa={},_0x5674cd={'count':0x0,'rows':[]};var _0x131851=_['map'](db[_0xb466('0x27')][_0xb466('0x28')],function(_0x39bfd6){return{'name':_0x39bfd6[_0xb466('0x29')],'type':_0x39bfd6[_0xb466('0x2a')][_0xb466('0x2b')]};});_0x282aaa[_0xb466('0x2c')]=_[_0xb466('0x2d')](_0x131851,_0xb466('0x2e'));_0x282aaa[_0xb466('0x2f')]=_[_0xb466('0x30')](_0x2ec002[_0xb466('0x2f')]);_0x282aaa[_0xb466('0x31')]=_[_0xb466('0x32')](_0x282aaa[_0xb466('0x2c')],_0x282aaa[_0xb466('0x2f')]);_0x3ac64e[_0xb466('0x33')]=_[_0xb466('0x32')](_0x282aaa[_0xb466('0x2c')],qs[_0xb466('0x34')](_0x2ec002[_0xb466('0x2f')]['fields']));_0x3ac64e[_0xb466('0x33')]=_0x3ac64e[_0xb466('0x33')][_0xb466('0x35')]?_0x3ac64e[_0xb466('0x33')]:_0x282aaa[_0xb466('0x2c')];if(!_0x2ec002['query'][_0xb466('0x36')](_0xb466('0x37'))){_0x3ac64e[_0xb466('0x1a')]=qs[_0xb466('0x1a')](_0x2ec002['query']['limit']);_0x3ac64e[_0xb466('0x19')]=qs[_0xb466('0x19')](_0x2ec002[_0xb466('0x2f')]['offset']);}_0x3ac64e[_0xb466('0x38')]=qs[_0xb466('0x39')](_0x2ec002[_0xb466('0x2f')]['sort']);_0x3ac64e[_0xb466('0x3a')]=qs['filters'](_[_0xb466('0x3b')](_0x2ec002['query'],_0x282aaa[_0xb466('0x31')]),_0x131851);if(_0x2ec002[_0xb466('0x2f')]['filter']){_0x3ac64e[_0xb466('0x3a')]=_[_0xb466('0x3c')](_0x3ac64e['where'],{'$or':_[_0xb466('0x2d')](_0x131851,function(_0x289401){if(_0x289401[_0xb466('0x2a')]!==_0xb466('0x3d')){var _0x2dad73={};_0x2dad73[_0x289401[_0xb466('0x2e')]]={'$like':'%'+_0x2ec002[_0xb466('0x2f')][_0xb466('0x3e')]+'%'};return _0x2dad73;}})});}_0x3ac64e=_[_0xb466('0x3c')]({},_0x3ac64e,_0x2ec002[_0xb466('0x3f')]);var _0x454b01={'where':_0x3ac64e[_0xb466('0x3a')]};return db[_0xb466('0x27')][_0xb466('0x1c')](_0x454b01)[_0xb466('0x22')](function(_0x39ae01){_0x5674cd[_0xb466('0x1c')]=_0x39ae01;if(_0x2ec002['query'][_0xb466('0x40')]){_0x3ac64e[_0xb466('0x41')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x3ac64e);})[_0xb466('0x22')](function(_0x5db6a8){_0x5674cd[_0xb466('0x42')]=_0x5db6a8;return _0x5674cd;})['then'](respondWithFilteredResult(_0x2c4df6,_0x3ac64e))['catch'](handleError(_0x2c4df6,null));};exports[_0xb466('0x43')]=function(_0x1c206c,_0x15e15f){var _0x28ffb4={'raw':!![],'where':{'id':_0x1c206c[_0xb466('0x44')]['id']}},_0x1c492b={};_0x1c492b[_0xb466('0x2c')]=_['keys'](db[_0xb466('0x27')]['rawAttributes']);_0x1c492b[_0xb466('0x2f')]=_[_0xb466('0x30')](_0x1c206c[_0xb466('0x2f')]);_0x1c492b[_0xb466('0x31')]=_['intersection'](_0x1c492b[_0xb466('0x2c')],_0x1c492b[_0xb466('0x2f')]);_0x28ffb4[_0xb466('0x33')]=_[_0xb466('0x32')](_0x1c492b[_0xb466('0x2c')],qs[_0xb466('0x34')](_0x1c206c[_0xb466('0x2f')]['fields']));_0x28ffb4[_0xb466('0x33')]=_0x28ffb4[_0xb466('0x33')]['length']?_0x28ffb4['attributes']:_0x1c492b['model'];if(_0x1c206c[_0xb466('0x2f')][_0xb466('0x40')]){_0x28ffb4['include']=[{'all':!![]}];}_0x28ffb4=_['merge']({},_0x28ffb4,_0x1c206c[_0xb466('0x3f')]);return db[_0xb466('0x27')][_0xb466('0x45')](_0x28ffb4)[_0xb466('0x22')](handleEntityNotFound(_0x15e15f,null))[_0xb466('0x22')](respondWithResult(_0x15e15f,null))['catch'](handleError(_0x15e15f,null));};exports[_0xb466('0x46')]=function(_0x1ae549,_0x106947){return db['VtigerField']['create'](_0x1ae549[_0xb466('0x47')],{})[_0xb466('0x22')](respondWithResult(_0x106947,0xc9))[_0xb466('0x48')](handleError(_0x106947,null));};exports[_0xb466('0x20')]=function(_0x5d0f72,_0x34fcad){if(_0x5d0f72[_0xb466('0x47')]['id']){delete _0x5d0f72[_0xb466('0x47')]['id'];}return db[_0xb466('0x27')][_0xb466('0x45')]({'where':{'id':_0x5d0f72[_0xb466('0x44')]['id']}})[_0xb466('0x22')](handleEntityNotFound(_0x34fcad,null))[_0xb466('0x22')](saveUpdates(_0x5d0f72['body'],null))[_0xb466('0x22')](respondWithResult(_0x34fcad,null))[_0xb466('0x48')](handleError(_0x34fcad,null));};exports[_0xb466('0x21')]=function(_0x57769c,_0x5ba86a){return db['VtigerField']['find']({'where':{'id':_0x57769c[_0xb466('0x44')]['id']}})[_0xb466('0x22')](handleEntityNotFound(_0x5ba86a,null))[_0xb466('0x22')](removeEntity(_0x5ba86a,null))[_0xb466('0x48')](handleError(_0x5ba86a,null));}; \ No newline at end of file +var _0xf3d5=['update','then','destroy','name','index','map','VtigerField','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf3d5,0x135));var _0x5f3d=function(_0x27f4ac,_0x1a0088){_0x27f4ac=_0x27f4ac-0x0;var _0x2c860a=_0xf3d5[_0x27f4ac];return _0x2c860a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f3d('0x0'));var zipdir=require(_0x5f3d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f3d('0x2'));var moment=require(_0x5f3d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5f3d('0x4'));var util=require(_0x5f3d('0x5'));var path=require('path');var sox=require(_0x5f3d('0x6'));var csv=require(_0x5f3d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f3d('0x8'));var jsforce=require(_0x5f3d('0x9'));var deskjs=require(_0x5f3d('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5f3d('0xb'));var Papa=require(_0x5f3d('0xc'));var Redis=require('ioredis');var authService=require(_0x5f3d('0xd'));var qs=require(_0x5f3d('0xe'));var as=require(_0x5f3d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f3d('0x10'));var utils=require(_0x5f3d('0x11'));var config=require(_0x5f3d('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f3d('0x13'))['db'];function respondWithStatusCode(_0x4404d7,_0xc562f8){_0xc562f8=_0xc562f8||0xcc;return function(_0xa3eea1){if(_0xa3eea1){return _0x4404d7[_0x5f3d('0x14')](_0xc562f8);}return _0x4404d7[_0x5f3d('0x15')](_0xc562f8)[_0x5f3d('0x16')]();};}function respondWithResult(_0x20e845,_0x1181f5){_0x1181f5=_0x1181f5||0xc8;return function(_0x2f06df){if(_0x2f06df){return _0x20e845[_0x5f3d('0x15')](_0x1181f5)[_0x5f3d('0x17')](_0x2f06df);}};}function respondWithFilteredResult(_0x2eef1d,_0x1c3281){return function(_0x52a2f7){if(_0x52a2f7){var _0x5c6a93=typeof _0x1c3281[_0x5f3d('0x18')]==='undefined'&&typeof _0x1c3281[_0x5f3d('0x19')]==='undefined';var _0xeea13c=_0x52a2f7['count'];var _0x261d8a=_0x5c6a93?0x0:_0x1c3281['offset'];var _0x41da17=_0x5c6a93?_0x52a2f7['count']:_0x1c3281['offset']+_0x1c3281[_0x5f3d('0x19')];var _0x25ac97;if(_0x41da17>=_0xeea13c){_0x41da17=_0xeea13c;_0x25ac97=0xc8;}else{_0x25ac97=0xce;}_0x2eef1d[_0x5f3d('0x15')](_0x25ac97);return _0x2eef1d[_0x5f3d('0x1a')](_0x5f3d('0x1b'),_0x261d8a+'-'+_0x41da17+'/'+_0xeea13c)[_0x5f3d('0x17')](_0x52a2f7);}return null;};}function patchUpdates(_0x211977){return function(_0xe3eccf){try{jsonpatch[_0x5f3d('0x1c')](_0xe3eccf,_0x211977,!![]);}catch(_0xd54e6b){return BPromise[_0x5f3d('0x1d')](_0xd54e6b);}return _0xe3eccf[_0x5f3d('0x1e')]();};}function saveUpdates(_0x13322a,_0x27229a){return function(_0x4d781f){if(_0x4d781f){return _0x4d781f[_0x5f3d('0x1f')](_0x13322a)[_0x5f3d('0x20')](function(_0x54ae30){return _0x54ae30;});}return null;};}function removeEntity(_0x333332,_0x1957e1){return function(_0x357832){if(_0x357832){return _0x357832[_0x5f3d('0x21')]()['then'](function(){_0x333332[_0x5f3d('0x15')](0xcc)[_0x5f3d('0x16')]();});}};}function handleEntityNotFound(_0x3cbe05,_0x15a275){return function(_0x34a397){if(!_0x34a397){_0x3cbe05['sendStatus'](0x194);}return _0x34a397;};}function handleError(_0x280092,_0x13cf88){_0x13cf88=_0x13cf88||0x1f4;return function(_0x2d9a52){logger['error'](_0x2d9a52['stack']);if(_0x2d9a52[_0x5f3d('0x22')]){delete _0x2d9a52['name'];}_0x280092[_0x5f3d('0x15')](_0x13cf88)['send'](_0x2d9a52);};}exports[_0x5f3d('0x23')]=function(_0x2f0050,_0x343af4){var _0x483bf0={},_0x23840e={},_0x2c8d9f={'count':0x0,'rows':[]};var _0x81dcd7=_[_0x5f3d('0x24')](db[_0x5f3d('0x25')][_0x5f3d('0x26')],function(_0x2c4cd1){return{'name':_0x2c4cd1['fieldName'],'type':_0x2c4cd1['type']['key']};});_0x23840e['model']=_[_0x5f3d('0x24')](_0x81dcd7,_0x5f3d('0x22'));_0x23840e[_0x5f3d('0x27')]=_[_0x5f3d('0x28')](_0x2f0050[_0x5f3d('0x27')]);_0x23840e[_0x5f3d('0x29')]=_[_0x5f3d('0x2a')](_0x23840e[_0x5f3d('0x2b')],_0x23840e[_0x5f3d('0x27')]);_0x483bf0['attributes']=_['intersection'](_0x23840e[_0x5f3d('0x2b')],qs[_0x5f3d('0x2c')](_0x2f0050['query'][_0x5f3d('0x2c')]));_0x483bf0[_0x5f3d('0x2d')]=_0x483bf0['attributes'][_0x5f3d('0x2e')]?_0x483bf0[_0x5f3d('0x2d')]:_0x23840e[_0x5f3d('0x2b')];if(!_0x2f0050[_0x5f3d('0x27')][_0x5f3d('0x2f')](_0x5f3d('0x30'))){_0x483bf0[_0x5f3d('0x19')]=qs['limit'](_0x2f0050['query']['limit']);_0x483bf0[_0x5f3d('0x18')]=qs['offset'](_0x2f0050[_0x5f3d('0x27')][_0x5f3d('0x18')]);}_0x483bf0[_0x5f3d('0x31')]=qs[_0x5f3d('0x32')](_0x2f0050[_0x5f3d('0x27')][_0x5f3d('0x32')]);_0x483bf0[_0x5f3d('0x33')]=qs[_0x5f3d('0x29')](_[_0x5f3d('0x34')](_0x2f0050['query'],_0x23840e['filters']),_0x81dcd7);if(_0x2f0050[_0x5f3d('0x27')][_0x5f3d('0x35')]){_0x483bf0[_0x5f3d('0x33')]=_['merge'](_0x483bf0[_0x5f3d('0x33')],{'$or':_[_0x5f3d('0x24')](_0x81dcd7,function(_0x18afda){if(_0x18afda['type']!==_0x5f3d('0x36')){var _0x5213f6={};_0x5213f6[_0x18afda[_0x5f3d('0x22')]]={'$like':'%'+_0x2f0050[_0x5f3d('0x27')][_0x5f3d('0x35')]+'%'};return _0x5213f6;}})});}_0x483bf0=_[_0x5f3d('0x37')]({},_0x483bf0,_0x2f0050[_0x5f3d('0x38')]);var _0x29ab72={'where':_0x483bf0[_0x5f3d('0x33')]};return db[_0x5f3d('0x25')][_0x5f3d('0x39')](_0x29ab72)[_0x5f3d('0x20')](function(_0x21f053){_0x2c8d9f[_0x5f3d('0x39')]=_0x21f053;if(_0x2f0050[_0x5f3d('0x27')]['includeAll']){_0x483bf0[_0x5f3d('0x3a')]=[{'all':!![]}];}return db[_0x5f3d('0x25')][_0x5f3d('0x3b')](_0x483bf0);})[_0x5f3d('0x20')](function(_0x11b0a4){_0x2c8d9f[_0x5f3d('0x3c')]=_0x11b0a4;return _0x2c8d9f;})[_0x5f3d('0x20')](respondWithFilteredResult(_0x343af4,_0x483bf0))[_0x5f3d('0x3d')](handleError(_0x343af4,null));};exports[_0x5f3d('0x3e')]=function(_0x3c4108,_0x1bf8f5){var _0x332a32={'raw':!![],'where':{'id':_0x3c4108[_0x5f3d('0x3f')]['id']}},_0x1473bb={};_0x1473bb[_0x5f3d('0x2b')]=_[_0x5f3d('0x28')](db[_0x5f3d('0x25')][_0x5f3d('0x26')]);_0x1473bb[_0x5f3d('0x27')]=_[_0x5f3d('0x28')](_0x3c4108[_0x5f3d('0x27')]);_0x1473bb[_0x5f3d('0x29')]=_[_0x5f3d('0x2a')](_0x1473bb[_0x5f3d('0x2b')],_0x1473bb['query']);_0x332a32['attributes']=_[_0x5f3d('0x2a')](_0x1473bb[_0x5f3d('0x2b')],qs[_0x5f3d('0x2c')](_0x3c4108[_0x5f3d('0x27')][_0x5f3d('0x2c')]));_0x332a32['attributes']=_0x332a32[_0x5f3d('0x2d')]['length']?_0x332a32['attributes']:_0x1473bb[_0x5f3d('0x2b')];if(_0x3c4108['query'][_0x5f3d('0x40')]){_0x332a32[_0x5f3d('0x3a')]=[{'all':!![]}];}_0x332a32=_['merge']({},_0x332a32,_0x3c4108[_0x5f3d('0x38')]);return db[_0x5f3d('0x25')][_0x5f3d('0x41')](_0x332a32)[_0x5f3d('0x20')](handleEntityNotFound(_0x1bf8f5,null))[_0x5f3d('0x20')](respondWithResult(_0x1bf8f5,null))[_0x5f3d('0x3d')](handleError(_0x1bf8f5,null));};exports[_0x5f3d('0x42')]=function(_0x172f1b,_0x74e4bd){return db['VtigerField'][_0x5f3d('0x42')](_0x172f1b[_0x5f3d('0x43')],{})[_0x5f3d('0x20')](respondWithResult(_0x74e4bd,0xc9))[_0x5f3d('0x3d')](handleError(_0x74e4bd,null));};exports[_0x5f3d('0x1f')]=function(_0x424a6b,_0x2596f7){if(_0x424a6b[_0x5f3d('0x43')]['id']){delete _0x424a6b[_0x5f3d('0x43')]['id'];}return db[_0x5f3d('0x25')][_0x5f3d('0x41')]({'where':{'id':_0x424a6b[_0x5f3d('0x3f')]['id']}})[_0x5f3d('0x20')](handleEntityNotFound(_0x2596f7,null))['then'](saveUpdates(_0x424a6b['body'],null))[_0x5f3d('0x20')](respondWithResult(_0x2596f7,null))['catch'](handleError(_0x2596f7,null));};exports[_0x5f3d('0x21')]=function(_0x2ec765,_0x3c2e6a){return db['VtigerField'][_0x5f3d('0x41')]({'where':{'id':_0x2ec765[_0x5f3d('0x3f')]['id']}})[_0x5f3d('0x20')](handleEntityNotFound(_0x3c2e6a,null))[_0x5f3d('0x20')](removeEntity(_0x3c2e6a,null))[_0x5f3d('0x3d')](handleError(_0x3c2e6a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index e9ef04c..6598af5 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 _0x7780=['vtiger_unique_index','idField','FieldId','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0x7780,0x137));var _0x0778=function(_0x4b2494,_0x494d41){_0x4b2494=_0x4b2494-0x0;var _0x2c1436=_0x7780[_0x4b2494];return _0x2c1436;};'use strict';var _=require(_0x0778('0x0'));var util=require(_0x0778('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0778('0x2'));var rp=require(_0x0778('0x3'));var fs=require('fs');var path=require(_0x0778('0x4'));var rimraf=require(_0x0778('0x5'));var config=require(_0x0778('0x6'));var attributes=require(_0x0778('0x7'));module[_0x0778('0x8')]=function(_0x38aac3,_0x4cece1){return _0x38aac3['define'](_0x0778('0x9'),attributes,{'tableName':_0x0778('0xa'),'paranoid':![],'indexes':[{'name':_0x0778('0xb'),'fields':[_0x0778('0xc'),_0x0778('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe309=['bluebird','request-promise','path','../../config/environment','exports','int_vtiger_fields','vtiger_unique_index','idField','FieldId','../../config/logger','api','moment'];(function(_0x1f1402,_0x36059f){var _0x11426b=function(_0x4b27a8){while(--_0x4b27a8){_0x1f1402['push'](_0x1f1402['shift']());}};_0x11426b(++_0x36059f);}(_0xe309,0x11d));var _0x9e30=function(_0x2fc97c,_0x142a8b){_0x2fc97c=_0x2fc97c-0x0;var _0x3f17c1=_0xe309[_0x2fc97c];return _0x3f17c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9e30('0x0'))(_0x9e30('0x1'));var moment=require(_0x9e30('0x2'));var BPromise=require(_0x9e30('0x3'));var rp=require(_0x9e30('0x4'));var fs=require('fs');var path=require(_0x9e30('0x5'));var rimraf=require('rimraf');var config=require(_0x9e30('0x6'));var attributes=require('./intVtigerField.attributes');module[_0x9e30('0x7')]=function(_0x8e41b7,_0x5761e0){return _0x8e41b7['define']('VtigerField',attributes,{'tableName':_0x9e30('0x8'),'paranoid':![],'indexes':[{'name':_0x9e30('0x9'),'fields':[_0x9e30('0xa'),_0x9e30('0xb')],'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 76829df..cba43dd 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 _0x5137=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','message','result','catch','VtigerField,\x20%s,\x20%s','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x5137,0x1c9));var _0x7513=function(_0x4f14c5,_0x485e41){_0x4f14c5=_0x4f14c5-0x0;var _0x52ea51=_0x5137[_0x4f14c5];return _0x52ea51;};'use strict';var _=require(_0x7513('0x0'));var util=require('util');var moment=require(_0x7513('0x1'));var BPromise=require(_0x7513('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7513('0x3'));var db=require(_0x7513('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7513('0x5'))(_0x7513('0x6'));var config=require(_0x7513('0x7'));var jayson=require(_0x7513('0x8'));var client=jayson[_0x7513('0x9')][_0x7513('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49a090,_0x4ab635,_0x5bad5f){return new BPromise(function(_0x13dbe8,_0x72877e){return client[_0x7513('0xb')](_0x49a090,_0x5bad5f)[_0x7513('0xc')](function(_0x285b89){logger[_0x7513('0xd')]('VtigerField,\x20%s,\x20%s',_0x4ab635,_0x7513('0xe'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x4ab635,'request\x20sent',JSON[_0x7513('0xf')](_0x285b89));if(_0x285b89[_0x7513('0x10')]){if(_0x285b89[_0x7513('0x10')]['code']===0x1f4){logger[_0x7513('0x10')]('VtigerField,\x20%s,\x20%s',_0x4ab635,_0x285b89[_0x7513('0x10')][_0x7513('0x11')]);return _0x72877e(_0x285b89[_0x7513('0x10')][_0x7513('0x11')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x4ab635,_0x285b89[_0x7513('0x10')][_0x7513('0x11')]);return _0x13dbe8(_0x285b89[_0x7513('0x10')][_0x7513('0x11')]);}else{logger[_0x7513('0xd')]('VtigerField,\x20%s,\x20%s',_0x4ab635,_0x7513('0xe'));_0x13dbe8(_0x285b89[_0x7513('0x12')][_0x7513('0x11')]);}})[_0x7513('0x13')](function(_0x6e3b4f){logger[_0x7513('0x10')](_0x7513('0x14'),_0x4ab635,_0x6e3b4f);_0x72877e(_0x6e3b4f);});});} \ No newline at end of file +var _0x1fa8=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','message','error','result','catch'];(function(_0x115186,_0x1baa42){var _0x38349f=function(_0x390c0a){while(--_0x390c0a){_0x115186['push'](_0x115186['shift']());}};_0x38349f(++_0x1baa42);}(_0x1fa8,0x1cc));var _0x81fa=function(_0x3d95e9,_0x45bb17){_0x3d95e9=_0x3d95e9-0x0;var _0x472c9a=_0x1fa8[_0x3d95e9];return _0x472c9a;};'use strict';var _=require(_0x81fa('0x0'));var util=require(_0x81fa('0x1'));var moment=require(_0x81fa('0x2'));var BPromise=require('bluebird');var rs=require(_0x81fa('0x3'));var fs=require('fs');var Redis=require(_0x81fa('0x4'));var db=require(_0x81fa('0x5'))['db'];var utils=require(_0x81fa('0x6'));var logger=require(_0x81fa('0x7'))(_0x81fa('0x8'));var config=require(_0x81fa('0x9'));var jayson=require(_0x81fa('0xa'));var client=jayson[_0x81fa('0xb')][_0x81fa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x234566,_0x62b634,_0x2c115b){return new BPromise(function(_0x5e36d9,_0x36362f){return client[_0x81fa('0xd')](_0x234566,_0x2c115b)[_0x81fa('0xe')](function(_0x44157c){logger[_0x81fa('0xf')](_0x81fa('0x10'),_0x62b634,_0x81fa('0x11'));logger[_0x81fa('0x12')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x62b634,_0x81fa('0x11'),JSON['stringify'](_0x44157c));if(_0x44157c['error']){if(_0x44157c['error']['code']===0x1f4){logger['error'](_0x81fa('0x10'),_0x62b634,_0x44157c['error'][_0x81fa('0x13')]);return _0x36362f(_0x44157c['error']['message']);}logger[_0x81fa('0x14')]('VtigerField,\x20%s,\x20%s',_0x62b634,_0x44157c[_0x81fa('0x14')][_0x81fa('0x13')]);return _0x5e36d9(_0x44157c[_0x81fa('0x14')][_0x81fa('0x13')]);}else{logger[_0x81fa('0xf')](_0x81fa('0x10'),_0x62b634,'request\x20sent');_0x5e36d9(_0x44157c[_0x81fa('0x15')][_0x81fa('0x13')]);}})[_0x81fa('0x16')](function(_0x134f3c){logger[_0x81fa('0x14')](_0x81fa('0x10'),_0x62b634,_0x134f3c);_0x36362f(_0x134f3c);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 5e34c29..5529d36 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 _0x9a05=['addConfiguration','put','/:id','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','index','show','get','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create'];(function(_0x1221d5,_0x16dbca){var _0x1ef857=function(_0x8f8faf){while(--_0x8f8faf){_0x1221d5['push'](_0x1221d5['shift']());}};_0x1ef857(++_0x16dbca);}(_0x9a05,0x14e));var _0x59a0=function(_0x327f28,_0x8c9705){_0x327f28=_0x327f28-0x0;var _0x414bdc=_0x9a05[_0x327f28];return _0x414bdc;};'use strict';var multer=require(_0x59a0('0x0'));var util=require(_0x59a0('0x1'));var path=require('path');var timeout=require(_0x59a0('0x2'));var express=require(_0x59a0('0x3'));var router=express[_0x59a0('0x4')]();var fs_extra=require(_0x59a0('0x5'));var auth=require(_0x59a0('0x6'));var interaction=require(_0x59a0('0x7'));var config=require('../../config/environment');var controller=require(_0x59a0('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x59a0('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x59a0('0xa')]);router[_0x59a0('0xb')](_0x59a0('0xc'),auth[_0x59a0('0xd')](),controller[_0x59a0('0xe')]);router['get']('/:id/fields',auth[_0x59a0('0xd')](),controller[_0x59a0('0xf')]);router[_0x59a0('0x10')]('/',auth[_0x59a0('0xd')](),controller[_0x59a0('0x11')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x59a0('0x12')]);router[_0x59a0('0x13')](_0x59a0('0x14'),auth[_0x59a0('0xd')](),controller['update']);router[_0x59a0('0x15')](_0x59a0('0x14'),auth[_0x59a0('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9bdb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x30a067,_0x48dbc6){var _0x1cdaec=function(_0xd5de5){while(--_0xd5de5){_0x30a067['push'](_0x30a067['shift']());}};_0x1cdaec(++_0x48dbc6);}(_0x9bdb,0x13c));var _0xb9bd=function(_0xdc1284,_0xe13c86){_0xdc1284=_0xdc1284-0x0;var _0x1def81=_0x9bdb[_0xdc1284];return _0x1def81;};'use strict';var multer=require(_0xb9bd('0x0'));var util=require(_0xb9bd('0x1'));var path=require(_0xb9bd('0x2'));var timeout=require(_0xb9bd('0x3'));var express=require('express');var router=express[_0xb9bd('0x4')]();var fs_extra=require(_0xb9bd('0x5'));var auth=require(_0xb9bd('0x6'));var interaction=require(_0xb9bd('0x7'));var config=require(_0xb9bd('0x8'));var controller=require(_0xb9bd('0x9'));router[_0xb9bd('0xa')]('/',auth[_0xb9bd('0xb')](),controller['index']);router[_0xb9bd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb9bd('0xc')]);router[_0xb9bd('0xa')]('/:id/configurations',auth[_0xb9bd('0xb')](),controller[_0xb9bd('0xd')]);router[_0xb9bd('0xa')](_0xb9bd('0xe'),auth[_0xb9bd('0xb')](),controller['getFields']);router['post']('/',auth[_0xb9bd('0xb')](),controller[_0xb9bd('0xf')]);router[_0xb9bd('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xb9bd('0x11')]);router[_0xb9bd('0x12')]('/:id',auth[_0xb9bd('0xb')](),controller[_0xb9bd('0x13')]);router[_0xb9bd('0x14')]('/:id',auth[_0xb9bd('0xb')](),controller[_0xb9bd('0x15')]);module[_0xb9bd('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index de035e8..a15d042 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 _0x4317=['ENUM','password','integrationTab','newTab','exports','STRING','username','remoteUri'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x4317,0x7c));var _0x7431=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4317[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')]},'description':{'type':Sequelize[_0x7431('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x7431('0x2')},'password':{'type':Sequelize[_0x7431('0x1')]},'token':{'type':Sequelize[_0x7431('0x1')]},'remoteUri':{'type':Sequelize[_0x7431('0x1')],'unique':_0x7431('0x3')},'authType':{'type':Sequelize[_0x7431('0x4')]('password','token'),'defaultValue':_0x7431('0x5')},'serverUrl':{'type':Sequelize[_0x7431('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7431('0x4')](_0x7431('0x6'),_0x7431('0x7')),'defaultValue':_0x7431('0x6')}}; \ No newline at end of file +var _0x4888=['password','token','exports','STRING','username','remoteUri','ENUM'];(function(_0x350300,_0x92a6aa){var _0xdcf806=function(_0x4b26be){while(--_0x4b26be){_0x350300['push'](_0x350300['shift']());}};_0xdcf806(++_0x92a6aa);}(_0x4888,0x198));var _0x8488=function(_0x25c5a4,_0x1922b9){_0x25c5a4=_0x25c5a4-0x0;var _0x3f191b=_0x4888[_0x25c5a4];return _0x3f191b;};'use strict';var Sequelize=require('sequelize');module[_0x8488('0x0')]={'name':{'type':Sequelize[_0x8488('0x1')]},'description':{'type':Sequelize[_0x8488('0x1')]},'username':{'type':Sequelize[_0x8488('0x1')],'unique':_0x8488('0x2')},'password':{'type':Sequelize[_0x8488('0x1')]},'token':{'type':Sequelize[_0x8488('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8488('0x3')},'authType':{'type':Sequelize[_0x8488('0x4')](_0x8488('0x5'),_0x8488('0x6')),'defaultValue':_0x8488('0x5')},'serverUrl':{'type':Sequelize[_0x8488('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index b22f0ce..f03a66e 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 _0x8f59=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','params','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','filter','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','username','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','position','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x5c7dc6,_0x2f7fe2){var _0x3d0dc4=function(_0x235930){while(--_0x235930){_0x5c7dc6['push'](_0x5c7dc6['shift']());}};_0x3d0dc4(++_0x2f7fe2);}(_0x8f59,0x11d));var _0x98f5=function(_0x8409e1,_0x52a92b){_0x8409e1=_0x8409e1-0x0;var _0x1e15e0=_0x8f59[_0x8409e1];return _0x1e15e0;};'use strict';var emlformat=require(_0x98f5('0x0'));var rimraf=require(_0x98f5('0x1'));var zipdir=require(_0x98f5('0x2'));var jsonpatch=require(_0x98f5('0x3'));var rp=require(_0x98f5('0x4'));var moment=require(_0x98f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x98f5('0x6'));var util=require(_0x98f5('0x7'));var path=require(_0x98f5('0x8'));var sox=require(_0x98f5('0x9'));var csv=require('to-csv');var ejs=require(_0x98f5('0xa'));var fs=require('fs');var fs_extra=require(_0x98f5('0xb'));var _=require(_0x98f5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98f5('0xd'));var deskjs=require(_0x98f5('0xe'));var toCsv=require(_0x98f5('0xf'));var querystring=require('querystring');var Papa=require(_0x98f5('0x10'));var Redis=require(_0x98f5('0x11'));var authService=require(_0x98f5('0x12'));var qs=require(_0x98f5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98f5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x98f5('0x15'));var config=require(_0x98f5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x98f5('0x17'))['db'];var integrations=require(_0x98f5('0x18'));function respondWithStatusCode(_0x1f00e8,_0x160626){_0x160626=_0x160626||0xcc;return function(_0x3286f7){if(_0x3286f7){return _0x1f00e8[_0x98f5('0x19')](_0x160626);}return _0x1f00e8['status'](_0x160626)[_0x98f5('0x1a')]();};}function respondWithResult(_0xbade31,_0x5b8bab){_0x5b8bab=_0x5b8bab||0xc8;return function(_0x9df84){if(_0x9df84){return _0xbade31[_0x98f5('0x1b')](_0x5b8bab)[_0x98f5('0x1c')](_0x9df84);}};}function respondWithFilteredResult(_0x4ae70d,_0x2437e7){return function(_0xc7a49b){if(_0xc7a49b){var _0x113545=typeof _0x2437e7['offset']===_0x98f5('0x1d')&&typeof _0x2437e7[_0x98f5('0x1e')]==='undefined';var _0x1df52d=_0xc7a49b['count'];var _0x10c57c=_0x113545?0x0:_0x2437e7[_0x98f5('0x1f')];var _0x2291d5=_0x113545?_0xc7a49b[_0x98f5('0x20')]:_0x2437e7[_0x98f5('0x1f')]+_0x2437e7[_0x98f5('0x1e')];var _0x484e1d;if(_0x2291d5>=_0x1df52d){_0x2291d5=_0x1df52d;_0x484e1d=0xc8;}else{_0x484e1d=0xce;}_0x4ae70d[_0x98f5('0x1b')](_0x484e1d);return _0x4ae70d['set'](_0x98f5('0x21'),_0x10c57c+'-'+_0x2291d5+'/'+_0x1df52d)[_0x98f5('0x1c')](_0xc7a49b);}return null;};}function patchUpdates(_0x5deca0){return function(_0x146db1){try{jsonpatch[_0x98f5('0x22')](_0x146db1,_0x5deca0,!![]);}catch(_0x331695){return BPromise[_0x98f5('0x23')](_0x331695);}return _0x146db1[_0x98f5('0x24')]();};}function saveUpdates(_0x3dc7c2,_0x38b46d){return function(_0x5ac2b7){if(_0x5ac2b7){return _0x5ac2b7[_0x98f5('0x25')](_0x3dc7c2)['then'](function(_0xcb10d6){return _0xcb10d6;});}return null;};}function removeEntity(_0x495889,_0x44bfbb){return function(_0x40c69b){if(_0x40c69b){return _0x40c69b[_0x98f5('0x26')]()[_0x98f5('0x27')](function(){_0x495889[_0x98f5('0x1b')](0xcc)[_0x98f5('0x1a')]();});}};}function handleEntityNotFound(_0x46dbd4,_0x58d506){return function(_0x27a533){if(!_0x27a533){_0x46dbd4[_0x98f5('0x19')](0x194);}return _0x27a533;};}function handleError(_0x5d7423,_0x1a1c55){_0x1a1c55=_0x1a1c55||0x1f4;return function(_0x18b0af){logger[_0x98f5('0x28')](_0x18b0af[_0x98f5('0x29')]);if(_0x18b0af[_0x98f5('0x2a')]){delete _0x18b0af[_0x98f5('0x2a')];}_0x5d7423[_0x98f5('0x1b')](_0x1a1c55)[_0x98f5('0x2b')](_0x18b0af);};}exports['index']=function(_0x4c10b8,_0x428c85){var _0x71661e={},_0x18bb29={},_0x209d15={'count':0x0,'rows':[]};var _0x15bf92=_[_0x98f5('0x2c')](db['ZendeskAccount'][_0x98f5('0x2d')],function(_0x6d7418){return{'name':_0x6d7418[_0x98f5('0x2e')],'type':_0x6d7418[_0x98f5('0x2f')][_0x98f5('0x30')]};});_0x18bb29[_0x98f5('0x31')]=_['map'](_0x15bf92,_0x98f5('0x2a'));_0x18bb29[_0x98f5('0x32')]=_[_0x98f5('0x33')](_0x4c10b8[_0x98f5('0x32')]);_0x18bb29['filters']=_[_0x98f5('0x34')](_0x18bb29[_0x98f5('0x31')],_0x18bb29[_0x98f5('0x32')]);_0x71661e[_0x98f5('0x35')]=_[_0x98f5('0x34')](_0x18bb29[_0x98f5('0x31')],qs[_0x98f5('0x36')](_0x4c10b8[_0x98f5('0x32')][_0x98f5('0x36')]));_0x71661e[_0x98f5('0x35')]=_0x71661e[_0x98f5('0x35')][_0x98f5('0x37')]?_0x71661e[_0x98f5('0x35')]:_0x18bb29[_0x98f5('0x31')];if(!_0x4c10b8[_0x98f5('0x32')][_0x98f5('0x38')](_0x98f5('0x39'))){_0x71661e[_0x98f5('0x1e')]=qs[_0x98f5('0x1e')](_0x4c10b8[_0x98f5('0x32')]['limit']);_0x71661e[_0x98f5('0x1f')]=qs['offset'](_0x4c10b8['query'][_0x98f5('0x1f')]);}_0x71661e[_0x98f5('0x3a')]=qs[_0x98f5('0x3b')](_0x4c10b8[_0x98f5('0x32')]['sort']);_0x71661e[_0x98f5('0x3c')]=qs[_0x98f5('0x3d')](_[_0x98f5('0x3e')](_0x4c10b8['query'],_0x18bb29[_0x98f5('0x3d')]),_0x15bf92);if(_0x4c10b8[_0x98f5('0x32')]['filter']){_0x71661e[_0x98f5('0x3c')]=_[_0x98f5('0x3f')](_0x71661e[_0x98f5('0x3c')],{'$or':_['map'](_0x15bf92,function(_0x15d704){if(_0x15d704[_0x98f5('0x2f')]!==_0x98f5('0x40')){var _0x544fbf={};_0x544fbf[_0x15d704[_0x98f5('0x2a')]]={'$like':'%'+_0x4c10b8['query']['filter']+'%'};return _0x544fbf;}})});}_0x71661e=_[_0x98f5('0x3f')]({},_0x71661e,_0x4c10b8[_0x98f5('0x41')]);var _0x33e6e2={'where':_0x71661e[_0x98f5('0x3c')]};return db[_0x98f5('0x42')][_0x98f5('0x20')](_0x33e6e2)['then'](function(_0x4a4129){_0x209d15[_0x98f5('0x20')]=_0x4a4129;if(_0x4c10b8[_0x98f5('0x32')][_0x98f5('0x43')]){_0x71661e[_0x98f5('0x44')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x71661e);})[_0x98f5('0x27')](function(_0x469d2c){_0x209d15[_0x98f5('0x45')]=_0x469d2c;return _0x209d15;})[_0x98f5('0x27')](respondWithFilteredResult(_0x428c85,_0x71661e))['catch'](handleError(_0x428c85,null));};exports['show']=function(_0x3db067,_0x3a191f){var _0x372c33={'raw':![],'where':{'id':_0x3db067[_0x98f5('0x46')]['id']}},_0x4a9b53={};_0x4a9b53['model']=_[_0x98f5('0x33')](db['ZendeskAccount'][_0x98f5('0x2d')]);_0x4a9b53[_0x98f5('0x32')]=_[_0x98f5('0x33')](_0x3db067['query']);_0x4a9b53[_0x98f5('0x3d')]=_[_0x98f5('0x34')](_0x4a9b53['model'],_0x4a9b53[_0x98f5('0x32')]);_0x372c33[_0x98f5('0x35')]=_['intersection'](_0x4a9b53[_0x98f5('0x31')],qs['fields'](_0x3db067[_0x98f5('0x32')][_0x98f5('0x36')]));_0x372c33['attributes']=_0x372c33['attributes']['length']?_0x372c33['attributes']:_0x4a9b53[_0x98f5('0x31')];if(_0x3db067['query'][_0x98f5('0x43')]){_0x372c33[_0x98f5('0x44')]=[{'all':!![]}];}_0x372c33=_[_0x98f5('0x3f')]({},_0x372c33,_0x3db067[_0x98f5('0x41')]);return db[_0x98f5('0x42')][_0x98f5('0x47')](_0x372c33)['then'](handleEntityNotFound(_0x3a191f,null))[_0x98f5('0x27')](respondWithResult(_0x3a191f,null))[_0x98f5('0x48')](handleError(_0x3a191f,null));};exports[_0x98f5('0x49')]=function(_0x2c3cef,_0x178867){return db[_0x98f5('0x42')]['create'](_0x2c3cef[_0x98f5('0x4a')],{})[_0x98f5('0x27')](respondWithResult(_0x178867,0xc9))[_0x98f5('0x48')](handleError(_0x178867,null));};exports[_0x98f5('0x25')]=function(_0x4a0cda,_0x2c5f96){if(_0x4a0cda[_0x98f5('0x4a')]['id']){delete _0x4a0cda[_0x98f5('0x4a')]['id'];}return db[_0x98f5('0x42')][_0x98f5('0x47')]({'where':{'id':_0x4a0cda['params']['id']}})[_0x98f5('0x27')](handleEntityNotFound(_0x2c5f96,null))[_0x98f5('0x27')](saveUpdates(_0x4a0cda['body'],null))[_0x98f5('0x27')](respondWithResult(_0x2c5f96,null))['catch'](handleError(_0x2c5f96,null));};exports[_0x98f5('0x26')]=function(_0x4cb157,_0x1bd2b9){return db[_0x98f5('0x42')][_0x98f5('0x47')]({'where':{'id':_0x4cb157['params']['id']}})[_0x98f5('0x27')](handleEntityNotFound(_0x1bd2b9,null))[_0x98f5('0x27')](removeEntity(_0x1bd2b9,null))[_0x98f5('0x48')](handleError(_0x1bd2b9,null));};exports[_0x98f5('0x4b')]=function(_0xde3d2d,_0xf39073,_0x37e620){var _0x1891ac={};var _0x2c3a23={};var _0x2e48a1;var _0x50343c;return db[_0x98f5('0x42')][_0x98f5('0x4c')]({'where':{'id':_0xde3d2d[_0x98f5('0x46')]['id']}})[_0x98f5('0x27')](handleEntityNotFound(_0xf39073,null))[_0x98f5('0x27')](function(_0x23e955){if(_0x23e955){_0x2e48a1=_0x23e955;_0x2c3a23['model']=_[_0x98f5('0x33')](db[_0x98f5('0x4d')][_0x98f5('0x2d')]);_0x2c3a23[_0x98f5('0x32')]=_[_0x98f5('0x33')](_0xde3d2d[_0x98f5('0x32')]);_0x2c3a23['filters']=_['intersection'](_0x2c3a23['model'],_0x2c3a23[_0x98f5('0x32')]);_0x1891ac[_0x98f5('0x35')]=_[_0x98f5('0x34')](_0x2c3a23[_0x98f5('0x31')],qs['fields'](_0xde3d2d[_0x98f5('0x32')]['fields']));_0x1891ac[_0x98f5('0x35')]=_0x1891ac['attributes']['length']?_0x1891ac[_0x98f5('0x35')]:_0x2c3a23[_0x98f5('0x31')];_0x1891ac[_0x98f5('0x3a')]=qs['sort'](_0xde3d2d['query'][_0x98f5('0x3b')]);_0x1891ac[_0x98f5('0x3c')]=qs['filters'](_[_0x98f5('0x3e')](_0xde3d2d[_0x98f5('0x32')],_0x2c3a23['filters']));if(_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x4e')]){_0x1891ac[_0x98f5('0x3c')]=_['merge'](_0x1891ac[_0x98f5('0x3c')],{'$or':_[_0x98f5('0x2c')](_0x1891ac[_0x98f5('0x35')],function(_0xabde69){var _0x459c64={};_0x459c64[_0xabde69]={'$like':'%'+_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x4e')]+'%'};return _0x459c64;})});}_0x1891ac=_['merge']({},_0x1891ac,_0xde3d2d[_0x98f5('0x41')]);return _0x2e48a1[_0x98f5('0x4b')](_0x1891ac);}})[_0x98f5('0x27')](function(_0x58041d){if(_0x58041d){_0x50343c=_0x58041d['length'];if(!_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x38')]('nolimit')){_0x1891ac['limit']=qs['limit'](_0xde3d2d['query'][_0x98f5('0x1e')]);_0x1891ac['offset']=qs[_0x98f5('0x1f')](_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x1f')]);}return _0x2e48a1[_0x98f5('0x4b')](_0x1891ac);}})[_0x98f5('0x27')](function(_0x26cc86){if(_0x26cc86){return _0x26cc86?{'count':_0x50343c,'rows':_0x26cc86}:null;}})[_0x98f5('0x27')](respondWithResult(_0xf39073,null))[_0x98f5('0x48')](handleError(_0xf39073,null));};exports['addConfiguration']=function(_0x4d89b6,_0x3b8229,_0x505209){if(_0x4d89b6[_0x98f5('0x4a')]['id']){delete _0x4d89b6[_0x98f5('0x4a')]['id'];}return db[_0x98f5('0x42')]['findOne']({'where':{'id':_0x4d89b6[_0x98f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b8229,null))['then'](function(_0x595aee){if(_0x595aee){_0x4d89b6[_0x98f5('0x4a')]['AccountId']=_0x595aee['id'];_0x4d89b6[_0x98f5('0x4a')][_0x98f5('0x4f')]=integrations[_0x98f5('0x50')](_0x4d89b6['body']['channel'],_0x4d89b6['body'][_0x98f5('0x2f')]);_0x4d89b6[_0x98f5('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x4d89b6[_0x98f5('0x4a')][_0x98f5('0x51')],_0x4d89b6[_0x98f5('0x4a')][_0x98f5('0x2f')]);return db[_0x98f5('0x4d')][_0x98f5('0x49')](_0x4d89b6[_0x98f5('0x4a')],{'include':[{'model':db[_0x98f5('0x52')],'as':_0x98f5('0x4f')},{'model':db['ZendeskField'],'as':_0x98f5('0x53')}]});}return null;})[_0x98f5('0x27')](respondWithResult(_0x3b8229,null))[_0x98f5('0x48')](handleError(_0x3b8229,null));};exports[_0x98f5('0x54')]=function(_0x50911c,_0x3e00bf,_0x48b175){var _0x42c7a6='';return db['ZendeskAccount'][_0x98f5('0x4c')]({'where':{'id':_0x50911c[_0x98f5('0x46')]['id']},'attributes':['id','username',_0x98f5('0x55'),_0x98f5('0x56'),_0x98f5('0x57'),'remoteUri']})[_0x98f5('0x27')](handleEntityNotFound(_0x3e00bf,null))[_0x98f5('0x27')](function(_0x14c4f1){if(_0x14c4f1){_0x42c7a6=_0x14c4f1[_0x98f5('0x58')];var _0x154e19=_0x42c7a6[_0x98f5('0x59')](-0x1);if(_0x154e19==='/'){_0x42c7a6=_0x42c7a6[_0x98f5('0x5a')](0x0,_0x42c7a6[_0x98f5('0x5b')](_0x154e19));}var _0x368f76={'method':'GET','uri':util[_0x98f5('0x5c')]('%s/%s',_0x42c7a6,_0x98f5('0x5d')),'json':!![]};switch(_0x14c4f1[_0x98f5('0x57')]){case _0x98f5('0x55'):_0x368f76[_0x98f5('0x5e')]={'Authorization':util['format'](_0x98f5('0x5f'),new Buffer(util[_0x98f5('0x5c')]('%s:%s',_0x14c4f1[_0x98f5('0x60')],_0x14c4f1['password']))[_0x98f5('0x61')](_0x98f5('0x62')))};break;case _0x98f5('0x56'):_0x368f76[_0x98f5('0x5e')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x98f5('0x5c')](_0x98f5('0x63'),_0x14c4f1['username'],_0x14c4f1[_0x98f5('0x56')]))[_0x98f5('0x61')](_0x98f5('0x62')))};break;default:throw new db[(_0x98f5('0x64'))][(_0x98f5('0x65'))](_0x98f5('0x66'));}return rp(_0x368f76);}})[_0x98f5('0x27')](function(_0x1a3cb8){if(_0x1a3cb8){var _0x2e0484=[_0x98f5('0x67'),_0x98f5('0x68'),'group','assignee'];_[_0x98f5('0x69')](_0x1a3cb8[_0x98f5('0x5d')],function(_0x10cd2d){return _0x2e0484['includes'](_0x10cd2d[_0x98f5('0x2f')]);});return{'count':_0x1a3cb8[_0x98f5('0x5d')]['length'],'rows':_[_0x98f5('0x2c')](_0x1a3cb8[_0x98f5('0x5d')],function(_0x4c1dda){return{'id':_0x4c1dda['id'],'name':_0x4c1dda['position']>0x7?_0x4c1dda['title']:_0x4c1dda['type'],'custom':_0x4c1dda[_0x98f5('0x6a')]>0x7?!![]:![],'options':_0x4c1dda[_0x98f5('0x6b')]?_0x4c1dda['system_field_options']:_0x4c1dda[_0x98f5('0x6c')]?_0x4c1dda[_0x98f5('0x6c')]:[]};})};}})['then'](respondWithResult(_0x3e00bf,null))[_0x98f5('0x48')](function(_0x4f582b){var _0x4814da=_0x50911c[_0x98f5('0x32')][_0x98f5('0x6d')]?0x1f4:_0x4f582b[_0x98f5('0x6e')]||0x1f4;logger[_0x98f5('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x98f5('0x54'),_0x4814da,JSON['stringify'](_0x4f582b));delete _0x4f582b['name'];if(_0x4814da===0x191){_0x4814da=0x190;}_0x3e00bf['status'](_0x4814da)[_0x98f5('0x2b')](_0x50911c[_0x98f5('0x32')][_0x98f5('0x6d')]?{'message':_0x98f5('0x6f'),'statusCode':_0x4f582b[_0x98f5('0x6e')]}:_0x4f582b);});}; \ No newline at end of file +var _0xc900=['query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','intersection','includeAll','find','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','password','token','authType','remoteUri','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','toString','base64','ValidationError','Unknown\x20authentication\x20type','subject','group','remove','includes','title','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZendeskAccount','fieldName','type','model'];(function(_0x42085e,_0x43630e){var _0x574013=function(_0x9eb445){while(--_0x9eb445){_0x42085e['push'](_0x42085e['shift']());}};_0x574013(++_0x43630e);}(_0xc900,0xb3));var _0x0c90=function(_0x39ef3f,_0x145753){_0x39ef3f=_0x39ef3f-0x0;var _0x15c904=_0xc900[_0x39ef3f];return _0x15c904;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x459cdb,_0x26fc46){_0x26fc46=_0x26fc46||0xcc;return function(_0x4535a2){if(_0x4535a2){return _0x459cdb[_0x0c90('0x19')](_0x26fc46);}return _0x459cdb[_0x0c90('0x1a')](_0x26fc46)['end']();};}function respondWithResult(_0x467b32,_0x4451e0){_0x4451e0=_0x4451e0||0xc8;return function(_0x4f35f4){if(_0x4f35f4){return _0x467b32[_0x0c90('0x1a')](_0x4451e0)[_0x0c90('0x1b')](_0x4f35f4);}};}function respondWithFilteredResult(_0x3bd5e8,_0x5bef7d){return function(_0x5daeb7){if(_0x5daeb7){var _0x412635=typeof _0x5bef7d[_0x0c90('0x1c')]===_0x0c90('0x1d')&&typeof _0x5bef7d[_0x0c90('0x1e')]===_0x0c90('0x1d');var _0x2cab22=_0x5daeb7[_0x0c90('0x1f')];var _0x57b9a6=_0x412635?0x0:_0x5bef7d[_0x0c90('0x1c')];var _0x38becc=_0x412635?_0x5daeb7[_0x0c90('0x1f')]:_0x5bef7d[_0x0c90('0x1c')]+_0x5bef7d['limit'];var _0x10a775;if(_0x38becc>=_0x2cab22){_0x38becc=_0x2cab22;_0x10a775=0xc8;}else{_0x10a775=0xce;}_0x3bd5e8[_0x0c90('0x1a')](_0x10a775);return _0x3bd5e8[_0x0c90('0x20')](_0x0c90('0x21'),_0x57b9a6+'-'+_0x38becc+'/'+_0x2cab22)[_0x0c90('0x1b')](_0x5daeb7);}return null;};}function patchUpdates(_0xc08f54){return function(_0x4cc940){try{jsonpatch[_0x0c90('0x22')](_0x4cc940,_0xc08f54,!![]);}catch(_0x4d629f){return BPromise[_0x0c90('0x23')](_0x4d629f);}return _0x4cc940[_0x0c90('0x24')]();};}function saveUpdates(_0x47b13c,_0x2a053a){return function(_0x43ddc3){if(_0x43ddc3){return _0x43ddc3[_0x0c90('0x25')](_0x47b13c)[_0x0c90('0x26')](function(_0x212164){return _0x212164;});}return null;};}function removeEntity(_0x3b287c,_0x4dfbc3){return function(_0x26f0a3){if(_0x26f0a3){return _0x26f0a3[_0x0c90('0x27')]()['then'](function(){_0x3b287c['status'](0xcc)[_0x0c90('0x28')]();});}};}function handleEntityNotFound(_0x3ea861,_0x35c243){return function(_0x109a5f){if(!_0x109a5f){_0x3ea861['sendStatus'](0x194);}return _0x109a5f;};}function handleError(_0x2dfa14,_0x438652){_0x438652=_0x438652||0x1f4;return function(_0xeb7f58){logger[_0x0c90('0x29')](_0xeb7f58[_0x0c90('0x2a')]);if(_0xeb7f58[_0x0c90('0x2b')]){delete _0xeb7f58['name'];}_0x2dfa14[_0x0c90('0x1a')](_0x438652)[_0x0c90('0x2c')](_0xeb7f58);};}exports[_0x0c90('0x2d')]=function(_0x13b377,_0x52d28d){var _0x4c8603={},_0x1f27f1={},_0x25da6e={'count':0x0,'rows':[]};var _0x3bff04=_[_0x0c90('0x2e')](db[_0x0c90('0x2f')]['rawAttributes'],function(_0x120136){return{'name':_0x120136[_0x0c90('0x30')],'type':_0x120136[_0x0c90('0x31')]['key']};});_0x1f27f1[_0x0c90('0x32')]=_['map'](_0x3bff04,'name');_0x1f27f1[_0x0c90('0x33')]=_[_0x0c90('0x34')](_0x13b377[_0x0c90('0x33')]);_0x1f27f1[_0x0c90('0x35')]=_['intersection'](_0x1f27f1[_0x0c90('0x32')],_0x1f27f1['query']);_0x4c8603[_0x0c90('0x36')]=_['intersection'](_0x1f27f1[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x13b377['query'][_0x0c90('0x37')]));_0x4c8603[_0x0c90('0x36')]=_0x4c8603[_0x0c90('0x36')][_0x0c90('0x38')]?_0x4c8603[_0x0c90('0x36')]:_0x1f27f1[_0x0c90('0x32')];if(!_0x13b377[_0x0c90('0x33')][_0x0c90('0x39')]('nolimit')){_0x4c8603[_0x0c90('0x1e')]=qs[_0x0c90('0x1e')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x1e')]);_0x4c8603['offset']=qs[_0x0c90('0x1c')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x1c')]);}_0x4c8603[_0x0c90('0x3a')]=qs[_0x0c90('0x3b')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x3b')]);_0x4c8603[_0x0c90('0x3c')]=qs['filters'](_[_0x0c90('0x3d')](_0x13b377[_0x0c90('0x33')],_0x1f27f1['filters']),_0x3bff04);if(_0x13b377[_0x0c90('0x33')][_0x0c90('0x3e')]){_0x4c8603[_0x0c90('0x3c')]=_[_0x0c90('0x3f')](_0x4c8603[_0x0c90('0x3c')],{'$or':_['map'](_0x3bff04,function(_0x2f1d95){if(_0x2f1d95[_0x0c90('0x31')]!==_0x0c90('0x40')){var _0x2bca69={};_0x2bca69[_0x2f1d95[_0x0c90('0x2b')]]={'$like':'%'+_0x13b377[_0x0c90('0x33')][_0x0c90('0x3e')]+'%'};return _0x2bca69;}})});}_0x4c8603=_[_0x0c90('0x3f')]({},_0x4c8603,_0x13b377[_0x0c90('0x41')]);var _0x4f0227={'where':_0x4c8603[_0x0c90('0x3c')]};return db['ZendeskAccount'][_0x0c90('0x1f')](_0x4f0227)['then'](function(_0xb126ef){_0x25da6e[_0x0c90('0x1f')]=_0xb126ef;if(_0x13b377['query']['includeAll']){_0x4c8603[_0x0c90('0x42')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x0c90('0x43')](_0x4c8603);})[_0x0c90('0x26')](function(_0x373f9f){_0x25da6e['rows']=_0x373f9f;return _0x25da6e;})[_0x0c90('0x26')](respondWithFilteredResult(_0x52d28d,_0x4c8603))[_0x0c90('0x44')](handleError(_0x52d28d,null));};exports[_0x0c90('0x45')]=function(_0x3e5137,_0x2139c3){var _0x1184c4={'raw':![],'where':{'id':_0x3e5137[_0x0c90('0x46')]['id']}},_0x565b10={};_0x565b10[_0x0c90('0x32')]=_[_0x0c90('0x34')](db[_0x0c90('0x2f')][_0x0c90('0x47')]);_0x565b10[_0x0c90('0x33')]=_[_0x0c90('0x34')](_0x3e5137['query']);_0x565b10[_0x0c90('0x35')]=_['intersection'](_0x565b10[_0x0c90('0x32')],_0x565b10[_0x0c90('0x33')]);_0x1184c4[_0x0c90('0x36')]=_[_0x0c90('0x48')](_0x565b10[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x3e5137[_0x0c90('0x33')][_0x0c90('0x37')]));_0x1184c4[_0x0c90('0x36')]=_0x1184c4[_0x0c90('0x36')][_0x0c90('0x38')]?_0x1184c4[_0x0c90('0x36')]:_0x565b10[_0x0c90('0x32')];if(_0x3e5137[_0x0c90('0x33')][_0x0c90('0x49')]){_0x1184c4['include']=[{'all':!![]}];}_0x1184c4=_[_0x0c90('0x3f')]({},_0x1184c4,_0x3e5137[_0x0c90('0x41')]);return db[_0x0c90('0x2f')][_0x0c90('0x4a')](_0x1184c4)[_0x0c90('0x26')](handleEntityNotFound(_0x2139c3,null))[_0x0c90('0x26')](respondWithResult(_0x2139c3,null))[_0x0c90('0x44')](handleError(_0x2139c3,null));};exports[_0x0c90('0x4b')]=function(_0x3bb138,_0x3af64f){return db[_0x0c90('0x2f')][_0x0c90('0x4b')](_0x3bb138[_0x0c90('0x4c')],{})[_0x0c90('0x26')](respondWithResult(_0x3af64f,0xc9))['catch'](handleError(_0x3af64f,null));};exports[_0x0c90('0x25')]=function(_0x38f492,_0x553fea){if(_0x38f492['body']['id']){delete _0x38f492['body']['id'];}return db[_0x0c90('0x2f')][_0x0c90('0x4a')]({'where':{'id':_0x38f492[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x553fea,null))[_0x0c90('0x26')](saveUpdates(_0x38f492['body'],null))[_0x0c90('0x26')](respondWithResult(_0x553fea,null))[_0x0c90('0x44')](handleError(_0x553fea,null));};exports[_0x0c90('0x27')]=function(_0x549c78,_0x119776){return db[_0x0c90('0x2f')][_0x0c90('0x4a')]({'where':{'id':_0x549c78[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x119776,null))[_0x0c90('0x26')](removeEntity(_0x119776,null))[_0x0c90('0x44')](handleError(_0x119776,null));};exports[_0x0c90('0x4d')]=function(_0x1daeed,_0xeeee3b,_0x5e288e){var _0xac80b2={};var _0x4ba9e7={};var _0xda4331;var _0x67539d;return db[_0x0c90('0x2f')][_0x0c90('0x4e')]({'where':{'id':_0x1daeed[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0xeeee3b,null))['then'](function(_0x4930fc){if(_0x4930fc){_0xda4331=_0x4930fc;_0x4ba9e7['model']=_['keys'](db[_0x0c90('0x4f')][_0x0c90('0x47')]);_0x4ba9e7[_0x0c90('0x33')]=_['keys'](_0x1daeed[_0x0c90('0x33')]);_0x4ba9e7[_0x0c90('0x35')]=_['intersection'](_0x4ba9e7[_0x0c90('0x32')],_0x4ba9e7['query']);_0xac80b2[_0x0c90('0x36')]=_[_0x0c90('0x48')](_0x4ba9e7[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x1daeed['query'][_0x0c90('0x37')]));_0xac80b2['attributes']=_0xac80b2[_0x0c90('0x36')][_0x0c90('0x38')]?_0xac80b2['attributes']:_0x4ba9e7['model'];_0xac80b2['order']=qs[_0x0c90('0x3b')](_0x1daeed[_0x0c90('0x33')][_0x0c90('0x3b')]);_0xac80b2[_0x0c90('0x3c')]=qs[_0x0c90('0x35')](_['pick'](_0x1daeed[_0x0c90('0x33')],_0x4ba9e7[_0x0c90('0x35')]));if(_0x1daeed['query'][_0x0c90('0x3e')]){_0xac80b2['where']=_[_0x0c90('0x3f')](_0xac80b2[_0x0c90('0x3c')],{'$or':_['map'](_0xac80b2[_0x0c90('0x36')],function(_0x5baf85){var _0x4de11a={};_0x4de11a[_0x5baf85]={'$like':'%'+_0x1daeed['query'][_0x0c90('0x3e')]+'%'};return _0x4de11a;})});}_0xac80b2=_[_0x0c90('0x3f')]({},_0xac80b2,_0x1daeed[_0x0c90('0x41')]);return _0xda4331[_0x0c90('0x4d')](_0xac80b2);}})['then'](function(_0x5b385b){if(_0x5b385b){_0x67539d=_0x5b385b[_0x0c90('0x38')];if(!_0x1daeed[_0x0c90('0x33')][_0x0c90('0x39')]('nolimit')){_0xac80b2[_0x0c90('0x1e')]=qs[_0x0c90('0x1e')](_0x1daeed[_0x0c90('0x33')]['limit']);_0xac80b2[_0x0c90('0x1c')]=qs[_0x0c90('0x1c')](_0x1daeed[_0x0c90('0x33')]['offset']);}return _0xda4331[_0x0c90('0x4d')](_0xac80b2);}})[_0x0c90('0x26')](function(_0x1a198b){if(_0x1a198b){return _0x1a198b?{'count':_0x67539d,'rows':_0x1a198b}:null;}})[_0x0c90('0x26')](respondWithResult(_0xeeee3b,null))[_0x0c90('0x44')](handleError(_0xeeee3b,null));};exports[_0x0c90('0x50')]=function(_0x19f4ac,_0x143e0d,_0x181fe3){if(_0x19f4ac['body']['id']){delete _0x19f4ac['body']['id'];}return db[_0x0c90('0x2f')][_0x0c90('0x4e')]({'where':{'id':_0x19f4ac[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x143e0d,null))[_0x0c90('0x26')](function(_0x2dad30){if(_0x2dad30){_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x51')]=_0x2dad30['id'];_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x52')]=integrations[_0x0c90('0x53')](_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x54')],_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x31')]);_0x19f4ac['body'][_0x0c90('0x55')]=integrations[_0x0c90('0x56')](_0x19f4ac[_0x0c90('0x4c')]['channel'],_0x19f4ac['body'][_0x0c90('0x31')]);return db['ZendeskConfiguration'][_0x0c90('0x4b')](_0x19f4ac[_0x0c90('0x4c')],{'include':[{'model':db['ZendeskField'],'as':_0x0c90('0x52')},{'model':db[_0x0c90('0x57')],'as':_0x0c90('0x55')}]});}return null;})[_0x0c90('0x26')](respondWithResult(_0x143e0d,null))['catch'](handleError(_0x143e0d,null));};exports['getFields']=function(_0x5f32d6,_0x16b38a,_0x2d3287){var _0x3bc90d='';return db[_0x0c90('0x2f')]['findOne']({'where':{'id':_0x5f32d6[_0x0c90('0x46')]['id']},'attributes':['id','username',_0x0c90('0x58'),_0x0c90('0x59'),_0x0c90('0x5a'),'remoteUri']})[_0x0c90('0x26')](handleEntityNotFound(_0x16b38a,null))[_0x0c90('0x26')](function(_0x2da9f9){if(_0x2da9f9){_0x3bc90d=_0x2da9f9[_0x0c90('0x5b')];var _0x57c3b3=_0x3bc90d['slice'](-0x1);if(_0x57c3b3==='/'){_0x3bc90d=_0x3bc90d[_0x0c90('0x5c')](0x0,_0x3bc90d['lastIndexOf'](_0x57c3b3));}var _0x3254c0={'method':_0x0c90('0x5d'),'uri':util[_0x0c90('0x5e')](_0x0c90('0x5f'),_0x3bc90d,_0x0c90('0x60')),'json':!![]};switch(_0x2da9f9[_0x0c90('0x5a')]){case _0x0c90('0x58'):_0x3254c0[_0x0c90('0x61')]={'Authorization':util[_0x0c90('0x5e')](_0x0c90('0x62'),new Buffer(util['format'](_0x0c90('0x63'),_0x2da9f9[_0x0c90('0x64')],_0x2da9f9[_0x0c90('0x58')]))[_0x0c90('0x65')](_0x0c90('0x66')))};break;case _0x0c90('0x59'):_0x3254c0[_0x0c90('0x61')]={'Authorization':util[_0x0c90('0x5e')](_0x0c90('0x62'),new Buffer(util[_0x0c90('0x5e')]('%s/token:%s',_0x2da9f9[_0x0c90('0x64')],_0x2da9f9[_0x0c90('0x59')]))[_0x0c90('0x65')](_0x0c90('0x66')))};break;default:throw new db['Sequelize'][(_0x0c90('0x67'))](_0x0c90('0x68'));}return rp(_0x3254c0);}})[_0x0c90('0x26')](function(_0x48a32f){if(_0x48a32f){var _0x40866c=[_0x0c90('0x69'),'description',_0x0c90('0x6a'),'assignee'];_[_0x0c90('0x6b')](_0x48a32f['ticket_fields'],function(_0x5633a4){return _0x40866c[_0x0c90('0x6c')](_0x5633a4[_0x0c90('0x31')]);});return{'count':_0x48a32f['ticket_fields']['length'],'rows':_[_0x0c90('0x2e')](_0x48a32f[_0x0c90('0x60')],function(_0x5d80b9){return{'id':_0x5d80b9['id'],'name':_0x5d80b9['position']>0x7?_0x5d80b9[_0x0c90('0x6d')]:_0x5d80b9['type'],'custom':_0x5d80b9[_0x0c90('0x6e')]>0x7?!![]:![],'options':_0x5d80b9[_0x0c90('0x6f')]?_0x5d80b9[_0x0c90('0x6f')]:_0x5d80b9[_0x0c90('0x70')]?_0x5d80b9[_0x0c90('0x70')]:[]};})};}})['then'](respondWithResult(_0x16b38a,null))[_0x0c90('0x44')](function(_0x142268){var _0x3aed3c=_0x5f32d6['query']['test']?0x1f4:_0x142268[_0x0c90('0x71')]||0x1f4;logger[_0x0c90('0x29')](_0x0c90('0x72'),'getFields',_0x3aed3c,JSON['stringify'](_0x142268));delete _0x142268['name'];if(_0x3aed3c===0x191){_0x3aed3c=0x190;}_0x16b38a[_0x0c90('0x1a')](_0x3aed3c)['send'](_0x5f32d6['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x142268[_0x0c90('0x71')]}:_0x142268);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 014663c..a700a78 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 _0xa0ab=['path','./intZendeskAccount.attributes','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x352851,_0x250b47){var _0x5549ad=function(_0x205b9b){while(--_0x205b9b){_0x352851['push'](_0x352851['shift']());}};_0x5549ad(++_0x250b47);}(_0xa0ab,0x1eb));var _0xba0a=function(_0x5442c6,_0x6a7ac9){_0x5442c6=_0x5442c6-0x0;var _0x539526=_0xa0ab[_0x5442c6];return _0x539526;};'use strict';var _=require(_0xba0a('0x0'));var util=require('util');var logger=require(_0xba0a('0x1'))(_0xba0a('0x2'));var moment=require('moment');var BPromise=require(_0xba0a('0x3'));var rp=require(_0xba0a('0x4'));var fs=require('fs');var path=require(_0xba0a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba0a('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3aa4b7,_0x5d90b8){return _0x3aa4b7[_0xba0a('0x7')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c53=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x2c53,0x18b));var _0x32c5=function(_0x4dbdda,_0x11f07c){_0x4dbdda=_0x4dbdda-0x0;var _0x1acbf1=_0x2c53[_0x4dbdda];return _0x1acbf1;};'use strict';var _=require(_0x32c5('0x0'));var util=require(_0x32c5('0x1'));var logger=require(_0x32c5('0x2'))('api');var moment=require(_0x32c5('0x3'));var BPromise=require(_0x32c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32c5('0x5'));var rimraf=require(_0x32c5('0x6'));var config=require(_0x32c5('0x7'));var attributes=require(_0x32c5('0x8'));var integrations=require(_0x32c5('0x9'));module[_0x32c5('0xa')]=function(_0x1b1a1e,_0x4d0b65){return _0x1b1a1e[_0x32c5('0xb')](_0x32c5('0xc'),attributes,{'tableName':'int_zendesk_accounts','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 b4c2521..069965d 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 _0xbad9=['map','model','catch','ShowZendeskAccount','ZendeskAccount','where','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetZendeskAccount','options','raw','attributes','limit','include'];(function(_0x21d266,_0x1f2ddb){var _0x21e549=function(_0xa68d99){while(--_0xa68d99){_0x21d266['push'](_0x21d266['shift']());}};_0x21e549(++_0x1f2ddb);}(_0xbad9,0x6d));var _0x9bad=function(_0x3c6a41,_0xb6f415){_0x3c6a41=_0x3c6a41-0x0;var _0x35eb17=_0xbad9[_0x3c6a41];return _0x35eb17;};'use strict';var _=require(_0x9bad('0x0'));var util=require(_0x9bad('0x1'));var moment=require(_0x9bad('0x2'));var BPromise=require('bluebird');var rs=require(_0x9bad('0x3'));var fs=require('fs');var Redis=require(_0x9bad('0x4'));var db=require(_0x9bad('0x5'))['db'];var utils=require(_0x9bad('0x6'));var logger=require(_0x9bad('0x7'))(_0x9bad('0x8'));var config=require('../../config/environment');var jayson=require(_0x9bad('0x9'));var client=jayson[_0x9bad('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f147f,_0x59eeeb,_0xe84dc4){return new BPromise(function(_0x3ec7c7,_0x167b4f){return client[_0x9bad('0xb')](_0x2f147f,_0xe84dc4)[_0x9bad('0xc')](function(_0x172241){logger[_0x9bad('0xd')](_0x9bad('0xe'),_0x59eeeb,_0x9bad('0xf'));logger[_0x9bad('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x59eeeb,_0x9bad('0xf'),JSON['stringify'](_0x172241));if(_0x172241[_0x9bad('0x11')]){if(_0x172241[_0x9bad('0x11')][_0x9bad('0x12')]===0x1f4){logger[_0x9bad('0x11')](_0x9bad('0xe'),_0x59eeeb,_0x172241[_0x9bad('0x11')][_0x9bad('0x13')]);return _0x167b4f(_0x172241[_0x9bad('0x11')][_0x9bad('0x13')]);}logger[_0x9bad('0x11')](_0x9bad('0xe'),_0x59eeeb,_0x172241['error'][_0x9bad('0x13')]);return _0x3ec7c7(_0x172241[_0x9bad('0x11')][_0x9bad('0x13')]);}else{logger[_0x9bad('0xd')](_0x9bad('0xe'),_0x59eeeb,'request\x20sent');_0x3ec7c7(_0x172241[_0x9bad('0x14')]['message']);}})['catch'](function(_0x539246){logger[_0x9bad('0x11')](_0x9bad('0xe'),_0x59eeeb,_0x539246);_0x167b4f(_0x539246);});});}exports[_0x9bad('0x15')]=function(_0x1dbb90){var _0xd52fe0=this;return new Promise(function(_0x99fef7,_0x36a7d8){return db['ZendeskAccount']['findAll']({'raw':_0x1dbb90['options']?_0x1dbb90[_0x9bad('0x16')][_0x9bad('0x17')]===undefined?!![]:![]:!![],'where':_0x1dbb90['options']?_0x1dbb90['options']['where']||null:null,'attributes':_0x1dbb90[_0x9bad('0x16')]?_0x1dbb90[_0x9bad('0x16')][_0x9bad('0x18')]||null:null,'limit':_0x1dbb90['options']?_0x1dbb90['options'][_0x9bad('0x19')]||null:null,'include':_0x1dbb90[_0x9bad('0x16')]?_0x1dbb90[_0x9bad('0x16')][_0x9bad('0x1a')]?_[_0x9bad('0x1b')](_0x1dbb90[_0x9bad('0x16')][_0x9bad('0x1a')],function(_0x13f3b3){return{'model':db[_0x13f3b3[_0x9bad('0x1c')]],'as':_0x13f3b3['as'],'attributes':_0x13f3b3[_0x9bad('0x18')],'include':_0x13f3b3['include']?_[_0x9bad('0x1b')](_0x13f3b3[_0x9bad('0x1a')],function(_0x2fba3a){return{'model':db[_0x2fba3a[_0x9bad('0x1c')]],'as':_0x2fba3a['as'],'attributes':_0x2fba3a[_0x9bad('0x18')],'include':_0x2fba3a[_0x9bad('0x1a')]?_[_0x9bad('0x1b')](_0x2fba3a['include'],function(_0x572f85){return{'model':db[_0x572f85[_0x9bad('0x1c')]],'as':_0x572f85['as'],'attributes':_0x572f85['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1423c5){logger[_0x9bad('0xd')](_0x9bad('0x15'),_0x1dbb90);logger[_0x9bad('0x10')](_0x9bad('0x15'),_0x1dbb90,JSON['stringify'](_0x1423c5));_0x99fef7(_0x1423c5);})[_0x9bad('0x1d')](function(_0x14189f){logger['error']('GetZendeskAccount',_0x14189f[_0x9bad('0x13')],_0x1dbb90);_0x36a7d8(_0xd52fe0['error'](0x1f4,_0x14189f['message']));});});};exports[_0x9bad('0x1e')]=function(_0x46ded9){var _0x41b18b=this;return new Promise(function(_0x27c7bf,_0x187376){return db[_0x9bad('0x1f')]['find']({'raw':_0x46ded9['options']?_0x46ded9[_0x9bad('0x16')][_0x9bad('0x17')]===undefined?!![]:![]:!![],'where':_0x46ded9[_0x9bad('0x16')]?_0x46ded9[_0x9bad('0x16')][_0x9bad('0x20')]||null:null,'attributes':_0x46ded9[_0x9bad('0x16')]?_0x46ded9[_0x9bad('0x16')]['attributes']||null:null,'include':_0x46ded9[_0x9bad('0x16')]?_0x46ded9[_0x9bad('0x16')]['include']?_[_0x9bad('0x1b')](_0x46ded9[_0x9bad('0x16')]['include'],function(_0x5a64fb){return{'model':db[_0x5a64fb[_0x9bad('0x1c')]],'as':_0x5a64fb['as'],'attributes':_0x5a64fb[_0x9bad('0x18')],'include':_0x5a64fb[_0x9bad('0x1a')]?_[_0x9bad('0x1b')](_0x5a64fb['include'],function(_0x4c9261){return{'model':db[_0x4c9261[_0x9bad('0x1c')]],'as':_0x4c9261['as'],'attributes':_0x4c9261[_0x9bad('0x18')],'include':_0x4c9261[_0x9bad('0x1a')]?_[_0x9bad('0x1b')](_0x4c9261[_0x9bad('0x1a')],function(_0x1833eb){return{'model':db[_0x1833eb['model']],'as':_0x1833eb['as'],'attributes':_0x1833eb[_0x9bad('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2534cb){logger[_0x9bad('0xd')](_0x9bad('0x1e'),_0x46ded9);logger[_0x9bad('0x10')]('ShowZendeskAccount',_0x46ded9,JSON[_0x9bad('0x21')](_0x2534cb));_0x27c7bf(_0x2534cb);})[_0x9bad('0x1d')](function(_0x4458ee){logger[_0x9bad('0x11')](_0x9bad('0x1e'),_0x4458ee[_0x9bad('0x13')],_0x46ded9);_0x187376(_0x41b18b[_0x9bad('0x11')](0x1f4,_0x4458ee[_0x9bad('0x13')]));});});}; \ No newline at end of file +var _0xbb9d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','GetZendeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','info','stringify','catch','ZendeskAccount','find','ShowZendeskAccount','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xbb9d,0x113));var _0xdbb9=function(_0x4d9ccb,_0x279565){_0x4d9ccb=_0x4d9ccb-0x0;var _0x1d8c94=_0xbb9d[_0x4d9ccb];return _0x1d8c94;};'use strict';var _=require(_0xdbb9('0x0'));var util=require(_0xdbb9('0x1'));var moment=require('moment');var BPromise=require(_0xdbb9('0x2'));var rs=require(_0xdbb9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbb9('0x4'))['db'];var utils=require(_0xdbb9('0x5'));var logger=require(_0xdbb9('0x6'))('rpc');var config=require(_0xdbb9('0x7'));var jayson=require(_0xdbb9('0x8'));var client=jayson['client'][_0xdbb9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4faecd,_0x244f43,_0x24f667){return new BPromise(function(_0x27e7bd,_0x14683d){return client[_0xdbb9('0xa')](_0x4faecd,_0x24f667)[_0xdbb9('0xb')](function(_0x12c2e4){logger['info'](_0xdbb9('0xc'),_0x244f43,_0xdbb9('0xd'));logger[_0xdbb9('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x244f43,'request\x20sent',JSON['stringify'](_0x12c2e4));if(_0x12c2e4['error']){if(_0x12c2e4['error'][_0xdbb9('0xf')]===0x1f4){logger['error'](_0xdbb9('0xc'),_0x244f43,_0x12c2e4[_0xdbb9('0x10')]['message']);return _0x14683d(_0x12c2e4[_0xdbb9('0x10')][_0xdbb9('0x11')]);}logger['error'](_0xdbb9('0xc'),_0x244f43,_0x12c2e4[_0xdbb9('0x10')]['message']);return _0x27e7bd(_0x12c2e4[_0xdbb9('0x10')][_0xdbb9('0x11')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x244f43,'request\x20sent');_0x27e7bd(_0x12c2e4[_0xdbb9('0x12')]['message']);}})['catch'](function(_0x4db9fd){logger[_0xdbb9('0x10')](_0xdbb9('0xc'),_0x244f43,_0x4db9fd);_0x14683d(_0x4db9fd);});});}exports[_0xdbb9('0x13')]=function(_0xedd55b){var _0x35402b=this;return new Promise(function(_0x20ba2a,_0x5a4d11){return db['ZendeskAccount'][_0xdbb9('0x14')]({'raw':_0xedd55b[_0xdbb9('0x15')]?_0xedd55b[_0xdbb9('0x15')][_0xdbb9('0x16')]===undefined?!![]:![]:!![],'where':_0xedd55b['options']?_0xedd55b[_0xdbb9('0x15')][_0xdbb9('0x17')]||null:null,'attributes':_0xedd55b[_0xdbb9('0x15')]?_0xedd55b[_0xdbb9('0x15')]['attributes']||null:null,'limit':_0xedd55b[_0xdbb9('0x15')]?_0xedd55b[_0xdbb9('0x15')][_0xdbb9('0x18')]||null:null,'include':_0xedd55b['options']?_0xedd55b[_0xdbb9('0x15')][_0xdbb9('0x19')]?_[_0xdbb9('0x1a')](_0xedd55b[_0xdbb9('0x15')][_0xdbb9('0x19')],function(_0x30bf38){return{'model':db[_0x30bf38[_0xdbb9('0x1b')]],'as':_0x30bf38['as'],'attributes':_0x30bf38[_0xdbb9('0x1c')],'include':_0x30bf38[_0xdbb9('0x19')]?_['map'](_0x30bf38[_0xdbb9('0x19')],function(_0x45c6c5){return{'model':db[_0x45c6c5[_0xdbb9('0x1b')]],'as':_0x45c6c5['as'],'attributes':_0x45c6c5[_0xdbb9('0x1c')],'include':_0x45c6c5['include']?_[_0xdbb9('0x1a')](_0x45c6c5['include'],function(_0x1f0e99){return{'model':db[_0x1f0e99[_0xdbb9('0x1b')]],'as':_0x1f0e99['as'],'attributes':_0x1f0e99['attributes']};}):[]};}):[]};}):[]:[]})[_0xdbb9('0xb')](function(_0x5cf095){logger[_0xdbb9('0x1d')](_0xdbb9('0x13'),_0xedd55b);logger['debug'](_0xdbb9('0x13'),_0xedd55b,JSON[_0xdbb9('0x1e')](_0x5cf095));_0x20ba2a(_0x5cf095);})[_0xdbb9('0x1f')](function(_0x25ad5f){logger[_0xdbb9('0x10')](_0xdbb9('0x13'),_0x25ad5f[_0xdbb9('0x11')],_0xedd55b);_0x5a4d11(_0x35402b[_0xdbb9('0x10')](0x1f4,_0x25ad5f[_0xdbb9('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x55b952){var _0x2cc933=this;return new Promise(function(_0x186fc0,_0xbdcb0a){return db[_0xdbb9('0x20')][_0xdbb9('0x21')]({'raw':_0x55b952[_0xdbb9('0x15')]?_0x55b952['options']['raw']===undefined?!![]:![]:!![],'where':_0x55b952[_0xdbb9('0x15')]?_0x55b952[_0xdbb9('0x15')][_0xdbb9('0x17')]||null:null,'attributes':_0x55b952[_0xdbb9('0x15')]?_0x55b952[_0xdbb9('0x15')]['attributes']||null:null,'include':_0x55b952[_0xdbb9('0x15')]?_0x55b952['options'][_0xdbb9('0x19')]?_[_0xdbb9('0x1a')](_0x55b952[_0xdbb9('0x15')][_0xdbb9('0x19')],function(_0x5d3f69){return{'model':db[_0x5d3f69[_0xdbb9('0x1b')]],'as':_0x5d3f69['as'],'attributes':_0x5d3f69[_0xdbb9('0x1c')],'include':_0x5d3f69['include']?_[_0xdbb9('0x1a')](_0x5d3f69[_0xdbb9('0x19')],function(_0x9ff462){return{'model':db[_0x9ff462['model']],'as':_0x9ff462['as'],'attributes':_0x9ff462[_0xdbb9('0x1c')],'include':_0x9ff462['include']?_[_0xdbb9('0x1a')](_0x9ff462[_0xdbb9('0x19')],function(_0x258421){return{'model':db[_0x258421[_0xdbb9('0x1b')]],'as':_0x258421['as'],'attributes':_0x258421['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cfaa8){logger[_0xdbb9('0x1d')]('ShowZendeskAccount',_0x55b952);logger[_0xdbb9('0xe')](_0xdbb9('0x22'),_0x55b952,JSON['stringify'](_0x1cfaa8));_0x186fc0(_0x1cfaa8);})['catch'](function(_0x26c1c9){logger[_0xdbb9('0x10')]('ShowZendeskAccount',_0x26c1c9[_0xdbb9('0x11')],_0x55b952);_0xbdcb0a(_0x2cc933[_0xdbb9('0x10')](0x1f4,_0x26c1c9['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 21b669d..a8cbc2b 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 _0x0abf=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0x0abf,0xe8));var _0xf0ab=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0abf[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf0ab('0x7')]('/:id/descriptions',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0x7')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0x12')]);router[_0xf0ab('0x11')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x16')]);router[_0xf0ab('0x17')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x18')]);module[_0xf0ab('0x19')]=router; \ No newline at end of file +var _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xb688,0xcf));var _0x8b68=function(_0x3d144b,_0x5ac8cd){_0x3d144b=_0x3d144b-0x0;var _0x5b76d4=_0xb688[_0x3d144b];return _0x5b76d4;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index fe22ecc..eec23d8 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 _0x8a14=['sequelize','exports','STRING'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x8a14,0x1b6));var _0x48a1=function(_0x38ab87,_0x18225f){_0x38ab87=_0x38ab87-0x0;var _0x53ace3=_0x8a14[_0x38ab87];return _0x53ace3;};'use strict';var Sequelize=require(_0x48a1('0x0'));module[_0x48a1('0x1')]={'name':{'type':Sequelize[_0x48a1('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x86fb=['sequelize','exports','STRING'];(function(_0x232e0a,_0x2fd08f){var _0x4f0fec=function(_0x54801f){while(--_0x54801f){_0x232e0a['push'](_0x232e0a['shift']());}};_0x4f0fec(++_0x2fd08f);}(_0x86fb,0x108));var _0xb86f=function(_0x8ed793,_0x27ad80){_0x8ed793=_0x8ed793-0x0;var _0x3bfbbf=_0x86fb[_0x8ed793];return _0x3bfbbf;};'use strict';var Sequelize=require(_0xb86f('0x0'));module[_0xb86f('0x1')]={'name':{'type':Sequelize[_0xb86f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index aa04f02..d569be2 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 _0x4377=['count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','include','rows','catch','show','includeAll','merge','options','find','create','body','params','getFields','findOne','nolimit','getSubjects','ZendeskField','hasOwnProperty','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit'];(function(_0x24cb8c,_0x423901){var _0x2b9b59=function(_0x21ded5){while(--_0x21ded5){_0x24cb8c['push'](_0x24cb8c['shift']());}};_0x2b9b59(++_0x423901);}(_0x4377,0xe2));var _0x7437=function(_0x36cbc7,_0xe7956a){_0x36cbc7=_0x36cbc7-0x0;var _0xe182bf=_0x4377[_0x36cbc7];return _0xe182bf;};'use strict';var emlformat=require(_0x7437('0x0'));var rimraf=require(_0x7437('0x1'));var zipdir=require(_0x7437('0x2'));var jsonpatch=require(_0x7437('0x3'));var rp=require('request-promise');var moment=require(_0x7437('0x4'));var BPromise=require(_0x7437('0x5'));var Mustache=require(_0x7437('0x6'));var util=require(_0x7437('0x7'));var path=require(_0x7437('0x8'));var sox=require(_0x7437('0x9'));var csv=require(_0x7437('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7437('0xb'));var crypto=require(_0x7437('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7437('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7437('0xe'));var Papa=require(_0x7437('0xf'));var Redis=require(_0x7437('0x10'));var authService=require(_0x7437('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7437('0x12'));var hardwareService=require(_0x7437('0x13'));var logger=require('../../config/logger')(_0x7437('0x14'));var utils=require('../../config/utils');var config=require(_0x7437('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7437('0x16'))['db'];function respondWithStatusCode(_0x4bfb1f,_0x49744d){_0x49744d=_0x49744d||0xcc;return function(_0x1c9b7f){if(_0x1c9b7f){return _0x4bfb1f[_0x7437('0x17')](_0x49744d);}return _0x4bfb1f['status'](_0x49744d)[_0x7437('0x18')]();};}function respondWithResult(_0x255974,_0x3933d8){_0x3933d8=_0x3933d8||0xc8;return function(_0x4bdf87){if(_0x4bdf87){return _0x255974[_0x7437('0x19')](_0x3933d8)['json'](_0x4bdf87);}};}function respondWithFilteredResult(_0x2f5ed8,_0x33f073){return function(_0x2fe07e){if(_0x2fe07e){var _0x556ca7=typeof _0x33f073[_0x7437('0x1a')]===_0x7437('0x1b')&&typeof _0x33f073[_0x7437('0x1c')]===_0x7437('0x1b');var _0x2369a8=_0x2fe07e[_0x7437('0x1d')];var _0x4526c3=_0x556ca7?0x0:_0x33f073[_0x7437('0x1a')];var _0x1a65b1=_0x556ca7?_0x2fe07e[_0x7437('0x1d')]:_0x33f073[_0x7437('0x1a')]+_0x33f073[_0x7437('0x1c')];var _0x1f100b;if(_0x1a65b1>=_0x2369a8){_0x1a65b1=_0x2369a8;_0x1f100b=0xc8;}else{_0x1f100b=0xce;}_0x2f5ed8[_0x7437('0x19')](_0x1f100b);return _0x2f5ed8[_0x7437('0x1e')](_0x7437('0x1f'),_0x4526c3+'-'+_0x1a65b1+'/'+_0x2369a8)[_0x7437('0x20')](_0x2fe07e);}return null;};}function patchUpdates(_0x2b37f4){return function(_0x58e590){try{jsonpatch[_0x7437('0x21')](_0x58e590,_0x2b37f4,!![]);}catch(_0x3a8841){return BPromise[_0x7437('0x22')](_0x3a8841);}return _0x58e590['save']();};}function saveUpdates(_0x2e5cd6,_0x4619f3){return function(_0xaed6db){if(_0xaed6db){return _0xaed6db[_0x7437('0x23')](_0x2e5cd6)[_0x7437('0x24')](function(_0x49bc82){return _0x49bc82;});}return null;};}function removeEntity(_0x3cc7df,_0x2c598e){return function(_0x969dcc){if(_0x969dcc){return _0x969dcc[_0x7437('0x25')]()[_0x7437('0x24')](function(){_0x3cc7df[_0x7437('0x19')](0xcc)[_0x7437('0x18')]();});}};}function handleEntityNotFound(_0x18eb09,_0x532894){return function(_0x55c275){if(!_0x55c275){_0x18eb09['sendStatus'](0x194);}return _0x55c275;};}function handleError(_0x1fbdeb,_0x3f1897){_0x3f1897=_0x3f1897||0x1f4;return function(_0x1f0d4b){logger[_0x7437('0x26')](_0x1f0d4b[_0x7437('0x27')]);if(_0x1f0d4b[_0x7437('0x28')]){delete _0x1f0d4b[_0x7437('0x28')];}_0x1fbdeb[_0x7437('0x19')](_0x3f1897)[_0x7437('0x29')](_0x1f0d4b);};}exports[_0x7437('0x2a')]=function(_0x517d13,_0x3f571b){var _0x534485={},_0x411cf1={},_0x1dcd90={'count':0x0,'rows':[]};var _0x375b75=_[_0x7437('0x2b')](db[_0x7437('0x2c')][_0x7437('0x2d')],function(_0x2b9258){return{'name':_0x2b9258[_0x7437('0x2e')],'type':_0x2b9258[_0x7437('0x2f')][_0x7437('0x30')]};});_0x411cf1['model']=_[_0x7437('0x2b')](_0x375b75,_0x7437('0x28'));_0x411cf1[_0x7437('0x31')]=_[_0x7437('0x32')](_0x517d13['query']);_0x411cf1[_0x7437('0x33')]=_[_0x7437('0x34')](_0x411cf1['model'],_0x411cf1['query']);_0x534485['attributes']=_[_0x7437('0x34')](_0x411cf1[_0x7437('0x35')],qs['fields'](_0x517d13['query'][_0x7437('0x36')]));_0x534485[_0x7437('0x37')]=_0x534485[_0x7437('0x37')][_0x7437('0x38')]?_0x534485[_0x7437('0x37')]:_0x411cf1[_0x7437('0x35')];if(!_0x517d13[_0x7437('0x31')]['hasOwnProperty']('nolimit')){_0x534485[_0x7437('0x1c')]=qs[_0x7437('0x1c')](_0x517d13[_0x7437('0x31')][_0x7437('0x1c')]);_0x534485[_0x7437('0x1a')]=qs[_0x7437('0x1a')](_0x517d13[_0x7437('0x31')]['offset']);}_0x534485[_0x7437('0x39')]=qs[_0x7437('0x3a')](_0x517d13[_0x7437('0x31')]['sort']);_0x534485[_0x7437('0x3b')]=qs[_0x7437('0x33')](_[_0x7437('0x3c')](_0x517d13[_0x7437('0x31')],_0x411cf1[_0x7437('0x33')]),_0x375b75);if(_0x517d13[_0x7437('0x31')][_0x7437('0x3d')]){_0x534485[_0x7437('0x3b')]=_['merge'](_0x534485[_0x7437('0x3b')],{'$or':_[_0x7437('0x2b')](_0x375b75,function(_0x30d9cb){if(_0x30d9cb['type']!==_0x7437('0x3e')){var _0x1e8599={};_0x1e8599[_0x30d9cb[_0x7437('0x28')]]={'$like':'%'+_0x517d13[_0x7437('0x31')]['filter']+'%'};return _0x1e8599;}})});}_0x534485=_['merge']({},_0x534485,_0x517d13['options']);var _0xb3e18a={'where':_0x534485['where']};return db[_0x7437('0x2c')][_0x7437('0x1d')](_0xb3e18a)['then'](function(_0x5dfdb5){_0x1dcd90[_0x7437('0x1d')]=_0x5dfdb5;if(_0x517d13[_0x7437('0x31')]['includeAll']){_0x534485[_0x7437('0x3f')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x534485);})[_0x7437('0x24')](function(_0x567dd8){_0x1dcd90[_0x7437('0x40')]=_0x567dd8;return _0x1dcd90;})[_0x7437('0x24')](respondWithFilteredResult(_0x3f571b,_0x534485))[_0x7437('0x41')](handleError(_0x3f571b,null));};exports[_0x7437('0x42')]=function(_0x3080b8,_0x41ed13){var _0x1a0017={'raw':![],'where':{'id':_0x3080b8['params']['id']}},_0x567993={};_0x567993[_0x7437('0x35')]=_[_0x7437('0x32')](db[_0x7437('0x2c')]['rawAttributes']);_0x567993[_0x7437('0x31')]=_[_0x7437('0x32')](_0x3080b8[_0x7437('0x31')]);_0x567993[_0x7437('0x33')]=_[_0x7437('0x34')](_0x567993[_0x7437('0x35')],_0x567993['query']);_0x1a0017[_0x7437('0x37')]=_[_0x7437('0x34')](_0x567993[_0x7437('0x35')],qs[_0x7437('0x36')](_0x3080b8[_0x7437('0x31')][_0x7437('0x36')]));_0x1a0017['attributes']=_0x1a0017[_0x7437('0x37')][_0x7437('0x38')]?_0x1a0017[_0x7437('0x37')]:_0x567993[_0x7437('0x35')];if(_0x3080b8['query'][_0x7437('0x43')]){_0x1a0017[_0x7437('0x3f')]=[{'all':!![]}];}_0x1a0017=_[_0x7437('0x44')]({},_0x1a0017,_0x3080b8[_0x7437('0x45')]);return db[_0x7437('0x2c')][_0x7437('0x46')](_0x1a0017)[_0x7437('0x24')](handleEntityNotFound(_0x41ed13,null))[_0x7437('0x24')](respondWithResult(_0x41ed13,null))[_0x7437('0x41')](handleError(_0x41ed13,null));};exports[_0x7437('0x47')]=function(_0x421134,_0x1fda52){return db[_0x7437('0x2c')][_0x7437('0x47')](_0x421134[_0x7437('0x48')],{})[_0x7437('0x24')](respondWithResult(_0x1fda52,0xc9))[_0x7437('0x41')](handleError(_0x1fda52,null));};exports[_0x7437('0x23')]=function(_0x35c7a9,_0x45a0a2){if(_0x35c7a9['body']['id']){delete _0x35c7a9[_0x7437('0x48')]['id'];}return db['ZendeskConfiguration'][_0x7437('0x46')]({'where':{'id':_0x35c7a9[_0x7437('0x49')]['id']}})[_0x7437('0x24')](handleEntityNotFound(_0x45a0a2,null))['then'](saveUpdates(_0x35c7a9[_0x7437('0x48')],null))[_0x7437('0x24')](respondWithResult(_0x45a0a2,null))[_0x7437('0x41')](handleError(_0x45a0a2,null));};exports[_0x7437('0x25')]=function(_0x47dc74,_0x9fad7d){return db[_0x7437('0x2c')][_0x7437('0x46')]({'where':{'id':_0x47dc74['params']['id']}})[_0x7437('0x24')](handleEntityNotFound(_0x9fad7d,null))['then'](removeEntity(_0x9fad7d,null))['catch'](handleError(_0x9fad7d,null));};exports[_0x7437('0x4a')]=function(_0xde93d5,_0x1d11f5,_0x2dddd){var _0x3febca={};var _0x42aa05={};var _0x5895b;var _0xbecd35;return db[_0x7437('0x2c')][_0x7437('0x4b')]({'where':{'id':_0xde93d5[_0x7437('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d11f5,null))['then'](function(_0x1091b2){if(_0x1091b2){_0x5895b=_0x1091b2;_0x42aa05['model']=_[_0x7437('0x32')](db['ZendeskField'][_0x7437('0x2d')]);_0x42aa05[_0x7437('0x31')]=_['keys'](_0xde93d5[_0x7437('0x31')]);_0x42aa05[_0x7437('0x33')]=_[_0x7437('0x34')](_0x42aa05['model'],_0x42aa05[_0x7437('0x31')]);_0x3febca[_0x7437('0x37')]=_[_0x7437('0x34')](_0x42aa05['model'],qs[_0x7437('0x36')](_0xde93d5[_0x7437('0x31')][_0x7437('0x36')]));_0x3febca[_0x7437('0x37')]=_0x3febca[_0x7437('0x37')][_0x7437('0x38')]?_0x3febca['attributes']:_0x42aa05[_0x7437('0x35')];_0x3febca[_0x7437('0x39')]=qs[_0x7437('0x3a')](_0xde93d5['query'][_0x7437('0x3a')]);_0x3febca['where']=qs['filters'](_['pick'](_0xde93d5['query'],_0x42aa05[_0x7437('0x33')]));if(_0xde93d5[_0x7437('0x31')]['filter']){_0x3febca[_0x7437('0x3b')]=_[_0x7437('0x44')](_0x3febca[_0x7437('0x3b')],{'$or':_[_0x7437('0x2b')](_0x3febca[_0x7437('0x37')],function(_0x4fba6e){var _0x564e89={};_0x564e89[_0x4fba6e]={'$like':'%'+_0xde93d5['query'][_0x7437('0x3d')]+'%'};return _0x564e89;})});}_0x3febca=_['merge']({},_0x3febca,_0xde93d5[_0x7437('0x45')]);return _0x5895b['getFields'](_0x3febca);}})[_0x7437('0x24')](function(_0x1225bd){if(_0x1225bd){_0xbecd35=_0x1225bd['length'];if(!_0xde93d5[_0x7437('0x31')]['hasOwnProperty'](_0x7437('0x4c'))){_0x3febca[_0x7437('0x1c')]=qs[_0x7437('0x1c')](_0xde93d5[_0x7437('0x31')][_0x7437('0x1c')]);_0x3febca[_0x7437('0x1a')]=qs[_0x7437('0x1a')](_0xde93d5['query'][_0x7437('0x1a')]);}return _0x5895b[_0x7437('0x4a')](_0x3febca);}})[_0x7437('0x24')](function(_0x175054){if(_0x175054){return _0x175054?{'count':_0xbecd35,'rows':_0x175054}:null;}})[_0x7437('0x24')](respondWithResult(_0x1d11f5,null))[_0x7437('0x41')](handleError(_0x1d11f5,null));};exports[_0x7437('0x4d')]=function(_0x3f14f6,_0x2fb170,_0x2b22fd){var _0xe9839d={};var _0x27446e={};var _0x1eb4be;var _0x13d909;return db['ZendeskConfiguration'][_0x7437('0x4b')]({'where':{'id':_0x3f14f6[_0x7437('0x49')]['id']}})[_0x7437('0x24')](handleEntityNotFound(_0x2fb170,null))[_0x7437('0x24')](function(_0x2f3968){if(_0x2f3968){_0x1eb4be=_0x2f3968;_0x27446e[_0x7437('0x35')]=_[_0x7437('0x32')](db[_0x7437('0x4e')][_0x7437('0x2d')]);_0x27446e[_0x7437('0x31')]=_[_0x7437('0x32')](_0x3f14f6[_0x7437('0x31')]);_0x27446e[_0x7437('0x33')]=_[_0x7437('0x34')](_0x27446e['model'],_0x27446e[_0x7437('0x31')]);_0xe9839d['attributes']=_[_0x7437('0x34')](_0x27446e[_0x7437('0x35')],qs[_0x7437('0x36')](_0x3f14f6[_0x7437('0x31')]['fields']));_0xe9839d['attributes']=_0xe9839d[_0x7437('0x37')][_0x7437('0x38')]?_0xe9839d[_0x7437('0x37')]:_0x27446e[_0x7437('0x35')];_0xe9839d['order']=qs[_0x7437('0x3a')](_0x3f14f6[_0x7437('0x31')][_0x7437('0x3a')]);_0xe9839d[_0x7437('0x3b')]=qs[_0x7437('0x33')](_[_0x7437('0x3c')](_0x3f14f6[_0x7437('0x31')],_0x27446e[_0x7437('0x33')]));if(_0x3f14f6[_0x7437('0x31')][_0x7437('0x3d')]){_0xe9839d[_0x7437('0x3b')]=_[_0x7437('0x44')](_0xe9839d['where'],{'$or':_[_0x7437('0x2b')](_0xe9839d[_0x7437('0x37')],function(_0x2763ce){var _0x445afb={};_0x445afb[_0x2763ce]={'$like':'%'+_0x3f14f6[_0x7437('0x31')][_0x7437('0x3d')]+'%'};return _0x445afb;})});}_0xe9839d=_[_0x7437('0x44')]({},_0xe9839d,_0x3f14f6[_0x7437('0x45')]);return _0x1eb4be['getSubjects'](_0xe9839d);}})[_0x7437('0x24')](function(_0x4c9129){if(_0x4c9129){_0x13d909=_0x4c9129[_0x7437('0x38')];if(!_0x3f14f6[_0x7437('0x31')][_0x7437('0x4f')](_0x7437('0x4c'))){_0xe9839d[_0x7437('0x1c')]=qs[_0x7437('0x1c')](_0x3f14f6['query'][_0x7437('0x1c')]);_0xe9839d[_0x7437('0x1a')]=qs[_0x7437('0x1a')](_0x3f14f6[_0x7437('0x31')][_0x7437('0x1a')]);}return _0x1eb4be[_0x7437('0x4d')](_0xe9839d);}})[_0x7437('0x24')](function(_0x44dd8d){if(_0x44dd8d){return _0x44dd8d?{'count':_0x13d909,'rows':_0x44dd8d}:null;}})[_0x7437('0x24')](respondWithResult(_0x2fb170,null))[_0x7437('0x41')](handleError(_0x2fb170,null));};exports[_0x7437('0x50')]=function(_0x29c860,_0x236d5f,_0x5389be){var _0x490164={};var _0x43e8d4={};var _0xca683d;var _0x1855db;return db[_0x7437('0x2c')][_0x7437('0x4b')]({'where':{'id':_0x29c860[_0x7437('0x49')]['id']}})['then'](handleEntityNotFound(_0x236d5f,null))[_0x7437('0x24')](function(_0x43b5b8){if(_0x43b5b8){_0xca683d=_0x43b5b8;_0x43e8d4['model']=_['keys'](db[_0x7437('0x4e')][_0x7437('0x2d')]);_0x43e8d4[_0x7437('0x31')]=_[_0x7437('0x32')](_0x29c860['query']);_0x43e8d4[_0x7437('0x33')]=_['intersection'](_0x43e8d4[_0x7437('0x35')],_0x43e8d4['query']);_0x490164[_0x7437('0x37')]=_[_0x7437('0x34')](_0x43e8d4[_0x7437('0x35')],qs[_0x7437('0x36')](_0x29c860['query']['fields']));_0x490164[_0x7437('0x37')]=_0x490164[_0x7437('0x37')][_0x7437('0x38')]?_0x490164[_0x7437('0x37')]:_0x43e8d4[_0x7437('0x35')];_0x490164[_0x7437('0x39')]=qs['sort'](_0x29c860[_0x7437('0x31')]['sort']);_0x490164[_0x7437('0x3b')]=qs[_0x7437('0x33')](_[_0x7437('0x3c')](_0x29c860['query'],_0x43e8d4[_0x7437('0x33')]));if(_0x29c860['query'][_0x7437('0x3d')]){_0x490164[_0x7437('0x3b')]=_[_0x7437('0x44')](_0x490164[_0x7437('0x3b')],{'$or':_[_0x7437('0x2b')](_0x490164['attributes'],function(_0x228a93){var _0x29967a={};_0x29967a[_0x228a93]={'$like':'%'+_0x29c860[_0x7437('0x31')][_0x7437('0x3d')]+'%'};return _0x29967a;})});}_0x490164=_[_0x7437('0x44')]({},_0x490164,_0x29c860[_0x7437('0x45')]);return _0xca683d['getDescriptions'](_0x490164);}})[_0x7437('0x24')](function(_0x1e2ce1){if(_0x1e2ce1){_0x1855db=_0x1e2ce1[_0x7437('0x38')];if(!_0x29c860[_0x7437('0x31')]['hasOwnProperty'](_0x7437('0x4c'))){_0x490164[_0x7437('0x1c')]=qs['limit'](_0x29c860['query'][_0x7437('0x1c')]);_0x490164['offset']=qs['offset'](_0x29c860[_0x7437('0x31')][_0x7437('0x1a')]);}return _0xca683d[_0x7437('0x50')](_0x490164);}})[_0x7437('0x24')](function(_0x35dc1a){if(_0x35dc1a){return _0x35dc1a?{'count':_0x1855db,'rows':_0x35dc1a}:null;}})[_0x7437('0x24')](respondWithResult(_0x236d5f,null))['catch'](handleError(_0x236d5f,null));};exports[_0x7437('0x51')]=function(_0x5194f9,_0x554f60,_0x45c3c5){var _0x88334e={};var _0x68e18e={};var _0x507cf4;var _0x38b417;return db['ZendeskConfiguration'][_0x7437('0x4b')]({'where':{'id':_0x5194f9[_0x7437('0x49')]['id']}})[_0x7437('0x24')](handleEntityNotFound(_0x554f60,null))[_0x7437('0x24')](function(_0xa2fe4){if(_0xa2fe4){_0x507cf4=_0xa2fe4;_0x68e18e[_0x7437('0x35')]=_[_0x7437('0x32')](db[_0x7437('0x52')]['rawAttributes']);_0x68e18e['query']=_[_0x7437('0x32')](_0x5194f9[_0x7437('0x31')]);_0x68e18e['filters']=_[_0x7437('0x34')](_0x68e18e[_0x7437('0x35')],_0x68e18e[_0x7437('0x31')]);_0x88334e[_0x7437('0x37')]=_[_0x7437('0x34')](_0x68e18e[_0x7437('0x35')],qs[_0x7437('0x36')](_0x5194f9[_0x7437('0x31')][_0x7437('0x36')]));_0x88334e[_0x7437('0x37')]=_0x88334e[_0x7437('0x37')][_0x7437('0x38')]?_0x88334e[_0x7437('0x37')]:_0x68e18e['model'];_0x88334e[_0x7437('0x39')]=qs[_0x7437('0x3a')](_0x5194f9[_0x7437('0x31')][_0x7437('0x3a')]);_0x88334e['where']=qs[_0x7437('0x33')](_['pick'](_0x5194f9[_0x7437('0x31')],_0x68e18e[_0x7437('0x33')]));if(_0x5194f9[_0x7437('0x31')][_0x7437('0x3d')]){_0x88334e[_0x7437('0x3b')]=_[_0x7437('0x44')](_0x88334e[_0x7437('0x3b')],{'$or':_[_0x7437('0x2b')](_0x88334e[_0x7437('0x37')],function(_0x1a562f){var _0x4b727f={};_0x4b727f[_0x1a562f]={'$like':'%'+_0x5194f9[_0x7437('0x31')]['filter']+'%'};return _0x4b727f;})});}_0x88334e=_[_0x7437('0x44')]({},_0x88334e,_0x5194f9[_0x7437('0x45')]);return _0x507cf4[_0x7437('0x51')](_0x88334e);}})[_0x7437('0x24')](function(_0x3f01e8){if(_0x3f01e8){_0x38b417=_0x3f01e8[_0x7437('0x38')];if(!_0x5194f9[_0x7437('0x31')][_0x7437('0x4f')](_0x7437('0x4c'))){_0x88334e[_0x7437('0x1c')]=qs[_0x7437('0x1c')](_0x5194f9[_0x7437('0x31')][_0x7437('0x1c')]);_0x88334e['offset']=qs['offset'](_0x5194f9[_0x7437('0x31')][_0x7437('0x1a')]);}return _0x507cf4['getTags'](_0x88334e);}})[_0x7437('0x24')](function(_0x5f0616){if(_0x5f0616){return _0x5f0616?{'count':_0x38b417,'rows':_0x5f0616}:null;}})['then'](respondWithResult(_0x554f60,null))[_0x7437('0x41')](handleError(_0x554f60,null));};exports['setTags']=function(_0x4155c2,_0x417b70,_0x55d393){if(_0x4155c2[_0x7437('0x48')]['id']){delete _0x4155c2['body']['id'];}return db[_0x7437('0x2c')]['findOne']({'where':{'id':_0x4155c2['params']['id']}})[_0x7437('0x24')](handleEntityNotFound(_0x417b70,null))[_0x7437('0x24')](function(_0x592878){if(_0x592878){return _0x592878[_0x7437('0x53')](_0x4155c2['body'][_0x7437('0x54')]||[]);}return null;})[_0x7437('0x24')](respondWithResult(_0x417b70,null))[_0x7437('0x41')](handleError(_0x417b70,null));}; \ No newline at end of file +var _0xb17e=['keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','ZendeskConfiguration','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','update','findOne','ZendeskField','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query'];(function(_0x2a79e3,_0x4080d1){var _0x548965=function(_0x256f07){while(--_0x256f07){_0x2a79e3['push'](_0x2a79e3['shift']());}};_0x548965(++_0x4080d1);}(_0xb17e,0x1c8));var _0xeb17=function(_0x96c9a5,_0x229e01){_0x96c9a5=_0x96c9a5-0x0;var _0x1aaa9a=_0xb17e[_0x96c9a5];return _0x1aaa9a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb17('0x0'));var zipdir=require(_0xeb17('0x1'));var jsonpatch=require(_0xeb17('0x2'));var rp=require(_0xeb17('0x3'));var moment=require('moment');var BPromise=require(_0xeb17('0x4'));var Mustache=require(_0xeb17('0x5'));var util=require('util');var path=require('path');var sox=require(_0xeb17('0x6'));var csv=require(_0xeb17('0x7'));var ejs=require(_0xeb17('0x8'));var fs=require('fs');var fs_extra=require(_0xeb17('0x9'));var _=require(_0xeb17('0xa'));var squel=require('squel');var crypto=require(_0xeb17('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xeb17('0xc'));var toCsv=require(_0xeb17('0x7'));var querystring=require(_0xeb17('0xd'));var Papa=require(_0xeb17('0xe'));var Redis=require('ioredis');var authService=require(_0xeb17('0xf'));var qs=require(_0xeb17('0x10'));var as=require(_0xeb17('0x11'));var hardwareService=require(_0xeb17('0x12'));var logger=require(_0xeb17('0x13'))(_0xeb17('0x14'));var utils=require(_0xeb17('0x15'));var config=require(_0xeb17('0x16'));var licenseUtil=require(_0xeb17('0x17'));var db=require(_0xeb17('0x18'))['db'];function respondWithStatusCode(_0x1f2e4a,_0x158176){_0x158176=_0x158176||0xcc;return function(_0x254dbe){if(_0x254dbe){return _0x1f2e4a[_0xeb17('0x19')](_0x158176);}return _0x1f2e4a['status'](_0x158176)[_0xeb17('0x1a')]();};}function respondWithResult(_0x58d24d,_0x42189c){_0x42189c=_0x42189c||0xc8;return function(_0x30f7fd){if(_0x30f7fd){return _0x58d24d['status'](_0x42189c)[_0xeb17('0x1b')](_0x30f7fd);}};}function respondWithFilteredResult(_0xbd06f7,_0x32bf3c){return function(_0x8e6336){if(_0x8e6336){var _0xfa5fef=typeof _0x32bf3c[_0xeb17('0x1c')]===_0xeb17('0x1d')&&typeof _0x32bf3c[_0xeb17('0x1e')]===_0xeb17('0x1d');var _0x5db6a8=_0x8e6336['count'];var _0x556106=_0xfa5fef?0x0:_0x32bf3c['offset'];var _0x58d01d=_0xfa5fef?_0x8e6336[_0xeb17('0x1f')]:_0x32bf3c['offset']+_0x32bf3c[_0xeb17('0x1e')];var _0x4f45eb;if(_0x58d01d>=_0x5db6a8){_0x58d01d=_0x5db6a8;_0x4f45eb=0xc8;}else{_0x4f45eb=0xce;}_0xbd06f7[_0xeb17('0x20')](_0x4f45eb);return _0xbd06f7[_0xeb17('0x21')](_0xeb17('0x22'),_0x556106+'-'+_0x58d01d+'/'+_0x5db6a8)[_0xeb17('0x1b')](_0x8e6336);}return null;};}function patchUpdates(_0x852f2b){return function(_0x401608){try{jsonpatch[_0xeb17('0x23')](_0x401608,_0x852f2b,!![]);}catch(_0x3c6f49){return BPromise['reject'](_0x3c6f49);}return _0x401608['save']();};}function saveUpdates(_0x4f8922,_0x11dd2d){return function(_0x19d028){if(_0x19d028){return _0x19d028['update'](_0x4f8922)['then'](function(_0x2718e4){return _0x2718e4;});}return null;};}function removeEntity(_0x486400,_0x1a2628){return function(_0x5227a1){if(_0x5227a1){return _0x5227a1[_0xeb17('0x24')]()[_0xeb17('0x25')](function(){_0x486400[_0xeb17('0x20')](0xcc)[_0xeb17('0x1a')]();});}};}function handleEntityNotFound(_0x1e4ce6,_0x2653b5){return function(_0x19ce07){if(!_0x19ce07){_0x1e4ce6[_0xeb17('0x19')](0x194);}return _0x19ce07;};}function handleError(_0x405a46,_0x32eafd){_0x32eafd=_0x32eafd||0x1f4;return function(_0x5de04a){logger['error'](_0x5de04a[_0xeb17('0x26')]);if(_0x5de04a[_0xeb17('0x27')]){delete _0x5de04a['name'];}_0x405a46[_0xeb17('0x20')](_0x32eafd)[_0xeb17('0x28')](_0x5de04a);};}exports[_0xeb17('0x29')]=function(_0x4b246f,_0x227bc7){var _0x1d45d5={},_0x5eaeea={},_0x151121={'count':0x0,'rows':[]};var _0x56c31c=_[_0xeb17('0x2a')](db['ZendeskConfiguration'][_0xeb17('0x2b')],function(_0x14b13a){return{'name':_0x14b13a[_0xeb17('0x2c')],'type':_0x14b13a[_0xeb17('0x2d')][_0xeb17('0x2e')]};});_0x5eaeea['model']=_[_0xeb17('0x2a')](_0x56c31c,_0xeb17('0x27'));_0x5eaeea[_0xeb17('0x2f')]=_[_0xeb17('0x30')](_0x4b246f[_0xeb17('0x2f')]);_0x5eaeea['filters']=_['intersection'](_0x5eaeea[_0xeb17('0x31')],_0x5eaeea[_0xeb17('0x2f')]);_0x1d45d5[_0xeb17('0x32')]=_[_0xeb17('0x33')](_0x5eaeea[_0xeb17('0x31')],qs[_0xeb17('0x34')](_0x4b246f[_0xeb17('0x2f')][_0xeb17('0x34')]));_0x1d45d5[_0xeb17('0x32')]=_0x1d45d5[_0xeb17('0x32')][_0xeb17('0x35')]?_0x1d45d5['attributes']:_0x5eaeea[_0xeb17('0x31')];if(!_0x4b246f[_0xeb17('0x2f')]['hasOwnProperty'](_0xeb17('0x36'))){_0x1d45d5[_0xeb17('0x1e')]=qs[_0xeb17('0x1e')](_0x4b246f[_0xeb17('0x2f')][_0xeb17('0x1e')]);_0x1d45d5['offset']=qs[_0xeb17('0x1c')](_0x4b246f[_0xeb17('0x2f')]['offset']);}_0x1d45d5[_0xeb17('0x37')]=qs[_0xeb17('0x38')](_0x4b246f['query'][_0xeb17('0x38')]);_0x1d45d5[_0xeb17('0x39')]=qs[_0xeb17('0x3a')](_[_0xeb17('0x3b')](_0x4b246f[_0xeb17('0x2f')],_0x5eaeea[_0xeb17('0x3a')]),_0x56c31c);if(_0x4b246f[_0xeb17('0x2f')][_0xeb17('0x3c')]){_0x1d45d5['where']=_[_0xeb17('0x3d')](_0x1d45d5[_0xeb17('0x39')],{'$or':_[_0xeb17('0x2a')](_0x56c31c,function(_0x293519){if(_0x293519[_0xeb17('0x2d')]!=='VIRTUAL'){var _0x59cbe9={};_0x59cbe9[_0x293519[_0xeb17('0x27')]]={'$like':'%'+_0x4b246f[_0xeb17('0x2f')][_0xeb17('0x3c')]+'%'};return _0x59cbe9;}})});}_0x1d45d5=_[_0xeb17('0x3d')]({},_0x1d45d5,_0x4b246f['options']);var _0x1f2764={'where':_0x1d45d5[_0xeb17('0x39')]};return db[_0xeb17('0x3e')]['count'](_0x1f2764)[_0xeb17('0x25')](function(_0x550e58){_0x151121[_0xeb17('0x1f')]=_0x550e58;if(_0x4b246f[_0xeb17('0x2f')][_0xeb17('0x3f')]){_0x1d45d5[_0xeb17('0x40')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xeb17('0x41')](_0x1d45d5);})[_0xeb17('0x25')](function(_0x36dafd){_0x151121[_0xeb17('0x42')]=_0x36dafd;return _0x151121;})['then'](respondWithFilteredResult(_0x227bc7,_0x1d45d5))['catch'](handleError(_0x227bc7,null));};exports[_0xeb17('0x43')]=function(_0x469a5d,_0x41f689){var _0x5424ea={'raw':![],'where':{'id':_0x469a5d[_0xeb17('0x44')]['id']}},_0x139abd={};_0x139abd['model']=_[_0xeb17('0x30')](db[_0xeb17('0x3e')]['rawAttributes']);_0x139abd[_0xeb17('0x2f')]=_[_0xeb17('0x30')](_0x469a5d[_0xeb17('0x2f')]);_0x139abd['filters']=_[_0xeb17('0x33')](_0x139abd[_0xeb17('0x31')],_0x139abd[_0xeb17('0x2f')]);_0x5424ea['attributes']=_[_0xeb17('0x33')](_0x139abd['model'],qs[_0xeb17('0x34')](_0x469a5d['query']['fields']));_0x5424ea[_0xeb17('0x32')]=_0x5424ea[_0xeb17('0x32')]['length']?_0x5424ea[_0xeb17('0x32')]:_0x139abd[_0xeb17('0x31')];if(_0x469a5d['query'][_0xeb17('0x3f')]){_0x5424ea[_0xeb17('0x40')]=[{'all':!![]}];}_0x5424ea=_[_0xeb17('0x3d')]({},_0x5424ea,_0x469a5d[_0xeb17('0x45')]);return db['ZendeskConfiguration'][_0xeb17('0x46')](_0x5424ea)['then'](handleEntityNotFound(_0x41f689,null))[_0xeb17('0x25')](respondWithResult(_0x41f689,null))[_0xeb17('0x47')](handleError(_0x41f689,null));};exports[_0xeb17('0x48')]=function(_0xf98ca5,_0x763fec){return db[_0xeb17('0x3e')][_0xeb17('0x48')](_0xf98ca5[_0xeb17('0x49')],{})[_0xeb17('0x25')](respondWithResult(_0x763fec,0xc9))['catch'](handleError(_0x763fec,null));};exports[_0xeb17('0x4a')]=function(_0x3bcf29,_0xf13fe5){if(_0x3bcf29['body']['id']){delete _0x3bcf29[_0xeb17('0x49')]['id'];}return db[_0xeb17('0x3e')][_0xeb17('0x46')]({'where':{'id':_0x3bcf29[_0xeb17('0x44')]['id']}})[_0xeb17('0x25')](handleEntityNotFound(_0xf13fe5,null))[_0xeb17('0x25')](saveUpdates(_0x3bcf29['body'],null))[_0xeb17('0x25')](respondWithResult(_0xf13fe5,null))[_0xeb17('0x47')](handleError(_0xf13fe5,null));};exports[_0xeb17('0x24')]=function(_0x1b1599,_0x42926e){return db[_0xeb17('0x3e')][_0xeb17('0x46')]({'where':{'id':_0x1b1599[_0xeb17('0x44')]['id']}})[_0xeb17('0x25')](handleEntityNotFound(_0x42926e,null))[_0xeb17('0x25')](removeEntity(_0x42926e,null))[_0xeb17('0x47')](handleError(_0x42926e,null));};exports['getFields']=function(_0x47ece0,_0x3d2396,_0x443211){var _0x42adcd={};var _0x1ba83f={};var _0x20629f;var _0x2444bc;return db[_0xeb17('0x3e')][_0xeb17('0x4b')]({'where':{'id':_0x47ece0[_0xeb17('0x44')]['id']}})[_0xeb17('0x25')](handleEntityNotFound(_0x3d2396,null))[_0xeb17('0x25')](function(_0x348fbe){if(_0x348fbe){_0x20629f=_0x348fbe;_0x1ba83f[_0xeb17('0x31')]=_[_0xeb17('0x30')](db[_0xeb17('0x4c')]['rawAttributes']);_0x1ba83f[_0xeb17('0x2f')]=_[_0xeb17('0x30')](_0x47ece0[_0xeb17('0x2f')]);_0x1ba83f[_0xeb17('0x3a')]=_['intersection'](_0x1ba83f[_0xeb17('0x31')],_0x1ba83f[_0xeb17('0x2f')]);_0x42adcd['attributes']=_[_0xeb17('0x33')](_0x1ba83f['model'],qs[_0xeb17('0x34')](_0x47ece0['query'][_0xeb17('0x34')]));_0x42adcd[_0xeb17('0x32')]=_0x42adcd['attributes'][_0xeb17('0x35')]?_0x42adcd[_0xeb17('0x32')]:_0x1ba83f[_0xeb17('0x31')];_0x42adcd[_0xeb17('0x37')]=qs['sort'](_0x47ece0[_0xeb17('0x2f')][_0xeb17('0x38')]);_0x42adcd[_0xeb17('0x39')]=qs[_0xeb17('0x3a')](_[_0xeb17('0x3b')](_0x47ece0['query'],_0x1ba83f['filters']));if(_0x47ece0[_0xeb17('0x2f')][_0xeb17('0x3c')]){_0x42adcd[_0xeb17('0x39')]=_[_0xeb17('0x3d')](_0x42adcd['where'],{'$or':_[_0xeb17('0x2a')](_0x42adcd[_0xeb17('0x32')],function(_0x261a1d){var _0x50c77e={};_0x50c77e[_0x261a1d]={'$like':'%'+_0x47ece0[_0xeb17('0x2f')]['filter']+'%'};return _0x50c77e;})});}_0x42adcd=_[_0xeb17('0x3d')]({},_0x42adcd,_0x47ece0[_0xeb17('0x45')]);return _0x20629f['getFields'](_0x42adcd);}})['then'](function(_0x473a03){if(_0x473a03){_0x2444bc=_0x473a03['length'];if(!_0x47ece0[_0xeb17('0x2f')]['hasOwnProperty']('nolimit')){_0x42adcd[_0xeb17('0x1e')]=qs[_0xeb17('0x1e')](_0x47ece0['query'][_0xeb17('0x1e')]);_0x42adcd[_0xeb17('0x1c')]=qs['offset'](_0x47ece0[_0xeb17('0x2f')][_0xeb17('0x1c')]);}return _0x20629f[_0xeb17('0x4d')](_0x42adcd);}})[_0xeb17('0x25')](function(_0x2fa880){if(_0x2fa880){return _0x2fa880?{'count':_0x2444bc,'rows':_0x2fa880}:null;}})[_0xeb17('0x25')](respondWithResult(_0x3d2396,null))['catch'](handleError(_0x3d2396,null));};exports['getSubjects']=function(_0x1e65d7,_0x156a6d,_0x2f97a0){var _0x55d96a={};var _0x3df001={};var _0x32e2dd;var _0x6f27e5;return db[_0xeb17('0x3e')][_0xeb17('0x4b')]({'where':{'id':_0x1e65d7[_0xeb17('0x44')]['id']}})[_0xeb17('0x25')](handleEntityNotFound(_0x156a6d,null))[_0xeb17('0x25')](function(_0x1c1674){if(_0x1c1674){_0x32e2dd=_0x1c1674;_0x3df001[_0xeb17('0x31')]=_['keys'](db[_0xeb17('0x4c')][_0xeb17('0x2b')]);_0x3df001['query']=_['keys'](_0x1e65d7[_0xeb17('0x2f')]);_0x3df001[_0xeb17('0x3a')]=_['intersection'](_0x3df001[_0xeb17('0x31')],_0x3df001[_0xeb17('0x2f')]);_0x55d96a[_0xeb17('0x32')]=_[_0xeb17('0x33')](_0x3df001[_0xeb17('0x31')],qs[_0xeb17('0x34')](_0x1e65d7[_0xeb17('0x2f')][_0xeb17('0x34')]));_0x55d96a[_0xeb17('0x32')]=_0x55d96a[_0xeb17('0x32')][_0xeb17('0x35')]?_0x55d96a['attributes']:_0x3df001[_0xeb17('0x31')];_0x55d96a['order']=qs['sort'](_0x1e65d7[_0xeb17('0x2f')][_0xeb17('0x38')]);_0x55d96a['where']=qs[_0xeb17('0x3a')](_[_0xeb17('0x3b')](_0x1e65d7['query'],_0x3df001[_0xeb17('0x3a')]));if(_0x1e65d7['query'][_0xeb17('0x3c')]){_0x55d96a[_0xeb17('0x39')]=_[_0xeb17('0x3d')](_0x55d96a[_0xeb17('0x39')],{'$or':_[_0xeb17('0x2a')](_0x55d96a[_0xeb17('0x32')],function(_0x4041c5){var _0x252676={};_0x252676[_0x4041c5]={'$like':'%'+_0x1e65d7[_0xeb17('0x2f')][_0xeb17('0x3c')]+'%'};return _0x252676;})});}_0x55d96a=_['merge']({},_0x55d96a,_0x1e65d7[_0xeb17('0x45')]);return _0x32e2dd['getSubjects'](_0x55d96a);}})[_0xeb17('0x25')](function(_0x1dbddf){if(_0x1dbddf){_0x6f27e5=_0x1dbddf[_0xeb17('0x35')];if(!_0x1e65d7['query'][_0xeb17('0x4e')](_0xeb17('0x36'))){_0x55d96a['limit']=qs[_0xeb17('0x1e')](_0x1e65d7[_0xeb17('0x2f')][_0xeb17('0x1e')]);_0x55d96a[_0xeb17('0x1c')]=qs[_0xeb17('0x1c')](_0x1e65d7[_0xeb17('0x2f')]['offset']);}return _0x32e2dd[_0xeb17('0x4f')](_0x55d96a);}})[_0xeb17('0x25')](function(_0x5ec645){if(_0x5ec645){return _0x5ec645?{'count':_0x6f27e5,'rows':_0x5ec645}:null;}})[_0xeb17('0x25')](respondWithResult(_0x156a6d,null))[_0xeb17('0x47')](handleError(_0x156a6d,null));};exports[_0xeb17('0x50')]=function(_0x239952,_0x7b507b,_0x546307){var _0x4bd441={};var _0x248dcf={};var _0x282583;var _0x767531;return db['ZendeskConfiguration'][_0xeb17('0x4b')]({'where':{'id':_0x239952[_0xeb17('0x44')]['id']}})['then'](handleEntityNotFound(_0x7b507b,null))[_0xeb17('0x25')](function(_0x135bb2){if(_0x135bb2){_0x282583=_0x135bb2;_0x248dcf[_0xeb17('0x31')]=_[_0xeb17('0x30')](db[_0xeb17('0x4c')][_0xeb17('0x2b')]);_0x248dcf[_0xeb17('0x2f')]=_[_0xeb17('0x30')](_0x239952['query']);_0x248dcf[_0xeb17('0x3a')]=_[_0xeb17('0x33')](_0x248dcf[_0xeb17('0x31')],_0x248dcf[_0xeb17('0x2f')]);_0x4bd441[_0xeb17('0x32')]=_[_0xeb17('0x33')](_0x248dcf['model'],qs['fields'](_0x239952[_0xeb17('0x2f')][_0xeb17('0x34')]));_0x4bd441[_0xeb17('0x32')]=_0x4bd441['attributes']['length']?_0x4bd441[_0xeb17('0x32')]:_0x248dcf[_0xeb17('0x31')];_0x4bd441[_0xeb17('0x37')]=qs[_0xeb17('0x38')](_0x239952[_0xeb17('0x2f')][_0xeb17('0x38')]);_0x4bd441[_0xeb17('0x39')]=qs[_0xeb17('0x3a')](_['pick'](_0x239952['query'],_0x248dcf[_0xeb17('0x3a')]));if(_0x239952[_0xeb17('0x2f')]['filter']){_0x4bd441[_0xeb17('0x39')]=_[_0xeb17('0x3d')](_0x4bd441[_0xeb17('0x39')],{'$or':_[_0xeb17('0x2a')](_0x4bd441[_0xeb17('0x32')],function(_0xb77592){var _0x1a42ac={};_0x1a42ac[_0xb77592]={'$like':'%'+_0x239952[_0xeb17('0x2f')][_0xeb17('0x3c')]+'%'};return _0x1a42ac;})});}_0x4bd441=_['merge']({},_0x4bd441,_0x239952['options']);return _0x282583[_0xeb17('0x50')](_0x4bd441);}})['then'](function(_0x2047b6){if(_0x2047b6){_0x767531=_0x2047b6[_0xeb17('0x35')];if(!_0x239952[_0xeb17('0x2f')][_0xeb17('0x4e')](_0xeb17('0x36'))){_0x4bd441[_0xeb17('0x1e')]=qs[_0xeb17('0x1e')](_0x239952[_0xeb17('0x2f')][_0xeb17('0x1e')]);_0x4bd441[_0xeb17('0x1c')]=qs[_0xeb17('0x1c')](_0x239952['query']['offset']);}return _0x282583[_0xeb17('0x50')](_0x4bd441);}})[_0xeb17('0x25')](function(_0x44d918){if(_0x44d918){return _0x44d918?{'count':_0x767531,'rows':_0x44d918}:null;}})[_0xeb17('0x25')](respondWithResult(_0x7b507b,null))['catch'](handleError(_0x7b507b,null));};exports[_0xeb17('0x51')]=function(_0x51b0e8,_0x20e567,_0x414c6f){var _0x12cf17={};var _0x27ac95={};var _0x5d9dc0;var _0x47d73b;return db[_0xeb17('0x3e')][_0xeb17('0x4b')]({'where':{'id':_0x51b0e8[_0xeb17('0x44')]['id']}})['then'](handleEntityNotFound(_0x20e567,null))[_0xeb17('0x25')](function(_0x31deba){if(_0x31deba){_0x5d9dc0=_0x31deba;_0x27ac95[_0xeb17('0x31')]=_[_0xeb17('0x30')](db[_0xeb17('0x52')]['rawAttributes']);_0x27ac95['query']=_[_0xeb17('0x30')](_0x51b0e8[_0xeb17('0x2f')]);_0x27ac95['filters']=_[_0xeb17('0x33')](_0x27ac95[_0xeb17('0x31')],_0x27ac95['query']);_0x12cf17[_0xeb17('0x32')]=_[_0xeb17('0x33')](_0x27ac95[_0xeb17('0x31')],qs[_0xeb17('0x34')](_0x51b0e8[_0xeb17('0x2f')]['fields']));_0x12cf17[_0xeb17('0x32')]=_0x12cf17[_0xeb17('0x32')][_0xeb17('0x35')]?_0x12cf17[_0xeb17('0x32')]:_0x27ac95[_0xeb17('0x31')];_0x12cf17[_0xeb17('0x37')]=qs[_0xeb17('0x38')](_0x51b0e8[_0xeb17('0x2f')][_0xeb17('0x38')]);_0x12cf17[_0xeb17('0x39')]=qs[_0xeb17('0x3a')](_[_0xeb17('0x3b')](_0x51b0e8[_0xeb17('0x2f')],_0x27ac95[_0xeb17('0x3a')]));if(_0x51b0e8[_0xeb17('0x2f')]['filter']){_0x12cf17[_0xeb17('0x39')]=_[_0xeb17('0x3d')](_0x12cf17[_0xeb17('0x39')],{'$or':_[_0xeb17('0x2a')](_0x12cf17[_0xeb17('0x32')],function(_0x1762f8){var _0x247463={};_0x247463[_0x1762f8]={'$like':'%'+_0x51b0e8[_0xeb17('0x2f')][_0xeb17('0x3c')]+'%'};return _0x247463;})});}_0x12cf17=_[_0xeb17('0x3d')]({},_0x12cf17,_0x51b0e8[_0xeb17('0x45')]);return _0x5d9dc0['getTags'](_0x12cf17);}})[_0xeb17('0x25')](function(_0x153e0f){if(_0x153e0f){_0x47d73b=_0x153e0f['length'];if(!_0x51b0e8[_0xeb17('0x2f')][_0xeb17('0x4e')](_0xeb17('0x36'))){_0x12cf17[_0xeb17('0x1e')]=qs[_0xeb17('0x1e')](_0x51b0e8['query']['limit']);_0x12cf17[_0xeb17('0x1c')]=qs['offset'](_0x51b0e8['query'][_0xeb17('0x1c')]);}return _0x5d9dc0['getTags'](_0x12cf17);}})['then'](function(_0x3bfba8){if(_0x3bfba8){return _0x3bfba8?{'count':_0x47d73b,'rows':_0x3bfba8}:null;}})[_0xeb17('0x25')](respondWithResult(_0x20e567,null))[_0xeb17('0x47')](handleError(_0x20e567,null));};exports[_0xeb17('0x53')]=function(_0x11d55d,_0x4cfd89,_0x5b1464){if(_0x11d55d['body']['id']){delete _0x11d55d['body']['id'];}return db[_0xeb17('0x3e')][_0xeb17('0x4b')]({'where':{'id':_0x11d55d[_0xeb17('0x44')]['id']}})[_0xeb17('0x25')](handleEntityNotFound(_0x4cfd89,null))['then'](function(_0x41c8d5){if(_0x41c8d5){return _0x41c8d5[_0xeb17('0x53')](_0x11d55d[_0xeb17('0x49')]['ids']||[]);}return null;})[_0xeb17('0x25')](respondWithResult(_0x4cfd89,null))['catch'](handleError(_0x4cfd89,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 2fa7846..dbbe7a2 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 _0xed3c=['util','../../config/logger','api','bluebird','request-promise','path','./intZendeskConfiguration.attributes','exports','lodash'];(function(_0x1bed61,_0x120a04){var _0x36e817=function(_0x162ca7){while(--_0x162ca7){_0x1bed61['push'](_0x1bed61['shift']());}};_0x36e817(++_0x120a04);}(_0xed3c,0x1a6));var _0xced3=function(_0xd256a1,_0x2aae80){_0xd256a1=_0xd256a1-0x0;var _0x2a11a4=_0xed3c[_0xd256a1];return _0x2a11a4;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require('moment');var BPromise=require(_0xced3('0x4'));var rp=require(_0xced3('0x5'));var fs=require('fs');var path=require(_0xced3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x2f92f8,_0x1cd694){return _0x2f92f8['define']('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d25=['api','moment','bluebird','request-promise','path','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger'];(function(_0x2ae5ce,_0x481760){var _0x3ccd3c=function(_0x3b870c){while(--_0x3b870c){_0x2ae5ce['push'](_0x2ae5ce['shift']());}};_0x3ccd3c(++_0x481760);}(_0x7d25,0x8a));var _0x57d2=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7d25[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('0x9'),'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 4b685ee..cbfb2c9 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 _0xe0b7=['request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe0b7,0x137));var _0x7e0b=function(_0x5391f4,_0x4254f3){_0x5391f4=_0x5391f4-0x0;var _0x1551cc=_0xe0b7[_0x5391f4];return _0x1551cc;};'use strict';var _=require(_0x7e0b('0x0'));var util=require(_0x7e0b('0x1'));var moment=require(_0x7e0b('0x2'));var BPromise=require(_0x7e0b('0x3'));var rs=require(_0x7e0b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e0b('0x5'))['db'];var utils=require(_0x7e0b('0x6'));var logger=require('../../config/logger')(_0x7e0b('0x7'));var config=require(_0x7e0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7e0b('0x9')][_0x7e0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22b61f,_0xb72179,_0x50862a){return new BPromise(function(_0x471f05,_0x273615){return client[_0x7e0b('0xb')](_0x22b61f,_0x50862a)[_0x7e0b('0xc')](function(_0x43f4e4){logger[_0x7e0b('0xd')](_0x7e0b('0xe'),_0xb72179,'request\x20sent');logger[_0x7e0b('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0xb72179,_0x7e0b('0x10'),JSON[_0x7e0b('0x11')](_0x43f4e4));if(_0x43f4e4[_0x7e0b('0x12')]){if(_0x43f4e4[_0x7e0b('0x12')][_0x7e0b('0x13')]===0x1f4){logger[_0x7e0b('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0xb72179,_0x43f4e4[_0x7e0b('0x12')][_0x7e0b('0x14')]);return _0x273615(_0x43f4e4[_0x7e0b('0x12')]['message']);}logger['error'](_0x7e0b('0xe'),_0xb72179,_0x43f4e4[_0x7e0b('0x12')][_0x7e0b('0x14')]);return _0x471f05(_0x43f4e4[_0x7e0b('0x12')][_0x7e0b('0x14')]);}else{logger[_0x7e0b('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0xb72179,_0x7e0b('0x10'));_0x471f05(_0x43f4e4[_0x7e0b('0x15')][_0x7e0b('0x14')]);}})[_0x7e0b('0x16')](function(_0x53cab5){logger[_0x7e0b('0x12')](_0x7e0b('0xe'),_0xb72179,_0x53cab5);_0x273615(_0x53cab5);});});} \ No newline at end of file +var _0xcfc0=['../../config/environment','jayson/promise','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x32c2be,_0x30f256){var _0x1541d3=function(_0x36af99){while(--_0x36af99){_0x32c2be['push'](_0x32c2be['shift']());}};_0x1541d3(++_0x30f256);}(_0xcfc0,0x167));var _0x0cfc=function(_0x2c4c5d,_0xd4c210){_0x2c4c5d=_0x2c4c5d-0x0;var _0x3d4e6f=_0xcfc0[_0x2c4c5d];return _0x3d4e6f;};'use strict';var _=require(_0x0cfc('0x0'));var util=require(_0x0cfc('0x1'));var moment=require(_0x0cfc('0x2'));var BPromise=require(_0x0cfc('0x3'));var rs=require(_0x0cfc('0x4'));var fs=require('fs');var Redis=require(_0x0cfc('0x5'));var db=require(_0x0cfc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cfc('0x7'))(_0x0cfc('0x8'));var config=require(_0x0cfc('0x9'));var jayson=require(_0x0cfc('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45d832,_0x1e9c0c,_0x553cd4){return new BPromise(function(_0x162a31,_0x2554bb){return client[_0x0cfc('0xb')](_0x45d832,_0x553cd4)[_0x0cfc('0xc')](function(_0x36ea27){logger['info'](_0x0cfc('0xd'),_0x1e9c0c,_0x0cfc('0xe'));logger[_0x0cfc('0xf')](_0x0cfc('0x10'),_0x1e9c0c,_0x0cfc('0xe'),JSON[_0x0cfc('0x11')](_0x36ea27));if(_0x36ea27[_0x0cfc('0x12')]){if(_0x36ea27[_0x0cfc('0x12')][_0x0cfc('0x13')]===0x1f4){logger[_0x0cfc('0x12')](_0x0cfc('0xd'),_0x1e9c0c,_0x36ea27['error'][_0x0cfc('0x14')]);return _0x2554bb(_0x36ea27[_0x0cfc('0x12')][_0x0cfc('0x14')]);}logger[_0x0cfc('0x12')](_0x0cfc('0xd'),_0x1e9c0c,_0x36ea27['error'][_0x0cfc('0x14')]);return _0x162a31(_0x36ea27[_0x0cfc('0x12')]['message']);}else{logger[_0x0cfc('0x15')](_0x0cfc('0xd'),_0x1e9c0c,'request\x20sent');_0x162a31(_0x36ea27['result'][_0x0cfc('0x14')]);}})[_0x0cfc('0x16')](function(_0xde6364){logger[_0x0cfc('0x12')](_0x0cfc('0xd'),_0x1e9c0c,_0xde6364);_0x2554bb(_0xde6364);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 30c1cdf..c63aeec 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 _0x5455=['../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x5455,0xef));var _0x5545=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5455[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x5545('0x0'));var util=require(_0x5545('0x1'));var path=require(_0x5545('0x2'));var timeout=require(_0x5545('0x3'));var express=require(_0x5545('0x4'));var router=express[_0x5545('0x5')]();var fs_extra=require(_0x5545('0x6'));var auth=require(_0x5545('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5545('0x8'));var controller=require('./intZendeskField.controller');router[_0x5545('0x9')]('/',auth[_0x5545('0xa')](),controller[_0x5545('0xb')]);router['get'](_0x5545('0xc'),auth[_0x5545('0xa')](),controller[_0x5545('0xd')]);router[_0x5545('0xe')]('/',auth[_0x5545('0xa')](),controller['create']);router[_0x5545('0xf')](_0x5545('0xc'),auth[_0x5545('0xa')](),controller[_0x5545('0x10')]);router[_0x5545('0x11')](_0x5545('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x5545('0x12')]=router; \ No newline at end of file +var _0x658f=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get'];(function(_0x14d996,_0x403389){var _0x577f12=function(_0x201992){while(--_0x201992){_0x14d996['push'](_0x14d996['shift']());}};_0x577f12(++_0x403389);}(_0x658f,0xbc));var _0xf658=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x658f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf658('0x0'));var util=require(_0xf658('0x1'));var path=require(_0xf658('0x2'));var timeout=require('connect-timeout');var express=require(_0xf658('0x3'));var router=express[_0xf658('0x4')]();var fs_extra=require(_0xf658('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf658('0x6'));var config=require(_0xf658('0x7'));var controller=require(_0xf658('0x8'));router['get']('/',auth[_0xf658('0x9')](),controller[_0xf658('0xa')]);router[_0xf658('0xb')](_0xf658('0xc'),auth['isAuthenticated'](),controller[_0xf658('0xd')]);router[_0xf658('0xe')]('/',auth['isAuthenticated'](),controller[_0xf658('0xf')]);router['put'](_0xf658('0xc'),auth[_0xf658('0x9')](),controller[_0xf658('0x10')]);router[_0xf658('0x11')](_0xf658('0xc'),auth[_0xf658('0x9')](),controller[_0xf658('0x12')]);module[_0xf658('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index d7abcad..92f0af5 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 _0x0ca9=['exports','ENUM','keyValue','string','STRING','variable','customVariable','BOOLEAN','sequelize'];(function(_0x5d6be3,_0x2f3535){var _0x5461df=function(_0x16d32f){while(--_0x16d32f){_0x5d6be3['push'](_0x5d6be3['shift']());}};_0x5461df(++_0x2f3535);}(_0x0ca9,0xbc));var _0x90ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ca9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x90ca('0x0'));module[_0x90ca('0x1')]={'type':{'type':Sequelize[_0x90ca('0x2')]('string','variable','customVariable',_0x90ca('0x3'),'picklist'),'defaultValue':_0x90ca('0x4')},'content':{'type':Sequelize[_0x90ca('0x5')]},'key':{'type':Sequelize[_0x90ca('0x5')]},'keyType':{'type':Sequelize[_0x90ca('0x2')]('string',_0x90ca('0x6'),_0x90ca('0x7'))},'keyContent':{'type':Sequelize[_0x90ca('0x5')]},'idField':{'type':Sequelize[_0x90ca('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x90ca('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcfb0=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist'];(function(_0x489420,_0x3af830){var _0x2104d8=function(_0x48a621){while(--_0x48a621){_0x489420['push'](_0x489420['shift']());}};_0x2104d8(++_0x3af830);}(_0xcfb0,0xd2));var _0x0cfb=function(_0x28347d,_0x2494c4){_0x28347d=_0x28347d-0x0;var _0x1c8324=_0xcfb0[_0x28347d];return _0x1c8324;};'use strict';var Sequelize=require(_0x0cfb('0x0'));module[_0x0cfb('0x1')]={'type':{'type':Sequelize[_0x0cfb('0x2')]('string',_0x0cfb('0x3'),_0x0cfb('0x4'),'keyValue',_0x0cfb('0x5')),'defaultValue':_0x0cfb('0x6')},'content':{'type':Sequelize[_0x0cfb('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x0cfb('0x6'),_0x0cfb('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x0cfb('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0cfb('0x7')]},'customField':{'type':Sequelize[_0x0cfb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0cfb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 1614eb9..5c90b2e 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 _0xe9ad=['status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','catch','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','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'];(function(_0x4fa738,_0x2a491c){var _0x55bf55=function(_0x185d53){while(--_0x185d53){_0x4fa738['push'](_0x4fa738['shift']());}};_0x55bf55(++_0x2a491c);}(_0xe9ad,0x82));var _0xde9a=function(_0x5e9d35,_0x382c91){_0x5e9d35=_0x5e9d35-0x0;var _0x3beb2e=_0xe9ad[_0x5e9d35];return _0x3beb2e;};'use strict';var emlformat=require(_0xde9a('0x0'));var rimraf=require(_0xde9a('0x1'));var zipdir=require(_0xde9a('0x2'));var jsonpatch=require(_0xde9a('0x3'));var rp=require(_0xde9a('0x4'));var moment=require(_0xde9a('0x5'));var BPromise=require(_0xde9a('0x6'));var Mustache=require('mustache');var util=require(_0xde9a('0x7'));var path=require(_0xde9a('0x8'));var sox=require(_0xde9a('0x9'));var csv=require(_0xde9a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde9a('0xb'));var _=require(_0xde9a('0xc'));var squel=require(_0xde9a('0xd'));var crypto=require('crypto');var jsforce=require(_0xde9a('0xe'));var deskjs=require(_0xde9a('0xf'));var toCsv=require(_0xde9a('0xa'));var querystring=require(_0xde9a('0x10'));var Papa=require(_0xde9a('0x11'));var Redis=require(_0xde9a('0x12'));var authService=require(_0xde9a('0x13'));var qs=require(_0xde9a('0x14'));var as=require(_0xde9a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde9a('0x16'))(_0xde9a('0x17'));var utils=require(_0xde9a('0x18'));var config=require(_0xde9a('0x19'));var licenseUtil=require(_0xde9a('0x1a'));var db=require(_0xde9a('0x1b'))['db'];function respondWithStatusCode(_0x1cb3bd,_0x3a9b1a){_0x3a9b1a=_0x3a9b1a||0xcc;return function(_0xd81956){if(_0xd81956){return _0x1cb3bd['sendStatus'](_0x3a9b1a);}return _0x1cb3bd[_0xde9a('0x1c')](_0x3a9b1a)[_0xde9a('0x1d')]();};}function respondWithResult(_0x2f2e11,_0x267d5b){_0x267d5b=_0x267d5b||0xc8;return function(_0x1c1873){if(_0x1c1873){return _0x2f2e11[_0xde9a('0x1c')](_0x267d5b)[_0xde9a('0x1e')](_0x1c1873);}};}function respondWithFilteredResult(_0x432d3c,_0x3f0e39){return function(_0x474713){if(_0x474713){var _0x50ffb8=typeof _0x3f0e39[_0xde9a('0x1f')]===_0xde9a('0x20')&&typeof _0x3f0e39[_0xde9a('0x21')]===_0xde9a('0x20');var _0x454156=_0x474713['count'];var _0x12ba7f=_0x50ffb8?0x0:_0x3f0e39[_0xde9a('0x1f')];var _0x3b89ef=_0x50ffb8?_0x474713['count']:_0x3f0e39[_0xde9a('0x1f')]+_0x3f0e39['limit'];var _0x8f481a;if(_0x3b89ef>=_0x454156){_0x3b89ef=_0x454156;_0x8f481a=0xc8;}else{_0x8f481a=0xce;}_0x432d3c['status'](_0x8f481a);return _0x432d3c[_0xde9a('0x22')](_0xde9a('0x23'),_0x12ba7f+'-'+_0x3b89ef+'/'+_0x454156)[_0xde9a('0x1e')](_0x474713);}return null;};}function patchUpdates(_0x4add81){return function(_0x43b1bb){try{jsonpatch[_0xde9a('0x24')](_0x43b1bb,_0x4add81,!![]);}catch(_0x4e4e02){return BPromise['reject'](_0x4e4e02);}return _0x43b1bb[_0xde9a('0x25')]();};}function saveUpdates(_0x416b36,_0x56550b){return function(_0x290d8d){if(_0x290d8d){return _0x290d8d[_0xde9a('0x26')](_0x416b36)[_0xde9a('0x27')](function(_0x402b06){return _0x402b06;});}return null;};}function removeEntity(_0xa48b6b,_0x284c96){return function(_0x544f9d){if(_0x544f9d){return _0x544f9d[_0xde9a('0x28')]()[_0xde9a('0x27')](function(){_0xa48b6b[_0xde9a('0x1c')](0xcc)[_0xde9a('0x1d')]();});}};}function handleEntityNotFound(_0xfd4b9d,_0xdcc5d2){return function(_0xbc8e99){if(!_0xbc8e99){_0xfd4b9d[_0xde9a('0x29')](0x194);}return _0xbc8e99;};}function handleError(_0x125720,_0x490b11){_0x490b11=_0x490b11||0x1f4;return function(_0x5ab5e5){logger[_0xde9a('0x2a')](_0x5ab5e5[_0xde9a('0x2b')]);if(_0x5ab5e5[_0xde9a('0x2c')]){delete _0x5ab5e5[_0xde9a('0x2c')];}_0x125720['status'](_0x490b11)[_0xde9a('0x2d')](_0x5ab5e5);};}exports[_0xde9a('0x2e')]=function(_0x467ce2,_0x51806d){var _0x3bd254={},_0x5890c5={},_0xff4daf={'count':0x0,'rows':[]};var _0x5d238f=_[_0xde9a('0x2f')](db[_0xde9a('0x30')][_0xde9a('0x31')],function(_0x422b05){return{'name':_0x422b05[_0xde9a('0x32')],'type':_0x422b05[_0xde9a('0x33')][_0xde9a('0x34')]};});_0x5890c5['model']=_[_0xde9a('0x2f')](_0x5d238f,_0xde9a('0x2c'));_0x5890c5[_0xde9a('0x35')]=_[_0xde9a('0x36')](_0x467ce2[_0xde9a('0x35')]);_0x5890c5[_0xde9a('0x37')]=_[_0xde9a('0x38')](_0x5890c5[_0xde9a('0x39')],_0x5890c5[_0xde9a('0x35')]);_0x3bd254[_0xde9a('0x3a')]=_[_0xde9a('0x38')](_0x5890c5[_0xde9a('0x39')],qs[_0xde9a('0x3b')](_0x467ce2[_0xde9a('0x35')]['fields']));_0x3bd254['attributes']=_0x3bd254[_0xde9a('0x3a')]['length']?_0x3bd254[_0xde9a('0x3a')]:_0x5890c5[_0xde9a('0x39')];if(!_0x467ce2['query'][_0xde9a('0x3c')](_0xde9a('0x3d'))){_0x3bd254[_0xde9a('0x21')]=qs['limit'](_0x467ce2['query'][_0xde9a('0x21')]);_0x3bd254[_0xde9a('0x1f')]=qs['offset'](_0x467ce2[_0xde9a('0x35')][_0xde9a('0x1f')]);}_0x3bd254[_0xde9a('0x3e')]=qs[_0xde9a('0x3f')](_0x467ce2[_0xde9a('0x35')][_0xde9a('0x3f')]);_0x3bd254[_0xde9a('0x40')]=qs[_0xde9a('0x37')](_[_0xde9a('0x41')](_0x467ce2[_0xde9a('0x35')],_0x5890c5['filters']),_0x5d238f);if(_0x467ce2[_0xde9a('0x35')][_0xde9a('0x42')]){_0x3bd254[_0xde9a('0x40')]=_[_0xde9a('0x43')](_0x3bd254['where'],{'$or':_[_0xde9a('0x2f')](_0x5d238f,function(_0xbdfe73){if(_0xbdfe73[_0xde9a('0x33')]!==_0xde9a('0x44')){var _0x22381c={};_0x22381c[_0xbdfe73[_0xde9a('0x2c')]]={'$like':'%'+_0x467ce2['query'][_0xde9a('0x42')]+'%'};return _0x22381c;}})});}_0x3bd254=_[_0xde9a('0x43')]({},_0x3bd254,_0x467ce2['options']);var _0x42d263={'where':_0x3bd254[_0xde9a('0x40')]};return db[_0xde9a('0x30')][_0xde9a('0x45')](_0x42d263)[_0xde9a('0x27')](function(_0x5ccb51){_0xff4daf[_0xde9a('0x45')]=_0x5ccb51;if(_0x467ce2[_0xde9a('0x35')][_0xde9a('0x46')]){_0x3bd254[_0xde9a('0x47')]=[{'all':!![]}];}return db[_0xde9a('0x30')][_0xde9a('0x48')](_0x3bd254);})[_0xde9a('0x27')](function(_0x2b87f0){_0xff4daf['rows']=_0x2b87f0;return _0xff4daf;})[_0xde9a('0x27')](respondWithFilteredResult(_0x51806d,_0x3bd254))[_0xde9a('0x49')](handleError(_0x51806d,null));};exports['show']=function(_0x236522,_0x5bf795){var _0x37736b={'raw':!![],'where':{'id':_0x236522[_0xde9a('0x4a')]['id']}},_0x229181={};_0x229181[_0xde9a('0x39')]=_[_0xde9a('0x36')](db[_0xde9a('0x30')][_0xde9a('0x31')]);_0x229181[_0xde9a('0x35')]=_['keys'](_0x236522['query']);_0x229181[_0xde9a('0x37')]=_[_0xde9a('0x38')](_0x229181['model'],_0x229181['query']);_0x37736b[_0xde9a('0x3a')]=_[_0xde9a('0x38')](_0x229181[_0xde9a('0x39')],qs[_0xde9a('0x3b')](_0x236522[_0xde9a('0x35')]['fields']));_0x37736b[_0xde9a('0x3a')]=_0x37736b['attributes']['length']?_0x37736b[_0xde9a('0x3a')]:_0x229181[_0xde9a('0x39')];if(_0x236522['query'][_0xde9a('0x46')]){_0x37736b[_0xde9a('0x47')]=[{'all':!![]}];}_0x37736b=_['merge']({},_0x37736b,_0x236522[_0xde9a('0x4b')]);return db[_0xde9a('0x30')][_0xde9a('0x4c')](_0x37736b)[_0xde9a('0x27')](handleEntityNotFound(_0x5bf795,null))[_0xde9a('0x27')](respondWithResult(_0x5bf795,null))[_0xde9a('0x49')](handleError(_0x5bf795,null));};exports[_0xde9a('0x4d')]=function(_0x58c343,_0x57d705){return db['ZendeskField']['create'](_0x58c343[_0xde9a('0x4e')],{})[_0xde9a('0x27')](respondWithResult(_0x57d705,0xc9))[_0xde9a('0x49')](handleError(_0x57d705,null));};exports[_0xde9a('0x26')]=function(_0x31de98,_0xe4c867){if(_0x31de98[_0xde9a('0x4e')]['id']){delete _0x31de98[_0xde9a('0x4e')]['id'];}return db[_0xde9a('0x30')][_0xde9a('0x4c')]({'where':{'id':_0x31de98[_0xde9a('0x4a')]['id']}})[_0xde9a('0x27')](handleEntityNotFound(_0xe4c867,null))['then'](saveUpdates(_0x31de98[_0xde9a('0x4e')],null))[_0xde9a('0x27')](respondWithResult(_0xe4c867,null))[_0xde9a('0x49')](handleError(_0xe4c867,null));};exports[_0xde9a('0x28')]=function(_0xc6d00b,_0x27524f){return db[_0xde9a('0x30')][_0xde9a('0x4c')]({'where':{'id':_0xc6d00b[_0xde9a('0x4a')]['id']}})[_0xde9a('0x27')](handleEntityNotFound(_0x27524f,null))['then'](removeEntity(_0x27524f,null))['catch'](handleError(_0x27524f,null));}; \ No newline at end of file +var _0x71c8=['query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','map','ZendeskField','fieldName','model'];(function(_0x54ddd7,_0x223146){var _0x24513c=function(_0x2deba1){while(--_0x2deba1){_0x54ddd7['push'](_0x54ddd7['shift']());}};_0x24513c(++_0x223146);}(_0x71c8,0x149));var _0x871c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71c8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x871c('0x0'));var rimraf=require(_0x871c('0x1'));var zipdir=require(_0x871c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x871c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x871c('0x4'));var util=require('util');var path=require(_0x871c('0x5'));var sox=require(_0x871c('0x6'));var csv=require(_0x871c('0x7'));var ejs=require(_0x871c('0x8'));var fs=require('fs');var fs_extra=require(_0x871c('0x9'));var _=require('lodash');var squel=require(_0x871c('0xa'));var crypto=require('crypto');var jsforce=require(_0x871c('0xb'));var deskjs=require(_0x871c('0xc'));var toCsv=require(_0x871c('0x7'));var querystring=require(_0x871c('0xd'));var Papa=require(_0x871c('0xe'));var Redis=require(_0x871c('0xf'));var authService=require(_0x871c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x871c('0x11'));var hardwareService=require(_0x871c('0x12'));var logger=require(_0x871c('0x13'))(_0x871c('0x14'));var utils=require(_0x871c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x871c('0x16'));var db=require(_0x871c('0x17'))['db'];function respondWithStatusCode(_0x2af14b,_0x469d87){_0x469d87=_0x469d87||0xcc;return function(_0x521db7){if(_0x521db7){return _0x2af14b[_0x871c('0x18')](_0x469d87);}return _0x2af14b['status'](_0x469d87)[_0x871c('0x19')]();};}function respondWithResult(_0x1dd476,_0x42eafc){_0x42eafc=_0x42eafc||0xc8;return function(_0x46a9b0){if(_0x46a9b0){return _0x1dd476[_0x871c('0x1a')](_0x42eafc)['json'](_0x46a9b0);}};}function respondWithFilteredResult(_0x35d49e,_0xa02784){return function(_0x32354a){if(_0x32354a){var _0xacf7c9=typeof _0xa02784[_0x871c('0x1b')]===_0x871c('0x1c')&&typeof _0xa02784[_0x871c('0x1d')]===_0x871c('0x1c');var _0x33b538=_0x32354a[_0x871c('0x1e')];var _0x47c43e=_0xacf7c9?0x0:_0xa02784[_0x871c('0x1b')];var _0xce43e2=_0xacf7c9?_0x32354a[_0x871c('0x1e')]:_0xa02784[_0x871c('0x1b')]+_0xa02784[_0x871c('0x1d')];var _0x268fec;if(_0xce43e2>=_0x33b538){_0xce43e2=_0x33b538;_0x268fec=0xc8;}else{_0x268fec=0xce;}_0x35d49e['status'](_0x268fec);return _0x35d49e[_0x871c('0x1f')](_0x871c('0x20'),_0x47c43e+'-'+_0xce43e2+'/'+_0x33b538)['json'](_0x32354a);}return null;};}function patchUpdates(_0x320f7f){return function(_0x1bb7f0){try{jsonpatch[_0x871c('0x21')](_0x1bb7f0,_0x320f7f,!![]);}catch(_0x520e22){return BPromise['reject'](_0x520e22);}return _0x1bb7f0[_0x871c('0x22')]();};}function saveUpdates(_0x2d8fe0,_0x79d971){return function(_0x58fbde){if(_0x58fbde){return _0x58fbde[_0x871c('0x23')](_0x2d8fe0)['then'](function(_0x55d771){return _0x55d771;});}return null;};}function removeEntity(_0x8de45a,_0x86ffb5){return function(_0x2cc6c0){if(_0x2cc6c0){return _0x2cc6c0[_0x871c('0x24')]()[_0x871c('0x25')](function(){_0x8de45a[_0x871c('0x1a')](0xcc)[_0x871c('0x19')]();});}};}function handleEntityNotFound(_0x572655,_0x5734a4){return function(_0x459e03){if(!_0x459e03){_0x572655[_0x871c('0x18')](0x194);}return _0x459e03;};}function handleError(_0x105e2f,_0x55c132){_0x55c132=_0x55c132||0x1f4;return function(_0x52b636){logger[_0x871c('0x26')](_0x52b636['stack']);if(_0x52b636[_0x871c('0x27')]){delete _0x52b636[_0x871c('0x27')];}_0x105e2f[_0x871c('0x1a')](_0x55c132)[_0x871c('0x28')](_0x52b636);};}exports[_0x871c('0x29')]=function(_0x588126,_0x37b66e){var _0x235563={},_0x22b055={},_0x2bd5fa={'count':0x0,'rows':[]};var _0x472ac2=_[_0x871c('0x2a')](db[_0x871c('0x2b')]['rawAttributes'],function(_0x360897){return{'name':_0x360897[_0x871c('0x2c')],'type':_0x360897['type']['key']};});_0x22b055[_0x871c('0x2d')]=_[_0x871c('0x2a')](_0x472ac2,_0x871c('0x27'));_0x22b055[_0x871c('0x2e')]=_[_0x871c('0x2f')](_0x588126[_0x871c('0x2e')]);_0x22b055[_0x871c('0x30')]=_['intersection'](_0x22b055['model'],_0x22b055['query']);_0x235563[_0x871c('0x31')]=_[_0x871c('0x32')](_0x22b055[_0x871c('0x2d')],qs['fields'](_0x588126[_0x871c('0x2e')][_0x871c('0x33')]));_0x235563['attributes']=_0x235563[_0x871c('0x31')][_0x871c('0x34')]?_0x235563[_0x871c('0x31')]:_0x22b055[_0x871c('0x2d')];if(!_0x588126['query'][_0x871c('0x35')](_0x871c('0x36'))){_0x235563[_0x871c('0x1d')]=qs['limit'](_0x588126[_0x871c('0x2e')][_0x871c('0x1d')]);_0x235563[_0x871c('0x1b')]=qs['offset'](_0x588126['query'][_0x871c('0x1b')]);}_0x235563[_0x871c('0x37')]=qs[_0x871c('0x38')](_0x588126['query'][_0x871c('0x38')]);_0x235563[_0x871c('0x39')]=qs[_0x871c('0x30')](_[_0x871c('0x3a')](_0x588126[_0x871c('0x2e')],_0x22b055[_0x871c('0x30')]),_0x472ac2);if(_0x588126[_0x871c('0x2e')][_0x871c('0x3b')]){_0x235563[_0x871c('0x39')]=_[_0x871c('0x3c')](_0x235563[_0x871c('0x39')],{'$or':_['map'](_0x472ac2,function(_0x41c964){if(_0x41c964[_0x871c('0x3d')]!==_0x871c('0x3e')){var _0x118af2={};_0x118af2[_0x41c964[_0x871c('0x27')]]={'$like':'%'+_0x588126[_0x871c('0x2e')][_0x871c('0x3b')]+'%'};return _0x118af2;}})});}_0x235563=_['merge']({},_0x235563,_0x588126[_0x871c('0x3f')]);var _0x1fd3c5={'where':_0x235563[_0x871c('0x39')]};return db[_0x871c('0x2b')][_0x871c('0x1e')](_0x1fd3c5)['then'](function(_0xfdfffd){_0x2bd5fa[_0x871c('0x1e')]=_0xfdfffd;if(_0x588126[_0x871c('0x2e')][_0x871c('0x40')]){_0x235563[_0x871c('0x41')]=[{'all':!![]}];}return db[_0x871c('0x2b')][_0x871c('0x42')](_0x235563);})[_0x871c('0x25')](function(_0x13a9fe){_0x2bd5fa[_0x871c('0x43')]=_0x13a9fe;return _0x2bd5fa;})[_0x871c('0x25')](respondWithFilteredResult(_0x37b66e,_0x235563))[_0x871c('0x44')](handleError(_0x37b66e,null));};exports[_0x871c('0x45')]=function(_0x229ad9,_0x5ab6e1){var _0x2c490c={'raw':!![],'where':{'id':_0x229ad9[_0x871c('0x46')]['id']}},_0x2d7454={};_0x2d7454[_0x871c('0x2d')]=_[_0x871c('0x2f')](db[_0x871c('0x2b')][_0x871c('0x47')]);_0x2d7454[_0x871c('0x2e')]=_[_0x871c('0x2f')](_0x229ad9[_0x871c('0x2e')]);_0x2d7454[_0x871c('0x30')]=_[_0x871c('0x32')](_0x2d7454['model'],_0x2d7454['query']);_0x2c490c[_0x871c('0x31')]=_[_0x871c('0x32')](_0x2d7454[_0x871c('0x2d')],qs['fields'](_0x229ad9[_0x871c('0x2e')][_0x871c('0x33')]));_0x2c490c[_0x871c('0x31')]=_0x2c490c[_0x871c('0x31')]['length']?_0x2c490c['attributes']:_0x2d7454[_0x871c('0x2d')];if(_0x229ad9[_0x871c('0x2e')][_0x871c('0x40')]){_0x2c490c[_0x871c('0x41')]=[{'all':!![]}];}_0x2c490c=_['merge']({},_0x2c490c,_0x229ad9[_0x871c('0x3f')]);return db[_0x871c('0x2b')][_0x871c('0x48')](_0x2c490c)[_0x871c('0x25')](handleEntityNotFound(_0x5ab6e1,null))[_0x871c('0x25')](respondWithResult(_0x5ab6e1,null))['catch'](handleError(_0x5ab6e1,null));};exports['create']=function(_0x195f11,_0x37d0f1){return db[_0x871c('0x2b')][_0x871c('0x49')](_0x195f11[_0x871c('0x4a')],{})['then'](respondWithResult(_0x37d0f1,0xc9))[_0x871c('0x44')](handleError(_0x37d0f1,null));};exports[_0x871c('0x23')]=function(_0x3c951c,_0x2ba734){if(_0x3c951c[_0x871c('0x4a')]['id']){delete _0x3c951c[_0x871c('0x4a')]['id'];}return db[_0x871c('0x2b')][_0x871c('0x48')]({'where':{'id':_0x3c951c['params']['id']}})[_0x871c('0x25')](handleEntityNotFound(_0x2ba734,null))[_0x871c('0x25')](saveUpdates(_0x3c951c['body'],null))['then'](respondWithResult(_0x2ba734,null))[_0x871c('0x44')](handleError(_0x2ba734,null));};exports[_0x871c('0x24')]=function(_0x4bf515,_0x5ada2e){return db[_0x871c('0x2b')]['find']({'where':{'id':_0x4bf515[_0x871c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ada2e,null))['then'](removeEntity(_0x5ada2e,null))[_0x871c('0x44')](handleError(_0x5ada2e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 590b731..f4440b3 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 _0x1be8=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intZendeskField.attributes','exports','define'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x1be8,0xc7));var _0x81be=function(_0x322f4d,_0x2211c6){_0x322f4d=_0x322f4d-0x0;var _0x548443=_0x1be8[_0x322f4d];return _0x548443;};'use strict';var _=require(_0x81be('0x0'));var util=require(_0x81be('0x1'));var logger=require(_0x81be('0x2'))(_0x81be('0x3'));var moment=require(_0x81be('0x4'));var BPromise=require(_0x81be('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x81be('0x6'));var rimraf=require(_0x81be('0x7'));var config=require('../../config/environment');var attributes=require(_0x81be('0x8'));module[_0x81be('0x9')]=function(_0x866142,_0x84fd7f){return _0x866142[_0x81be('0xa')]('ZendeskField',attributes,{'tableName':_0x81be('0xb'),'paranoid':![],'indexes':[{'name':_0x81be('0xc'),'fields':[_0x81be('0xd'),_0x81be('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5e0c=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ZendeskField','idField','util'];(function(_0x4f6e29,_0x54104f){var _0x4efbee=function(_0x32c2a5){while(--_0x32c2a5){_0x4f6e29['push'](_0x4f6e29['shift']());}};_0x4efbee(++_0x54104f);}(_0x5e0c,0xb3));var _0xc5e0=function(_0x3e54d5,_0x179556){_0x3e54d5=_0x3e54d5-0x0;var _0x35ad39=_0x5e0c[_0x3e54d5];return _0x35ad39;};'use strict';var _=require('lodash');var util=require(_0xc5e0('0x0'));var logger=require(_0xc5e0('0x1'))(_0xc5e0('0x2'));var moment=require(_0xc5e0('0x3'));var BPromise=require(_0xc5e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5e0('0x5'));var rimraf=require(_0xc5e0('0x6'));var config=require(_0xc5e0('0x7'));var attributes=require('./intZendeskField.attributes');module[_0xc5e0('0x8')]=function(_0xb941ff,_0x50100f){return _0xb941ff[_0xc5e0('0x9')](_0xc5e0('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xc5e0('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 00cb23a..372b747 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 _0x357e=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash'];(function(_0xfe91da,_0x5822a5){var _0x3070c8=function(_0x47f5f9){while(--_0x47f5f9){_0xfe91da['push'](_0xfe91da['shift']());}};_0x3070c8(++_0x5822a5);}(_0x357e,0x8f));var _0xe357=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x357e[_0x4b7895];return _0x264180;};'use strict';var _=require(_0xe357('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe357('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe357('0x2'));var logger=require(_0xe357('0x3'))(_0xe357('0x4'));var config=require('../../config/environment');var jayson=require(_0xe357('0x5'));var client=jayson[_0xe357('0x6')][_0xe357('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x385422,_0x4877b5,_0x54c1a1){return new BPromise(function(_0x248c3d,_0x4b2a13){return client['request'](_0x385422,_0x54c1a1)['then'](function(_0x23549c){logger[_0xe357('0x8')](_0xe357('0x9'),_0x4877b5,'request\x20sent');logger[_0xe357('0xa')](_0xe357('0xb'),_0x4877b5,_0xe357('0xc'),JSON[_0xe357('0xd')](_0x23549c));if(_0x23549c[_0xe357('0xe')]){if(_0x23549c[_0xe357('0xe')][_0xe357('0xf')]===0x1f4){logger[_0xe357('0xe')](_0xe357('0x9'),_0x4877b5,_0x23549c[_0xe357('0xe')]['message']);return _0x4b2a13(_0x23549c[_0xe357('0xe')][_0xe357('0x10')]);}logger[_0xe357('0xe')](_0xe357('0x9'),_0x4877b5,_0x23549c[_0xe357('0xe')]['message']);return _0x248c3d(_0x23549c['error']['message']);}else{logger[_0xe357('0x8')](_0xe357('0x9'),_0x4877b5,_0xe357('0xc'));_0x248c3d(_0x23549c[_0xe357('0x11')][_0xe357('0x10')]);}})['catch'](function(_0x35854f){logger[_0xe357('0xe')]('ZendeskField,\x20%s,\x20%s',_0x4877b5,_0x35854f);_0x4b2a13(_0x35854f);});});} \ No newline at end of file +var _0x283f=['rpc','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','error','code','message','ZendeskField,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1c6ef2,_0x8d926a){var _0x404b8c=function(_0x4fdf1e){while(--_0x4fdf1e){_0x1c6ef2['push'](_0x1c6ef2['shift']());}};_0x404b8c(++_0x8d926a);}(_0x283f,0x116));var _0xf283=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x283f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf283('0x0'));var util=require(_0xf283('0x1'));var moment=require(_0xf283('0x2'));var BPromise=require(_0xf283('0x3'));var rs=require(_0xf283('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf283('0x5'))['db'];var utils=require(_0xf283('0x6'));var logger=require(_0xf283('0x7'))(_0xf283('0x8'));var config=require(_0xf283('0x9'));var jayson=require(_0xf283('0xa'));var client=jayson[_0xf283('0xb')][_0xf283('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x340b35,_0xdd3679,_0x326c40){return new BPromise(function(_0x38faee,_0x9c5bd9){return client[_0xf283('0xd')](_0x340b35,_0x326c40)['then'](function(_0x5789b7){logger[_0xf283('0xe')]('ZendeskField,\x20%s,\x20%s',_0xdd3679,'request\x20sent');logger[_0xf283('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0xdd3679,_0xf283('0x10'),JSON['stringify'](_0x5789b7));if(_0x5789b7[_0xf283('0x11')]){if(_0x5789b7[_0xf283('0x11')][_0xf283('0x12')]===0x1f4){logger[_0xf283('0x11')]('ZendeskField,\x20%s,\x20%s',_0xdd3679,_0x5789b7['error'][_0xf283('0x13')]);return _0x9c5bd9(_0x5789b7[_0xf283('0x11')][_0xf283('0x13')]);}logger['error'](_0xf283('0x14'),_0xdd3679,_0x5789b7[_0xf283('0x11')][_0xf283('0x13')]);return _0x38faee(_0x5789b7[_0xf283('0x11')]['message']);}else{logger[_0xf283('0xe')](_0xf283('0x14'),_0xdd3679,_0xf283('0x10'));_0x38faee(_0x5789b7['result'][_0xf283('0x13')]);}})[_0xf283('0x15')](function(_0x38d40b){logger[_0xf283('0x11')](_0xf283('0x14'),_0xdd3679,_0x38d40b);_0x9c5bd9(_0x38d40b);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 8cc8262..a2a540e 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 _0x7dcc=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','/:id/configurations','/:id/fields','getFields','post','addConfiguration','update','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dcc,0xaf));var _0xc7dc=function(_0x7d5a8b,_0x2aedef){_0x7d5a8b=_0x7d5a8b-0x0;var _0x56ac46=_0x7dcc[_0x7d5a8b];return _0x56ac46;};'use strict';var multer=require('multer');var util=require(_0xc7dc('0x0'));var path=require('path');var timeout=require(_0xc7dc('0x1'));var express=require(_0xc7dc('0x2'));var router=express[_0xc7dc('0x3')]();var fs_extra=require(_0xc7dc('0x4'));var auth=require(_0xc7dc('0x5'));var interaction=require(_0xc7dc('0x6'));var config=require(_0xc7dc('0x7'));var controller=require(_0xc7dc('0x8'));router[_0xc7dc('0x9')]('/',auth[_0xc7dc('0xa')](),controller['index']);router['get'](_0xc7dc('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc7dc('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0xc7dc('0xd'),auth[_0xc7dc('0xa')](),controller[_0xc7dc('0xe')]);router['post']('/',auth[_0xc7dc('0xa')](),controller['create']);router[_0xc7dc('0xf')](_0xc7dc('0xc'),auth[_0xc7dc('0xa')](),controller[_0xc7dc('0x10')]);router['put']('/:id',auth[_0xc7dc('0xa')](),controller[_0xc7dc('0x11')]);router['delete'](_0xc7dc('0xb'),auth['isAuthenticated'](),controller[_0xc7dc('0x12')]);module[_0xc7dc('0x13')]=router; \ No newline at end of file +var _0x83cc=['../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','exports','multer','util','express','Router','fs-extra'];(function(_0x7ad8b0,_0x1ae2a5){var _0x3311d8=function(_0x172b12){while(--_0x172b12){_0x7ad8b0['push'](_0x7ad8b0['shift']());}};_0x3311d8(++_0x1ae2a5);}(_0x83cc,0x14b));var _0xc83c=function(_0x1e6e99,_0xd3bb5f){_0x1e6e99=_0x1e6e99-0x0;var _0x6b6ca8=_0x83cc[_0x1e6e99];return _0x6b6ca8;};'use strict';var multer=require(_0xc83c('0x0'));var util=require(_0xc83c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc83c('0x2'));var router=express[_0xc83c('0x3')]();var fs_extra=require(_0xc83c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc83c('0x5'));var config=require('../../config/environment');var controller=require(_0xc83c('0x6'));router[_0xc83c('0x7')]('/',auth[_0xc83c('0x8')](),controller['index']);router['get'](_0xc83c('0x9'),auth['isAuthenticated'](),controller[_0xc83c('0xa')]);router[_0xc83c('0x7')]('/:id/configurations',auth[_0xc83c('0x8')](),controller[_0xc83c('0xb')]);router['get'](_0xc83c('0xc'),auth['isAuthenticated'](),controller[_0xc83c('0xd')]);router[_0xc83c('0xe')]('/',auth['isAuthenticated'](),controller[_0xc83c('0xf')]);router[_0xc83c('0xe')](_0xc83c('0x10'),auth[_0xc83c('0x8')](),controller[_0xc83c('0x11')]);router['put'](_0xc83c('0x9'),auth[_0xc83c('0x8')](),controller[_0xc83c('0x12')]);router[_0xc83c('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc83c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index c359bca..e81a69a 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 _0xd64b=['STRING','sequelize'];(function(_0x24df55,_0x3ebb80){var _0x47292b=function(_0x22b7b5){while(--_0x22b7b5){_0x24df55['push'](_0x24df55['shift']());}};_0x47292b(++_0x3ebb80);}(_0xd64b,0xc1));var _0xbd64=function(_0x190987,_0x310a24){_0x190987=_0x190987-0x0;var _0x5254a5=_0xd64b[_0x190987];return _0x5254a5;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd64('0x1')]},'zone':{'type':Sequelize[_0xbd64('0x1')]},'clientId':{'type':Sequelize[_0xbd64('0x1')]},'clientSecret':{'type':Sequelize[_0xbd64('0x1')]},'serverUrl':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe5b3=['STRING','exports'];(function(_0x3fbedf,_0x131ae0){var _0x4c914c=function(_0x1a6c25){while(--_0x1a6c25){_0x3fbedf['push'](_0x3fbedf['shift']());}};_0x4c914c(++_0x131ae0);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5d3394,_0x5e5dce){_0x5d3394=_0x5d3394-0x0;var _0x102ca5=_0xe5b3[_0x5d3394];return _0x102ca5;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'name':{'type':Sequelize[_0x3e5b('0x1')]},'description':{'type':Sequelize[_0x3e5b('0x1')]},'host':{'type':Sequelize[_0x3e5b('0x1')]},'zone':{'type':Sequelize[_0x3e5b('0x1')]},'clientId':{'type':Sequelize[_0x3e5b('0x1')]},'clientSecret':{'type':Sequelize[_0x3e5b('0x1')]},'serverUrl':{'type':Sequelize[_0x3e5b('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x3e5b('0x1')]},'refreshToken':{'type':Sequelize[_0x3e5b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index eded18a..c0f22b6 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 _0xd8dd=['../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','then','sendStatus','stack','name','index','map','ZohoAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','include','rows','catch','params','includeAll','find','create','body','getConfigurations','ZohoConfiguration','filter','hasOwnProperty','addConfiguration','findOne','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','zoho.eu','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','error','message','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x39950f,_0x419783){var _0x9c327=function(_0x3bd442){while(--_0x3bd442){_0x39950f['push'](_0x39950f['shift']());}};_0x9c327(++_0x419783);}(_0xd8dd,0xda));var _0xdd8d=function(_0x4b7c86,_0x3c033c){_0x4b7c86=_0x4b7c86-0x0;var _0x10d869=_0xd8dd[_0x4b7c86];return _0x10d869;};'use strict';var emlformat=require(_0xdd8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd8d('0x1'));var jsonpatch=require(_0xdd8d('0x2'));var rp=require(_0xdd8d('0x3'));var moment=require(_0xdd8d('0x4'));var BPromise=require(_0xdd8d('0x5'));var Mustache=require(_0xdd8d('0x6'));var util=require(_0xdd8d('0x7'));var path=require(_0xdd8d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd8d('0x9'));var _=require('lodash');var squel=require(_0xdd8d('0xa'));var crypto=require(_0xdd8d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdd8d('0xc'));var toCsv=require(_0xdd8d('0xd'));var querystring=require(_0xdd8d('0xe'));var Papa=require('papaparse');var Redis=require(_0xdd8d('0xf'));var authService=require(_0xdd8d('0x10'));var qs=require(_0xdd8d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd8d('0x12'));var logger=require(_0xdd8d('0x13'))(_0xdd8d('0x14'));var utils=require(_0xdd8d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdd8d('0x16'));var db=require(_0xdd8d('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x18d05f,_0x472d9d){_0x472d9d=_0x472d9d||0xcc;return function(_0x1ba991){if(_0x1ba991){return _0x18d05f['sendStatus'](_0x472d9d);}return _0x18d05f[_0xdd8d('0x18')](_0x472d9d)[_0xdd8d('0x19')]();};}function respondWithResult(_0x199714,_0x27235f){_0x27235f=_0x27235f||0xc8;return function(_0x26d65f){if(_0x26d65f){return _0x199714[_0xdd8d('0x18')](_0x27235f)[_0xdd8d('0x1a')](_0x26d65f);}};}function respondWithFilteredResult(_0x980cbc,_0x895724){return function(_0x3c44f4){if(_0x3c44f4){var _0x4154cf=typeof _0x895724[_0xdd8d('0x1b')]==='undefined'&&typeof _0x895724[_0xdd8d('0x1c')]===_0xdd8d('0x1d');var _0x185967=_0x3c44f4[_0xdd8d('0x1e')];var _0x137b2b=_0x4154cf?0x0:_0x895724[_0xdd8d('0x1b')];var _0x984967=_0x4154cf?_0x3c44f4[_0xdd8d('0x1e')]:_0x895724[_0xdd8d('0x1b')]+_0x895724[_0xdd8d('0x1c')];var _0x3e27e1;if(_0x984967>=_0x185967){_0x984967=_0x185967;_0x3e27e1=0xc8;}else{_0x3e27e1=0xce;}_0x980cbc[_0xdd8d('0x18')](_0x3e27e1);return _0x980cbc['set'](_0xdd8d('0x1f'),_0x137b2b+'-'+_0x984967+'/'+_0x185967)[_0xdd8d('0x1a')](_0x3c44f4);}return null;};}function patchUpdates(_0x53af91){return function(_0x26f876){try{jsonpatch[_0xdd8d('0x20')](_0x26f876,_0x53af91,!![]);}catch(_0x453d82){return BPromise['reject'](_0x453d82);}return _0x26f876[_0xdd8d('0x21')]();};}function saveUpdates(_0x5d783b,_0x38c170){return function(_0x300f9e){if(_0x300f9e){return _0x300f9e['update'](_0x5d783b)['then'](function(_0x248e80){return _0x248e80;});}return null;};}function removeEntity(_0x42d55e,_0x4f16de){return function(_0x458e69){if(_0x458e69){return _0x458e69['destroy']()[_0xdd8d('0x22')](function(){_0x42d55e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xae14b7,_0x2fe413){return function(_0x1c1f89){if(!_0x1c1f89){_0xae14b7[_0xdd8d('0x23')](0x194);}return _0x1c1f89;};}function handleError(_0x5efcab,_0x41f4e4){_0x41f4e4=_0x41f4e4||0x1f4;return function(_0xcf2a16){logger['error'](_0xcf2a16[_0xdd8d('0x24')]);if(_0xcf2a16[_0xdd8d('0x25')]){delete _0xcf2a16[_0xdd8d('0x25')];}_0x5efcab[_0xdd8d('0x18')](_0x41f4e4)['send'](_0xcf2a16);};}exports[_0xdd8d('0x26')]=function(_0x4d8d46,_0x43c9b0){var _0x5c3422={},_0x2f2b4d={},_0x1718ba={'count':0x0,'rows':[]};var _0xdca5f4=_[_0xdd8d('0x27')](db[_0xdd8d('0x28')][_0xdd8d('0x29')],function(_0x10fab8){return{'name':_0x10fab8['fieldName'],'type':_0x10fab8[_0xdd8d('0x2a')][_0xdd8d('0x2b')]};});_0x2f2b4d[_0xdd8d('0x2c')]=_[_0xdd8d('0x27')](_0xdca5f4,_0xdd8d('0x25'));_0x2f2b4d[_0xdd8d('0x2d')]=_[_0xdd8d('0x2e')](_0x4d8d46[_0xdd8d('0x2d')]);_0x2f2b4d[_0xdd8d('0x2f')]=_[_0xdd8d('0x30')](_0x2f2b4d['model'],_0x2f2b4d[_0xdd8d('0x2d')]);_0x5c3422[_0xdd8d('0x31')]=_[_0xdd8d('0x30')](_0x2f2b4d[_0xdd8d('0x2c')],qs[_0xdd8d('0x32')](_0x4d8d46[_0xdd8d('0x2d')][_0xdd8d('0x32')]));_0x5c3422[_0xdd8d('0x31')]=_0x5c3422[_0xdd8d('0x31')][_0xdd8d('0x33')]?_0x5c3422['attributes']:_0x2f2b4d[_0xdd8d('0x2c')];if(!_0x4d8d46[_0xdd8d('0x2d')]['hasOwnProperty'](_0xdd8d('0x34'))){_0x5c3422[_0xdd8d('0x1c')]=qs['limit'](_0x4d8d46[_0xdd8d('0x2d')][_0xdd8d('0x1c')]);_0x5c3422[_0xdd8d('0x1b')]=qs[_0xdd8d('0x1b')](_0x4d8d46[_0xdd8d('0x2d')][_0xdd8d('0x1b')]);}_0x5c3422[_0xdd8d('0x35')]=qs['sort'](_0x4d8d46[_0xdd8d('0x2d')][_0xdd8d('0x36')]);_0x5c3422[_0xdd8d('0x37')]=qs[_0xdd8d('0x2f')](_[_0xdd8d('0x38')](_0x4d8d46[_0xdd8d('0x2d')],_0x2f2b4d[_0xdd8d('0x2f')]),_0xdca5f4);if(_0x4d8d46[_0xdd8d('0x2d')]['filter']){_0x5c3422['where']=_[_0xdd8d('0x39')](_0x5c3422[_0xdd8d('0x37')],{'$or':_[_0xdd8d('0x27')](_0xdca5f4,function(_0x3f6e16){if(_0x3f6e16['type']!=='VIRTUAL'){var _0x232e64={};_0x232e64[_0x3f6e16['name']]={'$like':'%'+_0x4d8d46['query']['filter']+'%'};return _0x232e64;}})});}_0x5c3422=_[_0xdd8d('0x39')]({},_0x5c3422,_0x4d8d46[_0xdd8d('0x3a')]);var _0x3fd915={'where':_0x5c3422[_0xdd8d('0x37')]};return db[_0xdd8d('0x28')][_0xdd8d('0x1e')](_0x3fd915)[_0xdd8d('0x22')](function(_0x4942fa){_0x1718ba[_0xdd8d('0x1e')]=_0x4942fa;if(_0x4d8d46[_0xdd8d('0x2d')]['includeAll']){_0x5c3422[_0xdd8d('0x3b')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x5c3422);})[_0xdd8d('0x22')](function(_0x2e088a){_0x1718ba[_0xdd8d('0x3c')]=_0x2e088a;return _0x1718ba;})[_0xdd8d('0x22')](respondWithFilteredResult(_0x43c9b0,_0x5c3422))[_0xdd8d('0x3d')](handleError(_0x43c9b0,null));};exports['show']=function(_0x3e3291,_0x344ad3){var _0x20f8fd={'raw':![],'where':{'id':_0x3e3291[_0xdd8d('0x3e')]['id']}},_0x77aa6a={};_0x77aa6a['model']=_[_0xdd8d('0x2e')](db['ZohoAccount'][_0xdd8d('0x29')]);_0x77aa6a['query']=_[_0xdd8d('0x2e')](_0x3e3291[_0xdd8d('0x2d')]);_0x77aa6a[_0xdd8d('0x2f')]=_[_0xdd8d('0x30')](_0x77aa6a[_0xdd8d('0x2c')],_0x77aa6a[_0xdd8d('0x2d')]);_0x20f8fd[_0xdd8d('0x31')]=_[_0xdd8d('0x30')](_0x77aa6a['model'],qs[_0xdd8d('0x32')](_0x3e3291[_0xdd8d('0x2d')]['fields']));_0x20f8fd[_0xdd8d('0x31')]=_0x20f8fd[_0xdd8d('0x31')]['length']?_0x20f8fd[_0xdd8d('0x31')]:_0x77aa6a[_0xdd8d('0x2c')];if(_0x3e3291['query'][_0xdd8d('0x3f')]){_0x20f8fd[_0xdd8d('0x3b')]=[{'all':!![]}];}_0x20f8fd=_[_0xdd8d('0x39')]({},_0x20f8fd,_0x3e3291['options']);return db['ZohoAccount'][_0xdd8d('0x40')](_0x20f8fd)[_0xdd8d('0x22')](handleEntityNotFound(_0x344ad3,null))[_0xdd8d('0x22')](respondWithResult(_0x344ad3,null))[_0xdd8d('0x3d')](handleError(_0x344ad3,null));};exports[_0xdd8d('0x41')]=function(_0x47877b,_0x4a954d){return db[_0xdd8d('0x28')][_0xdd8d('0x41')](_0x47877b[_0xdd8d('0x42')],{})[_0xdd8d('0x22')](respondWithResult(_0x4a954d,0xc9))[_0xdd8d('0x3d')](handleError(_0x4a954d,null));};exports['update']=function(_0x2cadbb,_0xebf7bb){if(_0x2cadbb[_0xdd8d('0x42')]['id']){delete _0x2cadbb[_0xdd8d('0x42')]['id'];}return db[_0xdd8d('0x28')][_0xdd8d('0x40')]({'where':{'id':_0x2cadbb['params']['id']}})[_0xdd8d('0x22')](handleEntityNotFound(_0xebf7bb,null))[_0xdd8d('0x22')](saveUpdates(_0x2cadbb['body'],null))['then'](respondWithResult(_0xebf7bb,null))['catch'](handleError(_0xebf7bb,null));};exports['destroy']=function(_0x2b4073,_0x2ae827){return db[_0xdd8d('0x28')][_0xdd8d('0x40')]({'where':{'id':_0x2b4073[_0xdd8d('0x3e')]['id']}})[_0xdd8d('0x22')](handleEntityNotFound(_0x2ae827,null))[_0xdd8d('0x22')](removeEntity(_0x2ae827,null))[_0xdd8d('0x3d')](handleError(_0x2ae827,null));};exports[_0xdd8d('0x43')]=function(_0x13ca2f,_0x30d420,_0x4220f1){var _0x4a44d1={};var _0x11cca6={};var _0x44548c;var _0x2b7b33;return db[_0xdd8d('0x28')]['findOne']({'where':{'id':_0x13ca2f[_0xdd8d('0x3e')]['id']}})[_0xdd8d('0x22')](handleEntityNotFound(_0x30d420,null))[_0xdd8d('0x22')](function(_0x53daf5){if(_0x53daf5){_0x44548c=_0x53daf5;_0x11cca6[_0xdd8d('0x2c')]=_[_0xdd8d('0x2e')](db[_0xdd8d('0x44')]['rawAttributes']);_0x11cca6[_0xdd8d('0x2d')]=_[_0xdd8d('0x2e')](_0x13ca2f[_0xdd8d('0x2d')]);_0x11cca6['filters']=_[_0xdd8d('0x30')](_0x11cca6[_0xdd8d('0x2c')],_0x11cca6['query']);_0x4a44d1[_0xdd8d('0x31')]=_[_0xdd8d('0x30')](_0x11cca6['model'],qs[_0xdd8d('0x32')](_0x13ca2f[_0xdd8d('0x2d')]['fields']));_0x4a44d1['attributes']=_0x4a44d1[_0xdd8d('0x31')][_0xdd8d('0x33')]?_0x4a44d1['attributes']:_0x11cca6[_0xdd8d('0x2c')];_0x4a44d1[_0xdd8d('0x35')]=qs[_0xdd8d('0x36')](_0x13ca2f['query'][_0xdd8d('0x36')]);_0x4a44d1[_0xdd8d('0x37')]=qs[_0xdd8d('0x2f')](_[_0xdd8d('0x38')](_0x13ca2f[_0xdd8d('0x2d')],_0x11cca6[_0xdd8d('0x2f')]));if(_0x13ca2f['query']['filter']){_0x4a44d1[_0xdd8d('0x37')]=_[_0xdd8d('0x39')](_0x4a44d1[_0xdd8d('0x37')],{'$or':_[_0xdd8d('0x27')](_0x4a44d1['attributes'],function(_0x1344bc){var _0x3e65c3={};_0x3e65c3[_0x1344bc]={'$like':'%'+_0x13ca2f[_0xdd8d('0x2d')][_0xdd8d('0x45')]+'%'};return _0x3e65c3;})});}_0x4a44d1=_['merge']({},_0x4a44d1,_0x13ca2f['options']);return _0x44548c[_0xdd8d('0x43')](_0x4a44d1);}})[_0xdd8d('0x22')](function(_0x141b2e){if(_0x141b2e){_0x2b7b33=_0x141b2e[_0xdd8d('0x33')];if(!_0x13ca2f[_0xdd8d('0x2d')][_0xdd8d('0x46')](_0xdd8d('0x34'))){_0x4a44d1['limit']=qs[_0xdd8d('0x1c')](_0x13ca2f[_0xdd8d('0x2d')][_0xdd8d('0x1c')]);_0x4a44d1[_0xdd8d('0x1b')]=qs[_0xdd8d('0x1b')](_0x13ca2f[_0xdd8d('0x2d')][_0xdd8d('0x1b')]);}return _0x44548c[_0xdd8d('0x43')](_0x4a44d1);}})[_0xdd8d('0x22')](function(_0x3cba78){if(_0x3cba78){return _0x3cba78?{'count':_0x2b7b33,'rows':_0x3cba78}:null;}})['then'](respondWithResult(_0x30d420,null))[_0xdd8d('0x3d')](handleError(_0x30d420,null));};exports[_0xdd8d('0x47')]=function(_0x44fcfd,_0x534ad,_0x5ef555){if(_0x44fcfd[_0xdd8d('0x42')]['id']){delete _0x44fcfd['body']['id'];}return db[_0xdd8d('0x28')][_0xdd8d('0x48')]({'where':{'id':_0x44fcfd[_0xdd8d('0x3e')]['id']}})[_0xdd8d('0x22')](handleEntityNotFound(_0x534ad,null))['then'](function(_0x5d602a){if(_0x5d602a){_0x44fcfd[_0xdd8d('0x42')]['AccountId']=_0x5d602a['id'];_0x44fcfd[_0xdd8d('0x42')][_0xdd8d('0x49')]=integrations['getSubjects'](_0x44fcfd[_0xdd8d('0x42')][_0xdd8d('0x4a')],_0x44fcfd[_0xdd8d('0x42')][_0xdd8d('0x2a')]);_0x44fcfd['body'][_0xdd8d('0x4b')]=integrations[_0xdd8d('0x4c')](_0x44fcfd[_0xdd8d('0x42')][_0xdd8d('0x4a')],_0x44fcfd[_0xdd8d('0x42')][_0xdd8d('0x2a')]);return db[_0xdd8d('0x44')][_0xdd8d('0x41')](_0x44fcfd[_0xdd8d('0x42')],{'include':[{'model':db[_0xdd8d('0x4d')],'as':'Subjects'},{'model':db[_0xdd8d('0x4d')],'as':_0xdd8d('0x4b')}]});}return null;})[_0xdd8d('0x22')](respondWithResult(_0x534ad,null))['catch'](handleError(_0x534ad,null));};function getAccessToken(_0x3bbdad){return new Promise(function(_0x36b76f,_0x244ff4){var _0x8d430f;switch(_0x3bbdad[_0xdd8d('0x4e')]){case'US':_0x8d430f=_0xdd8d('0x4f');break;case'AU':_0x8d430f='https://accounts.zoho.com.au';break;case'EU':_0x8d430f=_0xdd8d('0x50');break;case'IN':_0x8d430f=_0xdd8d('0x51');break;case'CN':_0x8d430f=_0xdd8d('0x52');break;default:_0x8d430f='https://accounts.zoho.eu';break;}var _0x3d825b={'method':_0xdd8d('0x53'),'uri':_0x8d430f+_0xdd8d('0x54'),'qs':{'refresh_token':_0x3bbdad[_0xdd8d('0x55')],'client_id':_0x3bbdad[_0xdd8d('0x56')],'client_secret':_0x3bbdad[_0xdd8d('0x57')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3d825b)[_0xdd8d('0x22')](function(_0x5e6b47){if(_0x5e6b47['access_token']){_0x36b76f(_0x5e6b47['access_token']);}else{_0x244ff4(_0xdd8d('0x58'));}})[_0xdd8d('0x3d')](function(_0x489ed8){_0x244ff4(_0x489ed8);});});}exports['getFields']=function(_0x4c518a,_0xb2f50c,_0x2c1613){var _0x14c2b9,_0x4bf502,_0x3d019c,_0x10d180,_0x4e180e;return db['ZohoAccount'][_0xdd8d('0x48')]({'where':{'id':_0x4c518a[_0xdd8d('0x3e')]['id']},'attributes':['id',_0xdd8d('0x59'),_0xdd8d('0x4e'),_0xdd8d('0x56'),_0xdd8d('0x57'),_0xdd8d('0x5a'),'code',_0xdd8d('0x55')]})[_0xdd8d('0x22')](handleEntityNotFound(_0xb2f50c,null))[_0xdd8d('0x22')](function(_0x35b4f6){_0x4e180e=_0x35b4f6;_0x14c2b9=_0x4e180e[_0xdd8d('0x59')];_0x4bf502=_0x14c2b9===_0xdd8d('0x5b')?'eu':'com';_0x3d019c=_0x4e180e[_0xdd8d('0x5a')];var _0x2f3593=_0x3d019c['slice'](-0x1);if(_0x2f3593==='/'||_0x2f3593==='\x5c'||_0x2f3593===':'){_0x3d019c=_0x3d019c[_0xdd8d('0x5c')](0x0,_0x3d019c[_0xdd8d('0x5d')](_0x2f3593));}if(!_0x4e180e['refreshToken']){throw new Error(_0xdd8d('0x5e'));}return getAccessToken(_0x4e180e);})['then'](function(_0x5736e4){if(_0x5736e4){return rp({'method':_0xdd8d('0x5f'),'uri':util[_0xdd8d('0x60')](_0xdd8d('0x61'),_0x4bf502),'qs':{'module':'Calls'},'headers':{'Authorization':_0xdd8d('0x62')+_0x5736e4},'json':!![]});}})[_0xdd8d('0x22')](function(_0x1fd2da){if(_0x1fd2da){if(_0x1fd2da[_0xdd8d('0x63')]&&_0x1fd2da[_0xdd8d('0x63')][_0xdd8d('0x64')]){throw new Error(_0x1fd2da[_0xdd8d('0x63')]['error'][_0xdd8d('0x65')]);}var _0x475a5d=[];var _0xab2307=[];var _0x2c21f8=['Owner','Subject',_0xdd8d('0x66'),_0xdd8d('0x67'),_0xdd8d('0x68'),_0xdd8d('0x69'),'Call_Start_Time',_0xdd8d('0x6a')];_0xab2307=_[_0xdd8d('0x6b')](_0x1fd2da[_0xdd8d('0x32')],function(_0x40e7ec){return _0x2c21f8[_0xdd8d('0x6c')](_0x40e7ec[_0xdd8d('0x6d')]);});for(var _0x46793b=0x0;_0x46793b<_0xab2307[_0xdd8d('0x33')];_0x46793b++){if(_0xab2307[_0x46793b][_0xdd8d('0x6e')]===![]){_0x475a5d['push']({'id':_0xab2307[_0x46793b]['id'],'name':_0xab2307[_0x46793b]['display_label'],'custom':_0xab2307[_0x46793b][_0xdd8d('0x6f')],'options':_0xab2307[_0x46793b][_0xdd8d('0x70')]===_0xdd8d('0x71')&&_0xab2307[_0x46793b][_0xdd8d('0x72')][_0xdd8d('0x33')]>-0x1?_[_0xdd8d('0x27')](_0xab2307[_0x46793b][_0xdd8d('0x72')],function(_0x188891){return{'name':_0x188891,'value':_0x188891};}):[]});}}return{'count':_0x475a5d[_0xdd8d('0x33')],'rows':_0x475a5d};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xb2f50c,null))[_0xdd8d('0x3d')](function(_0x4caac3){var _0x23a60f=_0x4c518a[_0xdd8d('0x2d')][_0xdd8d('0x73')]?0x1f4:_0x4caac3[_0xdd8d('0x74')]||0x1f4;logger[_0xdd8d('0x64')](_0xdd8d('0x75'),_0xdd8d('0x76'),_0x23a60f,JSON[_0xdd8d('0x77')](_0x4caac3));delete _0x4caac3['name'];if(_0x23a60f===0x191){_0x23a60f=0x190;}_0xb2f50c[_0xdd8d('0x18')](_0x23a60f)['send'](_0x4c518a[_0xdd8d('0x2d')][_0xdd8d('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x4caac3[_0xdd8d('0x74')]}:_0x4caac3);});}; \ No newline at end of file +var _0xaa0d=['name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','show','params','length','catch','create','body','find','destroy','getConfigurations','ZohoConfiguration','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZohoField','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','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Duration','Call_Type','remove','includes','api_name','push','display_label','custom_field','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack'];(function(_0x5af17c,_0x6e2f5f){var _0x326a72=function(_0x5377b5){while(--_0x5377b5){_0x5af17c['push'](_0x5af17c['shift']());}};_0x326a72(++_0x6e2f5f);}(_0xaa0d,0xdd));var _0xdaa0=function(_0x19bf0e,_0x39db02){_0x19bf0e=_0x19bf0e-0x0;var _0x19225c=_0xaa0d[_0x19bf0e];return _0x19225c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdaa0('0x0'));var jsonpatch=require(_0xdaa0('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdaa0('0x2'));var Mustache=require('mustache');var util=require(_0xdaa0('0x3'));var path=require(_0xdaa0('0x4'));var sox=require(_0xdaa0('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdaa0('0x6'));var _=require(_0xdaa0('0x7'));var squel=require(_0xdaa0('0x8'));var crypto=require(_0xdaa0('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xdaa0('0xa'));var toCsv=require(_0xdaa0('0xb'));var querystring=require(_0xdaa0('0xc'));var Papa=require(_0xdaa0('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdaa0('0xe'));var as=require(_0xdaa0('0xf'));var hardwareService=require(_0xdaa0('0x10'));var logger=require(_0xdaa0('0x11'))('api');var utils=require(_0xdaa0('0x12'));var config=require(_0xdaa0('0x13'));var licenseUtil=require(_0xdaa0('0x14'));var db=require(_0xdaa0('0x15'))['db'];var integrations=require(_0xdaa0('0x16'));function respondWithStatusCode(_0x46e1aa,_0x3d5424){_0x3d5424=_0x3d5424||0xcc;return function(_0x563096){if(_0x563096){return _0x46e1aa[_0xdaa0('0x17')](_0x3d5424);}return _0x46e1aa[_0xdaa0('0x18')](_0x3d5424)['end']();};}function respondWithResult(_0x1931de,_0x346859){_0x346859=_0x346859||0xc8;return function(_0x361300){if(_0x361300){return _0x1931de[_0xdaa0('0x18')](_0x346859)[_0xdaa0('0x19')](_0x361300);}};}function respondWithFilteredResult(_0x201418,_0x1af7ed){return function(_0x3ac5d3){if(_0x3ac5d3){var _0x1a9414=typeof _0x1af7ed[_0xdaa0('0x1a')]===_0xdaa0('0x1b')&&typeof _0x1af7ed[_0xdaa0('0x1c')]==='undefined';var _0x32541a=_0x3ac5d3[_0xdaa0('0x1d')];var _0x1860db=_0x1a9414?0x0:_0x1af7ed['offset'];var _0x178286=_0x1a9414?_0x3ac5d3['count']:_0x1af7ed[_0xdaa0('0x1a')]+_0x1af7ed['limit'];var _0x248649;if(_0x178286>=_0x32541a){_0x178286=_0x32541a;_0x248649=0xc8;}else{_0x248649=0xce;}_0x201418['status'](_0x248649);return _0x201418[_0xdaa0('0x1e')]('Content-Range',_0x1860db+'-'+_0x178286+'/'+_0x32541a)['json'](_0x3ac5d3);}return null;};}function patchUpdates(_0x5de0be){return function(_0x3a848b){try{jsonpatch[_0xdaa0('0x1f')](_0x3a848b,_0x5de0be,!![]);}catch(_0x478d16){return BPromise[_0xdaa0('0x20')](_0x478d16);}return _0x3a848b[_0xdaa0('0x21')]();};}function saveUpdates(_0x288307,_0x5753f9){return function(_0x4d5ccc){if(_0x4d5ccc){return _0x4d5ccc[_0xdaa0('0x22')](_0x288307)[_0xdaa0('0x23')](function(_0x2eef98){return _0x2eef98;});}return null;};}function removeEntity(_0x218c36,_0x31141b){return function(_0x2b4680){if(_0x2b4680){return _0x2b4680['destroy']()['then'](function(){_0x218c36['status'](0xcc)[_0xdaa0('0x24')]();});}};}function handleEntityNotFound(_0x73eacd,_0x155c0e){return function(_0x45adc9){if(!_0x45adc9){_0x73eacd[_0xdaa0('0x17')](0x194);}return _0x45adc9;};}function handleError(_0x272416,_0xcdcfb){_0xcdcfb=_0xcdcfb||0x1f4;return function(_0x19c550){logger[_0xdaa0('0x25')](_0x19c550[_0xdaa0('0x26')]);if(_0x19c550[_0xdaa0('0x27')]){delete _0x19c550[_0xdaa0('0x27')];}_0x272416[_0xdaa0('0x18')](_0xcdcfb)[_0xdaa0('0x28')](_0x19c550);};}exports[_0xdaa0('0x29')]=function(_0x4647b4,_0x217299){var _0x5e5846={},_0x426b40={},_0xb65e68={'count':0x0,'rows':[]};var _0x133adc=_['map'](db[_0xdaa0('0x2a')][_0xdaa0('0x2b')],function(_0x16e679){return{'name':_0x16e679[_0xdaa0('0x2c')],'type':_0x16e679[_0xdaa0('0x2d')][_0xdaa0('0x2e')]};});_0x426b40[_0xdaa0('0x2f')]=_[_0xdaa0('0x30')](_0x133adc,_0xdaa0('0x27'));_0x426b40[_0xdaa0('0x31')]=_[_0xdaa0('0x32')](_0x4647b4[_0xdaa0('0x31')]);_0x426b40['filters']=_[_0xdaa0('0x33')](_0x426b40[_0xdaa0('0x2f')],_0x426b40[_0xdaa0('0x31')]);_0x5e5846['attributes']=_[_0xdaa0('0x33')](_0x426b40[_0xdaa0('0x2f')],qs[_0xdaa0('0x34')](_0x4647b4[_0xdaa0('0x31')][_0xdaa0('0x34')]));_0x5e5846['attributes']=_0x5e5846['attributes']['length']?_0x5e5846[_0xdaa0('0x35')]:_0x426b40[_0xdaa0('0x2f')];if(!_0x4647b4[_0xdaa0('0x31')][_0xdaa0('0x36')](_0xdaa0('0x37'))){_0x5e5846['limit']=qs[_0xdaa0('0x1c')](_0x4647b4[_0xdaa0('0x31')][_0xdaa0('0x1c')]);_0x5e5846['offset']=qs[_0xdaa0('0x1a')](_0x4647b4[_0xdaa0('0x31')]['offset']);}_0x5e5846[_0xdaa0('0x38')]=qs[_0xdaa0('0x39')](_0x4647b4['query'][_0xdaa0('0x39')]);_0x5e5846['where']=qs[_0xdaa0('0x3a')](_[_0xdaa0('0x3b')](_0x4647b4['query'],_0x426b40[_0xdaa0('0x3a')]),_0x133adc);if(_0x4647b4[_0xdaa0('0x31')][_0xdaa0('0x3c')]){_0x5e5846['where']=_['merge'](_0x5e5846[_0xdaa0('0x3d')],{'$or':_['map'](_0x133adc,function(_0x204b64){if(_0x204b64[_0xdaa0('0x2d')]!==_0xdaa0('0x3e')){var _0x573935={};_0x573935[_0x204b64['name']]={'$like':'%'+_0x4647b4[_0xdaa0('0x31')]['filter']+'%'};return _0x573935;}})});}_0x5e5846=_[_0xdaa0('0x3f')]({},_0x5e5846,_0x4647b4[_0xdaa0('0x40')]);var _0x40c9dd={'where':_0x5e5846[_0xdaa0('0x3d')]};return db['ZohoAccount'][_0xdaa0('0x1d')](_0x40c9dd)['then'](function(_0x8aebab){_0xb65e68['count']=_0x8aebab;if(_0x4647b4['query'][_0xdaa0('0x41')]){_0x5e5846['include']=[{'all':!![]}];}return db[_0xdaa0('0x2a')][_0xdaa0('0x42')](_0x5e5846);})[_0xdaa0('0x23')](function(_0x136c7f){_0xb65e68['rows']=_0x136c7f;return _0xb65e68;})[_0xdaa0('0x23')](respondWithFilteredResult(_0x217299,_0x5e5846))['catch'](handleError(_0x217299,null));};exports[_0xdaa0('0x43')]=function(_0x2b35a3,_0x32a44d){var _0x55a462={'raw':![],'where':{'id':_0x2b35a3[_0xdaa0('0x44')]['id']}},_0x2c3b21={};_0x2c3b21[_0xdaa0('0x2f')]=_[_0xdaa0('0x32')](db[_0xdaa0('0x2a')][_0xdaa0('0x2b')]);_0x2c3b21[_0xdaa0('0x31')]=_[_0xdaa0('0x32')](_0x2b35a3[_0xdaa0('0x31')]);_0x2c3b21[_0xdaa0('0x3a')]=_['intersection'](_0x2c3b21[_0xdaa0('0x2f')],_0x2c3b21[_0xdaa0('0x31')]);_0x55a462[_0xdaa0('0x35')]=_[_0xdaa0('0x33')](_0x2c3b21[_0xdaa0('0x2f')],qs[_0xdaa0('0x34')](_0x2b35a3[_0xdaa0('0x31')][_0xdaa0('0x34')]));_0x55a462[_0xdaa0('0x35')]=_0x55a462[_0xdaa0('0x35')][_0xdaa0('0x45')]?_0x55a462[_0xdaa0('0x35')]:_0x2c3b21[_0xdaa0('0x2f')];if(_0x2b35a3[_0xdaa0('0x31')]['includeAll']){_0x55a462['include']=[{'all':!![]}];}_0x55a462=_[_0xdaa0('0x3f')]({},_0x55a462,_0x2b35a3['options']);return db[_0xdaa0('0x2a')]['find'](_0x55a462)[_0xdaa0('0x23')](handleEntityNotFound(_0x32a44d,null))[_0xdaa0('0x23')](respondWithResult(_0x32a44d,null))[_0xdaa0('0x46')](handleError(_0x32a44d,null));};exports[_0xdaa0('0x47')]=function(_0x3c4286,_0xdb931){return db[_0xdaa0('0x2a')]['create'](_0x3c4286[_0xdaa0('0x48')],{})[_0xdaa0('0x23')](respondWithResult(_0xdb931,0xc9))[_0xdaa0('0x46')](handleError(_0xdb931,null));};exports['update']=function(_0x4f31e8,_0x49cd58){if(_0x4f31e8[_0xdaa0('0x48')]['id']){delete _0x4f31e8[_0xdaa0('0x48')]['id'];}return db[_0xdaa0('0x2a')][_0xdaa0('0x49')]({'where':{'id':_0x4f31e8[_0xdaa0('0x44')]['id']}})[_0xdaa0('0x23')](handleEntityNotFound(_0x49cd58,null))[_0xdaa0('0x23')](saveUpdates(_0x4f31e8[_0xdaa0('0x48')],null))[_0xdaa0('0x23')](respondWithResult(_0x49cd58,null))[_0xdaa0('0x46')](handleError(_0x49cd58,null));};exports[_0xdaa0('0x4a')]=function(_0x2cd49e,_0x5baba0){return db[_0xdaa0('0x2a')][_0xdaa0('0x49')]({'where':{'id':_0x2cd49e[_0xdaa0('0x44')]['id']}})['then'](handleEntityNotFound(_0x5baba0,null))[_0xdaa0('0x23')](removeEntity(_0x5baba0,null))[_0xdaa0('0x46')](handleError(_0x5baba0,null));};exports[_0xdaa0('0x4b')]=function(_0x252fd2,_0x3077c8,_0x4490df){var _0x40a9b7={};var _0x3f8f86={};var _0x39463b;var _0x2c5bb5;return db['ZohoAccount']['findOne']({'where':{'id':_0x252fd2[_0xdaa0('0x44')]['id']}})[_0xdaa0('0x23')](handleEntityNotFound(_0x3077c8,null))[_0xdaa0('0x23')](function(_0x32440a){if(_0x32440a){_0x39463b=_0x32440a;_0x3f8f86[_0xdaa0('0x2f')]=_['keys'](db[_0xdaa0('0x4c')][_0xdaa0('0x2b')]);_0x3f8f86[_0xdaa0('0x31')]=_[_0xdaa0('0x32')](_0x252fd2[_0xdaa0('0x31')]);_0x3f8f86[_0xdaa0('0x3a')]=_[_0xdaa0('0x33')](_0x3f8f86['model'],_0x3f8f86[_0xdaa0('0x31')]);_0x40a9b7[_0xdaa0('0x35')]=_['intersection'](_0x3f8f86[_0xdaa0('0x2f')],qs['fields'](_0x252fd2[_0xdaa0('0x31')][_0xdaa0('0x34')]));_0x40a9b7[_0xdaa0('0x35')]=_0x40a9b7['attributes'][_0xdaa0('0x45')]?_0x40a9b7[_0xdaa0('0x35')]:_0x3f8f86[_0xdaa0('0x2f')];_0x40a9b7[_0xdaa0('0x38')]=qs[_0xdaa0('0x39')](_0x252fd2[_0xdaa0('0x31')][_0xdaa0('0x39')]);_0x40a9b7[_0xdaa0('0x3d')]=qs[_0xdaa0('0x3a')](_[_0xdaa0('0x3b')](_0x252fd2[_0xdaa0('0x31')],_0x3f8f86[_0xdaa0('0x3a')]));if(_0x252fd2['query'][_0xdaa0('0x3c')]){_0x40a9b7['where']=_[_0xdaa0('0x3f')](_0x40a9b7[_0xdaa0('0x3d')],{'$or':_[_0xdaa0('0x30')](_0x40a9b7[_0xdaa0('0x35')],function(_0x1bc30d){var _0x437ad2={};_0x437ad2[_0x1bc30d]={'$like':'%'+_0x252fd2[_0xdaa0('0x31')]['filter']+'%'};return _0x437ad2;})});}_0x40a9b7=_[_0xdaa0('0x3f')]({},_0x40a9b7,_0x252fd2[_0xdaa0('0x40')]);return _0x39463b[_0xdaa0('0x4b')](_0x40a9b7);}})[_0xdaa0('0x23')](function(_0x3c372d){if(_0x3c372d){_0x2c5bb5=_0x3c372d[_0xdaa0('0x45')];if(!_0x252fd2[_0xdaa0('0x31')]['hasOwnProperty'](_0xdaa0('0x37'))){_0x40a9b7[_0xdaa0('0x1c')]=qs[_0xdaa0('0x1c')](_0x252fd2[_0xdaa0('0x31')][_0xdaa0('0x1c')]);_0x40a9b7['offset']=qs[_0xdaa0('0x1a')](_0x252fd2['query']['offset']);}return _0x39463b['getConfigurations'](_0x40a9b7);}})[_0xdaa0('0x23')](function(_0x5cab44){if(_0x5cab44){return _0x5cab44?{'count':_0x2c5bb5,'rows':_0x5cab44}:null;}})[_0xdaa0('0x23')](respondWithResult(_0x3077c8,null))['catch'](handleError(_0x3077c8,null));};exports[_0xdaa0('0x4d')]=function(_0x3c9036,_0x5b4b7d,_0x3dd4e8){if(_0x3c9036[_0xdaa0('0x48')]['id']){delete _0x3c9036[_0xdaa0('0x48')]['id'];}return db[_0xdaa0('0x2a')]['findOne']({'where':{'id':_0x3c9036[_0xdaa0('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b4b7d,null))[_0xdaa0('0x23')](function(_0x37f42c){if(_0x37f42c){_0x3c9036[_0xdaa0('0x48')][_0xdaa0('0x4e')]=_0x37f42c['id'];_0x3c9036['body'][_0xdaa0('0x4f')]=integrations['getSubjects'](_0x3c9036['body'][_0xdaa0('0x50')],_0x3c9036[_0xdaa0('0x48')][_0xdaa0('0x2d')]);_0x3c9036[_0xdaa0('0x48')]['Descriptions']=integrations[_0xdaa0('0x51')](_0x3c9036[_0xdaa0('0x48')][_0xdaa0('0x50')],_0x3c9036['body'][_0xdaa0('0x2d')]);return db[_0xdaa0('0x4c')][_0xdaa0('0x47')](_0x3c9036['body'],{'include':[{'model':db['ZohoField'],'as':_0xdaa0('0x4f')},{'model':db[_0xdaa0('0x52')],'as':'Descriptions'}]});}return null;})[_0xdaa0('0x23')](respondWithResult(_0x5b4b7d,null))[_0xdaa0('0x46')](handleError(_0x5b4b7d,null));};function getAccessToken(_0x5648f4){return new Promise(function(_0x22d2ee,_0x38630a){var _0x105aa5;switch(_0x5648f4['zone']){case'US':_0x105aa5=_0xdaa0('0x53');break;case'AU':_0x105aa5=_0xdaa0('0x54');break;case'EU':_0x105aa5='https://accounts.zoho.eu';break;case'IN':_0x105aa5=_0xdaa0('0x55');break;case'CN':_0x105aa5=_0xdaa0('0x56');break;default:_0x105aa5=_0xdaa0('0x57');break;}var _0x3cda53={'method':_0xdaa0('0x58'),'uri':_0x105aa5+_0xdaa0('0x59'),'qs':{'refresh_token':_0x5648f4[_0xdaa0('0x5a')],'client_id':_0x5648f4[_0xdaa0('0x5b')],'client_secret':_0x5648f4[_0xdaa0('0x5c')],'grant_type':_0xdaa0('0x5d')},'json':!![]};return rp(_0x3cda53)[_0xdaa0('0x23')](function(_0x41bac5){if(_0x41bac5[_0xdaa0('0x5e')]){_0x22d2ee(_0x41bac5[_0xdaa0('0x5e')]);}else{_0x38630a(_0xdaa0('0x5f'));}})[_0xdaa0('0x46')](function(_0x44446e){_0x38630a(_0x44446e);});});}exports[_0xdaa0('0x60')]=function(_0x540a69,_0x38f647,_0x57ae72){var _0x9c3a08,_0x28e384,_0x587e5e,_0x476d6,_0x5e6353;return db['ZohoAccount']['findOne']({'where':{'id':_0x540a69[_0xdaa0('0x44')]['id']},'attributes':['id',_0xdaa0('0x61'),_0xdaa0('0x62'),_0xdaa0('0x5b'),_0xdaa0('0x5c'),_0xdaa0('0x63'),_0xdaa0('0x64'),'refreshToken']})[_0xdaa0('0x23')](handleEntityNotFound(_0x38f647,null))[_0xdaa0('0x23')](function(_0x1bdb2c){_0x5e6353=_0x1bdb2c;_0x9c3a08=_0x5e6353[_0xdaa0('0x61')];_0x28e384=_0x9c3a08===_0xdaa0('0x65')?'eu':_0xdaa0('0x66');_0x587e5e=_0x5e6353['serverUrl'];var _0x594719=_0x587e5e[_0xdaa0('0x67')](-0x1);if(_0x594719==='/'||_0x594719==='\x5c'||_0x594719===':'){_0x587e5e=_0x587e5e[_0xdaa0('0x68')](0x0,_0x587e5e[_0xdaa0('0x69')](_0x594719));}if(!_0x5e6353[_0xdaa0('0x5a')]){throw new Error(_0xdaa0('0x6a'));}return getAccessToken(_0x5e6353);})['then'](function(_0x14be8b){if(_0x14be8b){return rp({'method':_0xdaa0('0x6b'),'uri':util[_0xdaa0('0x6c')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x28e384),'qs':{'module':_0xdaa0('0x6d')},'headers':{'Authorization':_0xdaa0('0x6e')+_0x14be8b},'json':!![]});}})['then'](function(_0x389faa){if(_0x389faa){if(_0x389faa[_0xdaa0('0x6f')]&&_0x389faa[_0xdaa0('0x6f')][_0xdaa0('0x25')]){throw new Error(_0x389faa[_0xdaa0('0x6f')][_0xdaa0('0x25')][_0xdaa0('0x70')]);}var _0x575df4=[];var _0x1783b9=[];var _0x3890d6=['Owner',_0xdaa0('0x71'),_0xdaa0('0x72'),_0xdaa0('0x73'),_0xdaa0('0x74'),'Call_Result','Call_Start_Time',_0xdaa0('0x75')];_0x1783b9=_[_0xdaa0('0x76')](_0x389faa[_0xdaa0('0x34')],function(_0x985362){return _0x3890d6[_0xdaa0('0x77')](_0x985362[_0xdaa0('0x78')]);});for(var _0x2698b0=0x0;_0x2698b0<_0x1783b9[_0xdaa0('0x45')];_0x2698b0++){if(_0x1783b9[_0x2698b0]['system_mandatory']===![]){_0x575df4[_0xdaa0('0x79')]({'id':_0x1783b9[_0x2698b0]['id'],'name':_0x1783b9[_0x2698b0][_0xdaa0('0x7a')],'custom':_0x1783b9[_0x2698b0][_0xdaa0('0x7b')],'options':_0x1783b9[_0x2698b0]['data_type']===_0xdaa0('0x7c')&&_0x1783b9[_0x2698b0][_0xdaa0('0x7d')][_0xdaa0('0x45')]>-0x1?_[_0xdaa0('0x30')](_0x1783b9[_0x2698b0][_0xdaa0('0x7d')],function(_0x2437d4){return{'name':_0x2437d4,'value':_0x2437d4};}):[]});}}return{'count':_0x575df4[_0xdaa0('0x45')],'rows':_0x575df4};}else{return{'count':0x0,'rows':[]};}})[_0xdaa0('0x23')](respondWithResult(_0x38f647,null))[_0xdaa0('0x46')](function(_0x4cb4d4){var _0xff1509=_0x540a69[_0xdaa0('0x31')][_0xdaa0('0x7e')]?0x1f4:_0x4cb4d4[_0xdaa0('0x7f')]||0x1f4;logger[_0xdaa0('0x25')](_0xdaa0('0x80'),_0xdaa0('0x60'),_0xff1509,JSON['stringify'](_0x4cb4d4));delete _0x4cb4d4[_0xdaa0('0x27')];if(_0xff1509===0x191){_0xff1509=0x190;}_0x38f647['status'](_0xff1509)[_0xdaa0('0x28')](_0x540a69[_0xdaa0('0x31')][_0xdaa0('0x7e')]?{'message':_0xdaa0('0x81'),'statusCode':_0x4cb4d4[_0xdaa0('0x7f')]}:_0x4cb4d4);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 132d3ea..53c81fe 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 _0x712b=['../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','int_zoho_accounts','changed','serverUrl','clientSecret','code','host','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lastIndexOf','then','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x712b,0xfa));var _0xb712=function(_0x15642f,_0xa48ed6){_0x15642f=_0x15642f-0x0;var _0x2c2691=_0x712b[_0x15642f];return _0x2c2691;};'use strict';var _=require('lodash');var util=require(_0xb712('0x0'));var logger=require(_0xb712('0x1'))(_0xb712('0x2'));var moment=require(_0xb712('0x3'));var BPromise=require(_0xb712('0x4'));var rp=require(_0xb712('0x5'));var fs=require('fs');var path=require(_0xb712('0x6'));var rimraf=require(_0xb712('0x7'));var config=require(_0xb712('0x8'));var attributes=require(_0xb712('0x9'));var integrations=require(_0xb712('0xa'));module['exports']=function(_0x3523a5,_0x1a2e13){return _0x3523a5[_0xb712('0xb')]('ZohoAccount',attributes,{'tableName':_0xb712('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5783fc,_0x1a39a5,_0x2cfa56){if(_0x5783fc[_0xb712('0xd')]('zone')||_0x5783fc[_0xb712('0xd')](_0xb712('0xe'))||_0x5783fc[_0xb712('0xd')]('clientId')||_0x5783fc[_0xb712('0xd')](_0xb712('0xf'))||_0x5783fc[_0xb712('0xd')](_0xb712('0x10'))||_0x5783fc[_0xb712('0xd')](_0xb712('0x11'))){var _0x48dbe0,_0x1a498b;_0x48dbe0=_0x5783fc[_0xb712('0xe')];var _0x44606d=_0x48dbe0[_0xb712('0x12')](-0x1);if(_0x44606d==='/'||_0x44606d==='\x5c'||_0x44606d===':'){_0x48dbe0=_0x48dbe0[_0xb712('0x13')](0x0,_0x48dbe0['lastIndexOf'](_0x44606d));}switch(_0x5783fc[_0xb712('0x14')]){case'US':_0x1a498b=_0xb712('0x15');break;case'AU':_0x1a498b=_0xb712('0x16');break;case'IN':_0x1a498b=_0xb712('0x17');break;case'CN':_0x1a498b=_0xb712('0x18');break;default:_0x1a498b=_0xb712('0x19');break;}var _0x2803be={'method':_0xb712('0x1a'),'uri':_0x1a498b+_0xb712('0x1b'),'form':{'grant_type':_0xb712('0x1c'),'client_id':_0x5783fc[_0xb712('0x1d')],'client_secret':_0x5783fc['clientSecret'],'redirect_uri':_0x5783fc[_0xb712('0xe')],'code':_0x5783fc[_0xb712('0x10')]},'headers':{'Content-Type':_0xb712('0x1e')}};return rp(_0x2803be)['then'](function(_0x2bb5aa){var _0x4391f4=JSON['parse'](_0x2bb5aa);if(_0x4391f4[_0xb712('0x1f')]){_0x5783fc[_0xb712('0x20')]=_0x4391f4[_0xb712('0x1f')];logger[_0xb712('0x21')](util['format'](_0xb712('0x22'),_0x5783fc[_0xb712('0x23')],_0x5783fc['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5783fc['name'],_0x5783fc['id']),util[_0xb712('0x24')](_0x4391f4,{'showHidden':![],'depth':null}));}return _0x2cfa56(null,_0x1a39a5);})[_0xb712('0x25')](function(_0x3a43de){logger[_0xb712('0x26')](util[_0xb712('0x27')](_0xb712('0x28'),_0x5783fc[_0xb712('0x23')],_0x5783fc['id']),util[_0xb712('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x2cfa56(_0x3a43de);});}else{return _0x2cfa56(null,_0x1a39a5);}},'beforeUpdate':function(_0x41e2d3,_0x3f1af7,_0x417a4f){if(_0x41e2d3[_0xb712('0xd')]('zone')||_0x41e2d3[_0xb712('0xd')](_0xb712('0xe'))||_0x41e2d3[_0xb712('0xd')](_0xb712('0x1d'))||_0x41e2d3[_0xb712('0xd')](_0xb712('0xf'))||_0x41e2d3[_0xb712('0xd')]('code')||_0x41e2d3[_0xb712('0xd')](_0xb712('0x11'))){var _0x15f6cf,_0xc0005c;_0x15f6cf=_0x41e2d3[_0xb712('0xe')];var _0x39a480=_0x15f6cf[_0xb712('0x12')](-0x1);if(_0x39a480==='/'||_0x39a480==='\x5c'||_0x39a480===':'){_0x15f6cf=_0x15f6cf[_0xb712('0x13')](0x0,_0x15f6cf[_0xb712('0x29')](_0x39a480));}switch(_0x41e2d3[_0xb712('0x14')]){case'US':_0xc0005c=_0xb712('0x15');break;case'AU':_0xc0005c=_0xb712('0x16');break;case'IN':_0xc0005c=_0xb712('0x17');break;case'CN':_0xc0005c=_0xb712('0x18');break;default:_0xc0005c=_0xb712('0x19');break;}var _0x51aba1={'method':'POST','uri':_0xc0005c+_0xb712('0x1b'),'form':{'grant_type':_0xb712('0x1c'),'client_id':_0x41e2d3[_0xb712('0x1d')],'client_secret':_0x41e2d3[_0xb712('0xf')],'redirect_uri':_0x41e2d3[_0xb712('0xe')],'code':_0x41e2d3[_0xb712('0x10')]},'headers':{'Content-Type':_0xb712('0x1e')}};return rp(_0x51aba1)[_0xb712('0x2a')](function(_0x2c53b2){var _0x5860f5=JSON['parse'](_0x2c53b2);if(_0x5860f5[_0xb712('0x1f')]){_0x41e2d3[_0xb712('0x20')]=_0x5860f5['refresh_token'];logger[_0xb712('0x21')](util[_0xb712('0x27')](_0xb712('0x22'),_0x41e2d3[_0xb712('0x23')],_0x41e2d3['id']));}else{logger[_0xb712('0x26')](util[_0xb712('0x27')](_0xb712('0x28'),_0x41e2d3['name'],_0x41e2d3['id']),util[_0xb712('0x24')](_0x5860f5,{'showHidden':![],'depth':null}));}return _0x417a4f(null,_0x3f1af7);})[_0xb712('0x25')](function(_0x109802){logger[_0xb712('0x26')](util[_0xb712('0x27')](_0xb712('0x28'),_0x41e2d3[_0xb712('0x23')],_0x41e2d3['id']),util[_0xb712('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x417a4f(_0x109802);});}else{return _0x417a4f(null,_0x3f1af7);}}}});}; \ No newline at end of file +var _0x00d9=['clientSecret','host','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','code','https://accounts.zoho.in','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x00d9,0xf2));var _0x900d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x00d9[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x900d('0x0'));var util=require(_0x900d('0x1'));var logger=require(_0x900d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x900d('0x3'));var rp=require(_0x900d('0x4'));var fs=require('fs');var path=require(_0x900d('0x5'));var rimraf=require(_0x900d('0x6'));var config=require(_0x900d('0x7'));var attributes=require(_0x900d('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x900d('0x9')]=function(_0x238fd2,_0x56427c){return _0x238fd2[_0x900d('0xa')](_0x900d('0xb'),attributes,{'tableName':_0x900d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x928450,_0xdeb03e,_0x5c6c57){if(_0x928450[_0x900d('0xd')](_0x900d('0xe'))||_0x928450[_0x900d('0xd')]('serverUrl')||_0x928450[_0x900d('0xd')](_0x900d('0xf'))||_0x928450[_0x900d('0xd')](_0x900d('0x10'))||_0x928450[_0x900d('0xd')]('code')||_0x928450[_0x900d('0xd')](_0x900d('0x11'))){var _0x803458,_0x1efa93;_0x803458=_0x928450[_0x900d('0x12')];var _0x5b0b29=_0x803458[_0x900d('0x13')](-0x1);if(_0x5b0b29==='/'||_0x5b0b29==='\x5c'||_0x5b0b29===':'){_0x803458=_0x803458[_0x900d('0x14')](0x0,_0x803458[_0x900d('0x15')](_0x5b0b29));}switch(_0x928450[_0x900d('0xe')]){case'US':_0x1efa93=_0x900d('0x16');break;case'AU':_0x1efa93=_0x900d('0x17');break;case'IN':_0x1efa93='https://accounts.zoho.in';break;case'CN':_0x1efa93=_0x900d('0x18');break;default:_0x1efa93='https://accounts.zoho.eu';break;}var _0x3b5533={'method':_0x900d('0x19'),'uri':_0x1efa93+_0x900d('0x1a'),'form':{'grant_type':_0x900d('0x1b'),'client_id':_0x928450[_0x900d('0xf')],'client_secret':_0x928450[_0x900d('0x10')],'redirect_uri':_0x928450[_0x900d('0x12')],'code':_0x928450['code']},'headers':{'Content-Type':_0x900d('0x1c')}};return rp(_0x3b5533)[_0x900d('0x1d')](function(_0xf221f7){var _0x465c33=JSON[_0x900d('0x1e')](_0xf221f7);if(_0x465c33['refresh_token']){_0x928450[_0x900d('0x1f')]=_0x465c33[_0x900d('0x20')];logger[_0x900d('0x21')](util[_0x900d('0x22')](_0x900d('0x23'),_0x928450[_0x900d('0x24')],_0x928450['id']));}else{logger[_0x900d('0x25')](util['format'](_0x900d('0x26'),_0x928450['name'],_0x928450['id']),util[_0x900d('0x27')](_0x465c33,{'showHidden':![],'depth':null}));}return _0x5c6c57(null,_0xdeb03e);})[_0x900d('0x28')](function(_0x4aa0b6){logger[_0x900d('0x25')](util[_0x900d('0x22')](_0x900d('0x26'),_0x928450[_0x900d('0x24')],_0x928450['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5c6c57(_0x4aa0b6);});}else{return _0x5c6c57(null,_0xdeb03e);}},'beforeUpdate':function(_0x3b3580,_0x58b404,_0x38639b){if(_0x3b3580[_0x900d('0xd')](_0x900d('0xe'))||_0x3b3580[_0x900d('0xd')](_0x900d('0x12'))||_0x3b3580[_0x900d('0xd')]('clientId')||_0x3b3580['changed']('clientSecret')||_0x3b3580[_0x900d('0xd')](_0x900d('0x29'))||_0x3b3580[_0x900d('0xd')]('host')){var _0x19baa0,_0x24fe03;_0x19baa0=_0x3b3580['serverUrl'];var _0x555668=_0x19baa0[_0x900d('0x13')](-0x1);if(_0x555668==='/'||_0x555668==='\x5c'||_0x555668===':'){_0x19baa0=_0x19baa0['substring'](0x0,_0x19baa0[_0x900d('0x15')](_0x555668));}switch(_0x3b3580[_0x900d('0xe')]){case'US':_0x24fe03=_0x900d('0x16');break;case'AU':_0x24fe03=_0x900d('0x17');break;case'IN':_0x24fe03=_0x900d('0x2a');break;case'CN':_0x24fe03=_0x900d('0x18');break;default:_0x24fe03='https://accounts.zoho.eu';break;}var _0x481544={'method':_0x900d('0x19'),'uri':_0x24fe03+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x3b3580['clientId'],'client_secret':_0x3b3580[_0x900d('0x10')],'redirect_uri':_0x3b3580['serverUrl'],'code':_0x3b3580[_0x900d('0x29')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x481544)['then'](function(_0x5cec49){var _0x36b1af=JSON[_0x900d('0x1e')](_0x5cec49);if(_0x36b1af[_0x900d('0x20')]){_0x3b3580['refreshToken']=_0x36b1af[_0x900d('0x20')];logger[_0x900d('0x21')](util[_0x900d('0x22')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3b3580['name'],_0x3b3580['id']));}else{logger[_0x900d('0x25')](util['format'](_0x900d('0x26'),_0x3b3580[_0x900d('0x24')],_0x3b3580['id']),util['inspect'](_0x36b1af,{'showHidden':![],'depth':null}));}return _0x38639b(null,_0x58b404);})[_0x900d('0x28')](function(_0x5dd305){logger['error'](util[_0x900d('0x22')](_0x900d('0x26'),_0x3b3580['name'],_0x3b3580['id']),util[_0x900d('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x38639b(_0x5dd305);});}else{return _0x38639b(null,_0x58b404);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 8493bb4..8286529 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 _0xb923=['randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','model','include','map','stringify','find','ShowZohoAccount','catch','lodash','util','moment'];(function(_0x19c700,_0x1662ee){var _0x213fe9=function(_0x1fd039){while(--_0x1fd039){_0x19c700['push'](_0x19c700['shift']());}};_0x213fe9(++_0x1662ee);}(_0xb923,0xa2));var _0x3b92=function(_0x3d7360,_0x120839){_0x3d7360=_0x3d7360-0x0;var _0x40102c=_0xb923[_0x3d7360];return _0x40102c;};'use strict';var _=require(_0x3b92('0x0'));var util=require(_0x3b92('0x1'));var moment=require(_0x3b92('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b92('0x3'));var fs=require('fs');var Redis=require(_0x3b92('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b92('0x5'));var config=require(_0x3b92('0x6'));var jayson=require(_0x3b92('0x7'));var client=jayson[_0x3b92('0x8')][_0x3b92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b490c,_0x6809d9,_0x48b468){return new BPromise(function(_0x511c10,_0x2aefa5){return client['request'](_0x2b490c,_0x48b468)[_0x3b92('0xa')](function(_0x43b28a){logger['info'](_0x3b92('0xb'),_0x6809d9,_0x3b92('0xc'));logger[_0x3b92('0xd')](_0x3b92('0xe'),_0x6809d9,_0x3b92('0xc'),JSON['stringify'](_0x43b28a));if(_0x43b28a[_0x3b92('0xf')]){if(_0x43b28a['error']['code']===0x1f4){logger[_0x3b92('0xf')](_0x3b92('0xb'),_0x6809d9,_0x43b28a[_0x3b92('0xf')][_0x3b92('0x10')]);return _0x2aefa5(_0x43b28a['error']['message']);}logger[_0x3b92('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x6809d9,_0x43b28a['error'][_0x3b92('0x10')]);return _0x511c10(_0x43b28a[_0x3b92('0xf')][_0x3b92('0x10')]);}else{logger[_0x3b92('0x11')](_0x3b92('0xb'),_0x6809d9,'request\x20sent');_0x511c10(_0x43b28a[_0x3b92('0x12')][_0x3b92('0x10')]);}})['catch'](function(_0x4e6da7){logger[_0x3b92('0xf')](_0x3b92('0xb'),_0x6809d9,_0x4e6da7);_0x2aefa5(_0x4e6da7);});});}exports[_0x3b92('0x13')]=function(_0x1859b4){var _0x3d7f80=this;return new Promise(function(_0xc2cd15,_0x361754){return db[_0x3b92('0x14')][_0x3b92('0x15')]({'raw':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')][_0x3b92('0x17')]===undefined?!![]:![]:!![],'where':_0x1859b4[_0x3b92('0x16')]?_0x1859b4['options'][_0x3b92('0x18')]||null:null,'attributes':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')][_0x3b92('0x19')]||null:null,'limit':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')]['limit']||null:null,'include':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')]['include']?_['map'](_0x1859b4['options']['include'],function(_0x450f2e){return{'model':db[_0x450f2e[_0x3b92('0x1a')]],'as':_0x450f2e['as'],'attributes':_0x450f2e[_0x3b92('0x19')],'include':_0x450f2e[_0x3b92('0x1b')]?_[_0x3b92('0x1c')](_0x450f2e[_0x3b92('0x1b')],function(_0x427a90){return{'model':db[_0x427a90['model']],'as':_0x427a90['as'],'attributes':_0x427a90[_0x3b92('0x19')],'include':_0x427a90['include']?_[_0x3b92('0x1c')](_0x427a90['include'],function(_0x24a15f){return{'model':db[_0x24a15f[_0x3b92('0x1a')]],'as':_0x24a15f['as'],'attributes':_0x24a15f[_0x3b92('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3b92('0xa')](function(_0x42fc82){logger[_0x3b92('0x11')]('GetZohoAccount',_0x1859b4);logger[_0x3b92('0xd')](_0x3b92('0x13'),_0x1859b4,JSON[_0x3b92('0x1d')](_0x42fc82));_0xc2cd15(_0x42fc82);})['catch'](function(_0x4ac7b4){logger[_0x3b92('0xf')](_0x3b92('0x13'),_0x4ac7b4['message'],_0x1859b4);_0x361754(_0x3d7f80['error'](0x1f4,_0x4ac7b4[_0x3b92('0x10')]));});});};exports['ShowZohoAccount']=function(_0x2d8b2e){var _0x4e404c=this;return new Promise(function(_0x5b8e18,_0x4a3596){return db[_0x3b92('0x14')][_0x3b92('0x1e')]({'raw':_0x2d8b2e['options']?_0x2d8b2e[_0x3b92('0x16')][_0x3b92('0x17')]===undefined?!![]:![]:!![],'where':_0x2d8b2e['options']?_0x2d8b2e[_0x3b92('0x16')][_0x3b92('0x18')]||null:null,'attributes':_0x2d8b2e[_0x3b92('0x16')]?_0x2d8b2e['options']['attributes']||null:null,'include':_0x2d8b2e[_0x3b92('0x16')]?_0x2d8b2e[_0x3b92('0x16')][_0x3b92('0x1b')]?_['map'](_0x2d8b2e['options'][_0x3b92('0x1b')],function(_0x5cd23f){return{'model':db[_0x5cd23f[_0x3b92('0x1a')]],'as':_0x5cd23f['as'],'attributes':_0x5cd23f[_0x3b92('0x19')],'include':_0x5cd23f[_0x3b92('0x1b')]?_[_0x3b92('0x1c')](_0x5cd23f[_0x3b92('0x1b')],function(_0x1ec1e2){return{'model':db[_0x1ec1e2[_0x3b92('0x1a')]],'as':_0x1ec1e2['as'],'attributes':_0x1ec1e2['attributes'],'include':_0x1ec1e2[_0x3b92('0x1b')]?_[_0x3b92('0x1c')](_0x1ec1e2[_0x3b92('0x1b')],function(_0x49d036){return{'model':db[_0x49d036[_0x3b92('0x1a')]],'as':_0x49d036['as'],'attributes':_0x49d036[_0x3b92('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3b92('0xa')](function(_0x1a7bbb){logger[_0x3b92('0x11')](_0x3b92('0x1f'),_0x2d8b2e);logger[_0x3b92('0xd')](_0x3b92('0x1f'),_0x2d8b2e,JSON[_0x3b92('0x1d')](_0x1a7bbb));_0x5b8e18(_0x1a7bbb);})[_0x3b92('0x20')](function(_0x2920a5){logger[_0x3b92('0xf')](_0x3b92('0x1f'),_0x2920a5[_0x3b92('0x10')],_0x2d8b2e);_0x4a3596(_0x4e404c[_0x3b92('0xf')](0x1f4,_0x2920a5[_0x3b92('0x10')]));});});}; \ No newline at end of file +var _0x2ef3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','options','raw','where','include','model','map','attributes','ShowZohoAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x14b4ed,_0x59f613){var _0x4a9160=function(_0x2ec5d6){while(--_0x2ec5d6){_0x14b4ed['push'](_0x14b4ed['shift']());}};_0x4a9160(++_0x59f613);}(_0x2ef3,0xba));var _0x32ef=function(_0x1d15b8,_0x180d0a){_0x1d15b8=_0x1d15b8-0x0;var _0xb9d0f8=_0x2ef3[_0x1d15b8];return _0xb9d0f8;};'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')]('ZohoAccount,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['findAll']({'raw':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x18')]===undefined?!![]:![]:!![],'where':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x19')]||null:null,'attributes':_0x1a9476['options']?_0x1a9476[_0x32ef('0x17')]['attributes']||null:null,'limit':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')]['limit']||null:null,'include':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x1a')]?_['map'](_0x1a9476['options'][_0x32ef('0x1a')],function(_0xb30fab){return{'model':db[_0xb30fab[_0x32ef('0x1b')]],'as':_0xb30fab['as'],'attributes':_0xb30fab['attributes'],'include':_0xb30fab['include']?_[_0x32ef('0x1c')](_0xb30fab['include'],function(_0x51a412){return{'model':db[_0x51a412[_0x32ef('0x1b')]],'as':_0x51a412['as'],'attributes':_0x51a412[_0x32ef('0x1d')],'include':_0x51a412[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x51a412[_0x32ef('0x1a')],function(_0x234175){return{'model':db[_0x234175[_0x32ef('0x1b')]],'as':_0x234175['as'],'attributes':_0x234175[_0x32ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xb')](function(_0x2f52d7){logger[_0x32ef('0xc')](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x2f52d7));_0x57863c(_0x2f52d7);})['catch'](function(_0x12de1a){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x12de1a[_0x32ef('0x13')],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x12de1a[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1e')]=function(_0x31dbc3){var _0x2ac686=this;return new Promise(function(_0x1b668a,_0x1a6ed2){return db[_0x32ef('0x16')]['find']({'raw':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options'][_0x32ef('0x18')]===undefined?!![]:![]:!![],'where':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options'][_0x32ef('0x19')]||null:null,'attributes':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3[_0x32ef('0x17')][_0x32ef('0x1d')]||null:null,'include':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options']['include']?_[_0x32ef('0x1c')](_0x31dbc3['options'][_0x32ef('0x1a')],function(_0x15b873){return{'model':db[_0x15b873[_0x32ef('0x1b')]],'as':_0x15b873['as'],'attributes':_0x15b873[_0x32ef('0x1d')],'include':_0x15b873[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x15b873['include'],function(_0x482d3a){return{'model':db[_0x482d3a['model']],'as':_0x482d3a['as'],'attributes':_0x482d3a[_0x32ef('0x1d')],'include':_0x482d3a[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x482d3a['include'],function(_0x4fb402){return{'model':db[_0x4fb402[_0x32ef('0x1b')]],'as':_0x4fb402['as'],'attributes':_0x4fb402[_0x32ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xb')](function(_0x480348){logger['info'](_0x32ef('0x1e'),_0x31dbc3);logger[_0x32ef('0x1f')](_0x32ef('0x1e'),_0x31dbc3,JSON[_0x32ef('0x10')](_0x480348));_0x1b668a(_0x480348);})[_0x32ef('0x14')](function(_0x211c79){logger[_0x32ef('0x11')](_0x32ef('0x1e'),_0x211c79[_0x32ef('0x13')],_0x31dbc3);_0x1a6ed2(_0x2ac686['error'](0x1f4,_0x211c79[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 46e9a24..f173bc0 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 _0xda75=['destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','create','update','delete'];(function(_0x22b56c,_0x2880bc){var _0x5def9f=function(_0x3b4943){while(--_0x3b4943){_0x22b56c['push'](_0x22b56c['shift']());}};_0x5def9f(++_0x2880bc);}(_0xda75,0x1bb));var _0x5da7=function(_0x56b748,_0x9297ef){_0x56b748=_0x56b748-0x0;var _0x4ab538=_0xda75[_0x56b748];return _0x4ab538;};'use strict';var multer=require(_0x5da7('0x0'));var util=require('util');var path=require(_0x5da7('0x1'));var timeout=require(_0x5da7('0x2'));var express=require(_0x5da7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5da7('0x4'));var interaction=require(_0x5da7('0x5'));var config=require(_0x5da7('0x6'));var controller=require(_0x5da7('0x7'));router[_0x5da7('0x8')]('/',auth[_0x5da7('0x9')](),controller['index']);router['get'](_0x5da7('0xa'),auth[_0x5da7('0x9')](),controller[_0x5da7('0xb')]);router[_0x5da7('0x8')](_0x5da7('0xc'),auth[_0x5da7('0x9')](),controller[_0x5da7('0xd')]);router[_0x5da7('0x8')]('/:id/subjects',auth[_0x5da7('0x9')](),controller[_0x5da7('0xe')]);router[_0x5da7('0x8')]('/:id/descriptions',auth[_0x5da7('0x9')](),controller[_0x5da7('0xf')]);router['post']('/',auth[_0x5da7('0x9')](),controller[_0x5da7('0x10')]);router['put'](_0x5da7('0xa'),auth[_0x5da7('0x9')](),controller[_0x5da7('0x11')]);router[_0x5da7('0x12')](_0x5da7('0xa'),auth['isAuthenticated'](),controller[_0x5da7('0x13')]);module[_0x5da7('0x14')]=router; \ No newline at end of file +var _0xcf7b=['../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x281e74,_0x376149){var _0x415938=function(_0x5ee43b){while(--_0x5ee43b){_0x281e74['push'](_0x281e74['shift']());}};_0x415938(++_0x376149);}(_0xcf7b,0x77));var _0xbcf7=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xcf7b[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0xbcf7('0x0'));var util=require('util');var path=require(_0xbcf7('0x1'));var timeout=require(_0xbcf7('0x2'));var express=require('express');var router=express[_0xbcf7('0x3')]();var fs_extra=require(_0xbcf7('0x4'));var auth=require(_0xbcf7('0x5'));var interaction=require(_0xbcf7('0x6'));var config=require(_0xbcf7('0x7'));var controller=require(_0xbcf7('0x8'));router[_0xbcf7('0x9')]('/',auth[_0xbcf7('0xa')](),controller[_0xbcf7('0xb')]);router[_0xbcf7('0x9')](_0xbcf7('0xc'),auth['isAuthenticated'](),controller[_0xbcf7('0xd')]);router[_0xbcf7('0x9')](_0xbcf7('0xe'),auth[_0xbcf7('0xa')](),controller[_0xbcf7('0xf')]);router['get']('/:id/subjects',auth[_0xbcf7('0xa')](),controller[_0xbcf7('0x10')]);router[_0xbcf7('0x9')](_0xbcf7('0x11'),auth[_0xbcf7('0xa')](),controller[_0xbcf7('0x12')]);router[_0xbcf7('0x13')]('/',auth[_0xbcf7('0xa')](),controller[_0xbcf7('0x14')]);router[_0xbcf7('0x15')]('/:id',auth[_0xbcf7('0xa')](),controller['update']);router[_0xbcf7('0x16')](_0xbcf7('0xc'),auth[_0xbcf7('0xa')](),controller[_0xbcf7('0x17')]);module[_0xbcf7('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index bec2d4d..e426e4a 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 _0x2568=['nothing','contact_lead','sequelize','STRING','ENUM','lead','contact'];(function(_0x1256cd,_0x8939b9){var _0x4a310f=function(_0xce289b){while(--_0xce289b){_0x1256cd['push'](_0x1256cd['shift']());}};_0x4a310f(++_0x8939b9);}(_0x2568,0x12f));var _0x8256=function(_0x16cc17,_0x49727d){_0x16cc17=_0x16cc17-0x0;var _0x434278=_0x2568[_0x16cc17];return _0x434278;};'use strict';var Sequelize=require(_0x8256('0x0'));module['exports']={'name':{'type':Sequelize[_0x8256('0x1')]},'moduleCreate':{'type':Sequelize[_0x8256('0x2')](_0x8256('0x3'),_0x8256('0x4'),_0x8256('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0x8256('0x6'),_0x8256('0x4'),_0x8256('0x3')),'defaultValue':_0x8256('0x6')},'description':{'type':Sequelize[_0x8256('0x1')]}}; \ No newline at end of file +var _0x9404=['STRING','sequelize','exports','lead','contact','nothing','ENUM','contact_lead'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9404,0x101));var _0x4940=function(_0x35beff,_0x26451e){_0x35beff=_0x35beff-0x0;var _0x4a9967=_0x9404[_0x35beff];return _0x4a9967;};'use strict';var Sequelize=require(_0x4940('0x0'));module[_0x4940('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x4940('0x2'),_0x4940('0x3'),_0x4940('0x4')),'defaultValue':_0x4940('0x2')},'moduleSearch':{'type':Sequelize[_0x4940('0x5')]('contact_lead',_0x4940('0x3'),_0x4940('0x2')),'defaultValue':_0x4940('0x6')},'description':{'type':Sequelize[_0x4940('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index cff92e6..0d6a13b 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 _0x8a93=['ZohoField','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','ZohoConfiguration','create','body','find','getFields','findOne','getSubjects','getDescriptions'];(function(_0x1b4b64,_0x57de56){var _0x52a18b=function(_0x2b0b8f){while(--_0x2b0b8f){_0x1b4b64['push'](_0x1b4b64['shift']());}};_0x52a18b(++_0x57de56);}(_0x8a93,0xee));var _0x38a9=function(_0x1f5ab3,_0x2d2473){_0x1f5ab3=_0x1f5ab3-0x0;var _0x2bd0d7=_0x8a93[_0x1f5ab3];return _0x2bd0d7;};'use strict';var emlformat=require(_0x38a9('0x0'));var rimraf=require(_0x38a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38a9('0x2'));var rp=require('request-promise');var moment=require(_0x38a9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x38a9('0x4'));var util=require(_0x38a9('0x5'));var path=require(_0x38a9('0x6'));var sox=require(_0x38a9('0x7'));var csv=require(_0x38a9('0x8'));var ejs=require(_0x38a9('0x9'));var fs=require('fs');var fs_extra=require(_0x38a9('0xa'));var _=require(_0x38a9('0xb'));var squel=require(_0x38a9('0xc'));var crypto=require(_0x38a9('0xd'));var jsforce=require(_0x38a9('0xe'));var deskjs=require(_0x38a9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x38a9('0x10'));var Papa=require(_0x38a9('0x11'));var Redis=require(_0x38a9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x38a9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38a9('0x14'));var logger=require('../../config/logger')(_0x38a9('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x38a9('0x16'))['db'];function respondWithStatusCode(_0x37e877,_0xb139cd){_0xb139cd=_0xb139cd||0xcc;return function(_0x525890){if(_0x525890){return _0x37e877[_0x38a9('0x17')](_0xb139cd);}return _0x37e877['status'](_0xb139cd)[_0x38a9('0x18')]();};}function respondWithResult(_0x3f9f73,_0x3cfb40){_0x3cfb40=_0x3cfb40||0xc8;return function(_0x1cff17){if(_0x1cff17){return _0x3f9f73[_0x38a9('0x19')](_0x3cfb40)[_0x38a9('0x1a')](_0x1cff17);}};}function respondWithFilteredResult(_0x3284b3,_0x2ff521){return function(_0x35d31e){if(_0x35d31e){var _0x4511b2=typeof _0x2ff521[_0x38a9('0x1b')]==='undefined'&&typeof _0x2ff521[_0x38a9('0x1c')]===_0x38a9('0x1d');var _0x2e5e4b=_0x35d31e['count'];var _0x3fcc76=_0x4511b2?0x0:_0x2ff521[_0x38a9('0x1b')];var _0x28d717=_0x4511b2?_0x35d31e[_0x38a9('0x1e')]:_0x2ff521[_0x38a9('0x1b')]+_0x2ff521['limit'];var _0x3865c;if(_0x28d717>=_0x2e5e4b){_0x28d717=_0x2e5e4b;_0x3865c=0xc8;}else{_0x3865c=0xce;}_0x3284b3['status'](_0x3865c);return _0x3284b3[_0x38a9('0x1f')](_0x38a9('0x20'),_0x3fcc76+'-'+_0x28d717+'/'+_0x2e5e4b)['json'](_0x35d31e);}return null;};}function patchUpdates(_0x13a04e){return function(_0x390b4b){try{jsonpatch['apply'](_0x390b4b,_0x13a04e,!![]);}catch(_0x450138){return BPromise[_0x38a9('0x21')](_0x450138);}return _0x390b4b['save']();};}function saveUpdates(_0x490ff8,_0x3a07f0){return function(_0x8ef3cd){if(_0x8ef3cd){return _0x8ef3cd[_0x38a9('0x22')](_0x490ff8)[_0x38a9('0x23')](function(_0x5c10b8){return _0x5c10b8;});}return null;};}function removeEntity(_0x227ebc,_0x1f3a5d){return function(_0x103a6c){if(_0x103a6c){return _0x103a6c[_0x38a9('0x24')]()['then'](function(){_0x227ebc['status'](0xcc)[_0x38a9('0x18')]();});}};}function handleEntityNotFound(_0x13a933,_0x3c3bd6){return function(_0x567e4){if(!_0x567e4){_0x13a933['sendStatus'](0x194);}return _0x567e4;};}function handleError(_0x1eaece,_0x349831){_0x349831=_0x349831||0x1f4;return function(_0x1ea9df){logger[_0x38a9('0x25')](_0x1ea9df[_0x38a9('0x26')]);if(_0x1ea9df[_0x38a9('0x27')]){delete _0x1ea9df[_0x38a9('0x27')];}_0x1eaece[_0x38a9('0x19')](_0x349831)[_0x38a9('0x28')](_0x1ea9df);};}exports[_0x38a9('0x29')]=function(_0x1b64a1,_0x21de16){var _0x42bcfc={},_0x2be206={},_0x418496={'count':0x0,'rows':[]};var _0x3db2b1=_[_0x38a9('0x2a')](db['ZohoConfiguration'][_0x38a9('0x2b')],function(_0x595e3e){return{'name':_0x595e3e[_0x38a9('0x2c')],'type':_0x595e3e['type'][_0x38a9('0x2d')]};});_0x2be206['model']=_['map'](_0x3db2b1,'name');_0x2be206[_0x38a9('0x2e')]=_[_0x38a9('0x2f')](_0x1b64a1['query']);_0x2be206[_0x38a9('0x30')]=_[_0x38a9('0x31')](_0x2be206[_0x38a9('0x32')],_0x2be206['query']);_0x42bcfc[_0x38a9('0x33')]=_[_0x38a9('0x31')](_0x2be206[_0x38a9('0x32')],qs[_0x38a9('0x34')](_0x1b64a1[_0x38a9('0x2e')][_0x38a9('0x34')]));_0x42bcfc[_0x38a9('0x33')]=_0x42bcfc['attributes'][_0x38a9('0x35')]?_0x42bcfc[_0x38a9('0x33')]:_0x2be206['model'];if(!_0x1b64a1[_0x38a9('0x2e')][_0x38a9('0x36')](_0x38a9('0x37'))){_0x42bcfc[_0x38a9('0x1c')]=qs['limit'](_0x1b64a1[_0x38a9('0x2e')][_0x38a9('0x1c')]);_0x42bcfc[_0x38a9('0x1b')]=qs[_0x38a9('0x1b')](_0x1b64a1[_0x38a9('0x2e')]['offset']);}_0x42bcfc[_0x38a9('0x38')]=qs[_0x38a9('0x39')](_0x1b64a1[_0x38a9('0x2e')][_0x38a9('0x39')]);_0x42bcfc[_0x38a9('0x3a')]=qs[_0x38a9('0x30')](_[_0x38a9('0x3b')](_0x1b64a1[_0x38a9('0x2e')],_0x2be206['filters']),_0x3db2b1);if(_0x1b64a1[_0x38a9('0x2e')][_0x38a9('0x3c')]){_0x42bcfc[_0x38a9('0x3a')]=_[_0x38a9('0x3d')](_0x42bcfc[_0x38a9('0x3a')],{'$or':_[_0x38a9('0x2a')](_0x3db2b1,function(_0x33dd43){if(_0x33dd43[_0x38a9('0x3e')]!==_0x38a9('0x3f')){var _0x5d9b35={};_0x5d9b35[_0x33dd43[_0x38a9('0x27')]]={'$like':'%'+_0x1b64a1['query'][_0x38a9('0x3c')]+'%'};return _0x5d9b35;}})});}_0x42bcfc=_[_0x38a9('0x3d')]({},_0x42bcfc,_0x1b64a1[_0x38a9('0x40')]);var _0x329ca2={'where':_0x42bcfc['where']};return db['ZohoConfiguration'][_0x38a9('0x1e')](_0x329ca2)[_0x38a9('0x23')](function(_0x37cd9c){_0x418496[_0x38a9('0x1e')]=_0x37cd9c;if(_0x1b64a1[_0x38a9('0x2e')][_0x38a9('0x41')]){_0x42bcfc[_0x38a9('0x42')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x42bcfc);})[_0x38a9('0x23')](function(_0x291fe4){_0x418496[_0x38a9('0x43')]=_0x291fe4;return _0x418496;})[_0x38a9('0x23')](respondWithFilteredResult(_0x21de16,_0x42bcfc))[_0x38a9('0x44')](handleError(_0x21de16,null));};exports['show']=function(_0x5b247c,_0x2f0952){var _0x3d18ef={'raw':![],'where':{'id':_0x5b247c[_0x38a9('0x45')]['id']}},_0x4fc3f2={};_0x4fc3f2[_0x38a9('0x32')]=_[_0x38a9('0x2f')](db[_0x38a9('0x46')][_0x38a9('0x2b')]);_0x4fc3f2['query']=_[_0x38a9('0x2f')](_0x5b247c[_0x38a9('0x2e')]);_0x4fc3f2[_0x38a9('0x30')]=_[_0x38a9('0x31')](_0x4fc3f2[_0x38a9('0x32')],_0x4fc3f2[_0x38a9('0x2e')]);_0x3d18ef['attributes']=_[_0x38a9('0x31')](_0x4fc3f2[_0x38a9('0x32')],qs['fields'](_0x5b247c[_0x38a9('0x2e')][_0x38a9('0x34')]));_0x3d18ef['attributes']=_0x3d18ef[_0x38a9('0x33')][_0x38a9('0x35')]?_0x3d18ef[_0x38a9('0x33')]:_0x4fc3f2[_0x38a9('0x32')];if(_0x5b247c[_0x38a9('0x2e')][_0x38a9('0x41')]){_0x3d18ef[_0x38a9('0x42')]=[{'all':!![]}];}_0x3d18ef=_[_0x38a9('0x3d')]({},_0x3d18ef,_0x5b247c[_0x38a9('0x40')]);return db[_0x38a9('0x46')]['find'](_0x3d18ef)[_0x38a9('0x23')](handleEntityNotFound(_0x2f0952,null))[_0x38a9('0x23')](respondWithResult(_0x2f0952,null))['catch'](handleError(_0x2f0952,null));};exports['create']=function(_0x33d2c5,_0x3fb917){return db['ZohoConfiguration'][_0x38a9('0x47')](_0x33d2c5[_0x38a9('0x48')],{})[_0x38a9('0x23')](respondWithResult(_0x3fb917,0xc9))['catch'](handleError(_0x3fb917,null));};exports['update']=function(_0x39c749,_0xba7096){if(_0x39c749[_0x38a9('0x48')]['id']){delete _0x39c749[_0x38a9('0x48')]['id'];}return db[_0x38a9('0x46')][_0x38a9('0x49')]({'where':{'id':_0x39c749[_0x38a9('0x45')]['id']}})['then'](handleEntityNotFound(_0xba7096,null))[_0x38a9('0x23')](saveUpdates(_0x39c749['body'],null))[_0x38a9('0x23')](respondWithResult(_0xba7096,null))['catch'](handleError(_0xba7096,null));};exports[_0x38a9('0x24')]=function(_0x16c4d8,_0x3be34c){return db['ZohoConfiguration'][_0x38a9('0x49')]({'where':{'id':_0x16c4d8['params']['id']}})['then'](handleEntityNotFound(_0x3be34c,null))[_0x38a9('0x23')](removeEntity(_0x3be34c,null))['catch'](handleError(_0x3be34c,null));};exports[_0x38a9('0x4a')]=function(_0x145d63,_0x339596,_0x565fab){var _0x469ad0={};var _0x92a55e={};var _0xbaaec1;var _0x21190a;return db[_0x38a9('0x46')][_0x38a9('0x4b')]({'where':{'id':_0x145d63[_0x38a9('0x45')]['id']}})['then'](handleEntityNotFound(_0x339596,null))['then'](function(_0xdbb3ad){if(_0xdbb3ad){_0xbaaec1=_0xdbb3ad;_0x92a55e[_0x38a9('0x32')]=_[_0x38a9('0x2f')](db['ZohoField']['rawAttributes']);_0x92a55e['query']=_[_0x38a9('0x2f')](_0x145d63['query']);_0x92a55e[_0x38a9('0x30')]=_[_0x38a9('0x31')](_0x92a55e[_0x38a9('0x32')],_0x92a55e[_0x38a9('0x2e')]);_0x469ad0['attributes']=_[_0x38a9('0x31')](_0x92a55e[_0x38a9('0x32')],qs[_0x38a9('0x34')](_0x145d63['query'][_0x38a9('0x34')]));_0x469ad0[_0x38a9('0x33')]=_0x469ad0['attributes'][_0x38a9('0x35')]?_0x469ad0[_0x38a9('0x33')]:_0x92a55e[_0x38a9('0x32')];_0x469ad0[_0x38a9('0x38')]=qs[_0x38a9('0x39')](_0x145d63[_0x38a9('0x2e')][_0x38a9('0x39')]);_0x469ad0['where']=qs['filters'](_['pick'](_0x145d63[_0x38a9('0x2e')],_0x92a55e[_0x38a9('0x30')]));if(_0x145d63[_0x38a9('0x2e')]['filter']){_0x469ad0['where']=_[_0x38a9('0x3d')](_0x469ad0[_0x38a9('0x3a')],{'$or':_['map'](_0x469ad0[_0x38a9('0x33')],function(_0x4ea8dc){var _0x786644={};_0x786644[_0x4ea8dc]={'$like':'%'+_0x145d63[_0x38a9('0x2e')][_0x38a9('0x3c')]+'%'};return _0x786644;})});}_0x469ad0=_[_0x38a9('0x3d')]({},_0x469ad0,_0x145d63[_0x38a9('0x40')]);return _0xbaaec1[_0x38a9('0x4a')](_0x469ad0);}})[_0x38a9('0x23')](function(_0xf8707e){if(_0xf8707e){_0x21190a=_0xf8707e[_0x38a9('0x35')];if(!_0x145d63['query'][_0x38a9('0x36')](_0x38a9('0x37'))){_0x469ad0[_0x38a9('0x1c')]=qs['limit'](_0x145d63[_0x38a9('0x2e')][_0x38a9('0x1c')]);_0x469ad0[_0x38a9('0x1b')]=qs[_0x38a9('0x1b')](_0x145d63['query'][_0x38a9('0x1b')]);}return _0xbaaec1[_0x38a9('0x4a')](_0x469ad0);}})['then'](function(_0x4acaa7){if(_0x4acaa7){return _0x4acaa7?{'count':_0x21190a,'rows':_0x4acaa7}:null;}})[_0x38a9('0x23')](respondWithResult(_0x339596,null))['catch'](handleError(_0x339596,null));};exports[_0x38a9('0x4c')]=function(_0x30598d,_0x19907d,_0x19735d){var _0x5a26b7={};var _0x29f4a0={};var _0x40ade8;var _0x135722;return db[_0x38a9('0x46')][_0x38a9('0x4b')]({'where':{'id':_0x30598d[_0x38a9('0x45')]['id']}})['then'](handleEntityNotFound(_0x19907d,null))[_0x38a9('0x23')](function(_0x5e2118){if(_0x5e2118){_0x40ade8=_0x5e2118;_0x29f4a0['model']=_['keys'](db['ZohoField'][_0x38a9('0x2b')]);_0x29f4a0[_0x38a9('0x2e')]=_[_0x38a9('0x2f')](_0x30598d['query']);_0x29f4a0['filters']=_[_0x38a9('0x31')](_0x29f4a0[_0x38a9('0x32')],_0x29f4a0['query']);_0x5a26b7[_0x38a9('0x33')]=_[_0x38a9('0x31')](_0x29f4a0[_0x38a9('0x32')],qs['fields'](_0x30598d['query'][_0x38a9('0x34')]));_0x5a26b7[_0x38a9('0x33')]=_0x5a26b7[_0x38a9('0x33')][_0x38a9('0x35')]?_0x5a26b7[_0x38a9('0x33')]:_0x29f4a0[_0x38a9('0x32')];_0x5a26b7[_0x38a9('0x38')]=qs[_0x38a9('0x39')](_0x30598d['query']['sort']);_0x5a26b7[_0x38a9('0x3a')]=qs['filters'](_[_0x38a9('0x3b')](_0x30598d[_0x38a9('0x2e')],_0x29f4a0['filters']));if(_0x30598d[_0x38a9('0x2e')][_0x38a9('0x3c')]){_0x5a26b7['where']=_['merge'](_0x5a26b7['where'],{'$or':_[_0x38a9('0x2a')](_0x5a26b7[_0x38a9('0x33')],function(_0x4befd9){var _0x2d8008={};_0x2d8008[_0x4befd9]={'$like':'%'+_0x30598d[_0x38a9('0x2e')][_0x38a9('0x3c')]+'%'};return _0x2d8008;})});}_0x5a26b7=_[_0x38a9('0x3d')]({},_0x5a26b7,_0x30598d[_0x38a9('0x40')]);return _0x40ade8['getSubjects'](_0x5a26b7);}})[_0x38a9('0x23')](function(_0x2ce29f){if(_0x2ce29f){_0x135722=_0x2ce29f['length'];if(!_0x30598d[_0x38a9('0x2e')][_0x38a9('0x36')](_0x38a9('0x37'))){_0x5a26b7['limit']=qs['limit'](_0x30598d['query'][_0x38a9('0x1c')]);_0x5a26b7[_0x38a9('0x1b')]=qs['offset'](_0x30598d[_0x38a9('0x2e')]['offset']);}return _0x40ade8[_0x38a9('0x4c')](_0x5a26b7);}})[_0x38a9('0x23')](function(_0x1f01f7){if(_0x1f01f7){return _0x1f01f7?{'count':_0x135722,'rows':_0x1f01f7}:null;}})['then'](respondWithResult(_0x19907d,null))[_0x38a9('0x44')](handleError(_0x19907d,null));};exports[_0x38a9('0x4d')]=function(_0x528248,_0x3bd691,_0x509187){var _0x55e197={};var _0x37f36c={};var _0x322366;var _0x5c65ed;return db[_0x38a9('0x46')][_0x38a9('0x4b')]({'where':{'id':_0x528248[_0x38a9('0x45')]['id']}})['then'](handleEntityNotFound(_0x3bd691,null))[_0x38a9('0x23')](function(_0x34bf8c){if(_0x34bf8c){_0x322366=_0x34bf8c;_0x37f36c[_0x38a9('0x32')]=_['keys'](db[_0x38a9('0x4e')][_0x38a9('0x2b')]);_0x37f36c['query']=_[_0x38a9('0x2f')](_0x528248[_0x38a9('0x2e')]);_0x37f36c[_0x38a9('0x30')]=_['intersection'](_0x37f36c[_0x38a9('0x32')],_0x37f36c['query']);_0x55e197['attributes']=_[_0x38a9('0x31')](_0x37f36c['model'],qs[_0x38a9('0x34')](_0x528248[_0x38a9('0x2e')][_0x38a9('0x34')]));_0x55e197[_0x38a9('0x33')]=_0x55e197[_0x38a9('0x33')][_0x38a9('0x35')]?_0x55e197[_0x38a9('0x33')]:_0x37f36c[_0x38a9('0x32')];_0x55e197[_0x38a9('0x38')]=qs[_0x38a9('0x39')](_0x528248[_0x38a9('0x2e')][_0x38a9('0x39')]);_0x55e197[_0x38a9('0x3a')]=qs['filters'](_[_0x38a9('0x3b')](_0x528248[_0x38a9('0x2e')],_0x37f36c[_0x38a9('0x30')]));if(_0x528248[_0x38a9('0x2e')][_0x38a9('0x3c')]){_0x55e197[_0x38a9('0x3a')]=_[_0x38a9('0x3d')](_0x55e197[_0x38a9('0x3a')],{'$or':_[_0x38a9('0x2a')](_0x55e197[_0x38a9('0x33')],function(_0x17e4e8){var _0x2323e8={};_0x2323e8[_0x17e4e8]={'$like':'%'+_0x528248[_0x38a9('0x2e')][_0x38a9('0x3c')]+'%'};return _0x2323e8;})});}_0x55e197=_['merge']({},_0x55e197,_0x528248['options']);return _0x322366[_0x38a9('0x4d')](_0x55e197);}})[_0x38a9('0x23')](function(_0x5529aa){if(_0x5529aa){_0x5c65ed=_0x5529aa[_0x38a9('0x35')];if(!_0x528248['query'][_0x38a9('0x36')](_0x38a9('0x37'))){_0x55e197[_0x38a9('0x1c')]=qs[_0x38a9('0x1c')](_0x528248['query'][_0x38a9('0x1c')]);_0x55e197[_0x38a9('0x1b')]=qs[_0x38a9('0x1b')](_0x528248[_0x38a9('0x2e')][_0x38a9('0x1b')]);}return _0x322366[_0x38a9('0x4d')](_0x55e197);}})[_0x38a9('0x23')](function(_0x2b84eb){if(_0x2b84eb){return _0x2b84eb?{'count':_0x5c65ed,'rows':_0x2b84eb}:null;}})[_0x38a9('0x23')](respondWithResult(_0x3bd691,null))[_0x38a9('0x44')](handleError(_0x3bd691,null));}; \ No newline at end of file +var _0x5d38=['rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','update','find','destroy','getFields','findOne','ZohoField','pick','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','name','send','index','map','ZohoConfiguration'];(function(_0x459a80,_0x3da3dc){var _0x39efad=function(_0x1042f1){while(--_0x1042f1){_0x459a80['push'](_0x459a80['shift']());}};_0x39efad(++_0x3da3dc);}(_0x5d38,0x1a7));var _0x85d3=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5d38[_0x160c73];return _0xd9302;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85d3('0x0'));var jsonpatch=require(_0x85d3('0x1'));var rp=require(_0x85d3('0x2'));var moment=require(_0x85d3('0x3'));var BPromise=require(_0x85d3('0x4'));var Mustache=require(_0x85d3('0x5'));var util=require('util');var path=require(_0x85d3('0x6'));var sox=require(_0x85d3('0x7'));var csv=require(_0x85d3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x85d3('0x9'));var squel=require(_0x85d3('0xa'));var crypto=require('crypto');var jsforce=require(_0x85d3('0xb'));var deskjs=require(_0x85d3('0xc'));var toCsv=require(_0x85d3('0x8'));var querystring=require('querystring');var Papa=require(_0x85d3('0xd'));var Redis=require(_0x85d3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x85d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d3('0x10'))(_0x85d3('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x85d3('0x12'));var db=require(_0x85d3('0x13'))['db'];function respondWithStatusCode(_0x14f3de,_0x40cc91){_0x40cc91=_0x40cc91||0xcc;return function(_0x40126e){if(_0x40126e){return _0x14f3de[_0x85d3('0x14')](_0x40cc91);}return _0x14f3de['status'](_0x40cc91)[_0x85d3('0x15')]();};}function respondWithResult(_0x8a343c,_0x55bafa){_0x55bafa=_0x55bafa||0xc8;return function(_0x4ee068){if(_0x4ee068){return _0x8a343c[_0x85d3('0x16')](_0x55bafa)[_0x85d3('0x17')](_0x4ee068);}};}function respondWithFilteredResult(_0x3c116d,_0xd50cc3){return function(_0x202d7a){if(_0x202d7a){var _0x3f541c=typeof _0xd50cc3[_0x85d3('0x18')]===_0x85d3('0x19')&&typeof _0xd50cc3[_0x85d3('0x1a')]==='undefined';var _0x3f9242=_0x202d7a[_0x85d3('0x1b')];var _0x2ea88c=_0x3f541c?0x0:_0xd50cc3[_0x85d3('0x18')];var _0x304613=_0x3f541c?_0x202d7a[_0x85d3('0x1b')]:_0xd50cc3['offset']+_0xd50cc3[_0x85d3('0x1a')];var _0x9ab1c;if(_0x304613>=_0x3f9242){_0x304613=_0x3f9242;_0x9ab1c=0xc8;}else{_0x9ab1c=0xce;}_0x3c116d[_0x85d3('0x16')](_0x9ab1c);return _0x3c116d[_0x85d3('0x1c')](_0x85d3('0x1d'),_0x2ea88c+'-'+_0x304613+'/'+_0x3f9242)['json'](_0x202d7a);}return null;};}function patchUpdates(_0x1270a7){return function(_0x1b31a1){try{jsonpatch['apply'](_0x1b31a1,_0x1270a7,!![]);}catch(_0xac43c3){return BPromise[_0x85d3('0x1e')](_0xac43c3);}return _0x1b31a1[_0x85d3('0x1f')]();};}function saveUpdates(_0x1a84fe,_0x371d29){return function(_0x51faef){if(_0x51faef){return _0x51faef['update'](_0x1a84fe)[_0x85d3('0x20')](function(_0x24fcce){return _0x24fcce;});}return null;};}function removeEntity(_0x270f53,_0x32bcad){return function(_0x551adb){if(_0x551adb){return _0x551adb['destroy']()['then'](function(){_0x270f53['status'](0xcc)[_0x85d3('0x15')]();});}};}function handleEntityNotFound(_0x4de06f,_0x4a0240){return function(_0x4fdcba){if(!_0x4fdcba){_0x4de06f[_0x85d3('0x14')](0x194);}return _0x4fdcba;};}function handleError(_0x4a1f84,_0x2b63f8){_0x2b63f8=_0x2b63f8||0x1f4;return function(_0x396ba8){logger[_0x85d3('0x21')](_0x396ba8['stack']);if(_0x396ba8[_0x85d3('0x22')]){delete _0x396ba8[_0x85d3('0x22')];}_0x4a1f84['status'](_0x2b63f8)[_0x85d3('0x23')](_0x396ba8);};}exports[_0x85d3('0x24')]=function(_0x129acd,_0x41fc5c){var _0xcb7e8d={},_0x43333a={},_0x4fe099={'count':0x0,'rows':[]};var _0x1268af=_[_0x85d3('0x25')](db[_0x85d3('0x26')][_0x85d3('0x27')],function(_0x2c1727){return{'name':_0x2c1727[_0x85d3('0x28')],'type':_0x2c1727[_0x85d3('0x29')][_0x85d3('0x2a')]};});_0x43333a[_0x85d3('0x2b')]=_[_0x85d3('0x25')](_0x1268af,_0x85d3('0x22'));_0x43333a['query']=_[_0x85d3('0x2c')](_0x129acd[_0x85d3('0x2d')]);_0x43333a['filters']=_[_0x85d3('0x2e')](_0x43333a['model'],_0x43333a[_0x85d3('0x2d')]);_0xcb7e8d['attributes']=_[_0x85d3('0x2e')](_0x43333a['model'],qs[_0x85d3('0x2f')](_0x129acd['query'][_0x85d3('0x2f')]));_0xcb7e8d[_0x85d3('0x30')]=_0xcb7e8d[_0x85d3('0x30')][_0x85d3('0x31')]?_0xcb7e8d[_0x85d3('0x30')]:_0x43333a[_0x85d3('0x2b')];if(!_0x129acd[_0x85d3('0x2d')][_0x85d3('0x32')](_0x85d3('0x33'))){_0xcb7e8d['limit']=qs[_0x85d3('0x1a')](_0x129acd[_0x85d3('0x2d')][_0x85d3('0x1a')]);_0xcb7e8d[_0x85d3('0x18')]=qs['offset'](_0x129acd[_0x85d3('0x2d')]['offset']);}_0xcb7e8d[_0x85d3('0x34')]=qs[_0x85d3('0x35')](_0x129acd[_0x85d3('0x2d')][_0x85d3('0x35')]);_0xcb7e8d[_0x85d3('0x36')]=qs['filters'](_['pick'](_0x129acd[_0x85d3('0x2d')],_0x43333a[_0x85d3('0x37')]),_0x1268af);if(_0x129acd['query'][_0x85d3('0x38')]){_0xcb7e8d[_0x85d3('0x36')]=_['merge'](_0xcb7e8d['where'],{'$or':_[_0x85d3('0x25')](_0x1268af,function(_0xa806ea){if(_0xa806ea[_0x85d3('0x29')]!==_0x85d3('0x39')){var _0x23a1d2={};_0x23a1d2[_0xa806ea[_0x85d3('0x22')]]={'$like':'%'+_0x129acd['query'][_0x85d3('0x38')]+'%'};return _0x23a1d2;}})});}_0xcb7e8d=_[_0x85d3('0x3a')]({},_0xcb7e8d,_0x129acd[_0x85d3('0x3b')]);var _0x5ead75={'where':_0xcb7e8d[_0x85d3('0x36')]};return db[_0x85d3('0x26')][_0x85d3('0x1b')](_0x5ead75)['then'](function(_0x5ab136){_0x4fe099[_0x85d3('0x1b')]=_0x5ab136;if(_0x129acd[_0x85d3('0x2d')][_0x85d3('0x3c')]){_0xcb7e8d[_0x85d3('0x3d')]=[{'all':!![]}];}return db[_0x85d3('0x26')]['findAll'](_0xcb7e8d);})['then'](function(_0x182834){_0x4fe099[_0x85d3('0x3e')]=_0x182834;return _0x4fe099;})[_0x85d3('0x20')](respondWithFilteredResult(_0x41fc5c,_0xcb7e8d))[_0x85d3('0x3f')](handleError(_0x41fc5c,null));};exports[_0x85d3('0x40')]=function(_0x5ab301,_0x5c0ffd){var _0x19e9de={'raw':![],'where':{'id':_0x5ab301[_0x85d3('0x41')]['id']}},_0x3cddbb={};_0x3cddbb['model']=_[_0x85d3('0x2c')](db['ZohoConfiguration'][_0x85d3('0x27')]);_0x3cddbb[_0x85d3('0x2d')]=_[_0x85d3('0x2c')](_0x5ab301['query']);_0x3cddbb[_0x85d3('0x37')]=_['intersection'](_0x3cddbb[_0x85d3('0x2b')],_0x3cddbb['query']);_0x19e9de[_0x85d3('0x30')]=_[_0x85d3('0x2e')](_0x3cddbb[_0x85d3('0x2b')],qs[_0x85d3('0x2f')](_0x5ab301[_0x85d3('0x2d')][_0x85d3('0x2f')]));_0x19e9de['attributes']=_0x19e9de[_0x85d3('0x30')][_0x85d3('0x31')]?_0x19e9de['attributes']:_0x3cddbb[_0x85d3('0x2b')];if(_0x5ab301['query'][_0x85d3('0x3c')]){_0x19e9de[_0x85d3('0x3d')]=[{'all':!![]}];}_0x19e9de=_[_0x85d3('0x3a')]({},_0x19e9de,_0x5ab301[_0x85d3('0x3b')]);return db[_0x85d3('0x26')]['find'](_0x19e9de)[_0x85d3('0x20')](handleEntityNotFound(_0x5c0ffd,null))[_0x85d3('0x20')](respondWithResult(_0x5c0ffd,null))[_0x85d3('0x3f')](handleError(_0x5c0ffd,null));};exports[_0x85d3('0x42')]=function(_0x3440d3,_0x42872c){return db['ZohoConfiguration'][_0x85d3('0x42')](_0x3440d3[_0x85d3('0x43')],{})[_0x85d3('0x20')](respondWithResult(_0x42872c,0xc9))[_0x85d3('0x3f')](handleError(_0x42872c,null));};exports[_0x85d3('0x44')]=function(_0x2745bb,_0x575dce){if(_0x2745bb[_0x85d3('0x43')]['id']){delete _0x2745bb[_0x85d3('0x43')]['id'];}return db[_0x85d3('0x26')][_0x85d3('0x45')]({'where':{'id':_0x2745bb[_0x85d3('0x41')]['id']}})[_0x85d3('0x20')](handleEntityNotFound(_0x575dce,null))[_0x85d3('0x20')](saveUpdates(_0x2745bb[_0x85d3('0x43')],null))[_0x85d3('0x20')](respondWithResult(_0x575dce,null))[_0x85d3('0x3f')](handleError(_0x575dce,null));};exports[_0x85d3('0x46')]=function(_0x1fc2e2,_0x31bd36){return db['ZohoConfiguration'][_0x85d3('0x45')]({'where':{'id':_0x1fc2e2['params']['id']}})[_0x85d3('0x20')](handleEntityNotFound(_0x31bd36,null))[_0x85d3('0x20')](removeEntity(_0x31bd36,null))[_0x85d3('0x3f')](handleError(_0x31bd36,null));};exports[_0x85d3('0x47')]=function(_0x3cb484,_0x11400c,_0x204a76){var _0x253683={};var _0x4111fd={};var _0x4016ac;var _0x107d88;return db[_0x85d3('0x26')][_0x85d3('0x48')]({'where':{'id':_0x3cb484[_0x85d3('0x41')]['id']}})[_0x85d3('0x20')](handleEntityNotFound(_0x11400c,null))[_0x85d3('0x20')](function(_0x57fdfc){if(_0x57fdfc){_0x4016ac=_0x57fdfc;_0x4111fd[_0x85d3('0x2b')]=_['keys'](db[_0x85d3('0x49')][_0x85d3('0x27')]);_0x4111fd[_0x85d3('0x2d')]=_[_0x85d3('0x2c')](_0x3cb484['query']);_0x4111fd['filters']=_[_0x85d3('0x2e')](_0x4111fd[_0x85d3('0x2b')],_0x4111fd['query']);_0x253683[_0x85d3('0x30')]=_[_0x85d3('0x2e')](_0x4111fd[_0x85d3('0x2b')],qs[_0x85d3('0x2f')](_0x3cb484[_0x85d3('0x2d')][_0x85d3('0x2f')]));_0x253683[_0x85d3('0x30')]=_0x253683['attributes'][_0x85d3('0x31')]?_0x253683[_0x85d3('0x30')]:_0x4111fd[_0x85d3('0x2b')];_0x253683[_0x85d3('0x34')]=qs['sort'](_0x3cb484[_0x85d3('0x2d')][_0x85d3('0x35')]);_0x253683[_0x85d3('0x36')]=qs[_0x85d3('0x37')](_[_0x85d3('0x4a')](_0x3cb484[_0x85d3('0x2d')],_0x4111fd[_0x85d3('0x37')]));if(_0x3cb484[_0x85d3('0x2d')]['filter']){_0x253683[_0x85d3('0x36')]=_[_0x85d3('0x3a')](_0x253683['where'],{'$or':_[_0x85d3('0x25')](_0x253683['attributes'],function(_0x51a49b){var _0x427bf2={};_0x427bf2[_0x51a49b]={'$like':'%'+_0x3cb484[_0x85d3('0x2d')]['filter']+'%'};return _0x427bf2;})});}_0x253683=_[_0x85d3('0x3a')]({},_0x253683,_0x3cb484['options']);return _0x4016ac['getFields'](_0x253683);}})[_0x85d3('0x20')](function(_0x24981e){if(_0x24981e){_0x107d88=_0x24981e[_0x85d3('0x31')];if(!_0x3cb484[_0x85d3('0x2d')][_0x85d3('0x32')](_0x85d3('0x33'))){_0x253683[_0x85d3('0x1a')]=qs[_0x85d3('0x1a')](_0x3cb484[_0x85d3('0x2d')]['limit']);_0x253683[_0x85d3('0x18')]=qs['offset'](_0x3cb484[_0x85d3('0x2d')][_0x85d3('0x18')]);}return _0x4016ac['getFields'](_0x253683);}})['then'](function(_0x50080a){if(_0x50080a){return _0x50080a?{'count':_0x107d88,'rows':_0x50080a}:null;}})[_0x85d3('0x20')](respondWithResult(_0x11400c,null))[_0x85d3('0x3f')](handleError(_0x11400c,null));};exports[_0x85d3('0x4b')]=function(_0x5266da,_0x55fd73,_0x38cbb4){var _0x104e91={};var _0x19329a={};var _0x5a8114;var _0x128f08;return db[_0x85d3('0x26')][_0x85d3('0x48')]({'where':{'id':_0x5266da[_0x85d3('0x41')]['id']}})[_0x85d3('0x20')](handleEntityNotFound(_0x55fd73,null))[_0x85d3('0x20')](function(_0x30a578){if(_0x30a578){_0x5a8114=_0x30a578;_0x19329a[_0x85d3('0x2b')]=_['keys'](db[_0x85d3('0x49')][_0x85d3('0x27')]);_0x19329a['query']=_[_0x85d3('0x2c')](_0x5266da[_0x85d3('0x2d')]);_0x19329a[_0x85d3('0x37')]=_[_0x85d3('0x2e')](_0x19329a['model'],_0x19329a[_0x85d3('0x2d')]);_0x104e91[_0x85d3('0x30')]=_[_0x85d3('0x2e')](_0x19329a['model'],qs[_0x85d3('0x2f')](_0x5266da[_0x85d3('0x2d')]['fields']));_0x104e91[_0x85d3('0x30')]=_0x104e91['attributes'][_0x85d3('0x31')]?_0x104e91['attributes']:_0x19329a[_0x85d3('0x2b')];_0x104e91['order']=qs['sort'](_0x5266da[_0x85d3('0x2d')][_0x85d3('0x35')]);_0x104e91['where']=qs[_0x85d3('0x37')](_[_0x85d3('0x4a')](_0x5266da[_0x85d3('0x2d')],_0x19329a[_0x85d3('0x37')]));if(_0x5266da['query'][_0x85d3('0x38')]){_0x104e91[_0x85d3('0x36')]=_[_0x85d3('0x3a')](_0x104e91[_0x85d3('0x36')],{'$or':_['map'](_0x104e91[_0x85d3('0x30')],function(_0x30ebbc){var _0x1b5df8={};_0x1b5df8[_0x30ebbc]={'$like':'%'+_0x5266da[_0x85d3('0x2d')]['filter']+'%'};return _0x1b5df8;})});}_0x104e91=_[_0x85d3('0x3a')]({},_0x104e91,_0x5266da[_0x85d3('0x3b')]);return _0x5a8114[_0x85d3('0x4b')](_0x104e91);}})[_0x85d3('0x20')](function(_0x5d9133){if(_0x5d9133){_0x128f08=_0x5d9133[_0x85d3('0x31')];if(!_0x5266da['query'][_0x85d3('0x32')]('nolimit')){_0x104e91[_0x85d3('0x1a')]=qs[_0x85d3('0x1a')](_0x5266da['query'][_0x85d3('0x1a')]);_0x104e91[_0x85d3('0x18')]=qs[_0x85d3('0x18')](_0x5266da['query']['offset']);}return _0x5a8114[_0x85d3('0x4b')](_0x104e91);}})[_0x85d3('0x20')](function(_0x473450){if(_0x473450){return _0x473450?{'count':_0x128f08,'rows':_0x473450}:null;}})[_0x85d3('0x20')](respondWithResult(_0x55fd73,null))['catch'](handleError(_0x55fd73,null));};exports[_0x85d3('0x4c')]=function(_0xecbb15,_0x53935d,_0x370b9d){var _0xce5ffc={};var _0x1d4e21={};var _0x35a81b;var _0x51dcc6;return db[_0x85d3('0x26')]['findOne']({'where':{'id':_0xecbb15[_0x85d3('0x41')]['id']}})[_0x85d3('0x20')](handleEntityNotFound(_0x53935d,null))[_0x85d3('0x20')](function(_0x1154f1){if(_0x1154f1){_0x35a81b=_0x1154f1;_0x1d4e21[_0x85d3('0x2b')]=_['keys'](db[_0x85d3('0x49')]['rawAttributes']);_0x1d4e21['query']=_[_0x85d3('0x2c')](_0xecbb15['query']);_0x1d4e21[_0x85d3('0x37')]=_[_0x85d3('0x2e')](_0x1d4e21[_0x85d3('0x2b')],_0x1d4e21[_0x85d3('0x2d')]);_0xce5ffc[_0x85d3('0x30')]=_[_0x85d3('0x2e')](_0x1d4e21[_0x85d3('0x2b')],qs['fields'](_0xecbb15[_0x85d3('0x2d')][_0x85d3('0x2f')]));_0xce5ffc[_0x85d3('0x30')]=_0xce5ffc[_0x85d3('0x30')]['length']?_0xce5ffc[_0x85d3('0x30')]:_0x1d4e21[_0x85d3('0x2b')];_0xce5ffc[_0x85d3('0x34')]=qs[_0x85d3('0x35')](_0xecbb15[_0x85d3('0x2d')][_0x85d3('0x35')]);_0xce5ffc[_0x85d3('0x36')]=qs['filters'](_[_0x85d3('0x4a')](_0xecbb15[_0x85d3('0x2d')],_0x1d4e21['filters']));if(_0xecbb15[_0x85d3('0x2d')][_0x85d3('0x38')]){_0xce5ffc[_0x85d3('0x36')]=_[_0x85d3('0x3a')](_0xce5ffc['where'],{'$or':_[_0x85d3('0x25')](_0xce5ffc['attributes'],function(_0x3201a7){var _0x2de4c6={};_0x2de4c6[_0x3201a7]={'$like':'%'+_0xecbb15[_0x85d3('0x2d')][_0x85d3('0x38')]+'%'};return _0x2de4c6;})});}_0xce5ffc=_[_0x85d3('0x3a')]({},_0xce5ffc,_0xecbb15[_0x85d3('0x3b')]);return _0x35a81b[_0x85d3('0x4c')](_0xce5ffc);}})[_0x85d3('0x20')](function(_0x22a93a){if(_0x22a93a){_0x51dcc6=_0x22a93a['length'];if(!_0xecbb15[_0x85d3('0x2d')]['hasOwnProperty']('nolimit')){_0xce5ffc[_0x85d3('0x1a')]=qs[_0x85d3('0x1a')](_0xecbb15['query'][_0x85d3('0x1a')]);_0xce5ffc[_0x85d3('0x18')]=qs[_0x85d3('0x18')](_0xecbb15[_0x85d3('0x2d')][_0x85d3('0x18')]);}return _0x35a81b[_0x85d3('0x4c')](_0xce5ffc);}})[_0x85d3('0x20')](function(_0x498fa0){if(_0x498fa0){return _0x498fa0?{'count':_0x51dcc6,'rows':_0x498fa0}:null;}})[_0x85d3('0x20')](respondWithResult(_0x53935d,null))[_0x85d3('0x3f')](handleError(_0x53935d,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 02330ca..b92d90e 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 _0x595c=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x641afe,_0x22d726){var _0x2dfe9a=function(_0x33a370){while(--_0x33a370){_0x641afe['push'](_0x641afe['shift']());}};_0x2dfe9a(++_0x22d726);}(_0x595c,0xeb));var _0xc595=function(_0x37dd96,_0x3544fa){_0x37dd96=_0x37dd96-0x0;var _0x524727=_0x595c[_0x37dd96];return _0x524727;};'use strict';var _=require(_0xc595('0x0'));var util=require(_0xc595('0x1'));var logger=require(_0xc595('0x2'))(_0xc595('0x3'));var moment=require(_0xc595('0x4'));var BPromise=require(_0xc595('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc595('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc595('0x7'));module[_0xc595('0x8')]=function(_0x3a12e3,_0x23fac9){return _0x3a12e3[_0xc595('0x9')](_0xc595('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x749a=['request-promise','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','lodash','api','bluebird'];(function(_0x4f1b4a,_0x5a2de1){var _0x25f268=function(_0x7a9cd5){while(--_0x7a9cd5){_0x4f1b4a['push'](_0x4f1b4a['shift']());}};_0x25f268(++_0x5a2de1);}(_0x749a,0x153));var _0xa749=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x749a[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xa749('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa749('0x1'));var moment=require('moment');var BPromise=require(_0xa749('0x2'));var rp=require(_0xa749('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa749('0x4'));var attributes=require(_0xa749('0x5'));module['exports']=function(_0x5b7473,_0x3a1cad){return _0x5b7473[_0xa749('0x6')](_0xa749('0x7'),attributes,{'tableName':_0xa749('0x8'),'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 bfbe1a0..c90c16d 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 _0x6d52=['http','request','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x2b910f,_0x24d2d1){var _0x8818e3=function(_0x23126f){while(--_0x23126f){_0x2b910f['push'](_0x2b910f['shift']());}};_0x8818e3(++_0x24d2d1);}(_0x6d52,0x8b));var _0x26d5=function(_0x3344fc,_0x9a268e){_0x3344fc=_0x3344fc-0x0;var _0x4b83cf=_0x6d52[_0x3344fc];return _0x4b83cf;};'use strict';var _=require('lodash');var util=require(_0x26d5('0x0'));var moment=require(_0x26d5('0x1'));var BPromise=require('bluebird');var rs=require(_0x26d5('0x2'));var fs=require('fs');var Redis=require(_0x26d5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x26d5('0x4'));var logger=require('../../config/logger')(_0x26d5('0x5'));var config=require('../../config/environment');var jayson=require(_0x26d5('0x6'));var client=jayson[_0x26d5('0x7')][_0x26d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3336c5,_0x403bcc,_0x33830a){return new BPromise(function(_0x222a56,_0x5de63a){return client[_0x26d5('0x9')](_0x3336c5,_0x33830a)['then'](function(_0x8b11fb){logger[_0x26d5('0xa')](_0x26d5('0xb'),_0x403bcc,'request\x20sent');logger[_0x26d5('0xc')](_0x26d5('0xd'),_0x403bcc,'request\x20sent',JSON[_0x26d5('0xe')](_0x8b11fb));if(_0x8b11fb[_0x26d5('0xf')]){if(_0x8b11fb['error'][_0x26d5('0x10')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x403bcc,_0x8b11fb[_0x26d5('0xf')][_0x26d5('0x11')]);return _0x5de63a(_0x8b11fb['error'][_0x26d5('0x11')]);}logger['error'](_0x26d5('0xb'),_0x403bcc,_0x8b11fb[_0x26d5('0xf')][_0x26d5('0x11')]);return _0x222a56(_0x8b11fb['error']['message']);}else{logger[_0x26d5('0xa')](_0x26d5('0xb'),_0x403bcc,_0x26d5('0x12'));_0x222a56(_0x8b11fb[_0x26d5('0x13')][_0x26d5('0x11')]);}})[_0x26d5('0x14')](function(_0x4d0626){logger['error'](_0x26d5('0xb'),_0x403bcc,_0x4d0626);_0x5de63a(_0x4d0626);});});} \ No newline at end of file +var _0xe2eb=['error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe2eb,0x101));var _0xbe2e=function(_0x481924,_0x3bc2c8){_0x481924=_0x481924-0x0;var _0x88aba7=_0xe2eb[_0x481924];return _0x88aba7;};'use strict';var _=require('lodash');var util=require(_0xbe2e('0x0'));var moment=require(_0xbe2e('0x1'));var BPromise=require(_0xbe2e('0x2'));var rs=require(_0xbe2e('0x3'));var fs=require('fs');var Redis=require(_0xbe2e('0x4'));var db=require(_0xbe2e('0x5'))['db'];var utils=require(_0xbe2e('0x6'));var logger=require(_0xbe2e('0x7'))(_0xbe2e('0x8'));var config=require(_0xbe2e('0x9'));var jayson=require(_0xbe2e('0xa'));var client=jayson[_0xbe2e('0xb')][_0xbe2e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1eee4e,_0x4d885d,_0x384389){return new BPromise(function(_0x5990df,_0x36943b){return client['request'](_0x1eee4e,_0x384389)[_0xbe2e('0xd')](function(_0x285f41){logger[_0xbe2e('0xe')](_0xbe2e('0xf'),_0x4d885d,_0xbe2e('0x10'));logger[_0xbe2e('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4d885d,_0xbe2e('0x10'),JSON[_0xbe2e('0x12')](_0x285f41));if(_0x285f41['error']){if(_0x285f41['error']['code']===0x1f4){logger[_0xbe2e('0x13')](_0xbe2e('0xf'),_0x4d885d,_0x285f41[_0xbe2e('0x13')]['message']);return _0x36943b(_0x285f41[_0xbe2e('0x13')]['message']);}logger[_0xbe2e('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x4d885d,_0x285f41[_0xbe2e('0x13')][_0xbe2e('0x14')]);return _0x5990df(_0x285f41[_0xbe2e('0x13')][_0xbe2e('0x14')]);}else{logger[_0xbe2e('0xe')](_0xbe2e('0xf'),_0x4d885d,_0xbe2e('0x10'));_0x5990df(_0x285f41[_0xbe2e('0x15')][_0xbe2e('0x14')]);}})[_0xbe2e('0x16')](function(_0x34b251){logger[_0xbe2e('0x13')](_0xbe2e('0xf'),_0x4d885d,_0x34b251);_0x36943b(_0x34b251);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 2bf3825..7cb5b91 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 _0x6b0d=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2fb784,_0x2e4ae0){var _0x266853=function(_0x5e3e51){while(--_0x5e3e51){_0x2fb784['push'](_0x2fb784['shift']());}};_0x266853(++_0x2e4ae0);}(_0x6b0d,0x13f));var _0xd6b0=function(_0x1f8ab4,_0x25cfd0){_0x1f8ab4=_0x1f8ab4-0x0;var _0x41e921=_0x6b0d[_0x1f8ab4];return _0x41e921;};'use strict';var multer=require(_0xd6b0('0x0'));var util=require('util');var path=require(_0xd6b0('0x1'));var timeout=require(_0xd6b0('0x2'));var express=require(_0xd6b0('0x3'));var router=express[_0xd6b0('0x4')]();var fs_extra=require(_0xd6b0('0x5'));var auth=require(_0xd6b0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd6b0('0x7'));var controller=require(_0xd6b0('0x8'));router[_0xd6b0('0x9')]('/',auth[_0xd6b0('0xa')](),controller[_0xd6b0('0xb')]);router['get'](_0xd6b0('0xc'),auth[_0xd6b0('0xa')](),controller['show']);router[_0xd6b0('0xd')]('/',auth[_0xd6b0('0xa')](),controller[_0xd6b0('0xe')]);router['put'](_0xd6b0('0xc'),auth[_0xd6b0('0xa')](),controller['update']);router['delete'](_0xd6b0('0xc'),auth[_0xd6b0('0xa')](),controller[_0xd6b0('0xf')]);module[_0xd6b0('0x10')]=router; \ No newline at end of file +var _0x11fc=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x11fc,0x1db));var _0xc11f=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x11fc[_0x1035c1];return _0x308d67;};'use strict';var multer=require('multer');var util=require(_0xc11f('0x0'));var path=require(_0xc11f('0x1'));var timeout=require(_0xc11f('0x2'));var express=require(_0xc11f('0x3'));var router=express['Router']();var fs_extra=require(_0xc11f('0x4'));var auth=require(_0xc11f('0x5'));var interaction=require(_0xc11f('0x6'));var config=require(_0xc11f('0x7'));var controller=require(_0xc11f('0x8'));router[_0xc11f('0x9')]('/',auth[_0xc11f('0xa')](),controller[_0xc11f('0xb')]);router[_0xc11f('0x9')](_0xc11f('0xc'),auth[_0xc11f('0xa')](),controller[_0xc11f('0xd')]);router[_0xc11f('0xe')]('/',auth[_0xc11f('0xa')](),controller['create']);router['put'](_0xc11f('0xc'),auth[_0xc11f('0xa')](),controller[_0xc11f('0xf')]);router[_0xc11f('0x10')](_0xc11f('0xc'),auth[_0xc11f('0xa')](),controller[_0xc11f('0x11')]);module[_0xc11f('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 2302094..91e44bc 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 _0x6f7d=['keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x11aee5,_0x27fa94){var _0x2e8c9d=function(_0x33ff83){while(--_0x33ff83){_0x11aee5['push'](_0x11aee5['shift']());}};_0x2e8c9d(++_0x27fa94);}(_0x6f7d,0xeb));var _0xd6f7=function(_0x49891e,_0x3feb8b){_0x49891e=_0x49891e-0x0;var _0x13a067=_0x6f7d[_0x49891e];return _0x13a067;};'use strict';var Sequelize=require(_0xd6f7('0x0'));module[_0xd6f7('0x1')]={'type':{'type':Sequelize[_0xd6f7('0x2')](_0xd6f7('0x3'),'variable',_0xd6f7('0x4'),_0xd6f7('0x5'),_0xd6f7('0x6')),'defaultValue':_0xd6f7('0x3')},'content':{'type':Sequelize[_0xd6f7('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xd6f7('0x3'),_0xd6f7('0x8'),_0xd6f7('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd6f7('0x7')]},'customField':{'type':Sequelize[_0xd6f7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd6f7('0x7')]}}; \ No newline at end of file +var _0x7c0d=['string','STRING','variable','customVariable','BOOLEAN','exports','ENUM','keyValue','picklist'];(function(_0x27a0d9,_0x60da97){var _0x540904=function(_0x39a11f){while(--_0x39a11f){_0x27a0d9['push'](_0x27a0d9['shift']());}};_0x540904(++_0x60da97);}(_0x7c0d,0x9e));var _0xd7c0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7c0d[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0xd7c0('0x0')]={'type':{'type':Sequelize[_0xd7c0('0x1')]('string','variable','customVariable',_0xd7c0('0x2'),_0xd7c0('0x3')),'defaultValue':_0xd7c0('0x4')},'content':{'type':Sequelize[_0xd7c0('0x5')]},'key':{'type':Sequelize[_0xd7c0('0x5')]},'keyType':{'type':Sequelize[_0xd7c0('0x1')](_0xd7c0('0x4'),_0xd7c0('0x6'),_0xd7c0('0x7'))},'keyContent':{'type':Sequelize[_0xd7c0('0x5')]},'idField':{'type':Sequelize[_0xd7c0('0x5')]},'nameField':{'type':Sequelize[_0xd7c0('0x5')]},'customField':{'type':Sequelize[_0xd7c0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd7c0('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index a7c95a7..64ba64f 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 _0x6ae6=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','type','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x563b40,_0x3b1cba){var _0x5b6af1=function(_0x3bb82f){while(--_0x3bb82f){_0x563b40['push'](_0x563b40['shift']());}};_0x5b6af1(++_0x3b1cba);}(_0x6ae6,0x15c));var _0x66ae=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x6ae6[_0x43b08];return _0x5e05f4;};'use strict';var emlformat=require(_0x66ae('0x0'));var rimraf=require(_0x66ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66ae('0x2'));var rp=require(_0x66ae('0x3'));var moment=require(_0x66ae('0x4'));var BPromise=require(_0x66ae('0x5'));var Mustache=require('mustache');var util=require(_0x66ae('0x6'));var path=require('path');var sox=require(_0x66ae('0x7'));var csv=require(_0x66ae('0x8'));var ejs=require(_0x66ae('0x9'));var fs=require('fs');var fs_extra=require(_0x66ae('0xa'));var _=require('lodash');var squel=require(_0x66ae('0xb'));var crypto=require(_0x66ae('0xc'));var jsforce=require(_0x66ae('0xd'));var deskjs=require(_0x66ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0x66ae('0xf'));var Papa=require(_0x66ae('0x10'));var Redis=require(_0x66ae('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x66ae('0x12'));var hardwareService=require(_0x66ae('0x13'));var logger=require(_0x66ae('0x14'))(_0x66ae('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x66ae('0x16'))['db'];function respondWithStatusCode(_0x4d6b7c,_0x1341b9){_0x1341b9=_0x1341b9||0xcc;return function(_0x255fe0){if(_0x255fe0){return _0x4d6b7c['sendStatus'](_0x1341b9);}return _0x4d6b7c[_0x66ae('0x17')](_0x1341b9)[_0x66ae('0x18')]();};}function respondWithResult(_0x5bfc30,_0x141301){_0x141301=_0x141301||0xc8;return function(_0x443390){if(_0x443390){return _0x5bfc30[_0x66ae('0x17')](_0x141301)[_0x66ae('0x19')](_0x443390);}};}function respondWithFilteredResult(_0x7844f8,_0x21b13c){return function(_0xa9f274){if(_0xa9f274){var _0x280d32=typeof _0x21b13c[_0x66ae('0x1a')]==='undefined'&&typeof _0x21b13c['limit']===_0x66ae('0x1b');var _0x3d4f2e=_0xa9f274[_0x66ae('0x1c')];var _0x560edc=_0x280d32?0x0:_0x21b13c[_0x66ae('0x1a')];var _0x90fdb4=_0x280d32?_0xa9f274[_0x66ae('0x1c')]:_0x21b13c[_0x66ae('0x1a')]+_0x21b13c[_0x66ae('0x1d')];var _0x334090;if(_0x90fdb4>=_0x3d4f2e){_0x90fdb4=_0x3d4f2e;_0x334090=0xc8;}else{_0x334090=0xce;}_0x7844f8[_0x66ae('0x17')](_0x334090);return _0x7844f8[_0x66ae('0x1e')](_0x66ae('0x1f'),_0x560edc+'-'+_0x90fdb4+'/'+_0x3d4f2e)[_0x66ae('0x19')](_0xa9f274);}return null;};}function patchUpdates(_0xd5663a){return function(_0xd5b1e2){try{jsonpatch[_0x66ae('0x20')](_0xd5b1e2,_0xd5663a,!![]);}catch(_0x3ce534){return BPromise[_0x66ae('0x21')](_0x3ce534);}return _0xd5b1e2[_0x66ae('0x22')]();};}function saveUpdates(_0x361386,_0x28de72){return function(_0x257175){if(_0x257175){return _0x257175[_0x66ae('0x23')](_0x361386)['then'](function(_0x75402c){return _0x75402c;});}return null;};}function removeEntity(_0x45929b,_0x123d93){return function(_0x5c69c5){if(_0x5c69c5){return _0x5c69c5[_0x66ae('0x24')]()[_0x66ae('0x25')](function(){_0x45929b[_0x66ae('0x17')](0xcc)[_0x66ae('0x18')]();});}};}function handleEntityNotFound(_0x22870a,_0x3a3042){return function(_0x41a4cc){if(!_0x41a4cc){_0x22870a[_0x66ae('0x26')](0x194);}return _0x41a4cc;};}function handleError(_0x32e3c9,_0x6bf8b6){_0x6bf8b6=_0x6bf8b6||0x1f4;return function(_0x3145c8){logger['error'](_0x3145c8[_0x66ae('0x27')]);if(_0x3145c8['name']){delete _0x3145c8[_0x66ae('0x28')];}_0x32e3c9[_0x66ae('0x17')](_0x6bf8b6)[_0x66ae('0x29')](_0x3145c8);};}exports[_0x66ae('0x2a')]=function(_0xcd9efb,_0x56fa80){var _0x3eedcc={},_0x192f05={},_0x2f734b={'count':0x0,'rows':[]};var _0x190e7b=_[_0x66ae('0x2b')](db['ZohoField'][_0x66ae('0x2c')],function(_0x401772){return{'name':_0x401772[_0x66ae('0x2d')],'type':_0x401772['type']['key']};});_0x192f05[_0x66ae('0x2e')]=_[_0x66ae('0x2b')](_0x190e7b,'name');_0x192f05['query']=_[_0x66ae('0x2f')](_0xcd9efb[_0x66ae('0x30')]);_0x192f05[_0x66ae('0x31')]=_[_0x66ae('0x32')](_0x192f05[_0x66ae('0x2e')],_0x192f05['query']);_0x3eedcc[_0x66ae('0x33')]=_['intersection'](_0x192f05['model'],qs[_0x66ae('0x34')](_0xcd9efb['query'][_0x66ae('0x34')]));_0x3eedcc[_0x66ae('0x33')]=_0x3eedcc[_0x66ae('0x33')][_0x66ae('0x35')]?_0x3eedcc[_0x66ae('0x33')]:_0x192f05[_0x66ae('0x2e')];if(!_0xcd9efb[_0x66ae('0x30')]['hasOwnProperty'](_0x66ae('0x36'))){_0x3eedcc[_0x66ae('0x1d')]=qs[_0x66ae('0x1d')](_0xcd9efb[_0x66ae('0x30')][_0x66ae('0x1d')]);_0x3eedcc[_0x66ae('0x1a')]=qs[_0x66ae('0x1a')](_0xcd9efb[_0x66ae('0x30')][_0x66ae('0x1a')]);}_0x3eedcc[_0x66ae('0x37')]=qs['sort'](_0xcd9efb['query']['sort']);_0x3eedcc[_0x66ae('0x38')]=qs[_0x66ae('0x31')](_[_0x66ae('0x39')](_0xcd9efb['query'],_0x192f05[_0x66ae('0x31')]),_0x190e7b);if(_0xcd9efb['query'][_0x66ae('0x3a')]){_0x3eedcc[_0x66ae('0x38')]=_[_0x66ae('0x3b')](_0x3eedcc[_0x66ae('0x38')],{'$or':_[_0x66ae('0x2b')](_0x190e7b,function(_0x26bc93){if(_0x26bc93[_0x66ae('0x3c')]!=='VIRTUAL'){var _0x425a13={};_0x425a13[_0x26bc93[_0x66ae('0x28')]]={'$like':'%'+_0xcd9efb[_0x66ae('0x30')][_0x66ae('0x3a')]+'%'};return _0x425a13;}})});}_0x3eedcc=_[_0x66ae('0x3b')]({},_0x3eedcc,_0xcd9efb[_0x66ae('0x3d')]);var _0x20253d={'where':_0x3eedcc[_0x66ae('0x38')]};return db[_0x66ae('0x3e')][_0x66ae('0x1c')](_0x20253d)['then'](function(_0x51fd24){_0x2f734b[_0x66ae('0x1c')]=_0x51fd24;if(_0xcd9efb[_0x66ae('0x30')][_0x66ae('0x3f')]){_0x3eedcc[_0x66ae('0x40')]=[{'all':!![]}];}return db[_0x66ae('0x3e')][_0x66ae('0x41')](_0x3eedcc);})[_0x66ae('0x25')](function(_0x40f0cb){_0x2f734b[_0x66ae('0x42')]=_0x40f0cb;return _0x2f734b;})[_0x66ae('0x25')](respondWithFilteredResult(_0x56fa80,_0x3eedcc))[_0x66ae('0x43')](handleError(_0x56fa80,null));};exports[_0x66ae('0x44')]=function(_0x286efd,_0x29ae85){var _0x310ffe={'raw':!![],'where':{'id':_0x286efd[_0x66ae('0x45')]['id']}},_0x355380={};_0x355380[_0x66ae('0x2e')]=_['keys'](db['ZohoField'][_0x66ae('0x2c')]);_0x355380['query']=_[_0x66ae('0x2f')](_0x286efd[_0x66ae('0x30')]);_0x355380[_0x66ae('0x31')]=_[_0x66ae('0x32')](_0x355380[_0x66ae('0x2e')],_0x355380[_0x66ae('0x30')]);_0x310ffe[_0x66ae('0x33')]=_['intersection'](_0x355380['model'],qs[_0x66ae('0x34')](_0x286efd[_0x66ae('0x30')]['fields']));_0x310ffe[_0x66ae('0x33')]=_0x310ffe[_0x66ae('0x33')]['length']?_0x310ffe['attributes']:_0x355380[_0x66ae('0x2e')];if(_0x286efd[_0x66ae('0x30')][_0x66ae('0x3f')]){_0x310ffe[_0x66ae('0x40')]=[{'all':!![]}];}_0x310ffe=_[_0x66ae('0x3b')]({},_0x310ffe,_0x286efd[_0x66ae('0x3d')]);return db[_0x66ae('0x3e')][_0x66ae('0x46')](_0x310ffe)[_0x66ae('0x25')](handleEntityNotFound(_0x29ae85,null))['then'](respondWithResult(_0x29ae85,null))[_0x66ae('0x43')](handleError(_0x29ae85,null));};exports[_0x66ae('0x47')]=function(_0x2b4a5a,_0x125403){return db[_0x66ae('0x3e')]['create'](_0x2b4a5a[_0x66ae('0x48')],{})[_0x66ae('0x25')](respondWithResult(_0x125403,0xc9))[_0x66ae('0x43')](handleError(_0x125403,null));};exports['update']=function(_0x3e8fef,_0x255d4b){if(_0x3e8fef[_0x66ae('0x48')]['id']){delete _0x3e8fef['body']['id'];}return db[_0x66ae('0x3e')][_0x66ae('0x46')]({'where':{'id':_0x3e8fef[_0x66ae('0x45')]['id']}})[_0x66ae('0x25')](handleEntityNotFound(_0x255d4b,null))['then'](saveUpdates(_0x3e8fef[_0x66ae('0x48')],null))[_0x66ae('0x25')](respondWithResult(_0x255d4b,null))[_0x66ae('0x43')](handleError(_0x255d4b,null));};exports['destroy']=function(_0x38c40c,_0x52b262){return db['ZohoField']['find']({'where':{'id':_0x38c40c['params']['id']}})[_0x66ae('0x25')](handleEntityNotFound(_0x52b262,null))[_0x66ae('0x25')](removeEntity(_0x52b262,null))[_0x66ae('0x43')](handleError(_0x52b262,null));}; \ No newline at end of file +var _0x7ae7=['index','map','ZohoField','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send'];(function(_0x127ad3,_0x500b22){var _0x31a776=function(_0x171d69){while(--_0x171d69){_0x127ad3['push'](_0x127ad3['shift']());}};_0x31a776(++_0x500b22);}(_0x7ae7,0x109));var _0x77ae=function(_0x38b6ed,_0x355bb8){_0x38b6ed=_0x38b6ed-0x0;var _0x489fe0=_0x7ae7[_0x38b6ed];return _0x489fe0;};'use strict';var emlformat=require(_0x77ae('0x0'));var rimraf=require(_0x77ae('0x1'));var zipdir=require(_0x77ae('0x2'));var jsonpatch=require(_0x77ae('0x3'));var rp=require(_0x77ae('0x4'));var moment=require(_0x77ae('0x5'));var BPromise=require(_0x77ae('0x6'));var Mustache=require('mustache');var util=require(_0x77ae('0x7'));var path=require(_0x77ae('0x8'));var sox=require(_0x77ae('0x9'));var csv=require('to-csv');var ejs=require(_0x77ae('0xa'));var fs=require('fs');var fs_extra=require(_0x77ae('0xb'));var _=require(_0x77ae('0xc'));var squel=require(_0x77ae('0xd'));var crypto=require(_0x77ae('0xe'));var jsforce=require(_0x77ae('0xf'));var deskjs=require(_0x77ae('0x10'));var toCsv=require(_0x77ae('0x11'));var querystring=require(_0x77ae('0x12'));var Papa=require(_0x77ae('0x13'));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(_0x77ae('0x14'));var logger=require(_0x77ae('0x15'))(_0x77ae('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x77ae('0x17'));var db=require(_0x77ae('0x18'))['db'];function respondWithStatusCode(_0x12df1d,_0x101ff3){_0x101ff3=_0x101ff3||0xcc;return function(_0x36b844){if(_0x36b844){return _0x12df1d[_0x77ae('0x19')](_0x101ff3);}return _0x12df1d[_0x77ae('0x1a')](_0x101ff3)[_0x77ae('0x1b')]();};}function respondWithResult(_0x2b6110,_0x3960ed){_0x3960ed=_0x3960ed||0xc8;return function(_0x494bd9){if(_0x494bd9){return _0x2b6110[_0x77ae('0x1a')](_0x3960ed)[_0x77ae('0x1c')](_0x494bd9);}};}function respondWithFilteredResult(_0x3ef691,_0x9b0db2){return function(_0x508bdd){if(_0x508bdd){var _0x16c1c6=typeof _0x9b0db2[_0x77ae('0x1d')]===_0x77ae('0x1e')&&typeof _0x9b0db2[_0x77ae('0x1f')]==='undefined';var _0x22409e=_0x508bdd[_0x77ae('0x20')];var _0x55add8=_0x16c1c6?0x0:_0x9b0db2[_0x77ae('0x1d')];var _0x33b10c=_0x16c1c6?_0x508bdd['count']:_0x9b0db2[_0x77ae('0x1d')]+_0x9b0db2[_0x77ae('0x1f')];var _0x39cd66;if(_0x33b10c>=_0x22409e){_0x33b10c=_0x22409e;_0x39cd66=0xc8;}else{_0x39cd66=0xce;}_0x3ef691[_0x77ae('0x1a')](_0x39cd66);return _0x3ef691[_0x77ae('0x21')](_0x77ae('0x22'),_0x55add8+'-'+_0x33b10c+'/'+_0x22409e)[_0x77ae('0x1c')](_0x508bdd);}return null;};}function patchUpdates(_0x352ba0){return function(_0x16695d){try{jsonpatch[_0x77ae('0x23')](_0x16695d,_0x352ba0,!![]);}catch(_0x55268a){return BPromise[_0x77ae('0x24')](_0x55268a);}return _0x16695d[_0x77ae('0x25')]();};}function saveUpdates(_0x5c07a8,_0x1e2fb3){return function(_0x288fd5){if(_0x288fd5){return _0x288fd5[_0x77ae('0x26')](_0x5c07a8)['then'](function(_0x7e6c6f){return _0x7e6c6f;});}return null;};}function removeEntity(_0x4df9fb,_0x124f57){return function(_0x1e7b36){if(_0x1e7b36){return _0x1e7b36['destroy']()[_0x77ae('0x27')](function(){_0x4df9fb['status'](0xcc)[_0x77ae('0x1b')]();});}};}function handleEntityNotFound(_0x4f7441,_0x5920aa){return function(_0x22afce){if(!_0x22afce){_0x4f7441['sendStatus'](0x194);}return _0x22afce;};}function handleError(_0x4c6aa2,_0x5c1af2){_0x5c1af2=_0x5c1af2||0x1f4;return function(_0x1562ee){logger['error'](_0x1562ee[_0x77ae('0x28')]);if(_0x1562ee[_0x77ae('0x29')]){delete _0x1562ee[_0x77ae('0x29')];}_0x4c6aa2[_0x77ae('0x1a')](_0x5c1af2)[_0x77ae('0x2a')](_0x1562ee);};}exports[_0x77ae('0x2b')]=function(_0x150a46,_0x43b58e){var _0x2317bb={},_0x186bb2={},_0x2c22ce={'count':0x0,'rows':[]};var _0x11d53b=_[_0x77ae('0x2c')](db[_0x77ae('0x2d')][_0x77ae('0x2e')],function(_0x1487f1){return{'name':_0x1487f1[_0x77ae('0x2f')],'type':_0x1487f1[_0x77ae('0x30')]['key']};});_0x186bb2[_0x77ae('0x31')]=_[_0x77ae('0x2c')](_0x11d53b,_0x77ae('0x29'));_0x186bb2[_0x77ae('0x32')]=_['keys'](_0x150a46[_0x77ae('0x32')]);_0x186bb2[_0x77ae('0x33')]=_[_0x77ae('0x34')](_0x186bb2['model'],_0x186bb2['query']);_0x2317bb['attributes']=_[_0x77ae('0x34')](_0x186bb2[_0x77ae('0x31')],qs[_0x77ae('0x35')](_0x150a46[_0x77ae('0x32')][_0x77ae('0x35')]));_0x2317bb[_0x77ae('0x36')]=_0x2317bb[_0x77ae('0x36')][_0x77ae('0x37')]?_0x2317bb[_0x77ae('0x36')]:_0x186bb2[_0x77ae('0x31')];if(!_0x150a46[_0x77ae('0x32')]['hasOwnProperty'](_0x77ae('0x38'))){_0x2317bb[_0x77ae('0x1f')]=qs[_0x77ae('0x1f')](_0x150a46[_0x77ae('0x32')][_0x77ae('0x1f')]);_0x2317bb[_0x77ae('0x1d')]=qs[_0x77ae('0x1d')](_0x150a46[_0x77ae('0x32')][_0x77ae('0x1d')]);}_0x2317bb[_0x77ae('0x39')]=qs[_0x77ae('0x3a')](_0x150a46[_0x77ae('0x32')][_0x77ae('0x3a')]);_0x2317bb[_0x77ae('0x3b')]=qs[_0x77ae('0x33')](_[_0x77ae('0x3c')](_0x150a46['query'],_0x186bb2['filters']),_0x11d53b);if(_0x150a46['query'][_0x77ae('0x3d')]){_0x2317bb[_0x77ae('0x3b')]=_[_0x77ae('0x3e')](_0x2317bb['where'],{'$or':_[_0x77ae('0x2c')](_0x11d53b,function(_0x1b7a15){if(_0x1b7a15[_0x77ae('0x30')]!==_0x77ae('0x3f')){var _0x891600={};_0x891600[_0x1b7a15['name']]={'$like':'%'+_0x150a46[_0x77ae('0x32')][_0x77ae('0x3d')]+'%'};return _0x891600;}})});}_0x2317bb=_[_0x77ae('0x3e')]({},_0x2317bb,_0x150a46[_0x77ae('0x40')]);var _0x1ec08f={'where':_0x2317bb[_0x77ae('0x3b')]};return db['ZohoField'][_0x77ae('0x20')](_0x1ec08f)[_0x77ae('0x27')](function(_0x3a9ef1){_0x2c22ce[_0x77ae('0x20')]=_0x3a9ef1;if(_0x150a46[_0x77ae('0x32')]['includeAll']){_0x2317bb[_0x77ae('0x41')]=[{'all':!![]}];}return db['ZohoField'][_0x77ae('0x42')](_0x2317bb);})[_0x77ae('0x27')](function(_0x5290e8){_0x2c22ce[_0x77ae('0x43')]=_0x5290e8;return _0x2c22ce;})[_0x77ae('0x27')](respondWithFilteredResult(_0x43b58e,_0x2317bb))['catch'](handleError(_0x43b58e,null));};exports[_0x77ae('0x44')]=function(_0x363ac5,_0x31e34f){var _0x70e9fe={'raw':!![],'where':{'id':_0x363ac5['params']['id']}},_0x29fd27={};_0x29fd27[_0x77ae('0x31')]=_[_0x77ae('0x45')](db['ZohoField']['rawAttributes']);_0x29fd27['query']=_[_0x77ae('0x45')](_0x363ac5[_0x77ae('0x32')]);_0x29fd27[_0x77ae('0x33')]=_[_0x77ae('0x34')](_0x29fd27[_0x77ae('0x31')],_0x29fd27[_0x77ae('0x32')]);_0x70e9fe[_0x77ae('0x36')]=_[_0x77ae('0x34')](_0x29fd27[_0x77ae('0x31')],qs[_0x77ae('0x35')](_0x363ac5[_0x77ae('0x32')]['fields']));_0x70e9fe[_0x77ae('0x36')]=_0x70e9fe[_0x77ae('0x36')]['length']?_0x70e9fe[_0x77ae('0x36')]:_0x29fd27[_0x77ae('0x31')];if(_0x363ac5[_0x77ae('0x32')][_0x77ae('0x46')]){_0x70e9fe[_0x77ae('0x41')]=[{'all':!![]}];}_0x70e9fe=_[_0x77ae('0x3e')]({},_0x70e9fe,_0x363ac5[_0x77ae('0x40')]);return db[_0x77ae('0x2d')][_0x77ae('0x47')](_0x70e9fe)[_0x77ae('0x27')](handleEntityNotFound(_0x31e34f,null))[_0x77ae('0x27')](respondWithResult(_0x31e34f,null))[_0x77ae('0x48')](handleError(_0x31e34f,null));};exports['create']=function(_0x4af00f,_0x1353a7){return db[_0x77ae('0x2d')][_0x77ae('0x49')](_0x4af00f[_0x77ae('0x4a')],{})[_0x77ae('0x27')](respondWithResult(_0x1353a7,0xc9))[_0x77ae('0x48')](handleError(_0x1353a7,null));};exports[_0x77ae('0x26')]=function(_0x37cd6d,_0x3ea683){if(_0x37cd6d['body']['id']){delete _0x37cd6d[_0x77ae('0x4a')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x37cd6d[_0x77ae('0x4b')]['id']}})[_0x77ae('0x27')](handleEntityNotFound(_0x3ea683,null))[_0x77ae('0x27')](saveUpdates(_0x37cd6d['body'],null))[_0x77ae('0x27')](respondWithResult(_0x3ea683,null))[_0x77ae('0x48')](handleError(_0x3ea683,null));};exports[_0x77ae('0x4c')]=function(_0x5c51ce,_0x28c8b1){return db['ZohoField'][_0x77ae('0x47')]({'where':{'id':_0x5c51ce[_0x77ae('0x4b')]['id']}})[_0x77ae('0x27')](handleEntityNotFound(_0x28c8b1,null))[_0x77ae('0x27')](removeEntity(_0x28c8b1,null))[_0x77ae('0x48')](handleError(_0x28c8b1,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index a07b61f..cfe6a01 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 _0x627e=['define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x461403,_0x17c439){var _0x47716c=function(_0x247470){while(--_0x247470){_0x461403['push'](_0x461403['shift']());}};_0x47716c(++_0x17c439);}(_0x627e,0x14a));var _0xe627=function(_0x4911ab,_0x3c80bb){_0x4911ab=_0x4911ab-0x0;var _0x1c5716=_0x627e[_0x4911ab];return _0x1c5716;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var logger=require(_0xe627('0x2'))(_0xe627('0x3'));var moment=require(_0xe627('0x4'));var BPromise=require('bluebird');var rp=require(_0xe627('0x5'));var fs=require('fs');var path=require(_0xe627('0x6'));var rimraf=require(_0xe627('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module['exports']=function(_0x1a1a3d,_0x3f2791){return _0x1a1a3d[_0xe627('0x8')](_0xe627('0x9'),attributes,{'tableName':_0xe627('0xa'),'paranoid':![],'indexes':[{'name':_0xe627('0xb'),'fields':['idField',_0xe627('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x896e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x30b94a,_0xfb8634){var _0x291adc=function(_0x47d0c3){while(--_0x47d0c3){_0x30b94a['push'](_0x30b94a['shift']());}};_0x291adc(++_0xfb8634);}(_0x896e,0x1e9));var _0xe896=function(_0x48d39c,_0x1c31dd){_0x48d39c=_0x48d39c-0x0;var _0x5de2f4=_0x896e[_0x48d39c];return _0x5de2f4;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'paranoid':![],'indexes':[{'name':_0xe896('0xf'),'fields':['idField',_0xe896('0x10')],'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 a61119e..c773622 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 _0xdb79=['debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','ZohoField,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0xbc3682,_0x8401d2){var _0x403e28=function(_0x36bd9d){while(--_0x36bd9d){_0xbc3682['push'](_0xbc3682['shift']());}};_0x403e28(++_0x8401d2);}(_0xdb79,0x86));var _0x9db7=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xdb79[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x9db7('0x0'));var util=require(_0x9db7('0x1'));var moment=require(_0x9db7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9db7('0x3'));var db=require(_0x9db7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9db7('0x5'))(_0x9db7('0x6'));var config=require(_0x9db7('0x7'));var jayson=require(_0x9db7('0x8'));var client=jayson[_0x9db7('0x9')][_0x9db7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e7e82,_0x4c8073,_0x4346e3){return new BPromise(function(_0x16409e,_0x20d779){return client['request'](_0x1e7e82,_0x4346e3)['then'](function(_0x3958ad){logger[_0x9db7('0xb')]('ZohoField,\x20%s,\x20%s',_0x4c8073,_0x9db7('0xc'));logger[_0x9db7('0xd')](_0x9db7('0xe'),_0x4c8073,'request\x20sent',JSON['stringify'](_0x3958ad));if(_0x3958ad[_0x9db7('0xf')]){if(_0x3958ad[_0x9db7('0xf')][_0x9db7('0x10')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x4c8073,_0x3958ad[_0x9db7('0xf')][_0x9db7('0x11')]);return _0x20d779(_0x3958ad[_0x9db7('0xf')][_0x9db7('0x11')]);}logger[_0x9db7('0xf')]('ZohoField,\x20%s,\x20%s',_0x4c8073,_0x3958ad[_0x9db7('0xf')]['message']);return _0x16409e(_0x3958ad[_0x9db7('0xf')][_0x9db7('0x11')]);}else{logger['info'](_0x9db7('0x12'),_0x4c8073,_0x9db7('0xc'));_0x16409e(_0x3958ad[_0x9db7('0x13')][_0x9db7('0x11')]);}})[_0x9db7('0x14')](function(_0xc210b3){logger[_0x9db7('0xf')]('ZohoField,\x20%s,\x20%s',_0x4c8073,_0xc210b3);_0x20d779(_0xc210b3);});});} \ No newline at end of file +var _0x557d=['client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x557d,0x99));var _0xd557=function(_0x56fcee,_0x4100d7){_0x56fcee=_0x56fcee-0x0;var _0x2dc509=_0x557d[_0x56fcee];return _0x2dc509;};'use strict';var _=require(_0xd557('0x0'));var util=require(_0xd557('0x1'));var moment=require('moment');var BPromise=require(_0xd557('0x2'));var rs=require(_0xd557('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd557('0x4'))['db'];var utils=require(_0xd557('0x5'));var logger=require('../../config/logger')(_0xd557('0x6'));var config=require(_0xd557('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd557('0x8')][_0xd557('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xaec957,_0xbd7786,_0x414c75){return new BPromise(function(_0x1987fb,_0x2af390){return client[_0xd557('0xa')](_0xaec957,_0x414c75)[_0xd557('0xb')](function(_0x3ea561){logger['info'](_0xd557('0xc'),_0xbd7786,_0xd557('0xd'));logger[_0xd557('0xe')](_0xd557('0xf'),_0xbd7786,_0xd557('0xd'),JSON[_0xd557('0x10')](_0x3ea561));if(_0x3ea561[_0xd557('0x11')]){if(_0x3ea561[_0xd557('0x11')][_0xd557('0x12')]===0x1f4){logger[_0xd557('0x11')]('ZohoField,\x20%s,\x20%s',_0xbd7786,_0x3ea561[_0xd557('0x11')][_0xd557('0x13')]);return _0x2af390(_0x3ea561[_0xd557('0x11')][_0xd557('0x13')]);}logger[_0xd557('0x11')](_0xd557('0xc'),_0xbd7786,_0x3ea561[_0xd557('0x11')][_0xd557('0x13')]);return _0x1987fb(_0x3ea561[_0xd557('0x11')][_0xd557('0x13')]);}else{logger[_0xd557('0x14')]('ZohoField,\x20%s,\x20%s',_0xbd7786,_0xd557('0xd'));_0x1987fb(_0x3ea561[_0xd557('0x15')]['message']);}})[_0xd557('0x16')](function(_0x4522fb){logger[_0xd557('0x11')]('ZohoField,\x20%s,\x20%s',_0xbd7786,_0x4522fb);_0x2af390(_0x4522fb);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 6a46125..a9f23da 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x470fef,_0xe48cf0){var _0x358499=function(_0xfb80ac){while(--_0xfb80ac){_0x470fef['push'](_0x470fef['shift']());}};_0x358499(++_0xe48cf0);}(_0x70e0,0x17b));var _0x070e=function(_0x1d27ea,_0x426823){_0x1d27ea=_0x1d27ea-0x0;var _0x510915=_0x70e0[_0x1d27ea];return _0x510915;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x536256,_0x237fb5){var _0x1675f7=function(_0x339198){while(--_0x339198){_0x536256['push'](_0x536256['shift']());}};_0x1675f7(++_0x237fb5);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index abe9235..eb8a14d 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 _0x3992=['unique_name_and_version','app.js','BOOLEAN','exports','STRING'];(function(_0x5289a0,_0x35465c){var _0x3726fd=function(_0x24b596){while(--_0x24b596){_0x5289a0['push'](_0x5289a0['shift']());}};_0x3726fd(++_0x35465c);}(_0x3992,0x175));var _0x2399=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x3992[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require('sequelize');module[_0x2399('0x0')]={'name':{'type':Sequelize[_0x2399('0x1')],'allowNull':![],'unique':_0x2399('0x2')},'version':{'type':Sequelize[_0x2399('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x2399('0x1')],'defaultValue':_0x2399('0x3')},'filename':{'type':Sequelize[_0x2399('0x1')]},'path':{'type':Sequelize[_0x2399('0x1')]},'type':{'type':Sequelize[_0x2399('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x2399('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x2399('0x1')]},'logo':{'type':Sequelize[_0x2399('0x1')]},'state':{'type':Sequelize[_0x2399('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x2399('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2399('0x1')]},'link':{'type':Sequelize[_0x2399('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x8985=['sequelize','exports','STRING','app.js','BOOLEAN','state'];(function(_0x42047e,_0x15ff54){var _0x52aa5b=function(_0x5ce3a0){while(--_0x5ce3a0){_0x42047e['push'](_0x42047e['shift']());}};_0x52aa5b(++_0x15ff54);}(_0x8985,0x198));var _0x5898=function(_0x525511,_0x3b9d9b){_0x525511=_0x525511-0x0;var _0x1ab032=_0x8985[_0x525511];return _0x1ab032;};'use strict';var Sequelize=require(_0x5898('0x0'));module[_0x5898('0x1')]={'name':{'type':Sequelize[_0x5898('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x5898('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x5898('0x3')},'filename':{'type':Sequelize[_0x5898('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x5898('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x5898('0x2')]},'logo':{'type':Sequelize[_0x5898('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x5898('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x5898('0x2')]},'remoteUri':{'type':Sequelize[_0x5898('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index e82493b..b0523bd 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 _0xafc4=['reject','save','update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','Integration','includeAll','catch','show','params','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x5c73e5,_0x2ba756){var _0x501028=function(_0x209d1c){while(--_0x209d1c){_0x5c73e5['push'](_0x5c73e5['shift']());}};_0x501028(++_0x2ba756);}(_0xafc4,0x69));var _0x4afc=function(_0x3a1eec,_0x284417){_0x3a1eec=_0x3a1eec-0x0;var _0x354806=_0xafc4[_0x3a1eec];return _0x354806;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['Integration'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['Integration']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['Integration']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));}; \ No newline at end of file +var _0x1883=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Integration','includeAll','include','findAll','params','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x3ee76c,_0x58354e){var _0x14bfa8=function(_0xef7be8){while(--_0xef7be8){_0x3ee76c['push'](_0x3ee76c['shift']());}};_0x14bfa8(++_0x58354e);}(_0x1883,0xab));var _0x3188=function(_0x3cfaea,_0x59581c){_0x3cfaea=_0x3cfaea-0x0;var _0x5131f6=_0x1883[_0x3cfaea];return _0x5131f6;};'use strict';var emlformat=require(_0x3188('0x0'));var rimraf=require(_0x3188('0x1'));var zipdir=require(_0x3188('0x2'));var jsonpatch=require(_0x3188('0x3'));var rp=require(_0x3188('0x4'));var moment=require(_0x3188('0x5'));var BPromise=require(_0x3188('0x6'));var Mustache=require(_0x3188('0x7'));var util=require(_0x3188('0x8'));var path=require(_0x3188('0x9'));var sox=require(_0x3188('0xa'));var csv=require(_0x3188('0xb'));var ejs=require(_0x3188('0xc'));var fs=require('fs');var fs_extra=require(_0x3188('0xd'));var _=require(_0x3188('0xe'));var squel=require(_0x3188('0xf'));var crypto=require(_0x3188('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3188('0x11'));var toCsv=require(_0x3188('0xb'));var querystring=require('querystring');var Papa=require(_0x3188('0x12'));var Redis=require('ioredis');var authService=require(_0x3188('0x13'));var qs=require(_0x3188('0x14'));var as=require(_0x3188('0x15'));var hardwareService=require(_0x3188('0x16'));var logger=require('../../config/logger')(_0x3188('0x17'));var utils=require(_0x3188('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3188('0x19'))['db'];function respondWithStatusCode(_0x45e94e,_0x20fef6){_0x20fef6=_0x20fef6||0xcc;return function(_0x3ae228){if(_0x3ae228){return _0x45e94e[_0x3188('0x1a')](_0x20fef6);}return _0x45e94e[_0x3188('0x1b')](_0x20fef6)['end']();};}function respondWithResult(_0x276d69,_0x5e0044){_0x5e0044=_0x5e0044||0xc8;return function(_0x4a2f36){if(_0x4a2f36){return _0x276d69[_0x3188('0x1b')](_0x5e0044)['json'](_0x4a2f36);}};}function respondWithFilteredResult(_0x54a87f,_0x32c239){return function(_0x1beead){if(_0x1beead){var _0xa2269=typeof _0x32c239[_0x3188('0x1c')]===_0x3188('0x1d')&&typeof _0x32c239[_0x3188('0x1e')]==='undefined';var _0x19cc72=_0x1beead[_0x3188('0x1f')];var _0x3f5b35=_0xa2269?0x0:_0x32c239[_0x3188('0x1c')];var _0x18a71a=_0xa2269?_0x1beead[_0x3188('0x1f')]:_0x32c239[_0x3188('0x1c')]+_0x32c239[_0x3188('0x1e')];var _0x5bcbba;if(_0x18a71a>=_0x19cc72){_0x18a71a=_0x19cc72;_0x5bcbba=0xc8;}else{_0x5bcbba=0xce;}_0x54a87f[_0x3188('0x1b')](_0x5bcbba);return _0x54a87f[_0x3188('0x20')]('Content-Range',_0x3f5b35+'-'+_0x18a71a+'/'+_0x19cc72)['json'](_0x1beead);}return null;};}function patchUpdates(_0x5d8d62){return function(_0x46a318){try{jsonpatch[_0x3188('0x21')](_0x46a318,_0x5d8d62,!![]);}catch(_0xd292b5){return BPromise['reject'](_0xd292b5);}return _0x46a318['save']();};}function saveUpdates(_0x266260,_0x461286){return function(_0x375077){if(_0x375077){return _0x375077[_0x3188('0x22')](_0x266260)[_0x3188('0x23')](function(_0x4bd5ee){return _0x4bd5ee;});}return null;};}function removeEntity(_0x30cf2c,_0x33f882){return function(_0x5a2e67){if(_0x5a2e67){return _0x5a2e67[_0x3188('0x24')]()['then'](function(){_0x30cf2c['status'](0xcc)[_0x3188('0x25')]();});}};}function handleEntityNotFound(_0x129bd7,_0x87d5a3){return function(_0x1aeaba){if(!_0x1aeaba){_0x129bd7[_0x3188('0x1a')](0x194);}return _0x1aeaba;};}function handleError(_0x2cd060,_0xe57f73){_0xe57f73=_0xe57f73||0x1f4;return function(_0x11021c){logger['error'](_0x11021c[_0x3188('0x26')]);if(_0x11021c[_0x3188('0x27')]){delete _0x11021c['name'];}_0x2cd060[_0x3188('0x1b')](_0xe57f73)[_0x3188('0x28')](_0x11021c);};}exports[_0x3188('0x29')]=function(_0x44db9a,_0x20e6aa){var _0x1f1c6f={},_0x8f810f={},_0x472926={'count':0x0,'rows':[]};var _0x57c21c=_[_0x3188('0x2a')](db['Integration'][_0x3188('0x2b')],function(_0x5623f1){return{'name':_0x5623f1[_0x3188('0x2c')],'type':_0x5623f1[_0x3188('0x2d')][_0x3188('0x2e')]};});_0x8f810f[_0x3188('0x2f')]=_[_0x3188('0x2a')](_0x57c21c,_0x3188('0x27'));_0x8f810f[_0x3188('0x30')]=_[_0x3188('0x31')](_0x44db9a[_0x3188('0x30')]);_0x8f810f[_0x3188('0x32')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],_0x8f810f[_0x3188('0x30')]);_0x1f1c6f[_0x3188('0x34')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],qs[_0x3188('0x35')](_0x44db9a[_0x3188('0x30')]['fields']));_0x1f1c6f[_0x3188('0x34')]=_0x1f1c6f['attributes'][_0x3188('0x36')]?_0x1f1c6f[_0x3188('0x34')]:_0x8f810f['model'];if(!_0x44db9a[_0x3188('0x30')][_0x3188('0x37')](_0x3188('0x38'))){_0x1f1c6f[_0x3188('0x1e')]=qs[_0x3188('0x1e')](_0x44db9a[_0x3188('0x30')][_0x3188('0x1e')]);_0x1f1c6f['offset']=qs['offset'](_0x44db9a[_0x3188('0x30')][_0x3188('0x1c')]);}_0x1f1c6f[_0x3188('0x39')]=qs[_0x3188('0x3a')](_0x44db9a['query'][_0x3188('0x3a')]);_0x1f1c6f[_0x3188('0x3b')]=qs[_0x3188('0x32')](_[_0x3188('0x3c')](_0x44db9a['query'],_0x8f810f[_0x3188('0x32')]),_0x57c21c);if(_0x44db9a['query'][_0x3188('0x3d')]){_0x1f1c6f['where']=_[_0x3188('0x3e')](_0x1f1c6f[_0x3188('0x3b')],{'$or':_[_0x3188('0x2a')](_0x57c21c,function(_0x2990c4){if(_0x2990c4[_0x3188('0x2d')]!==_0x3188('0x3f')){var _0x4666b2={};_0x4666b2[_0x2990c4[_0x3188('0x27')]]={'$like':'%'+_0x44db9a[_0x3188('0x30')][_0x3188('0x3d')]+'%'};return _0x4666b2;}})});}_0x1f1c6f=_['merge']({},_0x1f1c6f,_0x44db9a[_0x3188('0x40')]);var _0x2bad0f={'where':_0x1f1c6f[_0x3188('0x3b')]};return db[_0x3188('0x41')][_0x3188('0x1f')](_0x2bad0f)[_0x3188('0x23')](function(_0x5a815d){_0x472926[_0x3188('0x1f')]=_0x5a815d;if(_0x44db9a['query'][_0x3188('0x42')]){_0x1f1c6f[_0x3188('0x43')]=[{'all':!![]}];}return db[_0x3188('0x41')][_0x3188('0x44')](_0x1f1c6f);})[_0x3188('0x23')](function(_0x549ab2){_0x472926['rows']=_0x549ab2;return _0x472926;})['then'](respondWithFilteredResult(_0x20e6aa,_0x1f1c6f))['catch'](handleError(_0x20e6aa,null));};exports['show']=function(_0x763943,_0x28c224){var _0x3e5f90={'raw':![],'where':{'id':_0x763943[_0x3188('0x45')]['id']}},_0x1b40b1={};_0x1b40b1['model']=_[_0x3188('0x31')](db['Integration'][_0x3188('0x2b')]);_0x1b40b1[_0x3188('0x30')]=_[_0x3188('0x31')](_0x763943[_0x3188('0x30')]);_0x1b40b1['filters']=_[_0x3188('0x33')](_0x1b40b1[_0x3188('0x2f')],_0x1b40b1[_0x3188('0x30')]);_0x3e5f90[_0x3188('0x34')]=_[_0x3188('0x33')](_0x1b40b1['model'],qs['fields'](_0x763943[_0x3188('0x30')][_0x3188('0x35')]));_0x3e5f90['attributes']=_0x3e5f90[_0x3188('0x34')][_0x3188('0x36')]?_0x3e5f90['attributes']:_0x1b40b1[_0x3188('0x2f')];if(_0x763943[_0x3188('0x30')][_0x3188('0x42')]){_0x3e5f90[_0x3188('0x43')]=[{'all':!![]}];}_0x3e5f90=_[_0x3188('0x3e')]({},_0x3e5f90,_0x763943['options']);return db[_0x3188('0x41')]['find'](_0x3e5f90)[_0x3188('0x23')](handleEntityNotFound(_0x28c224,null))[_0x3188('0x23')](respondWithResult(_0x28c224,null))[_0x3188('0x46')](handleError(_0x28c224,null));};exports[_0x3188('0x47')]=function(_0xe4cbb0,_0x315524){return db[_0x3188('0x41')][_0x3188('0x47')](_0xe4cbb0[_0x3188('0x48')],{})[_0x3188('0x23')](respondWithResult(_0x315524,0xc9))[_0x3188('0x46')](handleError(_0x315524,null));};exports['update']=function(_0x50fd56,_0x1b012d){if(_0x50fd56['body']['id']){delete _0x50fd56[_0x3188('0x48')]['id'];}return db[_0x3188('0x41')]['find']({'where':{'id':_0x50fd56[_0x3188('0x45')]['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x1b012d,null))[_0x3188('0x23')](saveUpdates(_0x50fd56[_0x3188('0x48')],null))[_0x3188('0x23')](respondWithResult(_0x1b012d,null))[_0x3188('0x46')](handleError(_0x1b012d,null));};exports[_0x3188('0x24')]=function(_0x1e3592,_0x59a177){return db[_0x3188('0x41')][_0x3188('0x49')]({'where':{'id':_0x1e3592['params']['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x59a177,null))['then'](removeEntity(_0x59a177,null))[_0x3188('0x46')](handleError(_0x59a177,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b46ebb4..158e7f5 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 _0x62bb=['integrations','util','moment','path','rimraf','exports','define','Integration'];(function(_0x303f17,_0x4f8d86){var _0x3107f7=function(_0x2d6763){while(--_0x2d6763){_0x303f17['push'](_0x303f17['shift']());}};_0x3107f7(++_0x4f8d86);}(_0x62bb,0x149));var _0xb62b=function(_0x201fa7,_0x586553){_0x201fa7=_0x201fa7-0x0;var _0x237f5f=_0x62bb[_0x201fa7];return _0x237f5f;};'use strict';var _=require('lodash');var util=require(_0xb62b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb62b('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb62b('0x2'));var rimraf=require(_0xb62b('0x3'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xb62b('0x4')]=function(_0x30f238,_0x202d21){return _0x30f238[_0xb62b('0x5')](_0xb62b('0x6'),attributes,{'tableName':_0xb62b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cd1=['bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','util','../../config/logger','api','moment'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0x6cd1,0x1e8));var _0x16cd=function(_0x32cd29,_0x29f6bb){_0x32cd29=_0x32cd29-0x0;var _0x2f7e6e=_0x6cd1[_0x32cd29];return _0x2f7e6e;};'use strict';var _=require('lodash');var util=require(_0x16cd('0x0'));var logger=require(_0x16cd('0x1'))(_0x16cd('0x2'));var moment=require(_0x16cd('0x3'));var BPromise=require(_0x16cd('0x4'));var rp=require(_0x16cd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16cd('0x6'));var config=require(_0x16cd('0x7'));var attributes=require(_0x16cd('0x8'));module[_0x16cd('0x9')]=function(_0x5a3bb0,_0xb4c63a){return _0x5a3bb0[_0x16cd('0xa')](_0x16cd('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 4e81432..40658d6 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 _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x410f02,_0x3d18e9){var _0x2c84e4=function(_0x8436e4){while(--_0x8436e4){_0x410f02['push'](_0x410f02['shift']());}};_0x2c84e4(++_0x3d18e9);}(_0x2542,0x169));var _0x2254=function(_0x481739,_0x714003){_0x481739=_0x481739-0x0;var _0x20f1d4=_0x2542[_0x481739];return _0x20f1d4;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x4ac424,_0x554b5d){var _0xe1b890=function(_0x5e85c4){while(--_0x5e85c4){_0x4ac424['push'](_0x4ac424['shift']());}};_0xe1b890(++_0x554b5d);}(_0x524e,0x15e));var _0xe524=function(_0x570a14,_0x509ac9){_0x570a14=_0x570a14-0x0;var _0x3cfaea=_0x524e[_0x570a14];return _0x3cfaea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index dbafc4a..4cda098 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 _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x43d0b3,_0x1fde9b){var _0x59e3a7=function(_0x5cfa5a){while(--_0x5cfa5a){_0x43d0b3['push'](_0x43d0b3['shift']());}};_0x59e3a7(++_0x1fde9b);}(_0x2542,0x169));var _0x2254=function(_0x3c7cc4,_0x358aa5){_0x3c7cc4=_0x3c7cc4-0x0;var _0x2ccad1=_0x2542[_0x3c7cc4];return _0x2ccad1;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file +var _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x9fc5a2,_0x46c38f){var _0x10a4a8=function(_0x2aeef2){while(--_0x2aeef2){_0x9fc5a2['push'](_0x9fc5a2['shift']());}};_0x10a4a8(++_0x46c38f);}(_0x66fa,0x117));var _0xa66f=function(_0x1c9f37,_0x21f275){_0x1c9f37=_0x1c9f37-0x0;var _0x4899f8=_0x66fa[_0x1c9f37];return _0x4899f8;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a1a5380..e63e7bf 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 _0xf594=['STRING','DATE','BOOLEAN','INTEGER','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x3a6b3c,_0x10faf5){var _0x51f097=function(_0x18dee6){while(--_0x18dee6){_0x3a6b3c['push'](_0x3a6b3c['shift']());}};_0x51f097(++_0x10faf5);}(_0xf594,0x81));var _0x4f59=function(_0x57bcef,_0x309324){_0x57bcef=_0x57bcef-0x0;var _0x5be37e=_0xf594[_0x57bcef];return _0x5be37e;};'use strict';var Sequelize=require(_0x4f59('0x0'));module['exports']={'integration':{'type':Sequelize[_0x4f59('0x1')]},'eventChannel':{'type':Sequelize[_0x4f59('0x1')]},'exitStatus':{'type':Sequelize[_0x4f59('0x1')]},'ticketId':{'type':Sequelize[_0x4f59('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x4f59('0x1')]},'uniqueid':{'type':Sequelize[_0x4f59('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4f59('0x1')]},'queue':{'type':Sequelize[_0x4f59('0x1')]},'interface':{'type':Sequelize[_0x4f59('0x1')]},'membername':{'type':Sequelize[_0x4f59('0x1')]},'agentcalledAt':{'type':Sequelize[_0x4f59('0x2')]},'agentconnectAt':{'type':Sequelize[_0x4f59('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4f59('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4f59('0x2')]},'talktime':{'type':Sequelize[_0x4f59('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4f59('0x4')]},'reason':{'type':Sequelize[_0x4f59('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4f59('0x2')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4f59('0x2')]},'lastevent':{'type':Sequelize[_0x4f59('0x1')]},'channel':{'type':Sequelize[_0x4f59('0x1')]},'channelstate':{'type':Sequelize[_0x4f59('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4f59('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4f59('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4f59('0x1')]},'context':{'type':Sequelize[_0x4f59('0x1')]},'exten':{'type':Sequelize[_0x4f59('0x1')]},'priority':{'type':Sequelize[_0x4f59('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x4f59('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x4f59('0x1')]},'destcalleridname':{'type':Sequelize[_0x4f59('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x4f59('0x1')]},'destlanguage':{'type':Sequelize[_0x4f59('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4f59('0x1')]},'destexten':{'type':Sequelize[_0x4f59('0x1')]},'destpriority':{'type':Sequelize[_0x4f59('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x4f59('0x1')]},'inReplyTo':{'type':Sequelize[_0x4f59('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x4f59('0x1')]},'to':{'type':Sequelize[_0x4f59('0x1')]},'cc':{'type':Sequelize[_0x4f59('0x1')]},'attachment':{'type':Sequelize[_0x4f59('0x5')]},'html':{'type':Sequelize[_0x4f59('0x5')]},'text':{'type':Sequelize[_0x4f59('0x5')]},'status':{'type':Sequelize['ENUM'](_0x4f59('0x6'),_0x4f59('0x7'),_0x4f59('0x8'),_0x4f59('0x9'))},'url':{'type':Sequelize[_0x4f59('0x1')]},'app':{'type':Sequelize[_0x4f59('0x1')]},'appdata':{'type':Sequelize[_0x4f59('0x1')]},'projectId':{'type':Sequelize[_0x4f59('0x4')]}}; \ No newline at end of file +var _0xd777=['RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x4ccad8,_0x1b2209){var _0x553f9f=function(_0x1f4ed4){while(--_0x1f4ed4){_0x4ccad8['push'](_0x4ccad8['shift']());}};_0x553f9f(++_0x1b2209);}(_0xd777,0x86));var _0x7d77=function(_0x497880,_0x430dbc){_0x497880=_0x497880-0x0;var _0x1a3d4b=_0xd777[_0x497880];return _0x1a3d4b;};'use strict';var Sequelize=require(_0x7d77('0x0'));module[_0x7d77('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x7d77('0x2')]},'ticketId':{'type':Sequelize[_0x7d77('0x2')]},'integrationId':{'type':Sequelize[_0x7d77('0x3')]},'contacts':{'type':Sequelize[_0x7d77('0x2')]},'uniqueid':{'type':Sequelize[_0x7d77('0x2')]},'calleridnum':{'type':Sequelize[_0x7d77('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x7d77('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x7d77('0x4')]},'agentconnectAt':{'type':Sequelize[_0x7d77('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x7d77('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7d77('0x4')]},'talktime':{'type':Sequelize[_0x7d77('0x3')]},'agentacw':{'type':Sequelize[_0x7d77('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7d77('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x7d77('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x7d77('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7d77('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7d77('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7d77('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7d77('0x2')]},'connectedlinename':{'type':Sequelize[_0x7d77('0x2')]},'language':{'type':Sequelize[_0x7d77('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7d77('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7d77('0x2')]},'destchannelstate':{'type':Sequelize[_0x7d77('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7d77('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x7d77('0x2')]},'destlanguage':{'type':Sequelize[_0x7d77('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x7d77('0x2')]},'destpriority':{'type':Sequelize[_0x7d77('0x2')]},'destuniqueid':{'type':Sequelize[_0x7d77('0x2')]},'messageId':{'type':Sequelize[_0x7d77('0x2')]},'inReplyTo':{'type':Sequelize[_0x7d77('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x7d77('0x6')]},'text':{'type':Sequelize[_0x7d77('0x6')]},'status':{'type':Sequelize[_0x7d77('0x7')](_0x7d77('0x8'),_0x7d77('0x9'),_0x7d77('0xa'),_0x7d77('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x7d77('0x2')]},'appdata':{'type':Sequelize[_0x7d77('0x2')]},'projectId':{'type':Sequelize[_0x7d77('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index f229866..8fc9785 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 _0xf5ff=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','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/environment','../../config/license/util','sendStatus','end','offset','limit','undefined','count','status','set','apply','reject','update','then','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection'];(function(_0x4fca79,_0x5cc14c){var _0xfee8fc=function(_0x46dcf2){while(--_0x46dcf2){_0x4fca79['push'](_0x4fca79['shift']());}};_0xfee8fc(++_0x5cc14c);}(_0xf5ff,0x1ed));var _0xff5f=function(_0x497eda,_0x3af9a4){_0x497eda=_0x497eda-0x0;var _0x53079f=_0xf5ff[_0x497eda];return _0x53079f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff5f('0x0'));var zipdir=require(_0xff5f('0x1'));var jsonpatch=require(_0xff5f('0x2'));var rp=require('request-promise');var moment=require(_0xff5f('0x3'));var BPromise=require(_0xff5f('0x4'));var Mustache=require('mustache');var util=require(_0xff5f('0x5'));var path=require('path');var sox=require(_0xff5f('0x6'));var csv=require(_0xff5f('0x7'));var ejs=require(_0xff5f('0x8'));var fs=require('fs');var fs_extra=require(_0xff5f('0x9'));var _=require(_0xff5f('0xa'));var squel=require(_0xff5f('0xb'));var crypto=require(_0xff5f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xff5f('0xd'));var toCsv=require(_0xff5f('0x7'));var querystring=require(_0xff5f('0xe'));var Papa=require(_0xff5f('0xf'));var Redis=require(_0xff5f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xff5f('0x11'));var as=require(_0xff5f('0x12'));var hardwareService=require(_0xff5f('0x13'));var logger=require(_0xff5f('0x14'))(_0xff5f('0x15'));var utils=require(_0xff5f('0x16'));var config=require(_0xff5f('0x17'));var licenseUtil=require(_0xff5f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59870d,_0x36913c){_0x36913c=_0x36913c||0xcc;return function(_0x261196){if(_0x261196){return _0x59870d[_0xff5f('0x19')](_0x36913c);}return _0x59870d['status'](_0x36913c)[_0xff5f('0x1a')]();};}function respondWithResult(_0xe54c10,_0x31e050){_0x31e050=_0x31e050||0xc8;return function(_0xf422cf){if(_0xf422cf){return _0xe54c10['status'](_0x31e050)['json'](_0xf422cf);}};}function respondWithFilteredResult(_0x3b3d15,_0x3e95b9){return function(_0x46ec0f){if(_0x46ec0f){var _0x5dc7f7=typeof _0x3e95b9[_0xff5f('0x1b')]==='undefined'&&typeof _0x3e95b9[_0xff5f('0x1c')]===_0xff5f('0x1d');var _0x1c6c0b=_0x46ec0f['count'];var _0x40550f=_0x5dc7f7?0x0:_0x3e95b9[_0xff5f('0x1b')];var _0x4c5d30=_0x5dc7f7?_0x46ec0f[_0xff5f('0x1e')]:_0x3e95b9[_0xff5f('0x1b')]+_0x3e95b9[_0xff5f('0x1c')];var _0x26300e;if(_0x4c5d30>=_0x1c6c0b){_0x4c5d30=_0x1c6c0b;_0x26300e=0xc8;}else{_0x26300e=0xce;}_0x3b3d15[_0xff5f('0x1f')](_0x26300e);return _0x3b3d15[_0xff5f('0x20')]('Content-Range',_0x40550f+'-'+_0x4c5d30+'/'+_0x1c6c0b)['json'](_0x46ec0f);}return null;};}function patchUpdates(_0x1cb737){return function(_0x167c3a){try{jsonpatch[_0xff5f('0x21')](_0x167c3a,_0x1cb737,!![]);}catch(_0x58674d){return BPromise[_0xff5f('0x22')](_0x58674d);}return _0x167c3a['save']();};}function saveUpdates(_0x47306e,_0x3f3ea1){return function(_0x1a5ea3){if(_0x1a5ea3){return _0x1a5ea3[_0xff5f('0x23')](_0x47306e)[_0xff5f('0x24')](function(_0x2aadfa){return _0x2aadfa;});}return null;};}function removeEntity(_0x3ded3a,_0x10a332){return function(_0x4618cd){if(_0x4618cd){return _0x4618cd['destroy']()[_0xff5f('0x24')](function(){_0x3ded3a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b9bc1,_0x400e66){return function(_0x4382e6){if(!_0x4382e6){_0x5b9bc1[_0xff5f('0x19')](0x194);}return _0x4382e6;};}function handleError(_0x50b23d,_0x553680){_0x553680=_0x553680||0x1f4;return function(_0xb0443a){logger[_0xff5f('0x25')](_0xb0443a[_0xff5f('0x26')]);if(_0xb0443a[_0xff5f('0x27')]){delete _0xb0443a[_0xff5f('0x27')];}_0x50b23d[_0xff5f('0x1f')](_0x553680)[_0xff5f('0x28')](_0xb0443a);};}exports[_0xff5f('0x29')]=function(_0x2d4e74,_0x48b693){var _0x54f630={},_0xf8fee0={},_0x3508e8={'count':0x0,'rows':[]};var _0xa5b924=_[_0xff5f('0x2a')](db[_0xff5f('0x2b')][_0xff5f('0x2c')],function(_0x35bae4){return{'name':_0x35bae4[_0xff5f('0x2d')],'type':_0x35bae4[_0xff5f('0x2e')][_0xff5f('0x2f')]};});_0xf8fee0[_0xff5f('0x30')]=_[_0xff5f('0x2a')](_0xa5b924,_0xff5f('0x27'));_0xf8fee0[_0xff5f('0x31')]=_[_0xff5f('0x32')](_0x2d4e74['query']);_0xf8fee0['filters']=_['intersection'](_0xf8fee0[_0xff5f('0x30')],_0xf8fee0[_0xff5f('0x31')]);_0x54f630[_0xff5f('0x33')]=_[_0xff5f('0x34')](_0xf8fee0[_0xff5f('0x30')],qs['fields'](_0x2d4e74['query'][_0xff5f('0x35')]));_0x54f630[_0xff5f('0x33')]=_0x54f630['attributes'][_0xff5f('0x36')]?_0x54f630['attributes']:_0xf8fee0[_0xff5f('0x30')];if(!_0x2d4e74['query'][_0xff5f('0x37')](_0xff5f('0x38'))){_0x54f630[_0xff5f('0x1c')]=qs[_0xff5f('0x1c')](_0x2d4e74['query'][_0xff5f('0x1c')]);_0x54f630[_0xff5f('0x1b')]=qs[_0xff5f('0x1b')](_0x2d4e74[_0xff5f('0x31')][_0xff5f('0x1b')]);}_0x54f630[_0xff5f('0x39')]=qs[_0xff5f('0x3a')](_0x2d4e74[_0xff5f('0x31')][_0xff5f('0x3a')]);_0x54f630[_0xff5f('0x3b')]=qs[_0xff5f('0x3c')](_[_0xff5f('0x3d')](_0x2d4e74[_0xff5f('0x31')],_0xf8fee0[_0xff5f('0x3c')]),_0xa5b924);if(_0x2d4e74[_0xff5f('0x31')]['filter']){_0x54f630[_0xff5f('0x3b')]=_[_0xff5f('0x3e')](_0x54f630[_0xff5f('0x3b')],{'$or':_['map'](_0xa5b924,function(_0x5cde1d){if(_0x5cde1d[_0xff5f('0x2e')]!==_0xff5f('0x3f')){var _0x7bc6f0={};_0x7bc6f0[_0x5cde1d[_0xff5f('0x27')]]={'$like':'%'+_0x2d4e74[_0xff5f('0x31')][_0xff5f('0x40')]+'%'};return _0x7bc6f0;}})});}_0x54f630=_['merge']({},_0x54f630,_0x2d4e74['options']);var _0x5be3b4={'where':_0x54f630[_0xff5f('0x3b')]};return db[_0xff5f('0x2b')][_0xff5f('0x1e')](_0x5be3b4)['then'](function(_0x4efd61){_0x3508e8['count']=_0x4efd61;if(_0x2d4e74[_0xff5f('0x31')][_0xff5f('0x41')]){_0x54f630['include']=[{'all':!![]}];}return db[_0xff5f('0x2b')][_0xff5f('0x42')](_0x54f630);})[_0xff5f('0x24')](function(_0x50db39){_0x3508e8[_0xff5f('0x43')]=_0x50db39;return _0x3508e8;})['then'](respondWithFilteredResult(_0x48b693,_0x54f630))['catch'](handleError(_0x48b693,null));};exports[_0xff5f('0x44')]=function(_0x36ab46,_0x13a524){var _0x5395a1={'raw':![],'where':{'id':_0x36ab46[_0xff5f('0x45')]['id']}},_0x332d84={};_0x332d84[_0xff5f('0x30')]=_[_0xff5f('0x32')](db[_0xff5f('0x2b')][_0xff5f('0x2c')]);_0x332d84[_0xff5f('0x31')]=_['keys'](_0x36ab46['query']);_0x332d84['filters']=_[_0xff5f('0x34')](_0x332d84[_0xff5f('0x30')],_0x332d84[_0xff5f('0x31')]);_0x5395a1['attributes']=_[_0xff5f('0x34')](_0x332d84[_0xff5f('0x30')],qs[_0xff5f('0x35')](_0x36ab46[_0xff5f('0x31')]['fields']));_0x5395a1[_0xff5f('0x33')]=_0x5395a1[_0xff5f('0x33')]['length']?_0x5395a1[_0xff5f('0x33')]:_0x332d84[_0xff5f('0x30')];if(_0x36ab46[_0xff5f('0x31')]['includeAll']){_0x5395a1[_0xff5f('0x46')]=[{'all':!![]}];}_0x5395a1=_[_0xff5f('0x3e')]({},_0x5395a1,_0x36ab46[_0xff5f('0x47')]);return db['IntegrationReport'][_0xff5f('0x48')](_0x5395a1)[_0xff5f('0x24')](handleEntityNotFound(_0x13a524,null))['then'](respondWithResult(_0x13a524,null))[_0xff5f('0x49')](handleError(_0x13a524,null));};exports[_0xff5f('0x4a')]=function(_0x570db0,_0x1402b3){return db[_0xff5f('0x2b')][_0xff5f('0x4a')](_0x570db0[_0xff5f('0x4b')],{})[_0xff5f('0x24')](respondWithResult(_0x1402b3,0xc9))[_0xff5f('0x49')](handleError(_0x1402b3,null));};exports[_0xff5f('0x23')]=function(_0x41b144,_0xa10fd2){if(_0x41b144['body']['id']){delete _0x41b144[_0xff5f('0x4b')]['id'];}return db[_0xff5f('0x2b')][_0xff5f('0x48')]({'where':{'id':_0x41b144['params']['id']}})[_0xff5f('0x24')](handleEntityNotFound(_0xa10fd2,null))[_0xff5f('0x24')](saveUpdates(_0x41b144[_0xff5f('0x4b')],null))[_0xff5f('0x24')](respondWithResult(_0xa10fd2,null))[_0xff5f('0x49')](handleError(_0xa10fd2,null));};exports[_0xff5f('0x4c')]=function(_0x49c3fe,_0x15208b){return db[_0xff5f('0x2b')][_0xff5f('0x48')]({'where':{'id':_0x49c3fe[_0xff5f('0x45')]['id']}})[_0xff5f('0x24')](handleEntityNotFound(_0x15208b,null))[_0xff5f('0x24')](removeEntity(_0x15208b,null))[_0xff5f('0x49')](handleError(_0x15208b,null));};exports[_0xff5f('0x4d')]=function(_0x48f01e,_0x2ab906){return db['IntegrationReport'][_0xff5f('0x4d')]()[_0xff5f('0x24')](respondWithResult(_0x2ab906,null))[_0xff5f('0x49')](handleError(_0x2ab906,null));}; \ No newline at end of file +var _0x4a7a=['rawAttributes','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','crypto','papaparse','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','IntegrationReport'];(function(_0x36f5e3,_0x1e755a){var _0x2d7aa9=function(_0x139b57){while(--_0x139b57){_0x36f5e3['push'](_0x36f5e3['shift']());}};_0x2d7aa9(++_0x1e755a);}(_0x4a7a,0x163));var _0xa4a7=function(_0x4f38a4,_0x3ed3a1){_0x4f38a4=_0x4f38a4-0x0;var _0x49e13d=_0x4a7a[_0x4f38a4];return _0x49e13d;};'use strict';var emlformat=require(_0xa4a7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4a7('0x1'));var jsonpatch=require(_0xa4a7('0x2'));var rp=require(_0xa4a7('0x3'));var moment=require(_0xa4a7('0x4'));var BPromise=require(_0xa4a7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa4a7('0x6'));var csv=require(_0xa4a7('0x7'));var ejs=require(_0xa4a7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa4a7('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa4a7('0xa'));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(_0xa4a7('0xb'));var logger=require('../../config/logger')(_0xa4a7('0xc'));var utils=require(_0xa4a7('0xd'));var config=require(_0xa4a7('0xe'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54e4c7,_0x4ca7d2){_0x4ca7d2=_0x4ca7d2||0xcc;return function(_0x280582){if(_0x280582){return _0x54e4c7[_0xa4a7('0xf')](_0x4ca7d2);}return _0x54e4c7['status'](_0x4ca7d2)['end']();};}function respondWithResult(_0x41d619,_0x2e8933){_0x2e8933=_0x2e8933||0xc8;return function(_0x2da695){if(_0x2da695){return _0x41d619[_0xa4a7('0x10')](_0x2e8933)[_0xa4a7('0x11')](_0x2da695);}};}function respondWithFilteredResult(_0x58c0f1,_0x3892fc){return function(_0x27faeb){if(_0x27faeb){var _0x5d68d2=typeof _0x3892fc[_0xa4a7('0x12')]==='undefined'&&typeof _0x3892fc['limit']===_0xa4a7('0x13');var _0x4c8e4b=_0x27faeb['count'];var _0xbaa994=_0x5d68d2?0x0:_0x3892fc['offset'];var _0x38edd4=_0x5d68d2?_0x27faeb[_0xa4a7('0x14')]:_0x3892fc[_0xa4a7('0x12')]+_0x3892fc[_0xa4a7('0x15')];var _0x141bfd;if(_0x38edd4>=_0x4c8e4b){_0x38edd4=_0x4c8e4b;_0x141bfd=0xc8;}else{_0x141bfd=0xce;}_0x58c0f1[_0xa4a7('0x10')](_0x141bfd);return _0x58c0f1[_0xa4a7('0x16')](_0xa4a7('0x17'),_0xbaa994+'-'+_0x38edd4+'/'+_0x4c8e4b)[_0xa4a7('0x11')](_0x27faeb);}return null;};}function patchUpdates(_0x4419e1){return function(_0x2a021e){try{jsonpatch[_0xa4a7('0x18')](_0x2a021e,_0x4419e1,!![]);}catch(_0x19ab3a){return BPromise[_0xa4a7('0x19')](_0x19ab3a);}return _0x2a021e[_0xa4a7('0x1a')]();};}function saveUpdates(_0x1be19b,_0x1465cc){return function(_0x282b71){if(_0x282b71){return _0x282b71['update'](_0x1be19b)[_0xa4a7('0x1b')](function(_0x1a1e07){return _0x1a1e07;});}return null;};}function removeEntity(_0x16f3a4,_0x164d48){return function(_0x4e4ad9){if(_0x4e4ad9){return _0x4e4ad9[_0xa4a7('0x1c')]()[_0xa4a7('0x1b')](function(){_0x16f3a4[_0xa4a7('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x444771,_0x3fe8eb){return function(_0xc9bbf8){if(!_0xc9bbf8){_0x444771[_0xa4a7('0xf')](0x194);}return _0xc9bbf8;};}function handleError(_0x84dd71,_0x3f88c1){_0x3f88c1=_0x3f88c1||0x1f4;return function(_0x538d24){logger[_0xa4a7('0x1d')](_0x538d24[_0xa4a7('0x1e')]);if(_0x538d24[_0xa4a7('0x1f')]){delete _0x538d24['name'];}_0x84dd71[_0xa4a7('0x10')](_0x3f88c1)['send'](_0x538d24);};}exports[_0xa4a7('0x20')]=function(_0x56f7f8,_0x2867c8){var _0x51fc8a={},_0x3b29ea={},_0x10ae3d={'count':0x0,'rows':[]};var _0xc2e8cb=_[_0xa4a7('0x21')](db[_0xa4a7('0x22')][_0xa4a7('0x23')],function(_0x590831){return{'name':_0x590831['fieldName'],'type':_0x590831[_0xa4a7('0x24')][_0xa4a7('0x25')]};});_0x3b29ea[_0xa4a7('0x26')]=_[_0xa4a7('0x21')](_0xc2e8cb,'name');_0x3b29ea['query']=_[_0xa4a7('0x27')](_0x56f7f8[_0xa4a7('0x28')]);_0x3b29ea['filters']=_[_0xa4a7('0x29')](_0x3b29ea[_0xa4a7('0x26')],_0x3b29ea[_0xa4a7('0x28')]);_0x51fc8a['attributes']=_[_0xa4a7('0x29')](_0x3b29ea[_0xa4a7('0x26')],qs['fields'](_0x56f7f8['query']['fields']));_0x51fc8a[_0xa4a7('0x2a')]=_0x51fc8a[_0xa4a7('0x2a')][_0xa4a7('0x2b')]?_0x51fc8a[_0xa4a7('0x2a')]:_0x3b29ea[_0xa4a7('0x26')];if(!_0x56f7f8[_0xa4a7('0x28')][_0xa4a7('0x2c')](_0xa4a7('0x2d'))){_0x51fc8a['limit']=qs[_0xa4a7('0x15')](_0x56f7f8[_0xa4a7('0x28')][_0xa4a7('0x15')]);_0x51fc8a[_0xa4a7('0x12')]=qs[_0xa4a7('0x12')](_0x56f7f8['query'][_0xa4a7('0x12')]);}_0x51fc8a[_0xa4a7('0x2e')]=qs[_0xa4a7('0x2f')](_0x56f7f8[_0xa4a7('0x28')][_0xa4a7('0x2f')]);_0x51fc8a[_0xa4a7('0x30')]=qs[_0xa4a7('0x31')](_['pick'](_0x56f7f8[_0xa4a7('0x28')],_0x3b29ea['filters']),_0xc2e8cb);if(_0x56f7f8[_0xa4a7('0x28')][_0xa4a7('0x32')]){_0x51fc8a[_0xa4a7('0x30')]=_[_0xa4a7('0x33')](_0x51fc8a[_0xa4a7('0x30')],{'$or':_[_0xa4a7('0x21')](_0xc2e8cb,function(_0x583173){if(_0x583173['type']!==_0xa4a7('0x34')){var _0x4233dd={};_0x4233dd[_0x583173[_0xa4a7('0x1f')]]={'$like':'%'+_0x56f7f8['query']['filter']+'%'};return _0x4233dd;}})});}_0x51fc8a=_[_0xa4a7('0x33')]({},_0x51fc8a,_0x56f7f8[_0xa4a7('0x35')]);var _0x5ea742={'where':_0x51fc8a[_0xa4a7('0x30')]};return db[_0xa4a7('0x22')]['count'](_0x5ea742)[_0xa4a7('0x1b')](function(_0x5a13aa){_0x10ae3d[_0xa4a7('0x14')]=_0x5a13aa;if(_0x56f7f8['query'][_0xa4a7('0x36')]){_0x51fc8a['include']=[{'all':!![]}];}return db['IntegrationReport'][_0xa4a7('0x37')](_0x51fc8a);})[_0xa4a7('0x1b')](function(_0x2fa338){_0x10ae3d[_0xa4a7('0x38')]=_0x2fa338;return _0x10ae3d;})[_0xa4a7('0x1b')](respondWithFilteredResult(_0x2867c8,_0x51fc8a))[_0xa4a7('0x39')](handleError(_0x2867c8,null));};exports[_0xa4a7('0x3a')]=function(_0xfce3eb,_0x4a88a0){var _0x3d067c={'raw':![],'where':{'id':_0xfce3eb[_0xa4a7('0x3b')]['id']}},_0x2d8b96={};_0x2d8b96[_0xa4a7('0x26')]=_[_0xa4a7('0x27')](db[_0xa4a7('0x22')]['rawAttributes']);_0x2d8b96[_0xa4a7('0x28')]=_[_0xa4a7('0x27')](_0xfce3eb[_0xa4a7('0x28')]);_0x2d8b96[_0xa4a7('0x31')]=_[_0xa4a7('0x29')](_0x2d8b96[_0xa4a7('0x26')],_0x2d8b96['query']);_0x3d067c[_0xa4a7('0x2a')]=_['intersection'](_0x2d8b96[_0xa4a7('0x26')],qs['fields'](_0xfce3eb['query']['fields']));_0x3d067c[_0xa4a7('0x2a')]=_0x3d067c[_0xa4a7('0x2a')][_0xa4a7('0x2b')]?_0x3d067c[_0xa4a7('0x2a')]:_0x2d8b96[_0xa4a7('0x26')];if(_0xfce3eb['query']['includeAll']){_0x3d067c['include']=[{'all':!![]}];}_0x3d067c=_[_0xa4a7('0x33')]({},_0x3d067c,_0xfce3eb[_0xa4a7('0x35')]);return db[_0xa4a7('0x22')][_0xa4a7('0x3c')](_0x3d067c)[_0xa4a7('0x1b')](handleEntityNotFound(_0x4a88a0,null))[_0xa4a7('0x1b')](respondWithResult(_0x4a88a0,null))['catch'](handleError(_0x4a88a0,null));};exports[_0xa4a7('0x3d')]=function(_0x53d488,_0x49fb0b){return db[_0xa4a7('0x22')][_0xa4a7('0x3d')](_0x53d488[_0xa4a7('0x3e')],{})[_0xa4a7('0x1b')](respondWithResult(_0x49fb0b,0xc9))[_0xa4a7('0x39')](handleError(_0x49fb0b,null));};exports[_0xa4a7('0x3f')]=function(_0x4916,_0x1a3f6d){if(_0x4916[_0xa4a7('0x3e')]['id']){delete _0x4916[_0xa4a7('0x3e')]['id'];}return db[_0xa4a7('0x22')][_0xa4a7('0x3c')]({'where':{'id':_0x4916[_0xa4a7('0x3b')]['id']}})[_0xa4a7('0x1b')](handleEntityNotFound(_0x1a3f6d,null))[_0xa4a7('0x1b')](saveUpdates(_0x4916[_0xa4a7('0x3e')],null))['then'](respondWithResult(_0x1a3f6d,null))[_0xa4a7('0x39')](handleError(_0x1a3f6d,null));};exports[_0xa4a7('0x1c')]=function(_0x230d20,_0x837728){return db[_0xa4a7('0x22')][_0xa4a7('0x3c')]({'where':{'id':_0x230d20['params']['id']}})[_0xa4a7('0x1b')](handleEntityNotFound(_0x837728,null))[_0xa4a7('0x1b')](removeEntity(_0x837728,null))[_0xa4a7('0x39')](handleError(_0x837728,null));};exports[_0xa4a7('0x40')]=function(_0x2307cf,_0x310eb2){return db[_0xa4a7('0x22')][_0xa4a7('0x40')]()[_0xa4a7('0x1b')](respondWithResult(_0x310eb2,null))[_0xa4a7('0x39')](handleError(_0x310eb2,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 2783ea5..59c43aa 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 _0x615c=['./integrationReport.attributes','exports','report_integration','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x43747e,_0x13b832){var _0x7fb853=function(_0x4b1028){while(--_0x4b1028){_0x43747e['push'](_0x43747e['shift']());}};_0x7fb853(++_0x13b832);}(_0x615c,0x193));var _0xc615=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0x615c[_0x367a3d];return _0x460539;};'use strict';var _=require(_0xc615('0x0'));var util=require(_0xc615('0x1'));var logger=require(_0xc615('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc615('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc615('0x4'));var rimraf=require(_0xc615('0x5'));var config=require(_0xc615('0x6'));var attributes=require(_0xc615('0x7'));module[_0xc615('0x8')]=function(_0x1645fb,_0xba0e3a){return _0x1645fb['define']('IntegrationReport',attributes,{'tableName':_0xc615('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72a5=['moment','bluebird','path','define','IntegrationReport','report_integration','util','../../config/logger','api'];(function(_0x2aba5f,_0x5704a4){var _0x132437=function(_0x288416){while(--_0x288416){_0x2aba5f['push'](_0x2aba5f['shift']());}};_0x132437(++_0x5704a4);}(_0x72a5,0x192));var _0x572a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72a5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x572a('0x0'));var logger=require(_0x572a('0x1'))(_0x572a('0x2'));var moment=require(_0x572a('0x3'));var BPromise=require(_0x572a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x572a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module['exports']=function(_0xe4931e,_0x3d008a){return _0xe4931e[_0x572a('0x6')](_0x572a('0x7'),attributes,{'tableName':_0x572a('0x8'),'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 81ad81e..38971d3 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x327b49,_0xc232b8){var _0x4e7265=function(_0x4e99c1){while(--_0x4e99c1){_0x327b49['push'](_0x327b49['shift']());}};_0x4e7265(++_0xc232b8);}(_0xadb5,0xad));var _0x5adb=function(_0x417bb1,_0xa98277){_0x417bb1=_0x417bb1-0x0;var _0x265324=_0xadb5[_0x417bb1];return _0x265324;};'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']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5c9b55,_0x5befc4){var _0x113969=function(_0x5a404d){while(--_0x5a404d){_0x5c9b55['push'](_0x5c9b55['shift']());}};_0x113969(++_0x5befc4);}(_0x31f0,0xb7));var _0x031f=function(_0x54c077,_0xea1a88){_0x54c077=_0x54c077-0x0;var _0x3c869d=_0x31f0[_0x54c077];return _0x3c869d;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 89bcc48..2c206ae 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 _0xf981=['isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get'];(function(_0x23cd34,_0xe7e8f7){var _0x1e1e48=function(_0x820992){while(--_0x820992){_0x23cd34['push'](_0x23cd34['shift']());}};_0x1e1e48(++_0xe7e8f7);}(_0xf981,0x1af));var _0x1f98=function(_0x4d7be4,_0x393887){_0x4d7be4=_0x4d7be4-0x0;var _0x2b257c=_0xf981[_0x4d7be4];return _0x2b257c;};'use strict';var multer=require(_0x1f98('0x0'));var util=require(_0x1f98('0x1'));var path=require(_0x1f98('0x2'));var timeout=require('connect-timeout');var express=require(_0x1f98('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1f98('0x4'));var interaction=require(_0x1f98('0x5'));var config=require(_0x1f98('0x6'));var controller=require(_0x1f98('0x7'));router[_0x1f98('0x8')]('/',auth[_0x1f98('0x9')](),controller['index']);router[_0x1f98('0x8')]('/:id',auth[_0x1f98('0x9')](),controller[_0x1f98('0xa')]);router['get'](_0x1f98('0xb'),auth[_0x1f98('0x9')](),controller[_0x1f98('0xc')]);router[_0x1f98('0xd')]('/',auth[_0x1f98('0x9')](),controller[_0x1f98('0xe')]);router[_0x1f98('0xd')](_0x1f98('0xb'),auth[_0x1f98('0x9')](),controller[_0x1f98('0xf')]);router['post'](_0x1f98('0x10'),auth['isAuthenticated'](),controller[_0x1f98('0x11')]);router[_0x1f98('0x12')]('/:id',auth[_0x1f98('0x9')](),controller[_0x1f98('0x13')]);router[_0x1f98('0x14')]('/:id',auth[_0x1f98('0x9')](),controller[_0x1f98('0x15')]);module['exports']=router; \ No newline at end of file +var _0x05f1=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','index','get','isAuthenticated','show','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','delete','exports','multer','util','path'];(function(_0x1dd122,_0x4dcca5){var _0x4e3713=function(_0x46577a){while(--_0x46577a){_0x1dd122['push'](_0x1dd122['shift']());}};_0x4e3713(++_0x4dcca5);}(_0x05f1,0xfa));var _0x105f=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x05f1[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x105f('0x0'));var util=require(_0x105f('0x1'));var path=require(_0x105f('0x2'));var timeout=require(_0x105f('0x3'));var express=require(_0x105f('0x4'));var router=express[_0x105f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x105f('0x6'));var interaction=require(_0x105f('0x7'));var config=require(_0x105f('0x8'));var controller=require(_0x105f('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x105f('0xa')]);router[_0x105f('0xb')]('/:id',auth[_0x105f('0xc')](),controller[_0x105f('0xd')]);router[_0x105f('0xb')]('/:id/sub_intervals',auth[_0x105f('0xc')](),controller['getIntervals']);router[_0x105f('0xe')]('/',auth[_0x105f('0xc')](),controller[_0x105f('0xf')]);router[_0x105f('0xe')](_0x105f('0x10'),auth[_0x105f('0xc')](),controller[_0x105f('0x11')]);router[_0x105f('0xe')](_0x105f('0x12'),auth[_0x105f('0xc')](),controller[_0x105f('0x13')]);router['put'](_0x105f('0x14'),auth[_0x105f('0xc')](),controller['update']);router[_0x105f('0x15')](_0x105f('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x105f('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 1d11e37..7527f74 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 _0x36cd=['exports','STRING'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x36cd,0x1cc));var _0xd36c=function(_0x3ec69d,_0xf8aade){_0x3ec69d=_0x3ec69d-0x0;var _0x394c7e=_0x36cd[_0x3ec69d];return _0x394c7e;};'use strict';var Sequelize=require('sequelize');module[_0xd36c('0x0')]={'name':{'type':Sequelize[_0xd36c('0x1')]},'description':{'type':Sequelize[_0xd36c('0x1')]},'interval':{'type':Sequelize[_0xd36c('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xdde5=['STRING','exports'];(function(_0x898654,_0x2e7d5d){var _0x6e2377=function(_0x2b8831){while(--_0x2b8831){_0x898654['push'](_0x898654['shift']());}};_0x6e2377(++_0x2e7d5d);}(_0xdde5,0x67));var _0x5dde=function(_0x4c3904,_0x56db61){_0x4c3904=_0x4c3904-0x0;var _0x44fd48=_0xdde5[_0x4c3904];return _0x44fd48;};'use strict';var Sequelize=require('sequelize');module[_0x5dde('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5dde('0x1')]},'interval':{'type':Sequelize[_0x5dde('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 85069af..532310f 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 _0x859a=['get','Intervals','UserProfileResource','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','catch','params','keys','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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','end','status','json','offset','undefined','count','limit','apply','save','update','then','destroy'];(function(_0x5de923,_0x2db5ad){var _0x32fb09=function(_0x559ec7){while(--_0x559ec7){_0x5de923['push'](_0x5de923['shift']());}};_0x32fb09(++_0x2db5ad);}(_0x859a,0x136));var _0xa859=function(_0x185d66,_0x250fe2){_0x185d66=_0x185d66-0x0;var _0x4de318=_0x859a[_0x185d66];return _0x4de318;};'use strict';var emlformat=require(_0xa859('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa859('0x1'));var jsonpatch=require(_0xa859('0x2'));var rp=require(_0xa859('0x3'));var moment=require(_0xa859('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa859('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa859('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa859('0x7'));var _=require(_0xa859('0x8'));var squel=require(_0xa859('0x9'));var crypto=require(_0xa859('0xa'));var jsforce=require(_0xa859('0xb'));var deskjs=require(_0xa859('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa859('0xd'));var Papa=require('papaparse');var Redis=require(_0xa859('0xe'));var authService=require(_0xa859('0xf'));var qs=require(_0xa859('0x10'));var as=require(_0xa859('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa859('0x12'))(_0xa859('0x13'));var utils=require(_0xa859('0x14'));var config=require(_0xa859('0x15'));var licenseUtil=require(_0xa859('0x16'));var db=require(_0xa859('0x17'))['db'];var extensions=require(_0xa859('0x18'));function respondWithStatusCode(_0x933f0,_0x41af7a){_0x41af7a=_0x41af7a||0xcc;return function(_0x53ca9b){if(_0x53ca9b){return _0x933f0[_0xa859('0x19')](_0x41af7a);}return _0x933f0['status'](_0x41af7a)[_0xa859('0x1a')]();};}function respondWithResult(_0x3dc014,_0x5ca838){_0x5ca838=_0x5ca838||0xc8;return function(_0x28d44e){if(_0x28d44e){return _0x3dc014[_0xa859('0x1b')](_0x5ca838)[_0xa859('0x1c')](_0x28d44e);}};}function respondWithFilteredResult(_0x122bfa,_0x4724e5){return function(_0x167224){if(_0x167224){var _0x9dde91=typeof _0x4724e5[_0xa859('0x1d')]===_0xa859('0x1e')&&typeof _0x4724e5['limit']==='undefined';var _0x8c1995=_0x167224[_0xa859('0x1f')];var _0x268d26=_0x9dde91?0x0:_0x4724e5[_0xa859('0x1d')];var _0x48d9aa=_0x9dde91?_0x167224[_0xa859('0x1f')]:_0x4724e5[_0xa859('0x1d')]+_0x4724e5[_0xa859('0x20')];var _0x26e11d;if(_0x48d9aa>=_0x8c1995){_0x48d9aa=_0x8c1995;_0x26e11d=0xc8;}else{_0x26e11d=0xce;}_0x122bfa[_0xa859('0x1b')](_0x26e11d);return _0x122bfa['set']('Content-Range',_0x268d26+'-'+_0x48d9aa+'/'+_0x8c1995)[_0xa859('0x1c')](_0x167224);}return null;};}function patchUpdates(_0x226625){return function(_0x21f830){try{jsonpatch[_0xa859('0x21')](_0x21f830,_0x226625,!![]);}catch(_0x14bc65){return BPromise['reject'](_0x14bc65);}return _0x21f830[_0xa859('0x22')]();};}function saveUpdates(_0x1ca902,_0x2505ef){return function(_0x2d37f7){if(_0x2d37f7){return _0x2d37f7[_0xa859('0x23')](_0x1ca902)[_0xa859('0x24')](function(_0x219faa){return _0x219faa;});}return null;};}function removeEntity(_0x382203,_0x2dddaa){return function(_0x38b60e){if(_0x38b60e){return _0x38b60e[_0xa859('0x25')]()[_0xa859('0x24')](function(){var _0x2dc5d8=_0x38b60e[_0xa859('0x26')]({'plain':!![]});var _0x2c03a4=_0xa859('0x27');return db[_0xa859('0x28')][_0xa859('0x25')]({'where':{'type':_0x2c03a4,'resourceId':_0x2dc5d8['id']}})[_0xa859('0x24')](function(){return _0x38b60e;});})[_0xa859('0x24')](function(){_0x382203['status'](0xcc)[_0xa859('0x1a')]();});}};}function handleEntityNotFound(_0x4bf9c0,_0x478da7){return function(_0x34d1a8){if(!_0x34d1a8){_0x4bf9c0[_0xa859('0x19')](0x194);}return _0x34d1a8;};}function handleError(_0x1c4035,_0x309ebf){_0x309ebf=_0x309ebf||0x1f4;return function(_0x4c9c65){logger['error'](_0x4c9c65['stack']);if(_0x4c9c65[_0xa859('0x29')]){delete _0x4c9c65[_0xa859('0x29')];}_0x1c4035['status'](_0x309ebf)[_0xa859('0x2a')](_0x4c9c65);};}exports[_0xa859('0x2b')]=function(_0x474690,_0x441809){var _0x273c2b={},_0x1292a1={},_0x3b6f39={'count':0x0,'rows':[]};var _0x432f7e=_['map'](db[_0xa859('0x2c')][_0xa859('0x2d')],function(_0x101159){return{'name':_0x101159[_0xa859('0x2e')],'type':_0x101159[_0xa859('0x2f')][_0xa859('0x30')]};});_0x1292a1[_0xa859('0x31')]=_[_0xa859('0x32')](_0x432f7e,_0xa859('0x29'));_0x1292a1[_0xa859('0x33')]=_['keys'](_0x474690['query']);_0x1292a1[_0xa859('0x34')]=_[_0xa859('0x35')](_0x1292a1[_0xa859('0x31')],_0x1292a1['query']);_0x273c2b[_0xa859('0x36')]=_[_0xa859('0x35')](_0x1292a1[_0xa859('0x31')],qs[_0xa859('0x37')](_0x474690[_0xa859('0x33')][_0xa859('0x37')]));_0x273c2b[_0xa859('0x36')]=_0x273c2b[_0xa859('0x36')][_0xa859('0x38')]?_0x273c2b[_0xa859('0x36')]:_0x1292a1[_0xa859('0x31')];if(!_0x474690[_0xa859('0x33')][_0xa859('0x39')](_0xa859('0x3a'))){_0x273c2b['limit']=qs[_0xa859('0x20')](_0x474690[_0xa859('0x33')]['limit']);_0x273c2b[_0xa859('0x1d')]=qs[_0xa859('0x1d')](_0x474690[_0xa859('0x33')][_0xa859('0x1d')]);}_0x273c2b[_0xa859('0x3b')]=qs[_0xa859('0x3c')](_0x474690[_0xa859('0x33')][_0xa859('0x3c')]);_0x273c2b[_0xa859('0x3d')]=qs[_0xa859('0x34')](_[_0xa859('0x3e')](_0x474690[_0xa859('0x33')],_0x1292a1[_0xa859('0x34')]),_0x432f7e);if(_0x474690[_0xa859('0x33')]['filter']){_0x273c2b[_0xa859('0x3d')]=_[_0xa859('0x3f')](_0x273c2b[_0xa859('0x3d')],{'$or':_[_0xa859('0x32')](_0x432f7e,function(_0x395a2a){if(_0x395a2a[_0xa859('0x2f')]!=='VIRTUAL'){var _0x5c58bb={};_0x5c58bb[_0x395a2a['name']]={'$like':'%'+_0x474690[_0xa859('0x33')][_0xa859('0x40')]+'%'};return _0x5c58bb;}})});}_0x273c2b=_[_0xa859('0x3f')]({},_0x273c2b,_0x474690['options']);var _0x56153e={'where':_0x273c2b[_0xa859('0x3d')]};return db['Interval'][_0xa859('0x1f')](_0x56153e)[_0xa859('0x24')](function(_0x284d20){_0x3b6f39[_0xa859('0x1f')]=_0x284d20;if(_0x474690[_0xa859('0x33')][_0xa859('0x41')]){_0x273c2b[_0xa859('0x42')]=[{'all':!![]}];}return db[_0xa859('0x2c')][_0xa859('0x43')](_0x273c2b);})[_0xa859('0x24')](function(_0x20cae2){_0x3b6f39['rows']=_0x20cae2;return _0x3b6f39;})[_0xa859('0x24')](respondWithFilteredResult(_0x441809,_0x273c2b))[_0xa859('0x44')](handleError(_0x441809,null));};exports['show']=function(_0x1c685b,_0x1043c9){var _0x4b01f5={'raw':!![],'where':{'id':_0x1c685b[_0xa859('0x45')]['id']}},_0xe30161={};_0xe30161['model']=_['keys'](db[_0xa859('0x2c')][_0xa859('0x2d')]);_0xe30161['query']=_[_0xa859('0x46')](_0x1c685b[_0xa859('0x33')]);_0xe30161[_0xa859('0x34')]=_[_0xa859('0x35')](_0xe30161[_0xa859('0x31')],_0xe30161['query']);_0x4b01f5[_0xa859('0x36')]=_['intersection'](_0xe30161['model'],qs[_0xa859('0x37')](_0x1c685b[_0xa859('0x33')][_0xa859('0x37')]));_0x4b01f5[_0xa859('0x36')]=_0x4b01f5[_0xa859('0x36')][_0xa859('0x38')]?_0x4b01f5['attributes']:_0xe30161[_0xa859('0x31')];if(_0x1c685b[_0xa859('0x33')][_0xa859('0x41')]){_0x4b01f5[_0xa859('0x42')]=[{'all':!![]}];}_0x4b01f5=_[_0xa859('0x3f')]({},_0x4b01f5,_0x1c685b[_0xa859('0x47')]);return db[_0xa859('0x2c')][_0xa859('0x48')](_0x4b01f5)[_0xa859('0x24')](handleEntityNotFound(_0x1043c9,null))[_0xa859('0x24')](respondWithResult(_0x1043c9,null))['catch'](handleError(_0x1043c9,null));};exports[_0xa859('0x49')]=function(_0x259529,_0x248582){return db['Interval'][_0xa859('0x49')](_0x259529[_0xa859('0x4a')],{})[_0xa859('0x24')](function(_0x5e4622){var _0x5ef8d1=_0x259529['user'][_0xa859('0x26')]({'plain':!![]});if(!_0x5ef8d1)throw new Error(_0xa859('0x4b'));if(_0x5ef8d1[_0xa859('0x4c')]==='user'){var _0x57b6b0=_0x5e4622['get']({'plain':!![]});var _0x55f6ef='Intervals';return db['UserProfileSection'][_0xa859('0x48')]({'where':{'name':_0x55f6ef,'userProfileId':_0x5ef8d1[_0xa859('0x4d')]},'raw':!![]})['then'](function(_0x155853){if(_0x155853&&_0x155853[_0xa859('0x4e')]===0x0){return db[_0xa859('0x28')][_0xa859('0x49')]({'name':_0x57b6b0[_0xa859('0x29')],'resourceId':_0x57b6b0['id'],'type':_0x155853[_0xa859('0x29')],'sectionId':_0x155853['id']},{})[_0xa859('0x24')](function(){return _0x5e4622;});}else{return _0x5e4622;}})[_0xa859('0x44')](function(_0x2ec9bb){logger[_0xa859('0x4f')](_0xa859('0x50'),_0x2ec9bb);throw _0x2ec9bb;});}return _0x5e4622;})['then'](respondWithResult(_0x248582,0xc9))[_0xa859('0x44')](handleError(_0x248582,null));};exports[_0xa859('0x23')]=function(_0x9e5c4a,_0x474337){if(_0x9e5c4a[_0xa859('0x4a')]['id']){delete _0x9e5c4a[_0xa859('0x4a')]['id'];}return db[_0xa859('0x2c')]['find']({'where':{'id':_0x9e5c4a['params']['id']}})[_0xa859('0x24')](handleEntityNotFound(_0x474337,null))['then'](saveUpdates(_0x9e5c4a[_0xa859('0x4a')],null))[_0xa859('0x24')](respondWithResult(_0x474337,null))[_0xa859('0x44')](handleError(_0x474337,null));};exports[_0xa859('0x25')]=function(_0x5e2858,_0xc5612){return db[_0xa859('0x2c')][_0xa859('0x48')]({'where':{'id':_0x5e2858[_0xa859('0x45')]['id']}})['then'](handleEntityNotFound(_0xc5612,null))[_0xa859('0x24')](removeEntity(_0xc5612,null))[_0xa859('0x44')](handleError(_0xc5612,null));};exports['addInterval']=function(_0x351305,_0x4f1292,_0xa778fa){if(_0x351305[_0xa859('0x4a')]['id']){delete _0x351305['body']['id'];}return db[_0xa859('0x2c')][_0xa859('0x48')]({'where':{'id':_0x351305[_0xa859('0x45')]['id']}})[_0xa859('0x24')](handleEntityNotFound(_0x4f1292,null))['then'](function(_0x11f094){if(_0x11f094){_0x351305[_0xa859('0x4a')][_0xa859('0x51')]=_0x11f094['id'];return db[_0xa859('0x2c')][_0xa859('0x49')](_0x351305[_0xa859('0x4a')]);}})[_0xa859('0x24')](respondWithResult(_0x4f1292,null))[_0xa859('0x44')](handleError(_0x4f1292,null));};exports[_0xa859('0x52')]=function(_0x1ff16b,_0x1e78ce,_0x5e16fa){var _0x32e1eb={};var _0x8c31c3={};var _0x1183bb;var _0x26b921;return db['Interval'][_0xa859('0x53')]({'where':{'id':_0x1ff16b[_0xa859('0x45')]['id']}})[_0xa859('0x24')](handleEntityNotFound(_0x1e78ce,null))[_0xa859('0x24')](function(_0xddb00d){if(_0xddb00d){_0x1183bb=_0xddb00d;_0x8c31c3[_0xa859('0x31')]=_['keys'](db[_0xa859('0x2c')][_0xa859('0x2d')]);_0x8c31c3[_0xa859('0x33')]=_[_0xa859('0x46')](_0x1ff16b['query']);_0x8c31c3[_0xa859('0x34')]=_[_0xa859('0x35')](_0x8c31c3['model'],_0x8c31c3[_0xa859('0x33')]);_0x32e1eb[_0xa859('0x36')]=_[_0xa859('0x35')](_0x8c31c3[_0xa859('0x31')],qs[_0xa859('0x37')](_0x1ff16b[_0xa859('0x33')][_0xa859('0x37')]));_0x32e1eb[_0xa859('0x36')]=_0x32e1eb[_0xa859('0x36')][_0xa859('0x38')]?_0x32e1eb[_0xa859('0x36')]:_0x8c31c3[_0xa859('0x31')];_0x32e1eb[_0xa859('0x3b')]=qs['sort'](_0x1ff16b[_0xa859('0x33')][_0xa859('0x3c')]);_0x32e1eb[_0xa859('0x3d')]=qs['filters'](_[_0xa859('0x3e')](_0x1ff16b[_0xa859('0x33')],_0x8c31c3[_0xa859('0x34')]));if(_0x1ff16b['query'][_0xa859('0x40')]){_0x32e1eb[_0xa859('0x3d')]=_[_0xa859('0x3f')](_0x32e1eb[_0xa859('0x3d')],{'$or':_['map'](_0x32e1eb['attributes'],function(_0xb5c750){var _0x1b8b56={};_0x1b8b56[_0xb5c750]={'$like':'%'+_0x1ff16b[_0xa859('0x33')][_0xa859('0x40')]+'%'};return _0x1b8b56;})});}_0x32e1eb=_[_0xa859('0x3f')]({},_0x32e1eb,_0x1ff16b[_0xa859('0x47')]);return _0x1183bb[_0xa859('0x52')](_0x32e1eb);}})['then'](function(_0x26c2ec){if(_0x26c2ec){_0x26b921=_0x26c2ec[_0xa859('0x38')];if(!_0x1ff16b[_0xa859('0x33')][_0xa859('0x39')]('nolimit')){_0x32e1eb[_0xa859('0x20')]=qs[_0xa859('0x20')](_0x1ff16b[_0xa859('0x33')][_0xa859('0x20')]);_0x32e1eb[_0xa859('0x1d')]=qs['offset'](_0x1ff16b[_0xa859('0x33')][_0xa859('0x1d')]);}return _0x1183bb['getIntervals'](_0x32e1eb);}})['then'](function(_0x4afc6f){if(_0x4afc6f){return _0x4afc6f?{'count':_0x26b921,'rows':_0x4afc6f}:null;}})[_0xa859('0x24')](respondWithResult(_0x1e78ce,null))[_0xa859('0x44')](handleError(_0x1e78ce,null));};exports[_0xa859('0x54')]=function(_0x3716d7,_0x31559c,_0x223887){return db[_0xa859('0x2c')][_0xa859('0x53')]({'where':{'id':_0x3716d7[_0xa859('0x45')]['id']}})[_0xa859('0x24')](handleEntityNotFound(_0x31559c,null))[_0xa859('0x24')](function(_0x2895c2){if(_0x2895c2){return db[_0xa859('0x55')][_0xa859('0x56')](function(_0x15bd59){return db[_0xa859('0x2c')][_0xa859('0x25')]({'where':{'IntervalId':_0x3716d7['params']['id']},'transaction':_0x15bd59})['then'](function(_0x2db748){var _0x8d4ee8=_[_0xa859('0x32')](_0x3716d7[_0xa859('0x4a')],function(_0x386793){delete _0x386793['id'];_0x386793[_0xa859('0x51')]=_0x3716d7[_0xa859('0x45')]['id'];return _0x386793;});return db['Interval']['bulkCreate'](_0x8d4ee8,{'transaction':_0x15bd59});});})[_0xa859('0x24')](function(){return db[_0xa859('0x2c')]['findAll']({'where':{'IntervalId':_0x3716d7['params']['id']}});});}})[_0xa859('0x24')](respondWithResult(_0x31559c,null))[_0xa859('0x44')](handleError(_0x31559c,null));}; \ No newline at end of file +var _0xe6fe=['Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','findOne','sort','getIntervals','addIntervals','sequelize','transaction','bulkCreate','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','UserProfileResource','sendStatus','error','send','index','map','Interval','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','pick','filter','merge','VIRTUAL','options','where','include','findAll','rows','catch','show','includeAll','find','create','body','user'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xe6fe,0x6c));var _0xee6f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6fe[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee6f('0x0'));var jsonpatch=require(_0xee6f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xee6f('0x2'));var Mustache=require(_0xee6f('0x3'));var util=require(_0xee6f('0x4'));var path=require(_0xee6f('0x5'));var sox=require(_0xee6f('0x6'));var csv=require(_0xee6f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee6f('0x8'));var squel=require(_0xee6f('0x9'));var crypto=require(_0xee6f('0xa'));var jsforce=require(_0xee6f('0xb'));var deskjs=require(_0xee6f('0xc'));var toCsv=require(_0xee6f('0x7'));var querystring=require(_0xee6f('0xd'));var Papa=require('papaparse');var Redis=require(_0xee6f('0xe'));var authService=require(_0xee6f('0xf'));var qs=require(_0xee6f('0x10'));var as=require(_0xee6f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee6f('0x12'))('api');var utils=require(_0xee6f('0x13'));var config=require(_0xee6f('0x14'));var licenseUtil=require(_0xee6f('0x15'));var db=require(_0xee6f('0x16'))['db'];var extensions=require(_0xee6f('0x17'));function respondWithStatusCode(_0x2f53ea,_0x5b3354){_0x5b3354=_0x5b3354||0xcc;return function(_0x3094a9){if(_0x3094a9){return _0x2f53ea['sendStatus'](_0x5b3354);}return _0x2f53ea[_0xee6f('0x18')](_0x5b3354)[_0xee6f('0x19')]();};}function respondWithResult(_0x33896a,_0x15904c){_0x15904c=_0x15904c||0xc8;return function(_0x18cb9a){if(_0x18cb9a){return _0x33896a[_0xee6f('0x18')](_0x15904c)[_0xee6f('0x1a')](_0x18cb9a);}};}function respondWithFilteredResult(_0x1e0221,_0x31ed19){return function(_0xc513b){if(_0xc513b){var _0x3a0793=typeof _0x31ed19[_0xee6f('0x1b')]===_0xee6f('0x1c')&&typeof _0x31ed19['limit']==='undefined';var _0x20ec40=_0xc513b[_0xee6f('0x1d')];var _0x1c0da0=_0x3a0793?0x0:_0x31ed19[_0xee6f('0x1b')];var _0x46fd12=_0x3a0793?_0xc513b[_0xee6f('0x1d')]:_0x31ed19[_0xee6f('0x1b')]+_0x31ed19['limit'];var _0x585a5d;if(_0x46fd12>=_0x20ec40){_0x46fd12=_0x20ec40;_0x585a5d=0xc8;}else{_0x585a5d=0xce;}_0x1e0221[_0xee6f('0x18')](_0x585a5d);return _0x1e0221['set'](_0xee6f('0x1e'),_0x1c0da0+'-'+_0x46fd12+'/'+_0x20ec40)[_0xee6f('0x1a')](_0xc513b);}return null;};}function patchUpdates(_0x4a653c){return function(_0x388fe5){try{jsonpatch[_0xee6f('0x1f')](_0x388fe5,_0x4a653c,!![]);}catch(_0x79daa7){return BPromise[_0xee6f('0x20')](_0x79daa7);}return _0x388fe5['save']();};}function saveUpdates(_0x46e4a6,_0x3fd138){return function(_0xbe1ac2){if(_0xbe1ac2){return _0xbe1ac2[_0xee6f('0x21')](_0x46e4a6)[_0xee6f('0x22')](function(_0x44f9fe){return _0x44f9fe;});}return null;};}function removeEntity(_0x246f88,_0x5920ed){return function(_0x38f55d){if(_0x38f55d){return _0x38f55d[_0xee6f('0x23')]()[_0xee6f('0x22')](function(){var _0x2a8510=_0x38f55d['get']({'plain':!![]});var _0x2f9375='Intervals';return db[_0xee6f('0x24')]['destroy']({'where':{'type':_0x2f9375,'resourceId':_0x2a8510['id']}})[_0xee6f('0x22')](function(){return _0x38f55d;});})[_0xee6f('0x22')](function(){_0x246f88['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40e8df,_0x47bab9){return function(_0x106c83){if(!_0x106c83){_0x40e8df[_0xee6f('0x25')](0x194);}return _0x106c83;};}function handleError(_0x4147e4,_0x14a714){_0x14a714=_0x14a714||0x1f4;return function(_0x4f961d){logger[_0xee6f('0x26')](_0x4f961d['stack']);if(_0x4f961d['name']){delete _0x4f961d['name'];}_0x4147e4[_0xee6f('0x18')](_0x14a714)[_0xee6f('0x27')](_0x4f961d);};}exports[_0xee6f('0x28')]=function(_0x5271d2,_0x1903d5){var _0x37502d={},_0x21bcae={},_0xf6584f={'count':0x0,'rows':[]};var _0x5994d5=_[_0xee6f('0x29')](db[_0xee6f('0x2a')][_0xee6f('0x2b')],function(_0x595ae1){return{'name':_0x595ae1[_0xee6f('0x2c')],'type':_0x595ae1[_0xee6f('0x2d')]['key']};});_0x21bcae['model']=_['map'](_0x5994d5,'name');_0x21bcae['query']=_[_0xee6f('0x2e')](_0x5271d2[_0xee6f('0x2f')]);_0x21bcae[_0xee6f('0x30')]=_[_0xee6f('0x31')](_0x21bcae[_0xee6f('0x32')],_0x21bcae[_0xee6f('0x2f')]);_0x37502d[_0xee6f('0x33')]=_[_0xee6f('0x31')](_0x21bcae[_0xee6f('0x32')],qs['fields'](_0x5271d2[_0xee6f('0x2f')][_0xee6f('0x34')]));_0x37502d[_0xee6f('0x33')]=_0x37502d['attributes'][_0xee6f('0x35')]?_0x37502d[_0xee6f('0x33')]:_0x21bcae[_0xee6f('0x32')];if(!_0x5271d2['query'][_0xee6f('0x36')](_0xee6f('0x37'))){_0x37502d[_0xee6f('0x38')]=qs[_0xee6f('0x38')](_0x5271d2['query'][_0xee6f('0x38')]);_0x37502d[_0xee6f('0x1b')]=qs[_0xee6f('0x1b')](_0x5271d2['query']['offset']);}_0x37502d[_0xee6f('0x39')]=qs['sort'](_0x5271d2[_0xee6f('0x2f')]['sort']);_0x37502d['where']=qs[_0xee6f('0x30')](_[_0xee6f('0x3a')](_0x5271d2[_0xee6f('0x2f')],_0x21bcae[_0xee6f('0x30')]),_0x5994d5);if(_0x5271d2[_0xee6f('0x2f')][_0xee6f('0x3b')]){_0x37502d['where']=_[_0xee6f('0x3c')](_0x37502d['where'],{'$or':_[_0xee6f('0x29')](_0x5994d5,function(_0xf5eec8){if(_0xf5eec8[_0xee6f('0x2d')]!==_0xee6f('0x3d')){var _0x6a2050={};_0x6a2050[_0xf5eec8['name']]={'$like':'%'+_0x5271d2[_0xee6f('0x2f')]['filter']+'%'};return _0x6a2050;}})});}_0x37502d=_['merge']({},_0x37502d,_0x5271d2[_0xee6f('0x3e')]);var _0x17e4b5={'where':_0x37502d[_0xee6f('0x3f')]};return db[_0xee6f('0x2a')][_0xee6f('0x1d')](_0x17e4b5)['then'](function(_0x35586f){_0xf6584f[_0xee6f('0x1d')]=_0x35586f;if(_0x5271d2[_0xee6f('0x2f')]['includeAll']){_0x37502d[_0xee6f('0x40')]=[{'all':!![]}];}return db[_0xee6f('0x2a')][_0xee6f('0x41')](_0x37502d);})['then'](function(_0x1ab0e2){_0xf6584f[_0xee6f('0x42')]=_0x1ab0e2;return _0xf6584f;})['then'](respondWithFilteredResult(_0x1903d5,_0x37502d))[_0xee6f('0x43')](handleError(_0x1903d5,null));};exports[_0xee6f('0x44')]=function(_0x33dfc6,_0x490fe0){var _0x4a1317={'raw':!![],'where':{'id':_0x33dfc6['params']['id']}},_0x1ce158={};_0x1ce158[_0xee6f('0x32')]=_[_0xee6f('0x2e')](db['Interval'][_0xee6f('0x2b')]);_0x1ce158[_0xee6f('0x2f')]=_[_0xee6f('0x2e')](_0x33dfc6['query']);_0x1ce158['filters']=_['intersection'](_0x1ce158[_0xee6f('0x32')],_0x1ce158['query']);_0x4a1317[_0xee6f('0x33')]=_['intersection'](_0x1ce158[_0xee6f('0x32')],qs['fields'](_0x33dfc6[_0xee6f('0x2f')][_0xee6f('0x34')]));_0x4a1317[_0xee6f('0x33')]=_0x4a1317['attributes'][_0xee6f('0x35')]?_0x4a1317[_0xee6f('0x33')]:_0x1ce158[_0xee6f('0x32')];if(_0x33dfc6['query'][_0xee6f('0x45')]){_0x4a1317[_0xee6f('0x40')]=[{'all':!![]}];}_0x4a1317=_['merge']({},_0x4a1317,_0x33dfc6[_0xee6f('0x3e')]);return db[_0xee6f('0x2a')][_0xee6f('0x46')](_0x4a1317)['then'](handleEntityNotFound(_0x490fe0,null))[_0xee6f('0x22')](respondWithResult(_0x490fe0,null))[_0xee6f('0x43')](handleError(_0x490fe0,null));};exports[_0xee6f('0x47')]=function(_0x556f7c,_0x13d410){return db[_0xee6f('0x2a')]['create'](_0x556f7c[_0xee6f('0x48')],{})[_0xee6f('0x22')](function(_0x34f209){var _0x413943=_0x556f7c[_0xee6f('0x49')]['get']({'plain':!![]});if(!_0x413943)throw new Error(_0xee6f('0x4a'));if(_0x413943['role']==='user'){var _0xa7bc59=_0x34f209[_0xee6f('0x4b')]({'plain':!![]});var _0x7a0ce='Intervals';return db[_0xee6f('0x4c')][_0xee6f('0x46')]({'where':{'name':_0x7a0ce,'userProfileId':_0x413943[_0xee6f('0x4d')]},'raw':!![]})[_0xee6f('0x22')](function(_0x30be53){if(_0x30be53&&_0x30be53[_0xee6f('0x4e')]===0x0){return db[_0xee6f('0x24')][_0xee6f('0x47')]({'name':_0xa7bc59[_0xee6f('0x4f')],'resourceId':_0xa7bc59['id'],'type':_0x30be53['name'],'sectionId':_0x30be53['id']},{})['then'](function(){return _0x34f209;});}else{return _0x34f209;}})[_0xee6f('0x43')](function(_0x217907){logger[_0xee6f('0x26')](_0xee6f('0x50'),_0x217907);throw _0x217907;});}return _0x34f209;})[_0xee6f('0x22')](respondWithResult(_0x13d410,0xc9))['catch'](handleError(_0x13d410,null));};exports['update']=function(_0x1bdd7c,_0x5c6478){if(_0x1bdd7c['body']['id']){delete _0x1bdd7c[_0xee6f('0x48')]['id'];}return db[_0xee6f('0x2a')][_0xee6f('0x46')]({'where':{'id':_0x1bdd7c['params']['id']}})[_0xee6f('0x22')](handleEntityNotFound(_0x5c6478,null))[_0xee6f('0x22')](saveUpdates(_0x1bdd7c[_0xee6f('0x48')],null))[_0xee6f('0x22')](respondWithResult(_0x5c6478,null))[_0xee6f('0x43')](handleError(_0x5c6478,null));};exports['destroy']=function(_0x596b88,_0x3aeecf){return db[_0xee6f('0x2a')][_0xee6f('0x46')]({'where':{'id':_0x596b88[_0xee6f('0x51')]['id']}})[_0xee6f('0x22')](handleEntityNotFound(_0x3aeecf,null))[_0xee6f('0x22')](removeEntity(_0x3aeecf,null))['catch'](handleError(_0x3aeecf,null));};exports[_0xee6f('0x52')]=function(_0x5a073e,_0x1fa837,_0x210e0e){if(_0x5a073e[_0xee6f('0x48')]['id']){delete _0x5a073e[_0xee6f('0x48')]['id'];}return db['Interval'][_0xee6f('0x46')]({'where':{'id':_0x5a073e[_0xee6f('0x51')]['id']}})[_0xee6f('0x22')](handleEntityNotFound(_0x1fa837,null))['then'](function(_0x8c1f58){if(_0x8c1f58){_0x5a073e[_0xee6f('0x48')][_0xee6f('0x53')]=_0x8c1f58['id'];return db['Interval'][_0xee6f('0x47')](_0x5a073e[_0xee6f('0x48')]);}})['then'](respondWithResult(_0x1fa837,null))[_0xee6f('0x43')](handleError(_0x1fa837,null));};exports['getIntervals']=function(_0x33025f,_0x47b656,_0x10d816){var _0x2e8103={};var _0xf37dc3={};var _0x109457;var _0x3b225f;return db[_0xee6f('0x2a')][_0xee6f('0x54')]({'where':{'id':_0x33025f[_0xee6f('0x51')]['id']}})['then'](handleEntityNotFound(_0x47b656,null))['then'](function(_0x459e97){if(_0x459e97){_0x109457=_0x459e97;_0xf37dc3[_0xee6f('0x32')]=_[_0xee6f('0x2e')](db[_0xee6f('0x2a')][_0xee6f('0x2b')]);_0xf37dc3['query']=_[_0xee6f('0x2e')](_0x33025f[_0xee6f('0x2f')]);_0xf37dc3[_0xee6f('0x30')]=_[_0xee6f('0x31')](_0xf37dc3['model'],_0xf37dc3[_0xee6f('0x2f')]);_0x2e8103[_0xee6f('0x33')]=_[_0xee6f('0x31')](_0xf37dc3[_0xee6f('0x32')],qs[_0xee6f('0x34')](_0x33025f['query'][_0xee6f('0x34')]));_0x2e8103[_0xee6f('0x33')]=_0x2e8103[_0xee6f('0x33')][_0xee6f('0x35')]?_0x2e8103[_0xee6f('0x33')]:_0xf37dc3['model'];_0x2e8103[_0xee6f('0x39')]=qs[_0xee6f('0x55')](_0x33025f[_0xee6f('0x2f')][_0xee6f('0x55')]);_0x2e8103['where']=qs[_0xee6f('0x30')](_[_0xee6f('0x3a')](_0x33025f[_0xee6f('0x2f')],_0xf37dc3[_0xee6f('0x30')]));if(_0x33025f[_0xee6f('0x2f')][_0xee6f('0x3b')]){_0x2e8103[_0xee6f('0x3f')]=_[_0xee6f('0x3c')](_0x2e8103[_0xee6f('0x3f')],{'$or':_[_0xee6f('0x29')](_0x2e8103[_0xee6f('0x33')],function(_0x770c39){var _0x3ae6bb={};_0x3ae6bb[_0x770c39]={'$like':'%'+_0x33025f['query'][_0xee6f('0x3b')]+'%'};return _0x3ae6bb;})});}_0x2e8103=_[_0xee6f('0x3c')]({},_0x2e8103,_0x33025f[_0xee6f('0x3e')]);return _0x109457['getIntervals'](_0x2e8103);}})[_0xee6f('0x22')](function(_0x470cae){if(_0x470cae){_0x3b225f=_0x470cae[_0xee6f('0x35')];if(!_0x33025f[_0xee6f('0x2f')][_0xee6f('0x36')](_0xee6f('0x37'))){_0x2e8103['limit']=qs[_0xee6f('0x38')](_0x33025f[_0xee6f('0x2f')]['limit']);_0x2e8103[_0xee6f('0x1b')]=qs[_0xee6f('0x1b')](_0x33025f['query']['offset']);}return _0x109457[_0xee6f('0x56')](_0x2e8103);}})[_0xee6f('0x22')](function(_0x2cda8d){if(_0x2cda8d){return _0x2cda8d?{'count':_0x3b225f,'rows':_0x2cda8d}:null;}})[_0xee6f('0x22')](respondWithResult(_0x47b656,null))[_0xee6f('0x43')](handleError(_0x47b656,null));};exports[_0xee6f('0x57')]=function(_0x562729,_0x4dfa1f,_0x4ff79a){return db[_0xee6f('0x2a')]['findOne']({'where':{'id':_0x562729[_0xee6f('0x51')]['id']}})[_0xee6f('0x22')](handleEntityNotFound(_0x4dfa1f,null))['then'](function(_0x3c784f){if(_0x3c784f){return db[_0xee6f('0x58')][_0xee6f('0x59')](function(_0x143c5b){return db['Interval'][_0xee6f('0x23')]({'where':{'IntervalId':_0x562729[_0xee6f('0x51')]['id']},'transaction':_0x143c5b})[_0xee6f('0x22')](function(_0x53d504){var _0x5ee135=_[_0xee6f('0x29')](_0x562729[_0xee6f('0x48')],function(_0x1882ca){delete _0x1882ca['id'];_0x1882ca['IntervalId']=_0x562729[_0xee6f('0x51')]['id'];return _0x1882ca;});return db[_0xee6f('0x2a')][_0xee6f('0x5a')](_0x5ee135,{'transaction':_0x143c5b});});})[_0xee6f('0x22')](function(){return db[_0xee6f('0x2a')][_0xee6f('0x41')]({'where':{'IntervalId':_0x562729['params']['id']}});});}})[_0xee6f('0x22')](respondWithResult(_0x4dfa1f,null))[_0xee6f('0x43')](handleError(_0x4dfa1f,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index b9209b1..1a34f65 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 _0x8a8c=['request-promise','path','../../config/environment','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','bluebird'];(function(_0x2c0467,_0x1b83aa){var _0x2b999b=function(_0x18275d){while(--_0x18275d){_0x2c0467['push'](_0x2c0467['shift']());}};_0x2b999b(++_0x1b83aa);}(_0x8a8c,0x1a0));var _0xc8a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a8c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a8('0x0'));var util=require(_0xc8a8('0x1'));var logger=require(_0xc8a8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc8a8('0x3'));var rp=require(_0xc8a8('0x4'));var fs=require('fs');var path=require(_0xc8a8('0x5'));var rimraf=require('rimraf');var config=require(_0xc8a8('0x6'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0xc8a8('0x7')]=function(_0xdda027,_0xd60f2f){return _0xdda027[_0xc8a8('0x8')](_0xc8a8('0x9'),attributes,{'tableName':_0xc8a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x468160,_0x38f3bb){extensions[_0xc8a8('0xb')](_0xdda027,_0x468160);},'afterBulkCreate':function(_0x4232f9,_0x19647b,_0x3af1a8){_0x3af1a8();extensions['rewrite'](_0xdda027,_0x4232f9[0x0]);},'afterUpdate':function(_0x4772a0,_0x37bb4e){extensions[_0xc8a8('0xb')](_0xdda027,_0x4772a0);},'afterDestroy':function(_0x193095,_0xe3e057){extensions[_0xc8a8('0xb')](_0xdda027,_0x193095);}}});}; \ No newline at end of file +var _0xe430=['path','rimraf','../../config/environment','define','tools_intervals','rewrite','lodash','util','../../config/logger','api','request-promise'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0xe430,0x171));var _0x0e43=function(_0x482c63,_0x289846){_0x482c63=_0x482c63-0x0;var _0x13cdb6=_0xe430[_0x482c63];return _0x13cdb6;};'use strict';var _=require(_0x0e43('0x0'));var util=require(_0x0e43('0x1'));var logger=require(_0x0e43('0x2'))(_0x0e43('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0e43('0x4'));var fs=require('fs');var path=require(_0x0e43('0x5'));var rimraf=require(_0x0e43('0x6'));var config=require(_0x0e43('0x7'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x5ab651,_0x5bc5ac){return _0x5ab651[_0x0e43('0x8')]('Interval',attributes,{'tableName':_0x0e43('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x361f8b,_0x77fb11){extensions[_0x0e43('0xa')](_0x5ab651,_0x361f8b);},'afterBulkCreate':function(_0xbdcc1,_0x32ca28,_0x2afebc){_0x2afebc();extensions[_0x0e43('0xa')](_0x5ab651,_0xbdcc1[0x0]);},'afterUpdate':function(_0x258e56,_0x18818c){extensions[_0x0e43('0xa')](_0x5ab651,_0x258e56);},'afterDestroy':function(_0x49a91a,_0x5186a2){extensions['rewrite'](_0x5ab651,_0x49a91a);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 26acf1f..2a2e3e4 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(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_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 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(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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 d180626..04665d1 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 _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb10b,0x12a));var _0xbb10=function(_0x19efbc,_0x10b7d7){_0x19efbc=_0x19efbc-0x0;var _0x205c5e=_0xb10b[_0x19efbc];return _0x205c5e;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x216c08,_0x4bea18){var _0x4731dd=function(_0x427360){while(--_0x427360){_0x216c08['push'](_0x216c08['shift']());}};_0x4731dd(++_0x4bea18);}(_0xdb28,0x106));var _0x8db2=function(_0x335edf,_0x3a2d73){_0x335edf=_0x335edf-0x0;var _0x9733e5=_0xdb28[_0x335edf];return _0x9733e5;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 27945df..81af71d 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 _0xd606=['connection','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','Report','stringify','issuetype','Bug','fields','customfield_11500','email','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','Basic\x20','toString','base64','request','setEncoding','utf8','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket'];(function(_0x35290b,_0x4ec7f8){var _0x523384=function(_0x107c39){while(--_0x107c39){_0x35290b['push'](_0x35290b['shift']());}};_0x523384(++_0x4ec7f8);}(_0xd606,0x135));var _0x6d60=function(_0x439bed,_0x56a7f0){_0x439bed=_0x439bed-0x0;var _0x10edc0=_0xd606[_0x439bed];return _0x10edc0;};'use strict';var BPromise=require(_0x6d60('0x0'));var https=require(_0x6d60('0x1'));var logger=require('../../config/logger')(_0x6d60('0x2'));var USERNAME=_0x6d60('0x3');var PASSWORD=_0x6d60('0x4');function openIssue(_0x45807d,_0x274f35){var _0x1de455={'fields':{'project':{'key':_0x45807d[_0x6d60('0x5')]||_0x6d60('0x6')},'summary':(_0x45807d['summary']||_0x6d60('0x7'))+'\x20from\x20'+_0x45807d['ip'],'description':_0x45807d['description']||JSON[_0x6d60('0x8')](_0x45807d),'issuetype':{'name':_0x45807d[_0x6d60('0x9')]||_0x6d60('0xa')}}};_0x1de455[_0x6d60('0xb')][_0x6d60('0xc')]=_0x45807d[_0x6d60('0xd')];_0x1de455['fields']['customfield_11501']=_0x45807d[_0x6d60('0xe')];_0x1de455[_0x6d60('0xb')][_0x6d60('0xf')]=_0x45807d[_0x6d60('0x10')];_0x1de455[_0x6d60('0xb')][_0x6d60('0x11')]=_0x45807d[_0x6d60('0x12')];_0x1de455[_0x6d60('0xb')][_0x6d60('0x13')]=_0x45807d[_0x6d60('0x14')];_0x1de455['fields'][_0x6d60('0x15')]=_0x45807d['ip'];var _0x5002d2={'host':_0x6d60('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x6d60('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x6d60('0x18')](_0x6d60('0x19'))}};var _0x1818fb=JSON[_0x6d60('0x8')](_0x1de455);var _0x42c8cc=https[_0x6d60('0x1a')](_0x5002d2,function(_0x20e503){_0x20e503[_0x6d60('0x1b')](_0x6d60('0x1c'));var _0x230dfa='';_0x20e503['on']('data',function(_0x133534){_0x230dfa+=_0x133534;});_0x20e503['on'](_0x6d60('0x1d'),function(){if(_0x274f35){return _0x274f35[_0x6d60('0x1e')](_0x20e503[_0x6d60('0x1f')])[_0x6d60('0x20')](JSON[_0x6d60('0x21')](_0x230dfa));}});});_0x42c8cc['on']('error',function(_0x2be7d8){if(_0x274f35){return _0x274f35[_0x6d60('0x1e')](0x1f4)[_0x6d60('0x20')]({'errors':[{'message':_0x6d60('0x22'),'type':_0x6d60('0x23')}]});}});_0x42c8cc['write'](_0x1818fb);_0x42c8cc[_0x6d60('0x1d')]();}exports[_0x6d60('0x24')]=openIssue;exports[_0x6d60('0x25')]=function(_0x381463,_0x59ad5a){_0x381463[_0x6d60('0x26')]['ip']=_0x381463[_0x6d60('0x27')][_0x6d60('0x28')]||_0x381463['connection'][_0x6d60('0x29')]||_0x381463[_0x6d60('0x2a')][_0x6d60('0x29')]||_0x381463[_0x6d60('0x2b')][_0x6d60('0x2a')]['remoteAddress'];return openIssue(_0x381463[_0x6d60('0x26')],_0x59ad5a);}; \ No newline at end of file +var _0xaef3=['connection','socket','body','bluebird','https','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','customfield_10102','/rest/api/2/issue','POST','Basic\x20','toString','base64','setEncoding','data','end','status','statusCode','json','parse','error','api.jira','openIssue','send','headers','x-forwarded-for','remoteAddress'];(function(_0x2daddd,_0x1f6d29){var _0x5ed9bd=function(_0x38510b){while(--_0x38510b){_0x2daddd['push'](_0x2daddd['shift']());}};_0x5ed9bd(++_0x1f6d29);}(_0xaef3,0xdf));var _0x3aef=function(_0x4a209a,_0x575ff9){_0x4a209a=_0x4a209a-0x0;var _0x4b3c20=_0xaef3[_0x4a209a];return _0x4b3c20;};'use strict';var BPromise=require(_0x3aef('0x0'));var https=require(_0x3aef('0x1'));var logger=require(_0x3aef('0x2'))('api');var USERNAME='support';var PASSWORD=_0x3aef('0x3');function openIssue(_0x529fe6,_0x13cd51){var _0x449c9b={'fields':{'project':{'key':_0x529fe6[_0x3aef('0x4')]||_0x3aef('0x5')},'summary':(_0x529fe6[_0x3aef('0x6')]||_0x3aef('0x7'))+_0x3aef('0x8')+_0x529fe6['ip'],'description':_0x529fe6[_0x3aef('0x9')]||JSON[_0x3aef('0xa')](_0x529fe6),'issuetype':{'name':_0x529fe6[_0x3aef('0xb')]||_0x3aef('0xc')}}};_0x449c9b['fields'][_0x3aef('0xd')]=_0x529fe6[_0x3aef('0xe')];_0x449c9b[_0x3aef('0xf')][_0x3aef('0x10')]=_0x529fe6[_0x3aef('0x11')];_0x449c9b[_0x3aef('0xf')][_0x3aef('0x12')]=_0x529fe6[_0x3aef('0x13')];_0x449c9b[_0x3aef('0xf')]['customfield_11503']=_0x529fe6['name'];_0x449c9b['fields'][_0x3aef('0x14')]=_0x529fe6['reason'];_0x449c9b['fields'][_0x3aef('0x15')]=_0x529fe6['ip'];var _0x30787c={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3aef('0x16'),'method':_0x3aef('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x3aef('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x3aef('0x19')](_0x3aef('0x1a'))}};var _0x2a0aab=JSON['stringify'](_0x449c9b);var _0x3ead7=https['request'](_0x30787c,function(_0x5c07cf){_0x5c07cf[_0x3aef('0x1b')]('utf8');var _0x55d70='';_0x5c07cf['on'](_0x3aef('0x1c'),function(_0x17ae6f){_0x55d70+=_0x17ae6f;});_0x5c07cf['on'](_0x3aef('0x1d'),function(){if(_0x13cd51){return _0x13cd51[_0x3aef('0x1e')](_0x5c07cf[_0x3aef('0x1f')])[_0x3aef('0x20')](JSON[_0x3aef('0x21')](_0x55d70));}});});_0x3ead7['on'](_0x3aef('0x22'),function(_0x1fca0c){if(_0x13cd51){return _0x13cd51[_0x3aef('0x1e')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x3aef('0x23')}]});}});_0x3ead7['write'](_0x2a0aab);_0x3ead7[_0x3aef('0x1d')]();}exports[_0x3aef('0x24')]=openIssue;exports[_0x3aef('0x25')]=function(_0x3c307f,_0xf18273){_0x3c307f['body']['ip']=_0x3c307f[_0x3aef('0x26')][_0x3aef('0x27')]||_0x3c307f['connection'][_0x3aef('0x28')]||_0x3c307f['socket'][_0x3aef('0x28')]||_0x3c307f[_0x3aef('0x29')][_0x3aef('0x2a')][_0x3aef('0x28')];return openIssue(_0x3c307f[_0x3aef('0x2b')],_0xf18273);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 8bd7df3..d195771 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 _0xa74f=['/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get'];(function(_0x2345cc,_0x61aa6b){var _0x538643=function(_0x2a4c12){while(--_0x2a4c12){_0x2345cc['push'](_0x2345cc['shift']());}};_0x538643(++_0x61aa6b);}(_0xa74f,0x9a));var _0xfa74=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0xa74f[_0x2bf466];return _0x856885;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var fs_extra=require(_0xfa74('0x2'));var auth=require(_0xfa74('0x3'));var interaction=require(_0xfa74('0x4'));var config=require('../../config/environment');var controller=require(_0xfa74('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x7')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router[_0xfa74('0xc')]('/',auth[_0xfa74('0x9')](),controller['create']);router[_0xfa74('0xd')](_0xfa74('0xe'),auth['isAuthenticated'](),controller[_0xfa74('0xf')]);router[_0xfa74('0x10')](_0xfa74('0xe'),auth[_0xfa74('0x9')](),controller['destroy']);module[_0xfa74('0x11')]=router; \ No newline at end of file +var _0x6324=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','exports','multer','util'];(function(_0x3b8831,_0x2a73d2){var _0x3d059a=function(_0x18af50){while(--_0x18af50){_0x3b8831['push'](_0x3b8831['shift']());}};_0x3d059a(++_0x2a73d2);}(_0x6324,0x142));var _0x4632=function(_0x29b564,_0x2d95bd){_0x29b564=_0x29b564-0x0;var _0xae0676=_0x6324[_0x29b564];return _0xae0676;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller[_0x4632('0xf')]);router[_0x4632('0x10')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller['destroy']);module[_0x4632('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 1c9311b..6f01e80 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(_0x361c41,_0x5a87c2){_0x361c41=_0x361c41-0x0;var _0xeba087=_0x7a54[_0x361c41];return _0xeba087;};'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(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x3d8d54,_0x24b536){_0x3d8d54=_0x3d8d54-0x0;var _0x31c3d0=_0x7a54[_0x3d8d54];return _0x31c3d0;};'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 bcb114c..92e9981 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 _0xdcc4=['params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','JscriptyAnswerReport','includeAll','include','findAll','show'];(function(_0x533c1d,_0x5604c5){var _0x2f9e1c=function(_0x3764d0){while(--_0x3764d0){_0x533c1d['push'](_0x533c1d['shift']());}};_0x2f9e1c(++_0x5604c5);}(_0xdcc4,0xea));var _0x4dcc=function(_0x1ad81a,_0x52afad){_0x1ad81a=_0x1ad81a-0x0;var _0x499832=_0xdcc4[_0x1ad81a];return _0x499832;};'use strict';var emlformat=require(_0x4dcc('0x0'));var rimraf=require(_0x4dcc('0x1'));var zipdir=require(_0x4dcc('0x2'));var jsonpatch=require(_0x4dcc('0x3'));var rp=require(_0x4dcc('0x4'));var moment=require('moment');var BPromise=require(_0x4dcc('0x5'));var Mustache=require(_0x4dcc('0x6'));var util=require(_0x4dcc('0x7'));var path=require(_0x4dcc('0x8'));var sox=require(_0x4dcc('0x9'));var csv=require(_0x4dcc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4dcc('0xb'));var _=require('lodash');var squel=require(_0x4dcc('0xc'));var crypto=require(_0x4dcc('0xd'));var jsforce=require(_0x4dcc('0xe'));var deskjs=require(_0x4dcc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4dcc('0x10'));var Papa=require(_0x4dcc('0x11'));var Redis=require(_0x4dcc('0x12'));var authService=require(_0x4dcc('0x13'));var qs=require(_0x4dcc('0x14'));var as=require(_0x4dcc('0x15'));var hardwareService=require(_0x4dcc('0x16'));var logger=require(_0x4dcc('0x17'))('api');var utils=require(_0x4dcc('0x18'));var config=require(_0x4dcc('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4dcc('0x1a'))['db'];function respondWithStatusCode(_0x20013a,_0x49cfbb){_0x49cfbb=_0x49cfbb||0xcc;return function(_0x5cc1d1){if(_0x5cc1d1){return _0x20013a[_0x4dcc('0x1b')](_0x49cfbb);}return _0x20013a[_0x4dcc('0x1c')](_0x49cfbb)[_0x4dcc('0x1d')]();};}function respondWithResult(_0xa28755,_0x3760c9){_0x3760c9=_0x3760c9||0xc8;return function(_0x62a437){if(_0x62a437){return _0xa28755[_0x4dcc('0x1c')](_0x3760c9)['json'](_0x62a437);}};}function respondWithFilteredResult(_0x4cb7f0,_0x26c28c){return function(_0x407072){if(_0x407072){var _0xde3a5f=typeof _0x26c28c[_0x4dcc('0x1e')]===_0x4dcc('0x1f')&&typeof _0x26c28c['limit']===_0x4dcc('0x1f');var _0x387523=_0x407072['count'];var _0x4ba591=_0xde3a5f?0x0:_0x26c28c['offset'];var _0x418392=_0xde3a5f?_0x407072[_0x4dcc('0x20')]:_0x26c28c['offset']+_0x26c28c[_0x4dcc('0x21')];var _0x3fbb60;if(_0x418392>=_0x387523){_0x418392=_0x387523;_0x3fbb60=0xc8;}else{_0x3fbb60=0xce;}_0x4cb7f0[_0x4dcc('0x1c')](_0x3fbb60);return _0x4cb7f0['set'](_0x4dcc('0x22'),_0x4ba591+'-'+_0x418392+'/'+_0x387523)[_0x4dcc('0x23')](_0x407072);}return null;};}function patchUpdates(_0x39209e){return function(_0x2eb5ec){try{jsonpatch[_0x4dcc('0x24')](_0x2eb5ec,_0x39209e,!![]);}catch(_0x444387){return BPromise[_0x4dcc('0x25')](_0x444387);}return _0x2eb5ec[_0x4dcc('0x26')]();};}function saveUpdates(_0x1b2834,_0x1ed6d0){return function(_0x235f4f){if(_0x235f4f){return _0x235f4f[_0x4dcc('0x27')](_0x1b2834)[_0x4dcc('0x28')](function(_0x9007cc){return _0x9007cc;});}return null;};}function removeEntity(_0xdeab92,_0xc1c37b){return function(_0x537f32){if(_0x537f32){return _0x537f32[_0x4dcc('0x29')]()[_0x4dcc('0x28')](function(){_0xdeab92[_0x4dcc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35470e,_0x589149){return function(_0x3a548a){if(!_0x3a548a){_0x35470e[_0x4dcc('0x1b')](0x194);}return _0x3a548a;};}function handleError(_0x558419,_0x3853ae){_0x3853ae=_0x3853ae||0x1f4;return function(_0x2afff8){logger['error'](_0x2afff8[_0x4dcc('0x2a')]);if(_0x2afff8[_0x4dcc('0x2b')]){delete _0x2afff8['name'];}_0x558419['status'](_0x3853ae)[_0x4dcc('0x2c')](_0x2afff8);};}exports[_0x4dcc('0x2d')]=function(_0x160805,_0x562d1f){var _0x30c617={},_0x5c2464={},_0x2ffac7={'count':0x0,'rows':[]};var _0x279524=_[_0x4dcc('0x2e')](db['JscriptyAnswerReport'][_0x4dcc('0x2f')],function(_0x4dd2e6){return{'name':_0x4dd2e6['fieldName'],'type':_0x4dd2e6[_0x4dcc('0x30')]['key']};});_0x5c2464[_0x4dcc('0x31')]=_[_0x4dcc('0x2e')](_0x279524,_0x4dcc('0x2b'));_0x5c2464[_0x4dcc('0x32')]=_[_0x4dcc('0x33')](_0x160805[_0x4dcc('0x32')]);_0x5c2464[_0x4dcc('0x34')]=_[_0x4dcc('0x35')](_0x5c2464[_0x4dcc('0x31')],_0x5c2464[_0x4dcc('0x32')]);_0x30c617[_0x4dcc('0x36')]=_['intersection'](_0x5c2464['model'],qs[_0x4dcc('0x37')](_0x160805['query'][_0x4dcc('0x37')]));_0x30c617[_0x4dcc('0x36')]=_0x30c617[_0x4dcc('0x36')][_0x4dcc('0x38')]?_0x30c617[_0x4dcc('0x36')]:_0x5c2464[_0x4dcc('0x31')];if(!_0x160805[_0x4dcc('0x32')][_0x4dcc('0x39')]('nolimit')){_0x30c617[_0x4dcc('0x21')]=qs['limit'](_0x160805[_0x4dcc('0x32')]['limit']);_0x30c617[_0x4dcc('0x1e')]=qs['offset'](_0x160805[_0x4dcc('0x32')][_0x4dcc('0x1e')]);}_0x30c617[_0x4dcc('0x3a')]=qs[_0x4dcc('0x3b')](_0x160805[_0x4dcc('0x32')]['sort']);_0x30c617[_0x4dcc('0x3c')]=qs['filters'](_[_0x4dcc('0x3d')](_0x160805[_0x4dcc('0x32')],_0x5c2464[_0x4dcc('0x34')]),_0x279524);if(_0x160805[_0x4dcc('0x32')][_0x4dcc('0x3e')]){_0x30c617[_0x4dcc('0x3c')]=_[_0x4dcc('0x3f')](_0x30c617[_0x4dcc('0x3c')],{'$or':_[_0x4dcc('0x2e')](_0x279524,function(_0x42d534){if(_0x42d534[_0x4dcc('0x30')]!==_0x4dcc('0x40')){var _0x4d4b92={};_0x4d4b92[_0x42d534['name']]={'$like':'%'+_0x160805[_0x4dcc('0x32')][_0x4dcc('0x3e')]+'%'};return _0x4d4b92;}})});}_0x30c617=_[_0x4dcc('0x3f')]({},_0x30c617,_0x160805['options']);var _0x478343={'where':_0x30c617['where']};return db[_0x4dcc('0x41')]['count'](_0x478343)['then'](function(_0x12d859){_0x2ffac7[_0x4dcc('0x20')]=_0x12d859;if(_0x160805[_0x4dcc('0x32')][_0x4dcc('0x42')]){_0x30c617[_0x4dcc('0x43')]=[{'all':!![]}];}return db[_0x4dcc('0x41')][_0x4dcc('0x44')](_0x30c617);})[_0x4dcc('0x28')](function(_0x5ec283){_0x2ffac7['rows']=_0x5ec283;return _0x2ffac7;})[_0x4dcc('0x28')](respondWithFilteredResult(_0x562d1f,_0x30c617))['catch'](handleError(_0x562d1f,null));};exports[_0x4dcc('0x45')]=function(_0x5545ed,_0x2cc3f7){var _0x4f3fa4={'raw':!![],'where':{'id':_0x5545ed[_0x4dcc('0x46')]['id']}},_0x34edc0={};_0x34edc0['model']=_[_0x4dcc('0x33')](db[_0x4dcc('0x41')][_0x4dcc('0x2f')]);_0x34edc0['query']=_[_0x4dcc('0x33')](_0x5545ed[_0x4dcc('0x32')]);_0x34edc0[_0x4dcc('0x34')]=_[_0x4dcc('0x35')](_0x34edc0[_0x4dcc('0x31')],_0x34edc0[_0x4dcc('0x32')]);_0x4f3fa4[_0x4dcc('0x36')]=_['intersection'](_0x34edc0[_0x4dcc('0x31')],qs[_0x4dcc('0x37')](_0x5545ed[_0x4dcc('0x32')]['fields']));_0x4f3fa4[_0x4dcc('0x36')]=_0x4f3fa4[_0x4dcc('0x36')]['length']?_0x4f3fa4[_0x4dcc('0x36')]:_0x34edc0[_0x4dcc('0x31')];if(_0x5545ed[_0x4dcc('0x32')][_0x4dcc('0x42')]){_0x4f3fa4[_0x4dcc('0x43')]=[{'all':!![]}];}_0x4f3fa4=_[_0x4dcc('0x3f')]({},_0x4f3fa4,_0x5545ed['options']);return db[_0x4dcc('0x41')][_0x4dcc('0x47')](_0x4f3fa4)[_0x4dcc('0x28')](handleEntityNotFound(_0x2cc3f7,null))['then'](respondWithResult(_0x2cc3f7,null))[_0x4dcc('0x48')](handleError(_0x2cc3f7,null));};exports['create']=function(_0x481b0c,_0x346afd){return db['JscriptyAnswerReport'][_0x4dcc('0x49')](_0x481b0c[_0x4dcc('0x4a')],{})[_0x4dcc('0x28')](respondWithResult(_0x346afd,0xc9))['catch'](handleError(_0x346afd,null));};exports[_0x4dcc('0x27')]=function(_0x53e1f1,_0x33f80c){if(_0x53e1f1['body']['id']){delete _0x53e1f1[_0x4dcc('0x4a')]['id'];}return db[_0x4dcc('0x41')]['find']({'where':{'id':_0x53e1f1[_0x4dcc('0x46')]['id']}})[_0x4dcc('0x28')](handleEntityNotFound(_0x33f80c,null))[_0x4dcc('0x28')](saveUpdates(_0x53e1f1[_0x4dcc('0x4a')],null))[_0x4dcc('0x28')](respondWithResult(_0x33f80c,null))[_0x4dcc('0x48')](handleError(_0x33f80c,null));};exports[_0x4dcc('0x29')]=function(_0x5970fb,_0x222ec8){return db[_0x4dcc('0x41')][_0x4dcc('0x47')]({'where':{'id':_0x5970fb[_0x4dcc('0x46')]['id']}})[_0x4dcc('0x28')](handleEntityNotFound(_0x222ec8,null))['then'](removeEntity(_0x222ec8,null))[_0x4dcc('0x48')](handleError(_0x222ec8,null));};exports[_0x4dcc('0x4b')]=function(_0x10968e,_0x3302bf){return db[_0x4dcc('0x41')][_0x4dcc('0x4b')]()[_0x4dcc('0x28')](respondWithResult(_0x3302bf,null))['catch'](handleError(_0x3302bf,null));}; \ No newline at end of file +var _0xc838=['count','limit','set','Content-Range','save','update','then','error','send','JscriptyAnswerReport','rawAttributes','fieldName','type','key','map','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','rows','catch','show','options','create','body','find','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc838,0xbd));var _0x8c83=function(_0x5668ec,_0x13ce45){_0x5668ec=_0x5668ec-0x0;var _0x512285=_0xc838[_0x5668ec];return _0x512285;};'use strict';var emlformat=require(_0x8c83('0x0'));var rimraf=require(_0x8c83('0x1'));var zipdir=require(_0x8c83('0x2'));var jsonpatch=require(_0x8c83('0x3'));var rp=require(_0x8c83('0x4'));var moment=require(_0x8c83('0x5'));var BPromise=require(_0x8c83('0x6'));var Mustache=require(_0x8c83('0x7'));var util=require(_0x8c83('0x8'));var path=require(_0x8c83('0x9'));var sox=require(_0x8c83('0xa'));var csv=require(_0x8c83('0xb'));var ejs=require(_0x8c83('0xc'));var fs=require('fs');var fs_extra=require(_0x8c83('0xd'));var _=require(_0x8c83('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8c83('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8c83('0xb'));var querystring=require(_0x8c83('0x10'));var Papa=require(_0x8c83('0x11'));var Redis=require(_0x8c83('0x12'));var authService=require(_0x8c83('0x13'));var qs=require(_0x8c83('0x14'));var as=require(_0x8c83('0x15'));var hardwareService=require(_0x8c83('0x16'));var logger=require(_0x8c83('0x17'))(_0x8c83('0x18'));var utils=require(_0x8c83('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8c83('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51d568,_0x4a2fc7){_0x4a2fc7=_0x4a2fc7||0xcc;return function(_0x57a0b5){if(_0x57a0b5){return _0x51d568[_0x8c83('0x1b')](_0x4a2fc7);}return _0x51d568[_0x8c83('0x1c')](_0x4a2fc7)[_0x8c83('0x1d')]();};}function respondWithResult(_0x45d86c,_0x401fc5){_0x401fc5=_0x401fc5||0xc8;return function(_0x1aaac5){if(_0x1aaac5){return _0x45d86c[_0x8c83('0x1c')](_0x401fc5)[_0x8c83('0x1e')](_0x1aaac5);}};}function respondWithFilteredResult(_0x1ac932,_0xf2dee0){return function(_0x573b7d){if(_0x573b7d){var _0x2b4027=typeof _0xf2dee0[_0x8c83('0x1f')]==='undefined'&&typeof _0xf2dee0['limit']===_0x8c83('0x20');var _0x4e3da8=_0x573b7d[_0x8c83('0x21')];var _0x535962=_0x2b4027?0x0:_0xf2dee0['offset'];var _0x3f4b38=_0x2b4027?_0x573b7d['count']:_0xf2dee0[_0x8c83('0x1f')]+_0xf2dee0[_0x8c83('0x22')];var _0x505c0c;if(_0x3f4b38>=_0x4e3da8){_0x3f4b38=_0x4e3da8;_0x505c0c=0xc8;}else{_0x505c0c=0xce;}_0x1ac932['status'](_0x505c0c);return _0x1ac932[_0x8c83('0x23')](_0x8c83('0x24'),_0x535962+'-'+_0x3f4b38+'/'+_0x4e3da8)['json'](_0x573b7d);}return null;};}function patchUpdates(_0x41e629){return function(_0x18f718){try{jsonpatch['apply'](_0x18f718,_0x41e629,!![]);}catch(_0x34825d){return BPromise['reject'](_0x34825d);}return _0x18f718[_0x8c83('0x25')]();};}function saveUpdates(_0x39b02f,_0x17937e){return function(_0xf7b089){if(_0xf7b089){return _0xf7b089[_0x8c83('0x26')](_0x39b02f)['then'](function(_0x4faecd){return _0x4faecd;});}return null;};}function removeEntity(_0x29fced,_0x3a21e9){return function(_0x59e6f9){if(_0x59e6f9){return _0x59e6f9['destroy']()[_0x8c83('0x27')](function(){_0x29fced[_0x8c83('0x1c')](0xcc)[_0x8c83('0x1d')]();});}};}function handleEntityNotFound(_0x5034e1,_0x1bd922){return function(_0x4f7088){if(!_0x4f7088){_0x5034e1[_0x8c83('0x1b')](0x194);}return _0x4f7088;};}function handleError(_0xc5d97d,_0x29b5d8){_0x29b5d8=_0x29b5d8||0x1f4;return function(_0x1180e1){logger[_0x8c83('0x28')](_0x1180e1['stack']);if(_0x1180e1['name']){delete _0x1180e1['name'];}_0xc5d97d[_0x8c83('0x1c')](_0x29b5d8)[_0x8c83('0x29')](_0x1180e1);};}exports['index']=function(_0x106f71,_0x12419a){var _0x142201={},_0x596ff0={},_0x48a74b={'count':0x0,'rows':[]};var _0x1b054a=_['map'](db[_0x8c83('0x2a')][_0x8c83('0x2b')],function(_0x290af8){return{'name':_0x290af8[_0x8c83('0x2c')],'type':_0x290af8[_0x8c83('0x2d')][_0x8c83('0x2e')]};});_0x596ff0['model']=_[_0x8c83('0x2f')](_0x1b054a,_0x8c83('0x30'));_0x596ff0[_0x8c83('0x31')]=_[_0x8c83('0x32')](_0x106f71[_0x8c83('0x31')]);_0x596ff0[_0x8c83('0x33')]=_[_0x8c83('0x34')](_0x596ff0[_0x8c83('0x35')],_0x596ff0[_0x8c83('0x31')]);_0x142201[_0x8c83('0x36')]=_['intersection'](_0x596ff0[_0x8c83('0x35')],qs[_0x8c83('0x37')](_0x106f71[_0x8c83('0x31')]['fields']));_0x142201[_0x8c83('0x36')]=_0x142201[_0x8c83('0x36')]['length']?_0x142201[_0x8c83('0x36')]:_0x596ff0[_0x8c83('0x35')];if(!_0x106f71[_0x8c83('0x31')][_0x8c83('0x38')](_0x8c83('0x39'))){_0x142201[_0x8c83('0x22')]=qs[_0x8c83('0x22')](_0x106f71[_0x8c83('0x31')][_0x8c83('0x22')]);_0x142201[_0x8c83('0x1f')]=qs[_0x8c83('0x1f')](_0x106f71[_0x8c83('0x31')]['offset']);}_0x142201['order']=qs[_0x8c83('0x3a')](_0x106f71[_0x8c83('0x31')][_0x8c83('0x3a')]);_0x142201[_0x8c83('0x3b')]=qs[_0x8c83('0x33')](_['pick'](_0x106f71['query'],_0x596ff0[_0x8c83('0x33')]),_0x1b054a);if(_0x106f71[_0x8c83('0x31')][_0x8c83('0x3c')]){_0x142201['where']=_['merge'](_0x142201['where'],{'$or':_['map'](_0x1b054a,function(_0x259bca){if(_0x259bca[_0x8c83('0x2d')]!==_0x8c83('0x3d')){var _0xbc83f8={};_0xbc83f8[_0x259bca[_0x8c83('0x30')]]={'$like':'%'+_0x106f71[_0x8c83('0x31')][_0x8c83('0x3c')]+'%'};return _0xbc83f8;}})});}_0x142201=_[_0x8c83('0x3e')]({},_0x142201,_0x106f71['options']);var _0x5bfea5={'where':_0x142201[_0x8c83('0x3b')]};return db[_0x8c83('0x2a')][_0x8c83('0x21')](_0x5bfea5)['then'](function(_0x2bab6d){_0x48a74b['count']=_0x2bab6d;if(_0x106f71[_0x8c83('0x31')][_0x8c83('0x3f')]){_0x142201['include']=[{'all':!![]}];}return db[_0x8c83('0x2a')]['findAll'](_0x142201);})['then'](function(_0x5dfc16){_0x48a74b[_0x8c83('0x40')]=_0x5dfc16;return _0x48a74b;})[_0x8c83('0x27')](respondWithFilteredResult(_0x12419a,_0x142201))[_0x8c83('0x41')](handleError(_0x12419a,null));};exports[_0x8c83('0x42')]=function(_0x3e4eb9,_0x3883de){var _0x3a6c98={'raw':!![],'where':{'id':_0x3e4eb9['params']['id']}},_0x4b540d={};_0x4b540d[_0x8c83('0x35')]=_[_0x8c83('0x32')](db[_0x8c83('0x2a')][_0x8c83('0x2b')]);_0x4b540d[_0x8c83('0x31')]=_[_0x8c83('0x32')](_0x3e4eb9[_0x8c83('0x31')]);_0x4b540d['filters']=_['intersection'](_0x4b540d[_0x8c83('0x35')],_0x4b540d[_0x8c83('0x31')]);_0x3a6c98[_0x8c83('0x36')]=_[_0x8c83('0x34')](_0x4b540d[_0x8c83('0x35')],qs[_0x8c83('0x37')](_0x3e4eb9[_0x8c83('0x31')][_0x8c83('0x37')]));_0x3a6c98[_0x8c83('0x36')]=_0x3a6c98[_0x8c83('0x36')]['length']?_0x3a6c98['attributes']:_0x4b540d[_0x8c83('0x35')];if(_0x3e4eb9[_0x8c83('0x31')][_0x8c83('0x3f')]){_0x3a6c98['include']=[{'all':!![]}];}_0x3a6c98=_[_0x8c83('0x3e')]({},_0x3a6c98,_0x3e4eb9[_0x8c83('0x43')]);return db[_0x8c83('0x2a')]['find'](_0x3a6c98)['then'](handleEntityNotFound(_0x3883de,null))['then'](respondWithResult(_0x3883de,null))[_0x8c83('0x41')](handleError(_0x3883de,null));};exports['create']=function(_0x5d3734,_0x35ee54){return db['JscriptyAnswerReport'][_0x8c83('0x44')](_0x5d3734[_0x8c83('0x45')],{})[_0x8c83('0x27')](respondWithResult(_0x35ee54,0xc9))[_0x8c83('0x41')](handleError(_0x35ee54,null));};exports['update']=function(_0x5d8f9f,_0x2c8853){if(_0x5d8f9f[_0x8c83('0x45')]['id']){delete _0x5d8f9f[_0x8c83('0x45')]['id'];}return db['JscriptyAnswerReport'][_0x8c83('0x46')]({'where':{'id':_0x5d8f9f['params']['id']}})[_0x8c83('0x27')](handleEntityNotFound(_0x2c8853,null))[_0x8c83('0x27')](saveUpdates(_0x5d8f9f[_0x8c83('0x45')],null))[_0x8c83('0x27')](respondWithResult(_0x2c8853,null))['catch'](handleError(_0x2c8853,null));};exports[_0x8c83('0x47')]=function(_0x5830b5,_0x595397){return db[_0x8c83('0x2a')][_0x8c83('0x46')]({'where':{'id':_0x5830b5[_0x8c83('0x48')]['id']}})[_0x8c83('0x27')](handleEntityNotFound(_0x595397,null))['then'](removeEntity(_0x595397,null))[_0x8c83('0x41')](handleError(_0x595397,null));};exports[_0x8c83('0x49')]=function(_0x2c1039,_0xd4badb){return db[_0x8c83('0x2a')][_0x8c83('0x49')]()[_0x8c83('0x27')](respondWithResult(_0xd4badb,null))[_0x8c83('0x41')](handleError(_0xd4badb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c164c61..6006c7f 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 _0x996a=['define','report_jscripty_answers','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x202df8,_0xb11ff1){var _0x3eefbb=function(_0x1ca249){while(--_0x1ca249){_0x202df8['push'](_0x202df8['shift']());}};_0x3eefbb(++_0xb11ff1);}(_0x996a,0x1e2));var _0xa996=function(_0x5ec582,_0x1f4a90){_0x5ec582=_0x5ec582-0x0;var _0x372b2e=_0x996a[_0x5ec582];return _0x372b2e;};'use strict';var _=require(_0xa996('0x0'));var util=require(_0xa996('0x1'));var logger=require(_0xa996('0x2'))('api');var moment=require(_0xa996('0x3'));var BPromise=require('bluebird');var rp=require(_0xa996('0x4'));var fs=require('fs');var path=require(_0xa996('0x5'));var rimraf=require(_0xa996('0x6'));var config=require(_0xa996('0x7'));var attributes=require(_0xa996('0x8'));module[_0xa996('0x9')]=function(_0x5a4254,_0x48d2a6){return _0x5a4254[_0xa996('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0xa996('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1736=['lodash','util','../../config/logger','api','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers'];(function(_0x51a327,_0x3669f0){var _0x22af21=function(_0x43a6cf){while(--_0x43a6cf){_0x51a327['push'](_0x51a327['shift']());}};_0x22af21(++_0x3669f0);}(_0x1736,0x19a));var _0x6173=function(_0x598cc5,_0x2cc52){_0x598cc5=_0x598cc5-0x0;var _0xd27750=_0x1736[_0x598cc5];return _0xd27750;};'use strict';var _=require(_0x6173('0x0'));var util=require(_0x6173('0x1'));var logger=require(_0x6173('0x2'))(_0x6173('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6173('0x4'));var rimraf=require(_0x6173('0x5'));var config=require('../../config/environment');var attributes=require(_0x6173('0x6'));module[_0x6173('0x7')]=function(_0x203df4,_0x40aec9){return _0x203df4[_0x6173('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x6173('0x9'),'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 59053ee..b122d6e 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 _0x1f77=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x1f77,0x1b9));var _0x71f7=function(_0x5ac482,_0x26358d){_0x5ac482=_0x5ac482-0x0;var _0x4f4e4a=_0x1f77[_0x5ac482];return _0x4f4e4a;};'use strict';var _=require('lodash');var util=require(_0x71f7('0x0'));var moment=require(_0x71f7('0x1'));var BPromise=require(_0x71f7('0x2'));var rs=require(_0x71f7('0x3'));var fs=require('fs');var Redis=require(_0x71f7('0x4'));var db=require(_0x71f7('0x5'))['db'];var utils=require(_0x71f7('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x71f7('0x7'));var jayson=require(_0x71f7('0x8'));var client=jayson[_0x71f7('0x9')][_0x71f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c33b7,_0x2f29f5,_0x5ea1ef){return new BPromise(function(_0x2e79f2,_0x3cd1d7){return client[_0x71f7('0xb')](_0x2c33b7,_0x5ea1ef)[_0x71f7('0xc')](function(_0xa785a4){logger[_0x71f7('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2f29f5,'request\x20sent');logger[_0x71f7('0xe')](_0x71f7('0xf'),_0x2f29f5,_0x71f7('0x10'),JSON['stringify'](_0xa785a4));if(_0xa785a4['error']){if(_0xa785a4[_0x71f7('0x11')][_0x71f7('0x12')]===0x1f4){logger[_0x71f7('0x11')](_0x71f7('0x13'),_0x2f29f5,_0xa785a4[_0x71f7('0x11')][_0x71f7('0x14')]);return _0x3cd1d7(_0xa785a4[_0x71f7('0x11')]['message']);}logger[_0x71f7('0x11')](_0x71f7('0x13'),_0x2f29f5,_0xa785a4[_0x71f7('0x11')]['message']);return _0x2e79f2(_0xa785a4[_0x71f7('0x11')]['message']);}else{logger[_0x71f7('0xd')](_0x71f7('0x13'),_0x2f29f5,_0x71f7('0x10'));_0x2e79f2(_0xa785a4[_0x71f7('0x15')][_0x71f7('0x14')]);}})['catch'](function(_0x42a6c0){logger[_0x71f7('0x11')](_0x71f7('0x13'),_0x2f29f5,_0x42a6c0);_0x3cd1d7(_0x42a6c0);});});} \ No newline at end of file +var _0x32d6=['../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5d640e,_0x149b36){var _0x58d5dc=function(_0x3cc928){while(--_0x3cc928){_0x5d640e['push'](_0x5d640e['shift']());}};_0x58d5dc(++_0x149b36);}(_0x32d6,0xf5));var _0x632d=function(_0x2fd941,_0x273179){_0x2fd941=_0x2fd941-0x0;var _0x2ee734=_0x32d6[_0x2fd941];return _0x2ee734;};'use strict';var _=require(_0x632d('0x0'));var util=require('util');var moment=require(_0x632d('0x1'));var BPromise=require(_0x632d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x632d('0x3'));var db=require(_0x632d('0x4'))['db'];var utils=require(_0x632d('0x5'));var logger=require(_0x632d('0x6'))(_0x632d('0x7'));var config=require(_0x632d('0x8'));var jayson=require(_0x632d('0x9'));var client=jayson['client'][_0x632d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x208a40,_0x24d5c5,_0x221865){return new BPromise(function(_0xa22851,_0x58ac82){return client[_0x632d('0xb')](_0x208a40,_0x221865)[_0x632d('0xc')](function(_0x4d8bdf){logger[_0x632d('0xd')](_0x632d('0xe'),_0x24d5c5,'request\x20sent');logger['debug'](_0x632d('0xf'),_0x24d5c5,_0x632d('0x10'),JSON[_0x632d('0x11')](_0x4d8bdf));if(_0x4d8bdf[_0x632d('0x12')]){if(_0x4d8bdf['error'][_0x632d('0x13')]===0x1f4){logger[_0x632d('0x12')](_0x632d('0xe'),_0x24d5c5,_0x4d8bdf['error'][_0x632d('0x14')]);return _0x58ac82(_0x4d8bdf[_0x632d('0x12')][_0x632d('0x14')]);}logger[_0x632d('0x12')](_0x632d('0xe'),_0x24d5c5,_0x4d8bdf[_0x632d('0x12')][_0x632d('0x14')]);return _0xa22851(_0x4d8bdf['error'][_0x632d('0x14')]);}else{logger[_0x632d('0xd')](_0x632d('0xe'),_0x24d5c5,_0x632d('0x10'));_0xa22851(_0x4d8bdf[_0x632d('0x15')][_0x632d('0x14')]);}})[_0x632d('0x16')](function(_0x4ac470){logger[_0x632d('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x24d5c5,_0x4ac470);_0x58ac82(_0x4ac470);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index d0804d9..efda70c 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 _0xc443=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','delete','exports','multer','util','connect-timeout','express'];(function(_0x27a5bb,_0x3f4cfb){var _0x2e17ea=function(_0x22912d){while(--_0x22912d){_0x27a5bb['push'](_0x27a5bb['shift']());}};_0x2e17ea(++_0x3f4cfb);}(_0xc443,0x9e));var _0x3c44=function(_0x2d4132,_0x18dc6d){_0x2d4132=_0x2d4132-0x0;var _0x5911a5=_0xc443[_0x2d4132];return _0x5911a5;};'use strict';var multer=require(_0x3c44('0x0'));var util=require(_0x3c44('0x1'));var path=require('path');var timeout=require(_0x3c44('0x2'));var express=require(_0x3c44('0x3'));var router=express[_0x3c44('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3c44('0x5'));var interaction=require(_0x3c44('0x6'));var config=require(_0x3c44('0x7'));var controller=require(_0x3c44('0x8'));router[_0x3c44('0x9')]('/',auth[_0x3c44('0xa')](),controller['index']);router[_0x3c44('0x9')]('/:id',auth[_0x3c44('0xa')](),controller[_0x3c44('0xb')]);router[_0x3c44('0x9')](_0x3c44('0xc'),auth[_0x3c44('0xa')](),controller[_0x3c44('0xd')]);router[_0x3c44('0x9')](_0x3c44('0xe'),auth[_0x3c44('0xa')](),controller[_0x3c44('0xf')]);router[_0x3c44('0x9')](_0x3c44('0x10'),auth[_0x3c44('0xa')](),timeout(_0x3c44('0x11')),controller[_0x3c44('0x12')]);router[_0x3c44('0x13')]('/',auth[_0x3c44('0xa')](),controller[_0x3c44('0x14')]);router['post'](_0x3c44('0x15'),auth[_0x3c44('0xa')](),controller[_0x3c44('0x16')]);router[_0x3c44('0x17')](_0x3c44('0x18'),auth[_0x3c44('0xa')](),controller['update']);router[_0x3c44('0x19')](_0x3c44('0x18'),auth[_0x3c44('0xa')](),controller['destroy']);module[_0x3c44('0x1a')]=router; \ No newline at end of file +var _0x2cc1=['post','create','/:id/clone','put','update','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/sessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary'];(function(_0x3c8235,_0x42667b){var _0x404b81=function(_0x3e87d9){while(--_0x3e87d9){_0x3c8235['push'](_0x3c8235['shift']());}};_0x404b81(++_0x42667b);}(_0x2cc1,0x157));var _0x12cc=function(_0x463f44,_0xc071ff){_0x463f44=_0x463f44-0x0;var _0x304163=_0x2cc1[_0x463f44];return _0x304163;};'use strict';var multer=require(_0x12cc('0x0'));var util=require(_0x12cc('0x1'));var path=require(_0x12cc('0x2'));var timeout=require(_0x12cc('0x3'));var express=require(_0x12cc('0x4'));var router=express[_0x12cc('0x5')]();var fs_extra=require(_0x12cc('0x6'));var auth=require(_0x12cc('0x7'));var interaction=require(_0x12cc('0x8'));var config=require(_0x12cc('0x9'));var controller=require('./jscriptyProject.controller');router[_0x12cc('0xa')]('/',auth[_0x12cc('0xb')](),controller[_0x12cc('0xc')]);router[_0x12cc('0xa')](_0x12cc('0xd'),auth[_0x12cc('0xb')](),controller[_0x12cc('0xe')]);router[_0x12cc('0xa')](_0x12cc('0xf'),auth[_0x12cc('0xb')](),controller['getSessions']);router[_0x12cc('0xa')](_0x12cc('0x10'),auth[_0x12cc('0xb')](),controller[_0x12cc('0x11')]);router['get'](_0x12cc('0x12'),auth['isAuthenticated'](),timeout(_0x12cc('0x13')),controller[_0x12cc('0x14')]);router[_0x12cc('0x15')]('/',auth[_0x12cc('0xb')](),controller[_0x12cc('0x16')]);router[_0x12cc('0x15')](_0x12cc('0x17'),auth[_0x12cc('0xb')](),controller['clone']);router[_0x12cc('0x18')](_0x12cc('0xd'),auth['isAuthenticated'](),controller[_0x12cc('0x19')]);router['delete'](_0x12cc('0xd'),auth[_0x12cc('0xb')](),controller[_0x12cc('0x1a')]);module[_0x12cc('0x1b')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index be4ca3a..44f62d8 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 _0x3470=['isObjectLike','setDataValue','formData','stringify','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','exports','STRING','name','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3470,0x182));var _0x0347=function(_0x16207f,_0x53795d){_0x16207f=_0x16207f-0x0;var _0x57dd8d=_0x3470[_0x16207f];return _0x57dd8d;};'use strict';var Sequelize=require('sequelize');var _=require(_0x0347('0x0'));var util=require(_0x0347('0x1'));module[_0x0347('0x2')]={'name':{'type':Sequelize[_0x0347('0x3')],'unique':_0x0347('0x4')},'description':{'type':Sequelize[_0x0347('0x3')]},'formData':{'type':Sequelize[_0x0347('0x5')]('long'),'set':function(_0x2ebe44){if(_[_0x0347('0x6')](_0x2ebe44)){this[_0x0347('0x7')](_0x0347('0x8'),JSON[_0x0347('0x9')](_0x2ebe44));}else if(_['isString'](_0x2ebe44)){this[_0x0347('0x7')](_0x0347('0x8'),_0x2ebe44);}else{this[_0x0347('0x7')](_0x0347('0x8'),util['format'](_0x0347('0xa'),this[_0x0347('0xb')](_0x0347('0x4'))||'',this['getDataValue'](_0x0347('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0347('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0347('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x03a5=['setDataValue','getDataValue','description','BOOLEAN','sequelize','lodash','util','STRING','name','TEXT','isObjectLike','formData','stringify','isString'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x03a5,0x162));var _0x503a=function(_0x420f45,_0x82ba43){_0x420f45=_0x420f45-0x0;var _0x115f02=_0x03a5[_0x420f45];return _0x115f02;};'use strict';var Sequelize=require(_0x503a('0x0'));var _=require(_0x503a('0x1'));var util=require(_0x503a('0x2'));module['exports']={'name':{'type':Sequelize[_0x503a('0x3')],'unique':_0x503a('0x4')},'description':{'type':Sequelize[_0x503a('0x3')]},'formData':{'type':Sequelize[_0x503a('0x5')]('long'),'set':function(_0xcffc77){if(_[_0x503a('0x6')](_0xcffc77)){this['setDataValue'](_0x503a('0x7'),JSON[_0x503a('0x8')](_0xcffc77));}else if(_[_0x503a('0x9')](_0xcffc77)){this[_0x503a('0xa')](_0x503a('0x7'),_0xcffc77);}else{this[_0x503a('0xa')]('formData',util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x503a('0xb')](_0x503a('0x4'))||'',this[_0x503a('0xb')](_0x503a('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x503a('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x503a('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 bf15ee7..afae699 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 _0x6c4d=['now','setHeader','Content-disposition','attachment;\x20filename=','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','sendStatus','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','params','length','find','catch','body','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','include','omit','createdAt','updatedAt','create','role','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','findAll','rows','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','question','starttime','YYYY-MM-DD\x20HH:mm:ss','questionId','push','isEmpty'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0x6c4d,0x1dd));var _0xd6c4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6c4d[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xd6c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6c4('0x2'));var moment=require(_0xd6c4('0x3'));var BPromise=require(_0xd6c4('0x4'));var Mustache=require(_0xd6c4('0x5'));var util=require(_0xd6c4('0x6'));var path=require(_0xd6c4('0x7'));var sox=require('sox');var csv=require(_0xd6c4('0x8'));var ejs=require(_0xd6c4('0x9'));var fs=require('fs');var fs_extra=require(_0xd6c4('0xa'));var _=require(_0xd6c4('0xb'));var squel=require('squel');var crypto=require(_0xd6c4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6c4('0xd'));var Papa=require(_0xd6c4('0xe'));var Redis=require(_0xd6c4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd6c4('0x10'));var as=require(_0xd6c4('0x11'));var hardwareService=require(_0xd6c4('0x12'));var logger=require(_0xd6c4('0x13'))(_0xd6c4('0x14'));var utils=require(_0xd6c4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd6c4('0x16'));var db=require(_0xd6c4('0x17'))['db'];function respondWithStatusCode(_0x550135,_0x3f9a9c){_0x3f9a9c=_0x3f9a9c||0xcc;return function(_0x42a3c7){if(_0x42a3c7){return _0x550135['sendStatus'](_0x3f9a9c);}return _0x550135[_0xd6c4('0x18')](_0x3f9a9c)[_0xd6c4('0x19')]();};}function respondWithResult(_0x5f513a,_0xad02d6){_0xad02d6=_0xad02d6||0xc8;return function(_0x4bce31){if(_0x4bce31){return _0x5f513a[_0xd6c4('0x18')](_0xad02d6)['json'](_0x4bce31);}};}function respondWithFilteredResult(_0x10f358,_0x3162ca){return function(_0x2f8e24){if(_0x2f8e24){var _0x4267ca=typeof _0x3162ca[_0xd6c4('0x1a')]==='undefined'&&typeof _0x3162ca['limit']===_0xd6c4('0x1b');var _0x2d52f8=_0x2f8e24[_0xd6c4('0x1c')];var _0x205cdd=_0x4267ca?0x0:_0x3162ca[_0xd6c4('0x1a')];var _0x109e05=_0x4267ca?_0x2f8e24[_0xd6c4('0x1c')]:_0x3162ca[_0xd6c4('0x1a')]+_0x3162ca[_0xd6c4('0x1d')];var _0xefc9eb;if(_0x109e05>=_0x2d52f8){_0x109e05=_0x2d52f8;_0xefc9eb=0xc8;}else{_0xefc9eb=0xce;}_0x10f358[_0xd6c4('0x18')](_0xefc9eb);return _0x10f358['set'](_0xd6c4('0x1e'),_0x205cdd+'-'+_0x109e05+'/'+_0x2d52f8)['json'](_0x2f8e24);}return null;};}function patchUpdates(_0x18861b){return function(_0xdaefea){try{jsonpatch[_0xd6c4('0x1f')](_0xdaefea,_0x18861b,!![]);}catch(_0x16a6a9){return BPromise[_0xd6c4('0x20')](_0x16a6a9);}return _0xdaefea[_0xd6c4('0x21')]();};}function saveUpdates(_0x20feb1,_0x353645){return function(_0x5977e5){if(_0x5977e5){return _0x5977e5[_0xd6c4('0x22')](_0x20feb1)['then'](function(_0x582ab3){return _0x582ab3;});}return null;};}function removeEntity(_0x433025,_0x13adf9){return function(_0x2a467f){if(_0x2a467f){return _0x2a467f[_0xd6c4('0x23')]()[_0xd6c4('0x24')](function(){var _0x1c4660=_0x2a467f[_0xd6c4('0x25')]({'plain':!![]});var _0x2745b9=_0xd6c4('0x26');return db[_0xd6c4('0x27')][_0xd6c4('0x23')]({'where':{'type':_0x2745b9,'resourceId':_0x1c4660['id']}})[_0xd6c4('0x24')](function(){return _0x2a467f;});})[_0xd6c4('0x24')](function(){_0x433025[_0xd6c4('0x18')](0xcc)[_0xd6c4('0x19')]();});}};}function handleEntityNotFound(_0x3dc746,_0x3dc051){return function(_0x1d0638){if(!_0x1d0638){_0x3dc746[_0xd6c4('0x28')](0x194);}return _0x1d0638;};}function handleError(_0x17535f,_0x572b8a){_0x572b8a=_0x572b8a||0x1f4;return function(_0x269684){logger['error'](_0x269684['stack']);if(_0x269684[_0xd6c4('0x29')]){delete _0x269684[_0xd6c4('0x29')];}_0x17535f[_0xd6c4('0x18')](_0x572b8a)['send'](_0x269684);};}exports[_0xd6c4('0x2a')]=function(_0x18d837,_0x49aa7f){var _0x560f5c={},_0x4fa3b7={},_0x13399e={'count':0x0,'rows':[]};var _0x3e8ecb=_[_0xd6c4('0x2b')](db[_0xd6c4('0x2c')][_0xd6c4('0x2d')],function(_0x5808c4){return{'name':_0x5808c4[_0xd6c4('0x2e')],'type':_0x5808c4[_0xd6c4('0x2f')][_0xd6c4('0x30')]};});_0x4fa3b7[_0xd6c4('0x31')]=_[_0xd6c4('0x2b')](_0x3e8ecb,'name');_0x4fa3b7[_0xd6c4('0x32')]=_['keys'](_0x18d837['query']);_0x4fa3b7[_0xd6c4('0x33')]=_['intersection'](_0x4fa3b7[_0xd6c4('0x31')],_0x4fa3b7[_0xd6c4('0x32')]);_0x560f5c['attributes']=_[_0xd6c4('0x34')](_0x4fa3b7[_0xd6c4('0x31')],qs[_0xd6c4('0x35')](_0x18d837['query'][_0xd6c4('0x35')]));_0x560f5c[_0xd6c4('0x36')]=_0x560f5c['attributes']['length']?_0x560f5c['attributes']:_0x4fa3b7[_0xd6c4('0x31')];if(!_0x18d837[_0xd6c4('0x32')]['hasOwnProperty'](_0xd6c4('0x37'))){_0x560f5c['limit']=qs[_0xd6c4('0x1d')](_0x18d837[_0xd6c4('0x32')]['limit']);_0x560f5c[_0xd6c4('0x1a')]=qs[_0xd6c4('0x1a')](_0x18d837[_0xd6c4('0x32')][_0xd6c4('0x1a')]);}_0x560f5c[_0xd6c4('0x38')]=qs[_0xd6c4('0x39')](_0x18d837[_0xd6c4('0x32')]['sort']);_0x560f5c[_0xd6c4('0x3a')]=qs[_0xd6c4('0x33')](_[_0xd6c4('0x3b')](_0x18d837[_0xd6c4('0x32')],_0x4fa3b7['filters']),_0x3e8ecb);if(_0x18d837[_0xd6c4('0x32')]['filter']){_0x560f5c[_0xd6c4('0x3a')]=_[_0xd6c4('0x3c')](_0x560f5c[_0xd6c4('0x3a')],{'$or':_[_0xd6c4('0x2b')](_0x3e8ecb,function(_0xfc60f8){if(_0xfc60f8['type']!==_0xd6c4('0x3d')){var _0x137de0={};_0x137de0[_0xfc60f8['name']]={'$like':'%'+_0x18d837['query'][_0xd6c4('0x3e')]+'%'};return _0x137de0;}})});}_0x560f5c=_[_0xd6c4('0x3c')]({},_0x560f5c,_0x18d837[_0xd6c4('0x3f')]);var _0x4e28ed={'where':_0x560f5c['where']};return db['JscriptyProject'][_0xd6c4('0x1c')](_0x4e28ed)[_0xd6c4('0x24')](function(_0x238b37){_0x13399e[_0xd6c4('0x1c')]=_0x238b37;if(_0x18d837[_0xd6c4('0x32')][_0xd6c4('0x40')]){_0x560f5c['include']=[{'all':!![]}];}return db[_0xd6c4('0x2c')]['findAll'](_0x560f5c);})[_0xd6c4('0x24')](function(_0x395e93){_0x13399e['rows']=_0x395e93;return _0x13399e;})[_0xd6c4('0x24')](respondWithFilteredResult(_0x49aa7f,_0x560f5c))['catch'](handleError(_0x49aa7f,null));};exports[_0xd6c4('0x41')]=function(_0x3078b4,_0x54a92d){var _0x5b91a4={'raw':![],'where':{'id':_0x3078b4[_0xd6c4('0x42')]['id']}},_0x4e37a1={};_0x4e37a1[_0xd6c4('0x31')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x4e37a1[_0xd6c4('0x32')]=_['keys'](_0x3078b4['query']);_0x4e37a1[_0xd6c4('0x33')]=_[_0xd6c4('0x34')](_0x4e37a1[_0xd6c4('0x31')],_0x4e37a1[_0xd6c4('0x32')]);_0x5b91a4['attributes']=_[_0xd6c4('0x34')](_0x4e37a1[_0xd6c4('0x31')],qs[_0xd6c4('0x35')](_0x3078b4[_0xd6c4('0x32')][_0xd6c4('0x35')]));_0x5b91a4[_0xd6c4('0x36')]=_0x5b91a4['attributes'][_0xd6c4('0x43')]?_0x5b91a4[_0xd6c4('0x36')]:_0x4e37a1['model'];if(_0x3078b4[_0xd6c4('0x32')][_0xd6c4('0x40')]){_0x5b91a4['include']=[{'all':!![]}];}_0x5b91a4=_['merge']({},_0x5b91a4,_0x3078b4[_0xd6c4('0x3f')]);return db[_0xd6c4('0x2c')][_0xd6c4('0x44')](_0x5b91a4)['then'](handleEntityNotFound(_0x54a92d,null))[_0xd6c4('0x24')](respondWithResult(_0x54a92d,null))[_0xd6c4('0x45')](handleError(_0x54a92d,null));};exports['create']=function(_0x144621,_0x51d5cb){return db[_0xd6c4('0x2c')]['create'](_0x144621[_0xd6c4('0x46')],{})[_0xd6c4('0x24')](function(_0x24f745){var _0x563366=_0x144621[_0xd6c4('0x47')]['get']({'plain':!![]});if(!_0x563366)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x563366['role']==='user'){var _0x22735b=_0x24f745[_0xd6c4('0x25')]({'plain':!![]});var _0x429526='Projects';return db[_0xd6c4('0x48')][_0xd6c4('0x44')]({'where':{'name':_0x429526,'userProfileId':_0x563366[_0xd6c4('0x49')]},'raw':!![]})[_0xd6c4('0x24')](function(_0x1aafe8){if(_0x1aafe8&&_0x1aafe8[_0xd6c4('0x4a')]===0x0){return db[_0xd6c4('0x27')]['create']({'name':_0x22735b[_0xd6c4('0x29')],'resourceId':_0x22735b['id'],'type':_0x1aafe8[_0xd6c4('0x29')],'sectionId':_0x1aafe8['id']},{})['then'](function(){return _0x24f745;});}else{return _0x24f745;}})[_0xd6c4('0x45')](function(_0x4662b7){logger[_0xd6c4('0x4b')](_0xd6c4('0x4c'),_0x4662b7);throw _0x4662b7;});}return _0x24f745;})[_0xd6c4('0x24')](respondWithResult(_0x51d5cb,0xc9))[_0xd6c4('0x45')](handleError(_0x51d5cb,null));};exports[_0xd6c4('0x4d')]=function(_0x3c655e,_0x1004f7){var _0x11b3ad={'where':{'id':_0x3c655e[_0xd6c4('0x42')]['id']}},_0x3d27f2={};_0x3d27f2[_0xd6c4('0x31')]=_[_0xd6c4('0x4e')](db[_0xd6c4('0x2c')][_0xd6c4('0x2d')]);_0x11b3ad[_0xd6c4('0x36')]=_[_0xd6c4('0x34')](_0x3d27f2[_0xd6c4('0x31')],qs['fields'](_0x3c655e[_0xd6c4('0x32')][_0xd6c4('0x35')]));_0x11b3ad[_0xd6c4('0x36')]=_0x11b3ad[_0xd6c4('0x36')]['length']?_0x11b3ad[_0xd6c4('0x36')]:_0x3d27f2[_0xd6c4('0x31')];if(_0x3c655e[_0xd6c4('0x32')][_0xd6c4('0x40')]){_0x11b3ad[_0xd6c4('0x4f')]=[{'all':!![]}];}_0x11b3ad=_[_0xd6c4('0x3c')]({},_0x11b3ad,_0x3c655e[_0xd6c4('0x3f')]);return db[_0xd6c4('0x2c')][_0xd6c4('0x44')](_0x11b3ad)[_0xd6c4('0x24')](handleEntityNotFound(_0x1004f7,null))[_0xd6c4('0x24')](function(_0x44ed9d){if(_0x44ed9d){var _0x228924=_0x44ed9d[_0xd6c4('0x25')]({'plain':!![]});_0x228924=qs[_0xd6c4('0x50')](_0x228924,['id',_0xd6c4('0x51'),'updatedAt']);_0x3c655e[_0xd6c4('0x46')]=_[_0xd6c4('0x50')](_0x3c655e['body'],['id',_0xd6c4('0x51'),_0xd6c4('0x52')]);return db['JscriptyProject'][_0xd6c4('0x53')](_['merge'](_0x228924,_0x3c655e[_0xd6c4('0x46')]),{'include':_0x3c655e[_0xd6c4('0x32')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x47421e){var _0x2aab9e=_0x3c655e[_0xd6c4('0x47')][_0xd6c4('0x25')]({'plain':!![]});if(!_0x2aab9e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2aab9e[_0xd6c4('0x54')]===_0xd6c4('0x47')){var _0x1af473=_0x47421e[_0xd6c4('0x25')]({'plain':!![]});var _0x2d6492=_0xd6c4('0x26');return db[_0xd6c4('0x48')][_0xd6c4('0x44')]({'where':{'name':_0x2d6492,'userProfileId':_0x2aab9e['userProfileId']},'raw':!![]})[_0xd6c4('0x24')](function(_0x72f90c){if(_0x72f90c&&_0x72f90c[_0xd6c4('0x4a')]===0x0){return db['UserProfileResource'][_0xd6c4('0x53')]({'name':_0x1af473[_0xd6c4('0x29')],'resourceId':_0x1af473['id'],'type':_0x72f90c[_0xd6c4('0x29')],'sectionId':_0x72f90c['id']},{})[_0xd6c4('0x24')](function(){return _0x47421e;});}else{return _0x47421e;}})[_0xd6c4('0x45')](function(_0x1a18a5){logger[_0xd6c4('0x4b')](_0xd6c4('0x4c'),_0x1a18a5);throw _0x1a18a5;});}return _0x47421e;});}})[_0xd6c4('0x24')](respondWithResult(_0x1004f7,0xc9))[_0xd6c4('0x45')](handleError(_0x1004f7,null));};exports[_0xd6c4('0x22')]=function(_0x3cacaf,_0x1cbf11){if(_0x3cacaf['body']['id']){delete _0x3cacaf[_0xd6c4('0x46')]['id'];}return db[_0xd6c4('0x2c')][_0xd6c4('0x44')]({'where':{'id':_0x3cacaf[_0xd6c4('0x42')]['id']}})[_0xd6c4('0x24')](handleEntityNotFound(_0x1cbf11,null))['then'](saveUpdates(_0x3cacaf['body'],null))[_0xd6c4('0x24')](respondWithResult(_0x1cbf11,null))[_0xd6c4('0x45')](handleError(_0x1cbf11,null));};exports[_0xd6c4('0x23')]=function(_0x1deaa0,_0x4f95e6){return db[_0xd6c4('0x2c')][_0xd6c4('0x44')]({'where':{'id':_0x1deaa0[_0xd6c4('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f95e6,null))[_0xd6c4('0x24')](removeEntity(_0x4f95e6,null))[_0xd6c4('0x45')](handleError(_0x4f95e6,null));};exports[_0xd6c4('0x55')]=function(_0x1f66f8,_0x10e365,_0x452a4e){var _0x260bbf={'raw':!![],'where':{}};var _0x5eca8b={};var _0x5add7a={'count':0x0,'rows':[]};return db[_0xd6c4('0x2c')][_0xd6c4('0x56')]({'where':{'id':_0x1f66f8[_0xd6c4('0x42')]['id']}})[_0xd6c4('0x24')](handleEntityNotFound(_0x10e365,null))['then'](function(_0x143512){if(_0x143512){_0x5eca8b[_0xd6c4('0x31')]=_[_0xd6c4('0x4e')](db[_0xd6c4('0x57')][_0xd6c4('0x2d')]);_0x5eca8b[_0xd6c4('0x32')]=_[_0xd6c4('0x4e')](_0x1f66f8['query']);_0x5eca8b[_0xd6c4('0x33')]=_[_0xd6c4('0x34')](_0x5eca8b[_0xd6c4('0x31')],_0x5eca8b['query']);_0x260bbf['attributes']=_[_0xd6c4('0x34')](_0x5eca8b[_0xd6c4('0x31')],qs[_0xd6c4('0x35')](_0x1f66f8[_0xd6c4('0x32')][_0xd6c4('0x35')]));_0x260bbf['attributes']=_0x260bbf[_0xd6c4('0x36')]['length']?_0x260bbf[_0xd6c4('0x36')]:_0x5eca8b[_0xd6c4('0x31')];if(!_0x1f66f8['query'][_0xd6c4('0x58')](_0xd6c4('0x37'))){_0x260bbf[_0xd6c4('0x1d')]=qs[_0xd6c4('0x1d')](_0x1f66f8[_0xd6c4('0x32')]['limit']);_0x260bbf['offset']=qs['offset'](_0x1f66f8[_0xd6c4('0x32')][_0xd6c4('0x1a')]);}_0x260bbf[_0xd6c4('0x38')]=qs[_0xd6c4('0x39')](_0x1f66f8['query'][_0xd6c4('0x39')]);_0x260bbf['where']=qs[_0xd6c4('0x33')](_['pick'](_0x1f66f8['query'],_0x5eca8b['filters']));_0x260bbf[_0xd6c4('0x3a')][_0xd6c4('0x59')]=_0x143512['id'];if(_0x1f66f8[_0xd6c4('0x32')]['filter']){_0x260bbf[_0xd6c4('0x3a')]=_[_0xd6c4('0x3c')](_0x260bbf['where'],{'$or':_[_0xd6c4('0x2b')](_0x260bbf[_0xd6c4('0x36')],function(_0x5d8bd9){var _0x4babd7={};_0x4babd7[_0x5d8bd9]={'$like':'%'+_0x1f66f8[_0xd6c4('0x32')]['filter']+'%'};return _0x4babd7;})});}_0x260bbf=_[_0xd6c4('0x3c')]({},_0x260bbf,_0x1f66f8[_0xd6c4('0x3f')]);return db[_0xd6c4('0x57')][_0xd6c4('0x1c')]({'where':_0x260bbf['where']})['then'](function(_0x2b967d){_0x5add7a[_0xd6c4('0x1c')]=_0x2b967d;if(_0x1f66f8[_0xd6c4('0x32')]['includeAll']){_0x260bbf['include']=[{'all':!![]}];}return db[_0xd6c4('0x57')][_0xd6c4('0x5a')](_0x260bbf);})[_0xd6c4('0x24')](function(_0x33eb2f){_0x5add7a[_0xd6c4('0x5b')]=_0x33eb2f;return _0x5add7a;});}})['then'](respondWithFilteredResult(_0x10e365,_0x260bbf))[_0xd6c4('0x45')](handleError(_0x10e365,null));};exports[_0xd6c4('0x5c')]=function(_0x401a80,_0x57c305,_0x410a91){var _0x3623f9={'raw':!![],'where':{}};var _0x90b26a={};var _0x501b51={'count':0x0,'rows':[]};return db[_0xd6c4('0x2c')][_0xd6c4('0x56')]({'where':{'id':_0x401a80[_0xd6c4('0x42')]['id']}})['then'](handleEntityNotFound(_0x57c305,null))[_0xd6c4('0x24')](function(_0x1ef9b4){if(_0x1ef9b4){_0x90b26a[_0xd6c4('0x31')]=_[_0xd6c4('0x4e')](db[_0xd6c4('0x5d')][_0xd6c4('0x2d')]);_0x90b26a[_0xd6c4('0x32')]=_[_0xd6c4('0x4e')](_0x401a80['query']);_0x90b26a['filters']=_[_0xd6c4('0x34')](_0x90b26a[_0xd6c4('0x31')],_0x90b26a[_0xd6c4('0x32')]);_0x3623f9[_0xd6c4('0x36')]=_[_0xd6c4('0x34')](_0x90b26a['model'],qs['fields'](_0x401a80[_0xd6c4('0x32')][_0xd6c4('0x35')]));_0x3623f9[_0xd6c4('0x36')]=_0x3623f9[_0xd6c4('0x36')][_0xd6c4('0x43')]?_0x3623f9[_0xd6c4('0x36')]:_0x90b26a[_0xd6c4('0x31')];if(!_0x401a80[_0xd6c4('0x32')][_0xd6c4('0x58')]('nolimit')){_0x3623f9['limit']=qs['limit'](_0x401a80[_0xd6c4('0x32')][_0xd6c4('0x1d')]);_0x3623f9[_0xd6c4('0x1a')]=qs[_0xd6c4('0x1a')](_0x401a80[_0xd6c4('0x32')][_0xd6c4('0x1a')]);}_0x3623f9[_0xd6c4('0x38')]=qs[_0xd6c4('0x39')](_0x401a80[_0xd6c4('0x32')][_0xd6c4('0x39')]);_0x3623f9['where']=qs[_0xd6c4('0x33')](_[_0xd6c4('0x3b')](_0x401a80[_0xd6c4('0x32')],_0x90b26a[_0xd6c4('0x33')]));_0x3623f9[_0xd6c4('0x3a')][_0xd6c4('0x59')]=_0x1ef9b4['id'];if(_0x401a80[_0xd6c4('0x32')][_0xd6c4('0x3e')]){_0x3623f9['where']=_[_0xd6c4('0x3c')](_0x3623f9[_0xd6c4('0x3a')],{'$or':_[_0xd6c4('0x2b')](_0x3623f9['attributes'],function(_0x2381aa){var _0x41ec60={};_0x41ec60[_0x2381aa]={'$like':'%'+_0x401a80[_0xd6c4('0x32')][_0xd6c4('0x3e')]+'%'};return _0x41ec60;})});}_0x3623f9=_[_0xd6c4('0x3c')]({},_0x3623f9,_0x401a80[_0xd6c4('0x3f')]);return db[_0xd6c4('0x5d')]['count']({'where':_0x3623f9[_0xd6c4('0x3a')]})[_0xd6c4('0x24')](function(_0x44c6c3){_0x501b51[_0xd6c4('0x1c')]=_0x44c6c3;if(_0x401a80[_0xd6c4('0x32')][_0xd6c4('0x40')]){_0x3623f9[_0xd6c4('0x4f')]=[{'all':!![]}];}return db[_0xd6c4('0x5d')][_0xd6c4('0x5a')](_0x3623f9);})[_0xd6c4('0x24')](function(_0x317055){_0x501b51['rows']=_0x317055;return _0x501b51;});}})[_0xd6c4('0x24')](respondWithFilteredResult(_0x57c305,_0x3623f9))[_0xd6c4('0x45')](handleError(_0x57c305,null));};function char(_0x4c98cb){return'number'===typeof _0x4c98cb?String[_0xd6c4('0x5e')][_0xd6c4('0x1f')](null,arguments):_0x4c98cb;}function needsEncapsulation(_0x6d902b){return!!_0x6d902b&&(_0x6d902b[_0xd6c4('0x5f')]()[_0xd6c4('0x60')](char(0xd))>=0x0||_0x6d902b[_0xd6c4('0x5f')]()[_0xd6c4('0x60')](char(0xa))>=0x0||_0x6d902b['toString']()[_0xd6c4('0x60')](char(0x2c))>=0x0||_0x6d902b[_0xd6c4('0x5f')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x51489e){var _0x1d5e95=char(0x22),_0x35b00d='\x5c'+char(0x22),_0x443ae1=_0x51489e['toString']()[_0xd6c4('0x61')](new RegExp(_0x1d5e95,'g'),_0x35b00d);return _0x1d5e95+_0x443ae1+_0x1d5e95;}exports['getSummary']=function(_0x99a6b5,_0x3db26d,_0x3b8467){var _0x3c89a9,_0x3f8e7b;var _0x56a800={'where':{'ProjectId':_0x99a6b5[_0xd6c4('0x42')]['id']}};if(_0x99a6b5['query'][_0xd6c4('0x62')]){_0x56a800[_0xd6c4('0x3a')]['starttime']=JSON[_0xd6c4('0x63')](_0x99a6b5[_0xd6c4('0x32')][_0xd6c4('0x62')]);}return db[_0xd6c4('0x57')][_0xd6c4('0x5a')](_0x56a800)[_0xd6c4('0x24')](handleEntityNotFound(_0x3db26d,null))[_0xd6c4('0x24')](function(_0x226e15){if(_0x226e15){_0x3c89a9=_0x226e15;return db[_0xd6c4('0x64')][_0xd6c4('0x5a')]({'where':{'SessionId':{'$in':_['map'](_0x3c89a9,'id')},'ProjectId':_0x99a6b5[_0xd6c4('0x42')]['id']},'order':_0xd6c4('0x65')});}})['then'](handleEntityNotFound(_0x3db26d,null))[_0xd6c4('0x24')](function(_0x566819){if(_0x566819){_0x3f8e7b=_0x566819;var _0x22af34={};for(var _0x1673f8=0x0,_0xd37e02=_0x3f8e7b[_0xd6c4('0x43')];_0x1673f8<_0xd37e02;_0x1673f8++){if(!_0x22af34['hasOwnProperty'](_0x3f8e7b[_0x1673f8]['questionId'])){_0x22af34[_0x3f8e7b[_0x1673f8]['questionId']]=needsEncapsulation(_0x3f8e7b[_0x1673f8][_0xd6c4('0x66')])?encapsulate(_0x3f8e7b[_0x1673f8]['question']):_0x3f8e7b[_0x1673f8]['question'];}}var _0x456b27=[],_0x190b4d={};for(var _0xf4a9d2=0x0,_0x32de60=_0x3c89a9[_0xd6c4('0x43')];_0xf4a9d2<_0x32de60;_0xf4a9d2++){_0x190b4d={'ProjectId':_0x99a6b5[_0xd6c4('0x42')]['id'],'SessionId':_0x3c89a9[_0xf4a9d2]['id'],'StartTime':moment(_0x3c89a9[_0xf4a9d2][_0xd6c4('0x67')])['format'](_0xd6c4('0x68'))};for(var _0x81b7d2=0x0,_0x31c448=_0x3f8e7b['length'];_0x81b7d2<_0x31c448;_0x81b7d2++){if(_0x3f8e7b[_0x81b7d2]['SessionId']==_0x3c89a9[_0xf4a9d2]['id']&&_0x22af34[_0xd6c4('0x58')](_0x3f8e7b[_0x81b7d2][_0xd6c4('0x69')])){_0x190b4d[_0x22af34[_0x3f8e7b[_0x81b7d2][_0xd6c4('0x69')]]]=_0x3f8e7b[_0x81b7d2]['answer'];}}for(var _0x4d93b6 in _0x22af34){if(!_0x190b4d[_0xd6c4('0x58')](_0x22af34[_0x4d93b6])){_0x190b4d[_0x22af34[_0x4d93b6]]=null;}}_0x456b27[_0xd6c4('0x6a')](_0x190b4d);}return _0x456b27;}})[_0xd6c4('0x24')](function(_0x9b17d3){if(!_[_0xd6c4('0x6b')](_0x9b17d3)){var _0x10d720=toCsv(_0x9b17d3);var _0x942773=Date[_0xd6c4('0x6c')]();fs['writeFileSync'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x99a6b5[_0xd6c4('0x42')]['id'],_0x942773),_0x10d720);_0x3db26d[_0xd6c4('0x6d')](_0xd6c4('0x6e'),_0xd6c4('0x6f')+util[_0xd6c4('0x70')](_0xd6c4('0x71'),_0x99a6b5['params']['id'],_0x942773));_0x3db26d[_0xd6c4('0x6d')](_0xd6c4('0x72'),_0xd6c4('0x73'));return _0x3db26d[_0xd6c4('0x74')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x99a6b5[_0xd6c4('0x42')]['id'],_0x942773));}else{return _0x3db26d[_0xd6c4('0x28')](0xcc);}})[_0xd6c4('0x45')](handleError(_0x3db26d,null));}; \ No newline at end of file +var _0x6e6c=['fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','length','find','create','user','UserProfileSection','autoAssociation','UserProfileResource','clone','params','createdAt','omit','body','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','getSessions','JscriptySessionReport','nolimit','getAnswers','findOne','JscriptyAnswerReport','ProjectId','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','end','error','stack','name','send','index','map','JscriptyProject','rawAttributes'];(function(_0x4e46aa,_0x4413e3){var _0x1ff81d=function(_0x497b09){while(--_0x497b09){_0x4e46aa['push'](_0x4e46aa['shift']());}};_0x1ff81d(++_0x4413e3);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];function respondWithStatusCode(_0x525d60,_0x3a30ce){_0x3a30ce=_0x3a30ce||0xcc;return function(_0x314d0f){if(_0x314d0f){return _0x525d60[_0xc6e6('0x17')](_0x3a30ce);}return _0x525d60[_0xc6e6('0x18')](_0x3a30ce)['end']();};}function respondWithResult(_0x149ac6,_0x2bfe7d){_0x2bfe7d=_0x2bfe7d||0xc8;return function(_0x13be73){if(_0x13be73){return _0x149ac6[_0xc6e6('0x18')](_0x2bfe7d)[_0xc6e6('0x19')](_0x13be73);}};}function respondWithFilteredResult(_0x4cdf15,_0x413cf8){return function(_0x178b34){if(_0x178b34){var _0x569474=typeof _0x413cf8[_0xc6e6('0x1a')]===_0xc6e6('0x1b')&&typeof _0x413cf8[_0xc6e6('0x1c')]==='undefined';var _0x51fd7c=_0x178b34['count'];var _0x3a1ccc=_0x569474?0x0:_0x413cf8['offset'];var _0x46e58f=_0x569474?_0x178b34[_0xc6e6('0x1d')]:_0x413cf8[_0xc6e6('0x1a')]+_0x413cf8[_0xc6e6('0x1c')];var _0x19e1e4;if(_0x46e58f>=_0x51fd7c){_0x46e58f=_0x51fd7c;_0x19e1e4=0xc8;}else{_0x19e1e4=0xce;}_0x4cdf15[_0xc6e6('0x18')](_0x19e1e4);return _0x4cdf15[_0xc6e6('0x1e')](_0xc6e6('0x1f'),_0x3a1ccc+'-'+_0x46e58f+'/'+_0x51fd7c)[_0xc6e6('0x19')](_0x178b34);}return null;};}function patchUpdates(_0x3d734d){return function(_0x4a36b6){try{jsonpatch[_0xc6e6('0x20')](_0x4a36b6,_0x3d734d,!![]);}catch(_0x4ad70e){return BPromise[_0xc6e6('0x21')](_0x4ad70e);}return _0x4a36b6[_0xc6e6('0x22')]();};}function saveUpdates(_0x2be6fc,_0x2f69f1){return function(_0x4f1d68){if(_0x4f1d68){return _0x4f1d68[_0xc6e6('0x23')](_0x2be6fc)[_0xc6e6('0x24')](function(_0x3a96df){return _0x3a96df;});}return null;};}function removeEntity(_0x36ebfa,_0x107561){return function(_0x4c35ae){if(_0x4c35ae){return _0x4c35ae[_0xc6e6('0x25')]()['then'](function(){var _0x266786=_0x4c35ae[_0xc6e6('0x26')]({'plain':!![]});var _0x2e5e0e=_0xc6e6('0x27');return db['UserProfileResource'][_0xc6e6('0x25')]({'where':{'type':_0x2e5e0e,'resourceId':_0x266786['id']}})['then'](function(){return _0x4c35ae;});})[_0xc6e6('0x24')](function(){_0x36ebfa['status'](0xcc)[_0xc6e6('0x28')]();});}};}function handleEntityNotFound(_0x16dcd9,_0x348888){return function(_0x41e7c2){if(!_0x41e7c2){_0x16dcd9[_0xc6e6('0x17')](0x194);}return _0x41e7c2;};}function handleError(_0x5e34f6,_0x346480){_0x346480=_0x346480||0x1f4;return function(_0x1501bd){logger[_0xc6e6('0x29')](_0x1501bd[_0xc6e6('0x2a')]);if(_0x1501bd['name']){delete _0x1501bd[_0xc6e6('0x2b')];}_0x5e34f6['status'](_0x346480)[_0xc6e6('0x2c')](_0x1501bd);};}exports[_0xc6e6('0x2d')]=function(_0x12c616,_0xc578b3){var _0xd3b63={},_0x402598={},_0x43ff9c={'count':0x0,'rows':[]};var _0x337442=_[_0xc6e6('0x2e')](db[_0xc6e6('0x2f')][_0xc6e6('0x30')],function(_0x214d6a){return{'name':_0x214d6a[_0xc6e6('0x31')],'type':_0x214d6a[_0xc6e6('0x32')][_0xc6e6('0x33')]};});_0x402598[_0xc6e6('0x34')]=_[_0xc6e6('0x2e')](_0x337442,'name');_0x402598[_0xc6e6('0x35')]=_[_0xc6e6('0x36')](_0x12c616['query']);_0x402598['filters']=_[_0xc6e6('0x37')](_0x402598[_0xc6e6('0x34')],_0x402598[_0xc6e6('0x35')]);_0xd3b63[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x402598[_0xc6e6('0x34')],qs['fields'](_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x39')]));_0xd3b63[_0xc6e6('0x38')]=_0xd3b63['attributes']['length']?_0xd3b63[_0xc6e6('0x38')]:_0x402598[_0xc6e6('0x34')];if(!_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x3a')]('nolimit')){_0xd3b63['limit']=qs[_0xc6e6('0x1c')](_0x12c616['query'][_0xc6e6('0x1c')]);_0xd3b63['offset']=qs[_0xc6e6('0x1a')](_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x1a')]);}_0xd3b63[_0xc6e6('0x3b')]=qs['sort'](_0x12c616['query'][_0xc6e6('0x3c')]);_0xd3b63[_0xc6e6('0x3d')]=qs[_0xc6e6('0x3e')](_[_0xc6e6('0x3f')](_0x12c616['query'],_0x402598['filters']),_0x337442);if(_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x40')]){_0xd3b63[_0xc6e6('0x3d')]=_[_0xc6e6('0x41')](_0xd3b63['where'],{'$or':_[_0xc6e6('0x2e')](_0x337442,function(_0x46c3ef){if(_0x46c3ef['type']!=='VIRTUAL'){var _0x2b01fd={};_0x2b01fd[_0x46c3ef['name']]={'$like':'%'+_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x40')]+'%'};return _0x2b01fd;}})});}_0xd3b63=_['merge']({},_0xd3b63,_0x12c616[_0xc6e6('0x42')]);var _0x50c96d={'where':_0xd3b63[_0xc6e6('0x3d')]};return db['JscriptyProject'][_0xc6e6('0x1d')](_0x50c96d)[_0xc6e6('0x24')](function(_0x247076){_0x43ff9c[_0xc6e6('0x1d')]=_0x247076;if(_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x43')]){_0xd3b63[_0xc6e6('0x44')]=[{'all':!![]}];}return db[_0xc6e6('0x2f')][_0xc6e6('0x45')](_0xd3b63);})['then'](function(_0x3e3da6){_0x43ff9c[_0xc6e6('0x46')]=_0x3e3da6;return _0x43ff9c;})[_0xc6e6('0x24')](respondWithFilteredResult(_0xc578b3,_0xd3b63))[_0xc6e6('0x47')](handleError(_0xc578b3,null));};exports['show']=function(_0xc5f4fb,_0x825640){var _0x3a46ee={'raw':![],'where':{'id':_0xc5f4fb['params']['id']}},_0x2fa3c5={};_0x2fa3c5[_0xc6e6('0x34')]=_[_0xc6e6('0x36')](db[_0xc6e6('0x2f')][_0xc6e6('0x30')]);_0x2fa3c5[_0xc6e6('0x35')]=_['keys'](_0xc5f4fb[_0xc6e6('0x35')]);_0x2fa3c5['filters']=_[_0xc6e6('0x37')](_0x2fa3c5['model'],_0x2fa3c5[_0xc6e6('0x35')]);_0x3a46ee[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x2fa3c5[_0xc6e6('0x34')],qs[_0xc6e6('0x39')](_0xc5f4fb[_0xc6e6('0x35')][_0xc6e6('0x39')]));_0x3a46ee[_0xc6e6('0x38')]=_0x3a46ee['attributes'][_0xc6e6('0x48')]?_0x3a46ee[_0xc6e6('0x38')]:_0x2fa3c5[_0xc6e6('0x34')];if(_0xc5f4fb['query'][_0xc6e6('0x43')]){_0x3a46ee[_0xc6e6('0x44')]=[{'all':!![]}];}_0x3a46ee=_[_0xc6e6('0x41')]({},_0x3a46ee,_0xc5f4fb[_0xc6e6('0x42')]);return db[_0xc6e6('0x2f')][_0xc6e6('0x49')](_0x3a46ee)[_0xc6e6('0x24')](handleEntityNotFound(_0x825640,null))[_0xc6e6('0x24')](respondWithResult(_0x825640,null))[_0xc6e6('0x47')](handleError(_0x825640,null));};exports[_0xc6e6('0x4a')]=function(_0x3bfe85,_0x470167){return db[_0xc6e6('0x2f')][_0xc6e6('0x4a')](_0x3bfe85['body'],{})[_0xc6e6('0x24')](function(_0x5566df){var _0x2c48e7=_0x3bfe85[_0xc6e6('0x4b')]['get']({'plain':!![]});if(!_0x2c48e7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c48e7['role']==='user'){var _0x531dca=_0x5566df[_0xc6e6('0x26')]({'plain':!![]});var _0x40bbe9=_0xc6e6('0x27');return db[_0xc6e6('0x4c')][_0xc6e6('0x49')]({'where':{'name':_0x40bbe9,'userProfileId':_0x2c48e7['userProfileId']},'raw':!![]})['then'](function(_0x335229){if(_0x335229&&_0x335229[_0xc6e6('0x4d')]===0x0){return db[_0xc6e6('0x4e')][_0xc6e6('0x4a')]({'name':_0x531dca['name'],'resourceId':_0x531dca['id'],'type':_0x335229[_0xc6e6('0x2b')],'sectionId':_0x335229['id']},{})[_0xc6e6('0x24')](function(){return _0x5566df;});}else{return _0x5566df;}})[_0xc6e6('0x47')](function(_0x286dcf){logger[_0xc6e6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x286dcf);throw _0x286dcf;});}return _0x5566df;})[_0xc6e6('0x24')](respondWithResult(_0x470167,0xc9))[_0xc6e6('0x47')](handleError(_0x470167,null));};exports[_0xc6e6('0x4f')]=function(_0x5113e3,_0x3df0db){var _0x2c2ece={'where':{'id':_0x5113e3[_0xc6e6('0x50')]['id']}},_0xa0032b={};_0xa0032b[_0xc6e6('0x34')]=_['keys'](db[_0xc6e6('0x2f')][_0xc6e6('0x30')]);_0x2c2ece[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0xa0032b[_0xc6e6('0x34')],qs['fields'](_0x5113e3['query']['fields']));_0x2c2ece[_0xc6e6('0x38')]=_0x2c2ece[_0xc6e6('0x38')][_0xc6e6('0x48')]?_0x2c2ece[_0xc6e6('0x38')]:_0xa0032b[_0xc6e6('0x34')];if(_0x5113e3[_0xc6e6('0x35')]['includeAll']){_0x2c2ece[_0xc6e6('0x44')]=[{'all':!![]}];}_0x2c2ece=_['merge']({},_0x2c2ece,_0x5113e3[_0xc6e6('0x42')]);return db[_0xc6e6('0x2f')][_0xc6e6('0x49')](_0x2c2ece)['then'](handleEntityNotFound(_0x3df0db,null))[_0xc6e6('0x24')](function(_0x5c89ed){if(_0x5c89ed){var _0x3b6822=_0x5c89ed['get']({'plain':!![]});_0x3b6822=qs['omit'](_0x3b6822,['id',_0xc6e6('0x51'),'updatedAt']);_0x5113e3['body']=_[_0xc6e6('0x52')](_0x5113e3[_0xc6e6('0x53')],['id',_0xc6e6('0x51'),_0xc6e6('0x54')]);return db[_0xc6e6('0x2f')][_0xc6e6('0x4a')](_[_0xc6e6('0x41')](_0x3b6822,_0x5113e3[_0xc6e6('0x53')]),{'include':_0x5113e3['query'][_0xc6e6('0x43')]?[{'all':!![]}]:undefined})[_0xc6e6('0x24')](function(_0x35b43f){var _0x345bc3=_0x5113e3['user'][_0xc6e6('0x26')]({'plain':!![]});if(!_0x345bc3)throw new Error(_0xc6e6('0x55'));if(_0x345bc3[_0xc6e6('0x56')]==='user'){var _0x5c007d=_0x35b43f[_0xc6e6('0x26')]({'plain':!![]});var _0x5ddc81='Projects';return db[_0xc6e6('0x4c')][_0xc6e6('0x49')]({'where':{'name':_0x5ddc81,'userProfileId':_0x345bc3[_0xc6e6('0x57')]},'raw':!![]})[_0xc6e6('0x24')](function(_0x269f63){if(_0x269f63&&_0x269f63[_0xc6e6('0x4d')]===0x0){return db[_0xc6e6('0x4e')][_0xc6e6('0x4a')]({'name':_0x5c007d[_0xc6e6('0x2b')],'resourceId':_0x5c007d['id'],'type':_0x269f63[_0xc6e6('0x2b')],'sectionId':_0x269f63['id']},{})[_0xc6e6('0x24')](function(){return _0x35b43f;});}else{return _0x35b43f;}})['catch'](function(_0x552b4f){logger[_0xc6e6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x552b4f);throw _0x552b4f;});}return _0x35b43f;});}})['then'](respondWithResult(_0x3df0db,0xc9))[_0xc6e6('0x47')](handleError(_0x3df0db,null));};exports[_0xc6e6('0x23')]=function(_0x27c5f0,_0x4f0543){if(_0x27c5f0[_0xc6e6('0x53')]['id']){delete _0x27c5f0[_0xc6e6('0x53')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x27c5f0[_0xc6e6('0x50')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x4f0543,null))[_0xc6e6('0x24')](saveUpdates(_0x27c5f0[_0xc6e6('0x53')],null))[_0xc6e6('0x24')](respondWithResult(_0x4f0543,null))[_0xc6e6('0x47')](handleError(_0x4f0543,null));};exports['destroy']=function(_0x21f52a,_0x12d300){return db[_0xc6e6('0x2f')][_0xc6e6('0x49')]({'where':{'id':_0x21f52a[_0xc6e6('0x50')]['id']}})['then'](handleEntityNotFound(_0x12d300,null))[_0xc6e6('0x24')](removeEntity(_0x12d300,null))[_0xc6e6('0x47')](handleError(_0x12d300,null));};exports[_0xc6e6('0x58')]=function(_0x36abee,_0x1f3e86,_0x26dac8){var _0x540b22={'raw':!![],'where':{}};var _0x27e74b={};var _0x4c4985={'count':0x0,'rows':[]};return db[_0xc6e6('0x2f')]['findOne']({'where':{'id':_0x36abee['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x1f3e86,null))['then'](function(_0x31cca2){if(_0x31cca2){_0x27e74b[_0xc6e6('0x34')]=_[_0xc6e6('0x36')](db[_0xc6e6('0x59')][_0xc6e6('0x30')]);_0x27e74b['query']=_[_0xc6e6('0x36')](_0x36abee['query']);_0x27e74b['filters']=_[_0xc6e6('0x37')](_0x27e74b[_0xc6e6('0x34')],_0x27e74b[_0xc6e6('0x35')]);_0x540b22['attributes']=_[_0xc6e6('0x37')](_0x27e74b['model'],qs['fields'](_0x36abee[_0xc6e6('0x35')]['fields']));_0x540b22[_0xc6e6('0x38')]=_0x540b22[_0xc6e6('0x38')][_0xc6e6('0x48')]?_0x540b22[_0xc6e6('0x38')]:_0x27e74b['model'];if(!_0x36abee[_0xc6e6('0x35')][_0xc6e6('0x3a')](_0xc6e6('0x5a'))){_0x540b22[_0xc6e6('0x1c')]=qs[_0xc6e6('0x1c')](_0x36abee['query'][_0xc6e6('0x1c')]);_0x540b22[_0xc6e6('0x1a')]=qs[_0xc6e6('0x1a')](_0x36abee[_0xc6e6('0x35')]['offset']);}_0x540b22['order']=qs[_0xc6e6('0x3c')](_0x36abee[_0xc6e6('0x35')][_0xc6e6('0x3c')]);_0x540b22[_0xc6e6('0x3d')]=qs[_0xc6e6('0x3e')](_[_0xc6e6('0x3f')](_0x36abee[_0xc6e6('0x35')],_0x27e74b[_0xc6e6('0x3e')]));_0x540b22[_0xc6e6('0x3d')]['ProjectId']=_0x31cca2['id'];if(_0x36abee['query'][_0xc6e6('0x40')]){_0x540b22['where']=_[_0xc6e6('0x41')](_0x540b22[_0xc6e6('0x3d')],{'$or':_[_0xc6e6('0x2e')](_0x540b22['attributes'],function(_0x5b0c3b){var _0x38b1ed={};_0x38b1ed[_0x5b0c3b]={'$like':'%'+_0x36abee['query'][_0xc6e6('0x40')]+'%'};return _0x38b1ed;})});}_0x540b22=_['merge']({},_0x540b22,_0x36abee[_0xc6e6('0x42')]);return db[_0xc6e6('0x59')]['count']({'where':_0x540b22[_0xc6e6('0x3d')]})[_0xc6e6('0x24')](function(_0x5a1997){_0x4c4985['count']=_0x5a1997;if(_0x36abee[_0xc6e6('0x35')][_0xc6e6('0x43')]){_0x540b22[_0xc6e6('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xc6e6('0x45')](_0x540b22);})[_0xc6e6('0x24')](function(_0x4e7b05){_0x4c4985['rows']=_0x4e7b05;return _0x4c4985;});}})['then'](respondWithFilteredResult(_0x1f3e86,_0x540b22))[_0xc6e6('0x47')](handleError(_0x1f3e86,null));};exports[_0xc6e6('0x5b')]=function(_0xfcefd8,_0x202331,_0x30ab02){var _0xcde47f={'raw':!![],'where':{}};var _0x58aef4={};var _0x21b965={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xc6e6('0x5c')]({'where':{'id':_0xfcefd8[_0xc6e6('0x50')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x202331,null))['then'](function(_0x503cdb){if(_0x503cdb){_0x58aef4[_0xc6e6('0x34')]=_[_0xc6e6('0x36')](db[_0xc6e6('0x5d')][_0xc6e6('0x30')]);_0x58aef4[_0xc6e6('0x35')]=_[_0xc6e6('0x36')](_0xfcefd8[_0xc6e6('0x35')]);_0x58aef4[_0xc6e6('0x3e')]=_['intersection'](_0x58aef4['model'],_0x58aef4[_0xc6e6('0x35')]);_0xcde47f[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x58aef4[_0xc6e6('0x34')],qs[_0xc6e6('0x39')](_0xfcefd8['query']['fields']));_0xcde47f[_0xc6e6('0x38')]=_0xcde47f[_0xc6e6('0x38')]['length']?_0xcde47f['attributes']:_0x58aef4[_0xc6e6('0x34')];if(!_0xfcefd8[_0xc6e6('0x35')][_0xc6e6('0x3a')](_0xc6e6('0x5a'))){_0xcde47f['limit']=qs[_0xc6e6('0x1c')](_0xfcefd8[_0xc6e6('0x35')][_0xc6e6('0x1c')]);_0xcde47f['offset']=qs['offset'](_0xfcefd8[_0xc6e6('0x35')][_0xc6e6('0x1a')]);}_0xcde47f['order']=qs['sort'](_0xfcefd8[_0xc6e6('0x35')][_0xc6e6('0x3c')]);_0xcde47f[_0xc6e6('0x3d')]=qs['filters'](_[_0xc6e6('0x3f')](_0xfcefd8[_0xc6e6('0x35')],_0x58aef4[_0xc6e6('0x3e')]));_0xcde47f[_0xc6e6('0x3d')][_0xc6e6('0x5e')]=_0x503cdb['id'];if(_0xfcefd8[_0xc6e6('0x35')]['filter']){_0xcde47f[_0xc6e6('0x3d')]=_[_0xc6e6('0x41')](_0xcde47f[_0xc6e6('0x3d')],{'$or':_[_0xc6e6('0x2e')](_0xcde47f['attributes'],function(_0x1742bd){var _0x408b41={};_0x408b41[_0x1742bd]={'$like':'%'+_0xfcefd8[_0xc6e6('0x35')]['filter']+'%'};return _0x408b41;})});}_0xcde47f=_[_0xc6e6('0x41')]({},_0xcde47f,_0xfcefd8[_0xc6e6('0x42')]);return db[_0xc6e6('0x5d')][_0xc6e6('0x1d')]({'where':_0xcde47f[_0xc6e6('0x3d')]})['then'](function(_0x3f5d70){_0x21b965[_0xc6e6('0x1d')]=_0x3f5d70;if(_0xfcefd8[_0xc6e6('0x35')][_0xc6e6('0x43')]){_0xcde47f[_0xc6e6('0x44')]=[{'all':!![]}];}return db[_0xc6e6('0x5d')]['findAll'](_0xcde47f);})[_0xc6e6('0x24')](function(_0x4cd2af){_0x21b965[_0xc6e6('0x46')]=_0x4cd2af;return _0x21b965;});}})[_0xc6e6('0x24')](respondWithFilteredResult(_0x202331,_0xcde47f))[_0xc6e6('0x47')](handleError(_0x202331,null));};function char(_0x410cfd){return _0xc6e6('0x5f')===typeof _0x410cfd?String[_0xc6e6('0x60')][_0xc6e6('0x20')](null,arguments):_0x410cfd;}function needsEncapsulation(_0x3df453){return!!_0x3df453&&(_0x3df453['toString']()[_0xc6e6('0x61')](char(0xd))>=0x0||_0x3df453[_0xc6e6('0x62')]()[_0xc6e6('0x61')](char(0xa))>=0x0||_0x3df453[_0xc6e6('0x62')]()[_0xc6e6('0x61')](char(0x2c))>=0x0||_0x3df453[_0xc6e6('0x62')]()[_0xc6e6('0x61')](char(0x22))>=0x0);}function encapsulate(_0x5091c2){var _0x4b97ac=char(0x22),_0x2df111='\x5c'+char(0x22),_0x19bb49=_0x5091c2['toString']()[_0xc6e6('0x63')](new RegExp(_0x4b97ac,'g'),_0x2df111);return _0x4b97ac+_0x19bb49+_0x4b97ac;}exports[_0xc6e6('0x64')]=function(_0x50af47,_0x48a326,_0xe15a78){var _0x79d341,_0x55cfce;var _0x4db332={'where':{'ProjectId':_0x50af47[_0xc6e6('0x50')]['id']}};if(_0x50af47[_0xc6e6('0x35')][_0xc6e6('0x65')]){_0x4db332['where'][_0xc6e6('0x66')]=JSON[_0xc6e6('0x67')](_0x50af47[_0xc6e6('0x35')][_0xc6e6('0x65')]);}return db[_0xc6e6('0x59')][_0xc6e6('0x45')](_0x4db332)['then'](handleEntityNotFound(_0x48a326,null))['then'](function(_0x2eb18c){if(_0x2eb18c){_0x79d341=_0x2eb18c;return db[_0xc6e6('0x68')][_0xc6e6('0x45')]({'where':{'SessionId':{'$in':_['map'](_0x79d341,'id')},'ProjectId':_0x50af47['params']['id']},'order':_0xc6e6('0x69')});}})[_0xc6e6('0x24')](handleEntityNotFound(_0x48a326,null))[_0xc6e6('0x24')](function(_0x2d9ae3){if(_0x2d9ae3){_0x55cfce=_0x2d9ae3;var _0x178d20={};for(var _0x353615=0x0,_0x24af66=_0x55cfce[_0xc6e6('0x48')];_0x353615<_0x24af66;_0x353615++){if(!_0x178d20[_0xc6e6('0x3a')](_0x55cfce[_0x353615][_0xc6e6('0x6a')])){_0x178d20[_0x55cfce[_0x353615][_0xc6e6('0x6a')]]=needsEncapsulation(_0x55cfce[_0x353615]['question'])?encapsulate(_0x55cfce[_0x353615]['question']):_0x55cfce[_0x353615]['question'];}}var _0x2dfaa8=[],_0x55a993={};for(var _0x49b030=0x0,_0x12c95c=_0x79d341[_0xc6e6('0x48')];_0x49b030<_0x12c95c;_0x49b030++){_0x55a993={'ProjectId':_0x50af47['params']['id'],'SessionId':_0x79d341[_0x49b030]['id'],'StartTime':moment(_0x79d341[_0x49b030]['starttime'])[_0xc6e6('0x6b')](_0xc6e6('0x6c'))};for(var _0x1d32b4=0x0,_0x5f1f6f=_0x55cfce[_0xc6e6('0x48')];_0x1d32b4<_0x5f1f6f;_0x1d32b4++){if(_0x55cfce[_0x1d32b4][_0xc6e6('0x6d')]==_0x79d341[_0x49b030]['id']&&_0x178d20['hasOwnProperty'](_0x55cfce[_0x1d32b4]['questionId'])){_0x55a993[_0x178d20[_0x55cfce[_0x1d32b4][_0xc6e6('0x6a')]]]=_0x55cfce[_0x1d32b4][_0xc6e6('0x6e')];}}for(var _0x2a1266 in _0x178d20){if(!_0x55a993[_0xc6e6('0x3a')](_0x178d20[_0x2a1266])){_0x55a993[_0x178d20[_0x2a1266]]=null;}}_0x2dfaa8[_0xc6e6('0x6f')](_0x55a993);}return _0x2dfaa8;}})['then'](function(_0x4c8ec3){if(!_[_0xc6e6('0x70')](_0x4c8ec3)){var _0x162b33=toCsv(_0x4c8ec3);var _0x5c82da=Date['now']();fs[_0xc6e6('0x71')](util['format'](_0xc6e6('0x72'),_0x50af47[_0xc6e6('0x50')]['id'],_0x5c82da),_0x162b33);_0x48a326[_0xc6e6('0x73')](_0xc6e6('0x74'),_0xc6e6('0x75')+util['format'](_0xc6e6('0x76'),_0x50af47['params']['id'],_0x5c82da));_0x48a326[_0xc6e6('0x73')](_0xc6e6('0x77'),_0xc6e6('0x78'));return _0x48a326[_0xc6e6('0x79')](util[_0xc6e6('0x6b')](_0xc6e6('0x72'),_0x50af47[_0xc6e6('0x50')]['id'],_0x5c82da));}else{return _0x48a326[_0xc6e6('0x17')](0xcc);}})[_0xc6e6('0x47')](handleError(_0x48a326,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 1a5c7d6..e35323c 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 _0xe9e7=['../../config/environment','./jscriptyProject.attributes','define','jscripty_projects','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x11b677,_0x2e556f){var _0x34ccdb=function(_0x28c277){while(--_0x28c277){_0x11b677['push'](_0x11b677['shift']());}};_0x34ccdb(++_0x2e556f);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x55081f,_0x3fc0e7){_0x55081f=_0x55081f-0x0;var _0x2f0566=_0xe9e7[_0x55081f];return _0x2f0566;};'use strict';var _=require(_0x7e9e('0x0'));var util=require(_0x7e9e('0x1'));var logger=require(_0x7e9e('0x2'))('api');var moment=require(_0x7e9e('0x3'));var BPromise=require(_0x7e9e('0x4'));var rp=require(_0x7e9e('0x5'));var fs=require('fs');var path=require(_0x7e9e('0x6'));var rimraf=require(_0x7e9e('0x7'));var config=require(_0x7e9e('0x8'));var attributes=require(_0x7e9e('0x9'));module['exports']=function(_0x319f70,_0x134fac){return _0x319f70[_0x7e9e('0xa')]('JscriptyProject',attributes,{'tableName':_0x7e9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fb8=['rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','bluebird'];(function(_0x1658e6,_0x43b52e){var _0xc54a9e=function(_0x2a9e46){while(--_0x2a9e46){_0x1658e6['push'](_0x1658e6['shift']());}};_0xc54a9e(++_0x43b52e);}(_0x6fb8,0x104));var _0x86fb=function(_0x2d3ab3,_0x47d90b){_0x2d3ab3=_0x2d3ab3-0x0;var _0x321f9e=_0x6fb8[_0x2d3ab3];return _0x321f9e;};'use strict';var _=require(_0x86fb('0x0'));var util=require('util');var logger=require(_0x86fb('0x1'))(_0x86fb('0x2'));var moment=require('moment');var BPromise=require(_0x86fb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x86fb('0x4'));var config=require(_0x86fb('0x5'));var attributes=require(_0x86fb('0x6'));module[_0x86fb('0x7')]=function(_0x1aa956,_0x7ba395){return _0x1aa956[_0x86fb('0x8')](_0x86fb('0x9'),attributes,{'tableName':_0x86fb('0xa'),'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 3584281..08540d1 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 _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(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0xbdb7[_0x17882c];return _0x355a59;};'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 +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x46da41,_0x3ae289){var _0x121015=function(_0x3dee74){while(--_0x3dee74){_0x46da41['push'](_0x46da41['shift']());}};_0x121015(++_0x3ae289);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xcb91[_0x20a558];return _0x53d3f7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index ee1c8a0..1433b28 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 _0x8028=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','destroy','multer','util'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x8028,0xe5));var _0x8802=function(_0x3a1b58,_0x16ae40){_0x3a1b58=_0x3a1b58-0x0;var _0x3f63b7=_0x8028[_0x3a1b58];return _0x3f63b7;};'use strict';var multer=require(_0x8802('0x0'));var util=require(_0x8802('0x1'));var path=require(_0x8802('0x2'));var timeout=require(_0x8802('0x3'));var express=require(_0x8802('0x4'));var router=express[_0x8802('0x5')]();var fs_extra=require(_0x8802('0x6'));var auth=require(_0x8802('0x7'));var interaction=require(_0x8802('0x8'));var config=require(_0x8802('0x9'));var controller=require(_0x8802('0xa'));router[_0x8802('0xb')]('/',auth[_0x8802('0xc')](),controller[_0x8802('0xd')]);router[_0x8802('0xb')](_0x8802('0xe'),auth[_0x8802('0xc')](),controller[_0x8802('0xf')]);router[_0x8802('0xb')](_0x8802('0x10'),auth[_0x8802('0xc')](),controller[_0x8802('0x11')]);router[_0x8802('0x12')]('/',auth[_0x8802('0xc')](),controller['create']);router['put'](_0x8802('0x10'),auth[_0x8802('0xc')](),controller[_0x8802('0x13')]);router['delete'](_0x8802('0x10'),auth[_0x8802('0xc')](),controller[_0x8802('0x14')]);module['exports']=router; \ No newline at end of file +var _0x2e0b=['create','put','delete','multer','util','path','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x2e0b,0x120));var _0xb2e0=function(_0x149bc3,_0x4b09d8){_0x149bc3=_0x149bc3-0x0;var _0x5d33eb=_0x2e0b[_0x149bc3];return _0x5d33eb;};'use strict';var multer=require(_0xb2e0('0x0'));var util=require(_0xb2e0('0x1'));var path=require(_0xb2e0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb2e0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb2e0('0x4'));var controller=require('./jscriptyQuestionReport.controller');router[_0xb2e0('0x5')]('/',auth[_0xb2e0('0x6')](),controller[_0xb2e0('0x7')]);router[_0xb2e0('0x5')](_0xb2e0('0x8'),auth[_0xb2e0('0x6')](),controller[_0xb2e0('0x9')]);router[_0xb2e0('0x5')](_0xb2e0('0xa'),auth['isAuthenticated'](),controller[_0xb2e0('0xb')]);router['post']('/',auth[_0xb2e0('0x6')](),controller[_0xb2e0('0xc')]);router[_0xb2e0('0xd')](_0xb2e0('0xa'),auth[_0xb2e0('0x6')](),controller['update']);router[_0xb2e0('0xe')]('/:id',auth[_0xb2e0('0x6')](),controller['destroy']);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 e7d1b8e..964baf7 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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x470bf5,_0x45c141){_0x470bf5=_0x470bf5-0x0;var _0x317101=_0x7a54[_0x470bf5];return _0x317101;};'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(_0x2827ed,_0x8b7012){_0x2827ed=_0x2827ed-0x0;var _0x191ad2=_0x7a54[_0x2827ed];return _0x191ad2;};'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 17f3e66..09cd437 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 _0xb5fa=['body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5fa,0x9f));var _0xab5f=function(_0x50788d,_0x2049b8){_0x50788d=_0x50788d-0x0;var _0x21622f=_0xb5fa[_0x50788d];return _0x21622f;};'use strict';var emlformat=require(_0xab5f('0x0'));var rimraf=require(_0xab5f('0x1'));var zipdir=require(_0xab5f('0x2'));var jsonpatch=require(_0xab5f('0x3'));var rp=require(_0xab5f('0x4'));var moment=require(_0xab5f('0x5'));var BPromise=require(_0xab5f('0x6'));var Mustache=require(_0xab5f('0x7'));var util=require(_0xab5f('0x8'));var path=require(_0xab5f('0x9'));var sox=require(_0xab5f('0xa'));var csv=require(_0xab5f('0xb'));var ejs=require(_0xab5f('0xc'));var fs=require('fs');var fs_extra=require(_0xab5f('0xd'));var _=require(_0xab5f('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xab5f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xab5f('0xb'));var querystring=require(_0xab5f('0x10'));var Papa=require(_0xab5f('0x11'));var Redis=require('ioredis');var authService=require(_0xab5f('0x12'));var qs=require(_0xab5f('0x13'));var as=require(_0xab5f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab5f('0x15'))(_0xab5f('0x16'));var utils=require(_0xab5f('0x17'));var config=require(_0xab5f('0x18'));var licenseUtil=require(_0xab5f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4475e7,_0x376b4d){_0x376b4d=_0x376b4d||0xcc;return function(_0x3a05d6){if(_0x3a05d6){return _0x4475e7[_0xab5f('0x1a')](_0x376b4d);}return _0x4475e7[_0xab5f('0x1b')](_0x376b4d)[_0xab5f('0x1c')]();};}function respondWithResult(_0x9a7589,_0x4b90a0){_0x4b90a0=_0x4b90a0||0xc8;return function(_0x3babd5){if(_0x3babd5){return _0x9a7589[_0xab5f('0x1b')](_0x4b90a0)[_0xab5f('0x1d')](_0x3babd5);}};}function respondWithFilteredResult(_0x17218c,_0x3921eb){return function(_0x450eb5){if(_0x450eb5){var _0xa1b238=typeof _0x3921eb[_0xab5f('0x1e')]===_0xab5f('0x1f')&&typeof _0x3921eb[_0xab5f('0x20')]===_0xab5f('0x1f');var _0x2beb3b=_0x450eb5['count'];var _0x5afd87=_0xa1b238?0x0:_0x3921eb[_0xab5f('0x1e')];var _0x8f9b78=_0xa1b238?_0x450eb5[_0xab5f('0x21')]:_0x3921eb[_0xab5f('0x1e')]+_0x3921eb[_0xab5f('0x20')];var _0x586d63;if(_0x8f9b78>=_0x2beb3b){_0x8f9b78=_0x2beb3b;_0x586d63=0xc8;}else{_0x586d63=0xce;}_0x17218c['status'](_0x586d63);return _0x17218c[_0xab5f('0x22')]('Content-Range',_0x5afd87+'-'+_0x8f9b78+'/'+_0x2beb3b)['json'](_0x450eb5);}return null;};}function patchUpdates(_0x522eb2){return function(_0xc025b3){try{jsonpatch['apply'](_0xc025b3,_0x522eb2,!![]);}catch(_0x2e8b8a){return BPromise[_0xab5f('0x23')](_0x2e8b8a);}return _0xc025b3[_0xab5f('0x24')]();};}function saveUpdates(_0xf582ba,_0x5f7a1f){return function(_0x4d7631){if(_0x4d7631){return _0x4d7631['update'](_0xf582ba)[_0xab5f('0x25')](function(_0x1e6a19){return _0x1e6a19;});}return null;};}function removeEntity(_0x4430c9,_0x3fbfe3){return function(_0x344663){if(_0x344663){return _0x344663[_0xab5f('0x26')]()[_0xab5f('0x25')](function(){_0x4430c9[_0xab5f('0x1b')](0xcc)[_0xab5f('0x1c')]();});}};}function handleEntityNotFound(_0x1eea77,_0x20cae9){return function(_0x33ff0c){if(!_0x33ff0c){_0x1eea77['sendStatus'](0x194);}return _0x33ff0c;};}function handleError(_0x949d49,_0x31db5e){_0x31db5e=_0x31db5e||0x1f4;return function(_0x3f2039){logger[_0xab5f('0x27')](_0x3f2039[_0xab5f('0x28')]);if(_0x3f2039[_0xab5f('0x29')]){delete _0x3f2039[_0xab5f('0x29')];}_0x949d49[_0xab5f('0x1b')](_0x31db5e)[_0xab5f('0x2a')](_0x3f2039);};}exports[_0xab5f('0x2b')]=function(_0x2d44bd,_0x5f2ea6){var _0x272a72={},_0x50a4b0={},_0x15dfb5={'count':0x0,'rows':[]};var _0x56536c=_[_0xab5f('0x2c')](db[_0xab5f('0x2d')]['rawAttributes'],function(_0x3b584d){return{'name':_0x3b584d['fieldName'],'type':_0x3b584d[_0xab5f('0x2e')][_0xab5f('0x2f')]};});_0x50a4b0['model']=_[_0xab5f('0x2c')](_0x56536c,'name');_0x50a4b0[_0xab5f('0x30')]=_[_0xab5f('0x31')](_0x2d44bd['query']);_0x50a4b0[_0xab5f('0x32')]=_['intersection'](_0x50a4b0[_0xab5f('0x33')],_0x50a4b0[_0xab5f('0x30')]);_0x272a72[_0xab5f('0x34')]=_[_0xab5f('0x35')](_0x50a4b0[_0xab5f('0x33')],qs[_0xab5f('0x36')](_0x2d44bd[_0xab5f('0x30')]['fields']));_0x272a72[_0xab5f('0x34')]=_0x272a72[_0xab5f('0x34')][_0xab5f('0x37')]?_0x272a72[_0xab5f('0x34')]:_0x50a4b0[_0xab5f('0x33')];if(!_0x2d44bd[_0xab5f('0x30')][_0xab5f('0x38')]('nolimit')){_0x272a72['limit']=qs[_0xab5f('0x20')](_0x2d44bd[_0xab5f('0x30')]['limit']);_0x272a72[_0xab5f('0x1e')]=qs['offset'](_0x2d44bd[_0xab5f('0x30')][_0xab5f('0x1e')]);}_0x272a72['order']=qs[_0xab5f('0x39')](_0x2d44bd['query'][_0xab5f('0x39')]);_0x272a72[_0xab5f('0x3a')]=qs[_0xab5f('0x32')](_[_0xab5f('0x3b')](_0x2d44bd[_0xab5f('0x30')],_0x50a4b0[_0xab5f('0x32')]),_0x56536c);if(_0x2d44bd[_0xab5f('0x30')][_0xab5f('0x3c')]){_0x272a72[_0xab5f('0x3a')]=_[_0xab5f('0x3d')](_0x272a72[_0xab5f('0x3a')],{'$or':_['map'](_0x56536c,function(_0x3cbb69){if(_0x3cbb69['type']!==_0xab5f('0x3e')){var _0x83ac05={};_0x83ac05[_0x3cbb69['name']]={'$like':'%'+_0x2d44bd[_0xab5f('0x30')][_0xab5f('0x3c')]+'%'};return _0x83ac05;}})});}_0x272a72=_[_0xab5f('0x3d')]({},_0x272a72,_0x2d44bd[_0xab5f('0x3f')]);var _0x48e352={'where':_0x272a72[_0xab5f('0x3a')]};return db['JscriptyQuestionReport'][_0xab5f('0x21')](_0x48e352)[_0xab5f('0x25')](function(_0x119503){_0x15dfb5[_0xab5f('0x21')]=_0x119503;if(_0x2d44bd['query'][_0xab5f('0x40')]){_0x272a72['include']=[{'all':!![]}];}return db[_0xab5f('0x2d')][_0xab5f('0x41')](_0x272a72);})[_0xab5f('0x25')](function(_0x3f648a){_0x15dfb5[_0xab5f('0x42')]=_0x3f648a;return _0x15dfb5;})[_0xab5f('0x25')](respondWithFilteredResult(_0x5f2ea6,_0x272a72))[_0xab5f('0x43')](handleError(_0x5f2ea6,null));};exports[_0xab5f('0x44')]=function(_0x2eda81,_0x2b9df4){var _0x5b99f7={'raw':!![],'where':{'id':_0x2eda81['params']['id']}},_0x2c89a1={};_0x2c89a1['model']=_[_0xab5f('0x31')](db[_0xab5f('0x2d')][_0xab5f('0x45')]);_0x2c89a1[_0xab5f('0x30')]=_[_0xab5f('0x31')](_0x2eda81[_0xab5f('0x30')]);_0x2c89a1['filters']=_['intersection'](_0x2c89a1[_0xab5f('0x33')],_0x2c89a1[_0xab5f('0x30')]);_0x5b99f7['attributes']=_['intersection'](_0x2c89a1['model'],qs[_0xab5f('0x36')](_0x2eda81[_0xab5f('0x30')][_0xab5f('0x36')]));_0x5b99f7[_0xab5f('0x34')]=_0x5b99f7[_0xab5f('0x34')][_0xab5f('0x37')]?_0x5b99f7[_0xab5f('0x34')]:_0x2c89a1[_0xab5f('0x33')];if(_0x2eda81['query']['includeAll']){_0x5b99f7[_0xab5f('0x46')]=[{'all':!![]}];}_0x5b99f7=_[_0xab5f('0x3d')]({},_0x5b99f7,_0x2eda81[_0xab5f('0x3f')]);return db[_0xab5f('0x2d')]['find'](_0x5b99f7)[_0xab5f('0x25')](handleEntityNotFound(_0x2b9df4,null))[_0xab5f('0x25')](respondWithResult(_0x2b9df4,null))[_0xab5f('0x43')](handleError(_0x2b9df4,null));};exports[_0xab5f('0x47')]=function(_0x3e8336,_0x291f25){return db['JscriptyQuestionReport'][_0xab5f('0x47')](_0x3e8336[_0xab5f('0x48')],{})[_0xab5f('0x25')](respondWithResult(_0x291f25,0xc9))['catch'](handleError(_0x291f25,null));};exports[_0xab5f('0x49')]=function(_0x4291df,_0x446859){if(_0x4291df[_0xab5f('0x48')]['id']){delete _0x4291df[_0xab5f('0x48')]['id'];}return db[_0xab5f('0x2d')][_0xab5f('0x4a')]({'where':{'id':_0x4291df[_0xab5f('0x4b')]['id']}})[_0xab5f('0x25')](handleEntityNotFound(_0x446859,null))[_0xab5f('0x25')](saveUpdates(_0x4291df['body'],null))[_0xab5f('0x25')](respondWithResult(_0x446859,null))[_0xab5f('0x43')](handleError(_0x446859,null));};exports[_0xab5f('0x26')]=function(_0x444675,_0xd62158){return db[_0xab5f('0x2d')][_0xab5f('0x4a')]({'where':{'id':_0x444675['params']['id']}})[_0xab5f('0x25')](handleEntityNotFound(_0xd62158,null))[_0xab5f('0x25')](removeEntity(_0xd62158,null))[_0xab5f('0x43')](handleError(_0xd62158,null));};exports[_0xab5f('0x4c')]=function(_0x1a0d01,_0x583a43){return db[_0xab5f('0x2d')][_0xab5f('0x4c')]()[_0xab5f('0x25')](respondWithResult(_0x583a43,null))[_0xab5f('0x43')](handleError(_0x583a43,null));}; \ No newline at end of file +var _0xb43c=['offset','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','options','JscriptyQuestionReport','includeAll','findAll','catch','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xb43c,0x191));var _0xcb43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb43c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xcb43('0x0'));var rimraf=require(_0xcb43('0x1'));var zipdir=require(_0xcb43('0x2'));var jsonpatch=require(_0xcb43('0x3'));var rp=require(_0xcb43('0x4'));var moment=require(_0xcb43('0x5'));var BPromise=require(_0xcb43('0x6'));var Mustache=require('mustache');var util=require(_0xcb43('0x7'));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(_0xcb43('0x8'));var _=require(_0xcb43('0x9'));var squel=require(_0xcb43('0xa'));var crypto=require(_0xcb43('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcb43('0xc'));var querystring=require(_0xcb43('0xd'));var Papa=require(_0xcb43('0xe'));var Redis=require(_0xcb43('0xf'));var authService=require(_0xcb43('0x10'));var qs=require(_0xcb43('0x11'));var as=require(_0xcb43('0x12'));var hardwareService=require(_0xcb43('0x13'));var logger=require(_0xcb43('0x14'))('api');var utils=require(_0xcb43('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcb43('0x16'));var db=require(_0xcb43('0x17'))['db'];function respondWithStatusCode(_0x24d3c2,_0x5ea419){_0x5ea419=_0x5ea419||0xcc;return function(_0x5eb783){if(_0x5eb783){return _0x24d3c2[_0xcb43('0x18')](_0x5ea419);}return _0x24d3c2[_0xcb43('0x19')](_0x5ea419)[_0xcb43('0x1a')]();};}function respondWithResult(_0x1933c8,_0xf007bc){_0xf007bc=_0xf007bc||0xc8;return function(_0x4320e3){if(_0x4320e3){return _0x1933c8['status'](_0xf007bc)[_0xcb43('0x1b')](_0x4320e3);}};}function respondWithFilteredResult(_0xcf676b,_0x14c1f6){return function(_0x5d291d){if(_0x5d291d){var _0x147478=typeof _0x14c1f6['offset']==='undefined'&&typeof _0x14c1f6[_0xcb43('0x1c')]===_0xcb43('0x1d');var _0xb5c1fc=_0x5d291d[_0xcb43('0x1e')];var _0x4be812=_0x147478?0x0:_0x14c1f6[_0xcb43('0x1f')];var _0x214c9e=_0x147478?_0x5d291d[_0xcb43('0x1e')]:_0x14c1f6[_0xcb43('0x1f')]+_0x14c1f6['limit'];var _0x226e27;if(_0x214c9e>=_0xb5c1fc){_0x214c9e=_0xb5c1fc;_0x226e27=0xc8;}else{_0x226e27=0xce;}_0xcf676b[_0xcb43('0x19')](_0x226e27);return _0xcf676b[_0xcb43('0x20')](_0xcb43('0x21'),_0x4be812+'-'+_0x214c9e+'/'+_0xb5c1fc)[_0xcb43('0x1b')](_0x5d291d);}return null;};}function patchUpdates(_0x33a501){return function(_0x4e46b9){try{jsonpatch[_0xcb43('0x22')](_0x4e46b9,_0x33a501,!![]);}catch(_0x55a763){return BPromise[_0xcb43('0x23')](_0x55a763);}return _0x4e46b9['save']();};}function saveUpdates(_0x473a05,_0x169db0){return function(_0x31971a){if(_0x31971a){return _0x31971a[_0xcb43('0x24')](_0x473a05)[_0xcb43('0x25')](function(_0x3662b8){return _0x3662b8;});}return null;};}function removeEntity(_0x5b289d,_0x54ed25){return function(_0x243a75){if(_0x243a75){return _0x243a75['destroy']()[_0xcb43('0x25')](function(){_0x5b289d['status'](0xcc)[_0xcb43('0x1a')]();});}};}function handleEntityNotFound(_0x17cbfb,_0x427c04){return function(_0x3b1118){if(!_0x3b1118){_0x17cbfb[_0xcb43('0x18')](0x194);}return _0x3b1118;};}function handleError(_0x44ee9a,_0x5e985a){_0x5e985a=_0x5e985a||0x1f4;return function(_0x366a2f){logger['error'](_0x366a2f[_0xcb43('0x26')]);if(_0x366a2f[_0xcb43('0x27')]){delete _0x366a2f[_0xcb43('0x27')];}_0x44ee9a['status'](_0x5e985a)[_0xcb43('0x28')](_0x366a2f);};}exports[_0xcb43('0x29')]=function(_0x19b808,_0x14abe0){var _0x479e09={},_0x16cb5e={},_0x324b4c={'count':0x0,'rows':[]};var _0x2711e1=_[_0xcb43('0x2a')](db['JscriptyQuestionReport'][_0xcb43('0x2b')],function(_0x20d72c){return{'name':_0x20d72c[_0xcb43('0x2c')],'type':_0x20d72c[_0xcb43('0x2d')][_0xcb43('0x2e')]};});_0x16cb5e[_0xcb43('0x2f')]=_[_0xcb43('0x2a')](_0x2711e1,_0xcb43('0x27'));_0x16cb5e['query']=_[_0xcb43('0x30')](_0x19b808[_0xcb43('0x31')]);_0x16cb5e[_0xcb43('0x32')]=_[_0xcb43('0x33')](_0x16cb5e[_0xcb43('0x2f')],_0x16cb5e[_0xcb43('0x31')]);_0x479e09[_0xcb43('0x34')]=_[_0xcb43('0x33')](_0x16cb5e[_0xcb43('0x2f')],qs[_0xcb43('0x35')](_0x19b808[_0xcb43('0x31')]['fields']));_0x479e09[_0xcb43('0x34')]=_0x479e09['attributes'][_0xcb43('0x36')]?_0x479e09[_0xcb43('0x34')]:_0x16cb5e[_0xcb43('0x2f')];if(!_0x19b808['query']['hasOwnProperty'](_0xcb43('0x37'))){_0x479e09[_0xcb43('0x1c')]=qs[_0xcb43('0x1c')](_0x19b808[_0xcb43('0x31')][_0xcb43('0x1c')]);_0x479e09[_0xcb43('0x1f')]=qs[_0xcb43('0x1f')](_0x19b808['query'][_0xcb43('0x1f')]);}_0x479e09[_0xcb43('0x38')]=qs['sort'](_0x19b808['query'][_0xcb43('0x39')]);_0x479e09['where']=qs[_0xcb43('0x32')](_['pick'](_0x19b808[_0xcb43('0x31')],_0x16cb5e[_0xcb43('0x32')]),_0x2711e1);if(_0x19b808[_0xcb43('0x31')]['filter']){_0x479e09[_0xcb43('0x3a')]=_[_0xcb43('0x3b')](_0x479e09[_0xcb43('0x3a')],{'$or':_[_0xcb43('0x2a')](_0x2711e1,function(_0x13188b){if(_0x13188b[_0xcb43('0x2d')]!=='VIRTUAL'){var _0x165ec9={};_0x165ec9[_0x13188b[_0xcb43('0x27')]]={'$like':'%'+_0x19b808[_0xcb43('0x31')]['filter']+'%'};return _0x165ec9;}})});}_0x479e09=_[_0xcb43('0x3b')]({},_0x479e09,_0x19b808[_0xcb43('0x3c')]);var _0x11df8f={'where':_0x479e09[_0xcb43('0x3a')]};return db[_0xcb43('0x3d')][_0xcb43('0x1e')](_0x11df8f)['then'](function(_0x2a7538){_0x324b4c[_0xcb43('0x1e')]=_0x2a7538;if(_0x19b808[_0xcb43('0x31')][_0xcb43('0x3e')]){_0x479e09['include']=[{'all':!![]}];}return db[_0xcb43('0x3d')][_0xcb43('0x3f')](_0x479e09);})[_0xcb43('0x25')](function(_0x28ff64){_0x324b4c['rows']=_0x28ff64;return _0x324b4c;})[_0xcb43('0x25')](respondWithFilteredResult(_0x14abe0,_0x479e09))[_0xcb43('0x40')](handleError(_0x14abe0,null));};exports['show']=function(_0x4605d0,_0x519a74){var _0x330ed7={'raw':!![],'where':{'id':_0x4605d0[_0xcb43('0x41')]['id']}},_0x50c964={};_0x50c964['model']=_[_0xcb43('0x30')](db['JscriptyQuestionReport'][_0xcb43('0x2b')]);_0x50c964[_0xcb43('0x31')]=_[_0xcb43('0x30')](_0x4605d0[_0xcb43('0x31')]);_0x50c964[_0xcb43('0x32')]=_[_0xcb43('0x33')](_0x50c964[_0xcb43('0x2f')],_0x50c964['query']);_0x330ed7['attributes']=_['intersection'](_0x50c964[_0xcb43('0x2f')],qs['fields'](_0x4605d0['query']['fields']));_0x330ed7['attributes']=_0x330ed7[_0xcb43('0x34')]['length']?_0x330ed7[_0xcb43('0x34')]:_0x50c964[_0xcb43('0x2f')];if(_0x4605d0[_0xcb43('0x31')]['includeAll']){_0x330ed7[_0xcb43('0x42')]=[{'all':!![]}];}_0x330ed7=_[_0xcb43('0x3b')]({},_0x330ed7,_0x4605d0[_0xcb43('0x3c')]);return db[_0xcb43('0x3d')][_0xcb43('0x43')](_0x330ed7)['then'](handleEntityNotFound(_0x519a74,null))['then'](respondWithResult(_0x519a74,null))['catch'](handleError(_0x519a74,null));};exports['create']=function(_0x5bdf40,_0x43eb2c){return db[_0xcb43('0x3d')][_0xcb43('0x44')](_0x5bdf40[_0xcb43('0x45')],{})['then'](respondWithResult(_0x43eb2c,0xc9))[_0xcb43('0x40')](handleError(_0x43eb2c,null));};exports[_0xcb43('0x24')]=function(_0xc3c821,_0x1c459f){if(_0xc3c821[_0xcb43('0x45')]['id']){delete _0xc3c821[_0xcb43('0x45')]['id'];}return db[_0xcb43('0x3d')]['find']({'where':{'id':_0xc3c821[_0xcb43('0x41')]['id']}})[_0xcb43('0x25')](handleEntityNotFound(_0x1c459f,null))[_0xcb43('0x25')](saveUpdates(_0xc3c821['body'],null))['then'](respondWithResult(_0x1c459f,null))[_0xcb43('0x40')](handleError(_0x1c459f,null));};exports[_0xcb43('0x46')]=function(_0x436dcd,_0x283691){return db['JscriptyQuestionReport'][_0xcb43('0x43')]({'where':{'id':_0x436dcd[_0xcb43('0x41')]['id']}})[_0xcb43('0x25')](handleEntityNotFound(_0x283691,null))[_0xcb43('0x25')](removeEntity(_0x283691,null))[_0xcb43('0x40')](handleError(_0x283691,null));};exports[_0xcb43('0x47')]=function(_0x4b2080,_0x24692c){return db[_0xcb43('0x3d')]['describe']()[_0xcb43('0x25')](respondWithResult(_0x24692c,null))[_0xcb43('0x40')](handleError(_0x24692c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 05a768f..13e2992 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 _0xfe14=['exports','define','report_jscripty_questions','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xe8969c,_0x1a5279){var _0x165af5=function(_0x2195d7){while(--_0x2195d7){_0xe8969c['push'](_0xe8969c['shift']());}};_0x165af5(++_0x1a5279);}(_0xfe14,0x1f2));var _0x4fe1=function(_0x1d5dc5,_0x238990){_0x1d5dc5=_0x1d5dc5-0x0;var _0x2db555=_0xfe14[_0x1d5dc5];return _0x2db555;};'use strict';var _=require('lodash');var util=require(_0x4fe1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4fe1('0x1'));var BPromise=require('bluebird');var rp=require(_0x4fe1('0x2'));var fs=require('fs');var path=require(_0x4fe1('0x3'));var rimraf=require(_0x4fe1('0x4'));var config=require(_0x4fe1('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x4fe1('0x6')]=function(_0x2719fe,_0x4154f1){return _0x2719fe[_0x4fe1('0x7')]('JscriptyQuestionReport',attributes,{'tableName':_0x4fe1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc84e=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x1f9730,_0x39814e){var _0x5866aa=function(_0x7fbd56){while(--_0x7fbd56){_0x1f9730['push'](_0x1f9730['shift']());}};_0x5866aa(++_0x39814e);}(_0xc84e,0x1a4));var _0xec84=function(_0x5b105b,_0x6c7812){_0x5b105b=_0x5b105b-0x0;var _0x3b3f61=_0xc84e[_0x5b105b];return _0x3b3f61;};'use strict';var _=require(_0xec84('0x0'));var util=require(_0xec84('0x1'));var logger=require(_0xec84('0x2'))(_0xec84('0x3'));var moment=require(_0xec84('0x4'));var BPromise=require(_0xec84('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec84('0x6'));var rimraf=require(_0xec84('0x7'));var config=require(_0xec84('0x8'));var attributes=require(_0xec84('0x9'));module[_0xec84('0xa')]=function(_0x2f587d,_0x437cd3){return _0x2f587d[_0xec84('0xb')](_0xec84('0xc'),attributes,{'tableName':_0xec84('0xd'),'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 026a1af..95c315c 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 _0xe89f=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0xe89f,0x11e));var _0xfe89=function(_0x3b2a1f,_0x430f90){_0x3b2a1f=_0x3b2a1f-0x0;var _0xb24e50=_0xe89f[_0x3b2a1f];return _0xb24e50;};'use strict';var _=require('lodash');var util=require(_0xfe89('0x0'));var moment=require('moment');var BPromise=require(_0xfe89('0x1'));var rs=require(_0xfe89('0x2'));var fs=require('fs');var Redis=require(_0xfe89('0x3'));var db=require(_0xfe89('0x4'))['db'];var utils=require(_0xfe89('0x5'));var logger=require(_0xfe89('0x6'))('rpc');var config=require(_0xfe89('0x7'));var jayson=require(_0xfe89('0x8'));var client=jayson['client'][_0xfe89('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x305942,_0x861ed,_0x5b0b74){return new BPromise(function(_0x578bba,_0x5c7d09){return client[_0xfe89('0xa')](_0x305942,_0x5b0b74)[_0xfe89('0xb')](function(_0x5260f9){logger[_0xfe89('0xc')](_0xfe89('0xd'),_0x861ed,_0xfe89('0xe'));logger[_0xfe89('0xf')](_0xfe89('0x10'),_0x861ed,_0xfe89('0xe'),JSON[_0xfe89('0x11')](_0x5260f9));if(_0x5260f9['error']){if(_0x5260f9[_0xfe89('0x12')][_0xfe89('0x13')]===0x1f4){logger[_0xfe89('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x861ed,_0x5260f9[_0xfe89('0x12')][_0xfe89('0x14')]);return _0x5c7d09(_0x5260f9[_0xfe89('0x12')]['message']);}logger[_0xfe89('0x12')](_0xfe89('0xd'),_0x861ed,_0x5260f9[_0xfe89('0x12')][_0xfe89('0x14')]);return _0x578bba(_0x5260f9['error'][_0xfe89('0x14')]);}else{logger[_0xfe89('0xc')](_0xfe89('0xd'),_0x861ed,'request\x20sent');_0x578bba(_0x5260f9[_0xfe89('0x15')]['message']);}})[_0xfe89('0x16')](function(_0x31b82f){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x861ed,_0x31b82f);_0x5c7d09(_0x31b82f);});});} \ No newline at end of file +var _0x1d37=['JscriptyQuestionReport,\x20%s,\x20%s','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x3d56fb,_0x5a4b6c){var _0xee69d1=function(_0x8192f){while(--_0x8192f){_0x3d56fb['push'](_0x3d56fb['shift']());}};_0xee69d1(++_0x5a4b6c);}(_0x1d37,0xdf));var _0x71d3=function(_0x2dbb49,_0x4955d6){_0x2dbb49=_0x2dbb49-0x0;var _0x59083b=_0x1d37[_0x2dbb49];return _0x59083b;};'use strict';var _=require(_0x71d3('0x0'));var util=require('util');var moment=require(_0x71d3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71d3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x71d3('0x3'));var logger=require(_0x71d3('0x4'))(_0x71d3('0x5'));var config=require(_0x71d3('0x6'));var jayson=require(_0x71d3('0x7'));var client=jayson[_0x71d3('0x8')][_0x71d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf027,_0x30141f,_0x325a80){return new BPromise(function(_0xe6977a,_0x134eec){return client['request'](_0x3bf027,_0x325a80)[_0x71d3('0xa')](function(_0x35e15c){logger[_0x71d3('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x30141f,_0x71d3('0xc'));logger[_0x71d3('0xd')](_0x71d3('0xe'),_0x30141f,_0x71d3('0xc'),JSON['stringify'](_0x35e15c));if(_0x35e15c['error']){if(_0x35e15c[_0x71d3('0xf')]['code']===0x1f4){logger[_0x71d3('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x30141f,_0x35e15c[_0x71d3('0xf')]['message']);return _0x134eec(_0x35e15c[_0x71d3('0xf')][_0x71d3('0x10')]);}logger[_0x71d3('0xf')](_0x71d3('0x11'),_0x30141f,_0x35e15c[_0x71d3('0xf')][_0x71d3('0x10')]);return _0xe6977a(_0x35e15c['error'][_0x71d3('0x10')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x30141f,_0x71d3('0xc'));_0xe6977a(_0x35e15c[_0x71d3('0x12')]['message']);}})[_0x71d3('0x13')](function(_0x64b6fa){logger[_0x71d3('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x30141f,_0x64b6fa);_0x134eec(_0x64b6fa);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index cf384d3..9bf8896 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 _0xd448=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','/:id','show','/:id/questions','getQuestions','create','put','delete','destroy','exports','multer','util','path'];(function(_0x132019,_0x116eb9){var _0x40a7d3=function(_0x7466b){while(--_0x7466b){_0x132019['push'](_0x132019['shift']());}};_0x40a7d3(++_0x116eb9);}(_0xd448,0x165));var _0x8d44=function(_0x106d51,_0x2eb27c){_0x106d51=_0x106d51-0x0;var _0x1924b9=_0xd448[_0x106d51];return _0x1924b9;};'use strict';var multer=require(_0x8d44('0x0'));var util=require(_0x8d44('0x1'));var path=require(_0x8d44('0x2'));var timeout=require(_0x8d44('0x3'));var express=require(_0x8d44('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8d44('0x5'));var interaction=require(_0x8d44('0x6'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x8d44('0x7')](),controller[_0x8d44('0x8')]);router[_0x8d44('0x9')]('/describe',auth[_0x8d44('0x7')](),controller[_0x8d44('0xa')]);router[_0x8d44('0x9')](_0x8d44('0xb'),auth[_0x8d44('0x7')](),controller[_0x8d44('0xc')]);router[_0x8d44('0x9')](_0x8d44('0xd'),auth[_0x8d44('0x7')](),controller[_0x8d44('0xe')]);router['post']('/',auth[_0x8d44('0x7')](),controller[_0x8d44('0xf')]);router[_0x8d44('0x10')]('/:id',auth[_0x8d44('0x7')](),controller['update']);router[_0x8d44('0x11')]('/:id',auth[_0x8d44('0x7')](),controller[_0x8d44('0x12')]);module[_0x8d44('0x13')]=router; \ No newline at end of file +var _0x56e7=['get','isAuthenticated','/describe','describe','show','post','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x2f597d,_0x32addb){var _0x28615a=function(_0xa06d14){while(--_0xa06d14){_0x2f597d['push'](_0x2f597d['shift']());}};_0x28615a(++_0x32addb);}(_0x56e7,0x14e));var _0x756e=function(_0x13e2b0,_0x3deffe){_0x13e2b0=_0x13e2b0-0x0;var _0x2a558b=_0x56e7[_0x13e2b0];return _0x2a558b;};'use strict';var multer=require(_0x756e('0x0'));var util=require(_0x756e('0x1'));var path=require(_0x756e('0x2'));var timeout=require(_0x756e('0x3'));var express=require(_0x756e('0x4'));var router=express[_0x756e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x756e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x756e('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x756e('0x8')]('/',auth[_0x756e('0x9')](),controller['index']);router[_0x756e('0x8')](_0x756e('0xa'),auth[_0x756e('0x9')](),controller[_0x756e('0xb')]);router[_0x756e('0x8')]('/:id',auth[_0x756e('0x9')](),controller[_0x756e('0xc')]);router[_0x756e('0x8')]('/:id/questions',auth[_0x756e('0x9')](),controller['getQuestions']);router[_0x756e('0xd')]('/',auth[_0x756e('0x9')](),controller['create']);router[_0x756e('0xe')]('/:id',auth[_0x756e('0x9')](),controller[_0x756e('0xf')]);router[_0x756e('0x10')](_0x756e('0x11'),auth[_0x756e('0x9')](),controller['destroy']);module[_0x756e('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 37397b3..28711fd 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 _0xc57e=['BOOLEAN','moment','DATE','starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x3ff353,_0x1f69c4){var _0x5e919c=function(_0xd1a6d4){while(--_0xd1a6d4){_0x3ff353['push'](_0x3ff353['shift']());}};_0x5e919c(++_0x1f69c4);}(_0xc57e,0xa3));var _0xec57=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc57e[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xec57('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xec57('0x1')],'set':function(_0x50ef7c){this['setDataValue'](_0xec57('0x2'),_0x50ef7c);this[_0xec57('0x3')](_0xec57('0x4'),moment()[_0xec57('0x5')](_0xec57('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xec57('0x7')]},'queue':{'type':Sequelize[_0xec57('0x7')]},'uniqueid':{'type':Sequelize[_0xec57('0x7')]},'calleridname':{'type':Sequelize[_0xec57('0x7')]},'calleridnum':{'type':Sequelize[_0xec57('0x7')]},'completed':{'type':Sequelize[_0xec57('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x4ec4=['DATE','STRING','BOOLEAN','moment','sequelize','exports','setDataValue','starttime','endtime','format'];(function(_0x4c4293,_0x2ad119){var _0x4e2402=function(_0x12db1e){while(--_0x12db1e){_0x4c4293['push'](_0x4c4293['shift']());}};_0x4e2402(++_0x2ad119);}(_0x4ec4,0x125));var _0x44ec=function(_0x1256c0,_0x21192c){_0x1256c0=_0x1256c0-0x0;var _0x246678=_0x4ec4[_0x1256c0];return _0x246678;};'use strict';var moment=require(_0x44ec('0x0'));var Sequelize=require(_0x44ec('0x1'));module[_0x44ec('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x16b598){this[_0x44ec('0x3')](_0x44ec('0x4'),_0x16b598);this[_0x44ec('0x3')](_0x44ec('0x5'),moment()[_0x44ec('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x44ec('0x7')]},'membername':{'type':Sequelize[_0x44ec('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x44ec('0x8')]},'uniqueid':{'type':Sequelize[_0x44ec('0x8')]},'calleridname':{'type':Sequelize[_0x44ec('0x8')]},'calleridnum':{'type':Sequelize[_0x44ec('0x8')]},'completed':{'type':Sequelize[_0x44ec('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index d8211d1..ff51327 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 _0x8219=['crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','apply','reject','save','then','stack','name','send','map','JscriptySessionReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','destroy','getQuestions','findOne','JscriptyQuestionReport','SessionId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x161f7b,_0x40b649){var _0x3ec45f=function(_0x2816aa){while(--_0x2816aa){_0x161f7b['push'](_0x161f7b['shift']());}};_0x3ec45f(++_0x40b649);}(_0x8219,0x1cd));var _0x9821=function(_0x299ecf,_0x5e642b){_0x299ecf=_0x299ecf-0x0;var _0x4813c9=_0x8219[_0x299ecf];return _0x4813c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9821('0x0'));var zipdir=require(_0x9821('0x1'));var jsonpatch=require(_0x9821('0x2'));var rp=require(_0x9821('0x3'));var moment=require(_0x9821('0x4'));var BPromise=require(_0x9821('0x5'));var Mustache=require('mustache');var util=require(_0x9821('0x6'));var path=require(_0x9821('0x7'));var sox=require(_0x9821('0x8'));var csv=require(_0x9821('0x9'));var ejs=require(_0x9821('0xa'));var fs=require('fs');var fs_extra=require(_0x9821('0xb'));var _=require(_0x9821('0xc'));var squel=require('squel');var crypto=require(_0x9821('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9821('0xe'));var toCsv=require(_0x9821('0x9'));var querystring=require('querystring');var Papa=require(_0x9821('0xf'));var Redis=require('ioredis');var authService=require(_0x9821('0x10'));var qs=require(_0x9821('0x11'));var as=require(_0x9821('0x12'));var hardwareService=require(_0x9821('0x13'));var logger=require(_0x9821('0x14'))(_0x9821('0x15'));var utils=require('../../config/utils');var config=require(_0x9821('0x16'));var licenseUtil=require(_0x9821('0x17'));var db=require(_0x9821('0x18'))['db'];function respondWithStatusCode(_0x79e2c9,_0x37a46a){_0x37a46a=_0x37a46a||0xcc;return function(_0x4a79a3){if(_0x4a79a3){return _0x79e2c9['sendStatus'](_0x37a46a);}return _0x79e2c9['status'](_0x37a46a)[_0x9821('0x19')]();};}function respondWithResult(_0x5b6782,_0xd02387){_0xd02387=_0xd02387||0xc8;return function(_0x47608f){if(_0x47608f){return _0x5b6782[_0x9821('0x1a')](_0xd02387)['json'](_0x47608f);}};}function respondWithFilteredResult(_0x4349d1,_0x2918db){return function(_0x50fd20){if(_0x50fd20){var _0x51b303=typeof _0x2918db[_0x9821('0x1b')]===_0x9821('0x1c')&&typeof _0x2918db['limit']===_0x9821('0x1c');var _0x10bf44=_0x50fd20[_0x9821('0x1d')];var _0x441dfa=_0x51b303?0x0:_0x2918db[_0x9821('0x1b')];var _0x47e4a5=_0x51b303?_0x50fd20[_0x9821('0x1d')]:_0x2918db[_0x9821('0x1b')]+_0x2918db[_0x9821('0x1e')];var _0x98ee63;if(_0x47e4a5>=_0x10bf44){_0x47e4a5=_0x10bf44;_0x98ee63=0xc8;}else{_0x98ee63=0xce;}_0x4349d1[_0x9821('0x1a')](_0x98ee63);return _0x4349d1[_0x9821('0x1f')]('Content-Range',_0x441dfa+'-'+_0x47e4a5+'/'+_0x10bf44)['json'](_0x50fd20);}return null;};}function patchUpdates(_0x190ff0){return function(_0x3e3730){try{jsonpatch[_0x9821('0x20')](_0x3e3730,_0x190ff0,!![]);}catch(_0x4ebf08){return BPromise[_0x9821('0x21')](_0x4ebf08);}return _0x3e3730[_0x9821('0x22')]();};}function saveUpdates(_0x317291,_0x3fa9a6){return function(_0x10568c){if(_0x10568c){return _0x10568c['update'](_0x317291)[_0x9821('0x23')](function(_0x479e33){return _0x479e33;});}return null;};}function removeEntity(_0xd9307f,_0x22282){return function(_0x5b7a48){if(_0x5b7a48){return _0x5b7a48['destroy']()[_0x9821('0x23')](function(){_0xd9307f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x138b90,_0xb7c229){return function(_0x4b45b3){if(!_0x4b45b3){_0x138b90['sendStatus'](0x194);}return _0x4b45b3;};}function handleError(_0x139d99,_0x5f1abd){_0x5f1abd=_0x5f1abd||0x1f4;return function(_0x73b208){logger['error'](_0x73b208[_0x9821('0x24')]);if(_0x73b208[_0x9821('0x25')]){delete _0x73b208[_0x9821('0x25')];}_0x139d99[_0x9821('0x1a')](_0x5f1abd)[_0x9821('0x26')](_0x73b208);};}exports['index']=function(_0xfaa9a6,_0x74eeeb){var _0x20be0d={},_0x37a518={},_0x37e358={'count':0x0,'rows':[]};var _0x1f9c47=_[_0x9821('0x27')](db[_0x9821('0x28')]['rawAttributes'],function(_0x25842b){return{'name':_0x25842b[_0x9821('0x29')],'type':_0x25842b[_0x9821('0x2a')][_0x9821('0x2b')]};});_0x37a518[_0x9821('0x2c')]=_['map'](_0x1f9c47,'name');_0x37a518[_0x9821('0x2d')]=_[_0x9821('0x2e')](_0xfaa9a6[_0x9821('0x2d')]);_0x37a518[_0x9821('0x2f')]=_['intersection'](_0x37a518['model'],_0x37a518['query']);_0x20be0d[_0x9821('0x30')]=_[_0x9821('0x31')](_0x37a518[_0x9821('0x2c')],qs[_0x9821('0x32')](_0xfaa9a6[_0x9821('0x2d')]['fields']));_0x20be0d[_0x9821('0x30')]=_0x20be0d[_0x9821('0x30')][_0x9821('0x33')]?_0x20be0d[_0x9821('0x30')]:_0x37a518[_0x9821('0x2c')];if(!_0xfaa9a6[_0x9821('0x2d')][_0x9821('0x34')](_0x9821('0x35'))){_0x20be0d[_0x9821('0x1e')]=qs['limit'](_0xfaa9a6['query'][_0x9821('0x1e')]);_0x20be0d[_0x9821('0x1b')]=qs[_0x9821('0x1b')](_0xfaa9a6[_0x9821('0x2d')]['offset']);}_0x20be0d[_0x9821('0x36')]=qs['sort'](_0xfaa9a6['query'][_0x9821('0x37')]);_0x20be0d[_0x9821('0x38')]=qs[_0x9821('0x2f')](_[_0x9821('0x39')](_0xfaa9a6[_0x9821('0x2d')],_0x37a518[_0x9821('0x2f')]),_0x1f9c47);if(_0xfaa9a6[_0x9821('0x2d')]['filter']){_0x20be0d[_0x9821('0x38')]=_['merge'](_0x20be0d[_0x9821('0x38')],{'$or':_['map'](_0x1f9c47,function(_0x51a1b5){if(_0x51a1b5[_0x9821('0x2a')]!==_0x9821('0x3a')){var _0x4c9491={};_0x4c9491[_0x51a1b5[_0x9821('0x25')]]={'$like':'%'+_0xfaa9a6['query'][_0x9821('0x3b')]+'%'};return _0x4c9491;}})});}_0x20be0d=_[_0x9821('0x3c')]({},_0x20be0d,_0xfaa9a6[_0x9821('0x3d')]);var _0x241245={'where':_0x20be0d[_0x9821('0x38')]};return db[_0x9821('0x28')][_0x9821('0x1d')](_0x241245)[_0x9821('0x23')](function(_0x1b8524){_0x37e358['count']=_0x1b8524;if(_0xfaa9a6['query'][_0x9821('0x3e')]){_0x20be0d['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9821('0x3f')](_0x20be0d);})[_0x9821('0x23')](function(_0x3f112a){_0x37e358[_0x9821('0x40')]=_0x3f112a;return _0x37e358;})[_0x9821('0x23')](respondWithFilteredResult(_0x74eeeb,_0x20be0d))[_0x9821('0x41')](handleError(_0x74eeeb,null));};exports[_0x9821('0x42')]=function(_0x29b9dc,_0x439083){var _0x2c64c6={'raw':!![],'where':{'id':_0x29b9dc[_0x9821('0x43')]['id']}},_0x4647f6={};_0x4647f6['model']=_[_0x9821('0x2e')](db['JscriptySessionReport'][_0x9821('0x44')]);_0x4647f6['query']=_[_0x9821('0x2e')](_0x29b9dc[_0x9821('0x2d')]);_0x4647f6[_0x9821('0x2f')]=_[_0x9821('0x31')](_0x4647f6[_0x9821('0x2c')],_0x4647f6['query']);_0x2c64c6[_0x9821('0x30')]=_[_0x9821('0x31')](_0x4647f6[_0x9821('0x2c')],qs['fields'](_0x29b9dc[_0x9821('0x2d')][_0x9821('0x32')]));_0x2c64c6['attributes']=_0x2c64c6['attributes'][_0x9821('0x33')]?_0x2c64c6[_0x9821('0x30')]:_0x4647f6[_0x9821('0x2c')];if(_0x29b9dc[_0x9821('0x2d')][_0x9821('0x3e')]){_0x2c64c6[_0x9821('0x45')]=[{'all':!![]}];}_0x2c64c6=_[_0x9821('0x3c')]({},_0x2c64c6,_0x29b9dc[_0x9821('0x3d')]);return db['JscriptySessionReport'][_0x9821('0x46')](_0x2c64c6)[_0x9821('0x23')](handleEntityNotFound(_0x439083,null))[_0x9821('0x23')](respondWithResult(_0x439083,null))[_0x9821('0x41')](handleError(_0x439083,null));};exports[_0x9821('0x47')]=function(_0x22355e,_0x4f2ca0){return db[_0x9821('0x28')][_0x9821('0x47')](_0x22355e[_0x9821('0x48')],{})[_0x9821('0x23')](respondWithResult(_0x4f2ca0,0xc9))[_0x9821('0x41')](handleError(_0x4f2ca0,null));};exports[_0x9821('0x49')]=function(_0x4cf68f,_0x5393cd){if(_0x4cf68f[_0x9821('0x48')]['id']){delete _0x4cf68f[_0x9821('0x48')]['id'];}return db[_0x9821('0x28')][_0x9821('0x46')]({'where':{'id':_0x4cf68f[_0x9821('0x43')]['id']}})[_0x9821('0x23')](handleEntityNotFound(_0x5393cd,null))[_0x9821('0x23')](saveUpdates(_0x4cf68f[_0x9821('0x48')],null))[_0x9821('0x23')](respondWithResult(_0x5393cd,null))[_0x9821('0x41')](handleError(_0x5393cd,null));};exports[_0x9821('0x4a')]=function(_0x617bd6,_0x390684){return db[_0x9821('0x28')]['find']({'where':{'id':_0x617bd6[_0x9821('0x43')]['id']}})[_0x9821('0x23')](handleEntityNotFound(_0x390684,null))[_0x9821('0x23')](removeEntity(_0x390684,null))[_0x9821('0x41')](handleError(_0x390684,null));};exports['describe']=function(_0x458a2a,_0x2b07e2){return db[_0x9821('0x28')]['describe']()[_0x9821('0x23')](respondWithResult(_0x2b07e2,null))[_0x9821('0x41')](handleError(_0x2b07e2,null));};exports[_0x9821('0x4b')]=function(_0x3cf61b,_0x594ba2,_0x2e15cc){var _0x2881da={'raw':!![],'where':{}};var _0x1dbe2f={};var _0x18b777={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x9821('0x4c')]({'where':{'id':_0x3cf61b[_0x9821('0x43')]['id']}})[_0x9821('0x23')](handleEntityNotFound(_0x594ba2,null))[_0x9821('0x23')](function(_0x173493){if(_0x173493){_0x1dbe2f[_0x9821('0x2c')]=_[_0x9821('0x2e')](db[_0x9821('0x4d')][_0x9821('0x44')]);_0x1dbe2f['query']=_[_0x9821('0x2e')](_0x3cf61b[_0x9821('0x2d')]);_0x1dbe2f[_0x9821('0x2f')]=_[_0x9821('0x31')](_0x1dbe2f['model'],_0x1dbe2f[_0x9821('0x2d')]);_0x2881da[_0x9821('0x30')]=_['intersection'](_0x1dbe2f[_0x9821('0x2c')],qs[_0x9821('0x32')](_0x3cf61b['query'][_0x9821('0x32')]));_0x2881da[_0x9821('0x30')]=_0x2881da['attributes'][_0x9821('0x33')]?_0x2881da['attributes']:_0x1dbe2f[_0x9821('0x2c')];if(!_0x3cf61b[_0x9821('0x2d')][_0x9821('0x34')]('nolimit')){_0x2881da[_0x9821('0x1e')]=qs[_0x9821('0x1e')](_0x3cf61b[_0x9821('0x2d')][_0x9821('0x1e')]);_0x2881da[_0x9821('0x1b')]=qs[_0x9821('0x1b')](_0x3cf61b[_0x9821('0x2d')][_0x9821('0x1b')]);}_0x2881da['order']=qs['sort'](_0x3cf61b['query'][_0x9821('0x37')]);_0x2881da[_0x9821('0x38')]=qs[_0x9821('0x2f')](_[_0x9821('0x39')](_0x3cf61b['query'],_0x1dbe2f[_0x9821('0x2f')]));_0x2881da[_0x9821('0x38')][_0x9821('0x4e')]=_0x173493['id'];if(_0x3cf61b[_0x9821('0x2d')][_0x9821('0x3b')]){_0x2881da['where']=_[_0x9821('0x3c')](_0x2881da[_0x9821('0x38')],{'$or':_['map'](_0x2881da[_0x9821('0x30')],function(_0x3fb4ec){var _0x289d51={};_0x289d51[_0x3fb4ec]={'$like':'%'+_0x3cf61b[_0x9821('0x2d')]['filter']+'%'};return _0x289d51;})});}_0x2881da=_[_0x9821('0x3c')]({},_0x2881da,_0x3cf61b['options']);return db[_0x9821('0x4d')][_0x9821('0x1d')]({'where':_0x2881da['where']})[_0x9821('0x23')](function(_0x5cd67b){_0x18b777['count']=_0x5cd67b;if(_0x3cf61b[_0x9821('0x2d')][_0x9821('0x3e')]){_0x2881da[_0x9821('0x45')]=[{'all':!![]}];}return db[_0x9821('0x4d')][_0x9821('0x3f')](_0x2881da);})[_0x9821('0x23')](function(_0x6feb7d){_0x18b777[_0x9821('0x40')]=_0x6feb7d;return _0x18b777;});}})[_0x9821('0x23')](respondWithFilteredResult(_0x594ba2,_0x2881da))[_0x9821('0x41')](handleError(_0x594ba2,null));}; \ No newline at end of file +var _0x6b0e=['fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','update','body','describe','getQuestions','hasOwnProperty','order','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','apply','reject','save','then','destroy','error','stack','name','map','JscriptySessionReport'];(function(_0x4d1cc6,_0x26bebe){var _0x1a6fee=function(_0x374f30){while(--_0x374f30){_0x4d1cc6['push'](_0x4d1cc6['shift']());}};_0x1a6fee(++_0x26bebe);}(_0x6b0e,0x149));var _0xe6b0=function(_0x251f9f,_0x1099d1){_0x251f9f=_0x251f9f-0x0;var _0x3da5b3=_0x6b0e[_0x251f9f];return _0x3da5b3;};'use strict';var emlformat=require(_0xe6b0('0x0'));var rimraf=require(_0xe6b0('0x1'));var zipdir=require(_0xe6b0('0x2'));var jsonpatch=require(_0xe6b0('0x3'));var rp=require('request-promise');var moment=require(_0xe6b0('0x4'));var BPromise=require(_0xe6b0('0x5'));var Mustache=require('mustache');var util=require(_0xe6b0('0x6'));var path=require(_0xe6b0('0x7'));var sox=require('sox');var csv=require(_0xe6b0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6b0('0x9'));var _=require(_0xe6b0('0xa'));var squel=require('squel');var crypto=require(_0xe6b0('0xb'));var jsforce=require(_0xe6b0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe6b0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe6b0('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6b0('0xe'));var logger=require(_0xe6b0('0xf'))(_0xe6b0('0x10'));var utils=require('../../config/utils');var config=require(_0xe6b0('0x11'));var licenseUtil=require(_0xe6b0('0x12'));var db=require(_0xe6b0('0x13'))['db'];function respondWithStatusCode(_0x79d2c7,_0x38a75c){_0x38a75c=_0x38a75c||0xcc;return function(_0x1fe6e7){if(_0x1fe6e7){return _0x79d2c7['sendStatus'](_0x38a75c);}return _0x79d2c7[_0xe6b0('0x14')](_0x38a75c)[_0xe6b0('0x15')]();};}function respondWithResult(_0x4bf625,_0x586c3b){_0x586c3b=_0x586c3b||0xc8;return function(_0x2abd53){if(_0x2abd53){return _0x4bf625['status'](_0x586c3b)['json'](_0x2abd53);}};}function respondWithFilteredResult(_0x138dfe,_0x5a5ddf){return function(_0x4be193){if(_0x4be193){var _0x19497c=typeof _0x5a5ddf[_0xe6b0('0x16')]==='undefined'&&typeof _0x5a5ddf[_0xe6b0('0x17')]===_0xe6b0('0x18');var _0x5c5b0b=_0x4be193[_0xe6b0('0x19')];var _0x1f8da5=_0x19497c?0x0:_0x5a5ddf[_0xe6b0('0x16')];var _0x59fef1=_0x19497c?_0x4be193[_0xe6b0('0x19')]:_0x5a5ddf[_0xe6b0('0x16')]+_0x5a5ddf['limit'];var _0x1a3226;if(_0x59fef1>=_0x5c5b0b){_0x59fef1=_0x5c5b0b;_0x1a3226=0xc8;}else{_0x1a3226=0xce;}_0x138dfe['status'](_0x1a3226);return _0x138dfe['set']('Content-Range',_0x1f8da5+'-'+_0x59fef1+'/'+_0x5c5b0b)['json'](_0x4be193);}return null;};}function patchUpdates(_0x1b2d14){return function(_0x193da1){try{jsonpatch[_0xe6b0('0x1a')](_0x193da1,_0x1b2d14,!![]);}catch(_0x15d800){return BPromise[_0xe6b0('0x1b')](_0x15d800);}return _0x193da1[_0xe6b0('0x1c')]();};}function saveUpdates(_0x32312c,_0x306d0f){return function(_0x100359){if(_0x100359){return _0x100359['update'](_0x32312c)[_0xe6b0('0x1d')](function(_0x426f33){return _0x426f33;});}return null;};}function removeEntity(_0xf57efd,_0x207efd){return function(_0x285ab5){if(_0x285ab5){return _0x285ab5[_0xe6b0('0x1e')]()['then'](function(){_0xf57efd[_0xe6b0('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e2c1,_0x173728){return function(_0x32ba43){if(!_0x32ba43){_0x28e2c1['sendStatus'](0x194);}return _0x32ba43;};}function handleError(_0x4fb8af,_0x269ac3){_0x269ac3=_0x269ac3||0x1f4;return function(_0x1a31f7){logger[_0xe6b0('0x1f')](_0x1a31f7[_0xe6b0('0x20')]);if(_0x1a31f7[_0xe6b0('0x21')]){delete _0x1a31f7[_0xe6b0('0x21')];}_0x4fb8af[_0xe6b0('0x14')](_0x269ac3)['send'](_0x1a31f7);};}exports['index']=function(_0x11821a,_0x481e25){var _0x22d408={},_0x387a16={},_0x241d36={'count':0x0,'rows':[]};var _0x1ed5a7=_[_0xe6b0('0x22')](db[_0xe6b0('0x23')]['rawAttributes'],function(_0x2ac525){return{'name':_0x2ac525[_0xe6b0('0x24')],'type':_0x2ac525[_0xe6b0('0x25')][_0xe6b0('0x26')]};});_0x387a16[_0xe6b0('0x27')]=_['map'](_0x1ed5a7,_0xe6b0('0x21'));_0x387a16['query']=_[_0xe6b0('0x28')](_0x11821a[_0xe6b0('0x29')]);_0x387a16['filters']=_[_0xe6b0('0x2a')](_0x387a16[_0xe6b0('0x27')],_0x387a16['query']);_0x22d408[_0xe6b0('0x2b')]=_[_0xe6b0('0x2a')](_0x387a16[_0xe6b0('0x27')],qs[_0xe6b0('0x2c')](_0x11821a[_0xe6b0('0x29')]['fields']));_0x22d408[_0xe6b0('0x2b')]=_0x22d408[_0xe6b0('0x2b')]['length']?_0x22d408[_0xe6b0('0x2b')]:_0x387a16[_0xe6b0('0x27')];if(!_0x11821a[_0xe6b0('0x29')]['hasOwnProperty'](_0xe6b0('0x2d'))){_0x22d408[_0xe6b0('0x17')]=qs['limit'](_0x11821a[_0xe6b0('0x29')][_0xe6b0('0x17')]);_0x22d408['offset']=qs[_0xe6b0('0x16')](_0x11821a[_0xe6b0('0x29')][_0xe6b0('0x16')]);}_0x22d408['order']=qs[_0xe6b0('0x2e')](_0x11821a[_0xe6b0('0x29')][_0xe6b0('0x2e')]);_0x22d408['where']=qs[_0xe6b0('0x2f')](_[_0xe6b0('0x30')](_0x11821a['query'],_0x387a16[_0xe6b0('0x2f')]),_0x1ed5a7);if(_0x11821a[_0xe6b0('0x29')][_0xe6b0('0x31')]){_0x22d408['where']=_['merge'](_0x22d408[_0xe6b0('0x32')],{'$or':_[_0xe6b0('0x22')](_0x1ed5a7,function(_0x162032){if(_0x162032[_0xe6b0('0x25')]!==_0xe6b0('0x33')){var _0x3df6e8={};_0x3df6e8[_0x162032[_0xe6b0('0x21')]]={'$like':'%'+_0x11821a[_0xe6b0('0x29')][_0xe6b0('0x31')]+'%'};return _0x3df6e8;}})});}_0x22d408=_[_0xe6b0('0x34')]({},_0x22d408,_0x11821a[_0xe6b0('0x35')]);var _0x52dbf1={'where':_0x22d408[_0xe6b0('0x32')]};return db[_0xe6b0('0x23')][_0xe6b0('0x19')](_0x52dbf1)[_0xe6b0('0x1d')](function(_0x345d2f){_0x241d36['count']=_0x345d2f;if(_0x11821a[_0xe6b0('0x29')][_0xe6b0('0x36')]){_0x22d408[_0xe6b0('0x37')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xe6b0('0x38')](_0x22d408);})[_0xe6b0('0x1d')](function(_0x135be9){_0x241d36[_0xe6b0('0x39')]=_0x135be9;return _0x241d36;})[_0xe6b0('0x1d')](respondWithFilteredResult(_0x481e25,_0x22d408))[_0xe6b0('0x3a')](handleError(_0x481e25,null));};exports[_0xe6b0('0x3b')]=function(_0x4c0a56,_0x49a5b9){var _0x291921={'raw':!![],'where':{'id':_0x4c0a56[_0xe6b0('0x3c')]['id']}},_0x32d07f={};_0x32d07f[_0xe6b0('0x27')]=_['keys'](db[_0xe6b0('0x23')][_0xe6b0('0x3d')]);_0x32d07f[_0xe6b0('0x29')]=_['keys'](_0x4c0a56[_0xe6b0('0x29')]);_0x32d07f[_0xe6b0('0x2f')]=_[_0xe6b0('0x2a')](_0x32d07f[_0xe6b0('0x27')],_0x32d07f[_0xe6b0('0x29')]);_0x291921[_0xe6b0('0x2b')]=_['intersection'](_0x32d07f['model'],qs[_0xe6b0('0x2c')](_0x4c0a56['query']['fields']));_0x291921[_0xe6b0('0x2b')]=_0x291921[_0xe6b0('0x2b')][_0xe6b0('0x3e')]?_0x291921[_0xe6b0('0x2b')]:_0x32d07f[_0xe6b0('0x27')];if(_0x4c0a56[_0xe6b0('0x29')][_0xe6b0('0x36')]){_0x291921['include']=[{'all':!![]}];}_0x291921=_[_0xe6b0('0x34')]({},_0x291921,_0x4c0a56[_0xe6b0('0x35')]);return db['JscriptySessionReport'][_0xe6b0('0x3f')](_0x291921)[_0xe6b0('0x1d')](handleEntityNotFound(_0x49a5b9,null))['then'](respondWithResult(_0x49a5b9,null))[_0xe6b0('0x3a')](handleError(_0x49a5b9,null));};exports[_0xe6b0('0x40')]=function(_0x412a53,_0x370adb){return db['JscriptySessionReport'][_0xe6b0('0x40')](_0x412a53['body'],{})['then'](respondWithResult(_0x370adb,0xc9))['catch'](handleError(_0x370adb,null));};exports[_0xe6b0('0x41')]=function(_0x1cc34a,_0x1a77ee){if(_0x1cc34a[_0xe6b0('0x42')]['id']){delete _0x1cc34a['body']['id'];}return db[_0xe6b0('0x23')][_0xe6b0('0x3f')]({'where':{'id':_0x1cc34a['params']['id']}})[_0xe6b0('0x1d')](handleEntityNotFound(_0x1a77ee,null))[_0xe6b0('0x1d')](saveUpdates(_0x1cc34a[_0xe6b0('0x42')],null))['then'](respondWithResult(_0x1a77ee,null))[_0xe6b0('0x3a')](handleError(_0x1a77ee,null));};exports[_0xe6b0('0x1e')]=function(_0x26da2a,_0x4716e9){return db[_0xe6b0('0x23')][_0xe6b0('0x3f')]({'where':{'id':_0x26da2a[_0xe6b0('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4716e9,null))['then'](removeEntity(_0x4716e9,null))[_0xe6b0('0x3a')](handleError(_0x4716e9,null));};exports[_0xe6b0('0x43')]=function(_0x2cdb64,_0x5c6ce0){return db[_0xe6b0('0x23')][_0xe6b0('0x43')]()[_0xe6b0('0x1d')](respondWithResult(_0x5c6ce0,null))['catch'](handleError(_0x5c6ce0,null));};exports[_0xe6b0('0x44')]=function(_0x1d1bfc,_0x3b471d,_0x1b56da){var _0x13a400={'raw':!![],'where':{}};var _0x1d6256={};var _0x197d39={'count':0x0,'rows':[]};return db[_0xe6b0('0x23')]['findOne']({'where':{'id':_0x1d1bfc['params']['id']}})[_0xe6b0('0x1d')](handleEntityNotFound(_0x3b471d,null))[_0xe6b0('0x1d')](function(_0x37fc0c){if(_0x37fc0c){_0x1d6256[_0xe6b0('0x27')]=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x1d6256[_0xe6b0('0x29')]=_[_0xe6b0('0x28')](_0x1d1bfc[_0xe6b0('0x29')]);_0x1d6256[_0xe6b0('0x2f')]=_['intersection'](_0x1d6256[_0xe6b0('0x27')],_0x1d6256['query']);_0x13a400[_0xe6b0('0x2b')]=_[_0xe6b0('0x2a')](_0x1d6256['model'],qs[_0xe6b0('0x2c')](_0x1d1bfc['query'][_0xe6b0('0x2c')]));_0x13a400[_0xe6b0('0x2b')]=_0x13a400['attributes']['length']?_0x13a400['attributes']:_0x1d6256['model'];if(!_0x1d1bfc[_0xe6b0('0x29')][_0xe6b0('0x45')](_0xe6b0('0x2d'))){_0x13a400['limit']=qs[_0xe6b0('0x17')](_0x1d1bfc[_0xe6b0('0x29')][_0xe6b0('0x17')]);_0x13a400['offset']=qs[_0xe6b0('0x16')](_0x1d1bfc[_0xe6b0('0x29')][_0xe6b0('0x16')]);}_0x13a400[_0xe6b0('0x46')]=qs['sort'](_0x1d1bfc[_0xe6b0('0x29')][_0xe6b0('0x2e')]);_0x13a400[_0xe6b0('0x32')]=qs[_0xe6b0('0x2f')](_[_0xe6b0('0x30')](_0x1d1bfc['query'],_0x1d6256[_0xe6b0('0x2f')]));_0x13a400['where'][_0xe6b0('0x47')]=_0x37fc0c['id'];if(_0x1d1bfc[_0xe6b0('0x29')][_0xe6b0('0x31')]){_0x13a400[_0xe6b0('0x32')]=_[_0xe6b0('0x34')](_0x13a400[_0xe6b0('0x32')],{'$or':_[_0xe6b0('0x22')](_0x13a400[_0xe6b0('0x2b')],function(_0xe1269c){var _0x225bc2={};_0x225bc2[_0xe1269c]={'$like':'%'+_0x1d1bfc['query'][_0xe6b0('0x31')]+'%'};return _0x225bc2;})});}_0x13a400=_[_0xe6b0('0x34')]({},_0x13a400,_0x1d1bfc[_0xe6b0('0x35')]);return db[_0xe6b0('0x48')]['count']({'where':_0x13a400[_0xe6b0('0x32')]})[_0xe6b0('0x1d')](function(_0x1c9fa6){_0x197d39[_0xe6b0('0x19')]=_0x1c9fa6;if(_0x1d1bfc['query'][_0xe6b0('0x36')]){_0x13a400[_0xe6b0('0x37')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xe6b0('0x38')](_0x13a400);})[_0xe6b0('0x1d')](function(_0x3ba2c3){_0x197d39[_0xe6b0('0x39')]=_0x3ba2c3;return _0x197d39;});}})[_0xe6b0('0x1d')](respondWithFilteredResult(_0x3b471d,_0x13a400))['catch'](handleError(_0x3b471d,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 7d0146a..c7947d1 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 _0x7dfd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0xc07b33,_0x3d745f){var _0x746787=function(_0x31700e){while(--_0x31700e){_0xc07b33['push'](_0xc07b33['shift']());}};_0x746787(++_0x3d745f);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));module[_0xd7df('0xb')]=function(_0x36cf0f,_0x39ce98){return _0x36cf0f[_0xd7df('0xc')](_0xd7df('0xd'),attributes,{'tableName':_0xd7df('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2fe=['../../config/environment','exports','define','JscriptySessionReport','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'report_jscripty_sessions','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 9207a15..ecc4e5f 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 _0x8aad=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x269d3c,_0x3c2082){var _0x393caf=function(_0x2d2aa8){while(--_0x2d2aa8){_0x269d3c['push'](_0x269d3c['shift']());}};_0x393caf(++_0x3c2082);}(_0x8aad,0x146));var _0xd8aa=function(_0x3de463,_0x531a27){_0x3de463=_0x3de463-0x0;var _0x40327f=_0x8aad[_0x3de463];return _0x40327f;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ea12,_0x4a4b10,_0x2a559d){return new BPromise(function(_0x1da411,_0x2a23b5){return client[_0xd8aa('0x8')](_0x16ea12,_0x2a559d)['then'](function(_0x5de228){logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x4a4b10,'request\x20sent',JSON[_0xd8aa('0xe')](_0x5de228));if(_0x5de228[_0xd8aa('0xf')]){if(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x10')]===0x1f4){logger[_0xd8aa('0xf')](_0xd8aa('0xa'),_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x2a23b5(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x1da411(_0x5de228[_0xd8aa('0xf')]['message']);}else{logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));_0x1da411(_0x5de228[_0xd8aa('0x12')]['message']);}})[_0xd8aa('0x13')](function(_0xa9ba1b){logger['error'](_0xd8aa('0xa'),_0x4a4b10,_0xa9ba1b);_0x2a23b5(_0xa9ba1b);});});} \ No newline at end of file +var _0x5c3c=['JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x43938b,_0x128db6){var _0x15b82a=function(_0xf38284){while(--_0xf38284){_0x43938b['push'](_0x43938b['shift']());}};_0x15b82a(++_0x128db6);}(_0x5c3c,0x132));var _0xc5c3=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x5c3c[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 9d2b9f5..ad30b17 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 _0x1f26=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','isAuthenticated','exports','multer'];(function(_0x21446d,_0xbf802b){var _0x11e317=function(_0x43e386){while(--_0x43e386){_0x21446d['push'](_0x21446d['shift']());}};_0x11e317(++_0xbf802b);}(_0x1f26,0xb5));var _0x61f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1f26[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x61f2('0x0'));var util=require(_0x61f2('0x1'));var path=require(_0x61f2('0x2'));var timeout=require('connect-timeout');var express=require(_0x61f2('0x3'));var router=express[_0x61f2('0x4')]();var fs_extra=require(_0x61f2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x61f2('0x6'));var config=require(_0x61f2('0x7'));var controller=require(_0x61f2('0x8'));router[_0x61f2('0x9')]('/',controller['index']);router[_0x61f2('0xa')](_0x61f2('0xb'),auth[_0x61f2('0xc')](),controller['update']);module[_0x61f2('0xd')]=router; \ No newline at end of file +var _0x0b36=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','util','path'];(function(_0x177505,_0x47a47a){var _0xb3dbfd=function(_0x46d26a){while(--_0x46d26a){_0x177505['push'](_0x177505['shift']());}};_0xb3dbfd(++_0x47a47a);}(_0x0b36,0x80));var _0x60b3=function(_0x49f368,_0xf070e2){_0x49f368=_0x49f368-0x0;var _0x3923f3=_0x0b36[_0x49f368];return _0x3923f3;};'use strict';var multer=require('multer');var util=require(_0x60b3('0x0'));var path=require(_0x60b3('0x1'));var timeout=require('connect-timeout');var express=require(_0x60b3('0x2'));var router=express[_0x60b3('0x3')]();var fs_extra=require(_0x60b3('0x4'));var auth=require(_0x60b3('0x5'));var interaction=require(_0x60b3('0x6'));var config=require(_0x60b3('0x7'));var controller=require(_0x60b3('0x8'));router[_0x60b3('0x9')]('/',controller[_0x60b3('0xa')]);router['put'](_0x60b3('0xb'),auth[_0x60b3('0xc')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 4971ab6..50fa757 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 _0xd2df=['STRING','TEXT'];(function(_0xf40d11,_0xb4dd63){var _0x2c21c8=function(_0x14a2cc){while(--_0x14a2cc){_0xf40d11['push'](_0xf40d11['shift']());}};_0x2c21c8(++_0xb4dd63);}(_0xd2df,0x89));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0xfd2d('0x0')]},'data1':{'type':Sequelize[_0xfd2d('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9d6a=['STRING','sequelize','exports','TEXT'];(function(_0x50700a,_0x3cfa24){var _0x93612c=function(_0x3bd5c0){while(--_0x3bd5c0){_0x50700a['push'](_0x50700a['shift']());}};_0x93612c(++_0x3cfa24);}(_0x9d6a,0x1b5));var _0xa9d6=function(_0x1d1a27,_0xad4ccb){_0x1d1a27=_0x1d1a27-0x0;var _0x29a011=_0x9d6a[_0x1d1a27];return _0x29a011;};'use strict';var Sequelize=require(_0xa9d6('0x0'));module[_0xa9d6('0x1')]={'license':{'type':Sequelize[_0xa9d6('0x2')]},'data1':{'type':Sequelize[_0xa9d6('0x3')]},'data2':{'type':Sequelize[_0xa9d6('0x3')]},'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 1b704dd..0dd75c9 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 _0x2ef3=['length','options','then','catch','body','params','get','checkLicense','demo','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x21e8a8,_0x1990e0){var _0x895006=function(_0x148e34){while(--_0x148e34){_0x21e8a8['push'](_0x21e8a8['shift']());}};_0x895006(++_0x1990e0);}(_0x2ef3,0xba));var _0x32ef=function(_0x51ddcd,_0x5dcb17){_0x51ddcd=_0x51ddcd-0x0;var _0x2a9d7e=_0x2ef3[_0x51ddcd];return _0x2a9d7e;};'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'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}var utilLicense=require('../../config/license/util');exports[_0x32ef('0x29')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={'raw':!![],'where':{'id':0x1}},_0x3c569d={};_0x3c569d[_0x32ef('0x2a')]=_[_0x32ef('0x2b')](db['License'][_0x32ef('0x2c')]);_0x3c569d[_0x32ef('0x2d')]=_[_0x32ef('0x2b')](_0x2f5d06[_0x32ef('0x2d')]);_0x3c569d[_0x32ef('0x2e')]=_[_0x32ef('0x2f')](_0x3c569d[_0x32ef('0x2a')],_0x3c569d['query']);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x3c569d[_0x32ef('0x2a')],qs[_0x32ef('0x31')](_0x2f5d06['query'][_0x32ef('0x31')]));_0x12de1a[_0x32ef('0x30')]=_0x12de1a[_0x32ef('0x30')][_0x32ef('0x32')]?_0x12de1a[_0x32ef('0x30')]:_0x3c569d['model'];_0x12de1a=_['merge']({},_0x12de1a,_0x2f5d06[_0x32ef('0x33')]);return utilLicense['getLicense'](_0x12de1a)[_0x32ef('0x34')](respondWithResult(_0x5a04cd,null))[_0x32ef('0x35')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x24')]=function(_0x390670,_0x389583){if(_0x390670[_0x32ef('0x36')]['id']){delete _0x390670['body']['id'];}return db['License']['find']({'where':{'id':_0x390670[_0x32ef('0x37')]['id']}})[_0x32ef('0x34')](handleEntityNotFound(_0x389583,null))[_0x32ef('0x34')](function(_0x5f2443){var _0x4fb402=_0x5f2443[_0x32ef('0x38')]({'plain':!![]});return utilLicense[_0x32ef('0x39')](_0x4fb402,_0x390670[_0x32ef('0x36')]['key']);})['then'](function(_0xcbdec8){if(!_0xcbdec8[_0x32ef('0x3a')]){return saveUpdates(_0x390670[_0x32ef('0x36')],null);}return _0xcbdec8;})[_0x32ef('0x34')](respondWithResult(_0x389583,null))[_0x32ef('0x35')](handleError(_0x389583,null));}; \ No newline at end of file +var _0x814b=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','model','keys','rawAttributes','intersection','query','attributes','fields','length','merge','options','getLicense','catch','body','License','params','get','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x2b9f98,_0x287922){var _0x29fc1b=function(_0xc72094){while(--_0xc72094){_0x2b9f98['push'](_0x2b9f98['shift']());}};_0x29fc1b(++_0x287922);}(_0x814b,0x1a2));var _0xb814=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0x814b[_0x1ad901];return _0x3c0249;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}var utilLicense=require(_0xb814('0x19'));exports['index']=function(_0x9008b2,_0x37d24d){var _0x530744={'raw':!![],'where':{'id':0x1}},_0x499f22={};_0x499f22[_0xb814('0x2e')]=_[_0xb814('0x2f')](db['License'][_0xb814('0x30')]);_0x499f22['query']=_[_0xb814('0x2f')](_0x9008b2['query']);_0x499f22['filters']=_[_0xb814('0x31')](_0x499f22['model'],_0x499f22[_0xb814('0x32')]);_0x530744[_0xb814('0x33')]=_[_0xb814('0x31')](_0x499f22['model'],qs['fields'](_0x9008b2[_0xb814('0x32')][_0xb814('0x34')]));_0x530744['attributes']=_0x530744[_0xb814('0x33')][_0xb814('0x35')]?_0x530744[_0xb814('0x33')]:_0x499f22[_0xb814('0x2e')];_0x530744=_[_0xb814('0x36')]({},_0x530744,_0x9008b2[_0xb814('0x37')]);return utilLicense[_0xb814('0x38')](_0x530744)['then'](respondWithResult(_0x37d24d,null))[_0xb814('0x39')](handleError(_0x37d24d,null));};exports[_0xb814('0x27')]=function(_0x30de5a,_0x424e2b){if(_0x30de5a[_0xb814('0x3a')]['id']){delete _0x30de5a['body']['id'];}return db[_0xb814('0x3b')]['find']({'where':{'id':_0x30de5a[_0xb814('0x3c')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x424e2b,null))[_0xb814('0x28')](function(_0x492d5e){var _0x40b885=_0x492d5e[_0xb814('0x3d')]({'plain':!![]});return utilLicense['checkLicense'](_0x40b885,_0x30de5a[_0xb814('0x3a')][_0xb814('0x3e')]);})[_0xb814('0x28')](function(_0x1f7cd8){if(!_0x1f7cd8[_0xb814('0x3f')]){return saveUpdates(_0x30de5a[_0xb814('0x3a')],null);}return _0x1f7cd8;})['then'](respondWithResult(_0x424e2b,null))[_0xb814('0x39')](handleError(_0x424e2b,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index efd70f3..58595db 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 _0x44bd=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./license.attributes','exports','License','license'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x44bd,0x6c));var _0xd44b=function(_0x186c6c,_0x2774b4){_0x186c6c=_0x186c6c-0x0;var _0x3a6298=_0x44bd[_0x186c6c];return _0x3a6298;};'use strict';var _=require(_0xd44b('0x0'));var util=require(_0xd44b('0x1'));var logger=require(_0xd44b('0x2'))(_0xd44b('0x3'));var moment=require(_0xd44b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd44b('0x5'));var rimraf=require(_0xd44b('0x6'));var config=require(_0xd44b('0x7'));var attributes=require(_0xd44b('0x8'));module[_0xd44b('0x9')]=function(_0x777283,_0x58ce68){return _0x777283['define'](_0xd44b('0xa'),attributes,{'tableName':_0xd44b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfeea=['license','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define','License'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0xfeea,0x105));var _0xafee=function(_0x237c45,_0x55cf99){_0x237c45=_0x237c45-0x0;var _0x2942f6=_0xfeea[_0x237c45];return _0x2942f6;};'use strict';var _=require(_0xafee('0x0'));var util=require(_0xafee('0x1'));var logger=require(_0xafee('0x2'))(_0xafee('0x3'));var moment=require('moment');var BPromise=require(_0xafee('0x4'));var rp=require(_0xafee('0x5'));var fs=require('fs');var path=require(_0xafee('0x6'));var rimraf=require('rimraf');var config=require(_0xafee('0x7'));var attributes=require(_0xafee('0x8'));module[_0xafee('0x9')]=function(_0x4f4bb4,_0x5c107e){return _0x4f4bb4[_0xafee('0xa')](_0xafee('0xb'),attributes,{'tableName':_0xafee('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 94ec963..4c0c560 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 _0x2fd9=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4b366e,_0x479e1f){var _0x464dff=function(_0x5ac61c){while(--_0x5ac61c){_0x4b366e['push'](_0x4b366e['shift']());}};_0x464dff(++_0x479e1f);}(_0x2fd9,0x134));var _0x92fd=function(_0x3b33b9,_0x106957){_0x3b33b9=_0x3b33b9-0x0;var _0x38b257=_0x2fd9[_0x3b33b9];return _0x38b257;};'use strict';var _=require(_0x92fd('0x0'));var util=require(_0x92fd('0x1'));var moment=require(_0x92fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x92fd('0x3'));var fs=require('fs');var Redis=require(_0x92fd('0x4'));var db=require(_0x92fd('0x5'))['db'];var utils=require(_0x92fd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x92fd('0x7'));var jayson=require(_0x92fd('0x8'));var client=jayson[_0x92fd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x93eba1,_0x36ae27,_0x45c9f5){return new BPromise(function(_0x1e4beb,_0x1a0eae){return client[_0x92fd('0xa')](_0x93eba1,_0x45c9f5)[_0x92fd('0xb')](function(_0x32fa67){logger[_0x92fd('0xc')](_0x92fd('0xd'),_0x36ae27,_0x92fd('0xe'));logger[_0x92fd('0xf')](_0x92fd('0x10'),_0x36ae27,_0x92fd('0xe'),JSON[_0x92fd('0x11')](_0x32fa67));if(_0x32fa67[_0x92fd('0x12')]){if(_0x32fa67[_0x92fd('0x12')][_0x92fd('0x13')]===0x1f4){logger[_0x92fd('0x12')](_0x92fd('0xd'),_0x36ae27,_0x32fa67[_0x92fd('0x12')][_0x92fd('0x14')]);return _0x1a0eae(_0x32fa67[_0x92fd('0x12')][_0x92fd('0x14')]);}logger[_0x92fd('0x12')](_0x92fd('0xd'),_0x36ae27,_0x32fa67[_0x92fd('0x12')][_0x92fd('0x14')]);return _0x1e4beb(_0x32fa67['error'][_0x92fd('0x14')]);}else{logger[_0x92fd('0xc')]('License,\x20%s,\x20%s',_0x36ae27,_0x92fd('0xe'));_0x1e4beb(_0x32fa67[_0x92fd('0x15')][_0x92fd('0x14')]);}})['catch'](function(_0x4c97d2){logger[_0x92fd('0x12')]('License,\x20%s,\x20%s',_0x36ae27,_0x4c97d2);_0x1a0eae(_0x4c97d2);});});} \ No newline at end of file +var _0x9af0=['randomstring','../../config/logger','../../config/environment','jayson/promise','client','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util','moment','bluebird'];(function(_0x22d3f6,_0x31834c){var _0x4b6f1e=function(_0x5e0e73){while(--_0x5e0e73){_0x22d3f6['push'](_0x22d3f6['shift']());}};_0x4b6f1e(++_0x31834c);}(_0x9af0,0xf8));var _0x09af=function(_0x311007,_0x499b48){_0x311007=_0x311007-0x0;var _0x1fbe59=_0x9af0[_0x311007];return _0x1fbe59;};'use strict';var _=require(_0x09af('0x0'));var util=require(_0x09af('0x1'));var moment=require(_0x09af('0x2'));var BPromise=require(_0x09af('0x3'));var rs=require(_0x09af('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x09af('0x5'))('rpc');var config=require(_0x09af('0x6'));var jayson=require(_0x09af('0x7'));var client=jayson[_0x09af('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35bf62,_0x4170b5,_0xb35502){return new BPromise(function(_0x47eacc,_0x3fa0b0){return client['request'](_0x35bf62,_0xb35502)[_0x09af('0x9')](function(_0x3e8069){logger[_0x09af('0xa')](_0x09af('0xb'),_0x4170b5,_0x09af('0xc'));logger['debug'](_0x09af('0xd'),_0x4170b5,_0x09af('0xc'),JSON[_0x09af('0xe')](_0x3e8069));if(_0x3e8069['error']){if(_0x3e8069['error'][_0x09af('0xf')]===0x1f4){logger[_0x09af('0x10')](_0x09af('0xb'),_0x4170b5,_0x3e8069[_0x09af('0x10')][_0x09af('0x11')]);return _0x3fa0b0(_0x3e8069['error']['message']);}logger[_0x09af('0x10')](_0x09af('0xb'),_0x4170b5,_0x3e8069[_0x09af('0x10')][_0x09af('0x11')]);return _0x47eacc(_0x3e8069[_0x09af('0x10')][_0x09af('0x11')]);}else{logger[_0x09af('0xa')](_0x09af('0xb'),_0x4170b5,_0x09af('0xc'));_0x47eacc(_0x3e8069['result']['message']);}})['catch'](function(_0x5a6db7){logger['error'](_0x09af('0xb'),_0x4170b5,_0x5a6db7);_0x3fa0b0(_0x5a6db7);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 7501360..ae885a5 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 _0x8572=['getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','put','update','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/out_servers'];(function(_0x438ec5,_0x555ab0){var _0x25c516=function(_0x529b3c){while(--_0x529b3c){_0x438ec5['push'](_0x438ec5['shift']());}};_0x25c516(++_0x555ab0);}(_0x8572,0x1e0));var _0x2857=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x8572[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0x2857('0x0'));var util=require('util');var path=require(_0x2857('0x1'));var timeout=require(_0x2857('0x2'));var express=require(_0x2857('0x3'));var router=express[_0x2857('0x4')]();var fs_extra=require(_0x2857('0x5'));var auth=require(_0x2857('0x6'));var interaction=require(_0x2857('0x7'));var config=require(_0x2857('0x8'));var controller=require(_0x2857('0x9'));router['get']('/',auth[_0x2857('0xa')](),controller[_0x2857('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2857('0xc')](_0x2857('0xd'),auth[_0x2857('0xa')](),controller[_0x2857('0xe')]);router['get'](_0x2857('0xf'),auth[_0x2857('0xa')](),controller[_0x2857('0x10')]);router['get'](_0x2857('0x11'),auth['isAuthenticated'](),controller[_0x2857('0x12')]);router['get']('/:id/in_servers',auth[_0x2857('0xa')](),controller['getImap']);router[_0x2857('0xc')](_0x2857('0x13'),auth[_0x2857('0xa')](),controller[_0x2857('0x14')]);router[_0x2857('0xc')](_0x2857('0x15'),auth[_0x2857('0xa')](),controller[_0x2857('0x16')]);router[_0x2857('0xc')]('/:id/applications',auth[_0x2857('0xa')](),controller[_0x2857('0x17')]);router[_0x2857('0xc')](_0x2857('0x18'),auth[_0x2857('0xa')](),controller[_0x2857('0x19')]);router[_0x2857('0xc')](_0x2857('0x1a'),auth['isAuthenticated'](),controller[_0x2857('0x1b')]);router['get'](_0x2857('0x1c'),auth['isAuthenticated'](),controller[_0x2857('0x1d')]);router[_0x2857('0x1e')](_0x2857('0xf'),auth[_0x2857('0xa')](),controller['addDisposition']);router[_0x2857('0x1e')](_0x2857('0x11'),auth[_0x2857('0xa')](),controller[_0x2857('0x1f')]);router['post']('/',auth[_0x2857('0xa')](),controller[_0x2857('0x20')]);router[_0x2857('0x1e')](_0x2857('0x21'),auth['isAuthenticated'](),controller[_0x2857('0x22')]);router[_0x2857('0x1e')](_0x2857('0x13'),auth['isAuthenticated'](),controller[_0x2857('0x23')]);router[_0x2857('0x1e')]('/:id/interactions',auth[_0x2857('0xa')](),controller[_0x2857('0x24')]);router[_0x2857('0x1e')](_0x2857('0x25'),auth[_0x2857('0xa')](),controller[_0x2857('0x26')]);router[_0x2857('0x1e')](_0x2857('0x27'),auth[_0x2857('0xa')](),controller[_0x2857('0x28')]);router[_0x2857('0x1e')](_0x2857('0x1c'),auth[_0x2857('0xa')](),controller['addAgents']);router[_0x2857('0x29')](_0x2857('0xd'),auth[_0x2857('0xa')](),controller[_0x2857('0x2a')]);router[_0x2857('0x2b')](_0x2857('0xf'),auth[_0x2857('0xa')](),controller['removeDispositions']);router[_0x2857('0x2b')](_0x2857('0x11'),auth[_0x2857('0xa')](),controller[_0x2857('0x2c')]);router['delete'](_0x2857('0x21'),auth[_0x2857('0xa')](),controller[_0x2857('0x2d')]);router[_0x2857('0x2b')]('/:id/out_servers',auth[_0x2857('0xa')](),controller[_0x2857('0x2e')]);router[_0x2857('0x2b')](_0x2857('0xd'),auth[_0x2857('0xa')](),controller[_0x2857('0x2f')]);router[_0x2857('0x2b')](_0x2857('0x1c'),auth['isAuthenticated'](),controller[_0x2857('0x30')]);module[_0x2857('0x31')]=router; \ No newline at end of file +var _0x44b4=['addInteraction','/:id/applications','addApplications','send','addAgents','put','delete','removeImap','destroy','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','create','addSmtp'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x44b4,0x13f));var _0x444b=function(_0x5a01d7,_0x1715f3){_0x5a01d7=_0x5a01d7-0x0;var _0x1ab6ad=_0x44b4[_0x5a01d7];return _0x1ab6ad;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x444b('0x0'));var timeout=require(_0x444b('0x1'));var express=require(_0x444b('0x2'));var router=express[_0x444b('0x3')]();var fs_extra=require(_0x444b('0x4'));var auth=require(_0x444b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x444b('0x6'));var controller=require('./mailAccount.controller');router[_0x444b('0x7')]('/',auth[_0x444b('0x8')](),controller[_0x444b('0x9')]);router[_0x444b('0x7')](_0x444b('0xa'),auth['isAuthenticated'](),controller[_0x444b('0xb')]);router['get'](_0x444b('0xc'),auth[_0x444b('0x8')](),controller['show']);router['get'](_0x444b('0xd'),auth[_0x444b('0x8')](),controller[_0x444b('0xe')]);router[_0x444b('0x7')](_0x444b('0xf'),auth[_0x444b('0x8')](),controller[_0x444b('0x10')]);router[_0x444b('0x7')](_0x444b('0x11'),auth[_0x444b('0x8')](),controller[_0x444b('0x12')]);router[_0x444b('0x7')](_0x444b('0x13'),auth[_0x444b('0x8')](),controller[_0x444b('0x14')]);router[_0x444b('0x7')](_0x444b('0x15'),auth['isAuthenticated'](),controller[_0x444b('0x16')]);router[_0x444b('0x7')]('/:id/applications',auth[_0x444b('0x8')](),controller[_0x444b('0x17')]);router[_0x444b('0x7')](_0x444b('0x18'),auth['isAuthenticated'](),controller[_0x444b('0x19')]);router['get'](_0x444b('0x1a'),auth['isAuthenticated'](),controller[_0x444b('0x1b')]);router[_0x444b('0x7')](_0x444b('0x1c'),auth[_0x444b('0x8')](),controller[_0x444b('0x1d')]);router[_0x444b('0x1e')](_0x444b('0xd'),auth[_0x444b('0x8')](),controller['addDisposition']);router[_0x444b('0x1e')](_0x444b('0xf'),auth[_0x444b('0x8')](),controller['addAnswer']);router[_0x444b('0x1e')]('/',auth['isAuthenticated'](),controller[_0x444b('0x1f')]);router[_0x444b('0x1e')](_0x444b('0x11'),auth[_0x444b('0x8')](),controller['addImap']);router['post'](_0x444b('0x13'),auth[_0x444b('0x8')](),controller[_0x444b('0x20')]);router[_0x444b('0x1e')](_0x444b('0x15'),auth[_0x444b('0x8')](),controller[_0x444b('0x21')]);router[_0x444b('0x1e')](_0x444b('0x22'),auth['isAuthenticated'](),controller[_0x444b('0x23')]);router[_0x444b('0x1e')]('/:id/send',auth[_0x444b('0x8')](),controller[_0x444b('0x24')]);router[_0x444b('0x1e')](_0x444b('0x1c'),auth[_0x444b('0x8')](),controller[_0x444b('0x25')]);router[_0x444b('0x26')](_0x444b('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x444b('0xd'),auth[_0x444b('0x8')](),controller['removeDispositions']);router[_0x444b('0x27')]('/:id/canned_answers',auth[_0x444b('0x8')](),controller['removeAnswers']);router['delete'](_0x444b('0x11'),auth[_0x444b('0x8')](),controller[_0x444b('0x28')]);router['delete'](_0x444b('0x13'),auth[_0x444b('0x8')](),controller['removeSmtp']);router[_0x444b('0x27')](_0x444b('0xc'),auth[_0x444b('0x8')](),controller[_0x444b('0x29')]);router[_0x444b('0x27')]('/:id/users',auth['isAuthenticated'](),controller[_0x444b('0x2a')]);module[_0x444b('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index cd02355..a5f4a8a 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 _0x55ca=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x55ca,0x126));var _0xa55c=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x55ca[_0x8b8564];return _0x360c61;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xa55c('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa55c('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xa55c('0x4')]},'markAsUnread':{'type':Sequelize[_0xa55c('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xa55c('0x2')],'allowNull':![],'defaultValue':_0xa55c('0x5')},'fontSize':{'type':Sequelize[_0xa55c('0x6')](0x2)[_0xa55c('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa55c('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[_0xa55c('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa55c('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa55c('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa55c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa55c('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xa55c('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xa55c('0x3')],'defaultValue':![],'comment':_0xa55c('0x9'),'set':function(_0x31646d){if(!_0x31646d)this[_0xa55c('0xa')](_0xa55c('0xb'),null);this[_0xa55c('0xa')](_0xa55c('0xc'),_0x31646d);}}}; \ No newline at end of file +var _0xb205=['STRING','BOOLEAN','INTEGER','UNSIGNED','TEXT','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x284c46,_0x49ac7e){var _0x290328=function(_0x370655){while(--_0x370655){_0x284c46['push'](_0x284c46['shift']());}};_0x290328(++_0x49ac7e);}(_0xb205,0xf0));var _0x5b20=function(_0x5b13f1,_0x8eaf5f){_0x5b13f1=_0x5b13f1-0x0;var _0x10b6bd=_0xb205[_0x5b13f1];return _0x10b6bd;};'use strict';var Sequelize=require(_0x5b20('0x0'));module[_0x5b20('0x1')]={'description':{'type':Sequelize[_0x5b20('0x2')]},'name':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x5b20('0x4')](0x2)[_0x5b20('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5b20('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5b20('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5b20('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5b20('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x5b20('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![],'comment':_0x5b20('0x8'),'set':function(_0x5ebb0d){if(!_0x5ebb0d)this[_0x5b20('0x9')](_0x5b20('0xa'),null);this[_0x5b20('0x9')]('mandatoryDisposition',_0x5ebb0d);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 5a05442..e1ebe5d 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 _0x636f=['%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','Contacts','ListId','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','end','stack','name','index','MailServerIn','Imap','Smtp','Pause','map','MailAccount','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','include','show','mandatoryDispositionPause','fields','includeAll','options','find','update','body','MailServerOut','describe','addDisposition','params','MailAccountId','Disposition','create','getDispositions','nolimit','removeDispositions','ids','getAnswers','findOne','CannedAnswer','findAll','rows','removeAnswers','email','isNil','description','cservice','cauthentication','user','cuser','pass','authentication','host','port','service','password','cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','omit','getInteractions','MailInteraction','User','Owner','fullname','Tag','Tags','tag','addApplications','transaction','MailApplication','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','CmContact','DESC','from'];(function(_0x30d5a5,_0x5b3ade){var _0x7188a0=function(_0x3b6ab2){while(--_0x3b6ab2){_0x30d5a5['push'](_0x30d5a5['shift']());}};_0x7188a0(++_0x5b3ade);}(_0x636f,0xe3));var _0xf636=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x636f[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xf636('0x0'));var rimraf=require(_0xf636('0x1'));var zipdir=require(_0xf636('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf636('0x3'));var moment=require('moment');var BPromise=require(_0xf636('0x4'));var Mustache=require(_0xf636('0x5'));var util=require(_0xf636('0x6'));var path=require(_0xf636('0x7'));var sox=require(_0xf636('0x8'));var csv=require(_0xf636('0x9'));var ejs=require(_0xf636('0xa'));var fs=require('fs');var fs_extra=require(_0xf636('0xb'));var _=require(_0xf636('0xc'));var squel=require(_0xf636('0xd'));var crypto=require('crypto');var jsforce=require(_0xf636('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf636('0xf'));var Papa=require(_0xf636('0x10'));var htmlToText=require(_0xf636('0x11'));var juice=require(_0xf636('0x12'));var Redis=require(_0xf636('0x13'));var authService=require(_0xf636('0x14'));var qs=require(_0xf636('0x15'));var as=require(_0xf636('0x16'));var hardwareService=require(_0xf636('0x17'));var logger=require(_0xf636('0x18'))(_0xf636('0x19'));var utils=require(_0xf636('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xf636('0x1b'));var db=require('../../mysqldb')['db'];config[_0xf636('0x1c')]=_[_0xf636('0x1d')](config[_0xf636('0x1c')],{'host':_0xf636('0x1e'),'port':0x18eb});var socket=require(_0xf636('0x1f'))(new Redis(config['redis']));require(_0xf636('0x20'))['register'](socket);var jayson=require(_0xf636('0x21'));var client=jayson['client'][_0xf636('0x22')]({'port':0x232b});function respondWithRpcPromise(_0x4f5e3d,_0x4e785f,_0x5a4a88,_0x44f714){return new BPromise(function(_0x44b351,_0x433560){var _0x12ef9a=_0x44f714||client;return _0x12ef9a['request'](_0x4f5e3d,_0x5a4a88)[_0xf636('0x23')](function(_0x357eae){logger[_0xf636('0x24')](_0xf636('0x25'),_0x4e785f,_0xf636('0x26'));logger[_0xf636('0x27')](_0xf636('0x28'),_0x4e785f,_0xf636('0x26'),JSON[_0xf636('0x29')](_0x357eae));if(_0x357eae[_0xf636('0x2a')]){if(_0x357eae[_0xf636('0x2a')][_0xf636('0x2b')]===0x1f4){logger[_0xf636('0x2a')](_0xf636('0x25'),_0x4e785f,_0x357eae[_0xf636('0x2a')]['message']);return _0x433560(_0x357eae['error'][_0xf636('0x2c')]);}logger[_0xf636('0x2a')](_0xf636('0x25'),_0x4e785f,_0x357eae[_0xf636('0x2a')][_0xf636('0x2c')]);return _0x44b351(_0x357eae[_0xf636('0x2a')][_0xf636('0x2c')]);}else{logger[_0xf636('0x24')](_0xf636('0x25'),_0x4e785f,'request\x20sent');_0x44b351(_0x357eae[_0xf636('0x2d')][_0xf636('0x2c')]);}})[_0xf636('0x2e')](function(_0x3278ee){logger[_0xf636('0x2a')](_0xf636('0x25'),_0x4e785f,_0x3278ee);_0x433560(_0x3278ee);});});}function respondWithStatusCode(_0x51e6b0,_0x539877){_0x539877=_0x539877||0xcc;return function(_0x32d69d){if(_0x32d69d){return _0x51e6b0[_0xf636('0x2f')](_0x539877);}return _0x51e6b0[_0xf636('0x30')](_0x539877)['end']();};}function respondWithResult(_0x164262,_0x5511a7){_0x5511a7=_0x5511a7||0xc8;return function(_0x1c8482){if(_0x1c8482){return _0x164262[_0xf636('0x30')](_0x5511a7)[_0xf636('0x31')](_0x1c8482);}};}function respondWithFilteredResult(_0x586441,_0x42561c){return function(_0x3a4c81){if(_0x3a4c81){var _0x598b4e=typeof _0x42561c[_0xf636('0x32')]===_0xf636('0x33')&&typeof _0x42561c['limit']===_0xf636('0x33');var _0x2ad6c8=_0x3a4c81[_0xf636('0x34')];var _0x5baf53=_0x598b4e?0x0:_0x42561c[_0xf636('0x32')];var _0x5d6fbd=_0x598b4e?_0x3a4c81['count']:_0x42561c['offset']+_0x42561c[_0xf636('0x35')];var _0x3994dc;if(_0x5d6fbd>=_0x2ad6c8){_0x5d6fbd=_0x2ad6c8;_0x3994dc=0xc8;}else{_0x3994dc=0xce;}_0x586441[_0xf636('0x30')](_0x3994dc);return _0x586441[_0xf636('0x36')](_0xf636('0x37'),_0x5baf53+'-'+_0x5d6fbd+'/'+_0x2ad6c8)[_0xf636('0x31')](_0x3a4c81);}return null;};}function patchUpdates(_0x3132e7){return function(_0x1a41e5){try{jsonpatch['apply'](_0x1a41e5,_0x3132e7,!![]);}catch(_0x507d20){return BPromise[_0xf636('0x38')](_0x507d20);}return _0x1a41e5[_0xf636('0x39')]();};}function saveUpdates(_0x474430,_0x29bcce){return function(_0x239f4d){if(_0x239f4d){return _0x239f4d['update'](_0x474430)[_0xf636('0x23')](function(_0x5e24bd){return _0x5e24bd;});}return null;};}function removeEntity(_0x362b28,_0x3d1641){return function(_0x153629){if(_0x153629){return _0x153629['destroy']()[_0xf636('0x23')](function(){var _0x22aff5=_0x153629['get']({'plain':!![]});var _0xfcd6d6='MailAccounts';return db['UserProfileResource'][_0xf636('0x3a')]({'where':{'type':_0xfcd6d6,'resourceId':_0x22aff5['id']}})['then'](function(){return _0x153629;});})[_0xf636('0x23')](function(){_0x362b28['status'](0xcc)[_0xf636('0x3b')]();});}};}function handleEntityNotFound(_0x328dbb,_0x38f57a){return function(_0x4e150c){if(!_0x4e150c){_0x328dbb[_0xf636('0x2f')](0x194);}return _0x4e150c;};}function handleError(_0x11839e,_0x51de9d){_0x51de9d=_0x51de9d||0x1f4;return function(_0x32537b){logger[_0xf636('0x2a')](_0x32537b[_0xf636('0x3c')]);if(_0x32537b[_0xf636('0x3d')]){delete _0x32537b[_0xf636('0x3d')];}_0x11839e['status'](_0x51de9d)['send'](_0x32537b);};}exports[_0xf636('0x3e')]=function(_0x436028,_0x457357){var _0x531e8c={'include':[{'model':db[_0xf636('0x3f')],'as':_0xf636('0x40')},{'model':db['MailServerOut'],'as':_0xf636('0x41')},{'model':db[_0xf636('0x42')],'as':'mandatoryDispositionPause'}]},_0x315974={},_0x183158={'count':0x0,'rows':[]};var _0x6bbabc=_[_0xf636('0x43')](db[_0xf636('0x44')][_0xf636('0x45')],function(_0x3cadbd){return{'name':_0x3cadbd[_0xf636('0x46')],'type':_0x3cadbd['type'][_0xf636('0x47')]};});_0x315974[_0xf636('0x48')]=_['map'](_0x6bbabc,'name');_0x315974['query']=_[_0xf636('0x49')](_0x436028[_0xf636('0x4a')]);_0x315974[_0xf636('0x4b')]=_[_0xf636('0x4c')](_0x315974['model'],_0x315974['query']);_0x531e8c[_0xf636('0x4d')]=_[_0xf636('0x4c')](_0x315974['model'],qs['fields'](_0x436028[_0xf636('0x4a')]['fields']));_0x531e8c[_0xf636('0x4d')]=_0x531e8c[_0xf636('0x4d')][_0xf636('0x4e')]?_0x531e8c[_0xf636('0x4d')]:_0x315974[_0xf636('0x48')];if(!_0x436028[_0xf636('0x4a')][_0xf636('0x4f')]('nolimit')){_0x531e8c[_0xf636('0x35')]=qs['limit'](_0x436028[_0xf636('0x4a')][_0xf636('0x35')]);_0x531e8c[_0xf636('0x32')]=qs[_0xf636('0x32')](_0x436028[_0xf636('0x4a')]['offset']);}_0x531e8c[_0xf636('0x50')]=qs['sort'](_0x436028['query'][_0xf636('0x51')]);_0x531e8c[_0xf636('0x52')]=qs['filters'](_[_0xf636('0x53')](_0x436028['query'],_0x315974[_0xf636('0x4b')]),_0x6bbabc);if(_0x436028[_0xf636('0x4a')][_0xf636('0x54')]){_0x531e8c[_0xf636('0x52')]=_[_0xf636('0x55')](_0x531e8c[_0xf636('0x52')],{'$or':_['map'](_0x6bbabc,function(_0x1686ce){if(_0x1686ce[_0xf636('0x56')]!==_0xf636('0x57')){var _0x3102bb={};_0x3102bb[_0x1686ce[_0xf636('0x3d')]]={'$like':'%'+_0x436028['query'][_0xf636('0x54')]+'%'};return _0x3102bb;}})});}_0x531e8c=_[_0xf636('0x55')]({},_0x531e8c,_0x436028['options']);var _0x14839d={'where':_0x531e8c[_0xf636('0x52')]};return db[_0xf636('0x44')][_0xf636('0x34')](_0x14839d)[_0xf636('0x23')](function(_0x56b221){_0x183158[_0xf636('0x34')]=_0x56b221;if(_0x436028['query']['includeAll']){_0x531e8c[_0xf636('0x58')]=[{'all':!![]}];}return db[_0xf636('0x44')]['findAll'](_0x531e8c);})['then'](function(_0x4d0195){_0x183158['rows']=_0x4d0195;return _0x183158;})['then'](respondWithFilteredResult(_0x457357,_0x531e8c))['catch'](handleError(_0x457357,null));};exports[_0xf636('0x59')]=function(_0x1b1e89,_0x47fa2d){var _0x4c8244={'raw':![],'where':{'id':_0x1b1e89['params']['id']},'include':[{'model':db[_0xf636('0x3f')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xf636('0x41')},{'model':db[_0xf636('0x42')],'as':_0xf636('0x5a')}]},_0x35e85a={};_0x35e85a[_0xf636('0x48')]=_[_0xf636('0x49')](db[_0xf636('0x44')][_0xf636('0x45')]);_0x35e85a[_0xf636('0x4a')]=_[_0xf636('0x49')](_0x1b1e89['query']);_0x35e85a['filters']=_['intersection'](_0x35e85a[_0xf636('0x48')],_0x35e85a[_0xf636('0x4a')]);_0x4c8244[_0xf636('0x4d')]=_['intersection'](_0x35e85a[_0xf636('0x48')],qs[_0xf636('0x5b')](_0x1b1e89[_0xf636('0x4a')][_0xf636('0x5b')]));_0x4c8244['attributes']=_0x4c8244[_0xf636('0x4d')][_0xf636('0x4e')]?_0x4c8244[_0xf636('0x4d')]:_0x35e85a[_0xf636('0x48')];if(_0x1b1e89[_0xf636('0x4a')][_0xf636('0x5c')]){_0x4c8244[_0xf636('0x58')]=[{'all':!![]}];}_0x4c8244=_[_0xf636('0x55')]({},_0x4c8244,_0x1b1e89[_0xf636('0x5d')]);return db[_0xf636('0x44')][_0xf636('0x5e')](_0x4c8244)['then'](handleEntityNotFound(_0x47fa2d,null))['then'](respondWithResult(_0x47fa2d,null))[_0xf636('0x2e')](handleError(_0x47fa2d,null));};exports[_0xf636('0x5f')]=function(_0x329437,_0x412de3){if(_0x329437[_0xf636('0x60')]['id']){delete _0x329437['body']['id'];}return db['MailAccount'][_0xf636('0x5e')]({'where':{'id':_0x329437['params']['id']},'include':[{'model':db[_0xf636('0x3f')],'as':'Imap'},{'model':db[_0xf636('0x61')],'as':_0xf636('0x41')},{'model':db[_0xf636('0x42')],'as':_0xf636('0x5a')}]})['then'](handleEntityNotFound(_0x412de3,null))[_0xf636('0x23')](saveUpdates(_0x329437['body'],null))[_0xf636('0x23')](function(_0x56f3c3){if(_0x56f3c3&&_0x329437[_0xf636('0x60')][_0xf636('0x40')]){return db['MailServerIn'][_0xf636('0x5f')](_0x329437[_0xf636('0x60')][_0xf636('0x40')],{'where':{'MailAccountId':_0x56f3c3['id']}})[_0xf636('0x23')](function(){return _0x56f3c3;});}return _0x56f3c3;})[_0xf636('0x23')](function(_0x11cd94){if(_0x11cd94&&_0x329437[_0xf636('0x60')][_0xf636('0x41')]){return db[_0xf636('0x61')][_0xf636('0x5f')](_0x329437[_0xf636('0x60')]['Smtp'],{'where':{'MailAccountId':_0x11cd94['id']}})[_0xf636('0x23')](function(){return _0x11cd94;});}return _0x11cd94;})[_0xf636('0x23')](respondWithResult(_0x412de3,null))['catch'](handleError(_0x412de3,null));};exports[_0xf636('0x62')]=function(_0x3c0276,_0x4c4359){return db[_0xf636('0x44')]['describe']()[_0xf636('0x23')](respondWithResult(_0x4c4359,null))[_0xf636('0x2e')](handleError(_0x4c4359,null));};exports[_0xf636('0x63')]=function(_0x8244f5,_0x583c6b,_0x1aa12d){if(_0x8244f5[_0xf636('0x60')]['id']){delete _0x8244f5[_0xf636('0x60')]['id'];}return db[_0xf636('0x44')][_0xf636('0x5e')]({'where':{'id':_0x8244f5[_0xf636('0x64')]['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x583c6b,null))[_0xf636('0x23')](function(_0x1769c8){if(_0x1769c8){_0x8244f5['body'][_0xf636('0x65')]=_0x1769c8['id'];return db[_0xf636('0x66')][_0xf636('0x67')](_0x8244f5[_0xf636('0x60')]);}})[_0xf636('0x23')](respondWithResult(_0x583c6b,null))[_0xf636('0x2e')](handleError(_0x583c6b,null));};exports[_0xf636('0x68')]=function(_0x5d7576,_0x44d37d,_0xd54661){var _0x3a6b28={'raw':![],'where':{}};var _0x43e817={};var _0x4d0d82={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x5d7576[_0xf636('0x64')]['id']}})['then'](handleEntityNotFound(_0x44d37d,null))[_0xf636('0x23')](function(_0x4bf89c){if(_0x4bf89c){_0x43e817['model']=_[_0xf636('0x49')](db[_0xf636('0x66')][_0xf636('0x45')]);_0x43e817[_0xf636('0x4a')]=_[_0xf636('0x49')](_0x5d7576[_0xf636('0x4a')]);_0x43e817[_0xf636('0x4b')]=_['intersection'](_0x43e817[_0xf636('0x48')],_0x43e817[_0xf636('0x4a')]);_0x3a6b28['attributes']=_[_0xf636('0x4c')](_0x43e817[_0xf636('0x48')],qs[_0xf636('0x5b')](_0x5d7576[_0xf636('0x4a')][_0xf636('0x5b')]));_0x3a6b28[_0xf636('0x4d')]=_0x3a6b28[_0xf636('0x4d')]['length']?_0x3a6b28['attributes']:_0x43e817[_0xf636('0x48')];if(!_0x5d7576['query'][_0xf636('0x4f')](_0xf636('0x69'))){_0x3a6b28[_0xf636('0x35')]=qs[_0xf636('0x35')](_0x5d7576['query'][_0xf636('0x35')]);_0x3a6b28[_0xf636('0x32')]=qs[_0xf636('0x32')](_0x5d7576[_0xf636('0x4a')][_0xf636('0x32')]);}_0x3a6b28['order']=qs[_0xf636('0x51')](_0x5d7576[_0xf636('0x4a')][_0xf636('0x51')]);_0x3a6b28[_0xf636('0x52')]=qs[_0xf636('0x4b')](_[_0xf636('0x53')](_0x5d7576[_0xf636('0x4a')],_0x43e817[_0xf636('0x4b')]));_0x3a6b28[_0xf636('0x52')][_0xf636('0x65')]=_0x4bf89c['id'];if(_0x5d7576[_0xf636('0x4a')][_0xf636('0x54')]){_0x3a6b28['where']=_[_0xf636('0x55')](_0x3a6b28[_0xf636('0x52')],{'$or':_[_0xf636('0x43')](_0x3a6b28[_0xf636('0x4d')],function(_0x135a42){var _0x4c9606={};_0x4c9606[_0x135a42]={'$like':'%'+_0x5d7576[_0xf636('0x4a')][_0xf636('0x54')]+'%'};return _0x4c9606;})});}_0x3a6b28=_[_0xf636('0x55')]({},_0x3a6b28,_0x5d7576[_0xf636('0x5d')]);return db[_0xf636('0x66')]['count']({'where':_0x3a6b28[_0xf636('0x52')]})[_0xf636('0x23')](function(_0x126900){_0x4d0d82['count']=_0x126900;if(_0x5d7576[_0xf636('0x4a')][_0xf636('0x5c')]){_0x3a6b28[_0xf636('0x58')]=[{'all':!![]}];}return db[_0xf636('0x66')]['findAll'](_0x3a6b28);})[_0xf636('0x23')](function(_0x392815){_0x4d0d82['rows']=_0x392815;return _0x4d0d82;});}})[_0xf636('0x23')](respondWithFilteredResult(_0x44d37d,_0x3a6b28))[_0xf636('0x2e')](handleError(_0x44d37d,null));};exports[_0xf636('0x6a')]=function(_0x1bd96b,_0x48c77f,_0x289317){return db['MailAccount'][_0xf636('0x5e')]({'where':{'id':_0x1bd96b[_0xf636('0x64')]['id']}})['then'](handleEntityNotFound(_0x48c77f,null))['then'](function(_0x31d7c4){if(_0x31d7c4){return _0x31d7c4[_0xf636('0x6a')](_0x1bd96b[_0xf636('0x4a')][_0xf636('0x6b')]);}})['then'](respondWithStatusCode(_0x48c77f,null))['catch'](handleError(_0x48c77f,null));};exports['addAnswer']=function(_0x1f7d98,_0x49e27a,_0x3c30c5){if(_0x1f7d98[_0xf636('0x60')]['id']){delete _0x1f7d98[_0xf636('0x60')]['id'];}return db['MailAccount'][_0xf636('0x5e')]({'where':{'id':_0x1f7d98[_0xf636('0x64')]['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x49e27a,null))[_0xf636('0x23')](function(_0x4de056){if(_0x4de056){_0x1f7d98[_0xf636('0x60')][_0xf636('0x65')]=_0x4de056['id'];return db['CannedAnswer'][_0xf636('0x67')](_0x1f7d98['body']);}})['then'](respondWithResult(_0x49e27a,null))['catch'](handleError(_0x49e27a,null));};exports[_0xf636('0x6c')]=function(_0x188993,_0x5b9f92,_0x2fbf21){var _0x57b1a9={'raw':![],'where':{}};var _0x9b4bd5={};var _0x1c381b={'count':0x0,'rows':[]};return db[_0xf636('0x44')][_0xf636('0x6d')]({'where':{'id':_0x188993[_0xf636('0x64')]['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x5b9f92,null))[_0xf636('0x23')](function(_0x1bd946){if(_0x1bd946){_0x9b4bd5['model']=_[_0xf636('0x49')](db[_0xf636('0x6e')][_0xf636('0x45')]);_0x9b4bd5['query']=_['keys'](_0x188993[_0xf636('0x4a')]);_0x9b4bd5[_0xf636('0x4b')]=_[_0xf636('0x4c')](_0x9b4bd5[_0xf636('0x48')],_0x9b4bd5[_0xf636('0x4a')]);_0x57b1a9[_0xf636('0x4d')]=_[_0xf636('0x4c')](_0x9b4bd5[_0xf636('0x48')],qs[_0xf636('0x5b')](_0x188993[_0xf636('0x4a')]['fields']));_0x57b1a9[_0xf636('0x4d')]=_0x57b1a9[_0xf636('0x4d')]['length']?_0x57b1a9['attributes']:_0x9b4bd5['model'];if(!_0x188993[_0xf636('0x4a')]['hasOwnProperty'](_0xf636('0x69'))){_0x57b1a9[_0xf636('0x35')]=qs[_0xf636('0x35')](_0x188993[_0xf636('0x4a')]['limit']);_0x57b1a9['offset']=qs[_0xf636('0x32')](_0x188993['query'][_0xf636('0x32')]);}_0x57b1a9[_0xf636('0x50')]=qs[_0xf636('0x51')](_0x188993[_0xf636('0x4a')][_0xf636('0x51')]);_0x57b1a9[_0xf636('0x52')]=qs['filters'](_['pick'](_0x188993[_0xf636('0x4a')],_0x9b4bd5[_0xf636('0x4b')]));_0x57b1a9[_0xf636('0x52')][_0xf636('0x65')]=_0x1bd946['id'];if(_0x188993['query'][_0xf636('0x54')]){_0x57b1a9[_0xf636('0x52')]=_[_0xf636('0x55')](_0x57b1a9['where'],{'$or':_[_0xf636('0x43')](_0x57b1a9[_0xf636('0x4d')],function(_0x173f3a){var _0x5a63e6={};_0x5a63e6[_0x173f3a]={'$like':'%'+_0x188993[_0xf636('0x4a')][_0xf636('0x54')]+'%'};return _0x5a63e6;})});}_0x57b1a9=_['merge']({},_0x57b1a9,_0x188993['options']);return db[_0xf636('0x6e')][_0xf636('0x34')]({'where':_0x57b1a9[_0xf636('0x52')]})[_0xf636('0x23')](function(_0x5718fb){_0x1c381b[_0xf636('0x34')]=_0x5718fb;if(_0x188993[_0xf636('0x4a')]['includeAll']){_0x57b1a9[_0xf636('0x58')]=[{'all':!![]}];}return db[_0xf636('0x6e')][_0xf636('0x6f')](_0x57b1a9);})[_0xf636('0x23')](function(_0xd57afb){_0x1c381b[_0xf636('0x70')]=_0xd57afb;return _0x1c381b;});}})[_0xf636('0x23')](respondWithFilteredResult(_0x5b9f92,_0x57b1a9))[_0xf636('0x2e')](handleError(_0x5b9f92,null));};exports['removeAnswers']=function(_0x51cbbb,_0x442b99,_0x3330c3){return db[_0xf636('0x44')][_0xf636('0x5e')]({'where':{'id':_0x51cbbb[_0xf636('0x64')]['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x442b99,null))[_0xf636('0x23')](function(_0x35c91b){if(_0x35c91b){return _0x35c91b[_0xf636('0x71')](_0x51cbbb[_0xf636('0x4a')][_0xf636('0x6b')]);}})['then'](respondWithStatusCode(_0x442b99,null))[_0xf636('0x2e')](handleError(_0x442b99,null));};exports['create']=function(_0x7a8120,_0x32443e){var _0x335732={'name':_0x7a8120[_0xf636('0x60')][_0xf636('0x3d')],'key':_0x7a8120['body']['key'],'email':_0x7a8120[_0xf636('0x60')][_0xf636('0x72')],'ListId':_0x7a8120[_0xf636('0x60')]['ListId'],'active':!_[_0xf636('0x73')](_0x7a8120[_0xf636('0x60')]['active'])?_0x7a8120['body']['active']:!![],'description':_0x7a8120['body'][_0xf636('0x74')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x7a8120[_0xf636('0x60')][_0xf636('0x75')])){if(_0x7a8120[_0xf636('0x60')][_0xf636('0x76')]){_0x335732[_0xf636('0x40')]['user']=_0x335732['Smtp'][_0xf636('0x77')]=_0x7a8120[_0xf636('0x60')][_0xf636('0x78')];_0x335732[_0xf636('0x40')]['password']=_0x335732['Smtp'][_0xf636('0x79')]=_0x7a8120[_0xf636('0x60')]['cpassword'];}else{_0x335732['Imap'][_0xf636('0x7a')]=_0x335732['Smtp']['authentication']=![];}_0x335732['Imap'][_0xf636('0x7b')]=_0x7a8120[_0xf636('0x60')]['Imap'][_0xf636('0x7b')];_0x335732[_0xf636('0x40')][_0xf636('0x7c')]=_0x7a8120[_0xf636('0x60')][_0xf636('0x40')][_0xf636('0x7c')];_0x335732['Smtp']['host']=_0x7a8120[_0xf636('0x60')][_0xf636('0x41')][_0xf636('0x7b')];_0x335732[_0xf636('0x41')][_0xf636('0x7c')]=_0x7a8120['body'][_0xf636('0x41')]['port'];}else{_0x335732[_0xf636('0x40')][_0xf636('0x7d')]=_0x335732[_0xf636('0x41')]['service']=_0x7a8120['body'][_0xf636('0x75')];_0x335732['Imap'][_0xf636('0x77')]=_0x335732['Smtp'][_0xf636('0x77')]=_0x7a8120[_0xf636('0x60')][_0xf636('0x78')];_0x335732['Imap'][_0xf636('0x7e')]=_0x335732[_0xf636('0x41')][_0xf636('0x79')]=_0x7a8120[_0xf636('0x60')][_0xf636('0x7f')];}return db[_0xf636('0x44')][_0xf636('0x67')](_0x335732,{'include':[{'model':db[_0xf636('0x61')],'as':_0xf636('0x41')},{'model':db[_0xf636('0x3f')],'as':_0xf636('0x40')}]})[_0xf636('0x23')](function(_0x55e67c){var _0x41bd53=_0x7a8120[_0xf636('0x77')][_0xf636('0x80')]({'plain':!![]});if(!_0x41bd53)throw new Error(_0xf636('0x81'));if(_0x41bd53['role']===_0xf636('0x77')){var _0x346a3c=_0x55e67c['get']({'plain':!![]});return db[_0xf636('0x82')][_0xf636('0x5e')]({'where':{'name':'MailAccounts','userProfileId':_0x41bd53[_0xf636('0x83')]},'raw':!![]})[_0xf636('0x23')](function(_0x5f77cb){if(_0x5f77cb&&_0x5f77cb[_0xf636('0x84')]===0x0){return db[_0xf636('0x85')][_0xf636('0x67')]({'name':_0x346a3c[_0xf636('0x3d')],'resourceId':_0x346a3c['id'],'type':_0x5f77cb[_0xf636('0x3d')],'sectionId':_0x5f77cb['id']},{})[_0xf636('0x23')](function(){return _0x55e67c;});}else{return _0x55e67c;}})[_0xf636('0x2e')](function(_0x3e0173){logger[_0xf636('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e0173);throw _0x3e0173;});}return _0x55e67c;})[_0xf636('0x23')](respondWithResult(_0x32443e,0xc9))[_0xf636('0x2e')](handleError(_0x32443e,null));};exports[_0xf636('0x86')]=function(_0x3569d7,_0x1280c1,_0x22de19){return db[_0xf636('0x44')][_0xf636('0x6d')]({'where':{'id':_0x3569d7[_0xf636('0x64')]['id']}})['then'](handleEntityNotFound(_0x1280c1,null))[_0xf636('0x23')](function(_0x4f8e4d){if(_0x4f8e4d){return _0x4f8e4d[_0xf636('0x86')]();}return null;})[_0xf636('0x23')](respondWithResult(_0x1280c1,null))[_0xf636('0x2e')](handleError(_0x1280c1,null));};exports[_0xf636('0x87')]=function(_0x53436c,_0x19c423,_0x542258){if(_0x53436c[_0xf636('0x60')]['id']){delete _0x53436c[_0xf636('0x60')]['id'];}return db['MailAccount'][_0xf636('0x5e')]({'where':{'id':_0x53436c['params']['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x19c423,null))[_0xf636('0x23')](function(_0x3d4d14){if(_0x3d4d14){_0x53436c[_0xf636('0x60')][_0xf636('0x65')]=_0x3d4d14['id'];return db[_0xf636('0x3f')][_0xf636('0x67')](_0x53436c[_0xf636('0x60')]);}})[_0xf636('0x23')](respondWithResult(_0x19c423,null))['catch'](handleError(_0x19c423,null));};exports[_0xf636('0x88')]=function(_0x1dd2a8,_0x5a7f52,_0x580d82){return db[_0xf636('0x44')][_0xf636('0x6d')]({'where':{'id':_0x1dd2a8[_0xf636('0x64')]['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x5a7f52,null))[_0xf636('0x23')](function(_0x47a865){if(_0x47a865){return _0x47a865['setImap'](null);}return null;})[_0xf636('0x23')](respondWithStatusCode(_0x5a7f52,null))[_0xf636('0x2e')](handleError(_0x5a7f52,null));};exports[_0xf636('0x89')]=function(_0x3dc890,_0xf65fd7,_0x658425){return db[_0xf636('0x44')][_0xf636('0x6d')]({'where':{'id':_0x3dc890[_0xf636('0x64')]['id']}})['then'](handleEntityNotFound(_0xf65fd7,null))[_0xf636('0x23')](function(_0x208790){if(_0x208790){return _0x208790[_0xf636('0x89')]();}return null;})['then'](respondWithResult(_0xf65fd7,null))[_0xf636('0x2e')](handleError(_0xf65fd7,null));};exports[_0xf636('0x8a')]=function(_0x336fb6,_0x386b1b,_0xb00fb9){if(_0x336fb6[_0xf636('0x60')]['id']){delete _0x336fb6[_0xf636('0x60')]['id'];}return db[_0xf636('0x44')][_0xf636('0x5e')]({'where':{'id':_0x336fb6[_0xf636('0x64')]['id']}})['then'](handleEntityNotFound(_0x386b1b,null))[_0xf636('0x23')](function(_0x179629){if(_0x179629){_0x336fb6[_0xf636('0x60')][_0xf636('0x65')]=_0x179629['id'];return db[_0xf636('0x61')][_0xf636('0x67')](_0x336fb6[_0xf636('0x60')]);}})[_0xf636('0x23')](respondWithResult(_0x386b1b,null))[_0xf636('0x2e')](handleError(_0x386b1b,null));};exports[_0xf636('0x8b')]=function(_0x319963,_0x12faec,_0x2a9647){return db[_0xf636('0x44')][_0xf636('0x6d')]({'where':{'id':_0x319963['params']['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x12faec,null))['then'](function(_0xd2db97){if(_0xd2db97){return _0xd2db97['setSmtp'](null);}return null;})[_0xf636('0x23')](respondWithStatusCode(_0x12faec,null))[_0xf636('0x2e')](handleError(_0x12faec,null));};exports['addInteraction']=function(_0x387eb9,_0x273ec4,_0x544c33){return db['MailInteraction'][_0xf636('0x5e')]({'where':{'id':_0x387eb9['params']['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x273ec4,null))['then'](function(_0x20aa2b){if(_0x20aa2b){return _0x20aa2b[_0xf636('0x8c')](_0x387eb9[_0xf636('0x60')]['ids'],_[_0xf636('0x8d')](_0x387eb9['body'],[_0xf636('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x273ec4,null))['catch'](handleError(_0x273ec4,null));};exports[_0xf636('0x8e')]=function(_0xf91879,_0x3e8929,_0xa44b49){var _0x23bd37={'raw':![],'where':{}};var _0x2052b7={};var _0x4acc90={'count':0x0,'rows':[]};return db[_0xf636('0x44')]['findOne']({'where':{'id':_0xf91879['params']['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x3e8929,null))[_0xf636('0x23')](function(_0x97f5b8){if(_0x97f5b8){_0x2052b7['model']=_[_0xf636('0x49')](db[_0xf636('0x8f')][_0xf636('0x45')]);_0x2052b7['query']=_['keys'](_0xf91879[_0xf636('0x4a')]);_0x2052b7[_0xf636('0x4b')]=_['intersection'](_0x2052b7['model'],_0x2052b7['query']);_0x23bd37['attributes']=_[_0xf636('0x4c')](_0x2052b7[_0xf636('0x48')],qs[_0xf636('0x5b')](_0xf91879['query']['fields']));_0x23bd37[_0xf636('0x4d')]=_0x23bd37[_0xf636('0x4d')][_0xf636('0x4e')]?_0x23bd37[_0xf636('0x4d')]:_0x2052b7[_0xf636('0x48')];if(!_0xf91879['query'][_0xf636('0x4f')](_0xf636('0x69'))){_0x23bd37[_0xf636('0x35')]=qs[_0xf636('0x35')](_0xf91879[_0xf636('0x4a')][_0xf636('0x35')]);_0x23bd37[_0xf636('0x32')]=qs[_0xf636('0x32')](_0xf91879['query'][_0xf636('0x32')]);}_0x23bd37[_0xf636('0x50')]=qs['sort'](_0xf91879[_0xf636('0x4a')][_0xf636('0x51')]);_0x23bd37[_0xf636('0x52')]=qs[_0xf636('0x4b')](_[_0xf636('0x53')](_0xf91879[_0xf636('0x4a')],_0x2052b7[_0xf636('0x4b')]));_0x23bd37['where'][_0xf636('0x65')]=_0x97f5b8['id'];if(_0xf91879[_0xf636('0x4a')][_0xf636('0x54')]){_0x23bd37[_0xf636('0x52')]=_[_0xf636('0x55')](_0x23bd37['where'],{'$or':_[_0xf636('0x43')](_0x23bd37[_0xf636('0x4d')],function(_0x571a6f){var _0xd1dec1={};_0xd1dec1[_0x571a6f]={'$like':'%'+_0xf91879[_0xf636('0x4a')][_0xf636('0x54')]+'%'};return _0xd1dec1;})});}_0x23bd37=_[_0xf636('0x55')]({},_0x23bd37,_0xf91879[_0xf636('0x5d')]);return db[_0xf636('0x8f')][_0xf636('0x34')]({'where':_0x23bd37[_0xf636('0x52')]})['then'](function(_0x3d5115){_0x4acc90[_0xf636('0x34')]=_0x3d5115;if(_0xf91879[_0xf636('0x4a')][_0xf636('0x5c')]){_0x23bd37[_0xf636('0x58')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xf636('0x90')],'as':_0xf636('0x91'),'attributes':[_0xf636('0x3d'),_0xf636('0x92'),'internal'],'required':![]},{'model':db[_0xf636('0x93')],'as':_0xf636('0x94'),'attributes':['id','name','color'],'where':_0xf91879[_0xf636('0x4a')][_0xf636('0x95')]?{'id':_0xf91879[_0xf636('0x4a')][_0xf636('0x95')]}:undefined,'required':_0xf91879[_0xf636('0x4a')][_0xf636('0x95')]?!![]:![]}];}return db['MailInteraction'][_0xf636('0x6f')](_0x23bd37);})[_0xf636('0x23')](function(_0x248df5){_0x4acc90[_0xf636('0x70')]=_0x248df5;return _0x4acc90;});}})[_0xf636('0x23')](respondWithFilteredResult(_0x3e8929,_0x23bd37))[_0xf636('0x2e')](handleError(_0x3e8929,null));};exports[_0xf636('0x96')]=function(_0x2a568c,_0x3cddb1,_0x13767f){return db[_0xf636('0x44')][_0xf636('0x6d')]({'where':{'id':_0x2a568c[_0xf636('0x64')]['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x3cddb1,null))[_0xf636('0x23')](function(_0x18d502){if(_0x18d502){return db['sequelize'][_0xf636('0x97')](function(_0x24134a){return db[_0xf636('0x98')]['destroy']({'where':{'MailAccountId':_0x2a568c[_0xf636('0x64')]['id']},'transaction':_0x24134a})[_0xf636('0x23')](function(_0x429041){var _0x5084f2=_[_0xf636('0x43')](_0x2a568c[_0xf636('0x60')],function(_0x3da25b){_0x3da25b[_0xf636('0x65')]=_0x2a568c[_0xf636('0x64')]['id'];return _0x3da25b;});return db[_0xf636('0x98')]['bulkCreate'](_0x5084f2,{'transaction':_0x24134a});});})[_0xf636('0x23')](function(){return db['MailApplication'][_0xf636('0x99')]({'where':{'MailAccountId':_0x2a568c['params']['id']},'order':_0xf636('0x9a')});});}})[_0xf636('0x23')](respondWithResult(_0x3cddb1,null))[_0xf636('0x2e')](handleError(_0x3cddb1,null));};exports[_0xf636('0x9b')]=function(_0x18d5c1,_0x23f87c,_0x2f8d43){var _0x519b5e={};var _0x3c2f7b={};var _0x4c327c;var _0x7ab7b2;return db[_0xf636('0x44')][_0xf636('0x6d')]({'where':{'id':_0x18d5c1[_0xf636('0x64')]['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x23f87c,null))[_0xf636('0x23')](function(_0x5aa2b6){if(_0x5aa2b6){_0x4c327c=_0x5aa2b6;_0x3c2f7b[_0xf636('0x48')]=_[_0xf636('0x49')](db['MailApplication'][_0xf636('0x45')]);_0x3c2f7b[_0xf636('0x4a')]=_[_0xf636('0x49')](_0x18d5c1['query']);_0x3c2f7b[_0xf636('0x4b')]=_['intersection'](_0x3c2f7b['model'],_0x3c2f7b[_0xf636('0x4a')]);_0x519b5e['attributes']=_[_0xf636('0x4c')](_0x3c2f7b[_0xf636('0x48')],qs['fields'](_0x18d5c1['query'][_0xf636('0x5b')]));_0x519b5e['attributes']=_0x519b5e[_0xf636('0x4d')][_0xf636('0x4e')]?_0x519b5e['attributes']:_0x3c2f7b[_0xf636('0x48')];_0x519b5e[_0xf636('0x50')]=qs['sort'](_0x18d5c1[_0xf636('0x4a')][_0xf636('0x51')]);_0x519b5e[_0xf636('0x52')]=qs[_0xf636('0x4b')](_[_0xf636('0x53')](_0x18d5c1[_0xf636('0x4a')],_0x3c2f7b['filters']));if(_0x18d5c1[_0xf636('0x4a')][_0xf636('0x54')]){_0x519b5e[_0xf636('0x52')]=_[_0xf636('0x55')](_0x519b5e['where'],{'$or':_['map'](_0x519b5e[_0xf636('0x4d')],function(_0x565e97){var _0x150c4c={};_0x150c4c[_0x565e97]={'$like':'%'+_0x18d5c1[_0xf636('0x4a')]['filter']+'%'};return _0x150c4c;})});}_0x519b5e=_['merge']({},_0x519b5e,_0x18d5c1[_0xf636('0x5d')]);return _0x4c327c[_0xf636('0x9b')](_0x519b5e);}})[_0xf636('0x23')](function(_0x7da96){if(_0x7da96){_0x7ab7b2=_0x7da96[_0xf636('0x4e')];if(!_0x18d5c1[_0xf636('0x4a')][_0xf636('0x4f')]('nolimit')){_0x519b5e['limit']=qs[_0xf636('0x35')](_0x18d5c1[_0xf636('0x4a')][_0xf636('0x35')]);_0x519b5e['offset']=qs[_0xf636('0x32')](_0x18d5c1['query']['offset']);}return _0x4c327c[_0xf636('0x9b')](_0x519b5e);}})[_0xf636('0x23')](function(_0x8cb841){if(_0x8cb841){return _0x8cb841?{'count':_0x7ab7b2,'rows':_0x8cb841}:null;}})[_0xf636('0x23')](respondWithResult(_0x23f87c,null))[_0xf636('0x2e')](handleError(_0x23f87c,null));};exports['getMessages']=function(_0x325bd3,_0x10d5ac,_0x525c7f){var _0x2a56eb={'raw':!![],'where':{}};var _0x1a5427={};var _0x19b05c={'count':0x0,'rows':[]};return db[_0xf636('0x44')][_0xf636('0x6d')]({'where':{'id':_0x325bd3[_0xf636('0x64')]['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x10d5ac,null))['then'](function(_0x18cd11){if(_0x18cd11){_0x1a5427[_0xf636('0x48')]=_['keys'](db[_0xf636('0x9c')][_0xf636('0x45')]);_0x1a5427['query']=_[_0xf636('0x49')](_0x325bd3[_0xf636('0x4a')]);_0x1a5427['filters']=_[_0xf636('0x4c')](_0x1a5427[_0xf636('0x48')],_0x1a5427[_0xf636('0x4a')]);_0x2a56eb[_0xf636('0x4d')]=_[_0xf636('0x4c')](_0x1a5427['model'],qs[_0xf636('0x5b')](_0x325bd3[_0xf636('0x4a')][_0xf636('0x5b')]));_0x2a56eb[_0xf636('0x4d')]=_0x2a56eb[_0xf636('0x4d')][_0xf636('0x4e')]?_0x2a56eb['attributes']:_0x1a5427['model'];if(!_0x325bd3[_0xf636('0x4a')]['hasOwnProperty'](_0xf636('0x69'))){_0x2a56eb[_0xf636('0x35')]=qs[_0xf636('0x35')](_0x325bd3[_0xf636('0x4a')]['limit']);_0x2a56eb['offset']=qs['offset'](_0x325bd3['query'][_0xf636('0x32')]);}_0x2a56eb['order']=qs[_0xf636('0x51')](_0x325bd3[_0xf636('0x4a')][_0xf636('0x51')]);_0x2a56eb[_0xf636('0x52')]=qs[_0xf636('0x4b')](_[_0xf636('0x53')](_0x325bd3[_0xf636('0x4a')],_0x1a5427[_0xf636('0x4b')]));_0x2a56eb[_0xf636('0x52')][_0xf636('0x65')]=_0x18cd11['id'];if(_0x325bd3[_0xf636('0x4a')][_0xf636('0x54')]){_0x2a56eb[_0xf636('0x52')]=_['merge'](_0x2a56eb[_0xf636('0x52')],{'$or':_[_0xf636('0x43')](_0x2a56eb[_0xf636('0x4d')],function(_0x349195){var _0x2149c6={};_0x2149c6[_0x349195]={'$like':'%'+_0x325bd3['query'][_0xf636('0x54')]+'%'};return _0x2149c6;})});}if(_0x325bd3['query'][_0xf636('0x9d')]){var _0x2c6347=_0x325bd3[_0xf636('0x4a')]['$gte'][_0xf636('0x9e')](',');var _0x5a41ac={};_0x5a41ac[_0x2c6347[0x0]]={'$gte':moment(_0x2c6347[0x1])[_0xf636('0x9f')](_0xf636('0xa0'))};_0x2a56eb['where']=_['merge'](_0x2a56eb[_0xf636('0x52')],_0x5a41ac);}_0x2a56eb=_[_0xf636('0x55')]({},_0x2a56eb,_0x325bd3[_0xf636('0x5d')]);return db[_0xf636('0x9c')]['count']({'where':_0x2a56eb['where']})['then'](function(_0x47eafa){_0x19b05c[_0xf636('0x34')]=_0x47eafa;if(_0x325bd3[_0xf636('0x4a')]['includeAll']){_0x2a56eb['include']=[{'all':!![]}];}return db[_0xf636('0x9c')]['findAll'](_0x2a56eb);})[_0xf636('0x23')](function(_0x50e047){if(_0x325bd3[_0xf636('0x4a')]['inlineCss']==='true'){for(var _0x5bbea0=0x0;_0x5bbea0<_0x50e047[_0xf636('0x4e')];_0x5bbea0++){_0x50e047[_0x5bbea0][_0xf636('0x60')]=juice(_0x50e047[_0x5bbea0]['body']);}}_0x19b05c[_0xf636('0x70')]=_0x50e047;return _0x19b05c;});}})[_0xf636('0x23')](respondWithFilteredResult(_0x10d5ac,_0x2a56eb))[_0xf636('0x2e')](handleError(_0x10d5ac,null));};exports[_0xf636('0xa1')]=function(_0xd471fc,_0x3c41a7,_0x2b3e3f){var _0x2ddc67,_0x22b23f={},_0x5258be;if(_0xd471fc[_0xf636('0x60')]['to']){_0x5258be=_0xd471fc['body']['to']['split'](',')[0x0];}return db[_0xf636('0x44')][_0xf636('0x5e')]({'where':{'id':_0xd471fc[_0xf636('0x64')]['id']},'include':[{'model':db[_0xf636('0xa2')],'as':_0xf636('0xa3'),'include':[{'model':db[_0xf636('0xa4')],'as':'Contacts','where':{'email':_0x5258be},'limit':0x1,'order':[['updatedAt',_0xf636('0xa5')]]}]},{'model':db[_0xf636('0x61')],'as':'Smtp','raw':!![]}]})[_0xf636('0x23')](handleEntityNotFound(_0x3c41a7,null))[_0xf636('0x23')](function(_0x25f5d1){if(_0x25f5d1){_0x2ddc67=_0x25f5d1;if(_0x25f5d1[_0xf636('0x41')]){if(_['isNil'](_0xd471fc[_0xf636('0x60')][_0xf636('0xa6')])){_0xd471fc['body']['from']=util['format'](_0xf636('0xa7'),_0x25f5d1[_0xf636('0x3d')],_0x25f5d1[_0xf636('0x72')]||_0x25f5d1[_0xf636('0x41')][_0xf636('0x77')]);}if(_0xd471fc['body'][_0xf636('0xa8')]&&_0xd471fc[_0xf636('0x60')][_0xf636('0xa8')][_0xf636('0x4e')]){for(var _0x2593c6=0x0;_0x2593c6<_0xd471fc[_0xf636('0x60')][_0xf636('0xa8')]['length'];_0x2593c6+=0x1){_0xd471fc['body'][_0xf636('0xa8')][_0x2593c6]={'filename':_0xd471fc[_0xf636('0x60')][_0xf636('0xa8')][_0x2593c6][_0xf636('0x3d')],'path':path[_0xf636('0xa9')](config[_0xf636('0xaa')],_0xf636('0xab'),_0xd471fc['body'][_0xf636('0xa8')][_0x2593c6][_0xf636('0xac')])};}}var _0x5088ff={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x25f5d1[_0xf636('0x41')][_0xf636('0x7d')])){if(_0x25f5d1['Smtp'][_0xf636('0x7a')]){_0x5088ff[_0xf636('0xad')]={'user':_0x25f5d1['Smtp'][_0xf636('0x77')],'pass':_0x25f5d1[_0xf636('0x41')][_0xf636('0x79')]};}_0x5088ff[_0xf636('0x7b')]=_0x25f5d1[_0xf636('0x41')][_0xf636('0x7b')];_0x5088ff[_0xf636('0x7c')]=_0x25f5d1[_0xf636('0x41')][_0xf636('0x7c')];_0x5088ff[_0xf636('0xae')]=_0x25f5d1[_0xf636('0x41')][_0xf636('0xae')];}else{_0x5088ff['service']=_0x25f5d1[_0xf636('0x41')]['service'];_0x5088ff[_0xf636('0xad')]={'user':_0x25f5d1[_0xf636('0x41')][_0xf636('0x77')],'pass':_0x25f5d1[_0xf636('0x41')][_0xf636('0x79')]};}return respondWithRpcPromise(_0xf636('0xaf'),_0xf636('0xb0'),{'account':_0x5088ff,'message':_0xd471fc['body']});}else{throw new Error(_0xf636('0xb1'));}}})[_0xf636('0x23')](function(_0x3857fa){if(_0x3857fa){_0x22b23f=_0x3857fa;if(_0x2ddc67[_0xf636('0xa3')]){if(_0x2ddc67[_0xf636('0xa3')]['Contacts'][_0xf636('0x4e')]){return _0x2ddc67[_0xf636('0xa3')][_0xf636('0xb2')][0x0];}else{return db[_0xf636('0xa4')]['create'](_[_0xf636('0x1d')](_0xd471fc[_0xf636('0x60')],{'firstName':_0xd471fc[_0xf636('0x60')]['to'],'email':_0xd471fc['body']['to'],'phone':_0xd471fc['body']['to'],'ListId':_0x2ddc67[_0xf636('0xb3')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xf636('0x23')](function(_0x590fb6){if(_0x590fb6){var _0x3640cd={'UserId':_0xd471fc[_0xf636('0x77')]['id'],'ContactId':_0x590fb6['id'],'MailAccountId':_0x2ddc67['id'],'inReplyTo':_0x22b23f[_0xf636('0xb4')],'to':_0xd471fc['body'][_0xf636('0xa6')],'cc':_0xd471fc[_0xf636('0x60')]['cc'],'subject':_0xd471fc[_0xf636('0x60')]['subject'],'attach':_0xd471fc[_0xf636('0x60')][_0xf636('0xb5')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xf636('0x9f')](_0xf636('0xa0')),'lastMsgDirection':_0xf636('0xb6'),'Messages':[_['merge'](_0xd471fc[_0xf636('0x60')],{'messageId':_0x22b23f['messageId'],'sentAt':moment()[_0xf636('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2ddc67['id'],'UserId':_0xd471fc[_0xf636('0x77')]['id'],'ContactId':_0x590fb6['id']})]};if(_0xd471fc[_0xf636('0x60')][_0xf636('0xb7')]){_0x3640cd=_[_0xf636('0x55')](_0x3640cd,_0xd471fc[_0xf636('0x60')][_0xf636('0xb7')]);}return db['MailInteraction'][_0xf636('0x67')](_0x3640cd,{'include':[{'model':db[_0xf636('0x9c')],'as':_0xf636('0xb8')}]});}})['then'](respondWithResult(_0x3c41a7,null))['catch'](handleError(_0x3c41a7,null));};exports[_0xf636('0xb9')]=function(_0x3106cf,_0x92a5b,_0x514cb8){return db[_0xf636('0x44')][_0xf636('0x5e')]({'where':{'id':_0x3106cf['params']['id']},'include':[{'model':db['MailServerOut'],'as':_0xf636('0x41'),'raw':!![]}]})['then'](handleEntityNotFound(_0x92a5b,null))[_0xf636('0x23')](function(_0x390ea1){if(_0x390ea1&&_0x390ea1[_0xf636('0x41')]){var _0x58db50={'id':_0x390ea1['id'],'tls':{'rejectUnauthorized':![]}};if(_0x390ea1[_0xf636('0x41')]['service']){_0x58db50[_0xf636('0x7d')]=_0x390ea1[_0xf636('0x41')][_0xf636('0x7d')];}else{_0x58db50[_0xf636('0x7b')]=_0x390ea1['Smtp'][_0xf636('0x7b')];_0x58db50[_0xf636('0x7c')]=_0x390ea1[_0xf636('0x41')][_0xf636('0x7c')];_0x58db50[_0xf636('0xae')]=_0x390ea1[_0xf636('0x41')][_0xf636('0xae')];}if(_0x390ea1[_0xf636('0x41')][_0xf636('0x7a')]){_0x58db50[_0xf636('0xad')]={'user':_0x390ea1[_0xf636('0x41')][_0xf636('0x77')],'pass':_0x390ea1[_0xf636('0x41')][_0xf636('0x79')]};}return respondWithRpcPromise(_0xf636('0xba'),_0xf636('0xb9'),{'account':_0x58db50});}})[_0xf636('0x23')](respondWithResult(_0x92a5b,null))['catch'](handleError(_0x92a5b,null));};exports['destroy']=function(_0xd104c8,_0x32e15f){return db[_0xf636('0x44')][_0xf636('0x5e')]({'where':{'id':_0xd104c8['params']['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x32e15f,null))['then'](function(_0x5fc4ca){if(_0x5fc4ca&&_0x5fc4ca[_0xf636('0x7d')]){throw new db[(_0xf636('0xbb'))][(_0xf636('0xbc'))](_0xf636('0xbd'));}return _0x5fc4ca;})[_0xf636('0x23')](removeEntity(_0x32e15f,null))[_0xf636('0x2e')](handleError(_0x32e15f,null));};exports[_0xf636('0xbe')]=function(_0x43a887,_0x3ec2d3,_0x4c9820){return db[_0xf636('0x44')][_0xf636('0x5e')]({'where':{'id':_0x43a887[_0xf636('0x64')]['id']}})['then'](handleEntityNotFound(_0x3ec2d3,null))[_0xf636('0x23')](function(_0x37f3c8){if(_0x37f3c8){return _0x37f3c8[_0xf636('0xbe')](_0x43a887[_0xf636('0x60')]['ids'],_[_0xf636('0x8d')](_0x43a887['body'],[_0xf636('0x6b'),'id'])||{})[_0xf636('0xbf')](function(_0x3de92a){for(var _0x5dfb61=0x0;_0x5dfb61<_0x43a887[_0xf636('0x60')][_0xf636('0x6b')]['length'];_0x5dfb61+=0x1){socket['emit'](_0xf636('0xc0'),{'UserId':Number(_0x43a887[_0xf636('0x60')][_0xf636('0x6b')][_0x5dfb61]),'MailAccountId':Number(_0x43a887[_0xf636('0x64')]['id'])});}return _0x3de92a;});}})[_0xf636('0x23')](respondWithResult(_0x3ec2d3,null))[_0xf636('0x2e')](handleError(_0x3ec2d3,null));};exports[_0xf636('0xc1')]=function(_0x3f0ffc,_0x4f8109,_0x95ba7f){return db[_0xf636('0x44')][_0xf636('0x5e')]({'where':{'id':_0x3f0ffc[_0xf636('0x64')]['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x4f8109,null))[_0xf636('0x23')](function(_0x6c3c93){if(_0x6c3c93){return _0x6c3c93[_0xf636('0xc1')](_0x3f0ffc[_0xf636('0x4a')][_0xf636('0x6b')])['then'](function(){if(_['isArray'](_0x3f0ffc[_0xf636('0x4a')][_0xf636('0x6b')])){for(var _0x5806b9=0x0;_0x5806b9<_0x3f0ffc[_0xf636('0x4a')][_0xf636('0x6b')][_0xf636('0x4e')];_0x5806b9+=0x1){socket[_0xf636('0xc2')](_0xf636('0xc3'),{'UserId':Number(_0x3f0ffc['query']['ids'][_0x5806b9]),'MailAccountId':Number(_0x3f0ffc['params']['id'])});}}else{socket['emit'](_0xf636('0xc3'),{'UserId':Number(_0x3f0ffc[_0xf636('0x4a')][_0xf636('0x6b')]),'MailAccountId':Number(_0x3f0ffc[_0xf636('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f8109,null))[_0xf636('0x2e')](handleError(_0x4f8109,null));};exports[_0xf636('0xc4')]=function(_0x22f19a,_0x26bd85,_0x40a389){var _0x112f35={};var _0x5584c2={};var _0x5d4ab0;var _0x56c605;return db['MailAccount'][_0xf636('0x6d')]({'where':{'id':_0x22f19a['params']['id']}})[_0xf636('0x23')](handleEntityNotFound(_0x26bd85,null))[_0xf636('0x23')](function(_0x368eb3){if(_0x368eb3){_0x5d4ab0=_0x368eb3;_0x5584c2[_0xf636('0x48')]=_[_0xf636('0x49')](db[_0xf636('0x90')][_0xf636('0x45')]);_0x5584c2['query']=_[_0xf636('0x49')](_0x22f19a[_0xf636('0x4a')]);_0x5584c2['filters']=_['intersection'](_0x5584c2['model'],_0x5584c2['query']);_0x112f35[_0xf636('0x4d')]=_['intersection'](_0x5584c2['model'],qs['fields'](_0x22f19a[_0xf636('0x4a')][_0xf636('0x5b')]));_0x112f35[_0xf636('0x4d')]=_0x112f35[_0xf636('0x4d')]['length']?_0x112f35[_0xf636('0x4d')]:_0x5584c2[_0xf636('0x48')];_0x112f35['order']=qs[_0xf636('0x51')](_0x22f19a[_0xf636('0x4a')][_0xf636('0x51')]);_0x112f35[_0xf636('0x52')]=qs[_0xf636('0x4b')](_['pick'](_0x22f19a['query'],_0x5584c2['filters']));if(_0x22f19a[_0xf636('0x4a')]['filter']){_0x112f35[_0xf636('0x52')]=_[_0xf636('0x55')](_0x112f35[_0xf636('0x52')],{'$or':_['map'](_0x112f35[_0xf636('0x4d')],function(_0x3cdace){var _0x156630={};_0x156630[_0x3cdace]={'$like':'%'+_0x22f19a[_0xf636('0x4a')][_0xf636('0x54')]+'%'};return _0x156630;})});}_0x112f35=_['merge']({},_0x112f35,_0x22f19a[_0xf636('0x5d')]);return _0x5d4ab0[_0xf636('0xc4')](_0x112f35);}})['then'](function(_0x584447){if(_0x584447){_0x56c605=_0x584447[_0xf636('0x4e')];if(!_0x22f19a[_0xf636('0x4a')][_0xf636('0x4f')](_0xf636('0x69'))){_0x112f35['limit']=qs[_0xf636('0x35')](_0x22f19a[_0xf636('0x4a')]['limit']);_0x112f35[_0xf636('0x32')]=qs['offset'](_0x22f19a[_0xf636('0x4a')][_0xf636('0x32')]);}return _0x5d4ab0['getAgents'](_0x112f35);}})[_0xf636('0x23')](function(_0x13eaad){if(_0x13eaad){return _0x13eaad?{'count':_0x56c605,'rows':_0x13eaad}:null;}})[_0xf636('0x23')](respondWithResult(_0x26bd85,null))[_0xf636('0x2e')](handleError(_0x26bd85,null));}; \ No newline at end of file +var _0x1bfa=['client','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','undefined','count','offset','set','Content-Range','apply','save','then','get','MailAccounts','destroy','send','index','MailServerIn','Imap','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','where','filter','merge','options','includeAll','include','rows','params','MailServerOut','keys','rawAttributes','find','update','body','describe','addDisposition','MailAccountId','getDispositions','Disposition','findAll','removeDispositions','ids','addAnswer','CannedAnswer','create','findOne','removeAnswers','email','isNil','active','description','cservice','user','cuser','password','cpassword','authentication','host','port','service','UserProfileSection','autoAssociation','UserProfileResource','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','Owner','internal','Tags','tag','sequelize','transaction','bulkCreate','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','updatedAt','DESC','from','attachments','join','root','server/files/attachments','pass','secure','auth','SendMail','Contacts','ListId','messageId','subject','attach','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x34be3e,_0x3263cb){var _0x1b8c56=function(_0x307e1f){while(--_0x307e1f){_0x34be3e['push'](_0x34be3e['shift']());}};_0x1b8c56(++_0x3263cb);}(_0x1bfa,0x9f));var _0xa1bf=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x1bfa[_0x4099ee];return _0x1b7bfc;};'use strict';var emlformat=require(_0xa1bf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa1bf('0x1'));var moment=require(_0xa1bf('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa1bf('0x3'));var util=require(_0xa1bf('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xa1bf('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1bf('0x6'));var _=require(_0xa1bf('0x7'));var squel=require(_0xa1bf('0x8'));var crypto=require('crypto');var jsforce=require(_0xa1bf('0x9'));var deskjs=require(_0xa1bf('0xa'));var toCsv=require(_0xa1bf('0x5'));var querystring=require(_0xa1bf('0xb'));var Papa=require(_0xa1bf('0xc'));var htmlToText=require('html-to-text');var juice=require(_0xa1bf('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa1bf('0xe'));var as=require(_0xa1bf('0xf'));var hardwareService=require(_0xa1bf('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xa1bf('0x11'));var config=require(_0xa1bf('0x12'));var licenseUtil=require(_0xa1bf('0x13'));var db=require(_0xa1bf('0x14'))['db'];config[_0xa1bf('0x15')]=_[_0xa1bf('0x16')](config[_0xa1bf('0x15')],{'host':_0xa1bf('0x17'),'port':0x18eb});var socket=require(_0xa1bf('0x18'))(new Redis(config[_0xa1bf('0x15')]));require('./mailAccount.socket')[_0xa1bf('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa1bf('0x1a')]['http']({'port':0x232b});function respondWithRpcPromise(_0x5d0d17,_0x8ed9e6,_0x2a6a7e,_0x776bfe){return new BPromise(function(_0x46f7ed,_0x3cdef3){var _0x3e9963=_0x776bfe||client;return _0x3e9963[_0xa1bf('0x1b')](_0x5d0d17,_0x2a6a7e)['then'](function(_0x125bcd){logger[_0xa1bf('0x1c')](_0xa1bf('0x1d'),_0x8ed9e6,_0xa1bf('0x1e'));logger[_0xa1bf('0x1f')](_0xa1bf('0x20'),_0x8ed9e6,_0xa1bf('0x1e'),JSON[_0xa1bf('0x21')](_0x125bcd));if(_0x125bcd['error']){if(_0x125bcd[_0xa1bf('0x22')][_0xa1bf('0x23')]===0x1f4){logger[_0xa1bf('0x22')](_0xa1bf('0x1d'),_0x8ed9e6,_0x125bcd[_0xa1bf('0x22')][_0xa1bf('0x24')]);return _0x3cdef3(_0x125bcd[_0xa1bf('0x22')][_0xa1bf('0x24')]);}logger[_0xa1bf('0x22')](_0xa1bf('0x1d'),_0x8ed9e6,_0x125bcd[_0xa1bf('0x22')][_0xa1bf('0x24')]);return _0x46f7ed(_0x125bcd['error'][_0xa1bf('0x24')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x8ed9e6,_0xa1bf('0x1e'));_0x46f7ed(_0x125bcd[_0xa1bf('0x25')][_0xa1bf('0x24')]);}})[_0xa1bf('0x26')](function(_0x3e5926){logger[_0xa1bf('0x22')](_0xa1bf('0x1d'),_0x8ed9e6,_0x3e5926);_0x3cdef3(_0x3e5926);});});}function respondWithStatusCode(_0x1ef775,_0x2f612a){_0x2f612a=_0x2f612a||0xcc;return function(_0x504e6e){if(_0x504e6e){return _0x1ef775['sendStatus'](_0x2f612a);}return _0x1ef775['status'](_0x2f612a)[_0xa1bf('0x27')]();};}function respondWithResult(_0x5bd770,_0x817512){_0x817512=_0x817512||0xc8;return function(_0x2b4111){if(_0x2b4111){return _0x5bd770[_0xa1bf('0x28')](_0x817512)[_0xa1bf('0x29')](_0x2b4111);}};}function respondWithFilteredResult(_0x206aa0,_0x9dcbdb){return function(_0x672fb3){if(_0x672fb3){var _0x5f33a4=typeof _0x9dcbdb['offset']===_0xa1bf('0x2a')&&typeof _0x9dcbdb['limit']===_0xa1bf('0x2a');var _0x32c8d4=_0x672fb3[_0xa1bf('0x2b')];var _0x6363bb=_0x5f33a4?0x0:_0x9dcbdb[_0xa1bf('0x2c')];var _0x1764da=_0x5f33a4?_0x672fb3[_0xa1bf('0x2b')]:_0x9dcbdb[_0xa1bf('0x2c')]+_0x9dcbdb['limit'];var _0x2cae6f;if(_0x1764da>=_0x32c8d4){_0x1764da=_0x32c8d4;_0x2cae6f=0xc8;}else{_0x2cae6f=0xce;}_0x206aa0[_0xa1bf('0x28')](_0x2cae6f);return _0x206aa0[_0xa1bf('0x2d')](_0xa1bf('0x2e'),_0x6363bb+'-'+_0x1764da+'/'+_0x32c8d4)[_0xa1bf('0x29')](_0x672fb3);}return null;};}function patchUpdates(_0x469d83){return function(_0x1189ed){try{jsonpatch[_0xa1bf('0x2f')](_0x1189ed,_0x469d83,!![]);}catch(_0x38b193){return BPromise['reject'](_0x38b193);}return _0x1189ed[_0xa1bf('0x30')]();};}function saveUpdates(_0x3eaa74,_0x2a6883){return function(_0x446d89){if(_0x446d89){return _0x446d89['update'](_0x3eaa74)['then'](function(_0x3a6adf){return _0x3a6adf;});}return null;};}function removeEntity(_0x510f33,_0x39fa0a){return function(_0x43ae1c){if(_0x43ae1c){return _0x43ae1c['destroy']()[_0xa1bf('0x31')](function(){var _0x5cfd0e=_0x43ae1c[_0xa1bf('0x32')]({'plain':!![]});var _0x12e3c7=_0xa1bf('0x33');return db['UserProfileResource'][_0xa1bf('0x34')]({'where':{'type':_0x12e3c7,'resourceId':_0x5cfd0e['id']}})['then'](function(){return _0x43ae1c;});})[_0xa1bf('0x31')](function(){_0x510f33[_0xa1bf('0x28')](0xcc)[_0xa1bf('0x27')]();});}};}function handleEntityNotFound(_0x32938d,_0x26026b){return function(_0x296ac7){if(!_0x296ac7){_0x32938d['sendStatus'](0x194);}return _0x296ac7;};}function handleError(_0x3df0dc,_0x54adaf){_0x54adaf=_0x54adaf||0x1f4;return function(_0x160297){logger[_0xa1bf('0x22')](_0x160297['stack']);if(_0x160297['name']){delete _0x160297['name'];}_0x3df0dc[_0xa1bf('0x28')](_0x54adaf)[_0xa1bf('0x35')](_0x160297);};}exports[_0xa1bf('0x36')]=function(_0x1fa60f,_0x45af6f){var _0x4d6b77={'include':[{'model':db[_0xa1bf('0x37')],'as':_0xa1bf('0x38')},{'model':db['MailServerOut'],'as':_0xa1bf('0x39')},{'model':db[_0xa1bf('0x3a')],'as':_0xa1bf('0x3b')}]},_0x2b6136={},_0x36e2d5={'count':0x0,'rows':[]};var _0x2f80a6=_[_0xa1bf('0x3c')](db[_0xa1bf('0x3d')]['rawAttributes'],function(_0x8b0016){return{'name':_0x8b0016[_0xa1bf('0x3e')],'type':_0x8b0016[_0xa1bf('0x3f')][_0xa1bf('0x40')]};});_0x2b6136[_0xa1bf('0x41')]=_[_0xa1bf('0x3c')](_0x2f80a6,_0xa1bf('0x42'));_0x2b6136[_0xa1bf('0x43')]=_['keys'](_0x1fa60f[_0xa1bf('0x43')]);_0x2b6136['filters']=_[_0xa1bf('0x44')](_0x2b6136[_0xa1bf('0x41')],_0x2b6136[_0xa1bf('0x43')]);_0x4d6b77['attributes']=_['intersection'](_0x2b6136[_0xa1bf('0x41')],qs[_0xa1bf('0x45')](_0x1fa60f[_0xa1bf('0x43')]['fields']));_0x4d6b77['attributes']=_0x4d6b77[_0xa1bf('0x46')][_0xa1bf('0x47')]?_0x4d6b77[_0xa1bf('0x46')]:_0x2b6136[_0xa1bf('0x41')];if(!_0x1fa60f[_0xa1bf('0x43')][_0xa1bf('0x48')](_0xa1bf('0x49'))){_0x4d6b77['limit']=qs[_0xa1bf('0x4a')](_0x1fa60f[_0xa1bf('0x43')][_0xa1bf('0x4a')]);_0x4d6b77['offset']=qs[_0xa1bf('0x2c')](_0x1fa60f[_0xa1bf('0x43')]['offset']);}_0x4d6b77[_0xa1bf('0x4b')]=qs[_0xa1bf('0x4c')](_0x1fa60f[_0xa1bf('0x43')][_0xa1bf('0x4c')]);_0x4d6b77['where']=qs[_0xa1bf('0x4d')](_[_0xa1bf('0x4e')](_0x1fa60f[_0xa1bf('0x43')],_0x2b6136[_0xa1bf('0x4d')]),_0x2f80a6);if(_0x1fa60f['query']['filter']){_0x4d6b77[_0xa1bf('0x4f')]=_['merge'](_0x4d6b77[_0xa1bf('0x4f')],{'$or':_[_0xa1bf('0x3c')](_0x2f80a6,function(_0x14ad64){if(_0x14ad64[_0xa1bf('0x3f')]!=='VIRTUAL'){var _0x28471d={};_0x28471d[_0x14ad64[_0xa1bf('0x42')]]={'$like':'%'+_0x1fa60f[_0xa1bf('0x43')][_0xa1bf('0x50')]+'%'};return _0x28471d;}})});}_0x4d6b77=_[_0xa1bf('0x51')]({},_0x4d6b77,_0x1fa60f[_0xa1bf('0x52')]);var _0x459246={'where':_0x4d6b77[_0xa1bf('0x4f')]};return db['MailAccount']['count'](_0x459246)[_0xa1bf('0x31')](function(_0x474fae){_0x36e2d5[_0xa1bf('0x2b')]=_0x474fae;if(_0x1fa60f[_0xa1bf('0x43')][_0xa1bf('0x53')]){_0x4d6b77[_0xa1bf('0x54')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x4d6b77);})[_0xa1bf('0x31')](function(_0x4973b1){_0x36e2d5[_0xa1bf('0x55')]=_0x4973b1;return _0x36e2d5;})['then'](respondWithFilteredResult(_0x45af6f,_0x4d6b77))[_0xa1bf('0x26')](handleError(_0x45af6f,null));};exports['show']=function(_0x5be69d,_0xa17cd2){var _0x1c5537={'raw':![],'where':{'id':_0x5be69d[_0xa1bf('0x56')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xa1bf('0x38')},{'model':db[_0xa1bf('0x57')],'as':_0xa1bf('0x39')},{'model':db[_0xa1bf('0x3a')],'as':_0xa1bf('0x3b')}]},_0x5462b2={};_0x5462b2[_0xa1bf('0x41')]=_[_0xa1bf('0x58')](db[_0xa1bf('0x3d')][_0xa1bf('0x59')]);_0x5462b2[_0xa1bf('0x43')]=_[_0xa1bf('0x58')](_0x5be69d[_0xa1bf('0x43')]);_0x5462b2[_0xa1bf('0x4d')]=_[_0xa1bf('0x44')](_0x5462b2['model'],_0x5462b2[_0xa1bf('0x43')]);_0x1c5537[_0xa1bf('0x46')]=_[_0xa1bf('0x44')](_0x5462b2[_0xa1bf('0x41')],qs[_0xa1bf('0x45')](_0x5be69d['query'][_0xa1bf('0x45')]));_0x1c5537['attributes']=_0x1c5537[_0xa1bf('0x46')][_0xa1bf('0x47')]?_0x1c5537['attributes']:_0x5462b2[_0xa1bf('0x41')];if(_0x5be69d[_0xa1bf('0x43')]['includeAll']){_0x1c5537[_0xa1bf('0x54')]=[{'all':!![]}];}_0x1c5537=_[_0xa1bf('0x51')]({},_0x1c5537,_0x5be69d[_0xa1bf('0x52')]);return db[_0xa1bf('0x3d')][_0xa1bf('0x5a')](_0x1c5537)[_0xa1bf('0x31')](handleEntityNotFound(_0xa17cd2,null))['then'](respondWithResult(_0xa17cd2,null))[_0xa1bf('0x26')](handleError(_0xa17cd2,null));};exports[_0xa1bf('0x5b')]=function(_0x55dc2f,_0x386f9b){if(_0x55dc2f[_0xa1bf('0x5c')]['id']){delete _0x55dc2f['body']['id'];}return db[_0xa1bf('0x3d')][_0xa1bf('0x5a')]({'where':{'id':_0x55dc2f['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xa1bf('0x38')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0xa1bf('0x3b')}]})[_0xa1bf('0x31')](handleEntityNotFound(_0x386f9b,null))['then'](saveUpdates(_0x55dc2f[_0xa1bf('0x5c')],null))[_0xa1bf('0x31')](function(_0x3ac045){if(_0x3ac045&&_0x55dc2f[_0xa1bf('0x5c')][_0xa1bf('0x38')]){return db[_0xa1bf('0x37')][_0xa1bf('0x5b')](_0x55dc2f['body'][_0xa1bf('0x38')],{'where':{'MailAccountId':_0x3ac045['id']}})[_0xa1bf('0x31')](function(){return _0x3ac045;});}return _0x3ac045;})['then'](function(_0x229a88){if(_0x229a88&&_0x55dc2f[_0xa1bf('0x5c')][_0xa1bf('0x39')]){return db[_0xa1bf('0x57')][_0xa1bf('0x5b')](_0x55dc2f[_0xa1bf('0x5c')][_0xa1bf('0x39')],{'where':{'MailAccountId':_0x229a88['id']}})[_0xa1bf('0x31')](function(){return _0x229a88;});}return _0x229a88;})[_0xa1bf('0x31')](respondWithResult(_0x386f9b,null))[_0xa1bf('0x26')](handleError(_0x386f9b,null));};exports['describe']=function(_0x3b5fa9,_0x1b07d0){return db[_0xa1bf('0x3d')][_0xa1bf('0x5d')]()['then'](respondWithResult(_0x1b07d0,null))[_0xa1bf('0x26')](handleError(_0x1b07d0,null));};exports[_0xa1bf('0x5e')]=function(_0x469289,_0x83877e,_0x3ae66c){if(_0x469289[_0xa1bf('0x5c')]['id']){delete _0x469289[_0xa1bf('0x5c')]['id'];}return db[_0xa1bf('0x3d')]['find']({'where':{'id':_0x469289['params']['id']}})['then'](handleEntityNotFound(_0x83877e,null))[_0xa1bf('0x31')](function(_0x440647){if(_0x440647){_0x469289[_0xa1bf('0x5c')][_0xa1bf('0x5f')]=_0x440647['id'];return db['Disposition']['create'](_0x469289[_0xa1bf('0x5c')]);}})[_0xa1bf('0x31')](respondWithResult(_0x83877e,null))[_0xa1bf('0x26')](handleError(_0x83877e,null));};exports[_0xa1bf('0x60')]=function(_0x26589b,_0x304697,_0x4e751a){var _0x4c186f={'raw':![],'where':{}};var _0x3e504a={};var _0x39c632={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x26589b[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x304697,null))[_0xa1bf('0x31')](function(_0x26a222){if(_0x26a222){_0x3e504a[_0xa1bf('0x41')]=_[_0xa1bf('0x58')](db[_0xa1bf('0x61')][_0xa1bf('0x59')]);_0x3e504a[_0xa1bf('0x43')]=_[_0xa1bf('0x58')](_0x26589b[_0xa1bf('0x43')]);_0x3e504a[_0xa1bf('0x4d')]=_[_0xa1bf('0x44')](_0x3e504a[_0xa1bf('0x41')],_0x3e504a[_0xa1bf('0x43')]);_0x4c186f[_0xa1bf('0x46')]=_[_0xa1bf('0x44')](_0x3e504a[_0xa1bf('0x41')],qs[_0xa1bf('0x45')](_0x26589b['query'][_0xa1bf('0x45')]));_0x4c186f[_0xa1bf('0x46')]=_0x4c186f[_0xa1bf('0x46')][_0xa1bf('0x47')]?_0x4c186f['attributes']:_0x3e504a['model'];if(!_0x26589b[_0xa1bf('0x43')]['hasOwnProperty']('nolimit')){_0x4c186f[_0xa1bf('0x4a')]=qs[_0xa1bf('0x4a')](_0x26589b[_0xa1bf('0x43')][_0xa1bf('0x4a')]);_0x4c186f[_0xa1bf('0x2c')]=qs[_0xa1bf('0x2c')](_0x26589b[_0xa1bf('0x43')][_0xa1bf('0x2c')]);}_0x4c186f[_0xa1bf('0x4b')]=qs[_0xa1bf('0x4c')](_0x26589b[_0xa1bf('0x43')][_0xa1bf('0x4c')]);_0x4c186f['where']=qs['filters'](_[_0xa1bf('0x4e')](_0x26589b[_0xa1bf('0x43')],_0x3e504a['filters']));_0x4c186f[_0xa1bf('0x4f')]['MailAccountId']=_0x26a222['id'];if(_0x26589b[_0xa1bf('0x43')][_0xa1bf('0x50')]){_0x4c186f['where']=_['merge'](_0x4c186f[_0xa1bf('0x4f')],{'$or':_['map'](_0x4c186f[_0xa1bf('0x46')],function(_0x2a452c){var _0x4b2b0b={};_0x4b2b0b[_0x2a452c]={'$like':'%'+_0x26589b['query'][_0xa1bf('0x50')]+'%'};return _0x4b2b0b;})});}_0x4c186f=_[_0xa1bf('0x51')]({},_0x4c186f,_0x26589b['options']);return db[_0xa1bf('0x61')][_0xa1bf('0x2b')]({'where':_0x4c186f[_0xa1bf('0x4f')]})[_0xa1bf('0x31')](function(_0x58bff4){_0x39c632[_0xa1bf('0x2b')]=_0x58bff4;if(_0x26589b[_0xa1bf('0x43')][_0xa1bf('0x53')]){_0x4c186f[_0xa1bf('0x54')]=[{'all':!![]}];}return db[_0xa1bf('0x61')][_0xa1bf('0x62')](_0x4c186f);})[_0xa1bf('0x31')](function(_0x56c0ad){_0x39c632[_0xa1bf('0x55')]=_0x56c0ad;return _0x39c632;});}})[_0xa1bf('0x31')](respondWithFilteredResult(_0x304697,_0x4c186f))['catch'](handleError(_0x304697,null));};exports[_0xa1bf('0x63')]=function(_0x46a956,_0x23f235,_0x2712d6){return db[_0xa1bf('0x3d')][_0xa1bf('0x5a')]({'where':{'id':_0x46a956[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x23f235,null))[_0xa1bf('0x31')](function(_0x256c72){if(_0x256c72){return _0x256c72[_0xa1bf('0x63')](_0x46a956[_0xa1bf('0x43')][_0xa1bf('0x64')]);}})[_0xa1bf('0x31')](respondWithStatusCode(_0x23f235,null))[_0xa1bf('0x26')](handleError(_0x23f235,null));};exports[_0xa1bf('0x65')]=function(_0x555021,_0x4cd32d,_0xdafa7b){if(_0x555021[_0xa1bf('0x5c')]['id']){delete _0x555021[_0xa1bf('0x5c')]['id'];}return db['MailAccount'][_0xa1bf('0x5a')]({'where':{'id':_0x555021[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x4cd32d,null))[_0xa1bf('0x31')](function(_0x59daa0){if(_0x59daa0){_0x555021[_0xa1bf('0x5c')][_0xa1bf('0x5f')]=_0x59daa0['id'];return db[_0xa1bf('0x66')][_0xa1bf('0x67')](_0x555021[_0xa1bf('0x5c')]);}})['then'](respondWithResult(_0x4cd32d,null))['catch'](handleError(_0x4cd32d,null));};exports['getAnswers']=function(_0x4c2daf,_0x2e9975,_0x2918d7){var _0x5916ab={'raw':![],'where':{}};var _0x25880a={};var _0xbfe0f0={'count':0x0,'rows':[]};return db[_0xa1bf('0x3d')][_0xa1bf('0x68')]({'where':{'id':_0x4c2daf[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x2e9975,null))[_0xa1bf('0x31')](function(_0xbfbff1){if(_0xbfbff1){_0x25880a['model']=_['keys'](db['CannedAnswer'][_0xa1bf('0x59')]);_0x25880a[_0xa1bf('0x43')]=_[_0xa1bf('0x58')](_0x4c2daf['query']);_0x25880a[_0xa1bf('0x4d')]=_[_0xa1bf('0x44')](_0x25880a[_0xa1bf('0x41')],_0x25880a[_0xa1bf('0x43')]);_0x5916ab[_0xa1bf('0x46')]=_[_0xa1bf('0x44')](_0x25880a[_0xa1bf('0x41')],qs[_0xa1bf('0x45')](_0x4c2daf[_0xa1bf('0x43')][_0xa1bf('0x45')]));_0x5916ab[_0xa1bf('0x46')]=_0x5916ab[_0xa1bf('0x46')][_0xa1bf('0x47')]?_0x5916ab[_0xa1bf('0x46')]:_0x25880a['model'];if(!_0x4c2daf[_0xa1bf('0x43')][_0xa1bf('0x48')]('nolimit')){_0x5916ab['limit']=qs['limit'](_0x4c2daf[_0xa1bf('0x43')]['limit']);_0x5916ab[_0xa1bf('0x2c')]=qs['offset'](_0x4c2daf[_0xa1bf('0x43')]['offset']);}_0x5916ab['order']=qs['sort'](_0x4c2daf[_0xa1bf('0x43')][_0xa1bf('0x4c')]);_0x5916ab[_0xa1bf('0x4f')]=qs[_0xa1bf('0x4d')](_[_0xa1bf('0x4e')](_0x4c2daf[_0xa1bf('0x43')],_0x25880a[_0xa1bf('0x4d')]));_0x5916ab[_0xa1bf('0x4f')][_0xa1bf('0x5f')]=_0xbfbff1['id'];if(_0x4c2daf['query'][_0xa1bf('0x50')]){_0x5916ab[_0xa1bf('0x4f')]=_['merge'](_0x5916ab[_0xa1bf('0x4f')],{'$or':_[_0xa1bf('0x3c')](_0x5916ab['attributes'],function(_0x1bcb25){var _0x286052={};_0x286052[_0x1bcb25]={'$like':'%'+_0x4c2daf['query']['filter']+'%'};return _0x286052;})});}_0x5916ab=_['merge']({},_0x5916ab,_0x4c2daf[_0xa1bf('0x52')]);return db[_0xa1bf('0x66')]['count']({'where':_0x5916ab['where']})[_0xa1bf('0x31')](function(_0x22f1f2){_0xbfe0f0[_0xa1bf('0x2b')]=_0x22f1f2;if(_0x4c2daf[_0xa1bf('0x43')]['includeAll']){_0x5916ab[_0xa1bf('0x54')]=[{'all':!![]}];}return db[_0xa1bf('0x66')][_0xa1bf('0x62')](_0x5916ab);})[_0xa1bf('0x31')](function(_0x3467d0){_0xbfe0f0[_0xa1bf('0x55')]=_0x3467d0;return _0xbfe0f0;});}})[_0xa1bf('0x31')](respondWithFilteredResult(_0x2e9975,_0x5916ab))['catch'](handleError(_0x2e9975,null));};exports[_0xa1bf('0x69')]=function(_0x6036bd,_0x2c18a3,_0x4a29f2){return db[_0xa1bf('0x3d')][_0xa1bf('0x5a')]({'where':{'id':_0x6036bd[_0xa1bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x2c18a3,null))['then'](function(_0x16ba50){if(_0x16ba50){return _0x16ba50[_0xa1bf('0x69')](_0x6036bd['query'][_0xa1bf('0x64')]);}})[_0xa1bf('0x31')](respondWithStatusCode(_0x2c18a3,null))[_0xa1bf('0x26')](handleError(_0x2c18a3,null));};exports['create']=function(_0x520c6c,_0x688358){var _0x47054a={'name':_0x520c6c[_0xa1bf('0x5c')][_0xa1bf('0x42')],'key':_0x520c6c['body'][_0xa1bf('0x40')],'email':_0x520c6c[_0xa1bf('0x5c')][_0xa1bf('0x6a')],'ListId':_0x520c6c[_0xa1bf('0x5c')]['ListId'],'active':!_[_0xa1bf('0x6b')](_0x520c6c['body'][_0xa1bf('0x6c')])?_0x520c6c[_0xa1bf('0x5c')][_0xa1bf('0x6c')]:!![],'description':_0x520c6c['body'][_0xa1bf('0x6d')]||null,'Imap':{},'Smtp':{}};if(_[_0xa1bf('0x6b')](_0x520c6c[_0xa1bf('0x5c')][_0xa1bf('0x6e')])){if(_0x520c6c['body']['cauthentication']){_0x47054a[_0xa1bf('0x38')][_0xa1bf('0x6f')]=_0x47054a['Smtp'][_0xa1bf('0x6f')]=_0x520c6c[_0xa1bf('0x5c')][_0xa1bf('0x70')];_0x47054a['Imap'][_0xa1bf('0x71')]=_0x47054a['Smtp']['pass']=_0x520c6c['body'][_0xa1bf('0x72')];}else{_0x47054a[_0xa1bf('0x38')][_0xa1bf('0x73')]=_0x47054a[_0xa1bf('0x39')][_0xa1bf('0x73')]=![];}_0x47054a[_0xa1bf('0x38')]['host']=_0x520c6c[_0xa1bf('0x5c')][_0xa1bf('0x38')][_0xa1bf('0x74')];_0x47054a[_0xa1bf('0x38')]['port']=_0x520c6c[_0xa1bf('0x5c')][_0xa1bf('0x38')]['port'];_0x47054a[_0xa1bf('0x39')][_0xa1bf('0x74')]=_0x520c6c[_0xa1bf('0x5c')][_0xa1bf('0x39')][_0xa1bf('0x74')];_0x47054a['Smtp']['port']=_0x520c6c[_0xa1bf('0x5c')][_0xa1bf('0x39')][_0xa1bf('0x75')];}else{_0x47054a[_0xa1bf('0x38')]['service']=_0x47054a[_0xa1bf('0x39')][_0xa1bf('0x76')]=_0x520c6c[_0xa1bf('0x5c')]['cservice'];_0x47054a[_0xa1bf('0x38')]['user']=_0x47054a[_0xa1bf('0x39')]['user']=_0x520c6c[_0xa1bf('0x5c')][_0xa1bf('0x70')];_0x47054a[_0xa1bf('0x38')][_0xa1bf('0x71')]=_0x47054a[_0xa1bf('0x39')]['pass']=_0x520c6c[_0xa1bf('0x5c')]['cpassword'];}return db[_0xa1bf('0x3d')]['create'](_0x47054a,{'include':[{'model':db[_0xa1bf('0x57')],'as':'Smtp'},{'model':db[_0xa1bf('0x37')],'as':_0xa1bf('0x38')}]})[_0xa1bf('0x31')](function(_0x377c22){var _0x1ea755=_0x520c6c[_0xa1bf('0x6f')][_0xa1bf('0x32')]({'plain':!![]});if(!_0x1ea755)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ea755['role']===_0xa1bf('0x6f')){var _0x57a117=_0x377c22['get']({'plain':!![]});return db[_0xa1bf('0x77')][_0xa1bf('0x5a')]({'where':{'name':_0xa1bf('0x33'),'userProfileId':_0x1ea755['userProfileId']},'raw':!![]})['then'](function(_0x1f6b8f){if(_0x1f6b8f&&_0x1f6b8f[_0xa1bf('0x78')]===0x0){return db[_0xa1bf('0x79')][_0xa1bf('0x67')]({'name':_0x57a117['name'],'resourceId':_0x57a117['id'],'type':_0x1f6b8f[_0xa1bf('0x42')],'sectionId':_0x1f6b8f['id']},{})['then'](function(){return _0x377c22;});}else{return _0x377c22;}})[_0xa1bf('0x26')](function(_0x46f3c4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46f3c4);throw _0x46f3c4;});}return _0x377c22;})[_0xa1bf('0x31')](respondWithResult(_0x688358,0xc9))[_0xa1bf('0x26')](handleError(_0x688358,null));};exports[_0xa1bf('0x7a')]=function(_0x2135bc,_0x464dc6,_0x135195){return db[_0xa1bf('0x3d')]['findOne']({'where':{'id':_0x2135bc['params']['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x464dc6,null))[_0xa1bf('0x31')](function(_0x409013){if(_0x409013){return _0x409013[_0xa1bf('0x7a')]();}return null;})[_0xa1bf('0x31')](respondWithResult(_0x464dc6,null))['catch'](handleError(_0x464dc6,null));};exports[_0xa1bf('0x7b')]=function(_0x39dc38,_0x19cc4c,_0x2834a){if(_0x39dc38[_0xa1bf('0x5c')]['id']){delete _0x39dc38[_0xa1bf('0x5c')]['id'];}return db[_0xa1bf('0x3d')]['find']({'where':{'id':_0x39dc38[_0xa1bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x19cc4c,null))[_0xa1bf('0x31')](function(_0x34f733){if(_0x34f733){_0x39dc38[_0xa1bf('0x5c')]['MailAccountId']=_0x34f733['id'];return db['MailServerIn']['create'](_0x39dc38['body']);}})['then'](respondWithResult(_0x19cc4c,null))[_0xa1bf('0x26')](handleError(_0x19cc4c,null));};exports[_0xa1bf('0x7c')]=function(_0x157af9,_0x1f553d,_0xbd15c0){return db['MailAccount'][_0xa1bf('0x68')]({'where':{'id':_0x157af9[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x1f553d,null))['then'](function(_0x4773de){if(_0x4773de){return _0x4773de[_0xa1bf('0x7d')](null);}return null;})['then'](respondWithStatusCode(_0x1f553d,null))['catch'](handleError(_0x1f553d,null));};exports[_0xa1bf('0x7e')]=function(_0x31a09e,_0x2bc58f,_0x1e0c05){return db['MailAccount']['findOne']({'where':{'id':_0x31a09e[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x2bc58f,null))['then'](function(_0x2813cb){if(_0x2813cb){return _0x2813cb[_0xa1bf('0x7e')]();}return null;})[_0xa1bf('0x31')](respondWithResult(_0x2bc58f,null))['catch'](handleError(_0x2bc58f,null));};exports[_0xa1bf('0x7f')]=function(_0x164c12,_0x328f0e,_0x301b4f){if(_0x164c12['body']['id']){delete _0x164c12[_0xa1bf('0x5c')]['id'];}return db[_0xa1bf('0x3d')][_0xa1bf('0x5a')]({'where':{'id':_0x164c12[_0xa1bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x328f0e,null))['then'](function(_0x5094d8){if(_0x5094d8){_0x164c12[_0xa1bf('0x5c')][_0xa1bf('0x5f')]=_0x5094d8['id'];return db['MailServerOut'][_0xa1bf('0x67')](_0x164c12[_0xa1bf('0x5c')]);}})[_0xa1bf('0x31')](respondWithResult(_0x328f0e,null))[_0xa1bf('0x26')](handleError(_0x328f0e,null));};exports[_0xa1bf('0x80')]=function(_0x41604c,_0x434546,_0x3137e1){return db[_0xa1bf('0x3d')]['findOne']({'where':{'id':_0x41604c[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x434546,null))[_0xa1bf('0x31')](function(_0x2c6231){if(_0x2c6231){return _0x2c6231[_0xa1bf('0x81')](null);}return null;})[_0xa1bf('0x31')](respondWithStatusCode(_0x434546,null))['catch'](handleError(_0x434546,null));};exports[_0xa1bf('0x82')]=function(_0x2cb352,_0x13e990,_0x17335b){return db[_0xa1bf('0x83')][_0xa1bf('0x5a')]({'where':{'id':_0x2cb352[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x13e990,null))['then'](function(_0x1fa5df){if(_0x1fa5df){return _0x1fa5df[_0xa1bf('0x82')](_0x2cb352[_0xa1bf('0x5c')][_0xa1bf('0x64')],_[_0xa1bf('0x84')](_0x2cb352['body'],[_0xa1bf('0x64'),'id'])||{});}})[_0xa1bf('0x31')](respondWithResult(_0x13e990,null))[_0xa1bf('0x26')](handleError(_0x13e990,null));};exports[_0xa1bf('0x85')]=function(_0x4999ce,_0x1b8752,_0x4132de){var _0x441e9e={'raw':![],'where':{}};var _0x3965ae={};var _0x168119={'count':0x0,'rows':[]};return db[_0xa1bf('0x3d')][_0xa1bf('0x68')]({'where':{'id':_0x4999ce[_0xa1bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x1b8752,null))['then'](function(_0x2ad8d1){if(_0x2ad8d1){_0x3965ae['model']=_['keys'](db[_0xa1bf('0x83')][_0xa1bf('0x59')]);_0x3965ae[_0xa1bf('0x43')]=_['keys'](_0x4999ce[_0xa1bf('0x43')]);_0x3965ae[_0xa1bf('0x4d')]=_[_0xa1bf('0x44')](_0x3965ae[_0xa1bf('0x41')],_0x3965ae[_0xa1bf('0x43')]);_0x441e9e[_0xa1bf('0x46')]=_[_0xa1bf('0x44')](_0x3965ae[_0xa1bf('0x41')],qs[_0xa1bf('0x45')](_0x4999ce[_0xa1bf('0x43')][_0xa1bf('0x45')]));_0x441e9e[_0xa1bf('0x46')]=_0x441e9e[_0xa1bf('0x46')][_0xa1bf('0x47')]?_0x441e9e['attributes']:_0x3965ae['model'];if(!_0x4999ce[_0xa1bf('0x43')][_0xa1bf('0x48')](_0xa1bf('0x49'))){_0x441e9e[_0xa1bf('0x4a')]=qs[_0xa1bf('0x4a')](_0x4999ce['query'][_0xa1bf('0x4a')]);_0x441e9e[_0xa1bf('0x2c')]=qs[_0xa1bf('0x2c')](_0x4999ce[_0xa1bf('0x43')][_0xa1bf('0x2c')]);}_0x441e9e[_0xa1bf('0x4b')]=qs[_0xa1bf('0x4c')](_0x4999ce['query']['sort']);_0x441e9e[_0xa1bf('0x4f')]=qs['filters'](_[_0xa1bf('0x4e')](_0x4999ce[_0xa1bf('0x43')],_0x3965ae[_0xa1bf('0x4d')]));_0x441e9e[_0xa1bf('0x4f')][_0xa1bf('0x5f')]=_0x2ad8d1['id'];if(_0x4999ce[_0xa1bf('0x43')][_0xa1bf('0x50')]){_0x441e9e[_0xa1bf('0x4f')]=_[_0xa1bf('0x51')](_0x441e9e[_0xa1bf('0x4f')],{'$or':_[_0xa1bf('0x3c')](_0x441e9e[_0xa1bf('0x46')],function(_0x393b56){var _0xc8c4f8={};_0xc8c4f8[_0x393b56]={'$like':'%'+_0x4999ce[_0xa1bf('0x43')][_0xa1bf('0x50')]+'%'};return _0xc8c4f8;})});}_0x441e9e=_['merge']({},_0x441e9e,_0x4999ce[_0xa1bf('0x52')]);return db[_0xa1bf('0x83')][_0xa1bf('0x2b')]({'where':_0x441e9e[_0xa1bf('0x4f')]})['then'](function(_0x71f643){_0x168119[_0xa1bf('0x2b')]=_0x71f643;if(_0x4999ce[_0xa1bf('0x43')]['includeAll']){_0x441e9e[_0xa1bf('0x54')]=[{'model':db[_0xa1bf('0x86')],'as':_0xa1bf('0x87'),'required':![]},{'model':db['User'],'as':_0xa1bf('0x88'),'attributes':[_0xa1bf('0x42'),'fullname',_0xa1bf('0x89')],'required':![]},{'model':db['Tag'],'as':_0xa1bf('0x8a'),'attributes':['id',_0xa1bf('0x42'),'color'],'where':_0x4999ce['query']['tag']?{'id':_0x4999ce['query'][_0xa1bf('0x8b')]}:undefined,'required':_0x4999ce[_0xa1bf('0x43')]['tag']?!![]:![]}];}return db[_0xa1bf('0x83')]['findAll'](_0x441e9e);})[_0xa1bf('0x31')](function(_0x2a815b){_0x168119[_0xa1bf('0x55')]=_0x2a815b;return _0x168119;});}})[_0xa1bf('0x31')](respondWithFilteredResult(_0x1b8752,_0x441e9e))[_0xa1bf('0x26')](handleError(_0x1b8752,null));};exports['addApplications']=function(_0x1c89c8,_0x27275d,_0x5396bd){return db[_0xa1bf('0x3d')][_0xa1bf('0x68')]({'where':{'id':_0x1c89c8[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x27275d,null))['then'](function(_0x2e2dea){if(_0x2e2dea){return db[_0xa1bf('0x8c')][_0xa1bf('0x8d')](function(_0x3533b8){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x1c89c8[_0xa1bf('0x56')]['id']},'transaction':_0x3533b8})[_0xa1bf('0x31')](function(_0x1fc6a1){var _0x716df4=_['map'](_0x1c89c8[_0xa1bf('0x5c')],function(_0x5718db){_0x5718db[_0xa1bf('0x5f')]=_0x1c89c8[_0xa1bf('0x56')]['id'];return _0x5718db;});return db['MailApplication'][_0xa1bf('0x8e')](_0x716df4,{'transaction':_0x3533b8});});})[_0xa1bf('0x31')](function(){return db[_0xa1bf('0x8f')][_0xa1bf('0x90')]({'where':{'MailAccountId':_0x1c89c8[_0xa1bf('0x56')]['id']},'order':_0xa1bf('0x91')});});}})[_0xa1bf('0x31')](respondWithResult(_0x27275d,null))[_0xa1bf('0x26')](handleError(_0x27275d,null));};exports['getApplications']=function(_0x401f92,_0x77a4b3,_0x345bd1){var _0x1c836b={};var _0x1759a5={};var _0x2372ef;var _0x285655;return db[_0xa1bf('0x3d')]['findOne']({'where':{'id':_0x401f92[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x77a4b3,null))['then'](function(_0x1212e2){if(_0x1212e2){_0x2372ef=_0x1212e2;_0x1759a5[_0xa1bf('0x41')]=_[_0xa1bf('0x58')](db['MailApplication'][_0xa1bf('0x59')]);_0x1759a5['query']=_[_0xa1bf('0x58')](_0x401f92[_0xa1bf('0x43')]);_0x1759a5[_0xa1bf('0x4d')]=_['intersection'](_0x1759a5[_0xa1bf('0x41')],_0x1759a5[_0xa1bf('0x43')]);_0x1c836b[_0xa1bf('0x46')]=_[_0xa1bf('0x44')](_0x1759a5[_0xa1bf('0x41')],qs[_0xa1bf('0x45')](_0x401f92[_0xa1bf('0x43')][_0xa1bf('0x45')]));_0x1c836b[_0xa1bf('0x46')]=_0x1c836b[_0xa1bf('0x46')][_0xa1bf('0x47')]?_0x1c836b[_0xa1bf('0x46')]:_0x1759a5['model'];_0x1c836b['order']=qs[_0xa1bf('0x4c')](_0x401f92['query'][_0xa1bf('0x4c')]);_0x1c836b[_0xa1bf('0x4f')]=qs[_0xa1bf('0x4d')](_[_0xa1bf('0x4e')](_0x401f92[_0xa1bf('0x43')],_0x1759a5['filters']));if(_0x401f92[_0xa1bf('0x43')]['filter']){_0x1c836b[_0xa1bf('0x4f')]=_[_0xa1bf('0x51')](_0x1c836b['where'],{'$or':_[_0xa1bf('0x3c')](_0x1c836b[_0xa1bf('0x46')],function(_0x2ba96c){var _0x2c412b={};_0x2c412b[_0x2ba96c]={'$like':'%'+_0x401f92[_0xa1bf('0x43')][_0xa1bf('0x50')]+'%'};return _0x2c412b;})});}_0x1c836b=_['merge']({},_0x1c836b,_0x401f92[_0xa1bf('0x52')]);return _0x2372ef[_0xa1bf('0x92')](_0x1c836b);}})[_0xa1bf('0x31')](function(_0x3f9cb9){if(_0x3f9cb9){_0x285655=_0x3f9cb9[_0xa1bf('0x47')];if(!_0x401f92[_0xa1bf('0x43')][_0xa1bf('0x48')]('nolimit')){_0x1c836b[_0xa1bf('0x4a')]=qs[_0xa1bf('0x4a')](_0x401f92[_0xa1bf('0x43')][_0xa1bf('0x4a')]);_0x1c836b[_0xa1bf('0x2c')]=qs['offset'](_0x401f92[_0xa1bf('0x43')][_0xa1bf('0x2c')]);}return _0x2372ef[_0xa1bf('0x92')](_0x1c836b);}})[_0xa1bf('0x31')](function(_0x2ed38c){if(_0x2ed38c){return _0x2ed38c?{'count':_0x285655,'rows':_0x2ed38c}:null;}})[_0xa1bf('0x31')](respondWithResult(_0x77a4b3,null))[_0xa1bf('0x26')](handleError(_0x77a4b3,null));};exports[_0xa1bf('0x93')]=function(_0x46182c,_0x746740,_0x3fe9f2){var _0x400376={'raw':!![],'where':{}};var _0x409693={};var _0x298b3d={'count':0x0,'rows':[]};return db[_0xa1bf('0x3d')][_0xa1bf('0x68')]({'where':{'id':_0x46182c[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x746740,null))['then'](function(_0xa0be02){if(_0xa0be02){_0x409693[_0xa1bf('0x41')]=_[_0xa1bf('0x58')](db[_0xa1bf('0x94')][_0xa1bf('0x59')]);_0x409693['query']=_[_0xa1bf('0x58')](_0x46182c[_0xa1bf('0x43')]);_0x409693[_0xa1bf('0x4d')]=_['intersection'](_0x409693['model'],_0x409693[_0xa1bf('0x43')]);_0x400376['attributes']=_[_0xa1bf('0x44')](_0x409693[_0xa1bf('0x41')],qs[_0xa1bf('0x45')](_0x46182c[_0xa1bf('0x43')][_0xa1bf('0x45')]));_0x400376[_0xa1bf('0x46')]=_0x400376['attributes'][_0xa1bf('0x47')]?_0x400376[_0xa1bf('0x46')]:_0x409693[_0xa1bf('0x41')];if(!_0x46182c[_0xa1bf('0x43')][_0xa1bf('0x48')](_0xa1bf('0x49'))){_0x400376[_0xa1bf('0x4a')]=qs[_0xa1bf('0x4a')](_0x46182c[_0xa1bf('0x43')]['limit']);_0x400376[_0xa1bf('0x2c')]=qs['offset'](_0x46182c[_0xa1bf('0x43')]['offset']);}_0x400376[_0xa1bf('0x4b')]=qs[_0xa1bf('0x4c')](_0x46182c['query'][_0xa1bf('0x4c')]);_0x400376['where']=qs[_0xa1bf('0x4d')](_[_0xa1bf('0x4e')](_0x46182c[_0xa1bf('0x43')],_0x409693[_0xa1bf('0x4d')]));_0x400376[_0xa1bf('0x4f')][_0xa1bf('0x5f')]=_0xa0be02['id'];if(_0x46182c[_0xa1bf('0x43')][_0xa1bf('0x50')]){_0x400376['where']=_[_0xa1bf('0x51')](_0x400376[_0xa1bf('0x4f')],{'$or':_[_0xa1bf('0x3c')](_0x400376[_0xa1bf('0x46')],function(_0x347f9d){var _0x42b51c={};_0x42b51c[_0x347f9d]={'$like':'%'+_0x46182c[_0xa1bf('0x43')]['filter']+'%'};return _0x42b51c;})});}if(_0x46182c[_0xa1bf('0x43')][_0xa1bf('0x95')]){var _0x22dc81=_0x46182c[_0xa1bf('0x43')][_0xa1bf('0x95')][_0xa1bf('0x96')](',');var _0x4373ad={};_0x4373ad[_0x22dc81[0x0]]={'$gte':moment(_0x22dc81[0x1])[_0xa1bf('0x97')](_0xa1bf('0x98'))};_0x400376[_0xa1bf('0x4f')]=_['merge'](_0x400376[_0xa1bf('0x4f')],_0x4373ad);}_0x400376=_['merge']({},_0x400376,_0x46182c[_0xa1bf('0x52')]);return db[_0xa1bf('0x94')]['count']({'where':_0x400376['where']})[_0xa1bf('0x31')](function(_0x6f64f1){_0x298b3d[_0xa1bf('0x2b')]=_0x6f64f1;if(_0x46182c['query']['includeAll']){_0x400376[_0xa1bf('0x54')]=[{'all':!![]}];}return db[_0xa1bf('0x94')]['findAll'](_0x400376);})['then'](function(_0x5451cb){if(_0x46182c['query']['inlineCss']===_0xa1bf('0x99')){for(var _0x480708=0x0;_0x480708<_0x5451cb['length'];_0x480708++){_0x5451cb[_0x480708]['body']=juice(_0x5451cb[_0x480708][_0xa1bf('0x5c')]);}}_0x298b3d[_0xa1bf('0x55')]=_0x5451cb;return _0x298b3d;});}})[_0xa1bf('0x31')](respondWithFilteredResult(_0x746740,_0x400376))[_0xa1bf('0x26')](handleError(_0x746740,null));};exports[_0xa1bf('0x35')]=function(_0x307495,_0x4428a1,_0x58d4ea){var _0x559f44,_0xe3dbd={},_0x5ca985;if(_0x307495['body']['to']){_0x5ca985=_0x307495[_0xa1bf('0x5c')]['to'][_0xa1bf('0x96')](',')[0x0];}return db[_0xa1bf('0x3d')][_0xa1bf('0x5a')]({'where':{'id':_0x307495[_0xa1bf('0x56')]['id']},'include':[{'model':db[_0xa1bf('0x9a')],'as':_0xa1bf('0x9b'),'include':[{'model':db[_0xa1bf('0x86')],'as':'Contacts','where':{'email':_0x5ca985},'limit':0x1,'order':[[_0xa1bf('0x9c'),_0xa1bf('0x9d')]]}]},{'model':db[_0xa1bf('0x57')],'as':_0xa1bf('0x39'),'raw':!![]}]})['then'](handleEntityNotFound(_0x4428a1,null))['then'](function(_0x233735){if(_0x233735){_0x559f44=_0x233735;if(_0x233735[_0xa1bf('0x39')]){if(_[_0xa1bf('0x6b')](_0x307495[_0xa1bf('0x5c')]['from'])){_0x307495[_0xa1bf('0x5c')][_0xa1bf('0x9e')]=util[_0xa1bf('0x97')]('%s\x20<%s>',_0x233735[_0xa1bf('0x42')],_0x233735['email']||_0x233735[_0xa1bf('0x39')]['user']);}if(_0x307495[_0xa1bf('0x5c')][_0xa1bf('0x9f')]&&_0x307495['body']['attachments'][_0xa1bf('0x47')]){for(var _0x234203=0x0;_0x234203<_0x307495[_0xa1bf('0x5c')][_0xa1bf('0x9f')][_0xa1bf('0x47')];_0x234203+=0x1){_0x307495[_0xa1bf('0x5c')]['attachments'][_0x234203]={'filename':_0x307495[_0xa1bf('0x5c')]['attachments'][_0x234203][_0xa1bf('0x42')],'path':path[_0xa1bf('0xa0')](config[_0xa1bf('0xa1')],_0xa1bf('0xa2'),_0x307495['body'][_0xa1bf('0x9f')][_0x234203]['basename'])};}}var _0x2ec6b1={'tls':{'rejectUnauthorized':![]}};if(_[_0xa1bf('0x6b')](_0x233735[_0xa1bf('0x39')][_0xa1bf('0x76')])){if(_0x233735['Smtp'][_0xa1bf('0x73')]){_0x2ec6b1['auth']={'user':_0x233735[_0xa1bf('0x39')][_0xa1bf('0x6f')],'pass':_0x233735[_0xa1bf('0x39')][_0xa1bf('0xa3')]};}_0x2ec6b1[_0xa1bf('0x74')]=_0x233735[_0xa1bf('0x39')][_0xa1bf('0x74')];_0x2ec6b1[_0xa1bf('0x75')]=_0x233735[_0xa1bf('0x39')]['port'];_0x2ec6b1[_0xa1bf('0xa4')]=_0x233735[_0xa1bf('0x39')]['secure'];}else{_0x2ec6b1[_0xa1bf('0x76')]=_0x233735[_0xa1bf('0x39')]['service'];_0x2ec6b1[_0xa1bf('0xa5')]={'user':_0x233735[_0xa1bf('0x39')][_0xa1bf('0x6f')],'pass':_0x233735[_0xa1bf('0x39')][_0xa1bf('0xa3')]};}return respondWithRpcPromise(_0xa1bf('0xa6'),'sendMail',{'account':_0x2ec6b1,'message':_0x307495[_0xa1bf('0x5c')]});}else{throw new Error('List\x20not\x20found');}}})[_0xa1bf('0x31')](function(_0x2e0742){if(_0x2e0742){_0xe3dbd=_0x2e0742;if(_0x559f44[_0xa1bf('0x9b')]){if(_0x559f44['List']['Contacts'][_0xa1bf('0x47')]){return _0x559f44[_0xa1bf('0x9b')][_0xa1bf('0xa7')][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x307495[_0xa1bf('0x5c')],{'firstName':_0x307495[_0xa1bf('0x5c')]['to'],'email':_0x307495[_0xa1bf('0x5c')]['to'],'phone':_0x307495[_0xa1bf('0x5c')]['to'],'ListId':_0x559f44[_0xa1bf('0xa8')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x56077f){if(_0x56077f){var _0x47ab15={'UserId':_0x307495[_0xa1bf('0x6f')]['id'],'ContactId':_0x56077f['id'],'MailAccountId':_0x559f44['id'],'inReplyTo':_0xe3dbd[_0xa1bf('0xa9')],'to':_0x307495[_0xa1bf('0x5c')]['from'],'cc':_0x307495['body']['cc'],'subject':_0x307495[_0xa1bf('0x5c')][_0xa1bf('0xaa')],'attach':_0x307495['body'][_0xa1bf('0xab')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0xa1bf('0x98')),'lastMsgDirection':'out','Messages':[_['merge'](_0x307495[_0xa1bf('0x5c')],{'messageId':_0xe3dbd[_0xa1bf('0xa9')],'sentAt':moment()[_0xa1bf('0x97')](_0xa1bf('0x98')),'read':!![],'MailAccountId':_0x559f44['id'],'UserId':_0x307495[_0xa1bf('0x6f')]['id'],'ContactId':_0x56077f['id']})]};if(_0x307495[_0xa1bf('0x5c')][_0xa1bf('0xac')]){_0x47ab15=_[_0xa1bf('0x51')](_0x47ab15,_0x307495['body'][_0xa1bf('0xac')]);}return db[_0xa1bf('0x83')][_0xa1bf('0x67')](_0x47ab15,{'include':[{'model':db[_0xa1bf('0x94')],'as':_0xa1bf('0xad')}]});}})['then'](respondWithResult(_0x4428a1,null))[_0xa1bf('0x26')](handleError(_0x4428a1,null));};exports['verifySmtp']=function(_0x4d93c6,_0x373718,_0x532f0e){return db[_0xa1bf('0x3d')][_0xa1bf('0x5a')]({'where':{'id':_0x4d93c6[_0xa1bf('0x56')]['id']},'include':[{'model':db[_0xa1bf('0x57')],'as':_0xa1bf('0x39'),'raw':!![]}]})['then'](handleEntityNotFound(_0x373718,null))[_0xa1bf('0x31')](function(_0xeea452){if(_0xeea452&&_0xeea452[_0xa1bf('0x39')]){var _0x43d231={'id':_0xeea452['id'],'tls':{'rejectUnauthorized':![]}};if(_0xeea452[_0xa1bf('0x39')]['service']){_0x43d231[_0xa1bf('0x76')]=_0xeea452[_0xa1bf('0x39')][_0xa1bf('0x76')];}else{_0x43d231['host']=_0xeea452[_0xa1bf('0x39')][_0xa1bf('0x74')];_0x43d231[_0xa1bf('0x75')]=_0xeea452[_0xa1bf('0x39')][_0xa1bf('0x75')];_0x43d231[_0xa1bf('0xa4')]=_0xeea452[_0xa1bf('0x39')][_0xa1bf('0xa4')];}if(_0xeea452[_0xa1bf('0x39')][_0xa1bf('0x73')]){_0x43d231[_0xa1bf('0xa5')]={'user':_0xeea452[_0xa1bf('0x39')][_0xa1bf('0x6f')],'pass':_0xeea452[_0xa1bf('0x39')][_0xa1bf('0xa3')]};}return respondWithRpcPromise('VerifySmtp',_0xa1bf('0xae'),{'account':_0x43d231});}})[_0xa1bf('0x31')](respondWithResult(_0x373718,null))['catch'](handleError(_0x373718,null));};exports['destroy']=function(_0x46ff41,_0x22d21f){return db[_0xa1bf('0x3d')][_0xa1bf('0x5a')]({'where':{'id':_0x46ff41[_0xa1bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x22d21f,null))['then'](function(_0x5e78e0){if(_0x5e78e0&&_0x5e78e0[_0xa1bf('0x76')]){throw new db[(_0xa1bf('0xaf'))][(_0xa1bf('0xb0'))](_0xa1bf('0xb1'));}return _0x5e78e0;})[_0xa1bf('0x31')](removeEntity(_0x22d21f,null))[_0xa1bf('0x26')](handleError(_0x22d21f,null));};exports[_0xa1bf('0xb2')]=function(_0x57a9d1,_0x41670c,_0x5a0fd1){return db[_0xa1bf('0x3d')][_0xa1bf('0x5a')]({'where':{'id':_0x57a9d1[_0xa1bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x41670c,null))[_0xa1bf('0x31')](function(_0x465252){if(_0x465252){return _0x465252[_0xa1bf('0xb2')](_0x57a9d1[_0xa1bf('0x5c')][_0xa1bf('0x64')],_[_0xa1bf('0x84')](_0x57a9d1[_0xa1bf('0x5c')],[_0xa1bf('0x64'),'id'])||{})[_0xa1bf('0xb3')](function(_0x1cc9a7){for(var _0x584df8=0x0;_0x584df8<_0x57a9d1['body'][_0xa1bf('0x64')][_0xa1bf('0x47')];_0x584df8+=0x1){socket[_0xa1bf('0xb4')](_0xa1bf('0xb5'),{'UserId':Number(_0x57a9d1['body']['ids'][_0x584df8]),'MailAccountId':Number(_0x57a9d1[_0xa1bf('0x56')]['id'])});}return _0x1cc9a7;});}})[_0xa1bf('0x31')](respondWithResult(_0x41670c,null))['catch'](handleError(_0x41670c,null));};exports[_0xa1bf('0xb6')]=function(_0x61b71,_0xe13482,_0x503c91){return db[_0xa1bf('0x3d')]['find']({'where':{'id':_0x61b71[_0xa1bf('0x56')]['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0xe13482,null))[_0xa1bf('0x31')](function(_0x3e02d8){if(_0x3e02d8){return _0x3e02d8[_0xa1bf('0xb6')](_0x61b71[_0xa1bf('0x43')][_0xa1bf('0x64')])[_0xa1bf('0x31')](function(){if(_['isArray'](_0x61b71[_0xa1bf('0x43')][_0xa1bf('0x64')])){for(var _0x4183d3=0x0;_0x4183d3<_0x61b71['query']['ids'][_0xa1bf('0x47')];_0x4183d3+=0x1){socket[_0xa1bf('0xb4')](_0xa1bf('0xb7'),{'UserId':Number(_0x61b71[_0xa1bf('0x43')][_0xa1bf('0x64')][_0x4183d3]),'MailAccountId':Number(_0x61b71[_0xa1bf('0x56')]['id'])});}}else{socket[_0xa1bf('0xb4')](_0xa1bf('0xb7'),{'UserId':Number(_0x61b71[_0xa1bf('0x43')][_0xa1bf('0x64')]),'MailAccountId':Number(_0x61b71[_0xa1bf('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0xe13482,null))[_0xa1bf('0x26')](handleError(_0xe13482,null));};exports['getAgents']=function(_0x1c40c0,_0x49c1cc,_0x2cac3b){var _0x36b725={};var _0x23f0fb={};var _0x4becc6;var _0x16630c;return db['MailAccount'][_0xa1bf('0x68')]({'where':{'id':_0x1c40c0['params']['id']}})[_0xa1bf('0x31')](handleEntityNotFound(_0x49c1cc,null))[_0xa1bf('0x31')](function(_0x5f0905){if(_0x5f0905){_0x4becc6=_0x5f0905;_0x23f0fb[_0xa1bf('0x41')]=_[_0xa1bf('0x58')](db['User'][_0xa1bf('0x59')]);_0x23f0fb['query']=_[_0xa1bf('0x58')](_0x1c40c0[_0xa1bf('0x43')]);_0x23f0fb[_0xa1bf('0x4d')]=_[_0xa1bf('0x44')](_0x23f0fb['model'],_0x23f0fb['query']);_0x36b725[_0xa1bf('0x46')]=_[_0xa1bf('0x44')](_0x23f0fb['model'],qs['fields'](_0x1c40c0[_0xa1bf('0x43')]['fields']));_0x36b725[_0xa1bf('0x46')]=_0x36b725[_0xa1bf('0x46')]['length']?_0x36b725[_0xa1bf('0x46')]:_0x23f0fb[_0xa1bf('0x41')];_0x36b725[_0xa1bf('0x4b')]=qs[_0xa1bf('0x4c')](_0x1c40c0['query'][_0xa1bf('0x4c')]);_0x36b725[_0xa1bf('0x4f')]=qs[_0xa1bf('0x4d')](_[_0xa1bf('0x4e')](_0x1c40c0['query'],_0x23f0fb['filters']));if(_0x1c40c0[_0xa1bf('0x43')]['filter']){_0x36b725['where']=_[_0xa1bf('0x51')](_0x36b725[_0xa1bf('0x4f')],{'$or':_[_0xa1bf('0x3c')](_0x36b725[_0xa1bf('0x46')],function(_0x11b0d9){var _0x1abe25={};_0x1abe25[_0x11b0d9]={'$like':'%'+_0x1c40c0[_0xa1bf('0x43')][_0xa1bf('0x50')]+'%'};return _0x1abe25;})});}_0x36b725=_[_0xa1bf('0x51')]({},_0x36b725,_0x1c40c0[_0xa1bf('0x52')]);return _0x4becc6[_0xa1bf('0xb8')](_0x36b725);}})['then'](function(_0x16c812){if(_0x16c812){_0x16630c=_0x16c812[_0xa1bf('0x47')];if(!_0x1c40c0['query'][_0xa1bf('0x48')](_0xa1bf('0x49'))){_0x36b725[_0xa1bf('0x4a')]=qs[_0xa1bf('0x4a')](_0x1c40c0[_0xa1bf('0x43')][_0xa1bf('0x4a')]);_0x36b725['offset']=qs[_0xa1bf('0x2c')](_0x1c40c0['query'][_0xa1bf('0x2c')]);}return _0x4becc6[_0xa1bf('0xb8')](_0x36b725);}})['then'](function(_0x45d9f4){if(_0x45d9f4){return _0x45d9f4?{'count':_0x16630c,'rows':_0x45d9f4}:null;}})[_0xa1bf('0x31')](respondWithResult(_0x49c1cc,null))[_0xa1bf('0x26')](handleError(_0x49c1cc,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index c34dbab..24f68ac 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 _0x0b97=['exports','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x16b614,_0x236729){var _0x5657=function(_0x208e98){while(--_0x208e98){_0x16b614['push'](_0x16b614['shift']());}};_0x5657(++_0x236729);}(_0x0b97,0xf4));var _0x70b9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0b97[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x70b9('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x70b9('0x1')](0x0);var events={'afterCreate':_0x70b9('0x2'),'afterUpdate':_0x70b9('0x3'),'afterDestroy':_0x70b9('0x4')};function emitEvent(_0x44409b){return function(_0x1d6635,_0x185643,_0x5930bf){MailAccountEvents[_0x70b9('0x5')](_0x44409b+':'+_0x1d6635['id'],_0x1d6635);MailAccountEvents[_0x70b9('0x5')](_0x44409b,_0x1d6635);_0x5930bf(null);};}for(var e in events){if(events[_0x70b9('0x6')](e)){var event=events[e];MailAccount[_0x70b9('0x7')](e,emitEvent(event));}}module[_0x70b9('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xbcba=['events','../../mysqldb','MailAccount','update','emit','exports'];(function(_0x4e84d3,_0x1add05){var _0x1a0df6=function(_0x7c5212){while(--_0x7c5212){_0x4e84d3['push'](_0x4e84d3['shift']());}};_0x1a0df6(++_0x1add05);}(_0xbcba,0x198));var _0xabcb=function(_0x67ee2,_0x46cae5){_0x67ee2=_0x67ee2-0x0;var _0x1dc091=_0xbcba[_0x67ee2];return _0x1dc091;};'use strict';var EventEmitter=require(_0xabcb('0x0'));var MailAccount=require(_0xabcb('0x1'))['db'][_0xabcb('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xabcb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4025be){return function(_0x473eb8,_0x481ed8,_0x1e0568){MailAccountEvents[_0xabcb('0x4')](_0x4025be+':'+_0x473eb8['id'],_0x473eb8);MailAccountEvents[_0xabcb('0x4')](_0x4025be,_0x473eb8);_0x1e0568(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xabcb('0x5')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index c95b7ef..2866b53 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 _0xebd8=['api','moment','bluebird','request-promise','rimraf','./mailAccount.attributes','define','MailAccount','mail_accounts','lodash'];(function(_0xc5b783,_0x21ca5f){var _0xe90117=function(_0x380700){while(--_0x380700){_0xc5b783['push'](_0xc5b783['shift']());}};_0xe90117(++_0x21ca5f);}(_0xebd8,0x1ad));var _0x8ebd=function(_0x5c4c57,_0x14d594){_0x5c4c57=_0x5c4c57-0x0;var _0x113f33=_0xebd8[_0x5c4c57];return _0x113f33;};'use strict';var _=require(_0x8ebd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8ebd('0x1'));var moment=require(_0x8ebd('0x2'));var BPromise=require(_0x8ebd('0x3'));var rp=require(_0x8ebd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ebd('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ebd('0x6'));module['exports']=function(_0x1dc56a,_0x13d1ef){return _0x1dc56a[_0x8ebd('0x7')](_0x8ebd('0x8'),attributes,{'tableName':_0x8ebd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7dc5=['mail_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes','exports','define'];(function(_0x1bc2d6,_0x1257d3){var _0x559744=function(_0x537bad){while(--_0x537bad){_0x1bc2d6['push'](_0x1bc2d6['shift']());}};_0x559744(++_0x1257d3);}(_0x7dc5,0xfd));var _0x57dc=function(_0x2991ea,_0x4a0231){_0x2991ea=_0x2991ea-0x0;var _0x4e1c51=_0x7dc5[_0x2991ea];return _0x4e1c51;};'use strict';var _=require(_0x57dc('0x0'));var util=require('util');var logger=require(_0x57dc('0x1'))(_0x57dc('0x2'));var moment=require(_0x57dc('0x3'));var BPromise=require(_0x57dc('0x4'));var rp=require(_0x57dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57dc('0x6'));var config=require(_0x57dc('0x7'));var attributes=require(_0x57dc('0x8'));module[_0x57dc('0x9')]=function(_0x5b5305,_0x433422){return _0x5b5305[_0x57dc('0xa')]('MailAccount',attributes,{'tableName':_0x57dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index f06e06a..186ed4b 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 _0x43e7=['startRouting','Start','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowMailAccount','where','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','MailApplication','Applications','MailServerOut','Smtp','applications','orderBy','priority','asc','autoclose','push','close','*,*,*,*','length','defaults','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','interaction','get','created','MailMessage','attachments','originTo','originCc','ChatWebsiteId','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x43e7,0xce));var _0x743e=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0x43e7[_0x296144];return _0x5329b1;};'use strict';var _=require('lodash');var util=require(_0x743e('0x0'));var moment=require(_0x743e('0x1'));var BPromise=require(_0x743e('0x2'));var rs=require(_0x743e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x743e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x743e('0x5'));var config=require(_0x743e('0x6'));var jayson=require(_0x743e('0x7'));var client=jayson['client'][_0x743e('0x8')]({'port':0x232c});config[_0x743e('0x9')]=_['defaults'](config[_0x743e('0x9')],{'host':_0x743e('0xa'),'port':0x18eb});var socket=require(_0x743e('0xb'))(new Redis(config[_0x743e('0x9')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x35e402,_0x1b022c,_0x43a51a){return new BPromise(function(_0x32914f,_0x10a0b8){return client[_0x743e('0xc')](_0x35e402,_0x43a51a)[_0x743e('0xd')](function(_0x4bd58e){logger['info'](_0x743e('0xe'),_0x1b022c,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x1b022c,_0x743e('0xf'),JSON[_0x743e('0x10')](_0x4bd58e));if(_0x4bd58e[_0x743e('0x11')]){if(_0x4bd58e[_0x743e('0x11')][_0x743e('0x12')]===0x1f4){logger[_0x743e('0x11')]('MailAccount,\x20%s,\x20%s',_0x1b022c,_0x4bd58e[_0x743e('0x11')][_0x743e('0x13')]);return _0x10a0b8(_0x4bd58e[_0x743e('0x11')][_0x743e('0x13')]);}logger[_0x743e('0x11')](_0x743e('0xe'),_0x1b022c,_0x4bd58e[_0x743e('0x11')][_0x743e('0x13')]);return _0x32914f(_0x4bd58e['error'][_0x743e('0x13')]);}else{logger[_0x743e('0x14')]('MailAccount,\x20%s,\x20%s',_0x1b022c,'request\x20sent');_0x32914f(_0x4bd58e[_0x743e('0x15')][_0x743e('0x13')]);}})[_0x743e('0x16')](function(_0x1e95da){logger[_0x743e('0x11')](_0x743e('0xe'),_0x1b022c,_0x1e95da);_0x10a0b8(_0x1e95da);});});}exports[_0x743e('0x17')]=function(_0x5f24e3){var _0x53f104=this;return new Promise(function(_0x1394e1,_0x174389){return db[_0x743e('0x18')][_0x743e('0x19')]({'raw':_0x5f24e3[_0x743e('0x1a')]?_0x5f24e3[_0x743e('0x1a')][_0x743e('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f24e3[_0x743e('0x1a')]?_0x5f24e3[_0x743e('0x1a')]['where']||null:null,'attributes':_0x5f24e3[_0x743e('0x1a')]?_0x5f24e3['options'][_0x743e('0x1c')]||null:null,'limit':_0x5f24e3['options']?_0x5f24e3[_0x743e('0x1a')][_0x743e('0x1d')]||null:null,'include':_0x5f24e3[_0x743e('0x1a')]?_0x5f24e3[_0x743e('0x1a')][_0x743e('0x1e')]?_[_0x743e('0x1f')](_0x5f24e3['options'][_0x743e('0x1e')],function(_0x38eb48){return{'model':db[_0x38eb48['model']],'as':_0x38eb48['as'],'attributes':_0x38eb48['attributes'],'include':_0x38eb48[_0x743e('0x1e')]?_['map'](_0x38eb48['include'],function(_0xa3ea50){return{'model':db[_0xa3ea50[_0x743e('0x20')]],'as':_0xa3ea50['as'],'attributes':_0xa3ea50[_0x743e('0x1c')],'include':_0xa3ea50['include']?_['map'](_0xa3ea50[_0x743e('0x1e')],function(_0x81748b){return{'model':db[_0x81748b[_0x743e('0x20')]],'as':_0x81748b['as'],'attributes':_0x81748b[_0x743e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e2be0){logger[_0x743e('0x14')](_0x743e('0x17'),_0x5f24e3);logger[_0x743e('0x21')](_0x743e('0x17'),_0x5f24e3,JSON['stringify'](_0x1e2be0));_0x1394e1(_0x1e2be0);})['catch'](function(_0xf62705){logger['error']('GetMailAccount',_0xf62705['message'],_0x5f24e3);_0x174389(_0x53f104[_0x743e('0x11')](0x1f4,_0xf62705[_0x743e('0x13')]));});});};exports[_0x743e('0x22')]=function(_0x491f6e){var _0x2406f5=this;return new Promise(function(_0x19c297,_0x204e99){return db[_0x743e('0x18')]['find']({'raw':_0x491f6e['options']?_0x491f6e[_0x743e('0x1a')][_0x743e('0x1b')]===undefined?!![]:![]:!![],'where':_0x491f6e[_0x743e('0x1a')]?_0x491f6e[_0x743e('0x1a')][_0x743e('0x23')]||null:null,'attributes':_0x491f6e['options']?_0x491f6e['options'][_0x743e('0x1c')]||null:null,'include':_0x491f6e[_0x743e('0x1a')]?_0x491f6e['options'][_0x743e('0x1e')]?_[_0x743e('0x1f')](_0x491f6e[_0x743e('0x1a')][_0x743e('0x1e')],function(_0x4c427e){return{'model':db[_0x4c427e[_0x743e('0x20')]],'as':_0x4c427e['as'],'attributes':_0x4c427e[_0x743e('0x1c')],'include':_0x4c427e[_0x743e('0x1e')]?_[_0x743e('0x1f')](_0x4c427e[_0x743e('0x1e')],function(_0x7aa432){return{'model':db[_0x7aa432[_0x743e('0x20')]],'as':_0x7aa432['as'],'attributes':_0x7aa432[_0x743e('0x1c')],'include':_0x7aa432[_0x743e('0x1e')]?_[_0x743e('0x1f')](_0x7aa432[_0x743e('0x1e')],function(_0x2c8528){return{'model':db[_0x2c8528[_0x743e('0x20')]],'as':_0x2c8528['as'],'attributes':_0x2c8528['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x112f08){logger['info'](_0x743e('0x22'),_0x491f6e);logger[_0x743e('0x21')]('ShowMailAccount',_0x491f6e,JSON['stringify'](_0x112f08));_0x19c297(_0x112f08);})['catch'](function(_0x1c3b66){logger[_0x743e('0x11')](_0x743e('0x22'),_0x1c3b66[_0x743e('0x13')],_0x491f6e);_0x204e99(_0x2406f5[_0x743e('0x11')](0x1f4,_0x1c3b66['message']));});});};exports['NotifyMailAccount']=function(_0x326a50){var _0x280b5e=this;return new Promise(function(_0x4d8489,_0x59a530){var _0x48d0f9={'body':_0x326a50[_0x743e('0x24')],'channel':_0x743e('0x25')};var _0x536d5e=_[_0x743e('0x26')](_[_0x743e('0x27')](db[_0x743e('0x28')][_0x743e('0x29')]),[_0x743e('0x2a'),_0x743e('0x2b'),_0x743e('0x2c'),_0x743e('0x2d')]);var _0x90b320=![];if(_0x326a50[_0x743e('0x24')]['id']){delete _0x326a50[_0x743e('0x24')]['id'];}if(_['isNil'](_0x326a50[_0x743e('0x24')][_0x743e('0x2e')])){return _0x59a530(_0x280b5e['error'](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x326a50[_0x743e('0x24')]['body'])||_0x326a50['body'][_0x743e('0x24')]===''){return _0x59a530(_0x280b5e[_0x743e('0x11')](0x1f4,_0x743e('0x2f')));}if(_[_0x743e('0x30')](_0x326a50[_0x743e('0x24')][_0x743e('0x31')])){return _0x59a530(_0x280b5e['error'](0x1f4,_0x743e('0x32')+_0x536d5e));}if(!_[_0x743e('0x33')](_0x536d5e,_0x326a50[_0x743e('0x24')][_0x743e('0x31')])){return _0x59a530(_0x280b5e['error'](0x1f4,_0x743e('0x34')+_0x536d5e));}var _0x21ce47={};_0x21ce47[_0x326a50[_0x743e('0x24')]['mapKey']]=_0x326a50[_0x743e('0x24')][_0x743e('0x2e')];return db[_0x743e('0x18')][_0x743e('0x35')]({'where':{'id':_0x326a50[_0x743e('0x36')]['id']},'include':[{'model':db['CmList'],'as':_0x743e('0x37'),'include':[{'model':db[_0x743e('0x28')],'as':_0x743e('0x38'),'where':_0x21ce47,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x743e('0x39')],'as':_0x743e('0x3a')},{'model':db[_0x743e('0x3b')],'as':_0x743e('0x3c')}]})[_0x743e('0xd')](function(_0x8545f6){if(_0x8545f6&&_0x8545f6[_0x743e('0x37')]){var _0x1aacdd=_0x8545f6['get']({'plain':!![]});_0x48d0f9[_0x743e('0x36')]=_['omit'](_0x1aacdd,['Applications',_0x743e('0x37')]);_0x48d0f9[_0x743e('0x3d')]=_0x1aacdd['Applications'];_0x48d0f9['list']=_0x1aacdd['List'];_0x48d0f9['applications']=_[_0x743e('0x3e')](_0x48d0f9[_0x743e('0x3d')],[_0x743e('0x3f')],[_0x743e('0x40')]);if(_0x48d0f9['account']&&_0x48d0f9[_0x743e('0x36')][_0x743e('0x41')]){_0x48d0f9[_0x743e('0x3d')][_0x743e('0x42')]({'id':0x0,'priority':_0x48d0f9[_0x743e('0x3d')]['length']+0x1,'app':_0x743e('0x43'),'appdata':'autoclose','interval':_0x743e('0x44')});}if(_0x48d0f9['account']['Applications']){delete _0x48d0f9['account'][_0x743e('0x3a')];}if(_0x48d0f9[_0x743e('0x36')][_0x743e('0x37')]){delete _0x48d0f9['account'][_0x743e('0x37')];}if(_0x1aacdd['List'][_0x743e('0x38')][_0x743e('0x45')]){return _0x1aacdd[_0x743e('0x37')][_0x743e('0x38')][0x0];}var _0x4a1883=_[_0x743e('0x46')](_0x326a50[_0x743e('0x24')],{'firstName':_0x326a50[_0x743e('0x24')][_0x743e('0x2e')],'ListId':_0x1aacdd['ListId']});_0x4a1883[_0x326a50[_0x743e('0x24')][_0x743e('0x31')]]=_0x326a50[_0x743e('0x24')][_0x743e('0x2e')];return db[_0x743e('0x28')]['create'](_0x4a1883);}else{throw new Error(_0x743e('0x47'));}})[_0x743e('0xd')](function(_0x17e144){_0x48d0f9[_0x743e('0x48')]=_0x17e144;if(_0x17e144){if(!_0x326a50[_0x743e('0x24')][_0x743e('0x13')]['messageId']){_0x326a50[_0x743e('0x24')][_0x743e('0x13')][_0x743e('0x49')]=rs['generate']()+'\x20'+_0x326a50[_0x743e('0x24')][_0x743e('0x13')][_0x743e('0x2e')];}var _0x50b1c7={'ContactId':_0x17e144['id'],'MailAccountId':_0x326a50[_0x743e('0x36')]['id'],'inReplyTo':_0x326a50['body'][_0x743e('0x13')]['messageId'],'to':_0x326a50[_0x743e('0x24')]['message']['from'],'cc':_0x326a50[_0x743e('0x24')][_0x743e('0x13')]['cc'],'subject':_0x326a50['body'][_0x743e('0x13')][_0x743e('0x4a')],'attach':_0x326a50[_0x743e('0x24')][_0x743e('0x13')][_0x743e('0x4b')],'lastMsgAt':moment()[_0x743e('0x4c')](_0x743e('0x4d')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x743e('0x35')]({'where':{'closed':![],'MailAccountId':_0x326a50[_0x743e('0x36')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x326a50[_0x743e('0x24')][_0x743e('0x13')][_0x743e('0x4e')]}}]})[_0x743e('0xd')](function(_0x5e018d){if(_0x5e018d){return[_0x5e018d,![]];}return db[_0x743e('0x4f')][_0x743e('0x50')](_0x50b1c7)['then'](function(_0x52ccc2){return[_0x52ccc2,!![]];});});}else{throw new Error(_0x743e('0x51'));}})[_0x743e('0x52')](function(_0x4b8222,_0x1ccee3){if(_0x4b8222){_0x90b320=_0x1ccee3;if(!_0x1ccee3){return _0x4b8222[_0x743e('0x53')]({'inReplyTo':_0x326a50[_0x743e('0x24')]['message'][_0x743e('0x49')],'to':_0x326a50['body'][_0x743e('0x13')][_0x743e('0x2e')],'cc':_0x326a50[_0x743e('0x24')][_0x743e('0x13')]['cc'],'subject':_0x326a50[_0x743e('0x24')][_0x743e('0x13')]['subject'],'attach':_0x4b8222['attach']?_0x4b8222['attach']:_0x326a50[_0x743e('0x24')][_0x743e('0x13')]['attach'],'substatus':null,'substatusAt':moment()[_0x743e('0x4c')](_0x743e('0x4d')),'lastMsgAt':moment()[_0x743e('0x4c')](_0x743e('0x4d')),'lastMsgDirection':'in'});}else{return _0x4b8222;}}})[_0x743e('0xd')](function(_0x2f7049){_0x48d0f9[_0x743e('0x54')]=_0x2f7049[_0x743e('0x55')]({'plain':!![]});_0x48d0f9[_0x743e('0x54')][_0x743e('0x56')]=_0x90b320;return db[_0x743e('0x57')][_0x743e('0x50')]({'body':_0x326a50['body'][_0x743e('0x24')],'MailAccountId':_0x326a50[_0x743e('0x36')]['id'],'MailInteractionId':_0x2f7049['id'],'direction':'in','ContactId':_0x48d0f9[_0x743e('0x48')]['id'],'messageId':_0x326a50[_0x743e('0x24')]['message'][_0x743e('0x49')],'from':_0x326a50[_0x743e('0x24')][_0x743e('0x13')][_0x743e('0x2e')],'to':_0x326a50[_0x743e('0x24')][_0x743e('0x13')]['to'],'cc':_0x326a50[_0x743e('0x24')][_0x743e('0x13')]['cc'],'subject':_0x326a50[_0x743e('0x24')][_0x743e('0x13')][_0x743e('0x4a')],'attach':_0x326a50['body'][_0x743e('0x13')][_0x743e('0x4b')],'Attachments':_0x326a50[_0x743e('0x24')][_0x743e('0x13')][_0x743e('0x58')],'originTo':_0x326a50[_0x743e('0x24')]['message'][_0x743e('0x59')],'originCc':_0x326a50[_0x743e('0x24')][_0x743e('0x13')][_0x743e('0x5a')],'bcc':_0x326a50['body'][_0x743e('0x13')]['bcc'],'ChatWebsiteId':_0x326a50[_0x743e('0x24')]['message'][_0x743e('0x5b')]||null,'originChannel':_0x326a50[_0x743e('0x24')][_0x743e('0x13')]['originChannel']||'Email','ChatOfflineMessageId':_0x326a50[_0x743e('0x24')][_0x743e('0x13')][_0x743e('0x5c')]||null},{'include':[{'model':db[_0x743e('0x5d')],'as':'Attachments'}]});})[_0x743e('0xd')](function(_0x397653){_0x48d0f9[_0x743e('0x13')]=_0x397653;if(_0x48d0f9[_0x743e('0x54')][_0x743e('0x5e')]){return db[_0x743e('0x5f')][_0x743e('0x35')]({'attributes':['id',_0x743e('0x60')],'where':{'id':_0x48d0f9[_0x743e('0x54')]['UserId']}})[_0x743e('0xd')](function(_0x4acb41){if(_0x4acb41){_0x48d0f9[_0x743e('0x3d')][_0x743e('0x61')]({'id':0x0,'priority':0x0,'app':_0x743e('0x62'),'appdata':_0x4acb41['name']+','+(_0x48d0f9[_0x743e('0x36')][_0x743e('0x63')]||0xa),'interval':_0x743e('0x44')});}return respondWithRpcPromise('Start',_0x743e('0x64'),_0x48d0f9);});}return respondWithRpcPromise(_0x743e('0x65'),_0x743e('0x64'),_0x48d0f9);})[_0x743e('0xd')](function(_0x3f170d){_0x4d8489(_0x3f170d);})[_0x743e('0x16')](function(_0x57c0ad){_0x59a530(_0x280b5e[_0x743e('0x11')](0x1f4,_0x57c0ad[_0x743e('0x13')]));});});}; \ No newline at end of file +var _0x08d9=['orderBy','priority','asc','autoclose','*,*,*,*','Contacts','length','create','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','MailInteraction','spread','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','User','UserId','unshift','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','MailAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','GetMailAccount','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','List','CmContact','MailApplication','Applications','MailServerOut','get','omit','list','applications'];(function(_0x2980de,_0x1426a4){var _0x81a4ca=function(_0x19040e){while(--_0x19040e){_0x2980de['push'](_0x2980de['shift']());}};_0x81a4ca(++_0x1426a4);}(_0x08d9,0x163));var _0x908d=function(_0x19c75b,_0x1c5a1d){_0x19c75b=_0x19c75b-0x0;var _0x4ad109=_0x08d9[_0x19c75b];return _0x4ad109;};'use strict';var _=require(_0x908d('0x0'));var util=require(_0x908d('0x1'));var moment=require(_0x908d('0x2'));var BPromise=require(_0x908d('0x3'));var rs=require(_0x908d('0x4'));var fs=require('fs');var Redis=require(_0x908d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x908d('0x6'));var logger=require(_0x908d('0x7'))(_0x908d('0x8'));var config=require(_0x908d('0x9'));var jayson=require(_0x908d('0xa'));var client=jayson[_0x908d('0xb')][_0x908d('0xc')]({'port':0x232c});config[_0x908d('0xd')]=_[_0x908d('0xe')](config[_0x908d('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x908d('0xf'))(new Redis(config[_0x908d('0xd')]));require(_0x908d('0x10'))[_0x908d('0x11')](socket);function respondWithRpcPromise(_0x5abb6c,_0x50d707,_0x592da1){return new BPromise(function(_0xd6dc4f,_0x2f91b2){return client[_0x908d('0x12')](_0x5abb6c,_0x592da1)[_0x908d('0x13')](function(_0xec11c5){logger[_0x908d('0x14')](_0x908d('0x15'),_0x50d707,_0x908d('0x16'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x50d707,_0x908d('0x16'),JSON[_0x908d('0x17')](_0xec11c5));if(_0xec11c5[_0x908d('0x18')]){if(_0xec11c5[_0x908d('0x18')]['code']===0x1f4){logger[_0x908d('0x18')](_0x908d('0x15'),_0x50d707,_0xec11c5['error'][_0x908d('0x19')]);return _0x2f91b2(_0xec11c5['error'][_0x908d('0x19')]);}logger[_0x908d('0x18')](_0x908d('0x15'),_0x50d707,_0xec11c5[_0x908d('0x18')][_0x908d('0x19')]);return _0xd6dc4f(_0xec11c5[_0x908d('0x18')][_0x908d('0x19')]);}else{logger[_0x908d('0x14')]('MailAccount,\x20%s,\x20%s',_0x50d707,_0x908d('0x16'));_0xd6dc4f(_0xec11c5[_0x908d('0x1a')][_0x908d('0x19')]);}})[_0x908d('0x1b')](function(_0x32446f){logger[_0x908d('0x18')](_0x908d('0x15'),_0x50d707,_0x32446f);_0x2f91b2(_0x32446f);});});}exports['GetMailAccount']=function(_0x221fc9){var _0x3929be=this;return new Promise(function(_0x6aeb38,_0x2b6b87){return db[_0x908d('0x1c')][_0x908d('0x1d')]({'raw':_0x221fc9[_0x908d('0x1e')]?_0x221fc9[_0x908d('0x1e')][_0x908d('0x1f')]===undefined?!![]:![]:!![],'where':_0x221fc9[_0x908d('0x1e')]?_0x221fc9[_0x908d('0x1e')][_0x908d('0x20')]||null:null,'attributes':_0x221fc9[_0x908d('0x1e')]?_0x221fc9[_0x908d('0x1e')][_0x908d('0x21')]||null:null,'limit':_0x221fc9['options']?_0x221fc9[_0x908d('0x1e')][_0x908d('0x22')]||null:null,'include':_0x221fc9[_0x908d('0x1e')]?_0x221fc9[_0x908d('0x1e')]['include']?_[_0x908d('0x23')](_0x221fc9[_0x908d('0x1e')][_0x908d('0x24')],function(_0xbdf9eb){return{'model':db[_0xbdf9eb['model']],'as':_0xbdf9eb['as'],'attributes':_0xbdf9eb[_0x908d('0x21')],'include':_0xbdf9eb['include']?_[_0x908d('0x23')](_0xbdf9eb[_0x908d('0x24')],function(_0xeacaf6){return{'model':db[_0xeacaf6[_0x908d('0x25')]],'as':_0xeacaf6['as'],'attributes':_0xeacaf6[_0x908d('0x21')],'include':_0xeacaf6[_0x908d('0x24')]?_[_0x908d('0x23')](_0xeacaf6['include'],function(_0x467d6c){return{'model':db[_0x467d6c['model']],'as':_0x467d6c['as'],'attributes':_0x467d6c[_0x908d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x908d('0x13')](function(_0x4cfc2){logger['info']('GetMailAccount',_0x221fc9);logger[_0x908d('0x26')](_0x908d('0x27'),_0x221fc9,JSON['stringify'](_0x4cfc2));_0x6aeb38(_0x4cfc2);})[_0x908d('0x1b')](function(_0x40109b){logger['error']('GetMailAccount',_0x40109b[_0x908d('0x19')],_0x221fc9);_0x2b6b87(_0x3929be['error'](0x1f4,_0x40109b[_0x908d('0x19')]));});});};exports[_0x908d('0x28')]=function(_0x249ae0){var _0x4771a4=this;return new Promise(function(_0x59ae95,_0x5a651b){return db[_0x908d('0x1c')][_0x908d('0x29')]({'raw':_0x249ae0[_0x908d('0x1e')]?_0x249ae0['options'][_0x908d('0x1f')]===undefined?!![]:![]:!![],'where':_0x249ae0[_0x908d('0x1e')]?_0x249ae0[_0x908d('0x1e')][_0x908d('0x20')]||null:null,'attributes':_0x249ae0[_0x908d('0x1e')]?_0x249ae0[_0x908d('0x1e')][_0x908d('0x21')]||null:null,'include':_0x249ae0[_0x908d('0x1e')]?_0x249ae0['options']['include']?_[_0x908d('0x23')](_0x249ae0[_0x908d('0x1e')][_0x908d('0x24')],function(_0x3d3f9f){return{'model':db[_0x3d3f9f['model']],'as':_0x3d3f9f['as'],'attributes':_0x3d3f9f[_0x908d('0x21')],'include':_0x3d3f9f['include']?_[_0x908d('0x23')](_0x3d3f9f['include'],function(_0x20751a){return{'model':db[_0x20751a[_0x908d('0x25')]],'as':_0x20751a['as'],'attributes':_0x20751a[_0x908d('0x21')],'include':_0x20751a[_0x908d('0x24')]?_[_0x908d('0x23')](_0x20751a[_0x908d('0x24')],function(_0x3c1008){return{'model':db[_0x3c1008[_0x908d('0x25')]],'as':_0x3c1008['as'],'attributes':_0x3c1008[_0x908d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x908d('0x13')](function(_0x47964a){logger[_0x908d('0x14')](_0x908d('0x28'),_0x249ae0);logger[_0x908d('0x26')]('ShowMailAccount',_0x249ae0,JSON[_0x908d('0x17')](_0x47964a));_0x59ae95(_0x47964a);})[_0x908d('0x1b')](function(_0x4c4049){logger[_0x908d('0x18')](_0x908d('0x28'),_0x4c4049[_0x908d('0x19')],_0x249ae0);_0x5a651b(_0x4771a4[_0x908d('0x18')](0x1f4,_0x4c4049[_0x908d('0x19')]));});});};exports[_0x908d('0x2a')]=function(_0x340a12){var _0xed879f=this;return new Promise(function(_0x74870b,_0x21be2d){var _0xa17e5e={'body':_0x340a12[_0x908d('0x2b')],'channel':_0x908d('0x2c')};var _0x26f8a0=_[_0x908d('0x2d')](_[_0x908d('0x2e')](db['CmContact'][_0x908d('0x2f')]),[_0x908d('0x30'),_0x908d('0x31'),_0x908d('0x32'),_0x908d('0x33')]);var _0x551d42=![];if(_0x340a12[_0x908d('0x2b')]['id']){delete _0x340a12['body']['id'];}if(_['isNil'](_0x340a12['body']['from'])){return _0x21be2d(_0xed879f[_0x908d('0x18')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x340a12[_0x908d('0x2b')][_0x908d('0x2b')])||_0x340a12['body'][_0x908d('0x2b')]===''){return _0x21be2d(_0xed879f['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x908d('0x34')](_0x340a12[_0x908d('0x2b')][_0x908d('0x35')])){return _0x21be2d(_0xed879f[_0x908d('0x18')](0x1f4,_0x908d('0x36')+_0x26f8a0));}if(!_[_0x908d('0x37')](_0x26f8a0,_0x340a12[_0x908d('0x2b')][_0x908d('0x35')])){return _0x21be2d(_0xed879f[_0x908d('0x18')](0x1f4,_0x908d('0x38')+_0x26f8a0));}var _0x55cee8={};_0x55cee8[_0x340a12['body'][_0x908d('0x35')]]=_0x340a12['body'][_0x908d('0x39')];return db[_0x908d('0x1c')][_0x908d('0x29')]({'where':{'id':_0x340a12[_0x908d('0x3a')]['id']},'include':[{'model':db[_0x908d('0x3b')],'as':_0x908d('0x3c'),'include':[{'model':db[_0x908d('0x3d')],'as':'Contacts','where':_0x55cee8,'limit':0x1,'order':[[_0x908d('0x31'),'DESC']]}]},{'model':db[_0x908d('0x3e')],'as':_0x908d('0x3f')},{'model':db[_0x908d('0x40')],'as':'Smtp'}]})[_0x908d('0x13')](function(_0x2ea6bb){if(_0x2ea6bb&&_0x2ea6bb[_0x908d('0x3c')]){var _0x359c7c=_0x2ea6bb[_0x908d('0x41')]({'plain':!![]});_0xa17e5e['account']=_[_0x908d('0x42')](_0x359c7c,['Applications',_0x908d('0x3c')]);_0xa17e5e['applications']=_0x359c7c['Applications'];_0xa17e5e[_0x908d('0x43')]=_0x359c7c[_0x908d('0x3c')];_0xa17e5e[_0x908d('0x44')]=_[_0x908d('0x45')](_0xa17e5e[_0x908d('0x44')],[_0x908d('0x46')],[_0x908d('0x47')]);if(_0xa17e5e[_0x908d('0x3a')]&&_0xa17e5e[_0x908d('0x3a')][_0x908d('0x48')]){_0xa17e5e[_0x908d('0x44')]['push']({'id':0x0,'priority':_0xa17e5e['applications']['length']+0x1,'app':'close','appdata':'autoclose','interval':_0x908d('0x49')});}if(_0xa17e5e[_0x908d('0x3a')]['Applications']){delete _0xa17e5e[_0x908d('0x3a')][_0x908d('0x3f')];}if(_0xa17e5e[_0x908d('0x3a')]['List']){delete _0xa17e5e['account'][_0x908d('0x3c')];}if(_0x359c7c['List'][_0x908d('0x4a')][_0x908d('0x4b')]){return _0x359c7c[_0x908d('0x3c')][_0x908d('0x4a')][0x0];}var _0x33071b=_[_0x908d('0xe')](_0x340a12[_0x908d('0x2b')],{'firstName':_0x340a12[_0x908d('0x2b')][_0x908d('0x39')],'ListId':_0x359c7c[_0x908d('0x33')]});_0x33071b[_0x340a12['body'][_0x908d('0x35')]]=_0x340a12[_0x908d('0x2b')][_0x908d('0x39')];return db['CmContact'][_0x908d('0x4c')](_0x33071b);}else{throw new Error(_0x908d('0x4d'));}})[_0x908d('0x13')](function(_0x35fbf1){_0xa17e5e[_0x908d('0x4e')]=_0x35fbf1;if(_0x35fbf1){if(!_0x340a12[_0x908d('0x2b')][_0x908d('0x19')]['messageId']){_0x340a12['body']['message'][_0x908d('0x4f')]=rs[_0x908d('0x50')]()+'\x20'+_0x340a12[_0x908d('0x2b')][_0x908d('0x19')][_0x908d('0x39')];}var _0x50f82d={'ContactId':_0x35fbf1['id'],'MailAccountId':_0x340a12[_0x908d('0x3a')]['id'],'inReplyTo':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')][_0x908d('0x4f')],'to':_0x340a12[_0x908d('0x2b')]['message'][_0x908d('0x39')],'cc':_0x340a12['body'][_0x908d('0x19')]['cc'],'subject':_0x340a12[_0x908d('0x2b')]['message'][_0x908d('0x51')],'attach':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')]['attach'],'lastMsgAt':moment()[_0x908d('0x52')](_0x908d('0x53')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x908d('0x29')]({'where':{'closed':![],'MailAccountId':_0x340a12[_0x908d('0x3a')]['id']},'include':[{'model':db[_0x908d('0x54')],'as':'Messages','attributes':[_0x908d('0x4f')],'where':{'messageId':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')][_0x908d('0x55')]}}]})['then'](function(_0x1e7a37){if(_0x1e7a37){return[_0x1e7a37,![]];}return db[_0x908d('0x56')]['create'](_0x50f82d)[_0x908d('0x13')](function(_0x3ef5de){return[_0x3ef5de,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x908d('0x57')](function(_0x21c090,_0x5c8d00){if(_0x21c090){_0x551d42=_0x5c8d00;if(!_0x5c8d00){return _0x21c090['update']({'inReplyTo':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')][_0x908d('0x4f')],'to':_0x340a12[_0x908d('0x2b')]['message']['from'],'cc':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')]['cc'],'subject':_0x340a12['body'][_0x908d('0x19')][_0x908d('0x51')],'attach':_0x21c090[_0x908d('0x58')]?_0x21c090['attach']:_0x340a12[_0x908d('0x2b')]['message'][_0x908d('0x58')],'substatus':null,'substatusAt':moment()[_0x908d('0x52')](_0x908d('0x53')),'lastMsgAt':moment()['format'](_0x908d('0x53')),'lastMsgDirection':'in'});}else{return _0x21c090;}}})[_0x908d('0x13')](function(_0x5057a9){_0xa17e5e[_0x908d('0x59')]=_0x5057a9[_0x908d('0x41')]({'plain':!![]});_0xa17e5e['interaction'][_0x908d('0x5a')]=_0x551d42;return db['MailMessage'][_0x908d('0x4c')]({'body':_0x340a12[_0x908d('0x2b')][_0x908d('0x2b')],'MailAccountId':_0x340a12[_0x908d('0x3a')]['id'],'MailInteractionId':_0x5057a9['id'],'direction':'in','ContactId':_0xa17e5e[_0x908d('0x4e')]['id'],'messageId':_0x340a12['body']['message']['messageId'],'from':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')][_0x908d('0x39')],'to':_0x340a12[_0x908d('0x2b')]['message']['to'],'cc':_0x340a12['body'][_0x908d('0x19')]['cc'],'subject':_0x340a12['body'][_0x908d('0x19')]['subject'],'attach':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')][_0x908d('0x58')],'Attachments':_0x340a12[_0x908d('0x2b')]['message'][_0x908d('0x5b')],'originTo':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')][_0x908d('0x5c')],'originCc':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')][_0x908d('0x5d')],'bcc':_0x340a12['body'][_0x908d('0x19')][_0x908d('0x5e')],'ChatWebsiteId':_0x340a12['body'][_0x908d('0x19')][_0x908d('0x5f')]||null,'originChannel':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')][_0x908d('0x60')]||_0x908d('0x61'),'ChatOfflineMessageId':_0x340a12[_0x908d('0x2b')][_0x908d('0x19')][_0x908d('0x62')]||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})['then'](function(_0x228d46){_0xa17e5e[_0x908d('0x19')]=_0x228d46;if(_0xa17e5e[_0x908d('0x59')]['UserId']){return db[_0x908d('0x63')][_0x908d('0x29')]({'attributes':['id','name'],'where':{'id':_0xa17e5e[_0x908d('0x59')][_0x908d('0x64')]}})[_0x908d('0x13')](function(_0x3fc490){if(_0x3fc490){_0xa17e5e[_0x908d('0x44')][_0x908d('0x65')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3fc490[_0x908d('0x66')]+','+(_0xa17e5e['account'][_0x908d('0x67')]||0xa),'interval':_0x908d('0x49')});}return respondWithRpcPromise(_0x908d('0x68'),'startRouting',_0xa17e5e);});}return respondWithRpcPromise(_0x908d('0x68'),_0x908d('0x69'),_0xa17e5e);})[_0x908d('0x13')](function(_0x50a5fa){_0x74870b(_0x50a5fa);})[_0x908d('0x1b')](function(_0x4db5d5){_0x21be2d(_0xed879f['error'](0x1f4,_0x4db5d5[_0x908d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 42d8139..a6d73b7 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 _0x251e=['remove','emit','removeListener','register','length','mailAccount:','save'];(function(_0x26eeb2,_0x416eb8){var _0x1c0398=function(_0x592146){while(--_0x592146){_0x26eeb2['push'](_0x26eeb2['shift']());}};_0x1c0398(++_0x416eb8);}(_0x251e,0x102));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xe251('0x0'),_0xe251('0x1'),'update'];function createListener(_0x4a7aed,_0x57c37e){return function(_0x3327ec){_0x57c37e[_0xe251('0x2')](_0x4a7aed,_0x3327ec);};}function removeListener(_0x59ad29,_0x789e29){return function(){MailAccountEvents[_0xe251('0x3')](_0x59ad29,_0x789e29);};}exports[_0xe251('0x4')]=function(_0xd86854){for(var _0x34cb58=0x0,_0x28591d=events[_0xe251('0x5')];_0x34cb58<_0x28591d;_0x34cb58++){var _0x23a5c7=events[_0x34cb58];var _0x351d45=createListener(_0xe251('0x6')+_0x23a5c7,_0xd86854);MailAccountEvents['on'](_0x23a5c7,_0x351d45);}}; \ No newline at end of file +var _0x7618=['mailAccount:','update','emit','register','length'];(function(_0x1c802a,_0x2bcf1b){var _0x221f59=function(_0xa56ad7){while(--_0xa56ad7){_0x1c802a['push'](_0x1c802a['shift']());}};_0x221f59(++_0x2bcf1b);}(_0x7618,0x119));var _0x8761=function(_0x5ea23a,_0x2503a8){_0x5ea23a=_0x5ea23a-0x0;var _0x517037=_0x7618[_0x5ea23a];return _0x517037;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save','remove',_0x8761('0x0')];function createListener(_0xe2e1cd,_0x358a77){return function(_0x59bcd5){_0x358a77[_0x8761('0x1')](_0xe2e1cd,_0x59bcd5);};}function removeListener(_0x4e2425,_0xe96ded){return function(){MailAccountEvents['removeListener'](_0x4e2425,_0xe96ded);};}exports[_0x8761('0x2')]=function(_0x4824b6){for(var _0x22eea5=0x0,_0x1a293c=events[_0x8761('0x3')];_0x22eea5<_0x1a293c;_0x22eea5++){var _0xc5fc17=events[_0x22eea5];var _0x34b055=createListener(_0x8761('0x4')+_0xc5fc17,_0x4824b6);MailAccountEvents['on'](_0xc5fc17,_0x34b055);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 2457fd1..16cf81d 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 _0x5abc=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','delete','destroy'];(function(_0x3f3bad,_0x193f06){var _0x4f0801=function(_0x5cfd32){while(--_0x5cfd32){_0x3f3bad['push'](_0x3f3bad['shift']());}};_0x4f0801(++_0x193f06);}(_0x5abc,0x6d));var _0xc5ab=function(_0x51c358,_0x46246b){_0x51c358=_0x51c358-0x0;var _0x15edc5=_0x5abc[_0x51c358];return _0x15edc5;};'use strict';var multer=require(_0xc5ab('0x0'));var util=require(_0xc5ab('0x1'));var path=require(_0xc5ab('0x2'));var timeout=require(_0xc5ab('0x3'));var express=require(_0xc5ab('0x4'));var router=express[_0xc5ab('0x5')]();var fs_extra=require(_0xc5ab('0x6'));var auth=require(_0xc5ab('0x7'));var interaction=require(_0xc5ab('0x8'));var config=require(_0xc5ab('0x9'));var controller=require(_0xc5ab('0xa'));router['get'](_0xc5ab('0xb'),auth[_0xc5ab('0xc')](),controller[_0xc5ab('0xd')]);router[_0xc5ab('0xe')](_0xc5ab('0xb'),auth[_0xc5ab('0xc')](),controller['update']);router[_0xc5ab('0xf')](_0xc5ab('0xb'),auth[_0xc5ab('0xc')](),controller[_0xc5ab('0x10')]);module[_0xc5ab('0x11')]=router; \ No newline at end of file +var _0x7945=['isAuthenticated','update','delete','exports','multer','util','path','Router','fs-extra','../../config/environment','./mailApplication.controller','/:id'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x7945,0xa0));var _0x5794=function(_0x4ebd42,_0x1e36a0){_0x4ebd42=_0x4ebd42-0x0;var _0x3ef98d=_0x7945[_0x4ebd42];return _0x3ef98d;};'use strict';var multer=require(_0x5794('0x0'));var util=require(_0x5794('0x1'));var path=require(_0x5794('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5794('0x3')]();var fs_extra=require(_0x5794('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5794('0x5'));var controller=require(_0x5794('0x6'));router['get'](_0x5794('0x7'),auth[_0x5794('0x8')](),controller['show']);router['put'](_0x5794('0x7'),auth[_0x5794('0x8')](),controller[_0x5794('0x9')]);router[_0x5794('0xa')](_0x5794('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x5794('0xb')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index ec2510a..307fe8d 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 _0x0b14=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x320eda,_0x152bfe){var _0x79d96e=function(_0x71cc4f){while(--_0x71cc4f){_0x320eda['push'](_0x320eda['shift']());}};_0x79d96e(++_0x152bfe);}(_0x0b14,0xed));var _0x40b1=function(_0xa9c9d9,_0x4bde51){_0xa9c9d9=_0xa9c9d9-0x0;var _0x278c58=_0x0b14[_0xa9c9d9];return _0x278c58;};'use strict';var Sequelize=require('sequelize');module[_0x40b1('0x0')]={'priority':{'type':Sequelize[_0x40b1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x40b1('0x2')],'allowNull':![],'defaultValue':_0x40b1('0x3')},'appdata':{'type':Sequelize[_0x40b1('0x4')]()},'description':{'type':Sequelize[_0x40b1('0x2')]},'interval':{'type':Sequelize[_0x40b1('0x2')],'defaultValue':_0x40b1('0x5')}}; \ No newline at end of file +var _0x38e8=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x368587,_0x1b6554){var _0x42d33c=function(_0xfdccf){while(--_0xfdccf){_0x368587['push'](_0x368587['shift']());}};_0x42d33c(++_0x1b6554);}(_0x38e8,0x9b));var _0x838e=function(_0x4822be,_0x5f5a8d){_0x4822be=_0x4822be-0x0;var _0x13c474=_0x38e8[_0x4822be];return _0x13c474;};'use strict';var Sequelize=require(_0x838e('0x0'));module['exports']={'priority':{'type':Sequelize[_0x838e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x838e('0x2')],'allowNull':![],'defaultValue':_0x838e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x838e('0x2')]},'interval':{'type':Sequelize[_0x838e('0x2')],'defaultValue':_0x838e('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index d9712b7..7e1ee1a 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 _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(_0x1bfe44,_0x4e410e){var _0x1103cb=function(_0x1e850e){while(--_0x1e850e){_0x1bfe44['push'](_0x1bfe44['shift']());}};_0x1103cb(++_0x4e410e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 +var _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xedd9,0xfc));var _0x9edd=function(_0x29ee75,_0x1b8e35){_0x29ee75=_0x29ee75-0x0;var _0x729d3d=_0xedd9[_0x29ee75];return _0x729d3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 8ee8842..8f91abd 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 _0x9446=['exports','define','MailApplication','utf8mb4_unicode_ci','util','../../config/logger','api','path','../../config/environment','./mailApplication.attributes'];(function(_0x2b5a7b,_0x49d66e){var _0x1c4d7b=function(_0xa1d618){while(--_0xa1d618){_0x2b5a7b['push'](_0x2b5a7b['shift']());}};_0x1c4d7b(++_0x49d66e);}(_0x9446,0xa4));var _0x6944=function(_0x3b3b13,_0x58d80f){_0x3b3b13=_0x3b3b13-0x0;var _0x432f4a=_0x9446[_0x3b3b13];return _0x432f4a;};'use strict';var _=require('lodash');var util=require(_0x6944('0x0'));var logger=require(_0x6944('0x1'))(_0x6944('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6944('0x3'));var rimraf=require('rimraf');var config=require(_0x6944('0x4'));var attributes=require(_0x6944('0x5'));module[_0x6944('0x6')]=function(_0xb710cd,_0x290db9){return _0xb710cd[_0x6944('0x7')](_0x6944('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6944('0x9')});}; \ No newline at end of file +var _0x1479=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','MailApplication','mail_applications'];(function(_0x38469b,_0x405546){var _0x5285a3=function(_0x5ccb15){while(--_0x5ccb15){_0x38469b['push'](_0x38469b['shift']());}};_0x5285a3(++_0x405546);}(_0x1479,0x1af));var _0x9147=function(_0x481432,_0x307bbd){_0x481432=_0x481432-0x0;var _0x33094f=_0x1479[_0x481432];return _0x33094f;};'use strict';var _=require(_0x9147('0x0'));var util=require(_0x9147('0x1'));var logger=require('../../config/logger')(_0x9147('0x2'));var moment=require(_0x9147('0x3'));var BPromise=require(_0x9147('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9147('0x5'));var rimraf=require(_0x9147('0x6'));var config=require(_0x9147('0x7'));var attributes=require('./mailApplication.attributes');module[_0x9147('0x8')]=function(_0x124aa0,_0x2899f9){return _0x124aa0['define'](_0x9147('0x9'),attributes,{'tableName':_0x9147('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9147('0xb'),'collate':_0x9147('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 3d2fceb..9745ca8 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 _0x7686=['info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x7686,0x12a));var _0x6768=function(_0x714597,_0x596490){_0x714597=_0x714597-0x0;var _0x3229be=_0x7686[_0x714597];return _0x3229be;};'use strict';var _=require('lodash');var util=require(_0x6768('0x0'));var moment=require(_0x6768('0x1'));var BPromise=require(_0x6768('0x2'));var rs=require(_0x6768('0x3'));var fs=require('fs');var Redis=require(_0x6768('0x4'));var db=require(_0x6768('0x5'))['db'];var utils=require(_0x6768('0x6'));var logger=require(_0x6768('0x7'))(_0x6768('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6768('0x9')][_0x6768('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f824b,_0x1ccf85,_0x393711){return new BPromise(function(_0x151d36,_0x1ccfb9){return client['request'](_0x1f824b,_0x393711)[_0x6768('0xb')](function(_0x43a61d){logger[_0x6768('0xc')]('MailApplication,\x20%s,\x20%s',_0x1ccf85,_0x6768('0xd'));logger[_0x6768('0xe')](_0x6768('0xf'),_0x1ccf85,_0x6768('0xd'),JSON[_0x6768('0x10')](_0x43a61d));if(_0x43a61d[_0x6768('0x11')]){if(_0x43a61d[_0x6768('0x11')][_0x6768('0x12')]===0x1f4){logger['error'](_0x6768('0x13'),_0x1ccf85,_0x43a61d['error'][_0x6768('0x14')]);return _0x1ccfb9(_0x43a61d[_0x6768('0x11')][_0x6768('0x14')]);}logger[_0x6768('0x11')](_0x6768('0x13'),_0x1ccf85,_0x43a61d[_0x6768('0x11')][_0x6768('0x14')]);return _0x151d36(_0x43a61d['error']['message']);}else{logger[_0x6768('0xc')]('MailApplication,\x20%s,\x20%s',_0x1ccf85,_0x6768('0xd'));_0x151d36(_0x43a61d[_0x6768('0x15')][_0x6768('0x14')]);}})[_0x6768('0x16')](function(_0x1ee648){logger['error'](_0x6768('0x13'),_0x1ccf85,_0x1ee648);_0x1ccfb9(_0x1ee648);});});}exports[_0x6768('0x17')]=function(_0x35d260){var _0x9d13df=this;return new Promise(function(_0xc57658,_0x525abe){return db[_0x6768('0x18')][_0x6768('0x19')](_0x35d260[_0x6768('0x1a')],{'raw':_0x35d260[_0x6768('0x1b')]?_0x35d260[_0x6768('0x1b')][_0x6768('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35d260['options']?_0x35d260[_0x6768('0x1b')]['where']||null:null,'attributes':_0x35d260[_0x6768('0x1b')]?_0x35d260[_0x6768('0x1b')][_0x6768('0x1d')]||null:null,'limit':_0x35d260[_0x6768('0x1b')]?_0x35d260['options'][_0x6768('0x1e')]||null:null})['then'](function(_0x3f297d){logger[_0x6768('0xc')](_0x6768('0x17'),_0x35d260);logger[_0x6768('0xe')](_0x6768('0x17'),_0x35d260,JSON[_0x6768('0x10')](_0x3f297d));_0xc57658(_0x3f297d);})[_0x6768('0x16')](function(_0x28970f){logger[_0x6768('0x11')](_0x6768('0x17'),_0x28970f[_0x6768('0x14')],_0x35d260);_0x525abe(_0x9d13df[_0x6768('0x11')](0x1f4,_0x28970f[_0x6768('0x14')]));});});}; \ No newline at end of file +var _0x54b0=['../../config/utils','rpc','client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','options','raw','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x34c1c6,_0x597c2d){var _0x3e2e6c=function(_0xac8600){while(--_0xac8600){_0x34c1c6['push'](_0x34c1c6['shift']());}};_0x3e2e6c(++_0x597c2d);}(_0x54b0,0xbf));var _0x054b=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0x54b0[_0x3207aa];return _0x51758f;};'use strict';var _=require('lodash');var util=require(_0x054b('0x0'));var moment=require(_0x054b('0x1'));var BPromise=require(_0x054b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x054b('0x3'));var db=require(_0x054b('0x4'))['db'];var utils=require(_0x054b('0x5'));var logger=require('../../config/logger')(_0x054b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x054b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8cb1b9,_0x350321,_0xe34f85){return new BPromise(function(_0x8a6bb4,_0x1a7110){return client[_0x054b('0x8')](_0x8cb1b9,_0xe34f85)[_0x054b('0x9')](function(_0x4264da){logger[_0x054b('0xa')](_0x054b('0xb'),_0x350321,_0x054b('0xc'));logger[_0x054b('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x350321,_0x054b('0xc'),JSON[_0x054b('0xe')](_0x4264da));if(_0x4264da['error']){if(_0x4264da[_0x054b('0xf')][_0x054b('0x10')]===0x1f4){logger[_0x054b('0xf')](_0x054b('0xb'),_0x350321,_0x4264da[_0x054b('0xf')]['message']);return _0x1a7110(_0x4264da['error'][_0x054b('0x11')]);}logger[_0x054b('0xf')](_0x054b('0xb'),_0x350321,_0x4264da[_0x054b('0xf')][_0x054b('0x11')]);return _0x8a6bb4(_0x4264da[_0x054b('0xf')][_0x054b('0x11')]);}else{logger[_0x054b('0xa')](_0x054b('0xb'),_0x350321,_0x054b('0xc'));_0x8a6bb4(_0x4264da[_0x054b('0x12')][_0x054b('0x11')]);}})[_0x054b('0x13')](function(_0x27499a){logger[_0x054b('0xf')](_0x054b('0xb'),_0x350321,_0x27499a);_0x1a7110(_0x27499a);});});}exports[_0x054b('0x14')]=function(_0x2e00c8){var _0x143a41=this;return new Promise(function(_0x240f36,_0x41316b){return db[_0x054b('0x15')][_0x054b('0x16')](_0x2e00c8['body'],{'raw':_0x2e00c8[_0x054b('0x17')]?_0x2e00c8[_0x054b('0x17')][_0x054b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e00c8[_0x054b('0x17')]?_0x2e00c8['options'][_0x054b('0x19')]||null:null,'attributes':_0x2e00c8['options']?_0x2e00c8[_0x054b('0x17')][_0x054b('0x1a')]||null:null,'limit':_0x2e00c8['options']?_0x2e00c8[_0x054b('0x17')][_0x054b('0x1b')]||null:null})[_0x054b('0x9')](function(_0xc1e939){logger[_0x054b('0xa')](_0x054b('0x14'),_0x2e00c8);logger[_0x054b('0xd')](_0x054b('0x14'),_0x2e00c8,JSON[_0x054b('0xe')](_0xc1e939));_0x240f36(_0xc1e939);})[_0x054b('0x13')](function(_0x5dead1){logger['error'](_0x054b('0x14'),_0x5dead1['message'],_0x2e00c8);_0x41316b(_0x143a41[_0x054b('0xf')](0x1f4,_0x5dead1[_0x054b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 45e8380..b2e1d51 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 _0x602f=['mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','tracked','mail','addTags'];(function(_0x1a85fe,_0x39dda1){var _0x506810=function(_0x4e5235){while(--_0x4e5235){_0x1a85fe['push'](_0x1a85fe['shift']());}};_0x506810(++_0x39dda1);}(_0x602f,0x1a8));var _0xf602=function(_0x3710fa,_0xd3edd1){_0x3710fa=_0x3710fa-0x0;var _0x1b90a6=_0x602f[_0x3710fa];return _0x1b90a6;};'use strict';var express=require('express');var router=express[_0xf602('0x0')]();var auth=require(_0xf602('0x1'));var interaction=require(_0xf602('0x2'));var controller=require(_0xf602('0x3'));router[_0xf602('0x4')]('/',auth[_0xf602('0x5')](),controller['index']);router['get'](_0xf602('0x6'),auth[_0xf602('0x5')](),controller[_0xf602('0x7')]);router[_0xf602('0x4')](_0xf602('0x8'),auth[_0xf602('0x5')](),controller[_0xf602('0x9')]);router[_0xf602('0x4')](_0xf602('0xa'),auth[_0xf602('0x5')](),controller['getMessages']);router[_0xf602('0x4')](_0xf602('0xb'),auth[_0xf602('0x5')](),controller[_0xf602('0xc')]);router[_0xf602('0xd')]('/',auth[_0xf602('0x5')](),controller[_0xf602('0xe')]);router['post'](_0xf602('0xa'),auth[_0xf602('0x5')](),controller['addMessage']);router[_0xf602('0xd')]('/:id/tags',auth[_0xf602('0x5')](),interaction[_0xf602('0xf')](_0xf602('0x10'),'mailinteraction:addtags'),controller[_0xf602('0x11')]);router['put'](_0xf602('0x8'),auth[_0xf602('0x5')](),interaction[_0xf602('0xf')](_0xf602('0x10'),_0xf602('0x12')),controller[_0xf602('0x13')]);router[_0xf602('0x14')](_0xf602('0x8'),auth[_0xf602('0x5')](),interaction[_0xf602('0xf')]('mail',_0xf602('0x15')),controller[_0xf602('0x16')]);router[_0xf602('0x14')](_0xf602('0x17'),auth[_0xf602('0x5')](),controller[_0xf602('0x18')]);module[_0xf602('0x19')]=router; \ No newline at end of file +var _0xe3f3=['/:id/download','download','post','create','/:id/tags','tracked','mail','mailinteraction:update','update','delete','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','getMessages'];(function(_0x54b8fa,_0x5d1397){var _0x55b736=function(_0x44078c){while(--_0x44078c){_0x54b8fa['push'](_0x54b8fa['shift']());}};_0x55b736(++_0x5d1397);}(_0xe3f3,0xed));var _0x3e3f=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xe3f3[_0xa148b7];return _0x51efd3;};'use strict';var express=require(_0x3e3f('0x0'));var router=express[_0x3e3f('0x1')]();var auth=require(_0x3e3f('0x2'));var interaction=require(_0x3e3f('0x3'));var controller=require(_0x3e3f('0x4'));router['get']('/',auth[_0x3e3f('0x5')](),controller[_0x3e3f('0x6')]);router[_0x3e3f('0x7')](_0x3e3f('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x3e3f('0x9'),auth['isAuthenticated'](),controller[_0x3e3f('0xa')]);router[_0x3e3f('0x7')](_0x3e3f('0xb'),auth[_0x3e3f('0x5')](),controller[_0x3e3f('0xc')]);router['get'](_0x3e3f('0xd'),auth[_0x3e3f('0x5')](),controller[_0x3e3f('0xe')]);router[_0x3e3f('0xf')]('/',auth[_0x3e3f('0x5')](),controller[_0x3e3f('0x10')]);router['post'](_0x3e3f('0xb'),auth[_0x3e3f('0x5')](),controller['addMessage']);router['post'](_0x3e3f('0x11'),auth[_0x3e3f('0x5')](),interaction[_0x3e3f('0x12')](_0x3e3f('0x13'),'mailinteraction:addtags'),controller['addTags']);router['put'](_0x3e3f('0x9'),auth[_0x3e3f('0x5')](),interaction[_0x3e3f('0x12')](_0x3e3f('0x13'),_0x3e3f('0x14')),controller[_0x3e3f('0x15')]);router[_0x3e3f('0x16')](_0x3e3f('0x9'),auth[_0x3e3f('0x5')](),interaction[_0x3e3f('0x12')](_0x3e3f('0x13'),'mailinteraction:destroy'),controller[_0x3e3f('0x17')]);router[_0x3e3f('0x16')]('/:id/tags',auth[_0x3e3f('0x5')](),controller['removeTags']);module[_0x3e3f('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4fd4747..279cd76 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 _0x8c5a=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','sequelize','iconv','exports'];(function(_0x5ca784,_0x28bea2){var _0x5aa579=function(_0x531234){while(--_0x531234){_0x5ca784['push'](_0x5ca784['shift']());}};_0x5aa579(++_0x28bea2);}(_0x8c5a,0x1b6));var _0xa8c5=function(_0x235cc2,_0x29f45e){_0x235cc2=_0x235cc2-0x0;var _0x3e2023=_0x8c5a[_0x235cc2];return _0x3e2023;};'use strict';var Sequelize=require(_0xa8c5('0x0'));var iconv=require(_0xa8c5('0x1'));module[_0xa8c5('0x2')]={'closed':{'type':Sequelize[_0xa8c5('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa8c5('0x4')]},'disposition':{'type':Sequelize[_0xa8c5('0x5')]},'secondDisposition':{'type':Sequelize[_0xa8c5('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa8c5('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xa8c5('0x5')](0x1fe)},'to':{'type':Sequelize[_0xa8c5('0x5')]},'cc':{'type':Sequelize[_0xa8c5('0x6')](_0xa8c5('0x7'))},'subject':{'type':Sequelize[_0xa8c5('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa8c5('0x4')]},'substatus':{'type':Sequelize[_0xa8c5('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xa8c5('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xa8c5('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa8c5('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa8c5('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa8c5('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x221b=['BOOLEAN','DATE','STRING','TEXT','long','out','ENUM','sequelize'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0x221b,0xbf));var _0xb221=function(_0x22d076,_0x1bb313){_0x22d076=_0x22d076-0x0;var _0x119e6d=_0x221b[_0x22d076];return _0x119e6d;};'use strict';var Sequelize=require(_0xb221('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0xb221('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb221('0x2')]},'disposition':{'type':Sequelize[_0xb221('0x3')]},'secondDisposition':{'type':Sequelize[_0xb221('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb221('0x3')]},'inReplyTo':{'type':Sequelize[_0xb221('0x3')](0x1fe)},'to':{'type':Sequelize[_0xb221('0x3')]},'cc':{'type':Sequelize[_0xb221('0x4')](_0xb221('0x5'))},'subject':{'type':Sequelize[_0xb221('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xb221('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xb221('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb221('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb221('0x7')]('in',_0xb221('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb221('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index b9b8cbd..c5a41f2 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 _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','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','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x452f0e,_0x1c4169){var _0x4c56c0=function(_0x7fef05){while(--_0x7fef05){_0x452f0e['push'](_0x452f0e['shift']());}};_0x4c56c0(++_0x1c4169);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('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','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file +var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','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','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x1d0d2b,_0x41539b){var _0x32f442=function(_0x5484e6){while(--_0x5484e6){_0x1d0d2b['push'](_0x1d0d2b['shift']());}};_0x32f442(++_0x41539b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('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','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index b2e0bf0..9c480db 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 _0x7c55=['map','findAll','then','setDataValue','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','save','remove','Users'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x7c55,0x180));var _0x57c5=function(_0x53166b,_0x2c6363){_0x53166b=_0x53166b-0x0;var _0x421ae6=_0x7c55[_0x53166b];return _0x421ae6;};'use strict';var EventEmitter=require(_0x57c5('0x0'));var MailInteraction=require(_0x57c5('0x1'))['db'][_0x57c5('0x2')];var MailMessage=require(_0x57c5('0x1'))['db'][_0x57c5('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x57c5('0x4'),'afterUpdate':'update','afterDestroy':_0x57c5('0x5')};function emitEvent(_0x3719a4){return function(_0x174f88,_0x1b5302,_0x1be252){_0x174f88['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x4d39b1){_0x174f88['setDataValue'](_0x57c5('0x6'),_0x4d39b1[_0x57c5('0x7')](function(_0x25aeda){return{'id':_0x25aeda['id']};}));return MailMessage[_0x57c5('0x8')]({'where':{'MailInteractionId':_0x174f88['id'],'direction':'in','read':![]},'raw':!![]});})[_0x57c5('0x9')](function(_0x515f62){_0x174f88[_0x57c5('0xa')](_0x57c5('0xb'),_0x515f62[_0x57c5('0xc')]);MailInteractionEvents[_0x57c5('0xd')](_0x3719a4+':'+_0x174f88['id'],_0x174f88);MailInteractionEvents['emit'](_0x3719a4,_0x174f88);_0x1be252(null);})[_0x57c5('0xe')](_0x1be252(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x57c5('0xf')](e,emitEvent(event));}}module[_0x57c5('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x33c6=['Users','findAll','setDataValue','unreadMessages','length','emit','catch','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update','remove','getUsers','then'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x33c6,0x15c));var _0x633c=function(_0x155812,_0x44d864){_0x155812=_0x155812-0x0;var _0x2dbbc7=_0x33c6[_0x155812];return _0x2dbbc7;};'use strict';var EventEmitter=require(_0x633c('0x0'));var MailInteraction=require(_0x633c('0x1'))['db'][_0x633c('0x2')];var MailMessage=require(_0x633c('0x1'))['db'][_0x633c('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x633c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x633c('0x5'),'afterDestroy':_0x633c('0x6')};function emitEvent(_0xbed90b){return function(_0x594794,_0x2c8f6c,_0x273daa){_0x594794[_0x633c('0x7')]({'attributes':['id'],'raw':!![]})[_0x633c('0x8')](function(_0x24a55e){_0x594794['setDataValue'](_0x633c('0x9'),_0x24a55e['map'](function(_0x1876b8){return{'id':_0x1876b8['id']};}));return MailMessage[_0x633c('0xa')]({'where':{'MailInteractionId':_0x594794['id'],'direction':'in','read':![]},'raw':!![]});})[_0x633c('0x8')](function(_0x2944a1){_0x594794[_0x633c('0xb')](_0x633c('0xc'),_0x2944a1[_0x633c('0xd')]);MailInteractionEvents['emit'](_0xbed90b+':'+_0x594794['id'],_0x594794);MailInteractionEvents[_0x633c('0xe')](_0xbed90b,_0x594794);_0x273daa(null);})[_0x633c('0xf')](_0x273daa(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x633c('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index c777616..cd1938f 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 _0x8dcd=['closedAt','substatus','changed','closed','update','then','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x481657,_0x3f66e4){var _0x2e5568=function(_0x162875){while(--_0x162875){_0x481657['push'](_0x481657['shift']());}};_0x2e5568(++_0x3f66e4);}(_0x8dcd,0x1ee));var _0xd8dc=function(_0x12636e,_0x29aa88){_0x12636e=_0x12636e-0x0;var _0x3a3337=_0x8dcd[_0x12636e];return _0x3a3337;};'use strict';var _=require('lodash');var util=require(_0xd8dc('0x0'));var logger=require(_0xd8dc('0x1'))(_0xd8dc('0x2'));var moment=require(_0xd8dc('0x3'));var BPromise=require(_0xd8dc('0x4'));var rp=require(_0xd8dc('0x5'));var fs=require('fs');var path=require(_0xd8dc('0x6'));var rimraf=require(_0xd8dc('0x7'));var config=require(_0xd8dc('0x8'));var attributes=require(_0xd8dc('0x9'));module[_0xd8dc('0xa')]=function(_0x520f57,_0x226a4d){return _0x520f57[_0xd8dc('0xb')](_0xd8dc('0xc'),attributes,{'tableName':_0xd8dc('0xd'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xd8dc('0xe'),'to'],'type':_0xd8dc('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4ab1fa,_0x4cde4f,_0x12e5b3){if(_0x4ab1fa['substatus']){_0x4ab1fa[_0xd8dc('0x10')]=moment()[_0xd8dc('0x11')](_0xd8dc('0x12'));}if(_0x4ab1fa['closed']){_0x4ab1fa[_0xd8dc('0x13')]=moment()['format'](_0xd8dc('0x12'));}_0x12e5b3(null,_0x4cde4f);},'beforeUpdate':function(_0x54fad4,_0x495a89,_0x55ab7c){if(_0x54fad4['changed']('substatus')){_0x54fad4[_0xd8dc('0x10')]=_0x54fad4[_0xd8dc('0x14')]?moment()['format'](_0xd8dc('0x12')):null;}if(_0x54fad4[_0xd8dc('0x15')](_0xd8dc('0x16'))){_0x54fad4[_0xd8dc('0x13')]=moment()[_0xd8dc('0x11')](_0xd8dc('0x12'));_0x54fad4[_0xd8dc('0x14')]=null;_0x54fad4['substatusAt']=null;}_0x55ab7c(null,_0x54fad4);},'afterUpdate':function(_0x18d854,_0x12c65b,_0x7c2527){var _0x412f14=_0x520f57['models'];var _0x8eba8d=_0x18d854['get']({'plain':!![]});if(_0x8eba8d[_0xd8dc('0x16')]){return _0x412f14['MailMessage'][_0xd8dc('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x8eba8d['id']}})[_0xd8dc('0x18')](function(){_0x7c2527();})['catch'](function(_0x1e290a){_0x7c2527(_0x1e290a);});}else{_0x7c2527();}}},'charset':_0xd8dc('0x19'),'collate':_0xd8dc('0x1a')});}; \ No newline at end of file +var _0x9e25=['define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','catch','utf8mb4_unicode_ci','lodash','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x5e3203,_0x4bf3f9){var _0x3f85bd=function(_0x39e07){while(--_0x39e07){_0x5e3203['push'](_0x5e3203['shift']());}};_0x3f85bd(++_0x4bf3f9);}(_0x9e25,0xc9));var _0x59e2=function(_0x2489d1,_0x4c9d45){_0x2489d1=_0x2489d1-0x0;var _0x2ac3b6=_0x9e25[_0x2489d1];return _0x2ac3b6;};'use strict';var _=require(_0x59e2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x59e2('0x1'));var BPromise=require('bluebird');var rp=require(_0x59e2('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x59e2('0x3'));var config=require(_0x59e2('0x4'));var attributes=require('./mailInteraction.attributes');module[_0x59e2('0x5')]=function(_0x4a70ea,_0x42fbb7){return _0x4a70ea[_0x59e2('0x6')](_0x59e2('0x7'),attributes,{'tableName':_0x59e2('0x8'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x59e2('0x9'),'to'],'type':_0x59e2('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d9396,_0x57fa23,_0x4cb8cd){if(_0x5d9396[_0x59e2('0xb')]){_0x5d9396['substatusAt']=moment()[_0x59e2('0xc')](_0x59e2('0xd'));}if(_0x5d9396[_0x59e2('0xe')]){_0x5d9396[_0x59e2('0xf')]=moment()['format'](_0x59e2('0xd'));}_0x4cb8cd(null,_0x57fa23);},'beforeUpdate':function(_0x516400,_0x67e177,_0x17ba8d){if(_0x516400[_0x59e2('0x10')](_0x59e2('0xb'))){_0x516400['substatusAt']=_0x516400['substatus']?moment()['format'](_0x59e2('0xd')):null;}if(_0x516400[_0x59e2('0x10')]('closed')){_0x516400['closedAt']=moment()[_0x59e2('0xc')](_0x59e2('0xd'));_0x516400[_0x59e2('0xb')]=null;_0x516400['substatusAt']=null;}_0x17ba8d(null,_0x516400);},'afterUpdate':function(_0x171e79,_0x36d977,_0x15ce1a){var _0x4a329a=_0x4a70ea[_0x59e2('0x11')];var _0x969591=_0x171e79[_0x59e2('0x12')]({'plain':!![]});if(_0x969591[_0x59e2('0xe')]){return _0x4a329a[_0x59e2('0x13')][_0x59e2('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x969591['id']}})['then'](function(){_0x15ce1a();})[_0x59e2('0x15')](function(_0x4a743f){_0x15ce1a(_0x4a743f);});}else{_0x15ce1a();}}},'charset':'utf8mb4','collate':_0x59e2('0x16')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 1f1502a..7776698 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 _0x77d4=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./mailInteraction.socket','register','then','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailInteraction','update','body','options','raw','where','attributes','info','UpdateMailInteraction','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','debug','util','bluebird'];(function(_0x2fe4e6,_0x39f94e){var _0x331d75=function(_0x346bdf){while(--_0x346bdf){_0x2fe4e6['push'](_0x2fe4e6['shift']());}};_0x331d75(++_0x39f94e);}(_0x77d4,0x108));var _0x477d=function(_0x144ae9,_0x4f551f){_0x144ae9=_0x144ae9-0x0;var _0x2bae3d=_0x77d4[_0x144ae9];return _0x2bae3d;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var moment=require('moment');var BPromise=require(_0x477d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x477d('0x4'));var config=require(_0x477d('0x5'));var jayson=require(_0x477d('0x6'));var client=jayson[_0x477d('0x7')][_0x477d('0x8')]({'port':0x232a});config[_0x477d('0x9')]=_['defaults'](config['redis'],{'host':_0x477d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x477d('0xb'))[_0x477d('0xc')](socket);function respondWithRpcPromise(_0x204cb9,_0x2c326c,_0x1cef1c){return new BPromise(function(_0x58ff29,_0x932cc9){return client['request'](_0x204cb9,_0x1cef1c)[_0x477d('0xd')](function(_0x462ac1){logger['info'](_0x477d('0xe'),_0x2c326c,_0x477d('0xf'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x2c326c,_0x477d('0xf'),JSON[_0x477d('0x10')](_0x462ac1));if(_0x462ac1['error']){if(_0x462ac1[_0x477d('0x11')][_0x477d('0x12')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x2c326c,_0x462ac1[_0x477d('0x11')]['message']);return _0x932cc9(_0x462ac1[_0x477d('0x11')][_0x477d('0x13')]);}logger[_0x477d('0x11')]('MailInteraction,\x20%s,\x20%s',_0x2c326c,_0x462ac1[_0x477d('0x11')][_0x477d('0x13')]);return _0x58ff29(_0x462ac1[_0x477d('0x11')][_0x477d('0x13')]);}else{logger['info'](_0x477d('0xe'),_0x2c326c,'request\x20sent');_0x58ff29(_0x462ac1[_0x477d('0x14')][_0x477d('0x13')]);}})[_0x477d('0x15')](function(_0x458489){logger[_0x477d('0x11')](_0x477d('0xe'),_0x2c326c,_0x458489);_0x932cc9(_0x458489);});});}exports['UpdateMailInteraction']=function(_0x33db7a){var _0x49c442=this;return new Promise(function(_0xe934a7,_0x24a6d5){return db[_0x477d('0x16')][_0x477d('0x17')](_0x33db7a[_0x477d('0x18')],{'raw':_0x33db7a[_0x477d('0x19')]?_0x33db7a[_0x477d('0x19')][_0x477d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33db7a[_0x477d('0x19')]?_0x33db7a[_0x477d('0x19')][_0x477d('0x1b')]||null:null,'attributes':_0x33db7a[_0x477d('0x19')]?_0x33db7a[_0x477d('0x19')][_0x477d('0x1c')]||null:null,'limit':_0x33db7a['options']?_0x33db7a[_0x477d('0x19')]['limit']||null:null})[_0x477d('0xd')](function(_0x2506d8){logger[_0x477d('0x1d')](_0x477d('0x1e'),_0x33db7a);logger['debug'](_0x477d('0x1e'),_0x33db7a,JSON[_0x477d('0x10')](_0x2506d8));_0xe934a7(_0x2506d8);})[_0x477d('0x15')](function(_0x48ee5e){logger['error'](_0x477d('0x1e'),_0x48ee5e[_0x477d('0x13')],_0x33db7a);_0x24a6d5(_0x49c442[_0x477d('0x11')](0x1f4,_0x48ee5e['message']));});});};exports[_0x477d('0x1f')]=function(_0x297d15){return new Promise(function(_0x74ebb4,_0xe4dd40){return db[_0x477d('0x16')]['find']({'where':_0x297d15[_0x477d('0x19')]?_0x297d15[_0x477d('0x19')][_0x477d('0x1b')]||null:null})[_0x477d('0xd')](function(_0x32c5d7){if(_0x32c5d7){return _0x32c5d7[_0x477d('0x20')](_0x297d15[_0x477d('0x18')][_0x477d('0x21')],_[_0x477d('0x22')](_0x297d15[_0x477d('0x18')],[_0x477d('0x21'),'id'])||{});}})[_0x477d('0x23')](function(_0x138c6d){logger[_0x477d('0x1d')](_0x477d('0x24'),_0x297d15);logger[_0x477d('0x25')](_0x477d('0x24'),_0x297d15,JSON[_0x477d('0x10')](_0x138c6d));_0x74ebb4(_0x138c6d);})[_0x477d('0x15')](function(_0x266dbf){logger['error'](_0x477d('0x24'),_0x266dbf['message'],_0x297d15);_0xe4dd40(_this[_0x477d('0x11')](0x1f4,_0x266dbf[_0x477d('0x13')]));});});}; \ No newline at end of file +var _0x1939=['debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s'];(function(_0xe29fae,_0x43d3f5){var _0xc1c438=function(_0x452237){while(--_0x452237){_0xe29fae['push'](_0xe29fae['shift']());}};_0xc1c438(++_0x43d3f5);}(_0x1939,0x1d1));var _0x9193=function(_0x587783,_0x6296e6){_0x587783=_0x587783-0x0;var _0x1cca44=_0x1939[_0x587783];return _0x1cca44;};'use strict';var _=require(_0x9193('0x0'));var util=require('util');var moment=require(_0x9193('0x1'));var BPromise=require(_0x9193('0x2'));var rs=require(_0x9193('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9193('0x4'))['db'];var utils=require(_0x9193('0x5'));var logger=require(_0x9193('0x6'))(_0x9193('0x7'));var config=require('../../config/environment');var jayson=require(_0x9193('0x8'));var client=jayson[_0x9193('0x9')]['http']({'port':0x232a});config[_0x9193('0xa')]=_[_0x9193('0xb')](config[_0x9193('0xa')],{'host':_0x9193('0xc'),'port':0x18eb});var socket=require(_0x9193('0xd'))(new Redis(config['redis']));require(_0x9193('0xe'))[_0x9193('0xf')](socket);function respondWithRpcPromise(_0x185b7a,_0xe6593e,_0x44d9f7){return new BPromise(function(_0x533e5f,_0x5934d9){return client['request'](_0x185b7a,_0x44d9f7)[_0x9193('0x10')](function(_0x4aa6c7){logger[_0x9193('0x11')](_0x9193('0x12'),_0xe6593e,'request\x20sent');logger[_0x9193('0x13')](_0x9193('0x14'),_0xe6593e,_0x9193('0x15'),JSON[_0x9193('0x16')](_0x4aa6c7));if(_0x4aa6c7[_0x9193('0x17')]){if(_0x4aa6c7[_0x9193('0x17')][_0x9193('0x18')]===0x1f4){logger[_0x9193('0x17')](_0x9193('0x12'),_0xe6593e,_0x4aa6c7['error'][_0x9193('0x19')]);return _0x5934d9(_0x4aa6c7[_0x9193('0x17')][_0x9193('0x19')]);}logger[_0x9193('0x17')](_0x9193('0x12'),_0xe6593e,_0x4aa6c7['error'][_0x9193('0x19')]);return _0x533e5f(_0x4aa6c7[_0x9193('0x17')][_0x9193('0x19')]);}else{logger[_0x9193('0x11')](_0x9193('0x12'),_0xe6593e,_0x9193('0x15'));_0x533e5f(_0x4aa6c7[_0x9193('0x1a')]['message']);}})[_0x9193('0x1b')](function(_0x430c6c){logger[_0x9193('0x17')]('MailInteraction,\x20%s,\x20%s',_0xe6593e,_0x430c6c);_0x5934d9(_0x430c6c);});});}exports[_0x9193('0x1c')]=function(_0x22a444){var _0x3216c9=this;return new Promise(function(_0x490b30,_0x465cd2){return db[_0x9193('0x1d')][_0x9193('0x1e')](_0x22a444[_0x9193('0x1f')],{'raw':_0x22a444[_0x9193('0x20')]?_0x22a444['options'][_0x9193('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22a444[_0x9193('0x20')]?_0x22a444[_0x9193('0x20')][_0x9193('0x22')]||null:null,'attributes':_0x22a444[_0x9193('0x20')]?_0x22a444['options'][_0x9193('0x23')]||null:null,'limit':_0x22a444[_0x9193('0x20')]?_0x22a444[_0x9193('0x20')][_0x9193('0x24')]||null:null})[_0x9193('0x10')](function(_0x4c1406){logger[_0x9193('0x11')](_0x9193('0x1c'),_0x22a444);logger[_0x9193('0x13')](_0x9193('0x1c'),_0x22a444,JSON['stringify'](_0x4c1406));_0x490b30(_0x4c1406);})['catch'](function(_0x1d9dfc){logger[_0x9193('0x17')](_0x9193('0x1c'),_0x1d9dfc[_0x9193('0x19')],_0x22a444);_0x465cd2(_0x3216c9[_0x9193('0x17')](0x1f4,_0x1d9dfc['message']));});});};exports[_0x9193('0x25')]=function(_0x368951){return new Promise(function(_0x404e9c,_0x51de3e){return db[_0x9193('0x1d')][_0x9193('0x26')]({'where':_0x368951[_0x9193('0x20')]?_0x368951[_0x9193('0x20')][_0x9193('0x22')]||null:null})['then'](function(_0x16dde0){if(_0x16dde0){return _0x16dde0[_0x9193('0x27')](_0x368951['body'][_0x9193('0x28')],_[_0x9193('0x29')](_0x368951[_0x9193('0x1f')],[_0x9193('0x28'),'id'])||{});}})[_0x9193('0x2a')](function(_0x2edf15){logger['info'](_0x9193('0x2b'),_0x368951);logger[_0x9193('0x13')](_0x9193('0x2b'),_0x368951,JSON[_0x9193('0x16')](_0x2edf15));_0x404e9c(_0x2edf15);})[_0x9193('0x1b')](function(_0x246d81){logger['error'](_0x9193('0x2b'),_0x246d81[_0x9193('0x19')],_0x368951);_0x51de3e(_this[_0x9193('0x17')](0x1f4,_0x246d81['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 4b6bbdc..c5daf9f 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 _0xcbbe=['update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xcbbe,0x176));var _0xecbb=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xcbbe[_0x819464];return _0x49dcc0;};'use strict';var MailInteractionEvents=require(_0xecbb('0x0'));var events=[_0xecbb('0x1'),'remove',_0xecbb('0x2')];function createListener(_0x145bbb,_0x5637f1){return function(_0x330ff7){_0x5637f1[_0xecbb('0x3')](_0x145bbb,_0x330ff7);};}function removeListener(_0xda9e4f,_0x30e7f2){return function(){MailInteractionEvents[_0xecbb('0x4')](_0xda9e4f,_0x30e7f2);};}exports[_0xecbb('0x5')]=function(_0x1332c4){for(var _0x488264=0x0,_0x5191fe=events[_0xecbb('0x6')];_0x488264<_0x5191fe;_0x488264++){var _0x16dded=events[_0x488264];var _0x53af9a=createListener(_0xecbb('0x7')+_0x16dded,_0x1332c4);MailInteractionEvents['on'](_0x16dded,_0x53af9a);}}; \ No newline at end of file +var _0x47f0=['./mailInteraction.events','save','remove','update','removeListener','register','length','mailInteraction:'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x47f0,0x78));var _0x047f=function(_0x2a8b3b,_0x5efd92){_0x2a8b3b=_0x2a8b3b-0x0;var _0x546b6c=_0x47f0[_0x2a8b3b];return _0x546b6c;};'use strict';var MailInteractionEvents=require(_0x047f('0x0'));var events=[_0x047f('0x1'),_0x047f('0x2'),_0x047f('0x3')];function createListener(_0xaff140,_0x50c8b8){return function(_0x1eac2e){_0x50c8b8['emit'](_0xaff140,_0x1eac2e);};}function removeListener(_0x2de3d3,_0x1eb67c){return function(){MailInteractionEvents[_0x047f('0x4')](_0x2de3d3,_0x1eb67c);};}exports[_0x047f('0x5')]=function(_0x17d1b5){for(var _0x52cf63=0x0,_0x11025d=events[_0x047f('0x6')];_0x52cf63<_0x11025d;_0x52cf63++){var _0x1f6d9a=events[_0x52cf63];var _0x2f636a=createListener(_0x047f('0x7')+_0x1f6d9a,_0x17d1b5);MailInteractionEvents['on'](_0x1f6d9a,_0x2f636a);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 2cf18ff..960e615 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 _0x9861=['post','mail','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x5cdc6f,_0x509123){var _0x2c3758=function(_0xba130d){while(--_0xba130d){_0x5cdc6f['push'](_0x5cdc6f['shift']());}};_0x2c3758(++_0x509123);}(_0x9861,0x176));var _0x1986=function(_0x5eac89,_0x23d776){_0x5eac89=_0x5eac89-0x0;var _0x2666df=_0x9861[_0x5eac89];return _0x2666df;};'use strict';var multer=require(_0x1986('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1986('0x1'));var express=require(_0x1986('0x2'));var router=express[_0x1986('0x3')]();var fs_extra=require(_0x1986('0x4'));var auth=require(_0x1986('0x5'));var interaction=require(_0x1986('0x6'));var config=require('../../config/environment');var controller=require(_0x1986('0x7'));router[_0x1986('0x8')]('/',auth[_0x1986('0x9')](),controller[_0x1986('0xa')]);router[_0x1986('0x8')](_0x1986('0xb'),auth[_0x1986('0x9')](),controller[_0x1986('0xc')]);router[_0x1986('0x8')](_0x1986('0xd'),auth['isAuthenticated'](),controller[_0x1986('0xe')]);router[_0x1986('0x8')](_0x1986('0xf'),auth[_0x1986('0x9')](),controller['download']);router[_0x1986('0x10')]('/',auth[_0x1986('0x9')](),interaction['tracked'](_0x1986('0x11'),'mailmessage:create'),controller['create']);router[_0x1986('0x12')](_0x1986('0xd'),auth[_0x1986('0x9')](),controller[_0x1986('0x13')]);router[_0x1986('0x12')](_0x1986('0x14'),auth[_0x1986('0x9')](),controller[_0x1986('0x15')]);router[_0x1986('0x12')](_0x1986('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0x1986('0x17')](_0x1986('0xd'),auth['isAuthenticated'](),controller[_0x1986('0x18')]);module[_0x1986('0x19')]=router; \ No newline at end of file +var _0x4d4b=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','post','mail','mailmessage:create','create','update','put','/:id/reject','reject'];(function(_0x4d3e1f,_0x5e5823){var _0xed198a=function(_0xdc4d6d){while(--_0xdc4d6d){_0x4d3e1f['push'](_0x4d3e1f['shift']());}};_0xed198a(++_0x5e5823);}(_0x4d4b,0xf5));var _0xb4d4=function(_0x13bc89,_0x12f103){_0x13bc89=_0x13bc89-0x0;var _0x587243=_0x4d4b[_0x13bc89];return _0x587243;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb4d4('0x0'));var timeout=require(_0xb4d4('0x1'));var express=require(_0xb4d4('0x2'));var router=express[_0xb4d4('0x3')]();var fs_extra=require(_0xb4d4('0x4'));var auth=require(_0xb4d4('0x5'));var interaction=require(_0xb4d4('0x6'));var config=require(_0xb4d4('0x7'));var controller=require(_0xb4d4('0x8'));router[_0xb4d4('0x9')]('/',auth[_0xb4d4('0xa')](),controller[_0xb4d4('0xb')]);router[_0xb4d4('0x9')](_0xb4d4('0xc'),auth[_0xb4d4('0xa')](),controller[_0xb4d4('0xd')]);router['get'](_0xb4d4('0xe'),auth[_0xb4d4('0xa')](),controller[_0xb4d4('0xf')]);router['get']('/:id/download',auth[_0xb4d4('0xa')](),controller[_0xb4d4('0x10')]);router[_0xb4d4('0x11')]('/',auth[_0xb4d4('0xa')](),interaction['tracked'](_0xb4d4('0x12'),_0xb4d4('0x13')),controller[_0xb4d4('0x14')]);router['put'](_0xb4d4('0xe'),auth[_0xb4d4('0xa')](),controller[_0xb4d4('0x15')]);router['put']('/:id/accept',auth[_0xb4d4('0xa')](),controller['accept']);router[_0xb4d4('0x16')](_0xb4d4('0x17'),auth[_0xb4d4('0xa')](),controller[_0xb4d4('0x18')]);router[_0xb4d4('0x19')](_0xb4d4('0xe'),auth[_0xb4d4('0xa')](),controller[_0xb4d4('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 90af77d..1c780b9 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 _0x7ca1=['Email','Chat','sequelize','TEXT','medium','out','STRING','long','DATE','INTEGER','BOOLEAN','ENUM'];(function(_0x17e298,_0x50b2ab){var _0x344aa8=function(_0x15c50){while(--_0x15c50){_0x17e298['push'](_0x17e298['shift']());}};_0x344aa8(++_0x50b2ab);}(_0x7ca1,0x9e));var _0x17ca=function(_0x1eafa3,_0x2e69df){_0x1eafa3=_0x1eafa3-0x0;var _0x16f60c=_0x7ca1[_0x1eafa3];return _0x16f60c;};'use strict';var Sequelize=require(_0x17ca('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x17ca('0x1')](_0x17ca('0x2'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x17ca('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x17ca('0x4')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x17ca('0x1')](_0x17ca('0x5'))},'cc':{'type':Sequelize['TEXT'](_0x17ca('0x5'))},'bcc':{'type':Sequelize[_0x17ca('0x1')](_0x17ca('0x5'))},'subject':{'type':Sequelize[_0x17ca('0x1')]},'sentAt':{'type':Sequelize[_0x17ca('0x6')]},'attach':{'type':Sequelize[_0x17ca('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x17ca('0x8')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x17ca('0x6')]},'originTo':{'type':Sequelize['TEXT'](_0x17ca('0x5'))},'originCc':{'type':Sequelize[_0x17ca('0x1')](_0x17ca('0x5'))},'originChannel':{'type':Sequelize[_0x17ca('0x9')](_0x17ca('0xa'),_0x17ca('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x1842=['exports','TEXT','long','BOOLEAN','out','STRING','INTEGER','DATE','ENUM','Email','Chat','sequelize','lodash'];(function(_0x35e31e,_0x2a70a7){var _0x281b37=function(_0x194b8f){while(--_0x194b8f){_0x35e31e['push'](_0x35e31e['shift']());}};_0x281b37(++_0x2a70a7);}(_0x1842,0x80));var _0x2184=function(_0x5bd667,_0x1aa1c8){_0x5bd667=_0x5bd667-0x0;var _0x47ba52=_0x1842[_0x5bd667];return _0x47ba52;};'use strict';var Sequelize=require(_0x2184('0x0'));var _=require(_0x2184('0x1'));module[_0x2184('0x2')]={'body':{'type':Sequelize[_0x2184('0x3')](_0x2184('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2184('0x3')]('medium')},'read':{'type':Sequelize[_0x2184('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2184('0x6')),'defaultValue':_0x2184('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2184('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x2184('0x3')](_0x2184('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x2184('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0x2184('0x4'))},'subject':{'type':Sequelize[_0x2184('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x2184('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2184('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2184('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x2184('0x4'))},'originCc':{'type':Sequelize[_0x2184('0x3')](_0x2184('0x4'))},'originChannel':{'type':Sequelize[_0x2184('0xa')](_0x2184('0xb'),_0x2184('0xc')),'defaultValue':_0x2184('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 4356fdf..dac6334 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 _0x74a7=['info','result','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','find','body','describe','create','secret','MailAccountId','List','Contacts','updatedAt','MailServerOut','Smtp','service','host','port','secure','authentication','user','attachments','root','server/files/attachments','List\x20not\x20found','sendMail','update','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','UserId','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','reject','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','QueryTypes','rejectmessage','download','unix','toString','join','server','tmp','files','from','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','basename','existsSync','push','build','writeFileSync','unlinkSync','eml-format','bluebird','util','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','html-entities','./mailMessage.socket','register','http','client','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74a7,0x7d));var _0x774a=function(_0xb0f552,_0x168d80){_0xb0f552=_0xb0f552-0x0;var _0x2f1a6c=_0x74a7[_0xb0f552];return _0x2f1a6c;};'use strict';var emlformat=require(_0x774a('0x0'));var moment=require('moment');var BPromise=require(_0x774a('0x1'));var util=require(_0x774a('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x774a('0x3'));var htmlToText=require('html-to-text');var qs=require(_0x774a('0x4'));var logger=require(_0x774a('0x5'))(_0x774a('0x6'));var interaction_log=require('../../config/logger')(_0x774a('0x7'));var config=require(_0x774a('0x8'));var db=require(_0x774a('0x9'))['db'];config[_0x774a('0xa')]=_[_0x774a('0xb')](config[_0x774a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x774a('0xa')]));var htmlEntities=require(_0x774a('0xc'));require(_0x774a('0xd'))[_0x774a('0xe')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x774a('0xf')]({'port':0x232c});var client9003=jayson['client'][_0x774a('0xf')]({'port':0x232b});var client9002=jayson[_0x774a('0x10')][_0x774a('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x375f04,_0x38b716,_0x2265ff,_0x2f0e05){return new BPromise(function(_0x1b339b,_0x21a4c2){var _0x4d7f21=_0x2f0e05||client;return _0x4d7f21['request'](_0x375f04,_0x2265ff)[_0x774a('0x11')](function(_0x3959fc){logger['info'](_0x774a('0x12'),_0x38b716,_0x774a('0x13'));logger['debug'](_0x774a('0x14'),_0x38b716,_0x774a('0x13'),JSON[_0x774a('0x15')](_0x3959fc));if(_0x3959fc[_0x774a('0x16')]){if(_0x3959fc[_0x774a('0x16')][_0x774a('0x17')]===0x1f4){logger[_0x774a('0x16')](_0x774a('0x12'),_0x38b716,_0x3959fc['error'][_0x774a('0x18')]);return _0x21a4c2(_0x3959fc[_0x774a('0x16')][_0x774a('0x18')]);}logger[_0x774a('0x16')]('MailMessage,\x20%s,\x20%s',_0x38b716,_0x3959fc[_0x774a('0x16')]['message']);return _0x1b339b(_0x3959fc['error'][_0x774a('0x18')]);}else{logger[_0x774a('0x19')](_0x774a('0x12'),_0x38b716,'request\x20sent');_0x1b339b(_0x3959fc[_0x774a('0x1a')][_0x774a('0x18')]);}})['catch'](function(_0xd114ee){logger['error'](_0x774a('0x12'),_0x38b716,_0xd114ee);_0x21a4c2(_0xd114ee);});});}function respondWithResult(_0x51f2d6,_0x34698c){_0x34698c=_0x34698c||0xc8;return function(_0x38521e){if(_0x38521e){return _0x51f2d6[_0x774a('0x1b')](_0x34698c)[_0x774a('0x1c')](_0x38521e);}};}function respondWithFilteredResult(_0x21e679,_0x5c2287){return function(_0x2455d8){if(_0x2455d8){var _0x1559ea=typeof _0x5c2287[_0x774a('0x1d')]===_0x774a('0x1e')&&typeof _0x5c2287[_0x774a('0x1f')]===_0x774a('0x1e');var _0x40f5ff=_0x2455d8[_0x774a('0x20')];var _0x233a95=_0x1559ea?0x0:_0x5c2287[_0x774a('0x1d')];var _0x38da61=_0x1559ea?_0x2455d8['count']:_0x5c2287['offset']+_0x5c2287['limit'];var _0x3080c9;if(_0x38da61>=_0x40f5ff){_0x38da61=_0x40f5ff;_0x3080c9=0xc8;}else{_0x3080c9=0xce;}_0x21e679[_0x774a('0x1b')](_0x3080c9);return _0x21e679[_0x774a('0x21')](_0x774a('0x22'),_0x233a95+'-'+_0x38da61+'/'+_0x40f5ff)[_0x774a('0x1c')](_0x2455d8);}return null;};}function saveUpdates(_0xaa9a8c){return function(_0x1bb8dd){if(_0x1bb8dd){return _0x1bb8dd['update'](_0xaa9a8c)['then'](function(_0x19c6e5){return _0x19c6e5;});}return null;};}function removeEntity(_0x4b5b5b){return function(_0x4f8eb7){if(_0x4f8eb7){return _0x4f8eb7[_0x774a('0x23')]()[_0x774a('0x11')](function(){_0x4b5b5b[_0x774a('0x1b')](0xcc)[_0x774a('0x24')]();});}};}function handleEntityNotFound(_0x233d20){return function(_0x3709c0){if(!_0x3709c0){_0x233d20['sendStatus'](0x194);}return _0x3709c0;};}function handleError(_0x24e09b,_0x18be4c){_0x18be4c=_0x18be4c||0x1f4;return function(_0x78ff0){logger[_0x774a('0x16')](_0x78ff0[_0x774a('0x25')]);if(_0x78ff0[_0x774a('0x26')]){delete _0x78ff0[_0x774a('0x26')];}_0x24e09b[_0x774a('0x1b')](_0x18be4c)[_0x774a('0x27')](_0x78ff0);};}exports[_0x774a('0x28')]=function(_0x1cf6e8,_0x840c69){var _0x45b76c={},_0x3623ca={},_0xdeb9ec={'count':0x0,'rows':[]};var _0x3d0766=_[_0x774a('0x29')](db[_0x774a('0x2a')][_0x774a('0x2b')],function(_0x1c4540){return{'name':_0x1c4540['fieldName'],'type':_0x1c4540[_0x774a('0x2c')][_0x774a('0x2d')]};});_0x3623ca['model']=_['map'](_0x3d0766,_0x774a('0x26'));_0x3623ca[_0x774a('0x2e')]=_['keys'](_0x1cf6e8[_0x774a('0x2e')]);_0x3623ca[_0x774a('0x2f')]=_[_0x774a('0x30')](_0x3623ca[_0x774a('0x31')],_0x3623ca[_0x774a('0x2e')]);_0x45b76c['attributes']=_[_0x774a('0x30')](_0x3623ca[_0x774a('0x31')],qs[_0x774a('0x32')](_0x1cf6e8[_0x774a('0x2e')][_0x774a('0x32')]));_0x45b76c[_0x774a('0x33')]=_0x45b76c[_0x774a('0x33')][_0x774a('0x34')]?_0x45b76c[_0x774a('0x33')]:_0x3623ca[_0x774a('0x31')];if(!_0x1cf6e8['query']['hasOwnProperty']('nolimit')){_0x45b76c[_0x774a('0x1f')]=qs[_0x774a('0x1f')](_0x1cf6e8[_0x774a('0x2e')]['limit']);_0x45b76c[_0x774a('0x1d')]=qs[_0x774a('0x1d')](_0x1cf6e8[_0x774a('0x2e')][_0x774a('0x1d')]);}_0x45b76c[_0x774a('0x35')]=qs[_0x774a('0x36')](_0x1cf6e8[_0x774a('0x2e')][_0x774a('0x36')]);_0x45b76c['where']=qs['filters'](_[_0x774a('0x37')](_0x1cf6e8[_0x774a('0x2e')],_0x3623ca['filters']),_0x3d0766);if(_0x1cf6e8['query'][_0x774a('0x38')]){_0x45b76c[_0x774a('0x39')]=_['merge'](_0x45b76c[_0x774a('0x39')],{'$or':_[_0x774a('0x29')](_0x3d0766,function(_0x14ff44){if(_0x14ff44['type']!==_0x774a('0x3a')){var _0x3bac8d={};_0x3bac8d[_0x14ff44[_0x774a('0x26')]]={'$like':'%'+_0x1cf6e8[_0x774a('0x2e')][_0x774a('0x38')]+'%'};return _0x3bac8d;}})});}_0x45b76c=_[_0x774a('0x3b')]({},_0x45b76c,_0x1cf6e8[_0x774a('0x3c')]);var _0x15442f={'where':_0x45b76c[_0x774a('0x39')]};return db[_0x774a('0x2a')][_0x774a('0x20')](_0x15442f)['then'](function(_0x4263a5){_0xdeb9ec[_0x774a('0x20')]=_0x4263a5;if(_0x1cf6e8[_0x774a('0x2e')][_0x774a('0x3d')]){_0x45b76c[_0x774a('0x3e')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x45b76c);})[_0x774a('0x11')](function(_0x412375){_0xdeb9ec[_0x774a('0x3f')]=_0x412375;return _0xdeb9ec;})[_0x774a('0x11')](respondWithFilteredResult(_0x840c69,_0x45b76c))[_0x774a('0x40')](handleError(_0x840c69,null));};exports[_0x774a('0x41')]=function(_0x292813,_0x3ff0b2){var _0x5ad1f1={'raw':!![],'where':{'id':_0x292813[_0x774a('0x42')]['id']}},_0x417ac6={};_0x417ac6['model']=_['keys'](db[_0x774a('0x2a')][_0x774a('0x2b')]);_0x417ac6['query']=_[_0x774a('0x43')](_0x292813['query']);_0x417ac6[_0x774a('0x2f')]=_[_0x774a('0x30')](_0x417ac6[_0x774a('0x31')],_0x417ac6[_0x774a('0x2e')]);_0x5ad1f1['attributes']=_['intersection'](_0x417ac6[_0x774a('0x31')],qs[_0x774a('0x32')](_0x292813[_0x774a('0x2e')]['fields']));_0x5ad1f1[_0x774a('0x33')]=_0x5ad1f1['attributes'][_0x774a('0x34')]?_0x5ad1f1[_0x774a('0x33')]:_0x417ac6['model'];if(_0x292813[_0x774a('0x2e')]['includeAll']){_0x5ad1f1[_0x774a('0x3e')]=[{'all':!![]}];}_0x5ad1f1=_[_0x774a('0x3b')]({},_0x5ad1f1,_0x292813[_0x774a('0x3c')]);return db[_0x774a('0x2a')][_0x774a('0x44')](_0x5ad1f1)[_0x774a('0x11')](handleEntityNotFound(_0x3ff0b2,null))[_0x774a('0x11')](respondWithResult(_0x3ff0b2,null))['catch'](handleError(_0x3ff0b2,null));};exports['update']=function(_0x598989,_0x422a87){if(_0x598989['body']['id']){delete _0x598989[_0x774a('0x45')]['id'];}return db['MailMessage'][_0x774a('0x44')]({'where':{'id':_0x598989['params']['id']}})[_0x774a('0x11')](handleEntityNotFound(_0x422a87,null))[_0x774a('0x11')](saveUpdates(_0x598989[_0x774a('0x45')],null))['then'](respondWithResult(_0x422a87,null))['catch'](handleError(_0x422a87,null));};exports[_0x774a('0x23')]=function(_0x2da211,_0x44390b){return db[_0x774a('0x2a')][_0x774a('0x44')]({'where':{'id':_0x2da211[_0x774a('0x42')]['id']}})[_0x774a('0x11')](handleEntityNotFound(_0x44390b,null))[_0x774a('0x11')](removeEntity(_0x44390b,null))[_0x774a('0x40')](handleError(_0x44390b,null));};exports['describe']=function(_0x43364a,_0x46ffb5){return db[_0x774a('0x2a')][_0x774a('0x46')]()[_0x774a('0x11')](respondWithResult(_0x46ffb5,null))[_0x774a('0x40')](handleError(_0x46ffb5,null));};exports[_0x774a('0x47')]=function(_0xeb4dac,_0xa7f822){return db[_0x774a('0x2a')][_0x774a('0x47')](_0xeb4dac[_0x774a('0x45')])['then'](function(_0x30fd3e){if(_0x30fd3e){if(_0x30fd3e['direction']==='out'&&!_0x30fd3e[_0x774a('0x48')]){var _0x252fef,_0x5e50d5,_0x4a6cbd;if(_0xeb4dac[_0x774a('0x45')]['to']){_0x5e50d5=_0xeb4dac[_0x774a('0x45')]['to']['split'](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x30fd3e[_0x774a('0x49')]},'include':[{'model':db['CmList'],'as':_0x774a('0x4a'),'include':[{'model':db['CmContact'],'as':_0x774a('0x4b'),'where':{'email':_0x5e50d5},'limit':0x1,'order':[[_0x774a('0x4c'),'DESC']]}]},{'model':db[_0x774a('0x4d')],'as':_0x774a('0x4e'),'raw':!![]}]})[_0x774a('0x11')](function(_0xb27afe){_0x252fef=_0xb27afe;if(_0x252fef&&_0x252fef[_0x774a('0x4e')]){var _0x4ad272={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x252fef[_0x774a('0x4e')][_0x774a('0x4f')])){_0x4ad272[_0x774a('0x50')]=_0x252fef[_0x774a('0x4e')][_0x774a('0x50')];_0x4ad272['port']=_0x252fef[_0x774a('0x4e')][_0x774a('0x51')];_0x4ad272[_0x774a('0x52')]=_0x252fef[_0x774a('0x4e')]['secure'];if(_0x252fef[_0x774a('0x4e')][_0x774a('0x53')]){_0x4ad272['auth']={'user':_0x252fef['Smtp'][_0x774a('0x54')],'pass':_0x252fef[_0x774a('0x4e')]['pass']};}}else{_0x4ad272[_0x774a('0x4f')]=_0x252fef[_0x774a('0x4e')][_0x774a('0x4f')];_0x4ad272['auth']={'user':_0x252fef[_0x774a('0x4e')][_0x774a('0x54')],'pass':_0x252fef[_0x774a('0x4e')]['pass']};_0x4ad272[_0x774a('0x52')]=_0x252fef[_0x774a('0x4e')][_0x774a('0x52')];}if(_0xeb4dac[_0x774a('0x45')][_0x774a('0x55')]&&_0xeb4dac[_0x774a('0x45')][_0x774a('0x55')][_0x774a('0x34')]){for(var _0x459b7e=0x0;_0x459b7e<_0xeb4dac[_0x774a('0x45')][_0x774a('0x55')][_0x774a('0x34')];_0x459b7e+=0x1){_0xeb4dac[_0x774a('0x45')]['attachments'][_0x459b7e]={'filename':_0xeb4dac[_0x774a('0x45')]['attachments'][_0x459b7e][_0x774a('0x26')],'path':path['join'](config[_0x774a('0x56')],_0x774a('0x57'),_0xeb4dac[_0x774a('0x45')][_0x774a('0x55')][_0x459b7e]['basename'])};}}_0x4a6cbd={'account':_0x4ad272,'message':_0xeb4dac['body']};return;}})[_0x774a('0x11')](function(){if(_0x252fef['List']){if(_0x252fef['List'][_0x774a('0x4b')][_0x774a('0x34')]){return _0x252fef[_0x774a('0x4a')]['Contacts'][0x0];}else{return db['CmContact'][_0x774a('0x47')](_[_0x774a('0xb')](_0xeb4dac['body'],{'firstName':_0xeb4dac[_0x774a('0x45')]['to'],'email':_0xeb4dac[_0x774a('0x45')]['to'],'phone':_0xeb4dac['body']['to'],'ListId':_0x252fef['ListId']}));}}else{throw new Error(_0x774a('0x58'));}})[_0x774a('0x11')](function(){if(_0x4a6cbd){return respondWithRpcPromise('SendMail',_0x774a('0x59'),_0x4a6cbd,client9003)[_0x774a('0x11')](function(_0x4c7690){return _0x30fd3e[_0x774a('0x5a')]({'read':!![],'messageId':_0x4c7690[_0x774a('0x5b')],'sentAt':moment()[_0x774a('0x5c')](_0x774a('0x5d'))});})['catch'](function(_0x2bc9c3){logger['error']('%s',JSON[_0x774a('0x15')](_0x2bc9c3));return _0x30fd3e;});}return _0x30fd3e;});}return _0x30fd3e;}})[_0x774a('0x11')](respondWithResult(_0xa7f822,0xc9))[_0x774a('0x40')](handleError(_0xa7f822,null));};exports[_0x774a('0x5e')]=function(_0x172f56,_0x225a63){var _0x2ce188={'agent':{},'channel':_0x774a('0x5f')};if(_0x172f56[_0x774a('0x45')]['id']){delete _0x172f56[_0x774a('0x45')]['id'];}_0x172f56[_0x774a('0x45')]['read']=!![];_0x172f56['body'][_0x774a('0x60')]=moment()[_0x774a('0x5c')](_0x774a('0x5d'));_0x172f56[_0x774a('0x45')][_0x774a('0x61')]=_0x172f56[_0x774a('0x45')][_0x774a('0x61')]||_0x172f56[_0x774a('0x54')]['id'];_0x2ce188['agent']['id']=_0x172f56[_0x774a('0x45')][_0x774a('0x61')];return db[_0x774a('0x2a')]['find']({'where':{'id':_0x172f56['params']['id'],'UserId':null}})[_0x774a('0x11')](handleEntityNotFound(_0x225a63,null))['then'](saveUpdates(_0x172f56[_0x774a('0x45')],null))[_0x774a('0x11')](function(_0x289980){if(_0x289980){_0x2ce188['message']=_0x289980[_0x774a('0x62')]({'plain':!![]});return db[_0x774a('0x63')][_0x774a('0x44')]({'where':{'id':_0x289980[_0x774a('0x64')]}});}return null;})[_0x774a('0x11')](handleEntityNotFound(_0x225a63,null))[_0x774a('0x11')](function(_0x437487){if(_0x437487){return _0x437487[_0x774a('0x5a')]({'UserId':_0x172f56[_0x774a('0x45')][_0x774a('0x61')],'read1stAt':_['isNil'](_0x437487[_0x774a('0x65')])?moment()[_0x774a('0x5c')](_0x774a('0x5d')):undefined});}return null;})[_0x774a('0x11')](function(_0x2b731d){if(_0x2b731d){_0x2ce188['interaction']=_0x2b731d['get']({'plain':!![]});interaction_log[_0x774a('0x19')](_0x774a('0x66'),_0x172f56[_0x774a('0x54')]['id'],_0x172f56[_0x774a('0x54')][_0x774a('0x26')],_0x172f56[_0x774a('0x54')]['role'],_0x2ce188['interaction']['id'],_0x172f56[_0x774a('0x45')]?JSON[_0x774a('0x15')](_0x172f56[_0x774a('0x45')]):_0x774a('0x67'));return respondWithRpcPromise(_0x774a('0x68'),'acceptMessage',_0x2ce188);}return null;})[_0x774a('0x11')](function(_0x4421fc){var _0x2b2969='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4421fc[_0x774a('0x18')][_0x774a('0x69')];return db[_0x774a('0x6a')][_0x774a('0x2e')](_0x2b2969,{'type':db[_0x774a('0x6b')]['QueryTypes'][_0x774a('0x6c')],'raw':!![]})['then'](function(_0x4d216b){return _0x4d216b;});})[_0x774a('0x11')](function(_0x5ddd5c){if(_0x5ddd5c){_0x2ce188[_0x774a('0x18')][_0x774a('0x6d')]=_0x5ddd5c[0x0];if(!_0x172f56['body'][_0x774a('0x61')])return;return db[_0x774a('0x6e')][_0x774a('0x44')]({'where':{'id':_0x172f56['body'][_0x774a('0x61')],'role':_0x774a('0x6f')},'attributes':['id',_0x774a('0x26'),_0x774a('0x70'),_0x774a('0x71'),_0x774a('0x72')],'raw':!![]});}return null;})[_0x774a('0x11')](function(_0x55ce4b){if(!_0x55ce4b)return null;_0x2ce188[_0x774a('0x18')]['agent']=_0x55ce4b;return _0x2ce188;})['then'](function(_0xf10de3){if(_0xf10de3){if(_0x172f56[_0x774a('0x45')][_0x774a('0x73')]){_0x2ce188[_0x774a('0x18')][_0x774a('0x74')]=util[_0x774a('0x5c')](_0x774a('0x75'),_0x172f56[_0x774a('0x54')][_0x774a('0x26')]);_0x2ce188[_0x774a('0x18')][_0x774a('0x76')]=_0x2ce188[_0x774a('0x76')];_0x2ce188[_0x774a('0x18')][_0x774a('0x77')]=_0x774a('0x5e');_0x2ce188[_0x774a('0x18')]['body']=htmlToText[_0x774a('0x78')](_0x2ce188[_0x774a('0x18')][_0x774a('0x45')]);return respondWithRpcPromise(_0x774a('0x79'),_0x774a('0x79'),{'event':'acceptmessage','message':_0x2ce188[_0x774a('0x18')]},client9002)['then'](function(){return _0x2ce188;});}return _0x2ce188;}return null;})[_0x774a('0x11')](respondWithResult(_0x225a63,null))['catch'](handleError(_0x225a63,null));};exports[_0x774a('0x7a')]=function(_0x463c67,_0x392e8a){var _0x3cb216={'agent':{},'channel':'mail'};if(_0x463c67[_0x774a('0x45')]['id']){delete _0x463c67[_0x774a('0x45')]['id'];}_0x463c67[_0x774a('0x45')]['UserId']=_0x463c67['body'][_0x774a('0x61')]||_0x463c67[_0x774a('0x54')]['id'];_0x3cb216[_0x774a('0x6f')]['id']=_0x463c67[_0x774a('0x45')][_0x774a('0x61')];return db[_0x774a('0x2a')][_0x774a('0x44')]({'where':{'id':_0x463c67[_0x774a('0x42')]['id'],'UserId':null}})[_0x774a('0x11')](handleEntityNotFound(_0x392e8a,null))[_0x774a('0x11')](function(_0x271eca){if(_0x271eca){_0x3cb216['message']=_0x271eca[_0x774a('0x62')]({'plain':!![]});return db[_0x774a('0x63')][_0x774a('0x44')]({'where':{'id':_0x271eca[_0x774a('0x64')]}});}return null;})[_0x774a('0x11')](handleEntityNotFound(_0x392e8a,null))[_0x774a('0x11')](function(_0x450f7c){if(_0x450f7c){_0x3cb216[_0x774a('0x7b')]=_0x450f7c[_0x774a('0x62')]({'plain':!![]});interaction_log[_0x774a('0x19')](_0x774a('0x7c'),_0x463c67[_0x774a('0x54')]['id'],_0x463c67[_0x774a('0x54')]['name'],_0x463c67[_0x774a('0x54')][_0x774a('0x7d')],_0x3cb216[_0x774a('0x7b')]['id'],_0x463c67['body']?JSON[_0x774a('0x15')](_0x463c67[_0x774a('0x45')]):_0x774a('0x67'));return respondWithRpcPromise('RejectMessage',_0x774a('0x7e'),_0x3cb216);}return null;})[_0x774a('0x11')](function(_0x59ff25){var _0xa64234='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x59ff25[_0x774a('0x18')]['ContactId'];return db[_0x774a('0x6a')][_0x774a('0x2e')](_0xa64234,{'type':db[_0x774a('0x6b')][_0x774a('0x7f')][_0x774a('0x6c')],'raw':!![]})['then'](function(_0x802f8e){return _0x802f8e;});})[_0x774a('0x11')](function(_0x3507b1){if(_0x3507b1){_0x3cb216[_0x774a('0x18')][_0x774a('0x6d')]=_0x3507b1[0x0];if(!_0x463c67[_0x774a('0x45')][_0x774a('0x61')])return;return db['User'][_0x774a('0x44')]({'where':{'id':_0x463c67[_0x774a('0x45')]['UserId'],'role':_0x774a('0x6f')},'attributes':['id',_0x774a('0x26'),_0x774a('0x70'),_0x774a('0x71'),'internal'],'raw':!![]});}return null;})[_0x774a('0x11')](function(_0x26d489){if(!_0x26d489)return null;_0x3cb216[_0x774a('0x18')][_0x774a('0x6f')]=_0x26d489;return _0x3cb216;})['then'](function(_0x418c4a){if(_0x418c4a){_0x418c4a['message'][_0x774a('0x74')]=util[_0x774a('0x5c')](_0x774a('0x75'),_0x463c67['user'][_0x774a('0x26')]);_0x418c4a['message'][_0x774a('0x76')]=_0x3cb216[_0x774a('0x76')];_0x418c4a[_0x774a('0x18')][_0x774a('0x77')]=_0x774a('0x7a');_0x418c4a[_0x774a('0x18')][_0x774a('0x45')]=htmlToText['fromString'](_0x3cb216[_0x774a('0x18')][_0x774a('0x45')]);respondWithRpcPromise(_0x774a('0x79'),'EventManager',{'event':_0x774a('0x80'),'message':_0x418c4a[_0x774a('0x18')]},client9002);return _0x3cb216;}return null;})[_0x774a('0x11')](respondWithResult(_0x392e8a,null))[_0x774a('0x40')](handleError(_0x392e8a,null));};exports[_0x774a('0x81')]=function(_0xcf80a9,_0x517efc){var _0x1d7cb7=moment()[_0x774a('0x82')]()[_0x774a('0x83')]();var _0x2827ae=path[_0x774a('0x84')](config[_0x774a('0x56')],_0x774a('0x85'),'files',_0x774a('0x86'));var _0x5a4fad=path['join'](config[_0x774a('0x56')],_0x774a('0x85'),_0x774a('0x87'),_0x774a('0x55'));var _0x1f9a0f=util[_0x774a('0x5c')]('message-%s.eml',_0x1d7cb7);return db['MailMessage']['find']({'where':{'id':_0xcf80a9[_0x774a('0x42')]['id']},'attributes':['id',_0x774a('0x45'),_0x774a('0x88'),'to','cc','bcc',_0x774a('0x89'),_0x774a('0x8a')],'include':_0xcf80a9[_0x774a('0x2e')]['attachments']?[{'model':db[_0x774a('0x8b')],'as':_0x774a('0x8c')}]:undefined})[_0x774a('0x11')](handleEntityNotFound(_0x517efc,null))['then'](function(_0x2b684e){if(_0x2b684e){var _0x142aec=_0x2b684e;var _0x5a4da6={'from':_0x142aec[_0x774a('0x88')],'to':_0x142aec['to'],'subject':_0x142aec[_0x774a('0x89')],'html':htmlEntities['decode'](_0x142aec[_0x774a('0x45')]),'headers':{'Date':moment(_0x142aec[_0x774a('0x8a')])[_0x774a('0x5c')](_0x774a('0x8d'))},'attachments':[]};if(_0x2b684e['cc']){_0x5a4da6[_0x774a('0x8e')]['Cc']=_0x2b684e['cc'];}if(_0x2b684e[_0x774a('0x8f')]){_0x5a4da6[_0x774a('0x8e')]['Bcc']=_0x2b684e['bcc'];}return new BPromise(function(_0x367411,_0x1c56f0){if(_0x2b684e[_0x774a('0x8c')]){for(var _0x92652b=0x0;_0x92652b<_0x2b684e['Attachments'][_0x774a('0x34')];_0x92652b++){var _0x425244=_0x2b684e[_0x774a('0x8c')][_0x92652b];var _0x439f12=path[_0x774a('0x84')](_0x5a4fad,_0x425244[_0x774a('0x90')]);if(fs[_0x774a('0x91')](_0x439f12)){_0x5a4da6[_0x774a('0x55')][_0x774a('0x92')]({'name':_0x425244[_0x774a('0x26')],'contentType':_0x425244[_0x774a('0x2c')],'data':fs['readFileSync'](_0x439f12)});}}}emlformat[_0x774a('0x93')](_0x5a4da6,function(_0x4d6f81,_0x1590c8){if(_0x4d6f81)return _0x1c56f0(_0x4d6f81);fs[_0x774a('0x94')](path[_0x774a('0x84')](_0x2827ae,_0x1f9a0f),_0x1590c8);return _0x367411(_0x1590c8);});});}})[_0x774a('0x11')](function(_0x2bcbb){if(_0x2bcbb){return _0x517efc[_0x774a('0x81')](path[_0x774a('0x84')](_0x2827ae,_0x1f9a0f),_0x1f9a0f,function(_0xbf0f71){if(!_0xbf0f71)fs[_0x774a('0x95')](path[_0x774a('0x84')](_0x2827ae,_0x1f9a0f));});}})[_0x774a('0x40')](handleError(_0x517efc,null));}; \ No newline at end of file +var _0x67a7=['[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','contact','rejectmessage','unix','toString','files','tmp','root','server','message-%s.eml','from','bcc','Attachments','decode','createdAt','Bcc','existsSync','push','build','writeFileSync','unlinkSync','util','path','lodash','ioredis','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','html-entities','./mailMessage.socket','client','http','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','MailMessage','includeAll','include','findAll','catch','show','params','find','body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','pass','auth','user','attachments','length','join','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','read','readAt','UserId','get','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','mail','MailInteraction','MailInteractionId'];(function(_0x4374af,_0x491c9e){var _0x27ae4e=function(_0x4b695e){while(--_0x4b695e){_0x4374af['push'](_0x4374af['shift']());}};_0x27ae4e(++_0x491c9e);}(_0x67a7,0x159));var _0x767a=function(_0x40faf2,_0x5881c9){_0x40faf2=_0x40faf2-0x0;var _0xb3c793=_0x67a7[_0x40faf2];return _0xb3c793;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x767a('0x0'));var path=require(_0x767a('0x1'));var fs=require('fs');var _=require(_0x767a('0x2'));var Redis=require(_0x767a('0x3'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0x767a('0x4'))(_0x767a('0x5'));var interaction_log=require('../../config/logger')(_0x767a('0x6'));var config=require(_0x767a('0x7'));var db=require(_0x767a('0x8'))['db'];config[_0x767a('0x9')]=_['defaults'](config[_0x767a('0x9')],{'host':_0x767a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x767a('0x9')]));var htmlEntities=require(_0x767a('0xb'));require(_0x767a('0xc'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x767a('0xd')][_0x767a('0xe')]({'port':0x232b});var client9002=jayson['client'][_0x767a('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x19aefc,_0x298637,_0x17a775,_0x10a0fd){return new BPromise(function(_0x34270f,_0x12bcbb){var _0x435444=_0x10a0fd||client;return _0x435444['request'](_0x19aefc,_0x17a775)[_0x767a('0xf')](function(_0x532dbc){logger['info'](_0x767a('0x10'),_0x298637,_0x767a('0x11'));logger[_0x767a('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x298637,_0x767a('0x11'),JSON['stringify'](_0x532dbc));if(_0x532dbc['error']){if(_0x532dbc[_0x767a('0x13')]['code']===0x1f4){logger[_0x767a('0x13')]('MailMessage,\x20%s,\x20%s',_0x298637,_0x532dbc[_0x767a('0x13')][_0x767a('0x14')]);return _0x12bcbb(_0x532dbc[_0x767a('0x13')][_0x767a('0x14')]);}logger[_0x767a('0x13')](_0x767a('0x10'),_0x298637,_0x532dbc[_0x767a('0x13')][_0x767a('0x14')]);return _0x34270f(_0x532dbc[_0x767a('0x13')][_0x767a('0x14')]);}else{logger[_0x767a('0x15')]('MailMessage,\x20%s,\x20%s',_0x298637,_0x767a('0x11'));_0x34270f(_0x532dbc[_0x767a('0x16')][_0x767a('0x14')]);}})['catch'](function(_0x191828){logger[_0x767a('0x13')]('MailMessage,\x20%s,\x20%s',_0x298637,_0x191828);_0x12bcbb(_0x191828);});});}function respondWithResult(_0x1c4df6,_0x8063d6){_0x8063d6=_0x8063d6||0xc8;return function(_0x2793e3){if(_0x2793e3){return _0x1c4df6[_0x767a('0x17')](_0x8063d6)[_0x767a('0x18')](_0x2793e3);}};}function respondWithFilteredResult(_0x12c9eb,_0x3a3ed7){return function(_0x307a8){if(_0x307a8){var _0x3f109a=typeof _0x3a3ed7[_0x767a('0x19')]==='undefined'&&typeof _0x3a3ed7[_0x767a('0x1a')]===_0x767a('0x1b');var _0x2dac32=_0x307a8[_0x767a('0x1c')];var _0x209e44=_0x3f109a?0x0:_0x3a3ed7[_0x767a('0x19')];var _0x3c6979=_0x3f109a?_0x307a8[_0x767a('0x1c')]:_0x3a3ed7[_0x767a('0x19')]+_0x3a3ed7['limit'];var _0x43dba2;if(_0x3c6979>=_0x2dac32){_0x3c6979=_0x2dac32;_0x43dba2=0xc8;}else{_0x43dba2=0xce;}_0x12c9eb['status'](_0x43dba2);return _0x12c9eb[_0x767a('0x1d')](_0x767a('0x1e'),_0x209e44+'-'+_0x3c6979+'/'+_0x2dac32)[_0x767a('0x18')](_0x307a8);}return null;};}function saveUpdates(_0x59a2c2){return function(_0x59a86d){if(_0x59a86d){return _0x59a86d[_0x767a('0x1f')](_0x59a2c2)[_0x767a('0xf')](function(_0x1a3bf9){return _0x1a3bf9;});}return null;};}function removeEntity(_0x438f12){return function(_0x344fef){if(_0x344fef){return _0x344fef[_0x767a('0x20')]()[_0x767a('0xf')](function(){_0x438f12[_0x767a('0x17')](0xcc)[_0x767a('0x21')]();});}};}function handleEntityNotFound(_0x5a268d){return function(_0x3f0865){if(!_0x3f0865){_0x5a268d[_0x767a('0x22')](0x194);}return _0x3f0865;};}function handleError(_0x4dcd12,_0x517590){_0x517590=_0x517590||0x1f4;return function(_0x2db40b){logger[_0x767a('0x13')](_0x2db40b[_0x767a('0x23')]);if(_0x2db40b['name']){delete _0x2db40b[_0x767a('0x24')];}_0x4dcd12[_0x767a('0x17')](_0x517590)[_0x767a('0x25')](_0x2db40b);};}exports[_0x767a('0x26')]=function(_0x725100,_0x4312d9){var _0x1bab0b={},_0x4939fc={},_0x223ebf={'count':0x0,'rows':[]};var _0x2a02e0=_['map'](db['MailMessage'][_0x767a('0x27')],function(_0x6f5a66){return{'name':_0x6f5a66[_0x767a('0x28')],'type':_0x6f5a66[_0x767a('0x29')][_0x767a('0x2a')]};});_0x4939fc[_0x767a('0x2b')]=_[_0x767a('0x2c')](_0x2a02e0,'name');_0x4939fc[_0x767a('0x2d')]=_[_0x767a('0x2e')](_0x725100[_0x767a('0x2d')]);_0x4939fc[_0x767a('0x2f')]=_[_0x767a('0x30')](_0x4939fc[_0x767a('0x2b')],_0x4939fc[_0x767a('0x2d')]);_0x1bab0b[_0x767a('0x31')]=_[_0x767a('0x30')](_0x4939fc[_0x767a('0x2b')],qs[_0x767a('0x32')](_0x725100[_0x767a('0x2d')]['fields']));_0x1bab0b['attributes']=_0x1bab0b['attributes']['length']?_0x1bab0b[_0x767a('0x31')]:_0x4939fc[_0x767a('0x2b')];if(!_0x725100[_0x767a('0x2d')]['hasOwnProperty'](_0x767a('0x33'))){_0x1bab0b[_0x767a('0x1a')]=qs[_0x767a('0x1a')](_0x725100['query'][_0x767a('0x1a')]);_0x1bab0b['offset']=qs[_0x767a('0x19')](_0x725100['query'][_0x767a('0x19')]);}_0x1bab0b[_0x767a('0x34')]=qs['sort'](_0x725100['query'][_0x767a('0x35')]);_0x1bab0b['where']=qs[_0x767a('0x2f')](_[_0x767a('0x36')](_0x725100[_0x767a('0x2d')],_0x4939fc[_0x767a('0x2f')]),_0x2a02e0);if(_0x725100[_0x767a('0x2d')]['filter']){_0x1bab0b['where']=_[_0x767a('0x37')](_0x1bab0b[_0x767a('0x38')],{'$or':_['map'](_0x2a02e0,function(_0x3a0cee){if(_0x3a0cee[_0x767a('0x29')]!==_0x767a('0x39')){var _0xa94464={};_0xa94464[_0x3a0cee[_0x767a('0x24')]]={'$like':'%'+_0x725100['query'][_0x767a('0x3a')]+'%'};return _0xa94464;}})});}_0x1bab0b=_['merge']({},_0x1bab0b,_0x725100[_0x767a('0x3b')]);var _0x455679={'where':_0x1bab0b[_0x767a('0x38')]};return db[_0x767a('0x3c')]['count'](_0x455679)[_0x767a('0xf')](function(_0xa60a0e){_0x223ebf[_0x767a('0x1c')]=_0xa60a0e;if(_0x725100[_0x767a('0x2d')][_0x767a('0x3d')]){_0x1bab0b[_0x767a('0x3e')]=[{'all':!![]}];}return db[_0x767a('0x3c')][_0x767a('0x3f')](_0x1bab0b);})['then'](function(_0x5bc61a){_0x223ebf['rows']=_0x5bc61a;return _0x223ebf;})['then'](respondWithFilteredResult(_0x4312d9,_0x1bab0b))[_0x767a('0x40')](handleError(_0x4312d9,null));};exports[_0x767a('0x41')]=function(_0x245fd0,_0x3c5d14){var _0x42516f={'raw':!![],'where':{'id':_0x245fd0[_0x767a('0x42')]['id']}},_0x53a2e4={};_0x53a2e4[_0x767a('0x2b')]=_[_0x767a('0x2e')](db[_0x767a('0x3c')][_0x767a('0x27')]);_0x53a2e4[_0x767a('0x2d')]=_['keys'](_0x245fd0[_0x767a('0x2d')]);_0x53a2e4[_0x767a('0x2f')]=_['intersection'](_0x53a2e4[_0x767a('0x2b')],_0x53a2e4[_0x767a('0x2d')]);_0x42516f[_0x767a('0x31')]=_[_0x767a('0x30')](_0x53a2e4[_0x767a('0x2b')],qs[_0x767a('0x32')](_0x245fd0[_0x767a('0x2d')][_0x767a('0x32')]));_0x42516f['attributes']=_0x42516f[_0x767a('0x31')]['length']?_0x42516f['attributes']:_0x53a2e4[_0x767a('0x2b')];if(_0x245fd0[_0x767a('0x2d')][_0x767a('0x3d')]){_0x42516f['include']=[{'all':!![]}];}_0x42516f=_['merge']({},_0x42516f,_0x245fd0[_0x767a('0x3b')]);return db[_0x767a('0x3c')][_0x767a('0x43')](_0x42516f)[_0x767a('0xf')](handleEntityNotFound(_0x3c5d14,null))['then'](respondWithResult(_0x3c5d14,null))[_0x767a('0x40')](handleError(_0x3c5d14,null));};exports['update']=function(_0xcfd2ac,_0x88dc04){if(_0xcfd2ac['body']['id']){delete _0xcfd2ac[_0x767a('0x44')]['id'];}return db[_0x767a('0x3c')][_0x767a('0x43')]({'where':{'id':_0xcfd2ac[_0x767a('0x42')]['id']}})[_0x767a('0xf')](handleEntityNotFound(_0x88dc04,null))['then'](saveUpdates(_0xcfd2ac[_0x767a('0x44')],null))[_0x767a('0xf')](respondWithResult(_0x88dc04,null))[_0x767a('0x40')](handleError(_0x88dc04,null));};exports[_0x767a('0x20')]=function(_0x928fc7,_0x210796){return db['MailMessage'][_0x767a('0x43')]({'where':{'id':_0x928fc7[_0x767a('0x42')]['id']}})['then'](handleEntityNotFound(_0x210796,null))[_0x767a('0xf')](removeEntity(_0x210796,null))[_0x767a('0x40')](handleError(_0x210796,null));};exports['describe']=function(_0x37e61e,_0x31c304){return db[_0x767a('0x3c')][_0x767a('0x45')]()[_0x767a('0xf')](respondWithResult(_0x31c304,null))[_0x767a('0x40')](handleError(_0x31c304,null));};exports[_0x767a('0x46')]=function(_0xc28f6a,_0x2eadec){return db[_0x767a('0x3c')][_0x767a('0x46')](_0xc28f6a[_0x767a('0x44')])[_0x767a('0xf')](function(_0x3e23e1){if(_0x3e23e1){if(_0x3e23e1[_0x767a('0x47')]===_0x767a('0x48')&&!_0x3e23e1[_0x767a('0x49')]){var _0x22bdba,_0x8ed5c,_0x2665a3;if(_0xc28f6a['body']['to']){_0x8ed5c=_0xc28f6a[_0x767a('0x44')]['to']['split'](',')[0x0];}return db[_0x767a('0x4a')][_0x767a('0x4b')]({'where':{'id':_0x3e23e1[_0x767a('0x4c')]},'include':[{'model':db[_0x767a('0x4d')],'as':_0x767a('0x4e'),'include':[{'model':db[_0x767a('0x4f')],'as':'Contacts','where':{'email':_0x8ed5c},'limit':0x1,'order':[['updatedAt',_0x767a('0x50')]]}]},{'model':db[_0x767a('0x51')],'as':'Smtp','raw':!![]}]})[_0x767a('0xf')](function(_0x4cca51){_0x22bdba=_0x4cca51;if(_0x22bdba&&_0x22bdba[_0x767a('0x52')]){var _0x22481b={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x22bdba[_0x767a('0x52')][_0x767a('0x53')])){_0x22481b[_0x767a('0x54')]=_0x22bdba[_0x767a('0x52')]['host'];_0x22481b['port']=_0x22bdba[_0x767a('0x52')][_0x767a('0x55')];_0x22481b[_0x767a('0x56')]=_0x22bdba['Smtp'][_0x767a('0x56')];if(_0x22bdba['Smtp'][_0x767a('0x57')]){_0x22481b['auth']={'user':_0x22bdba[_0x767a('0x52')]['user'],'pass':_0x22bdba[_0x767a('0x52')][_0x767a('0x58')]};}}else{_0x22481b[_0x767a('0x53')]=_0x22bdba[_0x767a('0x52')]['service'];_0x22481b[_0x767a('0x59')]={'user':_0x22bdba[_0x767a('0x52')][_0x767a('0x5a')],'pass':_0x22bdba['Smtp'][_0x767a('0x58')]};_0x22481b['secure']=_0x22bdba['Smtp'][_0x767a('0x56')];}if(_0xc28f6a[_0x767a('0x44')][_0x767a('0x5b')]&&_0xc28f6a[_0x767a('0x44')]['attachments'][_0x767a('0x5c')]){for(var _0x118c8c=0x0;_0x118c8c<_0xc28f6a['body'][_0x767a('0x5b')][_0x767a('0x5c')];_0x118c8c+=0x1){_0xc28f6a[_0x767a('0x44')][_0x767a('0x5b')][_0x118c8c]={'filename':_0xc28f6a[_0x767a('0x44')][_0x767a('0x5b')][_0x118c8c][_0x767a('0x24')],'path':path[_0x767a('0x5d')](config['root'],_0x767a('0x5e'),_0xc28f6a[_0x767a('0x44')][_0x767a('0x5b')][_0x118c8c][_0x767a('0x5f')])};}}_0x2665a3={'account':_0x22481b,'message':_0xc28f6a[_0x767a('0x44')]};return;}})[_0x767a('0xf')](function(){if(_0x22bdba['List']){if(_0x22bdba[_0x767a('0x4e')]['Contacts']['length']){return _0x22bdba['List'][_0x767a('0x60')][0x0];}else{return db[_0x767a('0x4f')]['create'](_['defaults'](_0xc28f6a[_0x767a('0x44')],{'firstName':_0xc28f6a['body']['to'],'email':_0xc28f6a[_0x767a('0x44')]['to'],'phone':_0xc28f6a[_0x767a('0x44')]['to'],'ListId':_0x22bdba[_0x767a('0x61')]}));}}else{throw new Error(_0x767a('0x62'));}})['then'](function(){if(_0x2665a3){return respondWithRpcPromise(_0x767a('0x63'),_0x767a('0x64'),_0x2665a3,client9003)[_0x767a('0xf')](function(_0x3e6974){return _0x3e23e1[_0x767a('0x1f')]({'read':!![],'messageId':_0x3e6974[_0x767a('0x65')],'sentAt':moment()[_0x767a('0x66')](_0x767a('0x67'))});})['catch'](function(_0x115463){logger[_0x767a('0x13')]('%s',JSON[_0x767a('0x68')](_0x115463));return _0x3e23e1;});}return _0x3e23e1;});}return _0x3e23e1;}})[_0x767a('0xf')](respondWithResult(_0x2eadec,0xc9))[_0x767a('0x40')](handleError(_0x2eadec,null));};exports['accept']=function(_0x378ffb,_0x1ab194){var _0xf98cc8={'agent':{},'channel':'mail'};if(_0x378ffb[_0x767a('0x44')]['id']){delete _0x378ffb[_0x767a('0x44')]['id'];}_0x378ffb[_0x767a('0x44')][_0x767a('0x69')]=!![];_0x378ffb['body'][_0x767a('0x6a')]=moment()[_0x767a('0x66')]('YYYY-MM-DD\x20HH:mm:ss');_0x378ffb[_0x767a('0x44')]['UserId']=_0x378ffb['body'][_0x767a('0x6b')]||_0x378ffb[_0x767a('0x5a')]['id'];_0xf98cc8['agent']['id']=_0x378ffb['body']['UserId'];return db['MailMessage'][_0x767a('0x43')]({'where':{'id':_0x378ffb[_0x767a('0x42')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1ab194,null))[_0x767a('0xf')](saveUpdates(_0x378ffb[_0x767a('0x44')],null))[_0x767a('0xf')](function(_0x1ef18e){if(_0x1ef18e){_0xf98cc8[_0x767a('0x14')]=_0x1ef18e[_0x767a('0x6c')]({'plain':!![]});return db['MailInteraction'][_0x767a('0x43')]({'where':{'id':_0x1ef18e['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1ab194,null))[_0x767a('0xf')](function(_0x48b320){if(_0x48b320){return _0x48b320['update']({'UserId':_0x378ffb[_0x767a('0x44')][_0x767a('0x6b')],'read1stAt':_[_0x767a('0x6d')](_0x48b320[_0x767a('0x6e')])?moment()[_0x767a('0x66')](_0x767a('0x67')):undefined});}return null;})[_0x767a('0xf')](function(_0x1c6999){if(_0x1c6999){_0xf98cc8[_0x767a('0x6f')]=_0x1c6999[_0x767a('0x6c')]({'plain':!![]});interaction_log['info'](_0x767a('0x70'),_0x378ffb[_0x767a('0x5a')]['id'],_0x378ffb['user'][_0x767a('0x24')],_0x378ffb[_0x767a('0x5a')][_0x767a('0x71')],_0xf98cc8[_0x767a('0x6f')]['id'],_0x378ffb[_0x767a('0x44')]?JSON[_0x767a('0x68')](_0x378ffb[_0x767a('0x44')]):'null');return respondWithRpcPromise(_0x767a('0x72'),_0x767a('0x73'),_0xf98cc8);}return null;})[_0x767a('0xf')](function(_0x2f4986){var _0x1f6d7e=_0x767a('0x74')+_0x2f4986['message'][_0x767a('0x75')];return db[_0x767a('0x76')][_0x767a('0x2d')](_0x1f6d7e,{'type':db[_0x767a('0x77')][_0x767a('0x78')][_0x767a('0x79')],'raw':!![]})[_0x767a('0xf')](function(_0x539c27){return _0x539c27;});})['then'](function(_0x5949ca){if(_0x5949ca){_0xf98cc8[_0x767a('0x14')]['contact']=_0x5949ca[0x0];if(!_0x378ffb['body'][_0x767a('0x6b')])return;return db[_0x767a('0x7a')][_0x767a('0x43')]({'where':{'id':_0x378ffb[_0x767a('0x44')][_0x767a('0x6b')],'role':_0x767a('0x7b')},'attributes':['id',_0x767a('0x24'),'fullname',_0x767a('0x7c'),_0x767a('0x7d')],'raw':!![]});}return null;})[_0x767a('0xf')](function(_0x37c7f8){if(!_0x37c7f8)return null;_0xf98cc8[_0x767a('0x14')][_0x767a('0x7b')]=_0x37c7f8;return _0xf98cc8;})[_0x767a('0xf')](function(_0x44875a){if(_0x44875a){if(_0x378ffb['body'][_0x767a('0x7e')]){_0xf98cc8[_0x767a('0x14')][_0x767a('0x7f')]=util[_0x767a('0x66')](_0x767a('0x80'),_0x378ffb[_0x767a('0x5a')][_0x767a('0x24')]);_0xf98cc8['message'][_0x767a('0x81')]=_0xf98cc8['channel'];_0xf98cc8['message'][_0x767a('0x82')]='accept';_0xf98cc8[_0x767a('0x14')]['body']=htmlToText[_0x767a('0x83')](_0xf98cc8['message'][_0x767a('0x44')]);return respondWithRpcPromise('EventManager',_0x767a('0x84'),{'event':_0x767a('0x85'),'message':_0xf98cc8['message']},client9002)[_0x767a('0xf')](function(){return _0xf98cc8;});}return _0xf98cc8;}return null;})['then'](respondWithResult(_0x1ab194,null))['catch'](handleError(_0x1ab194,null));};exports[_0x767a('0x86')]=function(_0x331cb1,_0x103709){var _0x17592c={'agent':{},'channel':_0x767a('0x87')};if(_0x331cb1['body']['id']){delete _0x331cb1[_0x767a('0x44')]['id'];}_0x331cb1[_0x767a('0x44')][_0x767a('0x6b')]=_0x331cb1[_0x767a('0x44')][_0x767a('0x6b')]||_0x331cb1[_0x767a('0x5a')]['id'];_0x17592c[_0x767a('0x7b')]['id']=_0x331cb1[_0x767a('0x44')][_0x767a('0x6b')];return db[_0x767a('0x3c')]['find']({'where':{'id':_0x331cb1[_0x767a('0x42')]['id'],'UserId':null}})[_0x767a('0xf')](handleEntityNotFound(_0x103709,null))[_0x767a('0xf')](function(_0x383155){if(_0x383155){_0x17592c[_0x767a('0x14')]=_0x383155['get']({'plain':!![]});return db[_0x767a('0x88')][_0x767a('0x43')]({'where':{'id':_0x383155[_0x767a('0x89')]}});}return null;})['then'](handleEntityNotFound(_0x103709,null))[_0x767a('0xf')](function(_0x48c57c){if(_0x48c57c){_0x17592c['interaction']=_0x48c57c[_0x767a('0x6c')]({'plain':!![]});interaction_log['info'](_0x767a('0x8a'),_0x331cb1[_0x767a('0x5a')]['id'],_0x331cb1[_0x767a('0x5a')][_0x767a('0x24')],_0x331cb1[_0x767a('0x5a')]['role'],_0x17592c[_0x767a('0x6f')]['id'],_0x331cb1[_0x767a('0x44')]?JSON[_0x767a('0x68')](_0x331cb1[_0x767a('0x44')]):_0x767a('0x8b'));return respondWithRpcPromise('RejectMessage',_0x767a('0x8c'),_0x17592c);}return null;})[_0x767a('0xf')](function(_0x26531e){var _0xacfd3d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26531e['message'][_0x767a('0x75')];return db[_0x767a('0x76')][_0x767a('0x2d')](_0xacfd3d,{'type':db[_0x767a('0x77')][_0x767a('0x78')][_0x767a('0x79')],'raw':!![]})[_0x767a('0xf')](function(_0x3af45e){return _0x3af45e;});})[_0x767a('0xf')](function(_0x11b84c){if(_0x11b84c){_0x17592c[_0x767a('0x14')][_0x767a('0x8d')]=_0x11b84c[0x0];if(!_0x331cb1[_0x767a('0x44')][_0x767a('0x6b')])return;return db[_0x767a('0x7a')]['find']({'where':{'id':_0x331cb1[_0x767a('0x44')][_0x767a('0x6b')],'role':_0x767a('0x7b')},'attributes':['id',_0x767a('0x24'),'fullname',_0x767a('0x7c'),'internal'],'raw':!![]});}return null;})['then'](function(_0x13462c){if(!_0x13462c)return null;_0x17592c[_0x767a('0x14')][_0x767a('0x7b')]=_0x13462c;return _0x17592c;})[_0x767a('0xf')](function(_0x2876a9){if(_0x2876a9){_0x2876a9[_0x767a('0x14')][_0x767a('0x7f')]=util[_0x767a('0x66')](_0x767a('0x80'),_0x331cb1[_0x767a('0x5a')][_0x767a('0x24')]);_0x2876a9['message']['channel']=_0x17592c[_0x767a('0x81')];_0x2876a9[_0x767a('0x14')]['event']='reject';_0x2876a9[_0x767a('0x14')]['body']=htmlToText[_0x767a('0x83')](_0x17592c[_0x767a('0x14')][_0x767a('0x44')]);respondWithRpcPromise(_0x767a('0x84'),_0x767a('0x84'),{'event':_0x767a('0x8e'),'message':_0x2876a9[_0x767a('0x14')]},client9002);return _0x17592c;}return null;})[_0x767a('0xf')](respondWithResult(_0x103709,null))[_0x767a('0x40')](handleError(_0x103709,null));};exports['download']=function(_0x40043c,_0x2265e0){var _0x52e3f2=moment()[_0x767a('0x8f')]()[_0x767a('0x90')]();var _0x4ff236=path['join'](config['root'],'server',_0x767a('0x91'),_0x767a('0x92'));var _0x127b0b=path[_0x767a('0x5d')](config[_0x767a('0x93')],_0x767a('0x94'),_0x767a('0x91'),'attachments');var _0x253fd9=util['format'](_0x767a('0x95'),_0x52e3f2);return db[_0x767a('0x3c')][_0x767a('0x43')]({'where':{'id':_0x40043c['params']['id']},'attributes':['id',_0x767a('0x44'),_0x767a('0x96'),'to','cc',_0x767a('0x97'),'subject','createdAt'],'include':_0x40043c[_0x767a('0x2d')][_0x767a('0x5b')]?[{'model':db['Attachment'],'as':_0x767a('0x98')}]:undefined})[_0x767a('0xf')](handleEntityNotFound(_0x2265e0,null))['then'](function(_0x190fff){if(_0x190fff){var _0x271270=_0x190fff;var _0xf36da1={'from':_0x271270['from'],'to':_0x271270['to'],'subject':_0x271270['subject'],'html':htmlEntities[_0x767a('0x99')](_0x271270[_0x767a('0x44')]),'headers':{'Date':moment(_0x271270[_0x767a('0x9a')])[_0x767a('0x66')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x190fff['cc']){_0xf36da1['headers']['Cc']=_0x190fff['cc'];}if(_0x190fff[_0x767a('0x97')]){_0xf36da1['headers'][_0x767a('0x9b')]=_0x190fff[_0x767a('0x97')];}return new BPromise(function(_0x518dc1,_0x109a16){if(_0x190fff[_0x767a('0x98')]){for(var _0x4147b1=0x0;_0x4147b1<_0x190fff[_0x767a('0x98')][_0x767a('0x5c')];_0x4147b1++){var _0x47fefa=_0x190fff[_0x767a('0x98')][_0x4147b1];var _0x4725de=path[_0x767a('0x5d')](_0x127b0b,_0x47fefa[_0x767a('0x5f')]);if(fs[_0x767a('0x9c')](_0x4725de)){_0xf36da1[_0x767a('0x5b')][_0x767a('0x9d')]({'name':_0x47fefa[_0x767a('0x24')],'contentType':_0x47fefa[_0x767a('0x29')],'data':fs['readFileSync'](_0x4725de)});}}}emlformat[_0x767a('0x9e')](_0xf36da1,function(_0xde8832,_0x2adb9a){if(_0xde8832)return _0x109a16(_0xde8832);fs[_0x767a('0x9f')](path['join'](_0x4ff236,_0x253fd9),_0x2adb9a);return _0x518dc1(_0x2adb9a);});});}})[_0x767a('0xf')](function(_0x57ebf8){if(_0x57ebf8){return _0x2265e0['download'](path['join'](_0x4ff236,_0x253fd9),_0x253fd9,function(_0x5c97be){if(!_0x5c97be)fs[_0x767a('0xa0')](path[_0x767a('0x5d')](_0x4ff236,_0x253fd9));});}})[_0x767a('0x40')](handleError(_0x2265e0,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 0dd9678..5a8fe5b 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 _0xbc8b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x585f94,_0x225545){var _0x391d35=function(_0x48aed0){while(--_0x48aed0){_0x585f94['push'](_0x585f94['shift']());}};_0x391d35(++_0x225545);}(_0xbc8b,0x196));var _0xbbc8=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xbc8b[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0xbbc8('0x0'));var MailMessage=require(_0xbbc8('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xbbc8('0x2')](0x0);var events={'afterCreate':_0xbbc8('0x3'),'afterUpdate':_0xbbc8('0x4'),'afterDestroy':_0xbbc8('0x5')};function emitEvent(_0x13dcd6){return function(_0x3fc067,_0x1c6c60,_0x3d5bd2){MailMessageEvents['emit'](_0x13dcd6+':'+_0x3fc067['id'],_0x3fc067);MailMessageEvents[_0xbbc8('0x6')](_0x13dcd6,_0x3fc067);_0x3d5bd2(null);};}for(var e in events){if(events[_0xbbc8('0x7')](e)){var event=events[e];MailMessage[_0xbbc8('0x8')](e,emitEvent(event));}}module[_0xbbc8('0x9')]=MailMessageEvents; \ No newline at end of file +var _0xf95a=['hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit'];(function(_0x49703e,_0x3af744){var _0x392ed0=function(_0x1b701d){while(--_0x1b701d){_0x49703e['push'](_0x49703e['shift']());}};_0x392ed0(++_0x3af744);}(_0xf95a,0x174));var _0xaf95=function(_0x47eb7c,_0xe023fb){_0x47eb7c=_0x47eb7c-0x0;var _0x16c2a2=_0xf95a[_0x47eb7c];return _0x16c2a2;};'use strict';var EventEmitter=require(_0xaf95('0x0'));var MailMessage=require(_0xaf95('0x1'))['db'][_0xaf95('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xaf95('0x3')](0x0);var events={'afterCreate':_0xaf95('0x4'),'afterUpdate':_0xaf95('0x5'),'afterDestroy':_0xaf95('0x6')};function emitEvent(_0x2edf60){return function(_0x5cfd8b,_0x264984,_0x4c21c6){MailMessageEvents['emit'](_0x2edf60+':'+_0x5cfd8b['id'],_0x5cfd8b);MailMessageEvents[_0xaf95('0x7')](_0x2edf60,_0x5cfd8b);_0x4c21c6(null);};}for(var e in events){if(events[_0xaf95('0x8')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xaf95('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 6f752fb..6f18d79 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 _0x0126=['models','get','direction','out','secret','UserId','MailInteraction','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','html-to-text','rimraf','../../config/environment','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString'];(function(_0x1ccf5f,_0x2d6e7c){var _0x5045c3=function(_0x3dbf22){while(--_0x3dbf22){_0x1ccf5f['push'](_0x1ccf5f['shift']());}};_0x5045c3(++_0x2d6e7c);}(_0x0126,0x1de));var _0x6012=function(_0x57d357,_0x113487){_0x57d357=_0x57d357-0x0;var _0x1be154=_0x0126[_0x57d357];return _0x1be154;};'use strict';var _=require(_0x6012('0x0'));var util=require(_0x6012('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6012('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0x6012('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6012('0x4'));var config=require(_0x6012('0x5'));var attributes=require('./mailMessage.attributes');module[_0x6012('0x6')]=function(_0x4e85a0,_0x3a5921){return _0x4e85a0['define'](_0x6012('0x7'),attributes,{'tableName':_0x6012('0x8'),'paranoid':![],'indexes':[{'name':_0x6012('0x9'),'fields':['messageId']},{'name':_0x6012('0xa'),'fields':[_0x6012('0xb'),'subject'],'type':_0x6012('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x239a4a,_0x2eff3c,_0x50631f){if(_0x239a4a[_0x6012('0xd')]){_0x239a4a[_0x6012('0xb')]=htmlToText[_0x6012('0xe')](_0x239a4a['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x50631f(null,_0x2eff3c);},'afterCreate':function(_0x36edab,_0x34d629,_0x5476b6){var _0x3133dd=_0x4e85a0[_0x6012('0xf')];var _0x5624dc=_0x36edab[_0x6012('0x10')]({'plain':!![]});if(_0x5624dc['direction']['toLowerCase']()==='in'||_0x5624dc[_0x6012('0x11')]['toLowerCase']()===_0x6012('0x12')&&!_0x5624dc[_0x6012('0x13')]&&!_['isNil'](_0x5624dc[_0x6012('0x14')])){_0x3133dd[_0x6012('0x15')]['findOne']({'where':{'id':_0x5624dc['MailInteractionId']}})[_0x6012('0x16')](function(_0x6055c6){if(_0x6055c6){_0x6055c6[_0x6012('0x17')]({'lastMsgAt':_0x5624dc[_0x6012('0x18')],'lastMsgDirection':_0x5624dc[_0x6012('0x11')]['toLowerCase']()});}})[_0x6012('0x19')](function(_0x41e930){console[_0x6012('0x1a')](_0x41e930);});}_0x5476b6();}},'charset':_0x6012('0x1b'),'collate':_0x6012('0x1c')});}; \ No newline at end of file +var _0xddb9=['rimraf','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','html-to-text','path'];(function(_0x4da6d2,_0x811b9a){var _0x278f55=function(_0x361b13){while(--_0x361b13){_0x4da6d2['push'](_0x4da6d2['shift']());}};_0x278f55(++_0x811b9a);}(_0xddb9,0x8f));var _0x9ddb=function(_0x3bf9ae,_0x3f41c4){_0x3bf9ae=_0x3bf9ae-0x0;var _0x56ddee=_0xddb9[_0x3bf9ae];return _0x56ddee;};'use strict';var _=require(_0x9ddb('0x0'));var util=require(_0x9ddb('0x1'));var logger=require(_0x9ddb('0x2'))(_0x9ddb('0x3'));var moment=require(_0x9ddb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0x9ddb('0x5'));var fs=require('fs');var path=require(_0x9ddb('0x6'));var rimraf=require(_0x9ddb('0x7'));var config=require(_0x9ddb('0x8'));var attributes=require(_0x9ddb('0x9'));module['exports']=function(_0x357274,_0x573f4f){return _0x357274['define'](_0x9ddb('0xa'),attributes,{'tableName':_0x9ddb('0xb'),'paranoid':![],'indexes':[{'name':_0x9ddb('0xc'),'fields':[_0x9ddb('0xc')]},{'name':_0x9ddb('0xd'),'fields':[_0x9ddb('0xe'),_0x9ddb('0xf')],'type':_0x9ddb('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c60d8,_0x3a316f,_0x5f55b0){if(_0x3c60d8['body']){_0x3c60d8['plainBody']=htmlToText['fromString'](_0x3c60d8['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5f55b0(null,_0x3a316f);},'afterCreate':function(_0xc443ef,_0x464cd8,_0x3d4563){var _0x58e438=_0x357274['models'];var _0x9051d4=_0xc443ef[_0x9ddb('0x11')]({'plain':!![]});if(_0x9051d4['direction'][_0x9ddb('0x12')]()==='in'||_0x9051d4[_0x9ddb('0x13')][_0x9ddb('0x12')]()===_0x9ddb('0x14')&&!_0x9051d4[_0x9ddb('0x15')]&&!_[_0x9ddb('0x16')](_0x9051d4[_0x9ddb('0x17')])){_0x58e438['MailInteraction'][_0x9ddb('0x18')]({'where':{'id':_0x9051d4['MailInteractionId']}})['then'](function(_0x1da05e){if(_0x1da05e){_0x1da05e[_0x9ddb('0x19')]({'lastMsgAt':_0x9051d4['createdAt'],'lastMsgDirection':_0x9051d4[_0x9ddb('0x13')]['toLowerCase']()});}})[_0x9ddb('0x1a')](function(_0x33df72){console[_0x9ddb('0x1b')](_0x33df72);});}_0x3d4563();}},'charset':_0x9ddb('0x1c'),'collate':_0x9ddb('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 37e3801..f809839 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 _0x2272=['MailMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateMailMessage'];(function(_0x2f4673,_0x10117c){var _0x5c4a9a=function(_0x125b3d){while(--_0x125b3d){_0x2f4673['push'](_0x2f4673['shift']());}};_0x5c4a9a(++_0x10117c);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});config[_0x2227('0xb')]=_[_0x2227('0xc')](config[_0x2227('0xb')],{'host':_0x2227('0xd'),'port':0x18eb});var socket=require(_0x2227('0xe'))(new Redis(config[_0x2227('0xb')]));require(_0x2227('0xf'))['register'](socket);function respondWithRpcPromise(_0x799370,_0x5c1cba,_0x2f66ca){return new BPromise(function(_0x2d1c39,_0x164735){return client[_0x2227('0x10')](_0x799370,_0x2f66ca)[_0x2227('0x11')](function(_0x51ed54){logger[_0x2227('0x12')](_0x2227('0x13'),_0x5c1cba,_0x2227('0x14'));logger[_0x2227('0x15')](_0x2227('0x16'),_0x5c1cba,_0x2227('0x14'),JSON['stringify'](_0x51ed54));if(_0x51ed54['error']){if(_0x51ed54['error'][_0x2227('0x17')]===0x1f4){logger['error'](_0x2227('0x13'),_0x5c1cba,_0x51ed54[_0x2227('0x18')]['message']);return _0x164735(_0x51ed54[_0x2227('0x18')][_0x2227('0x19')]);}logger[_0x2227('0x18')](_0x2227('0x13'),_0x5c1cba,_0x51ed54[_0x2227('0x18')][_0x2227('0x19')]);return _0x2d1c39(_0x51ed54['error'][_0x2227('0x19')]);}else{logger[_0x2227('0x12')](_0x2227('0x13'),_0x5c1cba,'request\x20sent');_0x2d1c39(_0x51ed54[_0x2227('0x1a')][_0x2227('0x19')]);}})[_0x2227('0x1b')](function(_0x2482ba){logger[_0x2227('0x18')](_0x2227('0x13'),_0x5c1cba,_0x2482ba);_0x164735(_0x2482ba);});});}exports[_0x2227('0x1c')]=function(_0x4e0bba){var _0x386e6a=this;return new Promise(function(_0x59f988,_0x2b26b7){return db[_0x2227('0x1d')][_0x2227('0x1e')](_0x4e0bba[_0x2227('0x1f')],{'raw':_0x4e0bba[_0x2227('0x20')]?_0x4e0bba[_0x2227('0x20')][_0x2227('0x21')]===undefined?!![]:![]:!![]})[_0x2227('0x11')](function(_0x3299fd){logger[_0x2227('0x12')](_0x2227('0x1c'),_0x4e0bba);logger['debug'](_0x2227('0x1c'),_0x4e0bba,JSON[_0x2227('0x22')](_0x3299fd));_0x59f988(_0x3299fd);})['catch'](function(_0x2cef4b){logger[_0x2227('0x18')]('CreateMailMessage',_0x2cef4b['message'],_0x4e0bba);_0x2b26b7(_0x386e6a[_0x2227('0x18')](0x1f4,_0x2cef4b[_0x2227('0x19')]));});});}; \ No newline at end of file +var _0xd914=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify','lodash'];(function(_0xa059ea,_0x5cb91e){var _0x156a4c=function(_0x1b4717){while(--_0x1b4717){_0xa059ea['push'](_0xa059ea['shift']());}};_0x156a4c(++_0x5cb91e);}(_0xd914,0x17f));var _0x4d91=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0xd914[_0x47e7dd];return _0x38501f;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});config[_0x4d91('0xb')]=_[_0x4d91('0xc')](config[_0x4d91('0xb')],{'host':_0x4d91('0xd'),'port':0x18eb});var socket=require(_0x4d91('0xe'))(new Redis(config[_0x4d91('0xb')]));require('./mailMessage.socket')[_0x4d91('0xf')](socket);function respondWithRpcPromise(_0xa4bb25,_0xc07c64,_0x278648){return new BPromise(function(_0xb234d2,_0x266b31){return client['request'](_0xa4bb25,_0x278648)['then'](function(_0x2ccd08){logger[_0x4d91('0x10')](_0x4d91('0x11'),_0xc07c64,_0x4d91('0x12'));logger[_0x4d91('0x13')](_0x4d91('0x14'),_0xc07c64,'request\x20sent',JSON['stringify'](_0x2ccd08));if(_0x2ccd08[_0x4d91('0x15')]){if(_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x16')]===0x1f4){logger[_0x4d91('0x15')](_0x4d91('0x11'),_0xc07c64,_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x17')]);return _0x266b31(_0x2ccd08['error'][_0x4d91('0x17')]);}logger[_0x4d91('0x15')](_0x4d91('0x11'),_0xc07c64,_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x17')]);return _0xb234d2(_0x2ccd08['error'][_0x4d91('0x17')]);}else{logger[_0x4d91('0x10')](_0x4d91('0x11'),_0xc07c64,_0x4d91('0x12'));_0xb234d2(_0x2ccd08['result'][_0x4d91('0x17')]);}})[_0x4d91('0x18')](function(_0x13254c){logger['error'](_0x4d91('0x11'),_0xc07c64,_0x13254c);_0x266b31(_0x13254c);});});}exports[_0x4d91('0x19')]=function(_0x351388){var _0xd59fe=this;return new Promise(function(_0x10b767,_0x40cde4){return db[_0x4d91('0x1a')][_0x4d91('0x1b')](_0x351388[_0x4d91('0x1c')],{'raw':_0x351388[_0x4d91('0x1d')]?_0x351388['options'][_0x4d91('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x57913e){logger[_0x4d91('0x10')](_0x4d91('0x19'),_0x351388);logger[_0x4d91('0x13')](_0x4d91('0x19'),_0x351388,JSON[_0x4d91('0x1f')](_0x57913e));_0x10b767(_0x57913e);})[_0x4d91('0x18')](function(_0x100cd4){logger[_0x4d91('0x15')]('CreateMailMessage',_0x100cd4['message'],_0x351388);_0x40cde4(_0xd59fe[_0x4d91('0x15')](0x1f4,_0x100cd4[_0x4d91('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 45656bb..48ccab4 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 _0xe4ec=['removeListener','register','length','mailMessage:','save','update','emit'];(function(_0x56d5ed,_0xd0b5a3){var _0x2c859e=function(_0xda6e51){while(--_0xda6e51){_0x56d5ed['push'](_0x56d5ed['shift']());}};_0x2c859e(++_0xd0b5a3);}(_0xe4ec,0x11c));var _0xce4e=function(_0x12788c,_0x5ef58a){_0x12788c=_0x12788c-0x0;var _0x512fa5=_0xe4ec[_0x12788c];return _0x512fa5;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xce4e('0x0'),'remove',_0xce4e('0x1')];function createListener(_0x14bfb3,_0x3af39a){return function(_0x4d3e1b){_0x3af39a[_0xce4e('0x2')](_0x14bfb3,_0x4d3e1b);};}function removeListener(_0xab969b,_0xaf6296){return function(){MailMessageEvents[_0xce4e('0x3')](_0xab969b,_0xaf6296);};}exports[_0xce4e('0x4')]=function(_0x464809){for(var _0x133772=0x0,_0x5270be=events[_0xce4e('0x5')];_0x133772<_0x5270be;_0x133772++){var _0x53e28a=events[_0x133772];var _0x595549=createListener(_0xce4e('0x6')+_0x53e28a,_0x464809);MailMessageEvents['on'](_0x53e28a,_0x595549);}}; \ No newline at end of file +var _0x4ccb=['update','removeListener','register','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0x4ee136,_0xe43fed){var _0x1492c7=function(_0x704f2){while(--_0x704f2){_0x4ee136['push'](_0x4ee136['shift']());}};_0x1492c7(++_0xe43fed);}(_0x4ccb,0x1a5));var _0xb4cc=function(_0x2a1330,_0x118d08){_0x2a1330=_0x2a1330-0x0;var _0x520ad1=_0x4ccb[_0x2a1330];return _0x520ad1;};'use strict';var MailMessageEvents=require(_0xb4cc('0x0'));var events=[_0xb4cc('0x1'),_0xb4cc('0x2'),_0xb4cc('0x3')];function createListener(_0x5557f5,_0x102892){return function(_0x3ea038){_0x102892['emit'](_0x5557f5,_0x3ea038);};}function removeListener(_0x4b6eea,_0x9639f2){return function(){MailMessageEvents[_0xb4cc('0x4')](_0x4b6eea,_0x9639f2);};}exports[_0xb4cc('0x5')]=function(_0x27f984){for(var _0x42dc05=0x0,_0x641db0=events[_0xb4cc('0x6')];_0x42dc05<_0x641db0;_0x42dc05++){var _0x25e57e=events[_0x42dc05];var _0x29538d=createListener(_0xb4cc('0x7')+_0x25e57e,_0x27f984);MailMessageEvents['on'](_0x25e57e,_0x29538d);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index c392a4f..c4b5038 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 _0xcfe3=['delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','update'];(function(_0x1a6cb2,_0x1945e0){var _0x1482a1=function(_0x145f6f){while(--_0x145f6f){_0x1a6cb2['push'](_0x1a6cb2['shift']());}};_0x1482a1(++_0x1945e0);}(_0xcfe3,0x1d8));var _0x3cfe=function(_0x36fc4c,_0x1c3ff8){_0x36fc4c=_0x36fc4c-0x0;var _0x5a7210=_0xcfe3[_0x36fc4c];return _0x5a7210;};'use strict';var multer=require(_0x3cfe('0x0'));var util=require('util');var path=require(_0x3cfe('0x1'));var timeout=require(_0x3cfe('0x2'));var express=require(_0x3cfe('0x3'));var router=express['Router']();var fs_extra=require(_0x3cfe('0x4'));var auth=require(_0x3cfe('0x5'));var interaction=require(_0x3cfe('0x6'));var config=require(_0x3cfe('0x7'));var controller=require(_0x3cfe('0x8'));router[_0x3cfe('0x9')]('/',auth[_0x3cfe('0xa')](),controller['index']);router[_0x3cfe('0x9')](_0x3cfe('0xb'),auth[_0x3cfe('0xa')](),controller['describe']);router[_0x3cfe('0x9')](_0x3cfe('0xc'),auth[_0x3cfe('0xa')](),controller['show']);router[_0x3cfe('0x9')](_0x3cfe('0xd'),auth[_0x3cfe('0xa')](),controller[_0x3cfe('0xe')]);router[_0x3cfe('0x9')](_0x3cfe('0xf'),auth['isAuthenticated'](),controller[_0x3cfe('0x10')]);router[_0x3cfe('0x9')](_0x3cfe('0x11'),auth[_0x3cfe('0xa')](),controller[_0x3cfe('0x12')]);router[_0x3cfe('0x13')]('/',auth[_0x3cfe('0xa')](),controller['create']);router[_0x3cfe('0x13')](_0x3cfe('0xf'),auth[_0x3cfe('0xa')](),controller[_0x3cfe('0x14')]);router[_0x3cfe('0x13')](_0x3cfe('0x11'),auth[_0x3cfe('0xa')](),controller['addAgents']);router['put'](_0x3cfe('0xc'),auth[_0x3cfe('0xa')](),controller[_0x3cfe('0x15')]);router[_0x3cfe('0x16')](_0x3cfe('0xc'),auth[_0x3cfe('0xa')](),controller[_0x3cfe('0x17')]);router['delete'](_0x3cfe('0xf'),auth[_0x3cfe('0xa')](),controller[_0x3cfe('0x18')]);router['delete'](_0x3cfe('0x11'),auth[_0x3cfe('0xa')](),controller['removeAgents']);module[_0x3cfe('0x19')]=router; \ No newline at end of file +var _0xc2e1=['addAgents','update','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc2e1,0xf8));var _0x1c2e=function(_0x4d7ca6,_0x422b3f){_0x4d7ca6=_0x4d7ca6-0x0;var _0x12ad69=_0xc2e1[_0x4d7ca6];return _0x12ad69;};'use strict';var multer=require(_0x1c2e('0x0'));var util=require(_0x1c2e('0x1'));var path=require(_0x1c2e('0x2'));var timeout=require(_0x1c2e('0x3'));var express=require('express');var router=express[_0x1c2e('0x4')]();var fs_extra=require(_0x1c2e('0x5'));var auth=require(_0x1c2e('0x6'));var interaction=require(_0x1c2e('0x7'));var config=require(_0x1c2e('0x8'));var controller=require(_0x1c2e('0x9'));router[_0x1c2e('0xa')]('/',auth[_0x1c2e('0xb')](),controller['index']);router[_0x1c2e('0xa')]('/describe',auth[_0x1c2e('0xb')](),controller['describe']);router[_0x1c2e('0xa')](_0x1c2e('0xc'),auth[_0x1c2e('0xb')](),controller[_0x1c2e('0xd')]);router[_0x1c2e('0xa')](_0x1c2e('0xe'),auth[_0x1c2e('0xb')](),controller[_0x1c2e('0xf')]);router['get'](_0x1c2e('0x10'),auth[_0x1c2e('0xb')](),controller[_0x1c2e('0x11')]);router[_0x1c2e('0xa')](_0x1c2e('0x12'),auth['isAuthenticated'](),controller[_0x1c2e('0x13')]);router[_0x1c2e('0x14')]('/',auth[_0x1c2e('0xb')](),controller['create']);router['post']('/:id/teams',auth[_0x1c2e('0xb')](),controller[_0x1c2e('0x15')]);router[_0x1c2e('0x14')](_0x1c2e('0x12'),auth['isAuthenticated'](),controller[_0x1c2e('0x16')]);router['put'](_0x1c2e('0xc'),auth[_0x1c2e('0xb')](),controller[_0x1c2e('0x17')]);router[_0x1c2e('0x18')](_0x1c2e('0xc'),auth[_0x1c2e('0xb')](),controller['destroy']);router[_0x1c2e('0x18')](_0x1c2e('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x1c2e('0xb')](),controller[_0x1c2e('0x19')]);module[_0x1c2e('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 cbf7cf1..87ea279 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 _0x1b1a=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x3ae528,_0x48614a){var _0x472cc9=function(_0x1767b7){while(--_0x1767b7){_0x3ae528['push'](_0x3ae528['shift']());}};_0x472cc9(++_0x48614a);}(_0x1b1a,0xac));var _0xa1b1=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x1b1a[_0x1168a1];return _0xcc5ad8;};'use strict';var Sequelize=require(_0xa1b1('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1b1('0x1')],'unique':_0xa1b1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa1b1('0x1')]},'timeout':{'type':Sequelize[_0xa1b1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa1b1('0x4')](_0xa1b1('0x5'),_0xa1b1('0x6'),_0xa1b1('0x7'))}}; \ No newline at end of file +var _0x8fac=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x1f2499,_0x6f3008){var _0x4f4cdd=function(_0x9c26b1){while(--_0x9c26b1){_0x1f2499['push'](_0x1f2499['shift']());}};_0x4f4cdd(++_0x6f3008);}(_0x8fac,0xf2));var _0xc8fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8fac[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc8fa('0x0'));module['exports']={'name':{'type':Sequelize[_0xc8fa('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc8fa('0x1')]},'timeout':{'type':Sequelize[_0xc8fa('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc8fa('0x3')](_0xc8fa('0x4'),_0xc8fa('0x5'),_0xc8fa('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 9fc190b..6ea6a9e 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 _0x01b7=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','MailQueues','end','error','stack','name','map','MailQueue','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','catch','show','params','options','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','MailQueueId','filter','findAll','User','findAndCountAll','createdAt','rows','%s/%s','SIP','mailPause','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','every','all','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x01b7,0x17f));var _0x701b=function(_0x2dfaf3,_0x2e21d2){_0x2dfaf3=_0x2dfaf3-0x0;var _0x119bb7=_0x01b7[_0x2dfaf3];return _0x119bb7;};'use strict';var emlformat=require(_0x701b('0x0'));var rimraf=require(_0x701b('0x1'));var zipdir=require(_0x701b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x701b('0x3'));var moment=require(_0x701b('0x4'));var BPromise=require(_0x701b('0x5'));var Mustache=require(_0x701b('0x6'));var util=require(_0x701b('0x7'));var path=require(_0x701b('0x8'));var sox=require(_0x701b('0x9'));var csv=require(_0x701b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x701b('0xb'));var _=require(_0x701b('0xc'));var squel=require(_0x701b('0xd'));var crypto=require(_0x701b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x701b('0xa'));var querystring=require(_0x701b('0xf'));var Papa=require(_0x701b('0x10'));var Redis=require(_0x701b('0x11'));var authService=require(_0x701b('0x12'));var qs=require(_0x701b('0x13'));var as=require(_0x701b('0x14'));var hardwareService=require(_0x701b('0x15'));var logger=require(_0x701b('0x16'))(_0x701b('0x17'));var utils=require('../../config/utils');var config=require(_0x701b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x701b('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x701b('0x1a'))(new Redis(config[_0x701b('0x19')]));require(_0x701b('0x1b'))[_0x701b('0x1c')](socket);function respondWithStatusCode(_0x5e11fc,_0x1daf3b){_0x1daf3b=_0x1daf3b||0xcc;return function(_0xb76d47){if(_0xb76d47){return _0x5e11fc[_0x701b('0x1d')](_0x1daf3b);}return _0x5e11fc[_0x701b('0x1e')](_0x1daf3b)['end']();};}function respondWithResult(_0xcd2b4f,_0x2b07a9){_0x2b07a9=_0x2b07a9||0xc8;return function(_0x218eaa){if(_0x218eaa){return _0xcd2b4f[_0x701b('0x1e')](_0x2b07a9)[_0x701b('0x1f')](_0x218eaa);}};}function respondWithFilteredResult(_0x34d0da,_0x220bbb){return function(_0x2e6640){if(_0x2e6640){var _0x42f649=typeof _0x220bbb[_0x701b('0x20')]==='undefined'&&typeof _0x220bbb[_0x701b('0x21')]==='undefined';var _0x407023=_0x2e6640[_0x701b('0x22')];var _0x23298f=_0x42f649?0x0:_0x220bbb[_0x701b('0x20')];var _0x4586d7=_0x42f649?_0x2e6640['count']:_0x220bbb[_0x701b('0x20')]+_0x220bbb[_0x701b('0x21')];var _0x38dd6f;if(_0x4586d7>=_0x407023){_0x4586d7=_0x407023;_0x38dd6f=0xc8;}else{_0x38dd6f=0xce;}_0x34d0da[_0x701b('0x1e')](_0x38dd6f);return _0x34d0da[_0x701b('0x23')](_0x701b('0x24'),_0x23298f+'-'+_0x4586d7+'/'+_0x407023)[_0x701b('0x1f')](_0x2e6640);}return null;};}function patchUpdates(_0x5136c6){return function(_0x173f15){try{jsonpatch['apply'](_0x173f15,_0x5136c6,!![]);}catch(_0x2070df){return BPromise[_0x701b('0x25')](_0x2070df);}return _0x173f15['save']();};}function saveUpdates(_0x3e0622,_0x54b956){return function(_0x388920){if(_0x388920){return _0x388920[_0x701b('0x26')](_0x3e0622)[_0x701b('0x27')](function(_0xf5011a){return _0xf5011a;});}return null;};}function removeEntity(_0x22a8d1,_0x3a47a7){return function(_0x5adc6a){if(_0x5adc6a){return _0x5adc6a[_0x701b('0x28')]()[_0x701b('0x27')](function(){var _0x6bc1a3=_0x5adc6a['get']({'plain':!![]});var _0x54602c=_0x701b('0x29');return db['UserProfileResource'][_0x701b('0x28')]({'where':{'type':_0x54602c,'resourceId':_0x6bc1a3['id']}})['then'](function(){return _0x5adc6a;});})[_0x701b('0x27')](function(){_0x22a8d1[_0x701b('0x1e')](0xcc)[_0x701b('0x2a')]();});}};}function handleEntityNotFound(_0x145256,_0x2214c1){return function(_0x494eba){if(!_0x494eba){_0x145256[_0x701b('0x1d')](0x194);}return _0x494eba;};}function handleError(_0x2dac38,_0x344ed6){_0x344ed6=_0x344ed6||0x1f4;return function(_0x1b33c7){logger[_0x701b('0x2b')](_0x1b33c7[_0x701b('0x2c')]);if(_0x1b33c7['name']){delete _0x1b33c7[_0x701b('0x2d')];}_0x2dac38[_0x701b('0x1e')](_0x344ed6)['send'](_0x1b33c7);};}exports['index']=function(_0x29997c,_0xd11934){var _0x3f830b={},_0x135105={},_0x5e56d8={'count':0x0,'rows':[]};var _0x5bba53=_[_0x701b('0x2e')](db[_0x701b('0x2f')][_0x701b('0x30')],function(_0x21e3cf){return{'name':_0x21e3cf['fieldName'],'type':_0x21e3cf[_0x701b('0x31')][_0x701b('0x32')]};});_0x135105[_0x701b('0x33')]=_[_0x701b('0x2e')](_0x5bba53,_0x701b('0x2d'));_0x135105[_0x701b('0x34')]=_[_0x701b('0x35')](_0x29997c['query']);_0x135105[_0x701b('0x36')]=_['intersection'](_0x135105['model'],_0x135105['query']);_0x3f830b[_0x701b('0x37')]=_[_0x701b('0x38')](_0x135105[_0x701b('0x33')],qs[_0x701b('0x39')](_0x29997c['query']['fields']));_0x3f830b[_0x701b('0x37')]=_0x3f830b['attributes'][_0x701b('0x3a')]?_0x3f830b[_0x701b('0x37')]:_0x135105[_0x701b('0x33')];if(!_0x29997c[_0x701b('0x34')][_0x701b('0x3b')](_0x701b('0x3c'))){_0x3f830b['limit']=qs[_0x701b('0x21')](_0x29997c[_0x701b('0x34')][_0x701b('0x21')]);_0x3f830b[_0x701b('0x20')]=qs[_0x701b('0x20')](_0x29997c[_0x701b('0x34')]['offset']);}_0x3f830b[_0x701b('0x3d')]=qs[_0x701b('0x3e')](_0x29997c[_0x701b('0x34')][_0x701b('0x3e')]);_0x3f830b[_0x701b('0x3f')]=qs[_0x701b('0x36')](_[_0x701b('0x40')](_0x29997c[_0x701b('0x34')],_0x135105[_0x701b('0x36')]),_0x5bba53);if(_0x29997c['query']['filter']){_0x3f830b[_0x701b('0x3f')]=_[_0x701b('0x41')](_0x3f830b['where'],{'$or':_[_0x701b('0x2e')](_0x5bba53,function(_0x2fda9b){if(_0x2fda9b[_0x701b('0x31')]!==_0x701b('0x42')){var _0x3faf97={};_0x3faf97[_0x2fda9b['name']]={'$like':'%'+_0x29997c[_0x701b('0x34')]['filter']+'%'};return _0x3faf97;}})});}_0x3f830b=_['merge']({},_0x3f830b,_0x29997c['options']);var _0x323724={'where':_0x3f830b['where']};return db[_0x701b('0x2f')][_0x701b('0x22')](_0x323724)[_0x701b('0x27')](function(_0x4941c4){_0x5e56d8[_0x701b('0x22')]=_0x4941c4;if(_0x29997c['query'][_0x701b('0x43')]){_0x3f830b[_0x701b('0x44')]=[{'all':!![]}];}return db[_0x701b('0x2f')]['findAll'](_0x3f830b);})[_0x701b('0x27')](function(_0x38e9eb){_0x5e56d8['rows']=_0x38e9eb;return _0x5e56d8;})['then'](respondWithFilteredResult(_0xd11934,_0x3f830b))[_0x701b('0x45')](handleError(_0xd11934,null));};exports[_0x701b('0x46')]=function(_0x2804a3,_0x4ad569){var _0x1522c4={'raw':!![],'where':{'id':_0x2804a3[_0x701b('0x47')]['id']}},_0x47a752={};_0x47a752[_0x701b('0x33')]=_[_0x701b('0x35')](db[_0x701b('0x2f')][_0x701b('0x30')]);_0x47a752[_0x701b('0x34')]=_[_0x701b('0x35')](_0x2804a3[_0x701b('0x34')]);_0x47a752['filters']=_['intersection'](_0x47a752[_0x701b('0x33')],_0x47a752[_0x701b('0x34')]);_0x1522c4[_0x701b('0x37')]=_[_0x701b('0x38')](_0x47a752[_0x701b('0x33')],qs[_0x701b('0x39')](_0x2804a3[_0x701b('0x34')][_0x701b('0x39')]));_0x1522c4[_0x701b('0x37')]=_0x1522c4['attributes']['length']?_0x1522c4[_0x701b('0x37')]:_0x47a752[_0x701b('0x33')];if(_0x2804a3[_0x701b('0x34')]['includeAll']){_0x1522c4[_0x701b('0x44')]=[{'all':!![]}];}_0x1522c4=_[_0x701b('0x41')]({},_0x1522c4,_0x2804a3[_0x701b('0x48')]);return db[_0x701b('0x2f')][_0x701b('0x49')](_0x1522c4)[_0x701b('0x27')](handleEntityNotFound(_0x4ad569,null))['then'](respondWithResult(_0x4ad569,null))[_0x701b('0x45')](handleError(_0x4ad569,null));};exports[_0x701b('0x4a')]=function(_0x4db136,_0x256781){return db[_0x701b('0x2f')][_0x701b('0x4a')](_0x4db136[_0x701b('0x4b')],{})[_0x701b('0x27')](function(_0x5560f6){var _0x540dd5=_0x4db136[_0x701b('0x4c')][_0x701b('0x4d')]({'plain':!![]});if(!_0x540dd5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x540dd5['role']===_0x701b('0x4c')){var _0x1479b1=_0x5560f6['get']({'plain':!![]});var _0x1a8d1b='MailQueues';return db[_0x701b('0x4e')][_0x701b('0x49')]({'where':{'name':_0x1a8d1b,'userProfileId':_0x540dd5[_0x701b('0x4f')]},'raw':!![]})[_0x701b('0x27')](function(_0x4080b6){if(_0x4080b6&&_0x4080b6[_0x701b('0x50')]===0x0){return db[_0x701b('0x51')][_0x701b('0x4a')]({'name':_0x1479b1['name'],'resourceId':_0x1479b1['id'],'type':_0x4080b6[_0x701b('0x2d')],'sectionId':_0x4080b6['id']},{})[_0x701b('0x27')](function(){return _0x5560f6;});}else{return _0x5560f6;}})[_0x701b('0x45')](function(_0x1d5f56){logger['error'](_0x701b('0x52'),_0x1d5f56);throw _0x1d5f56;});}return _0x5560f6;})[_0x701b('0x27')](respondWithResult(_0x256781,0xc9))['catch'](handleError(_0x256781,null));};exports[_0x701b('0x26')]=function(_0x4a79bb,_0x4fa510){if(_0x4a79bb[_0x701b('0x4b')]['id']){delete _0x4a79bb[_0x701b('0x4b')]['id'];}return db[_0x701b('0x2f')][_0x701b('0x49')]({'where':{'id':_0x4a79bb[_0x701b('0x47')]['id']}})[_0x701b('0x27')](handleEntityNotFound(_0x4fa510,null))[_0x701b('0x27')](saveUpdates(_0x4a79bb[_0x701b('0x4b')],null))[_0x701b('0x27')](respondWithResult(_0x4fa510,null))[_0x701b('0x45')](handleError(_0x4fa510,null));};exports[_0x701b('0x28')]=function(_0x82b35e,_0x338972){return db['MailQueue'][_0x701b('0x49')]({'where':{'id':_0x82b35e[_0x701b('0x47')]['id']}})[_0x701b('0x27')](handleEntityNotFound(_0x338972,null))[_0x701b('0x27')](removeEntity(_0x338972,null))[_0x701b('0x45')](handleError(_0x338972,null));};exports['describe']=function(_0x4b2eb8,_0x575d3e){return db[_0x701b('0x2f')][_0x701b('0x53')]()['then'](respondWithResult(_0x575d3e,null))['catch'](handleError(_0x575d3e,null));};exports[_0x701b('0x54')]=function(_0x34d456,_0x45f619,_0x3efb6d){var _0x5646c8={'raw':!![],'where':{}},_0x327488={},_0x9615e8;return db['MailQueue'][_0x701b('0x55')]({'where':{'id':_0x34d456[_0x701b('0x47')]['id']}})[_0x701b('0x27')](handleEntityNotFound(_0x45f619,null))[_0x701b('0x27')](function(_0x72673c){if(_0x72673c){_0x9615e8=_0x72673c[_0x701b('0x4d')]({'plain':!![]});_0x327488[_0x701b('0x33')]=_[_0x701b('0x35')](db[_0x701b('0x56')][_0x701b('0x30')]);_0x327488[_0x701b('0x34')]=_[_0x701b('0x35')](_0x34d456['query']);_0x327488[_0x701b('0x36')]=_[_0x701b('0x38')](_0x327488[_0x701b('0x33')],_0x327488['query']);_0x5646c8['attributes']=_[_0x701b('0x38')](_0x327488[_0x701b('0x33')],qs[_0x701b('0x39')](_0x34d456['query']['fields']));_0x5646c8[_0x701b('0x37')]=_0x5646c8[_0x701b('0x37')][_0x701b('0x3a')]?_0x5646c8[_0x701b('0x37')]:_0x327488['model'];if(!_0x34d456['query'][_0x701b('0x3b')](_0x701b('0x3c'))){_0x5646c8[_0x701b('0x21')]=qs[_0x701b('0x21')](_0x34d456[_0x701b('0x34')][_0x701b('0x21')]);_0x5646c8[_0x701b('0x20')]=qs[_0x701b('0x20')](_0x34d456[_0x701b('0x34')][_0x701b('0x20')]);}_0x5646c8[_0x701b('0x3d')]=qs[_0x701b('0x3e')](_0x34d456[_0x701b('0x34')][_0x701b('0x3e')]);_0x5646c8['where']=qs[_0x701b('0x36')](_['pick'](_0x34d456[_0x701b('0x34')],_0x327488[_0x701b('0x36')]));_0x5646c8[_0x701b('0x3f')][_0x701b('0x57')]=_0x72673c['id'];if(_0x34d456[_0x701b('0x34')][_0x701b('0x58')]){_0x5646c8[_0x701b('0x3f')]=_['merge'](_0x5646c8[_0x701b('0x3f')],{'$or':_['map'](_0x5646c8[_0x701b('0x37')],function(_0x56f8b0){var _0x390459={};_0x390459[_0x56f8b0]={'$like':'%'+_0x34d456[_0x701b('0x34')][_0x701b('0x58')]+'%'};return _0x390459;})});}_0x5646c8=_[_0x701b('0x41')]({},_0x5646c8,_0x34d456[_0x701b('0x48')]);return db[_0x701b('0x56')][_0x701b('0x59')](_0x5646c8);}})['then'](function(_0x297b92){if(_0x297b92){return db[_0x701b('0x5a')][_0x701b('0x5b')]({'where':{'id':_[_0x701b('0x2e')](_0x297b92,'UserId'),'role':'agent'},'attributes':['id',_0x701b('0x2d'),'mailPause','updatedAt',_0x701b('0x5c')]});}})[_0x701b('0x27')](function(_0x3157c9){if(_0x3157c9){return{'count':_0x3157c9['count'],'rows':_[_0x701b('0x2e')](_0x3157c9[_0x701b('0x5d')],function(_0x1c14bc){return{'membername':_0x1c14bc['name'],'UserId':_0x1c14bc['id'],'queue_name':_0x9615e8['name'],'MailQueueId':_0x9615e8['id'],'interface':util['format'](_0x701b('0x5e'),_0x701b('0x5f'),_0x1c14bc['name']),'penalty':0x0,'paused':_0x1c14bc[_0x701b('0x60')],'createdAt':_0x1c14bc[_0x701b('0x5c')],'updatedAt':_0x1c14bc[_0x701b('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x45f619,_0x5646c8))[_0x701b('0x45')](handleError(_0x45f619,null));};exports[_0x701b('0x62')]=function(_0x3fa707,_0x5f0c26,_0x2eb2b0){var _0x2f54af={};var _0x29999d={};var _0x2f19ae;var _0x56ef19;return db[_0x701b('0x2f')][_0x701b('0x55')]({'where':{'id':_0x3fa707[_0x701b('0x47')]['id']}})[_0x701b('0x27')](handleEntityNotFound(_0x5f0c26,null))[_0x701b('0x27')](function(_0x20884d){if(_0x20884d){_0x2f19ae=_0x20884d;_0x29999d[_0x701b('0x33')]=_[_0x701b('0x35')](db[_0x701b('0x63')][_0x701b('0x30')]);_0x29999d['query']=_[_0x701b('0x35')](_0x3fa707[_0x701b('0x34')]);_0x29999d['filters']=_['intersection'](_0x29999d['model'],_0x29999d[_0x701b('0x34')]);_0x2f54af[_0x701b('0x37')]=_[_0x701b('0x38')](_0x29999d[_0x701b('0x33')],qs[_0x701b('0x39')](_0x3fa707['query']['fields']));_0x2f54af['attributes']=_0x2f54af['attributes'][_0x701b('0x3a')]?_0x2f54af[_0x701b('0x37')]:_0x29999d[_0x701b('0x33')];_0x2f54af[_0x701b('0x3d')]=qs[_0x701b('0x3e')](_0x3fa707[_0x701b('0x34')][_0x701b('0x3e')]);_0x2f54af[_0x701b('0x3f')]=qs[_0x701b('0x36')](_[_0x701b('0x40')](_0x3fa707[_0x701b('0x34')],_0x29999d[_0x701b('0x36')]));if(_0x3fa707[_0x701b('0x34')][_0x701b('0x58')]){_0x2f54af['where']=_[_0x701b('0x41')](_0x2f54af[_0x701b('0x3f')],{'$or':_['map'](_0x2f54af[_0x701b('0x37')],function(_0x116be1){var _0xae9c8b={};_0xae9c8b[_0x116be1]={'$like':'%'+_0x3fa707[_0x701b('0x34')][_0x701b('0x58')]+'%'};return _0xae9c8b;})});}_0x2f54af=_['merge']({},_0x2f54af,_0x3fa707[_0x701b('0x48')]);return _0x2f19ae[_0x701b('0x62')](_0x2f54af);}})[_0x701b('0x27')](function(_0x35c119){if(_0x35c119){_0x56ef19=_0x35c119[_0x701b('0x3a')];if(!_0x3fa707['query']['hasOwnProperty']('nolimit')){_0x2f54af[_0x701b('0x21')]=qs[_0x701b('0x21')](_0x3fa707['query'][_0x701b('0x21')]);_0x2f54af[_0x701b('0x20')]=qs[_0x701b('0x20')](_0x3fa707[_0x701b('0x34')][_0x701b('0x20')]);}return _0x2f19ae[_0x701b('0x62')](_0x2f54af);}})[_0x701b('0x27')](function(_0x45e13c){if(_0x45e13c){return _0x45e13c?{'count':_0x56ef19,'rows':_0x45e13c}:null;}})[_0x701b('0x27')](respondWithResult(_0x5f0c26,null))[_0x701b('0x45')](handleError(_0x5f0c26,null));};exports[_0x701b('0x64')]=function(_0x2ba4d5,_0x23792b,_0x5f09de){var _0x123b96=_0x2ba4d5['body'][_0x701b('0x65')];return db[_0x701b('0x63')][_0x701b('0x59')]({'where':{'id':_0x123b96},'attributes':['id'],'include':[{'model':db[_0x701b('0x5a')],'as':_0x701b('0x66'),'attributes':['id',_0x701b('0x2d'),'online',_0x701b('0x67'),_0x701b('0x68')],'raw':!![]}]})[_0x701b('0x27')](function(_0x44b501){if(_0x44b501){var _0x5cce6b=_[_0x701b('0x69')](_0x44b501,function(_0x16c5f1){var _0x206f1f=_0x16c5f1['get']({'plain':!![]});return _0x206f1f[_0x701b('0x66')];});return db[_0x701b('0x2f')][_0x701b('0x49')]({'where':{'id':_0x2ba4d5[_0x701b('0x47')]['id']}})['then'](function(_0x51ab1c){return db[_0x701b('0x6a')]['transaction'](function(_0x576ea9){return _0x51ab1c['addTeams'](_0x123b96,{'transaction':_0x576ea9})[_0x701b('0x27')](function(){return BPromise[_0x701b('0x6b')](_0x5cce6b,function(_0x1327ba){return db[_0x701b('0x56')][_0x701b('0x6c')]({'where':{'UserId':_0x1327ba['id'],'MailQueueId':_0x2ba4d5['params']['id']},'transaction':_0x576ea9});});})[_0x701b('0x27')](function(){_0x5cce6b[_0x701b('0x6d')](function(_0x3a6740){socket[_0x701b('0x6e')](_0x701b('0x6f'),{'UserId':_0x3a6740['id'],'MailQueueId':_0x51ab1c['id']});});});});});}})[_0x701b('0x27')](respondWithStatusCode(_0x23792b,null))[_0x701b('0x45')](handleError(_0x23792b,null));};exports[_0x701b('0x70')]=function(_0x4ed3d0,_0x28dfea,_0x150d51){return db[_0x701b('0x63')][_0x701b('0x59')]({'where':{'id':_0x4ed3d0[_0x701b('0x34')][_0x701b('0x65')]},'attributes':['id'],'include':[{'model':db[_0x701b('0x5a')],'as':_0x701b('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x28dfea,null))[_0x701b('0x27')](function(_0x77d438){var _0xfd98b4=_[_0x701b('0x2e')](_0x77d438,'id');var _0x129a37=[];var _0x4e9549=[];var _0x170582=squel[_0x701b('0x71')]();_0x170582[_0x701b('0x72')]('tq.TeamId')[_0x701b('0x73')](_0x701b('0x74'),'tq')[_0x701b('0x75')]('user_has_teams','ut',_0x701b('0x76'))[_0x701b('0x3f')]('MailQueueId\x20=\x20?',_0x4ed3d0['params']['id']);for(var _0x22771d=0x0;_0x22771d<_0x77d438[_0x701b('0x3a')];_0x22771d+=0x1){let _0x497aa3=_0x77d438[_0x22771d];for(var _0x38c099=0x0;_0x38c099<_0x497aa3[_0x701b('0x66')][_0x701b('0x3a')];_0x38c099+=0x1){let _0x18fec4=_0x497aa3[_0x701b('0x66')][_0x38c099];var _0x2efb0a=_0x170582[_0x701b('0x77')]();_0x2efb0a[_0x701b('0x3f')](_0x701b('0x78'),_0x18fec4['id']);_0x4e9549[_0x701b('0x79')](db[_0x701b('0x6a')][_0x701b('0x34')](_0x2efb0a[_0x701b('0x7a')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x701b('0x27')](function(_0x2a35b4){if(_0x2a35b4[_0x701b('0x3a')]===0x1){return _0x18fec4['id'];}else{var _0x2d966c=_[_0x701b('0x7b')](_[_0x701b('0x2e')](_0x2a35b4,'TeamId'),function(_0x4f7b65){return _['includes'](_0xfd98b4,_0x4f7b65);});if(_0x2d966c){return _0x18fec4['id'];}}}));}}return BPromise[_0x701b('0x7c')](_0x4e9549)['then'](function(_0xca4b99){_0x129a37=_(_0x129a37)[_0x701b('0x7d')](_0xca4b99)['compact']()[_0x701b('0x7e')]();return db[_0x701b('0x2f')][_0x701b('0x49')]({'where':{'id':_0x4ed3d0[_0x701b('0x47')]['id']}})[_0x701b('0x27')](function(_0x3a9761){return db['sequelize']['transaction'](function(_0x4dfe4c){return _0x3a9761[_0x701b('0x70')](_0x4ed3d0[_0x701b('0x34')][_0x701b('0x65')],{'transaction':_0x4dfe4c})[_0x701b('0x27')](function(){if(!_[_0x701b('0x7f')](_0x129a37)){return _0x3a9761[_0x701b('0x80')](_0x129a37,{'transaction':_0x4dfe4c});}})['then'](function(){_0x129a37['forEach'](function(_0x44cecc){socket[_0x701b('0x6e')](_0x701b('0x81'),{'UserId':_0x44cecc,'MailQueueId':_0x3a9761['id']});});});});});});})[_0x701b('0x27')](respondWithStatusCode(_0x28dfea,null))[_0x701b('0x45')](handleError(_0x28dfea,null));};exports[_0x701b('0x82')]=function(_0x1d4082,_0x5552e9,_0x15a7f7){return db[_0x701b('0x2f')][_0x701b('0x49')]({'where':{'id':_0x1d4082[_0x701b('0x47')]['id']}})[_0x701b('0x27')](handleEntityNotFound(_0x5552e9,null))['then'](function(_0x19ab97){if(_0x19ab97){return _0x19ab97[_0x701b('0x82')](_0x1d4082[_0x701b('0x4b')][_0x701b('0x65')],_[_0x701b('0x83')](_0x1d4082[_0x701b('0x4b')],[_0x701b('0x65'),'id'])||{})[_0x701b('0x84')](function(_0x581726){for(var _0x10820a=0x0;_0x10820a<_0x1d4082[_0x701b('0x4b')][_0x701b('0x65')]['length'];_0x10820a+=0x1){socket[_0x701b('0x6e')](_0x701b('0x6f'),{'UserId':Number(_0x1d4082[_0x701b('0x4b')][_0x701b('0x65')][_0x10820a]),'MailQueueId':Number(_0x1d4082['params']['id'])});}return _0x581726;});}})['then'](respondWithResult(_0x5552e9,null))['catch'](handleError(_0x5552e9,null));};exports[_0x701b('0x80')]=function(_0x1f40e8,_0x2ac9e2,_0x3f9eff){return db[_0x701b('0x2f')][_0x701b('0x49')]({'where':{'id':_0x1f40e8[_0x701b('0x47')]['id']}})[_0x701b('0x27')](handleEntityNotFound(_0x2ac9e2,null))['then'](function(_0x314704){if(_0x314704){return _0x314704['removeAgents'](_0x1f40e8['query']['ids'])[_0x701b('0x27')](function(){if(_['isArray'](_0x1f40e8['query'][_0x701b('0x65')])){for(var _0x4c131f=0x0;_0x4c131f<_0x1f40e8[_0x701b('0x34')][_0x701b('0x65')][_0x701b('0x3a')];_0x4c131f+=0x1){socket[_0x701b('0x6e')](_0x701b('0x81'),{'UserId':Number(_0x1f40e8['query'][_0x701b('0x65')][_0x4c131f]),'MailQueueId':Number(_0x1f40e8[_0x701b('0x47')]['id'])});}}else{socket[_0x701b('0x6e')]('userMailQueue:remove',{'UserId':Number(_0x1f40e8[_0x701b('0x34')][_0x701b('0x65')]),'MailQueueId':Number(_0x1f40e8['params']['id'])});}});}})[_0x701b('0x27')](respondWithStatusCode(_0x2ac9e2,null))['catch'](handleError(_0x2ac9e2,null));};exports[_0x701b('0x85')]=function(_0x1f4f0b,_0x3d9393,_0x29a973){var _0x1cfda2={};var _0x3a7bef={};var _0x5ca52a;var _0x3021c6;return db['MailQueue'][_0x701b('0x55')]({'where':{'id':_0x1f4f0b[_0x701b('0x47')]['id']}})[_0x701b('0x27')](handleEntityNotFound(_0x3d9393,null))['then'](function(_0x1bc6e4){if(_0x1bc6e4){_0x5ca52a=_0x1bc6e4;_0x3a7bef[_0x701b('0x33')]=_[_0x701b('0x35')](db['User']['rawAttributes']);_0x3a7bef[_0x701b('0x34')]=_[_0x701b('0x35')](_0x1f4f0b[_0x701b('0x34')]);_0x3a7bef[_0x701b('0x36')]=_[_0x701b('0x38')](_0x3a7bef[_0x701b('0x33')],_0x3a7bef[_0x701b('0x34')]);_0x1cfda2[_0x701b('0x37')]=_[_0x701b('0x38')](_0x3a7bef[_0x701b('0x33')],qs['fields'](_0x1f4f0b[_0x701b('0x34')][_0x701b('0x39')]));_0x1cfda2['attributes']=_0x1cfda2[_0x701b('0x37')][_0x701b('0x3a')]?_0x1cfda2[_0x701b('0x37')]:_0x3a7bef[_0x701b('0x33')];_0x1cfda2[_0x701b('0x3d')]=qs['sort'](_0x1f4f0b['query'][_0x701b('0x3e')]);_0x1cfda2[_0x701b('0x3f')]=qs[_0x701b('0x36')](_[_0x701b('0x40')](_0x1f4f0b[_0x701b('0x34')],_0x3a7bef[_0x701b('0x36')]));if(_0x1f4f0b[_0x701b('0x34')][_0x701b('0x58')]){_0x1cfda2[_0x701b('0x3f')]=_[_0x701b('0x41')](_0x1cfda2[_0x701b('0x3f')],{'$or':_[_0x701b('0x2e')](_0x1cfda2[_0x701b('0x37')],function(_0x16d41d){var _0x54b214={};_0x54b214[_0x16d41d]={'$like':'%'+_0x1f4f0b['query']['filter']+'%'};return _0x54b214;})});}_0x1cfda2=_[_0x701b('0x41')]({},_0x1cfda2,_0x1f4f0b['options']);return _0x5ca52a[_0x701b('0x85')](_0x1cfda2);}})[_0x701b('0x27')](function(_0x106f4c){if(_0x106f4c){_0x3021c6=_0x106f4c[_0x701b('0x3a')];if(!_0x1f4f0b[_0x701b('0x34')][_0x701b('0x3b')](_0x701b('0x3c'))){_0x1cfda2['limit']=qs['limit'](_0x1f4f0b[_0x701b('0x34')][_0x701b('0x21')]);_0x1cfda2['offset']=qs['offset'](_0x1f4f0b[_0x701b('0x34')][_0x701b('0x20')]);}return _0x5ca52a[_0x701b('0x85')](_0x1cfda2);}})['then'](function(_0x239579){if(_0x239579){return _0x239579?{'count':_0x3021c6,'rows':_0x239579}:null;}})[_0x701b('0x27')](respondWithResult(_0x3d9393,null))['catch'](handleError(_0x3d9393,null));}; \ No newline at end of file +var _0xaf5a=['findOne','UserMailQueue','hasOwnProperty','sort','pick','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','ids','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','QueryTypes','SELECT','every','TeamId','all','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','index','MailQueue','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe'];(function(_0x2d4a5f,_0x3e4ea4){var _0x1aaf63=function(_0x3ad778){while(--_0x3ad778){_0x2d4a5f['push'](_0x2d4a5f['shift']());}};_0x1aaf63(++_0x3e4ea4);}(_0xaf5a,0x144));var _0xaaf5=function(_0x264e1e,_0x3af804){_0x264e1e=_0x264e1e-0x0;var _0x4b1840=_0xaf5a[_0x264e1e];return _0x4b1840;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaf5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaaf5('0x1'));var rp=require(_0xaaf5('0x2'));var moment=require(_0xaaf5('0x3'));var BPromise=require(_0xaaf5('0x4'));var Mustache=require(_0xaaf5('0x5'));var util=require(_0xaaf5('0x6'));var path=require(_0xaaf5('0x7'));var sox=require(_0xaaf5('0x8'));var csv=require('to-csv');var ejs=require(_0xaaf5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaaf5('0xa'));var squel=require(_0xaaf5('0xb'));var crypto=require(_0xaaf5('0xc'));var jsforce=require(_0xaaf5('0xd'));var deskjs=require(_0xaaf5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaaf5('0xf'));var Papa=require(_0xaaf5('0x10'));var Redis=require(_0xaaf5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaaf5('0x12'));var as=require(_0xaaf5('0x13'));var hardwareService=require(_0xaaf5('0x14'));var logger=require(_0xaaf5('0x15'))(_0xaaf5('0x16'));var utils=require(_0xaaf5('0x17'));var config=require(_0xaaf5('0x18'));var licenseUtil=require(_0xaaf5('0x19'));var db=require(_0xaaf5('0x1a'))['db'];config[_0xaaf5('0x1b')]=_['defaults'](config[_0xaaf5('0x1b')],{'host':_0xaaf5('0x1c'),'port':0x18eb});var socket=require(_0xaaf5('0x1d'))(new Redis(config[_0xaaf5('0x1b')]));require(_0xaaf5('0x1e'))[_0xaaf5('0x1f')](socket);function respondWithStatusCode(_0x39bf16,_0x2e45ad){_0x2e45ad=_0x2e45ad||0xcc;return function(_0x47a8aa){if(_0x47a8aa){return _0x39bf16['sendStatus'](_0x2e45ad);}return _0x39bf16['status'](_0x2e45ad)[_0xaaf5('0x20')]();};}function respondWithResult(_0x3a58e6,_0x55f8f3){_0x55f8f3=_0x55f8f3||0xc8;return function(_0x3faf68){if(_0x3faf68){return _0x3a58e6[_0xaaf5('0x21')](_0x55f8f3)[_0xaaf5('0x22')](_0x3faf68);}};}function respondWithFilteredResult(_0x5bf25e,_0x56e709){return function(_0x236371){if(_0x236371){var _0x29d42a=typeof _0x56e709[_0xaaf5('0x23')]===_0xaaf5('0x24')&&typeof _0x56e709[_0xaaf5('0x25')]==='undefined';var _0x29899a=_0x236371[_0xaaf5('0x26')];var _0x459097=_0x29d42a?0x0:_0x56e709[_0xaaf5('0x23')];var _0x22b95d=_0x29d42a?_0x236371[_0xaaf5('0x26')]:_0x56e709[_0xaaf5('0x23')]+_0x56e709[_0xaaf5('0x25')];var _0x187175;if(_0x22b95d>=_0x29899a){_0x22b95d=_0x29899a;_0x187175=0xc8;}else{_0x187175=0xce;}_0x5bf25e['status'](_0x187175);return _0x5bf25e[_0xaaf5('0x27')](_0xaaf5('0x28'),_0x459097+'-'+_0x22b95d+'/'+_0x29899a)[_0xaaf5('0x22')](_0x236371);}return null;};}function patchUpdates(_0x2ac3cf){return function(_0x8c129){try{jsonpatch[_0xaaf5('0x29')](_0x8c129,_0x2ac3cf,!![]);}catch(_0x2900bf){return BPromise[_0xaaf5('0x2a')](_0x2900bf);}return _0x8c129['save']();};}function saveUpdates(_0x290d68,_0x30f383){return function(_0x1a1ff0){if(_0x1a1ff0){return _0x1a1ff0[_0xaaf5('0x2b')](_0x290d68)[_0xaaf5('0x2c')](function(_0x46dacd){return _0x46dacd;});}return null;};}function removeEntity(_0x115800,_0x433041){return function(_0x187285){if(_0x187285){return _0x187285[_0xaaf5('0x2d')]()['then'](function(){var _0x8b417e=_0x187285[_0xaaf5('0x2e')]({'plain':!![]});var _0x27b974=_0xaaf5('0x2f');return db[_0xaaf5('0x30')][_0xaaf5('0x2d')]({'where':{'type':_0x27b974,'resourceId':_0x8b417e['id']}})[_0xaaf5('0x2c')](function(){return _0x187285;});})['then'](function(){_0x115800[_0xaaf5('0x21')](0xcc)[_0xaaf5('0x20')]();});}};}function handleEntityNotFound(_0x325ab9,_0x49c7f2){return function(_0x5e9b31){if(!_0x5e9b31){_0x325ab9[_0xaaf5('0x31')](0x194);}return _0x5e9b31;};}function handleError(_0x5b8030,_0x3240b3){_0x3240b3=_0x3240b3||0x1f4;return function(_0x481eb5){logger[_0xaaf5('0x32')](_0x481eb5[_0xaaf5('0x33')]);if(_0x481eb5['name']){delete _0x481eb5['name'];}_0x5b8030['status'](_0x3240b3)['send'](_0x481eb5);};}exports[_0xaaf5('0x34')]=function(_0x13c616,_0x21fa04){var _0x1d613d={},_0x1547d1={},_0x3d948b={'count':0x0,'rows':[]};var _0x18dbf2=_['map'](db[_0xaaf5('0x35')][_0xaaf5('0x36')],function(_0x3c5bf5){return{'name':_0x3c5bf5[_0xaaf5('0x37')],'type':_0x3c5bf5['type']['key']};});_0x1547d1[_0xaaf5('0x38')]=_[_0xaaf5('0x39')](_0x18dbf2,'name');_0x1547d1[_0xaaf5('0x3a')]=_[_0xaaf5('0x3b')](_0x13c616['query']);_0x1547d1[_0xaaf5('0x3c')]=_[_0xaaf5('0x3d')](_0x1547d1[_0xaaf5('0x38')],_0x1547d1['query']);_0x1d613d[_0xaaf5('0x3e')]=_[_0xaaf5('0x3d')](_0x1547d1['model'],qs[_0xaaf5('0x3f')](_0x13c616['query'][_0xaaf5('0x3f')]));_0x1d613d[_0xaaf5('0x3e')]=_0x1d613d[_0xaaf5('0x3e')][_0xaaf5('0x40')]?_0x1d613d[_0xaaf5('0x3e')]:_0x1547d1['model'];if(!_0x13c616[_0xaaf5('0x3a')]['hasOwnProperty'](_0xaaf5('0x41'))){_0x1d613d[_0xaaf5('0x25')]=qs['limit'](_0x13c616[_0xaaf5('0x3a')][_0xaaf5('0x25')]);_0x1d613d[_0xaaf5('0x23')]=qs[_0xaaf5('0x23')](_0x13c616['query']['offset']);}_0x1d613d[_0xaaf5('0x42')]=qs['sort'](_0x13c616[_0xaaf5('0x3a')]['sort']);_0x1d613d['where']=qs['filters'](_['pick'](_0x13c616['query'],_0x1547d1[_0xaaf5('0x3c')]),_0x18dbf2);if(_0x13c616[_0xaaf5('0x3a')][_0xaaf5('0x43')]){_0x1d613d[_0xaaf5('0x44')]=_[_0xaaf5('0x45')](_0x1d613d['where'],{'$or':_[_0xaaf5('0x39')](_0x18dbf2,function(_0x329732){if(_0x329732['type']!==_0xaaf5('0x46')){var _0x565eac={};_0x565eac[_0x329732['name']]={'$like':'%'+_0x13c616[_0xaaf5('0x3a')][_0xaaf5('0x43')]+'%'};return _0x565eac;}})});}_0x1d613d=_[_0xaaf5('0x45')]({},_0x1d613d,_0x13c616[_0xaaf5('0x47')]);var _0x6f5787={'where':_0x1d613d['where']};return db['MailQueue'][_0xaaf5('0x26')](_0x6f5787)[_0xaaf5('0x2c')](function(_0x240118){_0x3d948b[_0xaaf5('0x26')]=_0x240118;if(_0x13c616[_0xaaf5('0x3a')][_0xaaf5('0x48')]){_0x1d613d[_0xaaf5('0x49')]=[{'all':!![]}];}return db['MailQueue'][_0xaaf5('0x4a')](_0x1d613d);})[_0xaaf5('0x2c')](function(_0x2a91e8){_0x3d948b[_0xaaf5('0x4b')]=_0x2a91e8;return _0x3d948b;})['then'](respondWithFilteredResult(_0x21fa04,_0x1d613d))[_0xaaf5('0x4c')](handleError(_0x21fa04,null));};exports['show']=function(_0x2ada87,_0x54aa4d){var _0x1b7b16={'raw':!![],'where':{'id':_0x2ada87['params']['id']}},_0x5f299f={};_0x5f299f['model']=_['keys'](db[_0xaaf5('0x35')][_0xaaf5('0x36')]);_0x5f299f[_0xaaf5('0x3a')]=_[_0xaaf5('0x3b')](_0x2ada87[_0xaaf5('0x3a')]);_0x5f299f[_0xaaf5('0x3c')]=_[_0xaaf5('0x3d')](_0x5f299f['model'],_0x5f299f[_0xaaf5('0x3a')]);_0x1b7b16[_0xaaf5('0x3e')]=_['intersection'](_0x5f299f[_0xaaf5('0x38')],qs[_0xaaf5('0x3f')](_0x2ada87[_0xaaf5('0x3a')][_0xaaf5('0x3f')]));_0x1b7b16[_0xaaf5('0x3e')]=_0x1b7b16[_0xaaf5('0x3e')]['length']?_0x1b7b16['attributes']:_0x5f299f[_0xaaf5('0x38')];if(_0x2ada87[_0xaaf5('0x3a')][_0xaaf5('0x48')]){_0x1b7b16['include']=[{'all':!![]}];}_0x1b7b16=_[_0xaaf5('0x45')]({},_0x1b7b16,_0x2ada87[_0xaaf5('0x47')]);return db[_0xaaf5('0x35')][_0xaaf5('0x4d')](_0x1b7b16)[_0xaaf5('0x2c')](handleEntityNotFound(_0x54aa4d,null))[_0xaaf5('0x2c')](respondWithResult(_0x54aa4d,null))[_0xaaf5('0x4c')](handleError(_0x54aa4d,null));};exports[_0xaaf5('0x4e')]=function(_0x43e897,_0x5cc642){return db['MailQueue'][_0xaaf5('0x4e')](_0x43e897[_0xaaf5('0x4f')],{})[_0xaaf5('0x2c')](function(_0x41528a){var _0x46ddfa=_0x43e897['user'][_0xaaf5('0x2e')]({'plain':!![]});if(!_0x46ddfa)throw new Error(_0xaaf5('0x50'));if(_0x46ddfa['role']===_0xaaf5('0x51')){var _0x409b29=_0x41528a[_0xaaf5('0x2e')]({'plain':!![]});var _0x4b7b23=_0xaaf5('0x2f');return db['UserProfileSection']['find']({'where':{'name':_0x4b7b23,'userProfileId':_0x46ddfa['userProfileId']},'raw':!![]})[_0xaaf5('0x2c')](function(_0x5b1318){if(_0x5b1318&&_0x5b1318[_0xaaf5('0x52')]===0x0){return db[_0xaaf5('0x30')][_0xaaf5('0x4e')]({'name':_0x409b29[_0xaaf5('0x53')],'resourceId':_0x409b29['id'],'type':_0x5b1318[_0xaaf5('0x53')],'sectionId':_0x5b1318['id']},{})['then'](function(){return _0x41528a;});}else{return _0x41528a;}})[_0xaaf5('0x4c')](function(_0x1396a3){logger[_0xaaf5('0x32')](_0xaaf5('0x54'),_0x1396a3);throw _0x1396a3;});}return _0x41528a;})['then'](respondWithResult(_0x5cc642,0xc9))[_0xaaf5('0x4c')](handleError(_0x5cc642,null));};exports[_0xaaf5('0x2b')]=function(_0x2ad64d,_0x56381c){if(_0x2ad64d['body']['id']){delete _0x2ad64d[_0xaaf5('0x4f')]['id'];}return db[_0xaaf5('0x35')][_0xaaf5('0x4d')]({'where':{'id':_0x2ad64d[_0xaaf5('0x55')]['id']}})['then'](handleEntityNotFound(_0x56381c,null))[_0xaaf5('0x2c')](saveUpdates(_0x2ad64d[_0xaaf5('0x4f')],null))['then'](respondWithResult(_0x56381c,null))[_0xaaf5('0x4c')](handleError(_0x56381c,null));};exports[_0xaaf5('0x2d')]=function(_0x1c95cf,_0x1f1fdf){return db[_0xaaf5('0x35')][_0xaaf5('0x4d')]({'where':{'id':_0x1c95cf[_0xaaf5('0x55')]['id']}})[_0xaaf5('0x2c')](handleEntityNotFound(_0x1f1fdf,null))[_0xaaf5('0x2c')](removeEntity(_0x1f1fdf,null))[_0xaaf5('0x4c')](handleError(_0x1f1fdf,null));};exports[_0xaaf5('0x56')]=function(_0x576cd1,_0x2a5283){return db[_0xaaf5('0x35')]['describe']()['then'](respondWithResult(_0x2a5283,null))[_0xaaf5('0x4c')](handleError(_0x2a5283,null));};exports['getMembers']=function(_0x2cb1b3,_0x363597,_0xff3339){var _0x310c55={'raw':!![],'where':{}},_0x11355a={},_0x11f545;return db[_0xaaf5('0x35')][_0xaaf5('0x57')]({'where':{'id':_0x2cb1b3['params']['id']}})[_0xaaf5('0x2c')](handleEntityNotFound(_0x363597,null))[_0xaaf5('0x2c')](function(_0x5f4f9f){if(_0x5f4f9f){_0x11f545=_0x5f4f9f[_0xaaf5('0x2e')]({'plain':!![]});_0x11355a[_0xaaf5('0x38')]=_['keys'](db[_0xaaf5('0x58')][_0xaaf5('0x36')]);_0x11355a[_0xaaf5('0x3a')]=_[_0xaaf5('0x3b')](_0x2cb1b3[_0xaaf5('0x3a')]);_0x11355a[_0xaaf5('0x3c')]=_[_0xaaf5('0x3d')](_0x11355a[_0xaaf5('0x38')],_0x11355a[_0xaaf5('0x3a')]);_0x310c55[_0xaaf5('0x3e')]=_[_0xaaf5('0x3d')](_0x11355a[_0xaaf5('0x38')],qs['fields'](_0x2cb1b3['query'][_0xaaf5('0x3f')]));_0x310c55[_0xaaf5('0x3e')]=_0x310c55[_0xaaf5('0x3e')][_0xaaf5('0x40')]?_0x310c55[_0xaaf5('0x3e')]:_0x11355a[_0xaaf5('0x38')];if(!_0x2cb1b3[_0xaaf5('0x3a')][_0xaaf5('0x59')]('nolimit')){_0x310c55[_0xaaf5('0x25')]=qs['limit'](_0x2cb1b3[_0xaaf5('0x3a')][_0xaaf5('0x25')]);_0x310c55[_0xaaf5('0x23')]=qs[_0xaaf5('0x23')](_0x2cb1b3[_0xaaf5('0x3a')][_0xaaf5('0x23')]);}_0x310c55[_0xaaf5('0x42')]=qs[_0xaaf5('0x5a')](_0x2cb1b3[_0xaaf5('0x3a')]['sort']);_0x310c55[_0xaaf5('0x44')]=qs[_0xaaf5('0x3c')](_[_0xaaf5('0x5b')](_0x2cb1b3[_0xaaf5('0x3a')],_0x11355a[_0xaaf5('0x3c')]));_0x310c55[_0xaaf5('0x44')]['MailQueueId']=_0x5f4f9f['id'];if(_0x2cb1b3[_0xaaf5('0x3a')][_0xaaf5('0x43')]){_0x310c55[_0xaaf5('0x44')]=_[_0xaaf5('0x45')](_0x310c55[_0xaaf5('0x44')],{'$or':_['map'](_0x310c55[_0xaaf5('0x3e')],function(_0x1694c6){var _0x120de9={};_0x120de9[_0x1694c6]={'$like':'%'+_0x2cb1b3[_0xaaf5('0x3a')][_0xaaf5('0x43')]+'%'};return _0x120de9;})});}_0x310c55=_[_0xaaf5('0x45')]({},_0x310c55,_0x2cb1b3[_0xaaf5('0x47')]);return db[_0xaaf5('0x58')][_0xaaf5('0x4a')](_0x310c55);}})[_0xaaf5('0x2c')](function(_0x29b7ea){if(_0x29b7ea){return db[_0xaaf5('0x5c')][_0xaaf5('0x5d')]({'where':{'id':_[_0xaaf5('0x39')](_0x29b7ea,_0xaaf5('0x5e')),'role':_0xaaf5('0x5f')},'attributes':['id',_0xaaf5('0x53'),_0xaaf5('0x60'),_0xaaf5('0x61'),_0xaaf5('0x62')]});}})[_0xaaf5('0x2c')](function(_0x21aa9c){if(_0x21aa9c){return{'count':_0x21aa9c[_0xaaf5('0x26')],'rows':_[_0xaaf5('0x39')](_0x21aa9c[_0xaaf5('0x4b')],function(_0x162c65){return{'membername':_0x162c65[_0xaaf5('0x53')],'UserId':_0x162c65['id'],'queue_name':_0x11f545[_0xaaf5('0x53')],'MailQueueId':_0x11f545['id'],'interface':util[_0xaaf5('0x63')](_0xaaf5('0x64'),'SIP',_0x162c65[_0xaaf5('0x53')]),'penalty':0x0,'paused':_0x162c65[_0xaaf5('0x60')],'createdAt':_0x162c65[_0xaaf5('0x62')],'updatedAt':_0x162c65[_0xaaf5('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x363597,_0x310c55))[_0xaaf5('0x4c')](handleError(_0x363597,null));};exports[_0xaaf5('0x65')]=function(_0x43ff88,_0x20dccd,_0xc0df5a){var _0x262194={};var _0x79cc01={};var _0x9f3aa7;var _0x407bf9;return db['MailQueue'][_0xaaf5('0x57')]({'where':{'id':_0x43ff88[_0xaaf5('0x55')]['id']}})[_0xaaf5('0x2c')](handleEntityNotFound(_0x20dccd,null))[_0xaaf5('0x2c')](function(_0x285ce1){if(_0x285ce1){_0x9f3aa7=_0x285ce1;_0x79cc01[_0xaaf5('0x38')]=_[_0xaaf5('0x3b')](db[_0xaaf5('0x66')][_0xaaf5('0x36')]);_0x79cc01['query']=_[_0xaaf5('0x3b')](_0x43ff88['query']);_0x79cc01[_0xaaf5('0x3c')]=_[_0xaaf5('0x3d')](_0x79cc01[_0xaaf5('0x38')],_0x79cc01[_0xaaf5('0x3a')]);_0x262194['attributes']=_['intersection'](_0x79cc01[_0xaaf5('0x38')],qs['fields'](_0x43ff88[_0xaaf5('0x3a')]['fields']));_0x262194[_0xaaf5('0x3e')]=_0x262194[_0xaaf5('0x3e')]['length']?_0x262194['attributes']:_0x79cc01[_0xaaf5('0x38')];_0x262194[_0xaaf5('0x42')]=qs[_0xaaf5('0x5a')](_0x43ff88[_0xaaf5('0x3a')][_0xaaf5('0x5a')]);_0x262194[_0xaaf5('0x44')]=qs[_0xaaf5('0x3c')](_[_0xaaf5('0x5b')](_0x43ff88['query'],_0x79cc01[_0xaaf5('0x3c')]));if(_0x43ff88[_0xaaf5('0x3a')][_0xaaf5('0x43')]){_0x262194[_0xaaf5('0x44')]=_['merge'](_0x262194[_0xaaf5('0x44')],{'$or':_['map'](_0x262194[_0xaaf5('0x3e')],function(_0x125583){var _0x5495e1={};_0x5495e1[_0x125583]={'$like':'%'+_0x43ff88[_0xaaf5('0x3a')][_0xaaf5('0x43')]+'%'};return _0x5495e1;})});}_0x262194=_['merge']({},_0x262194,_0x43ff88[_0xaaf5('0x47')]);return _0x9f3aa7[_0xaaf5('0x65')](_0x262194);}})[_0xaaf5('0x2c')](function(_0x5f0aa1){if(_0x5f0aa1){_0x407bf9=_0x5f0aa1['length'];if(!_0x43ff88['query'][_0xaaf5('0x59')](_0xaaf5('0x41'))){_0x262194[_0xaaf5('0x25')]=qs['limit'](_0x43ff88['query'][_0xaaf5('0x25')]);_0x262194[_0xaaf5('0x23')]=qs[_0xaaf5('0x23')](_0x43ff88[_0xaaf5('0x3a')]['offset']);}return _0x9f3aa7[_0xaaf5('0x65')](_0x262194);}})['then'](function(_0x3bea2e){if(_0x3bea2e){return _0x3bea2e?{'count':_0x407bf9,'rows':_0x3bea2e}:null;}})[_0xaaf5('0x2c')](respondWithResult(_0x20dccd,null))[_0xaaf5('0x4c')](handleError(_0x20dccd,null));};exports[_0xaaf5('0x67')]=function(_0x261793,_0x1748f7,_0xbc1a4){var _0x6f47c4=_0x261793[_0xaaf5('0x4f')]['ids'];return db['Team'][_0xaaf5('0x4a')]({'where':{'id':_0x6f47c4},'attributes':['id'],'include':[{'model':db[_0xaaf5('0x5c')],'as':_0xaaf5('0x68'),'attributes':['id',_0xaaf5('0x53'),_0xaaf5('0x69'),_0xaaf5('0x6a'),_0xaaf5('0x6b')],'raw':!![]}]})[_0xaaf5('0x2c')](function(_0x1eb223){if(_0x1eb223){var _0x2a3c8a=_['flatMap'](_0x1eb223,function(_0x4791e){var _0x24c5b3=_0x4791e[_0xaaf5('0x2e')]({'plain':!![]});return _0x24c5b3['Agents'];});return db[_0xaaf5('0x35')]['find']({'where':{'id':_0x261793['params']['id']}})[_0xaaf5('0x2c')](function(_0x245b17){return db[_0xaaf5('0x6c')][_0xaaf5('0x6d')](function(_0x48d78d){return _0x245b17[_0xaaf5('0x67')](_0x6f47c4,{'transaction':_0x48d78d})[_0xaaf5('0x2c')](function(){return BPromise[_0xaaf5('0x6e')](_0x2a3c8a,function(_0x29f6b1){return db[_0xaaf5('0x58')][_0xaaf5('0x6f')]({'where':{'UserId':_0x29f6b1['id'],'MailQueueId':_0x261793['params']['id']},'transaction':_0x48d78d});});})[_0xaaf5('0x2c')](function(){_0x2a3c8a['forEach'](function(_0x4b7af4){socket[_0xaaf5('0x70')](_0xaaf5('0x71'),{'UserId':_0x4b7af4['id'],'MailQueueId':_0x245b17['id']});});});});});}})[_0xaaf5('0x2c')](respondWithStatusCode(_0x1748f7,null))[_0xaaf5('0x4c')](handleError(_0x1748f7,null));};exports[_0xaaf5('0x72')]=function(_0x112b0d,_0x19f37c,_0x45850a){return db[_0xaaf5('0x66')][_0xaaf5('0x4a')]({'where':{'id':_0x112b0d[_0xaaf5('0x3a')][_0xaaf5('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xaaf5('0x68'),'attributes':['id'],'raw':!![]}]})[_0xaaf5('0x2c')](handleEntityNotFound(_0x19f37c,null))[_0xaaf5('0x2c')](function(_0x4280f2){var _0x210ebc=_['map'](_0x4280f2,'id');var _0x16e0a5=[];var _0x59d88d=[];var _0x15b016=squel[_0xaaf5('0x74')]();_0x15b016['field']('tq.TeamId')[_0xaaf5('0x75')]('team_has_mail_queues','tq')[_0xaaf5('0x76')](_0xaaf5('0x77'),'ut',_0xaaf5('0x78'))['where'](_0xaaf5('0x79'),_0x112b0d[_0xaaf5('0x55')]['id']);for(var _0x360961=0x0;_0x360961<_0x4280f2['length'];_0x360961+=0x1){let _0x1da5b8=_0x4280f2[_0x360961];for(var _0x349238=0x0;_0x349238<_0x1da5b8[_0xaaf5('0x68')][_0xaaf5('0x40')];_0x349238+=0x1){let _0x18dedf=_0x1da5b8['Agents'][_0x349238];var _0x3a6415=_0x15b016[_0xaaf5('0x7a')]();_0x3a6415[_0xaaf5('0x44')]('ut.UserId\x20=\x20?',_0x18dedf['id']);_0x59d88d['push'](db['sequelize']['query'](_0x3a6415['toString'](),{'type':db[_0xaaf5('0x6c')][_0xaaf5('0x7b')][_0xaaf5('0x7c')]})['then'](function(_0x32f3a0){if(_0x32f3a0[_0xaaf5('0x40')]===0x1){return _0x18dedf['id'];}else{var _0x77c1e0=_[_0xaaf5('0x7d')](_[_0xaaf5('0x39')](_0x32f3a0,_0xaaf5('0x7e')),function(_0x4155f3){return _['includes'](_0x210ebc,_0x4155f3);});if(_0x77c1e0){return _0x18dedf['id'];}}}));}}return BPromise[_0xaaf5('0x7f')](_0x59d88d)['then'](function(_0x445c77){_0x16e0a5=_(_0x16e0a5)['union'](_0x445c77)['compact']()['value']();return db[_0xaaf5('0x35')]['find']({'where':{'id':_0x112b0d[_0xaaf5('0x55')]['id']}})[_0xaaf5('0x2c')](function(_0x4b2158){return db[_0xaaf5('0x6c')]['transaction'](function(_0x575f77){return _0x4b2158[_0xaaf5('0x72')](_0x112b0d[_0xaaf5('0x3a')]['ids'],{'transaction':_0x575f77})[_0xaaf5('0x2c')](function(){if(!_[_0xaaf5('0x80')](_0x16e0a5)){return _0x4b2158[_0xaaf5('0x81')](_0x16e0a5,{'transaction':_0x575f77});}})[_0xaaf5('0x2c')](function(){_0x16e0a5[_0xaaf5('0x82')](function(_0x9e60b4){socket[_0xaaf5('0x70')](_0xaaf5('0x83'),{'UserId':_0x9e60b4,'MailQueueId':_0x4b2158['id']});});});});});});})['then'](respondWithStatusCode(_0x19f37c,null))[_0xaaf5('0x4c')](handleError(_0x19f37c,null));};exports['addAgents']=function(_0x1d032c,_0x1c9cc0,_0x1fd4b2){return db[_0xaaf5('0x35')]['find']({'where':{'id':_0x1d032c[_0xaaf5('0x55')]['id']}})[_0xaaf5('0x2c')](handleEntityNotFound(_0x1c9cc0,null))[_0xaaf5('0x2c')](function(_0x7fb3ef){if(_0x7fb3ef){return _0x7fb3ef[_0xaaf5('0x84')](_0x1d032c[_0xaaf5('0x4f')][_0xaaf5('0x73')],_[_0xaaf5('0x85')](_0x1d032c[_0xaaf5('0x4f')],[_0xaaf5('0x73'),'id'])||{})[_0xaaf5('0x86')](function(_0x389a4a){for(var _0x14a0e8=0x0;_0x14a0e8<_0x1d032c[_0xaaf5('0x4f')][_0xaaf5('0x73')][_0xaaf5('0x40')];_0x14a0e8+=0x1){socket[_0xaaf5('0x70')](_0xaaf5('0x71'),{'UserId':Number(_0x1d032c[_0xaaf5('0x4f')][_0xaaf5('0x73')][_0x14a0e8]),'MailQueueId':Number(_0x1d032c[_0xaaf5('0x55')]['id'])});}return _0x389a4a;});}})[_0xaaf5('0x2c')](respondWithResult(_0x1c9cc0,null))[_0xaaf5('0x4c')](handleError(_0x1c9cc0,null));};exports[_0xaaf5('0x81')]=function(_0x96c4a6,_0x49905c,_0x49bb3b){return db[_0xaaf5('0x35')][_0xaaf5('0x4d')]({'where':{'id':_0x96c4a6[_0xaaf5('0x55')]['id']}})['then'](handleEntityNotFound(_0x49905c,null))['then'](function(_0x5f05c6){if(_0x5f05c6){return _0x5f05c6[_0xaaf5('0x81')](_0x96c4a6[_0xaaf5('0x3a')][_0xaaf5('0x73')])[_0xaaf5('0x2c')](function(){if(_[_0xaaf5('0x87')](_0x96c4a6['query'][_0xaaf5('0x73')])){for(var _0x23b501=0x0;_0x23b501<_0x96c4a6[_0xaaf5('0x3a')]['ids'][_0xaaf5('0x40')];_0x23b501+=0x1){socket[_0xaaf5('0x70')](_0xaaf5('0x83'),{'UserId':Number(_0x96c4a6[_0xaaf5('0x3a')][_0xaaf5('0x73')][_0x23b501]),'MailQueueId':Number(_0x96c4a6[_0xaaf5('0x55')]['id'])});}}else{socket[_0xaaf5('0x70')]('userMailQueue:remove',{'UserId':Number(_0x96c4a6['query']['ids']),'MailQueueId':Number(_0x96c4a6['params']['id'])});}});}})[_0xaaf5('0x2c')](respondWithStatusCode(_0x49905c,null))[_0xaaf5('0x4c')](handleError(_0x49905c,null));};exports[_0xaaf5('0x88')]=function(_0xdfb3a4,_0x47b7a5,_0x51a713){var _0x2e755f={};var _0x179ba7={};var _0x5e6d46;var _0x5ea13e;return db[_0xaaf5('0x35')][_0xaaf5('0x57')]({'where':{'id':_0xdfb3a4[_0xaaf5('0x55')]['id']}})[_0xaaf5('0x2c')](handleEntityNotFound(_0x47b7a5,null))[_0xaaf5('0x2c')](function(_0x316335){if(_0x316335){_0x5e6d46=_0x316335;_0x179ba7[_0xaaf5('0x38')]=_[_0xaaf5('0x3b')](db['User'][_0xaaf5('0x36')]);_0x179ba7[_0xaaf5('0x3a')]=_[_0xaaf5('0x3b')](_0xdfb3a4[_0xaaf5('0x3a')]);_0x179ba7['filters']=_[_0xaaf5('0x3d')](_0x179ba7[_0xaaf5('0x38')],_0x179ba7['query']);_0x2e755f[_0xaaf5('0x3e')]=_[_0xaaf5('0x3d')](_0x179ba7[_0xaaf5('0x38')],qs[_0xaaf5('0x3f')](_0xdfb3a4[_0xaaf5('0x3a')][_0xaaf5('0x3f')]));_0x2e755f[_0xaaf5('0x3e')]=_0x2e755f[_0xaaf5('0x3e')][_0xaaf5('0x40')]?_0x2e755f[_0xaaf5('0x3e')]:_0x179ba7['model'];_0x2e755f[_0xaaf5('0x42')]=qs['sort'](_0xdfb3a4[_0xaaf5('0x3a')][_0xaaf5('0x5a')]);_0x2e755f[_0xaaf5('0x44')]=qs[_0xaaf5('0x3c')](_[_0xaaf5('0x5b')](_0xdfb3a4[_0xaaf5('0x3a')],_0x179ba7['filters']));if(_0xdfb3a4[_0xaaf5('0x3a')][_0xaaf5('0x43')]){_0x2e755f[_0xaaf5('0x44')]=_[_0xaaf5('0x45')](_0x2e755f[_0xaaf5('0x44')],{'$or':_[_0xaaf5('0x39')](_0x2e755f['attributes'],function(_0xda0c29){var _0x383b4b={};_0x383b4b[_0xda0c29]={'$like':'%'+_0xdfb3a4[_0xaaf5('0x3a')]['filter']+'%'};return _0x383b4b;})});}_0x2e755f=_['merge']({},_0x2e755f,_0xdfb3a4[_0xaaf5('0x47')]);return _0x5e6d46[_0xaaf5('0x88')](_0x2e755f);}})[_0xaaf5('0x2c')](function(_0x33bb10){if(_0x33bb10){_0x5ea13e=_0x33bb10['length'];if(!_0xdfb3a4[_0xaaf5('0x3a')][_0xaaf5('0x59')](_0xaaf5('0x41'))){_0x2e755f[_0xaaf5('0x25')]=qs[_0xaaf5('0x25')](_0xdfb3a4[_0xaaf5('0x3a')][_0xaaf5('0x25')]);_0x2e755f[_0xaaf5('0x23')]=qs[_0xaaf5('0x23')](_0xdfb3a4['query'][_0xaaf5('0x23')]);}return _0x5e6d46[_0xaaf5('0x88')](_0x2e755f);}})[_0xaaf5('0x2c')](function(_0x4606bd){if(_0x4606bd){return _0x4606bd?{'count':_0x5ea13e,'rows':_0x4606bd}:null;}})['then'](respondWithResult(_0x47b7a5,null))['catch'](handleError(_0x47b7a5,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 5b41131..b4bc418 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 _0xee86=['update','remove','emit','exports','events','MailQueue','setMaxListeners','save'];(function(_0x5628a0,_0x1adf2b){var _0x12f9a9=function(_0x321486){while(--_0x321486){_0x5628a0['push'](_0x5628a0['shift']());}};_0x12f9a9(++_0x1adf2b);}(_0xee86,0x144));var _0x6ee8=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xee86[_0x3ab9ee];return _0x82ee88;};'use strict';var EventEmitter=require(_0x6ee8('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x6ee8('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6ee8('0x2')](0x0);var events={'afterCreate':_0x6ee8('0x3'),'afterUpdate':_0x6ee8('0x4'),'afterDestroy':_0x6ee8('0x5')};function emitEvent(_0x261648){return function(_0x210b5d,_0x265fd0,_0x29680a){MailQueueEvents[_0x6ee8('0x6')](_0x261648+':'+_0x210b5d['id'],_0x210b5d);MailQueueEvents[_0x6ee8('0x6')](_0x261648,_0x210b5d);_0x29680a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x6ee8('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x2e0a=['../../mysqldb','MailQueue','save','remove','emit','hasOwnProperty','events'];(function(_0x40a22f,_0xb3bba9){var _0x3f95c9=function(_0x13766d){while(--_0x13766d){_0x40a22f['push'](_0x40a22f['shift']());}};_0x3f95c9(++_0xb3bba9);}(_0x2e0a,0xae));var _0xa2e0=function(_0x41829f,_0x30fe1b){_0x41829f=_0x41829f-0x0;var _0x69562f=_0x2e0a[_0x41829f];return _0x69562f;};'use strict';var EventEmitter=require(_0xa2e0('0x0'));var MailQueue=require(_0xa2e0('0x1'))['db'][_0xa2e0('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa2e0('0x3'),'afterUpdate':'update','afterDestroy':_0xa2e0('0x4')};function emitEvent(_0xbaa47){return function(_0x38ae52,_0x5ba2a7,_0x20c70a){MailQueueEvents[_0xa2e0('0x5')](_0xbaa47+':'+_0x38ae52['id'],_0x38ae52);MailQueueEvents[_0xa2e0('0x5')](_0xbaa47,_0x38ae52);_0x20c70a(null);};}for(var e in events){if(events[_0xa2e0('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 9e39604..7bca724 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 _0x9ffe=['exports','MailQueue','lodash','util','../../config/logger','request-promise','rimraf','./mailQueue.attributes'];(function(_0x552875,_0x294d6a){var _0x4cc2f1=function(_0x4cf0e1){while(--_0x4cf0e1){_0x552875['push'](_0x552875['shift']());}};_0x4cc2f1(++_0x294d6a);}(_0x9ffe,0xba));var _0xe9ff=function(_0x52bdfe,_0x5282ec){_0x52bdfe=_0x52bdfe-0x0;var _0x5c6df7=_0x9ffe[_0x52bdfe];return _0x5c6df7;};'use strict';var _=require(_0xe9ff('0x0'));var util=require(_0xe9ff('0x1'));var logger=require(_0xe9ff('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe9ff('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9ff('0x4'));var config=require('../../config/environment');var attributes=require(_0xe9ff('0x5'));module[_0xe9ff('0x6')]=function(_0x4f39c0,_0x5b399d){return _0x4f39c0['define'](_0xe9ff('0x7'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a7b=['mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','MailQueue'];(function(_0xc7bc9a,_0x11cf88){var _0x28212a=function(_0x4406cd){while(--_0x4406cd){_0xc7bc9a['push'](_0xc7bc9a['shift']());}};_0x28212a(++_0x11cf88);}(_0x4a7b,0x1a3));var _0xb4a7=function(_0x72cad0,_0x1ee994){_0x72cad0=_0x72cad0-0x0;var _0xd5c9e2=_0x4a7b[_0x72cad0];return _0xd5c9e2;};'use strict';var _=require(_0xb4a7('0x0'));var util=require(_0xb4a7('0x1'));var logger=require('../../config/logger')(_0xb4a7('0x2'));var moment=require(_0xb4a7('0x3'));var BPromise=require(_0xb4a7('0x4'));var rp=require(_0xb4a7('0x5'));var fs=require('fs');var path=require(_0xb4a7('0x6'));var rimraf=require(_0xb4a7('0x7'));var config=require(_0xb4a7('0x8'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x53ff54,_0xd2cb71){return _0x53ff54['define'](_0xb4a7('0x9'),attributes,{'tableName':_0xb4a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 4478605..d9b9308 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 _0xc62c=['http','defaults','localhost','redis','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','map','include','model','ShowMailQueue','find','raw','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x469af7,_0x53e07d){var _0x4ca29b=function(_0x1baa21){while(--_0x1baa21){_0x469af7['push'](_0x469af7['shift']());}};_0x4ca29b(++_0x53e07d);}(_0xc62c,0x1c2));var _0xcc62=function(_0x24d0f7,_0x42cda7){_0x24d0f7=_0x24d0f7-0x0;var _0x1fa1a6=_0xc62c[_0x24d0f7];return _0x1fa1a6;};'use strict';var _=require(_0xcc62('0x0'));var util=require(_0xcc62('0x1'));var moment=require(_0xcc62('0x2'));var BPromise=require(_0xcc62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc62('0x4'));var db=require(_0xcc62('0x5'))['db'];var utils=require(_0xcc62('0x6'));var logger=require(_0xcc62('0x7'))(_0xcc62('0x8'));var config=require(_0xcc62('0x9'));var jayson=require(_0xcc62('0xa'));var client=jayson[_0xcc62('0xb')][_0xcc62('0xc')]({'port':0x232a});config['redis']=_[_0xcc62('0xd')](config['redis'],{'host':_0xcc62('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc62('0xf')]));require(_0xcc62('0x10'))[_0xcc62('0x11')](socket);function respondWithRpcPromise(_0x29957c,_0x463192,_0x3af56a){return new BPromise(function(_0x10b0b8,_0x4fce32){return client['request'](_0x29957c,_0x3af56a)[_0xcc62('0x12')](function(_0x4bd641){logger[_0xcc62('0x13')](_0xcc62('0x14'),_0x463192,_0xcc62('0x15'));logger[_0xcc62('0x16')](_0xcc62('0x17'),_0x463192,_0xcc62('0x15'),JSON[_0xcc62('0x18')](_0x4bd641));if(_0x4bd641[_0xcc62('0x19')]){if(_0x4bd641[_0xcc62('0x19')][_0xcc62('0x1a')]===0x1f4){logger[_0xcc62('0x19')](_0xcc62('0x14'),_0x463192,_0x4bd641['error'][_0xcc62('0x1b')]);return _0x4fce32(_0x4bd641[_0xcc62('0x19')]['message']);}logger[_0xcc62('0x19')](_0xcc62('0x14'),_0x463192,_0x4bd641[_0xcc62('0x19')][_0xcc62('0x1b')]);return _0x10b0b8(_0x4bd641[_0xcc62('0x19')][_0xcc62('0x1b')]);}else{logger[_0xcc62('0x13')]('MailQueue,\x20%s,\x20%s',_0x463192,'request\x20sent');_0x10b0b8(_0x4bd641[_0xcc62('0x1c')][_0xcc62('0x1b')]);}})[_0xcc62('0x1d')](function(_0x478e05){logger['error'](_0xcc62('0x14'),_0x463192,_0x478e05);_0x4fce32(_0x478e05);});});}exports[_0xcc62('0x1e')]=function(_0x5236dc){var _0x280238=this;return new Promise(function(_0x4f117c,_0x368a00){return db[_0xcc62('0x1f')][_0xcc62('0x20')]({'raw':_0x5236dc['options']?_0x5236dc[_0xcc62('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x5236dc[_0xcc62('0x21')]?_0x5236dc[_0xcc62('0x21')]['where']||null:null,'attributes':_0x5236dc[_0xcc62('0x21')]?_0x5236dc[_0xcc62('0x21')][_0xcc62('0x22')]||null:null,'limit':_0x5236dc['options']?_0x5236dc['options']['limit']||null:null,'include':_0x5236dc[_0xcc62('0x21')]?_0x5236dc['options']['include']?_[_0xcc62('0x23')](_0x5236dc[_0xcc62('0x21')][_0xcc62('0x24')],function(_0x586834){return{'model':db[_0x586834['model']],'as':_0x586834['as'],'attributes':_0x586834[_0xcc62('0x22')],'include':_0x586834[_0xcc62('0x24')]?_[_0xcc62('0x23')](_0x586834['include'],function(_0x28e7ec){return{'model':db[_0x28e7ec[_0xcc62('0x25')]],'as':_0x28e7ec['as'],'attributes':_0x28e7ec[_0xcc62('0x22')],'include':_0x28e7ec[_0xcc62('0x24')]?_['map'](_0x28e7ec[_0xcc62('0x24')],function(_0x4aa5a2){return{'model':db[_0x4aa5a2[_0xcc62('0x25')]],'as':_0x4aa5a2['as'],'attributes':_0x4aa5a2['attributes']};}):[]};}):[]};}):[]:[]})[_0xcc62('0x12')](function(_0x4893e8){logger[_0xcc62('0x13')](_0xcc62('0x1e'),_0x5236dc);logger[_0xcc62('0x16')](_0xcc62('0x1e'),_0x5236dc,JSON['stringify'](_0x4893e8));_0x4f117c(_0x4893e8);})[_0xcc62('0x1d')](function(_0x3ad52b){logger['error']('GetMailQueue',_0x3ad52b[_0xcc62('0x1b')],_0x5236dc);_0x368a00(_0x280238[_0xcc62('0x19')](0x1f4,_0x3ad52b[_0xcc62('0x1b')]));});});};exports[_0xcc62('0x26')]=function(_0x528cf4){var _0x2c18aa=this;return new Promise(function(_0xa9d8c9,_0x2095a0){return db['MailQueue'][_0xcc62('0x27')]({'raw':_0x528cf4[_0xcc62('0x21')]?_0x528cf4['options'][_0xcc62('0x28')]===undefined?!![]:![]:!![],'where':_0x528cf4[_0xcc62('0x21')]?_0x528cf4[_0xcc62('0x21')][_0xcc62('0x29')]||null:null,'attributes':_0x528cf4[_0xcc62('0x21')]?_0x528cf4[_0xcc62('0x21')][_0xcc62('0x22')]||null:null,'include':_0x528cf4['options']?_0x528cf4[_0xcc62('0x21')][_0xcc62('0x24')]?_['map'](_0x528cf4['options']['include'],function(_0x984ca2){return{'model':db[_0x984ca2[_0xcc62('0x25')]],'as':_0x984ca2['as'],'attributes':_0x984ca2[_0xcc62('0x22')],'include':_0x984ca2[_0xcc62('0x24')]?_[_0xcc62('0x23')](_0x984ca2[_0xcc62('0x24')],function(_0x1f8b49){return{'model':db[_0x1f8b49[_0xcc62('0x25')]],'as':_0x1f8b49['as'],'attributes':_0x1f8b49[_0xcc62('0x22')],'include':_0x1f8b49[_0xcc62('0x24')]?_['map'](_0x1f8b49[_0xcc62('0x24')],function(_0x79ad57){return{'model':db[_0x79ad57[_0xcc62('0x25')]],'as':_0x79ad57['as'],'attributes':_0x79ad57[_0xcc62('0x22')]};}):[]};}):[]};}):[]:[]})[_0xcc62('0x12')](function(_0x3939d9){logger[_0xcc62('0x13')](_0xcc62('0x26'),_0x528cf4);logger['debug']('ShowMailQueue',_0x528cf4,JSON['stringify'](_0x3939d9));_0xa9d8c9(_0x3939d9);})[_0xcc62('0x1d')](function(_0x3c8b49){logger[_0xcc62('0x19')](_0xcc62('0x26'),_0x3c8b49[_0xcc62('0x1b')],_0x528cf4);_0x2095a0(_0x2c18aa['error'](0x1f4,_0x3c8b49['message']));});});}; \ No newline at end of file +var _0x9f9f=['message','result','catch','MailQueue','findAll','options','where','attributes','limit','include','map','model','GetMailQueue','raw','ShowMailQueue','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5ea82f,_0x41ef96){var _0x2f38b6=function(_0x5b084e){while(--_0x5b084e){_0x5ea82f['push'](_0x5ea82f['shift']());}};_0x2f38b6(++_0x41ef96);}(_0x9f9f,0x100));var _0xf9f9=function(_0x533e8b,_0x169ad4){_0x533e8b=_0x533e8b-0x0;var _0x27e443=_0x9f9f[_0x533e8b];return _0x27e443;};'use strict';var _=require(_0xf9f9('0x0'));var util=require(_0xf9f9('0x1'));var moment=require('moment');var BPromise=require(_0xf9f9('0x2'));var rs=require(_0xf9f9('0x3'));var fs=require('fs');var Redis=require(_0xf9f9('0x4'));var db=require(_0xf9f9('0x5'))['db'];var utils=require(_0xf9f9('0x6'));var logger=require(_0xf9f9('0x7'))(_0xf9f9('0x8'));var config=require(_0xf9f9('0x9'));var jayson=require(_0xf9f9('0xa'));var client=jayson['client'][_0xf9f9('0xb')]({'port':0x232a});config[_0xf9f9('0xc')]=_['defaults'](config[_0xf9f9('0xc')],{'host':_0xf9f9('0xd'),'port':0x18eb});var socket=require(_0xf9f9('0xe'))(new Redis(config[_0xf9f9('0xc')]));require('./mailQueue.socket')[_0xf9f9('0xf')](socket);function respondWithRpcPromise(_0x462df1,_0x37bbe8,_0x230ce0){return new BPromise(function(_0x1fb55b,_0x1b390b){return client['request'](_0x462df1,_0x230ce0)[_0xf9f9('0x10')](function(_0x4cd22a){logger[_0xf9f9('0x11')](_0xf9f9('0x12'),_0x37bbe8,_0xf9f9('0x13'));logger['debug'](_0xf9f9('0x14'),_0x37bbe8,'request\x20sent',JSON[_0xf9f9('0x15')](_0x4cd22a));if(_0x4cd22a['error']){if(_0x4cd22a[_0xf9f9('0x16')][_0xf9f9('0x17')]===0x1f4){logger[_0xf9f9('0x16')](_0xf9f9('0x12'),_0x37bbe8,_0x4cd22a[_0xf9f9('0x16')]['message']);return _0x1b390b(_0x4cd22a['error'][_0xf9f9('0x18')]);}logger[_0xf9f9('0x16')](_0xf9f9('0x12'),_0x37bbe8,_0x4cd22a[_0xf9f9('0x16')][_0xf9f9('0x18')]);return _0x1fb55b(_0x4cd22a['error']['message']);}else{logger[_0xf9f9('0x11')](_0xf9f9('0x12'),_0x37bbe8,_0xf9f9('0x13'));_0x1fb55b(_0x4cd22a[_0xf9f9('0x19')][_0xf9f9('0x18')]);}})[_0xf9f9('0x1a')](function(_0x20484f){logger[_0xf9f9('0x16')](_0xf9f9('0x12'),_0x37bbe8,_0x20484f);_0x1b390b(_0x20484f);});});}exports['GetMailQueue']=function(_0x446184){var _0x5e6737=this;return new Promise(function(_0x52c65c,_0xdfbaae){return db[_0xf9f9('0x1b')][_0xf9f9('0x1c')]({'raw':_0x446184[_0xf9f9('0x1d')]?_0x446184['options']['raw']===undefined?!![]:![]:!![],'where':_0x446184[_0xf9f9('0x1d')]?_0x446184[_0xf9f9('0x1d')][_0xf9f9('0x1e')]||null:null,'attributes':_0x446184[_0xf9f9('0x1d')]?_0x446184[_0xf9f9('0x1d')][_0xf9f9('0x1f')]||null:null,'limit':_0x446184[_0xf9f9('0x1d')]?_0x446184['options'][_0xf9f9('0x20')]||null:null,'include':_0x446184[_0xf9f9('0x1d')]?_0x446184[_0xf9f9('0x1d')][_0xf9f9('0x21')]?_[_0xf9f9('0x22')](_0x446184[_0xf9f9('0x1d')][_0xf9f9('0x21')],function(_0x2042c5){return{'model':db[_0x2042c5[_0xf9f9('0x23')]],'as':_0x2042c5['as'],'attributes':_0x2042c5[_0xf9f9('0x1f')],'include':_0x2042c5[_0xf9f9('0x21')]?_[_0xf9f9('0x22')](_0x2042c5['include'],function(_0x5d31b1){return{'model':db[_0x5d31b1[_0xf9f9('0x23')]],'as':_0x5d31b1['as'],'attributes':_0x5d31b1['attributes'],'include':_0x5d31b1[_0xf9f9('0x21')]?_[_0xf9f9('0x22')](_0x5d31b1['include'],function(_0x4cb85f){return{'model':db[_0x4cb85f[_0xf9f9('0x23')]],'as':_0x4cb85f['as'],'attributes':_0x4cb85f[_0xf9f9('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e9fcb){logger[_0xf9f9('0x11')](_0xf9f9('0x24'),_0x446184);logger['debug'](_0xf9f9('0x24'),_0x446184,JSON[_0xf9f9('0x15')](_0x4e9fcb));_0x52c65c(_0x4e9fcb);})[_0xf9f9('0x1a')](function(_0x309f9a){logger[_0xf9f9('0x16')](_0xf9f9('0x24'),_0x309f9a[_0xf9f9('0x18')],_0x446184);_0xdfbaae(_0x5e6737[_0xf9f9('0x16')](0x1f4,_0x309f9a[_0xf9f9('0x18')]));});});};exports['ShowMailQueue']=function(_0x152ef1){var _0xe67f0=this;return new Promise(function(_0x24cf6b,_0x568a63){return db[_0xf9f9('0x1b')]['find']({'raw':_0x152ef1[_0xf9f9('0x1d')]?_0x152ef1[_0xf9f9('0x1d')][_0xf9f9('0x25')]===undefined?!![]:![]:!![],'where':_0x152ef1['options']?_0x152ef1['options']['where']||null:null,'attributes':_0x152ef1[_0xf9f9('0x1d')]?_0x152ef1[_0xf9f9('0x1d')][_0xf9f9('0x1f')]||null:null,'include':_0x152ef1[_0xf9f9('0x1d')]?_0x152ef1[_0xf9f9('0x1d')][_0xf9f9('0x21')]?_[_0xf9f9('0x22')](_0x152ef1[_0xf9f9('0x1d')]['include'],function(_0x694ce7){return{'model':db[_0x694ce7['model']],'as':_0x694ce7['as'],'attributes':_0x694ce7[_0xf9f9('0x1f')],'include':_0x694ce7[_0xf9f9('0x21')]?_['map'](_0x694ce7['include'],function(_0x236cb6){return{'model':db[_0x236cb6[_0xf9f9('0x23')]],'as':_0x236cb6['as'],'attributes':_0x236cb6[_0xf9f9('0x1f')],'include':_0x236cb6[_0xf9f9('0x21')]?_[_0xf9f9('0x22')](_0x236cb6[_0xf9f9('0x21')],function(_0x21c8b4){return{'model':db[_0x21c8b4['model']],'as':_0x21c8b4['as'],'attributes':_0x21c8b4[_0xf9f9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf9f9('0x10')](function(_0x4925fd){logger[_0xf9f9('0x11')](_0xf9f9('0x26'),_0x152ef1);logger[_0xf9f9('0x27')]('ShowMailQueue',_0x152ef1,JSON[_0xf9f9('0x15')](_0x4925fd));_0x24cf6b(_0x4925fd);})[_0xf9f9('0x1a')](function(_0x573bcd){logger['error'](_0xf9f9('0x26'),_0x573bcd[_0xf9f9('0x18')],_0x152ef1);_0x568a63(_0xe67f0[_0xf9f9('0x16')](0x1f4,_0x573bcd[_0xf9f9('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 264c7da..6e1520e 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 _0x233e=['mailQueue:','save','remove','emit','removeListener','register','length'];(function(_0xb26c7a,_0x202458){var _0x539326=function(_0x5b9f10){while(--_0x5b9f10){_0xb26c7a['push'](_0xb26c7a['shift']());}};_0x539326(++_0x202458);}(_0x233e,0x1dd));var _0xe233=function(_0x2a52e2,_0x1e462d){_0x2a52e2=_0x2a52e2-0x0;var _0x4c4427=_0x233e[_0x2a52e2];return _0x4c4427;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xe233('0x0'),_0xe233('0x1'),'update'];function createListener(_0x1e0047,_0x5d9607){return function(_0x5b3b86){_0x5d9607[_0xe233('0x2')](_0x1e0047,_0x5b3b86);};}function removeListener(_0xdc4374,_0x25b6bd){return function(){MailQueueEvents[_0xe233('0x3')](_0xdc4374,_0x25b6bd);};}exports[_0xe233('0x4')]=function(_0x488c8f){for(var _0x4e0c5b=0x0,_0x74df9a=events[_0xe233('0x5')];_0x4e0c5b<_0x74df9a;_0x4e0c5b++){var _0x3725b1=events[_0x4e0c5b];var _0x2da6ad=createListener(_0xe233('0x6')+_0x3725b1,_0x488c8f);MailQueueEvents['on'](_0x3725b1,_0x2da6ad);}}; \ No newline at end of file +var _0x3a5c=['register','length','mailQueue:','./mailQueue.events','emit'];(function(_0x57709e,_0x443595){var _0x131292=function(_0xf90d9f){while(--_0xf90d9f){_0x57709e['push'](_0x57709e['shift']());}};_0x131292(++_0x443595);}(_0x3a5c,0x166));var _0xc3a5=function(_0x51aea3,_0x5af6dd){_0x51aea3=_0x51aea3-0x0;var _0xe3311e=_0x3a5c[_0x51aea3];return _0xe3311e;};'use strict';var MailQueueEvents=require(_0xc3a5('0x0'));var events=['save','remove','update'];function createListener(_0x36a7df,_0x39368d){return function(_0x3bbf81){_0x39368d[_0xc3a5('0x1')](_0x36a7df,_0x3bbf81);};}function removeListener(_0x4c6b44,_0x154e5c){return function(){MailQueueEvents['removeListener'](_0x4c6b44,_0x154e5c);};}exports[_0xc3a5('0x2')]=function(_0x385583){for(var _0x54f768=0x0,_0x1433ac=events[_0xc3a5('0x3')];_0x54f768<_0x1433ac;_0x54f768++){var _0x5b68de=events[_0x54f768];var _0x5db178=createListener(_0xc3a5('0x4')+_0x5b68de,_0x385583);MailQueueEvents['on'](_0x5b68de,_0x5db178);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 451a9d3..89d9f49 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 _0x3acf=['create','put','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','isAuthenticated','show'];(function(_0x5a9666,_0x30bc94){var _0x28601f=function(_0x52e447){while(--_0x52e447){_0x5a9666['push'](_0x5a9666['shift']());}};_0x28601f(++_0x30bc94);}(_0x3acf,0x197));var _0xf3ac=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0x3acf[_0x2f54b6];return _0x169f21;};'use strict';var multer=require(_0xf3ac('0x0'));var util=require(_0xf3ac('0x1'));var path=require(_0xf3ac('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf3ac('0x3')]();var fs_extra=require(_0xf3ac('0x4'));var auth=require(_0xf3ac('0x5'));var interaction=require(_0xf3ac('0x6'));var config=require(_0xf3ac('0x7'));var controller=require(_0xf3ac('0x8'));router[_0xf3ac('0x9')]('/',auth['isAuthenticated'](),controller[_0xf3ac('0xa')]);router[_0xf3ac('0x9')]('/describe',auth[_0xf3ac('0xb')](),controller['describe']);router[_0xf3ac('0x9')]('/:id',auth[_0xf3ac('0xb')](),controller[_0xf3ac('0xc')]);router['post']('/',auth[_0xf3ac('0xb')](),controller[_0xf3ac('0xd')]);router[_0xf3ac('0xe')]('/:id',auth[_0xf3ac('0xb')](),controller[_0xf3ac('0xf')]);router[_0xf3ac('0x10')](_0xf3ac('0x11'),auth[_0xf3ac('0xb')](),controller[_0xf3ac('0x12')]);module[_0xf3ac('0x13')]=router; \ No newline at end of file +var _0x547b=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','update','destroy','exports'];(function(_0x3e67cf,_0x17d9f8){var _0x274bcf=function(_0x35ea4b){while(--_0x35ea4b){_0x3e67cf['push'](_0x3e67cf['shift']());}};_0x274bcf(++_0x17d9f8);}(_0x547b,0x72));var _0xb547=function(_0x3994b2,_0xfa48c0){_0x3994b2=_0x3994b2-0x0;var _0x476266=_0x547b[_0x3994b2];return _0x476266;};'use strict';var multer=require('multer');var util=require(_0xb547('0x0'));var path=require(_0xb547('0x1'));var timeout=require('connect-timeout');var express=require(_0xb547('0x2'));var router=express[_0xb547('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb547('0x4'));var interaction=require(_0xb547('0x5'));var config=require(_0xb547('0x6'));var controller=require(_0xb547('0x7'));router['get']('/',auth[_0xb547('0x8')](),controller[_0xb547('0x9')]);router[_0xb547('0xa')](_0xb547('0xb'),auth[_0xb547('0x8')](),controller['describe']);router['get'](_0xb547('0xc'),auth[_0xb547('0x8')](),controller[_0xb547('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb547('0xe')]);router[_0xb547('0xf')](_0xb547('0xc'),auth[_0xb547('0x8')](),controller[_0xb547('0x10')]);router['delete'](_0xb547('0xc'),auth['isAuthenticated'](),controller[_0xb547('0x11')]);module[_0xb547('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 89022d9..45975a1 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 _0xd710=['moment','sequelize','exports','DATE'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xd710,0x12c));var _0x0d71=function(_0x2d03df,_0x53dcc8){_0x2d03df=_0x2d03df-0x0;var _0x2eacc1=_0xd710[_0x2d03df];return _0x2eacc1;};'use strict';var moment=require(_0x0d71('0x0'));var Sequelize=require(_0x0d71('0x1'));module[_0x0d71('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0d71('0x3')]},'acceptAt':{'type':Sequelize[_0x0d71('0x3')]},'exitAt':{'type':Sequelize[_0x0d71('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x63aa=['STRING','DATE','moment','sequelize','exports'];(function(_0x43b5a7,_0xf5e3d6){var _0x5461fe=function(_0x5d9d5a){while(--_0x5d9d5a){_0x43b5a7['push'](_0x43b5a7['shift']());}};_0x5461fe(++_0xf5e3d6);}(_0x63aa,0x98));var _0xa63a=function(_0x81df6,_0x3a220f){_0x81df6=_0x81df6-0x0;var _0x1262ef=_0x63aa[_0x81df6];return _0x1262ef;};'use strict';var moment=require(_0xa63a('0x0'));var Sequelize=require(_0xa63a('0x1'));module[_0xa63a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa63a('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa63a('0x4')]},'acceptAt':{'type':Sequelize[_0xa63a('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa63a('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index aca0899..73b6852 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 _0x1a85=['describe','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy'];(function(_0x24bc28,_0x237aa0){var _0x4fd2b3=function(_0x557e21){while(--_0x557e21){_0x24bc28['push'](_0x24bc28['shift']());}};_0x4fd2b3(++_0x237aa0);}(_0x1a85,0x178));var _0x51a8=function(_0x12954a,_0x304691){_0x12954a=_0x12954a-0x0;var _0x5ccde2=_0x1a85[_0x12954a];return _0x5ccde2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':!![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['MailQueueReport'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));};exports['describe']=function(_0x21c4da,_0xc89617){return db[_0x51a8('0x2a')][_0x51a8('0x4a')]()[_0x51a8('0x23')](respondWithResult(_0xc89617,null))[_0x51a8('0x41')](handleError(_0xc89617,null));}; \ No newline at end of file +var _0x25e7=['params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','MailQueueReport','findAll','rows','catch','show','fields','create','body','update','find'];(function(_0x319ff8,_0x45ca90){var _0x11d674=function(_0x2e8194){while(--_0x2e8194){_0x319ff8['push'](_0x319ff8['shift']());}};_0x11d674(++_0x45ca90);}(_0x25e7,0x1d6));var _0x725e=function(_0x54e335,_0x6b782d){_0x54e335=_0x54e335-0x0;var _0x5be44a=_0x25e7[_0x54e335];return _0x5be44a;};'use strict';var emlformat=require(_0x725e('0x0'));var rimraf=require(_0x725e('0x1'));var zipdir=require(_0x725e('0x2'));var jsonpatch=require(_0x725e('0x3'));var rp=require(_0x725e('0x4'));var moment=require(_0x725e('0x5'));var BPromise=require(_0x725e('0x6'));var Mustache=require(_0x725e('0x7'));var util=require(_0x725e('0x8'));var path=require(_0x725e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x725e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x725e('0xb'));var crypto=require(_0x725e('0xc'));var jsforce=require(_0x725e('0xd'));var deskjs=require(_0x725e('0xe'));var toCsv=require(_0x725e('0xf'));var querystring=require(_0x725e('0x10'));var Papa=require(_0x725e('0x11'));var Redis=require(_0x725e('0x12'));var authService=require(_0x725e('0x13'));var qs=require(_0x725e('0x14'));var as=require(_0x725e('0x15'));var hardwareService=require(_0x725e('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x725e('0x17'));var config=require(_0x725e('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11916d,_0x14218e){_0x14218e=_0x14218e||0xcc;return function(_0x5c5e44){if(_0x5c5e44){return _0x11916d[_0x725e('0x19')](_0x14218e);}return _0x11916d[_0x725e('0x1a')](_0x14218e)[_0x725e('0x1b')]();};}function respondWithResult(_0x4e0515,_0x3f8052){_0x3f8052=_0x3f8052||0xc8;return function(_0x221e02){if(_0x221e02){return _0x4e0515[_0x725e('0x1a')](_0x3f8052)[_0x725e('0x1c')](_0x221e02);}};}function respondWithFilteredResult(_0x24c3c1,_0x13fbfe){return function(_0x523422){if(_0x523422){var _0x156b99=typeof _0x13fbfe[_0x725e('0x1d')]===_0x725e('0x1e')&&typeof _0x13fbfe['limit']===_0x725e('0x1e');var _0x125fef=_0x523422[_0x725e('0x1f')];var _0x397e33=_0x156b99?0x0:_0x13fbfe[_0x725e('0x1d')];var _0x2811e7=_0x156b99?_0x523422['count']:_0x13fbfe[_0x725e('0x1d')]+_0x13fbfe[_0x725e('0x20')];var _0x1b8879;if(_0x2811e7>=_0x125fef){_0x2811e7=_0x125fef;_0x1b8879=0xc8;}else{_0x1b8879=0xce;}_0x24c3c1[_0x725e('0x1a')](_0x1b8879);return _0x24c3c1[_0x725e('0x21')](_0x725e('0x22'),_0x397e33+'-'+_0x2811e7+'/'+_0x125fef)['json'](_0x523422);}return null;};}function patchUpdates(_0x2fc416){return function(_0xd30de9){try{jsonpatch[_0x725e('0x23')](_0xd30de9,_0x2fc416,!![]);}catch(_0x40c21b){return BPromise[_0x725e('0x24')](_0x40c21b);}return _0xd30de9[_0x725e('0x25')]();};}function saveUpdates(_0x127c99,_0x262b01){return function(_0x7d0792){if(_0x7d0792){return _0x7d0792['update'](_0x127c99)[_0x725e('0x26')](function(_0x36cbab){return _0x36cbab;});}return null;};}function removeEntity(_0x389668,_0x3facae){return function(_0x5a8191){if(_0x5a8191){return _0x5a8191[_0x725e('0x27')]()['then'](function(){_0x389668['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aad7b,_0x1cbaae){return function(_0x2d3c55){if(!_0x2d3c55){_0x2aad7b['sendStatus'](0x194);}return _0x2d3c55;};}function handleError(_0xab6cfd,_0x8a138f){_0x8a138f=_0x8a138f||0x1f4;return function(_0x5a5bef){logger[_0x725e('0x28')](_0x5a5bef[_0x725e('0x29')]);if(_0x5a5bef['name']){delete _0x5a5bef[_0x725e('0x2a')];}_0xab6cfd['status'](_0x8a138f)['send'](_0x5a5bef);};}exports[_0x725e('0x2b')]=function(_0x5b8dec,_0x3b42bd){var _0x4cc4ad={},_0x4de2e0={},_0x9b5b7f={'count':0x0,'rows':[]};var _0x31a8ff=_[_0x725e('0x2c')](db['MailQueueReport'][_0x725e('0x2d')],function(_0x5b03d9){return{'name':_0x5b03d9[_0x725e('0x2e')],'type':_0x5b03d9[_0x725e('0x2f')][_0x725e('0x30')]};});_0x4de2e0[_0x725e('0x31')]=_[_0x725e('0x2c')](_0x31a8ff,_0x725e('0x2a'));_0x4de2e0[_0x725e('0x32')]=_[_0x725e('0x33')](_0x5b8dec[_0x725e('0x32')]);_0x4de2e0[_0x725e('0x34')]=_[_0x725e('0x35')](_0x4de2e0['model'],_0x4de2e0[_0x725e('0x32')]);_0x4cc4ad[_0x725e('0x36')]=_['intersection'](_0x4de2e0[_0x725e('0x31')],qs['fields'](_0x5b8dec[_0x725e('0x32')]['fields']));_0x4cc4ad[_0x725e('0x36')]=_0x4cc4ad[_0x725e('0x36')][_0x725e('0x37')]?_0x4cc4ad[_0x725e('0x36')]:_0x4de2e0[_0x725e('0x31')];if(!_0x5b8dec[_0x725e('0x32')]['hasOwnProperty']('nolimit')){_0x4cc4ad[_0x725e('0x20')]=qs[_0x725e('0x20')](_0x5b8dec[_0x725e('0x32')]['limit']);_0x4cc4ad[_0x725e('0x1d')]=qs['offset'](_0x5b8dec[_0x725e('0x32')][_0x725e('0x1d')]);}_0x4cc4ad[_0x725e('0x38')]=qs[_0x725e('0x39')](_0x5b8dec['query']['sort']);_0x4cc4ad[_0x725e('0x3a')]=qs[_0x725e('0x34')](_[_0x725e('0x3b')](_0x5b8dec['query'],_0x4de2e0[_0x725e('0x34')]),_0x31a8ff);if(_0x5b8dec[_0x725e('0x32')][_0x725e('0x3c')]){_0x4cc4ad['where']=_[_0x725e('0x3d')](_0x4cc4ad['where'],{'$or':_[_0x725e('0x2c')](_0x31a8ff,function(_0x462dac){if(_0x462dac[_0x725e('0x2f')]!==_0x725e('0x3e')){var _0x46eaa0={};_0x46eaa0[_0x462dac['name']]={'$like':'%'+_0x5b8dec['query'][_0x725e('0x3c')]+'%'};return _0x46eaa0;}})});}_0x4cc4ad=_[_0x725e('0x3d')]({},_0x4cc4ad,_0x5b8dec[_0x725e('0x3f')]);var _0x5dd1d1={'where':_0x4cc4ad[_0x725e('0x3a')]};return db['MailQueueReport'][_0x725e('0x1f')](_0x5dd1d1)[_0x725e('0x26')](function(_0x337e53){_0x9b5b7f[_0x725e('0x1f')]=_0x337e53;if(_0x5b8dec['query'][_0x725e('0x40')]){_0x4cc4ad[_0x725e('0x41')]=[{'all':!![]}];}return db[_0x725e('0x42')][_0x725e('0x43')](_0x4cc4ad);})[_0x725e('0x26')](function(_0x19ed0a){_0x9b5b7f[_0x725e('0x44')]=_0x19ed0a;return _0x9b5b7f;})['then'](respondWithFilteredResult(_0x3b42bd,_0x4cc4ad))[_0x725e('0x45')](handleError(_0x3b42bd,null));};exports[_0x725e('0x46')]=function(_0x58ebe3,_0x2200ad){var _0x3b7a87={'raw':!![],'where':{'id':_0x58ebe3['params']['id']}},_0x5e719e={};_0x5e719e['model']=_['keys'](db[_0x725e('0x42')][_0x725e('0x2d')]);_0x5e719e[_0x725e('0x32')]=_['keys'](_0x58ebe3[_0x725e('0x32')]);_0x5e719e['filters']=_['intersection'](_0x5e719e[_0x725e('0x31')],_0x5e719e[_0x725e('0x32')]);_0x3b7a87[_0x725e('0x36')]=_[_0x725e('0x35')](_0x5e719e[_0x725e('0x31')],qs[_0x725e('0x47')](_0x58ebe3['query'][_0x725e('0x47')]));_0x3b7a87['attributes']=_0x3b7a87[_0x725e('0x36')][_0x725e('0x37')]?_0x3b7a87['attributes']:_0x5e719e[_0x725e('0x31')];if(_0x58ebe3['query'][_0x725e('0x40')]){_0x3b7a87[_0x725e('0x41')]=[{'all':!![]}];}_0x3b7a87=_['merge']({},_0x3b7a87,_0x58ebe3['options']);return db[_0x725e('0x42')]['find'](_0x3b7a87)[_0x725e('0x26')](handleEntityNotFound(_0x2200ad,null))['then'](respondWithResult(_0x2200ad,null))['catch'](handleError(_0x2200ad,null));};exports['create']=function(_0x118ef5,_0x38a81f){return db['MailQueueReport'][_0x725e('0x48')](_0x118ef5[_0x725e('0x49')],{})['then'](respondWithResult(_0x38a81f,0xc9))[_0x725e('0x45')](handleError(_0x38a81f,null));};exports[_0x725e('0x4a')]=function(_0x4d5415,_0x19f524){if(_0x4d5415[_0x725e('0x49')]['id']){delete _0x4d5415[_0x725e('0x49')]['id'];}return db[_0x725e('0x42')][_0x725e('0x4b')]({'where':{'id':_0x4d5415[_0x725e('0x4c')]['id']}})[_0x725e('0x26')](handleEntityNotFound(_0x19f524,null))[_0x725e('0x26')](saveUpdates(_0x4d5415[_0x725e('0x49')],null))[_0x725e('0x26')](respondWithResult(_0x19f524,null))['catch'](handleError(_0x19f524,null));};exports[_0x725e('0x27')]=function(_0x5e3678,_0x11e2f7){return db[_0x725e('0x42')][_0x725e('0x4b')]({'where':{'id':_0x5e3678[_0x725e('0x4c')]['id']}})[_0x725e('0x26')](handleEntityNotFound(_0x11e2f7,null))[_0x725e('0x26')](removeEntity(_0x11e2f7,null))[_0x725e('0x45')](handleError(_0x11e2f7,null));};exports[_0x725e('0x4d')]=function(_0x1f3097,_0xd366b9){return db[_0x725e('0x42')][_0x725e('0x4d')]()[_0x725e('0x26')](respondWithResult(_0xd366b9,null))[_0x725e('0x45')](handleError(_0xd366b9,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index fac7fe3..8d76586 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 _0x2010=['api','moment','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util'];(function(_0x4b526b,_0x2f1317){var _0x57f25d=function(_0xbd39a0){while(--_0xbd39a0){_0x4b526b['push'](_0x4b526b['shift']());}};_0x57f25d(++_0x2f1317);}(_0x2010,0x124));var _0x0201=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2010[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0201('0x0'));var util=require(_0x0201('0x1'));var logger=require('../../config/logger')(_0x0201('0x2'));var moment=require(_0x0201('0x3'));var BPromise=require(_0x0201('0x4'));var rp=require(_0x0201('0x5'));var fs=require('fs');var path=require(_0x0201('0x6'));var rimraf=require(_0x0201('0x7'));var config=require('../../config/environment');var attributes=require(_0x0201('0x8'));module[_0x0201('0x9')]=function(_0x10d62a,_0x29b195){return _0x10d62a[_0x0201('0xa')](_0x0201('0xb'),attributes,{'tableName':_0x0201('0xc'),'paranoid':![],'indexes':[{'name':_0x0201('0xd'),'fields':[_0x0201('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9bc=['../../config/logger','request-promise','path','rimraf','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0x30530a,_0x6bd645){var _0x2d01b1=function(_0x810b3a){while(--_0x810b3a){_0x30530a['push'](_0x30530a['shift']());}};_0x2d01b1(++_0x6bd645);}(_0xd9bc,0x1a3));var _0xcd9b=function(_0x15d059,_0x11b426){_0x15d059=_0x15d059-0x0;var _0x27e06b=_0xd9bc[_0x15d059];return _0x27e06b;};'use strict';var _=require(_0xcd9b('0x0'));var util=require('util');var logger=require(_0xcd9b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcd9b('0x2'));var fs=require('fs');var path=require(_0xcd9b('0x3'));var rimraf=require(_0xcd9b('0x4'));var config=require('../../config/environment');var attributes=require(_0xcd9b('0x5'));module[_0xcd9b('0x6')]=function(_0x458fc4,_0x1e92d1){return _0x458fc4['define'](_0xcd9b('0x7'),attributes,{'tableName':_0xcd9b('0x8'),'paranoid':![],'indexes':[{'name':_0xcd9b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 7f21f5c..77a282f 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 _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x3799cd,_0x131494){var _0x3410d3=function(_0x4a742b){while(--_0x4a742b){_0x3799cd['push'](_0x3799cd['shift']());}};_0x3410d3(++_0x131494);}(_0xdb28,0x106));var _0x8db2=function(_0x4b883b,_0xbd7aba){_0x4b883b=_0x4b883b-0x0;var _0x226000=_0xdb28[_0x4b883b];return _0x226000;};'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')]('MailQueueReport,\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);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x53ecdb,_0x16fdaf){var _0x49973e=function(_0xbb0036){while(--_0xbb0036){_0x53ecdb['push'](_0x53ecdb['shift']());}};_0x49973e(++_0x16fdaf);}(_0x7a54,0x106));var _0x47a5=function(_0x46bf5e,_0x1f922d){_0x46bf5e=_0x46bf5e-0x0;var _0x89a4bb=_0x7a54[_0x46bf5e];return _0x89a4bb;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index cd4b17b..f404909 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x49e532,_0x5c0cf7){var _0x2a3823=function(_0x5e0420){while(--_0x5e0420){_0x49e532['push'](_0x49e532['shift']());}};_0x2a3823(++_0x5c0cf7);}(_0xe706,0xa3));var _0x6e70=function(_0x53758c,_0x5664af){_0x53758c=_0x53758c-0x0;var _0x425eff=_0xe706[_0x53758c];return _0x425eff;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x16a049,_0x362cd0){var _0x4181cd=function(_0x3cf731){while(--_0x3cf731){_0x16a049['push'](_0x16a049['shift']());}};_0x4181cd(++_0x362cd0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0xcb91[_0x22ffbf];return _0x360c17;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index c0bf4c4..89009a0 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 _0xfe57=['STRING','INTEGER','INBOX','sequelize','exports','BOOLEAN'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xfe57,0x195));var _0x7fe5=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0xfe57[_0x3a8db5];return _0x2c03cd;};'use strict';var Sequelize=require(_0x7fe5('0x0'));module[_0x7fe5('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x7fe5('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x7fe5('0x3')]},'password':{'type':Sequelize[_0x7fe5('0x3')]},'port':{'type':Sequelize[_0x7fe5('0x4')]},'tls':{'type':Sequelize[_0x7fe5('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7fe5('0x3')],'defaultValue':_0x7fe5('0x5')},'connTimeout':{'type':Sequelize[_0x7fe5('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7fe5('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7fe5('0x3')]}}; \ No newline at end of file +var _0x6c76=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3b941e,_0x20df78){var _0x44c514=function(_0x89072){while(--_0x89072){_0x3b941e['push'](_0x3b941e['shift']());}};_0x44c514(++_0x20df78);}(_0x6c76,0x184));var _0x66c7=function(_0x70a833,_0x27fc77){_0x70a833=_0x70a833-0x0;var _0xf93c5d=_0x6c76[_0x70a833];return _0xf93c5d;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'description':{'type':Sequelize[_0x66c7('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x66c7('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x66c7('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x66c7('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x66c7('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index caa15d3..79df01e 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 _0x8f2c=['request-promise','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','api','bluebird'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x8f2c,0x6a));var _0xc8f2=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x8f2c[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xc8f2('0x0'));var util=require('util');var logger=require(_0xc8f2('0x1'))(_0xc8f2('0x2'));var moment=require('moment');var BPromise=require(_0xc8f2('0x3'));var rp=require(_0xc8f2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc8f2('0x5'));var attributes=require(_0xc8f2('0x6'));module[_0xc8f2('0x7')]=function(_0x222a2e,_0x4f5d98){return _0x222a2e[_0xc8f2('0x8')](_0xc8f2('0x9'),attributes,{'tableName':_0xc8f2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f18=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','util'];(function(_0x2c1812,_0x469234){var _0x22ed7d=function(_0x2f8a2d){while(--_0x2f8a2d){_0x2c1812['push'](_0x2c1812['shift']());}};_0x22ed7d(++_0x469234);}(_0x9f18,0x150));var _0x89f1=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x9f18[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0x89f1('0x0'));var util=require(_0x89f1('0x1'));var logger=require('../../config/logger')(_0x89f1('0x2'));var moment=require(_0x89f1('0x3'));var BPromise=require(_0x89f1('0x4'));var rp=require(_0x89f1('0x5'));var fs=require('fs');var path=require(_0x89f1('0x6'));var rimraf=require(_0x89f1('0x7'));var config=require(_0x89f1('0x8'));var attributes=require(_0x89f1('0x9'));module['exports']=function(_0x2ff677,_0x39f6b5){return _0x2ff677[_0x89f1('0xa')](_0x89f1('0xb'),attributes,{'tableName':_0x89f1('0xc'),'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 eb2d718..ddc3e73 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 _0x2d5e=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','include','map','model','catch','lodash','bluebird','ioredis'];(function(_0x347c61,_0x5c038e){var _0x3c5237=function(_0x514ddc){while(--_0x514ddc){_0x347c61['push'](_0x347c61['shift']());}};_0x3c5237(++_0x5c038e);}(_0x2d5e,0x19d));var _0xe2d5=function(_0xab760,_0xd2bc5b){_0xab760=_0xab760-0x0;var _0x54168f=_0x2d5e[_0xab760];return _0x54168f;};'use strict';var _=require(_0xe2d5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe2d5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2d5('0x2'));var db=require(_0xe2d5('0x3'))['db'];var utils=require(_0xe2d5('0x4'));var logger=require('../../config/logger')(_0xe2d5('0x5'));var config=require(_0xe2d5('0x6'));var jayson=require(_0xe2d5('0x7'));var client=jayson[_0xe2d5('0x8')][_0xe2d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21f74d,_0x411c77,_0x512f16){return new BPromise(function(_0x548942,_0x2ce53b){return client['request'](_0x21f74d,_0x512f16)[_0xe2d5('0xa')](function(_0x2a0cf1){logger[_0xe2d5('0xb')](_0xe2d5('0xc'),_0x411c77,'request\x20sent');logger[_0xe2d5('0xd')](_0xe2d5('0xe'),_0x411c77,'request\x20sent',JSON[_0xe2d5('0xf')](_0x2a0cf1));if(_0x2a0cf1[_0xe2d5('0x10')]){if(_0x2a0cf1['error'][_0xe2d5('0x11')]===0x1f4){logger[_0xe2d5('0x10')](_0xe2d5('0xc'),_0x411c77,_0x2a0cf1[_0xe2d5('0x10')]['message']);return _0x2ce53b(_0x2a0cf1[_0xe2d5('0x10')][_0xe2d5('0x12')]);}logger[_0xe2d5('0x10')](_0xe2d5('0xc'),_0x411c77,_0x2a0cf1[_0xe2d5('0x10')][_0xe2d5('0x12')]);return _0x548942(_0x2a0cf1[_0xe2d5('0x10')][_0xe2d5('0x12')]);}else{logger[_0xe2d5('0xb')]('MailServerIn,\x20%s,\x20%s',_0x411c77,_0xe2d5('0x13'));_0x548942(_0x2a0cf1[_0xe2d5('0x14')]['message']);}})['catch'](function(_0x5d70d3){logger['error'](_0xe2d5('0xc'),_0x411c77,_0x5d70d3);_0x2ce53b(_0x5d70d3);});});}exports[_0xe2d5('0x15')]=function(_0x2050e3){var _0x280213=this;return new Promise(function(_0x309131,_0x2b61f2){return db[_0xe2d5('0x16')]['findAll']({'raw':_0x2050e3['options']?_0x2050e3[_0xe2d5('0x17')][_0xe2d5('0x18')]===undefined?!![]:![]:!![],'where':_0x2050e3[_0xe2d5('0x17')]?_0x2050e3[_0xe2d5('0x17')][_0xe2d5('0x19')]||null:null,'attributes':_0x2050e3[_0xe2d5('0x17')]?_0x2050e3[_0xe2d5('0x17')][_0xe2d5('0x1a')]||null:null,'limit':_0x2050e3[_0xe2d5('0x17')]?_0x2050e3[_0xe2d5('0x17')][_0xe2d5('0x1b')]||null:null,'include':_0x2050e3[_0xe2d5('0x17')]?_0x2050e3['options'][_0xe2d5('0x1c')]?_[_0xe2d5('0x1d')](_0x2050e3['options']['include'],function(_0x296c4b){return{'model':db[_0x296c4b[_0xe2d5('0x1e')]],'as':_0x296c4b['as'],'attributes':_0x296c4b[_0xe2d5('0x1a')],'include':_0x296c4b[_0xe2d5('0x1c')]?_['map'](_0x296c4b[_0xe2d5('0x1c')],function(_0x4d2c1d){return{'model':db[_0x4d2c1d[_0xe2d5('0x1e')]],'as':_0x4d2c1d['as'],'attributes':_0x4d2c1d[_0xe2d5('0x1a')],'include':_0x4d2c1d[_0xe2d5('0x1c')]?_[_0xe2d5('0x1d')](_0x4d2c1d[_0xe2d5('0x1c')],function(_0x361ab9){return{'model':db[_0x361ab9[_0xe2d5('0x1e')]],'as':_0x361ab9['as'],'attributes':_0x361ab9[_0xe2d5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe2d5('0xa')](function(_0x394967){logger[_0xe2d5('0xb')]('GetMailServerIn',_0x2050e3);logger[_0xe2d5('0xd')](_0xe2d5('0x15'),_0x2050e3,JSON[_0xe2d5('0xf')](_0x394967));_0x309131(_0x394967);})[_0xe2d5('0x1f')](function(_0x5f13ca){logger[_0xe2d5('0x10')](_0xe2d5('0x15'),_0x5f13ca['message'],_0x2050e3);_0x2b61f2(_0x280213['error'](0x1f4,_0x5f13ca[_0xe2d5('0x12')]));});});}; \ No newline at end of file +var _0x5374=['error','code','message','result','MailServerIn','findAll','options','raw','where','limit','include','map','model','attributes','GetMailServerIn','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4ad133,_0x26fa00){var _0x2274e2=function(_0x58e822){while(--_0x58e822){_0x4ad133['push'](_0x4ad133['shift']());}};_0x2274e2(++_0x26fa00);}(_0x5374,0xd6));var _0x4537=function(_0x36a4aa,_0x129f4a){_0x36a4aa=_0x36a4aa-0x0;var _0x2743e9=_0x5374[_0x36a4aa];return _0x2743e9;};'use strict';var _=require('lodash');var util=require(_0x4537('0x0'));var moment=require(_0x4537('0x1'));var BPromise=require('bluebird');var rs=require(_0x4537('0x2'));var fs=require('fs');var Redis=require(_0x4537('0x3'));var db=require(_0x4537('0x4'))['db'];var utils=require(_0x4537('0x5'));var logger=require(_0x4537('0x6'))(_0x4537('0x7'));var config=require(_0x4537('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4537('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1b60,_0x295733,_0x38cac9){return new BPromise(function(_0x2e3b78,_0xcbc786){return client[_0x4537('0xa')](_0x3a1b60,_0x38cac9)[_0x4537('0xb')](function(_0x2354a4){logger[_0x4537('0xc')](_0x4537('0xd'),_0x295733,'request\x20sent');logger[_0x4537('0xe')](_0x4537('0xf'),_0x295733,_0x4537('0x10'),JSON['stringify'](_0x2354a4));if(_0x2354a4[_0x4537('0x11')]){if(_0x2354a4[_0x4537('0x11')][_0x4537('0x12')]===0x1f4){logger[_0x4537('0x11')](_0x4537('0xd'),_0x295733,_0x2354a4[_0x4537('0x11')][_0x4537('0x13')]);return _0xcbc786(_0x2354a4['error'][_0x4537('0x13')]);}logger[_0x4537('0x11')](_0x4537('0xd'),_0x295733,_0x2354a4[_0x4537('0x11')]['message']);return _0x2e3b78(_0x2354a4[_0x4537('0x11')][_0x4537('0x13')]);}else{logger[_0x4537('0xc')](_0x4537('0xd'),_0x295733,_0x4537('0x10'));_0x2e3b78(_0x2354a4[_0x4537('0x14')][_0x4537('0x13')]);}})['catch'](function(_0xb65c62){logger[_0x4537('0x11')](_0x4537('0xd'),_0x295733,_0xb65c62);_0xcbc786(_0xb65c62);});});}exports['GetMailServerIn']=function(_0x5724a4){var _0x1a5363=this;return new Promise(function(_0x4a9bb0,_0x444001){return db[_0x4537('0x15')][_0x4537('0x16')]({'raw':_0x5724a4[_0x4537('0x17')]?_0x5724a4['options'][_0x4537('0x18')]===undefined?!![]:![]:!![],'where':_0x5724a4['options']?_0x5724a4[_0x4537('0x17')][_0x4537('0x19')]||null:null,'attributes':_0x5724a4[_0x4537('0x17')]?_0x5724a4['options']['attributes']||null:null,'limit':_0x5724a4[_0x4537('0x17')]?_0x5724a4[_0x4537('0x17')][_0x4537('0x1a')]||null:null,'include':_0x5724a4['options']?_0x5724a4['options'][_0x4537('0x1b')]?_[_0x4537('0x1c')](_0x5724a4[_0x4537('0x17')][_0x4537('0x1b')],function(_0x40c7ab){return{'model':db[_0x40c7ab[_0x4537('0x1d')]],'as':_0x40c7ab['as'],'attributes':_0x40c7ab[_0x4537('0x1e')],'include':_0x40c7ab[_0x4537('0x1b')]?_[_0x4537('0x1c')](_0x40c7ab[_0x4537('0x1b')],function(_0x21b70d){return{'model':db[_0x21b70d[_0x4537('0x1d')]],'as':_0x21b70d['as'],'attributes':_0x21b70d['attributes'],'include':_0x21b70d['include']?_[_0x4537('0x1c')](_0x21b70d['include'],function(_0x1ca0d6){return{'model':db[_0x1ca0d6[_0x4537('0x1d')]],'as':_0x1ca0d6['as'],'attributes':_0x1ca0d6[_0x4537('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x550338){logger['info'](_0x4537('0x1f'),_0x5724a4);logger[_0x4537('0xe')](_0x4537('0x1f'),_0x5724a4,JSON['stringify'](_0x550338));_0x4a9bb0(_0x550338);})[_0x4537('0x20')](function(_0x42fe40){logger[_0x4537('0x11')](_0x4537('0x1f'),_0x42fe40['message'],_0x5724a4);_0x444001(_0x1a5363['error'](0x1f4,_0x42fe40[_0x4537('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 325eece..a043e86 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 _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(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_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 +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(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7a54,0x106));var _0x47a5=function(_0x2f03fe,_0xc1a3bc){_0x2f03fe=_0x2f03fe-0x0;var _0x3df498=_0x7a54[_0x2f03fe];return _0x3df498;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 952a5b1..eac802a 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 _0x33d4=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x33d4,0x1a4));var _0x433d=function(_0x3a53f7,_0x316a3b){_0x3a53f7=_0x3a53f7-0x0;var _0x490b9c=_0x33d4[_0x3a53f7];return _0x490b9c;};'use strict';var Sequelize=require('sequelize');module[_0x433d('0x0')]={'description':{'type':Sequelize[_0x433d('0x1')]},'host':{'type':Sequelize[_0x433d('0x1')]},'user':{'type':Sequelize[_0x433d('0x1')]},'pass':{'type':Sequelize[_0x433d('0x1')]},'port':{'type':Sequelize[_0x433d('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x433d('0x1')]},'authentication':{'type':Sequelize[_0x433d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x24c4=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x24c4,0x165));var _0x424c=function(_0x573c4c,_0x48781f){_0x573c4c=_0x573c4c-0x0;var _0x54e20a=_0x24c4[_0x573c4c];return _0x54e20a;};'use strict';var Sequelize=require(_0x424c('0x0'));module['exports']={'description':{'type':Sequelize[_0x424c('0x1')]},'host':{'type':Sequelize[_0x424c('0x1')]},'user':{'type':Sequelize[_0x424c('0x1')]},'pass':{'type':Sequelize[_0x424c('0x1')]},'port':{'type':Sequelize[_0x424c('0x2')]},'secure':{'type':Sequelize[_0x424c('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x424c('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 316d5c8..ee957f5 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 _0xa18f=['options','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','MailServerOut','type','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa18f,0x16f));var _0xfa18=function(_0x348c2a,_0x3fd0b3){_0x348c2a=_0x348c2a-0x0;var _0x5166ac=_0xa18f[_0x348c2a];return _0x5166ac;};'use strict';var emlformat=require(_0xfa18('0x0'));var rimraf=require(_0xfa18('0x1'));var zipdir=require(_0xfa18('0x2'));var jsonpatch=require(_0xfa18('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfa18('0x4'));var path=require(_0xfa18('0x5'));var sox=require(_0xfa18('0x6'));var csv=require(_0xfa18('0x7'));var ejs=require(_0xfa18('0x8'));var fs=require('fs');var fs_extra=require(_0xfa18('0x9'));var _=require(_0xfa18('0xa'));var squel=require(_0xfa18('0xb'));var crypto=require('crypto');var jsforce=require(_0xfa18('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfa18('0x7'));var querystring=require(_0xfa18('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfa18('0xe'));var qs=require(_0xfa18('0xf'));var as=require(_0xfa18('0x10'));var hardwareService=require(_0xfa18('0x11'));var logger=require(_0xfa18('0x12'))(_0xfa18('0x13'));var utils=require('../../config/utils');var config=require(_0xfa18('0x14'));var licenseUtil=require(_0xfa18('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42c7bd,_0x4ea618){_0x4ea618=_0x4ea618||0xcc;return function(_0x480d90){if(_0x480d90){return _0x42c7bd[_0xfa18('0x16')](_0x4ea618);}return _0x42c7bd[_0xfa18('0x17')](_0x4ea618)[_0xfa18('0x18')]();};}function respondWithResult(_0x35fa84,_0x15521a){_0x15521a=_0x15521a||0xc8;return function(_0x2a8ea3){if(_0x2a8ea3){return _0x35fa84['status'](_0x15521a)['json'](_0x2a8ea3);}};}function respondWithFilteredResult(_0x534897,_0x347c81){return function(_0x3f5c03){if(_0x3f5c03){var _0x13d9f8=typeof _0x347c81['offset']===_0xfa18('0x19')&&typeof _0x347c81['limit']===_0xfa18('0x19');var _0x188d87=_0x3f5c03[_0xfa18('0x1a')];var _0x2c7f74=_0x13d9f8?0x0:_0x347c81[_0xfa18('0x1b')];var _0x54ef62=_0x13d9f8?_0x3f5c03[_0xfa18('0x1a')]:_0x347c81[_0xfa18('0x1b')]+_0x347c81[_0xfa18('0x1c')];var _0x4665a8;if(_0x54ef62>=_0x188d87){_0x54ef62=_0x188d87;_0x4665a8=0xc8;}else{_0x4665a8=0xce;}_0x534897[_0xfa18('0x17')](_0x4665a8);return _0x534897[_0xfa18('0x1d')](_0xfa18('0x1e'),_0x2c7f74+'-'+_0x54ef62+'/'+_0x188d87)[_0xfa18('0x1f')](_0x3f5c03);}return null;};}function patchUpdates(_0x511a5c){return function(_0x50e412){try{jsonpatch['apply'](_0x50e412,_0x511a5c,!![]);}catch(_0x1c1b91){return BPromise[_0xfa18('0x20')](_0x1c1b91);}return _0x50e412[_0xfa18('0x21')]();};}function saveUpdates(_0x445130,_0x5c4b78){return function(_0x4b931f){if(_0x4b931f){return _0x4b931f[_0xfa18('0x22')](_0x445130)[_0xfa18('0x23')](function(_0x318d8b){return _0x318d8b;});}return null;};}function removeEntity(_0x460336,_0x4ca214){return function(_0x2a00c5){if(_0x2a00c5){return _0x2a00c5[_0xfa18('0x24')]()[_0xfa18('0x23')](function(){_0x460336[_0xfa18('0x17')](0xcc)[_0xfa18('0x18')]();});}};}function handleEntityNotFound(_0x274882,_0x3ca302){return function(_0xf184c2){if(!_0xf184c2){_0x274882['sendStatus'](0x194);}return _0xf184c2;};}function handleError(_0x59fab4,_0x501c10){_0x501c10=_0x501c10||0x1f4;return function(_0x9b5d30){logger[_0xfa18('0x25')](_0x9b5d30[_0xfa18('0x26')]);if(_0x9b5d30[_0xfa18('0x27')]){delete _0x9b5d30['name'];}_0x59fab4[_0xfa18('0x17')](_0x501c10)['send'](_0x9b5d30);};}exports[_0xfa18('0x28')]=function(_0x2a83c1,_0x46a9c9){var _0x1a0961={},_0x3ebc47={},_0x4a426d={'count':0x0,'rows':[]};var _0x3cf742=_['map'](db[_0xfa18('0x29')]['rawAttributes'],function(_0x163837){return{'name':_0x163837['fieldName'],'type':_0x163837[_0xfa18('0x2a')]['key']};});_0x3ebc47[_0xfa18('0x2b')]=_[_0xfa18('0x2c')](_0x3cf742,'name');_0x3ebc47[_0xfa18('0x2d')]=_[_0xfa18('0x2e')](_0x2a83c1['query']);_0x3ebc47[_0xfa18('0x2f')]=_[_0xfa18('0x30')](_0x3ebc47['model'],_0x3ebc47['query']);_0x1a0961[_0xfa18('0x31')]=_['intersection'](_0x3ebc47[_0xfa18('0x2b')],qs['fields'](_0x2a83c1[_0xfa18('0x2d')][_0xfa18('0x32')]));_0x1a0961[_0xfa18('0x31')]=_0x1a0961[_0xfa18('0x31')]['length']?_0x1a0961[_0xfa18('0x31')]:_0x3ebc47[_0xfa18('0x2b')];if(!_0x2a83c1['query']['hasOwnProperty'](_0xfa18('0x33'))){_0x1a0961['limit']=qs[_0xfa18('0x1c')](_0x2a83c1[_0xfa18('0x2d')]['limit']);_0x1a0961[_0xfa18('0x1b')]=qs['offset'](_0x2a83c1[_0xfa18('0x2d')][_0xfa18('0x1b')]);}_0x1a0961[_0xfa18('0x34')]=qs[_0xfa18('0x35')](_0x2a83c1[_0xfa18('0x2d')]['sort']);_0x1a0961['where']=qs[_0xfa18('0x2f')](_[_0xfa18('0x36')](_0x2a83c1[_0xfa18('0x2d')],_0x3ebc47['filters']),_0x3cf742);if(_0x2a83c1['query'][_0xfa18('0x37')]){_0x1a0961[_0xfa18('0x38')]=_[_0xfa18('0x39')](_0x1a0961[_0xfa18('0x38')],{'$or':_[_0xfa18('0x2c')](_0x3cf742,function(_0x57081c){if(_0x57081c[_0xfa18('0x2a')]!==_0xfa18('0x3a')){var _0x5428b4={};_0x5428b4[_0x57081c[_0xfa18('0x27')]]={'$like':'%'+_0x2a83c1[_0xfa18('0x2d')][_0xfa18('0x37')]+'%'};return _0x5428b4;}})});}_0x1a0961=_[_0xfa18('0x39')]({},_0x1a0961,_0x2a83c1[_0xfa18('0x3b')]);var _0xbc0389={'where':_0x1a0961[_0xfa18('0x38')]};return db['MailServerOut']['count'](_0xbc0389)['then'](function(_0x1eea78){_0x4a426d[_0xfa18('0x1a')]=_0x1eea78;if(_0x2a83c1['query']['includeAll']){_0x1a0961[_0xfa18('0x3c')]=[{'all':!![]}];}return db[_0xfa18('0x29')][_0xfa18('0x3d')](_0x1a0961);})[_0xfa18('0x23')](function(_0x2ceb90){_0x4a426d[_0xfa18('0x3e')]=_0x2ceb90;return _0x4a426d;})[_0xfa18('0x23')](respondWithFilteredResult(_0x46a9c9,_0x1a0961))['catch'](handleError(_0x46a9c9,null));};exports[_0xfa18('0x3f')]=function(_0x162b98,_0x759db1){var _0x563060={'raw':!![],'where':{'id':_0x162b98[_0xfa18('0x40')]['id']}},_0xad57ef={};_0xad57ef['model']=_[_0xfa18('0x2e')](db[_0xfa18('0x29')][_0xfa18('0x41')]);_0xad57ef['query']=_[_0xfa18('0x2e')](_0x162b98['query']);_0xad57ef['filters']=_[_0xfa18('0x30')](_0xad57ef[_0xfa18('0x2b')],_0xad57ef['query']);_0x563060['attributes']=_[_0xfa18('0x30')](_0xad57ef[_0xfa18('0x2b')],qs[_0xfa18('0x32')](_0x162b98[_0xfa18('0x2d')]['fields']));_0x563060[_0xfa18('0x31')]=_0x563060[_0xfa18('0x31')][_0xfa18('0x42')]?_0x563060[_0xfa18('0x31')]:_0xad57ef[_0xfa18('0x2b')];if(_0x162b98[_0xfa18('0x2d')][_0xfa18('0x43')]){_0x563060[_0xfa18('0x3c')]=[{'all':!![]}];}_0x563060=_[_0xfa18('0x39')]({},_0x563060,_0x162b98['options']);return db[_0xfa18('0x29')][_0xfa18('0x44')](_0x563060)[_0xfa18('0x23')](handleEntityNotFound(_0x759db1,null))[_0xfa18('0x23')](respondWithResult(_0x759db1,null))[_0xfa18('0x45')](handleError(_0x759db1,null));};exports['create']=function(_0x189eb9,_0x209b77){return db[_0xfa18('0x29')]['create'](_0x189eb9[_0xfa18('0x46')],{})[_0xfa18('0x23')](respondWithResult(_0x209b77,0xc9))[_0xfa18('0x45')](handleError(_0x209b77,null));};exports['update']=function(_0x4f250f,_0x31998c){if(_0x4f250f['body']['id']){delete _0x4f250f[_0xfa18('0x46')]['id'];}return db[_0xfa18('0x29')][_0xfa18('0x44')]({'where':{'id':_0x4f250f['params']['id']}})[_0xfa18('0x23')](handleEntityNotFound(_0x31998c,null))[_0xfa18('0x23')](saveUpdates(_0x4f250f[_0xfa18('0x46')],null))[_0xfa18('0x23')](respondWithResult(_0x31998c,null))['catch'](handleError(_0x31998c,null));};exports[_0xfa18('0x24')]=function(_0x2a07fe,_0x2d1915){return db[_0xfa18('0x29')]['find']({'where':{'id':_0x2a07fe['params']['id']}})['then'](handleEntityNotFound(_0x2d1915,null))[_0xfa18('0x23')](removeEntity(_0x2d1915,null))[_0xfa18('0x45')](handleError(_0x2d1915,null));}; \ No newline at end of file +var _0xc50a=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','MailServerOut','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','VIRTUAL','filter','options','includeAll','include','rows','catch','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x595604,_0x2cc998){var _0x1466f3=function(_0x4e1d9b){while(--_0x4e1d9b){_0x595604['push'](_0x595604['shift']());}};_0x1466f3(++_0x2cc998);}(_0xc50a,0x86));var _0xac50=function(_0x28f3c6,_0x48c850){_0x28f3c6=_0x28f3c6-0x0;var _0x3a2cbb=_0xc50a[_0x28f3c6];return _0x3a2cbb;};'use strict';var emlformat=require(_0xac50('0x0'));var rimraf=require(_0xac50('0x1'));var zipdir=require(_0xac50('0x2'));var jsonpatch=require(_0xac50('0x3'));var rp=require(_0xac50('0x4'));var moment=require(_0xac50('0x5'));var BPromise=require(_0xac50('0x6'));var Mustache=require('mustache');var util=require(_0xac50('0x7'));var path=require('path');var sox=require(_0xac50('0x8'));var csv=require(_0xac50('0x9'));var ejs=require(_0xac50('0xa'));var fs=require('fs');var fs_extra=require(_0xac50('0xb'));var _=require(_0xac50('0xc'));var squel=require(_0xac50('0xd'));var crypto=require(_0xac50('0xe'));var jsforce=require(_0xac50('0xf'));var deskjs=require(_0xac50('0x10'));var toCsv=require(_0xac50('0x9'));var querystring=require(_0xac50('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xac50('0x12'));var qs=require(_0xac50('0x13'));var as=require(_0xac50('0x14'));var hardwareService=require(_0xac50('0x15'));var logger=require('../../config/logger')(_0xac50('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xac50('0x17'));var db=require(_0xac50('0x18'))['db'];function respondWithStatusCode(_0x21157b,_0x416184){_0x416184=_0x416184||0xcc;return function(_0xcc8789){if(_0xcc8789){return _0x21157b[_0xac50('0x19')](_0x416184);}return _0x21157b[_0xac50('0x1a')](_0x416184)[_0xac50('0x1b')]();};}function respondWithResult(_0x38a1dd,_0x4dbf9b){_0x4dbf9b=_0x4dbf9b||0xc8;return function(_0x38aac6){if(_0x38aac6){return _0x38a1dd[_0xac50('0x1a')](_0x4dbf9b)[_0xac50('0x1c')](_0x38aac6);}};}function respondWithFilteredResult(_0x496c71,_0x46b515){return function(_0x49aa5f){if(_0x49aa5f){var _0x4c4bb6=typeof _0x46b515[_0xac50('0x1d')]===_0xac50('0x1e')&&typeof _0x46b515[_0xac50('0x1f')]===_0xac50('0x1e');var _0x2b2f65=_0x49aa5f[_0xac50('0x20')];var _0x584a1d=_0x4c4bb6?0x0:_0x46b515[_0xac50('0x1d')];var _0x506e09=_0x4c4bb6?_0x49aa5f[_0xac50('0x20')]:_0x46b515[_0xac50('0x1d')]+_0x46b515[_0xac50('0x1f')];var _0x420cc2;if(_0x506e09>=_0x2b2f65){_0x506e09=_0x2b2f65;_0x420cc2=0xc8;}else{_0x420cc2=0xce;}_0x496c71[_0xac50('0x1a')](_0x420cc2);return _0x496c71[_0xac50('0x21')](_0xac50('0x22'),_0x584a1d+'-'+_0x506e09+'/'+_0x2b2f65)['json'](_0x49aa5f);}return null;};}function patchUpdates(_0x2d781f){return function(_0x42a7f6){try{jsonpatch[_0xac50('0x23')](_0x42a7f6,_0x2d781f,!![]);}catch(_0x415aba){return BPromise[_0xac50('0x24')](_0x415aba);}return _0x42a7f6[_0xac50('0x25')]();};}function saveUpdates(_0x5460b9,_0x3b13b2){return function(_0x12fbbd){if(_0x12fbbd){return _0x12fbbd['update'](_0x5460b9)[_0xac50('0x26')](function(_0x209d9f){return _0x209d9f;});}return null;};}function removeEntity(_0x404cd8,_0xeaa8d5){return function(_0x258923){if(_0x258923){return _0x258923[_0xac50('0x27')]()['then'](function(){_0x404cd8[_0xac50('0x1a')](0xcc)[_0xac50('0x1b')]();});}};}function handleEntityNotFound(_0x519acc,_0x1b27e6){return function(_0x48f53c){if(!_0x48f53c){_0x519acc[_0xac50('0x19')](0x194);}return _0x48f53c;};}function handleError(_0x340599,_0xcf1891){_0xcf1891=_0xcf1891||0x1f4;return function(_0x47231e){logger['error'](_0x47231e[_0xac50('0x28')]);if(_0x47231e[_0xac50('0x29')]){delete _0x47231e[_0xac50('0x29')];}_0x340599[_0xac50('0x1a')](_0xcf1891)[_0xac50('0x2a')](_0x47231e);};}exports['index']=function(_0x41272a,_0x1c0c75){var _0x331606={},_0x546b09={},_0x101922={'count':0x0,'rows':[]};var _0xd64b9e=_['map'](db[_0xac50('0x2b')][_0xac50('0x2c')],function(_0x4aeaa9){return{'name':_0x4aeaa9['fieldName'],'type':_0x4aeaa9['type']['key']};});_0x546b09['model']=_['map'](_0xd64b9e,'name');_0x546b09[_0xac50('0x2d')]=_[_0xac50('0x2e')](_0x41272a[_0xac50('0x2d')]);_0x546b09[_0xac50('0x2f')]=_[_0xac50('0x30')](_0x546b09['model'],_0x546b09[_0xac50('0x2d')]);_0x331606[_0xac50('0x31')]=_[_0xac50('0x30')](_0x546b09[_0xac50('0x32')],qs[_0xac50('0x33')](_0x41272a[_0xac50('0x2d')][_0xac50('0x33')]));_0x331606['attributes']=_0x331606[_0xac50('0x31')][_0xac50('0x34')]?_0x331606[_0xac50('0x31')]:_0x546b09[_0xac50('0x32')];if(!_0x41272a[_0xac50('0x2d')][_0xac50('0x35')](_0xac50('0x36'))){_0x331606[_0xac50('0x1f')]=qs[_0xac50('0x1f')](_0x41272a[_0xac50('0x2d')][_0xac50('0x1f')]);_0x331606[_0xac50('0x1d')]=qs[_0xac50('0x1d')](_0x41272a[_0xac50('0x2d')]['offset']);}_0x331606['order']=qs[_0xac50('0x37')](_0x41272a[_0xac50('0x2d')][_0xac50('0x37')]);_0x331606[_0xac50('0x38')]=qs['filters'](_[_0xac50('0x39')](_0x41272a[_0xac50('0x2d')],_0x546b09[_0xac50('0x2f')]),_0xd64b9e);if(_0x41272a[_0xac50('0x2d')]['filter']){_0x331606[_0xac50('0x38')]=_[_0xac50('0x3a')](_0x331606[_0xac50('0x38')],{'$or':_[_0xac50('0x3b')](_0xd64b9e,function(_0x53d281){if(_0x53d281[_0xac50('0x3c')]!==_0xac50('0x3d')){var _0x6128b5={};_0x6128b5[_0x53d281[_0xac50('0x29')]]={'$like':'%'+_0x41272a[_0xac50('0x2d')][_0xac50('0x3e')]+'%'};return _0x6128b5;}})});}_0x331606=_[_0xac50('0x3a')]({},_0x331606,_0x41272a[_0xac50('0x3f')]);var _0x4a115b={'where':_0x331606[_0xac50('0x38')]};return db[_0xac50('0x2b')]['count'](_0x4a115b)[_0xac50('0x26')](function(_0x4d7bfa){_0x101922['count']=_0x4d7bfa;if(_0x41272a['query'][_0xac50('0x40')]){_0x331606[_0xac50('0x41')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x331606);})[_0xac50('0x26')](function(_0x3d0337){_0x101922[_0xac50('0x42')]=_0x3d0337;return _0x101922;})[_0xac50('0x26')](respondWithFilteredResult(_0x1c0c75,_0x331606))[_0xac50('0x43')](handleError(_0x1c0c75,null));};exports['show']=function(_0xfd85a0,_0x22a101){var _0x33ee62={'raw':!![],'where':{'id':_0xfd85a0['params']['id']}},_0xa77b3b={};_0xa77b3b[_0xac50('0x32')]=_[_0xac50('0x2e')](db['MailServerOut'][_0xac50('0x2c')]);_0xa77b3b[_0xac50('0x2d')]=_[_0xac50('0x2e')](_0xfd85a0[_0xac50('0x2d')]);_0xa77b3b[_0xac50('0x2f')]=_['intersection'](_0xa77b3b[_0xac50('0x32')],_0xa77b3b[_0xac50('0x2d')]);_0x33ee62[_0xac50('0x31')]=_[_0xac50('0x30')](_0xa77b3b[_0xac50('0x32')],qs[_0xac50('0x33')](_0xfd85a0[_0xac50('0x2d')][_0xac50('0x33')]));_0x33ee62[_0xac50('0x31')]=_0x33ee62[_0xac50('0x31')][_0xac50('0x34')]?_0x33ee62[_0xac50('0x31')]:_0xa77b3b[_0xac50('0x32')];if(_0xfd85a0[_0xac50('0x2d')][_0xac50('0x40')]){_0x33ee62[_0xac50('0x41')]=[{'all':!![]}];}_0x33ee62=_[_0xac50('0x3a')]({},_0x33ee62,_0xfd85a0[_0xac50('0x3f')]);return db['MailServerOut'][_0xac50('0x44')](_0x33ee62)[_0xac50('0x26')](handleEntityNotFound(_0x22a101,null))['then'](respondWithResult(_0x22a101,null))[_0xac50('0x43')](handleError(_0x22a101,null));};exports[_0xac50('0x45')]=function(_0x41d881,_0x5746e1){return db['MailServerOut'][_0xac50('0x45')](_0x41d881[_0xac50('0x46')],{})[_0xac50('0x26')](respondWithResult(_0x5746e1,0xc9))[_0xac50('0x43')](handleError(_0x5746e1,null));};exports['update']=function(_0x5c199a,_0x41ccef){if(_0x5c199a[_0xac50('0x46')]['id']){delete _0x5c199a[_0xac50('0x46')]['id'];}return db[_0xac50('0x2b')]['find']({'where':{'id':_0x5c199a[_0xac50('0x47')]['id']}})[_0xac50('0x26')](handleEntityNotFound(_0x41ccef,null))[_0xac50('0x26')](saveUpdates(_0x5c199a[_0xac50('0x46')],null))[_0xac50('0x26')](respondWithResult(_0x41ccef,null))[_0xac50('0x43')](handleError(_0x41ccef,null));};exports['destroy']=function(_0x43b316,_0x2cbae2){return db[_0xac50('0x2b')][_0xac50('0x44')]({'where':{'id':_0x43b316['params']['id']}})['then'](handleEntityNotFound(_0x2cbae2,null))['then'](removeEntity(_0x2cbae2,null))[_0xac50('0x43')](handleError(_0x2cbae2,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index f5e644a..34d3653 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 _0x7e6a=['../../config/environment','./mailServerOut.attributes','define','MailServerOut','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x7e6a,0x1e4));var _0xa7e6=function(_0x2eaa40,_0x31ca9a){_0x2eaa40=_0x2eaa40-0x0;var _0x44be04=_0x7e6a[_0x2eaa40];return _0x44be04;};'use strict';var _=require(_0xa7e6('0x0'));var util=require(_0xa7e6('0x1'));var logger=require(_0xa7e6('0x2'))(_0xa7e6('0x3'));var moment=require('moment');var BPromise=require(_0xa7e6('0x4'));var rp=require(_0xa7e6('0x5'));var fs=require('fs');var path=require(_0xa7e6('0x6'));var rimraf=require(_0xa7e6('0x7'));var config=require(_0xa7e6('0x8'));var attributes=require(_0xa7e6('0x9'));module['exports']=function(_0x303465,_0x1203ea){return _0x303465[_0xa7e6('0xa')](_0xa7e6('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x452c=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out'];(function(_0x14b80c,_0x118d6c){var _0xe04a45=function(_0x2a4947){while(--_0x2a4947){_0x14b80c['push'](_0x14b80c['shift']());}};_0xe04a45(++_0x118d6c);}(_0x452c,0x9c));var _0xc452=function(_0x11d93c,_0x12e587){_0x11d93c=_0x11d93c-0x0;var _0x359382=_0x452c[_0x11d93c];return _0x359382;};'use strict';var _=require('lodash');var util=require(_0xc452('0x0'));var logger=require('../../config/logger')(_0xc452('0x1'));var moment=require(_0xc452('0x2'));var BPromise=require(_0xc452('0x3'));var rp=require(_0xc452('0x4'));var fs=require('fs');var path=require(_0xc452('0x5'));var rimraf=require(_0xc452('0x6'));var config=require(_0xc452('0x7'));var attributes=require(_0xc452('0x8'));module[_0xc452('0x9')]=function(_0x54eddf,_0x1c8abe){return _0x54eddf[_0xc452('0xa')](_0xc452('0xb'),attributes,{'tableName':_0xc452('0xc'),'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 37aaf5a..9de918d 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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2cf6fe,_0x885a1f){var _0x1096f2=function(_0x61f540){while(--_0x61f540){_0x2cf6fe['push'](_0x2cf6fe['shift']());}};_0x1096f2(++_0x885a1f);}(_0x1261,0x144));var _0x1126=function(_0x4b4ce5,_0x573d2d){_0x4b4ce5=_0x4b4ce5-0x0;var _0x6522f3=_0x1261[_0x4b4ce5];return _0x6522f3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x37445a,_0xc58f5){var _0x1c5358=function(_0x3ca945){while(--_0x3ca945){_0x37445a['push'](_0x37445a['shift']());}};_0x1c5358(++_0xc58f5);}(_0x5f2f,0x73));var _0xf5f2=function(_0xab36f5,_0x8eb92a){_0xab36f5=_0xab36f5-0x0;var _0x20c769=_0x5f2f[_0xab36f5];return _0x20c769;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 495ad70..752990d 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 _0xc939=['get','index','/describe','isAuthenticated','describe','show','post','put','/:id','update','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailSubstatus.controller'];(function(_0x104162,_0x13a5f4){var _0xf55023=function(_0xbe126f){while(--_0xbe126f){_0x104162['push'](_0x104162['shift']());}};_0xf55023(++_0x13a5f4);}(_0xc939,0x1ad));var _0x9c93=function(_0x23d183,_0x3d8770){_0x23d183=_0x23d183-0x0;var _0x2fd708=_0xc939[_0x23d183];return _0x2fd708;};'use strict';var multer=require(_0x9c93('0x0'));var util=require(_0x9c93('0x1'));var path=require(_0x9c93('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c93('0x3'));var router=express[_0x9c93('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c93('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c93('0x6'));var controller=require(_0x9c93('0x7'));router[_0x9c93('0x8')]('/',auth['isAuthenticated'](),controller[_0x9c93('0x9')]);router['get'](_0x9c93('0xa'),auth[_0x9c93('0xb')](),controller[_0x9c93('0xc')]);router[_0x9c93('0x8')]('/:id',auth[_0x9c93('0xb')](),controller[_0x9c93('0xd')]);router[_0x9c93('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9c93('0xf')](_0x9c93('0x10'),auth[_0x9c93('0xb')](),controller[_0x9c93('0x11')]);router['delete'](_0x9c93('0x10'),auth[_0x9c93('0xb')](),controller['destroy']);module[_0x9c93('0x12')]=router; \ No newline at end of file +var _0xcb27=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','describe','isAuthenticated','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x16021d,_0x35d0bc){var _0x376ed0=function(_0x86da0e){while(--_0x86da0e){_0x16021d['push'](_0x16021d['shift']());}};_0x376ed0(++_0x35d0bc);}(_0xcb27,0x169));var _0x7cb2=function(_0x43a253,_0x49dcfd){_0x43a253=_0x43a253-0x0;var _0x7b590a=_0xcb27[_0x43a253];return _0x7b590a;};'use strict';var multer=require(_0x7cb2('0x0'));var util=require(_0x7cb2('0x1'));var path=require(_0x7cb2('0x2'));var timeout=require(_0x7cb2('0x3'));var express=require(_0x7cb2('0x4'));var router=express[_0x7cb2('0x5')]();var fs_extra=require(_0x7cb2('0x6'));var auth=require(_0x7cb2('0x7'));var interaction=require(_0x7cb2('0x8'));var config=require(_0x7cb2('0x9'));var controller=require(_0x7cb2('0xa'));router[_0x7cb2('0xb')]('/',auth['isAuthenticated'](),controller[_0x7cb2('0xc')]);router[_0x7cb2('0xb')](_0x7cb2('0xd'),auth['isAuthenticated'](),controller[_0x7cb2('0xe')]);router[_0x7cb2('0xb')]('/:id',auth[_0x7cb2('0xf')](),controller[_0x7cb2('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7cb2('0x11')]);router[_0x7cb2('0x12')](_0x7cb2('0x13'),auth[_0x7cb2('0xf')](),controller[_0x7cb2('0x14')]);router[_0x7cb2('0x15')]('/:id',auth[_0x7cb2('0xf')](),controller[_0x7cb2('0x16')]);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 7018518..3cfde78 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 _0x25fa=['name','sequelize','STRING'];(function(_0x8ea62e,_0x3da7e7){var _0x4e6121=function(_0x28191f){while(--_0x28191f){_0x8ea62e['push'](_0x8ea62e['shift']());}};_0x4e6121(++_0x3da7e7);}(_0x25fa,0x109));var _0xa25f=function(_0x11230e,_0x53114d){_0x11230e=_0x11230e-0x0;var _0x47794d=_0x25fa[_0x11230e];return _0x47794d;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa25f('0x1')],'unique':_0xa25f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4873=['exports','STRING','sequelize'];(function(_0x5936e6,_0xce4f37){var _0x292974=function(_0x2ab267){while(--_0x2ab267){_0x5936e6['push'](_0x5936e6['shift']());}};_0x292974(++_0xce4f37);}(_0x4873,0x1df));var _0x3487=function(_0x563252,_0x40edfd){_0x563252=_0x563252-0x0;var _0x1f15c8=_0x4873[_0x563252];return _0x1f15c8;};'use strict';var Sequelize=require(_0x3487('0x0'));module[_0x3487('0x1')]={'name':{'type':Sequelize[_0x3487('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3487('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 32d183b..08ef4f5 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 _0x877f=['options','MailSubstatus','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','map','fieldName','type','keys','query','filters','intersection','fields','attributes','length','model','order','sort','where','pick','filter','merge'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x877f,0x1ca));var _0xf877=function(_0x3aec4d,_0x5e9217){_0x3aec4d=_0x3aec4d-0x0;var _0x1ca178=_0x877f[_0x3aec4d];return _0x1ca178;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf877('0x0'));var zipdir=require(_0xf877('0x1'));var jsonpatch=require(_0xf877('0x2'));var rp=require(_0xf877('0x3'));var moment=require(_0xf877('0x4'));var BPromise=require(_0xf877('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf877('0x6'));var sox=require(_0xf877('0x7'));var csv=require(_0xf877('0x8'));var ejs=require(_0xf877('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf877('0xa'));var squel=require(_0xf877('0xb'));var crypto=require(_0xf877('0xc'));var jsforce=require(_0xf877('0xd'));var deskjs=require(_0xf877('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf877('0xf'));var Papa=require('papaparse');var Redis=require(_0xf877('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf877('0x11'));var as=require(_0xf877('0x12'));var hardwareService=require(_0xf877('0x13'));var logger=require('../../config/logger')(_0xf877('0x14'));var utils=require('../../config/utils');var config=require(_0xf877('0x15'));var licenseUtil=require(_0xf877('0x16'));var db=require(_0xf877('0x17'))['db'];function respondWithStatusCode(_0x43a40f,_0x1da449){_0x1da449=_0x1da449||0xcc;return function(_0x520262){if(_0x520262){return _0x43a40f['sendStatus'](_0x1da449);}return _0x43a40f[_0xf877('0x18')](_0x1da449)['end']();};}function respondWithResult(_0x33d72e,_0x18238f){_0x18238f=_0x18238f||0xc8;return function(_0xa21ff7){if(_0xa21ff7){return _0x33d72e['status'](_0x18238f)[_0xf877('0x19')](_0xa21ff7);}};}function respondWithFilteredResult(_0x50e12a,_0x46212d){return function(_0x18d12b){if(_0x18d12b){var _0x55f123=typeof _0x46212d[_0xf877('0x1a')]===_0xf877('0x1b')&&typeof _0x46212d[_0xf877('0x1c')]===_0xf877('0x1b');var _0x4d1788=_0x18d12b['count'];var _0x53ebdf=_0x55f123?0x0:_0x46212d[_0xf877('0x1a')];var _0x2dc3a2=_0x55f123?_0x18d12b[_0xf877('0x1d')]:_0x46212d[_0xf877('0x1a')]+_0x46212d['limit'];var _0x129295;if(_0x2dc3a2>=_0x4d1788){_0x2dc3a2=_0x4d1788;_0x129295=0xc8;}else{_0x129295=0xce;}_0x50e12a[_0xf877('0x18')](_0x129295);return _0x50e12a[_0xf877('0x1e')](_0xf877('0x1f'),_0x53ebdf+'-'+_0x2dc3a2+'/'+_0x4d1788)['json'](_0x18d12b);}return null;};}function patchUpdates(_0x5c2cff){return function(_0x5811f4){try{jsonpatch[_0xf877('0x20')](_0x5811f4,_0x5c2cff,!![]);}catch(_0x5b182a){return BPromise[_0xf877('0x21')](_0x5b182a);}return _0x5811f4[_0xf877('0x22')]();};}function saveUpdates(_0x56b8b6,_0xd4d179){return function(_0x413735){if(_0x413735){return _0x413735['update'](_0x56b8b6)[_0xf877('0x23')](function(_0x52c7fe){return _0x52c7fe;});}return null;};}function removeEntity(_0x37d66b,_0x4451f7){return function(_0x3c30c7){if(_0x3c30c7){return _0x3c30c7[_0xf877('0x24')]()[_0xf877('0x23')](function(){_0x37d66b['status'](0xcc)[_0xf877('0x25')]();});}};}function handleEntityNotFound(_0x3c9f61,_0x18570b){return function(_0x360c5c){if(!_0x360c5c){_0x3c9f61[_0xf877('0x26')](0x194);}return _0x360c5c;};}function handleError(_0x17e774,_0x1dda8e){_0x1dda8e=_0x1dda8e||0x1f4;return function(_0x398cb0){logger[_0xf877('0x27')](_0x398cb0[_0xf877('0x28')]);if(_0x398cb0[_0xf877('0x29')]){delete _0x398cb0[_0xf877('0x29')];}_0x17e774[_0xf877('0x18')](_0x1dda8e)[_0xf877('0x2a')](_0x398cb0);};}exports['index']=function(_0xdeec5a,_0x3b9d61){var _0x5d268c={},_0x1bd5c0={},_0x583ec5={'count':0x0,'rows':[]};var _0x49d371=_[_0xf877('0x2b')](db['MailSubstatus']['rawAttributes'],function(_0x19b33b){return{'name':_0x19b33b[_0xf877('0x2c')],'type':_0x19b33b[_0xf877('0x2d')]['key']};});_0x1bd5c0['model']=_['map'](_0x49d371,_0xf877('0x29'));_0x1bd5c0['query']=_[_0xf877('0x2e')](_0xdeec5a[_0xf877('0x2f')]);_0x1bd5c0[_0xf877('0x30')]=_['intersection'](_0x1bd5c0['model'],_0x1bd5c0[_0xf877('0x2f')]);_0x5d268c['attributes']=_[_0xf877('0x31')](_0x1bd5c0['model'],qs[_0xf877('0x32')](_0xdeec5a[_0xf877('0x2f')]['fields']));_0x5d268c[_0xf877('0x33')]=_0x5d268c['attributes'][_0xf877('0x34')]?_0x5d268c[_0xf877('0x33')]:_0x1bd5c0[_0xf877('0x35')];if(!_0xdeec5a[_0xf877('0x2f')]['hasOwnProperty']('nolimit')){_0x5d268c['limit']=qs[_0xf877('0x1c')](_0xdeec5a[_0xf877('0x2f')][_0xf877('0x1c')]);_0x5d268c[_0xf877('0x1a')]=qs['offset'](_0xdeec5a[_0xf877('0x2f')][_0xf877('0x1a')]);}_0x5d268c[_0xf877('0x36')]=qs[_0xf877('0x37')](_0xdeec5a[_0xf877('0x2f')]['sort']);_0x5d268c[_0xf877('0x38')]=qs[_0xf877('0x30')](_[_0xf877('0x39')](_0xdeec5a[_0xf877('0x2f')],_0x1bd5c0[_0xf877('0x30')]),_0x49d371);if(_0xdeec5a[_0xf877('0x2f')][_0xf877('0x3a')]){_0x5d268c[_0xf877('0x38')]=_[_0xf877('0x3b')](_0x5d268c[_0xf877('0x38')],{'$or':_['map'](_0x49d371,function(_0x4497ab){if(_0x4497ab['type']!=='VIRTUAL'){var _0x233134={};_0x233134[_0x4497ab[_0xf877('0x29')]]={'$like':'%'+_0xdeec5a[_0xf877('0x2f')][_0xf877('0x3a')]+'%'};return _0x233134;}})});}_0x5d268c=_[_0xf877('0x3b')]({},_0x5d268c,_0xdeec5a[_0xf877('0x3c')]);var _0x42f455={'where':_0x5d268c[_0xf877('0x38')]};return db[_0xf877('0x3d')][_0xf877('0x1d')](_0x42f455)['then'](function(_0x285cfa){_0x583ec5['count']=_0x285cfa;if(_0xdeec5a[_0xf877('0x2f')][_0xf877('0x3e')]){_0x5d268c[_0xf877('0x3f')]=[{'all':!![]}];}return db[_0xf877('0x3d')][_0xf877('0x40')](_0x5d268c);})[_0xf877('0x23')](function(_0x53529a){_0x583ec5['rows']=_0x53529a;return _0x583ec5;})[_0xf877('0x23')](respondWithFilteredResult(_0x3b9d61,_0x5d268c))[_0xf877('0x41')](handleError(_0x3b9d61,null));};exports[_0xf877('0x42')]=function(_0x56cbb1,_0x2416fe){var _0x5ea316={'raw':!![],'where':{'id':_0x56cbb1['params']['id']}},_0x5d8ba1={};_0x5d8ba1[_0xf877('0x35')]=_[_0xf877('0x2e')](db[_0xf877('0x3d')][_0xf877('0x43')]);_0x5d8ba1[_0xf877('0x2f')]=_[_0xf877('0x2e')](_0x56cbb1[_0xf877('0x2f')]);_0x5d8ba1['filters']=_['intersection'](_0x5d8ba1[_0xf877('0x35')],_0x5d8ba1[_0xf877('0x2f')]);_0x5ea316[_0xf877('0x33')]=_[_0xf877('0x31')](_0x5d8ba1['model'],qs[_0xf877('0x32')](_0x56cbb1['query'][_0xf877('0x32')]));_0x5ea316[_0xf877('0x33')]=_0x5ea316['attributes'][_0xf877('0x34')]?_0x5ea316[_0xf877('0x33')]:_0x5d8ba1[_0xf877('0x35')];if(_0x56cbb1['query'][_0xf877('0x3e')]){_0x5ea316['include']=[{'all':!![]}];}_0x5ea316=_[_0xf877('0x3b')]({},_0x5ea316,_0x56cbb1[_0xf877('0x3c')]);return db[_0xf877('0x3d')][_0xf877('0x44')](_0x5ea316)[_0xf877('0x23')](handleEntityNotFound(_0x2416fe,null))[_0xf877('0x23')](respondWithResult(_0x2416fe,null))[_0xf877('0x41')](handleError(_0x2416fe,null));};exports[_0xf877('0x45')]=function(_0x3d7f67,_0x1d8ce9){return db['MailSubstatus'][_0xf877('0x45')](_0x3d7f67[_0xf877('0x46')],{})['then'](respondWithResult(_0x1d8ce9,0xc9))[_0xf877('0x41')](handleError(_0x1d8ce9,null));};exports[_0xf877('0x47')]=function(_0x5d74e7,_0x1ceb2c){if(_0x5d74e7[_0xf877('0x46')]['id']){delete _0x5d74e7[_0xf877('0x46')]['id'];}return db[_0xf877('0x3d')]['find']({'where':{'id':_0x5d74e7[_0xf877('0x48')]['id']}})[_0xf877('0x23')](handleEntityNotFound(_0x1ceb2c,null))[_0xf877('0x23')](saveUpdates(_0x5d74e7['body'],null))[_0xf877('0x23')](respondWithResult(_0x1ceb2c,null))[_0xf877('0x41')](handleError(_0x1ceb2c,null));};exports['destroy']=function(_0x5794d4,_0x4b3ba0){return db[_0xf877('0x3d')][_0xf877('0x44')]({'where':{'id':_0x5794d4[_0xf877('0x48')]['id']}})[_0xf877('0x23')](handleEntityNotFound(_0x4b3ba0,null))[_0xf877('0x23')](removeEntity(_0x4b3ba0,null))[_0xf877('0x41')](handleError(_0x4b3ba0,null));};exports[_0xf877('0x49')]=function(_0x44af7c,_0x17cc1c){return db[_0xf877('0x3d')][_0xf877('0x49')]()[_0xf877('0x23')](respondWithResult(_0x17cc1c,null))[_0xf877('0x41')](handleError(_0x17cc1c,null));}; \ No newline at end of file +var _0x297e=['where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x365e17,_0x18b8c2){var _0x788da7=function(_0x1f4dbb){while(--_0x1f4dbb){_0x365e17['push'](_0x365e17['shift']());}};_0x788da7(++_0x18b8c2);}(_0x297e,0xf7));var _0xe297=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x297e[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe297('0x0'));var jsonpatch=require(_0xe297('0x1'));var rp=require(_0xe297('0x2'));var moment=require(_0xe297('0x3'));var BPromise=require(_0xe297('0x4'));var Mustache=require(_0xe297('0x5'));var util=require('util');var path=require(_0xe297('0x6'));var sox=require(_0xe297('0x7'));var csv=require(_0xe297('0x8'));var ejs=require(_0xe297('0x9'));var fs=require('fs');var fs_extra=require(_0xe297('0xa'));var _=require(_0xe297('0xb'));var squel=require(_0xe297('0xc'));var crypto=require(_0xe297('0xd'));var jsforce=require(_0xe297('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe297('0xf'));var Papa=require(_0xe297('0x10'));var Redis=require(_0xe297('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe297('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe297('0x13'));var logger=require(_0xe297('0x14'))(_0xe297('0x15'));var utils=require(_0xe297('0x16'));var config=require(_0xe297('0x17'));var licenseUtil=require(_0xe297('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cd1de,_0x2a4a61){_0x2a4a61=_0x2a4a61||0xcc;return function(_0x40147f){if(_0x40147f){return _0x2cd1de[_0xe297('0x19')](_0x2a4a61);}return _0x2cd1de[_0xe297('0x1a')](_0x2a4a61)[_0xe297('0x1b')]();};}function respondWithResult(_0x13485d,_0x2a1b5a){_0x2a1b5a=_0x2a1b5a||0xc8;return function(_0x4788a0){if(_0x4788a0){return _0x13485d[_0xe297('0x1a')](_0x2a1b5a)['json'](_0x4788a0);}};}function respondWithFilteredResult(_0x518ba2,_0x45db64){return function(_0x328895){if(_0x328895){var _0x40b358=typeof _0x45db64[_0xe297('0x1c')]===_0xe297('0x1d')&&typeof _0x45db64[_0xe297('0x1e')]===_0xe297('0x1d');var _0x5befc5=_0x328895['count'];var _0x949589=_0x40b358?0x0:_0x45db64[_0xe297('0x1c')];var _0x5e4971=_0x40b358?_0x328895[_0xe297('0x1f')]:_0x45db64[_0xe297('0x1c')]+_0x45db64[_0xe297('0x1e')];var _0x101e29;if(_0x5e4971>=_0x5befc5){_0x5e4971=_0x5befc5;_0x101e29=0xc8;}else{_0x101e29=0xce;}_0x518ba2[_0xe297('0x1a')](_0x101e29);return _0x518ba2[_0xe297('0x20')](_0xe297('0x21'),_0x949589+'-'+_0x5e4971+'/'+_0x5befc5)[_0xe297('0x22')](_0x328895);}return null;};}function patchUpdates(_0x120fee){return function(_0x4cef8c){try{jsonpatch['apply'](_0x4cef8c,_0x120fee,!![]);}catch(_0xfeda95){return BPromise[_0xe297('0x23')](_0xfeda95);}return _0x4cef8c['save']();};}function saveUpdates(_0x32b617,_0x16764a){return function(_0x53a422){if(_0x53a422){return _0x53a422[_0xe297('0x24')](_0x32b617)[_0xe297('0x25')](function(_0x2ead3e){return _0x2ead3e;});}return null;};}function removeEntity(_0x4fd20d,_0x543f02){return function(_0x7a01cf){if(_0x7a01cf){return _0x7a01cf['destroy']()['then'](function(){_0x4fd20d['status'](0xcc)[_0xe297('0x1b')]();});}};}function handleEntityNotFound(_0x37ee2a,_0x4194cc){return function(_0x3f86c7){if(!_0x3f86c7){_0x37ee2a[_0xe297('0x19')](0x194);}return _0x3f86c7;};}function handleError(_0x54a835,_0x2b3d58){_0x2b3d58=_0x2b3d58||0x1f4;return function(_0x2d8e8f){logger[_0xe297('0x26')](_0x2d8e8f[_0xe297('0x27')]);if(_0x2d8e8f[_0xe297('0x28')]){delete _0x2d8e8f[_0xe297('0x28')];}_0x54a835[_0xe297('0x1a')](_0x2b3d58)[_0xe297('0x29')](_0x2d8e8f);};}exports[_0xe297('0x2a')]=function(_0x4e7614,_0x618a7e){var _0xa62c3b={},_0x29fcbe={},_0x3c2b5c={'count':0x0,'rows':[]};var _0xdd7de8=_[_0xe297('0x2b')](db[_0xe297('0x2c')][_0xe297('0x2d')],function(_0x3d88fc){return{'name':_0x3d88fc[_0xe297('0x2e')],'type':_0x3d88fc[_0xe297('0x2f')][_0xe297('0x30')]};});_0x29fcbe[_0xe297('0x31')]=_['map'](_0xdd7de8,_0xe297('0x28'));_0x29fcbe['query']=_[_0xe297('0x32')](_0x4e7614[_0xe297('0x33')]);_0x29fcbe[_0xe297('0x34')]=_['intersection'](_0x29fcbe[_0xe297('0x31')],_0x29fcbe['query']);_0xa62c3b[_0xe297('0x35')]=_[_0xe297('0x36')](_0x29fcbe[_0xe297('0x31')],qs[_0xe297('0x37')](_0x4e7614[_0xe297('0x33')][_0xe297('0x37')]));_0xa62c3b[_0xe297('0x35')]=_0xa62c3b[_0xe297('0x35')][_0xe297('0x38')]?_0xa62c3b[_0xe297('0x35')]:_0x29fcbe[_0xe297('0x31')];if(!_0x4e7614['query'][_0xe297('0x39')](_0xe297('0x3a'))){_0xa62c3b['limit']=qs[_0xe297('0x1e')](_0x4e7614[_0xe297('0x33')][_0xe297('0x1e')]);_0xa62c3b[_0xe297('0x1c')]=qs[_0xe297('0x1c')](_0x4e7614[_0xe297('0x33')][_0xe297('0x1c')]);}_0xa62c3b[_0xe297('0x3b')]=qs['sort'](_0x4e7614[_0xe297('0x33')][_0xe297('0x3c')]);_0xa62c3b[_0xe297('0x3d')]=qs[_0xe297('0x34')](_[_0xe297('0x3e')](_0x4e7614[_0xe297('0x33')],_0x29fcbe[_0xe297('0x34')]),_0xdd7de8);if(_0x4e7614['query']['filter']){_0xa62c3b[_0xe297('0x3d')]=_[_0xe297('0x3f')](_0xa62c3b['where'],{'$or':_[_0xe297('0x2b')](_0xdd7de8,function(_0x323973){if(_0x323973[_0xe297('0x2f')]!=='VIRTUAL'){var _0x44e46a={};_0x44e46a[_0x323973['name']]={'$like':'%'+_0x4e7614[_0xe297('0x33')][_0xe297('0x40')]+'%'};return _0x44e46a;}})});}_0xa62c3b=_[_0xe297('0x3f')]({},_0xa62c3b,_0x4e7614[_0xe297('0x41')]);var _0x1559be={'where':_0xa62c3b[_0xe297('0x3d')]};return db['MailSubstatus'][_0xe297('0x1f')](_0x1559be)[_0xe297('0x25')](function(_0x40abc2){_0x3c2b5c[_0xe297('0x1f')]=_0x40abc2;if(_0x4e7614[_0xe297('0x33')][_0xe297('0x42')]){_0xa62c3b[_0xe297('0x43')]=[{'all':!![]}];}return db['MailSubstatus'][_0xe297('0x44')](_0xa62c3b);})[_0xe297('0x25')](function(_0x1e7039){_0x3c2b5c['rows']=_0x1e7039;return _0x3c2b5c;})['then'](respondWithFilteredResult(_0x618a7e,_0xa62c3b))[_0xe297('0x45')](handleError(_0x618a7e,null));};exports[_0xe297('0x46')]=function(_0x4c220d,_0x523c4a){var _0x22185b={'raw':!![],'where':{'id':_0x4c220d[_0xe297('0x47')]['id']}},_0x30cb0d={};_0x30cb0d[_0xe297('0x31')]=_[_0xe297('0x32')](db[_0xe297('0x2c')]['rawAttributes']);_0x30cb0d[_0xe297('0x33')]=_[_0xe297('0x32')](_0x4c220d[_0xe297('0x33')]);_0x30cb0d[_0xe297('0x34')]=_[_0xe297('0x36')](_0x30cb0d['model'],_0x30cb0d['query']);_0x22185b[_0xe297('0x35')]=_[_0xe297('0x36')](_0x30cb0d['model'],qs[_0xe297('0x37')](_0x4c220d[_0xe297('0x33')][_0xe297('0x37')]));_0x22185b[_0xe297('0x35')]=_0x22185b[_0xe297('0x35')][_0xe297('0x38')]?_0x22185b[_0xe297('0x35')]:_0x30cb0d[_0xe297('0x31')];if(_0x4c220d[_0xe297('0x33')][_0xe297('0x42')]){_0x22185b['include']=[{'all':!![]}];}_0x22185b=_[_0xe297('0x3f')]({},_0x22185b,_0x4c220d[_0xe297('0x41')]);return db[_0xe297('0x2c')][_0xe297('0x48')](_0x22185b)[_0xe297('0x25')](handleEntityNotFound(_0x523c4a,null))[_0xe297('0x25')](respondWithResult(_0x523c4a,null))[_0xe297('0x45')](handleError(_0x523c4a,null));};exports[_0xe297('0x49')]=function(_0x5e2488,_0x125112){return db['MailSubstatus'][_0xe297('0x49')](_0x5e2488[_0xe297('0x4a')],{})['then'](respondWithResult(_0x125112,0xc9))[_0xe297('0x45')](handleError(_0x125112,null));};exports[_0xe297('0x24')]=function(_0x55c53c,_0x5e837b){if(_0x55c53c[_0xe297('0x4a')]['id']){delete _0x55c53c[_0xe297('0x4a')]['id'];}return db[_0xe297('0x2c')][_0xe297('0x48')]({'where':{'id':_0x55c53c[_0xe297('0x47')]['id']}})[_0xe297('0x25')](handleEntityNotFound(_0x5e837b,null))[_0xe297('0x25')](saveUpdates(_0x55c53c[_0xe297('0x4a')],null))['then'](respondWithResult(_0x5e837b,null))[_0xe297('0x45')](handleError(_0x5e837b,null));};exports[_0xe297('0x4b')]=function(_0x1059c2,_0x526e76){return db['MailSubstatus'][_0xe297('0x48')]({'where':{'id':_0x1059c2[_0xe297('0x47')]['id']}})[_0xe297('0x25')](handleEntityNotFound(_0x526e76,null))['then'](removeEntity(_0x526e76,null))[_0xe297('0x45')](handleError(_0x526e76,null));};exports[_0xe297('0x4c')]=function(_0x27fe86,_0x1e7900){return db['MailSubstatus'][_0xe297('0x4c')]()['then'](respondWithResult(_0x1e7900,null))['catch'](handleError(_0x1e7900,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 5e0df03..2cfe2bb 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 _0x121e=['./mailSubstatus.attributes','exports','define','mail_substatuses','lodash','util','moment','request-promise','path','../../config/environment'];(function(_0x20fd23,_0x5d3358){var _0x573b67=function(_0x19c567){while(--_0x19c567){_0x20fd23['push'](_0x20fd23['shift']());}};_0x573b67(++_0x5d3358);}(_0x121e,0x112));var _0xe121=function(_0x7dccae,_0x367f8c){_0x7dccae=_0x7dccae-0x0;var _0x2f3445=_0x121e[_0x7dccae];return _0x2f3445;};'use strict';var _=require(_0xe121('0x0'));var util=require(_0xe121('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe121('0x2'));var BPromise=require('bluebird');var rp=require(_0xe121('0x3'));var fs=require('fs');var path=require(_0xe121('0x4'));var rimraf=require('rimraf');var config=require(_0xe121('0x5'));var attributes=require(_0xe121('0x6'));module[_0xe121('0x7')]=function(_0x59d0f2,_0x55114f){return _0x59d0f2[_0xe121('0x8')]('MailSubstatus',attributes,{'tableName':_0xe121('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc720=['exports','define','MailSubstatus','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailSubstatus.attributes'];(function(_0x427994,_0xb2b596){var _0x55cc9a=function(_0x5bffdc){while(--_0x5bffdc){_0x427994['push'](_0x427994['shift']());}};_0x55cc9a(++_0xb2b596);}(_0xc720,0x1e3));var _0x0c72=function(_0x39797f,_0xdce63b){_0x39797f=_0x39797f-0x0;var _0x54d63d=_0xc720[_0x39797f];return _0x54d63d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c72('0x0'))(_0x0c72('0x1'));var moment=require(_0x0c72('0x2'));var BPromise=require('bluebird');var rp=require(_0x0c72('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c72('0x4'));var config=require(_0x0c72('0x5'));var attributes=require(_0x0c72('0x6'));module[_0x0c72('0x7')]=function(_0x30c9ec,_0x1b4296){return _0x30c9ec[_0x0c72('0x8')](_0x0c72('0x9'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 8ed0ec8..bc182fd 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 _0x62cd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x62cd,0x95));var _0xd62c=function(_0x50fc5b,_0x280d63){_0x50fc5b=_0x50fc5b-0x0;var _0x4642e4=_0x62cd[_0x50fc5b];return _0x4642e4;};'use strict';var _=require('lodash');var util=require(_0xd62c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd62c('0x1'));var fs=require('fs');var Redis=require(_0xd62c('0x2'));var db=require(_0xd62c('0x3'))['db'];var utils=require(_0xd62c('0x4'));var logger=require(_0xd62c('0x5'))(_0xd62c('0x6'));var config=require(_0xd62c('0x7'));var jayson=require(_0xd62c('0x8'));var client=jayson[_0xd62c('0x9')][_0xd62c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x165418,_0x33983b,_0x4a98a8){return new BPromise(function(_0x3a60d0,_0x4566cf){return client[_0xd62c('0xb')](_0x165418,_0x4a98a8)[_0xd62c('0xc')](function(_0x131355){logger[_0xd62c('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x33983b,'request\x20sent');logger[_0xd62c('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x33983b,_0xd62c('0xf'),JSON['stringify'](_0x131355));if(_0x131355[_0xd62c('0x10')]){if(_0x131355[_0xd62c('0x10')][_0xd62c('0x11')]===0x1f4){logger[_0xd62c('0x10')](_0xd62c('0x12'),_0x33983b,_0x131355['error'][_0xd62c('0x13')]);return _0x4566cf(_0x131355[_0xd62c('0x10')]['message']);}logger['error'](_0xd62c('0x12'),_0x33983b,_0x131355[_0xd62c('0x10')][_0xd62c('0x13')]);return _0x3a60d0(_0x131355[_0xd62c('0x10')][_0xd62c('0x13')]);}else{logger[_0xd62c('0xd')](_0xd62c('0x12'),_0x33983b,_0xd62c('0xf'));_0x3a60d0(_0x131355[_0xd62c('0x14')][_0xd62c('0x13')]);}})[_0xd62c('0x15')](function(_0xe4469a){logger[_0xd62c('0x10')](_0xd62c('0x12'),_0x33983b,_0xe4469a);_0x4566cf(_0xe4469a);});});} \ No newline at end of file +var _0x1791=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x1791,0x192));var _0x1179=function(_0x438912,_0x3f7f74){_0x438912=_0x438912-0x0;var _0x18112f=_0x1791[_0x438912];return _0x18112f;};'use strict';var _=require(_0x1179('0x0'));var util=require(_0x1179('0x1'));var moment=require(_0x1179('0x2'));var BPromise=require(_0x1179('0x3'));var rs=require(_0x1179('0x4'));var fs=require('fs');var Redis=require(_0x1179('0x5'));var db=require(_0x1179('0x6'))['db'];var utils=require(_0x1179('0x7'));var logger=require(_0x1179('0x8'))('rpc');var config=require(_0x1179('0x9'));var jayson=require(_0x1179('0xa'));var client=jayson[_0x1179('0xb')][_0x1179('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c71e0,_0x55a746,_0x13c57f){return new BPromise(function(_0x574250,_0x3d7065){return client['request'](_0x2c71e0,_0x13c57f)[_0x1179('0xd')](function(_0x5a21ca){logger[_0x1179('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x55a746,_0x1179('0xf'));logger[_0x1179('0x10')](_0x1179('0x11'),_0x55a746,_0x1179('0xf'),JSON[_0x1179('0x12')](_0x5a21ca));if(_0x5a21ca[_0x1179('0x13')]){if(_0x5a21ca['error'][_0x1179('0x14')]===0x1f4){logger[_0x1179('0x13')](_0x1179('0x15'),_0x55a746,_0x5a21ca[_0x1179('0x13')][_0x1179('0x16')]);return _0x3d7065(_0x5a21ca['error'][_0x1179('0x16')]);}logger[_0x1179('0x13')](_0x1179('0x15'),_0x55a746,_0x5a21ca[_0x1179('0x13')][_0x1179('0x16')]);return _0x574250(_0x5a21ca[_0x1179('0x13')][_0x1179('0x16')]);}else{logger[_0x1179('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x55a746,'request\x20sent');_0x574250(_0x5a21ca[_0x1179('0x17')][_0x1179('0x16')]);}})[_0x1179('0x18')](function(_0x1a4351){logger[_0x1179('0x13')](_0x1179('0x15'),_0x55a746,_0x1a4351);_0x3d7065(_0x1a4351);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 221b450..7c23beb 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 _0xd0fa=['post','create','put','update','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x43d5d1,_0x2c7e7d){var _0x278bf2=function(_0x3ac69b){while(--_0x3ac69b){_0x43d5d1['push'](_0x43d5d1['shift']());}};_0x278bf2(++_0x2c7e7d);}(_0xd0fa,0x1a7));var _0xad0f=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xd0fa[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0xad0f('0x0'));var util=require(_0xad0f('0x1'));var path=require(_0xad0f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xad0f('0x3')]();var fs_extra=require(_0xad0f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xad0f('0x5'));var config=require(_0xad0f('0x6'));var controller=require(_0xad0f('0x7'));router[_0xad0f('0x8')]('/',auth[_0xad0f('0x9')](),controller[_0xad0f('0xa')]);router['get'](_0xad0f('0xb'),auth[_0xad0f('0x9')](),controller['describe']);router[_0xad0f('0x8')](_0xad0f('0xc'),auth[_0xad0f('0x9')](),controller[_0xad0f('0xd')]);router[_0xad0f('0xe')]('/',auth[_0xad0f('0x9')](),controller[_0xad0f('0xf')]);router[_0xad0f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xad0f('0x11')]);router['delete'](_0xad0f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xad0f('0x12')]=router; \ No newline at end of file +var _0x8631=['show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','index','/describe','describe','/:id'];(function(_0x5c23d0,_0x17aca8){var _0x11286a=function(_0x33bb11){while(--_0x33bb11){_0x5c23d0['push'](_0x5c23d0['shift']());}};_0x11286a(++_0x17aca8);}(_0x8631,0x1d1));var _0x1863=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8631[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x1863('0x0'));var util=require(_0x1863('0x1'));var path=require(_0x1863('0x2'));var timeout=require(_0x1863('0x3'));var express=require(_0x1863('0x4'));var router=express[_0x1863('0x5')]();var fs_extra=require(_0x1863('0x6'));var auth=require(_0x1863('0x7'));var interaction=require(_0x1863('0x8'));var config=require('../../config/environment');var controller=require(_0x1863('0x9'));router[_0x1863('0xa')]('/',auth['isAuthenticated'](),controller[_0x1863('0xb')]);router[_0x1863('0xa')](_0x1863('0xc'),auth['isAuthenticated'](),controller[_0x1863('0xd')]);router[_0x1863('0xa')](_0x1863('0xe'),auth['isAuthenticated'](),controller[_0x1863('0xf')]);router[_0x1863('0x10')]('/',auth[_0x1863('0x11')](),controller[_0x1863('0x12')]);router[_0x1863('0x13')](_0x1863('0xe'),auth[_0x1863('0x11')](),controller[_0x1863('0x14')]);router[_0x1863('0x15')](_0x1863('0xe'),auth[_0x1863('0x11')](),controller[_0x1863('0x16')]);module[_0x1863('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index a8252cb..8d587a4 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4c1ec2,_0x4f42b7){var _0x3f6f1c=function(_0xc82652){while(--_0xc82652){_0x4c1ec2['push'](_0x4c1ec2['shift']());}};_0x3f6f1c(++_0x4f42b7);}(_0x9bde,0xe1));var _0xe9bd=function(_0x307deb,_0x24785a){_0x307deb=_0x307deb-0x0;var _0x369b40=_0x9bde[_0x307deb];return _0x369b40;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2450a2,_0x5279da){var _0x454d95=function(_0x25fa3d){while(--_0x25fa3d){_0x2450a2['push'](_0x2450a2['shift']());}};_0x454d95(++_0x5279da);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0xcb91[_0x3f94f9];return _0x46f84f;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 34a5f69..26916c2 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 _0x804d=['intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','keys','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','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','end','json','undefined','count','offset','limit','Content-Range','reject','update','then','destroy','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','filters','model','attributes'];(function(_0xfc15d1,_0x18b83f){var _0x46bb57=function(_0x4bb71e){while(--_0x4bb71e){_0xfc15d1['push'](_0xfc15d1['shift']());}};_0x46bb57(++_0x18b83f);}(_0x804d,0xe9));var _0xd804=function(_0x48cb2b,_0x3b0835){_0x48cb2b=_0x48cb2b-0x0;var _0x3f3488=_0x804d[_0x48cb2b];return _0x3f3488;};'use strict';var emlformat=require(_0xd804('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd804('0x1'));var jsonpatch=require(_0xd804('0x2'));var rp=require(_0xd804('0x3'));var moment=require('moment');var BPromise=require(_0xd804('0x4'));var Mustache=require(_0xd804('0x5'));var util=require('util');var path=require(_0xd804('0x6'));var sox=require(_0xd804('0x7'));var csv=require(_0xd804('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd804('0x9'));var _=require(_0xd804('0xa'));var squel=require(_0xd804('0xb'));var crypto=require(_0xd804('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd804('0xd'));var toCsv=require(_0xd804('0x8'));var querystring=require(_0xd804('0xe'));var Papa=require(_0xd804('0xf'));var Redis=require(_0xd804('0x10'));var authService=require(_0xd804('0x11'));var qs=require(_0xd804('0x12'));var as=require(_0xd804('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd804('0x14'));var utils=require(_0xd804('0x15'));var config=require(_0xd804('0x16'));var licenseUtil=require(_0xd804('0x17'));var db=require(_0xd804('0x18'))['db'];function respondWithStatusCode(_0x14fb96,_0x435948){_0x435948=_0x435948||0xcc;return function(_0x14af7e){if(_0x14af7e){return _0x14fb96[_0xd804('0x19')](_0x435948);}return _0x14fb96[_0xd804('0x1a')](_0x435948)[_0xd804('0x1b')]();};}function respondWithResult(_0x462567,_0x455f94){_0x455f94=_0x455f94||0xc8;return function(_0x56a44a){if(_0x56a44a){return _0x462567[_0xd804('0x1a')](_0x455f94)[_0xd804('0x1c')](_0x56a44a);}};}function respondWithFilteredResult(_0x195377,_0xa1d233){return function(_0x20aad6){if(_0x20aad6){var _0xa7648e=typeof _0xa1d233['offset']===_0xd804('0x1d')&&typeof _0xa1d233['limit']===_0xd804('0x1d');var _0x268f8f=_0x20aad6[_0xd804('0x1e')];var _0x509c7f=_0xa7648e?0x0:_0xa1d233['offset'];var _0x1faf1b=_0xa7648e?_0x20aad6[_0xd804('0x1e')]:_0xa1d233[_0xd804('0x1f')]+_0xa1d233[_0xd804('0x20')];var _0x32e0ee;if(_0x1faf1b>=_0x268f8f){_0x1faf1b=_0x268f8f;_0x32e0ee=0xc8;}else{_0x32e0ee=0xce;}_0x195377['status'](_0x32e0ee);return _0x195377['set'](_0xd804('0x21'),_0x509c7f+'-'+_0x1faf1b+'/'+_0x268f8f)['json'](_0x20aad6);}return null;};}function patchUpdates(_0x48c276){return function(_0x1b5ced){try{jsonpatch['apply'](_0x1b5ced,_0x48c276,!![]);}catch(_0x498c7d){return BPromise[_0xd804('0x22')](_0x498c7d);}return _0x1b5ced['save']();};}function saveUpdates(_0x43d56a,_0x5599fa){return function(_0x5880a8){if(_0x5880a8){return _0x5880a8[_0xd804('0x23')](_0x43d56a)[_0xd804('0x24')](function(_0x4b37ac){return _0x4b37ac;});}return null;};}function removeEntity(_0x2849a9,_0x18b686){return function(_0x2cb6ae){if(_0x2cb6ae){return _0x2cb6ae[_0xd804('0x25')]()['then'](function(){_0x2849a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x387e3f,_0x334b04){return function(_0x4e3924){if(!_0x4e3924){_0x387e3f[_0xd804('0x19')](0x194);}return _0x4e3924;};}function handleError(_0x4181c4,_0x19faff){_0x19faff=_0x19faff||0x1f4;return function(_0x372a36){logger[_0xd804('0x26')](_0x372a36['stack']);if(_0x372a36[_0xd804('0x27')]){delete _0x372a36[_0xd804('0x27')];}_0x4181c4[_0xd804('0x1a')](_0x19faff)[_0xd804('0x28')](_0x372a36);};}exports['index']=function(_0x26997b,_0x24d8c2){var _0x1d2473={},_0x15dae={},_0x4923ca={'count':0x0,'rows':[]};var _0x169e2b=_[_0xd804('0x29')](db[_0xd804('0x2a')][_0xd804('0x2b')],function(_0x39a1e0){return{'name':_0x39a1e0[_0xd804('0x2c')],'type':_0x39a1e0[_0xd804('0x2d')][_0xd804('0x2e')]};});_0x15dae['model']=_[_0xd804('0x29')](_0x169e2b,_0xd804('0x27'));_0x15dae['query']=_['keys'](_0x26997b[_0xd804('0x2f')]);_0x15dae[_0xd804('0x30')]=_['intersection'](_0x15dae[_0xd804('0x31')],_0x15dae[_0xd804('0x2f')]);_0x1d2473[_0xd804('0x32')]=_[_0xd804('0x33')](_0x15dae[_0xd804('0x31')],qs[_0xd804('0x34')](_0x26997b[_0xd804('0x2f')][_0xd804('0x34')]));_0x1d2473['attributes']=_0x1d2473[_0xd804('0x32')][_0xd804('0x35')]?_0x1d2473[_0xd804('0x32')]:_0x15dae[_0xd804('0x31')];if(!_0x26997b[_0xd804('0x2f')][_0xd804('0x36')]('nolimit')){_0x1d2473[_0xd804('0x20')]=qs[_0xd804('0x20')](_0x26997b['query'][_0xd804('0x20')]);_0x1d2473[_0xd804('0x1f')]=qs[_0xd804('0x1f')](_0x26997b[_0xd804('0x2f')][_0xd804('0x1f')]);}_0x1d2473['order']=qs[_0xd804('0x37')](_0x26997b['query'][_0xd804('0x37')]);_0x1d2473[_0xd804('0x38')]=qs[_0xd804('0x30')](_[_0xd804('0x39')](_0x26997b[_0xd804('0x2f')],_0x15dae[_0xd804('0x30')]),_0x169e2b);if(_0x26997b[_0xd804('0x2f')][_0xd804('0x3a')]){_0x1d2473['where']=_[_0xd804('0x3b')](_0x1d2473[_0xd804('0x38')],{'$or':_[_0xd804('0x29')](_0x169e2b,function(_0x10c711){if(_0x10c711['type']!==_0xd804('0x3c')){var _0x3d13e2={};_0x3d13e2[_0x10c711[_0xd804('0x27')]]={'$like':'%'+_0x26997b[_0xd804('0x2f')]['filter']+'%'};return _0x3d13e2;}})});}_0x1d2473=_[_0xd804('0x3b')]({},_0x1d2473,_0x26997b[_0xd804('0x3d')]);var _0x364a83={'where':_0x1d2473[_0xd804('0x38')]};return db[_0xd804('0x2a')][_0xd804('0x1e')](_0x364a83)[_0xd804('0x24')](function(_0xac7307){_0x4923ca['count']=_0xac7307;if(_0x26997b[_0xd804('0x2f')][_0xd804('0x3e')]){_0x1d2473['include']=[{'all':!![]}];}return db[_0xd804('0x2a')][_0xd804('0x3f')](_0x1d2473);})[_0xd804('0x24')](function(_0x6ba606){_0x4923ca['rows']=_0x6ba606;return _0x4923ca;})[_0xd804('0x24')](respondWithFilteredResult(_0x24d8c2,_0x1d2473))[_0xd804('0x40')](handleError(_0x24d8c2,null));};exports['show']=function(_0x3c6ce4,_0x437f95){var _0x2993bf={'raw':!![],'where':{'id':_0x3c6ce4['params']['id']}},_0x9fecc6={};_0x9fecc6[_0xd804('0x31')]=_[_0xd804('0x41')](db[_0xd804('0x2a')][_0xd804('0x2b')]);_0x9fecc6[_0xd804('0x2f')]=_[_0xd804('0x41')](_0x3c6ce4[_0xd804('0x2f')]);_0x9fecc6['filters']=_[_0xd804('0x33')](_0x9fecc6[_0xd804('0x31')],_0x9fecc6[_0xd804('0x2f')]);_0x2993bf['attributes']=_[_0xd804('0x33')](_0x9fecc6[_0xd804('0x31')],qs[_0xd804('0x34')](_0x3c6ce4[_0xd804('0x2f')][_0xd804('0x34')]));_0x2993bf[_0xd804('0x32')]=_0x2993bf[_0xd804('0x32')]['length']?_0x2993bf['attributes']:_0x9fecc6[_0xd804('0x31')];if(_0x3c6ce4[_0xd804('0x2f')][_0xd804('0x3e')]){_0x2993bf[_0xd804('0x42')]=[{'all':!![]}];}_0x2993bf=_[_0xd804('0x3b')]({},_0x2993bf,_0x3c6ce4[_0xd804('0x3d')]);return db['MailTransferReport'][_0xd804('0x43')](_0x2993bf)['then'](handleEntityNotFound(_0x437f95,null))[_0xd804('0x24')](respondWithResult(_0x437f95,null))[_0xd804('0x40')](handleError(_0x437f95,null));};exports[_0xd804('0x44')]=function(_0x24c9d6,_0x24ab04){return db[_0xd804('0x2a')][_0xd804('0x44')](_0x24c9d6[_0xd804('0x45')],{})[_0xd804('0x24')](respondWithResult(_0x24ab04,0xc9))[_0xd804('0x40')](handleError(_0x24ab04,null));};exports['update']=function(_0x46664e,_0x49ddd2){if(_0x46664e['body']['id']){delete _0x46664e[_0xd804('0x45')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x46664e['params']['id']}})['then'](handleEntityNotFound(_0x49ddd2,null))[_0xd804('0x24')](saveUpdates(_0x46664e['body'],null))[_0xd804('0x24')](respondWithResult(_0x49ddd2,null))[_0xd804('0x40')](handleError(_0x49ddd2,null));};exports[_0xd804('0x25')]=function(_0x261967,_0x428ede){return db['MailTransferReport'][_0xd804('0x43')]({'where':{'id':_0x261967['params']['id']}})['then'](handleEntityNotFound(_0x428ede,null))[_0xd804('0x24')](removeEntity(_0x428ede,null))[_0xd804('0x40')](handleError(_0x428ede,null));};exports[_0xd804('0x46')]=function(_0x4e1d7a,_0x575242){return db[_0xd804('0x2a')][_0xd804('0x46')]()[_0xd804('0x24')](respondWithResult(_0x575242,null))[_0xd804('0x40')](handleError(_0x575242,null));}; \ No newline at end of file +var _0x473b=['offset','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','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','undefined','limit','count'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x473b,0x113));var _0xb473=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x473b[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0xb473('0x0'));var rimraf=require(_0xb473('0x1'));var zipdir=require(_0xb473('0x2'));var jsonpatch=require(_0xb473('0x3'));var rp=require(_0xb473('0x4'));var moment=require(_0xb473('0x5'));var BPromise=require(_0xb473('0x6'));var Mustache=require(_0xb473('0x7'));var util=require(_0xb473('0x8'));var path=require(_0xb473('0x9'));var sox=require('sox');var csv=require(_0xb473('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb473('0xb'));var squel=require(_0xb473('0xc'));var crypto=require('crypto');var jsforce=require(_0xb473('0xd'));var deskjs=require(_0xb473('0xe'));var toCsv=require(_0xb473('0xa'));var querystring=require(_0xb473('0xf'));var Papa=require(_0xb473('0x10'));var Redis=require(_0xb473('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb473('0x12'));var as=require(_0xb473('0x13'));var hardwareService=require(_0xb473('0x14'));var logger=require(_0xb473('0x15'))(_0xb473('0x16'));var utils=require(_0xb473('0x17'));var config=require(_0xb473('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb473('0x19'))['db'];function respondWithStatusCode(_0x3748d7,_0x1d96d3){_0x1d96d3=_0x1d96d3||0xcc;return function(_0x396511){if(_0x396511){return _0x3748d7[_0xb473('0x1a')](_0x1d96d3);}return _0x3748d7[_0xb473('0x1b')](_0x1d96d3)[_0xb473('0x1c')]();};}function respondWithResult(_0x3e2d28,_0x241794){_0x241794=_0x241794||0xc8;return function(_0x44bea4){if(_0x44bea4){return _0x3e2d28['status'](_0x241794)[_0xb473('0x1d')](_0x44bea4);}};}function respondWithFilteredResult(_0x29d0e4,_0x201b42){return function(_0x450ac0){if(_0x450ac0){var _0x1d263f=typeof _0x201b42['offset']===_0xb473('0x1e')&&typeof _0x201b42[_0xb473('0x1f')]===_0xb473('0x1e');var _0x56b665=_0x450ac0[_0xb473('0x20')];var _0x5689cd=_0x1d263f?0x0:_0x201b42[_0xb473('0x21')];var _0x390599=_0x1d263f?_0x450ac0[_0xb473('0x20')]:_0x201b42[_0xb473('0x21')]+_0x201b42[_0xb473('0x1f')];var _0x39b078;if(_0x390599>=_0x56b665){_0x390599=_0x56b665;_0x39b078=0xc8;}else{_0x39b078=0xce;}_0x29d0e4[_0xb473('0x1b')](_0x39b078);return _0x29d0e4[_0xb473('0x22')](_0xb473('0x23'),_0x5689cd+'-'+_0x390599+'/'+_0x56b665)['json'](_0x450ac0);}return null;};}function patchUpdates(_0x46083e){return function(_0x1f942a){try{jsonpatch[_0xb473('0x24')](_0x1f942a,_0x46083e,!![]);}catch(_0x7ec891){return BPromise[_0xb473('0x25')](_0x7ec891);}return _0x1f942a['save']();};}function saveUpdates(_0x3355e3,_0x8c12b4){return function(_0x5f275c){if(_0x5f275c){return _0x5f275c[_0xb473('0x26')](_0x3355e3)[_0xb473('0x27')](function(_0x28bf23){return _0x28bf23;});}return null;};}function removeEntity(_0x219e77,_0x5ab988){return function(_0x360b34){if(_0x360b34){return _0x360b34[_0xb473('0x28')]()[_0xb473('0x27')](function(){_0x219e77[_0xb473('0x1b')](0xcc)[_0xb473('0x1c')]();});}};}function handleEntityNotFound(_0x30f117,_0x589d8d){return function(_0x144dd5){if(!_0x144dd5){_0x30f117[_0xb473('0x1a')](0x194);}return _0x144dd5;};}function handleError(_0x2eb713,_0x2ee18c){_0x2ee18c=_0x2ee18c||0x1f4;return function(_0xf6b256){logger[_0xb473('0x29')](_0xf6b256['stack']);if(_0xf6b256[_0xb473('0x2a')]){delete _0xf6b256[_0xb473('0x2a')];}_0x2eb713['status'](_0x2ee18c)['send'](_0xf6b256);};}exports[_0xb473('0x2b')]=function(_0x4dda24,_0x15ca45){var _0x281838={},_0x25bee7={},_0x30d746={'count':0x0,'rows':[]};var _0x8a8524=_[_0xb473('0x2c')](db[_0xb473('0x2d')][_0xb473('0x2e')],function(_0x4b9827){return{'name':_0x4b9827[_0xb473('0x2f')],'type':_0x4b9827[_0xb473('0x30')][_0xb473('0x31')]};});_0x25bee7['model']=_['map'](_0x8a8524,_0xb473('0x2a'));_0x25bee7[_0xb473('0x32')]=_['keys'](_0x4dda24[_0xb473('0x32')]);_0x25bee7[_0xb473('0x33')]=_[_0xb473('0x34')](_0x25bee7['model'],_0x25bee7[_0xb473('0x32')]);_0x281838[_0xb473('0x35')]=_[_0xb473('0x34')](_0x25bee7['model'],qs[_0xb473('0x36')](_0x4dda24['query'][_0xb473('0x36')]));_0x281838[_0xb473('0x35')]=_0x281838[_0xb473('0x35')]['length']?_0x281838[_0xb473('0x35')]:_0x25bee7[_0xb473('0x37')];if(!_0x4dda24[_0xb473('0x32')][_0xb473('0x38')](_0xb473('0x39'))){_0x281838[_0xb473('0x1f')]=qs[_0xb473('0x1f')](_0x4dda24[_0xb473('0x32')][_0xb473('0x1f')]);_0x281838[_0xb473('0x21')]=qs['offset'](_0x4dda24[_0xb473('0x32')][_0xb473('0x21')]);}_0x281838[_0xb473('0x3a')]=qs[_0xb473('0x3b')](_0x4dda24[_0xb473('0x32')]['sort']);_0x281838[_0xb473('0x3c')]=qs[_0xb473('0x33')](_[_0xb473('0x3d')](_0x4dda24[_0xb473('0x32')],_0x25bee7[_0xb473('0x33')]),_0x8a8524);if(_0x4dda24[_0xb473('0x32')]['filter']){_0x281838[_0xb473('0x3c')]=_[_0xb473('0x3e')](_0x281838[_0xb473('0x3c')],{'$or':_[_0xb473('0x2c')](_0x8a8524,function(_0x9b8678){if(_0x9b8678[_0xb473('0x30')]!==_0xb473('0x3f')){var _0x1ec3ec={};_0x1ec3ec[_0x9b8678[_0xb473('0x2a')]]={'$like':'%'+_0x4dda24[_0xb473('0x32')]['filter']+'%'};return _0x1ec3ec;}})});}_0x281838=_[_0xb473('0x3e')]({},_0x281838,_0x4dda24[_0xb473('0x40')]);var _0x1f8a58={'where':_0x281838[_0xb473('0x3c')]};return db['MailTransferReport']['count'](_0x1f8a58)[_0xb473('0x27')](function(_0x67fb18){_0x30d746[_0xb473('0x20')]=_0x67fb18;if(_0x4dda24[_0xb473('0x32')][_0xb473('0x41')]){_0x281838['include']=[{'all':!![]}];}return db[_0xb473('0x2d')][_0xb473('0x42')](_0x281838);})[_0xb473('0x27')](function(_0x1a0e53){_0x30d746['rows']=_0x1a0e53;return _0x30d746;})['then'](respondWithFilteredResult(_0x15ca45,_0x281838))[_0xb473('0x43')](handleError(_0x15ca45,null));};exports[_0xb473('0x44')]=function(_0x2f9172,_0x4d4d7a){var _0x4a85ba={'raw':!![],'where':{'id':_0x2f9172[_0xb473('0x45')]['id']}},_0x2a444f={};_0x2a444f[_0xb473('0x37')]=_['keys'](db[_0xb473('0x2d')][_0xb473('0x2e')]);_0x2a444f[_0xb473('0x32')]=_[_0xb473('0x46')](_0x2f9172[_0xb473('0x32')]);_0x2a444f[_0xb473('0x33')]=_['intersection'](_0x2a444f[_0xb473('0x37')],_0x2a444f[_0xb473('0x32')]);_0x4a85ba[_0xb473('0x35')]=_[_0xb473('0x34')](_0x2a444f[_0xb473('0x37')],qs[_0xb473('0x36')](_0x2f9172[_0xb473('0x32')]['fields']));_0x4a85ba[_0xb473('0x35')]=_0x4a85ba[_0xb473('0x35')][_0xb473('0x47')]?_0x4a85ba[_0xb473('0x35')]:_0x2a444f[_0xb473('0x37')];if(_0x2f9172[_0xb473('0x32')][_0xb473('0x41')]){_0x4a85ba[_0xb473('0x48')]=[{'all':!![]}];}_0x4a85ba=_[_0xb473('0x3e')]({},_0x4a85ba,_0x2f9172[_0xb473('0x40')]);return db[_0xb473('0x2d')][_0xb473('0x49')](_0x4a85ba)[_0xb473('0x27')](handleEntityNotFound(_0x4d4d7a,null))[_0xb473('0x27')](respondWithResult(_0x4d4d7a,null))[_0xb473('0x43')](handleError(_0x4d4d7a,null));};exports[_0xb473('0x4a')]=function(_0x428df0,_0xf6c01){return db[_0xb473('0x2d')]['create'](_0x428df0['body'],{})[_0xb473('0x27')](respondWithResult(_0xf6c01,0xc9))[_0xb473('0x43')](handleError(_0xf6c01,null));};exports[_0xb473('0x26')]=function(_0x49b588,_0x8f1b4a){if(_0x49b588['body']['id']){delete _0x49b588[_0xb473('0x4b')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x49b588[_0xb473('0x45')]['id']}})[_0xb473('0x27')](handleEntityNotFound(_0x8f1b4a,null))[_0xb473('0x27')](saveUpdates(_0x49b588[_0xb473('0x4b')],null))[_0xb473('0x27')](respondWithResult(_0x8f1b4a,null))['catch'](handleError(_0x8f1b4a,null));};exports[_0xb473('0x28')]=function(_0x222ebe,_0x583aeb){return db[_0xb473('0x2d')][_0xb473('0x49')]({'where':{'id':_0x222ebe[_0xb473('0x45')]['id']}})['then'](handleEntityNotFound(_0x583aeb,null))['then'](removeEntity(_0x583aeb,null))['catch'](handleError(_0x583aeb,null));};exports[_0xb473('0x4c')]=function(_0x277695,_0x2f349c){return db['MailTransferReport'][_0xb473('0x4c')]()['then'](respondWithResult(_0x2f349c,null))[_0xb473('0x43')](handleError(_0x2f349c,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index af5b0f4..e9edc5e 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 _0x1de4=['./mailTransferReport.attributes','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x44a604,_0x3403bd){var _0x2845ed=function(_0x59bd30){while(--_0x59bd30){_0x44a604['push'](_0x44a604['shift']());}};_0x2845ed(++_0x3403bd);}(_0x1de4,0x94));var _0x41de=function(_0x1eb70d,_0x2525b1){_0x1eb70d=_0x1eb70d-0x0;var _0x397c6b=_0x1de4[_0x1eb70d];return _0x397c6b;};'use strict';var _=require(_0x41de('0x0'));var util=require(_0x41de('0x1'));var logger=require(_0x41de('0x2'))(_0x41de('0x3'));var moment=require('moment');var BPromise=require(_0x41de('0x4'));var rp=require(_0x41de('0x5'));var fs=require('fs');var path=require(_0x41de('0x6'));var rimraf=require('rimraf');var config=require(_0x41de('0x7'));var attributes=require(_0x41de('0x8'));module['exports']=function(_0x2e7196,_0x122565){return _0x2e7196[_0x41de('0x9')](_0x41de('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x41de('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xadc5=['uniqueid','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer'];(function(_0x549996,_0xd04634){var _0x4de5d1=function(_0x1883a7){while(--_0x1883a7){_0x549996['push'](_0x549996['shift']());}};_0x4de5d1(++_0xd04634);}(_0xadc5,0x1bd));var _0x5adc=function(_0x16f627,_0x41b1f0){_0x16f627=_0x16f627-0x0;var _0x2bf401=_0xadc5[_0x16f627];return _0x2bf401;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5adc('0x0'))(_0x5adc('0x1'));var moment=require(_0x5adc('0x2'));var BPromise=require(_0x5adc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5adc('0x4'));var config=require(_0x5adc('0x5'));var attributes=require(_0x5adc('0x6'));module[_0x5adc('0x7')]=function(_0x68a90d,_0x2deac9){return _0x68a90d[_0x5adc('0x8')](_0x5adc('0x9'),attributes,{'tableName':_0x5adc('0xa'),'paranoid':![],'indexes':[{'name':_0x5adc('0xb'),'fields':[_0x5adc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 0e6765a..de6f18d 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 _0x1413=['then','debug','request\x20sent','error','code','MailTransferReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request'];(function(_0x46c3d2,_0x76df9c){var _0x111d9b=function(_0x13fa32){while(--_0x13fa32){_0x46c3d2['push'](_0x46c3d2['shift']());}};_0x111d9b(++_0x76df9c);}(_0x1413,0xf9));var _0x3141=function(_0x2b3c93,_0x59a5df){_0x2b3c93=_0x2b3c93-0x0;var _0x18895e=_0x1413[_0x2b3c93];return _0x18895e;};'use strict';var _=require(_0x3141('0x0'));var util=require(_0x3141('0x1'));var moment=require(_0x3141('0x2'));var BPromise=require(_0x3141('0x3'));var rs=require(_0x3141('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3141('0x5'))['db'];var utils=require(_0x3141('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3141('0x7'));var client=jayson[_0x3141('0x8')][_0x3141('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32c8dc,_0x3451c6,_0x293e54){return new BPromise(function(_0x522aa4,_0x15a1d4){return client[_0x3141('0xa')](_0x32c8dc,_0x293e54)[_0x3141('0xb')](function(_0xcdb56d){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x3451c6,'request\x20sent');logger[_0x3141('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x3451c6,_0x3141('0xd'),JSON['stringify'](_0xcdb56d));if(_0xcdb56d[_0x3141('0xe')]){if(_0xcdb56d[_0x3141('0xe')][_0x3141('0xf')]===0x1f4){logger[_0x3141('0xe')](_0x3141('0x10'),_0x3451c6,_0xcdb56d[_0x3141('0xe')][_0x3141('0x11')]);return _0x15a1d4(_0xcdb56d[_0x3141('0xe')][_0x3141('0x11')]);}logger[_0x3141('0xe')](_0x3141('0x10'),_0x3451c6,_0xcdb56d['error'][_0x3141('0x11')]);return _0x522aa4(_0xcdb56d[_0x3141('0xe')][_0x3141('0x11')]);}else{logger[_0x3141('0x12')](_0x3141('0x10'),_0x3451c6,_0x3141('0xd'));_0x522aa4(_0xcdb56d['result'][_0x3141('0x11')]);}})[_0x3141('0x13')](function(_0x398c61){logger[_0x3141('0xe')](_0x3141('0x10'),_0x3451c6,_0x398c61);_0x15a1d4(_0x398c61);});});} \ No newline at end of file +var _0xea0e=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xea0e,0x153));var _0xeea0=function(_0x48d500,_0x44e32d){_0x48d500=_0x48d500-0x0;var _0x21924b=_0xea0e[_0x48d500];return _0x21924b;};'use strict';var _=require(_0xeea0('0x0'));var util=require(_0xeea0('0x1'));var moment=require(_0xeea0('0x2'));var BPromise=require(_0xeea0('0x3'));var rs=require(_0xeea0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeea0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeea0('0x6'))(_0xeea0('0x7'));var config=require(_0xeea0('0x8'));var jayson=require(_0xeea0('0x9'));var client=jayson[_0xeea0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14c01d,_0x5b2bea,_0x562c26){return new BPromise(function(_0x222e8b,_0x20110a){return client[_0xeea0('0xb')](_0x14c01d,_0x562c26)[_0xeea0('0xc')](function(_0x3e4e7f){logger[_0xeea0('0xd')](_0xeea0('0xe'),_0x5b2bea,_0xeea0('0xf'));logger[_0xeea0('0x10')](_0xeea0('0x11'),_0x5b2bea,_0xeea0('0xf'),JSON[_0xeea0('0x12')](_0x3e4e7f));if(_0x3e4e7f['error']){if(_0x3e4e7f[_0xeea0('0x13')][_0xeea0('0x14')]===0x1f4){logger[_0xeea0('0x13')](_0xeea0('0xe'),_0x5b2bea,_0x3e4e7f[_0xeea0('0x13')][_0xeea0('0x15')]);return _0x20110a(_0x3e4e7f[_0xeea0('0x13')][_0xeea0('0x15')]);}logger[_0xeea0('0x13')](_0xeea0('0xe'),_0x5b2bea,_0x3e4e7f['error']['message']);return _0x222e8b(_0x3e4e7f[_0xeea0('0x13')][_0xeea0('0x15')]);}else{logger['info'](_0xeea0('0xe'),_0x5b2bea,_0xeea0('0xf'));_0x222e8b(_0x3e4e7f[_0xeea0('0x16')][_0xeea0('0x15')]);}})[_0xeea0('0x17')](function(_0x1dc9c8){logger[_0xeea0('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x5b2bea,_0x1dc9c8);_0x20110a(_0x1dc9c8);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 7f615d9..9856f2c 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 _0x621e=['./memberReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x21e98a,_0x4db89e){var _0x236f20=function(_0x1fe629){while(--_0x1fe629){_0x21e98a['push'](_0x21e98a['shift']());}};_0x236f20(++_0x4db89e);}(_0x621e,0x1e6));var _0xe621=function(_0x22c273,_0x427628){_0x22c273=_0x22c273-0x0;var _0x2d93d5=_0x621e[_0x22c273];return _0x2d93d5;};'use strict';var multer=require(_0xe621('0x0'));var util=require('util');var path=require(_0xe621('0x1'));var timeout=require(_0xe621('0x2'));var express=require(_0xe621('0x3'));var router=express[_0xe621('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe621('0x5'));var interaction=require(_0xe621('0x6'));var config=require('../../config/environment');var controller=require(_0xe621('0x7'));router[_0xe621('0x8')]('/',auth[_0xe621('0x9')](),controller[_0xe621('0xa')]);router[_0xe621('0x8')](_0xe621('0xb'),auth[_0xe621('0x9')](),controller['describe']);router[_0xe621('0x8')](_0xe621('0xc'),auth[_0xe621('0x9')](),controller[_0xe621('0xd')]);router['post']('/',auth[_0xe621('0x9')](),controller['create']);router[_0xe621('0xe')]('/:id',auth[_0xe621('0x9')](),controller['update']);router['delete'](_0xe621('0xc'),auth[_0xe621('0x9')](),controller[_0xe621('0xf')]);module[_0xe621('0x10')]=router; \ No newline at end of file +var _0x156c=['/:id','show','post','create','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x42fb0e,_0x55fc22){var _0x595566=function(_0x4d7e07){while(--_0x4d7e07){_0x42fb0e['push'](_0x42fb0e['shift']());}};_0x595566(++_0x55fc22);}(_0x156c,0x119));var _0xc156=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x156c[_0x2f45ea];return _0x485a84;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc156('0x0'));var timeout=require(_0xc156('0x1'));var express=require(_0xc156('0x2'));var router=express[_0xc156('0x3')]();var fs_extra=require(_0xc156('0x4'));var auth=require(_0xc156('0x5'));var interaction=require(_0xc156('0x6'));var config=require('../../config/environment');var controller=require(_0xc156('0x7'));router[_0xc156('0x8')]('/',auth[_0xc156('0x9')](),controller[_0xc156('0xa')]);router[_0xc156('0x8')](_0xc156('0xb'),auth['isAuthenticated'](),controller[_0xc156('0xc')]);router[_0xc156('0x8')](_0xc156('0xd'),auth[_0xc156('0x9')](),controller[_0xc156('0xe')]);router[_0xc156('0xf')]('/',auth[_0xc156('0x9')](),controller[_0xc156('0x10')]);router[_0xc156('0x11')](_0xc156('0xd'),auth['isAuthenticated'](),controller[_0xc156('0x12')]);router[_0xc156('0x13')](_0xc156('0xd'),auth[_0xc156('0x9')](),controller['destroy']);module[_0xc156('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index d716b9b..a2c2847 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 _0xfa2f=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','exports','STRING'];(function(_0x588f75,_0x3b7672){var _0x5a6690=function(_0x10bcd7){while(--_0x10bcd7){_0x588f75['push'](_0x588f75['shift']());}};_0x5a6690(++_0x3b7672);}(_0xfa2f,0xe8));var _0xffa2=function(_0x12c8fb,_0x30c250){_0x12c8fb=_0x12c8fb-0x0;var _0x1914e2=_0xfa2f[_0x12c8fb];return _0x1914e2;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xffa2('0x0')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xffa2('0x1')]},'interface':{'type':Sequelize[_0xffa2('0x1')]},'type':{'type':Sequelize[_0xffa2('0x1')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xffa2('0x2')},'duration':{'type':Sequelize[_0xffa2('0x3')]},'enterAt':{'type':Sequelize[_0xffa2('0x4')]},'exitAt':{'type':Sequelize[_0xffa2('0x4')],'set':function(_0x25fd81){var _0x2c7708=moment(_0x25fd81);var _0x215134=moment(this['getDataValue']('enterAt'));var _0x34cf1b=_0x2c7708[_0xffa2('0x5')](_0x215134,_0xffa2('0x6'));this[_0xffa2('0x7')](_0xffa2('0x8'),_0x25fd81);this[_0xffa2('0x7')](_0xffa2('0x9'),_0x34cf1b||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xffa2('0xa')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xffa2('0x1')],'comment':_0xffa2('0xb')},'data4':{'type':Sequelize[_0xffa2('0x1')],'comment':_0xffa2('0xc')},'data5':{'type':Sequelize[_0xffa2('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xffa2('0x1')]},'internal':{'type':Sequelize[_0xffa2('0x3')]},'uniqueid':{'type':Sequelize[_0xffa2('0x1')]}}; \ No newline at end of file +var _0x45ea=['sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]'];(function(_0x2dcb05,_0x4b9009){var _0x2a9e37=function(_0x119f68){while(--_0x119f68){_0x2dcb05['push'](_0x2dcb05['shift']());}};_0x2a9e37(++_0x4b9009);}(_0x45ea,0x1f0));var _0xa45e=function(_0x48e04f,_0xd2c4ed){_0x48e04f=_0x48e04f-0x0;var _0x179759=_0x45ea[_0x48e04f];return _0x179759;};'use strict';var Sequelize=require(_0xa45e('0x0'));var moment=require(_0xa45e('0x1'));module[_0xa45e('0x2')]={'channel':{'type':Sequelize[_0xa45e('0x3')]},'membername':{'type':Sequelize[_0xa45e('0x3')]},'interface':{'type':Sequelize[_0xa45e('0x3')]},'type':{'type':Sequelize[_0xa45e('0x3')],'defaultValue':_0xa45e('0x4'),'comment':_0xa45e('0x5')},'duration':{'type':Sequelize[_0xa45e('0x6')]},'enterAt':{'type':Sequelize[_0xa45e('0x7')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x418a41){var _0x3ee60d=moment(_0x418a41);var _0x573ff8=moment(this['getDataValue']('enterAt'));var _0x40befe=_0x3ee60d[_0xa45e('0x8')](_0x573ff8,_0xa45e('0x9'));this[_0xa45e('0xa')](_0xa45e('0xb'),_0x418a41);this['setDataValue']('duration',_0x40befe||null);}},'data1':{'type':Sequelize[_0xa45e('0x3')],'comment':_0xa45e('0xc')},'data2':{'type':Sequelize[_0xa45e('0x3')],'comment':_0xa45e('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0xa45e('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0xa45e('0xf')},'data5':{'type':Sequelize[_0xa45e('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xa45e('0x6')]},'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 e81dc7d..fff8cd7 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(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x34e8,0x12c));var _0x834e=function(_0x56f52a,_0x303af2){_0x56f52a=_0x56f52a-0x0;var _0x3eac6d=_0x34e8[_0x56f52a];return _0x3eac6d;};'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 _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(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x34e8,0x12c));var _0x834e=function(_0x3c1df5,_0x5817df){_0x3c1df5=_0x3c1df5-0x0;var _0x2cc53b=_0x34e8[_0x3c1df5];return _0x2cc53b;};'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 diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 8dbeb88..d5a71e8 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 _0x1e6a=['define','MemberReport','report_member','membername_interface','membername','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x4167fa,_0x5e417c){var _0x2e393b=function(_0x3d3214){while(--_0x3d3214){_0x4167fa['push'](_0x4167fa['shift']());}};_0x2e393b(++_0x5e417c);}(_0x1e6a,0x135));var _0xa1e6=function(_0x4a1eef,_0x401f06){_0x4a1eef=_0x4a1eef-0x0;var _0x2cdbb1=_0x1e6a[_0x4a1eef];return _0x2cdbb1;};'use strict';var _=require(_0xa1e6('0x0'));var util=require('util');var logger=require(_0xa1e6('0x1'))(_0xa1e6('0x2'));var moment=require(_0xa1e6('0x3'));var BPromise=require(_0xa1e6('0x4'));var rp=require(_0xa1e6('0x5'));var fs=require('fs');var path=require(_0xa1e6('0x6'));var rimraf=require(_0xa1e6('0x7'));var config=require(_0xa1e6('0x8'));var attributes=require(_0xa1e6('0x9'));module[_0xa1e6('0xa')]=function(_0x44d497,_0x53aec2){return _0x44d497[_0xa1e6('0xb')](_0xa1e6('0xc'),attributes,{'tableName':_0xa1e6('0xd'),'paranoid':![],'indexes':[{'name':_0xa1e6('0xe'),'fields':[_0xa1e6('0xf'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9137=['moment','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','util','../../config/logger'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x9137,0x15d));var _0x7913=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0x9137[_0x21c6b8];return _0x39d474;};'use strict';var _=require('lodash');var util=require(_0x7913('0x0'));var logger=require(_0x7913('0x1'))('api');var moment=require(_0x7913('0x2'));var BPromise=require('bluebird');var rp=require(_0x7913('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7913('0x4'));var config=require(_0x7913('0x5'));var attributes=require(_0x7913('0x6'));module[_0x7913('0x7')]=function(_0x5aa240,_0x586799){return _0x5aa240[_0x7913('0x8')](_0x7913('0x9'),attributes,{'tableName':_0x7913('0xa'),'paranoid':![],'indexes':[{'name':_0x7913('0xb'),'fields':[_0x7913('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index fa510ba..84736b0 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 _0x806b=['request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','MemberReport,\x20%s,\x20%s','message','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','model','debug','catch','CreateMemberReport','body','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x301f7c,_0x462f8b){var _0xc05c41=function(_0x20e539){while(--_0x20e539){_0x301f7c['push'](_0x301f7c['shift']());}};_0xc05c41(++_0x462f8b);}(_0x806b,0x163));var _0xb806=function(_0x3f5443,_0x501b0b){_0x3f5443=_0x3f5443-0x0;var _0x45c9f0=_0x806b[_0x3f5443];return _0x45c9f0;};'use strict';var _=require(_0xb806('0x0'));var util=require(_0xb806('0x1'));var moment=require(_0xb806('0x2'));var BPromise=require(_0xb806('0x3'));var rs=require(_0xb806('0x4'));var fs=require('fs');var Redis=require(_0xb806('0x5'));var db=require(_0xb806('0x6'))['db'];var utils=require(_0xb806('0x7'));var logger=require('../../config/logger')(_0xb806('0x8'));var config=require(_0xb806('0x9'));var jayson=require(_0xb806('0xa'));var client=jayson[_0xb806('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9b2858,_0x46050f,_0x4fdc38){return new BPromise(function(_0x3525e8,_0x116ef4){return client[_0xb806('0xc')](_0x9b2858,_0x4fdc38)[_0xb806('0xd')](function(_0x5511f4){logger[_0xb806('0xe')]('MemberReport,\x20%s,\x20%s',_0x46050f,_0xb806('0xf'));logger['debug'](_0xb806('0x10'),_0x46050f,'request\x20sent',JSON[_0xb806('0x11')](_0x5511f4));if(_0x5511f4[_0xb806('0x12')]){if(_0x5511f4[_0xb806('0x12')]['code']===0x1f4){logger[_0xb806('0x12')](_0xb806('0x13'),_0x46050f,_0x5511f4['error'][_0xb806('0x14')]);return _0x116ef4(_0x5511f4[_0xb806('0x12')]['message']);}logger[_0xb806('0x12')](_0xb806('0x13'),_0x46050f,_0x5511f4['error'][_0xb806('0x14')]);return _0x3525e8(_0x5511f4[_0xb806('0x12')][_0xb806('0x14')]);}else{logger[_0xb806('0xe')](_0xb806('0x13'),_0x46050f,'request\x20sent');_0x3525e8(_0x5511f4['result'][_0xb806('0x14')]);}})['catch'](function(_0x131447){logger[_0xb806('0x12')](_0xb806('0x13'),_0x46050f,_0x131447);_0x116ef4(_0x131447);});});}exports[_0xb806('0x15')]=function(_0x5375c1){var _0x40635c=this;return new Promise(function(_0x1e17d2,_0x269e2b){return db[_0xb806('0x16')][_0xb806('0x17')]({'raw':_0x5375c1[_0xb806('0x18')]?_0x5375c1['options'][_0xb806('0x19')]===undefined?!![]:![]:!![],'where':_0x5375c1[_0xb806('0x18')]?_0x5375c1['options'][_0xb806('0x1a')]||null:null,'attributes':_0x5375c1[_0xb806('0x18')]?_0x5375c1[_0xb806('0x18')][_0xb806('0x1b')]||null:null,'limit':_0x5375c1['options']?_0x5375c1[_0xb806('0x18')][_0xb806('0x1c')]||null:null,'include':_0x5375c1[_0xb806('0x18')]?_0x5375c1['options']['include']?_[_0xb806('0x1d')](_0x5375c1[_0xb806('0x18')]['include'],function(_0x570837){return{'model':db[_0x570837['model']],'as':_0x570837['as'],'attributes':_0x570837[_0xb806('0x1b')],'include':_0x570837['include']?_['map'](_0x570837[_0xb806('0x1e')],function(_0x3c4556){return{'model':db[_0x3c4556[_0xb806('0x1f')]],'as':_0x3c4556['as'],'attributes':_0x3c4556[_0xb806('0x1b')],'include':_0x3c4556[_0xb806('0x1e')]?_[_0xb806('0x1d')](_0x3c4556[_0xb806('0x1e')],function(_0xcd8bb7){return{'model':db[_0xcd8bb7[_0xb806('0x1f')]],'as':_0xcd8bb7['as'],'attributes':_0xcd8bb7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x481826){logger['info'](_0xb806('0x15'),_0x5375c1);logger[_0xb806('0x20')]('GetMemberReport',_0x5375c1,JSON[_0xb806('0x11')](_0x481826));_0x1e17d2(_0x481826);})[_0xb806('0x21')](function(_0x34d9e1){logger['error'](_0xb806('0x15'),_0x34d9e1[_0xb806('0x14')],_0x5375c1);_0x269e2b(_0x40635c['error'](0x1f4,_0x34d9e1[_0xb806('0x14')]));});});};exports[_0xb806('0x22')]=function(_0x249ec5){var _0x4471c5=this;return new Promise(function(_0x4342bf,_0xb24e1c){return db[_0xb806('0x16')]['create'](_0x249ec5[_0xb806('0x23')],{'raw':_0x249ec5[_0xb806('0x18')]?_0x249ec5[_0xb806('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xb806('0xd')](function(_0x28aecf){logger['info'](_0xb806('0x22'),_0x249ec5);logger['debug'](_0xb806('0x22'),_0x249ec5,JSON[_0xb806('0x11')](_0x28aecf));_0x4342bf(_0x28aecf);})[_0xb806('0x21')](function(_0x2fa01e){logger[_0xb806('0x12')]('CreateMemberReport',_0x2fa01e[_0xb806('0x14')],_0x249ec5);_0xb24e1c(_0x4471c5[_0xb806('0x12')](0x1f4,_0x2fa01e[_0xb806('0x14')]));});});};exports[_0xb806('0x24')]=function(_0x38c579){var _0x15e4e6=this;return new Promise(function(_0x287c56,_0x65645a){return db[_0xb806('0x16')]['update'](_0x38c579[_0xb806('0x23')],{'raw':_0x38c579[_0xb806('0x18')]?_0x38c579[_0xb806('0x18')][_0xb806('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38c579[_0xb806('0x18')]?_0x38c579[_0xb806('0x18')][_0xb806('0x1a')]||null:null,'attributes':_0x38c579[_0xb806('0x18')]?_0x38c579[_0xb806('0x18')]['attributes']||null:null,'limit':_0x38c579[_0xb806('0x18')]?_0x38c579[_0xb806('0x18')][_0xb806('0x1c')]||null:null})[_0xb806('0xd')](function(_0x8b4ac2){logger[_0xb806('0xe')](_0xb806('0x24'),_0x38c579);logger[_0xb806('0x20')](_0xb806('0x24'),_0x38c579,JSON[_0xb806('0x11')](_0x8b4ac2));_0x287c56(_0x8b4ac2);})[_0xb806('0x21')](function(_0xb21b08){logger[_0xb806('0x12')](_0xb806('0x24'),_0xb21b08[_0xb806('0x14')],_0x38c579);_0x65645a(_0x15e4e6['error'](0x1f4,_0xb21b08[_0xb806('0x14')]));});});}; \ No newline at end of file +var _0x1c3b=['findAll','options','raw','where','attributes','limit','map','model','include','then','stringify','CreateMemberReport','update','body','UpdateMemberReport','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMemberReport','MemberReport'];(function(_0x2340c8,_0x976df8){var _0x2892e0=function(_0x3334cb){while(--_0x3334cb){_0x2340c8['push'](_0x2340c8['shift']());}};_0x2892e0(++_0x976df8);}(_0x1c3b,0xab));var _0xb1c3=function(_0x9a3822,_0x2eba4d){_0x9a3822=_0x9a3822-0x0;var _0x26fed2=_0x1c3b[_0x9a3822];return _0x26fed2;};'use strict';var _=require(_0xb1c3('0x0'));var util=require(_0xb1c3('0x1'));var moment=require(_0xb1c3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1c3('0x3'));var db=require(_0xb1c3('0x4'))['db'];var utils=require(_0xb1c3('0x5'));var logger=require(_0xb1c3('0x6'))(_0xb1c3('0x7'));var config=require(_0xb1c3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb1c3('0x9')][_0xb1c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x211254,_0x4c26fd,_0x504fc9){return new BPromise(function(_0x4ed6cf,_0x5f1df6){return client[_0xb1c3('0xb')](_0x211254,_0x504fc9)['then'](function(_0x2879c2){logger[_0xb1c3('0xc')](_0xb1c3('0xd'),_0x4c26fd,'request\x20sent');logger[_0xb1c3('0xe')](_0xb1c3('0xf'),_0x4c26fd,_0xb1c3('0x10'),JSON['stringify'](_0x2879c2));if(_0x2879c2[_0xb1c3('0x11')]){if(_0x2879c2[_0xb1c3('0x11')][_0xb1c3('0x12')]===0x1f4){logger[_0xb1c3('0x11')]('MemberReport,\x20%s,\x20%s',_0x4c26fd,_0x2879c2[_0xb1c3('0x11')][_0xb1c3('0x13')]);return _0x5f1df6(_0x2879c2[_0xb1c3('0x11')]['message']);}logger[_0xb1c3('0x11')](_0xb1c3('0xd'),_0x4c26fd,_0x2879c2['error'][_0xb1c3('0x13')]);return _0x4ed6cf(_0x2879c2[_0xb1c3('0x11')][_0xb1c3('0x13')]);}else{logger[_0xb1c3('0xc')](_0xb1c3('0xd'),_0x4c26fd,'request\x20sent');_0x4ed6cf(_0x2879c2[_0xb1c3('0x14')][_0xb1c3('0x13')]);}})[_0xb1c3('0x15')](function(_0x41b0fb){logger[_0xb1c3('0x11')]('MemberReport,\x20%s,\x20%s',_0x4c26fd,_0x41b0fb);_0x5f1df6(_0x41b0fb);});});}exports[_0xb1c3('0x16')]=function(_0x2bdeed){var _0x1313a8=this;return new Promise(function(_0x36b25f,_0x1bb2e4){return db[_0xb1c3('0x17')][_0xb1c3('0x18')]({'raw':_0x2bdeed[_0xb1c3('0x19')]?_0x2bdeed[_0xb1c3('0x19')][_0xb1c3('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bdeed[_0xb1c3('0x19')]?_0x2bdeed[_0xb1c3('0x19')][_0xb1c3('0x1b')]||null:null,'attributes':_0x2bdeed['options']?_0x2bdeed[_0xb1c3('0x19')][_0xb1c3('0x1c')]||null:null,'limit':_0x2bdeed[_0xb1c3('0x19')]?_0x2bdeed[_0xb1c3('0x19')][_0xb1c3('0x1d')]||null:null,'include':_0x2bdeed[_0xb1c3('0x19')]?_0x2bdeed['options']['include']?_[_0xb1c3('0x1e')](_0x2bdeed[_0xb1c3('0x19')]['include'],function(_0xdb96){return{'model':db[_0xdb96[_0xb1c3('0x1f')]],'as':_0xdb96['as'],'attributes':_0xdb96[_0xb1c3('0x1c')],'include':_0xdb96[_0xb1c3('0x20')]?_['map'](_0xdb96[_0xb1c3('0x20')],function(_0x1cefff){return{'model':db[_0x1cefff[_0xb1c3('0x1f')]],'as':_0x1cefff['as'],'attributes':_0x1cefff[_0xb1c3('0x1c')],'include':_0x1cefff[_0xb1c3('0x20')]?_['map'](_0x1cefff[_0xb1c3('0x20')],function(_0xc6c566){return{'model':db[_0xc6c566[_0xb1c3('0x1f')]],'as':_0xc6c566['as'],'attributes':_0xc6c566[_0xb1c3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb1c3('0x21')](function(_0x17f9e7){logger[_0xb1c3('0xc')](_0xb1c3('0x16'),_0x2bdeed);logger[_0xb1c3('0xe')](_0xb1c3('0x16'),_0x2bdeed,JSON[_0xb1c3('0x22')](_0x17f9e7));_0x36b25f(_0x17f9e7);})[_0xb1c3('0x15')](function(_0x11eb58){logger['error'](_0xb1c3('0x16'),_0x11eb58['message'],_0x2bdeed);_0x1bb2e4(_0x1313a8[_0xb1c3('0x11')](0x1f4,_0x11eb58['message']));});});};exports[_0xb1c3('0x23')]=function(_0x2d6ae7){var _0x194f94=this;return new Promise(function(_0x2714a7,_0x375b03){return db[_0xb1c3('0x17')]['create'](_0x2d6ae7['body'],{'raw':_0x2d6ae7[_0xb1c3('0x19')]?_0x2d6ae7[_0xb1c3('0x19')][_0xb1c3('0x1a')]===undefined?!![]:![]:!![]})[_0xb1c3('0x21')](function(_0x1f22b2){logger[_0xb1c3('0xc')](_0xb1c3('0x23'),_0x2d6ae7);logger['debug'](_0xb1c3('0x23'),_0x2d6ae7,JSON['stringify'](_0x1f22b2));_0x2714a7(_0x1f22b2);})[_0xb1c3('0x15')](function(_0x106e06){logger['error'](_0xb1c3('0x23'),_0x106e06[_0xb1c3('0x13')],_0x2d6ae7);_0x375b03(_0x194f94[_0xb1c3('0x11')](0x1f4,_0x106e06[_0xb1c3('0x13')]));});});};exports['UpdateMemberReport']=function(_0x417372){var _0xc28b8=this;return new Promise(function(_0x2ca797,_0x450ddb){return db[_0xb1c3('0x17')][_0xb1c3('0x24')](_0x417372[_0xb1c3('0x25')],{'raw':_0x417372[_0xb1c3('0x19')]?_0x417372[_0xb1c3('0x19')][_0xb1c3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x417372[_0xb1c3('0x19')]?_0x417372[_0xb1c3('0x19')]['where']||null:null,'attributes':_0x417372[_0xb1c3('0x19')]?_0x417372[_0xb1c3('0x19')]['attributes']||null:null,'limit':_0x417372[_0xb1c3('0x19')]?_0x417372[_0xb1c3('0x19')][_0xb1c3('0x1d')]||null:null})[_0xb1c3('0x21')](function(_0x465328){logger[_0xb1c3('0xc')](_0xb1c3('0x26'),_0x417372);logger[_0xb1c3('0xe')]('UpdateMemberReport',_0x417372,JSON[_0xb1c3('0x22')](_0x465328));_0x2ca797(_0x465328);})[_0xb1c3('0x15')](function(_0x157488){logger['error']('UpdateMemberReport',_0x157488[_0xb1c3('0x13')],_0x417372);_0x450ddb(_0xc28b8[_0xb1c3('0x11')](0x1f4,_0x157488['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 479b2c5..e786fb4 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 _0xc61a=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x4e35ed,_0x466703){var _0x3d8462=function(_0x2d50b1){while(--_0x2d50b1){_0x4e35ed['push'](_0x4e35ed['shift']());}};_0x3d8462(++_0x466703);}(_0xc61a,0x6e));var _0xac61=function(_0x363319,_0x4fa1a1){_0x363319=_0x363319-0x0;var _0x182a62=_0xc61a[_0x363319];return _0x182a62;};'use strict';var multer=require('multer');var util=require(_0xac61('0x0'));var path=require(_0xac61('0x1'));var timeout=require(_0xac61('0x2'));var express=require(_0xac61('0x3'));var router=express[_0xac61('0x4')]();var fs_extra=require(_0xac61('0x5'));var auth=require(_0xac61('0x6'));var interaction=require(_0xac61('0x7'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0xac61('0x8')]('/',controller[_0xac61('0x9')]);module['exports']=router; \ No newline at end of file +var _0x09da=['index','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller'];(function(_0x21ed98,_0x4a4209){var _0x4012bf=function(_0x46a9df){while(--_0x46a9df){_0x21ed98['push'](_0x21ed98['shift']());}};_0x4012bf(++_0x4a4209);}(_0x09da,0xf4));var _0xa09d=function(_0x5cd9a0,_0x144f70){_0x5cd9a0=_0x5cd9a0-0x0;var _0x1a3eec=_0x09da[_0x5cd9a0];return _0x1a3eec;};'use strict';var multer=require('multer');var util=require(_0xa09d('0x0'));var path=require(_0xa09d('0x1'));var timeout=require(_0xa09d('0x2'));var express=require(_0xa09d('0x3'));var router=express[_0xa09d('0x4')]();var fs_extra=require(_0xa09d('0x5'));var auth=require(_0xa09d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa09d('0x7'));var controller=require(_0xa09d('0x8'));router['get']('/',controller[_0xa09d('0x9')]);module[_0xa09d('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 70fec6a..889ccb1 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 _0x8176=['sequelize','exports','version'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x8176,0x9c));var _0x6817=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x8176[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x6817('0x0'));module[_0x6817('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x6817('0x2')}}; \ No newline at end of file +var _0x166f=['exports','STRING','version'];(function(_0x9227eb,_0xac2a5e){var _0x33f484=function(_0x3b8147){while(--_0x3b8147){_0x9227eb['push'](_0x9227eb['shift']());}};_0x33f484(++_0xac2a5e);}(_0x166f,0x102));var _0xf166=function(_0x553c18,_0x27b54b){_0x553c18=_0x553c18-0x0;var _0xa9bc7f=_0x166f[_0x553c18];return _0xa9bc7f;};'use strict';var Sequelize=require('sequelize');module[_0xf166('0x0')]={'version':{'type':Sequelize[_0xf166('0x1')],'unique':_0xf166('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 3602944..59afbe4 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 _0x1236=['destroy','error','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Migration','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','save','update','then'];(function(_0x3872af,_0x40ac0b){var _0x305e8d=function(_0xca492c){while(--_0xca492c){_0x3872af['push'](_0x3872af['shift']());}};_0x305e8d(++_0x40ac0b);}(_0x1236,0xab));var _0x6123=function(_0x49350e,_0x5c6395){_0x49350e=_0x49350e-0x0;var _0x478afa=_0x1236[_0x49350e];return _0x478afa;};'use strict';var emlformat=require(_0x6123('0x0'));var rimraf=require(_0x6123('0x1'));var zipdir=require(_0x6123('0x2'));var jsonpatch=require(_0x6123('0x3'));var rp=require(_0x6123('0x4'));var moment=require('moment');var BPromise=require(_0x6123('0x5'));var Mustache=require(_0x6123('0x6'));var util=require(_0x6123('0x7'));var path=require('path');var sox=require(_0x6123('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6123('0x9'));var _=require(_0x6123('0xa'));var squel=require(_0x6123('0xb'));var crypto=require(_0x6123('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6123('0xd'));var querystring=require(_0x6123('0xe'));var Papa=require('papaparse');var Redis=require(_0x6123('0xf'));var authService=require(_0x6123('0x10'));var qs=require(_0x6123('0x11'));var as=require(_0x6123('0x12'));var hardwareService=require(_0x6123('0x13'));var logger=require(_0x6123('0x14'))(_0x6123('0x15'));var utils=require(_0x6123('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6123('0x17'))['db'];function respondWithStatusCode(_0x2242c0,_0x3623f2){_0x3623f2=_0x3623f2||0xcc;return function(_0x2d363d){if(_0x2d363d){return _0x2242c0[_0x6123('0x18')](_0x3623f2);}return _0x2242c0['status'](_0x3623f2)[_0x6123('0x19')]();};}function respondWithResult(_0x28a090,_0x1157f5){_0x1157f5=_0x1157f5||0xc8;return function(_0x95b668){if(_0x95b668){return _0x28a090[_0x6123('0x1a')](_0x1157f5)['json'](_0x95b668);}};}function respondWithFilteredResult(_0x3d7d39,_0x121513){return function(_0x45dd02){if(_0x45dd02){var _0x4e7d0b=typeof _0x121513[_0x6123('0x1b')]==='undefined'&&typeof _0x121513['limit']===_0x6123('0x1c');var _0x38f9dd=_0x45dd02[_0x6123('0x1d')];var _0x132b96=_0x4e7d0b?0x0:_0x121513[_0x6123('0x1b')];var _0x2ec117=_0x4e7d0b?_0x45dd02['count']:_0x121513[_0x6123('0x1b')]+_0x121513['limit'];var _0x43211e;if(_0x2ec117>=_0x38f9dd){_0x2ec117=_0x38f9dd;_0x43211e=0xc8;}else{_0x43211e=0xce;}_0x3d7d39['status'](_0x43211e);return _0x3d7d39[_0x6123('0x1e')]('Content-Range',_0x132b96+'-'+_0x2ec117+'/'+_0x38f9dd)[_0x6123('0x1f')](_0x45dd02);}return null;};}function patchUpdates(_0x3cb4b4){return function(_0x5c0e0e){try{jsonpatch[_0x6123('0x20')](_0x5c0e0e,_0x3cb4b4,!![]);}catch(_0x4198de){return BPromise['reject'](_0x4198de);}return _0x5c0e0e[_0x6123('0x21')]();};}function saveUpdates(_0x800091,_0x5593f9){return function(_0x580b4d){if(_0x580b4d){return _0x580b4d[_0x6123('0x22')](_0x800091)[_0x6123('0x23')](function(_0x1b77e9){return _0x1b77e9;});}return null;};}function removeEntity(_0x13a82d,_0x22721c){return function(_0x5c9ac0){if(_0x5c9ac0){return _0x5c9ac0[_0x6123('0x24')]()[_0x6123('0x23')](function(){_0x13a82d[_0x6123('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c57c,_0x1f1be6){return function(_0x102504){if(!_0x102504){_0x40c57c[_0x6123('0x18')](0x194);}return _0x102504;};}function handleError(_0x38d578,_0x2d3b74){_0x2d3b74=_0x2d3b74||0x1f4;return function(_0x247a77){logger[_0x6123('0x25')](_0x247a77['stack']);if(_0x247a77['name']){delete _0x247a77[_0x6123('0x26')];}_0x38d578[_0x6123('0x1a')](_0x2d3b74)['send'](_0x247a77);};}exports[_0x6123('0x27')]=function(_0x15353f,_0x4d26d7){var _0x23804d={},_0xee599e={},_0x2a8e20={'count':0x0,'rows':[]};var _0x7f7b7d=_[_0x6123('0x28')](db['Migration'][_0x6123('0x29')],function(_0x3b9f63){return{'name':_0x3b9f63[_0x6123('0x2a')],'type':_0x3b9f63['type'][_0x6123('0x2b')]};});_0xee599e['model']=_['map'](_0x7f7b7d,_0x6123('0x26'));_0xee599e[_0x6123('0x2c')]=_[_0x6123('0x2d')](_0x15353f[_0x6123('0x2c')]);_0xee599e[_0x6123('0x2e')]=_[_0x6123('0x2f')](_0xee599e[_0x6123('0x30')],_0xee599e[_0x6123('0x2c')]);_0x23804d['attributes']=_['intersection'](_0xee599e['model'],qs[_0x6123('0x31')](_0x15353f['query'][_0x6123('0x31')]));_0x23804d[_0x6123('0x32')]=_0x23804d['attributes'][_0x6123('0x33')]?_0x23804d[_0x6123('0x32')]:_0xee599e[_0x6123('0x30')];if(!_0x15353f[_0x6123('0x2c')][_0x6123('0x34')](_0x6123('0x35'))){_0x23804d[_0x6123('0x36')]=qs[_0x6123('0x36')](_0x15353f[_0x6123('0x2c')][_0x6123('0x36')]);_0x23804d[_0x6123('0x1b')]=qs[_0x6123('0x1b')](_0x15353f[_0x6123('0x2c')][_0x6123('0x1b')]);}_0x23804d[_0x6123('0x37')]=qs['sort'](_0x15353f[_0x6123('0x2c')][_0x6123('0x38')]);_0x23804d[_0x6123('0x39')]=qs[_0x6123('0x2e')](_[_0x6123('0x3a')](_0x15353f[_0x6123('0x2c')],_0xee599e[_0x6123('0x2e')]),_0x7f7b7d);if(_0x15353f['query'][_0x6123('0x3b')]){_0x23804d[_0x6123('0x39')]=_[_0x6123('0x3c')](_0x23804d[_0x6123('0x39')],{'$or':_[_0x6123('0x28')](_0x7f7b7d,function(_0x4ad0da){if(_0x4ad0da['type']!==_0x6123('0x3d')){var _0x2a3f84={};_0x2a3f84[_0x4ad0da[_0x6123('0x26')]]={'$like':'%'+_0x15353f['query'][_0x6123('0x3b')]+'%'};return _0x2a3f84;}})});}_0x23804d=_[_0x6123('0x3c')]({},_0x23804d,_0x15353f[_0x6123('0x3e')]);var _0x2f6794={'where':_0x23804d[_0x6123('0x39')]};return db[_0x6123('0x3f')][_0x6123('0x1d')](_0x2f6794)[_0x6123('0x23')](function(_0x5dfb3f){_0x2a8e20[_0x6123('0x1d')]=_0x5dfb3f;if(_0x15353f['query'][_0x6123('0x40')]){_0x23804d[_0x6123('0x41')]=[{'all':!![]}];}return db['Migration'][_0x6123('0x42')](_0x23804d);})[_0x6123('0x23')](function(_0xcbaea7){_0x2a8e20[_0x6123('0x43')]=_0xcbaea7;return _0x2a8e20;})[_0x6123('0x23')](respondWithFilteredResult(_0x4d26d7,_0x23804d))[_0x6123('0x44')](handleError(_0x4d26d7,null));}; \ No newline at end of file +var _0x6894=['path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','error','name','send','index','Migration','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','options','includeAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6894,0x13d));var _0x4689=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x6894[_0x2112d4];return _0x434972;};'use strict';var emlformat=require(_0x4689('0x0'));var rimraf=require(_0x4689('0x1'));var zipdir=require(_0x4689('0x2'));var jsonpatch=require(_0x4689('0x3'));var rp=require(_0x4689('0x4'));var moment=require(_0x4689('0x5'));var BPromise=require(_0x4689('0x6'));var Mustache=require('mustache');var util=require(_0x4689('0x7'));var path=require(_0x4689('0x8'));var sox=require(_0x4689('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4689('0xa'));var _=require(_0x4689('0xb'));var squel=require('squel');var crypto=require(_0x4689('0xc'));var jsforce=require(_0x4689('0xd'));var deskjs=require(_0x4689('0xe'));var toCsv=require(_0x4689('0xf'));var querystring=require(_0x4689('0x10'));var Papa=require(_0x4689('0x11'));var Redis=require(_0x4689('0x12'));var authService=require(_0x4689('0x13'));var qs=require(_0x4689('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4689('0x15'));var config=require(_0x4689('0x16'));var licenseUtil=require(_0x4689('0x17'));var db=require(_0x4689('0x18'))['db'];function respondWithStatusCode(_0x530b09,_0x31437a){_0x31437a=_0x31437a||0xcc;return function(_0xdba35d){if(_0xdba35d){return _0x530b09[_0x4689('0x19')](_0x31437a);}return _0x530b09[_0x4689('0x1a')](_0x31437a)[_0x4689('0x1b')]();};}function respondWithResult(_0x4afce7,_0xdd4afe){_0xdd4afe=_0xdd4afe||0xc8;return function(_0x30fdf9){if(_0x30fdf9){return _0x4afce7['status'](_0xdd4afe)[_0x4689('0x1c')](_0x30fdf9);}};}function respondWithFilteredResult(_0x19e2be,_0x44b089){return function(_0x410c03){if(_0x410c03){var _0x38b320=typeof _0x44b089[_0x4689('0x1d')]===_0x4689('0x1e')&&typeof _0x44b089[_0x4689('0x1f')]===_0x4689('0x1e');var _0x44f534=_0x410c03[_0x4689('0x20')];var _0x112f9d=_0x38b320?0x0:_0x44b089[_0x4689('0x1d')];var _0xa5d406=_0x38b320?_0x410c03[_0x4689('0x20')]:_0x44b089[_0x4689('0x1d')]+_0x44b089[_0x4689('0x1f')];var _0x1bd08d;if(_0xa5d406>=_0x44f534){_0xa5d406=_0x44f534;_0x1bd08d=0xc8;}else{_0x1bd08d=0xce;}_0x19e2be['status'](_0x1bd08d);return _0x19e2be[_0x4689('0x21')]('Content-Range',_0x112f9d+'-'+_0xa5d406+'/'+_0x44f534)[_0x4689('0x1c')](_0x410c03);}return null;};}function patchUpdates(_0x3f2415){return function(_0x5e0579){try{jsonpatch[_0x4689('0x22')](_0x5e0579,_0x3f2415,!![]);}catch(_0x3c9aec){return BPromise[_0x4689('0x23')](_0x3c9aec);}return _0x5e0579['save']();};}function saveUpdates(_0x35e625,_0x32ed08){return function(_0x6e8898){if(_0x6e8898){return _0x6e8898[_0x4689('0x24')](_0x35e625)['then'](function(_0x4b11d9){return _0x4b11d9;});}return null;};}function removeEntity(_0x48c864,_0x1f5ecb){return function(_0x217b09){if(_0x217b09){return _0x217b09[_0x4689('0x25')]()[_0x4689('0x26')](function(){_0x48c864['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x147efc,_0x531f05){return function(_0x466c9b){if(!_0x466c9b){_0x147efc[_0x4689('0x19')](0x194);}return _0x466c9b;};}function handleError(_0x443db3,_0x135ec5){_0x135ec5=_0x135ec5||0x1f4;return function(_0x407efa){logger[_0x4689('0x27')](_0x407efa['stack']);if(_0x407efa[_0x4689('0x28')]){delete _0x407efa['name'];}_0x443db3[_0x4689('0x1a')](_0x135ec5)[_0x4689('0x29')](_0x407efa);};}exports[_0x4689('0x2a')]=function(_0xbfcdc1,_0x4fdfc9){var _0x460a1b={},_0x3db207={},_0x8f09ef={'count':0x0,'rows':[]};var _0x5b139c=_['map'](db[_0x4689('0x2b')]['rawAttributes'],function(_0x50a35c){return{'name':_0x50a35c[_0x4689('0x2c')],'type':_0x50a35c[_0x4689('0x2d')][_0x4689('0x2e')]};});_0x3db207[_0x4689('0x2f')]=_['map'](_0x5b139c,_0x4689('0x28'));_0x3db207[_0x4689('0x30')]=_['keys'](_0xbfcdc1[_0x4689('0x30')]);_0x3db207['filters']=_['intersection'](_0x3db207[_0x4689('0x2f')],_0x3db207[_0x4689('0x30')]);_0x460a1b['attributes']=_[_0x4689('0x31')](_0x3db207[_0x4689('0x2f')],qs[_0x4689('0x32')](_0xbfcdc1['query'][_0x4689('0x32')]));_0x460a1b[_0x4689('0x33')]=_0x460a1b['attributes']['length']?_0x460a1b['attributes']:_0x3db207[_0x4689('0x2f')];if(!_0xbfcdc1['query'][_0x4689('0x34')]('nolimit')){_0x460a1b[_0x4689('0x1f')]=qs['limit'](_0xbfcdc1[_0x4689('0x30')][_0x4689('0x1f')]);_0x460a1b[_0x4689('0x1d')]=qs[_0x4689('0x1d')](_0xbfcdc1[_0x4689('0x30')][_0x4689('0x1d')]);}_0x460a1b[_0x4689('0x35')]=qs[_0x4689('0x36')](_0xbfcdc1[_0x4689('0x30')][_0x4689('0x36')]);_0x460a1b[_0x4689('0x37')]=qs[_0x4689('0x38')](_[_0x4689('0x39')](_0xbfcdc1[_0x4689('0x30')],_0x3db207[_0x4689('0x38')]),_0x5b139c);if(_0xbfcdc1[_0x4689('0x30')][_0x4689('0x3a')]){_0x460a1b['where']=_[_0x4689('0x3b')](_0x460a1b['where'],{'$or':_[_0x4689('0x3c')](_0x5b139c,function(_0x8f17fc){if(_0x8f17fc[_0x4689('0x2d')]!=='VIRTUAL'){var _0x319897={};_0x319897[_0x8f17fc['name']]={'$like':'%'+_0xbfcdc1[_0x4689('0x30')][_0x4689('0x3a')]+'%'};return _0x319897;}})});}_0x460a1b=_[_0x4689('0x3b')]({},_0x460a1b,_0xbfcdc1[_0x4689('0x3d')]);var _0x554130={'where':_0x460a1b[_0x4689('0x37')]};return db[_0x4689('0x2b')][_0x4689('0x20')](_0x554130)[_0x4689('0x26')](function(_0x429772){_0x8f09ef[_0x4689('0x20')]=_0x429772;if(_0xbfcdc1['query'][_0x4689('0x3e')]){_0x460a1b['include']=[{'all':!![]}];}return db[_0x4689('0x2b')]['findAll'](_0x460a1b);})[_0x4689('0x26')](function(_0x46ec0b){_0x8f09ef[_0x4689('0x3f')]=_0x46ec0b;return _0x8f09ef;})['then'](respondWithFilteredResult(_0x4fdfc9,_0x460a1b))[_0x4689('0x40')](handleError(_0x4fdfc9,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 91c3f8e..f8f2cae 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 _0xd5d2=['./migration.attributes','exports','Migration','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x343f71,_0x5a8ab4){var _0x387ea5=function(_0xfd575f){while(--_0xfd575f){_0x343f71['push'](_0x343f71['shift']());}};_0x387ea5(++_0x5a8ab4);}(_0xd5d2,0x1dc));var _0x2d5d=function(_0x164059,_0xa3c4ca){_0x164059=_0x164059-0x0;var _0x816457=_0xd5d2[_0x164059];return _0x816457;};'use strict';var _=require(_0x2d5d('0x0'));var util=require(_0x2d5d('0x1'));var logger=require('../../config/logger')(_0x2d5d('0x2'));var moment=require(_0x2d5d('0x3'));var BPromise=require(_0x2d5d('0x4'));var rp=require(_0x2d5d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d5d('0x6'));var config=require(_0x2d5d('0x7'));var attributes=require(_0x2d5d('0x8'));module[_0x2d5d('0x9')]=function(_0x49ed35,_0x95e023){return _0x49ed35['define'](_0x2d5d('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ce0=['rimraf','../../config/environment','./migration.attributes','exports','define','migrations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1d043f,_0x334dae){var _0x1c65d2=function(_0x530e95){while(--_0x530e95){_0x1d043f['push'](_0x1d043f['shift']());}};_0x1c65d2(++_0x334dae);}(_0x0ce0,0x14a));var _0x00ce=function(_0x2d486b,_0x5f213c){_0x2d486b=_0x2d486b-0x0;var _0x4291d1=_0x0ce0[_0x2d486b];return _0x4291d1;};'use strict';var _=require(_0x00ce('0x0'));var util=require(_0x00ce('0x1'));var logger=require(_0x00ce('0x2'))(_0x00ce('0x3'));var moment=require('moment');var BPromise=require(_0x00ce('0x4'));var rp=require(_0x00ce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00ce('0x6'));var config=require(_0x00ce('0x7'));var attributes=require(_0x00ce('0x8'));module[_0x00ce('0x9')]=function(_0x1638b5,_0x1f81c4){return _0x1638b5[_0x00ce('0xa')]('Migration',attributes,{'tableName':_0x00ce('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 52e4f62..86f5987 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 _0x8eeb=['http','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1ccdae,_0x385fb6){var _0x1e804e=function(_0x1ef978){while(--_0x1ef978){_0x1ccdae['push'](_0x1ccdae['shift']());}};_0x1e804e(++_0x385fb6);}(_0x8eeb,0x183));var _0xb8ee=function(_0x33ba1f,_0x442df1){_0x33ba1f=_0x33ba1f-0x0;var _0x2ff306=_0x8eeb[_0x33ba1f];return _0x2ff306;};'use strict';var _=require(_0xb8ee('0x0'));var util=require('util');var moment=require(_0xb8ee('0x1'));var BPromise=require(_0xb8ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8ee('0x3'));var db=require(_0xb8ee('0x4'))['db'];var utils=require(_0xb8ee('0x5'));var logger=require(_0xb8ee('0x6'))(_0xb8ee('0x7'));var config=require('../../config/environment');var jayson=require(_0xb8ee('0x8'));var client=jayson['client'][_0xb8ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30dff7,_0x430b38,_0x469393){return new BPromise(function(_0x4e2428,_0x27243c){return client[_0xb8ee('0xa')](_0x30dff7,_0x469393)[_0xb8ee('0xb')](function(_0x5ea3ab){logger[_0xb8ee('0xc')]('Migration,\x20%s,\x20%s',_0x430b38,_0xb8ee('0xd'));logger[_0xb8ee('0xe')](_0xb8ee('0xf'),_0x430b38,_0xb8ee('0xd'),JSON[_0xb8ee('0x10')](_0x5ea3ab));if(_0x5ea3ab[_0xb8ee('0x11')]){if(_0x5ea3ab[_0xb8ee('0x11')][_0xb8ee('0x12')]===0x1f4){logger['error'](_0xb8ee('0x13'),_0x430b38,_0x5ea3ab[_0xb8ee('0x11')][_0xb8ee('0x14')]);return _0x27243c(_0x5ea3ab[_0xb8ee('0x11')][_0xb8ee('0x14')]);}logger[_0xb8ee('0x11')]('Migration,\x20%s,\x20%s',_0x430b38,_0x5ea3ab[_0xb8ee('0x11')][_0xb8ee('0x14')]);return _0x4e2428(_0x5ea3ab[_0xb8ee('0x11')][_0xb8ee('0x14')]);}else{logger[_0xb8ee('0xc')](_0xb8ee('0x13'),_0x430b38,_0xb8ee('0xd'));_0x4e2428(_0x5ea3ab[_0xb8ee('0x15')][_0xb8ee('0x14')]);}})['catch'](function(_0x135d5d){logger['error']('Migration,\x20%s,\x20%s',_0x430b38,_0x135d5d);_0x27243c(_0x135d5d);});});} \ No newline at end of file +var _0x3189=['../../config/environment','jayson/promise','http','then','info','Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x44781c,_0x30688f){var _0x5ece97=function(_0x33a68c){while(--_0x33a68c){_0x44781c['push'](_0x44781c['shift']());}};_0x5ece97(++_0x30688f);}(_0x3189,0xae));var _0x9318=function(_0x299267,_0x34c247){_0x299267=_0x299267-0x0;var _0x3392b0=_0x3189[_0x299267];return _0x3392b0;};'use strict';var _=require(_0x9318('0x0'));var util=require(_0x9318('0x1'));var moment=require('moment');var BPromise=require(_0x9318('0x2'));var rs=require(_0x9318('0x3'));var fs=require('fs');var Redis=require(_0x9318('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9318('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9318('0x6'));var jayson=require(_0x9318('0x7'));var client=jayson['client'][_0x9318('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bb3c3,_0x4dbe95,_0x2f6831){return new BPromise(function(_0x324307,_0x1bfed6){return client['request'](_0x4bb3c3,_0x2f6831)[_0x9318('0x9')](function(_0x2e8d1c){logger[_0x9318('0xa')](_0x9318('0xb'),_0x4dbe95,'request\x20sent');logger['debug'](_0x9318('0xc'),_0x4dbe95,'request\x20sent',JSON[_0x9318('0xd')](_0x2e8d1c));if(_0x2e8d1c[_0x9318('0xe')]){if(_0x2e8d1c[_0x9318('0xe')]['code']===0x1f4){logger[_0x9318('0xe')]('Migration,\x20%s,\x20%s',_0x4dbe95,_0x2e8d1c['error'][_0x9318('0xf')]);return _0x1bfed6(_0x2e8d1c['error'][_0x9318('0xf')]);}logger[_0x9318('0xe')]('Migration,\x20%s,\x20%s',_0x4dbe95,_0x2e8d1c[_0x9318('0xe')][_0x9318('0xf')]);return _0x324307(_0x2e8d1c[_0x9318('0xe')]['message']);}else{logger['info'](_0x9318('0xb'),_0x4dbe95,_0x9318('0x10'));_0x324307(_0x2e8d1c['result'][_0x9318('0xf')]);}})[_0x9318('0x11')](function(_0x5e1238){logger[_0x9318('0xe')](_0x9318('0xb'),_0x4dbe95,_0x5e1238);_0x1bfed6(_0x5e1238);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3c9a8e4..e9b675c 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 _0x29b1=['show','post','put','update','destroy','util','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','/:id'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0x29b1,0xbb));var _0x129b=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x29b1[_0x580576];return _0x3f55a0;};'use strict';var multer=require('multer');var util=require(_0x129b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x129b('0x1')]();var fs_extra=require(_0x129b('0x2'));var auth=require(_0x129b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x129b('0x4'));var controller=require(_0x129b('0x5'));router[_0x129b('0x6')]('/',auth[_0x129b('0x7')](),controller['index']);router[_0x129b('0x6')](_0x129b('0x8'),auth[_0x129b('0x7')](),controller[_0x129b('0x9')]);router[_0x129b('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x129b('0xb')](_0x129b('0x8'),auth['isAuthenticated'](),controller[_0x129b('0xc')]);router['delete'](_0x129b('0x8'),auth['isAuthenticated'](),controller[_0x129b('0xd')]);module['exports']=router; \ No newline at end of file +var _0x1c23=['../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','show','post','create','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x1c23,0x1d5));var _0x31c2=function(_0x3c5e02,_0x223581){_0x3c5e02=_0x3c5e02-0x0;var _0x351027=_0x1c23[_0x3c5e02];return _0x351027;};'use strict';var multer=require(_0x31c2('0x0'));var util=require(_0x31c2('0x1'));var path=require(_0x31c2('0x2'));var timeout=require(_0x31c2('0x3'));var express=require(_0x31c2('0x4'));var router=express[_0x31c2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x31c2('0x6'));var interaction=require(_0x31c2('0x7'));var config=require('../../config/environment');var controller=require(_0x31c2('0x8'));router[_0x31c2('0x9')]('/',auth[_0x31c2('0xa')](),controller[_0x31c2('0xb')]);router[_0x31c2('0x9')]('/:id',auth[_0x31c2('0xa')](),controller[_0x31c2('0xc')]);router[_0x31c2('0xd')]('/',auth[_0x31c2('0xa')](),controller[_0x31c2('0xe')]);router['put']('/:id',auth[_0x31c2('0xa')](),controller[_0x31c2('0xf')]);router[_0x31c2('0x10')](_0x31c2('0x11'),auth[_0x31c2('0xa')](),controller[_0x31c2('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index bb943d2..a5b009c 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 _0x9e4e=['exports','ENUM','localnet','externip','stun','turn','STRING'];(function(_0x5b1b8c,_0x3f9cfb){var _0x4d04ff=function(_0xd133c7){while(--_0xd133c7){_0x5b1b8c['push'](_0x5b1b8c['shift']());}};_0x4d04ff(++_0x3f9cfb);}(_0x9e4e,0x111));var _0xe9e4=function(_0x16b1b8,_0x432d03){_0x16b1b8=_0x16b1b8-0x0;var _0x558b1e=_0x9e4e[_0x16b1b8];return _0x558b1e;};'use strict';var Sequelize=require('sequelize');module[_0xe9e4('0x0')]={'type':{'type':Sequelize[_0xe9e4('0x1')](_0xe9e4('0x2'),_0xe9e4('0x3'),_0xe9e4('0x4'),_0xe9e4('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe9e4('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8ce0=['exports','ENUM','localnet','externip','turn','STRING','sequelize'];(function(_0x3bf55c,_0x5966f6){var _0x16d47d=function(_0x2a14cd){while(--_0x2a14cd){_0x3bf55c['push'](_0x3bf55c['shift']());}};_0x16d47d(++_0x5966f6);}(_0x8ce0,0x16b));var _0x08ce=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8ce0[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x08ce('0x0'));module[_0x08ce('0x1')]={'type':{'type':Sequelize[_0x08ce('0x2')](_0x08ce('0x3'),_0x08ce('0x4'),'stun',_0x08ce('0x5'))},'value':{'type':Sequelize[_0x08ce('0x6')]},'username':{'type':Sequelize[_0x08ce('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 1102d38..8f8ec69 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 _0xbac8=['bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','end','offset','undefined','limit','status','Content-Range','json','apply','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','Network','findAll','show','params','keys','find','create','sequelize','transaction','body','toUpperCase','STUN','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','join','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/stun_xcally.conf','eml-format','rimraf','request-promise','moment'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xbac8,0x140));var _0x8bac=function(_0xc55977,_0x44c740){_0xc55977=_0xc55977-0x0;var _0x574f1c=_0xbac8[_0xc55977];return _0x574f1c;};'use strict';var emlformat=require(_0x8bac('0x0'));var rimraf=require(_0x8bac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8bac('0x2'));var moment=require(_0x8bac('0x3'));var BPromise=require(_0x8bac('0x4'));var Mustache=require('mustache');var util=require(_0x8bac('0x5'));var path=require(_0x8bac('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8bac('0x7'));var fs=require('fs');var fs_extra=require(_0x8bac('0x8'));var _=require(_0x8bac('0x9'));var squel=require(_0x8bac('0xa'));var crypto=require(_0x8bac('0xb'));var jsforce=require(_0x8bac('0xc'));var deskjs=require(_0x8bac('0xd'));var toCsv=require(_0x8bac('0xe'));var querystring=require(_0x8bac('0xf'));var Papa=require('papaparse');var Redis=require(_0x8bac('0x10'));var authService=require(_0x8bac('0x11'));var qs=require(_0x8bac('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8bac('0x13'));var logger=require('../../config/logger')(_0x8bac('0x14'));var utils=require(_0x8bac('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8bac('0x16'));var db=require(_0x8bac('0x17'))['db'];var jayson=require(_0x8bac('0x18'));var client=jayson[_0x8bac('0x19')][_0x8bac('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5bc586,_0x4e571a,_0x318c69,_0x442c66){return new BPromise(function(_0x4deb09,_0x45170a){var _0x5264ad=_0x442c66||client;return _0x5264ad['request'](_0x5bc586,_0x318c69)[_0x8bac('0x1b')](function(_0x371006){logger[_0x8bac('0x1c')](_0x8bac('0x1d'),_0x4e571a,_0x8bac('0x1e'));logger[_0x8bac('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0x4e571a,'request\x20sent',JSON[_0x8bac('0x20')](_0x371006));if(_0x371006['error']){if(_0x371006['error'][_0x8bac('0x21')]===0x1f4){logger[_0x8bac('0x22')](_0x8bac('0x1d'),_0x4e571a,_0x371006[_0x8bac('0x22')][_0x8bac('0x23')]);return _0x45170a(_0x371006[_0x8bac('0x22')]['message']);}logger[_0x8bac('0x22')](_0x8bac('0x1d'),_0x4e571a,_0x371006[_0x8bac('0x22')][_0x8bac('0x23')]);return _0x4deb09(_0x371006[_0x8bac('0x22')][_0x8bac('0x23')]);}else{logger[_0x8bac('0x1c')](_0x8bac('0x1d'),_0x4e571a,'request\x20sent');_0x4deb09(_0x371006[_0x8bac('0x24')]['message']);}})[_0x8bac('0x25')](function(_0x521fdb){logger[_0x8bac('0x22')](_0x8bac('0x1d'),_0x4e571a,_0x521fdb);_0x45170a(_0x521fdb);});});}function respondWithStatusCode(_0x576824,_0x41fc20){_0x41fc20=_0x41fc20||0xcc;return function(_0x15f893){if(_0x15f893){return _0x576824[_0x8bac('0x26')](_0x41fc20);}return _0x576824['status'](_0x41fc20)[_0x8bac('0x27')]();};}function respondWithResult(_0x5353fa,_0x30916b){_0x30916b=_0x30916b||0xc8;return function(_0x565a22){if(_0x565a22){return _0x5353fa['status'](_0x30916b)['json'](_0x565a22);}};}function respondWithFilteredResult(_0x3db974,_0x2edf9c){return function(_0xaedf36){if(_0xaedf36){var _0x383e5d=typeof _0x2edf9c[_0x8bac('0x28')]===_0x8bac('0x29')&&typeof _0x2edf9c['limit']===_0x8bac('0x29');var _0x2285d0=_0xaedf36['count'];var _0x3c9fd3=_0x383e5d?0x0:_0x2edf9c[_0x8bac('0x28')];var _0x2bb6fe=_0x383e5d?_0xaedf36['count']:_0x2edf9c[_0x8bac('0x28')]+_0x2edf9c[_0x8bac('0x2a')];var _0x86bd5f;if(_0x2bb6fe>=_0x2285d0){_0x2bb6fe=_0x2285d0;_0x86bd5f=0xc8;}else{_0x86bd5f=0xce;}_0x3db974[_0x8bac('0x2b')](_0x86bd5f);return _0x3db974['set'](_0x8bac('0x2c'),_0x3c9fd3+'-'+_0x2bb6fe+'/'+_0x2285d0)[_0x8bac('0x2d')](_0xaedf36);}return null;};}function patchUpdates(_0x5795d1){return function(_0x5c3ad1){try{jsonpatch[_0x8bac('0x2e')](_0x5c3ad1,_0x5795d1,!![]);}catch(_0x58b61d){return BPromise['reject'](_0x58b61d);}return _0x5c3ad1[_0x8bac('0x2f')]();};}function saveUpdates(_0x1d8b89,_0x3a3071){return function(_0x5ca5be){if(_0x5ca5be){return _0x5ca5be[_0x8bac('0x30')](_0x1d8b89)[_0x8bac('0x1b')](function(_0x176d4e){return _0x176d4e;});}return null;};}function removeEntity(_0x586ea1,_0x478aba){return function(_0x9f77be){if(_0x9f77be){return _0x9f77be[_0x8bac('0x31')]()[_0x8bac('0x1b')](function(){_0x586ea1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5856bb,_0x156c45){return function(_0x515178){if(!_0x515178){_0x5856bb[_0x8bac('0x26')](0x194);}return _0x515178;};}function handleError(_0x42da1c,_0x212406){_0x212406=_0x212406||0x1f4;return function(_0x1c028e){logger[_0x8bac('0x22')](_0x1c028e[_0x8bac('0x32')]);if(_0x1c028e['name']){delete _0x1c028e[_0x8bac('0x33')];}_0x42da1c[_0x8bac('0x2b')](_0x212406)[_0x8bac('0x34')](_0x1c028e);};}exports[_0x8bac('0x35')]=function(_0x2d0aa8,_0x26691f){var _0x39c2dc={},_0x3a817e={},_0x5acaab={'count':0x0,'rows':[]};var _0x2b3652=_[_0x8bac('0x36')](db['Network'][_0x8bac('0x37')],function(_0x322aae){return{'name':_0x322aae[_0x8bac('0x38')],'type':_0x322aae[_0x8bac('0x39')][_0x8bac('0x3a')]};});_0x3a817e[_0x8bac('0x3b')]=_[_0x8bac('0x36')](_0x2b3652,'name');_0x3a817e['query']=_['keys'](_0x2d0aa8[_0x8bac('0x3c')]);_0x3a817e[_0x8bac('0x3d')]=_['intersection'](_0x3a817e[_0x8bac('0x3b')],_0x3a817e[_0x8bac('0x3c')]);_0x39c2dc[_0x8bac('0x3e')]=_[_0x8bac('0x3f')](_0x3a817e[_0x8bac('0x3b')],qs[_0x8bac('0x40')](_0x2d0aa8['query'][_0x8bac('0x40')]));_0x39c2dc[_0x8bac('0x3e')]=_0x39c2dc['attributes'][_0x8bac('0x41')]?_0x39c2dc['attributes']:_0x3a817e['model'];if(!_0x2d0aa8[_0x8bac('0x3c')][_0x8bac('0x42')](_0x8bac('0x43'))){_0x39c2dc[_0x8bac('0x2a')]=qs[_0x8bac('0x2a')](_0x2d0aa8[_0x8bac('0x3c')][_0x8bac('0x2a')]);_0x39c2dc['offset']=qs[_0x8bac('0x28')](_0x2d0aa8['query']['offset']);}_0x39c2dc[_0x8bac('0x44')]=qs[_0x8bac('0x45')](_0x2d0aa8[_0x8bac('0x3c')]['sort']);_0x39c2dc[_0x8bac('0x46')]=qs[_0x8bac('0x3d')](_[_0x8bac('0x47')](_0x2d0aa8['query'],_0x3a817e[_0x8bac('0x3d')]),_0x2b3652);if(_0x2d0aa8[_0x8bac('0x3c')][_0x8bac('0x48')]){_0x39c2dc[_0x8bac('0x46')]=_['merge'](_0x39c2dc[_0x8bac('0x46')],{'$or':_[_0x8bac('0x36')](_0x2b3652,function(_0x5c8702){if(_0x5c8702[_0x8bac('0x39')]!=='VIRTUAL'){var _0x1c50cd={};_0x1c50cd[_0x5c8702[_0x8bac('0x33')]]={'$like':'%'+_0x2d0aa8[_0x8bac('0x3c')][_0x8bac('0x48')]+'%'};return _0x1c50cd;}})});}_0x39c2dc=_[_0x8bac('0x49')]({},_0x39c2dc,_0x2d0aa8[_0x8bac('0x4a')]);var _0x4eef82={'where':_0x39c2dc[_0x8bac('0x46')]};return db['Network'][_0x8bac('0x4b')](_0x4eef82)[_0x8bac('0x1b')](function(_0x36daae){_0x5acaab[_0x8bac('0x4b')]=_0x36daae;if(_0x2d0aa8['query'][_0x8bac('0x4c')]){_0x39c2dc[_0x8bac('0x4d')]=[{'all':!![]}];}return db[_0x8bac('0x4e')][_0x8bac('0x4f')](_0x39c2dc);})[_0x8bac('0x1b')](function(_0xa67c62){_0x5acaab['rows']=_0xa67c62;return _0x5acaab;})[_0x8bac('0x1b')](respondWithFilteredResult(_0x26691f,_0x39c2dc))[_0x8bac('0x25')](handleError(_0x26691f,null));};exports[_0x8bac('0x50')]=function(_0x32fc00,_0x5e770d){var _0x3c02c0={'raw':!![],'where':{'id':_0x32fc00[_0x8bac('0x51')]['id']}},_0x5f40ce={};_0x5f40ce[_0x8bac('0x3b')]=_['keys'](db[_0x8bac('0x4e')][_0x8bac('0x37')]);_0x5f40ce['query']=_[_0x8bac('0x52')](_0x32fc00[_0x8bac('0x3c')]);_0x5f40ce[_0x8bac('0x3d')]=_['intersection'](_0x5f40ce['model'],_0x5f40ce[_0x8bac('0x3c')]);_0x3c02c0[_0x8bac('0x3e')]=_['intersection'](_0x5f40ce[_0x8bac('0x3b')],qs[_0x8bac('0x40')](_0x32fc00[_0x8bac('0x3c')][_0x8bac('0x40')]));_0x3c02c0[_0x8bac('0x3e')]=_0x3c02c0[_0x8bac('0x3e')][_0x8bac('0x41')]?_0x3c02c0[_0x8bac('0x3e')]:_0x5f40ce[_0x8bac('0x3b')];if(_0x32fc00['query'][_0x8bac('0x4c')]){_0x3c02c0[_0x8bac('0x4d')]=[{'all':!![]}];}_0x3c02c0=_[_0x8bac('0x49')]({},_0x3c02c0,_0x32fc00[_0x8bac('0x4a')]);return db[_0x8bac('0x4e')][_0x8bac('0x53')](_0x3c02c0)[_0x8bac('0x1b')](handleEntityNotFound(_0x5e770d,null))[_0x8bac('0x1b')](respondWithResult(_0x5e770d,null))[_0x8bac('0x25')](handleError(_0x5e770d,null));};exports[_0x8bac('0x54')]=function(_0x358167,_0xe9b919,_0x28a1d9){var _0x16a950;return db[_0x8bac('0x55')][_0x8bac('0x56')](function(_0x3fe7d4){return db['Network'][_0x8bac('0x54')](_0x358167[_0x8bac('0x57')],{'raw':!![]})[_0x8bac('0x1b')](function(_0x3c85ba){_0x16a950=_0x3c85ba;return db[_0x8bac('0x4e')]['findAll']({'where':{'type':_0x358167[_0x8bac('0x57')]['type']},'raw':!![]});})['then'](function(_0x18e80d){if(_0x16a950[_0x8bac('0x39')][_0x8bac('0x58')]()==_0x8bac('0x59')){var _0x4fd443=fs['readFileSync'](path['join'](config[_0x8bac('0x5a')],_0x8bac('0x5b')),_0x8bac('0x5c'));var _0x3d4b8f=ejs[_0x8bac('0x5d')](_0x4fd443,{'networks':_0x18e80d||[]});fs[_0x8bac('0x5e')]('/etc/asterisk/stun_xcally.conf',_0x3d4b8f);return respondWithRpcPromise('Reload',_0x8bac('0x54'),{'module':_0x8bac('0x5f')});}else if(_0x16a950[_0x8bac('0x39')]['toUpperCase']()==_0x8bac('0x60')){var _0x29fb21=fs[_0x8bac('0x61')](path['join'](config['root'],_0x8bac('0x62')),_0x8bac('0x5c'));var _0x265fb9=ejs[_0x8bac('0x5d')](_0x29fb21,{'networks':_0x18e80d||[]});fs[_0x8bac('0x5e')](_0x8bac('0x63'),_0x265fb9);return respondWithRpcPromise(_0x8bac('0x64'),_0x8bac('0x54'),{'module':'res_stun_monitor.so'});}else{var _0x291fbf=fs[_0x8bac('0x61')](path[_0x8bac('0x65')](config['root'],_0x8bac('0x66')),_0x8bac('0x5c'));var _0x1de5e9=ejs[_0x8bac('0x5d')](_0x291fbf,{'networks':_0x18e80d||[]});fs[_0x8bac('0x5e')](util[_0x8bac('0x67')](_0x8bac('0x68'),_0x358167[_0x8bac('0x57')][_0x8bac('0x39')][_0x8bac('0x69')]()),_0x1de5e9);return respondWithRpcPromise(_0x8bac('0x64'),_0x8bac('0x54'),{'module':_0x8bac('0x6a')});}return null;})[_0x8bac('0x1b')](function(){return _0x16a950;});})[_0x8bac('0x1b')](respondWithResult(_0xe9b919,0xc9))['catch'](handleError(_0xe9b919,null));};exports[_0x8bac('0x30')]=function(_0x540832,_0x4dddc5,_0x211854){var _0x25cf42;return db[_0x8bac('0x55')][_0x8bac('0x56')](function(_0x25c33d){return db[_0x8bac('0x4e')][_0x8bac('0x53')]({'where':{'id':_0x540832[_0x8bac('0x51')]['id']}})['then'](handleEntityNotFound(_0x4dddc5,null))[_0x8bac('0x1b')](saveUpdates(_0x540832[_0x8bac('0x57')],null))[_0x8bac('0x1b')](function(_0x12e8f5){if(_0x12e8f5){_0x25cf42=_0x12e8f5;return db[_0x8bac('0x4e')][_0x8bac('0x4f')]({'where':{'type':_0x25cf42[_0x8bac('0x39')]},'raw':!![]});}return null;})[_0x8bac('0x1b')](function(_0x5a3014){if(_0x25cf42[_0x8bac('0x39')][_0x8bac('0x58')]()==_0x8bac('0x59')){var _0x33d1df=fs['readFileSync'](path['join'](config[_0x8bac('0x5a')],_0x8bac('0x5b')),'utf8');var _0xb238ca=ejs[_0x8bac('0x5d')](_0x33d1df,{'networks':_0x5a3014||[]});fs[_0x8bac('0x5e')](_0x8bac('0x6b'),_0xb238ca);return respondWithRpcPromise(_0x8bac('0x64'),_0x8bac('0x30'),{'module':_0x8bac('0x5f')});}else if(_0x25cf42[_0x8bac('0x39')][_0x8bac('0x58')]()==_0x8bac('0x60')){var _0x28552c=fs[_0x8bac('0x61')](path['join'](config['root'],_0x8bac('0x62')),'utf8');var _0x1c4caa=ejs[_0x8bac('0x5d')](_0x28552c,{'networks':_0x5a3014||[]});fs[_0x8bac('0x5e')](_0x8bac('0x63'),_0x1c4caa);return respondWithRpcPromise(_0x8bac('0x64'),'update',{'module':_0x8bac('0x5f')});}else{var _0x5e7c44=fs['readFileSync'](path[_0x8bac('0x65')](config[_0x8bac('0x5a')],_0x8bac('0x66')),_0x8bac('0x5c'));var _0xa64d34=ejs[_0x8bac('0x5d')](_0x5e7c44,{'networks':_0x5a3014||[]});fs[_0x8bac('0x5e')](util[_0x8bac('0x67')](_0x8bac('0x68'),_0x540832[_0x8bac('0x57')][_0x8bac('0x39')][_0x8bac('0x69')]()),_0xa64d34);return respondWithRpcPromise(_0x8bac('0x64'),'update',{'module':'chan_sip.so'});}return null;})[_0x8bac('0x1b')](function(_0x3e9566){if(_0x3e9566){return _0x25cf42;}return null;});})['then'](respondWithResult(_0x4dddc5,null))[_0x8bac('0x25')](handleError(_0x4dddc5,null));};exports[_0x8bac('0x31')]=function(_0x4b7ce7,_0x37c595,_0x1b98bd){var _0x13e3e4;return db[_0x8bac('0x4e')]['find']({'where':{'id':_0x4b7ce7[_0x8bac('0x51')]['id']}})[_0x8bac('0x1b')](function(_0x3352e7){_0x13e3e4=_0x3352e7;return _0x3352e7;})[_0x8bac('0x1b')](handleEntityNotFound(_0x37c595,null))[_0x8bac('0x1b')](removeEntity(_0x37c595,null))[_0x8bac('0x1b')](function(){if(_0x13e3e4){return db[_0x8bac('0x4e')][_0x8bac('0x4f')]({'where':{'type':_0x13e3e4['type']},'raw':!![]});}})[_0x8bac('0x1b')](function(_0x43fa36){if(_0x13e3e4[_0x8bac('0x39')]['toUpperCase']()==_0x8bac('0x59')){var _0x499a24=fs[_0x8bac('0x61')](path[_0x8bac('0x65')](config[_0x8bac('0x5a')],_0x8bac('0x5b')),_0x8bac('0x5c'));var _0x4592ad=ejs[_0x8bac('0x5d')](_0x499a24,{'networks':_0x43fa36||[]});fs[_0x8bac('0x5e')](_0x8bac('0x6b'),_0x4592ad);return respondWithRpcPromise('Reload',_0x8bac('0x31'),{'module':_0x8bac('0x5f')});}else if(_0x13e3e4['type'][_0x8bac('0x58')]()==_0x8bac('0x60')){var _0x1b0d67=fs['readFileSync'](path[_0x8bac('0x65')](config[_0x8bac('0x5a')],_0x8bac('0x62')),_0x8bac('0x5c'));var _0x47a3bb=ejs[_0x8bac('0x5d')](_0x1b0d67,{'networks':_0x43fa36||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x47a3bb);return respondWithRpcPromise(_0x8bac('0x64'),_0x8bac('0x31'),{'module':_0x8bac('0x5f')});}else{var _0x46b0ae=fs['readFileSync'](path[_0x8bac('0x65')](config[_0x8bac('0x5a')],'server/files/templates/network.ejs'),'utf8');var _0x51f1c6=ejs[_0x8bac('0x5d')](_0x46b0ae,{'networks':_0x43fa36||[]});fs['writeFileSync'](util[_0x8bac('0x67')](_0x8bac('0x68'),_0x4b7ce7[_0x8bac('0x57')][_0x8bac('0x39')][_0x8bac('0x69')]()),_0x51f1c6);return respondWithRpcPromise(_0x8bac('0x64'),_0x8bac('0x31'),{'module':_0x8bac('0x6a')});}return null;})[_0x8bac('0x25')](handleError(_0x37c595,null));}; \ No newline at end of file +var _0xc698=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','then','Network,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','end','status','json','offset','limit','count','Content-Range','apply','save','update','destroy','sendStatus','map','Network','type','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','render','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','server/files/templates/stun_multiple.ejs','TURN','/etc/asterisk/turn_xcally.conf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x3fee84,_0x3063bb){var _0x40db4a=function(_0x5976fe){while(--_0x5976fe){_0x3fee84['push'](_0x3fee84['shift']());}};_0x40db4a(++_0x3063bb);}(_0xc698,0x116));var _0x8c69=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0xc698[_0x11a55c];return _0x26c390;};'use strict';var emlformat=require(_0x8c69('0x0'));var rimraf=require(_0x8c69('0x1'));var zipdir=require(_0x8c69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c69('0x3'));var moment=require(_0x8c69('0x4'));var BPromise=require(_0x8c69('0x5'));var Mustache=require('mustache');var util=require(_0x8c69('0x6'));var path=require('path');var sox=require(_0x8c69('0x7'));var csv=require(_0x8c69('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8c69('0x9'));var squel=require(_0x8c69('0xa'));var crypto=require(_0x8c69('0xb'));var jsforce=require(_0x8c69('0xc'));var deskjs=require(_0x8c69('0xd'));var toCsv=require(_0x8c69('0x8'));var querystring=require(_0x8c69('0xe'));var Papa=require(_0x8c69('0xf'));var Redis=require(_0x8c69('0x10'));var authService=require(_0x8c69('0x11'));var qs=require(_0x8c69('0x12'));var as=require(_0x8c69('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c69('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x8c69('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c69('0x16'))['db'];var jayson=require(_0x8c69('0x17'));var client=jayson['client'][_0x8c69('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xf601dd,_0x512367,_0x3c30ac,_0x50fceb){return new BPromise(function(_0x46fe8b,_0x1b8825){var _0x4d9cf8=_0x50fceb||client;return _0x4d9cf8['request'](_0xf601dd,_0x3c30ac)[_0x8c69('0x19')](function(_0x4f9ad8){logger['info'](_0x8c69('0x1a'),_0x512367,'request\x20sent');logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x512367,_0x8c69('0x1b'),JSON[_0x8c69('0x1c')](_0x4f9ad8));if(_0x4f9ad8[_0x8c69('0x1d')]){if(_0x4f9ad8[_0x8c69('0x1d')]['code']===0x1f4){logger[_0x8c69('0x1d')](_0x8c69('0x1a'),_0x512367,_0x4f9ad8['error'][_0x8c69('0x1e')]);return _0x1b8825(_0x4f9ad8[_0x8c69('0x1d')][_0x8c69('0x1e')]);}logger[_0x8c69('0x1d')](_0x8c69('0x1a'),_0x512367,_0x4f9ad8[_0x8c69('0x1d')]['message']);return _0x46fe8b(_0x4f9ad8['error']['message']);}else{logger['info']('Network,\x20%s,\x20%s',_0x512367,'request\x20sent');_0x46fe8b(_0x4f9ad8['result'][_0x8c69('0x1e')]);}})[_0x8c69('0x1f')](function(_0x3b5b0d){logger[_0x8c69('0x1d')]('Network,\x20%s,\x20%s',_0x512367,_0x3b5b0d);_0x1b8825(_0x3b5b0d);});});}function respondWithStatusCode(_0x5c1bd7,_0x3f8895){_0x3f8895=_0x3f8895||0xcc;return function(_0x249800){if(_0x249800){return _0x5c1bd7['sendStatus'](_0x3f8895);}return _0x5c1bd7['status'](_0x3f8895)[_0x8c69('0x20')]();};}function respondWithResult(_0x4d2c30,_0x17d698){_0x17d698=_0x17d698||0xc8;return function(_0x29b9b0){if(_0x29b9b0){return _0x4d2c30[_0x8c69('0x21')](_0x17d698)[_0x8c69('0x22')](_0x29b9b0);}};}function respondWithFilteredResult(_0x2d76c7,_0x22ac6c){return function(_0xe06835){if(_0xe06835){var _0x534b8c=typeof _0x22ac6c[_0x8c69('0x23')]==='undefined'&&typeof _0x22ac6c[_0x8c69('0x24')]==='undefined';var _0x3057d8=_0xe06835[_0x8c69('0x25')];var _0x479bd6=_0x534b8c?0x0:_0x22ac6c[_0x8c69('0x23')];var _0x131106=_0x534b8c?_0xe06835[_0x8c69('0x25')]:_0x22ac6c['offset']+_0x22ac6c[_0x8c69('0x24')];var _0x2322dc;if(_0x131106>=_0x3057d8){_0x131106=_0x3057d8;_0x2322dc=0xc8;}else{_0x2322dc=0xce;}_0x2d76c7[_0x8c69('0x21')](_0x2322dc);return _0x2d76c7['set'](_0x8c69('0x26'),_0x479bd6+'-'+_0x131106+'/'+_0x3057d8)[_0x8c69('0x22')](_0xe06835);}return null;};}function patchUpdates(_0x4d3b74){return function(_0x58ce66){try{jsonpatch[_0x8c69('0x27')](_0x58ce66,_0x4d3b74,!![]);}catch(_0x545468){return BPromise['reject'](_0x545468);}return _0x58ce66[_0x8c69('0x28')]();};}function saveUpdates(_0x35ef39,_0x4e02f9){return function(_0x4beb68){if(_0x4beb68){return _0x4beb68[_0x8c69('0x29')](_0x35ef39)[_0x8c69('0x19')](function(_0x4c6c9f){return _0x4c6c9f;});}return null;};}function removeEntity(_0x4f5b3a,_0x1cbb42){return function(_0x5448cb){if(_0x5448cb){return _0x5448cb[_0x8c69('0x2a')]()[_0x8c69('0x19')](function(){_0x4f5b3a[_0x8c69('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28f646,_0x24fd59){return function(_0x3d2b8a){if(!_0x3d2b8a){_0x28f646[_0x8c69('0x2b')](0x194);}return _0x3d2b8a;};}function handleError(_0xead370,_0x1477a8){_0x1477a8=_0x1477a8||0x1f4;return function(_0x53c7f7){logger[_0x8c69('0x1d')](_0x53c7f7['stack']);if(_0x53c7f7['name']){delete _0x53c7f7['name'];}_0xead370['status'](_0x1477a8)['send'](_0x53c7f7);};}exports['index']=function(_0x142b59,_0x4f1a91){var _0x531b7f={},_0x1e2a2b={},_0x46d2fe={'count':0x0,'rows':[]};var _0x339ed4=_[_0x8c69('0x2c')](db[_0x8c69('0x2d')]['rawAttributes'],function(_0xd1bba1){return{'name':_0xd1bba1['fieldName'],'type':_0xd1bba1[_0x8c69('0x2e')][_0x8c69('0x2f')]};});_0x1e2a2b[_0x8c69('0x30')]=_[_0x8c69('0x2c')](_0x339ed4,_0x8c69('0x31'));_0x1e2a2b[_0x8c69('0x32')]=_[_0x8c69('0x33')](_0x142b59['query']);_0x1e2a2b[_0x8c69('0x34')]=_[_0x8c69('0x35')](_0x1e2a2b[_0x8c69('0x30')],_0x1e2a2b[_0x8c69('0x32')]);_0x531b7f['attributes']=_[_0x8c69('0x35')](_0x1e2a2b[_0x8c69('0x30')],qs['fields'](_0x142b59['query'][_0x8c69('0x36')]));_0x531b7f[_0x8c69('0x37')]=_0x531b7f[_0x8c69('0x37')]['length']?_0x531b7f[_0x8c69('0x37')]:_0x1e2a2b[_0x8c69('0x30')];if(!_0x142b59[_0x8c69('0x32')][_0x8c69('0x38')](_0x8c69('0x39'))){_0x531b7f['limit']=qs[_0x8c69('0x24')](_0x142b59[_0x8c69('0x32')][_0x8c69('0x24')]);_0x531b7f['offset']=qs[_0x8c69('0x23')](_0x142b59['query'][_0x8c69('0x23')]);}_0x531b7f[_0x8c69('0x3a')]=qs[_0x8c69('0x3b')](_0x142b59[_0x8c69('0x32')][_0x8c69('0x3b')]);_0x531b7f[_0x8c69('0x3c')]=qs['filters'](_[_0x8c69('0x3d')](_0x142b59[_0x8c69('0x32')],_0x1e2a2b[_0x8c69('0x34')]),_0x339ed4);if(_0x142b59[_0x8c69('0x32')][_0x8c69('0x3e')]){_0x531b7f[_0x8c69('0x3c')]=_[_0x8c69('0x3f')](_0x531b7f[_0x8c69('0x3c')],{'$or':_['map'](_0x339ed4,function(_0x1ddb02){if(_0x1ddb02[_0x8c69('0x2e')]!==_0x8c69('0x40')){var _0x15e990={};_0x15e990[_0x1ddb02['name']]={'$like':'%'+_0x142b59[_0x8c69('0x32')][_0x8c69('0x3e')]+'%'};return _0x15e990;}})});}_0x531b7f=_[_0x8c69('0x3f')]({},_0x531b7f,_0x142b59['options']);var _0xbf092b={'where':_0x531b7f[_0x8c69('0x3c')]};return db[_0x8c69('0x2d')][_0x8c69('0x25')](_0xbf092b)[_0x8c69('0x19')](function(_0x20cae2){_0x46d2fe[_0x8c69('0x25')]=_0x20cae2;if(_0x142b59['query'][_0x8c69('0x41')]){_0x531b7f[_0x8c69('0x42')]=[{'all':!![]}];}return db[_0x8c69('0x2d')][_0x8c69('0x43')](_0x531b7f);})[_0x8c69('0x19')](function(_0x15d61c){_0x46d2fe[_0x8c69('0x44')]=_0x15d61c;return _0x46d2fe;})['then'](respondWithFilteredResult(_0x4f1a91,_0x531b7f))['catch'](handleError(_0x4f1a91,null));};exports[_0x8c69('0x45')]=function(_0x54500c,_0x4713b6){var _0x151ff6={'raw':!![],'where':{'id':_0x54500c[_0x8c69('0x46')]['id']}},_0x20dfbc={};_0x20dfbc[_0x8c69('0x30')]=_[_0x8c69('0x33')](db[_0x8c69('0x2d')]['rawAttributes']);_0x20dfbc[_0x8c69('0x32')]=_[_0x8c69('0x33')](_0x54500c[_0x8c69('0x32')]);_0x20dfbc[_0x8c69('0x34')]=_['intersection'](_0x20dfbc[_0x8c69('0x30')],_0x20dfbc[_0x8c69('0x32')]);_0x151ff6[_0x8c69('0x37')]=_['intersection'](_0x20dfbc['model'],qs[_0x8c69('0x36')](_0x54500c[_0x8c69('0x32')][_0x8c69('0x36')]));_0x151ff6[_0x8c69('0x37')]=_0x151ff6[_0x8c69('0x37')][_0x8c69('0x47')]?_0x151ff6[_0x8c69('0x37')]:_0x20dfbc[_0x8c69('0x30')];if(_0x54500c[_0x8c69('0x32')][_0x8c69('0x41')]){_0x151ff6[_0x8c69('0x42')]=[{'all':!![]}];}_0x151ff6=_['merge']({},_0x151ff6,_0x54500c['options']);return db[_0x8c69('0x2d')][_0x8c69('0x48')](_0x151ff6)[_0x8c69('0x19')](handleEntityNotFound(_0x4713b6,null))[_0x8c69('0x19')](respondWithResult(_0x4713b6,null))[_0x8c69('0x1f')](handleError(_0x4713b6,null));};exports[_0x8c69('0x49')]=function(_0x8f26e8,_0x14d1d8,_0x4d64bd){var _0x529095;return db[_0x8c69('0x4a')][_0x8c69('0x4b')](function(_0x4d00c8){return db[_0x8c69('0x2d')][_0x8c69('0x49')](_0x8f26e8[_0x8c69('0x4c')],{'raw':!![]})['then'](function(_0x5d0c64){_0x529095=_0x5d0c64;return db[_0x8c69('0x2d')]['findAll']({'where':{'type':_0x8f26e8[_0x8c69('0x4c')][_0x8c69('0x2e')]},'raw':!![]});})[_0x8c69('0x19')](function(_0x410f3d){if(_0x529095[_0x8c69('0x2e')][_0x8c69('0x4d')]()==_0x8c69('0x4e')){var _0x4cb17c=fs[_0x8c69('0x4f')](path[_0x8c69('0x50')](config[_0x8c69('0x51')],'server/files/templates/stun_multiple.ejs'),_0x8c69('0x52'));var _0x154de8=ejs['render'](_0x4cb17c,{'networks':_0x410f3d||[]});fs[_0x8c69('0x53')](_0x8c69('0x54'),_0x154de8);return respondWithRpcPromise(_0x8c69('0x55'),_0x8c69('0x49'),{'module':_0x8c69('0x56')});}else if(_0x529095[_0x8c69('0x2e')][_0x8c69('0x4d')]()=='TURN'){var _0xaec233=fs[_0x8c69('0x4f')](path['join'](config['root'],_0x8c69('0x57')),_0x8c69('0x52'));var _0x12cada=ejs[_0x8c69('0x58')](_0xaec233,{'networks':_0x410f3d||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x12cada);return respondWithRpcPromise(_0x8c69('0x55'),_0x8c69('0x49'),{'module':_0x8c69('0x56')});}else{var _0x448b7c=fs[_0x8c69('0x4f')](path[_0x8c69('0x50')](config[_0x8c69('0x51')],_0x8c69('0x59')),_0x8c69('0x52'));var _0x2507f0=ejs[_0x8c69('0x58')](_0x448b7c,{'networks':_0x410f3d||[]});fs[_0x8c69('0x53')](util[_0x8c69('0x5a')](_0x8c69('0x5b'),_0x8f26e8[_0x8c69('0x4c')][_0x8c69('0x2e')][_0x8c69('0x5c')]()),_0x2507f0);return respondWithRpcPromise(_0x8c69('0x55'),'create',{'module':_0x8c69('0x5d')});}return null;})['then'](function(){return _0x529095;});})['then'](respondWithResult(_0x14d1d8,0xc9))[_0x8c69('0x1f')](handleError(_0x14d1d8,null));};exports[_0x8c69('0x29')]=function(_0x4684ea,_0x174123,_0x59c40a){var _0x5d9221;return db[_0x8c69('0x4a')][_0x8c69('0x4b')](function(_0x43520a){return db[_0x8c69('0x2d')][_0x8c69('0x48')]({'where':{'id':_0x4684ea[_0x8c69('0x46')]['id']}})[_0x8c69('0x19')](handleEntityNotFound(_0x174123,null))[_0x8c69('0x19')](saveUpdates(_0x4684ea[_0x8c69('0x4c')],null))[_0x8c69('0x19')](function(_0x2bd702){if(_0x2bd702){_0x5d9221=_0x2bd702;return db['Network'][_0x8c69('0x43')]({'where':{'type':_0x5d9221[_0x8c69('0x2e')]},'raw':!![]});}return null;})[_0x8c69('0x19')](function(_0x23ab32){if(_0x5d9221[_0x8c69('0x2e')][_0x8c69('0x4d')]()==_0x8c69('0x4e')){var _0x174e8f=fs[_0x8c69('0x4f')](path['join'](config[_0x8c69('0x51')],_0x8c69('0x5e')),'utf8');var _0x26ff0b=ejs[_0x8c69('0x58')](_0x174e8f,{'networks':_0x23ab32||[]});fs[_0x8c69('0x53')](_0x8c69('0x54'),_0x26ff0b);return respondWithRpcPromise(_0x8c69('0x55'),'update',{'module':_0x8c69('0x56')});}else if(_0x5d9221[_0x8c69('0x2e')][_0x8c69('0x4d')]()==_0x8c69('0x5f')){var _0x4cce8f=fs[_0x8c69('0x4f')](path[_0x8c69('0x50')](config[_0x8c69('0x51')],_0x8c69('0x57')),_0x8c69('0x52'));var _0x114d3a=ejs[_0x8c69('0x58')](_0x4cce8f,{'networks':_0x23ab32||[]});fs[_0x8c69('0x53')](_0x8c69('0x60'),_0x114d3a);return respondWithRpcPromise(_0x8c69('0x55'),_0x8c69('0x29'),{'module':_0x8c69('0x56')});}else{var _0x1bedc2=fs[_0x8c69('0x4f')](path[_0x8c69('0x50')](config[_0x8c69('0x51')],_0x8c69('0x59')),_0x8c69('0x52'));var _0xbba349=ejs[_0x8c69('0x58')](_0x1bedc2,{'networks':_0x23ab32||[]});fs[_0x8c69('0x53')](util[_0x8c69('0x5a')](_0x8c69('0x5b'),_0x4684ea[_0x8c69('0x4c')][_0x8c69('0x2e')]['toLowerCase']()),_0xbba349);return respondWithRpcPromise(_0x8c69('0x55'),_0x8c69('0x29'),{'module':_0x8c69('0x5d')});}return null;})['then'](function(_0x43b75f){if(_0x43b75f){return _0x5d9221;}return null;});})[_0x8c69('0x19')](respondWithResult(_0x174123,null))[_0x8c69('0x1f')](handleError(_0x174123,null));};exports[_0x8c69('0x2a')]=function(_0x5de544,_0x428007,_0x5e0c84){var _0x221b35;return db[_0x8c69('0x2d')][_0x8c69('0x48')]({'where':{'id':_0x5de544[_0x8c69('0x46')]['id']}})[_0x8c69('0x19')](function(_0x586fa){_0x221b35=_0x586fa;return _0x586fa;})[_0x8c69('0x19')](handleEntityNotFound(_0x428007,null))[_0x8c69('0x19')](removeEntity(_0x428007,null))['then'](function(){if(_0x221b35){return db['Network'][_0x8c69('0x43')]({'where':{'type':_0x221b35[_0x8c69('0x2e')]},'raw':!![]});}})[_0x8c69('0x19')](function(_0x4adae8){if(_0x221b35[_0x8c69('0x2e')]['toUpperCase']()=='STUN'){var _0x2f84c3=fs['readFileSync'](path['join'](config['root'],_0x8c69('0x5e')),_0x8c69('0x52'));var _0x34c956=ejs[_0x8c69('0x58')](_0x2f84c3,{'networks':_0x4adae8||[]});fs[_0x8c69('0x53')](_0x8c69('0x54'),_0x34c956);return respondWithRpcPromise(_0x8c69('0x55'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x221b35[_0x8c69('0x2e')][_0x8c69('0x4d')]()==_0x8c69('0x5f')){var _0x5914c9=fs[_0x8c69('0x4f')](path['join'](config[_0x8c69('0x51')],_0x8c69('0x57')),_0x8c69('0x52'));var _0x4d4b5=ejs['render'](_0x5914c9,{'networks':_0x4adae8||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x4d4b5);return respondWithRpcPromise(_0x8c69('0x55'),_0x8c69('0x2a'),{'module':_0x8c69('0x56')});}else{var _0x466f15=fs[_0x8c69('0x4f')](path[_0x8c69('0x50')](config[_0x8c69('0x51')],'server/files/templates/network.ejs'),_0x8c69('0x52'));var _0x3294c1=ejs[_0x8c69('0x58')](_0x466f15,{'networks':_0x4adae8||[]});fs[_0x8c69('0x53')](util[_0x8c69('0x5a')](_0x8c69('0x5b'),_0x5de544[_0x8c69('0x4c')][_0x8c69('0x2e')]['toLowerCase']()),_0x3294c1);return respondWithRpcPromise('Reload',_0x8c69('0x2a'),{'module':_0x8c69('0x5d')});}return null;})[_0x8c69('0x1f')](handleError(_0x428007,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 46299b2..9e2b43e 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./network.attributes','exports','Network','util'];(function(_0x5b336a,_0x2374b9){var _0x3703c0=function(_0x5d25ff){while(--_0x5d25ff){_0x5b336a['push'](_0x5b336a['shift']());}};_0x3703c0(++_0x2374b9);}(_0xedd9,0xfc));var _0x9edd=function(_0x48c6f0,_0x1d1a95){_0x48c6f0=_0x48c6f0-0x0;var _0x44a665=_0xedd9[_0x48c6f0];return _0x44a665;};'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':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x750a=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','util','moment','bluebird','request-promise'];(function(_0xc57e60,_0xe3399c){var _0x5222b3=function(_0x2d9c56){while(--_0x2d9c56){_0xc57e60['push'](_0xc57e60['shift']());}};_0x5222b3(++_0xe3399c);}(_0x750a,0x140));var _0xa750=function(_0xb6f664,_0x2e976a){_0xb6f664=_0xb6f664-0x0;var _0x33c35b=_0x750a[_0xb6f664];return _0x33c35b;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa750('0x1'));var BPromise=require(_0xa750('0x2'));var rp=require(_0xa750('0x3'));var fs=require('fs');var path=require(_0xa750('0x4'));var rimraf=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var attributes=require(_0xa750('0x7'));module[_0xa750('0x8')]=function(_0x10b4d9,_0x2497df){return _0x10b4d9[_0xa750('0x9')](_0xa750('0xa'),attributes,{'tableName':_0xa750('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 8ed7d8a..496c4d1 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 _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(_0x1098da,_0x14c771){var _0x57a0d2=function(_0x54a2d7){while(--_0x54a2d7){_0x1098da['push'](_0x1098da['shift']());}};_0x57a0d2(++_0x14c771);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 +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(_0x25d69b,_0x581170){var _0x1ba84e=function(_0x368d46){while(--_0x368d46){_0x25d69b['push'](_0x25d69b['shift']());}};_0x1ba84e(++_0x581170);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 86180ce..d5137c8 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 _0x4f15=['/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','addApplications','/:id/users','addAgents','send','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get'];(function(_0xa1279d,_0x31dcd5){var _0x277dfc=function(_0x471920){while(--_0x471920){_0xa1279d['push'](_0xa1279d['shift']());}};_0x277dfc(++_0x31dcd5);}(_0x4f15,0x13a));var _0x54f1=function(_0x44203a,_0x182167){_0x44203a=_0x44203a-0x0;var _0x3ab876=_0x4f15[_0x44203a];return _0x3ab876;};'use strict';var multer=require(_0x54f1('0x0'));var util=require(_0x54f1('0x1'));var path=require(_0x54f1('0x2'));var timeout=require(_0x54f1('0x3'));var express=require(_0x54f1('0x4'));var router=express[_0x54f1('0x5')]();var fs_extra=require(_0x54f1('0x6'));var auth=require(_0x54f1('0x7'));var interaction=require(_0x54f1('0x8'));var config=require(_0x54f1('0x9'));var controller=require(_0x54f1('0xa'));router['get']('/',auth[_0x54f1('0xb')](),controller[_0x54f1('0xc')]);router[_0x54f1('0xd')](_0x54f1('0xe'),auth[_0x54f1('0xb')](),controller[_0x54f1('0xf')]);router['get']('/:id',auth[_0x54f1('0xb')](),controller[_0x54f1('0x10')]);router[_0x54f1('0xd')]('/:id/dispositions',auth[_0x54f1('0xb')](),controller[_0x54f1('0x11')]);router[_0x54f1('0xd')](_0x54f1('0x12'),auth[_0x54f1('0xb')](),controller[_0x54f1('0x13')]);router['get'](_0x54f1('0x14'),auth['isAuthenticated'](),controller[_0x54f1('0x15')]);router[_0x54f1('0xd')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x54f1('0xd')]('/:id/users',auth['isAuthenticated'](),controller[_0x54f1('0x16')]);router[_0x54f1('0x17')]('/',auth['isAuthenticated'](),controller[_0x54f1('0x18')]);router[_0x54f1('0x17')](_0x54f1('0x19'),auth[_0x54f1('0xb')](),controller[_0x54f1('0x1a')]);router[_0x54f1('0x17')](_0x54f1('0x12'),auth[_0x54f1('0xb')](),controller[_0x54f1('0x1b')]);router[_0x54f1('0x17')](_0x54f1('0x1c'),controller['notify']);router[_0x54f1('0x17')](_0x54f1('0x14'),auth[_0x54f1('0xb')](),controller[_0x54f1('0x1d')]);router[_0x54f1('0x17')](_0x54f1('0x1e'),auth['isAuthenticated'](),controller[_0x54f1('0x1f')]);router['post']('/:id/send',auth[_0x54f1('0xb')](),controller[_0x54f1('0x20')]);router[_0x54f1('0x21')](_0x54f1('0x22'),auth[_0x54f1('0xb')](),controller[_0x54f1('0x23')]);router[_0x54f1('0x24')](_0x54f1('0x22'),auth[_0x54f1('0xb')](),controller[_0x54f1('0x25')]);router[_0x54f1('0x24')](_0x54f1('0x19'),auth[_0x54f1('0xb')](),controller[_0x54f1('0x26')]);router['delete'](_0x54f1('0x12'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x54f1('0x24')]('/:id/users',auth['isAuthenticated'](),controller[_0x54f1('0x27')]);module[_0x54f1('0x28')]=router; \ No newline at end of file +var _0xee9b=['/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','send','put','delete','removeAnswers','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xee9b,0x1b8));var _0xbee9=function(_0x3e9d17,_0x17b581){_0x3e9d17=_0x3e9d17-0x0;var _0xb14e15=_0xee9b[_0x3e9d17];return _0xb14e15;};'use strict';var multer=require(_0xbee9('0x0'));var util=require('util');var path=require(_0xbee9('0x1'));var timeout=require(_0xbee9('0x2'));var express=require('express');var router=express[_0xbee9('0x3')]();var fs_extra=require(_0xbee9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbee9('0x5'));var config=require('../../config/environment');var controller=require(_0xbee9('0x6'));router[_0xbee9('0x7')]('/',auth[_0xbee9('0x8')](),controller[_0xbee9('0x9')]);router[_0xbee9('0x7')](_0xbee9('0xa'),auth['isAuthenticated'](),controller[_0xbee9('0xb')]);router[_0xbee9('0x7')](_0xbee9('0xc'),auth[_0xbee9('0x8')](),controller[_0xbee9('0xd')]);router[_0xbee9('0x7')](_0xbee9('0xe'),auth[_0xbee9('0x8')](),controller[_0xbee9('0xf')]);router[_0xbee9('0x7')](_0xbee9('0x10'),auth[_0xbee9('0x8')](),controller[_0xbee9('0x11')]);router[_0xbee9('0x7')](_0xbee9('0x12'),auth['isAuthenticated'](),controller[_0xbee9('0x13')]);router[_0xbee9('0x7')](_0xbee9('0x14'),auth[_0xbee9('0x8')](),controller[_0xbee9('0x15')]);router[_0xbee9('0x7')](_0xbee9('0x16'),auth[_0xbee9('0x8')](),controller[_0xbee9('0x17')]);router['post']('/',auth[_0xbee9('0x8')](),controller[_0xbee9('0x18')]);router[_0xbee9('0x19')](_0xbee9('0xe'),auth[_0xbee9('0x8')](),controller[_0xbee9('0x1a')]);router['post']('/:id/canned_answers',auth[_0xbee9('0x8')](),controller[_0xbee9('0x1b')]);router['post']('/:id/notify',controller[_0xbee9('0x1c')]);router['post'](_0xbee9('0x12'),auth['isAuthenticated'](),controller[_0xbee9('0x1d')]);router[_0xbee9('0x19')](_0xbee9('0x16'),auth[_0xbee9('0x8')](),controller[_0xbee9('0x1e')]);router[_0xbee9('0x19')](_0xbee9('0x1f'),auth[_0xbee9('0x8')](),controller[_0xbee9('0x20')]);router[_0xbee9('0x21')](_0xbee9('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xbee9('0x22')](_0xbee9('0xc'),auth[_0xbee9('0x8')](),controller['destroy']);router[_0xbee9('0x22')](_0xbee9('0xe'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xbee9('0x22')](_0xbee9('0x10'),auth[_0xbee9('0x8')](),controller[_0xbee9('0x23')]);router[_0xbee9('0x22')](_0xbee9('0x16'),auth[_0xbee9('0x8')](),controller[_0xbee9('0x24')]);module[_0xbee9('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index bfcb70d..956d62b 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 _0x15c4=['mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING','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','setDataValue'];(function(_0x4f21c4,_0x960024){var _0x2f9fa6=function(_0x26f914){while(--_0x26f914){_0x4f21c4['push'](_0x4f21c4['shift']());}};_0x2f9fa6(++_0x960024);}(_0x15c4,0x16d));var _0x415c=function(_0x15da30,_0x559d60){_0x15da30=_0x15da30-0x0;var _0x410b62=_0x15c4[_0x15da30];return _0x410b62;};'use strict';var Sequelize=require(_0x415c('0x0'));var rs=require(_0x415c('0x1'));module[_0x415c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x415c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x415c('0x4')]},'token':{'type':Sequelize[_0x415c('0x4')],'defaultValue':function(){return rs[_0x415c('0x5')]();}},'replyUri':{'type':Sequelize[_0x415c('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x415c('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x415c('0x6')],'defaultValue':function(){return _0x415c('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x415c('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x415c('0x4')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x415c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x415c('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x415c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x415c('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x415c('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x415c('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2b7ebb){if(!_0x2b7ebb)this[_0x415c('0xb')](_0x415c('0xc'),null);this[_0x415c('0xb')]('mandatoryDisposition',_0x2b7ebb);}}}; \ No newline at end of file +var _0xaa23=['STRING','name','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x2b850d,_0x541a0a){var _0x333dbf=function(_0xb574f9){while(--_0xb574f9){_0x2b850d['push'](_0x2b850d['shift']());}};_0x333dbf(++_0x541a0a);}(_0xaa23,0x11d));var _0x3aa2=function(_0x3c2666,_0x15fd23){_0x3c2666=_0x3c2666-0x0;var _0x10c814=_0xaa23[_0x3c2666];return _0x10c814;};'use strict';var Sequelize=require(_0x3aa2('0x0'));var rs=require(_0x3aa2('0x1'));module[_0x3aa2('0x2')]={'name':{'type':Sequelize[_0x3aa2('0x3')],'unique':_0x3aa2('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x3aa2('0x3')]},'token':{'type':Sequelize[_0x3aa2('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x3aa2('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x3aa2('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3aa2('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3aa2('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3aa2('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x3aa2('0x3')]},'queueTransfer':{'type':Sequelize[_0x3aa2('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3aa2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3aa2('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3aa2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x3aa2('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x3aa2('0x6')],'defaultValue':![],'comment':_0x3aa2('0x9'),'set':function(_0x333e3a){if(!_0x333e3a)this[_0x3aa2('0xa')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x3aa2('0xb'),_0x333e3a);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f208838..fcf718c 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 _0x8fce=['show','params','keys','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','order','sort','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','defaults','contact','threadId','externalUrl','OpenchannelInteraction','ContactId','messageId','interaction','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','pick','getApplications','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','DESC','out','OpenchannelMessage','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','get','OpenchannelAccounts','UserProfileResource','destroy','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','filter','VIRTUAL','merge','includeAll','include','findAll','rows'];(function(_0x1a6b28,_0x51a033){var _0x5ba51b=function(_0x4e751d){while(--_0x4e751d){_0x1a6b28['push'](_0x1a6b28['shift']());}};_0x5ba51b(++_0x51a033);}(_0x8fce,0x1d5));var _0xe8fc=function(_0xbca086,_0x55b9fc){_0xbca086=_0xbca086-0x0;var _0x347bc2=_0x8fce[_0xbca086];return _0x347bc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe8fc('0x0'));var zipdir=require(_0xe8fc('0x1'));var jsonpatch=require(_0xe8fc('0x2'));var rp=require(_0xe8fc('0x3'));var moment=require(_0xe8fc('0x4'));var BPromise=require(_0xe8fc('0x5'));var Mustache=require(_0xe8fc('0x6'));var util=require('util');var path=require(_0xe8fc('0x7'));var sox=require(_0xe8fc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe8fc('0x9'));var squel=require('squel');var crypto=require(_0xe8fc('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe8fc('0xb'));var querystring=require(_0xe8fc('0xc'));var Papa=require(_0xe8fc('0xd'));var Redis=require(_0xe8fc('0xe'));var authService=require(_0xe8fc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe8fc('0x10'));var logger=require(_0xe8fc('0x11'))(_0xe8fc('0x12'));var utils=require(_0xe8fc('0x13'));var config=require(_0xe8fc('0x14'));var licenseUtil=require(_0xe8fc('0x15'));var db=require(_0xe8fc('0x16'))['db'];config[_0xe8fc('0x17')]=_['defaults'](config[_0xe8fc('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe8fc('0x18'))(new Redis(config[_0xe8fc('0x17')]));require('./openchannelAccount.socket')[_0xe8fc('0x19')](socket);var jayson=require(_0xe8fc('0x1a'));var client=jayson[_0xe8fc('0x1b')][_0xe8fc('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43907d,_0xf161a6,_0x318995,_0x55094f){return new BPromise(function(_0x1bdb61,_0x1c72b1){var _0x4078a4=_0x55094f||client;return _0x4078a4[_0xe8fc('0x1d')](_0x43907d,_0x318995)[_0xe8fc('0x1e')](function(_0x26e27a){logger[_0xe8fc('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0xf161a6,_0xe8fc('0x20'));logger[_0xe8fc('0x21')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0xf161a6,'request\x20sent',JSON[_0xe8fc('0x22')](_0x26e27a));if(_0x26e27a[_0xe8fc('0x23')]){if(_0x26e27a[_0xe8fc('0x23')]['code']===0x1f4){logger[_0xe8fc('0x23')](_0xe8fc('0x24'),_0xf161a6,_0x26e27a['error']['message']);return _0x1c72b1(_0x26e27a[_0xe8fc('0x23')]['message']);}logger[_0xe8fc('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0xf161a6,_0x26e27a['error']['message']);return _0x1bdb61(_0x26e27a[_0xe8fc('0x23')][_0xe8fc('0x25')]);}else{logger[_0xe8fc('0x1f')](_0xe8fc('0x24'),_0xf161a6,_0xe8fc('0x20'));_0x1bdb61(_0x26e27a[_0xe8fc('0x26')][_0xe8fc('0x25')]);}})[_0xe8fc('0x27')](function(_0x580b28){logger[_0xe8fc('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0xf161a6,_0x580b28);_0x1c72b1(_0x580b28);});});}function respondWithStatusCode(_0x2565f3,_0x29adab){_0x29adab=_0x29adab||0xcc;return function(_0x5ba9ed){if(_0x5ba9ed){return _0x2565f3['sendStatus'](_0x29adab);}return _0x2565f3[_0xe8fc('0x28')](_0x29adab)[_0xe8fc('0x29')]();};}function respondWithResult(_0x11b545,_0x23d3b1){_0x23d3b1=_0x23d3b1||0xc8;return function(_0x1bf97b){if(_0x1bf97b){return _0x11b545[_0xe8fc('0x28')](_0x23d3b1)[_0xe8fc('0x2a')](_0x1bf97b);}};}function respondWithFilteredResult(_0x394511,_0x6ce95f){return function(_0x3cfc81){if(_0x3cfc81){var _0x1d4012=typeof _0x6ce95f[_0xe8fc('0x2b')]===_0xe8fc('0x2c')&&typeof _0x6ce95f[_0xe8fc('0x2d')]===_0xe8fc('0x2c');var _0x46ee15=_0x3cfc81[_0xe8fc('0x2e')];var _0x11554c=_0x1d4012?0x0:_0x6ce95f[_0xe8fc('0x2b')];var _0x11c65b=_0x1d4012?_0x3cfc81[_0xe8fc('0x2e')]:_0x6ce95f['offset']+_0x6ce95f[_0xe8fc('0x2d')];var _0x353be4;if(_0x11c65b>=_0x46ee15){_0x11c65b=_0x46ee15;_0x353be4=0xc8;}else{_0x353be4=0xce;}_0x394511[_0xe8fc('0x28')](_0x353be4);return _0x394511['set'](_0xe8fc('0x2f'),_0x11554c+'-'+_0x11c65b+'/'+_0x46ee15)[_0xe8fc('0x2a')](_0x3cfc81);}return null;};}function patchUpdates(_0x4e4830){return function(_0x3b4f3b){try{jsonpatch[_0xe8fc('0x30')](_0x3b4f3b,_0x4e4830,!![]);}catch(_0x5f5808){return BPromise[_0xe8fc('0x31')](_0x5f5808);}return _0x3b4f3b[_0xe8fc('0x32')]();};}function saveUpdates(_0x56b235,_0x49e481){return function(_0x32475c){if(_0x32475c){return _0x32475c['update'](_0x56b235)[_0xe8fc('0x1e')](function(_0x12a122){return _0x12a122;});}return null;};}function removeEntity(_0x2a6b0,_0x1b2d07){return function(_0x4ea603){if(_0x4ea603){return _0x4ea603['destroy']()[_0xe8fc('0x1e')](function(){var _0x43422d=_0x4ea603[_0xe8fc('0x33')]({'plain':!![]});var _0x13c138=_0xe8fc('0x34');return db[_0xe8fc('0x35')][_0xe8fc('0x36')]({'where':{'type':_0x13c138,'resourceId':_0x43422d['id']}})[_0xe8fc('0x1e')](function(){return _0x4ea603;});})['then'](function(){_0x2a6b0[_0xe8fc('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53bf6b,_0x10ee8c){return function(_0x38fa5c){if(!_0x38fa5c){_0x53bf6b[_0xe8fc('0x37')](0x194);}return _0x38fa5c;};}function handleError(_0x33ab18,_0x43f3ad){_0x43f3ad=_0x43f3ad||0x1f4;return function(_0x1b4a5d){logger[_0xe8fc('0x23')](_0x1b4a5d[_0xe8fc('0x38')]);if(_0x1b4a5d['name']){delete _0x1b4a5d[_0xe8fc('0x39')];}_0x33ab18['status'](_0x43f3ad)['send'](_0x1b4a5d);};}exports[_0xe8fc('0x3a')]=function(_0x325d04,_0xa5315a){var _0x431e48={'include':[{'model':db[_0xe8fc('0x3b')],'as':_0xe8fc('0x3c')}]},_0x2cae79={},_0x56cd60={'count':0x0,'rows':[]};var _0x2cc5a6=_[_0xe8fc('0x3d')](db[_0xe8fc('0x3e')][_0xe8fc('0x3f')],function(_0x25844c){return{'name':_0x25844c[_0xe8fc('0x40')],'type':_0x25844c[_0xe8fc('0x41')]['key']};});_0x2cae79[_0xe8fc('0x42')]=_[_0xe8fc('0x3d')](_0x2cc5a6,_0xe8fc('0x39'));_0x2cae79[_0xe8fc('0x43')]=_['keys'](_0x325d04[_0xe8fc('0x43')]);_0x2cae79['filters']=_[_0xe8fc('0x44')](_0x2cae79['model'],_0x2cae79[_0xe8fc('0x43')]);_0x431e48[_0xe8fc('0x45')]=_[_0xe8fc('0x44')](_0x2cae79[_0xe8fc('0x42')],qs['fields'](_0x325d04[_0xe8fc('0x43')][_0xe8fc('0x46')]));_0x431e48[_0xe8fc('0x45')]=_0x431e48[_0xe8fc('0x45')][_0xe8fc('0x47')]?_0x431e48['attributes']:_0x2cae79['model'];if(!_0x325d04['query'][_0xe8fc('0x48')](_0xe8fc('0x49'))){_0x431e48['limit']=qs[_0xe8fc('0x2d')](_0x325d04['query']['limit']);_0x431e48[_0xe8fc('0x2b')]=qs['offset'](_0x325d04[_0xe8fc('0x43')][_0xe8fc('0x2b')]);}_0x431e48['order']=qs['sort'](_0x325d04[_0xe8fc('0x43')]['sort']);_0x431e48[_0xe8fc('0x4a')]=qs[_0xe8fc('0x4b')](_['pick'](_0x325d04[_0xe8fc('0x43')],_0x2cae79['filters']),_0x2cc5a6);if(_0x325d04[_0xe8fc('0x43')][_0xe8fc('0x4c')]){_0x431e48['where']=_['merge'](_0x431e48[_0xe8fc('0x4a')],{'$or':_[_0xe8fc('0x3d')](_0x2cc5a6,function(_0x1e81c0){if(_0x1e81c0[_0xe8fc('0x41')]!==_0xe8fc('0x4d')){var _0x5779a5={};_0x5779a5[_0x1e81c0[_0xe8fc('0x39')]]={'$like':'%'+_0x325d04[_0xe8fc('0x43')]['filter']+'%'};return _0x5779a5;}})});}_0x431e48=_[_0xe8fc('0x4e')]({},_0x431e48,_0x325d04['options']);var _0x5ec7b3={'where':_0x431e48[_0xe8fc('0x4a')]};return db['OpenchannelAccount'][_0xe8fc('0x2e')](_0x5ec7b3)['then'](function(_0x42064a){_0x56cd60['count']=_0x42064a;if(_0x325d04['query'][_0xe8fc('0x4f')]){_0x431e48[_0xe8fc('0x50')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xe8fc('0x51')](_0x431e48);})[_0xe8fc('0x1e')](function(_0x3c3b72){_0x56cd60[_0xe8fc('0x52')]=_0x3c3b72;return _0x56cd60;})[_0xe8fc('0x1e')](respondWithFilteredResult(_0xa5315a,_0x431e48))[_0xe8fc('0x27')](handleError(_0xa5315a,null));};exports[_0xe8fc('0x53')]=function(_0x363541,_0xa26d97){var _0xb3985b={'raw':![],'where':{'id':_0x363541[_0xe8fc('0x54')]['id']},'include':[{'model':db[_0xe8fc('0x3b')],'as':_0xe8fc('0x3c')}]},_0x15580e={};_0x15580e[_0xe8fc('0x42')]=_[_0xe8fc('0x55')](db[_0xe8fc('0x3e')][_0xe8fc('0x3f')]);_0x15580e[_0xe8fc('0x43')]=_[_0xe8fc('0x55')](_0x363541[_0xe8fc('0x43')]);_0x15580e[_0xe8fc('0x4b')]=_['intersection'](_0x15580e[_0xe8fc('0x42')],_0x15580e[_0xe8fc('0x43')]);_0xb3985b[_0xe8fc('0x45')]=_['intersection'](_0x15580e['model'],qs[_0xe8fc('0x46')](_0x363541[_0xe8fc('0x43')][_0xe8fc('0x46')]));_0xb3985b['attributes']=_0xb3985b[_0xe8fc('0x45')][_0xe8fc('0x47')]?_0xb3985b[_0xe8fc('0x45')]:_0x15580e['model'];if(_0x363541[_0xe8fc('0x43')][_0xe8fc('0x4f')]){_0xb3985b[_0xe8fc('0x50')]=[{'all':!![]}];}_0xb3985b=_[_0xe8fc('0x4e')]({},_0xb3985b,_0x363541[_0xe8fc('0x56')]);return db[_0xe8fc('0x3e')][_0xe8fc('0x57')](_0xb3985b)['then'](handleEntityNotFound(_0xa26d97,null))[_0xe8fc('0x1e')](respondWithResult(_0xa26d97,null))[_0xe8fc('0x27')](handleError(_0xa26d97,null));};exports[_0xe8fc('0x58')]=function(_0x560e84,_0x7a9843){return db[_0xe8fc('0x3e')][_0xe8fc('0x58')](_0x560e84['body'],{})[_0xe8fc('0x1e')](function(_0x583d22){var _0x180c6c=_0x560e84['user'][_0xe8fc('0x33')]({'plain':!![]});if(!_0x180c6c)throw new Error(_0xe8fc('0x59'));if(_0x180c6c['role']===_0xe8fc('0x5a')){var _0x53371d=_0x583d22[_0xe8fc('0x33')]({'plain':!![]});var _0x4760d9=_0xe8fc('0x34');return db[_0xe8fc('0x5b')][_0xe8fc('0x57')]({'where':{'name':_0x4760d9,'userProfileId':_0x180c6c['userProfileId']},'raw':!![]})[_0xe8fc('0x1e')](function(_0x4c1155){if(_0x4c1155&&_0x4c1155[_0xe8fc('0x5c')]===0x0){return db[_0xe8fc('0x35')][_0xe8fc('0x58')]({'name':_0x53371d[_0xe8fc('0x39')],'resourceId':_0x53371d['id'],'type':_0x4c1155[_0xe8fc('0x39')],'sectionId':_0x4c1155['id']},{})[_0xe8fc('0x1e')](function(){return _0x583d22;});}else{return _0x583d22;}})[_0xe8fc('0x27')](function(_0x11da25){logger[_0xe8fc('0x23')](_0xe8fc('0x5d'),_0x11da25);throw _0x11da25;});}return _0x583d22;})[_0xe8fc('0x1e')](respondWithResult(_0x7a9843,0xc9))['catch'](handleError(_0x7a9843,null));};exports[_0xe8fc('0x5e')]=function(_0x107f65,_0x2aebfb){if(_0x107f65['body']['id']){delete _0x107f65[_0xe8fc('0x5f')]['id'];}return db[_0xe8fc('0x3e')][_0xe8fc('0x57')]({'where':{'id':_0x107f65[_0xe8fc('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xe8fc('0x3c')}]})['then'](handleEntityNotFound(_0x2aebfb,null))['then'](saveUpdates(_0x107f65[_0xe8fc('0x5f')],null))[_0xe8fc('0x1e')](respondWithResult(_0x2aebfb,null))[_0xe8fc('0x27')](handleError(_0x2aebfb,null));};exports['destroy']=function(_0x238ca9,_0xcb98a5){return db['OpenchannelAccount'][_0xe8fc('0x57')]({'where':{'id':_0x238ca9[_0xe8fc('0x54')]['id']}})[_0xe8fc('0x1e')](handleEntityNotFound(_0xcb98a5,null))[_0xe8fc('0x1e')](removeEntity(_0xcb98a5,null))[_0xe8fc('0x27')](handleError(_0xcb98a5,null));};exports['describe']=function(_0x51b2d9,_0x48f3b6){return db[_0xe8fc('0x3e')][_0xe8fc('0x60')]()[_0xe8fc('0x1e')](respondWithResult(_0x48f3b6,null))[_0xe8fc('0x27')](handleError(_0x48f3b6,null));};exports[_0xe8fc('0x61')]=function(_0x2fd248,_0x5c2e45,_0x3023b4){if(_0x2fd248[_0xe8fc('0x5f')]['id']){delete _0x2fd248[_0xe8fc('0x5f')]['id'];}return db[_0xe8fc('0x3e')]['find']({'where':{'id':_0x2fd248['params']['id']}})['then'](handleEntityNotFound(_0x5c2e45,null))[_0xe8fc('0x1e')](function(_0x11d505){if(_0x11d505){_0x2fd248[_0xe8fc('0x5f')][_0xe8fc('0x62')]=_0x11d505['id'];return db['Disposition'][_0xe8fc('0x58')](_0x2fd248[_0xe8fc('0x5f')]);}})[_0xe8fc('0x1e')](respondWithResult(_0x5c2e45,null))[_0xe8fc('0x27')](handleError(_0x5c2e45,null));};exports[_0xe8fc('0x63')]=function(_0x5df2b1,_0x42b215,_0x1cbeb2){var _0x264c7d={'raw':![],'where':{}};var _0x25c7ec={};var _0x5f0426={'count':0x0,'rows':[]};return db[_0xe8fc('0x3e')][_0xe8fc('0x64')]({'where':{'id':_0x5df2b1['params']['id']}})['then'](handleEntityNotFound(_0x42b215,null))[_0xe8fc('0x1e')](function(_0x460c0a){if(_0x460c0a){_0x25c7ec[_0xe8fc('0x42')]=_[_0xe8fc('0x55')](db[_0xe8fc('0x65')][_0xe8fc('0x3f')]);_0x25c7ec[_0xe8fc('0x43')]=_['keys'](_0x5df2b1[_0xe8fc('0x43')]);_0x25c7ec[_0xe8fc('0x4b')]=_[_0xe8fc('0x44')](_0x25c7ec[_0xe8fc('0x42')],_0x25c7ec['query']);_0x264c7d[_0xe8fc('0x45')]=_['intersection'](_0x25c7ec[_0xe8fc('0x42')],qs['fields'](_0x5df2b1[_0xe8fc('0x43')][_0xe8fc('0x46')]));_0x264c7d[_0xe8fc('0x45')]=_0x264c7d[_0xe8fc('0x45')]['length']?_0x264c7d[_0xe8fc('0x45')]:_0x25c7ec['model'];if(!_0x5df2b1['query'][_0xe8fc('0x48')](_0xe8fc('0x49'))){_0x264c7d[_0xe8fc('0x2d')]=qs[_0xe8fc('0x2d')](_0x5df2b1[_0xe8fc('0x43')]['limit']);_0x264c7d[_0xe8fc('0x2b')]=qs['offset'](_0x5df2b1[_0xe8fc('0x43')][_0xe8fc('0x2b')]);}_0x264c7d[_0xe8fc('0x66')]=qs[_0xe8fc('0x67')](_0x5df2b1['query']['sort']);_0x264c7d[_0xe8fc('0x4a')]=qs[_0xe8fc('0x4b')](_['pick'](_0x5df2b1[_0xe8fc('0x43')],_0x25c7ec[_0xe8fc('0x4b')]));_0x264c7d[_0xe8fc('0x4a')][_0xe8fc('0x62')]=_0x460c0a['id'];if(_0x5df2b1[_0xe8fc('0x43')][_0xe8fc('0x4c')]){_0x264c7d[_0xe8fc('0x4a')]=_[_0xe8fc('0x4e')](_0x264c7d[_0xe8fc('0x4a')],{'$or':_[_0xe8fc('0x3d')](_0x264c7d['attributes'],function(_0x41608c){var _0xde421b={};_0xde421b[_0x41608c]={'$like':'%'+_0x5df2b1[_0xe8fc('0x43')]['filter']+'%'};return _0xde421b;})});}_0x264c7d=_['merge']({},_0x264c7d,_0x5df2b1[_0xe8fc('0x56')]);return db[_0xe8fc('0x65')][_0xe8fc('0x2e')]({'where':_0x264c7d['where']})['then'](function(_0x41caa3){_0x5f0426[_0xe8fc('0x2e')]=_0x41caa3;if(_0x5df2b1[_0xe8fc('0x43')][_0xe8fc('0x4f')]){_0x264c7d['include']=[{'all':!![]}];}return db[_0xe8fc('0x65')][_0xe8fc('0x51')](_0x264c7d);})[_0xe8fc('0x1e')](function(_0x228676){_0x5f0426[_0xe8fc('0x52')]=_0x228676;return _0x5f0426;});}})[_0xe8fc('0x1e')](respondWithFilteredResult(_0x42b215,_0x264c7d))[_0xe8fc('0x27')](handleError(_0x42b215,null));};exports[_0xe8fc('0x68')]=function(_0x17bdb7,_0x5a0dfa,_0x474dc2){return db['OpenchannelAccount'][_0xe8fc('0x57')]({'where':{'id':_0x17bdb7[_0xe8fc('0x54')]['id']}})['then'](handleEntityNotFound(_0x5a0dfa,null))['then'](function(_0x2ec6e6){if(_0x2ec6e6){return _0x2ec6e6['removeDispositions'](_0x17bdb7[_0xe8fc('0x43')][_0xe8fc('0x69')]);}})['then'](respondWithStatusCode(_0x5a0dfa,null))[_0xe8fc('0x27')](handleError(_0x5a0dfa,null));};exports[_0xe8fc('0x6a')]=function(_0x482d42,_0x5bc113,_0x4bedbd){if(_0x482d42[_0xe8fc('0x5f')]['id']){delete _0x482d42[_0xe8fc('0x5f')]['id'];}return db[_0xe8fc('0x3e')]['find']({'where':{'id':_0x482d42[_0xe8fc('0x54')]['id']}})[_0xe8fc('0x1e')](handleEntityNotFound(_0x5bc113,null))['then'](function(_0x1dc579){if(_0x1dc579){_0x482d42[_0xe8fc('0x5f')][_0xe8fc('0x62')]=_0x1dc579['id'];return db['CannedAnswer']['create'](_0x482d42[_0xe8fc('0x5f')]);}})[_0xe8fc('0x1e')](respondWithResult(_0x5bc113,null))[_0xe8fc('0x27')](handleError(_0x5bc113,null));};exports[_0xe8fc('0x6b')]=function(_0x367e26,_0x4b2fe2,_0x2e3dcd){var _0x7a5469={'raw':![],'where':{}};var _0x5009cc={};var _0x4b20e5={'count':0x0,'rows':[]};return db[_0xe8fc('0x3e')][_0xe8fc('0x64')]({'where':{'id':_0x367e26[_0xe8fc('0x54')]['id']}})['then'](handleEntityNotFound(_0x4b2fe2,null))[_0xe8fc('0x1e')](function(_0x4f6c84){if(_0x4f6c84){_0x5009cc[_0xe8fc('0x42')]=_[_0xe8fc('0x55')](db[_0xe8fc('0x6c')][_0xe8fc('0x3f')]);_0x5009cc['query']=_[_0xe8fc('0x55')](_0x367e26['query']);_0x5009cc[_0xe8fc('0x4b')]=_['intersection'](_0x5009cc[_0xe8fc('0x42')],_0x5009cc[_0xe8fc('0x43')]);_0x7a5469[_0xe8fc('0x45')]=_[_0xe8fc('0x44')](_0x5009cc[_0xe8fc('0x42')],qs[_0xe8fc('0x46')](_0x367e26[_0xe8fc('0x43')][_0xe8fc('0x46')]));_0x7a5469[_0xe8fc('0x45')]=_0x7a5469[_0xe8fc('0x45')]['length']?_0x7a5469['attributes']:_0x5009cc[_0xe8fc('0x42')];if(!_0x367e26[_0xe8fc('0x43')]['hasOwnProperty'](_0xe8fc('0x49'))){_0x7a5469['limit']=qs[_0xe8fc('0x2d')](_0x367e26[_0xe8fc('0x43')][_0xe8fc('0x2d')]);_0x7a5469['offset']=qs[_0xe8fc('0x2b')](_0x367e26['query'][_0xe8fc('0x2b')]);}_0x7a5469[_0xe8fc('0x66')]=qs[_0xe8fc('0x67')](_0x367e26[_0xe8fc('0x43')][_0xe8fc('0x67')]);_0x7a5469[_0xe8fc('0x4a')]=qs[_0xe8fc('0x4b')](_['pick'](_0x367e26[_0xe8fc('0x43')],_0x5009cc[_0xe8fc('0x4b')]));_0x7a5469[_0xe8fc('0x4a')][_0xe8fc('0x62')]=_0x4f6c84['id'];if(_0x367e26[_0xe8fc('0x43')][_0xe8fc('0x4c')]){_0x7a5469[_0xe8fc('0x4a')]=_[_0xe8fc('0x4e')](_0x7a5469[_0xe8fc('0x4a')],{'$or':_[_0xe8fc('0x3d')](_0x7a5469['attributes'],function(_0x1738bf){var _0x549207={};_0x549207[_0x1738bf]={'$like':'%'+_0x367e26['query'][_0xe8fc('0x4c')]+'%'};return _0x549207;})});}_0x7a5469=_[_0xe8fc('0x4e')]({},_0x7a5469,_0x367e26['options']);return db['CannedAnswer'][_0xe8fc('0x2e')]({'where':_0x7a5469[_0xe8fc('0x4a')]})[_0xe8fc('0x1e')](function(_0x36ffc8){_0x4b20e5[_0xe8fc('0x2e')]=_0x36ffc8;if(_0x367e26[_0xe8fc('0x43')][_0xe8fc('0x4f')]){_0x7a5469[_0xe8fc('0x50')]=[{'all':!![]}];}return db[_0xe8fc('0x6c')][_0xe8fc('0x51')](_0x7a5469);})['then'](function(_0x25dc65){_0x4b20e5['rows']=_0x25dc65;return _0x4b20e5;});}})[_0xe8fc('0x1e')](respondWithFilteredResult(_0x4b2fe2,_0x7a5469))[_0xe8fc('0x27')](handleError(_0x4b2fe2,null));};exports[_0xe8fc('0x6d')]=function(_0x310770,_0x106ae3,_0x31bed2){return db[_0xe8fc('0x3e')][_0xe8fc('0x57')]({'where':{'id':_0x310770[_0xe8fc('0x54')]['id']}})[_0xe8fc('0x1e')](handleEntityNotFound(_0x106ae3,null))[_0xe8fc('0x1e')](function(_0x19b3e9){if(_0x19b3e9){return _0x19b3e9[_0xe8fc('0x6d')](_0x310770[_0xe8fc('0x43')][_0xe8fc('0x69')]);}})[_0xe8fc('0x1e')](respondWithStatusCode(_0x106ae3,null))['catch'](handleError(_0x106ae3,null));};exports[_0xe8fc('0x6e')]=function(_0x33c546,_0x101820,_0x4819b2){var _0x45e32c={'body':_0x33c546[_0xe8fc('0x5f')],'channel':'openchannel'};var _0x1260bb=[];var _0x493028=[];var _0x1fbfd1={};var _0x3089e4=![];return db[_0xe8fc('0x6f')][_0xe8fc('0x60')]()[_0xe8fc('0x1e')](function(_0x25776f){if(!_0x25776f){throw new db[(_0xe8fc('0x70'))][(_0xe8fc('0x71'))]('no\x20available\x20attributes');}_0x1260bb=_[_0xe8fc('0x72')](_['keys'](_0x25776f),[_0xe8fc('0x73'),_0xe8fc('0x74')]);_0x493028=_[_0xe8fc('0x72')](_[_0xe8fc('0x55')](_0x25776f),[_0xe8fc('0x73'),_0xe8fc('0x74'),_0xe8fc('0x75'),_0xe8fc('0x76')]);if(_0x33c546['body']['id']){delete _0x33c546[_0xe8fc('0x5f')]['id'];}if(_[_0xe8fc('0x77')](_0x33c546[_0xe8fc('0x5f')][_0xe8fc('0x78')])){throw new db[(_0xe8fc('0x70'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xe8fc('0x77')](_0x33c546[_0xe8fc('0x5f')]['body'])||_0x33c546[_0xe8fc('0x5f')]['body']===''){throw new db[(_0xe8fc('0x70'))][(_0xe8fc('0x71'))](_0xe8fc('0x79'));}if(_[_0xe8fc('0x77')](_0x33c546['body'][_0xe8fc('0x7a')])){throw new db[(_0xe8fc('0x70'))][(_0xe8fc('0x71'))](_0xe8fc('0x7b')+_0x493028);}if(!_['includes'](_0x493028,_0x33c546['body'][_0xe8fc('0x7a')])){throw new db[(_0xe8fc('0x70'))][(_0xe8fc('0x71'))](_0xe8fc('0x7c')+_0x493028);}_0x1fbfd1[_0x33c546[_0xe8fc('0x5f')][_0xe8fc('0x7a')]]=_0x33c546[_0xe8fc('0x5f')][_0xe8fc('0x78')];})[_0xe8fc('0x1e')](function(){return db[_0xe8fc('0x3e')][_0xe8fc('0x57')]({'where':{'id':_0x33c546[_0xe8fc('0x54')]['id']},'include':[{'model':db[_0xe8fc('0x7d')],'as':_0xe8fc('0x7e'),'include':[{'model':db[_0xe8fc('0x6f')],'as':_0xe8fc('0x7f'),'where':_0x1fbfd1,'limit':0x1,'order':[[_0xe8fc('0x74'),'DESC']]}]},{'model':db[_0xe8fc('0x80')],'as':_0xe8fc('0x81')}]});})[_0xe8fc('0x1e')](handleEntityNotFound(_0x101820,null))['then'](function(_0x526229){if(_0x526229&&_0x526229[_0xe8fc('0x7e')]){_0x45e32c[_0xe8fc('0x82')]=_0x526229;_0x45e32c[_0xe8fc('0x83')]=_0x526229[_0xe8fc('0x81')];_0x45e32c[_0xe8fc('0x84')]=_0x526229['List'];_0x45e32c['applications']=_[_0xe8fc('0x85')](_0x45e32c[_0xe8fc('0x83')],[_0xe8fc('0x86')],['asc']);if(_0x45e32c[_0xe8fc('0x82')][_0xe8fc('0x81')]){delete _0x45e32c['account'][_0xe8fc('0x81')];}if(_0x45e32c['account'][_0xe8fc('0x7e')]&&_0x45e32c[_0xe8fc('0x82')][_0xe8fc('0x7e')]['Contacts'][_0xe8fc('0x47')]){return _0x45e32c['account'][_0xe8fc('0x7e')][_0xe8fc('0x7f')][0x0];}var _0xef404f=_[_0xe8fc('0x87')](_0x33c546[_0xe8fc('0x5f')],{'firstName':_0x33c546[_0xe8fc('0x5f')][_0xe8fc('0x78')],'ListId':_0x526229[_0xe8fc('0x76')]});_0xef404f[_0x33c546[_0xe8fc('0x5f')]['mapKey']]=_0x33c546[_0xe8fc('0x5f')]['from'];return db['CmContact']['create'](_0xef404f,{'fields':_0x1260bb,'raw':!![]});}})[_0xe8fc('0x1e')](handleEntityNotFound(_0x101820,null))[_0xe8fc('0x1e')](function(_0x3019af){_0x45e32c[_0xe8fc('0x88')]=_0x3019af;if(_0x3019af){var _0x7f5913={'ContactId':_0x3019af['id'],'OpenchannelAccountId':_0x33c546[_0xe8fc('0x54')]['id'],'from':(_0x3019af['firstName']||'')+'\x20'+(_0x3019af['lastName']||'')};var _0x3cc98c={'OpenchannelAccountId':_0x33c546[_0xe8fc('0x54')]['id'],'closed':![]};if(_0x33c546[_0xe8fc('0x5f')][_0xe8fc('0x89')]){_0x3cc98c[_0xe8fc('0x89')]=_0x33c546['body'][_0xe8fc('0x89')];return db['OpenchannelInteraction'][_0xe8fc('0x57')]({'where':_0x3cc98c})[_0xe8fc('0x1e')](function(_0x4a0838){if(_0x4a0838){return[_0x4a0838,![]];}_0x7f5913[_0xe8fc('0x89')]=_0x33c546[_0xe8fc('0x5f')]['threadId'];_0x7f5913[_0xe8fc('0x8a')]=_0x33c546['body']['externalUrl'];return db[_0xe8fc('0x8b')]['create'](_0x7f5913)[_0xe8fc('0x1e')](function(_0x534eb5){return[_0x534eb5,!![]];});});}else{_0x3cc98c['threadId']=null;}_0x3cc98c[_0xe8fc('0x8c')]=_0x3019af['id'];return db[_0xe8fc('0x8b')]['find']({'where':_0x3cc98c})[_0xe8fc('0x1e')](function(_0x2bb7aa){if(_0x2bb7aa){return[_0x2bb7aa,![]];}return db[_0xe8fc('0x8b')]['create'](_0x7f5913)['then'](function(_0x4ca728){return[_0x4ca728,!![]];});});}})['spread'](function(_0x4e1def,_0x77a24b){if(_0x4e1def){_0x3089e4=_0x77a24b;if(!_0x77a24b){var _0x30de0f={'from':(_0x45e32c[_0xe8fc('0x88')]['firstName']||'')+'\x20'+(_0x45e32c['contact']['lastName']||'')};if(_0x33c546['body'][_0xe8fc('0x89')]&&_0x33c546[_0xe8fc('0x5f')][_0xe8fc('0x8d')]&&_0x33c546[_0xe8fc('0x5f')][_0xe8fc('0x89')]!=_0x33c546[_0xe8fc('0x5f')]['messageId']){_0x30de0f[_0xe8fc('0x89')]=_0x33c546[_0xe8fc('0x5f')]['messageId'];}return _0x4e1def[_0xe8fc('0x5e')](_0x30de0f);}else{return _0x4e1def;}}})[_0xe8fc('0x1e')](function(_0x398d78){_0x45e32c[_0xe8fc('0x8e')]=_0x398d78[_0xe8fc('0x33')]({'plain':!![]});_0x45e32c[_0xe8fc('0x8e')][_0xe8fc('0x8f')]=_0x3089e4;if(_0x45e32c['interaction']['created']){if(_0x45e32c[_0xe8fc('0x82')]['autoclose']){_0x45e32c['applications'][_0xe8fc('0x90')]({'id':0x0,'priority':_0x45e32c[_0xe8fc('0x83')][_0xe8fc('0x47')]+0x1,'app':_0xe8fc('0x91'),'appdata':_0xe8fc('0x92'),'interval':_0xe8fc('0x93')});}}return db['OpenchannelMessage'][_0xe8fc('0x58')]({'body':_0x33c546['body']['body'],'OpenchannelAccountId':_0x33c546[_0xe8fc('0x54')]['id'],'OpenchannelInteractionId':_0x398d78['id'],'direction':'in','ContactId':_0x45e32c[_0xe8fc('0x88')]['id'],'AttachmentId':_0x33c546[_0xe8fc('0x5f')][_0xe8fc('0x94')]});})[_0xe8fc('0x1e')](function(_0x2a32f4){_0x45e32c[_0xe8fc('0x25')]=_0x2a32f4;if(_0x45e32c[_0xe8fc('0x8e')][_0xe8fc('0x95')]){return db[_0xe8fc('0x96')][_0xe8fc('0x57')]({'attributes':['id',_0xe8fc('0x39')],'where':{'id':_0x45e32c[_0xe8fc('0x8e')]['UserId']}})[_0xe8fc('0x1e')](function(_0x3cf47e){if(_0x3cf47e){_0x45e32c[_0xe8fc('0x83')][_0xe8fc('0x97')]({'id':0x0,'priority':0x0,'app':_0xe8fc('0x98'),'appdata':_0x3cf47e['name']+','+(_0x45e32c[_0xe8fc('0x82')][_0xe8fc('0x99')]||0xa),'interval':_0xe8fc('0x93')});_0x45e32c[_0xe8fc('0x9a')]=![];}return respondWithRpcPromise(_0xe8fc('0x9b'),'startRouting',_0x45e32c);});}return respondWithRpcPromise(_0xe8fc('0x9b'),_0xe8fc('0x9c'),_0x45e32c);})[_0xe8fc('0x1e')](function(_0x20069b){respondWithRpcPromise(_0xe8fc('0x9d'),_0xe8fc('0x9d'),{'event':'notify','message':_0x20069b},client9002);return _0x20069b;})[_0xe8fc('0x1e')](respondWithResult(_0x101820,null))['catch'](handleError(_0x101820,null));};exports[_0xe8fc('0x9e')]=function(_0x4d5d11,_0x3e495d,_0x14ae27){return db['OpenchannelAccount'][_0xe8fc('0x64')]({'where':{'id':_0x4d5d11[_0xe8fc('0x54')]['id']}})[_0xe8fc('0x1e')](handleEntityNotFound(_0x3e495d,null))[_0xe8fc('0x1e')](function(_0x10c19d){if(_0x10c19d){return db[_0xe8fc('0x9f')][_0xe8fc('0xa0')](function(_0x185f67){return db[_0xe8fc('0x80')][_0xe8fc('0x36')]({'where':{'OpenchannelAccountId':_0x4d5d11[_0xe8fc('0x54')]['id']},'transaction':_0x185f67})[_0xe8fc('0x1e')](function(_0x15b4df){var _0x12ffca=_['map'](_0x4d5d11[_0xe8fc('0x5f')],function(_0x2543ef){_0x2543ef['OpenchannelAccountId']=_0x4d5d11[_0xe8fc('0x54')]['id'];return _0x2543ef;});return db[_0xe8fc('0x80')][_0xe8fc('0xa1')](_0x12ffca,{'transaction':_0x185f67});});})[_0xe8fc('0x1e')](function(){return db[_0xe8fc('0x80')][_0xe8fc('0xa2')]({'where':{'OpenchannelAccountId':_0x4d5d11[_0xe8fc('0x54')]['id']},'order':_0xe8fc('0x86')});});}})[_0xe8fc('0x1e')](respondWithResult(_0x3e495d,null))[_0xe8fc('0x27')](handleError(_0x3e495d,null));};exports['getApplications']=function(_0x3abda8,_0x2e4b97,_0x14f6f2){var _0x1f8ee6={};var _0x2bb456={};var _0x3a622c;var _0x47a7c8;return db['OpenchannelAccount'][_0xe8fc('0x64')]({'where':{'id':_0x3abda8['params']['id']}})[_0xe8fc('0x1e')](handleEntityNotFound(_0x2e4b97,null))[_0xe8fc('0x1e')](function(_0x1624b3){if(_0x1624b3){_0x3a622c=_0x1624b3;_0x2bb456['model']=_[_0xe8fc('0x55')](db[_0xe8fc('0x80')][_0xe8fc('0x3f')]);_0x2bb456[_0xe8fc('0x43')]=_[_0xe8fc('0x55')](_0x3abda8['query']);_0x2bb456[_0xe8fc('0x4b')]=_[_0xe8fc('0x44')](_0x2bb456[_0xe8fc('0x42')],_0x2bb456['query']);_0x1f8ee6['attributes']=_[_0xe8fc('0x44')](_0x2bb456[_0xe8fc('0x42')],qs[_0xe8fc('0x46')](_0x3abda8[_0xe8fc('0x43')][_0xe8fc('0x46')]));_0x1f8ee6[_0xe8fc('0x45')]=_0x1f8ee6[_0xe8fc('0x45')][_0xe8fc('0x47')]?_0x1f8ee6[_0xe8fc('0x45')]:_0x2bb456[_0xe8fc('0x42')];_0x1f8ee6[_0xe8fc('0x66')]=qs[_0xe8fc('0x67')](_0x3abda8[_0xe8fc('0x43')]['sort']);_0x1f8ee6['where']=qs[_0xe8fc('0x4b')](_[_0xe8fc('0xa3')](_0x3abda8[_0xe8fc('0x43')],_0x2bb456[_0xe8fc('0x4b')]));if(_0x3abda8[_0xe8fc('0x43')][_0xe8fc('0x4c')]){_0x1f8ee6['where']=_[_0xe8fc('0x4e')](_0x1f8ee6[_0xe8fc('0x4a')],{'$or':_[_0xe8fc('0x3d')](_0x1f8ee6[_0xe8fc('0x45')],function(_0x4ede63){var _0x2190d4={};_0x2190d4[_0x4ede63]={'$like':'%'+_0x3abda8[_0xe8fc('0x43')][_0xe8fc('0x4c')]+'%'};return _0x2190d4;})});}_0x1f8ee6=_[_0xe8fc('0x4e')]({},_0x1f8ee6,_0x3abda8['options']);return _0x3a622c[_0xe8fc('0xa4')](_0x1f8ee6);}})[_0xe8fc('0x1e')](function(_0x37f1bb){if(_0x37f1bb){_0x47a7c8=_0x37f1bb[_0xe8fc('0x47')];if(!_0x3abda8[_0xe8fc('0x43')][_0xe8fc('0x48')]('nolimit')){_0x1f8ee6[_0xe8fc('0x2d')]=qs['limit'](_0x3abda8['query']['limit']);_0x1f8ee6['offset']=qs[_0xe8fc('0x2b')](_0x3abda8[_0xe8fc('0x43')][_0xe8fc('0x2b')]);}return _0x3a622c['getApplications'](_0x1f8ee6);}})[_0xe8fc('0x1e')](function(_0x397203){if(_0x397203){return _0x397203?{'count':_0x47a7c8,'rows':_0x397203}:null;}})[_0xe8fc('0x1e')](respondWithResult(_0x2e4b97,null))['catch'](handleError(_0x2e4b97,null));};exports['getInteractions']=function(_0x2439e2,_0x5a94ac,_0x38263c){var _0x32d4e7={'raw':![],'where':{}};var _0x2a7d3b={};var _0x501602={'count':0x0,'rows':[]};return db[_0xe8fc('0x3e')]['findOne']({'where':{'id':_0x2439e2[_0xe8fc('0x54')]['id']}})[_0xe8fc('0x1e')](handleEntityNotFound(_0x5a94ac,null))[_0xe8fc('0x1e')](function(_0x573f37){if(_0x573f37){_0x2a7d3b['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x2a7d3b[_0xe8fc('0x43')]=_['keys'](_0x2439e2[_0xe8fc('0x43')]);_0x2a7d3b[_0xe8fc('0x4b')]=_[_0xe8fc('0x44')](_0x2a7d3b[_0xe8fc('0x42')],_0x2a7d3b[_0xe8fc('0x43')]);_0x32d4e7[_0xe8fc('0x45')]=_[_0xe8fc('0x44')](_0x2a7d3b[_0xe8fc('0x42')],qs[_0xe8fc('0x46')](_0x2439e2[_0xe8fc('0x43')][_0xe8fc('0x46')]));_0x32d4e7[_0xe8fc('0x45')]=_0x32d4e7[_0xe8fc('0x45')][_0xe8fc('0x47')]?_0x32d4e7['attributes']:_0x2a7d3b[_0xe8fc('0x42')];if(!_0x2439e2[_0xe8fc('0x43')][_0xe8fc('0x48')]('nolimit')){_0x32d4e7[_0xe8fc('0x2d')]=qs['limit'](_0x2439e2[_0xe8fc('0x43')][_0xe8fc('0x2d')]);_0x32d4e7[_0xe8fc('0x2b')]=qs[_0xe8fc('0x2b')](_0x2439e2[_0xe8fc('0x43')][_0xe8fc('0x2b')]);}_0x32d4e7[_0xe8fc('0x66')]=qs[_0xe8fc('0x67')](_0x2439e2[_0xe8fc('0x43')]['sort']);_0x32d4e7[_0xe8fc('0x4a')]=qs[_0xe8fc('0x4b')](_[_0xe8fc('0xa3')](_0x2439e2['query'],_0x2a7d3b['filters']));_0x32d4e7[_0xe8fc('0x4a')][_0xe8fc('0x62')]=_0x573f37['id'];if(_0x2439e2[_0xe8fc('0x43')]['filter']){_0x32d4e7['where']=_[_0xe8fc('0x4e')](_0x32d4e7[_0xe8fc('0x4a')],{'$or':_[_0xe8fc('0x3d')](_0x32d4e7[_0xe8fc('0x45')],function(_0xc4bc3f){var _0x4a9e17={};_0x4a9e17[_0xc4bc3f]={'$like':'%'+_0x2439e2[_0xe8fc('0x43')][_0xe8fc('0x4c')]+'%'};return _0x4a9e17;})});}_0x32d4e7=_['merge']({},_0x32d4e7,_0x2439e2['options']);return db[_0xe8fc('0x8b')]['count']({'where':_0x32d4e7[_0xe8fc('0x4a')]})[_0xe8fc('0x1e')](function(_0x4a078b){_0x501602['count']=_0x4a078b;if(_0x2439e2[_0xe8fc('0x43')][_0xe8fc('0x4f')]){_0x32d4e7[_0xe8fc('0x50')]=[{'model':db[_0xe8fc('0x6f')],'as':_0xe8fc('0xa5'),'required':![]},{'model':db[_0xe8fc('0x96')],'as':_0xe8fc('0xa6'),'attributes':[_0xe8fc('0x39'),_0xe8fc('0xa7'),_0xe8fc('0xa8')],'required':![]},{'model':db[_0xe8fc('0xa9')],'as':'Tags','attributes':['id',_0xe8fc('0x39'),_0xe8fc('0xaa')],'where':_0x2439e2[_0xe8fc('0x43')]['tag']?{'id':_0x2439e2[_0xe8fc('0x43')][_0xe8fc('0xab')]}:undefined,'required':_0x2439e2[_0xe8fc('0x43')][_0xe8fc('0xab')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xe8fc('0x51')](_0x32d4e7);})['then'](function(_0x39f3d8){_0x501602[_0xe8fc('0x52')]=_0x39f3d8;return _0x501602;});}})[_0xe8fc('0x1e')](respondWithFilteredResult(_0x5a94ac,_0x32d4e7))[_0xe8fc('0x27')](handleError(_0x5a94ac,null));};exports[_0xe8fc('0xac')]=function(_0x2f7930,_0x421f73,_0x5a7253){return db['OpenchannelAccount'][_0xe8fc('0x57')]({'where':{'id':_0x2f7930[_0xe8fc('0x54')]['id']}})[_0xe8fc('0x1e')](handleEntityNotFound(_0x421f73,null))[_0xe8fc('0x1e')](function(_0x4a6de8){if(_0x4a6de8){return _0x4a6de8[_0xe8fc('0xac')](_0x2f7930[_0xe8fc('0x5f')][_0xe8fc('0x69')],_[_0xe8fc('0xad')](_0x2f7930['body'],[_0xe8fc('0x69'),'id'])||{})[_0xe8fc('0xae')](function(_0x478c2e){for(var _0x5fb69d=0x0;_0x5fb69d<_0x2f7930[_0xe8fc('0x5f')][_0xe8fc('0x69')][_0xe8fc('0x47')];_0x5fb69d+=0x1){socket[_0xe8fc('0xaf')](_0xe8fc('0xb0'),{'UserId':Number(_0x2f7930[_0xe8fc('0x5f')][_0xe8fc('0x69')][_0x5fb69d]),'OpenchannelAccountId':Number(_0x2f7930[_0xe8fc('0x54')]['id'])});}return _0x478c2e;});}})[_0xe8fc('0x1e')](respondWithResult(_0x421f73,null))[_0xe8fc('0x27')](handleError(_0x421f73,null));};exports['removeAgents']=function(_0x4b9cbb,_0x1b8b2c,_0x4f5767){return db['OpenchannelAccount'][_0xe8fc('0x57')]({'where':{'id':_0x4b9cbb[_0xe8fc('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b8b2c,null))['then'](function(_0x22c93f){if(_0x22c93f){return _0x22c93f[_0xe8fc('0xb1')](_0x4b9cbb[_0xe8fc('0x43')][_0xe8fc('0x69')])[_0xe8fc('0x1e')](function(){if(_['isArray'](_0x4b9cbb[_0xe8fc('0x43')][_0xe8fc('0x69')])){for(var _0x19c28e=0x0;_0x19c28e<_0x4b9cbb['query']['ids'][_0xe8fc('0x47')];_0x19c28e+=0x1){socket[_0xe8fc('0xaf')](_0xe8fc('0xb2'),{'UserId':Number(_0x4b9cbb[_0xe8fc('0x43')][_0xe8fc('0x69')][_0x19c28e]),'OpenchannelAccountId':Number(_0x4b9cbb[_0xe8fc('0x54')]['id'])});}}else{socket['emit'](_0xe8fc('0xb2'),{'UserId':Number(_0x4b9cbb[_0xe8fc('0x43')][_0xe8fc('0x69')]),'OpenchannelAccountId':Number(_0x4b9cbb['params']['id'])});}});}})[_0xe8fc('0x1e')](respondWithStatusCode(_0x1b8b2c,null))['catch'](handleError(_0x1b8b2c,null));};exports[_0xe8fc('0xb3')]=function(_0x4eadcf,_0x48e48f,_0x5a4cc8){var _0x56288c={};var _0x3da952={};var _0x24435e;var _0x484421;return db[_0xe8fc('0x3e')]['findOne']({'where':{'id':_0x4eadcf[_0xe8fc('0x54')]['id']}})[_0xe8fc('0x1e')](handleEntityNotFound(_0x48e48f,null))['then'](function(_0x386714){if(_0x386714){_0x24435e=_0x386714;_0x3da952[_0xe8fc('0x42')]=_[_0xe8fc('0x55')](db['User'][_0xe8fc('0x3f')]);_0x3da952[_0xe8fc('0x43')]=_[_0xe8fc('0x55')](_0x4eadcf[_0xe8fc('0x43')]);_0x3da952['filters']=_[_0xe8fc('0x44')](_0x3da952['model'],_0x3da952[_0xe8fc('0x43')]);_0x56288c['attributes']=_[_0xe8fc('0x44')](_0x3da952[_0xe8fc('0x42')],qs[_0xe8fc('0x46')](_0x4eadcf[_0xe8fc('0x43')][_0xe8fc('0x46')]));_0x56288c[_0xe8fc('0x45')]=_0x56288c[_0xe8fc('0x45')][_0xe8fc('0x47')]?_0x56288c['attributes']:_0x3da952[_0xe8fc('0x42')];_0x56288c['order']=qs[_0xe8fc('0x67')](_0x4eadcf[_0xe8fc('0x43')][_0xe8fc('0x67')]);_0x56288c[_0xe8fc('0x4a')]=qs['filters'](_[_0xe8fc('0xa3')](_0x4eadcf[_0xe8fc('0x43')],_0x3da952['filters']));if(_0x4eadcf[_0xe8fc('0x43')][_0xe8fc('0x4c')]){_0x56288c[_0xe8fc('0x4a')]=_['merge'](_0x56288c[_0xe8fc('0x4a')],{'$or':_[_0xe8fc('0x3d')](_0x56288c[_0xe8fc('0x45')],function(_0x327aed){var _0x22cff8={};_0x22cff8[_0x327aed]={'$like':'%'+_0x4eadcf[_0xe8fc('0x43')][_0xe8fc('0x4c')]+'%'};return _0x22cff8;})});}_0x56288c=_['merge']({},_0x56288c,_0x4eadcf[_0xe8fc('0x56')]);return _0x24435e[_0xe8fc('0xb3')](_0x56288c);}})['then'](function(_0x1dc21d){if(_0x1dc21d){_0x484421=_0x1dc21d[_0xe8fc('0x47')];if(!_0x4eadcf[_0xe8fc('0x43')][_0xe8fc('0x48')]('nolimit')){_0x56288c[_0xe8fc('0x2d')]=qs[_0xe8fc('0x2d')](_0x4eadcf[_0xe8fc('0x43')]['limit']);_0x56288c[_0xe8fc('0x2b')]=qs[_0xe8fc('0x2b')](_0x4eadcf[_0xe8fc('0x43')]['offset']);}return _0x24435e[_0xe8fc('0xb3')](_0x56288c);}})[_0xe8fc('0x1e')](function(_0x2bdff0){if(_0x2bdff0){return _0x2bdff0?{'count':_0x484421,'rows':_0x2bdff0}:null;}})[_0xe8fc('0x1e')](respondWithResult(_0x48e48f,null))['catch'](handleError(_0x48e48f,null));};exports['send']=function(_0x2674e7,_0x5ae4bc,_0xcc92cf){var _0x56ea3f,_0x4d7edb,_0x2ca8f7;if(_['isNil'](_0x2674e7[_0xe8fc('0x5f')][_0xe8fc('0x5f')])||_0x2674e7[_0xe8fc('0x5f')]['body']===''){throw new db[(_0xe8fc('0x70'))][(_0xe8fc('0x71'))](_0xe8fc('0x79'));}if(_[_0xe8fc('0x77')](_0x2674e7[_0xe8fc('0x5f')]['to'])){}_0x56ea3f=_0x2674e7[_0xe8fc('0x5f')]['to'];return db['OpenchannelAccount'][_0xe8fc('0x64')]({'where':{'id':_0x2674e7[_0xe8fc('0x54')]['id']}})[_0xe8fc('0x1e')](handleEntityNotFound(_0x5ae4bc,null))[_0xe8fc('0x1e')](function(_0x5a4364){if(_0x5a4364){return db[_0xe8fc('0x3e')][_0xe8fc('0x57')]({'where':{'id':_0x5a4364['id']},'include':[{'model':db[_0xe8fc('0x7d')],'as':_0xe8fc('0x7e'),'include':[{'model':db[_0xe8fc('0x6f')],'as':_0xe8fc('0x7f'),'where':{[_0x5a4364[_0xe8fc('0x7a')]]:_0x56ea3f},'limit':0x1,'order':[[_0xe8fc('0x74'),_0xe8fc('0xb4')]]}]}]})[_0xe8fc('0x1e')](handleEntityNotFound(_0x5ae4bc,null))['then'](function(_0x48df19){if(_0x48df19&&_0x48df19[_0xe8fc('0x7e')]){_0x4d7edb=_0x48df19[_0xe8fc('0x33')]({'plain':!![]});if(_0x4d7edb[_0xe8fc('0x7e')]&&_0x4d7edb[_0xe8fc('0x7e')][_0xe8fc('0x7f')]['length']){return _0x4d7edb[_0xe8fc('0x7e')][_0xe8fc('0x7f')][0x0];}return db[_0xe8fc('0x6f')][_0xe8fc('0x58')](_[_0xe8fc('0x87')](_0x2674e7[_0xe8fc('0x5f')],{'firstName':_0x56ea3f,[_0x48df19[_0xe8fc('0x7a')]]:_0x56ea3f,'phone':_0x56ea3f,'ListId':_0x4d7edb[_0xe8fc('0x76')]}));}})[_0xe8fc('0x1e')](handleEntityNotFound(_0x5ae4bc,null))['then'](function(_0x5df8a0){if(_0x5df8a0){_0x2ca8f7=_0x5df8a0;return db['OpenchannelInteraction'][_0xe8fc('0x57')]({'where':{'ContactId':_0x2ca8f7['id'],'closed':![],'OpenchannelAccountId':_0x4d7edb['id']}})[_0xe8fc('0x1e')](function(_0x940e6){if(_0x940e6){return[_0x940e6,![]];}return db[_0xe8fc('0x8b')][_0xe8fc('0x58')]({'UserId':_0x2674e7['user']['id'],'ContactId':_0x2ca8f7['id'],'OpenchannelAccountId':_0x4d7edb['id'],'lastMsgDirection':_0xe8fc('0xb5'),'Messages':[_[_0xe8fc('0x4e')](_0x2674e7[_0xe8fc('0x5f')],{'read':![],'body':_0x2674e7[_0xe8fc('0x5f')][_0xe8fc('0x5f')],'OpenchannelAccountId':_0x4d7edb['id'],'UserId':_0x2674e7[_0xe8fc('0x5a')]['id'],'ContactId':_0x2ca8f7['id']})]},{'include':[{'model':db[_0xe8fc('0xb6')],'as':'Messages'}]})[_0xe8fc('0x1e')](function(_0x475b10){return[_0x475b10,!![]];});});}})[_0xe8fc('0xae')](function(_0x5e77dd,_0x5e5e68){if(_0x5e5e68){return _0x5e77dd;}return db[_0xe8fc('0xb6')][_0xe8fc('0x58')](_[_0xe8fc('0x4e')](_0x2674e7['body'],{'read':![],'body':_0x2674e7['body'][_0xe8fc('0x5f')],'OpenchannelAccountId':_0x4d7edb['id'],'OpenchannelInteractionId':_0x5e77dd['id'],'UserId':_0x2674e7[_0xe8fc('0x5a')]['id'],'ContactId':_0x2ca8f7['id']}))[_0xe8fc('0x1e')](function(_0x331e04){_0x5e77dd[_0xe8fc('0xb7')]['Messages']=[];_0x5e77dd[_0xe8fc('0xb7')]['Messages'][_0xe8fc('0x90')](_0x331e04[_0xe8fc('0xb7')]);return _0x5e77dd;});});}})[_0xe8fc('0x1e')](respondWithResult(_0x5ae4bc,null))[_0xe8fc('0x27')](handleError(_0x5ae4bc,null));}; \ No newline at end of file +var _0xa475=['nolimit','order','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','include','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','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','from','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','name','index','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','options','includeAll','findAll','show','params','Pause','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne'];(function(_0x554ebc,_0x2906ae){var _0x3640fc=function(_0x438a54){while(--_0x438a54){_0x554ebc['push'](_0x554ebc['shift']());}};_0x3640fc(++_0x2906ae);}(_0xa475,0x1d3));var _0x5a47=function(_0x5c44bd,_0x561f65){_0x5c44bd=_0x5c44bd-0x0;var _0x4f06a7=_0xa475[_0x5c44bd];return _0x4f06a7;};'use strict';var emlformat=require(_0x5a47('0x0'));var rimraf=require(_0x5a47('0x1'));var zipdir=require(_0x5a47('0x2'));var jsonpatch=require(_0x5a47('0x3'));var rp=require(_0x5a47('0x4'));var moment=require(_0x5a47('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5a47('0x6'));var util=require(_0x5a47('0x7'));var path=require(_0x5a47('0x8'));var sox=require(_0x5a47('0x9'));var csv=require('to-csv');var ejs=require(_0x5a47('0xa'));var fs=require('fs');var fs_extra=require(_0x5a47('0xb'));var _=require('lodash');var squel=require(_0x5a47('0xc'));var crypto=require(_0x5a47('0xd'));var jsforce=require(_0x5a47('0xe'));var deskjs=require(_0x5a47('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5a47('0x10'));var Papa=require(_0x5a47('0x11'));var Redis=require(_0x5a47('0x12'));var authService=require(_0x5a47('0x13'));var qs=require(_0x5a47('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a47('0x15'));var utils=require(_0x5a47('0x16'));var config=require(_0x5a47('0x17'));var licenseUtil=require(_0x5a47('0x18'));var db=require(_0x5a47('0x19'))['db'];config['redis']=_[_0x5a47('0x1a')](config['redis'],{'host':_0x5a47('0x1b'),'port':0x18eb});var socket=require(_0x5a47('0x1c'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x5a47('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x5a47('0x1e')][_0x5a47('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2056e4,_0x2a13f3,_0x109760,_0x192aa9){return new BPromise(function(_0x247e49,_0x322b1f){var _0xaf49bf=_0x192aa9||client;return _0xaf49bf[_0x5a47('0x20')](_0x2056e4,_0x109760)[_0x5a47('0x21')](function(_0x3b903b){logger[_0x5a47('0x22')](_0x5a47('0x23'),_0x2a13f3,_0x5a47('0x24'));logger[_0x5a47('0x25')](_0x5a47('0x26'),_0x2a13f3,_0x5a47('0x24'),JSON[_0x5a47('0x27')](_0x3b903b));if(_0x3b903b[_0x5a47('0x28')]){if(_0x3b903b[_0x5a47('0x28')][_0x5a47('0x29')]===0x1f4){logger[_0x5a47('0x28')](_0x5a47('0x23'),_0x2a13f3,_0x3b903b[_0x5a47('0x28')][_0x5a47('0x2a')]);return _0x322b1f(_0x3b903b[_0x5a47('0x28')][_0x5a47('0x2a')]);}logger[_0x5a47('0x28')](_0x5a47('0x23'),_0x2a13f3,_0x3b903b[_0x5a47('0x28')][_0x5a47('0x2a')]);return _0x247e49(_0x3b903b[_0x5a47('0x28')][_0x5a47('0x2a')]);}else{logger[_0x5a47('0x22')](_0x5a47('0x23'),_0x2a13f3,'request\x20sent');_0x247e49(_0x3b903b[_0x5a47('0x2b')][_0x5a47('0x2a')]);}})[_0x5a47('0x2c')](function(_0xfc698){logger['error'](_0x5a47('0x23'),_0x2a13f3,_0xfc698);_0x322b1f(_0xfc698);});});}function respondWithStatusCode(_0x318aba,_0x30d869){_0x30d869=_0x30d869||0xcc;return function(_0x4c5bed){if(_0x4c5bed){return _0x318aba[_0x5a47('0x2d')](_0x30d869);}return _0x318aba['status'](_0x30d869)[_0x5a47('0x2e')]();};}function respondWithResult(_0x1f4e6b,_0x10c3b3){_0x10c3b3=_0x10c3b3||0xc8;return function(_0x388b0f){if(_0x388b0f){return _0x1f4e6b['status'](_0x10c3b3)[_0x5a47('0x2f')](_0x388b0f);}};}function respondWithFilteredResult(_0x155d8f,_0x5bd47b){return function(_0x544066){if(_0x544066){var _0x3b662f=typeof _0x5bd47b[_0x5a47('0x30')]===_0x5a47('0x31')&&typeof _0x5bd47b[_0x5a47('0x32')]===_0x5a47('0x31');var _0x481ca8=_0x544066[_0x5a47('0x33')];var _0x156519=_0x3b662f?0x0:_0x5bd47b[_0x5a47('0x30')];var _0xbf673e=_0x3b662f?_0x544066[_0x5a47('0x33')]:_0x5bd47b[_0x5a47('0x30')]+_0x5bd47b[_0x5a47('0x32')];var _0x27937a;if(_0xbf673e>=_0x481ca8){_0xbf673e=_0x481ca8;_0x27937a=0xc8;}else{_0x27937a=0xce;}_0x155d8f['status'](_0x27937a);return _0x155d8f[_0x5a47('0x34')](_0x5a47('0x35'),_0x156519+'-'+_0xbf673e+'/'+_0x481ca8)[_0x5a47('0x2f')](_0x544066);}return null;};}function patchUpdates(_0x2ad177){return function(_0xbfd4bc){try{jsonpatch[_0x5a47('0x36')](_0xbfd4bc,_0x2ad177,!![]);}catch(_0x1c593a){return BPromise['reject'](_0x1c593a);}return _0xbfd4bc[_0x5a47('0x37')]();};}function saveUpdates(_0x2fe33a,_0x134550){return function(_0x126b2c){if(_0x126b2c){return _0x126b2c[_0x5a47('0x38')](_0x2fe33a)[_0x5a47('0x21')](function(_0x55d515){return _0x55d515;});}return null;};}function removeEntity(_0xc641c4,_0x2a41be){return function(_0x16a6eb){if(_0x16a6eb){return _0x16a6eb[_0x5a47('0x39')]()[_0x5a47('0x21')](function(){var _0x40339a=_0x16a6eb[_0x5a47('0x3a')]({'plain':!![]});var _0x5d6db1=_0x5a47('0x3b');return db[_0x5a47('0x3c')][_0x5a47('0x39')]({'where':{'type':_0x5d6db1,'resourceId':_0x40339a['id']}})[_0x5a47('0x21')](function(){return _0x16a6eb;});})[_0x5a47('0x21')](function(){_0xc641c4['status'](0xcc)[_0x5a47('0x2e')]();});}};}function handleEntityNotFound(_0x4564d4,_0x409002){return function(_0x41e7a0){if(!_0x41e7a0){_0x4564d4[_0x5a47('0x2d')](0x194);}return _0x41e7a0;};}function handleError(_0x20a443,_0x289f9d){_0x289f9d=_0x289f9d||0x1f4;return function(_0x40995c){logger[_0x5a47('0x28')](_0x40995c['stack']);if(_0x40995c[_0x5a47('0x3d')]){delete _0x40995c[_0x5a47('0x3d')];}_0x20a443['status'](_0x289f9d)['send'](_0x40995c);};}exports[_0x5a47('0x3e')]=function(_0x594c2c,_0x13f011){var _0x162d58={'include':[{'model':db['Pause'],'as':_0x5a47('0x3f')}]},_0x44c4e5={},_0xeaa626={'count':0x0,'rows':[]};var _0x10ffe6=_['map'](db[_0x5a47('0x40')][_0x5a47('0x41')],function(_0x2e6b3c){return{'name':_0x2e6b3c['fieldName'],'type':_0x2e6b3c[_0x5a47('0x42')]['key']};});_0x44c4e5[_0x5a47('0x43')]=_[_0x5a47('0x44')](_0x10ffe6,_0x5a47('0x3d'));_0x44c4e5[_0x5a47('0x45')]=_[_0x5a47('0x46')](_0x594c2c['query']);_0x44c4e5[_0x5a47('0x47')]=_[_0x5a47('0x48')](_0x44c4e5[_0x5a47('0x43')],_0x44c4e5[_0x5a47('0x45')]);_0x162d58[_0x5a47('0x49')]=_[_0x5a47('0x48')](_0x44c4e5[_0x5a47('0x43')],qs[_0x5a47('0x4a')](_0x594c2c[_0x5a47('0x45')][_0x5a47('0x4a')]));_0x162d58[_0x5a47('0x49')]=_0x162d58[_0x5a47('0x49')][_0x5a47('0x4b')]?_0x162d58[_0x5a47('0x49')]:_0x44c4e5[_0x5a47('0x43')];if(!_0x594c2c['query'][_0x5a47('0x4c')]('nolimit')){_0x162d58[_0x5a47('0x32')]=qs['limit'](_0x594c2c[_0x5a47('0x45')][_0x5a47('0x32')]);_0x162d58[_0x5a47('0x30')]=qs[_0x5a47('0x30')](_0x594c2c[_0x5a47('0x45')]['offset']);}_0x162d58['order']=qs[_0x5a47('0x4d')](_0x594c2c[_0x5a47('0x45')][_0x5a47('0x4d')]);_0x162d58[_0x5a47('0x4e')]=qs['filters'](_[_0x5a47('0x4f')](_0x594c2c[_0x5a47('0x45')],_0x44c4e5['filters']),_0x10ffe6);if(_0x594c2c[_0x5a47('0x45')][_0x5a47('0x50')]){_0x162d58[_0x5a47('0x4e')]=_['merge'](_0x162d58['where'],{'$or':_[_0x5a47('0x44')](_0x10ffe6,function(_0x2e4427){if(_0x2e4427[_0x5a47('0x42')]!=='VIRTUAL'){var _0x30605a={};_0x30605a[_0x2e4427[_0x5a47('0x3d')]]={'$like':'%'+_0x594c2c['query']['filter']+'%'};return _0x30605a;}})});}_0x162d58=_['merge']({},_0x162d58,_0x594c2c[_0x5a47('0x51')]);var _0x1fc14e={'where':_0x162d58[_0x5a47('0x4e')]};return db[_0x5a47('0x40')][_0x5a47('0x33')](_0x1fc14e)[_0x5a47('0x21')](function(_0x2eadf4){_0xeaa626[_0x5a47('0x33')]=_0x2eadf4;if(_0x594c2c[_0x5a47('0x45')][_0x5a47('0x52')]){_0x162d58['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0x5a47('0x53')](_0x162d58);})[_0x5a47('0x21')](function(_0x1d765f){_0xeaa626['rows']=_0x1d765f;return _0xeaa626;})[_0x5a47('0x21')](respondWithFilteredResult(_0x13f011,_0x162d58))['catch'](handleError(_0x13f011,null));};exports[_0x5a47('0x54')]=function(_0x14711c,_0x2dde73){var _0x3dd4bc={'raw':![],'where':{'id':_0x14711c[_0x5a47('0x55')]['id']},'include':[{'model':db[_0x5a47('0x56')],'as':_0x5a47('0x3f')}]},_0x2ee465={};_0x2ee465[_0x5a47('0x43')]=_['keys'](db[_0x5a47('0x40')][_0x5a47('0x41')]);_0x2ee465['query']=_['keys'](_0x14711c[_0x5a47('0x45')]);_0x2ee465[_0x5a47('0x47')]=_['intersection'](_0x2ee465[_0x5a47('0x43')],_0x2ee465[_0x5a47('0x45')]);_0x3dd4bc[_0x5a47('0x49')]=_[_0x5a47('0x48')](_0x2ee465[_0x5a47('0x43')],qs['fields'](_0x14711c['query']['fields']));_0x3dd4bc[_0x5a47('0x49')]=_0x3dd4bc[_0x5a47('0x49')][_0x5a47('0x4b')]?_0x3dd4bc[_0x5a47('0x49')]:_0x2ee465[_0x5a47('0x43')];if(_0x14711c[_0x5a47('0x45')][_0x5a47('0x52')]){_0x3dd4bc['include']=[{'all':!![]}];}_0x3dd4bc=_[_0x5a47('0x57')]({},_0x3dd4bc,_0x14711c[_0x5a47('0x51')]);return db['OpenchannelAccount'][_0x5a47('0x58')](_0x3dd4bc)[_0x5a47('0x21')](handleEntityNotFound(_0x2dde73,null))['then'](respondWithResult(_0x2dde73,null))['catch'](handleError(_0x2dde73,null));};exports[_0x5a47('0x59')]=function(_0x2e4135,_0x4548fe){return db[_0x5a47('0x40')][_0x5a47('0x59')](_0x2e4135['body'],{})['then'](function(_0x2ee688){var _0x3f6bd2=_0x2e4135[_0x5a47('0x5a')][_0x5a47('0x3a')]({'plain':!![]});if(!_0x3f6bd2)throw new Error(_0x5a47('0x5b'));if(_0x3f6bd2[_0x5a47('0x5c')]===_0x5a47('0x5a')){var _0x25f002=_0x2ee688[_0x5a47('0x3a')]({'plain':!![]});var _0x3f486e=_0x5a47('0x3b');return db['UserProfileSection']['find']({'where':{'name':_0x3f486e,'userProfileId':_0x3f6bd2[_0x5a47('0x5d')]},'raw':!![]})[_0x5a47('0x21')](function(_0x1d3af6){if(_0x1d3af6&&_0x1d3af6[_0x5a47('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x25f002[_0x5a47('0x3d')],'resourceId':_0x25f002['id'],'type':_0x1d3af6[_0x5a47('0x3d')],'sectionId':_0x1d3af6['id']},{})[_0x5a47('0x21')](function(){return _0x2ee688;});}else{return _0x2ee688;}})[_0x5a47('0x2c')](function(_0x25e672){logger[_0x5a47('0x28')](_0x5a47('0x5f'),_0x25e672);throw _0x25e672;});}return _0x2ee688;})['then'](respondWithResult(_0x4548fe,0xc9))[_0x5a47('0x2c')](handleError(_0x4548fe,null));};exports[_0x5a47('0x38')]=function(_0x59ee07,_0x1dc960){if(_0x59ee07[_0x5a47('0x60')]['id']){delete _0x59ee07[_0x5a47('0x60')]['id'];}return db[_0x5a47('0x40')][_0x5a47('0x58')]({'where':{'id':_0x59ee07['params']['id']},'include':[{'model':db['Pause'],'as':_0x5a47('0x3f')}]})[_0x5a47('0x21')](handleEntityNotFound(_0x1dc960,null))['then'](saveUpdates(_0x59ee07[_0x5a47('0x60')],null))[_0x5a47('0x21')](respondWithResult(_0x1dc960,null))['catch'](handleError(_0x1dc960,null));};exports[_0x5a47('0x39')]=function(_0x292723,_0x1031ce){return db['OpenchannelAccount'][_0x5a47('0x58')]({'where':{'id':_0x292723[_0x5a47('0x55')]['id']}})['then'](handleEntityNotFound(_0x1031ce,null))[_0x5a47('0x21')](removeEntity(_0x1031ce,null))[_0x5a47('0x2c')](handleError(_0x1031ce,null));};exports[_0x5a47('0x61')]=function(_0x3b15e7,_0x2dd7c5){return db[_0x5a47('0x40')][_0x5a47('0x61')]()[_0x5a47('0x21')](respondWithResult(_0x2dd7c5,null))[_0x5a47('0x2c')](handleError(_0x2dd7c5,null));};exports[_0x5a47('0x62')]=function(_0x2b6c5b,_0x3b331b,_0x5d88d0){if(_0x2b6c5b[_0x5a47('0x60')]['id']){delete _0x2b6c5b['body']['id'];}return db[_0x5a47('0x40')][_0x5a47('0x58')]({'where':{'id':_0x2b6c5b[_0x5a47('0x55')]['id']}})['then'](handleEntityNotFound(_0x3b331b,null))[_0x5a47('0x21')](function(_0x4d0390){if(_0x4d0390){_0x2b6c5b[_0x5a47('0x60')][_0x5a47('0x63')]=_0x4d0390['id'];return db[_0x5a47('0x64')][_0x5a47('0x59')](_0x2b6c5b['body']);}})[_0x5a47('0x21')](respondWithResult(_0x3b331b,null))[_0x5a47('0x2c')](handleError(_0x3b331b,null));};exports[_0x5a47('0x65')]=function(_0x34b0b0,_0x458f55,_0x201266){var _0x2b3b27={'raw':![],'where':{}};var _0x8ef9d3={};var _0x268749={'count':0x0,'rows':[]};return db[_0x5a47('0x40')][_0x5a47('0x66')]({'where':{'id':_0x34b0b0[_0x5a47('0x55')]['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x458f55,null))[_0x5a47('0x21')](function(_0x388e17){if(_0x388e17){_0x8ef9d3['model']=_['keys'](db[_0x5a47('0x64')]['rawAttributes']);_0x8ef9d3[_0x5a47('0x45')]=_['keys'](_0x34b0b0[_0x5a47('0x45')]);_0x8ef9d3[_0x5a47('0x47')]=_[_0x5a47('0x48')](_0x8ef9d3['model'],_0x8ef9d3[_0x5a47('0x45')]);_0x2b3b27[_0x5a47('0x49')]=_[_0x5a47('0x48')](_0x8ef9d3[_0x5a47('0x43')],qs[_0x5a47('0x4a')](_0x34b0b0[_0x5a47('0x45')][_0x5a47('0x4a')]));_0x2b3b27[_0x5a47('0x49')]=_0x2b3b27[_0x5a47('0x49')][_0x5a47('0x4b')]?_0x2b3b27[_0x5a47('0x49')]:_0x8ef9d3['model'];if(!_0x34b0b0[_0x5a47('0x45')][_0x5a47('0x4c')](_0x5a47('0x67'))){_0x2b3b27[_0x5a47('0x32')]=qs['limit'](_0x34b0b0[_0x5a47('0x45')][_0x5a47('0x32')]);_0x2b3b27['offset']=qs['offset'](_0x34b0b0['query'][_0x5a47('0x30')]);}_0x2b3b27[_0x5a47('0x68')]=qs[_0x5a47('0x4d')](_0x34b0b0[_0x5a47('0x45')][_0x5a47('0x4d')]);_0x2b3b27[_0x5a47('0x4e')]=qs[_0x5a47('0x47')](_[_0x5a47('0x4f')](_0x34b0b0[_0x5a47('0x45')],_0x8ef9d3[_0x5a47('0x47')]));_0x2b3b27[_0x5a47('0x4e')]['OpenchannelAccountId']=_0x388e17['id'];if(_0x34b0b0[_0x5a47('0x45')]['filter']){_0x2b3b27[_0x5a47('0x4e')]=_['merge'](_0x2b3b27[_0x5a47('0x4e')],{'$or':_[_0x5a47('0x44')](_0x2b3b27[_0x5a47('0x49')],function(_0xfb8972){var _0x1fe370={};_0x1fe370[_0xfb8972]={'$like':'%'+_0x34b0b0[_0x5a47('0x45')]['filter']+'%'};return _0x1fe370;})});}_0x2b3b27=_[_0x5a47('0x57')]({},_0x2b3b27,_0x34b0b0[_0x5a47('0x51')]);return db['Disposition'][_0x5a47('0x33')]({'where':_0x2b3b27[_0x5a47('0x4e')]})[_0x5a47('0x21')](function(_0x28afcf){_0x268749[_0x5a47('0x33')]=_0x28afcf;if(_0x34b0b0[_0x5a47('0x45')][_0x5a47('0x52')]){_0x2b3b27['include']=[{'all':!![]}];}return db[_0x5a47('0x64')][_0x5a47('0x53')](_0x2b3b27);})['then'](function(_0x4de070){_0x268749[_0x5a47('0x69')]=_0x4de070;return _0x268749;});}})[_0x5a47('0x21')](respondWithFilteredResult(_0x458f55,_0x2b3b27))[_0x5a47('0x2c')](handleError(_0x458f55,null));};exports[_0x5a47('0x6a')]=function(_0x13faea,_0x259667,_0x3c2da2){return db[_0x5a47('0x40')]['find']({'where':{'id':_0x13faea['params']['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x259667,null))[_0x5a47('0x21')](function(_0x3c9f2){if(_0x3c9f2){return _0x3c9f2[_0x5a47('0x6a')](_0x13faea[_0x5a47('0x45')][_0x5a47('0x6b')]);}})['then'](respondWithStatusCode(_0x259667,null))[_0x5a47('0x2c')](handleError(_0x259667,null));};exports[_0x5a47('0x6c')]=function(_0x15d627,_0x44fd84,_0x140da4){if(_0x15d627['body']['id']){delete _0x15d627[_0x5a47('0x60')]['id'];}return db[_0x5a47('0x40')][_0x5a47('0x58')]({'where':{'id':_0x15d627['params']['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x44fd84,null))[_0x5a47('0x21')](function(_0x16189f){if(_0x16189f){_0x15d627[_0x5a47('0x60')][_0x5a47('0x63')]=_0x16189f['id'];return db[_0x5a47('0x6d')][_0x5a47('0x59')](_0x15d627[_0x5a47('0x60')]);}})[_0x5a47('0x21')](respondWithResult(_0x44fd84,null))[_0x5a47('0x2c')](handleError(_0x44fd84,null));};exports[_0x5a47('0x6e')]=function(_0x5d5d28,_0x25704d,_0x45f70e){var _0x491173={'raw':![],'where':{}};var _0x49364e={};var _0x4dc36c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x5a47('0x66')]({'where':{'id':_0x5d5d28[_0x5a47('0x55')]['id']}})['then'](handleEntityNotFound(_0x25704d,null))[_0x5a47('0x21')](function(_0x311502){if(_0x311502){_0x49364e['model']=_[_0x5a47('0x46')](db['CannedAnswer'][_0x5a47('0x41')]);_0x49364e[_0x5a47('0x45')]=_[_0x5a47('0x46')](_0x5d5d28[_0x5a47('0x45')]);_0x49364e[_0x5a47('0x47')]=_[_0x5a47('0x48')](_0x49364e['model'],_0x49364e['query']);_0x491173[_0x5a47('0x49')]=_[_0x5a47('0x48')](_0x49364e[_0x5a47('0x43')],qs[_0x5a47('0x4a')](_0x5d5d28[_0x5a47('0x45')][_0x5a47('0x4a')]));_0x491173[_0x5a47('0x49')]=_0x491173['attributes']['length']?_0x491173[_0x5a47('0x49')]:_0x49364e['model'];if(!_0x5d5d28[_0x5a47('0x45')]['hasOwnProperty']('nolimit')){_0x491173[_0x5a47('0x32')]=qs[_0x5a47('0x32')](_0x5d5d28[_0x5a47('0x45')][_0x5a47('0x32')]);_0x491173[_0x5a47('0x30')]=qs['offset'](_0x5d5d28['query'][_0x5a47('0x30')]);}_0x491173[_0x5a47('0x68')]=qs[_0x5a47('0x4d')](_0x5d5d28[_0x5a47('0x45')][_0x5a47('0x4d')]);_0x491173['where']=qs[_0x5a47('0x47')](_[_0x5a47('0x4f')](_0x5d5d28[_0x5a47('0x45')],_0x49364e['filters']));_0x491173[_0x5a47('0x4e')]['OpenchannelAccountId']=_0x311502['id'];if(_0x5d5d28[_0x5a47('0x45')][_0x5a47('0x50')]){_0x491173[_0x5a47('0x4e')]=_[_0x5a47('0x57')](_0x491173[_0x5a47('0x4e')],{'$or':_[_0x5a47('0x44')](_0x491173[_0x5a47('0x49')],function(_0x2758b8){var _0x1b9393={};_0x1b9393[_0x2758b8]={'$like':'%'+_0x5d5d28[_0x5a47('0x45')][_0x5a47('0x50')]+'%'};return _0x1b9393;})});}_0x491173=_[_0x5a47('0x57')]({},_0x491173,_0x5d5d28[_0x5a47('0x51')]);return db[_0x5a47('0x6d')][_0x5a47('0x33')]({'where':_0x491173['where']})['then'](function(_0x376650){_0x4dc36c[_0x5a47('0x33')]=_0x376650;if(_0x5d5d28[_0x5a47('0x45')]['includeAll']){_0x491173[_0x5a47('0x6f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5a47('0x53')](_0x491173);})[_0x5a47('0x21')](function(_0x4b3f3e){_0x4dc36c[_0x5a47('0x69')]=_0x4b3f3e;return _0x4dc36c;});}})['then'](respondWithFilteredResult(_0x25704d,_0x491173))['catch'](handleError(_0x25704d,null));};exports[_0x5a47('0x70')]=function(_0x40de4f,_0x187f0c,_0x528f47){return db['OpenchannelAccount'][_0x5a47('0x58')]({'where':{'id':_0x40de4f[_0x5a47('0x55')]['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x187f0c,null))['then'](function(_0x5b7884){if(_0x5b7884){return _0x5b7884['removeAnswers'](_0x40de4f['query'][_0x5a47('0x6b')]);}})[_0x5a47('0x21')](respondWithStatusCode(_0x187f0c,null))[_0x5a47('0x2c')](handleError(_0x187f0c,null));};exports['notify']=function(_0x8ae7eb,_0x2a6131,_0x21a01f){var _0x1f9f61={'body':_0x8ae7eb[_0x5a47('0x60')],'channel':_0x5a47('0x71')};var _0x4dd769=[];var _0x5d3761=[];var _0x5abb62={};var _0x216374=![];return db[_0x5a47('0x72')][_0x5a47('0x61')]()[_0x5a47('0x21')](function(_0x569332){if(!_0x569332){throw new db[(_0x5a47('0x73'))][(_0x5a47('0x74'))](_0x5a47('0x75'));}_0x4dd769=_[_0x5a47('0x76')](_[_0x5a47('0x46')](_0x569332),['createdAt','updatedAt']);_0x5d3761=_['difference'](_[_0x5a47('0x46')](_0x569332),[_0x5a47('0x77'),_0x5a47('0x78'),'CompanyId',_0x5a47('0x79')]);if(_0x8ae7eb['body']['id']){delete _0x8ae7eb['body']['id'];}if(_[_0x5a47('0x7a')](_0x8ae7eb[_0x5a47('0x60')]['from'])){throw new db[(_0x5a47('0x73'))][(_0x5a47('0x74'))](_0x5a47('0x7b'));}if(_[_0x5a47('0x7a')](_0x8ae7eb[_0x5a47('0x60')][_0x5a47('0x60')])||_0x8ae7eb[_0x5a47('0x60')][_0x5a47('0x60')]===''){throw new db[(_0x5a47('0x73'))]['ValidationError'](_0x5a47('0x7c'));}if(_[_0x5a47('0x7a')](_0x8ae7eb[_0x5a47('0x60')][_0x5a47('0x7d')])){throw new db['Sequelize'][(_0x5a47('0x74'))](_0x5a47('0x7e')+_0x5d3761);}if(!_[_0x5a47('0x7f')](_0x5d3761,_0x8ae7eb[_0x5a47('0x60')][_0x5a47('0x7d')])){throw new db['Sequelize'][(_0x5a47('0x74'))](_0x5a47('0x80')+_0x5d3761);}_0x5abb62[_0x8ae7eb[_0x5a47('0x60')]['mapKey']]=_0x8ae7eb[_0x5a47('0x60')][_0x5a47('0x81')];})[_0x5a47('0x21')](function(){return db[_0x5a47('0x40')]['find']({'where':{'id':_0x8ae7eb['params']['id']},'include':[{'model':db[_0x5a47('0x82')],'as':_0x5a47('0x83'),'include':[{'model':db[_0x5a47('0x72')],'as':_0x5a47('0x84'),'where':_0x5abb62,'limit':0x1,'order':[[_0x5a47('0x78'),_0x5a47('0x85')]]}]},{'model':db[_0x5a47('0x86')],'as':_0x5a47('0x87')}]});})[_0x5a47('0x21')](handleEntityNotFound(_0x2a6131,null))[_0x5a47('0x21')](function(_0x154817){if(_0x154817&&_0x154817['List']){_0x1f9f61[_0x5a47('0x88')]=_0x154817;_0x1f9f61[_0x5a47('0x89')]=_0x154817[_0x5a47('0x87')];_0x1f9f61[_0x5a47('0x8a')]=_0x154817[_0x5a47('0x83')];_0x1f9f61[_0x5a47('0x89')]=_[_0x5a47('0x8b')](_0x1f9f61[_0x5a47('0x89')],['priority'],['asc']);if(_0x1f9f61[_0x5a47('0x88')][_0x5a47('0x87')]){delete _0x1f9f61[_0x5a47('0x88')][_0x5a47('0x87')];}if(_0x1f9f61[_0x5a47('0x88')]['List']&&_0x1f9f61[_0x5a47('0x88')][_0x5a47('0x83')]['Contacts'][_0x5a47('0x4b')]){return _0x1f9f61[_0x5a47('0x88')][_0x5a47('0x83')]['Contacts'][0x0];}var _0x47bcd3=_[_0x5a47('0x1a')](_0x8ae7eb[_0x5a47('0x60')],{'firstName':_0x8ae7eb[_0x5a47('0x60')]['from'],'ListId':_0x154817[_0x5a47('0x79')]});_0x47bcd3[_0x8ae7eb['body'][_0x5a47('0x7d')]]=_0x8ae7eb['body'][_0x5a47('0x81')];return db[_0x5a47('0x72')]['create'](_0x47bcd3,{'fields':_0x4dd769,'raw':!![]});}})['then'](handleEntityNotFound(_0x2a6131,null))[_0x5a47('0x21')](function(_0x12ca13){_0x1f9f61[_0x5a47('0x8c')]=_0x12ca13;if(_0x12ca13){var _0x362c17={'ContactId':_0x12ca13['id'],'OpenchannelAccountId':_0x8ae7eb[_0x5a47('0x55')]['id'],'from':(_0x12ca13[_0x5a47('0x8d')]||'')+'\x20'+(_0x12ca13[_0x5a47('0x8e')]||'')};var _0x5ba174={'OpenchannelAccountId':_0x8ae7eb[_0x5a47('0x55')]['id'],'closed':![]};if(_0x8ae7eb['body'][_0x5a47('0x8f')]){_0x5ba174[_0x5a47('0x8f')]=_0x8ae7eb[_0x5a47('0x60')][_0x5a47('0x8f')];return db[_0x5a47('0x90')][_0x5a47('0x58')]({'where':_0x5ba174})['then'](function(_0x5049db){if(_0x5049db){return[_0x5049db,![]];}_0x362c17['threadId']=_0x8ae7eb['body'][_0x5a47('0x8f')];_0x362c17[_0x5a47('0x91')]=_0x8ae7eb[_0x5a47('0x60')][_0x5a47('0x91')];return db[_0x5a47('0x90')][_0x5a47('0x59')](_0x362c17)[_0x5a47('0x21')](function(_0x59ce0a){return[_0x59ce0a,!![]];});});}else{_0x5ba174[_0x5a47('0x8f')]=null;}_0x5ba174['ContactId']=_0x12ca13['id'];return db[_0x5a47('0x90')][_0x5a47('0x58')]({'where':_0x5ba174})[_0x5a47('0x21')](function(_0x2558ea){if(_0x2558ea){return[_0x2558ea,![]];}return db[_0x5a47('0x90')][_0x5a47('0x59')](_0x362c17)['then'](function(_0x2bb99e){return[_0x2bb99e,!![]];});});}})[_0x5a47('0x92')](function(_0xfc0ba2,_0x57a680){if(_0xfc0ba2){_0x216374=_0x57a680;if(!_0x57a680){var _0xf3d18d={'from':(_0x1f9f61[_0x5a47('0x8c')][_0x5a47('0x8d')]||'')+'\x20'+(_0x1f9f61['contact']['lastName']||'')};if(_0x8ae7eb['body'][_0x5a47('0x8f')]&&_0x8ae7eb['body'][_0x5a47('0x93')]&&_0x8ae7eb['body'][_0x5a47('0x8f')]!=_0x8ae7eb[_0x5a47('0x60')][_0x5a47('0x93')]){_0xf3d18d['threadId']=_0x8ae7eb[_0x5a47('0x60')][_0x5a47('0x93')];}return _0xfc0ba2[_0x5a47('0x38')](_0xf3d18d);}else{return _0xfc0ba2;}}})[_0x5a47('0x21')](function(_0x1a74c7){_0x1f9f61[_0x5a47('0x94')]=_0x1a74c7[_0x5a47('0x3a')]({'plain':!![]});_0x1f9f61['interaction'][_0x5a47('0x95')]=_0x216374;if(_0x1f9f61[_0x5a47('0x94')][_0x5a47('0x95')]){if(_0x1f9f61[_0x5a47('0x88')][_0x5a47('0x96')]){_0x1f9f61[_0x5a47('0x89')][_0x5a47('0x97')]({'id':0x0,'priority':_0x1f9f61[_0x5a47('0x89')][_0x5a47('0x4b')]+0x1,'app':'close','appdata':_0x5a47('0x98'),'interval':_0x5a47('0x99')});}}return db[_0x5a47('0x9a')][_0x5a47('0x59')]({'body':_0x8ae7eb['body']['body'],'OpenchannelAccountId':_0x8ae7eb[_0x5a47('0x55')]['id'],'OpenchannelInteractionId':_0x1a74c7['id'],'direction':'in','ContactId':_0x1f9f61[_0x5a47('0x8c')]['id'],'AttachmentId':_0x8ae7eb[_0x5a47('0x60')][_0x5a47('0x9b')]});})['then'](function(_0x5d0c98){_0x1f9f61[_0x5a47('0x2a')]=_0x5d0c98;if(_0x1f9f61[_0x5a47('0x94')][_0x5a47('0x9c')]){return db[_0x5a47('0x9d')][_0x5a47('0x58')]({'attributes':['id',_0x5a47('0x3d')],'where':{'id':_0x1f9f61[_0x5a47('0x94')][_0x5a47('0x9c')]}})['then'](function(_0x264343){if(_0x264343){_0x1f9f61[_0x5a47('0x89')][_0x5a47('0x9e')]({'id':0x0,'priority':0x0,'app':_0x5a47('0x9f'),'appdata':_0x264343[_0x5a47('0x3d')]+','+(_0x1f9f61[_0x5a47('0x88')][_0x5a47('0xa0')]||0xa),'interval':'*,*,*,*'});_0x1f9f61[_0x5a47('0xa1')]=![];}return respondWithRpcPromise(_0x5a47('0xa2'),_0x5a47('0xa3'),_0x1f9f61);});}return respondWithRpcPromise(_0x5a47('0xa2'),'startRouting',_0x1f9f61);})[_0x5a47('0x21')](function(_0x2f4359){respondWithRpcPromise(_0x5a47('0xa4'),_0x5a47('0xa4'),{'event':_0x5a47('0xa5'),'message':_0x2f4359},client9002);return _0x2f4359;})[_0x5a47('0x21')](respondWithResult(_0x2a6131,null))[_0x5a47('0x2c')](handleError(_0x2a6131,null));};exports['addApplications']=function(_0x2e3180,_0x37d037,_0x30413e){return db[_0x5a47('0x40')][_0x5a47('0x66')]({'where':{'id':_0x2e3180[_0x5a47('0x55')]['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x37d037,null))[_0x5a47('0x21')](function(_0x3090f5){if(_0x3090f5){return db[_0x5a47('0xa6')][_0x5a47('0xa7')](function(_0x8b8374){return db[_0x5a47('0x86')][_0x5a47('0x39')]({'where':{'OpenchannelAccountId':_0x2e3180[_0x5a47('0x55')]['id']},'transaction':_0x8b8374})[_0x5a47('0x21')](function(_0x5bb047){var _0x3d4d64=_['map'](_0x2e3180['body'],function(_0x2ddf76){_0x2ddf76['OpenchannelAccountId']=_0x2e3180[_0x5a47('0x55')]['id'];return _0x2ddf76;});return db['OpenchannelApplication'][_0x5a47('0xa8')](_0x3d4d64,{'transaction':_0x8b8374});});})[_0x5a47('0x21')](function(){return db[_0x5a47('0x86')][_0x5a47('0xa9')]({'where':{'OpenchannelAccountId':_0x2e3180[_0x5a47('0x55')]['id']},'order':'priority'});});}})[_0x5a47('0x21')](respondWithResult(_0x37d037,null))[_0x5a47('0x2c')](handleError(_0x37d037,null));};exports['getApplications']=function(_0x569006,_0x596962,_0x371c45){var _0x112f79={};var _0x277cbc={};var _0x3114ad;var _0x4a3e09;return db[_0x5a47('0x40')][_0x5a47('0x66')]({'where':{'id':_0x569006[_0x5a47('0x55')]['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x596962,null))[_0x5a47('0x21')](function(_0x45e6a1){if(_0x45e6a1){_0x3114ad=_0x45e6a1;_0x277cbc[_0x5a47('0x43')]=_[_0x5a47('0x46')](db[_0x5a47('0x86')][_0x5a47('0x41')]);_0x277cbc['query']=_['keys'](_0x569006['query']);_0x277cbc[_0x5a47('0x47')]=_['intersection'](_0x277cbc[_0x5a47('0x43')],_0x277cbc['query']);_0x112f79['attributes']=_[_0x5a47('0x48')](_0x277cbc[_0x5a47('0x43')],qs[_0x5a47('0x4a')](_0x569006['query'][_0x5a47('0x4a')]));_0x112f79[_0x5a47('0x49')]=_0x112f79['attributes'][_0x5a47('0x4b')]?_0x112f79[_0x5a47('0x49')]:_0x277cbc[_0x5a47('0x43')];_0x112f79[_0x5a47('0x68')]=qs[_0x5a47('0x4d')](_0x569006['query']['sort']);_0x112f79[_0x5a47('0x4e')]=qs[_0x5a47('0x47')](_['pick'](_0x569006['query'],_0x277cbc[_0x5a47('0x47')]));if(_0x569006['query']['filter']){_0x112f79['where']=_['merge'](_0x112f79[_0x5a47('0x4e')],{'$or':_[_0x5a47('0x44')](_0x112f79[_0x5a47('0x49')],function(_0x29b65a){var _0x3c0d0e={};_0x3c0d0e[_0x29b65a]={'$like':'%'+_0x569006[_0x5a47('0x45')][_0x5a47('0x50')]+'%'};return _0x3c0d0e;})});}_0x112f79=_[_0x5a47('0x57')]({},_0x112f79,_0x569006[_0x5a47('0x51')]);return _0x3114ad[_0x5a47('0xaa')](_0x112f79);}})[_0x5a47('0x21')](function(_0x44a2fb){if(_0x44a2fb){_0x4a3e09=_0x44a2fb['length'];if(!_0x569006[_0x5a47('0x45')][_0x5a47('0x4c')](_0x5a47('0x67'))){_0x112f79['limit']=qs[_0x5a47('0x32')](_0x569006['query'][_0x5a47('0x32')]);_0x112f79[_0x5a47('0x30')]=qs['offset'](_0x569006[_0x5a47('0x45')][_0x5a47('0x30')]);}return _0x3114ad[_0x5a47('0xaa')](_0x112f79);}})[_0x5a47('0x21')](function(_0x24ae53){if(_0x24ae53){return _0x24ae53?{'count':_0x4a3e09,'rows':_0x24ae53}:null;}})[_0x5a47('0x21')](respondWithResult(_0x596962,null))[_0x5a47('0x2c')](handleError(_0x596962,null));};exports[_0x5a47('0xab')]=function(_0x45cf28,_0x2156ae,_0x96a5a7){var _0x4f609f={'raw':![],'where':{}};var _0x191ef0={};var _0x44e10b={'count':0x0,'rows':[]};return db[_0x5a47('0x40')][_0x5a47('0x66')]({'where':{'id':_0x45cf28[_0x5a47('0x55')]['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x2156ae,null))['then'](function(_0x59d90f){if(_0x59d90f){_0x191ef0[_0x5a47('0x43')]=_[_0x5a47('0x46')](db['OpenchannelInteraction']['rawAttributes']);_0x191ef0[_0x5a47('0x45')]=_[_0x5a47('0x46')](_0x45cf28[_0x5a47('0x45')]);_0x191ef0[_0x5a47('0x47')]=_['intersection'](_0x191ef0[_0x5a47('0x43')],_0x191ef0[_0x5a47('0x45')]);_0x4f609f[_0x5a47('0x49')]=_[_0x5a47('0x48')](_0x191ef0['model'],qs['fields'](_0x45cf28[_0x5a47('0x45')][_0x5a47('0x4a')]));_0x4f609f['attributes']=_0x4f609f['attributes'][_0x5a47('0x4b')]?_0x4f609f['attributes']:_0x191ef0['model'];if(!_0x45cf28['query'][_0x5a47('0x4c')](_0x5a47('0x67'))){_0x4f609f['limit']=qs[_0x5a47('0x32')](_0x45cf28[_0x5a47('0x45')][_0x5a47('0x32')]);_0x4f609f['offset']=qs[_0x5a47('0x30')](_0x45cf28[_0x5a47('0x45')]['offset']);}_0x4f609f[_0x5a47('0x68')]=qs['sort'](_0x45cf28[_0x5a47('0x45')][_0x5a47('0x4d')]);_0x4f609f['where']=qs['filters'](_[_0x5a47('0x4f')](_0x45cf28['query'],_0x191ef0[_0x5a47('0x47')]));_0x4f609f[_0x5a47('0x4e')][_0x5a47('0x63')]=_0x59d90f['id'];if(_0x45cf28['query'][_0x5a47('0x50')]){_0x4f609f[_0x5a47('0x4e')]=_[_0x5a47('0x57')](_0x4f609f[_0x5a47('0x4e')],{'$or':_[_0x5a47('0x44')](_0x4f609f[_0x5a47('0x49')],function(_0x18d82f){var _0x4b8137={};_0x4b8137[_0x18d82f]={'$like':'%'+_0x45cf28[_0x5a47('0x45')][_0x5a47('0x50')]+'%'};return _0x4b8137;})});}_0x4f609f=_[_0x5a47('0x57')]({},_0x4f609f,_0x45cf28[_0x5a47('0x51')]);return db[_0x5a47('0x90')][_0x5a47('0x33')]({'where':_0x4f609f[_0x5a47('0x4e')]})[_0x5a47('0x21')](function(_0x2c4a87){_0x44e10b[_0x5a47('0x33')]=_0x2c4a87;if(_0x45cf28[_0x5a47('0x45')][_0x5a47('0x52')]){_0x4f609f[_0x5a47('0x6f')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x5a47('0x3d'),_0x5a47('0xac'),_0x5a47('0xad')],'required':![]},{'model':db[_0x5a47('0xae')],'as':_0x5a47('0xaf'),'attributes':['id',_0x5a47('0x3d'),_0x5a47('0xb0')],'where':_0x45cf28[_0x5a47('0x45')][_0x5a47('0xb1')]?{'id':_0x45cf28['query'][_0x5a47('0xb1')]}:undefined,'required':_0x45cf28[_0x5a47('0x45')][_0x5a47('0xb1')]?!![]:![]}];}return db[_0x5a47('0x90')][_0x5a47('0x53')](_0x4f609f);})[_0x5a47('0x21')](function(_0x4d2daf){_0x44e10b[_0x5a47('0x69')]=_0x4d2daf;return _0x44e10b;});}})[_0x5a47('0x21')](respondWithFilteredResult(_0x2156ae,_0x4f609f))[_0x5a47('0x2c')](handleError(_0x2156ae,null));};exports[_0x5a47('0xb2')]=function(_0x2c3148,_0x40936e,_0x307343){return db[_0x5a47('0x40')]['find']({'where':{'id':_0x2c3148[_0x5a47('0x55')]['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x40936e,null))['then'](function(_0x561520){if(_0x561520){return _0x561520['addAgents'](_0x2c3148[_0x5a47('0x60')][_0x5a47('0x6b')],_[_0x5a47('0xb3')](_0x2c3148[_0x5a47('0x60')],[_0x5a47('0x6b'),'id'])||{})[_0x5a47('0x92')](function(_0x476268){for(var _0x35f3fa=0x0;_0x35f3fa<_0x2c3148[_0x5a47('0x60')][_0x5a47('0x6b')][_0x5a47('0x4b')];_0x35f3fa+=0x1){socket[_0x5a47('0xb4')](_0x5a47('0xb5'),{'UserId':Number(_0x2c3148[_0x5a47('0x60')][_0x5a47('0x6b')][_0x35f3fa]),'OpenchannelAccountId':Number(_0x2c3148[_0x5a47('0x55')]['id'])});}return _0x476268;});}})['then'](respondWithResult(_0x40936e,null))[_0x5a47('0x2c')](handleError(_0x40936e,null));};exports[_0x5a47('0xb6')]=function(_0x55c62f,_0x53d2f7,_0x302667){return db[_0x5a47('0x40')][_0x5a47('0x58')]({'where':{'id':_0x55c62f[_0x5a47('0x55')]['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x53d2f7,null))[_0x5a47('0x21')](function(_0x59d4d4){if(_0x59d4d4){return _0x59d4d4[_0x5a47('0xb6')](_0x55c62f[_0x5a47('0x45')][_0x5a47('0x6b')])[_0x5a47('0x21')](function(){if(_[_0x5a47('0xb7')](_0x55c62f['query'][_0x5a47('0x6b')])){for(var _0x4ada7f=0x0;_0x4ada7f<_0x55c62f[_0x5a47('0x45')][_0x5a47('0x6b')][_0x5a47('0x4b')];_0x4ada7f+=0x1){socket['emit'](_0x5a47('0xb8'),{'UserId':Number(_0x55c62f[_0x5a47('0x45')][_0x5a47('0x6b')][_0x4ada7f]),'OpenchannelAccountId':Number(_0x55c62f[_0x5a47('0x55')]['id'])});}}else{socket[_0x5a47('0xb4')](_0x5a47('0xb8'),{'UserId':Number(_0x55c62f[_0x5a47('0x45')][_0x5a47('0x6b')]),'OpenchannelAccountId':Number(_0x55c62f[_0x5a47('0x55')]['id'])});}});}})[_0x5a47('0x21')](respondWithStatusCode(_0x53d2f7,null))['catch'](handleError(_0x53d2f7,null));};exports[_0x5a47('0xb9')]=function(_0x1d9c4a,_0x1652d2,_0x1ae0ba){var _0x32e6a4={};var _0x2b82f5={};var _0x15f6ac;var _0x3485e0;return db[_0x5a47('0x40')][_0x5a47('0x66')]({'where':{'id':_0x1d9c4a[_0x5a47('0x55')]['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x1652d2,null))['then'](function(_0x379379){if(_0x379379){_0x15f6ac=_0x379379;_0x2b82f5[_0x5a47('0x43')]=_[_0x5a47('0x46')](db['User']['rawAttributes']);_0x2b82f5['query']=_[_0x5a47('0x46')](_0x1d9c4a[_0x5a47('0x45')]);_0x2b82f5[_0x5a47('0x47')]=_[_0x5a47('0x48')](_0x2b82f5['model'],_0x2b82f5[_0x5a47('0x45')]);_0x32e6a4['attributes']=_[_0x5a47('0x48')](_0x2b82f5[_0x5a47('0x43')],qs[_0x5a47('0x4a')](_0x1d9c4a[_0x5a47('0x45')][_0x5a47('0x4a')]));_0x32e6a4[_0x5a47('0x49')]=_0x32e6a4[_0x5a47('0x49')][_0x5a47('0x4b')]?_0x32e6a4['attributes']:_0x2b82f5['model'];_0x32e6a4['order']=qs[_0x5a47('0x4d')](_0x1d9c4a[_0x5a47('0x45')][_0x5a47('0x4d')]);_0x32e6a4[_0x5a47('0x4e')]=qs[_0x5a47('0x47')](_[_0x5a47('0x4f')](_0x1d9c4a[_0x5a47('0x45')],_0x2b82f5[_0x5a47('0x47')]));if(_0x1d9c4a['query'][_0x5a47('0x50')]){_0x32e6a4[_0x5a47('0x4e')]=_[_0x5a47('0x57')](_0x32e6a4[_0x5a47('0x4e')],{'$or':_[_0x5a47('0x44')](_0x32e6a4[_0x5a47('0x49')],function(_0x228d86){var _0x32f5fe={};_0x32f5fe[_0x228d86]={'$like':'%'+_0x1d9c4a[_0x5a47('0x45')]['filter']+'%'};return _0x32f5fe;})});}_0x32e6a4=_['merge']({},_0x32e6a4,_0x1d9c4a[_0x5a47('0x51')]);return _0x15f6ac['getAgents'](_0x32e6a4);}})[_0x5a47('0x21')](function(_0x1e640f){if(_0x1e640f){_0x3485e0=_0x1e640f[_0x5a47('0x4b')];if(!_0x1d9c4a[_0x5a47('0x45')]['hasOwnProperty'](_0x5a47('0x67'))){_0x32e6a4['limit']=qs[_0x5a47('0x32')](_0x1d9c4a[_0x5a47('0x45')]['limit']);_0x32e6a4[_0x5a47('0x30')]=qs[_0x5a47('0x30')](_0x1d9c4a[_0x5a47('0x45')][_0x5a47('0x30')]);}return _0x15f6ac[_0x5a47('0xb9')](_0x32e6a4);}})[_0x5a47('0x21')](function(_0x16a3aa){if(_0x16a3aa){return _0x16a3aa?{'count':_0x3485e0,'rows':_0x16a3aa}:null;}})['then'](respondWithResult(_0x1652d2,null))['catch'](handleError(_0x1652d2,null));};exports[_0x5a47('0xba')]=function(_0x309397,_0x22c50b,_0x5cbc25){var _0x51d6d8,_0x3c85c0,_0x27cefd;if(_[_0x5a47('0x7a')](_0x309397['body'][_0x5a47('0x60')])||_0x309397[_0x5a47('0x60')][_0x5a47('0x60')]===''){throw new db['Sequelize'][(_0x5a47('0x74'))](_0x5a47('0x7c'));}if(_[_0x5a47('0x7a')](_0x309397[_0x5a47('0x60')]['to'])){}_0x51d6d8=_0x309397['body']['to'];return db[_0x5a47('0x40')][_0x5a47('0x66')]({'where':{'id':_0x309397[_0x5a47('0x55')]['id']}})[_0x5a47('0x21')](handleEntityNotFound(_0x22c50b,null))[_0x5a47('0x21')](function(_0x36e1e8){if(_0x36e1e8){return db[_0x5a47('0x40')][_0x5a47('0x58')]({'where':{'id':_0x36e1e8['id']},'include':[{'model':db[_0x5a47('0x82')],'as':_0x5a47('0x83'),'include':[{'model':db[_0x5a47('0x72')],'as':'Contacts','where':{[_0x36e1e8['mapKey']]:_0x51d6d8},'limit':0x1,'order':[[_0x5a47('0x78'),'DESC']]}]}]})[_0x5a47('0x21')](handleEntityNotFound(_0x22c50b,null))[_0x5a47('0x21')](function(_0x4d3597){if(_0x4d3597&&_0x4d3597[_0x5a47('0x83')]){_0x3c85c0=_0x4d3597[_0x5a47('0x3a')]({'plain':!![]});if(_0x3c85c0['List']&&_0x3c85c0[_0x5a47('0x83')][_0x5a47('0x84')][_0x5a47('0x4b')]){return _0x3c85c0[_0x5a47('0x83')][_0x5a47('0x84')][0x0];}return db[_0x5a47('0x72')][_0x5a47('0x59')](_[_0x5a47('0x1a')](_0x309397[_0x5a47('0x60')],{'firstName':_0x51d6d8,[_0x4d3597['mapKey']]:_0x51d6d8,'phone':_0x51d6d8,'ListId':_0x3c85c0['ListId']}));}})['then'](handleEntityNotFound(_0x22c50b,null))[_0x5a47('0x21')](function(_0x15e7b7){if(_0x15e7b7){_0x27cefd=_0x15e7b7;return db[_0x5a47('0x90')][_0x5a47('0x58')]({'where':{'ContactId':_0x27cefd['id'],'closed':![],'OpenchannelAccountId':_0x3c85c0['id']}})['then'](function(_0x2b66bd){if(_0x2b66bd){return[_0x2b66bd,![]];}return db[_0x5a47('0x90')][_0x5a47('0x59')]({'UserId':_0x309397[_0x5a47('0x5a')]['id'],'ContactId':_0x27cefd['id'],'OpenchannelAccountId':_0x3c85c0['id'],'lastMsgDirection':_0x5a47('0xbb'),'Messages':[_[_0x5a47('0x57')](_0x309397[_0x5a47('0x60')],{'read':![],'body':_0x309397['body'][_0x5a47('0x60')],'OpenchannelAccountId':_0x3c85c0['id'],'UserId':_0x309397[_0x5a47('0x5a')]['id'],'ContactId':_0x27cefd['id']})]},{'include':[{'model':db[_0x5a47('0x9a')],'as':'Messages'}]})['then'](function(_0x25905c){return[_0x25905c,!![]];});});}})[_0x5a47('0x92')](function(_0x4195ef,_0x43af9c){if(_0x43af9c){return _0x4195ef;}return db[_0x5a47('0x9a')][_0x5a47('0x59')](_[_0x5a47('0x57')](_0x309397[_0x5a47('0x60')],{'read':![],'body':_0x309397[_0x5a47('0x60')][_0x5a47('0x60')],'OpenchannelAccountId':_0x3c85c0['id'],'OpenchannelInteractionId':_0x4195ef['id'],'UserId':_0x309397[_0x5a47('0x5a')]['id'],'ContactId':_0x27cefd['id']}))[_0x5a47('0x21')](function(_0x3bc40a){_0x4195ef[_0x5a47('0xbc')][_0x5a47('0xbd')]=[];_0x4195ef[_0x5a47('0xbc')][_0x5a47('0xbd')][_0x5a47('0x97')](_0x3bc40a['dataValues']);return _0x4195ef;});});}})['then'](respondWithResult(_0x22c50b,null))[_0x5a47('0x2c')](handleError(_0x22c50b,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index d9a06d5..5b639b8 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 _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x39325c,_0x4abcf0){var _0x103d35=function(_0xa33f76){while(--_0xa33f76){_0x39325c['push'](_0x39325c['shift']());}};_0x103d35(++_0x4abcf0);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3a15a2,_0x5222f2){_0x3a15a2=_0x3a15a2-0x0;var _0x41c488=_0xee5b[_0x3a15a2];return _0x41c488;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xda3f=['exports','../../mysqldb','OpenchannelAccount','remove','emit'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xda3f,0xec));var _0xfda3=function(_0x4c1e48,_0x4c67e5){_0x4c1e48=_0x4c1e48-0x0;var _0x4385de=_0xda3f[_0x4c1e48];return _0x4385de;};'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 43d5063..84e161e 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(_0x58e9c1,_0x32c8f4){var _0x4b70c5=function(_0x279cbb){while(--_0x279cbb){_0x58e9c1['push'](_0x58e9c1['shift']());}};_0x4b70c5(++_0x32c8f4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x4ac87b,_0xd82dd8){var _0x1f7ce8=function(_0xe495ea){while(--_0xe495ea){_0x4ac87b['push'](_0x4ac87b['shift']());}};_0x1f7ce8(++_0xd82dd8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 9cbea2f..1a46db5 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 _0xb921=['socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x4d6ac0,_0x201628){var _0x5296c4=function(_0x3d0b3d){while(--_0x3d0b3d){_0x4d6ac0['push'](_0x4d6ac0['shift']());}};_0x5296c4(++_0x201628);}(_0xb921,0x16a));var _0x1b92=function(_0x410413,_0x2c77a9){_0x410413=_0x410413-0x0;var _0x34ec54=_0xb921[_0x410413];return _0x34ec54;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var moment=require(_0x1b92('0x2'));var BPromise=require(_0x1b92('0x3'));var rs=require(_0x1b92('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b92('0x5'));var logger=require(_0x1b92('0x6'))(_0x1b92('0x7'));var config=require(_0x1b92('0x8'));var jayson=require(_0x1b92('0x9'));var client=jayson[_0x1b92('0xa')][_0x1b92('0xb')]({'port':0x232a});config[_0x1b92('0xc')]=_[_0x1b92('0xd')](config[_0x1b92('0xc')],{'host':_0x1b92('0xe'),'port':0x18eb});var socket=require(_0x1b92('0xf'))(new Redis(config[_0x1b92('0xc')]));require(_0x1b92('0x10'))[_0x1b92('0x11')](socket);function respondWithRpcPromise(_0x4c8e30,_0x31e314,_0x1e5802){return new BPromise(function(_0x154b6d,_0x146d68){return client[_0x1b92('0x12')](_0x4c8e30,_0x1e5802)[_0x1b92('0x13')](function(_0x3deaf4){logger['info'](_0x1b92('0x14'),_0x31e314,_0x1b92('0x15'));logger['debug'](_0x1b92('0x16'),_0x31e314,_0x1b92('0x15'),JSON[_0x1b92('0x17')](_0x3deaf4));if(_0x3deaf4[_0x1b92('0x18')]){if(_0x3deaf4[_0x1b92('0x18')][_0x1b92('0x19')]===0x1f4){logger[_0x1b92('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x31e314,_0x3deaf4[_0x1b92('0x18')]['message']);return _0x146d68(_0x3deaf4[_0x1b92('0x18')]['message']);}logger[_0x1b92('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x31e314,_0x3deaf4[_0x1b92('0x18')][_0x1b92('0x1a')]);return _0x154b6d(_0x3deaf4[_0x1b92('0x18')]['message']);}else{logger[_0x1b92('0x1b')](_0x1b92('0x14'),_0x31e314,_0x1b92('0x15'));_0x154b6d(_0x3deaf4[_0x1b92('0x1c')][_0x1b92('0x1a')]);}})['catch'](function(_0x4024bf){logger[_0x1b92('0x18')](_0x1b92('0x14'),_0x31e314,_0x4024bf);_0x146d68(_0x4024bf);});});} \ No newline at end of file +var _0xd52d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','../../config/utils'];(function(_0x152561,_0x16178b){var _0x491996=function(_0x28243d){while(--_0x28243d){_0x152561['push'](_0x152561['shift']());}};_0x491996(++_0x16178b);}(_0xd52d,0x1c7));var _0xdd52=function(_0x50b1ce,_0x4ee734){_0x50b1ce=_0x50b1ce-0x0;var _0x235f7b=_0xd52d[_0x50b1ce];return _0x235f7b;};'use strict';var _=require('lodash');var util=require(_0xdd52('0x0'));var moment=require(_0xdd52('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd52('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdd52('0x3'));var logger=require(_0xdd52('0x4'))(_0xdd52('0x5'));var config=require(_0xdd52('0x6'));var jayson=require(_0xdd52('0x7'));var client=jayson[_0xdd52('0x8')][_0xdd52('0x9')]({'port':0x232a});config[_0xdd52('0xa')]=_['defaults'](config[_0xdd52('0xa')],{'host':_0xdd52('0xb'),'port':0x18eb});var socket=require(_0xdd52('0xc'))(new Redis(config[_0xdd52('0xa')]));require(_0xdd52('0xd'))[_0xdd52('0xe')](socket);function respondWithRpcPromise(_0x3fd2b9,_0x3e41e1,_0x20f7ba){return new BPromise(function(_0x41dabd,_0x382fcc){return client[_0xdd52('0xf')](_0x3fd2b9,_0x20f7ba)[_0xdd52('0x10')](function(_0x4d2066){logger[_0xdd52('0x11')](_0xdd52('0x12'),_0x3e41e1,_0xdd52('0x13'));logger[_0xdd52('0x14')](_0xdd52('0x15'),_0x3e41e1,_0xdd52('0x13'),JSON['stringify'](_0x4d2066));if(_0x4d2066[_0xdd52('0x16')]){if(_0x4d2066[_0xdd52('0x16')][_0xdd52('0x17')]===0x1f4){logger['error'](_0xdd52('0x12'),_0x3e41e1,_0x4d2066[_0xdd52('0x16')][_0xdd52('0x18')]);return _0x382fcc(_0x4d2066[_0xdd52('0x16')][_0xdd52('0x18')]);}logger[_0xdd52('0x16')](_0xdd52('0x12'),_0x3e41e1,_0x4d2066[_0xdd52('0x16')]['message']);return _0x41dabd(_0x4d2066[_0xdd52('0x16')]['message']);}else{logger[_0xdd52('0x11')](_0xdd52('0x12'),_0x3e41e1,_0xdd52('0x13'));_0x41dabd(_0x4d2066[_0xdd52('0x19')]['message']);}})[_0xdd52('0x1a')](function(_0x2bf6ff){logger[_0xdd52('0x16')](_0xdd52('0x12'),_0x3e41e1,_0x2bf6ff);_0x382fcc(_0x2bf6ff);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 29ce550..27231de 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 _0xb58b=['save','remove','update','removeListener','register','length','openchannelAccount:'];(function(_0x544f46,_0x168b65){var _0x21e7f2=function(_0x4e22a8){while(--_0x4e22a8){_0x544f46['push'](_0x544f46['shift']());}};_0x21e7f2(++_0x168b65);}(_0xb58b,0x1f1));var _0xbb58=function(_0x541997,_0x24b7f2){_0x541997=_0x541997-0x0;var _0x4b7a85=_0xb58b[_0x541997];return _0x4b7a85;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xbb58('0x0'),_0xbb58('0x1'),_0xbb58('0x2')];function createListener(_0x4f5d42,_0x340c23){return function(_0x4e6d6c){_0x340c23['emit'](_0x4f5d42,_0x4e6d6c);};}function removeListener(_0x226363,_0x546510){return function(){OpenchannelAccountEvents[_0xbb58('0x3')](_0x226363,_0x546510);};}exports[_0xbb58('0x4')]=function(_0x33fe85){for(var _0x5cf8b1=0x0,_0x27cbda=events[_0xbb58('0x5')];_0x5cf8b1<_0x27cbda;_0x5cf8b1++){var _0xe874f2=events[_0x5cf8b1];var _0x5d7fe8=createListener(_0xbb58('0x6')+_0xe874f2,_0x33fe85);OpenchannelAccountEvents['on'](_0xe874f2,_0x5d7fe8);}}; \ No newline at end of file +var _0xea70=['length','openchannelAccount:','./openchannelAccount.events','save','remove','removeListener','register'];(function(_0xd2e0e6,_0x4dab30){var _0x485ed7=function(_0x3a5a02){while(--_0x3a5a02){_0xd2e0e6['push'](_0xd2e0e6['shift']());}};_0x485ed7(++_0x4dab30);}(_0xea70,0x175));var _0x0ea7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xea70[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelAccountEvents=require(_0x0ea7('0x0'));var events=[_0x0ea7('0x1'),_0x0ea7('0x2'),'update'];function createListener(_0x28ddf0,_0x499815){return function(_0x2fad00){_0x499815['emit'](_0x28ddf0,_0x2fad00);};}function removeListener(_0x425623,_0x3138eb){return function(){OpenchannelAccountEvents[_0x0ea7('0x3')](_0x425623,_0x3138eb);};}exports[_0x0ea7('0x4')]=function(_0x168372){for(var _0x489be9=0x0,_0x144497=events[_0x0ea7('0x5')];_0x489be9<_0x144497;_0x489be9++){var _0x51b516=events[_0x489be9];var _0x48dedd=createListener(_0x0ea7('0x6')+_0x51b516,_0x168372);OpenchannelAccountEvents['on'](_0x51b516,_0x48dedd);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index eef4183..1e7b6d9 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 _0x4cd7=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x49044b,_0x3dd345){var _0xde2c4d=function(_0x139faa){while(--_0x139faa){_0x49044b['push'](_0x49044b['shift']());}};_0xde2c4d(++_0x3dd345);}(_0x4cd7,0x10d));var _0x74cd=function(_0x120ec8,_0x3e29b1){_0x120ec8=_0x120ec8-0x0;var _0x32c670=_0x4cd7[_0x120ec8];return _0x32c670;};'use strict';var multer=require(_0x74cd('0x0'));var util=require(_0x74cd('0x1'));var path=require(_0x74cd('0x2'));var timeout=require(_0x74cd('0x3'));var express=require(_0x74cd('0x4'));var router=express[_0x74cd('0x5')]();var fs_extra=require(_0x74cd('0x6'));var auth=require(_0x74cd('0x7'));var interaction=require(_0x74cd('0x8'));var config=require('../../config/environment');var controller=require(_0x74cd('0x9'));router[_0x74cd('0xa')]('/',auth['isAuthenticated'](),controller[_0x74cd('0xb')]);router[_0x74cd('0xa')](_0x74cd('0xc'),auth[_0x74cd('0xd')](),controller[_0x74cd('0xe')]);router[_0x74cd('0xf')]('/',auth[_0x74cd('0xd')](),controller[_0x74cd('0x10')]);router[_0x74cd('0x11')](_0x74cd('0xc'),auth[_0x74cd('0xd')](),controller[_0x74cd('0x12')]);router[_0x74cd('0x13')](_0x74cd('0xc'),auth['isAuthenticated'](),controller[_0x74cd('0x14')]);module[_0x74cd('0x15')]=router; \ No newline at end of file +var _0xd171=['index','/:id','show','post','isAuthenticated','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller'];(function(_0x51df00,_0x4ac573){var _0x198328=function(_0x24e0ec){while(--_0x24e0ec){_0x51df00['push'](_0x51df00['shift']());}};_0x198328(++_0x4ac573);}(_0xd171,0x14b));var _0x1d17=function(_0x15106b,_0x4d96f6){_0x15106b=_0x15106b-0x0;var _0x521203=_0xd171[_0x15106b];return _0x521203;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1d17('0x0'));var timeout=require(_0x1d17('0x1'));var express=require(_0x1d17('0x2'));var router=express[_0x1d17('0x3')]();var fs_extra=require(_0x1d17('0x4'));var auth=require(_0x1d17('0x5'));var interaction=require(_0x1d17('0x6'));var config=require(_0x1d17('0x7'));var controller=require(_0x1d17('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1d17('0x9')]);router['get'](_0x1d17('0xa'),auth['isAuthenticated'](),controller[_0x1d17('0xb')]);router[_0x1d17('0xc')]('/',auth[_0x1d17('0xd')](),controller['create']);router['put'](_0x1d17('0xa'),auth['isAuthenticated'](),controller[_0x1d17('0xe')]);router['delete'](_0x1d17('0xa'),auth['isAuthenticated'](),controller[_0x1d17('0xf')]);module[_0x1d17('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 05dc9a8..dd7b9d4 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 _0x9372=['INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x27019b,_0x53cc28){var _0x1480f3=function(_0x4199c6){while(--_0x4199c6){_0x27019b['push'](_0x27019b['shift']());}};_0x1480f3(++_0x53cc28);}(_0x9372,0x1a4));var _0x2937=function(_0x53a93f,_0x3299d3){_0x53a93f=_0x53a93f-0x0;var _0x349f78=_0x9372[_0x53a93f];return _0x349f78;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2937('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x2937('0x1')],'allowNull':![],'defaultValue':_0x2937('0x2')},'appdata':{'type':Sequelize[_0x2937('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2937('0x1')],'defaultValue':_0x2937('0x4')}}; \ No newline at end of file +var _0xbe5e=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xbe5e,0x81));var _0xebe5=function(_0x4a80b0,_0x361160){_0x4a80b0=_0x4a80b0-0x0;var _0x6eeaba=_0xbe5e[_0x4a80b0];return _0x6eeaba;};'use strict';var Sequelize=require(_0xebe5('0x0'));module[_0xebe5('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xebe5('0x2')],'allowNull':![],'defaultValue':_0xebe5('0x3')},'appdata':{'type':Sequelize[_0xebe5('0x4')]()},'description':{'type':Sequelize[_0xebe5('0x2')]},'interval':{'type':Sequelize[_0xebe5('0x2')],'defaultValue':_0xebe5('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 6860983..7c67b7f 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 _0x00ea=['undefined','count','limit','set','Content-Range','apply','save','then','sendStatus','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','destroy','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x39a99d,_0x36fdec){var _0x229fd5=function(_0x13ea2b){while(--_0x13ea2b){_0x39a99d['push'](_0x39a99d['shift']());}};_0x229fd5(++_0x36fdec);}(_0x00ea,0xcb));var _0xa00e=function(_0x3eacaf,_0x9ceba9){_0x3eacaf=_0x3eacaf-0x0;var _0x41e7ed=_0x00ea[_0x3eacaf];return _0x41e7ed;};'use strict';var emlformat=require(_0xa00e('0x0'));var rimraf=require(_0xa00e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa00e('0x2'));var moment=require('moment');var BPromise=require(_0xa00e('0x3'));var Mustache=require(_0xa00e('0x4'));var util=require('util');var path=require(_0xa00e('0x5'));var sox=require(_0xa00e('0x6'));var csv=require(_0xa00e('0x7'));var ejs=require(_0xa00e('0x8'));var fs=require('fs');var fs_extra=require(_0xa00e('0x9'));var _=require(_0xa00e('0xa'));var squel=require(_0xa00e('0xb'));var crypto=require(_0xa00e('0xc'));var jsforce=require(_0xa00e('0xd'));var deskjs=require(_0xa00e('0xe'));var toCsv=require(_0xa00e('0x7'));var querystring=require(_0xa00e('0xf'));var Papa=require(_0xa00e('0x10'));var Redis=require(_0xa00e('0x11'));var authService=require(_0xa00e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa00e('0x13'));var hardwareService=require(_0xa00e('0x14'));var logger=require(_0xa00e('0x15'))(_0xa00e('0x16'));var utils=require(_0xa00e('0x17'));var config=require(_0xa00e('0x18'));var licenseUtil=require(_0xa00e('0x19'));var db=require(_0xa00e('0x1a'))['db'];function respondWithStatusCode(_0x267335,_0x2d63d1){_0x2d63d1=_0x2d63d1||0xcc;return function(_0x3aacf4){if(_0x3aacf4){return _0x267335['sendStatus'](_0x2d63d1);}return _0x267335[_0xa00e('0x1b')](_0x2d63d1)[_0xa00e('0x1c')]();};}function respondWithResult(_0x35f3c6,_0x43f7c8){_0x43f7c8=_0x43f7c8||0xc8;return function(_0xe18e7a){if(_0xe18e7a){return _0x35f3c6[_0xa00e('0x1b')](_0x43f7c8)[_0xa00e('0x1d')](_0xe18e7a);}};}function respondWithFilteredResult(_0x34b1ee,_0x517601){return function(_0x5795da){if(_0x5795da){var _0x50d14e=typeof _0x517601[_0xa00e('0x1e')]===_0xa00e('0x1f')&&typeof _0x517601['limit']===_0xa00e('0x1f');var _0x203392=_0x5795da[_0xa00e('0x20')];var _0x6ddc=_0x50d14e?0x0:_0x517601['offset'];var _0x5e7c4b=_0x50d14e?_0x5795da[_0xa00e('0x20')]:_0x517601[_0xa00e('0x1e')]+_0x517601[_0xa00e('0x21')];var _0x95d3ee;if(_0x5e7c4b>=_0x203392){_0x5e7c4b=_0x203392;_0x95d3ee=0xc8;}else{_0x95d3ee=0xce;}_0x34b1ee[_0xa00e('0x1b')](_0x95d3ee);return _0x34b1ee[_0xa00e('0x22')](_0xa00e('0x23'),_0x6ddc+'-'+_0x5e7c4b+'/'+_0x203392)[_0xa00e('0x1d')](_0x5795da);}return null;};}function patchUpdates(_0x1b2eb7){return function(_0x4b45d4){try{jsonpatch[_0xa00e('0x24')](_0x4b45d4,_0x1b2eb7,!![]);}catch(_0x2316dd){return BPromise['reject'](_0x2316dd);}return _0x4b45d4[_0xa00e('0x25')]();};}function saveUpdates(_0x41ab17,_0x33b0b6){return function(_0xccfe1c){if(_0xccfe1c){return _0xccfe1c['update'](_0x41ab17)[_0xa00e('0x26')](function(_0x2d8c68){return _0x2d8c68;});}return null;};}function removeEntity(_0x32f400,_0x2d33ee){return function(_0x591e42){if(_0x591e42){return _0x591e42['destroy']()[_0xa00e('0x26')](function(){_0x32f400[_0xa00e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2377c7,_0x55fd4c){return function(_0x355847){if(!_0x355847){_0x2377c7[_0xa00e('0x27')](0x194);}return _0x355847;};}function handleError(_0x3a5c3d,_0x385d0d){_0x385d0d=_0x385d0d||0x1f4;return function(_0x399dba){logger['error'](_0x399dba[_0xa00e('0x28')]);if(_0x399dba[_0xa00e('0x29')]){delete _0x399dba[_0xa00e('0x29')];}_0x3a5c3d['status'](_0x385d0d)[_0xa00e('0x2a')](_0x399dba);};}exports[_0xa00e('0x2b')]=function(_0x260042,_0x5b8a81){var _0x259da3={},_0x5aa61a={},_0x2371d1={'count':0x0,'rows':[]};var _0x46fb45=_['map'](db[_0xa00e('0x2c')][_0xa00e('0x2d')],function(_0x4fb38d){return{'name':_0x4fb38d[_0xa00e('0x2e')],'type':_0x4fb38d['type']['key']};});_0x5aa61a[_0xa00e('0x2f')]=_[_0xa00e('0x30')](_0x46fb45,_0xa00e('0x29'));_0x5aa61a[_0xa00e('0x31')]=_[_0xa00e('0x32')](_0x260042[_0xa00e('0x31')]);_0x5aa61a['filters']=_[_0xa00e('0x33')](_0x5aa61a['model'],_0x5aa61a[_0xa00e('0x31')]);_0x259da3[_0xa00e('0x34')]=_['intersection'](_0x5aa61a[_0xa00e('0x2f')],qs['fields'](_0x260042[_0xa00e('0x31')][_0xa00e('0x35')]));_0x259da3['attributes']=_0x259da3[_0xa00e('0x34')][_0xa00e('0x36')]?_0x259da3[_0xa00e('0x34')]:_0x5aa61a['model'];if(!_0x260042['query'][_0xa00e('0x37')](_0xa00e('0x38'))){_0x259da3['limit']=qs['limit'](_0x260042[_0xa00e('0x31')][_0xa00e('0x21')]);_0x259da3[_0xa00e('0x1e')]=qs['offset'](_0x260042[_0xa00e('0x31')][_0xa00e('0x1e')]);}_0x259da3[_0xa00e('0x39')]=qs['sort'](_0x260042[_0xa00e('0x31')][_0xa00e('0x3a')]);_0x259da3[_0xa00e('0x3b')]=qs['filters'](_[_0xa00e('0x3c')](_0x260042[_0xa00e('0x31')],_0x5aa61a[_0xa00e('0x3d')]),_0x46fb45);if(_0x260042['query'][_0xa00e('0x3e')]){_0x259da3[_0xa00e('0x3b')]=_[_0xa00e('0x3f')](_0x259da3[_0xa00e('0x3b')],{'$or':_[_0xa00e('0x30')](_0x46fb45,function(_0x1cb7ea){if(_0x1cb7ea[_0xa00e('0x40')]!==_0xa00e('0x41')){var _0x36fd47={};_0x36fd47[_0x1cb7ea['name']]={'$like':'%'+_0x260042[_0xa00e('0x31')]['filter']+'%'};return _0x36fd47;}})});}_0x259da3=_[_0xa00e('0x3f')]({},_0x259da3,_0x260042[_0xa00e('0x42')]);var _0x3470af={'where':_0x259da3[_0xa00e('0x3b')]};return db['OpenchannelApplication'][_0xa00e('0x20')](_0x3470af)[_0xa00e('0x26')](function(_0xc85894){_0x2371d1[_0xa00e('0x20')]=_0xc85894;if(_0x260042[_0xa00e('0x31')]['includeAll']){_0x259da3['include']=[{'all':!![]}];}return db[_0xa00e('0x2c')][_0xa00e('0x43')](_0x259da3);})[_0xa00e('0x26')](function(_0x8b5a62){_0x2371d1[_0xa00e('0x44')]=_0x8b5a62;return _0x2371d1;})[_0xa00e('0x26')](respondWithFilteredResult(_0x5b8a81,_0x259da3))[_0xa00e('0x45')](handleError(_0x5b8a81,null));};exports[_0xa00e('0x46')]=function(_0x211144,_0x1380c2){var _0x1fca37={'raw':!![],'where':{'id':_0x211144[_0xa00e('0x47')]['id']}},_0xb40ebc={};_0xb40ebc[_0xa00e('0x2f')]=_[_0xa00e('0x32')](db['OpenchannelApplication'][_0xa00e('0x2d')]);_0xb40ebc[_0xa00e('0x31')]=_[_0xa00e('0x32')](_0x211144[_0xa00e('0x31')]);_0xb40ebc['filters']=_[_0xa00e('0x33')](_0xb40ebc[_0xa00e('0x2f')],_0xb40ebc['query']);_0x1fca37['attributes']=_[_0xa00e('0x33')](_0xb40ebc['model'],qs[_0xa00e('0x35')](_0x211144[_0xa00e('0x31')]['fields']));_0x1fca37[_0xa00e('0x34')]=_0x1fca37['attributes'][_0xa00e('0x36')]?_0x1fca37['attributes']:_0xb40ebc[_0xa00e('0x2f')];if(_0x211144[_0xa00e('0x31')][_0xa00e('0x48')]){_0x1fca37[_0xa00e('0x49')]=[{'all':!![]}];}_0x1fca37=_['merge']({},_0x1fca37,_0x211144[_0xa00e('0x42')]);return db[_0xa00e('0x2c')][_0xa00e('0x4a')](_0x1fca37)[_0xa00e('0x26')](handleEntityNotFound(_0x1380c2,null))[_0xa00e('0x26')](respondWithResult(_0x1380c2,null))['catch'](handleError(_0x1380c2,null));};exports[_0xa00e('0x4b')]=function(_0x17dcec,_0xc3c4ac){return db[_0xa00e('0x2c')]['create'](_0x17dcec[_0xa00e('0x4c')],{})[_0xa00e('0x26')](respondWithResult(_0xc3c4ac,0xc9))[_0xa00e('0x45')](handleError(_0xc3c4ac,null));};exports['update']=function(_0x14ed0e,_0x34f5e5){if(_0x14ed0e[_0xa00e('0x4c')]['id']){delete _0x14ed0e[_0xa00e('0x4c')]['id'];}return db['OpenchannelApplication'][_0xa00e('0x4a')]({'where':{'id':_0x14ed0e[_0xa00e('0x47')]['id']}})[_0xa00e('0x26')](handleEntityNotFound(_0x34f5e5,null))[_0xa00e('0x26')](saveUpdates(_0x14ed0e[_0xa00e('0x4c')],null))[_0xa00e('0x26')](respondWithResult(_0x34f5e5,null))[_0xa00e('0x45')](handleError(_0x34f5e5,null));};exports[_0xa00e('0x4d')]=function(_0x1fe918,_0x318e3c){return db[_0xa00e('0x2c')][_0xa00e('0x4a')]({'where':{'id':_0x1fe918['params']['id']}})['then'](handleEntityNotFound(_0x318e3c,null))[_0xa00e('0x26')](removeEntity(_0x318e3c,null))[_0xa00e('0x45')](handleError(_0x318e3c,null));}; \ No newline at end of file +var _0x6e3b=['../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','OpenchannelApplication','rawAttributes','key','model','map','keys','query','fields','attributes','length','nolimit','limit','sort','filters','pick','where','merge','type','options','includeAll','findAll','rows','show','intersection','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6e3b,0xbf));var _0xb6e3=function(_0x22a802,_0x3b1f38){_0x22a802=_0x22a802-0x0;var _0x7f8948=_0x6e3b[_0x22a802];return _0x7f8948;};'use strict';var emlformat=require(_0xb6e3('0x0'));var rimraf=require(_0xb6e3('0x1'));var zipdir=require(_0xb6e3('0x2'));var jsonpatch=require(_0xb6e3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb6e3('0x4'));var Mustache=require(_0xb6e3('0x5'));var util=require('util');var path=require(_0xb6e3('0x6'));var sox=require(_0xb6e3('0x7'));var csv=require(_0xb6e3('0x8'));var ejs=require(_0xb6e3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb6e3('0xa'));var crypto=require(_0xb6e3('0xb'));var jsforce=require(_0xb6e3('0xc'));var deskjs=require(_0xb6e3('0xd'));var toCsv=require(_0xb6e3('0x8'));var querystring=require(_0xb6e3('0xe'));var Papa=require(_0xb6e3('0xf'));var Redis=require('ioredis');var authService=require(_0xb6e3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6e3('0x11'))(_0xb6e3('0x12'));var utils=require(_0xb6e3('0x13'));var config=require(_0xb6e3('0x14'));var licenseUtil=require(_0xb6e3('0x15'));var db=require(_0xb6e3('0x16'))['db'];function respondWithStatusCode(_0x15a843,_0xacbac2){_0xacbac2=_0xacbac2||0xcc;return function(_0x2c7086){if(_0x2c7086){return _0x15a843['sendStatus'](_0xacbac2);}return _0x15a843[_0xb6e3('0x17')](_0xacbac2)[_0xb6e3('0x18')]();};}function respondWithResult(_0x3e8486,_0x4d64e6){_0x4d64e6=_0x4d64e6||0xc8;return function(_0x28099a){if(_0x28099a){return _0x3e8486[_0xb6e3('0x17')](_0x4d64e6)[_0xb6e3('0x19')](_0x28099a);}};}function respondWithFilteredResult(_0x815e99,_0x428617){return function(_0x57ff13){if(_0x57ff13){var _0xd0ad70=typeof _0x428617[_0xb6e3('0x1a')]===_0xb6e3('0x1b')&&typeof _0x428617['limit']===_0xb6e3('0x1b');var _0x1c28e9=_0x57ff13['count'];var _0xadca01=_0xd0ad70?0x0:_0x428617[_0xb6e3('0x1a')];var _0x40662e=_0xd0ad70?_0x57ff13[_0xb6e3('0x1c')]:_0x428617[_0xb6e3('0x1a')]+_0x428617['limit'];var _0x57ef7c;if(_0x40662e>=_0x1c28e9){_0x40662e=_0x1c28e9;_0x57ef7c=0xc8;}else{_0x57ef7c=0xce;}_0x815e99['status'](_0x57ef7c);return _0x815e99['set']('Content-Range',_0xadca01+'-'+_0x40662e+'/'+_0x1c28e9)[_0xb6e3('0x19')](_0x57ff13);}return null;};}function patchUpdates(_0x540c24){return function(_0x2e93b5){try{jsonpatch[_0xb6e3('0x1d')](_0x2e93b5,_0x540c24,!![]);}catch(_0x54449f){return BPromise[_0xb6e3('0x1e')](_0x54449f);}return _0x2e93b5[_0xb6e3('0x1f')]();};}function saveUpdates(_0x449a2a,_0x12b3ed){return function(_0x1b7046){if(_0x1b7046){return _0x1b7046[_0xb6e3('0x20')](_0x449a2a)[_0xb6e3('0x21')](function(_0x32ccc2){return _0x32ccc2;});}return null;};}function removeEntity(_0x2550a7,_0x4e8d86){return function(_0x215385){if(_0x215385){return _0x215385[_0xb6e3('0x22')]()['then'](function(){_0x2550a7['status'](0xcc)[_0xb6e3('0x18')]();});}};}function handleEntityNotFound(_0xe12597,_0x45652a){return function(_0x1de3eb){if(!_0x1de3eb){_0xe12597[_0xb6e3('0x23')](0x194);}return _0x1de3eb;};}function handleError(_0xce0fd0,_0x37b77a){_0x37b77a=_0x37b77a||0x1f4;return function(_0x374b5c){logger[_0xb6e3('0x24')](_0x374b5c['stack']);if(_0x374b5c['name']){delete _0x374b5c[_0xb6e3('0x25')];}_0xce0fd0[_0xb6e3('0x17')](_0x37b77a)[_0xb6e3('0x26')](_0x374b5c);};}exports[_0xb6e3('0x27')]=function(_0x16fae8,_0x3a4ece){var _0x433553={},_0x135cde={},_0x17f223={'count':0x0,'rows':[]};var _0x2476ae=_['map'](db[_0xb6e3('0x28')][_0xb6e3('0x29')],function(_0x18d435){return{'name':_0x18d435['fieldName'],'type':_0x18d435['type'][_0xb6e3('0x2a')]};});_0x135cde[_0xb6e3('0x2b')]=_[_0xb6e3('0x2c')](_0x2476ae,_0xb6e3('0x25'));_0x135cde['query']=_[_0xb6e3('0x2d')](_0x16fae8[_0xb6e3('0x2e')]);_0x135cde['filters']=_['intersection'](_0x135cde[_0xb6e3('0x2b')],_0x135cde[_0xb6e3('0x2e')]);_0x433553['attributes']=_['intersection'](_0x135cde['model'],qs[_0xb6e3('0x2f')](_0x16fae8[_0xb6e3('0x2e')][_0xb6e3('0x2f')]));_0x433553[_0xb6e3('0x30')]=_0x433553[_0xb6e3('0x30')][_0xb6e3('0x31')]?_0x433553[_0xb6e3('0x30')]:_0x135cde[_0xb6e3('0x2b')];if(!_0x16fae8[_0xb6e3('0x2e')]['hasOwnProperty'](_0xb6e3('0x32'))){_0x433553[_0xb6e3('0x33')]=qs[_0xb6e3('0x33')](_0x16fae8['query'][_0xb6e3('0x33')]);_0x433553['offset']=qs[_0xb6e3('0x1a')](_0x16fae8[_0xb6e3('0x2e')][_0xb6e3('0x1a')]);}_0x433553['order']=qs[_0xb6e3('0x34')](_0x16fae8['query'][_0xb6e3('0x34')]);_0x433553['where']=qs[_0xb6e3('0x35')](_[_0xb6e3('0x36')](_0x16fae8[_0xb6e3('0x2e')],_0x135cde['filters']),_0x2476ae);if(_0x16fae8[_0xb6e3('0x2e')]['filter']){_0x433553[_0xb6e3('0x37')]=_[_0xb6e3('0x38')](_0x433553['where'],{'$or':_['map'](_0x2476ae,function(_0x4f7e4e){if(_0x4f7e4e[_0xb6e3('0x39')]!=='VIRTUAL'){var _0x512d65={};_0x512d65[_0x4f7e4e[_0xb6e3('0x25')]]={'$like':'%'+_0x16fae8[_0xb6e3('0x2e')]['filter']+'%'};return _0x512d65;}})});}_0x433553=_[_0xb6e3('0x38')]({},_0x433553,_0x16fae8[_0xb6e3('0x3a')]);var _0xd63e85={'where':_0x433553['where']};return db[_0xb6e3('0x28')]['count'](_0xd63e85)[_0xb6e3('0x21')](function(_0x11ea99){_0x17f223[_0xb6e3('0x1c')]=_0x11ea99;if(_0x16fae8['query'][_0xb6e3('0x3b')]){_0x433553['include']=[{'all':!![]}];}return db[_0xb6e3('0x28')][_0xb6e3('0x3c')](_0x433553);})[_0xb6e3('0x21')](function(_0x3bbe15){_0x17f223[_0xb6e3('0x3d')]=_0x3bbe15;return _0x17f223;})[_0xb6e3('0x21')](respondWithFilteredResult(_0x3a4ece,_0x433553))['catch'](handleError(_0x3a4ece,null));};exports[_0xb6e3('0x3e')]=function(_0x4f90f9,_0x30affa){var _0x450e6a={'raw':!![],'where':{'id':_0x4f90f9['params']['id']}},_0x43f97a={};_0x43f97a['model']=_[_0xb6e3('0x2d')](db[_0xb6e3('0x28')]['rawAttributes']);_0x43f97a[_0xb6e3('0x2e')]=_[_0xb6e3('0x2d')](_0x4f90f9[_0xb6e3('0x2e')]);_0x43f97a[_0xb6e3('0x35')]=_[_0xb6e3('0x3f')](_0x43f97a[_0xb6e3('0x2b')],_0x43f97a[_0xb6e3('0x2e')]);_0x450e6a[_0xb6e3('0x30')]=_[_0xb6e3('0x3f')](_0x43f97a[_0xb6e3('0x2b')],qs[_0xb6e3('0x2f')](_0x4f90f9[_0xb6e3('0x2e')][_0xb6e3('0x2f')]));_0x450e6a[_0xb6e3('0x30')]=_0x450e6a['attributes']['length']?_0x450e6a[_0xb6e3('0x30')]:_0x43f97a[_0xb6e3('0x2b')];if(_0x4f90f9[_0xb6e3('0x2e')]['includeAll']){_0x450e6a['include']=[{'all':!![]}];}_0x450e6a=_[_0xb6e3('0x38')]({},_0x450e6a,_0x4f90f9[_0xb6e3('0x3a')]);return db['OpenchannelApplication'][_0xb6e3('0x40')](_0x450e6a)[_0xb6e3('0x21')](handleEntityNotFound(_0x30affa,null))['then'](respondWithResult(_0x30affa,null))[_0xb6e3('0x41')](handleError(_0x30affa,null));};exports[_0xb6e3('0x42')]=function(_0x28a6fb,_0x384242){return db[_0xb6e3('0x28')][_0xb6e3('0x42')](_0x28a6fb['body'],{})[_0xb6e3('0x21')](respondWithResult(_0x384242,0xc9))[_0xb6e3('0x41')](handleError(_0x384242,null));};exports['update']=function(_0x4ed0bd,_0xe71407){if(_0x4ed0bd[_0xb6e3('0x43')]['id']){delete _0x4ed0bd[_0xb6e3('0x43')]['id'];}return db['OpenchannelApplication'][_0xb6e3('0x40')]({'where':{'id':_0x4ed0bd[_0xb6e3('0x44')]['id']}})['then'](handleEntityNotFound(_0xe71407,null))[_0xb6e3('0x21')](saveUpdates(_0x4ed0bd[_0xb6e3('0x43')],null))[_0xb6e3('0x21')](respondWithResult(_0xe71407,null))[_0xb6e3('0x41')](handleError(_0xe71407,null));};exports[_0xb6e3('0x22')]=function(_0x406e99,_0x1b687c){return db['OpenchannelApplication'][_0xb6e3('0x40')]({'where':{'id':_0x406e99[_0xb6e3('0x44')]['id']}})[_0xb6e3('0x21')](handleEntityNotFound(_0x1b687c,null))[_0xb6e3('0x21')](removeEntity(_0x1b687c,null))[_0xb6e3('0x41')](handleError(_0x1b687c,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c3f09c1..33b03e7 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 _0xe519=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelApplication.attributes','define','openchannel_applications','utf8mb4'];(function(_0x5d8de7,_0x347af7){var _0x5f3cac=function(_0x171e21){while(--_0x171e21){_0x5d8de7['push'](_0x5d8de7['shift']());}};_0x5f3cac(++_0x347af7);}(_0xe519,0xd1));var _0x9e51=function(_0x2fbcef,_0x18412d){_0x2fbcef=_0x2fbcef-0x0;var _0x584993=_0xe519[_0x2fbcef];return _0x584993;};'use strict';var _=require(_0x9e51('0x0'));var util=require(_0x9e51('0x1'));var logger=require(_0x9e51('0x2'))(_0x9e51('0x3'));var moment=require(_0x9e51('0x4'));var BPromise=require(_0x9e51('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e51('0x6'));var rimraf=require(_0x9e51('0x7'));var config=require('../../config/environment');var attributes=require(_0x9e51('0x8'));module['exports']=function(_0x407323,_0x4c3073){return _0x407323[_0x9e51('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x9e51('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9e51('0xb'),'collate':_0x9e51('0xc')});}; \ No newline at end of file +var _0x8472=['moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x1287a6,_0x38b142){var _0x3b6196=function(_0x216e82){while(--_0x216e82){_0x1287a6['push'](_0x1287a6['shift']());}};_0x3b6196(++_0x38b142);}(_0x8472,0x1ec));var _0x2847=function(_0x1e25ff,_0x194832){_0x1e25ff=_0x1e25ff-0x0;var _0x4d9ca7=_0x8472[_0x1e25ff];return _0x4d9ca7;};'use strict';var _=require(_0x2847('0x0'));var util=require(_0x2847('0x1'));var logger=require('../../config/logger')(_0x2847('0x2'));var moment=require(_0x2847('0x3'));var BPromise=require(_0x2847('0x4'));var rp=require(_0x2847('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2847('0x6'));var config=require(_0x2847('0x7'));var attributes=require(_0x2847('0x8'));module[_0x2847('0x9')]=function(_0x1ed5db,_0x3500be){return _0x1ed5db[_0x2847('0xa')](_0x2847('0xb'),attributes,{'tableName':_0x2847('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2847('0xd'),'collate':_0x2847('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 8d39a0a..87be29e 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 _0x310d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateOpenchannelApplication','update','body','options','raw','where','limit','debug','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x310d,0x1ad));var _0xd310=function(_0x28e56b,_0x50e46b){_0x28e56b=_0x28e56b-0x0;var _0x3256a2=_0x310d[_0x28e56b];return _0x3256a2;};'use strict';var _=require(_0xd310('0x0'));var util=require('util');var moment=require(_0xd310('0x1'));var BPromise=require(_0xd310('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd310('0x3'));var db=require(_0xd310('0x4'))['db'];var utils=require(_0xd310('0x5'));var logger=require(_0xd310('0x6'))(_0xd310('0x7'));var config=require(_0xd310('0x8'));var jayson=require(_0xd310('0x9'));var client=jayson[_0xd310('0xa')][_0xd310('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35248a,_0x436307,_0x260c79){return new BPromise(function(_0x162c1f,_0x429a38){return client[_0xd310('0xc')](_0x35248a,_0x260c79)[_0xd310('0xd')](function(_0x2aad1a){logger[_0xd310('0xe')](_0xd310('0xf'),_0x436307,_0xd310('0x10'));logger['debug'](_0xd310('0x11'),_0x436307,_0xd310('0x10'),JSON[_0xd310('0x12')](_0x2aad1a));if(_0x2aad1a[_0xd310('0x13')]){if(_0x2aad1a[_0xd310('0x13')][_0xd310('0x14')]===0x1f4){logger[_0xd310('0x13')](_0xd310('0xf'),_0x436307,_0x2aad1a[_0xd310('0x13')]['message']);return _0x429a38(_0x2aad1a[_0xd310('0x13')][_0xd310('0x15')]);}logger[_0xd310('0x13')](_0xd310('0xf'),_0x436307,_0x2aad1a[_0xd310('0x13')][_0xd310('0x15')]);return _0x162c1f(_0x2aad1a[_0xd310('0x13')][_0xd310('0x15')]);}else{logger[_0xd310('0xe')](_0xd310('0xf'),_0x436307,_0xd310('0x10'));_0x162c1f(_0x2aad1a['result']['message']);}})['catch'](function(_0x1e80e4){logger[_0xd310('0x13')](_0xd310('0xf'),_0x436307,_0x1e80e4);_0x429a38(_0x1e80e4);});});}exports[_0xd310('0x16')]=function(_0x5871eb){var _0x38fb7f=this;return new Promise(function(_0x30a3b6,_0x273a24){return db['OpenchannelApplication'][_0xd310('0x17')](_0x5871eb[_0xd310('0x18')],{'raw':_0x5871eb[_0xd310('0x19')]?_0x5871eb[_0xd310('0x19')][_0xd310('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5871eb[_0xd310('0x19')]?_0x5871eb[_0xd310('0x19')][_0xd310('0x1b')]||null:null,'attributes':_0x5871eb['options']?_0x5871eb[_0xd310('0x19')]['attributes']||null:null,'limit':_0x5871eb['options']?_0x5871eb[_0xd310('0x19')][_0xd310('0x1c')]||null:null})[_0xd310('0xd')](function(_0x2a5754){logger[_0xd310('0xe')](_0xd310('0x16'),_0x5871eb);logger[_0xd310('0x1d')](_0xd310('0x16'),_0x5871eb,JSON[_0xd310('0x12')](_0x2a5754));_0x30a3b6(_0x2a5754);})[_0xd310('0x1e')](function(_0x9282e4){logger[_0xd310('0x13')](_0xd310('0x16'),_0x9282e4[_0xd310('0x15')],_0x5871eb);_0x273a24(_0x38fb7f[_0xd310('0x13')](0x1f4,_0x9282e4[_0xd310('0x15')]));});});}; \ No newline at end of file +var _0x7076=['OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','where','limit','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x1717e5,_0x46d752){var _0x2b8c47=function(_0x25578c){while(--_0x25578c){_0x1717e5['push'](_0x1717e5['shift']());}};_0x2b8c47(++_0x46d752);}(_0x7076,0x116));var _0x6707=function(_0x12a271,_0x2bb48d){_0x12a271=_0x12a271-0x0;var _0x307fc4=_0x7076[_0x12a271];return _0x307fc4;};'use strict';var _=require(_0x6707('0x0'));var util=require(_0x6707('0x1'));var moment=require('moment');var BPromise=require(_0x6707('0x2'));var rs=require(_0x6707('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6707('0x4'))['db'];var utils=require(_0x6707('0x5'));var logger=require(_0x6707('0x6'))(_0x6707('0x7'));var config=require('../../config/environment');var jayson=require(_0x6707('0x8'));var client=jayson[_0x6707('0x9')][_0x6707('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46a4f1,_0x1e909d,_0x2eaf2e){return new BPromise(function(_0x5b188a,_0x57de4d){return client[_0x6707('0xb')](_0x46a4f1,_0x2eaf2e)['then'](function(_0x48d2d2){logger['info'](_0x6707('0xc'),_0x1e909d,_0x6707('0xd'));logger['debug'](_0x6707('0xe'),_0x1e909d,_0x6707('0xd'),JSON[_0x6707('0xf')](_0x48d2d2));if(_0x48d2d2[_0x6707('0x10')]){if(_0x48d2d2[_0x6707('0x10')][_0x6707('0x11')]===0x1f4){logger[_0x6707('0x10')](_0x6707('0xc'),_0x1e909d,_0x48d2d2[_0x6707('0x10')][_0x6707('0x12')]);return _0x57de4d(_0x48d2d2[_0x6707('0x10')][_0x6707('0x12')]);}logger[_0x6707('0x10')](_0x6707('0xc'),_0x1e909d,_0x48d2d2[_0x6707('0x10')][_0x6707('0x12')]);return _0x5b188a(_0x48d2d2[_0x6707('0x10')]['message']);}else{logger[_0x6707('0x13')](_0x6707('0xc'),_0x1e909d,'request\x20sent');_0x5b188a(_0x48d2d2[_0x6707('0x14')][_0x6707('0x12')]);}})[_0x6707('0x15')](function(_0x48110f){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x1e909d,_0x48110f);_0x57de4d(_0x48110f);});});}exports[_0x6707('0x16')]=function(_0x312094){var _0xe2ffc2=this;return new Promise(function(_0x15db03,_0x365ade){return db[_0x6707('0x17')]['update'](_0x312094[_0x6707('0x18')],{'raw':_0x312094[_0x6707('0x19')]?_0x312094[_0x6707('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x312094[_0x6707('0x19')]?_0x312094[_0x6707('0x19')][_0x6707('0x1a')]||null:null,'attributes':_0x312094[_0x6707('0x19')]?_0x312094[_0x6707('0x19')]['attributes']||null:null,'limit':_0x312094[_0x6707('0x19')]?_0x312094[_0x6707('0x19')][_0x6707('0x1b')]||null:null})[_0x6707('0x1c')](function(_0x3811d5){logger[_0x6707('0x13')](_0x6707('0x16'),_0x312094);logger['debug'](_0x6707('0x16'),_0x312094,JSON[_0x6707('0xf')](_0x3811d5));_0x15db03(_0x3811d5);})[_0x6707('0x15')](function(_0x4c564e){logger[_0x6707('0x10')](_0x6707('0x16'),_0x4c564e['message'],_0x312094);_0x365ade(_0xe2ffc2[_0x6707('0x10')](0x1f4,_0x4c564e[_0x6707('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index a3406e3..bfca49e 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 _0x1906=['/describe','describe','/:id','show','/:id/messages','/:id/download','download','create','addMessage','post','/:id/tags','openchannelinteraction:addtags','tracked','openchannelinteraction:update','update','openchannelinteraction:destroy','removeTags','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated'];(function(_0x1e802c,_0x37f611){var _0xfb5ab4=function(_0x16af79){while(--_0x16af79){_0x1e802c['push'](_0x1e802c['shift']());}};_0xfb5ab4(++_0x37f611);}(_0x1906,0x1ee));var _0x6190=function(_0x295cc9,_0x56f389){_0x295cc9=_0x295cc9-0x0;var _0x2a1858=_0x1906[_0x295cc9];return _0x2a1858;};'use strict';var multer=require(_0x6190('0x0'));var util=require('util');var path=require(_0x6190('0x1'));var timeout=require(_0x6190('0x2'));var express=require('express');var router=express[_0x6190('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6190('0x4'));var interaction=require(_0x6190('0x5'));var config=require(_0x6190('0x6'));var controller=require(_0x6190('0x7'));router[_0x6190('0x8')]('/',auth[_0x6190('0x9')](),controller['index']);router[_0x6190('0x8')](_0x6190('0xa'),auth[_0x6190('0x9')](),controller[_0x6190('0xb')]);router[_0x6190('0x8')](_0x6190('0xc'),auth[_0x6190('0x9')](),controller[_0x6190('0xd')]);router[_0x6190('0x8')](_0x6190('0xe'),auth[_0x6190('0x9')](),controller['getMessages']);router['get'](_0x6190('0xf'),auth['isAuthenticated'](),controller[_0x6190('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6190('0x11')]);router['post']('/:id/messages',auth[_0x6190('0x9')](),controller[_0x6190('0x12')]);router[_0x6190('0x13')](_0x6190('0x14'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x6190('0x15')),controller['addTags']);router['put'](_0x6190('0xc'),auth[_0x6190('0x9')](),interaction[_0x6190('0x16')]('openchannel',_0x6190('0x17')),controller[_0x6190('0x18')]);router['delete'](_0x6190('0xc'),auth[_0x6190('0x9')](),interaction[_0x6190('0x16')]('openchannel',_0x6190('0x19')),controller['destroy']);router['delete'](_0x6190('0x14'),auth['isAuthenticated'](),controller[_0x6190('0x1a')]);module[_0x6190('0x1b')]=router; \ No newline at end of file +var _0x0a1c=['openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','create','post','/:id/messages','/:id/tags','tracked'];(function(_0x278cbe,_0x452841){var _0x39d041=function(_0x2fbf66){while(--_0x2fbf66){_0x278cbe['push'](_0x278cbe['shift']());}};_0x39d041(++_0x452841);}(_0x0a1c,0x135));var _0xc0a1=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x0a1c[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0xc0a1('0x0'));var util=require(_0xc0a1('0x1'));var path=require('path');var timeout=require(_0xc0a1('0x2'));var express=require(_0xc0a1('0x3'));var router=express[_0xc0a1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc0a1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc0a1('0x6'));var controller=require('./openchannelInteraction.controller');router[_0xc0a1('0x7')]('/',auth['isAuthenticated'](),controller[_0xc0a1('0x8')]);router[_0xc0a1('0x7')](_0xc0a1('0x9'),auth[_0xc0a1('0xa')](),controller[_0xc0a1('0xb')]);router[_0xc0a1('0x7')](_0xc0a1('0xc'),auth[_0xc0a1('0xa')](),controller[_0xc0a1('0xd')]);router[_0xc0a1('0x7')]('/:id/messages',auth[_0xc0a1('0xa')](),controller['getMessages']);router[_0xc0a1('0x7')](_0xc0a1('0xe'),auth[_0xc0a1('0xa')](),controller[_0xc0a1('0xf')]);router['post']('/',auth[_0xc0a1('0xa')](),controller[_0xc0a1('0x10')]);router[_0xc0a1('0x11')](_0xc0a1('0x12'),auth[_0xc0a1('0xa')](),controller['addMessage']);router[_0xc0a1('0x11')](_0xc0a1('0x13'),auth['isAuthenticated'](),interaction[_0xc0a1('0x14')](_0xc0a1('0x15'),_0xc0a1('0x16')),controller['addTags']);router[_0xc0a1('0x17')]('/:id',auth[_0xc0a1('0xa')](),interaction[_0xc0a1('0x14')](_0xc0a1('0x15'),_0xc0a1('0x18')),controller[_0xc0a1('0x19')]);router[_0xc0a1('0x1a')](_0xc0a1('0xc'),auth[_0xc0a1('0xa')](),interaction['tracked'](_0xc0a1('0x15'),_0xc0a1('0x1b')),controller[_0xc0a1('0x1c')]);router[_0xc0a1('0x1a')](_0xc0a1('0x13'),auth[_0xc0a1('0xa')](),controller[_0xc0a1('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 06a2fa1..46353a3 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 _0xe8a4=['ENUM','out','sequelize','BOOLEAN','STRING','DATE'];(function(_0x5b3c11,_0x1976df){var _0xcd0657=function(_0x4dc055){while(--_0x4dc055){_0x5b3c11['push'](_0x5b3c11['shift']());}};_0xcd0657(++_0x1976df);}(_0xe8a4,0x158));var _0x4e8a=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xe8a4[_0x2fc012];return _0x2891f9;};'use strict';var Sequelize=require(_0x4e8a('0x0'));module['exports']={'closed':{'type':Sequelize[_0x4e8a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4e8a('0x2')]},'secondDisposition':{'type':Sequelize[_0x4e8a('0x2')]},'thirdDisposition':{'type':Sequelize[_0x4e8a('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x4e8a('0x3')]},'threadId':{'type':Sequelize[_0x4e8a('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x4e8a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4e8a('0x4')]('in',_0x4e8a('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4e8a('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x4e8a('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xe002=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x388e6f,_0x2f18aa){var _0x281a34=function(_0x4a1b1e){while(--_0x4a1b1e){_0x388e6f['push'](_0x388e6f['shift']());}};_0x281a34(++_0x2f18aa);}(_0xe002,0xf7));var _0x2e00=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0xe002[_0x38c652];return _0x218a37;};'use strict';var Sequelize=require(_0x2e00('0x0'));module[_0x2e00('0x1')]={'closed':{'type':Sequelize[_0x2e00('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2e00('0x3')]},'secondDisposition':{'type':Sequelize[_0x2e00('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2e00('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2e00('0x4')]},'threadId':{'type':Sequelize[_0x2e00('0x3')]},'externalUrl':{'type':Sequelize[_0x2e00('0x3')]},'lastMsgAt':{'type':Sequelize[_0x2e00('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2e00('0x5')]('in',_0x2e00('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2e00('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x2e00('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 49a333f..c8823c8 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 _0x10e8=['start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','some','compact','isEmpty','OpenchannelAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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)','unreadMessages','order','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','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.*','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','rows','params','rawAttributes','includeAll','include','options','create','body','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','nolimit','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','spread','findAll','openchannelInteractionTags:save','join','root','server','tmp','files','attachments','push','CmContact','Contact','firstName','lastName','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','get','N.A.','closed','closedAt','disposition','Public','Private','basename','existsSync','out','System','renderFile','views','.pdf','Openchannel','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','Users','map','fullname','TagIds','split','forEach','catch','index','OpenchannelInteraction','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','field','color','from','tools_tags','select','ui.OpenchannelInteractionId','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','expr','search','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','operator','$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?','find','ContactId','type'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x10e8,0x85));var _0x810e=function(_0x417634,_0x5c375a){_0x417634=_0x417634-0x0;var _0x219a87=_0x10e8[_0x417634];return _0x219a87;};'use strict';var emlformat=require(_0x810e('0x0'));var rimraf=require(_0x810e('0x1'));var zipdir=require(_0x810e('0x2'));var jsonpatch=require(_0x810e('0x3'));var rp=require(_0x810e('0x4'));var moment=require(_0x810e('0x5'));var BPromise=require(_0x810e('0x6'));var Mustache=require(_0x810e('0x7'));var util=require(_0x810e('0x8'));var path=require(_0x810e('0x9'));var sox=require(_0x810e('0xa'));var csv=require(_0x810e('0xb'));var ejs=require(_0x810e('0xc'));var fs=require('fs');var fs_extra=require(_0x810e('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x810e('0xe'));var deskjs=require(_0x810e('0xf'));var toCsv=require(_0x810e('0xb'));var querystring=require(_0x810e('0x10'));var Papa=require(_0x810e('0x11'));var Redis=require(_0x810e('0x12'));var authService=require(_0x810e('0x13'));var qs=require(_0x810e('0x14'));var as=require(_0x810e('0x15'));var pdf=require(_0x810e('0x16'));var hardwareService=require(_0x810e('0x17'));var logger=require(_0x810e('0x18'))(_0x810e('0x19'));var utils=require(_0x810e('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x810e('0x1b'))['db'];config[_0x810e('0x1c')]=_['defaults'](config[_0x810e('0x1c')],{'host':_0x810e('0x1d'),'port':0x18eb});var socket=require(_0x810e('0x1e'))(new Redis(config[_0x810e('0x1c')]));require(_0x810e('0x1f'))[_0x810e('0x20')](socket);function respondWithStatusCode(_0xefb3a4,_0x2f5f5c){_0x2f5f5c=_0x2f5f5c||0xcc;return function(_0x2c3798){if(_0x2c3798){return _0xefb3a4[_0x810e('0x21')](_0x2f5f5c);}return _0xefb3a4[_0x810e('0x22')](_0x2f5f5c)['end']();};}function respondWithResult(_0x23e0ac,_0x4f155e){_0x4f155e=_0x4f155e||0xc8;return function(_0x4696a2){if(_0x4696a2){return _0x23e0ac[_0x810e('0x22')](_0x4f155e)[_0x810e('0x23')](_0x4696a2);}};}function respondWithFilteredResult(_0x198429,_0x3560c0){return function(_0x2f1f2a){if(_0x2f1f2a){var _0x545a9d=typeof _0x3560c0[_0x810e('0x24')]===_0x810e('0x25')&&typeof _0x3560c0['limit']===_0x810e('0x25');var _0x33ddff=_0x2f1f2a[_0x810e('0x26')];var _0x80383=_0x545a9d?0x0:_0x3560c0['offset'];var _0x42aa9f=_0x545a9d?_0x2f1f2a[_0x810e('0x26')]:_0x3560c0[_0x810e('0x24')]+_0x3560c0[_0x810e('0x27')];var _0x22dd9e;if(_0x42aa9f>=_0x33ddff){_0x42aa9f=_0x33ddff;_0x22dd9e=0xc8;}else{_0x22dd9e=0xce;}_0x198429[_0x810e('0x22')](_0x22dd9e);return _0x198429['set'](_0x810e('0x28'),_0x80383+'-'+_0x42aa9f+'/'+_0x33ddff)['json'](_0x2f1f2a);}return null;};}function patchUpdates(_0x2e5490){return function(_0x2bfb10){try{jsonpatch[_0x810e('0x29')](_0x2bfb10,_0x2e5490,!![]);}catch(_0x121442){return BPromise[_0x810e('0x2a')](_0x121442);}return _0x2bfb10[_0x810e('0x2b')]();};}function saveUpdates(_0x1ef5ba,_0x15ae61){return function(_0x4f39fb){if(_0x4f39fb){return _0x4f39fb[_0x810e('0x2c')](_0x1ef5ba)[_0x810e('0x2d')](function(_0x24c482){return _0x24c482;});}return null;};}function removeEntity(_0xa951bf,_0x522687){return function(_0x44ca5f){if(_0x44ca5f){return _0x44ca5f[_0x810e('0x2e')]()[_0x810e('0x2d')](function(){_0xa951bf[_0x810e('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead9c,_0x39eec5){return function(_0x33206e){if(!_0x33206e){_0x2ead9c[_0x810e('0x21')](0x194);}return _0x33206e;};}function handleError(_0x2ffb5b,_0x15065a){_0x15065a=_0x15065a||0x1f4;return function(_0x44c4cc){logger[_0x810e('0x2f')](_0x44c4cc['stack']);if(_0x44c4cc[_0x810e('0x30')]){delete _0x44c4cc[_0x810e('0x30')];}_0x2ffb5b['status'](_0x15065a)['send'](_0x44c4cc);};}function getInteractionUsers(_0x4b888f,_0x5a3d4e){return new BPromise(function(_0x4d2681,_0x2501a2){try{if(_0x5a3d4e[_0x4b888f['id']]){_0x4b888f[_0x810e('0x31')]=_[_0x810e('0x32')](_0x5a3d4e[_0x4b888f['id']],function(_0x17a411){return{'id':_0x17a411['id'],'fullname':_0x17a411[_0x810e('0x33')]};});}}catch(_0x4f24bd){_0x2501a2(_0x4f24bd);}_0x4d2681(_0x4b888f);});}function getInteractionTags(_0x5642fb,_0x315158){return new BPromise(function(_0x375a90,_0x561ec1){try{if(_0x5642fb['TagIds']){_0x5642fb['Tags']=[];_0x5642fb[_0x810e('0x34')][_0x810e('0x35')](',')[_0x810e('0x36')](function(_0x4f76d0){_0x5642fb['Tags']['push'](_0x315158[_0x4f76d0]);});}delete _0x5642fb[_0x810e('0x34')];}catch(_0x8fdc58){_0x561ec1(_0x8fdc58);}_0x375a90(_0x5642fb);});}function updateOpenchannelInteraction(_0x2ebe3e,_0x5019bb,_0x558d85){return new BPromise(function(_0x2a2dd1,_0x307dc1){return getInteractionUsers(_0x2ebe3e,_0x558d85)['then'](function(_0x164e3b){return getInteractionTags(_0x164e3b,_0x5019bb);})[_0x810e('0x2d')](function(_0x787fdd){_0x2a2dd1(_0x787fdd);})[_0x810e('0x37')](function(_0x25aa84){_0x307dc1(_0x25aa84);});});}exports[_0x810e('0x38')]=function(_0x1f9280,_0x280195){var _0xb1bdbf={},_0x46d6aa={},_0x1cc7a7={'count':0x0,'rows':[]};var _0x7706cb=_[_0x810e('0x32')](db[_0x810e('0x39')]['rawAttributes'],function(_0x867a0){return{'name':_0x867a0[_0x810e('0x3a')],'type':_0x867a0['type'][_0x810e('0x3b')]};});_0x46d6aa['model']=_['map'](_0x7706cb,_0x810e('0x30'));_0x46d6aa[_0x810e('0x3c')]=_[_0x810e('0x3d')](_0x1f9280[_0x810e('0x3c')]);_0x46d6aa[_0x810e('0x3e')]=_[_0x810e('0x3f')](_0x46d6aa[_0x810e('0x40')],_0x46d6aa['query']);_0xb1bdbf[_0x810e('0x41')]=_[_0x810e('0x3f')](_0x46d6aa['model'],qs[_0x810e('0x42')](_0x1f9280['query'][_0x810e('0x42')]));_0xb1bdbf[_0x810e('0x41')]=_0xb1bdbf[_0x810e('0x41')][_0x810e('0x43')]?_0xb1bdbf[_0x810e('0x41')]:_0x46d6aa['model'];if(!_0x1f9280[_0x810e('0x3c')][_0x810e('0x44')]('nolimit')){_0xb1bdbf[_0x810e('0x27')]=qs[_0x810e('0x27')](_0x1f9280[_0x810e('0x3c')][_0x810e('0x27')]);_0xb1bdbf['offset']=qs[_0x810e('0x24')](_0x1f9280[_0x810e('0x3c')][_0x810e('0x24')]);}_0xb1bdbf['order']=qs[_0x810e('0x45')](_0x1f9280[_0x810e('0x3c')][_0x810e('0x45')]);_0xb1bdbf[_0x810e('0x46')]=qs[_0x810e('0x3e')](_[_0x810e('0x47')](_0x1f9280[_0x810e('0x3c')],_0x46d6aa[_0x810e('0x3e')]),_0x7706cb);var _0x17fb0e=[];var _0x23072c=squel['select']()[_0x810e('0x48')]('id')[_0x810e('0x48')]('name')[_0x810e('0x48')](_0x810e('0x49'))[_0x810e('0x4a')](_0x810e('0x4b'));var _0x1098fa=squel[_0x810e('0x4c')]()[_0x810e('0x48')]('u.id')[_0x810e('0x48')]('u.fullname')[_0x810e('0x48')](_0x810e('0x4d'))['from'](_0x810e('0x4e'),'ui')[_0x810e('0x4f')](_0x810e('0x50'),'u',_0x810e('0x51'));var _0x4539ae=squel[_0x810e('0x4c')]()[_0x810e('0x4a')](_0x810e('0x52'),'i')[_0x810e('0x4f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x810e('0x4f')]('users','o',_0x810e('0x53'))[_0x810e('0x4f')](_0x810e('0x54'),'a',_0x810e('0x55'))[_0x810e('0x4f')](_0x810e('0x56'),'me',_0x810e('0x57'))[_0x810e('0x4f')](_0x810e('0x58'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x810e('0x4f')](_0x810e('0x4b'),'t','t.id\x20=\x20it.TagId');var _0x380ccb=squel[_0x810e('0x59')]();var _0x30a3dc=[];var _0x2ba6d6=squel[_0x810e('0x59')]();var _0x7d0f87;if(_0x1f9280['query']['search']){_0x7d0f87=as['parseSearch'](_0x1f9280[_0x810e('0x3c')][_0x810e('0x5a')]);var _0x2a7378=_0x7d0f87[_0x810e('0x5b')];for(var _0x201276=0x0;_0x201276<_0x7d0f87[_0x810e('0x5c')][_0x810e('0x43')];_0x201276++){var _0x42d20d=_0x7d0f87[_0x810e('0x5c')][_0x201276];var _0x6f1fa0='i';var _0x1289e5=_['find'](_0x7706cb,[_0x810e('0x30'),_0x42d20d[_0x810e('0x48')]]);if(!_0x1289e5){switch(_0x42d20d[_0x810e('0x48')]){case'unreadMessages':if(_0x42d20d[_0x810e('0x5d')]==0x1){_0x4539ae[_0x810e('0x5e')]('`'+_0x42d20d['field']+_0x810e('0x5f'));}else{_0x4539ae[_0x810e('0x5e')]('`'+_0x42d20d['field']+_0x810e('0x60'));}break;case'Contact':if(_0x42d20d[_0x810e('0x61')]===_0x810e('0x62')){if(_0x42d20d[_0x810e('0x5d')]['split']('\x20')[_0x810e('0x43')]>0x1){_0x380ccb[_0x2a7378](_0x810e('0x63'),qs[_0x810e('0x64')](_0x42d20d[_0x810e('0x5d')]),null);}else{var _0x50de24='%'+_0x42d20d[_0x810e('0x5d')]+'%';_0x380ccb[_0x2a7378](_0x810e('0x65'),_0x50de24,_0x50de24,_0x50de24);}}else{_0x1289e5=_[_0x810e('0x66')](_0x7706cb,[_0x810e('0x30'),_0x810e('0x67')]);_0x42d20d[_0x810e('0x48')]=_0x810e('0x67');_0x28ae59=as['buildExpression'](_0x6f1fa0,_0x1289e5[_0x810e('0x68')],_0x42d20d);_0x380ccb[_0x2a7378](_0x28ae59['text'],_0x28ae59[_0x810e('0x5d')][_0x810e('0x69')],_0x28ae59[_0x810e('0x5d')][_0x810e('0x6a')]);}break;case _0x810e('0x6b'):var _0xf7ca4d=_0x42d20d[_0x810e('0x5d')]['split'](',')['map'](function(_0x54f155){return Number(_0x54f155);});_0xf7ca4d[_0x810e('0x36')](function(_0xc3c7ab){_0x2ba6d6['or'](_0x810e('0x6c'),'%,'+_0xc3c7ab+',%');});_0x30a3dc=_['union'](_0x30a3dc,_0xf7ca4d);break;case _0x810e('0x6d'):if(_0x42d20d[_0x810e('0x61')]===_0x810e('0x62')){_0x380ccb[_0x2a7378](_0x810e('0x6e'),'%'+_0x42d20d[_0x810e('0x5d')]+'%',null);}else{_0x1289e5=_[_0x810e('0x66')](_0x7706cb,[_0x810e('0x30'),_0x810e('0x6f')]);_0x42d20d[_0x810e('0x48')]=_0x810e('0x6f');_0x28ae59=as[_0x810e('0x70')](_0x6f1fa0,_0x1289e5[_0x810e('0x68')],_0x42d20d);_0x380ccb[_0x2a7378](_0x28ae59[_0x810e('0x71')],_0x28ae59[_0x810e('0x5d')][_0x810e('0x69')],_0x28ae59[_0x810e('0x5d')][_0x810e('0x6a')]);}break;case'body':_0x28ae59=as[_0x810e('0x70')]('me',null,_0x42d20d);_0x380ccb[_0x2a7378](_0x28ae59[_0x810e('0x71')],_0x28ae59['value']['start'],_0x28ae59['value'][_0x810e('0x6a')]);break;}}else{var _0x28ae59=as[_0x810e('0x70')](_0x6f1fa0,_0x1289e5[_0x810e('0x68')],_0x42d20d);_0x380ccb[_0x2a7378](_0x28ae59[_0x810e('0x71')],_0x28ae59[_0x810e('0x5d')][_0x810e('0x69')],_0x28ae59[_0x810e('0x5d')][_0x810e('0x6a')]);}}}else{var _0x1afcdd=_(_0x1f9280['query'])[_0x810e('0x3d')]()[_0x810e('0x32')](function(_0x43b3b9){return _[_0x810e('0x72')](_0x7706cb,[_0x810e('0x30'),_0x43b3b9])?_0x43b3b9:undefined;})[_0x810e('0x73')]()[_0x810e('0x5d')]();if(!_[_0x810e('0x74')](_0x1afcdd)){_0x1afcdd[_0x810e('0x36')](function(_0x41d29e){if(_0x41d29e===_0x810e('0x75')){_0x4539ae[_0x810e('0x46')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x810e('0x76')](_0x1f9280[_0x810e('0x3c')][_0x41d29e]));}else if(_0x41d29e===_0x810e('0x77')){var _0x43bdde=JSON[_0x810e('0x78')](_0x1f9280[_0x810e('0x3c')][_0x41d29e])[_0x810e('0x79')];var _0x388f62=JSON[_0x810e('0x78')](_0x1f9280[_0x810e('0x3c')][_0x41d29e])[_0x810e('0x7a')];_0x4539ae[_0x810e('0x46')](_0x810e('0x7b'),_0x43bdde,_0x388f62);}else{if(_0x1f9280[_0x810e('0x3c')][_0x41d29e]===_0x810e('0x7c')){_0x4539ae['where']('i.'+_0x41d29e+'\x20IS\x20NULL');}else{_0x4539ae['where']('i.'+_0x41d29e+_0x810e('0x7d'),_0x1f9280[_0x810e('0x3c')][_0x41d29e]);}}});}if(_0x1f9280[_0x810e('0x3c')][_0x810e('0x7e')]){if(_0x1f9280[_0x810e('0x3c')][_0x810e('0x7e')]==0x1){_0x4539ae[_0x810e('0x5e')](_0x810e('0x7f'));}else{_0x4539ae[_0x810e('0x5e')](_0x810e('0x80'));}}if(_0x1f9280[_0x810e('0x3c')]['tag']){_0x30a3dc=_[_0x810e('0x81')](_0x1f9280['query'][_0x810e('0x82')])?_0x1f9280[_0x810e('0x3c')][_0x810e('0x82')]:new Array(_0x1f9280[_0x810e('0x3c')]['tag']);_0x30a3dc[_0x810e('0x36')](function(_0x5b6b60){_0x2ba6d6['or'](_0x810e('0x6c'),'%,'+_0x5b6b60+',%');});}if(_0x1f9280[_0x810e('0x3c')][_0x810e('0x83')]){var _0x4e66bb=_0x1f9280['query'][_0x810e('0x83')][_0x810e('0x84')]('\x5c','\x5c\x5c')[_0x810e('0x84')](/'/g,'\x27\x27');if(qs[_0x810e('0x85')](_0x4e66bb)){_0x380ccb['or']('i.id\x20LIKE\x20?',_0x4e66bb+'%');}else{_0x380ccb['or'](_0x810e('0x86'),qs[_0x810e('0x64')](_0x4e66bb))['or']('i.from\x20LIKE\x20?',_0x4e66bb+'%')['or'](_0x810e('0x87'),_0x4e66bb+'%');}}}_0x4539ae[_0x810e('0x46')](_0x380ccb);_0x4539ae[_0x810e('0x88')](_0x810e('0x89'));var _0x33932f={'type':db[_0x810e('0x8a')][_0x810e('0x8b')]['SELECT'],'raw':!![]};var _0x49b6b2=_0x4539ae[_0x810e('0x8c')]();_0x49b6b2['field'](_0x810e('0x89'));_0x49b6b2[_0x810e('0x48')](_0x810e('0x8d'),_0x810e('0x8e'));if(_0xb1bdbf[_0x810e('0x8f')]){_0xb1bdbf['order'][_0x810e('0x36')](function(_0x2c8407){var _0x2bba75=_0x2c8407[0x0]===_0x810e('0x90')?_0x2c8407[0x0]:'i.'+_0x2c8407[0x0];_0x4539ae[_0x810e('0x8f')](_0x2bba75,_0x2c8407[0x1]===_0x810e('0x91')?![]:!![]);});}if(!_[_0x810e('0x74')](_0x30a3dc)){_0x4539ae['having'](_0x2ba6d6);_0x49b6b2['where']('t.id\x20IN\x20?',_0x30a3dc);}BPromise[_0x810e('0x92')]()['then'](function(){if(!_0x7d0f87){if(_0x1f9280[_0x810e('0x3c')][_0x810e('0x75')])return;_0x49b6b2['where'](_0x810e('0x93'));_0x4539ae[_0x810e('0x46')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1f9280[_0x810e('0x94')][_0x810e('0x95')]!==_0x810e('0x96'))return;return _0x1f9280[_0x810e('0x94')][_0x810e('0x97')]({'attributes':['id'],'raw':!![]})[_0x810e('0x2d')](function(_0x494ab7){if(_[_0x810e('0x74')](_0x494ab7)){_0x49b6b2[_0x810e('0x46')](_0x810e('0x98'));_0x4539ae[_0x810e('0x46')](_0x810e('0x98'));}else{_0x49b6b2[_0x810e('0x46')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x810e('0x32')](_0x494ab7,'id'));_0x4539ae['where'](_0x810e('0x99'),_[_0x810e('0x32')](_0x494ab7,'id'));}});})['then'](function(){if(_0x1f9280['user'][_0x810e('0x95')]==='agent'&&!_0x7d0f87&&!_0x1f9280[_0x810e('0x3c')][_0x810e('0x75')])return[];return db[_0x810e('0x9a')][_0x810e('0x3c')](_0x49b6b2[_0x810e('0x9b')](),_0x33932f);})[_0x810e('0x2d')](function(_0x39f633){_0x1cc7a7[_0x810e('0x26')]=_0x39f633['length'];if(_0x1cc7a7[_0x810e('0x26')]===0x0)return[];return db['sequelize'][_0x810e('0x3c')](_0x23072c[_0x810e('0x9b')](),_0x33932f)['then'](function(_0x274ad7){_0x17fb0e=_[_0x810e('0x9c')](_0x274ad7,'id');_0x33932f=_[_0x810e('0x9d')](_0x33932f,{'model':db[_0x810e('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1f9280[_0x810e('0x3c')][_0x810e('0x42')]){_0xb1bdbf[_0x810e('0x41')][_0x810e('0x36')](function(_0x30a87b){_0x4539ae[_0x810e('0x48')]('i.'+_0x30a87b);});}else{_0x4539ae[_0x810e('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x810e('0x8e'));_0x4539ae[_0x810e('0x48')]('a.key',_0x810e('0x9e'));_0x4539ae[_0x810e('0x48')](_0x810e('0x9f'),_0x810e('0xa0'));_0x4539ae['field'](_0x810e('0xa1'),_0x810e('0x90'));_0x4539ae[_0x810e('0x48')](_0x810e('0xa2'));_0x4539ae[_0x810e('0x48')]('c.firstName','Contact.firstName');_0x4539ae[_0x810e('0x48')](_0x810e('0xa3'),_0x810e('0xa4'));_0x4539ae[_0x810e('0x48')](_0x810e('0xa5'),_0x810e('0xa6'));_0x4539ae[_0x810e('0x48')](_0x810e('0xa7'),_0x810e('0xa8'));_0x4539ae[_0x810e('0x48')](_0x810e('0xa9'),_0x810e('0xaa'));_0x4539ae[_0x810e('0x48')](_0x810e('0xab'),_0x810e('0xac'));_0x4539ae[_0x810e('0x48')](_0x810e('0xad'),_0x810e('0xae'));_0x4539ae[_0x810e('0x48')](_0x810e('0xaf'),'Owner.internal');_0x4539ae[_0x810e('0x48')](_0x810e('0xb0'),_0x810e('0x34'));}if(_0xb1bdbf[_0x810e('0x27')])_0x4539ae[_0x810e('0x27')](_0xb1bdbf[_0x810e('0x27')]);if(_0xb1bdbf[_0x810e('0x24')])_0x4539ae[_0x810e('0x24')](_0xb1bdbf[_0x810e('0x24')]);return db[_0x810e('0x9a')][_0x810e('0x3c')](_0x4539ae[_0x810e('0x9b')](),_0x33932f);})[_0x810e('0x2d')](function(_0x3aebb4){if(_0x3aebb4['length']>0x0)_0x1098fa[_0x810e('0x46')](_0x810e('0xb1'),_[_0x810e('0x32')](_0x3aebb4,'id'));return db[_0x810e('0x9a')][_0x810e('0x3c')](_0x1098fa['toString'](),_0x33932f)['then'](function(_0x267663){var _0x22fd8c=_[_0x810e('0xb2')](_0x267663,'OpenchannelInteractionId');var _0xfc4487=[];_0x3aebb4[_0x810e('0x36')](function(_0x20ac5c){_0xfc4487['push'](updateOpenchannelInteraction(_0x20ac5c,_0x17fb0e,_0x22fd8c));});return BPromise[_0x810e('0xb3')](_0xfc4487);});});})[_0x810e('0x2d')](function(_0x3b25d8){_0x1cc7a7[_0x810e('0xb4')]=_0x3b25d8;return _0x1cc7a7;})['then'](respondWithFilteredResult(_0x280195,_0xb1bdbf))[_0x810e('0x37')](handleError(_0x280195,null));};exports['show']=function(_0x5043d2,_0x27a382){var _0x3a3120={};if(_0x5043d2[_0x810e('0x3c')][_0x810e('0x68')]&&_0x5043d2['query'][_0x810e('0x68')]===_0x810e('0x4a')){_0x3a3120[_0x810e('0x4a')]=_0x5043d2[_0x810e('0xb5')]['id'];}else{_0x3a3120['id']=_0x5043d2[_0x810e('0xb5')]['id'];}var _0x19852f={'raw':![],'where':_0x3a3120},_0x48994a={};_0x48994a[_0x810e('0x40')]=_[_0x810e('0x3d')](db[_0x810e('0x39')][_0x810e('0xb6')]);_0x48994a[_0x810e('0x3c')]=_[_0x810e('0x3d')](_0x5043d2[_0x810e('0x3c')]);_0x48994a['filters']=_['intersection'](_0x48994a['model'],_0x48994a['query']);_0x19852f[_0x810e('0x41')]=_[_0x810e('0x3f')](_0x48994a[_0x810e('0x40')],qs['fields'](_0x5043d2['query'][_0x810e('0x42')]));_0x19852f[_0x810e('0x41')]=_0x19852f[_0x810e('0x41')]['length']?_0x19852f[_0x810e('0x41')]:_0x48994a[_0x810e('0x40')];if(_0x5043d2['query'][_0x810e('0xb7')]){_0x19852f[_0x810e('0xb8')]=[{'all':!![]}];}_0x19852f=_['merge']({},_0x19852f,_0x5043d2[_0x810e('0xb9')]);return db['OpenchannelInteraction'][_0x810e('0x66')](_0x19852f)[_0x810e('0x2d')](handleEntityNotFound(_0x27a382,null))[_0x810e('0x2d')](respondWithResult(_0x27a382,null))[_0x810e('0x37')](handleError(_0x27a382,null));};exports[_0x810e('0xba')]=function(_0x1c9dcf,_0x355ec5){return db[_0x810e('0x39')][_0x810e('0xba')](_0x1c9dcf['body'],{})[_0x810e('0x2d')](respondWithResult(_0x355ec5,0xc9))[_0x810e('0x37')](handleError(_0x355ec5,null));};exports[_0x810e('0x2c')]=function(_0x4b3eb5,_0x360421){if(_0x4b3eb5['body']['id']){delete _0x4b3eb5[_0x810e('0xbb')]['id'];}return db[_0x810e('0x39')]['find']({'where':{'id':_0x4b3eb5[_0x810e('0xb5')]['id']}})[_0x810e('0x2d')](handleEntityNotFound(_0x360421,null))[_0x810e('0x2d')](saveUpdates(_0x4b3eb5[_0x810e('0xbb')],null))[_0x810e('0x2d')](respondWithResult(_0x360421,null))[_0x810e('0x37')](handleError(_0x360421,null));};exports['destroy']=function(_0x531d0b,_0x1f9f18){return db[_0x810e('0x39')][_0x810e('0x66')]({'where':{'id':_0x531d0b[_0x810e('0xb5')]['id']}})['then'](handleEntityNotFound(_0x1f9f18,null))[_0x810e('0x2d')](removeEntity(_0x1f9f18,null))[_0x810e('0x37')](handleError(_0x1f9f18,null));};exports['describe']=function(_0x39d0f5,_0x45acde){return db[_0x810e('0x39')][_0x810e('0xbc')]()[_0x810e('0x2d')](respondWithResult(_0x45acde,null))['catch'](handleError(_0x45acde,null));};exports[_0x810e('0xbd')]=function(_0x5e6508,_0x4f2a72,_0x10b8ad){return db[_0x810e('0xbe')][_0x810e('0x66')]({'where':{'id':_0x5e6508[_0x810e('0xb5')]['id']}})['then'](handleEntityNotFound(_0x4f2a72,null))[_0x810e('0x2d')](function(_0x8f5f8f){if(_0x8f5f8f){return _0x8f5f8f[_0x810e('0xbd')](_0x5e6508[_0x810e('0xbb')][_0x810e('0xbf')],_['omit'](_0x5e6508[_0x810e('0xbb')],['ids','id'])||{});}})['then'](respondWithResult(_0x4f2a72,null))[_0x810e('0x37')](handleError(_0x4f2a72,null));};exports[_0x810e('0xc0')]=function(_0x1a1ab7,_0x387f92,_0x2419a3){var _0x54470d={'raw':![],'where':{}};var _0x1d10d7={};var _0x536b19={'count':0x0,'rows':[]};return db[_0x810e('0x39')][_0x810e('0xc1')]({'where':{'id':_0x1a1ab7['params']['id']}})[_0x810e('0x2d')](handleEntityNotFound(_0x387f92,null))[_0x810e('0x2d')](function(_0x4c0268){if(_0x4c0268){_0x1d10d7['model']=_['keys'](db[_0x810e('0xbe')][_0x810e('0xb6')]);_0x1d10d7['query']=_['keys'](_0x1a1ab7[_0x810e('0x3c')]);_0x1d10d7['filters']=_[_0x810e('0x3f')](_0x1d10d7[_0x810e('0x40')],_0x1d10d7['query']);_0x54470d[_0x810e('0x41')]=_[_0x810e('0x3f')](_0x1d10d7[_0x810e('0x40')],qs[_0x810e('0x42')](_0x1a1ab7[_0x810e('0x3c')][_0x810e('0x42')]));_0x54470d['attributes']=_0x54470d['attributes'][_0x810e('0x43')]?_0x54470d['attributes']:_0x1d10d7[_0x810e('0x40')];if(!_0x1a1ab7[_0x810e('0x3c')][_0x810e('0x44')](_0x810e('0xc2'))){_0x54470d[_0x810e('0x27')]=qs[_0x810e('0x27')](_0x1a1ab7[_0x810e('0x3c')][_0x810e('0x27')]);_0x54470d[_0x810e('0x24')]=qs['offset'](_0x1a1ab7[_0x810e('0x3c')][_0x810e('0x24')]);}_0x54470d[_0x810e('0x8f')]=qs[_0x810e('0x45')](_0x1a1ab7[_0x810e('0x3c')][_0x810e('0x45')]);_0x54470d['where']=qs[_0x810e('0x3e')](_[_0x810e('0x47')](_0x1a1ab7[_0x810e('0x3c')],_0x1d10d7[_0x810e('0x3e')]));_0x54470d['where'][_0x810e('0xc3')]=_0x4c0268['id'];if(_0x1a1ab7['query']['filter']){_0x54470d[_0x810e('0x46')]=_[_0x810e('0x9d')](_0x54470d['where'],{'$or':_[_0x810e('0x32')](_0x54470d[_0x810e('0x41')],function(_0x15f442){var _0x27cb6e={};_0x27cb6e[_0x15f442]={'$like':'%'+_0x1a1ab7[_0x810e('0x3c')]['filter']+'%'};return _0x27cb6e;})});}if(_0x1a1ab7[_0x810e('0x3c')][_0x810e('0x79')]){var _0x1113d0=_0x1a1ab7[_0x810e('0x3c')][_0x810e('0x79')][_0x810e('0x35')](',');var _0x241e52={};_0x241e52[_0x1113d0[0x0]]={'$gte':moment(_0x1113d0[0x1])[_0x810e('0xc4')](_0x810e('0xc5'))};_0x54470d['where']=_[_0x810e('0x9d')](_0x54470d['where'],_0x241e52);}_0x54470d=_[_0x810e('0x9d')]({},_0x54470d,_0x1a1ab7[_0x810e('0xb9')]);return db[_0x810e('0xbe')][_0x810e('0x26')]({'where':_0x54470d['where']})[_0x810e('0x2d')](function(_0x7d9cc1){_0x536b19[_0x810e('0x26')]=_0x7d9cc1;if(_0x1a1ab7[_0x810e('0x3c')][_0x810e('0xb7')]){_0x54470d[_0x810e('0xb8')]=[{'all':!![]}];}return db[_0x810e('0xbe')]['findAll'](_0x54470d);})['then'](function(_0x16e140){_0x536b19[_0x810e('0xb4')]=_0x16e140;return _0x536b19;});}})[_0x810e('0x2d')](respondWithFilteredResult(_0x387f92,_0x54470d))[_0x810e('0x37')](handleError(_0x387f92,null));};exports[_0x810e('0xc6')]=function(_0x387eee,_0x17e425,_0x180f1d){return db['OpenchannelInteraction']['find']({'where':{'id':_0x387eee['params']['id']}})[_0x810e('0x2d')](handleEntityNotFound(_0x17e425,null))[_0x810e('0x2d')](function(_0x1ca44e){if(_0x1ca44e){return _0x1ca44e[_0x810e('0xc7')](_0x387eee[_0x810e('0xbb')][_0x810e('0xbf')],_[_0x810e('0xc8')](_0x387eee[_0x810e('0xbb')],[_0x810e('0xbf'),'id'])||{})[_0x810e('0xc9')](function(){return db['Tag'][_0x810e('0xca')]({'attributes':['id','name',_0x810e('0x49')],'where':{'id':_0x387eee['body'][_0x810e('0xbf')]}});})['then'](function(_0x108606){socket['emit'](_0x810e('0xcb'),{'id':Number(_0x387eee[_0x810e('0xb5')]['id']),'tags':_0x108606||[]});return{'id':Number(_0x387eee['params']['id']),'tags':_0x108606||[]};});}})['then'](respondWithResult(_0x17e425,null))['catch'](handleError(_0x17e425,null));};exports['removeTags']=function(_0x5454a5,_0x1eeaec,_0x12c58c){return db[_0x810e('0x39')][_0x810e('0x66')]({'where':{'id':_0x5454a5[_0x810e('0xb5')]['id']}})['then'](handleEntityNotFound(_0x1eeaec,null))['then'](function(_0x5a9e25){if(_0x5a9e25){return _0x5a9e25['removeTags'](_0x5454a5['query'][_0x810e('0xbf')]);}})[_0x810e('0x2d')](respondWithStatusCode(_0x1eeaec,null))[_0x810e('0x37')](handleError(_0x1eeaec,null));};exports['download']=function(_0x531731,_0x6a49d7){var _0x44cf2e=moment()['unix']()[_0x810e('0x9b')]();var _0x36e82e=path[_0x810e('0xcc')](config[_0x810e('0xcd')],_0x810e('0xce'),'files',_0x810e('0xcf'));var _0x416ca3=path[_0x810e('0xcc')](config[_0x810e('0xcd')],_0x810e('0xce'),_0x810e('0xd0'),_0x810e('0xd1'));var _0xaed907=path['join'](_0x36e82e,_0x44cf2e);var _0x48f965=util['format']('transcript-%d-%s.zip',_0x531731[_0x810e('0xb5')]['id'],_0x44cf2e);var _0x4b8e71=path['join'](_0x36e82e,_0x48f965);var _0x4d7172=[];_0x4d7172[_0x810e('0xd2')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x4d7172[_0x810e('0xd2')]({'model':db[_0x810e('0xd3')],'as':_0x810e('0xd4'),'attributes':['id',_0x810e('0xd5'),_0x810e('0xd6')],'raw':!![]});if(_0x531731[_0x810e('0x3c')][_0x810e('0xd1')]){_0x4d7172[_0x810e('0xd2')]({'model':db['Attachment'],'as':_0x810e('0xd7'),'raw':!![]});}var _0x2263d0=[{'model':db['OpenchannelMessage'],'as':_0x810e('0xd8'),'attributes':['id','body',_0x810e('0x77'),'direction',_0x810e('0xd9'),_0x810e('0x7e')],'include':_0x4d7172}];_0x2263d0['push']({'model':db[_0x810e('0xda')],'as':_0x810e('0xdb'),'attributes':['id',_0x810e('0x30')]});_0x2263d0[_0x810e('0xd2')]({'model':db[_0x810e('0x6d')],'as':_0x810e('0xdc'),'attributes':['id',_0x810e('0x33')]});return db[_0x810e('0x39')][_0x810e('0x66')]({'where':{'id':_0x531731[_0x810e('0xb5')]['id']},'include':_0x2263d0})[_0x810e('0x2d')](handleEntityNotFound(_0x6a49d7,null))[_0x810e('0x2d')](function(_0x1bd012){if(_0x1bd012){var _0x12dc0d=_0x1bd012[_0x810e('0xdd')]({'plain':!![]});fs['mkdirSync'](_0xaed907);var _0x21bd5f={'channel':'Openchannel','account':_0x12dc0d[_0x810e('0xdb')][_0x810e('0x30')],'agent':_0x12dc0d[_0x810e('0xdc')]?_0x12dc0d[_0x810e('0xdc')][_0x810e('0x33')]:_0x810e('0xde'),'createdAt':moment(_0x12dc0d[_0x810e('0x77')])[_0x810e('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x810e('0x9b')](),'closedAt':_0x12dc0d[_0x810e('0xdf')]?moment(_0x12dc0d[_0x810e('0xe0')])[_0x810e('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x810e('0x9b')]():'','disposition':_0x12dc0d[_0x810e('0xe1')],'visibility':_0x12dc0d['threadId']?_0x810e('0xe2'):_0x810e('0xe3'),'messages':_(_0x12dc0d[_0x810e('0xd8')])[_0x810e('0x83')]({'secret':![]})['map'](function(_0x2e8b00){if(_0x2e8b00[_0x810e('0xd7')]){var _0x1c9cf7=path[_0x810e('0xcc')](_0x416ca3,_0x2e8b00[_0x810e('0xd7')][_0x810e('0xe4')]);if(fs[_0x810e('0xe5')](_0x1c9cf7)){fs['createReadStream'](_0x1c9cf7)['pipe'](fs['createWriteStream'](path[_0x810e('0xcc')](_0xaed907,_0x2e8b00[_0x810e('0xd7')][_0x810e('0xe4')])));}}return{'date':moment(_0x2e8b00[_0x810e('0x77')])['format'](_0x810e('0xc5'))['toString'](),'sender':_0x2e8b00['direction']===_0x810e('0xe6')?_0x2e8b00['User']?_0x2e8b00[_0x810e('0x6d')][_0x810e('0x33')]:_0x810e('0xe7'):_0x2e8b00[_0x810e('0xd4')]['firstName']+(_0x2e8b00[_0x810e('0xd4')][_0x810e('0xd6')]?'\x20'+_0x2e8b00[_0x810e('0xd4')][_0x810e('0xd6')]:''),'body':_0x2e8b00[_0x810e('0xd7')]?_0x2e8b00['Attachment']['basename']:_0x2e8b00[_0x810e('0xbb')],'direction':_0x2e8b00['direction']===_0x810e('0xe6')?'A':'C','secret':_0x2e8b00['secret'],'read':_0x2e8b00[_0x810e('0x7e')],'attachment':_0x2e8b00[_0x810e('0xd7')]};})['value']()};return ejs[_0x810e('0xe8')](path[_0x810e('0xcc')](config[_0x810e('0xcd')],_0x810e('0xce'),_0x810e('0xe9'),'downloadInteraction.ejs'),{'interaction':_0x21bd5f})[_0x810e('0x2d')](function(_0x118a46){var _0x2d8675=path[_0x810e('0xcc')](_0xaed907,'transcript-'+_0x12dc0d['id']+'-'+_0x44cf2e+_0x810e('0xea'));var _0x45408d={'path':_0x2d8675,'channel':_0x810e('0xeb'),'interactionId':_0x12dc0d['id']};return pdf['createPdfFromHTML'](_0x118a46,_0x45408d);})[_0x810e('0x2d')](function(){return new BPromise(function(_0x53b049,_0x427662){zipdir(_0xaed907,{'saveTo':_0x4b8e71},function(_0xcef801,_0xc23f9c){if(_0xcef801)return _0x427662(_0xcef801);return _0x53b049(_0xc23f9c);});})[_0x810e('0x2d')](function(){return new BPromise(function(_0x54a3cb,_0x2f69b5){rimraf(_0xaed907,function(_0x587ba5){if(_0x587ba5)_0x2f69b5(_0x587ba5);return _0x54a3cb();});});})[_0x810e('0x2d')](function(){return _0x6a49d7['download'](_0x4b8e71,_0x48f965,function(_0x39592e){if(_0x39592e){console[_0x810e('0xec')](_0x810e('0xed'),_0x39592e);}else{fs['unlinkSync'](_0x4b8e71);}});});});}else{return _0x6a49d7[_0x810e('0x21')](0xc8);}})['catch'](handleError(_0x6a49d7,null));}; \ No newline at end of file +var _0x1d6c=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/utils','../../config/environment','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','save','update','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','expr','search','conditions','find','value','having','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','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','parse','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','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.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','show','params','includeAll','include','options','create','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','color','emit','removeTags','unix','join','root','server','tmp','files','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','createdAt','secret','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','threadId','basename','existsSync','createReadStream','pipe','direction','out','System','Contact','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis'];(function(_0x12a658,_0x43a9a5){var _0x47931e=function(_0x57db8c){while(--_0x57db8c){_0x12a658['push'](_0x12a658['shift']());}};_0x47931e(++_0x43a9a5);}(_0x1d6c,0x1b2));var _0xc1d6=function(_0x1d8e7d,_0x10bce9){_0x1d8e7d=_0x1d8e7d-0x0;var _0x214545=_0x1d6c[_0x1d8e7d];return _0x214545;};'use strict';var emlformat=require(_0xc1d6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc1d6('0x1'));var rp=require(_0xc1d6('0x2'));var moment=require(_0xc1d6('0x3'));var BPromise=require(_0xc1d6('0x4'));var Mustache=require(_0xc1d6('0x5'));var util=require(_0xc1d6('0x6'));var path=require(_0xc1d6('0x7'));var sox=require(_0xc1d6('0x8'));var csv=require(_0xc1d6('0x9'));var ejs=require(_0xc1d6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc1d6('0xb'));var crypto=require('crypto');var jsforce=require(_0xc1d6('0xc'));var deskjs=require(_0xc1d6('0xd'));var toCsv=require(_0xc1d6('0x9'));var querystring=require(_0xc1d6('0xe'));var Papa=require('papaparse');var Redis=require(_0xc1d6('0xf'));var authService=require(_0xc1d6('0x10'));var qs=require(_0xc1d6('0x11'));var as=require(_0xc1d6('0x12'));var pdf=require(_0xc1d6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc1d6('0x14'));var utils=require(_0xc1d6('0x15'));var config=require(_0xc1d6('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc1d6('0x17')]=_[_0xc1d6('0x18')](config[_0xc1d6('0x17')],{'host':_0xc1d6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc1d6('0x17')]));require(_0xc1d6('0x1a'))[_0xc1d6('0x1b')](socket);function respondWithStatusCode(_0x211f99,_0x2bd98b){_0x2bd98b=_0x2bd98b||0xcc;return function(_0x44a406){if(_0x44a406){return _0x211f99[_0xc1d6('0x1c')](_0x2bd98b);}return _0x211f99[_0xc1d6('0x1d')](_0x2bd98b)[_0xc1d6('0x1e')]();};}function respondWithResult(_0x4513d9,_0x148687){_0x148687=_0x148687||0xc8;return function(_0x2fd842){if(_0x2fd842){return _0x4513d9[_0xc1d6('0x1d')](_0x148687)['json'](_0x2fd842);}};}function respondWithFilteredResult(_0x54f1fa,_0x54416e){return function(_0x4fb6f5){if(_0x4fb6f5){var _0x23688d=typeof _0x54416e[_0xc1d6('0x1f')]===_0xc1d6('0x20')&&typeof _0x54416e[_0xc1d6('0x21')]==='undefined';var _0x402ee5=_0x4fb6f5[_0xc1d6('0x22')];var _0x41b815=_0x23688d?0x0:_0x54416e[_0xc1d6('0x1f')];var _0x493eb2=_0x23688d?_0x4fb6f5[_0xc1d6('0x22')]:_0x54416e['offset']+_0x54416e['limit'];var _0x2edb88;if(_0x493eb2>=_0x402ee5){_0x493eb2=_0x402ee5;_0x2edb88=0xc8;}else{_0x2edb88=0xce;}_0x54f1fa[_0xc1d6('0x1d')](_0x2edb88);return _0x54f1fa[_0xc1d6('0x23')]('Content-Range',_0x41b815+'-'+_0x493eb2+'/'+_0x402ee5)[_0xc1d6('0x24')](_0x4fb6f5);}return null;};}function patchUpdates(_0xb6f199){return function(_0x3c1209){try{jsonpatch['apply'](_0x3c1209,_0xb6f199,!![]);}catch(_0x37994a){return BPromise['reject'](_0x37994a);}return _0x3c1209[_0xc1d6('0x25')]();};}function saveUpdates(_0x187f86,_0xe66025){return function(_0x3edd4){if(_0x3edd4){return _0x3edd4[_0xc1d6('0x26')](_0x187f86)['then'](function(_0xb7a23){return _0xb7a23;});}return null;};}function removeEntity(_0x5cb690,_0x17b7ad){return function(_0x40d3f8){if(_0x40d3f8){return _0x40d3f8[_0xc1d6('0x27')]()[_0xc1d6('0x28')](function(){_0x5cb690[_0xc1d6('0x1d')](0xcc)[_0xc1d6('0x1e')]();});}};}function handleEntityNotFound(_0x5cc53f,_0x59c9ed){return function(_0x2af347){if(!_0x2af347){_0x5cc53f[_0xc1d6('0x1c')](0x194);}return _0x2af347;};}function handleError(_0x38a482,_0x53e030){_0x53e030=_0x53e030||0x1f4;return function(_0x29fc18){logger[_0xc1d6('0x29')](_0x29fc18[_0xc1d6('0x2a')]);if(_0x29fc18[_0xc1d6('0x2b')]){delete _0x29fc18[_0xc1d6('0x2b')];}_0x38a482[_0xc1d6('0x1d')](_0x53e030)[_0xc1d6('0x2c')](_0x29fc18);};}function getInteractionUsers(_0x40d0fc,_0x19c001){return new BPromise(function(_0x597fa8,_0x42aba8){try{if(_0x19c001[_0x40d0fc['id']]){_0x40d0fc[_0xc1d6('0x2d')]=_[_0xc1d6('0x2e')](_0x19c001[_0x40d0fc['id']],function(_0x5626b2){return{'id':_0x5626b2['id'],'fullname':_0x5626b2[_0xc1d6('0x2f')]};});}}catch(_0x541726){_0x42aba8(_0x541726);}_0x597fa8(_0x40d0fc);});}function getInteractionTags(_0x23107b,_0x30c67d){return new BPromise(function(_0x3e2ce7,_0x56cae2){try{if(_0x23107b[_0xc1d6('0x30')]){_0x23107b['Tags']=[];_0x23107b[_0xc1d6('0x30')]['split'](',')[_0xc1d6('0x31')](function(_0x51f176){_0x23107b['Tags'][_0xc1d6('0x32')](_0x30c67d[_0x51f176]);});}delete _0x23107b[_0xc1d6('0x30')];}catch(_0x98bb70){_0x56cae2(_0x98bb70);}_0x3e2ce7(_0x23107b);});}function updateOpenchannelInteraction(_0x2be296,_0x4d9667,_0x1ed47e){return new BPromise(function(_0x18d8a0,_0x5457d9){return getInteractionUsers(_0x2be296,_0x1ed47e)[_0xc1d6('0x28')](function(_0xe54adb){return getInteractionTags(_0xe54adb,_0x4d9667);})[_0xc1d6('0x28')](function(_0x1a1b2b){_0x18d8a0(_0x1a1b2b);})[_0xc1d6('0x33')](function(_0x15d489){_0x5457d9(_0x15d489);});});}exports[_0xc1d6('0x34')]=function(_0x48f00f,_0x149453){var _0x31a52b={},_0x5d05d1={},_0x314a34={'count':0x0,'rows':[]};var _0x348fbe=_[_0xc1d6('0x2e')](db[_0xc1d6('0x35')][_0xc1d6('0x36')],function(_0x588747){return{'name':_0x588747[_0xc1d6('0x37')],'type':_0x588747[_0xc1d6('0x38')][_0xc1d6('0x39')]};});_0x5d05d1['model']=_[_0xc1d6('0x2e')](_0x348fbe,_0xc1d6('0x2b'));_0x5d05d1[_0xc1d6('0x3a')]=_[_0xc1d6('0x3b')](_0x48f00f[_0xc1d6('0x3a')]);_0x5d05d1[_0xc1d6('0x3c')]=_['intersection'](_0x5d05d1[_0xc1d6('0x3d')],_0x5d05d1[_0xc1d6('0x3a')]);_0x31a52b['attributes']=_[_0xc1d6('0x3e')](_0x5d05d1[_0xc1d6('0x3d')],qs[_0xc1d6('0x3f')](_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x3f')]));_0x31a52b[_0xc1d6('0x40')]=_0x31a52b[_0xc1d6('0x40')][_0xc1d6('0x41')]?_0x31a52b[_0xc1d6('0x40')]:_0x5d05d1[_0xc1d6('0x3d')];if(!_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x42')](_0xc1d6('0x43'))){_0x31a52b[_0xc1d6('0x21')]=qs[_0xc1d6('0x21')](_0x48f00f['query'][_0xc1d6('0x21')]);_0x31a52b['offset']=qs[_0xc1d6('0x1f')](_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x1f')]);}_0x31a52b[_0xc1d6('0x44')]=qs['sort'](_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x45')]);_0x31a52b[_0xc1d6('0x46')]=qs['filters'](_[_0xc1d6('0x47')](_0x48f00f[_0xc1d6('0x3a')],_0x5d05d1[_0xc1d6('0x3c')]),_0x348fbe);var _0x3081cd=[];var _0x58ef87=squel[_0xc1d6('0x48')]()['field']('id')[_0xc1d6('0x49')](_0xc1d6('0x2b'))[_0xc1d6('0x49')]('color')[_0xc1d6('0x4a')](_0xc1d6('0x4b'));var _0x1832fc=squel[_0xc1d6('0x48')]()[_0xc1d6('0x49')](_0xc1d6('0x4c'))[_0xc1d6('0x49')](_0xc1d6('0x4d'))[_0xc1d6('0x49')](_0xc1d6('0x4e'))['from']('user_has_openchannel_interactions','ui')[_0xc1d6('0x4f')](_0xc1d6('0x50'),'u',_0xc1d6('0x51'));var _0x44899f=squel[_0xc1d6('0x48')]()[_0xc1d6('0x4a')](_0xc1d6('0x52'),'i')[_0xc1d6('0x4f')]('cm_contacts','c',_0xc1d6('0x53'))[_0xc1d6('0x4f')]('users','o',_0xc1d6('0x54'))[_0xc1d6('0x4f')](_0xc1d6('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xc1d6('0x4f')]('openchannel_messages','me',_0xc1d6('0x56'))['left_join'](_0xc1d6('0x57'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0xc1d6('0x4f')](_0xc1d6('0x4b'),'t','t.id\x20=\x20it.TagId');var _0x3e592c=squel[_0xc1d6('0x58')]();var _0xb53334=[];var _0x414ec2=squel['expr']();var _0xfe3e36;if(_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x59')]){_0xfe3e36=as['parseSearch'](_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x59')]);var _0x4f9517=_0xfe3e36['sqlOperator'];for(var _0x33d43e=0x0;_0x33d43e<_0xfe3e36[_0xc1d6('0x5a')][_0xc1d6('0x41')];_0x33d43e++){var _0x2fb779=_0xfe3e36[_0xc1d6('0x5a')][_0x33d43e];var _0x316d1b='i';var _0x4c6bea=_[_0xc1d6('0x5b')](_0x348fbe,[_0xc1d6('0x2b'),_0x2fb779[_0xc1d6('0x49')]]);if(!_0x4c6bea){switch(_0x2fb779[_0xc1d6('0x49')]){case'unreadMessages':if(_0x2fb779[_0xc1d6('0x5c')]==0x1){_0x44899f['having']('`'+_0x2fb779[_0xc1d6('0x49')]+'`\x20=\x200');}else{_0x44899f[_0xc1d6('0x5d')]('`'+_0x2fb779[_0xc1d6('0x49')]+'`\x20>\x200');}break;case'Contact':if(_0x2fb779[_0xc1d6('0x5e')]===_0xc1d6('0x5f')){if(_0x2fb779[_0xc1d6('0x5c')][_0xc1d6('0x60')]('\x20')['length']>0x1){_0x3e592c[_0x4f9517](_0xc1d6('0x61'),qs[_0xc1d6('0x62')](_0x2fb779[_0xc1d6('0x5c')]),null);}else{var _0x2bcf87='%'+_0x2fb779[_0xc1d6('0x5c')]+'%';_0x3e592c[_0x4f9517](_0xc1d6('0x63'),_0x2bcf87,_0x2bcf87,_0x2bcf87);}}else{_0x4c6bea=_[_0xc1d6('0x5b')](_0x348fbe,[_0xc1d6('0x2b'),_0xc1d6('0x64')]);_0x2fb779['field']=_0xc1d6('0x64');_0x15beda=as[_0xc1d6('0x65')](_0x316d1b,_0x4c6bea[_0xc1d6('0x38')],_0x2fb779);_0x3e592c[_0x4f9517](_0x15beda[_0xc1d6('0x66')],_0x15beda['value']['start'],_0x15beda[_0xc1d6('0x5c')]['end']);}break;case _0xc1d6('0x67'):var _0x5585a1=_0x2fb779['value'][_0xc1d6('0x60')](',')[_0xc1d6('0x2e')](function(_0x56c9ea){return Number(_0x56c9ea);});_0x5585a1['forEach'](function(_0x10be3c){_0x414ec2['or'](_0xc1d6('0x68'),'%,'+_0x10be3c+',%');});_0xb53334=_[_0xc1d6('0x69')](_0xb53334,_0x5585a1);break;case _0xc1d6('0x6a'):if(_0x2fb779[_0xc1d6('0x5e')]==='$substring'){_0x3e592c[_0x4f9517](_0xc1d6('0x6b'),'%'+_0x2fb779[_0xc1d6('0x5c')]+'%',null);}else{_0x4c6bea=_['find'](_0x348fbe,[_0xc1d6('0x2b'),_0xc1d6('0x6c')]);_0x2fb779['field']=_0xc1d6('0x6c');_0x15beda=as[_0xc1d6('0x65')](_0x316d1b,_0x4c6bea[_0xc1d6('0x38')],_0x2fb779);_0x3e592c[_0x4f9517](_0x15beda[_0xc1d6('0x66')],_0x15beda['value'][_0xc1d6('0x6d')],_0x15beda[_0xc1d6('0x5c')]['end']);}break;case _0xc1d6('0x6e'):_0x15beda=as['buildExpression']('me',null,_0x2fb779);_0x3e592c[_0x4f9517](_0x15beda[_0xc1d6('0x66')],_0x15beda['value'][_0xc1d6('0x6d')],_0x15beda[_0xc1d6('0x5c')][_0xc1d6('0x1e')]);break;}}else{var _0x15beda=as[_0xc1d6('0x65')](_0x316d1b,_0x4c6bea[_0xc1d6('0x38')],_0x2fb779);_0x3e592c[_0x4f9517](_0x15beda[_0xc1d6('0x66')],_0x15beda['value'][_0xc1d6('0x6d')],_0x15beda[_0xc1d6('0x5c')][_0xc1d6('0x1e')]);}}}else{var _0xbeb11e=_(_0x48f00f[_0xc1d6('0x3a')])[_0xc1d6('0x3b')]()[_0xc1d6('0x2e')](function(_0x5029a7){return _[_0xc1d6('0x6f')](_0x348fbe,[_0xc1d6('0x2b'),_0x5029a7])?_0x5029a7:undefined;})[_0xc1d6('0x70')]()['value']();if(!_['isEmpty'](_0xbeb11e)){_0xbeb11e[_0xc1d6('0x31')](function(_0x349148){if(_0x349148===_0xc1d6('0x71')){_0x44899f[_0xc1d6('0x46')](_0xc1d6('0x72'),[]['concat'](_0x48f00f[_0xc1d6('0x3a')][_0x349148]));}else if(_0x349148==='createdAt'){var _0x31acf8=JSON[_0xc1d6('0x73')](_0x48f00f[_0xc1d6('0x3a')][_0x349148])['$gte'];var _0x4059c5=JSON['parse'](_0x48f00f[_0xc1d6('0x3a')][_0x349148])['$lte'];_0x44899f[_0xc1d6('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x31acf8,_0x4059c5);}else{if(_0x48f00f[_0xc1d6('0x3a')][_0x349148]==='null'){_0x44899f[_0xc1d6('0x46')]('i.'+_0x349148+'\x20IS\x20NULL');}else{_0x44899f['where']('i.'+_0x349148+_0xc1d6('0x74'),_0x48f00f[_0xc1d6('0x3a')][_0x349148]);}}});}if(_0x48f00f['query'][_0xc1d6('0x75')]){if(_0x48f00f[_0xc1d6('0x3a')]['read']==0x1){_0x44899f[_0xc1d6('0x5d')](_0xc1d6('0x76'));}else{_0x44899f[_0xc1d6('0x5d')](_0xc1d6('0x77'));}}if(_0x48f00f[_0xc1d6('0x3a')]['tag']){_0xb53334=_[_0xc1d6('0x78')](_0x48f00f['query']['tag'])?_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x79')]:new Array(_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x79')]);_0xb53334[_0xc1d6('0x31')](function(_0x4220d9){_0x414ec2['or'](_0xc1d6('0x68'),'%,'+_0x4220d9+',%');});}if(_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x7a')]){var _0x45e923=_0x48f00f['query']['filter']['replace']('\x5c','\x5c\x5c')[_0xc1d6('0x7b')](/'/g,'\x27\x27');if(qs[_0xc1d6('0x7c')](_0x45e923)){_0x3e592c['or']('i.id\x20LIKE\x20?',_0x45e923+'%');}else{_0x3e592c['or'](_0xc1d6('0x7d'),qs[_0xc1d6('0x62')](_0x45e923))['or'](_0xc1d6('0x7e'),_0x45e923+'%')['or'](_0xc1d6('0x7f'),_0x45e923+'%');}}}_0x44899f[_0xc1d6('0x46')](_0x3e592c);_0x44899f[_0xc1d6('0x80')](_0xc1d6('0x81'));var _0x3b4b27={'type':db['Sequelize'][_0xc1d6('0x82')]['SELECT'],'raw':!![]};var _0x5a7cf7=_0x44899f['clone']();_0x5a7cf7[_0xc1d6('0x49')]('i.id');_0x5a7cf7[_0xc1d6('0x49')](_0xc1d6('0x83'),_0xc1d6('0x84'));if(_0x31a52b[_0xc1d6('0x44')]){_0x31a52b[_0xc1d6('0x44')]['forEach'](function(_0x598026){var _0x7ef941=_0x598026[0x0]===_0xc1d6('0x85')?_0x598026[0x0]:'i.'+_0x598026[0x0];_0x44899f[_0xc1d6('0x44')](_0x7ef941,_0x598026[0x1]===_0xc1d6('0x86')?![]:!![]);});}if(!_['isEmpty'](_0xb53334)){_0x44899f['having'](_0x414ec2);_0x5a7cf7[_0xc1d6('0x46')](_0xc1d6('0x87'),_0xb53334);}BPromise['resolve']()[_0xc1d6('0x28')](function(){if(!_0xfe3e36){if(_0x48f00f['query']['OpenchannelAccountId'])return;_0x5a7cf7[_0xc1d6('0x46')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x44899f[_0xc1d6('0x46')](_0xc1d6('0x88'));return;}if(_0x48f00f[_0xc1d6('0x89')]['role']!==_0xc1d6('0x8a'))return;return _0x48f00f['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xc1d6('0x28')](function(_0x1b5c20){if(_['isEmpty'](_0x1b5c20)){_0x5a7cf7[_0xc1d6('0x46')](_0xc1d6('0x8b'));_0x44899f[_0xc1d6('0x46')](_0xc1d6('0x8b'));}else{_0x5a7cf7[_0xc1d6('0x46')](_0xc1d6('0x72'),_['map'](_0x1b5c20,'id'));_0x44899f['where'](_0xc1d6('0x72'),_[_0xc1d6('0x2e')](_0x1b5c20,'id'));}});})[_0xc1d6('0x28')](function(){if(_0x48f00f[_0xc1d6('0x89')]['role']===_0xc1d6('0x8a')&&!_0xfe3e36&&!_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x71')])return[];return db['sequelize'][_0xc1d6('0x3a')](_0x5a7cf7[_0xc1d6('0x8c')](),_0x3b4b27);})['then'](function(_0x4b2340){_0x314a34[_0xc1d6('0x22')]=_0x4b2340[_0xc1d6('0x41')];if(_0x314a34['count']===0x0)return[];return db[_0xc1d6('0x8d')][_0xc1d6('0x3a')](_0x58ef87['toString'](),_0x3b4b27)['then'](function(_0x5c44bf){_0x3081cd=_['keyBy'](_0x5c44bf,'id');_0x3b4b27=_[_0xc1d6('0x8e')](_0x3b4b27,{'model':db[_0xc1d6('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x48f00f[_0xc1d6('0x3a')][_0xc1d6('0x3f')]){_0x31a52b[_0xc1d6('0x40')][_0xc1d6('0x31')](function(_0x4b2c9c){_0x44899f['field']('i.'+_0x4b2c9c);});}else{_0x44899f[_0xc1d6('0x49')](_0xc1d6('0x83'),'unreadMessages');_0x44899f[_0xc1d6('0x49')](_0xc1d6('0x8f'),_0xc1d6('0x90'));_0x44899f[_0xc1d6('0x49')](_0xc1d6('0x91'),_0xc1d6('0x92'));_0x44899f[_0xc1d6('0x49')](_0xc1d6('0x93'),'contactName');_0x44899f['field'](_0xc1d6('0x94'));_0x44899f[_0xc1d6('0x49')](_0xc1d6('0x95'),'Contact.firstName');_0x44899f[_0xc1d6('0x49')](_0xc1d6('0x96'),_0xc1d6('0x97'));_0x44899f['field']('c.email',_0xc1d6('0x98'));_0x44899f[_0xc1d6('0x49')](_0xc1d6('0x99'),'Contact.phone');_0x44899f[_0xc1d6('0x49')]('c.mobile',_0xc1d6('0x9a'));_0x44899f['field']('c.fax',_0xc1d6('0x9b'));_0x44899f[_0xc1d6('0x49')](_0xc1d6('0x9c'),_0xc1d6('0x9d'));_0x44899f[_0xc1d6('0x49')](_0xc1d6('0x9e'),_0xc1d6('0x9f'));_0x44899f['field'](_0xc1d6('0xa0'),_0xc1d6('0x30'));}if(_0x31a52b[_0xc1d6('0x21')])_0x44899f[_0xc1d6('0x21')](_0x31a52b[_0xc1d6('0x21')]);if(_0x31a52b[_0xc1d6('0x1f')])_0x44899f[_0xc1d6('0x1f')](_0x31a52b[_0xc1d6('0x1f')]);return db['sequelize'][_0xc1d6('0x3a')](_0x44899f[_0xc1d6('0x8c')](),_0x3b4b27);})[_0xc1d6('0x28')](function(_0x485438){if(_0x485438[_0xc1d6('0x41')]>0x0)_0x1832fc['where'](_0xc1d6('0xa1'),_[_0xc1d6('0x2e')](_0x485438,'id'));return db[_0xc1d6('0x8d')]['query'](_0x1832fc[_0xc1d6('0x8c')](),_0x3b4b27)['then'](function(_0x1bde12){var _0x18be49=_[_0xc1d6('0xa2')](_0x1bde12,'OpenchannelInteractionId');var _0x210e0e=[];_0x485438[_0xc1d6('0x31')](function(_0x1e3a15){_0x210e0e[_0xc1d6('0x32')](updateOpenchannelInteraction(_0x1e3a15,_0x3081cd,_0x18be49));});return BPromise[_0xc1d6('0xa3')](_0x210e0e);});});})['then'](function(_0xd5531b){_0x314a34['rows']=_0xd5531b;return _0x314a34;})['then'](respondWithFilteredResult(_0x149453,_0x31a52b))[_0xc1d6('0x33')](handleError(_0x149453,null));};exports[_0xc1d6('0xa4')]=function(_0x226911,_0x81dbbd){var _0x376cfb={};if(_0x226911[_0xc1d6('0x3a')][_0xc1d6('0x38')]&&_0x226911[_0xc1d6('0x3a')][_0xc1d6('0x38')]===_0xc1d6('0x4a')){_0x376cfb[_0xc1d6('0x4a')]=_0x226911[_0xc1d6('0xa5')]['id'];}else{_0x376cfb['id']=_0x226911[_0xc1d6('0xa5')]['id'];}var _0x3a9af1={'raw':![],'where':_0x376cfb},_0x5c87cd={};_0x5c87cd[_0xc1d6('0x3d')]=_[_0xc1d6('0x3b')](db[_0xc1d6('0x35')][_0xc1d6('0x36')]);_0x5c87cd[_0xc1d6('0x3a')]=_[_0xc1d6('0x3b')](_0x226911[_0xc1d6('0x3a')]);_0x5c87cd['filters']=_[_0xc1d6('0x3e')](_0x5c87cd['model'],_0x5c87cd[_0xc1d6('0x3a')]);_0x3a9af1['attributes']=_['intersection'](_0x5c87cd['model'],qs[_0xc1d6('0x3f')](_0x226911[_0xc1d6('0x3a')][_0xc1d6('0x3f')]));_0x3a9af1[_0xc1d6('0x40')]=_0x3a9af1['attributes']['length']?_0x3a9af1[_0xc1d6('0x40')]:_0x5c87cd['model'];if(_0x226911[_0xc1d6('0x3a')][_0xc1d6('0xa6')]){_0x3a9af1[_0xc1d6('0xa7')]=[{'all':!![]}];}_0x3a9af1=_[_0xc1d6('0x8e')]({},_0x3a9af1,_0x226911[_0xc1d6('0xa8')]);return db[_0xc1d6('0x35')][_0xc1d6('0x5b')](_0x3a9af1)['then'](handleEntityNotFound(_0x81dbbd,null))[_0xc1d6('0x28')](respondWithResult(_0x81dbbd,null))[_0xc1d6('0x33')](handleError(_0x81dbbd,null));};exports['create']=function(_0x253519,_0x2f0866){return db[_0xc1d6('0x35')][_0xc1d6('0xa9')](_0x253519[_0xc1d6('0x6e')],{})[_0xc1d6('0x28')](respondWithResult(_0x2f0866,0xc9))[_0xc1d6('0x33')](handleError(_0x2f0866,null));};exports[_0xc1d6('0x26')]=function(_0x440556,_0x2988e8){if(_0x440556[_0xc1d6('0x6e')]['id']){delete _0x440556[_0xc1d6('0x6e')]['id'];}return db[_0xc1d6('0x35')][_0xc1d6('0x5b')]({'where':{'id':_0x440556[_0xc1d6('0xa5')]['id']}})[_0xc1d6('0x28')](handleEntityNotFound(_0x2988e8,null))[_0xc1d6('0x28')](saveUpdates(_0x440556[_0xc1d6('0x6e')],null))[_0xc1d6('0x28')](respondWithResult(_0x2988e8,null))[_0xc1d6('0x33')](handleError(_0x2988e8,null));};exports['destroy']=function(_0x52bdb9,_0xcd92f9){return db[_0xc1d6('0x35')]['find']({'where':{'id':_0x52bdb9[_0xc1d6('0xa5')]['id']}})[_0xc1d6('0x28')](handleEntityNotFound(_0xcd92f9,null))[_0xc1d6('0x28')](removeEntity(_0xcd92f9,null))[_0xc1d6('0x33')](handleError(_0xcd92f9,null));};exports['describe']=function(_0x3ab465,_0x33c675){return db['OpenchannelInteraction'][_0xc1d6('0xaa')]()['then'](respondWithResult(_0x33c675,null))[_0xc1d6('0x33')](handleError(_0x33c675,null));};exports[_0xc1d6('0xab')]=function(_0x184215,_0x49cc3c,_0x16b358){return db['OpenchannelMessage']['find']({'where':{'id':_0x184215['params']['id']}})[_0xc1d6('0x28')](handleEntityNotFound(_0x49cc3c,null))[_0xc1d6('0x28')](function(_0x51043a){if(_0x51043a){return _0x51043a[_0xc1d6('0xab')](_0x184215['body'][_0xc1d6('0xac')],_[_0xc1d6('0xad')](_0x184215[_0xc1d6('0x6e')],['ids','id'])||{});}})[_0xc1d6('0x28')](respondWithResult(_0x49cc3c,null))[_0xc1d6('0x33')](handleError(_0x49cc3c,null));};exports[_0xc1d6('0xae')]=function(_0x53a868,_0x4fc48a,_0x2c402d){var _0x3cee5a={'raw':![],'where':{}};var _0x2bb944={};var _0x27db7f={'count':0x0,'rows':[]};return db[_0xc1d6('0x35')][_0xc1d6('0xaf')]({'where':{'id':_0x53a868['params']['id']}})['then'](handleEntityNotFound(_0x4fc48a,null))[_0xc1d6('0x28')](function(_0x3f0a51){if(_0x3f0a51){_0x2bb944[_0xc1d6('0x3d')]=_['keys'](db[_0xc1d6('0xb0')][_0xc1d6('0x36')]);_0x2bb944[_0xc1d6('0x3a')]=_[_0xc1d6('0x3b')](_0x53a868[_0xc1d6('0x3a')]);_0x2bb944[_0xc1d6('0x3c')]=_[_0xc1d6('0x3e')](_0x2bb944['model'],_0x2bb944[_0xc1d6('0x3a')]);_0x3cee5a['attributes']=_['intersection'](_0x2bb944[_0xc1d6('0x3d')],qs[_0xc1d6('0x3f')](_0x53a868[_0xc1d6('0x3a')][_0xc1d6('0x3f')]));_0x3cee5a[_0xc1d6('0x40')]=_0x3cee5a[_0xc1d6('0x40')][_0xc1d6('0x41')]?_0x3cee5a[_0xc1d6('0x40')]:_0x2bb944[_0xc1d6('0x3d')];if(!_0x53a868[_0xc1d6('0x3a')][_0xc1d6('0x42')](_0xc1d6('0x43'))){_0x3cee5a[_0xc1d6('0x21')]=qs[_0xc1d6('0x21')](_0x53a868[_0xc1d6('0x3a')][_0xc1d6('0x21')]);_0x3cee5a[_0xc1d6('0x1f')]=qs['offset'](_0x53a868[_0xc1d6('0x3a')][_0xc1d6('0x1f')]);}_0x3cee5a[_0xc1d6('0x44')]=qs[_0xc1d6('0x45')](_0x53a868['query'][_0xc1d6('0x45')]);_0x3cee5a['where']=qs[_0xc1d6('0x3c')](_[_0xc1d6('0x47')](_0x53a868[_0xc1d6('0x3a')],_0x2bb944[_0xc1d6('0x3c')]));_0x3cee5a[_0xc1d6('0x46')]['OpenchannelInteractionId']=_0x3f0a51['id'];if(_0x53a868[_0xc1d6('0x3a')][_0xc1d6('0x7a')]){_0x3cee5a['where']=_[_0xc1d6('0x8e')](_0x3cee5a['where'],{'$or':_['map'](_0x3cee5a[_0xc1d6('0x40')],function(_0x1f90d8){var _0x147060={};_0x147060[_0x1f90d8]={'$like':'%'+_0x53a868[_0xc1d6('0x3a')][_0xc1d6('0x7a')]+'%'};return _0x147060;})});}if(_0x53a868['query']['$gte']){var _0x1a6355=_0x53a868[_0xc1d6('0x3a')][_0xc1d6('0xb1')][_0xc1d6('0x60')](',');var _0x1c6bb1={};_0x1c6bb1[_0x1a6355[0x0]]={'$gte':moment(_0x1a6355[0x1])[_0xc1d6('0xb2')](_0xc1d6('0xb3'))};_0x3cee5a[_0xc1d6('0x46')]=_[_0xc1d6('0x8e')](_0x3cee5a['where'],_0x1c6bb1);}_0x3cee5a=_[_0xc1d6('0x8e')]({},_0x3cee5a,_0x53a868['options']);return db['OpenchannelMessage']['count']({'where':_0x3cee5a[_0xc1d6('0x46')]})[_0xc1d6('0x28')](function(_0x1ca600){_0x27db7f['count']=_0x1ca600;if(_0x53a868[_0xc1d6('0x3a')][_0xc1d6('0xa6')]){_0x3cee5a[_0xc1d6('0xa7')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xc1d6('0xb4')](_0x3cee5a);})[_0xc1d6('0x28')](function(_0x377471){_0x27db7f[_0xc1d6('0xb5')]=_0x377471;return _0x27db7f;});}})['then'](respondWithFilteredResult(_0x4fc48a,_0x3cee5a))[_0xc1d6('0x33')](handleError(_0x4fc48a,null));};exports[_0xc1d6('0xb6')]=function(_0x40d2f3,_0x511ed2,_0x2ae8ce){return db[_0xc1d6('0x35')][_0xc1d6('0x5b')]({'where':{'id':_0x40d2f3[_0xc1d6('0xa5')]['id']}})[_0xc1d6('0x28')](handleEntityNotFound(_0x511ed2,null))[_0xc1d6('0x28')](function(_0x42d15f){if(_0x42d15f){return _0x42d15f[_0xc1d6('0xb7')](_0x40d2f3[_0xc1d6('0x6e')][_0xc1d6('0xac')],_[_0xc1d6('0xad')](_0x40d2f3['body'],[_0xc1d6('0xac'),'id'])||{})[_0xc1d6('0xb8')](function(){return db[_0xc1d6('0x67')][_0xc1d6('0xb4')]({'attributes':['id',_0xc1d6('0x2b'),_0xc1d6('0xb9')],'where':{'id':_0x40d2f3[_0xc1d6('0x6e')][_0xc1d6('0xac')]}});})[_0xc1d6('0x28')](function(_0x4df283){socket[_0xc1d6('0xba')]('openchannelInteractionTags:save',{'id':Number(_0x40d2f3['params']['id']),'tags':_0x4df283||[]});return{'id':Number(_0x40d2f3[_0xc1d6('0xa5')]['id']),'tags':_0x4df283||[]};});}})[_0xc1d6('0x28')](respondWithResult(_0x511ed2,null))[_0xc1d6('0x33')](handleError(_0x511ed2,null));};exports[_0xc1d6('0xbb')]=function(_0x785b43,_0x4505cb,_0x3ee0f6){return db[_0xc1d6('0x35')][_0xc1d6('0x5b')]({'where':{'id':_0x785b43[_0xc1d6('0xa5')]['id']}})[_0xc1d6('0x28')](handleEntityNotFound(_0x4505cb,null))[_0xc1d6('0x28')](function(_0x29ae3d){if(_0x29ae3d){return _0x29ae3d['removeTags'](_0x785b43[_0xc1d6('0x3a')][_0xc1d6('0xac')]);}})['then'](respondWithStatusCode(_0x4505cb,null))['catch'](handleError(_0x4505cb,null));};exports['download']=function(_0x2dc92d,_0x11e3b7){var _0x5b979b=moment()[_0xc1d6('0xbc')]()[_0xc1d6('0x8c')]();var _0x270e50=path[_0xc1d6('0xbd')](config[_0xc1d6('0xbe')],_0xc1d6('0xbf'),'files',_0xc1d6('0xc0'));var _0x18e3a0=path[_0xc1d6('0xbd')](config[_0xc1d6('0xbe')],_0xc1d6('0xbf'),_0xc1d6('0xc1'),'attachments');var _0x3e75c4=path[_0xc1d6('0xbd')](_0x270e50,_0x5b979b);var _0x2c0abd=util[_0xc1d6('0xb2')](_0xc1d6('0xc2'),_0x2dc92d['params']['id'],_0x5b979b);var _0x4c35b6=path[_0xc1d6('0xbd')](_0x270e50,_0x2c0abd);var _0xbf9b94=[];_0xbf9b94[_0xc1d6('0x32')]({'model':db[_0xc1d6('0x6a')],'as':_0xc1d6('0x6a'),'attributes':['id',_0xc1d6('0x2f')],'raw':!![]});_0xbf9b94['push']({'model':db[_0xc1d6('0xc3')],'as':'Contact','attributes':['id',_0xc1d6('0xc4'),_0xc1d6('0xc5')],'raw':!![]});if(_0x2dc92d[_0xc1d6('0x3a')][_0xc1d6('0xc6')]){_0xbf9b94[_0xc1d6('0x32')]({'model':db[_0xc1d6('0xc7')],'as':_0xc1d6('0xc7'),'raw':!![]});}var _0x5aed76=[{'model':db[_0xc1d6('0xb0')],'as':'Messages','attributes':['id',_0xc1d6('0x6e'),_0xc1d6('0xc8'),'direction',_0xc1d6('0xc9'),_0xc1d6('0x75')],'include':_0xbf9b94}];_0x5aed76[_0xc1d6('0x32')]({'model':db['OpenchannelAccount'],'as':_0xc1d6('0xca'),'attributes':['id','name']});_0x5aed76[_0xc1d6('0x32')]({'model':db['User'],'as':_0xc1d6('0xcb'),'attributes':['id',_0xc1d6('0x2f')]});return db[_0xc1d6('0x35')][_0xc1d6('0x5b')]({'where':{'id':_0x2dc92d[_0xc1d6('0xa5')]['id']},'include':_0x5aed76})[_0xc1d6('0x28')](handleEntityNotFound(_0x11e3b7,null))[_0xc1d6('0x28')](function(_0x588ecf){if(_0x588ecf){var _0x505ac9=_0x588ecf[_0xc1d6('0xcc')]({'plain':!![]});fs[_0xc1d6('0xcd')](_0x3e75c4);var _0x486111={'channel':'Openchannel','account':_0x505ac9[_0xc1d6('0xca')]['name'],'agent':_0x505ac9[_0xc1d6('0xcb')]?_0x505ac9[_0xc1d6('0xcb')]['fullname']:_0xc1d6('0xce'),'createdAt':moment(_0x505ac9[_0xc1d6('0xc8')])['format'](_0xc1d6('0xb3'))[_0xc1d6('0x8c')](),'closedAt':_0x505ac9[_0xc1d6('0xcf')]?moment(_0x505ac9[_0xc1d6('0xd0')])[_0xc1d6('0xb2')](_0xc1d6('0xb3'))[_0xc1d6('0x8c')]():'','disposition':_0x505ac9['disposition'],'visibility':_0x505ac9[_0xc1d6('0xd1')]?'Public':'Private','messages':_(_0x505ac9['Messages'])[_0xc1d6('0x7a')]({'secret':![]})[_0xc1d6('0x2e')](function(_0x3de435){if(_0x3de435[_0xc1d6('0xc7')]){var _0x123532=path[_0xc1d6('0xbd')](_0x18e3a0,_0x3de435['Attachment'][_0xc1d6('0xd2')]);if(fs[_0xc1d6('0xd3')](_0x123532)){fs[_0xc1d6('0xd4')](_0x123532)[_0xc1d6('0xd5')](fs['createWriteStream'](path[_0xc1d6('0xbd')](_0x3e75c4,_0x3de435[_0xc1d6('0xc7')][_0xc1d6('0xd2')])));}}return{'date':moment(_0x3de435[_0xc1d6('0xc8')])[_0xc1d6('0xb2')](_0xc1d6('0xb3'))[_0xc1d6('0x8c')](),'sender':_0x3de435[_0xc1d6('0xd6')]===_0xc1d6('0xd7')?_0x3de435['User']?_0x3de435[_0xc1d6('0x6a')][_0xc1d6('0x2f')]:_0xc1d6('0xd8'):_0x3de435[_0xc1d6('0xd9')]['firstName']+(_0x3de435[_0xc1d6('0xd9')]['lastName']?'\x20'+_0x3de435[_0xc1d6('0xd9')]['lastName']:''),'body':_0x3de435[_0xc1d6('0xc7')]?_0x3de435[_0xc1d6('0xc7')][_0xc1d6('0xd2')]:_0x3de435[_0xc1d6('0x6e')],'direction':_0x3de435[_0xc1d6('0xd6')]===_0xc1d6('0xd7')?'A':'C','secret':_0x3de435[_0xc1d6('0xc9')],'read':_0x3de435[_0xc1d6('0x75')],'attachment':_0x3de435[_0xc1d6('0xc7')]};})[_0xc1d6('0x5c')]()};return ejs[_0xc1d6('0xda')](path[_0xc1d6('0xbd')](config[_0xc1d6('0xbe')],_0xc1d6('0xbf'),_0xc1d6('0xdb'),_0xc1d6('0xdc')),{'interaction':_0x486111})[_0xc1d6('0x28')](function(_0x2ca089){var _0x578bb9=path[_0xc1d6('0xbd')](_0x3e75c4,'transcript-'+_0x505ac9['id']+'-'+_0x5b979b+'.pdf');var _0x2aa90a={'path':_0x578bb9,'channel':'Openchannel','interactionId':_0x505ac9['id']};return pdf[_0xc1d6('0xdd')](_0x2ca089,_0x2aa90a);})['then'](function(){return new BPromise(function(_0x4ee075,_0x35b6cb){zipdir(_0x3e75c4,{'saveTo':_0x4c35b6},function(_0x2d9000,_0x178494){if(_0x2d9000)return _0x35b6cb(_0x2d9000);return _0x4ee075(_0x178494);});})[_0xc1d6('0x28')](function(){return new BPromise(function(_0x2b7663,_0x3de54f){rimraf(_0x3e75c4,function(_0x56947b){if(_0x56947b)_0x3de54f(_0x56947b);return _0x2b7663();});});})[_0xc1d6('0x28')](function(){return _0x11e3b7['download'](_0x4c35b6,_0x2c0abd,function(_0x45551f){if(_0x45551f){console[_0xc1d6('0xde')](_0xc1d6('0xdf'),_0x45551f);}else{fs[_0xc1d6('0xe0')](_0x4c35b6);}});});});}else{return _0x11e3b7[_0xc1d6('0x1c')](0xc8);}})[_0xc1d6('0x33')](handleError(_0x11e3b7,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 1d40ecd..708c027 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 _0xc75f=['remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0xc75f,0x1cc));var _0xfc75=function(_0x530ea4,_0x4133ee){_0x530ea4=_0x530ea4-0x0;var _0x5c4664=_0xc75f[_0x530ea4];return _0x5c4664;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xfc75('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xfc75('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xfc75('0x1')](0x0);var events={'afterCreate':_0xfc75('0x2'),'afterUpdate':_0xfc75('0x3'),'afterDestroy':_0xfc75('0x4')};function emitEvent(_0x3b92a6){return function(_0xdd3414,_0x16cfd1,_0x2554ee){_0xdd3414[_0xfc75('0x5')]({'attributes':['id'],'raw':!![]})[_0xfc75('0x6')](function(_0xa13997){_0xdd3414[_0xfc75('0x7')](_0xfc75('0x8'),_0xa13997[_0xfc75('0x9')](function(_0x186b5d){return{'id':_0x186b5d['id']};}));return OpenchannelMessage[_0xfc75('0xa')]({'where':{'OpenchannelInteractionId':_0xdd3414['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfc75('0x6')](function(_0x11de6c){_0xdd3414[_0xfc75('0x7')](_0xfc75('0xb'),_0x11de6c[_0xfc75('0xc')]);OpenchannelInteractionEvents[_0xfc75('0xd')](_0x3b92a6+':'+_0xdd3414['id'],_0xdd3414);OpenchannelInteractionEvents[_0xfc75('0xd')](_0x3b92a6,_0xdd3414);_0x2554ee(null);})[_0xfc75('0xe')](_0x2554ee(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xfc75('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xbf93=['getUsers','Users','findAll','then','setDataValue','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xbf93,0x14d));var _0x3bf9=function(_0x2f4096,_0x285079){_0x2f4096=_0x2f4096-0x0;var _0x598fa2=_0xbf93[_0x2f4096];return _0x598fa2;};'use strict';var EventEmitter=require(_0x3bf9('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x3bf9('0x1'))['db'][_0x3bf9('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3bf9('0x3')](0x0);var events={'afterCreate':_0x3bf9('0x4'),'afterUpdate':_0x3bf9('0x5'),'afterDestroy':_0x3bf9('0x6')};function emitEvent(_0x407832){return function(_0x28ade7,_0x53a72c,_0x1d0159){_0x28ade7[_0x3bf9('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1a0ac0){_0x28ade7['setDataValue'](_0x3bf9('0x8'),_0x1a0ac0['map'](function(_0xa828b){return{'id':_0xa828b['id']};}));return OpenchannelMessage[_0x3bf9('0x9')]({'where':{'OpenchannelInteractionId':_0x28ade7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3bf9('0xa')](function(_0xc7dec6){_0x28ade7[_0x3bf9('0xb')]('unreadMessages',_0xc7dec6[_0x3bf9('0xc')]);OpenchannelInteractionEvents[_0x3bf9('0xd')](_0x407832+':'+_0x28ade7['id'],_0x28ade7);OpenchannelInteractionEvents['emit'](_0x407832,_0x28ade7);_0x1d0159(null);})[_0x3bf9('0xe')](_0x1d0159(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x3bf9('0xf')](e,emitEvent(event));}}module[_0x3bf9('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 9787ab5..ff6c78c 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 _0x8620=['./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x8620,0xc0));var _0x0862=function(_0x372a32,_0x20093b){_0x372a32=_0x372a32-0x0;var _0x3d7923=_0x8620[_0x372a32];return _0x3d7923;};'use strict';var _=require('lodash');var util=require(_0x0862('0x0'));var logger=require(_0x0862('0x1'))(_0x0862('0x2'));var moment=require('moment');var BPromise=require(_0x0862('0x3'));var rp=require(_0x0862('0x4'));var fs=require('fs');var path=require(_0x0862('0x5'));var rimraf=require(_0x0862('0x6'));var config=require(_0x0862('0x7'));var attributes=require(_0x0862('0x8'));module[_0x0862('0x9')]=function(_0x24dab8,_0x5017eb){return _0x24dab8[_0x0862('0xa')](_0x0862('0xb'),attributes,{'tableName':_0x0862('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0862('0xd'),'collate':_0x0862('0xe'),'hooks':{'beforeUpdate':function(_0x1d7440,_0x5e3a80,_0x33ee75){if(_0x1d7440[_0x0862('0xf')](_0x0862('0x10'))){_0x1d7440[_0x0862('0x11')]=moment()[_0x0862('0x12')](_0x0862('0x13'));}_0x33ee75(null,_0x1d7440);}}});}; \ No newline at end of file +var _0x34e9=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x380aa0,_0x421a5f){var _0x4fd55d=function(_0xfcde39){while(--_0xfcde39){_0x380aa0['push'](_0x380aa0['shift']());}};_0x4fd55d(++_0x421a5f);}(_0x34e9,0x167));var _0x934e=function(_0x50d0c9,_0x1731fb){_0x50d0c9=_0x50d0c9-0x0;var _0x4955cb=_0x34e9[_0x50d0c9];return _0x4955cb;};'use strict';var _=require(_0x934e('0x0'));var util=require(_0x934e('0x1'));var logger=require(_0x934e('0x2'))(_0x934e('0x3'));var moment=require('moment');var BPromise=require(_0x934e('0x4'));var rp=require(_0x934e('0x5'));var fs=require('fs');var path=require(_0x934e('0x6'));var rimraf=require(_0x934e('0x7'));var config=require(_0x934e('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0x934e('0x9')]=function(_0xe5acbe,_0x2abddc){return _0xe5acbe['define'](_0x934e('0xa'),attributes,{'tableName':_0x934e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x934e('0xc'),'collate':_0x934e('0xd'),'hooks':{'beforeUpdate':function(_0x500d44,_0x548c0d,_0x2e1643){if(_0x500d44[_0x934e('0xe')](_0x934e('0xf'))){_0x500d44[_0x934e('0x10')]=moment()[_0x934e('0x11')](_0x934e('0x12'));}_0x2e1643(null,_0x500d44);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 05315b9..267e489 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 _0x6e96=['./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','update','body','options','raw','where','limit','debug','catch','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x48ec8a,_0x302b2f){var _0x4f2bd1=function(_0x257e07){while(--_0x257e07){_0x48ec8a['push'](_0x48ec8a['shift']());}};_0x4f2bd1(++_0x302b2f);}(_0x6e96,0x72));var _0x66e9=function(_0x5bdba4,_0x48b93c){_0x5bdba4=_0x5bdba4-0x0;var _0x11d0bd=_0x6e96[_0x5bdba4];return _0x11d0bd;};'use strict';var _=require(_0x66e9('0x0'));var util=require(_0x66e9('0x1'));var moment=require('moment');var BPromise=require(_0x66e9('0x2'));var rs=require(_0x66e9('0x3'));var fs=require('fs');var Redis=require(_0x66e9('0x4'));var db=require(_0x66e9('0x5'))['db'];var utils=require(_0x66e9('0x6'));var logger=require('../../config/logger')(_0x66e9('0x7'));var config=require(_0x66e9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x66e9('0x9')][_0x66e9('0xa')]({'port':0x232a});config[_0x66e9('0xb')]=_[_0x66e9('0xc')](config['redis'],{'host':_0x66e9('0xd'),'port':0x18eb});var socket=require(_0x66e9('0xe'))(new Redis(config[_0x66e9('0xb')]));require(_0x66e9('0xf'))[_0x66e9('0x10')](socket);function respondWithRpcPromise(_0x118f46,_0xbb6e1a,_0x94bded){return new BPromise(function(_0x57d878,_0x4f5194){return client['request'](_0x118f46,_0x94bded)[_0x66e9('0x11')](function(_0x16a31f){logger[_0x66e9('0x12')](_0x66e9('0x13'),_0xbb6e1a,_0x66e9('0x14'));logger['debug'](_0x66e9('0x15'),_0xbb6e1a,_0x66e9('0x14'),JSON[_0x66e9('0x16')](_0x16a31f));if(_0x16a31f[_0x66e9('0x17')]){if(_0x16a31f[_0x66e9('0x17')][_0x66e9('0x18')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0xbb6e1a,_0x16a31f[_0x66e9('0x17')][_0x66e9('0x19')]);return _0x4f5194(_0x16a31f['error'][_0x66e9('0x19')]);}logger['error'](_0x66e9('0x13'),_0xbb6e1a,_0x16a31f[_0x66e9('0x17')][_0x66e9('0x19')]);return _0x57d878(_0x16a31f['error'][_0x66e9('0x19')]);}else{logger[_0x66e9('0x12')](_0x66e9('0x13'),_0xbb6e1a,_0x66e9('0x14'));_0x57d878(_0x16a31f[_0x66e9('0x1a')][_0x66e9('0x19')]);}})['catch'](function(_0xb96df1){logger[_0x66e9('0x17')](_0x66e9('0x13'),_0xbb6e1a,_0xb96df1);_0x4f5194(_0xb96df1);});});}exports[_0x66e9('0x1b')]=function(_0x455dc){var _0x2cdd96=this;return new Promise(function(_0x131914,_0x31b31f){return db['OpenchannelInteraction'][_0x66e9('0x1c')](_0x455dc[_0x66e9('0x1d')],{'raw':_0x455dc[_0x66e9('0x1e')]?_0x455dc['options'][_0x66e9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x455dc[_0x66e9('0x1e')]?_0x455dc[_0x66e9('0x1e')][_0x66e9('0x20')]||null:null,'attributes':_0x455dc[_0x66e9('0x1e')]?_0x455dc[_0x66e9('0x1e')]['attributes']||null:null,'limit':_0x455dc['options']?_0x455dc[_0x66e9('0x1e')][_0x66e9('0x21')]||null:null})['then'](function(_0x3dadfa){logger[_0x66e9('0x12')]('UpdateOpenchannelInteraction',_0x455dc);logger[_0x66e9('0x22')](_0x66e9('0x1b'),_0x455dc,JSON[_0x66e9('0x16')](_0x3dadfa));_0x131914(_0x3dadfa);})[_0x66e9('0x23')](function(_0x36e1e7){logger[_0x66e9('0x17')](_0x66e9('0x1b'),_0x36e1e7[_0x66e9('0x19')],_0x455dc);_0x31b31f(_0x2cdd96[_0x66e9('0x17')](0x1f4,_0x36e1e7[_0x66e9('0x19')]));});});};exports[_0x66e9('0x24')]=function(_0x26ed3e){return new Promise(function(_0x3a331,_0x3bcc46){return db[_0x66e9('0x25')][_0x66e9('0x26')]({'where':_0x26ed3e['options']?_0x26ed3e['options'][_0x66e9('0x20')]||null:null})[_0x66e9('0x11')](function(_0x21df02){if(_0x21df02){return _0x21df02['addTags'](_0x26ed3e[_0x66e9('0x1d')][_0x66e9('0x27')],_[_0x66e9('0x28')](_0x26ed3e[_0x66e9('0x1d')],[_0x66e9('0x27'),'id'])||{});}})[_0x66e9('0x29')](function(_0x579405){logger[_0x66e9('0x12')](_0x66e9('0x2a'),_0x26ed3e);logger['debug'](_0x66e9('0x2a'),_0x26ed3e,JSON[_0x66e9('0x16')](_0x579405));_0x3a331(_0x579405);})[_0x66e9('0x23')](function(_0x176f45){logger[_0x66e9('0x17')]('AddTags',_0x176f45[_0x66e9('0x19')],_0x26ed3e);_0x3bcc46(_this[_0x66e9('0x17')](0x1f4,_0x176f45['message']));});});}; \ No newline at end of file +var _0x0c77=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment'];(function(_0x45a50b,_0x111e99){var _0x4fb5af=function(_0x1a5aa5){while(--_0x1a5aa5){_0x45a50b['push'](_0x45a50b['shift']());}};_0x4fb5af(++_0x111e99);}(_0x0c77,0xd4));var _0x70c7=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x0c77[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x70c7('0x0'));var util=require(_0x70c7('0x1'));var moment=require(_0x70c7('0x2'));var BPromise=require(_0x70c7('0x3'));var rs=require(_0x70c7('0x4'));var fs=require('fs');var Redis=require(_0x70c7('0x5'));var db=require(_0x70c7('0x6'))['db'];var utils=require(_0x70c7('0x7'));var logger=require(_0x70c7('0x8'))(_0x70c7('0x9'));var config=require(_0x70c7('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x70c7('0xb')]=_['defaults'](config[_0x70c7('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x70c7('0xc'))(new Redis(config[_0x70c7('0xb')]));require(_0x70c7('0xd'))[_0x70c7('0xe')](socket);function respondWithRpcPromise(_0x38cffa,_0x5c74f4,_0x20b07c){return new BPromise(function(_0x5f31c6,_0x391173){return client[_0x70c7('0xf')](_0x38cffa,_0x20b07c)[_0x70c7('0x10')](function(_0x3dfe4b){logger[_0x70c7('0x11')](_0x70c7('0x12'),_0x5c74f4,_0x70c7('0x13'));logger[_0x70c7('0x14')](_0x70c7('0x15'),_0x5c74f4,_0x70c7('0x13'),JSON[_0x70c7('0x16')](_0x3dfe4b));if(_0x3dfe4b[_0x70c7('0x17')]){if(_0x3dfe4b[_0x70c7('0x17')][_0x70c7('0x18')]===0x1f4){logger[_0x70c7('0x17')](_0x70c7('0x12'),_0x5c74f4,_0x3dfe4b['error'][_0x70c7('0x19')]);return _0x391173(_0x3dfe4b[_0x70c7('0x17')]['message']);}logger[_0x70c7('0x17')](_0x70c7('0x12'),_0x5c74f4,_0x3dfe4b['error'][_0x70c7('0x19')]);return _0x5f31c6(_0x3dfe4b[_0x70c7('0x17')][_0x70c7('0x19')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x5c74f4,_0x70c7('0x13'));_0x5f31c6(_0x3dfe4b[_0x70c7('0x1a')][_0x70c7('0x19')]);}})[_0x70c7('0x1b')](function(_0x45997a){logger[_0x70c7('0x17')](_0x70c7('0x12'),_0x5c74f4,_0x45997a);_0x391173(_0x45997a);});});}exports[_0x70c7('0x1c')]=function(_0x569623){var _0x2f34cb=this;return new Promise(function(_0x46cfe0,_0x538aa8){return db['OpenchannelInteraction'][_0x70c7('0x1d')](_0x569623[_0x70c7('0x1e')],{'raw':_0x569623[_0x70c7('0x1f')]?_0x569623[_0x70c7('0x1f')][_0x70c7('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x569623[_0x70c7('0x1f')]?_0x569623[_0x70c7('0x1f')][_0x70c7('0x21')]||null:null,'attributes':_0x569623['options']?_0x569623[_0x70c7('0x1f')][_0x70c7('0x22')]||null:null,'limit':_0x569623[_0x70c7('0x1f')]?_0x569623[_0x70c7('0x1f')]['limit']||null:null})[_0x70c7('0x10')](function(_0x3a5bbd){logger[_0x70c7('0x11')](_0x70c7('0x1c'),_0x569623);logger['debug'](_0x70c7('0x1c'),_0x569623,JSON['stringify'](_0x3a5bbd));_0x46cfe0(_0x3a5bbd);})['catch'](function(_0x5e704f){logger[_0x70c7('0x17')]('UpdateOpenchannelInteraction',_0x5e704f[_0x70c7('0x19')],_0x569623);_0x538aa8(_0x2f34cb['error'](0x1f4,_0x5e704f['message']));});});};exports[_0x70c7('0x23')]=function(_0x1b85a5){return new Promise(function(_0x57db5b,_0xb8d8c6){return db[_0x70c7('0x24')][_0x70c7('0x25')]({'where':_0x1b85a5['options']?_0x1b85a5[_0x70c7('0x1f')][_0x70c7('0x21')]||null:null})[_0x70c7('0x10')](function(_0x3238f5){if(_0x3238f5){return _0x3238f5[_0x70c7('0x26')](_0x1b85a5[_0x70c7('0x1e')]['ids'],_[_0x70c7('0x27')](_0x1b85a5['body'],[_0x70c7('0x28'),'id'])||{});}})[_0x70c7('0x29')](function(_0x4493bf){logger['info'](_0x70c7('0x2a'),_0x1b85a5);logger[_0x70c7('0x14')](_0x70c7('0x2a'),_0x1b85a5,JSON[_0x70c7('0x16')](_0x4493bf));_0x57db5b(_0x4493bf);})[_0x70c7('0x1b')](function(_0x214a6b){logger[_0x70c7('0x17')](_0x70c7('0x2a'),_0x214a6b[_0x70c7('0x19')],_0x1b85a5);_0xb8d8c6(_this[_0x70c7('0x17')](0x1f4,_0x214a6b[_0x70c7('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 9de8ca8..7a0ec7f 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 _0xa15d=['length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x18b8b6,_0x555e6a){var _0x2a9124=function(_0x3a42eb){while(--_0x3a42eb){_0x18b8b6['push'](_0x18b8b6['shift']());}};_0x2a9124(++_0x555e6a);}(_0xa15d,0x110));var _0xda15=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0xa15d[_0x1f5a63];return _0x30bb7a;};'use strict';var OpenchannelInteractionEvents=require(_0xda15('0x0'));var events=[_0xda15('0x1'),_0xda15('0x2'),_0xda15('0x3')];function createListener(_0x3efdf4,_0x523ccf){return function(_0x4f8212){_0x523ccf[_0xda15('0x4')](_0x3efdf4,_0x4f8212);};}function removeListener(_0x240d90,_0x30382e){return function(){OpenchannelInteractionEvents[_0xda15('0x5')](_0x240d90,_0x30382e);};}exports[_0xda15('0x6')]=function(_0x47f90f){for(var _0x247bf9=0x0,_0x438c72=events[_0xda15('0x7')];_0x247bf9<_0x438c72;_0x247bf9++){var _0x164e13=events[_0x247bf9];var _0x5533b4=createListener(_0xda15('0x8')+_0x164e13,_0x47f90f);OpenchannelInteractionEvents['on'](_0x164e13,_0x5533b4);}}; \ No newline at end of file +var _0xbe7a=['remove','update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x1b2658,_0x1d392){var _0x1c039a=function(_0x53f2e8){while(--_0x53f2e8){_0x1b2658['push'](_0x1b2658['shift']());}};_0x1c039a(++_0x1d392);}(_0xbe7a,0x19c));var _0xabe7=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbe7a[_0x4a9fb1];return _0x348672;};'use strict';var OpenchannelInteractionEvents=require(_0xabe7('0x0'));var events=[_0xabe7('0x1'),_0xabe7('0x2'),_0xabe7('0x3')];function createListener(_0x3b5103,_0x34472d){return function(_0x5698aa){_0x34472d[_0xabe7('0x4')](_0x3b5103,_0x5698aa);};}function removeListener(_0x35983f,_0x1df20e){return function(){OpenchannelInteractionEvents[_0xabe7('0x5')](_0x35983f,_0x1df20e);};}exports[_0xabe7('0x6')]=function(_0x235c62){for(var _0x1ae6ec=0x0,_0x28ddb6=events[_0xabe7('0x7')];_0x1ae6ec<_0x28ddb6;_0x1ae6ec++){var _0x140c31=events[_0x1ae6ec];var _0xd92c91=createListener(_0xabe7('0x8')+_0x140c31,_0x235c62);OpenchannelInteractionEvents['on'](_0x140c31,_0xd92c91);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f973715..e9a39c7 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 _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +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(_0x4b7288,_0x795ae6){var _0x3ce313=function(_0x3d6fd3){while(--_0x3d6fd3){_0x4b7288['push'](_0x4b7288['shift']());}};_0x3ce313(++_0x795ae6);}(_0xe706,0xa3));var _0x6e70=function(_0x1ba19c,_0x3975e2){_0x1ba19c=_0x1ba19c-0x0;var _0x4e069b=_0xe706[_0x1ba19c];return _0x4e069b;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 70e5502..3385120 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 _0x7033=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x7033,0x19e));var _0x3703=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7033[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x3703('0x0'));module[_0x3703('0x1')]={'body':{'type':Sequelize[_0x3703('0x2')](_0x3703('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3703('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3703('0x5')]('in',_0x3703('0x6')),'defaultValue':_0x3703('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3703('0x7')]},'providerName':{'type':Sequelize[_0x3703('0x8')]},'providerResponse':{'type':Sequelize[_0x3703('0x2')]}}; \ No newline at end of file +var _0x173d=['exports','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0xb9b594,_0x30617b){var _0x3609ba=function(_0x289b4a){while(--_0x289b4a){_0xb9b594['push'](_0xb9b594['shift']());}};_0x3609ba(++_0x30617b);}(_0x173d,0x108));var _0xd173=function(_0x347a2c,_0x3cda34){_0x347a2c=_0x347a2c-0x0;var _0x1e4647=_0x173d[_0x347a2c];return _0x1e4647;};'use strict';var Sequelize=require('sequelize');module[_0xd173('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd173('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd173('0x2')]('in',_0xd173('0x3')),'defaultValue':_0xd173('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd173('0x4')]},'providerName':{'type':Sequelize[_0xd173('0x5')]},'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 404dc28..55dc578 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 _0xdc1a=['accept','read','readAt','format','UserId','user','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','User','agent','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','SELECT','fullname','rejectmessage','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','http','client','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','OpenchannelMessage','includeAll','include','findAll','show','params','find','body','describe','openchannel-interactions'];(function(_0x4bf520,_0x1d2e51){var _0x5bee55=function(_0x2149a4){while(--_0x2149a4){_0x4bf520['push'](_0x4bf520['shift']());}};_0x5bee55(++_0x1d2e51);}(_0xdc1a,0x12f));var _0xadc1=function(_0x213b00,_0x492a82){_0x213b00=_0x213b00-0x0;var _0x348dcc=_0xdc1a[_0x213b00];return _0x348dcc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xadc1('0x0'));var jsonpatch=require(_0xadc1('0x1'));var rp=require('request-promise');var moment=require(_0xadc1('0x2'));var BPromise=require(_0xadc1('0x3'));var Mustache=require(_0xadc1('0x4'));var util=require('util');var path=require(_0xadc1('0x5'));var sox=require(_0xadc1('0x6'));var csv=require(_0xadc1('0x7'));var ejs=require(_0xadc1('0x8'));var fs=require('fs');var fs_extra=require(_0xadc1('0x9'));var _=require(_0xadc1('0xa'));var squel=require(_0xadc1('0xb'));var crypto=require(_0xadc1('0xc'));var jsforce=require(_0xadc1('0xd'));var deskjs=require(_0xadc1('0xe'));var toCsv=require(_0xadc1('0x7'));var querystring=require(_0xadc1('0xf'));var Papa=require(_0xadc1('0x10'));var Redis=require(_0xadc1('0x11'));var authService=require(_0xadc1('0x12'));var qs=require(_0xadc1('0x13'));var as=require(_0xadc1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadc1('0x15'))(_0xadc1('0x16'));var utils=require('../../config/utils');var config=require(_0xadc1('0x17'));var licenseUtil=require(_0xadc1('0x18'));var db=require(_0xadc1('0x19'))['db'];config['redis']=_[_0xadc1('0x1a')](config[_0xadc1('0x1b')],{'host':_0xadc1('0x1c'),'port':0x18eb});var socket=require(_0xadc1('0x1d'))(new Redis(config[_0xadc1('0x1b')]));require(_0xadc1('0x1e'))[_0xadc1('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xadc1('0x20')]({'port':0x232c});var client9002=jayson[_0xadc1('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fe6f3,_0x533f4f,_0x59582d,_0x5c17dc){return new BPromise(function(_0x10fd89,_0x469e14){var _0x2322c2=_0x5c17dc||client;return _0x2322c2[_0xadc1('0x22')](_0x4fe6f3,_0x59582d)['then'](function(_0x8e9009){logger[_0xadc1('0x23')](_0xadc1('0x24'),_0x533f4f,_0xadc1('0x25'));logger[_0xadc1('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x533f4f,_0xadc1('0x25'),JSON[_0xadc1('0x27')](_0x8e9009));if(_0x8e9009[_0xadc1('0x28')]){if(_0x8e9009[_0xadc1('0x28')]['code']===0x1f4){logger[_0xadc1('0x28')](_0xadc1('0x24'),_0x533f4f,_0x8e9009['error'][_0xadc1('0x29')]);return _0x469e14(_0x8e9009[_0xadc1('0x28')][_0xadc1('0x29')]);}logger[_0xadc1('0x28')](_0xadc1('0x24'),_0x533f4f,_0x8e9009['error'][_0xadc1('0x29')]);return _0x10fd89(_0x8e9009['error'][_0xadc1('0x29')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x533f4f,'request\x20sent');_0x10fd89(_0x8e9009[_0xadc1('0x2a')]['message']);}})[_0xadc1('0x2b')](function(_0x3118aa){logger['error'](_0xadc1('0x24'),_0x533f4f,_0x3118aa);_0x469e14(_0x3118aa);});});}function respondWithStatusCode(_0x4e5ea0,_0x508aee){_0x508aee=_0x508aee||0xcc;return function(_0x442756){if(_0x442756){return _0x4e5ea0[_0xadc1('0x2c')](_0x508aee);}return _0x4e5ea0[_0xadc1('0x2d')](_0x508aee)[_0xadc1('0x2e')]();};}function respondWithResult(_0x2184a4,_0x52fcd0){_0x52fcd0=_0x52fcd0||0xc8;return function(_0x46642a){if(_0x46642a){return _0x2184a4[_0xadc1('0x2d')](_0x52fcd0)['json'](_0x46642a);}};}function respondWithFilteredResult(_0x132272,_0x25780d){return function(_0x29dca5){if(_0x29dca5){var _0x12e8e9=typeof _0x25780d['offset']==='undefined'&&typeof _0x25780d[_0xadc1('0x2f')]===_0xadc1('0x30');var _0x2e0777=_0x29dca5[_0xadc1('0x31')];var _0x47d804=_0x12e8e9?0x0:_0x25780d['offset'];var _0x3588fd=_0x12e8e9?_0x29dca5[_0xadc1('0x31')]:_0x25780d[_0xadc1('0x32')]+_0x25780d[_0xadc1('0x2f')];var _0x500c7b;if(_0x3588fd>=_0x2e0777){_0x3588fd=_0x2e0777;_0x500c7b=0xc8;}else{_0x500c7b=0xce;}_0x132272[_0xadc1('0x2d')](_0x500c7b);return _0x132272[_0xadc1('0x33')](_0xadc1('0x34'),_0x47d804+'-'+_0x3588fd+'/'+_0x2e0777)[_0xadc1('0x35')](_0x29dca5);}return null;};}function patchUpdates(_0x1cd7ef){return function(_0x51f5d8){try{jsonpatch[_0xadc1('0x36')](_0x51f5d8,_0x1cd7ef,!![]);}catch(_0x31a066){return BPromise[_0xadc1('0x37')](_0x31a066);}return _0x51f5d8[_0xadc1('0x38')]();};}function saveUpdates(_0x56032d,_0x3500f6){return function(_0x40ef84){if(_0x40ef84){return _0x40ef84[_0xadc1('0x39')](_0x56032d)[_0xadc1('0x3a')](function(_0x49833e){return _0x49833e;});}return null;};}function removeEntity(_0x4563df,_0x409080){return function(_0x37518d){if(_0x37518d){return _0x37518d[_0xadc1('0x3b')]()[_0xadc1('0x3a')](function(){_0x4563df[_0xadc1('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x344a54,_0x258dc8){return function(_0x53cb31){if(!_0x53cb31){_0x344a54[_0xadc1('0x2c')](0x194);}return _0x53cb31;};}function handleError(_0x166b85,_0x2c2700){_0x2c2700=_0x2c2700||0x1f4;return function(_0x21d4bc){logger['error'](_0x21d4bc[_0xadc1('0x3c')]);if(_0x21d4bc[_0xadc1('0x3d')]){delete _0x21d4bc[_0xadc1('0x3d')];}_0x166b85[_0xadc1('0x2d')](_0x2c2700)[_0xadc1('0x3e')](_0x21d4bc);};}exports[_0xadc1('0x3f')]=function(_0x5f3723,_0x2a9661){var _0x46438a={},_0xb58a8b={},_0x5a145d={'count':0x0,'rows':[]};var _0x5c2008=_[_0xadc1('0x40')](db['OpenchannelMessage']['rawAttributes'],function(_0x3c43f9){return{'name':_0x3c43f9['fieldName'],'type':_0x3c43f9[_0xadc1('0x41')][_0xadc1('0x42')]};});_0xb58a8b[_0xadc1('0x43')]=_[_0xadc1('0x40')](_0x5c2008,_0xadc1('0x3d'));_0xb58a8b[_0xadc1('0x44')]=_[_0xadc1('0x45')](_0x5f3723[_0xadc1('0x44')]);_0xb58a8b[_0xadc1('0x46')]=_[_0xadc1('0x47')](_0xb58a8b[_0xadc1('0x43')],_0xb58a8b[_0xadc1('0x44')]);_0x46438a[_0xadc1('0x48')]=_[_0xadc1('0x47')](_0xb58a8b[_0xadc1('0x43')],qs[_0xadc1('0x49')](_0x5f3723['query']['fields']));_0x46438a['attributes']=_0x46438a[_0xadc1('0x48')][_0xadc1('0x4a')]?_0x46438a['attributes']:_0xb58a8b['model'];if(!_0x5f3723[_0xadc1('0x44')][_0xadc1('0x4b')](_0xadc1('0x4c'))){_0x46438a[_0xadc1('0x2f')]=qs[_0xadc1('0x2f')](_0x5f3723[_0xadc1('0x44')]['limit']);_0x46438a[_0xadc1('0x32')]=qs[_0xadc1('0x32')](_0x5f3723[_0xadc1('0x44')]['offset']);}_0x46438a['order']=qs[_0xadc1('0x4d')](_0x5f3723['query'][_0xadc1('0x4d')]);_0x46438a[_0xadc1('0x4e')]=qs[_0xadc1('0x46')](_['pick'](_0x5f3723[_0xadc1('0x44')],_0xb58a8b[_0xadc1('0x46')]),_0x5c2008);if(_0x5f3723[_0xadc1('0x44')][_0xadc1('0x4f')]){_0x46438a['where']=_[_0xadc1('0x50')](_0x46438a[_0xadc1('0x4e')],{'$or':_[_0xadc1('0x40')](_0x5c2008,function(_0x4ad9e3){if(_0x4ad9e3[_0xadc1('0x41')]!==_0xadc1('0x51')){var _0x2fa3ec={};_0x2fa3ec[_0x4ad9e3[_0xadc1('0x3d')]]={'$like':'%'+_0x5f3723['query']['filter']+'%'};return _0x2fa3ec;}})});}_0x46438a=_['merge']({},_0x46438a,_0x5f3723[_0xadc1('0x52')]);var _0x2b4da5={'where':_0x46438a[_0xadc1('0x4e')]};return db[_0xadc1('0x53')][_0xadc1('0x31')](_0x2b4da5)['then'](function(_0xdf0ac3){_0x5a145d[_0xadc1('0x31')]=_0xdf0ac3;if(_0x5f3723[_0xadc1('0x44')][_0xadc1('0x54')]){_0x46438a[_0xadc1('0x55')]=[{'all':!![]}];}return db[_0xadc1('0x53')][_0xadc1('0x56')](_0x46438a);})[_0xadc1('0x3a')](function(_0x8e6002){_0x5a145d['rows']=_0x8e6002;return _0x5a145d;})[_0xadc1('0x3a')](respondWithFilteredResult(_0x2a9661,_0x46438a))[_0xadc1('0x2b')](handleError(_0x2a9661,null));};exports[_0xadc1('0x57')]=function(_0x388f93,_0x1fd9ad){var _0x93141f={'raw':!![],'where':{'id':_0x388f93[_0xadc1('0x58')]['id']}},_0x4951ff={};_0x4951ff['model']=_[_0xadc1('0x45')](db['OpenchannelMessage']['rawAttributes']);_0x4951ff['query']=_[_0xadc1('0x45')](_0x388f93['query']);_0x4951ff[_0xadc1('0x46')]=_[_0xadc1('0x47')](_0x4951ff[_0xadc1('0x43')],_0x4951ff[_0xadc1('0x44')]);_0x93141f[_0xadc1('0x48')]=_['intersection'](_0x4951ff[_0xadc1('0x43')],qs[_0xadc1('0x49')](_0x388f93[_0xadc1('0x44')]['fields']));_0x93141f[_0xadc1('0x48')]=_0x93141f['attributes'][_0xadc1('0x4a')]?_0x93141f['attributes']:_0x4951ff[_0xadc1('0x43')];if(_0x388f93[_0xadc1('0x44')][_0xadc1('0x54')]){_0x93141f[_0xadc1('0x55')]=[{'all':!![]}];}_0x93141f=_['merge']({},_0x93141f,_0x388f93[_0xadc1('0x52')]);return db[_0xadc1('0x53')][_0xadc1('0x59')](_0x93141f)[_0xadc1('0x3a')](handleEntityNotFound(_0x1fd9ad,null))[_0xadc1('0x3a')](respondWithResult(_0x1fd9ad,null))[_0xadc1('0x2b')](handleError(_0x1fd9ad,null));};exports['create']=function(_0x24e710,_0x26f601){return db[_0xadc1('0x53')]['create'](_0x24e710[_0xadc1('0x5a')],{})[_0xadc1('0x3a')](respondWithResult(_0x26f601,0xc9))[_0xadc1('0x2b')](handleError(_0x26f601,null));};exports[_0xadc1('0x39')]=function(_0x5d69ba,_0xe165a){if(_0x5d69ba[_0xadc1('0x5a')]['id']){delete _0x5d69ba[_0xadc1('0x5a')]['id'];}return db[_0xadc1('0x53')]['find']({'where':{'id':_0x5d69ba['params']['id']}})[_0xadc1('0x3a')](handleEntityNotFound(_0xe165a,null))['then'](saveUpdates(_0x5d69ba['body'],null))[_0xadc1('0x3a')](respondWithResult(_0xe165a,null))[_0xadc1('0x2b')](handleError(_0xe165a,null));};exports[_0xadc1('0x3b')]=function(_0x4cbc2a,_0x5b9eae){return db['OpenchannelMessage'][_0xadc1('0x59')]({'where':{'id':_0x4cbc2a[_0xadc1('0x58')]['id']}})[_0xadc1('0x3a')](handleEntityNotFound(_0x5b9eae,null))[_0xadc1('0x3a')](removeEntity(_0x5b9eae,null))[_0xadc1('0x2b')](handleError(_0x5b9eae,null));};exports[_0xadc1('0x5b')]=function(_0x5ccd20,_0x504011){return db['OpenchannelMessage'][_0xadc1('0x5b')]()[_0xadc1('0x3a')](respondWithResult(_0x504011,null))[_0xadc1('0x2b')](handleError(_0x504011,null));};var interaction_log=require(_0xadc1('0x15'))(_0xadc1('0x5c'));exports[_0xadc1('0x5d')]=function(_0x2b3432,_0x34c081,_0x25f301){var _0x116536={'agent':{},'channel':'openchannel'};if(_0x2b3432[_0xadc1('0x5a')]['id']){delete _0x2b3432['body']['id'];}_0x2b3432['body'][_0xadc1('0x5e')]=!![];_0x2b3432['body'][_0xadc1('0x5f')]=moment()[_0xadc1('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b3432[_0xadc1('0x5a')]['UserId']=_0x2b3432[_0xadc1('0x5a')][_0xadc1('0x61')]||_0x2b3432[_0xadc1('0x62')]['id'];_0x116536['agent']['id']=_0x2b3432['body'][_0xadc1('0x61')];return db['OpenchannelMessage'][_0xadc1('0x59')]({'where':{'id':_0x2b3432[_0xadc1('0x58')]['id'],'UserId':null}})[_0xadc1('0x3a')](handleEntityNotFound(_0x34c081,null))[_0xadc1('0x3a')](saveUpdates(_0x2b3432[_0xadc1('0x5a')],null))[_0xadc1('0x3a')](function(_0x4a911f){if(_0x4a911f){_0x116536['message']=_0x4a911f['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xadc1('0x59')]({'where':{'id':_0x4a911f[_0xadc1('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x34c081,null))[_0xadc1('0x3a')](function(_0x419d3d){if(_0x419d3d){return _0x419d3d[_0xadc1('0x39')]({'UserId':_0x2b3432['body'][_0xadc1('0x61')],'read1stAt':_[_0xadc1('0x64')](_0x419d3d[_0xadc1('0x65')])?moment()[_0xadc1('0x60')](_0xadc1('0x66')):undefined});}return null;})['then'](function(_0x53e2ae){if(_0x53e2ae){_0x116536[_0xadc1('0x67')]=_0x53e2ae['get']({'plain':!![]});interaction_log['info'](_0xadc1('0x68'),_0x2b3432['user']['id'],_0x2b3432[_0xadc1('0x62')][_0xadc1('0x3d')],_0x2b3432[_0xadc1('0x62')]['role'],_0x116536[_0xadc1('0x67')]['id'],_0x2b3432[_0xadc1('0x5a')]?JSON[_0xadc1('0x27')](_0x2b3432['body']):_0xadc1('0x69'));return respondWithRpcPromise(_0xadc1('0x6a'),'acceptMessage',_0x116536);}return null;})[_0xadc1('0x3a')](function(_0x307770){var _0x30a460=_0xadc1('0x6b')+_0x307770['message']['ContactId'];return db[_0xadc1('0x6c')][_0xadc1('0x44')](_0x30a460,{'type':db[_0xadc1('0x6d')]['QueryTypes']['SELECT'],'raw':!![]})[_0xadc1('0x3a')](function(_0x362b4d){return _0x362b4d;});})[_0xadc1('0x3a')](function(_0x2d201c){if(_0x2d201c){_0x116536[_0xadc1('0x29')][_0xadc1('0x6e')]=_0x2d201c[0x0];if(!_0x2b3432[_0xadc1('0x5a')][_0xadc1('0x61')])return;return db[_0xadc1('0x6f')][_0xadc1('0x59')]({'where':{'id':_0x2b3432[_0xadc1('0x5a')][_0xadc1('0x61')],'role':_0xadc1('0x70')},'attributes':['id',_0xadc1('0x3d'),'fullname',_0xadc1('0x71'),_0xadc1('0x72')],'raw':!![]});}return null;})[_0xadc1('0x3a')](function(_0x2e7dff){if(!_0x2e7dff)return null;_0x116536['message'][_0xadc1('0x70')]=_0x2e7dff;return _0x116536;})[_0xadc1('0x3a')](function(_0x103cdc){if(_0x103cdc){if(_0x2b3432['body'][_0xadc1('0x73')]){_0x116536[_0xadc1('0x29')][_0xadc1('0x74')]=util['format'](_0xadc1('0x75'),_0x2b3432['user'][_0xadc1('0x3d')]);_0x116536['message'][_0xadc1('0x76')]=_0x116536[_0xadc1('0x76')];_0x116536['message'][_0xadc1('0x77')]='accept';return respondWithRpcPromise(_0xadc1('0x78'),_0xadc1('0x78'),{'event':_0xadc1('0x79'),'message':_0x116536[_0xadc1('0x29')]},client9002)[_0xadc1('0x3a')](function(){return _0x116536;});}return _0x116536;}return null;})['then'](respondWithResult(_0x34c081,null))['catch'](handleError(_0x34c081,null));};var interaction_log=require(_0xadc1('0x15'))(_0xadc1('0x5c'));exports['reject']=function(_0x2c43cf,_0x11b551,_0x14085a){var _0x40b7cf={'agent':{},'channel':'openchannel'};if(_0x2c43cf[_0xadc1('0x5a')]['id']){delete _0x2c43cf['body']['id'];}_0x2c43cf[_0xadc1('0x5a')][_0xadc1('0x61')]=_0x2c43cf[_0xadc1('0x5a')][_0xadc1('0x61')]||_0x2c43cf['user']['id'];_0x40b7cf[_0xadc1('0x70')]['id']=_0x2c43cf[_0xadc1('0x5a')][_0xadc1('0x61')];return db[_0xadc1('0x53')][_0xadc1('0x59')]({'where':{'id':_0x2c43cf[_0xadc1('0x58')]['id'],'UserId':null}})[_0xadc1('0x3a')](handleEntityNotFound(_0x11b551,null))[_0xadc1('0x3a')](function(_0x7db1b4){if(_0x7db1b4){_0x40b7cf[_0xadc1('0x29')]=_0x7db1b4[_0xadc1('0x7a')]({'plain':!![]});return db[_0xadc1('0x7b')][_0xadc1('0x59')]({'where':{'id':_0x7db1b4[_0xadc1('0x63')]}});}return null;})[_0xadc1('0x3a')](handleEntityNotFound(_0x11b551,null))[_0xadc1('0x3a')](function(_0x4b9b86){if(_0x4b9b86){_0x40b7cf[_0xadc1('0x67')]=_0x4b9b86[_0xadc1('0x7a')]({'plain':!![]});interaction_log[_0xadc1('0x23')](_0xadc1('0x7c'),_0x2c43cf[_0xadc1('0x62')]['id'],_0x2c43cf[_0xadc1('0x62')]['name'],_0x2c43cf['user'][_0xadc1('0x7d')],_0x40b7cf[_0xadc1('0x67')]['id'],_0x2c43cf[_0xadc1('0x5a')]?JSON['stringify'](_0x2c43cf[_0xadc1('0x5a')]):_0xadc1('0x69'));return respondWithRpcPromise(_0xadc1('0x7e'),_0xadc1('0x7f'),_0x40b7cf);}return null;})['then'](function(_0x493eee){var _0xda6e9e=_0xadc1('0x6b')+_0x493eee['message'][_0xadc1('0x80')];return db[_0xadc1('0x6c')][_0xadc1('0x44')](_0xda6e9e,{'type':db[_0xadc1('0x6d')]['QueryTypes'][_0xadc1('0x81')],'raw':!![]})[_0xadc1('0x3a')](function(_0x3a1fcd){return _0x3a1fcd;});})['then'](function(_0x102a52){if(_0x102a52){_0x40b7cf['message'][_0xadc1('0x6e')]=_0x102a52[0x0];if(!_0x2c43cf[_0xadc1('0x5a')][_0xadc1('0x61')])return;return db[_0xadc1('0x6f')][_0xadc1('0x59')]({'where':{'id':_0x2c43cf[_0xadc1('0x5a')][_0xadc1('0x61')],'role':'agent'},'attributes':['id',_0xadc1('0x3d'),_0xadc1('0x82'),_0xadc1('0x71'),_0xadc1('0x72')],'raw':!![]});}return null;})[_0xadc1('0x3a')](function(_0x338cf7){if(!_0x338cf7)return null;_0x40b7cf[_0xadc1('0x29')][_0xadc1('0x70')]=_0x338cf7;return _0x40b7cf;})['then'](function(_0x17d947){if(_0x17d947){_0x17d947[_0xadc1('0x29')][_0xadc1('0x74')]=util[_0xadc1('0x60')](_0xadc1('0x75'),_0x2c43cf[_0xadc1('0x62')][_0xadc1('0x3d')]);_0x17d947['message'][_0xadc1('0x76')]=_0x40b7cf[_0xadc1('0x76')];_0x17d947['message'][_0xadc1('0x77')]=_0xadc1('0x37');respondWithRpcPromise(_0xadc1('0x78'),'EventManager',{'event':_0xadc1('0x83'),'message':_0x17d947[_0xadc1('0x29')]},client9002);return _0x40b7cf;}return null;})[_0xadc1('0x3a')](respondWithResult(_0x11b551,null))['catch'](handleError(_0x11b551,null));}; \ No newline at end of file +var _0x5990=['create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','get','OpenchannelInteraction','OpenchannelInteractionId','UserId','isNil','read1stAt','interaction','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','channel','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','QueryTypes','EventManager','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','OpenchannelMessage','rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x342fe6,_0x4d212e){var _0x18b9dd=function(_0x5114c3){while(--_0x5114c3){_0x342fe6['push'](_0x342fe6['shift']());}};_0x18b9dd(++_0x4d212e);}(_0x5990,0x1a1));var _0x0599=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5990[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0599('0x0'));var rimraf=require(_0x0599('0x1'));var zipdir=require(_0x0599('0x2'));var jsonpatch=require(_0x0599('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0599('0x4'));var util=require(_0x0599('0x5'));var path=require(_0x0599('0x6'));var sox=require('sox');var csv=require(_0x0599('0x7'));var ejs=require(_0x0599('0x8'));var fs=require('fs');var fs_extra=require(_0x0599('0x9'));var _=require(_0x0599('0xa'));var squel=require(_0x0599('0xb'));var crypto=require(_0x0599('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0599('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0599('0xe'));var Papa=require(_0x0599('0xf'));var Redis=require('ioredis');var authService=require(_0x0599('0x10'));var qs=require(_0x0599('0x11'));var as=require(_0x0599('0x12'));var hardwareService=require(_0x0599('0x13'));var logger=require(_0x0599('0x14'))(_0x0599('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0599('0x16')]=_[_0x0599('0x17')](config[_0x0599('0x16')],{'host':_0x0599('0x18'),'port':0x18eb});var socket=require(_0x0599('0x19'))(new Redis(config[_0x0599('0x16')]));require(_0x0599('0x1a'))[_0x0599('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0599('0x1c')][_0x0599('0x1d')]({'port':0x232c});var client9002=jayson[_0x0599('0x1c')][_0x0599('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x31edbf,_0x310570,_0x53fd38,_0x38a38c){return new BPromise(function(_0x3e65e7,_0x34d077){var _0x2d1210=_0x38a38c||client;return _0x2d1210['request'](_0x31edbf,_0x53fd38)['then'](function(_0x39f3a2){logger[_0x0599('0x1e')](_0x0599('0x1f'),_0x310570,_0x0599('0x20'));logger['debug'](_0x0599('0x21'),_0x310570,'request\x20sent',JSON[_0x0599('0x22')](_0x39f3a2));if(_0x39f3a2[_0x0599('0x23')]){if(_0x39f3a2[_0x0599('0x23')][_0x0599('0x24')]===0x1f4){logger[_0x0599('0x23')](_0x0599('0x1f'),_0x310570,_0x39f3a2[_0x0599('0x23')][_0x0599('0x25')]);return _0x34d077(_0x39f3a2[_0x0599('0x23')]['message']);}logger[_0x0599('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x310570,_0x39f3a2[_0x0599('0x23')]['message']);return _0x3e65e7(_0x39f3a2[_0x0599('0x23')][_0x0599('0x25')]);}else{logger['info'](_0x0599('0x1f'),_0x310570,'request\x20sent');_0x3e65e7(_0x39f3a2[_0x0599('0x26')][_0x0599('0x25')]);}})['catch'](function(_0x16827d){logger[_0x0599('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x310570,_0x16827d);_0x34d077(_0x16827d);});});}function respondWithStatusCode(_0x35ed29,_0x2aebd2){_0x2aebd2=_0x2aebd2||0xcc;return function(_0x487aa1){if(_0x487aa1){return _0x35ed29[_0x0599('0x27')](_0x2aebd2);}return _0x35ed29[_0x0599('0x28')](_0x2aebd2)[_0x0599('0x29')]();};}function respondWithResult(_0x582630,_0x423c85){_0x423c85=_0x423c85||0xc8;return function(_0x1dd95c){if(_0x1dd95c){return _0x582630['status'](_0x423c85)[_0x0599('0x2a')](_0x1dd95c);}};}function respondWithFilteredResult(_0x2060c6,_0x6708a0){return function(_0x3723bf){if(_0x3723bf){var _0x234b41=typeof _0x6708a0[_0x0599('0x2b')]===_0x0599('0x2c')&&typeof _0x6708a0[_0x0599('0x2d')]==='undefined';var _0x4fc445=_0x3723bf['count'];var _0x2137c7=_0x234b41?0x0:_0x6708a0[_0x0599('0x2b')];var _0x275de1=_0x234b41?_0x3723bf['count']:_0x6708a0[_0x0599('0x2b')]+_0x6708a0[_0x0599('0x2d')];var _0x2aed0c;if(_0x275de1>=_0x4fc445){_0x275de1=_0x4fc445;_0x2aed0c=0xc8;}else{_0x2aed0c=0xce;}_0x2060c6['status'](_0x2aed0c);return _0x2060c6[_0x0599('0x2e')](_0x0599('0x2f'),_0x2137c7+'-'+_0x275de1+'/'+_0x4fc445)[_0x0599('0x2a')](_0x3723bf);}return null;};}function patchUpdates(_0x145faa){return function(_0x3987ee){try{jsonpatch[_0x0599('0x30')](_0x3987ee,_0x145faa,!![]);}catch(_0x2c2db6){return BPromise[_0x0599('0x31')](_0x2c2db6);}return _0x3987ee[_0x0599('0x32')]();};}function saveUpdates(_0x3f0a3a,_0x501d7b){return function(_0x33c76e){if(_0x33c76e){return _0x33c76e[_0x0599('0x33')](_0x3f0a3a)[_0x0599('0x34')](function(_0x19c616){return _0x19c616;});}return null;};}function removeEntity(_0x4c2960,_0x506693){return function(_0x38c93b){if(_0x38c93b){return _0x38c93b[_0x0599('0x35')]()[_0x0599('0x34')](function(){_0x4c2960[_0x0599('0x28')](0xcc)[_0x0599('0x29')]();});}};}function handleEntityNotFound(_0x194011,_0x579a6f){return function(_0x1b39e1){if(!_0x1b39e1){_0x194011[_0x0599('0x27')](0x194);}return _0x1b39e1;};}function handleError(_0x548b1e,_0x39caec){_0x39caec=_0x39caec||0x1f4;return function(_0x262132){logger['error'](_0x262132[_0x0599('0x36')]);if(_0x262132[_0x0599('0x37')]){delete _0x262132['name'];}_0x548b1e[_0x0599('0x28')](_0x39caec)[_0x0599('0x38')](_0x262132);};}exports['index']=function(_0x54d428,_0x5e0df1){var _0x2f5c09={},_0x5f5cdd={},_0x4f21d9={'count':0x0,'rows':[]};var _0x53679e=_['map'](db[_0x0599('0x39')][_0x0599('0x3a')],function(_0x3d13c3){return{'name':_0x3d13c3['fieldName'],'type':_0x3d13c3['type']['key']};});_0x5f5cdd[_0x0599('0x3b')]=_['map'](_0x53679e,_0x0599('0x37'));_0x5f5cdd[_0x0599('0x3c')]=_['keys'](_0x54d428['query']);_0x5f5cdd['filters']=_['intersection'](_0x5f5cdd[_0x0599('0x3b')],_0x5f5cdd[_0x0599('0x3c')]);_0x2f5c09[_0x0599('0x3d')]=_[_0x0599('0x3e')](_0x5f5cdd[_0x0599('0x3b')],qs[_0x0599('0x3f')](_0x54d428[_0x0599('0x3c')][_0x0599('0x3f')]));_0x2f5c09[_0x0599('0x3d')]=_0x2f5c09[_0x0599('0x3d')][_0x0599('0x40')]?_0x2f5c09['attributes']:_0x5f5cdd[_0x0599('0x3b')];if(!_0x54d428[_0x0599('0x3c')][_0x0599('0x41')](_0x0599('0x42'))){_0x2f5c09[_0x0599('0x2d')]=qs[_0x0599('0x2d')](_0x54d428[_0x0599('0x3c')]['limit']);_0x2f5c09[_0x0599('0x2b')]=qs[_0x0599('0x2b')](_0x54d428['query'][_0x0599('0x2b')]);}_0x2f5c09[_0x0599('0x43')]=qs[_0x0599('0x44')](_0x54d428[_0x0599('0x3c')][_0x0599('0x44')]);_0x2f5c09[_0x0599('0x45')]=qs[_0x0599('0x46')](_[_0x0599('0x47')](_0x54d428['query'],_0x5f5cdd[_0x0599('0x46')]),_0x53679e);if(_0x54d428[_0x0599('0x3c')][_0x0599('0x48')]){_0x2f5c09['where']=_[_0x0599('0x49')](_0x2f5c09[_0x0599('0x45')],{'$or':_[_0x0599('0x4a')](_0x53679e,function(_0x130fb3){if(_0x130fb3[_0x0599('0x4b')]!=='VIRTUAL'){var _0x494043={};_0x494043[_0x130fb3[_0x0599('0x37')]]={'$like':'%'+_0x54d428[_0x0599('0x3c')][_0x0599('0x48')]+'%'};return _0x494043;}})});}_0x2f5c09=_[_0x0599('0x49')]({},_0x2f5c09,_0x54d428[_0x0599('0x4c')]);var _0x3c3ae5={'where':_0x2f5c09['where']};return db[_0x0599('0x39')][_0x0599('0x4d')](_0x3c3ae5)[_0x0599('0x34')](function(_0x38646b){_0x4f21d9[_0x0599('0x4d')]=_0x38646b;if(_0x54d428['query'][_0x0599('0x4e')]){_0x2f5c09[_0x0599('0x4f')]=[{'all':!![]}];}return db[_0x0599('0x39')][_0x0599('0x50')](_0x2f5c09);})[_0x0599('0x34')](function(_0x2e5424){_0x4f21d9[_0x0599('0x51')]=_0x2e5424;return _0x4f21d9;})[_0x0599('0x34')](respondWithFilteredResult(_0x5e0df1,_0x2f5c09))[_0x0599('0x52')](handleError(_0x5e0df1,null));};exports[_0x0599('0x53')]=function(_0x4df7b1,_0x55d67){var _0x31d9d8={'raw':!![],'where':{'id':_0x4df7b1[_0x0599('0x54')]['id']}},_0x33ab1e={};_0x33ab1e[_0x0599('0x3b')]=_['keys'](db[_0x0599('0x39')]['rawAttributes']);_0x33ab1e['query']=_[_0x0599('0x55')](_0x4df7b1[_0x0599('0x3c')]);_0x33ab1e['filters']=_[_0x0599('0x3e')](_0x33ab1e['model'],_0x33ab1e[_0x0599('0x3c')]);_0x31d9d8[_0x0599('0x3d')]=_['intersection'](_0x33ab1e[_0x0599('0x3b')],qs[_0x0599('0x3f')](_0x4df7b1[_0x0599('0x3c')][_0x0599('0x3f')]));_0x31d9d8[_0x0599('0x3d')]=_0x31d9d8[_0x0599('0x3d')][_0x0599('0x40')]?_0x31d9d8[_0x0599('0x3d')]:_0x33ab1e['model'];if(_0x4df7b1[_0x0599('0x3c')][_0x0599('0x4e')]){_0x31d9d8[_0x0599('0x4f')]=[{'all':!![]}];}_0x31d9d8=_['merge']({},_0x31d9d8,_0x4df7b1[_0x0599('0x4c')]);return db['OpenchannelMessage'][_0x0599('0x56')](_0x31d9d8)[_0x0599('0x34')](handleEntityNotFound(_0x55d67,null))[_0x0599('0x34')](respondWithResult(_0x55d67,null))[_0x0599('0x52')](handleError(_0x55d67,null));};exports[_0x0599('0x57')]=function(_0x18427b,_0x5ae8bc){return db[_0x0599('0x39')]['create'](_0x18427b[_0x0599('0x58')],{})['then'](respondWithResult(_0x5ae8bc,0xc9))[_0x0599('0x52')](handleError(_0x5ae8bc,null));};exports[_0x0599('0x33')]=function(_0x23da54,_0x393aad){if(_0x23da54[_0x0599('0x58')]['id']){delete _0x23da54[_0x0599('0x58')]['id'];}return db[_0x0599('0x39')][_0x0599('0x56')]({'where':{'id':_0x23da54['params']['id']}})[_0x0599('0x34')](handleEntityNotFound(_0x393aad,null))[_0x0599('0x34')](saveUpdates(_0x23da54['body'],null))['then'](respondWithResult(_0x393aad,null))[_0x0599('0x52')](handleError(_0x393aad,null));};exports[_0x0599('0x35')]=function(_0x270099,_0x5b2900){return db[_0x0599('0x39')][_0x0599('0x56')]({'where':{'id':_0x270099[_0x0599('0x54')]['id']}})[_0x0599('0x34')](handleEntityNotFound(_0x5b2900,null))[_0x0599('0x34')](removeEntity(_0x5b2900,null))['catch'](handleError(_0x5b2900,null));};exports[_0x0599('0x59')]=function(_0x55ce6b,_0x127fc6){return db[_0x0599('0x39')]['describe']()[_0x0599('0x34')](respondWithResult(_0x127fc6,null))['catch'](handleError(_0x127fc6,null));};var interaction_log=require(_0x0599('0x14'))('openchannel-interactions');exports[_0x0599('0x5a')]=function(_0x22ee38,_0x40ab41,_0x2a5b46){var _0x10a2e9={'agent':{},'channel':'openchannel'};if(_0x22ee38[_0x0599('0x58')]['id']){delete _0x22ee38['body']['id'];}_0x22ee38[_0x0599('0x58')][_0x0599('0x5b')]=!![];_0x22ee38[_0x0599('0x58')][_0x0599('0x5c')]=moment()[_0x0599('0x5d')](_0x0599('0x5e'));_0x22ee38[_0x0599('0x58')]['UserId']=_0x22ee38['body']['UserId']||_0x22ee38['user']['id'];_0x10a2e9[_0x0599('0x5f')]['id']=_0x22ee38[_0x0599('0x58')]['UserId'];return db[_0x0599('0x39')][_0x0599('0x56')]({'where':{'id':_0x22ee38[_0x0599('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x40ab41,null))['then'](saveUpdates(_0x22ee38[_0x0599('0x58')],null))[_0x0599('0x34')](function(_0x2200b6){if(_0x2200b6){_0x10a2e9[_0x0599('0x25')]=_0x2200b6[_0x0599('0x60')]({'plain':!![]});return db[_0x0599('0x61')][_0x0599('0x56')]({'where':{'id':_0x2200b6[_0x0599('0x62')]}});}return null;})[_0x0599('0x34')](handleEntityNotFound(_0x40ab41,null))['then'](function(_0x46e781){if(_0x46e781){return _0x46e781[_0x0599('0x33')]({'UserId':_0x22ee38['body'][_0x0599('0x63')],'read1stAt':_[_0x0599('0x64')](_0x46e781[_0x0599('0x65')])?moment()[_0x0599('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0599('0x34')](function(_0xe03737){if(_0xe03737){_0x10a2e9[_0x0599('0x66')]=_0xe03737[_0x0599('0x60')]({'plain':!![]});interaction_log[_0x0599('0x1e')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x22ee38['user']['id'],_0x22ee38['user'][_0x0599('0x37')],_0x22ee38[_0x0599('0x67')][_0x0599('0x68')],_0x10a2e9[_0x0599('0x66')]['id'],_0x22ee38[_0x0599('0x58')]?JSON[_0x0599('0x22')](_0x22ee38['body']):_0x0599('0x69'));return respondWithRpcPromise(_0x0599('0x6a'),'acceptMessage',_0x10a2e9);}return null;})['then'](function(_0x35ab97){var _0x59c0cb=_0x0599('0x6b')+_0x35ab97[_0x0599('0x25')]['ContactId'];return db[_0x0599('0x6c')][_0x0599('0x3c')](_0x59c0cb,{'type':db[_0x0599('0x6d')]['QueryTypes'][_0x0599('0x6e')],'raw':!![]})['then'](function(_0x24a461){return _0x24a461;});})['then'](function(_0x547ccf){if(_0x547ccf){_0x10a2e9['message'][_0x0599('0x6f')]=_0x547ccf[0x0];if(!_0x22ee38[_0x0599('0x58')][_0x0599('0x63')])return;return db[_0x0599('0x70')][_0x0599('0x56')]({'where':{'id':_0x22ee38[_0x0599('0x58')][_0x0599('0x63')],'role':'agent'},'attributes':['id',_0x0599('0x37'),_0x0599('0x71'),_0x0599('0x72'),_0x0599('0x73')],'raw':!![]});}return null;})[_0x0599('0x34')](function(_0x599a6b){if(!_0x599a6b)return null;_0x10a2e9[_0x0599('0x25')][_0x0599('0x5f')]=_0x599a6b;return _0x10a2e9;})[_0x0599('0x34')](function(_0x1f9772){if(_0x1f9772){if(_0x22ee38[_0x0599('0x58')][_0x0599('0x74')]){_0x10a2e9[_0x0599('0x25')][_0x0599('0x75')]=util['format']('SIP/%s',_0x22ee38[_0x0599('0x67')][_0x0599('0x37')]);_0x10a2e9[_0x0599('0x25')][_0x0599('0x76')]=_0x10a2e9[_0x0599('0x76')];_0x10a2e9[_0x0599('0x25')]['event']='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x0599('0x77'),'message':_0x10a2e9[_0x0599('0x25')]},client9002)[_0x0599('0x34')](function(){return _0x10a2e9;});}return _0x10a2e9;}return null;})[_0x0599('0x34')](respondWithResult(_0x40ab41,null))[_0x0599('0x52')](handleError(_0x40ab41,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x0599('0x31')]=function(_0x155a3c,_0x3f110e,_0x2d2a10){var _0x15bb83={'agent':{},'channel':_0x0599('0x78')};if(_0x155a3c[_0x0599('0x58')]['id']){delete _0x155a3c[_0x0599('0x58')]['id'];}_0x155a3c[_0x0599('0x58')][_0x0599('0x63')]=_0x155a3c[_0x0599('0x58')]['UserId']||_0x155a3c['user']['id'];_0x15bb83[_0x0599('0x5f')]['id']=_0x155a3c[_0x0599('0x58')][_0x0599('0x63')];return db[_0x0599('0x39')]['find']({'where':{'id':_0x155a3c[_0x0599('0x54')]['id'],'UserId':null}})[_0x0599('0x34')](handleEntityNotFound(_0x3f110e,null))[_0x0599('0x34')](function(_0x46d6db){if(_0x46d6db){_0x15bb83['message']=_0x46d6db[_0x0599('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0x0599('0x56')]({'where':{'id':_0x46d6db[_0x0599('0x62')]}});}return null;})[_0x0599('0x34')](handleEntityNotFound(_0x3f110e,null))[_0x0599('0x34')](function(_0x2ee116){if(_0x2ee116){_0x15bb83[_0x0599('0x66')]=_0x2ee116[_0x0599('0x60')]({'plain':!![]});interaction_log['info'](_0x0599('0x79'),_0x155a3c[_0x0599('0x67')]['id'],_0x155a3c['user']['name'],_0x155a3c[_0x0599('0x67')][_0x0599('0x68')],_0x15bb83[_0x0599('0x66')]['id'],_0x155a3c['body']?JSON[_0x0599('0x22')](_0x155a3c[_0x0599('0x58')]):_0x0599('0x69'));return respondWithRpcPromise('RejectMessage',_0x0599('0x7a'),_0x15bb83);}return null;})['then'](function(_0x22d5d7){var _0x1d316e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x22d5d7[_0x0599('0x25')][_0x0599('0x7b')];return db[_0x0599('0x6c')][_0x0599('0x3c')](_0x1d316e,{'type':db[_0x0599('0x6d')][_0x0599('0x7c')]['SELECT'],'raw':!![]})['then'](function(_0x47ad79){return _0x47ad79;});})[_0x0599('0x34')](function(_0x4c5f89){if(_0x4c5f89){_0x15bb83[_0x0599('0x25')]['contact']=_0x4c5f89[0x0];if(!_0x155a3c[_0x0599('0x58')][_0x0599('0x63')])return;return db[_0x0599('0x70')][_0x0599('0x56')]({'where':{'id':_0x155a3c[_0x0599('0x58')]['UserId'],'role':_0x0599('0x5f')},'attributes':['id',_0x0599('0x37'),'fullname',_0x0599('0x72'),_0x0599('0x73')],'raw':!![]});}return null;})[_0x0599('0x34')](function(_0x21dd97){if(!_0x21dd97)return null;_0x15bb83[_0x0599('0x25')][_0x0599('0x5f')]=_0x21dd97;return _0x15bb83;})['then'](function(_0x3038f8){if(_0x3038f8){_0x3038f8[_0x0599('0x25')]['interface']=util[_0x0599('0x5d')]('SIP/%s',_0x155a3c[_0x0599('0x67')]['name']);_0x3038f8[_0x0599('0x25')][_0x0599('0x76')]=_0x15bb83[_0x0599('0x76')];_0x3038f8[_0x0599('0x25')]['event']=_0x0599('0x31');respondWithRpcPromise(_0x0599('0x7d'),_0x0599('0x7d'),{'event':'rejectmessage','message':_0x3038f8[_0x0599('0x25')]},client9002);return _0x15bb83;}return null;})[_0x0599('0x34')](respondWithResult(_0x3f110e,null))[_0x0599('0x52')](handleError(_0x3f110e,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 3dacfea..d128500 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 _0x4eda=['setMaxListeners','update','remove','emit','exports'];(function(_0xd81585,_0x54aa85){var _0x23e1c8=function(_0x1bf2bf){while(--_0x1bf2bf){_0xd81585['push'](_0xd81585['shift']());}};_0x23e1c8(++_0x54aa85);}(_0x4eda,0xa0));var _0xa4ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4eda[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa4ed('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa4ed('0x1'),'afterDestroy':_0xa4ed('0x2')};function emitEvent(_0x4617aa){return function(_0x268269,_0x4cc1c9,_0x45904d){OpenchannelMessageEvents[_0xa4ed('0x3')](_0x4617aa+':'+_0x268269['id'],_0x268269);OpenchannelMessageEvents['emit'](_0x4617aa,_0x268269);_0x45904d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xa4ed('0x4')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x9630=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x9630,0x188));var _0x0963=function(_0x5c68ed,_0xe7c8bb){_0x5c68ed=_0x5c68ed-0x0;var _0x37f6c1=_0x9630[_0x5c68ed];return _0x37f6c1;};'use strict';var EventEmitter=require(_0x0963('0x0'));var OpenchannelMessage=require(_0x0963('0x1'))['db'][_0x0963('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0963('0x3')](0x0);var events={'afterCreate':_0x0963('0x4'),'afterUpdate':'update','afterDestroy':_0x0963('0x5')};function emitEvent(_0x40430a){return function(_0x2584e8,_0x244e67,_0x2db888){OpenchannelMessageEvents[_0x0963('0x6')](_0x40430a+':'+_0x2584e8['id'],_0x2584e8);OpenchannelMessageEvents[_0x0963('0x6')](_0x40430a,_0x2584e8);_0x2db888(null);};}for(var e in events){if(events[_0x0963('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x0963('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index c7776c8..e0a5f0f 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 _0x6e6c=['util','api','moment','path','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','out','find','OpenchannelAccountId','Interactions','CmContact','Contact','keys','then','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4b7175,_0x2c2dd6){var _0x3eeb4b=function(_0x1d6daa){while(--_0x1d6daa){_0x4b7175['push'](_0x4b7175['shift']());}};_0x3eeb4b(++_0x2c2dd6);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var logger=require('../../config/logger')(_0xc6e6('0x2'));var moment=require(_0xc6e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e6('0x4'));var rimraf=require('rimraf');var config=require(_0xc6e6('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0xc6e6('0x6')]=function(_0x1182c7,_0x4bf906){return _0x1182c7[_0xc6e6('0x7')](_0xc6e6('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc6e6('0x9'),'fields':[_0xc6e6('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x324f05,_0x481799,_0x172aa9){var _0x3b2f50=_0x1182c7[_0xc6e6('0xb')];var _0x3ddf6f=_0x324f05[_0xc6e6('0xc')]({'plain':!![]});if(_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='in'||_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='out'&&!_0x3ddf6f[_0xc6e6('0xf')]&&!_['isNil'](_0x3ddf6f[_0xc6e6('0x10')])){_0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x12')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]}})['then'](function(_0x149ac6){if(_0x149ac6){_0x149ac6[_0xc6e6('0x14')]({'lastMsgAt':_0x3ddf6f[_0xc6e6('0x15')],'lastMsgDirection':_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()});}})['catch'](function(_0x413cf8){console[_0xc6e6('0x16')](_0x413cf8);});}if(_0x3ddf6f['direction']===_0xc6e6('0x17')&&!_0x3ddf6f[_0xc6e6('0xf')]){var _0xedf127;_0x3b2f50['CmContact']['describe']()['then'](function(_0x3a1ccc){return _0x3b2f50['OpenchannelAccount'][_0xc6e6('0x18')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x19')]},'include':[{'model':_0x3b2f50[_0xc6e6('0x11')],'as':_0xc6e6('0x1a'),'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]},'limit':0x1,'include':[{'model':_0x3b2f50[_0xc6e6('0x1b')],'as':_0xc6e6('0x1c'),'attributes':_[_0xc6e6('0x1d')](_0x3a1ccc)}]}]});})[_0xc6e6('0x1e')](function(_0x3d734d){_0xedf127=_0x3d734d['get']({'plain':!![]});if(_0xedf127&&_0xedf127[_0xc6e6('0x1f')]){logger['info'](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x22')](_0xc6e6('0x23'),_0x3ddf6f['id'],_0xedf127['replyUri']));if(_0xedf127[_0xc6e6('0x1a')]&&_0xedf127[_0xc6e6('0x1a')][_0xc6e6('0x24')]){_0x3ddf6f[_0xc6e6('0x25')]=_[_0xc6e6('0x26')](_0xedf127['Interactions'][0x0],_0xc6e6('0x1c'));_0x3ddf6f['Contact']=_0xedf127[_0xc6e6('0x1a')][0x0][_0xc6e6('0x1c')];}var _0x481799={'method':_0xc6e6('0x27'),'uri':encodeURI(_0xedf127['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x481799[_0xc6e6('0x28')]){case'GET':_0x481799['qs']=_0x3ddf6f;break;case _0xc6e6('0x27'):_0x481799['body']=_0x3ddf6f;break;}return rp(_0x481799)[_0xc6e6('0x1e')](function(_0x16dcd9){logger[_0xc6e6('0x29')](_0xc6e6('0x20'),_0xc6e6('0x21'),util['format'](_0xc6e6('0x2a'),_0x3ddf6f['id'],_0xedf127[_0xc6e6('0x1f')]));if(_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]&&_0x16dcd9['body'][_0xc6e6('0x2b')]!=_0x3ddf6f['Interaction'][_0xc6e6('0x2b')]){return _0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x14')]({'threadId':_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]},{'logging':!![],'where':{'id':_0x3ddf6f[_0xc6e6('0x25')]['id']}});}else{return;}})[_0xc6e6('0x1e')](function(){return _0x324f05[_0xc6e6('0x14')]({'read':!![]});})[_0xc6e6('0x2c')](function(_0x1eb477){logger[_0xc6e6('0x16')](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x2d')](_0x1eb477,{'showHidden':![],'depth':null}));_0x172aa9();});}else{_0x172aa9();}})[_0xc6e6('0x2e')](function(){_0x172aa9();});}else{_0x172aa9();}}},'charset':_0xc6e6('0x2f'),'collate':_0xc6e6('0x30')});}; \ No newline at end of file +var _0x9c00=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','describe','OpenchannelAccountId','Interactions','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','Contact','POST','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','finally','utf8mb4_unicode_ci'];(function(_0xe9f57f,_0x2d13f6){var _0x1c3bb2=function(_0x34c6e6){while(--_0x34c6e6){_0xe9f57f['push'](_0xe9f57f['shift']());}};_0x1c3bb2(++_0x2d13f6);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2e890e,_0x1a22b7){_0x2e890e=_0x2e890e-0x0;var _0x5d2b7f=_0x9c00[_0x2e890e];return _0x5d2b7f;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x09c0('0x2'));var BPromise=require(_0x09c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09c0('0x4'));var rimraf=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var attributes=require(_0x09c0('0x7'));module[_0x09c0('0x8')]=function(_0x5914eb,_0x4d5fc3){return _0x5914eb[_0x09c0('0x9')](_0x09c0('0xa'),attributes,{'tableName':_0x09c0('0xb'),'paranoid':![],'indexes':[{'name':_0x09c0('0xc'),'fields':[_0x09c0('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6558ca,_0x1c1246,_0xa20b5c){var _0x1feb1d=_0x5914eb[_0x09c0('0xe')];var _0x1e16f4=_0x6558ca[_0x09c0('0xf')]({'plain':!![]});if(_0x1e16f4[_0x09c0('0x10')][_0x09c0('0x11')]()==='in'||_0x1e16f4[_0x09c0('0x10')][_0x09c0('0x11')]()===_0x09c0('0x12')&&!_0x1e16f4[_0x09c0('0x13')]&&!_[_0x09c0('0x14')](_0x1e16f4[_0x09c0('0x15')])){_0x1feb1d[_0x09c0('0x16')][_0x09c0('0x17')]({'where':{'id':_0x1e16f4[_0x09c0('0x18')]}})[_0x09c0('0x19')](function(_0x3649d2){if(_0x3649d2){_0x3649d2[_0x09c0('0x1a')]({'lastMsgAt':_0x1e16f4[_0x09c0('0x1b')],'lastMsgDirection':_0x1e16f4[_0x09c0('0x10')][_0x09c0('0x11')]()});}})[_0x09c0('0x1c')](function(_0x2fdf11){console['error'](_0x2fdf11);});}if(_0x1e16f4['direction']==='out'&&!_0x1e16f4[_0x09c0('0x13')]){var _0x11f4b2;_0x1feb1d[_0x09c0('0x1d')][_0x09c0('0x1e')]()['then'](function(_0x2c4440){return _0x1feb1d['OpenchannelAccount']['find']({'where':{'id':_0x1e16f4[_0x09c0('0x1f')]},'include':[{'model':_0x1feb1d['OpenchannelInteraction'],'as':_0x09c0('0x20'),'where':{'id':_0x1e16f4[_0x09c0('0x18')]},'limit':0x1,'include':[{'model':_0x1feb1d[_0x09c0('0x1d')],'as':'Contact','attributes':_[_0x09c0('0x21')](_0x2c4440)}]}]});})[_0x09c0('0x19')](function(_0x8ad645){_0x11f4b2=_0x8ad645[_0x09c0('0xf')]({'plain':!![]});if(_0x11f4b2&&_0x11f4b2[_0x09c0('0x22')]){logger[_0x09c0('0x23')](_0x09c0('0x24'),'afterCreate',util[_0x09c0('0x25')](_0x09c0('0x26'),_0x1e16f4['id'],_0x11f4b2[_0x09c0('0x22')]));if(_0x11f4b2[_0x09c0('0x20')]&&_0x11f4b2['Interactions']['length']){_0x1e16f4[_0x09c0('0x27')]=_[_0x09c0('0x28')](_0x11f4b2[_0x09c0('0x20')][0x0],_0x09c0('0x29'));_0x1e16f4['Contact']=_0x11f4b2[_0x09c0('0x20')][0x0][_0x09c0('0x29')];}var _0x1c1246={'method':_0x09c0('0x2a'),'uri':encodeURI(_0x11f4b2[_0x09c0('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1c1246[_0x09c0('0x2b')]){case _0x09c0('0x2c'):_0x1c1246['qs']=_0x1e16f4;break;case _0x09c0('0x2a'):_0x1c1246[_0x09c0('0xd')]=_0x1e16f4;break;}return rp(_0x1c1246)[_0x09c0('0x19')](function(_0x35b61c){logger[_0x09c0('0x23')](_0x09c0('0x24'),_0x09c0('0x2d'),util['format'](_0x09c0('0x2e'),_0x1e16f4['id'],_0x11f4b2[_0x09c0('0x22')]));if(_0x35b61c['body'][_0x09c0('0x2f')]&&_0x35b61c['body'][_0x09c0('0x2f')]!=_0x1e16f4['Interaction'][_0x09c0('0x2f')]){return _0x1feb1d[_0x09c0('0x16')][_0x09c0('0x1a')]({'threadId':_0x35b61c[_0x09c0('0xd')]['threadId']},{'logging':!![],'where':{'id':_0x1e16f4['Interaction']['id']}});}else{return;}})[_0x09c0('0x19')](function(){return _0x6558ca[_0x09c0('0x1a')]({'read':!![]});})[_0x09c0('0x1c')](function(_0x5c93ca){logger[_0x09c0('0x30')]('OpenchannelMessage,\x20%s,\x20%s',_0x09c0('0x2d'),util[_0x09c0('0x31')](_0x5c93ca,{'showHidden':![],'depth':null}));_0xa20b5c();});}else{_0xa20b5c();}})[_0x09c0('0x32')](function(){_0xa20b5c();});}else{_0xa20b5c();}}},'charset':'utf8mb4','collate':_0x09c0('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 93748d6..6709861 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 _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x22cdd6,_0x3001a7){var _0x3aa453=function(_0x41bdd4){while(--_0x41bdd4){_0x22cdd6['push'](_0x22cdd6['shift']());}};_0x3aa453(++_0x3001a7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x39578c,_0x23635b){_0x39578c=_0x39578c-0x0;var _0x15ee51=_0x5f2f[_0x39578c];return _0x15ee51;};'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});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xdbe1f6,_0x100047){var _0x5883d7=function(_0xd4c91c){while(--_0xd4c91c){_0xdbe1f6['push'](_0xdbe1f6['shift']());}};_0x5883d7(++_0x100047);}(_0x1261,0x144));var _0x1126=function(_0x27fe26,_0x3b8ca7){_0x27fe26=_0x27fe26-0x0;var _0x4fcb35=_0x1261[_0x27fe26];return _0x4fcb35;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index c4c8365..6171038 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 _0xd6d2=['save','update','removeListener','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x41199a,_0x24f307){var _0x143cad=function(_0x52f59a){while(--_0x52f59a){_0x41199a['push'](_0x41199a['shift']());}};_0x143cad(++_0x24f307);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x312dc0,_0x592d0e){_0x312dc0=_0x312dc0-0x0;var _0x4b2a33=_0xd6d2[_0x312dc0];return _0x4b2a33;};'use strict';var OpenchannelMessageEvents=require(_0x2d6d('0x0'));var events=[_0x2d6d('0x1'),'remove',_0x2d6d('0x2')];function createListener(_0x224caa,_0x5b4a5b){return function(_0x2c2dd9){_0x5b4a5b['emit'](_0x224caa,_0x2c2dd9);};}function removeListener(_0x1c5e54,_0x3ee519){return function(){OpenchannelMessageEvents[_0x2d6d('0x3')](_0x1c5e54,_0x3ee519);};}exports['register']=function(_0xfcdb1d){for(var _0x132361=0x0,_0xf59b20=events[_0x2d6d('0x4')];_0x132361<_0xf59b20;_0x132361++){var _0x4002b7=events[_0x132361];var _0x42d802=createListener(_0x2d6d('0x5')+_0x4002b7,_0xfcdb1d);OpenchannelMessageEvents['on'](_0x4002b7,_0x42d802);}}; \ No newline at end of file +var _0x7cbc=['emit','removeListener','length','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0x12fb2d,_0x2617b3){var _0x1dd73f=function(_0x44eacc){while(--_0x44eacc){_0x12fb2d['push'](_0x12fb2d['shift']());}};_0x1dd73f(++_0x2617b3);}(_0x7cbc,0xa4));var _0xc7cb=function(_0x2c9d9d,_0x3179bc){_0x2c9d9d=_0x2c9d9d-0x0;var _0x2553a7=_0x7cbc[_0x2c9d9d];return _0x2553a7;};'use strict';var OpenchannelMessageEvents=require(_0xc7cb('0x0'));var events=[_0xc7cb('0x1'),_0xc7cb('0x2'),_0xc7cb('0x3')];function createListener(_0x518762,_0x3e04de){return function(_0x5952fb){_0x3e04de[_0xc7cb('0x4')](_0x518762,_0x5952fb);};}function removeListener(_0x2227de,_0x20a99f){return function(){OpenchannelMessageEvents[_0xc7cb('0x5')](_0x2227de,_0x20a99f);};}exports['register']=function(_0x3819a3){for(var _0x5c0dae=0x0,_0xb91489=events[_0xc7cb('0x6')];_0x5c0dae<_0xb91489;_0x5c0dae++){var _0x53b51e=events[_0x5c0dae];var _0x56dcc9=createListener(_0xc7cb('0x7')+_0x53b51e,_0x3819a3);OpenchannelMessageEvents['on'](_0x53b51e,_0x56dcc9);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index afe8605..3cedf27 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 _0xb186=['get','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e82e4,_0x37d693){var _0x3e4771=function(_0x2e971c){while(--_0x2e971c){_0x1e82e4['push'](_0x1e82e4['shift']());}};_0x3e4771(++_0x37d693);}(_0xb186,0x1e7));var _0x6b18=function(_0x196ddc,_0x514491){_0x196ddc=_0x196ddc-0x0;var _0x5d15f2=_0xb186[_0x196ddc];return _0x5d15f2;};'use strict';var multer=require(_0x6b18('0x0'));var util=require('util');var path=require(_0x6b18('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6b18('0x2')]();var fs_extra=require(_0x6b18('0x3'));var auth=require(_0x6b18('0x4'));var interaction=require(_0x6b18('0x5'));var config=require(_0x6b18('0x6'));var controller=require('./openchannelQueue.controller');router[_0x6b18('0x7')]('/',auth[_0x6b18('0x8')](),controller['index']);router[_0x6b18('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x6b18('0x9')]);router[_0x6b18('0x7')](_0x6b18('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x6b18('0x7')](_0x6b18('0xb'),auth[_0x6b18('0x8')](),controller[_0x6b18('0xc')]);router[_0x6b18('0x7')](_0x6b18('0xd'),auth[_0x6b18('0x8')](),controller[_0x6b18('0xe')]);router[_0x6b18('0x7')](_0x6b18('0xf'),auth[_0x6b18('0x8')](),controller[_0x6b18('0x10')]);router['post']('/',auth[_0x6b18('0x8')](),controller[_0x6b18('0x11')]);router[_0x6b18('0x12')]('/:id/teams',auth[_0x6b18('0x8')](),controller['addTeams']);router[_0x6b18('0x12')](_0x6b18('0xf'),auth['isAuthenticated'](),controller['addAgents']);router[_0x6b18('0x13')](_0x6b18('0xa'),auth[_0x6b18('0x8')](),controller[_0x6b18('0x14')]);router[_0x6b18('0x15')]('/:id',auth[_0x6b18('0x8')](),controller[_0x6b18('0x16')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x6b18('0x17')]);router['delete']('/:id/users',auth[_0x6b18('0x8')](),controller[_0x6b18('0x18')]);module[_0x6b18('0x19')]=router; \ No newline at end of file +var _0x8177=['getAgents','post','create','addTeams','put','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x5f4c2b,_0x240d07){var _0x2ea5e5=function(_0xeb32a){while(--_0xeb32a){_0x5f4c2b['push'](_0x5f4c2b['shift']());}};_0x2ea5e5(++_0x240d07);}(_0x8177,0x1ca));var _0x7817=function(_0x1bbccb,_0x2e9e82){_0x1bbccb=_0x1bbccb-0x0;var _0x420c2b=_0x8177[_0x1bbccb];return _0x420c2b;};'use strict';var multer=require(_0x7817('0x0'));var util=require(_0x7817('0x1'));var path=require('path');var timeout=require(_0x7817('0x2'));var express=require(_0x7817('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7817('0x4'));var interaction=require(_0x7817('0x5'));var config=require('../../config/environment');var controller=require(_0x7817('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7817('0x7')]);router[_0x7817('0x8')](_0x7817('0x9'),auth[_0x7817('0xa')](),controller[_0x7817('0xb')]);router['get'](_0x7817('0xc'),auth['isAuthenticated'](),controller[_0x7817('0xd')]);router[_0x7817('0x8')]('/:id/members',auth[_0x7817('0xa')](),controller[_0x7817('0xe')]);router[_0x7817('0x8')](_0x7817('0xf'),auth[_0x7817('0xa')](),controller[_0x7817('0x10')]);router[_0x7817('0x8')](_0x7817('0x11'),auth[_0x7817('0xa')](),controller[_0x7817('0x12')]);router[_0x7817('0x13')]('/',auth[_0x7817('0xa')](),controller[_0x7817('0x14')]);router[_0x7817('0x13')](_0x7817('0xf'),auth[_0x7817('0xa')](),controller[_0x7817('0x15')]);router[_0x7817('0x13')](_0x7817('0x11'),auth[_0x7817('0xa')](),controller['addAgents']);router[_0x7817('0x16')](_0x7817('0xc'),auth[_0x7817('0xa')](),controller[_0x7817('0x17')]);router[_0x7817('0x18')](_0x7817('0xc'),auth[_0x7817('0xa')](),controller[_0x7817('0x19')]);router['delete'](_0x7817('0xf'),auth[_0x7817('0xa')](),controller[_0x7817('0x1a')]);router[_0x7817('0x18')](_0x7817('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x7817('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index db8dca1..84e0d87 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 _0x35f4=['rrmemory','beepall','sequelize','exports','STRING','ENUM'];(function(_0x30e5f9,_0x3c3efe){var _0x3c762b=function(_0x352708){while(--_0x352708){_0x30e5f9['push'](_0x30e5f9['shift']());}};_0x3c762b(++_0x3c3efe);}(_0x35f4,0x1a0));var _0x435f=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x35f4[_0x44a64f];return _0x52024b;};'use strict';var Sequelize=require(_0x435f('0x0'));module[_0x435f('0x1')]={'name':{'type':Sequelize[_0x435f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x435f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x435f('0x3')](_0x435f('0x4'),_0x435f('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xa2ae=['rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xa2ae,0xd2));var _0xea2a=function(_0x575c75,_0x120aa9){_0x575c75=_0x575c75-0x0;var _0x436370=_0xa2ae[_0x575c75];return _0x436370;};'use strict';var Sequelize=require(_0xea2a('0x0'));module[_0xea2a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xea2a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xea2a('0x3')]},'timeout':{'type':Sequelize[_0xea2a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea2a('0x5')](_0xea2a('0x6'),_0xea2a('0x7'),_0xea2a('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 032702e..5cfe121 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 _0xb85b=['includeAll','include','findAll','rows','keys','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','params','describe','getMembers','findOne','nolimit','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','all','union','compact','value','userOpenchannelQueue:remove','addAgents','omit','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','error','stack','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','name','query','filters','model','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x117250,_0x2e51a5){var _0xa0f14c=function(_0x462c56){while(--_0x462c56){_0x117250['push'](_0x117250['shift']());}};_0xa0f14c(++_0x2e51a5);}(_0xb85b,0xd0));var _0xbb85=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb85b[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require(_0xbb85('0x0'));var rimraf=require(_0xbb85('0x1'));var zipdir=require(_0xbb85('0x2'));var jsonpatch=require(_0xbb85('0x3'));var rp=require(_0xbb85('0x4'));var moment=require(_0xbb85('0x5'));var BPromise=require(_0xbb85('0x6'));var Mustache=require('mustache');var util=require(_0xbb85('0x7'));var path=require(_0xbb85('0x8'));var sox=require(_0xbb85('0x9'));var csv=require(_0xbb85('0xa'));var ejs=require(_0xbb85('0xb'));var fs=require('fs');var fs_extra=require(_0xbb85('0xc'));var _=require(_0xbb85('0xd'));var squel=require(_0xbb85('0xe'));var crypto=require(_0xbb85('0xf'));var jsforce=require(_0xbb85('0x10'));var deskjs=require(_0xbb85('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbb85('0x12'));var Redis=require(_0xbb85('0x13'));var authService=require(_0xbb85('0x14'));var qs=require(_0xbb85('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xbb85('0x16'));var config=require(_0xbb85('0x17'));var licenseUtil=require(_0xbb85('0x18'));var db=require(_0xbb85('0x19'))['db'];config[_0xbb85('0x1a')]=_[_0xbb85('0x1b')](config['redis'],{'host':_0xbb85('0x1c'),'port':0x18eb});var socket=require(_0xbb85('0x1d'))(new Redis(config[_0xbb85('0x1a')]));require('./openchannelQueue.socket')[_0xbb85('0x1e')](socket);function respondWithStatusCode(_0x1e6357,_0x4b0851){_0x4b0851=_0x4b0851||0xcc;return function(_0x5d48d2){if(_0x5d48d2){return _0x1e6357[_0xbb85('0x1f')](_0x4b0851);}return _0x1e6357[_0xbb85('0x20')](_0x4b0851)[_0xbb85('0x21')]();};}function respondWithResult(_0xc0fbbb,_0xd6d37d){_0xd6d37d=_0xd6d37d||0xc8;return function(_0xceb4f1){if(_0xceb4f1){return _0xc0fbbb['status'](_0xd6d37d)[_0xbb85('0x22')](_0xceb4f1);}};}function respondWithFilteredResult(_0x19c1fa,_0x2cacd0){return function(_0x26b31b){if(_0x26b31b){var _0x50cac3=typeof _0x2cacd0[_0xbb85('0x23')]==='undefined'&&typeof _0x2cacd0[_0xbb85('0x24')]===_0xbb85('0x25');var _0x2cb8f2=_0x26b31b[_0xbb85('0x26')];var _0x5b4187=_0x50cac3?0x0:_0x2cacd0['offset'];var _0x24f79f=_0x50cac3?_0x26b31b[_0xbb85('0x26')]:_0x2cacd0[_0xbb85('0x23')]+_0x2cacd0[_0xbb85('0x24')];var _0x2fa3f0;if(_0x24f79f>=_0x2cb8f2){_0x24f79f=_0x2cb8f2;_0x2fa3f0=0xc8;}else{_0x2fa3f0=0xce;}_0x19c1fa['status'](_0x2fa3f0);return _0x19c1fa[_0xbb85('0x27')](_0xbb85('0x28'),_0x5b4187+'-'+_0x24f79f+'/'+_0x2cb8f2)['json'](_0x26b31b);}return null;};}function patchUpdates(_0x7bfece){return function(_0x51cd1d){try{jsonpatch[_0xbb85('0x29')](_0x51cd1d,_0x7bfece,!![]);}catch(_0x3c6fd6){return BPromise['reject'](_0x3c6fd6);}return _0x51cd1d[_0xbb85('0x2a')]();};}function saveUpdates(_0x14d814,_0x55f66c){return function(_0x1e3e1c){if(_0x1e3e1c){return _0x1e3e1c[_0xbb85('0x2b')](_0x14d814)['then'](function(_0x279556){return _0x279556;});}return null;};}function removeEntity(_0x85463a,_0x1f1ecb){return function(_0x97cc25){if(_0x97cc25){return _0x97cc25[_0xbb85('0x2c')]()[_0xbb85('0x2d')](function(){var _0x2a5361=_0x97cc25[_0xbb85('0x2e')]({'plain':!![]});var _0x5cf2cb=_0xbb85('0x2f');return db[_0xbb85('0x30')][_0xbb85('0x2c')]({'where':{'type':_0x5cf2cb,'resourceId':_0x2a5361['id']}})[_0xbb85('0x2d')](function(){return _0x97cc25;});})[_0xbb85('0x2d')](function(){_0x85463a[_0xbb85('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x681fe2,_0x456c32){return function(_0x25ad87){if(!_0x25ad87){_0x681fe2[_0xbb85('0x1f')](0x194);}return _0x25ad87;};}function handleError(_0x573b72,_0x6f0c5a){_0x6f0c5a=_0x6f0c5a||0x1f4;return function(_0x2520d1){logger[_0xbb85('0x31')](_0x2520d1[_0xbb85('0x32')]);if(_0x2520d1['name']){delete _0x2520d1['name'];}_0x573b72[_0xbb85('0x20')](_0x6f0c5a)[_0xbb85('0x33')](_0x2520d1);};}exports[_0xbb85('0x34')]=function(_0x4ea851,_0x1f17aa){var _0x17a3a8={},_0x25e43e={},_0x3bcb05={'count':0x0,'rows':[]};var _0x281a3b=_[_0xbb85('0x35')](db[_0xbb85('0x36')][_0xbb85('0x37')],function(_0x4d60cf){return{'name':_0x4d60cf[_0xbb85('0x38')],'type':_0x4d60cf['type'][_0xbb85('0x39')]};});_0x25e43e['model']=_[_0xbb85('0x35')](_0x281a3b,_0xbb85('0x3a'));_0x25e43e['query']=_['keys'](_0x4ea851[_0xbb85('0x3b')]);_0x25e43e[_0xbb85('0x3c')]=_['intersection'](_0x25e43e[_0xbb85('0x3d')],_0x25e43e[_0xbb85('0x3b')]);_0x17a3a8[_0xbb85('0x3e')]=_[_0xbb85('0x3f')](_0x25e43e[_0xbb85('0x3d')],qs[_0xbb85('0x40')](_0x4ea851['query'][_0xbb85('0x40')]));_0x17a3a8[_0xbb85('0x3e')]=_0x17a3a8[_0xbb85('0x3e')][_0xbb85('0x41')]?_0x17a3a8[_0xbb85('0x3e')]:_0x25e43e['model'];if(!_0x4ea851[_0xbb85('0x3b')]['hasOwnProperty']('nolimit')){_0x17a3a8[_0xbb85('0x24')]=qs[_0xbb85('0x24')](_0x4ea851[_0xbb85('0x3b')][_0xbb85('0x24')]);_0x17a3a8[_0xbb85('0x23')]=qs[_0xbb85('0x23')](_0x4ea851[_0xbb85('0x3b')][_0xbb85('0x23')]);}_0x17a3a8[_0xbb85('0x42')]=qs[_0xbb85('0x43')](_0x4ea851[_0xbb85('0x3b')][_0xbb85('0x43')]);_0x17a3a8[_0xbb85('0x44')]=qs[_0xbb85('0x3c')](_[_0xbb85('0x45')](_0x4ea851[_0xbb85('0x3b')],_0x25e43e[_0xbb85('0x3c')]),_0x281a3b);if(_0x4ea851[_0xbb85('0x3b')][_0xbb85('0x46')]){_0x17a3a8[_0xbb85('0x44')]=_[_0xbb85('0x47')](_0x17a3a8['where'],{'$or':_[_0xbb85('0x35')](_0x281a3b,function(_0x59cbf7){if(_0x59cbf7[_0xbb85('0x48')]!==_0xbb85('0x49')){var _0x5577f8={};_0x5577f8[_0x59cbf7[_0xbb85('0x3a')]]={'$like':'%'+_0x4ea851['query'][_0xbb85('0x46')]+'%'};return _0x5577f8;}})});}_0x17a3a8=_[_0xbb85('0x47')]({},_0x17a3a8,_0x4ea851['options']);var _0x5e60f4={'where':_0x17a3a8[_0xbb85('0x44')]};return db['OpenchannelQueue'][_0xbb85('0x26')](_0x5e60f4)['then'](function(_0x331b52){_0x3bcb05['count']=_0x331b52;if(_0x4ea851[_0xbb85('0x3b')][_0xbb85('0x4a')]){_0x17a3a8[_0xbb85('0x4b')]=[{'all':!![]}];}return db[_0xbb85('0x36')][_0xbb85('0x4c')](_0x17a3a8);})['then'](function(_0x1421b3){_0x3bcb05[_0xbb85('0x4d')]=_0x1421b3;return _0x3bcb05;})[_0xbb85('0x2d')](respondWithFilteredResult(_0x1f17aa,_0x17a3a8))['catch'](handleError(_0x1f17aa,null));};exports['show']=function(_0xf4513c,_0x56c534){var _0x538b60={'raw':!![],'where':{'id':_0xf4513c['params']['id']}},_0x471410={};_0x471410[_0xbb85('0x3d')]=_[_0xbb85('0x4e')](db[_0xbb85('0x36')][_0xbb85('0x37')]);_0x471410[_0xbb85('0x3b')]=_[_0xbb85('0x4e')](_0xf4513c[_0xbb85('0x3b')]);_0x471410[_0xbb85('0x3c')]=_[_0xbb85('0x3f')](_0x471410[_0xbb85('0x3d')],_0x471410[_0xbb85('0x3b')]);_0x538b60[_0xbb85('0x3e')]=_[_0xbb85('0x3f')](_0x471410[_0xbb85('0x3d')],qs['fields'](_0xf4513c['query'][_0xbb85('0x40')]));_0x538b60['attributes']=_0x538b60[_0xbb85('0x3e')]['length']?_0x538b60[_0xbb85('0x3e')]:_0x471410[_0xbb85('0x3d')];if(_0xf4513c[_0xbb85('0x3b')][_0xbb85('0x4a')]){_0x538b60['include']=[{'all':!![]}];}_0x538b60=_[_0xbb85('0x47')]({},_0x538b60,_0xf4513c[_0xbb85('0x4f')]);return db['OpenchannelQueue'][_0xbb85('0x50')](_0x538b60)[_0xbb85('0x2d')](handleEntityNotFound(_0x56c534,null))['then'](respondWithResult(_0x56c534,null))[_0xbb85('0x51')](handleError(_0x56c534,null));};exports[_0xbb85('0x52')]=function(_0x1fd042,_0x212cd4){return db['OpenchannelQueue'][_0xbb85('0x52')](_0x1fd042['body'],{})[_0xbb85('0x2d')](function(_0x2c2186){var _0x2a36af=_0x1fd042[_0xbb85('0x53')][_0xbb85('0x2e')]({'plain':!![]});if(!_0x2a36af)throw new Error(_0xbb85('0x54'));if(_0x2a36af['role']===_0xbb85('0x53')){var _0x37dae5=_0x2c2186[_0xbb85('0x2e')]({'plain':!![]});var _0x4bae1c='OpenchannelQueues';return db[_0xbb85('0x55')][_0xbb85('0x50')]({'where':{'name':_0x4bae1c,'userProfileId':_0x2a36af[_0xbb85('0x56')]},'raw':!![]})[_0xbb85('0x2d')](function(_0x427e48){if(_0x427e48&&_0x427e48[_0xbb85('0x57')]===0x0){return db['UserProfileResource'][_0xbb85('0x52')]({'name':_0x37dae5['name'],'resourceId':_0x37dae5['id'],'type':_0x427e48[_0xbb85('0x3a')],'sectionId':_0x427e48['id']},{})[_0xbb85('0x2d')](function(){return _0x2c2186;});}else{return _0x2c2186;}})[_0xbb85('0x51')](function(_0x5a01d3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a01d3);throw _0x5a01d3;});}return _0x2c2186;})[_0xbb85('0x2d')](respondWithResult(_0x212cd4,0xc9))[_0xbb85('0x51')](handleError(_0x212cd4,null));};exports[_0xbb85('0x2b')]=function(_0x4a7cba,_0x522637){if(_0x4a7cba[_0xbb85('0x58')]['id']){delete _0x4a7cba[_0xbb85('0x58')]['id'];}return db['OpenchannelQueue'][_0xbb85('0x50')]({'where':{'id':_0x4a7cba[_0xbb85('0x59')]['id']}})[_0xbb85('0x2d')](handleEntityNotFound(_0x522637,null))[_0xbb85('0x2d')](saveUpdates(_0x4a7cba[_0xbb85('0x58')],null))[_0xbb85('0x2d')](respondWithResult(_0x522637,null))[_0xbb85('0x51')](handleError(_0x522637,null));};exports['destroy']=function(_0x1233e8,_0x4714cb){return db[_0xbb85('0x36')][_0xbb85('0x50')]({'where':{'id':_0x1233e8[_0xbb85('0x59')]['id']}})[_0xbb85('0x2d')](handleEntityNotFound(_0x4714cb,null))[_0xbb85('0x2d')](removeEntity(_0x4714cb,null))[_0xbb85('0x51')](handleError(_0x4714cb,null));};exports[_0xbb85('0x5a')]=function(_0x5ee6f0,_0x5a5dee){return db[_0xbb85('0x36')][_0xbb85('0x5a')]()[_0xbb85('0x2d')](respondWithResult(_0x5a5dee,null))[_0xbb85('0x51')](handleError(_0x5a5dee,null));};exports[_0xbb85('0x5b')]=function(_0x2ab645,_0x334bad,_0x2d4f2a){var _0x5f0b0d={'raw':!![],'where':{}},_0x1326ce={},_0x31b078;return db[_0xbb85('0x36')][_0xbb85('0x5c')]({'where':{'id':_0x2ab645['params']['id']}})[_0xbb85('0x2d')](handleEntityNotFound(_0x334bad,null))[_0xbb85('0x2d')](function(_0x24aecd){if(_0x24aecd){_0x31b078=_0x24aecd[_0xbb85('0x2e')]({'plain':!![]});_0x1326ce[_0xbb85('0x3d')]=_[_0xbb85('0x4e')](db['UserOpenchannelQueue'][_0xbb85('0x37')]);_0x1326ce[_0xbb85('0x3b')]=_[_0xbb85('0x4e')](_0x2ab645[_0xbb85('0x3b')]);_0x1326ce[_0xbb85('0x3c')]=_[_0xbb85('0x3f')](_0x1326ce[_0xbb85('0x3d')],_0x1326ce[_0xbb85('0x3b')]);_0x5f0b0d[_0xbb85('0x3e')]=_['intersection'](_0x1326ce[_0xbb85('0x3d')],qs[_0xbb85('0x40')](_0x2ab645[_0xbb85('0x3b')][_0xbb85('0x40')]));_0x5f0b0d['attributes']=_0x5f0b0d['attributes'][_0xbb85('0x41')]?_0x5f0b0d[_0xbb85('0x3e')]:_0x1326ce[_0xbb85('0x3d')];if(!_0x2ab645[_0xbb85('0x3b')]['hasOwnProperty'](_0xbb85('0x5d'))){_0x5f0b0d[_0xbb85('0x24')]=qs[_0xbb85('0x24')](_0x2ab645[_0xbb85('0x3b')]['limit']);_0x5f0b0d[_0xbb85('0x23')]=qs['offset'](_0x2ab645[_0xbb85('0x3b')][_0xbb85('0x23')]);}_0x5f0b0d[_0xbb85('0x42')]=qs[_0xbb85('0x43')](_0x2ab645[_0xbb85('0x3b')]['sort']);_0x5f0b0d['where']=qs[_0xbb85('0x3c')](_[_0xbb85('0x45')](_0x2ab645[_0xbb85('0x3b')],_0x1326ce[_0xbb85('0x3c')]));_0x5f0b0d['where'][_0xbb85('0x5e')]=_0x24aecd['id'];if(_0x2ab645[_0xbb85('0x3b')][_0xbb85('0x46')]){_0x5f0b0d['where']=_['merge'](_0x5f0b0d[_0xbb85('0x44')],{'$or':_[_0xbb85('0x35')](_0x5f0b0d[_0xbb85('0x3e')],function(_0x91ffe4){var _0x434e5b={};_0x434e5b[_0x91ffe4]={'$like':'%'+_0x2ab645[_0xbb85('0x3b')][_0xbb85('0x46')]+'%'};return _0x434e5b;})});}_0x5f0b0d=_[_0xbb85('0x47')]({},_0x5f0b0d,_0x2ab645[_0xbb85('0x4f')]);return db[_0xbb85('0x5f')]['findAll'](_0x5f0b0d);}})[_0xbb85('0x2d')](function(_0x40d3b1){if(_0x40d3b1){return db[_0xbb85('0x60')][_0xbb85('0x61')]({'where':{'id':_['map'](_0x40d3b1,'UserId'),'role':_0xbb85('0x62')},'attributes':['id',_0xbb85('0x3a'),_0xbb85('0x63'),_0xbb85('0x64'),_0xbb85('0x65')]});}})[_0xbb85('0x2d')](function(_0x48ad99){if(_0x48ad99){return{'count':_0x48ad99[_0xbb85('0x26')],'rows':_[_0xbb85('0x35')](_0x48ad99[_0xbb85('0x4d')],function(_0x4612cf){return{'membername':_0x4612cf[_0xbb85('0x3a')],'UserId':_0x4612cf['id'],'queue_name':_0x31b078[_0xbb85('0x3a')],'OpenchannelQueueId':_0x31b078['id'],'interface':util['format'](_0xbb85('0x66'),_0xbb85('0x67'),_0x4612cf[_0xbb85('0x3a')]),'penalty':0x0,'paused':_0x4612cf['openchannelPause'],'createdAt':_0x4612cf[_0xbb85('0x65')],'updatedAt':_0x4612cf['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbb85('0x2d')](respondWithFilteredResult(_0x334bad,_0x5f0b0d))[_0xbb85('0x51')](handleError(_0x334bad,null));};exports[_0xbb85('0x68')]=function(_0xe4b2c4,_0x3fbb68,_0x3cd152){var _0x449196={};var _0x2ff02f={};var _0x4a5b91;var _0x2effff;return db[_0xbb85('0x36')][_0xbb85('0x5c')]({'where':{'id':_0xe4b2c4[_0xbb85('0x59')]['id']}})[_0xbb85('0x2d')](handleEntityNotFound(_0x3fbb68,null))[_0xbb85('0x2d')](function(_0x19c608){if(_0x19c608){_0x4a5b91=_0x19c608;_0x2ff02f[_0xbb85('0x3d')]=_[_0xbb85('0x4e')](db[_0xbb85('0x69')][_0xbb85('0x37')]);_0x2ff02f[_0xbb85('0x3b')]=_[_0xbb85('0x4e')](_0xe4b2c4[_0xbb85('0x3b')]);_0x2ff02f['filters']=_[_0xbb85('0x3f')](_0x2ff02f[_0xbb85('0x3d')],_0x2ff02f[_0xbb85('0x3b')]);_0x449196[_0xbb85('0x3e')]=_[_0xbb85('0x3f')](_0x2ff02f['model'],qs['fields'](_0xe4b2c4[_0xbb85('0x3b')][_0xbb85('0x40')]));_0x449196['attributes']=_0x449196[_0xbb85('0x3e')][_0xbb85('0x41')]?_0x449196[_0xbb85('0x3e')]:_0x2ff02f[_0xbb85('0x3d')];_0x449196[_0xbb85('0x42')]=qs[_0xbb85('0x43')](_0xe4b2c4['query'][_0xbb85('0x43')]);_0x449196[_0xbb85('0x44')]=qs[_0xbb85('0x3c')](_[_0xbb85('0x45')](_0xe4b2c4['query'],_0x2ff02f[_0xbb85('0x3c')]));if(_0xe4b2c4[_0xbb85('0x3b')][_0xbb85('0x46')]){_0x449196[_0xbb85('0x44')]=_[_0xbb85('0x47')](_0x449196['where'],{'$or':_[_0xbb85('0x35')](_0x449196[_0xbb85('0x3e')],function(_0x1c87d6){var _0x3fc7eb={};_0x3fc7eb[_0x1c87d6]={'$like':'%'+_0xe4b2c4['query'][_0xbb85('0x46')]+'%'};return _0x3fc7eb;})});}_0x449196=_[_0xbb85('0x47')]({},_0x449196,_0xe4b2c4[_0xbb85('0x4f')]);return _0x4a5b91[_0xbb85('0x68')](_0x449196);}})['then'](function(_0x221a4e){if(_0x221a4e){_0x2effff=_0x221a4e[_0xbb85('0x41')];if(!_0xe4b2c4['query'][_0xbb85('0x6a')](_0xbb85('0x5d'))){_0x449196[_0xbb85('0x24')]=qs['limit'](_0xe4b2c4[_0xbb85('0x3b')][_0xbb85('0x24')]);_0x449196[_0xbb85('0x23')]=qs[_0xbb85('0x23')](_0xe4b2c4[_0xbb85('0x3b')][_0xbb85('0x23')]);}return _0x4a5b91[_0xbb85('0x68')](_0x449196);}})[_0xbb85('0x2d')](function(_0x1478fa){if(_0x1478fa){return _0x1478fa?{'count':_0x2effff,'rows':_0x1478fa}:null;}})['then'](respondWithResult(_0x3fbb68,null))['catch'](handleError(_0x3fbb68,null));};exports[_0xbb85('0x6b')]=function(_0x208d60,_0x6cef26,_0x15036a){var _0x561518=_0x208d60[_0xbb85('0x58')][_0xbb85('0x6c')];return db['Team'][_0xbb85('0x4c')]({'where':{'id':_0x561518},'attributes':['id'],'include':[{'model':db[_0xbb85('0x60')],'as':_0xbb85('0x6d'),'attributes':['id',_0xbb85('0x3a'),_0xbb85('0x6e'),_0xbb85('0x6f'),_0xbb85('0x70')],'raw':!![]}]})[_0xbb85('0x2d')](function(_0x52a794){if(_0x52a794){var _0x4a0767=_[_0xbb85('0x71')](_0x52a794,function(_0x24b101){var _0x3e9c02=_0x24b101[_0xbb85('0x2e')]({'plain':!![]});return _0x3e9c02[_0xbb85('0x6d')];});return db[_0xbb85('0x36')][_0xbb85('0x50')]({'where':{'id':_0x208d60[_0xbb85('0x59')]['id']}})[_0xbb85('0x2d')](function(_0x23c99e){return db['sequelize'][_0xbb85('0x72')](function(_0x58dca5){return _0x23c99e[_0xbb85('0x6b')](_0x561518,{'transaction':_0x58dca5})[_0xbb85('0x2d')](function(){return BPromise[_0xbb85('0x73')](_0x4a0767,function(_0x13860d){return db[_0xbb85('0x5f')][_0xbb85('0x74')]({'where':{'UserId':_0x13860d['id'],'OpenchannelQueueId':_0x208d60[_0xbb85('0x59')]['id']},'transaction':_0x58dca5});});})[_0xbb85('0x2d')](function(){_0x4a0767[_0xbb85('0x75')](function(_0x596faa){socket[_0xbb85('0x76')](_0xbb85('0x77'),{'UserId':_0x596faa['id'],'OpenchannelQueueId':_0x23c99e['id']});});});});});}})['then'](respondWithStatusCode(_0x6cef26,null))[_0xbb85('0x51')](handleError(_0x6cef26,null));};exports['removeTeams']=function(_0x5be3fa,_0x5028c2,_0x3be9c8){return db[_0xbb85('0x69')]['findAll']({'where':{'id':_0x5be3fa[_0xbb85('0x3b')][_0xbb85('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xbb85('0x60')],'as':_0xbb85('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5028c2,null))[_0xbb85('0x2d')](function(_0x4582f8){var _0x71dfa4=_[_0xbb85('0x35')](_0x4582f8,'id');var _0x39fb0b=[];var _0xef47e1=[];var _0x59f52f=squel[_0xbb85('0x78')]();_0x59f52f['field']('tq.TeamId')['from'](_0xbb85('0x79'),'tq')[_0xbb85('0x7a')](_0xbb85('0x7b'),'ut',_0xbb85('0x7c'))[_0xbb85('0x44')](_0xbb85('0x7d'),_0x5be3fa['params']['id']);for(var _0x2c9a32=0x0;_0x2c9a32<_0x4582f8[_0xbb85('0x41')];_0x2c9a32+=0x1){let _0x2e6d94=_0x4582f8[_0x2c9a32];for(var _0x2b1359=0x0;_0x2b1359<_0x2e6d94[_0xbb85('0x6d')][_0xbb85('0x41')];_0x2b1359+=0x1){let _0x35639a=_0x2e6d94[_0xbb85('0x6d')][_0x2b1359];var _0xf8ea26=_0x59f52f['clone']();_0xf8ea26[_0xbb85('0x44')]('ut.UserId\x20=\x20?',_0x35639a['id']);_0xef47e1[_0xbb85('0x7e')](db[_0xbb85('0x7f')]['query'](_0xf8ea26[_0xbb85('0x80')](),{'type':db[_0xbb85('0x7f')]['QueryTypes'][_0xbb85('0x81')]})[_0xbb85('0x2d')](function(_0x3e16a6){if(_0x3e16a6[_0xbb85('0x41')]===0x1){return _0x35639a['id'];}else{var _0x4130b1=_[_0xbb85('0x82')](_[_0xbb85('0x35')](_0x3e16a6,_0xbb85('0x83')),function(_0x3534b4){return _['includes'](_0x71dfa4,_0x3534b4);});if(_0x4130b1){return _0x35639a['id'];}}}));}}return BPromise[_0xbb85('0x84')](_0xef47e1)['then'](function(_0x3c9a31){_0x39fb0b=_(_0x39fb0b)[_0xbb85('0x85')](_0x3c9a31)[_0xbb85('0x86')]()[_0xbb85('0x87')]();return db[_0xbb85('0x36')][_0xbb85('0x50')]({'where':{'id':_0x5be3fa[_0xbb85('0x59')]['id']}})[_0xbb85('0x2d')](function(_0x16e4e0){return db['sequelize']['transaction'](function(_0x36b0eb){return _0x16e4e0['removeTeams'](_0x5be3fa[_0xbb85('0x3b')][_0xbb85('0x6c')],{'transaction':_0x36b0eb})[_0xbb85('0x2d')](function(){if(!_['isEmpty'](_0x39fb0b)){return _0x16e4e0['removeAgents'](_0x39fb0b,{'transaction':_0x36b0eb});}})['then'](function(){_0x39fb0b[_0xbb85('0x75')](function(_0x21422a){socket[_0xbb85('0x76')](_0xbb85('0x88'),{'UserId':_0x21422a,'OpenchannelQueueId':_0x16e4e0['id']});});});});});});})[_0xbb85('0x2d')](respondWithStatusCode(_0x5028c2,null))[_0xbb85('0x51')](handleError(_0x5028c2,null));};exports['addAgents']=function(_0x247bda,_0x4c6d57,_0x49bcda){return db[_0xbb85('0x36')][_0xbb85('0x50')]({'where':{'id':_0x247bda['params']['id']}})[_0xbb85('0x2d')](handleEntityNotFound(_0x4c6d57,null))[_0xbb85('0x2d')](function(_0x44f659){if(_0x44f659){return _0x44f659[_0xbb85('0x89')](_0x247bda[_0xbb85('0x58')][_0xbb85('0x6c')],_[_0xbb85('0x8a')](_0x247bda[_0xbb85('0x58')],[_0xbb85('0x6c'),'id'])||{})['spread'](function(_0x526e1b){for(var _0x4613d3=0x0;_0x4613d3<_0x247bda[_0xbb85('0x58')]['ids'][_0xbb85('0x41')];_0x4613d3+=0x1){socket[_0xbb85('0x76')](_0xbb85('0x77'),{'UserId':Number(_0x247bda[_0xbb85('0x58')]['ids'][_0x4613d3]),'OpenchannelQueueId':Number(_0x247bda[_0xbb85('0x59')]['id'])});}return _0x526e1b;});}})['then'](respondWithResult(_0x4c6d57,null))[_0xbb85('0x51')](handleError(_0x4c6d57,null));};exports[_0xbb85('0x8b')]=function(_0x1c6d92,_0x3fce6d,_0x312c29){return db[_0xbb85('0x36')]['find']({'where':{'id':_0x1c6d92[_0xbb85('0x59')]['id']}})[_0xbb85('0x2d')](handleEntityNotFound(_0x3fce6d,null))[_0xbb85('0x2d')](function(_0x4476d6){if(_0x4476d6){return _0x4476d6['removeAgents'](_0x1c6d92[_0xbb85('0x3b')][_0xbb85('0x6c')])[_0xbb85('0x2d')](function(){if(_['isArray'](_0x1c6d92[_0xbb85('0x3b')][_0xbb85('0x6c')])){for(var _0x3269b6=0x0;_0x3269b6<_0x1c6d92['query'][_0xbb85('0x6c')][_0xbb85('0x41')];_0x3269b6+=0x1){socket[_0xbb85('0x76')]('userOpenchannelQueue:remove',{'UserId':Number(_0x1c6d92[_0xbb85('0x3b')]['ids'][_0x3269b6]),'OpenchannelQueueId':Number(_0x1c6d92[_0xbb85('0x59')]['id'])});}}else{socket[_0xbb85('0x76')](_0xbb85('0x88'),{'UserId':Number(_0x1c6d92[_0xbb85('0x3b')][_0xbb85('0x6c')]),'OpenchannelQueueId':Number(_0x1c6d92[_0xbb85('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x3fce6d,null))[_0xbb85('0x51')](handleError(_0x3fce6d,null));};exports[_0xbb85('0x8c')]=function(_0x267e45,_0x4046f2,_0x454eab){var _0x29ef5a={};var _0x3e246c={};var _0x201760;var _0x357a0e;return db[_0xbb85('0x36')][_0xbb85('0x5c')]({'where':{'id':_0x267e45[_0xbb85('0x59')]['id']}})[_0xbb85('0x2d')](handleEntityNotFound(_0x4046f2,null))[_0xbb85('0x2d')](function(_0x34e683){if(_0x34e683){_0x201760=_0x34e683;_0x3e246c[_0xbb85('0x3d')]=_[_0xbb85('0x4e')](db['User']['rawAttributes']);_0x3e246c[_0xbb85('0x3b')]=_[_0xbb85('0x4e')](_0x267e45[_0xbb85('0x3b')]);_0x3e246c[_0xbb85('0x3c')]=_[_0xbb85('0x3f')](_0x3e246c[_0xbb85('0x3d')],_0x3e246c['query']);_0x29ef5a[_0xbb85('0x3e')]=_[_0xbb85('0x3f')](_0x3e246c[_0xbb85('0x3d')],qs[_0xbb85('0x40')](_0x267e45[_0xbb85('0x3b')][_0xbb85('0x40')]));_0x29ef5a[_0xbb85('0x3e')]=_0x29ef5a['attributes'][_0xbb85('0x41')]?_0x29ef5a[_0xbb85('0x3e')]:_0x3e246c[_0xbb85('0x3d')];_0x29ef5a[_0xbb85('0x42')]=qs[_0xbb85('0x43')](_0x267e45[_0xbb85('0x3b')][_0xbb85('0x43')]);_0x29ef5a[_0xbb85('0x44')]=qs['filters'](_['pick'](_0x267e45[_0xbb85('0x3b')],_0x3e246c[_0xbb85('0x3c')]));if(_0x267e45[_0xbb85('0x3b')][_0xbb85('0x46')]){_0x29ef5a['where']=_[_0xbb85('0x47')](_0x29ef5a[_0xbb85('0x44')],{'$or':_['map'](_0x29ef5a[_0xbb85('0x3e')],function(_0x3b5489){var _0x3553ce={};_0x3553ce[_0x3b5489]={'$like':'%'+_0x267e45[_0xbb85('0x3b')]['filter']+'%'};return _0x3553ce;})});}_0x29ef5a=_[_0xbb85('0x47')]({},_0x29ef5a,_0x267e45['options']);return _0x201760[_0xbb85('0x8c')](_0x29ef5a);}})['then'](function(_0x220417){if(_0x220417){_0x357a0e=_0x220417[_0xbb85('0x41')];if(!_0x267e45['query']['hasOwnProperty'](_0xbb85('0x5d'))){_0x29ef5a[_0xbb85('0x24')]=qs[_0xbb85('0x24')](_0x267e45[_0xbb85('0x3b')][_0xbb85('0x24')]);_0x29ef5a[_0xbb85('0x23')]=qs[_0xbb85('0x23')](_0x267e45['query'][_0xbb85('0x23')]);}return _0x201760[_0xbb85('0x8c')](_0x29ef5a);}})[_0xbb85('0x2d')](function(_0x3fbdfe){if(_0x3fbdfe){return _0x3fbdfe?{'count':_0x357a0e,'rows':_0x3fbdfe}:null;}})[_0xbb85('0x2d')](respondWithResult(_0x4046f2,null))[_0xbb85('0x51')](handleError(_0x4046f2,null));}; \ No newline at end of file +var _0xcec2=['userOpenchannelQueue:save','ids','field','tq.TeamId','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','removeAgents','forEach','emit','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','end','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','sendStatus','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','rawAttributes','OpenchannelQueueId','UserOpenchannelQueue','User','UserId','agent','openchannelPause','format','SIP','createdAt','updatedAt','getTeams','addTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0xcec2,0x1db));var _0x2cec=function(_0x12ab90,_0x582eb6){_0x12ab90=_0x12ab90-0x0;var _0x49dd65=_0xcec2[_0x12ab90];return _0x49dd65;};'use strict';var emlformat=require(_0x2cec('0x0'));var rimraf=require(_0x2cec('0x1'));var zipdir=require(_0x2cec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cec('0x3'));var moment=require(_0x2cec('0x4'));var BPromise=require(_0x2cec('0x5'));var Mustache=require(_0x2cec('0x6'));var util=require('util');var path=require(_0x2cec('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2cec('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cec('0x9'));var squel=require(_0x2cec('0xa'));var crypto=require(_0x2cec('0xb'));var jsforce=require(_0x2cec('0xc'));var deskjs=require(_0x2cec('0xd'));var toCsv=require(_0x2cec('0xe'));var querystring=require(_0x2cec('0xf'));var Papa=require('papaparse');var Redis=require(_0x2cec('0x10'));var authService=require(_0x2cec('0x11'));var qs=require(_0x2cec('0x12'));var as=require(_0x2cec('0x13'));var hardwareService=require(_0x2cec('0x14'));var logger=require(_0x2cec('0x15'))(_0x2cec('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2cec('0x17'));var db=require('../../mysqldb')['db'];config[_0x2cec('0x18')]=_[_0x2cec('0x19')](config[_0x2cec('0x18')],{'host':_0x2cec('0x1a'),'port':0x18eb});var socket=require(_0x2cec('0x1b'))(new Redis(config[_0x2cec('0x18')]));require(_0x2cec('0x1c'))[_0x2cec('0x1d')](socket);function respondWithStatusCode(_0x2a6a1b,_0x3bc6e7){_0x3bc6e7=_0x3bc6e7||0xcc;return function(_0x46df0a){if(_0x46df0a){return _0x2a6a1b['sendStatus'](_0x3bc6e7);}return _0x2a6a1b['status'](_0x3bc6e7)[_0x2cec('0x1e')]();};}function respondWithResult(_0x47d87c,_0x1f59bb){_0x1f59bb=_0x1f59bb||0xc8;return function(_0x8b5601){if(_0x8b5601){return _0x47d87c[_0x2cec('0x1f')](_0x1f59bb)['json'](_0x8b5601);}};}function respondWithFilteredResult(_0x42b0a3,_0x4ca3ba){return function(_0x3f13be){if(_0x3f13be){var _0x10f5f9=typeof _0x4ca3ba[_0x2cec('0x20')]==='undefined'&&typeof _0x4ca3ba[_0x2cec('0x21')]===_0x2cec('0x22');var _0x11cc7d=_0x3f13be[_0x2cec('0x23')];var _0x10b913=_0x10f5f9?0x0:_0x4ca3ba[_0x2cec('0x20')];var _0x21d256=_0x10f5f9?_0x3f13be[_0x2cec('0x23')]:_0x4ca3ba[_0x2cec('0x20')]+_0x4ca3ba['limit'];var _0x542782;if(_0x21d256>=_0x11cc7d){_0x21d256=_0x11cc7d;_0x542782=0xc8;}else{_0x542782=0xce;}_0x42b0a3[_0x2cec('0x1f')](_0x542782);return _0x42b0a3[_0x2cec('0x24')](_0x2cec('0x25'),_0x10b913+'-'+_0x21d256+'/'+_0x11cc7d)['json'](_0x3f13be);}return null;};}function patchUpdates(_0x11aa02){return function(_0x4da7f0){try{jsonpatch[_0x2cec('0x26')](_0x4da7f0,_0x11aa02,!![]);}catch(_0xc3ad7c){return BPromise[_0x2cec('0x27')](_0xc3ad7c);}return _0x4da7f0[_0x2cec('0x28')]();};}function saveUpdates(_0x4db443,_0x58a48f){return function(_0x41c5f8){if(_0x41c5f8){return _0x41c5f8[_0x2cec('0x29')](_0x4db443)[_0x2cec('0x2a')](function(_0x3c9223){return _0x3c9223;});}return null;};}function removeEntity(_0x5f1bf4,_0x3a32e2){return function(_0x1893a1){if(_0x1893a1){return _0x1893a1[_0x2cec('0x2b')]()['then'](function(){var _0x58536a=_0x1893a1['get']({'plain':!![]});var _0x1fb913=_0x2cec('0x2c');return db[_0x2cec('0x2d')][_0x2cec('0x2b')]({'where':{'type':_0x1fb913,'resourceId':_0x58536a['id']}})[_0x2cec('0x2a')](function(){return _0x1893a1;});})['then'](function(){_0x5f1bf4[_0x2cec('0x1f')](0xcc)[_0x2cec('0x1e')]();});}};}function handleEntityNotFound(_0x3122a7,_0x297dfc){return function(_0x95ee7c){if(!_0x95ee7c){_0x3122a7[_0x2cec('0x2e')](0x194);}return _0x95ee7c;};}function handleError(_0x471041,_0x827ebc){_0x827ebc=_0x827ebc||0x1f4;return function(_0x8eb883){logger['error'](_0x8eb883[_0x2cec('0x2f')]);if(_0x8eb883['name']){delete _0x8eb883[_0x2cec('0x30')];}_0x471041['status'](_0x827ebc)[_0x2cec('0x31')](_0x8eb883);};}exports[_0x2cec('0x32')]=function(_0x2fe0b9,_0x1f81a9){var _0x1e6c65={},_0x466026={},_0x440a57={'count':0x0,'rows':[]};var _0x11a80b=_[_0x2cec('0x33')](db['OpenchannelQueue']['rawAttributes'],function(_0x466b89){return{'name':_0x466b89[_0x2cec('0x34')],'type':_0x466b89[_0x2cec('0x35')][_0x2cec('0x36')]};});_0x466026[_0x2cec('0x37')]=_[_0x2cec('0x33')](_0x11a80b,_0x2cec('0x30'));_0x466026[_0x2cec('0x38')]=_[_0x2cec('0x39')](_0x2fe0b9['query']);_0x466026[_0x2cec('0x3a')]=_[_0x2cec('0x3b')](_0x466026[_0x2cec('0x37')],_0x466026['query']);_0x1e6c65[_0x2cec('0x3c')]=_[_0x2cec('0x3b')](_0x466026[_0x2cec('0x37')],qs['fields'](_0x2fe0b9['query'][_0x2cec('0x3d')]));_0x1e6c65[_0x2cec('0x3c')]=_0x1e6c65[_0x2cec('0x3c')][_0x2cec('0x3e')]?_0x1e6c65[_0x2cec('0x3c')]:_0x466026[_0x2cec('0x37')];if(!_0x2fe0b9[_0x2cec('0x38')][_0x2cec('0x3f')](_0x2cec('0x40'))){_0x1e6c65['limit']=qs[_0x2cec('0x21')](_0x2fe0b9[_0x2cec('0x38')][_0x2cec('0x21')]);_0x1e6c65[_0x2cec('0x20')]=qs[_0x2cec('0x20')](_0x2fe0b9[_0x2cec('0x38')][_0x2cec('0x20')]);}_0x1e6c65[_0x2cec('0x41')]=qs[_0x2cec('0x42')](_0x2fe0b9[_0x2cec('0x38')][_0x2cec('0x42')]);_0x1e6c65[_0x2cec('0x43')]=qs[_0x2cec('0x3a')](_[_0x2cec('0x44')](_0x2fe0b9[_0x2cec('0x38')],_0x466026[_0x2cec('0x3a')]),_0x11a80b);if(_0x2fe0b9[_0x2cec('0x38')][_0x2cec('0x45')]){_0x1e6c65[_0x2cec('0x43')]=_[_0x2cec('0x46')](_0x1e6c65[_0x2cec('0x43')],{'$or':_[_0x2cec('0x33')](_0x11a80b,function(_0x4f8686){if(_0x4f8686['type']!==_0x2cec('0x47')){var _0xbea497={};_0xbea497[_0x4f8686[_0x2cec('0x30')]]={'$like':'%'+_0x2fe0b9[_0x2cec('0x38')][_0x2cec('0x45')]+'%'};return _0xbea497;}})});}_0x1e6c65=_[_0x2cec('0x46')]({},_0x1e6c65,_0x2fe0b9[_0x2cec('0x48')]);var _0x562188={'where':_0x1e6c65[_0x2cec('0x43')]};return db[_0x2cec('0x49')][_0x2cec('0x23')](_0x562188)[_0x2cec('0x2a')](function(_0x138b6a){_0x440a57[_0x2cec('0x23')]=_0x138b6a;if(_0x2fe0b9[_0x2cec('0x38')][_0x2cec('0x4a')]){_0x1e6c65[_0x2cec('0x4b')]=[{'all':!![]}];}return db[_0x2cec('0x49')][_0x2cec('0x4c')](_0x1e6c65);})[_0x2cec('0x2a')](function(_0x4d6d73){_0x440a57[_0x2cec('0x4d')]=_0x4d6d73;return _0x440a57;})[_0x2cec('0x2a')](respondWithFilteredResult(_0x1f81a9,_0x1e6c65))[_0x2cec('0x4e')](handleError(_0x1f81a9,null));};exports[_0x2cec('0x4f')]=function(_0x41bd65,_0x2ec896){var _0x251522={'raw':!![],'where':{'id':_0x41bd65[_0x2cec('0x50')]['id']}},_0x542e17={};_0x542e17['model']=_[_0x2cec('0x39')](db[_0x2cec('0x49')]['rawAttributes']);_0x542e17['query']=_['keys'](_0x41bd65[_0x2cec('0x38')]);_0x542e17[_0x2cec('0x3a')]=_[_0x2cec('0x3b')](_0x542e17[_0x2cec('0x37')],_0x542e17[_0x2cec('0x38')]);_0x251522[_0x2cec('0x3c')]=_['intersection'](_0x542e17[_0x2cec('0x37')],qs[_0x2cec('0x3d')](_0x41bd65[_0x2cec('0x38')][_0x2cec('0x3d')]));_0x251522['attributes']=_0x251522[_0x2cec('0x3c')][_0x2cec('0x3e')]?_0x251522['attributes']:_0x542e17[_0x2cec('0x37')];if(_0x41bd65['query']['includeAll']){_0x251522[_0x2cec('0x4b')]=[{'all':!![]}];}_0x251522=_[_0x2cec('0x46')]({},_0x251522,_0x41bd65[_0x2cec('0x48')]);return db[_0x2cec('0x49')][_0x2cec('0x51')](_0x251522)[_0x2cec('0x2a')](handleEntityNotFound(_0x2ec896,null))[_0x2cec('0x2a')](respondWithResult(_0x2ec896,null))[_0x2cec('0x4e')](handleError(_0x2ec896,null));};exports[_0x2cec('0x52')]=function(_0x5420ef,_0x42c249){return db['OpenchannelQueue'][_0x2cec('0x52')](_0x5420ef[_0x2cec('0x53')],{})[_0x2cec('0x2a')](function(_0x355404){var _0x55d562=_0x5420ef[_0x2cec('0x54')]['get']({'plain':!![]});if(!_0x55d562)throw new Error(_0x2cec('0x55'));if(_0x55d562[_0x2cec('0x56')]==='user'){var _0x2947d6=_0x355404[_0x2cec('0x57')]({'plain':!![]});var _0x197d17=_0x2cec('0x2c');return db['UserProfileSection'][_0x2cec('0x51')]({'where':{'name':_0x197d17,'userProfileId':_0x55d562[_0x2cec('0x58')]},'raw':!![]})['then'](function(_0x2edd80){if(_0x2edd80&&_0x2edd80[_0x2cec('0x59')]===0x0){return db[_0x2cec('0x2d')][_0x2cec('0x52')]({'name':_0x2947d6['name'],'resourceId':_0x2947d6['id'],'type':_0x2edd80[_0x2cec('0x30')],'sectionId':_0x2edd80['id']},{})[_0x2cec('0x2a')](function(){return _0x355404;});}else{return _0x355404;}})[_0x2cec('0x4e')](function(_0x2cee8f){logger[_0x2cec('0x5a')](_0x2cec('0x5b'),_0x2cee8f);throw _0x2cee8f;});}return _0x355404;})['then'](respondWithResult(_0x42c249,0xc9))[_0x2cec('0x4e')](handleError(_0x42c249,null));};exports['update']=function(_0x2e3bc1,_0x2e08c4){if(_0x2e3bc1['body']['id']){delete _0x2e3bc1[_0x2cec('0x53')]['id'];}return db['OpenchannelQueue'][_0x2cec('0x51')]({'where':{'id':_0x2e3bc1[_0x2cec('0x50')]['id']}})['then'](handleEntityNotFound(_0x2e08c4,null))['then'](saveUpdates(_0x2e3bc1[_0x2cec('0x53')],null))[_0x2cec('0x2a')](respondWithResult(_0x2e08c4,null))[_0x2cec('0x4e')](handleError(_0x2e08c4,null));};exports[_0x2cec('0x2b')]=function(_0x17357,_0x579b6d){return db[_0x2cec('0x49')][_0x2cec('0x51')]({'where':{'id':_0x17357[_0x2cec('0x50')]['id']}})[_0x2cec('0x2a')](handleEntityNotFound(_0x579b6d,null))[_0x2cec('0x2a')](removeEntity(_0x579b6d,null))[_0x2cec('0x4e')](handleError(_0x579b6d,null));};exports[_0x2cec('0x5c')]=function(_0x509945,_0x171737){return db['OpenchannelQueue'][_0x2cec('0x5c')]()[_0x2cec('0x2a')](respondWithResult(_0x171737,null))['catch'](handleError(_0x171737,null));};exports[_0x2cec('0x5d')]=function(_0x146595,_0x2d9774,_0x577cdc){var _0xa80062={'raw':!![],'where':{}},_0xaf1393={},_0x2af410;return db[_0x2cec('0x49')][_0x2cec('0x5e')]({'where':{'id':_0x146595[_0x2cec('0x50')]['id']}})[_0x2cec('0x2a')](handleEntityNotFound(_0x2d9774,null))[_0x2cec('0x2a')](function(_0x47d21c){if(_0x47d21c){_0x2af410=_0x47d21c[_0x2cec('0x57')]({'plain':!![]});_0xaf1393[_0x2cec('0x37')]=_['keys'](db['UserOpenchannelQueue'][_0x2cec('0x5f')]);_0xaf1393[_0x2cec('0x38')]=_['keys'](_0x146595[_0x2cec('0x38')]);_0xaf1393[_0x2cec('0x3a')]=_['intersection'](_0xaf1393['model'],_0xaf1393['query']);_0xa80062[_0x2cec('0x3c')]=_[_0x2cec('0x3b')](_0xaf1393[_0x2cec('0x37')],qs[_0x2cec('0x3d')](_0x146595['query'][_0x2cec('0x3d')]));_0xa80062[_0x2cec('0x3c')]=_0xa80062[_0x2cec('0x3c')][_0x2cec('0x3e')]?_0xa80062[_0x2cec('0x3c')]:_0xaf1393[_0x2cec('0x37')];if(!_0x146595['query']['hasOwnProperty'](_0x2cec('0x40'))){_0xa80062[_0x2cec('0x21')]=qs[_0x2cec('0x21')](_0x146595[_0x2cec('0x38')][_0x2cec('0x21')]);_0xa80062[_0x2cec('0x20')]=qs[_0x2cec('0x20')](_0x146595[_0x2cec('0x38')][_0x2cec('0x20')]);}_0xa80062['order']=qs[_0x2cec('0x42')](_0x146595[_0x2cec('0x38')]['sort']);_0xa80062['where']=qs['filters'](_[_0x2cec('0x44')](_0x146595[_0x2cec('0x38')],_0xaf1393['filters']));_0xa80062[_0x2cec('0x43')][_0x2cec('0x60')]=_0x47d21c['id'];if(_0x146595[_0x2cec('0x38')]['filter']){_0xa80062[_0x2cec('0x43')]=_[_0x2cec('0x46')](_0xa80062[_0x2cec('0x43')],{'$or':_[_0x2cec('0x33')](_0xa80062[_0x2cec('0x3c')],function(_0x58cf3c){var _0xd55218={};_0xd55218[_0x58cf3c]={'$like':'%'+_0x146595[_0x2cec('0x38')][_0x2cec('0x45')]+'%'};return _0xd55218;})});}_0xa80062=_['merge']({},_0xa80062,_0x146595['options']);return db[_0x2cec('0x61')][_0x2cec('0x4c')](_0xa80062);}})['then'](function(_0x561db6){if(_0x561db6){return db[_0x2cec('0x62')]['findAndCountAll']({'where':{'id':_[_0x2cec('0x33')](_0x561db6,_0x2cec('0x63')),'role':_0x2cec('0x64')},'attributes':['id',_0x2cec('0x30'),_0x2cec('0x65'),'updatedAt','createdAt']});}})['then'](function(_0x1e9308){if(_0x1e9308){return{'count':_0x1e9308[_0x2cec('0x23')],'rows':_[_0x2cec('0x33')](_0x1e9308[_0x2cec('0x4d')],function(_0x3709eb){return{'membername':_0x3709eb[_0x2cec('0x30')],'UserId':_0x3709eb['id'],'queue_name':_0x2af410[_0x2cec('0x30')],'OpenchannelQueueId':_0x2af410['id'],'interface':util[_0x2cec('0x66')]('%s/%s',_0x2cec('0x67'),_0x3709eb[_0x2cec('0x30')]),'penalty':0x0,'paused':_0x3709eb[_0x2cec('0x65')],'createdAt':_0x3709eb[_0x2cec('0x68')],'updatedAt':_0x3709eb[_0x2cec('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2cec('0x2a')](respondWithFilteredResult(_0x2d9774,_0xa80062))[_0x2cec('0x4e')](handleError(_0x2d9774,null));};exports['getTeams']=function(_0x5ed0e0,_0x49c8f2,_0x2450e6){var _0x580125={};var _0x5b460b={};var _0x1b08dd;var _0x336ccf;return db['OpenchannelQueue'][_0x2cec('0x5e')]({'where':{'id':_0x5ed0e0['params']['id']}})[_0x2cec('0x2a')](handleEntityNotFound(_0x49c8f2,null))['then'](function(_0x2d35fc){if(_0x2d35fc){_0x1b08dd=_0x2d35fc;_0x5b460b['model']=_[_0x2cec('0x39')](db['Team'][_0x2cec('0x5f')]);_0x5b460b['query']=_[_0x2cec('0x39')](_0x5ed0e0['query']);_0x5b460b[_0x2cec('0x3a')]=_[_0x2cec('0x3b')](_0x5b460b[_0x2cec('0x37')],_0x5b460b[_0x2cec('0x38')]);_0x580125[_0x2cec('0x3c')]=_[_0x2cec('0x3b')](_0x5b460b[_0x2cec('0x37')],qs[_0x2cec('0x3d')](_0x5ed0e0[_0x2cec('0x38')][_0x2cec('0x3d')]));_0x580125[_0x2cec('0x3c')]=_0x580125[_0x2cec('0x3c')][_0x2cec('0x3e')]?_0x580125[_0x2cec('0x3c')]:_0x5b460b['model'];_0x580125[_0x2cec('0x41')]=qs['sort'](_0x5ed0e0[_0x2cec('0x38')][_0x2cec('0x42')]);_0x580125[_0x2cec('0x43')]=qs[_0x2cec('0x3a')](_['pick'](_0x5ed0e0['query'],_0x5b460b[_0x2cec('0x3a')]));if(_0x5ed0e0[_0x2cec('0x38')][_0x2cec('0x45')]){_0x580125[_0x2cec('0x43')]=_['merge'](_0x580125[_0x2cec('0x43')],{'$or':_[_0x2cec('0x33')](_0x580125[_0x2cec('0x3c')],function(_0x4cf371){var _0x396b66={};_0x396b66[_0x4cf371]={'$like':'%'+_0x5ed0e0[_0x2cec('0x38')][_0x2cec('0x45')]+'%'};return _0x396b66;})});}_0x580125=_[_0x2cec('0x46')]({},_0x580125,_0x5ed0e0[_0x2cec('0x48')]);return _0x1b08dd[_0x2cec('0x6a')](_0x580125);}})[_0x2cec('0x2a')](function(_0x113fad){if(_0x113fad){_0x336ccf=_0x113fad[_0x2cec('0x3e')];if(!_0x5ed0e0[_0x2cec('0x38')][_0x2cec('0x3f')](_0x2cec('0x40'))){_0x580125[_0x2cec('0x21')]=qs[_0x2cec('0x21')](_0x5ed0e0[_0x2cec('0x38')][_0x2cec('0x21')]);_0x580125['offset']=qs[_0x2cec('0x20')](_0x5ed0e0[_0x2cec('0x38')][_0x2cec('0x20')]);}return _0x1b08dd[_0x2cec('0x6a')](_0x580125);}})[_0x2cec('0x2a')](function(_0x53f5b1){if(_0x53f5b1){return _0x53f5b1?{'count':_0x336ccf,'rows':_0x53f5b1}:null;}})[_0x2cec('0x2a')](respondWithResult(_0x49c8f2,null))[_0x2cec('0x4e')](handleError(_0x49c8f2,null));};exports[_0x2cec('0x6b')]=function(_0x48712b,_0x436913,_0x123018){var _0x35e263=_0x48712b[_0x2cec('0x53')]['ids'];return db[_0x2cec('0x6c')]['findAll']({'where':{'id':_0x35e263},'attributes':['id'],'include':[{'model':db[_0x2cec('0x62')],'as':_0x2cec('0x6d'),'attributes':['id',_0x2cec('0x30'),_0x2cec('0x6e'),'voicePause',_0x2cec('0x6f')],'raw':!![]}]})[_0x2cec('0x2a')](function(_0x357333){if(_0x357333){var _0xbbed89=_[_0x2cec('0x70')](_0x357333,function(_0x303db0){var _0x3169c1=_0x303db0[_0x2cec('0x57')]({'plain':!![]});return _0x3169c1[_0x2cec('0x6d')];});return db[_0x2cec('0x49')][_0x2cec('0x51')]({'where':{'id':_0x48712b['params']['id']}})[_0x2cec('0x2a')](function(_0x15df67){return db[_0x2cec('0x71')][_0x2cec('0x72')](function(_0x3e9b67){return _0x15df67[_0x2cec('0x6b')](_0x35e263,{'transaction':_0x3e9b67})[_0x2cec('0x2a')](function(){return BPromise[_0x2cec('0x73')](_0xbbed89,function(_0x11af1e){return db[_0x2cec('0x61')][_0x2cec('0x74')]({'where':{'UserId':_0x11af1e['id'],'OpenchannelQueueId':_0x48712b[_0x2cec('0x50')]['id']},'transaction':_0x3e9b67});});})[_0x2cec('0x2a')](function(){_0xbbed89['forEach'](function(_0x3241d1){socket['emit'](_0x2cec('0x75'),{'UserId':_0x3241d1['id'],'OpenchannelQueueId':_0x15df67['id']});});});});});}})[_0x2cec('0x2a')](respondWithStatusCode(_0x436913,null))[_0x2cec('0x4e')](handleError(_0x436913,null));};exports['removeTeams']=function(_0x50ef03,_0x4aebdf,_0x10e902){return db[_0x2cec('0x6c')][_0x2cec('0x4c')]({'where':{'id':_0x50ef03[_0x2cec('0x38')][_0x2cec('0x76')]},'attributes':['id'],'include':[{'model':db[_0x2cec('0x62')],'as':_0x2cec('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4aebdf,null))[_0x2cec('0x2a')](function(_0x503393){var _0x1caad3=_[_0x2cec('0x33')](_0x503393,'id');var _0x4d7000=[];var _0x12c3f8=[];var _0x532de0=squel['select']();_0x532de0[_0x2cec('0x77')](_0x2cec('0x78'))['from'](_0x2cec('0x79'),'tq')['join'](_0x2cec('0x7a'),'ut',_0x2cec('0x7b'))[_0x2cec('0x43')](_0x2cec('0x7c'),_0x50ef03['params']['id']);for(var _0x54fd2f=0x0;_0x54fd2f<_0x503393[_0x2cec('0x3e')];_0x54fd2f+=0x1){let _0x57989f=_0x503393[_0x54fd2f];for(var _0x78c9cd=0x0;_0x78c9cd<_0x57989f['Agents'][_0x2cec('0x3e')];_0x78c9cd+=0x1){let _0x221a4e=_0x57989f[_0x2cec('0x6d')][_0x78c9cd];var _0x25fb6c=_0x532de0[_0x2cec('0x7d')]();_0x25fb6c[_0x2cec('0x43')](_0x2cec('0x7e'),_0x221a4e['id']);_0x12c3f8[_0x2cec('0x7f')](db[_0x2cec('0x71')][_0x2cec('0x38')](_0x25fb6c[_0x2cec('0x80')](),{'type':db[_0x2cec('0x71')][_0x2cec('0x81')][_0x2cec('0x82')]})['then'](function(_0x4ad2ce){if(_0x4ad2ce[_0x2cec('0x3e')]===0x1){return _0x221a4e['id'];}else{var _0x4ccfbc=_[_0x2cec('0x83')](_[_0x2cec('0x33')](_0x4ad2ce,_0x2cec('0x84')),function(_0x3d8ba7){return _[_0x2cec('0x85')](_0x1caad3,_0x3d8ba7);});if(_0x4ccfbc){return _0x221a4e['id'];}}}));}}return BPromise[_0x2cec('0x86')](_0x12c3f8)[_0x2cec('0x2a')](function(_0x254001){_0x4d7000=_(_0x4d7000)[_0x2cec('0x87')](_0x254001)[_0x2cec('0x88')]()[_0x2cec('0x89')]();return db[_0x2cec('0x49')]['find']({'where':{'id':_0x50ef03[_0x2cec('0x50')]['id']}})[_0x2cec('0x2a')](function(_0x43bf3a){return db['sequelize'][_0x2cec('0x72')](function(_0xa0056d){return _0x43bf3a[_0x2cec('0x8a')](_0x50ef03[_0x2cec('0x38')][_0x2cec('0x76')],{'transaction':_0xa0056d})['then'](function(){if(!_['isEmpty'](_0x4d7000)){return _0x43bf3a[_0x2cec('0x8b')](_0x4d7000,{'transaction':_0xa0056d});}})[_0x2cec('0x2a')](function(){_0x4d7000[_0x2cec('0x8c')](function(_0x550e33){socket[_0x2cec('0x8d')]('userOpenchannelQueue:remove',{'UserId':_0x550e33,'OpenchannelQueueId':_0x43bf3a['id']});});});});});});})['then'](respondWithStatusCode(_0x4aebdf,null))['catch'](handleError(_0x4aebdf,null));};exports[_0x2cec('0x8e')]=function(_0x354644,_0x31a425,_0x27c673){return db['OpenchannelQueue'][_0x2cec('0x51')]({'where':{'id':_0x354644[_0x2cec('0x50')]['id']}})['then'](handleEntityNotFound(_0x31a425,null))[_0x2cec('0x2a')](function(_0x21f820){if(_0x21f820){return _0x21f820['addAgents'](_0x354644['body'][_0x2cec('0x76')],_[_0x2cec('0x8f')](_0x354644[_0x2cec('0x53')],[_0x2cec('0x76'),'id'])||{})[_0x2cec('0x90')](function(_0x423fc4){for(var _0x220dc0=0x0;_0x220dc0<_0x354644[_0x2cec('0x53')][_0x2cec('0x76')][_0x2cec('0x3e')];_0x220dc0+=0x1){socket[_0x2cec('0x8d')](_0x2cec('0x75'),{'UserId':Number(_0x354644['body'][_0x2cec('0x76')][_0x220dc0]),'OpenchannelQueueId':Number(_0x354644[_0x2cec('0x50')]['id'])});}return _0x423fc4;});}})[_0x2cec('0x2a')](respondWithResult(_0x31a425,null))[_0x2cec('0x4e')](handleError(_0x31a425,null));};exports['removeAgents']=function(_0x2b4598,_0x72cf5a,_0x31eab3){return db[_0x2cec('0x49')]['find']({'where':{'id':_0x2b4598['params']['id']}})[_0x2cec('0x2a')](handleEntityNotFound(_0x72cf5a,null))[_0x2cec('0x2a')](function(_0x4bf039){if(_0x4bf039){return _0x4bf039[_0x2cec('0x8b')](_0x2b4598[_0x2cec('0x38')][_0x2cec('0x76')])[_0x2cec('0x2a')](function(){if(_[_0x2cec('0x91')](_0x2b4598[_0x2cec('0x38')]['ids'])){for(var _0x1921dc=0x0;_0x1921dc<_0x2b4598['query']['ids']['length'];_0x1921dc+=0x1){socket[_0x2cec('0x8d')](_0x2cec('0x92'),{'UserId':Number(_0x2b4598[_0x2cec('0x38')][_0x2cec('0x76')][_0x1921dc]),'OpenchannelQueueId':Number(_0x2b4598[_0x2cec('0x50')]['id'])});}}else{socket[_0x2cec('0x8d')](_0x2cec('0x92'),{'UserId':Number(_0x2b4598['query'][_0x2cec('0x76')]),'OpenchannelQueueId':Number(_0x2b4598['params']['id'])});}});}})[_0x2cec('0x2a')](respondWithStatusCode(_0x72cf5a,null))[_0x2cec('0x4e')](handleError(_0x72cf5a,null));};exports[_0x2cec('0x93')]=function(_0x1ce45c,_0x47ca12,_0x1cbfde){var _0x2ae942={};var _0x431f01={};var _0x1a2e24;var _0x259e88;return db[_0x2cec('0x49')][_0x2cec('0x5e')]({'where':{'id':_0x1ce45c[_0x2cec('0x50')]['id']}})['then'](handleEntityNotFound(_0x47ca12,null))[_0x2cec('0x2a')](function(_0x362866){if(_0x362866){_0x1a2e24=_0x362866;_0x431f01[_0x2cec('0x37')]=_[_0x2cec('0x39')](db[_0x2cec('0x62')]['rawAttributes']);_0x431f01[_0x2cec('0x38')]=_[_0x2cec('0x39')](_0x1ce45c[_0x2cec('0x38')]);_0x431f01[_0x2cec('0x3a')]=_[_0x2cec('0x3b')](_0x431f01[_0x2cec('0x37')],_0x431f01[_0x2cec('0x38')]);_0x2ae942[_0x2cec('0x3c')]=_['intersection'](_0x431f01[_0x2cec('0x37')],qs['fields'](_0x1ce45c[_0x2cec('0x38')][_0x2cec('0x3d')]));_0x2ae942[_0x2cec('0x3c')]=_0x2ae942[_0x2cec('0x3c')][_0x2cec('0x3e')]?_0x2ae942[_0x2cec('0x3c')]:_0x431f01[_0x2cec('0x37')];_0x2ae942[_0x2cec('0x41')]=qs['sort'](_0x1ce45c['query'][_0x2cec('0x42')]);_0x2ae942[_0x2cec('0x43')]=qs['filters'](_[_0x2cec('0x44')](_0x1ce45c[_0x2cec('0x38')],_0x431f01[_0x2cec('0x3a')]));if(_0x1ce45c[_0x2cec('0x38')][_0x2cec('0x45')]){_0x2ae942[_0x2cec('0x43')]=_['merge'](_0x2ae942[_0x2cec('0x43')],{'$or':_[_0x2cec('0x33')](_0x2ae942[_0x2cec('0x3c')],function(_0x28bd1e){var _0x3792f7={};_0x3792f7[_0x28bd1e]={'$like':'%'+_0x1ce45c['query'][_0x2cec('0x45')]+'%'};return _0x3792f7;})});}_0x2ae942=_[_0x2cec('0x46')]({},_0x2ae942,_0x1ce45c[_0x2cec('0x48')]);return _0x1a2e24['getAgents'](_0x2ae942);}})['then'](function(_0x5ba8f1){if(_0x5ba8f1){_0x259e88=_0x5ba8f1['length'];if(!_0x1ce45c[_0x2cec('0x38')]['hasOwnProperty']('nolimit')){_0x2ae942['limit']=qs[_0x2cec('0x21')](_0x1ce45c['query'][_0x2cec('0x21')]);_0x2ae942[_0x2cec('0x20')]=qs[_0x2cec('0x20')](_0x1ce45c[_0x2cec('0x38')]['offset']);}return _0x1a2e24[_0x2cec('0x93')](_0x2ae942);}})[_0x2cec('0x2a')](function(_0x29216f){if(_0x29216f){return _0x29216f?{'count':_0x259e88,'rows':_0x29216f}:null;}})[_0x2cec('0x2a')](respondWithResult(_0x47ca12,null))[_0x2cec('0x4e')](handleError(_0x47ca12,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8255d0e..2d1d0d9 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 _0xfbc2=['setMaxListeners','save','update','remove','emit','exports','../../mysqldb','OpenchannelQueue'];(function(_0x252884,_0x117ddf){var _0x4de0e6=function(_0x442519){while(--_0x442519){_0x252884['push'](_0x252884['shift']());}};_0x4de0e6(++_0x117ddf);}(_0xfbc2,0x1be));var _0x2fbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfbc2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x2fbc('0x0'))['db'][_0x2fbc('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2fbc('0x2')](0x0);var events={'afterCreate':_0x2fbc('0x3'),'afterUpdate':_0x2fbc('0x4'),'afterDestroy':_0x2fbc('0x5')};function emitEvent(_0x50263c){return function(_0x45e986,_0x109d80,_0x530ba9){OpenchannelQueueEvents[_0x2fbc('0x6')](_0x50263c+':'+_0x45e986['id'],_0x45e986);OpenchannelQueueEvents[_0x2fbc('0x6')](_0x50263c,_0x45e986);_0x530ba9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x2fbc('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xc67e=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4b0403,_0x114024){var _0x439dfd=function(_0xf8d583){while(--_0xf8d583){_0x4b0403['push'](_0x4b0403['shift']());}};_0x439dfd(++_0x114024);}(_0xc67e,0xbc));var _0xec67=function(_0x377b6f,_0x245982){_0x377b6f=_0x377b6f-0x0;var _0x2cac1b=_0xc67e[_0x377b6f];return _0x2cac1b;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xec67('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xec67('0x1'),'afterUpdate':_0xec67('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1f3ca1){return function(_0x526959,_0xc02e46,_0x348ff2){OpenchannelQueueEvents[_0xec67('0x3')](_0x1f3ca1+':'+_0x526959['id'],_0x526959);OpenchannelQueueEvents['emit'](_0x1f3ca1,_0x526959);_0x348ff2(null);};}for(var e in events){if(events[_0xec67('0x4')](e)){var event=events[e];OpenchannelQueue[_0xec67('0x5')](e,emitEvent(event));}}module[_0xec67('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 741312a..1c16e5b 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 _0x323e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util'];(function(_0x5c7ca1,_0x3d7ad2){var _0x4b5779=function(_0x425a40){while(--_0x425a40){_0x5c7ca1['push'](_0x5c7ca1['shift']());}};_0x4b5779(++_0x3d7ad2);}(_0x323e,0xde));var _0xe323=function(_0x537d53,_0x26d1f0){_0x537d53=_0x537d53-0x0;var _0x1b1faa=_0x323e[_0x537d53];return _0x1b1faa;};'use strict';var _=require(_0xe323('0x0'));var util=require(_0xe323('0x1'));var logger=require(_0xe323('0x2'))(_0xe323('0x3'));var moment=require(_0xe323('0x4'));var BPromise=require(_0xe323('0x5'));var rp=require(_0xe323('0x6'));var fs=require('fs');var path=require(_0xe323('0x7'));var rimraf=require(_0xe323('0x8'));var config=require(_0xe323('0x9'));var attributes=require(_0xe323('0xa'));module[_0xe323('0xb')]=function(_0x2d13a7,_0x2b35a4){return _0x2d13a7[_0xe323('0xc')]('OpenchannelQueue',attributes,{'tableName':_0xe323('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcce8=['moment','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcce8,0x148));var _0x8cce=function(_0x276b71,_0x1425f7){_0x276b71=_0x276b71-0x0;var _0x3d214e=_0xcce8[_0x276b71];return _0x3d214e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8cce('0x0'))(_0x8cce('0x1'));var moment=require(_0x8cce('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8cce('0x3'));var config=require(_0x8cce('0x4'));var attributes=require(_0x8cce('0x5'));module[_0x8cce('0x6')]=function(_0x370946,_0x545c1d){return _0x370946[_0x8cce('0x7')](_0x8cce('0x8'),attributes,{'tableName':_0x8cce('0x9'),'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 f3f5ac9..b673bfb 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 _0x1de4=['debug','catch','ShowOpenchannelQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x39847c,_0x89dd0e){var _0x45d714=function(_0x22c294){while(--_0x22c294){_0x39847c['push'](_0x39847c['shift']());}};_0x45d714(++_0x89dd0e);}(_0x1de4,0x189));var _0x41de=function(_0x284e36,_0x5385e4){_0x284e36=_0x284e36-0x0;var _0x51e50f=_0x1de4[_0x284e36];return _0x51e50f;};'use strict';var _=require(_0x41de('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x41de('0x1'));var rs=require(_0x41de('0x2'));var fs=require('fs');var Redis=require(_0x41de('0x3'));var db=require(_0x41de('0x4'))['db'];var utils=require(_0x41de('0x5'));var logger=require(_0x41de('0x6'))(_0x41de('0x7'));var config=require(_0x41de('0x8'));var jayson=require(_0x41de('0x9'));var client=jayson[_0x41de('0xa')]['http']({'port':0x232a});config[_0x41de('0xb')]=_[_0x41de('0xc')](config[_0x41de('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x41de('0xd'))[_0x41de('0xe')](socket);function respondWithRpcPromise(_0x292767,_0x3cbb5f,_0x6a0771){return new BPromise(function(_0x4bcc07,_0x4fc706){return client[_0x41de('0xf')](_0x292767,_0x6a0771)[_0x41de('0x10')](function(_0x3b6a72){logger[_0x41de('0x11')](_0x41de('0x12'),_0x3cbb5f,_0x41de('0x13'));logger['debug'](_0x41de('0x14'),_0x3cbb5f,_0x41de('0x13'),JSON[_0x41de('0x15')](_0x3b6a72));if(_0x3b6a72[_0x41de('0x16')]){if(_0x3b6a72[_0x41de('0x16')][_0x41de('0x17')]===0x1f4){logger[_0x41de('0x16')](_0x41de('0x12'),_0x3cbb5f,_0x3b6a72[_0x41de('0x16')]['message']);return _0x4fc706(_0x3b6a72[_0x41de('0x16')][_0x41de('0x18')]);}logger['error'](_0x41de('0x12'),_0x3cbb5f,_0x3b6a72[_0x41de('0x16')][_0x41de('0x18')]);return _0x4bcc07(_0x3b6a72[_0x41de('0x16')]['message']);}else{logger[_0x41de('0x11')](_0x41de('0x12'),_0x3cbb5f,'request\x20sent');_0x4bcc07(_0x3b6a72['result'][_0x41de('0x18')]);}})['catch'](function(_0x28ef1f){logger[_0x41de('0x16')](_0x41de('0x12'),_0x3cbb5f,_0x28ef1f);_0x4fc706(_0x28ef1f);});});}exports[_0x41de('0x19')]=function(_0xbfea17){var _0x4f886b=this;return new Promise(function(_0x29d939,_0x4c7707){return db[_0x41de('0x1a')][_0x41de('0x1b')]({'raw':_0xbfea17[_0x41de('0x1c')]?_0xbfea17[_0x41de('0x1c')][_0x41de('0x1d')]===undefined?!![]:![]:!![],'where':_0xbfea17['options']?_0xbfea17[_0x41de('0x1c')][_0x41de('0x1e')]||null:null,'attributes':_0xbfea17[_0x41de('0x1c')]?_0xbfea17[_0x41de('0x1c')][_0x41de('0x1f')]||null:null,'limit':_0xbfea17[_0x41de('0x1c')]?_0xbfea17[_0x41de('0x1c')][_0x41de('0x20')]||null:null,'include':_0xbfea17[_0x41de('0x1c')]?_0xbfea17[_0x41de('0x1c')][_0x41de('0x21')]?_[_0x41de('0x22')](_0xbfea17['options']['include'],function(_0x16160f){return{'model':db[_0x16160f[_0x41de('0x23')]],'as':_0x16160f['as'],'attributes':_0x16160f[_0x41de('0x1f')],'include':_0x16160f['include']?_['map'](_0x16160f[_0x41de('0x21')],function(_0x1a31f4){return{'model':db[_0x1a31f4[_0x41de('0x23')]],'as':_0x1a31f4['as'],'attributes':_0x1a31f4[_0x41de('0x1f')],'include':_0x1a31f4[_0x41de('0x21')]?_['map'](_0x1a31f4[_0x41de('0x21')],function(_0x5c8d0a){return{'model':db[_0x5c8d0a[_0x41de('0x23')]],'as':_0x5c8d0a['as'],'attributes':_0x5c8d0a['attributes']};}):[]};}):[]};}):[]:[]})[_0x41de('0x10')](function(_0x35aa47){logger['info']('GetOpenchannelQueue',_0xbfea17);logger[_0x41de('0x24')](_0x41de('0x19'),_0xbfea17,JSON[_0x41de('0x15')](_0x35aa47));_0x29d939(_0x35aa47);})[_0x41de('0x25')](function(_0x56fcfc){logger['error'](_0x41de('0x19'),_0x56fcfc[_0x41de('0x18')],_0xbfea17);_0x4c7707(_0x4f886b['error'](0x1f4,_0x56fcfc[_0x41de('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x5238e0){var _0x167a03=this;return new Promise(function(_0x562cc1,_0x4e4c82){return db[_0x41de('0x1a')]['find']({'raw':_0x5238e0[_0x41de('0x1c')]?_0x5238e0[_0x41de('0x1c')][_0x41de('0x1d')]===undefined?!![]:![]:!![],'where':_0x5238e0[_0x41de('0x1c')]?_0x5238e0[_0x41de('0x1c')][_0x41de('0x1e')]||null:null,'attributes':_0x5238e0[_0x41de('0x1c')]?_0x5238e0[_0x41de('0x1c')][_0x41de('0x1f')]||null:null,'include':_0x5238e0[_0x41de('0x1c')]?_0x5238e0[_0x41de('0x1c')]['include']?_[_0x41de('0x22')](_0x5238e0[_0x41de('0x1c')]['include'],function(_0x363ac1){return{'model':db[_0x363ac1[_0x41de('0x23')]],'as':_0x363ac1['as'],'attributes':_0x363ac1[_0x41de('0x1f')],'include':_0x363ac1[_0x41de('0x21')]?_[_0x41de('0x22')](_0x363ac1[_0x41de('0x21')],function(_0x202478){return{'model':db[_0x202478[_0x41de('0x23')]],'as':_0x202478['as'],'attributes':_0x202478[_0x41de('0x1f')],'include':_0x202478[_0x41de('0x21')]?_[_0x41de('0x22')](_0x202478[_0x41de('0x21')],function(_0x10b962){return{'model':db[_0x10b962['model']],'as':_0x10b962['as'],'attributes':_0x10b962['attributes']};}):[]};}):[]};}):[]:[]})[_0x41de('0x10')](function(_0x7b62b9){logger[_0x41de('0x11')](_0x41de('0x26'),_0x5238e0);logger['debug'](_0x41de('0x26'),_0x5238e0,JSON[_0x41de('0x15')](_0x7b62b9));_0x562cc1(_0x7b62b9);})['catch'](function(_0x14802a){logger[_0x41de('0x16')](_0x41de('0x26'),_0x14802a[_0x41de('0x18')],_0x5238e0);_0x4e4c82(_0x167a03['error'](0x1f4,_0x14802a[_0x41de('0x18')]));});});}; \ No newline at end of file +var _0xf070=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetOpenchannelQueue','findAll','raw','options','where','attributes','limit','include','map','model','ShowOpenchannelQueue','OpenchannelQueue','lodash','util','moment'];(function(_0x15d66d,_0x99094c){var _0x3e9020=function(_0x42986b){while(--_0x42986b){_0x15d66d['push'](_0x15d66d['shift']());}};_0x3e9020(++_0x99094c);}(_0xf070,0x1d1));var _0x0f07=function(_0x126a58,_0x1c03f9){_0x126a58=_0x126a58-0x0;var _0x2d9d67=_0xf070[_0x126a58];return _0x2d9d67;};'use strict';var _=require(_0x0f07('0x0'));var util=require(_0x0f07('0x1'));var moment=require(_0x0f07('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f07('0x3'));var fs=require('fs');var Redis=require(_0x0f07('0x4'));var db=require(_0x0f07('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f07('0x6'))(_0x0f07('0x7'));var config=require(_0x0f07('0x8'));var jayson=require(_0x0f07('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x0f07('0xa')]=_[_0x0f07('0xb')](config['redis'],{'host':_0x0f07('0xc'),'port':0x18eb});var socket=require(_0x0f07('0xd'))(new Redis(config[_0x0f07('0xa')]));require(_0x0f07('0xe'))[_0x0f07('0xf')](socket);function respondWithRpcPromise(_0x5afdcb,_0x3c3f87,_0x477f2a){return new BPromise(function(_0x7305b7,_0x55eb17){return client['request'](_0x5afdcb,_0x477f2a)[_0x0f07('0x10')](function(_0x337934){logger[_0x0f07('0x11')](_0x0f07('0x12'),_0x3c3f87,_0x0f07('0x13'));logger[_0x0f07('0x14')](_0x0f07('0x15'),_0x3c3f87,_0x0f07('0x13'),JSON[_0x0f07('0x16')](_0x337934));if(_0x337934[_0x0f07('0x17')]){if(_0x337934[_0x0f07('0x17')]['code']===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x3c3f87,_0x337934[_0x0f07('0x17')][_0x0f07('0x18')]);return _0x55eb17(_0x337934['error'][_0x0f07('0x18')]);}logger[_0x0f07('0x17')](_0x0f07('0x12'),_0x3c3f87,_0x337934['error'][_0x0f07('0x18')]);return _0x7305b7(_0x337934['error'][_0x0f07('0x18')]);}else{logger[_0x0f07('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x3c3f87,_0x0f07('0x13'));_0x7305b7(_0x337934[_0x0f07('0x19')][_0x0f07('0x18')]);}})[_0x0f07('0x1a')](function(_0x12197d){logger[_0x0f07('0x17')](_0x0f07('0x12'),_0x3c3f87,_0x12197d);_0x55eb17(_0x12197d);});});}exports[_0x0f07('0x1b')]=function(_0x50a5cf){var _0x552bf2=this;return new Promise(function(_0x54169b,_0x393c39){return db['OpenchannelQueue'][_0x0f07('0x1c')]({'raw':_0x50a5cf['options']?_0x50a5cf['options'][_0x0f07('0x1d')]===undefined?!![]:![]:!![],'where':_0x50a5cf[_0x0f07('0x1e')]?_0x50a5cf['options'][_0x0f07('0x1f')]||null:null,'attributes':_0x50a5cf['options']?_0x50a5cf[_0x0f07('0x1e')][_0x0f07('0x20')]||null:null,'limit':_0x50a5cf[_0x0f07('0x1e')]?_0x50a5cf[_0x0f07('0x1e')][_0x0f07('0x21')]||null:null,'include':_0x50a5cf[_0x0f07('0x1e')]?_0x50a5cf[_0x0f07('0x1e')][_0x0f07('0x22')]?_[_0x0f07('0x23')](_0x50a5cf[_0x0f07('0x1e')][_0x0f07('0x22')],function(_0x422355){return{'model':db[_0x422355['model']],'as':_0x422355['as'],'attributes':_0x422355[_0x0f07('0x20')],'include':_0x422355[_0x0f07('0x22')]?_[_0x0f07('0x23')](_0x422355[_0x0f07('0x22')],function(_0x552e8c){return{'model':db[_0x552e8c[_0x0f07('0x24')]],'as':_0x552e8c['as'],'attributes':_0x552e8c[_0x0f07('0x20')],'include':_0x552e8c[_0x0f07('0x22')]?_[_0x0f07('0x23')](_0x552e8c[_0x0f07('0x22')],function(_0x46898c){return{'model':db[_0x46898c[_0x0f07('0x24')]],'as':_0x46898c['as'],'attributes':_0x46898c[_0x0f07('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0f07('0x10')](function(_0x500005){logger['info'](_0x0f07('0x1b'),_0x50a5cf);logger[_0x0f07('0x14')](_0x0f07('0x1b'),_0x50a5cf,JSON['stringify'](_0x500005));_0x54169b(_0x500005);})[_0x0f07('0x1a')](function(_0x3bc6de){logger[_0x0f07('0x17')](_0x0f07('0x1b'),_0x3bc6de['message'],_0x50a5cf);_0x393c39(_0x552bf2[_0x0f07('0x17')](0x1f4,_0x3bc6de[_0x0f07('0x18')]));});});};exports[_0x0f07('0x25')]=function(_0x52715b){var _0x1af11a=this;return new Promise(function(_0x1f416f,_0x5949b1){return db[_0x0f07('0x26')]['find']({'raw':_0x52715b[_0x0f07('0x1e')]?_0x52715b['options'][_0x0f07('0x1d')]===undefined?!![]:![]:!![],'where':_0x52715b[_0x0f07('0x1e')]?_0x52715b[_0x0f07('0x1e')][_0x0f07('0x1f')]||null:null,'attributes':_0x52715b['options']?_0x52715b[_0x0f07('0x1e')][_0x0f07('0x20')]||null:null,'include':_0x52715b[_0x0f07('0x1e')]?_0x52715b[_0x0f07('0x1e')][_0x0f07('0x22')]?_[_0x0f07('0x23')](_0x52715b[_0x0f07('0x1e')][_0x0f07('0x22')],function(_0x1533f9){return{'model':db[_0x1533f9[_0x0f07('0x24')]],'as':_0x1533f9['as'],'attributes':_0x1533f9[_0x0f07('0x20')],'include':_0x1533f9['include']?_[_0x0f07('0x23')](_0x1533f9[_0x0f07('0x22')],function(_0x32400e){return{'model':db[_0x32400e[_0x0f07('0x24')]],'as':_0x32400e['as'],'attributes':_0x32400e['attributes'],'include':_0x32400e[_0x0f07('0x22')]?_[_0x0f07('0x23')](_0x32400e[_0x0f07('0x22')],function(_0xd7892b){return{'model':db[_0xd7892b[_0x0f07('0x24')]],'as':_0xd7892b['as'],'attributes':_0xd7892b[_0x0f07('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0f07('0x10')](function(_0x50c6d3){logger[_0x0f07('0x11')](_0x0f07('0x25'),_0x52715b);logger[_0x0f07('0x14')](_0x0f07('0x25'),_0x52715b,JSON[_0x0f07('0x16')](_0x50c6d3));_0x1f416f(_0x50c6d3);})[_0x0f07('0x1a')](function(_0x195e1c){logger['error']('ShowOpenchannelQueue',_0x195e1c['message'],_0x52715b);_0x5949b1(_0x1af11a[_0x0f07('0x17')](0x1f4,_0x195e1c['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 619cc0a..da4a005 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 _0x1676=['removeListener','register','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit'];(function(_0x5882d9,_0x43ffd9){var _0x5624aa=function(_0x2d3633){while(--_0x2d3633){_0x5882d9['push'](_0x5882d9['shift']());}};_0x5624aa(++_0x43ffd9);}(_0x1676,0x153));var _0x6167=function(_0x2a69ec,_0x4b25d9){_0x2a69ec=_0x2a69ec-0x0;var _0x534581=_0x1676[_0x2a69ec];return _0x534581;};'use strict';var OpenchannelQueueEvents=require(_0x6167('0x0'));var events=[_0x6167('0x1'),_0x6167('0x2'),_0x6167('0x3')];function createListener(_0x520c04,_0xc0224b){return function(_0x5d738c){_0xc0224b[_0x6167('0x4')](_0x520c04,_0x5d738c);};}function removeListener(_0x2cf5c5,_0x4916a8){return function(){OpenchannelQueueEvents[_0x6167('0x5')](_0x2cf5c5,_0x4916a8);};}exports[_0x6167('0x6')]=function(_0x4eb073){for(var _0x4f3f4c=0x0,_0x1f6c5a=events['length'];_0x4f3f4c<_0x1f6c5a;_0x4f3f4c++){var _0x3f79d7=events[_0x4f3f4c];var _0x5a59be=createListener(_0x6167('0x7')+_0x3f79d7,_0x4eb073);OpenchannelQueueEvents['on'](_0x3f79d7,_0x5a59be);}}; \ No newline at end of file +var _0xcf8f=['openchannelQueue:','./openchannelQueue.events','remove','emit','removeListener'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xcf8f,0x1cd));var _0xfcf8=function(_0x3d38df,_0x17e701){_0x3d38df=_0x3d38df-0x0;var _0x5d089d=_0xcf8f[_0x3d38df];return _0x5d089d;};'use strict';var OpenchannelQueueEvents=require(_0xfcf8('0x0'));var events=['save',_0xfcf8('0x1'),'update'];function createListener(_0x4a51ce,_0x2410c7){return function(_0x3ba057){_0x2410c7[_0xfcf8('0x2')](_0x4a51ce,_0x3ba057);};}function removeListener(_0x20e873,_0x14c9e1){return function(){OpenchannelQueueEvents[_0xfcf8('0x3')](_0x20e873,_0x14c9e1);};}exports['register']=function(_0x113b9f){for(var _0x14d42d=0x0,_0x437998=events['length'];_0x14d42d<_0x437998;_0x14d42d++){var _0x629167=events[_0x14d42d];var _0x5500f6=createListener(_0xfcf8('0x4')+_0x629167,_0x113b9f);OpenchannelQueueEvents['on'](_0x629167,_0x5500f6);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 70e8085..622bd6a 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 _0xd4c2=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5b43fe,_0x3a058e){var _0x25683e=function(_0x2f6704){while(--_0x2f6704){_0x5b43fe['push'](_0x5b43fe['shift']());}};_0x25683e(++_0x3a058e);}(_0xd4c2,0xf8));var _0x2d4c=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xd4c2[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0x2d4c('0x0'));var util=require(_0x2d4c('0x1'));var path=require(_0x2d4c('0x2'));var timeout=require(_0x2d4c('0x3'));var express=require(_0x2d4c('0x4'));var router=express[_0x2d4c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4c('0x6'));var interaction=require(_0x2d4c('0x7'));var config=require(_0x2d4c('0x8'));var controller=require(_0x2d4c('0x9'));router[_0x2d4c('0xa')]('/',auth[_0x2d4c('0xb')](),controller[_0x2d4c('0xc')]);router[_0x2d4c('0xa')](_0x2d4c('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x2d4c('0xa')]('/:id',auth[_0x2d4c('0xb')](),controller['show']);router[_0x2d4c('0xe')]('/',auth[_0x2d4c('0xb')](),controller[_0x2d4c('0xf')]);router['put'](_0x2d4c('0x10'),auth[_0x2d4c('0xb')](),controller[_0x2d4c('0x11')]);router[_0x2d4c('0x12')](_0x2d4c('0x10'),auth[_0x2d4c('0xb')](),controller[_0x2d4c('0x13')]);module[_0x2d4c('0x14')]=router; \ No newline at end of file +var _0x8c9d=['delete','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','show','post','create','/:id'];(function(_0x10f659,_0x3d1409){var _0x1e3fb5=function(_0x404e24){while(--_0x404e24){_0x10f659['push'](_0x10f659['shift']());}};_0x1e3fb5(++_0x3d1409);}(_0x8c9d,0x1a1));var _0xd8c9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8c9d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd8c9('0x0'));var timeout=require(_0xd8c9('0x1'));var express=require(_0xd8c9('0x2'));var router=express['Router']();var fs_extra=require(_0xd8c9('0x3'));var auth=require(_0xd8c9('0x4'));var interaction=require(_0xd8c9('0x5'));var config=require(_0xd8c9('0x6'));var controller=require(_0xd8c9('0x7'));router['get']('/',auth[_0xd8c9('0x8')](),controller[_0xd8c9('0x9')]);router[_0xd8c9('0xa')]('/describe',auth[_0xd8c9('0x8')](),controller['describe']);router[_0xd8c9('0xa')]('/:id',auth[_0xd8c9('0x8')](),controller[_0xd8c9('0xb')]);router[_0xd8c9('0xc')]('/',auth[_0xd8c9('0x8')](),controller[_0xd8c9('0xd')]);router['put'](_0xd8c9('0xe'),auth[_0xd8c9('0x8')](),controller['update']);router[_0xd8c9('0xf')](_0xd8c9('0xe'),auth[_0xd8c9('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 116b059..1db802d 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 _0x5983=['STRING','DATE','moment','sequelize','exports'];(function(_0x5a9045,_0x79d4b8){var _0x591d46=function(_0x4cebe3){while(--_0x4cebe3){_0x5a9045['push'](_0x5a9045['shift']());}};_0x591d46(++_0x79d4b8);}(_0x5983,0x106));var _0x3598=function(_0x464db5,_0xa786e7){_0x464db5=_0x464db5-0x0;var _0x46b27f=_0x5983[_0x464db5];return _0x46b27f;};'use strict';var moment=require(_0x3598('0x0'));var Sequelize=require(_0x3598('0x1'));module[_0x3598('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3598('0x3')]},'joinAt':{'type':Sequelize[_0x3598('0x4')]},'leaveAt':{'type':Sequelize[_0x3598('0x4')]},'acceptAt':{'type':Sequelize[_0x3598('0x4')]},'exitAt':{'type':Sequelize[_0x3598('0x4')]},'reason':{'type':Sequelize[_0x3598('0x3')]}}; \ No newline at end of file +var _0x1e2a=['moment','sequelize','exports','STRING','DATE'];(function(_0x28723d,_0x4e6100){var _0x1c41a2=function(_0x45b628){while(--_0x45b628){_0x28723d['push'](_0x28723d['shift']());}};_0x1c41a2(++_0x4e6100);}(_0x1e2a,0x1c7));var _0xa1e2=function(_0x1ca85e,_0x4641b6){_0x1ca85e=_0x1ca85e-0x0;var _0xf14771=_0x1e2a[_0x1ca85e];return _0xf14771;};'use strict';var moment=require(_0xa1e2('0x0'));var Sequelize=require(_0xa1e2('0x1'));module[_0xa1e2('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa1e2('0x3')]},'joinAt':{'type':Sequelize[_0xa1e2('0x4')]},'leaveAt':{'type':Sequelize[_0xa1e2('0x4')]},'acceptAt':{'type':Sequelize[_0xa1e2('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa1e2('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index eb4cbe3..3e1cab7 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 _0xc875=['update','then','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','catch','params','length','includeAll','include','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save'];(function(_0x25a311,_0x32648c){var _0x52ef59=function(_0x21565f){while(--_0x21565f){_0x25a311['push'](_0x25a311['shift']());}};_0x52ef59(++_0x32648c);}(_0xc875,0x1e8));var _0x5c87=function(_0x274cb,_0xee62ed){_0x274cb=_0x274cb-0x0;var _0x551e07=_0xc875[_0x274cb];return _0x551e07;};'use strict';var emlformat=require(_0x5c87('0x0'));var rimraf=require(_0x5c87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c87('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5c87('0x3'));var Mustache=require('mustache');var util=require(_0x5c87('0x4'));var path=require(_0x5c87('0x5'));var sox=require(_0x5c87('0x6'));var csv=require(_0x5c87('0x7'));var ejs=require(_0x5c87('0x8'));var fs=require('fs');var fs_extra=require(_0x5c87('0x9'));var _=require('lodash');var squel=require(_0x5c87('0xa'));var crypto=require(_0x5c87('0xb'));var jsforce=require(_0x5c87('0xc'));var deskjs=require(_0x5c87('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5c87('0xe'));var Papa=require(_0x5c87('0xf'));var Redis=require(_0x5c87('0x10'));var authService=require(_0x5c87('0x11'));var qs=require(_0x5c87('0x12'));var as=require(_0x5c87('0x13'));var hardwareService=require(_0x5c87('0x14'));var logger=require(_0x5c87('0x15'))(_0x5c87('0x16'));var utils=require(_0x5c87('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5c87('0x18'));var db=require(_0x5c87('0x19'))['db'];function respondWithStatusCode(_0xcdf161,_0x3f4890){_0x3f4890=_0x3f4890||0xcc;return function(_0x2c7c54){if(_0x2c7c54){return _0xcdf161['sendStatus'](_0x3f4890);}return _0xcdf161[_0x5c87('0x1a')](_0x3f4890)[_0x5c87('0x1b')]();};}function respondWithResult(_0x737ee3,_0x30d2f3){_0x30d2f3=_0x30d2f3||0xc8;return function(_0x23eecd){if(_0x23eecd){return _0x737ee3['status'](_0x30d2f3)[_0x5c87('0x1c')](_0x23eecd);}};}function respondWithFilteredResult(_0x2a14e3,_0x506351){return function(_0x3b560b){if(_0x3b560b){var _0x184b2b=typeof _0x506351[_0x5c87('0x1d')]==='undefined'&&typeof _0x506351[_0x5c87('0x1e')]===_0x5c87('0x1f');var _0x3d9046=_0x3b560b[_0x5c87('0x20')];var _0x36485e=_0x184b2b?0x0:_0x506351[_0x5c87('0x1d')];var _0x3b85f4=_0x184b2b?_0x3b560b['count']:_0x506351[_0x5c87('0x1d')]+_0x506351[_0x5c87('0x1e')];var _0x16e500;if(_0x3b85f4>=_0x3d9046){_0x3b85f4=_0x3d9046;_0x16e500=0xc8;}else{_0x16e500=0xce;}_0x2a14e3['status'](_0x16e500);return _0x2a14e3[_0x5c87('0x21')]('Content-Range',_0x36485e+'-'+_0x3b85f4+'/'+_0x3d9046)['json'](_0x3b560b);}return null;};}function patchUpdates(_0x1f2040){return function(_0x23181f){try{jsonpatch[_0x5c87('0x22')](_0x23181f,_0x1f2040,!![]);}catch(_0x1b4cc3){return BPromise[_0x5c87('0x23')](_0x1b4cc3);}return _0x23181f[_0x5c87('0x24')]();};}function saveUpdates(_0x487a4d,_0x3bb89c){return function(_0x43eb59){if(_0x43eb59){return _0x43eb59[_0x5c87('0x25')](_0x487a4d)[_0x5c87('0x26')](function(_0x4b4543){return _0x4b4543;});}return null;};}function removeEntity(_0x39e004,_0x3164ee){return function(_0xc769ef){if(_0xc769ef){return _0xc769ef['destroy']()[_0x5c87('0x26')](function(){_0x39e004[_0x5c87('0x1a')](0xcc)[_0x5c87('0x1b')]();});}};}function handleEntityNotFound(_0x38d6e2,_0x5f0acf){return function(_0x6adc13){if(!_0x6adc13){_0x38d6e2[_0x5c87('0x27')](0x194);}return _0x6adc13;};}function handleError(_0x243a70,_0x24a25c){_0x24a25c=_0x24a25c||0x1f4;return function(_0x2de8af){logger[_0x5c87('0x28')](_0x2de8af[_0x5c87('0x29')]);if(_0x2de8af[_0x5c87('0x2a')]){delete _0x2de8af[_0x5c87('0x2a')];}_0x243a70[_0x5c87('0x1a')](_0x24a25c)[_0x5c87('0x2b')](_0x2de8af);};}exports[_0x5c87('0x2c')]=function(_0x1fd300,_0xb53d0a){var _0x422a5b={},_0x2389bb={},_0x235bae={'count':0x0,'rows':[]};var _0x5a3f41=_[_0x5c87('0x2d')](db[_0x5c87('0x2e')][_0x5c87('0x2f')],function(_0x42debd){return{'name':_0x42debd['fieldName'],'type':_0x42debd[_0x5c87('0x30')][_0x5c87('0x31')]};});_0x2389bb[_0x5c87('0x32')]=_[_0x5c87('0x2d')](_0x5a3f41,_0x5c87('0x2a'));_0x2389bb[_0x5c87('0x33')]=_[_0x5c87('0x34')](_0x1fd300[_0x5c87('0x33')]);_0x2389bb['filters']=_['intersection'](_0x2389bb[_0x5c87('0x32')],_0x2389bb[_0x5c87('0x33')]);_0x422a5b[_0x5c87('0x35')]=_[_0x5c87('0x36')](_0x2389bb[_0x5c87('0x32')],qs['fields'](_0x1fd300['query'][_0x5c87('0x37')]));_0x422a5b[_0x5c87('0x35')]=_0x422a5b[_0x5c87('0x35')]['length']?_0x422a5b['attributes']:_0x2389bb[_0x5c87('0x32')];if(!_0x1fd300[_0x5c87('0x33')][_0x5c87('0x38')](_0x5c87('0x39'))){_0x422a5b[_0x5c87('0x1e')]=qs['limit'](_0x1fd300['query'][_0x5c87('0x1e')]);_0x422a5b[_0x5c87('0x1d')]=qs[_0x5c87('0x1d')](_0x1fd300[_0x5c87('0x33')][_0x5c87('0x1d')]);}_0x422a5b['order']=qs[_0x5c87('0x3a')](_0x1fd300['query'][_0x5c87('0x3a')]);_0x422a5b[_0x5c87('0x3b')]=qs['filters'](_[_0x5c87('0x3c')](_0x1fd300[_0x5c87('0x33')],_0x2389bb[_0x5c87('0x3d')]),_0x5a3f41);if(_0x1fd300[_0x5c87('0x33')][_0x5c87('0x3e')]){_0x422a5b[_0x5c87('0x3b')]=_[_0x5c87('0x3f')](_0x422a5b[_0x5c87('0x3b')],{'$or':_[_0x5c87('0x2d')](_0x5a3f41,function(_0x55cb07){if(_0x55cb07[_0x5c87('0x30')]!=='VIRTUAL'){var _0x3ed655={};_0x3ed655[_0x55cb07[_0x5c87('0x2a')]]={'$like':'%'+_0x1fd300[_0x5c87('0x33')][_0x5c87('0x3e')]+'%'};return _0x3ed655;}})});}_0x422a5b=_[_0x5c87('0x3f')]({},_0x422a5b,_0x1fd300[_0x5c87('0x40')]);var _0x1f98dd={'where':_0x422a5b[_0x5c87('0x3b')]};return db[_0x5c87('0x2e')][_0x5c87('0x20')](_0x1f98dd)[_0x5c87('0x26')](function(_0x29ebf4){_0x235bae['count']=_0x29ebf4;if(_0x1fd300[_0x5c87('0x33')]['includeAll']){_0x422a5b['include']=[{'all':!![]}];}return db[_0x5c87('0x2e')]['findAll'](_0x422a5b);})[_0x5c87('0x26')](function(_0x339914){_0x235bae['rows']=_0x339914;return _0x235bae;})['then'](respondWithFilteredResult(_0xb53d0a,_0x422a5b))[_0x5c87('0x41')](handleError(_0xb53d0a,null));};exports['show']=function(_0x5ed51e,_0x1eb518){var _0x309c01={'raw':!![],'where':{'id':_0x5ed51e[_0x5c87('0x42')]['id']}},_0x30ed12={};_0x30ed12[_0x5c87('0x32')]=_['keys'](db[_0x5c87('0x2e')][_0x5c87('0x2f')]);_0x30ed12[_0x5c87('0x33')]=_['keys'](_0x5ed51e[_0x5c87('0x33')]);_0x30ed12[_0x5c87('0x3d')]=_[_0x5c87('0x36')](_0x30ed12[_0x5c87('0x32')],_0x30ed12[_0x5c87('0x33')]);_0x309c01[_0x5c87('0x35')]=_[_0x5c87('0x36')](_0x30ed12[_0x5c87('0x32')],qs[_0x5c87('0x37')](_0x5ed51e[_0x5c87('0x33')]['fields']));_0x309c01[_0x5c87('0x35')]=_0x309c01['attributes'][_0x5c87('0x43')]?_0x309c01[_0x5c87('0x35')]:_0x30ed12[_0x5c87('0x32')];if(_0x5ed51e[_0x5c87('0x33')][_0x5c87('0x44')]){_0x309c01[_0x5c87('0x45')]=[{'all':!![]}];}_0x309c01=_[_0x5c87('0x3f')]({},_0x309c01,_0x5ed51e['options']);return db['OpenchannelQueueReport'][_0x5c87('0x46')](_0x309c01)['then'](handleEntityNotFound(_0x1eb518,null))[_0x5c87('0x26')](respondWithResult(_0x1eb518,null))[_0x5c87('0x41')](handleError(_0x1eb518,null));};exports[_0x5c87('0x47')]=function(_0x142a5c,_0x4570f8){return db['OpenchannelQueueReport'][_0x5c87('0x47')](_0x142a5c['body'],{})[_0x5c87('0x26')](respondWithResult(_0x4570f8,0xc9))[_0x5c87('0x41')](handleError(_0x4570f8,null));};exports['update']=function(_0x13ff75,_0x348b27){if(_0x13ff75[_0x5c87('0x48')]['id']){delete _0x13ff75[_0x5c87('0x48')]['id'];}return db['OpenchannelQueueReport'][_0x5c87('0x46')]({'where':{'id':_0x13ff75['params']['id']}})['then'](handleEntityNotFound(_0x348b27,null))['then'](saveUpdates(_0x13ff75[_0x5c87('0x48')],null))['then'](respondWithResult(_0x348b27,null))[_0x5c87('0x41')](handleError(_0x348b27,null));};exports[_0x5c87('0x49')]=function(_0x4f8d04,_0x5dad4f){return db[_0x5c87('0x2e')][_0x5c87('0x46')]({'where':{'id':_0x4f8d04[_0x5c87('0x42')]['id']}})['then'](handleEntityNotFound(_0x5dad4f,null))[_0x5c87('0x26')](removeEntity(_0x5dad4f,null))[_0x5c87('0x41')](handleError(_0x5dad4f,null));};exports[_0x5c87('0x4a')]=function(_0x93a4c1,_0x351bf9){return db[_0x5c87('0x2e')][_0x5c87('0x4a')]()['then'](respondWithResult(_0x351bf9,null))[_0x5c87('0x41')](handleError(_0x351bf9,null));}; \ No newline at end of file +var _0xee6b=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x26c1be,_0x42ddf4){var _0x2f1b34=function(_0xd505c7){while(--_0xd505c7){_0x26c1be['push'](_0x26c1be['shift']());}};_0x2f1b34(++_0x42ddf4);}(_0xee6b,0x15d));var _0xbee6=function(_0x3f9ac2,_0x1b670b){_0x3f9ac2=_0x3f9ac2-0x0;var _0xe6a436=_0xee6b[_0x3f9ac2];return _0xe6a436;};'use strict';var emlformat=require(_0xbee6('0x0'));var rimraf=require(_0xbee6('0x1'));var zipdir=require(_0xbee6('0x2'));var jsonpatch=require(_0xbee6('0x3'));var rp=require(_0xbee6('0x4'));var moment=require(_0xbee6('0x5'));var BPromise=require(_0xbee6('0x6'));var Mustache=require('mustache');var util=require(_0xbee6('0x7'));var path=require(_0xbee6('0x8'));var sox=require(_0xbee6('0x9'));var csv=require(_0xbee6('0xa'));var ejs=require(_0xbee6('0xb'));var fs=require('fs');var fs_extra=require(_0xbee6('0xc'));var _=require(_0xbee6('0xd'));var squel=require(_0xbee6('0xe'));var crypto=require(_0xbee6('0xf'));var jsforce=require(_0xbee6('0x10'));var deskjs=require(_0xbee6('0x11'));var toCsv=require('to-csv');var querystring=require(_0xbee6('0x12'));var Papa=require(_0xbee6('0x13'));var Redis=require(_0xbee6('0x14'));var authService=require(_0xbee6('0x15'));var qs=require(_0xbee6('0x16'));var as=require(_0xbee6('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbee6('0x18'))(_0xbee6('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbee6('0x1a'));var db=require(_0xbee6('0x1b'))['db'];function respondWithStatusCode(_0x4539b3,_0x25d28f){_0x25d28f=_0x25d28f||0xcc;return function(_0x4d8af1){if(_0x4d8af1){return _0x4539b3[_0xbee6('0x1c')](_0x25d28f);}return _0x4539b3[_0xbee6('0x1d')](_0x25d28f)[_0xbee6('0x1e')]();};}function respondWithResult(_0x4f998e,_0x3a5f98){_0x3a5f98=_0x3a5f98||0xc8;return function(_0x596536){if(_0x596536){return _0x4f998e[_0xbee6('0x1d')](_0x3a5f98)['json'](_0x596536);}};}function respondWithFilteredResult(_0x83f7a1,_0x5d2e68){return function(_0x3497da){if(_0x3497da){var _0x502b17=typeof _0x5d2e68['offset']===_0xbee6('0x1f')&&typeof _0x5d2e68['limit']===_0xbee6('0x1f');var _0x110c76=_0x3497da[_0xbee6('0x20')];var _0x4599a9=_0x502b17?0x0:_0x5d2e68[_0xbee6('0x21')];var _0xca487=_0x502b17?_0x3497da[_0xbee6('0x20')]:_0x5d2e68['offset']+_0x5d2e68[_0xbee6('0x22')];var _0x5c8281;if(_0xca487>=_0x110c76){_0xca487=_0x110c76;_0x5c8281=0xc8;}else{_0x5c8281=0xce;}_0x83f7a1[_0xbee6('0x1d')](_0x5c8281);return _0x83f7a1[_0xbee6('0x23')](_0xbee6('0x24'),_0x4599a9+'-'+_0xca487+'/'+_0x110c76)[_0xbee6('0x25')](_0x3497da);}return null;};}function patchUpdates(_0x488639){return function(_0x1704e9){try{jsonpatch[_0xbee6('0x26')](_0x1704e9,_0x488639,!![]);}catch(_0x51e38f){return BPromise[_0xbee6('0x27')](_0x51e38f);}return _0x1704e9[_0xbee6('0x28')]();};}function saveUpdates(_0x66f4d4,_0x4f05a4){return function(_0x546a5a){if(_0x546a5a){return _0x546a5a['update'](_0x66f4d4)[_0xbee6('0x29')](function(_0x3516cb){return _0x3516cb;});}return null;};}function removeEntity(_0xc19c6,_0x481b33){return function(_0x1bf6f2){if(_0x1bf6f2){return _0x1bf6f2[_0xbee6('0x2a')]()[_0xbee6('0x29')](function(){_0xc19c6[_0xbee6('0x1d')](0xcc)[_0xbee6('0x1e')]();});}};}function handleEntityNotFound(_0x267f23,_0x3b90c6){return function(_0x5e4779){if(!_0x5e4779){_0x267f23[_0xbee6('0x1c')](0x194);}return _0x5e4779;};}function handleError(_0x31e1ef,_0x48d1f3){_0x48d1f3=_0x48d1f3||0x1f4;return function(_0x217cec){logger[_0xbee6('0x2b')](_0x217cec[_0xbee6('0x2c')]);if(_0x217cec['name']){delete _0x217cec[_0xbee6('0x2d')];}_0x31e1ef[_0xbee6('0x1d')](_0x48d1f3)[_0xbee6('0x2e')](_0x217cec);};}exports[_0xbee6('0x2f')]=function(_0x538a76,_0x5d9c0f){var _0x1386c3={},_0x42cb7f={},_0x1ea18f={'count':0x0,'rows':[]};var _0x1431b0=_[_0xbee6('0x30')](db[_0xbee6('0x31')][_0xbee6('0x32')],function(_0x5b9773){return{'name':_0x5b9773[_0xbee6('0x33')],'type':_0x5b9773[_0xbee6('0x34')][_0xbee6('0x35')]};});_0x42cb7f[_0xbee6('0x36')]=_[_0xbee6('0x30')](_0x1431b0,_0xbee6('0x2d'));_0x42cb7f[_0xbee6('0x37')]=_[_0xbee6('0x38')](_0x538a76[_0xbee6('0x37')]);_0x42cb7f[_0xbee6('0x39')]=_[_0xbee6('0x3a')](_0x42cb7f['model'],_0x42cb7f['query']);_0x1386c3[_0xbee6('0x3b')]=_[_0xbee6('0x3a')](_0x42cb7f[_0xbee6('0x36')],qs['fields'](_0x538a76[_0xbee6('0x37')][_0xbee6('0x3c')]));_0x1386c3[_0xbee6('0x3b')]=_0x1386c3[_0xbee6('0x3b')][_0xbee6('0x3d')]?_0x1386c3[_0xbee6('0x3b')]:_0x42cb7f[_0xbee6('0x36')];if(!_0x538a76['query'][_0xbee6('0x3e')](_0xbee6('0x3f'))){_0x1386c3['limit']=qs[_0xbee6('0x22')](_0x538a76[_0xbee6('0x37')][_0xbee6('0x22')]);_0x1386c3[_0xbee6('0x21')]=qs[_0xbee6('0x21')](_0x538a76[_0xbee6('0x37')][_0xbee6('0x21')]);}_0x1386c3['order']=qs['sort'](_0x538a76['query'][_0xbee6('0x40')]);_0x1386c3[_0xbee6('0x41')]=qs['filters'](_['pick'](_0x538a76[_0xbee6('0x37')],_0x42cb7f['filters']),_0x1431b0);if(_0x538a76[_0xbee6('0x37')][_0xbee6('0x42')]){_0x1386c3['where']=_[_0xbee6('0x43')](_0x1386c3[_0xbee6('0x41')],{'$or':_['map'](_0x1431b0,function(_0xc8228){if(_0xc8228[_0xbee6('0x34')]!==_0xbee6('0x44')){var _0x56993c={};_0x56993c[_0xc8228[_0xbee6('0x2d')]]={'$like':'%'+_0x538a76[_0xbee6('0x37')][_0xbee6('0x42')]+'%'};return _0x56993c;}})});}_0x1386c3=_[_0xbee6('0x43')]({},_0x1386c3,_0x538a76[_0xbee6('0x45')]);var _0x4e901e={'where':_0x1386c3[_0xbee6('0x41')]};return db[_0xbee6('0x31')][_0xbee6('0x20')](_0x4e901e)[_0xbee6('0x29')](function(_0x1ed0e0){_0x1ea18f[_0xbee6('0x20')]=_0x1ed0e0;if(_0x538a76[_0xbee6('0x37')][_0xbee6('0x46')]){_0x1386c3['include']=[{'all':!![]}];}return db[_0xbee6('0x31')]['findAll'](_0x1386c3);})['then'](function(_0x453844){_0x1ea18f[_0xbee6('0x47')]=_0x453844;return _0x1ea18f;})[_0xbee6('0x29')](respondWithFilteredResult(_0x5d9c0f,_0x1386c3))[_0xbee6('0x48')](handleError(_0x5d9c0f,null));};exports[_0xbee6('0x49')]=function(_0x2f18c4,_0x497c7e){var _0x324b93={'raw':!![],'where':{'id':_0x2f18c4[_0xbee6('0x4a')]['id']}},_0x42404d={};_0x42404d[_0xbee6('0x36')]=_['keys'](db[_0xbee6('0x31')][_0xbee6('0x32')]);_0x42404d[_0xbee6('0x37')]=_[_0xbee6('0x38')](_0x2f18c4['query']);_0x42404d['filters']=_[_0xbee6('0x3a')](_0x42404d[_0xbee6('0x36')],_0x42404d[_0xbee6('0x37')]);_0x324b93[_0xbee6('0x3b')]=_[_0xbee6('0x3a')](_0x42404d[_0xbee6('0x36')],qs[_0xbee6('0x3c')](_0x2f18c4[_0xbee6('0x37')][_0xbee6('0x3c')]));_0x324b93[_0xbee6('0x3b')]=_0x324b93[_0xbee6('0x3b')][_0xbee6('0x3d')]?_0x324b93['attributes']:_0x42404d['model'];if(_0x2f18c4['query'][_0xbee6('0x46')]){_0x324b93[_0xbee6('0x4b')]=[{'all':!![]}];}_0x324b93=_[_0xbee6('0x43')]({},_0x324b93,_0x2f18c4[_0xbee6('0x45')]);return db[_0xbee6('0x31')][_0xbee6('0x4c')](_0x324b93)[_0xbee6('0x29')](handleEntityNotFound(_0x497c7e,null))[_0xbee6('0x29')](respondWithResult(_0x497c7e,null))[_0xbee6('0x48')](handleError(_0x497c7e,null));};exports[_0xbee6('0x4d')]=function(_0x401017,_0x16a1a3){return db[_0xbee6('0x31')][_0xbee6('0x4d')](_0x401017[_0xbee6('0x4e')],{})[_0xbee6('0x29')](respondWithResult(_0x16a1a3,0xc9))['catch'](handleError(_0x16a1a3,null));};exports[_0xbee6('0x4f')]=function(_0x33a16d,_0x1627e6){if(_0x33a16d[_0xbee6('0x4e')]['id']){delete _0x33a16d[_0xbee6('0x4e')]['id'];}return db[_0xbee6('0x31')][_0xbee6('0x4c')]({'where':{'id':_0x33a16d[_0xbee6('0x4a')]['id']}})[_0xbee6('0x29')](handleEntityNotFound(_0x1627e6,null))['then'](saveUpdates(_0x33a16d[_0xbee6('0x4e')],null))[_0xbee6('0x29')](respondWithResult(_0x1627e6,null))[_0xbee6('0x48')](handleError(_0x1627e6,null));};exports[_0xbee6('0x2a')]=function(_0x530632,_0x1ba89f){return db['OpenchannelQueueReport'][_0xbee6('0x4c')]({'where':{'id':_0x530632['params']['id']}})[_0xbee6('0x29')](handleEntityNotFound(_0x1ba89f,null))[_0xbee6('0x29')](removeEntity(_0x1ba89f,null))['catch'](handleError(_0x1ba89f,null));};exports[_0xbee6('0x50')]=function(_0x328345,_0x4b0708){return db[_0xbee6('0x31')][_0xbee6('0x50')]()[_0xbee6('0x29')](respondWithResult(_0x4b0708,null))['catch'](handleError(_0x4b0708,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 90e3044..8f25bbc 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x2e5959,_0x5007b5){var _0x3e5edd=function(_0x42c429){while(--_0x42c429){_0x2e5959['push'](_0x2e5959['shift']());}};_0x3e5edd(++_0x5007b5);}(_0x326f,0xd1));var _0xf326=function(_0x525ffc,_0x23a420){_0x525ffc=_0x525ffc-0x0;var _0x3a1745=_0x326f[_0x525ffc];return _0x3a1745;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x52eea6,_0x184e3e){var _0x80de8a=function(_0x2b632c){while(--_0x2b632c){_0x52eea6['push'](_0x52eea6['shift']());}};_0x80de8a(++_0x184e3e);}(_0x326f,0xd1));var _0xf326=function(_0x2125fe,_0x401ff8){_0x2125fe=_0x2125fe-0x0;var _0x22ffdc=_0x326f[_0x2125fe];return _0x22ffdc;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 45cd889..8924fd3 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 _0xa1cc=['code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','then','update','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3a0cb9,_0xf1c42){var _0x54df0e=function(_0x1477e5){while(--_0x1477e5){_0x3a0cb9['push'](_0x3a0cb9['shift']());}};_0x54df0e(++_0xf1c42);}(_0xa1cc,0x10f));var _0xca1c=function(_0x4be31f,_0x51b17f){_0x4be31f=_0x4be31f-0x0;var _0x1e7f36=_0xa1cc[_0x4be31f];return _0x1e7f36;};'use strict';var _=require(_0xca1c('0x0'));var util=require(_0xca1c('0x1'));var moment=require(_0xca1c('0x2'));var BPromise=require('bluebird');var rs=require(_0xca1c('0x3'));var fs=require('fs');var Redis=require(_0xca1c('0x4'));var db=require(_0xca1c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca1c('0x6'))('rpc');var config=require(_0xca1c('0x7'));var jayson=require(_0xca1c('0x8'));var client=jayson[_0xca1c('0x9')][_0xca1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d5101,_0x5132e2,_0x4ff3f7){return new BPromise(function(_0x8fc787,_0x21f118){return client['request'](_0x5d5101,_0x4ff3f7)['then'](function(_0x57807b){logger[_0xca1c('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5132e2,_0xca1c('0xc'));logger[_0xca1c('0xd')](_0xca1c('0xe'),_0x5132e2,_0xca1c('0xc'),JSON[_0xca1c('0xf')](_0x57807b));if(_0x57807b['error']){if(_0x57807b[_0xca1c('0x10')][_0xca1c('0x11')]===0x1f4){logger['error'](_0xca1c('0x12'),_0x5132e2,_0x57807b['error'][_0xca1c('0x13')]);return _0x21f118(_0x57807b[_0xca1c('0x10')][_0xca1c('0x13')]);}logger['error'](_0xca1c('0x12'),_0x5132e2,_0x57807b[_0xca1c('0x10')]['message']);return _0x8fc787(_0x57807b['error'][_0xca1c('0x13')]);}else{logger[_0xca1c('0xb')](_0xca1c('0x12'),_0x5132e2,_0xca1c('0xc'));_0x8fc787(_0x57807b[_0xca1c('0x14')][_0xca1c('0x13')]);}})[_0xca1c('0x15')](function(_0x357321){logger[_0xca1c('0x10')](_0xca1c('0x12'),_0x5132e2,_0x357321);_0x21f118(_0x357321);});});}exports[_0xca1c('0x16')]=function(_0x10b126){var _0x14480c=this;return new Promise(function(_0x447547,_0x329244){return db[_0xca1c('0x17')]['create'](_0x10b126[_0xca1c('0x18')],{'raw':_0x10b126[_0xca1c('0x19')]?_0x10b126['options']['raw']===undefined?!![]:![]:!![]})[_0xca1c('0x1a')](function(_0x10f801){logger[_0xca1c('0xb')](_0xca1c('0x16'),_0x10b126);logger[_0xca1c('0xd')](_0xca1c('0x16'),_0x10b126,JSON[_0xca1c('0xf')](_0x10f801));_0x447547(_0x10f801);})['catch'](function(_0x115b4d){logger['error'](_0xca1c('0x16'),_0x115b4d[_0xca1c('0x13')],_0x10b126);_0x329244(_0x14480c[_0xca1c('0x10')](0x1f4,_0x115b4d[_0xca1c('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1c06dc){var _0x76af08=this;return new Promise(function(_0x47ace5,_0x21b022){return db['OpenchannelQueueReport'][_0xca1c('0x1b')](_0x1c06dc[_0xca1c('0x18')],{'raw':_0x1c06dc[_0xca1c('0x19')]?_0x1c06dc[_0xca1c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c06dc[_0xca1c('0x19')]?_0x1c06dc[_0xca1c('0x19')][_0xca1c('0x1c')]||null:null,'attributes':_0x1c06dc[_0xca1c('0x19')]?_0x1c06dc[_0xca1c('0x19')][_0xca1c('0x1d')]||null:null,'limit':_0x1c06dc[_0xca1c('0x19')]?_0x1c06dc['options'][_0xca1c('0x1e')]||null:null})['then'](function(_0x573fc){logger[_0xca1c('0xb')]('UpdateOpenchannelQueueReport',_0x1c06dc);logger[_0xca1c('0xd')](_0xca1c('0x1f'),_0x1c06dc,JSON[_0xca1c('0xf')](_0x573fc));_0x47ace5(_0x573fc);})[_0xca1c('0x15')](function(_0x55cc6d){logger[_0xca1c('0x10')](_0xca1c('0x1f'),_0x55cc6d[_0xca1c('0x13')],_0x1c06dc);_0x21b022(_0x76af08[_0xca1c('0x10')](0x1f4,_0x55cc6d['message']));});});}; \ No newline at end of file +var _0xd4f4=['options','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateOpenchannelQueueReport','create','body'];(function(_0x4f5076,_0x3deea8){var _0x2d8036=function(_0x323276){while(--_0x323276){_0x4f5076['push'](_0x4f5076['shift']());}};_0x2d8036(++_0x3deea8);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x181359,_0x37fe9d){_0x181359=_0x181359-0x0;var _0x653370=_0xd4f4[_0x181359];return _0x653370;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7aa8,_0xecc103,_0x150bd6){return new BPromise(function(_0xea29b,_0x40be66){return client[_0x4d4f('0xb')](_0x1d7aa8,_0x150bd6)[_0x4d4f('0xc')](function(_0x226837){logger[_0x4d4f('0xd')](_0x4d4f('0xe'),_0xecc103,_0x4d4f('0xf'));logger[_0x4d4f('0x10')](_0x4d4f('0x11'),_0xecc103,_0x4d4f('0xf'),JSON[_0x4d4f('0x12')](_0x226837));if(_0x226837[_0x4d4f('0x13')]){if(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x14')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xecc103,_0x226837['error'][_0x4d4f('0x15')]);return _0x40be66(_0x226837[_0x4d4f('0x13')]['message']);}logger[_0x4d4f('0x13')](_0x4d4f('0xe'),_0xecc103,_0x226837[_0x4d4f('0x13')]['message']);return _0xea29b(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x15')]);}else{logger[_0x4d4f('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xecc103,_0x4d4f('0xf'));_0xea29b(_0x226837['result'][_0x4d4f('0x15')]);}})[_0x4d4f('0x16')](function(_0x4170ca){logger['error'](_0x4d4f('0xe'),_0xecc103,_0x4170ca);_0x40be66(_0x4170ca);});});}exports[_0x4d4f('0x17')]=function(_0x51dcf1){var _0x5dbbeb=this;return new Promise(function(_0x519501,_0x5a58af){return db['OpenchannelQueueReport'][_0x4d4f('0x18')](_0x51dcf1[_0x4d4f('0x19')],{'raw':_0x51dcf1[_0x4d4f('0x1a')]?_0x51dcf1[_0x4d4f('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e1ae2){logger['info'](_0x4d4f('0x17'),_0x51dcf1);logger[_0x4d4f('0x10')](_0x4d4f('0x17'),_0x51dcf1,JSON[_0x4d4f('0x12')](_0x1e1ae2));_0x519501(_0x1e1ae2);})[_0x4d4f('0x16')](function(_0x5beab4){logger['error'](_0x4d4f('0x17'),_0x5beab4['message'],_0x51dcf1);_0x5a58af(_0x5dbbeb[_0x4d4f('0x13')](0x1f4,_0x5beab4[_0x4d4f('0x15')]));});});};exports[_0x4d4f('0x1b')]=function(_0x3f4a55){var _0xf3f7a4=this;return new Promise(function(_0x497cec,_0x44bd2f){return db[_0x4d4f('0x1c')][_0x4d4f('0x1d')](_0x3f4a55[_0x4d4f('0x19')],{'raw':_0x3f4a55['options']?_0x3f4a55['options'][_0x4d4f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4a55[_0x4d4f('0x1a')]?_0x3f4a55[_0x4d4f('0x1a')][_0x4d4f('0x1f')]||null:null,'attributes':_0x3f4a55['options']?_0x3f4a55[_0x4d4f('0x1a')][_0x4d4f('0x20')]||null:null,'limit':_0x3f4a55[_0x4d4f('0x1a')]?_0x3f4a55[_0x4d4f('0x1a')]['limit']||null:null})[_0x4d4f('0xc')](function(_0x51cb3d){logger[_0x4d4f('0xd')](_0x4d4f('0x1b'),_0x3f4a55);logger['debug'](_0x4d4f('0x1b'),_0x3f4a55,JSON[_0x4d4f('0x12')](_0x51cb3d));_0x497cec(_0x51cb3d);})[_0x4d4f('0x16')](function(_0x3d7f14){logger[_0x4d4f('0x13')](_0x4d4f('0x1b'),_0x3d7f14['message'],_0x3f4a55);_0x44bd2f(_0xf3f7a4[_0x4d4f('0x13')](0x1f4,_0x3d7f14[_0x4d4f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index e3a36e1..8c96000 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 _0x6ca1=['get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x3c1cbf,_0x43d227){var _0x508d4c=function(_0x4cdbb1){while(--_0x4cdbb1){_0x3c1cbf['push'](_0x3c1cbf['shift']());}};_0x508d4c(++_0x43d227);}(_0x6ca1,0x1d5));var _0x16ca=function(_0x362469,_0x127474){_0x362469=_0x362469-0x0;var _0x3cb032=_0x6ca1[_0x362469];return _0x3cb032;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x16ca('0x0'));var router=express[_0x16ca('0x1')]();var fs_extra=require(_0x16ca('0x2'));var auth=require(_0x16ca('0x3'));var interaction=require(_0x16ca('0x4'));var config=require(_0x16ca('0x5'));var controller=require(_0x16ca('0x6'));router[_0x16ca('0x7')]('/',auth[_0x16ca('0x8')](),controller[_0x16ca('0x9')]);router['get'](_0x16ca('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x16ca('0x7')](_0x16ca('0xb'),auth[_0x16ca('0x8')](),controller['show']);router[_0x16ca('0xc')]('/',auth[_0x16ca('0x8')](),controller[_0x16ca('0xd')]);router[_0x16ca('0xe')](_0x16ca('0xb'),auth[_0x16ca('0x8')](),controller[_0x16ca('0xf')]);router[_0x16ca('0x10')](_0x16ca('0xb'),auth[_0x16ca('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7d12=['../../config/environment','get','isAuthenticated','/describe','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2833da,_0x512321){var _0x49968a=function(_0x52e88e){while(--_0x52e88e){_0x2833da['push'](_0x2833da['shift']());}};_0x49968a(++_0x512321);}(_0x7d12,0x91));var _0x27d1=function(_0x1886d0,_0x36d4b4){_0x1886d0=_0x1886d0-0x0;var _0x152689=_0x7d12[_0x1886d0];return _0x152689;};'use strict';var multer=require('multer');var util=require(_0x27d1('0x0'));var path=require('path');var timeout=require(_0x27d1('0x1'));var express=require(_0x27d1('0x2'));var router=express[_0x27d1('0x3')]();var fs_extra=require(_0x27d1('0x4'));var auth=require(_0x27d1('0x5'));var interaction=require(_0x27d1('0x6'));var config=require(_0x27d1('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0x27d1('0x8')]('/',auth[_0x27d1('0x9')](),controller['index']);router[_0x27d1('0x8')](_0x27d1('0xa'),auth[_0x27d1('0x9')](),controller['describe']);router[_0x27d1('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x27d1('0xb')]('/',auth[_0x27d1('0x9')](),controller[_0x27d1('0xc')]);router[_0x27d1('0xd')](_0x27d1('0xe'),auth['isAuthenticated'](),controller[_0x27d1('0xf')]);router[_0x27d1('0x10')](_0x27d1('0xe'),auth[_0x27d1('0x9')](),controller[_0x27d1('0x11')]);module[_0x27d1('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index e6bcea0..1313d5a 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x12db6a,_0x327366){var _0x7dd50=function(_0x278367){while(--_0x278367){_0x12db6a['push'](_0x12db6a['shift']());}};_0x7dd50(++_0x327366);}(_0x008c,0x188));var _0xc008=function(_0x4688f3,_0x1d5a1a){_0x4688f3=_0x4688f3-0x0;var _0x470c84=_0x008c[_0x4688f3];return _0x470c84;};'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 +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x57fe34,_0x400bda){var _0x3cdcdf=function(_0x403770){while(--_0x403770){_0x57fe34['push'](_0x57fe34['shift']());}};_0x3cdcdf(++_0x400bda);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a3525,_0x5bee02){_0x3a3525=_0x3a3525-0x0;var _0x56e306=_0xedd9[_0x3a3525];return _0x56e306;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 7784f8a..f7ec7dc 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 _0xfdb0=['keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','create','body','destroy','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','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','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','model'];(function(_0x199371,_0x51bddf){var _0x9a168=function(_0x41628a){while(--_0x41628a){_0x199371['push'](_0x199371['shift']());}};_0x9a168(++_0x51bddf);}(_0xfdb0,0x102));var _0x0fdb=function(_0x4951e0,_0x11218a){_0x4951e0=_0x4951e0-0x0;var _0x452ccc=_0xfdb0[_0x4951e0];return _0x452ccc;};'use strict';var emlformat=require(_0x0fdb('0x0'));var rimraf=require(_0x0fdb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fdb('0x2'));var rp=require(_0x0fdb('0x3'));var moment=require(_0x0fdb('0x4'));var BPromise=require(_0x0fdb('0x5'));var Mustache=require(_0x0fdb('0x6'));var util=require('util');var path=require(_0x0fdb('0x7'));var sox=require(_0x0fdb('0x8'));var csv=require(_0x0fdb('0x9'));var ejs=require(_0x0fdb('0xa'));var fs=require('fs');var fs_extra=require(_0x0fdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fdb('0xc'));var jsforce=require(_0x0fdb('0xd'));var deskjs=require(_0x0fdb('0xe'));var toCsv=require(_0x0fdb('0x9'));var querystring=require(_0x0fdb('0xf'));var Papa=require(_0x0fdb('0x10'));var Redis=require(_0x0fdb('0x11'));var authService=require(_0x0fdb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fdb('0x13'));var hardwareService=require(_0x0fdb('0x14'));var logger=require(_0x0fdb('0x15'))(_0x0fdb('0x16'));var utils=require(_0x0fdb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0fdb('0x18'));var db=require(_0x0fdb('0x19'))['db'];function respondWithStatusCode(_0x17f3f9,_0x1b086d){_0x1b086d=_0x1b086d||0xcc;return function(_0x5e40c9){if(_0x5e40c9){return _0x17f3f9['sendStatus'](_0x1b086d);}return _0x17f3f9['status'](_0x1b086d)[_0x0fdb('0x1a')]();};}function respondWithResult(_0x143c5f,_0x54ed5b){_0x54ed5b=_0x54ed5b||0xc8;return function(_0x395435){if(_0x395435){return _0x143c5f[_0x0fdb('0x1b')](_0x54ed5b)[_0x0fdb('0x1c')](_0x395435);}};}function respondWithFilteredResult(_0x4b2abc,_0x6f3683){return function(_0x2c972c){if(_0x2c972c){var _0x506e4b=typeof _0x6f3683[_0x0fdb('0x1d')]===_0x0fdb('0x1e')&&typeof _0x6f3683[_0x0fdb('0x1f')]===_0x0fdb('0x1e');var _0x23207f=_0x2c972c[_0x0fdb('0x20')];var _0x4109a7=_0x506e4b?0x0:_0x6f3683[_0x0fdb('0x1d')];var _0x5894d2=_0x506e4b?_0x2c972c[_0x0fdb('0x20')]:_0x6f3683[_0x0fdb('0x1d')]+_0x6f3683[_0x0fdb('0x1f')];var _0x81293b;if(_0x5894d2>=_0x23207f){_0x5894d2=_0x23207f;_0x81293b=0xc8;}else{_0x81293b=0xce;}_0x4b2abc[_0x0fdb('0x1b')](_0x81293b);return _0x4b2abc['set'](_0x0fdb('0x21'),_0x4109a7+'-'+_0x5894d2+'/'+_0x23207f)[_0x0fdb('0x1c')](_0x2c972c);}return null;};}function patchUpdates(_0x33d236){return function(_0xe8b983){try{jsonpatch[_0x0fdb('0x22')](_0xe8b983,_0x33d236,!![]);}catch(_0x2273d3){return BPromise[_0x0fdb('0x23')](_0x2273d3);}return _0xe8b983[_0x0fdb('0x24')]();};}function saveUpdates(_0x10c7c3,_0x3288c8){return function(_0x4dd827){if(_0x4dd827){return _0x4dd827[_0x0fdb('0x25')](_0x10c7c3)[_0x0fdb('0x26')](function(_0x3b416e){return _0x3b416e;});}return null;};}function removeEntity(_0x50bf63,_0xdb9ffc){return function(_0x266888){if(_0x266888){return _0x266888['destroy']()[_0x0fdb('0x26')](function(){_0x50bf63['status'](0xcc)[_0x0fdb('0x1a')]();});}};}function handleEntityNotFound(_0x1fb9b0,_0x295a87){return function(_0x2bf833){if(!_0x2bf833){_0x1fb9b0[_0x0fdb('0x27')](0x194);}return _0x2bf833;};}function handleError(_0x52a377,_0x4a905f){_0x4a905f=_0x4a905f||0x1f4;return function(_0xb8fa32){logger['error'](_0xb8fa32[_0x0fdb('0x28')]);if(_0xb8fa32[_0x0fdb('0x29')]){delete _0xb8fa32[_0x0fdb('0x29')];}_0x52a377[_0x0fdb('0x1b')](_0x4a905f)[_0x0fdb('0x2a')](_0xb8fa32);};}exports[_0x0fdb('0x2b')]=function(_0x25eecd,_0x2221ce){var _0x24263d={},_0x3b1e0e={},_0x1b4ada={'count':0x0,'rows':[]};var _0x1198a9=_[_0x0fdb('0x2c')](db[_0x0fdb('0x2d')][_0x0fdb('0x2e')],function(_0x1b9ac4){return{'name':_0x1b9ac4['fieldName'],'type':_0x1b9ac4[_0x0fdb('0x2f')][_0x0fdb('0x30')]};});_0x3b1e0e[_0x0fdb('0x31')]=_[_0x0fdb('0x2c')](_0x1198a9,_0x0fdb('0x29'));_0x3b1e0e['query']=_[_0x0fdb('0x32')](_0x25eecd[_0x0fdb('0x33')]);_0x3b1e0e['filters']=_[_0x0fdb('0x34')](_0x3b1e0e[_0x0fdb('0x31')],_0x3b1e0e[_0x0fdb('0x33')]);_0x24263d[_0x0fdb('0x35')]=_['intersection'](_0x3b1e0e[_0x0fdb('0x31')],qs[_0x0fdb('0x36')](_0x25eecd[_0x0fdb('0x33')][_0x0fdb('0x36')]));_0x24263d['attributes']=_0x24263d[_0x0fdb('0x35')][_0x0fdb('0x37')]?_0x24263d[_0x0fdb('0x35')]:_0x3b1e0e[_0x0fdb('0x31')];if(!_0x25eecd['query'][_0x0fdb('0x38')](_0x0fdb('0x39'))){_0x24263d[_0x0fdb('0x1f')]=qs[_0x0fdb('0x1f')](_0x25eecd[_0x0fdb('0x33')][_0x0fdb('0x1f')]);_0x24263d[_0x0fdb('0x1d')]=qs[_0x0fdb('0x1d')](_0x25eecd[_0x0fdb('0x33')]['offset']);}_0x24263d[_0x0fdb('0x3a')]=qs[_0x0fdb('0x3b')](_0x25eecd[_0x0fdb('0x33')]['sort']);_0x24263d[_0x0fdb('0x3c')]=qs[_0x0fdb('0x3d')](_['pick'](_0x25eecd[_0x0fdb('0x33')],_0x3b1e0e[_0x0fdb('0x3d')]),_0x1198a9);if(_0x25eecd[_0x0fdb('0x33')]['filter']){_0x24263d[_0x0fdb('0x3c')]=_[_0x0fdb('0x3e')](_0x24263d[_0x0fdb('0x3c')],{'$or':_[_0x0fdb('0x2c')](_0x1198a9,function(_0x52ff69){if(_0x52ff69[_0x0fdb('0x2f')]!==_0x0fdb('0x3f')){var _0x46bebd={};_0x46bebd[_0x52ff69[_0x0fdb('0x29')]]={'$like':'%'+_0x25eecd[_0x0fdb('0x33')][_0x0fdb('0x40')]+'%'};return _0x46bebd;}})});}_0x24263d=_[_0x0fdb('0x3e')]({},_0x24263d,_0x25eecd[_0x0fdb('0x41')]);var _0x1cd5df={'where':_0x24263d[_0x0fdb('0x3c')]};return db['OpenchannelTransferReport'][_0x0fdb('0x20')](_0x1cd5df)[_0x0fdb('0x26')](function(_0x3da907){_0x1b4ada['count']=_0x3da907;if(_0x25eecd[_0x0fdb('0x33')][_0x0fdb('0x42')]){_0x24263d['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x0fdb('0x43')](_0x24263d);})[_0x0fdb('0x26')](function(_0x2e8df0){_0x1b4ada[_0x0fdb('0x44')]=_0x2e8df0;return _0x1b4ada;})[_0x0fdb('0x26')](respondWithFilteredResult(_0x2221ce,_0x24263d))[_0x0fdb('0x45')](handleError(_0x2221ce,null));};exports['show']=function(_0x42940a,_0x8331c0){var _0x37395b={'raw':!![],'where':{'id':_0x42940a[_0x0fdb('0x46')]['id']}},_0x5ee8ae={};_0x5ee8ae[_0x0fdb('0x31')]=_[_0x0fdb('0x32')](db[_0x0fdb('0x2d')][_0x0fdb('0x2e')]);_0x5ee8ae['query']=_['keys'](_0x42940a[_0x0fdb('0x33')]);_0x5ee8ae[_0x0fdb('0x3d')]=_[_0x0fdb('0x34')](_0x5ee8ae[_0x0fdb('0x31')],_0x5ee8ae[_0x0fdb('0x33')]);_0x37395b[_0x0fdb('0x35')]=_[_0x0fdb('0x34')](_0x5ee8ae[_0x0fdb('0x31')],qs['fields'](_0x42940a['query'][_0x0fdb('0x36')]));_0x37395b[_0x0fdb('0x35')]=_0x37395b[_0x0fdb('0x35')]['length']?_0x37395b[_0x0fdb('0x35')]:_0x5ee8ae[_0x0fdb('0x31')];if(_0x42940a[_0x0fdb('0x33')][_0x0fdb('0x42')]){_0x37395b[_0x0fdb('0x47')]=[{'all':!![]}];}_0x37395b=_['merge']({},_0x37395b,_0x42940a[_0x0fdb('0x41')]);return db[_0x0fdb('0x2d')]['find'](_0x37395b)['then'](handleEntityNotFound(_0x8331c0,null))[_0x0fdb('0x26')](respondWithResult(_0x8331c0,null))[_0x0fdb('0x45')](handleError(_0x8331c0,null));};exports[_0x0fdb('0x48')]=function(_0x2ba8ef,_0x2a3cfd){return db['OpenchannelTransferReport'][_0x0fdb('0x48')](_0x2ba8ef[_0x0fdb('0x49')],{})[_0x0fdb('0x26')](respondWithResult(_0x2a3cfd,0xc9))[_0x0fdb('0x45')](handleError(_0x2a3cfd,null));};exports[_0x0fdb('0x25')]=function(_0x3f06af,_0x4a0c68){if(_0x3f06af[_0x0fdb('0x49')]['id']){delete _0x3f06af['body']['id'];}return db[_0x0fdb('0x2d')]['find']({'where':{'id':_0x3f06af[_0x0fdb('0x46')]['id']}})[_0x0fdb('0x26')](handleEntityNotFound(_0x4a0c68,null))['then'](saveUpdates(_0x3f06af[_0x0fdb('0x49')],null))[_0x0fdb('0x26')](respondWithResult(_0x4a0c68,null))[_0x0fdb('0x45')](handleError(_0x4a0c68,null));};exports[_0x0fdb('0x4a')]=function(_0x4b04db,_0x4c612b){return db[_0x0fdb('0x2d')][_0x0fdb('0x4b')]({'where':{'id':_0x4b04db[_0x0fdb('0x46')]['id']}})[_0x0fdb('0x26')](handleEntityNotFound(_0x4c612b,null))[_0x0fdb('0x26')](removeEntity(_0x4c612b,null))[_0x0fdb('0x45')](handleError(_0x4c612b,null));};exports[_0x0fdb('0x4c')]=function(_0x281f70,_0x5b6942){return db[_0x0fdb('0x2d')][_0x0fdb('0x4c')]()[_0x0fdb('0x26')](respondWithResult(_0x5b6942,null))[_0x0fdb('0x45')](handleError(_0x5b6942,null));}; \ No newline at end of file +var _0x4924=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','reject','save','update','then','destroy','end','error','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','params','includeAll','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x5c756f,_0x230e49){var _0x1bdecb=function(_0x2a77c5){while(--_0x2a77c5){_0x5c756f['push'](_0x5c756f['shift']());}};_0x1bdecb(++_0x230e49);}(_0x4924,0x157));var _0x4492=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x4924[_0x400322];return _0xfdd597;};'use strict';var emlformat=require(_0x4492('0x0'));var rimraf=require(_0x4492('0x1'));var zipdir=require(_0x4492('0x2'));var jsonpatch=require(_0x4492('0x3'));var rp=require(_0x4492('0x4'));var moment=require(_0x4492('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4492('0x6'));var util=require(_0x4492('0x7'));var path=require(_0x4492('0x8'));var sox=require(_0x4492('0x9'));var csv=require(_0x4492('0xa'));var ejs=require(_0x4492('0xb'));var fs=require('fs');var fs_extra=require(_0x4492('0xc'));var _=require(_0x4492('0xd'));var squel=require('squel');var crypto=require(_0x4492('0xe'));var jsforce=require(_0x4492('0xf'));var deskjs=require(_0x4492('0x10'));var toCsv=require(_0x4492('0xa'));var querystring=require(_0x4492('0x11'));var Papa=require(_0x4492('0x12'));var Redis=require('ioredis');var authService=require(_0x4492('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4492('0x14'));var hardwareService=require(_0x4492('0x15'));var logger=require(_0x4492('0x16'))(_0x4492('0x17'));var utils=require(_0x4492('0x18'));var config=require(_0x4492('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d5810,_0x81b50e){_0x81b50e=_0x81b50e||0xcc;return function(_0x1d3e9a){if(_0x1d3e9a){return _0x4d5810[_0x4492('0x1a')](_0x81b50e);}return _0x4d5810['status'](_0x81b50e)['end']();};}function respondWithResult(_0x1f1616,_0x5b8b83){_0x5b8b83=_0x5b8b83||0xc8;return function(_0x3292e3){if(_0x3292e3){return _0x1f1616[_0x4492('0x1b')](_0x5b8b83)[_0x4492('0x1c')](_0x3292e3);}};}function respondWithFilteredResult(_0x4ecd41,_0x59ab8d){return function(_0x4cff8a){if(_0x4cff8a){var _0x286f27=typeof _0x59ab8d[_0x4492('0x1d')]===_0x4492('0x1e')&&typeof _0x59ab8d[_0x4492('0x1f')]===_0x4492('0x1e');var _0x4909f3=_0x4cff8a['count'];var _0x2b5d26=_0x286f27?0x0:_0x59ab8d['offset'];var _0xc29e8b=_0x286f27?_0x4cff8a['count']:_0x59ab8d[_0x4492('0x1d')]+_0x59ab8d[_0x4492('0x1f')];var _0x3655f8;if(_0xc29e8b>=_0x4909f3){_0xc29e8b=_0x4909f3;_0x3655f8=0xc8;}else{_0x3655f8=0xce;}_0x4ecd41[_0x4492('0x1b')](_0x3655f8);return _0x4ecd41['set']('Content-Range',_0x2b5d26+'-'+_0xc29e8b+'/'+_0x4909f3)[_0x4492('0x1c')](_0x4cff8a);}return null;};}function patchUpdates(_0x1dd88d){return function(_0x3a7954){try{jsonpatch['apply'](_0x3a7954,_0x1dd88d,!![]);}catch(_0x15abc3){return BPromise[_0x4492('0x20')](_0x15abc3);}return _0x3a7954[_0x4492('0x21')]();};}function saveUpdates(_0x3a4cbf,_0x2f4a12){return function(_0x3ea0f1){if(_0x3ea0f1){return _0x3ea0f1[_0x4492('0x22')](_0x3a4cbf)[_0x4492('0x23')](function(_0x3b55ad){return _0x3b55ad;});}return null;};}function removeEntity(_0x5a2bd8,_0x48531d){return function(_0x4793d8){if(_0x4793d8){return _0x4793d8[_0x4492('0x24')]()['then'](function(){_0x5a2bd8[_0x4492('0x1b')](0xcc)[_0x4492('0x25')]();});}};}function handleEntityNotFound(_0x5b73e0,_0x129de7){return function(_0x2e798b){if(!_0x2e798b){_0x5b73e0[_0x4492('0x1a')](0x194);}return _0x2e798b;};}function handleError(_0x1782e9,_0x46beaa){_0x46beaa=_0x46beaa||0x1f4;return function(_0x1bcd23){logger[_0x4492('0x26')](_0x1bcd23['stack']);if(_0x1bcd23[_0x4492('0x27')]){delete _0x1bcd23[_0x4492('0x27')];}_0x1782e9[_0x4492('0x1b')](_0x46beaa)[_0x4492('0x28')](_0x1bcd23);};}exports['index']=function(_0x3bc361,_0x5c78ad){var _0x5c132f={},_0x257d4f={},_0x575ee6={'count':0x0,'rows':[]};var _0x26f016=_[_0x4492('0x29')](db[_0x4492('0x2a')][_0x4492('0x2b')],function(_0x567f86){return{'name':_0x567f86[_0x4492('0x2c')],'type':_0x567f86['type']['key']};});_0x257d4f['model']=_[_0x4492('0x29')](_0x26f016,'name');_0x257d4f['query']=_[_0x4492('0x2d')](_0x3bc361[_0x4492('0x2e')]);_0x257d4f['filters']=_[_0x4492('0x2f')](_0x257d4f[_0x4492('0x30')],_0x257d4f[_0x4492('0x2e')]);_0x5c132f[_0x4492('0x31')]=_[_0x4492('0x2f')](_0x257d4f['model'],qs[_0x4492('0x32')](_0x3bc361['query'][_0x4492('0x32')]));_0x5c132f['attributes']=_0x5c132f[_0x4492('0x31')][_0x4492('0x33')]?_0x5c132f['attributes']:_0x257d4f[_0x4492('0x30')];if(!_0x3bc361[_0x4492('0x2e')][_0x4492('0x34')]('nolimit')){_0x5c132f['limit']=qs[_0x4492('0x1f')](_0x3bc361[_0x4492('0x2e')][_0x4492('0x1f')]);_0x5c132f[_0x4492('0x1d')]=qs[_0x4492('0x1d')](_0x3bc361[_0x4492('0x2e')][_0x4492('0x1d')]);}_0x5c132f['order']=qs[_0x4492('0x35')](_0x3bc361[_0x4492('0x2e')]['sort']);_0x5c132f[_0x4492('0x36')]=qs[_0x4492('0x37')](_[_0x4492('0x38')](_0x3bc361[_0x4492('0x2e')],_0x257d4f[_0x4492('0x37')]),_0x26f016);if(_0x3bc361[_0x4492('0x2e')][_0x4492('0x39')]){_0x5c132f['where']=_[_0x4492('0x3a')](_0x5c132f[_0x4492('0x36')],{'$or':_[_0x4492('0x29')](_0x26f016,function(_0x3abcb0){if(_0x3abcb0['type']!==_0x4492('0x3b')){var _0x200d9f={};_0x200d9f[_0x3abcb0[_0x4492('0x27')]]={'$like':'%'+_0x3bc361[_0x4492('0x2e')][_0x4492('0x39')]+'%'};return _0x200d9f;}})});}_0x5c132f=_[_0x4492('0x3a')]({},_0x5c132f,_0x3bc361[_0x4492('0x3c')]);var _0x21dbf8={'where':_0x5c132f[_0x4492('0x36')]};return db[_0x4492('0x2a')][_0x4492('0x3d')](_0x21dbf8)[_0x4492('0x23')](function(_0x3c0dab){_0x575ee6[_0x4492('0x3d')]=_0x3c0dab;if(_0x3bc361[_0x4492('0x2e')]['includeAll']){_0x5c132f[_0x4492('0x3e')]=[{'all':!![]}];}return db[_0x4492('0x2a')][_0x4492('0x3f')](_0x5c132f);})[_0x4492('0x23')](function(_0x35e4d0){_0x575ee6[_0x4492('0x40')]=_0x35e4d0;return _0x575ee6;})[_0x4492('0x23')](respondWithFilteredResult(_0x5c78ad,_0x5c132f))[_0x4492('0x41')](handleError(_0x5c78ad,null));};exports['show']=function(_0x538177,_0x190b5e){var _0x39091e={'raw':!![],'where':{'id':_0x538177[_0x4492('0x42')]['id']}},_0x53c3f1={};_0x53c3f1['model']=_[_0x4492('0x2d')](db[_0x4492('0x2a')][_0x4492('0x2b')]);_0x53c3f1['query']=_[_0x4492('0x2d')](_0x538177[_0x4492('0x2e')]);_0x53c3f1[_0x4492('0x37')]=_[_0x4492('0x2f')](_0x53c3f1[_0x4492('0x30')],_0x53c3f1['query']);_0x39091e['attributes']=_[_0x4492('0x2f')](_0x53c3f1['model'],qs[_0x4492('0x32')](_0x538177[_0x4492('0x2e')][_0x4492('0x32')]));_0x39091e[_0x4492('0x31')]=_0x39091e[_0x4492('0x31')][_0x4492('0x33')]?_0x39091e[_0x4492('0x31')]:_0x53c3f1[_0x4492('0x30')];if(_0x538177[_0x4492('0x2e')][_0x4492('0x43')]){_0x39091e[_0x4492('0x3e')]=[{'all':!![]}];}_0x39091e=_[_0x4492('0x3a')]({},_0x39091e,_0x538177[_0x4492('0x3c')]);return db[_0x4492('0x2a')]['find'](_0x39091e)[_0x4492('0x23')](handleEntityNotFound(_0x190b5e,null))['then'](respondWithResult(_0x190b5e,null))[_0x4492('0x41')](handleError(_0x190b5e,null));};exports['create']=function(_0x5b9e1c,_0x4e6e81){return db[_0x4492('0x2a')][_0x4492('0x44')](_0x5b9e1c[_0x4492('0x45')],{})[_0x4492('0x23')](respondWithResult(_0x4e6e81,0xc9))[_0x4492('0x41')](handleError(_0x4e6e81,null));};exports[_0x4492('0x22')]=function(_0x5a01c6,_0xd00886){if(_0x5a01c6[_0x4492('0x45')]['id']){delete _0x5a01c6['body']['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x5a01c6[_0x4492('0x42')]['id']}})[_0x4492('0x23')](handleEntityNotFound(_0xd00886,null))['then'](saveUpdates(_0x5a01c6[_0x4492('0x45')],null))[_0x4492('0x23')](respondWithResult(_0xd00886,null))[_0x4492('0x41')](handleError(_0xd00886,null));};exports['destroy']=function(_0x5a6f4f,_0x3afb82){return db[_0x4492('0x2a')]['find']({'where':{'id':_0x5a6f4f[_0x4492('0x42')]['id']}})[_0x4492('0x23')](handleEntityNotFound(_0x3afb82,null))['then'](removeEntity(_0x3afb82,null))[_0x4492('0x41')](handleError(_0x3afb82,null));};exports['describe']=function(_0x340b33,_0x24ed65){return db[_0x4492('0x2a')][_0x4492('0x46')]()[_0x4492('0x23')](respondWithResult(_0x24ed65,null))['catch'](handleError(_0x24ed65,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 6623245..80b2439 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 _0x0e3e=['define','report_openchannel_transfer','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x411579,_0x5a75b8){var _0x463fcb=function(_0x5b63c2){while(--_0x5b63c2){_0x411579['push'](_0x411579['shift']());}};_0x463fcb(++_0x5a75b8);}(_0x0e3e,0x137));var _0xe0e3=function(_0x3561a9,_0x53adfd){_0x3561a9=_0x3561a9-0x0;var _0x3a0bb9=_0x0e3e[_0x3561a9];return _0x3a0bb9;};'use strict';var _=require(_0xe0e3('0x0'));var util=require('util');var logger=require(_0xe0e3('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe0e3('0x2'));var rp=require(_0xe0e3('0x3'));var fs=require('fs');var path=require(_0xe0e3('0x4'));var rimraf=require(_0xe0e3('0x5'));var config=require(_0xe0e3('0x6'));var attributes=require(_0xe0e3('0x7'));module['exports']=function(_0x28cd2c,_0x4994b9){return _0x28cd2c[_0xe0e3('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0xe0e3('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe0e3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27cb=['request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','util','api','moment','bluebird'];(function(_0x1cd85a,_0x12ab1b){var _0x1c4a8e=function(_0x21d59c){while(--_0x21d59c){_0x1cd85a['push'](_0x1cd85a['shift']());}};_0x1c4a8e(++_0x12ab1b);}(_0x27cb,0xd4));var _0xb27c=function(_0x15ce17,_0x13068d){_0x15ce17=_0x15ce17-0x0;var _0x4856e3=_0x27cb[_0x15ce17];return _0x4856e3;};'use strict';var _=require('lodash');var util=require(_0xb27c('0x0'));var logger=require('../../config/logger')(_0xb27c('0x1'));var moment=require(_0xb27c('0x2'));var BPromise=require(_0xb27c('0x3'));var rp=require(_0xb27c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb27c('0x5'));var config=require(_0xb27c('0x6'));var attributes=require(_0xb27c('0x7'));module[_0xb27c('0x8')]=function(_0x62c5c1,_0x33d1ee){return _0x62c5c1[_0xb27c('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0xb27c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb27c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index eee1a8f..864ff8c 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 _0x37cc=['http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x795248,_0x1ecef9){var _0x2d0f23=function(_0x1f88f0){while(--_0x1f88f0){_0x795248['push'](_0x795248['shift']());}};_0x2d0f23(++_0x1ecef9);}(_0x37cc,0x185));var _0xc37c=function(_0x57c741,_0x26dcc5){_0x57c741=_0x57c741-0x0;var _0x248821=_0x37cc[_0x57c741];return _0x248821;};'use strict';var _=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var moment=require(_0xc37c('0x2'));var BPromise=require(_0xc37c('0x3'));var rs=require(_0xc37c('0x4'));var fs=require('fs');var Redis=require(_0xc37c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc37c('0x6'))(_0xc37c('0x7'));var config=require(_0xc37c('0x8'));var jayson=require(_0xc37c('0x9'));var client=jayson[_0xc37c('0xa')][_0xc37c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd8f098,_0x1eaa97,_0x3c5c63){return new BPromise(function(_0x483c8d,_0x15a756){return client[_0xc37c('0xc')](_0xd8f098,_0x3c5c63)[_0xc37c('0xd')](function(_0x3526b5){logger[_0xc37c('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1eaa97,_0xc37c('0xf'));logger[_0xc37c('0x10')](_0xc37c('0x11'),_0x1eaa97,_0xc37c('0xf'),JSON[_0xc37c('0x12')](_0x3526b5));if(_0x3526b5[_0xc37c('0x13')]){if(_0x3526b5[_0xc37c('0x13')][_0xc37c('0x14')]===0x1f4){logger[_0xc37c('0x13')](_0xc37c('0x15'),_0x1eaa97,_0x3526b5[_0xc37c('0x13')]['message']);return _0x15a756(_0x3526b5['error'][_0xc37c('0x16')]);}logger[_0xc37c('0x13')](_0xc37c('0x15'),_0x1eaa97,_0x3526b5[_0xc37c('0x13')][_0xc37c('0x16')]);return _0x483c8d(_0x3526b5[_0xc37c('0x13')]['message']);}else{logger[_0xc37c('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1eaa97,_0xc37c('0xf'));_0x483c8d(_0x3526b5[_0xc37c('0x17')][_0xc37c('0x16')]);}})[_0xc37c('0x18')](function(_0x674ccf){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1eaa97,_0x674ccf);_0x15a756(_0x674ccf);});});} \ No newline at end of file +var _0xc978=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));var BPromise=require(_0x8c97('0x3'));var rs=require(_0x8c97('0x4'));var fs=require('fs');var Redis=require(_0x8c97('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c97('0x6'));var logger=require(_0x8c97('0x7'))(_0x8c97('0x8'));var config=require(_0x8c97('0x9'));var jayson=require(_0x8c97('0xa'));var client=jayson[_0x8c97('0xb')][_0x8c97('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x524196,_0x41a511,_0x1b5864){return new BPromise(function(_0x332cd1,_0x26ff40){return client[_0x8c97('0xd')](_0x524196,_0x1b5864)[_0x8c97('0xe')](function(_0x17aef0){logger['info'](_0x8c97('0xf'),_0x41a511,_0x8c97('0x10'));logger[_0x8c97('0x11')](_0x8c97('0x12'),_0x41a511,_0x8c97('0x10'),JSON[_0x8c97('0x13')](_0x17aef0));if(_0x17aef0[_0x8c97('0x14')]){if(_0x17aef0[_0x8c97('0x14')][_0x8c97('0x15')]===0x1f4){logger['error'](_0x8c97('0xf'),_0x41a511,_0x17aef0[_0x8c97('0x14')]['message']);return _0x26ff40(_0x17aef0[_0x8c97('0x14')][_0x8c97('0x16')]);}logger['error'](_0x8c97('0xf'),_0x41a511,_0x17aef0['error']['message']);return _0x332cd1(_0x17aef0['error'][_0x8c97('0x16')]);}else{logger[_0x8c97('0x17')](_0x8c97('0xf'),_0x41a511,_0x8c97('0x10'));_0x332cd1(_0x17aef0[_0x8c97('0x18')][_0x8c97('0x16')]);}})[_0x8c97('0x19')](function(_0xe3be1){logger[_0x8c97('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x41a511,_0xe3be1);_0x26ff40(_0xe3be1);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index c95a70f..9d8f45c 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 _0x98a6=['./pause.controller','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0x98a6,0x90));var _0x698a=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x98a6[_0x5e36d1];return _0x950b9e;};'use strict';var multer=require(_0x698a('0x0'));var util=require(_0x698a('0x1'));var path=require(_0x698a('0x2'));var timeout=require(_0x698a('0x3'));var express=require('express');var router=express[_0x698a('0x4')]();var fs_extra=require(_0x698a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x698a('0x6'));var config=require(_0x698a('0x7'));var controller=require(_0x698a('0x8'));router[_0x698a('0x9')]('/',auth['isAuthenticated'](),controller[_0x698a('0xa')]);router[_0x698a('0x9')](_0x698a('0xb'),auth[_0x698a('0xc')](),controller[_0x698a('0xd')]);router['post']('/',auth[_0x698a('0xc')](),controller['create']);router[_0x698a('0xe')](_0x698a('0xb'),auth['isAuthenticated'](),controller[_0x698a('0xf')]);router[_0x698a('0x10')](_0x698a('0xb'),auth[_0x698a('0xc')](),controller[_0x698a('0x11')]);module[_0x698a('0x12')]=router; \ No newline at end of file +var _0x0a78=['../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0a78,0x1ab));var _0x80a7=function(_0x1504f9,_0x17e295){_0x1504f9=_0x1504f9-0x0;var _0x2dc464=_0x0a78[_0x1504f9];return _0x2dc464;};'use strict';var multer=require(_0x80a7('0x0'));var util=require(_0x80a7('0x1'));var path=require('path');var timeout=require(_0x80a7('0x2'));var express=require('express');var router=express[_0x80a7('0x3')]();var fs_extra=require(_0x80a7('0x4'));var auth=require(_0x80a7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x80a7('0x6'));var controller=require('./pause.controller');router[_0x80a7('0x7')]('/',auth[_0x80a7('0x8')](),controller['index']);router[_0x80a7('0x7')](_0x80a7('0x9'),auth[_0x80a7('0x8')](),controller[_0x80a7('0xa')]);router[_0x80a7('0xb')]('/',auth[_0x80a7('0x8')](),controller['create']);router[_0x80a7('0xc')](_0x80a7('0x9'),auth[_0x80a7('0x8')](),controller['update']);router[_0x80a7('0xd')](_0x80a7('0x9'),auth['isAuthenticated'](),controller[_0x80a7('0xe')]);module[_0x80a7('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 22db7f9..31a5ae9 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 _0xcbd3=['exports','STRING','name','sequelize'];(function(_0x15888d,_0x965ee1){var _0x3ef1de=function(_0x5b702f){while(--_0x5b702f){_0x15888d['push'](_0x15888d['shift']());}};_0x3ef1de(++_0x965ee1);}(_0xcbd3,0x9b));var _0x3cbd=function(_0x4fa3de,_0x1b5109){_0x4fa3de=_0x4fa3de-0x0;var _0x5a0e25=_0xcbd3[_0x4fa3de];return _0x5a0e25;};'use strict';var Sequelize=require(_0x3cbd('0x0'));module[_0x3cbd('0x1')]={'name':{'type':Sequelize[_0x3cbd('0x2')],'unique':_0x3cbd('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3cbd('0x2')]}}; \ No newline at end of file +var _0x0cbb=['name','sequelize','exports','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0cbb,0x1b5));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb0cb('0x0'));module[_0xb0cb('0x1')]={'name':{'type':Sequelize[_0xb0cb('0x2')],'unique':_0xb0cb('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index bdd3ee8..3e43ec5 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 _0x3e32=['status','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Pause','includeAll','include','findAll','show','params','find','catch','create','role','Pauses','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','count'];(function(_0x1fba3d,_0x17fda9){var _0x49f7f3=function(_0x4ec44f){while(--_0x4ec44f){_0x1fba3d['push'](_0x1fba3d['shift']());}};_0x49f7f3(++_0x17fda9);}(_0x3e32,0x7c));var _0x23e3=function(_0xd15bdb,_0x4dc987){_0xd15bdb=_0xd15bdb-0x0;var _0x52b4e4=_0x3e32[_0xd15bdb];return _0x52b4e4;};'use strict';var emlformat=require(_0x23e3('0x0'));var rimraf=require(_0x23e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x23e3('0x2'));var moment=require('moment');var BPromise=require(_0x23e3('0x3'));var Mustache=require(_0x23e3('0x4'));var util=require('util');var path=require(_0x23e3('0x5'));var sox=require(_0x23e3('0x6'));var csv=require(_0x23e3('0x7'));var ejs=require(_0x23e3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x23e3('0x9'));var squel=require(_0x23e3('0xa'));var crypto=require(_0x23e3('0xb'));var jsforce=require(_0x23e3('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x23e3('0xd'));var Papa=require('papaparse');var Redis=require(_0x23e3('0xe'));var authService=require(_0x23e3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x23e3('0x10'));var hardwareService=require(_0x23e3('0x11'));var logger=require(_0x23e3('0x12'))(_0x23e3('0x13'));var utils=require(_0x23e3('0x14'));var config=require(_0x23e3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x23e3('0x16'))['db'];function respondWithStatusCode(_0x2860d2,_0x52587c){_0x52587c=_0x52587c||0xcc;return function(_0x166ba6){if(_0x166ba6){return _0x2860d2[_0x23e3('0x17')](_0x52587c);}return _0x2860d2['status'](_0x52587c)['end']();};}function respondWithResult(_0x1adac2,_0x4cbdab){_0x4cbdab=_0x4cbdab||0xc8;return function(_0x51a7bc){if(_0x51a7bc){return _0x1adac2['status'](_0x4cbdab)[_0x23e3('0x18')](_0x51a7bc);}};}function respondWithFilteredResult(_0x216c5e,_0x3ed9cf){return function(_0x47a595){if(_0x47a595){var _0x8a795=typeof _0x3ed9cf[_0x23e3('0x19')]==='undefined'&&typeof _0x3ed9cf[_0x23e3('0x1a')]==='undefined';var _0x3d1acd=_0x47a595[_0x23e3('0x1b')];var _0x46c3b3=_0x8a795?0x0:_0x3ed9cf['offset'];var _0x23e8bf=_0x8a795?_0x47a595[_0x23e3('0x1b')]:_0x3ed9cf['offset']+_0x3ed9cf['limit'];var _0x3847fe;if(_0x23e8bf>=_0x3d1acd){_0x23e8bf=_0x3d1acd;_0x3847fe=0xc8;}else{_0x3847fe=0xce;}_0x216c5e[_0x23e3('0x1c')](_0x3847fe);return _0x216c5e['set'](_0x23e3('0x1d'),_0x46c3b3+'-'+_0x23e8bf+'/'+_0x3d1acd)[_0x23e3('0x18')](_0x47a595);}return null;};}function patchUpdates(_0x4d5cc5){return function(_0x207dfd){try{jsonpatch['apply'](_0x207dfd,_0x4d5cc5,!![]);}catch(_0x4764c8){return BPromise[_0x23e3('0x1e')](_0x4764c8);}return _0x207dfd[_0x23e3('0x1f')]();};}function saveUpdates(_0x2323ec,_0x5110ae){return function(_0x3f93e2){if(_0x3f93e2){return _0x3f93e2[_0x23e3('0x20')](_0x2323ec)[_0x23e3('0x21')](function(_0x2b34d5){return _0x2b34d5;});}return null;};}function removeEntity(_0x3f4b1a,_0x7f924d){return function(_0x32adc5){if(_0x32adc5){return _0x32adc5[_0x23e3('0x22')]()[_0x23e3('0x21')](function(){var _0x3b953a=_0x32adc5[_0x23e3('0x23')]({'plain':!![]});var _0x30ee0e='Pauses';return db[_0x23e3('0x24')][_0x23e3('0x22')]({'where':{'type':_0x30ee0e,'resourceId':_0x3b953a['id']}})[_0x23e3('0x21')](function(){return _0x32adc5;});})['then'](function(){_0x3f4b1a[_0x23e3('0x1c')](0xcc)[_0x23e3('0x25')]();});}};}function handleEntityNotFound(_0x55ca4c,_0x371965){return function(_0x171a4b){if(!_0x171a4b){_0x55ca4c[_0x23e3('0x17')](0x194);}return _0x171a4b;};}function handleError(_0x493054,_0x386074){_0x386074=_0x386074||0x1f4;return function(_0x234445){logger[_0x23e3('0x26')](_0x234445[_0x23e3('0x27')]);if(_0x234445[_0x23e3('0x28')]){delete _0x234445[_0x23e3('0x28')];}_0x493054[_0x23e3('0x1c')](_0x386074)['send'](_0x234445);};}exports[_0x23e3('0x29')]=function(_0x1e71e8,_0x1f8fec){var _0xe26572={},_0x537717={},_0x2c19c5={'count':0x0,'rows':[]};var _0x24517c=_[_0x23e3('0x2a')](db['Pause'][_0x23e3('0x2b')],function(_0x208748){return{'name':_0x208748['fieldName'],'type':_0x208748['type'][_0x23e3('0x2c')]};});_0x537717[_0x23e3('0x2d')]=_[_0x23e3('0x2a')](_0x24517c,_0x23e3('0x28'));_0x537717[_0x23e3('0x2e')]=_[_0x23e3('0x2f')](_0x1e71e8[_0x23e3('0x2e')]);_0x537717[_0x23e3('0x30')]=_['intersection'](_0x537717[_0x23e3('0x2d')],_0x537717[_0x23e3('0x2e')]);_0xe26572[_0x23e3('0x31')]=_[_0x23e3('0x32')](_0x537717['model'],qs[_0x23e3('0x33')](_0x1e71e8['query']['fields']));_0xe26572['attributes']=_0xe26572[_0x23e3('0x31')][_0x23e3('0x34')]?_0xe26572['attributes']:_0x537717[_0x23e3('0x2d')];if(!_0x1e71e8[_0x23e3('0x2e')][_0x23e3('0x35')](_0x23e3('0x36'))){_0xe26572[_0x23e3('0x1a')]=qs[_0x23e3('0x1a')](_0x1e71e8[_0x23e3('0x2e')][_0x23e3('0x1a')]);_0xe26572[_0x23e3('0x19')]=qs['offset'](_0x1e71e8[_0x23e3('0x2e')][_0x23e3('0x19')]);}_0xe26572[_0x23e3('0x37')]=qs[_0x23e3('0x38')](_0x1e71e8[_0x23e3('0x2e')][_0x23e3('0x38')]);_0xe26572[_0x23e3('0x39')]=qs[_0x23e3('0x30')](_['pick'](_0x1e71e8['query'],_0x537717[_0x23e3('0x30')]),_0x24517c);if(_0x1e71e8[_0x23e3('0x2e')][_0x23e3('0x3a')]){_0xe26572[_0x23e3('0x39')]=_[_0x23e3('0x3b')](_0xe26572[_0x23e3('0x39')],{'$or':_[_0x23e3('0x2a')](_0x24517c,function(_0x15d242){if(_0x15d242['type']!=='VIRTUAL'){var _0x56d6ef={};_0x56d6ef[_0x15d242['name']]={'$like':'%'+_0x1e71e8[_0x23e3('0x2e')][_0x23e3('0x3a')]+'%'};return _0x56d6ef;}})});}_0xe26572=_[_0x23e3('0x3b')]({},_0xe26572,_0x1e71e8[_0x23e3('0x3c')]);var _0x22e04c={'where':_0xe26572['where']};return db[_0x23e3('0x3d')][_0x23e3('0x1b')](_0x22e04c)[_0x23e3('0x21')](function(_0x1d943e){_0x2c19c5[_0x23e3('0x1b')]=_0x1d943e;if(_0x1e71e8[_0x23e3('0x2e')][_0x23e3('0x3e')]){_0xe26572[_0x23e3('0x3f')]=[{'all':!![]}];}return db[_0x23e3('0x3d')][_0x23e3('0x40')](_0xe26572);})['then'](function(_0x52f58d){_0x2c19c5['rows']=_0x52f58d;return _0x2c19c5;})['then'](respondWithFilteredResult(_0x1f8fec,_0xe26572))['catch'](handleError(_0x1f8fec,null));};exports[_0x23e3('0x41')]=function(_0x25d33a,_0x28458f){var _0x5d72c3={'raw':!![],'where':{'id':_0x25d33a[_0x23e3('0x42')]['id']}},_0x14840d={};_0x14840d[_0x23e3('0x2d')]=_['keys'](db['Pause'][_0x23e3('0x2b')]);_0x14840d[_0x23e3('0x2e')]=_[_0x23e3('0x2f')](_0x25d33a['query']);_0x14840d[_0x23e3('0x30')]=_[_0x23e3('0x32')](_0x14840d['model'],_0x14840d[_0x23e3('0x2e')]);_0x5d72c3[_0x23e3('0x31')]=_[_0x23e3('0x32')](_0x14840d[_0x23e3('0x2d')],qs['fields'](_0x25d33a[_0x23e3('0x2e')][_0x23e3('0x33')]));_0x5d72c3[_0x23e3('0x31')]=_0x5d72c3[_0x23e3('0x31')][_0x23e3('0x34')]?_0x5d72c3[_0x23e3('0x31')]:_0x14840d['model'];if(_0x25d33a[_0x23e3('0x2e')][_0x23e3('0x3e')]){_0x5d72c3[_0x23e3('0x3f')]=[{'all':!![]}];}_0x5d72c3=_[_0x23e3('0x3b')]({},_0x5d72c3,_0x25d33a[_0x23e3('0x3c')]);return db[_0x23e3('0x3d')][_0x23e3('0x43')](_0x5d72c3)[_0x23e3('0x21')](handleEntityNotFound(_0x28458f,null))[_0x23e3('0x21')](respondWithResult(_0x28458f,null))[_0x23e3('0x44')](handleError(_0x28458f,null));};exports[_0x23e3('0x45')]=function(_0x42b4a6,_0x159d04){return db['Pause'][_0x23e3('0x45')](_0x42b4a6['body'],{})['then'](function(_0x97757d){var _0x545b55=_0x42b4a6['user'][_0x23e3('0x23')]({'plain':!![]});if(!_0x545b55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x545b55[_0x23e3('0x46')]==='user'){var _0x14da6f=_0x97757d[_0x23e3('0x23')]({'plain':!![]});var _0xdbbffb=_0x23e3('0x47');return db['UserProfileSection'][_0x23e3('0x43')]({'where':{'name':_0xdbbffb,'userProfileId':_0x545b55[_0x23e3('0x48')]},'raw':!![]})['then'](function(_0x3af3b4){if(_0x3af3b4&&_0x3af3b4[_0x23e3('0x49')]===0x0){return db[_0x23e3('0x24')][_0x23e3('0x45')]({'name':_0x14da6f['name'],'resourceId':_0x14da6f['id'],'type':_0x3af3b4[_0x23e3('0x28')],'sectionId':_0x3af3b4['id']},{})['then'](function(){return _0x97757d;});}else{return _0x97757d;}})[_0x23e3('0x44')](function(_0x33eda6){logger[_0x23e3('0x26')](_0x23e3('0x4a'),_0x33eda6);throw _0x33eda6;});}return _0x97757d;})[_0x23e3('0x21')](respondWithResult(_0x159d04,0xc9))[_0x23e3('0x44')](handleError(_0x159d04,null));};exports[_0x23e3('0x20')]=function(_0x517cb7,_0x12e1af){if(_0x517cb7['body']['id']){delete _0x517cb7[_0x23e3('0x4b')]['id'];}return db[_0x23e3('0x3d')][_0x23e3('0x43')]({'where':{'id':_0x517cb7['params']['id']}})[_0x23e3('0x21')](handleEntityNotFound(_0x12e1af,null))['then'](saveUpdates(_0x517cb7[_0x23e3('0x4b')],null))[_0x23e3('0x21')](respondWithResult(_0x12e1af,null))['catch'](handleError(_0x12e1af,null));};exports[_0x23e3('0x22')]=function(_0x46a123,_0x5553ac){return db['Pause']['find']({'where':{'id':_0x46a123['params']['id']}})['then'](handleEntityNotFound(_0x5553ac,null))[_0x23e3('0x21')](removeEntity(_0x5553ac,null))[_0x23e3('0x44')](handleError(_0x5553ac,null));}; \ No newline at end of file +var _0x250d=['user','UserProfileSection','userProfileId','UserProfileResource','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','get','Pauses','error','name','send','index','Pause','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0x250d,0x1f0));var _0xd250=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x250d[_0x53b133];return _0x5647e0;};'use strict';var emlformat=require(_0xd250('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd250('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd250('0x2'));var moment=require(_0xd250('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd250('0x4'));var util=require(_0xd250('0x5'));var path=require(_0xd250('0x6'));var sox=require(_0xd250('0x7'));var csv=require(_0xd250('0x8'));var ejs=require(_0xd250('0x9'));var fs=require('fs');var fs_extra=require(_0xd250('0xa'));var _=require(_0xd250('0xb'));var squel=require('squel');var crypto=require(_0xd250('0xc'));var jsforce=require(_0xd250('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd250('0xe'));var Papa=require(_0xd250('0xf'));var Redis=require(_0xd250('0x10'));var authService=require(_0xd250('0x11'));var qs=require(_0xd250('0x12'));var as=require(_0xd250('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd250('0x14'))('api');var utils=require(_0xd250('0x15'));var config=require(_0xd250('0x16'));var licenseUtil=require(_0xd250('0x17'));var db=require(_0xd250('0x18'))['db'];function respondWithStatusCode(_0x4a5b61,_0x4d1dd6){_0x4d1dd6=_0x4d1dd6||0xcc;return function(_0x22eed6){if(_0x22eed6){return _0x4a5b61[_0xd250('0x19')](_0x4d1dd6);}return _0x4a5b61[_0xd250('0x1a')](_0x4d1dd6)[_0xd250('0x1b')]();};}function respondWithResult(_0x1adfbe,_0x587677){_0x587677=_0x587677||0xc8;return function(_0x47b73d){if(_0x47b73d){return _0x1adfbe['status'](_0x587677)[_0xd250('0x1c')](_0x47b73d);}};}function respondWithFilteredResult(_0x25da95,_0x21fa5a){return function(_0x4d7911){if(_0x4d7911){var _0x59ff8e=typeof _0x21fa5a[_0xd250('0x1d')]===_0xd250('0x1e')&&typeof _0x21fa5a['limit']==='undefined';var _0x1ddf3f=_0x4d7911['count'];var _0x537d1a=_0x59ff8e?0x0:_0x21fa5a[_0xd250('0x1d')];var _0x11e721=_0x59ff8e?_0x4d7911[_0xd250('0x1f')]:_0x21fa5a[_0xd250('0x1d')]+_0x21fa5a['limit'];var _0x4f0d3c;if(_0x11e721>=_0x1ddf3f){_0x11e721=_0x1ddf3f;_0x4f0d3c=0xc8;}else{_0x4f0d3c=0xce;}_0x25da95[_0xd250('0x1a')](_0x4f0d3c);return _0x25da95['set'](_0xd250('0x20'),_0x537d1a+'-'+_0x11e721+'/'+_0x1ddf3f)[_0xd250('0x1c')](_0x4d7911);}return null;};}function patchUpdates(_0x20ac1c){return function(_0x57aa4d){try{jsonpatch[_0xd250('0x21')](_0x57aa4d,_0x20ac1c,!![]);}catch(_0x403b6a){return BPromise[_0xd250('0x22')](_0x403b6a);}return _0x57aa4d['save']();};}function saveUpdates(_0x3626f0,_0x40be7d){return function(_0x71f107){if(_0x71f107){return _0x71f107[_0xd250('0x23')](_0x3626f0)[_0xd250('0x24')](function(_0x5d782b){return _0x5d782b;});}return null;};}function removeEntity(_0x145080,_0x581ff5){return function(_0x19454d){if(_0x19454d){return _0x19454d[_0xd250('0x25')]()[_0xd250('0x24')](function(){var _0x1c94f9=_0x19454d[_0xd250('0x26')]({'plain':!![]});var _0x4736a9=_0xd250('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4736a9,'resourceId':_0x1c94f9['id']}})[_0xd250('0x24')](function(){return _0x19454d;});})[_0xd250('0x24')](function(){_0x145080[_0xd250('0x1a')](0xcc)[_0xd250('0x1b')]();});}};}function handleEntityNotFound(_0xc1a4e,_0x1ab03c){return function(_0x4c8d7e){if(!_0x4c8d7e){_0xc1a4e['sendStatus'](0x194);}return _0x4c8d7e;};}function handleError(_0x29212f,_0x2e2427){_0x2e2427=_0x2e2427||0x1f4;return function(_0x49b4af){logger[_0xd250('0x28')](_0x49b4af['stack']);if(_0x49b4af[_0xd250('0x29')]){delete _0x49b4af[_0xd250('0x29')];}_0x29212f[_0xd250('0x1a')](_0x2e2427)[_0xd250('0x2a')](_0x49b4af);};}exports[_0xd250('0x2b')]=function(_0x39e397,_0x1d5002){var _0x22891f={},_0x9a4df={},_0x12238c={'count':0x0,'rows':[]};var _0x37acac=_['map'](db[_0xd250('0x2c')]['rawAttributes'],function(_0x59acac){return{'name':_0x59acac[_0xd250('0x2d')],'type':_0x59acac['type'][_0xd250('0x2e')]};});_0x9a4df[_0xd250('0x2f')]=_['map'](_0x37acac,'name');_0x9a4df[_0xd250('0x30')]=_[_0xd250('0x31')](_0x39e397[_0xd250('0x30')]);_0x9a4df[_0xd250('0x32')]=_[_0xd250('0x33')](_0x9a4df[_0xd250('0x2f')],_0x9a4df['query']);_0x22891f['attributes']=_['intersection'](_0x9a4df[_0xd250('0x2f')],qs[_0xd250('0x34')](_0x39e397[_0xd250('0x30')][_0xd250('0x34')]));_0x22891f[_0xd250('0x35')]=_0x22891f['attributes']['length']?_0x22891f[_0xd250('0x35')]:_0x9a4df[_0xd250('0x2f')];if(!_0x39e397[_0xd250('0x30')][_0xd250('0x36')](_0xd250('0x37'))){_0x22891f[_0xd250('0x38')]=qs[_0xd250('0x38')](_0x39e397[_0xd250('0x30')]['limit']);_0x22891f[_0xd250('0x1d')]=qs['offset'](_0x39e397['query'][_0xd250('0x1d')]);}_0x22891f[_0xd250('0x39')]=qs[_0xd250('0x3a')](_0x39e397[_0xd250('0x30')][_0xd250('0x3a')]);_0x22891f[_0xd250('0x3b')]=qs['filters'](_[_0xd250('0x3c')](_0x39e397[_0xd250('0x30')],_0x9a4df[_0xd250('0x32')]),_0x37acac);if(_0x39e397[_0xd250('0x30')][_0xd250('0x3d')]){_0x22891f['where']=_[_0xd250('0x3e')](_0x22891f[_0xd250('0x3b')],{'$or':_[_0xd250('0x3f')](_0x37acac,function(_0x5e50a6){if(_0x5e50a6['type']!==_0xd250('0x40')){var _0x45e9ca={};_0x45e9ca[_0x5e50a6['name']]={'$like':'%'+_0x39e397[_0xd250('0x30')][_0xd250('0x3d')]+'%'};return _0x45e9ca;}})});}_0x22891f=_['merge']({},_0x22891f,_0x39e397[_0xd250('0x41')]);var _0x352e11={'where':_0x22891f[_0xd250('0x3b')]};return db[_0xd250('0x2c')]['count'](_0x352e11)[_0xd250('0x24')](function(_0x2af2e3){_0x12238c[_0xd250('0x1f')]=_0x2af2e3;if(_0x39e397[_0xd250('0x30')][_0xd250('0x42')]){_0x22891f[_0xd250('0x43')]=[{'all':!![]}];}return db[_0xd250('0x2c')]['findAll'](_0x22891f);})[_0xd250('0x24')](function(_0x584550){_0x12238c['rows']=_0x584550;return _0x12238c;})[_0xd250('0x24')](respondWithFilteredResult(_0x1d5002,_0x22891f))[_0xd250('0x44')](handleError(_0x1d5002,null));};exports[_0xd250('0x45')]=function(_0x55dde1,_0x246831){var _0x392d05={'raw':!![],'where':{'id':_0x55dde1[_0xd250('0x46')]['id']}},_0x2d245b={};_0x2d245b[_0xd250('0x2f')]=_[_0xd250('0x31')](db[_0xd250('0x2c')][_0xd250('0x47')]);_0x2d245b[_0xd250('0x30')]=_['keys'](_0x55dde1[_0xd250('0x30')]);_0x2d245b[_0xd250('0x32')]=_[_0xd250('0x33')](_0x2d245b[_0xd250('0x2f')],_0x2d245b[_0xd250('0x30')]);_0x392d05[_0xd250('0x35')]=_[_0xd250('0x33')](_0x2d245b[_0xd250('0x2f')],qs[_0xd250('0x34')](_0x55dde1[_0xd250('0x30')][_0xd250('0x34')]));_0x392d05[_0xd250('0x35')]=_0x392d05['attributes'][_0xd250('0x48')]?_0x392d05[_0xd250('0x35')]:_0x2d245b[_0xd250('0x2f')];if(_0x55dde1[_0xd250('0x30')][_0xd250('0x42')]){_0x392d05[_0xd250('0x43')]=[{'all':!![]}];}_0x392d05=_['merge']({},_0x392d05,_0x55dde1[_0xd250('0x41')]);return db[_0xd250('0x2c')][_0xd250('0x49')](_0x392d05)[_0xd250('0x24')](handleEntityNotFound(_0x246831,null))[_0xd250('0x24')](respondWithResult(_0x246831,null))['catch'](handleError(_0x246831,null));};exports[_0xd250('0x4a')]=function(_0x42658e,_0x2fa4dc){return db[_0xd250('0x2c')][_0xd250('0x4a')](_0x42658e[_0xd250('0x4b')],{})[_0xd250('0x24')](function(_0x278da9){var _0x334a2d=_0x42658e['user'][_0xd250('0x26')]({'plain':!![]});if(!_0x334a2d)throw new Error(_0xd250('0x4c'));if(_0x334a2d[_0xd250('0x4d')]===_0xd250('0x4e')){var _0x3e3622=_0x278da9[_0xd250('0x26')]({'plain':!![]});var _0x174ee9=_0xd250('0x27');return db[_0xd250('0x4f')][_0xd250('0x49')]({'where':{'name':_0x174ee9,'userProfileId':_0x334a2d[_0xd250('0x50')]},'raw':!![]})['then'](function(_0x27fd91){if(_0x27fd91&&_0x27fd91['autoAssociation']===0x0){return db[_0xd250('0x51')][_0xd250('0x4a')]({'name':_0x3e3622[_0xd250('0x29')],'resourceId':_0x3e3622['id'],'type':_0x27fd91[_0xd250('0x29')],'sectionId':_0x27fd91['id']},{})['then'](function(){return _0x278da9;});}else{return _0x278da9;}})[_0xd250('0x44')](function(_0x589079){logger[_0xd250('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x589079);throw _0x589079;});}return _0x278da9;})['then'](respondWithResult(_0x2fa4dc,0xc9))[_0xd250('0x44')](handleError(_0x2fa4dc,null));};exports[_0xd250('0x23')]=function(_0x5311ab,_0x346833){if(_0x5311ab[_0xd250('0x4b')]['id']){delete _0x5311ab[_0xd250('0x4b')]['id'];}return db[_0xd250('0x2c')][_0xd250('0x49')]({'where':{'id':_0x5311ab[_0xd250('0x46')]['id']}})['then'](handleEntityNotFound(_0x346833,null))[_0xd250('0x24')](saveUpdates(_0x5311ab['body'],null))[_0xd250('0x24')](respondWithResult(_0x346833,null))[_0xd250('0x44')](handleError(_0x346833,null));};exports[_0xd250('0x25')]=function(_0x3ff681,_0x503ad7){return db[_0xd250('0x2c')][_0xd250('0x49')]({'where':{'id':_0x3ff681[_0xd250('0x46')]['id']}})[_0xd250('0x24')](handleEntityNotFound(_0x503ad7,null))[_0xd250('0x24')](removeEntity(_0x503ad7,null))[_0xd250('0x44')](handleError(_0x503ad7,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ea41bbf..84eaea5 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x4a8aaf,_0x417ef1){var _0x33f7fb=function(_0x3132e3){while(--_0x3132e3){_0x4a8aaf['push'](_0x4a8aaf['shift']());}};_0x33f7fb(++_0x417ef1);}(_0xabce,0x103));var _0xeabc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xabce[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 0968bc9..9305dd1 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 _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(_0x59b48b,_0x584733){var _0x4c3f79=function(_0x3f2e94){while(--_0x3f2e94){_0x59b48b['push'](_0x59b48b['shift']());}};_0x4c3f79(++_0x584733);}(_0x7a54,0x106));var _0x47a5=function(_0x2f6327,_0x2437a2){_0x2f6327=_0x2f6327-0x0;var _0x12478a=_0x7a54[_0x2f6327];return _0x12478a;};'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 +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(_0x3bf298,_0x40793a){var _0x4f9268=function(_0x36540e){while(--_0x36540e){_0x3bf298['push'](_0x3bf298['shift']());}};_0x4f9268(++_0x40793a);}(_0xb10b,0x12a));var _0xbb10=function(_0x556dda,_0x3180e8){_0x556dda=_0x556dda-0x0;var _0x3405ce=_0xb10b[_0x556dda];return _0x3405ce;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 8fa8a02..b4c7732 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 _0x17ba=['single','upload','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','server/files/plugins','originalname','replace','format','basename','extname','post'];(function(_0x3c1bc1,_0x27777a){var _0x120f65=function(_0x4a2664){while(--_0x4a2664){_0x3c1bc1['push'](_0x3c1bc1['shift']());}};_0x120f65(++_0x27777a);}(_0x17ba,0xab));var _0xa17b=function(_0x3afb31,_0xfe01ac){_0x3afb31=_0x3afb31-0x0;var _0x2ba222=_0x17ba[_0x3afb31];return _0x2ba222;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router[_0xa17b('0xa')]('/:id/download',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);var upload=multer({'storage':multer[_0xa17b('0x12')]({'destination':function(_0x1e799a,_0x140943,_0x4382df){_0x4382df(null,path[_0xa17b('0x13')](config['root'],_0xa17b('0x14')));},'filename':function(_0x3e92e4,_0x3c3a8a,_0x52b7aa){_0x3c3a8a[_0xa17b('0x15')]=_0x3c3a8a[_0xa17b('0x15')][_0xa17b('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52b7aa(null,util[_0xa17b('0x17')]('%s-%s%s',path[_0xa17b('0x18')](_0x3c3a8a['originalname'],path[_0xa17b('0x19')](_0x3c3a8a[_0xa17b('0x15')])),Date['now'](),path[_0xa17b('0x19')](_0x3c3a8a[_0xa17b('0x15')])));}})});router[_0xa17b('0x1a')]('/',upload[_0xa17b('0x1b')]('file'),controller[_0xa17b('0x1c')]);router['post']('/webhook',controller['webhookPost']);router[_0xa17b('0x1d')](_0xa17b('0xf'),auth['isAuthenticated'](),controller[_0xa17b('0x1e')]);router[_0xa17b('0x1f')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x1f')]);module[_0xa17b('0x20')]=router; \ No newline at end of file +var _0x57d4=['../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','diskStorage','join','root','server/files/plugins','originalname','%s-%s%s','basename','extname','now','single','file','upload','webhookPost','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14d3cc,_0x567831){var _0x1f822b=function(_0x1eeeb9){while(--_0x1eeeb9){_0x14d3cc['push'](_0x14d3cc['shift']());}};_0x1f822b(++_0x567831);}(_0x57d4,0x78));var _0x457d=function(_0x549779,_0x4afa01){_0x549779=_0x549779-0x0;var _0x223e3c=_0x57d4[_0x549779];return _0x223e3c;};'use strict';var multer=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var path=require('path');var timeout=require(_0x457d('0x2'));var express=require(_0x457d('0x3'));var router=express[_0x457d('0x4')]();var fs_extra=require(_0x457d('0x5'));var auth=require(_0x457d('0x6'));var interaction=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var controller=require(_0x457d('0x9'));router[_0x457d('0xa')]('/',auth[_0x457d('0xb')](),controller[_0x457d('0xc')]);router['get'](_0x457d('0xd'),controller[_0x457d('0xe')]);router['get']('/:id',auth[_0x457d('0xb')](),controller[_0x457d('0xf')]);router[_0x457d('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x457d('0x10')]({'destination':function(_0x38ec93,_0x449f48,_0x128e09){_0x128e09(null,path[_0x457d('0x11')](config[_0x457d('0x12')],_0x457d('0x13')));},'filename':function(_0x24cf65,_0xe7d200,_0x5abf49){_0xe7d200[_0x457d('0x14')]=_0xe7d200[_0x457d('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5abf49(null,util['format'](_0x457d('0x15'),path[_0x457d('0x16')](_0xe7d200[_0x457d('0x14')],path[_0x457d('0x17')](_0xe7d200[_0x457d('0x14')])),Date[_0x457d('0x18')](),path[_0x457d('0x17')](_0xe7d200[_0x457d('0x14')])));}})});router['post']('/',upload[_0x457d('0x19')](_0x457d('0x1a')),controller[_0x457d('0x1b')]);router['post']('/webhook',controller[_0x457d('0x1c')]);router['put'](_0x457d('0x1d'),auth[_0x457d('0xb')](),controller['update']);router[_0x457d('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x457d('0x1e')]);module[_0x457d('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index c9114f2..e63de33 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 _0x6968=['ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x12783e,_0x29ae3f){var _0x559c9a=function(_0x23107b){while(--_0x23107b){_0x12783e['push'](_0x12783e['shift']());}};_0x559c9a(++_0x29ae3f);}(_0x6968,0xd5));var _0x8696=function(_0x5be8ab,_0x4000a6){_0x5be8ab=_0x5be8ab-0x0;var _0x35914d=_0x6968[_0x5be8ab];return _0x35914d;};'use strict';var Sequelize=require(_0x8696('0x0'));module[_0x8696('0x1')]={'name':{'type':Sequelize[_0x8696('0x2')]},'type':{'type':Sequelize[_0x8696('0x3')]('html',_0x8696('0x4'))},'description':{'type':Sequelize[_0x8696('0x5')]},'version':{'type':Sequelize[_0x8696('0x5')]},'path':{'type':Sequelize[_0x8696('0x2')],'comment':_0x8696('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8696('0x7')},'sidebar':{'type':Sequelize[_0x8696('0x3')](_0x8696('0x8'),'agentOnly',_0x8696('0x9'),_0x8696('0xa')),'defaultValue':_0x8696('0x9'),'comment':_0x8696('0xb')},'icon':{'type':Sequelize[_0x8696('0x2')]},'adminUrl':{'type':Sequelize[_0x8696('0x2')]},'agentUrl':{'type':Sequelize[_0x8696('0x2')]},'scriptName':{'type':Sequelize[_0x8696('0x2')]},'scriptPath':{'type':Sequelize[_0x8696('0x2')]}}; \ No newline at end of file +var _0x1961=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly'];(function(_0x15413e,_0x36ccf6){var _0x3b58ff=function(_0x3cfd75){while(--_0x3cfd75){_0x15413e['push'](_0x15413e['shift']());}};_0x3b58ff(++_0x36ccf6);}(_0x1961,0xfa));var _0x1196=function(_0x1f1405,_0x20d0ae){_0x1f1405=_0x1f1405-0x0;var _0x330a27=_0x1961[_0x1f1405];return _0x330a27;};'use strict';var Sequelize=require(_0x1196('0x0'));module[_0x1196('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1196('0x2')]('html','script')},'description':{'type':Sequelize[_0x1196('0x3')]},'version':{'type':Sequelize[_0x1196('0x3')]},'path':{'type':Sequelize[_0x1196('0x4')],'comment':_0x1196('0x5')},'active':{'type':Sequelize[_0x1196('0x6')],'defaultValue':0x0,'comment':_0x1196('0x7')},'sidebar':{'type':Sequelize[_0x1196('0x2')](_0x1196('0x8'),_0x1196('0x9'),_0x1196('0xa'),_0x1196('0xb')),'defaultValue':_0x1196('0xa'),'comment':_0x1196('0xc')},'icon':{'type':Sequelize[_0x1196('0x4')]},'adminUrl':{'type':Sequelize[_0x1196('0x4')]},'agentUrl':{'type':Sequelize[_0x1196('0x4')]},'scriptName':{'type':Sequelize[_0x1196('0x4')]},'scriptPath':{'type':Sequelize[_0x1196('0x4')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 00bab1a..94231a8 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 _0x1e38=['Invalid\x20manifest:\x20parameters\x20missing','html','admin','views','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','agent','Warning:\x20agent\x20view\x20not\x20specified','plugins','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','desk.js','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./plugin.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','get','Plugins','UserProfileResource','end','error','name','send','index','Plugin','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','find','download','path','join','server/files/plugins','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','attachments/**/*','finalize','close','Plugin\x20not\x20found','%s.zip','Error','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','extname','root','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x1e38,0xdb));var _0x81e3=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0x1e38[_0x3fb9dd];return _0x20136a;};'use strict';var emlformat=require(_0x81e3('0x0'));var rimraf=require(_0x81e3('0x1'));var zipdir=require(_0x81e3('0x2'));var jsonpatch=require(_0x81e3('0x3'));var rp=require(_0x81e3('0x4'));var moment=require(_0x81e3('0x5'));var BPromise=require(_0x81e3('0x6'));var Mustache=require(_0x81e3('0x7'));var util=require('util');var path=require('path');var sox=require(_0x81e3('0x8'));var csv=require(_0x81e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81e3('0xa'));var squel=require(_0x81e3('0xb'));var crypto=require('crypto');var jsforce=require(_0x81e3('0xc'));var deskjs=require(_0x81e3('0xd'));var toCsv=require(_0x81e3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0x81e3('0xe'));var rimraf=require(_0x81e3('0x1'));var archiver=require(_0x81e3('0xf'));var Redis=require(_0x81e3('0x10'));var authService=require(_0x81e3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x81e3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x81e3('0x13'));var utils=require(_0x81e3('0x14'));var config=require(_0x81e3('0x15'));var licenseUtil=require(_0x81e3('0x16'));var db=require(_0x81e3('0x17'))['db'];config[_0x81e3('0x18')]=_['defaults'](config[_0x81e3('0x18')],{'host':_0x81e3('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x81e3('0x1a'))[_0x81e3('0x1b')](socket);function respondWithStatusCode(_0x30c0a6,_0x2ab08b){_0x2ab08b=_0x2ab08b||0xcc;return function(_0x1c0222){if(_0x1c0222){return _0x30c0a6[_0x81e3('0x1c')](_0x2ab08b);}return _0x30c0a6[_0x81e3('0x1d')](_0x2ab08b)['end']();};}function respondWithResult(_0x2fe974,_0x423b57){_0x423b57=_0x423b57||0xc8;return function(_0x4e38ed){if(_0x4e38ed){return _0x2fe974[_0x81e3('0x1d')](_0x423b57)['json'](_0x4e38ed);}};}function respondWithFilteredResult(_0x597431,_0x1b2275){return function(_0x1e57c6){if(_0x1e57c6){var _0xfa650d=typeof _0x1b2275[_0x81e3('0x1e')]===_0x81e3('0x1f')&&typeof _0x1b2275[_0x81e3('0x20')]===_0x81e3('0x1f');var _0x184757=_0x1e57c6[_0x81e3('0x21')];var _0x29c945=_0xfa650d?0x0:_0x1b2275['offset'];var _0x520801=_0xfa650d?_0x1e57c6[_0x81e3('0x21')]:_0x1b2275[_0x81e3('0x1e')]+_0x1b2275[_0x81e3('0x20')];var _0x1a66e6;if(_0x520801>=_0x184757){_0x520801=_0x184757;_0x1a66e6=0xc8;}else{_0x1a66e6=0xce;}_0x597431[_0x81e3('0x1d')](_0x1a66e6);return _0x597431[_0x81e3('0x22')](_0x81e3('0x23'),_0x29c945+'-'+_0x520801+'/'+_0x184757)[_0x81e3('0x24')](_0x1e57c6);}return null;};}function patchUpdates(_0x1f02fc){return function(_0x3abf38){try{jsonpatch['apply'](_0x3abf38,_0x1f02fc,!![]);}catch(_0x191adc){return BPromise[_0x81e3('0x25')](_0x191adc);}return _0x3abf38[_0x81e3('0x26')]();};}function saveUpdates(_0x9ca83a,_0x494ae7){return function(_0xf97471){if(_0xf97471){return _0xf97471['update'](_0x9ca83a)[_0x81e3('0x27')](function(_0x2078e4){return _0x2078e4;});}return null;};}function removeEntity(_0x1e16b8,_0xa0376f){return function(_0x2a13e4){if(_0x2a13e4){return _0x2a13e4[_0x81e3('0x28')]()[_0x81e3('0x27')](function(){var _0xe1949b=_0x2a13e4[_0x81e3('0x29')]({'plain':!![]});var _0x215214=_0x81e3('0x2a');return db[_0x81e3('0x2b')][_0x81e3('0x28')]({'where':{'type':_0x215214,'resourceId':_0xe1949b['id']}})['then'](function(){return _0x2a13e4;});})[_0x81e3('0x27')](function(){_0x1e16b8[_0x81e3('0x1d')](0xcc)[_0x81e3('0x2c')]();});}};}function handleEntityNotFound(_0xdac525,_0x1d367d){return function(_0x21eed3){if(!_0x21eed3){_0xdac525[_0x81e3('0x1c')](0x194);}return _0x21eed3;};}function handleError(_0x279cd9,_0x52c19c){_0x52c19c=_0x52c19c||0x1f4;return function(_0x268e82){logger[_0x81e3('0x2d')](_0x268e82['stack']);if(_0x268e82[_0x81e3('0x2e')]){delete _0x268e82[_0x81e3('0x2e')];}_0x279cd9[_0x81e3('0x1d')](_0x52c19c)[_0x81e3('0x2f')](_0x268e82);};}exports[_0x81e3('0x30')]=function(_0x472ca9,_0x3ef510){var _0x4bd9c1={},_0x288cb0={},_0x419abd={'count':0x0,'rows':[]};var _0x29386f=_['map'](db[_0x81e3('0x31')][_0x81e3('0x32')],function(_0x113aa2){return{'name':_0x113aa2['fieldName'],'type':_0x113aa2[_0x81e3('0x33')][_0x81e3('0x34')]};});_0x288cb0[_0x81e3('0x35')]=_[_0x81e3('0x36')](_0x29386f,'name');_0x288cb0['query']=_['keys'](_0x472ca9[_0x81e3('0x37')]);_0x288cb0[_0x81e3('0x38')]=_['intersection'](_0x288cb0[_0x81e3('0x35')],_0x288cb0[_0x81e3('0x37')]);_0x4bd9c1[_0x81e3('0x39')]=_[_0x81e3('0x3a')](_0x288cb0['model'],qs[_0x81e3('0x3b')](_0x472ca9[_0x81e3('0x37')]['fields']));_0x4bd9c1[_0x81e3('0x39')]=_0x4bd9c1['attributes']['length']?_0x4bd9c1[_0x81e3('0x39')]:_0x288cb0[_0x81e3('0x35')];if(!_0x472ca9[_0x81e3('0x37')]['hasOwnProperty']('nolimit')){_0x4bd9c1['limit']=qs[_0x81e3('0x20')](_0x472ca9[_0x81e3('0x37')]['limit']);_0x4bd9c1['offset']=qs[_0x81e3('0x1e')](_0x472ca9[_0x81e3('0x37')]['offset']);}_0x4bd9c1[_0x81e3('0x3c')]=qs[_0x81e3('0x3d')](_0x472ca9[_0x81e3('0x37')][_0x81e3('0x3d')]);_0x4bd9c1['where']=qs[_0x81e3('0x38')](_[_0x81e3('0x3e')](_0x472ca9[_0x81e3('0x37')],_0x288cb0[_0x81e3('0x38')]),_0x29386f);if(_0x472ca9[_0x81e3('0x37')][_0x81e3('0x3f')]){_0x4bd9c1[_0x81e3('0x40')]=_[_0x81e3('0x41')](_0x4bd9c1[_0x81e3('0x40')],{'$or':_[_0x81e3('0x36')](_0x29386f,function(_0x19819d){if(_0x19819d[_0x81e3('0x33')]!==_0x81e3('0x42')){var _0x5349f1={};_0x5349f1[_0x19819d['name']]={'$like':'%'+_0x472ca9[_0x81e3('0x37')]['filter']+'%'};return _0x5349f1;}})});}_0x4bd9c1=_[_0x81e3('0x41')]({},_0x4bd9c1,_0x472ca9[_0x81e3('0x43')]);var _0x7b414a={'where':_0x4bd9c1[_0x81e3('0x40')]};return db[_0x81e3('0x31')][_0x81e3('0x21')](_0x7b414a)[_0x81e3('0x27')](function(_0x1787ab){_0x419abd[_0x81e3('0x21')]=_0x1787ab;if(_0x472ca9['query'][_0x81e3('0x44')]){_0x4bd9c1[_0x81e3('0x45')]=[{'all':!![]}];}return db[_0x81e3('0x31')][_0x81e3('0x46')](_0x4bd9c1);})[_0x81e3('0x27')](function(_0x58841b){_0x419abd[_0x81e3('0x47')]=_0x58841b;return _0x419abd;})[_0x81e3('0x27')](respondWithFilteredResult(_0x3ef510,_0x4bd9c1))[_0x81e3('0x48')](handleError(_0x3ef510,null));};exports['show']=function(_0x3afc38,_0x5c02a3){var _0x12aea0={'raw':!![],'where':{'id':_0x3afc38[_0x81e3('0x49')]['id']}},_0x465580={};_0x465580[_0x81e3('0x35')]=_[_0x81e3('0x4a')](db[_0x81e3('0x31')][_0x81e3('0x32')]);_0x465580[_0x81e3('0x37')]=_[_0x81e3('0x4a')](_0x3afc38['query']);_0x465580[_0x81e3('0x38')]=_[_0x81e3('0x3a')](_0x465580['model'],_0x465580['query']);_0x12aea0[_0x81e3('0x39')]=_[_0x81e3('0x3a')](_0x465580[_0x81e3('0x35')],qs[_0x81e3('0x3b')](_0x3afc38[_0x81e3('0x37')][_0x81e3('0x3b')]));_0x12aea0[_0x81e3('0x39')]=_0x12aea0[_0x81e3('0x39')][_0x81e3('0x4b')]?_0x12aea0['attributes']:_0x465580[_0x81e3('0x35')];if(_0x3afc38[_0x81e3('0x37')][_0x81e3('0x44')]){_0x12aea0[_0x81e3('0x45')]=[{'all':!![]}];}_0x12aea0=_[_0x81e3('0x41')]({},_0x12aea0,_0x3afc38['options']);return db[_0x81e3('0x31')][_0x81e3('0x4c')](_0x12aea0)[_0x81e3('0x27')](handleEntityNotFound(_0x5c02a3,null))[_0x81e3('0x27')](respondWithResult(_0x5c02a3,null))[_0x81e3('0x48')](handleError(_0x5c02a3,null));};exports[_0x81e3('0x4d')]=function(_0x260834,_0x4daa08,_0x3f1f29){return db[_0x81e3('0x31')]['find']({'where':{'id':_0x260834[_0x81e3('0x49')]['id']},'attributes':[_0x81e3('0x2e'),_0x81e3('0x4e')],'raw':!![]})[_0x81e3('0x27')](handleEntityNotFound(_0x4daa08,null))[_0x81e3('0x27')](function(_0x1eef2c){if(_0x1eef2c){var _0x1ec5f7=path[_0x81e3('0x4f')](config['root'],_0x81e3('0x50'),util['format']('%s.zip',path[_0x81e3('0x51')](_0x1eef2c['path'])));var _0x3c8b63=fs[_0x81e3('0x52')](_0x1ec5f7);var _0x403ac9=archiver(_0x81e3('0x53'),{'zlib':{'level':0x9}});_0x403ac9['on'](_0x81e3('0x54'),function(_0x486abb){if(_0x486abb[_0x81e3('0x55')]===_0x81e3('0x56')){logger['error'](_0x486abb);}else{throw new db[(_0x81e3('0x57'))]['Error'](_0x81e3('0x58'));}});_0x403ac9['on'](_0x81e3('0x2d'),function(_0x497b46){throw new db[(_0x81e3('0x57'))]['Error'](_0x81e3('0x58'));});_0x403ac9[_0x81e3('0x59')](_0x3c8b63);_0x403ac9[_0x81e3('0x5a')](_0x81e3('0x5b'),{'cwd':path[_0x81e3('0x4f')](config['root'],'server/files/plugins',path[_0x81e3('0x5c')](_0x1eef2c[_0x81e3('0x4e')])),'ignore':[path[_0x81e3('0x4f')](path[_0x81e3('0x51')](_0x1eef2c[_0x81e3('0x4e')]),'node_modules/**/*'),path[_0x81e3('0x4f')](path[_0x81e3('0x51')](_0x1eef2c[_0x81e3('0x4e')]),_0x81e3('0x5d'))],'nodir':!![]})[_0x81e3('0x5e')]();_0x3c8b63['on'](_0x81e3('0x5f'),function(){if(!fs['existsSync'](_0x1ec5f7)){throw new db['Sequelize']['Error'](_0x81e3('0x60'));}return _0x4daa08['download'](_0x1ec5f7,util['format'](_0x81e3('0x61'),path[_0x81e3('0x51')](_0x1eef2c[_0x81e3('0x4e')])),function(_0x172836){if(_0x172836){throw new db['Sequelize'][(_0x81e3('0x62'))](_0x81e3('0x63'));}fs['unlinkSync'](_0x1ec5f7);logger[_0x81e3('0x64')](_0x81e3('0x65'));logger[_0x81e3('0x64')]('Temporary\x20file\x20removed');});});}return null;})[_0x81e3('0x48')](handleError(_0x4daa08,null));};exports[_0x81e3('0x66')]=function(_0x2eefbe,_0x358a67,_0x21fbd5){var _0x1e6738=path[_0x81e3('0x51')](_0x2eefbe[_0x81e3('0x67')][_0x81e3('0x68')],path[_0x81e3('0x69')](_0x2eefbe[_0x81e3('0x67')][_0x81e3('0x68')]));var _0x52a269=path[_0x81e3('0x4f')](config['root'],_0x81e3('0x50'),_0x2eefbe[_0x81e3('0x67')][_0x81e3('0x68')]);var _0x5aed2e=path[_0x81e3('0x4f')](config[_0x81e3('0x6a')],_0x81e3('0x50'),_0x1e6738);logger[_0x81e3('0x64')](_0x81e3('0x6b'),_0x52a269);logger['info'](_0x81e3('0x6c'),_0x5aed2e);try{fs[_0x81e3('0x6d')](_0x52a269,parseInt(_0x81e3('0x6e'),0x8));extract(_0x52a269,{'dir':_0x5aed2e},function(_0x5d2dd5){if(_0x5d2dd5){logger[_0x81e3('0x2d')](_0x5d2dd5);handleError(_0x5d2dd5,!![]);};var _0x23a6ac=fs[_0x81e3('0x6f')](_0x5aed2e);if(_0x23a6ac[_0x81e3('0x4b')]>0x1){removeReferences(_0x52a269,_0x5aed2e);logger['error'](_0x81e3('0x70'));return _0x21fbd5(new Error(_0x81e3('0x70')));}var _0x5976a3=fs[_0x81e3('0x71')](path[_0x81e3('0x4f')](_0x5aed2e,_0x23a6ac[0x0]));if(_0x5976a3[_0x81e3('0x72')]()){removeReferences(_0x52a269,_0x5aed2e);logger[_0x81e3('0x2d')]('Invalid\x20plugin\x20structure');return _0x21fbd5(new Error(_0x81e3('0x70')));}if(_0x5976a3[_0x81e3('0x73')]()){var _0x5c0321=fs[_0x81e3('0x6f')](path['join'](_0x5aed2e,_0x23a6ac[0x0]));if(_0x5c0321[_0x81e3('0x4b')]===0x0){removeReferences(_0x52a269,_0x5aed2e);logger[_0x81e3('0x2d')](_0x81e3('0x70'));return _0x21fbd5(new Error(_0x81e3('0x70')));}var _0x409668=_0x5c0321[_0x81e3('0x74')](function(_0x2abf7d){return _0x2abf7d===_0x81e3('0x75');});if(!_0x409668){return _0x21fbd5(new Error(_0x81e3('0x76')));}var _0x2dccb0=fs['readFileSync'](path[_0x81e3('0x4f')](_0x5aed2e,_0x23a6ac[0x0],_0x81e3('0x75')));var _0x1a8072=JSON[_0x81e3('0x77')](_0x2dccb0);if('undefined'==typeof _0x1a8072['name']){return _0x21fbd5(new Error(_0x81e3('0x78')));}if(_0x81e3('0x1f')==typeof _0x1a8072[_0x81e3('0x33')]){return _0x21fbd5(new Error(_0x81e3('0x79')));}if(_0x81e3('0x1f')==typeof _0x1a8072[_0x81e3('0x7a')]){return _0x21fbd5(new Error(_0x81e3('0x7b')));}if(_0x81e3('0x1f')==typeof _0x1a8072[_0x81e3('0x7c')]){return _0x21fbd5(new Error(_0x81e3('0x7d')));}if(_0x1a8072[_0x81e3('0x33')]===_0x81e3('0x7e')){if('undefined'==typeof _0x1a8072[_0x81e3('0x7c')]['views']){return _0x21fbd5(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x81e3('0x1f')==typeof _0x1a8072['parameters']['views'][_0x81e3('0x7f')]&&_0x81e3('0x1f')==typeof _0x1a8072['parameters'][_0x81e3('0x80')]['agent']){return _0x21fbd5(new Error(_0x81e3('0x81')));}}else if(_0x1a8072[_0x81e3('0x33')]===_0x81e3('0x82')){if('undefined'==typeof _0x1a8072[_0x81e3('0x7c')][_0x81e3('0x83')]){return _0x21fbd5(new Error(_0x81e3('0x84')));}if(_0x81e3('0x1f')==typeof _0x1a8072[_0x81e3('0x7c')][_0x81e3('0x85')]){return _0x21fbd5(new Error(_0x81e3('0x86')));}}else{return _0x21fbd5(new Error(_0x81e3('0x87')));}var _0x2b86c0=_0x1a8072[_0x81e3('0x2e')];var _0xcd366e=_0x1a8072[_0x81e3('0x88')];var _0x21dbf9=_0x1a8072[_0x81e3('0x33')];var _0x411ed5=_0x1a8072[_0x81e3('0x89')]?_0x1a8072[_0x81e3('0x89')]:_0x81e3('0x8a');var _0x1bad4f=_0x1a8072['icon']?_0x1a8072[_0x81e3('0x8b')]:_0x81e3('0x8c');var _0x2cf19c='';var _0x516128='';var _0x398248='';var _0x3f295e='';var _0x342272=_0x1a8072['version'];if(_0x21dbf9===_0x81e3('0x7e')){if(_0x81e3('0x1f')!=typeof _0x1a8072['parameters'][_0x81e3('0x80')][_0x81e3('0x7f')]){var _0x422ea0=_0x1a8072[_0x81e3('0x7c')][_0x81e3('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x81e3('0x8d')](_0x422ea0)){_0x2cf19c=path[_0x81e3('0x4f')]('plugins',_0x1e6738,_0x23a6ac[0x0],_0x422ea0);}else{_0x2cf19c=_0x422ea0;}}else{logger[_0x81e3('0x64')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x81e3('0x1f')!=typeof _0x1a8072[_0x81e3('0x7c')]['views'][_0x81e3('0x8e')]){var _0x4217cf=_0x1a8072[_0x81e3('0x7c')][_0x81e3('0x80')][_0x81e3('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0x81e3('0x8d')](_0x4217cf)){_0x516128=path[_0x81e3('0x4f')]('plugins',_0x1e6738,_0x23a6ac[0x0],_0x4217cf);}else{_0x516128=_0x4217cf;}}else{logger[_0x81e3('0x64')](_0x81e3('0x8f'));}}else if(_0x21dbf9==='script'){_0x398248=_0x1a8072[_0x81e3('0x7c')][_0x81e3('0x83')];_0x3f295e=_0x1a8072[_0x81e3('0x7c')][_0x81e3('0x85')];if('undefined'!=typeof _0x1a8072[_0x81e3('0x7c')]['views']){if(_0x81e3('0x1f')!=typeof _0x1a8072[_0x81e3('0x7c')]['views'][_0x81e3('0x7f')]){var _0x422ea0=_0x1a8072[_0x81e3('0x7c')]['views'][_0x81e3('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x422ea0)){_0x2cf19c=path['join'](_0x81e3('0x90'),_0x1e6738,_0x23a6ac[0x0],_0x422ea0);}else{_0x2cf19c=_0x422ea0;}}if('undefined'!=typeof _0x1a8072[_0x81e3('0x7c')][_0x81e3('0x80')]['agent']){var _0x4217cf=_0x1a8072['parameters'][_0x81e3('0x80')][_0x81e3('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0x81e3('0x8d')](_0x4217cf)){_0x516128=path['join'](_0x81e3('0x90'),_0x1e6738,_0x23a6ac[0x0],_0x4217cf);}else{_0x516128=_0x4217cf;}}}}var _0x13c83c={'name':_0x2b86c0,'description':_0xcd366e,'path':path[_0x81e3('0x4f')](_0x1e6738,_0x23a6ac[0x0]),'type':_0x21dbf9,'sidebar':_0x411ed5,'icon':_0x1bad4f,'adminUrl':_0x2cf19c,'agentUrl':_0x516128,'scriptName':_0x398248,'scriptPath':_0x3f295e,'version':_0x342272};removeReferences(_0x52a269,null);return db[_0x81e3('0x31')][_0x81e3('0x91')](_0x13c83c)[_0x81e3('0x27')](function(_0x361006){var _0x3eb1d8={'role':_0x2eefbe[_0x81e3('0x92')][_0x81e3('0x93')],'userProfileId':_0x2eefbe[_0x81e3('0x92')][_0x81e3('0x94')]};if(!_0x3eb1d8)throw new Error(_0x81e3('0x95'));if(_0x3eb1d8[_0x81e3('0x93')]===_0x81e3('0x96')){var _0x5d9bf1=_0x361006['get']({'plain':!![]});return db[_0x81e3('0x97')][_0x81e3('0x4c')]({'where':{'name':_0x81e3('0x2a'),'userProfileId':_0x3eb1d8[_0x81e3('0x94')]},'raw':!![]})['then'](function(_0xe5ef2){if(_0xe5ef2&&_0xe5ef2[_0x81e3('0x98')]===0x0){return db['UserProfileResource'][_0x81e3('0x91')]({'name':_0x5d9bf1['name'],'resourceId':_0x5d9bf1['id'],'type':_0xe5ef2[_0x81e3('0x2e')],'sectionId':_0xe5ef2['id']},{})[_0x81e3('0x27')](function(){return _0x361006;});}else{return _0x361006;}})[_0x81e3('0x48')](function(_0x474ee2){logger[_0x81e3('0x2d')](_0x81e3('0x99'),_0x474ee2);throw _0x474ee2;});}return _0x361006;})['then'](respondWithResult(_0x358a67,null))['catch'](handleError(_0x358a67,null));}});}catch(_0x38be2d){_0x358a67['status'](0x1f4)['send'](_0x38be2d);}};function removeReferences(_0x807930,_0x5038fd){try{if(_0x807930){fs[_0x81e3('0x9a')](_0x807930);logger[_0x81e3('0x64')]('Zip\x20archive\x20removed');}if(_0x5038fd){rimraf(_0x5038fd,function(){});logger[_0x81e3('0x64')](_0x81e3('0x9b'));}}catch(_0xc4234b){logger[_0x81e3('0x2d')](_0xc4234b);}}exports['update']=function(_0xfb5bee,_0x35ac9d,_0x44a8f0){return db[_0x81e3('0x31')]['find']({'where':{'id':_0xfb5bee[_0x81e3('0x49')]['id']}})['then'](handleEntityNotFound(_0x35ac9d,null))[_0x81e3('0x27')](saveUpdates(_0xfb5bee['body'],null))[_0x81e3('0x27')](respondWithResult(_0x35ac9d,null))['catch'](handleError(_0x35ac9d,null));};exports['delete']=function(_0x2f1600,_0x5a00f3,_0xd4964b){return db[_0x81e3('0x31')]['find']({'where':{'id':_0x2f1600[_0x81e3('0x49')]['id']}})[_0x81e3('0x27')](function(_0x260205){if(_0x260205){return _0x260205[_0x81e3('0x28')]();}})[_0x81e3('0x27')](function(_0x33685a){rimraf(path[_0x81e3('0x4f')](config[_0x81e3('0x6a')],_0x81e3('0x50'),path[_0x81e3('0x5c')](_0x33685a[_0x81e3('0x4e')])),function(){});return _0x33685a;})['then'](handleEntityNotFound(_0x5a00f3,null))[_0x81e3('0x27')](respondWithStatusCode(_0x5a00f3,null))[_0x81e3('0x48')](handleError(_0x5a00f3,null));};exports[_0x81e3('0x9c')]=function(_0x348588,_0x51d57a,_0x443a14){return BPromise[_0x81e3('0x9d')]()[_0x81e3('0x27')](function(){if(!_0x348588[_0x81e3('0x37')]['path']){throw new Error(_0x81e3('0x9e'));}if(!_0x348588[_0x81e3('0x37')][_0x81e3('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1b9a87=_0x348588[_0x81e3('0x37')][_0x81e3('0xa0')]?_0x348588[_0x81e3('0x37')]['hostname']+':'+_0x348588[_0x81e3('0x37')]['port']:'http://localhost:'+_0x348588[_0x81e3('0x37')][_0x81e3('0x9f')];var _0x4c7c96=_0x348588[_0x81e3('0x37')][_0x81e3('0x24')]?_0x348588['query']['json']:!![];var _0x8bd287=_0x348588[_0x81e3('0x37')][_0x81e3('0xa1')]?_0x348588[_0x81e3('0x37')][_0x81e3('0xa1')]:null;var _0x3bc2b7={'method':_0x348588[_0x81e3('0xa2')],'uri':util['format'](_0x81e3('0xa3'),_0x1b9a87,_0x348588[_0x81e3('0x37')][_0x81e3('0x4e')]),'json':_0x4c7c96,'resolveWithFullResponse':!![],'encoding':_0x8bd287,'qs':_0x348588[_0x81e3('0x37')]};if(_0x348588[_0x81e3('0xa4')]){_0x3bc2b7[_0x81e3('0xa4')]=_0x348588['headers'];if(_0x3bc2b7['headers']['content-length']){delete _0x3bc2b7[_0x81e3('0xa4')][_0x81e3('0xa5')];}}if(_0x3bc2b7[_0x81e3('0xa4')][_0x81e3('0xa6')]){delete _0x3bc2b7[_0x81e3('0xa4')]['content-type'];}return rp(_0x3bc2b7);})[_0x81e3('0x27')](function(_0x4d967d){if(_0x4d967d){_0x51d57a[_0x81e3('0x22')](_0x4d967d[_0x81e3('0xa4')]);logger[_0x81e3('0x64')](_0x4d967d['body']);if(_[_0x81e3('0xa7')](_0x348588[_0x81e3('0x37')][_0x81e3('0x4e')],_0x81e3('0x4d'))&&_0x4d967d[_0x81e3('0xa8')]==0x1f4){return _0x51d57a[_0x81e3('0x1c')](_0x4d967d['statusCode']);}else{return _0x51d57a['status'](_0x4d967d[_0x81e3('0xa8')])['send'](_0x4d967d['body']);}}else{return _0x51d57a[_0x81e3('0x1c')](0xc8);}})[_0x81e3('0x48')](handleError(_0x51d57a,null));};exports[_0x81e3('0xa9')]=function(_0x2f023e,_0x1916a8,_0x441e3a){return BPromise[_0x81e3('0x9d')]()[_0x81e3('0x27')](function(){if(!_0x2f023e['query'][_0x81e3('0x4e')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2f023e[_0x81e3('0x37')]['port']){throw new Error(_0x81e3('0xaa'));}var _0x3076fc=_0x2f023e[_0x81e3('0x37')]['hostname']?_0x2f023e[_0x81e3('0x37')][_0x81e3('0xa0')]+':'+_0x2f023e['query'][_0x81e3('0x9f')]:_0x81e3('0xab')+_0x2f023e[_0x81e3('0x37')][_0x81e3('0x9f')];var _0x3fa86e=_0x2f023e[_0x81e3('0x37')][_0x81e3('0x24')]?_0x2f023e[_0x81e3('0x37')][_0x81e3('0x24')]:!![];var _0x2131d0=_0x2f023e['query']['encoding']?_0x2f023e[_0x81e3('0x37')]['encoding']:null;var _0x1649e3={'method':_0x2f023e[_0x81e3('0xa2')],'uri':util['format'](_0x81e3('0xa3'),_0x3076fc,_0x2f023e[_0x81e3('0x37')][_0x81e3('0x4e')]),'json':_0x3fa86e,'resolveWithFullResponse':!![],'encoding':_0x2131d0,'body':_0x2f023e[_0x81e3('0x92')]};if(_0x2f023e[_0x81e3('0xa4')]){_0x1649e3[_0x81e3('0xa4')]=_0x2f023e[_0x81e3('0xa4')];if(_0x1649e3[_0x81e3('0xa4')][_0x81e3('0xa5')]){delete _0x1649e3[_0x81e3('0xa4')][_0x81e3('0xa5')];}}if(_0x1649e3[_0x81e3('0xa4')]['content-type']){delete _0x1649e3['headers'][_0x81e3('0xa6')];}return rp(_0x1649e3);})['then'](function(_0x4de9e3){if(_0x4de9e3){_0x1916a8[_0x81e3('0x22')](_0x4de9e3[_0x81e3('0xa4')]);logger[_0x81e3('0x64')](_0x4de9e3['body']);return _0x1916a8[_0x81e3('0x1d')](_0x4de9e3[_0x81e3('0xa8')])[_0x81e3('0x2f')](_0x4de9e3['body']);}else{return _0x1916a8[_0x81e3('0x1c')](0xc8);}})[_0x81e3('0x48')](handleError(_0x1916a8,null));}; \ No newline at end of file +var _0x19af=['socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','includeAll','find','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','views','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Plugins','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','statusCode','webhookPost','hostname','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost'];(function(_0x3662db,_0x3c33cd){var _0x1b9792=function(_0x45a22d){while(--_0x45a22d){_0x3662db['push'](_0x3662db['shift']());}};_0x1b9792(++_0x3c33cd);}(_0x19af,0x14e));var _0xf19a=function(_0x5a2697,_0x12dc85){_0x5a2697=_0x5a2697-0x0;var _0x1d800b=_0x19af[_0x5a2697];return _0x1d800b;};'use strict';var emlformat=require(_0xf19a('0x0'));var rimraf=require(_0xf19a('0x1'));var zipdir=require(_0xf19a('0x2'));var jsonpatch=require(_0xf19a('0x3'));var rp=require(_0xf19a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf19a('0x5'));var util=require(_0xf19a('0x6'));var path=require(_0xf19a('0x7'));var sox=require(_0xf19a('0x8'));var csv=require(_0xf19a('0x9'));var ejs=require(_0xf19a('0xa'));var fs=require('fs');var fs_extra=require(_0xf19a('0xb'));var _=require(_0xf19a('0xc'));var squel=require(_0xf19a('0xd'));var crypto=require(_0xf19a('0xe'));var jsforce=require(_0xf19a('0xf'));var deskjs=require(_0xf19a('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf19a('0x11'));var Papa=require('papaparse');var extract=require(_0xf19a('0x12'));var rimraf=require(_0xf19a('0x1'));var archiver=require(_0xf19a('0x13'));var Redis=require(_0xf19a('0x14'));var authService=require(_0xf19a('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xf19a('0x16'));var hardwareService=require(_0xf19a('0x17'));var logger=require('../../config/logger')(_0xf19a('0x18'));var utils=require('../../config/utils');var config=require(_0xf19a('0x19'));var licenseUtil=require(_0xf19a('0x1a'));var db=require('../../mysqldb')['db'];config[_0xf19a('0x1b')]=_[_0xf19a('0x1c')](config['redis'],{'host':_0xf19a('0x1d'),'port':0x18eb});var socket=require(_0xf19a('0x1e'))(new Redis(config[_0xf19a('0x1b')]));require(_0xf19a('0x1f'))[_0xf19a('0x20')](socket);function respondWithStatusCode(_0x50d81b,_0x3cb1ba){_0x3cb1ba=_0x3cb1ba||0xcc;return function(_0x219850){if(_0x219850){return _0x50d81b[_0xf19a('0x21')](_0x3cb1ba);}return _0x50d81b[_0xf19a('0x22')](_0x3cb1ba)[_0xf19a('0x23')]();};}function respondWithResult(_0x58c3a7,_0x5800e6){_0x5800e6=_0x5800e6||0xc8;return function(_0x5d072c){if(_0x5d072c){return _0x58c3a7['status'](_0x5800e6)[_0xf19a('0x24')](_0x5d072c);}};}function respondWithFilteredResult(_0x3b5888,_0x5f58f2){return function(_0x155d4e){if(_0x155d4e){var _0x1e5ac5=typeof _0x5f58f2['offset']===_0xf19a('0x25')&&typeof _0x5f58f2[_0xf19a('0x26')]===_0xf19a('0x25');var _0x18f542=_0x155d4e[_0xf19a('0x27')];var _0x37f80b=_0x1e5ac5?0x0:_0x5f58f2[_0xf19a('0x28')];var _0x27f396=_0x1e5ac5?_0x155d4e[_0xf19a('0x27')]:_0x5f58f2[_0xf19a('0x28')]+_0x5f58f2['limit'];var _0x3eac2d;if(_0x27f396>=_0x18f542){_0x27f396=_0x18f542;_0x3eac2d=0xc8;}else{_0x3eac2d=0xce;}_0x3b5888['status'](_0x3eac2d);return _0x3b5888['set']('Content-Range',_0x37f80b+'-'+_0x27f396+'/'+_0x18f542)[_0xf19a('0x24')](_0x155d4e);}return null;};}function patchUpdates(_0x262e9c){return function(_0x17c9a6){try{jsonpatch[_0xf19a('0x29')](_0x17c9a6,_0x262e9c,!![]);}catch(_0xf2bedf){return BPromise[_0xf19a('0x2a')](_0xf2bedf);}return _0x17c9a6[_0xf19a('0x2b')]();};}function saveUpdates(_0x539d07,_0x365bd4){return function(_0x1be7c2){if(_0x1be7c2){return _0x1be7c2[_0xf19a('0x2c')](_0x539d07)['then'](function(_0x5b5cb5){return _0x5b5cb5;});}return null;};}function removeEntity(_0x8abfda,_0x1b8de9){return function(_0x3ae2c5){if(_0x3ae2c5){return _0x3ae2c5[_0xf19a('0x2d')]()[_0xf19a('0x2e')](function(){var _0x9e6079=_0x3ae2c5[_0xf19a('0x2f')]({'plain':!![]});var _0x35af1f='Plugins';return db[_0xf19a('0x30')][_0xf19a('0x2d')]({'where':{'type':_0x35af1f,'resourceId':_0x9e6079['id']}})[_0xf19a('0x2e')](function(){return _0x3ae2c5;});})[_0xf19a('0x2e')](function(){_0x8abfda[_0xf19a('0x22')](0xcc)[_0xf19a('0x23')]();});}};}function handleEntityNotFound(_0x118bcc,_0x5c3f3b){return function(_0x38111d){if(!_0x38111d){_0x118bcc[_0xf19a('0x21')](0x194);}return _0x38111d;};}function handleError(_0x49f53a,_0x28b60d){_0x28b60d=_0x28b60d||0x1f4;return function(_0x2188be){logger[_0xf19a('0x31')](_0x2188be[_0xf19a('0x32')]);if(_0x2188be[_0xf19a('0x33')]){delete _0x2188be['name'];}_0x49f53a[_0xf19a('0x22')](_0x28b60d)[_0xf19a('0x34')](_0x2188be);};}exports[_0xf19a('0x35')]=function(_0xc00bd9,_0x2d839a){var _0x3ed6f2={},_0x49e6ce={},_0x43542b={'count':0x0,'rows':[]};var _0x2910fa=_[_0xf19a('0x36')](db[_0xf19a('0x37')][_0xf19a('0x38')],function(_0x539853){return{'name':_0x539853[_0xf19a('0x39')],'type':_0x539853[_0xf19a('0x3a')][_0xf19a('0x3b')]};});_0x49e6ce[_0xf19a('0x3c')]=_[_0xf19a('0x36')](_0x2910fa,_0xf19a('0x33'));_0x49e6ce[_0xf19a('0x3d')]=_['keys'](_0xc00bd9[_0xf19a('0x3d')]);_0x49e6ce['filters']=_[_0xf19a('0x3e')](_0x49e6ce['model'],_0x49e6ce[_0xf19a('0x3d')]);_0x3ed6f2[_0xf19a('0x3f')]=_['intersection'](_0x49e6ce[_0xf19a('0x3c')],qs['fields'](_0xc00bd9[_0xf19a('0x3d')][_0xf19a('0x40')]));_0x3ed6f2['attributes']=_0x3ed6f2[_0xf19a('0x3f')][_0xf19a('0x41')]?_0x3ed6f2[_0xf19a('0x3f')]:_0x49e6ce[_0xf19a('0x3c')];if(!_0xc00bd9[_0xf19a('0x3d')][_0xf19a('0x42')](_0xf19a('0x43'))){_0x3ed6f2[_0xf19a('0x26')]=qs['limit'](_0xc00bd9[_0xf19a('0x3d')][_0xf19a('0x26')]);_0x3ed6f2['offset']=qs[_0xf19a('0x28')](_0xc00bd9['query'][_0xf19a('0x28')]);}_0x3ed6f2[_0xf19a('0x44')]=qs['sort'](_0xc00bd9['query'][_0xf19a('0x45')]);_0x3ed6f2[_0xf19a('0x46')]=qs['filters'](_[_0xf19a('0x47')](_0xc00bd9[_0xf19a('0x3d')],_0x49e6ce[_0xf19a('0x48')]),_0x2910fa);if(_0xc00bd9[_0xf19a('0x3d')][_0xf19a('0x49')]){_0x3ed6f2['where']=_[_0xf19a('0x4a')](_0x3ed6f2[_0xf19a('0x46')],{'$or':_[_0xf19a('0x36')](_0x2910fa,function(_0x4e9f8d){if(_0x4e9f8d[_0xf19a('0x3a')]!==_0xf19a('0x4b')){var _0x2fdcf7={};_0x2fdcf7[_0x4e9f8d[_0xf19a('0x33')]]={'$like':'%'+_0xc00bd9[_0xf19a('0x3d')][_0xf19a('0x49')]+'%'};return _0x2fdcf7;}})});}_0x3ed6f2=_['merge']({},_0x3ed6f2,_0xc00bd9[_0xf19a('0x4c')]);var _0x4f5ce9={'where':_0x3ed6f2[_0xf19a('0x46')]};return db[_0xf19a('0x37')][_0xf19a('0x27')](_0x4f5ce9)[_0xf19a('0x2e')](function(_0x1bb31d){_0x43542b['count']=_0x1bb31d;if(_0xc00bd9['query']['includeAll']){_0x3ed6f2[_0xf19a('0x4d')]=[{'all':!![]}];}return db[_0xf19a('0x37')][_0xf19a('0x4e')](_0x3ed6f2);})[_0xf19a('0x2e')](function(_0xc23aef){_0x43542b['rows']=_0xc23aef;return _0x43542b;})[_0xf19a('0x2e')](respondWithFilteredResult(_0x2d839a,_0x3ed6f2))[_0xf19a('0x4f')](handleError(_0x2d839a,null));};exports[_0xf19a('0x50')]=function(_0x545848,_0x7bc059){var _0x33f1ef={'raw':!![],'where':{'id':_0x545848[_0xf19a('0x51')]['id']}},_0x16aa35={};_0x16aa35[_0xf19a('0x3c')]=_[_0xf19a('0x52')](db[_0xf19a('0x37')][_0xf19a('0x38')]);_0x16aa35['query']=_[_0xf19a('0x52')](_0x545848[_0xf19a('0x3d')]);_0x16aa35[_0xf19a('0x48')]=_[_0xf19a('0x3e')](_0x16aa35[_0xf19a('0x3c')],_0x16aa35[_0xf19a('0x3d')]);_0x33f1ef[_0xf19a('0x3f')]=_[_0xf19a('0x3e')](_0x16aa35[_0xf19a('0x3c')],qs[_0xf19a('0x40')](_0x545848[_0xf19a('0x3d')]['fields']));_0x33f1ef[_0xf19a('0x3f')]=_0x33f1ef[_0xf19a('0x3f')][_0xf19a('0x41')]?_0x33f1ef[_0xf19a('0x3f')]:_0x16aa35[_0xf19a('0x3c')];if(_0x545848['query'][_0xf19a('0x53')]){_0x33f1ef[_0xf19a('0x4d')]=[{'all':!![]}];}_0x33f1ef=_[_0xf19a('0x4a')]({},_0x33f1ef,_0x545848[_0xf19a('0x4c')]);return db[_0xf19a('0x37')][_0xf19a('0x54')](_0x33f1ef)[_0xf19a('0x2e')](handleEntityNotFound(_0x7bc059,null))[_0xf19a('0x2e')](respondWithResult(_0x7bc059,null))['catch'](handleError(_0x7bc059,null));};exports['download']=function(_0x26d951,_0x27ef7b,_0x3b77d0){return db['Plugin'][_0xf19a('0x54')]({'where':{'id':_0x26d951['params']['id']},'attributes':[_0xf19a('0x33'),'path'],'raw':!![]})[_0xf19a('0x2e')](handleEntityNotFound(_0x27ef7b,null))['then'](function(_0x29a062){if(_0x29a062){var _0x4d3bee=path['join'](config[_0xf19a('0x55')],_0xf19a('0x56'),util[_0xf19a('0x57')](_0xf19a('0x58'),path[_0xf19a('0x59')](_0x29a062[_0xf19a('0x7')])));var _0xec064f=fs[_0xf19a('0x5a')](_0x4d3bee);var _0x4b8679=archiver('zip',{'zlib':{'level':0x9}});_0x4b8679['on'](_0xf19a('0x5b'),function(_0x78c19c){if(_0x78c19c[_0xf19a('0x5c')]===_0xf19a('0x5d')){logger[_0xf19a('0x31')](_0x78c19c);}else{throw new db['Sequelize'][(_0xf19a('0x5e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4b8679['on'](_0xf19a('0x31'),function(_0x176aab){throw new db[(_0xf19a('0x5f'))][(_0xf19a('0x5e'))](_0xf19a('0x60'));});_0x4b8679[_0xf19a('0x61')](_0xec064f);_0x4b8679[_0xf19a('0x62')](_0xf19a('0x63'),{'cwd':path[_0xf19a('0x64')](config['root'],_0xf19a('0x56'),path[_0xf19a('0x65')](_0x29a062[_0xf19a('0x7')])),'ignore':[path[_0xf19a('0x64')](path[_0xf19a('0x59')](_0x29a062[_0xf19a('0x7')]),_0xf19a('0x66')),path['join'](path[_0xf19a('0x59')](_0x29a062['path']),_0xf19a('0x67'))],'nodir':!![]})[_0xf19a('0x68')]();_0xec064f['on'](_0xf19a('0x69'),function(){if(!fs['existsSync'](_0x4d3bee)){throw new db[(_0xf19a('0x5f'))][(_0xf19a('0x5e'))](_0xf19a('0x6a'));}return _0x27ef7b[_0xf19a('0x6b')](_0x4d3bee,util['format'](_0xf19a('0x58'),path[_0xf19a('0x59')](_0x29a062[_0xf19a('0x7')])),function(_0x11b641){if(_0x11b641){throw new db[(_0xf19a('0x5f'))][(_0xf19a('0x5e'))](_0xf19a('0x6c'));}fs[_0xf19a('0x6d')](_0x4d3bee);logger['info'](_0xf19a('0x6e'));logger[_0xf19a('0x6f')](_0xf19a('0x70'));});});}return null;})[_0xf19a('0x4f')](handleError(_0x27ef7b,null));};exports[_0xf19a('0x71')]=function(_0x5b54c0,_0x344139,_0x17a332){var _0x310c82=path[_0xf19a('0x59')](_0x5b54c0[_0xf19a('0x72')][_0xf19a('0x73')],path[_0xf19a('0x74')](_0x5b54c0[_0xf19a('0x72')][_0xf19a('0x73')]));var _0x50d1a6=path[_0xf19a('0x64')](config['root'],_0xf19a('0x56'),_0x5b54c0[_0xf19a('0x72')][_0xf19a('0x73')]);var _0xe5f6a1=path[_0xf19a('0x64')](config[_0xf19a('0x55')],_0xf19a('0x56'),_0x310c82);logger[_0xf19a('0x6f')](_0xf19a('0x75'),_0x50d1a6);logger[_0xf19a('0x6f')](_0xf19a('0x76'),_0xe5f6a1);try{fs[_0xf19a('0x77')](_0x50d1a6,parseInt(_0xf19a('0x78'),0x8));extract(_0x50d1a6,{'dir':_0xe5f6a1},function(_0x361207){if(_0x361207){logger[_0xf19a('0x31')](_0x361207);handleError(_0x361207,!![]);};var _0x18e87e=fs['readdirSync'](_0xe5f6a1);if(_0x18e87e[_0xf19a('0x41')]>0x1){removeReferences(_0x50d1a6,_0xe5f6a1);logger[_0xf19a('0x31')](_0xf19a('0x79'));return _0x17a332(new Error(_0xf19a('0x79')));}var _0x13e20c=fs[_0xf19a('0x7a')](path[_0xf19a('0x64')](_0xe5f6a1,_0x18e87e[0x0]));if(_0x13e20c[_0xf19a('0x7b')]()){removeReferences(_0x50d1a6,_0xe5f6a1);logger[_0xf19a('0x31')]('Invalid\x20plugin\x20structure');return _0x17a332(new Error(_0xf19a('0x79')));}if(_0x13e20c[_0xf19a('0x7c')]()){var _0xa118da=fs['readdirSync'](path[_0xf19a('0x64')](_0xe5f6a1,_0x18e87e[0x0]));if(_0xa118da[_0xf19a('0x41')]===0x0){removeReferences(_0x50d1a6,_0xe5f6a1);logger['error'](_0xf19a('0x79'));return _0x17a332(new Error(_0xf19a('0x79')));}var _0x28e7e7=_0xa118da['some'](function(_0x506f68){return _0x506f68==='manifest.json';});if(!_0x28e7e7){return _0x17a332(new Error(_0xf19a('0x7d')));}var _0x23a54d=fs[_0xf19a('0x7e')](path[_0xf19a('0x64')](_0xe5f6a1,_0x18e87e[0x0],_0xf19a('0x7f')));var _0x279570=JSON[_0xf19a('0x80')](_0x23a54d);if(_0xf19a('0x25')==typeof _0x279570[_0xf19a('0x33')]){return _0x17a332(new Error(_0xf19a('0x81')));}if(_0xf19a('0x25')==typeof _0x279570[_0xf19a('0x3a')]){return _0x17a332(new Error(_0xf19a('0x82')));}if('undefined'==typeof _0x279570[_0xf19a('0x83')]){return _0x17a332(new Error(_0xf19a('0x84')));}if(_0xf19a('0x25')==typeof _0x279570[_0xf19a('0x85')]){return _0x17a332(new Error(_0xf19a('0x86')));}if(_0x279570[_0xf19a('0x3a')]==='html'){if(_0xf19a('0x25')==typeof _0x279570[_0xf19a('0x85')]['views']){return _0x17a332(new Error(_0xf19a('0x87')));}if(_0xf19a('0x25')==typeof _0x279570[_0xf19a('0x85')]['views']['admin']&&_0xf19a('0x25')==typeof _0x279570[_0xf19a('0x85')][_0xf19a('0x88')][_0xf19a('0x89')]){return _0x17a332(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x279570[_0xf19a('0x3a')]===_0xf19a('0x8a')){if(_0xf19a('0x25')==typeof _0x279570[_0xf19a('0x85')]['scriptName']){return _0x17a332(new Error(_0xf19a('0x8b')));}if('undefined'==typeof _0x279570[_0xf19a('0x85')][_0xf19a('0x8c')]){return _0x17a332(new Error(_0xf19a('0x8d')));}}else{return _0x17a332(new Error(_0xf19a('0x8e')));}var _0x42b67b=_0x279570['name'];var _0x57ca2c=_0x279570[_0xf19a('0x8f')];var _0x525854=_0x279570[_0xf19a('0x3a')];var _0x13a934=_0x279570[_0xf19a('0x90')]?_0x279570[_0xf19a('0x90')]:_0xf19a('0x91');var _0x4093b4=_0x279570[_0xf19a('0x92')]?_0x279570[_0xf19a('0x92')]:_0xf19a('0x93');var _0x536ac0='';var _0x4f7746='';var _0x2ff674='';var _0x16f1e3='';var _0x2056f4=_0x279570[_0xf19a('0x83')];if(_0x525854===_0xf19a('0x94')){if('undefined'!=typeof _0x279570['parameters'][_0xf19a('0x88')]['admin']){var _0x18a4e1=_0x279570[_0xf19a('0x85')][_0xf19a('0x88')][_0xf19a('0x95')];if(!/^(f|ht)tps?:\/\//i[_0xf19a('0x96')](_0x18a4e1)){_0x536ac0=path[_0xf19a('0x64')](_0xf19a('0x97'),_0x310c82,_0x18e87e[0x0],_0x18a4e1);}else{_0x536ac0=_0x18a4e1;}}else{logger[_0xf19a('0x6f')](_0xf19a('0x98'));}if(_0xf19a('0x25')!=typeof _0x279570['parameters'][_0xf19a('0x88')][_0xf19a('0x89')]){var _0x5120fb=_0x279570[_0xf19a('0x85')]['views'][_0xf19a('0x89')];if(!/^(f|ht)tps?:\/\//i[_0xf19a('0x96')](_0x5120fb)){_0x4f7746=path[_0xf19a('0x64')](_0xf19a('0x97'),_0x310c82,_0x18e87e[0x0],_0x5120fb);}else{_0x4f7746=_0x5120fb;}}else{logger[_0xf19a('0x6f')](_0xf19a('0x99'));}}else if(_0x525854===_0xf19a('0x8a')){_0x2ff674=_0x279570[_0xf19a('0x85')]['scriptName'];_0x16f1e3=_0x279570['parameters'][_0xf19a('0x8c')];if(_0xf19a('0x25')!=typeof _0x279570[_0xf19a('0x85')]['views']){if(_0xf19a('0x25')!=typeof _0x279570[_0xf19a('0x85')][_0xf19a('0x88')][_0xf19a('0x95')]){var _0x18a4e1=_0x279570[_0xf19a('0x85')][_0xf19a('0x88')][_0xf19a('0x95')];if(!/^(f|ht)tps?:\/\//i['test'](_0x18a4e1)){_0x536ac0=path[_0xf19a('0x64')](_0xf19a('0x97'),_0x310c82,_0x18e87e[0x0],_0x18a4e1);}else{_0x536ac0=_0x18a4e1;}}if('undefined'!=typeof _0x279570[_0xf19a('0x85')]['views'][_0xf19a('0x89')]){var _0x5120fb=_0x279570[_0xf19a('0x85')][_0xf19a('0x88')][_0xf19a('0x89')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5120fb)){_0x4f7746=path[_0xf19a('0x64')](_0xf19a('0x97'),_0x310c82,_0x18e87e[0x0],_0x5120fb);}else{_0x4f7746=_0x5120fb;}}}}var _0x544780={'name':_0x42b67b,'description':_0x57ca2c,'path':path[_0xf19a('0x64')](_0x310c82,_0x18e87e[0x0]),'type':_0x525854,'sidebar':_0x13a934,'icon':_0x4093b4,'adminUrl':_0x536ac0,'agentUrl':_0x4f7746,'scriptName':_0x2ff674,'scriptPath':_0x16f1e3,'version':_0x2056f4};removeReferences(_0x50d1a6,null);return db['Plugin']['create'](_0x544780)[_0xf19a('0x2e')](function(_0x24f0a1){var _0x2c9338={'role':_0x5b54c0[_0xf19a('0x9a')]['role'],'userProfileId':_0x5b54c0[_0xf19a('0x9a')][_0xf19a('0x9b')]};if(!_0x2c9338)throw new Error(_0xf19a('0x9c'));if(_0x2c9338[_0xf19a('0x9d')]===_0xf19a('0x9e')){var _0x5624dc=_0x24f0a1[_0xf19a('0x2f')]({'plain':!![]});return db[_0xf19a('0x9f')][_0xf19a('0x54')]({'where':{'name':_0xf19a('0xa0'),'userProfileId':_0x2c9338[_0xf19a('0x9b')]},'raw':!![]})[_0xf19a('0x2e')](function(_0x1654a4){if(_0x1654a4&&_0x1654a4[_0xf19a('0xa1')]===0x0){return db[_0xf19a('0x30')][_0xf19a('0xa2')]({'name':_0x5624dc[_0xf19a('0x33')],'resourceId':_0x5624dc['id'],'type':_0x1654a4[_0xf19a('0x33')],'sectionId':_0x1654a4['id']},{})[_0xf19a('0x2e')](function(){return _0x24f0a1;});}else{return _0x24f0a1;}})[_0xf19a('0x4f')](function(_0x18b867){logger[_0xf19a('0x31')](_0xf19a('0xa3'),_0x18b867);throw _0x18b867;});}return _0x24f0a1;})[_0xf19a('0x2e')](respondWithResult(_0x344139,null))[_0xf19a('0x4f')](handleError(_0x344139,null));}});}catch(_0x20558d){_0x344139[_0xf19a('0x22')](0x1f4)[_0xf19a('0x34')](_0x20558d);}};function removeReferences(_0x55a631,_0x3f73b5){try{if(_0x55a631){fs[_0xf19a('0x6d')](_0x55a631);logger['info'](_0xf19a('0xa4'));}if(_0x3f73b5){rimraf(_0x3f73b5,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x3a9074){logger[_0xf19a('0x31')](_0x3a9074);}}exports[_0xf19a('0x2c')]=function(_0x2760a5,_0x18352b,_0x424c27){return db['Plugin'][_0xf19a('0x54')]({'where':{'id':_0x2760a5[_0xf19a('0x51')]['id']}})[_0xf19a('0x2e')](handleEntityNotFound(_0x18352b,null))['then'](saveUpdates(_0x2760a5[_0xf19a('0x9a')],null))[_0xf19a('0x2e')](respondWithResult(_0x18352b,null))[_0xf19a('0x4f')](handleError(_0x18352b,null));};exports[_0xf19a('0xa5')]=function(_0x25e247,_0x30b5d9,_0x101d38){return db[_0xf19a('0x37')]['find']({'where':{'id':_0x25e247[_0xf19a('0x51')]['id']}})[_0xf19a('0x2e')](function(_0x3de0b7){if(_0x3de0b7){return _0x3de0b7[_0xf19a('0x2d')]();}})[_0xf19a('0x2e')](function(_0x292eb4){rimraf(path[_0xf19a('0x64')](config['root'],_0xf19a('0x56'),path[_0xf19a('0x65')](_0x292eb4[_0xf19a('0x7')])),function(){});return _0x292eb4;})['then'](handleEntityNotFound(_0x30b5d9,null))[_0xf19a('0x2e')](respondWithStatusCode(_0x30b5d9,null))[_0xf19a('0x4f')](handleError(_0x30b5d9,null));};exports[_0xf19a('0xa6')]=function(_0xe37e08,_0x405fba,_0xe93a07){return BPromise[_0xf19a('0xa7')]()['then'](function(){if(!_0xe37e08[_0xf19a('0x3d')][_0xf19a('0x7')]){throw new Error(_0xf19a('0xa8'));}if(!_0xe37e08[_0xf19a('0x3d')][_0xf19a('0xa9')]){throw new Error(_0xf19a('0xaa'));}var _0x56eeb5=_0xe37e08['query']['hostname']?_0xe37e08[_0xf19a('0x3d')]['hostname']+':'+_0xe37e08[_0xf19a('0x3d')][_0xf19a('0xa9')]:_0xf19a('0xab')+_0xe37e08[_0xf19a('0x3d')][_0xf19a('0xa9')];var _0x2ef275=_0xe37e08[_0xf19a('0x3d')][_0xf19a('0x24')]?_0xe37e08[_0xf19a('0x3d')]['json']:!![];var _0x1066d8=_0xe37e08[_0xf19a('0x3d')]['encoding']?_0xe37e08['query'][_0xf19a('0xac')]:null;var _0x1a2d4d={'method':_0xe37e08[_0xf19a('0xad')],'uri':util['format'](_0xf19a('0xae'),_0x56eeb5,_0xe37e08[_0xf19a('0x3d')][_0xf19a('0x7')]),'json':_0x2ef275,'resolveWithFullResponse':!![],'encoding':_0x1066d8,'qs':_0xe37e08[_0xf19a('0x3d')]};if(_0xe37e08[_0xf19a('0xaf')]){_0x1a2d4d[_0xf19a('0xaf')]=_0xe37e08[_0xf19a('0xaf')];if(_0x1a2d4d[_0xf19a('0xaf')][_0xf19a('0xb0')]){delete _0x1a2d4d[_0xf19a('0xaf')][_0xf19a('0xb0')];}}if(_0x1a2d4d[_0xf19a('0xaf')][_0xf19a('0xb1')]){delete _0x1a2d4d['headers'][_0xf19a('0xb1')];}return rp(_0x1a2d4d);})[_0xf19a('0x2e')](function(_0x464716){if(_0x464716){_0x405fba[_0xf19a('0xb2')](_0x464716[_0xf19a('0xaf')]);logger[_0xf19a('0x6f')](_0x464716[_0xf19a('0x9a')]);if(_['endsWith'](_0xe37e08[_0xf19a('0x3d')]['path'],_0xf19a('0x6b'))&&_0x464716[_0xf19a('0xb3')]==0x1f4){return _0x405fba[_0xf19a('0x21')](_0x464716[_0xf19a('0xb3')]);}else{return _0x405fba['status'](_0x464716['statusCode'])[_0xf19a('0x34')](_0x464716[_0xf19a('0x9a')]);}}else{return _0x405fba[_0xf19a('0x21')](0xc8);}})[_0xf19a('0x4f')](handleError(_0x405fba,null));};exports[_0xf19a('0xb4')]=function(_0x4797e2,_0x4d8b51,_0x3d7c3d){return BPromise[_0xf19a('0xa7')]()[_0xf19a('0x2e')](function(){if(!_0x4797e2[_0xf19a('0x3d')][_0xf19a('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4797e2['query'][_0xf19a('0xa9')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4666db=_0x4797e2[_0xf19a('0x3d')][_0xf19a('0xb5')]?_0x4797e2[_0xf19a('0x3d')][_0xf19a('0xb5')]+':'+_0x4797e2[_0xf19a('0x3d')][_0xf19a('0xa9')]:_0xf19a('0xab')+_0x4797e2[_0xf19a('0x3d')]['port'];var _0x3f1ae6=_0x4797e2[_0xf19a('0x3d')][_0xf19a('0x24')]?_0x4797e2[_0xf19a('0x3d')][_0xf19a('0x24')]:!![];var _0x3a8433=_0x4797e2[_0xf19a('0x3d')][_0xf19a('0xac')]?_0x4797e2[_0xf19a('0x3d')][_0xf19a('0xac')]:null;var _0x53fefe={'method':_0x4797e2['method'],'uri':util[_0xf19a('0x57')](_0xf19a('0xae'),_0x4666db,_0x4797e2[_0xf19a('0x3d')][_0xf19a('0x7')]),'json':_0x3f1ae6,'resolveWithFullResponse':!![],'encoding':_0x3a8433,'body':_0x4797e2[_0xf19a('0x9a')]};if(_0x4797e2[_0xf19a('0xaf')]){_0x53fefe['headers']=_0x4797e2[_0xf19a('0xaf')];if(_0x53fefe[_0xf19a('0xaf')]['content-length']){delete _0x53fefe[_0xf19a('0xaf')]['content-length'];}}if(_0x53fefe[_0xf19a('0xaf')][_0xf19a('0xb1')]){delete _0x53fefe[_0xf19a('0xaf')]['content-type'];}return rp(_0x53fefe);})[_0xf19a('0x2e')](function(_0x1965ff){if(_0x1965ff){_0x4d8b51['set'](_0x1965ff['headers']);logger['info'](_0x1965ff['body']);return _0x4d8b51[_0xf19a('0x22')](_0x1965ff['statusCode'])[_0xf19a('0x34')](_0x1965ff[_0xf19a('0x9a')]);}else{return _0x4d8b51[_0xf19a('0x21')](0xc8);}})[_0xf19a('0x4f')](handleError(_0x4d8b51,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 3015f25..0de0859 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 _0x4279=['update','remove','emit','hook','exports','../../mysqldb','Plugin','save'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0x4279,0x8d));var _0x9427=function(_0x4899bc,_0x57f891){_0x4899bc=_0x4899bc-0x0;var _0x22d838=_0x4279[_0x4899bc];return _0x22d838;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x9427('0x0'))['db'][_0x9427('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9427('0x2'),'afterUpdate':_0x9427('0x3'),'afterDestroy':_0x9427('0x4')};function emitEvent(_0x32d94e){return function(_0x54cdfb,_0x426911,_0x57f12b){PluginEvents[_0x9427('0x5')](_0x32d94e+':'+_0x54cdfb['id'],_0x54cdfb);PluginEvents[_0x9427('0x5')](_0x32d94e,_0x54cdfb);_0x57f12b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x9427('0x6')](e,emitEvent(event));}}module[_0x9427('0x7')]=PluginEvents; \ No newline at end of file +var _0x9fe7=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x9fe7,0x1df));var _0x79fe=function(_0x1c92fd,_0x1af3e8){_0x1c92fd=_0x1c92fd-0x0;var _0x4f8d4e=_0x9fe7[_0x1c92fd];return _0x4f8d4e;};'use strict';var EventEmitter=require(_0x79fe('0x0'));var Plugin=require(_0x79fe('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x79fe('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x79fe('0x3'),'afterDestroy':_0x79fe('0x4')};function emitEvent(_0x277bb5){return function(_0x50423a,_0x44c145,_0x627ec4){PluginEvents[_0x79fe('0x5')](_0x277bb5+':'+_0x50423a['id'],_0x50423a);PluginEvents['emit'](_0x277bb5,_0x50423a);_0x627ec4(null);};}for(var e in events){if(events[_0x79fe('0x6')](e)){var event=events[e];Plugin[_0x79fe('0x7')](e,emitEvent(event));}}module[_0x79fe('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 62b65c6..45caa07 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 _0xbb6b=['rimraf','../../config/environment','./plugin.attributes','Plugin','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0xbb6b,0xea));var _0xbbb6=function(_0x5d018e,_0x4bb5dd){_0x5d018e=_0x5d018e-0x0;var _0x238ed0=_0xbb6b[_0x5d018e];return _0x238ed0;};'use strict';var _=require('lodash');var util=require(_0xbbb6('0x0'));var logger=require(_0xbbb6('0x1'))('api');var moment=require(_0xbbb6('0x2'));var BPromise=require(_0xbbb6('0x3'));var rp=require(_0xbbb6('0x4'));var fs=require('fs');var path=require(_0xbbb6('0x5'));var rimraf=require(_0xbbb6('0x6'));var config=require(_0xbbb6('0x7'));var attributes=require(_0xbbb6('0x8'));module['exports']=function(_0x45d31e,_0x1b7052){return _0x45d31e['define'](_0xbbb6('0x9'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe16f=['../../config/environment','./plugin.attributes','exports','define','Plugin','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x57ad2b,_0x2e9ede){var _0x1c7858=function(_0x2e6378){while(--_0x2e6378){_0x57ad2b['push'](_0x57ad2b['shift']());}};_0x1c7858(++_0x2e9ede);}(_0xe16f,0x9f));var _0xfe16=function(_0xb86682,_0x226d51){_0xb86682=_0xb86682-0x0;var _0x3a8502=_0xe16f[_0xb86682];return _0x3a8502;};'use strict';var _=require('lodash');var util=require(_0xfe16('0x0'));var logger=require(_0xfe16('0x1'))(_0xfe16('0x2'));var moment=require('moment');var BPromise=require(_0xfe16('0x3'));var rp=require(_0xfe16('0x4'));var fs=require('fs');var path=require(_0xfe16('0x5'));var rimraf=require('rimraf');var config=require(_0xfe16('0x6'));var attributes=require(_0xfe16('0x7'));module[_0xfe16('0x8')]=function(_0x28f661,_0x53c46b){return _0x28f661[_0xfe16('0x9')](_0xfe16('0xa'),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 8e5b124..c848ad2 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 _0xf538=['CreatePlugin','create','body','options','raw','then','debug','stringify','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x262b40,_0x1d0b38){var _0x477dd8=function(_0x4065af){while(--_0x4065af){_0x262b40['push'](_0x262b40['shift']());}};_0x477dd8(++_0x1d0b38);}(_0xf538,0x65));var _0x8f53=function(_0x4375d9,_0x5cee8a){_0x4375d9=_0x4375d9-0x0;var _0x1fd3ff=_0xf538[_0x4375d9];return _0x1fd3ff;};'use strict';var _=require('lodash');var util=require(_0x8f53('0x0'));var moment=require(_0x8f53('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f53('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f53('0x3'));var logger=require(_0x8f53('0x4'))(_0x8f53('0x5'));var config=require(_0x8f53('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8f53('0x7')][_0x8f53('0x8')]({'port':0x232a});config[_0x8f53('0x9')]=_[_0x8f53('0xa')](config[_0x8f53('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8f53('0xb'))(new Redis(config['redis']));require(_0x8f53('0xc'))[_0x8f53('0xd')](socket);function respondWithRpcPromise(_0x87eb1d,_0x259602,_0x238be7){return new BPromise(function(_0x676c2d,_0x3e81a5){return client[_0x8f53('0xe')](_0x87eb1d,_0x238be7)['then'](function(_0x199b4f){logger[_0x8f53('0xf')](_0x8f53('0x10'),_0x259602,_0x8f53('0x11'));logger['debug'](_0x8f53('0x12'),_0x259602,_0x8f53('0x11'),JSON['stringify'](_0x199b4f));if(_0x199b4f[_0x8f53('0x13')]){if(_0x199b4f[_0x8f53('0x13')][_0x8f53('0x14')]===0x1f4){logger['error'](_0x8f53('0x10'),_0x259602,_0x199b4f[_0x8f53('0x13')][_0x8f53('0x15')]);return _0x3e81a5(_0x199b4f[_0x8f53('0x13')][_0x8f53('0x15')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x259602,_0x199b4f[_0x8f53('0x13')][_0x8f53('0x15')]);return _0x676c2d(_0x199b4f[_0x8f53('0x13')]['message']);}else{logger[_0x8f53('0xf')](_0x8f53('0x10'),_0x259602,_0x8f53('0x11'));_0x676c2d(_0x199b4f['result'][_0x8f53('0x15')]);}})[_0x8f53('0x16')](function(_0x1959e5){logger[_0x8f53('0x13')](_0x8f53('0x10'),_0x259602,_0x1959e5);_0x3e81a5(_0x1959e5);});});}exports[_0x8f53('0x17')]=function(_0x47b4a1){var _0x31a267=this;return new Promise(function(_0x10f8d8,_0x404e45){return db['Plugin'][_0x8f53('0x18')](_0x47b4a1[_0x8f53('0x19')],{'raw':_0x47b4a1[_0x8f53('0x1a')]?_0x47b4a1[_0x8f53('0x1a')][_0x8f53('0x1b')]===undefined?!![]:![]:!![]})[_0x8f53('0x1c')](function(_0x158dc4){logger[_0x8f53('0xf')]('CreatePlugin',_0x47b4a1);logger[_0x8f53('0x1d')](_0x8f53('0x17'),_0x47b4a1,JSON[_0x8f53('0x1e')](_0x158dc4));_0x10f8d8(_0x158dc4);})[_0x8f53('0x16')](function(_0x141360){logger[_0x8f53('0x13')](_0x8f53('0x17'),_0x141360[_0x8f53('0x15')],_0x47b4a1);_0x404e45(_0x31a267['error'](0x1f4,_0x141360[_0x8f53('0x15')]));});});}; \ No newline at end of file +var _0x8b59=['client','http','defaults','redis','localhost','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreatePlugin','create','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x412f04,_0x5ca97b){var _0x2434a2=function(_0x31fc2b){while(--_0x31fc2b){_0x412f04['push'](_0x412f04['shift']());}};_0x2434a2(++_0x5ca97b);}(_0x8b59,0x1d7));var _0x98b5=function(_0x17b705,_0xab483){_0x17b705=_0x17b705-0x0;var _0x57cd8c=_0x8b59[_0x17b705];return _0x57cd8c;};'use strict';var _=require(_0x98b5('0x0'));var util=require(_0x98b5('0x1'));var moment=require('moment');var BPromise=require(_0x98b5('0x2'));var rs=require(_0x98b5('0x3'));var fs=require('fs');var Redis=require(_0x98b5('0x4'));var db=require(_0x98b5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x98b5('0x6'))(_0x98b5('0x7'));var config=require(_0x98b5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x98b5('0x9')][_0x98b5('0xa')]({'port':0x232a});config['redis']=_[_0x98b5('0xb')](config[_0x98b5('0xc')],{'host':_0x98b5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x98b5('0xc')]));require(_0x98b5('0xe'))[_0x98b5('0xf')](socket);function respondWithRpcPromise(_0x39787c,_0xe33f09,_0x1419ad){return new BPromise(function(_0x2ff081,_0x4dc95b){return client[_0x98b5('0x10')](_0x39787c,_0x1419ad)['then'](function(_0x326f75){logger[_0x98b5('0x11')](_0x98b5('0x12'),_0xe33f09,_0x98b5('0x13'));logger[_0x98b5('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0xe33f09,_0x98b5('0x13'),JSON[_0x98b5('0x15')](_0x326f75));if(_0x326f75[_0x98b5('0x16')]){if(_0x326f75[_0x98b5('0x16')][_0x98b5('0x17')]===0x1f4){logger['error'](_0x98b5('0x12'),_0xe33f09,_0x326f75[_0x98b5('0x16')][_0x98b5('0x18')]);return _0x4dc95b(_0x326f75[_0x98b5('0x16')][_0x98b5('0x18')]);}logger[_0x98b5('0x16')]('Plugin,\x20%s,\x20%s',_0xe33f09,_0x326f75[_0x98b5('0x16')][_0x98b5('0x18')]);return _0x2ff081(_0x326f75[_0x98b5('0x16')][_0x98b5('0x18')]);}else{logger[_0x98b5('0x11')](_0x98b5('0x12'),_0xe33f09,_0x98b5('0x13'));_0x2ff081(_0x326f75[_0x98b5('0x19')][_0x98b5('0x18')]);}})[_0x98b5('0x1a')](function(_0x1506b2){logger[_0x98b5('0x16')]('Plugin,\x20%s,\x20%s',_0xe33f09,_0x1506b2);_0x4dc95b(_0x1506b2);});});}exports[_0x98b5('0x1b')]=function(_0x290dc6){var _0x8f6b4f=this;return new Promise(function(_0x586356,_0xeef07d){return db['Plugin'][_0x98b5('0x1c')](_0x290dc6['body'],{'raw':_0x290dc6['options']?_0x290dc6[_0x98b5('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4dacc0){logger[_0x98b5('0x11')]('CreatePlugin',_0x290dc6);logger['debug'](_0x98b5('0x1b'),_0x290dc6,JSON[_0x98b5('0x15')](_0x4dacc0));_0x586356(_0x4dacc0);})[_0x98b5('0x1a')](function(_0x5f16d8){logger[_0x98b5('0x16')](_0x98b5('0x1b'),_0x5f16d8[_0x98b5('0x18')],_0x290dc6);_0xeef07d(_0x8f6b4f[_0x98b5('0x16')](0x1f4,_0x5f16d8[_0x98b5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index d10d571..5c1e776 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 _0x45ee=['remove','update','emit','removeListener','register','plugin:'];(function(_0x1d30fc,_0x3ab679){var _0x3c27e3=function(_0x50c609){while(--_0x50c609){_0x1d30fc['push'](_0x1d30fc['shift']());}};_0x3c27e3(++_0x3ab679);}(_0x45ee,0x168));var _0xe45e=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x45ee[_0xd1c39b];return _0x58f5bc;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0xe45e('0x0'),_0xe45e('0x1')];function createListener(_0x1484ae,_0x32ebc8){return function(_0x45ea25){_0x32ebc8[_0xe45e('0x2')](_0x1484ae,_0x45ea25);};}function removeListener(_0x2e7f0f,_0x6ade18){return function(){PluginEvents[_0xe45e('0x3')](_0x2e7f0f,_0x6ade18);};}exports[_0xe45e('0x4')]=function(_0x19133b){for(var _0x15d2b4=0x0,_0x57d867=events['length'];_0x15d2b4<_0x57d867;_0x15d2b4++){var _0x48786d=events[_0x15d2b4];var _0x535ada=createListener(_0xe45e('0x5')+_0x48786d,_0x19133b);PluginEvents['on'](_0x48786d,_0x535ada);}}; \ No newline at end of file +var _0xd2e4=['plugin:','./plugin.events','save','emit','removeListener','length'];(function(_0x375ba8,_0x3119af){var _0x84f35c=function(_0x4d0d0e){while(--_0x4d0d0e){_0x375ba8['push'](_0x375ba8['shift']());}};_0x84f35c(++_0x3119af);}(_0xd2e4,0xaf));var _0x4d2e=function(_0x3f3083,_0x229b41){_0x3f3083=_0x3f3083-0x0;var _0x499e65=_0xd2e4[_0x3f3083];return _0x499e65;};'use strict';var PluginEvents=require(_0x4d2e('0x0'));var events=[_0x4d2e('0x1'),'remove','update'];function createListener(_0x289217,_0x1193be){return function(_0x535212){_0x1193be[_0x4d2e('0x2')](_0x289217,_0x535212);};}function removeListener(_0x2d17dd,_0x3bd0f0){return function(){PluginEvents[_0x4d2e('0x3')](_0x2d17dd,_0x3bd0f0);};}exports['register']=function(_0x4043ff){for(var _0x4c9222=0x0,_0x3b3760=events[_0x4d2e('0x4')];_0x4c9222<_0x3b3760;_0x4c9222++){var _0x109c42=events[_0x4c9222];var _0x5dfc2a=createListener(_0x4d2e('0x5')+_0x109c42,_0x4043ff);PluginEvents['on'](_0x109c42,_0x5dfc2a);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index ad081d6..f7d2448 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(_0x23e136,_0x4eca99){var _0xe365af=function(_0x23efe0){while(--_0x23efe0){_0x23e136['push'](_0x23e136['shift']());}};_0xe365af(++_0x4eca99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x59f1d8,_0x528767){var _0x3f590a=function(_0x38d6ae){while(--_0x38d6ae){_0x59f1d8['push'](_0x59f1d8['shift']());}};_0x3f590a(++_0x528767);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 bb926d3..28eda2d 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 _0xd404=['stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','api','path','exec','bluebird','sendStatus','json','name','status','send','npm\x20install','info','error','index','list','then','express','motion2','length','catch','show','describe','params','body','join','script','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart'];(function(_0x1ac153,_0x14646b){var _0xe65406=function(_0x42cbd9){while(--_0x42cbd9){_0x1ac153['push'](_0x1ac153['shift']());}};_0xe65406(++_0x14646b);}(_0xd404,0x15b));var _0x4d40=function(_0x1d89e1,_0x4270c5){_0x1d89e1=_0x1d89e1-0x0;var _0x24646c=_0xd404[_0x1d89e1];return _0x24646c;};'use strict';var _=require(_0x4d40('0x0'));var pm2=require(_0x4d40('0x1'));var logger=require('../../config/logger')(_0x4d40('0x2'));var path=require(_0x4d40('0x3'));var exec=require('child_process')[_0x4d40('0x4')];var BPromise=require(_0x4d40('0x5'));function handleEntityNotFound(_0xba821,_0x8bde12){return function(_0xbfb4c6){if(!_0xbfb4c6){_0xba821[_0x4d40('0x6')](0x194);;}return _0xbfb4c6;};}function respondWithResult(_0xc2a9db,_0x24a237){_0x24a237=_0x24a237||0xc8;return function(_0x2e4bd8){if(_0x2e4bd8){return _0xc2a9db['status'](_0x24a237)[_0x4d40('0x7')](_0x2e4bd8);}return null;};}function handleError(_0x116941,_0x5a23a2){_0x5a23a2=_0x5a23a2||0x1f4;return function(_0x3bf81a){logger['error'](_0x3bf81a['stack']);if(_0x3bf81a[_0x4d40('0x8')]){delete _0x3bf81a[_0x4d40('0x8')];}_0x116941[_0x4d40('0x9')](_0x5a23a2)[_0x4d40('0xa')](_0x3bf81a);};}function execChildProcess(){return new BPromise(function(_0x1d00cf,_0x357abf){exec(_0x4d40('0xb'),function(_0x2eab7a,_0x1e18bc,_0x3f5c29){logger[_0x4d40('0xc')](_0x1e18bc);logger[_0x4d40('0xc')](_0x3f5c29);if(_0x2eab7a){logger[_0x4d40('0xd')](_0x2eab7a);return _0x357abf(_0x2eab7a);}return _0x1d00cf(_0x1e18bc);});});}exports[_0x4d40('0xe')]=function(_0x5162f9,_0xa644d2){return pm2[_0x4d40('0xf')]()[_0x4d40('0x10')](function(_0x2083bd){if(_0x2083bd){var _0x477a91=_['reject'](_0x2083bd,function(_0x23de7b){return _0x23de7b[_0x4d40('0x8')]===_0x4d40('0x11')||_0x23de7b[_0x4d40('0x8')]===_0x4d40('0x12');});return{'rows':_0x477a91,'count':_0x477a91[_0x4d40('0x13')]};}return null;})[_0x4d40('0x10')](respondWithResult(_0xa644d2,null))[_0x4d40('0x14')](handleError(_0xa644d2,null));};exports[_0x4d40('0x15')]=function(_0x4b5d23,_0x535989){return pm2[_0x4d40('0x16')](_0x4b5d23[_0x4d40('0x17')]['id'])['then'](respondWithResult(_0x535989,null))[_0x4d40('0x10')](handleEntityNotFound(_0x535989,null))[_0x4d40('0x14')](handleError(_0x535989,null));};exports['create']=function(_0x36d031,_0x5a77e0){if(_0x36d031[_0x4d40('0x18')][_0x4d40('0x8')]&&_0x36d031['body']['script']){var _0x375ce0=path[_0x4d40('0x19')](__dirname,'../../files/plugins',_0x36d031[_0x4d40('0x18')][_0x4d40('0x1a')]);var _0x30f058=process['cwd']();process[_0x4d40('0x1b')](path[_0x4d40('0x1c')](_0x375ce0));return execChildProcess()[_0x4d40('0x10')](function(_0x5ca0a0){process['chdir'](_0x30f058);return pm2[_0x4d40('0x1d')]({'name':_0x36d031[_0x4d40('0x18')][_0x4d40('0x8')],'script':_0x375ce0});})[_0x4d40('0x10')](function(_0x4677c9){pm2['dump']();return _0x4677c9[0x0];})[_0x4d40('0x10')](respondWithResult(_0x5a77e0,0xc9))[_0x4d40('0x14')](handleError(_0x5a77e0,null));}else{return _0x5a77e0['status'](0x1f4)['send']({'message':_0x4d40('0x1e')});}};exports[_0x4d40('0x1f')]=function(_0x3fa83e,_0x3ad1d7){if(_0x3fa83e[_0x4d40('0x18')]['id']){delete _0x3fa83e[_0x4d40('0x18')]['id'];}var _0x105635={'online':_0x4d40('0x20'),'stopped':_0x4d40('0x21')};if(_0x105635[_0x4d40('0x22')](_0x3fa83e[_0x4d40('0x18')]['status'])){return pm2[_0x105635[_0x3fa83e['body']['status']]](_0x3fa83e[_0x4d40('0x17')]['id'])[_0x4d40('0x10')](respondWithResult(_0x3ad1d7,0xc8))[_0x4d40('0x14')](handleError(_0x3ad1d7,null));}else{return _0x3ad1d7[_0x4d40('0x9')](0x1f4)['send']({'message':_0x4d40('0x23')});}};exports[_0x4d40('0x24')]=function(_0x429da9,_0x5a6aff){if(_0x429da9[_0x4d40('0x18')]['id']){delete _0x429da9[_0x4d40('0x18')]['id'];}if(_0x429da9[_0x4d40('0x17')]['id']){return pm2[_0x4d40('0x25')](_0x429da9[_0x4d40('0x17')]['id'])['then'](function(_0x2f4b22){pm2['dump']();return _0x2f4b22[0x0];})[_0x4d40('0x10')](respondWithResult(_0x5a6aff,null))[_0x4d40('0x14')](handleError(_0x5a6aff,null));}else{return _0x5a6aff[_0x4d40('0x9')](0x1f4)[_0x4d40('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xb469=['motion2','show','create','body','join','../../files/plugins','chdir','dirname','start','dump','catch','status','update','restart','hasOwnProperty','params','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','error','stack','name','send','info','index','list','then','reject','express'];(function(_0x9abc1d,_0x942017){var _0x1d0c93=function(_0x427f7d){while(--_0x427f7d){_0x9abc1d['push'](_0x9abc1d['shift']());}};_0x1d0c93(++_0x942017);}(_0xb469,0x13b));var _0x9b46=function(_0x436c67,_0x4729d3){_0x436c67=_0x436c67-0x0;var _0x15cc09=_0xb469[_0x436c67];return _0x15cc09;};'use strict';var _=require(_0x9b46('0x0'));var pm2=require(_0x9b46('0x1'));var logger=require(_0x9b46('0x2'))(_0x9b46('0x3'));var path=require(_0x9b46('0x4'));var exec=require(_0x9b46('0x5'))[_0x9b46('0x6')];var BPromise=require('bluebird');function handleEntityNotFound(_0x31f853,_0x45322f){return function(_0x538fc4){if(!_0x538fc4){_0x31f853[_0x9b46('0x7')](0x194);;}return _0x538fc4;};}function respondWithResult(_0x405d1c,_0x50b49e){_0x50b49e=_0x50b49e||0xc8;return function(_0x1b2dd3){if(_0x1b2dd3){return _0x405d1c['status'](_0x50b49e)['json'](_0x1b2dd3);}return null;};}function handleError(_0x34c0de,_0x545b6c){_0x545b6c=_0x545b6c||0x1f4;return function(_0x402595){logger[_0x9b46('0x8')](_0x402595[_0x9b46('0x9')]);if(_0x402595['name']){delete _0x402595[_0x9b46('0xa')];}_0x34c0de['status'](_0x545b6c)[_0x9b46('0xb')](_0x402595);};}function execChildProcess(){return new BPromise(function(_0x568d9a,_0x2c29a7){exec('npm\x20install',function(_0x672157,_0x233b6b,_0x563de4){logger[_0x9b46('0xc')](_0x233b6b);logger[_0x9b46('0xc')](_0x563de4);if(_0x672157){logger['error'](_0x672157);return _0x2c29a7(_0x672157);}return _0x568d9a(_0x233b6b);});});}exports[_0x9b46('0xd')]=function(_0x2cfb35,_0x3d9618){return pm2[_0x9b46('0xe')]()[_0x9b46('0xf')](function(_0x35c5c1){if(_0x35c5c1){var _0x2136bc=_[_0x9b46('0x10')](_0x35c5c1,function(_0x3f2b28){return _0x3f2b28[_0x9b46('0xa')]===_0x9b46('0x11')||_0x3f2b28[_0x9b46('0xa')]===_0x9b46('0x12');});return{'rows':_0x2136bc,'count':_0x2136bc['length']};}return null;})['then'](respondWithResult(_0x3d9618,null))['catch'](handleError(_0x3d9618,null));};exports[_0x9b46('0x13')]=function(_0x5a380c,_0x29fec9){return pm2['describe'](_0x5a380c['params']['id'])[_0x9b46('0xf')](respondWithResult(_0x29fec9,null))['then'](handleEntityNotFound(_0x29fec9,null))['catch'](handleError(_0x29fec9,null));};exports[_0x9b46('0x14')]=function(_0x3a15cc,_0x5a0d25){if(_0x3a15cc[_0x9b46('0x15')][_0x9b46('0xa')]&&_0x3a15cc['body']['script']){var _0xbec2ea=path[_0x9b46('0x16')](__dirname,_0x9b46('0x17'),_0x3a15cc['body']['script']);var _0x2b3440=process['cwd']();process[_0x9b46('0x18')](path[_0x9b46('0x19')](_0xbec2ea));return execChildProcess()['then'](function(_0xadff19){process['chdir'](_0x2b3440);return pm2[_0x9b46('0x1a')]({'name':_0x3a15cc[_0x9b46('0x15')]['name'],'script':_0xbec2ea});})[_0x9b46('0xf')](function(_0x31ca63){pm2[_0x9b46('0x1b')]();return _0x31ca63[0x0];})[_0x9b46('0xf')](respondWithResult(_0x5a0d25,0xc9))[_0x9b46('0x1c')](handleError(_0x5a0d25,null));}else{return _0x5a0d25[_0x9b46('0x1d')](0x1f4)[_0x9b46('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x9b46('0x1e')]=function(_0x3ac37e,_0x478105){if(_0x3ac37e[_0x9b46('0x15')]['id']){delete _0x3ac37e[_0x9b46('0x15')]['id'];}var _0x2a79a5={'online':_0x9b46('0x1f'),'stopped':'stop'};if(_0x2a79a5[_0x9b46('0x20')](_0x3ac37e[_0x9b46('0x15')][_0x9b46('0x1d')])){return pm2[_0x2a79a5[_0x3ac37e[_0x9b46('0x15')][_0x9b46('0x1d')]]](_0x3ac37e[_0x9b46('0x21')]['id'])[_0x9b46('0xf')](respondWithResult(_0x478105,0xc8))[_0x9b46('0x1c')](handleError(_0x478105,null));}else{return _0x478105[_0x9b46('0x1d')](0x1f4)[_0x9b46('0xb')]({'message':_0x9b46('0x22')});}};exports['destroy']=function(_0x1f722d,_0x27f326){if(_0x1f722d[_0x9b46('0x15')]['id']){delete _0x1f722d[_0x9b46('0x15')]['id'];}if(_0x1f722d[_0x9b46('0x21')]['id']){return pm2[_0x9b46('0x23')](_0x1f722d[_0x9b46('0x21')]['id'])[_0x9b46('0xf')](function(_0x3ab49a){pm2[_0x9b46('0x1b')]();return _0x3ab49a[0x0];})[_0x9b46('0xf')](respondWithResult(_0x27f326,null))['catch'](handleError(_0x27f326,null));}else{return _0x27f326[_0x9b46('0x1d')](0x1f4)['send']({'message':_0x9b46('0x24')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index a6f22ff..a5f715a 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 _0xd509=['exports','../../components/auth/service','./realtime.controller','get','getQueues'];(function(_0x3a83fc,_0x2e8cda){var _0x5c8bd2=function(_0x31a9b7){while(--_0x31a9b7){_0x3a83fc['push'](_0x3a83fc['shift']());}};_0x5c8bd2(++_0x2e8cda);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x9d50('0x0'));var controller=require(_0x9d50('0x1'));router[_0x9d50('0x2')]('/queues',auth['isAuthenticated'](),controller[_0x9d50('0x3')]);module[_0x9d50('0x4')]=router; \ No newline at end of file +var _0xa4e3=['isAuthenticated','getQueues','exports','express','../../components/auth/service','get','/queues'];(function(_0x2b3b60,_0x1fafc6){var _0x35099f=function(_0x19c3b6){while(--_0x19c3b6){_0x2b3b60['push'](_0x2b3b60['shift']());}};_0x35099f(++_0x1fafc6);}(_0xa4e3,0x129));var _0x3a4e=function(_0x15962c,_0x37a716){_0x15962c=_0x15962c-0x0;var _0x3d86ce=_0xa4e3[_0x15962c];return _0x3d86ce;};'use strict';var express=require(_0x3a4e('0x0'));var router=express['Router']();var auth=require(_0x3a4e('0x1'));var controller=require('./realtime.controller');router[_0x3a4e('0x2')](_0x3a4e('0x3'),auth[_0x3a4e('0x4')](),controller[_0x3a4e('0x5')]);module[_0x3a4e('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 04937af..736dd13 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 _0x7096=['pick','getAgents','online','getMembers','UserId','Pause','findAll','QueueId','User','agent','length','all','catch','lodash','../../components/parsers/qs','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','name','send','chat','sms','openchannel','fax','then','query','channel','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','fieldName','type','key','user','role','userProfileId','voice','outbound','QueueCampaigns','Queues','UserProfile','findAndCountAll','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','paused','push','originated','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','pTalking','agents','merge'];(function(_0x2d6dfa,_0x29ffad){var _0x249500=function(_0x12755f){while(--_0x12755f){_0x2d6dfa['push'](_0x2d6dfa['shift']());}};_0x249500(++_0x29ffad);}(_0x7096,0x10c));var _0x6709=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x7096[_0x334841];return _0x5beb4b;};'use strict';var util=require('util');var _=require(_0x6709('0x0'));var jayson=require('jayson/promise');var qs=require(_0x6709('0x1'));var logger=require('../../config/logger')(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var client=jayson[_0x6709('0x4')][_0x6709('0x5')]({'port':0x232a});var routingClient=jayson[_0x6709('0x4')][_0x6709('0x5')]({'port':0x232c});function respondWithFilteredResult(_0xb8fe6d,_0x9d630f){return function(_0xa35832){if(_0xa35832){var _0x3e2223=typeof _0x9d630f[_0x6709('0x6')]===_0x6709('0x7')&&typeof _0x9d630f[_0x6709('0x8')]==='undefined';var _0x5af380=_0xa35832[_0x6709('0x9')];var _0x2d8c0b=_0x3e2223?0x0:_0x9d630f[_0x6709('0x6')];var _0x1aa476=_0x3e2223?_0xa35832[_0x6709('0x9')]:_0x9d630f[_0x6709('0x6')]+_0x9d630f['limit'];var _0x5b9f26;if(_0x1aa476>=_0x5af380){_0x1aa476=_0x5af380;_0x5b9f26=0xc8;}else{_0x5b9f26=0xce;}_0xb8fe6d[_0x6709('0xa')](_0x5b9f26);return _0xb8fe6d[_0x6709('0xb')](_0x6709('0xc'),_0x2d8c0b+'-'+_0x1aa476+'/'+_0x5af380)[_0x6709('0xd')](_0xa35832);}return null;};}function handleError(_0x31ac88,_0x288f51){_0x288f51=_0x288f51||0x1f4;return function(_0x1d56a5){logger[_0x6709('0xe')](_0x1d56a5['stack']);if(_0x1d56a5[_0x6709('0xf')]){delete _0x1d56a5[_0x6709('0xf')];}_0x31ac88[_0x6709('0xa')](_0x288f51)[_0x6709('0x10')](_0x1d56a5);};}exports['getQueues']=function(_0xc728aa,_0x5c667c){var _0x41af1f=['mail',_0x6709('0x11'),_0x6709('0x12'),_0x6709('0x13'),_0x6709('0x14'),'whatsapp','voice'];var _0x5c4f94={'count':0x0,'rows':[]},_0x3fa5b1={},_0x235a54;Promise['resolve']()[_0x6709('0x15')](function(){if(_0xc728aa[_0x6709('0x16')][_0x6709('0x17')]){if(!_['includes'](_0x41af1f,_0xc728aa[_0x6709('0x16')][_0x6709('0x17')][_0x6709('0x18')]()))throw new Error(_0x6709('0x19'));_0x235a54=_0xc728aa['query'][_0x6709('0x17')][_0x6709('0x18')]();}var _0x373047=_[_0x6709('0x1a')](_0x235a54)+_0x6709('0x1b');var _0x224e8a=_[_0x6709('0x1c')](db[_0x373047][_0x6709('0x1d')],function(_0x386224){return{'name':_0x386224[_0x6709('0x1e')],'type':_0x386224[_0x6709('0x1f')][_0x6709('0x20')]};});_0x3fa5b1=qs['getOptions'](_0x224e8a,_0xc728aa);if(_0xc728aa[_0x6709('0x21')][_0x6709('0x22')]===_0x6709('0x21')){var _0x5c7982={'params':{'id':_0xc728aa[_0x6709('0x21')][_0x6709('0x23')]},'query':{'section':_0x235a54===_0x6709('0x24')&&_0xc728aa[_0x6709('0x16')]['type']===_0x6709('0x25')?_0x6709('0x26'):_['startCase'](_0x235a54)+_0x6709('0x27'),'type':_0xc728aa[_0x6709('0x16')]['type'],'nolimit':!![],'sort':_0x6709('0xf'),'filter':_0xc728aa[_0x6709('0x16')]['filter']}};return db[_0x6709('0x28')]['getResources'](_0x5c7982);}return db[_0x373047][_0x6709('0x29')](_0x3fa5b1);})[_0x6709('0x15')](function(_0x5b6906){_0x5c4f94[_0x6709('0x9')]=_0x5b6906['count'];var _0xe066d8=_0x235a54===_0x6709('0x24')?client:routingClient;return _0xe066d8['request'](_[_0x6709('0x1a')](_0x235a54)+'Queues',_0xc728aa)[_0x6709('0x15')](function(_0x135f46){if(_0x135f46['error'])throw new Error(util['format'](_0x6709('0x2a'),_0x235a54));var _0x2a0cb0=_0x135f46[_0x6709('0x2b')];var _0x3f2b5e=[_0x6709('0x2c'),_0x6709('0x2d'),_0x6709('0x2e'),_0x6709('0x2f'),_0x6709('0x30')];if(_0x235a54==='voice'&&_0xc728aa[_0x6709('0x16')][_0x6709('0x1f')]===_0x6709('0x25')){_0x3f2b5e[_0x6709('0x31')]('pTalking',_0x6709('0x32'),_0x6709('0x33'),_0x6709('0x34'),_0x6709('0x35'),'Trunk',_0x6709('0x36'),_0x6709('0x37'),'erlangCalls',_0x6709('0x38'),_0x6709('0x39'),'erlangBusyFactor',_0x6709('0x3a'),_0x6709('0x3b'),_0x6709('0x3c'),_0x6709('0x3d'),_0x6709('0x3e'),_0x6709('0x3f'),_0x6709('0x40'),'predictiveIntervalDroppedCallsCallersExit',_0x6709('0x41'),_0x6709('0x42'));}var _0x4fad54=_0x5b6906[_0x6709('0x43')][_0x6709('0x1c')](function(_0x6b5f39){var _0x2bb89c=_0x6b5f39[_0x6709('0x44')]({'plain':!![]});_0x2bb89c[_0x6709('0x30')]=0x0;_0x2bb89c['loggedInDb']=0x0;_0x2bb89c[_0x6709('0x2c')]=0x0;_0x2bb89c['available']=0x0;_0x2bb89c[_0x6709('0x30')]=0x0;_0x2bb89c[_0x6709('0x2e')]=0x0;if(_0x235a54===_0x6709('0x24')){_0x2bb89c['talking']=0x0;if(_0xc728aa[_0x6709('0x16')][_0x6709('0x1f')]===_0x6709('0x25')){_0x2bb89c[_0x6709('0x45')]=0x0;_0x2bb89c[_0x6709('0x32')]=0x0;}}_0x2bb89c[_0x6709('0x46')]=[];var _0x450654=_['find'](_0x2a0cb0[_0x6709('0x43')],['id',_0x2bb89c['id']]);if(_0x450654)_[_0x6709('0x47')](_0x2bb89c,_[_0x6709('0x48')](_0x450654,_0x3f2b5e));if(_0x235a54===_0x6709('0x24')){return _0x6b5f39[_0x6709('0x49')]({'attributes':['id',_0x6709('0xf'),_0x6709('0x4a')],'joinTableAttributes':[],'raw':!![]})['then'](function(_0x5abb53){return _0x6b5f39[_0x6709('0x4b')]({'raw':!![]})[_0x6709('0x15')](function(_0x98a12c){for(var _0x42790d=0x0;_0x42790d<_0x5abb53['length'];_0x42790d++){var _0x5afebc=_['find'](_0x98a12c,[_0x6709('0x4c'),_0x5abb53[_0x42790d]['id']]);var _0x293577={'id':_0x5abb53[_0x42790d]['id'],'name':_0x5abb53[_0x42790d]['name'],'online':Boolean(_0x5abb53[_0x42790d][_0x6709('0x4a')]),'paused':_0x5afebc?Boolean(_0x5afebc[_0x6709('0x30')]):![]};if(_0x293577['online'])_0x2bb89c['loggedInDb']++;if(_0x293577[_0x6709('0x30')])_0x2bb89c[_0x6709('0x30')]++;_0x2bb89c[_0x6709('0x46')][_0x6709('0x31')](_0x293577);}return _0x2bb89c;});});}else{var _0x13877a='User'+_[_0x6709('0x1a')](_0x235a54)+'Queue';var _0x26e871=_0x235a54+_0x6709('0x4d');return db[_0x13877a][_0x6709('0x4e')]({'where':{[_['startCase'](_0x235a54)+_0x6709('0x4f')]:_0x6b5f39['id']},'raw':!![]})['then'](function(_0x57c5bf){return db[_0x6709('0x50')][_0x6709('0x4e')]({'attributes':['id',_0x6709('0xf'),_0x6709('0x4a'),_0x26e871],'where':{'id':_[_0x6709('0x1c')](_0x57c5bf,_0x6709('0x4c')),'role':_0x6709('0x51')},'raw':!![]});})[_0x6709('0x15')](function(_0x123793){for(var _0xe999aa=0x0;_0xe999aa<_0x123793[_0x6709('0x52')];_0xe999aa++){var _0x17f95d={'id':_0x123793[_0xe999aa]['id'],'name':_0x123793[_0xe999aa][_0x6709('0xf')],'online':Boolean(_0x123793[_0xe999aa][_0x6709('0x4a')]),'paused':Boolean(_0x123793[_0xe999aa][_0x26e871])};if(_0x17f95d[_0x6709('0x4a')])_0x2bb89c['loggedInDb']++;if(_0x17f95d[_0x6709('0x30')])_0x2bb89c['paused']++;_0x2bb89c['agents'][_0x6709('0x31')](_0x17f95d);}return _0x2bb89c;});}});return Promise[_0x6709('0x53')](_0x4fad54);});})[_0x6709('0x15')](function(_0xe8dd1){_0x5c4f94[_0x6709('0x43')]=_0xe8dd1;return _0x5c4f94;})[_0x6709('0x15')](respondWithFilteredResult(_0x5c667c,_0x3fa5b1))[_0x6709('0x54')](handleError(_0x5c667c,null));}; \ No newline at end of file +var _0x187d=['undefined','limit','count','status','set','Content-Range','stack','name','getQueues','chat','fax','resolve','then','query','channel','includes','toLowerCase','Invalid\x20channel','startCase','rawAttributes','fieldName','key','user','userProfileId','type','Queues','filter','getResources','findAndCountAll','voice','request','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','push','originated','message','dialActive','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','loggedInDb','paused','outbound','pTalking','agents','find','getAgents','online','getMembers','length','User','Queue','findAll','UserId','agent','rows','catch','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x187d,0x93));var _0xd187=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x187d[_0x1b349a];return _0x5d1f7c;};'use strict';var util=require(_0xd187('0x0'));var _=require('lodash');var jayson=require(_0xd187('0x1'));var qs=require(_0xd187('0x2'));var logger=require(_0xd187('0x3'))(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var client=jayson[_0xd187('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0xd187('0x6')][_0xd187('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x4ebc8d,_0x1d2533){return function(_0x58ee7){if(_0x58ee7){var _0x444a60=typeof _0x1d2533[_0xd187('0x8')]===_0xd187('0x9')&&typeof _0x1d2533[_0xd187('0xa')]===_0xd187('0x9');var _0x461a44=_0x58ee7['count'];var _0x342539=_0x444a60?0x0:_0x1d2533[_0xd187('0x8')];var _0x4039f6=_0x444a60?_0x58ee7[_0xd187('0xb')]:_0x1d2533[_0xd187('0x8')]+_0x1d2533[_0xd187('0xa')];var _0x59c194;if(_0x4039f6>=_0x461a44){_0x4039f6=_0x461a44;_0x59c194=0xc8;}else{_0x59c194=0xce;}_0x4ebc8d[_0xd187('0xc')](_0x59c194);return _0x4ebc8d[_0xd187('0xd')](_0xd187('0xe'),_0x342539+'-'+_0x4039f6+'/'+_0x461a44)['json'](_0x58ee7);}return null;};}function handleError(_0x37e80c,_0x4545cf){_0x4545cf=_0x4545cf||0x1f4;return function(_0x32ba07){logger['error'](_0x32ba07[_0xd187('0xf')]);if(_0x32ba07[_0xd187('0x10')]){delete _0x32ba07[_0xd187('0x10')];}_0x37e80c[_0xd187('0xc')](_0x4545cf)['send'](_0x32ba07);};}exports[_0xd187('0x11')]=function(_0x2050d5,_0x45ab10){var _0x188cfe=['mail',_0xd187('0x12'),'sms','openchannel',_0xd187('0x13'),'whatsapp','voice'];var _0x207b36={'count':0x0,'rows':[]},_0x2b3290={},_0x374fe0;Promise[_0xd187('0x14')]()[_0xd187('0x15')](function(){if(_0x2050d5[_0xd187('0x16')][_0xd187('0x17')]){if(!_[_0xd187('0x18')](_0x188cfe,_0x2050d5[_0xd187('0x16')][_0xd187('0x17')][_0xd187('0x19')]()))throw new Error(_0xd187('0x1a'));_0x374fe0=_0x2050d5[_0xd187('0x16')]['channel'][_0xd187('0x19')]();}var _0x81b988=_[_0xd187('0x1b')](_0x374fe0)+'Queue';var _0x5a0360=_['map'](db[_0x81b988][_0xd187('0x1c')],function(_0x33741d){return{'name':_0x33741d[_0xd187('0x1d')],'type':_0x33741d['type'][_0xd187('0x1e')]};});_0x2b3290=qs['getOptions'](_0x5a0360,_0x2050d5);if(_0x2050d5[_0xd187('0x1f')]['role']===_0xd187('0x1f')){var _0x54f340={'params':{'id':_0x2050d5['user'][_0xd187('0x20')]},'query':{'section':_0x374fe0==='voice'&&_0x2050d5[_0xd187('0x16')][_0xd187('0x21')]==='outbound'?'QueueCampaigns':_[_0xd187('0x1b')](_0x374fe0)+_0xd187('0x22'),'type':_0x2050d5[_0xd187('0x16')][_0xd187('0x21')],'nolimit':!![],'sort':'name','filter':_0x2050d5[_0xd187('0x16')][_0xd187('0x23')]}};return db['UserProfile'][_0xd187('0x24')](_0x54f340);}return db[_0x81b988][_0xd187('0x25')](_0x2b3290);})[_0xd187('0x15')](function(_0x4c50a5){_0x207b36[_0xd187('0xb')]=_0x4c50a5['count'];var _0x263e31=_0x374fe0===_0xd187('0x26')?client:routingClient;return _0x263e31[_0xd187('0x27')](_[_0xd187('0x1b')](_0x374fe0)+'Queues',_0x2050d5)[_0xd187('0x15')](function(_0xb38778){if(_0xb38778['error'])throw new Error(util['format'](_0xd187('0x28'),_0x374fe0));var _0x1836cf=_0xb38778[_0xd187('0x29')];var _0x481346=[_0xd187('0x2a'),_0xd187('0x2b'),_0xd187('0x2c'),_0xd187('0x2d'),'paused'];if(_0x374fe0===_0xd187('0x26')&&_0x2050d5[_0xd187('0x16')][_0xd187('0x21')]==='outbound'){_0x481346[_0xd187('0x2e')]('pTalking',_0xd187('0x2f'),_0xd187('0x30'),_0xd187('0x31'),'dialMethod','Trunk',_0xd187('0x32'),_0xd187('0x33'),'erlangCalls',_0xd187('0x34'),_0xd187('0x35'),_0xd187('0x36'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0xd187('0x37'),_0xd187('0x38'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0xd187('0x39'),'predictiveIntervalAvgHoldtime',_0xd187('0x3a'));}var _0x35c381=_0x4c50a5['rows'][_0xd187('0x3b')](function(_0x5674ca){var _0x293ce9=_0x5674ca[_0xd187('0x3c')]({'plain':!![]});_0x293ce9['paused']=0x0;_0x293ce9[_0xd187('0x3d')]=0x0;_0x293ce9[_0xd187('0x2a')]=0x0;_0x293ce9['available']=0x0;_0x293ce9[_0xd187('0x3e')]=0x0;_0x293ce9['waiting']=0x0;if(_0x374fe0==='voice'){_0x293ce9[_0xd187('0x2d')]=0x0;if(_0x2050d5[_0xd187('0x16')][_0xd187('0x21')]===_0xd187('0x3f')){_0x293ce9[_0xd187('0x40')]=0x0;_0x293ce9['originated']=0x0;}}_0x293ce9[_0xd187('0x41')]=[];var _0xe090ad=_[_0xd187('0x42')](_0x1836cf['rows'],['id',_0x293ce9['id']]);if(_0xe090ad)_['merge'](_0x293ce9,_['pick'](_0xe090ad,_0x481346));if(_0x374fe0==='voice'){return _0x5674ca[_0xd187('0x43')]({'attributes':['id',_0xd187('0x10'),_0xd187('0x44')],'joinTableAttributes':[],'raw':!![]})[_0xd187('0x15')](function(_0x13436d){return _0x5674ca[_0xd187('0x45')]({'raw':!![]})[_0xd187('0x15')](function(_0x791ea0){for(var _0x526060=0x0;_0x526060<_0x13436d[_0xd187('0x46')];_0x526060++){var _0x3b1b30=_[_0xd187('0x42')](_0x791ea0,['UserId',_0x13436d[_0x526060]['id']]);var _0x21cbf6={'id':_0x13436d[_0x526060]['id'],'name':_0x13436d[_0x526060]['name'],'online':Boolean(_0x13436d[_0x526060][_0xd187('0x44')]),'paused':_0x3b1b30?Boolean(_0x3b1b30[_0xd187('0x3e')]):![]};if(_0x21cbf6[_0xd187('0x44')])_0x293ce9[_0xd187('0x3d')]++;if(_0x21cbf6[_0xd187('0x3e')])_0x293ce9['paused']++;_0x293ce9[_0xd187('0x41')][_0xd187('0x2e')](_0x21cbf6);}return _0x293ce9;});});}else{var _0x3215b1=_0xd187('0x47')+_['startCase'](_0x374fe0)+_0xd187('0x48');var _0x3a5b74=_0x374fe0+'Pause';return db[_0x3215b1][_0xd187('0x49')]({'where':{[_[_0xd187('0x1b')](_0x374fe0)+'QueueId']:_0x5674ca['id']},'raw':!![]})['then'](function(_0x3eca08){return db[_0xd187('0x47')]['findAll']({'attributes':['id','name','online',_0x3a5b74],'where':{'id':_[_0xd187('0x3b')](_0x3eca08,_0xd187('0x4a')),'role':_0xd187('0x4b')},'raw':!![]});})[_0xd187('0x15')](function(_0x321b86){for(var _0x60062b=0x0;_0x60062b<_0x321b86[_0xd187('0x46')];_0x60062b++){var _0x573155={'id':_0x321b86[_0x60062b]['id'],'name':_0x321b86[_0x60062b][_0xd187('0x10')],'online':Boolean(_0x321b86[_0x60062b][_0xd187('0x44')]),'paused':Boolean(_0x321b86[_0x60062b][_0x3a5b74])};if(_0x573155[_0xd187('0x44')])_0x293ce9[_0xd187('0x3d')]++;if(_0x573155[_0xd187('0x3e')])_0x293ce9[_0xd187('0x3e')]++;_0x293ce9[_0xd187('0x41')][_0xd187('0x2e')](_0x573155);}return _0x293ce9;});}});return Promise['all'](_0x35c381);});})[_0xd187('0x15')](function(_0x2657be){_0x207b36[_0xd187('0x4c')]=_0x2657be;return _0x207b36;})[_0xd187('0x15')](respondWithFilteredResult(_0x45ab10,_0x2b3290))[_0xd187('0x4d')](handleError(_0x45ab10,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 2d0c39a..d467ff9 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(_0x27fdb2,_0x38e27b){var _0x59bc42=function(_0xdea49f){while(--_0xdea49f){_0x27fdb2['push'](_0x27fdb2['shift']());}};_0x59bc42(++_0x38e27b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0xcb91[_0xcfc44];return _0x307a25;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x545521,_0x3602a9){var _0x48907c=function(_0x2a5df8){while(--_0x2a5df8){_0x545521['push'](_0x545521['shift']());}};_0x48907c(++_0x3602a9);}(_0x70e0,0x17b));var _0x070e=function(_0x4c77f2,_0x220719){_0x4c77f2=_0x4c77f2-0x0;var _0x38e988=_0x70e0[_0x4c77f2];return _0x38e988;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 33265a8..b7e0f17 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 _0x2c24=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x2c24,0x1e6));var _0x42c2=function(_0x215583,_0x528556){_0x215583=_0x215583-0x0;var _0x5d2c31=_0x2c24[_0x215583];return _0x5d2c31;};'use strict';var Sequelize=require(_0x42c2('0x0'));module[_0x42c2('0x1')]={'state':{'type':Sequelize[_0x42c2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x42c2('0x3')]},'scheduledat':{'type':Sequelize[_0x42c2('0x4')]},'uniqueid':{'type':Sequelize[_0x42c2('0x3')]},'starttime':{'type':Sequelize[_0x42c2('0x4')]},'responsetime':{'type':Sequelize[_0x42c2('0x4')]},'ringtime':{'type':Sequelize[_0x42c2('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x42c2('0x3')]},'membername':{'type':Sequelize[_0x42c2('0x3')]}}; \ No newline at end of file +var _0xbe3b=['exports','INTEGER','DATE','STRING'];(function(_0x231828,_0x57b6c4){var _0x2598ed=function(_0x1f3953){while(--_0x1f3953){_0x231828['push'](_0x231828['shift']());}};_0x2598ed(++_0x57b6c4);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x59f655,_0x1c12aa){_0x59f655=_0x59f655-0x0;var _0x1dbb6e=_0xbe3b[_0x59f655];return _0x1dbb6e;};'use strict';var Sequelize=require('sequelize');module[_0xbbe3('0x0')]={'state':{'type':Sequelize[_0xbbe3('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xbbe3('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xbbe3('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xbbe3('0x3')]},'membername':{'type':Sequelize[_0xbbe3('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index c544647..0b1e5ae 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 _0xd900=['../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','api','moment','path','rimraf'];(function(_0x171520,_0x1cee8c){var _0x3cc729=function(_0x201c4a){while(--_0x201c4a){_0x171520['push'](_0x171520['shift']());}};_0x3cc729(++_0x1cee8c);}(_0xd900,0x7e));var _0x0d90=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0xd900[_0xb3b452];return _0x238983;};'use strict';var _=require(_0x0d90('0x0'));var util=require(_0x0d90('0x1'));var logger=require('../../config/logger')(_0x0d90('0x2'));var moment=require(_0x0d90('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d90('0x4'));var rimraf=require(_0x0d90('0x5'));var config=require(_0x0d90('0x6'));var attributes=require(_0x0d90('0x7'));module[_0x0d90('0x8')]=function(_0x49bfad,_0x1b563d){return _0x49bfad[_0x0d90('0x9')]('ReportAgentPreview',attributes,{'tableName':_0x0d90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99d7=['bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment'];(function(_0x39e810,_0x44be39){var _0xddd88c=function(_0x595179){while(--_0x595179){_0x39e810['push'](_0x39e810['shift']());}};_0xddd88c(++_0x44be39);}(_0x99d7,0xfa));var _0x799d=function(_0x2993af,_0x47d0d6){_0x2993af=_0x2993af-0x0;var _0x5ca10f=_0x99d7[_0x2993af];return _0x5ca10f;};'use strict';var _=require(_0x799d('0x0'));var util=require(_0x799d('0x1'));var logger=require(_0x799d('0x2'))(_0x799d('0x3'));var moment=require(_0x799d('0x4'));var BPromise=require(_0x799d('0x5'));var rp=require(_0x799d('0x6'));var fs=require('fs');var path=require(_0x799d('0x7'));var rimraf=require(_0x799d('0x8'));var config=require(_0x799d('0x9'));var attributes=require(_0x799d('0xa'));module[_0x799d('0xb')]=function(_0x5a6e39,_0xd1830a){return _0x5a6e39[_0x799d('0xc')](_0x799d('0xd'),attributes,{'tableName':_0x799d('0xe'),'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 0074de8..4374f1c 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 _0x3e78=['debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','body','options','raw','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent'];(function(_0x2ce0b5,_0x49c96f){var _0x1ac788=function(_0x4bac91){while(--_0x4bac91){_0x2ce0b5['push'](_0x2ce0b5['shift']());}};_0x1ac788(++_0x49c96f);}(_0x3e78,0x138));var _0x83e7=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x3e78[_0x1780f8];return _0x33a410;};'use strict';var _=require('lodash');var util=require(_0x83e7('0x0'));var moment=require(_0x83e7('0x1'));var BPromise=require(_0x83e7('0x2'));var rs=require(_0x83e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x83e7('0x5'))(_0x83e7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x83e7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33d40d,_0x4d1dd0,_0x46d53e){return new BPromise(function(_0x1b6f6b,_0x14f213){return client[_0x83e7('0x8')](_0x33d40d,_0x46d53e)[_0x83e7('0x9')](function(_0x20b52d){logger[_0x83e7('0xa')](_0x83e7('0xb'),_0x4d1dd0,_0x83e7('0xc'));logger[_0x83e7('0xd')](_0x83e7('0xe'),_0x4d1dd0,_0x83e7('0xc'),JSON[_0x83e7('0xf')](_0x20b52d));if(_0x20b52d[_0x83e7('0x10')]){if(_0x20b52d[_0x83e7('0x10')][_0x83e7('0x11')]===0x1f4){logger['error'](_0x83e7('0xb'),_0x4d1dd0,_0x20b52d['error']['message']);return _0x14f213(_0x20b52d[_0x83e7('0x10')]['message']);}logger[_0x83e7('0x10')](_0x83e7('0xb'),_0x4d1dd0,_0x20b52d[_0x83e7('0x10')][_0x83e7('0x12')]);return _0x1b6f6b(_0x20b52d[_0x83e7('0x10')]['message']);}else{logger[_0x83e7('0xa')](_0x83e7('0xb'),_0x4d1dd0,_0x83e7('0xc'));_0x1b6f6b(_0x20b52d[_0x83e7('0x13')]['message']);}})['catch'](function(_0x296755){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x4d1dd0,_0x296755);_0x14f213(_0x296755);});});}exports['CreateReportAgentPreview']=function(_0x6b4d1a){var _0x462d8f=this;return new Promise(function(_0x4cb6a2,_0x19cdf2){return db['ReportAgentPreview'][_0x83e7('0x14')](_0x6b4d1a[_0x83e7('0x15')],{'raw':_0x6b4d1a[_0x83e7('0x16')]?_0x6b4d1a[_0x83e7('0x16')][_0x83e7('0x17')]===undefined?!![]:![]:!![]})[_0x83e7('0x9')](function(_0xa6d3c6){logger[_0x83e7('0xa')]('CreateReportAgentPreview',_0x6b4d1a);logger[_0x83e7('0xd')]('CreateReportAgentPreview',_0x6b4d1a,JSON['stringify'](_0xa6d3c6));_0x4cb6a2(_0xa6d3c6);})[_0x83e7('0x18')](function(_0x14ec15){logger[_0x83e7('0x10')]('CreateReportAgentPreview',_0x14ec15[_0x83e7('0x12')],_0x6b4d1a);_0x19cdf2(_0x462d8f[_0x83e7('0x10')](0x1f4,_0x14ec15[_0x83e7('0x12')]));});});}; \ No newline at end of file +var _0x9808=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x9808,0xb3));var _0x8980=function(_0x2534cf,_0x545be6){_0x2534cf=_0x2534cf-0x0;var _0x221461=_0x9808[_0x2534cf];return _0x221461;};'use strict';var _=require(_0x8980('0x0'));var util=require(_0x8980('0x1'));var moment=require(_0x8980('0x2'));var BPromise=require(_0x8980('0x3'));var rs=require(_0x8980('0x4'));var fs=require('fs');var Redis=require(_0x8980('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8980('0x6'));var logger=require(_0x8980('0x7'))('rpc');var config=require(_0x8980('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8980('0x9')][_0x8980('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4eaca3,_0x3e369c,_0x487a71){return new BPromise(function(_0x1b5cf0,_0x2f8aea){return client[_0x8980('0xb')](_0x4eaca3,_0x487a71)[_0x8980('0xc')](function(_0x343bdd){logger[_0x8980('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x3e369c,_0x8980('0xe'));logger[_0x8980('0xf')](_0x8980('0x10'),_0x3e369c,_0x8980('0xe'),JSON[_0x8980('0x11')](_0x343bdd));if(_0x343bdd['error']){if(_0x343bdd[_0x8980('0x12')][_0x8980('0x13')]===0x1f4){logger['error'](_0x8980('0x14'),_0x3e369c,_0x343bdd[_0x8980('0x12')][_0x8980('0x15')]);return _0x2f8aea(_0x343bdd[_0x8980('0x12')]['message']);}logger[_0x8980('0x12')](_0x8980('0x14'),_0x3e369c,_0x343bdd[_0x8980('0x12')][_0x8980('0x15')]);return _0x1b5cf0(_0x343bdd['error'][_0x8980('0x15')]);}else{logger[_0x8980('0xd')](_0x8980('0x14'),_0x3e369c,'request\x20sent');_0x1b5cf0(_0x343bdd[_0x8980('0x16')][_0x8980('0x15')]);}})[_0x8980('0x17')](function(_0x4b84c2){logger[_0x8980('0x12')](_0x8980('0x14'),_0x3e369c,_0x4b84c2);_0x2f8aea(_0x4b84c2);});});}exports[_0x8980('0x18')]=function(_0x456e1d){var _0x490d21=this;return new Promise(function(_0xcc787,_0xf0ba4d){return db[_0x8980('0x19')][_0x8980('0x1a')](_0x456e1d[_0x8980('0x1b')],{'raw':_0x456e1d[_0x8980('0x1c')]?_0x456e1d[_0x8980('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4527f0){logger[_0x8980('0xd')](_0x8980('0x18'),_0x456e1d);logger[_0x8980('0xf')](_0x8980('0x18'),_0x456e1d,JSON[_0x8980('0x11')](_0x4527f0));_0xcc787(_0x4527f0);})['catch'](function(_0x453749){logger[_0x8980('0x12')](_0x8980('0x18'),_0x453749[_0x8980('0x15')],_0x456e1d);_0xf0ba4d(_0x490d21[_0x8980('0x12')](0x1f4,_0x453749['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 6a4f669..b449ea0 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 _0x0171=['/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts'];(function(_0x160611,_0x4556e6){var _0x39bbb7=function(_0x5a67f3){while(--_0x5a67f3){_0x160611['push'](_0x160611['shift']());}};_0x39bbb7(++_0x4556e6);}(_0x0171,0x191));var _0x1017=function(_0x4a3fd4,_0x596e1e){_0x4a3fd4=_0x4a3fd4-0x0;var _0x356102=_0x0171[_0x4a3fd4];return _0x356102;};'use strict';var multer=require(_0x1017('0x0'));var util=require(_0x1017('0x1'));var path=require(_0x1017('0x2'));var express=require(_0x1017('0x3'));var router=express['Router']();var auth=require(_0x1017('0x4'));var controller=require(_0x1017('0x5'));router[_0x1017('0x6')](_0x1017('0x7'),auth['isAuthenticated'](),controller[_0x1017('0x8')]);router['get'](_0x1017('0x9'),auth[_0x1017('0xa')](),controller['voiceChannelMixMonitor']);router[_0x1017('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x1017('0xa')](),controller[_0x1017('0xb')]);router[_0x1017('0x6')](_0x1017('0xc'),auth[_0x1017('0xa')](),controller['voiceQueues']);router[_0x1017('0x6')](_0x1017('0xd'),auth[_0x1017('0xa')](),controller[_0x1017('0xe')]);router[_0x1017('0x6')](_0x1017('0xf'),auth['isAuthenticated'](),controller[_0x1017('0x10')]);router['get'](_0x1017('0x11'),auth[_0x1017('0xa')](),controller[_0x1017('0x12')]);router['get'](_0x1017('0x13'),auth['isAuthenticated'](),controller[_0x1017('0x14')]);router[_0x1017('0x6')](_0x1017('0x15'),auth['isAuthenticated'](),controller[_0x1017('0x16')]);router['get'](_0x1017('0x17'),auth[_0x1017('0xa')](),controller[_0x1017('0x18')]);router[_0x1017('0x6')](_0x1017('0x19'),auth[_0x1017('0xa')](),controller['faxQueues']);router[_0x1017('0x6')](_0x1017('0x1a'),auth[_0x1017('0xa')](),controller[_0x1017('0x1b')]);router[_0x1017('0x6')](_0x1017('0x1c'),auth['isAuthenticated'](),controller[_0x1017('0x1d')]);router[_0x1017('0x6')](_0x1017('0x1e'),auth[_0x1017('0xa')](),controller[_0x1017('0x1f')]);router[_0x1017('0x6')](_0x1017('0x20'),auth['isAuthenticated'](),controller[_0x1017('0x21')]);router['get'](_0x1017('0x22'),auth['isAuthenticated'](),controller[_0x1017('0x23')]);router[_0x1017('0x6')](_0x1017('0x24'),auth['isAuthenticated'](),controller[_0x1017('0x25')]);router[_0x1017('0x26')]('/voice/queues/:id',auth[_0x1017('0xa')](),controller[_0x1017('0x27')]);router[_0x1017('0x6')]('/outbound',auth[_0x1017('0xa')](),controller[_0x1017('0x28')]);router[_0x1017('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller[_0x1017('0x29')]);router['get'](_0x1017('0x2a'),auth[_0x1017('0xa')](),controller[_0x1017('0x2b')]);router[_0x1017('0x26')](_0x1017('0x2c'),auth[_0x1017('0xa')](),controller['agentCapacity']);router[_0x1017('0x6')](_0x1017('0x2d'),auth[_0x1017('0xa')](),controller[_0x1017('0x2e')]);router[_0x1017('0x6')](_0x1017('0x2f'),auth[_0x1017('0xa')](),controller[_0x1017('0x30')]);router['get'](_0x1017('0x31'),auth[_0x1017('0xa')](),controller['campaigns']);router[_0x1017('0x6')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x1017('0x32')]);router[_0x1017('0x6')](_0x1017('0x33'),auth[_0x1017('0xa')](),controller[_0x1017('0x34')]);router[_0x1017('0x6')](_0x1017('0x35'),auth[_0x1017('0xa')](),controller[_0x1017('0x36')]);router[_0x1017('0x6')](_0x1017('0x37'),auth[_0x1017('0xa')](),controller[_0x1017('0x38')]);router[_0x1017('0x6')](_0x1017('0x39'),auth[_0x1017('0xa')](),controller[_0x1017('0x3a')]);router['get']('/sms/queues/waitinginteractions',auth[_0x1017('0xa')](),controller[_0x1017('0x3b')]);router[_0x1017('0x6')]('/whatsapp/queues/waitinginteractions',auth[_0x1017('0xa')](),controller[_0x1017('0x3c')]);router[_0x1017('0x6')](_0x1017('0x3d'),auth[_0x1017('0xa')](),controller['faxQueuesWaitingInteractions']);router[_0x1017('0x3e')](_0x1017('0x3f'),auth[_0x1017('0xa')](),controller[_0x1017('0x40')](_0x1017('0x41')));router[_0x1017('0x6')](_0x1017('0x42'),auth[_0x1017('0xa')](),controller[_0x1017('0x43')]);router[_0x1017('0x3e')](_0x1017('0x44'),auth['isAuthenticated'](),controller[_0x1017('0x40')]('chat'));router['get'](_0x1017('0x45'),auth[_0x1017('0xa')](),controller[_0x1017('0x46')]);router['post'](_0x1017('0x47'),auth[_0x1017('0xa')](),controller[_0x1017('0x40')]('fax'));router['get']('/fax/queues/:id',auth[_0x1017('0xa')](),controller[_0x1017('0x48')]);router[_0x1017('0x3e')](_0x1017('0x49'),auth[_0x1017('0xa')](),controller['queueNotify'](_0x1017('0x4a')));router['get']('/openchannel/queues/:id',auth[_0x1017('0xa')](),controller[_0x1017('0x4b')]);router['post'](_0x1017('0x4c'),auth[_0x1017('0xa')](),controller[_0x1017('0x40')]('sms'));router['post'](_0x1017('0x4d'),auth[_0x1017('0xa')](),controller[_0x1017('0x40')](_0x1017('0x4e')));router[_0x1017('0x6')]('/sms/queues/:id',auth[_0x1017('0xa')](),controller[_0x1017('0x4f')]);router[_0x1017('0x6')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0x1017('0x50')]);router['post'](_0x1017('0x51'),auth[_0x1017('0xa')](),controller[_0x1017('0x52')]);module[_0x1017('0x53')]=router; \ No newline at end of file +var _0xb306=['outboundChannels','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','post','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','/mail/queues','mailQueues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels'];(function(_0x14eaba,_0x3c9bed){var _0x52e428=function(_0x3f51de){while(--_0x3f51de){_0x14eaba['push'](_0x14eaba['shift']());}};_0x52e428(++_0x3c9bed);}(_0xb306,0x132));var _0x6b30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb306[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6b30('0x0'));var path=require(_0x6b30('0x1'));var express=require(_0x6b30('0x2'));var router=express[_0x6b30('0x3')]();var auth=require(_0x6b30('0x4'));var controller=require('./rpc.controller');router[_0x6b30('0x5')](_0x6b30('0x6'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x8')]);router['get'](_0x6b30('0x9'),auth[_0x6b30('0x7')](),controller[_0x6b30('0xa')]);router[_0x6b30('0x5')](_0x6b30('0xb'),auth[_0x6b30('0x7')](),controller['voiceChannelStopMixMonitor']);router[_0x6b30('0x5')](_0x6b30('0xc'),auth[_0x6b30('0x7')](),controller['voiceQueues']);router['get'](_0x6b30('0xd'),auth[_0x6b30('0x7')](),controller['chatQueues']);router[_0x6b30('0x5')](_0x6b30('0xe'),auth['isAuthenticated'](),controller[_0x6b30('0xf')]);router[_0x6b30('0x5')]('/mail/accounts',auth[_0x6b30('0x7')](),controller['mailAccounts']);router[_0x6b30('0x5')]('/openchannel/queues',auth[_0x6b30('0x7')](),controller[_0x6b30('0x10')]);router[_0x6b30('0x5')](_0x6b30('0x11'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x12')]);router[_0x6b30('0x5')](_0x6b30('0x13'),auth['isAuthenticated'](),controller[_0x6b30('0x14')]);router['get'](_0x6b30('0x15'),auth['isAuthenticated'](),controller[_0x6b30('0x16')]);router['get']('/voice/queues/preview/:id',auth[_0x6b30('0x7')](),controller[_0x6b30('0x17')]);router[_0x6b30('0x5')](_0x6b30('0x18'),auth['isAuthenticated'](),controller[_0x6b30('0x19')]);router[_0x6b30('0x5')](_0x6b30('0x1a'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x1b')]);router[_0x6b30('0x5')](_0x6b30('0x1c'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x1d')]);router['get'](_0x6b30('0x1e'),auth['isAuthenticated'](),controller[_0x6b30('0x1f')]);router[_0x6b30('0x5')](_0x6b30('0x20'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x21')]);router[_0x6b30('0x22')](_0x6b30('0x20'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x23')]);router['get']('/outbound',auth[_0x6b30('0x7')](),controller[_0x6b30('0x24')]);router[_0x6b30('0x5')](_0x6b30('0x25'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x26')]);router[_0x6b30('0x5')]('/agents',auth[_0x6b30('0x7')](),controller[_0x6b30('0x27')]);router[_0x6b30('0x22')](_0x6b30('0x28'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x29')]);router[_0x6b30('0x5')]('/telephones',auth['isAuthenticated'](),controller[_0x6b30('0x2a')]);router[_0x6b30('0x5')](_0x6b30('0x2b'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x2c')]);router[_0x6b30('0x5')](_0x6b30('0x2d'),auth[_0x6b30('0x7')](),controller['campaigns']);router[_0x6b30('0x5')]('/fax/accounts',auth[_0x6b30('0x7')](),controller[_0x6b30('0x2e')]);router[_0x6b30('0x5')](_0x6b30('0x2f'),auth['isAuthenticated'](),controller[_0x6b30('0x30')]);router[_0x6b30('0x5')](_0x6b30('0x31'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x32')]);router[_0x6b30('0x5')](_0x6b30('0x33'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x34')]);router['get'](_0x6b30('0x35'),auth['isAuthenticated'](),controller[_0x6b30('0x36')]);router[_0x6b30('0x5')](_0x6b30('0x37'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x38')]);router[_0x6b30('0x5')](_0x6b30('0x39'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x3a')]);router[_0x6b30('0x5')](_0x6b30('0x3b'),auth[_0x6b30('0x7')](),controller['faxQueuesWaitingInteractions']);router['post']('/mail/queues/:id/notify',auth[_0x6b30('0x7')](),controller['queueNotify'](_0x6b30('0x3c')));router[_0x6b30('0x5')](_0x6b30('0x3d'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x3e')]);router['post'](_0x6b30('0x3f'),auth['isAuthenticated'](),controller[_0x6b30('0x40')](_0x6b30('0x41')));router[_0x6b30('0x5')](_0x6b30('0x42'),auth['isAuthenticated'](),controller[_0x6b30('0x43')]);router[_0x6b30('0x44')](_0x6b30('0x45'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x40')](_0x6b30('0x46')));router['get'](_0x6b30('0x47'),auth['isAuthenticated'](),controller[_0x6b30('0x48')]);router[_0x6b30('0x44')](_0x6b30('0x49'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x40')](_0x6b30('0x4a')));router[_0x6b30('0x5')](_0x6b30('0x4b'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x4c')]);router[_0x6b30('0x44')]('/sms/queues/:id/notify',auth[_0x6b30('0x7')](),controller[_0x6b30('0x40')](_0x6b30('0x4d')));router[_0x6b30('0x44')](_0x6b30('0x4e'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x40')]('whatsapp'));router['get'](_0x6b30('0x4f'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x50')]);router['get'](_0x6b30('0x51'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x52')]);router[_0x6b30('0x44')](_0x6b30('0x53'),auth[_0x6b30('0x7')](),controller[_0x6b30('0x54')]);module[_0x6b30('0x55')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index a7ff7b2..45e4c2d 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 _0x6f47=['voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','telephones','trunks','Trunks','Campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','moment','lodash','../../mysqldb','api','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel'];(function(_0x4af28b,_0x5942ca){var _0x2b8fb0=function(_0x3062a5){while(--_0x3062a5){_0x4af28b['push'](_0x4af28b['shift']());}};_0x2b8fb0(++_0x5942ca);}(_0x6f47,0xc7));var _0x76f4=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x6f47[_0x5c9307];return _0x373e29;};'use strict';var BPromise=require('bluebird');var moment=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));var util=require('util');var db=require(_0x76f4('0x2'))['db'];var logger=require('../../config/logger')(_0x76f4('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232a});var mailClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x76f4('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){var _0x65d2c7=_0x497f99?_0x497f99:amiClient;return _0x65d2c7[_0x76f4('0x6')](_0xfc2405,_0x2176a7)[_0x76f4('0x7')](function(_0x4c6b5c){if(_0x4c6b5c['error']){if(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0x9')]===0x1f4){return _0x25656d(_0x4c6b5c['error']['message']);}return _0x1a3172(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0xa')]);}else{_0x1a3172(_0x4c6b5c[_0x76f4('0xb')]);}})[_0x76f4('0xc')](function(_0x1aee7f){_0x25656d(_0x1aee7f);});});}function respondWithResult(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xc8;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0xd')](_0xf7e347)['json'](_0x3ec740);}return _0xafd21e[_0x76f4('0xe')](0x194);};}function handleError(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0x1f4;return function(_0x4b6021){logger['error'](_0x4b6021[_0x76f4('0xf')]);if(_0x4b6021[_0x76f4('0x10')]){delete _0x4b6021[_0x76f4('0x10')];}_0x30dabf[_0x76f4('0xd')](_0x5da1ff)[_0x76f4('0x11')](_0x4b6021);};}function findById(_0x2b5e23){return function(_0x46ba51){if(!_[_0x76f4('0x12')](_0x2b5e23)&&!_[_0x76f4('0x12')](_0x46ba51)&&!_[_0x76f4('0x12')](_0x46ba51[_0x76f4('0x13')])){return _[_0x76f4('0x14')](_0x46ba51[_0x76f4('0x13')],function(_0x38450e){return _0x38450e['id']==_0x2b5e23;});}return null;};}exports[_0x76f4('0x15')]=function(_0x397360,_0xfedbe4){return respondWithRpcPromise(_0x76f4('0x16'),_0x397360[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0xfedbe4,null))[_0x76f4('0xc')](handleError(_0xfedbe4,null));};exports[_0x76f4('0x18')]=function(_0x5bf3d5,_0x262937){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x76f4('0x19')](_0x5bf3d5[_0x76f4('0x17')],_0x5bf3d5[_0x76f4('0x1a')]))['then'](respondWithResult(_0x262937,null))['catch'](handleError(_0x262937,null));};exports['voiceChannelStopMixMonitor']=function(_0x465240,_0x681d67){return respondWithRpcPromise(_0x76f4('0x1b'),_[_0x76f4('0x19')](_0x465240[_0x76f4('0x17')],_0x465240[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x681d67,null))['catch'](handleError(_0x681d67,null));};exports['voiceQueues']=function(_0x3794fa,_0x497913){return respondWithRpcPromise(_0x76f4('0x1c'),_0x3794fa['query'])['then'](respondWithResult(_0x497913,null))['catch'](handleError(_0x497913,null));};exports[_0x76f4('0x1d')]=function(_0x38300d,_0xd368a2){return respondWithRpcPromise(_0x76f4('0x1c'),_0x38300d[_0x76f4('0x17')])[_0x76f4('0x7')](findById(_0x38300d['params']['id']))[_0x76f4('0x7')](respondWithResult(_0xd368a2,null))['catch'](handleError(_0xd368a2,null));};exports['updateVoiceQueue']=function(_0x5b3f07,_0x10ddb4){return respondWithRpcPromise(_0x76f4('0x1e'),_[_0x76f4('0x19')](_0x5b3f07[_0x76f4('0x1f')],_0x5b3f07['params']))[_0x76f4('0x7')](respondWithResult(_0x10ddb4,null))['catch'](handleError(_0x10ddb4,null));};exports[_0x76f4('0x20')]=function(_0x3c7513,_0x43ac4a){return respondWithRpcPromise(_0x76f4('0x21'),_[_0x76f4('0x19')](_0x3c7513['query'],_0x3c7513['params']))[_0x76f4('0x7')](respondWithResult(_0x43ac4a,null))[_0x76f4('0xc')](handleError(_0x43ac4a,null));};exports[_0x76f4('0x22')]=function(_0x281db6,_0x1f2adf){return respondWithRpcPromise(_0x76f4('0x23'),_0x281db6[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x1f2adf,null))[_0x76f4('0xc')](handleError(_0x1f2adf,null));};exports[_0x76f4('0x24')]=function(_0x308af2,_0x2527a6){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x308af2['query'],_0x308af2['params']))[_0x76f4('0x7')](respondWithResult(_0x2527a6,null))[_0x76f4('0xc')](handleError(_0x2527a6,null));};exports[_0x76f4('0x25')]=function(_0x456b1f,_0x26fdd6){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x76f4('0x19')](_0x456b1f[_0x76f4('0x17')],_0x456b1f[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x26fdd6,null))[_0x76f4('0xc')](handleError(_0x26fdd6,null));};exports[_0x76f4('0x26')]=function(_0xb806cc,_0x28d9d6){return respondWithRpcPromise(_0x76f4('0x27'),_[_0x76f4('0x19')](_0xb806cc[_0x76f4('0x17')],_0xb806cc[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x28d9d6,null))[_0x76f4('0xc')](handleError(_0x28d9d6,null));};exports[_0x76f4('0x28')]=function(_0x88506b,_0x3308e3){return respondWithRpcPromise(_0x76f4('0x29'),_0x88506b['query'])[_0x76f4('0x7')](respondWithResult(_0x3308e3,null))[_0x76f4('0xc')](handleError(_0x3308e3,null));};exports[_0x76f4('0x2a')]=function(_0x589637,_0x597e83){return respondWithRpcPromise(_0x76f4('0x2b'),_0x589637['query'])[_0x76f4('0x7')](respondWithResult(_0x597e83,null))['catch'](handleError(_0x597e83,null));};exports[_0x76f4('0x2c')]=function(_0x16f36d,_0x312243){var _0x378675;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')])[_0x76f4('0x7')](function(_0x109ad9){_0x378675=_0x109ad9;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')],routingClient);})['then'](function(_0x5b8d2d){return _[_0x76f4('0x19')]({},_0x5b8d2d,_0x378675);})[_0x76f4('0x7')](respondWithResult(_0x312243,null))[_0x76f4('0xc')](handleError(_0x312243,null));};exports[_0x76f4('0x2e')]=function(_0x2b7dc8,_0x2d6068){if(_0x2b7dc8[_0x76f4('0x1f')]&&_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')]&&_0x2b7dc8['user']&&_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')]){for(var _0x4f0d1a in _0x2b7dc8['body'][_0x76f4('0x2f')]){if(_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x76f4('0x31')](_0x4f0d1a)){db[_0x76f4('0x32')]['findAll']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'exitAt':null,'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]&&_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x76f4('0x34')]?{'$notIn':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]}:{'$ne':null}}})['then'](function(_0x571261){var _0x11ea58=moment()[_0x76f4('0x35')](_0x76f4('0x36'));for(var _0x2bea6d=0x0,_0x36fa03=_0x571261['length'];_0x2bea6d<_0x36fa03;_0x2bea6d+=0x1){_0x571261[_0x2bea6d]['updateAttributes']({'exitAt':_0x11ea58});}});for(var _0x8e5b60=0x0;_0x8e5b60<_0x2b7dc8['body'][_0x76f4('0x2f')][_0x4f0d1a][_0x76f4('0x34')];_0x8e5b60+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'uniqueid':_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x8e5b60],'exitAt':null},'defaults':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'interface':_[_0x76f4('0x12')](_0x2b7dc8['user'][_0x76f4('0x37')])?util[_0x76f4('0x35')]('SIP/%s',_0x2b7dc8['user'][_0x76f4('0x10')]):_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x37')],'type':_0x76f4('0x33'),'enterAt':moment()[_0x76f4('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x76f4('0x38'),'internal':_0x2b7dc8['user'][_0x76f4('0x39')],'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a][_0x8e5b60]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b7dc8[_0x76f4('0x1a')]['id'],'capacity':_0x2b7dc8[_0x76f4('0x1f')]['capacity']},routingClient)[_0x76f4('0x7')](respondWithResult(_0x2d6068,null))[_0x76f4('0xc')](handleError(_0x2d6068,null));};exports[_0x76f4('0x3a')]=function(_0x1c658c,_0x40ff20){return respondWithRpcPromise('Telephones',_0x1c658c[_0x76f4('0x17')])['then'](respondWithResult(_0x40ff20,null))[_0x76f4('0xc')](handleError(_0x40ff20,null));};exports[_0x76f4('0x3b')]=function(_0x154ba,_0x5121ec){return respondWithRpcPromise(_0x76f4('0x3c'),_0x154ba[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x5121ec,null))[_0x76f4('0xc')](handleError(_0x5121ec,null));};exports['campaigns']=function(_0x2028e9,_0xf11e07){return respondWithRpcPromise(_0x76f4('0x3d'),_0x2028e9[_0x76f4('0x17')])['then'](respondWithResult(_0xf11e07,null))[_0x76f4('0xc')](handleError(_0xf11e07,null));};exports['chatQueues']=function(_0x129048,_0x190c8d){return respondWithRpcPromise('ChatQueues',_0x129048['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x190c8d,null))[_0x76f4('0xc')](handleError(_0x190c8d,null));};exports[_0x76f4('0x3e')]=function(_0x596b51,_0x27ba06){return respondWithRpcPromise(_0x76f4('0x3f'),_0x596b51[_0x76f4('0x17')],routingClient)['then'](findById(_0x596b51['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x27ba06,null))[_0x76f4('0xc')](handleError(_0x27ba06,null));};exports['mailQueues']=function(_0x490ced,_0x3f1840){return respondWithRpcPromise(_0x76f4('0x40'),_0x490ced[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x3f1840,null))[_0x76f4('0xc')](handleError(_0x3f1840,null));};exports[_0x76f4('0x41')]=function(_0x97be11,_0x36a52a){return respondWithRpcPromise(_0x76f4('0x40'),_0x97be11['query'],routingClient)['then'](findById(_0x97be11['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x36a52a,null))[_0x76f4('0xc')](handleError(_0x36a52a,null));};exports[_0x76f4('0x42')]=function(_0x3b6c16,_0x4c9d64){return respondWithRpcPromise('MailAccounts',_0x3b6c16[_0x76f4('0x17')],mailClient)['then'](respondWithResult(_0x4c9d64,null))[_0x76f4('0xc')](handleError(_0x4c9d64,null));};exports['openchannelQueues']=function(_0x4285dd,_0x25e510){return respondWithRpcPromise(_0x76f4('0x43'),_0x4285dd[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x25e510,null))[_0x76f4('0xc')](handleError(_0x25e510,null));};exports[_0x76f4('0x44')]=function(_0x22a0cc,_0x40c170){return respondWithRpcPromise(_0x76f4('0x43'),_0x22a0cc[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x22a0cc['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x40c170,null))[_0x76f4('0xc')](handleError(_0x40c170,null));};exports[_0x76f4('0x45')]=function(_0x320a87,_0x28cf4c){return respondWithRpcPromise(_0x76f4('0x46'),_0x320a87[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x28cf4c,null))['catch'](handleError(_0x28cf4c,null));};exports['showSmsQueues']=function(_0xa3091a,_0x617924){return respondWithRpcPromise(_0x76f4('0x46'),_0xa3091a['query'],routingClient)[_0x76f4('0x7')](findById(_0xa3091a['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x617924,null))[_0x76f4('0xc')](handleError(_0x617924,null));};exports['whatsappQueues']=function(_0xda0ac2,_0x37b7f7){return respondWithRpcPromise(_0x76f4('0x47'),_0xda0ac2[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x37b7f7,null))[_0x76f4('0xc')](handleError(_0x37b7f7,null));};exports[_0x76f4('0x48')]=function(_0x410d83,_0x1f7257){return respondWithRpcPromise('WhatsappQueues',_0x410d83[_0x76f4('0x17')],routingClient)['then'](findById(_0x410d83[_0x76f4('0x1a')]['id']))[_0x76f4('0x7')](respondWithResult(_0x1f7257,null))[_0x76f4('0xc')](handleError(_0x1f7257,null));};exports[_0x76f4('0x49')]=function(_0xfbb52c,_0x8de630){return respondWithRpcPromise(_0x76f4('0x4a'),_0xfbb52c[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x8de630,null))[_0x76f4('0xc')](handleError(_0x8de630,null));};exports['showFaxQueues']=function(_0x30f3de,_0x6f874d){return respondWithRpcPromise('FaxQueues',_0x30f3de[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x30f3de[_0x76f4('0x1a')]['id']))['then'](respondWithResult(_0x6f874d,null))[_0x76f4('0xc')](handleError(_0x6f874d,null));};exports[_0x76f4('0x4b')]=function(_0x3e829f,_0x52610a){return respondWithRpcPromise(_0x76f4('0x4c'),_0x3e829f[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x52610a,null))[_0x76f4('0xc')](handleError(_0x52610a,null));};exports[_0x76f4('0x4d')]=function(_0x10ee07,_0x19b99c){return respondWithRpcPromise(_0x76f4('0x4e'),_0x10ee07[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x19b99c,null))[_0x76f4('0xc')](handleError(_0x19b99c,null));};exports[_0x76f4('0x4f')]=function(_0x19fdc3,_0x39c9af){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19fdc3[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x39c9af,null))[_0x76f4('0xc')](handleError(_0x39c9af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x43b44d,_0x1375d5){return respondWithRpcPromise(_0x76f4('0x50'),_0x43b44d[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x1375d5,null))['catch'](handleError(_0x1375d5,null));};exports[_0x76f4('0x51')]=function(_0x4dd41f,_0x2b8467){return respondWithRpcPromise(_0x76f4('0x50'),_0x4dd41f['query'],routingClient)['then'](function(_0x58251e){if(_0x4dd41f[_0x76f4('0x17')][_0x76f4('0x52')]!==undefined){var _0x1e7b6=_(_0x58251e[_0x76f4('0x13')])[_0x76f4('0x53')]([_0x4dd41f[_0x76f4('0x17')]['type'],_0x4dd41f[_0x76f4('0x1a')]['id']])[_0x76f4('0x54')](_0x76f4('0x55'))[_0x76f4('0x56')]()[_0x76f4('0x57')]();return _0x58251e[_0x76f4('0x13')][_0x76f4('0x53')](function(_0x202fc8){return _0x1e7b6['indexOf'](_0x202fc8[_0x76f4('0x55')])>-0x1;});}else{return _0x58251e['rows'][_0x76f4('0x53')](function(_0x30358a){return _0x30358a[_0x76f4('0x55')]===parseInt(_0x4dd41f[_0x76f4('0x1a')]['id']);});}})[_0x76f4('0x7')](respondWithResult(_0x2b8467,null))[_0x76f4('0xc')](handleError(_0x2b8467,null));};exports[_0x76f4('0x58')]=function(_0x2a0491,_0x54729b){return respondWithRpcPromise(_0x76f4('0x59'),_0x2a0491['query'],routingClient)['then'](respondWithResult(_0x54729b,null))['catch'](handleError(_0x54729b,null));};exports[_0x76f4('0x5a')]=function(_0x402209,_0x279040){return respondWithRpcPromise(_0x76f4('0x5b'),_0x402209['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x279040,null))[_0x76f4('0xc')](handleError(_0x279040,null));};exports[_0x76f4('0x5c')]=function(_0x5f5c24,_0x12f16e){return respondWithRpcPromise(_0x76f4('0x5d'),_0x5f5c24[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x12f16e,null))[_0x76f4('0xc')](handleError(_0x12f16e,null));};exports[_0x76f4('0x5e')]=function(_0x3b5e15){return function(_0x4b562c,_0x2e991e){var _0xa49e2a,_0x4c7307;var _0x3bc914=_[_0x76f4('0x5f')](_0x3b5e15);var _0x5e6393=_0x3b5e15===_0x76f4('0x60')?_0x76f4('0x61'):_0x76f4('0x62');return db[_0x3bc914+_0x76f4('0x63')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x4b562c[_0x76f4('0x1a')]['id']}})['then'](function(_0x2dac86){if(_[_0x76f4('0x12')](_0x2dac86)){throw new Error(_0x3bc914+_0x76f4('0x65'));}_0xa49e2a=_0x2dac86;return db[_0x3bc914+_0x76f4('0x66')]['findOne']({'where':{'id':_0x4b562c[_0x76f4('0x1f')]['messageId']},'include':[{'model':db[_0x3bc914+_0x76f4('0x67')],'as':'Interaction'},{'model':db[_0x3bc914+_0x5e6393],'as':_0x76f4('0x62')}]});})[_0x76f4('0x7')](function(_0x59e9ed){if(_['isNil'](_0x59e9ed)){throw new Error(_0x3bc914+_0x76f4('0x68'));}_0x4c7307=_0x59e9ed;return _0x59e9ed[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x76f4('0x7')](function(){var _0x4a2969={'uniqueid':_0x3b5e15+'.'+_0x4c7307['id']+'.'+_0x4c7307['Interaction']['id'],'FromUserId':_0x4b562c[_0x76f4('0x30')]['id'],'type':_0x76f4('0x6a')};_0x4a2969[_0x3bc914+_0x76f4('0x6b')]=_0x4c7307['id'];_0x4a2969[_0x3bc914+_0x76f4('0x6c')]=_0x4c7307[_0x76f4('0x67')]['id'];_0x4a2969[_0x76f4('0x6d')+_0x3bc914+_0x5e6393+'Id']=_0x4c7307[_0x76f4('0x62')]['id'];_0x4a2969['To'+_0x3bc914+_0x76f4('0x6e')]=_0xa49e2a['id'];return db[_0x3bc914+'TransferReport']['create'](_0x4a2969);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x3b5e15,'interaction':_0x4c7307[_0x76f4('0x67')],'message':_0x4c7307,'account':_0x4c7307['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x6a'),'appdata':_0xa49e2a[_0x76f4('0x10')]+','+(_0x4c7307[_0x76f4('0x62')][_0x76f4('0x70')]||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x2e991e,null))[_0x76f4('0xc')](handleError(_0x2e991e,null));};};exports['agentNotify']=function(_0x13cf2a,_0x316f86){var _0x3e537b,_0x53252e;if(_[_0x76f4('0x12')](_0x13cf2a[_0x76f4('0x1f')][_0x76f4('0x72')])){throw new Error(_0x76f4('0x73'));}var _0x5080a9=_0x13cf2a[_0x76f4('0x1f')]['channel'];var _0xc80d4c=_['capitalize'](_0x5080a9);var _0x238df3=_0x5080a9===_0x76f4('0x60')?_0x76f4('0x61'):'Account';return db[_0x76f4('0x74')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x13cf2a[_0x76f4('0x1a')]['id'],'role':'agent'}})[_0x76f4('0x7')](function(_0x460867){if(_['isNil'](_0x460867)){throw new Error('Agent\x20not\x20found');}_0x3e537b=_0x460867;return db[_0xc80d4c+_0x76f4('0x66')][_0x76f4('0x64')]({'where':{'id':_0x13cf2a['body']['messageId']},'include':[{'model':db[_0xc80d4c+_0x76f4('0x67')],'as':_0x76f4('0x67')},{'model':db[_0xc80d4c+_0x238df3],'as':'Account'}]});})[_0x76f4('0x7')](function(_0x54ae6c){if(_['isNil'](_0x54ae6c)){throw new Error(_0xc80d4c+'\x20Message\x20not\x20found');}_0x53252e=_0x54ae6c;return _0x54ae6c[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x59265d={'uniqueid':_0x5080a9+'.'+_0x53252e['id']+'.'+_0x53252e[_0x76f4('0x67')]['id'],'FromUserId':_0x13cf2a['user']['id'],'type':'queue','ToUserId':_0x3e537b['id']};_0x59265d[_0xc80d4c+_0x76f4('0x6b')]=_0x53252e['id'];_0x59265d[_0xc80d4c+'InteractionId']=_0x53252e[_0x76f4('0x67')]['id'];_0x59265d[_0x76f4('0x6d')+_0xc80d4c+_0x238df3+'Id']=_0x53252e['Account']['id'];return db[_0xc80d4c+'TransferReport'][_0x76f4('0x75')](_0x59265d);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x5080a9,'interaction':_0x53252e['Interaction'],'message':_0x53252e,'account':_0x53252e[_0x76f4('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x38'),'appdata':_0x3e537b[_0x76f4('0x10')]+','+(_0x53252e[_0x76f4('0x62')]['agentTransferTimeout']||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x316f86,null))[_0x76f4('0xc')](handleError(_0x316f86,null));}; \ No newline at end of file +var _0x24ca=['telephones','Telephones','trunks','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','queue','MessageId','InteractionId','From','QueueId','Start','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','TransferReport','create','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','error','code','message','result','json','sendStatus','stack','status','send','isNil','rows','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','catch','VoiceQueues','showVoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','name','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity'];(function(_0x106e02,_0x3664fe){var _0x15e21c=function(_0x4d47d2){while(--_0x4d47d2){_0x106e02['push'](_0x106e02['shift']());}};_0x15e21c(++_0x3664fe);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0x24ca[_0x4854d6];return _0x3885c0;};'use strict';var BPromise=require(_0xa24c('0x0'));var moment=require('moment');var _=require(_0xa24c('0x1'));var util=require(_0xa24c('0x2'));var db=require(_0xa24c('0x3'))['db'];var logger=require('../../config/logger')(_0xa24c('0x4'));var jayson=require(_0xa24c('0x5'));var amiClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232a});var mailClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232b});var routingClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){var _0x3a5727=_0x9a5013?_0x9a5013:amiClient;return _0x3a5727[_0xa24c('0x8')](_0x2dd348,_0x257264)['then'](function(_0x399f32){if(_0x399f32[_0xa24c('0x9')]){if(_0x399f32[_0xa24c('0x9')][_0xa24c('0xa')]===0x1f4){return _0x42d89c(_0x399f32[_0xa24c('0x9')][_0xa24c('0xb')]);}return _0x481196(_0x399f32[_0xa24c('0x9')][_0xa24c('0xb')]);}else{_0x481196(_0x399f32[_0xa24c('0xc')]);}})['catch'](function(_0x43bcd3){_0x42d89c(_0x43bcd3);});});}function respondWithResult(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xc8;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['status'](_0xcee4fe)[_0xa24c('0xd')](_0x2c2af8);}return _0x11090c[_0xa24c('0xe')](0x194);};}function handleError(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0x1f4;return function(_0x1cb08e){logger[_0xa24c('0x9')](_0x1cb08e[_0xa24c('0xf')]);if(_0x1cb08e['name']){delete _0x1cb08e['name'];}_0x26ff28[_0xa24c('0x10')](_0x2fcd8b)[_0xa24c('0x11')](_0x1cb08e);};}function findById(_0x49ce53){return function(_0x5babb5){if(!_[_0xa24c('0x12')](_0x49ce53)&&!_[_0xa24c('0x12')](_0x5babb5)&&!_['isNil'](_0x5babb5[_0xa24c('0x13')])){return _['find'](_0x5babb5[_0xa24c('0x13')],function(_0x2a610a){return _0x2a610a['id']==_0x49ce53;});}return null;};}exports[_0xa24c('0x14')]=function(_0xefdbd9,_0x4ff97c){return respondWithRpcPromise(_0xa24c('0x15'),_0xefdbd9[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x4ff97c,null))['catch'](handleError(_0x4ff97c,null));};exports['voiceChannelMixMonitor']=function(_0x506424,_0x4cd77e){return respondWithRpcPromise(_0xa24c('0x18'),_[_0xa24c('0x19')](_0x506424[_0xa24c('0x16')],_0x506424[_0xa24c('0x1a')]))['then'](respondWithResult(_0x4cd77e,null))[_0xa24c('0x1b')](handleError(_0x4cd77e,null));};exports['voiceChannelStopMixMonitor']=function(_0x224bca,_0xb81d97){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xa24c('0x19')](_0x224bca[_0xa24c('0x16')],_0x224bca[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0xb81d97,null))[_0xa24c('0x1b')](handleError(_0xb81d97,null));};exports['voiceQueues']=function(_0xec9167,_0x5cc9cb){return respondWithRpcPromise(_0xa24c('0x1c'),_0xec9167[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x5cc9cb,null))['catch'](handleError(_0x5cc9cb,null));};exports[_0xa24c('0x1d')]=function(_0x31c4d9,_0x14fd5a){return respondWithRpcPromise(_0xa24c('0x1c'),_0x31c4d9[_0xa24c('0x16')])[_0xa24c('0x17')](findById(_0x31c4d9[_0xa24c('0x1a')]['id']))['then'](respondWithResult(_0x14fd5a,null))[_0xa24c('0x1b')](handleError(_0x14fd5a,null));};exports[_0xa24c('0x1e')]=function(_0x152120,_0x12dbdc){return respondWithRpcPromise('UpdateVoiceQueue',_[_0xa24c('0x19')](_0x152120[_0xa24c('0x1f')],_0x152120[_0xa24c('0x1a')]))['then'](respondWithResult(_0x12dbdc,null))[_0xa24c('0x1b')](handleError(_0x12dbdc,null));};exports[_0xa24c('0x20')]=function(_0x253d83,_0x4ae35c){return respondWithRpcPromise(_0xa24c('0x21'),_['merge'](_0x253d83[_0xa24c('0x16')],_0x253d83[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x4ae35c,null))['catch'](handleError(_0x4ae35c,null));};exports[_0xa24c('0x22')]=function(_0x53f90,_0x1d0379){return respondWithRpcPromise('VoiceQueuesChannels',_0x53f90[_0xa24c('0x16')])['then'](respondWithResult(_0x1d0379,null))[_0xa24c('0x1b')](handleError(_0x1d0379,null));};exports[_0xa24c('0x23')]=function(_0x592198,_0x5680f5){return respondWithRpcPromise(_0xa24c('0x24'),_[_0xa24c('0x19')](_0x592198[_0xa24c('0x16')],_0x592198[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x5680f5,null))[_0xa24c('0x1b')](handleError(_0x5680f5,null));};exports[_0xa24c('0x25')]=function(_0x4b4dc2,_0x39f146){return respondWithRpcPromise(_0xa24c('0x26'),_[_0xa24c('0x19')](_0x4b4dc2[_0xa24c('0x16')],_0x4b4dc2[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x39f146,null))[_0xa24c('0x1b')](handleError(_0x39f146,null));};exports[_0xa24c('0x27')]=function(_0x1ea166,_0x129bb9){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xa24c('0x19')](_0x1ea166[_0xa24c('0x16')],_0x1ea166[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x129bb9,null))['catch'](handleError(_0x129bb9,null));};exports['outbound']=function(_0x19a65f,_0x56ef4d){return respondWithRpcPromise(_0xa24c('0x28'),_0x19a65f[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x56ef4d,null))[_0xa24c('0x1b')](handleError(_0x56ef4d,null));};exports[_0xa24c('0x29')]=function(_0x4c0fb9,_0x532875){return respondWithRpcPromise(_0xa24c('0x2a'),_0x4c0fb9[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x532875,null))[_0xa24c('0x1b')](handleError(_0x532875,null));};exports[_0xa24c('0x2b')]=function(_0x472912,_0x5080d0){var _0x56f392;return respondWithRpcPromise(_0xa24c('0x2c'),_0x472912[_0xa24c('0x16')])[_0xa24c('0x17')](function(_0x2101f8){_0x56f392=_0x2101f8;return respondWithRpcPromise(_0xa24c('0x2c'),_0x472912['query'],routingClient);})[_0xa24c('0x17')](function(_0x7895e){return _['merge']({},_0x7895e,_0x56f392);})['then'](respondWithResult(_0x5080d0,null))[_0xa24c('0x1b')](handleError(_0x5080d0,null));};exports[_0xa24c('0x2d')]=function(_0x231eea,_0x537849){if(_0x231eea['body']&&_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')]&&_0x231eea[_0xa24c('0x2f')]&&_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')]){for(var _0x1b7faf in _0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')]){if(_0x231eea['body']['interaction'][_0xa24c('0x31')](_0x1b7faf)){db[_0xa24c('0x32')][_0xa24c('0x33')]({'where':{'channel':_0x1b7faf,'membername':_0x231eea['user'][_0xa24c('0x30')],'type':_0xa24c('0x34'),'exitAt':null,'uniqueid':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf]&&_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0xa24c('0x35')]?{'$notIn':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf]}:{'$ne':null}}})[_0xa24c('0x17')](function(_0x4bbf93){var _0xb8c7a5=moment()[_0xa24c('0x36')](_0xa24c('0x37'));for(var _0x5aa2b2=0x0,_0x3a85cb=_0x4bbf93[_0xa24c('0x35')];_0x5aa2b2<_0x3a85cb;_0x5aa2b2+=0x1){_0x4bbf93[_0x5aa2b2][_0xa24c('0x38')]({'exitAt':_0xb8c7a5});}});for(var _0x31f05b=0x0;_0x31f05b<_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0xa24c('0x35')];_0x31f05b+=0x1){db[_0xa24c('0x32')][_0xa24c('0x39')]({'where':{'channel':_0x1b7faf,'membername':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')],'type':'INTERACTION','uniqueid':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0x31f05b],'exitAt':null},'defaults':{'channel':_0x1b7faf,'membername':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')],'interface':_[_0xa24c('0x12')](_0x231eea[_0xa24c('0x2f')][_0xa24c('0x3a')])?util[_0xa24c('0x36')](_0xa24c('0x3b'),_0x231eea['user']['name']):_0x231eea[_0xa24c('0x2f')]['interface'],'type':_0xa24c('0x34'),'enterAt':moment()[_0xa24c('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xa24c('0x3c'),'internal':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x3d')],'uniqueid':_0x231eea['body']['interaction'][_0x1b7faf][_0x31f05b]}});}}}}return respondWithRpcPromise(_0xa24c('0x3e'),{'id':_0x231eea['params']['id'],'capacity':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x3f')]},routingClient)[_0xa24c('0x17')](respondWithResult(_0x537849,null))[_0xa24c('0x1b')](handleError(_0x537849,null));};exports[_0xa24c('0x40')]=function(_0x1fa739,_0x3f3ce6){return respondWithRpcPromise(_0xa24c('0x41'),_0x1fa739[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x3f3ce6,null))['catch'](handleError(_0x3f3ce6,null));};exports[_0xa24c('0x42')]=function(_0x2759c1,_0x233f8e){return respondWithRpcPromise('Trunks',_0x2759c1['query'])['then'](respondWithResult(_0x233f8e,null))[_0xa24c('0x1b')](handleError(_0x233f8e,null));};exports['campaigns']=function(_0x4757ff,_0x21d0fc){return respondWithRpcPromise('Campaigns',_0x4757ff[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x21d0fc,null))[_0xa24c('0x1b')](handleError(_0x21d0fc,null));};exports[_0xa24c('0x43')]=function(_0x162a11,_0x3a72e3){return respondWithRpcPromise(_0xa24c('0x44'),_0x162a11[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x3a72e3,null))[_0xa24c('0x1b')](handleError(_0x3a72e3,null));};exports['showChatQueues']=function(_0x5abd45,_0x565f0a){return respondWithRpcPromise('ChatQueues',_0x5abd45['query'],routingClient)[_0xa24c('0x17')](findById(_0x5abd45['params']['id']))[_0xa24c('0x17')](respondWithResult(_0x565f0a,null))[_0xa24c('0x1b')](handleError(_0x565f0a,null));};exports[_0xa24c('0x45')]=function(_0x1a5f17,_0xa371d2){return respondWithRpcPromise(_0xa24c('0x46'),_0x1a5f17[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0xa371d2,null))[_0xa24c('0x1b')](handleError(_0xa371d2,null));};exports[_0xa24c('0x47')]=function(_0x303b7d,_0x37dbbd){return respondWithRpcPromise(_0xa24c('0x46'),_0x303b7d[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0x303b7d['params']['id']))[_0xa24c('0x17')](respondWithResult(_0x37dbbd,null))[_0xa24c('0x1b')](handleError(_0x37dbbd,null));};exports['mailAccounts']=function(_0x1e08bb,_0x179ae1){return respondWithRpcPromise(_0xa24c('0x48'),_0x1e08bb[_0xa24c('0x16')],mailClient)['then'](respondWithResult(_0x179ae1,null))['catch'](handleError(_0x179ae1,null));};exports[_0xa24c('0x49')]=function(_0x5e9631,_0x486040){return respondWithRpcPromise(_0xa24c('0x4a'),_0x5e9631[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x486040,null))[_0xa24c('0x1b')](handleError(_0x486040,null));};exports['showOpenchannelQueues']=function(_0x48a7b2,_0x29b836){return respondWithRpcPromise('OpenchannelQueues',_0x48a7b2['query'],routingClient)[_0xa24c('0x17')](findById(_0x48a7b2[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x29b836,null))['catch'](handleError(_0x29b836,null));};exports[_0xa24c('0x4b')]=function(_0x128e5b,_0x5c3285){return respondWithRpcPromise(_0xa24c('0x4c'),_0x128e5b[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x5c3285,null))['catch'](handleError(_0x5c3285,null));};exports[_0xa24c('0x4d')]=function(_0x34e261,_0x21439a){return respondWithRpcPromise(_0xa24c('0x4c'),_0x34e261[_0xa24c('0x16')],routingClient)['then'](findById(_0x34e261[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x21439a,null))[_0xa24c('0x1b')](handleError(_0x21439a,null));};exports[_0xa24c('0x4e')]=function(_0xab5260,_0x2ca3fa){return respondWithRpcPromise(_0xa24c('0x4f'),_0xab5260['query'],routingClient)[_0xa24c('0x17')](respondWithResult(_0x2ca3fa,null))[_0xa24c('0x1b')](handleError(_0x2ca3fa,null));};exports['showWhatsappQueues']=function(_0xb1048a,_0x3e455b){return respondWithRpcPromise(_0xa24c('0x4f'),_0xb1048a[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0xb1048a[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x3e455b,null))[_0xa24c('0x1b')](handleError(_0x3e455b,null));};exports[_0xa24c('0x50')]=function(_0x32ddc3,_0x50141e){return respondWithRpcPromise(_0xa24c('0x51'),_0x32ddc3[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x50141e,null))['catch'](handleError(_0x50141e,null));};exports[_0xa24c('0x52')]=function(_0xfd57fb,_0x2cc592){return respondWithRpcPromise('FaxQueues',_0xfd57fb[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0xfd57fb[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x2cc592,null))[_0xa24c('0x1b')](handleError(_0x2cc592,null));};exports[_0xa24c('0x53')]=function(_0x4f9b56,_0x4c374d){return respondWithRpcPromise(_0xa24c('0x54'),_0x4f9b56['query'])[_0xa24c('0x17')](respondWithResult(_0x4c374d,null))[_0xa24c('0x1b')](handleError(_0x4c374d,null));};exports[_0xa24c('0x55')]=function(_0x4073c5,_0x12d715){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4073c5[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x12d715,null))[_0xa24c('0x1b')](handleError(_0x12d715,null));};exports[_0xa24c('0x56')]=function(_0x987aca,_0x389c08){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x987aca[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x389c08,null))[_0xa24c('0x1b')](handleError(_0x389c08,null));};exports[_0xa24c('0x57')]=function(_0x5ebdd1,_0x403bf1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5ebdd1[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x403bf1,null))[_0xa24c('0x1b')](handleError(_0x403bf1,null));};exports[_0xa24c('0x58')]=function(_0x5726e1,_0x2e612d){return respondWithRpcPromise(_0xa24c('0x59'),_0x5726e1['query'],routingClient)[_0xa24c('0x17')](function(_0x168a8b){if(_0x5726e1[_0xa24c('0x16')][_0xa24c('0x5a')]!==undefined){var _0x8bd3fb=_(_0x168a8b[_0xa24c('0x13')])[_0xa24c('0x5b')]([_0x5726e1[_0xa24c('0x16')]['type'],_0x5726e1[_0xa24c('0x1a')]['id']])[_0xa24c('0x5c')](_0xa24c('0x5d'))[_0xa24c('0x5e')]()[_0xa24c('0x5f')]();return _0x168a8b[_0xa24c('0x13')][_0xa24c('0x5b')](function(_0x13dbef){return _0x8bd3fb[_0xa24c('0x60')](_0x13dbef[_0xa24c('0x5d')])>-0x1;});}else{return _0x168a8b[_0xa24c('0x13')]['filter'](function(_0x283c5b){return _0x283c5b[_0xa24c('0x5d')]===parseInt(_0x5726e1['params']['id']);});}})[_0xa24c('0x17')](respondWithResult(_0x2e612d,null))[_0xa24c('0x1b')](handleError(_0x2e612d,null));};exports[_0xa24c('0x61')]=function(_0x4f0f11,_0x5b4468){return respondWithRpcPromise(_0xa24c('0x62'),_0x4f0f11[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x5b4468,null))[_0xa24c('0x1b')](handleError(_0x5b4468,null));};exports[_0xa24c('0x63')]=function(_0x106178,_0x27a666){return respondWithRpcPromise(_0xa24c('0x64'),_0x106178[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x27a666,null))['catch'](handleError(_0x27a666,null));};exports['faxQueuesWaitingInteractions']=function(_0x263dab,_0x521894){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x263dab[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x521894,null))[_0xa24c('0x1b')](handleError(_0x521894,null));};exports[_0xa24c('0x65')]=function(_0x84ddcc){return function(_0x45b2fe,_0x16f93a){var _0x170b65,_0x2544fc;var _0x4ee10d=_[_0xa24c('0x66')](_0x84ddcc);var _0xa077c8=_0x84ddcc===_0xa24c('0x67')?_0xa24c('0x68'):_0xa24c('0x69');return db[_0x4ee10d+_0xa24c('0x6a')][_0xa24c('0x6b')]({'raw':!![],'where':{'id':_0x45b2fe[_0xa24c('0x1a')]['id']}})[_0xa24c('0x17')](function(_0x3c5495){if(_[_0xa24c('0x12')](_0x3c5495)){throw new Error(_0x4ee10d+_0xa24c('0x6c'));}_0x170b65=_0x3c5495;return db[_0x4ee10d+'Message'][_0xa24c('0x6b')]({'where':{'id':_0x45b2fe[_0xa24c('0x1f')]['messageId']},'include':[{'model':db[_0x4ee10d+_0xa24c('0x6d')],'as':_0xa24c('0x6d')},{'model':db[_0x4ee10d+_0xa077c8],'as':_0xa24c('0x69')}]});})['then'](function(_0x549e07){if(_[_0xa24c('0x12')](_0x549e07)){throw new Error(_0x4ee10d+'\x20Message\x20not\x20found');}_0x2544fc=_0x549e07;return _0x549e07[_0xa24c('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa24c('0x17')](function(){var _0x4c108f={'uniqueid':_0x84ddcc+'.'+_0x2544fc['id']+'.'+_0x2544fc['Interaction']['id'],'FromUserId':_0x45b2fe[_0xa24c('0x2f')]['id'],'type':_0xa24c('0x6f')};_0x4c108f[_0x4ee10d+_0xa24c('0x70')]=_0x2544fc['id'];_0x4c108f[_0x4ee10d+_0xa24c('0x71')]=_0x2544fc['Interaction']['id'];_0x4c108f[_0xa24c('0x72')+_0x4ee10d+_0xa077c8+'Id']=_0x2544fc[_0xa24c('0x69')]['id'];_0x4c108f['To'+_0x4ee10d+_0xa24c('0x73')]=_0x170b65['id'];return db[_0x4ee10d+'TransferReport']['create'](_0x4c108f);})[_0xa24c('0x17')](function(){return respondWithRpcPromise(_0xa24c('0x74'),{'channel':_0x84ddcc,'interaction':_0x2544fc[_0xa24c('0x6d')],'message':_0x2544fc,'account':_0x2544fc['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x170b65[_0xa24c('0x30')]+','+(_0x2544fc['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xa24c('0x17')](respondWithResult(_0x16f93a,null))[_0xa24c('0x1b')](handleError(_0x16f93a,null));};};exports[_0xa24c('0x75')]=function(_0xd23eb3,_0x890e15){var _0x12836d,_0x280fa2;if(_[_0xa24c('0x12')](_0xd23eb3[_0xa24c('0x1f')][_0xa24c('0x76')])){throw new Error(_0xa24c('0x77'));}var _0x24b28c=_0xd23eb3['body'][_0xa24c('0x76')];var _0x292c22=_['capitalize'](_0x24b28c);var _0x2fd4a2=_0x24b28c==='chat'?'Website':'Account';return db[_0xa24c('0x78')]['findOne']({'raw':!![],'where':{'id':_0xd23eb3[_0xa24c('0x1a')]['id'],'role':'agent'}})[_0xa24c('0x17')](function(_0x144c3b){if(_['isNil'](_0x144c3b)){throw new Error(_0xa24c('0x79'));}_0x12836d=_0x144c3b;return db[_0x292c22+'Message'][_0xa24c('0x6b')]({'where':{'id':_0xd23eb3[_0xa24c('0x1f')][_0xa24c('0x7a')]},'include':[{'model':db[_0x292c22+_0xa24c('0x6d')],'as':_0xa24c('0x6d')},{'model':db[_0x292c22+_0x2fd4a2],'as':'Account'}]});})[_0xa24c('0x17')](function(_0x5774d2){if(_[_0xa24c('0x12')](_0x5774d2)){throw new Error(_0x292c22+_0xa24c('0x7b'));}_0x280fa2=_0x5774d2;return _0x5774d2[_0xa24c('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa24c('0x17')](function(){var _0x4b848d={'uniqueid':_0x24b28c+'.'+_0x280fa2['id']+'.'+_0x280fa2[_0xa24c('0x6d')]['id'],'FromUserId':_0xd23eb3[_0xa24c('0x2f')]['id'],'type':_0xa24c('0x6f'),'ToUserId':_0x12836d['id']};_0x4b848d[_0x292c22+_0xa24c('0x70')]=_0x280fa2['id'];_0x4b848d[_0x292c22+'InteractionId']=_0x280fa2[_0xa24c('0x6d')]['id'];_0x4b848d[_0xa24c('0x72')+_0x292c22+_0x2fd4a2+'Id']=_0x280fa2[_0xa24c('0x69')]['id'];return db[_0x292c22+_0xa24c('0x7c')][_0xa24c('0x7d')](_0x4b848d);})[_0xa24c('0x17')](function(){return respondWithRpcPromise(_0xa24c('0x74'),{'channel':_0x24b28c,'interaction':_0x280fa2[_0xa24c('0x6d')],'message':_0x280fa2,'account':_0x280fa2[_0xa24c('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa24c('0x3c'),'appdata':_0x12836d[_0xa24c('0x30')]+','+(_0x280fa2[_0xa24c('0x69')][_0xa24c('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xa24c('0x17')](respondWithResult(_0x890e15,null))[_0xa24c('0x1b')](handleError(_0x890e15,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 057dec4..76db281 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 _0x4727=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','run','put','update','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x4727,0xab));var _0x7472=function(_0x23508e,_0x34a7f7){_0x23508e=_0x23508e-0x0;var _0x40d4c1=_0x4727[_0x23508e];return _0x40d4c1;};'use strict';var multer=require('multer');var util=require(_0x7472('0x0'));var path=require(_0x7472('0x1'));var timeout=require(_0x7472('0x2'));var express=require(_0x7472('0x3'));var router=express['Router']();var fs_extra=require(_0x7472('0x4'));var auth=require(_0x7472('0x5'));var interaction=require(_0x7472('0x6'));var config=require(_0x7472('0x7'));var controller=require('./schedule.controller');router[_0x7472('0x8')]('/',auth[_0x7472('0x9')](),controller['index']);router[_0x7472('0x8')](_0x7472('0xa'),auth['isAuthenticated'](),controller[_0x7472('0xb')]);router[_0x7472('0x8')]('/:id/run',auth[_0x7472('0x9')](),controller[_0x7472('0xc')]);router['post']('/',auth[_0x7472('0x9')](),controller['create']);router[_0x7472('0xd')](_0x7472('0xa'),auth[_0x7472('0x9')](),controller[_0x7472('0xe')]);router['delete']('/:id',auth[_0x7472('0x9')](),controller[_0x7472('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4116=['../../config/environment','get','index','isAuthenticated','run','post','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4fb001,_0x3f9e2e){var _0x207eda=function(_0x2d5b05){while(--_0x2d5b05){_0x4fb001['push'](_0x4fb001['shift']());}};_0x207eda(++_0x3f9e2e);}(_0x4116,0x161));var _0x6411=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x4116[_0x5d1044];return _0x3cd90e;};'use strict';var multer=require('multer');var util=require(_0x6411('0x0'));var path=require(_0x6411('0x1'));var timeout=require('connect-timeout');var express=require(_0x6411('0x2'));var router=express[_0x6411('0x3')]();var fs_extra=require(_0x6411('0x4'));var auth=require(_0x6411('0x5'));var interaction=require(_0x6411('0x6'));var config=require(_0x6411('0x7'));var controller=require('./schedule.controller');router[_0x6411('0x8')]('/',auth['isAuthenticated'](),controller[_0x6411('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6411('0x8')]('/:id/run',auth[_0x6411('0xa')](),controller[_0x6411('0xb')]);router[_0x6411('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x6411('0xa')](),controller['update']);router['delete']('/:id',auth[_0x6411('0xa')](),controller[_0x6411('0xd')]);module[_0x6411('0xe')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 6f371b1..ef99d28 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 _0x3cac=['STRING','DATE','INTEGER','ENUM','years','quarters','weeks','days','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports'];(function(_0x31f913,_0x5577b5){var _0x2df027=function(_0xc8004b){while(--_0xc8004b){_0x31f913['push'](_0x31f913['shift']());}};_0x2df027(++_0x5577b5);}(_0x3cac,0x142));var _0xc3ca=function(_0x34f53c,_0x37a241){_0x34f53c=_0x34f53c-0x0;var _0x154bf1=_0x3cac[_0x34f53c];return _0x154bf1;};'use strict';var Sequelize=require(_0xc3ca('0x0'));module[_0xc3ca('0x1')]={'name':{'type':Sequelize[_0xc3ca('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc3ca('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xc3ca('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc3ca('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xc3ca('0x5')](_0xc3ca('0x6'),_0xc3ca('0x7'),'months',_0xc3ca('0x8'),_0xc3ca('0x9'),_0xc3ca('0xa'),_0xc3ca('0xb')),'allowNull':![],'defaultValue':_0xc3ca('0x9')},'output':{'type':Sequelize['ENUM'](_0xc3ca('0xc'),_0xc3ca('0xd'),_0xc3ca('0xe')),'allowNull':![],'defaultValue':_0xc3ca('0xc')},'type':{'type':Sequelize[_0xc3ca('0x5')](_0xc3ca('0xf'),_0xc3ca('0x10')),'allowNull':![],'defaultValue':_0xc3ca('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xc3ca('0x2')]},'cc':{'type':Sequelize[_0xc3ca('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x10b9=['0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','minutes','csv','xlsx','default','custom','BOOLEAN','TEXT','sequelize','exports','STRING'];(function(_0x2f5a6e,_0x5b2e4d){var _0x346350=function(_0x26bd67){while(--_0x26bd67){_0x2f5a6e['push'](_0x2f5a6e['shift']());}};_0x346350(++_0x5b2e4d);}(_0x10b9,0x1b2));var _0x910b=function(_0x328f00,_0x3378b1){_0x328f00=_0x328f00-0x0;var _0x5d863d=_0x10b9[_0x328f00];return _0x5d863d;};'use strict';var Sequelize=require(_0x910b('0x0'));module[_0x910b('0x1')]={'name':{'type':Sequelize[_0x910b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x910b('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x910b('0x2')],'allowNull':![],'defaultValue':_0x910b('0x3')},'startAt':{'type':Sequelize[_0x910b('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x910b('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x910b('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x910b('0x6')](_0x910b('0x7'),_0x910b('0x8'),_0x910b('0x9'),_0x910b('0xa'),_0x910b('0xb'),'hours',_0x910b('0xc')),'allowNull':![],'defaultValue':_0x910b('0xb')},'output':{'type':Sequelize[_0x910b('0x6')](_0x910b('0xd'),'pdf',_0x910b('0xe')),'allowNull':![],'defaultValue':_0x910b('0xd')},'type':{'type':Sequelize[_0x910b('0x6')]('custom',_0x910b('0xf')),'allowNull':![],'defaultValue':_0x910b('0x10')},'sendMail':{'type':Sequelize[_0x910b('0x11')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x910b('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index ebb32d4..bd21946 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 _0x9971=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','userProfileId','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','json','apply','reject','update','then','destroy','get','UserProfileResource','end','name','send','index','map','Schedule','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields'];(function(_0x2abafc,_0x588cd7){var _0x1d35f2=function(_0xcb930a){while(--_0xcb930a){_0x2abafc['push'](_0x2abafc['shift']());}};_0x1d35f2(++_0x588cd7);}(_0x9971,0x1bb));var _0x1997=function(_0xbdadee,_0xb4f558){_0xbdadee=_0xbdadee-0x0;var _0xfe892d=_0x9971[_0xbdadee];return _0xfe892d;};'use strict';var emlformat=require(_0x1997('0x0'));var rimraf=require(_0x1997('0x1'));var zipdir=require(_0x1997('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1997('0x3'));var moment=require(_0x1997('0x4'));var BPromise=require(_0x1997('0x5'));var Mustache=require(_0x1997('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1997('0x7'));var csv=require(_0x1997('0x8'));var ejs=require(_0x1997('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1997('0xa'));var squel=require(_0x1997('0xb'));var crypto=require('crypto');var jsforce=require(_0x1997('0xc'));var deskjs=require(_0x1997('0xd'));var toCsv=require(_0x1997('0x8'));var querystring=require(_0x1997('0xe'));var Papa=require('papaparse');var Redis=require(_0x1997('0xf'));var authService=require(_0x1997('0x10'));var qs=require(_0x1997('0x11'));var as=require(_0x1997('0x12'));var hardwareService=require(_0x1997('0x13'));var logger=require(_0x1997('0x14'))(_0x1997('0x15'));var utils=require(_0x1997('0x16'));var config=require(_0x1997('0x17'));var licenseUtil=require(_0x1997('0x18'));var db=require(_0x1997('0x19'))['db'];function respondWithStatusCode(_0x42ce97,_0x4d046d){_0x4d046d=_0x4d046d||0xcc;return function(_0x52387f){if(_0x52387f){return _0x42ce97[_0x1997('0x1a')](_0x4d046d);}return _0x42ce97[_0x1997('0x1b')](_0x4d046d)['end']();};}function respondWithResult(_0xda90d0,_0x495c96){_0x495c96=_0x495c96||0xc8;return function(_0x1ba4c4){if(_0x1ba4c4){return _0xda90d0['status'](_0x495c96)['json'](_0x1ba4c4);}};}function respondWithFilteredResult(_0x47d9de,_0x3b786f){return function(_0xe3bbee){if(_0xe3bbee){var _0x408aad=typeof _0x3b786f[_0x1997('0x1c')]===_0x1997('0x1d')&&typeof _0x3b786f[_0x1997('0x1e')]===_0x1997('0x1d');var _0x1e43b9=_0xe3bbee['count'];var _0x3a1ff6=_0x408aad?0x0:_0x3b786f[_0x1997('0x1c')];var _0x2f7fff=_0x408aad?_0xe3bbee['count']:_0x3b786f[_0x1997('0x1c')]+_0x3b786f['limit'];var _0xb549de;if(_0x2f7fff>=_0x1e43b9){_0x2f7fff=_0x1e43b9;_0xb549de=0xc8;}else{_0xb549de=0xce;}_0x47d9de[_0x1997('0x1b')](_0xb549de);return _0x47d9de[_0x1997('0x1f')]('Content-Range',_0x3a1ff6+'-'+_0x2f7fff+'/'+_0x1e43b9)[_0x1997('0x20')](_0xe3bbee);}return null;};}function patchUpdates(_0x6f2aba){return function(_0x14cebd){try{jsonpatch[_0x1997('0x21')](_0x14cebd,_0x6f2aba,!![]);}catch(_0x144a69){return BPromise[_0x1997('0x22')](_0x144a69);}return _0x14cebd['save']();};}function saveUpdates(_0x313572,_0x13b1d1){return function(_0x4ed33f){if(_0x4ed33f){return _0x4ed33f[_0x1997('0x23')](_0x313572)[_0x1997('0x24')](function(_0x3643a3){return _0x3643a3;});}return null;};}function removeEntity(_0x16817a,_0x577e32){return function(_0x3d298b){if(_0x3d298b){return _0x3d298b[_0x1997('0x25')]()[_0x1997('0x24')](function(){var _0x5a39e3=_0x3d298b[_0x1997('0x26')]({'plain':!![]});var _0xe8598f='Scheduler';return db[_0x1997('0x27')]['destroy']({'where':{'type':_0xe8598f,'resourceId':_0x5a39e3['id']}})[_0x1997('0x24')](function(){return _0x3d298b;});})['then'](function(){_0x16817a[_0x1997('0x1b')](0xcc)[_0x1997('0x28')]();});}};}function handleEntityNotFound(_0x22e721,_0xf72923){return function(_0x34c5b9){if(!_0x34c5b9){_0x22e721['sendStatus'](0x194);}return _0x34c5b9;};}function handleError(_0x1090ac,_0x2e3a2a){_0x2e3a2a=_0x2e3a2a||0x1f4;return function(_0x2e808b){logger['error'](_0x2e808b['stack']);if(_0x2e808b['name']){delete _0x2e808b[_0x1997('0x29')];}_0x1090ac[_0x1997('0x1b')](_0x2e3a2a)[_0x1997('0x2a')](_0x2e808b);};}exports[_0x1997('0x2b')]=function(_0x3354e7,_0x171260){var _0x42f306={},_0x3045e2={},_0x778641={'count':0x0,'rows':[]};var _0x2fdcc5=_[_0x1997('0x2c')](db[_0x1997('0x2d')][_0x1997('0x2e')],function(_0x208f0e){return{'name':_0x208f0e[_0x1997('0x2f')],'type':_0x208f0e[_0x1997('0x30')]['key']};});_0x3045e2[_0x1997('0x31')]=_[_0x1997('0x2c')](_0x2fdcc5,_0x1997('0x29'));_0x3045e2[_0x1997('0x32')]=_[_0x1997('0x33')](_0x3354e7['query']);_0x3045e2[_0x1997('0x34')]=_[_0x1997('0x35')](_0x3045e2[_0x1997('0x31')],_0x3045e2[_0x1997('0x32')]);_0x42f306['attributes']=_[_0x1997('0x35')](_0x3045e2['model'],qs[_0x1997('0x36')](_0x3354e7[_0x1997('0x32')][_0x1997('0x36')]));_0x42f306[_0x1997('0x37')]=_0x42f306[_0x1997('0x37')][_0x1997('0x38')]?_0x42f306[_0x1997('0x37')]:_0x3045e2[_0x1997('0x31')];if(!_0x3354e7[_0x1997('0x32')][_0x1997('0x39')](_0x1997('0x3a'))){_0x42f306[_0x1997('0x1e')]=qs[_0x1997('0x1e')](_0x3354e7[_0x1997('0x32')][_0x1997('0x1e')]);_0x42f306['offset']=qs['offset'](_0x3354e7['query'][_0x1997('0x1c')]);}_0x42f306[_0x1997('0x3b')]=qs[_0x1997('0x3c')](_0x3354e7[_0x1997('0x32')]['sort']);_0x42f306[_0x1997('0x3d')]=qs[_0x1997('0x34')](_[_0x1997('0x3e')](_0x3354e7[_0x1997('0x32')],_0x3045e2[_0x1997('0x34')]),_0x2fdcc5);if(_0x3354e7[_0x1997('0x32')][_0x1997('0x3f')]){_0x42f306['where']=_[_0x1997('0x40')](_0x42f306[_0x1997('0x3d')],{'$or':_[_0x1997('0x2c')](_0x2fdcc5,function(_0x11abd1){if(_0x11abd1[_0x1997('0x30')]!==_0x1997('0x41')){var _0x4b7bf2={};_0x4b7bf2[_0x11abd1['name']]={'$like':'%'+_0x3354e7[_0x1997('0x32')][_0x1997('0x3f')]+'%'};return _0x4b7bf2;}})});}_0x42f306=_[_0x1997('0x40')]({},_0x42f306,_0x3354e7[_0x1997('0x42')]);var _0x53ab49={'where':_0x42f306[_0x1997('0x3d')]};return db[_0x1997('0x2d')][_0x1997('0x43')](_0x53ab49)[_0x1997('0x24')](function(_0x25fa86){_0x778641[_0x1997('0x43')]=_0x25fa86;if(_0x3354e7[_0x1997('0x32')]['includeAll']){_0x42f306[_0x1997('0x44')]=[{'all':!![]}];}return db[_0x1997('0x2d')][_0x1997('0x45')](_0x42f306);})[_0x1997('0x24')](function(_0x584054){_0x778641[_0x1997('0x46')]=_0x584054;return _0x778641;})[_0x1997('0x24')](respondWithFilteredResult(_0x171260,_0x42f306))[_0x1997('0x47')](handleError(_0x171260,null));};exports[_0x1997('0x48')]=function(_0x5f2f68,_0xa7b6b5){var _0x3cad94={'raw':![],'where':{'id':_0x5f2f68[_0x1997('0x49')]['id']}},_0x2d3f38={};_0x2d3f38[_0x1997('0x31')]=_[_0x1997('0x33')](db[_0x1997('0x2d')]['rawAttributes']);_0x2d3f38['query']=_[_0x1997('0x33')](_0x5f2f68[_0x1997('0x32')]);_0x2d3f38['filters']=_[_0x1997('0x35')](_0x2d3f38[_0x1997('0x31')],_0x2d3f38[_0x1997('0x32')]);_0x3cad94[_0x1997('0x37')]=_[_0x1997('0x35')](_0x2d3f38['model'],qs[_0x1997('0x36')](_0x5f2f68[_0x1997('0x32')]['fields']));_0x3cad94['attributes']=_0x3cad94[_0x1997('0x37')]['length']?_0x3cad94['attributes']:_0x2d3f38[_0x1997('0x31')];if(_0x5f2f68[_0x1997('0x32')]['includeAll']){_0x3cad94[_0x1997('0x44')]=[{'all':!![]}];}_0x3cad94=_[_0x1997('0x40')]({},_0x3cad94,_0x5f2f68[_0x1997('0x42')]);return db['Schedule'][_0x1997('0x4a')](_0x3cad94)[_0x1997('0x24')](handleEntityNotFound(_0xa7b6b5,null))['then'](respondWithResult(_0xa7b6b5,null))[_0x1997('0x47')](handleError(_0xa7b6b5,null));};exports['create']=function(_0x323528,_0x382875){return db[_0x1997('0x2d')][_0x1997('0x4b')](_0x323528[_0x1997('0x4c')],{})[_0x1997('0x24')](function(_0x36323d){var _0x512edf=_0x323528['user']['get']({'plain':!![]});if(!_0x512edf)throw new Error(_0x1997('0x4d'));if(_0x512edf[_0x1997('0x4e')]===_0x1997('0x4f')){var _0x4c0682=_0x36323d['get']({'plain':!![]});var _0x35bcca=_0x1997('0x50');return db['UserProfileSection'][_0x1997('0x4a')]({'where':{'name':_0x35bcca,'userProfileId':_0x512edf[_0x1997('0x51')]},'raw':!![]})['then'](function(_0x31645f){if(_0x31645f&&_0x31645f['autoAssociation']===0x0){return db[_0x1997('0x27')][_0x1997('0x4b')]({'name':_0x4c0682[_0x1997('0x29')],'resourceId':_0x4c0682['id'],'type':_0x31645f['name'],'sectionId':_0x31645f['id']},{})[_0x1997('0x24')](function(){return _0x36323d;});}else{return _0x36323d;}})[_0x1997('0x47')](function(_0x2e90da){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e90da);throw _0x2e90da;});}return _0x36323d;})[_0x1997('0x24')](respondWithResult(_0x382875,0xc9))[_0x1997('0x47')](handleError(_0x382875,null));};exports[_0x1997('0x23')]=function(_0x4ff88f,_0x109f0c){if(_0x4ff88f[_0x1997('0x4c')]['id']){delete _0x4ff88f[_0x1997('0x4c')]['id'];}return db[_0x1997('0x2d')][_0x1997('0x4a')]({'where':{'id':_0x4ff88f[_0x1997('0x49')]['id']}})[_0x1997('0x24')](handleEntityNotFound(_0x109f0c,null))[_0x1997('0x24')](saveUpdates(_0x4ff88f['body'],null))[_0x1997('0x24')](respondWithResult(_0x109f0c,null))[_0x1997('0x47')](handleError(_0x109f0c,null));};exports[_0x1997('0x25')]=function(_0x6fe1be,_0x16d4de){return db[_0x1997('0x2d')]['find']({'where':{'id':_0x6fe1be[_0x1997('0x49')]['id']}})[_0x1997('0x24')](handleEntityNotFound(_0x16d4de,null))[_0x1997('0x24')](removeEntity(_0x16d4de,null))[_0x1997('0x47')](handleError(_0x16d4de,null));};exports['run']=function(_0x8768f4,_0x4e62c8,_0x1f3043){var _0x49a0e=require(_0x1997('0x52'));return db['Schedule'][_0x1997('0x4a')]({'where':{'id':_0x8768f4['params']['id']},'raw':!![]})[_0x1997('0x24')](handleEntityNotFound(_0x4e62c8,null))[_0x1997('0x24')](function(){_0x49a0e['run'](_0x8768f4[_0x1997('0x49')]['id']);})[_0x1997('0x24')](respondWithStatusCode(_0x4e62c8,null))[_0x1997('0x47')](handleError(_0x4e62c8,null));}; \ No newline at end of file +var _0x54db=['update','then','destroy','get','UserProfileResource','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Schedule','includeAll','include','rows','catch','show','params','keys','find','create','body','user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x1c2ee5,_0x4208b1){var _0x3211b9=function(_0x5db4e2){while(--_0x5db4e2){_0x1c2ee5['push'](_0x1c2ee5['shift']());}};_0x3211b9(++_0x4208b1);}(_0x54db,0x18a));var _0xb54d=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x54db[_0x424a9a];return _0xa7831c;};'use strict';var emlformat=require(_0xb54d('0x0'));var rimraf=require(_0xb54d('0x1'));var zipdir=require(_0xb54d('0x2'));var jsonpatch=require(_0xb54d('0x3'));var rp=require(_0xb54d('0x4'));var moment=require(_0xb54d('0x5'));var BPromise=require(_0xb54d('0x6'));var Mustache=require('mustache');var util=require(_0xb54d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb54d('0x8'));var ejs=require(_0xb54d('0x9'));var fs=require('fs');var fs_extra=require(_0xb54d('0xa'));var _=require(_0xb54d('0xb'));var squel=require(_0xb54d('0xc'));var crypto=require(_0xb54d('0xd'));var jsforce=require(_0xb54d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb54d('0x8'));var querystring=require(_0xb54d('0xf'));var Papa=require(_0xb54d('0x10'));var Redis=require(_0xb54d('0x11'));var authService=require(_0xb54d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb54d('0x13'));var hardwareService=require(_0xb54d('0x14'));var logger=require(_0xb54d('0x15'))('api');var utils=require(_0xb54d('0x16'));var config=require(_0xb54d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3038ea,_0xcb487b){_0xcb487b=_0xcb487b||0xcc;return function(_0x31fa25){if(_0x31fa25){return _0x3038ea[_0xb54d('0x18')](_0xcb487b);}return _0x3038ea[_0xb54d('0x19')](_0xcb487b)[_0xb54d('0x1a')]();};}function respondWithResult(_0x441a34,_0x2cfbb0){_0x2cfbb0=_0x2cfbb0||0xc8;return function(_0x16179e){if(_0x16179e){return _0x441a34[_0xb54d('0x19')](_0x2cfbb0)[_0xb54d('0x1b')](_0x16179e);}};}function respondWithFilteredResult(_0x66d712,_0x31199a){return function(_0x1970f2){if(_0x1970f2){var _0x218fcd=typeof _0x31199a['offset']===_0xb54d('0x1c')&&typeof _0x31199a[_0xb54d('0x1d')]===_0xb54d('0x1c');var _0x17a0dd=_0x1970f2[_0xb54d('0x1e')];var _0x2a3011=_0x218fcd?0x0:_0x31199a[_0xb54d('0x1f')];var _0xf2a6ba=_0x218fcd?_0x1970f2[_0xb54d('0x1e')]:_0x31199a['offset']+_0x31199a['limit'];var _0xfe6098;if(_0xf2a6ba>=_0x17a0dd){_0xf2a6ba=_0x17a0dd;_0xfe6098=0xc8;}else{_0xfe6098=0xce;}_0x66d712[_0xb54d('0x19')](_0xfe6098);return _0x66d712[_0xb54d('0x20')](_0xb54d('0x21'),_0x2a3011+'-'+_0xf2a6ba+'/'+_0x17a0dd)[_0xb54d('0x1b')](_0x1970f2);}return null;};}function patchUpdates(_0x4e4c14){return function(_0x448818){try{jsonpatch[_0xb54d('0x22')](_0x448818,_0x4e4c14,!![]);}catch(_0x5d92dd){return BPromise[_0xb54d('0x23')](_0x5d92dd);}return _0x448818['save']();};}function saveUpdates(_0x1436ba,_0x2597b9){return function(_0x547590){if(_0x547590){return _0x547590[_0xb54d('0x24')](_0x1436ba)[_0xb54d('0x25')](function(_0x4a2fa2){return _0x4a2fa2;});}return null;};}function removeEntity(_0x20f63f,_0x28e9bd){return function(_0x238405){if(_0x238405){return _0x238405[_0xb54d('0x26')]()[_0xb54d('0x25')](function(){var _0xec6729=_0x238405[_0xb54d('0x27')]({'plain':!![]});var _0x548bc9='Scheduler';return db[_0xb54d('0x28')]['destroy']({'where':{'type':_0x548bc9,'resourceId':_0xec6729['id']}})['then'](function(){return _0x238405;});})[_0xb54d('0x25')](function(){_0x20f63f[_0xb54d('0x19')](0xcc)[_0xb54d('0x1a')]();});}};}function handleEntityNotFound(_0x10fbad,_0x5c3c34){return function(_0xe150e6){if(!_0xe150e6){_0x10fbad[_0xb54d('0x18')](0x194);}return _0xe150e6;};}function handleError(_0x263016,_0x1f370f){_0x1f370f=_0x1f370f||0x1f4;return function(_0x1264f1){logger['error'](_0x1264f1['stack']);if(_0x1264f1[_0xb54d('0x29')]){delete _0x1264f1[_0xb54d('0x29')];}_0x263016['status'](_0x1f370f)[_0xb54d('0x2a')](_0x1264f1);};}exports['index']=function(_0x2ee4d3,_0x56ecee){var _0x358207={},_0x1154e0={},_0x6ba34={'count':0x0,'rows':[]};var _0x5f533e=_[_0xb54d('0x2b')](db['Schedule'][_0xb54d('0x2c')],function(_0x29eb7a){return{'name':_0x29eb7a[_0xb54d('0x2d')],'type':_0x29eb7a[_0xb54d('0x2e')][_0xb54d('0x2f')]};});_0x1154e0[_0xb54d('0x30')]=_[_0xb54d('0x2b')](_0x5f533e,_0xb54d('0x29'));_0x1154e0[_0xb54d('0x31')]=_['keys'](_0x2ee4d3[_0xb54d('0x31')]);_0x1154e0[_0xb54d('0x32')]=_[_0xb54d('0x33')](_0x1154e0[_0xb54d('0x30')],_0x1154e0[_0xb54d('0x31')]);_0x358207[_0xb54d('0x34')]=_[_0xb54d('0x33')](_0x1154e0[_0xb54d('0x30')],qs['fields'](_0x2ee4d3['query'][_0xb54d('0x35')]));_0x358207[_0xb54d('0x34')]=_0x358207[_0xb54d('0x34')][_0xb54d('0x36')]?_0x358207[_0xb54d('0x34')]:_0x1154e0[_0xb54d('0x30')];if(!_0x2ee4d3['query'][_0xb54d('0x37')](_0xb54d('0x38'))){_0x358207['limit']=qs[_0xb54d('0x1d')](_0x2ee4d3[_0xb54d('0x31')][_0xb54d('0x1d')]);_0x358207[_0xb54d('0x1f')]=qs[_0xb54d('0x1f')](_0x2ee4d3[_0xb54d('0x31')][_0xb54d('0x1f')]);}_0x358207[_0xb54d('0x39')]=qs[_0xb54d('0x3a')](_0x2ee4d3[_0xb54d('0x31')]['sort']);_0x358207[_0xb54d('0x3b')]=qs[_0xb54d('0x32')](_[_0xb54d('0x3c')](_0x2ee4d3[_0xb54d('0x31')],_0x1154e0['filters']),_0x5f533e);if(_0x2ee4d3[_0xb54d('0x31')][_0xb54d('0x3d')]){_0x358207[_0xb54d('0x3b')]=_[_0xb54d('0x3e')](_0x358207[_0xb54d('0x3b')],{'$or':_[_0xb54d('0x2b')](_0x5f533e,function(_0x16fc43){if(_0x16fc43[_0xb54d('0x2e')]!==_0xb54d('0x3f')){var _0x1e5ce5={};_0x1e5ce5[_0x16fc43[_0xb54d('0x29')]]={'$like':'%'+_0x2ee4d3[_0xb54d('0x31')][_0xb54d('0x3d')]+'%'};return _0x1e5ce5;}})});}_0x358207=_[_0xb54d('0x3e')]({},_0x358207,_0x2ee4d3[_0xb54d('0x40')]);var _0x4f48cd={'where':_0x358207[_0xb54d('0x3b')]};return db[_0xb54d('0x41')]['count'](_0x4f48cd)[_0xb54d('0x25')](function(_0x33bf3c){_0x6ba34[_0xb54d('0x1e')]=_0x33bf3c;if(_0x2ee4d3[_0xb54d('0x31')][_0xb54d('0x42')]){_0x358207[_0xb54d('0x43')]=[{'all':!![]}];}return db[_0xb54d('0x41')]['findAll'](_0x358207);})['then'](function(_0x4cd1b6){_0x6ba34[_0xb54d('0x44')]=_0x4cd1b6;return _0x6ba34;})[_0xb54d('0x25')](respondWithFilteredResult(_0x56ecee,_0x358207))[_0xb54d('0x45')](handleError(_0x56ecee,null));};exports[_0xb54d('0x46')]=function(_0x126105,_0x259455){var _0x117bcd={'raw':![],'where':{'id':_0x126105[_0xb54d('0x47')]['id']}},_0x56c40b={};_0x56c40b[_0xb54d('0x30')]=_[_0xb54d('0x48')](db['Schedule']['rawAttributes']);_0x56c40b[_0xb54d('0x31')]=_[_0xb54d('0x48')](_0x126105[_0xb54d('0x31')]);_0x56c40b[_0xb54d('0x32')]=_[_0xb54d('0x33')](_0x56c40b[_0xb54d('0x30')],_0x56c40b[_0xb54d('0x31')]);_0x117bcd[_0xb54d('0x34')]=_[_0xb54d('0x33')](_0x56c40b[_0xb54d('0x30')],qs[_0xb54d('0x35')](_0x126105[_0xb54d('0x31')]['fields']));_0x117bcd[_0xb54d('0x34')]=_0x117bcd['attributes'][_0xb54d('0x36')]?_0x117bcd[_0xb54d('0x34')]:_0x56c40b[_0xb54d('0x30')];if(_0x126105[_0xb54d('0x31')][_0xb54d('0x42')]){_0x117bcd[_0xb54d('0x43')]=[{'all':!![]}];}_0x117bcd=_[_0xb54d('0x3e')]({},_0x117bcd,_0x126105['options']);return db[_0xb54d('0x41')][_0xb54d('0x49')](_0x117bcd)[_0xb54d('0x25')](handleEntityNotFound(_0x259455,null))['then'](respondWithResult(_0x259455,null))[_0xb54d('0x45')](handleError(_0x259455,null));};exports[_0xb54d('0x4a')]=function(_0x383a3b,_0x2aae95){return db[_0xb54d('0x41')][_0xb54d('0x4a')](_0x383a3b[_0xb54d('0x4b')],{})[_0xb54d('0x25')](function(_0x24414a){var _0x816270=_0x383a3b[_0xb54d('0x4c')]['get']({'plain':!![]});if(!_0x816270)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x816270[_0xb54d('0x4d')]===_0xb54d('0x4c')){var _0x3d0e79=_0x24414a[_0xb54d('0x27')]({'plain':!![]});var _0x50bd3f=_0xb54d('0x4e');return db[_0xb54d('0x4f')]['find']({'where':{'name':_0x50bd3f,'userProfileId':_0x816270[_0xb54d('0x50')]},'raw':!![]})[_0xb54d('0x25')](function(_0x457fa3){if(_0x457fa3&&_0x457fa3[_0xb54d('0x51')]===0x0){return db[_0xb54d('0x28')][_0xb54d('0x4a')]({'name':_0x3d0e79[_0xb54d('0x29')],'resourceId':_0x3d0e79['id'],'type':_0x457fa3[_0xb54d('0x29')],'sectionId':_0x457fa3['id']},{})[_0xb54d('0x25')](function(){return _0x24414a;});}else{return _0x24414a;}})[_0xb54d('0x45')](function(_0x188524){logger[_0xb54d('0x52')](_0xb54d('0x53'),_0x188524);throw _0x188524;});}return _0x24414a;})[_0xb54d('0x25')](respondWithResult(_0x2aae95,0xc9))[_0xb54d('0x45')](handleError(_0x2aae95,null));};exports[_0xb54d('0x24')]=function(_0x34552e,_0x64338b){if(_0x34552e['body']['id']){delete _0x34552e[_0xb54d('0x4b')]['id'];}return db['Schedule'][_0xb54d('0x49')]({'where':{'id':_0x34552e[_0xb54d('0x47')]['id']}})[_0xb54d('0x25')](handleEntityNotFound(_0x64338b,null))[_0xb54d('0x25')](saveUpdates(_0x34552e['body'],null))[_0xb54d('0x25')](respondWithResult(_0x64338b,null))['catch'](handleError(_0x64338b,null));};exports['destroy']=function(_0x27cf8d,_0x207bc5){return db[_0xb54d('0x41')][_0xb54d('0x49')]({'where':{'id':_0x27cf8d[_0xb54d('0x47')]['id']}})['then'](handleEntityNotFound(_0x207bc5,null))[_0xb54d('0x25')](removeEntity(_0x207bc5,null))[_0xb54d('0x45')](handleError(_0x207bc5,null));};exports[_0xb54d('0x54')]=function(_0xeb3eee,_0x42f429,_0x1dd3af){var _0x191179=require(_0xb54d('0x55'));return db['Schedule'][_0xb54d('0x49')]({'where':{'id':_0xeb3eee['params']['id']},'raw':!![]})[_0xb54d('0x25')](handleEntityNotFound(_0x42f429,null))[_0xb54d('0x25')](function(){_0x191179[_0xb54d('0x54')](_0xeb3eee['params']['id']);})[_0xb54d('0x25')](respondWithStatusCode(_0x42f429,null))[_0xb54d('0x45')](handleError(_0x42f429,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 3781979..2ce3cfb 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 _0xb2ea=['path','rimraf','../../config/environment','exports','Schedule','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x480e40,_0x9a6aa){var _0x4c81a=function(_0x45beb8){while(--_0x45beb8){_0x480e40['push'](_0x480e40['shift']());}};_0x4c81a(++_0x9a6aa);}(_0xb2ea,0x179));var _0xab2e=function(_0x152a8d,_0x5c9019){_0x152a8d=_0x152a8d-0x0;var _0x144e3d=_0xb2ea[_0x152a8d];return _0x144e3d;};'use strict';var _=require(_0xab2e('0x0'));var util=require(_0xab2e('0x1'));var logger=require(_0xab2e('0x2'))(_0xab2e('0x3'));var moment=require(_0xab2e('0x4'));var BPromise=require(_0xab2e('0x5'));var rp=require(_0xab2e('0x6'));var fs=require('fs');var path=require(_0xab2e('0x7'));var rimraf=require(_0xab2e('0x8'));var config=require(_0xab2e('0x9'));var attributes=require('./schedule.attributes');module[_0xab2e('0xa')]=function(_0x2fa91f,_0xbf05a7){return _0x2fa91f['define'](_0xab2e('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8456=['request-promise','path','exports','define','Schedule','tools_schedules','util','../../config/logger','api'];(function(_0x4973b7,_0x463138){var _0x40fb49=function(_0x1b9c32){while(--_0x1b9c32){_0x4973b7['push'](_0x4973b7['shift']());}};_0x40fb49(++_0x463138);}(_0x8456,0x126));var _0x6845=function(_0x47e5ce,_0x1d87f0){_0x47e5ce=_0x47e5ce-0x0;var _0xa78774=_0x8456[_0x47e5ce];return _0xa78774;};'use strict';var _=require('lodash');var util=require(_0x6845('0x0'));var logger=require(_0x6845('0x1'))(_0x6845('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6845('0x3'));var fs=require('fs');var path=require(_0x6845('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x6845('0x5')]=function(_0x543f8e,_0x5a7928){return _0x543f8e[_0x6845('0x6')](_0x6845('0x7'),attributes,{'tableName':_0x6845('0x8'),'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 83bda16..f746444 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 _0x134b=['rpc','jayson/promise','client','http','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x54eae7,_0x2472ff){var _0x203420=function(_0x5d26d2){while(--_0x5d26d2){_0x54eae7['push'](_0x54eae7['shift']());}};_0x203420(++_0x2472ff);}(_0x134b,0xae));var _0xb134=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x134b[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xb134('0x0'));var util=require(_0xb134('0x1'));var moment=require(_0xb134('0x2'));var BPromise=require(_0xb134('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb134('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb134('0x5'))(_0xb134('0x6'));var config=require('../../config/environment');var jayson=require(_0xb134('0x7'));var client=jayson[_0xb134('0x8')][_0xb134('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e18b9,_0x1f17ed,_0x186cd5){return new BPromise(function(_0x409ee3,_0x243463){return client['request'](_0x5e18b9,_0x186cd5)['then'](function(_0xc5dfbf){logger[_0xb134('0xa')](_0xb134('0xb'),_0x1f17ed,_0xb134('0xc'));logger[_0xb134('0xd')](_0xb134('0xe'),_0x1f17ed,_0xb134('0xc'),JSON['stringify'](_0xc5dfbf));if(_0xc5dfbf[_0xb134('0xf')]){if(_0xc5dfbf[_0xb134('0xf')][_0xb134('0x10')]===0x1f4){logger[_0xb134('0xf')](_0xb134('0xb'),_0x1f17ed,_0xc5dfbf[_0xb134('0xf')][_0xb134('0x11')]);return _0x243463(_0xc5dfbf[_0xb134('0xf')]['message']);}logger[_0xb134('0xf')](_0xb134('0xb'),_0x1f17ed,_0xc5dfbf[_0xb134('0xf')][_0xb134('0x11')]);return _0x409ee3(_0xc5dfbf[_0xb134('0xf')]['message']);}else{logger[_0xb134('0xa')](_0xb134('0xb'),_0x1f17ed,_0xb134('0xc'));_0x409ee3(_0xc5dfbf[_0xb134('0x12')][_0xb134('0x11')]);}})[_0xb134('0x13')](function(_0x1f58f2){logger[_0xb134('0xf')](_0xb134('0xb'),_0x1f17ed,_0x1f58f2);_0x243463(_0x1f58f2);});});} \ No newline at end of file +var _0x279b=['client','http','then','info','debug','request\x20sent','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x279b,0xe5));var _0xb279=function(_0x3187a7,_0x4c7bf5){_0x3187a7=_0x3187a7-0x0;var _0x30ce86=_0x279b[_0x3187a7];return _0x30ce86;};'use strict';var _=require(_0xb279('0x0'));var util=require(_0xb279('0x1'));var moment=require(_0xb279('0x2'));var BPromise=require(_0xb279('0x3'));var rs=require(_0xb279('0x4'));var fs=require('fs');var Redis=require(_0xb279('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb279('0x6'));var logger=require(_0xb279('0x7'))(_0xb279('0x8'));var config=require(_0xb279('0x9'));var jayson=require(_0xb279('0xa'));var client=jayson[_0xb279('0xb')][_0xb279('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15737b,_0x3a7b12,_0x35feb4){return new BPromise(function(_0x20d4e9,_0x266b24){return client['request'](_0x15737b,_0x35feb4)[_0xb279('0xd')](function(_0x5c6b2a){logger[_0xb279('0xe')]('Schedule,\x20%s,\x20%s',_0x3a7b12,'request\x20sent');logger[_0xb279('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x3a7b12,_0xb279('0x10'),JSON[_0xb279('0x11')](_0x5c6b2a));if(_0x5c6b2a[_0xb279('0x12')]){if(_0x5c6b2a['error'][_0xb279('0x13')]===0x1f4){logger['error'](_0xb279('0x14'),_0x3a7b12,_0x5c6b2a[_0xb279('0x12')]['message']);return _0x266b24(_0x5c6b2a[_0xb279('0x12')][_0xb279('0x15')]);}logger[_0xb279('0x12')]('Schedule,\x20%s,\x20%s',_0x3a7b12,_0x5c6b2a[_0xb279('0x12')][_0xb279('0x15')]);return _0x20d4e9(_0x5c6b2a[_0xb279('0x12')][_0xb279('0x15')]);}else{logger['info'](_0xb279('0x14'),_0x3a7b12,'request\x20sent');_0x20d4e9(_0x5c6b2a[_0xb279('0x16')][_0xb279('0x15')]);}})[_0xb279('0x17')](function(_0x3ce438){logger[_0xb279('0x12')]('Schedule,\x20%s,\x20%s',_0x3a7b12,_0x3ce438);_0x266b24(_0x3ce438);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 72131d1..f3b37c2 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 _0xe896=['get','/:id','put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x2382b5,_0x447dcf){var _0x4d5019=function(_0x4fd421){while(--_0x4fd421){_0x2382b5['push'](_0x2382b5['shift']());}};_0x4d5019(++_0x447dcf);}(_0xe896,0x15f));var _0x6e89=function(_0xc28010,_0x3c9617){_0xc28010=_0xc28010-0x0;var _0x3e6332=_0xe896[_0xc28010];return _0x3e6332;};'use strict';var multer=require(_0x6e89('0x0'));var util=require(_0x6e89('0x1'));var path=require(_0x6e89('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e89('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6e89('0x4'));var interaction=require(_0x6e89('0x5'));var config=require(_0x6e89('0x6'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0x6e89('0x7')](),controller['index']);router['get']('/describe',auth[_0x6e89('0x7')](),controller[_0x6e89('0x8')]);router[_0x6e89('0x9')](_0x6e89('0xa'),auth[_0x6e89('0x7')](),controller['show']);router['get']('/:id/download',auth[_0x6e89('0x7')](),controller['download']);router['post']('/',auth[_0x6e89('0x7')](),controller['create']);router[_0x6e89('0xb')](_0x6e89('0xa'),auth[_0x6e89('0x7')](),controller[_0x6e89('0xc')]);router[_0x6e89('0xd')](_0x6e89('0xa'),auth[_0x6e89('0x7')](),controller['destroy']);module[_0x6e89('0xe')]=router; \ No newline at end of file +var _0x6a38=['download','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/download'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x6a38,0x1eb));var _0x86a3=function(_0x13f72c,_0x27ea71){_0x13f72c=_0x13f72c-0x0;var _0x5900be=_0x6a38[_0x13f72c];return _0x5900be;};'use strict';var multer=require(_0x86a3('0x0'));var util=require(_0x86a3('0x1'));var path=require('path');var timeout=require(_0x86a3('0x2'));var express=require(_0x86a3('0x3'));var router=express['Router']();var fs_extra=require(_0x86a3('0x4'));var auth=require(_0x86a3('0x5'));var interaction=require(_0x86a3('0x6'));var config=require('../../config/environment');var controller=require(_0x86a3('0x7'));router['get']('/',auth[_0x86a3('0x8')](),controller['index']);router[_0x86a3('0x9')](_0x86a3('0xa'),auth[_0x86a3('0x8')](),controller[_0x86a3('0xb')]);router[_0x86a3('0x9')](_0x86a3('0xc'),auth['isAuthenticated'](),controller[_0x86a3('0xd')]);router['get'](_0x86a3('0xe'),auth[_0x86a3('0x8')](),controller[_0x86a3('0xf')]);router[_0x86a3('0x10')]('/',auth['isAuthenticated'](),controller[_0x86a3('0x11')]);router[_0x86a3('0x12')](_0x86a3('0xc'),auth['isAuthenticated'](),controller[_0x86a3('0x13')]);router[_0x86a3('0x14')](_0x86a3('0xc'),auth['isAuthenticated'](),controller[_0x86a3('0x15')]);module[_0x86a3('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index b28c341..232cb10 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 _0xf108=['INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment','exports','extname','getDataValue','value','STRING','replace','setDataValue'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xf108,0x1d9));var _0x8f10=function(_0x28cd35,_0x21fe5a){_0x28cd35=_0x28cd35-0x0;var _0x496f10=_0xf108[_0x28cd35];return _0x496f10;};'use strict';var Sequelize=require(_0x8f10('0x0'));var moment=require('moment');var path=require(_0x8f10('0x1'));var config=require(_0x8f10('0x2'));module[_0x8f10('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('value')?path[_0x8f10('0x4')](this[_0x8f10('0x5')](_0x8f10('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x8f10('0x7')]},'channel':{'type':Sequelize[_0x8f10('0x7')]},'value':{'type':Sequelize[_0x8f10('0x7')],'set':function(_0x212efc){var _0x38b45f=_0x212efc[_0x8f10('0x8')](/\\/g,'/');this[_0x8f10('0x9')](_0x8f10('0x6'),_0x38b45f);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8f10('0xa')],'set':function(_0x1787d2){this[_0x8f10('0x9')](_0x8f10('0xb'),moment()[_0x8f10('0xc')](_0x1787d2,'ms'));this[_0x8f10('0x9')](_0x8f10('0xd'),moment());this[_0x8f10('0x9')](_0x8f10('0xe'),_0x1787d2);}},'startedAt':{'type':Sequelize[_0x8f10('0xf')],'get':function(){return moment(this[_0x8f10('0x5')](_0x8f10('0xb')))[_0x8f10('0x10')](_0x8f10('0x11'))[_0x8f10('0x12')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x8f10('0xd')))[_0x8f10('0x10')](_0x8f10('0x11'))[_0x8f10('0x12')]();}},'createdAt':{'type':Sequelize[_0x8f10('0xf')],'get':function(){return moment(this[_0x8f10('0x5')](_0x8f10('0x13')))[_0x8f10('0x10')](_0x8f10('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x8f10('0xf')],'get':function(){return moment(this[_0x8f10('0x5')](_0x8f10('0x14')))['format'](_0x8f10('0x11'))[_0x8f10('0x12')]();}}}; \ No newline at end of file +var _0xa1c5=['DATE','format','MM-DD-YYYY\x20HH:mm','createdAt','toString','updatedAt','sequelize','moment','path','VIRTUAL','getDataValue','value','STRING','replace','INTEGER','setDataValue','subtract','closedAt'];(function(_0xce5c3c,_0x317488){var _0x3a1ae8=function(_0x2b323e){while(--_0x2b323e){_0xce5c3c['push'](_0xce5c3c['shift']());}};_0x3a1ae8(++_0x317488);}(_0xa1c5,0x96));var _0x5a1c=function(_0x775773,_0x588708){_0x775773=_0x775773-0x0;var _0x4149a7=_0xa1c5[_0x775773];return _0x4149a7;};'use strict';var Sequelize=require(_0x5a1c('0x0'));var moment=require(_0x5a1c('0x1'));var path=require(_0x5a1c('0x2'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x5a1c('0x3')],'get':function(){return this[_0x5a1c('0x4')](_0x5a1c('0x5'))?path['extname'](this[_0x5a1c('0x4')](_0x5a1c('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x5a1c('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x5a1c('0x6')],'set':function(_0x471644){var _0x5a77f6=_0x471644[_0x5a1c('0x7')](/\\/g,'/');this['setDataValue'](_0x5a1c('0x5'),_0x5a77f6);}},'rating':{'type':Sequelize[_0x5a1c('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x5a1c('0x8')],'set':function(_0x2214b7){this[_0x5a1c('0x9')]('startedAt',moment()[_0x5a1c('0xa')](_0x2214b7,'ms'));this['setDataValue'](_0x5a1c('0xb'),moment());this[_0x5a1c('0x9')]('duration',_0x2214b7);}},'startedAt':{'type':Sequelize[_0x5a1c('0xc')],'get':function(){return moment(this[_0x5a1c('0x4')]('startedAt'))[_0x5a1c('0xd')](_0x5a1c('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0x5a1c('0xc')],'get':function(){return moment(this[_0x5a1c('0x4')]('closedAt'))['format'](_0x5a1c('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0x5a1c('0xc')],'get':function(){return moment(this[_0x5a1c('0x4')](_0x5a1c('0xf')))['format']('MM-DD-YYYY\x20HH:mm')[_0x5a1c('0x10')]();}},'updatedAt':{'type':Sequelize[_0x5a1c('0xc')],'get':function(){return moment(this[_0x5a1c('0x4')](_0x5a1c('0x11')))[_0x5a1c('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x5a1c('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index f6a67c8..7008073 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 _0x5fc3=['status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','existsSync','decryptFile','secrets','join','Sequelize','ValidationError','filename','unlink','message','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x12be01,_0x4f9734){var _0x44ea2e=function(_0x12894a){while(--_0x12894a){_0x12be01['push'](_0x12be01['shift']());}};_0x44ea2e(++_0x4f9734);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x5fc3[_0x5f1391];return _0x50ebe3;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}exports['index']=function(_0x26b7cb,_0x645eac){var _0x383837={},_0x9f3c8a={},_0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x28')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x2b')]['key']};});_0x9f3c8a[_0x35fc('0x2c')]=_[_0x35fc('0x2d')](_[_0x35fc('0x28')](_0x134dfa,_0x35fc('0x26')),[_0x35fc('0x2e')]);_0x9f3c8a[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x26b7cb[_0x35fc('0x2f')]);_0x9f3c8a[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x9f3c8a['model'],_0x9f3c8a['query']);_0x383837[_0x35fc('0x33')]=_['intersection'](_0x9f3c8a[_0x35fc('0x2c')],qs[_0x35fc('0x34')](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x34')]));_0x383837[_0x35fc('0x33')]=_0x383837[_0x35fc('0x33')]['length']?_0x383837[_0x35fc('0x33')]:_0x9f3c8a[_0x35fc('0x2c')];if(!_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x35')](_0x35fc('0x36'))){_0x383837[_0x35fc('0x1c')]=qs['limit'](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x1c')]);_0x383837[_0x35fc('0x1a')]=qs['offset'](_0x26b7cb[_0x35fc('0x2f')]['offset']);}_0x383837[_0x35fc('0x37')]=qs[_0x35fc('0x38')](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x38')]);_0x383837['where']=qs['filters'](_['pick'](_0x26b7cb[_0x35fc('0x2f')],_0x9f3c8a['filters']),_0x134dfa);if(_0x26b7cb[_0x35fc('0x2f')]['filter']){_0x383837[_0x35fc('0x39')]=_[_0x35fc('0x3a')](_0x383837[_0x35fc('0x39')],{'$or':_[_0x35fc('0x28')](_0x134dfa,function(_0x1c10e0){if(_0x1c10e0[_0x35fc('0x2b')]!==_0x35fc('0x3b')){var _0x4ec0dc={};_0x4ec0dc[_0x1c10e0[_0x35fc('0x26')]]={'$like':'%'+_0x26b7cb[_0x35fc('0x2f')]['filter']+'%'};return _0x4ec0dc;}})});}_0x383837=_[_0x35fc('0x3a')]({},_0x383837,_0x26b7cb[_0x35fc('0x3c')]);var _0x1aac67={'where':_0x383837[_0x35fc('0x39')]};return db[_0x35fc('0x29')][_0x35fc('0x1d')](_0x1aac67)['then'](function(_0x3f6480){_0x3735da[_0x35fc('0x1d')]=_0x3f6480;if(_0x26b7cb[_0x35fc('0x2f')]['includeAll']){_0x383837[_0x35fc('0x3d')]=[{'all':!![]}];}return db[_0x35fc('0x29')]['findAll'](_0x383837);})[_0x35fc('0x24')](function(_0x280af1){_0x3735da[_0x35fc('0x3e')]=_0x280af1;return _0x3735da;})[_0x35fc('0x24')](respondWithFilteredResult(_0x645eac,_0x383837))[_0x35fc('0x3f')](handleError(_0x645eac,null));};exports[_0x35fc('0x40')]=function(_0x211b70,_0x3ec51f){var _0x5a7e9e={'raw':![],'where':{'id':_0x211b70[_0x35fc('0x41')]['id']}},_0x596e83={};_0x596e83[_0x35fc('0x2c')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x596e83[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x211b70['query']);_0x596e83[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x596e83[_0x35fc('0x2c')],_0x596e83[_0x35fc('0x2f')]);_0x5a7e9e['attributes']=_['intersection'](_0x596e83['model'],qs['fields'](_0x211b70['query'][_0x35fc('0x34')]));_0x5a7e9e[_0x35fc('0x33')]=_0x5a7e9e['attributes'][_0x35fc('0x42')]?_0x5a7e9e['attributes']:_0x596e83[_0x35fc('0x2c')];if(_0x211b70[_0x35fc('0x2f')][_0x35fc('0x43')]){_0x5a7e9e[_0x35fc('0x3d')]=[{'all':!![]}];}_0x5a7e9e=_[_0x35fc('0x3a')]({},_0x5a7e9e,_0x211b70['options']);return db[_0x35fc('0x29')][_0x35fc('0x44')](_0x5a7e9e)['then'](handleEntityNotFound(_0x3ec51f,null))[_0x35fc('0x24')](respondWithResult(_0x3ec51f,null))[_0x35fc('0x3f')](handleError(_0x3ec51f,null));};exports[_0x35fc('0x45')]=function(_0x211746,_0x5bc8c3){return db[_0x35fc('0x29')]['create'](_0x211746['body'],{})[_0x35fc('0x24')](respondWithResult(_0x5bc8c3,0xc9))[_0x35fc('0x3f')](handleError(_0x5bc8c3,null));};exports[_0x35fc('0x23')]=function(_0xca8aef,_0xf2ca20){if(_0xca8aef[_0x35fc('0x46')]['id']){delete _0xca8aef[_0x35fc('0x46')]['id'];}delete _0xca8aef[_0x35fc('0x46')]['duration'];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x47')];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x48')];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x49')];return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':{'id':_0xca8aef[_0x35fc('0x41')]['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0xf2ca20,null))[_0x35fc('0x24')](saveUpdates(_0xca8aef[_0x35fc('0x46')],null))[_0x35fc('0x24')](respondWithResult(_0xf2ca20,null))[_0x35fc('0x3f')](handleError(_0xf2ca20,null));};exports['describe']=function(_0x553ed6,_0x144f77){return db[_0x35fc('0x29')][_0x35fc('0x4a')]()[_0x35fc('0x24')](respondWithResult(_0x144f77,null))[_0x35fc('0x3f')](handleError(_0x144f77,null));};exports[_0x35fc('0x4b')]=function(_0x4a4798,_0x4f024c,_0x388521){var _0x19b2ce=require(_0x35fc('0x4c'));var _0x38bc78=![];var _0x5b2595={};if(_0x4a4798[_0x35fc('0x2f')][_0x35fc('0x2b')]&&_0x4a4798['query'][_0x35fc('0x2b')]===_0x35fc('0x4d')){_0x5b2595['uniqueid']=_0x4a4798[_0x35fc('0x41')]['id'];}else{_0x5b2595['id']=_0x4a4798[_0x35fc('0x41')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':_0x5b2595,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x4f024c,null))['then'](function(_0x240338){if(_0x240338){var _0x2ea8d6=path['join'](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x240338[_0x35fc('0x49')]);var _0x145854=util[_0x35fc('0x2e')]('%s.cypher',_0x2ea8d6);if(fs[_0x35fc('0x50')](_0x145854)){_0x38bc78=!![];return _0x19b2ce[_0x35fc('0x51')](_0x145854,_0x2ea8d6,config[_0x35fc('0x52')]['recording'])[_0x35fc('0x24')](function(){return _0x240338;});}return _0x240338;}})[_0x35fc('0x24')](function(_0x47fb1a){if(_0x47fb1a){var _0x35a676=path[_0x35fc('0x53')](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x47fb1a[_0x35fc('0x49')]);if(!fs[_0x35fc('0x50')](_0x35a676)){throw new db[(_0x35fc('0x54'))][(_0x35fc('0x55'))]('ScreenRecording\x20not\x20found');}if(_0x47fb1a[_0x35fc('0x56')]){return _0x4f024c[_0x35fc('0x4b')](_0x35a676,_0x47fb1a[_0x35fc('0x56')]+path['extname'](_0x35a676),function(){if(_0x38bc78){fs[_0x35fc('0x57')](_0x35a676);}});}else{return _0x4f024c['download'](_0x35a676,function(_0x4ceacc){if(_0x38bc78){fs['unlink'](_0x35a676);}});}}})[_0x35fc('0x3f')](function(_0xb1c68a){if(_0xb1c68a[_0x35fc('0x58')]===_0x35fc('0x59')){_0x4f024c[_0x35fc('0x18')](0x194)['send']('Not\x20found');}else{return handleError(_0x4f024c,null);}});};exports['destroy']=function(_0x4faef4,_0x51d231){return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':{'id':_0x4faef4[_0x35fc('0x41')]['id']}})[_0x35fc('0x24')](function(_0x511e8b){if(_[_0x35fc('0x5a')](_0x511e8b)){throw new ReferenceError(_0x35fc('0x5b'));}return _0x511e8b;})[_0x35fc('0x24')](function(_0x1b0063){var _0x37bea1=path[_0x35fc('0x53')](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x1b0063[_0x35fc('0x49')]);logger['info'](_0x35fc('0x5c'),_0x37bea1);if(!_['isNil'](_0x1b0063[_0x35fc('0x49')])&&fs[_0x35fc('0x50')](_0x37bea1)){logger[_0x35fc('0x5d')](_0x35fc('0x5e')+_0x37bea1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x35fc('0x5f')](_0x37bea1);}_0x37bea1=_0x37bea1+'.cypher';if(!_['isNil'](_0x1b0063['value'])&&fs[_0x35fc('0x50')](_0x37bea1)){logger['info'](_0x35fc('0x5e')+_0x37bea1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x35fc('0x5f')](_0x37bea1);}return _0x1b0063;})['then'](function(_0x42a53a){if(!_0x42a53a)throw new InternalError();return _0x42a53a[_0x35fc('0x25')]();})[_0x35fc('0x24')](function(){_0x51d231[_0x35fc('0x18')](0xcc)['end']();})[_0x35fc('0x3f')](handleError(_0x51d231,null));}; \ No newline at end of file +var _0xee14=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','catch','params','find','create','body','duration','describe','../../components/encryptor','uniqueid','value','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','filename','download','unlink','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','join','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x2d80da,_0x4153a5){var _0x4189ff=function(_0x537789){while(--_0x537789){_0x2d80da['push'](_0x2d80da['shift']());}};_0x4189ff(++_0x4153a5);}(_0xee14,0x13a));var _0x4ee1=function(_0x14aaae,_0x1a261){_0x14aaae=_0x14aaae-0x0;var _0x5a1189=_0xee14[_0x14aaae];return _0x5a1189;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['ScreenRecording'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x34')](_['map'](_0x13944c,_0x4ee1('0x2c')),[_0x4ee1('0x35')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x4746c2[_0x4ee1('0x36')]);_0x1d91be[_0x4ee1('0x38')]=_['intersection'](_0x1d91be['model'],_0x1d91be[_0x4ee1('0x36')]);_0x3dc870[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x1d91be['model'],qs[_0x4ee1('0x3b')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3c')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3d')](_0x4ee1('0x3e'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2['query'][_0x4ee1('0x20')]);_0x3dc870[_0x4ee1('0x1e')]=qs[_0x4ee1('0x1e')](_0x4746c2['query']['offset']);}_0x3dc870[_0x4ee1('0x3f')]=qs[_0x4ee1('0x40')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x40')]);_0x3dc870['where']=qs[_0x4ee1('0x38')](_[_0x4ee1('0x41')](_0x4746c2[_0x4ee1('0x36')],_0x1d91be[_0x4ee1('0x38')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x42')]){_0x3dc870[_0x4ee1('0x43')]=_[_0x4ee1('0x44')](_0x3dc870['where'],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x1116b4){if(_0x1116b4[_0x4ee1('0x31')]!==_0x4ee1('0x45')){var _0x45bb22={};_0x45bb22[_0x1116b4[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2['query'][_0x4ee1('0x42')]+'%'};return _0x45bb22;}})});}_0x3dc870=_[_0x4ee1('0x44')]({},_0x3dc870,_0x4746c2[_0x4ee1('0x46')]);var _0x333690={'where':_0x3dc870[_0x4ee1('0x43')]};return db[_0x4ee1('0x47')][_0x4ee1('0x21')](_0x333690)[_0x4ee1('0x29')](function(_0x23bb5f){_0x59a34e[_0x4ee1('0x21')]=_0x23bb5f;if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x48')]){_0x3dc870[_0x4ee1('0x49')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4ee1('0x4a')](_0x3dc870);})[_0x4ee1('0x29')](function(_0x5ee7b4){_0x59a34e[_0x4ee1('0x4b')]=_0x5ee7b4;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x4c')](handleError(_0x4ec408,null));};exports['show']=function(_0x14c333,_0xc7580c){var _0x557126={'raw':![],'where':{'id':_0x14c333[_0x4ee1('0x4d')]['id']}},_0x25d683={};_0x25d683[_0x4ee1('0x33')]=_[_0x4ee1('0x37')](db['ScreenRecording'][_0x4ee1('0x2f')]);_0x25d683[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x14c333['query']);_0x25d683['filters']=_[_0x4ee1('0x3a')](_0x25d683[_0x4ee1('0x33')],_0x25d683[_0x4ee1('0x36')]);_0x557126[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x25d683['model'],qs['fields'](_0x14c333[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x557126[_0x4ee1('0x39')]=_0x557126[_0x4ee1('0x39')]['length']?_0x557126[_0x4ee1('0x39')]:_0x25d683[_0x4ee1('0x33')];if(_0x14c333['query'][_0x4ee1('0x48')]){_0x557126[_0x4ee1('0x49')]=[{'all':!![]}];}_0x557126=_[_0x4ee1('0x44')]({},_0x557126,_0x14c333[_0x4ee1('0x46')]);return db[_0x4ee1('0x47')][_0x4ee1('0x4e')](_0x557126)[_0x4ee1('0x29')](handleEntityNotFound(_0xc7580c,null))[_0x4ee1('0x29')](respondWithResult(_0xc7580c,null))[_0x4ee1('0x4c')](handleError(_0xc7580c,null));};exports['create']=function(_0x49b667,_0x1a972b){return db[_0x4ee1('0x47')][_0x4ee1('0x4f')](_0x49b667[_0x4ee1('0x50')],{})['then'](respondWithResult(_0x1a972b,0xc9))[_0x4ee1('0x4c')](handleError(_0x1a972b,null));};exports[_0x4ee1('0x27')]=function(_0x42dd8d,_0x2bc77f){if(_0x42dd8d[_0x4ee1('0x50')]['id']){delete _0x42dd8d['body']['id'];}delete _0x42dd8d[_0x4ee1('0x50')][_0x4ee1('0x51')];delete _0x42dd8d[_0x4ee1('0x50')]['createdAt'];delete _0x42dd8d[_0x4ee1('0x50')]['closedAt'];delete _0x42dd8d[_0x4ee1('0x50')]['value'];return db[_0x4ee1('0x47')]['find']({'where':{'id':_0x42dd8d[_0x4ee1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2bc77f,null))[_0x4ee1('0x29')](saveUpdates(_0x42dd8d[_0x4ee1('0x50')],null))[_0x4ee1('0x29')](respondWithResult(_0x2bc77f,null))['catch'](handleError(_0x2bc77f,null));};exports[_0x4ee1('0x52')]=function(_0x4118d7,_0xcdb873){return db[_0x4ee1('0x47')][_0x4ee1('0x52')]()[_0x4ee1('0x29')](respondWithResult(_0xcdb873,null))[_0x4ee1('0x4c')](handleError(_0xcdb873,null));};exports['download']=function(_0x4c4178,_0x1feb78,_0xcddc5d){var _0xf58cd8=require(_0x4ee1('0x53'));var _0x44e65f=![];var _0x31e82d={};if(_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]&&_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]===_0x4ee1('0x54')){_0x31e82d[_0x4ee1('0x54')]=_0x4c4178[_0x4ee1('0x4d')]['id'];}else{_0x31e82d['id']=_0x4c4178['params']['id'];}return db[_0x4ee1('0x47')]['find']({'where':_0x31e82d,'attributes':['id',_0x4ee1('0x55')],'raw':!![]})[_0x4ee1('0x29')](handleEntityNotFound(_0x1feb78,null))['then'](function(_0x1e0aac){if(_0x1e0aac){var _0x184e36=path['join'](config['root'],_0x4ee1('0x56'),_0x1e0aac['value']);var _0x1ce99e=util[_0x4ee1('0x35')]('%s.cypher',_0x184e36);if(fs[_0x4ee1('0x57')](_0x1ce99e)){_0x44e65f=!![];return _0xf58cd8[_0x4ee1('0x58')](_0x1ce99e,_0x184e36,config[_0x4ee1('0x59')][_0x4ee1('0x5a')])[_0x4ee1('0x29')](function(){return _0x1e0aac;});}return _0x1e0aac;}})[_0x4ee1('0x29')](function(_0x11f619){if(_0x11f619){var _0x5f5694=path['join'](config[_0x4ee1('0x5b')],_0x4ee1('0x56'),_0x11f619['value']);if(!fs[_0x4ee1('0x57')](_0x5f5694)){throw new db[(_0x4ee1('0x5c'))][(_0x4ee1('0x5d'))]('ScreenRecording\x20not\x20found');}if(_0x11f619[_0x4ee1('0x5e')]){return _0x1feb78['download'](_0x5f5694,_0x11f619[_0x4ee1('0x5e')]+path['extname'](_0x5f5694),function(){if(_0x44e65f){fs['unlink'](_0x5f5694);}});}else{return _0x1feb78[_0x4ee1('0x5f')](_0x5f5694,function(_0x16fcd0){if(_0x44e65f){fs[_0x4ee1('0x60')](_0x5f5694);}});}}})[_0x4ee1('0x4c')](function(_0x38e889){if(_0x38e889['message']===_0x4ee1('0x61')){_0x1feb78[_0x4ee1('0x1b')](0x194)[_0x4ee1('0x2d')]('Not\x20found');}else{return handleError(_0x1feb78,null);}});};exports[_0x4ee1('0x28')]=function(_0x109dc6,_0x3fdd61){return db[_0x4ee1('0x47')][_0x4ee1('0x4e')]({'where':{'id':_0x109dc6[_0x4ee1('0x4d')]['id']}})[_0x4ee1('0x29')](function(_0x20ca0b){if(_[_0x4ee1('0x62')](_0x20ca0b)){throw new ReferenceError(_0x4ee1('0x63'));}return _0x20ca0b;})[_0x4ee1('0x29')](function(_0x38e86f){var _0x5d396c=path[_0x4ee1('0x64')](config['root'],_0x4ee1('0x56'),_0x38e86f['value']);logger[_0x4ee1('0x65')](_0x4ee1('0x66'),_0x5d396c);if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs[_0x4ee1('0x57')](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs[_0x4ee1('0x69')](_0x5d396c);}_0x5d396c=_0x5d396c+_0x4ee1('0x6a');if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs['existsSync'](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs['unlinkSync'](_0x5d396c);}return _0x38e86f;})['then'](function(_0x40dac3){if(!_0x40dac3)throw new InternalError();return _0x40dac3[_0x4ee1('0x28')]();})['then'](function(){_0x3fdd61[_0x4ee1('0x1b')](0xcc)[_0x4ee1('0x1c')]();})[_0x4ee1('0x4c')](handleError(_0x3fdd61,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index cf188b6..281975e 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 _0xb17b=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','define','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb17b,0x198));var _0xbb17=function(_0x95bd1b,_0x13e180){_0x95bd1b=_0x95bd1b-0x0;var _0x5f4201=_0xb17b[_0x95bd1b];return _0x5f4201;};'use strict';var _=require(_0xbb17('0x0'));var util=require(_0xbb17('0x1'));var logger=require(_0xbb17('0x2'))(_0xbb17('0x3'));var moment=require('moment');var BPromise=require(_0xbb17('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb17('0x5'));var rimraf=require(_0xbb17('0x6'));var config=require(_0xbb17('0x7'));var attributes=require(_0xbb17('0x8'));module['exports']=function(_0x3e49e1,_0xf9eb2a){return _0x3e49e1[_0xbb17('0x9')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c9=['define','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x2e989a,_0x433b3f){var _0x108279=function(_0x170c2c){while(--_0x170c2c){_0x2e989a['push'](_0x2e989a['shift']());}};_0x108279(++_0x433b3f);}(_0xb4c9,0x93));var _0x9b4c=function(_0x4b5fc5,_0x34f9d6){_0x4b5fc5=_0x4b5fc5-0x0;var _0x5d69e3=_0xb4c9[_0x4b5fc5];return _0x5d69e3;};'use strict';var _=require(_0x9b4c('0x0'));var util=require(_0x9b4c('0x1'));var logger=require(_0x9b4c('0x2'))(_0x9b4c('0x3'));var moment=require(_0x9b4c('0x4'));var BPromise=require(_0x9b4c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b4c('0x6'));var rimraf=require(_0x9b4c('0x7'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0x9b4c('0x8')]=function(_0x2629d2,_0x43806f){return _0x2629d2[_0x9b4c('0x9')]('ScreenRecording',attributes,{'tableName':_0x9b4c('0xa'),'paranoid':![],'indexes':[{'name':_0x9b4c('0xb'),'fields':[_0x9b4c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 5842b2e..8dae52f 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 _0x8a2e=['debug','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent'];(function(_0x2773f4,_0x5d781e){var _0x16f4a0=function(_0x51133a){while(--_0x51133a){_0x2773f4['push'](_0x2773f4['shift']());}};_0x16f4a0(++_0x5d781e);}(_0x8a2e,0x152));var _0xe8a2=function(_0x25dd7e,_0x27c72c){_0x25dd7e=_0x25dd7e-0x0;var _0x1754d3=_0x8a2e[_0x25dd7e];return _0x1754d3;};'use strict';var _=require(_0xe8a2('0x0'));var util=require(_0xe8a2('0x1'));var moment=require(_0xe8a2('0x2'));var BPromise=require(_0xe8a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8a2('0x4'));var db=require(_0xe8a2('0x5'))['db'];var utils=require(_0xe8a2('0x6'));var logger=require(_0xe8a2('0x7'))(_0xe8a2('0x8'));var config=require('../../config/environment');var jayson=require(_0xe8a2('0x9'));var client=jayson[_0xe8a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x222b01,_0x2b9fac,_0x352a3b){return new BPromise(function(_0x4c1b41,_0xcc5c2c){return client['request'](_0x222b01,_0x352a3b)[_0xe8a2('0xb')](function(_0xec934f){logger[_0xe8a2('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x2b9fac,_0xe8a2('0xd'));logger[_0xe8a2('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x2b9fac,_0xe8a2('0xd'),JSON[_0xe8a2('0xf')](_0xec934f));if(_0xec934f[_0xe8a2('0x10')]){if(_0xec934f[_0xe8a2('0x10')][_0xe8a2('0x11')]===0x1f4){logger[_0xe8a2('0x10')](_0xe8a2('0x12'),_0x2b9fac,_0xec934f['error'][_0xe8a2('0x13')]);return _0xcc5c2c(_0xec934f[_0xe8a2('0x10')]['message']);}logger[_0xe8a2('0x10')](_0xe8a2('0x12'),_0x2b9fac,_0xec934f[_0xe8a2('0x10')][_0xe8a2('0x13')]);return _0x4c1b41(_0xec934f[_0xe8a2('0x10')][_0xe8a2('0x13')]);}else{logger['info'](_0xe8a2('0x12'),_0x2b9fac,_0xe8a2('0xd'));_0x4c1b41(_0xec934f[_0xe8a2('0x14')][_0xe8a2('0x13')]);}})[_0xe8a2('0x15')](function(_0x445309){logger[_0xe8a2('0x10')](_0xe8a2('0x12'),_0x2b9fac,_0x445309);_0xcc5c2c(_0x445309);});});} \ No newline at end of file +var _0x01bc=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x17cb9c,_0xe7d521){var _0x577521=function(_0x1d1ba4){while(--_0x1d1ba4){_0x17cb9c['push'](_0x17cb9c['shift']());}};_0x577521(++_0xe7d521);}(_0x01bc,0x12d));var _0xc01b=function(_0x23ccef,_0x27056f){_0x23ccef=_0x23ccef-0x0;var _0x4dcada=_0x01bc[_0x23ccef];return _0x4dcada;};'use strict';var _=require(_0xc01b('0x0'));var util=require(_0xc01b('0x1'));var moment=require(_0xc01b('0x2'));var BPromise=require(_0xc01b('0x3'));var rs=require(_0xc01b('0x4'));var fs=require('fs');var Redis=require(_0xc01b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc01b('0x6'));var logger=require(_0xc01b('0x7'))('rpc');var config=require(_0xc01b('0x8'));var jayson=require(_0xc01b('0x9'));var client=jayson[_0xc01b('0xa')][_0xc01b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b2f37,_0x1620ca,_0x1ba30d){return new BPromise(function(_0x3e2303,_0x30408e){return client[_0xc01b('0xc')](_0x5b2f37,_0x1ba30d)[_0xc01b('0xd')](function(_0x29d6b9){logger[_0xc01b('0xe')](_0xc01b('0xf'),_0x1620ca,_0xc01b('0x10'));logger[_0xc01b('0x11')](_0xc01b('0x12'),_0x1620ca,_0xc01b('0x10'),JSON['stringify'](_0x29d6b9));if(_0x29d6b9[_0xc01b('0x13')]){if(_0x29d6b9['error']['code']===0x1f4){logger[_0xc01b('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x1620ca,_0x29d6b9[_0xc01b('0x13')]['message']);return _0x30408e(_0x29d6b9[_0xc01b('0x13')][_0xc01b('0x14')]);}logger[_0xc01b('0x13')](_0xc01b('0xf'),_0x1620ca,_0x29d6b9[_0xc01b('0x13')]['message']);return _0x3e2303(_0x29d6b9[_0xc01b('0x13')]['message']);}else{logger[_0xc01b('0xe')](_0xc01b('0xf'),_0x1620ca,_0xc01b('0x10'));_0x3e2303(_0x29d6b9[_0xc01b('0x15')][_0xc01b('0x14')]);}})[_0xc01b('0x16')](function(_0x109de6){logger[_0xc01b('0x13')](_0xc01b('0xf'),_0x1620ca,_0x109de6);_0x30408e(_0x109de6);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 6bb95e0..7a6ac4b 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 _0xf2a5=['/:id/gdpr','gdpr','getPreferred','/:id/favicon','diskStorage','server/files/images/logos/','format','logo','extname','originalname','post','/:id/logo','single','file','addLogo','join','root','%s%s','logologin','addLogoLogin','preferred','/:id/preferred','addPreferred','addFavicon','update','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo_login','getLogoLogin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2a5,0x6a));var _0x5f2a=function(_0x2b26dd,_0x3038bf){_0x2b26dd=_0x2b26dd-0x0;var _0x47e9d4=_0xf2a5[_0x2b26dd];return _0x47e9d4;};'use strict';var multer=require(_0x5f2a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5f2a('0x1'));var express=require('express');var router=express[_0x5f2a('0x2')]();var fs_extra=require(_0x5f2a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5f2a('0x4'));var config=require(_0x5f2a('0x5'));var controller=require(_0x5f2a('0x6'));router[_0x5f2a('0x7')]('/',auth[_0x5f2a('0x8')](),controller[_0x5f2a('0x9')]);router[_0x5f2a('0x7')]('/now',controller['getDate']);router[_0x5f2a('0x7')](_0x5f2a('0xa'),controller[_0x5f2a('0xb')]);router['get']('/:id/logo',controller['getLogo']);router[_0x5f2a('0x7')](_0x5f2a('0xc'),controller[_0x5f2a('0xd')]);router[_0x5f2a('0x7')](_0x5f2a('0xe'),controller[_0x5f2a('0xf')]);router[_0x5f2a('0x7')]('/:id/preferred',controller[_0x5f2a('0x10')]);router['get'](_0x5f2a('0x11'),controller['getFavicon']);var upload=multer({'storage':multer[_0x5f2a('0x12')]({'destination':function(_0x3ac61f,_0x4d0de2,_0x47fd70){_0x47fd70(null,path['join'](config['root'],_0x5f2a('0x13')));},'filename':function(_0x2e82b2,_0x41ce38,_0x32e622){_0x32e622(null,util[_0x5f2a('0x14')]('%s%s',_0x5f2a('0x15'),path[_0x5f2a('0x16')](_0x41ce38[_0x5f2a('0x17')])));}})});router[_0x5f2a('0x18')](_0x5f2a('0x19'),upload[_0x5f2a('0x1a')](_0x5f2a('0x1b')),controller[_0x5f2a('0x1c')]);var upload=multer({'storage':multer[_0x5f2a('0x12')]({'destination':function(_0x5a29c4,_0x27d81e,_0x178ccb){_0x178ccb(null,path[_0x5f2a('0x1d')](config[_0x5f2a('0x1e')],_0x5f2a('0x13')));},'filename':function(_0x5c5a56,_0x3aeb5f,_0x2dc9c6){_0x2dc9c6(null,util['format'](_0x5f2a('0x1f'),_0x5f2a('0x20'),path[_0x5f2a('0x16')](_0x3aeb5f[_0x5f2a('0x17')])));}})});router[_0x5f2a('0x18')](_0x5f2a('0xc'),upload['single']('file'),controller[_0x5f2a('0x21')]);var upload=multer({'storage':multer[_0x5f2a('0x12')]({'destination':function(_0x389bfb,_0x219634,_0x58793d){_0x58793d(null,path['join'](config['root'],_0x5f2a('0x13')));},'filename':function(_0x85e96d,_0x4f570d,_0x332a36){_0x332a36(null,util['format'](_0x5f2a('0x1f'),_0x5f2a('0x22'),path['extname'](_0x4f570d['originalname'])));}})});router['post'](_0x5f2a('0x23'),upload[_0x5f2a('0x1a')](_0x5f2a('0x1b')),controller[_0x5f2a('0x24')]);var upload=multer({'storage':multer[_0x5f2a('0x12')]({'destination':function(_0x4389a1,_0x44512e,_0x54ce74){_0x54ce74(null,path[_0x5f2a('0x1d')](config[_0x5f2a('0x1e')],'server/files/images/logos/'));},'filename':function(_0x203397,_0x53c478,_0x1d4e39){_0x1d4e39(null,util[_0x5f2a('0x14')](_0x5f2a('0x1f'),'favicon',path[_0x5f2a('0x16')](_0x53c478[_0x5f2a('0x17')])));}})});router[_0x5f2a('0x18')](_0x5f2a('0x11'),upload[_0x5f2a('0x1a')](_0x5f2a('0x1b')),controller[_0x5f2a('0x25')]);router['put'](_0x5f2a('0xa'),auth[_0x5f2a('0x8')](),controller[_0x5f2a('0x26')]);module[_0x5f2a('0x27')]=router; \ No newline at end of file +var _0xe10d=['getDate','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','%s%s','logo','extname','originalname','post','/:id/logo','file','addLogo','format','logologin','single','addLogoLogin','root','preferred','addPreferred','favicon','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/now'];(function(_0x5de8bf,_0x24e115){var _0x2be3e3=function(_0x385e2c){while(--_0x385e2c){_0x5de8bf['push'](_0x5de8bf['shift']());}};_0x2be3e3(++_0x24e115);}(_0xe10d,0x180));var _0xde10=function(_0x1b51c3,_0x20fa89){_0x1b51c3=_0x1b51c3-0x0;var _0x376a30=_0xe10d[_0x1b51c3];return _0x376a30;};'use strict';var multer=require(_0xde10('0x0'));var util=require(_0xde10('0x1'));var path=require(_0xde10('0x2'));var timeout=require('connect-timeout');var express=require(_0xde10('0x3'));var router=express[_0xde10('0x4')]();var fs_extra=require(_0xde10('0x5'));var auth=require(_0xde10('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xde10('0x7'));var controller=require('./setting.controller');router[_0xde10('0x8')]('/',auth[_0xde10('0x9')](),controller[_0xde10('0xa')]);router[_0xde10('0x8')](_0xde10('0xb'),controller[_0xde10('0xc')]);router[_0xde10('0x8')](_0xde10('0xd'),controller[_0xde10('0xe')]);router[_0xde10('0x8')]('/:id/logo',controller['getLogo']);router[_0xde10('0x8')](_0xde10('0xf'),controller[_0xde10('0x10')]);router[_0xde10('0x8')](_0xde10('0x11'),controller[_0xde10('0x12')]);router[_0xde10('0x8')](_0xde10('0x13'),controller[_0xde10('0x14')]);router[_0xde10('0x8')](_0xde10('0x15'),controller[_0xde10('0x16')]);var upload=multer({'storage':multer[_0xde10('0x17')]({'destination':function(_0x38263a,_0x131dce,_0x2c9c84){_0x2c9c84(null,path[_0xde10('0x18')](config['root'],_0xde10('0x19')));},'filename':function(_0x3809f3,_0x174511,_0x3730f1){_0x3730f1(null,util['format'](_0xde10('0x1a'),_0xde10('0x1b'),path[_0xde10('0x1c')](_0x174511[_0xde10('0x1d')])));}})});router[_0xde10('0x1e')](_0xde10('0x1f'),upload['single'](_0xde10('0x20')),controller[_0xde10('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x412650,_0x3a8df8,_0x33c8a6){_0x33c8a6(null,path[_0xde10('0x18')](config['root'],'server/files/images/logos/'));},'filename':function(_0x274a97,_0x20ee7d,_0x211a27){_0x211a27(null,util[_0xde10('0x22')]('%s%s',_0xde10('0x23'),path[_0xde10('0x1c')](_0x20ee7d[_0xde10('0x1d')])));}})});router[_0xde10('0x1e')](_0xde10('0xf'),upload[_0xde10('0x24')]('file'),controller[_0xde10('0x25')]);var upload=multer({'storage':multer[_0xde10('0x17')]({'destination':function(_0x182a67,_0x504d01,_0x2265ba){_0x2265ba(null,path[_0xde10('0x18')](config[_0xde10('0x26')],'server/files/images/logos/'));},'filename':function(_0x4b20c2,_0x1a0d91,_0x2a8219){_0x2a8219(null,util[_0xde10('0x22')](_0xde10('0x1a'),_0xde10('0x27'),path['extname'](_0x1a0d91[_0xde10('0x1d')])));}})});router[_0xde10('0x1e')](_0xde10('0x13'),upload[_0xde10('0x24')](_0xde10('0x20')),controller[_0xde10('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb1cb88,_0x1152f9,_0x5275ed){_0x5275ed(null,path[_0xde10('0x18')](config['root'],'server/files/images/logos/'));},'filename':function(_0x173bfb,_0x13f2b3,_0x3510bd){_0x3510bd(null,util[_0xde10('0x22')](_0xde10('0x1a'),_0xde10('0x29'),path['extname'](_0x13f2b3[_0xde10('0x1d')])));}})});router['post'](_0xde10('0x15'),upload['single'](_0xde10('0x20')),controller['addFavicon']);router['put'](_0xde10('0xd'),auth[_0xde10('0x9')](),controller[_0xde10('0x2a')]);module[_0xde10('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 7512cc1..1451855 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 _0x0b0e=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','sequelize'];(function(_0x1e7506,_0xaf5c0b){var _0x18f0fb=function(_0x13e655){while(--_0x13e655){_0x1e7506['push'](_0x1e7506['shift']());}};_0x18f0fb(++_0xaf5c0b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x52740f,_0x343961){_0x52740f=_0x52740f-0x0;var _0x1cbe11=_0x0b0e[_0x52740f];return _0x1cbe11;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':_0xe0b0('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe0b0('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x4')},'logo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xe0b0('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnusername':{'type':Sequelize[_0xe0b0('0x3')]},'turnpassword':{'type':Sequelize[_0xe0b0('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x6')},'chatTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xe0b0('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xe0b0('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe0b0('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xe0b0('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xe0b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0b0e=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','sequelize'];(function(_0x2492af,_0x53058c){var _0x924f79=function(_0x1230c7){while(--_0x1230c7){_0x2492af['push'](_0x2492af['shift']());}};_0x924f79(++_0x53058c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2384f6,_0x167775){_0x2384f6=_0x2384f6-0x0;var _0x370294=_0x0b0e[_0x2384f6];return _0x370294;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':_0xe0b0('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe0b0('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x4')},'logo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xe0b0('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnusername':{'type':Sequelize[_0xe0b0('0x3')]},'turnpassword':{'type':Sequelize[_0xe0b0('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x6')},'chatTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xe0b0('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xe0b0('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe0b0('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xe0b0('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xe0b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 435c8d2..32e8437 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 _0x6d42=['options','includeAll','include','rows','show','find','params','body','addLogo','file','filename','logo','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','favicon','defaultLogo','default_loginLogo.svg','\x20not\x20found','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x1c7e86,_0x24906b){var _0x238734=function(_0x4940dd){while(--_0x4940dd){_0x1c7e86['push'](_0x1c7e86['shift']());}};_0x238734(++_0x24906b);}(_0x6d42,0x1a0));var _0x26d4=function(_0x122cff,_0xdd8b8d){_0x122cff=_0x122cff-0x0;var _0x915f5e=_0x6d42[_0x122cff];return _0x915f5e;};'use strict';var emlformat=require(_0x26d4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x26d4('0x1'));var BPromise=require(_0x26d4('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x26d4('0x3'));var sox=require(_0x26d4('0x4'));var csv=require(_0x26d4('0x5'));var ejs=require(_0x26d4('0x6'));var fs=require('fs');var fs_extra=require(_0x26d4('0x7'));var _=require('lodash');var squel=require(_0x26d4('0x8'));var crypto=require(_0x26d4('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x26d4('0xa'));var toCsv=require(_0x26d4('0x5'));var querystring=require(_0x26d4('0xb'));var Papa=require(_0x26d4('0xc'));var Redis=require(_0x26d4('0xd'));var authService=require(_0x26d4('0xe'));var qs=require(_0x26d4('0xf'));var as=require(_0x26d4('0x10'));var hardwareService=require(_0x26d4('0x11'));var logger=require('../../config/logger')(_0x26d4('0x12'));var utils=require('../../config/utils');var config=require(_0x26d4('0x13'));var licenseUtil=require(_0x26d4('0x14'));var db=require(_0x26d4('0x15'))['db'];var jayson=require(_0x26d4('0x16'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e0b4f,_0x4a6c92,_0x4fbe16,_0x11b9ff){return new BPromise(function(_0xcc9d4f,_0x4998dd){var _0x2a7114=_0x11b9ff||client;return _0x2a7114['request'](_0x5e0b4f,_0x4fbe16)['then'](function(_0x5a903a){logger[_0x26d4('0x17')](_0x26d4('0x18'),_0x4a6c92,'request\x20sent');logger[_0x26d4('0x19')](_0x26d4('0x1a'),_0x4a6c92,_0x26d4('0x1b'),JSON[_0x26d4('0x1c')](_0x5a903a));if(_0x5a903a[_0x26d4('0x1d')]){if(_0x5a903a[_0x26d4('0x1d')][_0x26d4('0x1e')]===0x1f4){logger[_0x26d4('0x1d')](_0x26d4('0x18'),_0x4a6c92,_0x5a903a[_0x26d4('0x1d')][_0x26d4('0x1f')]);return _0x4998dd(_0x5a903a[_0x26d4('0x1d')][_0x26d4('0x1f')]);}logger[_0x26d4('0x1d')](_0x26d4('0x18'),_0x4a6c92,_0x5a903a['error']['message']);return _0xcc9d4f(_0x5a903a[_0x26d4('0x1d')][_0x26d4('0x1f')]);}else{logger[_0x26d4('0x17')]('Setting,\x20%s,\x20%s',_0x4a6c92,'request\x20sent');_0xcc9d4f(_0x5a903a['result'][_0x26d4('0x1f')]);}})[_0x26d4('0x20')](function(_0x6e094e){logger[_0x26d4('0x1d')](_0x26d4('0x18'),_0x4a6c92,_0x6e094e);_0x4998dd(_0x6e094e);});});}function respondWithStatusCode(_0x6a0111,_0x16735e){_0x16735e=_0x16735e||0xcc;return function(_0x458fdc){if(_0x458fdc){return _0x6a0111[_0x26d4('0x21')](_0x16735e);}return _0x6a0111[_0x26d4('0x22')](_0x16735e)['end']();};}function respondWithResult(_0x3fda94,_0x2e73ac){_0x2e73ac=_0x2e73ac||0xc8;return function(_0x39970e){if(_0x39970e){return _0x3fda94[_0x26d4('0x22')](_0x2e73ac)[_0x26d4('0x23')](_0x39970e);}};}function respondWithFilteredResult(_0x2dcd84,_0x222442){return function(_0x3fff85){if(_0x3fff85){var _0x137599=typeof _0x222442[_0x26d4('0x24')]===_0x26d4('0x25')&&typeof _0x222442['limit']==='undefined';var _0x248010=_0x3fff85[_0x26d4('0x26')];var _0x5e1c87=_0x137599?0x0:_0x222442[_0x26d4('0x24')];var _0x369398=_0x137599?_0x3fff85[_0x26d4('0x26')]:_0x222442[_0x26d4('0x24')]+_0x222442[_0x26d4('0x27')];var _0x2bfc6a;if(_0x369398>=_0x248010){_0x369398=_0x248010;_0x2bfc6a=0xc8;}else{_0x2bfc6a=0xce;}_0x2dcd84[_0x26d4('0x22')](_0x2bfc6a);return _0x2dcd84[_0x26d4('0x28')](_0x26d4('0x29'),_0x5e1c87+'-'+_0x369398+'/'+_0x248010)[_0x26d4('0x23')](_0x3fff85);}return null;};}function patchUpdates(_0x1f5b0e){return function(_0x14ca91){try{jsonpatch[_0x26d4('0x2a')](_0x14ca91,_0x1f5b0e,!![]);}catch(_0x46aafd){return BPromise[_0x26d4('0x2b')](_0x46aafd);}return _0x14ca91[_0x26d4('0x2c')]();};}function saveUpdates(_0x5e2dff,_0xc60ad4){return function(_0x3a1229){if(_0x3a1229){return _0x3a1229[_0x26d4('0x2d')](_0x5e2dff)['then'](function(_0x3d6de0){return _0x3d6de0;});}return null;};}function removeEntity(_0x48d1a2,_0x13a063){return function(_0x5c2c12){if(_0x5c2c12){return _0x5c2c12[_0x26d4('0x2e')]()[_0x26d4('0x2f')](function(){_0x48d1a2[_0x26d4('0x22')](0xcc)[_0x26d4('0x30')]();});}};}function handleEntityNotFound(_0x9320b8,_0x30bbad){return function(_0x1bb2a0){if(!_0x1bb2a0){_0x9320b8[_0x26d4('0x21')](0x194);}return _0x1bb2a0;};}function handleError(_0x1b1f3d,_0x2825b0){_0x2825b0=_0x2825b0||0x1f4;return function(_0x327c09){logger[_0x26d4('0x1d')](_0x327c09[_0x26d4('0x31')]);if(_0x327c09[_0x26d4('0x32')]){delete _0x327c09[_0x26d4('0x32')];}_0x1b1f3d[_0x26d4('0x22')](_0x2825b0)[_0x26d4('0x33')](_0x327c09);};}exports[_0x26d4('0x34')]=function(_0x25b4e2,_0x3be3f7){var _0x16292f={},_0x133d72={},_0x3c0d33={'count':0x0,'rows':[]};var _0x1c2381=_[_0x26d4('0x35')](db[_0x26d4('0x36')][_0x26d4('0x37')],function(_0x1d8c62){return{'name':_0x1d8c62[_0x26d4('0x38')],'type':_0x1d8c62[_0x26d4('0x39')][_0x26d4('0x3a')]};});_0x133d72[_0x26d4('0x3b')]=_[_0x26d4('0x35')](_0x1c2381,_0x26d4('0x32'));_0x133d72[_0x26d4('0x3c')]=_[_0x26d4('0x3d')](_0x25b4e2[_0x26d4('0x3c')]);_0x133d72[_0x26d4('0x3e')]=_[_0x26d4('0x3f')](_0x133d72[_0x26d4('0x3b')],_0x133d72[_0x26d4('0x3c')]);_0x16292f['attributes']=_[_0x26d4('0x3f')](_0x133d72[_0x26d4('0x3b')],qs[_0x26d4('0x40')](_0x25b4e2[_0x26d4('0x3c')]['fields']));_0x16292f[_0x26d4('0x41')]=_0x16292f[_0x26d4('0x41')][_0x26d4('0x42')]?_0x16292f['attributes']:_0x133d72[_0x26d4('0x3b')];if(!_0x25b4e2[_0x26d4('0x3c')][_0x26d4('0x43')](_0x26d4('0x44'))){_0x16292f[_0x26d4('0x27')]=qs[_0x26d4('0x27')](_0x25b4e2[_0x26d4('0x3c')][_0x26d4('0x27')]);_0x16292f[_0x26d4('0x24')]=qs['offset'](_0x25b4e2[_0x26d4('0x3c')][_0x26d4('0x24')]);}_0x16292f[_0x26d4('0x45')]=qs[_0x26d4('0x46')](_0x25b4e2[_0x26d4('0x3c')][_0x26d4('0x46')]);_0x16292f['where']=qs[_0x26d4('0x3e')](_[_0x26d4('0x47')](_0x25b4e2[_0x26d4('0x3c')],_0x133d72[_0x26d4('0x3e')]),_0x1c2381);if(_0x25b4e2['query'][_0x26d4('0x48')]){_0x16292f[_0x26d4('0x49')]=_[_0x26d4('0x4a')](_0x16292f[_0x26d4('0x49')],{'$or':_['map'](_0x1c2381,function(_0x266be1){if(_0x266be1['type']!==_0x26d4('0x4b')){var _0x40771a={};_0x40771a[_0x266be1[_0x26d4('0x32')]]={'$like':'%'+_0x25b4e2[_0x26d4('0x3c')]['filter']+'%'};return _0x40771a;}})});}_0x16292f=_[_0x26d4('0x4a')]({},_0x16292f,_0x25b4e2[_0x26d4('0x4c')]);var _0x325b4e={'where':_0x16292f[_0x26d4('0x49')]};return db['Setting']['count'](_0x325b4e)[_0x26d4('0x2f')](function(_0x1a07a7){_0x3c0d33['count']=_0x1a07a7;if(_0x25b4e2[_0x26d4('0x3c')][_0x26d4('0x4d')]){_0x16292f[_0x26d4('0x4e')]=[{'all':!![]}];}return db[_0x26d4('0x36')]['findAll'](_0x16292f);})['then'](function(_0x579238){_0x3c0d33[_0x26d4('0x4f')]=_0x579238;return _0x3c0d33;})[_0x26d4('0x2f')](respondWithFilteredResult(_0x3be3f7,_0x16292f))[_0x26d4('0x20')](handleError(_0x3be3f7,null));};exports[_0x26d4('0x50')]=function(_0x9f432e,_0x964b00){var _0x3ba69e={'raw':![],'where':{'id':_0x9f432e['params']['id']}},_0x5dc7a7={};_0x5dc7a7[_0x26d4('0x3b')]=_[_0x26d4('0x3d')](db[_0x26d4('0x36')][_0x26d4('0x37')]);_0x5dc7a7['query']=_[_0x26d4('0x3d')](_0x9f432e[_0x26d4('0x3c')]);_0x5dc7a7[_0x26d4('0x3e')]=_[_0x26d4('0x3f')](_0x5dc7a7[_0x26d4('0x3b')],_0x5dc7a7[_0x26d4('0x3c')]);_0x3ba69e[_0x26d4('0x41')]=_[_0x26d4('0x3f')](_0x5dc7a7[_0x26d4('0x3b')],qs['fields'](_0x9f432e[_0x26d4('0x3c')]['fields']));_0x3ba69e[_0x26d4('0x41')]=_0x3ba69e[_0x26d4('0x41')][_0x26d4('0x42')]?_0x3ba69e[_0x26d4('0x41')]:_0x5dc7a7[_0x26d4('0x3b')];if(_0x9f432e[_0x26d4('0x3c')][_0x26d4('0x4d')]){_0x3ba69e[_0x26d4('0x4e')]=[{'all':!![]}];}_0x3ba69e=_['merge']({},_0x3ba69e,_0x9f432e[_0x26d4('0x4c')]);return db[_0x26d4('0x36')][_0x26d4('0x51')](_0x3ba69e)['then'](handleEntityNotFound(_0x964b00,null))[_0x26d4('0x2f')](respondWithResult(_0x964b00,null))[_0x26d4('0x20')](handleError(_0x964b00,null));};exports[_0x26d4('0x2d')]=function(_0x4df24f,_0x53171e){if(_0x4df24f['body']['id']){delete _0x4df24f['body']['id'];}return db[_0x26d4('0x36')]['find']({'where':{'id':_0x4df24f[_0x26d4('0x52')]['id']}})[_0x26d4('0x2f')](handleEntityNotFound(_0x53171e,null))[_0x26d4('0x2f')](saveUpdates(_0x4df24f[_0x26d4('0x53')],null))[_0x26d4('0x2f')](respondWithResult(_0x53171e,null))[_0x26d4('0x20')](handleError(_0x53171e,null));};exports[_0x26d4('0x54')]=function(_0x24dd67,_0x2f5c3a,_0x30927e){if(_0x24dd67['file']&&_0x24dd67[_0x26d4('0x55')][_0x26d4('0x56')]){_0x24dd67['body'][_0x26d4('0x57')]=_0x24dd67[_0x26d4('0x55')]['filename'];}return db[_0x26d4('0x36')][_0x26d4('0x51')]({'where':{'id':_0x24dd67[_0x26d4('0x52')]['id']}})[_0x26d4('0x2f')](handleEntityNotFound(_0x2f5c3a,null))[_0x26d4('0x2f')](saveUpdates(_0x24dd67[_0x26d4('0x53')],null))['then'](respondWithResult(_0x2f5c3a,null))[_0x26d4('0x20')](handleError(_0x2f5c3a,null));};exports['addLogoLogin']=function(_0x425777,_0x39a33f,_0x3ef16a){if(_0x425777[_0x26d4('0x55')]&&_0x425777[_0x26d4('0x55')]['filename']){_0x425777[_0x26d4('0x53')][_0x26d4('0x58')]=_0x425777['file'][_0x26d4('0x56')];}return db[_0x26d4('0x36')]['find']({'where':{'id':_0x425777[_0x26d4('0x52')]['id']}})[_0x26d4('0x2f')](handleEntityNotFound(_0x39a33f,null))['then'](saveUpdates(_0x425777[_0x26d4('0x53')],null))[_0x26d4('0x2f')](respondWithResult(_0x39a33f,null))['catch'](handleError(_0x39a33f,null));};var utilLicense=require(_0x26d4('0x14'));exports[_0x26d4('0x59')]=function(_0x2116e1,_0x27876d,_0x238d1a){var _0x23e1dc=_0x26d4('0x5a');var _0x531d2a={'custom':![]};return utilLicense[_0x26d4('0x5b')]()[_0x26d4('0x2f')](function(_0x370f84){if(_0x370f84){_0x531d2a=_0x370f84;}return db[_0x26d4('0x36')]['find']({'where':{'id':_0x2116e1['params']['id']},'attributes':[_0x26d4('0x57'),_0x26d4('0x58'),_0x26d4('0x5c'),'favicon','defaultLogo',_0x26d4('0x5d'),_0x26d4('0x5e'),_0x26d4('0x5f')],'raw':!![]});})[_0x26d4('0x2f')](handleEntityNotFound(_0x27876d,null))[_0x26d4('0x2f')](function(_0x48b7de){if(_0x48b7de){var _0x1786e1=_0x48b7de['logo']&&fs[_0x26d4('0x60')](path['join'](config[_0x26d4('0x61')],_0x23e1dc,_[_0x26d4('0x62')](_0x48b7de[_0x26d4('0x57')])))?path[_0x26d4('0x63')](config['root'],_0x23e1dc,_['toLower'](_0x48b7de[_0x26d4('0x57')])):path[_0x26d4('0x63')](config[_0x26d4('0x61')],_0x23e1dc,_[_0x26d4('0x62')](_0x26d4('0x64')));var _0x7f26f7='default'+_[_0x26d4('0x65')](_0x26d4('0x57'));if(_0x48b7de[_0x7f26f7]||!_0x531d2a[_0x26d4('0x66')]){_0x1786e1=path[_0x26d4('0x63')](config[_0x26d4('0x61')],_0x23e1dc,_['toLower']('default_logo.svg'));}if(!fs['existsSync'](_0x1786e1)){throw new db[(_0x26d4('0x67'))][(_0x26d4('0x68'))](_['upperFirst'](_0x26d4('0x57'))+'\x20not\x20found');}return _0x27876d[_0x26d4('0x69')](_0x1786e1);}})[_0x26d4('0x20')](handleError(_0x27876d,null));};var utilLicense=require(_0x26d4('0x14'));exports[_0x26d4('0x6a')]=function(_0x25cb14,_0xfc3d52,_0x4d2fc2){var _0x21d028=_0x26d4('0x5a');var _0x52bf05={'custom':![]};return utilLicense[_0x26d4('0x5b')]()[_0x26d4('0x2f')](function(_0x5935b6){if(_0x5935b6){_0x52bf05=_0x5935b6;}return db[_0x26d4('0x36')][_0x26d4('0x51')]({'where':{'id':_0x25cb14[_0x26d4('0x52')]['id']},'attributes':[_0x26d4('0x57'),_0x26d4('0x58'),_0x26d4('0x5c'),_0x26d4('0x6b'),_0x26d4('0x6c'),_0x26d4('0x5d'),_0x26d4('0x5e'),_0x26d4('0x5f')],'raw':!![]});})[_0x26d4('0x2f')](handleEntityNotFound(_0xfc3d52,null))[_0x26d4('0x2f')](function(_0x5c40c9){if(_0x5c40c9){var _0x7379ec=_0x5c40c9[_0x26d4('0x58')]&&fs[_0x26d4('0x60')](path[_0x26d4('0x63')](config[_0x26d4('0x61')],_0x21d028,_[_0x26d4('0x62')](_0x5c40c9[_0x26d4('0x58')])))?path[_0x26d4('0x63')](config[_0x26d4('0x61')],_0x21d028,_[_0x26d4('0x62')](_0x5c40c9[_0x26d4('0x58')])):path[_0x26d4('0x63')](config['root'],_0x21d028,_[_0x26d4('0x62')](_0x26d4('0x6d')));var _0x171dff='default'+_[_0x26d4('0x65')](_0x26d4('0x58'));if(_0x5c40c9[_0x171dff]||!_0x52bf05[_0x26d4('0x66')]){_0x7379ec=path[_0x26d4('0x63')](config[_0x26d4('0x61')],_0x21d028,_[_0x26d4('0x62')]('default_loginLogo.svg'));}if(!fs[_0x26d4('0x60')](_0x7379ec)){throw new db[(_0x26d4('0x67'))]['ValidationError'](_[_0x26d4('0x65')](_0x26d4('0x58'))+_0x26d4('0x6e'));}return _0xfc3d52[_0x26d4('0x69')](_0x7379ec);}})[_0x26d4('0x20')](handleError(_0xfc3d52,null));};exports[_0x26d4('0x6f')]=function(_0x51c969,_0x3a3475){return db[_0x26d4('0x36')]['find']({'where':{'id':_0x51c969[_0x26d4('0x52')]['id']},'attributes':[_0x26d4('0x70')]})[_0x26d4('0x2f')](respondWithResult(_0x3a3475,null))[_0x26d4('0x20')](handleError(_0x3a3475,null));};exports[_0x26d4('0x71')]=function(_0x2a9788,_0x49b5fc,_0x41f0d3){if(_0x2a9788[_0x26d4('0x55')]&&_0x2a9788[_0x26d4('0x55')][_0x26d4('0x56')]){_0x2a9788[_0x26d4('0x53')]['preferred']=_0x2a9788[_0x26d4('0x55')][_0x26d4('0x56')];}return db[_0x26d4('0x36')][_0x26d4('0x51')]({'where':{'id':_0x2a9788[_0x26d4('0x52')]['id']}})[_0x26d4('0x2f')](handleEntityNotFound(_0x49b5fc,null))[_0x26d4('0x2f')](saveUpdates(_0x2a9788[_0x26d4('0x53')],null))['then'](respondWithResult(_0x49b5fc,null))[_0x26d4('0x20')](handleError(_0x49b5fc,null));};var utilLicense=require(_0x26d4('0x14'));exports['getPreferred']=function(_0x3fcd04,_0x445116,_0x4973e6){var _0x4d21a=_0x26d4('0x5a');var _0x14d8a4={'custom':![]};return utilLicense['getLicense']()[_0x26d4('0x2f')](function(_0x558cb6){if(_0x558cb6){_0x14d8a4=_0x558cb6;}return db[_0x26d4('0x36')][_0x26d4('0x51')]({'where':{'id':_0x3fcd04[_0x26d4('0x52')]['id']},'attributes':['logo',_0x26d4('0x58'),'preferred',_0x26d4('0x6b'),'defaultLogo',_0x26d4('0x5d'),_0x26d4('0x5e'),_0x26d4('0x5f')],'raw':!![]});})[_0x26d4('0x2f')](handleEntityNotFound(_0x445116,null))[_0x26d4('0x2f')](function(_0x46d041){if(_0x46d041){var _0xc4358c=_0x46d041[_0x26d4('0x5c')]&&fs[_0x26d4('0x60')](path['join'](config[_0x26d4('0x61')],_0x4d21a,_[_0x26d4('0x62')](_0x46d041['preferred'])))?path['join'](config[_0x26d4('0x61')],_0x4d21a,_['toLower'](_0x46d041[_0x26d4('0x5c')])):path['join'](config[_0x26d4('0x61')],_0x4d21a,_['toLower']('default_preferred.png'));var _0x336f82='default'+_[_0x26d4('0x65')](_0x26d4('0x5c'));if(_0x46d041[_0x336f82]||!_0x14d8a4[_0x26d4('0x66')]||!_0x14d8a4['preferred']){_0xc4358c=path[_0x26d4('0x63')](config[_0x26d4('0x61')],_0x4d21a,_[_0x26d4('0x62')](_0x26d4('0x72')));}if(!fs[_0x26d4('0x60')](_0xc4358c)){throw new db[(_0x26d4('0x67'))][(_0x26d4('0x68'))](_[_0x26d4('0x65')](_0x26d4('0x5c'))+_0x26d4('0x6e'));}return _0x445116[_0x26d4('0x69')](_0xc4358c);}})[_0x26d4('0x20')](handleError(_0x445116,null));};exports[_0x26d4('0x73')]=function(_0x354780,_0x1c9f01,_0x17ceff){if(_0x354780[_0x26d4('0x55')]&&_0x354780[_0x26d4('0x55')][_0x26d4('0x56')]){_0x354780['body'][_0x26d4('0x6b')]=_0x354780[_0x26d4('0x55')]['filename'];}return db[_0x26d4('0x36')][_0x26d4('0x51')]({'where':{'id':_0x354780[_0x26d4('0x52')]['id']}})['then'](handleEntityNotFound(_0x1c9f01,null))[_0x26d4('0x2f')](saveUpdates(_0x354780['body'],null))[_0x26d4('0x2f')](respondWithResult(_0x1c9f01,null))[_0x26d4('0x20')](handleError(_0x1c9f01,null));};var utilLicense=require('../../config/license/util');exports[_0x26d4('0x74')]=function(_0x40ee7b,_0x42eaa3,_0x208394){var _0xc746ba=_0x26d4('0x5a');var _0x2b2e5c={'custom':![]};return utilLicense[_0x26d4('0x5b')]()[_0x26d4('0x2f')](function(_0x2afe1d){if(_0x2afe1d){_0x2b2e5c=_0x2afe1d;}return db[_0x26d4('0x36')]['find']({'where':{'id':_0x40ee7b[_0x26d4('0x52')]['id']},'attributes':[_0x26d4('0x57'),_0x26d4('0x58'),_0x26d4('0x5c'),'favicon',_0x26d4('0x6c'),_0x26d4('0x5d'),_0x26d4('0x5e'),_0x26d4('0x5f')],'raw':!![]});})[_0x26d4('0x2f')](handleEntityNotFound(_0x42eaa3,null))[_0x26d4('0x2f')](function(_0x3309bb){if(_0x3309bb){var _0x5612eb=_0x3309bb[_0x26d4('0x6b')]&&fs[_0x26d4('0x60')](path['join'](config[_0x26d4('0x61')],_0xc746ba,_[_0x26d4('0x62')](_0x3309bb[_0x26d4('0x6b')])))?path[_0x26d4('0x63')](config[_0x26d4('0x61')],_0xc746ba,_[_0x26d4('0x62')](_0x3309bb['favicon'])):path[_0x26d4('0x63')](config[_0x26d4('0x61')],_0xc746ba,_[_0x26d4('0x62')]('default_favicon.ico'));var _0x5bc92d=_0x26d4('0x75')+_[_0x26d4('0x65')](_0x26d4('0x6b'));if(_0x3309bb[_0x5bc92d]||!_0x2b2e5c[_0x26d4('0x66')]){_0x5612eb=path[_0x26d4('0x63')](config['root'],_0xc746ba,_['toLower']('default_favicon.ico'));}if(!fs[_0x26d4('0x60')](_0x5612eb)){throw new db['Sequelize']['ValidationError'](_[_0x26d4('0x65')](_0x26d4('0x6b'))+_0x26d4('0x6e'));}return _0x42eaa3['download'](_0x5612eb);}})[_0x26d4('0x20')](handleError(_0x42eaa3,null));};exports[_0x26d4('0x76')]=function(_0xad37b3,_0x276666){var _0x669c0f={'offset':moment()[_0x26d4('0x77')]()};_0x669c0f[_0x26d4('0x78')]=moment()[_0x26d4('0x77')](_0x669c0f[_0x26d4('0x24')])[_0x26d4('0x79')](_0x26d4('0x7a'));return _0x276666['status'](0xc8)[_0x26d4('0x33')](_0x669c0f);}; \ No newline at end of file +var _0xaafc=['rows','params','length','find','body','addLogo','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','defaultLogo','defaultPreferred','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','request-promise','bluebird','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','sort','where','filter','merge','VIRTUAL','options','Setting','includeAll','include','findAll'];(function(_0x2569d0,_0x4e2953){var _0x4c5555=function(_0x34f5b3){while(--_0x34f5b3){_0x2569d0['push'](_0x2569d0['shift']());}};_0x4c5555(++_0x4e2953);}(_0xaafc,0x18f));var _0xcaaf=function(_0x1da07a,_0x734263){_0x1da07a=_0x1da07a-0x0;var _0x5233e6=_0xaafc[_0x1da07a];return _0x5233e6;};'use strict';var emlformat=require(_0xcaaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcaaf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcaaf('0x2'));var moment=require('moment');var BPromise=require(_0xcaaf('0x3'));var Mustache=require(_0xcaaf('0x4'));var util=require(_0xcaaf('0x5'));var path=require(_0xcaaf('0x6'));var sox=require('sox');var csv=require(_0xcaaf('0x7'));var ejs=require(_0xcaaf('0x8'));var fs=require('fs');var fs_extra=require(_0xcaaf('0x9'));var _=require(_0xcaaf('0xa'));var squel=require('squel');var crypto=require(_0xcaaf('0xb'));var jsforce=require(_0xcaaf('0xc'));var deskjs=require(_0xcaaf('0xd'));var toCsv=require(_0xcaaf('0x7'));var querystring=require(_0xcaaf('0xe'));var Papa=require(_0xcaaf('0xf'));var Redis=require(_0xcaaf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcaaf('0x11'));var as=require(_0xcaaf('0x12'));var hardwareService=require(_0xcaaf('0x13'));var logger=require(_0xcaaf('0x14'))('api');var utils=require(_0xcaaf('0x15'));var config=require(_0xcaaf('0x16'));var licenseUtil=require(_0xcaaf('0x17'));var db=require(_0xcaaf('0x18'))['db'];var jayson=require(_0xcaaf('0x19'));var client=jayson[_0xcaaf('0x1a')][_0xcaaf('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1bd138,_0x5009e9,_0x3d442b,_0x2df79f){return new BPromise(function(_0x2491df,_0x106656){var _0x3f10e2=_0x2df79f||client;return _0x3f10e2[_0xcaaf('0x1c')](_0x1bd138,_0x3d442b)['then'](function(_0x5b9537){logger['info'](_0xcaaf('0x1d'),_0x5009e9,_0xcaaf('0x1e'));logger[_0xcaaf('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x5009e9,'request\x20sent',JSON[_0xcaaf('0x20')](_0x5b9537));if(_0x5b9537['error']){if(_0x5b9537[_0xcaaf('0x21')][_0xcaaf('0x22')]===0x1f4){logger[_0xcaaf('0x21')]('Setting,\x20%s,\x20%s',_0x5009e9,_0x5b9537['error']['message']);return _0x106656(_0x5b9537[_0xcaaf('0x21')][_0xcaaf('0x23')]);}logger['error'](_0xcaaf('0x1d'),_0x5009e9,_0x5b9537[_0xcaaf('0x21')][_0xcaaf('0x23')]);return _0x2491df(_0x5b9537[_0xcaaf('0x21')][_0xcaaf('0x23')]);}else{logger['info'](_0xcaaf('0x1d'),_0x5009e9,_0xcaaf('0x1e'));_0x2491df(_0x5b9537['result'][_0xcaaf('0x23')]);}})[_0xcaaf('0x24')](function(_0x4973a3){logger[_0xcaaf('0x21')]('Setting,\x20%s,\x20%s',_0x5009e9,_0x4973a3);_0x106656(_0x4973a3);});});}function respondWithStatusCode(_0x1a4805,_0x523480){_0x523480=_0x523480||0xcc;return function(_0x6c3bc){if(_0x6c3bc){return _0x1a4805[_0xcaaf('0x25')](_0x523480);}return _0x1a4805['status'](_0x523480)[_0xcaaf('0x26')]();};}function respondWithResult(_0x20480a,_0x48c899){_0x48c899=_0x48c899||0xc8;return function(_0x14469d){if(_0x14469d){return _0x20480a['status'](_0x48c899)[_0xcaaf('0x27')](_0x14469d);}};}function respondWithFilteredResult(_0x271557,_0xae97fc){return function(_0x4d19be){if(_0x4d19be){var _0x19db65=typeof _0xae97fc[_0xcaaf('0x28')]===_0xcaaf('0x29')&&typeof _0xae97fc[_0xcaaf('0x2a')]===_0xcaaf('0x29');var _0x208f04=_0x4d19be[_0xcaaf('0x2b')];var _0x799bb5=_0x19db65?0x0:_0xae97fc['offset'];var _0x86d16c=_0x19db65?_0x4d19be[_0xcaaf('0x2b')]:_0xae97fc['offset']+_0xae97fc[_0xcaaf('0x2a')];var _0x14ab02;if(_0x86d16c>=_0x208f04){_0x86d16c=_0x208f04;_0x14ab02=0xc8;}else{_0x14ab02=0xce;}_0x271557[_0xcaaf('0x2c')](_0x14ab02);return _0x271557['set'](_0xcaaf('0x2d'),_0x799bb5+'-'+_0x86d16c+'/'+_0x208f04)['json'](_0x4d19be);}return null;};}function patchUpdates(_0x2d7316){return function(_0x1d3454){try{jsonpatch[_0xcaaf('0x2e')](_0x1d3454,_0x2d7316,!![]);}catch(_0x26cd9f){return BPromise['reject'](_0x26cd9f);}return _0x1d3454[_0xcaaf('0x2f')]();};}function saveUpdates(_0x11e509,_0x2f5727){return function(_0x214227){if(_0x214227){return _0x214227[_0xcaaf('0x30')](_0x11e509)['then'](function(_0x34a47e){return _0x34a47e;});}return null;};}function removeEntity(_0xa615a6,_0x5e2c80){return function(_0x53c3ea){if(_0x53c3ea){return _0x53c3ea[_0xcaaf('0x31')]()[_0xcaaf('0x32')](function(){_0xa615a6[_0xcaaf('0x2c')](0xcc)[_0xcaaf('0x26')]();});}};}function handleEntityNotFound(_0x57774f,_0x57e376){return function(_0x5615d3){if(!_0x5615d3){_0x57774f[_0xcaaf('0x25')](0x194);}return _0x5615d3;};}function handleError(_0x310112,_0x24cf44){_0x24cf44=_0x24cf44||0x1f4;return function(_0x326114){logger[_0xcaaf('0x21')](_0x326114[_0xcaaf('0x33')]);if(_0x326114['name']){delete _0x326114[_0xcaaf('0x34')];}_0x310112['status'](_0x24cf44)[_0xcaaf('0x35')](_0x326114);};}exports[_0xcaaf('0x36')]=function(_0x24e5c8,_0x524d70){var _0x4156e2={},_0x210bed={},_0x3761ce={'count':0x0,'rows':[]};var _0x226fc3=_['map'](db['Setting'][_0xcaaf('0x37')],function(_0x4eb9e0){return{'name':_0x4eb9e0[_0xcaaf('0x38')],'type':_0x4eb9e0[_0xcaaf('0x39')][_0xcaaf('0x3a')]};});_0x210bed[_0xcaaf('0x3b')]=_[_0xcaaf('0x3c')](_0x226fc3,'name');_0x210bed['query']=_[_0xcaaf('0x3d')](_0x24e5c8[_0xcaaf('0x3e')]);_0x210bed[_0xcaaf('0x3f')]=_[_0xcaaf('0x40')](_0x210bed[_0xcaaf('0x3b')],_0x210bed['query']);_0x4156e2[_0xcaaf('0x41')]=_['intersection'](_0x210bed[_0xcaaf('0x3b')],qs[_0xcaaf('0x42')](_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x42')]));_0x4156e2['attributes']=_0x4156e2['attributes']['length']?_0x4156e2[_0xcaaf('0x41')]:_0x210bed['model'];if(!_0x24e5c8[_0xcaaf('0x3e')]['hasOwnProperty']('nolimit')){_0x4156e2['limit']=qs['limit'](_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x2a')]);_0x4156e2[_0xcaaf('0x28')]=qs['offset'](_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x28')]);}_0x4156e2['order']=qs[_0xcaaf('0x43')](_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x43')]);_0x4156e2[_0xcaaf('0x44')]=qs['filters'](_['pick'](_0x24e5c8[_0xcaaf('0x3e')],_0x210bed[_0xcaaf('0x3f')]),_0x226fc3);if(_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x45')]){_0x4156e2['where']=_[_0xcaaf('0x46')](_0x4156e2['where'],{'$or':_[_0xcaaf('0x3c')](_0x226fc3,function(_0x21b5fc){if(_0x21b5fc[_0xcaaf('0x39')]!==_0xcaaf('0x47')){var _0x1d5971={};_0x1d5971[_0x21b5fc[_0xcaaf('0x34')]]={'$like':'%'+_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x45')]+'%'};return _0x1d5971;}})});}_0x4156e2=_[_0xcaaf('0x46')]({},_0x4156e2,_0x24e5c8[_0xcaaf('0x48')]);var _0x14dda8={'where':_0x4156e2['where']};return db[_0xcaaf('0x49')][_0xcaaf('0x2b')](_0x14dda8)['then'](function(_0x185f25){_0x3761ce['count']=_0x185f25;if(_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x4a')]){_0x4156e2[_0xcaaf('0x4b')]=[{'all':!![]}];}return db[_0xcaaf('0x49')][_0xcaaf('0x4c')](_0x4156e2);})[_0xcaaf('0x32')](function(_0x1c0179){_0x3761ce[_0xcaaf('0x4d')]=_0x1c0179;return _0x3761ce;})[_0xcaaf('0x32')](respondWithFilteredResult(_0x524d70,_0x4156e2))[_0xcaaf('0x24')](handleError(_0x524d70,null));};exports['show']=function(_0x57c09b,_0x472a00){var _0xedb069={'raw':![],'where':{'id':_0x57c09b[_0xcaaf('0x4e')]['id']}},_0x2127f1={};_0x2127f1[_0xcaaf('0x3b')]=_[_0xcaaf('0x3d')](db[_0xcaaf('0x49')][_0xcaaf('0x37')]);_0x2127f1['query']=_[_0xcaaf('0x3d')](_0x57c09b[_0xcaaf('0x3e')]);_0x2127f1['filters']=_[_0xcaaf('0x40')](_0x2127f1[_0xcaaf('0x3b')],_0x2127f1[_0xcaaf('0x3e')]);_0xedb069[_0xcaaf('0x41')]=_[_0xcaaf('0x40')](_0x2127f1[_0xcaaf('0x3b')],qs[_0xcaaf('0x42')](_0x57c09b[_0xcaaf('0x3e')][_0xcaaf('0x42')]));_0xedb069[_0xcaaf('0x41')]=_0xedb069[_0xcaaf('0x41')][_0xcaaf('0x4f')]?_0xedb069['attributes']:_0x2127f1[_0xcaaf('0x3b')];if(_0x57c09b[_0xcaaf('0x3e')][_0xcaaf('0x4a')]){_0xedb069[_0xcaaf('0x4b')]=[{'all':!![]}];}_0xedb069=_[_0xcaaf('0x46')]({},_0xedb069,_0x57c09b[_0xcaaf('0x48')]);return db[_0xcaaf('0x49')][_0xcaaf('0x50')](_0xedb069)[_0xcaaf('0x32')](handleEntityNotFound(_0x472a00,null))['then'](respondWithResult(_0x472a00,null))[_0xcaaf('0x24')](handleError(_0x472a00,null));};exports[_0xcaaf('0x30')]=function(_0x3eb140,_0xcdf3fc){if(_0x3eb140[_0xcaaf('0x51')]['id']){delete _0x3eb140[_0xcaaf('0x51')]['id'];}return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x3eb140[_0xcaaf('0x4e')]['id']}})[_0xcaaf('0x32')](handleEntityNotFound(_0xcdf3fc,null))[_0xcaaf('0x32')](saveUpdates(_0x3eb140[_0xcaaf('0x51')],null))[_0xcaaf('0x32')](respondWithResult(_0xcdf3fc,null))[_0xcaaf('0x24')](handleError(_0xcdf3fc,null));};exports[_0xcaaf('0x52')]=function(_0x57fbce,_0x234189,_0x4d4888){if(_0x57fbce[_0xcaaf('0x53')]&&_0x57fbce[_0xcaaf('0x53')][_0xcaaf('0x54')]){_0x57fbce['body'][_0xcaaf('0x55')]=_0x57fbce['file']['filename'];}return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x57fbce[_0xcaaf('0x4e')]['id']}})[_0xcaaf('0x32')](handleEntityNotFound(_0x234189,null))[_0xcaaf('0x32')](saveUpdates(_0x57fbce['body'],null))['then'](respondWithResult(_0x234189,null))[_0xcaaf('0x24')](handleError(_0x234189,null));};exports[_0xcaaf('0x56')]=function(_0x14173f,_0x47a73a,_0x5c80b3){if(_0x14173f[_0xcaaf('0x53')]&&_0x14173f[_0xcaaf('0x53')][_0xcaaf('0x54')]){_0x14173f[_0xcaaf('0x51')]['loginLogo']=_0x14173f['file'][_0xcaaf('0x54')];}return db['Setting'][_0xcaaf('0x50')]({'where':{'id':_0x14173f['params']['id']}})['then'](handleEntityNotFound(_0x47a73a,null))[_0xcaaf('0x32')](saveUpdates(_0x14173f[_0xcaaf('0x51')],null))[_0xcaaf('0x32')](respondWithResult(_0x47a73a,null))['catch'](handleError(_0x47a73a,null));};var utilLicense=require(_0xcaaf('0x17'));exports[_0xcaaf('0x57')]=function(_0x5ac758,_0x2c27db,_0x541863){var _0x1a1ec3=_0xcaaf('0x58');var _0x202297={'custom':![]};return utilLicense[_0xcaaf('0x59')]()['then'](function(_0x1a52b3){if(_0x1a52b3){_0x202297=_0x1a52b3;}return db[_0xcaaf('0x49')]['find']({'where':{'id':_0x5ac758[_0xcaaf('0x4e')]['id']},'attributes':[_0xcaaf('0x55'),_0xcaaf('0x5a'),_0xcaaf('0x5b'),_0xcaaf('0x5c'),'defaultLogo',_0xcaaf('0x5d'),'defaultPreferred',_0xcaaf('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x2c27db,null))[_0xcaaf('0x32')](function(_0x48ce22){if(_0x48ce22){var _0x17e7c9=_0x48ce22[_0xcaaf('0x55')]&&fs[_0xcaaf('0x5f')](path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x1a1ec3,_[_0xcaaf('0x62')](_0x48ce22[_0xcaaf('0x55')])))?path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x1a1ec3,_[_0xcaaf('0x62')](_0x48ce22[_0xcaaf('0x55')])):path[_0xcaaf('0x60')](config['root'],_0x1a1ec3,_['toLower'](_0xcaaf('0x63')));var _0x419394=_0xcaaf('0x64')+_[_0xcaaf('0x65')](_0xcaaf('0x55'));if(_0x48ce22[_0x419394]||!_0x202297[_0xcaaf('0x66')]){_0x17e7c9=path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x1a1ec3,_['toLower'](_0xcaaf('0x63')));}if(!fs[_0xcaaf('0x5f')](_0x17e7c9)){throw new db[(_0xcaaf('0x67'))][(_0xcaaf('0x68'))](_['upperFirst'](_0xcaaf('0x55'))+'\x20not\x20found');}return _0x2c27db[_0xcaaf('0x69')](_0x17e7c9);}})[_0xcaaf('0x24')](handleError(_0x2c27db,null));};var utilLicense=require(_0xcaaf('0x17'));exports[_0xcaaf('0x6a')]=function(_0x27b1c8,_0x49c08c,_0x239b36){var _0x3b52d3=_0xcaaf('0x58');var _0x1e9d65={'custom':![]};return utilLicense[_0xcaaf('0x59')]()['then'](function(_0x1b1165){if(_0x1b1165){_0x1e9d65=_0x1b1165;}return db['Setting'][_0xcaaf('0x50')]({'where':{'id':_0x27b1c8[_0xcaaf('0x4e')]['id']},'attributes':['logo',_0xcaaf('0x5a'),_0xcaaf('0x5b'),'favicon',_0xcaaf('0x6b'),_0xcaaf('0x5d'),_0xcaaf('0x6c'),_0xcaaf('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x49c08c,null))[_0xcaaf('0x32')](function(_0x4cd0ba){if(_0x4cd0ba){var _0x5bfa5b=_0x4cd0ba['loginLogo']&&fs[_0xcaaf('0x5f')](path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x3b52d3,_[_0xcaaf('0x62')](_0x4cd0ba[_0xcaaf('0x5a')])))?path[_0xcaaf('0x60')](config['root'],_0x3b52d3,_[_0xcaaf('0x62')](_0x4cd0ba[_0xcaaf('0x5a')])):path['join'](config[_0xcaaf('0x61')],_0x3b52d3,_[_0xcaaf('0x62')]('default_loginLogo.svg'));var _0x4eb5bf='default'+_['upperFirst'](_0xcaaf('0x5a'));if(_0x4cd0ba[_0x4eb5bf]||!_0x1e9d65[_0xcaaf('0x66')]){_0x5bfa5b=path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x3b52d3,_[_0xcaaf('0x62')]('default_loginLogo.svg'));}if(!fs[_0xcaaf('0x5f')](_0x5bfa5b)){throw new db['Sequelize'][(_0xcaaf('0x68'))](_['upperFirst']('loginLogo')+_0xcaaf('0x6d'));}return _0x49c08c[_0xcaaf('0x69')](_0x5bfa5b);}})[_0xcaaf('0x24')](handleError(_0x49c08c,null));};exports[_0xcaaf('0x6e')]=function(_0x3bcc5f,_0x46cefb){return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x3bcc5f['params']['id']},'attributes':[_0xcaaf('0x6f')]})[_0xcaaf('0x32')](respondWithResult(_0x46cefb,null))[_0xcaaf('0x24')](handleError(_0x46cefb,null));};exports[_0xcaaf('0x70')]=function(_0x1fbdf1,_0x20bdc0,_0x2e774c){if(_0x1fbdf1[_0xcaaf('0x53')]&&_0x1fbdf1[_0xcaaf('0x53')][_0xcaaf('0x54')]){_0x1fbdf1[_0xcaaf('0x51')][_0xcaaf('0x5b')]=_0x1fbdf1[_0xcaaf('0x53')]['filename'];}return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x1fbdf1[_0xcaaf('0x4e')]['id']}})['then'](handleEntityNotFound(_0x20bdc0,null))[_0xcaaf('0x32')](saveUpdates(_0x1fbdf1['body'],null))['then'](respondWithResult(_0x20bdc0,null))[_0xcaaf('0x24')](handleError(_0x20bdc0,null));};var utilLicense=require(_0xcaaf('0x17'));exports[_0xcaaf('0x71')]=function(_0x4dee30,_0x2a0e9c,_0xc5d2c6){var _0x3166e6=_0xcaaf('0x58');var _0x1b1e62={'custom':![]};return utilLicense[_0xcaaf('0x59')]()['then'](function(_0x35e49c){if(_0x35e49c){_0x1b1e62=_0x35e49c;}return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x4dee30['params']['id']},'attributes':[_0xcaaf('0x55'),_0xcaaf('0x5a'),_0xcaaf('0x5b'),_0xcaaf('0x5c'),_0xcaaf('0x6b'),_0xcaaf('0x5d'),_0xcaaf('0x6c'),_0xcaaf('0x5e')],'raw':!![]});})[_0xcaaf('0x32')](handleEntityNotFound(_0x2a0e9c,null))[_0xcaaf('0x32')](function(_0x39265b){if(_0x39265b){var _0x5adec6=_0x39265b[_0xcaaf('0x5b')]&&fs[_0xcaaf('0x5f')](path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x3166e6,_['toLower'](_0x39265b[_0xcaaf('0x5b')])))?path['join'](config[_0xcaaf('0x61')],_0x3166e6,_[_0xcaaf('0x62')](_0x39265b[_0xcaaf('0x5b')])):path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x3166e6,_['toLower']('default_preferred.png'));var _0x105cb6=_0xcaaf('0x64')+_['upperFirst'](_0xcaaf('0x5b'));if(_0x39265b[_0x105cb6]||!_0x1b1e62['custom']||!_0x1b1e62[_0xcaaf('0x5b')]){_0x5adec6=path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x3166e6,_[_0xcaaf('0x62')](_0xcaaf('0x72')));}if(!fs[_0xcaaf('0x5f')](_0x5adec6)){throw new db[(_0xcaaf('0x67'))][(_0xcaaf('0x68'))](_[_0xcaaf('0x65')](_0xcaaf('0x5b'))+_0xcaaf('0x6d'));}return _0x2a0e9c[_0xcaaf('0x69')](_0x5adec6);}})[_0xcaaf('0x24')](handleError(_0x2a0e9c,null));};exports['addFavicon']=function(_0x57e3dc,_0x1c2fac,_0x153674){if(_0x57e3dc[_0xcaaf('0x53')]&&_0x57e3dc[_0xcaaf('0x53')]['filename']){_0x57e3dc[_0xcaaf('0x51')][_0xcaaf('0x5c')]=_0x57e3dc[_0xcaaf('0x53')][_0xcaaf('0x54')];}return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x57e3dc[_0xcaaf('0x4e')]['id']}})[_0xcaaf('0x32')](handleEntityNotFound(_0x1c2fac,null))[_0xcaaf('0x32')](saveUpdates(_0x57e3dc['body'],null))[_0xcaaf('0x32')](respondWithResult(_0x1c2fac,null))['catch'](handleError(_0x1c2fac,null));};var utilLicense=require(_0xcaaf('0x17'));exports['getFavicon']=function(_0x516832,_0x33c027,_0x3c98b2){var _0x4c98ec='server/files/images/logos';var _0x2ae4e4={'custom':![]};return utilLicense[_0xcaaf('0x59')]()[_0xcaaf('0x32')](function(_0x3f15cd){if(_0x3f15cd){_0x2ae4e4=_0x3f15cd;}return db[_0xcaaf('0x49')]['find']({'where':{'id':_0x516832[_0xcaaf('0x4e')]['id']},'attributes':['logo','loginLogo',_0xcaaf('0x5b'),_0xcaaf('0x5c'),_0xcaaf('0x6b'),'defaultLoginLogo',_0xcaaf('0x6c'),'defaultFavicon'],'raw':!![]});})[_0xcaaf('0x32')](handleEntityNotFound(_0x33c027,null))[_0xcaaf('0x32')](function(_0x4c2f3e){if(_0x4c2f3e){var _0x50cb0f=_0x4c2f3e[_0xcaaf('0x5c')]&&fs[_0xcaaf('0x5f')](path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x4c98ec,_[_0xcaaf('0x62')](_0x4c2f3e[_0xcaaf('0x5c')])))?path['join'](config['root'],_0x4c98ec,_[_0xcaaf('0x62')](_0x4c2f3e[_0xcaaf('0x5c')])):path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x4c98ec,_[_0xcaaf('0x62')](_0xcaaf('0x73')));var _0x5b8042=_0xcaaf('0x64')+_[_0xcaaf('0x65')](_0xcaaf('0x5c'));if(_0x4c2f3e[_0x5b8042]||!_0x2ae4e4[_0xcaaf('0x66')]){_0x50cb0f=path['join'](config[_0xcaaf('0x61')],_0x4c98ec,_[_0xcaaf('0x62')](_0xcaaf('0x73')));}if(!fs[_0xcaaf('0x5f')](_0x50cb0f)){throw new db[(_0xcaaf('0x67'))]['ValidationError'](_[_0xcaaf('0x65')]('favicon')+'\x20not\x20found');}return _0x33c027['download'](_0x50cb0f);}})['catch'](handleError(_0x33c027,null));};exports['getDate']=function(_0x223d8a,_0x4c9e1b){var _0x5cae69={'offset':moment()['utcOffset']()};_0x5cae69['now']=moment()[_0xcaaf('0x74')](_0x5cae69[_0xcaaf('0x28')])[_0xcaaf('0x75')](_0xcaaf('0x76'));return _0x4c9e1b[_0xcaaf('0x2c')](0xc8)[_0xcaaf('0x35')](_0x5cae69);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 1796611..57375c4 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 _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0xeec628,_0x409553){var _0x15dd94=function(_0x35d5de){while(--_0x35d5de){_0xeec628['push'](_0xeec628['shift']());}};_0x15dd94(++_0x409553);}(_0x34e8,0x12c));var _0x834e=function(_0xb0b3ff,_0x137489){_0xb0b3ff=_0xb0b3ff-0x0;var _0x1a38da=_0x34e8[_0xb0b3ff];return _0x1a38da;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0x008c,0x188));var _0xc008=function(_0x49f19e,_0x1c3aa3){_0x49f19e=_0x49f19e-0x0;var _0x280b5a=_0x008c[_0x49f19e];return _0x280b5a;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 615cda7..2b99a78 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 _0x76c3=['jayson/promise','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','ShowSetting','Setting','find','options','raw','where','include','model','attributes','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x20fc0d,_0x21256c){var _0x3dc6b3=function(_0x251bbb){while(--_0x251bbb){_0x20fc0d['push'](_0x20fc0d['shift']());}};_0x3dc6b3(++_0x21256c);}(_0x76c3,0xb3));var _0x376c=function(_0x4b6eb7,_0x27abf2){_0x4b6eb7=_0x4b6eb7-0x0;var _0x320362=_0x76c3[_0x4b6eb7];return _0x320362;};'use strict';var _=require(_0x376c('0x0'));var util=require(_0x376c('0x1'));var moment=require(_0x376c('0x2'));var BPromise=require(_0x376c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x376c('0x4'));var db=require(_0x376c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x376c('0x6'));var config=require('../../config/environment');var jayson=require(_0x376c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59aaad,_0x444392,_0x47e818){return new BPromise(function(_0x421063,_0x159ba6){return client[_0x376c('0x8')](_0x59aaad,_0x47e818)[_0x376c('0x9')](function(_0x30f2eb){logger[_0x376c('0xa')](_0x376c('0xb'),_0x444392,_0x376c('0xc'));logger[_0x376c('0xd')](_0x376c('0xe'),_0x444392,_0x376c('0xc'),JSON[_0x376c('0xf')](_0x30f2eb));if(_0x30f2eb['error']){if(_0x30f2eb['error'][_0x376c('0x10')]===0x1f4){logger['error'](_0x376c('0xb'),_0x444392,_0x30f2eb[_0x376c('0x11')][_0x376c('0x12')]);return _0x159ba6(_0x30f2eb['error']['message']);}logger[_0x376c('0x11')](_0x376c('0xb'),_0x444392,_0x30f2eb[_0x376c('0x11')]['message']);return _0x421063(_0x30f2eb[_0x376c('0x11')][_0x376c('0x12')]);}else{logger[_0x376c('0xa')](_0x376c('0xb'),_0x444392,'request\x20sent');_0x421063(_0x30f2eb[_0x376c('0x13')][_0x376c('0x12')]);}})[_0x376c('0x14')](function(_0x5ef146){logger[_0x376c('0x11')](_0x376c('0xb'),_0x444392,_0x5ef146);_0x159ba6(_0x5ef146);});});}exports[_0x376c('0x15')]=function(_0x1ba31d){var _0x45a3a1=this;return new Promise(function(_0x2fdb49,_0x18cd69){return db[_0x376c('0x16')][_0x376c('0x17')]({'raw':_0x1ba31d[_0x376c('0x18')]?_0x1ba31d['options'][_0x376c('0x19')]===undefined?!![]:![]:!![],'where':_0x1ba31d[_0x376c('0x18')]?_0x1ba31d[_0x376c('0x18')][_0x376c('0x1a')]||null:null,'attributes':_0x1ba31d['options']?_0x1ba31d[_0x376c('0x18')]['attributes']||null:null,'include':_0x1ba31d['options']?_0x1ba31d['options'][_0x376c('0x1b')]?_['map'](_0x1ba31d[_0x376c('0x18')][_0x376c('0x1b')],function(_0x231c38){return{'model':db[_0x231c38[_0x376c('0x1c')]],'as':_0x231c38['as'],'attributes':_0x231c38[_0x376c('0x1d')],'include':_0x231c38['include']?_[_0x376c('0x1e')](_0x231c38['include'],function(_0x367db6){return{'model':db[_0x367db6[_0x376c('0x1c')]],'as':_0x367db6['as'],'attributes':_0x367db6['attributes'],'include':_0x367db6[_0x376c('0x1b')]?_[_0x376c('0x1e')](_0x367db6[_0x376c('0x1b')],function(_0x49352a){return{'model':db[_0x49352a['model']],'as':_0x49352a['as'],'attributes':_0x49352a['attributes']};}):[]};}):[]};}):[]:[]})[_0x376c('0x9')](function(_0x54cacb){logger[_0x376c('0xa')](_0x376c('0x15'),_0x1ba31d);logger[_0x376c('0xd')](_0x376c('0x15'),_0x1ba31d,JSON[_0x376c('0xf')](_0x54cacb));_0x2fdb49(_0x54cacb);})[_0x376c('0x14')](function(_0x48a406){logger['error']('ShowSetting',_0x48a406[_0x376c('0x12')],_0x1ba31d);_0x18cd69(_0x45a3a1['error'](0x1f4,_0x48a406[_0x376c('0x12')]));});});}; \ No newline at end of file +var _0xfa4b=['map','include','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes'];(function(_0x7d6674,_0x2c9e4d){var _0x10825c=function(_0x517abf){while(--_0x517abf){_0x7d6674['push'](_0x7d6674['shift']());}};_0x10825c(++_0x2c9e4d);}(_0xfa4b,0xcf));var _0xbfa4=function(_0x58d585,_0x27dffb){_0x58d585=_0x58d585-0x0;var _0x47ab48=_0xfa4b[_0x58d585];return _0x47ab48;};'use strict';var _=require(_0xbfa4('0x0'));var util=require(_0xbfa4('0x1'));var moment=require(_0xbfa4('0x2'));var BPromise=require('bluebird');var rs=require(_0xbfa4('0x3'));var fs=require('fs');var Redis=require(_0xbfa4('0x4'));var db=require(_0xbfa4('0x5'))['db'];var utils=require(_0xbfa4('0x6'));var logger=require('../../config/logger')(_0xbfa4('0x7'));var config=require(_0xbfa4('0x8'));var jayson=require(_0xbfa4('0x9'));var client=jayson[_0xbfa4('0xa')][_0xbfa4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a19e9,_0x9a06a3,_0x280f0c){return new BPromise(function(_0x4dbf9b,_0x3e7d8c){return client['request'](_0x3a19e9,_0x280f0c)[_0xbfa4('0xc')](function(_0x61d3d9){logger[_0xbfa4('0xd')](_0xbfa4('0xe'),_0x9a06a3,'request\x20sent');logger[_0xbfa4('0xf')](_0xbfa4('0x10'),_0x9a06a3,_0xbfa4('0x11'),JSON[_0xbfa4('0x12')](_0x61d3d9));if(_0x61d3d9['error']){if(_0x61d3d9[_0xbfa4('0x13')][_0xbfa4('0x14')]===0x1f4){logger['error'](_0xbfa4('0xe'),_0x9a06a3,_0x61d3d9[_0xbfa4('0x13')][_0xbfa4('0x15')]);return _0x3e7d8c(_0x61d3d9['error'][_0xbfa4('0x15')]);}logger[_0xbfa4('0x13')](_0xbfa4('0xe'),_0x9a06a3,_0x61d3d9[_0xbfa4('0x13')]['message']);return _0x4dbf9b(_0x61d3d9[_0xbfa4('0x13')][_0xbfa4('0x15')]);}else{logger[_0xbfa4('0xd')]('Setting,\x20%s,\x20%s',_0x9a06a3,_0xbfa4('0x11'));_0x4dbf9b(_0x61d3d9[_0xbfa4('0x16')][_0xbfa4('0x15')]);}})[_0xbfa4('0x17')](function(_0x7e9cf3){logger[_0xbfa4('0x13')](_0xbfa4('0xe'),_0x9a06a3,_0x7e9cf3);_0x3e7d8c(_0x7e9cf3);});});}exports[_0xbfa4('0x18')]=function(_0xfe64bc){var _0x2a3072=this;return new Promise(function(_0x399e7e,_0x2e43b9){return db[_0xbfa4('0x19')][_0xbfa4('0x1a')]({'raw':_0xfe64bc[_0xbfa4('0x1b')]?_0xfe64bc[_0xbfa4('0x1b')][_0xbfa4('0x1c')]===undefined?!![]:![]:!![],'where':_0xfe64bc[_0xbfa4('0x1b')]?_0xfe64bc[_0xbfa4('0x1b')][_0xbfa4('0x1d')]||null:null,'attributes':_0xfe64bc['options']?_0xfe64bc['options'][_0xbfa4('0x1e')]||null:null,'include':_0xfe64bc[_0xbfa4('0x1b')]?_0xfe64bc[_0xbfa4('0x1b')]['include']?_[_0xbfa4('0x1f')](_0xfe64bc[_0xbfa4('0x1b')][_0xbfa4('0x20')],function(_0x482719){return{'model':db[_0x482719[_0xbfa4('0x21')]],'as':_0x482719['as'],'attributes':_0x482719[_0xbfa4('0x1e')],'include':_0x482719[_0xbfa4('0x20')]?_['map'](_0x482719[_0xbfa4('0x20')],function(_0x34a392){return{'model':db[_0x34a392[_0xbfa4('0x21')]],'as':_0x34a392['as'],'attributes':_0x34a392[_0xbfa4('0x1e')],'include':_0x34a392['include']?_[_0xbfa4('0x1f')](_0x34a392[_0xbfa4('0x20')],function(_0x240533){return{'model':db[_0x240533[_0xbfa4('0x21')]],'as':_0x240533['as'],'attributes':_0x240533[_0xbfa4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbfa4('0xc')](function(_0x59ff0b){logger[_0xbfa4('0xd')](_0xbfa4('0x18'),_0xfe64bc);logger[_0xbfa4('0xf')](_0xbfa4('0x18'),_0xfe64bc,JSON['stringify'](_0x59ff0b));_0x399e7e(_0x59ff0b);})['catch'](function(_0x4f5730){logger[_0xbfa4('0x13')]('ShowSetting',_0x4f5730['message'],_0xfe64bc);_0x2e43b9(_0x2a3072[_0xbfa4('0x13')](0x1f4,_0x4f5730[_0xbfa4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index c1610a2..6414f21 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 _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7217,0x19e));var _0x7721=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x7217[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x43b106,_0x255209){var _0x1157ec=function(_0x2593f7){while(--_0x2593f7){_0x43b106['push'](_0x43b106['shift']());}};_0x1157ec(++_0x255209);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 4433f60..6607b9f 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 _0xd6ed=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','connectel','clicksend','bandwidth','intelepeer'];(function(_0x2d9622,_0x1ab86b){var _0x2a0e02=function(_0x199be9){while(--_0x199be9){_0x2d9622['push'](_0x2d9622['shift']());}};_0x2a0e02(++_0x1ab86b);}(_0xd6ed,0x184));var _0xdd6e=function(_0xd8bf51,_0x3185ef){_0xd8bf51=_0xd8bf51-0x0;var _0x39c79b=_0xd6ed[_0xd8bf51];return _0x39c79b;};'use strict';var Sequelize=require(_0xdd6e('0x0'));var rs=require(_0xdd6e('0x1'));module[_0xdd6e('0x2')]={'name':{'type':Sequelize[_0xdd6e('0x3')],'unique':_0xdd6e('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xdd6e('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xdd6e('0x5')]();}},'phone':{'type':Sequelize[_0xdd6e('0x3')]},'type':{'type':Sequelize[_0xdd6e('0x6')](_0xdd6e('0x7'),'skebby',_0xdd6e('0x8'),_0xdd6e('0x9'),'plivo','clickatell',_0xdd6e('0xa'),'csc','infobip',_0xdd6e('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xdd6e('0x3')]},'authToken':{'type':Sequelize[_0xdd6e('0x3')]},'smsMethod':{'type':Sequelize[_0xdd6e('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xdd6e('0x3')]},'password':{'type':Sequelize[_0xdd6e('0x3')]},'apiKey':{'type':Sequelize[_0xdd6e('0x3')]},'applicationId':{'type':Sequelize[_0xdd6e('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xdd6e('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xdd6e('0x3')]},'notificationTemplate':{'type':Sequelize[_0xdd6e('0xc')],'defaultValue':function(){return _0xdd6e('0xd');}},'notificationSound':{'type':Sequelize[_0xdd6e('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdd6e('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdd6e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdd6e('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdd6e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdd6e('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdd6e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xdd6e('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xdd6e('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xdd6e('0xe')],'defaultValue':![],'comment':_0xdd6e('0x11'),'set':function(_0x1cd2a8){if(!_0x1cd2a8)this[_0xdd6e('0x12')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xdd6e('0x13'),_0x1cd2a8);}}}; \ No newline at end of file +var _0x85ce=['connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM'];(function(_0x5cee53,_0x16d99d){var _0x474479=function(_0x403385){while(--_0x403385){_0x5cee53['push'](_0x5cee53['shift']());}};_0x474479(++_0x16d99d);}(_0x85ce,0x106));var _0xe85c=function(_0x47de17,_0x17c4f){_0x47de17=_0x47de17-0x0;var _0x18ad38=_0x85ce[_0x47de17];return _0x18ad38;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xe85c('0x0')]={'name':{'type':Sequelize[_0xe85c('0x1')],'unique':_0xe85c('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xe85c('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xe85c('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xe85c('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xe85c('0x1')]},'type':{'type':Sequelize[_0xe85c('0x3')]('twilio','skebby',_0xe85c('0x4'),_0xe85c('0x5'),_0xe85c('0x6'),'clickatell',_0xe85c('0x7'),_0xe85c('0x8'),_0xe85c('0x9'),_0xe85c('0xa'))},'accountSid':{'type':Sequelize[_0xe85c('0x1')]},'authId':{'type':Sequelize[_0xe85c('0x1')]},'authToken':{'type':Sequelize[_0xe85c('0x1')]},'smsMethod':{'type':Sequelize[_0xe85c('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0xe85c('0x1')]},'password':{'type':Sequelize[_0xe85c('0x1')]},'apiKey':{'type':Sequelize[_0xe85c('0x1')]},'applicationId':{'type':Sequelize[_0xe85c('0x1')]},'accountId':{'type':Sequelize[_0xe85c('0x1')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xe85c('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xe85c('0x1')]},'notificationTemplate':{'type':Sequelize[_0xe85c('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe85c('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe85c('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe85c('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe85c('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe85c('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe85c('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xe85c('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe85c('0xd')],'comment':_0xe85c('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xe85c('0xb')],'defaultValue':![],'comment':_0xe85c('0xf'),'set':function(_0x4ff8f8){if(!_0x4ff8f8)this[_0xe85c('0x10')](_0xe85c('0x11'),null);this['setDataValue'](_0xe85c('0x12'),_0x4ff8f8);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 5f7d1ab..cc21bd1 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 _0xcf20=['query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','show','params','rawAttributes','length','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','SmsAccountId','Disposition','findOne','hasOwnProperty','includeAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','mobile','from','From','MessageSid','skebby','text','connectel','messageId','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','ListId','Contacts','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','clicksend','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','type','model'];(function(_0x4c3f22,_0x9d8899){var _0x1c54e8=function(_0x43aeef){while(--_0x43aeef){_0x4c3f22['push'](_0x4c3f22['shift']());}};_0x1c54e8(++_0x9d8899);}(_0xcf20,0xa0));var _0x0cf2=function(_0x17d1fe,_0x19eb3d){_0x17d1fe=_0x17d1fe-0x0;var _0x3bf3ae=_0xcf20[_0x17d1fe];return _0x3bf3ae;};'use strict';var emlformat=require(_0x0cf2('0x0'));var rimraf=require(_0x0cf2('0x1'));var zipdir=require(_0x0cf2('0x2'));var jsonpatch=require(_0x0cf2('0x3'));var rp=require(_0x0cf2('0x4'));var moment=require(_0x0cf2('0x5'));var BPromise=require(_0x0cf2('0x6'));var Mustache=require('mustache');var util=require(_0x0cf2('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0cf2('0x8'));var ejs=require(_0x0cf2('0x9'));var fs=require('fs');var fs_extra=require(_0x0cf2('0xa'));var _=require(_0x0cf2('0xb'));var squel=require(_0x0cf2('0xc'));var crypto=require(_0x0cf2('0xd'));var jsforce=require(_0x0cf2('0xe'));var deskjs=require(_0x0cf2('0xf'));var toCsv=require(_0x0cf2('0x8'));var querystring=require(_0x0cf2('0x10'));var Papa=require(_0x0cf2('0x11'));var Redis=require(_0x0cf2('0x12'));var authService=require(_0x0cf2('0x13'));var qs=require(_0x0cf2('0x14'));var as=require(_0x0cf2('0x15'));var hardwareService=require(_0x0cf2('0x16'));var logger=require(_0x0cf2('0x17'))(_0x0cf2('0x18'));var utils=require(_0x0cf2('0x19'));var config=require(_0x0cf2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cf2('0x1b'))['db'];config[_0x0cf2('0x1c')]=_[_0x0cf2('0x1d')](config[_0x0cf2('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0cf2('0x1e'))(new Redis(config[_0x0cf2('0x1c')]));require(_0x0cf2('0x1f'))[_0x0cf2('0x20')](socket);var jayson=require(_0x0cf2('0x21'));var client=jayson[_0x0cf2('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0xface,_0x1e6516,_0x424652,_0x3501cf){return new BPromise(function(_0x4679a3,_0x538d86){var _0x3c9e99=_0x3501cf||client;return _0x3c9e99[_0x0cf2('0x23')](_0xface,_0x424652)['then'](function(_0x2eda15){logger[_0x0cf2('0x24')](_0x0cf2('0x25'),_0x1e6516,_0x0cf2('0x26'));logger[_0x0cf2('0x27')](_0x0cf2('0x28'),_0x1e6516,_0x0cf2('0x26'),JSON[_0x0cf2('0x29')](_0x2eda15));if(_0x2eda15[_0x0cf2('0x2a')]){if(_0x2eda15[_0x0cf2('0x2a')][_0x0cf2('0x2b')]===0x1f4){logger[_0x0cf2('0x2a')](_0x0cf2('0x25'),_0x1e6516,_0x2eda15['error']['message']);return _0x538d86(_0x2eda15[_0x0cf2('0x2a')]['message']);}logger[_0x0cf2('0x2a')](_0x0cf2('0x25'),_0x1e6516,_0x2eda15[_0x0cf2('0x2a')][_0x0cf2('0x2c')]);return _0x4679a3(_0x2eda15[_0x0cf2('0x2a')][_0x0cf2('0x2c')]);}else{logger[_0x0cf2('0x24')]('SmsAccount,\x20%s,\x20%s',_0x1e6516,_0x0cf2('0x26'));_0x4679a3(_0x2eda15['result'][_0x0cf2('0x2c')]);}})[_0x0cf2('0x2d')](function(_0x36e0bb){logger[_0x0cf2('0x2a')]('SmsAccount,\x20%s,\x20%s',_0x1e6516,_0x36e0bb);_0x538d86(_0x36e0bb);});});}function respondWithStatusCode(_0x539f30,_0x5cef45){_0x5cef45=_0x5cef45||0xcc;return function(_0x5dd0bb){if(_0x5dd0bb){return _0x539f30[_0x0cf2('0x2e')](_0x5cef45);}return _0x539f30[_0x0cf2('0x2f')](_0x5cef45)[_0x0cf2('0x30')]();};}function respondWithResult(_0x4d46ca,_0x2b1743){_0x2b1743=_0x2b1743||0xc8;return function(_0x3ec8c7){if(_0x3ec8c7){return _0x4d46ca['status'](_0x2b1743)[_0x0cf2('0x31')](_0x3ec8c7);}};}function respondWithFilteredResult(_0x2977f4,_0x27273c){return function(_0x47a1a2){if(_0x47a1a2){var _0x18d1c0=typeof _0x27273c[_0x0cf2('0x32')]==='undefined'&&typeof _0x27273c[_0x0cf2('0x33')]===_0x0cf2('0x34');var _0x287200=_0x47a1a2[_0x0cf2('0x35')];var _0x14f370=_0x18d1c0?0x0:_0x27273c[_0x0cf2('0x32')];var _0x35e4a5=_0x18d1c0?_0x47a1a2[_0x0cf2('0x35')]:_0x27273c[_0x0cf2('0x32')]+_0x27273c[_0x0cf2('0x33')];var _0x59e73b;if(_0x35e4a5>=_0x287200){_0x35e4a5=_0x287200;_0x59e73b=0xc8;}else{_0x59e73b=0xce;}_0x2977f4[_0x0cf2('0x2f')](_0x59e73b);return _0x2977f4[_0x0cf2('0x36')](_0x0cf2('0x37'),_0x14f370+'-'+_0x35e4a5+'/'+_0x287200)[_0x0cf2('0x31')](_0x47a1a2);}return null;};}function patchUpdates(_0xbfdc47){return function(_0x121bb7){try{jsonpatch[_0x0cf2('0x38')](_0x121bb7,_0xbfdc47,!![]);}catch(_0x1c931c){return BPromise[_0x0cf2('0x39')](_0x1c931c);}return _0x121bb7[_0x0cf2('0x3a')]();};}function saveUpdates(_0x523b1e,_0x31f8ee){return function(_0x1bb0c3){if(_0x1bb0c3){return _0x1bb0c3[_0x0cf2('0x3b')](_0x523b1e)['then'](function(_0x57339b){return _0x57339b;});}return null;};}function removeEntity(_0x663ddf,_0x4ead56){return function(_0x5aa9f0){if(_0x5aa9f0){return _0x5aa9f0[_0x0cf2('0x3c')]()[_0x0cf2('0x3d')](function(){var _0x21db27=_0x5aa9f0[_0x0cf2('0x3e')]({'plain':!![]});var _0xd7a8d7=_0x0cf2('0x3f');return db[_0x0cf2('0x40')][_0x0cf2('0x3c')]({'where':{'type':_0xd7a8d7,'resourceId':_0x21db27['id']}})[_0x0cf2('0x3d')](function(){return _0x5aa9f0;});})[_0x0cf2('0x3d')](function(){_0x663ddf['status'](0xcc)[_0x0cf2('0x30')]();});}};}function handleEntityNotFound(_0x460df4,_0xa1938d){return function(_0x5858bd){if(!_0x5858bd){_0x460df4[_0x0cf2('0x2e')](0x194);}return _0x5858bd;};}function handleError(_0x3c2b71,_0x46732a){_0x46732a=_0x46732a||0x1f4;return function(_0x898451){logger[_0x0cf2('0x2a')](_0x898451[_0x0cf2('0x41')]);if(_0x898451[_0x0cf2('0x42')]){delete _0x898451[_0x0cf2('0x42')];}_0x3c2b71[_0x0cf2('0x2f')](_0x46732a)['send'](_0x898451);};}exports[_0x0cf2('0x43')]=function(_0xfd2cb7,_0x386133){var _0x183940={'include':[{'model':db[_0x0cf2('0x44')],'as':_0x0cf2('0x45')}]},_0x8d2a0d={},_0x441da0={'count':0x0,'rows':[]};var _0x3d4568=_[_0x0cf2('0x46')](db[_0x0cf2('0x47')]['rawAttributes'],function(_0xeb9d64){return{'name':_0xeb9d64['fieldName'],'type':_0xeb9d64[_0x0cf2('0x48')]['key']};});_0x8d2a0d[_0x0cf2('0x49')]=_['map'](_0x3d4568,_0x0cf2('0x42'));_0x8d2a0d[_0x0cf2('0x4a')]=_[_0x0cf2('0x4b')](_0xfd2cb7[_0x0cf2('0x4a')]);_0x8d2a0d[_0x0cf2('0x4c')]=_[_0x0cf2('0x4d')](_0x8d2a0d[_0x0cf2('0x49')],_0x8d2a0d[_0x0cf2('0x4a')]);_0x183940[_0x0cf2('0x4e')]=_[_0x0cf2('0x4d')](_0x8d2a0d[_0x0cf2('0x49')],qs['fields'](_0xfd2cb7[_0x0cf2('0x4a')][_0x0cf2('0x4f')]));_0x183940[_0x0cf2('0x4e')]=_0x183940[_0x0cf2('0x4e')]['length']?_0x183940['attributes']:_0x8d2a0d[_0x0cf2('0x49')];if(!_0xfd2cb7[_0x0cf2('0x4a')]['hasOwnProperty'](_0x0cf2('0x50'))){_0x183940[_0x0cf2('0x33')]=qs['limit'](_0xfd2cb7[_0x0cf2('0x4a')]['limit']);_0x183940[_0x0cf2('0x32')]=qs[_0x0cf2('0x32')](_0xfd2cb7[_0x0cf2('0x4a')]['offset']);}_0x183940[_0x0cf2('0x51')]=qs[_0x0cf2('0x52')](_0xfd2cb7[_0x0cf2('0x4a')][_0x0cf2('0x52')]);_0x183940[_0x0cf2('0x53')]=qs[_0x0cf2('0x4c')](_[_0x0cf2('0x54')](_0xfd2cb7[_0x0cf2('0x4a')],_0x8d2a0d[_0x0cf2('0x4c')]),_0x3d4568);if(_0xfd2cb7[_0x0cf2('0x4a')][_0x0cf2('0x55')]){_0x183940[_0x0cf2('0x53')]=_['merge'](_0x183940['where'],{'$or':_[_0x0cf2('0x46')](_0x3d4568,function(_0x55f763){if(_0x55f763[_0x0cf2('0x48')]!==_0x0cf2('0x56')){var _0x5cb69e={};_0x5cb69e[_0x55f763['name']]={'$like':'%'+_0xfd2cb7[_0x0cf2('0x4a')][_0x0cf2('0x55')]+'%'};return _0x5cb69e;}})});}_0x183940=_[_0x0cf2('0x57')]({},_0x183940,_0xfd2cb7[_0x0cf2('0x58')]);var _0x1e3fc5={'where':_0x183940[_0x0cf2('0x53')]};return db['SmsAccount'][_0x0cf2('0x35')](_0x1e3fc5)[_0x0cf2('0x3d')](function(_0x5d7a2e){_0x441da0['count']=_0x5d7a2e;if(_0xfd2cb7[_0x0cf2('0x4a')]['includeAll']){_0x183940[_0x0cf2('0x59')]=[{'all':!![]}];}return db[_0x0cf2('0x47')][_0x0cf2('0x5a')](_0x183940);})[_0x0cf2('0x3d')](function(_0x254345){_0x441da0['rows']=_0x254345;return _0x441da0;})['then'](respondWithFilteredResult(_0x386133,_0x183940))[_0x0cf2('0x2d')](handleError(_0x386133,null));};exports[_0x0cf2('0x5b')]=function(_0x198655,_0xa2518a){var _0x2acc41={'raw':![],'where':{'id':_0x198655[_0x0cf2('0x5c')]['id']},'include':[{'model':db[_0x0cf2('0x44')],'as':'mandatoryDispositionPause'}]},_0x380219={};_0x380219[_0x0cf2('0x49')]=_['keys'](db[_0x0cf2('0x47')][_0x0cf2('0x5d')]);_0x380219['query']=_[_0x0cf2('0x4b')](_0x198655[_0x0cf2('0x4a')]);_0x380219['filters']=_['intersection'](_0x380219['model'],_0x380219[_0x0cf2('0x4a')]);_0x2acc41[_0x0cf2('0x4e')]=_[_0x0cf2('0x4d')](_0x380219[_0x0cf2('0x49')],qs['fields'](_0x198655[_0x0cf2('0x4a')]['fields']));_0x2acc41[_0x0cf2('0x4e')]=_0x2acc41[_0x0cf2('0x4e')][_0x0cf2('0x5e')]?_0x2acc41['attributes']:_0x380219[_0x0cf2('0x49')];if(_0x198655['query']['includeAll']){_0x2acc41['include']=[{'all':!![]}];}_0x2acc41=_[_0x0cf2('0x57')]({},_0x2acc41,_0x198655[_0x0cf2('0x58')]);return db['SmsAccount']['find'](_0x2acc41)[_0x0cf2('0x3d')](handleEntityNotFound(_0xa2518a,null))[_0x0cf2('0x3d')](respondWithResult(_0xa2518a,null))[_0x0cf2('0x2d')](handleError(_0xa2518a,null));};exports[_0x0cf2('0x5f')]=function(_0x41ad3b,_0x1a8cab){return db[_0x0cf2('0x47')][_0x0cf2('0x5f')](_0x41ad3b[_0x0cf2('0x60')],{})[_0x0cf2('0x3d')](function(_0x2bb090){var _0x284584=_0x41ad3b[_0x0cf2('0x61')][_0x0cf2('0x3e')]({'plain':!![]});if(!_0x284584)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x284584[_0x0cf2('0x62')]===_0x0cf2('0x61')){var _0x51af9f=_0x2bb090[_0x0cf2('0x3e')]({'plain':!![]});var _0x975b98=_0x0cf2('0x3f');return db[_0x0cf2('0x63')]['find']({'where':{'name':_0x975b98,'userProfileId':_0x284584[_0x0cf2('0x64')]},'raw':!![]})['then'](function(_0x15455e){if(_0x15455e&&_0x15455e[_0x0cf2('0x65')]===0x0){return db[_0x0cf2('0x40')][_0x0cf2('0x5f')]({'name':_0x51af9f[_0x0cf2('0x42')],'resourceId':_0x51af9f['id'],'type':_0x15455e[_0x0cf2('0x42')],'sectionId':_0x15455e['id']},{})[_0x0cf2('0x3d')](function(){return _0x2bb090;});}else{return _0x2bb090;}})[_0x0cf2('0x2d')](function(_0x5c941a){logger[_0x0cf2('0x2a')](_0x0cf2('0x66'),_0x5c941a);throw _0x5c941a;});}return _0x2bb090;})[_0x0cf2('0x3d')](respondWithResult(_0x1a8cab,0xc9))[_0x0cf2('0x2d')](handleError(_0x1a8cab,null));};exports['update']=function(_0x173de0,_0x2f65cb){if(_0x173de0['body']['id']){delete _0x173de0[_0x0cf2('0x60')]['id'];}return db[_0x0cf2('0x47')][_0x0cf2('0x67')]({'where':{'id':_0x173de0[_0x0cf2('0x5c')]['id']},'include':[{'model':db[_0x0cf2('0x44')],'as':_0x0cf2('0x45')}]})[_0x0cf2('0x3d')](handleEntityNotFound(_0x2f65cb,null))[_0x0cf2('0x3d')](saveUpdates(_0x173de0[_0x0cf2('0x60')],null))['then'](respondWithResult(_0x2f65cb,null))[_0x0cf2('0x2d')](handleError(_0x2f65cb,null));};exports['destroy']=function(_0x3c6ad2,_0x215b38){return db[_0x0cf2('0x47')][_0x0cf2('0x67')]({'where':{'id':_0x3c6ad2[_0x0cf2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x215b38,null))[_0x0cf2('0x3d')](removeEntity(_0x215b38,null))[_0x0cf2('0x2d')](handleError(_0x215b38,null));};exports['describe']=function(_0x16fb3f,_0x31cb79){return db['SmsAccount']['describe']()[_0x0cf2('0x3d')](respondWithResult(_0x31cb79,null))[_0x0cf2('0x2d')](handleError(_0x31cb79,null));};exports['addDisposition']=function(_0x49cad6,_0x346f54,_0x29feff){if(_0x49cad6[_0x0cf2('0x60')]['id']){delete _0x49cad6[_0x0cf2('0x60')]['id'];}return db[_0x0cf2('0x47')][_0x0cf2('0x67')]({'where':{'id':_0x49cad6[_0x0cf2('0x5c')]['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x346f54,null))[_0x0cf2('0x3d')](function(_0x4505ce){if(_0x4505ce){_0x49cad6['body'][_0x0cf2('0x68')]=_0x4505ce['id'];return db[_0x0cf2('0x69')][_0x0cf2('0x5f')](_0x49cad6[_0x0cf2('0x60')]);}})[_0x0cf2('0x3d')](respondWithResult(_0x346f54,null))['catch'](handleError(_0x346f54,null));};exports['getDispositions']=function(_0x12d519,_0x355440,_0x57689f){var _0x1893a8={'raw':![],'where':{}};var _0x4b62bd={};var _0x4e8c15={'count':0x0,'rows':[]};return db[_0x0cf2('0x47')][_0x0cf2('0x6a')]({'where':{'id':_0x12d519[_0x0cf2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x355440,null))[_0x0cf2('0x3d')](function(_0x334ea3){if(_0x334ea3){_0x4b62bd[_0x0cf2('0x49')]=_[_0x0cf2('0x4b')](db[_0x0cf2('0x69')]['rawAttributes']);_0x4b62bd[_0x0cf2('0x4a')]=_[_0x0cf2('0x4b')](_0x12d519[_0x0cf2('0x4a')]);_0x4b62bd[_0x0cf2('0x4c')]=_['intersection'](_0x4b62bd['model'],_0x4b62bd[_0x0cf2('0x4a')]);_0x1893a8[_0x0cf2('0x4e')]=_[_0x0cf2('0x4d')](_0x4b62bd[_0x0cf2('0x49')],qs[_0x0cf2('0x4f')](_0x12d519[_0x0cf2('0x4a')][_0x0cf2('0x4f')]));_0x1893a8[_0x0cf2('0x4e')]=_0x1893a8[_0x0cf2('0x4e')]['length']?_0x1893a8[_0x0cf2('0x4e')]:_0x4b62bd['model'];if(!_0x12d519[_0x0cf2('0x4a')][_0x0cf2('0x6b')](_0x0cf2('0x50'))){_0x1893a8[_0x0cf2('0x33')]=qs[_0x0cf2('0x33')](_0x12d519[_0x0cf2('0x4a')][_0x0cf2('0x33')]);_0x1893a8[_0x0cf2('0x32')]=qs[_0x0cf2('0x32')](_0x12d519['query'][_0x0cf2('0x32')]);}_0x1893a8['order']=qs[_0x0cf2('0x52')](_0x12d519[_0x0cf2('0x4a')][_0x0cf2('0x52')]);_0x1893a8[_0x0cf2('0x53')]=qs['filters'](_[_0x0cf2('0x54')](_0x12d519[_0x0cf2('0x4a')],_0x4b62bd[_0x0cf2('0x4c')]));_0x1893a8['where'][_0x0cf2('0x68')]=_0x334ea3['id'];if(_0x12d519[_0x0cf2('0x4a')]['filter']){_0x1893a8[_0x0cf2('0x53')]=_['merge'](_0x1893a8[_0x0cf2('0x53')],{'$or':_[_0x0cf2('0x46')](_0x1893a8['attributes'],function(_0x2155b9){var _0x4fc909={};_0x4fc909[_0x2155b9]={'$like':'%'+_0x12d519['query']['filter']+'%'};return _0x4fc909;})});}_0x1893a8=_[_0x0cf2('0x57')]({},_0x1893a8,_0x12d519['options']);return db[_0x0cf2('0x69')][_0x0cf2('0x35')]({'where':_0x1893a8['where']})[_0x0cf2('0x3d')](function(_0x1b3296){_0x4e8c15[_0x0cf2('0x35')]=_0x1b3296;if(_0x12d519[_0x0cf2('0x4a')][_0x0cf2('0x6c')]){_0x1893a8[_0x0cf2('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x0cf2('0x5a')](_0x1893a8);})[_0x0cf2('0x3d')](function(_0x1acb0c){_0x4e8c15[_0x0cf2('0x6d')]=_0x1acb0c;return _0x4e8c15;});}})[_0x0cf2('0x3d')](respondWithFilteredResult(_0x355440,_0x1893a8))[_0x0cf2('0x2d')](handleError(_0x355440,null));};exports[_0x0cf2('0x6e')]=function(_0x2e4fe3,_0x23fba7,_0x3124a0){return db[_0x0cf2('0x47')][_0x0cf2('0x67')]({'where':{'id':_0x2e4fe3[_0x0cf2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x23fba7,null))[_0x0cf2('0x3d')](function(_0x14fa9c){if(_0x14fa9c){return _0x14fa9c[_0x0cf2('0x6e')](_0x2e4fe3[_0x0cf2('0x4a')][_0x0cf2('0x6f')]);}})[_0x0cf2('0x3d')](respondWithStatusCode(_0x23fba7,null))[_0x0cf2('0x2d')](handleError(_0x23fba7,null));};exports[_0x0cf2('0x70')]=function(_0x113f7d,_0x5a68d8,_0x380636){if(_0x113f7d[_0x0cf2('0x60')]['id']){delete _0x113f7d[_0x0cf2('0x60')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x113f7d['params']['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x5a68d8,null))[_0x0cf2('0x3d')](function(_0x11a92d){if(_0x11a92d){_0x113f7d[_0x0cf2('0x60')]['SmsAccountId']=_0x11a92d['id'];return db[_0x0cf2('0x71')][_0x0cf2('0x5f')](_0x113f7d[_0x0cf2('0x60')]);}})[_0x0cf2('0x3d')](respondWithResult(_0x5a68d8,null))[_0x0cf2('0x2d')](handleError(_0x5a68d8,null));};exports[_0x0cf2('0x72')]=function(_0x55ce23,_0x5de3cb,_0x47f39c){var _0x4430b1={'raw':![],'where':{}};var _0x4efa0a={};var _0x4702ea={'count':0x0,'rows':[]};return db['SmsAccount'][_0x0cf2('0x6a')]({'where':{'id':_0x55ce23['params']['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x5de3cb,null))[_0x0cf2('0x3d')](function(_0x505358){if(_0x505358){_0x4efa0a[_0x0cf2('0x49')]=_[_0x0cf2('0x4b')](db[_0x0cf2('0x71')][_0x0cf2('0x5d')]);_0x4efa0a[_0x0cf2('0x4a')]=_[_0x0cf2('0x4b')](_0x55ce23[_0x0cf2('0x4a')]);_0x4efa0a[_0x0cf2('0x4c')]=_[_0x0cf2('0x4d')](_0x4efa0a['model'],_0x4efa0a[_0x0cf2('0x4a')]);_0x4430b1[_0x0cf2('0x4e')]=_['intersection'](_0x4efa0a[_0x0cf2('0x49')],qs['fields'](_0x55ce23[_0x0cf2('0x4a')][_0x0cf2('0x4f')]));_0x4430b1[_0x0cf2('0x4e')]=_0x4430b1[_0x0cf2('0x4e')]['length']?_0x4430b1[_0x0cf2('0x4e')]:_0x4efa0a[_0x0cf2('0x49')];if(!_0x55ce23[_0x0cf2('0x4a')][_0x0cf2('0x6b')](_0x0cf2('0x50'))){_0x4430b1[_0x0cf2('0x33')]=qs[_0x0cf2('0x33')](_0x55ce23[_0x0cf2('0x4a')]['limit']);_0x4430b1['offset']=qs[_0x0cf2('0x32')](_0x55ce23[_0x0cf2('0x4a')][_0x0cf2('0x32')]);}_0x4430b1['order']=qs[_0x0cf2('0x52')](_0x55ce23[_0x0cf2('0x4a')][_0x0cf2('0x52')]);_0x4430b1['where']=qs['filters'](_[_0x0cf2('0x54')](_0x55ce23[_0x0cf2('0x4a')],_0x4efa0a[_0x0cf2('0x4c')]));_0x4430b1['where']['SmsAccountId']=_0x505358['id'];if(_0x55ce23[_0x0cf2('0x4a')]['filter']){_0x4430b1[_0x0cf2('0x53')]=_['merge'](_0x4430b1[_0x0cf2('0x53')],{'$or':_['map'](_0x4430b1[_0x0cf2('0x4e')],function(_0x2ec0f2){var _0x48d8cd={};_0x48d8cd[_0x2ec0f2]={'$like':'%'+_0x55ce23['query'][_0x0cf2('0x55')]+'%'};return _0x48d8cd;})});}_0x4430b1=_[_0x0cf2('0x57')]({},_0x4430b1,_0x55ce23['options']);return db['CannedAnswer']['count']({'where':_0x4430b1[_0x0cf2('0x53')]})[_0x0cf2('0x3d')](function(_0x3d6bb4){_0x4702ea[_0x0cf2('0x35')]=_0x3d6bb4;if(_0x55ce23['query'][_0x0cf2('0x6c')]){_0x4430b1[_0x0cf2('0x59')]=[{'all':!![]}];}return db[_0x0cf2('0x71')][_0x0cf2('0x5a')](_0x4430b1);})[_0x0cf2('0x3d')](function(_0x4ff6a9){_0x4702ea['rows']=_0x4ff6a9;return _0x4702ea;});}})[_0x0cf2('0x3d')](respondWithFilteredResult(_0x5de3cb,_0x4430b1))[_0x0cf2('0x2d')](handleError(_0x5de3cb,null));};exports[_0x0cf2('0x73')]=function(_0x381aa4,_0x284587,_0x11ab48){return db[_0x0cf2('0x47')]['find']({'where':{'id':_0x381aa4['params']['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x284587,null))[_0x0cf2('0x3d')](function(_0x410978){if(_0x410978){return _0x410978[_0x0cf2('0x73')](_0x381aa4['query'][_0x0cf2('0x6f')]);}})[_0x0cf2('0x3d')](respondWithStatusCode(_0x284587,null))['catch'](handleError(_0x284587,null));};exports[_0x0cf2('0x74')]=function(_0x837be6,_0x52b9c7,_0x171aa9){var _0x1224f4={'channel':_0x0cf2('0x75')};var _0x3d72bc=[];var _0x4f8de2=[];var _0x1bc17b={};return db[_0x0cf2('0x47')][_0x0cf2('0x67')]({'where':{'id':_0x837be6[_0x0cf2('0x5c')]['id']},'include':[{'model':db[_0x0cf2('0x76')],'as':_0x0cf2('0x77')}]})[_0x0cf2('0x3d')](handleEntityNotFound(_0x52b9c7,null))[_0x0cf2('0x3d')](function(_0x4ed11b){_0x1224f4[_0x0cf2('0x78')]=_0x4ed11b;_0x1224f4[_0x0cf2('0x79')]=_[_0x0cf2('0x7a')](_0x4ed11b[_0x0cf2('0x77')],['priority'],['asc']);if(_0x1224f4['account'][_0x0cf2('0x77')]){delete _0x1224f4[_0x0cf2('0x78')][_0x0cf2('0x77')];}return db[_0x0cf2('0x7b')][_0x0cf2('0x7c')]();})[_0x0cf2('0x3d')](function(_0x1f24c3){if(!_0x1f24c3){throw new db['Sequelize'][(_0x0cf2('0x7d'))](_0x0cf2('0x7e'));}_0x3d72bc=_[_0x0cf2('0x7f')](_[_0x0cf2('0x4b')](_0x1f24c3),['createdAt',_0x0cf2('0x80')]);_0x4f8de2=_[_0x0cf2('0x7f')](_[_0x0cf2('0x4b')](_0x1f24c3),[_0x0cf2('0x81'),_0x0cf2('0x80'),_0x0cf2('0x82'),'ListId']);_0x1224f4['body']={'mapKey':_0x0cf2('0x83')};if(_0x1224f4['account']['type']){switch(_0x1224f4[_0x0cf2('0x78')]['type']){case'twilio':_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x84')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x85')];_0x1224f4['body'][_0x0cf2('0x60')]=_0x837be6[_0x0cf2('0x60')]['Body'];_0x1224f4[_0x0cf2('0x60')]['messageId']=_0x837be6['body'][_0x0cf2('0x86')];break;case _0x0cf2('0x87'):_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x84')]='+'+_0x837be6[_0x0cf2('0x60')]['sender'];_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x60')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x88')];break;case _0x0cf2('0x89'):_0x1224f4[_0x0cf2('0x60')]['from']=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x84')];_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x60')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x2c')];break;case'clicksend':_0x1224f4[_0x0cf2('0x60')]['from']=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x84')];_0x1224f4[_0x0cf2('0x60')]['body']=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x60')];_0x1224f4['body'][_0x0cf2('0x8a')]=_0x837be6['body'][_0x0cf2('0x8b')];break;case _0x0cf2('0x8c'):_0x1224f4['body'][_0x0cf2('0x84')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x85')];_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x60')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x8d')];_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x8a')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x8e')];break;case _0x0cf2('0x8f'):_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x84')]='+'+_0x837be6[_0x0cf2('0x60')]['results'][0x0]['from'];_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x60')]=_0x837be6['body']['results'][0x0][_0x0cf2('0x88')];_0x1224f4['body'][_0x0cf2('0x8a')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x90')][0x0][_0x0cf2('0x8a')];break;case _0x0cf2('0x91'):_0x1224f4['body'][_0x0cf2('0x84')]=_0x837be6['body'][_0x0cf2('0x92')];_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x60')]=_0x837be6[_0x0cf2('0x60')]['segmentedMessage']['message'];break;case _0x0cf2('0x93'):_0x1224f4[_0x0cf2('0x60')]['from']=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x94')];_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x60')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x88')];_0x1224f4['body'][_0x0cf2('0x8a')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x95')];break;case _0x0cf2('0x96'):_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x8a')]=_0x837be6[_0x0cf2('0x60')][0x0]['message']['id'];_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x84')]=_0x837be6[_0x0cf2('0x60')][0x0][_0x0cf2('0x2c')][_0x0cf2('0x84')];_0x1224f4['body'][_0x0cf2('0x60')]=_0x837be6[_0x0cf2('0x60')][0x0][_0x0cf2('0x2c')][_0x0cf2('0x88')];break;case _0x0cf2('0x97'):_0x1224f4[_0x0cf2('0x60')]['from']=_0x837be6[_0x0cf2('0x60')]['from'];_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x60')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x2c')];_0x1224f4['body'][_0x0cf2('0x8a')]=_0x837be6[_0x0cf2('0x60')][_0x0cf2('0x98')];break;}}if(_0x1224f4[_0x0cf2('0x60')]['id']){delete _0x1224f4['body']['id'];}if(_[_0x0cf2('0x99')](_0x1224f4[_0x0cf2('0x60')]['from'])){throw new db[(_0x0cf2('0x9a'))][(_0x0cf2('0x7d'))](_0x0cf2('0x9b'));}if(_[_0x0cf2('0x99')](_0x1224f4['body'][_0x0cf2('0x60')])||_0x1224f4[_0x0cf2('0x60')]['body']===''){throw new db[(_0x0cf2('0x9a'))]['ValidationError'](_0x0cf2('0x9c'));}if(_[_0x0cf2('0x99')](_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x9d')])){throw new db[(_0x0cf2('0x9a'))][(_0x0cf2('0x7d'))](_0x0cf2('0x9e')+_0x4f8de2);}if(!_[_0x0cf2('0x9f')](_0x4f8de2,_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x9d')])){throw new db['Sequelize'][(_0x0cf2('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f8de2);}_0x1bc17b[_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x9d')]]=_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x84')];return db[_0x0cf2('0xa0')][_0x0cf2('0x67')]({'where':{'id':_0x1224f4[_0x0cf2('0x78')][_0x0cf2('0xa1')]},'include':[{'model':db[_0x0cf2('0x7b')],'as':_0x0cf2('0xa2'),'where':_0x1bc17b,'limit':0x1,'order':[[_0x0cf2('0x80'),'DESC']]}]});})[_0x0cf2('0x3d')](handleEntityNotFound(_0x52b9c7,null))[_0x0cf2('0x3d')](function(_0x4f1e64){if(_0x4f1e64){_0x1224f4[_0x0cf2('0xa3')]=_[_0x0cf2('0xa4')](_0x4f1e64,[_0x0cf2('0xa2')]);if(_0x4f1e64['Contacts']['length']){return _0x4f1e64[_0x0cf2('0xa2')][0x0];}var _0x39349a=_['defaults'](_0x1224f4[_0x0cf2('0x60')],{'firstName':_0x1224f4['body'][_0x0cf2('0x84')],'ListId':_0x4f1e64['id']});_0x39349a[_0x1224f4[_0x0cf2('0x60')]['mapKey']]=_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x84')];return db['CmContact'][_0x0cf2('0x5f')](_0x39349a,{'fields':_0x3d72bc,'raw':!![]});}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x52b9c7,null))[_0x0cf2('0x3d')](function(_0xadd42c){if(_0xadd42c){_0x1224f4[_0x0cf2('0xa5')]=_0xadd42c;var _0x35c3ca={'ContactId':_0xadd42c['id'],'phone':_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x84')],'SmsAccountId':_0x837be6[_0x0cf2('0x5c')]['id']};var _0x45b0aa={'ContactId':_0xadd42c['id'],'SmsAccountId':_0x837be6[_0x0cf2('0x5c')]['id'],'closed':![]};return db[_0x0cf2('0xa6')]['find']({'where':_0x45b0aa})['then'](function(_0x166804){if(_0x166804){return[_0x166804,![]];}return db[_0x0cf2('0xa6')][_0x0cf2('0x5f')](_0x35c3ca)[_0x0cf2('0x3d')](function(_0x10e517){return[_0x10e517,!![]];});});}})[_0x0cf2('0xa7')](function(_0x19caca,_0x5afd78){_0x1224f4[_0x0cf2('0xa8')]=_0x19caca[_0x0cf2('0x3e')]({'plain':!![]});_0x1224f4[_0x0cf2('0xa8')]['created']=![];if(_0x5afd78){if(_0x1224f4['account'][_0x0cf2('0xa9')]){_0x1224f4[_0x0cf2('0x79')][_0x0cf2('0xaa')]({'id':0x0,'priority':_0x1224f4['applications']['length']+0x1,'app':'close','appdata':_0x0cf2('0xab'),'interval':_0x0cf2('0xac')});}_0x1224f4[_0x0cf2('0xa8')][_0x0cf2('0xad')]=!![];}return db['SmsMessage']['create']({'phone':_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x84')],'messageId':_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x8a')],'body':_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0x60')],'SmsAccountId':_0x837be6[_0x0cf2('0x5c')]['id'],'SmsInteractionId':_0x19caca['id'],'direction':'in','ContactId':_0x19caca[_0x0cf2('0xae')],'AttachmentId':_0x1224f4[_0x0cf2('0x60')][_0x0cf2('0xaf')]});})[_0x0cf2('0x3d')](function(_0x263778){_0x1224f4[_0x0cf2('0x2c')]=_0x263778;if(_0x1224f4[_0x0cf2('0xa8')][_0x0cf2('0xb0')]){return db[_0x0cf2('0xb1')][_0x0cf2('0x67')]({'attributes':['id',_0x0cf2('0x42')],'where':{'id':_0x1224f4[_0x0cf2('0xa8')][_0x0cf2('0xb0')]}})[_0x0cf2('0x3d')](function(_0x1f3d38){if(_0x1f3d38){_0x1224f4[_0x0cf2('0x79')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0cf2('0xb2'),'appdata':_0x1f3d38[_0x0cf2('0x42')]+','+(_0x1224f4[_0x0cf2('0x78')][_0x0cf2('0xb3')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x1224f4);});}return respondWithRpcPromise(_0x0cf2('0xb4'),_0x0cf2('0xb5'),_0x1224f4);})['then'](function(_0x7d13b7){if(_0x7d13b7){var _0x3bd5c8=0xc8;var _0x4167de=_0x0cf2('0xb6');logger[_0x0cf2('0x24')](_0x0cf2('0x28'),_0x4167de,_0x3bd5c8,_0x0cf2('0xb7'));logger['debug'](_0x0cf2('0xb8'),_0x4167de,_0x3bd5c8,_0x0cf2('0xb7'),JSON[_0x0cf2('0x29')](_0x7d13b7));if(_0x1224f4[_0x0cf2('0x78')][_0x0cf2('0x48')]===_0x0cf2('0xb9')){return _0x52b9c7[_0x0cf2('0x2f')](_0x3bd5c8)[_0x0cf2('0x36')](_0x0cf2('0xba'),_0x0cf2('0xbb'))[_0x0cf2('0xbc')](_0x0cf2('0xbd'));}else{return _0x52b9c7[_0x0cf2('0x2f')](_0x3bd5c8)[_0x0cf2('0x31')](_0x7d13b7);}}})[_0x0cf2('0x2d')](handleError(_0x52b9c7,null));};exports[_0x0cf2('0xbe')]=function(_0x12d3d9,_0x363275,_0x25b1d3){return db[_0x0cf2('0x47')][_0x0cf2('0x6a')]({'where':{'id':_0x12d3d9['params']['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x363275,null))[_0x0cf2('0x3d')](function(_0x33faeb){if(_0x33faeb){return db[_0x0cf2('0xbf')][_0x0cf2('0xc0')](function(_0x2ed266){return db[_0x0cf2('0x76')][_0x0cf2('0x3c')]({'where':{'SmsAccountId':_0x12d3d9['params']['id']},'transaction':_0x2ed266})['then'](function(_0x1f6e96){var _0x800fcb=_['map'](_0x12d3d9[_0x0cf2('0x60')],function(_0x13a83a){_0x13a83a[_0x0cf2('0x68')]=_0x12d3d9[_0x0cf2('0x5c')]['id'];return _0x13a83a;});return db[_0x0cf2('0x76')]['bulkCreate'](_0x800fcb,{'transaction':_0x2ed266});});})[_0x0cf2('0x3d')](function(){return db[_0x0cf2('0x76')][_0x0cf2('0xc1')]({'where':{'SmsAccountId':_0x12d3d9['params']['id']},'order':_0x0cf2('0xc2')});});}})[_0x0cf2('0x3d')](respondWithResult(_0x363275,null))[_0x0cf2('0x2d')](handleError(_0x363275,null));};exports[_0x0cf2('0xc3')]=function(_0x16d42f,_0x193631,_0x2a8de1){var _0x5f431f={};var _0x4108b8={};var _0x22d44d;var _0x6a9954;return db['SmsAccount'][_0x0cf2('0x6a')]({'where':{'id':_0x16d42f['params']['id']}})['then'](handleEntityNotFound(_0x193631,null))[_0x0cf2('0x3d')](function(_0x293a7f){if(_0x293a7f){_0x22d44d=_0x293a7f;_0x4108b8[_0x0cf2('0x49')]=_[_0x0cf2('0x4b')](db['SmsApplication'][_0x0cf2('0x5d')]);_0x4108b8[_0x0cf2('0x4a')]=_['keys'](_0x16d42f[_0x0cf2('0x4a')]);_0x4108b8[_0x0cf2('0x4c')]=_[_0x0cf2('0x4d')](_0x4108b8['model'],_0x4108b8[_0x0cf2('0x4a')]);_0x5f431f['attributes']=_['intersection'](_0x4108b8[_0x0cf2('0x49')],qs['fields'](_0x16d42f[_0x0cf2('0x4a')][_0x0cf2('0x4f')]));_0x5f431f['attributes']=_0x5f431f['attributes'][_0x0cf2('0x5e')]?_0x5f431f[_0x0cf2('0x4e')]:_0x4108b8['model'];_0x5f431f['order']=qs[_0x0cf2('0x52')](_0x16d42f[_0x0cf2('0x4a')][_0x0cf2('0x52')]);_0x5f431f['where']=qs['filters'](_[_0x0cf2('0x54')](_0x16d42f[_0x0cf2('0x4a')],_0x4108b8[_0x0cf2('0x4c')]));if(_0x16d42f['query'][_0x0cf2('0x55')]){_0x5f431f['where']=_['merge'](_0x5f431f['where'],{'$or':_[_0x0cf2('0x46')](_0x5f431f[_0x0cf2('0x4e')],function(_0x5a789a){var _0x5182c0={};_0x5182c0[_0x5a789a]={'$like':'%'+_0x16d42f[_0x0cf2('0x4a')][_0x0cf2('0x55')]+'%'};return _0x5182c0;})});}_0x5f431f=_[_0x0cf2('0x57')]({},_0x5f431f,_0x16d42f[_0x0cf2('0x58')]);return _0x22d44d[_0x0cf2('0xc3')](_0x5f431f);}})[_0x0cf2('0x3d')](function(_0x2be6f1){if(_0x2be6f1){_0x6a9954=_0x2be6f1[_0x0cf2('0x5e')];if(!_0x16d42f[_0x0cf2('0x4a')][_0x0cf2('0x6b')](_0x0cf2('0x50'))){_0x5f431f[_0x0cf2('0x33')]=qs['limit'](_0x16d42f[_0x0cf2('0x4a')][_0x0cf2('0x33')]);_0x5f431f['offset']=qs[_0x0cf2('0x32')](_0x16d42f[_0x0cf2('0x4a')][_0x0cf2('0x32')]);}return _0x22d44d['getApplications'](_0x5f431f);}})[_0x0cf2('0x3d')](function(_0x2e0511){if(_0x2e0511){return _0x2e0511?{'count':_0x6a9954,'rows':_0x2e0511}:null;}})[_0x0cf2('0x3d')](respondWithResult(_0x193631,null))['catch'](handleError(_0x193631,null));};exports[_0x0cf2('0xc4')]=function(_0x222f3a,_0x38476f,_0x4f980b){var _0x41e54b={'raw':![],'where':{}};var _0x2dac4b={};var _0x54922b={'count':0x0,'rows':[]};return db[_0x0cf2('0x47')][_0x0cf2('0x6a')]({'where':{'id':_0x222f3a[_0x0cf2('0x5c')]['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x38476f,null))[_0x0cf2('0x3d')](function(_0x2590a8){if(_0x2590a8){_0x2dac4b['model']=_['keys'](db[_0x0cf2('0xa6')][_0x0cf2('0x5d')]);_0x2dac4b['query']=_[_0x0cf2('0x4b')](_0x222f3a[_0x0cf2('0x4a')]);_0x2dac4b[_0x0cf2('0x4c')]=_[_0x0cf2('0x4d')](_0x2dac4b[_0x0cf2('0x49')],_0x2dac4b[_0x0cf2('0x4a')]);_0x41e54b['attributes']=_[_0x0cf2('0x4d')](_0x2dac4b[_0x0cf2('0x49')],qs[_0x0cf2('0x4f')](_0x222f3a[_0x0cf2('0x4a')][_0x0cf2('0x4f')]));_0x41e54b['attributes']=_0x41e54b[_0x0cf2('0x4e')][_0x0cf2('0x5e')]?_0x41e54b['attributes']:_0x2dac4b[_0x0cf2('0x49')];if(!_0x222f3a['query'][_0x0cf2('0x6b')](_0x0cf2('0x50'))){_0x41e54b[_0x0cf2('0x33')]=qs[_0x0cf2('0x33')](_0x222f3a[_0x0cf2('0x4a')][_0x0cf2('0x33')]);_0x41e54b[_0x0cf2('0x32')]=qs[_0x0cf2('0x32')](_0x222f3a['query'][_0x0cf2('0x32')]);}_0x41e54b['order']=qs[_0x0cf2('0x52')](_0x222f3a[_0x0cf2('0x4a')][_0x0cf2('0x52')]);_0x41e54b[_0x0cf2('0x53')]=qs[_0x0cf2('0x4c')](_[_0x0cf2('0x54')](_0x222f3a[_0x0cf2('0x4a')],_0x2dac4b['filters']));_0x41e54b[_0x0cf2('0x53')][_0x0cf2('0x68')]=_0x2590a8['id'];if(_0x222f3a[_0x0cf2('0x4a')]['filter']){_0x41e54b[_0x0cf2('0x53')]=_[_0x0cf2('0x57')](_0x41e54b[_0x0cf2('0x53')],{'$or':_['map'](_0x41e54b[_0x0cf2('0x4e')],function(_0x1013a5){var _0x5ec5b9={};_0x5ec5b9[_0x1013a5]={'$like':'%'+_0x222f3a[_0x0cf2('0x4a')][_0x0cf2('0x55')]+'%'};return _0x5ec5b9;})});}_0x41e54b=_[_0x0cf2('0x57')]({},_0x41e54b,_0x222f3a[_0x0cf2('0x58')]);return db[_0x0cf2('0xa6')][_0x0cf2('0x35')]({'where':_0x41e54b[_0x0cf2('0x53')]})[_0x0cf2('0x3d')](function(_0x544eab){_0x54922b[_0x0cf2('0x35')]=_0x544eab;if(_0x222f3a[_0x0cf2('0x4a')][_0x0cf2('0x6c')]){_0x41e54b[_0x0cf2('0x59')]=[{'model':db[_0x0cf2('0x7b')],'as':_0x0cf2('0xc5'),'required':![]},{'model':db[_0x0cf2('0xb1')],'as':_0x0cf2('0xc6'),'attributes':['name','fullname',_0x0cf2('0xc7')],'required':![]},{'model':db[_0x0cf2('0xc8')],'as':_0x0cf2('0xc9'),'attributes':['id',_0x0cf2('0x42'),_0x0cf2('0xca')],'where':_0x222f3a['query'][_0x0cf2('0xcb')]?{'id':_0x222f3a[_0x0cf2('0x4a')][_0x0cf2('0xcb')]}:undefined,'required':_0x222f3a[_0x0cf2('0x4a')][_0x0cf2('0xcb')]?!![]:![]}];}return db[_0x0cf2('0xa6')][_0x0cf2('0x5a')](_0x41e54b);})[_0x0cf2('0x3d')](function(_0x223717){_0x54922b[_0x0cf2('0x6d')]=_0x223717;return _0x54922b;});}})[_0x0cf2('0x3d')](respondWithFilteredResult(_0x38476f,_0x41e54b))[_0x0cf2('0x2d')](handleError(_0x38476f,null));};exports[_0x0cf2('0xbc')]=function(_0x3f8fbd,_0x369f6b,_0x481851){var _0x3588ee,_0x355b9,_0x3a885a;if(_['isNil'](_0x3f8fbd[_0x0cf2('0x60')][_0x0cf2('0x60')])||_0x3f8fbd[_0x0cf2('0x60')]['body']===''){throw new db[(_0x0cf2('0x9a'))]['ValidationError'](_0x0cf2('0x9c'));}if(_['isNil'](_0x3f8fbd[_0x0cf2('0x60')]['to'])){throw new db[(_0x0cf2('0x9a'))][(_0x0cf2('0x7d'))](_0x0cf2('0xcc'));}_0x3588ee=_0x3f8fbd[_0x0cf2('0x60')]['to'];return db[_0x0cf2('0x47')]['find']({'where':{'id':_0x3f8fbd[_0x0cf2('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x0cf2('0xcd'),'include':[{'model':db[_0x0cf2('0x7b')],'as':'Contacts','where':{'mobile':_0x3588ee},'limit':0x1,'order':[['updatedAt',_0x0cf2('0xce')]]}]}]})[_0x0cf2('0x3d')](handleEntityNotFound(_0x369f6b,null))[_0x0cf2('0x3d')](function(_0x38b114){if(_0x38b114&&_0x38b114['List']){_0x355b9=_0x38b114['get']({'plain':!![]});if(_0x355b9[_0x0cf2('0xcd')]&&_0x355b9[_0x0cf2('0xcd')][_0x0cf2('0xa2')][_0x0cf2('0x5e')]){return _0x355b9['List'][_0x0cf2('0xa2')][0x0];}return db[_0x0cf2('0x7b')]['create'](_[_0x0cf2('0x1d')](_0x3f8fbd[_0x0cf2('0x60')],{'firstName':_0x3588ee,'mobile':_0x3588ee,'phone':_0x3588ee,'ListId':_0x355b9[_0x0cf2('0xa1')]}));}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x369f6b,null))[_0x0cf2('0x3d')](function(_0x3427ce){if(_0x3427ce){_0x3a885a=_0x3427ce;return db[_0x0cf2('0xa6')]['find']({'where':{'ContactId':_0x3a885a['id'],'closed':![],'SmsAccountId':_0x355b9['id']}})[_0x0cf2('0x3d')](function(_0x3017d9){if(_0x3017d9){return[_0x3017d9,![]];}return db[_0x0cf2('0xa6')][_0x0cf2('0x5f')]({'UserId':_0x3f8fbd['user']['id'],'ContactId':_0x3a885a['id'],'SmsAccountId':_0x355b9['id'],'phone':_0x3588ee,'firstMsgDirection':'out','Messages':[_['merge'](_0x3f8fbd[_0x0cf2('0x60')],{'read':![],'body':_0x3f8fbd[_0x0cf2('0x60')][_0x0cf2('0x60')],'phone':_0x3588ee,'SmsAccountId':_0x355b9['id'],'UserId':_0x3f8fbd[_0x0cf2('0x61')]['id'],'ContactId':_0x3a885a['id']})]},{'include':[{'model':db[_0x0cf2('0xcf')],'as':_0x0cf2('0xd0')}]})['then'](function(_0x223013){return[_0x223013,!![]];});});}})[_0x0cf2('0xa7')](function(_0x8c4d73,_0x2d3df6){if(_0x2d3df6){return _0x8c4d73;}return db['SmsMessage'][_0x0cf2('0x5f')](_[_0x0cf2('0x57')](_0x3f8fbd['body'],{'read':![],'body':_0x3f8fbd[_0x0cf2('0x60')][_0x0cf2('0x60')],'phone':_0x3588ee,'SmsAccountId':_0x355b9['id'],'SmsInteractionId':_0x8c4d73['id'],'UserId':_0x3f8fbd[_0x0cf2('0x61')]['id'],'ContactId':_0x3a885a['id']}))[_0x0cf2('0x3d')](function(_0x573a98){_0x8c4d73[_0x0cf2('0xd1')][_0x0cf2('0xd0')]=[];_0x8c4d73['dataValues']['Messages'][_0x0cf2('0xaa')](_0x573a98[_0x0cf2('0xd1')]);return _0x8c4d73;});})['then'](respondWithResult(_0x369f6b,null))['catch'](handleError(_0x369f6b,null));};exports[_0x0cf2('0x2f')]=function(_0x4fcd56,_0x4d0a08,_0x2e4761){if(_0x4fcd56[_0x0cf2('0x60')]['id']){delete _0x4fcd56['body']['id'];}var _0x112ba9,_0x118fde,_0x329503;return db['SmsAccount'][_0x0cf2('0x67')]({'where':{'id':_0x4fcd56['params']['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x4d0a08,null))[_0x0cf2('0x3d')](function(_0xd78ecb){if(_0xd78ecb){_0x329503=_0xd78ecb;logger[_0x0cf2('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0cf2('0xd2'),_0xd78ecb[_0x0cf2('0x48')],util[_0x0cf2('0xd3')](_0x4fcd56[_0x0cf2('0x60')],{'showHidden':![],'depth':null}));switch(_0xd78ecb['type']){case _0x0cf2('0x87'):if(_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0xd4')]&&_0x4fcd56['body'][_0x0cf2('0x2f')]){_0x118fde=_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0x2f')];return db['SmsMessage'][_0x0cf2('0x67')]({'where':{'messageId':_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0xd4')]}});}break;case _0x0cf2('0x89'):if(_0x4fcd56['body'][_0x0cf2('0xd5')]&&_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0xd6')]){_0x118fde=_0x4fcd56['body'][_0x0cf2('0xd6')];return db[_0x0cf2('0xcf')][_0x0cf2('0x67')]({'where':{'messageId':_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0xd5')]}});}break;case'clicksend':if(_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0x8b')]&&_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0xd7')]){_0x118fde=_0x4fcd56['body'][_0x0cf2('0xd7')];return db[_0x0cf2('0xcf')][_0x0cf2('0x67')]({'where':{'messageId':_0x4fcd56['body']['message_id']}});}break;case _0x0cf2('0x8f'):var _0x4fa9d7=_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0x90')][0x0];if(_0x4fa9d7[_0x0cf2('0x8a')]&&_0x4fa9d7[_0x0cf2('0x2f')][_0x0cf2('0xd8')]===_0x0cf2('0xd9')){_0x118fde=_0x4fa9d7[_0x0cf2('0x2f')][_0x0cf2('0xd8')];return db[_0x0cf2('0xcf')][_0x0cf2('0x67')]({'where':{'messageId':_0x4fa9d7[_0x0cf2('0x8a')]}});}break;case'clickatell':if(_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0x8a')]&&_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0x2f')]){_0x118fde=_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0x2f')];return db[_0x0cf2('0xcf')][_0x0cf2('0x67')]({'where':{'messageId':_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0x8a')]}});}break;case _0x0cf2('0x96'):if(_0x4fcd56['body'][0x0][_0x0cf2('0x2c')]['id']){_0x118fde=_0x4fcd56[_0x0cf2('0x60')][0x0][_0x0cf2('0x48')];return db[_0x0cf2('0xcf')][_0x0cf2('0x67')]({'where':{'messageId':_0x4fcd56[_0x0cf2('0x60')][0x0]['message']['id']}});}break;case _0x0cf2('0x97'):if(_0x4fcd56['body'][_0x0cf2('0xda')]&&_0x4fcd56['body']['status']){_0x118fde=_0x4fcd56[_0x0cf2('0x60')]['status'];return db[_0x0cf2('0xcf')][_0x0cf2('0x67')]({'where':{'messageId':_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0xda')]}});}break;}}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x4d0a08,null))[_0x0cf2('0x3d')](function(_0x5d36d0){if(_0x5d36d0){_0x112ba9=_0x5d36d0;switch(_0x329503[_0x0cf2('0x48')]){case _0x0cf2('0x87'):if(_0x118fde===_0x0cf2('0xd9')){return _0x112ba9['update']({'read':!![]});}else{logger['error'](_0x0cf2('0x28'),_0x0cf2('0x2f'),'skebby',util[_0x0cf2('0xd3')](_0x4fcd56[_0x0cf2('0x60')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x118fde==='1'){return _0x112ba9['update']({'read':!![]});}else{logger[_0x0cf2('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0cf2('0x2f'),_0x0cf2('0x87'),util[_0x0cf2('0xd3')](_0x4fcd56['body'],{'showHidden':![],'depth':null}));}break;case _0x0cf2('0xdb'):if(!_0x4fcd56['body'][_0x0cf2('0xdc')]&&_0x118fde>=0xc8&&_0x118fde<=0xce){return _0x112ba9[_0x0cf2('0x3b')]({'read':!![]});}else{logger[_0x0cf2('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0cf2('0x2f'),_0x0cf2('0xdb'),util[_0x0cf2('0xd3')](_0x4fcd56[_0x0cf2('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0cf2('0x8f'):var _0x2ba6e7=_0x4fcd56[_0x0cf2('0x60')][_0x0cf2('0x90')][0x0];if(_0x2ba6e7[_0x0cf2('0x2f')]['groupName']===_0x0cf2('0xd9')){return _0x112ba9[_0x0cf2('0x3b')]({'read':!![]});}else{logger[_0x0cf2('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0cf2('0x2f'),_0x0cf2('0x8f'),util[_0x0cf2('0xd3')](_0x4fcd56[_0x0cf2('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0cf2('0x93'):if(_0x118fde==_0x0cf2('0xdd')||_0x118fde==_0x0cf2('0xde')){return _0x112ba9[_0x0cf2('0x3b')]({'read':!![]});}else{logger[_0x0cf2('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0cf2('0x2f'),_0x0cf2('0x93'),util[_0x0cf2('0xd3')](_0x4fcd56[_0x0cf2('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0cf2('0x96'):if(_0x118fde=='message-delivered'){return _0x112ba9[_0x0cf2('0x3b')]({'read':!![]});}else{logger[_0x0cf2('0x2a')](_0x0cf2('0x28'),_0x0cf2('0x2f'),'bandwidth',util[_0x0cf2('0xd3')](_0x4fcd56[_0x0cf2('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0cf2('0x97'):if(_0x118fde===_0x0cf2('0xdf')||_0x118fde===_0x0cf2('0xe0')){return _0x112ba9[_0x0cf2('0x3b')]({'read':!![]});}else{logger[_0x0cf2('0x2a')](_0x0cf2('0x28'),_0x0cf2('0x2f'),'intelepeer',util['inspect'](_0x4fcd56[_0x0cf2('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x112ba9;}})[_0x0cf2('0x3d')](respondWithResult(_0x4d0a08,null))['catch'](handleError(_0x4d0a08,null));};exports[_0x0cf2('0xe1')]=function(_0x43ddcb,_0x550fe2,_0x27d7d1){var _0x2e63e0,_0x2aa20a,_0x11cde9;return db[_0x0cf2('0x47')][_0x0cf2('0x67')]({'where':{'id':_0x43ddcb[_0x0cf2('0x5c')]['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x550fe2,null))[_0x0cf2('0x3d')](function(_0x337688){if(_0x337688){_0x11cde9=_0x337688;logger[_0x0cf2('0x27')](_0x0cf2('0x28'),_0x0cf2('0x2f'),_0x0cf2('0xd2'),_0x337688[_0x0cf2('0x48')],util['inspect'](_0x43ddcb[_0x0cf2('0x4a')],{'showHidden':![],'depth':null}));switch(_0x337688[_0x0cf2('0x48')]){case _0x0cf2('0x91'):if(_0x43ddcb[_0x0cf2('0x4a')][_0x0cf2('0xe2')]&&_0x43ddcb[_0x0cf2('0x4a')]['state']){_0x2aa20a=_0x43ddcb[_0x0cf2('0x4a')][_0x0cf2('0xe3')];return db[_0x0cf2('0xcf')][_0x0cf2('0x67')]({'where':{'messageId':_0x43ddcb['query']['message-id']}});}break;}}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x550fe2,null))[_0x0cf2('0x3d')](function(_0x334069){if(_0x334069){_0x2e63e0=_0x334069;switch(_0x11cde9['type']){case _0x0cf2('0x91'):if(_0x2aa20a==='2'||_0x2aa20a==='6'){return _0x2e63e0[_0x0cf2('0x3b')]({'read':!![]});}else{logger['error'](_0x0cf2('0x28'),_0x0cf2('0x2f'),'csc',util[_0x0cf2('0xd3')](_0x43ddcb['query'],{'showHidden':![],'depth':null}));};break;}return _0x2e63e0;}})['then'](respondWithResult(_0x550fe2,null))['catch'](handleError(_0x550fe2,null));};exports[_0x0cf2('0xe4')]=function(_0x57a3d5,_0x9d58c,_0x109cdb){return db[_0x0cf2('0x47')][_0x0cf2('0x67')]({'where':{'id':_0x57a3d5[_0x0cf2('0x5c')]['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x9d58c,null))[_0x0cf2('0x3d')](function(_0x340c25){if(_0x340c25){return _0x340c25[_0x0cf2('0xe4')](_0x57a3d5['body'][_0x0cf2('0x6f')],_[_0x0cf2('0xa4')](_0x57a3d5['body'],['ids','id'])||{})[_0x0cf2('0xa7')](function(_0x3463a6){for(var _0x40dfe8=0x0;_0x40dfe8<_0x57a3d5[_0x0cf2('0x60')][_0x0cf2('0x6f')][_0x0cf2('0x5e')];_0x40dfe8+=0x1){socket[_0x0cf2('0xe5')](_0x0cf2('0xe6'),{'UserId':Number(_0x57a3d5[_0x0cf2('0x60')][_0x0cf2('0x6f')][_0x40dfe8]),'SmsAccountId':Number(_0x57a3d5[_0x0cf2('0x5c')]['id'])});}return _0x3463a6;});}})[_0x0cf2('0x3d')](respondWithResult(_0x9d58c,null))[_0x0cf2('0x2d')](handleError(_0x9d58c,null));};exports[_0x0cf2('0xe7')]=function(_0x39559f,_0x239bf7,_0x4999e8){return db[_0x0cf2('0x47')][_0x0cf2('0x67')]({'where':{'id':_0x39559f[_0x0cf2('0x5c')]['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x239bf7,null))[_0x0cf2('0x3d')](function(_0x1cc054){if(_0x1cc054){return _0x1cc054[_0x0cf2('0xe7')](_0x39559f[_0x0cf2('0x4a')]['ids'])[_0x0cf2('0x3d')](function(){if(_['isArray'](_0x39559f['query']['ids'])){for(var _0x520016=0x0;_0x520016<_0x39559f[_0x0cf2('0x4a')][_0x0cf2('0x6f')][_0x0cf2('0x5e')];_0x520016+=0x1){socket[_0x0cf2('0xe5')](_0x0cf2('0xe8'),{'UserId':Number(_0x39559f[_0x0cf2('0x4a')][_0x0cf2('0x6f')][_0x520016]),'SmsAccountId':Number(_0x39559f[_0x0cf2('0x5c')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x39559f['query'][_0x0cf2('0x6f')]),'SmsAccountId':Number(_0x39559f[_0x0cf2('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x239bf7,null))['catch'](handleError(_0x239bf7,null));};exports[_0x0cf2('0xe9')]=function(_0x1039ad,_0x556281,_0xaaadb7){var _0x1c8f84={};var _0x2fbbe9={};var _0x199731;var _0x51267e;return db[_0x0cf2('0x47')][_0x0cf2('0x6a')]({'where':{'id':_0x1039ad[_0x0cf2('0x5c')]['id']}})[_0x0cf2('0x3d')](handleEntityNotFound(_0x556281,null))[_0x0cf2('0x3d')](function(_0x27c751){if(_0x27c751){_0x199731=_0x27c751;_0x2fbbe9[_0x0cf2('0x49')]=_[_0x0cf2('0x4b')](db[_0x0cf2('0xb1')][_0x0cf2('0x5d')]);_0x2fbbe9[_0x0cf2('0x4a')]=_[_0x0cf2('0x4b')](_0x1039ad['query']);_0x2fbbe9[_0x0cf2('0x4c')]=_[_0x0cf2('0x4d')](_0x2fbbe9[_0x0cf2('0x49')],_0x2fbbe9[_0x0cf2('0x4a')]);_0x1c8f84['attributes']=_['intersection'](_0x2fbbe9[_0x0cf2('0x49')],qs[_0x0cf2('0x4f')](_0x1039ad['query'][_0x0cf2('0x4f')]));_0x1c8f84[_0x0cf2('0x4e')]=_0x1c8f84[_0x0cf2('0x4e')][_0x0cf2('0x5e')]?_0x1c8f84[_0x0cf2('0x4e')]:_0x2fbbe9[_0x0cf2('0x49')];_0x1c8f84[_0x0cf2('0x51')]=qs[_0x0cf2('0x52')](_0x1039ad['query'][_0x0cf2('0x52')]);_0x1c8f84[_0x0cf2('0x53')]=qs[_0x0cf2('0x4c')](_[_0x0cf2('0x54')](_0x1039ad['query'],_0x2fbbe9['filters']));if(_0x1039ad[_0x0cf2('0x4a')][_0x0cf2('0x55')]){_0x1c8f84[_0x0cf2('0x53')]=_[_0x0cf2('0x57')](_0x1c8f84['where'],{'$or':_[_0x0cf2('0x46')](_0x1c8f84[_0x0cf2('0x4e')],function(_0x16c3af){var _0x3853d5={};_0x3853d5[_0x16c3af]={'$like':'%'+_0x1039ad[_0x0cf2('0x4a')][_0x0cf2('0x55')]+'%'};return _0x3853d5;})});}_0x1c8f84=_[_0x0cf2('0x57')]({},_0x1c8f84,_0x1039ad[_0x0cf2('0x58')]);return _0x199731[_0x0cf2('0xe9')](_0x1c8f84);}})[_0x0cf2('0x3d')](function(_0x2bb683){if(_0x2bb683){_0x51267e=_0x2bb683['length'];if(!_0x1039ad['query'][_0x0cf2('0x6b')](_0x0cf2('0x50'))){_0x1c8f84[_0x0cf2('0x33')]=qs['limit'](_0x1039ad[_0x0cf2('0x4a')][_0x0cf2('0x33')]);_0x1c8f84[_0x0cf2('0x32')]=qs[_0x0cf2('0x32')](_0x1039ad[_0x0cf2('0x4a')][_0x0cf2('0x32')]);}return _0x199731[_0x0cf2('0xe9')](_0x1c8f84);}})['then'](function(_0x5f03a5){if(_0x5f03a5){return _0x5f03a5?{'count':_0x51267e,'rows':_0x5f03a5}:null;}})[_0x0cf2('0x3d')](respondWithResult(_0x556281,null))[_0x0cf2('0x2d')](handleError(_0x556281,null));}; \ No newline at end of file +var _0x8929=['apply','reject','save','destroy','SmsAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','length','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','Body','messageId','MessageSid','text','connectel','message_id','plivo','From','Text','infobip','results','csc','fromNumber','replyMessageId','bandwidth','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','Contacts','list','CmContact','contact','SmsInteraction','spread','interaction','created','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','sequelize','transaction','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','List','DESC','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','groupName','clickatell','redif','DELIVERED','update','clicksend','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','intelepeer','DELIVRD','message-id','state','addAgents','omit','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','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','register','client','http','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range'];(function(_0x546c4d,_0x461326){var _0x279afc=function(_0x3c888d){while(--_0x3c888d){_0x546c4d['push'](_0x546c4d['shift']());}};_0x279afc(++_0x461326);}(_0x8929,0x18b));var _0x9892=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x8929[_0x1deb03];return _0x189fe7;};'use strict';var emlformat=require(_0x9892('0x0'));var rimraf=require(_0x9892('0x1'));var zipdir=require(_0x9892('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9892('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9892('0x4'));var path=require(_0x9892('0x5'));var sox=require(_0x9892('0x6'));var csv=require('to-csv');var ejs=require(_0x9892('0x7'));var fs=require('fs');var fs_extra=require(_0x9892('0x8'));var _=require('lodash');var squel=require(_0x9892('0x9'));var crypto=require('crypto');var jsforce=require(_0x9892('0xa'));var deskjs=require(_0x9892('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9892('0xc'));var Papa=require(_0x9892('0xd'));var Redis=require(_0x9892('0xe'));var authService=require(_0x9892('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9892('0x10'));var hardwareService=require(_0x9892('0x11'));var logger=require('../../config/logger')(_0x9892('0x12'));var utils=require(_0x9892('0x13'));var config=require(_0x9892('0x14'));var licenseUtil=require(_0x9892('0x15'));var db=require(_0x9892('0x16'))['db'];config[_0x9892('0x17')]=_[_0x9892('0x18')](config[_0x9892('0x17')],{'host':_0x9892('0x19'),'port':0x18eb});var socket=require(_0x9892('0x1a'))(new Redis(config[_0x9892('0x17')]));require('./smsAccount.socket')[_0x9892('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9892('0x1c')][_0x9892('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x16a9ea,_0x59a3a2,_0x557c38,_0x2cb8f1){return new BPromise(function(_0x2c3fab,_0x179815){var _0x705f12=_0x2cb8f1||client;return _0x705f12[_0x9892('0x1e')](_0x16a9ea,_0x557c38)[_0x9892('0x1f')](function(_0x254530){logger[_0x9892('0x20')]('SmsAccount,\x20%s,\x20%s',_0x59a3a2,_0x9892('0x21'));logger[_0x9892('0x22')](_0x9892('0x23'),_0x59a3a2,_0x9892('0x21'),JSON['stringify'](_0x254530));if(_0x254530[_0x9892('0x24')]){if(_0x254530[_0x9892('0x24')][_0x9892('0x25')]===0x1f4){logger[_0x9892('0x24')](_0x9892('0x26'),_0x59a3a2,_0x254530[_0x9892('0x24')]['message']);return _0x179815(_0x254530[_0x9892('0x24')][_0x9892('0x27')]);}logger[_0x9892('0x24')](_0x9892('0x26'),_0x59a3a2,_0x254530[_0x9892('0x24')][_0x9892('0x27')]);return _0x2c3fab(_0x254530['error']['message']);}else{logger[_0x9892('0x20')]('SmsAccount,\x20%s,\x20%s',_0x59a3a2,_0x9892('0x21'));_0x2c3fab(_0x254530[_0x9892('0x28')][_0x9892('0x27')]);}})[_0x9892('0x29')](function(_0x194878){logger['error'](_0x9892('0x26'),_0x59a3a2,_0x194878);_0x179815(_0x194878);});});}function respondWithStatusCode(_0x1f4b8d,_0x3444ff){_0x3444ff=_0x3444ff||0xcc;return function(_0x5a5671){if(_0x5a5671){return _0x1f4b8d[_0x9892('0x2a')](_0x3444ff);}return _0x1f4b8d[_0x9892('0x2b')](_0x3444ff)['end']();};}function respondWithResult(_0x31b5cd,_0x915b22){_0x915b22=_0x915b22||0xc8;return function(_0x58fc94){if(_0x58fc94){return _0x31b5cd[_0x9892('0x2b')](_0x915b22)[_0x9892('0x2c')](_0x58fc94);}};}function respondWithFilteredResult(_0x14211b,_0x4c0a0e){return function(_0x56c931){if(_0x56c931){var _0x5715a6=typeof _0x4c0a0e['offset']===_0x9892('0x2d')&&typeof _0x4c0a0e[_0x9892('0x2e')]===_0x9892('0x2d');var _0x2d2354=_0x56c931['count'];var _0x949911=_0x5715a6?0x0:_0x4c0a0e[_0x9892('0x2f')];var _0x42a004=_0x5715a6?_0x56c931[_0x9892('0x30')]:_0x4c0a0e['offset']+_0x4c0a0e[_0x9892('0x2e')];var _0x2da7f6;if(_0x42a004>=_0x2d2354){_0x42a004=_0x2d2354;_0x2da7f6=0xc8;}else{_0x2da7f6=0xce;}_0x14211b[_0x9892('0x2b')](_0x2da7f6);return _0x14211b[_0x9892('0x31')](_0x9892('0x32'),_0x949911+'-'+_0x42a004+'/'+_0x2d2354)['json'](_0x56c931);}return null;};}function patchUpdates(_0xcda26){return function(_0x271ec3){try{jsonpatch[_0x9892('0x33')](_0x271ec3,_0xcda26,!![]);}catch(_0x3e22d9){return BPromise[_0x9892('0x34')](_0x3e22d9);}return _0x271ec3[_0x9892('0x35')]();};}function saveUpdates(_0x3ddb29,_0x447f0c){return function(_0x50cb26){if(_0x50cb26){return _0x50cb26['update'](_0x3ddb29)['then'](function(_0x240873){return _0x240873;});}return null;};}function removeEntity(_0x44623c,_0x53a6d2){return function(_0x536e74){if(_0x536e74){return _0x536e74[_0x9892('0x36')]()['then'](function(){var _0x3cd599=_0x536e74['get']({'plain':!![]});var _0x50c525=_0x9892('0x37');return db['UserProfileResource'][_0x9892('0x36')]({'where':{'type':_0x50c525,'resourceId':_0x3cd599['id']}})['then'](function(){return _0x536e74;});})[_0x9892('0x1f')](function(){_0x44623c['status'](0xcc)[_0x9892('0x38')]();});}};}function handleEntityNotFound(_0x31bef1,_0x1176cb){return function(_0x3cc013){if(!_0x3cc013){_0x31bef1[_0x9892('0x2a')](0x194);}return _0x3cc013;};}function handleError(_0x3ccaf6,_0x3f80c6){_0x3f80c6=_0x3f80c6||0x1f4;return function(_0x3ad45d){logger['error'](_0x3ad45d[_0x9892('0x39')]);if(_0x3ad45d['name']){delete _0x3ad45d[_0x9892('0x3a')];}_0x3ccaf6['status'](_0x3f80c6)[_0x9892('0x3b')](_0x3ad45d);};}exports[_0x9892('0x3c')]=function(_0x466f34,_0x8e48e2){var _0x39db81={'include':[{'model':db[_0x9892('0x3d')],'as':_0x9892('0x3e')}]},_0x5b37b5={},_0x811b3a={'count':0x0,'rows':[]};var _0x16dc3f=_[_0x9892('0x3f')](db[_0x9892('0x40')][_0x9892('0x41')],function(_0x4a1315){return{'name':_0x4a1315[_0x9892('0x42')],'type':_0x4a1315[_0x9892('0x43')][_0x9892('0x44')]};});_0x5b37b5[_0x9892('0x45')]=_[_0x9892('0x3f')](_0x16dc3f,_0x9892('0x3a'));_0x5b37b5[_0x9892('0x46')]=_[_0x9892('0x47')](_0x466f34[_0x9892('0x46')]);_0x5b37b5['filters']=_[_0x9892('0x48')](_0x5b37b5[_0x9892('0x45')],_0x5b37b5['query']);_0x39db81[_0x9892('0x49')]=_[_0x9892('0x48')](_0x5b37b5[_0x9892('0x45')],qs[_0x9892('0x4a')](_0x466f34[_0x9892('0x46')][_0x9892('0x4a')]));_0x39db81[_0x9892('0x49')]=_0x39db81['attributes']['length']?_0x39db81['attributes']:_0x5b37b5[_0x9892('0x45')];if(!_0x466f34[_0x9892('0x46')][_0x9892('0x4b')](_0x9892('0x4c'))){_0x39db81[_0x9892('0x2e')]=qs[_0x9892('0x2e')](_0x466f34['query'][_0x9892('0x2e')]);_0x39db81[_0x9892('0x2f')]=qs['offset'](_0x466f34['query'][_0x9892('0x2f')]);}_0x39db81[_0x9892('0x4d')]=qs[_0x9892('0x4e')](_0x466f34['query'][_0x9892('0x4e')]);_0x39db81['where']=qs[_0x9892('0x4f')](_[_0x9892('0x50')](_0x466f34[_0x9892('0x46')],_0x5b37b5[_0x9892('0x4f')]),_0x16dc3f);if(_0x466f34[_0x9892('0x46')]['filter']){_0x39db81[_0x9892('0x51')]=_[_0x9892('0x52')](_0x39db81[_0x9892('0x51')],{'$or':_[_0x9892('0x3f')](_0x16dc3f,function(_0x4b617f){if(_0x4b617f[_0x9892('0x43')]!==_0x9892('0x53')){var _0x1e368e={};_0x1e368e[_0x4b617f['name']]={'$like':'%'+_0x466f34[_0x9892('0x46')][_0x9892('0x54')]+'%'};return _0x1e368e;}})});}_0x39db81=_['merge']({},_0x39db81,_0x466f34['options']);var _0x592c62={'where':_0x39db81[_0x9892('0x51')]};return db[_0x9892('0x40')][_0x9892('0x30')](_0x592c62)[_0x9892('0x1f')](function(_0x52aede){_0x811b3a[_0x9892('0x30')]=_0x52aede;if(_0x466f34['query'][_0x9892('0x55')]){_0x39db81['include']=[{'all':!![]}];}return db[_0x9892('0x40')][_0x9892('0x56')](_0x39db81);})[_0x9892('0x1f')](function(_0x2b1c99){_0x811b3a[_0x9892('0x57')]=_0x2b1c99;return _0x811b3a;})[_0x9892('0x1f')](respondWithFilteredResult(_0x8e48e2,_0x39db81))[_0x9892('0x29')](handleError(_0x8e48e2,null));};exports[_0x9892('0x58')]=function(_0x421907,_0x91085){var _0x3812bb={'raw':![],'where':{'id':_0x421907[_0x9892('0x59')]['id']},'include':[{'model':db[_0x9892('0x3d')],'as':'mandatoryDispositionPause'}]},_0x203e79={};_0x203e79[_0x9892('0x45')]=_[_0x9892('0x47')](db[_0x9892('0x40')][_0x9892('0x41')]);_0x203e79[_0x9892('0x46')]=_[_0x9892('0x47')](_0x421907[_0x9892('0x46')]);_0x203e79[_0x9892('0x4f')]=_[_0x9892('0x48')](_0x203e79[_0x9892('0x45')],_0x203e79[_0x9892('0x46')]);_0x3812bb[_0x9892('0x49')]=_[_0x9892('0x48')](_0x203e79[_0x9892('0x45')],qs['fields'](_0x421907[_0x9892('0x46')][_0x9892('0x4a')]));_0x3812bb[_0x9892('0x49')]=_0x3812bb[_0x9892('0x49')]['length']?_0x3812bb[_0x9892('0x49')]:_0x203e79[_0x9892('0x45')];if(_0x421907[_0x9892('0x46')][_0x9892('0x55')]){_0x3812bb[_0x9892('0x5a')]=[{'all':!![]}];}_0x3812bb=_[_0x9892('0x52')]({},_0x3812bb,_0x421907[_0x9892('0x5b')]);return db[_0x9892('0x40')][_0x9892('0x5c')](_0x3812bb)['then'](handleEntityNotFound(_0x91085,null))['then'](respondWithResult(_0x91085,null))['catch'](handleError(_0x91085,null));};exports[_0x9892('0x5d')]=function(_0xc54c03,_0x5ee072){return db[_0x9892('0x40')][_0x9892('0x5d')](_0xc54c03[_0x9892('0x5e')],{})['then'](function(_0x1deae1){var _0x2c16a0=_0xc54c03[_0x9892('0x5f')][_0x9892('0x60')]({'plain':!![]});if(!_0x2c16a0)throw new Error(_0x9892('0x61'));if(_0x2c16a0[_0x9892('0x62')]===_0x9892('0x5f')){var _0x2c1761=_0x1deae1['get']({'plain':!![]});var _0x3921b3=_0x9892('0x37');return db[_0x9892('0x63')][_0x9892('0x5c')]({'where':{'name':_0x3921b3,'userProfileId':_0x2c16a0[_0x9892('0x64')]},'raw':!![]})['then'](function(_0xfb93b7){if(_0xfb93b7&&_0xfb93b7[_0x9892('0x65')]===0x0){return db[_0x9892('0x66')]['create']({'name':_0x2c1761[_0x9892('0x3a')],'resourceId':_0x2c1761['id'],'type':_0xfb93b7[_0x9892('0x3a')],'sectionId':_0xfb93b7['id']},{})['then'](function(){return _0x1deae1;});}else{return _0x1deae1;}})[_0x9892('0x29')](function(_0x3aff9b){logger[_0x9892('0x24')](_0x9892('0x67'),_0x3aff9b);throw _0x3aff9b;});}return _0x1deae1;})['then'](respondWithResult(_0x5ee072,0xc9))[_0x9892('0x29')](handleError(_0x5ee072,null));};exports['update']=function(_0x3ce47e,_0xcd3ea){if(_0x3ce47e[_0x9892('0x5e')]['id']){delete _0x3ce47e[_0x9892('0x5e')]['id'];}return db[_0x9892('0x40')]['find']({'where':{'id':_0x3ce47e[_0x9892('0x59')]['id']},'include':[{'model':db[_0x9892('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x9892('0x1f')](handleEntityNotFound(_0xcd3ea,null))[_0x9892('0x1f')](saveUpdates(_0x3ce47e[_0x9892('0x5e')],null))[_0x9892('0x1f')](respondWithResult(_0xcd3ea,null))['catch'](handleError(_0xcd3ea,null));};exports['destroy']=function(_0x50bfaf,_0x3ee9a1){return db[_0x9892('0x40')][_0x9892('0x5c')]({'where':{'id':_0x50bfaf[_0x9892('0x59')]['id']}})['then'](handleEntityNotFound(_0x3ee9a1,null))[_0x9892('0x1f')](removeEntity(_0x3ee9a1,null))['catch'](handleError(_0x3ee9a1,null));};exports[_0x9892('0x68')]=function(_0x5c0456,_0x4a871c){return db[_0x9892('0x40')][_0x9892('0x68')]()[_0x9892('0x1f')](respondWithResult(_0x4a871c,null))['catch'](handleError(_0x4a871c,null));};exports['addDisposition']=function(_0x98fada,_0x19297c,_0x437ef5){if(_0x98fada[_0x9892('0x5e')]['id']){delete _0x98fada[_0x9892('0x5e')]['id'];}return db[_0x9892('0x40')][_0x9892('0x5c')]({'where':{'id':_0x98fada[_0x9892('0x59')]['id']}})['then'](handleEntityNotFound(_0x19297c,null))[_0x9892('0x1f')](function(_0x18fce8){if(_0x18fce8){_0x98fada[_0x9892('0x5e')][_0x9892('0x69')]=_0x18fce8['id'];return db[_0x9892('0x6a')][_0x9892('0x5d')](_0x98fada['body']);}})['then'](respondWithResult(_0x19297c,null))['catch'](handleError(_0x19297c,null));};exports[_0x9892('0x6b')]=function(_0x157ac6,_0x12d35a,_0x11a01f){var _0x10129a={'raw':![],'where':{}};var _0x3297f6={};var _0x9ed858={'count':0x0,'rows':[]};return db[_0x9892('0x40')][_0x9892('0x6c')]({'where':{'id':_0x157ac6[_0x9892('0x59')]['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x12d35a,null))[_0x9892('0x1f')](function(_0x238365){if(_0x238365){_0x3297f6[_0x9892('0x45')]=_[_0x9892('0x47')](db[_0x9892('0x6a')]['rawAttributes']);_0x3297f6[_0x9892('0x46')]=_[_0x9892('0x47')](_0x157ac6[_0x9892('0x46')]);_0x3297f6[_0x9892('0x4f')]=_['intersection'](_0x3297f6[_0x9892('0x45')],_0x3297f6[_0x9892('0x46')]);_0x10129a[_0x9892('0x49')]=_[_0x9892('0x48')](_0x3297f6[_0x9892('0x45')],qs[_0x9892('0x4a')](_0x157ac6[_0x9892('0x46')]['fields']));_0x10129a[_0x9892('0x49')]=_0x10129a['attributes']['length']?_0x10129a[_0x9892('0x49')]:_0x3297f6[_0x9892('0x45')];if(!_0x157ac6[_0x9892('0x46')][_0x9892('0x4b')]('nolimit')){_0x10129a[_0x9892('0x2e')]=qs[_0x9892('0x2e')](_0x157ac6[_0x9892('0x46')][_0x9892('0x2e')]);_0x10129a[_0x9892('0x2f')]=qs[_0x9892('0x2f')](_0x157ac6['query']['offset']);}_0x10129a[_0x9892('0x4d')]=qs[_0x9892('0x4e')](_0x157ac6['query'][_0x9892('0x4e')]);_0x10129a[_0x9892('0x51')]=qs[_0x9892('0x4f')](_[_0x9892('0x50')](_0x157ac6[_0x9892('0x46')],_0x3297f6[_0x9892('0x4f')]));_0x10129a[_0x9892('0x51')]['SmsAccountId']=_0x238365['id'];if(_0x157ac6['query'][_0x9892('0x54')]){_0x10129a[_0x9892('0x51')]=_[_0x9892('0x52')](_0x10129a[_0x9892('0x51')],{'$or':_[_0x9892('0x3f')](_0x10129a['attributes'],function(_0x46534d){var _0x322eb8={};_0x322eb8[_0x46534d]={'$like':'%'+_0x157ac6['query'][_0x9892('0x54')]+'%'};return _0x322eb8;})});}_0x10129a=_[_0x9892('0x52')]({},_0x10129a,_0x157ac6[_0x9892('0x5b')]);return db[_0x9892('0x6a')]['count']({'where':_0x10129a[_0x9892('0x51')]})['then'](function(_0x1e996d){_0x9ed858[_0x9892('0x30')]=_0x1e996d;if(_0x157ac6[_0x9892('0x46')][_0x9892('0x55')]){_0x10129a['include']=[{'all':!![]}];}return db['Disposition'][_0x9892('0x56')](_0x10129a);})[_0x9892('0x1f')](function(_0x44b8bc){_0x9ed858[_0x9892('0x57')]=_0x44b8bc;return _0x9ed858;});}})[_0x9892('0x1f')](respondWithFilteredResult(_0x12d35a,_0x10129a))[_0x9892('0x29')](handleError(_0x12d35a,null));};exports[_0x9892('0x6d')]=function(_0x7164a,_0x1bcfa1,_0x338d4c){return db[_0x9892('0x40')][_0x9892('0x5c')]({'where':{'id':_0x7164a['params']['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x1bcfa1,null))[_0x9892('0x1f')](function(_0x4362b2){if(_0x4362b2){return _0x4362b2[_0x9892('0x6d')](_0x7164a[_0x9892('0x46')][_0x9892('0x6e')]);}})[_0x9892('0x1f')](respondWithStatusCode(_0x1bcfa1,null))[_0x9892('0x29')](handleError(_0x1bcfa1,null));};exports['addAnswer']=function(_0x52eef1,_0x1a4405,_0x2a26cc){if(_0x52eef1[_0x9892('0x5e')]['id']){delete _0x52eef1[_0x9892('0x5e')]['id'];}return db[_0x9892('0x40')]['find']({'where':{'id':_0x52eef1[_0x9892('0x59')]['id']}})['then'](handleEntityNotFound(_0x1a4405,null))[_0x9892('0x1f')](function(_0x5a5c8a){if(_0x5a5c8a){_0x52eef1[_0x9892('0x5e')][_0x9892('0x69')]=_0x5a5c8a['id'];return db[_0x9892('0x6f')][_0x9892('0x5d')](_0x52eef1[_0x9892('0x5e')]);}})[_0x9892('0x1f')](respondWithResult(_0x1a4405,null))[_0x9892('0x29')](handleError(_0x1a4405,null));};exports[_0x9892('0x70')]=function(_0x43455e,_0x3d2e99,_0x6c03a3){var _0x486813={'raw':![],'where':{}};var _0x559675={};var _0x43f443={'count':0x0,'rows':[]};return db['SmsAccount'][_0x9892('0x6c')]({'where':{'id':_0x43455e[_0x9892('0x59')]['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x3d2e99,null))['then'](function(_0xaa8576){if(_0xaa8576){_0x559675['model']=_[_0x9892('0x47')](db[_0x9892('0x6f')][_0x9892('0x41')]);_0x559675[_0x9892('0x46')]=_[_0x9892('0x47')](_0x43455e['query']);_0x559675[_0x9892('0x4f')]=_['intersection'](_0x559675[_0x9892('0x45')],_0x559675[_0x9892('0x46')]);_0x486813[_0x9892('0x49')]=_[_0x9892('0x48')](_0x559675[_0x9892('0x45')],qs[_0x9892('0x4a')](_0x43455e['query']['fields']));_0x486813[_0x9892('0x49')]=_0x486813[_0x9892('0x49')][_0x9892('0x71')]?_0x486813[_0x9892('0x49')]:_0x559675[_0x9892('0x45')];if(!_0x43455e[_0x9892('0x46')][_0x9892('0x4b')](_0x9892('0x4c'))){_0x486813[_0x9892('0x2e')]=qs[_0x9892('0x2e')](_0x43455e[_0x9892('0x46')][_0x9892('0x2e')]);_0x486813[_0x9892('0x2f')]=qs[_0x9892('0x2f')](_0x43455e[_0x9892('0x46')][_0x9892('0x2f')]);}_0x486813[_0x9892('0x4d')]=qs[_0x9892('0x4e')](_0x43455e[_0x9892('0x46')][_0x9892('0x4e')]);_0x486813[_0x9892('0x51')]=qs[_0x9892('0x4f')](_[_0x9892('0x50')](_0x43455e[_0x9892('0x46')],_0x559675[_0x9892('0x4f')]));_0x486813[_0x9892('0x51')][_0x9892('0x69')]=_0xaa8576['id'];if(_0x43455e[_0x9892('0x46')]['filter']){_0x486813[_0x9892('0x51')]=_[_0x9892('0x52')](_0x486813[_0x9892('0x51')],{'$or':_[_0x9892('0x3f')](_0x486813[_0x9892('0x49')],function(_0x4c27a9){var _0x252fe0={};_0x252fe0[_0x4c27a9]={'$like':'%'+_0x43455e[_0x9892('0x46')][_0x9892('0x54')]+'%'};return _0x252fe0;})});}_0x486813=_['merge']({},_0x486813,_0x43455e[_0x9892('0x5b')]);return db['CannedAnswer'][_0x9892('0x30')]({'where':_0x486813['where']})[_0x9892('0x1f')](function(_0x3905fe){_0x43f443[_0x9892('0x30')]=_0x3905fe;if(_0x43455e[_0x9892('0x46')][_0x9892('0x55')]){_0x486813[_0x9892('0x5a')]=[{'all':!![]}];}return db[_0x9892('0x6f')]['findAll'](_0x486813);})[_0x9892('0x1f')](function(_0x3243a5){_0x43f443['rows']=_0x3243a5;return _0x43f443;});}})[_0x9892('0x1f')](respondWithFilteredResult(_0x3d2e99,_0x486813))[_0x9892('0x29')](handleError(_0x3d2e99,null));};exports[_0x9892('0x72')]=function(_0x290c65,_0x5c7043,_0x258415){return db[_0x9892('0x40')]['find']({'where':{'id':_0x290c65[_0x9892('0x59')]['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x5c7043,null))[_0x9892('0x1f')](function(_0x1e4f2b){if(_0x1e4f2b){return _0x1e4f2b['removeAnswers'](_0x290c65[_0x9892('0x46')]['ids']);}})[_0x9892('0x1f')](respondWithStatusCode(_0x5c7043,null))[_0x9892('0x29')](handleError(_0x5c7043,null));};exports[_0x9892('0x73')]=function(_0x2a4865,_0x23dfce,_0x4a3b53){var _0x21547f={'channel':_0x9892('0x74')};var _0x23d9c6=[];var _0x5702cc=[];var _0x67617a={};return db['SmsAccount']['find']({'where':{'id':_0x2a4865[_0x9892('0x59')]['id']},'include':[{'model':db[_0x9892('0x75')],'as':_0x9892('0x76')}]})[_0x9892('0x1f')](handleEntityNotFound(_0x23dfce,null))['then'](function(_0x1a2b0c){_0x21547f[_0x9892('0x77')]=_0x1a2b0c;_0x21547f[_0x9892('0x78')]=_[_0x9892('0x79')](_0x1a2b0c[_0x9892('0x76')],['priority'],['asc']);if(_0x21547f[_0x9892('0x77')][_0x9892('0x76')]){delete _0x21547f[_0x9892('0x77')][_0x9892('0x76')];}return db['CmContact'][_0x9892('0x68')]();})['then'](function(_0x35a7bf){if(!_0x35a7bf){throw new db[(_0x9892('0x7a'))][(_0x9892('0x7b'))](_0x9892('0x7c'));}_0x23d9c6=_[_0x9892('0x7d')](_['keys'](_0x35a7bf),[_0x9892('0x7e'),'updatedAt']);_0x5702cc=_[_0x9892('0x7d')](_[_0x9892('0x47')](_0x35a7bf),[_0x9892('0x7e'),_0x9892('0x7f'),_0x9892('0x80'),'ListId']);_0x21547f['body']={'mapKey':_0x9892('0x81')};if(_0x21547f[_0x9892('0x77')][_0x9892('0x43')]){switch(_0x21547f[_0x9892('0x77')]['type']){case _0x9892('0x82'):_0x21547f[_0x9892('0x5e')][_0x9892('0x83')]=_0x2a4865['body']['From'];_0x21547f[_0x9892('0x5e')][_0x9892('0x5e')]=_0x2a4865[_0x9892('0x5e')][_0x9892('0x84')];_0x21547f[_0x9892('0x5e')][_0x9892('0x85')]=_0x2a4865['body'][_0x9892('0x86')];break;case'skebby':_0x21547f[_0x9892('0x5e')][_0x9892('0x83')]='+'+_0x2a4865[_0x9892('0x5e')]['sender'];_0x21547f[_0x9892('0x5e')][_0x9892('0x5e')]=_0x2a4865[_0x9892('0x5e')][_0x9892('0x87')];break;case _0x9892('0x88'):_0x21547f[_0x9892('0x5e')][_0x9892('0x83')]=_0x2a4865['body']['from'];_0x21547f[_0x9892('0x5e')][_0x9892('0x5e')]=_0x2a4865[_0x9892('0x5e')]['message'];break;case'clicksend':_0x21547f[_0x9892('0x5e')][_0x9892('0x83')]=_0x2a4865[_0x9892('0x5e')][_0x9892('0x83')];_0x21547f[_0x9892('0x5e')][_0x9892('0x5e')]=_0x2a4865['body'][_0x9892('0x5e')];_0x21547f[_0x9892('0x5e')]['messageId']=_0x2a4865[_0x9892('0x5e')][_0x9892('0x89')];break;case _0x9892('0x8a'):_0x21547f[_0x9892('0x5e')][_0x9892('0x83')]=_0x2a4865[_0x9892('0x5e')][_0x9892('0x8b')];_0x21547f[_0x9892('0x5e')][_0x9892('0x5e')]=_0x2a4865[_0x9892('0x5e')][_0x9892('0x8c')];_0x21547f[_0x9892('0x5e')][_0x9892('0x85')]=_0x2a4865[_0x9892('0x5e')]['MessageUUID'];break;case _0x9892('0x8d'):_0x21547f[_0x9892('0x5e')][_0x9892('0x83')]='+'+_0x2a4865['body'][_0x9892('0x8e')][0x0][_0x9892('0x83')];_0x21547f[_0x9892('0x5e')][_0x9892('0x5e')]=_0x2a4865[_0x9892('0x5e')]['results'][0x0]['text'];_0x21547f[_0x9892('0x5e')][_0x9892('0x85')]=_0x2a4865[_0x9892('0x5e')][_0x9892('0x8e')][0x0][_0x9892('0x85')];break;case _0x9892('0x8f'):_0x21547f[_0x9892('0x5e')]['from']=_0x2a4865['body']['originatingAddress'];_0x21547f['body'][_0x9892('0x5e')]=_0x2a4865[_0x9892('0x5e')]['segmentedMessage'][_0x9892('0x27')];break;case'clickatell':_0x21547f[_0x9892('0x5e')][_0x9892('0x83')]=_0x2a4865[_0x9892('0x5e')][_0x9892('0x90')];_0x21547f['body'][_0x9892('0x5e')]=_0x2a4865['body'][_0x9892('0x87')];_0x21547f[_0x9892('0x5e')][_0x9892('0x85')]=_0x2a4865[_0x9892('0x5e')][_0x9892('0x91')];break;case _0x9892('0x92'):_0x21547f['body']['messageId']=_0x2a4865[_0x9892('0x5e')][0x0]['message']['id'];_0x21547f[_0x9892('0x5e')][_0x9892('0x83')]=_0x2a4865[_0x9892('0x5e')][0x0][_0x9892('0x27')]['from'];_0x21547f['body'][_0x9892('0x5e')]=_0x2a4865['body'][0x0][_0x9892('0x27')][_0x9892('0x87')];break;case'intelepeer':_0x21547f['body'][_0x9892('0x83')]=_0x2a4865[_0x9892('0x5e')][_0x9892('0x83')];_0x21547f['body'][_0x9892('0x5e')]=_0x2a4865['body'][_0x9892('0x27')];_0x21547f[_0x9892('0x5e')][_0x9892('0x85')]=_0x2a4865[_0x9892('0x5e')]['refid'];break;}}if(_0x21547f[_0x9892('0x5e')]['id']){delete _0x21547f['body']['id'];}if(_[_0x9892('0x93')](_0x21547f[_0x9892('0x5e')]['from'])){throw new db['Sequelize']['ValidationError'](_0x9892('0x94'));}if(_[_0x9892('0x93')](_0x21547f['body'][_0x9892('0x5e')])||_0x21547f[_0x9892('0x5e')]['body']===''){throw new db[(_0x9892('0x7a'))][(_0x9892('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9892('0x93')](_0x21547f[_0x9892('0x5e')][_0x9892('0x95')])){throw new db['Sequelize'][(_0x9892('0x7b'))](_0x9892('0x96')+_0x5702cc);}if(!_[_0x9892('0x97')](_0x5702cc,_0x21547f['body'][_0x9892('0x95')])){throw new db[(_0x9892('0x7a'))][(_0x9892('0x7b'))](_0x9892('0x98')+_0x5702cc);}_0x67617a[_0x21547f[_0x9892('0x5e')][_0x9892('0x95')]]=_0x21547f[_0x9892('0x5e')]['from'];return db[_0x9892('0x99')][_0x9892('0x5c')]({'where':{'id':_0x21547f[_0x9892('0x77')][_0x9892('0x9a')]},'include':[{'model':db['CmContact'],'as':_0x9892('0x9b'),'where':_0x67617a,'limit':0x1,'order':[[_0x9892('0x7f'),'DESC']]}]});})[_0x9892('0x1f')](handleEntityNotFound(_0x23dfce,null))[_0x9892('0x1f')](function(_0x583271){if(_0x583271){_0x21547f[_0x9892('0x9c')]=_['omit'](_0x583271,[_0x9892('0x9b')]);if(_0x583271['Contacts'][_0x9892('0x71')]){return _0x583271[_0x9892('0x9b')][0x0];}var _0x47620b=_[_0x9892('0x18')](_0x21547f[_0x9892('0x5e')],{'firstName':_0x21547f[_0x9892('0x5e')]['from'],'ListId':_0x583271['id']});_0x47620b[_0x21547f[_0x9892('0x5e')]['mapKey']]=_0x21547f[_0x9892('0x5e')][_0x9892('0x83')];return db[_0x9892('0x9d')][_0x9892('0x5d')](_0x47620b,{'fields':_0x23d9c6,'raw':!![]});}})[_0x9892('0x1f')](handleEntityNotFound(_0x23dfce,null))[_0x9892('0x1f')](function(_0x4e77ca){if(_0x4e77ca){_0x21547f[_0x9892('0x9e')]=_0x4e77ca;var _0x3b9305={'ContactId':_0x4e77ca['id'],'phone':_0x21547f[_0x9892('0x5e')]['from'],'SmsAccountId':_0x2a4865[_0x9892('0x59')]['id']};var _0x441225={'ContactId':_0x4e77ca['id'],'SmsAccountId':_0x2a4865[_0x9892('0x59')]['id'],'closed':![]};return db[_0x9892('0x9f')][_0x9892('0x5c')]({'where':_0x441225})[_0x9892('0x1f')](function(_0x3aebe4){if(_0x3aebe4){return[_0x3aebe4,![]];}return db[_0x9892('0x9f')][_0x9892('0x5d')](_0x3b9305)[_0x9892('0x1f')](function(_0x49bc8e){return[_0x49bc8e,!![]];});});}})[_0x9892('0xa0')](function(_0x438cdc,_0x189f69){_0x21547f[_0x9892('0xa1')]=_0x438cdc[_0x9892('0x60')]({'plain':!![]});_0x21547f[_0x9892('0xa1')][_0x9892('0xa2')]=![];if(_0x189f69){if(_0x21547f[_0x9892('0x77')]['autoclose']){_0x21547f[_0x9892('0x78')]['push']({'id':0x0,'priority':_0x21547f[_0x9892('0x78')][_0x9892('0x71')]+0x1,'app':_0x9892('0xa3'),'appdata':_0x9892('0xa4'),'interval':_0x9892('0xa5')});}_0x21547f[_0x9892('0xa1')][_0x9892('0xa2')]=!![];}return db[_0x9892('0xa6')]['create']({'phone':_0x21547f[_0x9892('0x5e')][_0x9892('0x83')],'messageId':_0x21547f[_0x9892('0x5e')][_0x9892('0x85')],'body':_0x21547f['body'][_0x9892('0x5e')],'SmsAccountId':_0x2a4865[_0x9892('0x59')]['id'],'SmsInteractionId':_0x438cdc['id'],'direction':'in','ContactId':_0x438cdc['ContactId'],'AttachmentId':_0x21547f[_0x9892('0x5e')][_0x9892('0xa7')]});})[_0x9892('0x1f')](function(_0x1e4489){_0x21547f['message']=_0x1e4489;if(_0x21547f[_0x9892('0xa1')][_0x9892('0xa8')]){return db[_0x9892('0xa9')][_0x9892('0x5c')]({'attributes':['id','name'],'where':{'id':_0x21547f[_0x9892('0xa1')][_0x9892('0xa8')]}})['then'](function(_0x5b8468){if(_0x5b8468){_0x21547f[_0x9892('0x78')][_0x9892('0xaa')]({'id':0x0,'priority':0x0,'app':_0x9892('0xab'),'appdata':_0x5b8468[_0x9892('0x3a')]+','+(_0x21547f[_0x9892('0x77')]['waitForTheAssignedAgent']||0xa),'interval':_0x9892('0xa5')});}return respondWithRpcPromise('Start',_0x9892('0xac'),_0x21547f);});}return respondWithRpcPromise('Start','startRouting',_0x21547f);})[_0x9892('0x1f')](function(_0x3bfab2){if(_0x3bfab2){var _0x3e879f=0xc8;var _0x3919c3=_0x9892('0xad');logger[_0x9892('0x20')](_0x9892('0x23'),_0x3919c3,_0x3e879f,_0x9892('0xae'));logger[_0x9892('0x22')](_0x9892('0xaf'),_0x3919c3,_0x3e879f,_0x9892('0xae'),JSON[_0x9892('0xb0')](_0x3bfab2));if(_0x21547f[_0x9892('0x77')]['type']===_0x9892('0x82')){return _0x23dfce[_0x9892('0x2b')](_0x3e879f)[_0x9892('0x31')](_0x9892('0xb1'),'text/xml')['send']('\x0a');}else{return _0x23dfce[_0x9892('0x2b')](_0x3e879f)['json'](_0x3bfab2);}}})[_0x9892('0x29')](handleError(_0x23dfce,null));};exports['addApplications']=function(_0x1a2895,_0x145efe,_0x511145){return db[_0x9892('0x40')]['findOne']({'where':{'id':_0x1a2895[_0x9892('0x59')]['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x145efe,null))['then'](function(_0x15c1d1){if(_0x15c1d1){return db[_0x9892('0xb2')][_0x9892('0xb3')](function(_0x46226f){return db[_0x9892('0x75')][_0x9892('0x36')]({'where':{'SmsAccountId':_0x1a2895[_0x9892('0x59')]['id']},'transaction':_0x46226f})[_0x9892('0x1f')](function(_0x18bdb3){var _0x3b96fe=_['map'](_0x1a2895[_0x9892('0x5e')],function(_0x46b920){_0x46b920[_0x9892('0x69')]=_0x1a2895[_0x9892('0x59')]['id'];return _0x46b920;});return db[_0x9892('0x75')]['bulkCreate'](_0x3b96fe,{'transaction':_0x46226f});});})['then'](function(){return db[_0x9892('0x75')][_0x9892('0xb4')]({'where':{'SmsAccountId':_0x1a2895[_0x9892('0x59')]['id']},'order':_0x9892('0xb5')});});}})['then'](respondWithResult(_0x145efe,null))[_0x9892('0x29')](handleError(_0x145efe,null));};exports['getApplications']=function(_0x2876b6,_0x1074b9,_0x500bf2){var _0x2dfcb3={};var _0x4d1e5f={};var _0x547780;var _0x36208b;return db['SmsAccount'][_0x9892('0x6c')]({'where':{'id':_0x2876b6[_0x9892('0x59')]['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x1074b9,null))[_0x9892('0x1f')](function(_0x3c9a7a){if(_0x3c9a7a){_0x547780=_0x3c9a7a;_0x4d1e5f[_0x9892('0x45')]=_[_0x9892('0x47')](db[_0x9892('0x75')]['rawAttributes']);_0x4d1e5f[_0x9892('0x46')]=_['keys'](_0x2876b6['query']);_0x4d1e5f[_0x9892('0x4f')]=_[_0x9892('0x48')](_0x4d1e5f[_0x9892('0x45')],_0x4d1e5f['query']);_0x2dfcb3['attributes']=_[_0x9892('0x48')](_0x4d1e5f[_0x9892('0x45')],qs[_0x9892('0x4a')](_0x2876b6['query'][_0x9892('0x4a')]));_0x2dfcb3['attributes']=_0x2dfcb3[_0x9892('0x49')][_0x9892('0x71')]?_0x2dfcb3[_0x9892('0x49')]:_0x4d1e5f[_0x9892('0x45')];_0x2dfcb3['order']=qs[_0x9892('0x4e')](_0x2876b6[_0x9892('0x46')][_0x9892('0x4e')]);_0x2dfcb3[_0x9892('0x51')]=qs[_0x9892('0x4f')](_[_0x9892('0x50')](_0x2876b6['query'],_0x4d1e5f['filters']));if(_0x2876b6[_0x9892('0x46')][_0x9892('0x54')]){_0x2dfcb3[_0x9892('0x51')]=_['merge'](_0x2dfcb3[_0x9892('0x51')],{'$or':_[_0x9892('0x3f')](_0x2dfcb3[_0x9892('0x49')],function(_0x51bb7f){var _0x3874ee={};_0x3874ee[_0x51bb7f]={'$like':'%'+_0x2876b6['query'][_0x9892('0x54')]+'%'};return _0x3874ee;})});}_0x2dfcb3=_[_0x9892('0x52')]({},_0x2dfcb3,_0x2876b6[_0x9892('0x5b')]);return _0x547780[_0x9892('0xb6')](_0x2dfcb3);}})['then'](function(_0x53f9b6){if(_0x53f9b6){_0x36208b=_0x53f9b6[_0x9892('0x71')];if(!_0x2876b6[_0x9892('0x46')][_0x9892('0x4b')](_0x9892('0x4c'))){_0x2dfcb3[_0x9892('0x2e')]=qs[_0x9892('0x2e')](_0x2876b6[_0x9892('0x46')]['limit']);_0x2dfcb3[_0x9892('0x2f')]=qs[_0x9892('0x2f')](_0x2876b6[_0x9892('0x46')]['offset']);}return _0x547780['getApplications'](_0x2dfcb3);}})[_0x9892('0x1f')](function(_0x2b635a){if(_0x2b635a){return _0x2b635a?{'count':_0x36208b,'rows':_0x2b635a}:null;}})[_0x9892('0x1f')](respondWithResult(_0x1074b9,null))[_0x9892('0x29')](handleError(_0x1074b9,null));};exports[_0x9892('0xb7')]=function(_0x835607,_0x5f4471,_0x656d54){var _0x26bda5={'raw':![],'where':{}};var _0x30b8cb={};var _0x14e21b={'count':0x0,'rows':[]};return db[_0x9892('0x40')][_0x9892('0x6c')]({'where':{'id':_0x835607[_0x9892('0x59')]['id']}})['then'](handleEntityNotFound(_0x5f4471,null))[_0x9892('0x1f')](function(_0x1acd97){if(_0x1acd97){_0x30b8cb[_0x9892('0x45')]=_[_0x9892('0x47')](db['SmsInteraction']['rawAttributes']);_0x30b8cb['query']=_[_0x9892('0x47')](_0x835607[_0x9892('0x46')]);_0x30b8cb[_0x9892('0x4f')]=_['intersection'](_0x30b8cb[_0x9892('0x45')],_0x30b8cb[_0x9892('0x46')]);_0x26bda5[_0x9892('0x49')]=_[_0x9892('0x48')](_0x30b8cb['model'],qs[_0x9892('0x4a')](_0x835607['query'][_0x9892('0x4a')]));_0x26bda5[_0x9892('0x49')]=_0x26bda5[_0x9892('0x49')][_0x9892('0x71')]?_0x26bda5[_0x9892('0x49')]:_0x30b8cb[_0x9892('0x45')];if(!_0x835607['query']['hasOwnProperty'](_0x9892('0x4c'))){_0x26bda5['limit']=qs[_0x9892('0x2e')](_0x835607['query'][_0x9892('0x2e')]);_0x26bda5[_0x9892('0x2f')]=qs['offset'](_0x835607[_0x9892('0x46')]['offset']);}_0x26bda5[_0x9892('0x4d')]=qs[_0x9892('0x4e')](_0x835607['query'][_0x9892('0x4e')]);_0x26bda5[_0x9892('0x51')]=qs[_0x9892('0x4f')](_[_0x9892('0x50')](_0x835607[_0x9892('0x46')],_0x30b8cb['filters']));_0x26bda5[_0x9892('0x51')]['SmsAccountId']=_0x1acd97['id'];if(_0x835607['query'][_0x9892('0x54')]){_0x26bda5[_0x9892('0x51')]=_['merge'](_0x26bda5[_0x9892('0x51')],{'$or':_[_0x9892('0x3f')](_0x26bda5['attributes'],function(_0x1f0939){var _0x3cf4a4={};_0x3cf4a4[_0x1f0939]={'$like':'%'+_0x835607[_0x9892('0x46')][_0x9892('0x54')]+'%'};return _0x3cf4a4;})});}_0x26bda5=_[_0x9892('0x52')]({},_0x26bda5,_0x835607[_0x9892('0x5b')]);return db[_0x9892('0x9f')][_0x9892('0x30')]({'where':_0x26bda5['where']})[_0x9892('0x1f')](function(_0x2ff9d7){_0x14e21b[_0x9892('0x30')]=_0x2ff9d7;if(_0x835607[_0x9892('0x46')][_0x9892('0x55')]){_0x26bda5[_0x9892('0x5a')]=[{'model':db[_0x9892('0x9d')],'as':_0x9892('0xb8'),'required':![]},{'model':db[_0x9892('0xa9')],'as':_0x9892('0xb9'),'attributes':[_0x9892('0x3a'),_0x9892('0xba'),_0x9892('0xbb')],'required':![]},{'model':db['Tag'],'as':_0x9892('0xbc'),'attributes':['id',_0x9892('0x3a'),_0x9892('0xbd')],'where':_0x835607[_0x9892('0x46')][_0x9892('0xbe')]?{'id':_0x835607[_0x9892('0x46')][_0x9892('0xbe')]}:undefined,'required':_0x835607[_0x9892('0x46')]['tag']?!![]:![]}];}return db[_0x9892('0x9f')][_0x9892('0x56')](_0x26bda5);})[_0x9892('0x1f')](function(_0x43cdd7){_0x14e21b[_0x9892('0x57')]=_0x43cdd7;return _0x14e21b;});}})[_0x9892('0x1f')](respondWithFilteredResult(_0x5f4471,_0x26bda5))['catch'](handleError(_0x5f4471,null));};exports['send']=function(_0x353641,_0x48717b,_0x2a75a8){var _0x5357ed,_0x556ab5,_0xca9e68;if(_[_0x9892('0x93')](_0x353641[_0x9892('0x5e')][_0x9892('0x5e')])||_0x353641['body'][_0x9892('0x5e')]===''){throw new db[(_0x9892('0x7a'))][(_0x9892('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x353641[_0x9892('0x5e')]['to'])){throw new db[(_0x9892('0x7a'))][(_0x9892('0x7b'))]('to\x20is\x20mandatory');}_0x5357ed=_0x353641[_0x9892('0x5e')]['to'];return db[_0x9892('0x40')][_0x9892('0x5c')]({'where':{'id':_0x353641[_0x9892('0x59')]['id']},'include':[{'model':db[_0x9892('0x99')],'as':_0x9892('0xbf'),'include':[{'model':db[_0x9892('0x9d')],'as':'Contacts','where':{'mobile':_0x5357ed},'limit':0x1,'order':[[_0x9892('0x7f'),_0x9892('0xc0')]]}]}]})[_0x9892('0x1f')](handleEntityNotFound(_0x48717b,null))[_0x9892('0x1f')](function(_0x4cbd43){if(_0x4cbd43&&_0x4cbd43[_0x9892('0xbf')]){_0x556ab5=_0x4cbd43[_0x9892('0x60')]({'plain':!![]});if(_0x556ab5['List']&&_0x556ab5[_0x9892('0xbf')]['Contacts'][_0x9892('0x71')]){return _0x556ab5[_0x9892('0xbf')][_0x9892('0x9b')][0x0];}return db[_0x9892('0x9d')][_0x9892('0x5d')](_['defaults'](_0x353641[_0x9892('0x5e')],{'firstName':_0x5357ed,'mobile':_0x5357ed,'phone':_0x5357ed,'ListId':_0x556ab5['ListId']}));}})[_0x9892('0x1f')](handleEntityNotFound(_0x48717b,null))[_0x9892('0x1f')](function(_0x250ec6){if(_0x250ec6){_0xca9e68=_0x250ec6;return db[_0x9892('0x9f')][_0x9892('0x5c')]({'where':{'ContactId':_0xca9e68['id'],'closed':![],'SmsAccountId':_0x556ab5['id']}})[_0x9892('0x1f')](function(_0x2b9726){if(_0x2b9726){return[_0x2b9726,![]];}return db[_0x9892('0x9f')][_0x9892('0x5d')]({'UserId':_0x353641['user']['id'],'ContactId':_0xca9e68['id'],'SmsAccountId':_0x556ab5['id'],'phone':_0x5357ed,'firstMsgDirection':_0x9892('0xc1'),'Messages':[_['merge'](_0x353641['body'],{'read':![],'body':_0x353641['body'][_0x9892('0x5e')],'phone':_0x5357ed,'SmsAccountId':_0x556ab5['id'],'UserId':_0x353641[_0x9892('0x5f')]['id'],'ContactId':_0xca9e68['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x9892('0xc2')}]})[_0x9892('0x1f')](function(_0x79392f){return[_0x79392f,!![]];});});}})[_0x9892('0xa0')](function(_0x2d8376,_0x3d3444){if(_0x3d3444){return _0x2d8376;}return db[_0x9892('0xa6')][_0x9892('0x5d')](_[_0x9892('0x52')](_0x353641['body'],{'read':![],'body':_0x353641[_0x9892('0x5e')][_0x9892('0x5e')],'phone':_0x5357ed,'SmsAccountId':_0x556ab5['id'],'SmsInteractionId':_0x2d8376['id'],'UserId':_0x353641[_0x9892('0x5f')]['id'],'ContactId':_0xca9e68['id']}))[_0x9892('0x1f')](function(_0xc2b8e1){_0x2d8376[_0x9892('0xc3')][_0x9892('0xc2')]=[];_0x2d8376[_0x9892('0xc3')][_0x9892('0xc2')][_0x9892('0xc4')](_0xc2b8e1[_0x9892('0xc3')]);return _0x2d8376;});})['then'](respondWithResult(_0x48717b,null))[_0x9892('0x29')](handleError(_0x48717b,null));};exports[_0x9892('0x2b')]=function(_0x39b68c,_0x30ba59,_0x2c8119){if(_0x39b68c[_0x9892('0x5e')]['id']){delete _0x39b68c['body']['id'];}var _0x461407,_0x348996,_0x27413f;return db['SmsAccount']['find']({'where':{'id':_0x39b68c[_0x9892('0x59')]['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x30ba59,null))[_0x9892('0x1f')](function(_0x432eaa){if(_0x432eaa){_0x27413f=_0x432eaa;logger[_0x9892('0x22')](_0x9892('0x23'),_0x9892('0x2b'),_0x9892('0xc5'),_0x432eaa[_0x9892('0x43')],util[_0x9892('0xc6')](_0x39b68c[_0x9892('0x5e')],{'showHidden':![],'depth':null}));switch(_0x432eaa[_0x9892('0x43')]){case _0x9892('0xc7'):if(_0x39b68c[_0x9892('0x5e')][_0x9892('0xc8')]&&_0x39b68c['body'][_0x9892('0x2b')]){_0x348996=_0x39b68c[_0x9892('0x5e')][_0x9892('0x2b')];return db[_0x9892('0xa6')][_0x9892('0x5c')]({'where':{'messageId':_0x39b68c[_0x9892('0x5e')][_0x9892('0xc8')]}});}break;case'connectel':if(_0x39b68c[_0x9892('0x5e')][_0x9892('0xc9')]&&_0x39b68c[_0x9892('0x5e')][_0x9892('0xca')]){_0x348996=_0x39b68c[_0x9892('0x5e')][_0x9892('0xca')];return db[_0x9892('0xa6')]['find']({'where':{'messageId':_0x39b68c[_0x9892('0x5e')]['requestid']}});}break;case'clicksend':if(_0x39b68c['body'][_0x9892('0x89')]&&_0x39b68c['body']['status_code']){_0x348996=_0x39b68c[_0x9892('0x5e')]['status_code'];return db['SmsMessage'][_0x9892('0x5c')]({'where':{'messageId':_0x39b68c['body'][_0x9892('0x89')]}});}break;case _0x9892('0x8d'):var _0x3a58fc=_0x39b68c[_0x9892('0x5e')][_0x9892('0x8e')][0x0];if(_0x3a58fc[_0x9892('0x85')]&&_0x3a58fc[_0x9892('0x2b')]['groupName']==='DELIVERED'){_0x348996=_0x3a58fc[_0x9892('0x2b')][_0x9892('0xcb')];return db[_0x9892('0xa6')][_0x9892('0x5c')]({'where':{'messageId':_0x3a58fc[_0x9892('0x85')]}});}break;case _0x9892('0xcc'):if(_0x39b68c['body']['messageId']&&_0x39b68c[_0x9892('0x5e')]['status']){_0x348996=_0x39b68c[_0x9892('0x5e')][_0x9892('0x2b')];return db[_0x9892('0xa6')][_0x9892('0x5c')]({'where':{'messageId':_0x39b68c[_0x9892('0x5e')][_0x9892('0x85')]}});}break;case _0x9892('0x92'):if(_0x39b68c[_0x9892('0x5e')][0x0][_0x9892('0x27')]['id']){_0x348996=_0x39b68c['body'][0x0][_0x9892('0x43')];return db['SmsMessage']['find']({'where':{'messageId':_0x39b68c[_0x9892('0x5e')][0x0][_0x9892('0x27')]['id']}});}break;case'intelepeer':if(_0x39b68c['body'][_0x9892('0xcd')]&&_0x39b68c['body'][_0x9892('0x2b')]){_0x348996=_0x39b68c[_0x9892('0x5e')][_0x9892('0x2b')];return db['SmsMessage'][_0x9892('0x5c')]({'where':{'messageId':_0x39b68c[_0x9892('0x5e')][_0x9892('0xcd')]}});}break;}}})[_0x9892('0x1f')](handleEntityNotFound(_0x30ba59,null))[_0x9892('0x1f')](function(_0x424ca4){if(_0x424ca4){_0x461407=_0x424ca4;switch(_0x27413f[_0x9892('0x43')]){case _0x9892('0xc7'):if(_0x348996===_0x9892('0xce')){return _0x461407[_0x9892('0xcf')]({'read':!![]});}else{logger[_0x9892('0x24')](_0x9892('0x23'),_0x9892('0x2b'),'skebby',util[_0x9892('0xc6')](_0x39b68c[_0x9892('0x5e')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x348996==='1'){return _0x461407[_0x9892('0xcf')]({'read':!![]});}else{logger['error'](_0x9892('0x23'),_0x9892('0x2b'),_0x9892('0xc7'),util[_0x9892('0xc6')](_0x39b68c[_0x9892('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x9892('0xd0'):if(!_0x39b68c[_0x9892('0x5e')][_0x9892('0xd1')]&&_0x348996>=0xc8&&_0x348996<=0xce){return _0x461407['update']({'read':!![]});}else{logger[_0x9892('0x24')](_0x9892('0x23'),_0x9892('0x2b'),'clicksend',util[_0x9892('0xc6')](_0x39b68c[_0x9892('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x9892('0x8d'):var _0x251c97=_0x39b68c['body'][_0x9892('0x8e')][0x0];if(_0x251c97[_0x9892('0x2b')][_0x9892('0xcb')]===_0x9892('0xce')){return _0x461407[_0x9892('0xcf')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9892('0x2b'),_0x9892('0x8d'),util[_0x9892('0xc6')](_0x39b68c[_0x9892('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x9892('0xcc'):if(_0x348996==_0x9892('0xd2')||_0x348996==_0x9892('0xd3')){return _0x461407[_0x9892('0xcf')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9892('0x2b'),_0x9892('0xcc'),util[_0x9892('0xc6')](_0x39b68c[_0x9892('0x5e')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x348996==_0x9892('0xd4')){return _0x461407[_0x9892('0xcf')]({'read':!![]});}else{logger[_0x9892('0x24')](_0x9892('0x23'),'status','bandwidth',util[_0x9892('0xc6')](_0x39b68c[_0x9892('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x9892('0xd5'):if(_0x348996===_0x9892('0xd6')||_0x348996==='ACCEPTD'){return _0x461407[_0x9892('0xcf')]({'read':!![]});}else{logger[_0x9892('0x24')](_0x9892('0x23'),_0x9892('0x2b'),_0x9892('0xd5'),util['inspect'](_0x39b68c[_0x9892('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x461407;}})[_0x9892('0x1f')](respondWithResult(_0x30ba59,null))['catch'](handleError(_0x30ba59,null));};exports['statusGet']=function(_0x3f068a,_0x671d36,_0x2bcb8b){var _0x4d8369,_0x2624f9,_0x41c8b4;return db[_0x9892('0x40')][_0x9892('0x5c')]({'where':{'id':_0x3f068a[_0x9892('0x59')]['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x671d36,null))[_0x9892('0x1f')](function(_0xd2c645){if(_0xd2c645){_0x41c8b4=_0xd2c645;logger[_0x9892('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x9892('0xc5'),_0xd2c645[_0x9892('0x43')],util[_0x9892('0xc6')](_0x3f068a[_0x9892('0x46')],{'showHidden':![],'depth':null}));switch(_0xd2c645[_0x9892('0x43')]){case _0x9892('0x8f'):if(_0x3f068a['query'][_0x9892('0xd7')]&&_0x3f068a[_0x9892('0x46')][_0x9892('0xd8')]){_0x2624f9=_0x3f068a[_0x9892('0x46')][_0x9892('0xd8')];return db[_0x9892('0xa6')][_0x9892('0x5c')]({'where':{'messageId':_0x3f068a[_0x9892('0x46')][_0x9892('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x671d36,null))['then'](function(_0xaae7d2){if(_0xaae7d2){_0x4d8369=_0xaae7d2;switch(_0x41c8b4[_0x9892('0x43')]){case _0x9892('0x8f'):if(_0x2624f9==='2'||_0x2624f9==='6'){return _0x4d8369[_0x9892('0xcf')]({'read':!![]});}else{logger[_0x9892('0x24')](_0x9892('0x23'),_0x9892('0x2b'),_0x9892('0x8f'),util[_0x9892('0xc6')](_0x3f068a[_0x9892('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x4d8369;}})[_0x9892('0x1f')](respondWithResult(_0x671d36,null))[_0x9892('0x29')](handleError(_0x671d36,null));};exports[_0x9892('0xd9')]=function(_0x28b033,_0x439b5,_0x1429c2){return db[_0x9892('0x40')][_0x9892('0x5c')]({'where':{'id':_0x28b033['params']['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x439b5,null))[_0x9892('0x1f')](function(_0x1b84ef){if(_0x1b84ef){return _0x1b84ef[_0x9892('0xd9')](_0x28b033['body'][_0x9892('0x6e')],_[_0x9892('0xda')](_0x28b033[_0x9892('0x5e')],[_0x9892('0x6e'),'id'])||{})[_0x9892('0xa0')](function(_0x5f390d){for(var _0x4014c7=0x0;_0x4014c7<_0x28b033[_0x9892('0x5e')][_0x9892('0x6e')]['length'];_0x4014c7+=0x1){socket[_0x9892('0xdb')]('userSmsAccount:save',{'UserId':Number(_0x28b033[_0x9892('0x5e')][_0x9892('0x6e')][_0x4014c7]),'SmsAccountId':Number(_0x28b033[_0x9892('0x59')]['id'])});}return _0x5f390d;});}})[_0x9892('0x1f')](respondWithResult(_0x439b5,null))['catch'](handleError(_0x439b5,null));};exports[_0x9892('0xdc')]=function(_0x110f7c,_0x19fcc8,_0x58da6b){return db['SmsAccount']['find']({'where':{'id':_0x110f7c['params']['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x19fcc8,null))[_0x9892('0x1f')](function(_0x1d0a38){if(_0x1d0a38){return _0x1d0a38['removeAgents'](_0x110f7c[_0x9892('0x46')][_0x9892('0x6e')])[_0x9892('0x1f')](function(){if(_['isArray'](_0x110f7c[_0x9892('0x46')][_0x9892('0x6e')])){for(var _0x53dd13=0x0;_0x53dd13<_0x110f7c[_0x9892('0x46')][_0x9892('0x6e')]['length'];_0x53dd13+=0x1){socket[_0x9892('0xdb')](_0x9892('0xdd'),{'UserId':Number(_0x110f7c[_0x9892('0x46')][_0x9892('0x6e')][_0x53dd13]),'SmsAccountId':Number(_0x110f7c[_0x9892('0x59')]['id'])});}}else{socket[_0x9892('0xdb')](_0x9892('0xdd'),{'UserId':Number(_0x110f7c[_0x9892('0x46')][_0x9892('0x6e')]),'SmsAccountId':Number(_0x110f7c[_0x9892('0x59')]['id'])});}});}})[_0x9892('0x1f')](respondWithStatusCode(_0x19fcc8,null))[_0x9892('0x29')](handleError(_0x19fcc8,null));};exports[_0x9892('0xde')]=function(_0x1e9d58,_0x3378e2,_0xab1797){var _0x25498b={};var _0x4f72a2={};var _0x1f85a3;var _0x345f2d;return db[_0x9892('0x40')][_0x9892('0x6c')]({'where':{'id':_0x1e9d58['params']['id']}})[_0x9892('0x1f')](handleEntityNotFound(_0x3378e2,null))[_0x9892('0x1f')](function(_0xdd6430){if(_0xdd6430){_0x1f85a3=_0xdd6430;_0x4f72a2[_0x9892('0x45')]=_[_0x9892('0x47')](db[_0x9892('0xa9')][_0x9892('0x41')]);_0x4f72a2[_0x9892('0x46')]=_[_0x9892('0x47')](_0x1e9d58['query']);_0x4f72a2['filters']=_[_0x9892('0x48')](_0x4f72a2[_0x9892('0x45')],_0x4f72a2[_0x9892('0x46')]);_0x25498b[_0x9892('0x49')]=_['intersection'](_0x4f72a2[_0x9892('0x45')],qs[_0x9892('0x4a')](_0x1e9d58['query'][_0x9892('0x4a')]));_0x25498b[_0x9892('0x49')]=_0x25498b[_0x9892('0x49')]['length']?_0x25498b[_0x9892('0x49')]:_0x4f72a2['model'];_0x25498b['order']=qs[_0x9892('0x4e')](_0x1e9d58['query'][_0x9892('0x4e')]);_0x25498b[_0x9892('0x51')]=qs[_0x9892('0x4f')](_[_0x9892('0x50')](_0x1e9d58['query'],_0x4f72a2[_0x9892('0x4f')]));if(_0x1e9d58['query'][_0x9892('0x54')]){_0x25498b['where']=_[_0x9892('0x52')](_0x25498b[_0x9892('0x51')],{'$or':_['map'](_0x25498b[_0x9892('0x49')],function(_0x2c014a){var _0x5a1634={};_0x5a1634[_0x2c014a]={'$like':'%'+_0x1e9d58[_0x9892('0x46')][_0x9892('0x54')]+'%'};return _0x5a1634;})});}_0x25498b=_[_0x9892('0x52')]({},_0x25498b,_0x1e9d58[_0x9892('0x5b')]);return _0x1f85a3[_0x9892('0xde')](_0x25498b);}})[_0x9892('0x1f')](function(_0x103c61){if(_0x103c61){_0x345f2d=_0x103c61['length'];if(!_0x1e9d58[_0x9892('0x46')][_0x9892('0x4b')]('nolimit')){_0x25498b[_0x9892('0x2e')]=qs['limit'](_0x1e9d58[_0x9892('0x46')][_0x9892('0x2e')]);_0x25498b[_0x9892('0x2f')]=qs[_0x9892('0x2f')](_0x1e9d58[_0x9892('0x46')][_0x9892('0x2f')]);}return _0x1f85a3[_0x9892('0xde')](_0x25498b);}})[_0x9892('0x1f')](function(_0x11d64e){if(_0x11d64e){return _0x11d64e?{'count':_0x345f2d,'rows':_0x11d64e}:null;}})[_0x9892('0x1f')](respondWithResult(_0x3378e2,null))['catch'](handleError(_0x3378e2,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index cac70db..a0ac1a7 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 _0x1155=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','remove'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0x1155,0x124));var _0x5115=function(_0x1a8bbf,_0x356523){_0x1a8bbf=_0x1a8bbf-0x0;var _0x2709bc=_0x1155[_0x1a8bbf];return _0x2709bc;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x5115('0x0'))['db'][_0x5115('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5115('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5115('0x3')};function emitEvent(_0x362e99){return function(_0x4d4b71,_0x388d4e,_0x4260f7){SmsAccountEvents[_0x5115('0x4')](_0x362e99+':'+_0x4d4b71['id'],_0x4d4b71);SmsAccountEvents[_0x5115('0x4')](_0x362e99,_0x4d4b71);_0x4260f7(null);};}for(var e in events){if(events[_0x5115('0x5')](e)){var event=events[e];SmsAccount[_0x5115('0x6')](e,emitEvent(event));}}module[_0x5115('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x3336=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x3467be,_0x2ac1e4){var _0x17638e=function(_0x403cd9){while(--_0x403cd9){_0x3467be['push'](_0x3467be['shift']());}};_0x17638e(++_0x2ac1e4);}(_0x3336,0xec));var _0x6333=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0x3336[_0x3ceb54];return _0x26d8a6;};'use strict';var EventEmitter=require(_0x6333('0x0'));var SmsAccount=require(_0x6333('0x1'))['db'][_0x6333('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6333('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6333('0x4'),'afterDestroy':_0x6333('0x5')};function emitEvent(_0x4522d2){return function(_0x598c75,_0xe29d53,_0x397361){SmsAccountEvents[_0x6333('0x6')](_0x4522d2+':'+_0x598c75['id'],_0x598c75);SmsAccountEvents[_0x6333('0x6')](_0x4522d2,_0x598c75);_0x397361(null);};}for(var e in events){if(events[_0x6333('0x7')](e)){var event=events[e];SmsAccount[_0x6333('0x8')](e,emitEvent(event));}}module[_0x6333('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 94e0e32..e4a780d 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 _0xf0a1=['../../config/environment','./smsAccount.attributes','define','sms_accounts','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x341ee8,_0x254e9b){var _0x2e0f43=function(_0x49b98b){while(--_0x49b98b){_0x341ee8['push'](_0x341ee8['shift']());}};_0x2e0f43(++_0x254e9b);}(_0xf0a1,0xb4));var _0x1f0a=function(_0x5238fe,_0x21b629){_0x5238fe=_0x5238fe-0x0;var _0x116e39=_0xf0a1[_0x5238fe];return _0x116e39;};'use strict';var _=require(_0x1f0a('0x0'));var util=require('util');var logger=require(_0x1f0a('0x1'))(_0x1f0a('0x2'));var moment=require(_0x1f0a('0x3'));var BPromise=require('bluebird');var rp=require(_0x1f0a('0x4'));var fs=require('fs');var path=require(_0x1f0a('0x5'));var rimraf=require(_0x1f0a('0x6'));var config=require(_0x1f0a('0x7'));var attributes=require(_0x1f0a('0x8'));module['exports']=function(_0x44acb1,_0x2e4e25){return _0x44acb1[_0x1f0a('0x9')]('SmsAccount',attributes,{'tableName':_0x1f0a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1172=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsAccount','sms_accounts','lodash'];(function(_0x21a209,_0x1b8347){var _0x40c2a8=function(_0x25ed46){while(--_0x25ed46){_0x21a209['push'](_0x21a209['shift']());}};_0x40c2a8(++_0x1b8347);}(_0x1172,0x74));var _0x2117=function(_0xaddc10,_0x245577){_0xaddc10=_0xaddc10-0x0;var _0x53f756=_0x1172[_0xaddc10];return _0x53f756;};'use strict';var _=require(_0x2117('0x0'));var util=require(_0x2117('0x1'));var logger=require('../../config/logger')(_0x2117('0x2'));var moment=require(_0x2117('0x3'));var BPromise=require(_0x2117('0x4'));var rp=require(_0x2117('0x5'));var fs=require('fs');var path=require(_0x2117('0x6'));var rimraf=require(_0x2117('0x7'));var config=require(_0x2117('0x8'));var attributes=require('./smsAccount.attributes');module[_0x2117('0x9')]=function(_0x3635f3,_0x239fee){return _0x3635f3[_0x2117('0xa')](_0x2117('0xb'),attributes,{'tableName':_0x2117('0xc'),'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 046060a..5a26078 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 _0xfde2=['client','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','include','map','model','attributes','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3b0c9d,_0x3ddeb5){var _0xcfc8d7=function(_0x320dc6){while(--_0x320dc6){_0x3b0c9d['push'](_0x3b0c9d['shift']());}};_0xcfc8d7(++_0x3ddeb5);}(_0xfde2,0x10a));var _0x2fde=function(_0x1c0f41,_0x26d95d){_0x1c0f41=_0x1c0f41-0x0;var _0x369a9f=_0xfde2[_0x1c0f41];return _0x369a9f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2fde('0x0'));var fs=require('fs');var Redis=require(_0x2fde('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x2fde('0x2'));var logger=require(_0x2fde('0x3'))(_0x2fde('0x4'));var config=require('../../config/environment');var jayson=require(_0x2fde('0x5'));var client=jayson[_0x2fde('0x6')][_0x2fde('0x7')]({'port':0x232a});config[_0x2fde('0x8')]=_[_0x2fde('0x9')](config[_0x2fde('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2fde('0xa'))(new Redis(config[_0x2fde('0x8')]));require(_0x2fde('0xb'))[_0x2fde('0xc')](socket);function respondWithRpcPromise(_0x4ee0be,_0x55fc93,_0x3d2400){return new BPromise(function(_0x1ef706,_0x458748){return client[_0x2fde('0xd')](_0x4ee0be,_0x3d2400)[_0x2fde('0xe')](function(_0x3539fd){logger['info'](_0x2fde('0xf'),_0x55fc93,_0x2fde('0x10'));logger[_0x2fde('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x55fc93,_0x2fde('0x10'),JSON[_0x2fde('0x12')](_0x3539fd));if(_0x3539fd[_0x2fde('0x13')]){if(_0x3539fd['error'][_0x2fde('0x14')]===0x1f4){logger[_0x2fde('0x13')](_0x2fde('0xf'),_0x55fc93,_0x3539fd[_0x2fde('0x13')][_0x2fde('0x15')]);return _0x458748(_0x3539fd[_0x2fde('0x13')]['message']);}logger['error'](_0x2fde('0xf'),_0x55fc93,_0x3539fd['error']['message']);return _0x1ef706(_0x3539fd[_0x2fde('0x13')][_0x2fde('0x15')]);}else{logger[_0x2fde('0x16')]('SmsAccount,\x20%s,\x20%s',_0x55fc93,_0x2fde('0x10'));_0x1ef706(_0x3539fd[_0x2fde('0x17')][_0x2fde('0x15')]);}})[_0x2fde('0x18')](function(_0x1f4746){logger['error'](_0x2fde('0xf'),_0x55fc93,_0x1f4746);_0x458748(_0x1f4746);});});}exports[_0x2fde('0x19')]=function(_0x1d3643){var _0x20e085=this;return new Promise(function(_0x3d6b13,_0x41597d){return db[_0x2fde('0x1a')]['find']({'raw':_0x1d3643[_0x2fde('0x1b')]?_0x1d3643[_0x2fde('0x1b')][_0x2fde('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d3643[_0x2fde('0x1b')]?_0x1d3643[_0x2fde('0x1b')][_0x2fde('0x1d')]||null:null,'attributes':_0x1d3643[_0x2fde('0x1b')]?_0x1d3643[_0x2fde('0x1b')]['attributes']||null:null,'include':_0x1d3643[_0x2fde('0x1b')]?_0x1d3643[_0x2fde('0x1b')][_0x2fde('0x1e')]?_[_0x2fde('0x1f')](_0x1d3643[_0x2fde('0x1b')][_0x2fde('0x1e')],function(_0x1c4617){return{'model':db[_0x1c4617[_0x2fde('0x20')]],'as':_0x1c4617['as'],'attributes':_0x1c4617['attributes'],'include':_0x1c4617[_0x2fde('0x1e')]?_[_0x2fde('0x1f')](_0x1c4617[_0x2fde('0x1e')],function(_0x5504f4){return{'model':db[_0x5504f4['model']],'as':_0x5504f4['as'],'attributes':_0x5504f4['attributes'],'include':_0x5504f4[_0x2fde('0x1e')]?_['map'](_0x5504f4[_0x2fde('0x1e')],function(_0x342dc9){return{'model':db[_0x342dc9[_0x2fde('0x20')]],'as':_0x342dc9['as'],'attributes':_0x342dc9[_0x2fde('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2fde('0xe')](function(_0x2f48e0){logger[_0x2fde('0x16')](_0x2fde('0x19'),_0x1d3643);logger[_0x2fde('0x11')](_0x2fde('0x19'),_0x1d3643,JSON['stringify'](_0x2f48e0));_0x3d6b13(_0x2f48e0);})[_0x2fde('0x18')](function(_0xd65085){logger[_0x2fde('0x13')](_0x2fde('0x19'),_0xd65085[_0x2fde('0x15')],_0x1d3643);_0x41597d(_0x20e085['error'](0x1f4,_0xd65085[_0x2fde('0x15')]));});});}; \ No newline at end of file +var _0xf7c0=['socket.io-emitter','./smsAccount.socket','register','request','then','request\x20sent','debug','error','code','SmsAccount,\x20%s,\x20%s','message','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','model','info','stringify','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0xf5dbcd,_0x357be8){var _0x22fc45=function(_0x24adf8){while(--_0x24adf8){_0xf5dbcd['push'](_0xf5dbcd['shift']());}};_0x22fc45(++_0x357be8);}(_0xf7c0,0x12f));var _0x0f7c=function(_0x4cf01b,_0x51aada){_0x4cf01b=_0x4cf01b-0x0;var _0x1c1669=_0xf7c0[_0x4cf01b];return _0x1c1669;};'use strict';var _=require(_0x0f7c('0x0'));var util=require('util');var moment=require(_0x0f7c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f7c('0x2'));var db=require(_0x0f7c('0x3'))['db'];var utils=require(_0x0f7c('0x4'));var logger=require('../../config/logger')(_0x0f7c('0x5'));var config=require(_0x0f7c('0x6'));var jayson=require(_0x0f7c('0x7'));var client=jayson[_0x0f7c('0x8')][_0x0f7c('0x9')]({'port':0x232a});config[_0x0f7c('0xa')]=_['defaults'](config['redis'],{'host':_0x0f7c('0xb'),'port':0x18eb});var socket=require(_0x0f7c('0xc'))(new Redis(config['redis']));require(_0x0f7c('0xd'))[_0x0f7c('0xe')](socket);function respondWithRpcPromise(_0x4a0499,_0x31f6b5,_0x24be77){return new BPromise(function(_0x3e2bc3,_0xd99ab1){return client[_0x0f7c('0xf')](_0x4a0499,_0x24be77)[_0x0f7c('0x10')](function(_0x327064){logger['info']('SmsAccount,\x20%s,\x20%s',_0x31f6b5,_0x0f7c('0x11'));logger[_0x0f7c('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x31f6b5,'request\x20sent',JSON['stringify'](_0x327064));if(_0x327064[_0x0f7c('0x13')]){if(_0x327064['error'][_0x0f7c('0x14')]===0x1f4){logger[_0x0f7c('0x13')](_0x0f7c('0x15'),_0x31f6b5,_0x327064[_0x0f7c('0x13')][_0x0f7c('0x16')]);return _0xd99ab1(_0x327064['error'][_0x0f7c('0x16')]);}logger[_0x0f7c('0x13')]('SmsAccount,\x20%s,\x20%s',_0x31f6b5,_0x327064[_0x0f7c('0x13')]['message']);return _0x3e2bc3(_0x327064[_0x0f7c('0x13')][_0x0f7c('0x16')]);}else{logger['info'](_0x0f7c('0x15'),_0x31f6b5,'request\x20sent');_0x3e2bc3(_0x327064[_0x0f7c('0x17')][_0x0f7c('0x16')]);}})['catch'](function(_0x21b79a){logger[_0x0f7c('0x13')]('SmsAccount,\x20%s,\x20%s',_0x31f6b5,_0x21b79a);_0xd99ab1(_0x21b79a);});});}exports[_0x0f7c('0x18')]=function(_0x290fce){var _0x3fcbda=this;return new Promise(function(_0x159a2d,_0x2d0b49){return db[_0x0f7c('0x19')][_0x0f7c('0x1a')]({'raw':_0x290fce[_0x0f7c('0x1b')]?_0x290fce[_0x0f7c('0x1b')][_0x0f7c('0x1c')]===undefined?!![]:![]:!![],'where':_0x290fce[_0x0f7c('0x1b')]?_0x290fce['options'][_0x0f7c('0x1d')]||null:null,'attributes':_0x290fce[_0x0f7c('0x1b')]?_0x290fce[_0x0f7c('0x1b')][_0x0f7c('0x1e')]||null:null,'include':_0x290fce[_0x0f7c('0x1b')]?_0x290fce[_0x0f7c('0x1b')]['include']?_['map'](_0x290fce[_0x0f7c('0x1b')][_0x0f7c('0x1f')],function(_0x56794b){return{'model':db[_0x56794b[_0x0f7c('0x20')]],'as':_0x56794b['as'],'attributes':_0x56794b[_0x0f7c('0x1e')],'include':_0x56794b[_0x0f7c('0x1f')]?_['map'](_0x56794b[_0x0f7c('0x1f')],function(_0x4ccf72){return{'model':db[_0x4ccf72['model']],'as':_0x4ccf72['as'],'attributes':_0x4ccf72[_0x0f7c('0x1e')],'include':_0x4ccf72[_0x0f7c('0x1f')]?_['map'](_0x4ccf72[_0x0f7c('0x1f')],function(_0x3be7ca){return{'model':db[_0x3be7ca['model']],'as':_0x3be7ca['as'],'attributes':_0x3be7ca['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f7c('0x10')](function(_0xac92ea){logger[_0x0f7c('0x21')](_0x0f7c('0x18'),_0x290fce);logger[_0x0f7c('0x12')](_0x0f7c('0x18'),_0x290fce,JSON[_0x0f7c('0x22')](_0xac92ea));_0x159a2d(_0xac92ea);})['catch'](function(_0x182aac){logger[_0x0f7c('0x13')]('ShowSmsAccount',_0x182aac['message'],_0x290fce);_0x2d0b49(_0x3fcbda[_0x0f7c('0x13')](0x1f4,_0x182aac['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index c334291..0a49b45 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(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 12de276..51dc436 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 _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x130466,_0x1fc58d){var _0xb16fda=function(_0x5d7f84){while(--_0x5d7f84){_0x130466['push'](_0x130466['shift']());}};_0xb16fda(++_0x1fc58d);}(_0x55ca,0x126));var _0xa55c=function(_0x1e0f42,_0x2567e5){_0x1e0f42=_0x1e0f42-0x0;var _0x4e9c54=_0x55ca[_0x1e0f42];return _0x4e9c54;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x56a7dd,_0x3fd9ae){var _0xc7b980=function(_0x34221b){while(--_0x34221b){_0x56a7dd['push'](_0x56a7dd['shift']());}};_0xc7b980(++_0x3fd9ae);}(_0x34e8,0x12c));var _0x834e=function(_0x179bd2,_0x3ac4c7){_0x179bd2=_0x179bd2-0x0;var _0x1d9d25=_0x34e8[_0x179bd2];return _0x1d9d25;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 7f0e0b8..d9dcbad 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 _0x407d=['STRING','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x348d7f,_0x480779){var _0x5a4708=function(_0x49bd96){while(--_0x49bd96){_0x348d7f['push'](_0x348d7f['shift']());}};_0x5a4708(++_0x480779);}(_0x407d,0x1d9));var _0xd407=function(_0x45bce4,_0x4bfaa9){_0x45bce4=_0x45bce4-0x0;var _0x225634=_0x407d[_0x45bce4];return _0x225634;};'use strict';var Sequelize=require('sequelize');module[_0xd407('0x0')]={'priority':{'type':Sequelize[_0xd407('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd407('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd407('0x3')]()},'description':{'type':Sequelize[_0xd407('0x2')]},'interval':{'type':Sequelize[_0xd407('0x2')],'defaultValue':_0xd407('0x4')}}; \ No newline at end of file +var _0xabbb=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0xabbb,0x167));var _0xbabb=function(_0x283142,_0x1d50e4){_0x283142=_0x283142-0x0;var _0x49aa77=_0xabbb[_0x283142];return _0x49aa77;};'use strict';var Sequelize=require(_0xbabb('0x0'));module[_0xbabb('0x1')]={'priority':{'type':Sequelize[_0xbabb('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbabb('0x3')],'allowNull':![],'defaultValue':_0xbabb('0x4')},'appdata':{'type':Sequelize[_0xbabb('0x5')]()},'description':{'type':Sequelize[_0xbabb('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbabb('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index bf29f21..c319ec9 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 _0x5518=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','show','SmsApplication','find','create','body','catch','update','params'];(function(_0x3e799a,_0x5cf407){var _0x3c06fe=function(_0x9b240f){while(--_0x9b240f){_0x3e799a['push'](_0x3e799a['shift']());}};_0x3c06fe(++_0x5cf407);}(_0x5518,0x9c));var _0x8551=function(_0x42be6b,_0x3511ef){_0x42be6b=_0x42be6b-0x0;var _0x2e85b0=_0x5518[_0x42be6b];return _0x2e85b0;};'use strict';var emlformat=require(_0x8551('0x0'));var rimraf=require(_0x8551('0x1'));var zipdir=require(_0x8551('0x2'));var jsonpatch=require(_0x8551('0x3'));var rp=require(_0x8551('0x4'));var moment=require(_0x8551('0x5'));var BPromise=require(_0x8551('0x6'));var Mustache=require(_0x8551('0x7'));var util=require(_0x8551('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8551('0x9'));var fs=require('fs');var fs_extra=require(_0x8551('0xa'));var _=require(_0x8551('0xb'));var squel=require(_0x8551('0xc'));var crypto=require(_0x8551('0xd'));var jsforce=require(_0x8551('0xe'));var deskjs=require(_0x8551('0xf'));var toCsv=require(_0x8551('0x10'));var querystring=require(_0x8551('0x11'));var Papa=require(_0x8551('0x12'));var Redis=require(_0x8551('0x13'));var authService=require(_0x8551('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8551('0x15'));var hardwareService=require(_0x8551('0x16'));var logger=require(_0x8551('0x17'))(_0x8551('0x18'));var utils=require(_0x8551('0x19'));var config=require(_0x8551('0x1a'));var licenseUtil=require(_0x8551('0x1b'));var db=require(_0x8551('0x1c'))['db'];function respondWithStatusCode(_0x2f9022,_0x512319){_0x512319=_0x512319||0xcc;return function(_0xafb122){if(_0xafb122){return _0x2f9022[_0x8551('0x1d')](_0x512319);}return _0x2f9022[_0x8551('0x1e')](_0x512319)[_0x8551('0x1f')]();};}function respondWithResult(_0x3f89ca,_0x52e860){_0x52e860=_0x52e860||0xc8;return function(_0x6fa0b8){if(_0x6fa0b8){return _0x3f89ca[_0x8551('0x1e')](_0x52e860)['json'](_0x6fa0b8);}};}function respondWithFilteredResult(_0x1685f6,_0x4ad5d6){return function(_0x3bfdc4){if(_0x3bfdc4){var _0x9a6518=typeof _0x4ad5d6['offset']===_0x8551('0x20')&&typeof _0x4ad5d6[_0x8551('0x21')]===_0x8551('0x20');var _0x58fddd=_0x3bfdc4[_0x8551('0x22')];var _0x4553b4=_0x9a6518?0x0:_0x4ad5d6[_0x8551('0x23')];var _0x5efafd=_0x9a6518?_0x3bfdc4[_0x8551('0x22')]:_0x4ad5d6[_0x8551('0x23')]+_0x4ad5d6[_0x8551('0x21')];var _0x56caea;if(_0x5efafd>=_0x58fddd){_0x5efafd=_0x58fddd;_0x56caea=0xc8;}else{_0x56caea=0xce;}_0x1685f6[_0x8551('0x1e')](_0x56caea);return _0x1685f6[_0x8551('0x24')]('Content-Range',_0x4553b4+'-'+_0x5efafd+'/'+_0x58fddd)['json'](_0x3bfdc4);}return null;};}function patchUpdates(_0x57a0b8){return function(_0x3eac3b){try{jsonpatch[_0x8551('0x25')](_0x3eac3b,_0x57a0b8,!![]);}catch(_0x45b78b){return BPromise['reject'](_0x45b78b);}return _0x3eac3b[_0x8551('0x26')]();};}function saveUpdates(_0x155e2a,_0x373cb5){return function(_0x5d0750){if(_0x5d0750){return _0x5d0750['update'](_0x155e2a)[_0x8551('0x27')](function(_0x4c737b){return _0x4c737b;});}return null;};}function removeEntity(_0x3780db,_0x5b5d0e){return function(_0xc73a75){if(_0xc73a75){return _0xc73a75[_0x8551('0x28')]()[_0x8551('0x27')](function(){_0x3780db[_0x8551('0x1e')](0xcc)[_0x8551('0x1f')]();});}};}function handleEntityNotFound(_0x1a17c2,_0x4cd5f6){return function(_0x4113b0){if(!_0x4113b0){_0x1a17c2[_0x8551('0x1d')](0x194);}return _0x4113b0;};}function handleError(_0x1b7525,_0x401d44){_0x401d44=_0x401d44||0x1f4;return function(_0x2122bb){logger[_0x8551('0x29')](_0x2122bb[_0x8551('0x2a')]);if(_0x2122bb[_0x8551('0x2b')]){delete _0x2122bb[_0x8551('0x2b')];}_0x1b7525[_0x8551('0x1e')](_0x401d44)[_0x8551('0x2c')](_0x2122bb);};}exports[_0x8551('0x2d')]=function(_0x385a4d,_0x580fc2){var _0x123e4b={},_0x9007ee={},_0x22da3b={'count':0x0,'rows':[]};var _0x48ed06=_[_0x8551('0x2e')](db['SmsApplication'][_0x8551('0x2f')],function(_0x2783b7){return{'name':_0x2783b7[_0x8551('0x30')],'type':_0x2783b7[_0x8551('0x31')][_0x8551('0x32')]};});_0x9007ee[_0x8551('0x33')]=_[_0x8551('0x2e')](_0x48ed06,'name');_0x9007ee[_0x8551('0x34')]=_[_0x8551('0x35')](_0x385a4d['query']);_0x9007ee[_0x8551('0x36')]=_[_0x8551('0x37')](_0x9007ee[_0x8551('0x33')],_0x9007ee['query']);_0x123e4b[_0x8551('0x38')]=_['intersection'](_0x9007ee[_0x8551('0x33')],qs[_0x8551('0x39')](_0x385a4d[_0x8551('0x34')][_0x8551('0x39')]));_0x123e4b['attributes']=_0x123e4b[_0x8551('0x38')][_0x8551('0x3a')]?_0x123e4b['attributes']:_0x9007ee[_0x8551('0x33')];if(!_0x385a4d['query'][_0x8551('0x3b')](_0x8551('0x3c'))){_0x123e4b['limit']=qs['limit'](_0x385a4d[_0x8551('0x34')][_0x8551('0x21')]);_0x123e4b[_0x8551('0x23')]=qs[_0x8551('0x23')](_0x385a4d[_0x8551('0x34')]['offset']);}_0x123e4b[_0x8551('0x3d')]=qs['sort'](_0x385a4d[_0x8551('0x34')][_0x8551('0x3e')]);_0x123e4b[_0x8551('0x3f')]=qs[_0x8551('0x36')](_['pick'](_0x385a4d[_0x8551('0x34')],_0x9007ee[_0x8551('0x36')]),_0x48ed06);if(_0x385a4d['query'][_0x8551('0x40')]){_0x123e4b[_0x8551('0x3f')]=_[_0x8551('0x41')](_0x123e4b[_0x8551('0x3f')],{'$or':_[_0x8551('0x2e')](_0x48ed06,function(_0x5ae9ae){if(_0x5ae9ae[_0x8551('0x31')]!=='VIRTUAL'){var _0x4da60e={};_0x4da60e[_0x5ae9ae[_0x8551('0x2b')]]={'$like':'%'+_0x385a4d[_0x8551('0x34')][_0x8551('0x40')]+'%'};return _0x4da60e;}})});}_0x123e4b=_[_0x8551('0x41')]({},_0x123e4b,_0x385a4d[_0x8551('0x42')]);var _0x9c7906={'where':_0x123e4b['where']};return db['SmsApplication'][_0x8551('0x22')](_0x9c7906)[_0x8551('0x27')](function(_0x48fcee){_0x22da3b[_0x8551('0x22')]=_0x48fcee;if(_0x385a4d['query'][_0x8551('0x43')]){_0x123e4b[_0x8551('0x44')]=[{'all':!![]}];}return db['SmsApplication'][_0x8551('0x45')](_0x123e4b);})[_0x8551('0x27')](function(_0x1b8305){_0x22da3b['rows']=_0x1b8305;return _0x22da3b;})['then'](respondWithFilteredResult(_0x580fc2,_0x123e4b))['catch'](handleError(_0x580fc2,null));};exports[_0x8551('0x46')]=function(_0x2ab006,_0x8f8578){var _0xaca822={'raw':!![],'where':{'id':_0x2ab006['params']['id']}},_0x5303fc={};_0x5303fc[_0x8551('0x33')]=_[_0x8551('0x35')](db[_0x8551('0x47')][_0x8551('0x2f')]);_0x5303fc[_0x8551('0x34')]=_['keys'](_0x2ab006[_0x8551('0x34')]);_0x5303fc[_0x8551('0x36')]=_[_0x8551('0x37')](_0x5303fc[_0x8551('0x33')],_0x5303fc[_0x8551('0x34')]);_0xaca822['attributes']=_[_0x8551('0x37')](_0x5303fc[_0x8551('0x33')],qs[_0x8551('0x39')](_0x2ab006[_0x8551('0x34')][_0x8551('0x39')]));_0xaca822['attributes']=_0xaca822[_0x8551('0x38')]['length']?_0xaca822[_0x8551('0x38')]:_0x5303fc[_0x8551('0x33')];if(_0x2ab006[_0x8551('0x34')][_0x8551('0x43')]){_0xaca822[_0x8551('0x44')]=[{'all':!![]}];}_0xaca822=_[_0x8551('0x41')]({},_0xaca822,_0x2ab006['options']);return db[_0x8551('0x47')][_0x8551('0x48')](_0xaca822)[_0x8551('0x27')](handleEntityNotFound(_0x8f8578,null))['then'](respondWithResult(_0x8f8578,null))['catch'](handleError(_0x8f8578,null));};exports[_0x8551('0x49')]=function(_0x3a7429,_0x5adf71){return db[_0x8551('0x47')]['create'](_0x3a7429[_0x8551('0x4a')],{})[_0x8551('0x27')](respondWithResult(_0x5adf71,0xc9))[_0x8551('0x4b')](handleError(_0x5adf71,null));};exports[_0x8551('0x4c')]=function(_0x3a22af,_0x35ada1){if(_0x3a22af[_0x8551('0x4a')]['id']){delete _0x3a22af['body']['id'];}return db[_0x8551('0x47')][_0x8551('0x48')]({'where':{'id':_0x3a22af[_0x8551('0x4d')]['id']}})[_0x8551('0x27')](handleEntityNotFound(_0x35ada1,null))['then'](saveUpdates(_0x3a22af[_0x8551('0x4a')],null))['then'](respondWithResult(_0x35ada1,null))[_0x8551('0x4b')](handleError(_0x35ada1,null));};exports[_0x8551('0x28')]=function(_0xcae553,_0x57887f){return db['SmsApplication'][_0x8551('0x48')]({'where':{'id':_0xcae553[_0x8551('0x4d')]['id']}})[_0x8551('0x27')](handleEntityNotFound(_0x57887f,null))[_0x8551('0x27')](removeEntity(_0x57887f,null))['catch'](handleError(_0x57887f,null));}; \ No newline at end of file +var _0x5f91=['destroy','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','length','create','body','find','params','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then'];(function(_0x1711fa,_0xcc2e28){var _0x4c615c=function(_0x138f60){while(--_0x138f60){_0x1711fa['push'](_0x1711fa['shift']());}};_0x4c615c(++_0xcc2e28);}(_0x5f91,0x1ea));var _0x15f9=function(_0x2f63a9,_0x1cb005){_0x2f63a9=_0x2f63a9-0x0;var _0xdb29ef=_0x5f91[_0x2f63a9];return _0xdb29ef;};'use strict';var emlformat=require(_0x15f9('0x0'));var rimraf=require(_0x15f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15f9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x15f9('0x3'));var Mustache=require(_0x15f9('0x4'));var util=require(_0x15f9('0x5'));var path=require(_0x15f9('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15f9('0x7'));var _=require('lodash');var squel=require(_0x15f9('0x8'));var crypto=require(_0x15f9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x15f9('0xa'));var toCsv=require(_0x15f9('0xb'));var querystring=require(_0x15f9('0xc'));var Papa=require(_0x15f9('0xd'));var Redis=require(_0x15f9('0xe'));var authService=require(_0x15f9('0xf'));var qs=require(_0x15f9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15f9('0x11'));var logger=require('../../config/logger')(_0x15f9('0x12'));var utils=require(_0x15f9('0x13'));var config=require(_0x15f9('0x14'));var licenseUtil=require(_0x15f9('0x15'));var db=require(_0x15f9('0x16'))['db'];function respondWithStatusCode(_0x5310c7,_0xbd1818){_0xbd1818=_0xbd1818||0xcc;return function(_0xa25095){if(_0xa25095){return _0x5310c7['sendStatus'](_0xbd1818);}return _0x5310c7[_0x15f9('0x17')](_0xbd1818)[_0x15f9('0x18')]();};}function respondWithResult(_0x2f13f0,_0x2cdfef){_0x2cdfef=_0x2cdfef||0xc8;return function(_0x453e44){if(_0x453e44){return _0x2f13f0['status'](_0x2cdfef)[_0x15f9('0x19')](_0x453e44);}};}function respondWithFilteredResult(_0x5097e8,_0x4dba54){return function(_0x59d8ce){if(_0x59d8ce){var _0x674f7d=typeof _0x4dba54[_0x15f9('0x1a')]===_0x15f9('0x1b')&&typeof _0x4dba54['limit']==='undefined';var _0x3f71a5=_0x59d8ce[_0x15f9('0x1c')];var _0x5cecc1=_0x674f7d?0x0:_0x4dba54[_0x15f9('0x1a')];var _0x3e553d=_0x674f7d?_0x59d8ce[_0x15f9('0x1c')]:_0x4dba54[_0x15f9('0x1a')]+_0x4dba54['limit'];var _0x34224e;if(_0x3e553d>=_0x3f71a5){_0x3e553d=_0x3f71a5;_0x34224e=0xc8;}else{_0x34224e=0xce;}_0x5097e8['status'](_0x34224e);return _0x5097e8[_0x15f9('0x1d')](_0x15f9('0x1e'),_0x5cecc1+'-'+_0x3e553d+'/'+_0x3f71a5)[_0x15f9('0x19')](_0x59d8ce);}return null;};}function patchUpdates(_0x2cfb45){return function(_0x41a20f){try{jsonpatch[_0x15f9('0x1f')](_0x41a20f,_0x2cfb45,!![]);}catch(_0xd844a9){return BPromise[_0x15f9('0x20')](_0xd844a9);}return _0x41a20f['save']();};}function saveUpdates(_0x2d5e42,_0xcdc604){return function(_0x3d5f8e){if(_0x3d5f8e){return _0x3d5f8e[_0x15f9('0x21')](_0x2d5e42)[_0x15f9('0x22')](function(_0x44fd33){return _0x44fd33;});}return null;};}function removeEntity(_0x1285e4,_0x280a0c){return function(_0x57ddd5){if(_0x57ddd5){return _0x57ddd5[_0x15f9('0x23')]()[_0x15f9('0x22')](function(){_0x1285e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x373af2,_0x4ad95a){return function(_0xcd98f6){if(!_0xcd98f6){_0x373af2[_0x15f9('0x24')](0x194);}return _0xcd98f6;};}function handleError(_0x5e0555,_0x5de864){_0x5de864=_0x5de864||0x1f4;return function(_0x30aee1){logger[_0x15f9('0x25')](_0x30aee1[_0x15f9('0x26')]);if(_0x30aee1[_0x15f9('0x27')]){delete _0x30aee1[_0x15f9('0x27')];}_0x5e0555[_0x15f9('0x17')](_0x5de864)[_0x15f9('0x28')](_0x30aee1);};}exports[_0x15f9('0x29')]=function(_0x716ead,_0x18a0d1){var _0x3e43f6={},_0x1361cb={},_0x5ce7ad={'count':0x0,'rows':[]};var _0x331121=_[_0x15f9('0x2a')](db[_0x15f9('0x2b')][_0x15f9('0x2c')],function(_0x4f81e2){return{'name':_0x4f81e2[_0x15f9('0x2d')],'type':_0x4f81e2[_0x15f9('0x2e')][_0x15f9('0x2f')]};});_0x1361cb[_0x15f9('0x30')]=_[_0x15f9('0x2a')](_0x331121,_0x15f9('0x27'));_0x1361cb[_0x15f9('0x31')]=_['keys'](_0x716ead[_0x15f9('0x31')]);_0x1361cb[_0x15f9('0x32')]=_[_0x15f9('0x33')](_0x1361cb['model'],_0x1361cb[_0x15f9('0x31')]);_0x3e43f6[_0x15f9('0x34')]=_[_0x15f9('0x33')](_0x1361cb['model'],qs['fields'](_0x716ead['query'][_0x15f9('0x35')]));_0x3e43f6[_0x15f9('0x34')]=_0x3e43f6[_0x15f9('0x34')]['length']?_0x3e43f6['attributes']:_0x1361cb['model'];if(!_0x716ead[_0x15f9('0x31')][_0x15f9('0x36')]('nolimit')){_0x3e43f6[_0x15f9('0x37')]=qs[_0x15f9('0x37')](_0x716ead[_0x15f9('0x31')][_0x15f9('0x37')]);_0x3e43f6[_0x15f9('0x1a')]=qs['offset'](_0x716ead[_0x15f9('0x31')][_0x15f9('0x1a')]);}_0x3e43f6[_0x15f9('0x38')]=qs[_0x15f9('0x39')](_0x716ead[_0x15f9('0x31')][_0x15f9('0x39')]);_0x3e43f6[_0x15f9('0x3a')]=qs[_0x15f9('0x32')](_['pick'](_0x716ead[_0x15f9('0x31')],_0x1361cb[_0x15f9('0x32')]),_0x331121);if(_0x716ead['query'][_0x15f9('0x3b')]){_0x3e43f6[_0x15f9('0x3a')]=_['merge'](_0x3e43f6['where'],{'$or':_[_0x15f9('0x2a')](_0x331121,function(_0x499c9b){if(_0x499c9b[_0x15f9('0x2e')]!==_0x15f9('0x3c')){var _0x1412ee={};_0x1412ee[_0x499c9b[_0x15f9('0x27')]]={'$like':'%'+_0x716ead[_0x15f9('0x31')][_0x15f9('0x3b')]+'%'};return _0x1412ee;}})});}_0x3e43f6=_[_0x15f9('0x3d')]({},_0x3e43f6,_0x716ead[_0x15f9('0x3e')]);var _0x4c6132={'where':_0x3e43f6[_0x15f9('0x3a')]};return db[_0x15f9('0x2b')]['count'](_0x4c6132)[_0x15f9('0x22')](function(_0x2279c0){_0x5ce7ad['count']=_0x2279c0;if(_0x716ead[_0x15f9('0x31')][_0x15f9('0x3f')]){_0x3e43f6[_0x15f9('0x40')]=[{'all':!![]}];}return db[_0x15f9('0x2b')][_0x15f9('0x41')](_0x3e43f6);})[_0x15f9('0x22')](function(_0x1b2d6f){_0x5ce7ad[_0x15f9('0x42')]=_0x1b2d6f;return _0x5ce7ad;})[_0x15f9('0x22')](respondWithFilteredResult(_0x18a0d1,_0x3e43f6))[_0x15f9('0x43')](handleError(_0x18a0d1,null));};exports[_0x15f9('0x44')]=function(_0x502f8e,_0x2b2a38){var _0x372997={'raw':!![],'where':{'id':_0x502f8e['params']['id']}},_0x469a5f={};_0x469a5f[_0x15f9('0x30')]=_[_0x15f9('0x45')](db['SmsApplication'][_0x15f9('0x2c')]);_0x469a5f[_0x15f9('0x31')]=_[_0x15f9('0x45')](_0x502f8e[_0x15f9('0x31')]);_0x469a5f['filters']=_['intersection'](_0x469a5f[_0x15f9('0x30')],_0x469a5f[_0x15f9('0x31')]);_0x372997['attributes']=_[_0x15f9('0x33')](_0x469a5f['model'],qs[_0x15f9('0x35')](_0x502f8e[_0x15f9('0x31')][_0x15f9('0x35')]));_0x372997[_0x15f9('0x34')]=_0x372997['attributes'][_0x15f9('0x46')]?_0x372997[_0x15f9('0x34')]:_0x469a5f[_0x15f9('0x30')];if(_0x502f8e[_0x15f9('0x31')][_0x15f9('0x3f')]){_0x372997[_0x15f9('0x40')]=[{'all':!![]}];}_0x372997=_['merge']({},_0x372997,_0x502f8e[_0x15f9('0x3e')]);return db[_0x15f9('0x2b')]['find'](_0x372997)[_0x15f9('0x22')](handleEntityNotFound(_0x2b2a38,null))[_0x15f9('0x22')](respondWithResult(_0x2b2a38,null))['catch'](handleError(_0x2b2a38,null));};exports[_0x15f9('0x47')]=function(_0x3368e3,_0x5da53a){return db[_0x15f9('0x2b')][_0x15f9('0x47')](_0x3368e3['body'],{})[_0x15f9('0x22')](respondWithResult(_0x5da53a,0xc9))[_0x15f9('0x43')](handleError(_0x5da53a,null));};exports[_0x15f9('0x21')]=function(_0x579f29,_0x150448){if(_0x579f29[_0x15f9('0x48')]['id']){delete _0x579f29['body']['id'];}return db[_0x15f9('0x2b')][_0x15f9('0x49')]({'where':{'id':_0x579f29['params']['id']}})[_0x15f9('0x22')](handleEntityNotFound(_0x150448,null))[_0x15f9('0x22')](saveUpdates(_0x579f29['body'],null))[_0x15f9('0x22')](respondWithResult(_0x150448,null))[_0x15f9('0x43')](handleError(_0x150448,null));};exports[_0x15f9('0x23')]=function(_0x5285b6,_0xa62c2c){return db[_0x15f9('0x2b')][_0x15f9('0x49')]({'where':{'id':_0x5285b6[_0x15f9('0x4a')]['id']}})[_0x15f9('0x22')](handleEntityNotFound(_0xa62c2c,null))['then'](removeEntity(_0xa62c2c,null))[_0x15f9('0x43')](handleError(_0xa62c2c,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 3a64edb..a68c2a6 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 _0xf362=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SmsApplication','sms_applications','utf8mb4_unicode_ci','util'];(function(_0x577a2e,_0x3816f0){var _0x3ac138=function(_0x5ba47c){while(--_0x5ba47c){_0x577a2e['push'](_0x577a2e['shift']());}};_0x3ac138(++_0x3816f0);}(_0xf362,0xb3));var _0x2f36=function(_0x1b4b5f,_0x2107b9){_0x1b4b5f=_0x1b4b5f-0x0;var _0x33086d=_0xf362[_0x1b4b5f];return _0x33086d;};'use strict';var _=require('lodash');var util=require(_0x2f36('0x0'));var logger=require('../../config/logger')(_0x2f36('0x1'));var moment=require(_0x2f36('0x2'));var BPromise=require(_0x2f36('0x3'));var rp=require(_0x2f36('0x4'));var fs=require('fs');var path=require(_0x2f36('0x5'));var rimraf=require(_0x2f36('0x6'));var config=require(_0x2f36('0x7'));var attributes=require('./smsApplication.attributes');module[_0x2f36('0x8')]=function(_0x4a6081,_0xa03f71){return _0x4a6081['define'](_0x2f36('0x9'),attributes,{'tableName':_0x2f36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2f36('0xb')});}; \ No newline at end of file +var _0xe142=['utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe142,0xaa));var _0x2e14=function(_0x422fa0,_0x4cd88a){_0x422fa0=_0x422fa0-0x0;var _0x2c6d22=_0xe142[_0x422fa0];return _0x2c6d22;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e14('0x0'))('api');var moment=require(_0x2e14('0x1'));var BPromise=require(_0x2e14('0x2'));var rp=require(_0x2e14('0x3'));var fs=require('fs');var path=require(_0x2e14('0x4'));var rimraf=require(_0x2e14('0x5'));var config=require(_0x2e14('0x6'));var attributes=require('./smsApplication.attributes');module[_0x2e14('0x7')]=function(_0x33e99b,_0x1bfd45){return _0x33e99b[_0x2e14('0x8')](_0x2e14('0x9'),attributes,{'tableName':_0x2e14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e14('0xb'),'collate':_0x2e14('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index b5b18b9..462a007 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 _0x09df=['rpc','../../config/environment','request','then','info','request\x20sent','debug','error','code','SmsApplication,\x20%s,\x20%s','message','lodash','util','bluebird','../../mysqldb'];(function(_0x4aa6f9,_0x1fee17){var _0x23cfb4=function(_0x53cfdc){while(--_0x53cfdc){_0x4aa6f9['push'](_0x4aa6f9['shift']());}};_0x23cfb4(++_0x1fee17);}(_0x09df,0x164));var _0xf09d=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0x09df[_0x1dbaf7];return _0x593f05;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var moment=require('moment');var BPromise=require(_0xf09d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf09d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf09d('0x4'));var config=require(_0xf09d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x284a42,_0x48b82f,_0x28c91c){return new BPromise(function(_0x2555c7,_0x2f1810){return client[_0xf09d('0x6')](_0x284a42,_0x28c91c)[_0xf09d('0x7')](function(_0x2a59a8){logger[_0xf09d('0x8')]('SmsApplication,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'));logger[_0xf09d('0xa')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'),JSON['stringify'](_0x2a59a8));if(_0x2a59a8[_0xf09d('0xb')]){if(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xc')]===0x1f4){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2f1810(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);}logger['error'](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2555c7(_0x2a59a8['error']['message']);}else{logger[_0xf09d('0x8')](_0xf09d('0xd'),_0x48b82f,_0xf09d('0x9'));_0x2555c7(_0x2a59a8['result'][_0xf09d('0xe')]);}})['catch'](function(_0x3614f7){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x3614f7);_0x2f1810(_0x3614f7);});});} \ No newline at end of file +var _0x65c9=['then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0x65c9,0x182));var _0x965c=function(_0x11f304,_0x2bbc42){_0x11f304=_0x11f304-0x0;var _0x57268c=_0x65c9[_0x11f304];return _0x57268c;};'use strict';var _=require(_0x965c('0x0'));var util=require(_0x965c('0x1'));var moment=require('moment');var BPromise=require(_0x965c('0x2'));var rs=require(_0x965c('0x3'));var fs=require('fs');var Redis=require(_0x965c('0x4'));var db=require(_0x965c('0x5'))['db'];var utils=require(_0x965c('0x6'));var logger=require(_0x965c('0x7'))(_0x965c('0x8'));var config=require(_0x965c('0x9'));var jayson=require(_0x965c('0xa'));var client=jayson[_0x965c('0xb')][_0x965c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x849260,_0x5ec702,_0xd19e57){return new BPromise(function(_0x263652,_0x41d248){return client[_0x965c('0xd')](_0x849260,_0xd19e57)[_0x965c('0xe')](function(_0x26d859){logger[_0x965c('0xf')]('SmsApplication,\x20%s,\x20%s',_0x5ec702,_0x965c('0x10'));logger[_0x965c('0x11')](_0x965c('0x12'),_0x5ec702,_0x965c('0x10'),JSON[_0x965c('0x13')](_0x26d859));if(_0x26d859[_0x965c('0x14')]){if(_0x26d859[_0x965c('0x14')][_0x965c('0x15')]===0x1f4){logger[_0x965c('0x14')](_0x965c('0x16'),_0x5ec702,_0x26d859[_0x965c('0x14')][_0x965c('0x17')]);return _0x41d248(_0x26d859[_0x965c('0x14')][_0x965c('0x17')]);}logger['error'](_0x965c('0x16'),_0x5ec702,_0x26d859[_0x965c('0x14')][_0x965c('0x17')]);return _0x263652(_0x26d859['error'][_0x965c('0x17')]);}else{logger[_0x965c('0xf')](_0x965c('0x16'),_0x5ec702,'request\x20sent');_0x263652(_0x26d859[_0x965c('0x18')]['message']);}})['catch'](function(_0x542499){logger[_0x965c('0x14')](_0x965c('0x16'),_0x5ec702,_0x542499);_0x41d248(_0x542499);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 0bd4501..5a69818 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 _0x4213=['download','post','create','/:id/messages','addMessage','/:id/tags','tracked','smsinteraction:addtags','put','smsinteraction:update','update','sms','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x4213,0x77));var _0x3421=function(_0x171f55,_0x400b15){_0x171f55=_0x171f55-0x0;var _0x5ef2bf=_0x4213[_0x171f55];return _0x5ef2bf;};'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('0x9')](_0x3421('0xe'),auth['isAuthenticated'](),controller[_0x3421('0xf')]);router['get']('/:id/messages',auth[_0x3421('0xa')](),controller['getMessages']);router[_0x3421('0x9')](_0x3421('0x10'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);router[_0x3421('0x12')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0x13')]);router['post'](_0x3421('0x14'),auth[_0x3421('0xa')](),controller[_0x3421('0x15')]);router[_0x3421('0x12')](_0x3421('0x16'),auth[_0x3421('0xa')](),interaction[_0x3421('0x17')]('sms',_0x3421('0x18')),controller['addTags']);router[_0x3421('0x19')](_0x3421('0xe'),auth['isAuthenticated'](),interaction[_0x3421('0x17')]('sms',_0x3421('0x1a')),controller[_0x3421('0x1b')]);router['delete'](_0x3421('0xe'),auth[_0x3421('0xa')](),interaction[_0x3421('0x17')](_0x3421('0x1c'),_0x3421('0x1d')),controller[_0x3421('0x1e')]);router[_0x3421('0x1f')](_0x3421('0x16'),auth[_0x3421('0xa')](),controller[_0x3421('0x20')]);module[_0x3421('0x21')]=router; \ No newline at end of file +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(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0x34b7,0x196));var _0x734b=function(_0x3ad191,_0x29e58b){_0x3ad191=_0x3ad191-0x0;var _0x4384e5=_0x34b7[_0x3ad191];return _0x4384e5;};'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 diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index ba6875a..836e435 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 _0x4813=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x51b3ae,_0x150b95){var _0x4702fe=function(_0x77756e){while(--_0x77756e){_0x51b3ae['push'](_0x51b3ae['shift']());}};_0x4702fe(++_0x150b95);}(_0x4813,0x14e));var _0x3481=function(_0x21b6a6,_0x4b6b1e){_0x21b6a6=_0x21b6a6-0x0;var _0x13564c=_0x4813[_0x21b6a6];return _0x13564c;};'use strict';var Sequelize=require(_0x3481('0x0'));var moment=require(_0x3481('0x1'));module[_0x3481('0x2')]={'closed':{'type':Sequelize[_0x3481('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3481('0x4')]},'disposition':{'type':Sequelize[_0x3481('0x5')]},'secondDisposition':{'type':Sequelize[_0x3481('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3481('0x5')]},'phone':{'type':Sequelize[_0x3481('0x5')]},'read1stAt':{'type':Sequelize[_0x3481('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3481('0x6')]('in',_0x3481('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3481('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x423b=['BOOLEAN','STRING','DATE','out','ENUM','moment'];(function(_0x10a212,_0x579d85){var _0x23c82b=function(_0x412ea9){while(--_0x412ea9){_0x10a212['push'](_0x10a212['shift']());}};_0x23c82b(++_0x579d85);}(_0x423b,0x12b));var _0xb423=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x423b[_0x1573ea];return _0x51c0e2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb423('0x0'));module['exports']={'closed':{'type':Sequelize[_0xb423('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb423('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb423('0x2')]},'read1stAt':{'type':Sequelize[_0xb423('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb423('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb423('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb423('0x5')]('in',_0xb423('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 58c64de..ae46449 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 _0xbf7f=['length','unreadMessages','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)','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','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','SmsAccountId','concat','createdAt','parse','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?','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','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.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','SmsInteractionId','all','rows','catch','show','params','includeAll','options','describe','ids','getMessages','findOne','SmsMessage','$gte','addTags','setTags','omit','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','format','CmContact','firstName','lastName','Messages','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','out','System','direction','secret','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','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','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','end','name','send','Users','fullname','Tags','TagIds','forEach','push','index','map','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','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','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xbf7f,0x86));var _0xfbf7=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xbf7f[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0xfbf7('0x0'));var rimraf=require(_0xfbf7('0x1'));var zipdir=require(_0xfbf7('0x2'));var jsonpatch=require(_0xfbf7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfbf7('0x4'));var Mustache=require(_0xfbf7('0x5'));var util=require(_0xfbf7('0x6'));var path=require(_0xfbf7('0x7'));var sox=require(_0xfbf7('0x8'));var csv=require(_0xfbf7('0x9'));var ejs=require(_0xfbf7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfbf7('0xb'));var crypto=require(_0xfbf7('0xc'));var jsforce=require(_0xfbf7('0xd'));var deskjs=require(_0xfbf7('0xe'));var toCsv=require(_0xfbf7('0x9'));var querystring=require(_0xfbf7('0xf'));var Papa=require(_0xfbf7('0x10'));var Redis=require(_0xfbf7('0x11'));var authService=require(_0xfbf7('0x12'));var qs=require(_0xfbf7('0x13'));var as=require(_0xfbf7('0x14'));var pdf=require(_0xfbf7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfbf7('0x16'))(_0xfbf7('0x17'));var utils=require('../../config/utils');var config=require(_0xfbf7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfbf7('0x19'))['db'];config['redis']=_['defaults'](config[_0xfbf7('0x1a')],{'host':_0xfbf7('0x1b'),'port':0x18eb});var socket=require(_0xfbf7('0x1c'))(new Redis(config[_0xfbf7('0x1a')]));require(_0xfbf7('0x1d'))[_0xfbf7('0x1e')](socket);function respondWithStatusCode(_0x137f44,_0x1df9b6){_0x1df9b6=_0x1df9b6||0xcc;return function(_0xea4731){if(_0xea4731){return _0x137f44[_0xfbf7('0x1f')](_0x1df9b6);}return _0x137f44[_0xfbf7('0x20')](_0x1df9b6)['end']();};}function respondWithResult(_0x5ca813,_0x28a9c0){_0x28a9c0=_0x28a9c0||0xc8;return function(_0x5d0738){if(_0x5d0738){return _0x5ca813[_0xfbf7('0x20')](_0x28a9c0)['json'](_0x5d0738);}};}function respondWithFilteredResult(_0x18b2b3,_0x2adc13){return function(_0xc16ff1){if(_0xc16ff1){var _0x1a08b7=typeof _0x2adc13[_0xfbf7('0x21')]==='undefined'&&typeof _0x2adc13[_0xfbf7('0x22')]===_0xfbf7('0x23');var _0x47420f=_0xc16ff1[_0xfbf7('0x24')];var _0x91ea7e=_0x1a08b7?0x0:_0x2adc13['offset'];var _0x2d5ea9=_0x1a08b7?_0xc16ff1['count']:_0x2adc13[_0xfbf7('0x21')]+_0x2adc13[_0xfbf7('0x22')];var _0x39a40e;if(_0x2d5ea9>=_0x47420f){_0x2d5ea9=_0x47420f;_0x39a40e=0xc8;}else{_0x39a40e=0xce;}_0x18b2b3[_0xfbf7('0x20')](_0x39a40e);return _0x18b2b3[_0xfbf7('0x25')](_0xfbf7('0x26'),_0x91ea7e+'-'+_0x2d5ea9+'/'+_0x47420f)[_0xfbf7('0x27')](_0xc16ff1);}return null;};}function patchUpdates(_0x2486c8){return function(_0xcf353c){try{jsonpatch[_0xfbf7('0x28')](_0xcf353c,_0x2486c8,!![]);}catch(_0x112813){return BPromise['reject'](_0x112813);}return _0xcf353c[_0xfbf7('0x29')]();};}function saveUpdates(_0x7440f1,_0x120e3c){return function(_0x29f936){if(_0x29f936){return _0x29f936[_0xfbf7('0x2a')](_0x7440f1)[_0xfbf7('0x2b')](function(_0x3f5f6e){return _0x3f5f6e;});}return null;};}function removeEntity(_0x5871d5,_0x3c9d0b){return function(_0x4317b3){if(_0x4317b3){return _0x4317b3[_0xfbf7('0x2c')]()[_0xfbf7('0x2b')](function(){_0x5871d5[_0xfbf7('0x20')](0xcc)[_0xfbf7('0x2d')]();});}};}function handleEntityNotFound(_0x56c9f4,_0x2bbfd6){return function(_0x19f26a){if(!_0x19f26a){_0x56c9f4[_0xfbf7('0x1f')](0x194);}return _0x19f26a;};}function handleError(_0x50b885,_0x2e09d4){_0x2e09d4=_0x2e09d4||0x1f4;return function(_0x72a05c){logger['error'](_0x72a05c['stack']);if(_0x72a05c['name']){delete _0x72a05c[_0xfbf7('0x2e')];}_0x50b885[_0xfbf7('0x20')](_0x2e09d4)[_0xfbf7('0x2f')](_0x72a05c);};}function getInteractionUsers(_0x6c22ec,_0x3892e8){return new BPromise(function(_0x38a1f4,_0x1a2d37){try{if(_0x3892e8[_0x6c22ec['id']]){_0x6c22ec[_0xfbf7('0x30')]=_['map'](_0x3892e8[_0x6c22ec['id']],function(_0x2f8caa){return{'id':_0x2f8caa['id'],'fullname':_0x2f8caa[_0xfbf7('0x31')]};});}}catch(_0x1323c4){_0x1a2d37(_0x1323c4);}_0x38a1f4(_0x6c22ec);});}function getInteractionTags(_0x1cb136,_0x384db1){return new BPromise(function(_0x12f31e,_0x503b19){try{if(_0x1cb136['TagIds']){_0x1cb136[_0xfbf7('0x32')]=[];_0x1cb136[_0xfbf7('0x33')]['split'](',')[_0xfbf7('0x34')](function(_0x49d36a){_0x1cb136[_0xfbf7('0x32')][_0xfbf7('0x35')](_0x384db1[_0x49d36a]);});}delete _0x1cb136['TagIds'];}catch(_0x46769d){_0x503b19(_0x46769d);}_0x12f31e(_0x1cb136);});}function updateSmsInteraction(_0x12a16c,_0xc63493,_0x5a2f7d){return new BPromise(function(_0x3ad601,_0x247ca5){return getInteractionUsers(_0x12a16c,_0x5a2f7d)[_0xfbf7('0x2b')](function(_0x19e81f){return getInteractionTags(_0x19e81f,_0xc63493);})['then'](function(_0x5dc690){_0x3ad601(_0x5dc690);})['catch'](function(_0x1298f7){_0x247ca5(_0x1298f7);});});}exports[_0xfbf7('0x36')]=function(_0x2cae23,_0x228461){var _0x53865a={},_0x4221cd={},_0x2c502a={'count':0x0,'rows':[]};var _0x26d149=_[_0xfbf7('0x37')](db[_0xfbf7('0x38')][_0xfbf7('0x39')],function(_0x2e2f76){return{'name':_0x2e2f76[_0xfbf7('0x3a')],'type':_0x2e2f76[_0xfbf7('0x3b')][_0xfbf7('0x3c')]};});_0x4221cd[_0xfbf7('0x3d')]=_[_0xfbf7('0x37')](_0x26d149,_0xfbf7('0x2e'));_0x4221cd[_0xfbf7('0x3e')]=_[_0xfbf7('0x3f')](_0x2cae23[_0xfbf7('0x3e')]);_0x4221cd[_0xfbf7('0x40')]=_[_0xfbf7('0x41')](_0x4221cd['model'],_0x4221cd[_0xfbf7('0x3e')]);_0x53865a['attributes']=_[_0xfbf7('0x41')](_0x4221cd['model'],qs[_0xfbf7('0x42')](_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x42')]));_0x53865a[_0xfbf7('0x43')]=_0x53865a[_0xfbf7('0x43')]['length']?_0x53865a[_0xfbf7('0x43')]:_0x4221cd[_0xfbf7('0x3d')];if(!_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x44')](_0xfbf7('0x45'))){_0x53865a[_0xfbf7('0x22')]=qs[_0xfbf7('0x22')](_0x2cae23[_0xfbf7('0x3e')]['limit']);_0x53865a[_0xfbf7('0x21')]=qs[_0xfbf7('0x21')](_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x21')]);}_0x53865a[_0xfbf7('0x46')]=qs[_0xfbf7('0x47')](_0x2cae23[_0xfbf7('0x3e')]['sort']);_0x53865a[_0xfbf7('0x48')]=qs[_0xfbf7('0x40')](_[_0xfbf7('0x49')](_0x2cae23[_0xfbf7('0x3e')],_0x4221cd['filters']),_0x26d149);var _0x4f8776=[];var _0x10144a=squel[_0xfbf7('0x4a')]()[_0xfbf7('0x4b')]('id')[_0xfbf7('0x4b')](_0xfbf7('0x2e'))[_0xfbf7('0x4b')](_0xfbf7('0x4c'))[_0xfbf7('0x4d')]('tools_tags');var _0x50cc02=squel['select']()['field'](_0xfbf7('0x4e'))[_0xfbf7('0x4b')]('u.fullname')['field'](_0xfbf7('0x4f'))[_0xfbf7('0x4d')](_0xfbf7('0x50'),'ui')[_0xfbf7('0x51')](_0xfbf7('0x52'),'u',_0xfbf7('0x53'));var _0x1a1b77=squel['select']()['from']('sms_interactions','i')[_0xfbf7('0x51')](_0xfbf7('0x54'),'c',_0xfbf7('0x55'))[_0xfbf7('0x51')](_0xfbf7('0x52'),'o','o.id\x20=\x20i.UserId')[_0xfbf7('0x51')](_0xfbf7('0x56'),'a',_0xfbf7('0x57'))['left_join'](_0xfbf7('0x58'),'me',_0xfbf7('0x59'))[_0xfbf7('0x51')](_0xfbf7('0x5a'),'it',_0xfbf7('0x5b'))[_0xfbf7('0x51')]('tools_tags','t',_0xfbf7('0x5c'));var _0x1a6e3c=squel[_0xfbf7('0x5d')]();var _0x16618b=[];var _0x27c711=squel[_0xfbf7('0x5d')]();var _0x12e259;if(_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x5e')]){_0x12e259=as[_0xfbf7('0x5f')](_0x2cae23['query']['search']);var _0x2aacbd=_0x12e259[_0xfbf7('0x60')];for(var _0xd1d3b6=0x0;_0xd1d3b6<_0x12e259[_0xfbf7('0x61')][_0xfbf7('0x62')];_0xd1d3b6++){var _0x52a869=_0x12e259[_0xfbf7('0x61')][_0xd1d3b6];var _0x59fe6b='i';var _0xd81e79=_['find'](_0x26d149,[_0xfbf7('0x2e'),_0x52a869[_0xfbf7('0x4b')]]);if(!_0xd81e79){switch(_0x52a869[_0xfbf7('0x4b')]){case _0xfbf7('0x63'):if(_0x52a869[_0xfbf7('0x64')]==0x1){_0x1a1b77[_0xfbf7('0x65')]('`'+_0x52a869['field']+_0xfbf7('0x66'));}else{_0x1a1b77[_0xfbf7('0x65')]('`'+_0x52a869[_0xfbf7('0x4b')]+_0xfbf7('0x67'));}break;case _0xfbf7('0x68'):if(_0x52a869[_0xfbf7('0x69')]===_0xfbf7('0x6a')){if(_0x52a869[_0xfbf7('0x64')][_0xfbf7('0x6b')]('\x20')[_0xfbf7('0x62')]>0x1){_0x1a6e3c[_0x2aacbd](_0xfbf7('0x6c'),qs['getFullTextValue'](_0x52a869['value']),null);}else{var _0x370250='%'+_0x52a869[_0xfbf7('0x64')]+'%';_0x1a6e3c[_0x2aacbd](_0xfbf7('0x6d'),_0x370250,_0x370250,_0x370250);}}else{_0xd81e79=_[_0xfbf7('0x6e')](_0x26d149,[_0xfbf7('0x2e'),_0xfbf7('0x6f')]);_0x52a869[_0xfbf7('0x4b')]=_0xfbf7('0x6f');_0x2d70d8=as[_0xfbf7('0x70')](_0x59fe6b,_0xd81e79['type'],_0x52a869);_0x1a6e3c[_0x2aacbd](_0x2d70d8[_0xfbf7('0x71')],_0x2d70d8['value'][_0xfbf7('0x72')],_0x2d70d8[_0xfbf7('0x64')][_0xfbf7('0x2d')]);}break;case _0xfbf7('0x73'):var _0x4ae884=_0x52a869[_0xfbf7('0x64')][_0xfbf7('0x6b')](',')[_0xfbf7('0x37')](function(_0x48a0b5){return Number(_0x48a0b5);});_0x4ae884[_0xfbf7('0x34')](function(_0x782d88){_0x27c711['or'](_0xfbf7('0x74'),'%,'+_0x782d88+',%');});_0x16618b=_[_0xfbf7('0x75')](_0x16618b,_0x4ae884);break;case _0xfbf7('0x76'):if(_0x52a869['operator']==='$substring'){_0x1a6e3c[_0x2aacbd](_0xfbf7('0x77'),'%'+_0x52a869[_0xfbf7('0x64')]+'%',null);}else{_0xd81e79=_[_0xfbf7('0x6e')](_0x26d149,['name',_0xfbf7('0x78')]);_0x52a869[_0xfbf7('0x4b')]=_0xfbf7('0x78');_0x2d70d8=as[_0xfbf7('0x70')](_0x59fe6b,_0xd81e79[_0xfbf7('0x3b')],_0x52a869);_0x1a6e3c[_0x2aacbd](_0x2d70d8['text'],_0x2d70d8[_0xfbf7('0x64')][_0xfbf7('0x72')],_0x2d70d8[_0xfbf7('0x64')][_0xfbf7('0x2d')]);}break;case _0xfbf7('0x79'):_0x2d70d8=as['buildExpression']('me',null,_0x52a869);_0x1a6e3c[_0x2aacbd](_0x2d70d8[_0xfbf7('0x71')],_0x2d70d8[_0xfbf7('0x64')][_0xfbf7('0x72')],_0x2d70d8[_0xfbf7('0x64')][_0xfbf7('0x2d')]);break;}}else{var _0x2d70d8=as[_0xfbf7('0x70')](_0x59fe6b,_0xd81e79['type'],_0x52a869);_0x1a6e3c[_0x2aacbd](_0x2d70d8['text'],_0x2d70d8[_0xfbf7('0x64')][_0xfbf7('0x72')],_0x2d70d8[_0xfbf7('0x64')]['end']);}}}else{var _0x2cc8c1=_(_0x2cae23['query'])[_0xfbf7('0x3f')]()[_0xfbf7('0x37')](function(_0x2eb0a3){return _[_0xfbf7('0x7a')](_0x26d149,[_0xfbf7('0x2e'),_0x2eb0a3])?_0x2eb0a3:undefined;})['compact']()[_0xfbf7('0x64')]();if(!_[_0xfbf7('0x7b')](_0x2cc8c1)){_0x2cc8c1[_0xfbf7('0x34')](function(_0x3c7fd5){if(_0x3c7fd5===_0xfbf7('0x7c')){_0x1a1b77[_0xfbf7('0x48')]('i.SmsAccountId\x20IN\x20?',[][_0xfbf7('0x7d')](_0x2cae23[_0xfbf7('0x3e')][_0x3c7fd5]));}else if(_0x3c7fd5===_0xfbf7('0x7e')){var _0x589708=JSON[_0xfbf7('0x7f')](_0x2cae23[_0xfbf7('0x3e')][_0x3c7fd5])['$gte'];var _0x2ef0bf=JSON[_0xfbf7('0x7f')](_0x2cae23['query'][_0x3c7fd5])['$lte'];_0x1a1b77[_0xfbf7('0x48')](_0xfbf7('0x80'),_0x589708,_0x2ef0bf);}else{if(_0x2cae23[_0xfbf7('0x3e')][_0x3c7fd5]===_0xfbf7('0x81')){_0x1a1b77[_0xfbf7('0x48')]('i.'+_0x3c7fd5+_0xfbf7('0x82'));}else{_0x1a1b77[_0xfbf7('0x48')]('i.'+_0x3c7fd5+_0xfbf7('0x83'),_0x2cae23[_0xfbf7('0x3e')][_0x3c7fd5]);}}});}if(_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x84')]){if(_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x84')]==0x1){_0x1a1b77[_0xfbf7('0x65')](_0xfbf7('0x85'));}else{_0x1a1b77[_0xfbf7('0x65')](_0xfbf7('0x86'));}}if(_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x87')]){_0x16618b=_[_0xfbf7('0x88')](_0x2cae23[_0xfbf7('0x3e')]['tag'])?_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x87')]:new Array(_0x2cae23[_0xfbf7('0x3e')]['tag']);_0x16618b['forEach'](function(_0x2ad539){_0x27c711['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2ad539+',%');});}if(_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x89')]){var _0x4fc43e=_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x89')][_0xfbf7('0x8a')]('\x5c','\x5c\x5c')[_0xfbf7('0x8a')](/'/g,'\x27\x27');if(qs[_0xfbf7('0x8b')](_0x4fc43e)){_0x1a6e3c['or'](_0xfbf7('0x8c'),_0x4fc43e+'%')['or'](_0xfbf7('0x8d'),_0x4fc43e+'%');}else{_0x1a6e3c['or'](_0xfbf7('0x8e'),qs[_0xfbf7('0x8f')](_0x4fc43e))['or'](_0xfbf7('0x90'),_0x4fc43e+'%');}}}_0x1a1b77[_0xfbf7('0x48')](_0x1a6e3c);_0x1a1b77['group'](_0xfbf7('0x91'));var _0x177ef9={'type':db['Sequelize']['QueryTypes'][_0xfbf7('0x92')],'raw':!![]};var _0x12d339=_0x1a1b77[_0xfbf7('0x93')]();_0x12d339[_0xfbf7('0x4b')](_0xfbf7('0x91'));_0x12d339[_0xfbf7('0x4b')](_0xfbf7('0x94'),_0xfbf7('0x63'));if(_0x53865a[_0xfbf7('0x46')]){_0x53865a['order'][_0xfbf7('0x34')](function(_0x3f32af){var _0x1d1ddd=_0x3f32af[0x0]===_0xfbf7('0x95')?_0x3f32af[0x0]:'i.'+_0x3f32af[0x0];_0x1a1b77[_0xfbf7('0x46')](_0x1d1ddd,_0x3f32af[0x1]===_0xfbf7('0x96')?![]:!![]);});}if(!_[_0xfbf7('0x7b')](_0x16618b)){_0x1a1b77[_0xfbf7('0x65')](_0x27c711);_0x12d339[_0xfbf7('0x48')](_0xfbf7('0x97'),_0x16618b);}BPromise['resolve']()['then'](function(){if(!_0x12e259){if(_0x2cae23['query'][_0xfbf7('0x7c')])return;_0x12d339[_0xfbf7('0x48')](_0xfbf7('0x98'));_0x1a1b77[_0xfbf7('0x48')](_0xfbf7('0x98'));return;}if(_0x2cae23[_0xfbf7('0x99')][_0xfbf7('0x9a')]!==_0xfbf7('0x9b'))return;return _0x2cae23[_0xfbf7('0x99')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x57b4c4){if(_[_0xfbf7('0x7b')](_0x57b4c4)){_0x12d339[_0xfbf7('0x48')](_0xfbf7('0x9c'));_0x1a1b77[_0xfbf7('0x48')](_0xfbf7('0x9c'));}else{_0x12d339[_0xfbf7('0x48')](_0xfbf7('0x9d'),_[_0xfbf7('0x37')](_0x57b4c4,'id'));_0x1a1b77[_0xfbf7('0x48')](_0xfbf7('0x9d'),_[_0xfbf7('0x37')](_0x57b4c4,'id'));}});})[_0xfbf7('0x2b')](function(){if(_0x2cae23['user'][_0xfbf7('0x9a')]==='agent'&&!_0x12e259&&!_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x7c')])return[];return db['sequelize'][_0xfbf7('0x3e')](_0x12d339[_0xfbf7('0x9e')](),_0x177ef9);})[_0xfbf7('0x2b')](function(_0x43b245){_0x2c502a[_0xfbf7('0x24')]=_0x43b245[_0xfbf7('0x62')];if(_0x2c502a[_0xfbf7('0x24')]===0x0)return[];return db[_0xfbf7('0x9f')][_0xfbf7('0x3e')](_0x10144a[_0xfbf7('0x9e')](),_0x177ef9)[_0xfbf7('0x2b')](function(_0x5d1727){_0x4f8776=_[_0xfbf7('0xa0')](_0x5d1727,'id');_0x177ef9=_[_0xfbf7('0xa1')](_0x177ef9,{'model':db[_0xfbf7('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2cae23[_0xfbf7('0x3e')][_0xfbf7('0x42')]){_0x53865a[_0xfbf7('0x43')][_0xfbf7('0x34')](function(_0x538c36){_0x1a1b77[_0xfbf7('0x4b')]('i.'+_0x538c36);});}else{_0x1a1b77[_0xfbf7('0x4b')](_0xfbf7('0x94'),'unreadMessages');_0x1a1b77['field'](_0xfbf7('0xa2'),'Account.key');_0x1a1b77[_0xfbf7('0x4b')](_0xfbf7('0xa3'),_0xfbf7('0xa4'));_0x1a1b77[_0xfbf7('0x4b')](_0xfbf7('0xa5'),_0xfbf7('0x95'));_0x1a1b77['field'](_0xfbf7('0xa6'));_0x1a1b77['field'](_0xfbf7('0xa7'),'Contact.firstName');_0x1a1b77['field'](_0xfbf7('0xa8'),'Contact.lastName');_0x1a1b77[_0xfbf7('0x4b')](_0xfbf7('0xa9'),_0xfbf7('0xaa'));_0x1a1b77[_0xfbf7('0x4b')]('c.phone','Contact.phone');_0x1a1b77['field'](_0xfbf7('0xab'),_0xfbf7('0xac'));_0x1a1b77[_0xfbf7('0x4b')](_0xfbf7('0xad'),'Contact.fax');_0x1a1b77[_0xfbf7('0x4b')](_0xfbf7('0xae'),_0xfbf7('0xaf'));_0x1a1b77[_0xfbf7('0x4b')](_0xfbf7('0xb0'),_0xfbf7('0xb1'));_0x1a1b77[_0xfbf7('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xfbf7('0x33'));}if(_0x53865a[_0xfbf7('0x22')])_0x1a1b77[_0xfbf7('0x22')](_0x53865a[_0xfbf7('0x22')]);if(_0x53865a[_0xfbf7('0x21')])_0x1a1b77[_0xfbf7('0x21')](_0x53865a[_0xfbf7('0x21')]);return db[_0xfbf7('0x9f')]['query'](_0x1a1b77[_0xfbf7('0x9e')](),_0x177ef9);})[_0xfbf7('0x2b')](function(_0x2f9a49){if(_0x2f9a49[_0xfbf7('0x62')]>0x0)_0x50cc02['where']('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x2f9a49,'id'));return db[_0xfbf7('0x9f')]['query'](_0x50cc02[_0xfbf7('0x9e')](),_0x177ef9)[_0xfbf7('0x2b')](function(_0x2071a6){var _0x34d336=_['groupBy'](_0x2071a6,_0xfbf7('0xb2'));var _0x5efb41=[];_0x2f9a49['forEach'](function(_0x409912){_0x5efb41[_0xfbf7('0x35')](updateSmsInteraction(_0x409912,_0x4f8776,_0x34d336));});return BPromise[_0xfbf7('0xb3')](_0x5efb41);});});})[_0xfbf7('0x2b')](function(_0x1a35df){_0x2c502a[_0xfbf7('0xb4')]=_0x1a35df;return _0x2c502a;})[_0xfbf7('0x2b')](respondWithFilteredResult(_0x228461,_0x53865a))[_0xfbf7('0xb5')](handleError(_0x228461,null));};exports[_0xfbf7('0xb6')]=function(_0x21e8e5,_0x5a87de){var _0x1dde6a={'raw':![],'where':{'id':_0x21e8e5[_0xfbf7('0xb7')]['id']}},_0x2b46d0={};_0x2b46d0[_0xfbf7('0x3d')]=_[_0xfbf7('0x3f')](db[_0xfbf7('0x38')][_0xfbf7('0x39')]);_0x2b46d0[_0xfbf7('0x3e')]=_[_0xfbf7('0x3f')](_0x21e8e5[_0xfbf7('0x3e')]);_0x2b46d0[_0xfbf7('0x40')]=_[_0xfbf7('0x41')](_0x2b46d0[_0xfbf7('0x3d')],_0x2b46d0[_0xfbf7('0x3e')]);_0x1dde6a[_0xfbf7('0x43')]=_['intersection'](_0x2b46d0[_0xfbf7('0x3d')],qs['fields'](_0x21e8e5[_0xfbf7('0x3e')]['fields']));_0x1dde6a[_0xfbf7('0x43')]=_0x1dde6a['attributes']['length']?_0x1dde6a[_0xfbf7('0x43')]:_0x2b46d0[_0xfbf7('0x3d')];if(_0x21e8e5[_0xfbf7('0x3e')][_0xfbf7('0xb8')]){_0x1dde6a['include']=[{'all':!![]}];}_0x1dde6a=_[_0xfbf7('0xa1')]({},_0x1dde6a,_0x21e8e5[_0xfbf7('0xb9')]);return db[_0xfbf7('0x38')][_0xfbf7('0x6e')](_0x1dde6a)[_0xfbf7('0x2b')](handleEntityNotFound(_0x5a87de,null))[_0xfbf7('0x2b')](respondWithResult(_0x5a87de,null))[_0xfbf7('0xb5')](handleError(_0x5a87de,null));};exports['create']=function(_0x13f1db,_0x188be1){return db[_0xfbf7('0x38')]['create'](_0x13f1db[_0xfbf7('0x79')],{})[_0xfbf7('0x2b')](respondWithResult(_0x188be1,0xc9))[_0xfbf7('0xb5')](handleError(_0x188be1,null));};exports[_0xfbf7('0x2a')]=function(_0x360902,_0x3427b3){if(_0x360902[_0xfbf7('0x79')]['id']){delete _0x360902[_0xfbf7('0x79')]['id'];}return db[_0xfbf7('0x38')][_0xfbf7('0x6e')]({'where':{'id':_0x360902['params']['id']}})[_0xfbf7('0x2b')](handleEntityNotFound(_0x3427b3,null))[_0xfbf7('0x2b')](saveUpdates(_0x360902[_0xfbf7('0x79')],null))['then'](respondWithResult(_0x3427b3,null))['catch'](handleError(_0x3427b3,null));};exports[_0xfbf7('0x2c')]=function(_0x1a5fb2,_0x296585){return db[_0xfbf7('0x38')][_0xfbf7('0x6e')]({'where':{'id':_0x1a5fb2[_0xfbf7('0xb7')]['id']}})['then'](handleEntityNotFound(_0x296585,null))['then'](removeEntity(_0x296585,null))['catch'](handleError(_0x296585,null));};exports[_0xfbf7('0xba')]=function(_0x3b6af8,_0x2f19de){return db[_0xfbf7('0x38')]['describe']()[_0xfbf7('0x2b')](respondWithResult(_0x2f19de,null))[_0xfbf7('0xb5')](handleError(_0x2f19de,null));};exports['addMessage']=function(_0x42b55e,_0x45616e,_0x38085c){return db['SmsMessage']['find']({'where':{'id':_0x42b55e[_0xfbf7('0xb7')]['id']}})['then'](handleEntityNotFound(_0x45616e,null))[_0xfbf7('0x2b')](function(_0x14138b){if(_0x14138b){return _0x14138b['addMessage'](_0x42b55e[_0xfbf7('0x79')][_0xfbf7('0xbb')],_['omit'](_0x42b55e['body'],['ids','id'])||{});}})[_0xfbf7('0x2b')](respondWithResult(_0x45616e,null))[_0xfbf7('0xb5')](handleError(_0x45616e,null));};exports[_0xfbf7('0xbc')]=function(_0x4dc2b8,_0xb09bef,_0x5ac17d){var _0x57d8f4={'raw':![],'where':{}};var _0x159299={};var _0x426517={'count':0x0,'rows':[]};return db[_0xfbf7('0x38')][_0xfbf7('0xbd')]({'where':{'id':_0x4dc2b8['params']['id']}})['then'](handleEntityNotFound(_0xb09bef,null))['then'](function(_0x53fa00){if(_0x53fa00){_0x159299['model']=_[_0xfbf7('0x3f')](db[_0xfbf7('0xbe')][_0xfbf7('0x39')]);_0x159299[_0xfbf7('0x3e')]=_['keys'](_0x4dc2b8[_0xfbf7('0x3e')]);_0x159299[_0xfbf7('0x40')]=_[_0xfbf7('0x41')](_0x159299[_0xfbf7('0x3d')],_0x159299[_0xfbf7('0x3e')]);_0x57d8f4[_0xfbf7('0x43')]=_['intersection'](_0x159299['model'],qs['fields'](_0x4dc2b8['query'][_0xfbf7('0x42')]));_0x57d8f4[_0xfbf7('0x43')]=_0x57d8f4[_0xfbf7('0x43')][_0xfbf7('0x62')]?_0x57d8f4[_0xfbf7('0x43')]:_0x159299['model'];if(!_0x4dc2b8[_0xfbf7('0x3e')][_0xfbf7('0x44')](_0xfbf7('0x45'))){_0x57d8f4['limit']=qs[_0xfbf7('0x22')](_0x4dc2b8['query'][_0xfbf7('0x22')]);_0x57d8f4[_0xfbf7('0x21')]=qs[_0xfbf7('0x21')](_0x4dc2b8['query'][_0xfbf7('0x21')]);}_0x57d8f4[_0xfbf7('0x46')]=qs['sort'](_0x4dc2b8['query'][_0xfbf7('0x47')]);_0x57d8f4[_0xfbf7('0x48')]=qs['filters'](_[_0xfbf7('0x49')](_0x4dc2b8[_0xfbf7('0x3e')],_0x159299[_0xfbf7('0x40')]));_0x57d8f4[_0xfbf7('0x48')][_0xfbf7('0xb2')]=_0x53fa00['id'];if(_0x4dc2b8[_0xfbf7('0x3e')][_0xfbf7('0x89')]){_0x57d8f4[_0xfbf7('0x48')]=_['merge'](_0x57d8f4[_0xfbf7('0x48')],{'$or':_[_0xfbf7('0x37')](_0x57d8f4[_0xfbf7('0x43')],function(_0x4c1b11){var _0xf533e8={};_0xf533e8[_0x4c1b11]={'$like':'%'+_0x4dc2b8[_0xfbf7('0x3e')][_0xfbf7('0x89')]+'%'};return _0xf533e8;})});}if(_0x4dc2b8[_0xfbf7('0x3e')][_0xfbf7('0xbf')]){var _0x3788d8=_0x4dc2b8[_0xfbf7('0x3e')]['$gte'][_0xfbf7('0x6b')](',');var _0x4572ee={};_0x4572ee[_0x3788d8[0x0]]={'$gte':moment(_0x3788d8[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x57d8f4[_0xfbf7('0x48')]=_[_0xfbf7('0xa1')](_0x57d8f4[_0xfbf7('0x48')],_0x4572ee);}_0x57d8f4=_[_0xfbf7('0xa1')]({},_0x57d8f4,_0x4dc2b8[_0xfbf7('0xb9')]);return db[_0xfbf7('0xbe')][_0xfbf7('0x24')]({'where':_0x57d8f4['where']})[_0xfbf7('0x2b')](function(_0x1a2cdc){_0x426517['count']=_0x1a2cdc;if(_0x4dc2b8['query']['includeAll']){_0x57d8f4['include']=[{'all':!![]}];}return db[_0xfbf7('0xbe')]['findAll'](_0x57d8f4);})['then'](function(_0x20cd28){_0x426517[_0xfbf7('0xb4')]=_0x20cd28;return _0x426517;});}})['then'](respondWithFilteredResult(_0xb09bef,_0x57d8f4))['catch'](handleError(_0xb09bef,null));};exports[_0xfbf7('0xc0')]=function(_0x5a7b48,_0x7e0677,_0x8e54f0){return db[_0xfbf7('0x38')][_0xfbf7('0x6e')]({'where':{'id':_0x5a7b48['params']['id']}})[_0xfbf7('0x2b')](handleEntityNotFound(_0x7e0677,null))[_0xfbf7('0x2b')](function(_0x35cd69){if(_0x35cd69){return _0x35cd69[_0xfbf7('0xc1')](_0x5a7b48['body'][_0xfbf7('0xbb')],_[_0xfbf7('0xc2')](_0x5a7b48[_0xfbf7('0x79')],['ids','id'])||{})[_0xfbf7('0xc3')](function(){return db['Tag']['findAll']({'attributes':['id',_0xfbf7('0x2e'),'color'],'where':{'id':_0x5a7b48[_0xfbf7('0x79')]['ids']}});})[_0xfbf7('0x2b')](function(_0x5a151a){socket[_0xfbf7('0xc4')](_0xfbf7('0xc5'),{'id':Number(_0x5a7b48[_0xfbf7('0xb7')]['id']),'tags':_0x5a151a||[]});return{'id':Number(_0x5a7b48[_0xfbf7('0xb7')]['id']),'tags':_0x5a151a||[]};});}})[_0xfbf7('0x2b')](respondWithResult(_0x7e0677,null))[_0xfbf7('0xb5')](handleError(_0x7e0677,null));};exports[_0xfbf7('0xc6')]=function(_0x524829,_0x2f3b55,_0x5083e1){return db[_0xfbf7('0x38')][_0xfbf7('0x6e')]({'where':{'id':_0x524829[_0xfbf7('0xb7')]['id']}})[_0xfbf7('0x2b')](handleEntityNotFound(_0x2f3b55,null))['then'](function(_0x195c40){if(_0x195c40){return _0x195c40[_0xfbf7('0xc6')](_0x524829[_0xfbf7('0x3e')][_0xfbf7('0xbb')]);}})[_0xfbf7('0x2b')](respondWithStatusCode(_0x2f3b55,null))[_0xfbf7('0xb5')](handleError(_0x2f3b55,null));};exports[_0xfbf7('0xc7')]=function(_0x521ba6,_0x2d19c0){var _0x2681e4=moment()[_0xfbf7('0xc8')]()[_0xfbf7('0x9e')]();var _0x53e885=path[_0xfbf7('0xc9')](config['root'],_0xfbf7('0xca'),_0xfbf7('0xcb'),_0xfbf7('0xcc'));var _0x3903c7=path[_0xfbf7('0xc9')](config[_0xfbf7('0xcd')],_0xfbf7('0xca'),'files',_0xfbf7('0xce'));var _0x5f1123=path[_0xfbf7('0xc9')](_0x53e885,_0x2681e4);var _0x3fdee4=util[_0xfbf7('0xcf')]('transcript-%d-%s.zip',_0x521ba6['params']['id'],_0x2681e4);var _0x54e668=path[_0xfbf7('0xc9')](_0x53e885,_0x3fdee4);var _0x55779b=[];_0x55779b[_0xfbf7('0x35')]({'model':db[_0xfbf7('0x76')],'as':_0xfbf7('0x76'),'attributes':['id',_0xfbf7('0x31')],'raw':!![]});_0x55779b[_0xfbf7('0x35')]({'model':db[_0xfbf7('0xd0')],'as':_0xfbf7('0x68'),'attributes':['id',_0xfbf7('0xd1'),_0xfbf7('0xd2')],'raw':!![]});var _0x33c5f5=[{'model':db['SmsMessage'],'as':_0xfbf7('0xd3'),'attributes':['id',_0xfbf7('0x79'),_0xfbf7('0x7e'),'direction','secret','read'],'include':_0x55779b}];_0x33c5f5[_0xfbf7('0x35')]({'model':db[_0xfbf7('0xd4')],'as':_0xfbf7('0xd5'),'attributes':['id','name']});_0x33c5f5[_0xfbf7('0x35')]({'model':db[_0xfbf7('0x76')],'as':_0xfbf7('0xd6'),'attributes':['id',_0xfbf7('0x31')]});return db[_0xfbf7('0x38')][_0xfbf7('0x6e')]({'where':{'id':_0x521ba6[_0xfbf7('0xb7')]['id']},'include':_0x33c5f5})['then'](handleEntityNotFound(_0x2d19c0,null))[_0xfbf7('0x2b')](function(_0x51ea24){if(_0x51ea24){var _0x4aee1a=_0x51ea24[_0xfbf7('0xd7')]({'plain':!![]});fs[_0xfbf7('0xd8')](_0x5f1123);var _0x46f015={'channel':_0xfbf7('0xd9'),'account':_0x4aee1a[_0xfbf7('0xd5')][_0xfbf7('0x2e')],'agent':_0x4aee1a['Owner']?_0x4aee1a[_0xfbf7('0xd6')][_0xfbf7('0x31')]:_0xfbf7('0xda'),'createdAt':moment(_0x4aee1a[_0xfbf7('0x7e')])[_0xfbf7('0xcf')](_0xfbf7('0xdb'))[_0xfbf7('0x9e')](),'closedAt':_0x4aee1a[_0xfbf7('0xdc')]?moment(_0x4aee1a['closedAt'])[_0xfbf7('0xcf')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfbf7('0x9e')]():'','disposition':_0x4aee1a['disposition'],'messages':_(_0x4aee1a[_0xfbf7('0xd3')])[_0xfbf7('0x89')]({'secret':![]})[_0xfbf7('0x37')](function(_0x4e7a28){return{'date':moment(_0x4e7a28[_0xfbf7('0x7e')])['format'](_0xfbf7('0xdb'))[_0xfbf7('0x9e')](),'sender':_0x4e7a28['direction']===_0xfbf7('0xdd')?_0x4e7a28[_0xfbf7('0x76')]?_0x4e7a28['User']['fullname']:_0xfbf7('0xde'):_0x4e7a28[_0xfbf7('0x68')][_0xfbf7('0xd1')]+(_0x4e7a28[_0xfbf7('0x68')]['lastName']?'\x20'+_0x4e7a28[_0xfbf7('0x68')][_0xfbf7('0xd2')]:''),'body':_0x4e7a28[_0xfbf7('0x79')],'direction':_0x4e7a28[_0xfbf7('0xdf')]===_0xfbf7('0xdd')?'A':'C','secret':_0x4e7a28[_0xfbf7('0xe0')],'read':_0x4e7a28[_0xfbf7('0x84')]};})['value']()};return ejs['renderFile'](path[_0xfbf7('0xc9')](config[_0xfbf7('0xcd')],_0xfbf7('0xca'),_0xfbf7('0xe1'),_0xfbf7('0xe2')),{'interaction':_0x46f015})[_0xfbf7('0x2b')](function(_0x1b9017){var _0x68835e=path[_0xfbf7('0xc9')](_0x5f1123,_0xfbf7('0xe3')+_0x4aee1a['id']+'-'+_0x2681e4+'.pdf');var _0x279bf6={'path':_0x68835e,'channel':_0xfbf7('0xd9'),'interactionId':_0x4aee1a['id']};return pdf[_0xfbf7('0xe4')](_0x1b9017,_0x279bf6);})[_0xfbf7('0x2b')](function(){return new BPromise(function(_0x244a03,_0x9e0b2b){zipdir(_0x5f1123,{'saveTo':_0x54e668},function(_0x72a7da,_0x54c32a){if(_0x72a7da)return _0x9e0b2b(_0x72a7da);return _0x244a03(_0x54c32a);});})[_0xfbf7('0x2b')](function(){return new BPromise(function(_0x5496fd,_0x248a8f){rimraf(_0x5f1123,function(_0x15c00c){if(_0x15c00c)_0x248a8f(_0x15c00c);return _0x5496fd();});});})['then'](function(){return _0x2d19c0[_0xfbf7('0xc7')](_0x54e668,_0x3fdee4,function(_0x334e46){if(_0x334e46){console[_0xfbf7('0xe5')](_0xfbf7('0xe6'),_0x334e46);}else{fs[_0xfbf7('0xe7')](_0x54e668);}});});});}else{return _0x2d19c0[_0xfbf7('0x1f')](0xc8);}})[_0xfbf7('0xb5')](handleError(_0x2d19c0,null));}; \ No newline at end of file +var _0x84c9=['filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SmsInteraction','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','rawAttributes','options','create','destroy','describe','addMessage','ids','getMessages','findOne','SmsMessage','hasOwnProperty','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','omit','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','join','fullname','CmContact','firstName','lastName','direction','secret','Account','get','mkdirSync','Sms','Owner','N.A.','closedAt','Messages','out','System','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','stack','name','send','map','Tags','TagIds','split','forEach','push','catch','index','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','i.SmsAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x84c9,0x66));var _0x984c=function(_0x228658,_0xc5e4ac){_0x228658=_0x228658-0x0;var _0x831c09=_0x84c9[_0x228658];return _0x831c09;};'use strict';var emlformat=require(_0x984c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x984c('0x1'));var jsonpatch=require(_0x984c('0x2'));var rp=require(_0x984c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x984c('0x4'));var path=require(_0x984c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x984c('0x6'));var _=require(_0x984c('0x7'));var squel=require(_0x984c('0x8'));var crypto=require(_0x984c('0x9'));var jsforce=require(_0x984c('0xa'));var deskjs=require(_0x984c('0xb'));var toCsv=require(_0x984c('0xc'));var querystring=require(_0x984c('0xd'));var Papa=require(_0x984c('0xe'));var Redis=require(_0x984c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x984c('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x984c('0x11'));var logger=require(_0x984c('0x12'))(_0x984c('0x13'));var utils=require(_0x984c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x984c('0x15'));var db=require(_0x984c('0x16'))['db'];config[_0x984c('0x17')]=_[_0x984c('0x18')](config[_0x984c('0x17')],{'host':_0x984c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x984c('0x17')]));require(_0x984c('0x1a'))['register'](socket);function respondWithStatusCode(_0x28352c,_0x25aeaf){_0x25aeaf=_0x25aeaf||0xcc;return function(_0xb22a89){if(_0xb22a89){return _0x28352c[_0x984c('0x1b')](_0x25aeaf);}return _0x28352c['status'](_0x25aeaf)[_0x984c('0x1c')]();};}function respondWithResult(_0x59237c,_0x1a30f9){_0x1a30f9=_0x1a30f9||0xc8;return function(_0x15f9c4){if(_0x15f9c4){return _0x59237c[_0x984c('0x1d')](_0x1a30f9)[_0x984c('0x1e')](_0x15f9c4);}};}function respondWithFilteredResult(_0x3bb17d,_0x1c5997){return function(_0x543047){if(_0x543047){var _0x4bc510=typeof _0x1c5997[_0x984c('0x1f')]===_0x984c('0x20')&&typeof _0x1c5997['limit']==='undefined';var _0x45d98a=_0x543047[_0x984c('0x21')];var _0x5582cd=_0x4bc510?0x0:_0x1c5997[_0x984c('0x1f')];var _0x3d37c3=_0x4bc510?_0x543047[_0x984c('0x21')]:_0x1c5997[_0x984c('0x1f')]+_0x1c5997[_0x984c('0x22')];var _0x4336bf;if(_0x3d37c3>=_0x45d98a){_0x3d37c3=_0x45d98a;_0x4336bf=0xc8;}else{_0x4336bf=0xce;}_0x3bb17d[_0x984c('0x1d')](_0x4336bf);return _0x3bb17d[_0x984c('0x23')](_0x984c('0x24'),_0x5582cd+'-'+_0x3d37c3+'/'+_0x45d98a)[_0x984c('0x1e')](_0x543047);}return null;};}function patchUpdates(_0x201ba8){return function(_0x3363ba){try{jsonpatch[_0x984c('0x25')](_0x3363ba,_0x201ba8,!![]);}catch(_0x95659f){return BPromise[_0x984c('0x26')](_0x95659f);}return _0x3363ba['save']();};}function saveUpdates(_0x5a241a,_0xe11be8){return function(_0x1ff63f){if(_0x1ff63f){return _0x1ff63f[_0x984c('0x27')](_0x5a241a)[_0x984c('0x28')](function(_0x4211c5){return _0x4211c5;});}return null;};}function removeEntity(_0x3660ee,_0x2d04e8){return function(_0x3b397b){if(_0x3b397b){return _0x3b397b['destroy']()[_0x984c('0x28')](function(){_0x3660ee[_0x984c('0x1d')](0xcc)[_0x984c('0x1c')]();});}};}function handleEntityNotFound(_0x3155bc,_0x101e4e){return function(_0x338c1e){if(!_0x338c1e){_0x3155bc[_0x984c('0x1b')](0x194);}return _0x338c1e;};}function handleError(_0x13a2fc,_0xfee2e9){_0xfee2e9=_0xfee2e9||0x1f4;return function(_0x39799d){logger['error'](_0x39799d[_0x984c('0x29')]);if(_0x39799d[_0x984c('0x2a')]){delete _0x39799d[_0x984c('0x2a')];}_0x13a2fc[_0x984c('0x1d')](_0xfee2e9)[_0x984c('0x2b')](_0x39799d);};}function getInteractionUsers(_0x5994b3,_0x4bb1e4){return new BPromise(function(_0x30d2df,_0x36947b){try{if(_0x4bb1e4[_0x5994b3['id']]){_0x5994b3['Users']=_[_0x984c('0x2c')](_0x4bb1e4[_0x5994b3['id']],function(_0x45fdb1){return{'id':_0x45fdb1['id'],'fullname':_0x45fdb1['fullname']};});}}catch(_0x35542b){_0x36947b(_0x35542b);}_0x30d2df(_0x5994b3);});}function getInteractionTags(_0x5dda84,_0x255ce5){return new BPromise(function(_0x4b4cf2,_0x1eefd3){try{if(_0x5dda84['TagIds']){_0x5dda84[_0x984c('0x2d')]=[];_0x5dda84[_0x984c('0x2e')][_0x984c('0x2f')](',')[_0x984c('0x30')](function(_0x2af821){_0x5dda84['Tags'][_0x984c('0x31')](_0x255ce5[_0x2af821]);});}delete _0x5dda84[_0x984c('0x2e')];}catch(_0x4e46fa){_0x1eefd3(_0x4e46fa);}_0x4b4cf2(_0x5dda84);});}function updateSmsInteraction(_0x40ba30,_0x1313a0,_0xf089c1){return new BPromise(function(_0x4c7f88,_0x482bb9){return getInteractionUsers(_0x40ba30,_0xf089c1)['then'](function(_0x1cad56){return getInteractionTags(_0x1cad56,_0x1313a0);})[_0x984c('0x28')](function(_0x34bf17){_0x4c7f88(_0x34bf17);})[_0x984c('0x32')](function(_0x43ab08){_0x482bb9(_0x43ab08);});});}exports[_0x984c('0x33')]=function(_0x393d43,_0x2444b1){var _0x21418d={},_0xf2a6b5={},_0x2a9620={'count':0x0,'rows':[]};var _0x2131c7=_[_0x984c('0x2c')](db['SmsInteraction']['rawAttributes'],function(_0x238457){return{'name':_0x238457[_0x984c('0x34')],'type':_0x238457[_0x984c('0x35')][_0x984c('0x36')]};});_0xf2a6b5[_0x984c('0x37')]=_[_0x984c('0x2c')](_0x2131c7,'name');_0xf2a6b5['query']=_[_0x984c('0x38')](_0x393d43[_0x984c('0x39')]);_0xf2a6b5[_0x984c('0x3a')]=_[_0x984c('0x3b')](_0xf2a6b5[_0x984c('0x37')],_0xf2a6b5[_0x984c('0x39')]);_0x21418d['attributes']=_[_0x984c('0x3b')](_0xf2a6b5[_0x984c('0x37')],qs[_0x984c('0x3c')](_0x393d43[_0x984c('0x39')]['fields']));_0x21418d[_0x984c('0x3d')]=_0x21418d[_0x984c('0x3d')][_0x984c('0x3e')]?_0x21418d[_0x984c('0x3d')]:_0xf2a6b5['model'];if(!_0x393d43[_0x984c('0x39')]['hasOwnProperty']('nolimit')){_0x21418d['limit']=qs[_0x984c('0x22')](_0x393d43[_0x984c('0x39')][_0x984c('0x22')]);_0x21418d[_0x984c('0x1f')]=qs[_0x984c('0x1f')](_0x393d43[_0x984c('0x39')]['offset']);}_0x21418d[_0x984c('0x3f')]=qs['sort'](_0x393d43[_0x984c('0x39')][_0x984c('0x40')]);_0x21418d[_0x984c('0x41')]=qs['filters'](_[_0x984c('0x42')](_0x393d43[_0x984c('0x39')],_0xf2a6b5[_0x984c('0x3a')]),_0x2131c7);var _0x3b0a49=[];var _0x220b29=squel[_0x984c('0x43')]()[_0x984c('0x44')]('id')[_0x984c('0x44')](_0x984c('0x2a'))[_0x984c('0x44')](_0x984c('0x45'))[_0x984c('0x46')](_0x984c('0x47'));var _0x9d602b=squel[_0x984c('0x43')]()['field'](_0x984c('0x48'))[_0x984c('0x44')](_0x984c('0x49'))[_0x984c('0x44')]('ui.SmsInteractionId')['from'](_0x984c('0x4a'),'ui')[_0x984c('0x4b')](_0x984c('0x4c'),'u',_0x984c('0x4d'));var _0x5681e=squel[_0x984c('0x43')]()[_0x984c('0x46')](_0x984c('0x4e'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x984c('0x4c'),'o',_0x984c('0x4f'))['left_join'](_0x984c('0x50'),'a','a.id\x20=\x20i.SmsAccountId')[_0x984c('0x4b')](_0x984c('0x51'),'me',_0x984c('0x52'))[_0x984c('0x4b')](_0x984c('0x53'),'it',_0x984c('0x54'))[_0x984c('0x4b')](_0x984c('0x47'),'t',_0x984c('0x55'));var _0x3a75a5=squel[_0x984c('0x56')]();var _0x16a823=[];var _0xe020a7=squel['expr']();var _0x4d08e7;if(_0x393d43[_0x984c('0x39')][_0x984c('0x57')]){_0x4d08e7=as[_0x984c('0x58')](_0x393d43[_0x984c('0x39')][_0x984c('0x57')]);var _0x428daf=_0x4d08e7[_0x984c('0x59')];for(var _0x1de601=0x0;_0x1de601<_0x4d08e7['conditions'][_0x984c('0x3e')];_0x1de601++){var _0x4a0a7f=_0x4d08e7[_0x984c('0x5a')][_0x1de601];var _0x568097='i';var _0x4b784d=_[_0x984c('0x5b')](_0x2131c7,[_0x984c('0x2a'),_0x4a0a7f['field']]);if(!_0x4b784d){switch(_0x4a0a7f[_0x984c('0x44')]){case _0x984c('0x5c'):if(_0x4a0a7f[_0x984c('0x5d')]==0x1){_0x5681e['having']('`'+_0x4a0a7f[_0x984c('0x44')]+_0x984c('0x5e'));}else{_0x5681e[_0x984c('0x5f')]('`'+_0x4a0a7f[_0x984c('0x44')]+_0x984c('0x60'));}break;case _0x984c('0x61'):if(_0x4a0a7f[_0x984c('0x62')]===_0x984c('0x63')){if(_0x4a0a7f[_0x984c('0x5d')][_0x984c('0x2f')]('\x20')[_0x984c('0x3e')]>0x1){_0x3a75a5[_0x428daf]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4a0a7f[_0x984c('0x5d')]),null);}else{var _0x1abeb3='%'+_0x4a0a7f[_0x984c('0x5d')]+'%';_0x3a75a5[_0x428daf](_0x984c('0x64'),_0x1abeb3,_0x1abeb3,_0x1abeb3);}}else{_0x4b784d=_[_0x984c('0x5b')](_0x2131c7,[_0x984c('0x2a'),_0x984c('0x65')]);_0x4a0a7f[_0x984c('0x44')]=_0x984c('0x65');_0x3d1ef9=as[_0x984c('0x66')](_0x568097,_0x4b784d[_0x984c('0x35')],_0x4a0a7f);_0x3a75a5[_0x428daf](_0x3d1ef9[_0x984c('0x67')],_0x3d1ef9[_0x984c('0x5d')][_0x984c('0x68')],_0x3d1ef9[_0x984c('0x5d')]['end']);}break;case'Tag':var _0x4d0c2e=_0x4a0a7f[_0x984c('0x5d')]['split'](',')[_0x984c('0x2c')](function(_0x457db9){return Number(_0x457db9);});_0x4d0c2e['forEach'](function(_0x385180){_0xe020a7['or'](_0x984c('0x69'),'%,'+_0x385180+',%');});_0x16a823=_[_0x984c('0x6a')](_0x16a823,_0x4d0c2e);break;case _0x984c('0x6b'):if(_0x4a0a7f['operator']===_0x984c('0x63')){_0x3a75a5[_0x428daf](_0x984c('0x6c'),'%'+_0x4a0a7f[_0x984c('0x5d')]+'%',null);}else{_0x4b784d=_[_0x984c('0x5b')](_0x2131c7,['name',_0x984c('0x6d')]);_0x4a0a7f[_0x984c('0x44')]='UserId';_0x3d1ef9=as[_0x984c('0x66')](_0x568097,_0x4b784d[_0x984c('0x35')],_0x4a0a7f);_0x3a75a5[_0x428daf](_0x3d1ef9[_0x984c('0x67')],_0x3d1ef9[_0x984c('0x5d')][_0x984c('0x68')],_0x3d1ef9[_0x984c('0x5d')]['end']);}break;case _0x984c('0x6e'):_0x3d1ef9=as['buildExpression']('me',null,_0x4a0a7f);_0x3a75a5[_0x428daf](_0x3d1ef9[_0x984c('0x67')],_0x3d1ef9[_0x984c('0x5d')][_0x984c('0x68')],_0x3d1ef9[_0x984c('0x5d')][_0x984c('0x1c')]);break;}}else{var _0x3d1ef9=as[_0x984c('0x66')](_0x568097,_0x4b784d[_0x984c('0x35')],_0x4a0a7f);_0x3a75a5[_0x428daf](_0x3d1ef9[_0x984c('0x67')],_0x3d1ef9[_0x984c('0x5d')][_0x984c('0x68')],_0x3d1ef9[_0x984c('0x5d')][_0x984c('0x1c')]);}}}else{var _0x20e205=_(_0x393d43[_0x984c('0x39')])['keys']()['map'](function(_0x107a2b){return _['some'](_0x2131c7,[_0x984c('0x2a'),_0x107a2b])?_0x107a2b:undefined;})[_0x984c('0x6f')]()[_0x984c('0x5d')]();if(!_[_0x984c('0x70')](_0x20e205)){_0x20e205[_0x984c('0x30')](function(_0x2f7493){if(_0x2f7493==='SmsAccountId'){_0x5681e[_0x984c('0x41')](_0x984c('0x71'),[]['concat'](_0x393d43['query'][_0x2f7493]));}else if(_0x2f7493===_0x984c('0x72')){var _0x11986f=JSON[_0x984c('0x73')](_0x393d43[_0x984c('0x39')][_0x2f7493])['$gte'];var _0x43b5b4=JSON[_0x984c('0x73')](_0x393d43['query'][_0x2f7493])[_0x984c('0x74')];_0x5681e[_0x984c('0x41')](_0x984c('0x75'),_0x11986f,_0x43b5b4);}else{if(_0x393d43[_0x984c('0x39')][_0x2f7493]===_0x984c('0x76')){_0x5681e[_0x984c('0x41')]('i.'+_0x2f7493+_0x984c('0x77'));}else{_0x5681e[_0x984c('0x41')]('i.'+_0x2f7493+_0x984c('0x78'),_0x393d43[_0x984c('0x39')][_0x2f7493]);}}});}if(_0x393d43[_0x984c('0x39')][_0x984c('0x79')]){if(_0x393d43[_0x984c('0x39')][_0x984c('0x79')]==0x1){_0x5681e[_0x984c('0x5f')](_0x984c('0x7a'));}else{_0x5681e[_0x984c('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x393d43['query']['tag']){_0x16a823=_[_0x984c('0x7b')](_0x393d43[_0x984c('0x39')]['tag'])?_0x393d43[_0x984c('0x39')][_0x984c('0x7c')]:new Array(_0x393d43[_0x984c('0x39')][_0x984c('0x7c')]);_0x16a823[_0x984c('0x30')](function(_0x24eefd){_0xe020a7['or'](_0x984c('0x69'),'%,'+_0x24eefd+',%');});}if(_0x393d43[_0x984c('0x39')][_0x984c('0x7d')]){var _0x5ca128=_0x393d43['query'][_0x984c('0x7d')][_0x984c('0x7e')]('\x5c','\x5c\x5c')[_0x984c('0x7e')](/'/g,'\x27\x27');if(qs[_0x984c('0x7f')](_0x5ca128)){_0x3a75a5['or'](_0x984c('0x80'),_0x5ca128+'%')['or'](_0x984c('0x81'),_0x5ca128+'%');}else{_0x3a75a5['or'](_0x984c('0x82'),qs['getFullTextValue'](_0x5ca128))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5ca128+'%');}}}_0x5681e['where'](_0x3a75a5);_0x5681e[_0x984c('0x83')]('i.id');var _0x48c7e6={'type':db[_0x984c('0x84')][_0x984c('0x85')]['SELECT'],'raw':!![]};var _0xf27c5c=_0x5681e[_0x984c('0x86')]();_0xf27c5c['field'](_0x984c('0x87'));_0xf27c5c[_0x984c('0x44')](_0x984c('0x88'),_0x984c('0x5c'));if(_0x21418d['order']){_0x21418d[_0x984c('0x3f')]['forEach'](function(_0x2de42a){var _0x364fd3=_0x2de42a[0x0]===_0x984c('0x89')?_0x2de42a[0x0]:'i.'+_0x2de42a[0x0];_0x5681e[_0x984c('0x3f')](_0x364fd3,_0x2de42a[0x1]==='DESC'?![]:!![]);});}if(!_[_0x984c('0x70')](_0x16a823)){_0x5681e[_0x984c('0x5f')](_0xe020a7);_0xf27c5c[_0x984c('0x41')](_0x984c('0x8a'),_0x16a823);}BPromise[_0x984c('0x8b')]()[_0x984c('0x28')](function(){if(!_0x4d08e7){if(_0x393d43['query'][_0x984c('0x8c')])return;_0xf27c5c[_0x984c('0x41')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x5681e[_0x984c('0x41')](_0x984c('0x8d'));return;}if(_0x393d43[_0x984c('0x8e')][_0x984c('0x8f')]!==_0x984c('0x90'))return;return _0x393d43[_0x984c('0x8e')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x984c('0x28')](function(_0x2d80f1){if(_[_0x984c('0x70')](_0x2d80f1)){_0xf27c5c[_0x984c('0x41')](_0x984c('0x91'));_0x5681e[_0x984c('0x41')](_0x984c('0x91'));}else{_0xf27c5c[_0x984c('0x41')](_0x984c('0x71'),_[_0x984c('0x2c')](_0x2d80f1,'id'));_0x5681e[_0x984c('0x41')]('i.SmsAccountId\x20IN\x20?',_[_0x984c('0x2c')](_0x2d80f1,'id'));}});})[_0x984c('0x28')](function(){if(_0x393d43[_0x984c('0x8e')][_0x984c('0x8f')]===_0x984c('0x90')&&!_0x4d08e7&&!_0x393d43['query'][_0x984c('0x8c')])return[];return db[_0x984c('0x92')][_0x984c('0x39')](_0xf27c5c[_0x984c('0x93')](),_0x48c7e6);})[_0x984c('0x28')](function(_0x262edc){_0x2a9620[_0x984c('0x21')]=_0x262edc[_0x984c('0x3e')];if(_0x2a9620[_0x984c('0x21')]===0x0)return[];return db[_0x984c('0x92')][_0x984c('0x39')](_0x220b29[_0x984c('0x93')](),_0x48c7e6)[_0x984c('0x28')](function(_0x5e6962){_0x3b0a49=_[_0x984c('0x94')](_0x5e6962,'id');_0x48c7e6=_[_0x984c('0x95')](_0x48c7e6,{'model':db[_0x984c('0x96')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x393d43[_0x984c('0x39')][_0x984c('0x3c')]){_0x21418d[_0x984c('0x3d')]['forEach'](function(_0x2c2c32){_0x5681e[_0x984c('0x44')]('i.'+_0x2c2c32);});}else{_0x5681e[_0x984c('0x44')](_0x984c('0x88'),_0x984c('0x5c'));_0x5681e[_0x984c('0x44')]('a.key','Account.key');_0x5681e['field'](_0x984c('0x97'),_0x984c('0x98'));_0x5681e[_0x984c('0x44')](_0x984c('0x99'),'contactName');_0x5681e[_0x984c('0x44')]('i.*');_0x5681e[_0x984c('0x44')](_0x984c('0x9a'),_0x984c('0x9b'));_0x5681e[_0x984c('0x44')](_0x984c('0x9c'),_0x984c('0x9d'));_0x5681e[_0x984c('0x44')](_0x984c('0x9e'),'Contact.email');_0x5681e[_0x984c('0x44')](_0x984c('0x9f'),_0x984c('0xa0'));_0x5681e[_0x984c('0x44')](_0x984c('0xa1'),'Contact.mobile');_0x5681e[_0x984c('0x44')]('c.fax',_0x984c('0xa2'));_0x5681e['field']('o.fullname',_0x984c('0xa3'));_0x5681e['field']('o.internal','Owner.internal');_0x5681e[_0x984c('0x44')](_0x984c('0xa4'),'TagIds');}if(_0x21418d['limit'])_0x5681e['limit'](_0x21418d[_0x984c('0x22')]);if(_0x21418d[_0x984c('0x1f')])_0x5681e[_0x984c('0x1f')](_0x21418d[_0x984c('0x1f')]);return db['sequelize'][_0x984c('0x39')](_0x5681e[_0x984c('0x93')](),_0x48c7e6);})[_0x984c('0x28')](function(_0x589f6e){if(_0x589f6e[_0x984c('0x3e')]>0x0)_0x9d602b['where'](_0x984c('0xa5'),_[_0x984c('0x2c')](_0x589f6e,'id'));return db[_0x984c('0x92')][_0x984c('0x39')](_0x9d602b[_0x984c('0x93')](),_0x48c7e6)['then'](function(_0x3da0b6){var _0x2da48a=_[_0x984c('0xa6')](_0x3da0b6,_0x984c('0xa7'));var _0x59af25=[];_0x589f6e[_0x984c('0x30')](function(_0x43a294){_0x59af25[_0x984c('0x31')](updateSmsInteraction(_0x43a294,_0x3b0a49,_0x2da48a));});return BPromise[_0x984c('0xa8')](_0x59af25);});});})['then'](function(_0x2ee194){_0x2a9620[_0x984c('0xa9')]=_0x2ee194;return _0x2a9620;})['then'](respondWithFilteredResult(_0x2444b1,_0x21418d))[_0x984c('0x32')](handleError(_0x2444b1,null));};exports[_0x984c('0xaa')]=function(_0x131c60,_0x379055){var _0x200c6a={'raw':![],'where':{'id':_0x131c60[_0x984c('0xab')]['id']}},_0x160b90={};_0x160b90[_0x984c('0x37')]=_[_0x984c('0x38')](db[_0x984c('0x96')][_0x984c('0xac')]);_0x160b90[_0x984c('0x39')]=_[_0x984c('0x38')](_0x131c60[_0x984c('0x39')]);_0x160b90[_0x984c('0x3a')]=_[_0x984c('0x3b')](_0x160b90[_0x984c('0x37')],_0x160b90[_0x984c('0x39')]);_0x200c6a['attributes']=_[_0x984c('0x3b')](_0x160b90[_0x984c('0x37')],qs[_0x984c('0x3c')](_0x131c60[_0x984c('0x39')][_0x984c('0x3c')]));_0x200c6a[_0x984c('0x3d')]=_0x200c6a[_0x984c('0x3d')]['length']?_0x200c6a[_0x984c('0x3d')]:_0x160b90[_0x984c('0x37')];if(_0x131c60['query']['includeAll']){_0x200c6a['include']=[{'all':!![]}];}_0x200c6a=_[_0x984c('0x95')]({},_0x200c6a,_0x131c60[_0x984c('0xad')]);return db[_0x984c('0x96')][_0x984c('0x5b')](_0x200c6a)[_0x984c('0x28')](handleEntityNotFound(_0x379055,null))[_0x984c('0x28')](respondWithResult(_0x379055,null))[_0x984c('0x32')](handleError(_0x379055,null));};exports[_0x984c('0xae')]=function(_0x48cf7e,_0x29e9e6){return db[_0x984c('0x96')]['create'](_0x48cf7e['body'],{})['then'](respondWithResult(_0x29e9e6,0xc9))['catch'](handleError(_0x29e9e6,null));};exports[_0x984c('0x27')]=function(_0x4f1542,_0x77a03e){if(_0x4f1542[_0x984c('0x6e')]['id']){delete _0x4f1542['body']['id'];}return db[_0x984c('0x96')][_0x984c('0x5b')]({'where':{'id':_0x4f1542['params']['id']}})['then'](handleEntityNotFound(_0x77a03e,null))[_0x984c('0x28')](saveUpdates(_0x4f1542[_0x984c('0x6e')],null))[_0x984c('0x28')](respondWithResult(_0x77a03e,null))['catch'](handleError(_0x77a03e,null));};exports[_0x984c('0xaf')]=function(_0x524fbb,_0x29d25e){return db[_0x984c('0x96')]['find']({'where':{'id':_0x524fbb[_0x984c('0xab')]['id']}})[_0x984c('0x28')](handleEntityNotFound(_0x29d25e,null))['then'](removeEntity(_0x29d25e,null))[_0x984c('0x32')](handleError(_0x29d25e,null));};exports[_0x984c('0xb0')]=function(_0x34d9c8,_0x29223c){return db[_0x984c('0x96')]['describe']()[_0x984c('0x28')](respondWithResult(_0x29223c,null))['catch'](handleError(_0x29223c,null));};exports[_0x984c('0xb1')]=function(_0x2b1bdf,_0x204688,_0x119730){return db['SmsMessage'][_0x984c('0x5b')]({'where':{'id':_0x2b1bdf[_0x984c('0xab')]['id']}})['then'](handleEntityNotFound(_0x204688,null))[_0x984c('0x28')](function(_0x1bafaa){if(_0x1bafaa){return _0x1bafaa[_0x984c('0xb1')](_0x2b1bdf[_0x984c('0x6e')][_0x984c('0xb2')],_['omit'](_0x2b1bdf[_0x984c('0x6e')],[_0x984c('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x204688,null))[_0x984c('0x32')](handleError(_0x204688,null));};exports[_0x984c('0xb3')]=function(_0x2d3f20,_0x5cd5c6,_0x70eefa){var _0x427761={'raw':![],'where':{}};var _0xbc030c={};var _0x573727={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x984c('0xb4')]({'where':{'id':_0x2d3f20[_0x984c('0xab')]['id']}})[_0x984c('0x28')](handleEntityNotFound(_0x5cd5c6,null))['then'](function(_0xda1c7d){if(_0xda1c7d){_0xbc030c[_0x984c('0x37')]=_[_0x984c('0x38')](db[_0x984c('0xb5')][_0x984c('0xac')]);_0xbc030c[_0x984c('0x39')]=_[_0x984c('0x38')](_0x2d3f20['query']);_0xbc030c['filters']=_[_0x984c('0x3b')](_0xbc030c[_0x984c('0x37')],_0xbc030c['query']);_0x427761[_0x984c('0x3d')]=_['intersection'](_0xbc030c[_0x984c('0x37')],qs[_0x984c('0x3c')](_0x2d3f20[_0x984c('0x39')][_0x984c('0x3c')]));_0x427761[_0x984c('0x3d')]=_0x427761['attributes'][_0x984c('0x3e')]?_0x427761[_0x984c('0x3d')]:_0xbc030c['model'];if(!_0x2d3f20[_0x984c('0x39')][_0x984c('0xb6')](_0x984c('0xb7'))){_0x427761[_0x984c('0x22')]=qs['limit'](_0x2d3f20[_0x984c('0x39')][_0x984c('0x22')]);_0x427761[_0x984c('0x1f')]=qs[_0x984c('0x1f')](_0x2d3f20[_0x984c('0x39')][_0x984c('0x1f')]);}_0x427761['order']=qs[_0x984c('0x40')](_0x2d3f20[_0x984c('0x39')][_0x984c('0x40')]);_0x427761[_0x984c('0x41')]=qs['filters'](_[_0x984c('0x42')](_0x2d3f20['query'],_0xbc030c['filters']));_0x427761[_0x984c('0x41')][_0x984c('0xa7')]=_0xda1c7d['id'];if(_0x2d3f20['query'][_0x984c('0x7d')]){_0x427761[_0x984c('0x41')]=_[_0x984c('0x95')](_0x427761[_0x984c('0x41')],{'$or':_[_0x984c('0x2c')](_0x427761[_0x984c('0x3d')],function(_0x5c6317){var _0x389876={};_0x389876[_0x5c6317]={'$like':'%'+_0x2d3f20[_0x984c('0x39')][_0x984c('0x7d')]+'%'};return _0x389876;})});}if(_0x2d3f20[_0x984c('0x39')][_0x984c('0xb8')]){var _0x36b349=_0x2d3f20[_0x984c('0x39')][_0x984c('0xb8')][_0x984c('0x2f')](',');var _0x7f0f3e={};_0x7f0f3e[_0x36b349[0x0]]={'$gte':moment(_0x36b349[0x1])['format'](_0x984c('0xb9'))};_0x427761[_0x984c('0x41')]=_['merge'](_0x427761['where'],_0x7f0f3e);}_0x427761=_['merge']({},_0x427761,_0x2d3f20['options']);return db['SmsMessage'][_0x984c('0x21')]({'where':_0x427761['where']})[_0x984c('0x28')](function(_0xdaf362){_0x573727['count']=_0xdaf362;if(_0x2d3f20[_0x984c('0x39')]['includeAll']){_0x427761[_0x984c('0xba')]=[{'all':!![]}];}return db[_0x984c('0xb5')][_0x984c('0xbb')](_0x427761);})[_0x984c('0x28')](function(_0x511ff7){_0x573727[_0x984c('0xa9')]=_0x511ff7;return _0x573727;});}})[_0x984c('0x28')](respondWithFilteredResult(_0x5cd5c6,_0x427761))[_0x984c('0x32')](handleError(_0x5cd5c6,null));};exports['addTags']=function(_0x5c5261,_0x40c929,_0x2ca5d6){return db[_0x984c('0x96')][_0x984c('0x5b')]({'where':{'id':_0x5c5261[_0x984c('0xab')]['id']}})[_0x984c('0x28')](handleEntityNotFound(_0x40c929,null))['then'](function(_0xa29374){if(_0xa29374){return _0xa29374[_0x984c('0xbc')](_0x5c5261[_0x984c('0x6e')][_0x984c('0xb2')],_[_0x984c('0xbd')](_0x5c5261[_0x984c('0x6e')],['ids','id'])||{})[_0x984c('0xbe')](function(){return db[_0x984c('0xbf')][_0x984c('0xbb')]({'attributes':['id',_0x984c('0x2a'),'color'],'where':{'id':_0x5c5261[_0x984c('0x6e')]['ids']}});})[_0x984c('0x28')](function(_0x5640e7){socket[_0x984c('0xc0')](_0x984c('0xc1'),{'id':Number(_0x5c5261[_0x984c('0xab')]['id']),'tags':_0x5640e7||[]});return{'id':Number(_0x5c5261[_0x984c('0xab')]['id']),'tags':_0x5640e7||[]};});}})['then'](respondWithResult(_0x40c929,null))['catch'](handleError(_0x40c929,null));};exports[_0x984c('0xc2')]=function(_0x4272c9,_0x1de48f,_0x31319b){return db[_0x984c('0x96')][_0x984c('0x5b')]({'where':{'id':_0x4272c9[_0x984c('0xab')]['id']}})[_0x984c('0x28')](handleEntityNotFound(_0x1de48f,null))['then'](function(_0x2a319f){if(_0x2a319f){return _0x2a319f[_0x984c('0xc2')](_0x4272c9[_0x984c('0x39')][_0x984c('0xb2')]);}})[_0x984c('0x28')](respondWithStatusCode(_0x1de48f,null))[_0x984c('0x32')](handleError(_0x1de48f,null));};exports[_0x984c('0xc3')]=function(_0x15ffad,_0x5cdac2){var _0x5e2cf7=moment()[_0x984c('0xc4')]()['toString']();var _0x2915fc=path['join'](config[_0x984c('0xc5')],_0x984c('0xc6'),'files',_0x984c('0xc7'));var _0x5487de=path['join'](config[_0x984c('0xc5')],_0x984c('0xc6'),_0x984c('0xc8'),_0x984c('0xc9'));var _0x37f597=path['join'](_0x2915fc,_0x5e2cf7);var _0x5bbb76=util[_0x984c('0xca')](_0x984c('0xcb'),_0x15ffad[_0x984c('0xab')]['id'],_0x5e2cf7);var _0x310124=path[_0x984c('0xcc')](_0x2915fc,_0x5bbb76);var _0x209385=[];_0x209385[_0x984c('0x31')]({'model':db['User'],'as':'User','attributes':['id',_0x984c('0xcd')],'raw':!![]});_0x209385[_0x984c('0x31')]({'model':db[_0x984c('0xce')],'as':_0x984c('0x61'),'attributes':['id',_0x984c('0xcf'),_0x984c('0xd0')],'raw':!![]});var _0x427ff6=[{'model':db[_0x984c('0xb5')],'as':'Messages','attributes':['id',_0x984c('0x6e'),_0x984c('0x72'),_0x984c('0xd1'),_0x984c('0xd2'),'read'],'include':_0x209385}];_0x427ff6[_0x984c('0x31')]({'model':db['SmsAccount'],'as':_0x984c('0xd3'),'attributes':['id',_0x984c('0x2a')]});_0x427ff6[_0x984c('0x31')]({'model':db['User'],'as':'Owner','attributes':['id',_0x984c('0xcd')]});return db[_0x984c('0x96')][_0x984c('0x5b')]({'where':{'id':_0x15ffad[_0x984c('0xab')]['id']},'include':_0x427ff6})[_0x984c('0x28')](handleEntityNotFound(_0x5cdac2,null))[_0x984c('0x28')](function(_0x4bdad3){if(_0x4bdad3){var _0x1546a1=_0x4bdad3[_0x984c('0xd4')]({'plain':!![]});fs[_0x984c('0xd5')](_0x37f597);var _0x279ddf={'channel':_0x984c('0xd6'),'account':_0x1546a1[_0x984c('0xd3')][_0x984c('0x2a')],'agent':_0x1546a1['Owner']?_0x1546a1[_0x984c('0xd7')][_0x984c('0xcd')]:_0x984c('0xd8'),'createdAt':moment(_0x1546a1[_0x984c('0x72')])[_0x984c('0xca')]('YYYY-MM-DD\x20HH:mm:ss')[_0x984c('0x93')](),'closedAt':_0x1546a1['closed']?moment(_0x1546a1[_0x984c('0xd9')])[_0x984c('0xca')](_0x984c('0xb9'))[_0x984c('0x93')]():'','disposition':_0x1546a1['disposition'],'messages':_(_0x1546a1[_0x984c('0xda')])[_0x984c('0x7d')]({'secret':![]})[_0x984c('0x2c')](function(_0x46a8b0){return{'date':moment(_0x46a8b0['createdAt'])['format'](_0x984c('0xb9'))[_0x984c('0x93')](),'sender':_0x46a8b0[_0x984c('0xd1')]===_0x984c('0xdb')?_0x46a8b0[_0x984c('0x6b')]?_0x46a8b0[_0x984c('0x6b')][_0x984c('0xcd')]:_0x984c('0xdc'):_0x46a8b0[_0x984c('0x61')][_0x984c('0xcf')]+(_0x46a8b0[_0x984c('0x61')][_0x984c('0xd0')]?'\x20'+_0x46a8b0[_0x984c('0x61')][_0x984c('0xd0')]:''),'body':_0x46a8b0[_0x984c('0x6e')],'direction':_0x46a8b0[_0x984c('0xd1')]===_0x984c('0xdb')?'A':'C','secret':_0x46a8b0['secret'],'read':_0x46a8b0[_0x984c('0x79')]};})[_0x984c('0x5d')]()};return ejs[_0x984c('0xdd')](path['join'](config[_0x984c('0xc5')],_0x984c('0xc6'),_0x984c('0xde'),_0x984c('0xdf')),{'interaction':_0x279ddf})[_0x984c('0x28')](function(_0x3e0c7c){var _0x3a6d04=path[_0x984c('0xcc')](_0x37f597,'transcript-'+_0x1546a1['id']+'-'+_0x5e2cf7+'.pdf');var _0x286e3c={'path':_0x3a6d04,'channel':_0x984c('0xd6'),'interactionId':_0x1546a1['id']};return pdf[_0x984c('0xe0')](_0x3e0c7c,_0x286e3c);})[_0x984c('0x28')](function(){return new BPromise(function(_0x6bc144,_0x26103a){zipdir(_0x37f597,{'saveTo':_0x310124},function(_0x53e3df,_0x3a51d5){if(_0x53e3df)return _0x26103a(_0x53e3df);return _0x6bc144(_0x3a51d5);});})[_0x984c('0x28')](function(){return new BPromise(function(_0x5e7193,_0x18d865){rimraf(_0x37f597,function(_0x417065){if(_0x417065)_0x18d865(_0x417065);return _0x5e7193();});});})['then'](function(){return _0x5cdac2[_0x984c('0xc3')](_0x310124,_0x5bbb76,function(_0x53cbe3){if(_0x53cbe3){console['log'](_0x984c('0xe1'),_0x53cbe3);}else{fs[_0x984c('0xe2')](_0x310124);}});});});}else{return _0x5cdac2[_0x984c('0x1b')](0xc8);}})[_0x984c('0x32')](handleError(_0x5cdac2,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 8609f97..7716185 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 _0x4b17=['SmsInteraction','SmsMessage','setMaxListeners','update','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x1c2119,_0x250b8c){var _0x5afcfa=function(_0x41a842){while(--_0x41a842){_0x1c2119['push'](_0x1c2119['shift']());}};_0x5afcfa(++_0x250b8c);}(_0x4b17,0x10f));var _0x74b1=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x4b17[_0x16771d];return _0x386f11;};'use strict';var EventEmitter=require(_0x74b1('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x74b1('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x74b1('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x74b1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x74b1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fdea2){return function(_0x7b3c36,_0x30d910,_0x379dcc){_0x7b3c36[_0x74b1('0x5')]({'attributes':['id'],'raw':!![]})[_0x74b1('0x6')](function(_0x191d2b){_0x7b3c36[_0x74b1('0x7')]('Users',_0x191d2b[_0x74b1('0x8')](function(_0x98bb33){return{'id':_0x98bb33['id']};}));return SmsMessage[_0x74b1('0x9')]({'where':{'SmsInteractionId':_0x7b3c36['id'],'direction':'in','read':![]},'raw':!![]});})[_0x74b1('0x6')](function(_0xc1952){_0x7b3c36['setDataValue'](_0x74b1('0xa'),_0xc1952[_0x74b1('0xb')]);SmsInteractionEvents['emit'](_0x4fdea2+':'+_0x7b3c36['id'],_0x7b3c36);SmsInteractionEvents[_0x74b1('0xc')](_0x4fdea2,_0x7b3c36);_0x379dcc(null);})[_0x74b1('0xd')](_0x379dcc(null));};}for(var e in events){if(events[_0x74b1('0xe')](e)){var event=events[e];SmsInteraction[_0x74b1('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x4137=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x3357df,_0x26b7d3){var _0x1ece50=function(_0x30e7ef){while(--_0x30e7ef){_0x3357df['push'](_0x3357df['shift']());}};_0x1ece50(++_0x26b7d3);}(_0x4137,0xf8));var _0x7413=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4137[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x7413('0x0'));var SmsInteraction=require(_0x7413('0x1'))['db'][_0x7413('0x2')];var SmsMessage=require(_0x7413('0x1'))['db'][_0x7413('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7413('0x4')](0x0);var events={'afterCreate':_0x7413('0x5'),'afterUpdate':_0x7413('0x6'),'afterDestroy':_0x7413('0x7')};function emitEvent(_0x3dc48a){return function(_0x451a96,_0x3bb181,_0x4fbade){_0x451a96[_0x7413('0x8')]({'attributes':['id'],'raw':!![]})[_0x7413('0x9')](function(_0x5b39ac){_0x451a96[_0x7413('0xa')]('Users',_0x5b39ac[_0x7413('0xb')](function(_0x120dc2){return{'id':_0x120dc2['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x451a96['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7413('0x9')](function(_0x2f4b54){_0x451a96['setDataValue'](_0x7413('0xc'),_0x2f4b54[_0x7413('0xd')]);SmsInteractionEvents[_0x7413('0xe')](_0x3dc48a+':'+_0x451a96['id'],_0x451a96);SmsInteractionEvents[_0x7413('0xe')](_0x3dc48a,_0x451a96);_0x4fbade(null);})[_0x7413('0xf')](_0x4fbade(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x7413('0x10')](e,emitEvent(event));}}module[_0x7413('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index b734124..63d4057 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 _0xa1e4=['closed','closedAt','format','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','SmsInteraction','sms_interactions'];(function(_0xfe0c0e,_0x2d2f8e){var _0x35ebd7=function(_0x3da763){while(--_0x3da763){_0xfe0c0e['push'](_0xfe0c0e['shift']());}};_0x35ebd7(++_0x2d2f8e);}(_0xa1e4,0x73));var _0x4a1e=function(_0x126121,_0x35e290){_0x126121=_0x126121-0x0;var _0x57d413=_0xa1e4[_0x126121];return _0x57d413;};'use strict';var _=require(_0x4a1e('0x0'));var util=require(_0x4a1e('0x1'));var logger=require(_0x4a1e('0x2'))(_0x4a1e('0x3'));var moment=require(_0x4a1e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a1e('0x5'));var rimraf=require(_0x4a1e('0x6'));var config=require(_0x4a1e('0x7'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x1583fa,_0x1b2a0e){return _0x1583fa[_0x4a1e('0x8')](_0x4a1e('0x9'),attributes,{'tableName':_0x4a1e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ef796,_0x457417,_0x14b3cb){if(_0x1ef796['changed'](_0x4a1e('0xb'))){_0x1ef796[_0x4a1e('0xc')]=moment()[_0x4a1e('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x14b3cb(null,_0x1ef796);}}});}; \ No newline at end of file +var _0x22a3=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','bluebird','request-promise','path','../../config/environment','exports','define','SmsInteraction','sms_interactions'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0x22a3,0x6e));var _0x322a=function(_0xb6a965,_0x5c5ace){_0xb6a965=_0xb6a965-0x0;var _0x51d37d=_0x22a3[_0xb6a965];return _0x51d37d;};'use strict';var _=require('lodash');var util=require(_0x322a('0x0'));var logger=require('../../config/logger')(_0x322a('0x1'));var moment=require('moment');var BPromise=require(_0x322a('0x2'));var rp=require(_0x322a('0x3'));var fs=require('fs');var path=require(_0x322a('0x4'));var rimraf=require('rimraf');var config=require(_0x322a('0x5'));var attributes=require('./smsInteraction.attributes');module[_0x322a('0x6')]=function(_0x56c43e,_0x2681eb){return _0x56c43e[_0x322a('0x7')](_0x322a('0x8'),attributes,{'tableName':_0x322a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47a048,_0x230001,_0x2df465){if(_0x47a048[_0x322a('0xa')](_0x322a('0xb'))){_0x47a048[_0x322a('0xc')]=moment()[_0x322a('0xd')](_0x322a('0xe'));}_0x2df465(null,_0x47a048);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a465eec..7440e5c 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 _0x662a=['redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','SmsInteraction','update','options','raw','where','attributes','UpdateSmsInteraction','debug','stringify','catch','AddTagsToSmsInteraction','find','addTags','body','omit','spread','AddTags','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52f294,_0x3bc787){var _0x33dc68=function(_0x511c47){while(--_0x511c47){_0x52f294['push'](_0x52f294['shift']());}};_0x33dc68(++_0x3bc787);}(_0x662a,0x137));var _0xa662=function(_0x5e65e3,_0x270f92){_0x5e65e3=_0x5e65e3-0x0;var _0x47a5a8=_0x662a[_0x5e65e3];return _0x47a5a8;};'use strict';var _=require('lodash');var util=require(_0xa662('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa662('0x1'));var fs=require('fs');var Redis=require(_0xa662('0x2'));var db=require(_0xa662('0x3'))['db'];var utils=require(_0xa662('0x4'));var logger=require(_0xa662('0x5'))(_0xa662('0x6'));var config=require(_0xa662('0x7'));var jayson=require(_0xa662('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xa662('0x9')]=_[_0xa662('0xa')](config[_0xa662('0x9')],{'host':_0xa662('0xb'),'port':0x18eb});var socket=require(_0xa662('0xc'))(new Redis(config[_0xa662('0x9')]));require(_0xa662('0xd'))[_0xa662('0xe')](socket);function respondWithRpcPromise(_0x4a39d8,_0x195980,_0x5adaff){return new BPromise(function(_0x54f3e4,_0x4ce64a){return client[_0xa662('0xf')](_0x4a39d8,_0x5adaff)[_0xa662('0x10')](function(_0x32a590){logger[_0xa662('0x11')](_0xa662('0x12'),_0x195980,_0xa662('0x13'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x195980,_0xa662('0x13'),JSON['stringify'](_0x32a590));if(_0x32a590[_0xa662('0x14')]){if(_0x32a590[_0xa662('0x14')][_0xa662('0x15')]===0x1f4){logger[_0xa662('0x14')](_0xa662('0x12'),_0x195980,_0x32a590['error'][_0xa662('0x16')]);return _0x4ce64a(_0x32a590['error'][_0xa662('0x16')]);}logger[_0xa662('0x14')](_0xa662('0x12'),_0x195980,_0x32a590[_0xa662('0x14')][_0xa662('0x16')]);return _0x54f3e4(_0x32a590[_0xa662('0x14')]['message']);}else{logger[_0xa662('0x11')](_0xa662('0x12'),_0x195980,_0xa662('0x13'));_0x54f3e4(_0x32a590['result'][_0xa662('0x16')]);}})['catch'](function(_0xb52a48){logger['error'](_0xa662('0x12'),_0x195980,_0xb52a48);_0x4ce64a(_0xb52a48);});});}exports['UpdateSmsInteraction']=function(_0x8ee426){var _0x9e86a5=this;return new Promise(function(_0x33f9ce,_0x3c2919){return db[_0xa662('0x17')][_0xa662('0x18')](_0x8ee426['body'],{'raw':_0x8ee426['options']?_0x8ee426[_0xa662('0x19')][_0xa662('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ee426[_0xa662('0x19')]?_0x8ee426[_0xa662('0x19')][_0xa662('0x1b')]||null:null,'attributes':_0x8ee426[_0xa662('0x19')]?_0x8ee426[_0xa662('0x19')][_0xa662('0x1c')]||null:null,'limit':_0x8ee426[_0xa662('0x19')]?_0x8ee426[_0xa662('0x19')]['limit']||null:null})[_0xa662('0x10')](function(_0x4d5599){logger['info'](_0xa662('0x1d'),_0x8ee426);logger[_0xa662('0x1e')](_0xa662('0x1d'),_0x8ee426,JSON[_0xa662('0x1f')](_0x4d5599));_0x33f9ce(_0x4d5599);})[_0xa662('0x20')](function(_0x2a8d72){logger['error'](_0xa662('0x1d'),_0x2a8d72[_0xa662('0x16')],_0x8ee426);_0x3c2919(_0x9e86a5[_0xa662('0x14')](0x1f4,_0x2a8d72['message']));});});};exports[_0xa662('0x21')]=function(_0x57cb6b){return new Promise(function(_0x574cb1,_0x1aeea4){return db[_0xa662('0x17')][_0xa662('0x22')]({'where':_0x57cb6b[_0xa662('0x19')]?_0x57cb6b[_0xa662('0x19')]['where']||null:null})[_0xa662('0x10')](function(_0x38b231){if(_0x38b231){return _0x38b231[_0xa662('0x23')](_0x57cb6b[_0xa662('0x24')]['ids'],_[_0xa662('0x25')](_0x57cb6b[_0xa662('0x24')],['ids','id'])||{});}})[_0xa662('0x26')](function(_0x477026){logger['info']('AddTags',_0x57cb6b);logger['debug']('AddTags',_0x57cb6b,JSON[_0xa662('0x1f')](_0x477026));_0x574cb1(_0x477026);})['catch'](function(_0x3c9441){logger[_0xa662('0x14')](_0xa662('0x27'),_0x3c9441[_0xa662('0x16')],_0x57cb6b);_0x1aeea4(_this[_0xa662('0x14')](0x1f4,_0x3c9441[_0xa662('0x16')]));});});}; \ No newline at end of file +var _0xfb4c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','SmsInteraction','update','options','raw','where','attributes','limit','debug','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','body','spread','AddTags','lodash','util','bluebird','randomstring'];(function(_0x639430,_0x3c1d15){var _0x282adb=function(_0x115d59){while(--_0x115d59){_0x639430['push'](_0x639430['shift']());}};_0x282adb(++_0x3c1d15);}(_0xfb4c,0xf8));var _0xcfb4=function(_0x45793d,_0x27c175){_0x45793d=_0x45793d-0x0;var _0x569f4d=_0xfb4c[_0x45793d];return _0x569f4d;};'use strict';var _=require(_0xcfb4('0x0'));var util=require(_0xcfb4('0x1'));var moment=require('moment');var BPromise=require(_0xcfb4('0x2'));var rs=require(_0xcfb4('0x3'));var fs=require('fs');var Redis=require(_0xcfb4('0x4'));var db=require(_0xcfb4('0x5'))['db'];var utils=require(_0xcfb4('0x6'));var logger=require(_0xcfb4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcfb4('0x8'));var client=jayson['client'][_0xcfb4('0x9')]({'port':0x232a});config[_0xcfb4('0xa')]=_[_0xcfb4('0xb')](config['redis'],{'host':_0xcfb4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfb4('0xa')]));require(_0xcfb4('0xd'))[_0xcfb4('0xe')](socket);function respondWithRpcPromise(_0x493050,_0x209b4f,_0xb2bf1d){return new BPromise(function(_0x31fb86,_0x471846){return client[_0xcfb4('0xf')](_0x493050,_0xb2bf1d)[_0xcfb4('0x10')](function(_0x211436){logger['info'](_0xcfb4('0x11'),_0x209b4f,_0xcfb4('0x12'));logger['debug'](_0xcfb4('0x13'),_0x209b4f,'request\x20sent',JSON[_0xcfb4('0x14')](_0x211436));if(_0x211436[_0xcfb4('0x15')]){if(_0x211436[_0xcfb4('0x15')][_0xcfb4('0x16')]===0x1f4){logger['error'](_0xcfb4('0x11'),_0x209b4f,_0x211436[_0xcfb4('0x15')]['message']);return _0x471846(_0x211436['error'][_0xcfb4('0x17')]);}logger[_0xcfb4('0x15')](_0xcfb4('0x11'),_0x209b4f,_0x211436[_0xcfb4('0x15')][_0xcfb4('0x17')]);return _0x31fb86(_0x211436[_0xcfb4('0x15')]['message']);}else{logger[_0xcfb4('0x18')](_0xcfb4('0x11'),_0x209b4f,_0xcfb4('0x12'));_0x31fb86(_0x211436['result'][_0xcfb4('0x17')]);}})[_0xcfb4('0x19')](function(_0x5f9335){logger['error'](_0xcfb4('0x11'),_0x209b4f,_0x5f9335);_0x471846(_0x5f9335);});});}exports['UpdateSmsInteraction']=function(_0x1de11d){var _0x1ce63c=this;return new Promise(function(_0x20fe9f,_0x4cf6a0){return db[_0xcfb4('0x1a')][_0xcfb4('0x1b')](_0x1de11d['body'],{'raw':_0x1de11d[_0xcfb4('0x1c')]?_0x1de11d[_0xcfb4('0x1c')][_0xcfb4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1de11d['options']?_0x1de11d['options'][_0xcfb4('0x1e')]||null:null,'attributes':_0x1de11d[_0xcfb4('0x1c')]?_0x1de11d[_0xcfb4('0x1c')][_0xcfb4('0x1f')]||null:null,'limit':_0x1de11d[_0xcfb4('0x1c')]?_0x1de11d['options'][_0xcfb4('0x20')]||null:null})['then'](function(_0x161633){logger[_0xcfb4('0x18')]('UpdateSmsInteraction',_0x1de11d);logger[_0xcfb4('0x21')](_0xcfb4('0x22'),_0x1de11d,JSON[_0xcfb4('0x14')](_0x161633));_0x20fe9f(_0x161633);})[_0xcfb4('0x19')](function(_0x491893){logger[_0xcfb4('0x15')](_0xcfb4('0x22'),_0x491893[_0xcfb4('0x17')],_0x1de11d);_0x4cf6a0(_0x1ce63c[_0xcfb4('0x15')](0x1f4,_0x491893[_0xcfb4('0x17')]));});});};exports[_0xcfb4('0x23')]=function(_0x1a96f0){return new Promise(function(_0x465151,_0x1307fa){return db[_0xcfb4('0x1a')][_0xcfb4('0x24')]({'where':_0x1a96f0[_0xcfb4('0x1c')]?_0x1a96f0['options'][_0xcfb4('0x1e')]||null:null})[_0xcfb4('0x10')](function(_0x379a8a){if(_0x379a8a){return _0x379a8a[_0xcfb4('0x25')](_0x1a96f0['body'][_0xcfb4('0x26')],_['omit'](_0x1a96f0[_0xcfb4('0x27')],[_0xcfb4('0x26'),'id'])||{});}})[_0xcfb4('0x28')](function(_0x36c825){logger['info'](_0xcfb4('0x29'),_0x1a96f0);logger[_0xcfb4('0x21')](_0xcfb4('0x29'),_0x1a96f0,JSON['stringify'](_0x36c825));_0x465151(_0x36c825);})['catch'](function(_0x35c77d){logger[_0xcfb4('0x15')](_0xcfb4('0x29'),_0x35c77d['message'],_0x1a96f0);_0x1307fa(_this['error'](0x1f4,_0x35c77d[_0xcfb4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 252eead..8affee4 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 _0xb088=['removeListener','register','length','./smsInteraction.events','save','remove','emit'];(function(_0x4e2f1,_0x2b5c4f){var _0x2da541=function(_0x31d545){while(--_0x31d545){_0x4e2f1['push'](_0x4e2f1['shift']());}};_0x2da541(++_0x2b5c4f);}(_0xb088,0xb9));var _0x8b08=function(_0x5a2bc5,_0x4866d2){_0x5a2bc5=_0x5a2bc5-0x0;var _0x1b9a47=_0xb088[_0x5a2bc5];return _0x1b9a47;};'use strict';var SmsInteractionEvents=require(_0x8b08('0x0'));var events=[_0x8b08('0x1'),_0x8b08('0x2'),'update'];function createListener(_0xdbe997,_0x28a60e){return function(_0x56f8f4){_0x28a60e[_0x8b08('0x3')](_0xdbe997,_0x56f8f4);};}function removeListener(_0x50c130,_0x4bb957){return function(){SmsInteractionEvents[_0x8b08('0x4')](_0x50c130,_0x4bb957);};}exports[_0x8b08('0x5')]=function(_0x30289a){for(var _0x397d59=0x0,_0x17f85a=events[_0x8b08('0x6')];_0x397d59<_0x17f85a;_0x397d59++){var _0x3d4386=events[_0x397d59];var _0x1cab2b=createListener('smsInteraction:'+_0x3d4386,_0x30289a);SmsInteractionEvents['on'](_0x3d4386,_0x1cab2b);}}; \ No newline at end of file +var _0xbd09=['smsInteraction:','./smsInteraction.events','remove','emit','register','length'];(function(_0x2139fc,_0x5acac0){var _0x15ad19=function(_0x2a396e){while(--_0x2a396e){_0x2139fc['push'](_0x2139fc['shift']());}};_0x15ad19(++_0x5acac0);}(_0xbd09,0x10f));var _0x9bd0=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xbd09[_0x31e29a];return _0x32d892;};'use strict';var SmsInteractionEvents=require(_0x9bd0('0x0'));var events=['save',_0x9bd0('0x1'),'update'];function createListener(_0x3365ab,_0x3b9b20){return function(_0x39b7a8){_0x3b9b20[_0x9bd0('0x2')](_0x3365ab,_0x39b7a8);};}function removeListener(_0x58bf1b,_0x4aef4e){return function(){SmsInteractionEvents['removeListener'](_0x58bf1b,_0x4aef4e);};}exports[_0x9bd0('0x3')]=function(_0x5c14fa){for(var _0x4f6ac9=0x0,_0x128b1d=events[_0x9bd0('0x4')];_0x4f6ac9<_0x128b1d;_0x4f6ac9++){var _0x1259e3=events[_0x4f6ac9];var _0x3b3de6=createListener(_0x9bd0('0x5')+_0x1259e3,_0x5c14fa);SmsInteractionEvents['on'](_0x1259e3,_0x3b3de6);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 0e48215..6497a57 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 _0x1936=['exports','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','describe','get','show','post','smsmessage:create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1936,0x1e1));var _0x6193=function(_0x9842b2,_0x1b94f0){_0x9842b2=_0x9842b2-0x0;var _0x53389c=_0x1936[_0x9842b2];return _0x53389c;};'use strict';var multer=require('multer');var util=require(_0x6193('0x0'));var path=require('path');var timeout=require(_0x6193('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6193('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x6193('0x3'));var config=require(_0x6193('0x4'));var controller=require(_0x6193('0x5'));router['get']('/',auth[_0x6193('0x6')](),controller['index']);router['get']('/describe',auth[_0x6193('0x6')](),controller[_0x6193('0x7')]);router[_0x6193('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6193('0x9')]);router[_0x6193('0xa')]('/',auth[_0x6193('0x6')](),interaction['tracked']('sms',_0x6193('0xb')),controller['create']);router[_0x6193('0xa')](_0x6193('0xc'),controller[_0x6193('0xd')]);router[_0x6193('0xe')]('/:id',auth[_0x6193('0x6')](),controller[_0x6193('0xf')]);router[_0x6193('0xe')](_0x6193('0x10'),auth[_0x6193('0x6')](),controller[_0x6193('0x11')]);router[_0x6193('0xe')](_0x6193('0x12'),auth[_0x6193('0x6')](),controller[_0x6193('0x13')]);router[_0x6193('0x14')](_0x6193('0x15'),auth['isAuthenticated'](),controller[_0x6193('0x16')]);module[_0x6193('0x17')]=router; \ No newline at end of file +var _0x9245=['reject','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','smsmessage:create','post','/:id/status','put','update','/:id/accept','accept','/:id/reject'];(function(_0x5e2cb4,_0x592c64){var _0x282902=function(_0x1c1836){while(--_0x1c1836){_0x5e2cb4['push'](_0x5e2cb4['shift']());}};_0x282902(++_0x592c64);}(_0x9245,0x99));var _0x5924=function(_0x36cb69,_0x14878f){_0x36cb69=_0x36cb69-0x0;var _0x84e43d=_0x9245[_0x36cb69];return _0x84e43d;};'use strict';var multer=require(_0x5924('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5924('0x1'));var express=require(_0x5924('0x2'));var router=express[_0x5924('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5924('0x4'));var interaction=require(_0x5924('0x5'));var config=require('../../config/environment');var controller=require(_0x5924('0x6'));router[_0x5924('0x7')]('/',auth[_0x5924('0x8')](),controller[_0x5924('0x9')]);router['get'](_0x5924('0xa'),auth['isAuthenticated'](),controller[_0x5924('0xb')]);router[_0x5924('0x7')](_0x5924('0xc'),auth[_0x5924('0x8')](),controller[_0x5924('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('sms',_0x5924('0xe')),controller['create']);router[_0x5924('0xf')](_0x5924('0x10'),controller['status']);router[_0x5924('0x11')](_0x5924('0xc'),auth[_0x5924('0x8')](),controller[_0x5924('0x12')]);router['put'](_0x5924('0x13'),auth['isAuthenticated'](),controller[_0x5924('0x14')]);router['put'](_0x5924('0x15'),auth[_0x5924('0x8')](),controller[_0x5924('0x16')]);router[_0x5924('0x17')](_0x5924('0xc'),auth['isAuthenticated'](),controller[_0x5924('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 74f7742..e5771e2 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 _0x1c55=['ENUM','out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0x1c55,0x1e3));var _0x51c5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1c55[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x51c5('0x0'));module[_0x51c5('0x1')]={'body':{'type':Sequelize[_0x51c5('0x2')](_0x51c5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x51c5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x51c5('0x5')]('in',_0x51c5('0x6')),'defaultValue':_0x51c5('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x51c5('0x7')](0xbe)},'phone':{'type':Sequelize[_0x51c5('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x51c5('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x51c5('0x7')]},'providerResponse':{'type':Sequelize[_0x51c5('0x2')]}}; \ No newline at end of file +var _0x2fa9=['exports','BOOLEAN','ENUM','out','STRING','TEXT','sequelize'];(function(_0x4fd288,_0x3ed14c){var _0x5b9b5b=function(_0x8bb98f){while(--_0x8bb98f){_0x4fd288['push'](_0x4fd288['shift']());}};_0x5b9b5b(++_0x3ed14c);}(_0x2fa9,0x1e9));var _0x92fa=function(_0x5e41d1,_0x626fa8){_0x5e41d1=_0x5e41d1-0x0;var _0x2ad97b=_0x2fa9[_0x5e41d1];return _0x2ad97b;};'use strict';var Sequelize=require(_0x92fa('0x0'));module[_0x92fa('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x92fa('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x92fa('0x3')]('in',_0x92fa('0x4')),'defaultValue':_0x92fa('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x92fa('0x5')](0xbe)},'phone':{'type':Sequelize[_0x92fa('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x92fa('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x92fa('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 06c12b1..4546c54 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 _0xdbb1=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsMessage.socket','jayson/promise','client','http','request','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','map','SmsMessage','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','options','include','rows','show','params','rawAttributes','includeAll','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','SmsInteraction','SmsInteractionId','isNil','interaction','get','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','contact','email','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','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','api'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xdbb1,0x7f));var _0x1dbb=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xdbb1[_0x2aecb2];return _0x3ebb80;};'use strict';var emlformat=require(_0x1dbb('0x0'));var rimraf=require(_0x1dbb('0x1'));var zipdir=require(_0x1dbb('0x2'));var jsonpatch=require(_0x1dbb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1dbb('0x4'));var Mustache=require('mustache');var util=require(_0x1dbb('0x5'));var path=require(_0x1dbb('0x6'));var sox=require(_0x1dbb('0x7'));var csv=require(_0x1dbb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1dbb('0x9'));var _=require(_0x1dbb('0xa'));var squel=require(_0x1dbb('0xb'));var crypto=require(_0x1dbb('0xc'));var jsforce=require(_0x1dbb('0xd'));var deskjs=require(_0x1dbb('0xe'));var toCsv=require(_0x1dbb('0x8'));var querystring=require(_0x1dbb('0xf'));var Papa=require(_0x1dbb('0x10'));var Redis=require(_0x1dbb('0x11'));var authService=require(_0x1dbb('0x12'));var qs=require(_0x1dbb('0x13'));var as=require(_0x1dbb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1dbb('0x15'));var utils=require(_0x1dbb('0x16'));var config=require(_0x1dbb('0x17'));var licenseUtil=require(_0x1dbb('0x18'));var db=require(_0x1dbb('0x19'))['db'];config['redis']=_[_0x1dbb('0x1a')](config[_0x1dbb('0x1b')],{'host':_0x1dbb('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1dbb('0x1b')]));require(_0x1dbb('0x1d'))['register'](socket);var jayson=require(_0x1dbb('0x1e'));var client=jayson[_0x1dbb('0x1f')][_0x1dbb('0x20')]({'port':0x232c});var client9002=jayson[_0x1dbb('0x1f')][_0x1dbb('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1db7bd,_0x3eea9b,_0x5089d9,_0xaad197){return new BPromise(function(_0x21389f,_0x529c98){var _0x57fbcb=_0xaad197||client;return _0x57fbcb[_0x1dbb('0x21')](_0x1db7bd,_0x5089d9)['then'](function(_0x173123){logger['info']('SmsMessage,\x20%s,\x20%s',_0x3eea9b,_0x1dbb('0x22'));logger[_0x1dbb('0x23')](_0x1dbb('0x24'),_0x3eea9b,_0x1dbb('0x22'),JSON[_0x1dbb('0x25')](_0x173123));if(_0x173123[_0x1dbb('0x26')]){if(_0x173123[_0x1dbb('0x26')]['code']===0x1f4){logger['error'](_0x1dbb('0x27'),_0x3eea9b,_0x173123['error'][_0x1dbb('0x28')]);return _0x529c98(_0x173123['error'][_0x1dbb('0x28')]);}logger[_0x1dbb('0x26')](_0x1dbb('0x27'),_0x3eea9b,_0x173123['error'][_0x1dbb('0x28')]);return _0x21389f(_0x173123[_0x1dbb('0x26')]['message']);}else{logger['info'](_0x1dbb('0x27'),_0x3eea9b,_0x1dbb('0x22'));_0x21389f(_0x173123['result'][_0x1dbb('0x28')]);}})[_0x1dbb('0x29')](function(_0x3499da){logger['error'](_0x1dbb('0x27'),_0x3eea9b,_0x3499da);_0x529c98(_0x3499da);});});}function respondWithStatusCode(_0x4c1762,_0x4f0bd2){_0x4f0bd2=_0x4f0bd2||0xcc;return function(_0x1d5597){if(_0x1d5597){return _0x4c1762[_0x1dbb('0x2a')](_0x4f0bd2);}return _0x4c1762[_0x1dbb('0x2b')](_0x4f0bd2)[_0x1dbb('0x2c')]();};}function respondWithResult(_0x2c097e,_0x55479d){_0x55479d=_0x55479d||0xc8;return function(_0x4105e4){if(_0x4105e4){return _0x2c097e[_0x1dbb('0x2b')](_0x55479d)['json'](_0x4105e4);}};}function respondWithFilteredResult(_0x561dc5,_0x50f549){return function(_0x417a26){if(_0x417a26){var _0x5a9453=typeof _0x50f549[_0x1dbb('0x2d')]===_0x1dbb('0x2e')&&typeof _0x50f549['limit']===_0x1dbb('0x2e');var _0x1c838c=_0x417a26[_0x1dbb('0x2f')];var _0x22e7c4=_0x5a9453?0x0:_0x50f549[_0x1dbb('0x2d')];var _0x4b94bd=_0x5a9453?_0x417a26[_0x1dbb('0x2f')]:_0x50f549[_0x1dbb('0x2d')]+_0x50f549[_0x1dbb('0x30')];var _0xc26727;if(_0x4b94bd>=_0x1c838c){_0x4b94bd=_0x1c838c;_0xc26727=0xc8;}else{_0xc26727=0xce;}_0x561dc5[_0x1dbb('0x2b')](_0xc26727);return _0x561dc5['set'](_0x1dbb('0x31'),_0x22e7c4+'-'+_0x4b94bd+'/'+_0x1c838c)[_0x1dbb('0x32')](_0x417a26);}return null;};}function patchUpdates(_0xc14cc2){return function(_0x127676){try{jsonpatch[_0x1dbb('0x33')](_0x127676,_0xc14cc2,!![]);}catch(_0x39ae61){return BPromise[_0x1dbb('0x34')](_0x39ae61);}return _0x127676[_0x1dbb('0x35')]();};}function saveUpdates(_0x584570,_0x15d220){return function(_0x36b075){if(_0x36b075){return _0x36b075[_0x1dbb('0x36')](_0x584570)[_0x1dbb('0x37')](function(_0x43629a){return _0x43629a;});}return null;};}function removeEntity(_0x479815,_0x52033e){return function(_0x26c854){if(_0x26c854){return _0x26c854[_0x1dbb('0x38')]()[_0x1dbb('0x37')](function(){_0x479815[_0x1dbb('0x2b')](0xcc)[_0x1dbb('0x2c')]();});}};}function handleEntityNotFound(_0x5228ac,_0x42f5f4){return function(_0xd1ffdc){if(!_0xd1ffdc){_0x5228ac[_0x1dbb('0x2a')](0x194);}return _0xd1ffdc;};}function handleError(_0x24670a,_0x572aec){_0x572aec=_0x572aec||0x1f4;return function(_0x48b13){logger[_0x1dbb('0x26')](_0x48b13['stack']);if(_0x48b13[_0x1dbb('0x39')]){delete _0x48b13[_0x1dbb('0x39')];}_0x24670a[_0x1dbb('0x2b')](_0x572aec)[_0x1dbb('0x3a')](_0x48b13);};}exports[_0x1dbb('0x3b')]=function(_0x47be81,_0x56358b){var _0xce7e61={},_0x153ae6={},_0x36a749={'count':0x0,'rows':[]};var _0x37d48d=_[_0x1dbb('0x3c')](db[_0x1dbb('0x3d')]['rawAttributes'],function(_0x39272a){return{'name':_0x39272a[_0x1dbb('0x3e')],'type':_0x39272a[_0x1dbb('0x3f')][_0x1dbb('0x40')]};});_0x153ae6[_0x1dbb('0x41')]=_[_0x1dbb('0x3c')](_0x37d48d,_0x1dbb('0x39'));_0x153ae6[_0x1dbb('0x42')]=_[_0x1dbb('0x43')](_0x47be81['query']);_0x153ae6['filters']=_[_0x1dbb('0x44')](_0x153ae6['model'],_0x153ae6[_0x1dbb('0x42')]);_0xce7e61['attributes']=_['intersection'](_0x153ae6[_0x1dbb('0x41')],qs[_0x1dbb('0x45')](_0x47be81['query'][_0x1dbb('0x45')]));_0xce7e61[_0x1dbb('0x46')]=_0xce7e61[_0x1dbb('0x46')][_0x1dbb('0x47')]?_0xce7e61[_0x1dbb('0x46')]:_0x153ae6['model'];if(!_0x47be81[_0x1dbb('0x42')]['hasOwnProperty'](_0x1dbb('0x48'))){_0xce7e61[_0x1dbb('0x30')]=qs[_0x1dbb('0x30')](_0x47be81[_0x1dbb('0x42')][_0x1dbb('0x30')]);_0xce7e61['offset']=qs[_0x1dbb('0x2d')](_0x47be81[_0x1dbb('0x42')][_0x1dbb('0x2d')]);}_0xce7e61[_0x1dbb('0x49')]=qs[_0x1dbb('0x4a')](_0x47be81[_0x1dbb('0x42')][_0x1dbb('0x4a')]);_0xce7e61[_0x1dbb('0x4b')]=qs['filters'](_['pick'](_0x47be81[_0x1dbb('0x42')],_0x153ae6[_0x1dbb('0x4c')]),_0x37d48d);if(_0x47be81['query'][_0x1dbb('0x4d')]){_0xce7e61[_0x1dbb('0x4b')]=_[_0x1dbb('0x4e')](_0xce7e61['where'],{'$or':_[_0x1dbb('0x3c')](_0x37d48d,function(_0xf74076){if(_0xf74076[_0x1dbb('0x3f')]!=='VIRTUAL'){var _0x16b39b={};_0x16b39b[_0xf74076['name']]={'$like':'%'+_0x47be81[_0x1dbb('0x42')][_0x1dbb('0x4d')]+'%'};return _0x16b39b;}})});}_0xce7e61=_[_0x1dbb('0x4e')]({},_0xce7e61,_0x47be81[_0x1dbb('0x4f')]);var _0x5ef48b={'where':_0xce7e61[_0x1dbb('0x4b')]};return db['SmsMessage'][_0x1dbb('0x2f')](_0x5ef48b)[_0x1dbb('0x37')](function(_0x158b73){_0x36a749[_0x1dbb('0x2f')]=_0x158b73;if(_0x47be81[_0x1dbb('0x42')]['includeAll']){_0xce7e61[_0x1dbb('0x50')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0xce7e61);})['then'](function(_0x2878d4){_0x36a749[_0x1dbb('0x51')]=_0x2878d4;return _0x36a749;})['then'](respondWithFilteredResult(_0x56358b,_0xce7e61))[_0x1dbb('0x29')](handleError(_0x56358b,null));};exports[_0x1dbb('0x52')]=function(_0x5c6ebc,_0xb55b43){var _0x40d956={'raw':!![],'where':{'id':_0x5c6ebc[_0x1dbb('0x53')]['id']}},_0x2ba9c3={};_0x2ba9c3[_0x1dbb('0x41')]=_[_0x1dbb('0x43')](db['SmsMessage'][_0x1dbb('0x54')]);_0x2ba9c3[_0x1dbb('0x42')]=_['keys'](_0x5c6ebc[_0x1dbb('0x42')]);_0x2ba9c3[_0x1dbb('0x4c')]=_[_0x1dbb('0x44')](_0x2ba9c3[_0x1dbb('0x41')],_0x2ba9c3[_0x1dbb('0x42')]);_0x40d956[_0x1dbb('0x46')]=_[_0x1dbb('0x44')](_0x2ba9c3[_0x1dbb('0x41')],qs[_0x1dbb('0x45')](_0x5c6ebc[_0x1dbb('0x42')][_0x1dbb('0x45')]));_0x40d956['attributes']=_0x40d956[_0x1dbb('0x46')]['length']?_0x40d956['attributes']:_0x2ba9c3[_0x1dbb('0x41')];if(_0x5c6ebc[_0x1dbb('0x42')][_0x1dbb('0x55')]){_0x40d956[_0x1dbb('0x50')]=[{'all':!![]}];}_0x40d956=_[_0x1dbb('0x4e')]({},_0x40d956,_0x5c6ebc[_0x1dbb('0x4f')]);return db[_0x1dbb('0x3d')][_0x1dbb('0x56')](_0x40d956)[_0x1dbb('0x37')](handleEntityNotFound(_0xb55b43,null))[_0x1dbb('0x37')](respondWithResult(_0xb55b43,null))['catch'](handleError(_0xb55b43,null));};exports[_0x1dbb('0x57')]=function(_0xa8985c,_0x369c0c){return db[_0x1dbb('0x3d')][_0x1dbb('0x57')](_0xa8985c[_0x1dbb('0x58')],{})[_0x1dbb('0x37')](respondWithResult(_0x369c0c,0xc9))[_0x1dbb('0x29')](handleError(_0x369c0c,null));};exports[_0x1dbb('0x36')]=function(_0x5bb0c8,_0x2a5c27){if(_0x5bb0c8[_0x1dbb('0x58')]['id']){delete _0x5bb0c8['body']['id'];}return db[_0x1dbb('0x3d')][_0x1dbb('0x56')]({'where':{'id':_0x5bb0c8['params']['id']}})[_0x1dbb('0x37')](handleEntityNotFound(_0x2a5c27,null))[_0x1dbb('0x37')](saveUpdates(_0x5bb0c8['body'],null))[_0x1dbb('0x37')](respondWithResult(_0x2a5c27,null))[_0x1dbb('0x29')](handleError(_0x2a5c27,null));};exports['destroy']=function(_0x350d70,_0x53ac7e){return db['SmsMessage'][_0x1dbb('0x56')]({'where':{'id':_0x350d70[_0x1dbb('0x53')]['id']}})[_0x1dbb('0x37')](handleEntityNotFound(_0x53ac7e,null))[_0x1dbb('0x37')](removeEntity(_0x53ac7e,null))[_0x1dbb('0x29')](handleError(_0x53ac7e,null));};exports[_0x1dbb('0x59')]=function(_0x4f9072,_0x10a1ba){return db['SmsMessage'][_0x1dbb('0x59')]()[_0x1dbb('0x37')](respondWithResult(_0x10a1ba,null))['catch'](handleError(_0x10a1ba,null));};var interaction_log=require(_0x1dbb('0x5a'))(_0x1dbb('0x5b'));exports[_0x1dbb('0x5c')]=function(_0xe97607,_0x42204d,_0x44a386){var _0x1e8303={'agent':{},'channel':_0x1dbb('0x5d')};if(_0xe97607[_0x1dbb('0x58')]['id']){delete _0xe97607['body']['id'];}_0xe97607['body'][_0x1dbb('0x5e')]=!![];_0xe97607[_0x1dbb('0x58')][_0x1dbb('0x5f')]=moment()[_0x1dbb('0x60')](_0x1dbb('0x61'));_0xe97607[_0x1dbb('0x58')][_0x1dbb('0x62')]=_0xe97607[_0x1dbb('0x58')][_0x1dbb('0x62')]||_0xe97607[_0x1dbb('0x63')]['id'];_0x1e8303['agent']['id']=_0xe97607['body']['UserId'];return db[_0x1dbb('0x3d')][_0x1dbb('0x56')]({'where':{'id':_0xe97607[_0x1dbb('0x53')]['id'],'UserId':null}})[_0x1dbb('0x37')](handleEntityNotFound(_0x42204d,null))[_0x1dbb('0x37')](saveUpdates(_0xe97607[_0x1dbb('0x58')],null))[_0x1dbb('0x37')](function(_0x4cd380){if(_0x4cd380){_0x1e8303[_0x1dbb('0x28')]=_0x4cd380['get']({'plain':!![]});return db[_0x1dbb('0x64')][_0x1dbb('0x56')]({'where':{'id':_0x4cd380[_0x1dbb('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x42204d,null))[_0x1dbb('0x37')](function(_0x439057){if(_0x439057){return _0x439057[_0x1dbb('0x36')]({'UserId':_0xe97607[_0x1dbb('0x58')][_0x1dbb('0x62')],'read1stAt':_[_0x1dbb('0x66')](_0x439057['read1stAt'])?moment()[_0x1dbb('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x9a0346){if(_0x9a0346){_0x1e8303[_0x1dbb('0x67')]=_0x9a0346[_0x1dbb('0x68')]({'plain':!![]});interaction_log[_0x1dbb('0x69')](_0x1dbb('0x6a'),_0xe97607[_0x1dbb('0x63')]['id'],_0xe97607['user'][_0x1dbb('0x39')],_0xe97607[_0x1dbb('0x63')][_0x1dbb('0x6b')],_0x1e8303[_0x1dbb('0x67')]['id'],_0xe97607['body']?JSON['stringify'](_0xe97607[_0x1dbb('0x58')]):_0x1dbb('0x6c'));return respondWithRpcPromise(_0x1dbb('0x6d'),_0x1dbb('0x6e'),_0x1e8303);}return null;})[_0x1dbb('0x37')](function(_0x5d6518){var _0x360f37=_0x1dbb('0x6f')+_0x5d6518['message']['ContactId'];return db[_0x1dbb('0x70')][_0x1dbb('0x42')](_0x360f37,{'type':db[_0x1dbb('0x71')][_0x1dbb('0x72')][_0x1dbb('0x73')],'raw':!![]})[_0x1dbb('0x37')](function(_0x77d4d1){return _0x77d4d1;});})[_0x1dbb('0x37')](function(_0x13bd31){if(_0x13bd31){_0x1e8303['message']['contact']=_0x13bd31[0x0];if(!_0xe97607[_0x1dbb('0x58')][_0x1dbb('0x62')])return;return db[_0x1dbb('0x74')][_0x1dbb('0x56')]({'where':{'id':_0xe97607[_0x1dbb('0x58')][_0x1dbb('0x62')],'role':_0x1dbb('0x75')},'attributes':['id',_0x1dbb('0x39'),_0x1dbb('0x76'),'email',_0x1dbb('0x77')],'raw':!![]});}return null;})[_0x1dbb('0x37')](function(_0x1c879d){if(!_0x1c879d)return null;_0x1e8303[_0x1dbb('0x28')][_0x1dbb('0x75')]=_0x1c879d;return _0x1e8303;})[_0x1dbb('0x37')](function(_0x20f4a3){if(_0x20f4a3){if(_0xe97607[_0x1dbb('0x58')][_0x1dbb('0x78')]){_0x1e8303['message'][_0x1dbb('0x79')]=util['format'](_0x1dbb('0x7a'),_0xe97607['user']['name']);_0x1e8303['message']['channel']=_0x1e8303[_0x1dbb('0x7b')];_0x1e8303[_0x1dbb('0x28')][_0x1dbb('0x7c')]='accept';return respondWithRpcPromise('EventManager',_0x1dbb('0x7d'),{'event':_0x1dbb('0x7e'),'message':_0x1e8303[_0x1dbb('0x28')]},client9002)[_0x1dbb('0x37')](function(){return _0x1e8303;});}return _0x1e8303;}return null;})[_0x1dbb('0x37')](respondWithResult(_0x42204d,null))[_0x1dbb('0x29')](handleError(_0x42204d,null));};var interaction_log=require(_0x1dbb('0x5a'))(_0x1dbb('0x5b'));exports[_0x1dbb('0x34')]=function(_0x48dae0,_0x39c5dd,_0xbfa985){var _0x380bae={'agent':{},'channel':'sms'};if(_0x48dae0['body']['id']){delete _0x48dae0[_0x1dbb('0x58')]['id'];}_0x48dae0[_0x1dbb('0x58')][_0x1dbb('0x62')]=_0x48dae0['body'][_0x1dbb('0x62')]||_0x48dae0['user']['id'];_0x380bae[_0x1dbb('0x75')]['id']=_0x48dae0[_0x1dbb('0x58')][_0x1dbb('0x62')];return db[_0x1dbb('0x3d')]['find']({'where':{'id':_0x48dae0['params']['id'],'UserId':null}})[_0x1dbb('0x37')](handleEntityNotFound(_0x39c5dd,null))[_0x1dbb('0x37')](function(_0x5e60c5){if(_0x5e60c5){_0x380bae[_0x1dbb('0x28')]=_0x5e60c5[_0x1dbb('0x68')]({'plain':!![]});return db['SmsInteraction'][_0x1dbb('0x56')]({'where':{'id':_0x5e60c5[_0x1dbb('0x65')]}});}return null;})[_0x1dbb('0x37')](handleEntityNotFound(_0x39c5dd,null))['then'](function(_0x5ce42a){if(_0x5ce42a){_0x380bae['interaction']=_0x5ce42a['get']({'plain':!![]});interaction_log['info'](_0x1dbb('0x7f'),_0x48dae0['user']['id'],_0x48dae0['user']['name'],_0x48dae0[_0x1dbb('0x63')][_0x1dbb('0x6b')],_0x380bae[_0x1dbb('0x67')]['id'],_0x48dae0[_0x1dbb('0x58')]?JSON[_0x1dbb('0x25')](_0x48dae0[_0x1dbb('0x58')]):_0x1dbb('0x6c'));return respondWithRpcPromise('RejectMessage',_0x1dbb('0x80'),_0x380bae);}return null;})[_0x1dbb('0x37')](function(_0x155c8f){var _0x11fdf9=_0x1dbb('0x6f')+_0x155c8f[_0x1dbb('0x28')][_0x1dbb('0x81')];return db[_0x1dbb('0x70')][_0x1dbb('0x42')](_0x11fdf9,{'type':db[_0x1dbb('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0x1dbb('0x37')](function(_0x150627){return _0x150627;});})[_0x1dbb('0x37')](function(_0x451643){if(_0x451643){_0x380bae[_0x1dbb('0x28')][_0x1dbb('0x82')]=_0x451643[0x0];if(!_0x48dae0[_0x1dbb('0x58')][_0x1dbb('0x62')])return;return db[_0x1dbb('0x74')]['find']({'where':{'id':_0x48dae0['body']['UserId'],'role':_0x1dbb('0x75')},'attributes':['id','name',_0x1dbb('0x76'),_0x1dbb('0x83'),'internal'],'raw':!![]});}return null;})['then'](function(_0x49bb81){if(!_0x49bb81)return null;_0x380bae[_0x1dbb('0x28')][_0x1dbb('0x75')]=_0x49bb81;return _0x380bae;})[_0x1dbb('0x37')](function(_0x8b56b2){if(_0x8b56b2){_0x8b56b2['message']['interface']=util['format']('SIP/%s',_0x48dae0['user'][_0x1dbb('0x39')]);_0x8b56b2['message']['channel']=_0x380bae[_0x1dbb('0x7b')];_0x8b56b2[_0x1dbb('0x28')][_0x1dbb('0x7c')]=_0x1dbb('0x34');respondWithRpcPromise(_0x1dbb('0x7d'),_0x1dbb('0x7d'),{'event':_0x1dbb('0x84'),'message':_0x8b56b2['message']},client9002);return _0x380bae;}return null;})[_0x1dbb('0x37')](respondWithResult(_0x39c5dd,null))['catch'](handleError(_0x39c5dd,null));};exports[_0x1dbb('0x2b')]=function(_0x2d1e2f,_0x214dd2,_0x1927a3){if(_0x2d1e2f['body']['id']){delete _0x2d1e2f['body']['id'];}var _0x596c39;return db['SmsMessage'][_0x1dbb('0x56')]({'where':{'id':_0x2d1e2f[_0x1dbb('0x53')]['id']}})[_0x1dbb('0x37')](handleEntityNotFound(_0x214dd2,null))[_0x1dbb('0x37')](function(_0x1f6e77){if(_0x1f6e77){_0x596c39=_0x1f6e77;return db[_0x1dbb('0x85')][_0x1dbb('0x56')]({'where':{'id':_0x1f6e77[_0x1dbb('0x86')]}});}})[_0x1dbb('0x37')](handleEntityNotFound(_0x214dd2,null))[_0x1dbb('0x37')](function(_0x17c446){if(_0x17c446){logger['debug'](_0x1dbb('0x24'),'status','received\x20delivery\x20report\x20from',_0x17c446[_0x1dbb('0x3f')],util[_0x1dbb('0x87')](_0x2d1e2f[_0x1dbb('0x58')],{'showHidden':![],'depth':null}));switch(_0x17c446[_0x1dbb('0x3f')]){case _0x1dbb('0x88'):if(_0x2d1e2f['body'][_0x1dbb('0x89')]&&_0x2d1e2f[_0x1dbb('0x58')][_0x1dbb('0x89')]===_0x596c39[_0x1dbb('0x8a')]){return _0x596c39[_0x1dbb('0x36')]({'read':!![]});}else{logger['error'](_0x1dbb('0x8b'),'status','twilio',util['inspect'](_0x2d1e2f[_0x1dbb('0x58')],{'showHidden':![],'depth':null}));}break;case _0x1dbb('0x8c'):if(_0x2d1e2f['body'][_0x1dbb('0x8d')]&&_0x2d1e2f[_0x1dbb('0x58')][_0x1dbb('0x8d')]===_0x596c39[_0x1dbb('0x8a')]&&_[_0x1dbb('0x8e')]([_0x1dbb('0x8f'),_0x1dbb('0x90')],_0x2d1e2f[_0x1dbb('0x58')][_0x1dbb('0x91')])>=0x0){return _0x596c39[_0x1dbb('0x36')]({'read':!![]});}else{logger[_0x1dbb('0x26')](_0x1dbb('0x8b'),'status','plivio',util['inspect'](_0x2d1e2f['body'],{'showHidden':![],'depth':null}));}break;case _0x1dbb('0x92'):var _0x2facaa=_0x2d1e2f['body']['results'][0x0];if(_0x2facaa['status'][_0x1dbb('0x93')]===_0x1dbb('0x94')){return _0x596c39['update']({'read':!![]});}else{logger[_0x1dbb('0x26')](_0x1dbb('0x8b'),'status','infobip',util[_0x1dbb('0x87')](_0x2d1e2f[_0x1dbb('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x596c39;}})[_0x1dbb('0x37')](respondWithResult(_0x214dd2,null))[_0x1dbb('0x29')](handleError(_0x214dd2,null));}; \ No newline at end of file +var _0x6535=['../../mysqldb','redis','localhost','./smsMessage.socket','register','client','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','offset','undefined','limit','count','set','json','apply','reject','update','destroy','end','stack','name','index','SmsMessage','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','keys','options','find','create','body','catch','params','describe','sms-interactions','accept','read','readAt','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','format','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','rejectmessage','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2fc5e5,_0x30b410){var _0x48a119=function(_0xd7e872){while(--_0xd7e872){_0x2fc5e5['push'](_0x2fc5e5['shift']());}};_0x48a119(++_0x30b410);}(_0x6535,0x74));var _0x5653=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x6535[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0x5653('0x0'));var rimraf=require(_0x5653('0x1'));var zipdir=require(_0x5653('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5653('0x3'));var BPromise=require(_0x5653('0x4'));var Mustache=require(_0x5653('0x5'));var util=require(_0x5653('0x6'));var path=require(_0x5653('0x7'));var sox=require(_0x5653('0x8'));var csv=require(_0x5653('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5653('0xa'));var _=require(_0x5653('0xb'));var squel=require(_0x5653('0xc'));var crypto=require(_0x5653('0xd'));var jsforce=require(_0x5653('0xe'));var deskjs=require(_0x5653('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5653('0x10'));var Papa=require('papaparse');var Redis=require(_0x5653('0x11'));var authService=require(_0x5653('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5653('0x13'));var hardwareService=require(_0x5653('0x14'));var logger=require(_0x5653('0x15'))(_0x5653('0x16'));var utils=require(_0x5653('0x17'));var config=require(_0x5653('0x18'));var licenseUtil=require(_0x5653('0x19'));var db=require(_0x5653('0x1a'))['db'];config[_0x5653('0x1b')]=_['defaults'](config['redis'],{'host':_0x5653('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5653('0x1b')]));require(_0x5653('0x1d'))[_0x5653('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5653('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x5653('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x110c0b,_0x32be3e,_0x1f27a2,_0xc371fd){return new BPromise(function(_0x483adb,_0x2efcfd){var _0x1d3080=_0xc371fd||client;return _0x1d3080['request'](_0x110c0b,_0x1f27a2)[_0x5653('0x20')](function(_0x3c4be9){logger[_0x5653('0x21')](_0x5653('0x22'),_0x32be3e,_0x5653('0x23'));logger[_0x5653('0x24')](_0x5653('0x25'),_0x32be3e,_0x5653('0x23'),JSON[_0x5653('0x26')](_0x3c4be9));if(_0x3c4be9[_0x5653('0x27')]){if(_0x3c4be9['error'][_0x5653('0x28')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x32be3e,_0x3c4be9['error']['message']);return _0x2efcfd(_0x3c4be9['error'][_0x5653('0x29')]);}logger[_0x5653('0x27')]('SmsMessage,\x20%s,\x20%s',_0x32be3e,_0x3c4be9[_0x5653('0x27')]['message']);return _0x483adb(_0x3c4be9[_0x5653('0x27')][_0x5653('0x29')]);}else{logger[_0x5653('0x21')](_0x5653('0x22'),_0x32be3e,_0x5653('0x23'));_0x483adb(_0x3c4be9[_0x5653('0x2a')][_0x5653('0x29')]);}})['catch'](function(_0x4b31bd){logger['error'](_0x5653('0x22'),_0x32be3e,_0x4b31bd);_0x2efcfd(_0x4b31bd);});});}function respondWithStatusCode(_0x3904ff,_0x48b9ae){_0x48b9ae=_0x48b9ae||0xcc;return function(_0x2ac1bd){if(_0x2ac1bd){return _0x3904ff['sendStatus'](_0x48b9ae);}return _0x3904ff[_0x5653('0x2b')](_0x48b9ae)['end']();};}function respondWithResult(_0x2d3e30,_0x41e4b9){_0x41e4b9=_0x41e4b9||0xc8;return function(_0xb8576e){if(_0xb8576e){return _0x2d3e30[_0x5653('0x2b')](_0x41e4b9)['json'](_0xb8576e);}};}function respondWithFilteredResult(_0x1d170d,_0x213ccc){return function(_0xe2ba6c){if(_0xe2ba6c){var _0x41c58f=typeof _0x213ccc[_0x5653('0x2c')]===_0x5653('0x2d')&&typeof _0x213ccc[_0x5653('0x2e')]===_0x5653('0x2d');var _0x3d08b0=_0xe2ba6c[_0x5653('0x2f')];var _0x2883af=_0x41c58f?0x0:_0x213ccc[_0x5653('0x2c')];var _0x15d497=_0x41c58f?_0xe2ba6c[_0x5653('0x2f')]:_0x213ccc['offset']+_0x213ccc[_0x5653('0x2e')];var _0x18dbfc;if(_0x15d497>=_0x3d08b0){_0x15d497=_0x3d08b0;_0x18dbfc=0xc8;}else{_0x18dbfc=0xce;}_0x1d170d['status'](_0x18dbfc);return _0x1d170d[_0x5653('0x30')]('Content-Range',_0x2883af+'-'+_0x15d497+'/'+_0x3d08b0)[_0x5653('0x31')](_0xe2ba6c);}return null;};}function patchUpdates(_0x54ff03){return function(_0x33c05a){try{jsonpatch[_0x5653('0x32')](_0x33c05a,_0x54ff03,!![]);}catch(_0x3e7cfc){return BPromise[_0x5653('0x33')](_0x3e7cfc);}return _0x33c05a['save']();};}function saveUpdates(_0x45ac40,_0x1e5d43){return function(_0x4fd89e){if(_0x4fd89e){return _0x4fd89e[_0x5653('0x34')](_0x45ac40)[_0x5653('0x20')](function(_0x45b9ad){return _0x45b9ad;});}return null;};}function removeEntity(_0x3f0e55,_0x5d3fe6){return function(_0x403c70){if(_0x403c70){return _0x403c70[_0x5653('0x35')]()['then'](function(){_0x3f0e55[_0x5653('0x2b')](0xcc)[_0x5653('0x36')]();});}};}function handleEntityNotFound(_0x577dd8,_0x19a055){return function(_0x2dc7b8){if(!_0x2dc7b8){_0x577dd8['sendStatus'](0x194);}return _0x2dc7b8;};}function handleError(_0x45034f,_0x54d1aa){_0x54d1aa=_0x54d1aa||0x1f4;return function(_0x12c04c){logger[_0x5653('0x27')](_0x12c04c[_0x5653('0x37')]);if(_0x12c04c['name']){delete _0x12c04c[_0x5653('0x38')];}_0x45034f[_0x5653('0x2b')](_0x54d1aa)['send'](_0x12c04c);};}exports[_0x5653('0x39')]=function(_0x836636,_0x35b228){var _0x2db15c={},_0x18b872={},_0x172136={'count':0x0,'rows':[]};var _0x3dd53c=_['map'](db[_0x5653('0x3a')]['rawAttributes'],function(_0x514f20){return{'name':_0x514f20[_0x5653('0x3b')],'type':_0x514f20[_0x5653('0x3c')][_0x5653('0x3d')]};});_0x18b872[_0x5653('0x3e')]=_[_0x5653('0x3f')](_0x3dd53c,'name');_0x18b872['query']=_['keys'](_0x836636[_0x5653('0x40')]);_0x18b872['filters']=_[_0x5653('0x41')](_0x18b872['model'],_0x18b872[_0x5653('0x40')]);_0x2db15c[_0x5653('0x42')]=_[_0x5653('0x41')](_0x18b872[_0x5653('0x3e')],qs[_0x5653('0x43')](_0x836636[_0x5653('0x40')][_0x5653('0x43')]));_0x2db15c['attributes']=_0x2db15c[_0x5653('0x42')]['length']?_0x2db15c['attributes']:_0x18b872['model'];if(!_0x836636[_0x5653('0x40')][_0x5653('0x44')](_0x5653('0x45'))){_0x2db15c[_0x5653('0x2e')]=qs[_0x5653('0x2e')](_0x836636[_0x5653('0x40')][_0x5653('0x2e')]);_0x2db15c['offset']=qs[_0x5653('0x2c')](_0x836636[_0x5653('0x40')][_0x5653('0x2c')]);}_0x2db15c[_0x5653('0x46')]=qs[_0x5653('0x47')](_0x836636[_0x5653('0x40')]['sort']);_0x2db15c[_0x5653('0x48')]=qs[_0x5653('0x49')](_['pick'](_0x836636[_0x5653('0x40')],_0x18b872[_0x5653('0x49')]),_0x3dd53c);if(_0x836636[_0x5653('0x40')][_0x5653('0x4a')]){_0x2db15c['where']=_['merge'](_0x2db15c[_0x5653('0x48')],{'$or':_[_0x5653('0x3f')](_0x3dd53c,function(_0x443824){if(_0x443824[_0x5653('0x3c')]!==_0x5653('0x4b')){var _0x572a26={};_0x572a26[_0x443824['name']]={'$like':'%'+_0x836636['query'][_0x5653('0x4a')]+'%'};return _0x572a26;}})});}_0x2db15c=_[_0x5653('0x4c')]({},_0x2db15c,_0x836636['options']);var _0x55e555={'where':_0x2db15c[_0x5653('0x48')]};return db[_0x5653('0x3a')][_0x5653('0x2f')](_0x55e555)['then'](function(_0x453932){_0x172136['count']=_0x453932;if(_0x836636[_0x5653('0x40')][_0x5653('0x4d')]){_0x2db15c[_0x5653('0x4e')]=[{'all':!![]}];}return db[_0x5653('0x3a')][_0x5653('0x4f')](_0x2db15c);})[_0x5653('0x20')](function(_0x15b8d0){_0x172136[_0x5653('0x50')]=_0x15b8d0;return _0x172136;})[_0x5653('0x20')](respondWithFilteredResult(_0x35b228,_0x2db15c))['catch'](handleError(_0x35b228,null));};exports[_0x5653('0x51')]=function(_0x2b324c,_0x251903){var _0x397da0={'raw':!![],'where':{'id':_0x2b324c['params']['id']}},_0x2f2436={};_0x2f2436[_0x5653('0x3e')]=_[_0x5653('0x52')](db[_0x5653('0x3a')]['rawAttributes']);_0x2f2436['query']=_['keys'](_0x2b324c[_0x5653('0x40')]);_0x2f2436[_0x5653('0x49')]=_[_0x5653('0x41')](_0x2f2436[_0x5653('0x3e')],_0x2f2436['query']);_0x397da0[_0x5653('0x42')]=_[_0x5653('0x41')](_0x2f2436[_0x5653('0x3e')],qs['fields'](_0x2b324c['query'][_0x5653('0x43')]));_0x397da0[_0x5653('0x42')]=_0x397da0[_0x5653('0x42')]['length']?_0x397da0[_0x5653('0x42')]:_0x2f2436[_0x5653('0x3e')];if(_0x2b324c[_0x5653('0x40')][_0x5653('0x4d')]){_0x397da0[_0x5653('0x4e')]=[{'all':!![]}];}_0x397da0=_[_0x5653('0x4c')]({},_0x397da0,_0x2b324c[_0x5653('0x53')]);return db[_0x5653('0x3a')][_0x5653('0x54')](_0x397da0)['then'](handleEntityNotFound(_0x251903,null))[_0x5653('0x20')](respondWithResult(_0x251903,null))['catch'](handleError(_0x251903,null));};exports[_0x5653('0x55')]=function(_0x1044f4,_0x9537bb){return db['SmsMessage'][_0x5653('0x55')](_0x1044f4[_0x5653('0x56')],{})['then'](respondWithResult(_0x9537bb,0xc9))[_0x5653('0x57')](handleError(_0x9537bb,null));};exports['update']=function(_0x501d6f,_0x35cbec){if(_0x501d6f[_0x5653('0x56')]['id']){delete _0x501d6f[_0x5653('0x56')]['id'];}return db[_0x5653('0x3a')]['find']({'where':{'id':_0x501d6f[_0x5653('0x58')]['id']}})[_0x5653('0x20')](handleEntityNotFound(_0x35cbec,null))[_0x5653('0x20')](saveUpdates(_0x501d6f['body'],null))['then'](respondWithResult(_0x35cbec,null))[_0x5653('0x57')](handleError(_0x35cbec,null));};exports[_0x5653('0x35')]=function(_0x4246c7,_0x670832){return db[_0x5653('0x3a')][_0x5653('0x54')]({'where':{'id':_0x4246c7[_0x5653('0x58')]['id']}})[_0x5653('0x20')](handleEntityNotFound(_0x670832,null))[_0x5653('0x20')](removeEntity(_0x670832,null))['catch'](handleError(_0x670832,null));};exports[_0x5653('0x59')]=function(_0x3ef404,_0x56c6ba){return db[_0x5653('0x3a')][_0x5653('0x59')]()[_0x5653('0x20')](respondWithResult(_0x56c6ba,null))[_0x5653('0x57')](handleError(_0x56c6ba,null));};var interaction_log=require(_0x5653('0x15'))(_0x5653('0x5a'));exports[_0x5653('0x5b')]=function(_0x28a8bb,_0x22f01a,_0x79e83b){var _0x406c01={'agent':{},'channel':'sms'};if(_0x28a8bb[_0x5653('0x56')]['id']){delete _0x28a8bb['body']['id'];}_0x28a8bb[_0x5653('0x56')][_0x5653('0x5c')]=!![];_0x28a8bb['body'][_0x5653('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x28a8bb['body'][_0x5653('0x5e')]=_0x28a8bb['body'][_0x5653('0x5e')]||_0x28a8bb[_0x5653('0x5f')]['id'];_0x406c01[_0x5653('0x60')]['id']=_0x28a8bb['body'][_0x5653('0x5e')];return db['SmsMessage'][_0x5653('0x54')]({'where':{'id':_0x28a8bb['params']['id'],'UserId':null}})[_0x5653('0x20')](handleEntityNotFound(_0x22f01a,null))[_0x5653('0x20')](saveUpdates(_0x28a8bb[_0x5653('0x56')],null))[_0x5653('0x20')](function(_0x61fbc9){if(_0x61fbc9){_0x406c01[_0x5653('0x29')]=_0x61fbc9[_0x5653('0x61')]({'plain':!![]});return db[_0x5653('0x62')][_0x5653('0x54')]({'where':{'id':_0x61fbc9[_0x5653('0x63')]}});}return null;})[_0x5653('0x20')](handleEntityNotFound(_0x22f01a,null))[_0x5653('0x20')](function(_0x195fb0){if(_0x195fb0){return _0x195fb0[_0x5653('0x34')]({'UserId':_0x28a8bb['body'][_0x5653('0x5e')],'read1stAt':_[_0x5653('0x64')](_0x195fb0['read1stAt'])?moment()[_0x5653('0x65')](_0x5653('0x66')):undefined});}return null;})[_0x5653('0x20')](function(_0x1d7086){if(_0x1d7086){_0x406c01[_0x5653('0x67')]=_0x1d7086[_0x5653('0x61')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x28a8bb['user']['id'],_0x28a8bb[_0x5653('0x5f')][_0x5653('0x38')],_0x28a8bb[_0x5653('0x5f')][_0x5653('0x68')],_0x406c01['interaction']['id'],_0x28a8bb[_0x5653('0x56')]?JSON[_0x5653('0x26')](_0x28a8bb[_0x5653('0x56')]):_0x5653('0x69'));return respondWithRpcPromise(_0x5653('0x6a'),_0x5653('0x6b'),_0x406c01);}return null;})[_0x5653('0x20')](function(_0x518b75){var _0x39ab6d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x518b75[_0x5653('0x29')][_0x5653('0x6c')];return db['sequelize'][_0x5653('0x40')](_0x39ab6d,{'type':db[_0x5653('0x6d')][_0x5653('0x6e')][_0x5653('0x6f')],'raw':!![]})[_0x5653('0x20')](function(_0x4ccc54){return _0x4ccc54;});})['then'](function(_0x36fde2){if(_0x36fde2){_0x406c01[_0x5653('0x29')][_0x5653('0x70')]=_0x36fde2[0x0];if(!_0x28a8bb[_0x5653('0x56')]['UserId'])return;return db['User'][_0x5653('0x54')]({'where':{'id':_0x28a8bb[_0x5653('0x56')][_0x5653('0x5e')],'role':_0x5653('0x60')},'attributes':['id',_0x5653('0x38'),_0x5653('0x71'),'email',_0x5653('0x72')],'raw':!![]});}return null;})[_0x5653('0x20')](function(_0x382614){if(!_0x382614)return null;_0x406c01[_0x5653('0x29')][_0x5653('0x60')]=_0x382614;return _0x406c01;})['then'](function(_0x360d23){if(_0x360d23){if(_0x28a8bb[_0x5653('0x56')][_0x5653('0x73')]){_0x406c01[_0x5653('0x29')][_0x5653('0x74')]=util['format'](_0x5653('0x75'),_0x28a8bb[_0x5653('0x5f')][_0x5653('0x38')]);_0x406c01[_0x5653('0x29')][_0x5653('0x76')]=_0x406c01[_0x5653('0x76')];_0x406c01[_0x5653('0x29')][_0x5653('0x77')]=_0x5653('0x5b');return respondWithRpcPromise(_0x5653('0x78'),'EventManager',{'event':_0x5653('0x79'),'message':_0x406c01[_0x5653('0x29')]},client9002)[_0x5653('0x20')](function(){return _0x406c01;});}return _0x406c01;}return null;})[_0x5653('0x20')](respondWithResult(_0x22f01a,null))['catch'](handleError(_0x22f01a,null));};var interaction_log=require('../../config/logger')(_0x5653('0x5a'));exports[_0x5653('0x33')]=function(_0x581367,_0x471532,_0x2a674a){var _0x5225e0={'agent':{},'channel':'sms'};if(_0x581367['body']['id']){delete _0x581367['body']['id'];}_0x581367['body'][_0x5653('0x5e')]=_0x581367[_0x5653('0x56')][_0x5653('0x5e')]||_0x581367[_0x5653('0x5f')]['id'];_0x5225e0['agent']['id']=_0x581367['body'][_0x5653('0x5e')];return db[_0x5653('0x3a')]['find']({'where':{'id':_0x581367[_0x5653('0x58')]['id'],'UserId':null}})[_0x5653('0x20')](handleEntityNotFound(_0x471532,null))[_0x5653('0x20')](function(_0x4567c7){if(_0x4567c7){_0x5225e0[_0x5653('0x29')]=_0x4567c7[_0x5653('0x61')]({'plain':!![]});return db[_0x5653('0x62')][_0x5653('0x54')]({'where':{'id':_0x4567c7[_0x5653('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x471532,null))['then'](function(_0x4cf4f0){if(_0x4cf4f0){_0x5225e0[_0x5653('0x67')]=_0x4cf4f0[_0x5653('0x61')]({'plain':!![]});interaction_log[_0x5653('0x21')](_0x5653('0x7a'),_0x581367[_0x5653('0x5f')]['id'],_0x581367[_0x5653('0x5f')][_0x5653('0x38')],_0x581367[_0x5653('0x5f')][_0x5653('0x68')],_0x5225e0['interaction']['id'],_0x581367[_0x5653('0x56')]?JSON['stringify'](_0x581367[_0x5653('0x56')]):_0x5653('0x69'));return respondWithRpcPromise(_0x5653('0x7b'),_0x5653('0x7c'),_0x5225e0);}return null;})[_0x5653('0x20')](function(_0x364353){var _0xd5faff=_0x5653('0x7d')+_0x364353[_0x5653('0x29')][_0x5653('0x6c')];return db['sequelize']['query'](_0xd5faff,{'type':db[_0x5653('0x6d')][_0x5653('0x6e')][_0x5653('0x6f')],'raw':!![]})[_0x5653('0x20')](function(_0x524c4b){return _0x524c4b;});})[_0x5653('0x20')](function(_0x305cf7){if(_0x305cf7){_0x5225e0[_0x5653('0x29')][_0x5653('0x70')]=_0x305cf7[0x0];if(!_0x581367[_0x5653('0x56')][_0x5653('0x5e')])return;return db['User'][_0x5653('0x54')]({'where':{'id':_0x581367[_0x5653('0x56')][_0x5653('0x5e')],'role':_0x5653('0x60')},'attributes':['id','name','fullname',_0x5653('0x7e'),_0x5653('0x72')],'raw':!![]});}return null;})[_0x5653('0x20')](function(_0x34101f){if(!_0x34101f)return null;_0x5225e0[_0x5653('0x29')][_0x5653('0x60')]=_0x34101f;return _0x5225e0;})[_0x5653('0x20')](function(_0x17baa0){if(_0x17baa0){_0x17baa0[_0x5653('0x29')]['interface']=util['format'](_0x5653('0x75'),_0x581367['user'][_0x5653('0x38')]);_0x17baa0['message']['channel']=_0x5225e0['channel'];_0x17baa0[_0x5653('0x29')][_0x5653('0x77')]='reject';respondWithRpcPromise(_0x5653('0x78'),'EventManager',{'event':_0x5653('0x7f'),'message':_0x17baa0[_0x5653('0x29')]},client9002);return _0x5225e0;}return null;})[_0x5653('0x20')](respondWithResult(_0x471532,null))[_0x5653('0x57')](handleError(_0x471532,null));};exports[_0x5653('0x2b')]=function(_0x2e0318,_0x4e193a,_0x337a68){if(_0x2e0318[_0x5653('0x56')]['id']){delete _0x2e0318['body']['id'];}var _0x267482;return db[_0x5653('0x3a')][_0x5653('0x54')]({'where':{'id':_0x2e0318['params']['id']}})[_0x5653('0x20')](handleEntityNotFound(_0x4e193a,null))[_0x5653('0x20')](function(_0x1b1408){if(_0x1b1408){_0x267482=_0x1b1408;return db['SmsAccount'][_0x5653('0x54')]({'where':{'id':_0x1b1408['SmsAccountId']}});}})[_0x5653('0x20')](handleEntityNotFound(_0x4e193a,null))[_0x5653('0x20')](function(_0x5b12d7){if(_0x5b12d7){logger[_0x5653('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5653('0x2b'),'received\x20delivery\x20report\x20from',_0x5b12d7[_0x5653('0x3c')],util[_0x5653('0x80')](_0x2e0318['body'],{'showHidden':![],'depth':null}));switch(_0x5b12d7[_0x5653('0x3c')]){case _0x5653('0x81'):if(_0x2e0318[_0x5653('0x56')][_0x5653('0x82')]&&_0x2e0318[_0x5653('0x56')]['MessageSid']===_0x267482[_0x5653('0x83')]){return _0x267482[_0x5653('0x34')]({'read':!![]});}else{logger[_0x5653('0x27')](_0x5653('0x84'),_0x5653('0x2b'),_0x5653('0x81'),util['inspect'](_0x2e0318[_0x5653('0x56')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x2e0318[_0x5653('0x56')]['MessageUUID']&&_0x2e0318[_0x5653('0x56')][_0x5653('0x85')]===_0x267482[_0x5653('0x83')]&&_[_0x5653('0x86')]([_0x5653('0x87'),_0x5653('0x88')],_0x2e0318[_0x5653('0x56')][_0x5653('0x89')])>=0x0){return _0x267482[_0x5653('0x34')]({'read':!![]});}else{logger[_0x5653('0x27')](_0x5653('0x84'),_0x5653('0x2b'),_0x5653('0x8a'),util[_0x5653('0x80')](_0x2e0318['body'],{'showHidden':![],'depth':null}));}break;case _0x5653('0x8b'):var _0x55e9d0=_0x2e0318['body'][_0x5653('0x8c')][0x0];if(_0x55e9d0[_0x5653('0x2b')][_0x5653('0x8d')]==='DELIVERED'){return _0x267482[_0x5653('0x34')]({'read':!![]});}else{logger[_0x5653('0x27')](_0x5653('0x84'),_0x5653('0x2b'),'infobip',util[_0x5653('0x80')](_0x2e0318[_0x5653('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x267482;}})[_0x5653('0x20')](respondWithResult(_0x4e193a,null))[_0x5653('0x57')](handleError(_0x4e193a,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 37fc5f0..86aa1b7 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 _0x23dc=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','SmsMessage'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x23dc,0x12c));var _0xc23d=function(_0x307b51,_0x7da168){_0x307b51=_0x307b51-0x0;var _0x5cd453=_0x23dc[_0x307b51];return _0x5cd453;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0xc23d('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc23d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc23d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x174d0e){return function(_0x437c12,_0x444412,_0x3b903e){SmsMessageEvents[_0xc23d('0x3')](_0x174d0e+':'+_0x437c12['id'],_0x437c12);SmsMessageEvents[_0xc23d('0x3')](_0x174d0e,_0x437c12);_0x3b903e(null);};}for(var e in events){if(events[_0xc23d('0x4')](e)){var event=events[e];SmsMessage[_0xc23d('0x5')](e,emitEvent(event));}}module[_0xc23d('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0xcc43=['SmsMessage','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x508685,_0x9f94af){var _0x976a76=function(_0x1bcb05){while(--_0x1bcb05){_0x508685['push'](_0x508685['shift']());}};_0x976a76(++_0x9f94af);}(_0xcc43,0x1d7));var _0x3cc4=function(_0x2db8d7,_0x551c99){_0x2db8d7=_0x2db8d7-0x0;var _0x1fffdd=_0xcc43[_0x2db8d7];return _0x1fffdd;};'use strict';var EventEmitter=require(_0x3cc4('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x3cc4('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3cc4('0x2')](0x0);var events={'afterCreate':_0x3cc4('0x3'),'afterUpdate':_0x3cc4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5b73eb){return function(_0x22e18f,_0x1f897f,_0x5b6d12){SmsMessageEvents[_0x3cc4('0x5')](_0x5b73eb+':'+_0x22e18f['id'],_0x22e18f);SmsMessageEvents[_0x3cc4('0x5')](_0x5b73eb,_0x22e18f);_0x5b6d12(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x3cc4('0x6')](e,emitEvent(event));}}module[_0x3cc4('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index dc655b7..4d797aa 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 _0xf323=['get','toLowerCase','direction','out','UserId','SmsInteraction','SmsInteractionId','then','catch','secret','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/status?token=','token','sid','update','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','session_key','internal_order_id','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','deliveryReport','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','csc','crypto','apiKey','text','timestamp','keys','length','createHash','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','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','Bearer\x20','application/json','code','message','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','messageId','fti_sms_messages','body','FULLTEXT','models'];(function(_0xc0c5a0,_0x181fa5){var _0x6f29bf=function(_0x3a5760){while(--_0x3a5760){_0xc0c5a0['push'](_0xc0c5a0['shift']());}};_0x6f29bf(++_0x181fa5);}(_0xf323,0x1c6));var _0x3f32=function(_0x3a2e4a,_0xb9a3ae){_0x3a2e4a=_0x3a2e4a-0x0;var _0x394a41=_0xf323[_0x3a2e4a];return _0x394a41;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f32('0x0'))(_0x3f32('0x1'));var moment=require('moment');var BPromise=require(_0x3f32('0x2'));var rp=require(_0x3f32('0x3'));var fs=require('fs');var path=require(_0x3f32('0x4'));var rimraf=require(_0x3f32('0x5'));var config=require(_0x3f32('0x6'));var attributes=require('./smsMessage.attributes');module[_0x3f32('0x7')]=function(_0x2b4488,_0xf8ca8b){return _0x2b4488[_0x3f32('0x8')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x3f32('0x9'),'fields':[_0x3f32('0x9')]},{'name':_0x3f32('0xa'),'fields':[_0x3f32('0xb')],'type':_0x3f32('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c3257,_0x228ac0,_0x952bb4){var _0x5ca455=_0x2b4488[_0x3f32('0xd')];var _0x446045=_0x1c3257[_0x3f32('0xe')]({'plain':!![]});if(_0x446045['direction'][_0x3f32('0xf')]()==='in'||_0x446045[_0x3f32('0x10')][_0x3f32('0xf')]()===_0x3f32('0x11')&&!_0x446045['secret']&&!_['isNil'](_0x446045[_0x3f32('0x12')])){_0x5ca455[_0x3f32('0x13')]['findOne']({'where':{'id':_0x446045[_0x3f32('0x14')]}})[_0x3f32('0x15')](function(_0xc68dd5){if(_0xc68dd5){_0xc68dd5['update']({'lastMsgAt':_0x446045['createdAt'],'lastMsgDirection':_0x446045[_0x3f32('0x10')][_0x3f32('0xf')]()});}})[_0x3f32('0x16')](function(_0x219d91){console['error'](_0x219d91);});}if(_0x446045['direction']===_0x3f32('0x11')&&!_0x446045[_0x3f32('0x17')]){var _0x3a8e7b;_0x5ca455['SmsAccount'][_0x3f32('0x18')]({'where':{'id':_0x446045[_0x3f32('0x19')]},'raw':!![]})[_0x3f32('0x15')](function(_0x8d70ee){_0x3a8e7b=_0x8d70ee;if(_0x3a8e7b&&_0x3a8e7b[_0x3f32('0x1a')]){switch(_0x3a8e7b[_0x3f32('0x1a')]){case'twilio':var _0x24c741=require(_0x3f32('0x1b'));if(_0x3a8e7b[_0x3f32('0x1c')]&&_0x3a8e7b[_0x3f32('0x1d')]&&_0x3a8e7b[_0x3f32('0x1e')]){var _0x2e698a=new _0x24c741(_0x3a8e7b['accountSid'],_0x3a8e7b[_0x3f32('0x1d')]);_0x2e698a[_0x3f32('0x1f')]['create']({'body':_0x446045[_0x3f32('0xb')],'to':_0x446045[_0x3f32('0x1e')],'from':_0x3a8e7b[_0x3f32('0x1e')],'statusCallback':_0x3a8e7b[_0x3f32('0x20')]+'/api/sms/messages/'+_0x446045['id']+_0x3f32('0x21')+_0x3a8e7b[_0x3f32('0x22')]})['then'](function(_0x416015){if(_0x416015[_0x3f32('0x23')]){return _0x1c3257[_0x3f32('0x24')]({'messageId':_0x416015[_0x3f32('0x23')]});}})[_0x3f32('0x16')](function(_0x11f4ab){logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x1b'),util[_0x3f32('0x28')](_0x11f4ab,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3f32('0x26'),_0x3f32('0x27'),'twilio',_0x3f32('0x29'));}break;case'skebby':var _0x50e9aa=_0x3f32('0x2a');if(_0x3a8e7b[_0x3f32('0x2b')]&&_0x3a8e7b[_0x3f32('0x2c')]){var _0x320972={'recipient':[_0x446045[_0x3f32('0x1e')]],'message':_0x446045[_0x3f32('0xb')],'message_type':_0x3a8e7b[_0x3f32('0x2d')]};if(_0x3a8e7b[_0x3f32('0x2d')]&&_0x3a8e7b[_0x3f32('0x2d')]!=='SI'){_0x320972[_0x3f32('0x2e')]=_0x3a8e7b[_0x3f32('0x1e')];}var _0x5b1d9b={'url':_0x50e9aa+_0x3f32('0x2f')+_0x3a8e7b[_0x3f32('0x2b')]+_0x3f32('0x30')+_0x3a8e7b[_0x3f32('0x2c')],'method':'GET'};rp(_0x5b1d9b)['then'](function(_0x4fd7e2){var _0x173b92=_0x4fd7e2[_0x3f32('0x31')](';');var _0x408ed7={'user_key':_0x173b92[0x0],'session_key':_0x173b92[0x1]};_0x5b1d9b={'url':_0x50e9aa+_0x3f32('0x32'),'method':_0x3f32('0x33'),'headers':{'user_key':_0x408ed7[_0x3f32('0x34')],'Session_key':_0x408ed7[_0x3f32('0x35')]},'json':!![],'body':_0x320972};return rp(_0x5b1d9b);})[_0x3f32('0x15')](function(_0x1272a1){if(_0x1272a1['total_sent']>=0x1){var _0x142c6e={'messageId':_0x1272a1[_0x3f32('0x36')]};if(_0x3a8e7b['smsMethod']!=='GP'||!_0x3a8e7b['deliveryReport']){_0x142c6e[_0x3f32('0x37')]=!![];}return _0x1c3257[_0x3f32('0x24')](_0x142c6e);}else{return logger[_0x3f32('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3f32('0x38'),util[_0x3f32('0x28')](_0x1272a1,{'showHidden':![],'depth':null}));}})[_0x3f32('0x16')](function(_0x123fe0){return logger['error'](_0x3f32('0x26'),'afterCreate',_0x3f32('0x38'),util[_0x3f32('0x28')](_0x123fe0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x38'),_0x3f32('0x39'));}break;case _0x3f32('0x3a'):if(_0x3a8e7b[_0x3f32('0x1d')]){var _0xdfa32c={'recipient':_0x446045[_0x3f32('0x1e')],'message':_0x446045['body'],'sender':_0x3a8e7b['senderString']||_0x3a8e7b[_0x3f32('0x1e')],'authorization':_0x3a8e7b[_0x3f32('0x1d')]};var _0x228ac0={'method':_0x3f32('0x33'),'uri':_0x3f32('0x3b'),'body':_0xdfa32c,'json':!![]};rp(_0x228ac0)[_0x3f32('0x15')](function(_0x28bd51){var _0x18637f={'messageId':_0x28bd51[_0x3f32('0x3c')]};if(!_0x3a8e7b['deliveryReport']){_0x18637f[_0x3f32('0x37')]=!![];}return _0x1c3257[_0x3f32('0x24')](_0x18637f);})[_0x3f32('0x16')](function(_0x579d4e){logger[_0x3f32('0x25')](_0x3f32('0x26'),'afterCreate',_0x3f32('0x3a'),util[_0x3f32('0x28')](_0x579d4e,{'showHidden':![],'depth':null}));});}else{logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x3a'),_0x3f32('0x3d'));}break;case'clicksend':if(_0x3a8e7b['username']&&_0x3a8e7b[_0x3f32('0x2c')]){var _0xdfa32c={'messages':[{'source':'xCALLY\x20Motion','to':_0x446045[_0x3f32('0x1e')],'body':_0x446045[_0x3f32('0xb')],'from':_0x3a8e7b[_0x3f32('0x3e')]||_0x3a8e7b[_0x3f32('0x1e')]}]};var _0x2dc7cf=util[_0x3f32('0x3f')](_0x3f32('0x40'),_0x3a8e7b['username'],_0x3a8e7b[_0x3f32('0x2c')]);var _0x228ac0={'method':_0x3f32('0x33'),'uri':_0x3f32('0x41'),'body':_0xdfa32c,'headers':{'Authorization':util[_0x3f32('0x3f')](_0x3f32('0x42'),new Buffer(_0x2dc7cf)[_0x3f32('0x43')](_0x3f32('0x44')))},'json':!![]};rp(_0x228ac0)[_0x3f32('0x15')](function(_0x50faa4){if(_0x50faa4[_0x3f32('0x45')]>=0xc8&&_0x50faa4[_0x3f32('0x45')]<=0xce){if(_0x50faa4[_0x3f32('0x46')]&&_0x50faa4[_0x3f32('0x46')][_0x3f32('0x47')]>0x0){var _0x562ca0=_['head'](_0x50faa4[_0x3f32('0x46')][_0x3f32('0x1f')]);var _0x1287af={'messageId':_0x562ca0['message_id']};if(!_0x3a8e7b[_0x3f32('0x48')]){_0x1287af['read']=!![];}return _0x1c3257[_0x3f32('0x24')](_0x1287af);}else{logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x49'),util['inspect'](_0x50faa4,{'showHidden':![],'depth':null}));}}else{logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),'clickSend',util['inspect'](_0x50faa4,{'showHidden':![],'depth':null}));}})[_0x3f32('0x16')](function(_0x4fa926){logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x49'),util[_0x3f32('0x28')](_0x4fa926,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x49'),_0x3f32('0x39'));}break;case _0x3f32('0x4a'):if(_0x3a8e7b['authId']&&_0x3a8e7b[_0x3f32('0x1d')]){var _0xdfa32c={'dst':_0x446045['phone'],'text':_0x446045[_0x3f32('0xb')],'src':_0x3a8e7b[_0x3f32('0x3e')]||_0x3a8e7b[_0x3f32('0x1e')],'url':_0x3a8e7b[_0x3f32('0x20')]+'/api/sms/messages/'+_0x446045['id']+_0x3f32('0x21')+_0x3a8e7b[_0x3f32('0x22')]};var _0x2dc7cf=util[_0x3f32('0x3f')](_0x3f32('0x40'),_0x3a8e7b[_0x3f32('0x4b')],_0x3a8e7b[_0x3f32('0x1d')]);var _0x228ac0={'method':'POST','uri':util[_0x3f32('0x3f')](_0x3f32('0x4c'),_0x3a8e7b['authId']),'body':_0xdfa32c,'headers':{'Authorization':util[_0x3f32('0x3f')]('Basic\x20%s',new Buffer(_0x2dc7cf)[_0x3f32('0x43')](_0x3f32('0x44')))},'json':!![]};rp(_0x228ac0)[_0x3f32('0x15')](function(_0x4675b2){var _0x3d889a={'messageId':_0x4675b2[_0x3f32('0x4d')][0x0]};return _0x1c3257[_0x3f32('0x24')](_0x3d889a);})['catch'](function(_0x114ed8){logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x4a'),util[_0x3f32('0x28')](_0x114ed8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x4a'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x3f32('0x4e'):if(_0x3a8e7b[_0x3f32('0x2b')]&&_0x3a8e7b[_0x3f32('0x2c')]){if(_0x3a8e7b[_0x3f32('0x4f')]){var _0x2d0e9e={'method':'POST','uri':_0x3a8e7b['baseUrl']+_0x3f32('0x50'),'body':{'username':_0x3a8e7b[_0x3f32('0x2b')],'password':_0x3a8e7b[_0x3f32('0x2c')]},'json':!![]};return rp(_0x2d0e9e)['then'](function(_0x239e09){var _0xcfc079={'method':_0x3f32('0x33'),'uri':_0x3a8e7b[_0x3f32('0x4f')]+_0x3f32('0x51'),'body':{'messages':[{'from':_0x3a8e7b['phone'],'destinations':[{'to':_0x446045[_0x3f32('0x1e')]}],'text':_0x446045[_0x3f32('0xb')],'notifyUrl':_0x3a8e7b[_0x3f32('0x20')]+'/api/sms/messages/'+_0x446045['id']+'/status?token='+_0x3a8e7b[_0x3f32('0x22')],'notifyContentType':'application/json','callbackData':_0x3a8e7b['phone']+';'+_0x446045[_0x3f32('0xb')]}]},'headers':{'Authorization':_0x3f32('0x52')+_0x239e09[_0x3f32('0x22')]},'json':!![]};return rp(_0xcfc079)[_0x3f32('0x15')](function(_0x32ef89){if(_0x32ef89['messages']){var _0x54802d={'messageId':_0x32ef89['messages'][0x0][_0x3f32('0x9')]};if(!_0x3a8e7b[_0x3f32('0x48')]){_0x54802d['read']=!![];}return _0x1c3257[_0x3f32('0x24')](_0x54802d);}else{return logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),'infobip',util[_0x3f32('0x28')](_0x32ef89,{'showHidden':![],'depth':null}));}});})[_0x3f32('0x16')](function(_0x1fe1f5){return logger[_0x3f32('0x25')](_0x3f32('0x26'),'afterCreate','infobip',util[_0x3f32('0x28')](_0x1fe1f5,{'showHidden':![],'depth':null}));});}else{logger[_0x3f32('0x25')](_0x3f32('0x26'),'afterCreate',_0x3f32('0x4e'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x4e'),_0x3f32('0x39'));}break;case _0x3f32('0x53'):var _0x24b4e1=require(_0x3f32('0x54'));if(_0x3a8e7b[_0x3f32('0x55')]){var _0x2e0093={};_0x2e0093['login']=_0x3a8e7b[_0x3f32('0x2b')];_0x2e0093[_0x3f32('0x1e')]=_0x446045['phone'];_0x2e0093[_0x3f32('0x2e')]=_0x3a8e7b['phone'];_0x2e0093[_0x3f32('0x56')]=_0x446045['body'];_0x2e0093[_0x3f32('0x57')]=+new Date();var _0x338ba8='';var _0x1b2d61='';var _0x4d76aa=Object[_0x3f32('0x58')](_0x2e0093);_0x4d76aa['sort']();for(var _0x1d5088=0x0;_0x1d5088<_0x4d76aa[_0x3f32('0x59')];_0x1d5088++){if(_0x338ba8!=''){_0x338ba8+='&';}_0x338ba8+=_0x4d76aa[_0x1d5088]+'='+encodeURIComponent(_0x2e0093[_0x4d76aa[_0x1d5088]]);_0x1b2d61+=_0x2e0093[_0x4d76aa[_0x1d5088]];}_0x1b2d61+=_0x3a8e7b[_0x3f32('0x55')];_0x1b2d61=_0x24b4e1[_0x3f32('0x5a')]('md5')[_0x3f32('0x24')](_0x1b2d61)[_0x3f32('0x5b')](_0x3f32('0x5c'));if(_0x338ba8!==''){_0x338ba8+='&';}_0x338ba8+=_0x3f32('0x5d')+_0x1b2d61;var _0x5b1d9b={'method':_0x3f32('0x5e'),'uri':_0x3a8e7b['baseUrl']+_0x3f32('0x5f')+_0x338ba8,'json':!![]};return rp(_0x5b1d9b)['then'](function(_0x13787a){var _0x4a14d9=Object[_0x3f32('0x58')](_0x13787a);if(_0x13787a[_0x4a14d9[0x0]][_0x3f32('0x25')]&&parseInt(_0x13787a[_0x4a14d9[0x0]][_0x3f32('0x25')])===0x0){var _0x4f9289={'messageId':_0x13787a[_0x4a14d9[0x0]][_0x3f32('0x60')]};if(!_0x3a8e7b[_0x3f32('0x48')]){_0x4f9289[_0x3f32('0x37')]=!![];}return _0x1c3257['update'](_0x4f9289);}else{return logger[_0x3f32('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3f32('0x27'),_0x3f32('0x53'),util[_0x3f32('0x28')](_0x13787a[_0x3f32('0x25')],{'showHidden':![],'depth':null}));}})[_0x3f32('0x16')](function(_0x11ee5f){return logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x53'),util[_0x3f32('0x28')](_0x11ee5f,{'showHidden':![],'depth':null}));});}else{logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),'csc',_0x3f32('0x61'));}break;case _0x3f32('0x62'):if(_0x3a8e7b['apiKey']){var _0x1a8517={'method':'POST','uri':_0x3f32('0x63'),'headers':{'Authorization':_0x3a8e7b[_0x3f32('0x55')]},'body':{'content':_0x446045[_0x3f32('0xb')],'to':[_0x446045[_0x3f32('0x1e')]],'from':_0x3a8e7b[_0x3f32('0x1e')],'binary':![],'clientMessageId':'uuid','charset':_0x3f32('0x64')},'json':!![]};rp(_0x1a8517)[_0x3f32('0x15')](function(_0x58b279){if(!_0x58b279[_0x3f32('0x25')]){var _0x4e9e91={'messageId':_0x58b279[_0x3f32('0x1f')][0x0][_0x3f32('0x65')]};if(!_0x3a8e7b[_0x3f32('0x48')]){_0x4e9e91['read']=!![];}return _0x1c3257['update'](_0x4e9e91);}else{return logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x62'),util[_0x3f32('0x28')](_0x58b279[_0x3f32('0x25')],{'showHidden':![],'depth':null}));}})[_0x3f32('0x16')](function(_0x397216){return logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),'clickatell',util[_0x3f32('0x28')](_0x397216,{'showHidden':![],'depth':null}));});}else{logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),'clickatell',_0x3f32('0x61'));}break;case _0x3f32('0x66'):if(_0x3a8e7b[_0x3f32('0x2b')]&&_0x3a8e7b[_0x3f32('0x2c')]){var _0x2dc7cf=util[_0x3f32('0x3f')](_0x3f32('0x40'),_0x3a8e7b[_0x3f32('0x2b')],_0x3a8e7b[_0x3f32('0x2c')]);var _0x228ac0={'method':_0x3f32('0x33'),'uri':_0x3f32('0x67')+_0x3a8e7b[_0x3f32('0x68')]+_0x3f32('0x69'),'body':{'to':[_0x446045['phone']],'text':_0x446045['body'],'from':_0x3a8e7b[_0x3f32('0x1e')],'applicationId':_0x3a8e7b[_0x3f32('0x6a')]},'headers':{'Authorization':util[_0x3f32('0x3f')](_0x3f32('0x42'),new Buffer(_0x2dc7cf)['toString'](_0x3f32('0x44')))},'json':!![]};rp(_0x228ac0)[_0x3f32('0x15')](function(_0x10009f){if(_0x10009f['id']){var _0x17b3a2={'messageId':_0x10009f['id']};return _0x1c3257[_0x3f32('0x24')](_0x17b3a2);}else{logger['error'](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x66'),util[_0x3f32('0x28')](_0x10009f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3a4eb4){logger[_0x3f32('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3f32('0x27'),'bandwidth',util['inspect'](_0x3a4eb4,{'showHidden':![],'depth':null}));});}else{logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),_0x3f32('0x66'),_0x3f32('0x39'));}break;case _0x3f32('0x6b'):if(_0x3a8e7b[_0x3f32('0x55')]){var _0x36d197={};var _0x5b1d9b={'method':_0x3f32('0x33'),'uri':_0x3f32('0x6c'),'headers':{'Authorization':_0x3f32('0x6d')+_0x3a8e7b[_0x3f32('0x55')],'Content-Type':_0x3f32('0x6e')},'body':{'from':_0x3a8e7b[_0x3f32('0x1e')],'to':_0x446045[_0x3f32('0x1e')],'text':_0x446045['body']},'json':!![]};return rp(_0x5b1d9b)[_0x3f32('0x15')](function(_0x436dbb){if(_0x436dbb[_0x3f32('0x6f')]==0xca){_0x36d197[_0x3f32('0x70')]=_0x436dbb;var _0x1fdcbf={'method':_0x3f32('0x33'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x3f32('0x6d')+_0x3a8e7b['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x36d197[_0x3f32('0x70')]['refid']},'json':!![]};return rp(_0x1fdcbf)[_0x3f32('0x15')](function(_0xfaf224){_0x36d197[_0x3f32('0x71')]=_0xfaf224;var _0x3e05fb={'messageId':_0x36d197['message']['refid'],'read':!![]};return _0x1c3257[_0x3f32('0x24')](_0x3e05fb);});}else{return logger[_0x3f32('0x25')](_0x3f32('0x26'),'afterCreate',_0x3f32('0x6b'),util[_0x3f32('0x28')](_0x436dbb,{'showHidden':![],'depth':null}));}})[_0x3f32('0x16')](function(_0x33a079){return logger[_0x3f32('0x25')](_0x3f32('0x26'),_0x3f32('0x27'),'intelepeer',util[_0x3f32('0x28')](_0x33a079,{'showHidden':![],'depth':null}));});}else{return logger[_0x3f32('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3f32('0x27'),_0x3f32('0x6b'),_0x3f32('0x72'));}break;}}})[_0x3f32('0x73')](function(){_0x952bb4();});}else{_0x952bb4();}}},'charset':'utf8mb4','collate':_0x3f32('0x74')});}; \ No newline at end of file +var _0x7ee1=['read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','token','application/json','IBSSO\x20','csc','crypto','apiKey','login','timestamp','keys','sort','length','createHash','md5','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','bandwidth','accountId','/messages','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','SmsMessage','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','findOne','then','update','createdAt','catch','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','sid','error','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport'];(function(_0x2a7d57,_0x27a648){var _0x5daa90=function(_0x211cac){while(--_0x211cac){_0x2a7d57['push'](_0x2a7d57['shift']());}};_0x5daa90(++_0x27a648);}(_0x7ee1,0xab));var _0x17ee=function(_0x463751,_0x3742aa){_0x463751=_0x463751-0x0;var _0x5a6968=_0x7ee1[_0x463751];return _0x5a6968;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require(_0x17ee('0x1'))(_0x17ee('0x2'));var moment=require(_0x17ee('0x3'));var BPromise=require(_0x17ee('0x4'));var rp=require(_0x17ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x6'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x17ee('0x7')]=function(_0x2e4db0,_0x2efefb){return _0x2e4db0[_0x17ee('0x8')](_0x17ee('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x17ee('0xa'),'fields':['messageId']},{'name':_0x17ee('0xb'),'fields':[_0x17ee('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xb3aa42,_0x36d73a,_0xa9902e){var _0x3c879d=_0x2e4db0[_0x17ee('0xd')];var _0x352d60=_0xb3aa42[_0x17ee('0xe')]({'plain':!![]});if(_0x352d60[_0x17ee('0xf')][_0x17ee('0x10')]()==='in'||_0x352d60[_0x17ee('0xf')][_0x17ee('0x10')]()===_0x17ee('0x11')&&!_0x352d60['secret']&&!_[_0x17ee('0x12')](_0x352d60[_0x17ee('0x13')])){_0x3c879d['SmsInteraction'][_0x17ee('0x14')]({'where':{'id':_0x352d60['SmsInteractionId']}})[_0x17ee('0x15')](function(_0x27447d){if(_0x27447d){_0x27447d[_0x17ee('0x16')]({'lastMsgAt':_0x352d60[_0x17ee('0x17')],'lastMsgDirection':_0x352d60['direction'][_0x17ee('0x10')]()});}})[_0x17ee('0x18')](function(_0x1b09a3){console['error'](_0x1b09a3);});}if(_0x352d60[_0x17ee('0xf')]===_0x17ee('0x11')&&!_0x352d60[_0x17ee('0x19')]){var _0x384eaa;_0x3c879d[_0x17ee('0x1a')][_0x17ee('0x1b')]({'where':{'id':_0x352d60[_0x17ee('0x1c')]},'raw':!![]})['then'](function(_0x536c75){_0x384eaa=_0x536c75;if(_0x384eaa&&_0x384eaa[_0x17ee('0x1d')]){switch(_0x384eaa[_0x17ee('0x1d')]){case _0x17ee('0x1e'):var _0x2f908f=require('twilio');if(_0x384eaa[_0x17ee('0x1f')]&&_0x384eaa[_0x17ee('0x20')]&&_0x384eaa[_0x17ee('0x21')]){var _0x3ace7f=new _0x2f908f(_0x384eaa['accountSid'],_0x384eaa[_0x17ee('0x20')]);_0x3ace7f[_0x17ee('0x22')][_0x17ee('0x23')]({'body':_0x352d60['body'],'to':_0x352d60[_0x17ee('0x21')],'from':_0x384eaa[_0x17ee('0x21')],'statusCallback':_0x384eaa[_0x17ee('0x24')]+_0x17ee('0x25')+_0x352d60['id']+_0x17ee('0x26')+_0x384eaa['token']})[_0x17ee('0x15')](function(_0xc01da5){if(_0xc01da5[_0x17ee('0x27')]){return _0xb3aa42[_0x17ee('0x16')]({'messageId':_0xc01da5[_0x17ee('0x27')]});}})[_0x17ee('0x18')](function(_0x13e8ff){logger[_0x17ee('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17ee('0x29'),_0x17ee('0x1e'),util[_0x17ee('0x2a')](_0x13e8ff,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x17ee('0x2c'):var _0x400306=_0x17ee('0x2d');if(_0x384eaa['username']&&_0x384eaa[_0x17ee('0x2e')]){var _0x34b003={'recipient':[_0x352d60[_0x17ee('0x21')]],'message':_0x352d60['body'],'message_type':_0x384eaa[_0x17ee('0x2f')]};if(_0x384eaa[_0x17ee('0x2f')]&&_0x384eaa[_0x17ee('0x2f')]!=='SI'){_0x34b003[_0x17ee('0x30')]=_0x384eaa['phone'];}var _0x49e8b7={'url':_0x400306+_0x17ee('0x31')+_0x384eaa[_0x17ee('0x32')]+'&password='+_0x384eaa[_0x17ee('0x2e')],'method':'GET'};rp(_0x49e8b7)[_0x17ee('0x15')](function(_0x1cf8b9){var _0x126f3a=_0x1cf8b9['split'](';');var _0x2356fd={'user_key':_0x126f3a[0x0],'session_key':_0x126f3a[0x1]};_0x49e8b7={'url':_0x400306+'sms','method':_0x17ee('0x33'),'headers':{'user_key':_0x2356fd[_0x17ee('0x34')],'Session_key':_0x2356fd[_0x17ee('0x35')]},'json':!![],'body':_0x34b003};return rp(_0x49e8b7);})[_0x17ee('0x15')](function(_0x514114){if(_0x514114[_0x17ee('0x36')]>=0x1){var _0x27e103={'messageId':_0x514114[_0x17ee('0x37')]};if(_0x384eaa['smsMethod']!=='GP'||!_0x384eaa[_0x17ee('0x38')]){_0x27e103[_0x17ee('0x39')]=!![];}return _0xb3aa42[_0x17ee('0x16')](_0x27e103);}else{return logger['error'](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x2c'),util[_0x17ee('0x2a')](_0x514114,{'showHidden':![],'depth':null}));}})[_0x17ee('0x18')](function(_0x423079){return logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x2c'),util['inspect'](_0x423079,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x2c'),_0x17ee('0x3a'));}break;case _0x17ee('0x3b'):if(_0x384eaa[_0x17ee('0x20')]){var _0x1c6924={'recipient':_0x352d60[_0x17ee('0x21')],'message':_0x352d60[_0x17ee('0xc')],'sender':_0x384eaa[_0x17ee('0x3c')]||_0x384eaa['phone'],'authorization':_0x384eaa[_0x17ee('0x20')]};var _0x36d73a={'method':'POST','uri':_0x17ee('0x3d'),'body':_0x1c6924,'json':!![]};rp(_0x36d73a)[_0x17ee('0x15')](function(_0x21cdf6){var _0x29e163={'messageId':_0x21cdf6[_0x17ee('0x3e')]};if(!_0x384eaa[_0x17ee('0x38')]){_0x29e163['read']=!![];}return _0xb3aa42['update'](_0x29e163);})[_0x17ee('0x18')](function(_0x20c6e9){logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x3b'),util['inspect'](_0x20c6e9,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x3b'),'Missing\x20parameters:\x20authToken');}break;case _0x17ee('0x3f'):if(_0x384eaa['username']&&_0x384eaa[_0x17ee('0x2e')]){var _0x1c6924={'messages':[{'source':_0x17ee('0x40'),'to':_0x352d60[_0x17ee('0x21')],'body':_0x352d60['body'],'from':_0x384eaa['senderString']||_0x384eaa['phone']}]};var _0x58106c=util[_0x17ee('0x41')](_0x17ee('0x42'),_0x384eaa['username'],_0x384eaa[_0x17ee('0x2e')]);var _0x36d73a={'method':_0x17ee('0x33'),'uri':_0x17ee('0x43'),'body':_0x1c6924,'headers':{'Authorization':util[_0x17ee('0x41')](_0x17ee('0x44'),new Buffer(_0x58106c)[_0x17ee('0x45')](_0x17ee('0x46')))},'json':!![]};rp(_0x36d73a)['then'](function(_0x4664f7){if(_0x4664f7[_0x17ee('0x47')]>=0xc8&&_0x4664f7['http_code']<=0xce){if(_0x4664f7[_0x17ee('0x48')]&&_0x4664f7[_0x17ee('0x48')][_0x17ee('0x49')]>0x0){var _0x55f597=_['head'](_0x4664f7['data'][_0x17ee('0x22')]);var _0x2a8a48={'messageId':_0x55f597[_0x17ee('0x4a')]};if(!_0x384eaa[_0x17ee('0x38')]){_0x2a8a48[_0x17ee('0x39')]=!![];}return _0xb3aa42[_0x17ee('0x16')](_0x2a8a48);}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x4b'),util[_0x17ee('0x2a')](_0x4664f7,{'showHidden':![],'depth':null}));}}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x4b'),util[_0x17ee('0x2a')](_0x4664f7,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3d7ba1){logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),'clickSend',util[_0x17ee('0x2a')](_0x3d7ba1,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),'clickSend',_0x17ee('0x3a'));}break;case _0x17ee('0x4c'):if(_0x384eaa[_0x17ee('0x4d')]&&_0x384eaa[_0x17ee('0x20')]){var _0x1c6924={'dst':_0x352d60[_0x17ee('0x21')],'text':_0x352d60[_0x17ee('0xc')],'src':_0x384eaa[_0x17ee('0x3c')]||_0x384eaa['phone'],'url':_0x384eaa['remote']+_0x17ee('0x25')+_0x352d60['id']+_0x17ee('0x26')+_0x384eaa['token']};var _0x58106c=util[_0x17ee('0x41')](_0x17ee('0x42'),_0x384eaa[_0x17ee('0x4d')],_0x384eaa['authToken']);var _0x36d73a={'method':_0x17ee('0x33'),'uri':util[_0x17ee('0x41')]('https://api.plivo.com/v1/Account/%s/Message/',_0x384eaa['authId']),'body':_0x1c6924,'headers':{'Authorization':util[_0x17ee('0x41')]('Basic\x20%s',new Buffer(_0x58106c)[_0x17ee('0x45')]('base64'))},'json':!![]};rp(_0x36d73a)[_0x17ee('0x15')](function(_0x537958){var _0x329c99={'messageId':_0x537958[_0x17ee('0x4e')][0x0]};return _0xb3aa42[_0x17ee('0x16')](_0x329c99);})['catch'](function(_0x151b4d){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x17ee('0x4c'),util[_0x17ee('0x2a')](_0x151b4d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x4c'),_0x17ee('0x4f'));}break;case _0x17ee('0x50'):if(_0x384eaa['username']&&_0x384eaa[_0x17ee('0x2e')]){if(_0x384eaa[_0x17ee('0x51')]){var _0x54527d={'method':_0x17ee('0x33'),'uri':_0x384eaa['baseUrl']+_0x17ee('0x52'),'body':{'username':_0x384eaa[_0x17ee('0x32')],'password':_0x384eaa['password']},'json':!![]};return rp(_0x54527d)[_0x17ee('0x15')](function(_0x8e7e69){var _0x201c57={'method':_0x17ee('0x33'),'uri':_0x384eaa['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x384eaa['phone'],'destinations':[{'to':_0x352d60[_0x17ee('0x21')]}],'text':_0x352d60['body'],'notifyUrl':_0x384eaa[_0x17ee('0x24')]+_0x17ee('0x25')+_0x352d60['id']+'/status?token='+_0x384eaa[_0x17ee('0x53')],'notifyContentType':_0x17ee('0x54'),'callbackData':_0x384eaa[_0x17ee('0x21')]+';'+_0x352d60['body']}]},'headers':{'Authorization':_0x17ee('0x55')+_0x8e7e69[_0x17ee('0x53')]},'json':!![]};return rp(_0x201c57)['then'](function(_0x1254df){if(_0x1254df[_0x17ee('0x22')]){var _0x155ede={'messageId':_0x1254df[_0x17ee('0x22')][0x0][_0x17ee('0xa')]};if(!_0x384eaa[_0x17ee('0x38')]){_0x155ede['read']=!![];}return _0xb3aa42['update'](_0x155ede);}else{return logger[_0x17ee('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x17ee('0x50'),util[_0x17ee('0x2a')](_0x1254df,{'showHidden':![],'depth':null}));}});})[_0x17ee('0x18')](function(_0x5615e3){return logger['error'](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x50'),util[_0x17ee('0x2a')](_0x5615e3,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17ee('0x29'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x17ee('0x56'):var _0x26717c=require(_0x17ee('0x57'));if(_0x384eaa[_0x17ee('0x58')]){var _0x5b9a57={};_0x5b9a57[_0x17ee('0x59')]=_0x384eaa[_0x17ee('0x32')];_0x5b9a57[_0x17ee('0x21')]=_0x352d60[_0x17ee('0x21')];_0x5b9a57[_0x17ee('0x30')]=_0x384eaa['phone'];_0x5b9a57['text']=_0x352d60[_0x17ee('0xc')];_0x5b9a57[_0x17ee('0x5a')]=+new Date();var _0xa02147='';var _0x235b4f='';var _0x38f3ec=Object[_0x17ee('0x5b')](_0x5b9a57);_0x38f3ec[_0x17ee('0x5c')]();for(var _0x22002a=0x0;_0x22002a<_0x38f3ec[_0x17ee('0x5d')];_0x22002a++){if(_0xa02147!=''){_0xa02147+='&';}_0xa02147+=_0x38f3ec[_0x22002a]+'='+encodeURIComponent(_0x5b9a57[_0x38f3ec[_0x22002a]]);_0x235b4f+=_0x5b9a57[_0x38f3ec[_0x22002a]];}_0x235b4f+=_0x384eaa[_0x17ee('0x58')];_0x235b4f=_0x26717c[_0x17ee('0x5e')](_0x17ee('0x5f'))[_0x17ee('0x16')](_0x235b4f)['digest'](_0x17ee('0x60'));if(_0xa02147!==''){_0xa02147+='&';}_0xa02147+=_0x17ee('0x61')+_0x235b4f;var _0x49e8b7={'method':'GET','uri':_0x384eaa['baseUrl']+_0x17ee('0x62')+_0xa02147,'json':!![]};return rp(_0x49e8b7)['then'](function(_0x44966b){var _0x1d043e=Object[_0x17ee('0x5b')](_0x44966b);if(_0x44966b[_0x1d043e[0x0]][_0x17ee('0x28')]&&parseInt(_0x44966b[_0x1d043e[0x0]]['error'])===0x0){var _0x56087d={'messageId':_0x44966b[_0x1d043e[0x0]][_0x17ee('0x63')]};if(!_0x384eaa[_0x17ee('0x38')]){_0x56087d['read']=!![];}return _0xb3aa42[_0x17ee('0x16')](_0x56087d);}else{return logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x56'),util['inspect'](_0x44966b[_0x17ee('0x28')],{'showHidden':![],'depth':null}));}})[_0x17ee('0x18')](function(_0x522e8e){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17ee('0x29'),_0x17ee('0x56'),util[_0x17ee('0x2a')](_0x522e8e,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17ee('0x29'),_0x17ee('0x56'),_0x17ee('0x64'));}break;case _0x17ee('0x65'):if(_0x384eaa['apiKey']){var _0x22d5f2={'method':_0x17ee('0x33'),'uri':_0x17ee('0x66'),'headers':{'Authorization':_0x384eaa[_0x17ee('0x58')]},'body':{'content':_0x352d60[_0x17ee('0xc')],'to':[_0x352d60[_0x17ee('0x21')]],'from':_0x384eaa[_0x17ee('0x21')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x22d5f2)[_0x17ee('0x15')](function(_0x555302){if(!_0x555302['error']){var _0x497dc7={'messageId':_0x555302['messages'][0x0]['apiMessageId']};if(!_0x384eaa[_0x17ee('0x38')]){_0x497dc7[_0x17ee('0x39')]=!![];}return _0xb3aa42[_0x17ee('0x16')](_0x497dc7);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17ee('0x29'),'clickatell',util[_0x17ee('0x2a')](_0x555302['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x65e755){return logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x65'),util[_0x17ee('0x2a')](_0x65e755,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x65'),_0x17ee('0x64'));}break;case _0x17ee('0x67'):if(_0x384eaa[_0x17ee('0x32')]&&_0x384eaa[_0x17ee('0x2e')]){var _0x58106c=util[_0x17ee('0x41')]('%s:%s',_0x384eaa['username'],_0x384eaa[_0x17ee('0x2e')]);var _0x36d73a={'method':_0x17ee('0x33'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x384eaa[_0x17ee('0x68')]+_0x17ee('0x69'),'body':{'to':[_0x352d60[_0x17ee('0x21')]],'text':_0x352d60[_0x17ee('0xc')],'from':_0x384eaa[_0x17ee('0x21')],'applicationId':_0x384eaa['applicationId']},'headers':{'Authorization':util[_0x17ee('0x41')]('Basic\x20%s',new Buffer(_0x58106c)[_0x17ee('0x45')](_0x17ee('0x46')))},'json':!![]};rp(_0x36d73a)[_0x17ee('0x15')](function(_0x16c6df){if(_0x16c6df['id']){var _0x176f19={'messageId':_0x16c6df['id']};return _0xb3aa42[_0x17ee('0x16')](_0x176f19);}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x67'),util['inspect'](_0x16c6df,{'showHidden':![],'depth':null}));}})[_0x17ee('0x18')](function(_0x1857fa){logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x67'),util[_0x17ee('0x2a')](_0x1857fa,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x67'),_0x17ee('0x3a'));}break;case'intelepeer':if(_0x384eaa[_0x17ee('0x58')]){var _0x36884e={};var _0x49e8b7={'method':_0x17ee('0x33'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x17ee('0x6a')+_0x384eaa['apiKey'],'Content-Type':_0x17ee('0x54')},'body':{'from':_0x384eaa['phone'],'to':_0x352d60[_0x17ee('0x21')],'text':_0x352d60[_0x17ee('0xc')]},'json':!![]};return rp(_0x49e8b7)[_0x17ee('0x15')](function(_0x296303){if(_0x296303[_0x17ee('0x6b')]==0xca){_0x36884e[_0x17ee('0x6c')]=_0x296303;var _0x19b456={'method':_0x17ee('0x33'),'uri':_0x17ee('0x6d'),'headers':{'Authorization':_0x17ee('0x6a')+_0x384eaa[_0x17ee('0x58')],'Content-Type':_0x17ee('0x54')},'body':{'refid':_0x36884e[_0x17ee('0x6c')][_0x17ee('0x6e')]},'json':!![]};return rp(_0x19b456)[_0x17ee('0x15')](function(_0x48ea15){_0x36884e['status']=_0x48ea15;var _0x4a6af4={'messageId':_0x36884e[_0x17ee('0x6c')][_0x17ee('0x6e')],'read':!![]};return _0xb3aa42[_0x17ee('0x16')](_0x4a6af4);});}else{return logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate','intelepeer',util['inspect'](_0x296303,{'showHidden':![],'depth':null}));}})['catch'](function(_0x20e9c4){return logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x6f'),util['inspect'](_0x20e9c4,{'showHidden':![],'depth':null}));});}else{return logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x6f'),'Token\x20not\x20received');}break;}}})[_0x17ee('0x70')](function(){_0xa9902e();});}else{_0xa9902e();}}},'charset':'utf8mb4','collate':_0x17ee('0x71')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 377ed63..2bf3d44 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 _0x7762=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','redis','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util'];(function(_0x32179c,_0x32fb68){var _0xad3766=function(_0x597f3f){while(--_0x597f3f){_0x32179c['push'](_0x32179c['shift']());}};_0xad3766(++_0x32fb68);}(_0x7762,0x13f));var _0x2776=function(_0x2bd957,_0x16a7bc){_0x2bd957=_0x2bd957-0x0;var _0x29bc79=_0x7762[_0x2bd957];return _0x29bc79;};'use strict';var _=require('lodash');var util=require(_0x2776('0x0'));var moment=require(_0x2776('0x1'));var BPromise=require(_0x2776('0x2'));var rs=require(_0x2776('0x3'));var fs=require('fs');var Redis=require(_0x2776('0x4'));var db=require(_0x2776('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2776('0x6'))('rpc');var config=require(_0x2776('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2776('0x8')]['http']({'port':0x232a});config[_0x2776('0x9')]=_['defaults'](config[_0x2776('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2776('0xa'))(new Redis(config[_0x2776('0x9')]));require(_0x2776('0xb'))[_0x2776('0xc')](socket);function respondWithRpcPromise(_0x33d7e2,_0x1d562a,_0x49931c){return new BPromise(function(_0x2ac1a5,_0x30c848){return client[_0x2776('0xd')](_0x33d7e2,_0x49931c)[_0x2776('0xe')](function(_0x15b860){logger[_0x2776('0xf')](_0x2776('0x10'),_0x1d562a,_0x2776('0x11'));logger[_0x2776('0x12')](_0x2776('0x13'),_0x1d562a,_0x2776('0x11'),JSON[_0x2776('0x14')](_0x15b860));if(_0x15b860['error']){if(_0x15b860[_0x2776('0x15')][_0x2776('0x16')]===0x1f4){logger['error'](_0x2776('0x10'),_0x1d562a,_0x15b860[_0x2776('0x15')][_0x2776('0x17')]);return _0x30c848(_0x15b860[_0x2776('0x15')]['message']);}logger[_0x2776('0x15')](_0x2776('0x10'),_0x1d562a,_0x15b860[_0x2776('0x15')][_0x2776('0x17')]);return _0x2ac1a5(_0x15b860[_0x2776('0x15')]['message']);}else{logger[_0x2776('0xf')](_0x2776('0x10'),_0x1d562a,'request\x20sent');_0x2ac1a5(_0x15b860[_0x2776('0x18')]['message']);}})[_0x2776('0x19')](function(_0x512fae){logger[_0x2776('0x15')](_0x2776('0x10'),_0x1d562a,_0x512fae);_0x30c848(_0x512fae);});});}exports[_0x2776('0x1a')]=function(_0x149b8d){var _0x46fabd=this;return new Promise(function(_0x25ce97,_0x599a27){return db[_0x2776('0x1b')][_0x2776('0x1c')](_0x149b8d[_0x2776('0x1d')],{'raw':_0x149b8d['options']?_0x149b8d[_0x2776('0x1e')][_0x2776('0x1f')]===undefined?!![]:![]:!![]})[_0x2776('0xe')](function(_0x5585d9){logger[_0x2776('0xf')](_0x2776('0x1a'),_0x149b8d);logger['debug'](_0x2776('0x1a'),_0x149b8d,JSON['stringify'](_0x5585d9));_0x25ce97(_0x5585d9);})[_0x2776('0x19')](function(_0x4fbae1){logger['error'](_0x2776('0x1a'),_0x4fbae1['message'],_0x149b8d);_0x599a27(_0x46fabd['error'](0x1f4,_0x4fbae1[_0x2776('0x17')]));});});}; \ No newline at end of file +var _0xff73=['localhost','socket.io-emitter','register','request','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','info','catch','CreateSmsMessage','SmsMessage','create','options','raw','then','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','defaults','redis'];(function(_0x35c221,_0x19b148){var _0x484c4a=function(_0x38032c){while(--_0x38032c){_0x35c221['push'](_0x35c221['shift']());}};_0x484c4a(++_0x19b148);}(_0xff73,0x15e));var _0x3ff7=function(_0x5b445b,_0xd251da){_0x5b445b=_0x5b445b-0x0;var _0x1a40fe=_0xff73[_0x5b445b];return _0x1a40fe;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ff7('0x0'));var BPromise=require(_0x3ff7('0x1'));var rs=require(_0x3ff7('0x2'));var fs=require('fs');var Redis=require(_0x3ff7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3ff7('0x4'));var config=require(_0x3ff7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3ff7('0x6')][_0x3ff7('0x7')]({'port':0x232a});config['redis']=_[_0x3ff7('0x8')](config[_0x3ff7('0x9')],{'host':_0x3ff7('0xa'),'port':0x18eb});var socket=require(_0x3ff7('0xb'))(new Redis(config[_0x3ff7('0x9')]));require('./smsMessage.socket')[_0x3ff7('0xc')](socket);function respondWithRpcPromise(_0x7fb30b,_0x567d9e,_0x19f52a){return new BPromise(function(_0x2f98c9,_0x130e34){return client[_0x3ff7('0xd')](_0x7fb30b,_0x19f52a)['then'](function(_0x2d613d){logger['info']('SmsMessage,\x20%s,\x20%s',_0x567d9e,_0x3ff7('0xe'));logger[_0x3ff7('0xf')](_0x3ff7('0x10'),_0x567d9e,_0x3ff7('0xe'),JSON[_0x3ff7('0x11')](_0x2d613d));if(_0x2d613d[_0x3ff7('0x12')]){if(_0x2d613d['error'][_0x3ff7('0x13')]===0x1f4){logger[_0x3ff7('0x12')](_0x3ff7('0x14'),_0x567d9e,_0x2d613d[_0x3ff7('0x12')][_0x3ff7('0x15')]);return _0x130e34(_0x2d613d[_0x3ff7('0x12')][_0x3ff7('0x15')]);}logger[_0x3ff7('0x12')](_0x3ff7('0x14'),_0x567d9e,_0x2d613d[_0x3ff7('0x12')]['message']);return _0x2f98c9(_0x2d613d[_0x3ff7('0x12')][_0x3ff7('0x15')]);}else{logger[_0x3ff7('0x16')](_0x3ff7('0x14'),_0x567d9e,_0x3ff7('0xe'));_0x2f98c9(_0x2d613d['result']['message']);}})[_0x3ff7('0x17')](function(_0x1ccc1d){logger['error']('SmsMessage,\x20%s,\x20%s',_0x567d9e,_0x1ccc1d);_0x130e34(_0x1ccc1d);});});}exports[_0x3ff7('0x18')]=function(_0x14ace8){var _0x10170d=this;return new Promise(function(_0xfec504,_0x221cd7){return db[_0x3ff7('0x19')][_0x3ff7('0x1a')](_0x14ace8['body'],{'raw':_0x14ace8[_0x3ff7('0x1b')]?_0x14ace8[_0x3ff7('0x1b')][_0x3ff7('0x1c')]===undefined?!![]:![]:!![]})[_0x3ff7('0x1d')](function(_0x5efee6){logger[_0x3ff7('0x16')](_0x3ff7('0x18'),_0x14ace8);logger[_0x3ff7('0xf')](_0x3ff7('0x18'),_0x14ace8,JSON[_0x3ff7('0x11')](_0x5efee6));_0xfec504(_0x5efee6);})['catch'](function(_0x218521){logger[_0x3ff7('0x12')](_0x3ff7('0x18'),_0x218521[_0x3ff7('0x15')],_0x14ace8);_0x221cd7(_0x10170d[_0x3ff7('0x12')](0x1f4,_0x218521[_0x3ff7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 73b1839..909c87e 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 _0x1ab2=['save','remove','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x5a1345,_0xcc9fc3){var _0x27d577=function(_0x51a778){while(--_0x51a778){_0x5a1345['push'](_0x5a1345['shift']());}};_0x27d577(++_0xcc9fc3);}(_0x1ab2,0x1bf));var _0x21ab=function(_0x1e4bf0,_0x123fee){_0x1e4bf0=_0x1e4bf0-0x0;var _0x2fb89d=_0x1ab2[_0x1e4bf0];return _0x2fb89d;};'use strict';var SmsMessageEvents=require(_0x21ab('0x0'));var events=[_0x21ab('0x1'),_0x21ab('0x2'),'update'];function createListener(_0x42dd63,_0x5b4b81){return function(_0x52debf){_0x5b4b81[_0x21ab('0x3')](_0x42dd63,_0x52debf);};}function removeListener(_0x195f81,_0x36493a){return function(){SmsMessageEvents[_0x21ab('0x4')](_0x195f81,_0x36493a);};}exports[_0x21ab('0x5')]=function(_0x552b1a){for(var _0x20963e=0x0,_0x47a352=events[_0x21ab('0x6')];_0x20963e<_0x47a352;_0x20963e++){var _0x43a30d=events[_0x20963e];var _0x19d2d9=createListener(_0x21ab('0x7')+_0x43a30d,_0x552b1a);SmsMessageEvents['on'](_0x43a30d,_0x19d2d9);}}; \ No newline at end of file +var _0xefc4=['register','length','smsMessage:','./smsMessage.events','save','remove','emit','removeListener'];(function(_0x1c1d24,_0x28c7ad){var _0x3161f5=function(_0xfe030b){while(--_0xfe030b){_0x1c1d24['push'](_0x1c1d24['shift']());}};_0x3161f5(++_0x28c7ad);}(_0xefc4,0x123));var _0x4efc=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0xefc4[_0x441563];return _0x2369ec;};'use strict';var SmsMessageEvents=require(_0x4efc('0x0'));var events=[_0x4efc('0x1'),_0x4efc('0x2'),'update'];function createListener(_0x51331c,_0x56fd89){return function(_0x459ab9){_0x56fd89[_0x4efc('0x3')](_0x51331c,_0x459ab9);};}function removeListener(_0x2cfcd8,_0x112a61){return function(){SmsMessageEvents[_0x4efc('0x4')](_0x2cfcd8,_0x112a61);};}exports[_0x4efc('0x5')]=function(_0x2b5d0c){for(var _0xd03078=0x0,_0x4d23dd=events[_0x4efc('0x6')];_0xd03078<_0x4d23dd;_0xd03078++){var _0x2bbbab=events[_0xd03078];var _0x1d067d=createListener(_0x4efc('0x7')+_0x2bbbab,_0x2b5d0c);SmsMessageEvents['on'](_0x2bbbab,_0x1d067d);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 504ee00..343af1c 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 _0x0ab4=['post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents'];(function(_0x4dd524,_0x2247e5){var _0x482629=function(_0x1fc3a0){while(--_0x1fc3a0){_0x4dd524['push'](_0x4dd524['shift']());}};_0x482629(++_0x2247e5);}(_0x0ab4,0x1ce));var _0x40ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ab4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x40ab('0x0'));var util=require(_0x40ab('0x1'));var path=require(_0x40ab('0x2'));var timeout=require(_0x40ab('0x3'));var express=require(_0x40ab('0x4'));var router=express[_0x40ab('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x40ab('0x6'));var interaction=require(_0x40ab('0x7'));var config=require('../../config/environment');var controller=require(_0x40ab('0x8'));router[_0x40ab('0x9')]('/',auth[_0x40ab('0xa')](),controller['index']);router[_0x40ab('0x9')](_0x40ab('0xb'),auth[_0x40ab('0xa')](),controller['describe']);router[_0x40ab('0x9')](_0x40ab('0xc'),auth['isAuthenticated'](),controller[_0x40ab('0xd')]);router['get'](_0x40ab('0xe'),auth[_0x40ab('0xa')](),controller[_0x40ab('0xf')]);router[_0x40ab('0x9')](_0x40ab('0x10'),auth[_0x40ab('0xa')](),controller['getTeams']);router['get']('/:id/users',auth[_0x40ab('0xa')](),controller[_0x40ab('0x11')]);router[_0x40ab('0x12')]('/',auth['isAuthenticated'](),controller[_0x40ab('0x13')]);router[_0x40ab('0x12')](_0x40ab('0x10'),auth['isAuthenticated'](),controller[_0x40ab('0x14')]);router[_0x40ab('0x12')](_0x40ab('0x15'),auth[_0x40ab('0xa')](),controller[_0x40ab('0x16')]);router[_0x40ab('0x17')](_0x40ab('0xc'),auth[_0x40ab('0xa')](),controller[_0x40ab('0x18')]);router[_0x40ab('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x40ab('0x1a')]);router[_0x40ab('0x19')](_0x40ab('0x10'),auth[_0x40ab('0xa')](),controller[_0x40ab('0x1b')]);router[_0x40ab('0x19')](_0x40ab('0x15'),auth[_0x40ab('0xa')](),controller[_0x40ab('0x1c')]);module[_0x40ab('0x1d')]=router; \ No newline at end of file +var _0xe8dd=['express','Router','fs-extra','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0xf312f7,_0x41edc7){var _0x297f67=function(_0x3f0274){while(--_0x3f0274){_0xf312f7['push'](_0xf312f7['shift']());}};_0x297f67(++_0x41edc7);}(_0xe8dd,0x1e9));var _0xde8d=function(_0x4fe095,_0x182acb){_0x4fe095=_0x4fe095-0x0;var _0x6ceac4=_0xe8dd[_0x4fe095];return _0x6ceac4;};'use strict';var multer=require(_0xde8d('0x0'));var util=require(_0xde8d('0x1'));var path=require(_0xde8d('0x2'));var timeout=require(_0xde8d('0x3'));var express=require(_0xde8d('0x4'));var router=express[_0xde8d('0x5')]();var fs_extra=require(_0xde8d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xde8d('0x7'));var controller=require('./smsQueue.controller');router[_0xde8d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xde8d('0x8')](_0xde8d('0x9'),auth[_0xde8d('0xa')](),controller[_0xde8d('0xb')]);router['get'](_0xde8d('0xc'),auth['isAuthenticated'](),controller[_0xde8d('0xd')]);router[_0xde8d('0x8')](_0xde8d('0xe'),auth[_0xde8d('0xa')](),controller[_0xde8d('0xf')]);router[_0xde8d('0x8')](_0xde8d('0x10'),auth['isAuthenticated'](),controller[_0xde8d('0x11')]);router[_0xde8d('0x8')](_0xde8d('0x12'),auth[_0xde8d('0xa')](),controller[_0xde8d('0x13')]);router[_0xde8d('0x14')]('/',auth[_0xde8d('0xa')](),controller['create']);router[_0xde8d('0x14')](_0xde8d('0x10'),auth[_0xde8d('0xa')](),controller[_0xde8d('0x15')]);router[_0xde8d('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xde8d('0x16')]);router[_0xde8d('0x17')](_0xde8d('0xc'),auth[_0xde8d('0xa')](),controller[_0xde8d('0x18')]);router[_0xde8d('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xde8d('0x19')](_0xde8d('0x10'),auth[_0xde8d('0xa')](),controller[_0xde8d('0x1a')]);router[_0xde8d('0x19')](_0xde8d('0x12'),auth['isAuthenticated'](),controller[_0xde8d('0x1b')]);module[_0xde8d('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 72fd874..bfb1037 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 _0x188d=['rrmemory','beepall','exports','STRING','name','INTEGER'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0x188d,0xb0));var _0xd188=function(_0x117b82,_0x13554b){_0x117b82=_0x117b82-0x0;var _0x3a8975=_0x188d[_0x117b82];return _0x3a8975;};'use strict';var Sequelize=require('sequelize');module[_0xd188('0x0')]={'name':{'type':Sequelize[_0xd188('0x1')],'unique':_0xd188('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd188('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd188('0x4'),_0xd188('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xca87=['rrmemory','beepall','roundrobin','exports','name','INTEGER','ENUM'];(function(_0x1610eb,_0x481da3){var _0x2bd7d2=function(_0x29ae44){while(--_0x29ae44){_0x1610eb['push'](_0x1610eb['shift']());}};_0x2bd7d2(++_0x481da3);}(_0xca87,0x14c));var _0x7ca8=function(_0x2e7944,_0x549797){_0x2e7944=_0x2e7944-0x0;var _0x1305c2=_0xca87[_0x2e7944];return _0x1305c2;};'use strict';var Sequelize=require('sequelize');module[_0x7ca8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7ca8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7ca8('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7ca8('0x3')](_0x7ca8('0x4'),_0x7ca8('0x5'),_0x7ca8('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 51d7efc..21b4e9d 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 _0x548e=['index','map','SmsQueue','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','keys','includeAll','options','find','body','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','findOne','UserSmsQueue','User','findAndCountAll','UserId','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','omit','getAgents','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','SmsQueues','UserProfileResource','stack','name','send'];(function(_0x4f053d,_0x50c38c){var _0x377963=function(_0x23bf0d){while(--_0x23bf0d){_0x4f053d['push'](_0x4f053d['shift']());}};_0x377963(++_0x50c38c);}(_0x548e,0x1f4));var _0xe548=function(_0x1cf4f8,_0x32420c){_0x1cf4f8=_0x1cf4f8-0x0;var _0x46de13=_0x548e[_0x1cf4f8];return _0x46de13;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe548('0x0'));var jsonpatch=require(_0xe548('0x1'));var rp=require('request-promise');var moment=require(_0xe548('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe548('0x3'));var util=require(_0xe548('0x4'));var path=require(_0xe548('0x5'));var sox=require(_0xe548('0x6'));var csv=require(_0xe548('0x7'));var ejs=require(_0xe548('0x8'));var fs=require('fs');var fs_extra=require(_0xe548('0x9'));var _=require(_0xe548('0xa'));var squel=require(_0xe548('0xb'));var crypto=require(_0xe548('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe548('0xd'));var toCsv=require(_0xe548('0x7'));var querystring=require(_0xe548('0xe'));var Papa=require(_0xe548('0xf'));var Redis=require(_0xe548('0x10'));var authService=require(_0xe548('0x11'));var qs=require(_0xe548('0x12'));var as=require(_0xe548('0x13'));var hardwareService=require(_0xe548('0x14'));var logger=require(_0xe548('0x15'))(_0xe548('0x16'));var utils=require(_0xe548('0x17'));var config=require(_0xe548('0x18'));var licenseUtil=require(_0xe548('0x19'));var db=require(_0xe548('0x1a'))['db'];config[_0xe548('0x1b')]=_[_0xe548('0x1c')](config[_0xe548('0x1b')],{'host':_0xe548('0x1d'),'port':0x18eb});var socket=require(_0xe548('0x1e'))(new Redis(config[_0xe548('0x1b')]));require(_0xe548('0x1f'))[_0xe548('0x20')](socket);function respondWithStatusCode(_0x1bfa8e,_0x490587){_0x490587=_0x490587||0xcc;return function(_0x2059be){if(_0x2059be){return _0x1bfa8e[_0xe548('0x21')](_0x490587);}return _0x1bfa8e[_0xe548('0x22')](_0x490587)[_0xe548('0x23')]();};}function respondWithResult(_0x254e88,_0x49c8b1){_0x49c8b1=_0x49c8b1||0xc8;return function(_0x57c141){if(_0x57c141){return _0x254e88['status'](_0x49c8b1)['json'](_0x57c141);}};}function respondWithFilteredResult(_0x33b9e9,_0x4e4582){return function(_0x3de251){if(_0x3de251){var _0x1bb267=typeof _0x4e4582[_0xe548('0x24')]===_0xe548('0x25')&&typeof _0x4e4582[_0xe548('0x26')]===_0xe548('0x25');var _0x5d41fc=_0x3de251[_0xe548('0x27')];var _0x549542=_0x1bb267?0x0:_0x4e4582[_0xe548('0x24')];var _0x164da4=_0x1bb267?_0x3de251[_0xe548('0x27')]:_0x4e4582[_0xe548('0x24')]+_0x4e4582[_0xe548('0x26')];var _0x19b916;if(_0x164da4>=_0x5d41fc){_0x164da4=_0x5d41fc;_0x19b916=0xc8;}else{_0x19b916=0xce;}_0x33b9e9[_0xe548('0x22')](_0x19b916);return _0x33b9e9[_0xe548('0x28')](_0xe548('0x29'),_0x549542+'-'+_0x164da4+'/'+_0x5d41fc)[_0xe548('0x2a')](_0x3de251);}return null;};}function patchUpdates(_0x5c2747){return function(_0x5f4f2f){try{jsonpatch['apply'](_0x5f4f2f,_0x5c2747,!![]);}catch(_0x44631d){return BPromise[_0xe548('0x2b')](_0x44631d);}return _0x5f4f2f[_0xe548('0x2c')]();};}function saveUpdates(_0x281605,_0x1d264c){return function(_0x192a1b){if(_0x192a1b){return _0x192a1b[_0xe548('0x2d')](_0x281605)[_0xe548('0x2e')](function(_0x297794){return _0x297794;});}return null;};}function removeEntity(_0x18b226,_0x74ec82){return function(_0xd6cdd6){if(_0xd6cdd6){return _0xd6cdd6['destroy']()[_0xe548('0x2e')](function(){var _0x5431a4=_0xd6cdd6['get']({'plain':!![]});var _0x29121c=_0xe548('0x2f');return db[_0xe548('0x30')]['destroy']({'where':{'type':_0x29121c,'resourceId':_0x5431a4['id']}})['then'](function(){return _0xd6cdd6;});})[_0xe548('0x2e')](function(){_0x18b226['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bfddd,_0x44e358){return function(_0x3ec1e0){if(!_0x3ec1e0){_0x2bfddd[_0xe548('0x21')](0x194);}return _0x3ec1e0;};}function handleError(_0x5c024c,_0x298abf){_0x298abf=_0x298abf||0x1f4;return function(_0x147a12){logger['error'](_0x147a12[_0xe548('0x31')]);if(_0x147a12[_0xe548('0x32')]){delete _0x147a12[_0xe548('0x32')];}_0x5c024c[_0xe548('0x22')](_0x298abf)[_0xe548('0x33')](_0x147a12);};}exports[_0xe548('0x34')]=function(_0x39d6da,_0x23acbd){var _0x141cad={},_0xc509fb={},_0x55b559={'count':0x0,'rows':[]};var _0x2bb1a9=_[_0xe548('0x35')](db[_0xe548('0x36')][_0xe548('0x37')],function(_0x1a894f){return{'name':_0x1a894f[_0xe548('0x38')],'type':_0x1a894f[_0xe548('0x39')]['key']};});_0xc509fb['model']=_[_0xe548('0x35')](_0x2bb1a9,_0xe548('0x32'));_0xc509fb[_0xe548('0x3a')]=_['keys'](_0x39d6da[_0xe548('0x3a')]);_0xc509fb[_0xe548('0x3b')]=_[_0xe548('0x3c')](_0xc509fb[_0xe548('0x3d')],_0xc509fb[_0xe548('0x3a')]);_0x141cad[_0xe548('0x3e')]=_[_0xe548('0x3c')](_0xc509fb[_0xe548('0x3d')],qs['fields'](_0x39d6da[_0xe548('0x3a')][_0xe548('0x3f')]));_0x141cad[_0xe548('0x3e')]=_0x141cad[_0xe548('0x3e')][_0xe548('0x40')]?_0x141cad['attributes']:_0xc509fb['model'];if(!_0x39d6da['query'][_0xe548('0x41')](_0xe548('0x42'))){_0x141cad[_0xe548('0x26')]=qs[_0xe548('0x26')](_0x39d6da[_0xe548('0x3a')][_0xe548('0x26')]);_0x141cad[_0xe548('0x24')]=qs[_0xe548('0x24')](_0x39d6da['query'][_0xe548('0x24')]);}_0x141cad[_0xe548('0x43')]=qs[_0xe548('0x44')](_0x39d6da['query'][_0xe548('0x44')]);_0x141cad[_0xe548('0x45')]=qs[_0xe548('0x3b')](_[_0xe548('0x46')](_0x39d6da[_0xe548('0x3a')],_0xc509fb[_0xe548('0x3b')]),_0x2bb1a9);if(_0x39d6da[_0xe548('0x3a')][_0xe548('0x47')]){_0x141cad[_0xe548('0x45')]=_[_0xe548('0x48')](_0x141cad[_0xe548('0x45')],{'$or':_[_0xe548('0x35')](_0x2bb1a9,function(_0x254246){if(_0x254246[_0xe548('0x39')]!==_0xe548('0x49')){var _0x10146e={};_0x10146e[_0x254246['name']]={'$like':'%'+_0x39d6da[_0xe548('0x3a')][_0xe548('0x47')]+'%'};return _0x10146e;}})});}_0x141cad=_['merge']({},_0x141cad,_0x39d6da['options']);var _0xccb5a3={'where':_0x141cad['where']};return db[_0xe548('0x36')][_0xe548('0x27')](_0xccb5a3)[_0xe548('0x2e')](function(_0x20a0d1){_0x55b559[_0xe548('0x27')]=_0x20a0d1;if(_0x39d6da[_0xe548('0x3a')]['includeAll']){_0x141cad[_0xe548('0x4a')]=[{'all':!![]}];}return db[_0xe548('0x36')][_0xe548('0x4b')](_0x141cad);})[_0xe548('0x2e')](function(_0x2d5637){_0x55b559[_0xe548('0x4c')]=_0x2d5637;return _0x55b559;})[_0xe548('0x2e')](respondWithFilteredResult(_0x23acbd,_0x141cad))[_0xe548('0x4d')](handleError(_0x23acbd,null));};exports['show']=function(_0x2da0d5,_0x263bb0){var _0x122885={'raw':!![],'where':{'id':_0x2da0d5[_0xe548('0x4e')]['id']}},_0x455db3={};_0x455db3['model']=_[_0xe548('0x4f')](db['SmsQueue'][_0xe548('0x37')]);_0x455db3[_0xe548('0x3a')]=_[_0xe548('0x4f')](_0x2da0d5[_0xe548('0x3a')]);_0x455db3['filters']=_['intersection'](_0x455db3[_0xe548('0x3d')],_0x455db3[_0xe548('0x3a')]);_0x122885[_0xe548('0x3e')]=_[_0xe548('0x3c')](_0x455db3[_0xe548('0x3d')],qs[_0xe548('0x3f')](_0x2da0d5[_0xe548('0x3a')][_0xe548('0x3f')]));_0x122885[_0xe548('0x3e')]=_0x122885['attributes']['length']?_0x122885[_0xe548('0x3e')]:_0x455db3[_0xe548('0x3d')];if(_0x2da0d5[_0xe548('0x3a')][_0xe548('0x50')]){_0x122885[_0xe548('0x4a')]=[{'all':!![]}];}_0x122885=_[_0xe548('0x48')]({},_0x122885,_0x2da0d5[_0xe548('0x51')]);return db[_0xe548('0x36')][_0xe548('0x52')](_0x122885)[_0xe548('0x2e')](handleEntityNotFound(_0x263bb0,null))['then'](respondWithResult(_0x263bb0,null))[_0xe548('0x4d')](handleError(_0x263bb0,null));};exports['create']=function(_0x33c0e7,_0x1a44a1){return db[_0xe548('0x36')]['create'](_0x33c0e7[_0xe548('0x53')],{})[_0xe548('0x2e')](function(_0x1cdb6d){var _0x931095=_0x33c0e7[_0xe548('0x54')]['get']({'plain':!![]});if(!_0x931095)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x931095['role']===_0xe548('0x54')){var _0xd56caa=_0x1cdb6d[_0xe548('0x55')]({'plain':!![]});var _0x51fa21=_0xe548('0x2f');return db['UserProfileSection'][_0xe548('0x52')]({'where':{'name':_0x51fa21,'userProfileId':_0x931095[_0xe548('0x56')]},'raw':!![]})[_0xe548('0x2e')](function(_0x46616a){if(_0x46616a&&_0x46616a[_0xe548('0x57')]===0x0){return db[_0xe548('0x30')]['create']({'name':_0xd56caa[_0xe548('0x32')],'resourceId':_0xd56caa['id'],'type':_0x46616a['name'],'sectionId':_0x46616a['id']},{})[_0xe548('0x2e')](function(){return _0x1cdb6d;});}else{return _0x1cdb6d;}})[_0xe548('0x4d')](function(_0x255671){logger['error'](_0xe548('0x58'),_0x255671);throw _0x255671;});}return _0x1cdb6d;})[_0xe548('0x2e')](respondWithResult(_0x1a44a1,0xc9))[_0xe548('0x4d')](handleError(_0x1a44a1,null));};exports[_0xe548('0x2d')]=function(_0x9d8154,_0x26b4fa){if(_0x9d8154[_0xe548('0x53')]['id']){delete _0x9d8154[_0xe548('0x53')]['id'];}return db[_0xe548('0x36')][_0xe548('0x52')]({'where':{'id':_0x9d8154[_0xe548('0x4e')]['id']}})[_0xe548('0x2e')](handleEntityNotFound(_0x26b4fa,null))[_0xe548('0x2e')](saveUpdates(_0x9d8154[_0xe548('0x53')],null))[_0xe548('0x2e')](respondWithResult(_0x26b4fa,null))[_0xe548('0x4d')](handleError(_0x26b4fa,null));};exports[_0xe548('0x59')]=function(_0x30e6be,_0x2e252e){return db[_0xe548('0x36')]['find']({'where':{'id':_0x30e6be['params']['id']}})[_0xe548('0x2e')](handleEntityNotFound(_0x2e252e,null))[_0xe548('0x2e')](removeEntity(_0x2e252e,null))[_0xe548('0x4d')](handleError(_0x2e252e,null));};exports[_0xe548('0x5a')]=function(_0x4620ee,_0x48be3e){return db[_0xe548('0x36')][_0xe548('0x5a')]()['then'](respondWithResult(_0x48be3e,null))[_0xe548('0x4d')](handleError(_0x48be3e,null));};exports['getMembers']=function(_0x294b50,_0x375f05,_0x51b030){var _0x5469e5={'raw':!![],'where':{}},_0x15741a={},_0x56e089;return db['SmsQueue'][_0xe548('0x5b')]({'where':{'id':_0x294b50[_0xe548('0x4e')]['id']}})[_0xe548('0x2e')](handleEntityNotFound(_0x375f05,null))['then'](function(_0x570854){if(_0x570854){_0x56e089=_0x570854[_0xe548('0x55')]({'plain':!![]});_0x15741a[_0xe548('0x3d')]=_[_0xe548('0x4f')](db[_0xe548('0x5c')][_0xe548('0x37')]);_0x15741a['query']=_[_0xe548('0x4f')](_0x294b50[_0xe548('0x3a')]);_0x15741a[_0xe548('0x3b')]=_['intersection'](_0x15741a[_0xe548('0x3d')],_0x15741a[_0xe548('0x3a')]);_0x5469e5[_0xe548('0x3e')]=_[_0xe548('0x3c')](_0x15741a[_0xe548('0x3d')],qs[_0xe548('0x3f')](_0x294b50[_0xe548('0x3a')][_0xe548('0x3f')]));_0x5469e5[_0xe548('0x3e')]=_0x5469e5['attributes'][_0xe548('0x40')]?_0x5469e5[_0xe548('0x3e')]:_0x15741a[_0xe548('0x3d')];if(!_0x294b50[_0xe548('0x3a')][_0xe548('0x41')](_0xe548('0x42'))){_0x5469e5['limit']=qs[_0xe548('0x26')](_0x294b50['query'][_0xe548('0x26')]);_0x5469e5[_0xe548('0x24')]=qs[_0xe548('0x24')](_0x294b50['query'][_0xe548('0x24')]);}_0x5469e5[_0xe548('0x43')]=qs[_0xe548('0x44')](_0x294b50[_0xe548('0x3a')]['sort']);_0x5469e5[_0xe548('0x45')]=qs[_0xe548('0x3b')](_['pick'](_0x294b50[_0xe548('0x3a')],_0x15741a[_0xe548('0x3b')]));_0x5469e5[_0xe548('0x45')]['SmsQueueId']=_0x570854['id'];if(_0x294b50['query'][_0xe548('0x47')]){_0x5469e5['where']=_[_0xe548('0x48')](_0x5469e5[_0xe548('0x45')],{'$or':_[_0xe548('0x35')](_0x5469e5[_0xe548('0x3e')],function(_0x2faf6f){var _0x4dfdc0={};_0x4dfdc0[_0x2faf6f]={'$like':'%'+_0x294b50[_0xe548('0x3a')][_0xe548('0x47')]+'%'};return _0x4dfdc0;})});}_0x5469e5=_['merge']({},_0x5469e5,_0x294b50[_0xe548('0x51')]);return db[_0xe548('0x5c')][_0xe548('0x4b')](_0x5469e5);}})['then'](function(_0xdf17fa){if(_0xdf17fa){return db[_0xe548('0x5d')][_0xe548('0x5e')]({'where':{'id':_[_0xe548('0x35')](_0xdf17fa,_0xe548('0x5f')),'role':'agent'},'attributes':['id',_0xe548('0x32'),_0xe548('0x60'),_0xe548('0x61'),'createdAt']});}})[_0xe548('0x2e')](function(_0x45d3c0){if(_0x45d3c0){return{'count':_0x45d3c0['count'],'rows':_[_0xe548('0x35')](_0x45d3c0['rows'],function(_0x47bb20){return{'membername':_0x47bb20[_0xe548('0x32')],'UserId':_0x47bb20['id'],'queue_name':_0x56e089[_0xe548('0x32')],'SmsQueueId':_0x56e089['id'],'interface':util[_0xe548('0x62')](_0xe548('0x63'),_0xe548('0x64'),_0x47bb20[_0xe548('0x32')]),'penalty':0x0,'paused':_0x47bb20[_0xe548('0x60')],'createdAt':_0x47bb20[_0xe548('0x65')],'updatedAt':_0x47bb20[_0xe548('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe548('0x2e')](respondWithFilteredResult(_0x375f05,_0x5469e5))[_0xe548('0x4d')](handleError(_0x375f05,null));};exports[_0xe548('0x66')]=function(_0xd62793,_0x402747,_0x4c161a){var _0x1d8106={};var _0x590d5d={};var _0x12787e;var _0x49de7b;return db[_0xe548('0x36')][_0xe548('0x5b')]({'where':{'id':_0xd62793[_0xe548('0x4e')]['id']}})[_0xe548('0x2e')](handleEntityNotFound(_0x402747,null))[_0xe548('0x2e')](function(_0x22b32b){if(_0x22b32b){_0x12787e=_0x22b32b;_0x590d5d[_0xe548('0x3d')]=_['keys'](db[_0xe548('0x67')]['rawAttributes']);_0x590d5d[_0xe548('0x3a')]=_[_0xe548('0x4f')](_0xd62793[_0xe548('0x3a')]);_0x590d5d['filters']=_['intersection'](_0x590d5d['model'],_0x590d5d[_0xe548('0x3a')]);_0x1d8106[_0xe548('0x3e')]=_[_0xe548('0x3c')](_0x590d5d['model'],qs[_0xe548('0x3f')](_0xd62793[_0xe548('0x3a')][_0xe548('0x3f')]));_0x1d8106[_0xe548('0x3e')]=_0x1d8106[_0xe548('0x3e')]['length']?_0x1d8106['attributes']:_0x590d5d[_0xe548('0x3d')];_0x1d8106[_0xe548('0x43')]=qs[_0xe548('0x44')](_0xd62793[_0xe548('0x3a')][_0xe548('0x44')]);_0x1d8106[_0xe548('0x45')]=qs[_0xe548('0x3b')](_[_0xe548('0x46')](_0xd62793[_0xe548('0x3a')],_0x590d5d[_0xe548('0x3b')]));if(_0xd62793['query'][_0xe548('0x47')]){_0x1d8106['where']=_[_0xe548('0x48')](_0x1d8106[_0xe548('0x45')],{'$or':_['map'](_0x1d8106[_0xe548('0x3e')],function(_0x10205c){var _0xf2ab0={};_0xf2ab0[_0x10205c]={'$like':'%'+_0xd62793['query']['filter']+'%'};return _0xf2ab0;})});}_0x1d8106=_[_0xe548('0x48')]({},_0x1d8106,_0xd62793[_0xe548('0x51')]);return _0x12787e['getTeams'](_0x1d8106);}})[_0xe548('0x2e')](function(_0xb4b134){if(_0xb4b134){_0x49de7b=_0xb4b134[_0xe548('0x40')];if(!_0xd62793[_0xe548('0x3a')]['hasOwnProperty']('nolimit')){_0x1d8106[_0xe548('0x26')]=qs[_0xe548('0x26')](_0xd62793[_0xe548('0x3a')][_0xe548('0x26')]);_0x1d8106[_0xe548('0x24')]=qs[_0xe548('0x24')](_0xd62793[_0xe548('0x3a')]['offset']);}return _0x12787e[_0xe548('0x66')](_0x1d8106);}})[_0xe548('0x2e')](function(_0x5802f0){if(_0x5802f0){return _0x5802f0?{'count':_0x49de7b,'rows':_0x5802f0}:null;}})[_0xe548('0x2e')](respondWithResult(_0x402747,null))[_0xe548('0x4d')](handleError(_0x402747,null));};exports[_0xe548('0x68')]=function(_0x264377,_0x363e3c,_0x111aea){var _0x4690a3=_0x264377[_0xe548('0x53')][_0xe548('0x69')];return db['Team']['findAll']({'where':{'id':_0x4690a3},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe548('0x6a'),'attributes':['id',_0xe548('0x32'),_0xe548('0x6b'),_0xe548('0x6c'),_0xe548('0x6d')],'raw':!![]}]})[_0xe548('0x2e')](function(_0x176a27){if(_0x176a27){var _0x5b8251=_[_0xe548('0x6e')](_0x176a27,function(_0x2e4d6c){var _0x16274e=_0x2e4d6c['get']({'plain':!![]});return _0x16274e[_0xe548('0x6a')];});return db[_0xe548('0x36')]['find']({'where':{'id':_0x264377[_0xe548('0x4e')]['id']}})[_0xe548('0x2e')](function(_0x3e69bd){return db[_0xe548('0x6f')][_0xe548('0x70')](function(_0x473ae0){return _0x3e69bd[_0xe548('0x68')](_0x4690a3,{'transaction':_0x473ae0})['then'](function(){return BPromise[_0xe548('0x71')](_0x5b8251,function(_0x15a4fa){return db[_0xe548('0x5c')]['findOrCreate']({'where':{'UserId':_0x15a4fa['id'],'SmsQueueId':_0x264377[_0xe548('0x4e')]['id']},'transaction':_0x473ae0});});})[_0xe548('0x2e')](function(){_0x5b8251[_0xe548('0x72')](function(_0x598213){socket[_0xe548('0x73')](_0xe548('0x74'),{'UserId':_0x598213['id'],'SmsQueueId':_0x3e69bd['id']});});});});});}})[_0xe548('0x2e')](respondWithStatusCode(_0x363e3c,null))['catch'](handleError(_0x363e3c,null));};exports[_0xe548('0x75')]=function(_0x349186,_0x37c08e,_0x528a57){return db[_0xe548('0x67')][_0xe548('0x4b')]({'where':{'id':_0x349186[_0xe548('0x3a')][_0xe548('0x69')]},'attributes':['id'],'include':[{'model':db[_0xe548('0x5d')],'as':_0xe548('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xe548('0x2e')](handleEntityNotFound(_0x37c08e,null))['then'](function(_0x1f1602){var _0x2297ce=_[_0xe548('0x35')](_0x1f1602,'id');var _0xb6abfb=[];var _0x114409=[];var _0x48994e=squel[_0xe548('0x76')]();_0x48994e[_0xe548('0x77')](_0xe548('0x78'))['from']('team_has_sms_queues','tq')[_0xe548('0x79')](_0xe548('0x7a'),'ut',_0xe548('0x7b'))['where']('SmsQueueId\x20=\x20?',_0x349186[_0xe548('0x4e')]['id']);for(var _0x2ccdae=0x0;_0x2ccdae<_0x1f1602[_0xe548('0x40')];_0x2ccdae+=0x1){let _0x344f79=_0x1f1602[_0x2ccdae];for(var _0x22ae8a=0x0;_0x22ae8a<_0x344f79[_0xe548('0x6a')][_0xe548('0x40')];_0x22ae8a+=0x1){let _0x538736=_0x344f79[_0xe548('0x6a')][_0x22ae8a];var _0x1ee005=_0x48994e[_0xe548('0x7c')]();_0x1ee005['where'](_0xe548('0x7d'),_0x538736['id']);_0x114409['push'](db[_0xe548('0x6f')][_0xe548('0x3a')](_0x1ee005[_0xe548('0x7e')](),{'type':db[_0xe548('0x6f')][_0xe548('0x7f')]['SELECT']})[_0xe548('0x2e')](function(_0x92486b){if(_0x92486b['length']===0x1){return _0x538736['id'];}else{var _0x312ee5=_[_0xe548('0x80')](_[_0xe548('0x35')](_0x92486b,_0xe548('0x81')),function(_0x162068){return _['includes'](_0x2297ce,_0x162068);});if(_0x312ee5){return _0x538736['id'];}}}));}}return BPromise['all'](_0x114409)['then'](function(_0xebcda2){_0xb6abfb=_(_0xb6abfb)[_0xe548('0x82')](_0xebcda2)[_0xe548('0x83')]()[_0xe548('0x84')]();return db['SmsQueue'][_0xe548('0x52')]({'where':{'id':_0x349186[_0xe548('0x4e')]['id']}})[_0xe548('0x2e')](function(_0xa8f804){return db[_0xe548('0x6f')][_0xe548('0x70')](function(_0x364006){return _0xa8f804['removeTeams'](_0x349186[_0xe548('0x3a')][_0xe548('0x69')],{'transaction':_0x364006})[_0xe548('0x2e')](function(){if(!_[_0xe548('0x85')](_0xb6abfb)){return _0xa8f804[_0xe548('0x86')](_0xb6abfb,{'transaction':_0x364006});}})[_0xe548('0x2e')](function(){_0xb6abfb['forEach'](function(_0x38cb1e){socket['emit'](_0xe548('0x87'),{'UserId':_0x38cb1e,'SmsQueueId':_0xa8f804['id']});});});});});});})['then'](respondWithStatusCode(_0x37c08e,null))[_0xe548('0x4d')](handleError(_0x37c08e,null));};exports['addAgents']=function(_0x2963d4,_0x5a3283,_0x515cb0){return db[_0xe548('0x36')][_0xe548('0x52')]({'where':{'id':_0x2963d4[_0xe548('0x4e')]['id']}})[_0xe548('0x2e')](handleEntityNotFound(_0x5a3283,null))['then'](function(_0x375bd3){if(_0x375bd3){return _0x375bd3['addAgents'](_0x2963d4[_0xe548('0x53')][_0xe548('0x69')],_[_0xe548('0x88')](_0x2963d4['body'],[_0xe548('0x69'),'id'])||{})['spread'](function(_0x490053){for(var _0x8653c=0x0;_0x8653c<_0x2963d4['body'][_0xe548('0x69')][_0xe548('0x40')];_0x8653c+=0x1){socket[_0xe548('0x73')](_0xe548('0x74'),{'UserId':Number(_0x2963d4[_0xe548('0x53')][_0xe548('0x69')][_0x8653c]),'SmsQueueId':Number(_0x2963d4['params']['id'])});}return _0x490053;});}})[_0xe548('0x2e')](respondWithResult(_0x5a3283,null))['catch'](handleError(_0x5a3283,null));};exports[_0xe548('0x86')]=function(_0xf038f6,_0x42b7cd,_0xca7960){return db[_0xe548('0x36')][_0xe548('0x52')]({'where':{'id':_0xf038f6[_0xe548('0x4e')]['id']}})[_0xe548('0x2e')](handleEntityNotFound(_0x42b7cd,null))[_0xe548('0x2e')](function(_0x22feda){if(_0x22feda){return _0x22feda[_0xe548('0x86')](_0xf038f6['query'][_0xe548('0x69')])[_0xe548('0x2e')](function(){if(_['isArray'](_0xf038f6['query'][_0xe548('0x69')])){for(var _0x107236=0x0;_0x107236<_0xf038f6[_0xe548('0x3a')][_0xe548('0x69')]['length'];_0x107236+=0x1){socket[_0xe548('0x73')](_0xe548('0x87'),{'UserId':Number(_0xf038f6[_0xe548('0x3a')][_0xe548('0x69')][_0x107236]),'SmsQueueId':Number(_0xf038f6[_0xe548('0x4e')]['id'])});}}else{socket[_0xe548('0x73')]('userSmsQueue:remove',{'UserId':Number(_0xf038f6['query'][_0xe548('0x69')]),'SmsQueueId':Number(_0xf038f6[_0xe548('0x4e')]['id'])});}});}})[_0xe548('0x2e')](respondWithStatusCode(_0x42b7cd,null))[_0xe548('0x4d')](handleError(_0x42b7cd,null));};exports['getAgents']=function(_0x47b688,_0x30c417,_0x1ff057){var _0xce65b9={};var _0x4ecbac={};var _0x1aff16;var _0x43d2c4;return db[_0xe548('0x36')]['findOne']({'where':{'id':_0x47b688[_0xe548('0x4e')]['id']}})['then'](handleEntityNotFound(_0x30c417,null))[_0xe548('0x2e')](function(_0x181708){if(_0x181708){_0x1aff16=_0x181708;_0x4ecbac[_0xe548('0x3d')]=_[_0xe548('0x4f')](db[_0xe548('0x5d')][_0xe548('0x37')]);_0x4ecbac['query']=_['keys'](_0x47b688[_0xe548('0x3a')]);_0x4ecbac[_0xe548('0x3b')]=_['intersection'](_0x4ecbac[_0xe548('0x3d')],_0x4ecbac[_0xe548('0x3a')]);_0xce65b9[_0xe548('0x3e')]=_[_0xe548('0x3c')](_0x4ecbac[_0xe548('0x3d')],qs[_0xe548('0x3f')](_0x47b688[_0xe548('0x3a')]['fields']));_0xce65b9[_0xe548('0x3e')]=_0xce65b9[_0xe548('0x3e')][_0xe548('0x40')]?_0xce65b9[_0xe548('0x3e')]:_0x4ecbac[_0xe548('0x3d')];_0xce65b9[_0xe548('0x43')]=qs[_0xe548('0x44')](_0x47b688[_0xe548('0x3a')][_0xe548('0x44')]);_0xce65b9[_0xe548('0x45')]=qs[_0xe548('0x3b')](_['pick'](_0x47b688[_0xe548('0x3a')],_0x4ecbac[_0xe548('0x3b')]));if(_0x47b688['query'][_0xe548('0x47')]){_0xce65b9[_0xe548('0x45')]=_[_0xe548('0x48')](_0xce65b9[_0xe548('0x45')],{'$or':_[_0xe548('0x35')](_0xce65b9[_0xe548('0x3e')],function(_0x3c9bd5){var _0xd7469c={};_0xd7469c[_0x3c9bd5]={'$like':'%'+_0x47b688[_0xe548('0x3a')][_0xe548('0x47')]+'%'};return _0xd7469c;})});}_0xce65b9=_['merge']({},_0xce65b9,_0x47b688['options']);return _0x1aff16[_0xe548('0x89')](_0xce65b9);}})['then'](function(_0x1b6252){if(_0x1b6252){_0x43d2c4=_0x1b6252['length'];if(!_0x47b688[_0xe548('0x3a')][_0xe548('0x41')](_0xe548('0x42'))){_0xce65b9['limit']=qs[_0xe548('0x26')](_0x47b688[_0xe548('0x3a')]['limit']);_0xce65b9['offset']=qs[_0xe548('0x24')](_0x47b688['query']['offset']);}return _0x1aff16[_0xe548('0x89')](_0xce65b9);}})[_0xe548('0x2e')](function(_0x122b6a){if(_0x122b6a){return _0x122b6a?{'count':_0x43d2c4,'rows':_0x122b6a}:null;}})['then'](respondWithResult(_0x30c417,null))[_0xe548('0x4d')](handleError(_0x30c417,null));}; \ No newline at end of file +var _0x4295=['UserId','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','User','voicePause','interface','Agents','sequelize','transaction','each','userSmsQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_sms_queues','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','emit','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','SmsQueues','UserProfileResource','destroy','then','error','name','send','rawAttributes','fieldName','key','model','map','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','SmsQueue','count','include','findAll','catch','show','params','intersection','find','create','body','get','role','user','userProfileId','autoAssociation','update','describe','findOne','UserSmsQueue','SmsQueueId','findAndCountAll'];(function(_0xee7ee7,_0x2b9817){var _0x56a7c4=function(_0x4ce58a){while(--_0x4ce58a){_0xee7ee7['push'](_0xee7ee7['shift']());}};_0x56a7c4(++_0x2b9817);}(_0x4295,0x147));var _0x5429=function(_0x3b87f4,_0x112243){_0x3b87f4=_0x3b87f4-0x0;var _0x63d16e=_0x4295[_0x3b87f4];return _0x63d16e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5429('0x0'));var zipdir=require(_0x5429('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5429('0x2'));var moment=require(_0x5429('0x3'));var BPromise=require(_0x5429('0x4'));var Mustache=require(_0x5429('0x5'));var util=require(_0x5429('0x6'));var path=require('path');var sox=require(_0x5429('0x7'));var csv=require(_0x5429('0x8'));var ejs=require(_0x5429('0x9'));var fs=require('fs');var fs_extra=require(_0x5429('0xa'));var _=require(_0x5429('0xb'));var squel=require(_0x5429('0xc'));var crypto=require(_0x5429('0xd'));var jsforce=require(_0x5429('0xe'));var deskjs=require(_0x5429('0xf'));var toCsv=require(_0x5429('0x8'));var querystring=require('querystring');var Papa=require(_0x5429('0x10'));var Redis=require(_0x5429('0x11'));var authService=require(_0x5429('0x12'));var qs=require(_0x5429('0x13'));var as=require(_0x5429('0x14'));var hardwareService=require(_0x5429('0x15'));var logger=require('../../config/logger')(_0x5429('0x16'));var utils=require(_0x5429('0x17'));var config=require(_0x5429('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5429('0x19'))['db'];config[_0x5429('0x1a')]=_[_0x5429('0x1b')](config['redis'],{'host':_0x5429('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5429('0x1a')]));require(_0x5429('0x1d'))[_0x5429('0x1e')](socket);function respondWithStatusCode(_0x2f621c,_0xa00327){_0xa00327=_0xa00327||0xcc;return function(_0x26fd06){if(_0x26fd06){return _0x2f621c[_0x5429('0x1f')](_0xa00327);}return _0x2f621c[_0x5429('0x20')](_0xa00327)[_0x5429('0x21')]();};}function respondWithResult(_0x28ccf5,_0x240f6d){_0x240f6d=_0x240f6d||0xc8;return function(_0x23eb53){if(_0x23eb53){return _0x28ccf5[_0x5429('0x20')](_0x240f6d)[_0x5429('0x22')](_0x23eb53);}};}function respondWithFilteredResult(_0x56fc5f,_0x5a2a85){return function(_0x2604ea){if(_0x2604ea){var _0x2fac03=typeof _0x5a2a85[_0x5429('0x23')]===_0x5429('0x24')&&typeof _0x5a2a85[_0x5429('0x25')]==='undefined';var _0x6d9750=_0x2604ea['count'];var _0x4c1733=_0x2fac03?0x0:_0x5a2a85[_0x5429('0x23')];var _0x53c310=_0x2fac03?_0x2604ea['count']:_0x5a2a85[_0x5429('0x23')]+_0x5a2a85[_0x5429('0x25')];var _0x74341c;if(_0x53c310>=_0x6d9750){_0x53c310=_0x6d9750;_0x74341c=0xc8;}else{_0x74341c=0xce;}_0x56fc5f['status'](_0x74341c);return _0x56fc5f[_0x5429('0x26')]('Content-Range',_0x4c1733+'-'+_0x53c310+'/'+_0x6d9750)[_0x5429('0x22')](_0x2604ea);}return null;};}function patchUpdates(_0x31c8dc){return function(_0x3d46ff){try{jsonpatch[_0x5429('0x27')](_0x3d46ff,_0x31c8dc,!![]);}catch(_0x244713){return BPromise[_0x5429('0x28')](_0x244713);}return _0x3d46ff[_0x5429('0x29')]();};}function saveUpdates(_0x3e656c,_0x4e9d51){return function(_0x5358b1){if(_0x5358b1){return _0x5358b1['update'](_0x3e656c)['then'](function(_0x4ce40d){return _0x4ce40d;});}return null;};}function removeEntity(_0x2200a6,_0x17f9a7){return function(_0x21edb7){if(_0x21edb7){return _0x21edb7['destroy']()['then'](function(){var _0x4a2f41=_0x21edb7['get']({'plain':!![]});var _0x2282d4=_0x5429('0x2a');return db[_0x5429('0x2b')][_0x5429('0x2c')]({'where':{'type':_0x2282d4,'resourceId':_0x4a2f41['id']}})[_0x5429('0x2d')](function(){return _0x21edb7;});})[_0x5429('0x2d')](function(){_0x2200a6[_0x5429('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13efa8,_0x5ee24b){return function(_0x165cdb){if(!_0x165cdb){_0x13efa8[_0x5429('0x1f')](0x194);}return _0x165cdb;};}function handleError(_0x308e2c,_0x23cad7){_0x23cad7=_0x23cad7||0x1f4;return function(_0x1bbe27){logger[_0x5429('0x2e')](_0x1bbe27['stack']);if(_0x1bbe27['name']){delete _0x1bbe27[_0x5429('0x2f')];}_0x308e2c[_0x5429('0x20')](_0x23cad7)[_0x5429('0x30')](_0x1bbe27);};}exports['index']=function(_0x6981ea,_0x35c19e){var _0x53cea8={},_0x4c7363={},_0x2f10d3={'count':0x0,'rows':[]};var _0x181b51=_['map'](db['SmsQueue'][_0x5429('0x31')],function(_0x50dbc6){return{'name':_0x50dbc6[_0x5429('0x32')],'type':_0x50dbc6['type'][_0x5429('0x33')]};});_0x4c7363[_0x5429('0x34')]=_[_0x5429('0x35')](_0x181b51,_0x5429('0x2f'));_0x4c7363['query']=_[_0x5429('0x36')](_0x6981ea[_0x5429('0x37')]);_0x4c7363[_0x5429('0x38')]=_['intersection'](_0x4c7363[_0x5429('0x34')],_0x4c7363[_0x5429('0x37')]);_0x53cea8['attributes']=_['intersection'](_0x4c7363[_0x5429('0x34')],qs[_0x5429('0x39')](_0x6981ea[_0x5429('0x37')][_0x5429('0x39')]));_0x53cea8[_0x5429('0x3a')]=_0x53cea8[_0x5429('0x3a')][_0x5429('0x3b')]?_0x53cea8[_0x5429('0x3a')]:_0x4c7363['model'];if(!_0x6981ea[_0x5429('0x37')][_0x5429('0x3c')](_0x5429('0x3d'))){_0x53cea8[_0x5429('0x25')]=qs[_0x5429('0x25')](_0x6981ea['query'][_0x5429('0x25')]);_0x53cea8['offset']=qs[_0x5429('0x23')](_0x6981ea[_0x5429('0x37')]['offset']);}_0x53cea8[_0x5429('0x3e')]=qs['sort'](_0x6981ea[_0x5429('0x37')][_0x5429('0x3f')]);_0x53cea8['where']=qs['filters'](_[_0x5429('0x40')](_0x6981ea['query'],_0x4c7363[_0x5429('0x38')]),_0x181b51);if(_0x6981ea[_0x5429('0x37')][_0x5429('0x41')]){_0x53cea8[_0x5429('0x42')]=_['merge'](_0x53cea8[_0x5429('0x42')],{'$or':_[_0x5429('0x35')](_0x181b51,function(_0x5c2f4d){if(_0x5c2f4d[_0x5429('0x43')]!==_0x5429('0x44')){var _0x50883f={};_0x50883f[_0x5c2f4d[_0x5429('0x2f')]]={'$like':'%'+_0x6981ea[_0x5429('0x37')][_0x5429('0x41')]+'%'};return _0x50883f;}})});}_0x53cea8=_[_0x5429('0x45')]({},_0x53cea8,_0x6981ea[_0x5429('0x46')]);var _0x5ac8ef={'where':_0x53cea8[_0x5429('0x42')]};return db[_0x5429('0x47')][_0x5429('0x48')](_0x5ac8ef)[_0x5429('0x2d')](function(_0x5ec14f){_0x2f10d3['count']=_0x5ec14f;if(_0x6981ea[_0x5429('0x37')]['includeAll']){_0x53cea8[_0x5429('0x49')]=[{'all':!![]}];}return db['SmsQueue'][_0x5429('0x4a')](_0x53cea8);})[_0x5429('0x2d')](function(_0xf12e6b){_0x2f10d3['rows']=_0xf12e6b;return _0x2f10d3;})[_0x5429('0x2d')](respondWithFilteredResult(_0x35c19e,_0x53cea8))[_0x5429('0x4b')](handleError(_0x35c19e,null));};exports[_0x5429('0x4c')]=function(_0x5d6dce,_0x21c64f){var _0x45289e={'raw':!![],'where':{'id':_0x5d6dce[_0x5429('0x4d')]['id']}},_0x4769df={};_0x4769df[_0x5429('0x34')]=_[_0x5429('0x36')](db[_0x5429('0x47')][_0x5429('0x31')]);_0x4769df[_0x5429('0x37')]=_[_0x5429('0x36')](_0x5d6dce[_0x5429('0x37')]);_0x4769df[_0x5429('0x38')]=_[_0x5429('0x4e')](_0x4769df['model'],_0x4769df['query']);_0x45289e['attributes']=_[_0x5429('0x4e')](_0x4769df[_0x5429('0x34')],qs[_0x5429('0x39')](_0x5d6dce[_0x5429('0x37')][_0x5429('0x39')]));_0x45289e[_0x5429('0x3a')]=_0x45289e[_0x5429('0x3a')][_0x5429('0x3b')]?_0x45289e[_0x5429('0x3a')]:_0x4769df[_0x5429('0x34')];if(_0x5d6dce['query']['includeAll']){_0x45289e[_0x5429('0x49')]=[{'all':!![]}];}_0x45289e=_[_0x5429('0x45')]({},_0x45289e,_0x5d6dce[_0x5429('0x46')]);return db[_0x5429('0x47')][_0x5429('0x4f')](_0x45289e)[_0x5429('0x2d')](handleEntityNotFound(_0x21c64f,null))[_0x5429('0x2d')](respondWithResult(_0x21c64f,null))[_0x5429('0x4b')](handleError(_0x21c64f,null));};exports['create']=function(_0x4eead3,_0x28429f){return db[_0x5429('0x47')][_0x5429('0x50')](_0x4eead3[_0x5429('0x51')],{})[_0x5429('0x2d')](function(_0x7254a){var _0x129b2a=_0x4eead3['user'][_0x5429('0x52')]({'plain':!![]});if(!_0x129b2a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x129b2a[_0x5429('0x53')]===_0x5429('0x54')){var _0x3404bd=_0x7254a['get']({'plain':!![]});var _0x59d84f=_0x5429('0x2a');return db['UserProfileSection'][_0x5429('0x4f')]({'where':{'name':_0x59d84f,'userProfileId':_0x129b2a[_0x5429('0x55')]},'raw':!![]})[_0x5429('0x2d')](function(_0x293993){if(_0x293993&&_0x293993[_0x5429('0x56')]===0x0){return db['UserProfileResource'][_0x5429('0x50')]({'name':_0x3404bd[_0x5429('0x2f')],'resourceId':_0x3404bd['id'],'type':_0x293993[_0x5429('0x2f')],'sectionId':_0x293993['id']},{})[_0x5429('0x2d')](function(){return _0x7254a;});}else{return _0x7254a;}})[_0x5429('0x4b')](function(_0x54ad43){logger[_0x5429('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54ad43);throw _0x54ad43;});}return _0x7254a;})[_0x5429('0x2d')](respondWithResult(_0x28429f,0xc9))[_0x5429('0x4b')](handleError(_0x28429f,null));};exports[_0x5429('0x57')]=function(_0x151f64,_0x527312){if(_0x151f64[_0x5429('0x51')]['id']){delete _0x151f64[_0x5429('0x51')]['id'];}return db[_0x5429('0x47')]['find']({'where':{'id':_0x151f64[_0x5429('0x4d')]['id']}})[_0x5429('0x2d')](handleEntityNotFound(_0x527312,null))[_0x5429('0x2d')](saveUpdates(_0x151f64[_0x5429('0x51')],null))['then'](respondWithResult(_0x527312,null))[_0x5429('0x4b')](handleError(_0x527312,null));};exports['destroy']=function(_0x18fc87,_0x2068b4){return db[_0x5429('0x47')][_0x5429('0x4f')]({'where':{'id':_0x18fc87[_0x5429('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2068b4,null))[_0x5429('0x2d')](removeEntity(_0x2068b4,null))[_0x5429('0x4b')](handleError(_0x2068b4,null));};exports[_0x5429('0x58')]=function(_0x4436bc,_0x442eb3){return db[_0x5429('0x47')]['describe']()['then'](respondWithResult(_0x442eb3,null))['catch'](handleError(_0x442eb3,null));};exports['getMembers']=function(_0x4b901f,_0x40636f,_0x2c0339){var _0x337cb9={'raw':!![],'where':{}},_0x387e34={},_0x414b75;return db['SmsQueue'][_0x5429('0x59')]({'where':{'id':_0x4b901f[_0x5429('0x4d')]['id']}})[_0x5429('0x2d')](handleEntityNotFound(_0x40636f,null))[_0x5429('0x2d')](function(_0x27d6f7){if(_0x27d6f7){_0x414b75=_0x27d6f7[_0x5429('0x52')]({'plain':!![]});_0x387e34[_0x5429('0x34')]=_['keys'](db[_0x5429('0x5a')][_0x5429('0x31')]);_0x387e34['query']=_[_0x5429('0x36')](_0x4b901f[_0x5429('0x37')]);_0x387e34[_0x5429('0x38')]=_[_0x5429('0x4e')](_0x387e34['model'],_0x387e34['query']);_0x337cb9['attributes']=_[_0x5429('0x4e')](_0x387e34[_0x5429('0x34')],qs[_0x5429('0x39')](_0x4b901f[_0x5429('0x37')][_0x5429('0x39')]));_0x337cb9[_0x5429('0x3a')]=_0x337cb9[_0x5429('0x3a')][_0x5429('0x3b')]?_0x337cb9[_0x5429('0x3a')]:_0x387e34['model'];if(!_0x4b901f['query'][_0x5429('0x3c')](_0x5429('0x3d'))){_0x337cb9[_0x5429('0x25')]=qs['limit'](_0x4b901f[_0x5429('0x37')][_0x5429('0x25')]);_0x337cb9[_0x5429('0x23')]=qs['offset'](_0x4b901f['query']['offset']);}_0x337cb9[_0x5429('0x3e')]=qs['sort'](_0x4b901f['query']['sort']);_0x337cb9[_0x5429('0x42')]=qs[_0x5429('0x38')](_[_0x5429('0x40')](_0x4b901f['query'],_0x387e34[_0x5429('0x38')]));_0x337cb9['where'][_0x5429('0x5b')]=_0x27d6f7['id'];if(_0x4b901f['query']['filter']){_0x337cb9[_0x5429('0x42')]=_[_0x5429('0x45')](_0x337cb9[_0x5429('0x42')],{'$or':_[_0x5429('0x35')](_0x337cb9[_0x5429('0x3a')],function(_0x37ac82){var _0x2c7ac9={};_0x2c7ac9[_0x37ac82]={'$like':'%'+_0x4b901f[_0x5429('0x37')][_0x5429('0x41')]+'%'};return _0x2c7ac9;})});}_0x337cb9=_[_0x5429('0x45')]({},_0x337cb9,_0x4b901f['options']);return db[_0x5429('0x5a')][_0x5429('0x4a')](_0x337cb9);}})[_0x5429('0x2d')](function(_0x393695){if(_0x393695){return db['User'][_0x5429('0x5c')]({'where':{'id':_['map'](_0x393695,_0x5429('0x5d')),'role':'agent'},'attributes':['id',_0x5429('0x2f'),_0x5429('0x5e'),_0x5429('0x5f'),'createdAt']});}})[_0x5429('0x2d')](function(_0x25a497){if(_0x25a497){return{'count':_0x25a497['count'],'rows':_[_0x5429('0x35')](_0x25a497['rows'],function(_0xb6498c){return{'membername':_0xb6498c[_0x5429('0x2f')],'UserId':_0xb6498c['id'],'queue_name':_0x414b75[_0x5429('0x2f')],'SmsQueueId':_0x414b75['id'],'interface':util[_0x5429('0x60')](_0x5429('0x61'),_0x5429('0x62'),_0xb6498c[_0x5429('0x2f')]),'penalty':0x0,'paused':_0xb6498c[_0x5429('0x5e')],'createdAt':_0xb6498c[_0x5429('0x63')],'updatedAt':_0xb6498c[_0x5429('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5429('0x2d')](respondWithFilteredResult(_0x40636f,_0x337cb9))['catch'](handleError(_0x40636f,null));};exports[_0x5429('0x64')]=function(_0x1f649b,_0x4af7db,_0x471cec){var _0x2c215b={};var _0xc26c19={};var _0x4fa86a;var _0x1377ea;return db[_0x5429('0x47')][_0x5429('0x59')]({'where':{'id':_0x1f649b[_0x5429('0x4d')]['id']}})[_0x5429('0x2d')](handleEntityNotFound(_0x4af7db,null))[_0x5429('0x2d')](function(_0x3f5309){if(_0x3f5309){_0x4fa86a=_0x3f5309;_0xc26c19[_0x5429('0x34')]=_[_0x5429('0x36')](db[_0x5429('0x65')][_0x5429('0x31')]);_0xc26c19['query']=_['keys'](_0x1f649b[_0x5429('0x37')]);_0xc26c19[_0x5429('0x38')]=_[_0x5429('0x4e')](_0xc26c19[_0x5429('0x34')],_0xc26c19['query']);_0x2c215b['attributes']=_[_0x5429('0x4e')](_0xc26c19[_0x5429('0x34')],qs['fields'](_0x1f649b[_0x5429('0x37')][_0x5429('0x39')]));_0x2c215b[_0x5429('0x3a')]=_0x2c215b[_0x5429('0x3a')][_0x5429('0x3b')]?_0x2c215b[_0x5429('0x3a')]:_0xc26c19[_0x5429('0x34')];_0x2c215b['order']=qs[_0x5429('0x3f')](_0x1f649b[_0x5429('0x37')][_0x5429('0x3f')]);_0x2c215b[_0x5429('0x42')]=qs[_0x5429('0x38')](_[_0x5429('0x40')](_0x1f649b[_0x5429('0x37')],_0xc26c19[_0x5429('0x38')]));if(_0x1f649b['query']['filter']){_0x2c215b[_0x5429('0x42')]=_[_0x5429('0x45')](_0x2c215b[_0x5429('0x42')],{'$or':_['map'](_0x2c215b[_0x5429('0x3a')],function(_0x1b54da){var _0x365e3d={};_0x365e3d[_0x1b54da]={'$like':'%'+_0x1f649b[_0x5429('0x37')]['filter']+'%'};return _0x365e3d;})});}_0x2c215b=_[_0x5429('0x45')]({},_0x2c215b,_0x1f649b[_0x5429('0x46')]);return _0x4fa86a[_0x5429('0x64')](_0x2c215b);}})['then'](function(_0xa56cc4){if(_0xa56cc4){_0x1377ea=_0xa56cc4[_0x5429('0x3b')];if(!_0x1f649b[_0x5429('0x37')][_0x5429('0x3c')](_0x5429('0x3d'))){_0x2c215b['limit']=qs[_0x5429('0x25')](_0x1f649b[_0x5429('0x37')][_0x5429('0x25')]);_0x2c215b[_0x5429('0x23')]=qs[_0x5429('0x23')](_0x1f649b[_0x5429('0x37')][_0x5429('0x23')]);}return _0x4fa86a['getTeams'](_0x2c215b);}})[_0x5429('0x2d')](function(_0x276b75){if(_0x276b75){return _0x276b75?{'count':_0x1377ea,'rows':_0x276b75}:null;}})['then'](respondWithResult(_0x4af7db,null))[_0x5429('0x4b')](handleError(_0x4af7db,null));};exports[_0x5429('0x66')]=function(_0xe72679,_0x4e604a,_0x400ec4){var _0x401626=_0xe72679[_0x5429('0x51')]['ids'];return db['Team']['findAll']({'where':{'id':_0x401626},'attributes':['id'],'include':[{'model':db[_0x5429('0x67')],'as':'Agents','attributes':['id',_0x5429('0x2f'),'online',_0x5429('0x68'),_0x5429('0x69')],'raw':!![]}]})['then'](function(_0x5950cf){if(_0x5950cf){var _0x916640=_['flatMap'](_0x5950cf,function(_0x2dd195){var _0x1e7ed3=_0x2dd195[_0x5429('0x52')]({'plain':!![]});return _0x1e7ed3[_0x5429('0x6a')];});return db['SmsQueue'][_0x5429('0x4f')]({'where':{'id':_0xe72679['params']['id']}})['then'](function(_0x1d777c){return db[_0x5429('0x6b')][_0x5429('0x6c')](function(_0x22a762){return _0x1d777c[_0x5429('0x66')](_0x401626,{'transaction':_0x22a762})[_0x5429('0x2d')](function(){return BPromise[_0x5429('0x6d')](_0x916640,function(_0x299514){return db[_0x5429('0x5a')]['findOrCreate']({'where':{'UserId':_0x299514['id'],'SmsQueueId':_0xe72679[_0x5429('0x4d')]['id']},'transaction':_0x22a762});});})[_0x5429('0x2d')](function(){_0x916640['forEach'](function(_0x50f8b0){socket['emit'](_0x5429('0x6e'),{'UserId':_0x50f8b0['id'],'SmsQueueId':_0x1d777c['id']});});});});});}})[_0x5429('0x2d')](respondWithStatusCode(_0x4e604a,null))[_0x5429('0x4b')](handleError(_0x4e604a,null));};exports[_0x5429('0x6f')]=function(_0x2417ba,_0x23faa0,_0x2db154){return db['Team']['findAll']({'where':{'id':_0x2417ba[_0x5429('0x37')][_0x5429('0x70')]},'attributes':['id'],'include':[{'model':db[_0x5429('0x67')],'as':_0x5429('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x5429('0x2d')](handleEntityNotFound(_0x23faa0,null))[_0x5429('0x2d')](function(_0x55e8fc){var _0x514b83=_[_0x5429('0x35')](_0x55e8fc,'id');var _0x4ff269=[];var _0x51f9c8=[];var _0xd44647=squel[_0x5429('0x71')]();_0xd44647['field'](_0x5429('0x72'))[_0x5429('0x73')](_0x5429('0x74'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5429('0x42')](_0x5429('0x75'),_0x2417ba[_0x5429('0x4d')]['id']);for(var _0x28a46f=0x0;_0x28a46f<_0x55e8fc[_0x5429('0x3b')];_0x28a46f+=0x1){let _0x488179=_0x55e8fc[_0x28a46f];for(var _0x423871=0x0;_0x423871<_0x488179[_0x5429('0x6a')][_0x5429('0x3b')];_0x423871+=0x1){let _0x42a199=_0x488179[_0x5429('0x6a')][_0x423871];var _0x430ca3=_0xd44647[_0x5429('0x76')]();_0x430ca3[_0x5429('0x42')](_0x5429('0x77'),_0x42a199['id']);_0x51f9c8['push'](db[_0x5429('0x6b')][_0x5429('0x37')](_0x430ca3[_0x5429('0x78')](),{'type':db[_0x5429('0x6b')][_0x5429('0x79')][_0x5429('0x7a')]})[_0x5429('0x2d')](function(_0x361a08){if(_0x361a08[_0x5429('0x3b')]===0x1){return _0x42a199['id'];}else{var _0x4560ca=_[_0x5429('0x7b')](_[_0x5429('0x35')](_0x361a08,_0x5429('0x7c')),function(_0x43d23f){return _[_0x5429('0x7d')](_0x514b83,_0x43d23f);});if(_0x4560ca){return _0x42a199['id'];}}}));}}return BPromise[_0x5429('0x7e')](_0x51f9c8)[_0x5429('0x2d')](function(_0x2fd200){_0x4ff269=_(_0x4ff269)[_0x5429('0x7f')](_0x2fd200)[_0x5429('0x80')]()[_0x5429('0x81')]();return db['SmsQueue'][_0x5429('0x4f')]({'where':{'id':_0x2417ba['params']['id']}})[_0x5429('0x2d')](function(_0x147d2f){return db[_0x5429('0x6b')]['transaction'](function(_0x24c399){return _0x147d2f[_0x5429('0x6f')](_0x2417ba['query'][_0x5429('0x70')],{'transaction':_0x24c399})[_0x5429('0x2d')](function(){if(!_[_0x5429('0x82')](_0x4ff269)){return _0x147d2f[_0x5429('0x83')](_0x4ff269,{'transaction':_0x24c399});}})[_0x5429('0x2d')](function(){_0x4ff269[_0x5429('0x84')](function(_0x2aefe2){socket[_0x5429('0x85')]('userSmsQueue:remove',{'UserId':_0x2aefe2,'SmsQueueId':_0x147d2f['id']});});});});});});})['then'](respondWithStatusCode(_0x23faa0,null))[_0x5429('0x4b')](handleError(_0x23faa0,null));};exports[_0x5429('0x86')]=function(_0x40866c,_0x422bc2,_0x4684cf){return db[_0x5429('0x47')][_0x5429('0x4f')]({'where':{'id':_0x40866c['params']['id']}})['then'](handleEntityNotFound(_0x422bc2,null))[_0x5429('0x2d')](function(_0x4c55b4){if(_0x4c55b4){return _0x4c55b4[_0x5429('0x86')](_0x40866c['body']['ids'],_[_0x5429('0x87')](_0x40866c['body'],[_0x5429('0x70'),'id'])||{})[_0x5429('0x88')](function(_0x3ffb23){for(var _0x411823=0x0;_0x411823<_0x40866c[_0x5429('0x51')]['ids'][_0x5429('0x3b')];_0x411823+=0x1){socket[_0x5429('0x85')](_0x5429('0x6e'),{'UserId':Number(_0x40866c[_0x5429('0x51')][_0x5429('0x70')][_0x411823]),'SmsQueueId':Number(_0x40866c[_0x5429('0x4d')]['id'])});}return _0x3ffb23;});}})[_0x5429('0x2d')](respondWithResult(_0x422bc2,null))[_0x5429('0x4b')](handleError(_0x422bc2,null));};exports[_0x5429('0x83')]=function(_0x537151,_0x30084,_0x8b2b89){return db['SmsQueue'][_0x5429('0x4f')]({'where':{'id':_0x537151[_0x5429('0x4d')]['id']}})[_0x5429('0x2d')](handleEntityNotFound(_0x30084,null))[_0x5429('0x2d')](function(_0x45ab8f){if(_0x45ab8f){return _0x45ab8f[_0x5429('0x83')](_0x537151['query'][_0x5429('0x70')])[_0x5429('0x2d')](function(){if(_[_0x5429('0x89')](_0x537151[_0x5429('0x37')]['ids'])){for(var _0x5660f3=0x0;_0x5660f3<_0x537151[_0x5429('0x37')][_0x5429('0x70')][_0x5429('0x3b')];_0x5660f3+=0x1){socket[_0x5429('0x85')](_0x5429('0x8a'),{'UserId':Number(_0x537151[_0x5429('0x37')][_0x5429('0x70')][_0x5660f3]),'SmsQueueId':Number(_0x537151[_0x5429('0x4d')]['id'])});}}else{socket['emit'](_0x5429('0x8a'),{'UserId':Number(_0x537151[_0x5429('0x37')][_0x5429('0x70')]),'SmsQueueId':Number(_0x537151[_0x5429('0x4d')]['id'])});}});}})[_0x5429('0x2d')](respondWithStatusCode(_0x30084,null))[_0x5429('0x4b')](handleError(_0x30084,null));};exports['getAgents']=function(_0x3c1b08,_0x498326,_0x2106ab){var _0x5118f6={};var _0x5bd516={};var _0x5b5bd1;var _0x184c80;return db[_0x5429('0x47')][_0x5429('0x59')]({'where':{'id':_0x3c1b08[_0x5429('0x4d')]['id']}})[_0x5429('0x2d')](handleEntityNotFound(_0x498326,null))[_0x5429('0x2d')](function(_0x1e67a7){if(_0x1e67a7){_0x5b5bd1=_0x1e67a7;_0x5bd516['model']=_['keys'](db['User'][_0x5429('0x31')]);_0x5bd516[_0x5429('0x37')]=_[_0x5429('0x36')](_0x3c1b08[_0x5429('0x37')]);_0x5bd516['filters']=_[_0x5429('0x4e')](_0x5bd516[_0x5429('0x34')],_0x5bd516['query']);_0x5118f6[_0x5429('0x3a')]=_[_0x5429('0x4e')](_0x5bd516[_0x5429('0x34')],qs[_0x5429('0x39')](_0x3c1b08[_0x5429('0x37')][_0x5429('0x39')]));_0x5118f6['attributes']=_0x5118f6['attributes']['length']?_0x5118f6[_0x5429('0x3a')]:_0x5bd516['model'];_0x5118f6[_0x5429('0x3e')]=qs[_0x5429('0x3f')](_0x3c1b08[_0x5429('0x37')]['sort']);_0x5118f6[_0x5429('0x42')]=qs[_0x5429('0x38')](_[_0x5429('0x40')](_0x3c1b08[_0x5429('0x37')],_0x5bd516['filters']));if(_0x3c1b08[_0x5429('0x37')][_0x5429('0x41')]){_0x5118f6[_0x5429('0x42')]=_[_0x5429('0x45')](_0x5118f6['where'],{'$or':_[_0x5429('0x35')](_0x5118f6[_0x5429('0x3a')],function(_0x5782ea){var _0x4f73a1={};_0x4f73a1[_0x5782ea]={'$like':'%'+_0x3c1b08['query'][_0x5429('0x41')]+'%'};return _0x4f73a1;})});}_0x5118f6=_[_0x5429('0x45')]({},_0x5118f6,_0x3c1b08[_0x5429('0x46')]);return _0x5b5bd1[_0x5429('0x8b')](_0x5118f6);}})[_0x5429('0x2d')](function(_0x5bfa3e){if(_0x5bfa3e){_0x184c80=_0x5bfa3e[_0x5429('0x3b')];if(!_0x3c1b08[_0x5429('0x37')][_0x5429('0x3c')](_0x5429('0x3d'))){_0x5118f6['limit']=qs[_0x5429('0x25')](_0x3c1b08['query'][_0x5429('0x25')]);_0x5118f6['offset']=qs[_0x5429('0x23')](_0x3c1b08[_0x5429('0x37')][_0x5429('0x23')]);}return _0x5b5bd1[_0x5429('0x8b')](_0x5118f6);}})[_0x5429('0x2d')](function(_0x4c8edc){if(_0x4c8edc){return _0x4c8edc?{'count':_0x184c80,'rows':_0x4c8edc}:null;}})[_0x5429('0x2d')](respondWithResult(_0x498326,null))[_0x5429('0x4b')](handleError(_0x498326,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 344acae..026c3dc 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 _0x6fb4=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x465ea2,_0x3e5a13){var _0x4ba338=function(_0x571f25){while(--_0x571f25){_0x465ea2['push'](_0x465ea2['shift']());}};_0x4ba338(++_0x3e5a13);}(_0x6fb4,0x1ab));var _0x46fb=function(_0x1b1267,_0x5b37ee){_0x1b1267=_0x1b1267-0x0;var _0x42c68f=_0x6fb4[_0x1b1267];return _0x42c68f;};'use strict';var EventEmitter=require(_0x46fb('0x0'));var SmsQueue=require(_0x46fb('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x46fb('0x2'),'afterUpdate':_0x46fb('0x3'),'afterDestroy':_0x46fb('0x4')};function emitEvent(_0x15f9fd){return function(_0x716a8,_0x131173,_0x18b432){SmsQueueEvents[_0x46fb('0x5')](_0x15f9fd+':'+_0x716a8['id'],_0x716a8);SmsQueueEvents[_0x46fb('0x5')](_0x15f9fd,_0x716a8);_0x18b432(null);};}for(var e in events){if(events[_0x46fb('0x6')](e)){var event=events[e];SmsQueue[_0x46fb('0x7')](e,emitEvent(event));}}module[_0x46fb('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x8bb1=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x1731c7,_0x45b1c2){var _0xe9c5d=function(_0x4c385e){while(--_0x4c385e){_0x1731c7['push'](_0x1731c7['shift']());}};_0xe9c5d(++_0x45b1c2);}(_0x8bb1,0x12c));var _0x18bb=function(_0x33cec5,_0x4327fa){_0x33cec5=_0x33cec5-0x0;var _0x3901e5=_0x8bb1[_0x33cec5];return _0x3901e5;};'use strict';var EventEmitter=require(_0x18bb('0x0'));var SmsQueue=require(_0x18bb('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x18bb('0x2')](0x0);var events={'afterCreate':_0x18bb('0x3'),'afterUpdate':_0x18bb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x401e72){return function(_0x2ef9b2,_0x3293a9,_0x17544b){SmsQueueEvents[_0x18bb('0x5')](_0x401e72+':'+_0x2ef9b2['id'],_0x2ef9b2);SmsQueueEvents[_0x18bb('0x5')](_0x401e72,_0x2ef9b2);_0x17544b(null);};}for(var e in events){if(events[_0x18bb('0x6')](e)){var event=events[e];SmsQueue[_0x18bb('0x7')](e,emitEvent(event));}}module[_0x18bb('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index d20b800..42924d3 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 _0x21ed=['../../config/environment','exports','define','SmsQueue','util','api','moment','bluebird','request-promise'];(function(_0x517eaf,_0x125750){var _0x381e69=function(_0x2a5241){while(--_0x2a5241){_0x517eaf['push'](_0x517eaf['shift']());}};_0x381e69(++_0x125750);}(_0x21ed,0x175));var _0xd21e=function(_0x177385,_0x323024){_0x177385=_0x177385-0x0;var _0x1d4376=_0x21ed[_0x177385];return _0x1d4376;};'use strict';var _=require('lodash');var util=require(_0xd21e('0x0'));var logger=require('../../config/logger')(_0xd21e('0x1'));var moment=require(_0xd21e('0x2'));var BPromise=require(_0xd21e('0x3'));var rp=require(_0xd21e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd21e('0x5'));var attributes=require('./smsQueue.attributes');module[_0xd21e('0x6')]=function(_0x227c60,_0x2402e6){return _0x227c60[_0xd21e('0x7')](_0xd21e('0x8'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x570f=['lodash','util','../../config/logger','api','bluebird','request-promise','path','./smsQueue.attributes','exports','define','sms_queues'];(function(_0x5c1401,_0x3ec444){var _0x50cf10=function(_0xe0c4b){while(--_0xe0c4b){_0x5c1401['push'](_0x5c1401['shift']());}};_0x50cf10(++_0x3ec444);}(_0x570f,0x176));var _0xf570=function(_0x559e51,_0x2836f7){_0x559e51=_0x559e51-0x0;var _0x3d228c=_0x570f[_0x559e51];return _0x3d228c;};'use strict';var _=require(_0xf570('0x0'));var util=require(_0xf570('0x1'));var logger=require(_0xf570('0x2'))(_0xf570('0x3'));var moment=require('moment');var BPromise=require(_0xf570('0x4'));var rp=require(_0xf570('0x5'));var fs=require('fs');var path=require(_0xf570('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf570('0x7'));module[_0xf570('0x8')]=function(_0x5a1adf,_0x5136e8){return _0x5a1adf[_0xf570('0x9')]('SmsQueue',attributes,{'tableName':_0xf570('0xa'),'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 2451e99..acda46e 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 _0xd197=['code','message','GetSmsQueue','SmsQueue','findAll','options','where','limit','include','map','attributes','model','catch','ShowSmsQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ee1e2,_0x59ea6a){var _0x23c18d=function(_0x3d8ebf){while(--_0x3d8ebf){_0x1ee1e2['push'](_0x1ee1e2['shift']());}};_0x23c18d(++_0x59ea6a);}(_0xd197,0x18a));var _0x7d19=function(_0x187258,_0x53c81f){_0x187258=_0x187258-0x0;var _0x29b4a8=_0xd197[_0x187258];return _0x29b4a8;};'use strict';var _=require(_0x7d19('0x0'));var util=require(_0x7d19('0x1'));var moment=require(_0x7d19('0x2'));var BPromise=require(_0x7d19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d19('0x4'));var db=require(_0x7d19('0x5'))['db'];var utils=require(_0x7d19('0x6'));var logger=require('../../config/logger')(_0x7d19('0x7'));var config=require(_0x7d19('0x8'));var jayson=require(_0x7d19('0x9'));var client=jayson[_0x7d19('0xa')][_0x7d19('0xb')]({'port':0x232a});config['redis']=_[_0x7d19('0xc')](config[_0x7d19('0xd')],{'host':_0x7d19('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7d19('0xf'))[_0x7d19('0x10')](socket);function respondWithRpcPromise(_0x5484ea,_0x209e01,_0x3919e2){return new BPromise(function(_0x2a18a3,_0x5b09c0){return client[_0x7d19('0x11')](_0x5484ea,_0x3919e2)[_0x7d19('0x12')](function(_0x4131db){logger[_0x7d19('0x13')](_0x7d19('0x14'),_0x209e01,_0x7d19('0x15'));logger[_0x7d19('0x16')](_0x7d19('0x17'),_0x209e01,_0x7d19('0x15'),JSON[_0x7d19('0x18')](_0x4131db));if(_0x4131db[_0x7d19('0x19')]){if(_0x4131db[_0x7d19('0x19')][_0x7d19('0x1a')]===0x1f4){logger['error'](_0x7d19('0x14'),_0x209e01,_0x4131db[_0x7d19('0x19')][_0x7d19('0x1b')]);return _0x5b09c0(_0x4131db[_0x7d19('0x19')][_0x7d19('0x1b')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x209e01,_0x4131db[_0x7d19('0x19')][_0x7d19('0x1b')]);return _0x2a18a3(_0x4131db[_0x7d19('0x19')][_0x7d19('0x1b')]);}else{logger['info'](_0x7d19('0x14'),_0x209e01,_0x7d19('0x15'));_0x2a18a3(_0x4131db['result'][_0x7d19('0x1b')]);}})['catch'](function(_0x4b027e){logger[_0x7d19('0x19')](_0x7d19('0x14'),_0x209e01,_0x4b027e);_0x5b09c0(_0x4b027e);});});}exports[_0x7d19('0x1c')]=function(_0x311a67){var _0x50528d=this;return new Promise(function(_0x4625b3,_0x342f1f){return db[_0x7d19('0x1d')][_0x7d19('0x1e')]({'raw':_0x311a67[_0x7d19('0x1f')]?_0x311a67[_0x7d19('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x311a67[_0x7d19('0x1f')]?_0x311a67[_0x7d19('0x1f')][_0x7d19('0x20')]||null:null,'attributes':_0x311a67['options']?_0x311a67[_0x7d19('0x1f')]['attributes']||null:null,'limit':_0x311a67[_0x7d19('0x1f')]?_0x311a67[_0x7d19('0x1f')][_0x7d19('0x21')]||null:null,'include':_0x311a67['options']?_0x311a67['options'][_0x7d19('0x22')]?_[_0x7d19('0x23')](_0x311a67['options'][_0x7d19('0x22')],function(_0x51cebb){return{'model':db[_0x51cebb['model']],'as':_0x51cebb['as'],'attributes':_0x51cebb[_0x7d19('0x24')],'include':_0x51cebb['include']?_['map'](_0x51cebb[_0x7d19('0x22')],function(_0x108f7d){return{'model':db[_0x108f7d[_0x7d19('0x25')]],'as':_0x108f7d['as'],'attributes':_0x108f7d['attributes'],'include':_0x108f7d[_0x7d19('0x22')]?_[_0x7d19('0x23')](_0x108f7d[_0x7d19('0x22')],function(_0x4e322e){return{'model':db[_0x4e322e[_0x7d19('0x25')]],'as':_0x4e322e['as'],'attributes':_0x4e322e[_0x7d19('0x24')]};}):[]};}):[]};}):[]:[]})[_0x7d19('0x12')](function(_0x4e0689){logger[_0x7d19('0x13')](_0x7d19('0x1c'),_0x311a67);logger[_0x7d19('0x16')]('GetSmsQueue',_0x311a67,JSON['stringify'](_0x4e0689));_0x4625b3(_0x4e0689);})[_0x7d19('0x26')](function(_0xac989){logger[_0x7d19('0x19')](_0x7d19('0x1c'),_0xac989['message'],_0x311a67);_0x342f1f(_0x50528d[_0x7d19('0x19')](0x1f4,_0xac989[_0x7d19('0x1b')]));});});};exports[_0x7d19('0x27')]=function(_0x4b44d9){var _0x2f0323=this;return new Promise(function(_0x30d7e5,_0x1d5987){return db[_0x7d19('0x1d')][_0x7d19('0x28')]({'raw':_0x4b44d9[_0x7d19('0x1f')]?_0x4b44d9['options'][_0x7d19('0x29')]===undefined?!![]:![]:!![],'where':_0x4b44d9[_0x7d19('0x1f')]?_0x4b44d9[_0x7d19('0x1f')][_0x7d19('0x20')]||null:null,'attributes':_0x4b44d9[_0x7d19('0x1f')]?_0x4b44d9[_0x7d19('0x1f')][_0x7d19('0x24')]||null:null,'include':_0x4b44d9[_0x7d19('0x1f')]?_0x4b44d9[_0x7d19('0x1f')]['include']?_[_0x7d19('0x23')](_0x4b44d9[_0x7d19('0x1f')][_0x7d19('0x22')],function(_0x14b9b2){return{'model':db[_0x14b9b2[_0x7d19('0x25')]],'as':_0x14b9b2['as'],'attributes':_0x14b9b2[_0x7d19('0x24')],'include':_0x14b9b2[_0x7d19('0x22')]?_[_0x7d19('0x23')](_0x14b9b2[_0x7d19('0x22')],function(_0xfd06dd){return{'model':db[_0xfd06dd[_0x7d19('0x25')]],'as':_0xfd06dd['as'],'attributes':_0xfd06dd[_0x7d19('0x24')],'include':_0xfd06dd['include']?_['map'](_0xfd06dd[_0x7d19('0x22')],function(_0x5631f4){return{'model':db[_0x5631f4[_0x7d19('0x25')]],'as':_0x5631f4['as'],'attributes':_0x5631f4['attributes']};}):[]};}):[]};}):[]:[]})[_0x7d19('0x12')](function(_0xd97d7d){logger[_0x7d19('0x13')](_0x7d19('0x27'),_0x4b44d9);logger[_0x7d19('0x16')](_0x7d19('0x27'),_0x4b44d9,JSON[_0x7d19('0x18')](_0xd97d7d));_0x30d7e5(_0xd97d7d);})[_0x7d19('0x26')](function(_0x46f0a2){logger['error'](_0x7d19('0x27'),_0x46f0a2['message'],_0x4b44d9);_0x1d5987(_0x2f0323[_0x7d19('0x19')](0x1f4,_0x46f0a2[_0x7d19('0x1b')]));});});}; \ No newline at end of file +var _0x1f2d=['where','attributes','map','include','model','GetSmsQueue','ShowSmsQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsQueue.socket','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','catch','SmsQueue','findAll','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f2d,0x13f));var _0xd1f2=function(_0x5ac7d7,_0x109040){_0x5ac7d7=_0x5ac7d7-0x0;var _0x23955f=_0x1f2d[_0x5ac7d7];return _0x23955f;};'use strict';var _=require(_0xd1f2('0x0'));var util=require(_0xd1f2('0x1'));var moment=require(_0xd1f2('0x2'));var BPromise=require('bluebird');var rs=require(_0xd1f2('0x3'));var fs=require('fs');var Redis=require(_0xd1f2('0x4'));var db=require(_0xd1f2('0x5'))['db'];var utils=require(_0xd1f2('0x6'));var logger=require(_0xd1f2('0x7'))(_0xd1f2('0x8'));var config=require(_0xd1f2('0x9'));var jayson=require(_0xd1f2('0xa'));var client=jayson[_0xd1f2('0xb')][_0xd1f2('0xc')]({'port':0x232a});config[_0xd1f2('0xd')]=_['defaults'](config[_0xd1f2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd1f2('0xe'))(new Redis(config[_0xd1f2('0xd')]));require(_0xd1f2('0xf'))['register'](socket);function respondWithRpcPromise(_0x4ffaf1,_0x286f3c,_0x27cd5e){return new BPromise(function(_0x231753,_0x1ed12d){return client[_0xd1f2('0x10')](_0x4ffaf1,_0x27cd5e)[_0xd1f2('0x11')](function(_0x387df4){logger[_0xd1f2('0x12')]('SmsQueue,\x20%s,\x20%s',_0x286f3c,_0xd1f2('0x13'));logger[_0xd1f2('0x14')](_0xd1f2('0x15'),_0x286f3c,_0xd1f2('0x13'),JSON[_0xd1f2('0x16')](_0x387df4));if(_0x387df4[_0xd1f2('0x17')]){if(_0x387df4['error'][_0xd1f2('0x18')]===0x1f4){logger[_0xd1f2('0x17')](_0xd1f2('0x19'),_0x286f3c,_0x387df4[_0xd1f2('0x17')][_0xd1f2('0x1a')]);return _0x1ed12d(_0x387df4['error']['message']);}logger[_0xd1f2('0x17')](_0xd1f2('0x19'),_0x286f3c,_0x387df4['error'][_0xd1f2('0x1a')]);return _0x231753(_0x387df4[_0xd1f2('0x17')][_0xd1f2('0x1a')]);}else{logger[_0xd1f2('0x12')](_0xd1f2('0x19'),_0x286f3c,_0xd1f2('0x13'));_0x231753(_0x387df4['result'][_0xd1f2('0x1a')]);}})[_0xd1f2('0x1b')](function(_0x5f4f33){logger[_0xd1f2('0x17')](_0xd1f2('0x19'),_0x286f3c,_0x5f4f33);_0x1ed12d(_0x5f4f33);});});}exports['GetSmsQueue']=function(_0x2b1c26){var _0x2da11e=this;return new Promise(function(_0x2a0f9d,_0x450833){return db[_0xd1f2('0x1c')][_0xd1f2('0x1d')]({'raw':_0x2b1c26[_0xd1f2('0x1e')]?_0x2b1c26[_0xd1f2('0x1e')][_0xd1f2('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b1c26[_0xd1f2('0x1e')]?_0x2b1c26[_0xd1f2('0x1e')][_0xd1f2('0x20')]||null:null,'attributes':_0x2b1c26[_0xd1f2('0x1e')]?_0x2b1c26[_0xd1f2('0x1e')][_0xd1f2('0x21')]||null:null,'limit':_0x2b1c26['options']?_0x2b1c26[_0xd1f2('0x1e')]['limit']||null:null,'include':_0x2b1c26[_0xd1f2('0x1e')]?_0x2b1c26[_0xd1f2('0x1e')]['include']?_[_0xd1f2('0x22')](_0x2b1c26[_0xd1f2('0x1e')][_0xd1f2('0x23')],function(_0x38dc13){return{'model':db[_0x38dc13[_0xd1f2('0x24')]],'as':_0x38dc13['as'],'attributes':_0x38dc13[_0xd1f2('0x21')],'include':_0x38dc13[_0xd1f2('0x23')]?_[_0xd1f2('0x22')](_0x38dc13[_0xd1f2('0x23')],function(_0x241a68){return{'model':db[_0x241a68[_0xd1f2('0x24')]],'as':_0x241a68['as'],'attributes':_0x241a68[_0xd1f2('0x21')],'include':_0x241a68[_0xd1f2('0x23')]?_['map'](_0x241a68[_0xd1f2('0x23')],function(_0x3e45c4){return{'model':db[_0x3e45c4[_0xd1f2('0x24')]],'as':_0x3e45c4['as'],'attributes':_0x3e45c4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd1f2('0x11')](function(_0x175b5d){logger[_0xd1f2('0x12')](_0xd1f2('0x25'),_0x2b1c26);logger[_0xd1f2('0x14')]('GetSmsQueue',_0x2b1c26,JSON[_0xd1f2('0x16')](_0x175b5d));_0x2a0f9d(_0x175b5d);})[_0xd1f2('0x1b')](function(_0x11de47){logger[_0xd1f2('0x17')](_0xd1f2('0x25'),_0x11de47['message'],_0x2b1c26);_0x450833(_0x2da11e[_0xd1f2('0x17')](0x1f4,_0x11de47['message']));});});};exports['ShowSmsQueue']=function(_0x35aad3){var _0x27dc13=this;return new Promise(function(_0x3f60d6,_0x1fe9c6){return db[_0xd1f2('0x1c')]['find']({'raw':_0x35aad3['options']?_0x35aad3[_0xd1f2('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x35aad3[_0xd1f2('0x1e')]?_0x35aad3[_0xd1f2('0x1e')][_0xd1f2('0x20')]||null:null,'attributes':_0x35aad3[_0xd1f2('0x1e')]?_0x35aad3['options'][_0xd1f2('0x21')]||null:null,'include':_0x35aad3[_0xd1f2('0x1e')]?_0x35aad3[_0xd1f2('0x1e')][_0xd1f2('0x23')]?_[_0xd1f2('0x22')](_0x35aad3['options'][_0xd1f2('0x23')],function(_0x38a11d){return{'model':db[_0x38a11d['model']],'as':_0x38a11d['as'],'attributes':_0x38a11d[_0xd1f2('0x21')],'include':_0x38a11d[_0xd1f2('0x23')]?_['map'](_0x38a11d[_0xd1f2('0x23')],function(_0xeaa97d){return{'model':db[_0xeaa97d[_0xd1f2('0x24')]],'as':_0xeaa97d['as'],'attributes':_0xeaa97d['attributes'],'include':_0xeaa97d[_0xd1f2('0x23')]?_[_0xd1f2('0x22')](_0xeaa97d['include'],function(_0x1b2679){return{'model':db[_0x1b2679[_0xd1f2('0x24')]],'as':_0x1b2679['as'],'attributes':_0x1b2679[_0xd1f2('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cd665){logger[_0xd1f2('0x12')](_0xd1f2('0x26'),_0x35aad3);logger[_0xd1f2('0x14')](_0xd1f2('0x26'),_0x35aad3,JSON[_0xd1f2('0x16')](_0x5cd665));_0x3f60d6(_0x5cd665);})[_0xd1f2('0x1b')](function(_0x5373be){logger[_0xd1f2('0x17')](_0xd1f2('0x26'),_0x5373be['message'],_0x35aad3);_0x1fe9c6(_0x27dc13['error'](0x1f4,_0x5373be[_0xd1f2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index d13f97e..afec973 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 _0x8b28=['removeListener','register','length','smsQueue:','save','remove','update','emit'];(function(_0x3cc547,_0x4020ec){var _0x52b5b8=function(_0x2dc039){while(--_0x2dc039){_0x3cc547['push'](_0x3cc547['shift']());}};_0x52b5b8(++_0x4020ec);}(_0x8b28,0x164));var _0x88b2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b28[_0x20a584];return _0x4b41a8;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x88b2('0x0'),_0x88b2('0x1'),_0x88b2('0x2')];function createListener(_0x31a8a0,_0x31f0a1){return function(_0x5d359a){_0x31f0a1[_0x88b2('0x3')](_0x31a8a0,_0x5d359a);};}function removeListener(_0x4ea313,_0x4cb533){return function(){SmsQueueEvents[_0x88b2('0x4')](_0x4ea313,_0x4cb533);};}exports[_0x88b2('0x5')]=function(_0x3ce335){for(var _0x3df304=0x0,_0x5d474e=events[_0x88b2('0x6')];_0x3df304<_0x5d474e;_0x3df304++){var _0x1f1313=events[_0x3df304];var _0x494fcb=createListener(_0x88b2('0x7')+_0x1f1313,_0x3ce335);SmsQueueEvents['on'](_0x1f1313,_0x494fcb);}}; \ No newline at end of file +var _0x78b7=['removeListener','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x559ce2,_0x257fe8){var _0x5f31a4=function(_0x33cb27){while(--_0x33cb27){_0x559ce2['push'](_0x559ce2['shift']());}};_0x5f31a4(++_0x257fe8);}(_0x78b7,0x9d));var _0x778b=function(_0x3ecd06,_0x5246c8){_0x3ecd06=_0x3ecd06-0x0;var _0x31606d=_0x78b7[_0x3ecd06];return _0x31606d;};'use strict';var SmsQueueEvents=require(_0x778b('0x0'));var events=[_0x778b('0x1'),_0x778b('0x2'),_0x778b('0x3')];function createListener(_0x5ebde7,_0x1a21cc){return function(_0x350c6b){_0x1a21cc['emit'](_0x5ebde7,_0x350c6b);};}function removeListener(_0x1205fd,_0x34d449){return function(){SmsQueueEvents[_0x778b('0x4')](_0x1205fd,_0x34d449);};}exports['register']=function(_0x496647){for(var _0x3cfedb=0x0,_0x43b469=events[_0x778b('0x5')];_0x3cfedb<_0x43b469;_0x3cfedb++){var _0x15008e=events[_0x3cfedb];var _0x220519=createListener(_0x778b('0x6')+_0x15008e,_0x496647);SmsQueueEvents['on'](_0x15008e,_0x220519);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f98e953..83e4aad 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 _0xfcda=['/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xfcda,0x198));var _0xafcd=function(_0x3caded,_0x19a211){_0x3caded=_0x3caded-0x0;var _0x1675f7=_0xfcda[_0x3caded];return _0x1675f7;};'use strict';var multer=require(_0xafcd('0x0'));var util=require(_0xafcd('0x1'));var path=require('path');var timeout=require(_0xafcd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xafcd('0x3'));var interaction=require(_0xafcd('0x4'));var config=require(_0xafcd('0x5'));var controller=require(_0xafcd('0x6'));router[_0xafcd('0x7')]('/',auth[_0xafcd('0x8')](),controller[_0xafcd('0x9')]);router['get'](_0xafcd('0xa'),auth['isAuthenticated'](),controller[_0xafcd('0xb')]);router[_0xafcd('0x7')](_0xafcd('0xc'),auth[_0xafcd('0x8')](),controller[_0xafcd('0xd')]);router[_0xafcd('0xe')]('/',auth['isAuthenticated'](),controller[_0xafcd('0xf')]);router[_0xafcd('0x10')](_0xafcd('0xc'),auth[_0xafcd('0x8')](),controller[_0xafcd('0x11')]);router[_0xafcd('0x12')](_0xafcd('0xc'),auth[_0xafcd('0x8')](),controller[_0xafcd('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1c3b=['isAuthenticated','index','get','/:id','show','post','put','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller'];(function(_0x17369c,_0x57e58f){var _0x5d558e=function(_0x2c1039){while(--_0x2c1039){_0x17369c['push'](_0x17369c['shift']());}};_0x5d558e(++_0x57e58f);}(_0x1c3b,0xab));var _0xb1c3=function(_0x4ec082,_0x283489){_0x4ec082=_0x4ec082-0x0;var _0x31deb0=_0x1c3b[_0x4ec082];return _0x31deb0;};'use strict';var multer=require(_0xb1c3('0x0'));var util=require(_0xb1c3('0x1'));var path=require(_0xb1c3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1c3('0x3')]();var fs_extra=require(_0xb1c3('0x4'));var auth=require(_0xb1c3('0x5'));var interaction=require(_0xb1c3('0x6'));var config=require(_0xb1c3('0x7'));var controller=require(_0xb1c3('0x8'));router['get']('/',auth[_0xb1c3('0x9')](),controller[_0xb1c3('0xa')]);router[_0xb1c3('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xb1c3('0xc'),auth['isAuthenticated'](),controller[_0xb1c3('0xd')]);router[_0xb1c3('0xe')]('/',auth[_0xb1c3('0x9')](),controller['create']);router[_0xb1c3('0xf')](_0xb1c3('0xc'),auth[_0xb1c3('0x9')](),controller['update']);router[_0xb1c3('0x10')](_0xb1c3('0xc'),auth[_0xb1c3('0x9')](),controller[_0xb1c3('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 027eab0..567e019 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 _0x5437=['sequelize','exports','STRING','DATE','moment'];(function(_0x1fa4bc,_0x157b4a){var _0x66e51d=function(_0x4cad63){while(--_0x4cad63){_0x1fa4bc['push'](_0x1fa4bc['shift']());}};_0x66e51d(++_0x157b4a);}(_0x5437,0x1b2));var _0x7543=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x5437[_0x1928c9];return _0x51b5fb;};'use strict';var moment=require(_0x7543('0x0'));var Sequelize=require(_0x7543('0x1'));module[_0x7543('0x2')]={'uniqueid':{'type':Sequelize[_0x7543('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7543('0x4')]},'leaveAt':{'type':Sequelize[_0x7543('0x4')]},'acceptAt':{'type':Sequelize[_0x7543('0x4')]},'exitAt':{'type':Sequelize[_0x7543('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb046=['exports','STRING','DATE','moment','sequelize'];(function(_0x379d16,_0x330a57){var _0x2a9e29=function(_0x321967){while(--_0x321967){_0x379d16['push'](_0x379d16['shift']());}};_0x2a9e29(++_0x330a57);}(_0xb046,0x193));var _0x6b04=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0xb046[_0x3c6dce];return _0x1450e9;};'use strict';var moment=require(_0x6b04('0x0'));var Sequelize=require(_0x6b04('0x1'));module[_0x6b04('0x2')]={'uniqueid':{'type':Sequelize[_0x6b04('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x6b04('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6b04('0x4')]},'acceptAt':{'type':Sequelize[_0x6b04('0x4')]},'exitAt':{'type':Sequelize[_0x6b04('0x4')]},'reason':{'type':Sequelize[_0x6b04('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index ac1d60d..42053b8 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 _0xbbeb=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','SmsQueueReport','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','length','find','create','body','params','catch','eml-format','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x8a0541,_0xaa5625){var _0x124c9f=function(_0x340c3d){while(--_0x340c3d){_0x8a0541['push'](_0x8a0541['shift']());}};_0x124c9f(++_0xaa5625);}(_0xbbeb,0x86));var _0xbbbe=function(_0x392dc2,_0x47c3f3){_0x392dc2=_0x392dc2-0x0;var _0x14150f=_0xbbeb[_0x392dc2];return _0x14150f;};'use strict';var emlformat=require(_0xbbbe('0x0'));var rimraf=require(_0xbbbe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbbe('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbbbe('0x3'));var util=require(_0xbbbe('0x4'));var path=require(_0xbbbe('0x5'));var sox=require('sox');var csv=require(_0xbbbe('0x6'));var ejs=require(_0xbbbe('0x7'));var fs=require('fs');var fs_extra=require(_0xbbbe('0x8'));var _=require(_0xbbbe('0x9'));var squel=require(_0xbbbe('0xa'));var crypto=require(_0xbbbe('0xb'));var jsforce=require(_0xbbbe('0xc'));var deskjs=require(_0xbbbe('0xd'));var toCsv=require(_0xbbbe('0x6'));var querystring=require(_0xbbbe('0xe'));var Papa=require(_0xbbbe('0xf'));var Redis=require(_0xbbbe('0x10'));var authService=require(_0xbbbe('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbbbe('0x12'));var hardwareService=require(_0xbbbe('0x13'));var logger=require(_0xbbbe('0x14'))('api');var utils=require(_0xbbbe('0x15'));var config=require(_0xbbbe('0x16'));var licenseUtil=require(_0xbbbe('0x17'));var db=require(_0xbbbe('0x18'))['db'];function respondWithStatusCode(_0x9c77f6,_0x4d8619){_0x4d8619=_0x4d8619||0xcc;return function(_0x51c4f0){if(_0x51c4f0){return _0x9c77f6[_0xbbbe('0x19')](_0x4d8619);}return _0x9c77f6[_0xbbbe('0x1a')](_0x4d8619)[_0xbbbe('0x1b')]();};}function respondWithResult(_0x11a20f,_0x2e566e){_0x2e566e=_0x2e566e||0xc8;return function(_0x5836cf){if(_0x5836cf){return _0x11a20f['status'](_0x2e566e)['json'](_0x5836cf);}};}function respondWithFilteredResult(_0xd6d74a,_0x700321){return function(_0x37f3a2){if(_0x37f3a2){var _0x53a4e0=typeof _0x700321[_0xbbbe('0x1c')]===_0xbbbe('0x1d')&&typeof _0x700321[_0xbbbe('0x1e')]==='undefined';var _0x2f7ca3=_0x37f3a2[_0xbbbe('0x1f')];var _0x5a2900=_0x53a4e0?0x0:_0x700321['offset'];var _0x3d5443=_0x53a4e0?_0x37f3a2['count']:_0x700321[_0xbbbe('0x1c')]+_0x700321['limit'];var _0x5d805a;if(_0x3d5443>=_0x2f7ca3){_0x3d5443=_0x2f7ca3;_0x5d805a=0xc8;}else{_0x5d805a=0xce;}_0xd6d74a[_0xbbbe('0x1a')](_0x5d805a);return _0xd6d74a[_0xbbbe('0x20')](_0xbbbe('0x21'),_0x5a2900+'-'+_0x3d5443+'/'+_0x2f7ca3)['json'](_0x37f3a2);}return null;};}function patchUpdates(_0x1f33fb){return function(_0x358a60){try{jsonpatch[_0xbbbe('0x22')](_0x358a60,_0x1f33fb,!![]);}catch(_0x41a389){return BPromise[_0xbbbe('0x23')](_0x41a389);}return _0x358a60[_0xbbbe('0x24')]();};}function saveUpdates(_0x51084c,_0x4ea717){return function(_0x4d1cb1){if(_0x4d1cb1){return _0x4d1cb1['update'](_0x51084c)['then'](function(_0x1e3356){return _0x1e3356;});}return null;};}function removeEntity(_0x272e8a,_0x22e255){return function(_0x3dc34b){if(_0x3dc34b){return _0x3dc34b[_0xbbbe('0x25')]()[_0xbbbe('0x26')](function(){_0x272e8a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5888f8,_0x9e744f){return function(_0x16a7af){if(!_0x16a7af){_0x5888f8[_0xbbbe('0x19')](0x194);}return _0x16a7af;};}function handleError(_0x2b0d9e,_0x3db3b7){_0x3db3b7=_0x3db3b7||0x1f4;return function(_0x836a66){logger[_0xbbbe('0x27')](_0x836a66[_0xbbbe('0x28')]);if(_0x836a66[_0xbbbe('0x29')]){delete _0x836a66[_0xbbbe('0x29')];}_0x2b0d9e[_0xbbbe('0x1a')](_0x3db3b7)[_0xbbbe('0x2a')](_0x836a66);};}exports[_0xbbbe('0x2b')]=function(_0xa710cb,_0x3955ea){var _0x4bea40={},_0x496eec={},_0x31045a={'count':0x0,'rows':[]};var _0x14034e=_['map'](db[_0xbbbe('0x2c')]['rawAttributes'],function(_0x544599){return{'name':_0x544599[_0xbbbe('0x2d')],'type':_0x544599[_0xbbbe('0x2e')]['key']};});_0x496eec[_0xbbbe('0x2f')]=_['map'](_0x14034e,'name');_0x496eec[_0xbbbe('0x30')]=_['keys'](_0xa710cb['query']);_0x496eec['filters']=_[_0xbbbe('0x31')](_0x496eec['model'],_0x496eec['query']);_0x4bea40[_0xbbbe('0x32')]=_[_0xbbbe('0x31')](_0x496eec[_0xbbbe('0x2f')],qs[_0xbbbe('0x33')](_0xa710cb[_0xbbbe('0x30')]['fields']));_0x4bea40['attributes']=_0x4bea40[_0xbbbe('0x32')]['length']?_0x4bea40[_0xbbbe('0x32')]:_0x496eec[_0xbbbe('0x2f')];if(!_0xa710cb[_0xbbbe('0x30')][_0xbbbe('0x34')](_0xbbbe('0x35'))){_0x4bea40[_0xbbbe('0x1e')]=qs[_0xbbbe('0x1e')](_0xa710cb[_0xbbbe('0x30')][_0xbbbe('0x1e')]);_0x4bea40[_0xbbbe('0x1c')]=qs[_0xbbbe('0x1c')](_0xa710cb[_0xbbbe('0x30')][_0xbbbe('0x1c')]);}_0x4bea40['order']=qs[_0xbbbe('0x36')](_0xa710cb[_0xbbbe('0x30')]['sort']);_0x4bea40[_0xbbbe('0x37')]=qs[_0xbbbe('0x38')](_[_0xbbbe('0x39')](_0xa710cb[_0xbbbe('0x30')],_0x496eec[_0xbbbe('0x38')]),_0x14034e);if(_0xa710cb[_0xbbbe('0x30')][_0xbbbe('0x3a')]){_0x4bea40[_0xbbbe('0x37')]=_['merge'](_0x4bea40[_0xbbbe('0x37')],{'$or':_[_0xbbbe('0x3b')](_0x14034e,function(_0x40fa39){if(_0x40fa39['type']!==_0xbbbe('0x3c')){var _0x488601={};_0x488601[_0x40fa39[_0xbbbe('0x29')]]={'$like':'%'+_0xa710cb[_0xbbbe('0x30')][_0xbbbe('0x3a')]+'%'};return _0x488601;}})});}_0x4bea40=_[_0xbbbe('0x3d')]({},_0x4bea40,_0xa710cb[_0xbbbe('0x3e')]);var _0x4dea87={'where':_0x4bea40[_0xbbbe('0x37')]};return db[_0xbbbe('0x2c')][_0xbbbe('0x1f')](_0x4dea87)['then'](function(_0x304553){_0x31045a['count']=_0x304553;if(_0xa710cb[_0xbbbe('0x30')][_0xbbbe('0x3f')]){_0x4bea40[_0xbbbe('0x40')]=[{'all':!![]}];}return db[_0xbbbe('0x2c')][_0xbbbe('0x41')](_0x4bea40);})[_0xbbbe('0x26')](function(_0x345f04){_0x31045a[_0xbbbe('0x42')]=_0x345f04;return _0x31045a;})[_0xbbbe('0x26')](respondWithFilteredResult(_0x3955ea,_0x4bea40))['catch'](handleError(_0x3955ea,null));};exports[_0xbbbe('0x43')]=function(_0xb500a5,_0x22189e){var _0x20629a={'raw':!![],'where':{'id':_0xb500a5['params']['id']}},_0x24c961={};_0x24c961[_0xbbbe('0x2f')]=_['keys'](db['SmsQueueReport'][_0xbbbe('0x44')]);_0x24c961[_0xbbbe('0x30')]=_['keys'](_0xb500a5[_0xbbbe('0x30')]);_0x24c961[_0xbbbe('0x38')]=_[_0xbbbe('0x31')](_0x24c961[_0xbbbe('0x2f')],_0x24c961[_0xbbbe('0x30')]);_0x20629a[_0xbbbe('0x32')]=_[_0xbbbe('0x31')](_0x24c961[_0xbbbe('0x2f')],qs[_0xbbbe('0x33')](_0xb500a5[_0xbbbe('0x30')][_0xbbbe('0x33')]));_0x20629a['attributes']=_0x20629a[_0xbbbe('0x32')][_0xbbbe('0x45')]?_0x20629a[_0xbbbe('0x32')]:_0x24c961['model'];if(_0xb500a5[_0xbbbe('0x30')][_0xbbbe('0x3f')]){_0x20629a[_0xbbbe('0x40')]=[{'all':!![]}];}_0x20629a=_[_0xbbbe('0x3d')]({},_0x20629a,_0xb500a5[_0xbbbe('0x3e')]);return db[_0xbbbe('0x2c')][_0xbbbe('0x46')](_0x20629a)['then'](handleEntityNotFound(_0x22189e,null))[_0xbbbe('0x26')](respondWithResult(_0x22189e,null))['catch'](handleError(_0x22189e,null));};exports[_0xbbbe('0x47')]=function(_0x1fdab7,_0x368f06){return db[_0xbbbe('0x2c')][_0xbbbe('0x47')](_0x1fdab7[_0xbbbe('0x48')],{})[_0xbbbe('0x26')](respondWithResult(_0x368f06,0xc9))['catch'](handleError(_0x368f06,null));};exports['update']=function(_0x155536,_0x2501de){if(_0x155536['body']['id']){delete _0x155536[_0xbbbe('0x48')]['id'];}return db['SmsQueueReport'][_0xbbbe('0x46')]({'where':{'id':_0x155536[_0xbbbe('0x49')]['id']}})[_0xbbbe('0x26')](handleEntityNotFound(_0x2501de,null))['then'](saveUpdates(_0x155536['body'],null))[_0xbbbe('0x26')](respondWithResult(_0x2501de,null))[_0xbbbe('0x4a')](handleError(_0x2501de,null));};exports[_0xbbbe('0x25')]=function(_0x2e975f,_0x348dee){return db[_0xbbbe('0x2c')][_0xbbbe('0x46')]({'where':{'id':_0x2e975f[_0xbbbe('0x49')]['id']}})[_0xbbbe('0x26')](handleEntityNotFound(_0x348dee,null))[_0xbbbe('0x26')](removeEntity(_0x348dee,null))[_0xbbbe('0x4a')](handleError(_0x348dee,null));};exports['describe']=function(_0x315665,_0x29eacb){return db[_0xbbbe('0x2c')]['describe']()[_0xbbbe('0x26')](respondWithResult(_0x29eacb,null))[_0xbbbe('0x4a')](handleError(_0x29eacb,null));}; \ No newline at end of file +var _0x34c1=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','error','stack','name','send','map','SmsQueueReport','rawAttributes','type','model','query','keys','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','params','intersection','create','update','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0xeb3872,_0x9b3206){var _0x3f8e1b=function(_0x1a3b6e){while(--_0x1a3b6e){_0xeb3872['push'](_0xeb3872['shift']());}};_0x3f8e1b(++_0x9b3206);}(_0x34c1,0x81));var _0x134c=function(_0x2258e8,_0x396f17){_0x2258e8=_0x2258e8-0x0;var _0x539892=_0x34c1[_0x2258e8];return _0x539892;};'use strict';var emlformat=require(_0x134c('0x0'));var rimraf=require(_0x134c('0x1'));var zipdir=require(_0x134c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x134c('0x3'));var moment=require(_0x134c('0x4'));var BPromise=require(_0x134c('0x5'));var Mustache=require(_0x134c('0x6'));var util=require(_0x134c('0x7'));var path=require(_0x134c('0x8'));var sox=require(_0x134c('0x9'));var csv=require(_0x134c('0xa'));var ejs=require(_0x134c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x134c('0xc'));var squel=require(_0x134c('0xd'));var crypto=require(_0x134c('0xe'));var jsforce=require(_0x134c('0xf'));var deskjs=require(_0x134c('0x10'));var toCsv=require(_0x134c('0xa'));var querystring=require(_0x134c('0x11'));var Papa=require(_0x134c('0x12'));var Redis=require(_0x134c('0x13'));var authService=require(_0x134c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x134c('0x15'));var hardwareService=require(_0x134c('0x16'));var logger=require(_0x134c('0x17'))(_0x134c('0x18'));var utils=require(_0x134c('0x19'));var config=require(_0x134c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x134c('0x1b'))['db'];function respondWithStatusCode(_0x3aa1b0,_0x3aa999){_0x3aa999=_0x3aa999||0xcc;return function(_0x4378bd){if(_0x4378bd){return _0x3aa1b0[_0x134c('0x1c')](_0x3aa999);}return _0x3aa1b0[_0x134c('0x1d')](_0x3aa999)[_0x134c('0x1e')]();};}function respondWithResult(_0x2b3c47,_0x307030){_0x307030=_0x307030||0xc8;return function(_0x13f4cd){if(_0x13f4cd){return _0x2b3c47['status'](_0x307030)[_0x134c('0x1f')](_0x13f4cd);}};}function respondWithFilteredResult(_0x2de9f9,_0x389ae0){return function(_0x3fe672){if(_0x3fe672){var _0x526a0f=typeof _0x389ae0[_0x134c('0x20')]===_0x134c('0x21')&&typeof _0x389ae0['limit']===_0x134c('0x21');var _0x36d9a0=_0x3fe672['count'];var _0x1d3f49=_0x526a0f?0x0:_0x389ae0['offset'];var _0x43c27f=_0x526a0f?_0x3fe672[_0x134c('0x22')]:_0x389ae0['offset']+_0x389ae0[_0x134c('0x23')];var _0x3f3d21;if(_0x43c27f>=_0x36d9a0){_0x43c27f=_0x36d9a0;_0x3f3d21=0xc8;}else{_0x3f3d21=0xce;}_0x2de9f9[_0x134c('0x1d')](_0x3f3d21);return _0x2de9f9['set'](_0x134c('0x24'),_0x1d3f49+'-'+_0x43c27f+'/'+_0x36d9a0)[_0x134c('0x1f')](_0x3fe672);}return null;};}function patchUpdates(_0x10b0d){return function(_0x42d0b8){try{jsonpatch[_0x134c('0x25')](_0x42d0b8,_0x10b0d,!![]);}catch(_0x36c998){return BPromise[_0x134c('0x26')](_0x36c998);}return _0x42d0b8[_0x134c('0x27')]();};}function saveUpdates(_0x55e3e6,_0x3a17e3){return function(_0x3d8ecd){if(_0x3d8ecd){return _0x3d8ecd['update'](_0x55e3e6)['then'](function(_0x11f4c9){return _0x11f4c9;});}return null;};}function removeEntity(_0x41304f,_0x3fffe9){return function(_0x48e56c){if(_0x48e56c){return _0x48e56c[_0x134c('0x28')]()['then'](function(){_0x41304f[_0x134c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x107d21,_0x213a07){return function(_0x5c3de0){if(!_0x5c3de0){_0x107d21[_0x134c('0x1c')](0x194);}return _0x5c3de0;};}function handleError(_0x3dc949,_0x488a34){_0x488a34=_0x488a34||0x1f4;return function(_0x5f3aed){logger[_0x134c('0x29')](_0x5f3aed[_0x134c('0x2a')]);if(_0x5f3aed[_0x134c('0x2b')]){delete _0x5f3aed[_0x134c('0x2b')];}_0x3dc949[_0x134c('0x1d')](_0x488a34)[_0x134c('0x2c')](_0x5f3aed);};}exports['index']=function(_0x11983c,_0x3bb522){var _0x3150b3={},_0x280f5b={},_0x18262c={'count':0x0,'rows':[]};var _0x230b60=_[_0x134c('0x2d')](db[_0x134c('0x2e')][_0x134c('0x2f')],function(_0x1c664a){return{'name':_0x1c664a['fieldName'],'type':_0x1c664a[_0x134c('0x30')]['key']};});_0x280f5b[_0x134c('0x31')]=_[_0x134c('0x2d')](_0x230b60,_0x134c('0x2b'));_0x280f5b[_0x134c('0x32')]=_[_0x134c('0x33')](_0x11983c[_0x134c('0x32')]);_0x280f5b['filters']=_['intersection'](_0x280f5b[_0x134c('0x31')],_0x280f5b[_0x134c('0x32')]);_0x3150b3[_0x134c('0x34')]=_['intersection'](_0x280f5b['model'],qs[_0x134c('0x35')](_0x11983c[_0x134c('0x32')]['fields']));_0x3150b3[_0x134c('0x34')]=_0x3150b3[_0x134c('0x34')][_0x134c('0x36')]?_0x3150b3[_0x134c('0x34')]:_0x280f5b[_0x134c('0x31')];if(!_0x11983c[_0x134c('0x32')][_0x134c('0x37')]('nolimit')){_0x3150b3[_0x134c('0x23')]=qs[_0x134c('0x23')](_0x11983c[_0x134c('0x32')][_0x134c('0x23')]);_0x3150b3[_0x134c('0x20')]=qs[_0x134c('0x20')](_0x11983c[_0x134c('0x32')]['offset']);}_0x3150b3['order']=qs[_0x134c('0x38')](_0x11983c['query'][_0x134c('0x38')]);_0x3150b3[_0x134c('0x39')]=qs[_0x134c('0x3a')](_[_0x134c('0x3b')](_0x11983c[_0x134c('0x32')],_0x280f5b['filters']),_0x230b60);if(_0x11983c[_0x134c('0x32')]['filter']){_0x3150b3[_0x134c('0x39')]=_[_0x134c('0x3c')](_0x3150b3[_0x134c('0x39')],{'$or':_[_0x134c('0x2d')](_0x230b60,function(_0x4866a2){if(_0x4866a2[_0x134c('0x30')]!==_0x134c('0x3d')){var _0x158ec6={};_0x158ec6[_0x4866a2[_0x134c('0x2b')]]={'$like':'%'+_0x11983c[_0x134c('0x32')][_0x134c('0x3e')]+'%'};return _0x158ec6;}})});}_0x3150b3=_[_0x134c('0x3c')]({},_0x3150b3,_0x11983c[_0x134c('0x3f')]);var _0x3bd67b={'where':_0x3150b3[_0x134c('0x39')]};return db[_0x134c('0x2e')]['count'](_0x3bd67b)[_0x134c('0x40')](function(_0x1f999b){_0x18262c[_0x134c('0x22')]=_0x1f999b;if(_0x11983c[_0x134c('0x32')][_0x134c('0x41')]){_0x3150b3[_0x134c('0x42')]=[{'all':!![]}];}return db[_0x134c('0x2e')][_0x134c('0x43')](_0x3150b3);})['then'](function(_0x349422){_0x18262c[_0x134c('0x44')]=_0x349422;return _0x18262c;})['then'](respondWithFilteredResult(_0x3bb522,_0x3150b3))[_0x134c('0x45')](handleError(_0x3bb522,null));};exports['show']=function(_0x537a1e,_0x50f0d1){var _0x361122={'raw':!![],'where':{'id':_0x537a1e[_0x134c('0x46')]['id']}},_0x546851={};_0x546851[_0x134c('0x31')]=_['keys'](db[_0x134c('0x2e')]['rawAttributes']);_0x546851['query']=_['keys'](_0x537a1e[_0x134c('0x32')]);_0x546851['filters']=_['intersection'](_0x546851[_0x134c('0x31')],_0x546851['query']);_0x361122['attributes']=_[_0x134c('0x47')](_0x546851[_0x134c('0x31')],qs[_0x134c('0x35')](_0x537a1e[_0x134c('0x32')][_0x134c('0x35')]));_0x361122[_0x134c('0x34')]=_0x361122[_0x134c('0x34')][_0x134c('0x36')]?_0x361122['attributes']:_0x546851[_0x134c('0x31')];if(_0x537a1e[_0x134c('0x32')][_0x134c('0x41')]){_0x361122[_0x134c('0x42')]=[{'all':!![]}];}_0x361122=_['merge']({},_0x361122,_0x537a1e[_0x134c('0x3f')]);return db['SmsQueueReport']['find'](_0x361122)[_0x134c('0x40')](handleEntityNotFound(_0x50f0d1,null))['then'](respondWithResult(_0x50f0d1,null))[_0x134c('0x45')](handleError(_0x50f0d1,null));};exports['create']=function(_0x322e5f,_0x4a5d61){return db[_0x134c('0x2e')][_0x134c('0x48')](_0x322e5f['body'],{})[_0x134c('0x40')](respondWithResult(_0x4a5d61,0xc9))[_0x134c('0x45')](handleError(_0x4a5d61,null));};exports[_0x134c('0x49')]=function(_0x568453,_0x2df2b3){if(_0x568453[_0x134c('0x4a')]['id']){delete _0x568453[_0x134c('0x4a')]['id'];}return db['SmsQueueReport'][_0x134c('0x4b')]({'where':{'id':_0x568453[_0x134c('0x46')]['id']}})[_0x134c('0x40')](handleEntityNotFound(_0x2df2b3,null))[_0x134c('0x40')](saveUpdates(_0x568453[_0x134c('0x4a')],null))[_0x134c('0x40')](respondWithResult(_0x2df2b3,null))['catch'](handleError(_0x2df2b3,null));};exports[_0x134c('0x28')]=function(_0x5512b7,_0x51cdd3){return db[_0x134c('0x2e')][_0x134c('0x4b')]({'where':{'id':_0x5512b7['params']['id']}})[_0x134c('0x40')](handleEntityNotFound(_0x51cdd3,null))[_0x134c('0x40')](removeEntity(_0x51cdd3,null))['catch'](handleError(_0x51cdd3,null));};exports[_0x134c('0x4c')]=function(_0x8826a9,_0x5d4586){return db[_0x134c('0x2e')][_0x134c('0x4c')]()[_0x134c('0x40')](respondWithResult(_0x5d4586,null))[_0x134c('0x45')](handleError(_0x5d4586,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 0c3b1a2..68a826f 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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xb5a683,_0x17e5ab){var _0x56d26e=function(_0x5a2003){while(--_0x5a2003){_0xb5a683['push'](_0xb5a683['shift']());}};_0x56d26e(++_0x17e5ab);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 56a63ce..61f5355 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 _0x1fd2=['body','options','raw','then','CreateSmsQueueReport','UpdateSmsQueueReport','SmsQueueReport','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x1fd2,0x112));var _0x21fd=function(_0x2f2589,_0x2ec2b2){_0x2f2589=_0x2f2589-0x0;var _0x57a93a=_0x1fd2[_0x2f2589];return _0x57a93a;};'use strict';var _=require(_0x21fd('0x0'));var util=require(_0x21fd('0x1'));var moment=require('moment');var BPromise=require(_0x21fd('0x2'));var rs=require(_0x21fd('0x3'));var fs=require('fs');var Redis=require(_0x21fd('0x4'));var db=require(_0x21fd('0x5'))['db'];var utils=require(_0x21fd('0x6'));var logger=require('../../config/logger')(_0x21fd('0x7'));var config=require('../../config/environment');var jayson=require(_0x21fd('0x8'));var client=jayson['client'][_0x21fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f46e5,_0x327048,_0x487488){return new BPromise(function(_0x4e1168,_0x1dbb26){return client[_0x21fd('0xa')](_0x3f46e5,_0x487488)['then'](function(_0x3d2dce){logger[_0x21fd('0xb')](_0x21fd('0xc'),_0x327048,_0x21fd('0xd'));logger[_0x21fd('0xe')](_0x21fd('0xf'),_0x327048,_0x21fd('0xd'),JSON[_0x21fd('0x10')](_0x3d2dce));if(_0x3d2dce[_0x21fd('0x11')]){if(_0x3d2dce['error'][_0x21fd('0x12')]===0x1f4){logger[_0x21fd('0x11')](_0x21fd('0xc'),_0x327048,_0x3d2dce[_0x21fd('0x11')][_0x21fd('0x13')]);return _0x1dbb26(_0x3d2dce[_0x21fd('0x11')]['message']);}logger[_0x21fd('0x11')](_0x21fd('0xc'),_0x327048,_0x3d2dce[_0x21fd('0x11')]['message']);return _0x4e1168(_0x3d2dce[_0x21fd('0x11')][_0x21fd('0x13')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x327048,_0x21fd('0xd'));_0x4e1168(_0x3d2dce[_0x21fd('0x14')][_0x21fd('0x13')]);}})[_0x21fd('0x15')](function(_0x6f7d94){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x327048,_0x6f7d94);_0x1dbb26(_0x6f7d94);});});}exports['CreateSmsQueueReport']=function(_0x4e0a98){var _0x35841c=this;return new Promise(function(_0x53ec2b,_0x586a65){return db['SmsQueueReport'][_0x21fd('0x16')](_0x4e0a98[_0x21fd('0x17')],{'raw':_0x4e0a98['options']?_0x4e0a98[_0x21fd('0x18')][_0x21fd('0x19')]===undefined?!![]:![]:!![]})[_0x21fd('0x1a')](function(_0x492045){logger[_0x21fd('0xb')](_0x21fd('0x1b'),_0x4e0a98);logger[_0x21fd('0xe')](_0x21fd('0x1b'),_0x4e0a98,JSON[_0x21fd('0x10')](_0x492045));_0x53ec2b(_0x492045);})['catch'](function(_0x3e0176){logger['error']('CreateSmsQueueReport',_0x3e0176[_0x21fd('0x13')],_0x4e0a98);_0x586a65(_0x35841c['error'](0x1f4,_0x3e0176['message']));});});};exports[_0x21fd('0x1c')]=function(_0x4f6599){var _0x1332c6=this;return new Promise(function(_0x41b92e,_0x21eaec){return db[_0x21fd('0x1d')][_0x21fd('0x1e')](_0x4f6599[_0x21fd('0x17')],{'raw':_0x4f6599[_0x21fd('0x18')]?_0x4f6599[_0x21fd('0x18')][_0x21fd('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6599[_0x21fd('0x18')]?_0x4f6599['options']['where']||null:null,'attributes':_0x4f6599[_0x21fd('0x18')]?_0x4f6599['options'][_0x21fd('0x1f')]||null:null,'limit':_0x4f6599[_0x21fd('0x18')]?_0x4f6599[_0x21fd('0x18')][_0x21fd('0x20')]||null:null})['then'](function(_0x321d03){logger[_0x21fd('0xb')](_0x21fd('0x1c'),_0x4f6599);logger[_0x21fd('0xe')]('UpdateSmsQueueReport',_0x4f6599,JSON[_0x21fd('0x10')](_0x321d03));_0x41b92e(_0x321d03);})[_0x21fd('0x15')](function(_0xd9f1ad){logger[_0x21fd('0x11')]('UpdateSmsQueueReport',_0xd9f1ad[_0x21fd('0x13')],_0x4f6599);_0x21eaec(_0x1332c6[_0x21fd('0x11')](0x1f4,_0xd9f1ad[_0x21fd('0x13')]));});});}; \ No newline at end of file +var _0x0b80=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','SmsQueueReport','create','body','options','raw','info','CreateSmsQueueReport','debug','UpdateSmsQueueReport','update','where','attributes','limit','moment','bluebird','randomstring','ioredis'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x0b80,0x125));var _0x00b8=function(_0x5e0363,_0x4c49fb){_0x5e0363=_0x5e0363-0x0;var _0x5d55a8=_0x0b80[_0x5e0363];return _0x5d55a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x00b8('0x0'));var BPromise=require(_0x00b8('0x1'));var rs=require(_0x00b8('0x2'));var fs=require('fs');var Redis=require(_0x00b8('0x3'));var db=require(_0x00b8('0x4'))['db'];var utils=require(_0x00b8('0x5'));var logger=require(_0x00b8('0x6'))(_0x00b8('0x7'));var config=require(_0x00b8('0x8'));var jayson=require(_0x00b8('0x9'));var client=jayson[_0x00b8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xad9693,_0x1de817,_0x4a4002){return new BPromise(function(_0x4688e4,_0x45ce12){return client[_0x00b8('0xb')](_0xad9693,_0x4a4002)[_0x00b8('0xc')](function(_0x1e294f){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x1de817,_0x00b8('0xd'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x1de817,_0x00b8('0xd'),JSON[_0x00b8('0xe')](_0x1e294f));if(_0x1e294f['error']){if(_0x1e294f[_0x00b8('0xf')][_0x00b8('0x10')]===0x1f4){logger['error'](_0x00b8('0x11'),_0x1de817,_0x1e294f[_0x00b8('0xf')][_0x00b8('0x12')]);return _0x45ce12(_0x1e294f[_0x00b8('0xf')][_0x00b8('0x12')]);}logger['error'](_0x00b8('0x11'),_0x1de817,_0x1e294f[_0x00b8('0xf')][_0x00b8('0x12')]);return _0x4688e4(_0x1e294f['error'][_0x00b8('0x12')]);}else{logger['info'](_0x00b8('0x11'),_0x1de817,'request\x20sent');_0x4688e4(_0x1e294f[_0x00b8('0x13')][_0x00b8('0x12')]);}})['catch'](function(_0xc5340f){logger[_0x00b8('0xf')](_0x00b8('0x11'),_0x1de817,_0xc5340f);_0x45ce12(_0xc5340f);});});}exports['CreateSmsQueueReport']=function(_0x492e69){var _0x2514bd=this;return new Promise(function(_0x1d787e,_0x169e88){return db[_0x00b8('0x14')][_0x00b8('0x15')](_0x492e69[_0x00b8('0x16')],{'raw':_0x492e69['options']?_0x492e69[_0x00b8('0x17')][_0x00b8('0x18')]===undefined?!![]:![]:!![]})[_0x00b8('0xc')](function(_0xbcb10c){logger[_0x00b8('0x19')](_0x00b8('0x1a'),_0x492e69);logger[_0x00b8('0x1b')](_0x00b8('0x1a'),_0x492e69,JSON['stringify'](_0xbcb10c));_0x1d787e(_0xbcb10c);})['catch'](function(_0x371f7c){logger[_0x00b8('0xf')](_0x00b8('0x1a'),_0x371f7c[_0x00b8('0x12')],_0x492e69);_0x169e88(_0x2514bd[_0x00b8('0xf')](0x1f4,_0x371f7c['message']));});});};exports[_0x00b8('0x1c')]=function(_0x5b7804){var _0x1d6ead=this;return new Promise(function(_0x4c2773,_0x34e91f){return db[_0x00b8('0x14')][_0x00b8('0x1d')](_0x5b7804[_0x00b8('0x16')],{'raw':_0x5b7804[_0x00b8('0x17')]?_0x5b7804[_0x00b8('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b7804[_0x00b8('0x17')]?_0x5b7804[_0x00b8('0x17')][_0x00b8('0x1e')]||null:null,'attributes':_0x5b7804[_0x00b8('0x17')]?_0x5b7804[_0x00b8('0x17')][_0x00b8('0x1f')]||null:null,'limit':_0x5b7804[_0x00b8('0x17')]?_0x5b7804[_0x00b8('0x17')][_0x00b8('0x20')]||null:null})[_0x00b8('0xc')](function(_0x43945d){logger[_0x00b8('0x19')]('UpdateSmsQueueReport',_0x5b7804);logger[_0x00b8('0x1b')](_0x00b8('0x1c'),_0x5b7804,JSON[_0x00b8('0xe')](_0x43945d));_0x4c2773(_0x43945d);})['catch'](function(_0x14000d){logger[_0x00b8('0xf')](_0x00b8('0x1c'),_0x14000d['message'],_0x5b7804);_0x34e91f(_0x1d6ead['error'](0x1f4,_0x14000d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 188520f..b6fcf4c 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 _0x46ed=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','multer'];(function(_0x5b2d38,_0x3c461a){var _0x2f7806=function(_0x3433c9){while(--_0x3433c9){_0x5b2d38['push'](_0x5b2d38['shift']());}};_0x2f7806(++_0x3c461a);}(_0x46ed,0x168));var _0xd46e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46ed[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')]('/',auth[_0xd46e('0x9')](),controller[_0xd46e('0xa')]);router[_0xd46e('0x8')](_0xd46e('0xb'),auth[_0xd46e('0x9')](),controller[_0xd46e('0xc')]);router[_0xd46e('0x8')](_0xd46e('0xd'),auth[_0xd46e('0x9')](),controller['show']);router[_0xd46e('0xe')]('/',auth[_0xd46e('0x9')](),controller['create']);router[_0xd46e('0xf')](_0xd46e('0xd'),auth[_0xd46e('0x9')](),controller[_0xd46e('0x10')]);router[_0xd46e('0x11')](_0xd46e('0xd'),auth['isAuthenticated'](),controller[_0xd46e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x31af=['delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update'];(function(_0x297162,_0x2a1207){var _0x1c1b89=function(_0x1d4c5a){while(--_0x1d4c5a){_0x297162['push'](_0x297162['shift']());}};_0x1c1b89(++_0x2a1207);}(_0x31af,0xde));var _0xf31a=function(_0x58727c,_0x1f16d7){_0x58727c=_0x58727c-0x0;var _0x5356e1=_0x31af[_0x58727c];return _0x5356e1;};'use strict';var multer=require(_0xf31a('0x0'));var util=require(_0xf31a('0x1'));var path=require(_0xf31a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf31a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf31a('0x4'));var interaction=require(_0xf31a('0x5'));var config=require(_0xf31a('0x6'));var controller=require(_0xf31a('0x7'));router['get']('/',auth[_0xf31a('0x8')](),controller[_0xf31a('0x9')]);router[_0xf31a('0xa')](_0xf31a('0xb'),auth['isAuthenticated'](),controller[_0xf31a('0xc')]);router[_0xf31a('0xa')](_0xf31a('0xd'),auth[_0xf31a('0x8')](),controller['show']);router[_0xf31a('0xe')]('/',auth[_0xf31a('0x8')](),controller[_0xf31a('0xf')]);router[_0xf31a('0x10')](_0xf31a('0xd'),auth['isAuthenticated'](),controller[_0xf31a('0x11')]);router[_0xf31a('0x12')](_0xf31a('0xd'),auth[_0xf31a('0x8')](),controller['destroy']);module[_0xf31a('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 9a39a99..559fc82 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x718474,_0x298039){var _0x3d660e=function(_0x470c11){while(--_0x470c11){_0x718474['push'](_0x718474['shift']());}};_0x3d660e(++_0x298039);}(_0x70e0,0x17b));var _0x070e=function(_0x2d3eb1,_0x2f0fd1){_0x2d3eb1=_0x2d3eb1-0x0;var _0xa214=_0x70e0[_0x2d3eb1];return _0xa214;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0xb4cc12,_0x41436e){var _0x8593b5=function(_0x13b840){while(--_0x13b840){_0xb4cc12['push'](_0xb4cc12['shift']());}};_0x8593b5(++_0x41436e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x27f29d,_0x245708){_0x27f29d=_0x27f29d-0x0;var _0x5b8aa9=_0xb43b[_0x27f29d];return _0x5b8aa9;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 60f6be2..107a5a7 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 _0xfeda=['status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','map','SmsTransferReport','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2e1f4f,_0x491d3e){var _0x8fa1c2=function(_0x26eb2e){while(--_0x26eb2e){_0x2e1f4f['push'](_0x2e1f4f['shift']());}};_0x8fa1c2(++_0x491d3e);}(_0xfeda,0x11c));var _0xafed=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xfeda[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xafed('0x0'));var zipdir=require(_0xafed('0x1'));var jsonpatch=require(_0xafed('0x2'));var rp=require(_0xafed('0x3'));var moment=require(_0xafed('0x4'));var BPromise=require(_0xafed('0x5'));var Mustache=require(_0xafed('0x6'));var util=require(_0xafed('0x7'));var path=require(_0xafed('0x8'));var sox=require(_0xafed('0x9'));var csv=require('to-csv');var ejs=require(_0xafed('0xa'));var fs=require('fs');var fs_extra=require(_0xafed('0xb'));var _=require(_0xafed('0xc'));var squel=require(_0xafed('0xd'));var crypto=require(_0xafed('0xe'));var jsforce=require(_0xafed('0xf'));var deskjs=require(_0xafed('0x10'));var toCsv=require(_0xafed('0x11'));var querystring=require(_0xafed('0x12'));var Papa=require(_0xafed('0x13'));var Redis=require(_0xafed('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xafed('0x15'));var as=require(_0xafed('0x16'));var hardwareService=require(_0xafed('0x17'));var logger=require(_0xafed('0x18'))('api');var utils=require(_0xafed('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xafed('0x1a'));var db=require(_0xafed('0x1b'))['db'];function respondWithStatusCode(_0x3691c7,_0x2fd3b1){_0x2fd3b1=_0x2fd3b1||0xcc;return function(_0x1f9784){if(_0x1f9784){return _0x3691c7['sendStatus'](_0x2fd3b1);}return _0x3691c7[_0xafed('0x1c')](_0x2fd3b1)[_0xafed('0x1d')]();};}function respondWithResult(_0x4cc3cc,_0xafbbbf){_0xafbbbf=_0xafbbbf||0xc8;return function(_0x415ef9){if(_0x415ef9){return _0x4cc3cc[_0xafed('0x1c')](_0xafbbbf)[_0xafed('0x1e')](_0x415ef9);}};}function respondWithFilteredResult(_0x1e141e,_0x4d0839){return function(_0x297d28){if(_0x297d28){var _0x2e1df5=typeof _0x4d0839[_0xafed('0x1f')]==='undefined'&&typeof _0x4d0839[_0xafed('0x20')]===_0xafed('0x21');var _0x43a629=_0x297d28[_0xafed('0x22')];var _0x5e09c0=_0x2e1df5?0x0:_0x4d0839[_0xafed('0x1f')];var _0x21b5e5=_0x2e1df5?_0x297d28[_0xafed('0x22')]:_0x4d0839[_0xafed('0x1f')]+_0x4d0839[_0xafed('0x20')];var _0x9e6b43;if(_0x21b5e5>=_0x43a629){_0x21b5e5=_0x43a629;_0x9e6b43=0xc8;}else{_0x9e6b43=0xce;}_0x1e141e['status'](_0x9e6b43);return _0x1e141e[_0xafed('0x23')]('Content-Range',_0x5e09c0+'-'+_0x21b5e5+'/'+_0x43a629)[_0xafed('0x1e')](_0x297d28);}return null;};}function patchUpdates(_0x49f985){return function(_0x1d4ed7){try{jsonpatch[_0xafed('0x24')](_0x1d4ed7,_0x49f985,!![]);}catch(_0x181e79){return BPromise[_0xafed('0x25')](_0x181e79);}return _0x1d4ed7[_0xafed('0x26')]();};}function saveUpdates(_0x590dec,_0xa852d0){return function(_0xa6216b){if(_0xa6216b){return _0xa6216b[_0xafed('0x27')](_0x590dec)['then'](function(_0x18b861){return _0x18b861;});}return null;};}function removeEntity(_0x3e2cd2,_0x181715){return function(_0x25b736){if(_0x25b736){return _0x25b736[_0xafed('0x28')]()[_0xafed('0x29')](function(){_0x3e2cd2[_0xafed('0x1c')](0xcc)[_0xafed('0x1d')]();});}};}function handleEntityNotFound(_0x2cc463,_0x1f29ff){return function(_0xa9cace){if(!_0xa9cace){_0x2cc463[_0xafed('0x2a')](0x194);}return _0xa9cace;};}function handleError(_0x385523,_0x3a3615){_0x3a3615=_0x3a3615||0x1f4;return function(_0x3961b9){logger[_0xafed('0x2b')](_0x3961b9[_0xafed('0x2c')]);if(_0x3961b9[_0xafed('0x2d')]){delete _0x3961b9[_0xafed('0x2d')];}_0x385523[_0xafed('0x1c')](_0x3a3615)['send'](_0x3961b9);};}exports['index']=function(_0x38aadc,_0x2e849c){var _0x59c02e={},_0x341ff6={},_0x399ccc={'count':0x0,'rows':[]};var _0x58edb4=_[_0xafed('0x2e')](db[_0xafed('0x2f')]['rawAttributes'],function(_0x4a2610){return{'name':_0x4a2610[_0xafed('0x30')],'type':_0x4a2610[_0xafed('0x31')][_0xafed('0x32')]};});_0x341ff6[_0xafed('0x33')]=_[_0xafed('0x2e')](_0x58edb4,'name');_0x341ff6['query']=_[_0xafed('0x34')](_0x38aadc['query']);_0x341ff6[_0xafed('0x35')]=_[_0xafed('0x36')](_0x341ff6[_0xafed('0x33')],_0x341ff6[_0xafed('0x37')]);_0x59c02e['attributes']=_[_0xafed('0x36')](_0x341ff6[_0xafed('0x33')],qs[_0xafed('0x38')](_0x38aadc[_0xafed('0x37')][_0xafed('0x38')]));_0x59c02e['attributes']=_0x59c02e[_0xafed('0x39')][_0xafed('0x3a')]?_0x59c02e[_0xafed('0x39')]:_0x341ff6[_0xafed('0x33')];if(!_0x38aadc[_0xafed('0x37')][_0xafed('0x3b')]('nolimit')){_0x59c02e[_0xafed('0x20')]=qs['limit'](_0x38aadc[_0xafed('0x37')][_0xafed('0x20')]);_0x59c02e[_0xafed('0x1f')]=qs[_0xafed('0x1f')](_0x38aadc[_0xafed('0x37')][_0xafed('0x1f')]);}_0x59c02e[_0xafed('0x3c')]=qs[_0xafed('0x3d')](_0x38aadc[_0xafed('0x37')][_0xafed('0x3d')]);_0x59c02e[_0xafed('0x3e')]=qs[_0xafed('0x35')](_[_0xafed('0x3f')](_0x38aadc[_0xafed('0x37')],_0x341ff6[_0xafed('0x35')]),_0x58edb4);if(_0x38aadc[_0xafed('0x37')][_0xafed('0x40')]){_0x59c02e[_0xafed('0x3e')]=_[_0xafed('0x41')](_0x59c02e['where'],{'$or':_['map'](_0x58edb4,function(_0x173422){if(_0x173422[_0xafed('0x31')]!=='VIRTUAL'){var _0x54cb3d={};_0x54cb3d[_0x173422['name']]={'$like':'%'+_0x38aadc[_0xafed('0x37')][_0xafed('0x40')]+'%'};return _0x54cb3d;}})});}_0x59c02e=_[_0xafed('0x41')]({},_0x59c02e,_0x38aadc[_0xafed('0x42')]);var _0x453994={'where':_0x59c02e[_0xafed('0x3e')]};return db[_0xafed('0x2f')]['count'](_0x453994)[_0xafed('0x29')](function(_0x2a1dc6){_0x399ccc[_0xafed('0x22')]=_0x2a1dc6;if(_0x38aadc[_0xafed('0x37')][_0xafed('0x43')]){_0x59c02e[_0xafed('0x44')]=[{'all':!![]}];}return db[_0xafed('0x2f')][_0xafed('0x45')](_0x59c02e);})['then'](function(_0x617066){_0x399ccc[_0xafed('0x46')]=_0x617066;return _0x399ccc;})[_0xafed('0x29')](respondWithFilteredResult(_0x2e849c,_0x59c02e))[_0xafed('0x47')](handleError(_0x2e849c,null));};exports[_0xafed('0x48')]=function(_0x697559,_0xd38100){var _0x2f2f08={'raw':!![],'where':{'id':_0x697559[_0xafed('0x49')]['id']}},_0x2fbc1d={};_0x2fbc1d[_0xafed('0x33')]=_[_0xafed('0x34')](db[_0xafed('0x2f')]['rawAttributes']);_0x2fbc1d[_0xafed('0x37')]=_[_0xafed('0x34')](_0x697559[_0xafed('0x37')]);_0x2fbc1d[_0xafed('0x35')]=_[_0xafed('0x36')](_0x2fbc1d[_0xafed('0x33')],_0x2fbc1d[_0xafed('0x37')]);_0x2f2f08['attributes']=_[_0xafed('0x36')](_0x2fbc1d['model'],qs['fields'](_0x697559[_0xafed('0x37')]['fields']));_0x2f2f08[_0xafed('0x39')]=_0x2f2f08[_0xafed('0x39')]['length']?_0x2f2f08[_0xafed('0x39')]:_0x2fbc1d[_0xafed('0x33')];if(_0x697559['query']['includeAll']){_0x2f2f08[_0xafed('0x44')]=[{'all':!![]}];}_0x2f2f08=_['merge']({},_0x2f2f08,_0x697559['options']);return db['SmsTransferReport']['find'](_0x2f2f08)[_0xafed('0x29')](handleEntityNotFound(_0xd38100,null))[_0xafed('0x29')](respondWithResult(_0xd38100,null))[_0xafed('0x47')](handleError(_0xd38100,null));};exports[_0xafed('0x4a')]=function(_0x36c7ce,_0x59edb8){return db[_0xafed('0x2f')][_0xafed('0x4a')](_0x36c7ce[_0xafed('0x4b')],{})['then'](respondWithResult(_0x59edb8,0xc9))[_0xafed('0x47')](handleError(_0x59edb8,null));};exports[_0xafed('0x27')]=function(_0xa373cc,_0x8e7bcc){if(_0xa373cc[_0xafed('0x4b')]['id']){delete _0xa373cc[_0xafed('0x4b')]['id'];}return db[_0xafed('0x2f')][_0xafed('0x4c')]({'where':{'id':_0xa373cc['params']['id']}})[_0xafed('0x29')](handleEntityNotFound(_0x8e7bcc,null))['then'](saveUpdates(_0xa373cc[_0xafed('0x4b')],null))[_0xafed('0x29')](respondWithResult(_0x8e7bcc,null))['catch'](handleError(_0x8e7bcc,null));};exports[_0xafed('0x28')]=function(_0x3626c3,_0x41ecd6){return db['SmsTransferReport'][_0xafed('0x4c')]({'where':{'id':_0x3626c3[_0xafed('0x49')]['id']}})[_0xafed('0x29')](handleEntityNotFound(_0x41ecd6,null))['then'](removeEntity(_0x41ecd6,null))[_0xafed('0x47')](handleError(_0x41ecd6,null));};exports['describe']=function(_0x1fb856,_0x4a0395){return db[_0xafed('0x2f')][_0xafed('0x4d')]()[_0xafed('0x29')](respondWithResult(_0x4a0395,null))[_0xafed('0x47')](handleError(_0x4a0395,null));}; \ No newline at end of file +var _0x7328=['pick','filter','merge','options','include','SmsTransferReport','rows','catch','show','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','where'];(function(_0x1566a8,_0x1c71e4){var _0x88e2f5=function(_0x32b5d9){while(--_0x32b5d9){_0x1566a8['push'](_0x1566a8['shift']());}};_0x88e2f5(++_0x1c71e4);}(_0x7328,0xa5));var _0x8732=function(_0x3ac7de,_0x1aad90){_0x3ac7de=_0x3ac7de-0x0;var _0x2fb1f2=_0x7328[_0x3ac7de];return _0x2fb1f2;};'use strict';var emlformat=require(_0x8732('0x0'));var rimraf=require(_0x8732('0x1'));var zipdir=require(_0x8732('0x2'));var jsonpatch=require(_0x8732('0x3'));var rp=require(_0x8732('0x4'));var moment=require(_0x8732('0x5'));var BPromise=require(_0x8732('0x6'));var Mustache=require('mustache');var util=require(_0x8732('0x7'));var path=require(_0x8732('0x8'));var sox=require('sox');var csv=require(_0x8732('0x9'));var ejs=require(_0x8732('0xa'));var fs=require('fs');var fs_extra=require(_0x8732('0xb'));var _=require(_0x8732('0xc'));var squel=require(_0x8732('0xd'));var crypto=require(_0x8732('0xe'));var jsforce=require(_0x8732('0xf'));var deskjs=require(_0x8732('0x10'));var toCsv=require(_0x8732('0x9'));var querystring=require(_0x8732('0x11'));var Papa=require(_0x8732('0x12'));var Redis=require(_0x8732('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8732('0x14'));var as=require(_0x8732('0x15'));var hardwareService=require(_0x8732('0x16'));var logger=require(_0x8732('0x17'))(_0x8732('0x18'));var utils=require('../../config/utils');var config=require(_0x8732('0x19'));var licenseUtil=require(_0x8732('0x1a'));var db=require(_0x8732('0x1b'))['db'];function respondWithStatusCode(_0x58c200,_0x122555){_0x122555=_0x122555||0xcc;return function(_0x1a3035){if(_0x1a3035){return _0x58c200[_0x8732('0x1c')](_0x122555);}return _0x58c200[_0x8732('0x1d')](_0x122555)['end']();};}function respondWithResult(_0x36d7dd,_0x3a9f33){_0x3a9f33=_0x3a9f33||0xc8;return function(_0x37253c){if(_0x37253c){return _0x36d7dd[_0x8732('0x1d')](_0x3a9f33)[_0x8732('0x1e')](_0x37253c);}};}function respondWithFilteredResult(_0x28a32e,_0x245208){return function(_0x1642fd){if(_0x1642fd){var _0x5a1563=typeof _0x245208['offset']===_0x8732('0x1f')&&typeof _0x245208[_0x8732('0x20')]===_0x8732('0x1f');var _0x4a1e54=_0x1642fd['count'];var _0x2bbbf9=_0x5a1563?0x0:_0x245208['offset'];var _0x4264f7=_0x5a1563?_0x1642fd[_0x8732('0x21')]:_0x245208[_0x8732('0x22')]+_0x245208[_0x8732('0x20')];var _0x3bf767;if(_0x4264f7>=_0x4a1e54){_0x4264f7=_0x4a1e54;_0x3bf767=0xc8;}else{_0x3bf767=0xce;}_0x28a32e[_0x8732('0x1d')](_0x3bf767);return _0x28a32e['set']('Content-Range',_0x2bbbf9+'-'+_0x4264f7+'/'+_0x4a1e54)['json'](_0x1642fd);}return null;};}function patchUpdates(_0x1aa41d){return function(_0x48d86f){try{jsonpatch[_0x8732('0x23')](_0x48d86f,_0x1aa41d,!![]);}catch(_0xe6bdf5){return BPromise[_0x8732('0x24')](_0xe6bdf5);}return _0x48d86f[_0x8732('0x25')]();};}function saveUpdates(_0x4517ef,_0x28734e){return function(_0x3d623a){if(_0x3d623a){return _0x3d623a[_0x8732('0x26')](_0x4517ef)[_0x8732('0x27')](function(_0x586ffe){return _0x586ffe;});}return null;};}function removeEntity(_0x53516f,_0x2c3df8){return function(_0xd57386){if(_0xd57386){return _0xd57386[_0x8732('0x28')]()[_0x8732('0x27')](function(){_0x53516f[_0x8732('0x1d')](0xcc)[_0x8732('0x29')]();});}};}function handleEntityNotFound(_0x1b9e70,_0x271a55){return function(_0xcd6b75){if(!_0xcd6b75){_0x1b9e70[_0x8732('0x1c')](0x194);}return _0xcd6b75;};}function handleError(_0x34f229,_0x4c06c2){_0x4c06c2=_0x4c06c2||0x1f4;return function(_0x1e8214){logger[_0x8732('0x2a')](_0x1e8214['stack']);if(_0x1e8214[_0x8732('0x2b')]){delete _0x1e8214[_0x8732('0x2b')];}_0x34f229['status'](_0x4c06c2)[_0x8732('0x2c')](_0x1e8214);};}exports['index']=function(_0xba1c28,_0x3315ba){var _0x2b515e={},_0x4b2fce={},_0x3028d5={'count':0x0,'rows':[]};var _0x29c1f3=_[_0x8732('0x2d')](db['SmsTransferReport'][_0x8732('0x2e')],function(_0x5ec062){return{'name':_0x5ec062[_0x8732('0x2f')],'type':_0x5ec062[_0x8732('0x30')][_0x8732('0x31')]};});_0x4b2fce[_0x8732('0x32')]=_['map'](_0x29c1f3,_0x8732('0x2b'));_0x4b2fce[_0x8732('0x33')]=_[_0x8732('0x34')](_0xba1c28[_0x8732('0x33')]);_0x4b2fce[_0x8732('0x35')]=_[_0x8732('0x36')](_0x4b2fce[_0x8732('0x32')],_0x4b2fce[_0x8732('0x33')]);_0x2b515e[_0x8732('0x37')]=_[_0x8732('0x36')](_0x4b2fce['model'],qs['fields'](_0xba1c28[_0x8732('0x33')][_0x8732('0x38')]));_0x2b515e[_0x8732('0x37')]=_0x2b515e[_0x8732('0x37')]['length']?_0x2b515e['attributes']:_0x4b2fce[_0x8732('0x32')];if(!_0xba1c28['query']['hasOwnProperty'](_0x8732('0x39'))){_0x2b515e['limit']=qs[_0x8732('0x20')](_0xba1c28[_0x8732('0x33')][_0x8732('0x20')]);_0x2b515e[_0x8732('0x22')]=qs[_0x8732('0x22')](_0xba1c28[_0x8732('0x33')][_0x8732('0x22')]);}_0x2b515e[_0x8732('0x3a')]=qs['sort'](_0xba1c28[_0x8732('0x33')]['sort']);_0x2b515e[_0x8732('0x3b')]=qs[_0x8732('0x35')](_[_0x8732('0x3c')](_0xba1c28[_0x8732('0x33')],_0x4b2fce[_0x8732('0x35')]),_0x29c1f3);if(_0xba1c28[_0x8732('0x33')][_0x8732('0x3d')]){_0x2b515e[_0x8732('0x3b')]=_[_0x8732('0x3e')](_0x2b515e['where'],{'$or':_[_0x8732('0x2d')](_0x29c1f3,function(_0x561fb3){if(_0x561fb3[_0x8732('0x30')]!=='VIRTUAL'){var _0x5a7d7c={};_0x5a7d7c[_0x561fb3['name']]={'$like':'%'+_0xba1c28['query'][_0x8732('0x3d')]+'%'};return _0x5a7d7c;}})});}_0x2b515e=_['merge']({},_0x2b515e,_0xba1c28[_0x8732('0x3f')]);var _0x124119={'where':_0x2b515e[_0x8732('0x3b')]};return db['SmsTransferReport'][_0x8732('0x21')](_0x124119)[_0x8732('0x27')](function(_0x9ae3a1){_0x3028d5[_0x8732('0x21')]=_0x9ae3a1;if(_0xba1c28[_0x8732('0x33')]['includeAll']){_0x2b515e[_0x8732('0x40')]=[{'all':!![]}];}return db[_0x8732('0x41')]['findAll'](_0x2b515e);})['then'](function(_0x362eda){_0x3028d5[_0x8732('0x42')]=_0x362eda;return _0x3028d5;})['then'](respondWithFilteredResult(_0x3315ba,_0x2b515e))[_0x8732('0x43')](handleError(_0x3315ba,null));};exports[_0x8732('0x44')]=function(_0x31efb4,_0x4c8ae5){var _0x2914e2={'raw':!![],'where':{'id':_0x31efb4[_0x8732('0x45')]['id']}},_0x11047b={};_0x11047b[_0x8732('0x32')]=_[_0x8732('0x34')](db[_0x8732('0x41')][_0x8732('0x2e')]);_0x11047b['query']=_['keys'](_0x31efb4[_0x8732('0x33')]);_0x11047b[_0x8732('0x35')]=_[_0x8732('0x36')](_0x11047b['model'],_0x11047b[_0x8732('0x33')]);_0x2914e2[_0x8732('0x37')]=_[_0x8732('0x36')](_0x11047b['model'],qs[_0x8732('0x38')](_0x31efb4[_0x8732('0x33')][_0x8732('0x38')]));_0x2914e2[_0x8732('0x37')]=_0x2914e2[_0x8732('0x37')][_0x8732('0x46')]?_0x2914e2[_0x8732('0x37')]:_0x11047b[_0x8732('0x32')];if(_0x31efb4[_0x8732('0x33')]['includeAll']){_0x2914e2[_0x8732('0x40')]=[{'all':!![]}];}_0x2914e2=_['merge']({},_0x2914e2,_0x31efb4[_0x8732('0x3f')]);return db['SmsTransferReport']['find'](_0x2914e2)[_0x8732('0x27')](handleEntityNotFound(_0x4c8ae5,null))['then'](respondWithResult(_0x4c8ae5,null))['catch'](handleError(_0x4c8ae5,null));};exports[_0x8732('0x47')]=function(_0x16e22b,_0x41095a){return db[_0x8732('0x41')]['create'](_0x16e22b[_0x8732('0x48')],{})[_0x8732('0x27')](respondWithResult(_0x41095a,0xc9))['catch'](handleError(_0x41095a,null));};exports[_0x8732('0x26')]=function(_0x1fb56e,_0x3a4f92){if(_0x1fb56e['body']['id']){delete _0x1fb56e['body']['id'];}return db['SmsTransferReport'][_0x8732('0x49')]({'where':{'id':_0x1fb56e[_0x8732('0x45')]['id']}})[_0x8732('0x27')](handleEntityNotFound(_0x3a4f92,null))['then'](saveUpdates(_0x1fb56e[_0x8732('0x48')],null))[_0x8732('0x27')](respondWithResult(_0x3a4f92,null))[_0x8732('0x43')](handleError(_0x3a4f92,null));};exports[_0x8732('0x28')]=function(_0x523cd5,_0x4d6879){return db[_0x8732('0x41')]['find']({'where':{'id':_0x523cd5[_0x8732('0x45')]['id']}})[_0x8732('0x27')](handleEntityNotFound(_0x4d6879,null))['then'](removeEntity(_0x4d6879,null))[_0x8732('0x43')](handleError(_0x4d6879,null));};exports[_0x8732('0x4a')]=function(_0x268254,_0x269527){return db[_0x8732('0x41')]['describe']()[_0x8732('0x27')](respondWithResult(_0x269527,null))['catch'](handleError(_0x269527,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e4ffda7..63da018 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 _0x1974=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x25d8bb,_0x464fd5){var _0x37debb=function(_0x787220){while(--_0x787220){_0x25d8bb['push'](_0x25d8bb['shift']());}};_0x37debb(++_0x464fd5);}(_0x1974,0x1d3));var _0x4197=function(_0x2938ed,_0x26b501){_0x2938ed=_0x2938ed-0x0;var _0x361028=_0x1974[_0x2938ed];return _0x361028;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4197('0x0'))('api');var moment=require(_0x4197('0x1'));var BPromise=require(_0x4197('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4197('0x3'));var rimraf=require(_0x4197('0x4'));var config=require(_0x4197('0x5'));var attributes=require(_0x4197('0x6'));module[_0x4197('0x7')]=function(_0x43687d,_0x1b0404){return _0x43687d[_0x4197('0x8')](_0x4197('0x9'),attributes,{'tableName':_0x4197('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d3f=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./smsTransferReport.attributes','exports','define'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x8d3f,0x1e4));var _0xf8d3=function(_0xc7419e,_0x4a883e){_0xc7419e=_0xc7419e-0x0;var _0x3b693f=_0x8d3f[_0xc7419e];return _0x3b693f;};'use strict';var _=require(_0xf8d3('0x0'));var util=require(_0xf8d3('0x1'));var logger=require(_0xf8d3('0x2'))('api');var moment=require(_0xf8d3('0x3'));var BPromise=require(_0xf8d3('0x4'));var rp=require(_0xf8d3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf8d3('0x6'));var attributes=require(_0xf8d3('0x7'));module[_0xf8d3('0x8')]=function(_0x208cc1,_0x2b67b9){return _0x208cc1[_0xf8d3('0x9')](_0xf8d3('0xa'),attributes,{'tableName':_0xf8d3('0xb'),'paranoid':![],'indexes':[{'name':_0xf8d3('0xc'),'fields':[_0xf8d3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 17c2af1..5d44f21 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 _0xa7dc=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x288b8,_0x45b725){var _0x268894=function(_0x14e012){while(--_0x14e012){_0x288b8['push'](_0x288b8['shift']());}};_0x268894(++_0x45b725);}(_0xa7dc,0x11d));var _0xca7d=function(_0x39b3c6,_0x4f9948){_0x39b3c6=_0x39b3c6-0x0;var _0x33ec02=_0xa7dc[_0x39b3c6];return _0x33ec02;};'use strict';var _=require(_0xca7d('0x0'));var util=require(_0xca7d('0x1'));var moment=require(_0xca7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xca7d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca7d('0x4'))['db'];var utils=require(_0xca7d('0x5'));var logger=require(_0xca7d('0x6'))(_0xca7d('0x7'));var config=require(_0xca7d('0x8'));var jayson=require(_0xca7d('0x9'));var client=jayson[_0xca7d('0xa')][_0xca7d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5073dd,_0x22223d,_0x820afa){return new BPromise(function(_0x4d5bc7,_0x2920bd){return client[_0xca7d('0xc')](_0x5073dd,_0x820afa)[_0xca7d('0xd')](function(_0x5236ce){logger[_0xca7d('0xe')](_0xca7d('0xf'),_0x22223d,_0xca7d('0x10'));logger[_0xca7d('0x11')](_0xca7d('0x12'),_0x22223d,'request\x20sent',JSON[_0xca7d('0x13')](_0x5236ce));if(_0x5236ce['error']){if(_0x5236ce[_0xca7d('0x14')]['code']===0x1f4){logger[_0xca7d('0x14')](_0xca7d('0xf'),_0x22223d,_0x5236ce[_0xca7d('0x14')][_0xca7d('0x15')]);return _0x2920bd(_0x5236ce['error']['message']);}logger['error'](_0xca7d('0xf'),_0x22223d,_0x5236ce[_0xca7d('0x14')][_0xca7d('0x15')]);return _0x4d5bc7(_0x5236ce[_0xca7d('0x14')][_0xca7d('0x15')]);}else{logger[_0xca7d('0xe')](_0xca7d('0xf'),_0x22223d,_0xca7d('0x10'));_0x4d5bc7(_0x5236ce[_0xca7d('0x16')][_0xca7d('0x15')]);}})[_0xca7d('0x17')](function(_0x245c7c){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x22223d,_0x245c7c);_0x2920bd(_0x245c7c);});});} \ No newline at end of file +var _0x8fed=['stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8fed,0xf5));var _0xd8fe=function(_0x41b6b5,_0x645e16){_0x41b6b5=_0x41b6b5-0x0;var _0x3964c7=_0x8fed[_0x41b6b5];return _0x3964c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd8fe('0x0'));var BPromise=require(_0xd8fe('0x1'));var rs=require(_0xd8fe('0x2'));var fs=require('fs');var Redis=require(_0xd8fe('0x3'));var db=require(_0xd8fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd8fe('0x5'))(_0xd8fe('0x6'));var config=require(_0xd8fe('0x7'));var jayson=require(_0xd8fe('0x8'));var client=jayson[_0xd8fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7e3b94,_0x1747b3,_0xa33e22){return new BPromise(function(_0x26d33d,_0x5e48f9){return client[_0xd8fe('0xa')](_0x7e3b94,_0xa33e22)['then'](function(_0x410d44){logger[_0xd8fe('0xb')](_0xd8fe('0xc'),_0x1747b3,_0xd8fe('0xd'));logger[_0xd8fe('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x1747b3,_0xd8fe('0xd'),JSON[_0xd8fe('0xf')](_0x410d44));if(_0x410d44[_0xd8fe('0x10')]){if(_0x410d44['error'][_0xd8fe('0x11')]===0x1f4){logger['error'](_0xd8fe('0xc'),_0x1747b3,_0x410d44[_0xd8fe('0x10')][_0xd8fe('0x12')]);return _0x5e48f9(_0x410d44[_0xd8fe('0x10')][_0xd8fe('0x12')]);}logger['error'](_0xd8fe('0xc'),_0x1747b3,_0x410d44[_0xd8fe('0x10')]['message']);return _0x26d33d(_0x410d44[_0xd8fe('0x10')][_0xd8fe('0x12')]);}else{logger[_0xd8fe('0xb')](_0xd8fe('0xc'),_0x1747b3,_0xd8fe('0xd'));_0x26d33d(_0x410d44[_0xd8fe('0x13')][_0xd8fe('0x12')]);}})['catch'](function(_0x260a7f){logger['error'](_0xd8fe('0xc'),_0x1747b3,_0x260a7f);_0x5e48f9(_0x260a7f);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 5dd2edb..01b3fa8 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 _0x0f02=['post','single','file','put','update','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now'];(function(_0x1e0118,_0x572d14){var _0x15dccc=function(_0x5350c7){while(--_0x5350c7){_0x1e0118['push'](_0x1e0118['shift']());}};_0x15dccc(++_0x572d14);}(_0x0f02,0x9c));var _0x20f0=function(_0x10cbe4,_0x51eb26){_0x10cbe4=_0x10cbe4-0x0;var _0x5485de=_0x0f02[_0x10cbe4];return _0x5485de;};'use strict';var multer=require(_0x20f0('0x0'));var util=require(_0x20f0('0x1'));var path=require('path');var timeout=require(_0x20f0('0x2'));var express=require(_0x20f0('0x3'));var router=express['Router']();var fs_extra=require(_0x20f0('0x4'));var auth=require(_0x20f0('0x5'));var interaction=require(_0x20f0('0x6'));var config=require(_0x20f0('0x7'));var controller=require('./sound.controller');router[_0x20f0('0x8')]('/',auth[_0x20f0('0x9')](),controller[_0x20f0('0xa')]);router['get'](_0x20f0('0xb'),auth[_0x20f0('0x9')](),controller[_0x20f0('0xc')]);router[_0x20f0('0x8')](_0x20f0('0xd'),auth[_0x20f0('0x9')](),controller[_0x20f0('0xe')]);var upload=multer({'storage':multer[_0x20f0('0xf')]({'destination':function(_0x22f552,_0xfc1664,_0x1ee7f1){_0x1ee7f1(null,path['join'](config[_0x20f0('0x10')],_0x20f0('0x11')));},'filename':function(_0x2c42b0,_0x4ee4cf,_0x2b49b2){_0x4ee4cf[_0x20f0('0x12')]=_0x4ee4cf[_0x20f0('0x12')][_0x20f0('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b49b2(null,util[_0x20f0('0x14')](_0x20f0('0x15'),path['basename'](_0x4ee4cf['originalname'],path[_0x20f0('0x16')](_0x4ee4cf[_0x20f0('0x12')])),Date[_0x20f0('0x17')](),path[_0x20f0('0x16')](_0x4ee4cf['originalname'])));}})});router[_0x20f0('0x18')]('/',upload[_0x20f0('0x19')](_0x20f0('0x1a')),controller['create']);router[_0x20f0('0x1b')](_0x20f0('0xb'),auth[_0x20f0('0x9')](),controller[_0x20f0('0x1c')]);router[_0x20f0('0x1d')]('/:id',auth[_0x20f0('0x9')](),controller[_0x20f0('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x254d=['now','post','single','file','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname'];(function(_0x5e67be,_0x271ac8){var _0x45c259=function(_0x5eb9d7){while(--_0x5eb9d7){_0x5e67be['push'](_0x5e67be['shift']());}};_0x45c259(++_0x271ac8);}(_0x254d,0xc2));var _0xd254=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0x254d[_0x3ef45e];return _0x69e7c;};'use strict';var multer=require(_0xd254('0x0'));var util=require(_0xd254('0x1'));var path=require(_0xd254('0x2'));var timeout=require('connect-timeout');var express=require(_0xd254('0x3'));var router=express['Router']();var fs_extra=require(_0xd254('0x4'));var auth=require(_0xd254('0x5'));var interaction=require(_0xd254('0x6'));var config=require(_0xd254('0x7'));var controller=require('./sound.controller');router[_0xd254('0x8')]('/',auth[_0xd254('0x9')](),controller[_0xd254('0xa')]);router[_0xd254('0x8')](_0xd254('0xb'),auth[_0xd254('0x9')](),controller[_0xd254('0xc')]);router[_0xd254('0x8')](_0xd254('0xd'),auth['isAuthenticated'](),controller[_0xd254('0xe')]);var upload=multer({'storage':multer[_0xd254('0xf')]({'destination':function(_0x25b1b6,_0x396f4b,_0x4042ee){_0x4042ee(null,path[_0xd254('0x10')](config['root'],_0xd254('0x11')));},'filename':function(_0x3ecc0c,_0x92cb02,_0x5880aa){_0x92cb02[_0xd254('0x12')]=_0x92cb02['originalname'][_0xd254('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5880aa(null,util[_0xd254('0x14')](_0xd254('0x15'),path['basename'](_0x92cb02[_0xd254('0x12')],path[_0xd254('0x16')](_0x92cb02[_0xd254('0x12')])),Date[_0xd254('0x17')](),path[_0xd254('0x16')](_0x92cb02[_0xd254('0x12')])));}})});router[_0xd254('0x18')]('/',upload[_0xd254('0x19')](_0xd254('0x1a')),controller[_0xd254('0x1b')]);router[_0xd254('0x1c')](_0xd254('0xb'),auth[_0xd254('0x9')](),controller[_0xd254('0x1d')]);router[_0xd254('0x1e')](_0xd254('0xb'),auth[_0xd254('0x9')](),controller[_0xd254('0x1e')]);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 b25f84d..cbb1b99 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 _0xc7ea=['name','STRING','BIGINT','INTEGER','FLOAT','sequelize'];(function(_0xff01d2,_0x55806d){var _0xde0945=function(_0x1423fe){while(--_0x1423fe){_0xff01d2['push'](_0xff01d2['shift']());}};_0xde0945(++_0x55806d);}(_0xc7ea,0xe3));var _0xac7e=function(_0x4fb28b,_0x22fc65){_0x4fb28b=_0x4fb28b-0x0;var _0x46753a=_0xc7ea[_0x4fb28b];return _0x46753a;};'use strict';var Sequelize=require(_0xac7e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xac7e('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xac7e('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xac7e('0x2')]},'original_format':{'type':Sequelize[_0xac7e('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xac7e('0x3')]},'original_channelCount':{'type':Sequelize[_0xac7e('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xac7e('0x5')]},'converted_sampleCount':{'type':Sequelize[_0xac7e('0x3')]},'converted_channelCount':{'type':Sequelize[_0xac7e('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x773d=['name','STRING','FLOAT','BIGINT','INTEGER','exports'];(function(_0x50b451,_0xba9b68){var _0xd58466=function(_0x46b91c){while(--_0x46b91c){_0x50b451['push'](_0x50b451['shift']());}};_0xd58466(++_0xba9b68);}(_0x773d,0xa1));var _0xd773=function(_0x574c85,_0x1c8179){_0x574c85=_0x574c85-0x0;var _0x1e0989=_0x773d[_0x574c85];return _0x1e0989;};'use strict';var Sequelize=require('sequelize');module[_0xd773('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd773('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xd773('0x2')]},'original_format':{'type':Sequelize[_0xd773('0x2')]},'original_duration':{'type':Sequelize[_0xd773('0x3')]},'original_sampleCount':{'type':Sequelize[_0xd773('0x4')]},'original_channelCount':{'type':Sequelize[_0xd773('0x5')]},'original_bitRate':{'type':Sequelize[_0xd773('0x4')]},'original_sampleRate':{'type':Sequelize[_0xd773('0x5')]},'converted_format':{'type':Sequelize[_0xd773('0x2')]},'converted_duration':{'type':Sequelize[_0xd773('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xd773('0x5')]},'converted_bitRate':{'type':Sequelize[_0xd773('0x4')]},'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 dc0fe97..9bf6478 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 _0x0666=['converted_duration','converted_sampleCount','converted_bitRate','sampleRate','role','body','userProfileId','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Sounds','UserProfileResource','error','stack','name','index','map','Sound','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','keys','find','save_name','converted_format','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','send','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','dest'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0666,0x1ee));var _0x6066=function(_0x1ef246,_0x42e40){_0x1ef246=_0x1ef246-0x0;var _0x229a28=_0x0666[_0x1ef246];return _0x229a28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6066('0x0'));var zipdir=require(_0x6066('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6066('0x2'));var moment=require(_0x6066('0x3'));var BPromise=require(_0x6066('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6066('0x5'));var csv=require(_0x6066('0x6'));var ejs=require(_0x6066('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6066('0x8'));var squel=require(_0x6066('0x9'));var crypto=require(_0x6066('0xa'));var jsforce=require(_0x6066('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6066('0xc'));var Papa=require('papaparse');var Redis=require(_0x6066('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6066('0xe'));var as=require(_0x6066('0xf'));var hardwareService=require(_0x6066('0x10'));var logger=require(_0x6066('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6066('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bc57c,_0x373f99){_0x373f99=_0x373f99||0xcc;return function(_0x3fb284){if(_0x3fb284){return _0x4bc57c[_0x6066('0x13')](_0x373f99);}return _0x4bc57c[_0x6066('0x14')](_0x373f99)[_0x6066('0x15')]();};}function respondWithResult(_0x85321a,_0x5eb6ec){_0x5eb6ec=_0x5eb6ec||0xc8;return function(_0x54d8b4){if(_0x54d8b4){return _0x85321a[_0x6066('0x14')](_0x5eb6ec)[_0x6066('0x16')](_0x54d8b4);}};}function respondWithFilteredResult(_0x572a61,_0x270cc9){return function(_0x3861f1){if(_0x3861f1){var _0x418c15=typeof _0x270cc9[_0x6066('0x17')]===_0x6066('0x18')&&typeof _0x270cc9[_0x6066('0x19')]==='undefined';var _0x2feb2f=_0x3861f1[_0x6066('0x1a')];var _0x4c8f44=_0x418c15?0x0:_0x270cc9[_0x6066('0x17')];var _0xb35ed6=_0x418c15?_0x3861f1[_0x6066('0x1a')]:_0x270cc9[_0x6066('0x17')]+_0x270cc9['limit'];var _0x3c2873;if(_0xb35ed6>=_0x2feb2f){_0xb35ed6=_0x2feb2f;_0x3c2873=0xc8;}else{_0x3c2873=0xce;}_0x572a61['status'](_0x3c2873);return _0x572a61[_0x6066('0x1b')](_0x6066('0x1c'),_0x4c8f44+'-'+_0xb35ed6+'/'+_0x2feb2f)['json'](_0x3861f1);}return null;};}function patchUpdates(_0x3c18cb){return function(_0xc9cdfb){try{jsonpatch[_0x6066('0x1d')](_0xc9cdfb,_0x3c18cb,!![]);}catch(_0x185891){return BPromise[_0x6066('0x1e')](_0x185891);}return _0xc9cdfb[_0x6066('0x1f')]();};}function saveUpdates(_0x4debbc,_0x3e35a8){return function(_0x3fc95d){if(_0x3fc95d){return _0x3fc95d[_0x6066('0x20')](_0x4debbc)['then'](function(_0x59458b){return _0x59458b;});}return null;};}function removeEntity(_0x5cbee5,_0x3a6fe5){return function(_0x5f53cf){if(_0x5f53cf){return _0x5f53cf[_0x6066('0x21')]()[_0x6066('0x22')](function(){var _0x53753f=_0x5f53cf[_0x6066('0x23')]({'plain':!![]});var _0x1c2173=_0x6066('0x24');return db[_0x6066('0x25')][_0x6066('0x21')]({'where':{'type':_0x1c2173,'resourceId':_0x53753f['id']}})[_0x6066('0x22')](function(){return _0x5f53cf;});})[_0x6066('0x22')](function(){_0x5cbee5[_0x6066('0x14')](0xcc)[_0x6066('0x15')]();});}};}function handleEntityNotFound(_0x55a93f,_0x3dffe2){return function(_0x10cb83){if(!_0x10cb83){_0x55a93f[_0x6066('0x13')](0x194);}return _0x10cb83;};}function handleError(_0x22fc91,_0x522f48){_0x522f48=_0x522f48||0x1f4;return function(_0x12a4c9){logger[_0x6066('0x26')](_0x12a4c9[_0x6066('0x27')]);if(_0x12a4c9[_0x6066('0x28')]){delete _0x12a4c9[_0x6066('0x28')];}_0x22fc91[_0x6066('0x14')](_0x522f48)['send'](_0x12a4c9);};}exports[_0x6066('0x29')]=function(_0x2ec958,_0x3b622e){var _0x4b3772={},_0x12deba={},_0x430b78={'count':0x0,'rows':[]};var _0x590aa8=_[_0x6066('0x2a')](db[_0x6066('0x2b')]['rawAttributes'],function(_0x2376c9){return{'name':_0x2376c9[_0x6066('0x2c')],'type':_0x2376c9['type'][_0x6066('0x2d')]};});_0x12deba[_0x6066('0x2e')]=_['map'](_0x590aa8,_0x6066('0x28'));_0x12deba['query']=_['keys'](_0x2ec958[_0x6066('0x2f')]);_0x12deba[_0x6066('0x30')]=_[_0x6066('0x31')](_0x12deba[_0x6066('0x2e')],_0x12deba[_0x6066('0x2f')]);_0x4b3772[_0x6066('0x32')]=_['intersection'](_0x12deba[_0x6066('0x2e')],qs[_0x6066('0x33')](_0x2ec958[_0x6066('0x2f')][_0x6066('0x33')]));_0x4b3772['attributes']=_0x4b3772[_0x6066('0x32')][_0x6066('0x34')]?_0x4b3772[_0x6066('0x32')]:_0x12deba['model'];if(!_0x2ec958[_0x6066('0x2f')][_0x6066('0x35')](_0x6066('0x36'))){_0x4b3772[_0x6066('0x19')]=qs[_0x6066('0x19')](_0x2ec958[_0x6066('0x2f')][_0x6066('0x19')]);_0x4b3772[_0x6066('0x17')]=qs[_0x6066('0x17')](_0x2ec958[_0x6066('0x2f')][_0x6066('0x17')]);}_0x4b3772[_0x6066('0x37')]=qs[_0x6066('0x38')](_0x2ec958[_0x6066('0x2f')][_0x6066('0x38')]);_0x4b3772['where']=qs[_0x6066('0x30')](_['pick'](_0x2ec958[_0x6066('0x2f')],_0x12deba[_0x6066('0x30')]),_0x590aa8);if(_0x2ec958[_0x6066('0x2f')][_0x6066('0x39')]){_0x4b3772['where']=_[_0x6066('0x3a')](_0x4b3772[_0x6066('0x3b')],{'$or':_['map'](_0x590aa8,function(_0x563985){if(_0x563985['type']!==_0x6066('0x3c')){var _0x21846c={};_0x21846c[_0x563985['name']]={'$like':'%'+_0x2ec958[_0x6066('0x2f')][_0x6066('0x39')]+'%'};return _0x21846c;}})});}_0x4b3772=_[_0x6066('0x3a')]({},_0x4b3772,_0x2ec958[_0x6066('0x3d')]);var _0x83e62a={'where':_0x4b3772[_0x6066('0x3b')]};return db[_0x6066('0x2b')][_0x6066('0x1a')](_0x83e62a)['then'](function(_0x56b185){_0x430b78['count']=_0x56b185;if(_0x2ec958[_0x6066('0x2f')][_0x6066('0x3e')]){_0x4b3772['include']=[{'all':!![]}];}return db[_0x6066('0x2b')]['findAll'](_0x4b3772);})['then'](function(_0x3d8f42){_0x430b78[_0x6066('0x3f')]=_0x3d8f42;return _0x430b78;})[_0x6066('0x22')](respondWithFilteredResult(_0x3b622e,_0x4b3772))[_0x6066('0x40')](handleError(_0x3b622e,null));};exports[_0x6066('0x41')]=function(_0x4b80b0,_0x475ac7){var _0x3bc4ac={'raw':!![],'where':{'id':_0x4b80b0[_0x6066('0x42')]['id']}},_0x7211b5={};_0x7211b5[_0x6066('0x2e')]=_['keys'](db[_0x6066('0x2b')][_0x6066('0x43')]);_0x7211b5['query']=_[_0x6066('0x44')](_0x4b80b0['query']);_0x7211b5[_0x6066('0x30')]=_['intersection'](_0x7211b5['model'],_0x7211b5[_0x6066('0x2f')]);_0x3bc4ac[_0x6066('0x32')]=_[_0x6066('0x31')](_0x7211b5[_0x6066('0x2e')],qs['fields'](_0x4b80b0[_0x6066('0x2f')][_0x6066('0x33')]));_0x3bc4ac[_0x6066('0x32')]=_0x3bc4ac[_0x6066('0x32')][_0x6066('0x34')]?_0x3bc4ac[_0x6066('0x32')]:_0x7211b5['model'];if(_0x4b80b0[_0x6066('0x2f')]['includeAll']){_0x3bc4ac['include']=[{'all':!![]}];}_0x3bc4ac=_[_0x6066('0x3a')]({},_0x3bc4ac,_0x4b80b0[_0x6066('0x3d')]);return db[_0x6066('0x2b')]['find'](_0x3bc4ac)['then'](handleEntityNotFound(_0x475ac7,null))[_0x6066('0x22')](respondWithResult(_0x475ac7,null))[_0x6066('0x40')](handleError(_0x475ac7,null));};exports['download']=function(_0x1515cd,_0x32a8a8,_0x10dd0f){return db['Sound'][_0x6066('0x45')]({'where':{'id':_0x1515cd[_0x6066('0x42')]['id']},'attributes':[_0x6066('0x28'),_0x6066('0x46'),_0x6066('0x47')],'raw':!![]})[_0x6066('0x22')](handleEntityNotFound(_0x32a8a8,null))['then'](function(_0x400d06){if(_0x400d06){if(!fs['existsSync'](path[_0x6066('0x48')](config['root'],_0x6066('0x49'),_0x400d06[_0x6066('0x46')]+'.'+_0x400d06[_0x6066('0x47')]))){throw new db[(_0x6066('0x4a'))][(_0x6066('0x4b'))](_0x6066('0x4c'));}return _0x32a8a8['download'](path['join'](config[_0x6066('0x4d')],_0x6066('0x49'),util[_0x6066('0x4e')](_0x6066('0x4f'),_0x400d06['save_name'],_0x400d06[_0x6066('0x47')])),util[_0x6066('0x4e')]('%s.%s',_0x400d06[_0x6066('0x28')],_0x400d06[_0x6066('0x47')]));}return null;})[_0x6066('0x40')](handleError(_0x32a8a8,null));};exports[_0x6066('0x50')]=function(_0x52b0b9,_0x4f0387,_0x557f2c){var _0x3320cc={'name':path[_0x6066('0x51')](_0x52b0b9[_0x6066('0x52')][_0x6066('0x53')],path[_0x6066('0x54')](_0x52b0b9[_0x6066('0x52')]['originalname'])),'save_name':path[_0x6066('0x51')](_0x52b0b9[_0x6066('0x52')]['filename'],path['extname'](_0x52b0b9[_0x6066('0x52')][_0x6066('0x55')])),'original_format':path[_0x6066('0x54')](_0x52b0b9[_0x6066('0x52')][_0x6066('0x53')])[_0x6066('0x56')](0x1),'converted_format':_0x6066('0x57')};var _0x149830=path[_0x6066('0x48')](config[_0x6066('0x4d')],_0x6066('0x58'),_0x52b0b9[_0x6066('0x52')][_0x6066('0x55')]);var _0x4a7fb6=path[_0x6066('0x48')](config[_0x6066('0x4d')],_0x6066('0x49'),util['format'](_0x6066('0x4f'),path[_0x6066('0x51')](_0x52b0b9[_0x6066('0x52')][_0x6066('0x55')],path['extname'](_0x52b0b9[_0x6066('0x52')][_0x6066('0x55')])),_0x3320cc[_0x6066('0x47')]));logger[_0x6066('0x59')](_0x6066('0x5a'),_0x149830);logger[_0x6066('0x59')](_0x6066('0x5b'),_0x4a7fb6);try{fs[_0x6066('0x5c')](_0x149830,parseInt(_0x6066('0x5d'),0x8));var _0x526f1f=sox['transcode'](_0x149830,_0x4a7fb6,{'sampleRate':0x1f40,'format':_0x6066('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526f1f['on']('error',function(_0xfbe0ac){fs[_0x6066('0x5e')](_0x149830);_0x4f0387[_0x6066('0x14')](0x1f4)[_0x6066('0x5f')](_0xfbe0ac);});_0x526f1f['on']('src',function(_0x43f3f0){_0x3320cc[_0x6066('0x60')]=isNaN(_0x43f3f0[_0x6066('0x61')])?null:_0x43f3f0['duration']*0x3e8;_0x3320cc[_0x6066('0x62')]=isNaN(_0x43f3f0[_0x6066('0x63')])?null:_0x43f3f0[_0x6066('0x63')];_0x3320cc[_0x6066('0x64')]=isNaN(_0x43f3f0[_0x6066('0x65')])?null:_0x43f3f0[_0x6066('0x65')];_0x3320cc[_0x6066('0x66')]=isNaN(_0x43f3f0['bitRate'])?null:_0x43f3f0[_0x6066('0x67')];_0x3320cc[_0x6066('0x68')]=isNaN(_0x43f3f0['sampleRate'])?null:_0x43f3f0['sampleRate'];});_0x526f1f['on'](_0x6066('0x69'),function(_0x1e116b){_0x3320cc[_0x6066('0x6a')]=isNaN(_0x1e116b[_0x6066('0x61')])?null:_0x1e116b[_0x6066('0x61')]*0x3e8;_0x3320cc[_0x6066('0x6b')]=isNaN(_0x1e116b['sampleCount'])?null:_0x1e116b[_0x6066('0x63')];_0x3320cc['converted_channelCount']=isNaN(_0x1e116b[_0x6066('0x65')])?null:_0x1e116b[_0x6066('0x65')];_0x3320cc[_0x6066('0x6c')]=isNaN(_0x1e116b[_0x6066('0x67')])?null:_0x1e116b[_0x6066('0x67')];_0x3320cc['converted_sampleRate']=isNaN(_0x1e116b['sampleRate'])?null:_0x1e116b[_0x6066('0x6d')];});_0x526f1f['on'](_0x6066('0x15'),function(){fs[_0x6066('0x5c')](_0x4a7fb6,parseInt('0777',0x8));return db[_0x6066('0x2b')][_0x6066('0x50')](_0x3320cc)['then'](function(_0x18c12c){var _0x568e8c={'role':_0x52b0b9['body'][_0x6066('0x6e')],'userProfileId':_0x52b0b9[_0x6066('0x6f')][_0x6066('0x70')]};if(!_0x568e8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x568e8c[_0x6066('0x6e')]===_0x6066('0x71')){var _0x165991=_0x18c12c[_0x6066('0x23')]({'plain':!![]});return db[_0x6066('0x72')][_0x6066('0x45')]({'where':{'name':'Sounds','userProfileId':_0x568e8c[_0x6066('0x70')]},'raw':!![]})[_0x6066('0x22')](function(_0x36a09b){if(_0x36a09b&&_0x36a09b['autoAssociation']===0x0){return db['UserProfileResource'][_0x6066('0x50')]({'name':_0x165991[_0x6066('0x28')],'resourceId':_0x165991['id'],'type':_0x36a09b[_0x6066('0x28')],'sectionId':_0x36a09b['id']},{})['then'](function(){return _0x18c12c;});}else{return _0x18c12c;}})['catch'](function(_0x58a8b1){logger[_0x6066('0x26')](_0x6066('0x73'),_0x58a8b1);throw _0x58a8b1;});}return _0x18c12c;})[_0x6066('0x22')](respondWithResult(_0x4f0387,null))[_0x6066('0x40')](handleError(_0x4f0387,null));});_0x526f1f[_0x6066('0x74')]();}catch(_0x4413fb){_0x4f0387['status'](0x1f4)[_0x6066('0x5f')](_0x4413fb);}};exports[_0x6066('0x20')]=function(_0x2c842e,_0x9229ad,_0x2c20a2){return db[_0x6066('0x2b')][_0x6066('0x45')]({'where':{'id':_0x2c842e[_0x6066('0x42')]['id']}})[_0x6066('0x22')](handleEntityNotFound(_0x9229ad,null))['then'](saveUpdates(_[_0x6066('0x75')](_0x2c842e[_0x6066('0x6f')],[_0x6066('0x28'),_0x6066('0x76')]),null))['then'](respondWithResult(_0x9229ad,null))[_0x6066('0x40')](handleError(_0x9229ad,null));};exports[_0x6066('0x77')]=function(_0x267622,_0x4efceb,_0x5101e1){return db['Sound'][_0x6066('0x45')]({'where':{'id':_0x267622['params']['id']}})[_0x6066('0x22')](function(_0x22a977){if(_0x22a977){return _0x22a977[_0x6066('0x21')]();}})['then'](function(_0x2d85f1){var _0x36a038=path[_0x6066('0x48')](config[_0x6066('0x4d')],'server/files/sounds/original',util['format'](_0x6066('0x4f'),_0x2d85f1[_0x6066('0x46')],_0x2d85f1['original_format']));var _0x5e8e8=path[_0x6066('0x48')](config[_0x6066('0x4d')],_0x6066('0x49'),util[_0x6066('0x4e')](_0x6066('0x4f'),_0x2d85f1[_0x6066('0x46')],_0x2d85f1[_0x6066('0x47')]));fs[_0x6066('0x5e')](_0x36a038);fs[_0x6066('0x5e')](_0x5e8e8);return _0x2d85f1;})[_0x6066('0x22')](function(_0x16d6c6){if(_0x16d6c6){return _0x4efceb[_0x6066('0x14')](0xcc)['end']();}})[_0x6066('0x22')](handleEntityNotFound(_0x4efceb,null))['catch'](handleError(_0x4efceb,null));}; \ No newline at end of file +var _0x98a7=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','end','error','stack','name','send','Sound','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','findAll','rows','show','params','length','options','find','catch','download','save_name','existsSync','join','root','converted_format','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','basename','originalname','file','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','original_format','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x262b11,_0x39937){var _0x3013ed=function(_0x525a11){while(--_0x525a11){_0x262b11['push'](_0x262b11['shift']());}};_0x3013ed(++_0x39937);}(_0x98a7,0x15a));var _0x798a=function(_0x2e787b,_0x371e3b){_0x2e787b=_0x2e787b-0x0;var _0x2c69e8=_0x98a7[_0x2e787b];return _0x2c69e8;};'use strict';var emlformat=require(_0x798a('0x0'));var rimraf=require(_0x798a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x798a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x798a('0x3'));var Mustache=require('mustache');var util=require(_0x798a('0x4'));var path=require(_0x798a('0x5'));var sox=require(_0x798a('0x6'));var csv=require(_0x798a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x798a('0x8'));var _=require(_0x798a('0x9'));var squel=require(_0x798a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x798a('0xb'));var toCsv=require(_0x798a('0x7'));var querystring=require(_0x798a('0xc'));var Papa=require(_0x798a('0xd'));var Redis=require(_0x798a('0xe'));var authService=require(_0x798a('0xf'));var qs=require(_0x798a('0x10'));var as=require(_0x798a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x798a('0x12'));var utils=require(_0x798a('0x13'));var config=require(_0x798a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x798a('0x15'))['db'];function respondWithStatusCode(_0x2a80da,_0x56216f){_0x56216f=_0x56216f||0xcc;return function(_0x4b693b){if(_0x4b693b){return _0x2a80da[_0x798a('0x16')](_0x56216f);}return _0x2a80da['status'](_0x56216f)['end']();};}function respondWithResult(_0x649e9c,_0x2d9533){_0x2d9533=_0x2d9533||0xc8;return function(_0x2be908){if(_0x2be908){return _0x649e9c[_0x798a('0x17')](_0x2d9533)[_0x798a('0x18')](_0x2be908);}};}function respondWithFilteredResult(_0x197459,_0x2601df){return function(_0x3f6343){if(_0x3f6343){var _0xb321fa=typeof _0x2601df[_0x798a('0x19')]==='undefined'&&typeof _0x2601df[_0x798a('0x1a')]===_0x798a('0x1b');var _0x197079=_0x3f6343[_0x798a('0x1c')];var _0x562b55=_0xb321fa?0x0:_0x2601df['offset'];var _0x407757=_0xb321fa?_0x3f6343[_0x798a('0x1c')]:_0x2601df[_0x798a('0x19')]+_0x2601df[_0x798a('0x1a')];var _0x1f174d;if(_0x407757>=_0x197079){_0x407757=_0x197079;_0x1f174d=0xc8;}else{_0x1f174d=0xce;}_0x197459['status'](_0x1f174d);return _0x197459['set'](_0x798a('0x1d'),_0x562b55+'-'+_0x407757+'/'+_0x197079)[_0x798a('0x18')](_0x3f6343);}return null;};}function patchUpdates(_0x319619){return function(_0x40a9cd){try{jsonpatch[_0x798a('0x1e')](_0x40a9cd,_0x319619,!![]);}catch(_0x3fb944){return BPromise[_0x798a('0x1f')](_0x3fb944);}return _0x40a9cd[_0x798a('0x20')]();};}function saveUpdates(_0x2cc17a,_0x31813f){return function(_0x502a42){if(_0x502a42){return _0x502a42[_0x798a('0x21')](_0x2cc17a)[_0x798a('0x22')](function(_0x243dae){return _0x243dae;});}return null;};}function removeEntity(_0x31ccb8,_0x35521d){return function(_0x479e98){if(_0x479e98){return _0x479e98[_0x798a('0x23')]()[_0x798a('0x22')](function(){var _0x446d94=_0x479e98[_0x798a('0x24')]({'plain':!![]});var _0x24f085=_0x798a('0x25');return db['UserProfileResource'][_0x798a('0x23')]({'where':{'type':_0x24f085,'resourceId':_0x446d94['id']}})[_0x798a('0x22')](function(){return _0x479e98;});})[_0x798a('0x22')](function(){_0x31ccb8[_0x798a('0x17')](0xcc)[_0x798a('0x26')]();});}};}function handleEntityNotFound(_0x2267ef,_0x5f42a4){return function(_0x4933f0){if(!_0x4933f0){_0x2267ef[_0x798a('0x16')](0x194);}return _0x4933f0;};}function handleError(_0x4749ff,_0x87a8c5){_0x87a8c5=_0x87a8c5||0x1f4;return function(_0x5800d4){logger[_0x798a('0x27')](_0x5800d4[_0x798a('0x28')]);if(_0x5800d4[_0x798a('0x29')]){delete _0x5800d4['name'];}_0x4749ff[_0x798a('0x17')](_0x87a8c5)[_0x798a('0x2a')](_0x5800d4);};}exports['index']=function(_0x11dc8a,_0x3eda6e){var _0x1c9fa8={},_0x3a6146={},_0x5aa090={'count':0x0,'rows':[]};var _0x49afbf=_['map'](db[_0x798a('0x2b')][_0x798a('0x2c')],function(_0x4a0dee){return{'name':_0x4a0dee['fieldName'],'type':_0x4a0dee[_0x798a('0x2d')][_0x798a('0x2e')]};});_0x3a6146[_0x798a('0x2f')]=_['map'](_0x49afbf,_0x798a('0x29'));_0x3a6146[_0x798a('0x30')]=_[_0x798a('0x31')](_0x11dc8a[_0x798a('0x30')]);_0x3a6146[_0x798a('0x32')]=_[_0x798a('0x33')](_0x3a6146[_0x798a('0x2f')],_0x3a6146[_0x798a('0x30')]);_0x1c9fa8['attributes']=_[_0x798a('0x33')](_0x3a6146['model'],qs[_0x798a('0x34')](_0x11dc8a['query']['fields']));_0x1c9fa8[_0x798a('0x35')]=_0x1c9fa8['attributes']['length']?_0x1c9fa8['attributes']:_0x3a6146[_0x798a('0x2f')];if(!_0x11dc8a[_0x798a('0x30')]['hasOwnProperty'](_0x798a('0x36'))){_0x1c9fa8[_0x798a('0x1a')]=qs[_0x798a('0x1a')](_0x11dc8a[_0x798a('0x30')][_0x798a('0x1a')]);_0x1c9fa8['offset']=qs['offset'](_0x11dc8a['query'][_0x798a('0x19')]);}_0x1c9fa8[_0x798a('0x37')]=qs[_0x798a('0x38')](_0x11dc8a[_0x798a('0x30')]['sort']);_0x1c9fa8[_0x798a('0x39')]=qs[_0x798a('0x32')](_[_0x798a('0x3a')](_0x11dc8a['query'],_0x3a6146[_0x798a('0x32')]),_0x49afbf);if(_0x11dc8a['query'][_0x798a('0x3b')]){_0x1c9fa8[_0x798a('0x39')]=_[_0x798a('0x3c')](_0x1c9fa8[_0x798a('0x39')],{'$or':_[_0x798a('0x3d')](_0x49afbf,function(_0x3605f7){if(_0x3605f7[_0x798a('0x2d')]!=='VIRTUAL'){var _0x432b74={};_0x432b74[_0x3605f7[_0x798a('0x29')]]={'$like':'%'+_0x11dc8a['query'][_0x798a('0x3b')]+'%'};return _0x432b74;}})});}_0x1c9fa8=_[_0x798a('0x3c')]({},_0x1c9fa8,_0x11dc8a['options']);var _0x5f9e0={'where':_0x1c9fa8['where']};return db[_0x798a('0x2b')][_0x798a('0x1c')](_0x5f9e0)['then'](function(_0x535128){_0x5aa090[_0x798a('0x1c')]=_0x535128;if(_0x11dc8a[_0x798a('0x30')][_0x798a('0x3e')]){_0x1c9fa8[_0x798a('0x3f')]=[{'all':!![]}];}return db[_0x798a('0x2b')][_0x798a('0x40')](_0x1c9fa8);})[_0x798a('0x22')](function(_0x4fdb7f){_0x5aa090[_0x798a('0x41')]=_0x4fdb7f;return _0x5aa090;})[_0x798a('0x22')](respondWithFilteredResult(_0x3eda6e,_0x1c9fa8))['catch'](handleError(_0x3eda6e,null));};exports[_0x798a('0x42')]=function(_0x29b022,_0x1333fc){var _0x328584={'raw':!![],'where':{'id':_0x29b022[_0x798a('0x43')]['id']}},_0x9c1e69={};_0x9c1e69[_0x798a('0x2f')]=_['keys'](db[_0x798a('0x2b')]['rawAttributes']);_0x9c1e69[_0x798a('0x30')]=_[_0x798a('0x31')](_0x29b022[_0x798a('0x30')]);_0x9c1e69[_0x798a('0x32')]=_[_0x798a('0x33')](_0x9c1e69[_0x798a('0x2f')],_0x9c1e69['query']);_0x328584['attributes']=_[_0x798a('0x33')](_0x9c1e69[_0x798a('0x2f')],qs['fields'](_0x29b022['query'][_0x798a('0x34')]));_0x328584[_0x798a('0x35')]=_0x328584[_0x798a('0x35')][_0x798a('0x44')]?_0x328584[_0x798a('0x35')]:_0x9c1e69[_0x798a('0x2f')];if(_0x29b022[_0x798a('0x30')][_0x798a('0x3e')]){_0x328584[_0x798a('0x3f')]=[{'all':!![]}];}_0x328584=_[_0x798a('0x3c')]({},_0x328584,_0x29b022[_0x798a('0x45')]);return db[_0x798a('0x2b')][_0x798a('0x46')](_0x328584)[_0x798a('0x22')](handleEntityNotFound(_0x1333fc,null))[_0x798a('0x22')](respondWithResult(_0x1333fc,null))[_0x798a('0x47')](handleError(_0x1333fc,null));};exports[_0x798a('0x48')]=function(_0x120786,_0x5023e,_0x3b2634){return db[_0x798a('0x2b')][_0x798a('0x46')]({'where':{'id':_0x120786[_0x798a('0x43')]['id']},'attributes':[_0x798a('0x29'),_0x798a('0x49'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x5023e,null))[_0x798a('0x22')](function(_0xc18718){if(_0xc18718){if(!fs[_0x798a('0x4a')](path[_0x798a('0x4b')](config[_0x798a('0x4c')],'server/files/sounds/converted',_0xc18718[_0x798a('0x49')]+'.'+_0xc18718[_0x798a('0x4d')]))){throw new db['Sequelize']['ValidationError'](_0x798a('0x4e'));}return _0x5023e['download'](path[_0x798a('0x4b')](config[_0x798a('0x4c')],_0x798a('0x4f'),util[_0x798a('0x50')](_0x798a('0x51'),_0xc18718['save_name'],_0xc18718[_0x798a('0x4d')])),util[_0x798a('0x50')]('%s.%s',_0xc18718['name'],_0xc18718['converted_format']));}return null;})[_0x798a('0x47')](handleError(_0x5023e,null));};exports['create']=function(_0x2789f7,_0x2451f3,_0x3e07db){var _0x2910bf={'name':path[_0x798a('0x52')](_0x2789f7['file'][_0x798a('0x53')],path['extname'](_0x2789f7['file'][_0x798a('0x53')])),'save_name':path[_0x798a('0x52')](_0x2789f7[_0x798a('0x54')]['filename'],path[_0x798a('0x55')](_0x2789f7[_0x798a('0x54')][_0x798a('0x56')])),'original_format':path['extname'](_0x2789f7[_0x798a('0x54')][_0x798a('0x53')])[_0x798a('0x57')](0x1),'converted_format':_0x798a('0x58')};var _0x4f93df=path['join'](config[_0x798a('0x4c')],_0x798a('0x59'),_0x2789f7[_0x798a('0x54')]['filename']);var _0x1eda4e=path[_0x798a('0x4b')](config['root'],'server/files/sounds/converted',util[_0x798a('0x50')](_0x798a('0x51'),path[_0x798a('0x52')](_0x2789f7[_0x798a('0x54')][_0x798a('0x56')],path[_0x798a('0x55')](_0x2789f7['file'][_0x798a('0x56')])),_0x2910bf[_0x798a('0x4d')]));logger[_0x798a('0x5a')](_0x798a('0x5b'),_0x4f93df);logger[_0x798a('0x5a')](_0x798a('0x5c'),_0x1eda4e);try{fs[_0x798a('0x5d')](_0x4f93df,parseInt(_0x798a('0x5e'),0x8));var _0x5890a8=sox[_0x798a('0x5f')](_0x4f93df,_0x1eda4e,{'sampleRate':0x1f40,'format':_0x798a('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5890a8['on'](_0x798a('0x27'),function(_0x50cf3d){fs[_0x798a('0x60')](_0x4f93df);_0x2451f3[_0x798a('0x17')](0x1f4)[_0x798a('0x2a')](_0x50cf3d);});_0x5890a8['on']('src',function(_0x257224){_0x2910bf[_0x798a('0x61')]=isNaN(_0x257224[_0x798a('0x62')])?null:_0x257224['duration']*0x3e8;_0x2910bf[_0x798a('0x63')]=isNaN(_0x257224[_0x798a('0x64')])?null:_0x257224[_0x798a('0x64')];_0x2910bf[_0x798a('0x65')]=isNaN(_0x257224[_0x798a('0x66')])?null:_0x257224[_0x798a('0x66')];_0x2910bf[_0x798a('0x67')]=isNaN(_0x257224['bitRate'])?null:_0x257224[_0x798a('0x68')];_0x2910bf[_0x798a('0x69')]=isNaN(_0x257224[_0x798a('0x6a')])?null:_0x257224[_0x798a('0x6a')];});_0x5890a8['on'](_0x798a('0x6b'),function(_0x2fa1fc){_0x2910bf[_0x798a('0x6c')]=isNaN(_0x2fa1fc[_0x798a('0x62')])?null:_0x2fa1fc[_0x798a('0x62')]*0x3e8;_0x2910bf[_0x798a('0x6d')]=isNaN(_0x2fa1fc[_0x798a('0x64')])?null:_0x2fa1fc[_0x798a('0x64')];_0x2910bf['converted_channelCount']=isNaN(_0x2fa1fc['channelCount'])?null:_0x2fa1fc[_0x798a('0x66')];_0x2910bf['converted_bitRate']=isNaN(_0x2fa1fc['bitRate'])?null:_0x2fa1fc[_0x798a('0x68')];_0x2910bf[_0x798a('0x6e')]=isNaN(_0x2fa1fc['sampleRate'])?null:_0x2fa1fc[_0x798a('0x6a')];});_0x5890a8['on'](_0x798a('0x26'),function(){fs[_0x798a('0x5d')](_0x1eda4e,parseInt('0777',0x8));return db[_0x798a('0x2b')]['create'](_0x2910bf)[_0x798a('0x22')](function(_0x5aed04){var _0x6f56a6={'role':_0x2789f7[_0x798a('0x6f')]['role'],'userProfileId':_0x2789f7[_0x798a('0x6f')]['userProfileId']};if(!_0x6f56a6)throw new Error(_0x798a('0x70'));if(_0x6f56a6[_0x798a('0x71')]===_0x798a('0x72')){var _0x31b2d3=_0x5aed04[_0x798a('0x24')]({'plain':!![]});return db[_0x798a('0x73')][_0x798a('0x46')]({'where':{'name':_0x798a('0x25'),'userProfileId':_0x6f56a6['userProfileId']},'raw':!![]})[_0x798a('0x22')](function(_0x414dd3){if(_0x414dd3&&_0x414dd3['autoAssociation']===0x0){return db[_0x798a('0x74')][_0x798a('0x75')]({'name':_0x31b2d3[_0x798a('0x29')],'resourceId':_0x31b2d3['id'],'type':_0x414dd3[_0x798a('0x29')],'sectionId':_0x414dd3['id']},{})[_0x798a('0x22')](function(){return _0x5aed04;});}else{return _0x5aed04;}})['catch'](function(_0x3cbbb5){logger['error'](_0x798a('0x76'),_0x3cbbb5);throw _0x3cbbb5;});}return _0x5aed04;})[_0x798a('0x22')](respondWithResult(_0x2451f3,null))[_0x798a('0x47')](handleError(_0x2451f3,null));});_0x5890a8['start']();}catch(_0x539e5f){_0x2451f3[_0x798a('0x17')](0x1f4)[_0x798a('0x2a')](_0x539e5f);}};exports[_0x798a('0x21')]=function(_0x10e4e3,_0x5bc354,_0x15e890){return db['Sound'][_0x798a('0x46')]({'where':{'id':_0x10e4e3[_0x798a('0x43')]['id']}})['then'](handleEntityNotFound(_0x5bc354,null))['then'](saveUpdates(_[_0x798a('0x3a')](_0x10e4e3[_0x798a('0x6f')],[_0x798a('0x29'),'description']),null))[_0x798a('0x22')](respondWithResult(_0x5bc354,null))[_0x798a('0x47')](handleError(_0x5bc354,null));};exports[_0x798a('0x77')]=function(_0x35576e,_0x4257c1,_0x25d882){return db[_0x798a('0x2b')][_0x798a('0x46')]({'where':{'id':_0x35576e['params']['id']}})[_0x798a('0x22')](function(_0x295605){if(_0x295605){return _0x295605[_0x798a('0x23')]();}})[_0x798a('0x22')](function(_0x447534){var _0x390aae=path['join'](config[_0x798a('0x4c')],_0x798a('0x59'),util[_0x798a('0x50')]('%s.%s',_0x447534['save_name'],_0x447534[_0x798a('0x78')]));var _0x48f7ca=path[_0x798a('0x4b')](config[_0x798a('0x4c')],_0x798a('0x4f'),util['format'](_0x798a('0x51'),_0x447534[_0x798a('0x49')],_0x447534[_0x798a('0x4d')]));fs['unlinkSync'](_0x390aae);fs[_0x798a('0x60')](_0x48f7ca);return _0x447534;})['then'](function(_0x367455){if(_0x367455){return _0x4257c1[_0x798a('0x17')](0xcc)[_0x798a('0x26')]();}})[_0x798a('0x22')](handleEntityNotFound(_0x4257c1,null))[_0x798a('0x47')](handleError(_0x4257c1,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index cb00a3b..d4eb261 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 _0xde6b=['bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','util','../../config/logger','api','moment'];(function(_0x5f22b9,_0x18e876){var _0x5e805f=function(_0x3b224d){while(--_0x3b224d){_0x5f22b9['push'](_0x5f22b9['shift']());}};_0x5e805f(++_0x18e876);}(_0xde6b,0xbf));var _0xbde6=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xde6b[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0xbde6('0x0'));var logger=require(_0xbde6('0x1'))(_0xbde6('0x2'));var moment=require(_0xbde6('0x3'));var BPromise=require(_0xbde6('0x4'));var rp=require(_0xbde6('0x5'));var fs=require('fs');var path=require(_0xbde6('0x6'));var rimraf=require(_0xbde6('0x7'));var config=require(_0xbde6('0x8'));var attributes=require(_0xbde6('0x9'));module[_0xbde6('0xa')]=function(_0x30423d,_0x514d45){return _0x30423d[_0xbde6('0xb')](_0xbde6('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1900=['moment','request-promise','rimraf','../../config/environment','./sound.attributes','exports','Sound','lodash','util','../../config/logger','api'];(function(_0x65200e,_0x44e42b){var _0x2f57de=function(_0x864b3c){while(--_0x864b3c){_0x65200e['push'](_0x65200e['shift']());}};_0x2f57de(++_0x44e42b);}(_0x1900,0x172));var _0x0190=function(_0xe06a8e,_0x197e62){_0xe06a8e=_0xe06a8e-0x0;var _0x3dc1d0=_0x1900[_0xe06a8e];return _0x3dc1d0;};'use strict';var _=require(_0x0190('0x0'));var util=require(_0x0190('0x1'));var logger=require(_0x0190('0x2'))(_0x0190('0x3'));var moment=require(_0x0190('0x4'));var BPromise=require('bluebird');var rp=require(_0x0190('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0190('0x6'));var config=require(_0x0190('0x7'));var attributes=require(_0x0190('0x8'));module[_0x0190('0x9')]=function(_0x1469ca,_0x3b5ebd){return _0x1469ca['define'](_0x0190('0xa'),attributes,{'tableName':'tools_sounds','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 03802ed..b4f3bed 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 _0x6d44=['../../config/utils','../../config/logger','rpc','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','Sound','options','where','attributes','include','map','model','ShowSound','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x8326f6,_0x2e6213){var _0x59fae6=function(_0x447b53){while(--_0x447b53){_0x8326f6['push'](_0x8326f6['shift']());}};_0x59fae6(++_0x2e6213);}(_0x6d44,0xb5));var _0x46d4=function(_0x4ec7f2,_0x3d92d2){_0x4ec7f2=_0x4ec7f2-0x0;var _0x118004=_0x6d44[_0x4ec7f2];return _0x118004;};'use strict';var _=require('lodash');var util=require(_0x46d4('0x0'));var moment=require(_0x46d4('0x1'));var BPromise=require(_0x46d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46d4('0x3'));var db=require(_0x46d4('0x4'))['db'];var utils=require(_0x46d4('0x5'));var logger=require(_0x46d4('0x6'))(_0x46d4('0x7'));var config=require('../../config/environment');var jayson=require(_0x46d4('0x8'));var client=jayson[_0x46d4('0x9')][_0x46d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14a734,_0x3db7e7,_0x387bfe){return new BPromise(function(_0x4546aa,_0x1a51c1){return client[_0x46d4('0xb')](_0x14a734,_0x387bfe)[_0x46d4('0xc')](function(_0x40be03){logger[_0x46d4('0xd')](_0x46d4('0xe'),_0x3db7e7,_0x46d4('0xf'));logger[_0x46d4('0x10')](_0x46d4('0x11'),_0x3db7e7,_0x46d4('0xf'),JSON[_0x46d4('0x12')](_0x40be03));if(_0x40be03[_0x46d4('0x13')]){if(_0x40be03[_0x46d4('0x13')][_0x46d4('0x14')]===0x1f4){logger[_0x46d4('0x13')](_0x46d4('0xe'),_0x3db7e7,_0x40be03[_0x46d4('0x13')][_0x46d4('0x15')]);return _0x1a51c1(_0x40be03[_0x46d4('0x13')][_0x46d4('0x15')]);}logger[_0x46d4('0x13')](_0x46d4('0xe'),_0x3db7e7,_0x40be03[_0x46d4('0x13')]['message']);return _0x4546aa(_0x40be03[_0x46d4('0x13')][_0x46d4('0x15')]);}else{logger[_0x46d4('0xd')]('Sound,\x20%s,\x20%s',_0x3db7e7,_0x46d4('0xf'));_0x4546aa(_0x40be03['result'][_0x46d4('0x15')]);}})[_0x46d4('0x16')](function(_0x44b32e){logger[_0x46d4('0x13')]('Sound,\x20%s,\x20%s',_0x3db7e7,_0x44b32e);_0x1a51c1(_0x44b32e);});});}exports['ShowSound']=function(_0x5ddf7c){var _0x3ddb6b=this;return new Promise(function(_0x302d5b,_0x15a255){return db[_0x46d4('0x17')]['find']({'raw':_0x5ddf7c['options']?_0x5ddf7c['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ddf7c[_0x46d4('0x18')]?_0x5ddf7c[_0x46d4('0x18')][_0x46d4('0x19')]||null:null,'attributes':_0x5ddf7c[_0x46d4('0x18')]?_0x5ddf7c[_0x46d4('0x18')][_0x46d4('0x1a')]||null:null,'include':_0x5ddf7c['options']?_0x5ddf7c['options'][_0x46d4('0x1b')]?_[_0x46d4('0x1c')](_0x5ddf7c[_0x46d4('0x18')][_0x46d4('0x1b')],function(_0x1a8d4b){return{'model':db[_0x1a8d4b[_0x46d4('0x1d')]],'as':_0x1a8d4b['as'],'attributes':_0x1a8d4b['attributes'],'include':_0x1a8d4b[_0x46d4('0x1b')]?_['map'](_0x1a8d4b[_0x46d4('0x1b')],function(_0x103039){return{'model':db[_0x103039['model']],'as':_0x103039['as'],'attributes':_0x103039[_0x46d4('0x1a')],'include':_0x103039[_0x46d4('0x1b')]?_[_0x46d4('0x1c')](_0x103039[_0x46d4('0x1b')],function(_0x412475){return{'model':db[_0x412475['model']],'as':_0x412475['as'],'attributes':_0x412475[_0x46d4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x46d4('0xc')](function(_0x3d5e76){logger['info']('ShowSound',_0x5ddf7c);logger[_0x46d4('0x10')](_0x46d4('0x1e'),_0x5ddf7c,JSON[_0x46d4('0x12')](_0x3d5e76));_0x302d5b(_0x3d5e76);})[_0x46d4('0x16')](function(_0x309576){logger[_0x46d4('0x13')](_0x46d4('0x1e'),_0x309576[_0x46d4('0x15')],_0x5ddf7c);_0x15a255(_0x3ddb6b['error'](0x1f4,_0x309576[_0x46d4('0x15')]));});});}; \ No newline at end of file +var _0xf41e=['message','info','result','catch','ShowSound','find','options','raw','include','map','model','attributes','lodash','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','client','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x15c19a,_0xd4667b){var _0x3290d9=function(_0x1c533d){while(--_0x1c533d){_0x15c19a['push'](_0x15c19a['shift']());}};_0x3290d9(++_0xd4667b);}(_0xf41e,0x194));var _0xef41=function(_0x4996af,_0x3a1ef9){_0x4996af=_0x4996af-0x0;var _0x55eab0=_0xf41e[_0x4996af];return _0x55eab0;};'use strict';var _=require(_0xef41('0x0'));var util=require(_0xef41('0x1'));var moment=require(_0xef41('0x2'));var BPromise=require('bluebird');var rs=require(_0xef41('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef41('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xef41('0x5'));var config=require('../../config/environment');var jayson=require(_0xef41('0x6'));var client=jayson[_0xef41('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26ec60,_0x49f7e4,_0x2a28f2){return new BPromise(function(_0x31b10a,_0x5cb12c){return client[_0xef41('0x8')](_0x26ec60,_0x2a28f2)[_0xef41('0x9')](function(_0x50d286){logger['info'](_0xef41('0xa'),_0x49f7e4,_0xef41('0xb'));logger[_0xef41('0xc')](_0xef41('0xd'),_0x49f7e4,_0xef41('0xb'),JSON[_0xef41('0xe')](_0x50d286));if(_0x50d286['error']){if(_0x50d286[_0xef41('0xf')]['code']===0x1f4){logger['error'](_0xef41('0xa'),_0x49f7e4,_0x50d286[_0xef41('0xf')]['message']);return _0x5cb12c(_0x50d286['error']['message']);}logger[_0xef41('0xf')](_0xef41('0xa'),_0x49f7e4,_0x50d286[_0xef41('0xf')][_0xef41('0x10')]);return _0x31b10a(_0x50d286[_0xef41('0xf')][_0xef41('0x10')]);}else{logger[_0xef41('0x11')]('Sound,\x20%s,\x20%s',_0x49f7e4,'request\x20sent');_0x31b10a(_0x50d286[_0xef41('0x12')][_0xef41('0x10')]);}})[_0xef41('0x13')](function(_0x4ed8f4){logger['error'](_0xef41('0xa'),_0x49f7e4,_0x4ed8f4);_0x5cb12c(_0x4ed8f4);});});}exports[_0xef41('0x14')]=function(_0x568592){var _0x6c978a=this;return new Promise(function(_0x17d3f7,_0x48621c){return db['Sound'][_0xef41('0x15')]({'raw':_0x568592[_0xef41('0x16')]?_0x568592['options'][_0xef41('0x17')]===undefined?!![]:![]:!![],'where':_0x568592[_0xef41('0x16')]?_0x568592[_0xef41('0x16')]['where']||null:null,'attributes':_0x568592[_0xef41('0x16')]?_0x568592[_0xef41('0x16')]['attributes']||null:null,'include':_0x568592[_0xef41('0x16')]?_0x568592['options'][_0xef41('0x18')]?_[_0xef41('0x19')](_0x568592[_0xef41('0x16')][_0xef41('0x18')],function(_0x13a94c){return{'model':db[_0x13a94c[_0xef41('0x1a')]],'as':_0x13a94c['as'],'attributes':_0x13a94c['attributes'],'include':_0x13a94c[_0xef41('0x18')]?_[_0xef41('0x19')](_0x13a94c[_0xef41('0x18')],function(_0x16def4){return{'model':db[_0x16def4['model']],'as':_0x16def4['as'],'attributes':_0x16def4['attributes'],'include':_0x16def4[_0xef41('0x18')]?_[_0xef41('0x19')](_0x16def4[_0xef41('0x18')],function(_0xc66ad1){return{'model':db[_0xc66ad1[_0xef41('0x1a')]],'as':_0xc66ad1['as'],'attributes':_0xc66ad1[_0xef41('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xef41('0x9')](function(_0x18fb3a){logger[_0xef41('0x11')](_0xef41('0x14'),_0x568592);logger['debug']('ShowSound',_0x568592,JSON[_0xef41('0xe')](_0x18fb3a));_0x17d3f7(_0x18fb3a);})[_0xef41('0x13')](function(_0x300aac){logger[_0xef41('0xf')]('ShowSound',_0x300aac[_0xef41('0x10')],_0x568592);_0x48621c(_0x6c978a[_0xef41('0xf')](0x1f4,_0x300aac[_0xef41('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index aee6c80..9ddae9d 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x5061ec,_0x27e1fd){var _0x116ada=function(_0x5cd93b){while(--_0x5cd93b){_0x5061ec['push'](_0x5061ec['shift']());}};_0x116ada(++_0x27e1fd);}(_0xb7e7,0x121));var _0x7b7e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xb7e7[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x596e98,_0xc326c9){var _0x1c09ac=function(_0x3d839d){while(--_0x3d839d){_0x596e98['push'](_0x596e98['shift']());}};_0x1c09ac(++_0xc326c9);}(_0x2032,0xd9));var _0x2203=function(_0x245567,_0x2708ff){_0x245567=_0x245567-0x0;var _0x4e0e0e=_0x2032[_0x245567];return _0x4e0e0e;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index a81394b..749f149 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 _0x7dee=['STRING','ENUM','out','sequelize','exports'];(function(_0x5a89bc,_0x4a09b0){var _0x5abd73=function(_0x4af95f){while(--_0x4af95f){_0x5a89bc['push'](_0x5a89bc['shift']());}};_0x5abd73(++_0x4a09b0);}(_0x7dee,0x8a));var _0xe7de=function(_0x33e22c,_0x316e59){_0x33e22c=_0x33e22c-0x0;var _0x6fbec9=_0x7dee[_0x33e22c];return _0x6fbec9;};'use strict';var Sequelize=require(_0xe7de('0x0'));module[_0xe7de('0x1')]={'uniqueid':{'type':Sequelize[_0xe7de('0x2')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xe7de('0x3')]('in',_0xe7de('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9c5e=['out','sequelize','STRING','TEXT','medium','ENUM'];(function(_0x7894bf,_0x5bbdc0){var _0x2e36d6=function(_0x5ba193){while(--_0x5ba193){_0x7894bf['push'](_0x7894bf['shift']());}};_0x2e36d6(++_0x5bbdc0);}(_0x9c5e,0xc1));var _0xe9c5=function(_0x3215c8,_0x329596){_0x3215c8=_0x3215c8-0x0;var _0x4570a8=_0x9c5e[_0x3215c8];return _0x4570a8;};'use strict';var Sequelize=require(_0xe9c5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9c5('0x1')]},'body':{'type':Sequelize[_0xe9c5('0x2')](_0xe9c5('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xe9c5('0x4')]('in',_0xe9c5('0x5')),'defaultValue':_0xe9c5('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xe9c5('0x1')]},'providerResponse':{'type':Sequelize[_0xe9c5('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 3f3504b..a958b7e 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 _0xa064=['model','map','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','length','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SquareMessage','rawAttributes','key'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xa064,0x192));var _0x4a06=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0xa064[_0x5e238b];return _0x389bea;};'use strict';var emlformat=require(_0x4a06('0x0'));var rimraf=require(_0x4a06('0x1'));var zipdir=require(_0x4a06('0x2'));var jsonpatch=require(_0x4a06('0x3'));var rp=require(_0x4a06('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4a06('0x5'));var util=require('util');var path=require(_0x4a06('0x6'));var sox=require(_0x4a06('0x7'));var csv=require('to-csv');var ejs=require(_0x4a06('0x8'));var fs=require('fs');var fs_extra=require(_0x4a06('0x9'));var _=require('lodash');var squel=require(_0x4a06('0xa'));var crypto=require(_0x4a06('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4a06('0xc'));var querystring=require(_0x4a06('0xd'));var Papa=require(_0x4a06('0xe'));var Redis=require(_0x4a06('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4a06('0x10'));var as=require(_0x4a06('0x11'));var hardwareService=require(_0x4a06('0x12'));var logger=require(_0x4a06('0x13'))(_0x4a06('0x14'));var utils=require(_0x4a06('0x15'));var config=require(_0x4a06('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a06('0x17'))['db'];function respondWithStatusCode(_0x52818e,_0x16d686){_0x16d686=_0x16d686||0xcc;return function(_0x3ac986){if(_0x3ac986){return _0x52818e[_0x4a06('0x18')](_0x16d686);}return _0x52818e['status'](_0x16d686)[_0x4a06('0x19')]();};}function respondWithResult(_0xdbc234,_0xf9b166){_0xf9b166=_0xf9b166||0xc8;return function(_0x569aed){if(_0x569aed){return _0xdbc234[_0x4a06('0x1a')](_0xf9b166)[_0x4a06('0x1b')](_0x569aed);}};}function respondWithFilteredResult(_0x292770,_0x51643c){return function(_0x221a80){if(_0x221a80){var _0x29e99b=typeof _0x51643c[_0x4a06('0x1c')]===_0x4a06('0x1d')&&typeof _0x51643c[_0x4a06('0x1e')]==='undefined';var _0x19c96d=_0x221a80['count'];var _0x4fd47f=_0x29e99b?0x0:_0x51643c[_0x4a06('0x1c')];var _0x463aca=_0x29e99b?_0x221a80[_0x4a06('0x1f')]:_0x51643c[_0x4a06('0x1c')]+_0x51643c[_0x4a06('0x1e')];var _0x226538;if(_0x463aca>=_0x19c96d){_0x463aca=_0x19c96d;_0x226538=0xc8;}else{_0x226538=0xce;}_0x292770[_0x4a06('0x1a')](_0x226538);return _0x292770[_0x4a06('0x20')](_0x4a06('0x21'),_0x4fd47f+'-'+_0x463aca+'/'+_0x19c96d)['json'](_0x221a80);}return null;};}function patchUpdates(_0x98df26){return function(_0x3933e6){try{jsonpatch[_0x4a06('0x22')](_0x3933e6,_0x98df26,!![]);}catch(_0x357f82){return BPromise[_0x4a06('0x23')](_0x357f82);}return _0x3933e6[_0x4a06('0x24')]();};}function saveUpdates(_0x20f9f4,_0x156af7){return function(_0xae7471){if(_0xae7471){return _0xae7471[_0x4a06('0x25')](_0x20f9f4)[_0x4a06('0x26')](function(_0x44eb74){return _0x44eb74;});}return null;};}function removeEntity(_0x38c823,_0x5ebd7c){return function(_0x501ee9){if(_0x501ee9){return _0x501ee9[_0x4a06('0x27')]()[_0x4a06('0x26')](function(){_0x38c823[_0x4a06('0x1a')](0xcc)[_0x4a06('0x19')]();});}};}function handleEntityNotFound(_0x5b5a43,_0x5e8af0){return function(_0xf7e565){if(!_0xf7e565){_0x5b5a43[_0x4a06('0x18')](0x194);}return _0xf7e565;};}function handleError(_0x55861c,_0xdf5163){_0xdf5163=_0xdf5163||0x1f4;return function(_0x54613e){logger[_0x4a06('0x28')](_0x54613e[_0x4a06('0x29')]);if(_0x54613e['name']){delete _0x54613e[_0x4a06('0x2a')];}_0x55861c[_0x4a06('0x1a')](_0xdf5163)[_0x4a06('0x2b')](_0x54613e);};}exports[_0x4a06('0x2c')]=function(_0x1c14d3,_0x37cb33){var _0x5ee187={},_0x255924={},_0x452188={'count':0x0,'rows':[]};var _0x1ab220=_['map'](db[_0x4a06('0x2d')][_0x4a06('0x2e')],function(_0x20cf23){return{'name':_0x20cf23['fieldName'],'type':_0x20cf23['type'][_0x4a06('0x2f')]};});_0x255924[_0x4a06('0x30')]=_[_0x4a06('0x31')](_0x1ab220,_0x4a06('0x2a'));_0x255924[_0x4a06('0x32')]=_[_0x4a06('0x33')](_0x1c14d3[_0x4a06('0x32')]);_0x255924[_0x4a06('0x34')]=_['intersection'](_0x255924[_0x4a06('0x30')],_0x255924[_0x4a06('0x32')]);_0x5ee187[_0x4a06('0x35')]=_[_0x4a06('0x36')](_0x255924[_0x4a06('0x30')],qs['fields'](_0x1c14d3[_0x4a06('0x32')]['fields']));_0x5ee187[_0x4a06('0x35')]=_0x5ee187[_0x4a06('0x35')]['length']?_0x5ee187[_0x4a06('0x35')]:_0x255924[_0x4a06('0x30')];if(!_0x1c14d3[_0x4a06('0x32')][_0x4a06('0x37')](_0x4a06('0x38'))){_0x5ee187['limit']=qs[_0x4a06('0x1e')](_0x1c14d3['query'][_0x4a06('0x1e')]);_0x5ee187[_0x4a06('0x1c')]=qs[_0x4a06('0x1c')](_0x1c14d3['query'][_0x4a06('0x1c')]);}_0x5ee187[_0x4a06('0x39')]=qs[_0x4a06('0x3a')](_0x1c14d3[_0x4a06('0x32')][_0x4a06('0x3a')]);_0x5ee187[_0x4a06('0x3b')]=qs['filters'](_[_0x4a06('0x3c')](_0x1c14d3['query'],_0x255924[_0x4a06('0x34')]),_0x1ab220);if(_0x1c14d3[_0x4a06('0x32')][_0x4a06('0x3d')]){_0x5ee187['where']=_[_0x4a06('0x3e')](_0x5ee187['where'],{'$or':_[_0x4a06('0x31')](_0x1ab220,function(_0x59517c){if(_0x59517c['type']!==_0x4a06('0x3f')){var _0x84b40e={};_0x84b40e[_0x59517c[_0x4a06('0x2a')]]={'$like':'%'+_0x1c14d3[_0x4a06('0x32')][_0x4a06('0x3d')]+'%'};return _0x84b40e;}})});}_0x5ee187=_[_0x4a06('0x3e')]({},_0x5ee187,_0x1c14d3[_0x4a06('0x40')]);var _0x1084b8={'where':_0x5ee187[_0x4a06('0x3b')]};return db['SquareMessage']['count'](_0x1084b8)[_0x4a06('0x26')](function(_0x284a2b){_0x452188[_0x4a06('0x1f')]=_0x284a2b;if(_0x1c14d3[_0x4a06('0x32')][_0x4a06('0x41')]){_0x5ee187[_0x4a06('0x42')]=[{'all':!![]}];}return db[_0x4a06('0x2d')]['findAll'](_0x5ee187);})['then'](function(_0x465938){_0x452188[_0x4a06('0x43')]=_0x465938;return _0x452188;})[_0x4a06('0x26')](respondWithFilteredResult(_0x37cb33,_0x5ee187))[_0x4a06('0x44')](handleError(_0x37cb33,null));};exports[_0x4a06('0x45')]=function(_0x534227,_0x18dbe9){var _0x538c73={'raw':!![],'where':{'id':_0x534227[_0x4a06('0x46')]['id']}},_0x35fb1b={};_0x35fb1b[_0x4a06('0x30')]=_[_0x4a06('0x33')](db['SquareMessage'][_0x4a06('0x2e')]);_0x35fb1b[_0x4a06('0x32')]=_[_0x4a06('0x33')](_0x534227['query']);_0x35fb1b[_0x4a06('0x34')]=_[_0x4a06('0x36')](_0x35fb1b[_0x4a06('0x30')],_0x35fb1b['query']);_0x538c73[_0x4a06('0x35')]=_[_0x4a06('0x36')](_0x35fb1b[_0x4a06('0x30')],qs[_0x4a06('0x47')](_0x534227[_0x4a06('0x32')][_0x4a06('0x47')]));_0x538c73[_0x4a06('0x35')]=_0x538c73[_0x4a06('0x35')][_0x4a06('0x48')]?_0x538c73[_0x4a06('0x35')]:_0x35fb1b[_0x4a06('0x30')];if(_0x534227[_0x4a06('0x32')][_0x4a06('0x41')]){_0x538c73['include']=[{'all':!![]}];}_0x538c73=_[_0x4a06('0x3e')]({},_0x538c73,_0x534227['options']);return db[_0x4a06('0x2d')][_0x4a06('0x49')](_0x538c73)[_0x4a06('0x26')](handleEntityNotFound(_0x18dbe9,null))[_0x4a06('0x26')](respondWithResult(_0x18dbe9,null))[_0x4a06('0x44')](handleError(_0x18dbe9,null));};exports['create']=function(_0x1fb2fe,_0x1f4fad){return db[_0x4a06('0x2d')]['create'](_0x1fb2fe[_0x4a06('0x4a')],{})[_0x4a06('0x26')](respondWithResult(_0x1f4fad,0xc9))[_0x4a06('0x44')](handleError(_0x1f4fad,null));};exports['update']=function(_0x25ba9c,_0x2824ed){if(_0x25ba9c[_0x4a06('0x4a')]['id']){delete _0x25ba9c[_0x4a06('0x4a')]['id'];}return db[_0x4a06('0x2d')][_0x4a06('0x49')]({'where':{'id':_0x25ba9c['params']['id']}})[_0x4a06('0x26')](handleEntityNotFound(_0x2824ed,null))[_0x4a06('0x26')](saveUpdates(_0x25ba9c[_0x4a06('0x4a')],null))[_0x4a06('0x26')](respondWithResult(_0x2824ed,null))[_0x4a06('0x44')](handleError(_0x2824ed,null));};exports[_0x4a06('0x27')]=function(_0x524ebd,_0xcfa915){return db['SquareMessage']['find']({'where':{'id':_0x524ebd[_0x4a06('0x46')]['id']}})[_0x4a06('0x26')](handleEntityNotFound(_0xcfa915,null))[_0x4a06('0x26')](removeEntity(_0xcfa915,null))[_0x4a06('0x44')](handleError(_0xcfa915,null));}; \ No newline at end of file +var _0xb248=['sort','pick','filter','where','merge','includeAll','rows','catch','show','params','options','create','body','find','destroy','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','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','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','SquareMessage','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4aa7bd,_0x497f8e){var _0x45445e=function(_0x33c6f1){while(--_0x33c6f1){_0x4aa7bd['push'](_0x4aa7bd['shift']());}};_0x45445e(++_0x497f8e);}(_0xb248,0x1b9));var _0x8b24=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xb248[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b24('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b24('0x1'));var moment=require(_0x8b24('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8b24('0x3'));var util=require(_0x8b24('0x4'));var path=require(_0x8b24('0x5'));var sox=require(_0x8b24('0x6'));var csv=require(_0x8b24('0x7'));var ejs=require(_0x8b24('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b24('0x9'));var squel=require(_0x8b24('0xa'));var crypto=require(_0x8b24('0xb'));var jsforce=require(_0x8b24('0xc'));var deskjs=require(_0x8b24('0xd'));var toCsv=require(_0x8b24('0x7'));var querystring=require(_0x8b24('0xe'));var Papa=require(_0x8b24('0xf'));var Redis=require('ioredis');var authService=require(_0x8b24('0x10'));var qs=require(_0x8b24('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b24('0x12'));var logger=require(_0x8b24('0x13'))(_0x8b24('0x14'));var utils=require(_0x8b24('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8b24('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x559609,_0x30a717){_0x30a717=_0x30a717||0xcc;return function(_0x307b2b){if(_0x307b2b){return _0x559609[_0x8b24('0x17')](_0x30a717);}return _0x559609[_0x8b24('0x18')](_0x30a717)[_0x8b24('0x19')]();};}function respondWithResult(_0x5e2c45,_0x4c3668){_0x4c3668=_0x4c3668||0xc8;return function(_0x24def3){if(_0x24def3){return _0x5e2c45['status'](_0x4c3668)[_0x8b24('0x1a')](_0x24def3);}};}function respondWithFilteredResult(_0x4474e4,_0x36c5c3){return function(_0x2100a9){if(_0x2100a9){var _0x3e24af=typeof _0x36c5c3['offset']===_0x8b24('0x1b')&&typeof _0x36c5c3[_0x8b24('0x1c')]==='undefined';var _0x3b0acc=_0x2100a9['count'];var _0x1769ea=_0x3e24af?0x0:_0x36c5c3[_0x8b24('0x1d')];var _0x2a89f9=_0x3e24af?_0x2100a9[_0x8b24('0x1e')]:_0x36c5c3[_0x8b24('0x1d')]+_0x36c5c3['limit'];var _0x4301ef;if(_0x2a89f9>=_0x3b0acc){_0x2a89f9=_0x3b0acc;_0x4301ef=0xc8;}else{_0x4301ef=0xce;}_0x4474e4[_0x8b24('0x18')](_0x4301ef);return _0x4474e4[_0x8b24('0x1f')](_0x8b24('0x20'),_0x1769ea+'-'+_0x2a89f9+'/'+_0x3b0acc)[_0x8b24('0x1a')](_0x2100a9);}return null;};}function patchUpdates(_0x1b2933){return function(_0x4f23ab){try{jsonpatch['apply'](_0x4f23ab,_0x1b2933,!![]);}catch(_0x542ed7){return BPromise[_0x8b24('0x21')](_0x542ed7);}return _0x4f23ab[_0x8b24('0x22')]();};}function saveUpdates(_0x591ada,_0x27fdd3){return function(_0x26b867){if(_0x26b867){return _0x26b867[_0x8b24('0x23')](_0x591ada)[_0x8b24('0x24')](function(_0x38bb05){return _0x38bb05;});}return null;};}function removeEntity(_0x524e7e,_0x35f965){return function(_0x286523){if(_0x286523){return _0x286523['destroy']()[_0x8b24('0x24')](function(){_0x524e7e[_0x8b24('0x18')](0xcc)[_0x8b24('0x19')]();});}};}function handleEntityNotFound(_0x10bc19,_0x47049b){return function(_0x5333ad){if(!_0x5333ad){_0x10bc19[_0x8b24('0x17')](0x194);}return _0x5333ad;};}function handleError(_0x5e87d7,_0x121e5c){_0x121e5c=_0x121e5c||0x1f4;return function(_0x40de5a){logger[_0x8b24('0x25')](_0x40de5a[_0x8b24('0x26')]);if(_0x40de5a[_0x8b24('0x27')]){delete _0x40de5a[_0x8b24('0x27')];}_0x5e87d7['status'](_0x121e5c)[_0x8b24('0x28')](_0x40de5a);};}exports[_0x8b24('0x29')]=function(_0x25eb46,_0x29b1c0){var _0x7f851b={},_0x209b4c={},_0xa7aff0={'count':0x0,'rows':[]};var _0x218cc5=_[_0x8b24('0x2a')](db[_0x8b24('0x2b')]['rawAttributes'],function(_0x3f0bc2){return{'name':_0x3f0bc2['fieldName'],'type':_0x3f0bc2[_0x8b24('0x2c')][_0x8b24('0x2d')]};});_0x209b4c[_0x8b24('0x2e')]=_[_0x8b24('0x2a')](_0x218cc5,_0x8b24('0x27'));_0x209b4c[_0x8b24('0x2f')]=_[_0x8b24('0x30')](_0x25eb46[_0x8b24('0x2f')]);_0x209b4c[_0x8b24('0x31')]=_[_0x8b24('0x32')](_0x209b4c[_0x8b24('0x2e')],_0x209b4c[_0x8b24('0x2f')]);_0x7f851b[_0x8b24('0x33')]=_[_0x8b24('0x32')](_0x209b4c[_0x8b24('0x2e')],qs[_0x8b24('0x34')](_0x25eb46['query'][_0x8b24('0x34')]));_0x7f851b[_0x8b24('0x33')]=_0x7f851b['attributes'][_0x8b24('0x35')]?_0x7f851b[_0x8b24('0x33')]:_0x209b4c[_0x8b24('0x2e')];if(!_0x25eb46['query'][_0x8b24('0x36')](_0x8b24('0x37'))){_0x7f851b[_0x8b24('0x1c')]=qs[_0x8b24('0x1c')](_0x25eb46['query'][_0x8b24('0x1c')]);_0x7f851b[_0x8b24('0x1d')]=qs[_0x8b24('0x1d')](_0x25eb46['query']['offset']);}_0x7f851b['order']=qs[_0x8b24('0x38')](_0x25eb46[_0x8b24('0x2f')][_0x8b24('0x38')]);_0x7f851b['where']=qs[_0x8b24('0x31')](_[_0x8b24('0x39')](_0x25eb46[_0x8b24('0x2f')],_0x209b4c[_0x8b24('0x31')]),_0x218cc5);if(_0x25eb46['query'][_0x8b24('0x3a')]){_0x7f851b[_0x8b24('0x3b')]=_[_0x8b24('0x3c')](_0x7f851b[_0x8b24('0x3b')],{'$or':_['map'](_0x218cc5,function(_0x4c280d){if(_0x4c280d[_0x8b24('0x2c')]!=='VIRTUAL'){var _0x6f9398={};_0x6f9398[_0x4c280d[_0x8b24('0x27')]]={'$like':'%'+_0x25eb46[_0x8b24('0x2f')][_0x8b24('0x3a')]+'%'};return _0x6f9398;}})});}_0x7f851b=_[_0x8b24('0x3c')]({},_0x7f851b,_0x25eb46['options']);var _0x3e23b7={'where':_0x7f851b['where']};return db[_0x8b24('0x2b')][_0x8b24('0x1e')](_0x3e23b7)[_0x8b24('0x24')](function(_0x112977){_0xa7aff0[_0x8b24('0x1e')]=_0x112977;if(_0x25eb46[_0x8b24('0x2f')][_0x8b24('0x3d')]){_0x7f851b['include']=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x7f851b);})[_0x8b24('0x24')](function(_0x1f5ba2){_0xa7aff0[_0x8b24('0x3e')]=_0x1f5ba2;return _0xa7aff0;})['then'](respondWithFilteredResult(_0x29b1c0,_0x7f851b))[_0x8b24('0x3f')](handleError(_0x29b1c0,null));};exports[_0x8b24('0x40')]=function(_0x3726dc,_0x5d0e1a){var _0x5f0972={'raw':!![],'where':{'id':_0x3726dc[_0x8b24('0x41')]['id']}},_0x5e0f57={};_0x5e0f57['model']=_[_0x8b24('0x30')](db[_0x8b24('0x2b')]['rawAttributes']);_0x5e0f57[_0x8b24('0x2f')]=_[_0x8b24('0x30')](_0x3726dc['query']);_0x5e0f57[_0x8b24('0x31')]=_[_0x8b24('0x32')](_0x5e0f57[_0x8b24('0x2e')],_0x5e0f57[_0x8b24('0x2f')]);_0x5f0972[_0x8b24('0x33')]=_[_0x8b24('0x32')](_0x5e0f57[_0x8b24('0x2e')],qs['fields'](_0x3726dc[_0x8b24('0x2f')]['fields']));_0x5f0972['attributes']=_0x5f0972[_0x8b24('0x33')][_0x8b24('0x35')]?_0x5f0972[_0x8b24('0x33')]:_0x5e0f57[_0x8b24('0x2e')];if(_0x3726dc[_0x8b24('0x2f')][_0x8b24('0x3d')]){_0x5f0972['include']=[{'all':!![]}];}_0x5f0972=_['merge']({},_0x5f0972,_0x3726dc[_0x8b24('0x42')]);return db['SquareMessage']['find'](_0x5f0972)[_0x8b24('0x24')](handleEntityNotFound(_0x5d0e1a,null))[_0x8b24('0x24')](respondWithResult(_0x5d0e1a,null))['catch'](handleError(_0x5d0e1a,null));};exports[_0x8b24('0x43')]=function(_0x5f4500,_0x4f8a2d){return db[_0x8b24('0x2b')][_0x8b24('0x43')](_0x5f4500['body'],{})['then'](respondWithResult(_0x4f8a2d,0xc9))['catch'](handleError(_0x4f8a2d,null));};exports['update']=function(_0x5af749,_0x18edca){if(_0x5af749['body']['id']){delete _0x5af749[_0x8b24('0x44')]['id'];}return db['SquareMessage'][_0x8b24('0x45')]({'where':{'id':_0x5af749[_0x8b24('0x41')]['id']}})['then'](handleEntityNotFound(_0x18edca,null))[_0x8b24('0x24')](saveUpdates(_0x5af749[_0x8b24('0x44')],null))[_0x8b24('0x24')](respondWithResult(_0x18edca,null))[_0x8b24('0x3f')](handleError(_0x18edca,null));};exports[_0x8b24('0x46')]=function(_0x3362ad,_0x124566){return db[_0x8b24('0x2b')][_0x8b24('0x45')]({'where':{'id':_0x3362ad[_0x8b24('0x41')]['id']}})[_0x8b24('0x24')](handleEntityNotFound(_0x124566,null))['then'](removeEntity(_0x124566,null))[_0x8b24('0x3f')](handleError(_0x124566,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 3d06637..b813ba5 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 _0x4efc=['path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x50b87,_0x2c4ec8){var _0x51f6ce=function(_0x28e63b){while(--_0x28e63b){_0x50b87['push'](_0x50b87['shift']());}};_0x51f6ce(++_0x2c4ec8);}(_0x4efc,0xb0));var _0xc4ef=function(_0x33b507,_0xe48ac3){_0x33b507=_0x33b507-0x0;var _0x4d4309=_0x4efc[_0x33b507];return _0x4d4309;};'use strict';var _=require(_0xc4ef('0x0'));var util=require('util');var logger=require(_0xc4ef('0x1'))(_0xc4ef('0x2'));var moment=require(_0xc4ef('0x3'));var BPromise=require(_0xc4ef('0x4'));var rp=require(_0xc4ef('0x5'));var fs=require('fs');var path=require(_0xc4ef('0x6'));var rimraf=require(_0xc4ef('0x7'));var config=require(_0xc4ef('0x8'));var attributes=require(_0xc4ef('0x9'));module[_0xc4ef('0xa')]=function(_0x43ed45,_0x405134){return _0x43ed45[_0xc4ef('0xb')](_0xc4ef('0xc'),attributes,{'tableName':_0xc4ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05c6=['rimraf','../../config/environment','./squareMessage.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x320db2,_0x5c7dfa){var _0x558ece=function(_0x16ebd1){while(--_0x16ebd1){_0x320db2['push'](_0x320db2['shift']());}};_0x558ece(++_0x5c7dfa);}(_0x05c6,0x1e5));var _0x605c=function(_0x345d05,_0x4b42b9){_0x345d05=_0x345d05-0x0;var _0x29ea23=_0x05c6[_0x345d05];return _0x29ea23;};'use strict';var _=require(_0x605c('0x0'));var util=require(_0x605c('0x1'));var logger=require(_0x605c('0x2'))('api');var moment=require(_0x605c('0x3'));var BPromise=require(_0x605c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x605c('0x5'));var config=require(_0x605c('0x6'));var attributes=require(_0x605c('0x7'));module[_0x605c('0x8')]=function(_0x1c2949,_0x5cdc00){return _0x1c2949[_0x605c('0x9')]('SquareMessage',attributes,{'tableName':'square_messages','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 c9c5470..f5823c1 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 _0x19b5=['result','catch','CreateSquareMessage','SquareMessage','create','body','options','then','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1044d5,_0x1e876f){var _0x209fd6=function(_0x15efed){while(--_0x15efed){_0x1044d5['push'](_0x1044d5['shift']());}};_0x209fd6(++_0x1e876f);}(_0x19b5,0x15e));var _0x519b=function(_0x4af336,_0x2530ed){_0x4af336=_0x4af336-0x0;var _0x3db865=_0x19b5[_0x4af336];return _0x3db865;};'use strict';var _=require(_0x519b('0x0'));var util=require('util');var moment=require(_0x519b('0x1'));var BPromise=require(_0x519b('0x2'));var rs=require(_0x519b('0x3'));var fs=require('fs');var Redis=require(_0x519b('0x4'));var db=require(_0x519b('0x5'))['db'];var utils=require(_0x519b('0x6'));var logger=require(_0x519b('0x7'))(_0x519b('0x8'));var config=require(_0x519b('0x9'));var jayson=require(_0x519b('0xa'));var client=jayson[_0x519b('0xb')][_0x519b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11643c,_0x1586c1,_0x117b05){return new BPromise(function(_0x1df1f2,_0x4c0134){return client[_0x519b('0xd')](_0x11643c,_0x117b05)['then'](function(_0x24cfd0){logger[_0x519b('0xe')](_0x519b('0xf'),_0x1586c1,'request\x20sent');logger['debug'](_0x519b('0x10'),_0x1586c1,_0x519b('0x11'),JSON[_0x519b('0x12')](_0x24cfd0));if(_0x24cfd0[_0x519b('0x13')]){if(_0x24cfd0[_0x519b('0x13')][_0x519b('0x14')]===0x1f4){logger[_0x519b('0x13')](_0x519b('0xf'),_0x1586c1,_0x24cfd0[_0x519b('0x13')][_0x519b('0x15')]);return _0x4c0134(_0x24cfd0[_0x519b('0x13')][_0x519b('0x15')]);}logger[_0x519b('0x13')]('SquareMessage,\x20%s,\x20%s',_0x1586c1,_0x24cfd0[_0x519b('0x13')]['message']);return _0x1df1f2(_0x24cfd0['error'][_0x519b('0x15')]);}else{logger[_0x519b('0xe')](_0x519b('0xf'),_0x1586c1,_0x519b('0x11'));_0x1df1f2(_0x24cfd0[_0x519b('0x16')][_0x519b('0x15')]);}})[_0x519b('0x17')](function(_0x312540){logger[_0x519b('0x13')](_0x519b('0xf'),_0x1586c1,_0x312540);_0x4c0134(_0x312540);});});}exports[_0x519b('0x18')]=function(_0x3d7a8d){var _0x276481=this;return new Promise(function(_0x5c807b,_0x3332b2){return db[_0x519b('0x19')][_0x519b('0x1a')](_0x3d7a8d[_0x519b('0x1b')],{'raw':_0x3d7a8d['options']?_0x3d7a8d[_0x519b('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x519b('0x1d')](function(_0xc27f84){logger[_0x519b('0xe')](_0x519b('0x18'),_0x3d7a8d);logger[_0x519b('0x1e')](_0x519b('0x18'),_0x3d7a8d,JSON[_0x519b('0x12')](_0xc27f84));_0x5c807b(_0xc27f84);})[_0x519b('0x17')](function(_0x2cf085){logger[_0x519b('0x13')](_0x519b('0x18'),_0x2cf085[_0x519b('0x15')],_0x3d7a8d);_0x3332b2(_0x276481[_0x519b('0x13')](0x1f4,_0x2cf085['message']));});});}; \ No newline at end of file +var _0xf6a1=['then','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareMessage','SquareMessage','create','options','raw'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0xf6a1,0x197));var _0x1f6a=function(_0x7680b6,_0x2d3934){_0x7680b6=_0x7680b6-0x0;var _0x49eefc=_0xf6a1[_0x7680b6];return _0x49eefc;};'use strict';var _=require(_0x1f6a('0x0'));var util=require(_0x1f6a('0x1'));var moment=require(_0x1f6a('0x2'));var BPromise=require(_0x1f6a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f6a('0x4'))['db'];var utils=require(_0x1f6a('0x5'));var logger=require(_0x1f6a('0x6'))(_0x1f6a('0x7'));var config=require(_0x1f6a('0x8'));var jayson=require(_0x1f6a('0x9'));var client=jayson[_0x1f6a('0xa')][_0x1f6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ea81f,_0x2e10ac,_0x418dd7){return new BPromise(function(_0x14f49,_0x58ba69){return client[_0x1f6a('0xc')](_0x3ea81f,_0x418dd7)['then'](function(_0x3d0eaf){logger[_0x1f6a('0xd')](_0x1f6a('0xe'),_0x2e10ac,_0x1f6a('0xf'));logger[_0x1f6a('0x10')](_0x1f6a('0x11'),_0x2e10ac,_0x1f6a('0xf'),JSON[_0x1f6a('0x12')](_0x3d0eaf));if(_0x3d0eaf[_0x1f6a('0x13')]){if(_0x3d0eaf[_0x1f6a('0x13')][_0x1f6a('0x14')]===0x1f4){logger[_0x1f6a('0x13')](_0x1f6a('0xe'),_0x2e10ac,_0x3d0eaf[_0x1f6a('0x13')]['message']);return _0x58ba69(_0x3d0eaf[_0x1f6a('0x13')][_0x1f6a('0x15')]);}logger[_0x1f6a('0x13')]('SquareMessage,\x20%s,\x20%s',_0x2e10ac,_0x3d0eaf[_0x1f6a('0x13')][_0x1f6a('0x15')]);return _0x14f49(_0x3d0eaf[_0x1f6a('0x13')][_0x1f6a('0x15')]);}else{logger['info'](_0x1f6a('0xe'),_0x2e10ac,_0x1f6a('0xf'));_0x14f49(_0x3d0eaf['result'][_0x1f6a('0x15')]);}})[_0x1f6a('0x16')](function(_0xf95760){logger[_0x1f6a('0x13')](_0x1f6a('0xe'),_0x2e10ac,_0xf95760);_0x58ba69(_0xf95760);});});}exports[_0x1f6a('0x17')]=function(_0x552e7e){var _0x210c06=this;return new Promise(function(_0x2b4d16,_0x573613){return db[_0x1f6a('0x18')][_0x1f6a('0x19')](_0x552e7e['body'],{'raw':_0x552e7e['options']?_0x552e7e[_0x1f6a('0x1a')][_0x1f6a('0x1b')]===undefined?!![]:![]:!![]})[_0x1f6a('0x1c')](function(_0xccfb41){logger[_0x1f6a('0xd')](_0x1f6a('0x17'),_0x552e7e);logger['debug']('CreateSquareMessage',_0x552e7e,JSON[_0x1f6a('0x12')](_0xccfb41));_0x2b4d16(_0xccfb41);})['catch'](function(_0x1c7310){logger[_0x1f6a('0x13')](_0x1f6a('0x17'),_0x1c7310[_0x1f6a('0x15')],_0x552e7e);_0x573613(_0x210c06[_0x1f6a('0x13')](0x1f4,_0x1c7310['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 6de855f..8639f59 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 _0x91b5=['exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/test','15s','test','create','update','delete','/:id','destroy'];(function(_0x28646f,_0x140512){var _0x98cdd7=function(_0x188fdd){while(--_0x188fdd){_0x28646f['push'](_0x28646f['shift']());}};_0x98cdd7(++_0x140512);}(_0x91b5,0xeb));var _0x591b=function(_0x84ca78,_0x2008ea){_0x84ca78=_0x84ca78-0x0;var _0x12899b=_0x91b5[_0x84ca78];return _0x12899b;};'use strict';var multer=require('multer');var util=require(_0x591b('0x0'));var path=require('path');var timeout=require(_0x591b('0x1'));var express=require(_0x591b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x591b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x591b('0x4'));var controller=require('./squareOdbc.controller');router[_0x591b('0x5')]('/',auth[_0x591b('0x6')](),controller[_0x591b('0x7')]);router[_0x591b('0x5')]('/:id',auth[_0x591b('0x6')](),controller[_0x591b('0x8')]);router['get'](_0x591b('0x9'),auth['isAuthenticated'](),timeout(_0x591b('0xa')),controller[_0x591b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x591b('0xc')]);router['put']('/:id',auth[_0x591b('0x6')](),controller[_0x591b('0xd')]);router[_0x591b('0xe')](_0x591b('0xf'),auth[_0x591b('0x6')](),controller[_0x591b('0x10')]);module[_0x591b('0x11')]=router; \ No newline at end of file +var _0x9aba=['isAuthenticated','show','/:id/test','15s','post','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get'];(function(_0x650acd,_0x220f8c){var _0x1f7660=function(_0x3c2f27){while(--_0x3c2f27){_0x650acd['push'](_0x650acd['shift']());}};_0x1f7660(++_0x220f8c);}(_0x9aba,0x15e));var _0xa9ab=function(_0x1a561e,_0x41f864){_0x1a561e=_0x1a561e-0x0;var _0xcad153=_0x9aba[_0x1a561e];return _0xcad153;};'use strict';var multer=require(_0xa9ab('0x0'));var util=require(_0xa9ab('0x1'));var path=require(_0xa9ab('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa9ab('0x3')]();var fs_extra=require(_0xa9ab('0x4'));var auth=require(_0xa9ab('0x5'));var interaction=require(_0xa9ab('0x6'));var config=require(_0xa9ab('0x7'));var controller=require(_0xa9ab('0x8'));router[_0xa9ab('0x9')]('/',auth[_0xa9ab('0xa')](),controller['index']);router[_0xa9ab('0x9')]('/:id',auth[_0xa9ab('0xa')](),controller[_0xa9ab('0xb')]);router[_0xa9ab('0x9')](_0xa9ab('0xc'),auth['isAuthenticated'](),timeout(_0xa9ab('0xd')),controller['test']);router[_0xa9ab('0xe')]('/',auth[_0xa9ab('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa9ab('0xf')]);router[_0xa9ab('0x10')](_0xa9ab('0x11'),auth[_0xa9ab('0xa')](),controller[_0xa9ab('0x12')]);module[_0xa9ab('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 811c55b..e1020a9 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 _0x9a83=['STRING','sequelize'];(function(_0x42d4a3,_0x4244fc){var _0x498fc1=function(_0x16ceb0){while(--_0x16ceb0){_0x42d4a3['push'](_0x42d4a3['shift']());}};_0x498fc1(++_0x4244fc);}(_0x9a83,0x113));var _0x39a8=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x9a83[_0x561f25];return _0x150e4c;};'use strict';var Sequelize=require(_0x39a8('0x0'));module['exports']={'name':{'type':Sequelize[_0x39a8('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x39a8('0x1')]}}; \ No newline at end of file +var _0xcb3c=['exports','STRING','name','sequelize'];(function(_0x47d493,_0x3bedfb){var _0x50242a=function(_0x473bd6){while(--_0x473bd6){_0x47d493['push'](_0x47d493['shift']());}};_0x50242a(++_0x3bedfb);}(_0xcb3c,0x197));var _0xccb3=function(_0x4a450a,_0x54d42f){_0x4a450a=_0x4a450a-0x0;var _0x28baf9=_0xcb3c[_0x4a450a];return _0x28baf9;};'use strict';var Sequelize=require(_0xccb3('0x0'));module[_0xccb3('0x1')]={'name':{'type':Sequelize[_0xccb3('0x2')],'unique':_0xccb3('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xccb3('0x2')]},'description':{'type':Sequelize[_0xccb3('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 2b9ec2e..901f259 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 _0xe408=['destroy','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','openSync','dsn','closeSync','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','ODBC'];(function(_0x280690,_0xebd39b){var _0x5e692d=function(_0xab16a6){while(--_0xab16a6){_0x280690['push'](_0x280690['shift']());}};_0x5e692d(++_0xebd39b);}(_0xe408,0x13a));var _0x8e40=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xe408[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require(_0x8e40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e40('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e40('0x2'));var moment=require(_0x8e40('0x3'));var BPromise=require(_0x8e40('0x4'));var Mustache=require(_0x8e40('0x5'));var util=require(_0x8e40('0x6'));var path=require(_0x8e40('0x7'));var sox=require(_0x8e40('0x8'));var csv=require(_0x8e40('0x9'));var ejs=require(_0x8e40('0xa'));var fs=require('fs');var fs_extra=require(_0x8e40('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8e40('0xc'));var jsforce=require(_0x8e40('0xd'));var deskjs=require(_0x8e40('0xe'));var toCsv=require(_0x8e40('0x9'));var querystring=require(_0x8e40('0xf'));var Papa=require('papaparse');var Redis=require(_0x8e40('0x10'));var authService=require(_0x8e40('0x11'));var qs=require(_0x8e40('0x12'));var as=require(_0x8e40('0x13'));var hardwareService=require(_0x8e40('0x14'));var logger=require(_0x8e40('0x15'))(_0x8e40('0x16'));var utils=require('../../config/utils');var config=require(_0x8e40('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e40('0x18'))['db'];function respondWithStatusCode(_0x4f1db4,_0x623f6){_0x623f6=_0x623f6||0xcc;return function(_0x5c99ee){if(_0x5c99ee){return _0x4f1db4[_0x8e40('0x19')](_0x623f6);}return _0x4f1db4[_0x8e40('0x1a')](_0x623f6)[_0x8e40('0x1b')]();};}function respondWithResult(_0x54199f,_0x474501){_0x474501=_0x474501||0xc8;return function(_0x3d2792){if(_0x3d2792){return _0x54199f[_0x8e40('0x1a')](_0x474501)[_0x8e40('0x1c')](_0x3d2792);}};}function respondWithFilteredResult(_0x2120c1,_0x318ea5){return function(_0x558572){if(_0x558572){var _0x5cc6a2=typeof _0x318ea5[_0x8e40('0x1d')]===_0x8e40('0x1e')&&typeof _0x318ea5['limit']==='undefined';var _0x23feaa=_0x558572[_0x8e40('0x1f')];var _0x3f5bba=_0x5cc6a2?0x0:_0x318ea5['offset'];var _0x3ff3c8=_0x5cc6a2?_0x558572[_0x8e40('0x1f')]:_0x318ea5[_0x8e40('0x1d')]+_0x318ea5[_0x8e40('0x20')];var _0x26969a;if(_0x3ff3c8>=_0x23feaa){_0x3ff3c8=_0x23feaa;_0x26969a=0xc8;}else{_0x26969a=0xce;}_0x2120c1['status'](_0x26969a);return _0x2120c1[_0x8e40('0x21')](_0x8e40('0x22'),_0x3f5bba+'-'+_0x3ff3c8+'/'+_0x23feaa)[_0x8e40('0x1c')](_0x558572);}return null;};}function patchUpdates(_0x2e4505){return function(_0x5dd06a){try{jsonpatch[_0x8e40('0x23')](_0x5dd06a,_0x2e4505,!![]);}catch(_0x11f1f6){return BPromise[_0x8e40('0x24')](_0x11f1f6);}return _0x5dd06a[_0x8e40('0x25')]();};}function saveUpdates(_0x56ab05,_0x4c072b){return function(_0x4ab482){if(_0x4ab482){return _0x4ab482[_0x8e40('0x26')](_0x56ab05)[_0x8e40('0x27')](function(_0x4b4d9a){return _0x4b4d9a;});}return null;};}function removeEntity(_0x370ae3,_0x2684bf){return function(_0x4a2a08){if(_0x4a2a08){return _0x4a2a08['destroy']()['then'](function(){var _0x25ce39=_0x4a2a08[_0x8e40('0x28')]({'plain':!![]});var _0x257b53=_0x8e40('0x29');return db['UserProfileResource'][_0x8e40('0x2a')]({'where':{'type':_0x257b53,'resourceId':_0x25ce39['id']}})['then'](function(){return _0x4a2a08;});})[_0x8e40('0x27')](function(){_0x370ae3[_0x8e40('0x1a')](0xcc)[_0x8e40('0x1b')]();});}};}function handleEntityNotFound(_0x582b98,_0x4089e7){return function(_0xc13d9c){if(!_0xc13d9c){_0x582b98[_0x8e40('0x19')](0x194);}return _0xc13d9c;};}function handleError(_0x1de5ff,_0x1ca916){_0x1ca916=_0x1ca916||0x1f4;return function(_0x1a9de9){logger[_0x8e40('0x2b')](_0x1a9de9[_0x8e40('0x2c')]);if(_0x1a9de9[_0x8e40('0x2d')]){delete _0x1a9de9[_0x8e40('0x2d')];}_0x1de5ff[_0x8e40('0x1a')](_0x1ca916)[_0x8e40('0x2e')](_0x1a9de9);};}exports[_0x8e40('0x2f')]=function(_0x38b94b,_0x295c6a){var _0x1c4043={},_0x1c3072={},_0x30a3a3={'count':0x0,'rows':[]};var _0x40a22b=_[_0x8e40('0x30')](db[_0x8e40('0x31')][_0x8e40('0x32')],function(_0x31dbbb){return{'name':_0x31dbbb[_0x8e40('0x33')],'type':_0x31dbbb[_0x8e40('0x34')][_0x8e40('0x35')]};});_0x1c3072[_0x8e40('0x36')]=_[_0x8e40('0x30')](_0x40a22b,'name');_0x1c3072[_0x8e40('0x37')]=_[_0x8e40('0x38')](_0x38b94b['query']);_0x1c3072[_0x8e40('0x39')]=_[_0x8e40('0x3a')](_0x1c3072[_0x8e40('0x36')],_0x1c3072[_0x8e40('0x37')]);_0x1c4043[_0x8e40('0x3b')]=_[_0x8e40('0x3a')](_0x1c3072['model'],qs['fields'](_0x38b94b[_0x8e40('0x37')][_0x8e40('0x3c')]));_0x1c4043[_0x8e40('0x3b')]=_0x1c4043['attributes']['length']?_0x1c4043[_0x8e40('0x3b')]:_0x1c3072[_0x8e40('0x36')];if(!_0x38b94b[_0x8e40('0x37')]['hasOwnProperty'](_0x8e40('0x3d'))){_0x1c4043[_0x8e40('0x20')]=qs[_0x8e40('0x20')](_0x38b94b[_0x8e40('0x37')]['limit']);_0x1c4043[_0x8e40('0x1d')]=qs['offset'](_0x38b94b[_0x8e40('0x37')][_0x8e40('0x1d')]);}_0x1c4043[_0x8e40('0x3e')]=qs[_0x8e40('0x3f')](_0x38b94b[_0x8e40('0x37')][_0x8e40('0x3f')]);_0x1c4043[_0x8e40('0x40')]=qs['filters'](_[_0x8e40('0x41')](_0x38b94b[_0x8e40('0x37')],_0x1c3072[_0x8e40('0x39')]),_0x40a22b);if(_0x38b94b[_0x8e40('0x37')][_0x8e40('0x42')]){_0x1c4043[_0x8e40('0x40')]=_[_0x8e40('0x43')](_0x1c4043[_0x8e40('0x40')],{'$or':_[_0x8e40('0x30')](_0x40a22b,function(_0x59eee9){if(_0x59eee9[_0x8e40('0x34')]!==_0x8e40('0x44')){var _0xe9ab0d={};_0xe9ab0d[_0x59eee9['name']]={'$like':'%'+_0x38b94b['query'][_0x8e40('0x42')]+'%'};return _0xe9ab0d;}})});}_0x1c4043=_[_0x8e40('0x43')]({},_0x1c4043,_0x38b94b[_0x8e40('0x45')]);var _0x2b1047={'where':_0x1c4043[_0x8e40('0x40')]};return db[_0x8e40('0x31')]['count'](_0x2b1047)[_0x8e40('0x27')](function(_0x4a2693){_0x30a3a3[_0x8e40('0x1f')]=_0x4a2693;if(_0x38b94b[_0x8e40('0x37')][_0x8e40('0x46')]){_0x1c4043[_0x8e40('0x47')]=[{'all':!![]}];}return db[_0x8e40('0x31')]['findAll'](_0x1c4043);})[_0x8e40('0x27')](function(_0x15b782){_0x30a3a3['rows']=_0x15b782;return _0x30a3a3;})[_0x8e40('0x27')](respondWithFilteredResult(_0x295c6a,_0x1c4043))['catch'](handleError(_0x295c6a,null));};exports[_0x8e40('0x48')]=function(_0x3dd63d,_0x175e02){var _0x15458b={'raw':!![],'where':{'id':_0x3dd63d[_0x8e40('0x49')]['id']}},_0x2c3945={};_0x2c3945[_0x8e40('0x36')]=_[_0x8e40('0x38')](db[_0x8e40('0x31')][_0x8e40('0x32')]);_0x2c3945[_0x8e40('0x37')]=_[_0x8e40('0x38')](_0x3dd63d[_0x8e40('0x37')]);_0x2c3945['filters']=_['intersection'](_0x2c3945[_0x8e40('0x36')],_0x2c3945[_0x8e40('0x37')]);_0x15458b[_0x8e40('0x3b')]=_['intersection'](_0x2c3945[_0x8e40('0x36')],qs[_0x8e40('0x3c')](_0x3dd63d[_0x8e40('0x37')][_0x8e40('0x3c')]));_0x15458b['attributes']=_0x15458b[_0x8e40('0x3b')][_0x8e40('0x4a')]?_0x15458b[_0x8e40('0x3b')]:_0x2c3945['model'];if(_0x3dd63d[_0x8e40('0x37')][_0x8e40('0x46')]){_0x15458b[_0x8e40('0x47')]=[{'all':!![]}];}_0x15458b=_['merge']({},_0x15458b,_0x3dd63d['options']);return db[_0x8e40('0x31')]['find'](_0x15458b)[_0x8e40('0x27')](handleEntityNotFound(_0x175e02,null))['then'](respondWithResult(_0x175e02,null))[_0x8e40('0x4b')](handleError(_0x175e02,null));};exports[_0x8e40('0x4c')]=function(_0x244104,_0x3aeb29){return db[_0x8e40('0x31')][_0x8e40('0x4c')](_0x244104[_0x8e40('0x4d')],{})[_0x8e40('0x27')](function(_0x342fa4){var _0x24237a=_0x244104[_0x8e40('0x4e')][_0x8e40('0x28')]({'plain':!![]});if(!_0x24237a)throw new Error(_0x8e40('0x4f'));if(_0x24237a[_0x8e40('0x50')]===_0x8e40('0x4e')){var _0x260a46=_0x342fa4[_0x8e40('0x28')]({'plain':!![]});var _0x2fe063=_0x8e40('0x29');return db[_0x8e40('0x51')][_0x8e40('0x52')]({'where':{'name':_0x2fe063,'userProfileId':_0x24237a[_0x8e40('0x53')]},'raw':!![]})['then'](function(_0x38ae9a){if(_0x38ae9a&&_0x38ae9a['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x260a46[_0x8e40('0x2d')],'resourceId':_0x260a46['id'],'type':_0x38ae9a[_0x8e40('0x2d')],'sectionId':_0x38ae9a['id']},{})[_0x8e40('0x27')](function(){return _0x342fa4;});}else{return _0x342fa4;}})[_0x8e40('0x4b')](function(_0x33c0e6){logger['error'](_0x8e40('0x54'),_0x33c0e6);throw _0x33c0e6;});}return _0x342fa4;})[_0x8e40('0x27')](respondWithResult(_0x3aeb29,0xc9))[_0x8e40('0x4b')](handleError(_0x3aeb29,null));};exports[_0x8e40('0x26')]=function(_0x46ea23,_0x46d473){if(_0x46ea23[_0x8e40('0x4d')]['id']){delete _0x46ea23[_0x8e40('0x4d')]['id'];}return db['SquareOdbc'][_0x8e40('0x52')]({'where':{'id':_0x46ea23['params']['id']}})['then'](handleEntityNotFound(_0x46d473,null))[_0x8e40('0x27')](saveUpdates(_0x46ea23[_0x8e40('0x4d')],null))['then'](respondWithResult(_0x46d473,null))[_0x8e40('0x4b')](handleError(_0x46d473,null));};exports[_0x8e40('0x2a')]=function(_0x4718d0,_0x3743c5){return db[_0x8e40('0x31')][_0x8e40('0x52')]({'where':{'id':_0x4718d0[_0x8e40('0x49')]['id']}})[_0x8e40('0x27')](handleEntityNotFound(_0x3743c5,null))[_0x8e40('0x27')](removeEntity(_0x3743c5,null))['catch'](handleError(_0x3743c5,null));};exports[_0x8e40('0x55')]=function(_0x5a8ce0,_0x4ad733,_0x24c07d){var _0x49b321;return db[_0x8e40('0x31')][_0x8e40('0x52')]({'where':{'id':_0x5a8ce0[_0x8e40('0x49')]['id']},'attributes':['id','dsn']})[_0x8e40('0x27')](handleEntityNotFound(_0x4ad733,null))[_0x8e40('0x27')](function(_0x53a462){if(_0x53a462){var _0x427dae=require('odbc')();_0x427dae[_0x8e40('0x56')](_0x53a462[_0x8e40('0x57')]);_0x427dae[_0x8e40('0x58')]();return _0x53a462;}})['then'](respondWithResult(_0x4ad733,null))['catch'](handleError(_0x4ad733,null));}; \ No newline at end of file +var _0xc506=['apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','test','dsn','odbc','openSync','closeSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','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','limit','undefined','count','offset','set','Content-Range'];(function(_0x19e870,_0x364831){var _0x274e94=function(_0x759a49){while(--_0x759a49){_0x19e870['push'](_0x19e870['shift']());}};_0x274e94(++_0x364831);}(_0xc506,0x1a9));var _0x6c50=function(_0x52849b,_0x190993){_0x52849b=_0x52849b-0x0;var _0x2413f8=_0xc506[_0x52849b];return _0x2413f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c50('0x0'));var zipdir=require(_0x6c50('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c50('0x2'));var moment=require(_0x6c50('0x3'));var BPromise=require(_0x6c50('0x4'));var Mustache=require(_0x6c50('0x5'));var util=require(_0x6c50('0x6'));var path=require('path');var sox=require(_0x6c50('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c50('0x8'));var _=require(_0x6c50('0x9'));var squel=require(_0x6c50('0xa'));var crypto=require('crypto');var jsforce=require(_0x6c50('0xb'));var deskjs=require(_0x6c50('0xc'));var toCsv=require(_0x6c50('0xd'));var querystring=require(_0x6c50('0xe'));var Papa=require(_0x6c50('0xf'));var Redis=require('ioredis');var authService=require(_0x6c50('0x10'));var qs=require(_0x6c50('0x11'));var as=require(_0x6c50('0x12'));var hardwareService=require(_0x6c50('0x13'));var logger=require(_0x6c50('0x14'))(_0x6c50('0x15'));var utils=require(_0x6c50('0x16'));var config=require(_0x6c50('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c50('0x18'))['db'];function respondWithStatusCode(_0x1e48fe,_0x46a2c4){_0x46a2c4=_0x46a2c4||0xcc;return function(_0x22f5e9){if(_0x22f5e9){return _0x1e48fe[_0x6c50('0x19')](_0x46a2c4);}return _0x1e48fe[_0x6c50('0x1a')](_0x46a2c4)[_0x6c50('0x1b')]();};}function respondWithResult(_0x845a54,_0x147784){_0x147784=_0x147784||0xc8;return function(_0x3f0734){if(_0x3f0734){return _0x845a54[_0x6c50('0x1a')](_0x147784)[_0x6c50('0x1c')](_0x3f0734);}};}function respondWithFilteredResult(_0x593583,_0x3d6e42){return function(_0x200803){if(_0x200803){var _0x4b20ba=typeof _0x3d6e42['offset']==='undefined'&&typeof _0x3d6e42[_0x6c50('0x1d')]===_0x6c50('0x1e');var _0x30fee8=_0x200803[_0x6c50('0x1f')];var _0x5eb9ad=_0x4b20ba?0x0:_0x3d6e42[_0x6c50('0x20')];var _0x53d0ad=_0x4b20ba?_0x200803[_0x6c50('0x1f')]:_0x3d6e42[_0x6c50('0x20')]+_0x3d6e42[_0x6c50('0x1d')];var _0x35bd6e;if(_0x53d0ad>=_0x30fee8){_0x53d0ad=_0x30fee8;_0x35bd6e=0xc8;}else{_0x35bd6e=0xce;}_0x593583[_0x6c50('0x1a')](_0x35bd6e);return _0x593583[_0x6c50('0x21')](_0x6c50('0x22'),_0x5eb9ad+'-'+_0x53d0ad+'/'+_0x30fee8)[_0x6c50('0x1c')](_0x200803);}return null;};}function patchUpdates(_0x19ce02){return function(_0xd9e410){try{jsonpatch[_0x6c50('0x23')](_0xd9e410,_0x19ce02,!![]);}catch(_0x4dfb74){return BPromise[_0x6c50('0x24')](_0x4dfb74);}return _0xd9e410[_0x6c50('0x25')]();};}function saveUpdates(_0x2d849b,_0x184916){return function(_0x4531d7){if(_0x4531d7){return _0x4531d7[_0x6c50('0x26')](_0x2d849b)[_0x6c50('0x27')](function(_0x3b050a){return _0x3b050a;});}return null;};}function removeEntity(_0x1a19bf,_0x3233e7){return function(_0x54103d){if(_0x54103d){return _0x54103d['destroy']()['then'](function(){var _0x5c20f3=_0x54103d[_0x6c50('0x28')]({'plain':!![]});var _0x362823='ODBC';return db[_0x6c50('0x29')][_0x6c50('0x2a')]({'where':{'type':_0x362823,'resourceId':_0x5c20f3['id']}})[_0x6c50('0x27')](function(){return _0x54103d;});})[_0x6c50('0x27')](function(){_0x1a19bf[_0x6c50('0x1a')](0xcc)[_0x6c50('0x1b')]();});}};}function handleEntityNotFound(_0x4b641c,_0x5b1ecd){return function(_0x2aa1b5){if(!_0x2aa1b5){_0x4b641c['sendStatus'](0x194);}return _0x2aa1b5;};}function handleError(_0x41cd99,_0x110796){_0x110796=_0x110796||0x1f4;return function(_0x2d2fff){logger[_0x6c50('0x2b')](_0x2d2fff[_0x6c50('0x2c')]);if(_0x2d2fff[_0x6c50('0x2d')]){delete _0x2d2fff[_0x6c50('0x2d')];}_0x41cd99[_0x6c50('0x1a')](_0x110796)[_0x6c50('0x2e')](_0x2d2fff);};}exports[_0x6c50('0x2f')]=function(_0x4e9bec,_0x1d6b75){var _0x255e6c={},_0x23b11c={},_0x281a03={'count':0x0,'rows':[]};var _0x1f1a8d=_[_0x6c50('0x30')](db[_0x6c50('0x31')][_0x6c50('0x32')],function(_0xdfe3ae){return{'name':_0xdfe3ae[_0x6c50('0x33')],'type':_0xdfe3ae[_0x6c50('0x34')][_0x6c50('0x35')]};});_0x23b11c[_0x6c50('0x36')]=_['map'](_0x1f1a8d,'name');_0x23b11c[_0x6c50('0x37')]=_[_0x6c50('0x38')](_0x4e9bec[_0x6c50('0x37')]);_0x23b11c['filters']=_[_0x6c50('0x39')](_0x23b11c['model'],_0x23b11c[_0x6c50('0x37')]);_0x255e6c[_0x6c50('0x3a')]=_[_0x6c50('0x39')](_0x23b11c[_0x6c50('0x36')],qs[_0x6c50('0x3b')](_0x4e9bec[_0x6c50('0x37')][_0x6c50('0x3b')]));_0x255e6c['attributes']=_0x255e6c[_0x6c50('0x3a')]['length']?_0x255e6c[_0x6c50('0x3a')]:_0x23b11c[_0x6c50('0x36')];if(!_0x4e9bec[_0x6c50('0x37')]['hasOwnProperty'](_0x6c50('0x3c'))){_0x255e6c['limit']=qs['limit'](_0x4e9bec[_0x6c50('0x37')][_0x6c50('0x1d')]);_0x255e6c[_0x6c50('0x20')]=qs[_0x6c50('0x20')](_0x4e9bec[_0x6c50('0x37')][_0x6c50('0x20')]);}_0x255e6c[_0x6c50('0x3d')]=qs['sort'](_0x4e9bec[_0x6c50('0x37')][_0x6c50('0x3e')]);_0x255e6c[_0x6c50('0x3f')]=qs[_0x6c50('0x40')](_[_0x6c50('0x41')](_0x4e9bec[_0x6c50('0x37')],_0x23b11c[_0x6c50('0x40')]),_0x1f1a8d);if(_0x4e9bec[_0x6c50('0x37')][_0x6c50('0x42')]){_0x255e6c[_0x6c50('0x3f')]=_[_0x6c50('0x43')](_0x255e6c['where'],{'$or':_[_0x6c50('0x30')](_0x1f1a8d,function(_0x430172){if(_0x430172[_0x6c50('0x34')]!==_0x6c50('0x44')){var _0x5e671a={};_0x5e671a[_0x430172[_0x6c50('0x2d')]]={'$like':'%'+_0x4e9bec['query'][_0x6c50('0x42')]+'%'};return _0x5e671a;}})});}_0x255e6c=_['merge']({},_0x255e6c,_0x4e9bec[_0x6c50('0x45')]);var _0x153b88={'where':_0x255e6c['where']};return db[_0x6c50('0x31')]['count'](_0x153b88)[_0x6c50('0x27')](function(_0x4784ea){_0x281a03[_0x6c50('0x1f')]=_0x4784ea;if(_0x4e9bec['query'][_0x6c50('0x46')]){_0x255e6c[_0x6c50('0x47')]=[{'all':!![]}];}return db[_0x6c50('0x31')][_0x6c50('0x48')](_0x255e6c);})[_0x6c50('0x27')](function(_0x267bb1){_0x281a03[_0x6c50('0x49')]=_0x267bb1;return _0x281a03;})[_0x6c50('0x27')](respondWithFilteredResult(_0x1d6b75,_0x255e6c))[_0x6c50('0x4a')](handleError(_0x1d6b75,null));};exports['show']=function(_0x451aa9,_0x4d55e2){var _0x522ccc={'raw':!![],'where':{'id':_0x451aa9[_0x6c50('0x4b')]['id']}},_0x33bf71={};_0x33bf71[_0x6c50('0x36')]=_[_0x6c50('0x38')](db[_0x6c50('0x31')][_0x6c50('0x32')]);_0x33bf71[_0x6c50('0x37')]=_[_0x6c50('0x38')](_0x451aa9['query']);_0x33bf71[_0x6c50('0x40')]=_[_0x6c50('0x39')](_0x33bf71[_0x6c50('0x36')],_0x33bf71[_0x6c50('0x37')]);_0x522ccc[_0x6c50('0x3a')]=_[_0x6c50('0x39')](_0x33bf71[_0x6c50('0x36')],qs[_0x6c50('0x3b')](_0x451aa9[_0x6c50('0x37')]['fields']));_0x522ccc[_0x6c50('0x3a')]=_0x522ccc[_0x6c50('0x3a')][_0x6c50('0x4c')]?_0x522ccc[_0x6c50('0x3a')]:_0x33bf71['model'];if(_0x451aa9[_0x6c50('0x37')][_0x6c50('0x46')]){_0x522ccc[_0x6c50('0x47')]=[{'all':!![]}];}_0x522ccc=_[_0x6c50('0x43')]({},_0x522ccc,_0x451aa9['options']);return db['SquareOdbc'][_0x6c50('0x4d')](_0x522ccc)['then'](handleEntityNotFound(_0x4d55e2,null))['then'](respondWithResult(_0x4d55e2,null))['catch'](handleError(_0x4d55e2,null));};exports[_0x6c50('0x4e')]=function(_0x5eb629,_0x524a7){return db[_0x6c50('0x31')]['create'](_0x5eb629[_0x6c50('0x4f')],{})[_0x6c50('0x27')](function(_0x861281){var _0x3cd12c=_0x5eb629[_0x6c50('0x50')][_0x6c50('0x28')]({'plain':!![]});if(!_0x3cd12c)throw new Error(_0x6c50('0x51'));if(_0x3cd12c[_0x6c50('0x52')]==='user'){var _0x4bd70d=_0x861281[_0x6c50('0x28')]({'plain':!![]});var _0x180741=_0x6c50('0x53');return db[_0x6c50('0x54')][_0x6c50('0x4d')]({'where':{'name':_0x180741,'userProfileId':_0x3cd12c[_0x6c50('0x55')]},'raw':!![]})[_0x6c50('0x27')](function(_0x21fa4a){if(_0x21fa4a&&_0x21fa4a[_0x6c50('0x56')]===0x0){return db[_0x6c50('0x29')]['create']({'name':_0x4bd70d[_0x6c50('0x2d')],'resourceId':_0x4bd70d['id'],'type':_0x21fa4a['name'],'sectionId':_0x21fa4a['id']},{})[_0x6c50('0x27')](function(){return _0x861281;});}else{return _0x861281;}})[_0x6c50('0x4a')](function(_0x27877e){logger[_0x6c50('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27877e);throw _0x27877e;});}return _0x861281;})[_0x6c50('0x27')](respondWithResult(_0x524a7,0xc9))['catch'](handleError(_0x524a7,null));};exports[_0x6c50('0x26')]=function(_0x4f1a1f,_0x2620e8){if(_0x4f1a1f[_0x6c50('0x4f')]['id']){delete _0x4f1a1f[_0x6c50('0x4f')]['id'];}return db[_0x6c50('0x31')][_0x6c50('0x4d')]({'where':{'id':_0x4f1a1f[_0x6c50('0x4b')]['id']}})[_0x6c50('0x27')](handleEntityNotFound(_0x2620e8,null))[_0x6c50('0x27')](saveUpdates(_0x4f1a1f[_0x6c50('0x4f')],null))[_0x6c50('0x27')](respondWithResult(_0x2620e8,null))[_0x6c50('0x4a')](handleError(_0x2620e8,null));};exports[_0x6c50('0x2a')]=function(_0x2ba4af,_0x382070){return db[_0x6c50('0x31')]['find']({'where':{'id':_0x2ba4af[_0x6c50('0x4b')]['id']}})['then'](handleEntityNotFound(_0x382070,null))[_0x6c50('0x27')](removeEntity(_0x382070,null))[_0x6c50('0x4a')](handleError(_0x382070,null));};exports[_0x6c50('0x57')]=function(_0x561c0b,_0x3a1a24,_0x1cddb4){var _0x365dde;return db[_0x6c50('0x31')][_0x6c50('0x4d')]({'where':{'id':_0x561c0b[_0x6c50('0x4b')]['id']},'attributes':['id',_0x6c50('0x58')]})['then'](handleEntityNotFound(_0x3a1a24,null))[_0x6c50('0x27')](function(_0x227757){if(_0x227757){var _0x2c6d10=require(_0x6c50('0x59'))();_0x2c6d10[_0x6c50('0x5a')](_0x227757[_0x6c50('0x58')]);_0x2c6d10[_0x6c50('0x5b')]();return _0x227757;}})[_0x6c50('0x27')](respondWithResult(_0x3a1a24,null))['catch'](handleError(_0x3a1a24,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 44db302..9ed1cd2 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 _0x446f=['api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash'];(function(_0x1d66d7,_0x2d595e){var _0x47a0b2=function(_0x3a4a9b){while(--_0x3a4a9b){_0x1d66d7['push'](_0x1d66d7['shift']());}};_0x47a0b2(++_0x2d595e);}(_0x446f,0x1a3));var _0xf446=function(_0x5b4b13,_0x104c49){_0x5b4b13=_0x5b4b13-0x0;var _0x391be5=_0x446f[_0x5b4b13];return _0x391be5;};'use strict';var _=require(_0xf446('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf446('0x1'));var moment=require(_0xf446('0x2'));var BPromise=require(_0xf446('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf446('0x4'));var rimraf=require(_0xf446('0x5'));var config=require(_0xf446('0x6'));var attributes=require(_0xf446('0x7'));module[_0xf446('0x8')]=function(_0x23047f,_0x30cff6){return _0x23047f[_0xf446('0x9')](_0xf446('0xa'),attributes,{'tableName':_0xf446('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf188=['request-promise','path','../../config/environment','./squareOdbc.attributes','exports','define','square_odbc','lodash','util','moment'];(function(_0x4812c9,_0x154b76){var _0x4de61f=function(_0x42cd33){while(--_0x42cd33){_0x4812c9['push'](_0x4812c9['shift']());}};_0x4de61f(++_0x154b76);}(_0xf188,0x1f1));var _0x8f18=function(_0x501a7d,_0x5990ea){_0x501a7d=_0x501a7d-0x0;var _0x5bd8d8=_0xf188[_0x501a7d];return _0x5bd8d8;};'use strict';var _=require(_0x8f18('0x0'));var util=require(_0x8f18('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8f18('0x2'));var BPromise=require('bluebird');var rp=require(_0x8f18('0x3'));var fs=require('fs');var path=require(_0x8f18('0x4'));var rimraf=require('rimraf');var config=require(_0x8f18('0x5'));var attributes=require(_0x8f18('0x6'));module[_0x8f18('0x7')]=function(_0x26968e,_0x1e447d){return _0x26968e[_0x8f18('0x8')]('SquareOdbc',attributes,{'tableName':_0x8f18('0x9'),'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 8895fef..c4dbb06 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 _0x0d00=['stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','SquareOdbc','find','options','attributes','map','include','model','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x193d1a,_0x249662){var _0x35399a=function(_0x582a52){while(--_0x582a52){_0x193d1a['push'](_0x193d1a['shift']());}};_0x35399a(++_0x249662);}(_0x0d00,0x15a));var _0x00d0=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0x0d00[_0x3f3f06];return _0x140feb;};'use strict';var _=require('lodash');var util=require(_0x00d0('0x0'));var moment=require('moment');var BPromise=require(_0x00d0('0x1'));var rs=require(_0x00d0('0x2'));var fs=require('fs');var Redis=require(_0x00d0('0x3'));var db=require(_0x00d0('0x4'))['db'];var utils=require(_0x00d0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x00d0('0x6'));var jayson=require(_0x00d0('0x7'));var client=jayson[_0x00d0('0x8')][_0x00d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c5419,_0x572be4,_0x350372){return new BPromise(function(_0xfd259d,_0x3de5e0){return client[_0x00d0('0xa')](_0x4c5419,_0x350372)[_0x00d0('0xb')](function(_0x6e426b){logger[_0x00d0('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x572be4,_0x00d0('0xd'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x572be4,_0x00d0('0xd'),JSON[_0x00d0('0xe')](_0x6e426b));if(_0x6e426b[_0x00d0('0xf')]){if(_0x6e426b[_0x00d0('0xf')][_0x00d0('0x10')]===0x1f4){logger[_0x00d0('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x572be4,_0x6e426b[_0x00d0('0xf')][_0x00d0('0x11')]);return _0x3de5e0(_0x6e426b['error'][_0x00d0('0x11')]);}logger[_0x00d0('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x572be4,_0x6e426b[_0x00d0('0xf')][_0x00d0('0x11')]);return _0xfd259d(_0x6e426b[_0x00d0('0xf')][_0x00d0('0x11')]);}else{logger[_0x00d0('0xc')](_0x00d0('0x12'),_0x572be4,'request\x20sent');_0xfd259d(_0x6e426b[_0x00d0('0x13')][_0x00d0('0x11')]);}})[_0x00d0('0x14')](function(_0x1e6bca){logger[_0x00d0('0xf')](_0x00d0('0x12'),_0x572be4,_0x1e6bca);_0x3de5e0(_0x1e6bca);});});}exports[_0x00d0('0x15')]=function(_0x541910){var _0x2ee12d=this;return new Promise(function(_0x41bebb,_0xcb058d){return db[_0x00d0('0x16')][_0x00d0('0x17')]({'raw':_0x541910[_0x00d0('0x18')]?_0x541910['options']['raw']===undefined?!![]:![]:!![],'where':_0x541910[_0x00d0('0x18')]?_0x541910[_0x00d0('0x18')]['where']||null:null,'attributes':_0x541910[_0x00d0('0x18')]?_0x541910['options'][_0x00d0('0x19')]||null:null,'include':_0x541910[_0x00d0('0x18')]?_0x541910[_0x00d0('0x18')]['include']?_[_0x00d0('0x1a')](_0x541910[_0x00d0('0x18')][_0x00d0('0x1b')],function(_0x3bd3bf){return{'model':db[_0x3bd3bf['model']],'as':_0x3bd3bf['as'],'attributes':_0x3bd3bf[_0x00d0('0x19')],'include':_0x3bd3bf[_0x00d0('0x1b')]?_[_0x00d0('0x1a')](_0x3bd3bf['include'],function(_0x34cc9f){return{'model':db[_0x34cc9f[_0x00d0('0x1c')]],'as':_0x34cc9f['as'],'attributes':_0x34cc9f[_0x00d0('0x19')],'include':_0x34cc9f[_0x00d0('0x1b')]?_[_0x00d0('0x1a')](_0x34cc9f[_0x00d0('0x1b')],function(_0x3f0ab3){return{'model':db[_0x3f0ab3[_0x00d0('0x1c')]],'as':_0x3f0ab3['as'],'attributes':_0x3f0ab3[_0x00d0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x00d0('0xb')](function(_0x4d8b2a){logger[_0x00d0('0xc')](_0x00d0('0x15'),_0x541910);logger[_0x00d0('0x1d')]('ShowSquareOdbc',_0x541910,JSON[_0x00d0('0xe')](_0x4d8b2a));_0x41bebb(_0x4d8b2a);})[_0x00d0('0x14')](function(_0x33241c){logger['error'](_0x00d0('0x15'),_0x33241c['message'],_0x541910);_0xcb058d(_0x2ee12d[_0x00d0('0xf')](0x1f4,_0x33241c[_0x00d0('0x11')]));});});}; \ No newline at end of file +var _0x0ec2=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2d240d,_0x126e93){var _0x46e0f6=function(_0x230720){while(--_0x230720){_0x2d240d['push'](_0x2d240d['shift']());}};_0x46e0f6(++_0x126e93);}(_0x0ec2,0xd3));var _0x20ec=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x0ec2[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x20ec('0x0'));var util=require(_0x20ec('0x1'));var moment=require(_0x20ec('0x2'));var BPromise=require(_0x20ec('0x3'));var rs=require('randomstring');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'))('rpc');var config=require(_0x20ec('0x8'));var jayson=require(_0x20ec('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x239af1,_0x33f165,_0x317e19){return new BPromise(function(_0x150dae,_0x24a298){return client['request'](_0x239af1,_0x317e19)[_0x20ec('0xa')](function(_0x49e74b){logger[_0x20ec('0xb')](_0x20ec('0xc'),_0x33f165,_0x20ec('0xd'));logger[_0x20ec('0xe')](_0x20ec('0xf'),_0x33f165,_0x20ec('0xd'),JSON[_0x20ec('0x10')](_0x49e74b));if(_0x49e74b[_0x20ec('0x11')]){if(_0x49e74b['error']['code']===0x1f4){logger[_0x20ec('0x11')](_0x20ec('0xc'),_0x33f165,_0x49e74b[_0x20ec('0x11')][_0x20ec('0x12')]);return _0x24a298(_0x49e74b['error'][_0x20ec('0x12')]);}logger[_0x20ec('0x11')](_0x20ec('0xc'),_0x33f165,_0x49e74b[_0x20ec('0x11')][_0x20ec('0x12')]);return _0x150dae(_0x49e74b[_0x20ec('0x11')][_0x20ec('0x12')]);}else{logger[_0x20ec('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x33f165,_0x20ec('0xd'));_0x150dae(_0x49e74b[_0x20ec('0x13')][_0x20ec('0x12')]);}})[_0x20ec('0x14')](function(_0x4865a2){logger[_0x20ec('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x33f165,_0x4865a2);_0x24a298(_0x4865a2);});});}exports[_0x20ec('0x15')]=function(_0x4551b2){var _0x491052=this;return new Promise(function(_0x2c9b63,_0x3a444d){return db[_0x20ec('0x16')][_0x20ec('0x17')]({'raw':_0x4551b2[_0x20ec('0x18')]?_0x4551b2[_0x20ec('0x18')][_0x20ec('0x19')]===undefined?!![]:![]:!![],'where':_0x4551b2['options']?_0x4551b2[_0x20ec('0x18')][_0x20ec('0x1a')]||null:null,'attributes':_0x4551b2[_0x20ec('0x18')]?_0x4551b2['options'][_0x20ec('0x1b')]||null:null,'include':_0x4551b2[_0x20ec('0x18')]?_0x4551b2['options'][_0x20ec('0x1c')]?_[_0x20ec('0x1d')](_0x4551b2[_0x20ec('0x18')]['include'],function(_0x393304){return{'model':db[_0x393304[_0x20ec('0x1e')]],'as':_0x393304['as'],'attributes':_0x393304[_0x20ec('0x1b')],'include':_0x393304['include']?_['map'](_0x393304[_0x20ec('0x1c')],function(_0x1c6b84){return{'model':db[_0x1c6b84[_0x20ec('0x1e')]],'as':_0x1c6b84['as'],'attributes':_0x1c6b84[_0x20ec('0x1b')],'include':_0x1c6b84[_0x20ec('0x1c')]?_['map'](_0x1c6b84[_0x20ec('0x1c')],function(_0x588dc6){return{'model':db[_0x588dc6[_0x20ec('0x1e')]],'as':_0x588dc6['as'],'attributes':_0x588dc6[_0x20ec('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x20ec('0xa')](function(_0x1d1010){logger[_0x20ec('0xb')](_0x20ec('0x15'),_0x4551b2);logger[_0x20ec('0xe')](_0x20ec('0x15'),_0x4551b2,JSON[_0x20ec('0x10')](_0x1d1010));_0x2c9b63(_0x1d1010);})['catch'](function(_0x5dccb4){logger[_0x20ec('0x11')](_0x20ec('0x15'),_0x5dccb4[_0x20ec('0x12')],_0x4551b2);_0x3a444d(_0x491052[_0x20ec('0x11')](0x1f4,_0x5dccb4[_0x20ec('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index ad85235..498485a 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 _0x8286=['/:id','show','/:id/users','getUsers','post','create','update','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index'];(function(_0x279dc6,_0x347d85){var _0xf4c84=function(_0x5f1dd1){while(--_0x5f1dd1){_0x279dc6['push'](_0x279dc6['shift']());}};_0xf4c84(++_0x347d85);}(_0x8286,0x66));var _0x6828=function(_0x55b920,_0x247078){_0x55b920=_0x55b920-0x0;var _0x5d9fd0=_0x8286[_0x55b920];return _0x5d9fd0;};'use strict';var multer=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var path=require(_0x6828('0x2'));var timeout=require(_0x6828('0x3'));var express=require(_0x6828('0x4'));var router=express[_0x6828('0x5')]();var fs_extra=require(_0x6828('0x6'));var auth=require(_0x6828('0x7'));var interaction=require(_0x6828('0x8'));var config=require(_0x6828('0x9'));var controller=require(_0x6828('0xa'));router['get']('/',auth[_0x6828('0xb')](),controller[_0x6828('0xc')]);router['get'](_0x6828('0xd'),auth[_0x6828('0xb')](),controller[_0x6828('0xe')]);router['get'](_0x6828('0xf'),auth[_0x6828('0xb')](),controller[_0x6828('0x10')]);router[_0x6828('0x11')]('/',auth[_0x6828('0xb')](),controller[_0x6828('0x12')]);router[_0x6828('0x11')](_0x6828('0xf'),auth[_0x6828('0xb')](),controller['addUsers']);router['put'](_0x6828('0xd'),auth['isAuthenticated'](),controller[_0x6828('0x13')]);router['delete'](_0x6828('0xd'),auth[_0x6828('0xb')](),controller[_0x6828('0x14')]);router[_0x6828('0x15')](_0x6828('0xf'),auth[_0x6828('0xb')](),controller['removeUsers']);module[_0x6828('0x16')]=router; \ No newline at end of file +var _0x8ce3=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','/:id','isAuthenticated','show','/:id/users','getUsers','post','addUsers','put','delete','removeUsers','exports'];(function(_0x1e4078,_0x155a20){var _0x1129fa=function(_0x344446){while(--_0x344446){_0x1e4078['push'](_0x1e4078['shift']());}};_0x1129fa(++_0x155a20);}(_0x8ce3,0x1b9));var _0x38ce=function(_0x7e918f,_0x48cf10){_0x7e918f=_0x7e918f-0x0;var _0x5b35ab=_0x8ce3[_0x7e918f];return _0x5b35ab;};'use strict';var multer=require('multer');var util=require(_0x38ce('0x0'));var path=require(_0x38ce('0x1'));var timeout=require(_0x38ce('0x2'));var express=require(_0x38ce('0x3'));var router=express[_0x38ce('0x4')]();var fs_extra=require(_0x38ce('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x38ce('0x6'));var config=require(_0x38ce('0x7'));var controller=require(_0x38ce('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x38ce('0x9')](_0x38ce('0xa'),auth[_0x38ce('0xb')](),controller[_0x38ce('0xc')]);router['get'](_0x38ce('0xd'),auth[_0x38ce('0xb')](),controller[_0x38ce('0xe')]);router[_0x38ce('0xf')]('/',auth[_0x38ce('0xb')](),controller['create']);router[_0x38ce('0xf')](_0x38ce('0xd'),auth[_0x38ce('0xb')](),controller[_0x38ce('0x10')]);router[_0x38ce('0x11')]('/:id',auth[_0x38ce('0xb')](),controller['update']);router[_0x38ce('0x12')](_0x38ce('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x38ce('0x12')](_0x38ce('0xd'),auth[_0x38ce('0xb')](),controller[_0x38ce('0x13')]);module[_0x38ce('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 426761a..104845b 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 _0xd993=['preproduction','toString','utf8','production','getDataValue','DATE','exports','STRING','name','TEXT','BLOB','long'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xd993,0x19e));var _0x3d99=function(_0x2ae469,_0xbb37f){_0x2ae469=_0x2ae469-0x0;var _0x30b677=_0xd993[_0x2ae469];return _0x30b677;};'use strict';var Sequelize=require('sequelize');module[_0x3d99('0x0')]={'name':{'type':Sequelize[_0x3d99('0x1')],'unique':_0x3d99('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3d99('0x1')]},'notes':{'type':Sequelize[_0x3d99('0x3')]},'preproduction':{'type':Sequelize[_0x3d99('0x4')](_0x3d99('0x5')),'get':function(){if(this['getDataValue'](_0x3d99('0x6'))){return this['getDataValue'](_0x3d99('0x6'))[_0x3d99('0x7')](_0x3d99('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x3d99('0x5')),'get':function(){if(this['getDataValue'](_0x3d99('0x9'))){return this[_0x3d99('0xa')]('production')[_0x3d99('0x7')](_0x3d99('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x3d99('0xb')]}}; \ No newline at end of file +var _0x79a3=['sequelize','exports','STRING','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x3a5916,_0xa2cb1e){var _0x3ce568=function(_0x4e5401){while(--_0x4e5401){_0x3a5916['push'](_0x3a5916['shift']());}};_0x3ce568(++_0xa2cb1e);}(_0x79a3,0x113));var _0x379a=function(_0x3db327,_0x357573){_0x3db327=_0x3db327-0x0;var _0x4b82ef=_0x79a3[_0x3db327];return _0x4b82ef;};'use strict';var Sequelize=require(_0x379a('0x0'));module[_0x379a('0x1')]={'name':{'type':Sequelize[_0x379a('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x379a('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x379a('0x3')](_0x379a('0x4')),'get':function(){if(this[_0x379a('0x5')](_0x379a('0x6'))){return this['getDataValue'](_0x379a('0x6'))[_0x379a('0x7')](_0x379a('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x379a('0x4')),'get':function(){if(this['getDataValue'](_0x379a('0x9'))){return this[_0x379a('0x5')]('production')[_0x379a('0x7')](_0x379a('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x379a('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 86135bc..25f5308 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 _0xb8f8=['include','findAll','rows','catch','show','params','length','create','user','role','SquareProjects','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','User','filter','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','defaults','redis','localhost','./squareProject.socket','sendStatus','status','json','undefined','limit','offset','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','nolimit','order','sort','where','filters','pick','merge','options','count','includeAll'];(function(_0x4e1f15,_0x360024){var _0x5aac3f=function(_0x27306c){while(--_0x27306c){_0x4e1f15['push'](_0x4e1f15['shift']());}};_0x5aac3f(++_0x360024);}(_0xb8f8,0x19c));var _0x8b8f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb8f8[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x8b8f('0x0'));var rimraf=require(_0x8b8f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b8f('0x2'));var rp=require(_0x8b8f('0x3'));var moment=require(_0x8b8f('0x4'));var BPromise=require(_0x8b8f('0x5'));var Mustache=require(_0x8b8f('0x6'));var util=require(_0x8b8f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8b8f('0x8'));var ejs=require(_0x8b8f('0x9'));var fs=require('fs');var fs_extra=require(_0x8b8f('0xa'));var _=require(_0x8b8f('0xb'));var squel=require(_0x8b8f('0xc'));var crypto=require('crypto');var jsforce=require(_0x8b8f('0xd'));var deskjs=require(_0x8b8f('0xe'));var toCsv=require(_0x8b8f('0x8'));var querystring=require('querystring');var Papa=require(_0x8b8f('0xf'));var Redis=require(_0x8b8f('0x10'));var authService=require(_0x8b8f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b8f('0x12'));var hardwareService=require(_0x8b8f('0x13'));var logger=require('../../config/logger')(_0x8b8f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b8f('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8b8f('0x16')](config[_0x8b8f('0x17')],{'host':_0x8b8f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b8f('0x17')]));require(_0x8b8f('0x19'))['register'](socket);function respondWithStatusCode(_0x304d6d,_0x4aa71b){_0x4aa71b=_0x4aa71b||0xcc;return function(_0x32dbf5){if(_0x32dbf5){return _0x304d6d[_0x8b8f('0x1a')](_0x4aa71b);}return _0x304d6d[_0x8b8f('0x1b')](_0x4aa71b)['end']();};}function respondWithResult(_0x4f8994,_0x5d06fd){_0x5d06fd=_0x5d06fd||0xc8;return function(_0x4e4f94){if(_0x4e4f94){return _0x4f8994[_0x8b8f('0x1b')](_0x5d06fd)[_0x8b8f('0x1c')](_0x4e4f94);}};}function respondWithFilteredResult(_0x3f14a3,_0x22ceaf){return function(_0x45405b){if(_0x45405b){var _0x30e082=typeof _0x22ceaf['offset']===_0x8b8f('0x1d')&&typeof _0x22ceaf[_0x8b8f('0x1e')]===_0x8b8f('0x1d');var _0x3d00b3=_0x45405b['count'];var _0x265f5c=_0x30e082?0x0:_0x22ceaf[_0x8b8f('0x1f')];var _0x409c43=_0x30e082?_0x45405b['count']:_0x22ceaf[_0x8b8f('0x1f')]+_0x22ceaf[_0x8b8f('0x1e')];var _0x46587c;if(_0x409c43>=_0x3d00b3){_0x409c43=_0x3d00b3;_0x46587c=0xc8;}else{_0x46587c=0xce;}_0x3f14a3[_0x8b8f('0x1b')](_0x46587c);return _0x3f14a3[_0x8b8f('0x20')](_0x8b8f('0x21'),_0x265f5c+'-'+_0x409c43+'/'+_0x3d00b3)[_0x8b8f('0x1c')](_0x45405b);}return null;};}function patchUpdates(_0xb6dea8){return function(_0x690e50){try{jsonpatch['apply'](_0x690e50,_0xb6dea8,!![]);}catch(_0x244ddb){return BPromise[_0x8b8f('0x22')](_0x244ddb);}return _0x690e50[_0x8b8f('0x23')]();};}function saveUpdates(_0x150404,_0x92ce78){return function(_0x205703){if(_0x205703){return _0x205703[_0x8b8f('0x24')](_0x150404)[_0x8b8f('0x25')](function(_0x47626b){return _0x47626b;});}return null;};}function removeEntity(_0x444a21,_0x47ced7){return function(_0x512a33){if(_0x512a33){return _0x512a33[_0x8b8f('0x26')]()['then'](function(){var _0x209321=_0x512a33[_0x8b8f('0x27')]({'plain':!![]});var _0x275b34='SquareProjects';return db[_0x8b8f('0x28')][_0x8b8f('0x26')]({'where':{'type':_0x275b34,'resourceId':_0x209321['id']}})[_0x8b8f('0x25')](function(){return _0x512a33;});})[_0x8b8f('0x25')](function(){_0x444a21['status'](0xcc)[_0x8b8f('0x29')]();});}};}function handleEntityNotFound(_0x4f44b3,_0x1b14e5){return function(_0x1e4bd0){if(!_0x1e4bd0){_0x4f44b3[_0x8b8f('0x1a')](0x194);}return _0x1e4bd0;};}function handleError(_0x22ecee,_0x6c5a3c){_0x6c5a3c=_0x6c5a3c||0x1f4;return function(_0x574ec4){logger['error'](_0x574ec4[_0x8b8f('0x2a')]);if(_0x574ec4[_0x8b8f('0x2b')]){delete _0x574ec4[_0x8b8f('0x2b')];}_0x22ecee[_0x8b8f('0x1b')](_0x6c5a3c)[_0x8b8f('0x2c')](_0x574ec4);};}exports[_0x8b8f('0x2d')]=function(_0x5b972e,_0x34d37c){var _0x4955f4={},_0x25d446={},_0x273e59={'count':0x0,'rows':[]};var _0x151eb6=_[_0x8b8f('0x2e')](db[_0x8b8f('0x2f')][_0x8b8f('0x30')],function(_0x3c03ea){return{'name':_0x3c03ea[_0x8b8f('0x31')],'type':_0x3c03ea[_0x8b8f('0x32')][_0x8b8f('0x33')]};});_0x25d446[_0x8b8f('0x34')]=_['map'](_0x151eb6,'name');_0x25d446['query']=_[_0x8b8f('0x35')](_0x5b972e['query']);_0x25d446['filters']=_[_0x8b8f('0x36')](_0x25d446['model'],_0x25d446[_0x8b8f('0x37')]);_0x4955f4[_0x8b8f('0x38')]=_[_0x8b8f('0x36')](_0x25d446[_0x8b8f('0x34')],qs['fields'](_0x5b972e[_0x8b8f('0x37')][_0x8b8f('0x39')]));_0x4955f4[_0x8b8f('0x38')]=_0x4955f4['attributes']['length']?_0x4955f4[_0x8b8f('0x38')]:_0x25d446[_0x8b8f('0x34')];if(!_0x5b972e[_0x8b8f('0x37')]['hasOwnProperty'](_0x8b8f('0x3a'))){_0x4955f4[_0x8b8f('0x1e')]=qs[_0x8b8f('0x1e')](_0x5b972e[_0x8b8f('0x37')][_0x8b8f('0x1e')]);_0x4955f4[_0x8b8f('0x1f')]=qs['offset'](_0x5b972e[_0x8b8f('0x37')][_0x8b8f('0x1f')]);}_0x4955f4[_0x8b8f('0x3b')]=qs['sort'](_0x5b972e[_0x8b8f('0x37')][_0x8b8f('0x3c')]);_0x4955f4[_0x8b8f('0x3d')]=qs[_0x8b8f('0x3e')](_[_0x8b8f('0x3f')](_0x5b972e[_0x8b8f('0x37')],_0x25d446[_0x8b8f('0x3e')]),_0x151eb6);if(_0x5b972e[_0x8b8f('0x37')]['filter']){_0x4955f4[_0x8b8f('0x3d')]=_['merge'](_0x4955f4[_0x8b8f('0x3d')],{'$or':_[_0x8b8f('0x2e')](_0x151eb6,function(_0x4cb091){if(_0x4cb091[_0x8b8f('0x32')]!=='VIRTUAL'){var _0x36a0d8={};_0x36a0d8[_0x4cb091[_0x8b8f('0x2b')]]={'$like':'%'+_0x5b972e[_0x8b8f('0x37')]['filter']+'%'};return _0x36a0d8;}})});}_0x4955f4=_[_0x8b8f('0x40')]({},_0x4955f4,_0x5b972e[_0x8b8f('0x41')]);var _0x400d7={'where':_0x4955f4[_0x8b8f('0x3d')]};return db[_0x8b8f('0x2f')][_0x8b8f('0x42')](_0x400d7)[_0x8b8f('0x25')](function(_0x3c515d){_0x273e59[_0x8b8f('0x42')]=_0x3c515d;if(_0x5b972e[_0x8b8f('0x37')][_0x8b8f('0x43')]){_0x4955f4[_0x8b8f('0x44')]=[{'all':!![]}];}return db[_0x8b8f('0x2f')][_0x8b8f('0x45')](_0x4955f4);})[_0x8b8f('0x25')](function(_0x23a652){_0x273e59[_0x8b8f('0x46')]=_0x23a652;return _0x273e59;})[_0x8b8f('0x25')](respondWithFilteredResult(_0x34d37c,_0x4955f4))[_0x8b8f('0x47')](handleError(_0x34d37c,null));};exports[_0x8b8f('0x48')]=function(_0x35b393,_0x2f497f){var _0x5f4a8c={'raw':![],'where':{'id':_0x35b393[_0x8b8f('0x49')]['id']}},_0x2208b5={};_0x2208b5[_0x8b8f('0x34')]=_[_0x8b8f('0x35')](db[_0x8b8f('0x2f')][_0x8b8f('0x30')]);_0x2208b5['query']=_['keys'](_0x35b393['query']);_0x2208b5['filters']=_[_0x8b8f('0x36')](_0x2208b5['model'],_0x2208b5[_0x8b8f('0x37')]);_0x5f4a8c[_0x8b8f('0x38')]=_[_0x8b8f('0x36')](_0x2208b5[_0x8b8f('0x34')],qs[_0x8b8f('0x39')](_0x35b393[_0x8b8f('0x37')][_0x8b8f('0x39')]));_0x5f4a8c['attributes']=_0x5f4a8c[_0x8b8f('0x38')][_0x8b8f('0x4a')]?_0x5f4a8c['attributes']:_0x2208b5[_0x8b8f('0x34')];if(_0x35b393[_0x8b8f('0x37')]['includeAll']){_0x5f4a8c[_0x8b8f('0x44')]=[{'all':!![]}];}_0x5f4a8c=_[_0x8b8f('0x40')]({},_0x5f4a8c,_0x35b393['options']);return db[_0x8b8f('0x2f')]['find'](_0x5f4a8c)[_0x8b8f('0x25')](handleEntityNotFound(_0x2f497f,null))['then'](respondWithResult(_0x2f497f,null))[_0x8b8f('0x47')](handleError(_0x2f497f,null));};exports[_0x8b8f('0x4b')]=function(_0x1a5f34,_0x4fe5b0){return db[_0x8b8f('0x2f')]['create'](_0x1a5f34['body'],{})[_0x8b8f('0x25')](function(_0x3ffe8b){var _0xd51eb0=_0x1a5f34[_0x8b8f('0x4c')]['get']({'plain':!![]});if(!_0xd51eb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd51eb0[_0x8b8f('0x4d')]===_0x8b8f('0x4c')){var _0x49b719=_0x3ffe8b[_0x8b8f('0x27')]({'plain':!![]});var _0x282bf7=_0x8b8f('0x4e');return db[_0x8b8f('0x4f')][_0x8b8f('0x50')]({'where':{'name':_0x282bf7,'userProfileId':_0xd51eb0[_0x8b8f('0x51')]},'raw':!![]})[_0x8b8f('0x25')](function(_0x3f5ada){if(_0x3f5ada&&_0x3f5ada[_0x8b8f('0x52')]===0x0){return db[_0x8b8f('0x28')][_0x8b8f('0x4b')]({'name':_0x49b719['name'],'resourceId':_0x49b719['id'],'type':_0x3f5ada[_0x8b8f('0x2b')],'sectionId':_0x3f5ada['id']},{})['then'](function(){return _0x3ffe8b;});}else{return _0x3ffe8b;}})[_0x8b8f('0x47')](function(_0x20886e){logger[_0x8b8f('0x53')](_0x8b8f('0x54'),_0x20886e);throw _0x20886e;});}return _0x3ffe8b;})[_0x8b8f('0x25')](respondWithResult(_0x4fe5b0,0xc9))[_0x8b8f('0x47')](handleError(_0x4fe5b0,null));};exports[_0x8b8f('0x24')]=function(_0x4f919b,_0x179b97){if(_0x4f919b[_0x8b8f('0x55')]['id']){delete _0x4f919b[_0x8b8f('0x55')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x4f919b[_0x8b8f('0x49')]['id']}})['then'](handleEntityNotFound(_0x179b97,null))[_0x8b8f('0x25')](saveUpdates(_0x4f919b[_0x8b8f('0x55')],null))[_0x8b8f('0x25')](respondWithResult(_0x179b97,null))['catch'](handleError(_0x179b97,null));};exports[_0x8b8f('0x26')]=function(_0x166a34,_0x27d319){return db['SquareProject']['find']({'where':{'id':_0x166a34[_0x8b8f('0x49')]['id']}})['then'](handleEntityNotFound(_0x27d319,null))['then'](removeEntity(_0x27d319,null))[_0x8b8f('0x47')](handleError(_0x27d319,null));};exports[_0x8b8f('0x56')]=function(_0x5d934e,_0x609ee9,_0xb6ffb6){return db[_0x8b8f('0x2f')][_0x8b8f('0x50')]({'where':{'id':_0x5d934e['params']['id']}})[_0x8b8f('0x25')](handleEntityNotFound(_0x609ee9,null))[_0x8b8f('0x25')](function(_0x5102fb){if(_0x5102fb){return _0x5102fb[_0x8b8f('0x56')](_0x5d934e[_0x8b8f('0x55')][_0x8b8f('0x57')],_['omit'](_0x5d934e['body'],[_0x8b8f('0x57'),'id'])||{});}})[_0x8b8f('0x25')](respondWithResult(_0x609ee9,null))[_0x8b8f('0x47')](handleError(_0x609ee9,null));};exports[_0x8b8f('0x58')]=function(_0x38392b,_0x2862a0,_0x284d74){return db['SquareProject'][_0x8b8f('0x50')]({'where':{'id':_0x38392b[_0x8b8f('0x49')]['id']}})[_0x8b8f('0x25')](handleEntityNotFound(_0x2862a0,null))[_0x8b8f('0x25')](function(_0x5b356c){if(_0x5b356c){return _0x5b356c[_0x8b8f('0x58')](_0x38392b['query']['ids'])[_0x8b8f('0x25')](function(){if(_[_0x8b8f('0x59')](_0x38392b[_0x8b8f('0x37')]['ids'])){for(var _0x1302ad=0x0;_0x1302ad<_0x38392b[_0x8b8f('0x37')][_0x8b8f('0x57')][_0x8b8f('0x4a')];_0x1302ad+=0x1){socket['emit'](_0x8b8f('0x5a'),{'UserId':Number(_0x38392b[_0x8b8f('0x37')]['ids'][_0x1302ad]),'SquareProjectId':Number(_0x38392b[_0x8b8f('0x49')]['id'])});}}else{socket[_0x8b8f('0x5b')]('userSquareProject:remove',{'UserId':Number(_0x38392b[_0x8b8f('0x37')]['ids']),'SquareProjectId':Number(_0x38392b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2862a0,null))[_0x8b8f('0x47')](handleError(_0x2862a0,null));};exports[_0x8b8f('0x5c')]=function(_0x26364c,_0x17b5be,_0x1dc261){var _0x113326={};var _0x6fa567={};var _0x1680d7;var _0x3aacb6;return db['SquareProject'][_0x8b8f('0x5d')]({'where':{'id':_0x26364c['params']['id']}})[_0x8b8f('0x25')](handleEntityNotFound(_0x17b5be,null))[_0x8b8f('0x25')](function(_0x5aee18){if(_0x5aee18){_0x1680d7=_0x5aee18;_0x6fa567[_0x8b8f('0x34')]=_[_0x8b8f('0x35')](db[_0x8b8f('0x5e')][_0x8b8f('0x30')]);_0x6fa567[_0x8b8f('0x37')]=_[_0x8b8f('0x35')](_0x26364c[_0x8b8f('0x37')]);_0x6fa567[_0x8b8f('0x3e')]=_[_0x8b8f('0x36')](_0x6fa567[_0x8b8f('0x34')],_0x6fa567[_0x8b8f('0x37')]);_0x113326['attributes']=_[_0x8b8f('0x36')](_0x6fa567['model'],qs[_0x8b8f('0x39')](_0x26364c['query'][_0x8b8f('0x39')]));_0x113326[_0x8b8f('0x38')]=_0x113326[_0x8b8f('0x38')][_0x8b8f('0x4a')]?_0x113326[_0x8b8f('0x38')]:_0x6fa567[_0x8b8f('0x34')];_0x113326[_0x8b8f('0x3b')]=qs['sort'](_0x26364c['query']['sort']);_0x113326[_0x8b8f('0x3d')]=qs[_0x8b8f('0x3e')](_['pick'](_0x26364c[_0x8b8f('0x37')],_0x6fa567[_0x8b8f('0x3e')]));if(_0x26364c[_0x8b8f('0x37')][_0x8b8f('0x5f')]){_0x113326[_0x8b8f('0x3d')]=_[_0x8b8f('0x40')](_0x113326['where'],{'$or':_['map'](_0x113326[_0x8b8f('0x38')],function(_0x492d89){var _0x181b85={};_0x181b85[_0x492d89]={'$like':'%'+_0x26364c[_0x8b8f('0x37')][_0x8b8f('0x5f')]+'%'};return _0x181b85;})});}_0x113326=_[_0x8b8f('0x40')]({},_0x113326,_0x26364c[_0x8b8f('0x41')]);return _0x1680d7[_0x8b8f('0x5c')](_0x113326);}})[_0x8b8f('0x25')](function(_0x3d3574){if(_0x3d3574){_0x3aacb6=_0x3d3574['length'];if(!_0x26364c[_0x8b8f('0x37')]['hasOwnProperty']('nolimit')){_0x113326[_0x8b8f('0x1e')]=qs['limit'](_0x26364c[_0x8b8f('0x37')][_0x8b8f('0x1e')]);_0x113326[_0x8b8f('0x1f')]=qs[_0x8b8f('0x1f')](_0x26364c[_0x8b8f('0x37')][_0x8b8f('0x1f')]);}return _0x1680d7[_0x8b8f('0x5c')](_0x113326);}})[_0x8b8f('0x25')](function(_0x77ed93){if(_0x77ed93){return _0x77ed93?{'count':_0x3aacb6,'rows':_0x77ed93}:null;}})[_0x8b8f('0x25')](respondWithResult(_0x17b5be,null))[_0x8b8f('0x47')](handleError(_0x17b5be,null));}; \ No newline at end of file +var _0x7d23=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./squareProject.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','SquareProjects','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','where','merge','VIRTUAL','include','SquareProject','findAll','catch','params','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','User','pick','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x29469a,_0x3020d9){var _0x4a7911=function(_0x1d01e4){while(--_0x1d01e4){_0x29469a['push'](_0x29469a['shift']());}};_0x4a7911(++_0x3020d9);}(_0x7d23,0x172));var _0x37d2=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x7d23[_0x5a95fa];return _0x1a61b8;};'use strict';var emlformat=require(_0x37d2('0x0'));var rimraf=require(_0x37d2('0x1'));var zipdir=require(_0x37d2('0x2'));var jsonpatch=require(_0x37d2('0x3'));var rp=require(_0x37d2('0x4'));var moment=require(_0x37d2('0x5'));var BPromise=require(_0x37d2('0x6'));var Mustache=require(_0x37d2('0x7'));var util=require(_0x37d2('0x8'));var path=require('path');var sox=require(_0x37d2('0x9'));var csv=require(_0x37d2('0xa'));var ejs=require(_0x37d2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x37d2('0xc'));var deskjs=require(_0x37d2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x37d2('0xe'));var Papa=require(_0x37d2('0xf'));var Redis=require(_0x37d2('0x10'));var authService=require(_0x37d2('0x11'));var qs=require(_0x37d2('0x12'));var as=require(_0x37d2('0x13'));var hardwareService=require(_0x37d2('0x14'));var logger=require(_0x37d2('0x15'))(_0x37d2('0x16'));var utils=require(_0x37d2('0x17'));var config=require(_0x37d2('0x18'));var licenseUtil=require(_0x37d2('0x19'));var db=require(_0x37d2('0x1a'))['db'];config[_0x37d2('0x1b')]=_[_0x37d2('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37d2('0x1b')]));require(_0x37d2('0x1d'))[_0x37d2('0x1e')](socket);function respondWithStatusCode(_0xc91944,_0x313e52){_0x313e52=_0x313e52||0xcc;return function(_0x571fa0){if(_0x571fa0){return _0xc91944['sendStatus'](_0x313e52);}return _0xc91944[_0x37d2('0x1f')](_0x313e52)[_0x37d2('0x20')]();};}function respondWithResult(_0x3787a6,_0xf996a4){_0xf996a4=_0xf996a4||0xc8;return function(_0x41870d){if(_0x41870d){return _0x3787a6[_0x37d2('0x1f')](_0xf996a4)[_0x37d2('0x21')](_0x41870d);}};}function respondWithFilteredResult(_0x343cf8,_0x3400ac){return function(_0x198a6e){if(_0x198a6e){var _0x2a04b7=typeof _0x3400ac[_0x37d2('0x22')]===_0x37d2('0x23')&&typeof _0x3400ac[_0x37d2('0x24')]===_0x37d2('0x23');var _0x529930=_0x198a6e[_0x37d2('0x25')];var _0x272bc8=_0x2a04b7?0x0:_0x3400ac['offset'];var _0x5169eb=_0x2a04b7?_0x198a6e[_0x37d2('0x25')]:_0x3400ac['offset']+_0x3400ac[_0x37d2('0x24')];var _0x55614c;if(_0x5169eb>=_0x529930){_0x5169eb=_0x529930;_0x55614c=0xc8;}else{_0x55614c=0xce;}_0x343cf8[_0x37d2('0x1f')](_0x55614c);return _0x343cf8[_0x37d2('0x26')]('Content-Range',_0x272bc8+'-'+_0x5169eb+'/'+_0x529930)[_0x37d2('0x21')](_0x198a6e);}return null;};}function patchUpdates(_0x5a19a2){return function(_0x106c6d){try{jsonpatch[_0x37d2('0x27')](_0x106c6d,_0x5a19a2,!![]);}catch(_0x1d24a0){return BPromise[_0x37d2('0x28')](_0x1d24a0);}return _0x106c6d[_0x37d2('0x29')]();};}function saveUpdates(_0x300f08,_0xbcea0a){return function(_0xefbde2){if(_0xefbde2){return _0xefbde2[_0x37d2('0x2a')](_0x300f08)[_0x37d2('0x2b')](function(_0x3cf260){return _0x3cf260;});}return null;};}function removeEntity(_0x137b1a,_0x1393b0){return function(_0x4a2091){if(_0x4a2091){return _0x4a2091[_0x37d2('0x2c')]()[_0x37d2('0x2b')](function(){var _0x1a3e1a=_0x4a2091['get']({'plain':!![]});var _0x2d9e65=_0x37d2('0x2d');return db[_0x37d2('0x2e')][_0x37d2('0x2c')]({'where':{'type':_0x2d9e65,'resourceId':_0x1a3e1a['id']}})[_0x37d2('0x2b')](function(){return _0x4a2091;});})['then'](function(){_0x137b1a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a898,_0x49a13c){return function(_0x55661e){if(!_0x55661e){_0x41a898['sendStatus'](0x194);}return _0x55661e;};}function handleError(_0x69383d,_0x1be418){_0x1be418=_0x1be418||0x1f4;return function(_0x29c432){logger[_0x37d2('0x2f')](_0x29c432[_0x37d2('0x30')]);if(_0x29c432[_0x37d2('0x31')]){delete _0x29c432[_0x37d2('0x31')];}_0x69383d['status'](_0x1be418)[_0x37d2('0x32')](_0x29c432);};}exports[_0x37d2('0x33')]=function(_0x3aa11d,_0x378af5){var _0x21882d={},_0x45af78={},_0x1a1590={'count':0x0,'rows':[]};var _0x3ce539=_[_0x37d2('0x34')](db['SquareProject'][_0x37d2('0x35')],function(_0x5c091f){return{'name':_0x5c091f[_0x37d2('0x36')],'type':_0x5c091f[_0x37d2('0x37')][_0x37d2('0x38')]};});_0x45af78[_0x37d2('0x39')]=_['map'](_0x3ce539,_0x37d2('0x31'));_0x45af78[_0x37d2('0x3a')]=_[_0x37d2('0x3b')](_0x3aa11d[_0x37d2('0x3a')]);_0x45af78['filters']=_['intersection'](_0x45af78[_0x37d2('0x39')],_0x45af78[_0x37d2('0x3a')]);_0x21882d['attributes']=_[_0x37d2('0x3c')](_0x45af78[_0x37d2('0x39')],qs[_0x37d2('0x3d')](_0x3aa11d[_0x37d2('0x3a')][_0x37d2('0x3d')]));_0x21882d[_0x37d2('0x3e')]=_0x21882d['attributes'][_0x37d2('0x3f')]?_0x21882d[_0x37d2('0x3e')]:_0x45af78[_0x37d2('0x39')];if(!_0x3aa11d[_0x37d2('0x3a')]['hasOwnProperty'](_0x37d2('0x40'))){_0x21882d[_0x37d2('0x24')]=qs[_0x37d2('0x24')](_0x3aa11d[_0x37d2('0x3a')][_0x37d2('0x24')]);_0x21882d[_0x37d2('0x22')]=qs[_0x37d2('0x22')](_0x3aa11d[_0x37d2('0x3a')]['offset']);}_0x21882d[_0x37d2('0x41')]=qs['sort'](_0x3aa11d[_0x37d2('0x3a')][_0x37d2('0x42')]);_0x21882d['where']=qs['filters'](_['pick'](_0x3aa11d[_0x37d2('0x3a')],_0x45af78[_0x37d2('0x43')]),_0x3ce539);if(_0x3aa11d['query']['filter']){_0x21882d[_0x37d2('0x44')]=_[_0x37d2('0x45')](_0x21882d[_0x37d2('0x44')],{'$or':_[_0x37d2('0x34')](_0x3ce539,function(_0x94009f){if(_0x94009f[_0x37d2('0x37')]!==_0x37d2('0x46')){var _0x58ccac={};_0x58ccac[_0x94009f[_0x37d2('0x31')]]={'$like':'%'+_0x3aa11d[_0x37d2('0x3a')]['filter']+'%'};return _0x58ccac;}})});}_0x21882d=_[_0x37d2('0x45')]({},_0x21882d,_0x3aa11d['options']);var _0x515718={'where':_0x21882d[_0x37d2('0x44')]};return db['SquareProject']['count'](_0x515718)['then'](function(_0x15935c){_0x1a1590[_0x37d2('0x25')]=_0x15935c;if(_0x3aa11d[_0x37d2('0x3a')]['includeAll']){_0x21882d[_0x37d2('0x47')]=[{'all':!![]}];}return db[_0x37d2('0x48')][_0x37d2('0x49')](_0x21882d);})['then'](function(_0x3c0732){_0x1a1590['rows']=_0x3c0732;return _0x1a1590;})[_0x37d2('0x2b')](respondWithFilteredResult(_0x378af5,_0x21882d))[_0x37d2('0x4a')](handleError(_0x378af5,null));};exports['show']=function(_0x1ddc41,_0x252d58){var _0x155c7b={'raw':![],'where':{'id':_0x1ddc41[_0x37d2('0x4b')]['id']}},_0x14e868={};_0x14e868[_0x37d2('0x39')]=_['keys'](db[_0x37d2('0x48')]['rawAttributes']);_0x14e868[_0x37d2('0x3a')]=_['keys'](_0x1ddc41[_0x37d2('0x3a')]);_0x14e868[_0x37d2('0x43')]=_[_0x37d2('0x3c')](_0x14e868[_0x37d2('0x39')],_0x14e868[_0x37d2('0x3a')]);_0x155c7b[_0x37d2('0x3e')]=_[_0x37d2('0x3c')](_0x14e868[_0x37d2('0x39')],qs[_0x37d2('0x3d')](_0x1ddc41['query'][_0x37d2('0x3d')]));_0x155c7b[_0x37d2('0x3e')]=_0x155c7b[_0x37d2('0x3e')][_0x37d2('0x3f')]?_0x155c7b[_0x37d2('0x3e')]:_0x14e868[_0x37d2('0x39')];if(_0x1ddc41[_0x37d2('0x3a')][_0x37d2('0x4c')]){_0x155c7b[_0x37d2('0x47')]=[{'all':!![]}];}_0x155c7b=_['merge']({},_0x155c7b,_0x1ddc41[_0x37d2('0x4d')]);return db['SquareProject'][_0x37d2('0x4e')](_0x155c7b)['then'](handleEntityNotFound(_0x252d58,null))[_0x37d2('0x2b')](respondWithResult(_0x252d58,null))[_0x37d2('0x4a')](handleError(_0x252d58,null));};exports[_0x37d2('0x4f')]=function(_0x29d88a,_0x181862){return db[_0x37d2('0x48')][_0x37d2('0x4f')](_0x29d88a[_0x37d2('0x50')],{})[_0x37d2('0x2b')](function(_0x3deb42){var _0x51c57b=_0x29d88a[_0x37d2('0x51')][_0x37d2('0x52')]({'plain':!![]});if(!_0x51c57b)throw new Error(_0x37d2('0x53'));if(_0x51c57b[_0x37d2('0x54')]===_0x37d2('0x51')){var _0x36b1d7=_0x3deb42[_0x37d2('0x52')]({'plain':!![]});var _0x87944b=_0x37d2('0x2d');return db[_0x37d2('0x55')][_0x37d2('0x4e')]({'where':{'name':_0x87944b,'userProfileId':_0x51c57b[_0x37d2('0x56')]},'raw':!![]})[_0x37d2('0x2b')](function(_0x48126a){if(_0x48126a&&_0x48126a[_0x37d2('0x57')]===0x0){return db['UserProfileResource'][_0x37d2('0x4f')]({'name':_0x36b1d7[_0x37d2('0x31')],'resourceId':_0x36b1d7['id'],'type':_0x48126a[_0x37d2('0x31')],'sectionId':_0x48126a['id']},{})[_0x37d2('0x2b')](function(){return _0x3deb42;});}else{return _0x3deb42;}})['catch'](function(_0x19547a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19547a);throw _0x19547a;});}return _0x3deb42;})[_0x37d2('0x2b')](respondWithResult(_0x181862,0xc9))[_0x37d2('0x4a')](handleError(_0x181862,null));};exports[_0x37d2('0x2a')]=function(_0x17abea,_0x4ed745){if(_0x17abea[_0x37d2('0x50')]['id']){delete _0x17abea[_0x37d2('0x50')]['id'];}return db['SquareProject'][_0x37d2('0x4e')]({'where':{'id':_0x17abea[_0x37d2('0x4b')]['id']}})[_0x37d2('0x2b')](handleEntityNotFound(_0x4ed745,null))[_0x37d2('0x2b')](saveUpdates(_0x17abea[_0x37d2('0x50')],null))['then'](respondWithResult(_0x4ed745,null))['catch'](handleError(_0x4ed745,null));};exports['destroy']=function(_0x2dc922,_0x520f62){return db[_0x37d2('0x48')]['find']({'where':{'id':_0x2dc922[_0x37d2('0x4b')]['id']}})[_0x37d2('0x2b')](handleEntityNotFound(_0x520f62,null))[_0x37d2('0x2b')](removeEntity(_0x520f62,null))[_0x37d2('0x4a')](handleError(_0x520f62,null));};exports[_0x37d2('0x58')]=function(_0x1c7b43,_0x282a49,_0xe89f3b){return db['SquareProject'][_0x37d2('0x4e')]({'where':{'id':_0x1c7b43[_0x37d2('0x4b')]['id']}})[_0x37d2('0x2b')](handleEntityNotFound(_0x282a49,null))['then'](function(_0x319d1f){if(_0x319d1f){return _0x319d1f['addUsers'](_0x1c7b43[_0x37d2('0x50')][_0x37d2('0x59')],_[_0x37d2('0x5a')](_0x1c7b43['body'],['ids','id'])||{});}})[_0x37d2('0x2b')](respondWithResult(_0x282a49,null))['catch'](handleError(_0x282a49,null));};exports[_0x37d2('0x5b')]=function(_0x190c1e,_0x1040f8,_0x367b82){return db['SquareProject'][_0x37d2('0x4e')]({'where':{'id':_0x190c1e[_0x37d2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1040f8,null))[_0x37d2('0x2b')](function(_0x493ecb){if(_0x493ecb){return _0x493ecb[_0x37d2('0x5b')](_0x190c1e['query'][_0x37d2('0x59')])['then'](function(){if(_['isArray'](_0x190c1e[_0x37d2('0x3a')][_0x37d2('0x59')])){for(var _0x44a653=0x0;_0x44a653<_0x190c1e[_0x37d2('0x3a')][_0x37d2('0x59')]['length'];_0x44a653+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x190c1e[_0x37d2('0x3a')][_0x37d2('0x59')][_0x44a653]),'SquareProjectId':Number(_0x190c1e[_0x37d2('0x4b')]['id'])});}}else{socket[_0x37d2('0x5c')](_0x37d2('0x5d'),{'UserId':Number(_0x190c1e['query'][_0x37d2('0x59')]),'SquareProjectId':Number(_0x190c1e[_0x37d2('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x1040f8,null))[_0x37d2('0x4a')](handleError(_0x1040f8,null));};exports[_0x37d2('0x5e')]=function(_0x5c632c,_0x303015,_0x19fe08){var _0x34a857={};var _0x329124={};var _0x54c274;var _0x40727c;return db['SquareProject']['findOne']({'where':{'id':_0x5c632c[_0x37d2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x303015,null))['then'](function(_0x2d88c1){if(_0x2d88c1){_0x54c274=_0x2d88c1;_0x329124[_0x37d2('0x39')]=_['keys'](db[_0x37d2('0x5f')][_0x37d2('0x35')]);_0x329124['query']=_['keys'](_0x5c632c[_0x37d2('0x3a')]);_0x329124['filters']=_[_0x37d2('0x3c')](_0x329124[_0x37d2('0x39')],_0x329124[_0x37d2('0x3a')]);_0x34a857[_0x37d2('0x3e')]=_['intersection'](_0x329124['model'],qs[_0x37d2('0x3d')](_0x5c632c[_0x37d2('0x3a')][_0x37d2('0x3d')]));_0x34a857[_0x37d2('0x3e')]=_0x34a857[_0x37d2('0x3e')]['length']?_0x34a857[_0x37d2('0x3e')]:_0x329124[_0x37d2('0x39')];_0x34a857['order']=qs[_0x37d2('0x42')](_0x5c632c[_0x37d2('0x3a')][_0x37d2('0x42')]);_0x34a857['where']=qs['filters'](_[_0x37d2('0x60')](_0x5c632c[_0x37d2('0x3a')],_0x329124[_0x37d2('0x43')]));if(_0x5c632c[_0x37d2('0x3a')][_0x37d2('0x61')]){_0x34a857[_0x37d2('0x44')]=_[_0x37d2('0x45')](_0x34a857['where'],{'$or':_[_0x37d2('0x34')](_0x34a857[_0x37d2('0x3e')],function(_0x5578f4){var _0x4df279={};_0x4df279[_0x5578f4]={'$like':'%'+_0x5c632c[_0x37d2('0x3a')][_0x37d2('0x61')]+'%'};return _0x4df279;})});}_0x34a857=_[_0x37d2('0x45')]({},_0x34a857,_0x5c632c[_0x37d2('0x4d')]);return _0x54c274['getUsers'](_0x34a857);}})[_0x37d2('0x2b')](function(_0x4d7851){if(_0x4d7851){_0x40727c=_0x4d7851['length'];if(!_0x5c632c[_0x37d2('0x3a')]['hasOwnProperty'](_0x37d2('0x40'))){_0x34a857[_0x37d2('0x24')]=qs[_0x37d2('0x24')](_0x5c632c[_0x37d2('0x3a')][_0x37d2('0x24')]);_0x34a857[_0x37d2('0x22')]=qs[_0x37d2('0x22')](_0x5c632c['query']['offset']);}return _0x54c274['getUsers'](_0x34a857);}})['then'](function(_0x4e5610){if(_0x4e5610){return _0x4e5610?{'count':_0x40727c,'rows':_0x4e5610}:null;}})[_0x37d2('0x2b')](respondWithResult(_0x303015,null))[_0x37d2('0x4a')](handleError(_0x303015,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index d3a5bf2..161e590 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 _0xd54f=['hasOwnProperty','exports','events','../../mysqldb','SquareProject','save','remove','emit'];(function(_0x5ed644,_0x237566){var _0x559ab8=function(_0x1a8f75){while(--_0x1a8f75){_0x5ed644['push'](_0x5ed644['shift']());}};_0x559ab8(++_0x237566);}(_0xd54f,0x132));var _0xfd54=function(_0x3d71d3,_0x11caf1){_0x3d71d3=_0x3d71d3-0x0;var _0x30ec87=_0xd54f[_0x3d71d3];return _0x30ec87;};'use strict';var EventEmitter=require(_0xfd54('0x0'));var SquareProject=require(_0xfd54('0x1'))['db'][_0xfd54('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfd54('0x3'),'afterUpdate':'update','afterDestroy':_0xfd54('0x4')};function emitEvent(_0x57ec35){return function(_0x24efda,_0x45e462,_0x555850){SquareProjectEvents[_0xfd54('0x5')](_0x57ec35+':'+_0x24efda['id'],_0x24efda);SquareProjectEvents[_0xfd54('0x5')](_0x57ec35,_0x24efda);_0x555850(null);};}for(var e in events){if(events[_0xfd54('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xfd54('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x2a50=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x3b054a,_0x3620f8){var _0x1d2316=function(_0xc833bd){while(--_0xc833bd){_0x3b054a['push'](_0x3b054a['shift']());}};_0x1d2316(++_0x3620f8);}(_0x2a50,0xc8));var _0x02a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a50[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x02a5('0x0'));var SquareProject=require(_0x02a5('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x02a5('0x2'),'afterUpdate':_0x02a5('0x3'),'afterDestroy':_0x02a5('0x4')};function emitEvent(_0x106850){return function(_0x35b12a,_0x6cb3d,_0x3d0941){SquareProjectEvents[_0x02a5('0x5')](_0x106850+':'+_0x35b12a['id'],_0x35b12a);SquareProjectEvents[_0x02a5('0x5')](_0x106850,_0x35b12a);_0x3d0941(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x02a5('0x6')](e,emitEvent(event));}}module[_0x02a5('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index eb90669..079bc67 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 _0xc56d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xc56d,0x153));var _0xdc56=function(_0x5c2e76,_0x1f3ead){_0x5c2e76=_0x5c2e76-0x0;var _0xdde8d8=_0xc56d[_0x5c2e76];return _0xdde8d8;};'use strict';var _=require(_0xdc56('0x0'));var util=require(_0xdc56('0x1'));var logger=require(_0xdc56('0x2'))(_0xdc56('0x3'));var moment=require(_0xdc56('0x4'));var BPromise=require(_0xdc56('0x5'));var rp=require(_0xdc56('0x6'));var fs=require('fs');var path=require(_0xdc56('0x7'));var rimraf=require(_0xdc56('0x8'));var config=require(_0xdc56('0x9'));var attributes=require(_0xdc56('0xa'));module[_0xdc56('0xb')]=function(_0x2bf5fb,_0x48866f){return _0x2bf5fb[_0xdc56('0xc')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x16617b,_0x5a183b,_0x17d15b){if(_0x16617b[_0xdc56('0xd')](_0xdc56('0xe'))){_0x16617b[_0xdc56('0xf')]=moment()['format'](_0xdc56('0x10'));}if(_0x16617b[_0xdc56('0xd')](_0xdc56('0x11'))){_0x16617b[_0xdc56('0x12')]=moment()[_0xdc56('0x13')](_0xdc56('0x10'));}_0x17d15b(null,_0x16617b);}}});}; \ No newline at end of file +var _0x9bfc=['request-promise','rimraf','./squareProject.attributes','SquareProject','square_projects','changed','preproduction','savedAt','format','production','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird'];(function(_0x4d5a49,_0x38d185){var _0x47b712=function(_0x146e79){while(--_0x146e79){_0x4d5a49['push'](_0x4d5a49['shift']());}};_0x47b712(++_0x38d185);}(_0x9bfc,0x173));var _0xc9bf=function(_0x2ff17f,_0xf7c1a1){_0x2ff17f=_0x2ff17f-0x0;var _0xcdcd31=_0x9bfc[_0x2ff17f];return _0xcdcd31;};'use strict';var _=require(_0xc9bf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc9bf('0x1'));var moment=require(_0xc9bf('0x2'));var BPromise=require(_0xc9bf('0x3'));var rp=require(_0xc9bf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9bf('0x5'));var config=require('../../config/environment');var attributes=require(_0xc9bf('0x6'));module['exports']=function(_0x3486bc,_0x4e641f){return _0x3486bc['define'](_0xc9bf('0x7'),attributes,{'tableName':_0xc9bf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x24d48c,_0x2f4c90,_0x3935b7){if(_0x24d48c[_0xc9bf('0x9')](_0xc9bf('0xa'))){_0x24d48c[_0xc9bf('0xb')]=moment()[_0xc9bf('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x24d48c[_0xc9bf('0x9')](_0xc9bf('0xd'))){_0x24d48c['publishedAt']=moment()[_0xc9bf('0xc')](_0xc9bf('0xe'));}_0x3935b7(null,_0x24d48c);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 4dbc937..0c2a129 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 _0xac62=['SquareProject','find','options','raw','where','attributes','include','model','map','debug','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSquareProject'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xac62,0x1a2));var _0x2ac6=function(_0x44594d,_0x44470c){_0x44594d=_0x44594d-0x0;var _0x1bff66=_0xac62[_0x44594d];return _0x1bff66;};'use strict';var _=require('lodash');var util=require(_0x2ac6('0x0'));var moment=require(_0x2ac6('0x1'));var BPromise=require('bluebird');var rs=require(_0x2ac6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ac6('0x3'))['db'];var utils=require(_0x2ac6('0x4'));var logger=require('../../config/logger')(_0x2ac6('0x5'));var config=require('../../config/environment');var jayson=require(_0x2ac6('0x6'));var client=jayson[_0x2ac6('0x7')][_0x2ac6('0x8')]({'port':0x232a});config[_0x2ac6('0x9')]=_['defaults'](config[_0x2ac6('0x9')],{'host':_0x2ac6('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ac6('0x9')]));require(_0x2ac6('0xb'))[_0x2ac6('0xc')](socket);function respondWithRpcPromise(_0x5eb236,_0x3f7701,_0x5c300a){return new BPromise(function(_0x2c6c3b,_0x34c3d0){return client[_0x2ac6('0xd')](_0x5eb236,_0x5c300a)[_0x2ac6('0xe')](function(_0x204341){logger[_0x2ac6('0xf')](_0x2ac6('0x10'),_0x3f7701,_0x2ac6('0x11'));logger['debug']('SquareProject,\x20%s,\x20%s,\x20%s',_0x3f7701,_0x2ac6('0x11'),JSON[_0x2ac6('0x12')](_0x204341));if(_0x204341[_0x2ac6('0x13')]){if(_0x204341[_0x2ac6('0x13')]['code']===0x1f4){logger[_0x2ac6('0x13')]('SquareProject,\x20%s,\x20%s',_0x3f7701,_0x204341[_0x2ac6('0x13')][_0x2ac6('0x14')]);return _0x34c3d0(_0x204341['error'][_0x2ac6('0x14')]);}logger[_0x2ac6('0x13')](_0x2ac6('0x10'),_0x3f7701,_0x204341[_0x2ac6('0x13')][_0x2ac6('0x14')]);return _0x2c6c3b(_0x204341['error'][_0x2ac6('0x14')]);}else{logger[_0x2ac6('0xf')](_0x2ac6('0x10'),_0x3f7701,'request\x20sent');_0x2c6c3b(_0x204341[_0x2ac6('0x15')][_0x2ac6('0x14')]);}})[_0x2ac6('0x16')](function(_0x4d373f){logger['error'](_0x2ac6('0x10'),_0x3f7701,_0x4d373f);_0x34c3d0(_0x4d373f);});});}exports[_0x2ac6('0x17')]=function(_0x42e04f){var _0x141f49=this;return new Promise(function(_0x554e76,_0x1c9122){return db[_0x2ac6('0x18')][_0x2ac6('0x19')]({'raw':_0x42e04f[_0x2ac6('0x1a')]?_0x42e04f['options'][_0x2ac6('0x1b')]===undefined?!![]:![]:!![],'where':_0x42e04f[_0x2ac6('0x1a')]?_0x42e04f[_0x2ac6('0x1a')][_0x2ac6('0x1c')]||null:null,'attributes':_0x42e04f[_0x2ac6('0x1a')]?_0x42e04f[_0x2ac6('0x1a')][_0x2ac6('0x1d')]||null:null,'include':_0x42e04f[_0x2ac6('0x1a')]?_0x42e04f['options'][_0x2ac6('0x1e')]?_['map'](_0x42e04f[_0x2ac6('0x1a')][_0x2ac6('0x1e')],function(_0x5e3de1){return{'model':db[_0x5e3de1[_0x2ac6('0x1f')]],'as':_0x5e3de1['as'],'attributes':_0x5e3de1[_0x2ac6('0x1d')],'include':_0x5e3de1['include']?_['map'](_0x5e3de1[_0x2ac6('0x1e')],function(_0x5be932){return{'model':db[_0x5be932[_0x2ac6('0x1f')]],'as':_0x5be932['as'],'attributes':_0x5be932[_0x2ac6('0x1d')],'include':_0x5be932['include']?_[_0x2ac6('0x20')](_0x5be932[_0x2ac6('0x1e')],function(_0x1ae613){return{'model':db[_0x1ae613[_0x2ac6('0x1f')]],'as':_0x1ae613['as'],'attributes':_0x1ae613[_0x2ac6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2ac6('0xe')](function(_0x46f307){logger[_0x2ac6('0xf')](_0x2ac6('0x17'),_0x42e04f);logger[_0x2ac6('0x21')](_0x2ac6('0x17'),_0x42e04f,JSON[_0x2ac6('0x12')](_0x46f307));_0x554e76(_0x46f307);})['catch'](function(_0x4592d2){logger[_0x2ac6('0x13')](_0x2ac6('0x17'),_0x4592d2[_0x2ac6('0x14')],_0x42e04f);_0x1c9122(_0x141f49[_0x2ac6('0x13')](0x1f4,_0x4592d2[_0x2ac6('0x14')]));});});}; \ No newline at end of file +var _0x38bd=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','request','then','info','SquareProject,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','ShowSquareProject','SquareProject','options','raw','where','attributes','map','include','model','stringify'];(function(_0x3fe1a5,_0x1a7d99){var _0x389d8d=function(_0x13e6f8){while(--_0x13e6f8){_0x3fe1a5['push'](_0x3fe1a5['shift']());}};_0x389d8d(++_0x1a7d99);}(_0x38bd,0xe4));var _0xd38b=function(_0x189057,_0x5969f9){_0x189057=_0x189057-0x0;var _0x2fa38a=_0x38bd[_0x189057];return _0x2fa38a;};'use strict';var _=require(_0xd38b('0x0'));var util=require(_0xd38b('0x1'));var moment=require(_0xd38b('0x2'));var BPromise=require(_0xd38b('0x3'));var rs=require(_0xd38b('0x4'));var fs=require('fs');var Redis=require(_0xd38b('0x5'));var db=require(_0xd38b('0x6'))['db'];var utils=require(_0xd38b('0x7'));var logger=require(_0xd38b('0x8'))(_0xd38b('0x9'));var config=require(_0xd38b('0xa'));var jayson=require(_0xd38b('0xb'));var client=jayson['client'][_0xd38b('0xc')]({'port':0x232a});config[_0xd38b('0xd')]=_[_0xd38b('0xe')](config[_0xd38b('0xd')],{'host':_0xd38b('0xf'),'port':0x18eb});var socket=require(_0xd38b('0x10'))(new Redis(config['redis']));require(_0xd38b('0x11'))['register'](socket);function respondWithRpcPromise(_0x49e95e,_0x3a5bbf,_0x254057){return new BPromise(function(_0x569451,_0x3e42b1){return client[_0xd38b('0x12')](_0x49e95e,_0x254057)[_0xd38b('0x13')](function(_0x58e496){logger[_0xd38b('0x14')](_0xd38b('0x15'),_0x3a5bbf,'request\x20sent');logger[_0xd38b('0x16')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x3a5bbf,_0xd38b('0x17'),JSON['stringify'](_0x58e496));if(_0x58e496[_0xd38b('0x18')]){if(_0x58e496['error'][_0xd38b('0x19')]===0x1f4){logger[_0xd38b('0x18')](_0xd38b('0x15'),_0x3a5bbf,_0x58e496[_0xd38b('0x18')]['message']);return _0x3e42b1(_0x58e496['error'][_0xd38b('0x1a')]);}logger[_0xd38b('0x18')](_0xd38b('0x15'),_0x3a5bbf,_0x58e496[_0xd38b('0x18')][_0xd38b('0x1a')]);return _0x569451(_0x58e496['error'][_0xd38b('0x1a')]);}else{logger[_0xd38b('0x14')](_0xd38b('0x15'),_0x3a5bbf,_0xd38b('0x17'));_0x569451(_0x58e496[_0xd38b('0x1b')][_0xd38b('0x1a')]);}})['catch'](function(_0x33a152){logger[_0xd38b('0x18')](_0xd38b('0x15'),_0x3a5bbf,_0x33a152);_0x3e42b1(_0x33a152);});});}exports[_0xd38b('0x1c')]=function(_0x48696c){var _0x2a64c8=this;return new Promise(function(_0x11d31a,_0x4dac4f){return db[_0xd38b('0x1d')]['find']({'raw':_0x48696c[_0xd38b('0x1e')]?_0x48696c[_0xd38b('0x1e')][_0xd38b('0x1f')]===undefined?!![]:![]:!![],'where':_0x48696c['options']?_0x48696c['options'][_0xd38b('0x20')]||null:null,'attributes':_0x48696c[_0xd38b('0x1e')]?_0x48696c[_0xd38b('0x1e')][_0xd38b('0x21')]||null:null,'include':_0x48696c['options']?_0x48696c[_0xd38b('0x1e')]['include']?_[_0xd38b('0x22')](_0x48696c[_0xd38b('0x1e')][_0xd38b('0x23')],function(_0x3920a0){return{'model':db[_0x3920a0['model']],'as':_0x3920a0['as'],'attributes':_0x3920a0[_0xd38b('0x21')],'include':_0x3920a0[_0xd38b('0x23')]?_[_0xd38b('0x22')](_0x3920a0[_0xd38b('0x23')],function(_0x2d2cba){return{'model':db[_0x2d2cba['model']],'as':_0x2d2cba['as'],'attributes':_0x2d2cba[_0xd38b('0x21')],'include':_0x2d2cba[_0xd38b('0x23')]?_[_0xd38b('0x22')](_0x2d2cba[_0xd38b('0x23')],function(_0x577925){return{'model':db[_0x577925[_0xd38b('0x24')]],'as':_0x577925['as'],'attributes':_0x577925[_0xd38b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd38b('0x13')](function(_0x241272){logger['info']('ShowSquareProject',_0x48696c);logger[_0xd38b('0x16')](_0xd38b('0x1c'),_0x48696c,JSON[_0xd38b('0x25')](_0x241272));_0x11d31a(_0x241272);})['catch'](function(_0x5b9741){logger['error'](_0xd38b('0x1c'),_0x5b9741[_0xd38b('0x1a')],_0x48696c);_0x4dac4f(_0x2a64c8[_0xd38b('0x18')](0x1f4,_0x5b9741[_0xd38b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 49630d5..86218cf 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 _0x6955=['update','emit','removeListener','register','squareProject:'];(function(_0x5a550c,_0x4b1bc0){var _0x5f2417=function(_0x4c8528){while(--_0x4c8528){_0x5a550c['push'](_0x5a550c['shift']());}};_0x5f2417(++_0x4b1bc0);}(_0x6955,0xf5));var _0x5695=function(_0x23d60b,_0x4ec8c5){_0x23d60b=_0x23d60b-0x0;var _0x726632=_0x6955[_0x23d60b];return _0x726632;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x5695('0x0')];function createListener(_0x3f81c1,_0x4b5e04){return function(_0x36ce10){_0x4b5e04[_0x5695('0x1')](_0x3f81c1,_0x36ce10);};}function removeListener(_0x155cbf,_0x51222f){return function(){SquareProjectEvents[_0x5695('0x2')](_0x155cbf,_0x51222f);};}exports[_0x5695('0x3')]=function(_0x52b07c){for(var _0xbe38a=0x0,_0x1179b8=events['length'];_0xbe38a<_0x1179b8;_0xbe38a++){var _0x1c7bcd=events[_0xbe38a];var _0x323cbd=createListener(_0x5695('0x4')+_0x1c7bcd,_0x52b07c);SquareProjectEvents['on'](_0x1c7bcd,_0x323cbd);}}; \ No newline at end of file +var _0x4a70=['emit','removeListener','register','save','remove'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4a70,0xe4));var _0x04a7=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0x4a70[_0x263f4c];return _0x3a78d3;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x04a7('0x0'),_0x04a7('0x1'),'update'];function createListener(_0x37ce28,_0x39e45d){return function(_0xbc7c92){_0x39e45d[_0x04a7('0x2')](_0x37ce28,_0xbc7c92);};}function removeListener(_0x2f8c2e,_0x56de86){return function(){SquareProjectEvents[_0x04a7('0x3')](_0x2f8c2e,_0x56de86);};}exports[_0x04a7('0x4')]=function(_0xa5e3b7){for(var _0x546279=0x0,_0x5c38c1=events['length'];_0x546279<_0x5c38c1;_0x546279++){var _0x5a580f=events[_0x546279];var _0x44aa7e=createListener('squareProject:'+_0x5a580f,_0xa5e3b7);SquareProjectEvents['on'](_0x5a580f,_0x44aa7e);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index c72f8d2..1a7e76d 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7217,0x19e));var _0x7721=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7217[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router; \ No newline at end of file +var _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(_0x342db9,_0x50ea26){var _0x2b4d61=function(_0x3688a9){while(--_0x3688a9){_0x342db9['push'](_0x342db9['shift']());}};_0x2b4d61(++_0x50ea26);}(_0x5fc3,0xa8));var _0x35fc=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x5fc3[_0x11a55c];return _0x26c390;};'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 diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 4ac3f80..2775166 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 _0x5075=['savePath','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x81fe53,_0x5b8f05){var _0x56f7a7=function(_0x1e7846){while(--_0x1e7846){_0x81fe53['push'](_0x81fe53['shift']());}};_0x56f7a7(++_0x5b8f05);}(_0x5075,0x73));var _0x5507=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0x5075[_0x22e47a];return _0x15a12a;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'uniqueid':{'type':Sequelize[_0x5507('0x2')]},'callerid':{'type':Sequelize[_0x5507('0x2')]},'calleridname':{'type':Sequelize[_0x5507('0x2')]},'context':{'type':Sequelize[_0x5507('0x2')]},'extension':{'type':Sequelize[_0x5507('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5507('0x2')]},'dnid':{'type':Sequelize[_0x5507('0x2')]},'projectName':{'type':Sequelize[_0x5507('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x5507('0x2')]},'format':{'type':Sequelize[_0x5507('0x3')],'get':function(){var _0x4c2d6d='';var _0x42c232=this[_0x5507('0x4')](_0x5507('0x5'));if(_0x42c232){_0x4c2d6d=_0x42c232['substring'](_0x42c232['lastIndexOf']('.'));}return _0x4c2d6d;}}}; \ No newline at end of file +var _0xeda8=['substring','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xeda8,0x104));var _0x8eda=function(_0x4dbe6c,_0x395bb2){_0x4dbe6c=_0x4dbe6c-0x0;var _0x46c68f=_0xeda8[_0x4dbe6c];return _0x46c68f;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8eda('0x2')]},'calleridname':{'type':Sequelize[_0x8eda('0x2')]},'context':{'type':Sequelize[_0x8eda('0x2')]},'extension':{'type':Sequelize[_0x8eda('0x2')]},'priority':{'type':Sequelize[_0x8eda('0x2')]},'accountcode':{'type':Sequelize[_0x8eda('0x2')]},'dnid':{'type':Sequelize[_0x8eda('0x2')]},'projectName':{'type':Sequelize[_0x8eda('0x2')]},'saveName':{'type':Sequelize[_0x8eda('0x2')]},'filename':{'type':Sequelize[_0x8eda('0x2')]},'savePath':{'type':Sequelize[_0x8eda('0x2')]},'format':{'type':Sequelize[_0x8eda('0x3')],'get':function(){var _0x4e2ebb='';var _0x28b721=this[_0x8eda('0x4')](_0x8eda('0x5'));if(_0x28b721){_0x4e2ebb=_0x28b721[_0x8eda('0x6')](_0x28b721['lastIndexOf']('.'));}return _0x4e2ebb;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 2717532..8478e98 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 _0x4101=['existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','send','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','jsforce','desk.js','to-csv','querystring','ioredis','../../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','limit','Content-Range','reject','save','update','then','destroy','end','error','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','SquareRecording','count','include','rows','catch','filters','intersection','includeAll','find','create','body','download','../../components/encryptor','uniqueid','params','savePath','filename','%s.cypher'];(function(_0x494e72,_0x5f1178){var _0x2d3947=function(_0x165f2b){while(--_0x165f2b){_0x494e72['push'](_0x494e72['shift']());}};_0x2d3947(++_0x5f1178);}(_0x4101,0xcb));var _0x1410=function(_0x4f1e52,_0x3f2100){_0x4f1e52=_0x4f1e52-0x0;var _0x213a54=_0x4101[_0x4f1e52];return _0x213a54;};'use strict';var emlformat=require(_0x1410('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1410('0x1'));var rp=require(_0x1410('0x2'));var moment=require(_0x1410('0x3'));var BPromise=require(_0x1410('0x4'));var Mustache=require(_0x1410('0x5'));var util=require(_0x1410('0x6'));var path=require(_0x1410('0x7'));var sox=require(_0x1410('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1410('0x9'));var deskjs=require(_0x1410('0xa'));var toCsv=require(_0x1410('0xb'));var querystring=require(_0x1410('0xc'));var Papa=require('papaparse');var Redis=require(_0x1410('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1410('0xe'));var as=require(_0x1410('0xf'));var hardwareService=require(_0x1410('0x10'));var logger=require(_0x1410('0x11'))(_0x1410('0x12'));var utils=require(_0x1410('0x13'));var config=require(_0x1410('0x14'));var licenseUtil=require(_0x1410('0x15'));var db=require(_0x1410('0x16'))['db'];function respondWithStatusCode(_0x31bc0b,_0x2f5ca2){_0x2f5ca2=_0x2f5ca2||0xcc;return function(_0xdb770c){if(_0xdb770c){return _0x31bc0b[_0x1410('0x17')](_0x2f5ca2);}return _0x31bc0b[_0x1410('0x18')](_0x2f5ca2)['end']();};}function respondWithResult(_0x34d185,_0x272a2b){_0x272a2b=_0x272a2b||0xc8;return function(_0x40eeed){if(_0x40eeed){return _0x34d185[_0x1410('0x18')](_0x272a2b)[_0x1410('0x19')](_0x40eeed);}};}function respondWithFilteredResult(_0x5a8eea,_0x15bddd){return function(_0x21ef64){if(_0x21ef64){var _0x723220=typeof _0x15bddd[_0x1410('0x1a')]===_0x1410('0x1b')&&typeof _0x15bddd[_0x1410('0x1c')]==='undefined';var _0x5e58bb=_0x21ef64['count'];var _0x51dd24=_0x723220?0x0:_0x15bddd['offset'];var _0x4bb7f6=_0x723220?_0x21ef64['count']:_0x15bddd[_0x1410('0x1a')]+_0x15bddd[_0x1410('0x1c')];var _0x1549ba;if(_0x4bb7f6>=_0x5e58bb){_0x4bb7f6=_0x5e58bb;_0x1549ba=0xc8;}else{_0x1549ba=0xce;}_0x5a8eea['status'](_0x1549ba);return _0x5a8eea['set'](_0x1410('0x1d'),_0x51dd24+'-'+_0x4bb7f6+'/'+_0x5e58bb)[_0x1410('0x19')](_0x21ef64);}return null;};}function patchUpdates(_0x56a9b3){return function(_0x477f94){try{jsonpatch['apply'](_0x477f94,_0x56a9b3,!![]);}catch(_0x523e82){return BPromise[_0x1410('0x1e')](_0x523e82);}return _0x477f94[_0x1410('0x1f')]();};}function saveUpdates(_0x31376d,_0x197592){return function(_0x1ba28e){if(_0x1ba28e){return _0x1ba28e[_0x1410('0x20')](_0x31376d)[_0x1410('0x21')](function(_0xb17a21){return _0xb17a21;});}return null;};}function removeEntity(_0x33f4b2,_0x36038b){return function(_0x59d421){if(_0x59d421){return _0x59d421[_0x1410('0x22')]()[_0x1410('0x21')](function(){_0x33f4b2[_0x1410('0x18')](0xcc)[_0x1410('0x23')]();});}};}function handleEntityNotFound(_0x1c4a9b,_0x4ce99a){return function(_0x2f0a8d){if(!_0x2f0a8d){_0x1c4a9b[_0x1410('0x17')](0x194);}return _0x2f0a8d;};}function handleError(_0x804499,_0x1230f4){_0x1230f4=_0x1230f4||0x1f4;return function(_0x416177){logger[_0x1410('0x24')](_0x416177['stack']);if(_0x416177['name']){delete _0x416177['name'];}_0x804499[_0x1410('0x18')](_0x1230f4)['send'](_0x416177);};}exports[_0x1410('0x25')]=function(_0x512549,_0x40dabf){var _0x4269d0={},_0x5f8b2={},_0x3e5f3c={'count':0x0,'rows':[]};var _0x2aa482=_[_0x1410('0x26')](db['SquareRecording'][_0x1410('0x27')],function(_0x3e3b09){return{'name':_0x3e3b09[_0x1410('0x28')],'type':_0x3e3b09[_0x1410('0x29')][_0x1410('0x2a')]};});_0x5f8b2[_0x1410('0x2b')]=_[_0x1410('0x26')](_0x2aa482,_0x1410('0x2c'));_0x5f8b2[_0x1410('0x2d')]=_[_0x1410('0x2e')](_0x512549[_0x1410('0x2d')]);_0x5f8b2['filters']=_['intersection'](_0x5f8b2[_0x1410('0x2b')],_0x5f8b2[_0x1410('0x2d')]);_0x4269d0[_0x1410('0x2f')]=_['intersection'](_0x5f8b2['model'],qs[_0x1410('0x30')](_0x512549['query'][_0x1410('0x30')]));_0x4269d0[_0x1410('0x2f')]=_0x4269d0[_0x1410('0x2f')][_0x1410('0x31')]?_0x4269d0['attributes']:_0x5f8b2[_0x1410('0x2b')];if(!_0x512549[_0x1410('0x2d')][_0x1410('0x32')]('nolimit')){_0x4269d0[_0x1410('0x1c')]=qs[_0x1410('0x1c')](_0x512549['query'][_0x1410('0x1c')]);_0x4269d0[_0x1410('0x1a')]=qs[_0x1410('0x1a')](_0x512549['query'][_0x1410('0x1a')]);}_0x4269d0['order']=qs[_0x1410('0x33')](_0x512549[_0x1410('0x2d')]['sort']);_0x4269d0['where']=qs['filters'](_[_0x1410('0x34')](_0x512549['query'],_0x5f8b2['filters']),_0x2aa482);if(_0x512549['query'][_0x1410('0x35')]){_0x4269d0['where']=_[_0x1410('0x36')](_0x4269d0[_0x1410('0x37')],{'$or':_[_0x1410('0x26')](_0x2aa482,function(_0x2a27d1){if(_0x2a27d1['type']!==_0x1410('0x38')){var _0x324296={};_0x324296[_0x2a27d1[_0x1410('0x2c')]]={'$like':'%'+_0x512549[_0x1410('0x2d')][_0x1410('0x35')]+'%'};return _0x324296;}})});}_0x4269d0=_[_0x1410('0x36')]({},_0x4269d0,_0x512549[_0x1410('0x39')]);var _0x1f7bdb={'where':_0x4269d0[_0x1410('0x37')]};return db[_0x1410('0x3a')][_0x1410('0x3b')](_0x1f7bdb)[_0x1410('0x21')](function(_0x2174aa){_0x3e5f3c[_0x1410('0x3b')]=_0x2174aa;if(_0x512549['query']['includeAll']){_0x4269d0[_0x1410('0x3c')]=[{'all':!![]}];}return db[_0x1410('0x3a')]['findAll'](_0x4269d0);})[_0x1410('0x21')](function(_0xa6ac39){_0x3e5f3c[_0x1410('0x3d')]=_0xa6ac39;return _0x3e5f3c;})[_0x1410('0x21')](respondWithFilteredResult(_0x40dabf,_0x4269d0))[_0x1410('0x3e')](handleError(_0x40dabf,null));};exports['show']=function(_0x25dbca,_0x30f97b){var _0x275802={'raw':!![],'where':{'id':_0x25dbca['params']['id']}},_0x20f211={};_0x20f211[_0x1410('0x2b')]=_[_0x1410('0x2e')](db[_0x1410('0x3a')][_0x1410('0x27')]);_0x20f211['query']=_[_0x1410('0x2e')](_0x25dbca[_0x1410('0x2d')]);_0x20f211[_0x1410('0x3f')]=_[_0x1410('0x40')](_0x20f211[_0x1410('0x2b')],_0x20f211[_0x1410('0x2d')]);_0x275802[_0x1410('0x2f')]=_[_0x1410('0x40')](_0x20f211[_0x1410('0x2b')],qs[_0x1410('0x30')](_0x25dbca['query'][_0x1410('0x30')]));_0x275802[_0x1410('0x2f')]=_0x275802[_0x1410('0x2f')][_0x1410('0x31')]?_0x275802[_0x1410('0x2f')]:_0x20f211[_0x1410('0x2b')];if(_0x25dbca[_0x1410('0x2d')][_0x1410('0x41')]){_0x275802['include']=[{'all':!![]}];}_0x275802=_[_0x1410('0x36')]({},_0x275802,_0x25dbca[_0x1410('0x39')]);return db['SquareRecording'][_0x1410('0x42')](_0x275802)['then'](handleEntityNotFound(_0x30f97b,null))[_0x1410('0x21')](respondWithResult(_0x30f97b,null))[_0x1410('0x3e')](handleError(_0x30f97b,null));};exports['create']=function(_0x24c255,_0x3b91f2){return db[_0x1410('0x3a')][_0x1410('0x43')](_0x24c255[_0x1410('0x44')],{})[_0x1410('0x21')](respondWithResult(_0x3b91f2,0xc9))['catch'](handleError(_0x3b91f2,null));};exports[_0x1410('0x20')]=function(_0x5bff35,_0x2c6180){if(_0x5bff35[_0x1410('0x44')]['id']){delete _0x5bff35['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x5bff35['params']['id']}})[_0x1410('0x21')](handleEntityNotFound(_0x2c6180,null))['then'](saveUpdates(_0x5bff35[_0x1410('0x44')],null))[_0x1410('0x21')](respondWithResult(_0x2c6180,null))[_0x1410('0x3e')](handleError(_0x2c6180,null));};exports[_0x1410('0x45')]=function(_0x39c688,_0x3572a5,_0x30986c){var _0x156380=require(_0x1410('0x46'));var _0x36881c=![];var _0x39394d={};if(_0x39c688[_0x1410('0x2d')][_0x1410('0x29')]&&_0x39c688[_0x1410('0x2d')][_0x1410('0x29')]==='uniqueid'){_0x39394d[_0x1410('0x47')]=_0x39c688[_0x1410('0x48')]['id'];}else{_0x39394d['id']=_0x39c688['params']['id'];}return db['SquareRecording'][_0x1410('0x42')]({'where':_0x39394d,'attributes':['id',_0x1410('0x49'),_0x1410('0x4a')],'raw':!![]})[_0x1410('0x21')](handleEntityNotFound(_0x3572a5,null))[_0x1410('0x21')](function(_0x288759){if(_0x288759){var _0x41ebe3=_0x288759[_0x1410('0x49')];var _0xebf81c=util['format'](_0x1410('0x4b'),_0x41ebe3);if(fs[_0x1410('0x4c')](_0xebf81c)){_0x36881c=!![];return _0x156380[_0x1410('0x4d')](_0xebf81c,_0x41ebe3,config[_0x1410('0x4e')]['recording'])[_0x1410('0x21')](function(){return _0x288759;});}return _0x288759;}})[_0x1410('0x21')](function(_0x3c644e){if(_0x3c644e){var _0x57180a=_0x3c644e[_0x1410('0x49')];if(!fs[_0x1410('0x4c')](_0x57180a)){throw new db[(_0x1410('0x4f'))][(_0x1410('0x50'))](_0x1410('0x51'));}if(_0x3c644e[_0x1410('0x4a')]){return _0x3572a5[_0x1410('0x45')](_0x57180a,_0x3c644e[_0x1410('0x4a')]+path['extname'](_0x57180a),function(){if(_0x36881c){fs['unlink'](_0x57180a);}});}else{return _0x3572a5[_0x1410('0x45')](_0x57180a,function(_0x5a838d){if(_0x36881c){fs[_0x1410('0x52')](_0x57180a);}});}}})[_0x1410('0x3e')](function(_0x559c7c){if(_0x559c7c[_0x1410('0x53')]==='SquareRecording\x20not\x20found'){_0x3572a5['status'](0x194)[_0x1410('0x54')](_0x1410('0x55'));}else{return handleError(_0x3572a5,null);}});};exports[_0x1410('0x22')]=function(_0x8df6e7,_0x8b7ac0){return db[_0x1410('0x3a')][_0x1410('0x42')]({'where':{'id':_0x8df6e7['params']['id']}})[_0x1410('0x21')](function(_0x5b3172){if(_[_0x1410('0x56')](_0x5b3172)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5b3172;})[_0x1410('0x21')](function(_0x168e77){var _0xa72e35=_0x168e77[_0x1410('0x49')];logger[_0x1410('0x57')](_0x1410('0x58'),_0xa72e35);if(!_['isNil'](_0x168e77[_0x1410('0x49')])&&fs[_0x1410('0x4c')](_0xa72e35)){logger[_0x1410('0x57')](_0x1410('0x59')+_0xa72e35+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1410('0x5a')](_0xa72e35);}_0xa72e35=_0xa72e35+_0x1410('0x5b');if(!_[_0x1410('0x56')](_0x168e77['savePath'])&&fs[_0x1410('0x4c')](_0xa72e35)){logger[_0x1410('0x57')](_0x1410('0x59')+_0xa72e35+_0x1410('0x5c'));fs[_0x1410('0x5a')](_0xa72e35);}return _0x168e77;})[_0x1410('0x21')](function(_0x239d93){if(!_0x239d93)throw new InternalError();return _0x239d93['destroy']();})[_0x1410('0x21')](function(){_0x8b7ac0[_0x1410('0x18')](0xcc)['end']();})[_0x1410('0x3e')](handleError(_0x8b7ac0,null));}; \ No newline at end of file +var _0x168e=['download','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','SquareRecording','includeAll','include','catch','params','body','update','find','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x168e,0x167));var _0xe168=function(_0x25f176,_0x1eda24){_0x25f176=_0x25f176-0x0;var _0x35d725=_0x168e[_0x25f176];return _0x35d725;};'use strict';var emlformat=require(_0xe168('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe168('0x1'));var moment=require(_0xe168('0x2'));var BPromise=require(_0xe168('0x3'));var Mustache=require('mustache');var util=require(_0xe168('0x4'));var path=require(_0xe168('0x5'));var sox=require(_0xe168('0x6'));var csv=require(_0xe168('0x7'));var ejs=require(_0xe168('0x8'));var fs=require('fs');var fs_extra=require(_0xe168('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe168('0xa'));var jsforce=require(_0xe168('0xb'));var deskjs=require(_0xe168('0xc'));var toCsv=require(_0xe168('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe168('0xd'));var as=require(_0xe168('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe168('0xf'))(_0xe168('0x10'));var utils=require(_0xe168('0x11'));var config=require(_0xe168('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xe168('0x13'))['db'];function respondWithStatusCode(_0x56127b,_0x342ace){_0x342ace=_0x342ace||0xcc;return function(_0x133f9e){if(_0x133f9e){return _0x56127b[_0xe168('0x14')](_0x342ace);}return _0x56127b[_0xe168('0x15')](_0x342ace)[_0xe168('0x16')]();};}function respondWithResult(_0x4d5ccd,_0x2719dd){_0x2719dd=_0x2719dd||0xc8;return function(_0x2598b9){if(_0x2598b9){return _0x4d5ccd[_0xe168('0x15')](_0x2719dd)[_0xe168('0x17')](_0x2598b9);}};}function respondWithFilteredResult(_0x53808f,_0x4fcaea){return function(_0x470a46){if(_0x470a46){var _0x40832f=typeof _0x4fcaea[_0xe168('0x18')]===_0xe168('0x19')&&typeof _0x4fcaea['limit']==='undefined';var _0x1373b7=_0x470a46[_0xe168('0x1a')];var _0x2de445=_0x40832f?0x0:_0x4fcaea[_0xe168('0x18')];var _0x16d985=_0x40832f?_0x470a46['count']:_0x4fcaea[_0xe168('0x18')]+_0x4fcaea[_0xe168('0x1b')];var _0x58e1da;if(_0x16d985>=_0x1373b7){_0x16d985=_0x1373b7;_0x58e1da=0xc8;}else{_0x58e1da=0xce;}_0x53808f[_0xe168('0x15')](_0x58e1da);return _0x53808f['set'](_0xe168('0x1c'),_0x2de445+'-'+_0x16d985+'/'+_0x1373b7)[_0xe168('0x17')](_0x470a46);}return null;};}function patchUpdates(_0x37856f){return function(_0x3d75af){try{jsonpatch[_0xe168('0x1d')](_0x3d75af,_0x37856f,!![]);}catch(_0x265e92){return BPromise['reject'](_0x265e92);}return _0x3d75af[_0xe168('0x1e')]();};}function saveUpdates(_0x1dafa0,_0x4d75b7){return function(_0x271690){if(_0x271690){return _0x271690['update'](_0x1dafa0)[_0xe168('0x1f')](function(_0x1d0bf2){return _0x1d0bf2;});}return null;};}function removeEntity(_0x179a12,_0x19bdb2){return function(_0x2bfb1b){if(_0x2bfb1b){return _0x2bfb1b[_0xe168('0x20')]()[_0xe168('0x1f')](function(){_0x179a12[_0xe168('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5112e2,_0x1f8407){return function(_0x561bcd){if(!_0x561bcd){_0x5112e2[_0xe168('0x14')](0x194);}return _0x561bcd;};}function handleError(_0x1eb265,_0x4a20d1){_0x4a20d1=_0x4a20d1||0x1f4;return function(_0x29c987){logger[_0xe168('0x21')](_0x29c987['stack']);if(_0x29c987[_0xe168('0x22')]){delete _0x29c987[_0xe168('0x22')];}_0x1eb265['status'](_0x4a20d1)[_0xe168('0x23')](_0x29c987);};}exports['index']=function(_0x316fa4,_0x5e02e6){var _0x163143={},_0x55a433={},_0x19fee2={'count':0x0,'rows':[]};var _0x107fc5=_[_0xe168('0x24')](db['SquareRecording'][_0xe168('0x25')],function(_0xcbd6b3){return{'name':_0xcbd6b3[_0xe168('0x26')],'type':_0xcbd6b3[_0xe168('0x27')][_0xe168('0x28')]};});_0x55a433[_0xe168('0x29')]=_['map'](_0x107fc5,_0xe168('0x22'));_0x55a433[_0xe168('0x2a')]=_[_0xe168('0x2b')](_0x316fa4[_0xe168('0x2a')]);_0x55a433['filters']=_[_0xe168('0x2c')](_0x55a433[_0xe168('0x29')],_0x55a433['query']);_0x163143[_0xe168('0x2d')]=_[_0xe168('0x2c')](_0x55a433[_0xe168('0x29')],qs[_0xe168('0x2e')](_0x316fa4[_0xe168('0x2a')][_0xe168('0x2e')]));_0x163143[_0xe168('0x2d')]=_0x163143['attributes']['length']?_0x163143[_0xe168('0x2d')]:_0x55a433['model'];if(!_0x316fa4[_0xe168('0x2a')]['hasOwnProperty'](_0xe168('0x2f'))){_0x163143[_0xe168('0x1b')]=qs[_0xe168('0x1b')](_0x316fa4[_0xe168('0x2a')][_0xe168('0x1b')]);_0x163143[_0xe168('0x18')]=qs[_0xe168('0x18')](_0x316fa4['query'][_0xe168('0x18')]);}_0x163143['order']=qs[_0xe168('0x30')](_0x316fa4[_0xe168('0x2a')][_0xe168('0x30')]);_0x163143[_0xe168('0x31')]=qs['filters'](_[_0xe168('0x32')](_0x316fa4[_0xe168('0x2a')],_0x55a433[_0xe168('0x33')]),_0x107fc5);if(_0x316fa4['query'][_0xe168('0x34')]){_0x163143['where']=_[_0xe168('0x35')](_0x163143['where'],{'$or':_[_0xe168('0x24')](_0x107fc5,function(_0x497455){if(_0x497455['type']!==_0xe168('0x36')){var _0x3b294f={};_0x3b294f[_0x497455[_0xe168('0x22')]]={'$like':'%'+_0x316fa4['query']['filter']+'%'};return _0x3b294f;}})});}_0x163143=_[_0xe168('0x35')]({},_0x163143,_0x316fa4[_0xe168('0x37')]);var _0x3f7679={'where':_0x163143[_0xe168('0x31')]};return db[_0xe168('0x38')]['count'](_0x3f7679)[_0xe168('0x1f')](function(_0x2db919){_0x19fee2[_0xe168('0x1a')]=_0x2db919;if(_0x316fa4[_0xe168('0x2a')][_0xe168('0x39')]){_0x163143[_0xe168('0x3a')]=[{'all':!![]}];}return db[_0xe168('0x38')]['findAll'](_0x163143);})['then'](function(_0x59524e){_0x19fee2['rows']=_0x59524e;return _0x19fee2;})[_0xe168('0x1f')](respondWithFilteredResult(_0x5e02e6,_0x163143))[_0xe168('0x3b')](handleError(_0x5e02e6,null));};exports['show']=function(_0x309f30,_0x59f48d){var _0x4067f3={'raw':!![],'where':{'id':_0x309f30[_0xe168('0x3c')]['id']}},_0x166ace={};_0x166ace['model']=_[_0xe168('0x2b')](db[_0xe168('0x38')][_0xe168('0x25')]);_0x166ace[_0xe168('0x2a')]=_[_0xe168('0x2b')](_0x309f30[_0xe168('0x2a')]);_0x166ace['filters']=_[_0xe168('0x2c')](_0x166ace[_0xe168('0x29')],_0x166ace['query']);_0x4067f3['attributes']=_[_0xe168('0x2c')](_0x166ace[_0xe168('0x29')],qs[_0xe168('0x2e')](_0x309f30[_0xe168('0x2a')]['fields']));_0x4067f3['attributes']=_0x4067f3[_0xe168('0x2d')]['length']?_0x4067f3[_0xe168('0x2d')]:_0x166ace['model'];if(_0x309f30[_0xe168('0x2a')][_0xe168('0x39')]){_0x4067f3[_0xe168('0x3a')]=[{'all':!![]}];}_0x4067f3=_[_0xe168('0x35')]({},_0x4067f3,_0x309f30[_0xe168('0x37')]);return db[_0xe168('0x38')]['find'](_0x4067f3)[_0xe168('0x1f')](handleEntityNotFound(_0x59f48d,null))['then'](respondWithResult(_0x59f48d,null))[_0xe168('0x3b')](handleError(_0x59f48d,null));};exports['create']=function(_0x3420e6,_0x46cd6a){return db[_0xe168('0x38')]['create'](_0x3420e6[_0xe168('0x3d')],{})['then'](respondWithResult(_0x46cd6a,0xc9))[_0xe168('0x3b')](handleError(_0x46cd6a,null));};exports[_0xe168('0x3e')]=function(_0x32e5fa,_0x5e2e9e){if(_0x32e5fa[_0xe168('0x3d')]['id']){delete _0x32e5fa[_0xe168('0x3d')]['id'];}return db[_0xe168('0x38')][_0xe168('0x3f')]({'where':{'id':_0x32e5fa[_0xe168('0x3c')]['id']}})[_0xe168('0x1f')](handleEntityNotFound(_0x5e2e9e,null))[_0xe168('0x1f')](saveUpdates(_0x32e5fa['body'],null))[_0xe168('0x1f')](respondWithResult(_0x5e2e9e,null))[_0xe168('0x3b')](handleError(_0x5e2e9e,null));};exports['download']=function(_0x5e8ae1,_0x4b9ce9,_0x56f827){var _0x417c03=require(_0xe168('0x40'));var _0xecac7=![];var _0xce8128={};if(_0x5e8ae1['query'][_0xe168('0x27')]&&_0x5e8ae1[_0xe168('0x2a')][_0xe168('0x27')]==='uniqueid'){_0xce8128[_0xe168('0x41')]=_0x5e8ae1['params']['id'];}else{_0xce8128['id']=_0x5e8ae1[_0xe168('0x3c')]['id'];}return db['SquareRecording']['find']({'where':_0xce8128,'attributes':['id',_0xe168('0x42'),_0xe168('0x43')],'raw':!![]})[_0xe168('0x1f')](handleEntityNotFound(_0x4b9ce9,null))['then'](function(_0x3eb0d6){if(_0x3eb0d6){var _0x4b8c5d=_0x3eb0d6[_0xe168('0x42')];var _0x2c1020=util[_0xe168('0x44')]('%s.cypher',_0x4b8c5d);if(fs[_0xe168('0x45')](_0x2c1020)){_0xecac7=!![];return _0x417c03[_0xe168('0x46')](_0x2c1020,_0x4b8c5d,config[_0xe168('0x47')][_0xe168('0x48')])[_0xe168('0x1f')](function(){return _0x3eb0d6;});}return _0x3eb0d6;}})[_0xe168('0x1f')](function(_0x3cf037){if(_0x3cf037){var _0x19785b=_0x3cf037[_0xe168('0x42')];if(!fs[_0xe168('0x45')](_0x19785b)){throw new db[(_0xe168('0x49'))][(_0xe168('0x4a'))](_0xe168('0x4b'));}if(_0x3cf037[_0xe168('0x43')]){return _0x4b9ce9[_0xe168('0x4c')](_0x19785b,_0x3cf037[_0xe168('0x43')]+path[_0xe168('0x4d')](_0x19785b),function(){if(_0xecac7){fs['unlink'](_0x19785b);}});}else{return _0x4b9ce9[_0xe168('0x4c')](_0x19785b,function(_0x24251e){if(_0xecac7){fs[_0xe168('0x4e')](_0x19785b);}});}}})['catch'](function(_0x543883){if(_0x543883['message']==='SquareRecording\x20not\x20found'){_0x4b9ce9[_0xe168('0x15')](0x194)[_0xe168('0x23')](_0xe168('0x4f'));}else{return handleError(_0x4b9ce9,null);}});};exports[_0xe168('0x20')]=function(_0xb9313a,_0x345128){return db['SquareRecording'][_0xe168('0x3f')]({'where':{'id':_0xb9313a['params']['id']}})[_0xe168('0x1f')](function(_0x27970a){if(_[_0xe168('0x50')](_0x27970a)){throw new ReferenceError(_0xe168('0x51'));}return _0x27970a;})[_0xe168('0x1f')](function(_0x4cb29e){var _0xcf8050=_0x4cb29e[_0xe168('0x42')];logger[_0xe168('0x52')]('cancellazione\x20fisica\x20documento\x20%s',_0xcf8050);if(!_[_0xe168('0x50')](_0x4cb29e[_0xe168('0x42')])&&fs[_0xe168('0x45')](_0xcf8050)){logger[_0xe168('0x52')](_0xe168('0x53')+_0xcf8050+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe168('0x54')](_0xcf8050);}_0xcf8050=_0xcf8050+_0xe168('0x55');if(!_['isNil'](_0x4cb29e[_0xe168('0x42')])&&fs[_0xe168('0x45')](_0xcf8050)){logger[_0xe168('0x52')](_0xe168('0x53')+_0xcf8050+_0xe168('0x56'));fs[_0xe168('0x54')](_0xcf8050);}return _0x4cb29e;})[_0xe168('0x1f')](function(_0x33576e){if(!_0x33576e)throw new InternalError();return _0x33576e[_0xe168('0x20')]();})[_0xe168('0x1f')](function(){_0x345128[_0xe168('0x15')](0xcc)[_0xe168('0x16')]();})['catch'](handleError(_0x345128,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 8fcf28b..76f3eaf 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 _0x65cb=['request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','../../config/logger','api','moment'];(function(_0x7c8b94,_0x1024bb){var _0x197a8c=function(_0x372220){while(--_0x372220){_0x7c8b94['push'](_0x7c8b94['shift']());}};_0x197a8c(++_0x1024bb);}(_0x65cb,0xa4));var _0xb65c=function(_0x4b7bc5,_0x18b3b0){_0x4b7bc5=_0x4b7bc5-0x0;var _0x5ec3ba=_0x65cb[_0x4b7bc5];return _0x5ec3ba;};'use strict';var _=require(_0xb65c('0x0'));var util=require('util');var logger=require(_0xb65c('0x1'))(_0xb65c('0x2'));var moment=require(_0xb65c('0x3'));var BPromise=require('bluebird');var rp=require(_0xb65c('0x4'));var fs=require('fs');var path=require(_0xb65c('0x5'));var rimraf=require(_0xb65c('0x6'));var config=require(_0xb65c('0x7'));var attributes=require(_0xb65c('0x8'));module['exports']=function(_0x38d414,_0x1c6718){return _0x38d414[_0xb65c('0x9')](_0xb65c('0xa'),attributes,{'tableName':_0xb65c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5aa=['bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util','api','moment'];(function(_0xef71b7,_0x300992){var _0x3e853d=function(_0x37126f){while(--_0x37126f){_0xef71b7['push'](_0xef71b7['shift']());}};_0x3e853d(++_0x300992);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x155cee,_0x42f903){_0x155cee=_0x155cee-0x0;var _0x473a4b=_0xa5aa[_0x155cee];return _0x473a4b;};'use strict';var _=require(_0xaa5a('0x0'));var util=require(_0xaa5a('0x1'));var logger=require('../../config/logger')(_0xaa5a('0x2'));var moment=require(_0xaa5a('0x3'));var BPromise=require(_0xaa5a('0x4'));var rp=require(_0xaa5a('0x5'));var fs=require('fs');var path=require(_0xaa5a('0x6'));var rimraf=require(_0xaa5a('0x7'));var config=require('../../config/environment');var attributes=require(_0xaa5a('0x8'));module[_0xaa5a('0x9')]=function(_0x46c8cc,_0x561d19){return _0x46c8cc['define'](_0xaa5a('0xa'),attributes,{'tableName':_0xaa5a('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 ecb5022..a99332d 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 _0xc5e8=['then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareRecording','SquareRecording','body','options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x43b833,_0x345a9e){var _0x5085d0=function(_0x3211b8){while(--_0x3211b8){_0x43b833['push'](_0x43b833['shift']());}};_0x5085d0(++_0x345a9e);}(_0xc5e8,0x1e4));var _0x8c5e=function(_0x74594c,_0x15bdc4){_0x74594c=_0x74594c-0x0;var _0x5164a9=_0xc5e8[_0x74594c];return _0x5164a9;};'use strict';var _=require('lodash');var util=require(_0x8c5e('0x0'));var moment=require('moment');var BPromise=require(_0x8c5e('0x1'));var rs=require(_0x8c5e('0x2'));var fs=require('fs');var Redis=require(_0x8c5e('0x3'));var db=require(_0x8c5e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c5e('0x5'))(_0x8c5e('0x6'));var config=require('../../config/environment');var jayson=require(_0x8c5e('0x7'));var client=jayson['client'][_0x8c5e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5dfa9b,_0x54e8ac,_0x25078b){return new BPromise(function(_0x295f6,_0x30bd7e){return client[_0x8c5e('0x9')](_0x5dfa9b,_0x25078b)[_0x8c5e('0xa')](function(_0x38e358){logger['info'](_0x8c5e('0xb'),_0x54e8ac,_0x8c5e('0xc'));logger[_0x8c5e('0xd')](_0x8c5e('0xe'),_0x54e8ac,_0x8c5e('0xc'),JSON[_0x8c5e('0xf')](_0x38e358));if(_0x38e358['error']){if(_0x38e358[_0x8c5e('0x10')][_0x8c5e('0x11')]===0x1f4){logger[_0x8c5e('0x10')](_0x8c5e('0xb'),_0x54e8ac,_0x38e358['error'][_0x8c5e('0x12')]);return _0x30bd7e(_0x38e358['error'][_0x8c5e('0x12')]);}logger['error'](_0x8c5e('0xb'),_0x54e8ac,_0x38e358[_0x8c5e('0x10')][_0x8c5e('0x12')]);return _0x295f6(_0x38e358[_0x8c5e('0x10')][_0x8c5e('0x12')]);}else{logger[_0x8c5e('0x13')](_0x8c5e('0xb'),_0x54e8ac,'request\x20sent');_0x295f6(_0x38e358['result']['message']);}})[_0x8c5e('0x14')](function(_0x441ec6){logger[_0x8c5e('0x10')](_0x8c5e('0xb'),_0x54e8ac,_0x441ec6);_0x30bd7e(_0x441ec6);});});}exports[_0x8c5e('0x15')]=function(_0x2d520f){var _0x514578=this;return new Promise(function(_0x2363ad,_0x4d2f9b){return db[_0x8c5e('0x16')]['create'](_0x2d520f[_0x8c5e('0x17')],{'raw':_0x2d520f[_0x8c5e('0x18')]?_0x2d520f[_0x8c5e('0x18')][_0x8c5e('0x19')]===undefined?!![]:![]:!![]})[_0x8c5e('0xa')](function(_0x227f05){logger[_0x8c5e('0x13')]('CreateSquareRecording',_0x2d520f);logger[_0x8c5e('0xd')](_0x8c5e('0x15'),_0x2d520f,JSON[_0x8c5e('0xf')](_0x227f05));_0x2363ad(_0x227f05);})[_0x8c5e('0x14')](function(_0x123dd1){logger['error']('CreateSquareRecording',_0x123dd1[_0x8c5e('0x12')],_0x2d520f);_0x4d2f9b(_0x514578[_0x8c5e('0x10')](0x1f4,_0x123dd1[_0x8c5e('0x12')]));});});}; \ No newline at end of file +var _0x16fd=['result','CreateSquareRecording','SquareRecording','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message'];(function(_0x2df4d7,_0x57da82){var _0x40787a=function(_0x5e8a31){while(--_0x5e8a31){_0x2df4d7['push'](_0x2df4d7['shift']());}};_0x40787a(++_0x57da82);}(_0x16fd,0x1b5));var _0xd16f=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0x16fd[_0x2ef8c1];return _0x288305;};'use strict';var _=require(_0xd16f('0x0'));var util=require('util');var moment=require(_0xd16f('0x1'));var BPromise=require(_0xd16f('0x2'));var rs=require(_0xd16f('0x3'));var fs=require('fs');var Redis=require(_0xd16f('0x4'));var db=require(_0xd16f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd16f('0x6'))(_0xd16f('0x7'));var config=require('../../config/environment');var jayson=require(_0xd16f('0x8'));var client=jayson[_0xd16f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2fe5,_0x274430,_0x132140){return new BPromise(function(_0x114156,_0x87cbea){return client['request'](_0x3a2fe5,_0x132140)[_0xd16f('0xa')](function(_0x58d395){logger[_0xd16f('0xb')]('SquareRecording,\x20%s,\x20%s',_0x274430,_0xd16f('0xc'));logger['debug'](_0xd16f('0xd'),_0x274430,'request\x20sent',JSON[_0xd16f('0xe')](_0x58d395));if(_0x58d395[_0xd16f('0xf')]){if(_0x58d395[_0xd16f('0xf')][_0xd16f('0x10')]===0x1f4){logger[_0xd16f('0xf')](_0xd16f('0x11'),_0x274430,_0x58d395['error'][_0xd16f('0x12')]);return _0x87cbea(_0x58d395['error'][_0xd16f('0x12')]);}logger[_0xd16f('0xf')]('SquareRecording,\x20%s,\x20%s',_0x274430,_0x58d395[_0xd16f('0xf')]['message']);return _0x114156(_0x58d395['error'][_0xd16f('0x12')]);}else{logger[_0xd16f('0xb')](_0xd16f('0x11'),_0x274430,_0xd16f('0xc'));_0x114156(_0x58d395[_0xd16f('0x13')][_0xd16f('0x12')]);}})['catch'](function(_0x27f7f6){logger[_0xd16f('0xf')](_0xd16f('0x11'),_0x274430,_0x27f7f6);_0x87cbea(_0x27f7f6);});});}exports[_0xd16f('0x14')]=function(_0x4a6f05){var _0x51e9e6=this;return new Promise(function(_0x54881f,_0x4f4dad){return db[_0xd16f('0x15')]['create'](_0x4a6f05['body'],{'raw':_0x4a6f05[_0xd16f('0x16')]?_0x4a6f05[_0xd16f('0x16')][_0xd16f('0x17')]===undefined?!![]:![]:!![]})[_0xd16f('0xa')](function(_0x3f53e4){logger['info']('CreateSquareRecording',_0x4a6f05);logger['debug'](_0xd16f('0x14'),_0x4a6f05,JSON[_0xd16f('0xe')](_0x3f53e4));_0x54881f(_0x3f53e4);})['catch'](function(_0x227895){logger[_0xd16f('0xf')](_0xd16f('0x14'),_0x227895[_0xd16f('0x12')],_0x4a6f05);_0x4f4dad(_0x51e9e6[_0xd16f('0xf')](0x1f4,_0x227895[_0xd16f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 8e3ce75..344d970 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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x145d17,_0x38a899){var _0x5b7ec6=function(_0x51806f){while(--_0x51806f){_0x145d17['push'](_0x145d17['shift']());}};_0x5b7ec6(++_0x38a899);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x534dfb,_0x512008){var _0x55e9c2=function(_0x888092){while(--_0x888092){_0x534dfb['push'](_0x534dfb['shift']());}};_0x55e9c2(++_0x512008);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index af49701..6dccedf 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 _0x5323=['STRING','sequelize','exports'];(function(_0x3d6268,_0x9be257){var _0x18574e=function(_0x1740eb){while(--_0x1740eb){_0x3d6268['push'](_0x3d6268['shift']());}};_0x18574e(++_0x9be257);}(_0x5323,0x88));var _0x3532=function(_0xa1679a,_0x440677){_0xa1679a=_0xa1679a-0x0;var _0x3db958=_0x5323[_0xa1679a];return _0x3db958;};'use strict';var Sequelize=require(_0x3532('0x0'));module[_0x3532('0x1')]={'network':{'type':Sequelize[_0x3532('0x2')]},'network_script':{'type':Sequelize[_0x3532('0x2')]},'request':{'type':Sequelize[_0x3532('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3532('0x2')]},'type':{'type':Sequelize[_0x3532('0x2')]},'uniqueid':{'type':Sequelize[_0x3532('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x3532('0x2')]},'calleridname':{'type':Sequelize[_0x3532('0x2')]},'callingpres':{'type':Sequelize[_0x3532('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x3532('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x3532('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3532('0x2')]},'extension':{'type':Sequelize[_0x3532('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x3532('0x2')]},'accountcode':{'type':Sequelize[_0x3532('0x2')]},'threadid':{'type':Sequelize[_0x3532('0x2')]},'project_name':{'type':Sequelize[_0x3532('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd61e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3d0240,_0x21509a){var _0xdf8a7d=function(_0x5628a3){while(--_0x5628a3){_0x3d0240['push'](_0x3d0240['shift']());}};_0xdf8a7d(++_0x21509a);}(_0xd61e,0x13d));var _0xed61=function(_0x7496ee,_0x287ee6){_0x7496ee=_0x7496ee-0x0;var _0x481696=_0xd61e[_0x7496ee];return _0x481696;};'use strict';var Sequelize=require(_0xed61('0x0'));module[_0xed61('0x1')]={'network':{'type':Sequelize[_0xed61('0x2')]},'network_script':{'type':Sequelize[_0xed61('0x2')]},'request':{'type':Sequelize[_0xed61('0x2')]},'channel':{'type':Sequelize[_0xed61('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xed61('0x2')]},'uniqueid':{'type':Sequelize[_0xed61('0x2')]},'version':{'type':Sequelize[_0xed61('0x2')]},'callerid':{'type':Sequelize[_0xed61('0x2')]},'calleridname':{'type':Sequelize[_0xed61('0x2')]},'callingpres':{'type':Sequelize[_0xed61('0x2')]},'callingani2':{'type':Sequelize[_0xed61('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xed61('0x2')]},'priority':{'type':Sequelize[_0xed61('0x2')]},'enhanced':{'type':Sequelize[_0xed61('0x2')]},'accountcode':{'type':Sequelize[_0xed61('0x2')]},'threadid':{'type':Sequelize[_0xed61('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xed61('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index a1b99bb..b5e7e77 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 _0x965e=['keys','filters','query','attributes','intersection','fields','length','model','nolimit','order','sort','where','filter','merge','VIRTUAL','SquareReport','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','lodash','squel','crypto','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','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x965e,0x68));var _0xe965=function(_0x3a6c91,_0x58a5f9){_0x3a6c91=_0x3a6c91-0x0;var _0x2174e6=_0x965e[_0x3a6c91];return _0x2174e6;};'use strict';var emlformat=require(_0xe965('0x0'));var rimraf=require(_0xe965('0x1'));var zipdir=require(_0xe965('0x2'));var jsonpatch=require(_0xe965('0x3'));var rp=require(_0xe965('0x4'));var moment=require('moment');var BPromise=require(_0xe965('0x5'));var Mustache=require(_0xe965('0x6'));var util=require(_0xe965('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe965('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe965('0x9'));var squel=require(_0xe965('0xa'));var crypto=require(_0xe965('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe965('0xc'));var toCsv=require(_0xe965('0xd'));var querystring=require(_0xe965('0xe'));var Papa=require(_0xe965('0xf'));var Redis=require(_0xe965('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe965('0x11'));var as=require(_0xe965('0x12'));var hardwareService=require(_0xe965('0x13'));var logger=require(_0xe965('0x14'))(_0xe965('0x15'));var utils=require(_0xe965('0x16'));var config=require(_0xe965('0x17'));var licenseUtil=require(_0xe965('0x18'));var db=require(_0xe965('0x19'))['db'];function respondWithStatusCode(_0x47c05f,_0x117d3c){_0x117d3c=_0x117d3c||0xcc;return function(_0x3b0237){if(_0x3b0237){return _0x47c05f[_0xe965('0x1a')](_0x117d3c);}return _0x47c05f[_0xe965('0x1b')](_0x117d3c)[_0xe965('0x1c')]();};}function respondWithResult(_0x3d41e5,_0x2d85ba){_0x2d85ba=_0x2d85ba||0xc8;return function(_0x3c5561){if(_0x3c5561){return _0x3d41e5[_0xe965('0x1b')](_0x2d85ba)[_0xe965('0x1d')](_0x3c5561);}};}function respondWithFilteredResult(_0x536629,_0x3dde2c){return function(_0x174494){if(_0x174494){var _0x398063=typeof _0x3dde2c['offset']==='undefined'&&typeof _0x3dde2c[_0xe965('0x1e')]===_0xe965('0x1f');var _0x3ad31d=_0x174494[_0xe965('0x20')];var _0x2cd250=_0x398063?0x0:_0x3dde2c['offset'];var _0x401a16=_0x398063?_0x174494[_0xe965('0x20')]:_0x3dde2c[_0xe965('0x21')]+_0x3dde2c['limit'];var _0x150ca2;if(_0x401a16>=_0x3ad31d){_0x401a16=_0x3ad31d;_0x150ca2=0xc8;}else{_0x150ca2=0xce;}_0x536629[_0xe965('0x1b')](_0x150ca2);return _0x536629[_0xe965('0x22')](_0xe965('0x23'),_0x2cd250+'-'+_0x401a16+'/'+_0x3ad31d)[_0xe965('0x1d')](_0x174494);}return null;};}function patchUpdates(_0x5d2ac5){return function(_0x45a3f0){try{jsonpatch[_0xe965('0x24')](_0x45a3f0,_0x5d2ac5,!![]);}catch(_0x556ed8){return BPromise[_0xe965('0x25')](_0x556ed8);}return _0x45a3f0[_0xe965('0x26')]();};}function saveUpdates(_0x4a0928,_0x5b64b4){return function(_0x14a381){if(_0x14a381){return _0x14a381[_0xe965('0x27')](_0x4a0928)[_0xe965('0x28')](function(_0x31d7b3){return _0x31d7b3;});}return null;};}function removeEntity(_0x55dfa4,_0x582df2){return function(_0x246559){if(_0x246559){return _0x246559[_0xe965('0x29')]()['then'](function(){_0x55dfa4[_0xe965('0x1b')](0xcc)[_0xe965('0x1c')]();});}};}function handleEntityNotFound(_0x55c075,_0x390bf8){return function(_0x426d59){if(!_0x426d59){_0x55c075['sendStatus'](0x194);}return _0x426d59;};}function handleError(_0x2a21f5,_0x837ffc){_0x837ffc=_0x837ffc||0x1f4;return function(_0x459e8d){logger[_0xe965('0x2a')](_0x459e8d[_0xe965('0x2b')]);if(_0x459e8d[_0xe965('0x2c')]){delete _0x459e8d[_0xe965('0x2c')];}_0x2a21f5[_0xe965('0x1b')](_0x837ffc)['send'](_0x459e8d);};}exports[_0xe965('0x2d')]=function(_0x29f21c,_0x14b0cb){var _0x3a7360={},_0x2d05d={},_0xb8a545={'count':0x0,'rows':[]};var _0x119d91=_[_0xe965('0x2e')](db['SquareReport'][_0xe965('0x2f')],function(_0x21682a){return{'name':_0x21682a[_0xe965('0x30')],'type':_0x21682a[_0xe965('0x31')]['key']};});_0x2d05d['model']=_[_0xe965('0x2e')](_0x119d91,_0xe965('0x2c'));_0x2d05d['query']=_[_0xe965('0x32')](_0x29f21c['query']);_0x2d05d[_0xe965('0x33')]=_['intersection'](_0x2d05d['model'],_0x2d05d[_0xe965('0x34')]);_0x3a7360[_0xe965('0x35')]=_[_0xe965('0x36')](_0x2d05d['model'],qs[_0xe965('0x37')](_0x29f21c[_0xe965('0x34')][_0xe965('0x37')]));_0x3a7360[_0xe965('0x35')]=_0x3a7360[_0xe965('0x35')][_0xe965('0x38')]?_0x3a7360[_0xe965('0x35')]:_0x2d05d[_0xe965('0x39')];if(!_0x29f21c[_0xe965('0x34')]['hasOwnProperty'](_0xe965('0x3a'))){_0x3a7360[_0xe965('0x1e')]=qs[_0xe965('0x1e')](_0x29f21c[_0xe965('0x34')]['limit']);_0x3a7360['offset']=qs[_0xe965('0x21')](_0x29f21c[_0xe965('0x34')][_0xe965('0x21')]);}_0x3a7360[_0xe965('0x3b')]=qs[_0xe965('0x3c')](_0x29f21c['query'][_0xe965('0x3c')]);_0x3a7360[_0xe965('0x3d')]=qs[_0xe965('0x33')](_['pick'](_0x29f21c['query'],_0x2d05d['filters']),_0x119d91);if(_0x29f21c['query'][_0xe965('0x3e')]){_0x3a7360['where']=_[_0xe965('0x3f')](_0x3a7360[_0xe965('0x3d')],{'$or':_[_0xe965('0x2e')](_0x119d91,function(_0x35e96d){if(_0x35e96d[_0xe965('0x31')]!==_0xe965('0x40')){var _0x4d4ef1={};_0x4d4ef1[_0x35e96d[_0xe965('0x2c')]]={'$like':'%'+_0x29f21c[_0xe965('0x34')]['filter']+'%'};return _0x4d4ef1;}})});}_0x3a7360=_[_0xe965('0x3f')]({},_0x3a7360,_0x29f21c['options']);var _0x464568={'where':_0x3a7360[_0xe965('0x3d')]};return db['SquareReport']['count'](_0x464568)[_0xe965('0x28')](function(_0x642734){_0xb8a545['count']=_0x642734;if(_0x29f21c[_0xe965('0x34')]['includeAll']){_0x3a7360['include']=[{'all':!![]}];}return db[_0xe965('0x41')][_0xe965('0x42')](_0x3a7360);})[_0xe965('0x28')](function(_0x26fe83){_0xb8a545[_0xe965('0x43')]=_0x26fe83;return _0xb8a545;})[_0xe965('0x28')](respondWithFilteredResult(_0x14b0cb,_0x3a7360))[_0xe965('0x44')](handleError(_0x14b0cb,null));};exports[_0xe965('0x45')]=function(_0x3e44db,_0x4d6bf4){var _0x1d1266={'raw':!![],'where':{'id':_0x3e44db[_0xe965('0x46')]['id']}},_0x2c878c={};_0x2c878c[_0xe965('0x39')]=_[_0xe965('0x32')](db[_0xe965('0x41')][_0xe965('0x2f')]);_0x2c878c[_0xe965('0x34')]=_[_0xe965('0x32')](_0x3e44db[_0xe965('0x34')]);_0x2c878c[_0xe965('0x33')]=_[_0xe965('0x36')](_0x2c878c[_0xe965('0x39')],_0x2c878c[_0xe965('0x34')]);_0x1d1266[_0xe965('0x35')]=_['intersection'](_0x2c878c[_0xe965('0x39')],qs[_0xe965('0x37')](_0x3e44db[_0xe965('0x34')][_0xe965('0x37')]));_0x1d1266['attributes']=_0x1d1266[_0xe965('0x35')][_0xe965('0x38')]?_0x1d1266[_0xe965('0x35')]:_0x2c878c[_0xe965('0x39')];if(_0x3e44db['query'][_0xe965('0x47')]){_0x1d1266['include']=[{'all':!![]}];}_0x1d1266=_[_0xe965('0x3f')]({},_0x1d1266,_0x3e44db[_0xe965('0x48')]);return db[_0xe965('0x41')][_0xe965('0x49')](_0x1d1266)['then'](handleEntityNotFound(_0x4d6bf4,null))[_0xe965('0x28')](respondWithResult(_0x4d6bf4,null))[_0xe965('0x44')](handleError(_0x4d6bf4,null));};exports[_0xe965('0x4a')]=function(_0x802015,_0x4dee51){return db[_0xe965('0x41')][_0xe965('0x4a')](_0x802015['body'],{})['then'](respondWithResult(_0x4dee51,0xc9))['catch'](handleError(_0x4dee51,null));};exports[_0xe965('0x27')]=function(_0x521479,_0x5dba1e){if(_0x521479[_0xe965('0x4b')]['id']){delete _0x521479['body']['id'];}return db[_0xe965('0x41')][_0xe965('0x49')]({'where':{'id':_0x521479['params']['id']}})[_0xe965('0x28')](handleEntityNotFound(_0x5dba1e,null))[_0xe965('0x28')](saveUpdates(_0x521479[_0xe965('0x4b')],null))[_0xe965('0x28')](respondWithResult(_0x5dba1e,null))[_0xe965('0x44')](handleError(_0x5dba1e,null));};exports[_0xe965('0x29')]=function(_0x524c85,_0x4cc37d){return db[_0xe965('0x41')][_0xe965('0x49')]({'where':{'id':_0x524c85[_0xe965('0x46')]['id']}})[_0xe965('0x28')](handleEntityNotFound(_0x4cc37d,null))[_0xe965('0x28')](removeEntity(_0x4cc37d,null))[_0xe965('0x44')](handleError(_0x4cc37d,null));};exports[_0xe965('0x4c')]=function(_0x17d664,_0x231e1e){return db[_0xe965('0x41')][_0xe965('0x4c')]()[_0xe965('0x28')](respondWithResult(_0x231e1e,null))[_0xe965('0x44')](handleError(_0x231e1e,null));}; \ No newline at end of file +var _0x8530=['create','body','find','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','filters','length','options'];(function(_0x34215d,_0x4a0d80){var _0x20e9bd=function(_0x3dc835){while(--_0x3dc835){_0x34215d['push'](_0x34215d['shift']());}};_0x20e9bd(++_0x4a0d80);}(_0x8530,0xf4));var _0x0853=function(_0x2af34a,_0x4e3d01){_0x2af34a=_0x2af34a-0x0;var _0x26fe52=_0x8530[_0x2af34a];return _0x26fe52;};'use strict';var emlformat=require(_0x0853('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0853('0x1'));var moment=require(_0x0853('0x2'));var BPromise=require(_0x0853('0x3'));var Mustache=require(_0x0853('0x4'));var util=require(_0x0853('0x5'));var path=require(_0x0853('0x6'));var sox=require(_0x0853('0x7'));var csv=require('to-csv');var ejs=require(_0x0853('0x8'));var fs=require('fs');var fs_extra=require(_0x0853('0x9'));var _=require(_0x0853('0xa'));var squel=require(_0x0853('0xb'));var crypto=require(_0x0853('0xc'));var jsforce=require(_0x0853('0xd'));var deskjs=require(_0x0853('0xe'));var toCsv=require(_0x0853('0xf'));var querystring=require('querystring');var Papa=require(_0x0853('0x10'));var Redis=require(_0x0853('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0853('0x12'));var as=require(_0x0853('0x13'));var hardwareService=require(_0x0853('0x14'));var logger=require(_0x0853('0x15'))(_0x0853('0x16'));var utils=require('../../config/utils');var config=require(_0x0853('0x17'));var licenseUtil=require(_0x0853('0x18'));var db=require(_0x0853('0x19'))['db'];function respondWithStatusCode(_0x27fe96,_0x45fe1c){_0x45fe1c=_0x45fe1c||0xcc;return function(_0x4b061d){if(_0x4b061d){return _0x27fe96[_0x0853('0x1a')](_0x45fe1c);}return _0x27fe96[_0x0853('0x1b')](_0x45fe1c)[_0x0853('0x1c')]();};}function respondWithResult(_0x3c9722,_0xcf9a5){_0xcf9a5=_0xcf9a5||0xc8;return function(_0x599877){if(_0x599877){return _0x3c9722[_0x0853('0x1b')](_0xcf9a5)[_0x0853('0x1d')](_0x599877);}};}function respondWithFilteredResult(_0x3a494a,_0x856ecc){return function(_0x4f558d){if(_0x4f558d){var _0x3720c5=typeof _0x856ecc[_0x0853('0x1e')]===_0x0853('0x1f')&&typeof _0x856ecc[_0x0853('0x20')]===_0x0853('0x1f');var _0x278565=_0x4f558d['count'];var _0x394e33=_0x3720c5?0x0:_0x856ecc['offset'];var _0x2f1f01=_0x3720c5?_0x4f558d[_0x0853('0x21')]:_0x856ecc[_0x0853('0x1e')]+_0x856ecc[_0x0853('0x20')];var _0x343e61;if(_0x2f1f01>=_0x278565){_0x2f1f01=_0x278565;_0x343e61=0xc8;}else{_0x343e61=0xce;}_0x3a494a[_0x0853('0x1b')](_0x343e61);return _0x3a494a[_0x0853('0x22')](_0x0853('0x23'),_0x394e33+'-'+_0x2f1f01+'/'+_0x278565)[_0x0853('0x1d')](_0x4f558d);}return null;};}function patchUpdates(_0x3c2ece){return function(_0x15db4f){try{jsonpatch[_0x0853('0x24')](_0x15db4f,_0x3c2ece,!![]);}catch(_0x54c247){return BPromise[_0x0853('0x25')](_0x54c247);}return _0x15db4f[_0x0853('0x26')]();};}function saveUpdates(_0x272ecb,_0x96e4e6){return function(_0x3a52d1){if(_0x3a52d1){return _0x3a52d1[_0x0853('0x27')](_0x272ecb)[_0x0853('0x28')](function(_0x184545){return _0x184545;});}return null;};}function removeEntity(_0x43b39e,_0x17b836){return function(_0x488c0a){if(_0x488c0a){return _0x488c0a[_0x0853('0x29')]()[_0x0853('0x28')](function(){_0x43b39e[_0x0853('0x1b')](0xcc)[_0x0853('0x1c')]();});}};}function handleEntityNotFound(_0x551f8a,_0x29700c){return function(_0x3172c3){if(!_0x3172c3){_0x551f8a[_0x0853('0x1a')](0x194);}return _0x3172c3;};}function handleError(_0x40a117,_0x4c0192){_0x4c0192=_0x4c0192||0x1f4;return function(_0x54733e){logger[_0x0853('0x2a')](_0x54733e['stack']);if(_0x54733e[_0x0853('0x2b')]){delete _0x54733e[_0x0853('0x2b')];}_0x40a117['status'](_0x4c0192)['send'](_0x54733e);};}exports[_0x0853('0x2c')]=function(_0x10f59a,_0x5b1570){var _0x23e0f3={},_0x25ad54={},_0xdfb16e={'count':0x0,'rows':[]};var _0x3a82f6=_[_0x0853('0x2d')](db[_0x0853('0x2e')][_0x0853('0x2f')],function(_0x1b05c1){return{'name':_0x1b05c1[_0x0853('0x30')],'type':_0x1b05c1[_0x0853('0x31')][_0x0853('0x32')]};});_0x25ad54[_0x0853('0x33')]=_[_0x0853('0x2d')](_0x3a82f6,_0x0853('0x2b'));_0x25ad54[_0x0853('0x34')]=_[_0x0853('0x35')](_0x10f59a[_0x0853('0x34')]);_0x25ad54['filters']=_[_0x0853('0x36')](_0x25ad54[_0x0853('0x33')],_0x25ad54[_0x0853('0x34')]);_0x23e0f3['attributes']=_[_0x0853('0x36')](_0x25ad54[_0x0853('0x33')],qs[_0x0853('0x37')](_0x10f59a[_0x0853('0x34')][_0x0853('0x37')]));_0x23e0f3[_0x0853('0x38')]=_0x23e0f3[_0x0853('0x38')]['length']?_0x23e0f3[_0x0853('0x38')]:_0x25ad54[_0x0853('0x33')];if(!_0x10f59a['query'][_0x0853('0x39')](_0x0853('0x3a'))){_0x23e0f3[_0x0853('0x20')]=qs['limit'](_0x10f59a[_0x0853('0x34')][_0x0853('0x20')]);_0x23e0f3[_0x0853('0x1e')]=qs['offset'](_0x10f59a[_0x0853('0x34')][_0x0853('0x1e')]);}_0x23e0f3[_0x0853('0x3b')]=qs[_0x0853('0x3c')](_0x10f59a[_0x0853('0x34')][_0x0853('0x3c')]);_0x23e0f3[_0x0853('0x3d')]=qs['filters'](_[_0x0853('0x3e')](_0x10f59a[_0x0853('0x34')],_0x25ad54['filters']),_0x3a82f6);if(_0x10f59a[_0x0853('0x34')][_0x0853('0x3f')]){_0x23e0f3[_0x0853('0x3d')]=_[_0x0853('0x40')](_0x23e0f3[_0x0853('0x3d')],{'$or':_['map'](_0x3a82f6,function(_0x56f2a3){if(_0x56f2a3[_0x0853('0x31')]!==_0x0853('0x41')){var _0x321330={};_0x321330[_0x56f2a3['name']]={'$like':'%'+_0x10f59a['query']['filter']+'%'};return _0x321330;}})});}_0x23e0f3=_[_0x0853('0x40')]({},_0x23e0f3,_0x10f59a['options']);var _0x22a4ff={'where':_0x23e0f3[_0x0853('0x3d')]};return db[_0x0853('0x2e')][_0x0853('0x21')](_0x22a4ff)[_0x0853('0x28')](function(_0x3b356b){_0xdfb16e['count']=_0x3b356b;if(_0x10f59a[_0x0853('0x34')][_0x0853('0x42')]){_0x23e0f3[_0x0853('0x43')]=[{'all':!![]}];}return db[_0x0853('0x2e')][_0x0853('0x44')](_0x23e0f3);})[_0x0853('0x28')](function(_0x28af8a){_0xdfb16e[_0x0853('0x45')]=_0x28af8a;return _0xdfb16e;})[_0x0853('0x28')](respondWithFilteredResult(_0x5b1570,_0x23e0f3))[_0x0853('0x46')](handleError(_0x5b1570,null));};exports[_0x0853('0x47')]=function(_0x2eab6c,_0x2d3858){var _0xeddad3={'raw':!![],'where':{'id':_0x2eab6c[_0x0853('0x48')]['id']}},_0x433224={};_0x433224['model']=_['keys'](db[_0x0853('0x2e')][_0x0853('0x2f')]);_0x433224[_0x0853('0x34')]=_[_0x0853('0x35')](_0x2eab6c[_0x0853('0x34')]);_0x433224[_0x0853('0x49')]=_[_0x0853('0x36')](_0x433224[_0x0853('0x33')],_0x433224[_0x0853('0x34')]);_0xeddad3['attributes']=_[_0x0853('0x36')](_0x433224[_0x0853('0x33')],qs[_0x0853('0x37')](_0x2eab6c['query'][_0x0853('0x37')]));_0xeddad3[_0x0853('0x38')]=_0xeddad3[_0x0853('0x38')][_0x0853('0x4a')]?_0xeddad3['attributes']:_0x433224[_0x0853('0x33')];if(_0x2eab6c[_0x0853('0x34')][_0x0853('0x42')]){_0xeddad3[_0x0853('0x43')]=[{'all':!![]}];}_0xeddad3=_[_0x0853('0x40')]({},_0xeddad3,_0x2eab6c[_0x0853('0x4b')]);return db[_0x0853('0x2e')]['find'](_0xeddad3)['then'](handleEntityNotFound(_0x2d3858,null))['then'](respondWithResult(_0x2d3858,null))['catch'](handleError(_0x2d3858,null));};exports[_0x0853('0x4c')]=function(_0x5304ff,_0x327319){return db[_0x0853('0x2e')][_0x0853('0x4c')](_0x5304ff[_0x0853('0x4d')],{})[_0x0853('0x28')](respondWithResult(_0x327319,0xc9))['catch'](handleError(_0x327319,null));};exports[_0x0853('0x27')]=function(_0x12f7bc,_0x5c2d0b){if(_0x12f7bc[_0x0853('0x4d')]['id']){delete _0x12f7bc[_0x0853('0x4d')]['id'];}return db['SquareReport'][_0x0853('0x4e')]({'where':{'id':_0x12f7bc[_0x0853('0x48')]['id']}})[_0x0853('0x28')](handleEntityNotFound(_0x5c2d0b,null))['then'](saveUpdates(_0x12f7bc[_0x0853('0x4d')],null))[_0x0853('0x28')](respondWithResult(_0x5c2d0b,null))[_0x0853('0x46')](handleError(_0x5c2d0b,null));};exports[_0x0853('0x29')]=function(_0x49218f,_0xf123e7){return db[_0x0853('0x2e')]['find']({'where':{'id':_0x49218f[_0x0853('0x48')]['id']}})[_0x0853('0x28')](handleEntityNotFound(_0xf123e7,null))['then'](removeEntity(_0xf123e7,null))[_0x0853('0x46')](handleError(_0xf123e7,null));};exports[_0x0853('0x4f')]=function(_0x3ccd9c,_0x3cccea){return db[_0x0853('0x2e')][_0x0853('0x4f')]()[_0x0853('0x28')](respondWithResult(_0x3cccea,null))[_0x0853('0x46')](handleError(_0x3cccea,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 962099b..65d39e9 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 _0x7c7c=['path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5e3054,_0xc04840){var _0x4834c9=function(_0x5bd72e){while(--_0x5bd72e){_0x5e3054['push'](_0x5e3054['shift']());}};_0x4834c9(++_0xc04840);}(_0x7c7c,0x12b));var _0xc7c7=function(_0x403833,_0x2b4869){_0x403833=_0x403833-0x0;var _0x1e659a=_0x7c7c[_0x403833];return _0x1e659a;};'use strict';var _=require('lodash');var util=require(_0xc7c7('0x0'));var logger=require(_0xc7c7('0x1'))(_0xc7c7('0x2'));var moment=require('moment');var BPromise=require(_0xc7c7('0x3'));var rp=require(_0xc7c7('0x4'));var fs=require('fs');var path=require(_0xc7c7('0x5'));var rimraf=require(_0xc7c7('0x6'));var config=require(_0xc7c7('0x7'));var attributes=require(_0xc7c7('0x8'));module['exports']=function(_0x3dc3bc,_0xb92791){return _0x3dc3bc[_0xc7c7('0x9')](_0xc7c7('0xa'),attributes,{'tableName':_0xc7c7('0xb'),'paranoid':![],'indexes':[{'name':_0xc7c7('0xc'),'fields':[_0xc7c7('0xd'),_0xc7c7('0xe')]},{'name':_0xc7c7('0xf'),'fields':[_0xc7c7('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa639=['../../config/logger','api','moment','request-promise','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util'];(function(_0x4a0c35,_0x457442){var _0x564b17=function(_0x5bdb85){while(--_0x5bdb85){_0x4a0c35['push'](_0x4a0c35['shift']());}};_0x564b17(++_0x457442);}(_0xa639,0x11e));var _0x9a63=function(_0x536cd5,_0x18c540){_0x536cd5=_0x536cd5-0x0;var _0x1be13e=_0xa639[_0x536cd5];return _0x1be13e;};'use strict';var _=require(_0x9a63('0x0'));var util=require(_0x9a63('0x1'));var logger=require(_0x9a63('0x2'))(_0x9a63('0x3'));var moment=require(_0x9a63('0x4'));var BPromise=require('bluebird');var rp=require(_0x9a63('0x5'));var fs=require('fs');var path=require(_0x9a63('0x6'));var rimraf=require('rimraf');var config=require(_0x9a63('0x7'));var attributes=require(_0x9a63('0x8'));module[_0x9a63('0x9')]=function(_0x1e3902,_0xf951e9){return _0x1e3902[_0x9a63('0xa')](_0x9a63('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x9a63('0xc'),'fields':[_0x9a63('0xd'),_0x9a63('0xe')]},{'name':_0x9a63('0xf'),'fields':[_0x9a63('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 8ab590a..07fe566 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 _0xfea4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateSquareReport','create','options','raw','stringify','SquareReport','update','body','where','attributes','UpdateSquareReport','util','moment','bluebird','randomstring'];(function(_0x5e0944,_0x10a56f){var _0x159edb=function(_0x17e682){while(--_0x17e682){_0x5e0944['push'](_0x5e0944['shift']());}};_0x159edb(++_0x10a56f);}(_0xfea4,0x1ac));var _0x4fea=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0xfea4[_0x2b5513];return _0x578fd2;};'use strict';var _=require('lodash');var util=require(_0x4fea('0x0'));var moment=require(_0x4fea('0x1'));var BPromise=require(_0x4fea('0x2'));var rs=require(_0x4fea('0x3'));var fs=require('fs');var Redis=require(_0x4fea('0x4'));var db=require(_0x4fea('0x5'))['db'];var utils=require(_0x4fea('0x6'));var logger=require(_0x4fea('0x7'))(_0x4fea('0x8'));var config=require(_0x4fea('0x9'));var jayson=require(_0x4fea('0xa'));var client=jayson[_0x4fea('0xb')][_0x4fea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x514c93,_0x19e876,_0x2da55f){return new BPromise(function(_0x4cc9a5,_0x4283f4){return client[_0x4fea('0xd')](_0x514c93,_0x2da55f)[_0x4fea('0xe')](function(_0x48f788){logger['info'](_0x4fea('0xf'),_0x19e876,_0x4fea('0x10'));logger[_0x4fea('0x11')](_0x4fea('0x12'),_0x19e876,_0x4fea('0x10'),JSON['stringify'](_0x48f788));if(_0x48f788[_0x4fea('0x13')]){if(_0x48f788[_0x4fea('0x13')][_0x4fea('0x14')]===0x1f4){logger[_0x4fea('0x13')](_0x4fea('0xf'),_0x19e876,_0x48f788[_0x4fea('0x13')][_0x4fea('0x15')]);return _0x4283f4(_0x48f788[_0x4fea('0x13')][_0x4fea('0x15')]);}logger[_0x4fea('0x13')](_0x4fea('0xf'),_0x19e876,_0x48f788[_0x4fea('0x13')][_0x4fea('0x15')]);return _0x4cc9a5(_0x48f788[_0x4fea('0x13')]['message']);}else{logger[_0x4fea('0x16')](_0x4fea('0xf'),_0x19e876,'request\x20sent');_0x4cc9a5(_0x48f788[_0x4fea('0x17')][_0x4fea('0x15')]);}})[_0x4fea('0x18')](function(_0x53648f){logger[_0x4fea('0x13')](_0x4fea('0xf'),_0x19e876,_0x53648f);_0x4283f4(_0x53648f);});});}exports[_0x4fea('0x19')]=function(_0x50216d){var _0x86c4ee=this;return new Promise(function(_0x57fae3,_0x56d613){return db['SquareReport'][_0x4fea('0x1a')](_0x50216d['body'],{'raw':_0x50216d[_0x4fea('0x1b')]?_0x50216d['options'][_0x4fea('0x1c')]===undefined?!![]:![]:!![]})[_0x4fea('0xe')](function(_0x11076e){logger['info'](_0x4fea('0x19'),_0x50216d);logger[_0x4fea('0x11')](_0x4fea('0x19'),_0x50216d,JSON[_0x4fea('0x1d')](_0x11076e));_0x57fae3(_0x11076e);})[_0x4fea('0x18')](function(_0x38e77a){logger['error']('CreateSquareReport',_0x38e77a[_0x4fea('0x15')],_0x50216d);_0x56d613(_0x86c4ee[_0x4fea('0x13')](0x1f4,_0x38e77a['message']));});});};exports['UpdateSquareReport']=function(_0x27981e){var _0x44e066=this;return new Promise(function(_0x2d8d70,_0x1bab84){return db[_0x4fea('0x1e')][_0x4fea('0x1f')](_0x27981e[_0x4fea('0x20')],{'raw':_0x27981e[_0x4fea('0x1b')]?_0x27981e[_0x4fea('0x1b')][_0x4fea('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27981e[_0x4fea('0x1b')]?_0x27981e[_0x4fea('0x1b')][_0x4fea('0x21')]||null:null,'attributes':_0x27981e[_0x4fea('0x1b')]?_0x27981e['options'][_0x4fea('0x22')]||null:null,'limit':_0x27981e['options']?_0x27981e[_0x4fea('0x1b')]['limit']||null:null})[_0x4fea('0xe')](function(_0x5f2569){logger[_0x4fea('0x16')](_0x4fea('0x23'),_0x27981e);logger['debug'](_0x4fea('0x23'),_0x27981e,JSON[_0x4fea('0x1d')](_0x5f2569));_0x2d8d70(_0x5f2569);})[_0x4fea('0x18')](function(_0x4db474){logger[_0x4fea('0x13')](_0x4fea('0x23'),_0x4db474[_0x4fea('0x15')],_0x27981e);_0x1bab84(_0x44e066[_0x4fea('0x13')](0x1f4,_0x4db474[_0x4fea('0x15')]));});});}; \ No newline at end of file +var _0x4ad7=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','SquareReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','CreateSquareReport','SquareReport','body','options','raw','catch','UpdateSquareReport','stringify','lodash'];(function(_0x24f2dc,_0x4ad7e6){var _0x2becfe=function(_0x557a00){while(--_0x557a00){_0x24f2dc['push'](_0x24f2dc['shift']());}};_0x2becfe(++_0x4ad7e6);}(_0x4ad7,0xcf));var _0x74ad=function(_0x20d919,_0x106eb9){_0x20d919=_0x20d919-0x0;var _0x2726b0=_0x4ad7[_0x20d919];return _0x2726b0;};'use strict';var _=require(_0x74ad('0x0'));var util=require('util');var moment=require(_0x74ad('0x1'));var BPromise=require(_0x74ad('0x2'));var rs=require(_0x74ad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x74ad('0x4'));var logger=require(_0x74ad('0x5'))(_0x74ad('0x6'));var config=require('../../config/environment');var jayson=require(_0x74ad('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d197e,_0x43bde0,_0x496c72){return new BPromise(function(_0x2e065d,_0x2213ef){return client[_0x74ad('0x8')](_0x5d197e,_0x496c72)[_0x74ad('0x9')](function(_0x21f0de){logger[_0x74ad('0xa')](_0x74ad('0xb'),_0x43bde0,'request\x20sent');logger[_0x74ad('0xc')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x43bde0,_0x74ad('0xd'),JSON['stringify'](_0x21f0de));if(_0x21f0de['error']){if(_0x21f0de[_0x74ad('0xe')][_0x74ad('0xf')]===0x1f4){logger['error'](_0x74ad('0xb'),_0x43bde0,_0x21f0de[_0x74ad('0xe')][_0x74ad('0x10')]);return _0x2213ef(_0x21f0de[_0x74ad('0xe')]['message']);}logger[_0x74ad('0xe')](_0x74ad('0xb'),_0x43bde0,_0x21f0de[_0x74ad('0xe')][_0x74ad('0x10')]);return _0x2e065d(_0x21f0de['error']['message']);}else{logger['info'](_0x74ad('0xb'),_0x43bde0,_0x74ad('0xd'));_0x2e065d(_0x21f0de[_0x74ad('0x11')][_0x74ad('0x10')]);}})['catch'](function(_0x4d989e){logger[_0x74ad('0xe')](_0x74ad('0xb'),_0x43bde0,_0x4d989e);_0x2213ef(_0x4d989e);});});}exports[_0x74ad('0x12')]=function(_0x3689dd){var _0x17c092=this;return new Promise(function(_0x323430,_0x1ae39b){return db[_0x74ad('0x13')]['create'](_0x3689dd[_0x74ad('0x14')],{'raw':_0x3689dd[_0x74ad('0x15')]?_0x3689dd[_0x74ad('0x15')][_0x74ad('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x4962d8){logger['info']('CreateSquareReport',_0x3689dd);logger['debug']('CreateSquareReport',_0x3689dd,JSON['stringify'](_0x4962d8));_0x323430(_0x4962d8);})[_0x74ad('0x17')](function(_0x1c760c){logger[_0x74ad('0xe')](_0x74ad('0x12'),_0x1c760c[_0x74ad('0x10')],_0x3689dd);_0x1ae39b(_0x17c092[_0x74ad('0xe')](0x1f4,_0x1c760c[_0x74ad('0x10')]));});});};exports[_0x74ad('0x18')]=function(_0x5e90c1){var _0x48ada1=this;return new Promise(function(_0x54c008,_0x5c2f98){return db[_0x74ad('0x13')]['update'](_0x5e90c1[_0x74ad('0x14')],{'raw':_0x5e90c1['options']?_0x5e90c1[_0x74ad('0x15')][_0x74ad('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e90c1[_0x74ad('0x15')]?_0x5e90c1[_0x74ad('0x15')]['where']||null:null,'attributes':_0x5e90c1[_0x74ad('0x15')]?_0x5e90c1[_0x74ad('0x15')]['attributes']||null:null,'limit':_0x5e90c1['options']?_0x5e90c1['options']['limit']||null:null})[_0x74ad('0x9')](function(_0x5632a1){logger[_0x74ad('0xa')](_0x74ad('0x18'),_0x5e90c1);logger[_0x74ad('0xc')]('UpdateSquareReport',_0x5e90c1,JSON[_0x74ad('0x19')](_0x5632a1));_0x54c008(_0x5632a1);})[_0x74ad('0x17')](function(_0x2b0605){logger[_0x74ad('0xe')](_0x74ad('0x18'),_0x2b0605[_0x74ad('0x10')],_0x5e90c1);_0x5c2f98(_0x48ada1[_0x74ad('0xe')](0x1f4,_0x2b0605[_0x74ad('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 6d7c38a..1789b0f 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 _0x8ea4=['put','update','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x2417ef,_0x2b4f11){var _0x2a19cf=function(_0x440ad0){while(--_0x440ad0){_0x2417ef['push'](_0x2417ef['shift']());}};_0x2a19cf(++_0x2b4f11);}(_0x8ea4,0x16c));var _0x48ea=function(_0x11aee5,_0x27fa94){_0x11aee5=_0x11aee5-0x0;var _0x2e8c9d=_0x8ea4[_0x11aee5];return _0x2e8c9d;};'use strict';var multer=require(_0x48ea('0x0'));var util=require('util');var path=require(_0x48ea('0x1'));var timeout=require(_0x48ea('0x2'));var express=require('express');var router=express[_0x48ea('0x3')]();var fs_extra=require(_0x48ea('0x4'));var auth=require(_0x48ea('0x5'));var interaction=require(_0x48ea('0x6'));var config=require(_0x48ea('0x7'));var controller=require('./squareReportDetail.controller');router[_0x48ea('0x8')]('/',auth[_0x48ea('0x9')](),controller[_0x48ea('0xa')]);router[_0x48ea('0x8')](_0x48ea('0xb'),auth[_0x48ea('0x9')](),controller[_0x48ea('0xc')]);router[_0x48ea('0x8')](_0x48ea('0xd'),auth['isAuthenticated'](),controller[_0x48ea('0xe')]);router[_0x48ea('0xf')]('/',auth[_0x48ea('0x9')](),controller['create']);router[_0x48ea('0x10')]('/:id',auth[_0x48ea('0x9')](),controller[_0x48ea('0x11')]);router['delete']('/:id',auth[_0x48ea('0x9')](),controller[_0x48ea('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb6ad=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x1d1172,_0x5ecc98){var _0x4a30ad=function(_0x4483b7){while(--_0x4483b7){_0x1d1172['push'](_0x1d1172['shift']());}};_0x4a30ad(++_0x5ecc98);}(_0xb6ad,0x165));var _0xdb6a=function(_0x26d0ff,_0x3cdbf5){_0x26d0ff=_0x26d0ff-0x0;var _0x5c8866=_0xb6ad[_0x26d0ff];return _0x5c8866;};'use strict';var multer=require(_0xdb6a('0x0'));var util=require(_0xdb6a('0x1'));var path=require(_0xdb6a('0x2'));var timeout=require(_0xdb6a('0x3'));var express=require(_0xdb6a('0x4'));var router=express[_0xdb6a('0x5')]();var fs_extra=require(_0xdb6a('0x6'));var auth=require(_0xdb6a('0x7'));var interaction=require(_0xdb6a('0x8'));var config=require(_0xdb6a('0x9'));var controller=require(_0xdb6a('0xa'));router[_0xdb6a('0xb')]('/',auth[_0xdb6a('0xc')](),controller[_0xdb6a('0xd')]);router[_0xdb6a('0xb')]('/describe',auth[_0xdb6a('0xc')](),controller[_0xdb6a('0xe')]);router[_0xdb6a('0xb')](_0xdb6a('0xf'),auth[_0xdb6a('0xc')](),controller[_0xdb6a('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdb6a('0x11')]);router[_0xdb6a('0x12')]('/:id',auth[_0xdb6a('0xc')](),controller['update']);router[_0xdb6a('0x13')](_0xdb6a('0xf'),auth['isAuthenticated'](),controller[_0xdb6a('0x14')]);module[_0xdb6a('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 1483768..3e8d539 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 _0xd866=['STRING','TEXT'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd866,0xdc));var _0x6d86=function(_0x3890d7,_0x5d6229){_0x3890d7=_0x3890d7-0x0;var _0x224e89=_0xd866[_0x3890d7];return _0x224e89;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6d86('0x0')]},'node':{'type':Sequelize[_0x6d86('0x0')]},'application':{'type':Sequelize[_0x6d86('0x0')]},'data':{'type':Sequelize[_0x6d86('0x1')]},'project_name':{'type':Sequelize[_0x6d86('0x0')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7f0=['STRING'];(function(_0x1bef07,_0x2a4e64){var _0x29edf6=function(_0x3e0230){while(--_0x3e0230){_0x1bef07['push'](_0x1bef07['shift']());}};_0x29edf6(++_0x2a4e64);}(_0xb7f0,0x9d));var _0x0b7f=function(_0x205e5b,_0x3d9293){_0x205e5b=_0x205e5b-0x0;var _0x2e60db=_0xb7f0[_0x205e5b];return _0x2e60db;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x0b7f('0x0')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0b7f('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9e82f9f..fec2213 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 _0x50e8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','describe','eml-format','rimraf'];(function(_0x761419,_0x17a19c){var _0x4b25fb=function(_0x3e5f55){while(--_0x3e5f55){_0x761419['push'](_0x761419['shift']());}};_0x4b25fb(++_0x17a19c);}(_0x50e8,0xf1));var _0x850e=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x50e8[_0x1d6a82];return _0x5834ac;};'use strict';var emlformat=require(_0x850e('0x0'));var rimraf=require(_0x850e('0x1'));var zipdir=require(_0x850e('0x2'));var jsonpatch=require(_0x850e('0x3'));var rp=require(_0x850e('0x4'));var moment=require(_0x850e('0x5'));var BPromise=require(_0x850e('0x6'));var Mustache=require(_0x850e('0x7'));var util=require(_0x850e('0x8'));var path=require(_0x850e('0x9'));var sox=require(_0x850e('0xa'));var csv=require(_0x850e('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x850e('0xc'));var _=require(_0x850e('0xd'));var squel=require(_0x850e('0xe'));var crypto=require(_0x850e('0xf'));var jsforce=require(_0x850e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x850e('0xb'));var querystring=require(_0x850e('0x11'));var Papa=require(_0x850e('0x12'));var Redis=require(_0x850e('0x13'));var authService=require(_0x850e('0x14'));var qs=require(_0x850e('0x15'));var as=require(_0x850e('0x16'));var hardwareService=require(_0x850e('0x17'));var logger=require(_0x850e('0x18'))('api');var utils=require(_0x850e('0x19'));var config=require(_0x850e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x850e('0x1b'))['db'];function respondWithStatusCode(_0x1790cf,_0x3b856e){_0x3b856e=_0x3b856e||0xcc;return function(_0xee460b){if(_0xee460b){return _0x1790cf[_0x850e('0x1c')](_0x3b856e);}return _0x1790cf[_0x850e('0x1d')](_0x3b856e)[_0x850e('0x1e')]();};}function respondWithResult(_0x1acc12,_0x54efc3){_0x54efc3=_0x54efc3||0xc8;return function(_0x380f81){if(_0x380f81){return _0x1acc12[_0x850e('0x1d')](_0x54efc3)[_0x850e('0x1f')](_0x380f81);}};}function respondWithFilteredResult(_0xff6238,_0x5b3215){return function(_0x2d9dd4){if(_0x2d9dd4){var _0xedbe83=typeof _0x5b3215[_0x850e('0x20')]==='undefined'&&typeof _0x5b3215[_0x850e('0x21')]===_0x850e('0x22');var _0x58de03=_0x2d9dd4[_0x850e('0x23')];var _0x174f9b=_0xedbe83?0x0:_0x5b3215[_0x850e('0x20')];var _0x23dcbb=_0xedbe83?_0x2d9dd4['count']:_0x5b3215['offset']+_0x5b3215[_0x850e('0x21')];var _0xb02a0c;if(_0x23dcbb>=_0x58de03){_0x23dcbb=_0x58de03;_0xb02a0c=0xc8;}else{_0xb02a0c=0xce;}_0xff6238[_0x850e('0x1d')](_0xb02a0c);return _0xff6238[_0x850e('0x24')](_0x850e('0x25'),_0x174f9b+'-'+_0x23dcbb+'/'+_0x58de03)[_0x850e('0x1f')](_0x2d9dd4);}return null;};}function patchUpdates(_0x212a13){return function(_0x570865){try{jsonpatch[_0x850e('0x26')](_0x570865,_0x212a13,!![]);}catch(_0x5d2f0a){return BPromise['reject'](_0x5d2f0a);}return _0x570865[_0x850e('0x27')]();};}function saveUpdates(_0x2ef3f4,_0x59c7d9){return function(_0x58bc50){if(_0x58bc50){return _0x58bc50[_0x850e('0x28')](_0x2ef3f4)['then'](function(_0x1a48d6){return _0x1a48d6;});}return null;};}function removeEntity(_0x4128ae,_0x4a2c7e){return function(_0xdd158b){if(_0xdd158b){return _0xdd158b[_0x850e('0x29')]()[_0x850e('0x2a')](function(){_0x4128ae['status'](0xcc)[_0x850e('0x1e')]();});}};}function handleEntityNotFound(_0x5bb7d4,_0xaae6b4){return function(_0x2243e9){if(!_0x2243e9){_0x5bb7d4[_0x850e('0x1c')](0x194);}return _0x2243e9;};}function handleError(_0x4c4208,_0x3efbcc){_0x3efbcc=_0x3efbcc||0x1f4;return function(_0x9524a0){logger[_0x850e('0x2b')](_0x9524a0[_0x850e('0x2c')]);if(_0x9524a0['name']){delete _0x9524a0[_0x850e('0x2d')];}_0x4c4208[_0x850e('0x1d')](_0x3efbcc)[_0x850e('0x2e')](_0x9524a0);};}exports[_0x850e('0x2f')]=function(_0x1d3184,_0x83d164){var _0x449acd={},_0xe73c8={},_0x36efba={'count':0x0,'rows':[]};var _0x10e201=_[_0x850e('0x30')](db[_0x850e('0x31')]['rawAttributes'],function(_0x58b557){return{'name':_0x58b557[_0x850e('0x32')],'type':_0x58b557[_0x850e('0x33')][_0x850e('0x34')]};});_0xe73c8[_0x850e('0x35')]=_[_0x850e('0x30')](_0x10e201,'name');_0xe73c8[_0x850e('0x36')]=_[_0x850e('0x37')](_0x1d3184[_0x850e('0x36')]);_0xe73c8[_0x850e('0x38')]=_[_0x850e('0x39')](_0xe73c8[_0x850e('0x35')],_0xe73c8[_0x850e('0x36')]);_0x449acd[_0x850e('0x3a')]=_[_0x850e('0x39')](_0xe73c8[_0x850e('0x35')],qs[_0x850e('0x3b')](_0x1d3184[_0x850e('0x36')][_0x850e('0x3b')]));_0x449acd[_0x850e('0x3a')]=_0x449acd[_0x850e('0x3a')][_0x850e('0x3c')]?_0x449acd[_0x850e('0x3a')]:_0xe73c8[_0x850e('0x35')];if(!_0x1d3184['query'][_0x850e('0x3d')]('nolimit')){_0x449acd[_0x850e('0x21')]=qs['limit'](_0x1d3184[_0x850e('0x36')][_0x850e('0x21')]);_0x449acd[_0x850e('0x20')]=qs[_0x850e('0x20')](_0x1d3184[_0x850e('0x36')][_0x850e('0x20')]);}_0x449acd['order']=qs[_0x850e('0x3e')](_0x1d3184[_0x850e('0x36')][_0x850e('0x3e')]);_0x449acd[_0x850e('0x3f')]=qs[_0x850e('0x38')](_[_0x850e('0x40')](_0x1d3184[_0x850e('0x36')],_0xe73c8[_0x850e('0x38')]),_0x10e201);if(_0x1d3184[_0x850e('0x36')][_0x850e('0x41')]){_0x449acd[_0x850e('0x3f')]=_['merge'](_0x449acd['where'],{'$or':_['map'](_0x10e201,function(_0xc74053){if(_0xc74053[_0x850e('0x33')]!==_0x850e('0x42')){var _0x51bf24={};_0x51bf24[_0xc74053[_0x850e('0x2d')]]={'$like':'%'+_0x1d3184[_0x850e('0x36')][_0x850e('0x41')]+'%'};return _0x51bf24;}})});}_0x449acd=_[_0x850e('0x43')]({},_0x449acd,_0x1d3184[_0x850e('0x44')]);var _0x2f1477={'where':_0x449acd[_0x850e('0x3f')]};return db[_0x850e('0x31')][_0x850e('0x23')](_0x2f1477)[_0x850e('0x2a')](function(_0x3e4b6e){_0x36efba[_0x850e('0x23')]=_0x3e4b6e;if(_0x1d3184['query']['includeAll']){_0x449acd['include']=[{'all':!![]}];}return db[_0x850e('0x31')][_0x850e('0x45')](_0x449acd);})[_0x850e('0x2a')](function(_0x36e1f4){_0x36efba[_0x850e('0x46')]=_0x36e1f4;return _0x36efba;})['then'](respondWithFilteredResult(_0x83d164,_0x449acd))[_0x850e('0x47')](handleError(_0x83d164,null));};exports[_0x850e('0x48')]=function(_0x16bbdb,_0x55cb2b){var _0x1897b2={'raw':!![],'where':{'id':_0x16bbdb[_0x850e('0x49')]['id']}},_0x49e29e={};_0x49e29e[_0x850e('0x35')]=_[_0x850e('0x37')](db[_0x850e('0x31')][_0x850e('0x4a')]);_0x49e29e[_0x850e('0x36')]=_[_0x850e('0x37')](_0x16bbdb[_0x850e('0x36')]);_0x49e29e[_0x850e('0x38')]=_[_0x850e('0x39')](_0x49e29e[_0x850e('0x35')],_0x49e29e[_0x850e('0x36')]);_0x1897b2[_0x850e('0x3a')]=_[_0x850e('0x39')](_0x49e29e[_0x850e('0x35')],qs[_0x850e('0x3b')](_0x16bbdb[_0x850e('0x36')][_0x850e('0x3b')]));_0x1897b2[_0x850e('0x3a')]=_0x1897b2[_0x850e('0x3a')][_0x850e('0x3c')]?_0x1897b2[_0x850e('0x3a')]:_0x49e29e[_0x850e('0x35')];if(_0x16bbdb[_0x850e('0x36')][_0x850e('0x4b')]){_0x1897b2[_0x850e('0x4c')]=[{'all':!![]}];}_0x1897b2=_['merge']({},_0x1897b2,_0x16bbdb[_0x850e('0x44')]);return db[_0x850e('0x31')][_0x850e('0x4d')](_0x1897b2)['then'](handleEntityNotFound(_0x55cb2b,null))[_0x850e('0x2a')](respondWithResult(_0x55cb2b,null))[_0x850e('0x47')](handleError(_0x55cb2b,null));};exports[_0x850e('0x4e')]=function(_0x51e80b,_0x3fe985){return db[_0x850e('0x31')][_0x850e('0x4e')](_0x51e80b[_0x850e('0x4f')],{})[_0x850e('0x2a')](respondWithResult(_0x3fe985,0xc9))[_0x850e('0x47')](handleError(_0x3fe985,null));};exports['update']=function(_0x95da55,_0x458986){if(_0x95da55[_0x850e('0x4f')]['id']){delete _0x95da55['body']['id'];}return db[_0x850e('0x31')][_0x850e('0x4d')]({'where':{'id':_0x95da55['params']['id']}})[_0x850e('0x2a')](handleEntityNotFound(_0x458986,null))[_0x850e('0x2a')](saveUpdates(_0x95da55['body'],null))[_0x850e('0x2a')](respondWithResult(_0x458986,null))[_0x850e('0x47')](handleError(_0x458986,null));};exports[_0x850e('0x29')]=function(_0x217f91,_0x1d790a){return db[_0x850e('0x31')]['find']({'where':{'id':_0x217f91[_0x850e('0x49')]['id']}})[_0x850e('0x2a')](handleEntityNotFound(_0x1d790a,null))[_0x850e('0x2a')](removeEntity(_0x1d790a,null))[_0x850e('0x47')](handleError(_0x1d790a,null));};exports[_0x850e('0x50')]=function(_0x53f7c0,_0x37eef9){return db[_0x850e('0x31')]['describe']()[_0x850e('0x2a')](respondWithResult(_0x37eef9,null))['catch'](handleError(_0x37eef9,null));}; \ No newline at end of file +var _0x0e79=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','set','Content-Range','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','catch','length','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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'];(function(_0x3febd9,_0x37aa62){var _0x2168b9=function(_0x33739e){while(--_0x33739e){_0x3febd9['push'](_0x3febd9['shift']());}};_0x2168b9(++_0x37aa62);}(_0x0e79,0xd0));var _0x90e7=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0e79[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0x90e7('0x0'));var rimraf=require(_0x90e7('0x1'));var zipdir=require(_0x90e7('0x2'));var jsonpatch=require(_0x90e7('0x3'));var rp=require(_0x90e7('0x4'));var moment=require(_0x90e7('0x5'));var BPromise=require(_0x90e7('0x6'));var Mustache=require(_0x90e7('0x7'));var util=require('util');var path=require(_0x90e7('0x8'));var sox=require(_0x90e7('0x9'));var csv=require(_0x90e7('0xa'));var ejs=require(_0x90e7('0xb'));var fs=require('fs');var fs_extra=require(_0x90e7('0xc'));var _=require(_0x90e7('0xd'));var squel=require(_0x90e7('0xe'));var crypto=require(_0x90e7('0xf'));var jsforce=require(_0x90e7('0x10'));var deskjs=require(_0x90e7('0x11'));var toCsv=require(_0x90e7('0xa'));var querystring=require(_0x90e7('0x12'));var Papa=require(_0x90e7('0x13'));var Redis=require('ioredis');var authService=require(_0x90e7('0x14'));var qs=require(_0x90e7('0x15'));var as=require(_0x90e7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90e7('0x17'))('api');var utils=require(_0x90e7('0x18'));var config=require(_0x90e7('0x19'));var licenseUtil=require(_0x90e7('0x1a'));var db=require(_0x90e7('0x1b'))['db'];function respondWithStatusCode(_0x57a793,_0x3e9dde){_0x3e9dde=_0x3e9dde||0xcc;return function(_0x2a4ef5){if(_0x2a4ef5){return _0x57a793['sendStatus'](_0x3e9dde);}return _0x57a793[_0x90e7('0x1c')](_0x3e9dde)['end']();};}function respondWithResult(_0xce9fe1,_0x44596e){_0x44596e=_0x44596e||0xc8;return function(_0x3eadb7){if(_0x3eadb7){return _0xce9fe1['status'](_0x44596e)[_0x90e7('0x1d')](_0x3eadb7);}};}function respondWithFilteredResult(_0x2bec44,_0x4979ca){return function(_0x6831b2){if(_0x6831b2){var _0x221176=typeof _0x4979ca['offset']===_0x90e7('0x1e')&&typeof _0x4979ca['limit']===_0x90e7('0x1e');var _0x3d80fe=_0x6831b2[_0x90e7('0x1f')];var _0x8a76cd=_0x221176?0x0:_0x4979ca['offset'];var _0x491865=_0x221176?_0x6831b2[_0x90e7('0x1f')]:_0x4979ca['offset']+_0x4979ca['limit'];var _0x32dbd3;if(_0x491865>=_0x3d80fe){_0x491865=_0x3d80fe;_0x32dbd3=0xc8;}else{_0x32dbd3=0xce;}_0x2bec44[_0x90e7('0x1c')](_0x32dbd3);return _0x2bec44[_0x90e7('0x20')](_0x90e7('0x21'),_0x8a76cd+'-'+_0x491865+'/'+_0x3d80fe)[_0x90e7('0x1d')](_0x6831b2);}return null;};}function patchUpdates(_0x45d1a0){return function(_0x50af40){try{jsonpatch['apply'](_0x50af40,_0x45d1a0,!![]);}catch(_0x10517d){return BPromise['reject'](_0x10517d);}return _0x50af40[_0x90e7('0x22')]();};}function saveUpdates(_0x233bac,_0x2ec0c9){return function(_0x29bee0){if(_0x29bee0){return _0x29bee0[_0x90e7('0x23')](_0x233bac)['then'](function(_0x13587c){return _0x13587c;});}return null;};}function removeEntity(_0x376d49,_0x57d7d1){return function(_0x1f9be7){if(_0x1f9be7){return _0x1f9be7[_0x90e7('0x24')]()[_0x90e7('0x25')](function(){_0x376d49['status'](0xcc)[_0x90e7('0x26')]();});}};}function handleEntityNotFound(_0x11cbe5,_0x3537a4){return function(_0x27348a){if(!_0x27348a){_0x11cbe5[_0x90e7('0x27')](0x194);}return _0x27348a;};}function handleError(_0x2354ee,_0xdf4b41){_0xdf4b41=_0xdf4b41||0x1f4;return function(_0x33bc70){logger[_0x90e7('0x28')](_0x33bc70[_0x90e7('0x29')]);if(_0x33bc70[_0x90e7('0x2a')]){delete _0x33bc70[_0x90e7('0x2a')];}_0x2354ee['status'](_0xdf4b41)[_0x90e7('0x2b')](_0x33bc70);};}exports[_0x90e7('0x2c')]=function(_0x47a786,_0x41905c){var _0x2ab969={},_0x522c63={},_0x58538e={'count':0x0,'rows':[]};var _0x34cd38=_[_0x90e7('0x2d')](db[_0x90e7('0x2e')][_0x90e7('0x2f')],function(_0x42bb94){return{'name':_0x42bb94[_0x90e7('0x30')],'type':_0x42bb94['type'][_0x90e7('0x31')]};});_0x522c63[_0x90e7('0x32')]=_[_0x90e7('0x2d')](_0x34cd38,_0x90e7('0x2a'));_0x522c63[_0x90e7('0x33')]=_[_0x90e7('0x34')](_0x47a786[_0x90e7('0x33')]);_0x522c63['filters']=_[_0x90e7('0x35')](_0x522c63[_0x90e7('0x32')],_0x522c63['query']);_0x2ab969['attributes']=_[_0x90e7('0x35')](_0x522c63[_0x90e7('0x32')],qs[_0x90e7('0x36')](_0x47a786[_0x90e7('0x33')]['fields']));_0x2ab969[_0x90e7('0x37')]=_0x2ab969[_0x90e7('0x37')]['length']?_0x2ab969['attributes']:_0x522c63[_0x90e7('0x32')];if(!_0x47a786[_0x90e7('0x33')][_0x90e7('0x38')](_0x90e7('0x39'))){_0x2ab969[_0x90e7('0x3a')]=qs[_0x90e7('0x3a')](_0x47a786[_0x90e7('0x33')][_0x90e7('0x3a')]);_0x2ab969['offset']=qs[_0x90e7('0x3b')](_0x47a786[_0x90e7('0x33')][_0x90e7('0x3b')]);}_0x2ab969[_0x90e7('0x3c')]=qs[_0x90e7('0x3d')](_0x47a786['query'][_0x90e7('0x3d')]);_0x2ab969['where']=qs['filters'](_['pick'](_0x47a786[_0x90e7('0x33')],_0x522c63[_0x90e7('0x3e')]),_0x34cd38);if(_0x47a786[_0x90e7('0x33')][_0x90e7('0x3f')]){_0x2ab969[_0x90e7('0x40')]=_[_0x90e7('0x41')](_0x2ab969['where'],{'$or':_[_0x90e7('0x2d')](_0x34cd38,function(_0x361a96){if(_0x361a96[_0x90e7('0x42')]!==_0x90e7('0x43')){var _0x2a47a9={};_0x2a47a9[_0x361a96['name']]={'$like':'%'+_0x47a786[_0x90e7('0x33')][_0x90e7('0x3f')]+'%'};return _0x2a47a9;}})});}_0x2ab969=_['merge']({},_0x2ab969,_0x47a786[_0x90e7('0x44')]);var _0x7fd4f9={'where':_0x2ab969[_0x90e7('0x40')]};return db[_0x90e7('0x2e')][_0x90e7('0x1f')](_0x7fd4f9)[_0x90e7('0x25')](function(_0x152aa0){_0x58538e['count']=_0x152aa0;if(_0x47a786[_0x90e7('0x33')][_0x90e7('0x45')]){_0x2ab969['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0x90e7('0x46')](_0x2ab969);})[_0x90e7('0x25')](function(_0x13b22e){_0x58538e['rows']=_0x13b22e;return _0x58538e;})[_0x90e7('0x25')](respondWithFilteredResult(_0x41905c,_0x2ab969))[_0x90e7('0x47')](handleError(_0x41905c,null));};exports['show']=function(_0x2148c3,_0x389e68){var _0x590427={'raw':!![],'where':{'id':_0x2148c3['params']['id']}},_0x6d28f2={};_0x6d28f2[_0x90e7('0x32')]=_[_0x90e7('0x34')](db[_0x90e7('0x2e')][_0x90e7('0x2f')]);_0x6d28f2['query']=_[_0x90e7('0x34')](_0x2148c3[_0x90e7('0x33')]);_0x6d28f2[_0x90e7('0x3e')]=_['intersection'](_0x6d28f2[_0x90e7('0x32')],_0x6d28f2[_0x90e7('0x33')]);_0x590427['attributes']=_[_0x90e7('0x35')](_0x6d28f2['model'],qs[_0x90e7('0x36')](_0x2148c3[_0x90e7('0x33')][_0x90e7('0x36')]));_0x590427[_0x90e7('0x37')]=_0x590427['attributes'][_0x90e7('0x48')]?_0x590427[_0x90e7('0x37')]:_0x6d28f2[_0x90e7('0x32')];if(_0x2148c3['query'][_0x90e7('0x45')]){_0x590427['include']=[{'all':!![]}];}_0x590427=_[_0x90e7('0x41')]({},_0x590427,_0x2148c3['options']);return db[_0x90e7('0x2e')][_0x90e7('0x49')](_0x590427)[_0x90e7('0x25')](handleEntityNotFound(_0x389e68,null))[_0x90e7('0x25')](respondWithResult(_0x389e68,null))[_0x90e7('0x47')](handleError(_0x389e68,null));};exports['create']=function(_0x552a58,_0x23715d){return db[_0x90e7('0x2e')]['create'](_0x552a58[_0x90e7('0x4a')],{})['then'](respondWithResult(_0x23715d,0xc9))[_0x90e7('0x47')](handleError(_0x23715d,null));};exports['update']=function(_0x886d16,_0x1bcf22){if(_0x886d16[_0x90e7('0x4a')]['id']){delete _0x886d16[_0x90e7('0x4a')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x886d16[_0x90e7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1bcf22,null))['then'](saveUpdates(_0x886d16['body'],null))[_0x90e7('0x25')](respondWithResult(_0x1bcf22,null))[_0x90e7('0x47')](handleError(_0x1bcf22,null));};exports[_0x90e7('0x24')]=function(_0x17c73c,_0x43ba9a){return db['SquareDetailsReport'][_0x90e7('0x49')]({'where':{'id':_0x17c73c['params']['id']}})[_0x90e7('0x25')](handleEntityNotFound(_0x43ba9a,null))[_0x90e7('0x25')](removeEntity(_0x43ba9a,null))[_0x90e7('0x47')](handleError(_0x43ba9a,null));};exports[_0x90e7('0x4c')]=function(_0x237997,_0x155319){return db[_0x90e7('0x2e')][_0x90e7('0x4c')]()[_0x90e7('0x25')](respondWithResult(_0x155319,null))[_0x90e7('0x47')](handleError(_0x155319,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 8f21ec9..8d3a0e3 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 _0xb0f7=['exports','define','SquareDetailsReport','report_square_details','../../config/logger','api','bluebird','request-promise','path','./squareReportDetail.attributes'];(function(_0x31caf1,_0x52cbcf){var _0x40b424=function(_0xa7cd4d){while(--_0xa7cd4d){_0x31caf1['push'](_0x31caf1['shift']());}};_0x40b424(++_0x52cbcf);}(_0xb0f7,0xae));var _0x7b0f=function(_0xd0c54f,_0x5910ba){_0xd0c54f=_0xd0c54f-0x0;var _0x533c19=_0xb0f7[_0xd0c54f];return _0x533c19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b0f('0x0'))(_0x7b0f('0x1'));var moment=require('moment');var BPromise=require(_0x7b0f('0x2'));var rp=require(_0x7b0f('0x3'));var fs=require('fs');var path=require(_0x7b0f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7b0f('0x5'));module[_0x7b0f('0x6')]=function(_0x1be42a,_0x4f5c9e){return _0x1be42a[_0x7b0f('0x7')](_0x7b0f('0x8'),attributes,{'tableName':_0x7b0f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9421=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareDetailsReport','util'];(function(_0xdbd6be,_0x1a1535){var _0x251c45=function(_0x38b25e){while(--_0x38b25e){_0xdbd6be['push'](_0xdbd6be['shift']());}};_0x251c45(++_0x1a1535);}(_0x9421,0x1bb));var _0x1942=function(_0x9d1102,_0x5c55c9){_0x9d1102=_0x9d1102-0x0;var _0x2c668e=_0x9421[_0x9d1102];return _0x2c668e;};'use strict';var _=require('lodash');var util=require(_0x1942('0x0'));var logger=require(_0x1942('0x1'))(_0x1942('0x2'));var moment=require(_0x1942('0x3'));var BPromise=require(_0x1942('0x4'));var rp=require(_0x1942('0x5'));var fs=require('fs');var path=require(_0x1942('0x6'));var rimraf=require(_0x1942('0x7'));var config=require(_0x1942('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0x1942('0x9')]=function(_0x36ab0e,_0x5ba47b){return _0x36ab0e[_0x1942('0xa')](_0x1942('0xb'),attributes,{'tableName':'report_square_details','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 8682bc4..87c438a 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 _0x351d=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','then'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x351d,0x90));var _0xd351=function(_0x3da3e3,_0x3f2a86){_0x3da3e3=_0x3da3e3-0x0;var _0x3d4e9d=_0x351d[_0x3da3e3];return _0x3d4e9d;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5318b2,_0x16b3f7,_0x235aa0){return new BPromise(function(_0x4e1b06,_0x2e9a2a){return client[_0xd351('0xa')](_0x5318b2,_0x235aa0)['then'](function(_0x586c60){logger[_0xd351('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'));logger[_0xd351('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'),JSON[_0xd351('0xe')](_0x586c60));if(_0x586c60['error']){if(_0x586c60[_0xd351('0xf')]['code']===0x1f4){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);return _0x2e9a2a(_0x586c60[_0xd351('0xf')]['message']);}logger[_0xd351('0xf')](_0xd351('0x10'),_0x16b3f7,_0x586c60['error'][_0xd351('0x11')]);return _0x4e1b06(_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);}else{logger[_0xd351('0xb')](_0xd351('0x10'),_0x16b3f7,'request\x20sent');_0x4e1b06(_0x586c60[_0xd351('0x12')]['message']);}})['catch'](function(_0x2c6708){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x2c6708);_0x2e9a2a(_0x2c6708);});});}exports[_0xd351('0x13')]=function(_0x4e0164){var _0x4c6693=this;return new Promise(function(_0x1e1a3c,_0x2bfc53){return db[_0xd351('0x14')][_0xd351('0x15')](_0x4e0164['body'],{'raw':_0x4e0164[_0xd351('0x16')]?_0x4e0164['options']['raw']===undefined?!![]:![]:!![]})[_0xd351('0x17')](function(_0x4a427b){logger[_0xd351('0xb')](_0xd351('0x13'),_0x4e0164);logger[_0xd351('0xd')](_0xd351('0x13'),_0x4e0164,JSON[_0xd351('0xe')](_0x4a427b));_0x1e1a3c(_0x4a427b);})['catch'](function(_0x18625b){logger[_0xd351('0xf')](_0xd351('0x13'),_0x18625b['message'],_0x4e0164);_0x2bfc53(_0x4c6693[_0xd351('0xf')](0x1f4,_0x18625b[_0xd351('0x11')]));});});}; \ No newline at end of file +var _0xfcbb=['code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x8a7e38,_0x473a5d){var _0x228609=function(_0x5dcb5c){while(--_0x5dcb5c){_0x8a7e38['push'](_0x8a7e38['shift']());}};_0x228609(++_0x473a5d);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x5744d5,_0x5be579){_0x5744d5=_0x5744d5-0x0;var _0x19304c=_0xfcbb[_0x5744d5];return _0x19304c;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')](_0xba1d6['body'],{'raw':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbfcb('0xa')](function(_0x1a7225){logger['info']('CreateSquareDetailsReport',_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x1a7225));_0x3404aa(_0x1a7225);})[_0xbfcb('0x15')](function(_0x1c5924){logger['error'](_0xbfcb('0x16'),_0x1c5924[_0xbfcb('0x13')],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x1c5924[_0xbfcb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 7eaa1a8..0b71f27 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 _0x42b7=['express','Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x5036f1,_0x555d55){var _0x283263=function(_0x3a7508){while(--_0x3a7508){_0x5036f1['push'](_0x5036f1['shift']());}};_0x283263(++_0x555d55);}(_0x42b7,0x103));var _0x742b=function(_0x1f6739,_0x2ff18d){_0x1f6739=_0x1f6739-0x0;var _0x57894a=_0x42b7[_0x1f6739];return _0x57894a;};'use strict';var express=require(_0x742b('0x0'));var router=express[_0x742b('0x1')]();var auth=require(_0x742b('0x2'));var controller=require('./system.controller');router[_0x742b('0x3')]('/',auth[_0x742b('0x4')](),controller[_0x742b('0x5')]);router['get'](_0x742b('0x6'),auth[_0x742b('0x4')](),controller['killProcess']);module['exports']=router; \ No newline at end of file +var _0x7b0a=['isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get'];(function(_0x232009,_0x36eb63){var _0x24c448=function(_0x582069){while(--_0x582069){_0x232009['push'](_0x232009['shift']());}};_0x24c448(++_0x36eb63);}(_0x7b0a,0x1db));var _0xa7b0=function(_0x2c3044,_0x874808){_0x2c3044=_0x2c3044-0x0;var _0x4baeb3=_0x7b0a[_0x2c3044];return _0x4baeb3;};'use strict';var express=require(_0xa7b0('0x0'));var router=express[_0xa7b0('0x1')]();var auth=require(_0xa7b0('0x2'));var controller=require(_0xa7b0('0x3'));router[_0xa7b0('0x4')]('/',auth[_0xa7b0('0x5')](),controller[_0xa7b0('0x6')]);router['get'](_0xa7b0('0x7'),auth[_0xa7b0('0x5')](),controller[_0xa7b0('0x8')]);module[_0xa7b0('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index dc16bd2..5a09a7d 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 _0x2d91=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','util','bluebird','lodash','error','inspect','name','send','index','getAllData','status','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf'];(function(_0x31259d,_0x251eb4){var _0x286f79=function(_0x53255b){while(--_0x53255b){_0x31259d['push'](_0x31259d['shift']());}};_0x286f79(++_0x251eb4);}(_0x2d91,0x1d7));var _0x12d9=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x2d91[_0x149083];return _0x4dc74e;};'use strict';var info=require(_0x12d9('0x0'));var exec=require(_0x12d9('0x1'))[_0x12d9('0x2')];var logger=require(_0x12d9('0x3'))('api');var util=require(_0x12d9('0x4'));var BPromise=require(_0x12d9('0x5'));var _=require(_0x12d9('0x6'));function handleError(_0x11d207,_0x38b938,_0x4011c3){_0x38b938=_0x38b938||0x1f4;return function(_0xed5aad){logger[_0x12d9('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4011c3,_0x38b938,util[_0x12d9('0x8')](_0xed5aad,{'showHidden':![],'depth':null}));delete _0xed5aad[_0x12d9('0x9')];_0x11d207['status'](_0x38b938)[_0x12d9('0xa')](_0xed5aad);};}exports[_0x12d9('0xb')]=function(_0x6772fa,_0xbde044){return info[_0x12d9('0xc')]()['then'](function(_0x2e0f33){return _0xbde044[_0x12d9('0xd')](0xc8)[_0x12d9('0xe')](_0x2e0f33);})[_0x12d9('0xf')](function(_0x229730){return _0xbde044['status'](0x1f4)[_0x12d9('0xe')](_0x229730);});};exports[_0x12d9('0x10')]=function(_0x3e0a49,_0x23ba7b){var _0x4a7c98=['components/import/cm'];return new BPromise(function(_0x271959,_0x23eef4){return exec(util[_0x12d9('0x11')](_0x12d9('0x12'),_0x3e0a49[_0x12d9('0x13')][_0x12d9('0x14')]),function(_0x376408,_0x52a988,_0x35b418){if(_0x376408){return _0x23eef4(_0x376408);}return _0x271959(_0x52a988);});})['then'](function(_0x468170){var _0x1f1ffc=![];var _0x476211=_0x468170[_0x12d9('0x15')](/\n/);for(var _0xcf8e00=0x0,_0x1fa470=_0x4a7c98['length'];_0xcf8e00<_0x1fa470,_0x1f1ffc===![];_0xcf8e00+=0x1){if(_0x468170[_0x12d9('0x16')](_0x4a7c98[_0xcf8e00])>=0x0){_0x1f1ffc=!![];}}if(!_0x1f1ffc){throw new Error(util[_0x12d9('0x11')](_0x12d9('0x17'),_0x3e0a49[_0x12d9('0x13')]['pid']));}process[_0x12d9('0x18')](_0x3e0a49[_0x12d9('0x13')][_0x12d9('0x14')],'SIGINT');return _0x23ba7b[_0x12d9('0xd')](0xc8)[_0x12d9('0xe')]({'message':util[_0x12d9('0x11')](_0x12d9('0x19'),_0x3e0a49['params'][_0x12d9('0x14')])});})['catch'](handleError(_0x23ba7b,null,_0x12d9('0x10')));}; \ No newline at end of file +var _0x1e90=['SIGINT','killProcess','exec','../../config/logger','api','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','components/import/cm','format','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill'];(function(_0x571118,_0x201a59){var _0x5da3eb=function(_0x2e8bb1){while(--_0x2e8bb1){_0x571118['push'](_0x571118['shift']());}};_0x5da3eb(++_0x201a59);}(_0x1e90,0xb1));var _0x01e9=function(_0x1853a7,_0x3685d7){_0x1853a7=_0x1853a7-0x0;var _0x3ad016=_0x1e90[_0x1853a7];return _0x3ad016;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x01e9('0x0')];var logger=require(_0x01e9('0x1'))(_0x01e9('0x2'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x01e9('0x3'));function handleError(_0x4751a6,_0x973fb9,_0x136c23){_0x973fb9=_0x973fb9||0x1f4;return function(_0x4a6bf7){logger['error'](_0x01e9('0x4'),_0x136c23,_0x973fb9,util[_0x01e9('0x5')](_0x4a6bf7,{'showHidden':![],'depth':null}));delete _0x4a6bf7[_0x01e9('0x6')];_0x4751a6[_0x01e9('0x7')](_0x973fb9)[_0x01e9('0x8')](_0x4a6bf7);};}exports[_0x01e9('0x9')]=function(_0x950711,_0x5c4096){return info[_0x01e9('0xa')]()[_0x01e9('0xb')](function(_0x3db051){return _0x5c4096[_0x01e9('0x7')](0xc8)[_0x01e9('0xc')](_0x3db051);})[_0x01e9('0xd')](function(_0x1adbe5){return _0x5c4096['status'](0x1f4)[_0x01e9('0xc')](_0x1adbe5);});};exports['killProcess']=function(_0x3b0a08,_0x2ea86c){var _0x397574=[_0x01e9('0xe')];return new BPromise(function(_0x10b56c,_0x2dfe85){return exec(util[_0x01e9('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x3b0a08[_0x01e9('0x10')][_0x01e9('0x11')]),function(_0x2f7771,_0x4c6120,_0x4dc9b4){if(_0x2f7771){return _0x2dfe85(_0x2f7771);}return _0x10b56c(_0x4c6120);});})[_0x01e9('0xb')](function(_0x5df676){var _0x2184d1=![];var _0x44f505=_0x5df676[_0x01e9('0x12')](/\n/);for(var _0x343cf4=0x0,_0xe70368=_0x397574[_0x01e9('0x13')];_0x343cf4<_0xe70368,_0x2184d1===![];_0x343cf4+=0x1){if(_0x5df676[_0x01e9('0x14')](_0x397574[_0x343cf4])>=0x0){_0x2184d1=!![];}}if(!_0x2184d1){throw new Error(util['format'](_0x01e9('0x15'),_0x3b0a08['params'][_0x01e9('0x11')]));}process[_0x01e9('0x16')](_0x3b0a08[_0x01e9('0x10')][_0x01e9('0x11')],_0x01e9('0x17'));return _0x2ea86c['status'](0xc8)['json']({'message':util[_0x01e9('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x3b0a08['params'][_0x01e9('0x11')])});})['catch'](handleError(_0x2ea86c,null,_0x01e9('0x18')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 686fb07..88a4cfc 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 _0x1a4d=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util'];(function(_0x71a487,_0x5eaddb){var _0x32a9d0=function(_0x5c05e7){while(--_0x5c05e7){_0x71a487['push'](_0x71a487['shift']());}};_0x32a9d0(++_0x5eaddb);}(_0x1a4d,0x12e));var _0xd1a4=function(_0x4ff668,_0x1c0c37){_0x4ff668=_0x4ff668-0x0;var _0x20c647=_0x1a4d[_0x4ff668];return _0x20c647;};'use strict';var multer=require(_0xd1a4('0x0'));var util=require(_0xd1a4('0x1'));var path=require(_0xd1a4('0x2'));var timeout=require(_0xd1a4('0x3'));var express=require('express');var router=express[_0xd1a4('0x4')]();var fs_extra=require(_0xd1a4('0x5'));var auth=require(_0xd1a4('0x6'));var interaction=require(_0xd1a4('0x7'));var config=require(_0xd1a4('0x8'));var controller=require('./tag.controller');router[_0xd1a4('0x9')]('/',auth[_0xd1a4('0xa')](),controller[_0xd1a4('0xb')]);router[_0xd1a4('0x9')](_0xd1a4('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd1a4('0xd')]('/',auth[_0xd1a4('0xa')](),controller['create']);router[_0xd1a4('0xe')](_0xd1a4('0xc'),auth[_0xd1a4('0xa')](),controller[_0xd1a4('0xf')]);router[_0xd1a4('0x10')](_0xd1a4('0xc'),auth[_0xd1a4('0xa')](),controller[_0xd1a4('0x11')]);module[_0xd1a4('0x12')]=router; \ No newline at end of file +var _0x8212=['isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x54e0bb,_0x140919){var _0x4897ea=function(_0x2f54c0){while(--_0x2f54c0){_0x54e0bb['push'](_0x54e0bb['shift']());}};_0x4897ea(++_0x140919);}(_0x8212,0xb3));var _0x2821=function(_0x536f07,_0x1a1a14){_0x536f07=_0x536f07-0x0;var _0xc1ac5b=_0x8212[_0x536f07];return _0xc1ac5b;};'use strict';var multer=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var path=require('path');var timeout=require(_0x2821('0x2'));var express=require(_0x2821('0x3'));var router=express[_0x2821('0x4')]();var fs_extra=require(_0x2821('0x5'));var auth=require(_0x2821('0x6'));var interaction=require(_0x2821('0x7'));var config=require(_0x2821('0x8'));var controller=require(_0x2821('0x9'));router['get']('/',auth[_0x2821('0xa')](),controller['index']);router[_0x2821('0xb')](_0x2821('0xc'),auth['isAuthenticated'](),controller[_0x2821('0xd')]);router[_0x2821('0xe')]('/',auth[_0x2821('0xa')](),controller[_0x2821('0xf')]);router[_0x2821('0x10')](_0x2821('0xc'),auth[_0x2821('0xa')](),controller[_0x2821('0x11')]);router[_0x2821('0x12')]('/:id',auth[_0x2821('0xa')](),controller[_0x2821('0x13')]);module[_0x2821('0x14')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 1ec430e..0fa267e 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 _0x8d37=['name','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8d37,0x1d5));var _0x78d3=function(_0x19e642,_0x16c131){_0x19e642=_0x19e642-0x0;var _0x2818b3=_0x8d37[_0x19e642];return _0x2818b3;};'use strict';var Sequelize=require(_0x78d3('0x0'));module[_0x78d3('0x1')]={'name':{'type':Sequelize[_0x78d3('0x2')],'unique':_0x78d3('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x78d3('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x78d3('0x2')]}}; \ No newline at end of file +var _0x5525=['exports','STRING','name','#0091EA','sequelize'];(function(_0xef47a3,_0x141d61){var _0x407ffe=function(_0x2702bb){while(--_0x2702bb){_0xef47a3['push'](_0xef47a3['shift']());}};_0x407ffe(++_0x141d61);}(_0x5525,0xd1));var _0x5552=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5525[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x5552('0x0'));module[_0x5552('0x1')]={'name':{'type':Sequelize[_0x5552('0x2')],'unique':_0x5552('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5552('0x2')],'defaultValue':_0x5552('0x4')},'description':{'type':Sequelize[_0x5552('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index df6d207..38bb225 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 _0x6308=['nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','error','stack','name','index','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x34e528,_0x209f7d){var _0x2e634f=function(_0x5d92c1){while(--_0x5d92c1){_0x34e528['push'](_0x34e528['shift']());}};_0x2e634f(++_0x209f7d);}(_0x6308,0x1f2));var _0x8630=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x6308[_0x101e7b];return _0x4995c0;};'use strict';var emlformat=require(_0x8630('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8630('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8630('0x2'));var BPromise=require(_0x8630('0x3'));var Mustache=require(_0x8630('0x4'));var util=require(_0x8630('0x5'));var path=require(_0x8630('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8630('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8630('0x8'));var squel=require(_0x8630('0x9'));var crypto=require(_0x8630('0xa'));var jsforce=require(_0x8630('0xb'));var deskjs=require(_0x8630('0xc'));var toCsv=require(_0x8630('0xd'));var querystring=require('querystring');var Papa=require(_0x8630('0xe'));var Redis=require('ioredis');var authService=require(_0x8630('0xf'));var qs=require(_0x8630('0x10'));var as=require(_0x8630('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8630('0x12'))(_0x8630('0x13'));var utils=require(_0x8630('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8630('0x15'));var db=require(_0x8630('0x16'))['db'];function respondWithStatusCode(_0x5b6d75,_0x54073b){_0x54073b=_0x54073b||0xcc;return function(_0x303e3a){if(_0x303e3a){return _0x5b6d75[_0x8630('0x17')](_0x54073b);}return _0x5b6d75['status'](_0x54073b)[_0x8630('0x18')]();};}function respondWithResult(_0x4db686,_0xf31c17){_0xf31c17=_0xf31c17||0xc8;return function(_0x4cc542){if(_0x4cc542){return _0x4db686[_0x8630('0x19')](_0xf31c17)['json'](_0x4cc542);}};}function respondWithFilteredResult(_0x53f236,_0x29a42d){return function(_0x86c262){if(_0x86c262){var _0x49fce1=typeof _0x29a42d['offset']===_0x8630('0x1a')&&typeof _0x29a42d['limit']===_0x8630('0x1a');var _0x18a874=_0x86c262[_0x8630('0x1b')];var _0x20f462=_0x49fce1?0x0:_0x29a42d[_0x8630('0x1c')];var _0x1e9780=_0x49fce1?_0x86c262[_0x8630('0x1b')]:_0x29a42d[_0x8630('0x1c')]+_0x29a42d[_0x8630('0x1d')];var _0x5dd2e0;if(_0x1e9780>=_0x18a874){_0x1e9780=_0x18a874;_0x5dd2e0=0xc8;}else{_0x5dd2e0=0xce;}_0x53f236['status'](_0x5dd2e0);return _0x53f236[_0x8630('0x1e')](_0x8630('0x1f'),_0x20f462+'-'+_0x1e9780+'/'+_0x18a874)['json'](_0x86c262);}return null;};}function patchUpdates(_0x5cff5c){return function(_0x1325dc){try{jsonpatch[_0x8630('0x20')](_0x1325dc,_0x5cff5c,!![]);}catch(_0x1ac046){return BPromise['reject'](_0x1ac046);}return _0x1325dc['save']();};}function saveUpdates(_0xcc7454,_0x58c0b5){return function(_0x30fb4d){if(_0x30fb4d){return _0x30fb4d[_0x8630('0x21')](_0xcc7454)[_0x8630('0x22')](function(_0x469de3){return _0x469de3;});}return null;};}function removeEntity(_0x4c2851,_0x37c224){return function(_0xf24c11){if(_0xf24c11){return _0xf24c11[_0x8630('0x23')]()[_0x8630('0x22')](function(){var _0x41871a=_0xf24c11[_0x8630('0x24')]({'plain':!![]});var _0x37b7aa='Tags';return db['UserProfileResource'][_0x8630('0x23')]({'where':{'type':_0x37b7aa,'resourceId':_0x41871a['id']}})[_0x8630('0x22')](function(){return _0xf24c11;});})[_0x8630('0x22')](function(){_0x4c2851[_0x8630('0x19')](0xcc)[_0x8630('0x18')]();});}};}function handleEntityNotFound(_0x1c012d,_0x149a8e){return function(_0x349c4d){if(!_0x349c4d){_0x1c012d[_0x8630('0x17')](0x194);}return _0x349c4d;};}function handleError(_0x357c15,_0x221841){_0x221841=_0x221841||0x1f4;return function(_0x41f74c){logger[_0x8630('0x25')](_0x41f74c[_0x8630('0x26')]);if(_0x41f74c[_0x8630('0x27')]){delete _0x41f74c[_0x8630('0x27')];}_0x357c15[_0x8630('0x19')](_0x221841)['send'](_0x41f74c);};}exports[_0x8630('0x28')]=function(_0x4545c2,_0x24d85d){var _0xe3ed67={},_0x55653d={},_0x43e470={'count':0x0,'rows':[]};var _0x1eb036=_[_0x8630('0x29')](db[_0x8630('0x2a')][_0x8630('0x2b')],function(_0x32f4fd){return{'name':_0x32f4fd['fieldName'],'type':_0x32f4fd[_0x8630('0x2c')][_0x8630('0x2d')]};});_0x55653d[_0x8630('0x2e')]=_['map'](_0x1eb036,_0x8630('0x27'));_0x55653d[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x4545c2[_0x8630('0x2f')]);_0x55653d[_0x8630('0x31')]=_[_0x8630('0x32')](_0x55653d['model'],_0x55653d[_0x8630('0x2f')]);_0xe3ed67[_0x8630('0x33')]=_[_0x8630('0x32')](_0x55653d[_0x8630('0x2e')],qs[_0x8630('0x34')](_0x4545c2[_0x8630('0x2f')][_0x8630('0x34')]));_0xe3ed67[_0x8630('0x33')]=_0xe3ed67[_0x8630('0x33')][_0x8630('0x35')]?_0xe3ed67[_0x8630('0x33')]:_0x55653d[_0x8630('0x2e')];if(!_0x4545c2[_0x8630('0x2f')][_0x8630('0x36')](_0x8630('0x37'))){_0xe3ed67[_0x8630('0x1d')]=qs[_0x8630('0x1d')](_0x4545c2['query'][_0x8630('0x1d')]);_0xe3ed67[_0x8630('0x1c')]=qs['offset'](_0x4545c2['query'][_0x8630('0x1c')]);}_0xe3ed67[_0x8630('0x38')]=qs[_0x8630('0x39')](_0x4545c2[_0x8630('0x2f')][_0x8630('0x39')]);_0xe3ed67['where']=qs[_0x8630('0x31')](_[_0x8630('0x3a')](_0x4545c2[_0x8630('0x2f')],_0x55653d[_0x8630('0x31')]),_0x1eb036);if(_0x4545c2['query'][_0x8630('0x3b')]){_0xe3ed67[_0x8630('0x3c')]=_[_0x8630('0x3d')](_0xe3ed67[_0x8630('0x3c')],{'$or':_[_0x8630('0x29')](_0x1eb036,function(_0x16c041){if(_0x16c041[_0x8630('0x2c')]!=='VIRTUAL'){var _0x1076f4={};_0x1076f4[_0x16c041[_0x8630('0x27')]]={'$like':'%'+_0x4545c2[_0x8630('0x2f')][_0x8630('0x3b')]+'%'};return _0x1076f4;}})});}_0xe3ed67=_[_0x8630('0x3d')]({},_0xe3ed67,_0x4545c2[_0x8630('0x3e')]);var _0x25cb36={'where':_0xe3ed67[_0x8630('0x3c')]};return db[_0x8630('0x2a')][_0x8630('0x1b')](_0x25cb36)['then'](function(_0x358431){_0x43e470['count']=_0x358431;if(_0x4545c2[_0x8630('0x2f')][_0x8630('0x3f')]){_0xe3ed67[_0x8630('0x40')]=[{'all':!![]}];}return db[_0x8630('0x2a')][_0x8630('0x41')](_0xe3ed67);})[_0x8630('0x22')](function(_0x5bcf39){_0x43e470[_0x8630('0x42')]=_0x5bcf39;return _0x43e470;})[_0x8630('0x22')](respondWithFilteredResult(_0x24d85d,_0xe3ed67))[_0x8630('0x43')](handleError(_0x24d85d,null));};exports['show']=function(_0x79385,_0x1ea295){var _0x40914f={'raw':!![],'where':{'id':_0x79385[_0x8630('0x44')]['id']}},_0x327466={};_0x327466[_0x8630('0x2e')]=_['keys'](db[_0x8630('0x2a')][_0x8630('0x2b')]);_0x327466[_0x8630('0x2f')]=_['keys'](_0x79385[_0x8630('0x2f')]);_0x327466[_0x8630('0x31')]=_['intersection'](_0x327466[_0x8630('0x2e')],_0x327466[_0x8630('0x2f')]);_0x40914f[_0x8630('0x33')]=_['intersection'](_0x327466['model'],qs[_0x8630('0x34')](_0x79385['query']['fields']));_0x40914f[_0x8630('0x33')]=_0x40914f['attributes'][_0x8630('0x35')]?_0x40914f[_0x8630('0x33')]:_0x327466['model'];if(_0x79385[_0x8630('0x2f')][_0x8630('0x3f')]){_0x40914f[_0x8630('0x40')]=[{'all':!![]}];}_0x40914f=_[_0x8630('0x3d')]({},_0x40914f,_0x79385[_0x8630('0x3e')]);return db['Tag'][_0x8630('0x45')](_0x40914f)[_0x8630('0x22')](handleEntityNotFound(_0x1ea295,null))['then'](respondWithResult(_0x1ea295,null))[_0x8630('0x43')](handleError(_0x1ea295,null));};exports[_0x8630('0x46')]=function(_0x3ff20b,_0x47aa03){return db[_0x8630('0x2a')][_0x8630('0x46')](_0x3ff20b[_0x8630('0x47')],{})[_0x8630('0x22')](function(_0x8b467a){var _0xefe57b=_0x3ff20b[_0x8630('0x48')][_0x8630('0x24')]({'plain':!![]});if(!_0xefe57b)throw new Error(_0x8630('0x49'));if(_0xefe57b['role']==='user'){var _0x1b8328=_0x8b467a[_0x8630('0x24')]({'plain':!![]});var _0x34619c=_0x8630('0x4a');return db[_0x8630('0x4b')][_0x8630('0x45')]({'where':{'name':_0x34619c,'userProfileId':_0xefe57b[_0x8630('0x4c')]},'raw':!![]})['then'](function(_0x2af827){if(_0x2af827&&_0x2af827[_0x8630('0x4d')]===0x0){return db[_0x8630('0x4e')][_0x8630('0x46')]({'name':_0x1b8328[_0x8630('0x27')],'resourceId':_0x1b8328['id'],'type':_0x2af827['name'],'sectionId':_0x2af827['id']},{})[_0x8630('0x22')](function(){return _0x8b467a;});}else{return _0x8b467a;}})[_0x8630('0x43')](function(_0xeacec4){logger[_0x8630('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xeacec4);throw _0xeacec4;});}return _0x8b467a;})[_0x8630('0x22')](respondWithResult(_0x47aa03,0xc9))[_0x8630('0x43')](handleError(_0x47aa03,null));};exports['update']=function(_0x2edc3d,_0x1ecb2a){if(_0x2edc3d[_0x8630('0x47')]['id']){delete _0x2edc3d[_0x8630('0x47')]['id'];}return db['Tag'][_0x8630('0x45')]({'where':{'id':_0x2edc3d[_0x8630('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ecb2a,null))['then'](saveUpdates(_0x2edc3d[_0x8630('0x47')],null))[_0x8630('0x22')](respondWithResult(_0x1ecb2a,null))['catch'](handleError(_0x1ecb2a,null));};exports[_0x8630('0x23')]=function(_0x510113,_0x2e49c8){return db[_0x8630('0x2a')][_0x8630('0x45')]({'where':{'id':_0x510113['params']['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x2e49c8,null))[_0x8630('0x22')](removeEntity(_0x2e49c8,null))[_0x8630('0x43')](handleError(_0x2e49c8,null));}; \ No newline at end of file +var _0x7794=['stack','name','send','Tag','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','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','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','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','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','Tags','UserProfileResource','sendStatus','error'];(function(_0x3d77a3,_0x95660e){var _0x58fefc=function(_0x579ef1){while(--_0x579ef1){_0x3d77a3['push'](_0x3d77a3['shift']());}};_0x58fefc(++_0x95660e);}(_0x7794,0x7b));var _0x4779=function(_0x5aef4b,_0x13bd17){_0x5aef4b=_0x5aef4b-0x0;var _0x5eb33e=_0x7794[_0x5aef4b];return _0x5eb33e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4779('0x0'));var zipdir=require(_0x4779('0x1'));var jsonpatch=require(_0x4779('0x2'));var rp=require(_0x4779('0x3'));var moment=require('moment');var BPromise=require(_0x4779('0x4'));var Mustache=require(_0x4779('0x5'));var util=require('util');var path=require(_0x4779('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4779('0x7'));var _=require(_0x4779('0x8'));var squel=require('squel');var crypto=require(_0x4779('0x9'));var jsforce=require(_0x4779('0xa'));var deskjs=require(_0x4779('0xb'));var toCsv=require(_0x4779('0xc'));var querystring=require(_0x4779('0xd'));var Papa=require(_0x4779('0xe'));var Redis=require(_0x4779('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4779('0x10'));var as=require(_0x4779('0x11'));var hardwareService=require(_0x4779('0x12'));var logger=require(_0x4779('0x13'))(_0x4779('0x14'));var utils=require(_0x4779('0x15'));var config=require(_0x4779('0x16'));var licenseUtil=require(_0x4779('0x17'));var db=require(_0x4779('0x18'))['db'];function respondWithStatusCode(_0x13c989,_0x50e17e){_0x50e17e=_0x50e17e||0xcc;return function(_0x5b1219){if(_0x5b1219){return _0x13c989['sendStatus'](_0x50e17e);}return _0x13c989[_0x4779('0x19')](_0x50e17e)[_0x4779('0x1a')]();};}function respondWithResult(_0xb9a06f,_0xddf5cd){_0xddf5cd=_0xddf5cd||0xc8;return function(_0x4fe370){if(_0x4fe370){return _0xb9a06f[_0x4779('0x19')](_0xddf5cd)[_0x4779('0x1b')](_0x4fe370);}};}function respondWithFilteredResult(_0x4d71a0,_0x599deb){return function(_0x1dbbe1){if(_0x1dbbe1){var _0x2de2be=typeof _0x599deb[_0x4779('0x1c')]===_0x4779('0x1d')&&typeof _0x599deb['limit']==='undefined';var _0x445e0b=_0x1dbbe1[_0x4779('0x1e')];var _0x19fbb6=_0x2de2be?0x0:_0x599deb['offset'];var _0x3dbe70=_0x2de2be?_0x1dbbe1['count']:_0x599deb[_0x4779('0x1c')]+_0x599deb[_0x4779('0x1f')];var _0x478fa5;if(_0x3dbe70>=_0x445e0b){_0x3dbe70=_0x445e0b;_0x478fa5=0xc8;}else{_0x478fa5=0xce;}_0x4d71a0[_0x4779('0x19')](_0x478fa5);return _0x4d71a0['set'](_0x4779('0x20'),_0x19fbb6+'-'+_0x3dbe70+'/'+_0x445e0b)[_0x4779('0x1b')](_0x1dbbe1);}return null;};}function patchUpdates(_0x143ef6){return function(_0x298e25){try{jsonpatch[_0x4779('0x21')](_0x298e25,_0x143ef6,!![]);}catch(_0x1ce270){return BPromise['reject'](_0x1ce270);}return _0x298e25[_0x4779('0x22')]();};}function saveUpdates(_0x4f2158,_0x4ad246){return function(_0xd983f0){if(_0xd983f0){return _0xd983f0[_0x4779('0x23')](_0x4f2158)[_0x4779('0x24')](function(_0x2b7ab6){return _0x2b7ab6;});}return null;};}function removeEntity(_0x555cd6,_0x152887){return function(_0x29a39a){if(_0x29a39a){return _0x29a39a[_0x4779('0x25')]()['then'](function(){var _0x340648=_0x29a39a[_0x4779('0x26')]({'plain':!![]});var _0x577b13=_0x4779('0x27');return db[_0x4779('0x28')]['destroy']({'where':{'type':_0x577b13,'resourceId':_0x340648['id']}})[_0x4779('0x24')](function(){return _0x29a39a;});})[_0x4779('0x24')](function(){_0x555cd6[_0x4779('0x19')](0xcc)[_0x4779('0x1a')]();});}};}function handleEntityNotFound(_0x2634c2,_0x254562){return function(_0xeb1850){if(!_0xeb1850){_0x2634c2[_0x4779('0x29')](0x194);}return _0xeb1850;};}function handleError(_0x4b9066,_0x44c162){_0x44c162=_0x44c162||0x1f4;return function(_0x1607a5){logger[_0x4779('0x2a')](_0x1607a5[_0x4779('0x2b')]);if(_0x1607a5[_0x4779('0x2c')]){delete _0x1607a5[_0x4779('0x2c')];}_0x4b9066[_0x4779('0x19')](_0x44c162)[_0x4779('0x2d')](_0x1607a5);};}exports['index']=function(_0x5b1b36,_0x179717){var _0x986bed={},_0xc7e4d1={},_0x15da6d={'count':0x0,'rows':[]};var _0x335d48=_['map'](db[_0x4779('0x2e')][_0x4779('0x2f')],function(_0x1fa222){return{'name':_0x1fa222[_0x4779('0x30')],'type':_0x1fa222['type']['key']};});_0xc7e4d1[_0x4779('0x31')]=_['map'](_0x335d48,_0x4779('0x2c'));_0xc7e4d1[_0x4779('0x32')]=_[_0x4779('0x33')](_0x5b1b36[_0x4779('0x32')]);_0xc7e4d1[_0x4779('0x34')]=_[_0x4779('0x35')](_0xc7e4d1[_0x4779('0x31')],_0xc7e4d1[_0x4779('0x32')]);_0x986bed[_0x4779('0x36')]=_[_0x4779('0x35')](_0xc7e4d1[_0x4779('0x31')],qs[_0x4779('0x37')](_0x5b1b36['query']['fields']));_0x986bed[_0x4779('0x36')]=_0x986bed['attributes'][_0x4779('0x38')]?_0x986bed['attributes']:_0xc7e4d1[_0x4779('0x31')];if(!_0x5b1b36[_0x4779('0x32')][_0x4779('0x39')](_0x4779('0x3a'))){_0x986bed[_0x4779('0x1f')]=qs['limit'](_0x5b1b36['query'][_0x4779('0x1f')]);_0x986bed[_0x4779('0x1c')]=qs[_0x4779('0x1c')](_0x5b1b36[_0x4779('0x32')][_0x4779('0x1c')]);}_0x986bed[_0x4779('0x3b')]=qs[_0x4779('0x3c')](_0x5b1b36[_0x4779('0x32')][_0x4779('0x3c')]);_0x986bed[_0x4779('0x3d')]=qs[_0x4779('0x34')](_[_0x4779('0x3e')](_0x5b1b36[_0x4779('0x32')],_0xc7e4d1[_0x4779('0x34')]),_0x335d48);if(_0x5b1b36[_0x4779('0x32')][_0x4779('0x3f')]){_0x986bed[_0x4779('0x3d')]=_[_0x4779('0x40')](_0x986bed[_0x4779('0x3d')],{'$or':_['map'](_0x335d48,function(_0xa48aa1){if(_0xa48aa1['type']!==_0x4779('0x41')){var _0x1cc7da={};_0x1cc7da[_0xa48aa1[_0x4779('0x2c')]]={'$like':'%'+_0x5b1b36[_0x4779('0x32')][_0x4779('0x3f')]+'%'};return _0x1cc7da;}})});}_0x986bed=_[_0x4779('0x40')]({},_0x986bed,_0x5b1b36['options']);var _0x2ab9c3={'where':_0x986bed['where']};return db[_0x4779('0x2e')][_0x4779('0x1e')](_0x2ab9c3)[_0x4779('0x24')](function(_0x3a3589){_0x15da6d[_0x4779('0x1e')]=_0x3a3589;if(_0x5b1b36[_0x4779('0x32')]['includeAll']){_0x986bed[_0x4779('0x42')]=[{'all':!![]}];}return db['Tag'][_0x4779('0x43')](_0x986bed);})[_0x4779('0x24')](function(_0x2e60ab){_0x15da6d['rows']=_0x2e60ab;return _0x15da6d;})[_0x4779('0x24')](respondWithFilteredResult(_0x179717,_0x986bed))[_0x4779('0x44')](handleError(_0x179717,null));};exports[_0x4779('0x45')]=function(_0x15520d,_0xbc5a86){var _0x3b0bfd={'raw':!![],'where':{'id':_0x15520d[_0x4779('0x46')]['id']}},_0x13f768={};_0x13f768[_0x4779('0x31')]=_[_0x4779('0x33')](db[_0x4779('0x2e')][_0x4779('0x2f')]);_0x13f768[_0x4779('0x32')]=_[_0x4779('0x33')](_0x15520d[_0x4779('0x32')]);_0x13f768['filters']=_['intersection'](_0x13f768[_0x4779('0x31')],_0x13f768[_0x4779('0x32')]);_0x3b0bfd[_0x4779('0x36')]=_[_0x4779('0x35')](_0x13f768[_0x4779('0x31')],qs[_0x4779('0x37')](_0x15520d[_0x4779('0x32')][_0x4779('0x37')]));_0x3b0bfd['attributes']=_0x3b0bfd[_0x4779('0x36')][_0x4779('0x38')]?_0x3b0bfd[_0x4779('0x36')]:_0x13f768[_0x4779('0x31')];if(_0x15520d[_0x4779('0x32')][_0x4779('0x47')]){_0x3b0bfd['include']=[{'all':!![]}];}_0x3b0bfd=_[_0x4779('0x40')]({},_0x3b0bfd,_0x15520d[_0x4779('0x48')]);return db[_0x4779('0x2e')][_0x4779('0x49')](_0x3b0bfd)[_0x4779('0x24')](handleEntityNotFound(_0xbc5a86,null))['then'](respondWithResult(_0xbc5a86,null))[_0x4779('0x44')](handleError(_0xbc5a86,null));};exports[_0x4779('0x4a')]=function(_0x3873d4,_0x4a1040){return db[_0x4779('0x2e')]['create'](_0x3873d4[_0x4779('0x4b')],{})[_0x4779('0x24')](function(_0x397216){var _0x4f0aaf=_0x3873d4[_0x4779('0x4c')]['get']({'plain':!![]});if(!_0x4f0aaf)throw new Error(_0x4779('0x4d'));if(_0x4f0aaf[_0x4779('0x4e')]===_0x4779('0x4c')){var _0x58e14e=_0x397216['get']({'plain':!![]});var _0x5dc79a=_0x4779('0x27');return db[_0x4779('0x4f')]['find']({'where':{'name':_0x5dc79a,'userProfileId':_0x4f0aaf[_0x4779('0x50')]},'raw':!![]})[_0x4779('0x24')](function(_0x3c7493){if(_0x3c7493&&_0x3c7493[_0x4779('0x51')]===0x0){return db[_0x4779('0x28')]['create']({'name':_0x58e14e[_0x4779('0x2c')],'resourceId':_0x58e14e['id'],'type':_0x3c7493[_0x4779('0x2c')],'sectionId':_0x3c7493['id']},{})[_0x4779('0x24')](function(){return _0x397216;});}else{return _0x397216;}})[_0x4779('0x44')](function(_0x15c180){logger[_0x4779('0x2a')](_0x4779('0x52'),_0x15c180);throw _0x15c180;});}return _0x397216;})[_0x4779('0x24')](respondWithResult(_0x4a1040,0xc9))['catch'](handleError(_0x4a1040,null));};exports['update']=function(_0x1e4bff,_0x34e951){if(_0x1e4bff[_0x4779('0x4b')]['id']){delete _0x1e4bff[_0x4779('0x4b')]['id'];}return db['Tag'][_0x4779('0x49')]({'where':{'id':_0x1e4bff[_0x4779('0x46')]['id']}})['then'](handleEntityNotFound(_0x34e951,null))[_0x4779('0x24')](saveUpdates(_0x1e4bff[_0x4779('0x4b')],null))[_0x4779('0x24')](respondWithResult(_0x34e951,null))['catch'](handleError(_0x34e951,null));};exports['destroy']=function(_0x225734,_0xe836e0){return db['Tag'][_0x4779('0x49')]({'where':{'id':_0x225734[_0x4779('0x46')]['id']}})[_0x4779('0x24')](handleEntityNotFound(_0xe836e0,null))[_0x4779('0x24')](removeEntity(_0xe836e0,null))[_0x4779('0x44')](handleError(_0xe836e0,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index b189060..cbff002 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 _0x7b72=['../../config/logger','moment','bluebird','request-promise','rimraf','./tag.attributes','exports','define','tools_tags','lodash','util'];(function(_0x167914,_0x87b5a){var _0x5e5d79=function(_0x221d4e){while(--_0x221d4e){_0x167914['push'](_0x167914['shift']());}};_0x5e5d79(++_0x87b5a);}(_0x7b72,0xb9));var _0x27b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x27b7('0x0'));var util=require(_0x27b7('0x1'));var logger=require(_0x27b7('0x2'))('api');var moment=require(_0x27b7('0x3'));var BPromise=require(_0x27b7('0x4'));var rp=require(_0x27b7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x27b7('0x7'));module[_0x27b7('0x8')]=function(_0x45b85f,_0x423b22){return _0x45b85f[_0x27b7('0x9')]('Tag',attributes,{'tableName':_0x27b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a9c=['Tag','tools_tags','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./tag.attributes','exports','define'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a9('0x0'));var util=require(_0xc8a9('0x1'));var logger=require(_0xc8a9('0x2'))(_0xc8a9('0x3'));var moment=require(_0xc8a9('0x4'));var BPromise=require('bluebird');var rp=require(_0xc8a9('0x5'));var fs=require('fs');var path=require(_0xc8a9('0x6'));var rimraf=require('rimraf');var config=require(_0xc8a9('0x7'));var attributes=require(_0xc8a9('0x8'));module[_0xc8a9('0x9')]=function(_0x4c1e04,_0xb4340b){return _0x4c1e04[_0xc8a9('0xa')](_0xc8a9('0xb'),attributes,{'tableName':_0xc8a9('0xc'),'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 30bdcbe..eba7f35 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 _0x0faf=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x48a925,_0x23b174){var _0x35fa00=function(_0xb2a29){while(--_0xb2a29){_0x48a925['push'](_0x48a925['shift']());}};_0x35fa00(++_0x23b174);}(_0x0faf,0x132));var _0xf0fa=function(_0x4976eb,_0x4b09d1){_0x4976eb=_0x4976eb-0x0;var _0x5dd7b2=_0x0faf[_0x4976eb];return _0x5dd7b2;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var moment=require(_0xf0fa('0x1'));var BPromise=require(_0xf0fa('0x2'));var rs=require(_0xf0fa('0x3'));var fs=require('fs');var Redis=require(_0xf0fa('0x4'));var db=require(_0xf0fa('0x5'))['db'];var utils=require(_0xf0fa('0x6'));var logger=require(_0xf0fa('0x7'))(_0xf0fa('0x8'));var config=require(_0xf0fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0fa('0xa')][_0xf0fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25b5c4,_0x3a703b,_0x2db1d9){return new BPromise(function(_0x587865,_0x42f7fd){return client[_0xf0fa('0xc')](_0x25b5c4,_0x2db1d9)['then'](function(_0x4df4d1){logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));logger[_0xf0fa('0x10')](_0xf0fa('0x11'),_0x3a703b,_0xf0fa('0xf'),JSON[_0xf0fa('0x12')](_0x4df4d1));if(_0x4df4d1[_0xf0fa('0x13')]){if(_0x4df4d1['error'][_0xf0fa('0x14')]===0x1f4){logger['error'](_0xf0fa('0xe'),_0x3a703b,_0x4df4d1['error'][_0xf0fa('0x15')]);return _0x42f7fd(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}logger['error']('Tag,\x20%s,\x20%s',_0x3a703b,_0x4df4d1[_0xf0fa('0x13')]['message']);return _0x587865(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}else{logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));_0x587865(_0x4df4d1[_0xf0fa('0x16')][_0xf0fa('0x15')]);}})[_0xf0fa('0x17')](function(_0x497542){logger[_0xf0fa('0x13')](_0xf0fa('0xe'),_0x3a703b,_0x497542);_0x42f7fd(_0x497542);});});} \ No newline at end of file +var _0x919e=['client','http','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','Tag,\x20%s,\x20%s','message','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x34dbf7,_0x32f0ad){var _0x509757=function(_0x502cc5){while(--_0x502cc5){_0x34dbf7['push'](_0x34dbf7['shift']());}};_0x509757(++_0x32f0ad);}(_0x919e,0x1d7));var _0xe919=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x919e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe919('0x0'));var util=require(_0xe919('0x1'));var moment=require(_0xe919('0x2'));var BPromise=require('bluebird');var rs=require(_0xe919('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe919('0x4'));var logger=require(_0xe919('0x5'))(_0xe919('0x6'));var config=require(_0xe919('0x7'));var jayson=require(_0xe919('0x8'));var client=jayson[_0xe919('0x9')][_0xe919('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x493b47,_0x7c1fa4,_0x2ceb41){return new BPromise(function(_0x57c3fe,_0x44d418){return client['request'](_0x493b47,_0x2ceb41)[_0xe919('0xb')](function(_0x22ea65){logger[_0xe919('0xc')]('Tag,\x20%s,\x20%s',_0x7c1fa4,_0xe919('0xd'));logger[_0xe919('0xe')](_0xe919('0xf'),_0x7c1fa4,'request\x20sent',JSON[_0xe919('0x10')](_0x22ea65));if(_0x22ea65['error']){if(_0x22ea65['error']['code']===0x1f4){logger[_0xe919('0x11')](_0xe919('0x12'),_0x7c1fa4,_0x22ea65[_0xe919('0x11')]['message']);return _0x44d418(_0x22ea65['error'][_0xe919('0x13')]);}logger[_0xe919('0x11')]('Tag,\x20%s,\x20%s',_0x7c1fa4,_0x22ea65[_0xe919('0x11')][_0xe919('0x13')]);return _0x57c3fe(_0x22ea65[_0xe919('0x11')][_0xe919('0x13')]);}else{logger[_0xe919('0xc')](_0xe919('0x12'),_0x7c1fa4,_0xe919('0xd'));_0x57c3fe(_0x22ea65['result'][_0xe919('0x13')]);}})['catch'](function(_0x5ba7ad){logger[_0xe919('0x11')](_0xe919('0x12'),_0x7c1fa4,_0x5ba7ad);_0x44d418(_0x5ba7ad);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index ab00f4b..5c6794d 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_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['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 450f127..f29d3fb 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 _0xb10b=['name','sequelize','STRING'];(function(_0x4944ab,_0x52cd51){var _0x4b4a0c=function(_0x575c08){while(--_0x575c08){_0x4944ab['push'](_0x4944ab['shift']());}};_0x4b4a0c(++_0x52cd51);}(_0xb10b,0x12a));var _0xbb10=function(_0x277c19,_0x22f714){_0x277c19=_0x277c19-0x0;var _0x3281e5=_0xb10b[_0x277c19];return _0x3281e5;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x20a17e,_0x256cb9){var _0x531898=function(_0xdca534){while(--_0xdca534){_0x20a17e['push'](_0x20a17e['shift']());}};_0x531898(++_0x256cb9);}(_0x2032,0xd9));var _0x2203=function(_0x401af7,_0x5bbf0e){_0x401af7=_0x401af7-0x0;var _0x1db3b6=_0x2032[_0x401af7];return _0x1db3b6;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index eeed583..3a0da90 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 _0xd5a9=['defaults','localhost','./team.socket','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','Teams','UserProfileResource','error','stack','name','send','index','Team','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','toLowerCase','Queue','order','capitalize','Queues','addQueues','add','ids','remove','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','Voice','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','format','SIP/%s','interface','all','addAgents','spread','removeAgents','sequelize','parse','Queue:remove','getAgents','User','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x559bf0,_0x19fc48){var _0x33d87c=function(_0x462b6d){while(--_0x462b6d){_0x559bf0['push'](_0x559bf0['shift']());}};_0x33d87c(++_0x19fc48);}(_0xd5a9,0x6a));var _0x9d5a=function(_0x4700ce,_0x1d9240){_0x4700ce=_0x4700ce-0x0;var _0x4b910c=_0xd5a9[_0x4700ce];return _0x4b910c;};'use strict';var emlformat=require(_0x9d5a('0x0'));var rimraf=require(_0x9d5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d5a('0x2'));var rp=require(_0x9d5a('0x3'));var moment=require(_0x9d5a('0x4'));var BPromise=require(_0x9d5a('0x5'));var Mustache=require(_0x9d5a('0x6'));var util=require(_0x9d5a('0x7'));var path=require(_0x9d5a('0x8'));var sox=require(_0x9d5a('0x9'));var csv=require(_0x9d5a('0xa'));var ejs=require(_0x9d5a('0xb'));var fs=require('fs');var fs_extra=require(_0x9d5a('0xc'));var _=require(_0x9d5a('0xd'));var squel=require(_0x9d5a('0xe'));var crypto=require(_0x9d5a('0xf'));var jsforce=require(_0x9d5a('0x10'));var deskjs=require(_0x9d5a('0x11'));var toCsv=require(_0x9d5a('0xa'));var querystring=require(_0x9d5a('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9d5a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d5a('0x14'))(_0x9d5a('0x15'));var utils=require(_0x9d5a('0x16'));var config=require(_0x9d5a('0x17'));var licenseUtil=require(_0x9d5a('0x18'));var db=require(_0x9d5a('0x19'))['db'];config[_0x9d5a('0x1a')]=_[_0x9d5a('0x1b')](config[_0x9d5a('0x1a')],{'host':_0x9d5a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d5a('0x1a')]));require(_0x9d5a('0x1d'))['register'](socket);function respondWithStatusCode(_0x1a409,_0x292bd8){_0x292bd8=_0x292bd8||0xcc;return function(_0x578057){if(_0x578057){return _0x1a409[_0x9d5a('0x1e')](_0x292bd8);}return _0x1a409[_0x9d5a('0x1f')](_0x292bd8)['end']();};}function respondWithResult(_0x3ba0db,_0x4a44b5){_0x4a44b5=_0x4a44b5||0xc8;return function(_0x4e59b0){if(_0x4e59b0){return _0x3ba0db[_0x9d5a('0x1f')](_0x4a44b5)[_0x9d5a('0x20')](_0x4e59b0);}};}function respondWithFilteredResult(_0x5dba1f,_0xc39a4a){return function(_0x468d6c){if(_0x468d6c){var _0x18620c=typeof _0xc39a4a[_0x9d5a('0x21')]===_0x9d5a('0x22')&&typeof _0xc39a4a[_0x9d5a('0x23')]==='undefined';var _0x5a3757=_0x468d6c[_0x9d5a('0x24')];var _0x5eab63=_0x18620c?0x0:_0xc39a4a[_0x9d5a('0x21')];var _0x2c2abe=_0x18620c?_0x468d6c['count']:_0xc39a4a[_0x9d5a('0x21')]+_0xc39a4a[_0x9d5a('0x23')];var _0x1cf980;if(_0x2c2abe>=_0x5a3757){_0x2c2abe=_0x5a3757;_0x1cf980=0xc8;}else{_0x1cf980=0xce;}_0x5dba1f[_0x9d5a('0x1f')](_0x1cf980);return _0x5dba1f[_0x9d5a('0x25')]('Content-Range',_0x5eab63+'-'+_0x2c2abe+'/'+_0x5a3757)[_0x9d5a('0x20')](_0x468d6c);}return null;};}function patchUpdates(_0x3e5f70){return function(_0x1487fe){try{jsonpatch[_0x9d5a('0x26')](_0x1487fe,_0x3e5f70,!![]);}catch(_0x49f0a7){return BPromise[_0x9d5a('0x27')](_0x49f0a7);}return _0x1487fe['save']();};}function saveUpdates(_0x3df849,_0x55a7f5){return function(_0x29876f){if(_0x29876f){return _0x29876f[_0x9d5a('0x28')](_0x3df849)[_0x9d5a('0x29')](function(_0xb29c6e){return _0xb29c6e;});}return null;};}function removeEntity(_0x57af3,_0x4aaba4){return function(_0xa57728){if(_0xa57728){return _0xa57728[_0x9d5a('0x2a')]()['then'](function(){var _0x38f105=_0xa57728[_0x9d5a('0x2b')]({'plain':!![]});var _0x6e4807=_0x9d5a('0x2c');return db[_0x9d5a('0x2d')]['destroy']({'where':{'type':_0x6e4807,'resourceId':_0x38f105['id']}})[_0x9d5a('0x29')](function(){return _0xa57728;});})[_0x9d5a('0x29')](function(){_0x57af3[_0x9d5a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x871d73,_0x1eae1d){return function(_0x4d138){if(!_0x4d138){_0x871d73['sendStatus'](0x194);}return _0x4d138;};}function handleError(_0x319c0e,_0x1e1952){_0x1e1952=_0x1e1952||0x1f4;return function(_0x33fff1){logger[_0x9d5a('0x2e')](_0x33fff1[_0x9d5a('0x2f')]);if(_0x33fff1[_0x9d5a('0x30')]){delete _0x33fff1['name'];}_0x319c0e['status'](_0x1e1952)[_0x9d5a('0x31')](_0x33fff1);};}exports[_0x9d5a('0x32')]=function(_0x2767d5,_0x3677e3){var _0x28c9fd={},_0x544189={},_0x4628c2={'count':0x0,'rows':[]};var _0x264446=_['map'](db[_0x9d5a('0x33')]['rawAttributes'],function(_0x453904){return{'name':_0x453904['fieldName'],'type':_0x453904[_0x9d5a('0x34')][_0x9d5a('0x35')]};});_0x544189[_0x9d5a('0x36')]=_['map'](_0x264446,_0x9d5a('0x30'));_0x544189[_0x9d5a('0x37')]=_[_0x9d5a('0x38')](_0x2767d5[_0x9d5a('0x37')]);_0x544189[_0x9d5a('0x39')]=_[_0x9d5a('0x3a')](_0x544189[_0x9d5a('0x36')],_0x544189[_0x9d5a('0x37')]);_0x28c9fd['attributes']=_[_0x9d5a('0x3a')](_0x544189['model'],qs[_0x9d5a('0x3b')](_0x2767d5[_0x9d5a('0x37')][_0x9d5a('0x3b')]));_0x28c9fd[_0x9d5a('0x3c')]=_0x28c9fd[_0x9d5a('0x3c')][_0x9d5a('0x3d')]?_0x28c9fd['attributes']:_0x544189['model'];if(!_0x2767d5['query']['hasOwnProperty'](_0x9d5a('0x3e'))){_0x28c9fd['limit']=qs[_0x9d5a('0x23')](_0x2767d5[_0x9d5a('0x37')][_0x9d5a('0x23')]);_0x28c9fd['offset']=qs['offset'](_0x2767d5[_0x9d5a('0x37')][_0x9d5a('0x21')]);}_0x28c9fd['order']=qs[_0x9d5a('0x3f')](_0x2767d5[_0x9d5a('0x37')][_0x9d5a('0x3f')]);_0x28c9fd[_0x9d5a('0x40')]=qs['filters'](_[_0x9d5a('0x41')](_0x2767d5[_0x9d5a('0x37')],_0x544189['filters']),_0x264446);if(_0x2767d5[_0x9d5a('0x37')][_0x9d5a('0x42')]){_0x28c9fd[_0x9d5a('0x40')]=_[_0x9d5a('0x43')](_0x28c9fd[_0x9d5a('0x40')],{'$or':_[_0x9d5a('0x44')](_0x264446,function(_0x5109f7){if(_0x5109f7['type']!==_0x9d5a('0x45')){var _0x22073d={};_0x22073d[_0x5109f7['name']]={'$like':'%'+_0x2767d5[_0x9d5a('0x37')][_0x9d5a('0x42')]+'%'};return _0x22073d;}})});}_0x28c9fd=_[_0x9d5a('0x43')]({},_0x28c9fd,_0x2767d5[_0x9d5a('0x46')]);var _0x5a81aa={'where':_0x28c9fd['where']};return db['Team']['count'](_0x5a81aa)['then'](function(_0x35502c){_0x4628c2[_0x9d5a('0x24')]=_0x35502c;if(_0x2767d5[_0x9d5a('0x37')]['includeAll']){_0x28c9fd[_0x9d5a('0x47')]=[{'all':!![]}];}return db[_0x9d5a('0x33')][_0x9d5a('0x48')](_0x28c9fd);})['then'](function(_0x411fbe){_0x4628c2[_0x9d5a('0x49')]=_0x411fbe;return _0x4628c2;})[_0x9d5a('0x29')](respondWithFilteredResult(_0x3677e3,_0x28c9fd))[_0x9d5a('0x4a')](handleError(_0x3677e3,null));};exports[_0x9d5a('0x4b')]=function(_0x5888f7,_0x410834){var _0x376907={'raw':![],'where':{'id':_0x5888f7['params']['id']}},_0x3058b6={};_0x3058b6['model']=_[_0x9d5a('0x38')](db[_0x9d5a('0x33')][_0x9d5a('0x4c')]);_0x3058b6[_0x9d5a('0x37')]=_[_0x9d5a('0x38')](_0x5888f7[_0x9d5a('0x37')]);_0x3058b6['filters']=_[_0x9d5a('0x3a')](_0x3058b6[_0x9d5a('0x36')],_0x3058b6[_0x9d5a('0x37')]);_0x376907['attributes']=_[_0x9d5a('0x3a')](_0x3058b6['model'],qs[_0x9d5a('0x3b')](_0x5888f7[_0x9d5a('0x37')][_0x9d5a('0x3b')]));_0x376907['attributes']=_0x376907[_0x9d5a('0x3c')][_0x9d5a('0x3d')]?_0x376907[_0x9d5a('0x3c')]:_0x3058b6[_0x9d5a('0x36')];if(_0x5888f7[_0x9d5a('0x37')]['includeAll']){_0x376907[_0x9d5a('0x47')]=[{'all':!![]}];}_0x376907=_['merge']({},_0x376907,_0x5888f7[_0x9d5a('0x46')]);return db[_0x9d5a('0x33')][_0x9d5a('0x4d')](_0x376907)[_0x9d5a('0x29')](handleEntityNotFound(_0x410834,null))[_0x9d5a('0x29')](respondWithResult(_0x410834,null))[_0x9d5a('0x4a')](handleError(_0x410834,null));};exports[_0x9d5a('0x4e')]=function(_0x3058cf,_0x30977c){return db[_0x9d5a('0x33')][_0x9d5a('0x4e')](_0x3058cf[_0x9d5a('0x4f')],{})[_0x9d5a('0x29')](function(_0x2450ec){var _0x161914=_0x3058cf[_0x9d5a('0x50')][_0x9d5a('0x2b')]({'plain':!![]});if(!_0x161914)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x161914[_0x9d5a('0x51')]===_0x9d5a('0x50')){var _0x374715=_0x2450ec['get']({'plain':!![]});var _0x13768a=_0x9d5a('0x2c');return db[_0x9d5a('0x52')][_0x9d5a('0x4d')]({'where':{'name':_0x13768a,'userProfileId':_0x161914[_0x9d5a('0x53')]},'raw':!![]})[_0x9d5a('0x29')](function(_0x7c56c){if(_0x7c56c&&_0x7c56c['autoAssociation']===0x0){return db['UserProfileResource'][_0x9d5a('0x4e')]({'name':_0x374715[_0x9d5a('0x30')],'resourceId':_0x374715['id'],'type':_0x7c56c[_0x9d5a('0x30')],'sectionId':_0x7c56c['id']},{})[_0x9d5a('0x29')](function(){return _0x2450ec;});}else{return _0x2450ec;}})[_0x9d5a('0x4a')](function(_0x20e42b){logger['error'](_0x9d5a('0x54'),_0x20e42b);throw _0x20e42b;});}return _0x2450ec;})[_0x9d5a('0x29')](respondWithResult(_0x30977c,0xc9))[_0x9d5a('0x4a')](handleError(_0x30977c,null));};exports[_0x9d5a('0x28')]=function(_0x1f66f2,_0x75a3a8){if(_0x1f66f2[_0x9d5a('0x4f')]['id']){delete _0x1f66f2[_0x9d5a('0x4f')]['id'];}return db[_0x9d5a('0x33')]['find']({'where':{'id':_0x1f66f2[_0x9d5a('0x55')]['id']}})[_0x9d5a('0x29')](handleEntityNotFound(_0x75a3a8,null))[_0x9d5a('0x29')](saveUpdates(_0x1f66f2['body'],null))[_0x9d5a('0x29')](respondWithResult(_0x75a3a8,null))[_0x9d5a('0x4a')](handleError(_0x75a3a8,null));};exports[_0x9d5a('0x2a')]=function(_0x2ef1aa,_0x4d5ffb){return db[_0x9d5a('0x33')][_0x9d5a('0x4d')]({'where':{'id':_0x2ef1aa[_0x9d5a('0x55')]['id']}})[_0x9d5a('0x29')](handleEntityNotFound(_0x4d5ffb,null))[_0x9d5a('0x29')](removeEntity(_0x4d5ffb,null))['catch'](handleError(_0x4d5ffb,null));};exports[_0x9d5a('0x56')]=function(_0x4a5521,_0x330f72,_0x3e8f88){return db[_0x9d5a('0x33')][_0x9d5a('0x57')]({'where':{'id':_0x4a5521[_0x9d5a('0x55')]['id']}})['then'](handleEntityNotFound(_0x330f72,null))[_0x9d5a('0x29')](function(_0x3d3894){if(!_0x4a5521['query'][_0x9d5a('0x58')]||!utils[_0x9d5a('0x59')](_0x4a5521['query']['channel'])){throw new db[(_0x9d5a('0x5a'))][(_0x9d5a('0x5b'))](_0x9d5a('0x5c'));}var _0x30feff={};var _0x3cc5f8={};_0x3cc5f8[_0x9d5a('0x36')]=_['keys'](db[_['capitalize'](_0x4a5521[_0x9d5a('0x37')][_0x9d5a('0x58')][_0x9d5a('0x5d')]())+_0x9d5a('0x5e')][_0x9d5a('0x4c')]);_0x3cc5f8[_0x9d5a('0x37')]=_[_0x9d5a('0x38')](_0x4a5521[_0x9d5a('0x37')]);_0x3cc5f8[_0x9d5a('0x39')]=_[_0x9d5a('0x3a')](_0x3cc5f8[_0x9d5a('0x36')],_0x3cc5f8['query']);_0x30feff[_0x9d5a('0x3c')]=_[_0x9d5a('0x3a')](_0x3cc5f8[_0x9d5a('0x36')],qs[_0x9d5a('0x3b')](_0x4a5521[_0x9d5a('0x37')]['fields']));_0x30feff[_0x9d5a('0x3c')]=_0x30feff[_0x9d5a('0x3c')][_0x9d5a('0x3d')]?_0x30feff['attributes']:_0x3cc5f8[_0x9d5a('0x36')];_0x30feff['limit']=qs['limit'](_0x4a5521[_0x9d5a('0x37')][_0x9d5a('0x23')]);_0x30feff[_0x9d5a('0x21')]=qs[_0x9d5a('0x21')](_0x4a5521[_0x9d5a('0x37')][_0x9d5a('0x21')]);_0x30feff[_0x9d5a('0x5f')]=qs['sort'](_0x4a5521[_0x9d5a('0x37')][_0x9d5a('0x3f')]);_0x30feff['where']=qs[_0x9d5a('0x39')](_['pick'](_0x4a5521[_0x9d5a('0x37')],_0x3cc5f8[_0x9d5a('0x39')]));_0x30feff=_[_0x9d5a('0x43')]({},_0x30feff,_0x4a5521['options']);return _0x3d3894[_0x9d5a('0x2b')+_[_0x9d5a('0x60')](_0x4a5521['query']['channel'][_0x9d5a('0x5d')]())+_0x9d5a('0x61')](_0x30feff);})['then'](respondWithResult(_0x330f72,null))[_0x9d5a('0x4a')](handleError(_0x330f72,null));};exports[_0x9d5a('0x62')]=function(_0x337fd2,_0x98184a,_0x243ca6){return db['Team']['findOne']({'where':{'id':_0x337fd2[_0x9d5a('0x55')]['id']}})[_0x9d5a('0x29')](function(_0x4cc5d3){if(_0x4cc5d3){if(!_0x337fd2[_0x9d5a('0x4f')][_0x9d5a('0x58')]||!utils[_0x9d5a('0x59')](_0x337fd2[_0x9d5a('0x4f')]['channel'])){throw new db['Sequelize'][(_0x9d5a('0x5b'))](_0x9d5a('0x5c'));}return _0x4cc5d3[_0x9d5a('0x63')+_[_0x9d5a('0x60')](_0x337fd2[_0x9d5a('0x4f')]['channel'][_0x9d5a('0x5d')]())+_0x9d5a('0x61')](_0x337fd2[_0x9d5a('0x4f')][_0x9d5a('0x64')]);}return null;})[_0x9d5a('0x29')](handleEntityNotFound(_0x98184a,null))[_0x9d5a('0x29')](respondWithStatusCode(_0x98184a,null))['catch'](handleError(_0x98184a,null));};exports['removeQueues']=function(_0x3f021c,_0x5c4921,_0x1d5f84){return db[_0x9d5a('0x33')][_0x9d5a('0x57')]({'where':{'id':_0x3f021c[_0x9d5a('0x55')]['id']}})[_0x9d5a('0x29')](function(_0x930e52){if(_0x930e52){if(!_0x3f021c[_0x9d5a('0x37')]['channel']||!utils['isValidChannel'](_0x3f021c['query'][_0x9d5a('0x58')])){throw new db['Sequelize'][(_0x9d5a('0x5b'))](_0x9d5a('0x5c'));}return _0x930e52[_0x9d5a('0x65')+_[_0x9d5a('0x60')](_0x3f021c[_0x9d5a('0x37')][_0x9d5a('0x58')][_0x9d5a('0x5d')]())+_0x9d5a('0x61')](_0x3f021c[_0x9d5a('0x37')][_0x9d5a('0x64')]);}return null;})[_0x9d5a('0x29')](handleEntityNotFound(_0x5c4921,null))['then'](respondWithStatusCode(_0x5c4921,null))['catch'](handleError(_0x5c4921,null));};exports['addAgents']=function(_0x393938,_0x4d9011){return db['Team']['find']({'where':{'id':_0x393938['params']['id']}})['then'](handleEntityNotFound(_0x4d9011,null))[_0x9d5a('0x29')](function(_0x1f919c){if(_0x1f919c){var _0x3624be=['Voice',_0x9d5a('0x66'),_0x9d5a('0x67'),_0x9d5a('0x68'),_0x9d5a('0x69'),_0x9d5a('0x6a'),_0x9d5a('0x6b')];return db['sequelize'][_0x9d5a('0x6c')](function(_0x587b27){var _0x4f33af=_[_0x9d5a('0x44')](_0x3624be,function(_0x2d8ee8){var _0x504ab9={'attributes':['id','name']};if(_0x2d8ee8===_0x9d5a('0x6d')){_0x504ab9[_0x9d5a('0x6e')]={'attributes':[_0x9d5a('0x6f')]};}return _0x1f919c[_0x9d5a('0x2b')+_0x2d8ee8+_0x9d5a('0x61')](_0x504ab9)[_0x9d5a('0x29')](function(_0x344fbf){var _0xef7f77=_[_0x9d5a('0x44')](_0x344fbf,function(_0x3bb32a){var _0x30d438=_[_0x9d5a('0x44')](_0x393938[_0x9d5a('0x4f')][_0x9d5a('0x64')],function(_0x404110){var _0x3ec042={'where':{'UserId':_0x404110,[_0x2d8ee8+_0x9d5a('0x70')]:_0x3bb32a['id']},'transaction':_0x587b27};if(_0x2d8ee8===_0x9d5a('0x6d')){_0x3ec042[_0x9d5a('0x1b')]={'penalty':_0x3bb32a[_0x9d5a('0x71')][_0x9d5a('0x6f')]};}return db['User'+_0x2d8ee8+_0x9d5a('0x5e')][_0x9d5a('0x72')](_0x3ec042)[_0x9d5a('0x29')](function(){socket[_0x9d5a('0x73')]('user'+_0x2d8ee8+_0x9d5a('0x74'),{'UserId':_0x404110,[_0x2d8ee8+_0x9d5a('0x70')]:_0x3bb32a['id']});if(_0x2d8ee8!=='Voice')return;return db['User']['findAll']({'where':{'id':_0x393938[_0x9d5a('0x4f')][_0x9d5a('0x64')],'online':0x1},'attributes':['id',_0x9d5a('0x30'),_0x9d5a('0x75'),_0x9d5a('0x76'),'interface'],'raw':!![]})[_0x9d5a('0x29')](function(_0x3fb575){var _0x5a8057=_[_0x9d5a('0x44')](_0x3fb575,function(_0x157d21){return db[_0x9d5a('0x77')]['upsert']({'membername':_0x157d21[_0x9d5a('0x30')],'UserId':_0x157d21['id'],'queue_name':_0x3bb32a[_0x9d5a('0x30')],'VoiceQueueId':_0x3bb32a['id'],'interface':_['isNil'](_0x157d21['interface'])?util[_0x9d5a('0x78')](_0x9d5a('0x79'),_0x157d21['name']):_0x157d21[_0x9d5a('0x7a')],'paused':_0x157d21[_0x9d5a('0x76')]||![],'penalty':_0x3bb32a[_0x9d5a('0x71')][_0x9d5a('0x6f')]},{'transaction':_0x587b27});});return Promise[_0x9d5a('0x7b')](_0x5a8057);});});});return Promise[_0x9d5a('0x7b')](_0x30d438);});return Promise[_0x9d5a('0x7b')](_0xef7f77);});});return Promise[_0x9d5a('0x7b')](_0x4f33af)[_0x9d5a('0x29')](function(){return _0x1f919c[_0x9d5a('0x7c')](_0x393938['body'][_0x9d5a('0x64')],{'transaction':_0x587b27})[_0x9d5a('0x7d')](function(_0x1b1ac9){return _0x1b1ac9;});});});}})['then'](respondWithResult(_0x4d9011,null))[_0x9d5a('0x4a')](handleError(_0x4d9011,null));};exports[_0x9d5a('0x7e')]=function(_0x2d1a5a,_0x29b88d){return db[_0x9d5a('0x33')][_0x9d5a('0x4d')]({'where':{'id':_0x2d1a5a[_0x9d5a('0x55')]['id']}})[_0x9d5a('0x29')](handleEntityNotFound(_0x29b88d,null))['then'](function(_0x495842){if(_0x495842){var _0x5e8b49=[_0x9d5a('0x6d'),_0x9d5a('0x66'),'Mail',_0x9d5a('0x68'),_0x9d5a('0x69'),_0x9d5a('0x6a'),_0x9d5a('0x6b')];return db[_0x9d5a('0x7f')][_0x9d5a('0x6c')](function(_0x1ca070){var _0x325c1f=_['map'](_0x5e8b49,function(_0x32ace9){var _0x585793={'attributes':['id',_0x9d5a('0x30')]};return _0x495842[_0x9d5a('0x2b')+_0x32ace9+_0x9d5a('0x61')](_0x585793)[_0x9d5a('0x29')](function(_0x9561e1){var _0x50bf75=_[_0x9d5a('0x44')](_0x9561e1,function(_0x82ac62){return _0x82ac62[_0x9d5a('0x7e')](_0x2d1a5a['query'][_0x9d5a('0x64')],{'transaction':_0x1ca070})[_0x9d5a('0x29')](function(){var _0xbc8c17=JSON[_0x9d5a('0x80')]('['+_0x2d1a5a['query'][_0x9d5a('0x64')]+']');var _0x36233b=_[_0x9d5a('0x44')](_0xbc8c17,function(_0x90d622){socket[_0x9d5a('0x73')](_0x9d5a('0x50')+_0x32ace9+_0x9d5a('0x81'),{'UserId':Number(_0x90d622),[_0x32ace9+'QueueId']:_0x82ac62['id']});if(_0x32ace9!==_0x9d5a('0x6d'))return;return db[_0x9d5a('0x77')][_0x9d5a('0x2a')]({'where':{'VoiceQueueId':_0x82ac62['id'],'UserId':_0x90d622},'transaction':_0x1ca070});});return Promise[_0x9d5a('0x7b')](_0x36233b);});});return Promise[_0x9d5a('0x7b')](_0x50bf75);});});return Promise[_0x9d5a('0x7b')](_0x325c1f)[_0x9d5a('0x29')](function(){return _0x495842[_0x9d5a('0x7e')](_0x2d1a5a[_0x9d5a('0x37')]['ids'],{'transaction':_0x1ca070});});});}})['then'](respondWithStatusCode(_0x29b88d,null))['catch'](handleError(_0x29b88d,null));};exports[_0x9d5a('0x82')]=function(_0x519ac3,_0x263054,_0x2640b7){var _0x56c675={};var _0x1d2d2c={};var _0x30215b;var _0xb536c;return db[_0x9d5a('0x33')][_0x9d5a('0x57')]({'where':{'id':_0x519ac3[_0x9d5a('0x55')]['id']}})['then'](handleEntityNotFound(_0x263054,null))[_0x9d5a('0x29')](function(_0x37f0a6){if(_0x37f0a6){_0x30215b=_0x37f0a6;_0x1d2d2c['model']=_[_0x9d5a('0x38')](db[_0x9d5a('0x83')][_0x9d5a('0x4c')]);_0x1d2d2c[_0x9d5a('0x37')]=_[_0x9d5a('0x38')](_0x519ac3[_0x9d5a('0x37')]);_0x1d2d2c[_0x9d5a('0x39')]=_['intersection'](_0x1d2d2c[_0x9d5a('0x36')],_0x1d2d2c[_0x9d5a('0x37')]);_0x56c675['attributes']=_['intersection'](_0x1d2d2c[_0x9d5a('0x36')],qs['fields'](_0x519ac3[_0x9d5a('0x37')][_0x9d5a('0x3b')]));_0x56c675[_0x9d5a('0x3c')]=_0x56c675[_0x9d5a('0x3c')][_0x9d5a('0x3d')]?_0x56c675[_0x9d5a('0x3c')]:_0x1d2d2c[_0x9d5a('0x36')];_0x56c675['order']=qs[_0x9d5a('0x3f')](_0x519ac3[_0x9d5a('0x37')][_0x9d5a('0x3f')]);_0x56c675[_0x9d5a('0x40')]=qs[_0x9d5a('0x39')](_[_0x9d5a('0x41')](_0x519ac3[_0x9d5a('0x37')],_0x1d2d2c[_0x9d5a('0x39')]));if(_0x519ac3['query'][_0x9d5a('0x42')]){_0x56c675[_0x9d5a('0x40')]=_[_0x9d5a('0x43')](_0x56c675['where'],{'$or':_[_0x9d5a('0x44')](_0x56c675['attributes'],function(_0x21ab62){var _0x42cd1b={};_0x42cd1b[_0x21ab62]={'$like':'%'+_0x519ac3[_0x9d5a('0x37')][_0x9d5a('0x42')]+'%'};return _0x42cd1b;})});}_0x56c675=_[_0x9d5a('0x43')]({},_0x56c675,_0x519ac3['options']);return _0x30215b[_0x9d5a('0x82')](_0x56c675);}})[_0x9d5a('0x29')](function(_0xe06afc){if(_0xe06afc){_0xb536c=_0xe06afc[_0x9d5a('0x3d')];if(!_0x519ac3['query'][_0x9d5a('0x84')]('nolimit')){_0x56c675['limit']=qs[_0x9d5a('0x23')](_0x519ac3['query'][_0x9d5a('0x23')]);_0x56c675['offset']=qs[_0x9d5a('0x21')](_0x519ac3[_0x9d5a('0x37')][_0x9d5a('0x21')]);}return _0x30215b[_0x9d5a('0x82')](_0x56c675);}})['then'](function(_0x1d6753){if(_0x1d6753){return _0x1d6753?{'count':_0xb536c,'rows':_0x1d6753}:null;}})[_0x9d5a('0x29')](respondWithResult(_0x263054,null))[_0x9d5a('0x4a')](handleError(_0x263054,null));}; \ No newline at end of file +var _0xcc8f=['SIP/%s','penalty','all','spread','Sms','transaction','parse','Queue:remove','removeAgents','getAgents','nolimit','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Teams','error','stack','name','index','map','Team','fieldName','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','length','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','addQueues','Sequelize','add','ids','isValidChannel','remove','Queues','addAgents','Voice','Chat','Fax','Openchannel','Whatsapp','sequelize','through','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','interface','UserVoiceQueueRt','upsert','isNil'];(function(_0x544a22,_0x4f762e){var _0x45911f=function(_0x26a6eb){while(--_0x26a6eb){_0x544a22['push'](_0x544a22['shift']());}};_0x45911f(++_0x4f762e);}(_0xcc8f,0x10d));var _0xfcc8=function(_0x3aaf10,_0x2117a2){_0x3aaf10=_0x3aaf10-0x0;var _0x83c78a=_0xcc8f[_0x3aaf10];return _0x83c78a;};'use strict';var emlformat=require(_0xfcc8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfcc8('0x1'));var rp=require(_0xfcc8('0x2'));var moment=require('moment');var BPromise=require(_0xfcc8('0x3'));var Mustache=require(_0xfcc8('0x4'));var util=require(_0xfcc8('0x5'));var path=require(_0xfcc8('0x6'));var sox=require('sox');var csv=require(_0xfcc8('0x7'));var ejs=require(_0xfcc8('0x8'));var fs=require('fs');var fs_extra=require(_0xfcc8('0x9'));var _=require(_0xfcc8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfcc8('0xb'));var toCsv=require(_0xfcc8('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfcc8('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xfcc8('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcc8('0xe'));var logger=require(_0xfcc8('0xf'))(_0xfcc8('0x10'));var utils=require(_0xfcc8('0x11'));var config=require(_0xfcc8('0x12'));var licenseUtil=require(_0xfcc8('0x13'));var db=require(_0xfcc8('0x14'))['db'];config['redis']=_[_0xfcc8('0x15')](config[_0xfcc8('0x16')],{'host':_0xfcc8('0x17'),'port':0x18eb});var socket=require(_0xfcc8('0x18'))(new Redis(config['redis']));require(_0xfcc8('0x19'))['register'](socket);function respondWithStatusCode(_0x302b18,_0x25f611){_0x25f611=_0x25f611||0xcc;return function(_0x1383b5){if(_0x1383b5){return _0x302b18[_0xfcc8('0x1a')](_0x25f611);}return _0x302b18[_0xfcc8('0x1b')](_0x25f611)[_0xfcc8('0x1c')]();};}function respondWithResult(_0x202485,_0x4de9bc){_0x4de9bc=_0x4de9bc||0xc8;return function(_0x2f7de4){if(_0x2f7de4){return _0x202485[_0xfcc8('0x1b')](_0x4de9bc)[_0xfcc8('0x1d')](_0x2f7de4);}};}function respondWithFilteredResult(_0x4f9a33,_0x218ce6){return function(_0x171a28){if(_0x171a28){var _0x38c86a=typeof _0x218ce6['offset']==='undefined'&&typeof _0x218ce6[_0xfcc8('0x1e')]==='undefined';var _0x24005d=_0x171a28[_0xfcc8('0x1f')];var _0x22cdc4=_0x38c86a?0x0:_0x218ce6[_0xfcc8('0x20')];var _0x14e035=_0x38c86a?_0x171a28[_0xfcc8('0x1f')]:_0x218ce6[_0xfcc8('0x20')]+_0x218ce6[_0xfcc8('0x1e')];var _0x54898e;if(_0x14e035>=_0x24005d){_0x14e035=_0x24005d;_0x54898e=0xc8;}else{_0x54898e=0xce;}_0x4f9a33[_0xfcc8('0x1b')](_0x54898e);return _0x4f9a33[_0xfcc8('0x21')](_0xfcc8('0x22'),_0x22cdc4+'-'+_0x14e035+'/'+_0x24005d)[_0xfcc8('0x1d')](_0x171a28);}return null;};}function patchUpdates(_0x14888f){return function(_0x3c2f75){try{jsonpatch[_0xfcc8('0x23')](_0x3c2f75,_0x14888f,!![]);}catch(_0x1c35a8){return BPromise[_0xfcc8('0x24')](_0x1c35a8);}return _0x3c2f75[_0xfcc8('0x25')]();};}function saveUpdates(_0xa9f222,_0x2e4505){return function(_0x546cac){if(_0x546cac){return _0x546cac[_0xfcc8('0x26')](_0xa9f222)[_0xfcc8('0x27')](function(_0x23390f){return _0x23390f;});}return null;};}function removeEntity(_0x2c7a60,_0x1458ba){return function(_0x315c43){if(_0x315c43){return _0x315c43[_0xfcc8('0x28')]()[_0xfcc8('0x27')](function(){var _0x39cf29=_0x315c43[_0xfcc8('0x29')]({'plain':!![]});var _0x340f20=_0xfcc8('0x2a');return db['UserProfileResource'][_0xfcc8('0x28')]({'where':{'type':_0x340f20,'resourceId':_0x39cf29['id']}})[_0xfcc8('0x27')](function(){return _0x315c43;});})[_0xfcc8('0x27')](function(){_0x2c7a60[_0xfcc8('0x1b')](0xcc)[_0xfcc8('0x1c')]();});}};}function handleEntityNotFound(_0x74ab56,_0x51de27){return function(_0x3f3b90){if(!_0x3f3b90){_0x74ab56[_0xfcc8('0x1a')](0x194);}return _0x3f3b90;};}function handleError(_0x38c5b0,_0x2308d2){_0x2308d2=_0x2308d2||0x1f4;return function(_0x1fa740){logger[_0xfcc8('0x2b')](_0x1fa740[_0xfcc8('0x2c')]);if(_0x1fa740[_0xfcc8('0x2d')]){delete _0x1fa740[_0xfcc8('0x2d')];}_0x38c5b0['status'](_0x2308d2)['send'](_0x1fa740);};}exports[_0xfcc8('0x2e')]=function(_0x56b589,_0x1eb1ee){var _0x28cec1={},_0xae163b={},_0x44c979={'count':0x0,'rows':[]};var _0xd742e3=_[_0xfcc8('0x2f')](db[_0xfcc8('0x30')]['rawAttributes'],function(_0x300bfa){return{'name':_0x300bfa[_0xfcc8('0x31')],'type':_0x300bfa[_0xfcc8('0x32')]['key']};});_0xae163b['model']=_['map'](_0xd742e3,'name');_0xae163b[_0xfcc8('0x33')]=_['keys'](_0x56b589['query']);_0xae163b[_0xfcc8('0x34')]=_[_0xfcc8('0x35')](_0xae163b['model'],_0xae163b[_0xfcc8('0x33')]);_0x28cec1[_0xfcc8('0x36')]=_['intersection'](_0xae163b[_0xfcc8('0x37')],qs[_0xfcc8('0x38')](_0x56b589['query'][_0xfcc8('0x38')]));_0x28cec1[_0xfcc8('0x36')]=_0x28cec1[_0xfcc8('0x36')]['length']?_0x28cec1[_0xfcc8('0x36')]:_0xae163b[_0xfcc8('0x37')];if(!_0x56b589['query'][_0xfcc8('0x39')]('nolimit')){_0x28cec1[_0xfcc8('0x1e')]=qs['limit'](_0x56b589[_0xfcc8('0x33')][_0xfcc8('0x1e')]);_0x28cec1[_0xfcc8('0x20')]=qs['offset'](_0x56b589[_0xfcc8('0x33')]['offset']);}_0x28cec1[_0xfcc8('0x3a')]=qs[_0xfcc8('0x3b')](_0x56b589[_0xfcc8('0x33')][_0xfcc8('0x3b')]);_0x28cec1[_0xfcc8('0x3c')]=qs[_0xfcc8('0x34')](_[_0xfcc8('0x3d')](_0x56b589[_0xfcc8('0x33')],_0xae163b[_0xfcc8('0x34')]),_0xd742e3);if(_0x56b589[_0xfcc8('0x33')][_0xfcc8('0x3e')]){_0x28cec1[_0xfcc8('0x3c')]=_[_0xfcc8('0x3f')](_0x28cec1[_0xfcc8('0x3c')],{'$or':_[_0xfcc8('0x2f')](_0xd742e3,function(_0x281ca0){if(_0x281ca0['type']!==_0xfcc8('0x40')){var _0x42000f={};_0x42000f[_0x281ca0[_0xfcc8('0x2d')]]={'$like':'%'+_0x56b589['query']['filter']+'%'};return _0x42000f;}})});}_0x28cec1=_[_0xfcc8('0x3f')]({},_0x28cec1,_0x56b589['options']);var _0x480ce2={'where':_0x28cec1[_0xfcc8('0x3c')]};return db[_0xfcc8('0x30')][_0xfcc8('0x1f')](_0x480ce2)['then'](function(_0xe96f5d){_0x44c979[_0xfcc8('0x1f')]=_0xe96f5d;if(_0x56b589[_0xfcc8('0x33')][_0xfcc8('0x41')]){_0x28cec1[_0xfcc8('0x42')]=[{'all':!![]}];}return db['Team']['findAll'](_0x28cec1);})[_0xfcc8('0x27')](function(_0x404289){_0x44c979[_0xfcc8('0x43')]=_0x404289;return _0x44c979;})[_0xfcc8('0x27')](respondWithFilteredResult(_0x1eb1ee,_0x28cec1))[_0xfcc8('0x44')](handleError(_0x1eb1ee,null));};exports[_0xfcc8('0x45')]=function(_0x587434,_0x4df93d){var _0x2f5e56={'raw':![],'where':{'id':_0x587434[_0xfcc8('0x46')]['id']}},_0xe21e1f={};_0xe21e1f[_0xfcc8('0x37')]=_[_0xfcc8('0x47')](db[_0xfcc8('0x30')]['rawAttributes']);_0xe21e1f[_0xfcc8('0x33')]=_[_0xfcc8('0x47')](_0x587434[_0xfcc8('0x33')]);_0xe21e1f[_0xfcc8('0x34')]=_['intersection'](_0xe21e1f[_0xfcc8('0x37')],_0xe21e1f[_0xfcc8('0x33')]);_0x2f5e56[_0xfcc8('0x36')]=_[_0xfcc8('0x35')](_0xe21e1f[_0xfcc8('0x37')],qs[_0xfcc8('0x38')](_0x587434[_0xfcc8('0x33')][_0xfcc8('0x38')]));_0x2f5e56[_0xfcc8('0x36')]=_0x2f5e56['attributes'][_0xfcc8('0x48')]?_0x2f5e56['attributes']:_0xe21e1f[_0xfcc8('0x37')];if(_0x587434['query'][_0xfcc8('0x41')]){_0x2f5e56['include']=[{'all':!![]}];}_0x2f5e56=_['merge']({},_0x2f5e56,_0x587434[_0xfcc8('0x49')]);return db[_0xfcc8('0x30')][_0xfcc8('0x4a')](_0x2f5e56)[_0xfcc8('0x27')](handleEntityNotFound(_0x4df93d,null))['then'](respondWithResult(_0x4df93d,null))['catch'](handleError(_0x4df93d,null));};exports[_0xfcc8('0x4b')]=function(_0x1d09d8,_0x3652d1){return db[_0xfcc8('0x30')][_0xfcc8('0x4b')](_0x1d09d8['body'],{})[_0xfcc8('0x27')](function(_0x11e7aa){var _0x217273=_0x1d09d8['user']['get']({'plain':!![]});if(!_0x217273)throw new Error(_0xfcc8('0x4c'));if(_0x217273[_0xfcc8('0x4d')]===_0xfcc8('0x4e')){var _0x188b60=_0x11e7aa[_0xfcc8('0x29')]({'plain':!![]});var _0x11dde3=_0xfcc8('0x2a');return db[_0xfcc8('0x4f')][_0xfcc8('0x4a')]({'where':{'name':_0x11dde3,'userProfileId':_0x217273[_0xfcc8('0x50')]},'raw':!![]})['then'](function(_0x40ecfb){if(_0x40ecfb&&_0x40ecfb['autoAssociation']===0x0){return db[_0xfcc8('0x51')][_0xfcc8('0x4b')]({'name':_0x188b60[_0xfcc8('0x2d')],'resourceId':_0x188b60['id'],'type':_0x40ecfb[_0xfcc8('0x2d')],'sectionId':_0x40ecfb['id']},{})[_0xfcc8('0x27')](function(){return _0x11e7aa;});}else{return _0x11e7aa;}})[_0xfcc8('0x44')](function(_0x30b963){logger['error'](_0xfcc8('0x52'),_0x30b963);throw _0x30b963;});}return _0x11e7aa;})[_0xfcc8('0x27')](respondWithResult(_0x3652d1,0xc9))[_0xfcc8('0x44')](handleError(_0x3652d1,null));};exports[_0xfcc8('0x26')]=function(_0x976595,_0xdba5a0){if(_0x976595[_0xfcc8('0x53')]['id']){delete _0x976595['body']['id'];}return db[_0xfcc8('0x30')][_0xfcc8('0x4a')]({'where':{'id':_0x976595[_0xfcc8('0x46')]['id']}})[_0xfcc8('0x27')](handleEntityNotFound(_0xdba5a0,null))['then'](saveUpdates(_0x976595[_0xfcc8('0x53')],null))[_0xfcc8('0x27')](respondWithResult(_0xdba5a0,null))[_0xfcc8('0x44')](handleError(_0xdba5a0,null));};exports[_0xfcc8('0x28')]=function(_0x57dcc9,_0xcfe31b){return db[_0xfcc8('0x30')][_0xfcc8('0x4a')]({'where':{'id':_0x57dcc9[_0xfcc8('0x46')]['id']}})[_0xfcc8('0x27')](handleEntityNotFound(_0xcfe31b,null))['then'](removeEntity(_0xcfe31b,null))[_0xfcc8('0x44')](handleError(_0xcfe31b,null));};exports['getQueues']=function(_0x113b2c,_0x575d3e,_0xcd6638){return db[_0xfcc8('0x30')][_0xfcc8('0x54')]({'where':{'id':_0x113b2c[_0xfcc8('0x46')]['id']}})[_0xfcc8('0x27')](handleEntityNotFound(_0x575d3e,null))[_0xfcc8('0x27')](function(_0x586185){if(!_0x113b2c[_0xfcc8('0x33')][_0xfcc8('0x55')]||!utils['isValidChannel'](_0x113b2c['query'][_0xfcc8('0x55')])){throw new db['Sequelize'][(_0xfcc8('0x56'))](_0xfcc8('0x57'));}var _0x53dd1f={};var _0x19f0f5={};_0x19f0f5[_0xfcc8('0x37')]=_[_0xfcc8('0x47')](db[_[_0xfcc8('0x58')](_0x113b2c[_0xfcc8('0x33')][_0xfcc8('0x55')][_0xfcc8('0x59')]())+_0xfcc8('0x5a')][_0xfcc8('0x5b')]);_0x19f0f5['query']=_['keys'](_0x113b2c[_0xfcc8('0x33')]);_0x19f0f5[_0xfcc8('0x34')]=_[_0xfcc8('0x35')](_0x19f0f5[_0xfcc8('0x37')],_0x19f0f5[_0xfcc8('0x33')]);_0x53dd1f['attributes']=_['intersection'](_0x19f0f5[_0xfcc8('0x37')],qs[_0xfcc8('0x38')](_0x113b2c[_0xfcc8('0x33')]['fields']));_0x53dd1f['attributes']=_0x53dd1f[_0xfcc8('0x36')][_0xfcc8('0x48')]?_0x53dd1f[_0xfcc8('0x36')]:_0x19f0f5[_0xfcc8('0x37')];_0x53dd1f[_0xfcc8('0x1e')]=qs[_0xfcc8('0x1e')](_0x113b2c['query'][_0xfcc8('0x1e')]);_0x53dd1f[_0xfcc8('0x20')]=qs['offset'](_0x113b2c[_0xfcc8('0x33')][_0xfcc8('0x20')]);_0x53dd1f['order']=qs[_0xfcc8('0x3b')](_0x113b2c['query'][_0xfcc8('0x3b')]);_0x53dd1f[_0xfcc8('0x3c')]=qs[_0xfcc8('0x34')](_[_0xfcc8('0x3d')](_0x113b2c[_0xfcc8('0x33')],_0x19f0f5['filters']));_0x53dd1f=_[_0xfcc8('0x3f')]({},_0x53dd1f,_0x113b2c[_0xfcc8('0x49')]);return _0x586185[_0xfcc8('0x29')+_[_0xfcc8('0x58')](_0x113b2c[_0xfcc8('0x33')][_0xfcc8('0x55')][_0xfcc8('0x59')]())+'Queues'](_0x53dd1f);})['then'](respondWithResult(_0x575d3e,null))[_0xfcc8('0x44')](handleError(_0x575d3e,null));};exports[_0xfcc8('0x5c')]=function(_0x168821,_0x34a548,_0x584e92){return db['Team'][_0xfcc8('0x54')]({'where':{'id':_0x168821[_0xfcc8('0x46')]['id']}})[_0xfcc8('0x27')](function(_0x2750b6){if(_0x2750b6){if(!_0x168821[_0xfcc8('0x53')][_0xfcc8('0x55')]||!utils['isValidChannel'](_0x168821['body'][_0xfcc8('0x55')])){throw new db[(_0xfcc8('0x5d'))]['ValidationError'](_0xfcc8('0x57'));}return _0x2750b6[_0xfcc8('0x5e')+_[_0xfcc8('0x58')](_0x168821[_0xfcc8('0x53')]['channel'][_0xfcc8('0x59')]())+'Queues'](_0x168821['body'][_0xfcc8('0x5f')]);}return null;})[_0xfcc8('0x27')](handleEntityNotFound(_0x34a548,null))[_0xfcc8('0x27')](respondWithStatusCode(_0x34a548,null))['catch'](handleError(_0x34a548,null));};exports['removeQueues']=function(_0x2c99a1,_0x5e9629,_0x17fcfc){return db[_0xfcc8('0x30')][_0xfcc8('0x54')]({'where':{'id':_0x2c99a1[_0xfcc8('0x46')]['id']}})['then'](function(_0x186db3){if(_0x186db3){if(!_0x2c99a1[_0xfcc8('0x33')][_0xfcc8('0x55')]||!utils[_0xfcc8('0x60')](_0x2c99a1[_0xfcc8('0x33')][_0xfcc8('0x55')])){throw new db[(_0xfcc8('0x5d'))][(_0xfcc8('0x56'))](_0xfcc8('0x57'));}return _0x186db3[_0xfcc8('0x61')+_['capitalize'](_0x2c99a1[_0xfcc8('0x33')][_0xfcc8('0x55')][_0xfcc8('0x59')]())+_0xfcc8('0x62')](_0x2c99a1[_0xfcc8('0x33')][_0xfcc8('0x5f')]);}return null;})[_0xfcc8('0x27')](handleEntityNotFound(_0x5e9629,null))[_0xfcc8('0x27')](respondWithStatusCode(_0x5e9629,null))[_0xfcc8('0x44')](handleError(_0x5e9629,null));};exports[_0xfcc8('0x63')]=function(_0x463b20,_0x528353){return db['Team']['find']({'where':{'id':_0x463b20[_0xfcc8('0x46')]['id']}})['then'](handleEntityNotFound(_0x528353,null))[_0xfcc8('0x27')](function(_0x2745e5){if(_0x2745e5){var _0x541b2a=[_0xfcc8('0x64'),_0xfcc8('0x65'),'Mail','Sms',_0xfcc8('0x66'),_0xfcc8('0x67'),_0xfcc8('0x68')];return db[_0xfcc8('0x69')]['transaction'](function(_0xc7d18a){var _0x5267a6=_['map'](_0x541b2a,function(_0x2d44d8){var _0x2e8b8f={'attributes':['id',_0xfcc8('0x2d')]};if(_0x2d44d8===_0xfcc8('0x64')){_0x2e8b8f[_0xfcc8('0x6a')]={'attributes':['penalty']};}return _0x2745e5[_0xfcc8('0x29')+_0x2d44d8+_0xfcc8('0x62')](_0x2e8b8f)[_0xfcc8('0x27')](function(_0x5808d7){var _0x4a7c7e=_['map'](_0x5808d7,function(_0x441b30){var _0x397377=_['map'](_0x463b20[_0xfcc8('0x53')][_0xfcc8('0x5f')],function(_0x3c2ea1){var _0x26f427={'where':{'UserId':_0x3c2ea1,[_0x2d44d8+_0xfcc8('0x6b')]:_0x441b30['id']},'transaction':_0xc7d18a};if(_0x2d44d8===_0xfcc8('0x64')){_0x26f427['defaults']={'penalty':_0x441b30[_0xfcc8('0x6c')]['penalty']};}return db[_0xfcc8('0x6d')+_0x2d44d8+_0xfcc8('0x5a')][_0xfcc8('0x6e')](_0x26f427)['then'](function(){socket[_0xfcc8('0x6f')]('user'+_0x2d44d8+_0xfcc8('0x70'),{'UserId':_0x3c2ea1,[_0x2d44d8+'QueueId']:_0x441b30['id']});if(_0x2d44d8!==_0xfcc8('0x64'))return;return db[_0xfcc8('0x6d')]['findAll']({'where':{'id':_0x463b20[_0xfcc8('0x53')]['ids'],'online':0x1},'attributes':['id',_0xfcc8('0x2d'),_0xfcc8('0x71'),'voicePause',_0xfcc8('0x72')],'raw':!![]})[_0xfcc8('0x27')](function(_0x279407){var _0x4667ca=_[_0xfcc8('0x2f')](_0x279407,function(_0x4cab8d){return db[_0xfcc8('0x73')][_0xfcc8('0x74')]({'membername':_0x4cab8d[_0xfcc8('0x2d')],'UserId':_0x4cab8d['id'],'queue_name':_0x441b30[_0xfcc8('0x2d')],'VoiceQueueId':_0x441b30['id'],'interface':_[_0xfcc8('0x75')](_0x4cab8d[_0xfcc8('0x72')])?util['format'](_0xfcc8('0x76'),_0x4cab8d[_0xfcc8('0x2d')]):_0x4cab8d[_0xfcc8('0x72')],'paused':_0x4cab8d['voicePause']||![],'penalty':_0x441b30[_0xfcc8('0x6c')][_0xfcc8('0x77')]},{'transaction':_0xc7d18a});});return Promise[_0xfcc8('0x78')](_0x4667ca);});});});return Promise[_0xfcc8('0x78')](_0x397377);});return Promise[_0xfcc8('0x78')](_0x4a7c7e);});});return Promise['all'](_0x5267a6)[_0xfcc8('0x27')](function(){return _0x2745e5[_0xfcc8('0x63')](_0x463b20['body'][_0xfcc8('0x5f')],{'transaction':_0xc7d18a})[_0xfcc8('0x79')](function(_0x25e82d){return _0x25e82d;});});});}})['then'](respondWithResult(_0x528353,null))['catch'](handleError(_0x528353,null));};exports['removeAgents']=function(_0x472a65,_0x290a73){return db[_0xfcc8('0x30')]['find']({'where':{'id':_0x472a65[_0xfcc8('0x46')]['id']}})[_0xfcc8('0x27')](handleEntityNotFound(_0x290a73,null))[_0xfcc8('0x27')](function(_0x512618){if(_0x512618){var _0x4a78a5=[_0xfcc8('0x64'),_0xfcc8('0x65'),'Mail',_0xfcc8('0x7a'),_0xfcc8('0x66'),_0xfcc8('0x67'),_0xfcc8('0x68')];return db[_0xfcc8('0x69')][_0xfcc8('0x7b')](function(_0x21788a){var _0xc81c67=_['map'](_0x4a78a5,function(_0x19cec9){var _0xc2b1cb={'attributes':['id',_0xfcc8('0x2d')]};return _0x512618[_0xfcc8('0x29')+_0x19cec9+_0xfcc8('0x62')](_0xc2b1cb)[_0xfcc8('0x27')](function(_0x3f3065){var _0x3070ca=_[_0xfcc8('0x2f')](_0x3f3065,function(_0x27c68d){return _0x27c68d['removeAgents'](_0x472a65[_0xfcc8('0x33')]['ids'],{'transaction':_0x21788a})[_0xfcc8('0x27')](function(){var _0xd8756f=JSON[_0xfcc8('0x7c')]('['+_0x472a65[_0xfcc8('0x33')][_0xfcc8('0x5f')]+']');var _0x158fb2=_[_0xfcc8('0x2f')](_0xd8756f,function(_0x2c5c0f){socket[_0xfcc8('0x6f')](_0xfcc8('0x4e')+_0x19cec9+_0xfcc8('0x7d'),{'UserId':Number(_0x2c5c0f),[_0x19cec9+_0xfcc8('0x6b')]:_0x27c68d['id']});if(_0x19cec9!=='Voice')return;return db[_0xfcc8('0x73')][_0xfcc8('0x28')]({'where':{'VoiceQueueId':_0x27c68d['id'],'UserId':_0x2c5c0f},'transaction':_0x21788a});});return Promise[_0xfcc8('0x78')](_0x158fb2);});});return Promise[_0xfcc8('0x78')](_0x3070ca);});});return Promise[_0xfcc8('0x78')](_0xc81c67)['then'](function(){return _0x512618[_0xfcc8('0x7e')](_0x472a65['query'][_0xfcc8('0x5f')],{'transaction':_0x21788a});});});}})[_0xfcc8('0x27')](respondWithStatusCode(_0x290a73,null))['catch'](handleError(_0x290a73,null));};exports[_0xfcc8('0x7f')]=function(_0x3e30d8,_0x2e9137,_0x420362){var _0x2db9df={};var _0x2bec94={};var _0x535b36;var _0x307d9e;return db[_0xfcc8('0x30')][_0xfcc8('0x54')]({'where':{'id':_0x3e30d8[_0xfcc8('0x46')]['id']}})[_0xfcc8('0x27')](handleEntityNotFound(_0x2e9137,null))[_0xfcc8('0x27')](function(_0x2b677f){if(_0x2b677f){_0x535b36=_0x2b677f;_0x2bec94['model']=_['keys'](db[_0xfcc8('0x6d')][_0xfcc8('0x5b')]);_0x2bec94[_0xfcc8('0x33')]=_['keys'](_0x3e30d8[_0xfcc8('0x33')]);_0x2bec94[_0xfcc8('0x34')]=_[_0xfcc8('0x35')](_0x2bec94[_0xfcc8('0x37')],_0x2bec94[_0xfcc8('0x33')]);_0x2db9df[_0xfcc8('0x36')]=_['intersection'](_0x2bec94[_0xfcc8('0x37')],qs[_0xfcc8('0x38')](_0x3e30d8[_0xfcc8('0x33')][_0xfcc8('0x38')]));_0x2db9df[_0xfcc8('0x36')]=_0x2db9df['attributes'][_0xfcc8('0x48')]?_0x2db9df[_0xfcc8('0x36')]:_0x2bec94[_0xfcc8('0x37')];_0x2db9df['order']=qs[_0xfcc8('0x3b')](_0x3e30d8[_0xfcc8('0x33')]['sort']);_0x2db9df[_0xfcc8('0x3c')]=qs[_0xfcc8('0x34')](_[_0xfcc8('0x3d')](_0x3e30d8[_0xfcc8('0x33')],_0x2bec94[_0xfcc8('0x34')]));if(_0x3e30d8['query'][_0xfcc8('0x3e')]){_0x2db9df[_0xfcc8('0x3c')]=_[_0xfcc8('0x3f')](_0x2db9df[_0xfcc8('0x3c')],{'$or':_['map'](_0x2db9df[_0xfcc8('0x36')],function(_0x216d14){var _0x44e222={};_0x44e222[_0x216d14]={'$like':'%'+_0x3e30d8[_0xfcc8('0x33')]['filter']+'%'};return _0x44e222;})});}_0x2db9df=_[_0xfcc8('0x3f')]({},_0x2db9df,_0x3e30d8['options']);return _0x535b36[_0xfcc8('0x7f')](_0x2db9df);}})[_0xfcc8('0x27')](function(_0x4d6624){if(_0x4d6624){_0x307d9e=_0x4d6624[_0xfcc8('0x48')];if(!_0x3e30d8[_0xfcc8('0x33')]['hasOwnProperty'](_0xfcc8('0x80'))){_0x2db9df[_0xfcc8('0x1e')]=qs['limit'](_0x3e30d8[_0xfcc8('0x33')][_0xfcc8('0x1e')]);_0x2db9df[_0xfcc8('0x20')]=qs[_0xfcc8('0x20')](_0x3e30d8[_0xfcc8('0x33')]['offset']);}return _0x535b36[_0xfcc8('0x7f')](_0x2db9df);}})['then'](function(_0x42d86c){if(_0x42d86c){return _0x42d86c?{'count':_0x307d9e,'rows':_0x42d86c}:null;}})[_0xfcc8('0x27')](respondWithResult(_0x2e9137,null))['catch'](handleError(_0x2e9137,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 86ff8a7..7567bfd 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 _0x863e=['exports','../../mysqldb','Team','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3a7589,_0x572b50){var _0xa04b11=function(_0x551100){while(--_0x551100){_0x3a7589['push'](_0x3a7589['shift']());}};_0xa04b11(++_0x572b50);}(_0x863e,0x1ba));var _0xe863=function(_0x12db5b,_0x1c1995){_0x12db5b=_0x12db5b-0x0;var _0x162d2e=_0x863e[_0x12db5b];return _0x162d2e;};'use strict';var EventEmitter=require('events');var Team=require(_0xe863('0x0'))['db'][_0xe863('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xe863('0x2')](0x0);var events={'afterCreate':_0xe863('0x3'),'afterUpdate':_0xe863('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1d3386){return function(_0x2becab,_0x5d8017,_0x265dbf){TeamEvents[_0xe863('0x5')](_0x1d3386+':'+_0x2becab['id'],_0x2becab);TeamEvents[_0xe863('0x5')](_0x1d3386,_0x2becab);_0x265dbf(null);};}for(var e in events){if(events[_0xe863('0x6')](e)){var event=events[e];Team[_0xe863('0x7')](e,emitEvent(event));}}module[_0xe863('0x8')]=TeamEvents; \ No newline at end of file +var _0xb722=['exports','events','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2cf72d,_0x1f8d24){var _0x417ef4=function(_0x1a0c4d){while(--_0x1a0c4d){_0x2cf72d['push'](_0x2cf72d['shift']());}};_0x417ef4(++_0x1f8d24);}(_0xb722,0x191));var _0x2b72=function(_0x4a0b37,_0x4026b7){_0x4a0b37=_0x4a0b37-0x0;var _0x3c5c8a=_0xb722[_0x4a0b37];return _0x3c5c8a;};'use strict';var EventEmitter=require(_0x2b72('0x0'));var Team=require('../../mysqldb')['db'][_0x2b72('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x2b72('0x2')](0x0);var events={'afterCreate':_0x2b72('0x3'),'afterUpdate':_0x2b72('0x4'),'afterDestroy':_0x2b72('0x5')};function emitEvent(_0x246d4c){return function(_0x16c456,_0x4e8154,_0xd163b5){TeamEvents[_0x2b72('0x6')](_0x246d4c+':'+_0x16c456['id'],_0x16c456);TeamEvents[_0x2b72('0x6')](_0x246d4c,_0x16c456);_0xd163b5(null);};}for(var e in events){if(events[_0x2b72('0x7')](e)){var event=events[e];Team[_0x2b72('0x8')](e,emitEvent(event));}}module[_0x2b72('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 0c18e54..7ebe23d 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 _0xfa21=['request-promise','rimraf','../../config/environment','./team.attributes','exports','define','teams','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2a8480,_0x35034e){var _0x5680b0=function(_0x39be65){while(--_0x39be65){_0x2a8480['push'](_0x2a8480['shift']());}};_0x5680b0(++_0x35034e);}(_0xfa21,0x1c3));var _0x1fa2=function(_0xd0fb04,_0x2ca702){_0xd0fb04=_0xd0fb04-0x0;var _0x587d30=_0xfa21[_0xd0fb04];return _0x587d30;};'use strict';var _=require(_0x1fa2('0x0'));var util=require(_0x1fa2('0x1'));var logger=require(_0x1fa2('0x2'))('api');var moment=require(_0x1fa2('0x3'));var BPromise=require(_0x1fa2('0x4'));var rp=require(_0x1fa2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fa2('0x6'));var config=require(_0x1fa2('0x7'));var attributes=require(_0x1fa2('0x8'));module[_0x1fa2('0x9')]=function(_0x2e5e29,_0x3a219b){return _0x2e5e29[_0x1fa2('0xa')]('Team',attributes,{'tableName':_0x1fa2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa61=['teams','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./team.attributes','define','Team'];(function(_0x46581f,_0x54be61){var _0x308dba=function(_0x69ee08){while(--_0x69ee08){_0x46581f['push'](_0x46581f['shift']());}};_0x308dba(++_0x54be61);}(_0xfa61,0xa9));var _0x1fa6=function(_0x2e88c5,_0x2498f4){_0x2e88c5=_0x2e88c5-0x0;var _0x169ea2=_0xfa61[_0x2e88c5];return _0x169ea2;};'use strict';var _=require(_0x1fa6('0x0'));var util=require(_0x1fa6('0x1'));var logger=require(_0x1fa6('0x2'))(_0x1fa6('0x3'));var moment=require(_0x1fa6('0x4'));var BPromise=require(_0x1fa6('0x5'));var rp=require(_0x1fa6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fa6('0x7'));var config=require('../../config/environment');var attributes=require(_0x1fa6('0x8'));module['exports']=function(_0x2e356b,_0x390f1d){return _0x2e356b[_0x1fa6('0x9')](_0x1fa6('0xa'),attributes,{'tableName':_0x1fa6('0xb'),'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 68fe8e7..8ae3145 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 _0x1b3b=['moment','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./team.socket','register','request','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x15f603,_0x40325b){var _0x3d7303=function(_0x4ef210){while(--_0x4ef210){_0x15f603['push'](_0x15f603['shift']());}};_0x3d7303(++_0x40325b);}(_0x1b3b,0x16e));var _0xb1b3=function(_0x909398,_0x2e6d0b){_0x909398=_0x909398-0x0;var _0x16e1f3=_0x1b3b[_0x909398];return _0x16e1f3;};'use strict';var _=require(_0xb1b3('0x0'));var util=require(_0xb1b3('0x1'));var moment=require(_0xb1b3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1b3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb1b3('0x4'))(_0xb1b3('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb1b3('0x6')][_0xb1b3('0x7')]({'port':0x232a});config[_0xb1b3('0x8')]=_[_0xb1b3('0x9')](config[_0xb1b3('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb1b3('0xa'))(new Redis(config['redis']));require(_0xb1b3('0xb'))[_0xb1b3('0xc')](socket);function respondWithRpcPromise(_0x32d84e,_0x1eab86,_0x20902f){return new BPromise(function(_0x35ab61,_0x2c9f72){return client[_0xb1b3('0xd')](_0x32d84e,_0x20902f)['then'](function(_0x34f01b){logger['info'](_0xb1b3('0xe'),_0x1eab86,_0xb1b3('0xf'));logger[_0xb1b3('0x10')](_0xb1b3('0x11'),_0x1eab86,'request\x20sent',JSON[_0xb1b3('0x12')](_0x34f01b));if(_0x34f01b[_0xb1b3('0x13')]){if(_0x34f01b['error'][_0xb1b3('0x14')]===0x1f4){logger[_0xb1b3('0x13')]('Team,\x20%s,\x20%s',_0x1eab86,_0x34f01b['error'][_0xb1b3('0x15')]);return _0x2c9f72(_0x34f01b['error'][_0xb1b3('0x15')]);}logger['error'](_0xb1b3('0xe'),_0x1eab86,_0x34f01b[_0xb1b3('0x13')]['message']);return _0x35ab61(_0x34f01b[_0xb1b3('0x13')]['message']);}else{logger['info'](_0xb1b3('0xe'),_0x1eab86,_0xb1b3('0xf'));_0x35ab61(_0x34f01b[_0xb1b3('0x16')][_0xb1b3('0x15')]);}})['catch'](function(_0x40f938){logger[_0xb1b3('0x13')]('Team,\x20%s,\x20%s',_0x1eab86,_0x40f938);_0x2c9f72(_0x40f938);});});} \ No newline at end of file +var _0xc347=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./team.socket','request','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x2ea9ce,_0x4f8890){var _0x1aec12=function(_0x49687a){while(--_0x49687a){_0x2ea9ce['push'](_0x2ea9ce['shift']());}};_0x1aec12(++_0x4f8890);}(_0xc347,0x132));var _0x7c34=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc347[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7c34('0x0'));var util=require(_0x7c34('0x1'));var moment=require(_0x7c34('0x2'));var BPromise=require(_0x7c34('0x3'));var rs=require(_0x7c34('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c34('0x5'))['db'];var utils=require(_0x7c34('0x6'));var logger=require(_0x7c34('0x7'))(_0x7c34('0x8'));var config=require(_0x7c34('0x9'));var jayson=require(_0x7c34('0xa'));var client=jayson[_0x7c34('0xb')][_0x7c34('0xc')]({'port':0x232a});config[_0x7c34('0xd')]=_[_0x7c34('0xe')](config[_0x7c34('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c34('0xf'))(new Redis(config[_0x7c34('0xd')]));require(_0x7c34('0x10'))['register'](socket);function respondWithRpcPromise(_0x437517,_0xcd3f73,_0x2ef54b){return new BPromise(function(_0x80417,_0x294f0d){return client[_0x7c34('0x11')](_0x437517,_0x2ef54b)['then'](function(_0x20bc2c){logger[_0x7c34('0x12')](_0x7c34('0x13'),_0xcd3f73,'request\x20sent');logger[_0x7c34('0x14')](_0x7c34('0x15'),_0xcd3f73,_0x7c34('0x16'),JSON[_0x7c34('0x17')](_0x20bc2c));if(_0x20bc2c['error']){if(_0x20bc2c[_0x7c34('0x18')]['code']===0x1f4){logger[_0x7c34('0x18')](_0x7c34('0x13'),_0xcd3f73,_0x20bc2c[_0x7c34('0x18')][_0x7c34('0x19')]);return _0x294f0d(_0x20bc2c[_0x7c34('0x18')]['message']);}logger[_0x7c34('0x18')]('Team,\x20%s,\x20%s',_0xcd3f73,_0x20bc2c[_0x7c34('0x18')][_0x7c34('0x19')]);return _0x80417(_0x20bc2c['error'][_0x7c34('0x19')]);}else{logger[_0x7c34('0x12')](_0x7c34('0x13'),_0xcd3f73,_0x7c34('0x16'));_0x80417(_0x20bc2c[_0x7c34('0x1a')]['message']);}})[_0x7c34('0x1b')](function(_0x16aca4){logger['error'](_0x7c34('0x13'),_0xcd3f73,_0x16aca4);_0x294f0d(_0x16aca4);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index d80b8ed..5765aef 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 _0x173d=['save','emit','removeListener','team:'];(function(_0x59b35b,_0x9a0ca0){var _0x3facd5=function(_0x33dd5e){while(--_0x33dd5e){_0x59b35b['push'](_0x59b35b['shift']());}};_0x3facd5(++_0x9a0ca0);}(_0x173d,0x108));var _0xd173=function(_0x4b087a,_0x5f337c){_0x4b087a=_0x4b087a-0x0;var _0x4fb7d9=_0x173d[_0x4b087a];return _0x4fb7d9;};'use strict';var TeamEvents=require('./team.events');var events=[_0xd173('0x0'),'remove','update'];function createListener(_0x1b52f3,_0x558a1d){return function(_0x4e7c26){_0x558a1d[_0xd173('0x1')](_0x1b52f3,_0x4e7c26);};}function removeListener(_0x16d405,_0x487266){return function(){TeamEvents[_0xd173('0x2')](_0x16d405,_0x487266);};}exports['register']=function(_0x24f796){for(var _0x2d464b=0x0,_0x454bfa=events['length'];_0x2d464b<_0x454bfa;_0x2d464b++){var _0x239a90=events[_0x2d464b];var _0x5229ad=createListener(_0xd173('0x3')+_0x239a90,_0x24f796);TeamEvents['on'](_0x239a90,_0x5229ad);}}; \ No newline at end of file +var _0xc933=['team:','./team.events','save','remove','update','emit','removeListener','length'];(function(_0x1b3fc5,_0x576f1d){var _0x42f248=function(_0x397304){while(--_0x397304){_0x1b3fc5['push'](_0x1b3fc5['shift']());}};_0x42f248(++_0x576f1d);}(_0xc933,0xf9));var _0x3c93=function(_0x326eb3,_0x5ae4df){_0x326eb3=_0x326eb3-0x0;var _0x3b9d30=_0xc933[_0x326eb3];return _0x3b9d30;};'use strict';var TeamEvents=require(_0x3c93('0x0'));var events=[_0x3c93('0x1'),_0x3c93('0x2'),_0x3c93('0x3')];function createListener(_0x3ce54a,_0x547097){return function(_0xfd3bb5){_0x547097[_0x3c93('0x4')](_0x3ce54a,_0xfd3bb5);};}function removeListener(_0x20d680,_0x343f96){return function(){TeamEvents[_0x3c93('0x5')](_0x20d680,_0x343f96);};}exports['register']=function(_0x1f2667){for(var _0x19939f=0x0,_0x52c22c=events[_0x3c93('0x6')];_0x19939f<_0x52c22c;_0x19939f++){var _0x489139=events[_0x19939f];var _0x1b505a=createListener(_0x3c93('0x7')+_0x489139,_0x1f2667);TeamEvents['on'](_0x489139,_0x1b505a);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index ad2be31..786be7d 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x229fb8,_0xffd4d7){var _0x179205=function(_0x38f433){while(--_0x38f433){_0x229fb8['push'](_0x229fb8['shift']());}};_0x179205(++_0xffd4d7);}(_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(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 4289d0e..9136e3c 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 _0x8e70=['sequelize','exports'];(function(_0x57aabc,_0x4664e5){var _0x39848c=function(_0x3fc1b8){while(--_0x3fc1b8){_0x57aabc['push'](_0x57aabc['shift']());}};_0x39848c(++_0x4664e5);}(_0x8e70,0x88));var _0x08e7=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x8e70[_0x46d0c9];return _0x174506;};'use strict';var Sequelize=require(_0x08e7('0x0'));module[_0x08e7('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7de4=['sequelize','INTEGER'];(function(_0x4366ef,_0x26b905){var _0x29f35e=function(_0xb6333e){while(--_0xb6333e){_0x4366ef['push'](_0x4366ef['shift']());}};_0x29f35e(++_0x26b905);}(_0x7de4,0xb4));var _0x47de=function(_0x21ffd6,_0xca87bb){_0x21ffd6=_0x21ffd6-0x0;var _0x37dff7=_0x7de4[_0x21ffd6];return _0x37dff7;};'use strict';var Sequelize=require(_0x47de('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x47de('0x1')],'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 dd7d8c3..8a01cc1 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 _0x25b5=['team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x57e18a,_0x199383){var _0x1181c7=function(_0x2503e8){while(--_0x2503e8){_0x57e18a['push'](_0x57e18a['shift']());}};_0x1181c7(++_0x199383);}(_0x25b5,0x198));var _0x525b=function(_0x1c7440,_0x17c8f7){_0x1c7440=_0x1c7440-0x0;var _0x448382=_0x25b5[_0x1c7440];return _0x448382;};'use strict';var _=require(_0x525b('0x0'));var util=require(_0x525b('0x1'));var logger=require(_0x525b('0x2'))(_0x525b('0x3'));var moment=require(_0x525b('0x4'));var BPromise=require('bluebird');var rp=require(_0x525b('0x5'));var fs=require('fs');var path=require(_0x525b('0x6'));var rimraf=require(_0x525b('0x7'));var config=require(_0x525b('0x8'));var attributes=require(_0x525b('0x9'));module['exports']=function(_0x5cca3f,_0x982127){return _0x5cca3f['define']('TeamVoiceQueue',attributes,{'tableName':_0x525b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07c3=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash'];(function(_0x14525d,_0x747b83){var _0x26b05c=function(_0xf98e52){while(--_0xf98e52){_0x14525d['push'](_0x14525d['shift']());}};_0x26b05c(++_0x747b83);}(_0x07c3,0x1bf));var _0x307c=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x07c3[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var logger=require(_0x307c('0x2'))(_0x307c('0x3'));var moment=require(_0x307c('0x4'));var BPromise=require(_0x307c('0x5'));var rp=require(_0x307c('0x6'));var fs=require('fs');var path=require(_0x307c('0x7'));var rimraf=require('rimraf');var config=require(_0x307c('0x8'));var attributes=require(_0x307c('0x9'));module[_0x307c('0xa')]=function(_0x317066,_0x250f22){return _0x317066[_0x307c('0xb')](_0x307c('0xc'),attributes,{'tableName':_0x307c('0xd'),'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 4f0e0e3..7a4bee7 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 _0x5c37=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x5a4487,_0x3d0fe8){var _0xb77577=function(_0x8970e6){while(--_0x8970e6){_0x5a4487['push'](_0x5a4487['shift']());}};_0xb77577(++_0x3d0fe8);}(_0x5c37,0x11e));var _0x75c3=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0x5c37[_0x53b8e0];return _0x10630c;};'use strict';var _=require(_0x75c3('0x0'));var util=require(_0x75c3('0x1'));var moment=require(_0x75c3('0x2'));var BPromise=require(_0x75c3('0x3'));var rs=require(_0x75c3('0x4'));var fs=require('fs');var Redis=require(_0x75c3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x75c3('0x6'));var logger=require(_0x75c3('0x7'))(_0x75c3('0x8'));var config=require('../../config/environment');var jayson=require(_0x75c3('0x9'));var client=jayson[_0x75c3('0xa')][_0x75c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c19fa,_0x47d78b,_0x1c9a68){return new BPromise(function(_0x5b9389,_0x4bf06b){return client[_0x75c3('0xc')](_0x3c19fa,_0x1c9a68)[_0x75c3('0xd')](function(_0x5609c9){logger[_0x75c3('0xe')](_0x75c3('0xf'),_0x47d78b,_0x75c3('0x10'));logger[_0x75c3('0x11')](_0x75c3('0x12'),_0x47d78b,_0x75c3('0x10'),JSON['stringify'](_0x5609c9));if(_0x5609c9['error']){if(_0x5609c9[_0x75c3('0x13')][_0x75c3('0x14')]===0x1f4){logger[_0x75c3('0x13')](_0x75c3('0xf'),_0x47d78b,_0x5609c9[_0x75c3('0x13')]['message']);return _0x4bf06b(_0x5609c9[_0x75c3('0x13')][_0x75c3('0x15')]);}logger[_0x75c3('0x13')](_0x75c3('0xf'),_0x47d78b,_0x5609c9['error'][_0x75c3('0x15')]);return _0x5b9389(_0x5609c9[_0x75c3('0x13')][_0x75c3('0x15')]);}else{logger[_0x75c3('0xe')](_0x75c3('0xf'),_0x47d78b,_0x75c3('0x10'));_0x5b9389(_0x5609c9[_0x75c3('0x16')][_0x75c3('0x15')]);}})[_0x75c3('0x17')](function(_0x4a450c){logger[_0x75c3('0x13')](_0x75c3('0xf'),_0x47d78b,_0x4a450c);_0x4bf06b(_0x4a450c);});});} \ No newline at end of file +var _0x9251=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3c9831,_0x147bf6){var _0x221fcf=function(_0x45ad37){while(--_0x45ad37){_0x3c9831['push'](_0x3c9831['shift']());}};_0x221fcf(++_0x147bf6);}(_0x9251,0x1e6));var _0x1925=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0x9251[_0x29dda1];return _0x21b0ef;};'use strict';var _=require('lodash');var util=require(_0x1925('0x0'));var moment=require(_0x1925('0x1'));var BPromise=require(_0x1925('0x2'));var rs=require(_0x1925('0x3'));var fs=require('fs');var Redis=require(_0x1925('0x4'));var db=require(_0x1925('0x5'))['db'];var utils=require(_0x1925('0x6'));var logger=require(_0x1925('0x7'))(_0x1925('0x8'));var config=require(_0x1925('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1925('0xa')][_0x1925('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a6313,_0x3dd721,_0x4f8d6c){return new BPromise(function(_0x4cfd03,_0x41d888){return client[_0x1925('0xc')](_0x1a6313,_0x4f8d6c)['then'](function(_0x4a37e1){logger[_0x1925('0xd')](_0x1925('0xe'),_0x3dd721,_0x1925('0xf'));logger[_0x1925('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3dd721,_0x1925('0xf'),JSON[_0x1925('0x11')](_0x4a37e1));if(_0x4a37e1['error']){if(_0x4a37e1[_0x1925('0x12')][_0x1925('0x13')]===0x1f4){logger[_0x1925('0x12')](_0x1925('0xe'),_0x3dd721,_0x4a37e1[_0x1925('0x12')][_0x1925('0x14')]);return _0x41d888(_0x4a37e1['error']['message']);}logger[_0x1925('0x12')](_0x1925('0xe'),_0x3dd721,_0x4a37e1[_0x1925('0x12')][_0x1925('0x14')]);return _0x4cfd03(_0x4a37e1['error']['message']);}else{logger[_0x1925('0xd')](_0x1925('0xe'),_0x3dd721,_0x1925('0xf'));_0x4cfd03(_0x4a37e1[_0x1925('0x15')][_0x1925('0x14')]);}})[_0x1925('0x16')](function(_0x568257){logger[_0x1925('0x12')](_0x1925('0xe'),_0x3dd721,_0x568257);_0x41d888(_0x568257);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 4a60084..5ae0b06 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 _0xb0ee=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x324dac,_0x524176){var _0x4bcf1a=function(_0x16c999){while(--_0x16c999){_0x324dac['push'](_0x324dac['shift']());}};_0x4bcf1a(++_0x524176);}(_0xb0ee,0x18f));var _0xeb0e=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xb0ee[_0x486f4a];return _0x135d99;};'use strict';var multer=require('multer');var util=require(_0xeb0e('0x0'));var path=require(_0xeb0e('0x1'));var timeout=require(_0xeb0e('0x2'));var express=require(_0xeb0e('0x3'));var router=express[_0xeb0e('0x4')]();var fs_extra=require(_0xeb0e('0x5'));var auth=require(_0xeb0e('0x6'));var interaction=require(_0xeb0e('0x7'));var config=require(_0xeb0e('0x8'));var controller=require(_0xeb0e('0x9'));router['get']('/',auth[_0xeb0e('0xa')](),controller[_0xeb0e('0xb')]);router[_0xeb0e('0xc')](_0xeb0e('0xd'),auth['isAuthenticated'](),controller[_0xeb0e('0xe')]);router[_0xeb0e('0xf')]('/',auth[_0xeb0e('0xa')](),controller[_0xeb0e('0x10')]);router[_0xeb0e('0x11')](_0xeb0e('0xd'),auth[_0xeb0e('0xa')](),controller[_0xeb0e('0x12')]);router[_0xeb0e('0x13')](_0xeb0e('0xd'),auth[_0xeb0e('0xa')](),controller[_0xeb0e('0x14')]);module[_0xeb0e('0x15')]=router; \ No newline at end of file +var _0x955f=['path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x955f,0x1eb));var _0xf955=function(_0x65f169,_0x42fc3f){_0x65f169=_0x65f169-0x0;var _0xf716d7=_0x955f[_0x65f169];return _0xf716d7;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./template.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['show']);router[_0xf955('0xb')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')](_0xf955('0xa'),auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['delete'](_0xf955('0xa'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);module[_0xf955('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 760588f..0a57f0a 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 _0x209e=['exports','STRING','TEXT'];(function(_0x16f318,_0xdb0ef3){var _0x56a381=function(_0x192604){while(--_0x192604){_0x16f318['push'](_0x16f318['shift']());}};_0x56a381(++_0xdb0ef3);}(_0x209e,0x189));var _0xe209=function(_0x536ee,_0x1b8acc){_0x536ee=_0x536ee-0x0;var _0x228d4d=_0x209e[_0x536ee];return _0x228d4d;};'use strict';var Sequelize=require('sequelize');module[_0xe209('0x0')]={'name':{'type':Sequelize[_0xe209('0x1')]},'description':{'type':Sequelize[_0xe209('0x1')]},'html':{'type':Sequelize[_0xe209('0x2')]}}; \ No newline at end of file +var _0xef9f=['TEXT','sequelize','exports','STRING'];(function(_0x57d628,_0xda6747){var _0x2f8486=function(_0x5f2cba){while(--_0x5f2cba){_0x57d628['push'](_0x57d628['shift']());}};_0x2f8486(++_0xda6747);}(_0xef9f,0x95));var _0xfef9=function(_0x2a5949,_0x2126c0){_0x2a5949=_0x2a5949-0x0;var _0x116094=_0xef9f[_0x2a5949];return _0x116094;};'use strict';var Sequelize=require(_0xfef9('0x0'));module[_0xfef9('0x1')]={'name':{'type':Sequelize[_0xfef9('0x2')]},'description':{'type':Sequelize[_0xfef9('0x2')]},'html':{'type':Sequelize[_0xfef9('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 55f9f75..1ec844e 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 _0x08bb=['keys','query','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Template','includeAll','include','rows','show','params','rawAttributes','intersection','length','find','create','body','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','end','name','send','index','map','fieldName','key','model'];(function(_0x5f5431,_0x908c84){var _0x46f69c=function(_0x3f21aa){while(--_0x3f21aa){_0x5f5431['push'](_0x5f5431['shift']());}};_0x46f69c(++_0x908c84);}(_0x08bb,0x165));var _0xb08b=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x08bb[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb08b('0x0'));var zipdir=require(_0xb08b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb08b('0x2'));var moment=require(_0xb08b('0x3'));var BPromise=require(_0xb08b('0x4'));var Mustache=require(_0xb08b('0x5'));var util=require(_0xb08b('0x6'));var path=require(_0xb08b('0x7'));var sox=require(_0xb08b('0x8'));var csv=require(_0xb08b('0x9'));var ejs=require(_0xb08b('0xa'));var fs=require('fs');var fs_extra=require(_0xb08b('0xb'));var _=require('lodash');var squel=require(_0xb08b('0xc'));var crypto=require(_0xb08b('0xd'));var jsforce=require(_0xb08b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb08b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb08b('0x10'));var qs=require(_0xb08b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb08b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xb08b('0x13'));var config=require(_0xb08b('0x14'));var licenseUtil=require(_0xb08b('0x15'));var db=require(_0xb08b('0x16'))['db'];function respondWithStatusCode(_0x3f12da,_0x247736){_0x247736=_0x247736||0xcc;return function(_0x124db7){if(_0x124db7){return _0x3f12da['sendStatus'](_0x247736);}return _0x3f12da[_0xb08b('0x17')](_0x247736)['end']();};}function respondWithResult(_0x336133,_0x364e5a){_0x364e5a=_0x364e5a||0xc8;return function(_0x4df0f9){if(_0x4df0f9){return _0x336133[_0xb08b('0x17')](_0x364e5a)[_0xb08b('0x18')](_0x4df0f9);}};}function respondWithFilteredResult(_0x315dda,_0x211964){return function(_0x23dc88){if(_0x23dc88){var _0x514571=typeof _0x211964[_0xb08b('0x19')]===_0xb08b('0x1a')&&typeof _0x211964[_0xb08b('0x1b')]===_0xb08b('0x1a');var _0x1a1f56=_0x23dc88[_0xb08b('0x1c')];var _0xc64964=_0x514571?0x0:_0x211964[_0xb08b('0x19')];var _0x412da7=_0x514571?_0x23dc88[_0xb08b('0x1c')]:_0x211964[_0xb08b('0x19')]+_0x211964['limit'];var _0x139ecb;if(_0x412da7>=_0x1a1f56){_0x412da7=_0x1a1f56;_0x139ecb=0xc8;}else{_0x139ecb=0xce;}_0x315dda[_0xb08b('0x17')](_0x139ecb);return _0x315dda[_0xb08b('0x1d')](_0xb08b('0x1e'),_0xc64964+'-'+_0x412da7+'/'+_0x1a1f56)[_0xb08b('0x18')](_0x23dc88);}return null;};}function patchUpdates(_0x347d3c){return function(_0x1ad709){try{jsonpatch[_0xb08b('0x1f')](_0x1ad709,_0x347d3c,!![]);}catch(_0x63e62c){return BPromise[_0xb08b('0x20')](_0x63e62c);}return _0x1ad709[_0xb08b('0x21')]();};}function saveUpdates(_0x1de44a,_0x315fe3){return function(_0x2283f4){if(_0x2283f4){return _0x2283f4[_0xb08b('0x22')](_0x1de44a)[_0xb08b('0x23')](function(_0x51f8ec){return _0x51f8ec;});}return null;};}function removeEntity(_0xb8ff7e,_0x18c440){return function(_0x5006fb){if(_0x5006fb){return _0x5006fb[_0xb08b('0x24')]()[_0xb08b('0x23')](function(){var _0x4005c8=_0x5006fb[_0xb08b('0x25')]({'plain':!![]});var _0x129996=_0xb08b('0x26');return db[_0xb08b('0x27')]['destroy']({'where':{'type':_0x129996,'resourceId':_0x4005c8['id']}})[_0xb08b('0x23')](function(){return _0x5006fb;});})[_0xb08b('0x23')](function(){_0xb8ff7e[_0xb08b('0x17')](0xcc)[_0xb08b('0x28')]();});}};}function handleEntityNotFound(_0x96b039,_0xba9af7){return function(_0x2207fd){if(!_0x2207fd){_0x96b039['sendStatus'](0x194);}return _0x2207fd;};}function handleError(_0x944354,_0x20f186){_0x20f186=_0x20f186||0x1f4;return function(_0x3470a1){logger['error'](_0x3470a1['stack']);if(_0x3470a1[_0xb08b('0x29')]){delete _0x3470a1[_0xb08b('0x29')];}_0x944354[_0xb08b('0x17')](_0x20f186)[_0xb08b('0x2a')](_0x3470a1);};}exports[_0xb08b('0x2b')]=function(_0x56661b,_0x535979){var _0x5c7eb4={},_0x32ee4f={},_0xb66c1d={'count':0x0,'rows':[]};var _0x55f0b0=_[_0xb08b('0x2c')](db['Template']['rawAttributes'],function(_0x245c31){return{'name':_0x245c31[_0xb08b('0x2d')],'type':_0x245c31['type'][_0xb08b('0x2e')]};});_0x32ee4f[_0xb08b('0x2f')]=_['map'](_0x55f0b0,_0xb08b('0x29'));_0x32ee4f['query']=_[_0xb08b('0x30')](_0x56661b[_0xb08b('0x31')]);_0x32ee4f['filters']=_['intersection'](_0x32ee4f[_0xb08b('0x2f')],_0x32ee4f[_0xb08b('0x31')]);_0x5c7eb4[_0xb08b('0x32')]=_['intersection'](_0x32ee4f[_0xb08b('0x2f')],qs[_0xb08b('0x33')](_0x56661b[_0xb08b('0x31')][_0xb08b('0x33')]));_0x5c7eb4[_0xb08b('0x32')]=_0x5c7eb4[_0xb08b('0x32')]['length']?_0x5c7eb4[_0xb08b('0x32')]:_0x32ee4f[_0xb08b('0x2f')];if(!_0x56661b[_0xb08b('0x31')][_0xb08b('0x34')]('nolimit')){_0x5c7eb4[_0xb08b('0x1b')]=qs['limit'](_0x56661b[_0xb08b('0x31')][_0xb08b('0x1b')]);_0x5c7eb4[_0xb08b('0x19')]=qs['offset'](_0x56661b[_0xb08b('0x31')][_0xb08b('0x19')]);}_0x5c7eb4[_0xb08b('0x35')]=qs[_0xb08b('0x36')](_0x56661b[_0xb08b('0x31')]['sort']);_0x5c7eb4[_0xb08b('0x37')]=qs[_0xb08b('0x38')](_[_0xb08b('0x39')](_0x56661b['query'],_0x32ee4f['filters']),_0x55f0b0);if(_0x56661b[_0xb08b('0x31')][_0xb08b('0x3a')]){_0x5c7eb4[_0xb08b('0x37')]=_[_0xb08b('0x3b')](_0x5c7eb4[_0xb08b('0x37')],{'$or':_[_0xb08b('0x2c')](_0x55f0b0,function(_0x13840f){if(_0x13840f[_0xb08b('0x3c')]!==_0xb08b('0x3d')){var _0x5b3ac5={};_0x5b3ac5[_0x13840f[_0xb08b('0x29')]]={'$like':'%'+_0x56661b[_0xb08b('0x31')][_0xb08b('0x3a')]+'%'};return _0x5b3ac5;}})});}_0x5c7eb4=_[_0xb08b('0x3b')]({},_0x5c7eb4,_0x56661b[_0xb08b('0x3e')]);var _0x422a19={'where':_0x5c7eb4[_0xb08b('0x37')]};return db[_0xb08b('0x3f')][_0xb08b('0x1c')](_0x422a19)[_0xb08b('0x23')](function(_0x6ec4b2){_0xb66c1d[_0xb08b('0x1c')]=_0x6ec4b2;if(_0x56661b[_0xb08b('0x31')][_0xb08b('0x40')]){_0x5c7eb4[_0xb08b('0x41')]=[{'all':!![]}];}return db[_0xb08b('0x3f')]['findAll'](_0x5c7eb4);})[_0xb08b('0x23')](function(_0x5d4f2c){_0xb66c1d[_0xb08b('0x42')]=_0x5d4f2c;return _0xb66c1d;})[_0xb08b('0x23')](respondWithFilteredResult(_0x535979,_0x5c7eb4))['catch'](handleError(_0x535979,null));};exports[_0xb08b('0x43')]=function(_0x10e9dd,_0x54ee7e){var _0x5940d5={'raw':!![],'where':{'id':_0x10e9dd[_0xb08b('0x44')]['id']}},_0x3260ec={};_0x3260ec[_0xb08b('0x2f')]=_['keys'](db['Template'][_0xb08b('0x45')]);_0x3260ec[_0xb08b('0x31')]=_[_0xb08b('0x30')](_0x10e9dd[_0xb08b('0x31')]);_0x3260ec[_0xb08b('0x38')]=_[_0xb08b('0x46')](_0x3260ec[_0xb08b('0x2f')],_0x3260ec[_0xb08b('0x31')]);_0x5940d5[_0xb08b('0x32')]=_[_0xb08b('0x46')](_0x3260ec['model'],qs['fields'](_0x10e9dd[_0xb08b('0x31')][_0xb08b('0x33')]));_0x5940d5[_0xb08b('0x32')]=_0x5940d5[_0xb08b('0x32')][_0xb08b('0x47')]?_0x5940d5['attributes']:_0x3260ec[_0xb08b('0x2f')];if(_0x10e9dd[_0xb08b('0x31')][_0xb08b('0x40')]){_0x5940d5[_0xb08b('0x41')]=[{'all':!![]}];}_0x5940d5=_['merge']({},_0x5940d5,_0x10e9dd[_0xb08b('0x3e')]);return db[_0xb08b('0x3f')][_0xb08b('0x48')](_0x5940d5)[_0xb08b('0x23')](handleEntityNotFound(_0x54ee7e,null))[_0xb08b('0x23')](respondWithResult(_0x54ee7e,null))['catch'](handleError(_0x54ee7e,null));};exports['create']=function(_0x3dd1e4,_0xd0d9fa){return db[_0xb08b('0x3f')][_0xb08b('0x49')](_0x3dd1e4[_0xb08b('0x4a')],{})[_0xb08b('0x23')](function(_0x25a0f1){var _0x577c33=_0x3dd1e4[_0xb08b('0x4b')][_0xb08b('0x25')]({'plain':!![]});if(!_0x577c33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x577c33['role']==='user'){var _0x309410=_0x25a0f1[_0xb08b('0x25')]({'plain':!![]});var _0x4463dc=_0xb08b('0x26');return db[_0xb08b('0x4c')][_0xb08b('0x48')]({'where':{'name':_0x4463dc,'userProfileId':_0x577c33['userProfileId']},'raw':!![]})[_0xb08b('0x23')](function(_0x1f0338){if(_0x1f0338&&_0x1f0338[_0xb08b('0x4d')]===0x0){return db[_0xb08b('0x27')][_0xb08b('0x49')]({'name':_0x309410[_0xb08b('0x29')],'resourceId':_0x309410['id'],'type':_0x1f0338[_0xb08b('0x29')],'sectionId':_0x1f0338['id']},{})[_0xb08b('0x23')](function(){return _0x25a0f1;});}else{return _0x25a0f1;}})['catch'](function(_0x23188c){logger[_0xb08b('0x4e')](_0xb08b('0x4f'),_0x23188c);throw _0x23188c;});}return _0x25a0f1;})[_0xb08b('0x23')](respondWithResult(_0xd0d9fa,0xc9))['catch'](handleError(_0xd0d9fa,null));};exports[_0xb08b('0x22')]=function(_0x499e62,_0x461378){if(_0x499e62['body']['id']){delete _0x499e62[_0xb08b('0x4a')]['id'];}return db[_0xb08b('0x3f')][_0xb08b('0x48')]({'where':{'id':_0x499e62[_0xb08b('0x44')]['id']}})[_0xb08b('0x23')](handleEntityNotFound(_0x461378,null))['then'](saveUpdates(_0x499e62['body'],null))[_0xb08b('0x23')](respondWithResult(_0x461378,null))['catch'](handleError(_0x461378,null));};exports['destroy']=function(_0x403be5,_0x22fa1b){return db[_0xb08b('0x3f')][_0xb08b('0x48')]({'where':{'id':_0x403be5[_0xb08b('0x44')]['id']}})[_0xb08b('0x23')](handleEntityNotFound(_0x22fa1b,null))['then'](removeEntity(_0x22fa1b,null))[_0xb08b('0x50')](handleError(_0x22fa1b,null));}; \ No newline at end of file +var _0xa571=['apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','stack','name','index','Template','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa571,0x1e6));var _0x1a57=function(_0x95cf71,_0x597e5b){_0x95cf71=_0x95cf71-0x0;var _0x979b54=_0xa571[_0x95cf71];return _0x979b54;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a57('0x3'));var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require(_0x1a57('0x6'));var util=require(_0x1a57('0x7'));var path=require(_0x1a57('0x8'));var sox=require(_0x1a57('0x9'));var csv=require(_0x1a57('0xa'));var ejs=require(_0x1a57('0xb'));var fs=require('fs');var fs_extra=require(_0x1a57('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1a57('0xd'));var jsforce=require(_0x1a57('0xe'));var deskjs=require(_0x1a57('0xf'));var toCsv=require(_0x1a57('0xa'));var querystring=require(_0x1a57('0x10'));var Papa=require('papaparse');var Redis=require(_0x1a57('0x11'));var authService=require(_0x1a57('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1a57('0x13'));var hardwareService=require(_0x1a57('0x14'));var logger=require(_0x1a57('0x15'))(_0x1a57('0x16'));var utils=require(_0x1a57('0x17'));var config=require(_0x1a57('0x18'));var licenseUtil=require(_0x1a57('0x19'));var db=require(_0x1a57('0x1a'))['db'];function respondWithStatusCode(_0x18ccf2,_0x4202a5){_0x4202a5=_0x4202a5||0xcc;return function(_0x1ea571){if(_0x1ea571){return _0x18ccf2[_0x1a57('0x1b')](_0x4202a5);}return _0x18ccf2[_0x1a57('0x1c')](_0x4202a5)['end']();};}function respondWithResult(_0x1684f1,_0x20f724){_0x20f724=_0x20f724||0xc8;return function(_0x4e0b93){if(_0x4e0b93){return _0x1684f1[_0x1a57('0x1c')](_0x20f724)['json'](_0x4e0b93);}};}function respondWithFilteredResult(_0x588d52,_0x31b2f9){return function(_0x1b6320){if(_0x1b6320){var _0x483544=typeof _0x31b2f9[_0x1a57('0x1d')]==='undefined'&&typeof _0x31b2f9[_0x1a57('0x1e')]===_0x1a57('0x1f');var _0x5a7afe=_0x1b6320[_0x1a57('0x20')];var _0x5b8d55=_0x483544?0x0:_0x31b2f9['offset'];var _0x51de0c=_0x483544?_0x1b6320[_0x1a57('0x20')]:_0x31b2f9[_0x1a57('0x1d')]+_0x31b2f9[_0x1a57('0x1e')];var _0x52465d;if(_0x51de0c>=_0x5a7afe){_0x51de0c=_0x5a7afe;_0x52465d=0xc8;}else{_0x52465d=0xce;}_0x588d52[_0x1a57('0x1c')](_0x52465d);return _0x588d52[_0x1a57('0x21')](_0x1a57('0x22'),_0x5b8d55+'-'+_0x51de0c+'/'+_0x5a7afe)[_0x1a57('0x23')](_0x1b6320);}return null;};}function patchUpdates(_0x7a5ff4){return function(_0x4faf74){try{jsonpatch[_0x1a57('0x24')](_0x4faf74,_0x7a5ff4,!![]);}catch(_0x448dfd){return BPromise[_0x1a57('0x25')](_0x448dfd);}return _0x4faf74[_0x1a57('0x26')]();};}function saveUpdates(_0x12ffb2,_0x4d45b5){return function(_0x46d94b){if(_0x46d94b){return _0x46d94b[_0x1a57('0x27')](_0x12ffb2)['then'](function(_0x10134a){return _0x10134a;});}return null;};}function removeEntity(_0x4b9d58,_0x336785){return function(_0x38fb19){if(_0x38fb19){return _0x38fb19[_0x1a57('0x28')]()[_0x1a57('0x29')](function(){var _0x58c855=_0x38fb19[_0x1a57('0x2a')]({'plain':!![]});var _0x3fd30a=_0x1a57('0x2b');return db[_0x1a57('0x2c')][_0x1a57('0x28')]({'where':{'type':_0x3fd30a,'resourceId':_0x58c855['id']}})[_0x1a57('0x29')](function(){return _0x38fb19;});})[_0x1a57('0x29')](function(){_0x4b9d58[_0x1a57('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x470a95,_0x5bee43){return function(_0x59ece6){if(!_0x59ece6){_0x470a95[_0x1a57('0x1b')](0x194);}return _0x59ece6;};}function handleError(_0x968168,_0xd8e52e){_0xd8e52e=_0xd8e52e||0x1f4;return function(_0x132eda){logger['error'](_0x132eda[_0x1a57('0x2d')]);if(_0x132eda[_0x1a57('0x2e')]){delete _0x132eda[_0x1a57('0x2e')];}_0x968168['status'](_0xd8e52e)['send'](_0x132eda);};}exports[_0x1a57('0x2f')]=function(_0x4b4789,_0x226876){var _0x2cfef6={},_0x33c17f={},_0x31d548={'count':0x0,'rows':[]};var _0x417284=_['map'](db[_0x1a57('0x30')][_0x1a57('0x31')],function(_0x9f18a0){return{'name':_0x9f18a0[_0x1a57('0x32')],'type':_0x9f18a0[_0x1a57('0x33')]['key']};});_0x33c17f[_0x1a57('0x34')]=_[_0x1a57('0x35')](_0x417284,_0x1a57('0x2e'));_0x33c17f[_0x1a57('0x36')]=_['keys'](_0x4b4789[_0x1a57('0x36')]);_0x33c17f['filters']=_[_0x1a57('0x37')](_0x33c17f[_0x1a57('0x34')],_0x33c17f[_0x1a57('0x36')]);_0x2cfef6[_0x1a57('0x38')]=_[_0x1a57('0x37')](_0x33c17f[_0x1a57('0x34')],qs[_0x1a57('0x39')](_0x4b4789[_0x1a57('0x36')][_0x1a57('0x39')]));_0x2cfef6[_0x1a57('0x38')]=_0x2cfef6[_0x1a57('0x38')][_0x1a57('0x3a')]?_0x2cfef6['attributes']:_0x33c17f[_0x1a57('0x34')];if(!_0x4b4789[_0x1a57('0x36')]['hasOwnProperty'](_0x1a57('0x3b'))){_0x2cfef6[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x4b4789[_0x1a57('0x36')]['limit']);_0x2cfef6[_0x1a57('0x1d')]=qs[_0x1a57('0x1d')](_0x4b4789[_0x1a57('0x36')][_0x1a57('0x1d')]);}_0x2cfef6[_0x1a57('0x3c')]=qs[_0x1a57('0x3d')](_0x4b4789[_0x1a57('0x36')][_0x1a57('0x3d')]);_0x2cfef6[_0x1a57('0x3e')]=qs[_0x1a57('0x3f')](_[_0x1a57('0x40')](_0x4b4789[_0x1a57('0x36')],_0x33c17f[_0x1a57('0x3f')]),_0x417284);if(_0x4b4789[_0x1a57('0x36')][_0x1a57('0x41')]){_0x2cfef6[_0x1a57('0x3e')]=_[_0x1a57('0x42')](_0x2cfef6[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x35')](_0x417284,function(_0x237f8f){if(_0x237f8f[_0x1a57('0x33')]!==_0x1a57('0x43')){var _0x527ef8={};_0x527ef8[_0x237f8f[_0x1a57('0x2e')]]={'$like':'%'+_0x4b4789[_0x1a57('0x36')][_0x1a57('0x41')]+'%'};return _0x527ef8;}})});}_0x2cfef6=_[_0x1a57('0x42')]({},_0x2cfef6,_0x4b4789[_0x1a57('0x44')]);var _0x2adc63={'where':_0x2cfef6[_0x1a57('0x3e')]};return db[_0x1a57('0x30')][_0x1a57('0x20')](_0x2adc63)[_0x1a57('0x29')](function(_0x11c018){_0x31d548['count']=_0x11c018;if(_0x4b4789[_0x1a57('0x36')]['includeAll']){_0x2cfef6[_0x1a57('0x45')]=[{'all':!![]}];}return db[_0x1a57('0x30')][_0x1a57('0x46')](_0x2cfef6);})['then'](function(_0x305701){_0x31d548[_0x1a57('0x47')]=_0x305701;return _0x31d548;})[_0x1a57('0x29')](respondWithFilteredResult(_0x226876,_0x2cfef6))[_0x1a57('0x48')](handleError(_0x226876,null));};exports[_0x1a57('0x49')]=function(_0x277bab,_0xb3765f){var _0x41ca08={'raw':!![],'where':{'id':_0x277bab['params']['id']}},_0x118100={};_0x118100[_0x1a57('0x34')]=_['keys'](db[_0x1a57('0x30')][_0x1a57('0x31')]);_0x118100[_0x1a57('0x36')]=_[_0x1a57('0x4a')](_0x277bab[_0x1a57('0x36')]);_0x118100['filters']=_[_0x1a57('0x37')](_0x118100[_0x1a57('0x34')],_0x118100[_0x1a57('0x36')]);_0x41ca08[_0x1a57('0x38')]=_[_0x1a57('0x37')](_0x118100[_0x1a57('0x34')],qs[_0x1a57('0x39')](_0x277bab['query']['fields']));_0x41ca08[_0x1a57('0x38')]=_0x41ca08[_0x1a57('0x38')][_0x1a57('0x3a')]?_0x41ca08[_0x1a57('0x38')]:_0x118100[_0x1a57('0x34')];if(_0x277bab['query'][_0x1a57('0x4b')]){_0x41ca08[_0x1a57('0x45')]=[{'all':!![]}];}_0x41ca08=_[_0x1a57('0x42')]({},_0x41ca08,_0x277bab[_0x1a57('0x44')]);return db[_0x1a57('0x30')][_0x1a57('0x4c')](_0x41ca08)[_0x1a57('0x29')](handleEntityNotFound(_0xb3765f,null))['then'](respondWithResult(_0xb3765f,null))[_0x1a57('0x48')](handleError(_0xb3765f,null));};exports[_0x1a57('0x4d')]=function(_0x4525b0,_0x1e1621){return db[_0x1a57('0x30')]['create'](_0x4525b0[_0x1a57('0x4e')],{})['then'](function(_0x51fb14){var _0x398b4e=_0x4525b0[_0x1a57('0x4f')][_0x1a57('0x2a')]({'plain':!![]});if(!_0x398b4e)throw new Error(_0x1a57('0x50'));if(_0x398b4e[_0x1a57('0x51')]===_0x1a57('0x4f')){var _0x3952ee=_0x51fb14['get']({'plain':!![]});var _0x1ffdc1=_0x1a57('0x2b');return db[_0x1a57('0x52')][_0x1a57('0x4c')]({'where':{'name':_0x1ffdc1,'userProfileId':_0x398b4e[_0x1a57('0x53')]},'raw':!![]})[_0x1a57('0x29')](function(_0x481d26){if(_0x481d26&&_0x481d26['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a57('0x4d')]({'name':_0x3952ee[_0x1a57('0x2e')],'resourceId':_0x3952ee['id'],'type':_0x481d26['name'],'sectionId':_0x481d26['id']},{})['then'](function(){return _0x51fb14;});}else{return _0x51fb14;}})['catch'](function(_0x519815){logger[_0x1a57('0x54')](_0x1a57('0x55'),_0x519815);throw _0x519815;});}return _0x51fb14;})[_0x1a57('0x29')](respondWithResult(_0x1e1621,0xc9))[_0x1a57('0x48')](handleError(_0x1e1621,null));};exports[_0x1a57('0x27')]=function(_0x964c32,_0x49040e){if(_0x964c32[_0x1a57('0x4e')]['id']){delete _0x964c32[_0x1a57('0x4e')]['id'];}return db['Template']['find']({'where':{'id':_0x964c32[_0x1a57('0x56')]['id']}})['then'](handleEntityNotFound(_0x49040e,null))['then'](saveUpdates(_0x964c32[_0x1a57('0x4e')],null))['then'](respondWithResult(_0x49040e,null))['catch'](handleError(_0x49040e,null));};exports[_0x1a57('0x28')]=function(_0x177b72,_0x57fed5){return db[_0x1a57('0x30')][_0x1a57('0x4c')]({'where':{'id':_0x177b72[_0x1a57('0x56')]['id']}})[_0x1a57('0x29')](handleEntityNotFound(_0x57fed5,null))[_0x1a57('0x29')](removeEntity(_0x57fed5,null))[_0x1a57('0x48')](handleError(_0x57fed5,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 4940fa3..c90536d 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 _0x2971=['define','Template','tools_templates','lodash','../../config/logger','moment','bluebird','request-promise','path','./template.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2971,0x1bb));var _0x1297=function(_0x39f769,_0x120adb){_0x39f769=_0x39f769-0x0;var _0x45338b=_0x2971[_0x39f769];return _0x45338b;};'use strict';var _=require(_0x1297('0x0'));var util=require('util');var logger=require(_0x1297('0x1'))('api');var moment=require(_0x1297('0x2'));var BPromise=require(_0x1297('0x3'));var rp=require(_0x1297('0x4'));var fs=require('fs');var path=require(_0x1297('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1297('0x6'));module[_0x1297('0x7')]=function(_0x2fe0b5,_0x49d699){return _0x2fe0b5[_0x1297('0x8')](_0x1297('0x9'),attributes,{'tableName':_0x1297('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1155=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger'];(function(_0x15aa73,_0x4eea3f){var _0x3fe2f5=function(_0x4c5b4c){while(--_0x4c5b4c){_0x15aa73['push'](_0x15aa73['shift']());}};_0x3fe2f5(++_0x4eea3f);}(_0x1155,0x1cb));var _0x5115=function(_0x7a68c7,_0x1cfb76){_0x7a68c7=_0x7a68c7-0x0;var _0x40e6fa=_0x1155[_0x7a68c7];return _0x40e6fa;};'use strict';var _=require(_0x5115('0x0'));var util=require(_0x5115('0x1'));var logger=require(_0x5115('0x2'))('api');var moment=require(_0x5115('0x3'));var BPromise=require(_0x5115('0x4'));var rp=require(_0x5115('0x5'));var fs=require('fs');var path=require(_0x5115('0x6'));var rimraf=require(_0x5115('0x7'));var config=require(_0x5115('0x8'));var attributes=require(_0x5115('0x9'));module[_0x5115('0xa')]=function(_0x286262,_0x49ffda){return _0x286262[_0x5115('0xb')](_0x5115('0xc'),attributes,{'tableName':_0x5115('0xd'),'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 006e7f5..018fd2b 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 _0xd40b=['request\x20sent','debug','error','message','result','Template','findAll','options','raw','where','attributes','limit','include','map','model','GetTemplate','stringify','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s'];(function(_0x337e1e,_0x168c4d){var _0x408d30=function(_0x171ac8){while(--_0x171ac8){_0x337e1e['push'](_0x337e1e['shift']());}};_0x408d30(++_0x168c4d);}(_0xd40b,0x78));var _0xbd40=function(_0x40db05,_0x2ac741){_0x40db05=_0x40db05-0x0;var _0x1aa325=_0xd40b[_0x40db05];return _0x1aa325;};'use strict';var _=require(_0xbd40('0x0'));var util=require(_0xbd40('0x1'));var moment=require(_0xbd40('0x2'));var BPromise=require(_0xbd40('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd40('0x4'))['db'];var utils=require(_0xbd40('0x5'));var logger=require(_0xbd40('0x6'))(_0xbd40('0x7'));var config=require(_0xbd40('0x8'));var jayson=require(_0xbd40('0x9'));var client=jayson[_0xbd40('0xa')][_0xbd40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a3444,_0x3e51ff,_0x4eddd9){return new BPromise(function(_0x595852,_0x5b1bc7){return client[_0xbd40('0xc')](_0x2a3444,_0x4eddd9)[_0xbd40('0xd')](function(_0x5d8a21){logger[_0xbd40('0xe')](_0xbd40('0xf'),_0x3e51ff,_0xbd40('0x10'));logger[_0xbd40('0x11')]('Template,\x20%s,\x20%s,\x20%s',_0x3e51ff,_0xbd40('0x10'),JSON['stringify'](_0x5d8a21));if(_0x5d8a21[_0xbd40('0x12')]){if(_0x5d8a21[_0xbd40('0x12')]['code']===0x1f4){logger[_0xbd40('0x12')](_0xbd40('0xf'),_0x3e51ff,_0x5d8a21[_0xbd40('0x12')][_0xbd40('0x13')]);return _0x5b1bc7(_0x5d8a21['error'][_0xbd40('0x13')]);}logger[_0xbd40('0x12')](_0xbd40('0xf'),_0x3e51ff,_0x5d8a21[_0xbd40('0x12')][_0xbd40('0x13')]);return _0x595852(_0x5d8a21['error'][_0xbd40('0x13')]);}else{logger['info'](_0xbd40('0xf'),_0x3e51ff,_0xbd40('0x10'));_0x595852(_0x5d8a21[_0xbd40('0x14')][_0xbd40('0x13')]);}})['catch'](function(_0x342627){logger['error'](_0xbd40('0xf'),_0x3e51ff,_0x342627);_0x5b1bc7(_0x342627);});});}exports['GetTemplate']=function(_0x2a1c24){var _0x26769d=this;return new Promise(function(_0x45cbe7,_0x196360){return db[_0xbd40('0x15')][_0xbd40('0x16')]({'raw':_0x2a1c24['options']?_0x2a1c24[_0xbd40('0x17')][_0xbd40('0x18')]===undefined?!![]:![]:!![],'where':_0x2a1c24[_0xbd40('0x17')]?_0x2a1c24[_0xbd40('0x17')][_0xbd40('0x19')]||null:null,'attributes':_0x2a1c24[_0xbd40('0x17')]?_0x2a1c24[_0xbd40('0x17')][_0xbd40('0x1a')]||null:null,'limit':_0x2a1c24['options']?_0x2a1c24['options'][_0xbd40('0x1b')]||null:null,'include':_0x2a1c24['options']?_0x2a1c24[_0xbd40('0x17')][_0xbd40('0x1c')]?_[_0xbd40('0x1d')](_0x2a1c24[_0xbd40('0x17')]['include'],function(_0x54da25){return{'model':db[_0x54da25[_0xbd40('0x1e')]],'as':_0x54da25['as'],'attributes':_0x54da25[_0xbd40('0x1a')],'include':_0x54da25[_0xbd40('0x1c')]?_[_0xbd40('0x1d')](_0x54da25[_0xbd40('0x1c')],function(_0x3ef74c){return{'model':db[_0x3ef74c[_0xbd40('0x1e')]],'as':_0x3ef74c['as'],'attributes':_0x3ef74c[_0xbd40('0x1a')],'include':_0x3ef74c[_0xbd40('0x1c')]?_['map'](_0x3ef74c[_0xbd40('0x1c')],function(_0x165703){return{'model':db[_0x165703[_0xbd40('0x1e')]],'as':_0x165703['as'],'attributes':_0x165703[_0xbd40('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x307c14){logger[_0xbd40('0xe')]('GetTemplate',_0x2a1c24);logger[_0xbd40('0x11')](_0xbd40('0x1f'),_0x2a1c24,JSON[_0xbd40('0x20')](_0x307c14));_0x45cbe7(_0x307c14);})[_0xbd40('0x21')](function(_0x53738a){logger[_0xbd40('0x12')](_0xbd40('0x1f'),_0x53738a[_0xbd40('0x13')],_0x2a1c24);_0x196360(_0x26769d[_0xbd40('0x12')](0x1f4,_0x53738a[_0xbd40('0x13')]));});});}; \ No newline at end of file +var _0xa811=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','Template','findAll','options','attributes','include','map','model','GetTemplate','stringify','lodash','util'];(function(_0x5c81d1,_0x3e1d94){var _0x275777=function(_0x3db1e7){while(--_0x3db1e7){_0x5c81d1['push'](_0x5c81d1['shift']());}};_0x275777(++_0x3e1d94);}(_0xa811,0x1de));var _0x1a81=function(_0x303fe3,_0x55290e){_0x303fe3=_0x303fe3-0x0;var _0x4b479f=_0xa811[_0x303fe3];return _0x4b479f;};'use strict';var _=require(_0x1a81('0x0'));var util=require(_0x1a81('0x1'));var moment=require(_0x1a81('0x2'));var BPromise=require(_0x1a81('0x3'));var rs=require(_0x1a81('0x4'));var fs=require('fs');var Redis=require(_0x1a81('0x5'));var db=require(_0x1a81('0x6'))['db'];var utils=require(_0x1a81('0x7'));var logger=require(_0x1a81('0x8'))(_0x1a81('0x9'));var config=require(_0x1a81('0xa'));var jayson=require(_0x1a81('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x125b8b,_0x53fca7,_0x16a418){return new BPromise(function(_0x25b20b,_0x4c9ab2){return client[_0x1a81('0xc')](_0x125b8b,_0x16a418)[_0x1a81('0xd')](function(_0x146e8c){logger['info'](_0x1a81('0xe'),_0x53fca7,_0x1a81('0xf'));logger[_0x1a81('0x10')]('Template,\x20%s,\x20%s,\x20%s',_0x53fca7,_0x1a81('0xf'),JSON['stringify'](_0x146e8c));if(_0x146e8c[_0x1a81('0x11')]){if(_0x146e8c[_0x1a81('0x11')][_0x1a81('0x12')]===0x1f4){logger['error'](_0x1a81('0xe'),_0x53fca7,_0x146e8c[_0x1a81('0x11')][_0x1a81('0x13')]);return _0x4c9ab2(_0x146e8c['error']['message']);}logger['error'](_0x1a81('0xe'),_0x53fca7,_0x146e8c['error'][_0x1a81('0x13')]);return _0x25b20b(_0x146e8c[_0x1a81('0x11')]['message']);}else{logger[_0x1a81('0x14')](_0x1a81('0xe'),_0x53fca7,_0x1a81('0xf'));_0x25b20b(_0x146e8c[_0x1a81('0x15')][_0x1a81('0x13')]);}})[_0x1a81('0x16')](function(_0x52b03e){logger['error']('Template,\x20%s,\x20%s',_0x53fca7,_0x52b03e);_0x4c9ab2(_0x52b03e);});});}exports['GetTemplate']=function(_0x4aa6a0){var _0x359684=this;return new Promise(function(_0x36e56f,_0x45728e){return db[_0x1a81('0x17')][_0x1a81('0x18')]({'raw':_0x4aa6a0[_0x1a81('0x19')]?_0x4aa6a0[_0x1a81('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4aa6a0[_0x1a81('0x19')]?_0x4aa6a0[_0x1a81('0x19')]['where']||null:null,'attributes':_0x4aa6a0[_0x1a81('0x19')]?_0x4aa6a0[_0x1a81('0x19')][_0x1a81('0x1a')]||null:null,'limit':_0x4aa6a0[_0x1a81('0x19')]?_0x4aa6a0[_0x1a81('0x19')]['limit']||null:null,'include':_0x4aa6a0[_0x1a81('0x19')]?_0x4aa6a0[_0x1a81('0x19')][_0x1a81('0x1b')]?_[_0x1a81('0x1c')](_0x4aa6a0[_0x1a81('0x19')][_0x1a81('0x1b')],function(_0x3d43ca){return{'model':db[_0x3d43ca[_0x1a81('0x1d')]],'as':_0x3d43ca['as'],'attributes':_0x3d43ca[_0x1a81('0x1a')],'include':_0x3d43ca[_0x1a81('0x1b')]?_[_0x1a81('0x1c')](_0x3d43ca[_0x1a81('0x1b')],function(_0x38e58d){return{'model':db[_0x38e58d[_0x1a81('0x1d')]],'as':_0x38e58d['as'],'attributes':_0x38e58d['attributes'],'include':_0x38e58d['include']?_[_0x1a81('0x1c')](_0x38e58d[_0x1a81('0x1b')],function(_0x894b46){return{'model':db[_0x894b46[_0x1a81('0x1d')]],'as':_0x894b46['as'],'attributes':_0x894b46[_0x1a81('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a0ea8){logger[_0x1a81('0x14')](_0x1a81('0x1e'),_0x4aa6a0);logger[_0x1a81('0x10')](_0x1a81('0x1e'),_0x4aa6a0,JSON[_0x1a81('0x1f')](_0x1a0ea8));_0x36e56f(_0x1a0ea8);})[_0x1a81('0x16')](function(_0x186510){logger[_0x1a81('0x11')]('GetTemplate',_0x186510[_0x1a81('0x13')],_0x4aa6a0);_0x45728e(_0x359684[_0x1a81('0x11')](0x1f4,_0x186510[_0x1a81('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 685ccf8..f8a41d4 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 _0x0b41=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','addAllCondition','post','addAnyCondition','/:id/actions','addAction','put','update','destroy','exports','multer','path'];(function(_0x4dbb87,_0x2e238f){var _0x2f6e90=function(_0x3270df){while(--_0x3270df){_0x4dbb87['push'](_0x4dbb87['shift']());}};_0x2f6e90(++_0x2e238f);}(_0x0b41,0x6a));var _0x10b4=function(_0x59c84f,_0x28ec9d){_0x59c84f=_0x59c84f-0x0;var _0x5d5131=_0x0b41[_0x59c84f];return _0x5d5131;};'use strict';var multer=require(_0x10b4('0x0'));var util=require('util');var path=require(_0x10b4('0x1'));var timeout=require(_0x10b4('0x2'));var express=require('express');var router=express[_0x10b4('0x3')]();var fs_extra=require(_0x10b4('0x4'));var auth=require(_0x10b4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x10b4('0x6'));var controller=require(_0x10b4('0x7'));router[_0x10b4('0x8')]('/',auth[_0x10b4('0x9')](),controller[_0x10b4('0xa')]);router[_0x10b4('0x8')](_0x10b4('0xb'),auth[_0x10b4('0x9')](),controller[_0x10b4('0xc')]);router[_0x10b4('0x8')](_0x10b4('0xd'),auth[_0x10b4('0x9')](),controller[_0x10b4('0xe')]);router[_0x10b4('0x8')](_0x10b4('0xf'),auth[_0x10b4('0x9')](),controller[_0x10b4('0x10')]);router[_0x10b4('0x8')]('/:id/actions',auth['isAuthenticated'](),controller[_0x10b4('0x11')]);router['post']('/',auth[_0x10b4('0x9')](),controller['create']);router['post'](_0x10b4('0xd'),auth['isAuthenticated'](),controller[_0x10b4('0x12')]);router[_0x10b4('0x13')](_0x10b4('0xf'),auth[_0x10b4('0x9')](),controller[_0x10b4('0x14')]);router[_0x10b4('0x13')](_0x10b4('0x15'),auth[_0x10b4('0x9')](),controller[_0x10b4('0x16')]);router[_0x10b4('0x17')](_0x10b4('0xb'),auth['isAuthenticated'](),controller[_0x10b4('0x18')]);router['delete'](_0x10b4('0xb'),auth[_0x10b4('0x9')](),controller[_0x10b4('0x19')]);module[_0x10b4('0x1a')]=router; \ No newline at end of file +var _0x678e=['put','update','delete','multer','util','path','connect-timeout','fs-extra','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x678e,0x153));var _0xe678=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x678e[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xe678('0x0'));var util=require(_0xe678('0x1'));var path=require(_0xe678('0x2'));var timeout=require(_0xe678('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe678('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe678('0x5'));var controller=require(_0xe678('0x6'));router[_0xe678('0x7')]('/',auth[_0xe678('0x8')](),controller[_0xe678('0x9')]);router[_0xe678('0x7')](_0xe678('0xa'),auth['isAuthenticated'](),controller[_0xe678('0xb')]);router[_0xe678('0x7')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xe678('0xc')]);router[_0xe678('0x7')](_0xe678('0xd'),auth[_0xe678('0x8')](),controller[_0xe678('0xe')]);router[_0xe678('0x7')](_0xe678('0xf'),auth[_0xe678('0x8')](),controller[_0xe678('0x10')]);router[_0xe678('0x11')]('/',auth[_0xe678('0x8')](),controller[_0xe678('0x12')]);router[_0xe678('0x11')](_0xe678('0x13'),auth[_0xe678('0x8')](),controller['addAllCondition']);router[_0xe678('0x11')]('/:id/any_conditions',auth[_0xe678('0x8')](),controller['addAnyCondition']);router[_0xe678('0x11')]('/:id/actions',auth[_0xe678('0x8')](),controller[_0xe678('0x14')]);router[_0xe678('0x15')](_0xe678('0xa'),auth['isAuthenticated'](),controller[_0xe678('0x16')]);router[_0xe678('0x17')](_0xe678('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index a058425..9b96ae4 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 _0x8f1e=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3cd563,_0x229e53){var _0x3ee04a=function(_0x39cee0){while(--_0x39cee0){_0x3cd563['push'](_0x3cd563['shift']());}};_0x3ee04a(++_0x229e53);}(_0x8f1e,0xc2));var _0xe8f1=function(_0x172459,_0x4a34eb){_0x172459=_0x172459-0x0;var _0x28a544=_0x8f1e[_0x172459];return _0x28a544;};'use strict';var Sequelize=require(_0xe8f1('0x0'));module[_0xe8f1('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe8f1('0x2')]},'description':{'type':Sequelize[_0xe8f1('0x2')]},'status':{'type':Sequelize[_0xe8f1('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5b90=['exports','STRING','sequelize'];(function(_0xf2f72b,_0x39d723){var _0xd7891c=function(_0x5a8709){while(--_0x5a8709){_0xf2f72b['push'](_0xf2f72b['shift']());}};_0xd7891c(++_0x39d723);}(_0x5b90,0x80));var _0x05b9=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0x5b90[_0x15b380];return _0x232c5c;};'use strict';var Sequelize=require(_0x05b9('0x0'));module[_0x05b9('0x1')]={'name':{'type':Sequelize[_0x05b9('0x2')]},'channel':{'type':Sequelize[_0x05b9('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 18e968b..8726b38 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 _0xa1ea=['save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Trigger','rawAttributes','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Triggers','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','pick','nolimit','getAllConditions','getAnyConditions','TriggerId','Action','getActions','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply'];(function(_0x5eea7c,_0x36a5cf){var _0x314d36=function(_0x26f69d){while(--_0x26f69d){_0x5eea7c['push'](_0x5eea7c['shift']());}};_0x314d36(++_0x36a5cf);}(_0xa1ea,0x1ac));var _0xaa1e=function(_0x230c11,_0x4031d8){_0x230c11=_0x230c11-0x0;var _0x18b059=_0xa1ea[_0x230c11];return _0x18b059;};'use strict';var emlformat=require(_0xaa1e('0x0'));var rimraf=require(_0xaa1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa1e('0x2'));var rp=require(_0xaa1e('0x3'));var moment=require(_0xaa1e('0x4'));var BPromise=require(_0xaa1e('0x5'));var Mustache=require(_0xaa1e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xaa1e('0x7'));var csv=require('to-csv');var ejs=require(_0xaa1e('0x8'));var fs=require('fs');var fs_extra=require(_0xaa1e('0x9'));var _=require(_0xaa1e('0xa'));var squel=require(_0xaa1e('0xb'));var crypto=require(_0xaa1e('0xc'));var jsforce=require(_0xaa1e('0xd'));var deskjs=require(_0xaa1e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaa1e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaa1e('0x10'));var qs=require(_0xaa1e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa1e('0x12'));var logger=require(_0xaa1e('0x13'))(_0xaa1e('0x14'));var utils=require(_0xaa1e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaa1e('0x16'));var db=require(_0xaa1e('0x17'))['db'];function respondWithStatusCode(_0x132f29,_0x1e448d){_0x1e448d=_0x1e448d||0xcc;return function(_0x3d3cd8){if(_0x3d3cd8){return _0x132f29[_0xaa1e('0x18')](_0x1e448d);}return _0x132f29[_0xaa1e('0x19')](_0x1e448d)[_0xaa1e('0x1a')]();};}function respondWithResult(_0x4f516a,_0x754665){_0x754665=_0x754665||0xc8;return function(_0x9f9bc4){if(_0x9f9bc4){return _0x4f516a['status'](_0x754665)[_0xaa1e('0x1b')](_0x9f9bc4);}};}function respondWithFilteredResult(_0x285074,_0x810161){return function(_0x3bf560){if(_0x3bf560){var _0xd752c1=typeof _0x810161[_0xaa1e('0x1c')]===_0xaa1e('0x1d')&&typeof _0x810161[_0xaa1e('0x1e')]===_0xaa1e('0x1d');var _0x4f92b8=_0x3bf560['count'];var _0x14e16d=_0xd752c1?0x0:_0x810161[_0xaa1e('0x1c')];var _0x541efa=_0xd752c1?_0x3bf560['count']:_0x810161[_0xaa1e('0x1c')]+_0x810161[_0xaa1e('0x1e')];var _0x24db79;if(_0x541efa>=_0x4f92b8){_0x541efa=_0x4f92b8;_0x24db79=0xc8;}else{_0x24db79=0xce;}_0x285074[_0xaa1e('0x19')](_0x24db79);return _0x285074['set']('Content-Range',_0x14e16d+'-'+_0x541efa+'/'+_0x4f92b8)[_0xaa1e('0x1b')](_0x3bf560);}return null;};}function patchUpdates(_0x2fca05){return function(_0x136879){try{jsonpatch[_0xaa1e('0x1f')](_0x136879,_0x2fca05,!![]);}catch(_0x11999c){return BPromise['reject'](_0x11999c);}return _0x136879[_0xaa1e('0x20')]();};}function saveUpdates(_0x4b5ca7,_0xad89f1){return function(_0x3a6c4a){if(_0x3a6c4a){return _0x3a6c4a[_0xaa1e('0x21')](_0x4b5ca7)[_0xaa1e('0x22')](function(_0x3bddca){return _0x3bddca;});}return null;};}function removeEntity(_0x123479,_0x490760){return function(_0x7ed3f7){if(_0x7ed3f7){return _0x7ed3f7[_0xaa1e('0x23')]()[_0xaa1e('0x22')](function(){var _0x40a7a3=_0x7ed3f7[_0xaa1e('0x24')]({'plain':!![]});var _0x2f66b6='Triggers';return db[_0xaa1e('0x25')][_0xaa1e('0x23')]({'where':{'type':_0x2f66b6,'resourceId':_0x40a7a3['id']}})[_0xaa1e('0x22')](function(){return _0x7ed3f7;});})[_0xaa1e('0x22')](function(){_0x123479[_0xaa1e('0x19')](0xcc)[_0xaa1e('0x1a')]();});}};}function handleEntityNotFound(_0xc8f648,_0x30fbd5){return function(_0x18ce2c){if(!_0x18ce2c){_0xc8f648[_0xaa1e('0x18')](0x194);}return _0x18ce2c;};}function handleError(_0x6395bc,_0x1b8513){_0x1b8513=_0x1b8513||0x1f4;return function(_0x2c8234){logger[_0xaa1e('0x26')](_0x2c8234[_0xaa1e('0x27')]);if(_0x2c8234[_0xaa1e('0x28')]){delete _0x2c8234[_0xaa1e('0x28')];}_0x6395bc[_0xaa1e('0x19')](_0x1b8513)[_0xaa1e('0x29')](_0x2c8234);};}exports[_0xaa1e('0x2a')]=function(_0x359822,_0x18668b){var _0x5ee8f8={},_0x49078f={},_0x1a336f={'count':0x0,'rows':[]};var _0x1b1ff5=_['map'](db[_0xaa1e('0x2b')][_0xaa1e('0x2c')],function(_0x2ed6f1){return{'name':_0x2ed6f1['fieldName'],'type':_0x2ed6f1[_0xaa1e('0x2d')][_0xaa1e('0x2e')]};});_0x49078f['model']=_[_0xaa1e('0x2f')](_0x1b1ff5,'name');_0x49078f[_0xaa1e('0x30')]=_[_0xaa1e('0x31')](_0x359822[_0xaa1e('0x30')]);_0x49078f[_0xaa1e('0x32')]=_['intersection'](_0x49078f[_0xaa1e('0x33')],_0x49078f['query']);_0x5ee8f8[_0xaa1e('0x34')]=_[_0xaa1e('0x35')](_0x49078f['model'],qs['fields'](_0x359822[_0xaa1e('0x30')][_0xaa1e('0x36')]));_0x5ee8f8['attributes']=_0x5ee8f8[_0xaa1e('0x34')][_0xaa1e('0x37')]?_0x5ee8f8['attributes']:_0x49078f[_0xaa1e('0x33')];if(!_0x359822[_0xaa1e('0x30')][_0xaa1e('0x38')]('nolimit')){_0x5ee8f8[_0xaa1e('0x1e')]=qs[_0xaa1e('0x1e')](_0x359822['query'][_0xaa1e('0x1e')]);_0x5ee8f8[_0xaa1e('0x1c')]=qs[_0xaa1e('0x1c')](_0x359822[_0xaa1e('0x30')][_0xaa1e('0x1c')]);}_0x5ee8f8[_0xaa1e('0x39')]=qs[_0xaa1e('0x3a')](_0x359822[_0xaa1e('0x30')][_0xaa1e('0x3a')]);_0x5ee8f8[_0xaa1e('0x3b')]=qs[_0xaa1e('0x32')](_['pick'](_0x359822['query'],_0x49078f['filters']),_0x1b1ff5);if(_0x359822[_0xaa1e('0x30')][_0xaa1e('0x3c')]){_0x5ee8f8['where']=_[_0xaa1e('0x3d')](_0x5ee8f8[_0xaa1e('0x3b')],{'$or':_[_0xaa1e('0x2f')](_0x1b1ff5,function(_0x1251be){if(_0x1251be[_0xaa1e('0x2d')]!=='VIRTUAL'){var _0x40b7fe={};_0x40b7fe[_0x1251be[_0xaa1e('0x28')]]={'$like':'%'+_0x359822[_0xaa1e('0x30')][_0xaa1e('0x3c')]+'%'};return _0x40b7fe;}})});}_0x5ee8f8=_[_0xaa1e('0x3d')]({},_0x5ee8f8,_0x359822[_0xaa1e('0x3e')]);var _0x1417f6={'where':_0x5ee8f8['where']};return db[_0xaa1e('0x2b')][_0xaa1e('0x3f')](_0x1417f6)['then'](function(_0x4ce014){_0x1a336f['count']=_0x4ce014;if(_0x359822[_0xaa1e('0x30')][_0xaa1e('0x40')]){_0x5ee8f8[_0xaa1e('0x41')]=[{'all':!![]}];}return db[_0xaa1e('0x2b')][_0xaa1e('0x42')](_0x5ee8f8);})[_0xaa1e('0x22')](function(_0x454925){_0x1a336f[_0xaa1e('0x43')]=_0x454925;return _0x1a336f;})['then'](respondWithFilteredResult(_0x18668b,_0x5ee8f8))[_0xaa1e('0x44')](handleError(_0x18668b,null));};exports[_0xaa1e('0x45')]=function(_0x581887,_0x1c03f5){var _0x389778={'raw':![],'where':{'id':_0x581887[_0xaa1e('0x46')]['id']}},_0x20dae8={};_0x20dae8[_0xaa1e('0x33')]=_[_0xaa1e('0x31')](db[_0xaa1e('0x2b')][_0xaa1e('0x2c')]);_0x20dae8[_0xaa1e('0x30')]=_['keys'](_0x581887[_0xaa1e('0x30')]);_0x20dae8['filters']=_['intersection'](_0x20dae8[_0xaa1e('0x33')],_0x20dae8[_0xaa1e('0x30')]);_0x389778[_0xaa1e('0x34')]=_[_0xaa1e('0x35')](_0x20dae8[_0xaa1e('0x33')],qs[_0xaa1e('0x36')](_0x581887[_0xaa1e('0x30')][_0xaa1e('0x36')]));_0x389778['attributes']=_0x389778[_0xaa1e('0x34')]['length']?_0x389778[_0xaa1e('0x34')]:_0x20dae8[_0xaa1e('0x33')];if(_0x581887['query']['includeAll']){_0x389778[_0xaa1e('0x41')]=[{'all':!![]}];}_0x389778=_[_0xaa1e('0x3d')]({},_0x389778,_0x581887[_0xaa1e('0x3e')]);return db[_0xaa1e('0x2b')][_0xaa1e('0x47')](_0x389778)[_0xaa1e('0x22')](handleEntityNotFound(_0x1c03f5,null))[_0xaa1e('0x22')](respondWithResult(_0x1c03f5,null))[_0xaa1e('0x44')](handleError(_0x1c03f5,null));};exports[_0xaa1e('0x48')]=function(_0x5d598c,_0x48cc38){return db[_0xaa1e('0x2b')][_0xaa1e('0x48')](_0x5d598c[_0xaa1e('0x49')],{})['then'](function(_0x4af8dd){var _0x3b0aa0=_0x5d598c[_0xaa1e('0x4a')]['get']({'plain':!![]});if(!_0x3b0aa0)throw new Error(_0xaa1e('0x4b'));if(_0x3b0aa0['role']==='user'){var _0x4c9f02=_0x4af8dd[_0xaa1e('0x24')]({'plain':!![]});var _0x14e957=_0xaa1e('0x4c');return db[_0xaa1e('0x4d')][_0xaa1e('0x47')]({'where':{'name':_0x14e957,'userProfileId':_0x3b0aa0[_0xaa1e('0x4e')]},'raw':!![]})[_0xaa1e('0x22')](function(_0x57e11d){if(_0x57e11d&&_0x57e11d[_0xaa1e('0x4f')]===0x0){return db[_0xaa1e('0x25')][_0xaa1e('0x48')]({'name':_0x4c9f02[_0xaa1e('0x28')],'resourceId':_0x4c9f02['id'],'type':_0x57e11d[_0xaa1e('0x28')],'sectionId':_0x57e11d['id']},{})[_0xaa1e('0x22')](function(){return _0x4af8dd;});}else{return _0x4af8dd;}})[_0xaa1e('0x44')](function(_0x16a900){logger[_0xaa1e('0x26')](_0xaa1e('0x50'),_0x16a900);throw _0x16a900;});}return _0x4af8dd;})['then'](respondWithResult(_0x48cc38,0xc9))[_0xaa1e('0x44')](handleError(_0x48cc38,null));};exports['update']=function(_0x4a7d8f,_0x13bc7c){if(_0x4a7d8f['body']['id']){delete _0x4a7d8f[_0xaa1e('0x49')]['id'];}return db[_0xaa1e('0x2b')][_0xaa1e('0x47')]({'where':{'id':_0x4a7d8f[_0xaa1e('0x46')]['id']}})[_0xaa1e('0x22')](handleEntityNotFound(_0x13bc7c,null))[_0xaa1e('0x22')](saveUpdates(_0x4a7d8f[_0xaa1e('0x49')],null))[_0xaa1e('0x22')](respondWithResult(_0x13bc7c,null))[_0xaa1e('0x44')](handleError(_0x13bc7c,null));};exports[_0xaa1e('0x23')]=function(_0x28448d,_0x15b883){return db['Trigger']['find']({'where':{'id':_0x28448d[_0xaa1e('0x46')]['id']}})[_0xaa1e('0x22')](handleEntityNotFound(_0x15b883,null))[_0xaa1e('0x22')](removeEntity(_0x15b883,null))[_0xaa1e('0x44')](handleError(_0x15b883,null));};exports[_0xaa1e('0x51')]=function(_0x65202d,_0x2faa9b,_0x3cbcce){if(_0x65202d[_0xaa1e('0x49')]['id']){delete _0x65202d['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x65202d['params']['id']}})[_0xaa1e('0x22')](handleEntityNotFound(_0x2faa9b,null))['then'](function(_0x22add5){if(_0x22add5){_0x65202d[_0xaa1e('0x49')][_0xaa1e('0x52')]=_0x22add5['id'];return db[_0xaa1e('0x53')][_0xaa1e('0x48')](_0x65202d['body']);}})[_0xaa1e('0x22')](respondWithResult(_0x2faa9b,null))[_0xaa1e('0x44')](handleError(_0x2faa9b,null));};exports['addAnyCondition']=function(_0x545e25,_0x514f31,_0x4ddf44){if(_0x545e25[_0xaa1e('0x49')]['id']){delete _0x545e25[_0xaa1e('0x49')]['id'];}return db[_0xaa1e('0x2b')]['find']({'where':{'id':_0x545e25[_0xaa1e('0x46')]['id']}})['then'](handleEntityNotFound(_0x514f31,null))[_0xaa1e('0x22')](function(_0x522bfb){if(_0x522bfb){_0x545e25['body']['TriggerAnyId']=_0x522bfb['id'];return db[_0xaa1e('0x53')]['create'](_0x545e25['body']);}})['then'](respondWithResult(_0x514f31,null))['catch'](handleError(_0x514f31,null));};exports['getAllConditions']=function(_0x3b1ed9,_0x279179,_0x7a8c78){var _0x408f5c={};var _0x1dfab9={};var _0x188050;var _0x53f0dd;return db['Trigger']['findOne']({'where':{'id':_0x3b1ed9['params']['id']}})[_0xaa1e('0x22')](handleEntityNotFound(_0x279179,null))['then'](function(_0x2be0b5){if(_0x2be0b5){_0x188050=_0x2be0b5;_0x1dfab9[_0xaa1e('0x33')]=_['keys'](db[_0xaa1e('0x53')][_0xaa1e('0x2c')]);_0x1dfab9['query']=_[_0xaa1e('0x31')](_0x3b1ed9[_0xaa1e('0x30')]);_0x1dfab9[_0xaa1e('0x32')]=_[_0xaa1e('0x35')](_0x1dfab9[_0xaa1e('0x33')],_0x1dfab9['query']);_0x408f5c['attributes']=_['intersection'](_0x1dfab9['model'],qs[_0xaa1e('0x36')](_0x3b1ed9[_0xaa1e('0x30')]['fields']));_0x408f5c[_0xaa1e('0x34')]=_0x408f5c[_0xaa1e('0x34')][_0xaa1e('0x37')]?_0x408f5c['attributes']:_0x1dfab9['model'];_0x408f5c['order']=qs['sort'](_0x3b1ed9[_0xaa1e('0x30')][_0xaa1e('0x3a')]);_0x408f5c[_0xaa1e('0x3b')]=qs[_0xaa1e('0x32')](_[_0xaa1e('0x54')](_0x3b1ed9[_0xaa1e('0x30')],_0x1dfab9[_0xaa1e('0x32')]));if(_0x3b1ed9[_0xaa1e('0x30')][_0xaa1e('0x3c')]){_0x408f5c[_0xaa1e('0x3b')]=_[_0xaa1e('0x3d')](_0x408f5c['where'],{'$or':_[_0xaa1e('0x2f')](_0x408f5c[_0xaa1e('0x34')],function(_0x4b16b6){var _0x54c2ca={};_0x54c2ca[_0x4b16b6]={'$like':'%'+_0x3b1ed9[_0xaa1e('0x30')][_0xaa1e('0x3c')]+'%'};return _0x54c2ca;})});}_0x408f5c=_[_0xaa1e('0x3d')]({},_0x408f5c,_0x3b1ed9[_0xaa1e('0x3e')]);return _0x188050['getAllConditions'](_0x408f5c);}})[_0xaa1e('0x22')](function(_0x48eea3){if(_0x48eea3){_0x53f0dd=_0x48eea3['length'];if(!_0x3b1ed9[_0xaa1e('0x30')]['hasOwnProperty'](_0xaa1e('0x55'))){_0x408f5c['limit']=qs['limit'](_0x3b1ed9[_0xaa1e('0x30')][_0xaa1e('0x1e')]);_0x408f5c[_0xaa1e('0x1c')]=qs[_0xaa1e('0x1c')](_0x3b1ed9[_0xaa1e('0x30')][_0xaa1e('0x1c')]);}return _0x188050[_0xaa1e('0x56')](_0x408f5c);}})[_0xaa1e('0x22')](function(_0x460ca4){if(_0x460ca4){return _0x460ca4?{'count':_0x53f0dd,'rows':_0x460ca4}:null;}})[_0xaa1e('0x22')](respondWithResult(_0x279179,null))[_0xaa1e('0x44')](handleError(_0x279179,null));};exports['getAnyConditions']=function(_0x18a4e4,_0x45fce6,_0x2fa2ce){var _0x5f1998={};var _0x34a74={};var _0x4b179b;var _0x55b26d;return db[_0xaa1e('0x2b')]['findOne']({'where':{'id':_0x18a4e4[_0xaa1e('0x46')]['id']}})['then'](handleEntityNotFound(_0x45fce6,null))['then'](function(_0x41a53a){if(_0x41a53a){_0x4b179b=_0x41a53a;_0x34a74[_0xaa1e('0x33')]=_[_0xaa1e('0x31')](db['Condition'][_0xaa1e('0x2c')]);_0x34a74[_0xaa1e('0x30')]=_['keys'](_0x18a4e4[_0xaa1e('0x30')]);_0x34a74[_0xaa1e('0x32')]=_[_0xaa1e('0x35')](_0x34a74[_0xaa1e('0x33')],_0x34a74[_0xaa1e('0x30')]);_0x5f1998['attributes']=_[_0xaa1e('0x35')](_0x34a74[_0xaa1e('0x33')],qs['fields'](_0x18a4e4[_0xaa1e('0x30')][_0xaa1e('0x36')]));_0x5f1998[_0xaa1e('0x34')]=_0x5f1998[_0xaa1e('0x34')][_0xaa1e('0x37')]?_0x5f1998[_0xaa1e('0x34')]:_0x34a74[_0xaa1e('0x33')];_0x5f1998[_0xaa1e('0x39')]=qs['sort'](_0x18a4e4[_0xaa1e('0x30')][_0xaa1e('0x3a')]);_0x5f1998['where']=qs[_0xaa1e('0x32')](_[_0xaa1e('0x54')](_0x18a4e4['query'],_0x34a74[_0xaa1e('0x32')]));if(_0x18a4e4[_0xaa1e('0x30')]['filter']){_0x5f1998['where']=_[_0xaa1e('0x3d')](_0x5f1998['where'],{'$or':_[_0xaa1e('0x2f')](_0x5f1998['attributes'],function(_0x117f28){var _0x2758df={};_0x2758df[_0x117f28]={'$like':'%'+_0x18a4e4['query'][_0xaa1e('0x3c')]+'%'};return _0x2758df;})});}_0x5f1998=_['merge']({},_0x5f1998,_0x18a4e4[_0xaa1e('0x3e')]);return _0x4b179b[_0xaa1e('0x57')](_0x5f1998);}})[_0xaa1e('0x22')](function(_0x1be2b4){if(_0x1be2b4){_0x55b26d=_0x1be2b4[_0xaa1e('0x37')];if(!_0x18a4e4[_0xaa1e('0x30')]['hasOwnProperty'](_0xaa1e('0x55'))){_0x5f1998[_0xaa1e('0x1e')]=qs[_0xaa1e('0x1e')](_0x18a4e4[_0xaa1e('0x30')][_0xaa1e('0x1e')]);_0x5f1998[_0xaa1e('0x1c')]=qs[_0xaa1e('0x1c')](_0x18a4e4['query'][_0xaa1e('0x1c')]);}return _0x4b179b[_0xaa1e('0x57')](_0x5f1998);}})[_0xaa1e('0x22')](function(_0x4f0376){if(_0x4f0376){return _0x4f0376?{'count':_0x55b26d,'rows':_0x4f0376}:null;}})[_0xaa1e('0x22')](respondWithResult(_0x45fce6,null))[_0xaa1e('0x44')](handleError(_0x45fce6,null));};exports['addAction']=function(_0x5ea138,_0x532cbe,_0x292e68){if(_0x5ea138[_0xaa1e('0x49')]['id']){delete _0x5ea138[_0xaa1e('0x49')]['id'];}return db[_0xaa1e('0x2b')][_0xaa1e('0x47')]({'where':{'id':_0x5ea138[_0xaa1e('0x46')]['id']}})['then'](handleEntityNotFound(_0x532cbe,null))['then'](function(_0x57837f){if(_0x57837f){_0x5ea138[_0xaa1e('0x49')][_0xaa1e('0x58')]=_0x57837f['id'];return db[_0xaa1e('0x59')][_0xaa1e('0x48')](_0x5ea138[_0xaa1e('0x49')]);}})[_0xaa1e('0x22')](respondWithResult(_0x532cbe,null))['catch'](handleError(_0x532cbe,null));};exports[_0xaa1e('0x5a')]=function(_0x2fe128,_0x1dda37,_0x26fb9b){var _0x5c854c={};var _0x52733a={};var _0x1d02ac;var _0x4fa9ed;return db[_0xaa1e('0x2b')][_0xaa1e('0x5b')]({'where':{'id':_0x2fe128[_0xaa1e('0x46')]['id']}})[_0xaa1e('0x22')](handleEntityNotFound(_0x1dda37,null))[_0xaa1e('0x22')](function(_0x3b7216){if(_0x3b7216){_0x1d02ac=_0x3b7216;_0x52733a['model']=_[_0xaa1e('0x31')](db['Action'][_0xaa1e('0x2c')]);_0x52733a[_0xaa1e('0x30')]=_[_0xaa1e('0x31')](_0x2fe128[_0xaa1e('0x30')]);_0x52733a[_0xaa1e('0x32')]=_[_0xaa1e('0x35')](_0x52733a['model'],_0x52733a[_0xaa1e('0x30')]);_0x5c854c['attributes']=_[_0xaa1e('0x35')](_0x52733a['model'],qs['fields'](_0x2fe128[_0xaa1e('0x30')][_0xaa1e('0x36')]));_0x5c854c[_0xaa1e('0x34')]=_0x5c854c[_0xaa1e('0x34')][_0xaa1e('0x37')]?_0x5c854c[_0xaa1e('0x34')]:_0x52733a[_0xaa1e('0x33')];_0x5c854c[_0xaa1e('0x39')]=qs['sort'](_0x2fe128[_0xaa1e('0x30')]['sort']);_0x5c854c[_0xaa1e('0x3b')]=qs['filters'](_['pick'](_0x2fe128['query'],_0x52733a[_0xaa1e('0x32')]));if(_0x2fe128[_0xaa1e('0x30')][_0xaa1e('0x3c')]){_0x5c854c['where']=_[_0xaa1e('0x3d')](_0x5c854c[_0xaa1e('0x3b')],{'$or':_[_0xaa1e('0x2f')](_0x5c854c[_0xaa1e('0x34')],function(_0x106075){var _0x16d027={};_0x16d027[_0x106075]={'$like':'%'+_0x2fe128[_0xaa1e('0x30')][_0xaa1e('0x3c')]+'%'};return _0x16d027;})});}_0x5c854c=_[_0xaa1e('0x3d')]({},_0x5c854c,_0x2fe128[_0xaa1e('0x3e')]);return _0x1d02ac[_0xaa1e('0x5a')](_0x5c854c);}})[_0xaa1e('0x22')](function(_0x1f1382){if(_0x1f1382){_0x4fa9ed=_0x1f1382[_0xaa1e('0x37')];if(!_0x2fe128[_0xaa1e('0x30')][_0xaa1e('0x38')](_0xaa1e('0x55'))){_0x5c854c[_0xaa1e('0x1e')]=qs[_0xaa1e('0x1e')](_0x2fe128[_0xaa1e('0x30')][_0xaa1e('0x1e')]);_0x5c854c['offset']=qs[_0xaa1e('0x1c')](_0x2fe128[_0xaa1e('0x30')][_0xaa1e('0x1c')]);}return _0x1d02ac[_0xaa1e('0x5a')](_0x5c854c);}})[_0xaa1e('0x22')](function(_0x1853ec){if(_0x1853ec){return _0x1853ec?{'count':_0x4fa9ed,'rows':_0x1853ec}:null;}})[_0xaa1e('0x22')](respondWithResult(_0x1dda37,null))['catch'](handleError(_0x1dda37,null));}; \ No newline at end of file +var _0x2e6f=['Trigger','rawAttributes','type','key','filters','intersection','model','attributes','query','fields','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','rows','params','keys','length','catch','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','nolimit','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','request-promise','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','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map'];(function(_0x36bbbb,_0x3f6709){var _0x3ca0eb=function(_0x299763){while(--_0x299763){_0x36bbbb['push'](_0x36bbbb['shift']());}};_0x3ca0eb(++_0x3f6709);}(_0x2e6f,0xf5));var _0xf2e6=function(_0x15e3d0,_0x491297){_0x15e3d0=_0x15e3d0-0x0;var _0x4124e4=_0x2e6f[_0x15e3d0];return _0x4124e4;};'use strict';var emlformat=require(_0xf2e6('0x0'));var rimraf=require(_0xf2e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf2e6('0x2'));var moment=require(_0xf2e6('0x3'));var BPromise=require(_0xf2e6('0x4'));var Mustache=require(_0xf2e6('0x5'));var util=require(_0xf2e6('0x6'));var path=require(_0xf2e6('0x7'));var sox=require(_0xf2e6('0x8'));var csv=require(_0xf2e6('0x9'));var ejs=require(_0xf2e6('0xa'));var fs=require('fs');var fs_extra=require(_0xf2e6('0xb'));var _=require('lodash');var squel=require(_0xf2e6('0xc'));var crypto=require(_0xf2e6('0xd'));var jsforce=require(_0xf2e6('0xe'));var deskjs=require(_0xf2e6('0xf'));var toCsv=require(_0xf2e6('0x9'));var querystring=require(_0xf2e6('0x10'));var Papa=require(_0xf2e6('0x11'));var Redis=require(_0xf2e6('0x12'));var authService=require(_0xf2e6('0x13'));var qs=require(_0xf2e6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2e6('0x15'));var logger=require(_0xf2e6('0x16'))(_0xf2e6('0x17'));var utils=require(_0xf2e6('0x18'));var config=require(_0xf2e6('0x19'));var licenseUtil=require(_0xf2e6('0x1a'));var db=require(_0xf2e6('0x1b'))['db'];function respondWithStatusCode(_0x52dfa6,_0x38e43f){_0x38e43f=_0x38e43f||0xcc;return function(_0xdfa91b){if(_0xdfa91b){return _0x52dfa6[_0xf2e6('0x1c')](_0x38e43f);}return _0x52dfa6['status'](_0x38e43f)[_0xf2e6('0x1d')]();};}function respondWithResult(_0x13fef6,_0x3b315a){_0x3b315a=_0x3b315a||0xc8;return function(_0x5031d4){if(_0x5031d4){return _0x13fef6[_0xf2e6('0x1e')](_0x3b315a)[_0xf2e6('0x1f')](_0x5031d4);}};}function respondWithFilteredResult(_0x559d8b,_0x5b0e98){return function(_0x325169){if(_0x325169){var _0x21d87b=typeof _0x5b0e98[_0xf2e6('0x20')]===_0xf2e6('0x21')&&typeof _0x5b0e98[_0xf2e6('0x22')]===_0xf2e6('0x21');var _0x33a97b=_0x325169[_0xf2e6('0x23')];var _0x246a90=_0x21d87b?0x0:_0x5b0e98['offset'];var _0x5b5621=_0x21d87b?_0x325169['count']:_0x5b0e98[_0xf2e6('0x20')]+_0x5b0e98[_0xf2e6('0x22')];var _0x5708bb;if(_0x5b5621>=_0x33a97b){_0x5b5621=_0x33a97b;_0x5708bb=0xc8;}else{_0x5708bb=0xce;}_0x559d8b[_0xf2e6('0x1e')](_0x5708bb);return _0x559d8b[_0xf2e6('0x24')]('Content-Range',_0x246a90+'-'+_0x5b5621+'/'+_0x33a97b)['json'](_0x325169);}return null;};}function patchUpdates(_0x4e9fb4){return function(_0x4e63d8){try{jsonpatch[_0xf2e6('0x25')](_0x4e63d8,_0x4e9fb4,!![]);}catch(_0x3a6689){return BPromise[_0xf2e6('0x26')](_0x3a6689);}return _0x4e63d8[_0xf2e6('0x27')]();};}function saveUpdates(_0x502f01,_0x3c1a14){return function(_0x23a9b2){if(_0x23a9b2){return _0x23a9b2[_0xf2e6('0x28')](_0x502f01)[_0xf2e6('0x29')](function(_0x472e46){return _0x472e46;});}return null;};}function removeEntity(_0x1aa85d,_0x4a103a){return function(_0x2cabb5){if(_0x2cabb5){return _0x2cabb5[_0xf2e6('0x2a')]()['then'](function(){var _0x467ddf=_0x2cabb5[_0xf2e6('0x2b')]({'plain':!![]});var _0x5028c7=_0xf2e6('0x2c');return db[_0xf2e6('0x2d')][_0xf2e6('0x2a')]({'where':{'type':_0x5028c7,'resourceId':_0x467ddf['id']}})['then'](function(){return _0x2cabb5;});})[_0xf2e6('0x29')](function(){_0x1aa85d[_0xf2e6('0x1e')](0xcc)[_0xf2e6('0x1d')]();});}};}function handleEntityNotFound(_0x49458f,_0x4b525b){return function(_0x52b215){if(!_0x52b215){_0x49458f[_0xf2e6('0x1c')](0x194);}return _0x52b215;};}function handleError(_0x5cf44a,_0x2d838d){_0x2d838d=_0x2d838d||0x1f4;return function(_0x557be7){logger[_0xf2e6('0x2e')](_0x557be7[_0xf2e6('0x2f')]);if(_0x557be7[_0xf2e6('0x30')]){delete _0x557be7['name'];}_0x5cf44a[_0xf2e6('0x1e')](_0x2d838d)[_0xf2e6('0x31')](_0x557be7);};}exports[_0xf2e6('0x32')]=function(_0x5b8684,_0x51b8f6){var _0x567160={},_0x3e67c6={},_0x11b70f={'count':0x0,'rows':[]};var _0x4f69c6=_[_0xf2e6('0x33')](db[_0xf2e6('0x34')][_0xf2e6('0x35')],function(_0xff1e7f){return{'name':_0xff1e7f['fieldName'],'type':_0xff1e7f[_0xf2e6('0x36')][_0xf2e6('0x37')]};});_0x3e67c6['model']=_['map'](_0x4f69c6,'name');_0x3e67c6['query']=_['keys'](_0x5b8684['query']);_0x3e67c6[_0xf2e6('0x38')]=_[_0xf2e6('0x39')](_0x3e67c6[_0xf2e6('0x3a')],_0x3e67c6['query']);_0x567160[_0xf2e6('0x3b')]=_[_0xf2e6('0x39')](_0x3e67c6[_0xf2e6('0x3a')],qs['fields'](_0x5b8684[_0xf2e6('0x3c')][_0xf2e6('0x3d')]));_0x567160['attributes']=_0x567160[_0xf2e6('0x3b')]['length']?_0x567160['attributes']:_0x3e67c6[_0xf2e6('0x3a')];if(!_0x5b8684[_0xf2e6('0x3c')][_0xf2e6('0x3e')]('nolimit')){_0x567160[_0xf2e6('0x22')]=qs[_0xf2e6('0x22')](_0x5b8684[_0xf2e6('0x3c')][_0xf2e6('0x22')]);_0x567160[_0xf2e6('0x20')]=qs[_0xf2e6('0x20')](_0x5b8684[_0xf2e6('0x3c')][_0xf2e6('0x20')]);}_0x567160[_0xf2e6('0x3f')]=qs[_0xf2e6('0x40')](_0x5b8684[_0xf2e6('0x3c')][_0xf2e6('0x40')]);_0x567160['where']=qs[_0xf2e6('0x38')](_[_0xf2e6('0x41')](_0x5b8684['query'],_0x3e67c6[_0xf2e6('0x38')]),_0x4f69c6);if(_0x5b8684[_0xf2e6('0x3c')]['filter']){_0x567160['where']=_[_0xf2e6('0x42')](_0x567160[_0xf2e6('0x43')],{'$or':_[_0xf2e6('0x33')](_0x4f69c6,function(_0x4ad552){if(_0x4ad552[_0xf2e6('0x36')]!==_0xf2e6('0x44')){var _0x3e7c6f={};_0x3e7c6f[_0x4ad552['name']]={'$like':'%'+_0x5b8684['query'][_0xf2e6('0x45')]+'%'};return _0x3e7c6f;}})});}_0x567160=_['merge']({},_0x567160,_0x5b8684[_0xf2e6('0x46')]);var _0x37b54e={'where':_0x567160[_0xf2e6('0x43')]};return db[_0xf2e6('0x34')][_0xf2e6('0x23')](_0x37b54e)[_0xf2e6('0x29')](function(_0x550630){_0x11b70f[_0xf2e6('0x23')]=_0x550630;if(_0x5b8684['query'][_0xf2e6('0x47')]){_0x567160[_0xf2e6('0x48')]=[{'all':!![]}];}return db[_0xf2e6('0x34')]['findAll'](_0x567160);})['then'](function(_0x13ea71){_0x11b70f[_0xf2e6('0x49')]=_0x13ea71;return _0x11b70f;})['then'](respondWithFilteredResult(_0x51b8f6,_0x567160))['catch'](handleError(_0x51b8f6,null));};exports['show']=function(_0x3b165e,_0x4a50c0){var _0x4cfd47={'raw':![],'where':{'id':_0x3b165e[_0xf2e6('0x4a')]['id']}},_0xcf269e={};_0xcf269e['model']=_[_0xf2e6('0x4b')](db[_0xf2e6('0x34')][_0xf2e6('0x35')]);_0xcf269e[_0xf2e6('0x3c')]=_[_0xf2e6('0x4b')](_0x3b165e[_0xf2e6('0x3c')]);_0xcf269e[_0xf2e6('0x38')]=_[_0xf2e6('0x39')](_0xcf269e[_0xf2e6('0x3a')],_0xcf269e[_0xf2e6('0x3c')]);_0x4cfd47[_0xf2e6('0x3b')]=_[_0xf2e6('0x39')](_0xcf269e[_0xf2e6('0x3a')],qs[_0xf2e6('0x3d')](_0x3b165e[_0xf2e6('0x3c')][_0xf2e6('0x3d')]));_0x4cfd47[_0xf2e6('0x3b')]=_0x4cfd47[_0xf2e6('0x3b')][_0xf2e6('0x4c')]?_0x4cfd47[_0xf2e6('0x3b')]:_0xcf269e[_0xf2e6('0x3a')];if(_0x3b165e[_0xf2e6('0x3c')][_0xf2e6('0x47')]){_0x4cfd47[_0xf2e6('0x48')]=[{'all':!![]}];}_0x4cfd47=_[_0xf2e6('0x42')]({},_0x4cfd47,_0x3b165e[_0xf2e6('0x46')]);return db[_0xf2e6('0x34')]['find'](_0x4cfd47)['then'](handleEntityNotFound(_0x4a50c0,null))[_0xf2e6('0x29')](respondWithResult(_0x4a50c0,null))[_0xf2e6('0x4d')](handleError(_0x4a50c0,null));};exports[_0xf2e6('0x4e')]=function(_0x2b9ac0,_0x112c37){return db['Trigger'][_0xf2e6('0x4e')](_0x2b9ac0[_0xf2e6('0x4f')],{})[_0xf2e6('0x29')](function(_0x5814e3){var _0x3c8c86=_0x2b9ac0['user'][_0xf2e6('0x2b')]({'plain':!![]});if(!_0x3c8c86)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c8c86[_0xf2e6('0x50')]===_0xf2e6('0x51')){var _0x274bb5=_0x5814e3[_0xf2e6('0x2b')]({'plain':!![]});var _0x21f981=_0xf2e6('0x2c');return db[_0xf2e6('0x52')][_0xf2e6('0x53')]({'where':{'name':_0x21f981,'userProfileId':_0x3c8c86[_0xf2e6('0x54')]},'raw':!![]})['then'](function(_0xe10f86){if(_0xe10f86&&_0xe10f86[_0xf2e6('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x274bb5[_0xf2e6('0x30')],'resourceId':_0x274bb5['id'],'type':_0xe10f86[_0xf2e6('0x30')],'sectionId':_0xe10f86['id']},{})[_0xf2e6('0x29')](function(){return _0x5814e3;});}else{return _0x5814e3;}})[_0xf2e6('0x4d')](function(_0x1edcf5){logger[_0xf2e6('0x2e')](_0xf2e6('0x56'),_0x1edcf5);throw _0x1edcf5;});}return _0x5814e3;})['then'](respondWithResult(_0x112c37,0xc9))[_0xf2e6('0x4d')](handleError(_0x112c37,null));};exports['update']=function(_0x182eb7,_0x239bed){if(_0x182eb7[_0xf2e6('0x4f')]['id']){delete _0x182eb7[_0xf2e6('0x4f')]['id'];}return db[_0xf2e6('0x34')]['find']({'where':{'id':_0x182eb7[_0xf2e6('0x4a')]['id']}})[_0xf2e6('0x29')](handleEntityNotFound(_0x239bed,null))[_0xf2e6('0x29')](saveUpdates(_0x182eb7[_0xf2e6('0x4f')],null))[_0xf2e6('0x29')](respondWithResult(_0x239bed,null))['catch'](handleError(_0x239bed,null));};exports[_0xf2e6('0x2a')]=function(_0x230ad6,_0x709af2){return db[_0xf2e6('0x34')][_0xf2e6('0x53')]({'where':{'id':_0x230ad6['params']['id']}})['then'](handleEntityNotFound(_0x709af2,null))[_0xf2e6('0x29')](removeEntity(_0x709af2,null))[_0xf2e6('0x4d')](handleError(_0x709af2,null));};exports['addAllCondition']=function(_0xd0f688,_0x39db6e,_0x146a85){if(_0xd0f688[_0xf2e6('0x4f')]['id']){delete _0xd0f688['body']['id'];}return db[_0xf2e6('0x34')]['find']({'where':{'id':_0xd0f688[_0xf2e6('0x4a')]['id']}})[_0xf2e6('0x29')](handleEntityNotFound(_0x39db6e,null))['then'](function(_0x2b92ec){if(_0x2b92ec){_0xd0f688[_0xf2e6('0x4f')][_0xf2e6('0x57')]=_0x2b92ec['id'];return db[_0xf2e6('0x58')][_0xf2e6('0x4e')](_0xd0f688[_0xf2e6('0x4f')]);}})['then'](respondWithResult(_0x39db6e,null))[_0xf2e6('0x4d')](handleError(_0x39db6e,null));};exports[_0xf2e6('0x59')]=function(_0x3fa1ab,_0x14a93c,_0xf29dec){if(_0x3fa1ab[_0xf2e6('0x4f')]['id']){delete _0x3fa1ab[_0xf2e6('0x4f')]['id'];}return db[_0xf2e6('0x34')][_0xf2e6('0x53')]({'where':{'id':_0x3fa1ab['params']['id']}})[_0xf2e6('0x29')](handleEntityNotFound(_0x14a93c,null))[_0xf2e6('0x29')](function(_0x397cdf){if(_0x397cdf){_0x3fa1ab[_0xf2e6('0x4f')][_0xf2e6('0x5a')]=_0x397cdf['id'];return db[_0xf2e6('0x58')][_0xf2e6('0x4e')](_0x3fa1ab[_0xf2e6('0x4f')]);}})[_0xf2e6('0x29')](respondWithResult(_0x14a93c,null))['catch'](handleError(_0x14a93c,null));};exports['getAllConditions']=function(_0x380b1b,_0x959fe2,_0x448120){var _0x441de3={};var _0x346729={};var _0x255507;var _0x4520ce;return db[_0xf2e6('0x34')]['findOne']({'where':{'id':_0x380b1b[_0xf2e6('0x4a')]['id']}})[_0xf2e6('0x29')](handleEntityNotFound(_0x959fe2,null))['then'](function(_0x3371f8){if(_0x3371f8){_0x255507=_0x3371f8;_0x346729['model']=_[_0xf2e6('0x4b')](db[_0xf2e6('0x58')][_0xf2e6('0x35')]);_0x346729['query']=_[_0xf2e6('0x4b')](_0x380b1b[_0xf2e6('0x3c')]);_0x346729['filters']=_['intersection'](_0x346729[_0xf2e6('0x3a')],_0x346729[_0xf2e6('0x3c')]);_0x441de3[_0xf2e6('0x3b')]=_[_0xf2e6('0x39')](_0x346729[_0xf2e6('0x3a')],qs['fields'](_0x380b1b[_0xf2e6('0x3c')][_0xf2e6('0x3d')]));_0x441de3[_0xf2e6('0x3b')]=_0x441de3[_0xf2e6('0x3b')][_0xf2e6('0x4c')]?_0x441de3[_0xf2e6('0x3b')]:_0x346729[_0xf2e6('0x3a')];_0x441de3[_0xf2e6('0x3f')]=qs[_0xf2e6('0x40')](_0x380b1b[_0xf2e6('0x3c')][_0xf2e6('0x40')]);_0x441de3['where']=qs[_0xf2e6('0x38')](_['pick'](_0x380b1b['query'],_0x346729[_0xf2e6('0x38')]));if(_0x380b1b[_0xf2e6('0x3c')][_0xf2e6('0x45')]){_0x441de3[_0xf2e6('0x43')]=_['merge'](_0x441de3[_0xf2e6('0x43')],{'$or':_[_0xf2e6('0x33')](_0x441de3[_0xf2e6('0x3b')],function(_0x34ab13){var _0x5bf850={};_0x5bf850[_0x34ab13]={'$like':'%'+_0x380b1b[_0xf2e6('0x3c')][_0xf2e6('0x45')]+'%'};return _0x5bf850;})});}_0x441de3=_[_0xf2e6('0x42')]({},_0x441de3,_0x380b1b[_0xf2e6('0x46')]);return _0x255507[_0xf2e6('0x5b')](_0x441de3);}})[_0xf2e6('0x29')](function(_0x4a7128){if(_0x4a7128){_0x4520ce=_0x4a7128['length'];if(!_0x380b1b[_0xf2e6('0x3c')]['hasOwnProperty'](_0xf2e6('0x5c'))){_0x441de3['limit']=qs[_0xf2e6('0x22')](_0x380b1b[_0xf2e6('0x3c')][_0xf2e6('0x22')]);_0x441de3[_0xf2e6('0x20')]=qs[_0xf2e6('0x20')](_0x380b1b['query'][_0xf2e6('0x20')]);}return _0x255507[_0xf2e6('0x5b')](_0x441de3);}})[_0xf2e6('0x29')](function(_0x1c42f3){if(_0x1c42f3){return _0x1c42f3?{'count':_0x4520ce,'rows':_0x1c42f3}:null;}})[_0xf2e6('0x29')](respondWithResult(_0x959fe2,null))[_0xf2e6('0x4d')](handleError(_0x959fe2,null));};exports['getAnyConditions']=function(_0x56fcef,_0x324b7f,_0x169ad1){var _0x150cee={};var _0x512d39={};var _0x2e889d;var _0x122342;return db['Trigger'][_0xf2e6('0x5d')]({'where':{'id':_0x56fcef[_0xf2e6('0x4a')]['id']}})[_0xf2e6('0x29')](handleEntityNotFound(_0x324b7f,null))['then'](function(_0x3afde6){if(_0x3afde6){_0x2e889d=_0x3afde6;_0x512d39[_0xf2e6('0x3a')]=_[_0xf2e6('0x4b')](db[_0xf2e6('0x58')][_0xf2e6('0x35')]);_0x512d39['query']=_['keys'](_0x56fcef[_0xf2e6('0x3c')]);_0x512d39[_0xf2e6('0x38')]=_[_0xf2e6('0x39')](_0x512d39['model'],_0x512d39[_0xf2e6('0x3c')]);_0x150cee[_0xf2e6('0x3b')]=_['intersection'](_0x512d39[_0xf2e6('0x3a')],qs[_0xf2e6('0x3d')](_0x56fcef[_0xf2e6('0x3c')]['fields']));_0x150cee[_0xf2e6('0x3b')]=_0x150cee[_0xf2e6('0x3b')][_0xf2e6('0x4c')]?_0x150cee[_0xf2e6('0x3b')]:_0x512d39[_0xf2e6('0x3a')];_0x150cee['order']=qs[_0xf2e6('0x40')](_0x56fcef[_0xf2e6('0x3c')][_0xf2e6('0x40')]);_0x150cee[_0xf2e6('0x43')]=qs[_0xf2e6('0x38')](_[_0xf2e6('0x41')](_0x56fcef['query'],_0x512d39['filters']));if(_0x56fcef['query'][_0xf2e6('0x45')]){_0x150cee[_0xf2e6('0x43')]=_[_0xf2e6('0x42')](_0x150cee[_0xf2e6('0x43')],{'$or':_[_0xf2e6('0x33')](_0x150cee[_0xf2e6('0x3b')],function(_0x4bad8f){var _0x48cc77={};_0x48cc77[_0x4bad8f]={'$like':'%'+_0x56fcef['query'][_0xf2e6('0x45')]+'%'};return _0x48cc77;})});}_0x150cee=_[_0xf2e6('0x42')]({},_0x150cee,_0x56fcef[_0xf2e6('0x46')]);return _0x2e889d[_0xf2e6('0x5e')](_0x150cee);}})[_0xf2e6('0x29')](function(_0x5105b9){if(_0x5105b9){_0x122342=_0x5105b9['length'];if(!_0x56fcef[_0xf2e6('0x3c')]['hasOwnProperty'](_0xf2e6('0x5c'))){_0x150cee[_0xf2e6('0x22')]=qs[_0xf2e6('0x22')](_0x56fcef[_0xf2e6('0x3c')]['limit']);_0x150cee[_0xf2e6('0x20')]=qs[_0xf2e6('0x20')](_0x56fcef['query'][_0xf2e6('0x20')]);}return _0x2e889d['getAnyConditions'](_0x150cee);}})[_0xf2e6('0x29')](function(_0x222d29){if(_0x222d29){return _0x222d29?{'count':_0x122342,'rows':_0x222d29}:null;}})[_0xf2e6('0x29')](respondWithResult(_0x324b7f,null))[_0xf2e6('0x4d')](handleError(_0x324b7f,null));};exports[_0xf2e6('0x5f')]=function(_0x45e32e,_0x339592,_0x513c0b){if(_0x45e32e[_0xf2e6('0x4f')]['id']){delete _0x45e32e[_0xf2e6('0x4f')]['id'];}return db[_0xf2e6('0x34')][_0xf2e6('0x53')]({'where':{'id':_0x45e32e[_0xf2e6('0x4a')]['id']}})[_0xf2e6('0x29')](handleEntityNotFound(_0x339592,null))[_0xf2e6('0x29')](function(_0x5d1cad){if(_0x5d1cad){_0x45e32e[_0xf2e6('0x4f')][_0xf2e6('0x60')]=_0x5d1cad['id'];return db['Action'][_0xf2e6('0x4e')](_0x45e32e['body']);}})[_0xf2e6('0x29')](respondWithResult(_0x339592,null))[_0xf2e6('0x4d')](handleError(_0x339592,null));};exports['getActions']=function(_0x5b6cf1,_0x349e68,_0x3621ca){var _0x49ebb2={};var _0x11eb66={};var _0x598c5c;var _0x1a47a3;return db[_0xf2e6('0x34')][_0xf2e6('0x5d')]({'where':{'id':_0x5b6cf1[_0xf2e6('0x4a')]['id']}})[_0xf2e6('0x29')](handleEntityNotFound(_0x349e68,null))[_0xf2e6('0x29')](function(_0x11e6e0){if(_0x11e6e0){_0x598c5c=_0x11e6e0;_0x11eb66[_0xf2e6('0x3a')]=_[_0xf2e6('0x4b')](db[_0xf2e6('0x61')][_0xf2e6('0x35')]);_0x11eb66[_0xf2e6('0x3c')]=_[_0xf2e6('0x4b')](_0x5b6cf1[_0xf2e6('0x3c')]);_0x11eb66['filters']=_['intersection'](_0x11eb66[_0xf2e6('0x3a')],_0x11eb66[_0xf2e6('0x3c')]);_0x49ebb2[_0xf2e6('0x3b')]=_[_0xf2e6('0x39')](_0x11eb66[_0xf2e6('0x3a')],qs['fields'](_0x5b6cf1[_0xf2e6('0x3c')][_0xf2e6('0x3d')]));_0x49ebb2[_0xf2e6('0x3b')]=_0x49ebb2[_0xf2e6('0x3b')][_0xf2e6('0x4c')]?_0x49ebb2[_0xf2e6('0x3b')]:_0x11eb66['model'];_0x49ebb2[_0xf2e6('0x3f')]=qs[_0xf2e6('0x40')](_0x5b6cf1[_0xf2e6('0x3c')][_0xf2e6('0x40')]);_0x49ebb2[_0xf2e6('0x43')]=qs[_0xf2e6('0x38')](_['pick'](_0x5b6cf1[_0xf2e6('0x3c')],_0x11eb66[_0xf2e6('0x38')]));if(_0x5b6cf1[_0xf2e6('0x3c')][_0xf2e6('0x45')]){_0x49ebb2[_0xf2e6('0x43')]=_[_0xf2e6('0x42')](_0x49ebb2[_0xf2e6('0x43')],{'$or':_[_0xf2e6('0x33')](_0x49ebb2['attributes'],function(_0x5add21){var _0x22b541={};_0x22b541[_0x5add21]={'$like':'%'+_0x5b6cf1[_0xf2e6('0x3c')][_0xf2e6('0x45')]+'%'};return _0x22b541;})});}_0x49ebb2=_[_0xf2e6('0x42')]({},_0x49ebb2,_0x5b6cf1[_0xf2e6('0x46')]);return _0x598c5c[_0xf2e6('0x62')](_0x49ebb2);}})[_0xf2e6('0x29')](function(_0x1e4e7c){if(_0x1e4e7c){_0x1a47a3=_0x1e4e7c[_0xf2e6('0x4c')];if(!_0x5b6cf1[_0xf2e6('0x3c')][_0xf2e6('0x3e')]('nolimit')){_0x49ebb2[_0xf2e6('0x22')]=qs[_0xf2e6('0x22')](_0x5b6cf1[_0xf2e6('0x3c')]['limit']);_0x49ebb2[_0xf2e6('0x20')]=qs['offset'](_0x5b6cf1[_0xf2e6('0x3c')][_0xf2e6('0x20')]);}return _0x598c5c[_0xf2e6('0x62')](_0x49ebb2);}})[_0xf2e6('0x29')](function(_0x5c495d){if(_0x5c495d){return _0x5c495d?{'count':_0x1a47a3,'rows':_0x5c495d}:null;}})[_0xf2e6('0x29')](respondWithResult(_0x349e68,null))[_0xf2e6('0x4d')](handleError(_0x349e68,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index f633a83..970bb88 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 _0x4c6d=['moment','request-promise','path','rimraf','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger','api'];(function(_0x5dc927,_0x49f4a1){var _0x416440=function(_0x752837){while(--_0x752837){_0x5dc927['push'](_0x5dc927['shift']());}};_0x416440(++_0x49f4a1);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x928174,_0x27b2e2){_0x928174=_0x928174-0x0;var _0x50c908=_0x4c6d[_0x928174];return _0x50c908;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var logger=require(_0xd4c6('0x2'))(_0xd4c6('0x3'));var moment=require(_0xd4c6('0x4'));var BPromise=require('bluebird');var rp=require(_0xd4c6('0x5'));var fs=require('fs');var path=require(_0xd4c6('0x6'));var rimraf=require(_0xd4c6('0x7'));var config=require('../../config/environment');var attributes=require(_0xd4c6('0x8'));module[_0xd4c6('0x9')]=function(_0x56279c,_0x182671){return _0x56279c[_0xd4c6('0xa')](_0xd4c6('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63b6=['rimraf','../../config/environment','./trigger.attributes','define','tools_triggers','lodash','util','../../config/logger','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63b6,0x127));var _0x663b=function(_0x298edb,_0x32aec8){_0x298edb=_0x298edb-0x0;var _0x2c9d09=_0x63b6[_0x298edb];return _0x2c9d09;};'use strict';var _=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var logger=require(_0x663b('0x2'))('api');var moment=require(_0x663b('0x3'));var BPromise=require('bluebird');var rp=require(_0x663b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x663b('0x5'));var config=require(_0x663b('0x6'));var attributes=require(_0x663b('0x7'));module['exports']=function(_0x4486b1,_0x57e43e){return _0x4486b1[_0x663b('0x8')]('Trigger',attributes,{'tableName':_0x663b('0x9'),'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 9f400bd..d574e2f 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 _0x75a8=['debug','request\x20sent','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','raw','map','include','model','attributes','then','ShowTrigger','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','Trigger,\x20%s,\x20%s'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0x75a8,0x1c5));var _0x875a=function(_0x815a8a,_0x391fb6){_0x815a8a=_0x815a8a-0x0;var _0x49b126=_0x75a8[_0x815a8a];return _0x49b126;};'use strict';var _=require(_0x875a('0x0'));var util=require(_0x875a('0x1'));var moment=require(_0x875a('0x2'));var BPromise=require(_0x875a('0x3'));var rs=require(_0x875a('0x4'));var fs=require('fs');var Redis=require(_0x875a('0x5'));var db=require(_0x875a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x875a('0x7'))(_0x875a('0x8'));var config=require(_0x875a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x875a('0xa')][_0x875a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55ceb8,_0x4570dd,_0x2c0900){return new BPromise(function(_0x4a9ab3,_0x322365){return client[_0x875a('0xc')](_0x55ceb8,_0x2c0900)['then'](function(_0x4b399c){logger[_0x875a('0xd')](_0x875a('0xe'),_0x4570dd,'request\x20sent');logger[_0x875a('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x4570dd,_0x875a('0x10'),JSON[_0x875a('0x11')](_0x4b399c));if(_0x4b399c[_0x875a('0x12')]){if(_0x4b399c['error'][_0x875a('0x13')]===0x1f4){logger[_0x875a('0x12')]('Trigger,\x20%s,\x20%s',_0x4570dd,_0x4b399c[_0x875a('0x12')][_0x875a('0x14')]);return _0x322365(_0x4b399c[_0x875a('0x12')][_0x875a('0x14')]);}logger[_0x875a('0x12')](_0x875a('0xe'),_0x4570dd,_0x4b399c[_0x875a('0x12')][_0x875a('0x14')]);return _0x4a9ab3(_0x4b399c[_0x875a('0x12')][_0x875a('0x14')]);}else{logger[_0x875a('0xd')]('Trigger,\x20%s,\x20%s',_0x4570dd,_0x875a('0x10'));_0x4a9ab3(_0x4b399c[_0x875a('0x15')]['message']);}})[_0x875a('0x16')](function(_0x424f32){logger[_0x875a('0x12')]('Trigger,\x20%s,\x20%s',_0x4570dd,_0x424f32);_0x322365(_0x424f32);});});}exports[_0x875a('0x17')]=function(_0x19edc7){var _0x394880=this;return new Promise(function(_0x2c3cac,_0x4a14ac){return db[_0x875a('0x18')][_0x875a('0x19')]({'raw':_0x19edc7[_0x875a('0x1a')]?_0x19edc7[_0x875a('0x1a')][_0x875a('0x1b')]===undefined?!![]:![]:!![],'where':_0x19edc7['options']?_0x19edc7[_0x875a('0x1a')]['where']||null:null,'attributes':_0x19edc7[_0x875a('0x1a')]?_0x19edc7[_0x875a('0x1a')]['attributes']||null:null,'limit':_0x19edc7[_0x875a('0x1a')]?_0x19edc7[_0x875a('0x1a')]['limit']||null:null,'include':_0x19edc7['options']?_0x19edc7['options']['include']?_[_0x875a('0x1c')](_0x19edc7['options'][_0x875a('0x1d')],function(_0x33cc46){return{'model':db[_0x33cc46[_0x875a('0x1e')]],'as':_0x33cc46['as'],'attributes':_0x33cc46['attributes'],'include':_0x33cc46['include']?_[_0x875a('0x1c')](_0x33cc46[_0x875a('0x1d')],function(_0x250ab6){return{'model':db[_0x250ab6[_0x875a('0x1e')]],'as':_0x250ab6['as'],'attributes':_0x250ab6[_0x875a('0x1f')],'include':_0x250ab6[_0x875a('0x1d')]?_[_0x875a('0x1c')](_0x250ab6['include'],function(_0x308754){return{'model':db[_0x308754[_0x875a('0x1e')]],'as':_0x308754['as'],'attributes':_0x308754[_0x875a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x875a('0x20')](function(_0x582713){logger[_0x875a('0xd')](_0x875a('0x17'),_0x19edc7);logger[_0x875a('0xf')](_0x875a('0x17'),_0x19edc7,JSON[_0x875a('0x11')](_0x582713));_0x2c3cac(_0x582713);})[_0x875a('0x16')](function(_0x1447f7){logger[_0x875a('0x12')]('GetTrigger',_0x1447f7[_0x875a('0x14')],_0x19edc7);_0x4a14ac(_0x394880['error'](0x1f4,_0x1447f7[_0x875a('0x14')]));});});};exports[_0x875a('0x21')]=function(_0x147de2){var _0x3697b7=this;return new Promise(function(_0xdddb3c,_0x38794a){return db['Trigger'][_0x875a('0x22')]({'raw':_0x147de2[_0x875a('0x1a')]?_0x147de2['options'][_0x875a('0x1b')]===undefined?!![]:![]:!![],'where':_0x147de2['options']?_0x147de2[_0x875a('0x1a')][_0x875a('0x23')]||null:null,'attributes':_0x147de2[_0x875a('0x1a')]?_0x147de2[_0x875a('0x1a')][_0x875a('0x1f')]||null:null,'include':_0x147de2['options']?_0x147de2[_0x875a('0x1a')]['include']?_['map'](_0x147de2['options'][_0x875a('0x1d')],function(_0x1a75be){return{'model':db[_0x1a75be['model']],'as':_0x1a75be['as'],'attributes':_0x1a75be[_0x875a('0x1f')],'include':_0x1a75be[_0x875a('0x1d')]?_['map'](_0x1a75be[_0x875a('0x1d')],function(_0x3ee9eb){return{'model':db[_0x3ee9eb['model']],'as':_0x3ee9eb['as'],'attributes':_0x3ee9eb[_0x875a('0x1f')],'include':_0x3ee9eb[_0x875a('0x1d')]?_[_0x875a('0x1c')](_0x3ee9eb[_0x875a('0x1d')],function(_0x1b170e){return{'model':db[_0x1b170e['model']],'as':_0x1b170e['as'],'attributes':_0x1b170e[_0x875a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x875a('0x20')](function(_0x5b5ef5){logger[_0x875a('0xd')]('ShowTrigger',_0x147de2);logger['debug'](_0x875a('0x21'),_0x147de2,JSON[_0x875a('0x11')](_0x5b5ef5));_0xdddb3c(_0x5b5ef5);})[_0x875a('0x16')](function(_0x3306aa){logger['error'](_0x875a('0x21'),_0x3306aa[_0x875a('0x14')],_0x147de2);_0x38794a(_0x3697b7[_0x875a('0x12')](0x1f4,_0x3306aa[_0x875a('0x14')]));});});}; \ No newline at end of file +var _0x8555=['limit','include','map','model','stringify','ShowTrigger','Trigger','find','where','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','Trigger,\x20%s,\x20%s','message','result','GetTrigger','options','raw','attributes'];(function(_0x4154fe,_0x3dc862){var _0x54612a=function(_0x3c16a6){while(--_0x3c16a6){_0x4154fe['push'](_0x4154fe['shift']());}};_0x54612a(++_0x3dc862);}(_0x8555,0x8e));var _0x5855=function(_0x216ce7,_0xb65bdd){_0x216ce7=_0x216ce7-0x0;var _0x15181d=_0x8555[_0x216ce7];return _0x15181d;};'use strict';var _=require(_0x5855('0x0'));var util=require('util');var moment=require(_0x5855('0x1'));var BPromise=require(_0x5855('0x2'));var rs=require(_0x5855('0x3'));var fs=require('fs');var Redis=require(_0x5855('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5855('0x5'));var logger=require('../../config/logger')(_0x5855('0x6'));var config=require(_0x5855('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5855('0x8')][_0x5855('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14cbd6,_0x24a06e,_0x346390){return new BPromise(function(_0x5569ed,_0x2044d6){return client['request'](_0x14cbd6,_0x346390)[_0x5855('0xa')](function(_0x7991b4){logger[_0x5855('0xb')]('Trigger,\x20%s,\x20%s',_0x24a06e,_0x5855('0xc'));logger[_0x5855('0xd')](_0x5855('0xe'),_0x24a06e,_0x5855('0xc'),JSON['stringify'](_0x7991b4));if(_0x7991b4[_0x5855('0xf')]){if(_0x7991b4[_0x5855('0xf')]['code']===0x1f4){logger[_0x5855('0xf')](_0x5855('0x10'),_0x24a06e,_0x7991b4[_0x5855('0xf')][_0x5855('0x11')]);return _0x2044d6(_0x7991b4['error']['message']);}logger['error'](_0x5855('0x10'),_0x24a06e,_0x7991b4[_0x5855('0xf')][_0x5855('0x11')]);return _0x5569ed(_0x7991b4[_0x5855('0xf')][_0x5855('0x11')]);}else{logger[_0x5855('0xb')](_0x5855('0x10'),_0x24a06e,_0x5855('0xc'));_0x5569ed(_0x7991b4[_0x5855('0x12')]['message']);}})['catch'](function(_0x1e1f08){logger['error']('Trigger,\x20%s,\x20%s',_0x24a06e,_0x1e1f08);_0x2044d6(_0x1e1f08);});});}exports[_0x5855('0x13')]=function(_0x3416c2){var _0x4e7f0e=this;return new Promise(function(_0x2cc9e8,_0x1bf4cc){return db['Trigger']['findAll']({'raw':_0x3416c2['options']?_0x3416c2[_0x5855('0x14')][_0x5855('0x15')]===undefined?!![]:![]:!![],'where':_0x3416c2[_0x5855('0x14')]?_0x3416c2[_0x5855('0x14')]['where']||null:null,'attributes':_0x3416c2[_0x5855('0x14')]?_0x3416c2[_0x5855('0x14')][_0x5855('0x16')]||null:null,'limit':_0x3416c2[_0x5855('0x14')]?_0x3416c2['options'][_0x5855('0x17')]||null:null,'include':_0x3416c2['options']?_0x3416c2[_0x5855('0x14')][_0x5855('0x18')]?_[_0x5855('0x19')](_0x3416c2[_0x5855('0x14')][_0x5855('0x18')],function(_0x330294){return{'model':db[_0x330294['model']],'as':_0x330294['as'],'attributes':_0x330294[_0x5855('0x16')],'include':_0x330294[_0x5855('0x18')]?_['map'](_0x330294[_0x5855('0x18')],function(_0x312e06){return{'model':db[_0x312e06[_0x5855('0x1a')]],'as':_0x312e06['as'],'attributes':_0x312e06[_0x5855('0x16')],'include':_0x312e06[_0x5855('0x18')]?_[_0x5855('0x19')](_0x312e06[_0x5855('0x18')],function(_0x1284dd){return{'model':db[_0x1284dd[_0x5855('0x1a')]],'as':_0x1284dd['as'],'attributes':_0x1284dd[_0x5855('0x16')]};}):[]};}):[]};}):[]:[]})[_0x5855('0xa')](function(_0x3522be){logger['info']('GetTrigger',_0x3416c2);logger[_0x5855('0xd')](_0x5855('0x13'),_0x3416c2,JSON[_0x5855('0x1b')](_0x3522be));_0x2cc9e8(_0x3522be);})['catch'](function(_0x3eaec3){logger[_0x5855('0xf')](_0x5855('0x13'),_0x3eaec3[_0x5855('0x11')],_0x3416c2);_0x1bf4cc(_0x4e7f0e['error'](0x1f4,_0x3eaec3[_0x5855('0x11')]));});});};exports[_0x5855('0x1c')]=function(_0x2675eb){var _0x10c896=this;return new Promise(function(_0x712414,_0x146d11){return db[_0x5855('0x1d')][_0x5855('0x1e')]({'raw':_0x2675eb[_0x5855('0x14')]?_0x2675eb['options'][_0x5855('0x15')]===undefined?!![]:![]:!![],'where':_0x2675eb[_0x5855('0x14')]?_0x2675eb['options'][_0x5855('0x1f')]||null:null,'attributes':_0x2675eb[_0x5855('0x14')]?_0x2675eb[_0x5855('0x14')][_0x5855('0x16')]||null:null,'include':_0x2675eb[_0x5855('0x14')]?_0x2675eb[_0x5855('0x14')][_0x5855('0x18')]?_[_0x5855('0x19')](_0x2675eb[_0x5855('0x14')][_0x5855('0x18')],function(_0x166920){return{'model':db[_0x166920['model']],'as':_0x166920['as'],'attributes':_0x166920[_0x5855('0x16')],'include':_0x166920[_0x5855('0x18')]?_['map'](_0x166920[_0x5855('0x18')],function(_0xc29467){return{'model':db[_0xc29467[_0x5855('0x1a')]],'as':_0xc29467['as'],'attributes':_0xc29467[_0x5855('0x16')],'include':_0xc29467['include']?_[_0x5855('0x19')](_0xc29467[_0x5855('0x18')],function(_0xa97048){return{'model':db[_0xa97048[_0x5855('0x1a')]],'as':_0xa97048['as'],'attributes':_0xa97048['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x218b20){logger['info'](_0x5855('0x1c'),_0x2675eb);logger[_0x5855('0xd')](_0x5855('0x1c'),_0x2675eb,JSON['stringify'](_0x218b20));_0x712414(_0x218b20);})[_0x5855('0x20')](function(_0x3df9cf){logger['error'](_0x5855('0x1c'),_0x3df9cf[_0x5855('0x11')],_0x2675eb);_0x146d11(_0x10c896[_0x5855('0xf')](0x1f4,_0x3df9cf[_0x5855('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 41cf275..0f4122e 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 _0x35b1=['post','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','clone'];(function(_0x275624,_0x12e717){var _0xd91bae=function(_0x12c160){while(--_0x12c160){_0x275624['push'](_0x275624['shift']());}};_0xd91bae(++_0x12e717);}(_0x35b1,0x194));var _0x135b=function(_0x4c1ad8,_0x55e28d){_0x4c1ad8=_0x4c1ad8-0x0;var _0x2c617b=_0x35b1[_0x4c1ad8];return _0x2c617b;};'use strict';var multer=require('multer');var util=require(_0x135b('0x0'));var path=require(_0x135b('0x1'));var timeout=require(_0x135b('0x2'));var express=require(_0x135b('0x3'));var router=express[_0x135b('0x4')]();var fs_extra=require(_0x135b('0x5'));var auth=require(_0x135b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x135b('0x7'));var controller=require(_0x135b('0x8'));router[_0x135b('0x9')]('/',auth[_0x135b('0xa')](),controller[_0x135b('0xb')]);router[_0x135b('0x9')](_0x135b('0xc'),auth[_0x135b('0xa')](),controller[_0x135b('0xd')]);router['post'](_0x135b('0xe'),auth[_0x135b('0xa')](),controller[_0x135b('0xf')]);router[_0x135b('0x10')]('/',auth[_0x135b('0xa')](),controller['create']);router[_0x135b('0x11')](_0x135b('0xc'),auth['isAuthenticated'](),controller[_0x135b('0x12')]);router[_0x135b('0x13')](_0x135b('0xc'),auth[_0x135b('0xa')](),controller['destroy']);module[_0x135b('0x14')]=router; \ No newline at end of file +var _0x3bf0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','/:id/clone','clone','put','/:id','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x13875a,_0x4d878b){var _0x4e2fbb=function(_0x2a94a8){while(--_0x2a94a8){_0x13875a['push'](_0x13875a['shift']());}};_0x4e2fbb(++_0x4d878b);}(_0x3bf0,0x1b5));var _0x03bf=function(_0x3edb90,_0x305612){_0x3edb90=_0x3edb90-0x0;var _0x318a53=_0x3bf0[_0x3edb90];return _0x318a53;};'use strict';var multer=require(_0x03bf('0x0'));var util=require(_0x03bf('0x1'));var path=require('path');var timeout=require(_0x03bf('0x2'));var express=require(_0x03bf('0x3'));var router=express[_0x03bf('0x4')]();var fs_extra=require(_0x03bf('0x5'));var auth=require(_0x03bf('0x6'));var interaction=require(_0x03bf('0x7'));var config=require(_0x03bf('0x8'));var controller=require('./trunk.controller');router[_0x03bf('0x9')]('/',auth[_0x03bf('0xa')](),controller[_0x03bf('0xb')]);router[_0x03bf('0x9')]('/:id',auth[_0x03bf('0xa')](),controller[_0x03bf('0xc')]);router[_0x03bf('0xd')](_0x03bf('0xe'),auth[_0x03bf('0xa')](),controller[_0x03bf('0xf')]);router[_0x03bf('0xd')]('/',auth[_0x03bf('0xa')](),controller['create']);router[_0x03bf('0x10')](_0x03bf('0x11'),auth[_0x03bf('0xa')](),controller[_0x03bf('0x12')]);router[_0x03bf('0x13')]('/:id',auth[_0x03bf('0xa')](),controller['destroy']);module[_0x03bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index fc6f0aa..65998bc 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 _0xfc8b=['uas','fingerprint','certificate','active','passive','actpass','dynamic','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','setDataValue','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac'];(function(_0x22c49f,_0x4ad08d){var _0xbe0aad=function(_0x57114c){while(--_0x57114c){_0x22c49f['push'](_0x22c49f['shift']());}};_0xbe0aad(++_0x4ad08d);}(_0xfc8b,0x1ed));var _0xbfc8=function(_0x487a5b,_0x20c6d7){_0x487a5b=_0x487a5b-0x0;var _0x26fca1=_0xfc8b[_0x487a5b];return _0x26fca1;};'use strict';var Sequelize=require(_0xbfc8('0x0'));module[_0xbfc8('0x1')]={'name':{'type':Sequelize[_0xbfc8('0x2')],'allowNull':![],'unique':_0xbfc8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x5'),_0xbfc8('0x6'),_0xbfc8('0x7')),'allowNull':![],'defaultValue':_0xbfc8('0x5')},'context':{'type':Sequelize[_0xbfc8('0x2')],'allowNull':![],'defaultValue':_0xbfc8('0x8')},'callingpres':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x9'),_0xbfc8('0xa'),_0xbfc8('0xb'),'ALLOWED',_0xbfc8('0xc'),_0xbfc8('0xd'),_0xbfc8('0xe'),_0xbfc8('0xf'))},'deny':{'type':Sequelize[_0xbfc8('0x2')]},'permit':{'type':Sequelize[_0xbfc8('0x2')]},'secret':{'type':Sequelize[_0xbfc8('0x2')]},'md5secret':{'type':Sequelize[_0xbfc8('0x2')]},'remotesecret':{'type':Sequelize[_0xbfc8('0x2')]},'transport':{'type':Sequelize[_0xbfc8('0x2')],'defaultValue':_0xbfc8('0x10'),'set':function(_0x18cd99){this['setDataValue']('transport',_0x18cd99?_0x18cd99[_0xbfc8('0x11')](','):null);},'get':function(){return this[_0xbfc8('0x12')]('transport')?this[_0xbfc8('0x12')](_0xbfc8('0x13'))[_0xbfc8('0x14')](','):null;},'comment':_0xbfc8('0x15')},'dtmfmode':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x16'),'info',_0xbfc8('0x17'),_0xbfc8('0x18'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no',_0xbfc8('0x1a'),_0xbfc8('0x1b'),_0xbfc8('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xbfc8('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbfc8('0x2')]},'directmediadeny':{'type':Sequelize[_0xbfc8('0x2')]},'nat':{'type':Sequelize[_0xbfc8('0x2')],'defaultValue':_0xbfc8('0x1d'),'set':function(_0x55b0d8){this['setDataValue']('nat',_0x55b0d8?_0x55b0d8['join'](','):null);},'get':function(){return this['getDataValue'](_0xbfc8('0x1e'))?this['getDataValue'](_0xbfc8('0x1e'))[_0xbfc8('0x14')](','):null;},'comment':_0xbfc8('0x1f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xbfc8('0x2')]},'pickupgroup':{'type':Sequelize[_0xbfc8('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xbfc8('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbfc8('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbfc8('0x20')},'allow':{'type':Sequelize[_0xbfc8('0x2')],'allowNull':![],'defaultValue':_0xbfc8('0x21'),'set':function(_0x230603){this['setDataValue'](_0xbfc8('0x22'),_0x230603?_0x230603[_0xbfc8('0x11')](';'):_0xbfc8('0x21'));},'get':function(){return this[_0xbfc8('0x12')](_0xbfc8('0x22'))?this[_0xbfc8('0x12')](_0xbfc8('0x22'))[_0xbfc8('0x14')](';'):null;},'comment':_0xbfc8('0x23')},'autoframing':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no')},'insecure':{'type':Sequelize[_0xbfc8('0x2')],'defaultValue':_0xbfc8('0x24'),'set':function(_0x46aeb1){this[_0xbfc8('0x25')](_0xbfc8('0x26'),_0x46aeb1?_0x46aeb1[_0xbfc8('0x11')](','):null);},'get':function(){return this['getDataValue'](_0xbfc8('0x26'))?this[_0xbfc8('0x12')](_0xbfc8('0x26'))[_0xbfc8('0x14')](','):null;},'comment':_0xbfc8('0x27')},'trustrpid':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0xbfc8('0x28'))},'promiscredir':{'type':Sequelize['ENUM'](_0xbfc8('0x19'),'no')},'useclientcode':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no')},'accountcode':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xbfc8('0x2')],'defaultValue':_0xbfc8('0x2a')},'amaflags':{'type':Sequelize[_0xbfc8('0x2')]},'callcounter':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no'),'defaultValue':_0xbfc8('0x19')},'busylevel':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xbfc8('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0xbfc8('0x2')]},'template':{'type':Sequelize[_0xbfc8('0x2')]},'videosupport':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no')},'mailbox':{'type':Sequelize[_0xbfc8('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0xbfc8('0x2b'),_0xbfc8('0x2c'),_0xbfc8('0x2d'))},'session_expires':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'session_minse':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'session_refresher':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x2e'),_0xbfc8('0x2f')),'defaultValue':_0xbfc8('0x2f')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xbfc8('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xbfc8('0x29')](0x5)},'qualify':{'type':Sequelize[_0xbfc8('0x4')]('yes','no'),'defaultValue':_0xbfc8('0x19')},'keepalive':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'defaultip':{'type':Sequelize[_0xbfc8('0x2')]},'defaultuser':{'type':Sequelize[_0xbfc8('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xbfc8('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'qualifyfreq':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xbfc8('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xbfc8('0x2')]},'use_q850_reason':{'type':Sequelize[_0xbfc8('0x2')]},'maxforwards':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no')},'force_avp':{'type':Sequelize[_0xbfc8('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0xbfc8('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no',_0xbfc8('0x30'),_0xbfc8('0x31'))},'dtlsrekey':{'type':Sequelize[_0xbfc8('0x29')](0xb)},'dtlscertfile':{'type':Sequelize[_0xbfc8('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xbfc8('0x2')]},'dtlscipher':{'type':Sequelize[_0xbfc8('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x32'),_0xbfc8('0x33'),_0xbfc8('0x34')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xbfc8('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbfc8('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no')},'vmexten':{'type':Sequelize[_0xbfc8('0x2')]},'mohinterpret':{'type':Sequelize[_0xbfc8('0x2')]},'mohsuggest':{'type':Sequelize[_0xbfc8('0x2')]},'parkinglot':{'type':Sequelize[_0xbfc8('0x2')]},'description':{'type':Sequelize[_0xbfc8('0x2')]},'host':{'type':Sequelize[_0xbfc8('0x2')],'defaultValue':_0xbfc8('0x35')},'canreinvite':{'type':Sequelize[_0xbfc8('0x4')](_0xbfc8('0x19'),'no',_0xbfc8('0x1a'),_0xbfc8('0x1b'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xbfc8('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbfc8('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x90e5=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','accept','uas','pai','fingerprint','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','friend','user','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','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'];(function(_0xb4788,_0x1efb8d){var _0xd49d21=function(_0x2b2a2b){while(--_0x2b2a2b){_0xb4788['push'](_0xb4788['shift']());}};_0xd49d21(++_0x1efb8d);}(_0x90e5,0x17d));var _0x590e=function(_0x270e97,_0x58a427){_0x270e97=_0x270e97-0x0;var _0x54dc12=_0x90e5[_0x270e97];return _0x54dc12;};'use strict';var Sequelize=require(_0x590e('0x0'));module['exports']={'name':{'type':Sequelize[_0x590e('0x1')],'allowNull':![],'unique':_0x590e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x590e('0x3'),_0x590e('0x4'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x590e('0x1')],'allowNull':![],'defaultValue':_0x590e('0x5')},'callingpres':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x7'),'ALLOWED_PASSED_SCREEN',_0x590e('0x8'),'ALLOWED',_0x590e('0x9'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0x590e('0x1')]},'permit':{'type':Sequelize[_0x590e('0x1')]},'secret':{'type':Sequelize[_0x590e('0x1')]},'md5secret':{'type':Sequelize[_0x590e('0x1')]},'remotesecret':{'type':Sequelize[_0x590e('0x1')]},'transport':{'type':Sequelize[_0x590e('0x1')],'defaultValue':_0x590e('0xa'),'set':function(_0x3823f6){this[_0x590e('0xb')](_0x590e('0xc'),_0x3823f6?_0x3823f6[_0x590e('0xd')](','):null);},'get':function(){return this['getDataValue'](_0x590e('0xc'))?this[_0x590e('0xe')](_0x590e('0xc'))[_0x590e('0xf')](','):null;},'comment':_0x590e('0x10')},'dtmfmode':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x11'),_0x590e('0x12'),_0x590e('0x13'),_0x590e('0x14'),_0x590e('0x15')),'defaultValue':_0x590e('0x11')},'directmedia':{'type':Sequelize['ENUM'](_0x590e('0x16'),'no',_0x590e('0x17'),_0x590e('0x18'),_0x590e('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x590e('0x1')]},'directmediadeny':{'type':Sequelize[_0x590e('0x1')]},'nat':{'type':Sequelize[_0x590e('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x4183e4){this[_0x590e('0xb')](_0x590e('0x1a'),_0x4183e4?_0x4183e4[_0x590e('0xd')](','):null);},'get':function(){return this[_0x590e('0xe')](_0x590e('0x1a'))?this['getDataValue'](_0x590e('0x1a'))[_0x590e('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x590e('0x1')]},'namedcallgroup':{'type':Sequelize[_0x590e('0x1')]},'pickupgroup':{'type':Sequelize[_0x590e('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x590e('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x590e('0x1')],'defaultValue':_0x590e('0x1b')},'allow':{'type':Sequelize[_0x590e('0x1')],'allowNull':![],'defaultValue':_0x590e('0x1c'),'set':function(_0xdf5eb5){this['setDataValue']('allow',_0xdf5eb5?_0xdf5eb5[_0x590e('0xd')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x590e('0xe')]('allow')?this[_0x590e('0xe')](_0x590e('0x1d'))[_0x590e('0xf')](';'):null;},'comment':_0x590e('0x1e')},'autoframing':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no')},'insecure':{'type':Sequelize[_0x590e('0x1')],'defaultValue':_0x590e('0x1f'),'set':function(_0x17a13e){this[_0x590e('0xb')]('insecure',_0x17a13e?_0x17a13e[_0x590e('0xd')](','):null);},'get':function(){return this[_0x590e('0xe')](_0x590e('0x20'))?this[_0x590e('0xe')](_0x590e('0x20'))['split'](','):null;},'comment':_0x590e('0x21')},'trustrpid':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x590e('0x6')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no',_0x590e('0x22'))},'promiscredir':{'type':Sequelize['ENUM'](_0x590e('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no')},'accountcode':{'type':Sequelize[_0x590e('0x23')](0xb)},'setvar':{'type':Sequelize[_0x590e('0x1')]},'callerid':{'type':Sequelize[_0x590e('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x590e('0x1')]},'callcounter':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no'),'defaultValue':_0x590e('0x16')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x590e('0x1')]},'template':{'type':Sequelize[_0x590e('0x1')]},'videosupport':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x590e('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x590e('0x16'),'no')},'mailbox':{'type':Sequelize[_0x590e('0x1')]},'session_timers':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x24'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x590e('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x590e('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x590e('0x6')]('uac','uas'),'defaultValue':_0x590e('0x25')},'t38pt_usertpsource':{'type':Sequelize[_0x590e('0x1')]},'regexten':{'type':Sequelize[_0x590e('0x1')]},'fromdomain':{'type':Sequelize[_0x590e('0x1')]},'fromuser':{'type':Sequelize[_0x590e('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x590e('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x590e('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x590e('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x590e('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x590e('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no',_0x590e('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x590e('0x1')]},'timert1':{'type':Sequelize[_0x590e('0x23')](0xb)},'timerb':{'type':Sequelize[_0x590e('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x590e('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x590e('0x1')]},'contactdeny':{'type':Sequelize[_0x590e('0x1')]},'contactacl':{'type':Sequelize[_0x590e('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x590e('0x1')]},'use_q850_reason':{'type':Sequelize[_0x590e('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x590e('0x6')]('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0x590e('0x16'),'no')},'icesupport':{'type':Sequelize[_0x590e('0x6')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x590e('0x16'),'no',_0x590e('0x27'),_0x590e('0x28'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x590e('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x590e('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x590e('0x29'),_0x590e('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x590e('0x6')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x590e('0x1')]},'recordofffeature':{'type':Sequelize[_0x590e('0x1')]},'call_limit':{'type':Sequelize[_0x590e('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x590e('0x16'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x590e('0x16'),'no')},'vmexten':{'type':Sequelize[_0x590e('0x1')]},'mohinterpret':{'type':Sequelize[_0x590e('0x1')]},'mohsuggest':{'type':Sequelize[_0x590e('0x1')]},'parkinglot':{'type':Sequelize[_0x590e('0x1')]},'description':{'type':Sequelize[_0x590e('0x1')]},'host':{'type':Sequelize[_0x590e('0x1')],'defaultValue':_0x590e('0x2b')},'canreinvite':{'type':Sequelize[_0x590e('0x6')](_0x590e('0x16'),'no',_0x590e('0x17'),_0x590e('0x18'),_0x590e('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x590e('0x1')]},'otherFields':{'type':Sequelize[_0x590e('0x1')]},'active':{'type':Sequelize[_0x590e('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x590e('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 843ee93..e3eb2cb 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 _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x10e737,_0x2f2f14){var _0x5038d7=function(_0x1be835){while(--_0x1be835){_0x10e737['push'](_0x10e737['shift']());}};_0x5038d7(++_0x2f2f14);}(_0xb821,0xa7));var _0x1b82=function(_0x15d56b,_0x415b6a){_0x15d56b=_0x15d56b-0x0;var _0x30999=_0xb821[_0x15d56b];return _0x30999;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file +var _0x8ef6=['userProfileId','autoAssociation','UserProfileResource','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','options','Trunk','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','catch','clone','omit','createdAt','updatedAt','create','body','get','role','UserProfileSection'];(function(_0x38ed45,_0x4ca866){var _0x37ea2f=function(_0x5c4e57){while(--_0x5c4e57){_0x38ed45['push'](_0x38ed45['shift']());}};_0x37ea2f(++_0x4ca866);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1f60f6,_0x3f4a7f){_0x1f60f6=_0x1f60f6-0x0;var _0x443d3f=_0x8ef6[_0x1f60f6];return _0x443d3f;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];var jayson=require(_0x68ef('0x1b'));var client=jayson[_0x68ef('0x1c')][_0x68ef('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x288cc9,_0x508671,_0x3b48dd,_0xc50cce){return new BPromise(function(_0x2657c5,_0x47fbb5){var _0x22fe96=_0xc50cce||client;return _0x22fe96[_0x68ef('0x1e')](_0x288cc9,_0x3b48dd)[_0x68ef('0x1f')](function(_0x5005ba){logger[_0x68ef('0x20')](_0x68ef('0x21'),_0x508671,_0x68ef('0x22'));logger[_0x68ef('0x23')]('Trunk,\x20%s,\x20%s,\x20%s',_0x508671,_0x68ef('0x22'),JSON['stringify'](_0x5005ba));if(_0x5005ba['error']){if(_0x5005ba[_0x68ef('0x24')][_0x68ef('0x25')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x508671,_0x5005ba[_0x68ef('0x24')][_0x68ef('0x26')]);return _0x47fbb5(_0x5005ba[_0x68ef('0x24')]['message']);}logger[_0x68ef('0x24')](_0x68ef('0x21'),_0x508671,_0x5005ba[_0x68ef('0x24')]['message']);return _0x2657c5(_0x5005ba[_0x68ef('0x24')][_0x68ef('0x26')]);}else{logger['info'](_0x68ef('0x21'),_0x508671,_0x68ef('0x22'));_0x2657c5(_0x5005ba[_0x68ef('0x27')]['message']);}})['catch'](function(_0x59bebc){logger[_0x68ef('0x24')](_0x68ef('0x21'),_0x508671,_0x59bebc);_0x47fbb5(_0x59bebc);});});}function respondWithStatusCode(_0x312cc9,_0x2e6e39){_0x2e6e39=_0x2e6e39||0xcc;return function(_0x438b4c){if(_0x438b4c){return _0x312cc9[_0x68ef('0x28')](_0x2e6e39);}return _0x312cc9[_0x68ef('0x29')](_0x2e6e39)[_0x68ef('0x2a')]();};}function respondWithResult(_0x65fd09,_0x13280b){_0x13280b=_0x13280b||0xc8;return function(_0x5e4dbe){if(_0x5e4dbe){return _0x65fd09[_0x68ef('0x29')](_0x13280b)['json'](_0x5e4dbe);}};}function respondWithFilteredResult(_0x599243,_0x55d8b0){return function(_0x1a7ce1){if(_0x1a7ce1){var _0x268f32=typeof _0x55d8b0[_0x68ef('0x2b')]===_0x68ef('0x2c')&&typeof _0x55d8b0['limit']==='undefined';var _0x1cbe4f=_0x1a7ce1[_0x68ef('0x2d')];var _0x7bf96=_0x268f32?0x0:_0x55d8b0[_0x68ef('0x2b')];var _0x22ef25=_0x268f32?_0x1a7ce1[_0x68ef('0x2d')]:_0x55d8b0[_0x68ef('0x2b')]+_0x55d8b0[_0x68ef('0x2e')];var _0x5a6dfd;if(_0x22ef25>=_0x1cbe4f){_0x22ef25=_0x1cbe4f;_0x5a6dfd=0xc8;}else{_0x5a6dfd=0xce;}_0x599243[_0x68ef('0x29')](_0x5a6dfd);return _0x599243[_0x68ef('0x2f')](_0x68ef('0x30'),_0x7bf96+'-'+_0x22ef25+'/'+_0x1cbe4f)['json'](_0x1a7ce1);}return null;};}function patchUpdates(_0x370a8f){return function(_0x523120){try{jsonpatch[_0x68ef('0x31')](_0x523120,_0x370a8f,!![]);}catch(_0x17588a){return BPromise['reject'](_0x17588a);}return _0x523120['save']();};}function saveUpdates(_0x159395,_0x5fa72a){return function(_0x4b8fc8){if(_0x4b8fc8){return _0x4b8fc8[_0x68ef('0x32')](_0x159395)[_0x68ef('0x1f')](function(_0x2d67be){return _0x2d67be;});}return null;};}function removeEntity(_0x2d1e9f,_0x59e9fb){return function(_0x2c8bd0){if(_0x2c8bd0){return _0x2c8bd0[_0x68ef('0x33')]()['then'](function(){var _0x2f8de2=_0x2c8bd0['get']({'plain':!![]});var _0x14581d=_0x68ef('0x34');return db['UserProfileResource'][_0x68ef('0x33')]({'where':{'type':_0x14581d,'resourceId':_0x2f8de2['id']}})['then'](function(){return _0x2c8bd0;});})[_0x68ef('0x1f')](function(){_0x2d1e9f['status'](0xcc)[_0x68ef('0x2a')]();});}};}function handleEntityNotFound(_0x1444e0,_0x798276){return function(_0x569949){if(!_0x569949){_0x1444e0[_0x68ef('0x28')](0x194);}return _0x569949;};}function handleError(_0x485dc3,_0x476938){_0x476938=_0x476938||0x1f4;return function(_0x4c9506){logger[_0x68ef('0x24')](_0x4c9506[_0x68ef('0x35')]);if(_0x4c9506[_0x68ef('0x36')]){delete _0x4c9506[_0x68ef('0x36')];}_0x485dc3[_0x68ef('0x29')](_0x476938)[_0x68ef('0x37')](_0x4c9506);};}exports['index']=function(_0x294fba,_0x15a6ab){var _0x32074a={},_0x52a8b9={},_0x32eddd={'count':0x0,'rows':[]};var _0x3c5de6=_[_0x68ef('0x38')](db['Trunk']['rawAttributes'],function(_0x14f0fc){return{'name':_0x14f0fc[_0x68ef('0x39')],'type':_0x14f0fc[_0x68ef('0x3a')][_0x68ef('0x3b')]};});_0x52a8b9[_0x68ef('0x3c')]=_[_0x68ef('0x38')](_0x3c5de6,_0x68ef('0x36'));_0x52a8b9['query']=_[_0x68ef('0x3d')](_0x294fba[_0x68ef('0x3e')]);_0x52a8b9[_0x68ef('0x3f')]=_[_0x68ef('0x40')](_0x52a8b9['model'],_0x52a8b9[_0x68ef('0x3e')]);_0x32074a[_0x68ef('0x41')]=_[_0x68ef('0x40')](_0x52a8b9[_0x68ef('0x3c')],qs[_0x68ef('0x42')](_0x294fba[_0x68ef('0x3e')]['fields']));_0x32074a[_0x68ef('0x41')]=_0x32074a[_0x68ef('0x41')][_0x68ef('0x43')]?_0x32074a[_0x68ef('0x41')]:_0x52a8b9[_0x68ef('0x3c')];if(!_0x294fba[_0x68ef('0x3e')][_0x68ef('0x44')](_0x68ef('0x45'))){_0x32074a[_0x68ef('0x2e')]=qs['limit'](_0x294fba[_0x68ef('0x3e')][_0x68ef('0x2e')]);_0x32074a[_0x68ef('0x2b')]=qs[_0x68ef('0x2b')](_0x294fba[_0x68ef('0x3e')][_0x68ef('0x2b')]);}_0x32074a[_0x68ef('0x46')]=qs['sort'](_0x294fba[_0x68ef('0x3e')]['sort']);_0x32074a[_0x68ef('0x47')]=qs[_0x68ef('0x3f')](_[_0x68ef('0x48')](_0x294fba[_0x68ef('0x3e')],_0x52a8b9['filters']),_0x3c5de6);if(_0x294fba[_0x68ef('0x3e')]['filter']){_0x32074a[_0x68ef('0x47')]=_['merge'](_0x32074a[_0x68ef('0x47')],{'$or':_[_0x68ef('0x38')](_0x3c5de6,function(_0x105e8c){if(_0x105e8c['type']!=='VIRTUAL'){var _0x4044d5={};_0x4044d5[_0x105e8c[_0x68ef('0x36')]]={'$like':'%'+_0x294fba['query']['filter']+'%'};return _0x4044d5;}})});}_0x32074a=_['merge']({},_0x32074a,_0x294fba[_0x68ef('0x49')]);var _0x15c753={'where':_0x32074a[_0x68ef('0x47')]};return db[_0x68ef('0x4a')][_0x68ef('0x2d')](_0x15c753)['then'](function(_0x55f385){_0x32eddd[_0x68ef('0x2d')]=_0x55f385;if(_0x294fba[_0x68ef('0x3e')][_0x68ef('0x4b')]){_0x32074a[_0x68ef('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x68ef('0x4d')](_0x32074a);})[_0x68ef('0x1f')](function(_0x1c9b6f){_0x32eddd[_0x68ef('0x4e')]=_0x1c9b6f;return _0x32eddd;})['then'](respondWithFilteredResult(_0x15a6ab,_0x32074a))['catch'](handleError(_0x15a6ab,null));};exports[_0x68ef('0x4f')]=function(_0x3c3074,_0x566e7c){var _0xfc7a74={'raw':![],'where':{'id':_0x3c3074[_0x68ef('0x50')]['id']}},_0x12fff3={};_0x12fff3[_0x68ef('0x3c')]=_[_0x68ef('0x3d')](db['Trunk'][_0x68ef('0x51')]);_0x12fff3[_0x68ef('0x3e')]=_[_0x68ef('0x3d')](_0x3c3074['query']);_0x12fff3[_0x68ef('0x3f')]=_[_0x68ef('0x40')](_0x12fff3[_0x68ef('0x3c')],_0x12fff3['query']);_0xfc7a74[_0x68ef('0x41')]=_['intersection'](_0x12fff3['model'],qs[_0x68ef('0x42')](_0x3c3074['query'][_0x68ef('0x42')]));_0xfc7a74[_0x68ef('0x41')]=_0xfc7a74[_0x68ef('0x41')][_0x68ef('0x43')]?_0xfc7a74[_0x68ef('0x41')]:_0x12fff3[_0x68ef('0x3c')];if(_0x3c3074[_0x68ef('0x3e')][_0x68ef('0x4b')]){_0xfc7a74[_0x68ef('0x4c')]=[{'all':!![]}];}_0xfc7a74=_[_0x68ef('0x52')]({},_0xfc7a74,_0x3c3074['options']);return db['Trunk'][_0x68ef('0x53')](_0xfc7a74)[_0x68ef('0x1f')](handleEntityNotFound(_0x566e7c,null))[_0x68ef('0x1f')](respondWithResult(_0x566e7c,null))[_0x68ef('0x54')](handleError(_0x566e7c,null));};exports[_0x68ef('0x55')]=function(_0x1d11d7,_0x15400c){var _0x300a64={'where':{'id':_0x1d11d7['params']['id']}},_0x40c784={};_0x40c784['model']=_[_0x68ef('0x3d')](db['Trunk'][_0x68ef('0x51')]);_0x300a64['attributes']=_[_0x68ef('0x40')](_0x40c784[_0x68ef('0x3c')],qs['fields'](_0x1d11d7[_0x68ef('0x3e')]['fields']));_0x300a64[_0x68ef('0x41')]=_0x300a64[_0x68ef('0x41')][_0x68ef('0x43')]?_0x300a64[_0x68ef('0x41')]:_0x40c784[_0x68ef('0x3c')];if(_0x1d11d7[_0x68ef('0x3e')]['includeAll']){_0x300a64[_0x68ef('0x4c')]=[{'all':!![]}];}_0x300a64=_[_0x68ef('0x52')]({},_0x300a64,_0x1d11d7[_0x68ef('0x49')]);return db[_0x68ef('0x4a')][_0x68ef('0x53')](_0x300a64)[_0x68ef('0x1f')](handleEntityNotFound(_0x15400c,null))['then'](function(_0x9a978f){if(_0x9a978f){var _0x42d2a3=_0x9a978f['get']({'plain':!![]});_0x42d2a3=qs[_0x68ef('0x56')](_0x42d2a3,['id',_0x68ef('0x57'),_0x68ef('0x58')]);_0x1d11d7['body']=_[_0x68ef('0x56')](_0x1d11d7['body'],['id','createdAt',_0x68ef('0x58')]);return db['Trunk'][_0x68ef('0x59')](_['merge'](_0x42d2a3,_0x1d11d7[_0x68ef('0x5a')]),{'include':_0x1d11d7[_0x68ef('0x3e')][_0x68ef('0x4b')]?[{'all':!![]}]:undefined})[_0x68ef('0x1f')](function(_0x19ce17){var _0x19a9c4=_0x1d11d7['user'][_0x68ef('0x5b')]({'plain':!![]});if(!_0x19a9c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19a9c4[_0x68ef('0x5c')]==='user'){var _0x2f97c5=_0x19ce17[_0x68ef('0x5b')]({'plain':!![]});var _0x212ec4=_0x68ef('0x34');return db[_0x68ef('0x5d')][_0x68ef('0x53')]({'where':{'name':_0x212ec4,'userProfileId':_0x19a9c4[_0x68ef('0x5e')]},'raw':!![]})['then'](function(_0x3ea4e7){if(_0x3ea4e7&&_0x3ea4e7[_0x68ef('0x5f')]===0x0){return db[_0x68ef('0x60')][_0x68ef('0x59')]({'name':_0x2f97c5[_0x68ef('0x36')],'resourceId':_0x2f97c5['id'],'type':_0x3ea4e7['name'],'sectionId':_0x3ea4e7['id']},{})[_0x68ef('0x1f')](function(){return _0x19ce17;});}else{return _0x19ce17;}})['catch'](function(_0x1ed172){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ed172);throw _0x1ed172;});}return _0x19ce17;});}})[_0x68ef('0x1f')](respondWithResult(_0x15400c,0xc9))[_0x68ef('0x54')](handleError(_0x15400c,null));};exports[_0x68ef('0x59')]=function(_0x21b2ce,_0x51f905,_0x124b49){var _0x570e0c;return db[_0x68ef('0x4a')][_0x68ef('0x59')](_0x21b2ce[_0x68ef('0x5a')],{'raw':!![]})['then'](function(_0x541e35){_0x570e0c=_0x541e35;return db[_0x68ef('0x4a')][_0x68ef('0x4d')]({'raw':!![]});})[_0x68ef('0x1f')](function(_0x454c6f){var _0x5b41e1=fs[_0x68ef('0x61')](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x64')),'utf8');var _0x3f56a7=fs['readFileSync'](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x65')),_0x68ef('0x66'));var _0xed16d1=ejs['render'](_0x5b41e1,{'trunks':_0x454c6f||[]});fs[_0x68ef('0x67')](_0x68ef('0x68'),_0xed16d1);if(_0x570e0c[_0x68ef('0x69')]){var _0x595e79=ejs[_0x68ef('0x6a')](_0x3f56a7,{'trunks':_0x454c6f||[]});fs['writeFileSync'](_0x68ef('0x6b'),_0x595e79);}})['then'](function(){return respondWithRpcPromise('Reload',_0x68ef('0x59'),{'module':_0x68ef('0x6c')});})[_0x68ef('0x1f')](function(){var _0x405971=_0x21b2ce['user'][_0x68ef('0x5b')]({'plain':!![]});if(!_0x405971)throw new Error(_0x68ef('0x6d'));if(_0x405971[_0x68ef('0x5c')]==='user'){var _0x3e14a4=_0x570e0c[_0x68ef('0x5b')]({'plain':!![]});return db[_0x68ef('0x5d')][_0x68ef('0x53')]({'where':{'name':_0x68ef('0x34'),'userProfileId':_0x405971[_0x68ef('0x5e')]},'raw':!![]})[_0x68ef('0x1f')](function(_0xfe72dc){if(_0xfe72dc&&_0xfe72dc[_0x68ef('0x5f')]===0x0){return db[_0x68ef('0x60')][_0x68ef('0x59')]({'name':_0x3e14a4[_0x68ef('0x36')],'resourceId':_0x3e14a4['id'],'type':_0xfe72dc['name'],'sectionId':_0xfe72dc['id']},{})[_0x68ef('0x1f')](function(){return _0x570e0c;});}else{return _0x570e0c;}})[_0x68ef('0x54')](function(_0x5db443){logger['error'](_0x68ef('0x6e'),_0x5db443);throw _0x5db443;});}return _0x570e0c;})['then'](respondWithResult(_0x51f905,0xc9))[_0x68ef('0x54')](handleError(_0x51f905,null));};exports[_0x68ef('0x32')]=function(_0x5f1b12,_0x4e0874,_0x31a336){var _0x5c500c;return db[_0x68ef('0x4a')]['find']({'where':{'id':_0x5f1b12[_0x68ef('0x50')]['id']}})['then'](handleEntityNotFound(_0x4e0874,null))[_0x68ef('0x1f')](saveUpdates(_0x5f1b12[_0x68ef('0x5a')],null))['then'](function(_0x3c5e35){if(_0x3c5e35){_0x5c500c=_0x3c5e35;return db[_0x68ef('0x4a')][_0x68ef('0x4d')]({'raw':!![]});}})[_0x68ef('0x1f')](function(_0x50c308){if(_0x50c308){var _0x2bebdc=fs[_0x68ef('0x61')](path['join'](config[_0x68ef('0x63')],_0x68ef('0x64')),_0x68ef('0x66'));var _0x4de1d1=fs[_0x68ef('0x61')](path['join'](config[_0x68ef('0x63')],_0x68ef('0x65')),'utf8');var _0x4b0fb4=ejs['render'](_0x2bebdc,{'trunks':_0x50c308||[]});fs['writeFileSync'](_0x68ef('0x68'),_0x4b0fb4);var _0x28ad22=ejs[_0x68ef('0x6a')](_0x4de1d1,{'trunks':_0x50c308||[]});fs[_0x68ef('0x67')](_0x68ef('0x6b'),_0x28ad22);return respondWithRpcPromise(_0x68ef('0x6f'),_0x68ef('0x32'),{'module':_0x68ef('0x6c')});}return null;})[_0x68ef('0x1f')](function(_0x3ae3e9){if(_0x3ae3e9){return _0x5c500c;}})[_0x68ef('0x1f')](respondWithResult(_0x4e0874,null))[_0x68ef('0x54')](handleError(_0x4e0874,null));};exports[_0x68ef('0x33')]=function(_0x4bd5c3,_0x2b20dc,_0x556dfc){var _0x791181;return db['Trunk']['find']({'where':{'id':_0x4bd5c3[_0x68ef('0x50')]['id']}})[_0x68ef('0x1f')](handleEntityNotFound(_0x2b20dc,null))[_0x68ef('0x1f')](removeEntity(_0x2b20dc,null))[_0x68ef('0x1f')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x68ef('0x1f')](function(_0x308997){var _0x1f1dfd=fs['readFileSync'](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x64')),_0x68ef('0x66'));var _0x4dc885=fs[_0x68ef('0x61')](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x65')),_0x68ef('0x66'));var _0x346049=ejs['render'](_0x1f1dfd,{'trunks':_0x308997});var _0x2a72e8=ejs['render'](_0x4dc885,{'trunks':_0x308997});fs[_0x68ef('0x67')](_0x68ef('0x68'),_0x346049);fs[_0x68ef('0x67')](_0x68ef('0x6b'),_0x2a72e8);return respondWithRpcPromise('Reload',_0x68ef('0x33'),{'module':'chan_sip.so'});})[_0x68ef('0x54')](handleError(_0x2b20dc,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 542f90e..4fbfad9 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 _0x92d9=['moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0x92d9,0xcc));var _0x992d=function(_0x2fa633,_0x33d3d8){_0x2fa633=_0x2fa633-0x0;var _0x11fd06=_0x92d9[_0x2fa633];return _0x11fd06;};'use strict';var _=require(_0x992d('0x0'));var util=require(_0x992d('0x1'));var logger=require(_0x992d('0x2'))(_0x992d('0x3'));var moment=require(_0x992d('0x4'));var BPromise=require(_0x992d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x992d('0x6'));var rimraf=require(_0x992d('0x7'));var config=require(_0x992d('0x8'));var attributes=require(_0x992d('0x9'));module[_0x992d('0xa')]=function(_0x3fd5a8,_0x1fe16c){return _0x3fd5a8[_0x992d('0xb')]('Trunk',attributes,{'tableName':_0x992d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff44=['util','api','request-promise','rimraf','./trunk.attributes','exports','Trunk','tools_trunks','lodash'];(function(_0x11a7f3,_0x299f5a){var _0x3d2054=function(_0x57f4bf){while(--_0x57f4bf){_0x11a7f3['push'](_0x11a7f3['shift']());}};_0x3d2054(++_0x299f5a);}(_0xff44,0x182));var _0x4ff4=function(_0x234d56,_0x4eee01){_0x234d56=_0x234d56-0x0;var _0xd47811=_0xff44[_0x234d56];return _0xd47811;};'use strict';var _=require(_0x4ff4('0x0'));var util=require(_0x4ff4('0x1'));var logger=require('../../config/logger')(_0x4ff4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4ff4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ff4('0x4'));var config=require('../../config/environment');var attributes=require(_0x4ff4('0x5'));module[_0x4ff4('0x6')]=function(_0x273b81,_0x2e1749){return _0x273b81['define'](_0x4ff4('0x7'),attributes,{'tableName':_0x4ff4('0x8'),'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 c12c0f1..c23caf3 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 _0x8ca1=['map','model','info','GetTrunk','stringify','catch','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','Trunk','options','raw','where','attributes','limit','include'];(function(_0x44f44b,_0x227d5d){var _0x3d1663=function(_0x4ee2ed){while(--_0x4ee2ed){_0x44f44b['push'](_0x44f44b['shift']());}};_0x3d1663(++_0x227d5d);}(_0x8ca1,0x138));var _0x18ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8ca1[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x18ca('0x0'));var util=require(_0x18ca('0x1'));var moment=require(_0x18ca('0x2'));var BPromise=require(_0x18ca('0x3'));var rs=require(_0x18ca('0x4'));var fs=require('fs');var Redis=require(_0x18ca('0x5'));var db=require(_0x18ca('0x6'))['db'];var utils=require(_0x18ca('0x7'));var logger=require(_0x18ca('0x8'))('rpc');var config=require(_0x18ca('0x9'));var jayson=require(_0x18ca('0xa'));var client=jayson[_0x18ca('0xb')][_0x18ca('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x490c32,_0x4797a3,_0x291e58){return new BPromise(function(_0x3892c0,_0x292eec){return client[_0x18ca('0xd')](_0x490c32,_0x291e58)[_0x18ca('0xe')](function(_0x2bf4ec){logger['info'](_0x18ca('0xf'),_0x4797a3,'request\x20sent');logger[_0x18ca('0x10')](_0x18ca('0x11'),_0x4797a3,_0x18ca('0x12'),JSON['stringify'](_0x2bf4ec));if(_0x2bf4ec['error']){if(_0x2bf4ec['error'][_0x18ca('0x13')]===0x1f4){logger[_0x18ca('0x14')](_0x18ca('0xf'),_0x4797a3,_0x2bf4ec[_0x18ca('0x14')][_0x18ca('0x15')]);return _0x292eec(_0x2bf4ec[_0x18ca('0x14')][_0x18ca('0x15')]);}logger[_0x18ca('0x14')]('Trunk,\x20%s,\x20%s',_0x4797a3,_0x2bf4ec[_0x18ca('0x14')][_0x18ca('0x15')]);return _0x3892c0(_0x2bf4ec[_0x18ca('0x14')][_0x18ca('0x15')]);}else{logger['info'](_0x18ca('0xf'),_0x4797a3,_0x18ca('0x12'));_0x3892c0(_0x2bf4ec[_0x18ca('0x16')][_0x18ca('0x15')]);}})['catch'](function(_0x880399){logger[_0x18ca('0x14')](_0x18ca('0xf'),_0x4797a3,_0x880399);_0x292eec(_0x880399);});});}exports['GetTrunk']=function(_0xd3e498){var _0x3c6367=this;return new Promise(function(_0x46dc5a,_0x1acb83){return db[_0x18ca('0x17')]['findAll']({'raw':_0xd3e498[_0x18ca('0x18')]?_0xd3e498[_0x18ca('0x18')][_0x18ca('0x19')]===undefined?!![]:![]:!![],'where':_0xd3e498[_0x18ca('0x18')]?_0xd3e498[_0x18ca('0x18')][_0x18ca('0x1a')]||null:null,'attributes':_0xd3e498[_0x18ca('0x18')]?_0xd3e498[_0x18ca('0x18')][_0x18ca('0x1b')]||null:null,'limit':_0xd3e498[_0x18ca('0x18')]?_0xd3e498['options'][_0x18ca('0x1c')]||null:null,'include':_0xd3e498[_0x18ca('0x18')]?_0xd3e498[_0x18ca('0x18')][_0x18ca('0x1d')]?_[_0x18ca('0x1e')](_0xd3e498['options'][_0x18ca('0x1d')],function(_0x35fcd2){return{'model':db[_0x35fcd2[_0x18ca('0x1f')]],'as':_0x35fcd2['as'],'attributes':_0x35fcd2[_0x18ca('0x1b')],'include':_0x35fcd2['include']?_['map'](_0x35fcd2[_0x18ca('0x1d')],function(_0x491c42){return{'model':db[_0x491c42[_0x18ca('0x1f')]],'as':_0x491c42['as'],'attributes':_0x491c42[_0x18ca('0x1b')],'include':_0x491c42[_0x18ca('0x1d')]?_[_0x18ca('0x1e')](_0x491c42['include'],function(_0x5d3f52){return{'model':db[_0x5d3f52['model']],'as':_0x5d3f52['as'],'attributes':_0x5d3f52[_0x18ca('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x18ca('0xe')](function(_0x55450f){logger[_0x18ca('0x20')](_0x18ca('0x21'),_0xd3e498);logger[_0x18ca('0x10')](_0x18ca('0x21'),_0xd3e498,JSON[_0x18ca('0x22')](_0x55450f));_0x46dc5a(_0x55450f);})[_0x18ca('0x23')](function(_0xd4478d){logger[_0x18ca('0x14')](_0x18ca('0x21'),_0xd4478d[_0x18ca('0x15')],_0xd3e498);_0x1acb83(_0x3c6367[_0x18ca('0x14')](0x1f4,_0xd4478d[_0x18ca('0x15')]));});});};exports[_0x18ca('0x24')]=function(_0x5e3671){var _0x5a1ff6=this;return new Promise(function(_0x17e4d4,_0x5d11d4){return db[_0x18ca('0x17')][_0x18ca('0x25')]({'raw':_0x5e3671[_0x18ca('0x18')]?_0x5e3671['options']['raw']===undefined?!![]:![]:!![],'where':_0x5e3671['options']?_0x5e3671[_0x18ca('0x18')]['where']||null:null,'attributes':_0x5e3671[_0x18ca('0x18')]?_0x5e3671[_0x18ca('0x18')][_0x18ca('0x1b')]||null:null,'include':_0x5e3671[_0x18ca('0x18')]?_0x5e3671['options'][_0x18ca('0x1d')]?_[_0x18ca('0x1e')](_0x5e3671[_0x18ca('0x18')][_0x18ca('0x1d')],function(_0x1718df){return{'model':db[_0x1718df['model']],'as':_0x1718df['as'],'attributes':_0x1718df['attributes'],'include':_0x1718df[_0x18ca('0x1d')]?_[_0x18ca('0x1e')](_0x1718df[_0x18ca('0x1d')],function(_0x3084ad){return{'model':db[_0x3084ad[_0x18ca('0x1f')]],'as':_0x3084ad['as'],'attributes':_0x3084ad['attributes'],'include':_0x3084ad[_0x18ca('0x1d')]?_[_0x18ca('0x1e')](_0x3084ad[_0x18ca('0x1d')],function(_0x186cb3){return{'model':db[_0x186cb3['model']],'as':_0x186cb3['as'],'attributes':_0x186cb3[_0x18ca('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x18ca('0xe')](function(_0x5542ec){logger['info'](_0x18ca('0x24'),_0x5e3671);logger[_0x18ca('0x10')]('ShowTrunk',_0x5e3671,JSON[_0x18ca('0x22')](_0x5542ec));_0x17e4d4(_0x5542ec);})[_0x18ca('0x23')](function(_0x5c2fa6){logger['error'](_0x18ca('0x24'),_0x5c2fa6[_0x18ca('0x15')],_0x5e3671);_0x5d11d4(_0x5a1ff6['error'](0x1f4,_0x5c2fa6[_0x18ca('0x15')]));});});}; \ No newline at end of file +var _0x7515=['jayson/promise','client','request','then','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','find','debug','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x49c27c,_0x3fa21b){var _0x392bf5=function(_0x279aad){while(--_0x279aad){_0x49c27c['push'](_0x49c27c['shift']());}};_0x392bf5(++_0x3fa21b);}(_0x7515,0x82));var _0x5751=function(_0xaff290,_0x2ab600){_0xaff290=_0xaff290-0x0;var _0x476e68=_0x7515[_0xaff290];return _0x476e68;};'use strict';var _=require('lodash');var util=require(_0x5751('0x0'));var moment=require('moment');var BPromise=require(_0x5751('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5751('0x2'));var db=require(_0x5751('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5751('0x4'));var config=require(_0x5751('0x5'));var jayson=require(_0x5751('0x6'));var client=jayson[_0x5751('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x158b1d,_0x20b706,_0x1145ae){return new BPromise(function(_0x37e673,_0x5f02d7){return client[_0x5751('0x8')](_0x158b1d,_0x1145ae)[_0x5751('0x9')](function(_0x14b155){logger['info']('Trunk,\x20%s,\x20%s',_0x20b706,'request\x20sent');logger['debug'](_0x5751('0xa'),_0x20b706,_0x5751('0xb'),JSON[_0x5751('0xc')](_0x14b155));if(_0x14b155['error']){if(_0x14b155[_0x5751('0xd')][_0x5751('0xe')]===0x1f4){logger[_0x5751('0xd')](_0x5751('0xf'),_0x20b706,_0x14b155['error'][_0x5751('0x10')]);return _0x5f02d7(_0x14b155[_0x5751('0xd')][_0x5751('0x10')]);}logger['error'](_0x5751('0xf'),_0x20b706,_0x14b155[_0x5751('0xd')][_0x5751('0x10')]);return _0x37e673(_0x14b155['error']['message']);}else{logger[_0x5751('0x11')]('Trunk,\x20%s,\x20%s',_0x20b706,_0x5751('0xb'));_0x37e673(_0x14b155[_0x5751('0x12')][_0x5751('0x10')]);}})[_0x5751('0x13')](function(_0x19952a){logger[_0x5751('0xd')]('Trunk,\x20%s,\x20%s',_0x20b706,_0x19952a);_0x5f02d7(_0x19952a);});});}exports[_0x5751('0x14')]=function(_0x3219be){var _0x5961af=this;return new Promise(function(_0x2a600d,_0xc4dd3a){return db[_0x5751('0x15')][_0x5751('0x16')]({'raw':_0x3219be[_0x5751('0x17')]?_0x3219be[_0x5751('0x17')][_0x5751('0x18')]===undefined?!![]:![]:!![],'where':_0x3219be[_0x5751('0x17')]?_0x3219be[_0x5751('0x17')][_0x5751('0x19')]||null:null,'attributes':_0x3219be['options']?_0x3219be[_0x5751('0x17')][_0x5751('0x1a')]||null:null,'limit':_0x3219be['options']?_0x3219be[_0x5751('0x17')][_0x5751('0x1b')]||null:null,'include':_0x3219be[_0x5751('0x17')]?_0x3219be[_0x5751('0x17')][_0x5751('0x1c')]?_[_0x5751('0x1d')](_0x3219be[_0x5751('0x17')][_0x5751('0x1c')],function(_0xc47772){return{'model':db[_0xc47772['model']],'as':_0xc47772['as'],'attributes':_0xc47772[_0x5751('0x1a')],'include':_0xc47772[_0x5751('0x1c')]?_[_0x5751('0x1d')](_0xc47772[_0x5751('0x1c')],function(_0x469158){return{'model':db[_0x469158[_0x5751('0x1e')]],'as':_0x469158['as'],'attributes':_0x469158[_0x5751('0x1a')],'include':_0x469158[_0x5751('0x1c')]?_[_0x5751('0x1d')](_0x469158[_0x5751('0x1c')],function(_0xc07dc3){return{'model':db[_0xc07dc3['model']],'as':_0xc07dc3['as'],'attributes':_0xc07dc3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x268b02){logger[_0x5751('0x11')](_0x5751('0x14'),_0x3219be);logger['debug'](_0x5751('0x14'),_0x3219be,JSON['stringify'](_0x268b02));_0x2a600d(_0x268b02);})['catch'](function(_0x463d61){logger[_0x5751('0xd')](_0x5751('0x14'),_0x463d61[_0x5751('0x10')],_0x3219be);_0xc4dd3a(_0x5961af[_0x5751('0xd')](0x1f4,_0x463d61[_0x5751('0x10')]));});});};exports[_0x5751('0x1f')]=function(_0x436728){var _0x529424=this;return new Promise(function(_0x3cc3ee,_0x27b5b5){return db[_0x5751('0x15')][_0x5751('0x20')]({'raw':_0x436728[_0x5751('0x17')]?_0x436728[_0x5751('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x436728[_0x5751('0x17')]?_0x436728[_0x5751('0x17')][_0x5751('0x19')]||null:null,'attributes':_0x436728[_0x5751('0x17')]?_0x436728[_0x5751('0x17')]['attributes']||null:null,'include':_0x436728[_0x5751('0x17')]?_0x436728[_0x5751('0x17')][_0x5751('0x1c')]?_['map'](_0x436728[_0x5751('0x17')][_0x5751('0x1c')],function(_0x38b352){return{'model':db[_0x38b352[_0x5751('0x1e')]],'as':_0x38b352['as'],'attributes':_0x38b352['attributes'],'include':_0x38b352[_0x5751('0x1c')]?_['map'](_0x38b352['include'],function(_0x25e9fd){return{'model':db[_0x25e9fd['model']],'as':_0x25e9fd['as'],'attributes':_0x25e9fd['attributes'],'include':_0x25e9fd[_0x5751('0x1c')]?_[_0x5751('0x1d')](_0x25e9fd[_0x5751('0x1c')],function(_0x5da9a3){return{'model':db[_0x5da9a3[_0x5751('0x1e')]],'as':_0x5da9a3['as'],'attributes':_0x5da9a3[_0x5751('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58fede){logger[_0x5751('0x11')]('ShowTrunk',_0x436728);logger[_0x5751('0x21')]('ShowTrunk',_0x436728,JSON[_0x5751('0xc')](_0x58fede));_0x3cc3ee(_0x58fede);})[_0x5751('0x13')](function(_0x30570a){logger['error'](_0x5751('0x1f'),_0x30570a[_0x5751('0x10')],_0x436728);_0x27b5b5(_0x529424[_0x5751('0xd')](0x1f4,_0x30570a[_0x5751('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index cfc2993..d90b63a 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 _0x7bbd=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','index','/whoami','isAuthenticated','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','addContacts','post','create','/create_many','addQueues','join','root','server/files/images/','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','put','changePassword','delete','removeQueues','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','path'];(function(_0x2b871b,_0x2ced5d){var _0x36918b=function(_0x101552){while(--_0x101552){_0x2b871b['push'](_0x2b871b['shift']());}};_0x36918b(++_0x2ced5d);}(_0x7bbd,0x73));var _0xd7bb=function(_0x3a3fd2,_0x2fb9ac){_0x3a3fd2=_0x3a3fd2-0x0;var _0x32e355=_0x7bbd[_0x3a3fd2];return _0x32e355;};'use strict';var multer=require(_0xd7bb('0x0'));var util=require(_0xd7bb('0x1'));var path=require(_0xd7bb('0x2'));var timeout=require(_0xd7bb('0x3'));var express=require(_0xd7bb('0x4'));var router=express[_0xd7bb('0x5')]();var fs_extra=require(_0xd7bb('0x6'));var auth=require(_0xd7bb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd7bb('0x8'));var controller=require(_0xd7bb('0x9'));router[_0xd7bb('0xa')]('/',auth['isAuthenticated'](),controller[_0xd7bb('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd7bb('0xa')](_0xd7bb('0xc'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0xe')]);router[_0xd7bb('0xa')](_0xd7bb('0xf'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x10')]);router[_0xd7bb('0xa')](_0xd7bb('0x11'),auth['isAuthenticated'](),controller[_0xd7bb('0x12')]);router[_0xd7bb('0xa')](_0xd7bb('0x13'),controller[_0xd7bb('0x14')]);router[_0xd7bb('0xa')](_0xd7bb('0x15'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x16')]);router[_0xd7bb('0xa')](_0xd7bb('0x17'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x18')]);router['get'](_0xd7bb('0x19'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x1a')]);router['get'](_0xd7bb('0x1b'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x1c')]);router[_0xd7bb('0xa')](_0xd7bb('0x1d'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x1e')]);router[_0xd7bb('0xa')](_0xd7bb('0x1f'),auth[_0xd7bb('0xd')](),controller['getRecordings']);router[_0xd7bb('0xa')](_0xd7bb('0x20'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x21')]);router[_0xd7bb('0xa')](_0xd7bb('0x22'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x23')]);router[_0xd7bb('0xa')](_0xd7bb('0x24'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0xd7bb('0xa')]('/:id/mail/interactions',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x25')]);router['get']('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0xd7bb('0x26')]);router[_0xd7bb('0xa')](_0xd7bb('0x27'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x28')]);router['get'](_0xd7bb('0x29'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x2a')]);router[_0xd7bb('0xa')](_0xd7bb('0x2b'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x2c')]);router[_0xd7bb('0xa')](_0xd7bb('0x2d'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x2e')]);router[_0xd7bb('0xa')]('/:id/agents',auth['isAuthenticated'](),controller['getAgents']);router[_0xd7bb('0xa')]('/:id/prefixes',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x2f')]);router[_0xd7bb('0xa')](_0xd7bb('0x30'),auth[_0xd7bb('0xd')](),controller['getFaxAccounts']);router[_0xd7bb('0xa')](_0xd7bb('0x31'),auth['isAuthenticated'](),controller[_0xd7bb('0x32')]);router[_0xd7bb('0xa')](_0xd7bb('0x33'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x34')]);router[_0xd7bb('0xa')](_0xd7bb('0x35'),auth['isAuthenticated'](),controller[_0xd7bb('0x36')]);router[_0xd7bb('0xa')]('/:id/chat_websites',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x37')]);router[_0xd7bb('0xa')](_0xd7bb('0x38'),auth['isAuthenticated'](),controller[_0xd7bb('0x39')]);router[_0xd7bb('0xa')](_0xd7bb('0x3a'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x3b')]);router[_0xd7bb('0xa')](_0xd7bb('0x3c'),auth['isAuthenticated'](),controller[_0xd7bb('0x3d')]);router['get']('/:id/api_key',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x3e')]);router['post']('/:id/contacts',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x3f')]);router[_0xd7bb('0x40')]('/',auth['isAuthenticated'](),controller[_0xd7bb('0x41')]);router[_0xd7bb('0x40')](_0xd7bb('0x42'),auth[_0xd7bb('0xd')](),controller['bulkCreate']);router['post']('/:id/queues',auth['isAuthenticated'](),controller[_0xd7bb('0x43')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa1b17c,_0x47a131,_0x2c9522){_0x2c9522(null,path[_0xd7bb('0x44')](config[_0xd7bb('0x45')],_0xd7bb('0x46')));},'filename':function(_0x5b4309,_0x24cf38,_0x3a0967){_0x3a0967(null,util['format'](_0xd7bb('0x47'),Date[_0xd7bb('0x48')](),_0x24cf38[_0xd7bb('0x49')]));}})});router[_0xd7bb('0x40')](_0xd7bb('0x13'),upload[_0xd7bb('0x4a')](_0xd7bb('0x4b')),controller[_0xd7bb('0x4c')]);router['post'](_0xd7bb('0x4d'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x4e')]);router[_0xd7bb('0x40')](_0xd7bb('0x4f'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x50')]);router[_0xd7bb('0x40')]('/:id/pause',auth[_0xd7bb('0xd')](),controller['pause']);router[_0xd7bb('0x40')](_0xd7bb('0x51'),auth['isAuthenticated'](),controller['unpause']);router[_0xd7bb('0x40')]('/:id/teams',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x52')]);router['post'](_0xd7bb('0x53'),auth['isAuthenticated'](),controller[_0xd7bb('0x54')]);router[_0xd7bb('0x40')](_0xd7bb('0x55'),auth['isAuthenticated'](),controller[_0xd7bb('0x56')]);router[_0xd7bb('0x40')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xd7bb('0x57')]);router[_0xd7bb('0x40')](_0xd7bb('0x58'),auth[_0xd7bb('0xd')](),controller['addSmsInteractions']);router[_0xd7bb('0x40')](_0xd7bb('0x59'),auth['isAuthenticated'](),controller[_0xd7bb('0x5a')]);router['post']('/:id/whatsapp_interactions',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x5b')]);router[_0xd7bb('0x40')](_0xd7bb('0x30'),auth['isAuthenticated'](),controller[_0xd7bb('0x5c')]);router[_0xd7bb('0x40')]('/:id/mail_accounts',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x5d')]);router['post'](_0xd7bb('0x33'),auth['isAuthenticated'](),controller[_0xd7bb('0x5e')]);router[_0xd7bb('0x40')](_0xd7bb('0x35'),auth[_0xd7bb('0xd')](),controller['addSmsAccounts']);router['post'](_0xd7bb('0x5f'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x60')]);router[_0xd7bb('0x40')](_0xd7bb('0x38'),auth['isAuthenticated'](),controller[_0xd7bb('0x61')]);router[_0xd7bb('0x40')](_0xd7bb('0x3a'),auth[_0xd7bb('0xd')](),controller['addSquareProjects']);router[_0xd7bb('0x40')](_0xd7bb('0x62'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x63')]);router[_0xd7bb('0x64')](_0xd7bb('0x11'),auth[_0xd7bb('0xd')](),controller['update']);router[_0xd7bb('0x64')]('/:id/password',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x65')]);router[_0xd7bb('0x66')]('/:id/queues',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x67')]);router[_0xd7bb('0x66')](_0xd7bb('0x2b'),auth[_0xd7bb('0xd')](),controller['removeTeams']);router[_0xd7bb('0x66')](_0xd7bb('0x11'),auth[_0xd7bb('0xd')](),controller['destroy']);router['delete'](_0xd7bb('0x53'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x68')]);router[_0xd7bb('0x66')]('/:id/mail_interactions',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x69')]);router[_0xd7bb('0x66')](_0xd7bb('0x6a'),auth[_0xd7bb('0xd')](),controller['removeFaxInteractions']);router[_0xd7bb('0x66')](_0xd7bb('0x58'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x6b')]);router[_0xd7bb('0x66')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0xd7bb('0x6c')]);router[_0xd7bb('0x66')]('/:id/whatsapp_interactions',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x6d')]);router[_0xd7bb('0x66')](_0xd7bb('0x30'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x6e')]);router[_0xd7bb('0x66')](_0xd7bb('0x31'),auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x6f')]);router[_0xd7bb('0x66')]('/:id/openchannel_accounts',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x70')]);router[_0xd7bb('0x66')]('/:id/sms_accounts',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x71')]);router[_0xd7bb('0x66')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xd7bb('0x72')]);router[_0xd7bb('0x66')]('/:id/whatsapp_accounts',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x73')]);router[_0xd7bb('0x66')]('/:id/square_projects',auth[_0xd7bb('0xd')](),controller[_0xd7bb('0x74')]);router[_0xd7bb('0x66')](_0xd7bb('0x62'),auth['isAuthenticated'](),controller['removeApiKey']);module[_0xd7bb('0x75')]=router; \ No newline at end of file +var _0x7dac=['/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/:id/contacts','addContacts','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','format','now','originalname','single','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/openchannel_accounts','/:id/sms_accounts','addSmsAccounts','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','whoami','getPresence','/:id','/:id/avatar','getAvatar','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects'];(function(_0x12e9de,_0x30269d){var _0x3017d2=function(_0x37b27e){while(--_0x37b27e){_0x12e9de['push'](_0x12e9de['shift']());}};_0x3017d2(++_0x30269d);}(_0x7dac,0x126));var _0xc7da=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7dac[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xc7da('0x0'));var util=require(_0xc7da('0x1'));var path=require('path');var timeout=require(_0xc7da('0x2'));var express=require(_0xc7da('0x3'));var router=express[_0xc7da('0x4')]();var fs_extra=require(_0xc7da('0x5'));var auth=require(_0xc7da('0x6'));var interaction=require(_0xc7da('0x7'));var config=require(_0xc7da('0x8'));var controller=require(_0xc7da('0x9'));router[_0xc7da('0xa')]('/',auth[_0xc7da('0xb')](),controller['index']);router[_0xc7da('0xa')](_0xc7da('0xc'),auth[_0xc7da('0xb')](),controller[_0xc7da('0xd')]);router['get']('/whoami',auth['isAuthenticated'](),controller[_0xc7da('0xe')]);router[_0xc7da('0xa')]('/presence',auth[_0xc7da('0xb')](),controller[_0xc7da('0xf')]);router['get'](_0xc7da('0x10'),auth['isAuthenticated'](),controller['show']);router[_0xc7da('0xa')](_0xc7da('0x11'),controller[_0xc7da('0x12')]);router['get']('/:id/open_tabs',auth[_0xc7da('0xb')](),controller['getOpenTabs']);router[_0xc7da('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xc7da('0x13')]);router[_0xc7da('0xa')]('/:id/queues',auth[_0xc7da('0xb')](),controller[_0xc7da('0x14')]);router[_0xc7da('0xa')](_0xc7da('0x15'),auth['isAuthenticated'](),controller[_0xc7da('0x16')]);router[_0xc7da('0xa')](_0xc7da('0x17'),auth['isAuthenticated'](),controller[_0xc7da('0x18')]);router[_0xc7da('0xa')](_0xc7da('0x19'),auth['isAuthenticated'](),controller[_0xc7da('0x1a')]);router[_0xc7da('0xa')](_0xc7da('0x1b'),auth['isAuthenticated'](),controller[_0xc7da('0x1c')]);router[_0xc7da('0xa')](_0xc7da('0x1d'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x1e')]);router[_0xc7da('0xa')]('/:id/openchannel/interactions',auth[_0xc7da('0xb')](),controller[_0xc7da('0x1f')]);router[_0xc7da('0xa')](_0xc7da('0x20'),auth['isAuthenticated'](),controller['getMailInteractions']);router['get'](_0xc7da('0x21'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x22')]);router[_0xc7da('0xa')](_0xc7da('0x23'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x24')]);router[_0xc7da('0xa')](_0xc7da('0x25'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x26')]);router[_0xc7da('0xa')](_0xc7da('0x27'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x28')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router['get'](_0xc7da('0x29'),auth[_0xc7da('0xb')](),controller['getAgents']);router[_0xc7da('0xa')](_0xc7da('0x2a'),auth['isAuthenticated'](),controller[_0xc7da('0x2b')]);router['get'](_0xc7da('0x2c'),auth['isAuthenticated'](),controller[_0xc7da('0x2d')]);router['get'](_0xc7da('0x2e'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0xc7da('0xa')]('/:id/openchannel_accounts',auth[_0xc7da('0xb')](),controller[_0xc7da('0x2f')]);router[_0xc7da('0xa')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xc7da('0x30')]);router['get'](_0xc7da('0x31'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x32')]);router[_0xc7da('0xa')](_0xc7da('0x33'),auth[_0xc7da('0xb')](),controller['getWhatsappAccounts']);router[_0xc7da('0xa')](_0xc7da('0x34'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x35')]);router[_0xc7da('0xa')](_0xc7da('0x36'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x37')]);router['get']('/:id/api_key',auth[_0xc7da('0xb')](),controller[_0xc7da('0x38')]);router[_0xc7da('0x39')](_0xc7da('0x3a'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x3b')]);router['post']('/',auth[_0xc7da('0xb')](),controller['create']);router[_0xc7da('0x39')](_0xc7da('0x3c'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x3d')]);router[_0xc7da('0x39')](_0xc7da('0x3e'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x3f')]);var upload=multer({'storage':multer[_0xc7da('0x40')]({'destination':function(_0x58f61d,_0x1659f0,_0x10a3f2){_0x10a3f2(null,path[_0xc7da('0x41')](config['root'],'server/files/images/'));},'filename':function(_0x22bbb8,_0x36bef1,_0x17cc54){_0x17cc54(null,util[_0xc7da('0x42')]('%s-%s',Date[_0xc7da('0x43')](),_0x36bef1[_0xc7da('0x44')]));}})});router[_0xc7da('0x39')]('/:id/avatar',upload[_0xc7da('0x45')]('file'),controller[_0xc7da('0x46')]);router[_0xc7da('0x39')](_0xc7da('0x47'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x48')]);router['post']('/:id/logout',auth[_0xc7da('0xb')](),controller[_0xc7da('0x49')]);router[_0xc7da('0x39')](_0xc7da('0x4a'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x4b')]);router[_0xc7da('0x39')](_0xc7da('0x4c'),auth['isAuthenticated'](),controller['unpause']);router[_0xc7da('0x39')](_0xc7da('0x27'),auth[_0xc7da('0xb')](),controller['addTeams']);router['post'](_0xc7da('0x4d'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x4e')]);router[_0xc7da('0x39')](_0xc7da('0x4f'),auth['isAuthenticated'](),controller[_0xc7da('0x50')]);router[_0xc7da('0x39')](_0xc7da('0x51'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x52')]);router[_0xc7da('0x39')](_0xc7da('0x53'),auth['isAuthenticated'](),controller[_0xc7da('0x54')]);router['post'](_0xc7da('0x55'),auth[_0xc7da('0xb')](),controller['addOpenchannelInteractions']);router[_0xc7da('0x39')](_0xc7da('0x56'),auth['isAuthenticated'](),controller[_0xc7da('0x57')]);router[_0xc7da('0x39')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xc7da('0x58')]);router[_0xc7da('0x39')](_0xc7da('0x2e'),auth[_0xc7da('0xb')](),controller['addMailAccounts']);router[_0xc7da('0x39')](_0xc7da('0x59'),auth[_0xc7da('0xb')](),controller['addOpenchannelAccounts']);router[_0xc7da('0x39')](_0xc7da('0x5a'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x5b')]);router[_0xc7da('0x39')]('/:id/chat_websites',auth[_0xc7da('0xb')](),controller['addChatWebsites']);router[_0xc7da('0x39')](_0xc7da('0x33'),auth['isAuthenticated'](),controller[_0xc7da('0x5c')]);router[_0xc7da('0x39')](_0xc7da('0x34'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x5d')]);router[_0xc7da('0x39')](_0xc7da('0x5e'),auth['isAuthenticated'](),controller[_0xc7da('0x5f')]);router[_0xc7da('0x60')](_0xc7da('0x10'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x61')]);router[_0xc7da('0x60')](_0xc7da('0x62'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x63')]);router[_0xc7da('0x64')](_0xc7da('0x3e'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x65')]);router[_0xc7da('0x64')](_0xc7da('0x27'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x66')]);router[_0xc7da('0x64')](_0xc7da('0x10'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x67')]);router[_0xc7da('0x64')]('/:id/chat_interactions',auth[_0xc7da('0xb')](),controller['removeChatInteractions']);router[_0xc7da('0x64')](_0xc7da('0x4f'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x68')]);router[_0xc7da('0x64')](_0xc7da('0x51'),auth['isAuthenticated'](),controller[_0xc7da('0x69')]);router[_0xc7da('0x64')](_0xc7da('0x53'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x6a')]);router[_0xc7da('0x64')]('/:id/openchannel_interactions',auth[_0xc7da('0xb')](),controller[_0xc7da('0x6b')]);router[_0xc7da('0x64')](_0xc7da('0x56'),auth['isAuthenticated'](),controller[_0xc7da('0x6c')]);router[_0xc7da('0x64')](_0xc7da('0x2c'),auth[_0xc7da('0xb')](),controller['removeFaxAccounts']);router['delete'](_0xc7da('0x2e'),auth[_0xc7da('0xb')](),controller['removeMailAccounts']);router[_0xc7da('0x64')](_0xc7da('0x59'),auth['isAuthenticated'](),controller[_0xc7da('0x6d')]);router[_0xc7da('0x64')](_0xc7da('0x5a'),auth['isAuthenticated'](),controller[_0xc7da('0x6e')]);router[_0xc7da('0x64')](_0xc7da('0x31'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x6f')]);router[_0xc7da('0x64')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0xc7da('0x70')]);router[_0xc7da('0x64')](_0xc7da('0x34'),auth['isAuthenticated'](),controller[_0xc7da('0x71')]);router[_0xc7da('0x64')](_0xc7da('0x5e'),auth[_0xc7da('0xb')](),controller[_0xc7da('0x72')]);module[_0xc7da('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 cc6e21b..e0cc769 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 _0x6bb4=['from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','join','ulaw;alaw;gsm','allow','insecure','never','\x22\x22\x20<>','always','refuse','uac','fingerprint','certificate','passive','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','exports','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','\x22%s\x22\x20<%s>','getDataValue','email','ENUM','admin','user','telephone','local','internal','accountcode','callerid','BOOLEAN','DATE','INTEGER','dynamic','friend','peer'];(function(_0x5d244b,_0x5c5c26){var _0x2f7068=function(_0x4e8393){while(--_0x4e8393){_0x5d244b['push'](_0x5d244b['shift']());}};_0x2f7068(++_0x5c5c26);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x47b69f,_0x3f1696){_0x47b69f=_0x47b69f-0x0;var _0x56f392=_0x6bb4[_0x47b69f];return _0x56f392;};'use strict';var Sequelize=require(_0x46bb('0x0'));var moment=require(_0x46bb('0x1'));var util=require(_0x46bb('0x2'));var _=require('lodash');module[_0x46bb('0x3')]={'name':{'type':Sequelize[_0x46bb('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x74054){this[_0x46bb('0x5')](_0x46bb('0x6'),_0x74054);this[_0x46bb('0x5')](_0x46bb('0x7'),_0x74054);},'comment':_0x46bb('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4fa5c4){this[_0x46bb('0x5')](_0x46bb('0x9'),_0x4fa5c4);this['setDataValue']('callerid',util['format'](_0x46bb('0xa'),_0x4fa5c4,this[_0x46bb('0xb')]('internal')));}},'alias':{'type':Sequelize[_0x46bb('0x4')]},'email':{'type':Sequelize[_0x46bb('0x4')],'allowNull':![],'unique':_0x46bb('0xc'),'validate':{'isEmail':!![]},'set':function(_0x4b7854){if(_0x4b7854){this[_0x46bb('0x5')](_0x46bb('0xc'),_0x4b7854['toLowerCase']());}}},'role':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0xe'),_0x46bb('0xf'),'agent',_0x46bb('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x46bb('0x11')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x46bb('0x12'),'set':function(_0x1c8850){this['setDataValue'](_0x46bb('0x12'),_0x1c8850);this['setDataValue'](_0x46bb('0x13'),_0x1c8850);this['setDataValue'](_0x46bb('0x14'),util['format']('\x22%s\x22\x20<%s>',this[_0x46bb('0xb')](_0x46bb('0x9')),_0x1c8850));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x46bb('0x4')]},'mobile':{'type':Sequelize[_0x46bb('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x46bb('0x4')]},'city':{'type':Sequelize[_0x46bb('0x4')]},'country':{'type':Sequelize[_0x46bb('0x4')]},'online':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x46bb('0x16')]},'voicePause':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x46bb('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x46bb('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x46bb('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x46bb('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x46bb('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![],'defaultValue':_0x46bb('0x18')},'ipaddr':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x46bb('0x17')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x46bb('0x19'),_0x46bb('0xf'),_0x46bb('0x1a')),'allowNull':!![],'defaultValue':_0x46bb('0x19')},'context':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![],'defaultValue':_0x46bb('0x1b')},'callingpres':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x1c'),_0x46bb('0x1d'),_0x46bb('0x1e'),_0x46bb('0x1f'),_0x46bb('0x20'),_0x46bb('0x21'),_0x46bb('0x22'),_0x46bb('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0xd69dd8){this['setDataValue'](_0x46bb('0x24'),_0xd69dd8?_0xd69dd8['join'](','):null);},'get':function(){return this[_0x46bb('0xb')](_0x46bb('0x24'))?this[_0x46bb('0xb')]('transport')[_0x46bb('0x25')](','):null;},'comment':_0x46bb('0x26')},'dtmfmode':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x27'),_0x46bb('0x28'),'shortinfo',_0x46bb('0x29'),_0x46bb('0x2a')),'allowNull':!![],'defaultValue':_0x46bb('0x27')},'directmedia':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no',_0x46bb('0x2c'),_0x46bb('0x2d'),_0x46bb('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![],'defaultValue':_0x46bb('0x2f'),'set':function(_0xc1f9b9){this[_0x46bb('0x5')](_0x46bb('0x30'),_0xc1f9b9?_0xc1f9b9[_0x46bb('0x31')](','):null);},'get':function(){return this[_0x46bb('0xb')](_0x46bb('0x30'))?this[_0x46bb('0xb')](_0x46bb('0x30'))[_0x46bb('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x46bb('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x46bb('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x46bb('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x46bb('0x32'),'set':function(_0x102ffb){this['setDataValue'](_0x46bb('0x33'),_0x102ffb?_0x102ffb['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x46bb('0xb')]('allow')?this[_0x46bb('0xb')](_0x46bb('0x33'))[_0x46bb('0x25')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![],'set':function(_0x4bf211){this[_0x46bb('0x5')](_0x46bb('0x34'),_0x4bf211?_0x4bf211[_0x46bb('0x31')](','):null);},'get':function(){return this[_0x46bb('0xb')](_0x46bb('0x34'))?this[_0x46bb('0xb')]('insecure')[_0x46bb('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x46bb('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x46bb('0xd')]('yes','no',_0x46bb('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![],'defaultValue':_0x46bb('0x36')},'amaflags':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x46bb('0x2b')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x46bb('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no',_0x46bb('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x46bb('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x46bb('0xd')]('accept',_0x46bb('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x39'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x46bb('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x46bb('0x2b')},'keepalive':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x46bb('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no',_0x46bb('0x3a'),_0x46bb('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x46bb('0xd')]('active',_0x46bb('0x3c'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x46bb('0xd')](_0x46bb('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x46bb('0xd')]('yes','no',_0x46bb('0x2c'),_0x46bb('0x2d'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x46bb('0x16')]},'passwordResetAt':{'type':Sequelize[_0x46bb('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x563ffe){this[_0x46bb('0x5')](_0x46bb('0x3d'),_0x563ffe);var _0x4e8166=this[_0x46bb('0x3e')]({'plain':!![]});switch(_0x563ffe){case 0x0:case 0x1:var _0x1736ce=_0x4e8166['transport']?_[_0x46bb('0x3f')](_0x4e8166[_0x46bb('0x24')])?_0x4e8166[_0x46bb('0x24')][_0x46bb('0x31')]():_0x4e8166[_0x46bb('0x24')]:'udp';if(_0x1736ce===_0x46bb('0x40')){_0x1736ce='udp';}this[_0x46bb('0x5')](_0x46bb('0x24'),_0x1736ce);this[_0x46bb('0x5')](_0x46bb('0x41'),'no');this[_0x46bb('0x5')](_0x46bb('0x42'),null);this[_0x46bb('0x5')](_0x46bb('0x43'),null);this[_0x46bb('0x5')](_0x46bb('0x44'),null);this[_0x46bb('0x5')](_0x46bb('0x45'),null);this[_0x46bb('0x5')](_0x46bb('0x46'),null);this[_0x46bb('0x5')](_0x46bb('0x47'),null);this[_0x46bb('0x5')](_0x46bb('0x48'),null);this[_0x46bb('0x5')](_0x46bb('0x49'),null);this[_0x46bb('0x5')](_0x46bb('0x4a'),'no');break;case 0x2:this['setDataValue'](_0x46bb('0x24'),'wss');this['setDataValue']('encryption',_0x46bb('0x2b'));this[_0x46bb('0x5')](_0x46bb('0x42'),_0x46bb('0x2b'));this[_0x46bb('0x5')](_0x46bb('0x43'),_0x46bb('0x2b'));this['setDataValue'](_0x46bb('0x44'),'yes');this[_0x46bb('0x5')]('dtlsenable','yes');this[_0x46bb('0x5')]('dtlsverify','no');this[_0x46bb('0x5')](_0x46bb('0x47'),'actpass');this[_0x46bb('0x5')]('dtlscertfile',_0x4e8166[_0x46bb('0x48')]||_0x46bb('0x4b'));this[_0x46bb('0x5')](_0x46bb('0x49'),_0x4e8166[_0x46bb('0x49')]||_0x46bb('0x4c'));this[_0x46bb('0x5')]('rtcp_mux',_0x46bb('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0x46bb('0x4d')],'set':function(_0x23acce){this[_0x46bb('0x5')](_0x46bb('0x4e'),_0x23acce?_0x23acce[_0x46bb('0x31')](','):[]);},'get':function(){return this[_0x46bb('0xb')](_0x46bb('0x4e'))?_[_0x46bb('0x4f')](this['getDataValue'](_0x46bb('0x4e'))['split'](','),function(_0x3200af){return parseInt(_0x3200af,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x46bb('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x46bb('0x17')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x46bb('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x46bb('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x46bb('0x50')],'get':function(){return this[_0x46bb('0xb')](_0x46bb('0x51'))?this['getDataValue'](_0x46bb('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x46bb('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x46bb('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![],'set':function(_0x307227){if(typeof _0x307227===_0x46bb('0x52')){var _0x46b23f=_0x307227==='1'?!![]:_0x307227==='0'?![]:_0x307227===_0x46bb('0x53')?!![]:_0x307227===_0x46bb('0x54')?![]:![];this['setDataValue']('screenrecording',_0x46b23f);}else{this['setDataValue'](_0x46bb('0x55'),_0x307227);}}},'blocked':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![],'set':function(_0x3f093e){this['setDataValue'](_0x46bb('0x56'),_0x3f093e);if(_0x3f093e===!![]){this[_0x46bb('0x5')](_0x46bb('0x57'),moment());this[_0x46bb('0x5')](_0x46bb('0x58'),0x0);}else{this['setDataValue'](_0x46bb('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x46bb('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x46bb('0x17')](0x5)[_0x46bb('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x46bb('0x15')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb7ac=['accept','originate','uac','uas','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','rtcp_mux','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','agent','telephone','local','INTEGER','callerid','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','user','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','nonat','update','yes','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always'];(function(_0x3e4bf3,_0x5ec836){var _0x29b3f9=function(_0x310696){while(--_0x310696){_0x3e4bf3['push'](_0x3e4bf3['shift']());}};_0x29b3f9(++_0x5ec836);}(_0xb7ac,0x18a));var _0xcb7a=function(_0xfd2d0b,_0xdb5e6){_0xfd2d0b=_0xfd2d0b-0x0;var _0xb901fe=_0xb7ac[_0xfd2d0b];return _0xb901fe;};'use strict';var Sequelize=require(_0xcb7a('0x0'));var moment=require(_0xcb7a('0x1'));var util=require(_0xcb7a('0x2'));var _=require(_0xcb7a('0x3'));module[_0xcb7a('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcb7a('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4817ac){this[_0xcb7a('0x6')](_0xcb7a('0x5'),_0x4817ac);this['setDataValue'](_0xcb7a('0x7'),_0x4817ac);},'comment':_0xcb7a('0x8')},'fullname':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':![],'set':function(_0x4fe4a9){this['setDataValue'](_0xcb7a('0xa'),_0x4fe4a9);this[_0xcb7a('0x6')]('callerid',util[_0xcb7a('0xb')](_0xcb7a('0xc'),_0x4fe4a9,this[_0xcb7a('0xd')](_0xcb7a('0xe'))));}},'alias':{'type':Sequelize[_0xcb7a('0x9')]},'email':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x39742a){if(_0x39742a){this[_0xcb7a('0x6')](_0xcb7a('0xf'),_0x39742a['toLowerCase']());}}},'role':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x11'),'user',_0xcb7a('0x12'),_0xcb7a('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xcb7a('0x9')],'defaultValue':_0xcb7a('0x14')},'internal':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':![],'unique':_0xcb7a('0xe'),'set':function(_0x1050ca){this[_0xcb7a('0x6')]('internal',_0x1050ca);this[_0xcb7a('0x6')]('accountcode',_0x1050ca);this[_0xcb7a('0x6')](_0xcb7a('0x16'),util[_0xcb7a('0xb')](_0xcb7a('0xc'),this['getDataValue'](_0xcb7a('0xa')),_0x1050ca));}},'salt':{'type':Sequelize[_0xcb7a('0x9')]},'phone':{'type':Sequelize[_0xcb7a('0x9')]},'mobile':{'type':Sequelize[_0xcb7a('0x9')]},'address':{'type':Sequelize[_0xcb7a('0x9')]},'zipcode':{'type':Sequelize[_0xcb7a('0x9')]},'userpic':{'type':Sequelize[_0xcb7a('0x9')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xcb7a('0x9')]},'online':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xcb7a('0x18')]},'voicePause':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xcb7a('0x9')],'defaultValue':_0xcb7a('0x19')},'lastPauseAt':{'type':Sequelize[_0xcb7a('0x18')]},'chatCapacity':{'type':Sequelize[_0xcb7a('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xcb7a('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xcb7a('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xcb7a('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xcb7a('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xcb7a('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xcb7a('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'host':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![],'defaultValue':_0xcb7a('0x1a')},'ipaddr':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x1b'),_0xcb7a('0x1c'),'peer'),'allowNull':!![],'defaultValue':_0xcb7a('0x1b')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcb7a('0x1d')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xcb7a('0x1e'),_0xcb7a('0x1f'),_0xcb7a('0x20'),_0xcb7a('0x21'),_0xcb7a('0x22'),'PROHIB_FAILED_SCREEN',_0xcb7a('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'permit':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'transport':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![],'defaultValue':_0xcb7a('0x24'),'set':function(_0x3bb4f6){this[_0xcb7a('0x6')](_0xcb7a('0x25'),_0x3bb4f6?_0x3bb4f6[_0xcb7a('0x26')](','):null);},'get':function(){return this[_0xcb7a('0xd')]('transport')?this[_0xcb7a('0xd')]('transport')[_0xcb7a('0x27')](','):null;},'comment':_0xcb7a('0x28')},'dtmfmode':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x29'),'info',_0xcb7a('0x2a'),'inband',_0xcb7a('0x2b')),'allowNull':!![],'defaultValue':_0xcb7a('0x29')},'directmedia':{'type':Sequelize[_0xcb7a('0x10')]('yes','no',_0xcb7a('0x2c'),_0xcb7a('0x2d'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcb7a('0x2f'),'set':function(_0x44a961){this[_0xcb7a('0x6')]('nat',_0x44a961?_0x44a961[_0xcb7a('0x26')](','):null);},'get':function(){return this[_0xcb7a('0xd')](_0xcb7a('0x30'))?this[_0xcb7a('0xd')](_0xcb7a('0x30'))[_0xcb7a('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xcb7a('0x9')]},'namedcallgroup':{'type':Sequelize[_0xcb7a('0x9')]},'pickupgroup':{'type':Sequelize[_0xcb7a('0x9')]},'namedpickupgroup':{'type':Sequelize[_0xcb7a('0x9')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xcb7a('0x9')]},'disallow':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':![],'defaultValue':_0xcb7a('0x31')},'allow':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':![],'defaultValue':_0xcb7a('0x32'),'set':function(_0x52c756){this[_0xcb7a('0x6')](_0xcb7a('0x33'),_0x52c756?_0x52c756[_0xcb7a('0x26')](';'):_0xcb7a('0x32'));},'get':function(){return this[_0xcb7a('0xd')]('allow')?this['getDataValue']('allow')[_0xcb7a('0x27')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![],'set':function(_0x5c8e1b){this[_0xcb7a('0x6')](_0xcb7a('0x34'),_0x5c8e1b?_0x5c8e1b[_0xcb7a('0x26')](','):null);},'get':function(){return this[_0xcb7a('0xd')]('insecure')?this[_0xcb7a('0xd')](_0xcb7a('0x34'))[_0xcb7a('0x27')](','):null;},'comment':_0xcb7a('0x35')},'trustrpid':{'type':Sequelize['ENUM'](_0xcb7a('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xcb7a('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcb7a('0x10')]('yes','no',_0xcb7a('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![],'defaultValue':_0xcb7a('0x2e')},'busylevel':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no',_0xcb7a('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x38'),'refuse',_0xcb7a('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x3a'),_0xcb7a('0x3b')),'allowNull':!![],'defaultValue':_0xcb7a('0x3b')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![],'defaultValue':_0xcb7a('0x2e')},'keepalive':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no','fingerprint',_0xcb7a('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x3d'),_0xcb7a('0x3e'),_0xcb7a('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xcb7a('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xcb7a('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xcb7a('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no',_0xcb7a('0x2c'),_0xcb7a('0x2d'),_0xcb7a('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xcb7a('0x18')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xcb7a('0x41')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3a64b6){this[_0xcb7a('0x6')](_0xcb7a('0x42'),_0x3a64b6);var _0x213b84=this[_0xcb7a('0x43')]({'plain':!![]});switch(_0x3a64b6){case 0x0:case 0x1:var _0x5128b7=_0x213b84[_0xcb7a('0x25')]?_['isArray'](_0x213b84[_0xcb7a('0x25')])?_0x213b84[_0xcb7a('0x25')][_0xcb7a('0x26')]():_0x213b84[_0xcb7a('0x25')]:'udp';if(_0x5128b7===_0xcb7a('0x44')){_0x5128b7='udp';}this[_0xcb7a('0x6')]('transport',_0x5128b7);this[_0xcb7a('0x6')](_0xcb7a('0x45'),'no');this['setDataValue'](_0xcb7a('0x46'),null);this[_0xcb7a('0x6')](_0xcb7a('0x47'),null);this[_0xcb7a('0x6')](_0xcb7a('0x48'),null);this['setDataValue'](_0xcb7a('0x49'),null);this[_0xcb7a('0x6')](_0xcb7a('0x4a'),null);this[_0xcb7a('0x6')](_0xcb7a('0x4b'),null);this[_0xcb7a('0x6')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this['setDataValue'](_0xcb7a('0x4c'),'no');break;case 0x2:this['setDataValue']('transport',_0xcb7a('0x44'));this[_0xcb7a('0x6')](_0xcb7a('0x45'),'yes');this[_0xcb7a('0x6')]('avpf',_0xcb7a('0x2e'));this['setDataValue']('force_avp',_0xcb7a('0x2e'));this['setDataValue']('icesupport','yes');this[_0xcb7a('0x6')]('dtlsenable',_0xcb7a('0x2e'));this['setDataValue'](_0xcb7a('0x4a'),'no');this['setDataValue'](_0xcb7a('0x4b'),_0xcb7a('0x3f'));this[_0xcb7a('0x6')](_0xcb7a('0x4d'),_0x213b84[_0xcb7a('0x4d')]||_0xcb7a('0x4e'));this[_0xcb7a('0x6')](_0xcb7a('0x4f'),_0x213b84[_0xcb7a('0x4f')]||_0xcb7a('0x50'));this[_0xcb7a('0x6')](_0xcb7a('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xcb7a('0x41')],'set':function(_0x54b745){this['setDataValue']('permissions',_0x54b745?_0x54b745[_0xcb7a('0x26')](','):[]);},'get':function(){return this['getDataValue'](_0xcb7a('0x51'))?_[_0xcb7a('0x52')](this['getDataValue'](_0xcb7a('0x51'))[_0xcb7a('0x27')](','),function(_0xc71289){return parseInt(_0xc71289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xcb7a('0x9')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xcb7a('0x9')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xcb7a('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xcb7a('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xcb7a('0x10')](_0xcb7a('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xcb7a('0x9')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xcb7a('0x53')],'get':function(){return this['getDataValue'](_0xcb7a('0x54'))?this[_0xcb7a('0xd')](_0xcb7a('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0xcb7a('0x9')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xcb7a('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![],'set':function(_0x1396a5){if(typeof _0x1396a5==='string'){var _0x463d0d=_0x1396a5==='1'?!![]:_0x1396a5==='0'?![]:_0x1396a5===_0xcb7a('0x55')?!![]:_0x1396a5===_0xcb7a('0x56')?![]:![];this[_0xcb7a('0x6')](_0xcb7a('0x57'),_0x463d0d);}else{this['setDataValue'](_0xcb7a('0x57'),_0x1396a5);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x459c82){this[_0xcb7a('0x6')]('blocked',_0x459c82);if(_0x459c82===!![]){this[_0xcb7a('0x6')]('blockedAt',moment());this['setDataValue']('loginAttempts',0x0);}else{this[_0xcb7a('0x6')](_0xcb7a('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0xcb7a('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xcb7a('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xcb7a('0x15')](0x5)[_0xcb7a('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcb7a('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index fee8487..3d09cc0 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 _0x23a3=['options','openTabs','sms','openchannel','fax','mail','body','params','describe','addContacts','ids','omit','internal','Setting','securePassword','max','isNil','min_internal','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','from','voicemail','VoiceMail','password','fullname','email','permissions','102','113','110','105','106','107','108','100','111','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','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','each','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','voicePause','interface','isValidChannel','capitalize','toLowerCase','Queues','penalty','QueueId','voice','format','SIP/%s','UserVoiceQueueRt','Unknown\x20channel','isArray','emit','Queue:remove','addAvatar','file','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','order','sort','pick','hasOwnProperty','CmList','Tags','color','tag','map','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','set','%s%s','manual','getTeams','Team','addTeams','setDataValue','Voice','Mail','getSmsQueues','Sms','getWhatsappQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','upsert','getDataValue','Queue:save','removeTeams','getChatQueues','getMailQueues','removeAgent','getLists','values','send','addChatInteractions','spread','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','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','getChatWebsites','ChatWebsite','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','$and','$gt','$lt','$ne','$eq','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','dialActive','VoiceQueue','CmHopper','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','getAgents','col','toString','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','unavailable','ringing','busy','slice','toUpperCase','SELECT','field','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','path','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','./user.socket','register','redis','localhost','client','http','request','then','User,\x20%s,\x20%s','debug','stringify','error','message','info','catch','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','update','destroy','get','Users','Agents','agent','Telephones','telephone','ignore','value','includes','role','find','name','UserProfileResource','index','User','type','key','filter','salt','getOptions','where','query','include','attributes','push','findAll','rows','true','chat','dataValues','whatsapp','all','show','differenceBy','keys','rawAttributes','filters','intersection','model','fields','length','includeAll','merge'];(function(_0x291329,_0x978408){var _0x38d45a=function(_0x26c47a){while(--_0x26c47a){_0x291329['push'](_0x291329['shift']());}};_0x38d45a(++_0x978408);}(_0x23a3,0x131));var _0x323a=function(_0x28ab1a,_0x41638e){_0x28ab1a=_0x28ab1a-0x0;var _0x2db742=_0x23a3[_0x28ab1a];return _0x2db742;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x323a('0x0'));var fs=require('fs');var _=require('lodash');var squel=require(_0x323a('0x1'));var jayson=require(_0x323a('0x2'));var Redis=require(_0x323a('0x3'));var authService=require(_0x323a('0x4'));var qs=require(_0x323a('0x5'));var logger=require(_0x323a('0x6'))(_0x323a('0x7'));var utils=require(_0x323a('0x8'));var config=require(_0x323a('0x9'));var licenseUtil=require('../../config/license/util');var db=require(_0x323a('0xa'))['db'];var socket=require(_0x323a('0xb'))(new Redis(config['redis']));require(_0x323a('0xc'))[_0x323a('0xd')](socket);config[_0x323a('0xe')]=_['defaults'](config[_0x323a('0xe')],{'host':_0x323a('0xf'),'port':0x18eb});var client=jayson[_0x323a('0x10')][_0x323a('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0x1b3d13,_0x50a99b,_0x15d09f,_0x2cea45){return new BPromise(function(_0x1bc768,_0x21ddac){var _0x42b854=_0x2cea45||client;return _0x42b854[_0x323a('0x12')](_0x1b3d13,_0x15d09f)[_0x323a('0x13')](function(_0x1ae315){logger['info'](_0x323a('0x14'),_0x50a99b,'request\x20sent');logger[_0x323a('0x15')]('User,\x20%s,\x20%s,\x20%s',_0x50a99b,'request\x20sent',JSON[_0x323a('0x16')](_0x1ae315));if(_0x1ae315['error']){if(_0x1ae315[_0x323a('0x17')]['code']===0x1f4){logger[_0x323a('0x17')](_0x323a('0x14'),_0x50a99b,_0x1ae315['error'][_0x323a('0x18')]);return _0x21ddac(_0x1ae315[_0x323a('0x17')]['message']);}logger['error'](_0x323a('0x14'),_0x50a99b,_0x1ae315[_0x323a('0x17')][_0x323a('0x18')]);return _0x1bc768(_0x1ae315[_0x323a('0x17')][_0x323a('0x18')]);}else{logger[_0x323a('0x19')]('User,\x20%s,\x20%s',_0x50a99b,'request\x20sent');_0x1bc768(_0x1ae315['result']['message']);}})[_0x323a('0x1a')](function(_0x549801){logger[_0x323a('0x17')](_0x323a('0x14'),_0x50a99b,_0x549801);_0x21ddac(_0x549801);});});}function respondWithStatusCode(_0x154ab1,_0xd35d83){_0xd35d83=_0xd35d83||0xcc;return function(_0x4ee861){if(_0x4ee861){return _0x154ab1[_0x323a('0x1b')](_0xd35d83);}return _0x154ab1['status'](_0xd35d83)[_0x323a('0x1c')]();};}function respondWithResult(_0x323517,_0x174f53){_0x174f53=_0x174f53||0xc8;return function(_0x4ccd81){if(_0x4ccd81){return _0x323517[_0x323a('0x1d')](_0x174f53)[_0x323a('0x1e')](_0x4ccd81);}};}function respondWithFilteredResult(_0x36d4d9,_0x2960e0){return function(_0x35f8ec){if(_0x35f8ec){var _0x204f76=typeof _0x2960e0['offset']===_0x323a('0x1f')&&typeof _0x2960e0['limit']===_0x323a('0x1f');var _0x2e05fd=_0x35f8ec[_0x323a('0x20')];var _0x44273f=_0x204f76?0x0:_0x2960e0[_0x323a('0x21')];var _0x47ed72=_0x204f76?_0x35f8ec[_0x323a('0x20')]:_0x2960e0[_0x323a('0x21')]+_0x2960e0[_0x323a('0x22')];var _0x17907c;if(_0x47ed72>=_0x2e05fd){_0x47ed72=_0x2e05fd;_0x17907c=0xc8;}else{_0x17907c=0xce;}_0x36d4d9[_0x323a('0x1d')](_0x17907c);return _0x36d4d9['set'](_0x323a('0x23'),_0x44273f+'-'+_0x47ed72+'/'+_0x2e05fd)['json'](_0x35f8ec);}return null;};}function saveUpdates(_0x24747b){return function(_0x1eb71f){if(_0x1eb71f){return _0x1eb71f[_0x323a('0x24')](_0x24747b)[_0x323a('0x13')](function(_0x43a938){return _0x43a938;});}return null;};}function removeEntity(_0x3b4216){return function(_0x5bdea1){if(_0x5bdea1){return _0x5bdea1[_0x323a('0x25')]()[_0x323a('0x13')](function(){var _0x580c2b=_0x5bdea1[_0x323a('0x26')]({'plain':!![]});if(_0x580c2b['role']==='admin')return;var _0x4bb7ca=[{'name':_0x323a('0x27'),'value':'user','ignore':!![]},{'name':_0x323a('0x28'),'value':_0x323a('0x29'),'ignore':![]},{'name':_0x323a('0x2a'),'value':_0x323a('0x2b'),'ignore':![]}];var _0x1d5f61=_(_0x4bb7ca)['filter'](_0x323a('0x2c'))['map'](_0x323a('0x2d'))['value']();if(_[_0x323a('0x2e')](_0x1d5f61,_0x580c2b[_0x323a('0x2f')])){return;}var _0x5140d9=_[_0x323a('0x30')](_0x4bb7ca,[_0x323a('0x2d'),_0x580c2b[_0x323a('0x2f')]])[_0x323a('0x31')];return db[_0x323a('0x32')][_0x323a('0x25')]({'where':{'type':_0x5140d9,'resourceId':_0x580c2b['id']}})[_0x323a('0x13')](function(){return _0x5bdea1;});})[_0x323a('0x13')](function(){_0x3b4216['status'](0xcc)[_0x323a('0x1c')]();});}};}function handleEntityNotFound(_0x149944){return function(_0x10b7ab){if(!_0x10b7ab){_0x149944[_0x323a('0x1b')](0x194);}return _0x10b7ab;};}function handleError(_0x29d4c2,_0x676e72){_0x676e72=_0x676e72||0x1f4;return function(_0xd8addb){logger['error'](_0xd8addb['stack']);if(_0xd8addb[_0x323a('0x31')]){delete _0xd8addb[_0x323a('0x31')];}_0x29d4c2[_0x323a('0x1d')](_0x676e72)['send'](_0xd8addb);};}exports[_0x323a('0x33')]=function(_0x3f044e,_0x3c5add){var _0x2dd385={},_0x509d5f={'count':0x0,'rows':[]};var _0x28d410=_(db[_0x323a('0x34')]['rawAttributes'])['map'](function(_0x2a468a){return{'name':_0x2a468a['fieldName'],'type':_0x2a468a[_0x323a('0x35')][_0x323a('0x36')]};})[_0x323a('0x37')](function(_0x5b3a00){return!_[_0x323a('0x2e')](['password',_0x323a('0x38')],_0x5b3a00[_0x323a('0x31')]);})[_0x323a('0x2d')]();_0x2dd385=qs[_0x323a('0x39')](_0x28d410,_0x3f044e);var _0x2a5d38={'where':_0x2dd385[_0x323a('0x3a')]};return db['User'][_0x323a('0x20')](_0x2a5d38)[_0x323a('0x13')](function(_0x248d0f){_0x509d5f[_0x323a('0x20')]=_0x248d0f;if(_0x3f044e[_0x323a('0x3b')]['includeAll']){_0x2dd385[_0x323a('0x3c')]=[{'all':!![]}];}if(!_[_0x323a('0x2e')](_0x2dd385['attributes'],'id')){_0x2dd385[_0x323a('0x3d')][_0x323a('0x3e')]('id');}return db[_0x323a('0x34')][_0x323a('0x3f')](_0x2dd385);})[_0x323a('0x13')](function(_0x599b28){_0x509d5f[_0x323a('0x40')]=_0x599b28;if(_0x3f044e['query']['openTabs']===_0x323a('0x41')){var _0x3543a7=[];for(var _0x3d98ce=0x0;_0x3d98ce<_0x509d5f[_0x323a('0x40')]['length'];_0x3d98ce++){_0x3543a7[_0x323a('0x3e')](get_open_tabs(_0x323a('0x42'),_0x509d5f[_0x323a('0x40')][_0x3d98ce][_0x323a('0x43')]));_0x3543a7[_0x323a('0x3e')](get_open_tabs('sms',_0x509d5f[_0x323a('0x40')][_0x3d98ce][_0x323a('0x43')]));_0x3543a7['push'](get_open_tabs('fax',_0x509d5f[_0x323a('0x40')][_0x3d98ce][_0x323a('0x43')]));_0x3543a7[_0x323a('0x3e')](get_open_tabs('mail',_0x509d5f[_0x323a('0x40')][_0x3d98ce][_0x323a('0x43')]));_0x3543a7[_0x323a('0x3e')](get_open_tabs('openchannel',_0x509d5f[_0x323a('0x40')][_0x3d98ce][_0x323a('0x43')]));_0x3543a7[_0x323a('0x3e')](get_open_tabs(_0x323a('0x44'),_0x509d5f[_0x323a('0x40')][_0x3d98ce][_0x323a('0x43')]));}return BPromise[_0x323a('0x45')](_0x3543a7)[_0x323a('0x13')](function(_0x34afa4){return _0x509d5f;});}else{return _0x509d5f;}})[_0x323a('0x13')](respondWithFilteredResult(_0x3c5add,_0x2dd385))[_0x323a('0x1a')](handleError(_0x3c5add,null));};exports[_0x323a('0x46')]=function(_0x516a49,_0x32bd10){var _0x3bae04={'raw':![],'where':{'id':_0x516a49['params']['id']}},_0x1c2681={};_0x1c2681['model']=_[_0x323a('0x47')](_[_0x323a('0x48')](db[_0x323a('0x34')][_0x323a('0x49')]),['password',_0x323a('0x38')]);_0x1c2681['query']=_[_0x323a('0x48')](_0x516a49[_0x323a('0x3b')]);_0x1c2681[_0x323a('0x4a')]=_[_0x323a('0x4b')](_0x1c2681[_0x323a('0x4c')],_0x1c2681['query']);_0x3bae04[_0x323a('0x3d')]=_[_0x323a('0x4b')](_0x1c2681[_0x323a('0x4c')],qs[_0x323a('0x4d')](_0x516a49['query'][_0x323a('0x4d')]));_0x3bae04['attributes']=_0x3bae04[_0x323a('0x3d')][_0x323a('0x4e')]?_0x3bae04[_0x323a('0x3d')]:_0x1c2681[_0x323a('0x4c')];if(_0x516a49[_0x323a('0x3b')][_0x323a('0x4f')]){_0x3bae04[_0x323a('0x3c')]=[{'all':!![]}];}_0x3bae04=_[_0x323a('0x50')]({},_0x3bae04,_0x516a49[_0x323a('0x51')]);if(!_[_0x323a('0x2e')](_0x3bae04['attributes'],'id')){_0x3bae04['attributes'][_0x323a('0x3e')]('id');}return db[_0x323a('0x34')][_0x323a('0x30')](_0x3bae04)[_0x323a('0x13')](handleEntityNotFound(_0x32bd10,null))[_0x323a('0x13')](function(_0x39db9a){var _0x4e5a52=[];values=_0x39db9a;if(_0x516a49[_0x323a('0x3b')][_0x323a('0x52')]===_0x323a('0x41')){_0x4e5a52['push'](get_open_tabs(_0x323a('0x42'),_0x39db9a[_0x323a('0x43')]));_0x4e5a52['push'](get_open_tabs(_0x323a('0x53'),_0x39db9a['dataValues']));_0x4e5a52[_0x323a('0x3e')](get_open_tabs(_0x323a('0x54'),_0x39db9a[_0x323a('0x43')]));_0x4e5a52[_0x323a('0x3e')](get_open_tabs('whatsapp',_0x39db9a[_0x323a('0x43')]));_0x4e5a52['push'](get_open_tabs(_0x323a('0x55'),_0x39db9a['dataValues']));_0x4e5a52[_0x323a('0x3e')](get_open_tabs(_0x323a('0x56'),_0x39db9a['dataValues']));return BPromise[_0x323a('0x45')](_0x4e5a52);}else{return values;}})['then'](function(_0x1aa6dd){return values;})[_0x323a('0x13')](respondWithResult(_0x32bd10,null))['catch'](handleError(_0x32bd10,null));};exports[_0x323a('0x24')]=function(_0x445c23,_0x185ac7){if(_0x445c23['body']['id']){delete _0x445c23[_0x323a('0x57')]['id'];}delete _0x445c23[_0x323a('0x57')][_0x323a('0x2f')];return db[_0x323a('0x34')][_0x323a('0x30')]({'where':{'id':_0x445c23[_0x323a('0x58')]['id']}})[_0x323a('0x13')](handleEntityNotFound(_0x185ac7,null))[_0x323a('0x13')](saveUpdates(_0x445c23[_0x323a('0x57')],null))[_0x323a('0x13')](respondWithResult(_0x185ac7,null))[_0x323a('0x1a')](handleError(_0x185ac7,null));};exports[_0x323a('0x59')]=function(_0x181072,_0x28036a){return db[_0x323a('0x34')][_0x323a('0x59')]()['then'](respondWithResult(_0x28036a,null))[_0x323a('0x1a')](handleError(_0x28036a,null));};exports[_0x323a('0x5a')]=function(_0x42d260,_0x40df26){return db['User']['find']({'where':{'id':_0x42d260['params']['id']}})[_0x323a('0x13')](handleEntityNotFound(_0x40df26,null))[_0x323a('0x13')](function(_0x17a608){if(_0x17a608){return _0x17a608[_0x323a('0x5a')](_0x42d260[_0x323a('0x57')][_0x323a('0x5b')],_[_0x323a('0x5c')](_0x42d260[_0x323a('0x57')],[_0x323a('0x5b'),'id'])||{});}})[_0x323a('0x13')](respondWithResult(_0x40df26,null))[_0x323a('0x1a')](handleError(_0x40df26,null));};function validateUser(_0x1d5933){return new BPromise(function(_0x58beee,_0x37c7df){if(_0x1d5933[_0x323a('0x5d')])return _0x58beee(_0x1d5933);return db[_0x323a('0x5e')]['findById'](0x1)[_0x323a('0x13')](function(_0x440f7c){if(_0x440f7c[_0x323a('0x5f')])authService['validatePasswordPattern'](_0x1d5933['password']);db['User'][_0x323a('0x60')](_0x323a('0x5d'))[_0x323a('0x13')](function(_0x4470ea){if(_[_0x323a('0x61')](_0x4470ea)){_0x1d5933[_0x323a('0x5d')]=_0x440f7c[_0x323a('0x62')]||0x1;return;}if(_['isNil'](_0x440f7c['min_internal'])||_0x440f7c['min_internal']===_0x4470ea){_0x1d5933['internal']=_0x4470ea+0x1;return;}if(_0x440f7c['min_internal']>_0x4470ea){_0x1d5933[_0x323a('0x5d')]=_0x440f7c[_0x323a('0x62')];return;}return db[_0x323a('0x63')][_0x323a('0x3b')](_0x323a('0x64'),{'type':db[_0x323a('0x63')][_0x323a('0x65')]['SELECT']})[_0x323a('0x13')](function(_0x5b8bed){if(_0x5b8bed&&_0x5b8bed[_0x323a('0x4e')]){for(var _0x4ee6b0=0x0,_0x5e7e00=_0x5b8bed['length'];_0x4ee6b0<_0x5e7e00&&_[_0x323a('0x61')](_0x1d5933[_0x323a('0x5d')]);_0x4ee6b0++){if(_0x440f7c['min_internal']<=_0x5b8bed[_0x4ee6b0][_0x323a('0x66')]){_0x1d5933['internal']=_0x5b8bed[_0x4ee6b0][_0x323a('0x66')];}else if(_0x440f7c[_0x323a('0x62')]>_0x5b8bed[_0x4ee6b0][_0x323a('0x66')]&&_0x440f7c['min_internal']<=_0x5b8bed[_0x4ee6b0]['to']){_0x1d5933['internal']=_0x440f7c[_0x323a('0x62')];}}}if(_[_0x323a('0x61')](_0x1d5933[_0x323a('0x5d')])){_0x1d5933[_0x323a('0x5d')]=_0x4470ea+0x1;}return _0x58beee(_0x1d5933);});});})['catch'](function(_0x29808a){_0x37c7df(_0x29808a);});});}function updateUser(_0x40b2bc){return new BPromise(function(_0x9a97d9,_0xf0ddc6){try{if(_0x40b2bc[_0x323a('0x67')]){_0x40b2bc['mailbox']=_0x40b2bc[_0x323a('0x5d')];_0x40b2bc[_0x323a('0x68')]={'mailbox':_0x40b2bc[_0x323a('0x5d')],'password':_0x40b2bc[_0x323a('0x69')],'fullname':_0x40b2bc[_0x323a('0x6a')],'email':_0x40b2bc[_0x323a('0x6b')]};}if(_0x40b2bc[_0x323a('0x2f')]==='agent'){if(!_0x40b2bc['permissions'])_0x40b2bc[_0x323a('0x6c')]=['101',_0x323a('0x6d'),'103',_0x323a('0x6e'),_0x323a('0x6f'),'104',_0x323a('0x70'),_0x323a('0x71'),_0x323a('0x72'),_0x323a('0x73'),'109',_0x323a('0x74'),_0x323a('0x75'),'114','115'];}_0x9a97d9(_0x40b2bc);}catch(_0x1e9ff1){_0xf0ddc6(_0x1e9ff1);}});}exports['create']=function(_0x48829d,_0x30016f){if(_0x48829d[_0x323a('0x76')][_0x323a('0x2f')]===_0x323a('0x29'))throw new Error(_0x323a('0x77'));if(_0x48829d[_0x323a('0x57')][_0x323a('0x2f')]===_0x323a('0x76')&&_0x48829d['user'][_0x323a('0x2f')]!=='admin'){throw new Error(_0x323a('0x78'));}if(_0x48829d['body']['role']===_0x323a('0x79')&&_0x48829d[_0x323a('0x76')][_0x323a('0x2f')]!==_0x323a('0x79')){throw new Error(_0x323a('0x7a'));}return licenseUtil[_0x323a('0x7b')]([_0x48829d[_0x323a('0x57')]])[_0x323a('0x13')](function(){return validateUser(_0x48829d['body']);})[_0x323a('0x13')](function(_0x32e328){return updateUser(_0x32e328)[_0x323a('0x13')](function(_0x36db83){if(_0x36db83[_0x323a('0x2f')]===_0x323a('0x79')){_0x36db83[_0x323a('0x7c')]=_0x48829d[_0x323a('0x76')]['settingsEnabled'];delete _0x36db83[_0x323a('0x7d')];}return _0x36db83;});})[_0x323a('0x13')](function(_0x100666){return db[_0x323a('0x34')][_0x323a('0x7e')](_0x100666,{'include':[{'model':db[_0x323a('0x68')],'as':_0x323a('0x68')}]});})['then'](function(_0x152145){if(_0x48829d['body'][_0x323a('0x2f')]===_0x323a('0x76'))return _0x152145;if(_0x48829d[_0x323a('0x76')][_0x323a('0x2f')]!==_0x323a('0x76'))return _0x152145;return db[_0x323a('0x7f')][_0x323a('0x30')]({'where':{'name':_0x152145['role']===_0x323a('0x29')?_0x323a('0x28'):_0x323a('0x2a'),'userProfileId':_0x48829d['user'][_0x323a('0x7d')]},'raw':!![]})[_0x323a('0x13')](function(_0x2de6a4){if(!_0x2de6a4||_0x2de6a4[_0x323a('0x80')]!=0x0)return _0x152145;return db['UserProfileResource']['create']({'name':_0x152145[_0x323a('0x31')],'resourceId':_0x152145['id'],'type':_0x2de6a4[_0x323a('0x31')],'sectionId':_0x2de6a4['id']},{})[_0x323a('0x13')](function(){return _0x152145;});})[_0x323a('0x1a')](function(_0x419d99){logger[_0x323a('0x17')](_0x323a('0x81'),_0x419d99);throw _0x419d99;});})['then'](respondWithResult(_0x30016f,0xc9))[_0x323a('0x1a')](handleError(_0x30016f,null));};exports[_0x323a('0x82')]=function(_0x140b83,_0x5bf590){var _0x16f8e4=_0x140b83[_0x323a('0x57')];var _0x42a0ea=[];if(_0x140b83[_0x323a('0x76')][_0x323a('0x2f')]===_0x323a('0x29'))throw new Error(_0x323a('0x77'));if(_[_0x323a('0x83')](_0x16f8e4,[_0x323a('0x2f'),_0x323a('0x76')])&&_0x140b83[_0x323a('0x76')][_0x323a('0x2f')]!==_0x323a('0x79')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x16f8e4,[_0x323a('0x2f'),'admin'])&&_0x140b83[_0x323a('0x76')]['role']!==_0x323a('0x79')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x323a('0x7b')](_0x16f8e4)['then'](function(){return validateUser(_0x16f8e4[0x0]);})[_0x323a('0x13')](function(){for(var _0x15e73b=0x1;_0x15e73b<_0x16f8e4[_0x323a('0x4e')];_0x15e73b++){var _0x21a209=_0x16f8e4[_0x15e73b-0x1][_0x323a('0x5d')];if(!_0x16f8e4[_0x15e73b]['internal'])_0x16f8e4[_0x15e73b][_0x323a('0x5d')]=_0x21a209+0x1;_0x42a0ea[_0x323a('0x3e')](validateUser(_0x16f8e4[_0x15e73b]));}return BPromise['all'](_0x42a0ea);})[_0x323a('0x13')](function(){_0x42a0ea=[];for(var _0x370b88=0x0;_0x370b88<_0x16f8e4[_0x323a('0x4e')];_0x370b88++){_0x42a0ea[_0x323a('0x3e')](updateUser(_0x16f8e4[_0x370b88]));}return BPromise[_0x323a('0x45')](_0x42a0ea);})[_0x323a('0x13')](function(){return BPromise[_0x323a('0x84')](_0x16f8e4,function(_0x5e3986){return db[_0x323a('0x34')][_0x323a('0x7e')](_0x5e3986,{'include':[{'model':db[_0x323a('0x68')],'as':_0x323a('0x68')}]})[_0x323a('0x13')](function(_0x23ea9b){_0x5e3986['id']=_0x23ea9b['id'];return _0x5e3986;});});})[_0x323a('0x13')](function(_0x5cf140){if(_0x140b83[_0x323a('0x57')]['role']===_0x323a('0x76'))return _0x5cf140;if(_0x140b83[_0x323a('0x76')]['role']!==_0x323a('0x76'))return _0x5cf140;var _0x4f359b=_['some'](_0x5cf140,function(_0x220409){return _0x220409['role']===_0x323a('0x29')||_0x220409[_0x323a('0x2f')]===_0x323a('0x2b');});if(!_0x4f359b)return _0x5cf140;return db[_0x323a('0x7f')][_0x323a('0x3f')]({'where':{'name':{'$or':[_0x323a('0x28'),_0x323a('0x2a')]},'userProfileId':_0x140b83[_0x323a('0x76')]['userProfileId']},'raw':!![]})['then'](function(_0x18860c){if(_[_0x323a('0x85')](_0x18860c)||!_[_0x323a('0x83')](_0x18860c,[_0x323a('0x80'),0x0]))return _0x5cf140;_0x42a0ea=[];var _0xf5ee47=_(_0x18860c)['map'](function(_0x440f4a){if(_0x440f4a[_0x323a('0x80')]===0x1)return;return _0x440f4a[_0x323a('0x31')]===_0x323a('0x28')?'agent':_0x323a('0x2b');})[_0x323a('0x86')]()['value']();for(var _0x1c4afd=0x0;_0x1c4afd<_0x5cf140['length'];_0x1c4afd++){if(!_[_0x323a('0x2e')](_0xf5ee47,_0x5cf140[_0x1c4afd][_0x323a('0x2f')]))return;var _0x923da6=_0x5cf140[_0x1c4afd][_0x323a('0x2f')]==='agent'?_0x323a('0x28'):_0x323a('0x2a');_0x42a0ea[_0x323a('0x3e')](db['UserProfileResource']['create']({'name':_0x5cf140[_0x1c4afd][_0x323a('0x31')],'resourceId':_0x5cf140[_0x1c4afd]['id'],'type':_0x923da6,'sectionId':_[_0x323a('0x30')](_0x18860c,[_0x323a('0x31'),_0x923da6])['id']},{}));}return BPromise['all'](_0x42a0ea);});})[_0x323a('0x13')](respondWithResult(_0x5bf590,0xc9))[_0x323a('0x1a')](handleError(_0x5bf590,null));};exports[_0x323a('0x87')]=function(_0x320d93,_0x1dbf16){if(_0x320d93[_0x323a('0x57')]['id']){delete _0x320d93[_0x323a('0x57')]['id'];}return db[_0x323a('0x34')][_0x323a('0x30')]({'where':{'id':_0x320d93['params']['id']}})[_0x323a('0x13')](function(_0x5db071){if(!_0x5db071)return null;if(_0x5db071['id']===_0x320d93['user']['id']){if(!_0x320d93['body']['oldPassword']||!_0x320d93[_0x323a('0x57')][_0x323a('0x88')]){throw new db[(_0x323a('0x89'))][(_0x323a('0x8a'))](_0x323a('0x8b'));}if(!_0x5db071['authenticate'](_0x320d93[_0x323a('0x57')][_0x323a('0x8c')])){throw new db[(_0x323a('0x89'))][(_0x323a('0x8a'))](_0x323a('0x8d'));}if(_0x320d93[_0x323a('0x57')][_0x323a('0x8c')]===_0x320d93[_0x323a('0x57')]['newPassword']){throw new db[(_0x323a('0x89'))]['ValidationError'](_0x323a('0x8e'));}}else if(_0x320d93[_0x323a('0x76')][_0x323a('0x2f')]===_0x323a('0x79')){if(!_0x320d93[_0x323a('0x57')][_0x323a('0x88')]){throw new db[(_0x323a('0x89'))][(_0x323a('0x8a'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x320d93[_0x323a('0x76')]['role']===_0x323a('0x76')){if(!_0x320d93[_0x323a('0x57')][_0x323a('0x88')]){throw new db['Sequelize'][(_0x323a('0x8a'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x5db071[_0x323a('0x2f')]!==_0x323a('0x29')){throw new db[(_0x323a('0x89'))][(_0x323a('0x8a'))](_0x323a('0x77'));}}else{throw new db[(_0x323a('0x89'))]['ValidationError'](_0x323a('0x77'));}return _0x5db071;})[_0x323a('0x13')](handleEntityNotFound(_0x1dbf16,null))[_0x323a('0x13')](function(_0x813f24){return db[_0x323a('0x5e')][_0x323a('0x8f')]({'attributes':['id','securePassword',_0x323a('0x90'),_0x323a('0x91')]})['then'](function(_0x101882){if(_0x101882['securePassword'])authService[_0x323a('0x92')](_0x320d93[_0x323a('0x57')]['newPassword']);if(!_0x101882[_0x323a('0x90')]||!_0x813f24[_0x323a('0x93')])return _0x813f24;authService[_0x323a('0x94')](_0x320d93[_0x323a('0x57')][_0x323a('0x88')],_0x813f24[_0x323a('0x93')],_0x101882['passwordHistoryLimit']);return _0x813f24;})['then'](saveUpdates({'password':_0x320d93[_0x323a('0x57')][_0x323a('0x88')],'passwordResetAt':_0x320d93[_0x323a('0x76')]['id']==_0x320d93['params']['id']?moment():null,'previousPasswords':authService[_0x323a('0x95')](_0x320d93[_0x323a('0x57')]['newPassword'],_0x813f24['previousPasswords'])},null));})['then'](respondWithResult(_0x1dbf16,null))['catch'](handleError(_0x1dbf16,null));};exports[_0x323a('0x96')]=function(_0x1ab262,_0x1c36c7){var _0x1478ec=_0x1ab262[_0x323a('0x57')][_0x323a('0x97')];return db[_0x323a('0x34')][_0x323a('0x30')]({'where':{'id':_0x1ab262[_0x323a('0x58')]['id']},'attributes':['id','name','role',_0x323a('0x98'),'loginInPause',_0x323a('0x99'),_0x323a('0x9a')]})['then'](handleEntityNotFound(_0x1c36c7,null))[_0x323a('0x13')](function(_0x5027c6){if(_0x5027c6){if(!utils[_0x323a('0x9b')](_0x1478ec)){throw new db[(_0x323a('0x89'))]['ValidationError']('Unknown\x20channel');}return _0x5027c6['add'+_[_0x323a('0x9c')](_0x1478ec[_0x323a('0x9d')]())+_0x323a('0x9e')](_0x1ab262['body']['ids'],{'penalty':_0x1ab262[_0x323a('0x57')][_0x323a('0x9f')]||0x0})['spread'](function(_0x12ca9e){for(var _0x255119=0x0;_0x255119<_0x1ab262[_0x323a('0x57')][_0x323a('0x5b')][_0x323a('0x4e')];_0x255119+=0x1){var _0x28593e={'UserId':Number(_0x1ab262[_0x323a('0x58')]['id'])};_0x28593e[_['capitalize'](_0x1478ec[_0x323a('0x9d')]())+_0x323a('0xa0')]=Number(_0x1ab262[_0x323a('0x57')][_0x323a('0x5b')][_0x255119]);socket['emit'](_0x323a('0x76')+_['capitalize'](_0x1478ec['toLowerCase']())+'Queue:save',_0x28593e);}return _0x12ca9e;})[_0x323a('0x13')](function(){if(_0x1478ec===_0x323a('0xa1')){return db['VoiceQueue'][_0x323a('0x3f')]({'where':{'id':_0x1ab262[_0x323a('0x57')][_0x323a('0x5b')]||[]},'raw':!![],'attributes':['id',_0x323a('0x31')]});}})['then'](function(_0x593e5a){var _0x46d6fb=_0x5027c6[_0x323a('0x26')]({'plain':!![]});var _0x212d74=[];if(_0x1478ec===_0x323a('0xa1')&&_0x46d6fb['role']===_0x323a('0x29')&&_0x46d6fb['online']){for(var _0x4d986e=0x0;_0x4d986e<_0x593e5a[_0x323a('0x4e')];_0x4d986e+=0x1){_0x212d74[_0x323a('0x3e')]({'membername':_0x46d6fb[_0x323a('0x31')],'UserId':_0x46d6fb['id'],'queue_name':_0x593e5a[_0x4d986e][_0x323a('0x31')],'VoiceQueueId':_0x593e5a[_0x4d986e]['id'],'interface':_[_0x323a('0x61')](_0x46d6fb[_0x323a('0x9a')])?util[_0x323a('0xa2')](_0x323a('0xa3'),_0x46d6fb[_0x323a('0x31')]):_0x46d6fb[_0x323a('0x9a')],'paused':_0x46d6fb[_0x323a('0x99')]||![],'penalty':_0x1ab262[_0x323a('0x57')][_0x323a('0x9f')]||0x0});}return BPromise[_0x323a('0x84')](_0x212d74,function(_0x213bd0){return db[_0x323a('0xa4')]['upsert'](_0x213bd0);});}return _0x5027c6;});}})[_0x323a('0x13')](respondWithStatusCode(_0x1c36c7,null))['catch'](handleError(_0x1c36c7,null));};exports['removeQueues']=function(_0x28ef67,_0x1c7265){var _0xff5b86;return db[_0x323a('0x34')]['find']({'where':{'id':_0x28ef67[_0x323a('0x58')]['id']},'attributes':['id',_0x323a('0x31'),_0x323a('0x2f')]})[_0x323a('0x13')](handleEntityNotFound(_0x1c7265,null))[_0x323a('0x13')](function(_0xa3ed57){if(_0xa3ed57){_0xff5b86=_0xa3ed57;if(!_0x28ef67['query'][_0x323a('0x97')]||!utils[_0x323a('0x9b')](_0x28ef67[_0x323a('0x3b')][_0x323a('0x97')])){throw new db['Sequelize']['ValidationError'](_0x323a('0xa5'));}return _0xa3ed57['remove'+_['capitalize'](_0x28ef67[_0x323a('0x3b')][_0x323a('0x97')][_0x323a('0x9d')]())+_0x323a('0x9e')](_0x28ef67[_0x323a('0x3b')][_0x323a('0x5b')]);}})[_0x323a('0x13')](function(_0x59089c){if(_[_0x323a('0xa6')](_0x28ef67[_0x323a('0x3b')][_0x323a('0x5b')])){for(var _0x2be4bc=0x0;_0x2be4bc<_0x28ef67[_0x323a('0x3b')][_0x323a('0x5b')][_0x323a('0x4e')];_0x2be4bc+=0x1){var _0xba9634={'UserId':Number(_0x28ef67[_0x323a('0x58')]['id'])};_0xba9634[_[_0x323a('0x9c')](_0x28ef67[_0x323a('0x3b')][_0x323a('0x97')][_0x323a('0x9d')]())+_0x323a('0xa0')]=Number(_0x28ef67['query']['ids'][_0x2be4bc]);socket[_0x323a('0xa7')](_0x323a('0x76')+_[_0x323a('0x9c')](_0x28ef67[_0x323a('0x3b')][_0x323a('0x97')][_0x323a('0x9d')]())+_0x323a('0xa8'),_0xba9634);}}else{var _0xba9634={'UserId':Number(_0x28ef67['params']['id'])};_0xba9634[_[_0x323a('0x9c')](_0x28ef67[_0x323a('0x3b')][_0x323a('0x97')]['toLowerCase']())+_0x323a('0xa0')]=Number(_0x28ef67[_0x323a('0x3b')]['ids']);socket[_0x323a('0xa7')](_0x323a('0x76')+_[_0x323a('0x9c')](_0x28ef67['query'][_0x323a('0x97')]['toLowerCase']())+_0x323a('0xa8'),_0xba9634);}return _0x59089c;})[_0x323a('0x13')](function(){if(_0x28ef67[_0x323a('0x3b')][_0x323a('0x97')]===_0x323a('0xa1')){return db[_0x323a('0xa4')][_0x323a('0x25')]({'where':{'UserId':_0x28ef67[_0x323a('0x58')]['id'],'VoiceQueueId':_0x28ef67['query'][_0x323a('0x5b')]},'individualHooks':!![]})[_0x323a('0x13')](function(){return _0xff5b86;});}return _0xff5b86;})[_0x323a('0x13')](respondWithStatusCode(_0x1c7265,null))[_0x323a('0x1a')](handleError(_0x1c7265,null));};exports[_0x323a('0xa9')]=function(_0x50ec3c,_0x25769b){_0x50ec3c['body']['userpic']=_0x50ec3c[_0x323a('0xaa')]['filename'];return db[_0x323a('0x34')][_0x323a('0x30')]({'where':{'id':_0x50ec3c[_0x323a('0x58')]['id']}})[_0x323a('0x13')](handleEntityNotFound(_0x25769b,null))['then'](saveUpdates(_0x50ec3c[_0x323a('0x57')],null))[_0x323a('0x13')](respondWithResult(_0x25769b,null))[_0x323a('0x1a')](handleError(_0x25769b,null));};exports[_0x323a('0xab')]=function(_0x2eb15a,_0x253ef0){var _0x1fd982=path[_0x323a('0xac')](config[_0x323a('0xad')],_0x323a('0xae'));return db['User']['find']({'where':{'id':_0x2eb15a[_0x323a('0x58')]['id']},'attributes':['id',_0x323a('0xaf')],'raw':!![]})[_0x323a('0x13')](handleEntityNotFound(_0x253ef0,null))[_0x323a('0x13')](function(_0x100bd7){if(_0x100bd7){if(_[_0x323a('0x61')](_0x100bd7['userpic'])){return _0x253ef0['download'](_0x1fd982);}else{if(!fs['existsSync'](path[_0x323a('0xac')](config[_0x323a('0xad')],_0x323a('0xb0'),_0x100bd7['userpic']))){return _0x253ef0[_0x323a('0xb1')](_0x1fd982);}return _0x253ef0[_0x323a('0xb1')](path['join'](config[_0x323a('0xad')],'server/files/images/',_0x100bd7[_0x323a('0xaf')]));}}})[_0x323a('0x1a')](handleError(_0x253ef0,null));};exports[_0x323a('0xb2')]=function(_0x4edec2,_0x1732f4){return db[_0x323a('0x34')]['find']({'where':{'id':_0x4edec2['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x1732f4,null))[_0x323a('0x13')](function(_0x2c5e8d){var _0x95a0ed=[];values=_0x2c5e8d[_0x323a('0x43')];_0x95a0ed[_0x323a('0x3e')](get_open_tabs(_0x323a('0x42'),_0x2c5e8d['dataValues']));_0x95a0ed['push'](get_open_tabs(_0x323a('0x53'),_0x2c5e8d['dataValues']));_0x95a0ed[_0x323a('0x3e')](get_open_tabs(_0x323a('0x54'),_0x2c5e8d[_0x323a('0x43')]));_0x95a0ed[_0x323a('0x3e')](get_open_tabs(_0x323a('0x44'),_0x2c5e8d[_0x323a('0x43')]));_0x95a0ed[_0x323a('0x3e')](get_open_tabs(_0x323a('0x55'),_0x2c5e8d[_0x323a('0x43')]));_0x95a0ed[_0x323a('0x3e')](get_open_tabs('mail',_0x2c5e8d[_0x323a('0x43')]));return BPromise[_0x323a('0x45')](_0x95a0ed);})['then'](function(_0x42288a){var _0x26dc27=[];if(_0x42288a){for(var _0x71afa8=0x0;_0x71afa8=_0xc44172){_0x54acd0=_0xc44172;_0x3505b0=0xc8;}else{_0x3505b0=0xce;}_0x55df4a[_0x63da('0x20')](_0x3505b0);return _0x55df4a[_0x63da('0x26')](_0x63da('0x27'),_0x1a1889+'-'+_0x54acd0+'/'+_0xc44172)['json'](_0x32d43e);}return null;};}function saveUpdates(_0x5a4628){return function(_0x3c646a){if(_0x3c646a){return _0x3c646a[_0x63da('0x28')](_0x5a4628)[_0x63da('0x13')](function(_0xdcf3cb){return _0xdcf3cb;});}return null;};}function removeEntity(_0x90788a){return function(_0x33fbca){if(_0x33fbca){return _0x33fbca[_0x63da('0x29')]()[_0x63da('0x13')](function(){var _0x56fcda=_0x33fbca['get']({'plain':!![]});if(_0x56fcda[_0x63da('0x2a')]==='admin')return;var _0x3f2ed0=[{'name':_0x63da('0x2b'),'value':_0x63da('0x2c'),'ignore':!![]},{'name':_0x63da('0x2d'),'value':_0x63da('0x2e'),'ignore':![]},{'name':_0x63da('0x2f'),'value':_0x63da('0x30'),'ignore':![]}];var _0x2171bb=_(_0x3f2ed0)['filter']('ignore')['map'](_0x63da('0x31'))['value']();if(_['includes'](_0x2171bb,_0x56fcda[_0x63da('0x2a')])){return;}var _0x1cb9e4=_[_0x63da('0x32')](_0x3f2ed0,[_0x63da('0x31'),_0x56fcda[_0x63da('0x2a')]])['name'];return db['UserProfileResource'][_0x63da('0x29')]({'where':{'type':_0x1cb9e4,'resourceId':_0x56fcda['id']}})['then'](function(){return _0x33fbca;});})[_0x63da('0x13')](function(){_0x90788a[_0x63da('0x20')](0xcc)[_0x63da('0x21')]();});}};}function handleEntityNotFound(_0x3a8bf6){return function(_0x40635d){if(!_0x40635d){_0x3a8bf6['sendStatus'](0x194);}return _0x40635d;};}function handleError(_0x57af0b,_0x5c9df0){_0x5c9df0=_0x5c9df0||0x1f4;return function(_0x8f267b){logger[_0x63da('0x1a')](_0x8f267b[_0x63da('0x33')]);if(_0x8f267b[_0x63da('0x34')]){delete _0x8f267b['name'];}_0x57af0b['status'](_0x5c9df0)[_0x63da('0x35')](_0x8f267b);};}exports[_0x63da('0x36')]=function(_0x241466,_0x444561){var _0x2cc02a={},_0x23340a={'count':0x0,'rows':[]};var _0x9cd4f=_(db['User']['rawAttributes'])[_0x63da('0x37')](function(_0x43055d){return{'name':_0x43055d[_0x63da('0x38')],'type':_0x43055d[_0x63da('0x39')][_0x63da('0x3a')]};})[_0x63da('0x3b')](function(_0x544b2b){return!_['includes'](['password',_0x63da('0x3c')],_0x544b2b['name']);})[_0x63da('0x31')]();_0x2cc02a=qs['getOptions'](_0x9cd4f,_0x241466);var _0x1c329d={'where':_0x2cc02a[_0x63da('0x3d')]};return db['User'][_0x63da('0x25')](_0x1c329d)['then'](function(_0x14c338){_0x23340a['count']=_0x14c338;if(_0x241466['query'][_0x63da('0x3e')]){_0x2cc02a['include']=[{'all':!![]}];}if(!_[_0x63da('0x3f')](_0x2cc02a['attributes'],'id')){_0x2cc02a['attributes']['push']('id');}return db[_0x63da('0x40')][_0x63da('0x41')](_0x2cc02a);})['then'](function(_0x5b999c){_0x23340a[_0x63da('0x42')]=_0x5b999c;if(_0x241466[_0x63da('0x43')][_0x63da('0x44')]===_0x63da('0x45')){var _0x1dd93c=[];for(var _0x296e03=0x0;_0x296e03<_0x23340a[_0x63da('0x42')][_0x63da('0x46')];_0x296e03++){_0x1dd93c[_0x63da('0x47')](get_open_tabs(_0x63da('0x48'),_0x23340a[_0x63da('0x42')][_0x296e03][_0x63da('0x49')]));_0x1dd93c['push'](get_open_tabs('sms',_0x23340a['rows'][_0x296e03][_0x63da('0x49')]));_0x1dd93c['push'](get_open_tabs(_0x63da('0x4a'),_0x23340a[_0x63da('0x42')][_0x296e03][_0x63da('0x49')]));_0x1dd93c[_0x63da('0x47')](get_open_tabs(_0x63da('0x4b'),_0x23340a[_0x63da('0x42')][_0x296e03][_0x63da('0x49')]));_0x1dd93c[_0x63da('0x47')](get_open_tabs('openchannel',_0x23340a['rows'][_0x296e03]['dataValues']));_0x1dd93c[_0x63da('0x47')](get_open_tabs(_0x63da('0x4c'),_0x23340a[_0x63da('0x42')][_0x296e03]['dataValues']));}return BPromise[_0x63da('0x4d')](_0x1dd93c)[_0x63da('0x13')](function(_0xef2ecf){return _0x23340a;});}else{return _0x23340a;}})[_0x63da('0x13')](respondWithFilteredResult(_0x444561,_0x2cc02a))[_0x63da('0x1e')](handleError(_0x444561,null));};exports[_0x63da('0x4e')]=function(_0x512dc3,_0x387684){var _0x2e59df={'raw':![],'where':{'id':_0x512dc3[_0x63da('0x4f')]['id']}},_0x4a7e8d={};_0x4a7e8d[_0x63da('0x50')]=_[_0x63da('0x51')](_[_0x63da('0x52')](db[_0x63da('0x40')][_0x63da('0x53')]),['password',_0x63da('0x3c')]);_0x4a7e8d['query']=_[_0x63da('0x52')](_0x512dc3['query']);_0x4a7e8d['filters']=_[_0x63da('0x54')](_0x4a7e8d[_0x63da('0x50')],_0x4a7e8d['query']);_0x2e59df[_0x63da('0x55')]=_['intersection'](_0x4a7e8d['model'],qs[_0x63da('0x56')](_0x512dc3['query']['fields']));_0x2e59df[_0x63da('0x55')]=_0x2e59df[_0x63da('0x55')][_0x63da('0x46')]?_0x2e59df[_0x63da('0x55')]:_0x4a7e8d[_0x63da('0x50')];if(_0x512dc3[_0x63da('0x43')][_0x63da('0x3e')]){_0x2e59df[_0x63da('0x57')]=[{'all':!![]}];}_0x2e59df=_[_0x63da('0x58')]({},_0x2e59df,_0x512dc3[_0x63da('0x59')]);if(!_['includes'](_0x2e59df[_0x63da('0x55')],'id')){_0x2e59df[_0x63da('0x55')][_0x63da('0x47')]('id');}return db[_0x63da('0x40')][_0x63da('0x32')](_0x2e59df)[_0x63da('0x13')](handleEntityNotFound(_0x387684,null))[_0x63da('0x13')](function(_0x2ece02){var _0x956c2a=[];values=_0x2ece02;if(_0x512dc3[_0x63da('0x43')]['openTabs']===_0x63da('0x45')){_0x956c2a[_0x63da('0x47')](get_open_tabs('chat',_0x2ece02[_0x63da('0x49')]));_0x956c2a[_0x63da('0x47')](get_open_tabs(_0x63da('0x5a'),_0x2ece02[_0x63da('0x49')]));_0x956c2a[_0x63da('0x47')](get_open_tabs(_0x63da('0x5b'),_0x2ece02[_0x63da('0x49')]));_0x956c2a[_0x63da('0x47')](get_open_tabs(_0x63da('0x4c'),_0x2ece02['dataValues']));_0x956c2a[_0x63da('0x47')](get_open_tabs(_0x63da('0x4a'),_0x2ece02[_0x63da('0x49')]));_0x956c2a[_0x63da('0x47')](get_open_tabs(_0x63da('0x4b'),_0x2ece02[_0x63da('0x49')]));return BPromise[_0x63da('0x4d')](_0x956c2a);}else{return values;}})[_0x63da('0x13')](function(_0x4d0471){return values;})[_0x63da('0x13')](respondWithResult(_0x387684,null))[_0x63da('0x1e')](handleError(_0x387684,null));};exports[_0x63da('0x28')]=function(_0x215060,_0x2c8179){if(_0x215060['body']['id']){delete _0x215060[_0x63da('0x5c')]['id'];}delete _0x215060['body'][_0x63da('0x2a')];return db[_0x63da('0x40')][_0x63da('0x32')]({'where':{'id':_0x215060[_0x63da('0x4f')]['id']}})[_0x63da('0x13')](handleEntityNotFound(_0x2c8179,null))['then'](saveUpdates(_0x215060[_0x63da('0x5c')],null))[_0x63da('0x13')](respondWithResult(_0x2c8179,null))[_0x63da('0x1e')](handleError(_0x2c8179,null));};exports[_0x63da('0x5d')]=function(_0x4977e6,_0x1738f9){return db[_0x63da('0x40')][_0x63da('0x5d')]()['then'](respondWithResult(_0x1738f9,null))[_0x63da('0x1e')](handleError(_0x1738f9,null));};exports[_0x63da('0x5e')]=function(_0x50da69,_0x2f89d3){return db[_0x63da('0x40')]['find']({'where':{'id':_0x50da69[_0x63da('0x4f')]['id']}})[_0x63da('0x13')](handleEntityNotFound(_0x2f89d3,null))[_0x63da('0x13')](function(_0x46de56){if(_0x46de56){return _0x46de56[_0x63da('0x5e')](_0x50da69['body'][_0x63da('0x5f')],_[_0x63da('0x60')](_0x50da69[_0x63da('0x5c')],[_0x63da('0x5f'),'id'])||{});}})[_0x63da('0x13')](respondWithResult(_0x2f89d3,null))[_0x63da('0x1e')](handleError(_0x2f89d3,null));};function validateUser(_0xda304c){return new BPromise(function(_0x248c9b,_0x3d5756){if(_0xda304c[_0x63da('0x61')])return _0x248c9b(_0xda304c);return db[_0x63da('0x62')][_0x63da('0x63')](0x1)['then'](function(_0x36da27){if(_0x36da27['securePassword'])authService['validatePasswordPattern'](_0xda304c['password']);db[_0x63da('0x40')][_0x63da('0x64')](_0x63da('0x61'))[_0x63da('0x13')](function(_0x35ef7d){if(_[_0x63da('0x65')](_0x35ef7d)){_0xda304c['internal']=_0x36da27[_0x63da('0x66')]||0x1;return;}if(_['isNil'](_0x36da27[_0x63da('0x66')])||_0x36da27['min_internal']===_0x35ef7d){_0xda304c['internal']=_0x35ef7d+0x1;return;}if(_0x36da27[_0x63da('0x66')]>_0x35ef7d){_0xda304c[_0x63da('0x61')]=_0x36da27[_0x63da('0x66')];return;}return db['sequelize'][_0x63da('0x43')](_0x63da('0x67'),{'type':db[_0x63da('0x68')][_0x63da('0x69')][_0x63da('0x6a')]})[_0x63da('0x13')](function(_0x5c04c1){if(_0x5c04c1&&_0x5c04c1[_0x63da('0x46')]){for(var _0x1b32a7=0x0,_0x45429d=_0x5c04c1[_0x63da('0x46')];_0x1b32a7<_0x45429d&&_[_0x63da('0x65')](_0xda304c['internal']);_0x1b32a7++){if(_0x36da27[_0x63da('0x66')]<=_0x5c04c1[_0x1b32a7][_0x63da('0x6b')]){_0xda304c[_0x63da('0x61')]=_0x5c04c1[_0x1b32a7][_0x63da('0x6b')];}else if(_0x36da27[_0x63da('0x66')]>_0x5c04c1[_0x1b32a7][_0x63da('0x6b')]&&_0x36da27[_0x63da('0x66')]<=_0x5c04c1[_0x1b32a7]['to']){_0xda304c[_0x63da('0x61')]=_0x36da27[_0x63da('0x66')];}}}if(_[_0x63da('0x65')](_0xda304c['internal'])){_0xda304c['internal']=_0x35ef7d+0x1;}return _0x248c9b(_0xda304c);});});})[_0x63da('0x1e')](function(_0x3052d2){_0x3d5756(_0x3052d2);});});}function updateUser(_0x3c352f){return new BPromise(function(_0x4614c7,_0x8e998d){try{if(_0x3c352f[_0x63da('0x6c')]){_0x3c352f[_0x63da('0x6d')]=_0x3c352f['internal'];_0x3c352f[_0x63da('0x6e')]={'mailbox':_0x3c352f['internal'],'password':_0x3c352f[_0x63da('0x6f')],'fullname':_0x3c352f[_0x63da('0x70')],'email':_0x3c352f[_0x63da('0x71')]};}if(_0x3c352f[_0x63da('0x2a')]===_0x63da('0x2e')){if(!_0x3c352f['permissions'])_0x3c352f['permissions']=[_0x63da('0x72'),_0x63da('0x73'),'103',_0x63da('0x74'),'110',_0x63da('0x75'),_0x63da('0x76'),_0x63da('0x77'),_0x63da('0x78'),'108','109','100',_0x63da('0x79'),_0x63da('0x7a'),_0x63da('0x7b')];}_0x4614c7(_0x3c352f);}catch(_0x1a6b61){_0x8e998d(_0x1a6b61);}});}exports[_0x63da('0x7c')]=function(_0x48f813,_0x617ee5){if(_0x48f813[_0x63da('0x2c')][_0x63da('0x2a')]===_0x63da('0x2e'))throw new Error(_0x63da('0x7d'));if(_0x48f813[_0x63da('0x5c')]['role']===_0x63da('0x2c')&&_0x48f813[_0x63da('0x2c')][_0x63da('0x2a')]!==_0x63da('0x7e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x48f813['body'][_0x63da('0x2a')]===_0x63da('0x7e')&&_0x48f813['user'][_0x63da('0x2a')]!==_0x63da('0x7e')){throw new Error(_0x63da('0x7f'));}return licenseUtil[_0x63da('0x80')]([_0x48f813[_0x63da('0x5c')]])['then'](function(){return validateUser(_0x48f813[_0x63da('0x5c')]);})[_0x63da('0x13')](function(_0x3fb2dd){return updateUser(_0x3fb2dd)[_0x63da('0x13')](function(_0x3e5fa8){if(_0x3e5fa8[_0x63da('0x2a')]===_0x63da('0x7e')){_0x3e5fa8[_0x63da('0x81')]=_0x48f813[_0x63da('0x2c')][_0x63da('0x81')];delete _0x3e5fa8[_0x63da('0x82')];}return _0x3e5fa8;});})[_0x63da('0x13')](function(_0x163acc){return db[_0x63da('0x40')][_0x63da('0x7c')](_0x163acc,{'include':[{'model':db[_0x63da('0x6e')],'as':_0x63da('0x6e')}]});})[_0x63da('0x13')](function(_0x305371){if(_0x48f813[_0x63da('0x5c')][_0x63da('0x2a')]==='user')return _0x305371;if(_0x48f813[_0x63da('0x2c')][_0x63da('0x2a')]!==_0x63da('0x2c'))return _0x305371;return db[_0x63da('0x83')]['find']({'where':{'name':_0x305371['role']===_0x63da('0x2e')?_0x63da('0x2d'):_0x63da('0x2f'),'userProfileId':_0x48f813[_0x63da('0x2c')]['userProfileId']},'raw':!![]})[_0x63da('0x13')](function(_0x3cc2da){if(!_0x3cc2da||_0x3cc2da['autoAssociation']!=0x0)return _0x305371;return db['UserProfileResource']['create']({'name':_0x305371[_0x63da('0x34')],'resourceId':_0x305371['id'],'type':_0x3cc2da[_0x63da('0x34')],'sectionId':_0x3cc2da['id']},{})[_0x63da('0x13')](function(){return _0x305371;});})[_0x63da('0x1e')](function(_0x1118f1){logger[_0x63da('0x1a')](_0x63da('0x84'),_0x1118f1);throw _0x1118f1;});})['then'](respondWithResult(_0x617ee5,0xc9))[_0x63da('0x1e')](handleError(_0x617ee5,null));};exports[_0x63da('0x85')]=function(_0x1d55d7,_0x1bdcf2){var _0x5184c1=_0x1d55d7[_0x63da('0x5c')];var _0xa6b906=[];if(_0x1d55d7[_0x63da('0x2c')][_0x63da('0x2a')]===_0x63da('0x2e'))throw new Error(_0x63da('0x7d'));if(_[_0x63da('0x86')](_0x5184c1,[_0x63da('0x2a'),'user'])&&_0x1d55d7['user'][_0x63da('0x2a')]!==_0x63da('0x7e')){throw new Error(_0x63da('0x87'));}if(_[_0x63da('0x86')](_0x5184c1,[_0x63da('0x2a'),_0x63da('0x7e')])&&_0x1d55d7[_0x63da('0x2c')][_0x63da('0x2a')]!==_0x63da('0x7e')){throw new Error(_0x63da('0x88'));}return licenseUtil['checkUserLimits'](_0x5184c1)[_0x63da('0x13')](function(){return validateUser(_0x5184c1[0x0]);})[_0x63da('0x13')](function(){for(var _0x280076=0x1;_0x280076<_0x5184c1['length'];_0x280076++){var _0x2f66f6=_0x5184c1[_0x280076-0x1][_0x63da('0x61')];if(!_0x5184c1[_0x280076][_0x63da('0x61')])_0x5184c1[_0x280076][_0x63da('0x61')]=_0x2f66f6+0x1;_0xa6b906[_0x63da('0x47')](validateUser(_0x5184c1[_0x280076]));}return BPromise[_0x63da('0x4d')](_0xa6b906);})['then'](function(){_0xa6b906=[];for(var _0x59b2ab=0x0;_0x59b2ab<_0x5184c1['length'];_0x59b2ab++){_0xa6b906['push'](updateUser(_0x5184c1[_0x59b2ab]));}return BPromise['all'](_0xa6b906);})[_0x63da('0x13')](function(){return BPromise[_0x63da('0x89')](_0x5184c1,function(_0x319f68){return db['User'][_0x63da('0x7c')](_0x319f68,{'include':[{'model':db[_0x63da('0x6e')],'as':_0x63da('0x6e')}]})[_0x63da('0x13')](function(_0x649658){_0x319f68['id']=_0x649658['id'];return _0x319f68;});});})[_0x63da('0x13')](function(_0x13b02f){if(_0x1d55d7['body'][_0x63da('0x2a')]==='user')return _0x13b02f;if(_0x1d55d7[_0x63da('0x2c')][_0x63da('0x2a')]!==_0x63da('0x2c'))return _0x13b02f;var _0x3028e8=_[_0x63da('0x86')](_0x13b02f,function(_0x3f3b7d){return _0x3f3b7d[_0x63da('0x2a')]==='agent'||_0x3f3b7d[_0x63da('0x2a')]===_0x63da('0x30');});if(!_0x3028e8)return _0x13b02f;return db[_0x63da('0x83')][_0x63da('0x41')]({'where':{'name':{'$or':['Agents',_0x63da('0x2f')]},'userProfileId':_0x1d55d7[_0x63da('0x2c')][_0x63da('0x82')]},'raw':!![]})[_0x63da('0x13')](function(_0xbbaa9a){if(_[_0x63da('0x8a')](_0xbbaa9a)||!_['some'](_0xbbaa9a,[_0x63da('0x8b'),0x0]))return _0x13b02f;_0xa6b906=[];var _0x4357c6=_(_0xbbaa9a)['map'](function(_0x213273){if(_0x213273[_0x63da('0x8b')]===0x1)return;return _0x213273[_0x63da('0x34')]===_0x63da('0x2d')?_0x63da('0x2e'):_0x63da('0x30');})['compact']()['value']();for(var _0x23c538=0x0;_0x23c538<_0x13b02f['length'];_0x23c538++){if(!_[_0x63da('0x3f')](_0x4357c6,_0x13b02f[_0x23c538][_0x63da('0x2a')]))return;var _0x24021f=_0x13b02f[_0x23c538]['role']===_0x63da('0x2e')?_0x63da('0x2d'):_0x63da('0x2f');_0xa6b906[_0x63da('0x47')](db[_0x63da('0x8c')][_0x63da('0x7c')]({'name':_0x13b02f[_0x23c538][_0x63da('0x34')],'resourceId':_0x13b02f[_0x23c538]['id'],'type':_0x24021f,'sectionId':_[_0x63da('0x32')](_0xbbaa9a,[_0x63da('0x34'),_0x24021f])['id']},{}));}return BPromise[_0x63da('0x4d')](_0xa6b906);});})[_0x63da('0x13')](respondWithResult(_0x1bdcf2,0xc9))[_0x63da('0x1e')](handleError(_0x1bdcf2,null));};exports[_0x63da('0x8d')]=function(_0x4f63c1,_0x3d7dc3){if(_0x4f63c1[_0x63da('0x5c')]['id']){delete _0x4f63c1['body']['id'];}return db[_0x63da('0x40')][_0x63da('0x32')]({'where':{'id':_0x4f63c1[_0x63da('0x4f')]['id']}})[_0x63da('0x13')](function(_0x20e53a){if(!_0x20e53a)return null;if(_0x20e53a['id']===_0x4f63c1[_0x63da('0x2c')]['id']){if(!_0x4f63c1[_0x63da('0x5c')][_0x63da('0x8e')]||!_0x4f63c1[_0x63da('0x5c')][_0x63da('0x8f')]){throw new db[(_0x63da('0x90'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x20e53a['authenticate'](_0x4f63c1['body'][_0x63da('0x8e')])){throw new db['Sequelize'][(_0x63da('0x91'))](_0x63da('0x92'));}if(_0x4f63c1[_0x63da('0x5c')][_0x63da('0x8e')]===_0x4f63c1['body']['newPassword']){throw new db[(_0x63da('0x90'))][(_0x63da('0x91'))](_0x63da('0x93'));}}else if(_0x4f63c1[_0x63da('0x2c')][_0x63da('0x2a')]===_0x63da('0x7e')){if(!_0x4f63c1[_0x63da('0x5c')][_0x63da('0x8f')]){throw new db[(_0x63da('0x90'))][(_0x63da('0x91'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x4f63c1[_0x63da('0x2c')][_0x63da('0x2a')]===_0x63da('0x2c')){if(!_0x4f63c1[_0x63da('0x5c')][_0x63da('0x8f')]){throw new db[(_0x63da('0x90'))][(_0x63da('0x91'))](_0x63da('0x94'));}if(_0x20e53a['role']!==_0x63da('0x2e')){throw new db['Sequelize'][(_0x63da('0x91'))](_0x63da('0x7d'));}}else{throw new db[(_0x63da('0x90'))]['ValidationError'](_0x63da('0x7d'));}return _0x20e53a;})['then'](handleEntityNotFound(_0x3d7dc3,null))[_0x63da('0x13')](function(_0x5c5162){return db[_0x63da('0x62')]['findOne']({'attributes':['id',_0x63da('0x95'),_0x63da('0x96'),_0x63da('0x97')]})['then'](function(_0x2f9c3a){if(_0x2f9c3a[_0x63da('0x95')])authService[_0x63da('0x98')](_0x4f63c1['body']['newPassword']);if(!_0x2f9c3a[_0x63da('0x96')]||!_0x5c5162[_0x63da('0x99')])return _0x5c5162;authService['validatePasswordHistory'](_0x4f63c1[_0x63da('0x5c')][_0x63da('0x8f')],_0x5c5162[_0x63da('0x99')],_0x2f9c3a[_0x63da('0x97')]);return _0x5c5162;})[_0x63da('0x13')](saveUpdates({'password':_0x4f63c1[_0x63da('0x5c')][_0x63da('0x8f')],'passwordResetAt':_0x4f63c1[_0x63da('0x2c')]['id']==_0x4f63c1[_0x63da('0x4f')]['id']?moment():null,'previousPasswords':authService[_0x63da('0x9a')](_0x4f63c1['body'][_0x63da('0x8f')],_0x5c5162[_0x63da('0x99')])},null));})[_0x63da('0x13')](respondWithResult(_0x3d7dc3,null))[_0x63da('0x1e')](handleError(_0x3d7dc3,null));};exports[_0x63da('0x9b')]=function(_0x5e4b66,_0x183dbd){var _0x16be50=_0x5e4b66[_0x63da('0x5c')]['channel'];return db['User'][_0x63da('0x32')]({'where':{'id':_0x5e4b66[_0x63da('0x4f')]['id']},'attributes':['id',_0x63da('0x34'),_0x63da('0x2a'),'online',_0x63da('0x9c'),'voicePause',_0x63da('0x9d')]})['then'](handleEntityNotFound(_0x183dbd,null))[_0x63da('0x13')](function(_0xd0f241){if(_0xd0f241){if(!utils[_0x63da('0x9e')](_0x16be50)){throw new db[(_0x63da('0x90'))][(_0x63da('0x91'))](_0x63da('0x9f'));}return _0xd0f241[_0x63da('0xa0')+_[_0x63da('0xa1')](_0x16be50[_0x63da('0xa2')]())+_0x63da('0xa3')](_0x5e4b66[_0x63da('0x5c')]['ids'],{'penalty':_0x5e4b66[_0x63da('0x5c')]['penalty']||0x0})[_0x63da('0xa4')](function(_0x15e7b1){for(var _0x2b7da1=0x0;_0x2b7da1<_0x5e4b66['body']['ids'][_0x63da('0x46')];_0x2b7da1+=0x1){var _0x1e3d80={'UserId':Number(_0x5e4b66[_0x63da('0x4f')]['id'])};_0x1e3d80[_['capitalize'](_0x16be50[_0x63da('0xa2')]())+_0x63da('0xa5')]=Number(_0x5e4b66[_0x63da('0x5c')][_0x63da('0x5f')][_0x2b7da1]);socket['emit']('user'+_['capitalize'](_0x16be50['toLowerCase']())+'Queue:save',_0x1e3d80);}return _0x15e7b1;})[_0x63da('0x13')](function(){if(_0x16be50===_0x63da('0xa6')){return db[_0x63da('0xa7')][_0x63da('0x41')]({'where':{'id':_0x5e4b66[_0x63da('0x5c')][_0x63da('0x5f')]||[]},'raw':!![],'attributes':['id',_0x63da('0x34')]});}})[_0x63da('0x13')](function(_0x1c3591){var _0x4d6e9a=_0xd0f241[_0x63da('0xa8')]({'plain':!![]});var _0x175d0e=[];if(_0x16be50===_0x63da('0xa6')&&_0x4d6e9a[_0x63da('0x2a')]===_0x63da('0x2e')&&_0x4d6e9a[_0x63da('0xa9')]){for(var _0x5f2bd5=0x0;_0x5f2bd5<_0x1c3591[_0x63da('0x46')];_0x5f2bd5+=0x1){_0x175d0e[_0x63da('0x47')]({'membername':_0x4d6e9a[_0x63da('0x34')],'UserId':_0x4d6e9a['id'],'queue_name':_0x1c3591[_0x5f2bd5][_0x63da('0x34')],'VoiceQueueId':_0x1c3591[_0x5f2bd5]['id'],'interface':_[_0x63da('0x65')](_0x4d6e9a[_0x63da('0x9d')])?util[_0x63da('0xaa')](_0x63da('0xab'),_0x4d6e9a['name']):_0x4d6e9a['interface'],'paused':_0x4d6e9a[_0x63da('0xac')]||![],'penalty':_0x5e4b66[_0x63da('0x5c')][_0x63da('0xad')]||0x0});}return BPromise[_0x63da('0x89')](_0x175d0e,function(_0x3a3254){return db[_0x63da('0xae')][_0x63da('0xaf')](_0x3a3254);});}return _0xd0f241;});}})[_0x63da('0x13')](respondWithStatusCode(_0x183dbd,null))['catch'](handleError(_0x183dbd,null));};exports[_0x63da('0xb0')]=function(_0x1d3fcf,_0x4d9e4e){var _0x19fc86;return db['User'][_0x63da('0x32')]({'where':{'id':_0x1d3fcf['params']['id']},'attributes':['id','name',_0x63da('0x2a')]})[_0x63da('0x13')](handleEntityNotFound(_0x4d9e4e,null))[_0x63da('0x13')](function(_0x1c6dbd){if(_0x1c6dbd){_0x19fc86=_0x1c6dbd;if(!_0x1d3fcf[_0x63da('0x43')][_0x63da('0xb1')]||!utils[_0x63da('0x9e')](_0x1d3fcf[_0x63da('0x43')][_0x63da('0xb1')])){throw new db['Sequelize'][(_0x63da('0x91'))](_0x63da('0x9f'));}return _0x1c6dbd[_0x63da('0xb2')+_[_0x63da('0xa1')](_0x1d3fcf['query'][_0x63da('0xb1')][_0x63da('0xa2')]())+_0x63da('0xa3')](_0x1d3fcf['query'][_0x63da('0x5f')]);}})[_0x63da('0x13')](function(_0x32f708){if(_['isArray'](_0x1d3fcf[_0x63da('0x43')][_0x63da('0x5f')])){for(var _0x1b2449=0x0;_0x1b2449<_0x1d3fcf['query'][_0x63da('0x5f')][_0x63da('0x46')];_0x1b2449+=0x1){var _0x60c2f={'UserId':Number(_0x1d3fcf[_0x63da('0x4f')]['id'])};_0x60c2f[_['capitalize'](_0x1d3fcf['query']['channel'][_0x63da('0xa2')]())+_0x63da('0xa5')]=Number(_0x1d3fcf[_0x63da('0x43')][_0x63da('0x5f')][_0x1b2449]);socket[_0x63da('0xb3')]('user'+_['capitalize'](_0x1d3fcf[_0x63da('0x43')]['channel'][_0x63da('0xa2')]())+'Queue:remove',_0x60c2f);}}else{var _0x60c2f={'UserId':Number(_0x1d3fcf[_0x63da('0x4f')]['id'])};_0x60c2f[_['capitalize'](_0x1d3fcf[_0x63da('0x43')][_0x63da('0xb1')][_0x63da('0xa2')]())+_0x63da('0xa5')]=Number(_0x1d3fcf[_0x63da('0x43')][_0x63da('0x5f')]);socket[_0x63da('0xb3')](_0x63da('0x2c')+_[_0x63da('0xa1')](_0x1d3fcf[_0x63da('0x43')][_0x63da('0xb1')][_0x63da('0xa2')]())+_0x63da('0xb4'),_0x60c2f);}return _0x32f708;})[_0x63da('0x13')](function(){if(_0x1d3fcf[_0x63da('0x43')][_0x63da('0xb1')]===_0x63da('0xa6')){return db[_0x63da('0xae')][_0x63da('0x29')]({'where':{'UserId':_0x1d3fcf[_0x63da('0x4f')]['id'],'VoiceQueueId':_0x1d3fcf[_0x63da('0x43')][_0x63da('0x5f')]},'individualHooks':!![]})['then'](function(){return _0x19fc86;});}return _0x19fc86;})[_0x63da('0x13')](respondWithStatusCode(_0x4d9e4e,null))[_0x63da('0x1e')](handleError(_0x4d9e4e,null));};exports[_0x63da('0xb5')]=function(_0x4ae159,_0x2d79c0){_0x4ae159[_0x63da('0x5c')][_0x63da('0xb6')]=_0x4ae159[_0x63da('0xb7')][_0x63da('0xb8')];return db[_0x63da('0x40')][_0x63da('0x32')]({'where':{'id':_0x4ae159['params']['id']}})[_0x63da('0x13')](handleEntityNotFound(_0x2d79c0,null))[_0x63da('0x13')](saveUpdates(_0x4ae159['body'],null))[_0x63da('0x13')](respondWithResult(_0x2d79c0,null))['catch'](handleError(_0x2d79c0,null));};exports['getAvatar']=function(_0x5d1f5d,_0x405c69){var _0x37925f=path[_0x63da('0xb9')](config[_0x63da('0xba')],_0x63da('0xbb'));return db[_0x63da('0x40')][_0x63da('0x32')]({'where':{'id':_0x5d1f5d['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x405c69,null))[_0x63da('0x13')](function(_0xf4f879){if(_0xf4f879){if(_[_0x63da('0x65')](_0xf4f879[_0x63da('0xb6')])){return _0x405c69[_0x63da('0xbc')](_0x37925f);}else{if(!fs[_0x63da('0xbd')](path[_0x63da('0xb9')](config[_0x63da('0xba')],'server/files/images/',_0xf4f879[_0x63da('0xb6')]))){return _0x405c69['download'](_0x37925f);}return _0x405c69[_0x63da('0xbc')](path[_0x63da('0xb9')](config['root'],_0x63da('0xbe'),_0xf4f879[_0x63da('0xb6')]));}}})[_0x63da('0x1e')](handleError(_0x405c69,null));};exports['getOpenTabs']=function(_0x62df58,_0x13239b){return db[_0x63da('0x40')][_0x63da('0x32')]({'where':{'id':_0x62df58[_0x63da('0x4f')]['id']},'attributes':['id']})[_0x63da('0x13')](handleEntityNotFound(_0x13239b,null))[_0x63da('0x13')](function(_0x587ec5){var _0x711851=[];values=_0x587ec5['dataValues'];_0x711851[_0x63da('0x47')](get_open_tabs(_0x63da('0x48'),_0x587ec5['dataValues']));_0x711851['push'](get_open_tabs(_0x63da('0x5a'),_0x587ec5[_0x63da('0x49')]));_0x711851[_0x63da('0x47')](get_open_tabs('openchannel',_0x587ec5[_0x63da('0x49')]));_0x711851['push'](get_open_tabs(_0x63da('0x4c'),_0x587ec5['dataValues']));_0x711851[_0x63da('0x47')](get_open_tabs(_0x63da('0x4a'),_0x587ec5[_0x63da('0x49')]));_0x711851['push'](get_open_tabs('mail',_0x587ec5[_0x63da('0x49')]));return BPromise[_0x63da('0x4d')](_0x711851);})['then'](function(_0x4c4ceb){var _0x21cfd1=[];if(_0x4c4ceb){for(var _0x4305f9=0x0;_0x4305f9=_0x233e2f['agents']){throw new Error(_0xdb9a('0x54'));}})['then'](function(){if(_0x3245c7){return db[_0xdb9a('0x2d')][_0xdb9a('0x55')]({'where':{'membername':_0x3245c7[_0xdb9a('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x3245c7){return _0x3245c7['getVoiceQueues']({'raw':!![]});}})[_0xdb9a('0x12')](function(_0x2dd1d9){if(_0x3245c7){if(_0x2dd1d9){var _0x54d1c4=[];_0x1874cf=_0x2dd1d9;if(_0x1874cf[_0xdb9a('0x32')]){for(var _0x43d985=0x0;_0x43d985<_0x1874cf[_0xdb9a('0x32')];_0x43d985++){_0x54d1c4['push'](db[_0xdb9a('0x2d')][_0xdb9a('0x56')]({'membername':_0x3245c7[_0xdb9a('0x2a')],'UserId':_0x3245c7['id'],'queue_name':_0x1874cf[_0x43d985][_0xdb9a('0x2a')],'VoiceQueueId':_0x1874cf[_0x43d985]['id'],'interface':_0x2bfd78,'paused':_0x3245c7['loginInPause']||![],'penalty':_0x1874cf[_0x43d985]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x54d1c4);}}}})[_0xdb9a('0x12')](function(){if(_0x3245c7){return db[_0xdb9a('0x2e')][_0xdb9a('0x1f')]({'where':{'membername':_0x3245c7[_0xdb9a('0x2a')],'exitAt':null}});}})[_0xdb9a('0x12')](function(_0x21028d){if(_0x3245c7){if(_0x21028d&&_0x21028d[_0xdb9a('0x32')]){var _0x23c681=[];_0x21028d['forEach'](function(_0x237e2d){_0x23c681['push'](_0x237e2d[_0xdb9a('0x3f')]({'exitAt':moment()[_0xdb9a('0x30')](_0xdb9a('0x31'))}));});return BPromise[_0xdb9a('0x48')](_0x23c681);}}})[_0xdb9a('0x12')](function(_0x3cd4df){if(_0x3245c7){var _0x1c7616=[];var _0x704635=[];var _0x1797dc=utils['getChannels']();var _0x27b235={'membername':_0x3245c7[_0xdb9a('0x2a')],'interface':_0x2bfd78,'enterAt':moment()[_0xdb9a('0x30')](_0xdb9a('0x31')),'role':_0x3245c7[_0xdb9a('0x3a')],'internal':_0x3245c7[_0xdb9a('0x2b')]};_0x1797dc['forEach'](function(_0x541cb8){_0x1c7616[_0xdb9a('0x35')](_[_0xdb9a('0x57')]({'channel':_0x541cb8,'type':'LOGIN','data1':_0xdb9a('0x58'),'data2':_0x2bfd78},_0x27b235));if(_0x3245c7[_0xdb9a('0x4e')]){_0x704635[_0xdb9a('0x35')](_[_0xdb9a('0x57')]({'channel':_0x541cb8,'type':'PAUSE','data1':'LOGININPAUSE'},_0x27b235));}});return db[_0xdb9a('0x2e')]['bulkCreate'](_0x1c7616[_0xdb9a('0x59')](_0x704635),{'individualHooks':!![]});}})[_0xdb9a('0x12')](function(){if(_0x3245c7){return _0x3245c7['update']({'online':!![],'lastLoginAt':moment()[_0xdb9a('0x30')](_0xdb9a('0x31')),'voicePause':_0x3245c7['loginInPause']||![],'mailPause':_0x3245c7[_0xdb9a('0x4e')]||![],'chatPause':_0x3245c7[_0xdb9a('0x4e')]||![],'faxPause':_0x3245c7[_0xdb9a('0x4e')]||![],'smsPause':_0x3245c7['loginInPause']||![],'openchannelPause':_0x3245c7[_0xdb9a('0x4e')]||![],'pauseType':_0x3245c7[_0xdb9a('0x4e')]?_0xdb9a('0x5a'):null,'lastPauseAt':moment()[_0xdb9a('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x2bfd78});}})[_0xdb9a('0x12')](function(_0x323c7c){_0x79267e(_0x323c7c);})[_0xdb9a('0x1d')](function(_0x209e6c){_0x4c60cb(_0x556936[_0xdb9a('0x18')](0x1f4,_0x209e6c[_0xdb9a('0x1a')]));});});}; \ No newline at end of file +var _0x337d=['all','LoginUser','mobile','loginInPause','count','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','merge','LOGIN','callysquare','concat','LOGININPAUSE','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetUser','User','findAll','options','raw','where','limit','include','model','map','attributes','then','ShowUser','debug','PauseUser','role','internal','update','MemberReport','name','PAUSE','length','format','updateAttributes','push','isNil','interface','YYYY-MM-DD\x20HH:mm:ss','body','uniqueid','bulkCreate','type','DEFAULT\x20PAUSE','UnpauseUser','isValidChannel','channel','Unknown\x20channel','voice','UserVoiceQueueRt','find','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','forEach','LogoutUser','findOne'];(function(_0x1b4489,_0x58fa8f){var _0x363e5c=function(_0xbe2e71){while(--_0xbe2e71){_0x1b4489['push'](_0x1b4489['shift']());}};_0x363e5c(++_0x58fa8f);}(_0x337d,0xcb));var _0xd337=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x337d[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd337('0x0'));var BPromise=require('bluebird');var rs=require(_0xd337('0x1'));var fs=require('fs');var Redis=require(_0xd337('0x2'));var db=require(_0xd337('0x3'))['db'];var utils=require(_0xd337('0x4'));var logger=require(_0xd337('0x5'))(_0xd337('0x6'));var config=require(_0xd337('0x7'));var jayson=require(_0xd337('0x8'));var client=jayson[_0xd337('0x9')][_0xd337('0xa')]({'port':0x232a});config[_0xd337('0xb')]=_[_0xd337('0xc')](config[_0xd337('0xb')],{'host':_0xd337('0xd'),'port':0x18eb});var socket=require(_0xd337('0xe'))(new Redis(config[_0xd337('0xb')]));require(_0xd337('0xf'))[_0xd337('0x10')](socket);function respondWithRpcPromise(_0x705742,_0x2d48b6,_0x5d7664){return new BPromise(function(_0x53a05e,_0x55c00c){return client[_0xd337('0x11')](_0x705742,_0x5d7664)['then'](function(_0x29d449){logger[_0xd337('0x12')](_0xd337('0x13'),_0x2d48b6,_0xd337('0x14'));logger['debug'](_0xd337('0x15'),_0x2d48b6,_0xd337('0x14'),JSON[_0xd337('0x16')](_0x29d449));if(_0x29d449['error']){if(_0x29d449[_0xd337('0x17')][_0xd337('0x18')]===0x1f4){logger['error'](_0xd337('0x13'),_0x2d48b6,_0x29d449['error'][_0xd337('0x19')]);return _0x55c00c(_0x29d449[_0xd337('0x17')]['message']);}logger['error'](_0xd337('0x13'),_0x2d48b6,_0x29d449[_0xd337('0x17')][_0xd337('0x19')]);return _0x53a05e(_0x29d449[_0xd337('0x17')][_0xd337('0x19')]);}else{logger['info'](_0xd337('0x13'),_0x2d48b6,_0xd337('0x14'));_0x53a05e(_0x29d449['result'][_0xd337('0x19')]);}})[_0xd337('0x1a')](function(_0x45f0d8){logger[_0xd337('0x17')]('User,\x20%s,\x20%s',_0x2d48b6,_0x45f0d8);_0x55c00c(_0x45f0d8);});});}exports[_0xd337('0x1b')]=function(_0x116ea4){var _0xabd629=this;return new Promise(function(_0x5a758c,_0x43bb86){return db[_0xd337('0x1c')][_0xd337('0x1d')]({'raw':_0x116ea4[_0xd337('0x1e')]?_0x116ea4[_0xd337('0x1e')][_0xd337('0x1f')]===undefined?!![]:![]:!![],'where':_0x116ea4[_0xd337('0x1e')]?_0x116ea4[_0xd337('0x1e')][_0xd337('0x20')]||null:null,'attributes':_0x116ea4['options']?_0x116ea4['options']['attributes']||null:null,'limit':_0x116ea4[_0xd337('0x1e')]?_0x116ea4[_0xd337('0x1e')][_0xd337('0x21')]||null:null,'include':_0x116ea4['options']?_0x116ea4[_0xd337('0x1e')][_0xd337('0x22')]?_['map'](_0x116ea4[_0xd337('0x1e')]['include'],function(_0x56417b){return{'model':db[_0x56417b[_0xd337('0x23')]],'as':_0x56417b['as'],'attributes':_0x56417b['attributes'],'include':_0x56417b['include']?_[_0xd337('0x24')](_0x56417b[_0xd337('0x22')],function(_0xe7f093){return{'model':db[_0xe7f093[_0xd337('0x23')]],'as':_0xe7f093['as'],'attributes':_0xe7f093[_0xd337('0x25')],'include':_0xe7f093['include']?_[_0xd337('0x24')](_0xe7f093[_0xd337('0x22')],function(_0x30a449){return{'model':db[_0x30a449[_0xd337('0x23')]],'as':_0x30a449['as'],'attributes':_0x30a449['attributes']};}):[]};}):[]};}):[]:[]})[_0xd337('0x26')](function(_0x2506c2){logger[_0xd337('0x12')](_0xd337('0x1b'),_0x116ea4);logger['debug'](_0xd337('0x1b'),_0x116ea4,JSON['stringify'](_0x2506c2));_0x5a758c(_0x2506c2);})[_0xd337('0x1a')](function(_0x25ecef){logger[_0xd337('0x17')](_0xd337('0x1b'),_0x25ecef[_0xd337('0x19')],_0x116ea4);_0x43bb86(_0xabd629['error'](0x1f4,_0x25ecef[_0xd337('0x19')]));});});};exports[_0xd337('0x27')]=function(_0x2ebde0){var _0x329197=this;return new Promise(function(_0x53ab4a,_0x1560ea){return db['User']['find']({'raw':_0x2ebde0[_0xd337('0x1e')]?_0x2ebde0[_0xd337('0x1e')][_0xd337('0x1f')]===undefined?!![]:![]:!![],'where':_0x2ebde0[_0xd337('0x1e')]?_0x2ebde0[_0xd337('0x1e')][_0xd337('0x20')]||null:null,'attributes':_0x2ebde0[_0xd337('0x1e')]?_0x2ebde0['options'][_0xd337('0x25')]||null:null,'include':_0x2ebde0['options']?_0x2ebde0[_0xd337('0x1e')][_0xd337('0x22')]?_[_0xd337('0x24')](_0x2ebde0[_0xd337('0x1e')][_0xd337('0x22')],function(_0x5f11cb){return{'model':db[_0x5f11cb[_0xd337('0x23')]],'as':_0x5f11cb['as'],'attributes':_0x5f11cb['attributes'],'include':_0x5f11cb[_0xd337('0x22')]?_[_0xd337('0x24')](_0x5f11cb[_0xd337('0x22')],function(_0x709521){return{'model':db[_0x709521[_0xd337('0x23')]],'as':_0x709521['as'],'attributes':_0x709521[_0xd337('0x25')],'include':_0x709521['include']?_[_0xd337('0x24')](_0x709521[_0xd337('0x22')],function(_0x399794){return{'model':db[_0x399794[_0xd337('0x23')]],'as':_0x399794['as'],'attributes':_0x399794[_0xd337('0x25')]};}):[]};}):[]};}):[]:[]})[_0xd337('0x26')](function(_0x28589b){logger[_0xd337('0x12')](_0xd337('0x27'),_0x2ebde0);logger[_0xd337('0x28')](_0xd337('0x27'),_0x2ebde0,JSON[_0xd337('0x16')](_0x28589b));_0x53ab4a(_0x28589b);})[_0xd337('0x1a')](function(_0x16086e){logger[_0xd337('0x17')]('ShowUser',_0x16086e[_0xd337('0x19')],_0x2ebde0);_0x1560ea(_0x329197[_0xd337('0x17')](0x1f4,_0x16086e['message']));});});};exports[_0xd337('0x29')]=function(_0x58bf05){var _0x768352=this;return new Promise(function(_0x15d952,_0x4540ac){var _0x3f5782;return db[_0xd337('0x1c')]['find']({'where':_0x58bf05[_0xd337('0x1e')]['where']||{},'attributes':['id','name',_0xd337('0x2a'),_0xd337('0x2b'),'interface']})[_0xd337('0x26')](function(_0x56489d){if(_0x56489d){_0x3f5782=_0x56489d;return db['UserVoiceQueueRt'][_0xd337('0x2c')]({'paused':0x1},{'where':{'UserId':_0x3f5782['id']},'individualHooks':!![]});}})['then'](function(){if(_0x3f5782){return db[_0xd337('0x2d')]['findAll']({'where':{'membername':_0x3f5782[_0xd337('0x2e')],'type':_0xd337('0x2f'),'exitAt':null}});}})[_0xd337('0x26')](function(_0x1adaa8){if(_0x3f5782){if(_0x1adaa8&&_0x1adaa8[_0xd337('0x30')]){var _0x3dffca=moment()[_0xd337('0x31')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x306a31=0x0,_0x57fce7=_0x1adaa8[_0xd337('0x30')];_0x306a31<_0x57fce7;_0x306a31++){_0x1adaa8[_0x306a31][_0xd337('0x32')]({'exitAt':_0x3dffca});}}}})[_0xd337('0x26')](function(){if(_0x3f5782){var _0x13f043=[];var _0x5c5cfc=utils['getChannels']();_0x5c5cfc['forEach'](function(_0x54cf86){_0x13f043[_0xd337('0x33')]({'channel':_0x54cf86,'membername':_0x3f5782[_0xd337('0x2e')],'interface':_[_0xd337('0x34')](_0x3f5782[_0xd337('0x35')])?util[_0xd337('0x31')]('SIP/%s',_0x3f5782[_0xd337('0x2e')]):_0x3f5782[_0xd337('0x35')],'type':_0xd337('0x2f'),'enterAt':moment()[_0xd337('0x31')](_0xd337('0x36')),'data1':_0x58bf05[_0xd337('0x37')]['type']||'DEFAULT\x20PAUSE','role':_0x3f5782[_0xd337('0x2a')],'internal':_0x3f5782[_0xd337('0x2b')],'uniqueid':_0x58bf05[_0xd337('0x37')][_0xd337('0x38')]||null});});return db['MemberReport'][_0xd337('0x39')](_0x13f043,{'individualHooks':!![]});}})[_0xd337('0x26')](function(){if(_0x3f5782){return _0x3f5782[_0xd337('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x58bf05[_0xd337('0x37')][_0xd337('0x3a')]||_0xd337('0x3b'),'lastPauseAt':moment()[_0xd337('0x31')](_0xd337('0x36'))});}})['then'](function(_0x2cfad8){_0x15d952(_0x2cfad8);})['catch'](function(_0x1f666a){_0x4540ac(_0x768352['error'](0x1f4,_0x1f666a[_0xd337('0x19')]));});});};exports[_0xd337('0x3c')]=function(_0x531dbf){var _0x1e7405=this;return new Promise(function(_0x2e201f,_0x14e564){var _0x48a9ef;return db['User']['findOne']({'where':_0x531dbf[_0xd337('0x1e')][_0xd337('0x20')]||{},'attributes':['id',_0xd337('0x2e')]})[_0xd337('0x26')](function(_0x9ea943){if(_0x9ea943){_0x48a9ef=_0x9ea943;if(_0x531dbf['body']['channel']&&!utils[_0xd337('0x3d')](_0x531dbf[_0xd337('0x37')][_0xd337('0x3e')])){throw new Error(_0xd337('0x3f'));}switch(_0x531dbf[_0xd337('0x37')]['channel']){case _0xd337('0x40'):return db[_0xd337('0x41')][_0xd337('0x2c')]({'paused':0x0},{'where':{'UserId':_0x48a9ef['id']}})[_0xd337('0x26')](function(){return db[_0xd337('0x2d')][_0xd337('0x42')]({'where':{'channel':_0x531dbf[_0xd337('0x37')][_0xd337('0x3e')],'membername':_0x48a9ef['name'],'type':'PAUSE','exitAt':null}});})[_0xd337('0x26')](function(_0x51f3b5){if(_0x51f3b5){return _0x51f3b5[_0xd337('0x2c')]({'exitAt':moment()[_0xd337('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xd337('0x43')},{'individualHooks':!![]});}return null;})[_0xd337('0x26')](function(){return _0x48a9ef[_0xd337('0x2c')]({'voicePause':![]});});case _0xd337('0x44'):case _0xd337('0x45'):case _0xd337('0x46'):case _0xd337('0x47'):case _0xd337('0x48'):case _0xd337('0x49'):return db[_0xd337('0x2d')][_0xd337('0x42')]({'where':{'channel':_0x531dbf[_0xd337('0x37')][_0xd337('0x3e')],'membername':_0x48a9ef['name'],'type':_0xd337('0x2f'),'exitAt':null}})[_0xd337('0x26')](function(_0x503fba){return _0x503fba['update']({'exitAt':moment()[_0xd337('0x31')](_0xd337('0x36')),'data2':_0xd337('0x43')},{'individualHooks':!![]});})['then'](function(){var _0xabc6ac={};_[_0xd337('0x4a')](_0xabc6ac,util['format'](_0xd337('0x4b'),_0x531dbf[_0xd337('0x37')]['channel'],'Pause'),![]);return _0x48a9ef[_0xd337('0x2c')](_0xabc6ac);});default:return db[_0xd337('0x41')][_0xd337('0x2c')]({'paused':0x0},{'where':{'UserId':_0x48a9ef['id']}})[_0xd337('0x26')](function(){return db[_0xd337('0x2d')]['findAll']({'where':{'membername':_0x48a9ef[_0xd337('0x2e')],'type':'PAUSE','exitAt':null}});})[_0xd337('0x26')](function(_0x4f064c){var _0x2872af=[];_0x4f064c[_0xd337('0x4c')](function(_0x5246c0){_0x2872af[_0xd337('0x33')](_0x5246c0[_0xd337('0x2c')]({'exitAt':moment()[_0xd337('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'}));});return BPromise['all'](_0x2872af);})['then'](function(){return _0x48a9ef[_0xd337('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xd337('0x26')](function(_0x19648b){_0x2e201f(_0x19648b);})[_0xd337('0x1a')](function(_0x4207d4){_0x14e564(_0x1e7405[_0xd337('0x17')](0x1f4,_0x4207d4[_0xd337('0x19')]));});});};exports[_0xd337('0x4d')]=function(_0x10c519){var _0x795daa=this;return new Promise(function(_0x5dd183,_0x125b91){var _0xad16b8;return db[_0xd337('0x1c')][_0xd337('0x4e')]({'where':_0x10c519[_0xd337('0x1e')][_0xd337('0x20')]||{},'attributes':['id',_0xd337('0x2e')]})[_0xd337('0x26')](function(_0x176341){if(_0x176341){_0xad16b8=_0x176341;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0xad16b8['name']},'individualHooks':!![]});}})[_0xd337('0x26')](function(){if(_0xad16b8){return db[_0xd337('0x2d')][_0xd337('0x1d')]({'where':{'membername':_0xad16b8['name'],'exitAt':null}});}})['then'](function(_0x12ddfd){if(_0xad16b8){if(_0x12ddfd&&_0x12ddfd['length']){var _0x1cfd31=[];_0x12ddfd[_0xd337('0x4c')](function(_0xe37a29){_0x1cfd31[_0xd337('0x33')](_0xe37a29[_0xd337('0x2c')]({'exitAt':moment()['format'](_0xd337('0x36'))}));});return BPromise[_0xd337('0x4f')](_0x1cfd31);}}})[_0xd337('0x26')](function(){if(_0xad16b8){return _0xad16b8[_0xd337('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd337('0x26')](function(_0x13c959){_0x5dd183(_0x13c959);})[_0xd337('0x1a')](function(_0x215d3f){_0x125b91(_0x795daa[_0xd337('0x17')](0x1f4,_0x215d3f[_0xd337('0x19')]));});});};exports[_0xd337('0x50')]=function(_0x1eb6c3){var _0x1b7e01=this;return new Promise(function(_0x2afd25,_0x2910ae){var _0x24bece;var _0x357568;var _0x1984fb;var _0x2493a0;return db[_0xd337('0x1c')]['findOne']({'where':_0x1eb6c3[_0xd337('0x1e')][_0xd337('0x20')]||{},'attributes':['id',_0xd337('0x2e'),_0xd337('0x2a'),_0xd337('0x51'),'phone',_0xd337('0x2b'),_0xd337('0x52'),_0xd337('0x35')]})[_0xd337('0x26')](function(_0x42b56e){if(_0x42b56e){_0x24bece=_0x42b56e;_0x2493a0=_0x1eb6c3['body'][_0xd337('0x35')]?_0x1eb6c3[_0xd337('0x37')][_0xd337('0x35')]:util[_0xd337('0x31')]('SIP/%s',_0x24bece['name']);return db['User'][_0xd337('0x53')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x24bece['id']}}});}})['then'](function(_0x3d626c){if(_0x3d626c){_0x1984fb=_0x3d626c;return require(_0xd337('0x54'))['getLicense']();}})['then'](function(_0x5cb3ff){if(_0x5cb3ff&&_0x5cb3ff['agents']&&_0x1984fb>=_0x5cb3ff[_0xd337('0x55')]){throw new Error(_0xd337('0x56'));}})[_0xd337('0x26')](function(){if(_0x24bece){return db[_0xd337('0x41')][_0xd337('0x57')]({'where':{'membername':_0x24bece[_0xd337('0x2e')]},'individualHooks':!![]});}})['then'](function(){if(_0x24bece){return _0x24bece[_0xd337('0x58')]({'raw':!![]});}})[_0xd337('0x26')](function(_0x1b6d02){if(_0x24bece){if(_0x1b6d02){var _0x408754=[];_0x357568=_0x1b6d02;if(_0x357568[_0xd337('0x30')]){for(var _0x1ec134=0x0;_0x1ec134<_0x357568[_0xd337('0x30')];_0x1ec134++){_0x408754[_0xd337('0x33')](db[_0xd337('0x41')]['upsert']({'membername':_0x24bece[_0xd337('0x2e')],'UserId':_0x24bece['id'],'queue_name':_0x357568[_0x1ec134]['name'],'VoiceQueueId':_0x357568[_0x1ec134]['id'],'interface':_0x2493a0,'paused':_0x24bece[_0xd337('0x52')]||![],'penalty':_0x357568[_0x1ec134]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xd337('0x4f')](_0x408754);}}}})['then'](function(){if(_0x24bece){return db[_0xd337('0x2d')][_0xd337('0x1d')]({'where':{'membername':_0x24bece[_0xd337('0x2e')],'exitAt':null}});}})['then'](function(_0x38a734){if(_0x24bece){if(_0x38a734&&_0x38a734[_0xd337('0x30')]){var _0x43666c=[];_0x38a734[_0xd337('0x4c')](function(_0x466f36){_0x43666c[_0xd337('0x33')](_0x466f36[_0xd337('0x2c')]({'exitAt':moment()[_0xd337('0x31')](_0xd337('0x36'))}));});return BPromise['all'](_0x43666c);}}})[_0xd337('0x26')](function(_0x112c74){if(_0x24bece){var _0x5c0393=[];var _0x3f9268=[];var _0x57f627=utils['getChannels']();var _0x409b27={'membername':_0x24bece[_0xd337('0x2e')],'interface':_0x2493a0,'enterAt':moment()[_0xd337('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x24bece[_0xd337('0x2a')],'internal':_0x24bece['internal']};_0x57f627[_0xd337('0x4c')](function(_0xf6d3a1){_0x5c0393[_0xd337('0x33')](_[_0xd337('0x59')]({'channel':_0xf6d3a1,'type':_0xd337('0x5a'),'data1':_0xd337('0x5b'),'data2':_0x2493a0},_0x409b27));if(_0x24bece[_0xd337('0x52')]){_0x3f9268['push'](_[_0xd337('0x59')]({'channel':_0xf6d3a1,'type':_0xd337('0x2f'),'data1':'LOGININPAUSE'},_0x409b27));}});return db['MemberReport']['bulkCreate'](_0x5c0393[_0xd337('0x5c')](_0x3f9268),{'individualHooks':!![]});}})[_0xd337('0x26')](function(){if(_0x24bece){return _0x24bece[_0xd337('0x2c')]({'online':!![],'lastLoginAt':moment()[_0xd337('0x31')](_0xd337('0x36')),'voicePause':_0x24bece[_0xd337('0x52')]||![],'mailPause':_0x24bece[_0xd337('0x52')]||![],'chatPause':_0x24bece[_0xd337('0x52')]||![],'faxPause':_0x24bece[_0xd337('0x52')]||![],'smsPause':_0x24bece[_0xd337('0x52')]||![],'openchannelPause':_0x24bece[_0xd337('0x52')]||![],'pauseType':_0x24bece[_0xd337('0x52')]?_0xd337('0x5d'):null,'lastPauseAt':moment()['format'](_0xd337('0x36')),'interface':_0x2493a0});}})['then'](function(_0x213c77){_0x2afd25(_0x213c77);})[_0xd337('0x1a')](function(_0x4f39ce){_0x2910ae(_0x1b7e01[_0xd337('0x17')](0x1f4,_0x4f39ce['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 1d25d97..e8bb93d 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 _0x5814=['removeListener','register','length','user:','./user.events','remove','update'];(function(_0x49d21f,_0x6e7f5){var _0x1b93f2=function(_0x1cd8e7){while(--_0x1cd8e7){_0x49d21f['push'](_0x49d21f['shift']());}};_0x1b93f2(++_0x6e7f5);}(_0x5814,0xc8));var _0x4581=function(_0x3f9fed,_0x1af106){_0x3f9fed=_0x3f9fed-0x0;var _0x1dd0a1=_0x5814[_0x3f9fed];return _0x1dd0a1;};'use strict';var UserEvents=require(_0x4581('0x0'));var events=['save',_0x4581('0x1'),_0x4581('0x2')];function createListener(_0x18355d,_0x5c7733){return function(_0x203a5b){_0x5c7733['emit'](_0x18355d,_0x203a5b);};}function removeListener(_0x3d6a29,_0x2777a9){return function(){UserEvents[_0x4581('0x3')](_0x3d6a29,_0x2777a9);};}exports[_0x4581('0x4')]=function(_0x280118){for(var _0x547dac=0x0,_0x5ef580=events[_0x4581('0x5')];_0x547dac<_0x5ef580;_0x547dac++){var _0xff79aa=events[_0x547dac];var _0x375bcf=createListener(_0x4581('0x6')+_0xff79aa,_0x280118);UserEvents['on'](_0xff79aa,_0x375bcf);}}; \ No newline at end of file +var _0x98ca=['save','update','removeListener','register','user:','./user.events'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x98ca,0x15b));var _0xa98c=function(_0x49aa1a,_0x5a2302){_0x49aa1a=_0x49aa1a-0x0;var _0x2ab62a=_0x98ca[_0x49aa1a];return _0x2ab62a;};'use strict';var UserEvents=require(_0xa98c('0x0'));var events=[_0xa98c('0x1'),'remove',_0xa98c('0x2')];function createListener(_0x332c08,_0x1ce45d){return function(_0x28d1a4){_0x1ce45d['emit'](_0x332c08,_0x28d1a4);};}function removeListener(_0x28026b,_0x4c16d0){return function(){UserEvents[_0xa98c('0x3')](_0x28026b,_0x4c16d0);};}exports[_0xa98c('0x4')]=function(_0xb19fee){for(var _0x4f1546=0x0,_0x510eb3=events['length'];_0x4f1546<_0x510eb3;_0x4f1546++){var _0xeeae0a=events[_0x4f1546];var _0x5eb914=createListener(_0xa98c('0x5')+_0xeeae0a,_0xb19fee);UserEvents['on'](_0xeeae0a,_0x5eb914);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 6c90b59..562f53a 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1595ff,_0x238718){var _0x571b9d=function(_0x403228){while(--_0x403228){_0x1595ff['push'](_0x1595ff['shift']());}};_0x571b9d(++_0x238718);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x8495da,_0x431a31){var _0x205387=function(_0x86d1b6){while(--_0x86d1b6){_0x8495da['push'](_0x8495da['shift']());}};_0x205387(++_0x431a31);}(_0x70e0,0x17b));var _0x070e=function(_0x2885f1,_0x2645c6){_0x2885f1=_0x2885f1-0x0;var _0x349663=_0x70e0[_0x2885f1];return _0x349663;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index febd50f..438ea72 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 _0xacde=['INTEGER','sequelize','exports'];(function(_0x195c5c,_0x2cf583){var _0x9a388=function(_0x4900db){while(--_0x4900db){_0x195c5c['push'](_0x195c5c['shift']());}};_0x9a388(++_0x2cf583);}(_0xacde,0x1cf));var _0xeacd=function(_0x1418a5,_0x19c106){_0x1418a5=_0x1418a5-0x0;var _0x22c849=_0xacde[_0x1418a5];return _0x22c849;};'use strict';var Sequelize=require(_0xeacd('0x0'));module[_0xeacd('0x1')]={'penalty':{'type':Sequelize[_0xeacd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xafa3=['INTEGER'];(function(_0x575fdc,_0x50c603){var _0x36c057=function(_0x5bfc7b){while(--_0x5bfc7b){_0x575fdc['push'](_0x575fdc['shift']());}};_0x36c057(++_0x50c603);}(_0xafa3,0x174));var _0x3afa=function(_0x11eb1f,_0x826f0b){_0x11eb1f=_0x11eb1f-0x0;var _0x2121e9=_0xafa3[_0x11eb1f];return _0x2121e9;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x3afa('0x0')],'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 6d11957..6574d11 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 _0x615e=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./userChatQueue.attributes'];(function(_0x11314c,_0x2ca8d7){var _0x12cb4a=function(_0x5e7ddc){while(--_0x5e7ddc){_0x11314c['push'](_0x11314c['shift']());}};_0x12cb4a(++_0x2ca8d7);}(_0x615e,0x1b1));var _0xe615=function(_0x3ad6d6,_0x55d488){_0x3ad6d6=_0x3ad6d6-0x0;var _0x26b0e6=_0x615e[_0x3ad6d6];return _0x26b0e6;};'use strict';var _=require(_0xe615('0x0'));var util=require(_0xe615('0x1'));var logger=require(_0xe615('0x2'))(_0xe615('0x3'));var moment=require(_0xe615('0x4'));var BPromise=require(_0xe615('0x5'));var rp=require(_0xe615('0x6'));var fs=require('fs');var path=require(_0xe615('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe615('0x8'));module[_0xe615('0x9')]=function(_0xe104ed,_0x592cfa){return _0xe104ed[_0xe615('0xa')](_0xe615('0xb'),attributes,{'tableName':_0xe615('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe008=['bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util','../../config/logger','api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe008,0xf3));var _0x8e00=function(_0x5c8e6e,_0x3faa0e){_0x5c8e6e=_0x5c8e6e-0x0;var _0x1c3734=_0xe008[_0x5c8e6e];return _0x1c3734;};'use strict';var _=require(_0x8e00('0x0'));var util=require(_0x8e00('0x1'));var logger=require(_0x8e00('0x2'))(_0x8e00('0x3'));var moment=require('moment');var BPromise=require(_0x8e00('0x4'));var rp=require(_0x8e00('0x5'));var fs=require('fs');var path=require(_0x8e00('0x6'));var rimraf=require(_0x8e00('0x7'));var config=require(_0x8e00('0x8'));var attributes=require(_0x8e00('0x9'));module[_0x8e00('0xa')]=function(_0xe0469,_0x4c90a6){return _0xe0469[_0x8e00('0xb')]('UserChatQueue',attributes,{'tableName':_0x8e00('0xc'),'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 fe8f0bb..4eee520 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 _0xed75=['stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x31be3e,_0x15d41e){var _0x49847a=function(_0x106a0c){while(--_0x106a0c){_0x31be3e['push'](_0x31be3e['shift']());}};_0x49847a(++_0x15d41e);}(_0xed75,0xf5));var _0x5ed7=function(_0x262882,_0x54c08c){_0x262882=_0x262882-0x0;var _0x5b0d1a=_0xed75[_0x262882];return _0x5b0d1a;};'use strict';var _=require(_0x5ed7('0x0'));var util=require(_0x5ed7('0x1'));var moment=require(_0x5ed7('0x2'));var BPromise=require(_0x5ed7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ed7('0x4'));var db=require(_0x5ed7('0x5'))['db'];var utils=require(_0x5ed7('0x6'));var logger=require(_0x5ed7('0x7'))(_0x5ed7('0x8'));var config=require('../../config/environment');var jayson=require(_0x5ed7('0x9'));var client=jayson['client'][_0x5ed7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e8fd9,_0x3823ca,_0x4dde9a){return new BPromise(function(_0x1ad737,_0x27dcf1){return client['request'](_0x4e8fd9,_0x4dde9a)[_0x5ed7('0xb')](function(_0x21b13c){logger[_0x5ed7('0xc')](_0x5ed7('0xd'),_0x3823ca,_0x5ed7('0xe'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x3823ca,_0x5ed7('0xe'),JSON[_0x5ed7('0xf')](_0x21b13c));if(_0x21b13c[_0x5ed7('0x10')]){if(_0x21b13c['error']['code']===0x1f4){logger[_0x5ed7('0x10')](_0x5ed7('0xd'),_0x3823ca,_0x21b13c[_0x5ed7('0x10')]['message']);return _0x27dcf1(_0x21b13c['error'][_0x5ed7('0x11')]);}logger[_0x5ed7('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x3823ca,_0x21b13c[_0x5ed7('0x10')]['message']);return _0x1ad737(_0x21b13c[_0x5ed7('0x10')][_0x5ed7('0x11')]);}else{logger[_0x5ed7('0xc')](_0x5ed7('0xd'),_0x3823ca,_0x5ed7('0xe'));_0x1ad737(_0x21b13c[_0x5ed7('0x12')]['message']);}})[_0x5ed7('0x13')](function(_0x328255){logger['error'](_0x5ed7('0xd'),_0x3823ca,_0x328255);_0x27dcf1(_0x328255);});});} \ No newline at end of file +var _0xc00e=['UserChatQueue,\x20%s,\x20%s','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x50b148,_0x198a78){var _0x371a7a=function(_0x5ab93f){while(--_0x5ab93f){_0x50b148['push'](_0x50b148['shift']());}};_0x371a7a(++_0x198a78);}(_0xc00e,0xdd));var _0xec00=function(_0x523615,_0x11ae42){_0x523615=_0x523615-0x0;var _0x5ef9b3=_0xc00e[_0x523615];return _0x5ef9b3;};'use strict';var _=require(_0xec00('0x0'));var util=require(_0xec00('0x1'));var moment=require('moment');var BPromise=require(_0xec00('0x2'));var rs=require(_0xec00('0x3'));var fs=require('fs');var Redis=require(_0xec00('0x4'));var db=require(_0xec00('0x5'))['db'];var utils=require(_0xec00('0x6'));var logger=require('../../config/logger')(_0xec00('0x7'));var config=require(_0xec00('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xec00('0x9')][_0xec00('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22408f,_0xc5ea4a,_0x5c7dd7){return new BPromise(function(_0x2efad7,_0x13e6bf){return client[_0xec00('0xb')](_0x22408f,_0x5c7dd7)[_0xec00('0xc')](function(_0xa42d1c){logger[_0xec00('0xd')]('UserChatQueue,\x20%s,\x20%s',_0xc5ea4a,_0xec00('0xe'));logger[_0xec00('0xf')](_0xec00('0x10'),_0xc5ea4a,_0xec00('0xe'),JSON[_0xec00('0x11')](_0xa42d1c));if(_0xa42d1c[_0xec00('0x12')]){if(_0xa42d1c['error'][_0xec00('0x13')]===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0xc5ea4a,_0xa42d1c[_0xec00('0x12')][_0xec00('0x14')]);return _0x13e6bf(_0xa42d1c['error'][_0xec00('0x14')]);}logger[_0xec00('0x12')](_0xec00('0x15'),_0xc5ea4a,_0xa42d1c['error'][_0xec00('0x14')]);return _0x2efad7(_0xa42d1c[_0xec00('0x12')]['message']);}else{logger[_0xec00('0xd')](_0xec00('0x15'),_0xc5ea4a,_0xec00('0xe'));_0x2efad7(_0xa42d1c['result']['message']);}})['catch'](function(_0x186972){logger[_0xec00('0x12')]('UserChatQueue,\x20%s,\x20%s',_0xc5ea4a,_0x186972);_0x13e6bf(_0x186972);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 2a6502f..8cdfa29 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x42d59f,_0x3b2853){var _0x4c8a04=function(_0x192fe5){while(--_0x192fe5){_0x42d59f['push'](_0x42d59f['shift']());}};_0x4c8a04(++_0x3b2853);}(_0x70e0,0x17b));var _0x070e=function(_0x3f33b9,_0x4eb0d6){_0x3f33b9=_0x3f33b9-0x0;var _0x40447c=_0x70e0[_0x3f33b9];return _0x40447c;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x13ab7f,_0x35c4f9){var _0x28c68e=function(_0x570aea){while(--_0x570aea){_0x13ab7f['push'](_0x13ab7f['shift']());}};_0x28c68e(++_0x35c4f9);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'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 5b9c150..4bf930e 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 _0xc19c=['sequelize','exports','INTEGER','STRING'];(function(_0x333520,_0x819658){var _0x58f409=function(_0x372b16){while(--_0x372b16){_0x333520['push'](_0x333520['shift']());}};_0x58f409(++_0x819658);}(_0xc19c,0xcc));var _0xcc19=function(_0x5cfeeb,_0x2af3c4){_0x5cfeeb=_0x5cfeeb-0x0;var _0x43fd28=_0xc19c[_0x5cfeeb];return _0x43fd28;};'use strict';var Sequelize=require(_0xcc19('0x0'));module[_0xcc19('0x1')]={'penalty':{'type':Sequelize[_0xcc19('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcc19('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xcc19('0x3')]}}; \ No newline at end of file +var _0x7580=['STRING','sequelize','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7580,0x1ed));var _0x0758=function(_0x4c80a6,_0x405a07){_0x4c80a6=_0x4c80a6-0x0;var _0xee6071=_0x7580[_0x4c80a6];return _0xee6071;};'use strict';var Sequelize=require(_0x0758('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0758('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0758('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 9618790..2da683e 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 _0xd548=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x10791d,_0x2562b6){var _0x1b4f9c=function(_0x3b2815){while(--_0x3b2815){_0x10791d['push'](_0x10791d['shift']());}};_0x1b4f9c(++_0x2562b6);}(_0xd548,0x86));var _0x8d54=function(_0x2678d7,_0x183a22){_0x2678d7=_0x2678d7-0x0;var _0x28b82e=_0xd548[_0x2678d7];return _0x28b82e;};'use strict';var _=require(_0x8d54('0x0'));var util=require(_0x8d54('0x1'));var logger=require(_0x8d54('0x2'))('api');var moment=require(_0x8d54('0x3'));var BPromise=require(_0x8d54('0x4'));var rp=require(_0x8d54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d54('0x6'));var config=require(_0x8d54('0x7'));var attributes=require(_0x8d54('0x8'));module[_0x8d54('0x9')]=function(_0x42fdf3,_0x425906){return _0x42fdf3[_0x8d54('0xa')](_0x8d54('0xb'),attributes,{'tableName':_0x8d54('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6221=['api','moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','define','UserFaxQueue','lodash','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6221,0xed));var _0x1622=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0x6221[_0x4e198a];return _0xb84bfe;};'use strict';var _=require(_0x1622('0x0'));var util=require(_0x1622('0x1'));var logger=require(_0x1622('0x2'))(_0x1622('0x3'));var moment=require(_0x1622('0x4'));var BPromise=require(_0x1622('0x5'));var rp=require(_0x1622('0x6'));var fs=require('fs');var path=require(_0x1622('0x7'));var rimraf=require(_0x1622('0x8'));var config=require('../../config/environment');var attributes=require(_0x1622('0x9'));module['exports']=function(_0x58d8be,_0x59c3ef){return _0x58d8be[_0x1622('0xa')](_0x1622('0xb'),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 7dda2aa..09f0a9b 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 _0x633b=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash'];(function(_0x411c72,_0xc9251e){var _0x23e16a=function(_0x5a13db){while(--_0x5a13db){_0x411c72['push'](_0x411c72['shift']());}};_0x23e16a(++_0xc9251e);}(_0x633b,0x1a1));var _0xb633=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x633b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb633('0x0'));var util=require(_0xb633('0x1'));var moment=require(_0xb633('0x2'));var BPromise=require(_0xb633('0x3'));var rs=require(_0xb633('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb633('0x5'))['db'];var utils=require(_0xb633('0x6'));var logger=require(_0xb633('0x7'))(_0xb633('0x8'));var config=require('../../config/environment');var jayson=require(_0xb633('0x9'));var client=jayson[_0xb633('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c27bf,_0x3d9f8e,_0x3533ce){return new BPromise(function(_0x4be079,_0x48ef2d){return client[_0xb633('0xb')](_0x2c27bf,_0x3533ce)['then'](function(_0x83d646){logger['info'](_0xb633('0xc'),_0x3d9f8e,'request\x20sent');logger[_0xb633('0xd')](_0xb633('0xe'),_0x3d9f8e,_0xb633('0xf'),JSON['stringify'](_0x83d646));if(_0x83d646['error']){if(_0x83d646[_0xb633('0x10')][_0xb633('0x11')]===0x1f4){logger[_0xb633('0x10')](_0xb633('0xc'),_0x3d9f8e,_0x83d646[_0xb633('0x10')][_0xb633('0x12')]);return _0x48ef2d(_0x83d646['error'][_0xb633('0x12')]);}logger[_0xb633('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x3d9f8e,_0x83d646['error'][_0xb633('0x12')]);return _0x4be079(_0x83d646[_0xb633('0x10')][_0xb633('0x12')]);}else{logger[_0xb633('0x13')](_0xb633('0xc'),_0x3d9f8e,_0xb633('0xf'));_0x4be079(_0x83d646[_0xb633('0x14')]['message']);}})[_0xb633('0x15')](function(_0x5954de){logger[_0xb633('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x3d9f8e,_0x5954de);_0x48ef2d(_0x5954de);});});} \ No newline at end of file +var _0xe016=['message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b5c23,_0x101faa){var _0x262cfd=function(_0x48aa2a){while(--_0x48aa2a){_0x4b5c23['push'](_0x4b5c23['shift']());}};_0x262cfd(++_0x101faa);}(_0xe016,0xcc));var _0x6e01=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xe016[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x6e01('0x0'));var util=require('util');var moment=require(_0x6e01('0x1'));var BPromise=require(_0x6e01('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e01('0x3'));var db=require(_0x6e01('0x4'))['db'];var utils=require(_0x6e01('0x5'));var logger=require(_0x6e01('0x6'))(_0x6e01('0x7'));var config=require(_0x6e01('0x8'));var jayson=require(_0x6e01('0x9'));var client=jayson[_0x6e01('0xa')][_0x6e01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b6b14,_0x459feb,_0x3b2d5a){return new BPromise(function(_0x4dfb47,_0x3f4e44){return client[_0x6e01('0xc')](_0x5b6b14,_0x3b2d5a)[_0x6e01('0xd')](function(_0x4f7c59){logger['info'](_0x6e01('0xe'),_0x459feb,_0x6e01('0xf'));logger[_0x6e01('0x10')](_0x6e01('0x11'),_0x459feb,_0x6e01('0xf'),JSON[_0x6e01('0x12')](_0x4f7c59));if(_0x4f7c59[_0x6e01('0x13')]){if(_0x4f7c59[_0x6e01('0x13')][_0x6e01('0x14')]===0x1f4){logger['error'](_0x6e01('0xe'),_0x459feb,_0x4f7c59[_0x6e01('0x13')][_0x6e01('0x15')]);return _0x3f4e44(_0x4f7c59[_0x6e01('0x13')][_0x6e01('0x15')]);}logger[_0x6e01('0x13')](_0x6e01('0xe'),_0x459feb,_0x4f7c59[_0x6e01('0x13')][_0x6e01('0x15')]);return _0x4dfb47(_0x4f7c59['error']['message']);}else{logger[_0x6e01('0x16')](_0x6e01('0xe'),_0x459feb,'request\x20sent');_0x4dfb47(_0x4f7c59[_0x6e01('0x17')][_0x6e01('0x15')]);}})[_0x6e01('0x18')](function(_0x395833){logger[_0x6e01('0x13')](_0x6e01('0xe'),_0x459feb,_0x395833);_0x3f4e44(_0x395833);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 0d7f858..20a5af7 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x343834,_0x55a568){var _0x31f41a=function(_0x40afa5){while(--_0x40afa5){_0x343834['push'](_0x343834['shift']());}};_0x31f41a(++_0x55a568);}(_0xe706,0xa3));var _0x6e70=function(_0x569d11,_0x217bc7){_0x569d11=_0x569d11-0x0;var _0x4160c5=_0xe706[_0x569d11];return _0x4160c5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3003bf,_0x4d4531){var _0x543559=function(_0x1a871d){while(--_0x1a871d){_0x3003bf['push'](_0x3003bf['shift']());}};_0x543559(++_0x4d4531);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 300f4d8..5a2b384 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 _0xc305=['sequelize'];(function(_0x181670,_0x2f8162){var _0x427b22=function(_0xa3d907){while(--_0xa3d907){_0x181670['push'](_0x181670['shift']());}};_0x427b22(++_0x2f8162);}(_0xc305,0xcf));var _0x5c30=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc305[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x5c30('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xaff8=['INTEGER','sequelize','exports'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xaff8,0x1c6));var _0x8aff=function(_0x3d8ca8,_0x1a9764){_0x3d8ca8=_0x3d8ca8-0x0;var _0x517e45=_0xaff8[_0x3d8ca8];return _0x517e45;};'use strict';var Sequelize=require(_0x8aff('0x0'));module[_0x8aff('0x1')]={'penalty':{'type':Sequelize[_0x8aff('0x2')],'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 5d05967..c676db1 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 _0x6ae4=['moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','util','../../config/logger','api'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x6ae4,0x105));var _0x46ae=function(_0x3d1132,_0x50b802){_0x3d1132=_0x3d1132-0x0;var _0x167ff4=_0x6ae4[_0x3d1132];return _0x167ff4;};'use strict';var _=require('lodash');var util=require(_0x46ae('0x0'));var logger=require(_0x46ae('0x1'))(_0x46ae('0x2'));var moment=require(_0x46ae('0x3'));var BPromise=require(_0x46ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46ae('0x5'));var rimraf=require(_0x46ae('0x6'));var config=require(_0x46ae('0x7'));var attributes=require(_0x46ae('0x8'));module[_0x46ae('0x9')]=function(_0x22f9ce,_0x4bed36){return _0x22f9ce[_0x46ae('0xa')](_0x46ae('0xb'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1654=['define','UserMailQueue','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x15349f,_0x164701){var _0x5d770f=function(_0x5ee13f){while(--_0x5ee13f){_0x15349f['push'](_0x15349f['shift']());}};_0x5d770f(++_0x164701);}(_0x1654,0x17e));var _0x4165=function(_0x175c92,_0x28c731){_0x175c92=_0x175c92-0x0;var _0x44cc1b=_0x1654[_0x175c92];return _0x44cc1b;};'use strict';var _=require('lodash');var util=require(_0x4165('0x0'));var logger=require(_0x4165('0x1'))(_0x4165('0x2'));var moment=require(_0x4165('0x3'));var BPromise=require(_0x4165('0x4'));var rp=require(_0x4165('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4165('0x6'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x4165('0x7')]=function(_0x53d196,_0xfd86ce){return _0x53d196[_0x4165('0x8')](_0x4165('0x9'),attributes,{'tableName':'user_has_mail_queues','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 4b77968..1070abc 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 _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x47883a,_0x2e5b6c){var _0x360146=function(_0x351391){while(--_0x351391){_0x47883a['push'](_0x47883a['shift']());}};_0x360146(++_0x2e5b6c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5bed28,_0x3069b3){_0x5bed28=_0x5bed28-0x0;var _0x44fe9f=_0x7fbe[_0x5bed28];return _0x44fe9f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x7217,0x19e));var _0x7721=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x7217[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 4ae4516..15e3889 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 _0xf2f0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification','exports','multer','util','path','express'];(function(_0x27a9de,_0x3987eb){var _0xb6a1d9=function(_0x483a04){while(--_0x483a04){_0x27a9de['push'](_0x27a9de['shift']());}};_0xb6a1d9(++_0x3987eb);}(_0xf2f0,0x168));var _0x0f2f=function(_0x5dbdbc,_0x35fee0){_0x5dbdbc=_0x5dbdbc-0x0;var _0x258f29=_0xf2f0[_0x5dbdbc];return _0x258f29;};'use strict';var multer=require(_0x0f2f('0x0'));var util=require(_0x0f2f('0x1'));var path=require(_0x0f2f('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f2f('0x3'));var router=express[_0x0f2f('0x4')]();var fs_extra=require(_0x0f2f('0x5'));var auth=require(_0x0f2f('0x6'));var interaction=require(_0x0f2f('0x7'));var config=require(_0x0f2f('0x8'));var controller=require(_0x0f2f('0x9'));router[_0x0f2f('0xa')]('/',auth['isAuthenticated'](),controller[_0x0f2f('0xb')]);module[_0x0f2f('0xc')]=router; \ No newline at end of file +var _0xe7dd=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification'];(function(_0xef3ae2,_0x4c63b8){var _0x1cc22b=function(_0x4de2da){while(--_0x4de2da){_0xef3ae2['push'](_0xef3ae2['shift']());}};_0x1cc22b(++_0x4c63b8);}(_0xe7dd,0x1bb));var _0xde7d=function(_0x583dfd,_0x4a5251){_0x583dfd=_0x583dfd-0x0;var _0x1ecc79=_0xe7dd[_0x583dfd];return _0x1ecc79;};'use strict';var multer=require('multer');var util=require(_0xde7d('0x0'));var path=require(_0xde7d('0x1'));var timeout=require(_0xde7d('0x2'));var express=require('express');var router=express[_0xde7d('0x3')]();var fs_extra=require(_0xde7d('0x4'));var auth=require(_0xde7d('0x5'));var interaction=require(_0xde7d('0x6'));var config=require(_0xde7d('0x7'));var controller=require(_0xde7d('0x8'));router[_0xde7d('0x9')]('/',auth[_0xde7d('0xa')](),controller[_0xde7d('0xb')]);module[_0xde7d('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index d4dc493..68de36d 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 _0xdaa4=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x39dead,_0x6c6c31){var _0x2ab731=function(_0x39eda0){while(--_0x39eda0){_0x39dead['push'](_0x39dead['shift']());}};_0x2ab731(++_0x6c6c31);}(_0xdaa4,0xea));var _0x4daa=function(_0x34db30,_0x52a31e){_0x34db30=_0x34db30-0x0;var _0x1e0f76=_0xdaa4[_0x34db30];return _0x1e0f76;};'use strict';var Sequelize=require(_0x4daa('0x0'));module['exports']={'body':{'type':Sequelize[_0x4daa('0x1')]},'senderName':{'type':Sequelize[_0x4daa('0x2')]},'recipientsId':{'type':Sequelize[_0x4daa('0x1')]},'recipientsDescription':{'type':Sequelize[_0x4daa('0x2')]},'beep':{'type':Sequelize[_0x4daa('0x3')]}}; \ No newline at end of file +var _0x9f79=['TEXT','STRING','exports'];(function(_0x562aa9,_0x4ab1ce){var _0x23728e=function(_0x43f086){while(--_0x43f086){_0x562aa9['push'](_0x562aa9['shift']());}};_0x23728e(++_0x4ab1ce);}(_0x9f79,0x101));var _0x99f7=function(_0x5b2453,_0x1220d5){_0x5b2453=_0x5b2453-0x0;var _0x152105=_0x9f79[_0x5b2453];return _0x152105;};'use strict';var Sequelize=require('sequelize');module[_0x99f7('0x0')]={'body':{'type':Sequelize[_0x99f7('0x1')]},'senderName':{'type':Sequelize[_0x99f7('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x99f7('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 8b15153..83a30f6 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 _0xcd18=['openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','transaction','UserNotification','create','forEach','recipient','emit','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','model','User','union','queue','replace','Queue','ids','all','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','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','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue'];(function(_0x3de98f,_0x2892ef){var _0x3fa30c=function(_0x9f10e5){while(--_0x9f10e5){_0x3de98f['push'](_0x3de98f['shift']());}};_0x3fa30c(++_0x2892ef);}(_0xcd18,0x93));var _0x8cd1=function(_0x5aab0d,_0x5f328c){_0x5aab0d=_0x5aab0d-0x0;var _0x272b83=_0xcd18[_0x5aab0d];return _0x272b83;};'use strict';var emlformat=require(_0x8cd1('0x0'));var rimraf=require(_0x8cd1('0x1'));var zipdir=require(_0x8cd1('0x2'));var jsonpatch=require(_0x8cd1('0x3'));var rp=require(_0x8cd1('0x4'));var moment=require(_0x8cd1('0x5'));var BPromise=require(_0x8cd1('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8cd1('0x7'));var sox=require(_0x8cd1('0x8'));var csv=require(_0x8cd1('0x9'));var ejs=require(_0x8cd1('0xa'));var fs=require('fs');var fs_extra=require(_0x8cd1('0xb'));var _=require(_0x8cd1('0xc'));var squel=require(_0x8cd1('0xd'));var crypto=require(_0x8cd1('0xe'));var jsforce=require(_0x8cd1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8cd1('0x9'));var querystring=require('querystring');var Papa=require(_0x8cd1('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8cd1('0x11'));var as=require(_0x8cd1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cd1('0x13'))(_0x8cd1('0x14'));var utils=require(_0x8cd1('0x15'));var config=require(_0x8cd1('0x16'));var licenseUtil=require(_0x8cd1('0x17'));var db=require(_0x8cd1('0x18'))['db'];config['redis']=_[_0x8cd1('0x19')](config[_0x8cd1('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8cd1('0x1b'))(new Redis(config[_0x8cd1('0x1a')]));require(_0x8cd1('0x1c'))[_0x8cd1('0x1d')](socket);function respondWithStatusCode(_0x42ee53,_0x1d42f2){_0x1d42f2=_0x1d42f2||0xcc;return function(_0x4ebe22){if(_0x4ebe22){return _0x42ee53[_0x8cd1('0x1e')](_0x1d42f2);}return _0x42ee53['status'](_0x1d42f2)[_0x8cd1('0x1f')]();};}function respondWithResult(_0x17be08,_0x25a9df){_0x25a9df=_0x25a9df||0xc8;return function(_0x331e05){if(_0x331e05){return _0x17be08[_0x8cd1('0x20')](_0x25a9df)['json'](_0x331e05);}};}function respondWithFilteredResult(_0x1cd364,_0x478da0){return function(_0x3ba380){if(_0x3ba380){var _0x14d51a=typeof _0x478da0[_0x8cd1('0x21')]===_0x8cd1('0x22')&&typeof _0x478da0[_0x8cd1('0x23')]===_0x8cd1('0x22');var _0x699ed6=_0x3ba380['count'];var _0xd4c37e=_0x14d51a?0x0:_0x478da0[_0x8cd1('0x21')];var _0x13184b=_0x14d51a?_0x3ba380[_0x8cd1('0x24')]:_0x478da0['offset']+_0x478da0[_0x8cd1('0x23')];var _0x5ab27d;if(_0x13184b>=_0x699ed6){_0x13184b=_0x699ed6;_0x5ab27d=0xc8;}else{_0x5ab27d=0xce;}_0x1cd364[_0x8cd1('0x20')](_0x5ab27d);return _0x1cd364[_0x8cd1('0x25')](_0x8cd1('0x26'),_0xd4c37e+'-'+_0x13184b+'/'+_0x699ed6)[_0x8cd1('0x27')](_0x3ba380);}return null;};}function patchUpdates(_0x33ac98){return function(_0x2aa00f){try{jsonpatch[_0x8cd1('0x28')](_0x2aa00f,_0x33ac98,!![]);}catch(_0x3d330f){return BPromise[_0x8cd1('0x29')](_0x3d330f);}return _0x2aa00f[_0x8cd1('0x2a')]();};}function saveUpdates(_0x53ddeb,_0x32c7f4){return function(_0x2c1ab2){if(_0x2c1ab2){return _0x2c1ab2[_0x8cd1('0x2b')](_0x53ddeb)[_0x8cd1('0x2c')](function(_0x13313f){return _0x13313f;});}return null;};}function removeEntity(_0x175f83,_0x2110eb){return function(_0x2389ee){if(_0x2389ee){return _0x2389ee[_0x8cd1('0x2d')]()['then'](function(){_0x175f83[_0x8cd1('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e2919,_0x4de600){return function(_0x3fd1c6){if(!_0x3fd1c6){_0x2e2919[_0x8cd1('0x1e')](0x194);}return _0x3fd1c6;};}function handleError(_0x1130ff,_0x50528f){_0x50528f=_0x50528f||0x1f4;return function(_0x4c1463){logger['error'](_0x4c1463['stack']);if(_0x4c1463['name']){delete _0x4c1463[_0x8cd1('0x2e')];}_0x1130ff[_0x8cd1('0x20')](_0x50528f)[_0x8cd1('0x2f')](_0x4c1463);};}exports[_0x8cd1('0x30')]=function(_0x4f8cb3,_0xb03c03,_0x3c4599){if(!_0x4f8cb3[_0x8cd1('0x31')][_0x8cd1('0x32')](_0x8cd1('0x33'))&&!_0x4f8cb3[_0x8cd1('0x31')][_0x8cd1('0x32')]('TemplateId')){throw new db[(_0x8cd1('0x34'))][(_0x8cd1('0x35'))](_0x8cd1('0x36'));}else{if(_0x4f8cb3[_0x8cd1('0x31')][_0x8cd1('0x32')](_0x8cd1('0x37'))&&!_0x4f8cb3[_0x8cd1('0x31')]['hasOwnProperty'](_0x8cd1('0x38'))){throw new db[(_0x8cd1('0x34'))][(_0x8cd1('0x35'))](_0x8cd1('0x39'));}if(!_0x4f8cb3[_0x8cd1('0x31')]['hasOwnProperty']('recipients')){throw new db[(_0x8cd1('0x34'))][(_0x8cd1('0x35'))](_0x8cd1('0x3a'));}else{try{var _0x378bd7=JSON[_0x8cd1('0x3b')](_0x4f8cb3[_0x8cd1('0x31')]['recipients']);}catch(_0x506d2f){logger[_0x8cd1('0x3c')](_0x506d2f);throw new db['Sequelize'][(_0x8cd1('0x35'))](_0x8cd1('0x3d'));}var _0x2ad8c1=[_0x8cd1('0x3e'),_0x8cd1('0x3f'),_0x8cd1('0x40'),_0x8cd1('0x41'),_0x8cd1('0x42'),_0x8cd1('0x43'),_0x8cd1('0x44'),_0x8cd1('0x45'),'user'];if(_[_0x8cd1('0x46')](_0x378bd7,function(_0x2afae5){return!_[_0x8cd1('0x47')](_0x2ad8c1,_0x2afae5['model'][_0x8cd1('0x48')]());})){throw new db[(_0x8cd1('0x34'))][(_0x8cd1('0x35'))](_0x8cd1('0x49'));}}}var _0x345056={};_0x345056[_0x8cd1('0x4a')]=_0x4f8cb3['body'][_0x8cd1('0x32')](_0x8cd1('0x4a'))?_0x4f8cb3[_0x8cd1('0x31')][_0x8cd1('0x4a')]:_0x4f8cb3[_0x8cd1('0x4b')][_0x8cd1('0x4c')];_0x345056[_0x8cd1('0x4d')]=_[_0x8cd1('0x4e')](_0x4f8cb3['body'][_0x8cd1('0x4d')])?null:_0x4f8cb3['body'][_0x8cd1('0x4d')];_0x345056[_0x8cd1('0x4f')]=_0x4f8cb3['body'][_0x8cd1('0x4f')]||![];_0x345056[_0x8cd1('0x50')]=_0x4f8cb3[_0x8cd1('0x4b')]['id'];return getContent(_0x4f8cb3[_0x8cd1('0x31')])[_0x8cd1('0x2c')](function(_0x3ce48c){_0x345056['body']=_0x3ce48c;return getRecipients(_0x378bd7);})[_0x8cd1('0x2c')](function(_0x73a55){_0x345056[_0x8cd1('0x51')]=_['sortBy'](_0x73a55)[_0x8cd1('0x52')](',');return db['sequelize'][_0x8cd1('0x53')](function(_0x5a931d){return db[_0x8cd1('0x54')][_0x8cd1('0x55')](_0x345056,{'raw':!![],'transaction':_0x5a931d})[_0x8cd1('0x2c')](function(_0x1a496c){var _0x463380={'sender':_0x345056[_0x8cd1('0x4a')],'description':_0x345056[_0x8cd1('0x4d')],'content':_0x345056[_0x8cd1('0x31')],'beep':_0x345056[_0x8cd1('0x4f')]};_0x73a55[_0x8cd1('0x56')](function(_0x397f3e){_0x463380[_0x8cd1('0x57')]=_0x397f3e;socket[_0x8cd1('0x58')]('userNotification:send',_0x463380);});return _0x1a496c;});});})[_0x8cd1('0x2c')](respondWithResult(_0xb03c03,0xc9))['catch'](handleError(_0xb03c03,null));};function getContent(_0x594901){return new BPromise(function(_0x56b350,_0xa55e7e){if(_0x594901['text']){_0x56b350(_0x594901[_0x8cd1('0x33')]);return;}return db['Template']['findOne']({'attributes':[_0x8cd1('0x59')],'where':{'id':_0x594901[_0x8cd1('0x37')]},'raw':!![]})[_0x8cd1('0x2c')](function(_0x4bbdfa){if(!_0x4bbdfa)throw new db[(_0x8cd1('0x34'))][(_0x8cd1('0x35'))](_0x8cd1('0x5a'));var _0x523337=Mustache[_0x8cd1('0x5b')](_0x4bbdfa[_0x8cd1('0x59')],_0x594901['view']);_0x56b350(_0x523337);})[_0x8cd1('0x5c')](function(_0x38f378){_0xa55e7e(_0x38f378);});});}function getRecipients(_0x3836ab){return new BPromise(function(_0x4d41fb,_0x5117cc){var _0x301110=[];var _0x143d07=[];_0x3836ab[_0x8cd1('0x56')](function(_0x5d6137){var _0x11f3e5=_[_0x8cd1('0x5d')](_0x5d6137[_0x8cd1('0x5e')]['toLowerCase']());if(_0x11f3e5===_0x8cd1('0x5f')){_0x301110=_[_0x8cd1('0x60')](_0x301110,_0x5d6137['ids']);}else{if(_[_0x8cd1('0x47')](_0x11f3e5,_0x8cd1('0x61')))_0x11f3e5=_0x11f3e5[_0x8cd1('0x62')]('queue',_0x8cd1('0x63'));_0x5d6137[_0x8cd1('0x64')][_0x8cd1('0x56')](function(_0x128681){_0x143d07['push'](getAgents(_0x11f3e5,_0x128681));});}});return BPromise[_0x8cd1('0x65')](_0x143d07)[_0x8cd1('0x2c')](function(_0x138684){_0x301110=_[_0x8cd1('0x60')](_0x301110,_[_0x8cd1('0x66')](_0x138684));_0x4d41fb(_0x301110);})[_0x8cd1('0x5c')](function(_0x4fda33){_0x5117cc(_0x4fda33);});});}function getAgents(_0x9fedcd,_0x5780da){return new BPromise(function(_0x67e0f2,_0x42ce0f){return db[_0x9fedcd][_0x8cd1('0x67')]({'where':{'id':_0x5780da}})[_0x8cd1('0x2c')](function(_0x85bcf4){return _0x85bcf4[_0x8cd1('0x68')]({'attributes':['id'],'raw':!![]})[_0x8cd1('0x2c')](function(_0x4079ae){var _0x4c80a2=_[_0x8cd1('0x69')](_0x4079ae,'id');_0x67e0f2(_0x4c80a2);});})[_0x8cd1('0x5c')](function(_0xb83d79){_0x42ce0f(_0xb83d79);});});} \ No newline at end of file +var _0x95e9=['voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','userNotification:send','catch','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','union','ids','queue','replace','Queue','push','all','getAgents','map','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','sendUserNotification','hasOwnProperty','text','body','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue'];(function(_0x38dbd6,_0x15a82d){var _0x2e9afd=function(_0x355f40){while(--_0x355f40){_0x38dbd6['push'](_0x38dbd6['shift']());}};_0x2e9afd(++_0x15a82d);}(_0x95e9,0x101));var _0x995e=function(_0x452144,_0x170931){_0x452144=_0x452144-0x0;var _0x37f223=_0x95e9[_0x452144];return _0x37f223;};'use strict';var emlformat=require(_0x995e('0x0'));var rimraf=require(_0x995e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x995e('0x2'));var rp=require('request-promise');var moment=require(_0x995e('0x3'));var BPromise=require(_0x995e('0x4'));var Mustache=require(_0x995e('0x5'));var util=require(_0x995e('0x6'));var path=require(_0x995e('0x7'));var sox=require(_0x995e('0x8'));var csv=require(_0x995e('0x9'));var ejs=require(_0x995e('0xa'));var fs=require('fs');var fs_extra=require(_0x995e('0xb'));var _=require(_0x995e('0xc'));var squel=require(_0x995e('0xd'));var crypto=require(_0x995e('0xe'));var jsforce=require(_0x995e('0xf'));var deskjs=require(_0x995e('0x10'));var toCsv=require(_0x995e('0x9'));var querystring=require(_0x995e('0x11'));var Papa=require(_0x995e('0x12'));var Redis=require(_0x995e('0x13'));var authService=require(_0x995e('0x14'));var qs=require(_0x995e('0x15'));var as=require(_0x995e('0x16'));var hardwareService=require(_0x995e('0x17'));var logger=require(_0x995e('0x18'))(_0x995e('0x19'));var utils=require(_0x995e('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x995e('0x1b'));var db=require(_0x995e('0x1c'))['db'];config[_0x995e('0x1d')]=_[_0x995e('0x1e')](config[_0x995e('0x1d')],{'host':_0x995e('0x1f'),'port':0x18eb});var socket=require(_0x995e('0x20'))(new Redis(config[_0x995e('0x1d')]));require(_0x995e('0x21'))[_0x995e('0x22')](socket);function respondWithStatusCode(_0x39d373,_0x328554){_0x328554=_0x328554||0xcc;return function(_0x145904){if(_0x145904){return _0x39d373[_0x995e('0x23')](_0x328554);}return _0x39d373[_0x995e('0x24')](_0x328554)['end']();};}function respondWithResult(_0xadefe0,_0x2f97b6){_0x2f97b6=_0x2f97b6||0xc8;return function(_0x4a8426){if(_0x4a8426){return _0xadefe0[_0x995e('0x24')](_0x2f97b6)[_0x995e('0x25')](_0x4a8426);}};}function respondWithFilteredResult(_0x42dddf,_0x33d6e9){return function(_0x508fee){if(_0x508fee){var _0x257e4b=typeof _0x33d6e9[_0x995e('0x26')]===_0x995e('0x27')&&typeof _0x33d6e9[_0x995e('0x28')]===_0x995e('0x27');var _0x3f4e66=_0x508fee[_0x995e('0x29')];var _0x545214=_0x257e4b?0x0:_0x33d6e9[_0x995e('0x26')];var _0x46a9cf=_0x257e4b?_0x508fee[_0x995e('0x29')]:_0x33d6e9[_0x995e('0x26')]+_0x33d6e9[_0x995e('0x28')];var _0x52c0cf;if(_0x46a9cf>=_0x3f4e66){_0x46a9cf=_0x3f4e66;_0x52c0cf=0xc8;}else{_0x52c0cf=0xce;}_0x42dddf[_0x995e('0x24')](_0x52c0cf);return _0x42dddf['set'](_0x995e('0x2a'),_0x545214+'-'+_0x46a9cf+'/'+_0x3f4e66)[_0x995e('0x25')](_0x508fee);}return null;};}function patchUpdates(_0x98d1ad){return function(_0x5c7a76){try{jsonpatch[_0x995e('0x2b')](_0x5c7a76,_0x98d1ad,!![]);}catch(_0x2144f4){return BPromise[_0x995e('0x2c')](_0x2144f4);}return _0x5c7a76[_0x995e('0x2d')]();};}function saveUpdates(_0x1204c9,_0x1c6aea){return function(_0xc3c625){if(_0xc3c625){return _0xc3c625[_0x995e('0x2e')](_0x1204c9)[_0x995e('0x2f')](function(_0x2312a1){return _0x2312a1;});}return null;};}function removeEntity(_0x543ca6,_0x5e77f2){return function(_0x4c7aba){if(_0x4c7aba){return _0x4c7aba[_0x995e('0x30')]()[_0x995e('0x2f')](function(){_0x543ca6['status'](0xcc)[_0x995e('0x31')]();});}};}function handleEntityNotFound(_0x20ae70,_0x443eac){return function(_0x527f44){if(!_0x527f44){_0x20ae70[_0x995e('0x23')](0x194);}return _0x527f44;};}function handleError(_0x5c08e6,_0x34d61d){_0x34d61d=_0x34d61d||0x1f4;return function(_0x5ef44f){logger[_0x995e('0x32')](_0x5ef44f['stack']);if(_0x5ef44f[_0x995e('0x33')]){delete _0x5ef44f[_0x995e('0x33')];}_0x5c08e6['status'](_0x34d61d)['send'](_0x5ef44f);};}exports[_0x995e('0x34')]=function(_0x36b9ef,_0x439d4d,_0x2ffac9){if(!_0x36b9ef['body'][_0x995e('0x35')](_0x995e('0x36'))&&!_0x36b9ef[_0x995e('0x37')][_0x995e('0x35')](_0x995e('0x38'))){throw new db['Sequelize'][(_0x995e('0x39'))](_0x995e('0x3a'));}else{if(_0x36b9ef['body']['hasOwnProperty'](_0x995e('0x38'))&&!_0x36b9ef[_0x995e('0x37')][_0x995e('0x35')](_0x995e('0x3b'))){throw new db[(_0x995e('0x3c'))][(_0x995e('0x39'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x36b9ef[_0x995e('0x37')][_0x995e('0x35')]('recipients')){throw new db['Sequelize'][(_0x995e('0x39'))](_0x995e('0x3d'));}else{try{var _0xbf214a=JSON[_0x995e('0x3e')](_0x36b9ef[_0x995e('0x37')][_0x995e('0x3f')]);}catch(_0x52823a){logger[_0x995e('0x32')](_0x52823a);throw new db[(_0x995e('0x3c'))][(_0x995e('0x39'))](_0x995e('0x40'));}var _0x3548f3=[_0x995e('0x41'),_0x995e('0x42'),_0x995e('0x43'),_0x995e('0x44'),_0x995e('0x45'),_0x995e('0x46'),_0x995e('0x47'),_0x995e('0x48'),_0x995e('0x49')];if(_[_0x995e('0x4a')](_0xbf214a,function(_0xf994ff){return!_[_0x995e('0x4b')](_0x3548f3,_0xf994ff[_0x995e('0x4c')][_0x995e('0x4d')]());})){throw new db[(_0x995e('0x3c'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x2f7e50={};_0x2f7e50[_0x995e('0x4e')]=_0x36b9ef[_0x995e('0x37')][_0x995e('0x35')](_0x995e('0x4e'))?_0x36b9ef['body']['senderName']:_0x36b9ef[_0x995e('0x49')][_0x995e('0x4f')];_0x2f7e50['recipientsDescription']=_[_0x995e('0x50')](_0x36b9ef[_0x995e('0x37')][_0x995e('0x51')])?null:_0x36b9ef[_0x995e('0x37')][_0x995e('0x51')];_0x2f7e50['beep']=_0x36b9ef[_0x995e('0x37')][_0x995e('0x52')]||![];_0x2f7e50[_0x995e('0x53')]=_0x36b9ef['user']['id'];return getContent(_0x36b9ef[_0x995e('0x37')])[_0x995e('0x2f')](function(_0x16eaf4){_0x2f7e50[_0x995e('0x37')]=_0x16eaf4;return getRecipients(_0xbf214a);})[_0x995e('0x2f')](function(_0x24a84e){_0x2f7e50[_0x995e('0x54')]=_[_0x995e('0x55')](_0x24a84e)[_0x995e('0x56')](',');return db[_0x995e('0x57')][_0x995e('0x58')](function(_0x69764b){return db[_0x995e('0x59')][_0x995e('0x5a')](_0x2f7e50,{'raw':!![],'transaction':_0x69764b})[_0x995e('0x2f')](function(_0x4530af){var _0x204cbd={'sender':_0x2f7e50[_0x995e('0x4e')],'description':_0x2f7e50[_0x995e('0x51')],'content':_0x2f7e50[_0x995e('0x37')],'beep':_0x2f7e50[_0x995e('0x52')]};_0x24a84e[_0x995e('0x5b')](function(_0x468087){_0x204cbd['recipient']=_0x468087;socket['emit'](_0x995e('0x5c'),_0x204cbd);});return _0x4530af;});});})['then'](respondWithResult(_0x439d4d,0xc9))[_0x995e('0x5d')](handleError(_0x439d4d,null));};function getContent(_0x176f13){return new BPromise(function(_0x37763b,_0x56a33d){if(_0x176f13[_0x995e('0x36')]){_0x37763b(_0x176f13[_0x995e('0x36')]);return;}return db['Template'][_0x995e('0x5e')]({'attributes':['html'],'where':{'id':_0x176f13[_0x995e('0x38')]},'raw':!![]})[_0x995e('0x2f')](function(_0x1e0287){if(!_0x1e0287)throw new db[(_0x995e('0x3c'))]['ValidationError'](_0x995e('0x5f'));var _0x1009cd=Mustache[_0x995e('0x60')](_0x1e0287[_0x995e('0x61')],_0x176f13['view']);_0x37763b(_0x1009cd);})['catch'](function(_0x21fe0f){_0x56a33d(_0x21fe0f);});});}function getRecipients(_0x34ef56){return new BPromise(function(_0x430c84,_0x1f9c31){var _0x44d545=[];var _0x2b32af=[];_0x34ef56['forEach'](function(_0x20ecec){var _0x4480c0=_[_0x995e('0x62')](_0x20ecec[_0x995e('0x4c')]['toLowerCase']());if(_0x4480c0===_0x995e('0x63')){_0x44d545=_[_0x995e('0x64')](_0x44d545,_0x20ecec[_0x995e('0x65')]);}else{if(_['includes'](_0x4480c0,_0x995e('0x66')))_0x4480c0=_0x4480c0[_0x995e('0x67')]('queue',_0x995e('0x68'));_0x20ecec['ids'][_0x995e('0x5b')](function(_0x27a9bb){_0x2b32af[_0x995e('0x69')](getAgents(_0x4480c0,_0x27a9bb));});}});return BPromise[_0x995e('0x6a')](_0x2b32af)[_0x995e('0x2f')](function(_0x59c248){_0x44d545=_[_0x995e('0x64')](_0x44d545,_['flatten'](_0x59c248));_0x430c84(_0x44d545);})[_0x995e('0x5d')](function(_0xc32bc8){_0x1f9c31(_0xc32bc8);});});}function getAgents(_0x53afa0,_0x1322bf){return new BPromise(function(_0x47ac28,_0x28415f){return db[_0x53afa0]['findOne']({'where':{'id':_0x1322bf}})[_0x995e('0x2f')](function(_0x36a720){return _0x36a720[_0x995e('0x6b')]({'attributes':['id'],'raw':!![]})[_0x995e('0x2f')](function(_0x459b06){var _0x39332c=_[_0x995e('0x6c')](_0x459b06,'id');_0x47ac28(_0x39332c);});})['catch'](function(_0x10f15f){_0x28415f(_0x10f15f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index f67ffa3..ed4b337 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 _0x72f9=['../../mysqldb','setMaxListeners','emit','hook','exports','events'];(function(_0x29b07c,_0x47004f){var _0x4b31ab=function(_0xb242a1){while(--_0xb242a1){_0x29b07c['push'](_0x29b07c['shift']());}};_0x4b31ab(++_0x47004f);}(_0x72f9,0x1eb));var _0x972f=function(_0x459b74,_0x5773bd){_0x459b74=_0x459b74-0x0;var _0x46cb16=_0x72f9[_0x459b74];return _0x46cb16;};'use strict';var EventEmitter=require(_0x972f('0x0'));var UserNotification=require(_0x972f('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x972f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x53f319){return function(_0x5e24da,_0xc20532,_0x562401){UserNotificationEvents[_0x972f('0x3')](_0x53f319+':'+_0x5e24da['id'],_0x5e24da);UserNotificationEvents[_0x972f('0x3')](_0x53f319,_0x5e24da);_0x562401(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x972f('0x4')](e,emitEvent(event));}}module[_0x972f('0x5')]=UserNotificationEvents; \ No newline at end of file +var _0x5485=['hook','exports','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0x5485,0x1c4));var _0x5548=function(_0x46f154,_0x6bd9ba){_0x46f154=_0x46f154-0x0;var _0x5e3b38=_0x5485[_0x46f154];return _0x5e3b38;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x5548('0x0'))['db'][_0x5548('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5548('0x2')](0x0);var events={'afterCreate':_0x5548('0x3'),'afterUpdate':_0x5548('0x4'),'afterDestroy':_0x5548('0x5')};function emitEvent(_0x214234){return function(_0x21c06b,_0x12b65d,_0x4987aa){UserNotificationEvents['emit'](_0x214234+':'+_0x21c06b['id'],_0x21c06b);UserNotificationEvents[_0x5548('0x6')](_0x214234,_0x21c06b);_0x4987aa(null);};}for(var e in events){if(events[_0x5548('0x7')](e)){var event=events[e];UserNotification[_0x5548('0x8')](e,emitEvent(event));}}module[_0x5548('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index b610d7b..34731d0 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 _0xdda1=['exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xdda1,0x12b));var _0x1dda=function(_0x1f539e,_0x1fa476){_0x1f539e=_0x1f539e-0x0;var _0x15697e=_0xdda1[_0x1f539e];return _0x15697e;};'use strict';var _=require(_0x1dda('0x0'));var util=require(_0x1dda('0x1'));var logger=require(_0x1dda('0x2'))(_0x1dda('0x3'));var moment=require(_0x1dda('0x4'));var BPromise=require('bluebird');var rp=require(_0x1dda('0x5'));var fs=require('fs');var path=require(_0x1dda('0x6'));var rimraf=require(_0x1dda('0x7'));var config=require(_0x1dda('0x8'));var attributes=require('./userNotification.attributes');module[_0x1dda('0x9')]=function(_0x21802c,_0x26d8ab){return _0x21802c['define'](_0x1dda('0xa'),attributes,{'tableName':_0x1dda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1dda('0xc'),'collate':_0x1dda('0xd')});}; \ No newline at end of file +var _0x4b72=['path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','lodash','util','../../config/logger','api','request-promise'];(function(_0x737fef,_0x5b4dcc){var _0x3682b6=function(_0x513686){while(--_0x513686){_0x737fef['push'](_0x737fef['shift']());}};_0x3682b6(++_0x5b4dcc);}(_0x4b72,0x10f));var _0x24b7=function(_0x34e7b6,_0x34bfdf){_0x34e7b6=_0x34e7b6-0x0;var _0x1013ba=_0x4b72[_0x34e7b6];return _0x1013ba;};'use strict';var _=require(_0x24b7('0x0'));var util=require(_0x24b7('0x1'));var logger=require(_0x24b7('0x2'))(_0x24b7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x24b7('0x4'));var fs=require('fs');var path=require(_0x24b7('0x5'));var rimraf=require('rimraf');var config=require(_0x24b7('0x6'));var attributes=require(_0x24b7('0x7'));module[_0x24b7('0x8')]=function(_0x393d0d,_0x511ca6){return _0x393d0d[_0x24b7('0x9')](_0x24b7('0xa'),attributes,{'tableName':_0x24b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index e97007d..5a2848b 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 _0x7c50=['then','info','debug','stringify','error','UserNotification,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','redis','socket.io-emitter','register','request'];(function(_0x138c23,_0x299a8c){var _0xe1d5eb=function(_0x1364cc){while(--_0x1364cc){_0x138c23['push'](_0x138c23['shift']());}};_0xe1d5eb(++_0x299a8c);}(_0x7c50,0x1d7));var _0x07c5=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x7c50[_0x11946c];return _0x383935;};'use strict';var _=require('lodash');var util=require(_0x07c5('0x0'));var moment=require(_0x07c5('0x1'));var BPromise=require(_0x07c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x07c5('0x4'));var logger=require(_0x07c5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x07c5('0x6'));var client=jayson[_0x07c5('0x7')]['http']({'port':0x232a});config[_0x07c5('0x8')]=_['defaults'](config[_0x07c5('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x07c5('0x9'))(new Redis(config[_0x07c5('0x8')]));require('./userNotification.socket')[_0x07c5('0xa')](socket);function respondWithRpcPromise(_0x23b2bd,_0x1e35c3,_0x4347b4){return new BPromise(function(_0x3426cf,_0x313f47){return client[_0x07c5('0xb')](_0x23b2bd,_0x4347b4)[_0x07c5('0xc')](function(_0x1a1893){logger[_0x07c5('0xd')]('UserNotification,\x20%s,\x20%s',_0x1e35c3,'request\x20sent');logger[_0x07c5('0xe')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x1e35c3,'request\x20sent',JSON[_0x07c5('0xf')](_0x1a1893));if(_0x1a1893[_0x07c5('0x10')]){if(_0x1a1893['error']['code']===0x1f4){logger['error'](_0x07c5('0x11'),_0x1e35c3,_0x1a1893[_0x07c5('0x10')][_0x07c5('0x12')]);return _0x313f47(_0x1a1893['error']['message']);}logger['error']('UserNotification,\x20%s,\x20%s',_0x1e35c3,_0x1a1893[_0x07c5('0x10')][_0x07c5('0x12')]);return _0x3426cf(_0x1a1893['error']['message']);}else{logger['info'](_0x07c5('0x11'),_0x1e35c3,'request\x20sent');_0x3426cf(_0x1a1893[_0x07c5('0x13')][_0x07c5('0x12')]);}})[_0x07c5('0x14')](function(_0x3b8af2){logger[_0x07c5('0x10')]('UserNotification,\x20%s,\x20%s',_0x1e35c3,_0x3b8af2);_0x313f47(_0x3b8af2);});});} \ No newline at end of file +var _0x891a=['request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s'];(function(_0x5d6b41,_0x3d1c8f){var _0x1c2dd6=function(_0x48d601){while(--_0x48d601){_0x5d6b41['push'](_0x5d6b41['shift']());}};_0x1c2dd6(++_0x3d1c8f);}(_0x891a,0x1c7));var _0xa891=function(_0x27a450,_0x5aed8e){_0x27a450=_0x27a450-0x0;var _0x2401df=_0x891a[_0x27a450];return _0x2401df;};'use strict';var _=require(_0xa891('0x0'));var util=require('util');var moment=require(_0xa891('0x1'));var BPromise=require(_0xa891('0x2'));var rs=require(_0xa891('0x3'));var fs=require('fs');var Redis=require(_0xa891('0x4'));var db=require(_0xa891('0x5'))['db'];var utils=require(_0xa891('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa891('0x7'));var jayson=require(_0xa891('0x8'));var client=jayson[_0xa891('0x9')][_0xa891('0xa')]({'port':0x232a});config[_0xa891('0xb')]=_[_0xa891('0xc')](config['redis'],{'host':_0xa891('0xd'),'port':0x18eb});var socket=require(_0xa891('0xe'))(new Redis(config['redis']));require(_0xa891('0xf'))[_0xa891('0x10')](socket);function respondWithRpcPromise(_0x13317e,_0x35961a,_0x124c9c){return new BPromise(function(_0x2ef969,_0x3af791){return client[_0xa891('0x11')](_0x13317e,_0x124c9c)[_0xa891('0x12')](function(_0x5aa170){logger[_0xa891('0x13')](_0xa891('0x14'),_0x35961a,_0xa891('0x15'));logger['debug'](_0xa891('0x16'),_0x35961a,'request\x20sent',JSON['stringify'](_0x5aa170));if(_0x5aa170[_0xa891('0x17')]){if(_0x5aa170[_0xa891('0x17')][_0xa891('0x18')]===0x1f4){logger['error'](_0xa891('0x14'),_0x35961a,_0x5aa170[_0xa891('0x17')][_0xa891('0x19')]);return _0x3af791(_0x5aa170[_0xa891('0x17')]['message']);}logger[_0xa891('0x17')](_0xa891('0x14'),_0x35961a,_0x5aa170[_0xa891('0x17')]['message']);return _0x2ef969(_0x5aa170[_0xa891('0x17')][_0xa891('0x19')]);}else{logger[_0xa891('0x13')](_0xa891('0x14'),_0x35961a,'request\x20sent');_0x2ef969(_0x5aa170[_0xa891('0x1a')][_0xa891('0x19')]);}})[_0xa891('0x1b')](function(_0x48662d){logger[_0xa891('0x17')](_0xa891('0x14'),_0x35961a,_0x48662d);_0x3af791(_0x48662d);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 01ae414..0966132 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 _0x537e=['save','emit','removeListener','register','length','userNotification:'];(function(_0x4f096e,_0x30d3c3){var _0x4a33ce=function(_0x107ba6){while(--_0x107ba6){_0x4f096e['push'](_0x4f096e['shift']());}};_0x4a33ce(++_0x30d3c3);}(_0x537e,0x1e6));var _0xe537=function(_0x2a574c,_0x10ec94){_0x2a574c=_0x2a574c-0x0;var _0x1cda58=_0x537e[_0x2a574c];return _0x1cda58;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xe537('0x0'),'remove','update'];function createListener(_0x3ac478,_0x569c5d){return function(_0x4ecb2d){_0x569c5d[_0xe537('0x1')](_0x3ac478,_0x4ecb2d);};}function removeListener(_0x307eab,_0x3be951){return function(){UserNotificationEvents[_0xe537('0x2')](_0x307eab,_0x3be951);};}exports[_0xe537('0x3')]=function(_0x5f0e6d){for(var _0x5f3551=0x0,_0x4d3ec8=events[_0xe537('0x4')];_0x5f3551<_0x4d3ec8;_0x5f3551++){var _0x307142=events[_0x5f3551];var _0x1cdfd4=createListener(_0xe537('0x5')+_0x307142,_0x5f0e6d);UserNotificationEvents['on'](_0x307142,_0x1cdfd4);}}; \ No newline at end of file +var _0x77d1=['remove','update','emit','removeListener','register','length','userNotification:','./userNotification.events','save'];(function(_0x294b3b,_0x1615dd){var _0x29cf8d=function(_0x40e937){while(--_0x40e937){_0x294b3b['push'](_0x294b3b['shift']());}};_0x29cf8d(++_0x1615dd);}(_0x77d1,0xc4));var _0x177d=function(_0x146a85,_0x529b52){_0x146a85=_0x146a85-0x0;var _0x1b59bf=_0x77d1[_0x146a85];return _0x1b59bf;};'use strict';var UserNotificationEvents=require(_0x177d('0x0'));var events=[_0x177d('0x1'),_0x177d('0x2'),_0x177d('0x3')];function createListener(_0x5281d5,_0x1ce5b5){return function(_0x1d2915){_0x1ce5b5[_0x177d('0x4')](_0x5281d5,_0x1d2915);};}function removeListener(_0x59ba29,_0x2b0957){return function(){UserNotificationEvents[_0x177d('0x5')](_0x59ba29,_0x2b0957);};}exports[_0x177d('0x6')]=function(_0x45330c){for(var _0x59da01=0x0,_0x553ba0=events[_0x177d('0x7')];_0x59da01<_0x553ba0;_0x59da01++){var _0x4febd1=events[_0x59da01];var _0x52c5a2=createListener(_0x177d('0x8')+_0x4febd1,_0x45330c);UserNotificationEvents['on'](_0x4febd1,_0x52c5a2);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 0f6abfb..ad9a10a 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x7d1a86,_0x5c6b6b){var _0x49baa2=function(_0x4f8150){while(--_0x4f8150){_0x7d1a86['push'](_0x7d1a86['shift']());}};_0x49baa2(++_0x5c6b6b);}(_0xe706,0xa3));var _0x6e70=function(_0x849e8d,_0x21b681){_0x849e8d=_0x849e8d-0x0;var _0x53d15d=_0xe706[_0x849e8d];return _0x53d15d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2eae12,_0x1d2fc1){var _0x522040=function(_0x1a0935){while(--_0x1a0935){_0x2eae12['push'](_0x2eae12['shift']());}};_0x522040(++_0x1d2fc1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0xcb91[_0x218972];return _0x1bb1a8;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 7dcfb2e..c821f23 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 _0xdb06=['exports','INTEGER'];(function(_0x2773e8,_0x5d2cf5){var _0x16223d=function(_0x5b9416){while(--_0x5b9416){_0x2773e8['push'](_0x2773e8['shift']());}};_0x16223d(++_0x5d2cf5);}(_0xdb06,0x1e4));var _0x6db0=function(_0x3970d0,_0x276e10){_0x3970d0=_0x3970d0-0x0;var _0x506222=_0xdb06[_0x3970d0];return _0x506222;};'use strict';var Sequelize=require('sequelize');module[_0x6db0('0x0')]={'penalty':{'type':Sequelize[_0x6db0('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3eb7=['exports','INTEGER'];(function(_0x3b3750,_0x28f3b8){var _0x1b9e8b=function(_0xaf75c3){while(--_0xaf75c3){_0x3b3750['push'](_0x3b3750['shift']());}};_0x1b9e8b(++_0x28f3b8);}(_0x3eb7,0x14e));var _0x73eb=function(_0x50d886,_0x461c90){_0x50d886=_0x50d886-0x0;var _0x349178=_0x3eb7[_0x50d886];return _0x349178;};'use strict';var Sequelize=require('sequelize');module[_0x73eb('0x0')]={'penalty':{'type':Sequelize[_0x73eb('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index d0cadec..1ae6a11 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 _0x59b8=['user_has_openchannel_queues','lodash','util','../../config/logger','moment','request-promise','path','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x18f132,_0xd5ef75){var _0x11a647=function(_0x1228ad){while(--_0x1228ad){_0x18f132['push'](_0x18f132['shift']());}};_0x11a647(++_0xd5ef75);}(_0x59b8,0xdd));var _0x859b=function(_0x58ca9d,_0x1a4b20){_0x58ca9d=_0x58ca9d-0x0;var _0x3b3993=_0x59b8[_0x58ca9d];return _0x3b3993;};'use strict';var _=require(_0x859b('0x0'));var util=require(_0x859b('0x1'));var logger=require(_0x859b('0x2'))('api');var moment=require(_0x859b('0x3'));var BPromise=require('bluebird');var rp=require(_0x859b('0x4'));var fs=require('fs');var path=require(_0x859b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x859b('0x6'));module[_0x859b('0x7')]=function(_0x4efc7c,_0x44cf11){return _0x4efc7c[_0x859b('0x8')](_0x859b('0x9'),attributes,{'tableName':_0x859b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe472=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userOpenchannelQueue.attributes','exports','define','lodash'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xe472,0x1c2));var _0x2e47=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe472[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2e47('0x0'));var util=require(_0x2e47('0x1'));var logger=require(_0x2e47('0x2'))(_0x2e47('0x3'));var moment=require(_0x2e47('0x4'));var BPromise=require(_0x2e47('0x5'));var rp=require(_0x2e47('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e47('0x7'));var config=require('../../config/environment');var attributes=require(_0x2e47('0x8'));module[_0x2e47('0x9')]=function(_0x33defa,_0x4d2e06){return _0x33defa[_0x2e47('0xa')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 21502e7..4d09186 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 _0xfd15=['message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xfd15,0xd1));var _0x5fd1=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xfd15[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x5fd1('0x0'));var util=require(_0x5fd1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5fd1('0x2'));var fs=require('fs');var Redis=require(_0x5fd1('0x3'));var db=require(_0x5fd1('0x4'))['db'];var utils=require(_0x5fd1('0x5'));var logger=require(_0x5fd1('0x6'))(_0x5fd1('0x7'));var config=require('../../config/environment');var jayson=require(_0x5fd1('0x8'));var client=jayson[_0x5fd1('0x9')][_0x5fd1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35b01e,_0x70b2a9,_0x2ef397){return new BPromise(function(_0x25ddb1,_0x1913e2){return client[_0x5fd1('0xb')](_0x35b01e,_0x2ef397)[_0x5fd1('0xc')](function(_0x31231c){logger[_0x5fd1('0xd')](_0x5fd1('0xe'),_0x70b2a9,'request\x20sent');logger[_0x5fd1('0xf')](_0x5fd1('0x10'),_0x70b2a9,_0x5fd1('0x11'),JSON[_0x5fd1('0x12')](_0x31231c));if(_0x31231c[_0x5fd1('0x13')]){if(_0x31231c[_0x5fd1('0x13')][_0x5fd1('0x14')]===0x1f4){logger[_0x5fd1('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x70b2a9,_0x31231c[_0x5fd1('0x13')][_0x5fd1('0x15')]);return _0x1913e2(_0x31231c[_0x5fd1('0x13')][_0x5fd1('0x15')]);}logger[_0x5fd1('0x13')](_0x5fd1('0xe'),_0x70b2a9,_0x31231c[_0x5fd1('0x13')]['message']);return _0x25ddb1(_0x31231c[_0x5fd1('0x13')][_0x5fd1('0x15')]);}else{logger[_0x5fd1('0xd')](_0x5fd1('0xe'),_0x70b2a9,_0x5fd1('0x11'));_0x25ddb1(_0x31231c[_0x5fd1('0x16')]['message']);}})['catch'](function(_0x2d497f){logger[_0x5fd1('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x70b2a9,_0x2d497f);_0x1913e2(_0x2d497f);});});} \ No newline at end of file +var _0xb59a=['client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x5b6396,_0x2400e0){var _0x6836ca=function(_0x24aec4){while(--_0x24aec4){_0x5b6396['push'](_0x5b6396['shift']());}};_0x6836ca(++_0x2400e0);}(_0xb59a,0x19b));var _0xab59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb59a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xab59('0x0'));var util=require(_0xab59('0x1'));var moment=require(_0xab59('0x2'));var BPromise=require(_0xab59('0x3'));var rs=require(_0xab59('0x4'));var fs=require('fs');var Redis=require(_0xab59('0x5'));var db=require(_0xab59('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xab59('0x7'));var config=require('../../config/environment');var jayson=require(_0xab59('0x8'));var client=jayson[_0xab59('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c8a36,_0x33bc02,_0x3c11f8){return new BPromise(function(_0x35c30a,_0x2866d4){return client[_0xab59('0xa')](_0x1c8a36,_0x3c11f8)[_0xab59('0xb')](function(_0x5f00bd){logger[_0xab59('0xc')](_0xab59('0xd'),_0x33bc02,_0xab59('0xe'));logger[_0xab59('0xf')](_0xab59('0x10'),_0x33bc02,_0xab59('0xe'),JSON[_0xab59('0x11')](_0x5f00bd));if(_0x5f00bd[_0xab59('0x12')]){if(_0x5f00bd[_0xab59('0x12')]['code']===0x1f4){logger[_0xab59('0x12')](_0xab59('0xd'),_0x33bc02,_0x5f00bd[_0xab59('0x12')][_0xab59('0x13')]);return _0x2866d4(_0x5f00bd['error'][_0xab59('0x13')]);}logger[_0xab59('0x12')](_0xab59('0xd'),_0x33bc02,_0x5f00bd[_0xab59('0x12')][_0xab59('0x13')]);return _0x35c30a(_0x5f00bd[_0xab59('0x12')][_0xab59('0x13')]);}else{logger[_0xab59('0xc')](_0xab59('0xd'),_0x33bc02,_0xab59('0xe'));_0x35c30a(_0x5f00bd['result'][_0xab59('0x13')]);}})[_0xab59('0x14')](function(_0x32ae9f){logger[_0xab59('0x12')](_0xab59('0xd'),_0x33bc02,_0x32ae9f);_0x2866d4(_0x32ae9f);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 913152a..bda2e20 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 _0x2849=['index','/describe','describe','getSections','post','create','clone','/:id/sections','addSections','put','/:id','update','delete','destroy','removeSections','/:id/resources','removeResources','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x2849,0x66));var _0x9284=function(_0x12c3c7,_0x2ea454){_0x12c3c7=_0x12c3c7-0x0;var _0x25c094=_0x2849[_0x12c3c7];return _0x25c094;};'use strict';var multer=require(_0x9284('0x0'));var util=require(_0x9284('0x1'));var path=require(_0x9284('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9284('0x3')]();var fs_extra=require(_0x9284('0x4'));var auth=require(_0x9284('0x5'));var interaction=require(_0x9284('0x6'));var config=require('../../config/environment');var controller=require(_0x9284('0x7'));router[_0x9284('0x8')]('/',auth[_0x9284('0x9')](),controller[_0x9284('0xa')]);router[_0x9284('0x8')](_0x9284('0xb'),auth[_0x9284('0x9')](),controller[_0x9284('0xc')]);router[_0x9284('0x8')]('/:id',auth[_0x9284('0x9')](),controller['show']);router[_0x9284('0x8')]('/:id/sections',auth[_0x9284('0x9')](),controller[_0x9284('0xd')]);router['get']('/:id/resources',auth['isAuthenticated'](),controller['getResources']);router[_0x9284('0xe')]('/',auth[_0x9284('0x9')](),controller[_0x9284('0xf')]);router[_0x9284('0xe')]('/:id/clone',auth[_0x9284('0x9')](),controller[_0x9284('0x10')]);router[_0x9284('0xe')](_0x9284('0x11'),auth[_0x9284('0x9')](),controller[_0x9284('0x12')]);router[_0x9284('0xe')]('/:id/resources',auth[_0x9284('0x9')](),controller['addResources']);router[_0x9284('0x13')](_0x9284('0x14'),auth[_0x9284('0x9')](),controller[_0x9284('0x15')]);router[_0x9284('0x16')](_0x9284('0x14'),auth[_0x9284('0x9')](),controller[_0x9284('0x17')]);router['delete'](_0x9284('0x11'),auth[_0x9284('0x9')](),controller[_0x9284('0x18')]);router[_0x9284('0x16')](_0x9284('0x19'),auth[_0x9284('0x9')](),controller[_0x9284('0x1a')]);module[_0x9284('0x1b')]=router; \ No newline at end of file +var _0x4b23=['get','describe','show','/:id/sections','/:id/resources','getResources','post','addSections','addResources','put','/:id','update','delete','destroy','removeSections','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b23,0xcd));var _0x34b2=function(_0x4f01a9,_0x4a0d3a){_0x4f01a9=_0x4f01a9-0x0;var _0x5f5ade=_0x4b23[_0x4f01a9];return _0x5f5ade;};'use strict';var multer=require(_0x34b2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x34b2('0x1'));var express=require(_0x34b2('0x2'));var router=express[_0x34b2('0x3')]();var fs_extra=require(_0x34b2('0x4'));var auth=require(_0x34b2('0x5'));var interaction=require(_0x34b2('0x6'));var config=require(_0x34b2('0x7'));var controller=require(_0x34b2('0x8'));router['get']('/',auth[_0x34b2('0x9')](),controller[_0x34b2('0xa')]);router[_0x34b2('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x34b2('0xc')]);router['get']('/:id',auth[_0x34b2('0x9')](),controller[_0x34b2('0xd')]);router['get'](_0x34b2('0xe'),auth[_0x34b2('0x9')](),controller['getSections']);router[_0x34b2('0xb')](_0x34b2('0xf'),auth[_0x34b2('0x9')](),controller[_0x34b2('0x10')]);router[_0x34b2('0x11')]('/',auth[_0x34b2('0x9')](),controller['create']);router[_0x34b2('0x11')]('/:id/clone',auth[_0x34b2('0x9')](),controller['clone']);router['post'](_0x34b2('0xe'),auth['isAuthenticated'](),controller[_0x34b2('0x12')]);router[_0x34b2('0x11')]('/:id/resources',auth['isAuthenticated'](),controller[_0x34b2('0x13')]);router[_0x34b2('0x14')](_0x34b2('0x15'),auth[_0x34b2('0x9')](),controller[_0x34b2('0x16')]);router[_0x34b2('0x17')](_0x34b2('0x15'),auth[_0x34b2('0x9')](),controller[_0x34b2('0x18')]);router['delete'](_0x34b2('0xe'),auth[_0x34b2('0x9')](),controller[_0x34b2('0x19')]);router[_0x34b2('0x17')](_0x34b2('0xf'),auth[_0x34b2('0x9')](),controller['removeResources']);module[_0x34b2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 79dbff1..dfb0c0e 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 _0xfd87=['name','crudPermissions','join','getDataValue','BOOLEAN','sequelize','exports','STRING'];(function(_0x4bcefe,_0x45fbe2){var _0x5c1d49=function(_0x2140cc){while(--_0x2140cc){_0x4bcefe['push'](_0x4bcefe['shift']());}};_0x5c1d49(++_0x45fbe2);}(_0xfd87,0x16d));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7fd8('0x0'));module[_0x7fd8('0x1')]={'name':{'type':Sequelize[_0x7fd8('0x2')],'allowNull':![],'unique':_0x7fd8('0x3')},'crudPermissions':{'type':Sequelize[_0x7fd8('0x2')],'set':function(_0x453dee){this['setDataValue'](_0x7fd8('0x4'),_0x453dee?_0x453dee[_0x7fd8('0x5')](''):[]);},'get':function(){return this[_0x7fd8('0x6')](_0x7fd8('0x4'))?this[_0x7fd8('0x6')](_0x7fd8('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7fd8('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x7fd8('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7fd8('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x7fd8('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7fd8('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7fd8('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7fd8('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1cf6=['STRING','name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','exports'];(function(_0x350223,_0x3cd6a8){var _0x56eebe=function(_0x3b4116){while(--_0x3b4116){_0x350223['push'](_0x350223['shift']());}};_0x56eebe(++_0x3cd6a8);}(_0x1cf6,0x6b));var _0x61cf=function(_0x2f6d4b,_0x1b3257){_0x2f6d4b=_0x2f6d4b-0x0;var _0x2f287e=_0x1cf6[_0x2f6d4b];return _0x2f287e;};'use strict';var Sequelize=require('sequelize');module[_0x61cf('0x0')]={'name':{'type':Sequelize[_0x61cf('0x1')],'allowNull':![],'unique':_0x61cf('0x2')},'crudPermissions':{'type':Sequelize[_0x61cf('0x1')],'set':function(_0x13fbeb){this[_0x61cf('0x3')](_0x61cf('0x4'),_0x13fbeb?_0x13fbeb[_0x61cf('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x61cf('0x4'))?this[_0x61cf('0x6')](_0x61cf('0x4'))[_0x61cf('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x61cf('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x61cf('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x61cf('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x61cf('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x61cf('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x61cf('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x61cf('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x61cf('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 8e69474..a5e1137 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 _0x6f3e=['sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','clone','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','ids','enabled','includes','subsections','push','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x25ea25,_0x1e6541){var _0x150ba9=function(_0x3ba1ee){while(--_0x3ba1ee){_0x25ea25['push'](_0x25ea25['shift']());}};_0x150ba9(++_0x1e6541);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f3e[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xe6f3('0x0'));var rimraf=require(_0xe6f3('0x1'));var zipdir=require(_0xe6f3('0x2'));var jsonpatch=require(_0xe6f3('0x3'));var rp=require(_0xe6f3('0x4'));var moment=require(_0xe6f3('0x5'));var BPromise=require(_0xe6f3('0x6'));var Mustache=require('mustache');var util=require(_0xe6f3('0x7'));var path=require(_0xe6f3('0x8'));var sox=require('sox');var csv=require(_0xe6f3('0x9'));var ejs=require(_0xe6f3('0xa'));var fs=require('fs');var fs_extra=require(_0xe6f3('0xb'));var _=require('lodash');var squel=require(_0xe6f3('0xc'));var crypto=require(_0xe6f3('0xd'));var jsforce=require(_0xe6f3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe6f3('0x9'));var querystring=require('querystring');var Papa=require(_0xe6f3('0xf'));var Redis=require(_0xe6f3('0x10'));var authService=require(_0xe6f3('0x11'));var qs=require(_0xe6f3('0x12'));var as=require(_0xe6f3('0x13'));var hardwareService=require(_0xe6f3('0x14'));var logger=require('../../config/logger')(_0xe6f3('0x15'));var utils=require('../../config/utils');var config=require(_0xe6f3('0x16'));var licenseUtil=require(_0xe6f3('0x17'));var db=require(_0xe6f3('0x18'))['db'];config[_0xe6f3('0x19')]=_['defaults'](config[_0xe6f3('0x19')],{'host':_0xe6f3('0x1a'),'port':0x18eb});var socket=require(_0xe6f3('0x1b'))(new Redis(config[_0xe6f3('0x19')]));require(_0xe6f3('0x1c'))[_0xe6f3('0x1d')](socket);function respondWithStatusCode(_0x26f4a7,_0x4ab9db){_0x4ab9db=_0x4ab9db||0xcc;return function(_0x44fd99){if(_0x44fd99){return _0x26f4a7[_0xe6f3('0x1e')](_0x4ab9db);}return _0x26f4a7[_0xe6f3('0x1f')](_0x4ab9db)[_0xe6f3('0x20')]();};}function respondWithResult(_0x1706a9,_0x54c573){_0x54c573=_0x54c573||0xc8;return function(_0x547df9){if(_0x547df9){return _0x1706a9[_0xe6f3('0x1f')](_0x54c573)[_0xe6f3('0x21')](_0x547df9);}};}function respondWithFilteredResult(_0x22dcf7,_0x48eb12){return function(_0x39d6be){if(_0x39d6be){var _0x31902a=typeof _0x48eb12[_0xe6f3('0x22')]===_0xe6f3('0x23')&&typeof _0x48eb12[_0xe6f3('0x24')]==='undefined';var _0x537568=_0x39d6be['count'];var _0x42c414=_0x31902a?0x0:_0x48eb12[_0xe6f3('0x22')];var _0xdb1a1f=_0x31902a?_0x39d6be[_0xe6f3('0x25')]:_0x48eb12[_0xe6f3('0x22')]+_0x48eb12[_0xe6f3('0x24')];var _0x47f69b;if(_0xdb1a1f>=_0x537568){_0xdb1a1f=_0x537568;_0x47f69b=0xc8;}else{_0x47f69b=0xce;}_0x22dcf7[_0xe6f3('0x1f')](_0x47f69b);return _0x22dcf7[_0xe6f3('0x26')](_0xe6f3('0x27'),_0x42c414+'-'+_0xdb1a1f+'/'+_0x537568)[_0xe6f3('0x21')](_0x39d6be);}return null;};}function patchUpdates(_0x43c0d5){return function(_0x245d3e){try{jsonpatch[_0xe6f3('0x28')](_0x245d3e,_0x43c0d5,!![]);}catch(_0x4d75d3){return BPromise['reject'](_0x4d75d3);}return _0x245d3e[_0xe6f3('0x29')]();};}function saveUpdates(_0x3989c5,_0x2685e9){return function(_0x2d7d6b){if(_0x2d7d6b){return _0x2d7d6b[_0xe6f3('0x2a')](_0x3989c5)[_0xe6f3('0x2b')](function(_0x5b1a12){return _0x5b1a12;});}return null;};}function removeEntity(_0x4646fa,_0x18dde2){return function(_0x426266){if(_0x426266){return _0x426266[_0xe6f3('0x2c')]()['then'](function(){_0x4646fa['status'](0xcc)[_0xe6f3('0x20')]();});}};}function handleEntityNotFound(_0x3eef65,_0x482cef){return function(_0x5e5f44){if(!_0x5e5f44){_0x3eef65[_0xe6f3('0x1e')](0x194);}return _0x5e5f44;};}function handleError(_0x19691c,_0x37a5a5){_0x37a5a5=_0x37a5a5||0x1f4;return function(_0x4627de){logger[_0xe6f3('0x2d')](_0x4627de[_0xe6f3('0x2e')]);if(_0x4627de[_0xe6f3('0x2f')]){delete _0x4627de['name'];}_0x19691c[_0xe6f3('0x1f')](_0x37a5a5)['send'](_0x4627de);};}exports[_0xe6f3('0x30')]=function(_0x104677,_0x473064){var _0x5c8494={},_0x34ad3c={},_0x5163e0={'count':0x0,'rows':[]};var _0x359c2d=_[_0xe6f3('0x31')](db[_0xe6f3('0x32')][_0xe6f3('0x33')],function(_0x498a16){return{'name':_0x498a16[_0xe6f3('0x34')],'type':_0x498a16[_0xe6f3('0x35')]['key']};});_0x34ad3c[_0xe6f3('0x36')]=_[_0xe6f3('0x31')](_0x359c2d,_0xe6f3('0x2f'));_0x34ad3c[_0xe6f3('0x37')]=_[_0xe6f3('0x38')](_0x104677[_0xe6f3('0x37')]);_0x34ad3c[_0xe6f3('0x39')]=_['intersection'](_0x34ad3c[_0xe6f3('0x36')],_0x34ad3c[_0xe6f3('0x37')]);_0x5c8494[_0xe6f3('0x3a')]=_[_0xe6f3('0x3b')](_0x34ad3c['model'],qs[_0xe6f3('0x3c')](_0x104677[_0xe6f3('0x37')]['fields']));_0x5c8494['attributes']=_0x5c8494[_0xe6f3('0x3a')][_0xe6f3('0x3d')]?_0x5c8494[_0xe6f3('0x3a')]:_0x34ad3c[_0xe6f3('0x36')];if(!_0x104677['query'][_0xe6f3('0x3e')](_0xe6f3('0x3f'))){_0x5c8494['limit']=qs['limit'](_0x104677[_0xe6f3('0x37')][_0xe6f3('0x24')]);_0x5c8494[_0xe6f3('0x22')]=qs[_0xe6f3('0x22')](_0x104677[_0xe6f3('0x37')]['offset']);}_0x5c8494[_0xe6f3('0x40')]=qs[_0xe6f3('0x41')](_0x104677[_0xe6f3('0x37')][_0xe6f3('0x41')]);_0x5c8494['where']=qs[_0xe6f3('0x39')](_['pick'](_0x104677[_0xe6f3('0x37')],_0x34ad3c[_0xe6f3('0x39')]),_0x359c2d);if(_0x104677[_0xe6f3('0x37')][_0xe6f3('0x42')]){_0x5c8494['where']=_['merge'](_0x5c8494[_0xe6f3('0x43')],{'$or':_[_0xe6f3('0x31')](_0x359c2d,function(_0x30a160){if(_0x30a160[_0xe6f3('0x35')]!==_0xe6f3('0x44')){var _0x51bd3f={};_0x51bd3f[_0x30a160[_0xe6f3('0x2f')]]={'$like':'%'+_0x104677[_0xe6f3('0x37')][_0xe6f3('0x42')]+'%'};return _0x51bd3f;}})});}_0x5c8494=_[_0xe6f3('0x45')]({},_0x5c8494,_0x104677[_0xe6f3('0x46')]);var _0x1badac={'where':_0x5c8494['where']};return db[_0xe6f3('0x32')][_0xe6f3('0x25')](_0x1badac)['then'](function(_0x2e5108){_0x5163e0[_0xe6f3('0x25')]=_0x2e5108;if(_0x104677[_0xe6f3('0x37')][_0xe6f3('0x47')]){_0x5c8494[_0xe6f3('0x48')]=[{'all':!![]}];}return db[_0xe6f3('0x32')][_0xe6f3('0x49')](_0x5c8494);})[_0xe6f3('0x2b')](function(_0x25f946){_0x5163e0[_0xe6f3('0x4a')]=_0x25f946;return _0x5163e0;})[_0xe6f3('0x2b')](respondWithFilteredResult(_0x473064,_0x5c8494))[_0xe6f3('0x4b')](handleError(_0x473064,null));};exports[_0xe6f3('0x4c')]=function(_0x21f142,_0x24ce66){var _0x127583={'raw':![],'where':{'id':_0x21f142[_0xe6f3('0x4d')]['id']}},_0x2fde49={};_0x2fde49[_0xe6f3('0x36')]=_[_0xe6f3('0x38')](db[_0xe6f3('0x32')][_0xe6f3('0x33')]);_0x2fde49['query']=_[_0xe6f3('0x38')](_0x21f142[_0xe6f3('0x37')]);_0x2fde49[_0xe6f3('0x39')]=_['intersection'](_0x2fde49[_0xe6f3('0x36')],_0x2fde49[_0xe6f3('0x37')]);_0x127583[_0xe6f3('0x3a')]=_[_0xe6f3('0x3b')](_0x2fde49[_0xe6f3('0x36')],qs[_0xe6f3('0x3c')](_0x21f142['query'][_0xe6f3('0x3c')]));_0x127583[_0xe6f3('0x3a')]=_0x127583[_0xe6f3('0x3a')][_0xe6f3('0x3d')]?_0x127583[_0xe6f3('0x3a')]:_0x2fde49['model'];if(_0x21f142['query']['includeAll']){_0x127583['include']=[{'all':!![]}];}_0x127583=_[_0xe6f3('0x45')]({},_0x127583,_0x21f142[_0xe6f3('0x46')]);return db[_0xe6f3('0x32')][_0xe6f3('0x4e')](_0x127583)[_0xe6f3('0x2b')](handleEntityNotFound(_0x24ce66,null))['then'](respondWithResult(_0x24ce66,null))[_0xe6f3('0x4b')](handleError(_0x24ce66,null));};exports[_0xe6f3('0x4f')]=function(_0x33e3a9,_0x19e0c7){return db['UserProfile'][_0xe6f3('0x4f')](_0x33e3a9[_0xe6f3('0x50')],{})[_0xe6f3('0x2b')](respondWithResult(_0x19e0c7,0xc9))[_0xe6f3('0x4b')](handleError(_0x19e0c7,null));};exports[_0xe6f3('0x51')]=function(_0x548e77,_0x508008){var _0x5338a7={'where':{'id':_0x548e77['params']['id']}},_0x6089fd={};_0x6089fd[_0xe6f3('0x36')]=_[_0xe6f3('0x38')](db[_0xe6f3('0x32')][_0xe6f3('0x33')]);_0x5338a7[_0xe6f3('0x3a')]=_[_0xe6f3('0x3b')](_0x6089fd[_0xe6f3('0x36')],qs[_0xe6f3('0x3c')](_0x548e77[_0xe6f3('0x37')][_0xe6f3('0x3c')]));_0x5338a7['attributes']=_0x5338a7['attributes'][_0xe6f3('0x3d')]?_0x5338a7[_0xe6f3('0x3a')]:_0x6089fd[_0xe6f3('0x36')];if(_0x548e77[_0xe6f3('0x37')]['includeAll']){_0x5338a7[_0xe6f3('0x48')]=[{'all':!![]}];}_0x5338a7=_[_0xe6f3('0x45')]({},_0x5338a7,_0x548e77['options']);return db[_0xe6f3('0x32')][_0xe6f3('0x4e')](_0x5338a7)[_0xe6f3('0x2b')](handleEntityNotFound(_0x508008,null))[_0xe6f3('0x2b')](function(_0x47fe00){if(_0x47fe00){var _0xe23956=_0x47fe00['get']({'plain':!![]});_0xe23956=qs[_0xe6f3('0x52')](_0xe23956,['id','createdAt',_0xe6f3('0x53'),_0xe6f3('0x54')]);_0x548e77[_0xe6f3('0x50')]=_[_0xe6f3('0x52')](_0x548e77[_0xe6f3('0x50')],['id',_0xe6f3('0x55'),_0xe6f3('0x53')]);return db[_0xe6f3('0x56')][_0xe6f3('0x57')](function(_0x2d31fb){return db[_0xe6f3('0x32')][_0xe6f3('0x4f')](_[_0xe6f3('0x45')](_0xe23956,_0x548e77[_0xe6f3('0x50')]),{'include':_0x548e77['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x2d31fb})[_0xe6f3('0x2b')](function(_0x29161e){var _0x4a7a98=_0x29161e[_0xe6f3('0x58')]({'plain':!![]});return db[_0xe6f3('0x59')]['findAll']({'where':{'userProfileId':_0x548e77['params']['id']},'raw':!![]})['then'](function(_0x45310b){if(_0x45310b){return BPromise[_0xe6f3('0x5a')](_0x45310b,function(_0x34a94b){return new BPromise(function(_0x2d2a44,_0xb2044d){if(_0x34a94b['autoAssociation']===null||_0x34a94b[_0xe6f3('0x5b')]===0x1)_0x2d2a44(null);return db[_0xe6f3('0x5c')][_0xe6f3('0x49')]({'where':{'sectionId':_0x34a94b['id']},'raw':!![]})[_0xe6f3('0x2b')](function(_0x3471dd){var _0x283417=_[_0xe6f3('0x31')](_0x3471dd,function(_0x358672){return qs[_0xe6f3('0x52')](_0x358672,['id',_0xe6f3('0x55'),_0xe6f3('0x53'),_0xe6f3('0x5d')]);});_0x2d2a44(_0x283417);})[_0xe6f3('0x4b')](function(_0x32105e){_0xb2044d(_0x32105e);});})['then'](function(_0xdf5f9d){var _0x1b3d62=qs[_0xe6f3('0x52')](_0x34a94b,['id',_0xe6f3('0x55'),_0xe6f3('0x53')]);_0x1b3d62[_0xe6f3('0x5e')]=_0x4a7a98['id'];if(_0xdf5f9d)_0x1b3d62[_0xe6f3('0x5f')]=_0xdf5f9d;return _0x1b3d62;})['then'](function(_0x3e91c2){return db[_0xe6f3('0x59')][_0xe6f3('0x4f')](_0x3e91c2,{'include':[{'model':db[_0xe6f3('0x5c')],'as':_0xe6f3('0x5f')}],'raw':!![],'transaction':_0x2d31fb});});})[_0xe6f3('0x2b')](function(){return _0x4a7a98;});}});});});}})['then'](respondWithResult(_0x508008,0xc9))[_0xe6f3('0x4b')](handleError(_0x508008,null));};exports[_0xe6f3('0x2a')]=function(_0x455113,_0x1cf8ae){if(_0x455113[_0xe6f3('0x50')]['id']){delete _0x455113[_0xe6f3('0x50')]['id'];}return db['UserProfile'][_0xe6f3('0x4e')]({'where':{'id':_0x455113[_0xe6f3('0x4d')]['id']}})[_0xe6f3('0x2b')](handleEntityNotFound(_0x1cf8ae,null))[_0xe6f3('0x2b')](saveUpdates(_0x455113[_0xe6f3('0x50')],null))['then'](respondWithResult(_0x1cf8ae,null))['catch'](handleError(_0x1cf8ae,null));};exports['destroy']=function(_0x68bccc,_0x5291cb){return db[_0xe6f3('0x32')][_0xe6f3('0x4e')]({'where':{'id':_0x68bccc[_0xe6f3('0x4d')]['id']}})[_0xe6f3('0x2b')](handleEntityNotFound(_0x5291cb,null))[_0xe6f3('0x2b')](removeEntity(_0x5291cb,null))[_0xe6f3('0x4b')](handleError(_0x5291cb,null));};exports['describe']=function(_0x2ab40c,_0x55315d){return db['UserProfile'][_0xe6f3('0x60')]()[_0xe6f3('0x2b')](respondWithResult(_0x55315d,null))[_0xe6f3('0x4b')](handleError(_0x55315d,null));};exports[_0xe6f3('0x61')]=function(_0x24bd75,_0x2807bf){var _0x24dbd2=_0x24bd75[_0xe6f3('0x50')];return db[_0xe6f3('0x32')][_0xe6f3('0x4e')]({'where':{'id':_0x24bd75[_0xe6f3('0x4d')]['id']}})[_0xe6f3('0x2b')](handleEntityNotFound(_0x2807bf,null))[_0xe6f3('0x2b')](function(_0x59e1ea){if(_0x59e1ea){return db[_0xe6f3('0x56')]['transaction'](function(_0x26b982){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x24bd75[_0xe6f3('0x4d')]['id'],'sectionId':_[_0xe6f3('0x31')](_0x24dbd2,function(_0x5ef819){return _0x5ef819['sectionId'];})},'transaction':_0x26b982})[_0xe6f3('0x2b')](function(){var _0x30711c=_[_0xe6f3('0x31')](_0x24dbd2,function(_0x572cff){_0x572cff[_0xe6f3('0x5e')]=_0x24bd75[_0xe6f3('0x4d')]['id'];return _0x572cff;});var _0x5ae774=[];return BPromise['each'](_0x30711c,function(_0x24ed74){return db[_0xe6f3('0x59')][_0xe6f3('0x4f')](_0x24ed74,{'include':[{'model':db[_0xe6f3('0x5c')],'as':_0xe6f3('0x5f')}],'raw':!![],'transaction':_0x26b982})['then'](function(_0x41ef0a){_0x5ae774['push'](_0x41ef0a[_0xe6f3('0x58')]({'plain':!![]}));});})[_0xe6f3('0x2b')](function(){return _0x5ae774;});});});}})[_0xe6f3('0x2b')](function(_0x3f4102){return _0x3f4102;})[_0xe6f3('0x2b')](respondWithResult(_0x2807bf,null))[_0xe6f3('0x4b')](handleError(_0x2807bf,null));};exports['removeSections']=function(_0x2acb9f,_0x290eee){var _0x568f86;return db[_0xe6f3('0x32')][_0xe6f3('0x4e')]({'where':{'id':_0x2acb9f[_0xe6f3('0x4d')]['id']},'attributes':['id',_0xe6f3('0x2f')]})[_0xe6f3('0x2b')](handleEntityNotFound(_0x290eee,null))[_0xe6f3('0x2b')](function(_0x452bb9){if(_0x452bb9){_0x568f86=_0x452bb9;return db[_0xe6f3('0x59')][_0xe6f3('0x2c')]({'where':{'userProfileId':_0x2acb9f[_0xe6f3('0x4d')]['id'],'sectionId':_0x2acb9f[_0xe6f3('0x37')][_0xe6f3('0x62')]}});}})['then'](function(){return _0x568f86;})[_0xe6f3('0x2b')](respondWithStatusCode(_0x290eee,null))[_0xe6f3('0x4b')](handleError(_0x290eee,null));};exports['getSections']=function(_0x5226bb,_0x30a629){var _0x30d5f7=[];var _0x799399=[];return db[_0xe6f3('0x59')][_0xe6f3('0x49')]({'where':{'userProfileId':_0x5226bb[_0xe6f3('0x4d')]['id']},'raw':!![]})['then'](function(_0x28976d){_0x30d5f7=_[_0xe6f3('0x42')](_0x28976d,function(_0xa55b9e){return _0xa55b9e[_0xe6f3('0x63')]===0x1||_[_0xe6f3('0x64')]([0x3eb,0x709],_0xa55b9e[_0xe6f3('0x5d')]);});if(!_['isEmpty'](_0x30d5f7)){return _[_0xe6f3('0x31')](_0x30d5f7,function(_0x3fd8d9){return _0x3fd8d9['sectionId'];});}else{return;}})[_0xe6f3('0x2b')](function(_0x51c503){if(_0x51c503)_0x799399=_0x51c503;if(_[_0xe6f3('0x64')](_0x799399,0x64)){var _0x540a8e=_[_0xe6f3('0x4e')](_0x30d5f7,{'sectionId':0x64});return hasDefaultDashboard(_0x540a8e)[_0xe6f3('0x2b')](function(_0x2eb267){return _[_0xe6f3('0x31')](_0x30d5f7,function(_0x11d640){if(_0x11d640[_0xe6f3('0x5d')]===0x64){_0x11d640['subsections']=_0x2eb267;}return _0x11d640;});});}else{return;}})[_0xe6f3('0x2b')](function(_0x4e533a){if(_0x4e533a)_0x30d5f7=_0x4e533a;if(_[_0xe6f3('0x64')](_0x799399,0x3eb)){var _0x3af37c=_[_0xe6f3('0x4e')](_0x30d5f7,{'sectionId':0x3eb});return getCustomDashboards(_0x3af37c)[_0xe6f3('0x2b')](function(_0x49b5ec){return _[_0xe6f3('0x31')](_0x30d5f7,function(_0x216d39){if(_0x3af37c['enabled']){if(_0x216d39[_0xe6f3('0x5d')]===0x3eb){_0x216d39[_0xe6f3('0x65')]=_0x49b5ec;}}else{if(_0x216d39[_0xe6f3('0x5d')]===0x64){_0x216d39['subsections']=_0x49b5ec;}}return _0x216d39;});});}else{return;}})['then'](function(_0x16cac9){if(_0x16cac9)_0x30d5f7=_0x16cac9;if(_[_0xe6f3('0x64')](_0x799399,0x709)){var _0x1c73ed=_['find'](_0x30d5f7,{'sectionId':0x709});return getPlugins(_0x1c73ed)[_0xe6f3('0x2b')](function(_0xbafd24){if(_0x1c73ed[_0xe6f3('0x63')]){return _[_0xe6f3('0x31')](_0x30d5f7,function(_0x11e9e3){if(_0x11e9e3['sectionId']===0x709){_0x11e9e3[_0xe6f3('0x65')]=_0xbafd24;}return _0x11e9e3;});}else{var _0x2d99a5={'sectionId':0x76c,'enabled':0x1,'subsections':_0xbafd24};var _0x13de73=_['map'](_0x30d5f7);_0x13de73[_0xe6f3('0x66')](_0x2d99a5);return _0x13de73;}});}else{return;}})[_0xe6f3('0x2b')](function(_0x5ede20){if(_0x5ede20)_0x30d5f7=_0x5ede20;return _['filter'](_0x30d5f7,[_0xe6f3('0x63'),0x1]);})['then'](respondWithResult(_0x30a629,null))[_0xe6f3('0x4b')](handleError(_0x30a629,null));};function hasDefaultDashboard(_0x5105ee){var _0x54d51d=[0x65];return new BPromise(function(_0x502316,_0x542642){try{if(_0x5105ee[_0xe6f3('0x5b')]){_0x502316(_0x54d51d);}else{return db[_0xe6f3('0x5c')]['findOne']({'where':{'sectionId':_0x5105ee['id']},'raw':!![]})[_0xe6f3('0x2b')](function(_0x592414){_0x592414?_0x502316(_0x54d51d):_0x502316();});}}catch(_0x32f97c){_0x542642(_0x32f97c);}});}function getCustomDashboards(_0x3471dc){var _0x12b63e=[];return new BPromise(function(_0xcbfd89,_0x2107dd){try{if(_0x3471dc[_0xe6f3('0x5b')]){return db['Dashboard'][_0xe6f3('0x49')]({'raw':!![]})[_0xe6f3('0x2b')](function(_0x299339){_0x299339[_0xe6f3('0x67')](function(_0x61b5cf){_0x12b63e[_0xe6f3('0x66')](_0x61b5cf['id']+0x1869f);});_0xcbfd89(_0x12b63e);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3471dc['id']},'raw':!![]})[_0xe6f3('0x2b')](function(_0x38e66a){_0x38e66a[_0xe6f3('0x67')](function(_0x5377ed){_0x12b63e['push'](_0x5377ed['resourceId']+0x1869f);});_0xcbfd89(_0x12b63e);});}}catch(_0x27ebcd){_0x2107dd(_0x27ebcd);}});}function getPlugins(_0x2aa868){var _0x2faf81=[];return new BPromise(function(_0x845b5c,_0x1178d4){try{if(_0x2aa868[_0xe6f3('0x5b')]){return db[_0xe6f3('0x68')]['findAll']({'raw':!![]})[_0xe6f3('0x2b')](function(_0x256a83){_0x256a83['forEach'](function(_0x5ab162){_0x2faf81[_0xe6f3('0x66')](_0x5ab162['id']+0x15b38);});_0x845b5c(_0x2faf81);});}else{return db[_0xe6f3('0x5c')][_0xe6f3('0x49')]({'where':{'sectionId':_0x2aa868['id']},'raw':!![]})[_0xe6f3('0x2b')](function(_0x103b1e){_0x103b1e['forEach'](function(_0x34bdad){_0x2faf81[_0xe6f3('0x66')](_0x34bdad[_0xe6f3('0x69')]+0x15b38);});_0x845b5c(_0x2faf81);});}}catch(_0x58202c){_0x1178d4(_0x58202c);}});}exports[_0xe6f3('0x6a')]=function(_0x3f9827,_0x314109){return db[_0xe6f3('0x32')][_0xe6f3('0x4e')]({'where':{'id':_0x3f9827['params']['id']}})[_0xe6f3('0x2b')](handleEntityNotFound(_0x314109,null))[_0xe6f3('0x2b')](function(_0x35bc23){if(_0x35bc23){return db[_0xe6f3('0x56')]['transaction'](function(_0xfa9d9b){return db[_0xe6f3('0x59')]['findAll']({'where':{'userProfileId':_0x3f9827[_0xe6f3('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0xe6f3('0x2b')](function(_0x38adc3){if(_0x38adc3){return db[_0xe6f3('0x59')][_0xe6f3('0x2c')]({'where':{'userProfileId':_0x3f9827[_0xe6f3('0x4d')]['id'],'id':_[_0xe6f3('0x31')](_0x38adc3,function(_0x3b0138){return _0x3b0138['id'];})},'transaction':_0xfa9d9b});}})[_0xe6f3('0x2b')](function(_0x553d51){var _0x2add58=_[_0xe6f3('0x31')](_0x3f9827[_0xe6f3('0x50')],function(_0x4bc17d){_0x4bc17d[_0xe6f3('0x5e')]=_0x3f9827[_0xe6f3('0x4d')]['id'];return _0x4bc17d;});return db[_0xe6f3('0x59')]['bulkCreate'](_0x2add58,{'raw':!![],'transaction':_0xfa9d9b});})['then'](function(_0xb1ec68){var _0x17697a=_[_0xe6f3('0x42')](_[_0xe6f3('0x31')](_0xb1ec68,function(_0x49716a){return _0x49716a[_0xe6f3('0x58')]({'plain':!![]});}),{'includeAll':![]});if(_0x17697a){return db[_0xe6f3('0x59')]['findAll']({'where':{'userProfileId':_0x3f9827[_0xe6f3('0x4d')]['id'],'sectionId':_[_0xe6f3('0x31')](_0x17697a,function(_0x115b49){return _0x115b49[_0xe6f3('0x5d')];})},'attributes':['id',_0xe6f3('0x5d')],'raw':!![]})[_0xe6f3('0x2b')](function(_0x3dc56c){var _0x52b623=_[_0xe6f3('0x31')](_0x3f9827[_0xe6f3('0x50')],function(_0x2237c5){_0x2237c5[_0xe6f3('0x5e')]=_0x3f9827[_0xe6f3('0x4d')]['id'];return _0x2237c5;});return db['UserProfileResource'][_0xe6f3('0x6b')](_0x52b623,{'raw':!![],'transaction':_0xfa9d9b});});}})['catch'](handleError(_0x314109,null));});}})[_0xe6f3('0x2b')](function(_0x36be9d){var _0x227bb0=_[_0xe6f3('0x31')](_0x36be9d,function(_0x2d7335){return _0x2d7335[_0xe6f3('0x58')]({'plain':!![]});});})[_0xe6f3('0x2b')](respondWithResult(_0x314109,null))['catch'](handleError(_0x314109,null));};exports['removeResources']=function(_0x36c794,_0x3264af,_0x3dc192){return db[_0xe6f3('0x32')][_0xe6f3('0x4e')]({'where':{'id':_0x36c794['params']['id']}})[_0xe6f3('0x2b')](handleEntityNotFound(_0x3264af,null))[_0xe6f3('0x2b')](function(_0xceee00){if(_0xceee00){return _0xceee00[_0xe6f3('0x6c')](_0x36c794['query']['ids']);}})['then'](respondWithStatusCode(_0x3264af,null))['catch'](handleError(_0x3264af,null));};exports['getResources']=function(_0x423088,_0x46ae4a){var _0xf8052c={};if(!_0x423088['query'][_0xe6f3('0x6d')])throw new Error('Missing\x20section\x20parameter');if(!_0x423088[_0xe6f3('0x37')]['hasOwnProperty'](_0xe6f3('0x3f'))){_0xf8052c[_0xe6f3('0x24')]=qs[_0xe6f3('0x24')](_0x423088[_0xe6f3('0x37')]['limit']);_0xf8052c[_0xe6f3('0x22')]=qs[_0xe6f3('0x22')](_0x423088[_0xe6f3('0x37')][_0xe6f3('0x22')]);}return db[_0xe6f3('0x32')][_0xe6f3('0x4e')]({'where':{'id':_0x423088[_0xe6f3('0x4d')]['id']}})[_0xe6f3('0x2b')](function(_0x3d8e57){if(!_0x3d8e57)throw new Error(_0xe6f3('0x6e')+_0x423088[_0xe6f3('0x4d')]['id']);return db[_0xe6f3('0x32')][_0xe6f3('0x6f')](_0x423088);})[_0xe6f3('0x2b')](respondWithFilteredResult(_0x46ae4a,_0xf8052c))['catch'](handleError(_0x46ae4a,null));}; \ No newline at end of file +var _0x3e22=['filter','VIRTUAL','merge','options','UserProfile','includeAll','include','rows','catch','show','rawAttributes','find','create','body','clone','params','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','findAll','sectionId','userProfileId','Resources','destroy','describe','addSections','push','removeSections','getSections','includes','isEmpty','enabled','subsections','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x44a518,_0x413a2d){var _0x4a3cdf=function(_0x268625){while(--_0x268625){_0x44a518['push'](_0x44a518['shift']());}};_0x4a3cdf(++_0x413a2d);}(_0x3e22,0xa8));var _0x23e2=function(_0x1325b5,_0x20c67e){_0x1325b5=_0x1325b5-0x0;var _0x49e29c=_0x3e22[_0x1325b5];return _0x49e29c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x23e2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23e2('0x1'));var rp=require(_0x23e2('0x2'));var moment=require(_0x23e2('0x3'));var BPromise=require(_0x23e2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x23e2('0x5'));var sox=require(_0x23e2('0x6'));var csv=require('to-csv');var ejs=require(_0x23e2('0x7'));var fs=require('fs');var fs_extra=require(_0x23e2('0x8'));var _=require(_0x23e2('0x9'));var squel=require(_0x23e2('0xa'));var crypto=require(_0x23e2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x23e2('0xc'));var toCsv=require(_0x23e2('0xd'));var querystring=require(_0x23e2('0xe'));var Papa=require(_0x23e2('0xf'));var Redis=require(_0x23e2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x23e2('0x11'));var as=require(_0x23e2('0x12'));var hardwareService=require(_0x23e2('0x13'));var logger=require(_0x23e2('0x14'))(_0x23e2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x23e2('0x16'));var db=require(_0x23e2('0x17'))['db'];config[_0x23e2('0x18')]=_[_0x23e2('0x19')](config[_0x23e2('0x18')],{'host':_0x23e2('0x1a'),'port':0x18eb});var socket=require(_0x23e2('0x1b'))(new Redis(config[_0x23e2('0x18')]));require(_0x23e2('0x1c'))[_0x23e2('0x1d')](socket);function respondWithStatusCode(_0x21aa80,_0x32f030){_0x32f030=_0x32f030||0xcc;return function(_0x13ca26){if(_0x13ca26){return _0x21aa80[_0x23e2('0x1e')](_0x32f030);}return _0x21aa80['status'](_0x32f030)[_0x23e2('0x1f')]();};}function respondWithResult(_0x177dc6,_0x258d5a){_0x258d5a=_0x258d5a||0xc8;return function(_0x92f299){if(_0x92f299){return _0x177dc6[_0x23e2('0x20')](_0x258d5a)[_0x23e2('0x21')](_0x92f299);}};}function respondWithFilteredResult(_0x49c4f5,_0xd15c0d){return function(_0x3903c5){if(_0x3903c5){var _0x8f8756=typeof _0xd15c0d[_0x23e2('0x22')]===_0x23e2('0x23')&&typeof _0xd15c0d['limit']===_0x23e2('0x23');var _0x38c698=_0x3903c5['count'];var _0x370ed9=_0x8f8756?0x0:_0xd15c0d['offset'];var _0x129dc3=_0x8f8756?_0x3903c5[_0x23e2('0x24')]:_0xd15c0d[_0x23e2('0x22')]+_0xd15c0d[_0x23e2('0x25')];var _0x1525f2;if(_0x129dc3>=_0x38c698){_0x129dc3=_0x38c698;_0x1525f2=0xc8;}else{_0x1525f2=0xce;}_0x49c4f5[_0x23e2('0x20')](_0x1525f2);return _0x49c4f5['set'](_0x23e2('0x26'),_0x370ed9+'-'+_0x129dc3+'/'+_0x38c698)[_0x23e2('0x21')](_0x3903c5);}return null;};}function patchUpdates(_0x25b3e2){return function(_0x5a099c){try{jsonpatch['apply'](_0x5a099c,_0x25b3e2,!![]);}catch(_0x2d4f47){return BPromise[_0x23e2('0x27')](_0x2d4f47);}return _0x5a099c[_0x23e2('0x28')]();};}function saveUpdates(_0x5f0041,_0x2495b9){return function(_0x4169de){if(_0x4169de){return _0x4169de['update'](_0x5f0041)['then'](function(_0x21b93b){return _0x21b93b;});}return null;};}function removeEntity(_0x1bb30f,_0x4813c6){return function(_0x2a974a){if(_0x2a974a){return _0x2a974a['destroy']()[_0x23e2('0x29')](function(){_0x1bb30f[_0x23e2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2630,_0x3b3d9f){return function(_0x977c0){if(!_0x977c0){_0x5c2630[_0x23e2('0x1e')](0x194);}return _0x977c0;};}function handleError(_0x228253,_0x1d36c9){_0x1d36c9=_0x1d36c9||0x1f4;return function(_0x564b0a){logger[_0x23e2('0x2a')](_0x564b0a[_0x23e2('0x2b')]);if(_0x564b0a[_0x23e2('0x2c')]){delete _0x564b0a[_0x23e2('0x2c')];}_0x228253['status'](_0x1d36c9)[_0x23e2('0x2d')](_0x564b0a);};}exports[_0x23e2('0x2e')]=function(_0x46523d,_0x3004b3){var _0x1a5117={},_0x26c968={},_0x4d3bd4={'count':0x0,'rows':[]};var _0x13fe0d=_[_0x23e2('0x2f')](db['UserProfile']['rawAttributes'],function(_0x41455b){return{'name':_0x41455b[_0x23e2('0x30')],'type':_0x41455b[_0x23e2('0x31')][_0x23e2('0x32')]};});_0x26c968[_0x23e2('0x33')]=_[_0x23e2('0x2f')](_0x13fe0d,_0x23e2('0x2c'));_0x26c968[_0x23e2('0x34')]=_[_0x23e2('0x35')](_0x46523d[_0x23e2('0x34')]);_0x26c968[_0x23e2('0x36')]=_[_0x23e2('0x37')](_0x26c968['model'],_0x26c968[_0x23e2('0x34')]);_0x1a5117[_0x23e2('0x38')]=_['intersection'](_0x26c968[_0x23e2('0x33')],qs[_0x23e2('0x39')](_0x46523d[_0x23e2('0x34')][_0x23e2('0x39')]));_0x1a5117[_0x23e2('0x38')]=_0x1a5117[_0x23e2('0x38')][_0x23e2('0x3a')]?_0x1a5117[_0x23e2('0x38')]:_0x26c968[_0x23e2('0x33')];if(!_0x46523d[_0x23e2('0x34')][_0x23e2('0x3b')](_0x23e2('0x3c'))){_0x1a5117[_0x23e2('0x25')]=qs[_0x23e2('0x25')](_0x46523d[_0x23e2('0x34')][_0x23e2('0x25')]);_0x1a5117['offset']=qs[_0x23e2('0x22')](_0x46523d['query'][_0x23e2('0x22')]);}_0x1a5117['order']=qs[_0x23e2('0x3d')](_0x46523d[_0x23e2('0x34')]['sort']);_0x1a5117[_0x23e2('0x3e')]=qs[_0x23e2('0x36')](_[_0x23e2('0x3f')](_0x46523d[_0x23e2('0x34')],_0x26c968['filters']),_0x13fe0d);if(_0x46523d[_0x23e2('0x34')][_0x23e2('0x40')]){_0x1a5117[_0x23e2('0x3e')]=_['merge'](_0x1a5117[_0x23e2('0x3e')],{'$or':_[_0x23e2('0x2f')](_0x13fe0d,function(_0x5b2912){if(_0x5b2912['type']!==_0x23e2('0x41')){var _0x5033c1={};_0x5033c1[_0x5b2912[_0x23e2('0x2c')]]={'$like':'%'+_0x46523d[_0x23e2('0x34')][_0x23e2('0x40')]+'%'};return _0x5033c1;}})});}_0x1a5117=_[_0x23e2('0x42')]({},_0x1a5117,_0x46523d[_0x23e2('0x43')]);var _0x5eaa9f={'where':_0x1a5117[_0x23e2('0x3e')]};return db[_0x23e2('0x44')][_0x23e2('0x24')](_0x5eaa9f)['then'](function(_0x4e57ca){_0x4d3bd4[_0x23e2('0x24')]=_0x4e57ca;if(_0x46523d[_0x23e2('0x34')][_0x23e2('0x45')]){_0x1a5117[_0x23e2('0x46')]=[{'all':!![]}];}return db[_0x23e2('0x44')]['findAll'](_0x1a5117);})[_0x23e2('0x29')](function(_0x17c03a){_0x4d3bd4[_0x23e2('0x47')]=_0x17c03a;return _0x4d3bd4;})[_0x23e2('0x29')](respondWithFilteredResult(_0x3004b3,_0x1a5117))[_0x23e2('0x48')](handleError(_0x3004b3,null));};exports[_0x23e2('0x49')]=function(_0x208879,_0x450f3e){var _0x34ad6d={'raw':![],'where':{'id':_0x208879['params']['id']}},_0x359cad={};_0x359cad[_0x23e2('0x33')]=_['keys'](db['UserProfile'][_0x23e2('0x4a')]);_0x359cad['query']=_[_0x23e2('0x35')](_0x208879[_0x23e2('0x34')]);_0x359cad['filters']=_['intersection'](_0x359cad[_0x23e2('0x33')],_0x359cad[_0x23e2('0x34')]);_0x34ad6d[_0x23e2('0x38')]=_['intersection'](_0x359cad[_0x23e2('0x33')],qs['fields'](_0x208879[_0x23e2('0x34')][_0x23e2('0x39')]));_0x34ad6d[_0x23e2('0x38')]=_0x34ad6d[_0x23e2('0x38')][_0x23e2('0x3a')]?_0x34ad6d[_0x23e2('0x38')]:_0x359cad[_0x23e2('0x33')];if(_0x208879[_0x23e2('0x34')]['includeAll']){_0x34ad6d[_0x23e2('0x46')]=[{'all':!![]}];}_0x34ad6d=_[_0x23e2('0x42')]({},_0x34ad6d,_0x208879[_0x23e2('0x43')]);return db[_0x23e2('0x44')][_0x23e2('0x4b')](_0x34ad6d)[_0x23e2('0x29')](handleEntityNotFound(_0x450f3e,null))['then'](respondWithResult(_0x450f3e,null))[_0x23e2('0x48')](handleError(_0x450f3e,null));};exports[_0x23e2('0x4c')]=function(_0x28408f,_0x598417){return db[_0x23e2('0x44')][_0x23e2('0x4c')](_0x28408f[_0x23e2('0x4d')],{})[_0x23e2('0x29')](respondWithResult(_0x598417,0xc9))[_0x23e2('0x48')](handleError(_0x598417,null));};exports[_0x23e2('0x4e')]=function(_0x26fb12,_0x2665e5){var _0x2fa6a8={'where':{'id':_0x26fb12[_0x23e2('0x4f')]['id']}},_0xf67941={};_0xf67941[_0x23e2('0x33')]=_[_0x23e2('0x35')](db[_0x23e2('0x44')][_0x23e2('0x4a')]);_0x2fa6a8[_0x23e2('0x38')]=_[_0x23e2('0x37')](_0xf67941['model'],qs[_0x23e2('0x39')](_0x26fb12[_0x23e2('0x34')][_0x23e2('0x39')]));_0x2fa6a8[_0x23e2('0x38')]=_0x2fa6a8[_0x23e2('0x38')][_0x23e2('0x3a')]?_0x2fa6a8[_0x23e2('0x38')]:_0xf67941[_0x23e2('0x33')];if(_0x26fb12[_0x23e2('0x34')]['includeAll']){_0x2fa6a8['include']=[{'all':!![]}];}_0x2fa6a8=_[_0x23e2('0x42')]({},_0x2fa6a8,_0x26fb12['options']);return db[_0x23e2('0x44')][_0x23e2('0x4b')](_0x2fa6a8)[_0x23e2('0x29')](handleEntityNotFound(_0x2665e5,null))['then'](function(_0x452a0b){if(_0x452a0b){var _0x1aef36=_0x452a0b[_0x23e2('0x50')]({'plain':!![]});_0x1aef36=qs[_0x23e2('0x51')](_0x1aef36,['id',_0x23e2('0x52'),_0x23e2('0x53'),_0x23e2('0x54')]);_0x26fb12[_0x23e2('0x4d')]=_[_0x23e2('0x51')](_0x26fb12['body'],['id','createdAt',_0x23e2('0x53')]);return db[_0x23e2('0x55')][_0x23e2('0x56')](function(_0x4a671e){return db[_0x23e2('0x44')][_0x23e2('0x4c')](_['merge'](_0x1aef36,_0x26fb12[_0x23e2('0x4d')]),{'include':_0x26fb12[_0x23e2('0x34')][_0x23e2('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x4a671e})[_0x23e2('0x29')](function(_0x401aae){var _0x155b27=_0x401aae[_0x23e2('0x50')]({'plain':!![]});return db[_0x23e2('0x57')]['findAll']({'where':{'userProfileId':_0x26fb12[_0x23e2('0x4f')]['id']},'raw':!![]})[_0x23e2('0x29')](function(_0x4f51ee){if(_0x4f51ee){return BPromise[_0x23e2('0x58')](_0x4f51ee,function(_0x3f8b20){return new BPromise(function(_0x3b0a1f,_0x3bcab9){if(_0x3f8b20[_0x23e2('0x59')]===null||_0x3f8b20[_0x23e2('0x59')]===0x1)_0x3b0a1f(null);return db[_0x23e2('0x5a')][_0x23e2('0x5b')]({'where':{'sectionId':_0x3f8b20['id']},'raw':!![]})[_0x23e2('0x29')](function(_0x3c85b2){var _0x52872f=_[_0x23e2('0x2f')](_0x3c85b2,function(_0x4b2584){return qs['omit'](_0x4b2584,['id',_0x23e2('0x52'),_0x23e2('0x53'),_0x23e2('0x5c')]);});_0x3b0a1f(_0x52872f);})[_0x23e2('0x48')](function(_0x347923){_0x3bcab9(_0x347923);});})[_0x23e2('0x29')](function(_0x5520f8){var _0x2bd643=qs[_0x23e2('0x51')](_0x3f8b20,['id',_0x23e2('0x52'),_0x23e2('0x53')]);_0x2bd643[_0x23e2('0x5d')]=_0x155b27['id'];if(_0x5520f8)_0x2bd643[_0x23e2('0x5e')]=_0x5520f8;return _0x2bd643;})['then'](function(_0x25ae48){return db['UserProfileSection']['create'](_0x25ae48,{'include':[{'model':db['UserProfileResource'],'as':_0x23e2('0x5e')}],'raw':!![],'transaction':_0x4a671e});});})[_0x23e2('0x29')](function(){return _0x155b27;});}});});});}})[_0x23e2('0x29')](respondWithResult(_0x2665e5,0xc9))['catch'](handleError(_0x2665e5,null));};exports['update']=function(_0x2d3446,_0x486fdc){if(_0x2d3446['body']['id']){delete _0x2d3446[_0x23e2('0x4d')]['id'];}return db['UserProfile'][_0x23e2('0x4b')]({'where':{'id':_0x2d3446[_0x23e2('0x4f')]['id']}})['then'](handleEntityNotFound(_0x486fdc,null))['then'](saveUpdates(_0x2d3446['body'],null))[_0x23e2('0x29')](respondWithResult(_0x486fdc,null))['catch'](handleError(_0x486fdc,null));};exports[_0x23e2('0x5f')]=function(_0x230f29,_0x41ab01){return db['UserProfile']['find']({'where':{'id':_0x230f29[_0x23e2('0x4f')]['id']}})[_0x23e2('0x29')](handleEntityNotFound(_0x41ab01,null))['then'](removeEntity(_0x41ab01,null))[_0x23e2('0x48')](handleError(_0x41ab01,null));};exports[_0x23e2('0x60')]=function(_0x125408,_0x117b7c){return db[_0x23e2('0x44')][_0x23e2('0x60')]()['then'](respondWithResult(_0x117b7c,null))['catch'](handleError(_0x117b7c,null));};exports[_0x23e2('0x61')]=function(_0x4a0bba,_0x130820){var _0x19942e=_0x4a0bba['body'];return db[_0x23e2('0x44')]['find']({'where':{'id':_0x4a0bba[_0x23e2('0x4f')]['id']}})['then'](handleEntityNotFound(_0x130820,null))[_0x23e2('0x29')](function(_0x43daff){if(_0x43daff){return db[_0x23e2('0x55')][_0x23e2('0x56')](function(_0x18a318){return db[_0x23e2('0x57')][_0x23e2('0x5f')]({'where':{'userProfileId':_0x4a0bba[_0x23e2('0x4f')]['id'],'sectionId':_[_0x23e2('0x2f')](_0x19942e,function(_0x5c5511){return _0x5c5511[_0x23e2('0x5c')];})},'transaction':_0x18a318})[_0x23e2('0x29')](function(){var _0x34c201=_['map'](_0x19942e,function(_0x2dc048){_0x2dc048[_0x23e2('0x5d')]=_0x4a0bba[_0x23e2('0x4f')]['id'];return _0x2dc048;});var _0x114b75=[];return BPromise[_0x23e2('0x58')](_0x34c201,function(_0x2aa7c3){return db[_0x23e2('0x57')]['create'](_0x2aa7c3,{'include':[{'model':db[_0x23e2('0x5a')],'as':_0x23e2('0x5e')}],'raw':!![],'transaction':_0x18a318})['then'](function(_0x64d3f3){_0x114b75[_0x23e2('0x62')](_0x64d3f3[_0x23e2('0x50')]({'plain':!![]}));});})[_0x23e2('0x29')](function(){return _0x114b75;});});});}})[_0x23e2('0x29')](function(_0x296731){return _0x296731;})[_0x23e2('0x29')](respondWithResult(_0x130820,null))['catch'](handleError(_0x130820,null));};exports[_0x23e2('0x63')]=function(_0x12e7e3,_0x325f2e){var _0x36f596;return db[_0x23e2('0x44')][_0x23e2('0x4b')]({'where':{'id':_0x12e7e3[_0x23e2('0x4f')]['id']},'attributes':['id',_0x23e2('0x2c')]})[_0x23e2('0x29')](handleEntityNotFound(_0x325f2e,null))[_0x23e2('0x29')](function(_0x360b45){if(_0x360b45){_0x36f596=_0x360b45;return db[_0x23e2('0x57')][_0x23e2('0x5f')]({'where':{'userProfileId':_0x12e7e3[_0x23e2('0x4f')]['id'],'sectionId':_0x12e7e3[_0x23e2('0x34')]['ids']}});}})['then'](function(){return _0x36f596;})[_0x23e2('0x29')](respondWithStatusCode(_0x325f2e,null))['catch'](handleError(_0x325f2e,null));};exports[_0x23e2('0x64')]=function(_0x20fe07,_0x2b1eb4){var _0x399e64=[];var _0x5f5860=[];return db[_0x23e2('0x57')][_0x23e2('0x5b')]({'where':{'userProfileId':_0x20fe07['params']['id']},'raw':!![]})[_0x23e2('0x29')](function(_0x73403d){_0x399e64=_[_0x23e2('0x40')](_0x73403d,function(_0xf28460){return _0xf28460['enabled']===0x1||_[_0x23e2('0x65')]([0x3eb,0x709],_0xf28460[_0x23e2('0x5c')]);});if(!_[_0x23e2('0x66')](_0x399e64)){return _[_0x23e2('0x2f')](_0x399e64,function(_0x32119f){return _0x32119f[_0x23e2('0x5c')];});}else{return;}})[_0x23e2('0x29')](function(_0x1df2a9){if(_0x1df2a9)_0x5f5860=_0x1df2a9;if(_[_0x23e2('0x65')](_0x5f5860,0x64)){var _0x26a713=_[_0x23e2('0x4b')](_0x399e64,{'sectionId':0x64});return hasDefaultDashboard(_0x26a713)[_0x23e2('0x29')](function(_0x20f7b6){return _[_0x23e2('0x2f')](_0x399e64,function(_0x169999){if(_0x169999[_0x23e2('0x5c')]===0x64){_0x169999['subsections']=_0x20f7b6;}return _0x169999;});});}else{return;}})['then'](function(_0xbae002){if(_0xbae002)_0x399e64=_0xbae002;if(_[_0x23e2('0x65')](_0x5f5860,0x3eb)){var _0x415569=_['find'](_0x399e64,{'sectionId':0x3eb});return getCustomDashboards(_0x415569)['then'](function(_0x287fb0){return _[_0x23e2('0x2f')](_0x399e64,function(_0x22edc9){if(_0x415569[_0x23e2('0x67')]){if(_0x22edc9['sectionId']===0x3eb){_0x22edc9[_0x23e2('0x68')]=_0x287fb0;}}else{if(_0x22edc9[_0x23e2('0x5c')]===0x64){_0x22edc9[_0x23e2('0x68')]=_0x287fb0;}}return _0x22edc9;});});}else{return;}})[_0x23e2('0x29')](function(_0x1d11e3){if(_0x1d11e3)_0x399e64=_0x1d11e3;if(_[_0x23e2('0x65')](_0x5f5860,0x709)){var _0x25db15=_[_0x23e2('0x4b')](_0x399e64,{'sectionId':0x709});return getPlugins(_0x25db15)[_0x23e2('0x29')](function(_0x420a17){if(_0x25db15['enabled']){return _['map'](_0x399e64,function(_0x343c5e){if(_0x343c5e[_0x23e2('0x5c')]===0x709){_0x343c5e[_0x23e2('0x68')]=_0x420a17;}return _0x343c5e;});}else{var _0x409701={'sectionId':0x76c,'enabled':0x1,'subsections':_0x420a17};var _0x406188=_[_0x23e2('0x2f')](_0x399e64);_0x406188[_0x23e2('0x62')](_0x409701);return _0x406188;}});}else{return;}})[_0x23e2('0x29')](function(_0x2536ad){if(_0x2536ad)_0x399e64=_0x2536ad;return _[_0x23e2('0x40')](_0x399e64,['enabled',0x1]);})[_0x23e2('0x29')](respondWithResult(_0x2b1eb4,null))[_0x23e2('0x48')](handleError(_0x2b1eb4,null));};function hasDefaultDashboard(_0x57834d){var _0x7a8876=[0x65];return new BPromise(function(_0x18644f,_0x49b09a){try{if(_0x57834d[_0x23e2('0x59')]){_0x18644f(_0x7a8876);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x57834d['id']},'raw':!![]})[_0x23e2('0x29')](function(_0x21ce82){_0x21ce82?_0x18644f(_0x7a8876):_0x18644f();});}}catch(_0x498e0b){_0x49b09a(_0x498e0b);}});}function getCustomDashboards(_0x5caefb){var _0x4eaec2=[];return new BPromise(function(_0x31db2c,_0x314114){try{if(_0x5caefb[_0x23e2('0x59')]){return db['Dashboard'][_0x23e2('0x5b')]({'raw':!![]})[_0x23e2('0x29')](function(_0x14e810){_0x14e810[_0x23e2('0x69')](function(_0xa378af){_0x4eaec2[_0x23e2('0x62')](_0xa378af['id']+0x1869f);});_0x31db2c(_0x4eaec2);});}else{return db[_0x23e2('0x5a')]['findAll']({'where':{'sectionId':_0x5caefb['id']},'raw':!![]})[_0x23e2('0x29')](function(_0x592207){_0x592207['forEach'](function(_0x400e95){_0x4eaec2['push'](_0x400e95[_0x23e2('0x6a')]+0x1869f);});_0x31db2c(_0x4eaec2);});}}catch(_0x5109cc){_0x314114(_0x5109cc);}});}function getPlugins(_0x3f1f7d){var _0x233269=[];return new BPromise(function(_0x3fa5a1,_0x256af4){try{if(_0x3f1f7d['autoAssociation']){return db[_0x23e2('0x6b')][_0x23e2('0x5b')]({'raw':!![]})[_0x23e2('0x29')](function(_0x10c066){_0x10c066['forEach'](function(_0x5ce3f4){_0x233269['push'](_0x5ce3f4['id']+0x15b38);});_0x3fa5a1(_0x233269);});}else{return db[_0x23e2('0x5a')][_0x23e2('0x5b')]({'where':{'sectionId':_0x3f1f7d['id']},'raw':!![]})[_0x23e2('0x29')](function(_0x26fd72){_0x26fd72[_0x23e2('0x69')](function(_0x5720fe){_0x233269[_0x23e2('0x62')](_0x5720fe[_0x23e2('0x6a')]+0x15b38);});_0x3fa5a1(_0x233269);});}}catch(_0x4c5e89){_0x256af4(_0x4c5e89);}});}exports[_0x23e2('0x6c')]=function(_0x397de0,_0x1c56be){return db[_0x23e2('0x44')]['find']({'where':{'id':_0x397de0[_0x23e2('0x4f')]['id']}})[_0x23e2('0x29')](handleEntityNotFound(_0x1c56be,null))[_0x23e2('0x29')](function(_0x5ab04b){if(_0x5ab04b){return db[_0x23e2('0x55')][_0x23e2('0x56')](function(_0x4a4908){return db[_0x23e2('0x57')]['findAll']({'where':{'userProfileId':_0x397de0[_0x23e2('0x4f')]['id']},'attributes':['id'],'raw':!![]})[_0x23e2('0x29')](function(_0x1e28b0){if(_0x1e28b0){return db['UserProfileSection'][_0x23e2('0x5f')]({'where':{'userProfileId':_0x397de0[_0x23e2('0x4f')]['id'],'id':_[_0x23e2('0x2f')](_0x1e28b0,function(_0x19c004){return _0x19c004['id'];})},'transaction':_0x4a4908});}})[_0x23e2('0x29')](function(_0x10f45d){var _0x4bd116=_[_0x23e2('0x2f')](_0x397de0['body'],function(_0x10677a){_0x10677a[_0x23e2('0x5d')]=_0x397de0[_0x23e2('0x4f')]['id'];return _0x10677a;});return db[_0x23e2('0x57')][_0x23e2('0x6d')](_0x4bd116,{'raw':!![],'transaction':_0x4a4908});})[_0x23e2('0x29')](function(_0xcfad8b){var _0x5cd310=_[_0x23e2('0x40')](_['map'](_0xcfad8b,function(_0x5f0659){return _0x5f0659['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5cd310){return db[_0x23e2('0x57')]['findAll']({'where':{'userProfileId':_0x397de0['params']['id'],'sectionId':_[_0x23e2('0x2f')](_0x5cd310,function(_0x5693ff){return _0x5693ff[_0x23e2('0x5c')];})},'attributes':['id',_0x23e2('0x5c')],'raw':!![]})['then'](function(_0x26b9c5){var _0x27205d=_[_0x23e2('0x2f')](_0x397de0['body'],function(_0xbeca91){_0xbeca91[_0x23e2('0x5d')]=_0x397de0['params']['id'];return _0xbeca91;});return db[_0x23e2('0x5a')]['bulkCreate'](_0x27205d,{'raw':!![],'transaction':_0x4a4908});});}})['catch'](handleError(_0x1c56be,null));});}})['then'](function(_0x32b659){var _0x5a0dbf=_['map'](_0x32b659,function(_0x3ea1eb){return _0x3ea1eb['get']({'plain':!![]});});})[_0x23e2('0x29')](respondWithResult(_0x1c56be,null))['catch'](handleError(_0x1c56be,null));};exports[_0x23e2('0x6e')]=function(_0x49e2ea,_0x48077d,_0x2c0cff){return db[_0x23e2('0x44')][_0x23e2('0x4b')]({'where':{'id':_0x49e2ea['params']['id']}})[_0x23e2('0x29')](handleEntityNotFound(_0x48077d,null))[_0x23e2('0x29')](function(_0x49fff2){if(_0x49fff2){return _0x49fff2[_0x23e2('0x6e')](_0x49e2ea[_0x23e2('0x34')][_0x23e2('0x6f')]);}})[_0x23e2('0x29')](respondWithStatusCode(_0x48077d,null))[_0x23e2('0x48')](handleError(_0x48077d,null));};exports['getResources']=function(_0x3cf4ce,_0x45f290){var _0x50d056={};if(!_0x3cf4ce['query'][_0x23e2('0x70')])throw new Error(_0x23e2('0x71'));if(!_0x3cf4ce[_0x23e2('0x34')][_0x23e2('0x3b')](_0x23e2('0x3c'))){_0x50d056[_0x23e2('0x25')]=qs['limit'](_0x3cf4ce[_0x23e2('0x34')][_0x23e2('0x25')]);_0x50d056[_0x23e2('0x22')]=qs[_0x23e2('0x22')](_0x3cf4ce['query']['offset']);}return db[_0x23e2('0x44')][_0x23e2('0x4b')]({'where':{'id':_0x3cf4ce[_0x23e2('0x4f')]['id']}})[_0x23e2('0x29')](function(_0x5e168a){if(!_0x5e168a)throw new Error(_0x23e2('0x72')+_0x3cf4ce['params']['id']);return db[_0x23e2('0x44')][_0x23e2('0x73')](_0x3cf4ce);})[_0x23e2('0x29')](respondWithFilteredResult(_0x45f290,_0x50d056))['catch'](handleError(_0x45f290,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 3cad948..84da7d6 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 _0x3d3d=['emit','hasOwnProperty','exports','../../mysqldb','UserProfile','save','update','remove'];(function(_0x2cb0e6,_0x386bfc){var _0x4665df=function(_0x358531){while(--_0x358531){_0x2cb0e6['push'](_0x2cb0e6['shift']());}};_0x4665df(++_0x386bfc);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xd3d3('0x0'))['db'][_0xd3d3('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3d3('0x2'),'afterUpdate':_0xd3d3('0x3'),'afterDestroy':_0xd3d3('0x4')};function emitEvent(_0x427bd5){return function(_0x1f03e9,_0x46aa0c,_0x3b43f2){UserProfileEvents[_0xd3d3('0x5')](_0x427bd5+':'+_0x1f03e9['id'],_0x1f03e9);UserProfileEvents[_0xd3d3('0x5')](_0x427bd5,_0x1f03e9);_0x3b43f2(null);};}for(var e in events){if(events[_0xd3d3('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xd3d3('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xdbb1=['exports','events','save','hasOwnProperty','hook'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xdbb1,0x105));var _0x1dbb=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xdbb1[_0x59c301];return _0x3866b9;};'use strict';var EventEmitter=require(_0x1dbb('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1dbb('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x395788){return function(_0x483e15,_0xa1e321,_0xd53e45){UserProfileEvents['emit'](_0x395788+':'+_0x483e15['id'],_0x483e15);UserProfileEvents['emit'](_0x395788,_0x483e15);_0xd53e45(null);};}for(var e in events){if(events[_0x1dbb('0x2')](e)){var event=events[e];UserProfile[_0x1dbb('0x3')](e,emitEvent(event));}}module[_0x1dbb('0x4')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 9764303..ba755c5 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 _0x4bd3=['key','foreignKey','where','forEach','options','includeAll','include','custom','CustomReports','count','rows','color','ThroughTags','tag','openTabs','true','chat','dataValues','sms','fax','mail','all','lodash','../../components/parsers/qs','squel','models','filter','value','findAll','then','associatedResources','catch','field','model','resolve','UserProfileResource','map','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','CmCompany','globalcustomfields','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','User','role','agent','Telephones','name','telephone','VoiceQueues','VoiceQueue','QueueCampaigns','queue','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','voicequeues','users','agents','telephones','admin','user','ZendeskAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','Dashboard','Pause','sounds','tags','Tag','templates','Template','Trigger','trunks','variables','Variable','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','section','mergeResources','isEmpty','UserProfileSection','find','params','ignore','union','length','push','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge'];(function(_0x32552b,_0x376a0e){var _0x540754=function(_0x399831){while(--_0x399831){_0x32552b['push'](_0x32552b['shift']());}};_0x540754(++_0x376a0e);}(_0x4bd3,0x174));var _0x34bd=function(_0x1f0649,_0x1999f1){_0x1f0649=_0x1f0649-0x0;var _0x564d9d=_0x4bd3[_0x1f0649];return _0x564d9d;};'use strict';var _=require(_0x34bd('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x34bd('0x1'));var squel=require(_0x34bd('0x2'));module['exports']=function(_0x4997bc){var _0x4cad21=_0x4997bc[_0x34bd('0x3')];function _0x44854a(_0x1fc8eb,_0x5846f3){return new Promise(function(_0x2133c5,_0x2a15a2){if(!_0x5846f3)return _0x2133c5(null);var _0x5c2a7a=_0x5846f3[_0x34bd('0x4')]?{[_0x5846f3[_0x34bd('0x4')]['field']]:_0x5846f3[_0x34bd('0x4')][_0x34bd('0x5')]}:undefined;return _0x4cad21[_0x1fc8eb][_0x34bd('0x6')]({'where':_0x5c2a7a,'raw':!![]})[_0x34bd('0x7')](function(_0x1ac77f){_0x5846f3[_0x34bd('0x8')]=_['map'](_0x1ac77f,'id');_0x2133c5(_0x5846f3);})[_0x34bd('0x9')](function(_0x45322f){_0x2a15a2(_0x45322f);});});}function _0x282ea6(_0x7c7992,_0x501b7f){return new Promise(function(_0x4a8622,_0x3da7a0){var _0x5e4ce7=_0x7c7992['filter']?{[_0x7c7992[_0x34bd('0x4')][_0x34bd('0xa')]]:_0x7c7992[_0x34bd('0x4')][_0x34bd('0x5')]}:undefined;return _0x4cad21[_0x7c7992[_0x34bd('0xb')]][_0x34bd('0x6')]({'where':_0x5e4ce7,'raw':!![]})[_0x34bd('0x7')](function(_0x236f6b){_0x501b7f[_0x34bd('0x8')]=_['map'](_0x236f6b,function(_0x3fa6a8){return _0x3fa6a8['name'];});_0x4a8622(_0x501b7f);})['catch'](function(_0x6638ed){_0x3da7a0(_0x6638ed);});});}function _0x30b3f2(_0x280c1a,_0x2dc917,_0x34b91b){if(!_0x2dc917)return Promise[_0x34bd('0xc')](null);return new Promise(function(_0xd39d72,_0x1c12e8){return _0x4cad21[_0x34bd('0xd')][_0x34bd('0x6')]({'where':{'sectionId':_0x2dc917['id']},'raw':!![]})[_0x34bd('0x7')](function(_0x48d2ba){if(_0x280c1a[_0x34bd('0xa')]&&_0x280c1a[_0x34bd('0xa')]!=='id'){_0x2dc917[_0x34bd('0x8')]=_[_0x34bd('0xe')](_0x48d2ba,function(_0x3976e4){return _0x3976e4[_0x280c1a[_0x34bd('0xa')]];});}else{if(_0x34b91b===_0x34bd('0xf')){_0x2dc917[_0x34bd('0x8')]=_[_0x34bd('0xe')](_0x48d2ba,function(_0x55538e){return{'id':_0x55538e[_0x34bd('0x10')],'type':_0x55538e[_0x34bd('0x11')]};});}else{_0x2dc917[_0x34bd('0x8')]=_[_0x34bd('0xe')](_0x48d2ba,function(_0x463224){return _0x463224['resourceId'];});}}_0xd39d72(_0x2dc917);})['catch'](function(_0x5da62a){_0x1c12e8(_0x5da62a);});});}function _0x4edf84(_0x3dafe8,_0x503a60){var _0x10fc4b={'parentSections':[]};switch(_0x3dafe8[_0x34bd('0x12')]()){case _0x34bd('0x13'):_0x10fc4b['childModel']=_0x34bd('0x14');break;case _0x34bd('0x15'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x17');break;case'squarerecordings':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x18');_0x10fc4b[_0x34bd('0x19')]=[{'name':_0x34bd('0x1a'),'field':'name','foreignKey':_0x34bd('0x1b')}];break;case _0x34bd('0x1c'):_0x10fc4b['childModel']=_0x34bd('0x1d');break;case _0x34bd('0x1e'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x1f');_0x10fc4b[_0x34bd('0x19')]=[{'name':_0x34bd('0x20'),'field':'id','foreignKey':_0x34bd('0x21')}];break;case'lists':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x22');break;case'companies':_0x10fc4b['childModel']=_0x34bd('0x23');break;case _0x34bd('0x24'):_0x10fc4b[_0x34bd('0x16')]='CmCustomField';break;case'chatqueues':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x25');break;case _0x34bd('0x26'):_0x10fc4b[_0x34bd('0x16')]='ChatWebsite';break;case _0x34bd('0x27'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x28');break;case _0x34bd('0x29'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x2a');break;case'inboundroutes':case _0x34bd('0x2b'):case'outboundroutes':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x2c');break;case _0x34bd('0x2d'):_0x10fc4b['childModel']=_0x34bd('0x2e');break;case _0x34bd('0x2f'):_0x10fc4b['childModel']=_0x34bd('0x30');break;case _0x34bd('0x31'):_0x10fc4b[_0x34bd('0x16')]='VoiceRecording';_0x10fc4b[_0x34bd('0x19')]=[{'name':_0x34bd('0x32'),'field':'name','foreignKey':_0x34bd('0x33'),'model':_0x34bd('0x34'),'filter':{'field':_0x34bd('0x35'),'value':[_0x34bd('0x36')]}},{'name':_0x34bd('0x37'),'field':_0x34bd('0x38'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0x34bd('0x39')]}},{'name':_0x34bd('0x3a'),'field':'name','foreignKey':'queue','model':_0x34bd('0x3b'),'filter':{'field':'type','value':['inbound']}},{'name':_0x34bd('0x3c'),'field':_0x34bd('0x38'),'foreignKey':_0x34bd('0x3d'),'model':_0x34bd('0x3b'),'filter':{'field':_0x34bd('0x11'),'value':['outbound']}}];break;case'musiconholds':_0x10fc4b[_0x34bd('0x16')]='VoiceMusicOnHold';break;case _0x34bd('0x3e'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x3f');break;case _0x34bd('0x40'):_0x10fc4b[_0x34bd('0x16')]='VoicePrefix';break;case _0x34bd('0x41'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x42');break;case _0x34bd('0x43'):_0x10fc4b['childModel']=_0x34bd('0x44');break;case'mailaccounts':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x45');break;case'mailsubstatuses':_0x10fc4b[_0x34bd('0x16')]='MailSubstatus';break;case _0x34bd('0x46'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x47');break;case _0x34bd('0x48'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x49');break;case _0x34bd('0x4a'):_0x10fc4b['childModel']='SmsQueue';break;case'smsaccounts':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x4b');break;case _0x34bd('0x4c'):_0x10fc4b[_0x34bd('0x16')]='WhatsappQueue';break;case _0x34bd('0x4d'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x4e');break;case _0x34bd('0x4f'):_0x10fc4b[_0x34bd('0x16')]='Team';break;case _0x34bd('0x50'):case'queuecampaigns':_0x10fc4b['childModel']=_0x34bd('0x3b');if(_0x503a60){_0x10fc4b['parentSections']=[{'name':_0x34bd('0x3a')},{'name':_0x34bd('0x3c')}];}break;case _0x34bd('0x51'):case _0x34bd('0x52'):case _0x34bd('0x53'):_0x10fc4b['childModel']='User';if(_0x503a60){_0x10fc4b[_0x34bd('0x19')]=[{'name':'Users','filter':{'field':_0x34bd('0x35'),'value':[_0x34bd('0x54'),_0x34bd('0x55')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x10fc4b['childModel']=_0x34bd('0x56');break;case'salesforceaccounts':_0x10fc4b[_0x34bd('0x16')]='SalesforceAccount';break;case _0x34bd('0x57'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x58');break;case _0x34bd('0x59'):_0x10fc4b[_0x34bd('0x16')]='SugarcrmAccount';break;case _0x34bd('0x5a'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x5b');break;case _0x34bd('0x5c'):_0x10fc4b[_0x34bd('0x16')]='ZohoAccount';break;case _0x34bd('0x5d'):_0x10fc4b[_0x34bd('0x16')]='User';break;case _0x34bd('0x5e'):_0x10fc4b[_0x34bd('0x16')]='CannedAnswer';break;case'dispositions':_0x10fc4b[_0x34bd('0x16')]='Disposition';break;case'customdashboards':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x5f');break;case'intervals':_0x10fc4b['childModel']='Interval';break;case'pauses':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x60');break;case'scheduler':_0x10fc4b['childModel']='Schedule';break;case _0x34bd('0x61'):_0x10fc4b[_0x34bd('0x16')]='Sound';break;case _0x34bd('0x62'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x63');break;case _0x34bd('0x64'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x65');break;case'triggers':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x66');break;case _0x34bd('0x67'):_0x10fc4b[_0x34bd('0x16')]='Trunk';break;case _0x34bd('0x68'):_0x10fc4b['childModel']=_0x34bd('0x69');break;case'plugins':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x6a');break;case _0x34bd('0x6b'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0xf');_0x10fc4b[_0x34bd('0x19')]=[{'name':_0x34bd('0x6c'),'field':'id','foreignKey':_0x34bd('0x6d')}];break;case _0x34bd('0x6e'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x6f');break;}return _0x10fc4b;}function _0x5ddb03(_0x2e232f,_0x55f72e){var _0x15fea7=_0x2e232f['charAt'](0x0)[_0x34bd('0x70')]()+_0x2e232f['slice'](0x1);var _0x1d85d0={'type':_0x4cad21[_0x34bd('0x71')][_0x34bd('0x72')][_0x34bd('0x73')],'raw':!![]};return new Promise(function(_0x3ebbf2,_0x34dbcc){var _0x109fce=squel[_0x34bd('0x74')]()[_0x34bd('0xa')](_0x34bd('0x75')+_0x15fea7+_0x34bd('0x76'),'id')[_0x34bd('0xa')](_0x34bd('0x77'))[_0x34bd('0x78')](_0x34bd('0x79')+_0x2e232f+'_interactions','ui')['where'](_0x34bd('0x7a'),_0x55f72e['id']);return _0x4cad21[_0x34bd('0x7b')][_0x34bd('0x7c')](_0x109fce[_0x34bd('0x7d')](),_0x1d85d0)[_0x34bd('0x7')](function(_0x5d4833){_0x55f72e[_0x15fea7+'OpenTabs']=_0x5d4833;_0x3ebbf2(_0x5d4833);})['catch'](function(_0x49f095){_0x34dbcc(_0x49f095);});});}return _0x4997bc[_0x34bd('0x7e')](_0x34bd('0x7f'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x163935){var _0xfa0814={'raw':![],'where':{}};var _0x13db71={};var _0x583590={'count':0x0,'rows':[]};var _0x40b148=_0x163935[_0x34bd('0x7c')][_0x34bd('0x80')];var _0x344be3=_0x163935[_0x34bd('0x7c')][_0x34bd('0x81')]||![];var _0x310bac=_0x4edf84(_0x40b148,_0x344be3);if(!_0x310bac[_0x34bd('0x16')])throw new Error('Invalid\x20section\x20\x27'+_0x40b148+'\x27');var _0x5e239f=[{'name':_0x40b148}];if(!_[_0x34bd('0x82')](_0x310bac['parentSections']))_0x5e239f=_0x310bac[_0x34bd('0x19')];var _0x4762d9=[];for(var _0x2ae5e4=0x0;_0x2ae5e4<_0x5e239f['length'];_0x2ae5e4++){_0x4762d9['push'](_0x4cad21[_0x34bd('0x83')][_0x34bd('0x84')]({'where':{'userProfileId':_0x163935[_0x34bd('0x85')]['id'],'name':_0x5e239f[_0x2ae5e4]['name']},'raw':!![]}));}return Promise['all'](_0x4762d9)[_0x34bd('0x7')](function(_0x8d929e){var _0x32c61f=_[_0x34bd('0x4')](_0x8d929e,function(_0x29b588){return _0x29b588?_0x29b588:undefined;});var _0x34c9bc=_[_0x34bd('0x4')](_0x5e239f,[_0x34bd('0x86'),!![]]);var _0x31bedd=_['isEmpty'](_0x32c61f)&&_['isEmpty'](_0x34c9bc)?null:_[_0x34bd('0x87')](_0x34c9bc,_0x32c61f);if(!_0x31bedd)return null;var _0x4fab21=[];for(var _0x2b9bc3=0x0;_0x2b9bc3<_0x31bedd[_0x34bd('0x88')];_0x2b9bc3++){var _0x1639de=_[_0x34bd('0x84')](_0x5e239f,function(_0x4a5e55){return _0x31bedd[_0x2b9bc3]?_0x4a5e55['name']===_0x31bedd[_0x2b9bc3][_0x34bd('0x38')]:null;});if(_0x1639de){if(_0x31bedd[_0x2b9bc3][_0x34bd('0x86')]){_0x4fab21[_0x34bd('0x89')](_0x44854a(_0x310bac['childModel'],_0x31bedd[_0x2b9bc3]));}else{if(!_0x31bedd[_0x2b9bc3][_0x34bd('0x8a')]){_0x4fab21['push'](_0x30b3f2(_0x1639de,_0x31bedd[_0x2b9bc3],_0x310bac[_0x34bd('0x16')]));}else{if(_0x1639de[_0x34bd('0xb')]){_0x4fab21[_0x34bd('0x89')](_0x282ea6(_0x1639de,_0x31bedd[_0x2b9bc3]));}}}}}return Promise['all'](_0x4fab21);})[_0x34bd('0x7')](function(_0x5c6898){var _0x5d96b9=_0x5c6898;var _0x3cf4c3=null;if(_0x5d96b9){_0x3cf4c3=_0x5d96b9[_0x34bd('0x88')]===0x1?_0x5d96b9[0x0]:null;}if(!_0x3cf4c3&&!_0x5d96b9)return _0x583590;var _0x29a259=_0x4cad21[_0x310bac['childModel']][_0x34bd('0x8b')];_0x13db71[_0x34bd('0xb')]=_[_0x34bd('0x8c')](_0x29a259);_0x13db71['query']=_[_0x34bd('0x8c')](_0x163935[_0x34bd('0x7c')]);_0x13db71[_0x34bd('0x8d')]=_[_0x34bd('0x8e')](_0x13db71[_0x34bd('0xb')],_0x13db71[_0x34bd('0x7c')]);_0xfa0814[_0x34bd('0x8f')]=_[_0x34bd('0x8e')](_0x13db71[_0x34bd('0xb')],qs[_0x34bd('0x90')](_0x163935[_0x34bd('0x7c')]['fields']));_0xfa0814[_0x34bd('0x8f')]=_0xfa0814['attributes'][_0x34bd('0x88')]?_0xfa0814['attributes']:_0x13db71[_0x34bd('0xb')];if(!_0x163935[_0x34bd('0x7c')][_0x34bd('0x91')](_0x34bd('0x92'))){_0xfa0814[_0x34bd('0x93')]=qs[_0x34bd('0x93')](_0x163935[_0x34bd('0x7c')][_0x34bd('0x93')]);_0xfa0814[_0x34bd('0x94')]=qs[_0x34bd('0x94')](_0x163935['query']['offset']);}_0xfa0814[_0x34bd('0x95')]=qs[_0x34bd('0x96')](_0x163935[_0x34bd('0x7c')]['sort']);_0xfa0814['where']=qs['filters'](_[_0x34bd('0x97')](_0x163935[_0x34bd('0x7c')],_0x13db71[_0x34bd('0x8d')]));if(_0x163935[_0x34bd('0x7c')][_0x34bd('0x4')]){_0xfa0814['where']=_[_0x34bd('0x98')](_0xfa0814['where'],{'$or':_[_0x34bd('0xe')](_0x29a259,function(_0x34b7ea){if(_0x34b7ea['type'][_0x34bd('0x99')]!=='VIRTUAL'){var _0x242093={};_0x242093[_0x34b7ea['field']]={'$like':'%'+_0x163935[_0x34bd('0x7c')]['filter']+'%'};return _0x242093;}})});}var _0x397396=[];var _0x38f6f2=null;var _0x3506da={};if(_0x3cf4c3){_0x38f6f2=_[_0x34bd('0x84')](_0x5e239f,[_0x34bd('0x38'),_0x3cf4c3[_0x34bd('0x38')]]);if(_0x38f6f2[_0x34bd('0xa')]){_0x3506da={};if(_0x310bac[_0x34bd('0x16')]==='AnalyticExtractedReport'){_0x3506da[_0x38f6f2[_0x34bd('0x9a')]]=_[_0x34bd('0xe')](_0x3cf4c3[_0x34bd('0x8')],'id');}else{_0x3506da[_0x38f6f2['foreignKey']]=_0x3cf4c3['associatedResources'];}_0x397396['push'](_0x3506da);}else{_0xfa0814[_0x34bd('0x9b')]['id']=_0x3cf4c3[_0x34bd('0x8')];}}else{for(var _0x56935e=0x0;_0x56935e<_0x5d96b9[_0x34bd('0x88')];_0x56935e++){_0x38f6f2=_['find'](_0x5e239f,[_0x34bd('0x38'),_0x5d96b9[_0x56935e][_0x34bd('0x38')]]);if(_0x38f6f2[_0x34bd('0xa')]){_0x3506da={};_0x3506da[_0x38f6f2['foreignKey']]=_0x5d96b9[_0x56935e][_0x34bd('0x8')];_0x397396['push'](_0x3506da);}else{if(!_0xfa0814[_0x34bd('0x9b')]['id'])_0xfa0814[_0x34bd('0x9b')]['id']=[];_0x5d96b9[_0x56935e][_0x34bd('0x8')][_0x34bd('0x9c')](function(_0x1fe8cc){_0xfa0814[_0x34bd('0x9b')]['id'][_0x34bd('0x89')](_0x1fe8cc);});}}}if(!_[_0x34bd('0x82')](_0x397396)){_0xfa0814[_0x34bd('0x9b')]=_[_0x34bd('0x98')](_0xfa0814[_0x34bd('0x9b')],{'$and':{'$or':_0x397396}});}_0xfa0814=_[_0x34bd('0x98')]({},_0xfa0814,_0x163935[_0x34bd('0x9d')]);if(_0x3cf4c3&&!_0x3cf4c3[_0x34bd('0x8a')]&&_0x310bac['childModel']===_0x34bd('0xf')){if(_0x163935[_0x34bd('0x7c')][_0x34bd('0x9e')]){_0xfa0814[_0x34bd('0x9f')]=[{'all':!![]}];}return _0x4cad21[_0x310bac[_0x34bd('0x16')]]['findAll'](_0xfa0814)[_0x34bd('0x7')](function(_0x1d4259){var _0x14b45a=[];_0x1d4259[_0x34bd('0x9c')](function(_0x59708f){var _0x2b838a;switch(_0x59708f['reportType']){case'default':_0x2b838a=_['find'](_0x3cf4c3['associatedResources'],function(_0x325f8a){return _0x325f8a['id']===_0x59708f[_0x34bd('0x6d')]&&_0x325f8a[_0x34bd('0x11')]==='DefaultReports';});break;case _0x34bd('0xa0'):_0x2b838a=_[_0x34bd('0x84')](_0x3cf4c3[_0x34bd('0x8')],function(_0x2b27c7){return _0x2b27c7['id']===_0x59708f[_0x34bd('0x6d')]&&_0x2b27c7[_0x34bd('0x11')]===_0x34bd('0xa1');});break;}if(_0x2b838a)_0x14b45a[_0x34bd('0x89')](_0x59708f);});_0x583590[_0x34bd('0xa2')]=_0x14b45a[_0x34bd('0x88')];_0x583590[_0x34bd('0xa3')]=_0x14b45a;return _0x583590;});}else{return _0x4cad21[_0x310bac['childModel']]['count']({'where':_0xfa0814[_0x34bd('0x9b')]})['then'](function(_0xbe3d9c){_0x583590[_0x34bd('0xa2')]=_0xbe3d9c;if(_0x163935[_0x34bd('0x7c')][_0x34bd('0x9e')]){if(_0x310bac[_0x34bd('0x16')]===_0x34bd('0x1f')){_0xfa0814[_0x34bd('0x9f')]=[{'model':_0x4cad21[_0x34bd('0x63')],'as':'Tags','attributes':['id',_0x34bd('0x38'),_0x34bd('0xa4')],'required':_0x163935[_0x34bd('0x7c')]['tag']?!![]:![]},{'model':_0x4cad21[_0x34bd('0x63')],'as':_0x34bd('0xa5'),'attributes':['id',_0x34bd('0x38'),_0x34bd('0xa4')],'through':_0x163935['query'][_0x34bd('0xa6')]?{'attributes':[],'where':{'TagId':_0x163935[_0x34bd('0x7c')][_0x34bd('0xa6')]||undefined}}:{},'required':_0x163935[_0x34bd('0x7c')][_0x34bd('0xa6')]?!![]:![]}];}else{_0xfa0814[_0x34bd('0x9f')]=[{'all':!![]}];}}return _0x4cad21[_0x310bac[_0x34bd('0x16')]][_0x34bd('0x6')](_0xfa0814);})[_0x34bd('0x7')](function(_0x3b95f6){_0x583590['rows']=_0x3b95f6;if(_0x40b148===_0x34bd('0x32')&&_0x163935[_0x34bd('0x7c')][_0x34bd('0xa7')]===_0x34bd('0xa8')){var _0x2f7caf=[];for(var _0x38752d=0x0;_0x38752d<_0x583590[_0x34bd('0xa3')][_0x34bd('0x88')];_0x38752d++){_0x2f7caf[_0x34bd('0x89')](_0x5ddb03(_0x34bd('0xa9'),_0x583590[_0x34bd('0xa3')][_0x38752d][_0x34bd('0xaa')]));_0x2f7caf[_0x34bd('0x89')](_0x5ddb03(_0x34bd('0xab'),_0x583590['rows'][_0x38752d][_0x34bd('0xaa')]));_0x2f7caf['push'](_0x5ddb03(_0x34bd('0xac'),_0x583590[_0x34bd('0xa3')][_0x38752d][_0x34bd('0xaa')]));_0x2f7caf[_0x34bd('0x89')](_0x5ddb03(_0x34bd('0xad'),_0x583590[_0x34bd('0xa3')][_0x38752d][_0x34bd('0xaa')]));_0x2f7caf[_0x34bd('0x89')](_0x5ddb03('openchannel',_0x583590[_0x34bd('0xa3')][_0x38752d][_0x34bd('0xaa')]));_0x2f7caf[_0x34bd('0x89')](_0x5ddb03('whatsapp',_0x583590[_0x34bd('0xa3')][_0x38752d][_0x34bd('0xaa')]));}return Promise[_0x34bd('0xae')](_0x2f7caf)[_0x34bd('0x7')](function(){return _0x583590;});}return _0x583590;});}});}}});}; \ No newline at end of file +var _0x1261=['FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','membername','User','agent','Telephones','role','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsAccount','whatsappqueues','WhatsappQueue','teams','Team','queuecampaigns','users','telephones','Users','admin','Agents','ZendeskAccount','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','isEmpty','length','push','UserProfileSection','params','all','ignore','find','autoAssociation','rawAttributes','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','forEach','reportType','default','custom','count','Tags','tag','ThroughTags','color','rows','true','chat','dataValues','sms','fax','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','AnalyticExtractedReport','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','JscriptyProject','CmContact','Lists','lists','CmList','CmCustomField','chatqueues','chatwebsites','faxqueues'];(function(_0x4da00b,_0x48100d){var _0x13f0e3=function(_0x46d3d0){while(--_0x46d3d0){_0x4da00b['push'](_0x4da00b['shift']());}};_0x13f0e3(++_0x48100d);}(_0x1261,0x144));var _0x1126=function(_0xdb6398,_0x2d07b3){_0xdb6398=_0xdb6398-0x0;var _0x5dd76b=_0x1261[_0xdb6398];return _0x5dd76b;};'use strict';var _=require('lodash');var attributes=require(_0x1126('0x0'));var qs=require(_0x1126('0x1'));var squel=require(_0x1126('0x2'));module[_0x1126('0x3')]=function(_0x39b786){var _0x350f3a=_0x39b786[_0x1126('0x4')];function _0x4245ca(_0x21a480,_0x75a851){return new Promise(function(_0x5a2189,_0x5c68c8){if(!_0x75a851)return _0x5a2189(null);var _0x40ba58=_0x75a851[_0x1126('0x5')]?{[_0x75a851['filter'][_0x1126('0x6')]]:_0x75a851[_0x1126('0x5')][_0x1126('0x7')]}:undefined;return _0x350f3a[_0x21a480][_0x1126('0x8')]({'where':_0x40ba58,'raw':!![]})[_0x1126('0x9')](function(_0x59cfa1){_0x75a851[_0x1126('0xa')]=_[_0x1126('0xb')](_0x59cfa1,'id');_0x5a2189(_0x75a851);})[_0x1126('0xc')](function(_0x5e72e2){_0x5c68c8(_0x5e72e2);});});}function _0x34571c(_0x5d581b,_0x52ef15){return new Promise(function(_0x15c071,_0x561b93){var _0x15e89b=_0x5d581b[_0x1126('0x5')]?{[_0x5d581b[_0x1126('0x5')][_0x1126('0x6')]]:_0x5d581b[_0x1126('0x5')][_0x1126('0x7')]}:undefined;return _0x350f3a[_0x5d581b[_0x1126('0xd')]][_0x1126('0x8')]({'where':_0x15e89b,'raw':!![]})[_0x1126('0x9')](function(_0x53a8f0){_0x52ef15['associatedResources']=_[_0x1126('0xb')](_0x53a8f0,function(_0x154e20){return _0x154e20[_0x1126('0xe')];});_0x15c071(_0x52ef15);})['catch'](function(_0x45149c){_0x561b93(_0x45149c);});});}function _0x4794a7(_0x35fe9f,_0x42f379,_0x257b5f){if(!_0x42f379)return Promise['resolve'](null);return new Promise(function(_0x245cd7,_0x1695f6){return _0x350f3a['UserProfileResource']['findAll']({'where':{'sectionId':_0x42f379['id']},'raw':!![]})[_0x1126('0x9')](function(_0x2b2487){if(_0x35fe9f['field']&&_0x35fe9f['field']!=='id'){_0x42f379[_0x1126('0xa')]=_['map'](_0x2b2487,function(_0x22ed37){return _0x22ed37[_0x35fe9f[_0x1126('0x6')]];});}else{if(_0x257b5f===_0x1126('0xf')){_0x42f379['associatedResources']=_[_0x1126('0xb')](_0x2b2487,function(_0x49d209){return{'id':_0x49d209['resourceId'],'type':_0x49d209[_0x1126('0x10')]};});}else{_0x42f379[_0x1126('0xa')]=_[_0x1126('0xb')](_0x2b2487,function(_0x36d254){return _0x36d254['resourceId'];});}}_0x245cd7(_0x42f379);})[_0x1126('0xc')](function(_0x477e6a){_0x1695f6(_0x477e6a);});});}function _0x48a08d(_0x2175fa,_0x59cd8e){var _0x529dd9={'parentSections':[]};switch(_0x2175fa['toLowerCase']()){case _0x1126('0x11'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x13');break;case _0x1126('0x14'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x15');break;case _0x1126('0x16'):_0x529dd9[_0x1126('0x12')]='SquareRecording';_0x529dd9[_0x1126('0x17')]=[{'name':_0x1126('0x18'),'field':_0x1126('0xe'),'foreignKey':'projectName'}];break;case'projects':_0x529dd9[_0x1126('0x12')]=_0x1126('0x19');break;case'contacts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x1a');_0x529dd9['parentSections']=[{'name':_0x1126('0x1b'),'field':'id','foreignKey':'ListId'}];break;case _0x1126('0x1c'):_0x529dd9['childModel']=_0x1126('0x1d');break;case'companies':_0x529dd9[_0x1126('0x12')]='CmCompany';break;case'globalcustomfields':_0x529dd9['childModel']=_0x1126('0x1e');break;case _0x1126('0x1f'):_0x529dd9[_0x1126('0x12')]='ChatQueue';break;case _0x1126('0x20'):_0x529dd9[_0x1126('0x12')]='ChatWebsite';break;case _0x1126('0x21'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x22');break;case _0x1126('0x23'):_0x529dd9['childModel']='FaxAccount';break;case _0x1126('0x24'):case _0x1126('0x25'):case _0x1126('0x26'):_0x529dd9[_0x1126('0x12')]='VoiceExtension';break;case _0x1126('0x27'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x28');break;case _0x1126('0x29'):_0x529dd9[_0x1126('0x12')]='VoiceMail';break;case _0x1126('0x2a'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x2b');_0x529dd9[_0x1126('0x17')]=[{'name':'Agents','field':'name','foreignKey':_0x1126('0x2c'),'model':_0x1126('0x2d'),'filter':{'field':'role','value':[_0x1126('0x2e')]}},{'name':_0x1126('0x2f'),'field':_0x1126('0xe'),'foreignKey':'membername','model':'User','filter':{'field':_0x1126('0x30'),'value':[_0x1126('0x31')]}},{'name':_0x1126('0x32'),'field':_0x1126('0xe'),'foreignKey':'queue','model':_0x1126('0x33'),'filter':{'field':'type','value':[_0x1126('0x34')]}},{'name':_0x1126('0x35'),'field':_0x1126('0xe'),'foreignKey':_0x1126('0x36'),'model':_0x1126('0x33'),'filter':{'field':'type','value':[_0x1126('0x37')]}}];break;case _0x1126('0x38'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x39');break;case _0x1126('0x3a'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x3b');break;case'voiceprefixes':_0x529dd9[_0x1126('0x12')]=_0x1126('0x3c');break;case _0x1126('0x3d'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x3e');break;case'mailqueues':_0x529dd9['childModel']=_0x1126('0x3f');break;case _0x1126('0x40'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x41');break;case _0x1126('0x42'):_0x529dd9[_0x1126('0x12')]='MailSubstatus';break;case'openchannelqueues':_0x529dd9['childModel']=_0x1126('0x43');break;case'openchannelaccounts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x44');break;case _0x1126('0x45'):_0x529dd9[_0x1126('0x12')]='SmsQueue';break;case'smsaccounts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x46');break;case _0x1126('0x47'):_0x529dd9['childModel']=_0x1126('0x48');break;case'whatsappaccounts':_0x529dd9[_0x1126('0x12')]='WhatsappAccount';break;case _0x1126('0x49'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x4a');break;case'voicequeues':case _0x1126('0x4b'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x33');if(_0x59cd8e){_0x529dd9['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x1126('0x4c'):case'agents':case _0x1126('0x4d'):_0x529dd9['childModel']=_0x1126('0x2d');if(_0x59cd8e){_0x529dd9[_0x1126('0x17')]=[{'name':_0x1126('0x4e'),'filter':{'field':_0x1126('0x30'),'value':[_0x1126('0x4f'),'user']},'ignore':!![]},{'name':_0x1126('0x50')},{'name':_0x1126('0x2f')}];}break;case'zendeskaccounts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x51');break;case'salesforceaccounts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x52');break;case'freshdeskaccounts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x53');break;case _0x1126('0x54'):_0x529dd9['childModel']=_0x1126('0x55');break;case _0x1126('0x56'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x57');break;case _0x1126('0x58'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x59');break;case _0x1126('0x5a'):_0x529dd9['childModel']=_0x1126('0x2d');break;case'cannedanswers':_0x529dd9[_0x1126('0x12')]=_0x1126('0x5b');break;case'dispositions':_0x529dd9['childModel']=_0x1126('0x5c');break;case _0x1126('0x5d'):_0x529dd9[_0x1126('0x12')]='Dashboard';break;case _0x1126('0x5e'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x5f');break;case _0x1126('0x60'):_0x529dd9['childModel']=_0x1126('0x61');break;case _0x1126('0x62'):_0x529dd9['childModel']='Schedule';break;case'sounds':_0x529dd9['childModel']=_0x1126('0x63');break;case _0x1126('0x64'):_0x529dd9['childModel']=_0x1126('0x65');break;case _0x1126('0x66'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x67');break;case _0x1126('0x68'):_0x529dd9['childModel']=_0x1126('0x69');break;case _0x1126('0x6a'):_0x529dd9['childModel']=_0x1126('0x6b');break;case _0x1126('0x6c'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x6d');break;case _0x1126('0x6e'):_0x529dd9['childModel']=_0x1126('0x6f');break;case'extractedreports':_0x529dd9[_0x1126('0x12')]=_0x1126('0xf');_0x529dd9[_0x1126('0x17')]=[{'name':'Reports','field':'id','foreignKey':_0x1126('0x70')}];break;case _0x1126('0x71'):_0x529dd9['childModel']=_0x1126('0x72');break;}return _0x529dd9;}function _0x25038f(_0x9bad53,_0x5a5340){var _0x2fe6dc=_0x9bad53[_0x1126('0x73')](0x0)[_0x1126('0x74')]()+_0x9bad53[_0x1126('0x75')](0x1);var _0x128c94={'type':_0x350f3a[_0x1126('0x76')][_0x1126('0x77')][_0x1126('0x78')],'raw':!![]};return new Promise(function(_0x47e53d,_0x2b23e3){var _0x2db45e=squel[_0x1126('0x79')]()[_0x1126('0x6')](_0x1126('0x7a')+_0x2fe6dc+'InteractionId','id')[_0x1126('0x6')](_0x1126('0x7b'))['from'](_0x1126('0x7c')+_0x9bad53+'_interactions','ui')[_0x1126('0x7d')](_0x1126('0x7e'),_0x5a5340['id']);return _0x350f3a['sequelize'][_0x1126('0x7f')](_0x2db45e[_0x1126('0x80')](),_0x128c94)[_0x1126('0x9')](function(_0x592960){_0x5a5340[_0x2fe6dc+_0x1126('0x81')]=_0x592960;_0x47e53d(_0x592960);})['catch'](function(_0x558b6e){_0x2b23e3(_0x558b6e);});});}return _0x39b786[_0x1126('0x82')](_0x1126('0x83'),attributes,{'tableName':_0x1126('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1230e9){var _0x3a76ec={'raw':![],'where':{}};var _0x1b4ebf={};var _0x1a0e26={'count':0x0,'rows':[]};var _0x5036d4=_0x1230e9[_0x1126('0x7f')][_0x1126('0x85')];var _0x116867=_0x1230e9[_0x1126('0x7f')][_0x1126('0x86')]||![];var _0x3cd788=_0x48a08d(_0x5036d4,_0x116867);if(!_0x3cd788['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x5036d4+'\x27');var _0x16a343=[{'name':_0x5036d4}];if(!_[_0x1126('0x87')](_0x3cd788['parentSections']))_0x16a343=_0x3cd788['parentSections'];var _0x5e9260=[];for(var _0x51a28d=0x0;_0x51a28d<_0x16a343[_0x1126('0x88')];_0x51a28d++){_0x5e9260[_0x1126('0x89')](_0x350f3a[_0x1126('0x8a')]['find']({'where':{'userProfileId':_0x1230e9[_0x1126('0x8b')]['id'],'name':_0x16a343[_0x51a28d][_0x1126('0xe')]},'raw':!![]}));}return Promise[_0x1126('0x8c')](_0x5e9260)[_0x1126('0x9')](function(_0x22d403){var _0x3f007b=_[_0x1126('0x5')](_0x22d403,function(_0x49a0a3){return _0x49a0a3?_0x49a0a3:undefined;});var _0x339aa6=_[_0x1126('0x5')](_0x16a343,[_0x1126('0x8d'),!![]]);var _0xd8171c=_[_0x1126('0x87')](_0x3f007b)&&_['isEmpty'](_0x339aa6)?null:_['union'](_0x339aa6,_0x3f007b);if(!_0xd8171c)return null;var _0x15cf3d=[];for(var _0x2643d7=0x0;_0x2643d7<_0xd8171c['length'];_0x2643d7++){var _0x3bf25d=_[_0x1126('0x8e')](_0x16a343,function(_0x366675){return _0xd8171c[_0x2643d7]?_0x366675[_0x1126('0xe')]===_0xd8171c[_0x2643d7][_0x1126('0xe')]:null;});if(_0x3bf25d){if(_0xd8171c[_0x2643d7][_0x1126('0x8d')]){_0x15cf3d[_0x1126('0x89')](_0x4245ca(_0x3cd788[_0x1126('0x12')],_0xd8171c[_0x2643d7]));}else{if(!_0xd8171c[_0x2643d7][_0x1126('0x8f')]){_0x15cf3d[_0x1126('0x89')](_0x4794a7(_0x3bf25d,_0xd8171c[_0x2643d7],_0x3cd788[_0x1126('0x12')]));}else{if(_0x3bf25d[_0x1126('0xd')]){_0x15cf3d[_0x1126('0x89')](_0x34571c(_0x3bf25d,_0xd8171c[_0x2643d7]));}}}}}return Promise['all'](_0x15cf3d);})[_0x1126('0x9')](function(_0x274343){var _0x2b61ae=_0x274343;var _0x53ea9a=null;if(_0x2b61ae){_0x53ea9a=_0x2b61ae['length']===0x1?_0x2b61ae[0x0]:null;}if(!_0x53ea9a&&!_0x2b61ae)return _0x1a0e26;var _0xe22fd2=_0x350f3a[_0x3cd788[_0x1126('0x12')]][_0x1126('0x90')];_0x1b4ebf[_0x1126('0xd')]=_['keys'](_0xe22fd2);_0x1b4ebf['query']=_['keys'](_0x1230e9[_0x1126('0x7f')]);_0x1b4ebf[_0x1126('0x91')]=_[_0x1126('0x92')](_0x1b4ebf[_0x1126('0xd')],_0x1b4ebf['query']);_0x3a76ec[_0x1126('0x93')]=_['intersection'](_0x1b4ebf[_0x1126('0xd')],qs[_0x1126('0x94')](_0x1230e9[_0x1126('0x7f')][_0x1126('0x94')]));_0x3a76ec[_0x1126('0x93')]=_0x3a76ec[_0x1126('0x93')][_0x1126('0x88')]?_0x3a76ec['attributes']:_0x1b4ebf[_0x1126('0xd')];if(!_0x1230e9['query'][_0x1126('0x95')](_0x1126('0x96'))){_0x3a76ec['limit']=qs[_0x1126('0x97')](_0x1230e9[_0x1126('0x7f')]['limit']);_0x3a76ec[_0x1126('0x98')]=qs[_0x1126('0x98')](_0x1230e9['query']['offset']);}_0x3a76ec[_0x1126('0x99')]=qs[_0x1126('0x9a')](_0x1230e9[_0x1126('0x7f')]['sort']);_0x3a76ec['where']=qs['filters'](_[_0x1126('0x9b')](_0x1230e9['query'],_0x1b4ebf['filters']));if(_0x1230e9[_0x1126('0x7f')]['filter']){_0x3a76ec[_0x1126('0x7d')]=_[_0x1126('0x9c')](_0x3a76ec['where'],{'$or':_[_0x1126('0xb')](_0xe22fd2,function(_0x375728){if(_0x375728[_0x1126('0x10')][_0x1126('0x9d')]!==_0x1126('0x9e')){var _0x5e9872={};_0x5e9872[_0x375728[_0x1126('0x6')]]={'$like':'%'+_0x1230e9[_0x1126('0x7f')]['filter']+'%'};return _0x5e9872;}})});}var _0xd182b1=[];var _0x2d6fcf=null;var _0x2c0908={};if(_0x53ea9a){_0x2d6fcf=_[_0x1126('0x8e')](_0x16a343,[_0x1126('0xe'),_0x53ea9a[_0x1126('0xe')]]);if(_0x2d6fcf[_0x1126('0x6')]){_0x2c0908={};if(_0x3cd788[_0x1126('0x12')]===_0x1126('0xf')){_0x2c0908[_0x2d6fcf[_0x1126('0x9f')]]=_[_0x1126('0xb')](_0x53ea9a[_0x1126('0xa')],'id');}else{_0x2c0908[_0x2d6fcf[_0x1126('0x9f')]]=_0x53ea9a[_0x1126('0xa')];}_0xd182b1[_0x1126('0x89')](_0x2c0908);}else{_0x3a76ec[_0x1126('0x7d')]['id']=_0x53ea9a['associatedResources'];}}else{for(var _0x31cfb5=0x0;_0x31cfb5<_0x2b61ae[_0x1126('0x88')];_0x31cfb5++){_0x2d6fcf=_[_0x1126('0x8e')](_0x16a343,[_0x1126('0xe'),_0x2b61ae[_0x31cfb5][_0x1126('0xe')]]);if(_0x2d6fcf['field']){_0x2c0908={};_0x2c0908[_0x2d6fcf[_0x1126('0x9f')]]=_0x2b61ae[_0x31cfb5]['associatedResources'];_0xd182b1['push'](_0x2c0908);}else{if(!_0x3a76ec[_0x1126('0x7d')]['id'])_0x3a76ec[_0x1126('0x7d')]['id']=[];_0x2b61ae[_0x31cfb5]['associatedResources']['forEach'](function(_0xaada05){_0x3a76ec[_0x1126('0x7d')]['id'][_0x1126('0x89')](_0xaada05);});}}}if(!_[_0x1126('0x87')](_0xd182b1)){_0x3a76ec[_0x1126('0x7d')]=_[_0x1126('0x9c')](_0x3a76ec[_0x1126('0x7d')],{'$and':{'$or':_0xd182b1}});}_0x3a76ec=_[_0x1126('0x9c')]({},_0x3a76ec,_0x1230e9[_0x1126('0xa0')]);if(_0x53ea9a&&!_0x53ea9a['autoAssociation']&&_0x3cd788[_0x1126('0x12')]===_0x1126('0xf')){if(_0x1230e9[_0x1126('0x7f')][_0x1126('0xa1')]){_0x3a76ec[_0x1126('0xa2')]=[{'all':!![]}];}return _0x350f3a[_0x3cd788[_0x1126('0x12')]]['findAll'](_0x3a76ec)[_0x1126('0x9')](function(_0x2cc4c8){var _0x194b3c=[];_0x2cc4c8[_0x1126('0xa3')](function(_0x12cdc6){var _0x1796eb;switch(_0x12cdc6[_0x1126('0xa4')]){case _0x1126('0xa5'):_0x1796eb=_[_0x1126('0x8e')](_0x53ea9a[_0x1126('0xa')],function(_0x5d6edb){return _0x5d6edb['id']===_0x12cdc6['reportId']&&_0x5d6edb[_0x1126('0x10')]==='DefaultReports';});break;case _0x1126('0xa6'):_0x1796eb=_['find'](_0x53ea9a[_0x1126('0xa')],function(_0x5059d3){return _0x5059d3['id']===_0x12cdc6[_0x1126('0x70')]&&_0x5059d3['type']==='CustomReports';});break;}if(_0x1796eb)_0x194b3c['push'](_0x12cdc6);});_0x1a0e26[_0x1126('0xa7')]=_0x194b3c[_0x1126('0x88')];_0x1a0e26['rows']=_0x194b3c;return _0x1a0e26;});}else{return _0x350f3a[_0x3cd788['childModel']][_0x1126('0xa7')]({'where':_0x3a76ec[_0x1126('0x7d')]})[_0x1126('0x9')](function(_0x5dfb8f){_0x1a0e26['count']=_0x5dfb8f;if(_0x1230e9[_0x1126('0x7f')]['includeAll']){if(_0x3cd788[_0x1126('0x12')]===_0x1126('0x1a')){_0x3a76ec[_0x1126('0xa2')]=[{'model':_0x350f3a[_0x1126('0x65')],'as':_0x1126('0xa8'),'attributes':['id','name','color'],'required':_0x1230e9[_0x1126('0x7f')][_0x1126('0xa9')]?!![]:![]},{'model':_0x350f3a[_0x1126('0x65')],'as':_0x1126('0xaa'),'attributes':['id',_0x1126('0xe'),_0x1126('0xab')],'through':_0x1230e9[_0x1126('0x7f')][_0x1126('0xa9')]?{'attributes':[],'where':{'TagId':_0x1230e9[_0x1126('0x7f')][_0x1126('0xa9')]||undefined}}:{},'required':_0x1230e9[_0x1126('0x7f')]['tag']?!![]:![]}];}else{_0x3a76ec[_0x1126('0xa2')]=[{'all':!![]}];}}return _0x350f3a[_0x3cd788['childModel']][_0x1126('0x8')](_0x3a76ec);})['then'](function(_0x4256e6){_0x1a0e26[_0x1126('0xac')]=_0x4256e6;if(_0x5036d4===_0x1126('0x50')&&_0x1230e9[_0x1126('0x7f')]['openTabs']===_0x1126('0xad')){var _0x834360=[];for(var _0x4b5d46=0x0;_0x4b5d46<_0x1a0e26['rows'][_0x1126('0x88')];_0x4b5d46++){_0x834360[_0x1126('0x89')](_0x25038f(_0x1126('0xae'),_0x1a0e26['rows'][_0x4b5d46][_0x1126('0xaf')]));_0x834360['push'](_0x25038f(_0x1126('0xb0'),_0x1a0e26[_0x1126('0xac')][_0x4b5d46]['dataValues']));_0x834360[_0x1126('0x89')](_0x25038f(_0x1126('0xb1'),_0x1a0e26[_0x1126('0xac')][_0x4b5d46][_0x1126('0xaf')]));_0x834360[_0x1126('0x89')](_0x25038f('mail',_0x1a0e26[_0x1126('0xac')][_0x4b5d46][_0x1126('0xaf')]));_0x834360[_0x1126('0x89')](_0x25038f('openchannel',_0x1a0e26['rows'][_0x4b5d46]['dataValues']));_0x834360[_0x1126('0x89')](_0x25038f(_0x1126('0xb2'),_0x1a0e26[_0x1126('0xac')][_0x4b5d46][_0x1126('0xaf')]));}return Promise['all'](_0x834360)[_0x1126('0x9')](function(){return _0x1a0e26;});}return _0x1a0e26;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index ca132a3..252b812 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 _0x9e69=['register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x81ad64,_0xce0dd2){var _0x5824b8=function(_0x13d261){while(--_0x13d261){_0x81ad64['push'](_0x81ad64['shift']());}};_0x5824b8(++_0xce0dd2);}(_0x9e69,0x150));var _0x99e6=function(_0x2c74de,_0x50ede8){_0x2c74de=_0x2c74de-0x0;var _0x10bbfa=_0x9e69[_0x2c74de];return _0x10bbfa;};'use strict';var _=require('lodash');var util=require(_0x99e6('0x0'));var moment=require(_0x99e6('0x1'));var BPromise=require(_0x99e6('0x2'));var rs=require(_0x99e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99e6('0x4'))['db'];var utils=require(_0x99e6('0x5'));var logger=require('../../config/logger')(_0x99e6('0x6'));var config=require(_0x99e6('0x7'));var jayson=require(_0x99e6('0x8'));var client=jayson['client'][_0x99e6('0x9')]({'port':0x232a});config[_0x99e6('0xa')]=_[_0x99e6('0xb')](config['redis'],{'host':_0x99e6('0xc'),'port':0x18eb});var socket=require(_0x99e6('0xd'))(new Redis(config['redis']));require(_0x99e6('0xe'))[_0x99e6('0xf')](socket);function respondWithRpcPromise(_0x5d2a2b,_0x26bcdd,_0x74906a){return new BPromise(function(_0x490a04,_0x4d2d8c){return client[_0x99e6('0x10')](_0x5d2a2b,_0x74906a)[_0x99e6('0x11')](function(_0x45d416){logger[_0x99e6('0x12')](_0x99e6('0x13'),_0x26bcdd,_0x99e6('0x14'));logger['debug'](_0x99e6('0x15'),_0x26bcdd,_0x99e6('0x14'),JSON[_0x99e6('0x16')](_0x45d416));if(_0x45d416['error']){if(_0x45d416[_0x99e6('0x17')][_0x99e6('0x18')]===0x1f4){logger[_0x99e6('0x17')]('UserProfile,\x20%s,\x20%s',_0x26bcdd,_0x45d416['error']['message']);return _0x4d2d8c(_0x45d416[_0x99e6('0x17')][_0x99e6('0x19')]);}logger[_0x99e6('0x17')]('UserProfile,\x20%s,\x20%s',_0x26bcdd,_0x45d416[_0x99e6('0x17')][_0x99e6('0x19')]);return _0x490a04(_0x45d416[_0x99e6('0x17')][_0x99e6('0x19')]);}else{logger[_0x99e6('0x12')]('UserProfile,\x20%s,\x20%s',_0x26bcdd,_0x99e6('0x14'));_0x490a04(_0x45d416['result'][_0x99e6('0x19')]);}})[_0x99e6('0x1a')](function(_0x538651){logger[_0x99e6('0x17')](_0x99e6('0x13'),_0x26bcdd,_0x538651);_0x4d2d8c(_0x538651);});});} \ No newline at end of file +var _0xafc4=['error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5840a5,_0x3d8dd9){var _0x323368=function(_0x17c3d1){while(--_0x17c3d1){_0x5840a5['push'](_0x5840a5['shift']());}};_0x323368(++_0x3d8dd9);}(_0xafc4,0x69));var _0x4afc=function(_0x5da023,_0x1272bb){_0x5da023=_0x5da023-0x0;var _0x555c71=_0xafc4[_0x5da023];return _0x555c71;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});config[_0x4afc('0x9')]=_[_0x4afc('0xa')](config[_0x4afc('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4afc('0xb'))(new Redis(config[_0x4afc('0x9')]));require(_0x4afc('0xc'))[_0x4afc('0xd')](socket);function respondWithRpcPromise(_0x1b8981,_0x458fde,_0x5542ec){return new BPromise(function(_0x5c523b,_0x7f127f){return client['request'](_0x1b8981,_0x5542ec)[_0x4afc('0xe')](function(_0x225793){logger['info'](_0x4afc('0xf'),_0x458fde,_0x4afc('0x10'));logger[_0x4afc('0x11')](_0x4afc('0x12'),_0x458fde,_0x4afc('0x10'),JSON[_0x4afc('0x13')](_0x225793));if(_0x225793[_0x4afc('0x14')]){if(_0x225793[_0x4afc('0x14')]['code']===0x1f4){logger[_0x4afc('0x14')](_0x4afc('0xf'),_0x458fde,_0x225793[_0x4afc('0x14')][_0x4afc('0x15')]);return _0x7f127f(_0x225793['error']['message']);}logger[_0x4afc('0x14')]('UserProfile,\x20%s,\x20%s',_0x458fde,_0x225793[_0x4afc('0x14')][_0x4afc('0x15')]);return _0x5c523b(_0x225793[_0x4afc('0x14')][_0x4afc('0x15')]);}else{logger[_0x4afc('0x16')](_0x4afc('0xf'),_0x458fde,_0x4afc('0x10'));_0x5c523b(_0x225793[_0x4afc('0x17')][_0x4afc('0x15')]);}})[_0x4afc('0x18')](function(_0x178229){logger['error'](_0x4afc('0xf'),_0x458fde,_0x178229);_0x7f127f(_0x178229);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 544068b..178c906 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 _0x8f42=['update','emit','removeListener','userProfile:','./userProfile.events','save'];(function(_0x1306b7,_0x5d4891){var _0x45ad97=function(_0x1b69f2){while(--_0x1b69f2){_0x1306b7['push'](_0x1306b7['shift']());}};_0x45ad97(++_0x5d4891);}(_0x8f42,0x136));var _0x28f4=function(_0x10df35,_0x315828){_0x10df35=_0x10df35-0x0;var _0x4da716=_0x8f42[_0x10df35];return _0x4da716;};'use strict';var UserProfileEvents=require(_0x28f4('0x0'));var events=[_0x28f4('0x1'),'remove',_0x28f4('0x2')];function createListener(_0x2963f6,_0x57cba6){return function(_0x206ae0){_0x57cba6[_0x28f4('0x3')](_0x2963f6,_0x206ae0);};}function removeListener(_0x3250cb,_0x34d08d){return function(){UserProfileEvents[_0x28f4('0x4')](_0x3250cb,_0x34d08d);};}exports['register']=function(_0x7e5d43){for(var _0x1b960d=0x0,_0x554a0e=events['length'];_0x1b960d<_0x554a0e;_0x1b960d++){var _0x1e90ff=events[_0x1b960d];var _0x1c73e6=createListener(_0x28f4('0x5')+_0x1e90ff,_0x7e5d43);UserProfileEvents['on'](_0x1e90ff,_0x1c73e6);}}; \ No newline at end of file +var _0x4331=['register','length','userProfile:','./userProfile.events','remove','emit','removeListener'];(function(_0x3b5fda,_0xde2b62){var _0x5bfd99=function(_0x384ffc){while(--_0x384ffc){_0x3b5fda['push'](_0x3b5fda['shift']());}};_0x5bfd99(++_0xde2b62);}(_0x4331,0xdc));var _0x1433=function(_0x5886b1,_0x8c78aa){_0x5886b1=_0x5886b1-0x0;var _0x2713f9=_0x4331[_0x5886b1];return _0x2713f9;};'use strict';var UserProfileEvents=require(_0x1433('0x0'));var events=['save',_0x1433('0x1'),'update'];function createListener(_0x559526,_0x2dd60d){return function(_0x26c1fe){_0x2dd60d[_0x1433('0x2')](_0x559526,_0x26c1fe);};}function removeListener(_0x3f0d80,_0x162019){return function(){UserProfileEvents[_0x1433('0x3')](_0x3f0d80,_0x162019);};}exports[_0x1433('0x4')]=function(_0x5c7eee){for(var _0x990f0e=0x0,_0x5a6e2c=events[_0x1433('0x5')];_0x990f0e<_0x5a6e2c;_0x990f0e++){var _0x4fab56=events[_0x990f0e];var _0x4e34c2=createListener(_0x1433('0x6')+_0x4fab56,_0x5c7eee);UserProfileEvents['on'](_0x4fab56,_0x4e34c2);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index c7834d0..76c3762 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 _0x6595=['/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x6595,0xb2));var _0x5659=function(_0x531ea3,_0x373939){_0x531ea3=_0x531ea3-0x0;var _0x2d7bda=_0x6595[_0x531ea3];return _0x2d7bda;};'use strict';var multer=require(_0x5659('0x0'));var util=require(_0x5659('0x1'));var path=require('path');var timeout=require(_0x5659('0x2'));var express=require(_0x5659('0x3'));var router=express[_0x5659('0x4')]();var fs_extra=require(_0x5659('0x5'));var auth=require(_0x5659('0x6'));var interaction=require(_0x5659('0x7'));var config=require('../../config/environment');var controller=require(_0x5659('0x8'));router[_0x5659('0x9')]('/',auth[_0x5659('0xa')](),controller['index']);router[_0x5659('0x9')](_0x5659('0xb'),auth[_0x5659('0xa')](),controller[_0x5659('0xc')]);router[_0x5659('0x9')](_0x5659('0xd'),auth[_0x5659('0xa')](),controller[_0x5659('0xe')]);router[_0x5659('0xf')]('/',auth[_0x5659('0xa')](),controller[_0x5659('0x10')]);router[_0x5659('0x11')](_0x5659('0xd'),auth[_0x5659('0xa')](),controller[_0x5659('0x12')]);router[_0x5659('0x13')](_0x5659('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x5659('0x14')]=router; \ No newline at end of file +var _0x5fe8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','destroy','exports','connect-timeout'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5fe8,0x1cb));var _0x85fe=function(_0x28ace8,_0x131557){_0x28ace8=_0x28ace8-0x0;var _0x3957e0=_0x5fe8[_0x28ace8];return _0x3957e0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x85fe('0x0'));var express=require(_0x85fe('0x1'));var router=express[_0x85fe('0x2')]();var fs_extra=require(_0x85fe('0x3'));var auth=require(_0x85fe('0x4'));var interaction=require(_0x85fe('0x5'));var config=require('../../config/environment');var controller=require(_0x85fe('0x6'));router[_0x85fe('0x7')]('/',auth[_0x85fe('0x8')](),controller[_0x85fe('0x9')]);router[_0x85fe('0x7')](_0x85fe('0xa'),auth[_0x85fe('0x8')](),controller[_0x85fe('0xb')]);router[_0x85fe('0x7')]('/:id',auth[_0x85fe('0x8')](),controller[_0x85fe('0xc')]);router[_0x85fe('0xd')]('/',auth[_0x85fe('0x8')](),controller[_0x85fe('0xe')]);router[_0x85fe('0xf')](_0x85fe('0x10'),auth[_0x85fe('0x8')](),controller[_0x85fe('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x85fe('0x12')]);module[_0x85fe('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index c6e2f2c..7c362a0 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 _0x98eb=['INTEGER','sequelize','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x98eb,0xb5));var _0xb98e=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x98eb[_0x2080a3];return _0x8d7d17;};'use strict';var Sequelize=require(_0xb98e('0x0'));module[_0xb98e('0x1')]={'name':{'type':Sequelize[_0xb98e('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xb98e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb98e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe773=['sequelize','STRING'];(function(_0x548dc4,_0x5163fc){var _0x5e9272=function(_0x3de7ec){while(--_0x3de7ec){_0x548dc4['push'](_0x548dc4['shift']());}};_0x5e9272(++_0x5163fc);}(_0xe773,0x16c));var _0x3e77=function(_0x442089,_0x54906a){_0x442089=_0x442089-0x0;var _0x2f1cc4=_0xe773[_0x442089];return _0x2f1cc4;};'use strict';var Sequelize=require(_0x3e77('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e77('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x3e77('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index ef631b7..4e24125 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 _0xafc4=['update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','UserProfileResource','includeAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5e5d41,_0x208901){var _0xbb31ba=function(_0x699284){while(--_0x699284){_0x5e5d41['push'](_0x5e5d41['shift']());}};_0xbb31ba(++_0x208901);}(_0xafc4,0x69));var _0x4afc=function(_0x3bfd25,_0x1c6228){_0x3bfd25=_0x3bfd25-0x0;var _0x44f0db=_0xafc4[_0x3bfd25];return _0x44f0db;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['UserProfileResource'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['UserProfileResource']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));};exports[_0x4afc('0x45')]=function(_0x3625c9,_0x387834){return db[_0x4afc('0x3d')][_0x4afc('0x45')]()[_0x4afc('0x25')](respondWithResult(_0x387834,null))[_0x4afc('0x3f')](handleError(_0x387834,null));}; \ No newline at end of file +var _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','UserProfileResource','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0xdc0d16,_0x2e7bac){var _0x31f716=function(_0xe1a7a1){while(--_0xe1a7a1){_0xdc0d16['push'](_0xdc0d16['shift']());}};_0x31f716(++_0x2e7bac);}(_0x57ca,0x108));var _0xa57c=function(_0x59941b,_0x121697){_0x59941b=_0x59941b-0x0;var _0x43d0b2=_0x57ca[_0x59941b];return _0x43d0b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['UserProfileResource'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['UserProfileResource'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 273a300..d61753c 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 _0xe51a=['./userProfileResource.attributes','define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe51a,0x1b9));var _0xae51=function(_0xab50d3,_0x3cc4c1){_0xab50d3=_0xab50d3-0x0;var _0x33dbbd=_0xe51a[_0xab50d3];return _0x33dbbd;};'use strict';var _=require(_0xae51('0x0'));var util=require(_0xae51('0x1'));var logger=require(_0xae51('0x2'))('api');var moment=require(_0xae51('0x3'));var BPromise=require(_0xae51('0x4'));var rp=require(_0xae51('0x5'));var fs=require('fs');var path=require(_0xae51('0x6'));var rimraf=require(_0xae51('0x7'));var config=require(_0xae51('0x8'));var attributes=require(_0xae51('0x9'));module['exports']=function(_0x48c2f2,_0x22d8f4){return _0x48c2f2[_0xae51('0xa')](_0xae51('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xae51('0xc'),'fields':[_0xae51('0xd'),_0xae51('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdf0=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash'];(function(_0x40a397,_0x4fa39c){var _0x464c33=function(_0x29125c){while(--_0x29125c){_0x40a397['push'](_0x40a397['shift']());}};_0x464c33(++_0x4fa39c);}(_0xfdf0,0x1b2));var _0x0fdf=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xfdf0[_0x55d8c5];return _0x225ae5;};'use strict';var _=require(_0x0fdf('0x0'));var util=require(_0x0fdf('0x1'));var logger=require('../../config/logger')(_0x0fdf('0x2'));var moment=require(_0x0fdf('0x3'));var BPromise=require(_0x0fdf('0x4'));var rp=require(_0x0fdf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fdf('0x6'));var config=require(_0x0fdf('0x7'));var attributes=require(_0x0fdf('0x8'));module[_0x0fdf('0x9')]=function(_0x4b7f8a,_0x226e6c){return _0x4b7f8a[_0x0fdf('0xa')](_0x0fdf('0xb'),attributes,{'tableName':_0x0fdf('0xc'),'paranoid':![],'indexes':[{'name':_0x0fdf('0xd'),'fields':['resourceId',_0x0fdf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 9f67e18..905debd 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 _0x671f=['info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x4ce924,_0x3d8483){var _0x4263a6=function(_0x4b8c67){while(--_0x4b8c67){_0x4ce924['push'](_0x4ce924['shift']());}};_0x4263a6(++_0x3d8483);}(_0x671f,0x164));var _0xf671=function(_0x1aa176,_0x29d165){_0x1aa176=_0x1aa176-0x0;var _0x13adda=_0x671f[_0x1aa176];return _0x13adda;};'use strict';var _=require(_0xf671('0x0'));var util=require(_0xf671('0x1'));var moment=require('moment');var BPromise=require(_0xf671('0x2'));var rs=require(_0xf671('0x3'));var fs=require('fs');var Redis=require(_0xf671('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf671('0x5'));var logger=require('../../config/logger')(_0xf671('0x6'));var config=require(_0xf671('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf671('0x8')][_0xf671('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23fd32,_0x23d3b8,_0x3ecc3c){return new BPromise(function(_0xf7f443,_0x81fb79){return client[_0xf671('0xa')](_0x23fd32,_0x3ecc3c)[_0xf671('0xb')](function(_0x3fcd93){logger[_0xf671('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x23d3b8,_0xf671('0xd'));logger[_0xf671('0xe')](_0xf671('0xf'),_0x23d3b8,_0xf671('0xd'),JSON[_0xf671('0x10')](_0x3fcd93));if(_0x3fcd93[_0xf671('0x11')]){if(_0x3fcd93[_0xf671('0x11')][_0xf671('0x12')]===0x1f4){logger[_0xf671('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x23d3b8,_0x3fcd93[_0xf671('0x11')][_0xf671('0x13')]);return _0x81fb79(_0x3fcd93[_0xf671('0x11')][_0xf671('0x13')]);}logger[_0xf671('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x23d3b8,_0x3fcd93[_0xf671('0x11')][_0xf671('0x13')]);return _0xf7f443(_0x3fcd93['error']['message']);}else{logger['info'](_0xf671('0x14'),_0x23d3b8,_0xf671('0xd'));_0xf7f443(_0x3fcd93[_0xf671('0x15')]['message']);}})[_0xf671('0x16')](function(_0x3ae7dd){logger[_0xf671('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x23d3b8,_0x3ae7dd);_0x81fb79(_0x3ae7dd);});});} \ No newline at end of file +var _0x9609=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','ioredis'];(function(_0x85961a,_0x58a6f5){var _0x43d5d7=function(_0x22fcec){while(--_0x22fcec){_0x85961a['push'](_0x85961a['shift']());}};_0x43d5d7(++_0x58a6f5);}(_0x9609,0x146));var _0x9960=function(_0x156fba,_0x3a5026){_0x156fba=_0x156fba-0x0;var _0x7c7f24=_0x9609[_0x156fba];return _0x7c7f24;};'use strict';var _=require(_0x9960('0x0'));var util=require(_0x9960('0x1'));var moment=require('moment');var BPromise=require(_0x9960('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9960('0x3'));var db=require(_0x9960('0x4'))['db'];var utils=require(_0x9960('0x5'));var logger=require(_0x9960('0x6'))(_0x9960('0x7'));var config=require(_0x9960('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9960('0x9')][_0x9960('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f6810,_0x51b3fa,_0x557c9a){return new BPromise(function(_0x3613c4,_0x391092){return client[_0x9960('0xb')](_0x1f6810,_0x557c9a)[_0x9960('0xc')](function(_0x576de5){logger[_0x9960('0xd')](_0x9960('0xe'),_0x51b3fa,_0x9960('0xf'));logger[_0x9960('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x51b3fa,_0x9960('0xf'),JSON[_0x9960('0x11')](_0x576de5));if(_0x576de5[_0x9960('0x12')]){if(_0x576de5[_0x9960('0x12')]['code']===0x1f4){logger[_0x9960('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x51b3fa,_0x576de5[_0x9960('0x12')][_0x9960('0x13')]);return _0x391092(_0x576de5[_0x9960('0x12')]['message']);}logger['error'](_0x9960('0xe'),_0x51b3fa,_0x576de5[_0x9960('0x12')][_0x9960('0x13')]);return _0x3613c4(_0x576de5['error'][_0x9960('0x13')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x51b3fa,_0x9960('0xf'));_0x3613c4(_0x576de5[_0x9960('0x14')][_0x9960('0x13')]);}})[_0x9960('0x15')](function(_0x35ef24){logger[_0x9960('0x12')](_0x9960('0xe'),_0x51b3fa,_0x35ef24);_0x391092(_0x35ef24);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 947e62c..12d3a06 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 _0x5d1f=['../../config/environment','./userProfileSection.controller','isAuthenticated','get','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x5d1f,0x19b));var _0xf5d1=function(_0x2e91a2,_0x509636){_0x2e91a2=_0x2e91a2-0x0;var _0x251b61=_0x5d1f[_0x2e91a2];return _0x251b61;};'use strict';var multer=require(_0xf5d1('0x0'));var util=require(_0xf5d1('0x1'));var path=require(_0xf5d1('0x2'));var timeout=require(_0xf5d1('0x3'));var express=require(_0xf5d1('0x4'));var router=express[_0xf5d1('0x5')]();var fs_extra=require(_0xf5d1('0x6'));var auth=require(_0xf5d1('0x7'));var interaction=require(_0xf5d1('0x8'));var config=require(_0xf5d1('0x9'));var controller=require(_0xf5d1('0xa'));router['get']('/',auth[_0xf5d1('0xb')](),controller['index']);router[_0xf5d1('0xc')]('/describe',auth[_0xf5d1('0xb')](),controller[_0xf5d1('0xd')]);router[_0xf5d1('0xc')](_0xf5d1('0xe'),auth[_0xf5d1('0xb')](),controller[_0xf5d1('0xf')]);router['post']('/',auth[_0xf5d1('0xb')](),controller[_0xf5d1('0x10')]);router[_0xf5d1('0x11')](_0xf5d1('0xe'),auth[_0xf5d1('0xb')](),controller[_0xf5d1('0x12')]);router[_0xf5d1('0x13')](_0xf5d1('0xe'),auth[_0xf5d1('0xb')](),controller['destroy']);module[_0xf5d1('0x14')]=router; \ No newline at end of file +var _0x8e18=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','destroy','exports','multer'];(function(_0x53da4e,_0x1fb698){var _0x321239=function(_0x4ab228){while(--_0x4ab228){_0x53da4e['push'](_0x53da4e['shift']());}};_0x321239(++_0x1fb698);}(_0x8e18,0x1df));var _0x88e1=function(_0x11063b,_0x5f0f9d){_0x11063b=_0x11063b-0x0;var _0x491bb6=_0x8e18[_0x11063b];return _0x491bb6;};'use strict';var multer=require(_0x88e1('0x0'));var util=require(_0x88e1('0x1'));var path=require('path');var timeout=require(_0x88e1('0x2'));var express=require(_0x88e1('0x3'));var router=express[_0x88e1('0x4')]();var fs_extra=require(_0x88e1('0x5'));var auth=require(_0x88e1('0x6'));var interaction=require(_0x88e1('0x7'));var config=require(_0x88e1('0x8'));var controller=require('./userProfileSection.controller');router[_0x88e1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x88e1('0x9')](_0x88e1('0xa'),auth[_0x88e1('0xb')](),controller[_0x88e1('0xc')]);router[_0x88e1('0x9')](_0x88e1('0xd'),auth[_0x88e1('0xb')](),controller[_0x88e1('0xe')]);router[_0x88e1('0xf')]('/',auth[_0x88e1('0xb')](),controller['create']);router[_0x88e1('0x10')]('/:id',auth[_0x88e1('0xb')](),controller[_0x88e1('0x11')]);router['delete'](_0x88e1('0xd'),auth[_0x88e1('0xb')](),controller[_0x88e1('0x12')]);module[_0x88e1('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 666f228..d6ac077 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 _0x6cb4=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x599ad6,_0x526b2b){var _0x3b1df4=function(_0x4deb14){while(--_0x4deb14){_0x599ad6['push'](_0x599ad6['shift']());}};_0x3b1df4(++_0x526b2b);}(_0x6cb4,0xff));var _0x46cb=function(_0x2526e0,_0x30e976){_0x2526e0=_0x2526e0-0x0;var _0x376304=_0x6cb4[_0x2526e0];return _0x376304;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'name':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x46cb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x46cb('0x2')],'set':function(_0x2efd19){this['setDataValue'](_0x46cb('0x5'),_0x2efd19?_0x2efd19['join'](''):[]);},'get':function(){return this[_0x46cb('0x6')]('crudPermissions')?this[_0x46cb('0x6')](_0x46cb('0x5'))[_0x46cb('0x7')](''):[];}}}; \ No newline at end of file +var _0xb9a7=['getDataValue','split','exports','BOOLEAN','STRING','setDataValue','crudPermissions','join'];(function(_0x4f5dd5,_0x1fb6d8){var _0x26dc3a=function(_0x26ed32){while(--_0x26ed32){_0x4f5dd5['push'](_0x4f5dd5['shift']());}};_0x26dc3a(++_0x1fb6d8);}(_0xb9a7,0x112));var _0x7b9a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xb9a7[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x7b9a('0x1')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x7b9a('0x2')],'set':function(_0x40ef7d){this[_0x7b9a('0x3')](_0x7b9a('0x4'),_0x40ef7d?_0x40ef7d[_0x7b9a('0x5')](''):[]);},'get':function(){return this[_0x7b9a('0x6')](_0x7b9a('0x4'))?this[_0x7b9a('0x6')](_0x7b9a('0x4'))[_0x7b9a('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 3eea5d2..9612016 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 _0xf5b7=['order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x27d8bc,_0x19e010){var _0x4b04cb=function(_0x524568){while(--_0x524568){_0x27d8bc['push'](_0x27d8bc['shift']());}};_0x4b04cb(++_0x19e010);}(_0xf5b7,0xa8));var _0x7f5b=function(_0x1ef264,_0x5205e2){_0x1ef264=_0x1ef264-0x0;var _0x38574a=_0xf5b7[_0x1ef264];return _0x38574a;};'use strict';var emlformat=require(_0x7f5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f5b('0x1'));var jsonpatch=require(_0x7f5b('0x2'));var rp=require(_0x7f5b('0x3'));var moment=require(_0x7f5b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f5b('0x5'));var util=require(_0x7f5b('0x6'));var path=require('path');var sox=require(_0x7f5b('0x7'));var csv=require('to-csv');var ejs=require(_0x7f5b('0x8'));var fs=require('fs');var fs_extra=require(_0x7f5b('0x9'));var _=require(_0x7f5b('0xa'));var squel=require(_0x7f5b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7f5b('0xc'));var toCsv=require(_0x7f5b('0xd'));var querystring=require(_0x7f5b('0xe'));var Papa=require('papaparse');var Redis=require(_0x7f5b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7f5b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f5b('0x11'));var logger=require(_0x7f5b('0x12'))(_0x7f5b('0x13'));var utils=require(_0x7f5b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7f5b('0x15'));var db=require(_0x7f5b('0x16'))['db'];function respondWithStatusCode(_0x4a6e92,_0x1cd39b){_0x1cd39b=_0x1cd39b||0xcc;return function(_0x59b0ad){if(_0x59b0ad){return _0x4a6e92['sendStatus'](_0x1cd39b);}return _0x4a6e92['status'](_0x1cd39b)[_0x7f5b('0x17')]();};}function respondWithResult(_0x276659,_0x57cf3a){_0x57cf3a=_0x57cf3a||0xc8;return function(_0x12c31b){if(_0x12c31b){return _0x276659[_0x7f5b('0x18')](_0x57cf3a)[_0x7f5b('0x19')](_0x12c31b);}};}function respondWithFilteredResult(_0x3b1d4b,_0x1821e6){return function(_0x191a0c){if(_0x191a0c){var _0x40505f=typeof _0x1821e6[_0x7f5b('0x1a')]==='undefined'&&typeof _0x1821e6[_0x7f5b('0x1b')]===_0x7f5b('0x1c');var _0x5ed924=_0x191a0c[_0x7f5b('0x1d')];var _0x31dd96=_0x40505f?0x0:_0x1821e6[_0x7f5b('0x1a')];var _0x10436d=_0x40505f?_0x191a0c[_0x7f5b('0x1d')]:_0x1821e6[_0x7f5b('0x1a')]+_0x1821e6[_0x7f5b('0x1b')];var _0x226fb5;if(_0x10436d>=_0x5ed924){_0x10436d=_0x5ed924;_0x226fb5=0xc8;}else{_0x226fb5=0xce;}_0x3b1d4b[_0x7f5b('0x18')](_0x226fb5);return _0x3b1d4b[_0x7f5b('0x1e')](_0x7f5b('0x1f'),_0x31dd96+'-'+_0x10436d+'/'+_0x5ed924)[_0x7f5b('0x19')](_0x191a0c);}return null;};}function patchUpdates(_0x287a4f){return function(_0x3168e4){try{jsonpatch['apply'](_0x3168e4,_0x287a4f,!![]);}catch(_0x7997d6){return BPromise['reject'](_0x7997d6);}return _0x3168e4[_0x7f5b('0x20')]();};}function saveUpdates(_0x1f5089,_0x111870){return function(_0x506064){if(_0x506064){return _0x506064[_0x7f5b('0x21')](_0x1f5089)[_0x7f5b('0x22')](function(_0x355d43){return _0x355d43;});}return null;};}function removeEntity(_0x3444dd,_0x562da9){return function(_0x17071b){if(_0x17071b){return _0x17071b[_0x7f5b('0x23')]()['then'](function(){_0x3444dd[_0x7f5b('0x18')](0xcc)[_0x7f5b('0x17')]();});}};}function handleEntityNotFound(_0x4d87f6,_0x58d431){return function(_0x120146){if(!_0x120146){_0x4d87f6['sendStatus'](0x194);}return _0x120146;};}function handleError(_0x37b6b2,_0x3f7e9f){_0x3f7e9f=_0x3f7e9f||0x1f4;return function(_0x4d023a){logger[_0x7f5b('0x24')](_0x4d023a[_0x7f5b('0x25')]);if(_0x4d023a[_0x7f5b('0x26')]){delete _0x4d023a[_0x7f5b('0x26')];}_0x37b6b2[_0x7f5b('0x18')](_0x3f7e9f)[_0x7f5b('0x27')](_0x4d023a);};}exports[_0x7f5b('0x28')]=function(_0x1e1e1a,_0x30c38f){var _0xb68335={},_0xb4cec4={},_0x1b7e93={'count':0x0,'rows':[]};var _0x1d4fbf=_[_0x7f5b('0x29')](db[_0x7f5b('0x2a')][_0x7f5b('0x2b')],function(_0x1d9dbe){return{'name':_0x1d9dbe[_0x7f5b('0x2c')],'type':_0x1d9dbe[_0x7f5b('0x2d')][_0x7f5b('0x2e')]};});_0xb4cec4['model']=_[_0x7f5b('0x29')](_0x1d4fbf,_0x7f5b('0x26'));_0xb4cec4[_0x7f5b('0x2f')]=_[_0x7f5b('0x30')](_0x1e1e1a['query']);_0xb4cec4[_0x7f5b('0x31')]=_[_0x7f5b('0x32')](_0xb4cec4[_0x7f5b('0x33')],_0xb4cec4[_0x7f5b('0x2f')]);_0xb68335['attributes']=_['intersection'](_0xb4cec4[_0x7f5b('0x33')],qs[_0x7f5b('0x34')](_0x1e1e1a[_0x7f5b('0x2f')][_0x7f5b('0x34')]));_0xb68335[_0x7f5b('0x35')]=_0xb68335[_0x7f5b('0x35')][_0x7f5b('0x36')]?_0xb68335[_0x7f5b('0x35')]:_0xb4cec4[_0x7f5b('0x33')];if(!_0x1e1e1a[_0x7f5b('0x2f')][_0x7f5b('0x37')](_0x7f5b('0x38'))){_0xb68335['limit']=qs[_0x7f5b('0x1b')](_0x1e1e1a[_0x7f5b('0x2f')][_0x7f5b('0x1b')]);_0xb68335[_0x7f5b('0x1a')]=qs[_0x7f5b('0x1a')](_0x1e1e1a[_0x7f5b('0x2f')]['offset']);}_0xb68335[_0x7f5b('0x39')]=qs[_0x7f5b('0x3a')](_0x1e1e1a[_0x7f5b('0x2f')][_0x7f5b('0x3a')]);_0xb68335[_0x7f5b('0x3b')]=qs['filters'](_[_0x7f5b('0x3c')](_0x1e1e1a[_0x7f5b('0x2f')],_0xb4cec4[_0x7f5b('0x31')]),_0x1d4fbf);if(_0x1e1e1a[_0x7f5b('0x2f')][_0x7f5b('0x3d')]){_0xb68335[_0x7f5b('0x3b')]=_['merge'](_0xb68335[_0x7f5b('0x3b')],{'$or':_['map'](_0x1d4fbf,function(_0x3b6253){if(_0x3b6253[_0x7f5b('0x2d')]!=='VIRTUAL'){var _0x73c5ac={};_0x73c5ac[_0x3b6253[_0x7f5b('0x26')]]={'$like':'%'+_0x1e1e1a['query'][_0x7f5b('0x3d')]+'%'};return _0x73c5ac;}})});}_0xb68335=_[_0x7f5b('0x3e')]({},_0xb68335,_0x1e1e1a[_0x7f5b('0x3f')]);var _0x5263e1={'where':_0xb68335[_0x7f5b('0x3b')]};return db[_0x7f5b('0x2a')][_0x7f5b('0x1d')](_0x5263e1)[_0x7f5b('0x22')](function(_0x5574bd){_0x1b7e93['count']=_0x5574bd;if(_0x1e1e1a[_0x7f5b('0x2f')]['includeAll']){_0xb68335[_0x7f5b('0x40')]=[{'all':!![]}];}return db[_0x7f5b('0x2a')][_0x7f5b('0x41')](_0xb68335);})[_0x7f5b('0x22')](function(_0x37c9c){_0x1b7e93[_0x7f5b('0x42')]=_0x37c9c;return _0x1b7e93;})[_0x7f5b('0x22')](respondWithFilteredResult(_0x30c38f,_0xb68335))[_0x7f5b('0x43')](handleError(_0x30c38f,null));};exports[_0x7f5b('0x44')]=function(_0x3eb7fd,_0x379ff5){var _0x44c321={'raw':![],'where':{'id':_0x3eb7fd['params']['id']}},_0x22046c={};_0x22046c[_0x7f5b('0x33')]=_[_0x7f5b('0x30')](db[_0x7f5b('0x2a')]['rawAttributes']);_0x22046c['query']=_[_0x7f5b('0x30')](_0x3eb7fd['query']);_0x22046c['filters']=_['intersection'](_0x22046c['model'],_0x22046c[_0x7f5b('0x2f')]);_0x44c321[_0x7f5b('0x35')]=_[_0x7f5b('0x32')](_0x22046c[_0x7f5b('0x33')],qs[_0x7f5b('0x34')](_0x3eb7fd[_0x7f5b('0x2f')][_0x7f5b('0x34')]));_0x44c321['attributes']=_0x44c321[_0x7f5b('0x35')]['length']?_0x44c321[_0x7f5b('0x35')]:_0x22046c[_0x7f5b('0x33')];if(_0x3eb7fd[_0x7f5b('0x2f')][_0x7f5b('0x45')]){_0x44c321[_0x7f5b('0x40')]=[{'all':!![]}];}_0x44c321=_['merge']({},_0x44c321,_0x3eb7fd['options']);return db[_0x7f5b('0x2a')][_0x7f5b('0x46')](_0x44c321)[_0x7f5b('0x22')](handleEntityNotFound(_0x379ff5,null))[_0x7f5b('0x22')](respondWithResult(_0x379ff5,null))[_0x7f5b('0x43')](handleError(_0x379ff5,null));};exports[_0x7f5b('0x47')]=function(_0x2f9eeb,_0x21a857){return db[_0x7f5b('0x2a')]['create'](_0x2f9eeb[_0x7f5b('0x48')],{})[_0x7f5b('0x22')](respondWithResult(_0x21a857,0xc9))[_0x7f5b('0x43')](handleError(_0x21a857,null));};exports['update']=function(_0x1d55a9,_0x49c688){if(_0x1d55a9['body']['id']){delete _0x1d55a9[_0x7f5b('0x48')]['id'];}return db[_0x7f5b('0x2a')][_0x7f5b('0x46')]({'where':{'id':_0x1d55a9[_0x7f5b('0x49')]['id']}})['then'](handleEntityNotFound(_0x49c688,null))['then'](saveUpdates(_0x1d55a9['body'],null))[_0x7f5b('0x22')](respondWithResult(_0x49c688,null))[_0x7f5b('0x43')](handleError(_0x49c688,null));};exports['destroy']=function(_0x2c0cd4,_0x36a216){return db[_0x7f5b('0x2a')]['find']({'where':{'id':_0x2c0cd4[_0x7f5b('0x49')]['id']}})[_0x7f5b('0x22')](handleEntityNotFound(_0x36a216,null))[_0x7f5b('0x22')](removeEntity(_0x36a216,null))[_0x7f5b('0x43')](handleError(_0x36a216,null));};exports['describe']=function(_0x1c72a3,_0x26b02a){return db[_0x7f5b('0x2a')][_0x7f5b('0x4a')]()[_0x7f5b('0x22')](respondWithResult(_0x26b02a,null))[_0x7f5b('0x43')](handleError(_0x26b02a,null));}; \ No newline at end of file +var _0xb9ee=['save','update','then','destroy','error','stack','name','send','index','UserProfileSection','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','show','include','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','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','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb9ee,0x7a));var _0xeb9e=function(_0x4c06ac,_0x568788){_0x4c06ac=_0x4c06ac-0x0;var _0x2333cb=_0xb9ee[_0x4c06ac];return _0x2333cb;};'use strict';var emlformat=require(_0xeb9e('0x0'));var rimraf=require(_0xeb9e('0x1'));var zipdir=require(_0xeb9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb9e('0x3'));var moment=require(_0xeb9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeb9e('0x5'));var util=require(_0xeb9e('0x6'));var path=require(_0xeb9e('0x7'));var sox=require(_0xeb9e('0x8'));var csv=require(_0xeb9e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb9e('0xa'));var _=require(_0xeb9e('0xb'));var squel=require('squel');var crypto=require(_0xeb9e('0xc'));var jsforce=require(_0xeb9e('0xd'));var deskjs=require(_0xeb9e('0xe'));var toCsv=require(_0xeb9e('0x9'));var querystring=require('querystring');var Papa=require(_0xeb9e('0xf'));var Redis=require(_0xeb9e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xeb9e('0x11'));var as=require(_0xeb9e('0x12'));var hardwareService=require(_0xeb9e('0x13'));var logger=require(_0xeb9e('0x14'))(_0xeb9e('0x15'));var utils=require(_0xeb9e('0x16'));var config=require(_0xeb9e('0x17'));var licenseUtil=require(_0xeb9e('0x18'));var db=require(_0xeb9e('0x19'))['db'];function respondWithStatusCode(_0x113ff2,_0x346d45){_0x346d45=_0x346d45||0xcc;return function(_0x1b1082){if(_0x1b1082){return _0x113ff2[_0xeb9e('0x1a')](_0x346d45);}return _0x113ff2[_0xeb9e('0x1b')](_0x346d45)[_0xeb9e('0x1c')]();};}function respondWithResult(_0x6effe6,_0x298927){_0x298927=_0x298927||0xc8;return function(_0x5b48b7){if(_0x5b48b7){return _0x6effe6[_0xeb9e('0x1b')](_0x298927)[_0xeb9e('0x1d')](_0x5b48b7);}};}function respondWithFilteredResult(_0x5dce50,_0x161989){return function(_0x5ccac2){if(_0x5ccac2){var _0x1e4d89=typeof _0x161989['offset']==='undefined'&&typeof _0x161989[_0xeb9e('0x1e')]===_0xeb9e('0x1f');var _0x47960d=_0x5ccac2[_0xeb9e('0x20')];var _0x17fc9b=_0x1e4d89?0x0:_0x161989[_0xeb9e('0x21')];var _0x2e6fbb=_0x1e4d89?_0x5ccac2['count']:_0x161989[_0xeb9e('0x21')]+_0x161989[_0xeb9e('0x1e')];var _0x42e2e3;if(_0x2e6fbb>=_0x47960d){_0x2e6fbb=_0x47960d;_0x42e2e3=0xc8;}else{_0x42e2e3=0xce;}_0x5dce50[_0xeb9e('0x1b')](_0x42e2e3);return _0x5dce50[_0xeb9e('0x22')](_0xeb9e('0x23'),_0x17fc9b+'-'+_0x2e6fbb+'/'+_0x47960d)[_0xeb9e('0x1d')](_0x5ccac2);}return null;};}function patchUpdates(_0x26bc7e){return function(_0x4beb5e){try{jsonpatch[_0xeb9e('0x24')](_0x4beb5e,_0x26bc7e,!![]);}catch(_0x45b8d7){return BPromise[_0xeb9e('0x25')](_0x45b8d7);}return _0x4beb5e[_0xeb9e('0x26')]();};}function saveUpdates(_0x20721b,_0x507217){return function(_0x3cb4e4){if(_0x3cb4e4){return _0x3cb4e4[_0xeb9e('0x27')](_0x20721b)[_0xeb9e('0x28')](function(_0x5d72d3){return _0x5d72d3;});}return null;};}function removeEntity(_0x4e265e,_0x41e860){return function(_0x4039eb){if(_0x4039eb){return _0x4039eb[_0xeb9e('0x29')]()[_0xeb9e('0x28')](function(){_0x4e265e[_0xeb9e('0x1b')](0xcc)[_0xeb9e('0x1c')]();});}};}function handleEntityNotFound(_0x207771,_0x232ed7){return function(_0x14faf9){if(!_0x14faf9){_0x207771['sendStatus'](0x194);}return _0x14faf9;};}function handleError(_0x6db0cc,_0x3b3560){_0x3b3560=_0x3b3560||0x1f4;return function(_0x52ae01){logger[_0xeb9e('0x2a')](_0x52ae01[_0xeb9e('0x2b')]);if(_0x52ae01[_0xeb9e('0x2c')]){delete _0x52ae01[_0xeb9e('0x2c')];}_0x6db0cc[_0xeb9e('0x1b')](_0x3b3560)[_0xeb9e('0x2d')](_0x52ae01);};}exports[_0xeb9e('0x2e')]=function(_0x107906,_0x16a768){var _0x4d64b3={},_0x3c8f01={},_0x5cfffc={'count':0x0,'rows':[]};var _0x358885=_['map'](db[_0xeb9e('0x2f')][_0xeb9e('0x30')],function(_0x1fa68a){return{'name':_0x1fa68a['fieldName'],'type':_0x1fa68a[_0xeb9e('0x31')]['key']};});_0x3c8f01[_0xeb9e('0x32')]=_[_0xeb9e('0x33')](_0x358885,_0xeb9e('0x2c'));_0x3c8f01[_0xeb9e('0x34')]=_[_0xeb9e('0x35')](_0x107906[_0xeb9e('0x34')]);_0x3c8f01[_0xeb9e('0x36')]=_[_0xeb9e('0x37')](_0x3c8f01['model'],_0x3c8f01[_0xeb9e('0x34')]);_0x4d64b3[_0xeb9e('0x38')]=_[_0xeb9e('0x37')](_0x3c8f01[_0xeb9e('0x32')],qs[_0xeb9e('0x39')](_0x107906['query'][_0xeb9e('0x39')]));_0x4d64b3[_0xeb9e('0x38')]=_0x4d64b3[_0xeb9e('0x38')][_0xeb9e('0x3a')]?_0x4d64b3[_0xeb9e('0x38')]:_0x3c8f01['model'];if(!_0x107906['query'][_0xeb9e('0x3b')](_0xeb9e('0x3c'))){_0x4d64b3['limit']=qs['limit'](_0x107906[_0xeb9e('0x34')]['limit']);_0x4d64b3['offset']=qs[_0xeb9e('0x21')](_0x107906['query'][_0xeb9e('0x21')]);}_0x4d64b3[_0xeb9e('0x3d')]=qs['sort'](_0x107906['query'][_0xeb9e('0x3e')]);_0x4d64b3['where']=qs[_0xeb9e('0x36')](_[_0xeb9e('0x3f')](_0x107906[_0xeb9e('0x34')],_0x3c8f01[_0xeb9e('0x36')]),_0x358885);if(_0x107906['query']['filter']){_0x4d64b3['where']=_[_0xeb9e('0x40')](_0x4d64b3[_0xeb9e('0x41')],{'$or':_['map'](_0x358885,function(_0x3872af){if(_0x3872af[_0xeb9e('0x31')]!==_0xeb9e('0x42')){var _0x1db46b={};_0x1db46b[_0x3872af[_0xeb9e('0x2c')]]={'$like':'%'+_0x107906[_0xeb9e('0x34')][_0xeb9e('0x43')]+'%'};return _0x1db46b;}})});}_0x4d64b3=_['merge']({},_0x4d64b3,_0x107906[_0xeb9e('0x44')]);var _0x592798={'where':_0x4d64b3['where']};return db[_0xeb9e('0x2f')][_0xeb9e('0x20')](_0x592798)['then'](function(_0x2ccc98){_0x5cfffc[_0xeb9e('0x20')]=_0x2ccc98;if(_0x107906[_0xeb9e('0x34')][_0xeb9e('0x45')]){_0x4d64b3['include']=[{'all':!![]}];}return db[_0xeb9e('0x2f')][_0xeb9e('0x46')](_0x4d64b3);})[_0xeb9e('0x28')](function(_0x5ca452){_0x5cfffc[_0xeb9e('0x47')]=_0x5ca452;return _0x5cfffc;})[_0xeb9e('0x28')](respondWithFilteredResult(_0x16a768,_0x4d64b3))['catch'](handleError(_0x16a768,null));};exports[_0xeb9e('0x48')]=function(_0x30c5c5,_0x59f518){var _0x35b676={'raw':![],'where':{'id':_0x30c5c5['params']['id']}},_0x4c0ceb={};_0x4c0ceb[_0xeb9e('0x32')]=_[_0xeb9e('0x35')](db[_0xeb9e('0x2f')][_0xeb9e('0x30')]);_0x4c0ceb[_0xeb9e('0x34')]=_[_0xeb9e('0x35')](_0x30c5c5[_0xeb9e('0x34')]);_0x4c0ceb[_0xeb9e('0x36')]=_[_0xeb9e('0x37')](_0x4c0ceb['model'],_0x4c0ceb[_0xeb9e('0x34')]);_0x35b676[_0xeb9e('0x38')]=_[_0xeb9e('0x37')](_0x4c0ceb[_0xeb9e('0x32')],qs[_0xeb9e('0x39')](_0x30c5c5[_0xeb9e('0x34')][_0xeb9e('0x39')]));_0x35b676[_0xeb9e('0x38')]=_0x35b676[_0xeb9e('0x38')][_0xeb9e('0x3a')]?_0x35b676[_0xeb9e('0x38')]:_0x4c0ceb['model'];if(_0x30c5c5[_0xeb9e('0x34')][_0xeb9e('0x45')]){_0x35b676[_0xeb9e('0x49')]=[{'all':!![]}];}_0x35b676=_[_0xeb9e('0x40')]({},_0x35b676,_0x30c5c5[_0xeb9e('0x44')]);return db['UserProfileSection'][_0xeb9e('0x4a')](_0x35b676)['then'](handleEntityNotFound(_0x59f518,null))[_0xeb9e('0x28')](respondWithResult(_0x59f518,null))['catch'](handleError(_0x59f518,null));};exports['create']=function(_0x41713a,_0xf3ff1b){return db[_0xeb9e('0x2f')][_0xeb9e('0x4b')](_0x41713a[_0xeb9e('0x4c')],{})['then'](respondWithResult(_0xf3ff1b,0xc9))[_0xeb9e('0x4d')](handleError(_0xf3ff1b,null));};exports[_0xeb9e('0x27')]=function(_0x339fd7,_0x48d215){if(_0x339fd7[_0xeb9e('0x4c')]['id']){delete _0x339fd7[_0xeb9e('0x4c')]['id'];}return db[_0xeb9e('0x2f')][_0xeb9e('0x4a')]({'where':{'id':_0x339fd7['params']['id']}})['then'](handleEntityNotFound(_0x48d215,null))['then'](saveUpdates(_0x339fd7['body'],null))[_0xeb9e('0x28')](respondWithResult(_0x48d215,null))[_0xeb9e('0x4d')](handleError(_0x48d215,null));};exports[_0xeb9e('0x29')]=function(_0x3bc147,_0x36f58d){return db[_0xeb9e('0x2f')][_0xeb9e('0x4a')]({'where':{'id':_0x3bc147[_0xeb9e('0x4e')]['id']}})[_0xeb9e('0x28')](handleEntityNotFound(_0x36f58d,null))['then'](removeEntity(_0x36f58d,null))[_0xeb9e('0x4d')](handleError(_0x36f58d,null));};exports[_0xeb9e('0x4f')]=function(_0x17c575,_0x332dbd){return db[_0xeb9e('0x2f')][_0xeb9e('0x4f')]()[_0xeb9e('0x28')](respondWithResult(_0x332dbd,null))[_0xeb9e('0x4d')](handleError(_0x332dbd,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 7b3a595..7b5398d 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 _0xe30f=['./userProfileSection.attributes','define','UserProfileSection','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xe30f,0xe2));var _0xfe30=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe30f[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xfe30('0x0'));var util=require(_0xfe30('0x1'));var logger=require(_0xfe30('0x2'))(_0xfe30('0x3'));var moment=require(_0xfe30('0x4'));var BPromise=require('bluebird');var rp=require(_0xfe30('0x5'));var fs=require('fs');var path=require(_0xfe30('0x6'));var rimraf=require('rimraf');var config=require(_0xfe30('0x7'));var attributes=require(_0xfe30('0x8'));module['exports']=function(_0x586de1,_0x2fafbf){return _0x586de1[_0xfe30('0x9')](_0xfe30('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xfe30('0xb'),_0xfe30('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbdb0=['../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x5b6fe5,_0x5ddf47){var _0x5928d4=function(_0x3e0846){while(--_0x3e0846){_0x5b6fe5['push'](_0x5b6fe5['shift']());}};_0x5928d4(++_0x5ddf47);}(_0xbdb0,0x165));var _0x0bdb=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xbdb0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0bdb('0x0'));var util=require(_0x0bdb('0x1'));var logger=require('../../config/logger')(_0x0bdb('0x2'));var moment=require(_0x0bdb('0x3'));var BPromise=require(_0x0bdb('0x4'));var rp=require(_0x0bdb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0bdb('0x6'));var config=require(_0x0bdb('0x7'));var attributes=require(_0x0bdb('0x8'));module[_0x0bdb('0x9')]=function(_0x42161b,_0x56b99c){return _0x42161b['define'](_0x0bdb('0xa'),attributes,{'tableName':_0x0bdb('0xb'),'paranoid':![],'indexes':[{'name':_0x0bdb('0xc'),'fields':[_0x0bdb('0xd'),'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 73cbf05..a849862 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 _0x0c52=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','code','error','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x126f9b,_0x499df7){var _0x5983b7=function(_0x394e5a){while(--_0x394e5a){_0x126f9b['push'](_0x126f9b['shift']());}};_0x5983b7(++_0x499df7);}(_0x0c52,0x170));var _0x20c5=function(_0x168887,_0xcbcdf4){_0x168887=_0x168887-0x0;var _0x14cdce=_0x0c52[_0x168887];return _0x14cdce;};'use strict';var _=require(_0x20c5('0x0'));var util=require(_0x20c5('0x1'));var moment=require(_0x20c5('0x2'));var BPromise=require(_0x20c5('0x3'));var rs=require(_0x20c5('0x4'));var fs=require('fs');var Redis=require(_0x20c5('0x5'));var db=require(_0x20c5('0x6'))['db'];var utils=require(_0x20c5('0x7'));var logger=require(_0x20c5('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x20c5('0x9'));var client=jayson[_0x20c5('0xa')][_0x20c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c0c16,_0x1f79f1,_0x3236da){return new BPromise(function(_0xe7b226,_0x44f280){return client[_0x20c5('0xc')](_0x5c0c16,_0x3236da)['then'](function(_0x595d2e){logger[_0x20c5('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x1f79f1,_0x20c5('0xe'));logger[_0x20c5('0xf')](_0x20c5('0x10'),_0x1f79f1,_0x20c5('0xe'),JSON[_0x20c5('0x11')](_0x595d2e));if(_0x595d2e['error']){if(_0x595d2e['error'][_0x20c5('0x12')]===0x1f4){logger[_0x20c5('0x13')](_0x20c5('0x14'),_0x1f79f1,_0x595d2e['error'][_0x20c5('0x15')]);return _0x44f280(_0x595d2e[_0x20c5('0x13')][_0x20c5('0x15')]);}logger[_0x20c5('0x13')](_0x20c5('0x14'),_0x1f79f1,_0x595d2e[_0x20c5('0x13')][_0x20c5('0x15')]);return _0xe7b226(_0x595d2e[_0x20c5('0x13')][_0x20c5('0x15')]);}else{logger[_0x20c5('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x1f79f1,_0x20c5('0xe'));_0xe7b226(_0x595d2e[_0x20c5('0x16')][_0x20c5('0x15')]);}})[_0x20c5('0x17')](function(_0x41ad22){logger[_0x20c5('0x13')](_0x20c5('0x14'),_0x1f79f1,_0x41ad22);_0x44f280(_0x41ad22);});});} \ No newline at end of file +var _0x8f57=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x8f57,0xfb));var _0x78f5=function(_0x48eb11,_0x2a697c){_0x48eb11=_0x48eb11-0x0;var _0x2b1a9c=_0x8f57[_0x48eb11];return _0x2b1a9c;};'use strict';var _=require(_0x78f5('0x0'));var util=require(_0x78f5('0x1'));var moment=require(_0x78f5('0x2'));var BPromise=require(_0x78f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78f5('0x4'));var db=require(_0x78f5('0x5'))['db'];var utils=require(_0x78f5('0x6'));var logger=require('../../config/logger')(_0x78f5('0x7'));var config=require(_0x78f5('0x8'));var jayson=require(_0x78f5('0x9'));var client=jayson[_0x78f5('0xa')][_0x78f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x413513,_0x2eefbc,_0x353d21){return new BPromise(function(_0x3de497,_0x54180c){return client[_0x78f5('0xc')](_0x413513,_0x353d21)[_0x78f5('0xd')](function(_0x43cdcc){logger[_0x78f5('0xe')](_0x78f5('0xf'),_0x2eefbc,_0x78f5('0x10'));logger['debug'](_0x78f5('0x11'),_0x2eefbc,'request\x20sent',JSON[_0x78f5('0x12')](_0x43cdcc));if(_0x43cdcc[_0x78f5('0x13')]){if(_0x43cdcc[_0x78f5('0x13')]['code']===0x1f4){logger['error'](_0x78f5('0xf'),_0x2eefbc,_0x43cdcc['error'][_0x78f5('0x14')]);return _0x54180c(_0x43cdcc[_0x78f5('0x13')][_0x78f5('0x14')]);}logger[_0x78f5('0x13')](_0x78f5('0xf'),_0x2eefbc,_0x43cdcc[_0x78f5('0x13')][_0x78f5('0x14')]);return _0x3de497(_0x43cdcc['error'][_0x78f5('0x14')]);}else{logger['info'](_0x78f5('0xf'),_0x2eefbc,_0x78f5('0x10'));_0x3de497(_0x43cdcc[_0x78f5('0x15')]['message']);}})[_0x78f5('0x16')](function(_0x39eac1){logger['error'](_0x78f5('0xf'),_0x2eefbc,_0x39eac1);_0x54180c(_0x39eac1);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 5454c88..7996b8b 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4bc50e,_0x337339){var _0x5a8722=function(_0x52351d){while(--_0x52351d){_0x4bc50e['push'](_0x4bc50e['shift']());}};_0x5a8722(++_0x337339);}(_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(_0x52d5df,_0x3a6baa){var _0x374a89=function(_0x168536){while(--_0x168536){_0x52d5df['push'](_0x52d5df['shift']());}};_0x374a89(++_0x3a6baa);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index ce8bd88..90158e4 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 _0xe187=['INTEGER','sequelize','exports'];(function(_0x1d8c9b,_0x3ff0e4){var _0x275871=function(_0x28f890){while(--_0x28f890){_0x1d8c9b['push'](_0x1d8c9b['shift']());}};_0x275871(++_0x3ff0e4);}(_0xe187,0x19c));var _0x7e18=function(_0x216dbf,_0x1e7940){_0x216dbf=_0x216dbf-0x0;var _0x33552e=_0xe187[_0x216dbf];return _0x33552e;};'use strict';var Sequelize=require(_0x7e18('0x0'));module[_0x7e18('0x1')]={'penalty':{'type':Sequelize[_0x7e18('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x13ff=['sequelize','INTEGER'];(function(_0x178cc1,_0xbf86e0){var _0x17459e=function(_0x5eaf49){while(--_0x5eaf49){_0x178cc1['push'](_0x178cc1['shift']());}};_0x17459e(++_0xbf86e0);}(_0x13ff,0xe6));var _0xf13f=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x13ff[_0x5317b5];return _0x3b7ce2;};'use strict';var Sequelize=require(_0xf13f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf13f('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 b109c3e..907d527 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 _0x2581=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x5b557f,_0x1d5080){var _0x1ae321=function(_0x3bf249){while(--_0x3bf249){_0x5b557f['push'](_0x5b557f['shift']());}};_0x1ae321(++_0x1d5080);}(_0x2581,0xcb));var _0x1258=function(_0x2e2180,_0x18ddd6){_0x2e2180=_0x2e2180-0x0;var _0x34c484=_0x2581[_0x2e2180];return _0x34c484;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var logger=require(_0x1258('0x2'))(_0x1258('0x3'));var moment=require(_0x1258('0x4'));var BPromise=require('bluebird');var rp=require(_0x1258('0x5'));var fs=require('fs');var path=require(_0x1258('0x6'));var rimraf=require(_0x1258('0x7'));var config=require(_0x1258('0x8'));var attributes=require(_0x1258('0x9'));module[_0x1258('0xa')]=function(_0x16c926,_0x2aeafc){return _0x16c926['define'](_0x1258('0xb'),attributes,{'tableName':_0x1258('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7880=['../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2db0f5,_0x4f0409){var _0x376493=function(_0x3ae9d8){while(--_0x3ae9d8){_0x2db0f5['push'](_0x2db0f5['shift']());}};_0x376493(++_0x4f0409);}(_0x7880,0x1f4));var _0x0788=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x7880[_0x4cbf20];return _0x582ae4;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));module[_0x0788('0x9')]=function(_0x262f5c,_0x775629){return _0x262f5c[_0x0788('0xa')](_0x0788('0xb'),attributes,{'tableName':_0x0788('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 4322dc6..5384266 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 _0xb749=['client','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1a417e,_0x298a2a){var _0x2d8919=function(_0x4e6808){while(--_0x4e6808){_0x1a417e['push'](_0x1a417e['shift']());}};_0x2d8919(++_0x298a2a);}(_0xb749,0x124));var _0x9b74=function(_0x2bedee,_0x159687){_0x2bedee=_0x2bedee-0x0;var _0x3dff30=_0xb749[_0x2bedee];return _0x3dff30;};'use strict';var _=require(_0x9b74('0x0'));var util=require('util');var moment=require(_0x9b74('0x1'));var BPromise=require('bluebird');var rs=require(_0x9b74('0x2'));var fs=require('fs');var Redis=require(_0x9b74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b74('0x4'));var logger=require(_0x9b74('0x5'))(_0x9b74('0x6'));var config=require(_0x9b74('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9b74('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42cbb0,_0x2392fc,_0x428478){return new BPromise(function(_0x17af9b,_0x11d6a4){return client[_0x9b74('0x9')](_0x42cbb0,_0x428478)['then'](function(_0x4f83cc){logger[_0x9b74('0xa')](_0x9b74('0xb'),_0x2392fc,_0x9b74('0xc'));logger[_0x9b74('0xd')](_0x9b74('0xe'),_0x2392fc,_0x9b74('0xc'),JSON[_0x9b74('0xf')](_0x4f83cc));if(_0x4f83cc['error']){if(_0x4f83cc[_0x9b74('0x10')]['code']===0x1f4){logger[_0x9b74('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x2392fc,_0x4f83cc[_0x9b74('0x10')][_0x9b74('0x11')]);return _0x11d6a4(_0x4f83cc[_0x9b74('0x10')][_0x9b74('0x11')]);}logger[_0x9b74('0x10')](_0x9b74('0xb'),_0x2392fc,_0x4f83cc[_0x9b74('0x10')][_0x9b74('0x11')]);return _0x17af9b(_0x4f83cc[_0x9b74('0x10')]['message']);}else{logger[_0x9b74('0xa')](_0x9b74('0xb'),_0x2392fc,_0x9b74('0xc'));_0x17af9b(_0x4f83cc[_0x9b74('0x12')]['message']);}})[_0x9b74('0x13')](function(_0x430b92){logger['error'](_0x9b74('0xb'),_0x2392fc,_0x430b92);_0x11d6a4(_0x430b92);});});} \ No newline at end of file +var _0xaee7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis'];(function(_0x28e845,_0x363b75){var _0x1f6a57=function(_0x5e7f50){while(--_0x5e7f50){_0x28e845['push'](_0x28e845['shift']());}};_0x1f6a57(++_0x363b75);}(_0xaee7,0x9d));var _0x7aee=function(_0x2fa6c3,_0x5ec2b7){_0x2fa6c3=_0x2fa6c3-0x0;var _0xedce18=_0xaee7[_0x2fa6c3];return _0xedce18;};'use strict';var _=require('lodash');var util=require(_0x7aee('0x0'));var moment=require(_0x7aee('0x1'));var BPromise=require(_0x7aee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7aee('0x3'));var db=require(_0x7aee('0x4'))['db'];var utils=require(_0x7aee('0x5'));var logger=require(_0x7aee('0x6'))(_0x7aee('0x7'));var config=require(_0x7aee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7aee('0x9')][_0x7aee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bcc5c,_0xc29be2,_0x5cb338){return new BPromise(function(_0x49f2e0,_0xace48c){return client[_0x7aee('0xb')](_0x4bcc5c,_0x5cb338)[_0x7aee('0xc')](function(_0x500d1d){logger[_0x7aee('0xd')](_0x7aee('0xe'),_0xc29be2,_0x7aee('0xf'));logger[_0x7aee('0x10')](_0x7aee('0x11'),_0xc29be2,_0x7aee('0xf'),JSON[_0x7aee('0x12')](_0x500d1d));if(_0x500d1d[_0x7aee('0x13')]){if(_0x500d1d[_0x7aee('0x13')][_0x7aee('0x14')]===0x1f4){logger[_0x7aee('0x13')](_0x7aee('0xe'),_0xc29be2,_0x500d1d['error'][_0x7aee('0x15')]);return _0xace48c(_0x500d1d[_0x7aee('0x13')][_0x7aee('0x15')]);}logger[_0x7aee('0x13')](_0x7aee('0xe'),_0xc29be2,_0x500d1d['error']['message']);return _0x49f2e0(_0x500d1d[_0x7aee('0x13')][_0x7aee('0x15')]);}else{logger[_0x7aee('0xd')](_0x7aee('0xe'),_0xc29be2,_0x7aee('0xf'));_0x49f2e0(_0x500d1d[_0x7aee('0x16')][_0x7aee('0x15')]);}})['catch'](function(_0x5a701b){logger[_0x7aee('0x13')](_0x7aee('0xe'),_0xc29be2,_0x5a701b);_0xace48c(_0x5a701b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index a8aea6e..39d57cf 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(_0x4346ba,_0x1d5a07){var _0x55742b=function(_0x5bb78a){while(--_0x5bb78a){_0x4346ba['push'](_0x4346ba['shift']());}};_0x55742b(++_0x1d5a07);}(_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(_0x9da774,_0x5a9d80){var _0x49cfdd=function(_0x32d958){while(--_0x32d958){_0x9da774['push'](_0x9da774['shift']());}};_0x49cfdd(++_0x5a9d80);}(_0xedd9,0xfc));var _0x9edd=function(_0x49ffb4,_0x5150b6){_0x49ffb4=_0x49ffb4-0x0;var _0x16259e=_0xedd9[_0x49ffb4];return _0x16259e;};'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 a4ce067..a56f4bb 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 _0xcc7a=['sequelize'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xcc7a,0x1e0));var _0xacc7=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0xcc7a[_0x403fc7];return _0x5d0827;};'use strict';var Sequelize=require(_0xacc7('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc4b6=['exports','INTEGER'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xc4b6,0x1b8));var _0x6c4b=function(_0x734cd4,_0x48841b){_0x734cd4=_0x734cd4-0x0;var _0xcc66ad=_0xc4b6[_0x734cd4];return _0xcc66ad;};'use strict';var Sequelize=require('sequelize');module[_0x6c4b('0x0')]={'penalty':{'type':Sequelize[_0x6c4b('0x1')],'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 d348ecb..1108c5c 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 _0x33ed=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x24daee,_0x14a997){var _0x1ceaad=function(_0x121e74){while(--_0x121e74){_0x24daee['push'](_0x24daee['shift']());}};_0x1ceaad(++_0x14a997);}(_0x33ed,0xc9));var _0xd33e=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0x33ed[_0x2fdf82];return _0x2382f5;};'use strict';var _=require(_0xd33e('0x0'));var util=require(_0xd33e('0x1'));var logger=require('../../config/logger')(_0xd33e('0x2'));var moment=require(_0xd33e('0x3'));var BPromise=require(_0xd33e('0x4'));var rp=require(_0xd33e('0x5'));var fs=require('fs');var path=require(_0xd33e('0x6'));var rimraf=require(_0xd33e('0x7'));var config=require(_0xd33e('0x8'));var attributes=require(_0xd33e('0x9'));module[_0xd33e('0xa')]=function(_0x22e947,_0x5740a8){return _0x22e947[_0xd33e('0xb')](_0xd33e('0xc'),attributes,{'tableName':_0xd33e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd816=['api','moment','request-promise','rimraf','exports','define','UserVoiceQueue','lodash','util','../../config/logger'];(function(_0x28ac0e,_0x1b2592){var _0x10a35e=function(_0x205382){while(--_0x205382){_0x28ac0e['push'](_0x28ac0e['shift']());}};_0x10a35e(++_0x1b2592);}(_0xd816,0x1c9));var _0x6d81=function(_0x2e20de,_0x18b8ed){_0x2e20de=_0x2e20de-0x0;var _0x2d365e=_0xd816[_0x2e20de];return _0x2d365e;};'use strict';var _=require(_0x6d81('0x0'));var util=require(_0x6d81('0x1'));var logger=require(_0x6d81('0x2'))(_0x6d81('0x3'));var moment=require(_0x6d81('0x4'));var BPromise=require('bluebird');var rp=require(_0x6d81('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d81('0x6'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0x6d81('0x7')]=function(_0x2b36b2,_0x2c34af){return _0x2b36b2[_0x6d81('0x8')](_0x6d81('0x9'),attributes,{'tableName':'user_has_voice_queues','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 35066c8..a2c477f 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 _0x19d6=['code','message','info','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x19d6,0x1f2));var _0x619d=function(_0x5df2a2,_0x43e8af){_0x5df2a2=_0x5df2a2-0x0;var _0x1ea859=_0x19d6[_0x5df2a2];return _0x1ea859;};'use strict';var _=require('lodash');var util=require(_0x619d('0x0'));var moment=require(_0x619d('0x1'));var BPromise=require(_0x619d('0x2'));var rs=require(_0x619d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x619d('0x4'));var logger=require(_0x619d('0x5'))(_0x619d('0x6'));var config=require(_0x619d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x619d('0x8')][_0x619d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x307d9e,_0x2eaa3b,_0xe2dd9d){return new BPromise(function(_0x2a3770,_0x39e60a){return client['request'](_0x307d9e,_0xe2dd9d)[_0x619d('0xa')](function(_0x259233){logger['info'](_0x619d('0xb'),_0x2eaa3b,_0x619d('0xc'));logger['debug'](_0x619d('0xd'),_0x2eaa3b,_0x619d('0xc'),JSON['stringify'](_0x259233));if(_0x259233[_0x619d('0xe')]){if(_0x259233[_0x619d('0xe')][_0x619d('0xf')]===0x1f4){logger[_0x619d('0xe')](_0x619d('0xb'),_0x2eaa3b,_0x259233[_0x619d('0xe')][_0x619d('0x10')]);return _0x39e60a(_0x259233['error'][_0x619d('0x10')]);}logger['error'](_0x619d('0xb'),_0x2eaa3b,_0x259233[_0x619d('0xe')][_0x619d('0x10')]);return _0x2a3770(_0x259233[_0x619d('0xe')][_0x619d('0x10')]);}else{logger[_0x619d('0x11')](_0x619d('0xb'),_0x2eaa3b,_0x619d('0xc'));_0x2a3770(_0x259233['result'][_0x619d('0x10')]);}})[_0x619d('0x12')](function(_0x338b90){logger[_0x619d('0xe')](_0x619d('0xb'),_0x2eaa3b,_0x338b90);_0x39e60a(_0x338b90);});});} \ No newline at end of file +var _0x9d76=['client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d76,0x17c));var _0x69d7=function(_0x58c414,_0x5c7e9d){_0x58c414=_0x58c414-0x0;var _0x166b9d=_0x9d76[_0x58c414];return _0x166b9d;};'use strict';var _=require(_0x69d7('0x0'));var util=require(_0x69d7('0x1'));var moment=require(_0x69d7('0x2'));var BPromise=require(_0x69d7('0x3'));var rs=require(_0x69d7('0x4'));var fs=require('fs');var Redis=require(_0x69d7('0x5'));var db=require(_0x69d7('0x6'))['db'];var utils=require(_0x69d7('0x7'));var logger=require(_0x69d7('0x8'))('rpc');var config=require(_0x69d7('0x9'));var jayson=require(_0x69d7('0xa'));var client=jayson[_0x69d7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4f90,_0x3bc4d5,_0x4ae2b1){return new BPromise(function(_0x53307c,_0x5e5e37){return client[_0x69d7('0xc')](_0x3c4f90,_0x4ae2b1)[_0x69d7('0xd')](function(_0x20f599){logger[_0x69d7('0xe')](_0x69d7('0xf'),_0x3bc4d5,'request\x20sent');logger[_0x69d7('0x10')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3bc4d5,_0x69d7('0x11'),JSON[_0x69d7('0x12')](_0x20f599));if(_0x20f599[_0x69d7('0x13')]){if(_0x20f599['error']['code']===0x1f4){logger['error'](_0x69d7('0xf'),_0x3bc4d5,_0x20f599['error'][_0x69d7('0x14')]);return _0x5e5e37(_0x20f599[_0x69d7('0x13')][_0x69d7('0x14')]);}logger[_0x69d7('0x13')](_0x69d7('0xf'),_0x3bc4d5,_0x20f599[_0x69d7('0x13')][_0x69d7('0x14')]);return _0x53307c(_0x20f599['error']['message']);}else{logger[_0x69d7('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x3bc4d5,'request\x20sent');_0x53307c(_0x20f599[_0x69d7('0x15')][_0x69d7('0x14')]);}})[_0x69d7('0x16')](function(_0x1f2596){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x3bc4d5,_0x1f2596);_0x5e5e37(_0x1f2596);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 1e6c4ad..b32a785 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5464d1,_0x5c197d){var _0x4ff61f=function(_0x2362ac){while(--_0x2362ac){_0x5464d1['push'](_0x5464d1['shift']());}};_0x4ff61f(++_0x5c197d);}(_0xe706,0xa3));var _0x6e70=function(_0x2c04d9,_0x59ec65){_0x2c04d9=_0x2c04d9-0x0;var _0x5ad09a=_0xe706[_0x2c04d9];return _0x5ad09a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x55a76a,_0x2d0203){var _0x45885a=function(_0x4348d5){while(--_0x4348d5){_0x55a76a['push'](_0x55a76a['shift']());}};_0x45885a(++_0x2d0203);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index b7453f1..d566743 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 _0x2a5b=['INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize'];(function(_0x2ab1ce,_0x1238a5){var _0xdd7d0e=function(_0x1db03a){while(--_0x1db03a){_0x2ab1ce['push'](_0x2ab1ce['shift']());}};_0xdd7d0e(++_0x1238a5);}(_0x2a5b,0x6d));var _0xb2a5=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0x2a5b[_0x382e89];return _0x3a1318;};'use strict';var Sequelize=require(_0xb2a5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xb2a5('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xb2a5('0x2')],'allowNull':![],'comment':_0xb2a5('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb2a5('0x2')],'allowNull':![],'unique':_0xb2a5('0x4'),'comment':_0xb2a5('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb2a5('0x4'),'comment':_0xb2a5('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xb2a5('0x1')](0xb),'defaultValue':0x0,'comment':_0xb2a5('0x3')}}; \ No newline at end of file +var _0xde72=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x412ed6,_0x5ac827){var _0x3883d2=function(_0x5f3380){while(--_0x5f3380){_0x412ed6['push'](_0x412ed6['shift']());}};_0x3883d2(++_0x5ac827);}(_0xde72,0x1a4));var _0x2de7=function(_0x1060d9,_0x47f741){_0x1060d9=_0x1060d9-0x0;var _0x5d71ca=_0xde72[_0x1060d9];return _0x5d71ca;};'use strict';var Sequelize=require('sequelize');module[_0x2de7('0x0')]={'uniqueid':{'type':Sequelize[_0x2de7('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x2de7('0x2')},'membername':{'type':Sequelize[_0x2de7('0x3')],'allowNull':![],'comment':_0x2de7('0x2')},'UserId':{'type':Sequelize[_0x2de7('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x2de7('0x3')],'allowNull':![],'unique':_0x2de7('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x2de7('0x2')},'paused':{'type':Sequelize[_0x2de7('0x1')](0xb),'defaultValue':0x0,'comment':_0x2de7('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 8ea365f..f267217 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 _0x60a3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','update','remove'];(function(_0x17ec07,_0xe3ca90){var _0x5a6c45=function(_0x59b715){while(--_0x59b715){_0x17ec07['push'](_0x17ec07['shift']());}};_0x5a6c45(++_0xe3ca90);}(_0x60a3,0x1d4));var _0x360a=function(_0x3502b7,_0x4c62cb){_0x3502b7=_0x3502b7-0x0;var _0x56f575=_0x60a3[_0x3502b7];return _0x56f575;};'use strict';var EventEmitter=require(_0x360a('0x0'));var UserVoiceQueueRt=require(_0x360a('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x360a('0x2'),'afterDestroy':_0x360a('0x3')};function emitEvent(_0x2ac444){return function(_0x12fdf2,_0x1f0ef4,_0x26d74a){UserVoiceQueueRtEvents['emit'](_0x2ac444+':'+_0x12fdf2['id'],_0x12fdf2);UserVoiceQueueRtEvents[_0x360a('0x4')](_0x2ac444,_0x12fdf2);_0x26d74a(null);};}for(var e in events){if(events[_0x360a('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x360a('0x6')](e,emitEvent(event));}}module[_0x360a('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xed71=['update','remove','emit','hasOwnProperty','events','../../mysqldb','UserVoiceQueueRt','save'];(function(_0x2f1433,_0x3c48d8){var _0xd6f1af=function(_0x560e28){while(--_0x560e28){_0x2f1433['push'](_0x2f1433['shift']());}};_0xd6f1af(++_0x3c48d8);}(_0xed71,0x12c));var _0x1ed7=function(_0x4a3554,_0x14f2fd){_0x4a3554=_0x4a3554-0x0;var _0x12e4cb=_0xed71[_0x4a3554];return _0x12e4cb;};'use strict';var EventEmitter=require(_0x1ed7('0x0'));var UserVoiceQueueRt=require(_0x1ed7('0x1'))['db'][_0x1ed7('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1ed7('0x3'),'afterUpdate':_0x1ed7('0x4'),'afterDestroy':_0x1ed7('0x5')};function emitEvent(_0x2b19d1){return function(_0x580bf5,_0x17ffca,_0x992648){UserVoiceQueueRtEvents[_0x1ed7('0x6')](_0x2b19d1+':'+_0x580bf5['id'],_0x580bf5);UserVoiceQueueRtEvents[_0x1ed7('0x6')](_0x2b19d1,_0x580bf5);_0x992648(null);};}for(var e in events){if(events[_0x1ed7('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index ce90d2a..4f0e4a2 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 _0xa45b=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0xa45b,0xf5));var _0xba45=function(_0x521c9,_0x4e3a2f){_0x521c9=_0x521c9-0x0;var _0x440d5c=_0xa45b[_0x521c9];return _0x440d5c;};'use strict';var _=require(_0xba45('0x0'));var util=require(_0xba45('0x1'));var logger=require(_0xba45('0x2'))(_0xba45('0x3'));var moment=require(_0xba45('0x4'));var BPromise=require(_0xba45('0x5'));var rp=require(_0xba45('0x6'));var fs=require('fs');var path=require(_0xba45('0x7'));var rimraf=require(_0xba45('0x8'));var config=require(_0xba45('0x9'));var attributes=require(_0xba45('0xa'));module[_0xba45('0xb')]=function(_0x1eee9d,_0x24891e){return _0x1eee9d[_0xba45('0xc')](_0xba45('0xd'),attributes,{'tableName':_0xba45('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf47=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','util'];(function(_0x27d8a2,_0x3700ef){var _0x299b7c=function(_0x34d5f9){while(--_0x34d5f9){_0x27d8a2['push'](_0x27d8a2['shift']());}};_0x299b7c(++_0x3700ef);}(_0xaf47,0xaf));var _0x7af4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf47[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7af4('0x0'));var logger=require(_0x7af4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7af4('0x2'));var rp=require(_0x7af4('0x3'));var fs=require('fs');var path=require(_0x7af4('0x4'));var rimraf=require(_0x7af4('0x5'));var config=require(_0x7af4('0x6'));var attributes=require(_0x7af4('0x7'));module[_0x7af4('0x8')]=function(_0x986752,_0x284894){return _0x986752[_0x7af4('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0x7af4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 1d80f3e..c56a10e 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 _0xd116=['error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','register','then','info','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x55822a,_0x65d1c7){var _0x246596=function(_0x5fe383){while(--_0x5fe383){_0x55822a['push'](_0x55822a['shift']());}};_0x246596(++_0x65d1c7);}(_0xd116,0x7c));var _0x6d11=function(_0x147cca,_0x4c900c){_0x147cca=_0x147cca-0x0;var _0x4fe2c4=_0xd116[_0x147cca];return _0x4fe2c4;};'use strict';var _=require(_0x6d11('0x0'));var util=require('util');var moment=require(_0x6d11('0x1'));var BPromise=require(_0x6d11('0x2'));var rs=require(_0x6d11('0x3'));var fs=require('fs');var Redis=require(_0x6d11('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d11('0x5'));var logger=require(_0x6d11('0x6'))(_0x6d11('0x7'));var config=require(_0x6d11('0x8'));var jayson=require(_0x6d11('0x9'));var client=jayson[_0x6d11('0xa')]['http']({'port':0x232a});config[_0x6d11('0xb')]=_['defaults'](config[_0x6d11('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d11('0xc'))(new Redis(config[_0x6d11('0xb')]));require('./userVoiceQueueRt.socket')[_0x6d11('0xd')](socket);function respondWithRpcPromise(_0x39920d,_0x3b41c2,_0x52c414){return new BPromise(function(_0x383d8c,_0x2d503b){return client['request'](_0x39920d,_0x52c414)[_0x6d11('0xe')](function(_0x2bd918){logger[_0x6d11('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3b41c2,'request\x20sent');logger[_0x6d11('0x10')](_0x6d11('0x11'),_0x3b41c2,_0x6d11('0x12'),JSON[_0x6d11('0x13')](_0x2bd918));if(_0x2bd918[_0x6d11('0x14')]){if(_0x2bd918['error'][_0x6d11('0x15')]===0x1f4){logger[_0x6d11('0x14')](_0x6d11('0x16'),_0x3b41c2,_0x2bd918[_0x6d11('0x14')][_0x6d11('0x17')]);return _0x2d503b(_0x2bd918[_0x6d11('0x14')][_0x6d11('0x17')]);}logger['error'](_0x6d11('0x16'),_0x3b41c2,_0x2bd918[_0x6d11('0x14')]['message']);return _0x383d8c(_0x2bd918[_0x6d11('0x14')][_0x6d11('0x17')]);}else{logger[_0x6d11('0xf')](_0x6d11('0x16'),_0x3b41c2,'request\x20sent');_0x383d8c(_0x2bd918[_0x6d11('0x18')][_0x6d11('0x17')]);}})['catch'](function(_0x48afc4){logger['error'](_0x6d11('0x16'),_0x3b41c2,_0x48afc4);_0x2d503b(_0x48afc4);});});}exports[_0x6d11('0x19')]=function(_0x5aa1cd){var _0x21eebf=this;return new Promise(function(_0x2401a6,_0x50fc5f){return db[_0x6d11('0x1a')][_0x6d11('0x1b')]({'raw':_0x5aa1cd[_0x6d11('0x1c')]?_0x5aa1cd[_0x6d11('0x1c')][_0x6d11('0x1d')]===undefined?!![]:![]:!![],'where':_0x5aa1cd[_0x6d11('0x1c')]?_0x5aa1cd[_0x6d11('0x1c')][_0x6d11('0x1e')]||null:null,'attributes':[[db[_0x6d11('0x1f')]['fn'](_0x6d11('0x20'),db['sequelize']['fn']('IF',db[_0x6d11('0x1f')][_0x6d11('0x21')](_0x6d11('0x22')))),_0x6d11('0x23')]]})[_0x6d11('0xe')](function(_0x2010d7){logger[_0x6d11('0xf')](_0x6d11('0x19'),_0x5aa1cd);logger[_0x6d11('0x10')](_0x6d11('0x19'),_0x5aa1cd,JSON['stringify'](_0x2010d7));_0x2401a6(_0x2010d7);})['catch'](function(_0x31b4a0){logger['error'](_0x6d11('0x19'),_0x31b4a0[_0x6d11('0x17')],_0x5aa1cd);_0x50fc5f(_0x21eebf[_0x6d11('0x14')](0x1f4,_0x31b4a0[_0x6d11('0x17')]));});});}; \ No newline at end of file +var _0xf308=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','util','moment','bluebird'];(function(_0x4de246,_0x5bdf27){var _0x24c4a8=function(_0x33edd4){while(--_0x33edd4){_0x4de246['push'](_0x4de246['shift']());}};_0x24c4a8(++_0x5bdf27);}(_0xf308,0x68));var _0x8f30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf308[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8f30('0x0'));var util=require(_0x8f30('0x1'));var moment=require(_0x8f30('0x2'));var BPromise=require(_0x8f30('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f30('0x4'))['db'];var utils=require(_0x8f30('0x5'));var logger=require('../../config/logger')(_0x8f30('0x6'));var config=require(_0x8f30('0x7'));var jayson=require(_0x8f30('0x8'));var client=jayson[_0x8f30('0x9')][_0x8f30('0xa')]({'port':0x232a});config[_0x8f30('0xb')]=_[_0x8f30('0xc')](config[_0x8f30('0xb')],{'host':_0x8f30('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f30('0xb')]));require(_0x8f30('0xe'))['register'](socket);function respondWithRpcPromise(_0x3749b8,_0x475cc6,_0x11f0df){return new BPromise(function(_0x1d6aa9,_0x19821d){return client[_0x8f30('0xf')](_0x3749b8,_0x11f0df)[_0x8f30('0x10')](function(_0x453070){logger['info'](_0x8f30('0x11'),_0x475cc6,_0x8f30('0x12'));logger['debug'](_0x8f30('0x13'),_0x475cc6,'request\x20sent',JSON[_0x8f30('0x14')](_0x453070));if(_0x453070[_0x8f30('0x15')]){if(_0x453070[_0x8f30('0x15')][_0x8f30('0x16')]===0x1f4){logger[_0x8f30('0x15')](_0x8f30('0x11'),_0x475cc6,_0x453070[_0x8f30('0x15')]['message']);return _0x19821d(_0x453070['error']['message']);}logger[_0x8f30('0x15')](_0x8f30('0x11'),_0x475cc6,_0x453070['error'][_0x8f30('0x17')]);return _0x1d6aa9(_0x453070['error'][_0x8f30('0x17')]);}else{logger[_0x8f30('0x18')](_0x8f30('0x11'),_0x475cc6,_0x8f30('0x12'));_0x1d6aa9(_0x453070[_0x8f30('0x19')]['message']);}})[_0x8f30('0x1a')](function(_0x1ce9c9){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x475cc6,_0x1ce9c9);_0x19821d(_0x1ce9c9);});});}exports[_0x8f30('0x1b')]=function(_0x5852a0){var _0x59334b=this;return new Promise(function(_0x3fc0af,_0x5e7031){return db[_0x8f30('0x1c')][_0x8f30('0x1d')]({'raw':_0x5852a0[_0x8f30('0x1e')]?_0x5852a0['options'][_0x8f30('0x1f')]===undefined?!![]:![]:!![],'where':_0x5852a0[_0x8f30('0x1e')]?_0x5852a0[_0x8f30('0x1e')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x8f30('0x20')]['fn']('IF',db[_0x8f30('0x20')]['literal'](_0x8f30('0x21')))),_0x8f30('0x22')]]})[_0x8f30('0x10')](function(_0x54d7bf){logger[_0x8f30('0x18')]('GetVoiceQueueRtPauses',_0x5852a0);logger[_0x8f30('0x23')]('GetVoiceQueueRtPauses',_0x5852a0,JSON[_0x8f30('0x14')](_0x54d7bf));_0x3fc0af(_0x54d7bf);})[_0x8f30('0x1a')](function(_0x19bdb8){logger[_0x8f30('0x15')](_0x8f30('0x1b'),_0x19bdb8['message'],_0x5852a0);_0x5e7031(_0x59334b[_0x8f30('0x15')](0x1f4,_0x19bdb8[_0x8f30('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 9735424..efc1c08 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 _0x3d49=['userVoiceQueueRt:','save','remove','update','emit','removeListener','register'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x3d49,0x151));var _0x93d4=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x3d49[_0x408e38];return _0x426b0e;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x93d4('0x0'),_0x93d4('0x1'),_0x93d4('0x2')];function createListener(_0xcf6e4f,_0x547ab9){return function(_0x571d2c){_0x547ab9[_0x93d4('0x3')](_0xcf6e4f,_0x571d2c);};}function removeListener(_0xa1de2e,_0x41313a){return function(){UserVoiceQueueRtEvents[_0x93d4('0x4')](_0xa1de2e,_0x41313a);};}exports[_0x93d4('0x5')]=function(_0x4b91a8){for(var _0x577079=0x0,_0x4bee9d=events['length'];_0x577079<_0x4bee9d;_0x577079++){var _0x50c533=events[_0x577079];var _0x4c96b7=createListener(_0x93d4('0x6')+_0x50c533,_0x4b91a8);UserVoiceQueueRtEvents['on'](_0x50c533,_0x4c96b7);}}; \ No newline at end of file +var _0x0650=['./userVoiceQueueRt.events','save','remove','update','removeListener','userVoiceQueueRt:'];(function(_0x2cfd1e,_0x4dfc49){var _0x2e6e33=function(_0x2a1cd9){while(--_0x2a1cd9){_0x2cfd1e['push'](_0x2cfd1e['shift']());}};_0x2e6e33(++_0x4dfc49);}(_0x0650,0x1aa));var _0x0065=function(_0x62ff29,_0x5b5d4c){_0x62ff29=_0x62ff29-0x0;var _0x63583b=_0x0650[_0x62ff29];return _0x63583b;};'use strict';var UserVoiceQueueRtEvents=require(_0x0065('0x0'));var events=[_0x0065('0x1'),_0x0065('0x2'),_0x0065('0x3')];function createListener(_0x4e8ee5,_0x19fb0e){return function(_0x5d831c){_0x19fb0e['emit'](_0x4e8ee5,_0x5d831c);};}function removeListener(_0x1798d6,_0xe2785){return function(){UserVoiceQueueRtEvents[_0x0065('0x4')](_0x1798d6,_0xe2785);};}exports['register']=function(_0x4aab3a){for(var _0x456a74=0x0,_0x5792dc=events['length'];_0x456a74<_0x5792dc;_0x456a74++){var _0x49d04d=events[_0x456a74];var _0x576ca0=createListener(_0x0065('0x5')+_0x49d04d,_0x4aab3a);UserVoiceQueueRtEvents['on'](_0x49d04d,_0x576ca0);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 38a03c8..331058f 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x18a246,_0x5e7f4b){var _0x268977=function(_0x5cf902){while(--_0x5cf902){_0x18a246['push'](_0x18a246['shift']());}};_0x268977(++_0x5e7f4b);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2f9cdb,_0x11aed7){var _0x233491=function(_0x5bcbf4){while(--_0x5bcbf4){_0x2f9cdb['push'](_0x2f9cdb['shift']());}};_0x233491(++_0x11aed7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0xcb91[_0x5cbf0e];return _0x1c76f8;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index e536d5a..9d90b58 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 _0x70ff=['sequelize','exports','INTEGER'];(function(_0x4d5dbe,_0x43b77){var _0x3941ef=function(_0x1fe45b){while(--_0x1fe45b){_0x4d5dbe['push'](_0x4d5dbe['shift']());}};_0x3941ef(++_0x43b77);}(_0x70ff,0x1ce));var _0xf70f=function(_0x35268e,_0x4acfd1){_0x35268e=_0x35268e-0x0;var _0x28ba11=_0x70ff[_0x35268e];return _0x28ba11;};'use strict';var Sequelize=require(_0xf70f('0x0'));module[_0xf70f('0x1')]={'penalty':{'type':Sequelize[_0xf70f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8478=['exports','INTEGER','sequelize'];(function(_0x2ebb32,_0x56de24){var _0x224d00=function(_0x34e182){while(--_0x34e182){_0x2ebb32['push'](_0x2ebb32['shift']());}};_0x224d00(++_0x56de24);}(_0x8478,0x149));var _0x8847=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8478[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x8847('0x0'));module[_0x8847('0x1')]={'penalty':{'type':Sequelize[_0x8847('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 614354c..62bdc2b 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 _0x3399=['define','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x596954,_0x47303c){var _0x29ba8f=function(_0x62c939){while(--_0x62c939){_0x596954['push'](_0x596954['shift']());}};_0x29ba8f(++_0x47303c);}(_0x3399,0x1e6));var _0x9339=function(_0x294dbd,_0x3d603e){_0x294dbd=_0x294dbd-0x0;var _0x51b7a2=_0x3399[_0x294dbd];return _0x51b7a2;};'use strict';var _=require(_0x9339('0x0'));var util=require(_0x9339('0x1'));var logger=require(_0x9339('0x2'))(_0x9339('0x3'));var moment=require(_0x9339('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9339('0x5'));var config=require(_0x9339('0x6'));var attributes=require(_0x9339('0x7'));module[_0x9339('0x8')]=function(_0x1af4de,_0x4034cb){return _0x1af4de[_0x9339('0x9')]('UserWhatsappQueue',attributes,{'tableName':_0x9339('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x050c=['user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','path','./userWhatsappQueue.attributes','exports','define'];(function(_0x117473,_0x485375){var _0x38711a=function(_0x33e119){while(--_0x33e119){_0x117473['push'](_0x117473['shift']());}};_0x38711a(++_0x485375);}(_0x050c,0x1b9));var _0xc050=function(_0x4983ce,_0x13f756){_0x4983ce=_0x4983ce-0x0;var _0x2ad4c4=_0x050c[_0x4983ce];return _0x2ad4c4;};'use strict';var _=require(_0xc050('0x0'));var util=require(_0xc050('0x1'));var logger=require(_0xc050('0x2'))(_0xc050('0x3'));var moment=require(_0xc050('0x4'));var BPromise=require('bluebird');var rp=require(_0xc050('0x5'));var fs=require('fs');var path=require(_0xc050('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc050('0x7'));module[_0xc050('0x8')]=function(_0x39a9d9,_0x15dc5c){return _0x39a9d9[_0xc050('0x9')]('UserWhatsappQueue',attributes,{'tableName':_0xc050('0xa'),'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 3795bf9..8ae87d0 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 _0xe4c7=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x4ce318,_0x28d105){var _0x51f744=function(_0x58d7e9){while(--_0x58d7e9){_0x4ce318['push'](_0x4ce318['shift']());}};_0x51f744(++_0x28d105);}(_0xe4c7,0x152));var _0x7e4c=function(_0xc85513,_0x49e852){_0xc85513=_0xc85513-0x0;var _0x3e70be=_0xe4c7[_0xc85513];return _0x3e70be;};'use strict';var _=require(_0x7e4c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7e4c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e4c('0x2'));var db=require(_0x7e4c('0x3'))['db'];var utils=require(_0x7e4c('0x4'));var logger=require(_0x7e4c('0x5'))('rpc');var config=require(_0x7e4c('0x6'));var jayson=require(_0x7e4c('0x7'));var client=jayson[_0x7e4c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbeb914,_0x3fa5d,_0x3418ea){return new BPromise(function(_0x237a7d,_0x70e442){return client[_0x7e4c('0x9')](_0xbeb914,_0x3418ea)['then'](function(_0x357bad){logger['info'](_0x7e4c('0xa'),_0x3fa5d,_0x7e4c('0xb'));logger[_0x7e4c('0xc')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x3fa5d,_0x7e4c('0xb'),JSON[_0x7e4c('0xd')](_0x357bad));if(_0x357bad['error']){if(_0x357bad['error']['code']===0x1f4){logger[_0x7e4c('0xe')](_0x7e4c('0xa'),_0x3fa5d,_0x357bad[_0x7e4c('0xe')][_0x7e4c('0xf')]);return _0x70e442(_0x357bad[_0x7e4c('0xe')][_0x7e4c('0xf')]);}logger[_0x7e4c('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3fa5d,_0x357bad[_0x7e4c('0xe')][_0x7e4c('0xf')]);return _0x237a7d(_0x357bad[_0x7e4c('0xe')][_0x7e4c('0xf')]);}else{logger[_0x7e4c('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3fa5d,_0x7e4c('0xb'));_0x237a7d(_0x357bad[_0x7e4c('0x11')]['message']);}})['catch'](function(_0x4205c0){logger['error'](_0x7e4c('0xa'),_0x3fa5d,_0x4205c0);_0x70e442(_0x4205c0);});});} \ No newline at end of file +var _0xc0ee=['info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then'];(function(_0xb19183,_0x145763){var _0x33b014=function(_0x35db27){while(--_0x35db27){_0xb19183['push'](_0xb19183['shift']());}};_0x33b014(++_0x145763);}(_0xc0ee,0x19a));var _0xec0e=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xc0ee[_0x126fb9];return _0xc8a3b1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xec0e('0x0'));var BPromise=require(_0xec0e('0x1'));var rs=require(_0xec0e('0x2'));var fs=require('fs');var Redis=require(_0xec0e('0x3'));var db=require(_0xec0e('0x4'))['db'];var utils=require(_0xec0e('0x5'));var logger=require(_0xec0e('0x6'))('rpc');var config=require(_0xec0e('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x469cb7,_0x3e3511,_0x453af3){return new BPromise(function(_0x3d292d,_0x45a246){return client[_0xec0e('0x8')](_0x469cb7,_0x453af3)[_0xec0e('0x9')](function(_0x158afe){logger[_0xec0e('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3e3511,_0xec0e('0xb'));logger[_0xec0e('0xc')](_0xec0e('0xd'),_0x3e3511,_0xec0e('0xb'),JSON['stringify'](_0x158afe));if(_0x158afe[_0xec0e('0xe')]){if(_0x158afe['error'][_0xec0e('0xf')]===0x1f4){logger[_0xec0e('0xe')](_0xec0e('0x10'),_0x3e3511,_0x158afe['error'][_0xec0e('0x11')]);return _0x45a246(_0x158afe[_0xec0e('0xe')][_0xec0e('0x11')]);}logger[_0xec0e('0xe')](_0xec0e('0x10'),_0x3e3511,_0x158afe['error']['message']);return _0x3d292d(_0x158afe['error'][_0xec0e('0x11')]);}else{logger[_0xec0e('0xa')](_0xec0e('0x10'),_0x3e3511,_0xec0e('0xb'));_0x3d292d(_0x158afe[_0xec0e('0x12')][_0xec0e('0x11')]);}})[_0xec0e('0x13')](function(_0x12809d){logger[_0xec0e('0xe')](_0xec0e('0x10'),_0x3e3511,_0x12809d);_0x45a246(_0x12809d);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 79dec45..e8b302f 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 _0x1a8f=['multer','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','/:id','show','post','put','delete','destroy'];(function(_0x185070,_0x3c7668){var _0x55d1e9=function(_0x54677f){while(--_0x54677f){_0x185070['push'](_0x185070['shift']());}};_0x55d1e9(++_0x3c7668);}(_0x1a8f,0x87));var _0xf1a8=function(_0x251421,_0x34bf49){_0x251421=_0x251421-0x0;var _0xe9bbff=_0x1a8f[_0x251421];return _0xe9bbff;};'use strict';var multer=require(_0xf1a8('0x0'));var util=require('util');var path=require(_0xf1a8('0x1'));var timeout=require(_0xf1a8('0x2'));var express=require(_0xf1a8('0x3'));var router=express[_0xf1a8('0x4')]();var fs_extra=require(_0xf1a8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./variable.controller');router[_0xf1a8('0x6')]('/',auth[_0xf1a8('0x7')](),controller[_0xf1a8('0x8')]);router['get'](_0xf1a8('0x9'),auth['isAuthenticated'](),controller[_0xf1a8('0xa')]);router[_0xf1a8('0xb')]('/',auth[_0xf1a8('0x7')](),controller['create']);router[_0xf1a8('0xc')]('/:id',auth[_0xf1a8('0x7')](),controller['update']);router[_0xf1a8('0xd')](_0xf1a8('0x9'),auth[_0xf1a8('0x7')](),controller[_0xf1a8('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe14d=['../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3d938d,_0x5ed96d){var _0x2b721f=function(_0x3f5ca2){while(--_0x3f5ca2){_0x3d938d['push'](_0x3d938d['shift']());}};_0x2b721f(++_0x5ed96d);}(_0xe14d,0x1ee));var _0xde14=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe14d[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/:id',auth[_0xde14('0xa')](),controller[_0xde14('0xc')]);router[_0xde14('0xd')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0xf')](_0xde14('0x10'),auth[_0xde14('0xa')](),controller['update']);router[_0xde14('0x11')](_0xde14('0x10'),auth[_0xde14('0xa')](),controller[_0xde14('0x12')]);module[_0xde14('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 2352ff7..e4ccc4b 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 _0xfd2f=['sequelize','exports','STRING'];(function(_0x5792fc,_0x28a499){var _0x3db018=function(_0x303218){while(--_0x303218){_0x5792fc['push'](_0x5792fc['shift']());}};_0x3db018(++_0x28a499);}(_0xfd2f,0x14a));var _0xffd2=function(_0x2d2881,_0x1684d1){_0x2d2881=_0x2d2881-0x0;var _0x34fe67=_0xfd2f[_0x2d2881];return _0x34fe67;};'use strict';var Sequelize=require(_0xffd2('0x0'));module[_0xffd2('0x1')]={'name':{'type':Sequelize[_0xffd2('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xffd2('0x2')]}}; \ No newline at end of file +var _0x60d4=['sequelize','exports','STRING','name'];(function(_0x554824,_0x26abe4){var _0x39e60d=function(_0x493228){while(--_0x493228){_0x554824['push'](_0x554824['shift']());}};_0x39e60d(++_0x26abe4);}(_0x60d4,0xa4));var _0x460d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x60d4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x460d('0x0'));module[_0x460d('0x1')]={'name':{'type':Sequelize[_0x460d('0x2')],'unique':_0x460d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 43c5fd8..d940684 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 _0xa6a7=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','Variable','findAll','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','get','Variables','UserProfileResource','error','stack','name','index','map','rawAttributes','type','key','model'];(function(_0x220ec8,_0x3e57de){var _0x4723a3=function(_0x2cb8b7){while(--_0x2cb8b7){_0x220ec8['push'](_0x220ec8['shift']());}};_0x4723a3(++_0x3e57de);}(_0xa6a7,0x1b0));var _0x7a6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa6a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7a6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7a6a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a6a('0x2'));var moment=require(_0x7a6a('0x3'));var BPromise=require(_0x7a6a('0x4'));var Mustache=require(_0x7a6a('0x5'));var util=require(_0x7a6a('0x6'));var path=require('path');var sox=require(_0x7a6a('0x7'));var csv=require(_0x7a6a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a6a('0x9'));var _=require(_0x7a6a('0xa'));var squel=require(_0x7a6a('0xb'));var crypto=require(_0x7a6a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7a6a('0xd'));var toCsv=require(_0x7a6a('0x8'));var querystring=require(_0x7a6a('0xe'));var Papa=require(_0x7a6a('0xf'));var Redis=require(_0x7a6a('0x10'));var authService=require(_0x7a6a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a6a('0x12'));var logger=require('../../config/logger')(_0x7a6a('0x13'));var utils=require(_0x7a6a('0x14'));var config=require(_0x7a6a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7a6a('0x16'))['db'];function respondWithStatusCode(_0x45b9ff,_0x778814){_0x778814=_0x778814||0xcc;return function(_0x440dda){if(_0x440dda){return _0x45b9ff[_0x7a6a('0x17')](_0x778814);}return _0x45b9ff[_0x7a6a('0x18')](_0x778814)[_0x7a6a('0x19')]();};}function respondWithResult(_0x463246,_0x6cbd74){_0x6cbd74=_0x6cbd74||0xc8;return function(_0x26a261){if(_0x26a261){return _0x463246['status'](_0x6cbd74)[_0x7a6a('0x1a')](_0x26a261);}};}function respondWithFilteredResult(_0x4bb64b,_0x58e532){return function(_0x4f7ac4){if(_0x4f7ac4){var _0x288238=typeof _0x58e532['offset']==='undefined'&&typeof _0x58e532['limit']===_0x7a6a('0x1b');var _0x4d939e=_0x4f7ac4['count'];var _0x44f354=_0x288238?0x0:_0x58e532['offset'];var _0x5457d2=_0x288238?_0x4f7ac4[_0x7a6a('0x1c')]:_0x58e532[_0x7a6a('0x1d')]+_0x58e532[_0x7a6a('0x1e')];var _0x26e394;if(_0x5457d2>=_0x4d939e){_0x5457d2=_0x4d939e;_0x26e394=0xc8;}else{_0x26e394=0xce;}_0x4bb64b[_0x7a6a('0x18')](_0x26e394);return _0x4bb64b[_0x7a6a('0x1f')](_0x7a6a('0x20'),_0x44f354+'-'+_0x5457d2+'/'+_0x4d939e)[_0x7a6a('0x1a')](_0x4f7ac4);}return null;};}function patchUpdates(_0x31f066){return function(_0x31197d){try{jsonpatch['apply'](_0x31197d,_0x31f066,!![]);}catch(_0x3c86a3){return BPromise[_0x7a6a('0x21')](_0x3c86a3);}return _0x31197d['save']();};}function saveUpdates(_0x357218,_0x4a76a3){return function(_0x2332ff){if(_0x2332ff){return _0x2332ff[_0x7a6a('0x22')](_0x357218)[_0x7a6a('0x23')](function(_0x586efa){return _0x586efa;});}return null;};}function removeEntity(_0x5251e2,_0x1229d7){return function(_0x2b708b){if(_0x2b708b){return _0x2b708b['destroy']()[_0x7a6a('0x23')](function(){var _0x1e3f32=_0x2b708b[_0x7a6a('0x24')]({'plain':!![]});var _0x1cbe94=_0x7a6a('0x25');return db[_0x7a6a('0x26')]['destroy']({'where':{'type':_0x1cbe94,'resourceId':_0x1e3f32['id']}})[_0x7a6a('0x23')](function(){return _0x2b708b;});})[_0x7a6a('0x23')](function(){_0x5251e2[_0x7a6a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d1d48,_0x5b0e0c){return function(_0xe9acc7){if(!_0xe9acc7){_0x2d1d48[_0x7a6a('0x17')](0x194);}return _0xe9acc7;};}function handleError(_0x2628e2,_0x30e45f){_0x30e45f=_0x30e45f||0x1f4;return function(_0x4d64b3){logger[_0x7a6a('0x27')](_0x4d64b3[_0x7a6a('0x28')]);if(_0x4d64b3[_0x7a6a('0x29')]){delete _0x4d64b3[_0x7a6a('0x29')];}_0x2628e2[_0x7a6a('0x18')](_0x30e45f)['send'](_0x4d64b3);};}exports[_0x7a6a('0x2a')]=function(_0x17fe97,_0x426ab4){var _0x1c6ff0={},_0xb67176={},_0x4f09cf={'count':0x0,'rows':[]};var _0x4c5808=_[_0x7a6a('0x2b')](db['Variable'][_0x7a6a('0x2c')],function(_0x20134b){return{'name':_0x20134b['fieldName'],'type':_0x20134b[_0x7a6a('0x2d')][_0x7a6a('0x2e')]};});_0xb67176[_0x7a6a('0x2f')]=_[_0x7a6a('0x2b')](_0x4c5808,_0x7a6a('0x29'));_0xb67176[_0x7a6a('0x30')]=_[_0x7a6a('0x31')](_0x17fe97[_0x7a6a('0x30')]);_0xb67176[_0x7a6a('0x32')]=_['intersection'](_0xb67176[_0x7a6a('0x2f')],_0xb67176['query']);_0x1c6ff0[_0x7a6a('0x33')]=_[_0x7a6a('0x34')](_0xb67176[_0x7a6a('0x2f')],qs[_0x7a6a('0x35')](_0x17fe97[_0x7a6a('0x30')][_0x7a6a('0x35')]));_0x1c6ff0[_0x7a6a('0x33')]=_0x1c6ff0[_0x7a6a('0x33')]['length']?_0x1c6ff0[_0x7a6a('0x33')]:_0xb67176[_0x7a6a('0x2f')];if(!_0x17fe97[_0x7a6a('0x30')][_0x7a6a('0x36')](_0x7a6a('0x37'))){_0x1c6ff0[_0x7a6a('0x1e')]=qs[_0x7a6a('0x1e')](_0x17fe97[_0x7a6a('0x30')]['limit']);_0x1c6ff0[_0x7a6a('0x1d')]=qs[_0x7a6a('0x1d')](_0x17fe97[_0x7a6a('0x30')][_0x7a6a('0x1d')]);}_0x1c6ff0['order']=qs['sort'](_0x17fe97['query'][_0x7a6a('0x38')]);_0x1c6ff0['where']=qs[_0x7a6a('0x32')](_[_0x7a6a('0x39')](_0x17fe97[_0x7a6a('0x30')],_0xb67176[_0x7a6a('0x32')]),_0x4c5808);if(_0x17fe97[_0x7a6a('0x30')][_0x7a6a('0x3a')]){_0x1c6ff0[_0x7a6a('0x3b')]=_['merge'](_0x1c6ff0[_0x7a6a('0x3b')],{'$or':_[_0x7a6a('0x2b')](_0x4c5808,function(_0x551a64){if(_0x551a64[_0x7a6a('0x2d')]!==_0x7a6a('0x3c')){var _0x174cd1={};_0x174cd1[_0x551a64['name']]={'$like':'%'+_0x17fe97[_0x7a6a('0x30')][_0x7a6a('0x3a')]+'%'};return _0x174cd1;}})});}_0x1c6ff0=_[_0x7a6a('0x3d')]({},_0x1c6ff0,_0x17fe97[_0x7a6a('0x3e')]);var _0x69ff92={'where':_0x1c6ff0[_0x7a6a('0x3b')]};return db['Variable'][_0x7a6a('0x1c')](_0x69ff92)['then'](function(_0x5fd6a0){_0x4f09cf[_0x7a6a('0x1c')]=_0x5fd6a0;if(_0x17fe97[_0x7a6a('0x30')][_0x7a6a('0x3f')]){_0x1c6ff0['include']=[{'all':!![]}];}return db[_0x7a6a('0x40')][_0x7a6a('0x41')](_0x1c6ff0);})[_0x7a6a('0x23')](function(_0x151792){_0x4f09cf['rows']=_0x151792;return _0x4f09cf;})[_0x7a6a('0x23')](respondWithFilteredResult(_0x426ab4,_0x1c6ff0))['catch'](handleError(_0x426ab4,null));};exports[_0x7a6a('0x42')]=function(_0x596d91,_0x1599ef){var _0x41eff5={'raw':!![],'where':{'id':_0x596d91[_0x7a6a('0x43')]['id']}},_0x495679={};_0x495679[_0x7a6a('0x2f')]=_['keys'](db[_0x7a6a('0x40')][_0x7a6a('0x2c')]);_0x495679[_0x7a6a('0x30')]=_[_0x7a6a('0x31')](_0x596d91['query']);_0x495679[_0x7a6a('0x32')]=_[_0x7a6a('0x34')](_0x495679[_0x7a6a('0x2f')],_0x495679[_0x7a6a('0x30')]);_0x41eff5[_0x7a6a('0x33')]=_[_0x7a6a('0x34')](_0x495679[_0x7a6a('0x2f')],qs[_0x7a6a('0x35')](_0x596d91[_0x7a6a('0x30')][_0x7a6a('0x35')]));_0x41eff5[_0x7a6a('0x33')]=_0x41eff5[_0x7a6a('0x33')]['length']?_0x41eff5[_0x7a6a('0x33')]:_0x495679[_0x7a6a('0x2f')];if(_0x596d91['query']['includeAll']){_0x41eff5[_0x7a6a('0x44')]=[{'all':!![]}];}_0x41eff5=_[_0x7a6a('0x3d')]({},_0x41eff5,_0x596d91['options']);return db['Variable'][_0x7a6a('0x45')](_0x41eff5)[_0x7a6a('0x23')](handleEntityNotFound(_0x1599ef,null))[_0x7a6a('0x23')](respondWithResult(_0x1599ef,null))[_0x7a6a('0x46')](handleError(_0x1599ef,null));};exports[_0x7a6a('0x47')]=function(_0x2af36b,_0x512523){return db[_0x7a6a('0x40')][_0x7a6a('0x47')](_0x2af36b[_0x7a6a('0x48')],{})[_0x7a6a('0x23')](function(_0x47d64c){var _0x322f82=_0x2af36b[_0x7a6a('0x49')]['get']({'plain':!![]});if(!_0x322f82)throw new Error(_0x7a6a('0x4a'));if(_0x322f82[_0x7a6a('0x4b')]===_0x7a6a('0x49')){var _0x2c777a=_0x47d64c[_0x7a6a('0x24')]({'plain':!![]});var _0x205919='Variables';return db['UserProfileSection'][_0x7a6a('0x45')]({'where':{'name':_0x205919,'userProfileId':_0x322f82[_0x7a6a('0x4c')]},'raw':!![]})['then'](function(_0x5a8fbd){if(_0x5a8fbd&&_0x5a8fbd[_0x7a6a('0x4d')]===0x0){return db[_0x7a6a('0x26')]['create']({'name':_0x2c777a[_0x7a6a('0x29')],'resourceId':_0x2c777a['id'],'type':_0x5a8fbd['name'],'sectionId':_0x5a8fbd['id']},{})[_0x7a6a('0x23')](function(){return _0x47d64c;});}else{return _0x47d64c;}})[_0x7a6a('0x46')](function(_0x453391){logger['error'](_0x7a6a('0x4e'),_0x453391);throw _0x453391;});}return _0x47d64c;})[_0x7a6a('0x23')](respondWithResult(_0x512523,0xc9))[_0x7a6a('0x46')](handleError(_0x512523,null));};exports['update']=function(_0x4ae468,_0x347d49){if(_0x4ae468[_0x7a6a('0x48')]['id']){delete _0x4ae468['body']['id'];}return db['Variable'][_0x7a6a('0x45')]({'where':{'id':_0x4ae468[_0x7a6a('0x43')]['id']}})[_0x7a6a('0x23')](handleEntityNotFound(_0x347d49,null))[_0x7a6a('0x23')](saveUpdates(_0x4ae468['body'],null))[_0x7a6a('0x23')](respondWithResult(_0x347d49,null))[_0x7a6a('0x46')](handleError(_0x347d49,null));};exports[_0x7a6a('0x4f')]=function(_0xb6a744,_0x17ef61){return db[_0x7a6a('0x40')][_0x7a6a('0x45')]({'where':{'id':_0xb6a744[_0x7a6a('0x43')]['id']}})[_0x7a6a('0x23')](handleEntityNotFound(_0x17ef61,null))[_0x7a6a('0x23')](removeEntity(_0x17ef61,null))[_0x7a6a('0x46')](handleError(_0x17ef61,null));}; \ No newline at end of file +var _0x8b90=['catch','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','get','Variables','UserProfileResource','destroy','error','name','send','index','Variable','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8b90,0xaa));var _0x08b9=function(_0x52a08b,_0x12388d){_0x52a08b=_0x52a08b-0x0;var _0x2c6670=_0x8b90[_0x52a08b];return _0x2c6670;};'use strict';var emlformat=require(_0x08b9('0x0'));var rimraf=require(_0x08b9('0x1'));var zipdir=require(_0x08b9('0x2'));var jsonpatch=require(_0x08b9('0x3'));var rp=require('request-promise');var moment=require(_0x08b9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x08b9('0x5'));var util=require(_0x08b9('0x6'));var path=require(_0x08b9('0x7'));var sox=require(_0x08b9('0x8'));var csv=require(_0x08b9('0x9'));var ejs=require(_0x08b9('0xa'));var fs=require('fs');var fs_extra=require(_0x08b9('0xb'));var _=require(_0x08b9('0xc'));var squel=require('squel');var crypto=require(_0x08b9('0xd'));var jsforce=require(_0x08b9('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x08b9('0xf'));var Papa=require('papaparse');var Redis=require(_0x08b9('0x10'));var authService=require(_0x08b9('0x11'));var qs=require(_0x08b9('0x12'));var as=require(_0x08b9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x08b9('0x14'))(_0x08b9('0x15'));var utils=require(_0x08b9('0x16'));var config=require(_0x08b9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x08b9('0x18'))['db'];function respondWithStatusCode(_0x1ba62f,_0x1a578e){_0x1a578e=_0x1a578e||0xcc;return function(_0x290a65){if(_0x290a65){return _0x1ba62f[_0x08b9('0x19')](_0x1a578e);}return _0x1ba62f[_0x08b9('0x1a')](_0x1a578e)[_0x08b9('0x1b')]();};}function respondWithResult(_0x2e9b54,_0x100271){_0x100271=_0x100271||0xc8;return function(_0x5a454a){if(_0x5a454a){return _0x2e9b54['status'](_0x100271)[_0x08b9('0x1c')](_0x5a454a);}};}function respondWithFilteredResult(_0x221447,_0x4259e1){return function(_0x1665c3){if(_0x1665c3){var _0x31daad=typeof _0x4259e1[_0x08b9('0x1d')]===_0x08b9('0x1e')&&typeof _0x4259e1[_0x08b9('0x1f')]===_0x08b9('0x1e');var _0x50aec6=_0x1665c3['count'];var _0x1d2c78=_0x31daad?0x0:_0x4259e1['offset'];var _0x4fb897=_0x31daad?_0x1665c3[_0x08b9('0x20')]:_0x4259e1[_0x08b9('0x1d')]+_0x4259e1[_0x08b9('0x1f')];var _0x45fac4;if(_0x4fb897>=_0x50aec6){_0x4fb897=_0x50aec6;_0x45fac4=0xc8;}else{_0x45fac4=0xce;}_0x221447[_0x08b9('0x1a')](_0x45fac4);return _0x221447[_0x08b9('0x21')]('Content-Range',_0x1d2c78+'-'+_0x4fb897+'/'+_0x50aec6)[_0x08b9('0x1c')](_0x1665c3);}return null;};}function patchUpdates(_0xc6dff6){return function(_0x4ffb8c){try{jsonpatch['apply'](_0x4ffb8c,_0xc6dff6,!![]);}catch(_0x20e5f1){return BPromise[_0x08b9('0x22')](_0x20e5f1);}return _0x4ffb8c[_0x08b9('0x23')]();};}function saveUpdates(_0x10a451,_0x2b193c){return function(_0x386bff){if(_0x386bff){return _0x386bff[_0x08b9('0x24')](_0x10a451)['then'](function(_0x38f362){return _0x38f362;});}return null;};}function removeEntity(_0x2ae5d8,_0x4e3ab3){return function(_0x5eb950){if(_0x5eb950){return _0x5eb950['destroy']()[_0x08b9('0x25')](function(){var _0x4dea63=_0x5eb950[_0x08b9('0x26')]({'plain':!![]});var _0x3a69c6=_0x08b9('0x27');return db[_0x08b9('0x28')][_0x08b9('0x29')]({'where':{'type':_0x3a69c6,'resourceId':_0x4dea63['id']}})['then'](function(){return _0x5eb950;});})['then'](function(){_0x2ae5d8[_0x08b9('0x1a')](0xcc)[_0x08b9('0x1b')]();});}};}function handleEntityNotFound(_0x518599,_0x190ba7){return function(_0x4ed9da){if(!_0x4ed9da){_0x518599[_0x08b9('0x19')](0x194);}return _0x4ed9da;};}function handleError(_0x28563f,_0x1a81b5){_0x1a81b5=_0x1a81b5||0x1f4;return function(_0x5a3f5a){logger[_0x08b9('0x2a')](_0x5a3f5a['stack']);if(_0x5a3f5a[_0x08b9('0x2b')]){delete _0x5a3f5a['name'];}_0x28563f['status'](_0x1a81b5)[_0x08b9('0x2c')](_0x5a3f5a);};}exports[_0x08b9('0x2d')]=function(_0x2e8eab,_0x13886e){var _0x3c0bb9={},_0x2aed37={},_0x300086={'count':0x0,'rows':[]};var _0x394bab=_['map'](db[_0x08b9('0x2e')]['rawAttributes'],function(_0x20fad5){return{'name':_0x20fad5[_0x08b9('0x2f')],'type':_0x20fad5['type']['key']};});_0x2aed37['model']=_['map'](_0x394bab,'name');_0x2aed37[_0x08b9('0x30')]=_[_0x08b9('0x31')](_0x2e8eab['query']);_0x2aed37['filters']=_[_0x08b9('0x32')](_0x2aed37[_0x08b9('0x33')],_0x2aed37[_0x08b9('0x30')]);_0x3c0bb9[_0x08b9('0x34')]=_['intersection'](_0x2aed37[_0x08b9('0x33')],qs[_0x08b9('0x35')](_0x2e8eab['query'][_0x08b9('0x35')]));_0x3c0bb9[_0x08b9('0x34')]=_0x3c0bb9['attributes'][_0x08b9('0x36')]?_0x3c0bb9[_0x08b9('0x34')]:_0x2aed37['model'];if(!_0x2e8eab[_0x08b9('0x30')][_0x08b9('0x37')]('nolimit')){_0x3c0bb9[_0x08b9('0x1f')]=qs[_0x08b9('0x1f')](_0x2e8eab[_0x08b9('0x30')][_0x08b9('0x1f')]);_0x3c0bb9[_0x08b9('0x1d')]=qs[_0x08b9('0x1d')](_0x2e8eab['query'][_0x08b9('0x1d')]);}_0x3c0bb9['order']=qs[_0x08b9('0x38')](_0x2e8eab[_0x08b9('0x30')][_0x08b9('0x38')]);_0x3c0bb9[_0x08b9('0x39')]=qs[_0x08b9('0x3a')](_[_0x08b9('0x3b')](_0x2e8eab[_0x08b9('0x30')],_0x2aed37[_0x08b9('0x3a')]),_0x394bab);if(_0x2e8eab['query'][_0x08b9('0x3c')]){_0x3c0bb9[_0x08b9('0x39')]=_[_0x08b9('0x3d')](_0x3c0bb9[_0x08b9('0x39')],{'$or':_['map'](_0x394bab,function(_0x55a28f){if(_0x55a28f['type']!==_0x08b9('0x3e')){var _0x415c9d={};_0x415c9d[_0x55a28f[_0x08b9('0x2b')]]={'$like':'%'+_0x2e8eab[_0x08b9('0x30')][_0x08b9('0x3c')]+'%'};return _0x415c9d;}})});}_0x3c0bb9=_[_0x08b9('0x3d')]({},_0x3c0bb9,_0x2e8eab[_0x08b9('0x3f')]);var _0x2a38b1={'where':_0x3c0bb9[_0x08b9('0x39')]};return db['Variable']['count'](_0x2a38b1)[_0x08b9('0x25')](function(_0x4d409e){_0x300086[_0x08b9('0x20')]=_0x4d409e;if(_0x2e8eab[_0x08b9('0x30')][_0x08b9('0x40')]){_0x3c0bb9[_0x08b9('0x41')]=[{'all':!![]}];}return db['Variable'][_0x08b9('0x42')](_0x3c0bb9);})[_0x08b9('0x25')](function(_0x3df532){_0x300086[_0x08b9('0x43')]=_0x3df532;return _0x300086;})[_0x08b9('0x25')](respondWithFilteredResult(_0x13886e,_0x3c0bb9))['catch'](handleError(_0x13886e,null));};exports[_0x08b9('0x44')]=function(_0x4d1b69,_0x372000){var _0x123a7c={'raw':!![],'where':{'id':_0x4d1b69['params']['id']}},_0x1c2195={};_0x1c2195[_0x08b9('0x33')]=_[_0x08b9('0x31')](db['Variable']['rawAttributes']);_0x1c2195[_0x08b9('0x30')]=_['keys'](_0x4d1b69['query']);_0x1c2195[_0x08b9('0x3a')]=_[_0x08b9('0x32')](_0x1c2195[_0x08b9('0x33')],_0x1c2195[_0x08b9('0x30')]);_0x123a7c['attributes']=_[_0x08b9('0x32')](_0x1c2195[_0x08b9('0x33')],qs[_0x08b9('0x35')](_0x4d1b69[_0x08b9('0x30')][_0x08b9('0x35')]));_0x123a7c[_0x08b9('0x34')]=_0x123a7c[_0x08b9('0x34')][_0x08b9('0x36')]?_0x123a7c[_0x08b9('0x34')]:_0x1c2195[_0x08b9('0x33')];if(_0x4d1b69['query']['includeAll']){_0x123a7c['include']=[{'all':!![]}];}_0x123a7c=_[_0x08b9('0x3d')]({},_0x123a7c,_0x4d1b69[_0x08b9('0x3f')]);return db[_0x08b9('0x2e')][_0x08b9('0x45')](_0x123a7c)['then'](handleEntityNotFound(_0x372000,null))[_0x08b9('0x25')](respondWithResult(_0x372000,null))[_0x08b9('0x46')](handleError(_0x372000,null));};exports['create']=function(_0x4fce76,_0x173a3d){return db['Variable']['create'](_0x4fce76['body'],{})[_0x08b9('0x25')](function(_0x17173f){var _0x44255b=_0x4fce76[_0x08b9('0x47')]['get']({'plain':!![]});if(!_0x44255b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44255b[_0x08b9('0x48')]===_0x08b9('0x47')){var _0xc6d493=_0x17173f[_0x08b9('0x26')]({'plain':!![]});var _0x24522a=_0x08b9('0x27');return db[_0x08b9('0x49')][_0x08b9('0x45')]({'where':{'name':_0x24522a,'userProfileId':_0x44255b[_0x08b9('0x4a')]},'raw':!![]})[_0x08b9('0x25')](function(_0x4ab76e){if(_0x4ab76e&&_0x4ab76e[_0x08b9('0x4b')]===0x0){return db['UserProfileResource'][_0x08b9('0x4c')]({'name':_0xc6d493[_0x08b9('0x2b')],'resourceId':_0xc6d493['id'],'type':_0x4ab76e[_0x08b9('0x2b')],'sectionId':_0x4ab76e['id']},{})['then'](function(){return _0x17173f;});}else{return _0x17173f;}})[_0x08b9('0x46')](function(_0xdd4d79){logger['error'](_0x08b9('0x4d'),_0xdd4d79);throw _0xdd4d79;});}return _0x17173f;})[_0x08b9('0x25')](respondWithResult(_0x173a3d,0xc9))[_0x08b9('0x46')](handleError(_0x173a3d,null));};exports[_0x08b9('0x24')]=function(_0x104f13,_0x418abd){if(_0x104f13[_0x08b9('0x4e')]['id']){delete _0x104f13[_0x08b9('0x4e')]['id'];}return db[_0x08b9('0x2e')]['find']({'where':{'id':_0x104f13[_0x08b9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x418abd,null))['then'](saveUpdates(_0x104f13[_0x08b9('0x4e')],null))[_0x08b9('0x25')](respondWithResult(_0x418abd,null))[_0x08b9('0x46')](handleError(_0x418abd,null));};exports['destroy']=function(_0x375c13,_0x33d47d){return db[_0x08b9('0x2e')][_0x08b9('0x45')]({'where':{'id':_0x375c13['params']['id']}})[_0x08b9('0x25')](handleEntityNotFound(_0x33d47d,null))[_0x08b9('0x25')](removeEntity(_0x33d47d,null))[_0x08b9('0x46')](handleError(_0x33d47d,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index c0c659f..557ebb0 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 _0xa738=['tools_variables','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','Variable'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0xa738,0x145));var _0x8a73=function(_0x46a884,_0x170f37){_0x46a884=_0x46a884-0x0;var _0x40e146=_0xa738[_0x46a884];return _0x40e146;};'use strict';var _=require(_0x8a73('0x0'));var util=require(_0x8a73('0x1'));var logger=require(_0x8a73('0x2'))(_0x8a73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8a73('0x4'));var fs=require('fs');var path=require(_0x8a73('0x5'));var rimraf=require(_0x8a73('0x6'));var config=require(_0x8a73('0x7'));var attributes=require('./variable.attributes');module[_0x8a73('0x8')]=function(_0x2bc8e4,_0x565c93){return _0x2bc8e4[_0x8a73('0x9')](_0x8a73('0xa'),attributes,{'tableName':_0x8a73('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x591d=['lodash','util','api','moment','request-promise','path','rimraf','./variable.attributes','exports','Variable','tools_variables'];(function(_0x25c2e3,_0x4e93d1){var _0xc504f6=function(_0x285ded){while(--_0x285ded){_0x25c2e3['push'](_0x25c2e3['shift']());}};_0xc504f6(++_0x4e93d1);}(_0x591d,0x16b));var _0xd591=function(_0x6af0cf,_0x572f40){_0x6af0cf=_0x6af0cf-0x0;var _0x4e99ae=_0x591d[_0x6af0cf];return _0x4e99ae;};'use strict';var _=require(_0xd591('0x0'));var util=require(_0xd591('0x1'));var logger=require('../../config/logger')(_0xd591('0x2'));var moment=require(_0xd591('0x3'));var BPromise=require('bluebird');var rp=require(_0xd591('0x4'));var fs=require('fs');var path=require(_0xd591('0x5'));var rimraf=require(_0xd591('0x6'));var config=require('../../config/environment');var attributes=require(_0xd591('0x7'));module[_0xd591('0x8')]=function(_0x3eeee0,_0x520bd0){return _0x3eeee0['define'](_0xd591('0x9'),attributes,{'tableName':_0xd591('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index a099d08..1d0f623 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 _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x368eba,_0x13e967){var _0x24d46f=function(_0x12d01f){while(--_0x12d01f){_0x368eba['push'](_0x368eba['shift']());}};_0x24d46f(++_0x13e967);}(_0x7217,0x19e));var _0x7721=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x7217[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x57a489,_0x189abc){var _0x1988a7=function(_0x2e9e03){while(--_0x2e9e03){_0x57a489['push'](_0x57a489['shift']());}};_0x1988a7(++_0x189abc);}(_0xe14b,0x93));var _0xbe14=function(_0x3ceb60,_0x3d61f2){_0x3ceb60=_0x3ceb60-0x0;var _0x447e41=_0xe14b[_0x3ceb60];return _0x447e41;};'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);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 23b4299..1876408 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 _0x10df=['/restart','restart','/migrations','migrations','express','Router','./version.controller','get','index','isAuthenticated','canUpdate','/reset','/pull','pull'];(function(_0x3835e4,_0x1957d9){var _0x3bdd97=function(_0x436f0f){while(--_0x436f0f){_0x3835e4['push'](_0x3835e4['shift']());}};_0x3bdd97(++_0x1957d9);}(_0x10df,0x18c));var _0xf10d=function(_0x457bf8,_0x209a0a){_0x457bf8=_0x457bf8-0x0;var _0x919f94=_0x10df[_0x457bf8];return _0x919f94;};'use strict';var express=require(_0xf10d('0x0'));var router=express[_0xf10d('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xf10d('0x2'));router[_0xf10d('0x3')]('/',controller[_0xf10d('0x4')]);router['get']('/fetch',auth[_0xf10d('0x5')](),auth[_0xf10d('0x6')](),controller['fetch']);router[_0xf10d('0x3')](_0xf10d('0x7'),auth['isAuthenticated'](),auth['canUpdate'](),controller['reset']);router[_0xf10d('0x3')](_0xf10d('0x8'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xf10d('0x9')]);router[_0xf10d('0x3')](_0xf10d('0xa'),auth['isAuthenticated'](),controller[_0xf10d('0xb')]);router['get'](_0xf10d('0xc'),controller[_0xf10d('0xd')]);module['exports']=router; \ No newline at end of file +var _0xd968=['express','../../components/auth/service','./version.controller','get','canUpdate','fetch','/reset','isAuthenticated','reset','/pull','/restart','restart','/migrations','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd968,0x1b2));var _0x8d96=function(_0x231a02,_0x2a9e36){_0x231a02=_0x231a02-0x0;var _0x3ae533=_0xd968[_0x231a02];return _0x3ae533;};'use strict';var express=require(_0x8d96('0x0'));var router=express['Router']();var auth=require(_0x8d96('0x1'));var controller=require(_0x8d96('0x2'));router[_0x8d96('0x3')]('/',controller['index']);router[_0x8d96('0x3')]('/fetch',auth['isAuthenticated'](),auth[_0x8d96('0x4')](),controller[_0x8d96('0x5')]);router['get'](_0x8d96('0x6'),auth[_0x8d96('0x7')](),auth[_0x8d96('0x4')](),controller[_0x8d96('0x8')]);router[_0x8d96('0x3')](_0x8d96('0x9'),auth[_0x8d96('0x7')](),auth['canUpdate'](),controller['pull']);router[_0x8d96('0x3')](_0x8d96('0xa'),auth['isAuthenticated'](),controller[_0x8d96('0xb')]);router[_0x8d96('0x3')](_0x8d96('0xc'),controller['migrations']);module[_0x8d96('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 2ebec64..210f3f5 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 _0x8e30=['query','latest','fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','motion2','then','catch','readdirSync','server','length','.js','exports','push','sort','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','migrations','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index'];(function(_0x340543,_0x12b328){var _0x29ce92=function(_0x1c3369){while(--_0x1c3369){_0x340543['push'](_0x340543['shift']());}};_0x29ce92(++_0x12b328);}(_0x8e30,0x124));var _0x08e3=function(_0x476531,_0x2e34cf){_0x476531=_0x476531-0x0;var _0x482cba=_0x8e30[_0x476531];return _0x482cba;};'use strict';var Umzug=require(_0x08e3('0x0'));var path=require(_0x08e3('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x08e3('0x2'))(module,_0x08e3('0x3'));var compareVersions=require(_0x08e3('0x4'));var exec=require(_0x08e3('0x5'))[_0x08e3('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0x08e3('0x7'));var pm2=require(_0x08e3('0x8'));var logger=require(_0x08e3('0x9'))(_0x08e3('0xa'));var git=require(_0x08e3('0xb'))(config[_0x08e3('0xc')]);exports[_0x08e3('0xd')]=function(_0x5e6ee0,_0x1cde44){var _0x2d70b4={'current':module['exports'][_0x08e3('0x3')],'phonebar':0x2};if(_0x5e6ee0[_0x08e3('0xe')]&&_0x5e6ee0[_0x08e3('0xe')][_0x08e3('0xf')]){return git[_0x08e3('0x10')]()[_0x08e3('0x11')](function(_0x24e619,_0x27338a){_0x2d70b4['latest']=(_0x24e619?module['exports'][_0x08e3('0x3')]:_0x27338a[_0x08e3('0xf')])||_0x08e3('0x12');return _0x1cde44[_0x08e3('0x13')](0xc8)[_0x08e3('0x14')](_0x2d70b4);});}else{return _0x1cde44[_0x08e3('0x13')](0xc8)[_0x08e3('0x14')](_0x2d70b4);}};exports[_0x08e3('0x10')]=function(_0xf4cac1,_0x4ac928){return git['fetch']([_0x08e3('0x15'),'master'],function(_0x30d3eb){if(_0x30d3eb){logger[_0x08e3('0x16')](_0x30d3eb);return _0x4ac928[_0x08e3('0x13')](0x1f4)[_0x08e3('0x14')](_0x30d3eb);}logger[_0x08e3('0x17')](_0x08e3('0x18'));return _0x4ac928['status'](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x244a99,_0x25e78e){return git[_0x08e3('0x19')](['--hard',_0x08e3('0x1a')],function(_0xf8d3e7){if(_0xf8d3e7){logger[_0x08e3('0x16')](_0xf8d3e7);return _0x25e78e[_0x08e3('0x13')](0x1f4)['json'](_0xf8d3e7);}logger[_0x08e3('0x17')](_0x08e3('0x1b'));return _0x25e78e[_0x08e3('0x13')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x08e3('0x1c')]=function(_0x27cc50,_0x380081){exec(_0x08e3('0x1d'),function(_0x1dc0b9,_0x3d8b71,_0x25a262){logger[_0x08e3('0x17')](_0x3d8b71);logger[_0x08e3('0x17')](_0x25a262);if(_0x1dc0b9){logger[_0x08e3('0x16')](_0x1dc0b9);return _0x380081[_0x08e3('0x13')](0x1f4)['json'](_0x1dc0b9);}return _0x380081[_0x08e3('0x13')](0xc8)[_0x08e3('0x14')]({'output':_0x3d8b71});});};exports['restart']=function(_0x279f5f,_0x308174){return pm2['restart'](_0x08e3('0x1e'))[_0x08e3('0x1f')](function(_0x4c0cab){logger[_0x08e3('0x17')]('pm2\x20restart\x20motion\x20%s',_0x4c0cab);return _0x308174[_0x08e3('0x13')](0xc8)[_0x08e3('0x14')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x08e3('0x20')](function(_0x39b618){logger[_0x08e3('0x16')](_0x39b618);return _0x308174[_0x08e3('0x13')](0x1f4)[_0x08e3('0x14')](_0x39b618);});};exports['migrations']=function(_0xcd9d24,_0x553975){var _0x35b175=fs[_0x08e3('0x21')](path['join'](config[_0x08e3('0xc')],_0x08e3('0x22'),'migrations'));var _0x1b137b=[];for(var _0x7a34eb=0x0;_0x7a34eb<_0x35b175[_0x08e3('0x23')];_0x7a34eb++){var _0x5ba201=_0x35b175[_0x7a34eb]['replace'](_0x08e3('0x24'),'');if(compareVersions(module[_0x08e3('0x25')][_0x08e3('0x3')],_0x5ba201)===-0x1){_0x1b137b[_0x08e3('0x26')](_0x5ba201);}}if(_0x1b137b[_0x08e3('0x23')]){var _0x4ff25a=_0x1b137b[_0x08e3('0x27')](compareVersions);var _0x38c694=new Umzug({'storage':_0x08e3('0x28'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x08e3('0x3')},'migrations':{'params':[db[_0x08e3('0x28')][_0x08e3('0x29')](),db[_0x08e3('0x28')][_0x08e3('0x2a')],function(){throw new Error(_0x08e3('0x2b'));}],'path':path[_0x08e3('0x2c')](config['root'],'server',_0x08e3('0x2d')),'pattern':/\.js$/}});_0x38c694['up']({'migrations':_[_0x08e3('0x2e')](_0x4ff25a,function(_0x38e432){return _0x38e432+_0x08e3('0x24');})})[_0x08e3('0x1f')](function(){return _0x553975[_0x08e3('0x13')](0xc8)[_0x08e3('0x14')]({'output':_0x08e3('0x2f')+module[_0x08e3('0x25')][_0x08e3('0x3')]+'\x20to\x20'+_[_0x08e3('0x30')](_0x4ff25a),'migrations':_[_0x08e3('0x2c')](_0x4ff25a)});})[_0x08e3('0x20')](function(_0x12ffc6){if(_0x12ffc6 instanceof db['sequelize'][_0x08e3('0x31')]){return _0x553975['status'](0xc8)[_0x08e3('0x14')]({'output':_0x08e3('0x32')});}else{return _0x553975[_0x08e3('0x13')](0x1f4)['json'](_0x12ffc6);}});}else{return _0x553975[_0x08e3('0x13')](0xc8)['json']({'output':_0x08e3('0x32')});}}; \ No newline at end of file +var _0x0300=['join','server','replace','.js','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','version','compare-versions','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','latest','2.0.0','status','json','error','git\x20fetch','reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync'];(function(_0x57b30a,_0x8f1ffc){var _0x337ab2=function(_0x81d79){while(--_0x81d79){_0x57b30a['push'](_0x57b30a['shift']());}};_0x337ab2(++_0x8f1ffc);}(_0x0300,0x161));var _0x0030=function(_0x9cf9ba,_0x235c1c){_0x9cf9ba=_0x9cf9ba-0x0;var _0x14cec1=_0x0300[_0x9cf9ba];return _0x14cec1;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0x0030('0x0'));var compareVersions=require(_0x0030('0x1'));var exec=require('child_process')[_0x0030('0x2')];var db=require(_0x0030('0x3'))['db'];var config=require('../../config/environment');var pm2=require(_0x0030('0x4'));var logger=require(_0x0030('0x5'))(_0x0030('0x6'));var git=require(_0x0030('0x7'))(config[_0x0030('0x8')]);exports[_0x0030('0x9')]=function(_0x274b53,_0x5098ca){var _0xd0f612={'current':module[_0x0030('0xa')]['version'],'phonebar':0x2};if(_0x274b53['query']&&_0x274b53['query'][_0x0030('0xb')]){return git['fetch']()['tags'](function(_0x5c112c,_0xc2b213){_0xd0f612['latest']=(_0x5c112c?module[_0x0030('0xa')]['version']:_0xc2b213[_0x0030('0xb')])||_0x0030('0xc');return _0x5098ca[_0x0030('0xd')](0xc8)[_0x0030('0xe')](_0xd0f612);});}else{return _0x5098ca['status'](0xc8)[_0x0030('0xe')](_0xd0f612);}};exports['fetch']=function(_0x5a693a,_0x1e06d5){return git['fetch'](['origin','master'],function(_0x282121){if(_0x282121){logger[_0x0030('0xf')](_0x282121);return _0x1e06d5['status'](0x1f4)[_0x0030('0xe')](_0x282121);}logger['info'](_0x0030('0x10'));return _0x1e06d5[_0x0030('0xd')](0xc8)[_0x0030('0xe')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x0030('0x11')]=function(_0x198b5e,_0x4b09a9){return git['reset']([_0x0030('0x12'),'FETCH_HEAD'],function(_0x2abe92){if(_0x2abe92){logger[_0x0030('0xf')](_0x2abe92);return _0x4b09a9[_0x0030('0xd')](0x1f4)[_0x0030('0xe')](_0x2abe92);}logger[_0x0030('0x13')](_0x0030('0x14'));return _0x4b09a9[_0x0030('0xd')](0xc8)[_0x0030('0xe')]({'output':_0x0030('0x15')});});};exports[_0x0030('0x16')]=function(_0x2adcd6,_0x1fc976){exec(_0x0030('0x17'),function(_0x4ea879,_0x4892c1,_0x5abb1c){logger['info'](_0x4892c1);logger['info'](_0x5abb1c);if(_0x4ea879){logger[_0x0030('0xf')](_0x4ea879);return _0x1fc976[_0x0030('0xd')](0x1f4)[_0x0030('0xe')](_0x4ea879);}return _0x1fc976[_0x0030('0xd')](0xc8)[_0x0030('0xe')]({'output':_0x4892c1});});};exports[_0x0030('0x18')]=function(_0x3cccf7,_0x255361){return pm2['restart'](_0x0030('0x19'))['then'](function(_0x204cfe){logger[_0x0030('0x13')](_0x0030('0x1a'),_0x204cfe);return _0x255361[_0x0030('0xd')](0xc8)['json']({'output':_0x0030('0x1b')});})[_0x0030('0x1c')](function(_0x2acc31){logger['error'](_0x2acc31);return _0x255361[_0x0030('0xd')](0x1f4)[_0x0030('0xe')](_0x2acc31);});};exports[_0x0030('0x1d')]=function(_0x21548b,_0x18ce2b){var _0x5835b9=fs[_0x0030('0x1e')](path[_0x0030('0x1f')](config[_0x0030('0x8')],_0x0030('0x20'),_0x0030('0x1d')));var _0x4a54a9=[];for(var _0x511d19=0x0;_0x511d19<_0x5835b9['length'];_0x511d19++){var _0x3bcf7f=_0x5835b9[_0x511d19][_0x0030('0x21')](_0x0030('0x22'),'');if(compareVersions(module[_0x0030('0xa')][_0x0030('0x0')],_0x3bcf7f)===-0x1){_0x4a54a9['push'](_0x3bcf7f);}}if(_0x4a54a9[_0x0030('0x23')]){var _0x277faf=_0x4a54a9[_0x0030('0x24')](compareVersions);var _0x45c3fc=new Umzug({'storage':_0x0030('0x25'),'storageOptions':{'model':db['Migration'],'modelName':_0x0030('0x26'),'columnName':_0x0030('0x0')},'migrations':{'params':[db[_0x0030('0x25')][_0x0030('0x27')](),db[_0x0030('0x25')][_0x0030('0x28')],function(){throw new Error(_0x0030('0x29'));}],'path':path['join'](config['root'],_0x0030('0x20'),_0x0030('0x1d')),'pattern':/\.js$/}});_0x45c3fc['up']({'migrations':_[_0x0030('0x2a')](_0x277faf,function(_0xdf25f){return _0xdf25f+_0x0030('0x22');})})[_0x0030('0x2b')](function(){return _0x18ce2b['status'](0xc8)[_0x0030('0xe')]({'output':_0x0030('0x2c')+module[_0x0030('0xa')][_0x0030('0x0')]+'\x20to\x20'+_[_0x0030('0x2d')](_0x277faf),'migrations':_[_0x0030('0x1f')](_0x277faf)});})[_0x0030('0x1c')](function(_0x5262c9){if(_0x5262c9 instanceof db[_0x0030('0x25')][_0x0030('0x2e')]){return _0x18ce2b[_0x0030('0xd')](0xc8)[_0x0030('0xe')]({'output':_0x0030('0x2f')});}else{return _0x18ce2b['status'](0x1f4)['json'](_0x5262c9);}});}else{return _0x18ce2b['status'](0xc8)[_0x0030('0xe')]({'output':_0x0030('0x2f')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 7fd062c..2e4b697 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 _0xa739=['exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x529abc,_0x17b97e){var _0x453afa=function(_0x536263){while(--_0x536263){_0x529abc['push'](_0x529abc['shift']());}};_0x453afa(++_0x17b97e);}(_0xa739,0x1e1));var _0x9a73=function(_0x471fc4,_0x1c7033){_0x471fc4=_0x471fc4-0x0;var _0x3432e6=_0xa739[_0x471fc4];return _0x3432e6;};'use strict';var multer=require('multer');var util=require(_0x9a73('0x0'));var path=require('path');var timeout=require(_0x9a73('0x1'));var express=require(_0x9a73('0x2'));var router=express['Router']();var fs_extra=require(_0x9a73('0x3'));var auth=require(_0x9a73('0x4'));var interaction=require(_0x9a73('0x5'));var config=require('../../config/environment');var controller=require(_0x9a73('0x6'));router[_0x9a73('0x7')]('/',auth[_0x9a73('0x8')](),controller[_0x9a73('0x9')]);router[_0x9a73('0x7')](_0x9a73('0xa'),auth[_0x9a73('0x8')](),controller[_0x9a73('0xb')]);router['get'](_0x9a73('0xc'),auth['isAuthenticated'](),controller[_0x9a73('0xd')]);router[_0x9a73('0xe')]('/',auth[_0x9a73('0x8')](),controller['create']);router[_0x9a73('0xf')](_0x9a73('0xc'),auth['isAuthenticated'](),controller[_0x9a73('0x10')]);router[_0x9a73('0x11')](_0x9a73('0xc'),auth['isAuthenticated'](),controller[_0x9a73('0x12')]);module[_0x9a73('0x13')]=router; \ No newline at end of file +var _0x23c1=['./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x579802,_0x1cf14a){var _0x3efeb8=function(_0xd388f3){while(--_0xd388f3){_0x579802['push'](_0x579802['shift']());}};_0x3efeb8(++_0x1cf14a);}(_0x23c1,0x19a));var _0x123c=function(_0x5a5b60,_0x548df6){_0x5a5b60=_0x5a5b60-0x0;var _0x5cbaac=_0x23c1[_0x5a5b60];return _0x5cbaac;};'use strict';var multer=require(_0x123c('0x0'));var util=require(_0x123c('0x1'));var path=require(_0x123c('0x2'));var timeout=require(_0x123c('0x3'));var express=require(_0x123c('0x4'));var router=express[_0x123c('0x5')]();var fs_extra=require(_0x123c('0x6'));var auth=require(_0x123c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x123c('0x8'));router[_0x123c('0x9')]('/',auth[_0x123c('0xa')](),controller[_0x123c('0xb')]);router[_0x123c('0x9')]('/describe',auth[_0x123c('0xa')](),controller[_0x123c('0xc')]);router['get'](_0x123c('0xd'),auth[_0x123c('0xa')](),controller[_0x123c('0xe')]);router[_0x123c('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x123c('0x10')]('/:id',auth[_0x123c('0xa')](),controller[_0x123c('0x11')]);router[_0x123c('0x12')](_0x123c('0xd'),auth[_0x123c('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 20d0480..6148416 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 _0x7275=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x396188,_0x4e0289){var _0x285f62=function(_0x3ede0f){while(--_0x3ede0f){_0x396188['push'](_0x396188['shift']());}};_0x285f62(++_0x4e0289);}(_0x7275,0x143));var _0x5727=function(_0x516247,_0x5466ca){_0x516247=_0x516247-0x0;var _0x4b8122=_0x7275[_0x516247];return _0x4b8122;};'use strict';var Sequelize=require(_0x5727('0x0'));module[_0x5727('0x1')]={'type':{'type':Sequelize[_0x5727('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5727('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5727('0x2')]},'interface':{'type':Sequelize[_0x5727('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x5727('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5727('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x5727('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x5727('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5727('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5727('0x4')]},'reason':{'type':Sequelize[_0x5727('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5727('0x2')]},'channelstate':{'type':Sequelize[_0x5727('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5727('0x2')]},'connectedlinename':{'type':Sequelize[_0x5727('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5727('0x2')]},'context':{'type':Sequelize[_0x5727('0x2')]},'exten':{'type':Sequelize[_0x5727('0x2')]},'priority':{'type':Sequelize[_0x5727('0x2')]},'destchannel':{'type':Sequelize[_0x5727('0x2')]},'destchannelstate':{'type':Sequelize[_0x5727('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x5727('0x2')]},'destcalleridname':{'type':Sequelize[_0x5727('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5727('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x5727('0x2')]},'destlanguage':{'type':Sequelize[_0x5727('0x2')]},'destaccountcode':{'type':Sequelize[_0x5727('0x2')]},'destcontext':{'type':Sequelize[_0x5727('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5727('0x2')]},'destuniqueid':{'type':Sequelize[_0x5727('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x5727('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x5727('0x2')]},'transfer':{'type':Sequelize[_0x5727('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5727('0x2')],'comment':_0x5727('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x5727('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1399=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x18cca1,_0x190962){var _0x3261c7=function(_0x1e2bf3){while(--_0x1e2bf3){_0x18cca1['push'](_0x18cca1['shift']());}};_0x3261c7(++_0x190962);}(_0x1399,0x16c));var _0x9139=function(_0x151e0b,_0x3bec86){_0x151e0b=_0x151e0b-0x0;var _0x5d4a5c=_0x1399[_0x151e0b];return _0x5d4a5c;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9139('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9139('0x2')]},'queue':{'type':Sequelize[_0x9139('0x2')]},'interface':{'type':Sequelize[_0x9139('0x2')]},'membername':{'type':Sequelize[_0x9139('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9139('0x3')]},'agentconnectAt':{'type':Sequelize[_0x9139('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x9139('0x3')]},'holdtime':{'type':Sequelize[_0x9139('0x4')]},'agentcomplete':{'type':Sequelize[_0x9139('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9139('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9139('0x4')]},'reason':{'type':Sequelize[_0x9139('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9139('0x2')]},'channelstate':{'type':Sequelize[_0x9139('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9139('0x2')]},'language':{'type':Sequelize[_0x9139('0x2')]},'accountcode':{'type':Sequelize[_0x9139('0x2')]},'context':{'type':Sequelize[_0x9139('0x2')]},'exten':{'type':Sequelize[_0x9139('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x9139('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x9139('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9139('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x9139('0x2')]},'destlanguage':{'type':Sequelize[_0x9139('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9139('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9139('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x9139('0x2')]},'transfer':{'type':Sequelize[_0x9139('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9139('0x2')],'comment':_0x9139('0x6')},'transferexten':{'type':Sequelize[_0x9139('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'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 50bf8b8..13a7be1 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(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 cc081d9..d7fb6cb 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 _0xcea5=['api','moment','request-promise','path','rimraf','../../config/environment','exports','uniqueid','destuniqueid','lodash','util','../../config/logger'];(function(_0x2e2a1d,_0x44158d){var _0x585e4a=function(_0x58dedc){while(--_0x58dedc){_0x2e2a1d['push'](_0x2e2a1d['shift']());}};_0x585e4a(++_0x44158d);}(_0xcea5,0xed));var _0x5cea=function(_0x3cd3c1,_0x4ca4b7){_0x3cd3c1=_0x3cd3c1-0x0;var _0x1b0d3b=_0xcea5[_0x3cd3c1];return _0x1b0d3b;};'use strict';var _=require(_0x5cea('0x0'));var util=require(_0x5cea('0x1'));var logger=require(_0x5cea('0x2'))(_0x5cea('0x3'));var moment=require(_0x5cea('0x4'));var BPromise=require('bluebird');var rp=require(_0x5cea('0x5'));var fs=require('fs');var path=require(_0x5cea('0x6'));var rimraf=require(_0x5cea('0x7'));var config=require(_0x5cea('0x8'));var attributes=require('./voiceAgentReport.attributes');module[_0x5cea('0x9')]=function(_0x31e6f3,_0x599bc5){return _0x31e6f3['define']('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5cea('0xa'),_0x5cea('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae1c=['VoiceAgentReport','report_agent','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define'];(function(_0x37425b,_0x3b8678){var _0x10fa19=function(_0x19e6a5){while(--_0x19e6a5){_0x37425b['push'](_0x37425b['shift']());}};_0x10fa19(++_0x3b8678);}(_0xae1c,0xff));var _0xcae1=function(_0x5e9a7e,_0x1175c2){_0x5e9a7e=_0x5e9a7e-0x0;var _0x59bb96=_0xae1c[_0x5e9a7e];return _0x59bb96;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcae1('0x0'));var BPromise=require(_0xcae1('0x1'));var rp=require(_0xcae1('0x2'));var fs=require('fs');var path=require(_0xcae1('0x3'));var rimraf=require(_0xcae1('0x4'));var config=require(_0xcae1('0x5'));var attributes=require(_0xcae1('0x6'));module[_0xcae1('0x7')]=function(_0x3513e5,_0x40fcec){return _0x3513e5[_0xcae1('0x8')](_0xcae1('0x9'),attributes,{'tableName':_0xcae1('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid','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 8b712f8..80bddc6 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 _0x84d7=['limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','VoiceAgentReport,\x20%s,\x20%s','message','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','stringify','update','where','attributes'];(function(_0x319a5a,_0x2e8567){var _0x400fdf=function(_0x159a38){while(--_0x159a38){_0x319a5a['push'](_0x319a5a['shift']());}};_0x400fdf(++_0x2e8567);}(_0x84d7,0xe9));var _0x784d=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x84d7[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x784d('0x0'));var util=require(_0x784d('0x1'));var moment=require(_0x784d('0x2'));var BPromise=require(_0x784d('0x3'));var rs=require(_0x784d('0x4'));var fs=require('fs');var Redis=require(_0x784d('0x5'));var db=require(_0x784d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x784d('0x7'))(_0x784d('0x8'));var config=require(_0x784d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x784d('0xa')][_0x784d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6eb3e,_0x431f89,_0x5e5145){return new BPromise(function(_0x2ffe1c,_0x20b0e4){return client[_0x784d('0xc')](_0x6eb3e,_0x5e5145)[_0x784d('0xd')](function(_0x39526e){logger[_0x784d('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x431f89,_0x784d('0xf'));logger[_0x784d('0x10')](_0x784d('0x11'),_0x431f89,_0x784d('0xf'),JSON['stringify'](_0x39526e));if(_0x39526e[_0x784d('0x12')]){if(_0x39526e['error']['code']===0x1f4){logger[_0x784d('0x12')](_0x784d('0x13'),_0x431f89,_0x39526e[_0x784d('0x12')][_0x784d('0x14')]);return _0x20b0e4(_0x39526e[_0x784d('0x12')][_0x784d('0x14')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x431f89,_0x39526e[_0x784d('0x12')]['message']);return _0x2ffe1c(_0x39526e[_0x784d('0x12')][_0x784d('0x14')]);}else{logger[_0x784d('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x431f89,_0x784d('0xf'));_0x2ffe1c(_0x39526e['result']['message']);}})[_0x784d('0x15')](function(_0x2bf038){logger[_0x784d('0x12')](_0x784d('0x13'),_0x431f89,_0x2bf038);_0x20b0e4(_0x2bf038);});});}exports[_0x784d('0x16')]=function(_0x560137){var _0x126622=this;return new Promise(function(_0x51f563,_0xe878d6){return db[_0x784d('0x17')][_0x784d('0x18')](_0x560137[_0x784d('0x19')],{'raw':_0x560137[_0x784d('0x1a')]?_0x560137['options']['raw']===undefined?!![]:![]:!![]})[_0x784d('0xd')](function(_0x36c3f1){logger[_0x784d('0xe')](_0x784d('0x16'),_0x560137);logger['debug']('CreateVoiceAgentReport',_0x560137,JSON[_0x784d('0x1b')](_0x36c3f1));_0x51f563(_0x36c3f1);})[_0x784d('0x15')](function(_0x2e2012){logger['error'](_0x784d('0x16'),_0x2e2012[_0x784d('0x14')],_0x560137);_0xe878d6(_0x126622[_0x784d('0x12')](0x1f4,_0x2e2012[_0x784d('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x43d69d){var _0x4bd48c=this;return new Promise(function(_0x413fe0,_0x2348f8){return db[_0x784d('0x17')][_0x784d('0x1c')](_0x43d69d[_0x784d('0x19')],{'raw':_0x43d69d['options']?_0x43d69d[_0x784d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43d69d[_0x784d('0x1a')]?_0x43d69d['options'][_0x784d('0x1d')]||null:null,'attributes':_0x43d69d[_0x784d('0x1a')]?_0x43d69d[_0x784d('0x1a')][_0x784d('0x1e')]||null:null,'limit':_0x43d69d[_0x784d('0x1a')]?_0x43d69d['options'][_0x784d('0x1f')]||null:null})['then'](function(_0x3934d8){logger[_0x784d('0xe')](_0x784d('0x20'),_0x43d69d);logger[_0x784d('0x10')](_0x784d('0x20'),_0x43d69d,JSON['stringify'](_0x3934d8));_0x413fe0(_0x3934d8);})['catch'](function(_0x7c2fea){logger[_0x784d('0x12')]('UpdateVoiceAgentReport',_0x7c2fea[_0x784d('0x14')],_0x43d69d);_0x2348f8(_0x4bd48c[_0x784d('0x12')](0x1f4,_0x7c2fea['message']));});});}; \ No newline at end of file +var _0xc18b=['client','request','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','CreateVoiceAgentReport','create','options','raw','then','UpdateVoiceAgentReport','VoiceAgentReport','update','body','where','attributes','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4ddc7a,_0x5b6cb8){var _0x4547c1=function(_0x3739e7){while(--_0x3739e7){_0x4ddc7a['push'](_0x4ddc7a['shift']());}};_0x4547c1(++_0x5b6cb8);}(_0xc18b,0x16b));var _0xbc18=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xc18b[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0xbc18('0x0'));var util=require(_0xbc18('0x1'));var moment=require(_0xbc18('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc18('0x3'));var fs=require('fs');var Redis=require(_0xbc18('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc18('0x5'));var logger=require(_0xbc18('0x6'))(_0xbc18('0x7'));var config=require(_0xbc18('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbc18('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254f34,_0x200b70,_0x36b980){return new BPromise(function(_0x5b595e,_0x2ea1d0){return client[_0xbc18('0xa')](_0x254f34,_0x36b980)['then'](function(_0x208c75){logger[_0xbc18('0xb')](_0xbc18('0xc'),_0x200b70,'request\x20sent');logger[_0xbc18('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x200b70,'request\x20sent',JSON[_0xbc18('0xe')](_0x208c75));if(_0x208c75[_0xbc18('0xf')]){if(_0x208c75[_0xbc18('0xf')][_0xbc18('0x10')]===0x1f4){logger[_0xbc18('0xf')](_0xbc18('0xc'),_0x200b70,_0x208c75['error']['message']);return _0x2ea1d0(_0x208c75[_0xbc18('0xf')][_0xbc18('0x11')]);}logger[_0xbc18('0xf')](_0xbc18('0xc'),_0x200b70,_0x208c75['error']['message']);return _0x5b595e(_0x208c75[_0xbc18('0xf')][_0xbc18('0x11')]);}else{logger[_0xbc18('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x200b70,_0xbc18('0x12'));_0x5b595e(_0x208c75['result'][_0xbc18('0x11')]);}})[_0xbc18('0x13')](function(_0x57ec41){logger[_0xbc18('0xf')](_0xbc18('0xc'),_0x200b70,_0x57ec41);_0x2ea1d0(_0x57ec41);});});}exports[_0xbc18('0x14')]=function(_0x4cf31e){var _0x5415aa=this;return new Promise(function(_0xda54ce,_0x18b2b3){return db['VoiceAgentReport'][_0xbc18('0x15')](_0x4cf31e['body'],{'raw':_0x4cf31e[_0xbc18('0x16')]?_0x4cf31e[_0xbc18('0x16')][_0xbc18('0x17')]===undefined?!![]:![]:!![]})[_0xbc18('0x18')](function(_0x4f6940){logger[_0xbc18('0xb')](_0xbc18('0x14'),_0x4cf31e);logger['debug']('CreateVoiceAgentReport',_0x4cf31e,JSON[_0xbc18('0xe')](_0x4f6940));_0xda54ce(_0x4f6940);})[_0xbc18('0x13')](function(_0x36b2c2){logger[_0xbc18('0xf')]('CreateVoiceAgentReport',_0x36b2c2['message'],_0x4cf31e);_0x18b2b3(_0x5415aa[_0xbc18('0xf')](0x1f4,_0x36b2c2[_0xbc18('0x11')]));});});};exports[_0xbc18('0x19')]=function(_0x2c33ae){var _0xce5eea=this;return new Promise(function(_0x5ad23c,_0x5f0536){return db[_0xbc18('0x1a')][_0xbc18('0x1b')](_0x2c33ae[_0xbc18('0x1c')],{'raw':_0x2c33ae['options']?_0x2c33ae['options'][_0xbc18('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c33ae[_0xbc18('0x16')]?_0x2c33ae[_0xbc18('0x16')][_0xbc18('0x1d')]||null:null,'attributes':_0x2c33ae[_0xbc18('0x16')]?_0x2c33ae[_0xbc18('0x16')][_0xbc18('0x1e')]||null:null,'limit':_0x2c33ae[_0xbc18('0x16')]?_0x2c33ae['options']['limit']||null:null})[_0xbc18('0x18')](function(_0x395204){logger[_0xbc18('0xb')](_0xbc18('0x19'),_0x2c33ae);logger[_0xbc18('0xd')](_0xbc18('0x19'),_0x2c33ae,JSON[_0xbc18('0xe')](_0x395204));_0x5ad23c(_0x395204);})['catch'](function(_0xc5a0b4){logger[_0xbc18('0xf')](_0xbc18('0x19'),_0xc5a0b4[_0xbc18('0x11')],_0x2c33ae);_0x5f0536(_0xce5eea['error'](0x1f4,_0xc5a0b4[_0xbc18('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 6fa12c9..21d0e48 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 _0xb458=['./voiceCallReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x55c937,_0x4136f7){var _0xc45fad=function(_0xf2e4c){while(--_0xf2e4c){_0x55c937['push'](_0x55c937['shift']());}};_0xc45fad(++_0x4136f7);}(_0xb458,0x103));var _0x8b45=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0xb458[_0x46f3f8];return _0xbc57cd;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b45('0x3')]();var fs_extra=require(_0x8b45('0x4'));var auth=require(_0x8b45('0x5'));var interaction=require(_0x8b45('0x6'));var config=require('../../config/environment');var controller=require(_0x8b45('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b45('0x8')]);router[_0x8b45('0x9')](_0x8b45('0xa'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xc')]);router['get'](_0x8b45('0xd'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xe')]);router[_0x8b45('0xf')]('/',auth[_0x8b45('0xb')](),controller['create']);router[_0x8b45('0x10')](_0x8b45('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8b45('0xb')](),controller[_0x8b45('0x11')]);module[_0x8b45('0x12')]=router; \ No newline at end of file +var _0x4bc3=['post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0xf63d81,_0x4816a2){var _0x40c21d=function(_0xeacdd5){while(--_0xeacdd5){_0xf63d81['push'](_0xf63d81['shift']());}};_0x40c21d(++_0x4816a2);}(_0x4bc3,0x16e));var _0x34bc=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x4bc3[_0x176329];return _0x31997c;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x34bc('0xb')]);router[_0x34bc('0x9')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x34bc('0xf')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x10')]('/:id',auth[_0x34bc('0xa')](),controller[_0x34bc('0x11')]);module[_0x34bc('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 5cdc756..358b9c0 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 _0x8b35=['inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound'];(function(_0x4595e6,_0x1e72df){var _0x18c7da=function(_0x396c5b){while(--_0x396c5b){_0x4595e6['push'](_0x4595e6['shift']());}};_0x18c7da(++_0x1e72df);}(_0x8b35,0x17a));var _0x58b3=function(_0xe1146,_0x47e05e){_0xe1146=_0xe1146-0x0;var _0x5e0210=_0x8b35[_0xe1146];return _0x5e0210;};'use strict';var Sequelize=require(_0x58b3('0x0'));module[_0x58b3('0x1')]={'uniqueid':{'type':Sequelize[_0x58b3('0x2')]},'type':{'type':Sequelize[_0x58b3('0x3')](_0x58b3('0x4'),'internal',_0x58b3('0x5'),_0x58b3('0x6'),_0x58b3('0x7'),_0x58b3('0x8'))},'tag':{'type':Sequelize[_0x58b3('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x58b3('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x58b3('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x58b3('0x2')]},'lastapplication':{'type':Sequelize[_0x58b3('0x2')]},'lastdata':{'type':Sequelize[_0x58b3('0x9')]},'starttime':{'type':Sequelize[_0x58b3('0xa')]},'systemanswertime':{'type':Sequelize[_0x58b3('0xa')]},'answertime':{'type':Sequelize[_0x58b3('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x58b3('0xb')]},'billableseconds':{'type':Sequelize[_0x58b3('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x58b3('0x2')]},'amaflags':{'type':Sequelize[_0x58b3('0x2')]},'userfield':{'type':Sequelize[_0x58b3('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x58b3('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x58b3('0x2')]},'prefix':{'type':Sequelize[_0x58b3('0x2')]},'routeid':{'type':Sequelize[_0x58b3('0xb')]},'sipcallid':{'type':Sequelize[_0x58b3('0x2')]}}; \ No newline at end of file +var _0xe9e9=['outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal'];(function(_0xfc34ce,_0x4d7c98){var _0x1b8863=function(_0x854516){while(--_0x854516){_0xfc34ce['push'](_0xfc34ce['shift']());}};_0x1b8863(++_0x4d7c98);}(_0xe9e9,0x1c1));var _0x9e9e=function(_0x1ca4a9,_0x443909){_0x1ca4a9=_0x1ca4a9-0x0;var _0x5e4454=_0xe9e9[_0x1ca4a9];return _0x5e4454;};'use strict';var Sequelize=require(_0x9e9e('0x0'));module[_0x9e9e('0x1')]={'uniqueid':{'type':Sequelize[_0x9e9e('0x2')]},'type':{'type':Sequelize[_0x9e9e('0x3')](_0x9e9e('0x4'),_0x9e9e('0x5'),_0x9e9e('0x6'),_0x9e9e('0x7'),_0x9e9e('0x8'),_0x9e9e('0x9'))},'tag':{'type':Sequelize[_0x9e9e('0x2')]},'accountcode':{'type':Sequelize[_0x9e9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x9e9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x9e9e('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9e9e('0x2')]},'destinationchannel':{'type':Sequelize[_0x9e9e('0x2')]},'lastapplication':{'type':Sequelize[_0x9e9e('0x2')]},'lastdata':{'type':Sequelize[_0x9e9e('0xa')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x9e9e('0xb')]},'answertime':{'type':Sequelize[_0x9e9e('0xb')]},'endtime':{'type':Sequelize[_0x9e9e('0xb')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x9e9e('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9e9e('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x9e9e('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x9e9e('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x9e9e('0x2')]},'note':{'type':Sequelize[_0x9e9e('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x9e9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 61cc0ce..50b6f88 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(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0x5f2f,0x73));var _0xf5f2=function(_0x39bd80,_0x48cc4b){_0x39bd80=_0x39bd80-0x0;var _0x368d24=_0x5f2f[_0x39bd80];return _0x368d24;};'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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x2ef3,0xba));var _0x32ef=function(_0x200a1a,_0x581924){_0x200a1a=_0x200a1a-0x0;var _0x128f9f=_0x2ef3[_0x200a1a];return _0x128f9f;};'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'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 6e23526..8409d17 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 _0x11a9=['../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','util','../../config/logger','bluebird','request-promise','path'];(function(_0x2f38d7,_0x24deab){var _0x157fcb=function(_0xd73def){while(--_0xd73def){_0x2f38d7['push'](_0x2f38d7['shift']());}};_0x157fcb(++_0x24deab);}(_0x11a9,0x145));var _0x911a=function(_0x17e275,_0x32310e){_0x17e275=_0x17e275-0x0;var _0x57c7c1=_0x11a9[_0x17e275];return _0x57c7c1;};'use strict';var _=require('lodash');var util=require(_0x911a('0x0'));var logger=require(_0x911a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x911a('0x2'));var rp=require(_0x911a('0x3'));var fs=require('fs');var path=require(_0x911a('0x4'));var rimraf=require('rimraf');var config=require(_0x911a('0x5'));var attributes=require(_0x911a('0x6'));module['exports']=function(_0x51c8d9,_0x57763b){return _0x51c8d9[_0x911a('0x7')](_0x911a('0x8'),attributes,{'tableName':_0x911a('0x9'),'paranoid':![],'indexes':[{'fields':[_0x911a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x162e=['request-promise','path','rimraf','exports','VoiceCallReport','report_call','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x162e,0x75));var _0xe162=function(_0x5d4fc2,_0x42ef4e){_0x5d4fc2=_0x5d4fc2-0x0;var _0x5cf632=_0x162e[_0x5d4fc2];return _0x5cf632;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe162('0x0'))(_0xe162('0x1'));var moment=require(_0xe162('0x2'));var BPromise=require(_0xe162('0x3'));var rp=require(_0xe162('0x4'));var fs=require('fs');var path=require(_0xe162('0x5'));var rimraf=require(_0xe162('0x6'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0xe162('0x7')]=function(_0x5d378e,_0x506e35){return _0x5d378e['define'](_0xe162('0x8'),attributes,{'tableName':_0xe162('0x9'),'paranoid':![],'indexes':[{'fields':[_0xe162('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 7d4d478..5ff1a2f 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 _0xb896=['result','catch','options','raw','where','attributes','limit','map','include','model','GetVoiceCallReport','stringify','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','error','code','VoiceCallReport,\x20%s,\x20%s','message'];(function(_0x52b0d6,_0x4ea14b){var _0x5ded6c=function(_0x1f5d70){while(--_0x1f5d70){_0x52b0d6['push'](_0x52b0d6['shift']());}};_0x5ded6c(++_0x4ea14b);}(_0xb896,0xbf));var _0x6b89=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0xb896[_0x5a5395];return _0x4da43d;};'use strict';var _=require(_0x6b89('0x0'));var util=require(_0x6b89('0x1'));var moment=require(_0x6b89('0x2'));var BPromise=require(_0x6b89('0x3'));var rs=require(_0x6b89('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b89('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b89('0x6'))(_0x6b89('0x7'));var config=require(_0x6b89('0x8'));var jayson=require(_0x6b89('0x9'));var client=jayson[_0x6b89('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fdf9e,_0x391dc2,_0x11e249){return new BPromise(function(_0xe0d2f,_0x7d353d){return client['request'](_0x2fdf9e,_0x11e249)[_0x6b89('0xb')](function(_0x12d974){logger[_0x6b89('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x391dc2,_0x6b89('0xd'));logger[_0x6b89('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x391dc2,_0x6b89('0xd'),JSON['stringify'](_0x12d974));if(_0x12d974['error']){if(_0x12d974[_0x6b89('0xf')][_0x6b89('0x10')]===0x1f4){logger['error'](_0x6b89('0x11'),_0x391dc2,_0x12d974[_0x6b89('0xf')][_0x6b89('0x12')]);return _0x7d353d(_0x12d974[_0x6b89('0xf')][_0x6b89('0x12')]);}logger[_0x6b89('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x391dc2,_0x12d974[_0x6b89('0xf')][_0x6b89('0x12')]);return _0xe0d2f(_0x12d974[_0x6b89('0xf')][_0x6b89('0x12')]);}else{logger['info'](_0x6b89('0x11'),_0x391dc2,_0x6b89('0xd'));_0xe0d2f(_0x12d974[_0x6b89('0x13')][_0x6b89('0x12')]);}})[_0x6b89('0x14')](function(_0x36d96d){logger['error'](_0x6b89('0x11'),_0x391dc2,_0x36d96d);_0x7d353d(_0x36d96d);});});}exports['GetVoiceCallReport']=function(_0x222c91){var _0x2c96f5=this;return new Promise(function(_0x66ac6f,_0x32fcba){return db['VoiceCallReport']['findAll']({'raw':_0x222c91[_0x6b89('0x15')]?_0x222c91['options'][_0x6b89('0x16')]===undefined?!![]:![]:!![],'where':_0x222c91['options']?_0x222c91[_0x6b89('0x15')][_0x6b89('0x17')]||null:null,'attributes':_0x222c91[_0x6b89('0x15')]?_0x222c91[_0x6b89('0x15')][_0x6b89('0x18')]||null:null,'limit':_0x222c91[_0x6b89('0x15')]?_0x222c91[_0x6b89('0x15')][_0x6b89('0x19')]||null:null,'include':_0x222c91[_0x6b89('0x15')]?_0x222c91['options']['include']?_[_0x6b89('0x1a')](_0x222c91[_0x6b89('0x15')][_0x6b89('0x1b')],function(_0xe7d755){return{'model':db[_0xe7d755[_0x6b89('0x1c')]],'as':_0xe7d755['as'],'attributes':_0xe7d755[_0x6b89('0x18')],'include':_0xe7d755[_0x6b89('0x1b')]?_[_0x6b89('0x1a')](_0xe7d755['include'],function(_0x485390){return{'model':db[_0x485390[_0x6b89('0x1c')]],'as':_0x485390['as'],'attributes':_0x485390[_0x6b89('0x18')],'include':_0x485390[_0x6b89('0x1b')]?_[_0x6b89('0x1a')](_0x485390['include'],function(_0x161d75){return{'model':db[_0x161d75[_0x6b89('0x1c')]],'as':_0x161d75['as'],'attributes':_0x161d75[_0x6b89('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6b89('0xb')](function(_0xd21f51){logger['info']('GetVoiceCallReport',_0x222c91);logger['debug'](_0x6b89('0x1d'),_0x222c91,JSON[_0x6b89('0x1e')](_0xd21f51));_0x66ac6f(_0xd21f51);})[_0x6b89('0x14')](function(_0x23e7a0){logger[_0x6b89('0xf')](_0x6b89('0x1d'),_0x23e7a0['message'],_0x222c91);_0x32fcba(_0x2c96f5['error'](0x1f4,_0x23e7a0[_0x6b89('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x3f6448){var _0xc47502=this;return new Promise(function(_0x556299,_0x617359){return db['VoiceCallReport'][_0x6b89('0x1f')](_0x3f6448[_0x6b89('0x20')],{'raw':_0x3f6448['options']?_0x3f6448[_0x6b89('0x15')][_0x6b89('0x16')]===undefined?!![]:![]:!![]})[_0x6b89('0xb')](function(_0x11afb5){logger[_0x6b89('0xc')](_0x6b89('0x21'),_0x3f6448);logger['debug'](_0x6b89('0x21'),_0x3f6448,JSON[_0x6b89('0x1e')](_0x11afb5));_0x556299(_0x11afb5);})[_0x6b89('0x14')](function(_0x4fce45){logger['error']('CreateVoiceCallReport',_0x4fce45[_0x6b89('0x12')],_0x3f6448);_0x617359(_0xc47502[_0x6b89('0xf')](0x1f4,_0x4fce45[_0x6b89('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x3c91e0){var _0xaa4c65=this;return new Promise(function(_0x3a92fd,_0xceacff){return db['VoiceCallReport']['update'](_0x3c91e0['body'],{'raw':_0x3c91e0[_0x6b89('0x15')]?_0x3c91e0[_0x6b89('0x15')][_0x6b89('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c91e0[_0x6b89('0x15')]?_0x3c91e0['options']['where']||null:null,'attributes':_0x3c91e0[_0x6b89('0x15')]?_0x3c91e0[_0x6b89('0x15')][_0x6b89('0x18')]||null:null,'limit':_0x3c91e0[_0x6b89('0x15')]?_0x3c91e0['options'][_0x6b89('0x19')]||null:null})[_0x6b89('0xb')](function(_0x2391b6){logger['info']('UpdateVoiceCallReport',_0x3c91e0);logger[_0x6b89('0xe')](_0x6b89('0x22'),_0x3c91e0,JSON[_0x6b89('0x1e')](_0x2391b6));_0x3a92fd(_0x2391b6);})[_0x6b89('0x14')](function(_0x47a620){logger[_0x6b89('0xf')](_0x6b89('0x22'),_0x47a620[_0x6b89('0x12')],_0x3c91e0);_0xceacff(_0xaa4c65['error'](0x1f4,_0x47a620[_0x6b89('0x12')]));});});}; \ No newline at end of file +var _0x5072=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceCallReport','options','raw','where','attributes','include','map','model','catch','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x271144,_0x1f8516){var _0x288a40=function(_0x3c5b28){while(--_0x3c5b28){_0x271144['push'](_0x271144['shift']());}};_0x288a40(++_0x1f8516);}(_0x5072,0x151));var _0x2507=function(_0x2abfb7,_0x1f6a6b){_0x2abfb7=_0x2abfb7-0x0;var _0x3cfb4e=_0x5072[_0x2abfb7];return _0x3cfb4e;};'use strict';var _=require(_0x2507('0x0'));var util=require(_0x2507('0x1'));var moment=require(_0x2507('0x2'));var BPromise=require(_0x2507('0x3'));var rs=require(_0x2507('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2507('0x5'))(_0x2507('0x6'));var config=require('../../config/environment');var jayson=require(_0x2507('0x7'));var client=jayson[_0x2507('0x8')][_0x2507('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502da8,_0x378f28,_0x3c45e2){return new BPromise(function(_0x4f220f,_0x54f28e){return client[_0x2507('0xa')](_0x502da8,_0x3c45e2)[_0x2507('0xb')](function(_0x22616d){logger[_0x2507('0xc')](_0x2507('0xd'),_0x378f28,'request\x20sent');logger[_0x2507('0xe')](_0x2507('0xf'),_0x378f28,_0x2507('0x10'),JSON[_0x2507('0x11')](_0x22616d));if(_0x22616d[_0x2507('0x12')]){if(_0x22616d[_0x2507('0x12')][_0x2507('0x13')]===0x1f4){logger[_0x2507('0x12')](_0x2507('0xd'),_0x378f28,_0x22616d[_0x2507('0x12')][_0x2507('0x14')]);return _0x54f28e(_0x22616d[_0x2507('0x12')][_0x2507('0x14')]);}logger[_0x2507('0x12')](_0x2507('0xd'),_0x378f28,_0x22616d[_0x2507('0x12')]['message']);return _0x4f220f(_0x22616d['error'][_0x2507('0x14')]);}else{logger[_0x2507('0xc')](_0x2507('0xd'),_0x378f28,_0x2507('0x10'));_0x4f220f(_0x22616d[_0x2507('0x15')][_0x2507('0x14')]);}})['catch'](function(_0x1776d9){logger[_0x2507('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x378f28,_0x1776d9);_0x54f28e(_0x1776d9);});});}exports[_0x2507('0x16')]=function(_0xb3a488){var _0x25e74d=this;return new Promise(function(_0x15deb2,_0x3a2e17){return db['VoiceCallReport']['findAll']({'raw':_0xb3a488[_0x2507('0x17')]?_0xb3a488[_0x2507('0x17')][_0x2507('0x18')]===undefined?!![]:![]:!![],'where':_0xb3a488['options']?_0xb3a488[_0x2507('0x17')][_0x2507('0x19')]||null:null,'attributes':_0xb3a488['options']?_0xb3a488[_0x2507('0x17')][_0x2507('0x1a')]||null:null,'limit':_0xb3a488['options']?_0xb3a488[_0x2507('0x17')]['limit']||null:null,'include':_0xb3a488[_0x2507('0x17')]?_0xb3a488[_0x2507('0x17')][_0x2507('0x1b')]?_[_0x2507('0x1c')](_0xb3a488[_0x2507('0x17')]['include'],function(_0x5f3c9f){return{'model':db[_0x5f3c9f[_0x2507('0x1d')]],'as':_0x5f3c9f['as'],'attributes':_0x5f3c9f[_0x2507('0x1a')],'include':_0x5f3c9f[_0x2507('0x1b')]?_[_0x2507('0x1c')](_0x5f3c9f[_0x2507('0x1b')],function(_0x1017f3){return{'model':db[_0x1017f3['model']],'as':_0x1017f3['as'],'attributes':_0x1017f3[_0x2507('0x1a')],'include':_0x1017f3[_0x2507('0x1b')]?_[_0x2507('0x1c')](_0x1017f3[_0x2507('0x1b')],function(_0x45d1a7){return{'model':db[_0x45d1a7['model']],'as':_0x45d1a7['as'],'attributes':_0x45d1a7[_0x2507('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2507('0xb')](function(_0x2a59ed){logger[_0x2507('0xc')](_0x2507('0x16'),_0xb3a488);logger['debug'](_0x2507('0x16'),_0xb3a488,JSON[_0x2507('0x11')](_0x2a59ed));_0x15deb2(_0x2a59ed);})[_0x2507('0x1e')](function(_0x2a5e67){logger[_0x2507('0x12')](_0x2507('0x16'),_0x2a5e67[_0x2507('0x14')],_0xb3a488);_0x3a2e17(_0x25e74d[_0x2507('0x12')](0x1f4,_0x2a5e67[_0x2507('0x14')]));});});};exports[_0x2507('0x1f')]=function(_0x2a1f7c){var _0x466ced=this;return new Promise(function(_0x1b5a18,_0x508d0e){return db[_0x2507('0x20')][_0x2507('0x21')](_0x2a1f7c[_0x2507('0x22')],{'raw':_0x2a1f7c['options']?_0x2a1f7c[_0x2507('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x2507('0xb')](function(_0x2f84a7){logger['info']('CreateVoiceCallReport',_0x2a1f7c);logger[_0x2507('0xe')](_0x2507('0x1f'),_0x2a1f7c,JSON[_0x2507('0x11')](_0x2f84a7));_0x1b5a18(_0x2f84a7);})['catch'](function(_0xa5283d){logger['error'](_0x2507('0x1f'),_0xa5283d[_0x2507('0x14')],_0x2a1f7c);_0x508d0e(_0x466ced[_0x2507('0x12')](0x1f4,_0xa5283d[_0x2507('0x14')]));});});};exports[_0x2507('0x23')]=function(_0x98b5b6){var _0x5b120e=this;return new Promise(function(_0x80e9c7,_0x429d17){return db[_0x2507('0x20')][_0x2507('0x24')](_0x98b5b6[_0x2507('0x22')],{'raw':_0x98b5b6[_0x2507('0x17')]?_0x98b5b6[_0x2507('0x17')][_0x2507('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x98b5b6[_0x2507('0x17')]?_0x98b5b6[_0x2507('0x17')]['where']||null:null,'attributes':_0x98b5b6[_0x2507('0x17')]?_0x98b5b6['options']['attributes']||null:null,'limit':_0x98b5b6[_0x2507('0x17')]?_0x98b5b6[_0x2507('0x17')][_0x2507('0x25')]||null:null})['then'](function(_0x2d591f){logger[_0x2507('0xc')](_0x2507('0x23'),_0x98b5b6);logger[_0x2507('0xe')]('UpdateVoiceCallReport',_0x98b5b6,JSON['stringify'](_0x2d591f));_0x80e9c7(_0x2d591f);})['catch'](function(_0x37c149){logger[_0x2507('0x12')](_0x2507('0x23'),_0x37c149[_0x2507('0x14')],_0x98b5b6);_0x429d17(_0x5b120e[_0x2507('0x12')](0x1f4,_0x37c149[_0x2507('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 080ff77..e6f4dcb 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 _0x6bc5=['../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0xfb0370,_0x3d5585){var _0x323c86=function(_0x39c86e){while(--_0x39c86e){_0xfb0370['push'](_0xfb0370['shift']());}};_0x323c86(++_0x3d5585);}(_0x6bc5,0xde));var _0x56bc=function(_0x3e06aa,_0x23c555){_0x3e06aa=_0x3e06aa-0x0;var _0x4ad618=_0x6bc5[_0x3e06aa];return _0x4ad618;};'use strict';var multer=require(_0x56bc('0x0'));var util=require(_0x56bc('0x1'));var path=require(_0x56bc('0x2'));var timeout=require(_0x56bc('0x3'));var express=require('express');var router=express[_0x56bc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x56bc('0x5'));var config=require(_0x56bc('0x6'));var controller=require(_0x56bc('0x7'));router[_0x56bc('0x8')]('/',auth['isAuthenticated'](),controller[_0x56bc('0x9')]);router[_0x56bc('0x8')](_0x56bc('0xa'),auth[_0x56bc('0xb')](),controller[_0x56bc('0xc')]);router[_0x56bc('0xd')]('/',auth[_0x56bc('0xb')](),controller[_0x56bc('0xe')]);router[_0x56bc('0xf')](_0x56bc('0xa'),auth[_0x56bc('0xb')](),controller[_0x56bc('0x10')]);router[_0x56bc('0x11')](_0x56bc('0xa'),auth['isAuthenticated'](),controller[_0x56bc('0x12')]);module['exports']=router; \ No newline at end of file +var _0x41a8=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','create','update','delete','destroy'];(function(_0x4177ca,_0x432293){var _0x10ee2b=function(_0x1c1c20){while(--_0x1c1c20){_0x4177ca['push'](_0x4177ca['shift']());}};_0x10ee2b(++_0x432293);}(_0x41a8,0x176));var _0x841a=function(_0x27665c,_0x3bbac6){_0x27665c=_0x27665c-0x0;var _0x235f39=_0x41a8[_0x27665c];return _0x235f39;};'use strict';var multer=require(_0x841a('0x0'));var util=require('util');var path=require(_0x841a('0x1'));var timeout=require(_0x841a('0x2'));var express=require(_0x841a('0x3'));var router=express['Router']();var fs_extra=require(_0x841a('0x4'));var auth=require(_0x841a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x841a('0x6'));var controller=require(_0x841a('0x7'));router[_0x841a('0x8')]('/',auth['isAuthenticated'](),controller[_0x841a('0x9')]);router['get'](_0x841a('0xa'),auth[_0x841a('0xb')](),controller[_0x841a('0xc')]);router['post']('/',auth[_0x841a('0xb')](),controller[_0x841a('0xd')]);router['put'](_0x841a('0xa'),auth[_0x841a('0xb')](),controller[_0x841a('0xe')]);router[_0x841a('0xf')](_0x841a('0xa'),auth[_0x841a('0xb')](),controller[_0x841a('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8e07683..2f67d27 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 _0x7085=['sequelize','STRING','join','getDataValue','options','split','BOOLEAN'];(function(_0x200256,_0x590421){var _0x555785=function(_0x3aac4f){while(--_0x3aac4f){_0x200256['push'](_0x200256['shift']());}};_0x555785(++_0x590421);}(_0x7085,0xa1));var _0x5708=function(_0xa8f776,_0x420cbf){_0xa8f776=_0xa8f776-0x0;var _0x435961=_0x7085[_0xa8f776];return _0x435961;};'use strict';var Sequelize=require(_0x5708('0x0'));module['exports']={'name':{'type':Sequelize[_0x5708('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x5708('0x1')],'set':function(_0x2ef9ec){this['setDataValue']('options',_0x2ef9ec?_0x2ef9ec[_0x5708('0x2')](''):[]);},'get':function(){return this[_0x5708('0x3')](_0x5708('0x4'))?this[_0x5708('0x3')]('options')[_0x5708('0x5')](''):[];}},'auth':{'type':Sequelize[_0x5708('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x5708('0x1')]},'record':{'type':Sequelize[_0x5708('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5708('0x1')]},'description':{'type':Sequelize[_0x5708('0x1')]}}; \ No newline at end of file +var _0x54b4=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','getDataValue','split'];(function(_0x17727e,_0xc002d0){var _0x303082=function(_0x198c3b){while(--_0x198c3b){_0x17727e['push'](_0x17727e['shift']());}};_0x303082(++_0xc002d0);}(_0x54b4,0x14e));var _0x454b=function(_0x5c0795,_0x751672){_0x5c0795=_0x5c0795-0x0;var _0x3711ab=_0x54b4[_0x5c0795];return _0x3711ab;};'use strict';var Sequelize=require(_0x454b('0x0'));module[_0x454b('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x454b('0x2')],'unique':_0x454b('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x454b('0x2')],'set':function(_0x79b1f){this[_0x454b('0x4')](_0x454b('0x5'),_0x79b1f?_0x79b1f['join'](''):[]);},'get':function(){return this[_0x454b('0x6')](_0x454b('0x5'))?this[_0x454b('0x6')](_0x454b('0x5'))[_0x454b('0x7')](''):[];}},'auth':{'type':Sequelize[_0x454b('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x454b('0x2')]},'record':{'type':Sequelize[_0x454b('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x454b('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 5baa73c..d57f0d2 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 _0xc2e8=['stack','name','index','map','VoiceChanSpy','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','rows','params','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','limit','offset','set','apply','save','update','destroy','then','get','ChanSpies','UserProfileResource','error'];(function(_0x4152a3,_0x5d1911){var _0xded787=function(_0x150728){while(--_0x150728){_0x4152a3['push'](_0x4152a3['shift']());}};_0xded787(++_0x5d1911);}(_0xc2e8,0x70));var _0x8c2e=function(_0x4b6e5c,_0x540454){_0x4b6e5c=_0x4b6e5c-0x0;var _0xf7609b=_0xc2e8[_0x4b6e5c];return _0xf7609b;};'use strict';var emlformat=require(_0x8c2e('0x0'));var rimraf=require(_0x8c2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8c2e('0x2'));var moment=require('moment');var BPromise=require(_0x8c2e('0x3'));var Mustache=require(_0x8c2e('0x4'));var util=require(_0x8c2e('0x5'));var path=require('path');var sox=require(_0x8c2e('0x6'));var csv=require(_0x8c2e('0x7'));var ejs=require(_0x8c2e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8c2e('0x9'));var toCsv=require(_0x8c2e('0x7'));var querystring=require(_0x8c2e('0xa'));var Papa=require(_0x8c2e('0xb'));var Redis=require(_0x8c2e('0xc'));var authService=require(_0x8c2e('0xd'));var qs=require(_0x8c2e('0xe'));var as=require(_0x8c2e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c2e('0x10'))(_0x8c2e('0x11'));var utils=require(_0x8c2e('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31067c,_0x364b18){_0x364b18=_0x364b18||0xcc;return function(_0x2952f4){if(_0x2952f4){return _0x31067c[_0x8c2e('0x13')](_0x364b18);}return _0x31067c[_0x8c2e('0x14')](_0x364b18)[_0x8c2e('0x15')]();};}function respondWithResult(_0x26abe0,_0x4f9398){_0x4f9398=_0x4f9398||0xc8;return function(_0x5bedbb){if(_0x5bedbb){return _0x26abe0[_0x8c2e('0x14')](_0x4f9398)[_0x8c2e('0x16')](_0x5bedbb);}};}function respondWithFilteredResult(_0x2095d4,_0x2787af){return function(_0x203b3a){if(_0x203b3a){var _0x3e5f16=typeof _0x2787af['offset']===_0x8c2e('0x17')&&typeof _0x2787af[_0x8c2e('0x18')]===_0x8c2e('0x17');var _0x160901=_0x203b3a['count'];var _0x944b34=_0x3e5f16?0x0:_0x2787af[_0x8c2e('0x19')];var _0x2e2e46=_0x3e5f16?_0x203b3a['count']:_0x2787af['offset']+_0x2787af[_0x8c2e('0x18')];var _0x56a325;if(_0x2e2e46>=_0x160901){_0x2e2e46=_0x160901;_0x56a325=0xc8;}else{_0x56a325=0xce;}_0x2095d4[_0x8c2e('0x14')](_0x56a325);return _0x2095d4[_0x8c2e('0x1a')]('Content-Range',_0x944b34+'-'+_0x2e2e46+'/'+_0x160901)[_0x8c2e('0x16')](_0x203b3a);}return null;};}function patchUpdates(_0x3b101e){return function(_0x3f98f0){try{jsonpatch[_0x8c2e('0x1b')](_0x3f98f0,_0x3b101e,!![]);}catch(_0x107f13){return BPromise['reject'](_0x107f13);}return _0x3f98f0[_0x8c2e('0x1c')]();};}function saveUpdates(_0x5baf2e,_0x4937b0){return function(_0x308dd9){if(_0x308dd9){return _0x308dd9[_0x8c2e('0x1d')](_0x5baf2e)['then'](function(_0x556e83){return _0x556e83;});}return null;};}function removeEntity(_0xfc60d2,_0x5a389d){return function(_0x350cc5){if(_0x350cc5){return _0x350cc5[_0x8c2e('0x1e')]()[_0x8c2e('0x1f')](function(){var _0x50a3db=_0x350cc5[_0x8c2e('0x20')]({'plain':!![]});var _0x15d275=_0x8c2e('0x21');return db[_0x8c2e('0x22')]['destroy']({'where':{'type':_0x15d275,'resourceId':_0x50a3db['id']}})[_0x8c2e('0x1f')](function(){return _0x350cc5;});})['then'](function(){_0xfc60d2['status'](0xcc)[_0x8c2e('0x15')]();});}};}function handleEntityNotFound(_0x26fa84,_0x522d5a){return function(_0x4d0c3c){if(!_0x4d0c3c){_0x26fa84[_0x8c2e('0x13')](0x194);}return _0x4d0c3c;};}function handleError(_0x2021e4,_0x4220ba){_0x4220ba=_0x4220ba||0x1f4;return function(_0x46a69f){logger[_0x8c2e('0x23')](_0x46a69f[_0x8c2e('0x24')]);if(_0x46a69f[_0x8c2e('0x25')]){delete _0x46a69f['name'];}_0x2021e4['status'](_0x4220ba)['send'](_0x46a69f);};}exports[_0x8c2e('0x26')]=function(_0x2f2b6b,_0x26e4b1){var _0x534315={},_0x89de37={},_0x33731f={'count':0x0,'rows':[]};var _0x24d8ba=_[_0x8c2e('0x27')](db[_0x8c2e('0x28')]['rawAttributes'],function(_0x129768){return{'name':_0x129768[_0x8c2e('0x29')],'type':_0x129768['type'][_0x8c2e('0x2a')]};});_0x89de37[_0x8c2e('0x2b')]=_[_0x8c2e('0x27')](_0x24d8ba,_0x8c2e('0x25'));_0x89de37[_0x8c2e('0x2c')]=_[_0x8c2e('0x2d')](_0x2f2b6b[_0x8c2e('0x2c')]);_0x89de37[_0x8c2e('0x2e')]=_['intersection'](_0x89de37[_0x8c2e('0x2b')],_0x89de37[_0x8c2e('0x2c')]);_0x534315[_0x8c2e('0x2f')]=_[_0x8c2e('0x30')](_0x89de37[_0x8c2e('0x2b')],qs[_0x8c2e('0x31')](_0x2f2b6b[_0x8c2e('0x2c')][_0x8c2e('0x31')]));_0x534315[_0x8c2e('0x2f')]=_0x534315['attributes'][_0x8c2e('0x32')]?_0x534315[_0x8c2e('0x2f')]:_0x89de37[_0x8c2e('0x2b')];if(!_0x2f2b6b[_0x8c2e('0x2c')][_0x8c2e('0x33')]('nolimit')){_0x534315['limit']=qs[_0x8c2e('0x18')](_0x2f2b6b[_0x8c2e('0x2c')][_0x8c2e('0x18')]);_0x534315[_0x8c2e('0x19')]=qs[_0x8c2e('0x19')](_0x2f2b6b[_0x8c2e('0x2c')][_0x8c2e('0x19')]);}_0x534315['order']=qs['sort'](_0x2f2b6b[_0x8c2e('0x2c')][_0x8c2e('0x34')]);_0x534315[_0x8c2e('0x35')]=qs[_0x8c2e('0x2e')](_[_0x8c2e('0x36')](_0x2f2b6b[_0x8c2e('0x2c')],_0x89de37[_0x8c2e('0x2e')]),_0x24d8ba);if(_0x2f2b6b[_0x8c2e('0x2c')]['filter']){_0x534315[_0x8c2e('0x35')]=_[_0x8c2e('0x37')](_0x534315[_0x8c2e('0x35')],{'$or':_['map'](_0x24d8ba,function(_0x474407){if(_0x474407['type']!==_0x8c2e('0x38')){var _0x3aefd4={};_0x3aefd4[_0x474407[_0x8c2e('0x25')]]={'$like':'%'+_0x2f2b6b['query']['filter']+'%'};return _0x3aefd4;}})});}_0x534315=_[_0x8c2e('0x37')]({},_0x534315,_0x2f2b6b[_0x8c2e('0x39')]);var _0x542a8f={'where':_0x534315[_0x8c2e('0x35')]};return db[_0x8c2e('0x28')]['count'](_0x542a8f)[_0x8c2e('0x1f')](function(_0x501490){_0x33731f[_0x8c2e('0x3a')]=_0x501490;if(_0x2f2b6b[_0x8c2e('0x2c')][_0x8c2e('0x3b')]){_0x534315[_0x8c2e('0x3c')]=[{'all':!![]}];}return db[_0x8c2e('0x28')]['findAll'](_0x534315);})[_0x8c2e('0x1f')](function(_0x2ae43f){_0x33731f[_0x8c2e('0x3d')]=_0x2ae43f;return _0x33731f;})[_0x8c2e('0x1f')](respondWithFilteredResult(_0x26e4b1,_0x534315))['catch'](handleError(_0x26e4b1,null));};exports['show']=function(_0x442521,_0x2b8683){var _0x3495a3={'raw':![],'where':{'id':_0x442521[_0x8c2e('0x3e')]['id']}},_0x3be1c7={};_0x3be1c7[_0x8c2e('0x2b')]=_[_0x8c2e('0x2d')](db[_0x8c2e('0x28')]['rawAttributes']);_0x3be1c7[_0x8c2e('0x2c')]=_[_0x8c2e('0x2d')](_0x442521[_0x8c2e('0x2c')]);_0x3be1c7[_0x8c2e('0x2e')]=_[_0x8c2e('0x30')](_0x3be1c7[_0x8c2e('0x2b')],_0x3be1c7[_0x8c2e('0x2c')]);_0x3495a3[_0x8c2e('0x2f')]=_[_0x8c2e('0x30')](_0x3be1c7[_0x8c2e('0x2b')],qs[_0x8c2e('0x31')](_0x442521['query'][_0x8c2e('0x31')]));_0x3495a3[_0x8c2e('0x2f')]=_0x3495a3[_0x8c2e('0x2f')]['length']?_0x3495a3[_0x8c2e('0x2f')]:_0x3be1c7[_0x8c2e('0x2b')];if(_0x442521[_0x8c2e('0x2c')][_0x8c2e('0x3b')]){_0x3495a3[_0x8c2e('0x3c')]=[{'all':!![]}];}_0x3495a3=_[_0x8c2e('0x37')]({},_0x3495a3,_0x442521[_0x8c2e('0x39')]);return db[_0x8c2e('0x28')][_0x8c2e('0x3f')](_0x3495a3)[_0x8c2e('0x1f')](handleEntityNotFound(_0x2b8683,null))[_0x8c2e('0x1f')](respondWithResult(_0x2b8683,null))[_0x8c2e('0x40')](handleError(_0x2b8683,null));};exports['create']=function(_0x5f4882,_0x3c0dff){return db[_0x8c2e('0x28')]['create'](_0x5f4882['body'],{})['then'](function(_0x5d3099){var _0x39db30=_0x5f4882[_0x8c2e('0x41')][_0x8c2e('0x20')]({'plain':!![]});if(!_0x39db30)throw new Error(_0x8c2e('0x42'));if(_0x39db30[_0x8c2e('0x43')]===_0x8c2e('0x41')){var _0x25f170=_0x5d3099[_0x8c2e('0x20')]({'plain':!![]});var _0x3f8443=_0x8c2e('0x21');return db[_0x8c2e('0x44')][_0x8c2e('0x3f')]({'where':{'name':_0x3f8443,'userProfileId':_0x39db30[_0x8c2e('0x45')]},'raw':!![]})['then'](function(_0x2d12c7){if(_0x2d12c7&&_0x2d12c7[_0x8c2e('0x46')]===0x0){return db[_0x8c2e('0x22')][_0x8c2e('0x47')]({'name':_0x25f170['name'],'resourceId':_0x25f170['id'],'type':_0x2d12c7[_0x8c2e('0x25')],'sectionId':_0x2d12c7['id']},{})[_0x8c2e('0x1f')](function(){return _0x5d3099;});}else{return _0x5d3099;}})[_0x8c2e('0x40')](function(_0x3d9423){logger[_0x8c2e('0x23')](_0x8c2e('0x48'),_0x3d9423);throw _0x3d9423;});}return _0x5d3099;})[_0x8c2e('0x1f')](respondWithResult(_0x3c0dff,0xc9))[_0x8c2e('0x40')](handleError(_0x3c0dff,null));};exports[_0x8c2e('0x1d')]=function(_0x26abbc,_0x5dfdd3){if(_0x26abbc[_0x8c2e('0x49')]['id']){delete _0x26abbc[_0x8c2e('0x49')]['id'];}return db[_0x8c2e('0x28')][_0x8c2e('0x3f')]({'where':{'id':_0x26abbc['params']['id']}})[_0x8c2e('0x1f')](handleEntityNotFound(_0x5dfdd3,null))['then'](saveUpdates(_0x26abbc[_0x8c2e('0x49')],null))['then'](respondWithResult(_0x5dfdd3,null))[_0x8c2e('0x40')](handleError(_0x5dfdd3,null));};exports['destroy']=function(_0x47640b,_0x4beb4a){return db[_0x8c2e('0x28')][_0x8c2e('0x3f')]({'where':{'id':_0x47640b['params']['id']}})[_0x8c2e('0x1f')](handleEntityNotFound(_0x4beb4a,null))[_0x8c2e('0x1f')](removeEntity(_0x4beb4a,null))[_0x8c2e('0x40')](handleError(_0x4beb4a,null));}; \ No newline at end of file +var _0xbee3=['set','Content-Range','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','index','map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceChanSpy','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','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'];(function(_0x4b8f9c,_0x4078b1){var _0x4b7122=function(_0x1476ac){while(--_0x1476ac){_0x4b8f9c['push'](_0x4b8f9c['shift']());}};_0x4b7122(++_0x4078b1);}(_0xbee3,0xd5));var _0x3bee=function(_0x5d868c,_0x1b2d37){_0x5d868c=_0x5d868c-0x0;var _0x5bba2f=_0xbee3[_0x5d868c];return _0x5bba2f;};'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='ChanSpies';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['VoiceChanSpy']['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='ChanSpies';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));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 69bba4d..0e4e9dd 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 _0x5ce9=['catch','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','context','from-sip','%s%s','prefix','system','merge','Set','format','CDR(type)=%s','chanspy','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','ChanSpy','SIP/%s,%s','options','join','record','StopMixMonitor','length','concat','internal','name','User','findAll','agent','then'];(function(_0x520aba,_0x38acc1){var _0x5c9349=function(_0x80bac9){while(--_0x80bac9){_0x520aba['push'](_0x520aba['shift']());}};_0x5c9349(++_0x38acc1);}(_0x5ce9,0x1dc));var _0x95ce=function(_0x51bd7d,_0x511fa){_0x51bd7d=_0x51bd7d-0x0;var _0x20f733=_0x5ce9[_0x51bd7d];return _0x20f733;};'use strict';var _=require(_0x95ce('0x0'));var util=require(_0x95ce('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x5d2818,_0x2e7c16,_0xbf1b91){var _0x4a64cf=0x1;var _0x163190=[];var _0x7f0c98={'context':_0x2e7c16[_0x95ce('0x2')]||_0x95ce('0x3'),'exten':util['format'](_0x95ce('0x4'),_0x5d2818[_0x95ce('0x5')],_0xbf1b91),'type':_0x95ce('0x6'),'isApp':![],'ChanSpyId':_0x5d2818['id'],'UserId':_0x2e7c16['id']};_0x163190['push'](_[_0x95ce('0x7')]({'app':_0x95ce('0x8'),'appdata':util[_0x95ce('0x9')](_0x95ce('0xa'),_0x95ce('0xb')),'priority':_0x4a64cf++},_0x7f0c98));if(_0x5d2818['record']){_0x163190[_0x95ce('0xc')](_[_0x95ce('0x7')]({'app':_0x95ce('0xd'),'appdata':util[_0x95ce('0x9')](_0x95ce('0xe'),_0x5d2818[_0x95ce('0xf')]),'priority':_0x4a64cf++},_0x7f0c98));}if(_0x5d2818[_0x95ce('0x10')]){_0x163190[_0x95ce('0xc')](_['merge']({'app':'Authenticate','appdata':_0x5d2818['password'],'priority':_0x4a64cf++},_0x7f0c98));}_0x163190[_0x95ce('0xc')](_[_0x95ce('0x7')]({'app':_0x95ce('0x11'),'appdata':util[_0x95ce('0x9')](_0x95ce('0x12'),_0x2e7c16['name'],_0x5d2818['options']?_0x5d2818[_0x95ce('0x13')][_0x95ce('0x14')](''):''),'priority':_0x4a64cf++},_0x7f0c98));if(_0x5d2818[_0x95ce('0x15')]){_0x163190['push'](_[_0x95ce('0x7')]({'app':_0x95ce('0x16'),'priority':_0x4a64cf++},_0x7f0c98));}return _0x163190;};var getChanSpyApplications=function(_0x1a3c0a,_0x195440){var _0x5747db=[];for(var _0x4c5a88=0x0,_0x4b5176=0x1;_0x4c5a88<_0x195440[_0x95ce('0x17')];_0x4c5a88++,_0x4b5176=0x1){_0x5747db=_0x5747db[_0x95ce('0x18')](getUserApplications(_0x1a3c0a,_0x195440[_0x4c5a88],_0x195440[_0x4c5a88][_0x95ce('0x19')]));if(_0x195440[_0x4c5a88][_0x95ce('0x19')]!=_0x195440[_0x4c5a88][_0x95ce('0x1a')]){_0x5747db=_0x5747db[_0x95ce('0x18')](getUserApplications(_0x1a3c0a,_0x195440[_0x4c5a88],_0x195440[_0x4c5a88]['name']));}}return _0x5747db;};var getChanSpyPromise=function(_0x3e432b,_0x4e4f6f){return new BPromise(function(_0x38d8ce,_0x2ddc57){return _0x3e432b[_0x95ce('0x1b')][_0x95ce('0x1c')]({'attributes':['id',_0x95ce('0x1a'),'internal'],'where':{'role':_0x95ce('0x1d'),'chanspy':!![]},'raw':!![]})[_0x95ce('0x1e')](function(_0x1bf3e3){if(_0x1bf3e3){return _0x38d8ce(getChanSpyApplications(_0x4e4f6f,_0x1bf3e3));}return _0x38d8ce([]);})[_0x95ce('0x1f')](function(_0x18d3dd){_0x2ddc57(_0x18d3dd);});});};module[_0x95ce('0x20')]=function(_0x5a4e4d,_0x13e370){var _0x5ad54b=_0x5a4e4d['models'];return _0x5a4e4d[_0x95ce('0x21')](_0x95ce('0x22'),attributes,{'tableName':_0x95ce('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x166903,_0x3ae31a,_0x19d893){return getChanSpyPromise(_0x5ad54b,_0x166903)[_0x95ce('0x1e')](function(_0x472a3c){if(_0x472a3c&&_0x472a3c[_0x95ce('0x17')]){return _0x5ad54b[_0x95ce('0x24')][_0x95ce('0x25')](_0x472a3c);}})[_0x95ce('0x1e')](function(){_0x19d893();})[_0x95ce('0x1f')](function(_0x2290c6){_0x19d893(_0x2290c6);});},'afterUpdate':function(_0x2e4dc4,_0x4cec24,_0x18c41e){return _0x5ad54b[_0x95ce('0x24')][_0x95ce('0x26')]({'where':{'ChanSpyId':_0x2e4dc4['id']}})[_0x95ce('0x1e')](function(){return getChanSpyPromise(_0x5ad54b,_0x2e4dc4);})[_0x95ce('0x1e')](function(_0x285002){if(_0x285002&&_0x285002['length']){return _0x5ad54b[_0x95ce('0x24')][_0x95ce('0x25')](_0x285002);}})[_0x95ce('0x1e')](function(){_0x18c41e();})[_0x95ce('0x1f')](function(_0x4d33af){_0x18c41e(_0x4d33af);});},'afterDestroy':function(_0x339116,_0x4fc9a8,_0x5ccb1a){return _0x5ad54b[_0x95ce('0x24')][_0x95ce('0x26')]({'where':{'ChanSpyId':_0x339116['id']}})[_0x95ce('0x1e')](function(){_0x5ccb1a();})[_0x95ce('0x1f')](function(_0x1c0f87){_0x5ccb1a(_0x1c0f87);});}}});}; \ No newline at end of file +var _0x879b=['User','findAll','agent','then','catch','models','define','VoiceChanSpy','bulkCreate','VoiceExtension','destroy','lodash','util','./voiceChanSpy.attributes','context','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','MixMonitor','${UNIQUEID}.%s,a','auth','password','SIP/%s,%s','name','options','record','StopMixMonitor','length','concat','internal'];(function(_0x56a908,_0x39d50e){var _0x3f9f62=function(_0x36b547){while(--_0x36b547){_0x56a908['push'](_0x56a908['shift']());}};_0x3f9f62(++_0x39d50e);}(_0x879b,0x1c5));var _0xb879=function(_0x5c8a11,_0x10805f){_0x5c8a11=_0x5c8a11-0x0;var _0x116b22=_0x879b[_0x5c8a11];return _0x116b22;};'use strict';var _=require(_0xb879('0x0'));var util=require(_0xb879('0x1'));var BPromise=require('bluebird');var attributes=require(_0xb879('0x2'));var getUserApplications=function(_0x2f573c,_0xea715d,_0x476f78){var _0x4a233d=0x1;var _0x3434ad=[];var _0x2e1272={'context':_0xea715d[_0xb879('0x3')]||'from-sip','exten':util[_0xb879('0x4')](_0xb879('0x5'),_0x2f573c[_0xb879('0x6')],_0x476f78),'type':'system','isApp':![],'ChanSpyId':_0x2f573c['id'],'UserId':_0xea715d['id']};_0x3434ad[_0xb879('0x7')](_[_0xb879('0x8')]({'app':_0xb879('0x9'),'appdata':util[_0xb879('0x4')](_0xb879('0xa'),'chanspy'),'priority':_0x4a233d++},_0x2e1272));if(_0x2f573c['record']){_0x3434ad['push'](_[_0xb879('0x8')]({'app':_0xb879('0xb'),'appdata':util[_0xb879('0x4')](_0xb879('0xc'),_0x2f573c['recordingFormat']),'priority':_0x4a233d++},_0x2e1272));}if(_0x2f573c[_0xb879('0xd')]){_0x3434ad['push'](_[_0xb879('0x8')]({'app':'Authenticate','appdata':_0x2f573c[_0xb879('0xe')],'priority':_0x4a233d++},_0x2e1272));}_0x3434ad[_0xb879('0x7')](_[_0xb879('0x8')]({'app':'ChanSpy','appdata':util[_0xb879('0x4')](_0xb879('0xf'),_0xea715d[_0xb879('0x10')],_0x2f573c[_0xb879('0x11')]?_0x2f573c[_0xb879('0x11')]['join'](''):''),'priority':_0x4a233d++},_0x2e1272));if(_0x2f573c[_0xb879('0x12')]){_0x3434ad['push'](_[_0xb879('0x8')]({'app':_0xb879('0x13'),'priority':_0x4a233d++},_0x2e1272));}return _0x3434ad;};var getChanSpyApplications=function(_0x572c9a,_0x2494c3){var _0x339b9d=[];for(var _0x331d8a=0x0,_0x3d40f2=0x1;_0x331d8a<_0x2494c3[_0xb879('0x14')];_0x331d8a++,_0x3d40f2=0x1){_0x339b9d=_0x339b9d[_0xb879('0x15')](getUserApplications(_0x572c9a,_0x2494c3[_0x331d8a],_0x2494c3[_0x331d8a][_0xb879('0x16')]));if(_0x2494c3[_0x331d8a][_0xb879('0x16')]!=_0x2494c3[_0x331d8a][_0xb879('0x10')]){_0x339b9d=_0x339b9d[_0xb879('0x15')](getUserApplications(_0x572c9a,_0x2494c3[_0x331d8a],_0x2494c3[_0x331d8a][_0xb879('0x10')]));}}return _0x339b9d;};var getChanSpyPromise=function(_0x29cfbe,_0x5d187b){return new BPromise(function(_0x233d53,_0x393c10){return _0x29cfbe[_0xb879('0x17')][_0xb879('0x18')]({'attributes':['id','name',_0xb879('0x16')],'where':{'role':_0xb879('0x19'),'chanspy':!![]},'raw':!![]})[_0xb879('0x1a')](function(_0x4a7ec9){if(_0x4a7ec9){return _0x233d53(getChanSpyApplications(_0x5d187b,_0x4a7ec9));}return _0x233d53([]);})[_0xb879('0x1b')](function(_0x23237c){_0x393c10(_0x23237c);});});};module['exports']=function(_0x3462f3,_0x348977){var _0xed09ec=_0x3462f3[_0xb879('0x1c')];return _0x3462f3[_0xb879('0x1d')](_0xb879('0x1e'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3208b3,_0x16b5e1,_0x9d034c){return getChanSpyPromise(_0xed09ec,_0x3208b3)[_0xb879('0x1a')](function(_0x2159fa){if(_0x2159fa&&_0x2159fa[_0xb879('0x14')]){return _0xed09ec['VoiceExtension'][_0xb879('0x1f')](_0x2159fa);}})[_0xb879('0x1a')](function(){_0x9d034c();})[_0xb879('0x1b')](function(_0x40c03c){_0x9d034c(_0x40c03c);});},'afterUpdate':function(_0x5e0716,_0x142b07,_0x26b568){return _0xed09ec['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x5e0716['id']}})[_0xb879('0x1a')](function(){return getChanSpyPromise(_0xed09ec,_0x5e0716);})['then'](function(_0x5bad07){if(_0x5bad07&&_0x5bad07['length']){return _0xed09ec[_0xb879('0x20')][_0xb879('0x1f')](_0x5bad07);}})[_0xb879('0x1a')](function(){_0x26b568();})[_0xb879('0x1b')](function(_0x5607a9){_0x26b568(_0x5607a9);});},'afterDestroy':function(_0x1ee646,_0x2d3ae2,_0x2b9072){return _0xed09ec[_0xb879('0x20')][_0xb879('0x21')]({'where':{'ChanSpyId':_0x1ee646['id']}})[_0xb879('0x1a')](function(){_0x2b9072();})[_0xb879('0x1b')](function(_0x36c5e6){_0x2b9072(_0x36c5e6);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index bbe83a7..5a8e626 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 _0x0bb5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2b7f7b,_0xdcc12){var _0xecf7b4=function(_0x27d4b9){while(--_0x27d4b9){_0x2b7f7b['push'](_0x2b7f7b['shift']());}};_0xecf7b4(++_0xdcc12);}(_0x0bb5,0x148));var _0x50bb=function(_0x5e2135,_0x5b8364){_0x5e2135=_0x5e2135-0x0;var _0x398ad8=_0x0bb5[_0x5e2135];return _0x398ad8;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});} \ No newline at end of file +var _0x2f68=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug'];(function(_0x1149c4,_0xcecf28){var _0xac8165=function(_0x19cd04){while(--_0x19cd04){_0x1149c4['push'](_0x1149c4['shift']());}};_0xac8165(++_0xcecf28);}(_0x2f68,0x9a));var _0x82f6=function(_0xc41519,_0x460fce){_0xc41519=_0xc41519-0x0;var _0x55f792=_0x2f68[_0xc41519];return _0x55f792;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index e917bfe..f5e8221 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 _0xb7de=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','post','put','/:id'];(function(_0x4073c7,_0x56156e){var _0x4ec42d=function(_0x2db6ce){while(--_0x2db6ce){_0x4073c7['push'](_0x4073c7['shift']());}};_0x4ec42d(++_0x56156e);}(_0xb7de,0x133));var _0xeb7d=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xb7de[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var path=require(_0xeb7d('0x2'));var timeout=require(_0xeb7d('0x3'));var express=require(_0xeb7d('0x4'));var router=express[_0xeb7d('0x5')]();var fs_extra=require(_0xeb7d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xeb7d('0x7'));var config=require(_0xeb7d('0x8'));var controller=require(_0xeb7d('0x9'));router[_0xeb7d('0xa')]('/',auth['isAuthenticated'](),controller[_0xeb7d('0xb')]);router[_0xeb7d('0xa')]('/:id',auth[_0xeb7d('0xc')](),controller['show']);router[_0xeb7d('0xd')]('/',auth[_0xeb7d('0xc')](),controller['create']);router[_0xeb7d('0xe')](_0xeb7d('0xf'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xeb7d('0xc')](),controller[_0xeb7d('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd947=['update','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0xc36d01,_0x3bf1a6){var _0xecb231=function(_0x2fb301){while(--_0x2fb301){_0xc36d01['push'](_0xc36d01['shift']());}};_0xecb231(++_0x3bf1a6);}(_0xd947,0x1cb));var _0x7d94=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xd947[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7d94('0x0'));var timeout=require('connect-timeout');var express=require(_0x7d94('0x1'));var router=express[_0x7d94('0x2')]();var fs_extra=require(_0x7d94('0x3'));var auth=require(_0x7d94('0x4'));var interaction=require(_0x7d94('0x5'));var config=require(_0x7d94('0x6'));var controller=require(_0x7d94('0x7'));router[_0x7d94('0x8')]('/',auth[_0x7d94('0x9')](),controller[_0x7d94('0xa')]);router['get'](_0x7d94('0xb'),auth[_0x7d94('0x9')](),controller[_0x7d94('0xc')]);router[_0x7d94('0xd')]('/',auth[_0x7d94('0x9')](),controller[_0x7d94('0xe')]);router[_0x7d94('0xf')](_0x7d94('0xb'),auth[_0x7d94('0x9')](),controller[_0x7d94('0x10')]);router['delete'](_0x7d94('0xb'),auth[_0x7d94('0x9')](),controller[_0x7d94('0x11')]);module[_0x7d94('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 9bb849f..bc4b730 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 _0xe2c1=['STRING','name','BOOLEAN'];(function(_0x5099d8,_0x283286){var _0x52406d=function(_0x3843a8){while(--_0x3843a8){_0x5099d8['push'](_0x5099d8['shift']());}};_0x52406d(++_0x283286);}(_0xe2c1,0xc9));var _0x1e2c=function(_0x5dbcfc,_0xb3dea9){_0x5dbcfc=_0x5dbcfc-0x0;var _0x28bb6a=_0xe2c1[_0x5dbcfc];return _0x28bb6a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1e2c('0x0')],'unique':_0x1e2c('0x1')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9d3a=['STRING','name','BOOLEAN','sequelize'];(function(_0x1f8f66,_0x5dc25a){var _0x3b992d=function(_0x25dadb){while(--_0x25dadb){_0x1f8f66['push'](_0x1f8f66['shift']());}};_0x3b992d(++_0x5dc25a);}(_0x9d3a,0x1a7));var _0xa9d3=function(_0x1df3ec,_0x3a8b71){_0x1df3ec=_0x1df3ec-0x0;var _0x353b67=_0x9d3a[_0x1df3ec];return _0x353b67;};'use strict';var Sequelize=require(_0xa9d3('0x0'));module['exports']={'name':{'type':Sequelize[_0xa9d3('0x1')],'unique':_0xa9d3('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa9d3('0x3')],'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 d1075b2..6d7d03d 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 _0x63cc=['../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','VoiceContext','includeAll','findAll','rows','show','params','create','body','readFileSync','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1f011a,_0x757ad7){var _0x4ce451=function(_0xed1f06){while(--_0xed1f06){_0x1f011a['push'](_0x1f011a['shift']());}};_0x4ce451(++_0x757ad7);}(_0x63cc,0x18f));var _0xc63c=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0x63cc[_0x22bdd3];return _0x44d9d9;};'use strict';var emlformat=require(_0xc63c('0x0'));var rimraf=require(_0xc63c('0x1'));var zipdir=require(_0xc63c('0x2'));var jsonpatch=require(_0xc63c('0x3'));var rp=require(_0xc63c('0x4'));var moment=require(_0xc63c('0x5'));var BPromise=require(_0xc63c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc63c('0x7'));var csv=require('to-csv');var ejs=require(_0xc63c('0x8'));var fs=require('fs');var fs_extra=require(_0xc63c('0x9'));var _=require('lodash');var squel=require(_0xc63c('0xa'));var crypto=require(_0xc63c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc63c('0xc'));var toCsv=require(_0xc63c('0xd'));var querystring=require(_0xc63c('0xe'));var Papa=require('papaparse');var Redis=require(_0xc63c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc63c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc63c('0x11'));var logger=require(_0xc63c('0x12'))(_0xc63c('0x13'));var utils=require(_0xc63c('0x14'));var config=require(_0xc63c('0x15'));var licenseUtil=require(_0xc63c('0x16'));var db=require(_0xc63c('0x17'))['db'];var jayson=require(_0xc63c('0x18'));var client=jayson['client'][_0xc63c('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x47ed51,_0x2faa78,_0x457fae,_0x3e6eea){return new BPromise(function(_0x97478f,_0x3799b8){var _0x1dd540=_0x3e6eea||client;return _0x1dd540[_0xc63c('0x1a')](_0x47ed51,_0x457fae)[_0xc63c('0x1b')](function(_0x2f5c21){logger[_0xc63c('0x1c')](_0xc63c('0x1d'),_0x2faa78,'request\x20sent');logger[_0xc63c('0x1e')](_0xc63c('0x1f'),_0x2faa78,_0xc63c('0x20'),JSON[_0xc63c('0x21')](_0x2f5c21));if(_0x2f5c21['error']){if(_0x2f5c21[_0xc63c('0x22')][_0xc63c('0x23')]===0x1f4){logger[_0xc63c('0x22')](_0xc63c('0x1d'),_0x2faa78,_0x2f5c21[_0xc63c('0x22')]['message']);return _0x3799b8(_0x2f5c21['error'][_0xc63c('0x24')]);}logger[_0xc63c('0x22')]('VoiceContext,\x20%s,\x20%s',_0x2faa78,_0x2f5c21[_0xc63c('0x22')][_0xc63c('0x24')]);return _0x97478f(_0x2f5c21[_0xc63c('0x22')][_0xc63c('0x24')]);}else{logger[_0xc63c('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x2faa78,_0xc63c('0x20'));_0x97478f(_0x2f5c21[_0xc63c('0x25')][_0xc63c('0x24')]);}})[_0xc63c('0x26')](function(_0x342fd2){logger['error'](_0xc63c('0x1d'),_0x2faa78,_0x342fd2);_0x3799b8(_0x342fd2);});});}function respondWithStatusCode(_0x3f4a01,_0x2bb572){_0x2bb572=_0x2bb572||0xcc;return function(_0x3875ba){if(_0x3875ba){return _0x3f4a01[_0xc63c('0x27')](_0x2bb572);}return _0x3f4a01[_0xc63c('0x28')](_0x2bb572)[_0xc63c('0x29')]();};}function respondWithResult(_0x567c05,_0xc7c8ae){_0xc7c8ae=_0xc7c8ae||0xc8;return function(_0x31c563){if(_0x31c563){return _0x567c05['status'](_0xc7c8ae)[_0xc63c('0x2a')](_0x31c563);}};}function respondWithFilteredResult(_0x5d0e03,_0xa8ed0c){return function(_0x55b324){if(_0x55b324){var _0x3078d7=typeof _0xa8ed0c[_0xc63c('0x2b')]===_0xc63c('0x2c')&&typeof _0xa8ed0c[_0xc63c('0x2d')]===_0xc63c('0x2c');var _0x1c30fe=_0x55b324[_0xc63c('0x2e')];var _0x4b067f=_0x3078d7?0x0:_0xa8ed0c[_0xc63c('0x2b')];var _0x215f3e=_0x3078d7?_0x55b324[_0xc63c('0x2e')]:_0xa8ed0c[_0xc63c('0x2b')]+_0xa8ed0c[_0xc63c('0x2d')];var _0x18d4b4;if(_0x215f3e>=_0x1c30fe){_0x215f3e=_0x1c30fe;_0x18d4b4=0xc8;}else{_0x18d4b4=0xce;}_0x5d0e03[_0xc63c('0x28')](_0x18d4b4);return _0x5d0e03[_0xc63c('0x2f')](_0xc63c('0x30'),_0x4b067f+'-'+_0x215f3e+'/'+_0x1c30fe)[_0xc63c('0x2a')](_0x55b324);}return null;};}function patchUpdates(_0x395360){return function(_0x11dcb6){try{jsonpatch[_0xc63c('0x31')](_0x11dcb6,_0x395360,!![]);}catch(_0x16ef5a){return BPromise[_0xc63c('0x32')](_0x16ef5a);}return _0x11dcb6[_0xc63c('0x33')]();};}function saveUpdates(_0x39acb4,_0x216d8b){return function(_0x2ac11e){if(_0x2ac11e){return _0x2ac11e[_0xc63c('0x34')](_0x39acb4)[_0xc63c('0x1b')](function(_0x37c585){return _0x37c585;});}return null;};}function removeEntity(_0x228cbb,_0x1a076a){return function(_0x1b6195){if(_0x1b6195){return _0x1b6195[_0xc63c('0x35')]()[_0xc63c('0x1b')](function(){var _0x59349a=_0x1b6195[_0xc63c('0x36')]({'plain':!![]});var _0x121224=_0xc63c('0x37');return db[_0xc63c('0x38')][_0xc63c('0x35')]({'where':{'type':_0x121224,'resourceId':_0x59349a['id']}})[_0xc63c('0x1b')](function(){return _0x1b6195;});})['then'](function(){_0x228cbb[_0xc63c('0x28')](0xcc)[_0xc63c('0x29')]();});}};}function handleEntityNotFound(_0x34328a,_0x1edf87){return function(_0x3f4036){if(!_0x3f4036){_0x34328a[_0xc63c('0x27')](0x194);}return _0x3f4036;};}function handleError(_0x3c7083,_0x23b270){_0x23b270=_0x23b270||0x1f4;return function(_0x3646e3){logger[_0xc63c('0x22')](_0x3646e3['stack']);if(_0x3646e3[_0xc63c('0x39')]){delete _0x3646e3[_0xc63c('0x39')];}_0x3c7083[_0xc63c('0x28')](_0x23b270)['send'](_0x3646e3);};}exports['index']=function(_0x55d166,_0x4c5a9f){var _0x5103fa={},_0x2c5788={},_0x5ad36d={'count':0x0,'rows':[]};var _0x4171d8=_[_0xc63c('0x3a')](db['VoiceContext'][_0xc63c('0x3b')],function(_0x4a6e0d){return{'name':_0x4a6e0d[_0xc63c('0x3c')],'type':_0x4a6e0d[_0xc63c('0x3d')][_0xc63c('0x3e')]};});_0x2c5788[_0xc63c('0x3f')]=_['map'](_0x4171d8,_0xc63c('0x39'));_0x2c5788[_0xc63c('0x40')]=_[_0xc63c('0x41')](_0x55d166[_0xc63c('0x40')]);_0x2c5788[_0xc63c('0x42')]=_[_0xc63c('0x43')](_0x2c5788[_0xc63c('0x3f')],_0x2c5788['query']);_0x5103fa[_0xc63c('0x44')]=_['intersection'](_0x2c5788[_0xc63c('0x3f')],qs[_0xc63c('0x45')](_0x55d166[_0xc63c('0x40')]['fields']));_0x5103fa[_0xc63c('0x44')]=_0x5103fa[_0xc63c('0x44')][_0xc63c('0x46')]?_0x5103fa[_0xc63c('0x44')]:_0x2c5788['model'];if(!_0x55d166['query'][_0xc63c('0x47')]('nolimit')){_0x5103fa[_0xc63c('0x2d')]=qs[_0xc63c('0x2d')](_0x55d166[_0xc63c('0x40')][_0xc63c('0x2d')]);_0x5103fa[_0xc63c('0x2b')]=qs[_0xc63c('0x2b')](_0x55d166['query'][_0xc63c('0x2b')]);}_0x5103fa[_0xc63c('0x48')]=qs['sort'](_0x55d166[_0xc63c('0x40')][_0xc63c('0x49')]);_0x5103fa['where']=qs[_0xc63c('0x42')](_['pick'](_0x55d166['query'],_0x2c5788[_0xc63c('0x42')]),_0x4171d8);if(_0x55d166[_0xc63c('0x40')][_0xc63c('0x4a')]){_0x5103fa[_0xc63c('0x4b')]=_[_0xc63c('0x4c')](_0x5103fa[_0xc63c('0x4b')],{'$or':_['map'](_0x4171d8,function(_0x208e71){if(_0x208e71[_0xc63c('0x3d')]!==_0xc63c('0x4d')){var _0x564caa={};_0x564caa[_0x208e71[_0xc63c('0x39')]]={'$like':'%'+_0x55d166[_0xc63c('0x40')][_0xc63c('0x4a')]+'%'};return _0x564caa;}})});}_0x5103fa=_[_0xc63c('0x4c')]({},_0x5103fa,_0x55d166[_0xc63c('0x4e')]);var _0x1ae180={'where':_0x5103fa['where']};return db[_0xc63c('0x4f')][_0xc63c('0x2e')](_0x1ae180)['then'](function(_0x366912){_0x5ad36d[_0xc63c('0x2e')]=_0x366912;if(_0x55d166[_0xc63c('0x40')][_0xc63c('0x50')]){_0x5103fa['include']=[{'all':!![]}];}return db[_0xc63c('0x4f')][_0xc63c('0x51')](_0x5103fa);})[_0xc63c('0x1b')](function(_0x397640){_0x5ad36d[_0xc63c('0x52')]=_0x397640;return _0x5ad36d;})['then'](respondWithFilteredResult(_0x4c5a9f,_0x5103fa))[_0xc63c('0x26')](handleError(_0x4c5a9f,null));};exports[_0xc63c('0x53')]=function(_0x46ee0b,_0x24b8b0){var _0x294365={'raw':![],'where':{'id':_0x46ee0b[_0xc63c('0x54')]['id']}},_0x4d1f86={};_0x4d1f86[_0xc63c('0x3f')]=_[_0xc63c('0x41')](db[_0xc63c('0x4f')][_0xc63c('0x3b')]);_0x4d1f86['query']=_[_0xc63c('0x41')](_0x46ee0b[_0xc63c('0x40')]);_0x4d1f86['filters']=_['intersection'](_0x4d1f86[_0xc63c('0x3f')],_0x4d1f86[_0xc63c('0x40')]);_0x294365['attributes']=_[_0xc63c('0x43')](_0x4d1f86[_0xc63c('0x3f')],qs['fields'](_0x46ee0b[_0xc63c('0x40')][_0xc63c('0x45')]));_0x294365[_0xc63c('0x44')]=_0x294365[_0xc63c('0x44')][_0xc63c('0x46')]?_0x294365[_0xc63c('0x44')]:_0x4d1f86[_0xc63c('0x3f')];if(_0x46ee0b[_0xc63c('0x40')][_0xc63c('0x50')]){_0x294365['include']=[{'all':!![]}];}_0x294365=_[_0xc63c('0x4c')]({},_0x294365,_0x46ee0b[_0xc63c('0x4e')]);return db[_0xc63c('0x4f')]['find'](_0x294365)[_0xc63c('0x1b')](handleEntityNotFound(_0x24b8b0,null))['then'](respondWithResult(_0x24b8b0,null))[_0xc63c('0x26')](handleError(_0x24b8b0,null));};exports['create']=function(_0x14dea4,_0x193dc6,_0x3ae0aa){var _0x22845a;return db[_0xc63c('0x4f')][_0xc63c('0x55')](_0x14dea4[_0xc63c('0x56')],{'raw':!![]})[_0xc63c('0x1b')](function(_0x41f226){_0x22845a=_0x41f226;return db[_0xc63c('0x4f')][_0xc63c('0x51')]({'raw':!![]});})[_0xc63c('0x1b')](function(_0x5d88f1){var _0x384665=fs[_0xc63c('0x57')](path['join'](config['root'],_0xc63c('0x58')),_0xc63c('0x59'));var _0x5e3bb3=ejs[_0xc63c('0x5a')](_0x384665,{'contexts':_0x5d88f1||[]});fs[_0xc63c('0x5b')](_0xc63c('0x5c'),_0x5e3bb3);})[_0xc63c('0x1b')](function(){return respondWithRpcPromise(_0xc63c('0x5d'),_0xc63c('0x55'),{'module':'chan_sip.so'});})[_0xc63c('0x1b')](function(){var _0x7f7015=_0x14dea4[_0xc63c('0x5e')]['get']({'plain':!![]});if(!_0x7f7015)throw new Error(_0xc63c('0x5f'));if(_0x7f7015[_0xc63c('0x60')]===_0xc63c('0x5e')){var _0x1d130d=_0x22845a[_0xc63c('0x36')]({'plain':!![]});return db[_0xc63c('0x61')][_0xc63c('0x62')]({'where':{'name':_0xc63c('0x37'),'userProfileId':_0x7f7015[_0xc63c('0x63')]},'raw':!![]})[_0xc63c('0x1b')](function(_0x34647d){if(_0x34647d&&_0x34647d[_0xc63c('0x64')]===0x0){return db[_0xc63c('0x38')]['create']({'name':_0x1d130d[_0xc63c('0x39')],'resourceId':_0x1d130d['id'],'type':_0x34647d[_0xc63c('0x39')],'sectionId':_0x34647d['id']},{})[_0xc63c('0x1b')](function(){return _0x22845a;});}else{return _0x22845a;}})[_0xc63c('0x26')](function(_0x47c441){logger['error'](_0xc63c('0x65'),_0x47c441);throw _0x47c441;});}return _0x22845a;})[_0xc63c('0x1b')](respondWithResult(_0x193dc6,0xc9))[_0xc63c('0x26')](handleError(_0x193dc6,null));};exports[_0xc63c('0x34')]=function(_0x1b252e,_0x5ac0d1,_0x1d0fa3){var _0x84b4a2;return db[_0xc63c('0x4f')]['find']({'where':{'id':_0x1b252e[_0xc63c('0x54')]['id']}})[_0xc63c('0x1b')](handleEntityNotFound(_0x5ac0d1,null))[_0xc63c('0x1b')](saveUpdates(_0x1b252e[_0xc63c('0x56')],null))['then'](function(_0x3a8101){if(_0x3a8101){_0x84b4a2=_0x3a8101;return db[_0xc63c('0x4f')][_0xc63c('0x51')]({'raw':!![]});}})[_0xc63c('0x1b')](function(_0x58a3e7){var _0x3b67ca=fs[_0xc63c('0x57')](path[_0xc63c('0x66')](config[_0xc63c('0x67')],_0xc63c('0x58')),_0xc63c('0x59'));var _0x1e040f=ejs[_0xc63c('0x5a')](_0x3b67ca,{'contexts':_0x58a3e7||[]});fs[_0xc63c('0x5b')](_0xc63c('0x5c'),_0x1e040f);})[_0xc63c('0x1b')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xc63c('0x68')});})[_0xc63c('0x1b')](function(){return _0x84b4a2;})[_0xc63c('0x1b')](respondWithResult(_0x5ac0d1,null))[_0xc63c('0x26')](handleError(_0x5ac0d1,null));};exports['destroy']=function(_0xb0215c,_0x296fcb,_0x28c5ff){var _0x386f9c;return db[_0xc63c('0x4f')][_0xc63c('0x62')]({'where':{'id':_0xb0215c[_0xc63c('0x54')]['id']}})['then'](handleEntityNotFound(_0x296fcb,null))['then'](removeEntity(_0x296fcb,null))[_0xc63c('0x1b')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xc63c('0x1b')](function(_0x5df142){var _0x40cc55=fs[_0xc63c('0x57')](path[_0xc63c('0x66')](config[_0xc63c('0x67')],'server/files/templates/context.ejs'),_0xc63c('0x59'));var _0x14442c=ejs[_0xc63c('0x5a')](_0x40cc55,{'contexts':_0x5df142});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x14442c);return respondWithRpcPromise(_0xc63c('0x5d'),_0xc63c('0x35'),{'module':_0xc63c('0x68')});})[_0xc63c('0x26')](handleError(_0x296fcb,null));}; \ No newline at end of file +var _0x948d=['role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','Contexts','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','Reload','chan_sip.so','user'];(function(_0x1c5899,_0x1cd098){var _0x3a34cd=function(_0xb2a5d9){while(--_0xb2a5d9){_0x1c5899['push'](_0x1c5899['shift']());}};_0x3a34cd(++_0x1cd098);}(_0x948d,0x1b8));var _0xd948=function(_0x4833f4,_0x7f50db){_0x4833f4=_0x4833f4-0x0;var _0x1c172a=_0x948d[_0x4833f4];return _0x1c172a;};'use strict';var emlformat=require(_0xd948('0x0'));var rimraf=require(_0xd948('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd948('0x2'));var rp=require(_0xd948('0x3'));var moment=require(_0xd948('0x4'));var BPromise=require(_0xd948('0x5'));var Mustache=require('mustache');var util=require(_0xd948('0x6'));var path=require('path');var sox=require(_0xd948('0x7'));var csv=require(_0xd948('0x8'));var ejs=require(_0xd948('0x9'));var fs=require('fs');var fs_extra=require(_0xd948('0xa'));var _=require(_0xd948('0xb'));var squel=require(_0xd948('0xc'));var crypto=require(_0xd948('0xd'));var jsforce=require(_0xd948('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd948('0x8'));var querystring=require(_0xd948('0xf'));var Papa=require(_0xd948('0x10'));var Redis=require('ioredis');var authService=require(_0xd948('0x11'));var qs=require(_0xd948('0x12'));var as=require(_0xd948('0x13'));var hardwareService=require(_0xd948('0x14'));var logger=require(_0xd948('0x15'))(_0xd948('0x16'));var utils=require(_0xd948('0x17'));var config=require(_0xd948('0x18'));var licenseUtil=require(_0xd948('0x19'));var db=require(_0xd948('0x1a'))['db'];var jayson=require(_0xd948('0x1b'));var client=jayson['client'][_0xd948('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x330c64,_0x50059f,_0x3254d3,_0x1c2e53){return new BPromise(function(_0x19fb68,_0x27142f){var _0x33767b=_0x1c2e53||client;return _0x33767b['request'](_0x330c64,_0x3254d3)['then'](function(_0x31a295){logger[_0xd948('0x1d')](_0xd948('0x1e'),_0x50059f,_0xd948('0x1f'));logger[_0xd948('0x20')](_0xd948('0x21'),_0x50059f,_0xd948('0x1f'),JSON[_0xd948('0x22')](_0x31a295));if(_0x31a295[_0xd948('0x23')]){if(_0x31a295[_0xd948('0x23')][_0xd948('0x24')]===0x1f4){logger[_0xd948('0x23')](_0xd948('0x1e'),_0x50059f,_0x31a295['error']['message']);return _0x27142f(_0x31a295[_0xd948('0x23')]['message']);}logger['error'](_0xd948('0x1e'),_0x50059f,_0x31a295[_0xd948('0x23')][_0xd948('0x25')]);return _0x19fb68(_0x31a295[_0xd948('0x23')][_0xd948('0x25')]);}else{logger[_0xd948('0x1d')](_0xd948('0x1e'),_0x50059f,'request\x20sent');_0x19fb68(_0x31a295[_0xd948('0x26')][_0xd948('0x25')]);}})['catch'](function(_0x5e2345){logger[_0xd948('0x23')](_0xd948('0x1e'),_0x50059f,_0x5e2345);_0x27142f(_0x5e2345);});});}function respondWithStatusCode(_0x8fe67d,_0x4103ba){_0x4103ba=_0x4103ba||0xcc;return function(_0x30ca0d){if(_0x30ca0d){return _0x8fe67d['sendStatus'](_0x4103ba);}return _0x8fe67d[_0xd948('0x27')](_0x4103ba)[_0xd948('0x28')]();};}function respondWithResult(_0x101ec4,_0x1dd29f){_0x1dd29f=_0x1dd29f||0xc8;return function(_0x520425){if(_0x520425){return _0x101ec4['status'](_0x1dd29f)[_0xd948('0x29')](_0x520425);}};}function respondWithFilteredResult(_0x452c26,_0x13eb95){return function(_0x24ddeb){if(_0x24ddeb){var _0x283883=typeof _0x13eb95[_0xd948('0x2a')]===_0xd948('0x2b')&&typeof _0x13eb95[_0xd948('0x2c')]===_0xd948('0x2b');var _0x3a4fb6=_0x24ddeb[_0xd948('0x2d')];var _0x2b6849=_0x283883?0x0:_0x13eb95[_0xd948('0x2a')];var _0x5e4a7d=_0x283883?_0x24ddeb[_0xd948('0x2d')]:_0x13eb95['offset']+_0x13eb95[_0xd948('0x2c')];var _0x54f67f;if(_0x5e4a7d>=_0x3a4fb6){_0x5e4a7d=_0x3a4fb6;_0x54f67f=0xc8;}else{_0x54f67f=0xce;}_0x452c26['status'](_0x54f67f);return _0x452c26[_0xd948('0x2e')](_0xd948('0x2f'),_0x2b6849+'-'+_0x5e4a7d+'/'+_0x3a4fb6)[_0xd948('0x29')](_0x24ddeb);}return null;};}function patchUpdates(_0x1f205c){return function(_0x16fad7){try{jsonpatch[_0xd948('0x30')](_0x16fad7,_0x1f205c,!![]);}catch(_0x3e8a28){return BPromise[_0xd948('0x31')](_0x3e8a28);}return _0x16fad7['save']();};}function saveUpdates(_0x5334af,_0xb78eff){return function(_0x5f2b1b){if(_0x5f2b1b){return _0x5f2b1b[_0xd948('0x32')](_0x5334af)[_0xd948('0x33')](function(_0x2fdb30){return _0x2fdb30;});}return null;};}function removeEntity(_0x245efe,_0x1e8a59){return function(_0x50d17c){if(_0x50d17c){return _0x50d17c['destroy']()[_0xd948('0x33')](function(){var _0x279bd8=_0x50d17c[_0xd948('0x34')]({'plain':!![]});var _0x351eea=_0xd948('0x35');return db[_0xd948('0x36')][_0xd948('0x37')]({'where':{'type':_0x351eea,'resourceId':_0x279bd8['id']}})['then'](function(){return _0x50d17c;});})[_0xd948('0x33')](function(){_0x245efe[_0xd948('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d8c1d,_0x3381da){return function(_0x21d501){if(!_0x21d501){_0x5d8c1d[_0xd948('0x38')](0x194);}return _0x21d501;};}function handleError(_0x137c70,_0x4cc7b3){_0x4cc7b3=_0x4cc7b3||0x1f4;return function(_0x361774){logger[_0xd948('0x23')](_0x361774[_0xd948('0x39')]);if(_0x361774[_0xd948('0x3a')]){delete _0x361774[_0xd948('0x3a')];}_0x137c70[_0xd948('0x27')](_0x4cc7b3)[_0xd948('0x3b')](_0x361774);};}exports[_0xd948('0x3c')]=function(_0x1174a9,_0x32e4ea){var _0x5996f8={},_0xcb174a={},_0x1ce6c6={'count':0x0,'rows':[]};var _0xf2aa34=_[_0xd948('0x3d')](db[_0xd948('0x3e')][_0xd948('0x3f')],function(_0x46db70){return{'name':_0x46db70['fieldName'],'type':_0x46db70[_0xd948('0x40')]['key']};});_0xcb174a[_0xd948('0x41')]=_[_0xd948('0x3d')](_0xf2aa34,_0xd948('0x3a'));_0xcb174a[_0xd948('0x42')]=_[_0xd948('0x43')](_0x1174a9[_0xd948('0x42')]);_0xcb174a[_0xd948('0x44')]=_[_0xd948('0x45')](_0xcb174a['model'],_0xcb174a[_0xd948('0x42')]);_0x5996f8['attributes']=_[_0xd948('0x45')](_0xcb174a[_0xd948('0x41')],qs[_0xd948('0x46')](_0x1174a9[_0xd948('0x42')][_0xd948('0x46')]));_0x5996f8[_0xd948('0x47')]=_0x5996f8['attributes'][_0xd948('0x48')]?_0x5996f8[_0xd948('0x47')]:_0xcb174a[_0xd948('0x41')];if(!_0x1174a9['query'][_0xd948('0x49')](_0xd948('0x4a'))){_0x5996f8[_0xd948('0x2c')]=qs[_0xd948('0x2c')](_0x1174a9[_0xd948('0x42')][_0xd948('0x2c')]);_0x5996f8[_0xd948('0x2a')]=qs[_0xd948('0x2a')](_0x1174a9[_0xd948('0x42')][_0xd948('0x2a')]);}_0x5996f8['order']=qs[_0xd948('0x4b')](_0x1174a9['query']['sort']);_0x5996f8[_0xd948('0x4c')]=qs[_0xd948('0x44')](_[_0xd948('0x4d')](_0x1174a9['query'],_0xcb174a[_0xd948('0x44')]),_0xf2aa34);if(_0x1174a9['query'][_0xd948('0x4e')]){_0x5996f8[_0xd948('0x4c')]=_[_0xd948('0x4f')](_0x5996f8[_0xd948('0x4c')],{'$or':_[_0xd948('0x3d')](_0xf2aa34,function(_0x4e3c14){if(_0x4e3c14[_0xd948('0x40')]!==_0xd948('0x50')){var _0x49fede={};_0x49fede[_0x4e3c14[_0xd948('0x3a')]]={'$like':'%'+_0x1174a9['query']['filter']+'%'};return _0x49fede;}})});}_0x5996f8=_[_0xd948('0x4f')]({},_0x5996f8,_0x1174a9[_0xd948('0x51')]);var _0x1f5c62={'where':_0x5996f8[_0xd948('0x4c')]};return db[_0xd948('0x3e')][_0xd948('0x2d')](_0x1f5c62)['then'](function(_0x48a928){_0x1ce6c6['count']=_0x48a928;if(_0x1174a9[_0xd948('0x42')]['includeAll']){_0x5996f8['include']=[{'all':!![]}];}return db['VoiceContext'][_0xd948('0x52')](_0x5996f8);})[_0xd948('0x33')](function(_0x2ddafa){_0x1ce6c6[_0xd948('0x53')]=_0x2ddafa;return _0x1ce6c6;})['then'](respondWithFilteredResult(_0x32e4ea,_0x5996f8))[_0xd948('0x54')](handleError(_0x32e4ea,null));};exports[_0xd948('0x55')]=function(_0x391348,_0x1b3805){var _0x3b4e78={'raw':![],'where':{'id':_0x391348['params']['id']}},_0x2acb0d={};_0x2acb0d[_0xd948('0x41')]=_[_0xd948('0x43')](db[_0xd948('0x3e')]['rawAttributes']);_0x2acb0d[_0xd948('0x42')]=_[_0xd948('0x43')](_0x391348[_0xd948('0x42')]);_0x2acb0d[_0xd948('0x44')]=_[_0xd948('0x45')](_0x2acb0d[_0xd948('0x41')],_0x2acb0d['query']);_0x3b4e78['attributes']=_['intersection'](_0x2acb0d[_0xd948('0x41')],qs[_0xd948('0x46')](_0x391348['query']['fields']));_0x3b4e78[_0xd948('0x47')]=_0x3b4e78[_0xd948('0x47')][_0xd948('0x48')]?_0x3b4e78[_0xd948('0x47')]:_0x2acb0d[_0xd948('0x41')];if(_0x391348['query'][_0xd948('0x56')]){_0x3b4e78[_0xd948('0x57')]=[{'all':!![]}];}_0x3b4e78=_[_0xd948('0x4f')]({},_0x3b4e78,_0x391348[_0xd948('0x51')]);return db[_0xd948('0x3e')][_0xd948('0x58')](_0x3b4e78)[_0xd948('0x33')](handleEntityNotFound(_0x1b3805,null))[_0xd948('0x33')](respondWithResult(_0x1b3805,null))['catch'](handleError(_0x1b3805,null));};exports[_0xd948('0x59')]=function(_0x336797,_0x2ac5da,_0x3cf829){var _0x221cca;return db[_0xd948('0x3e')][_0xd948('0x59')](_0x336797[_0xd948('0x5a')],{'raw':!![]})[_0xd948('0x33')](function(_0x44023d){_0x221cca=_0x44023d;return db[_0xd948('0x3e')][_0xd948('0x52')]({'raw':!![]});})['then'](function(_0x783799){var _0x1cb214=fs[_0xd948('0x5b')](path[_0xd948('0x5c')](config[_0xd948('0x5d')],_0xd948('0x5e')),_0xd948('0x5f'));var _0x4540f0=ejs[_0xd948('0x60')](_0x1cb214,{'contexts':_0x783799||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x4540f0);})[_0xd948('0x33')](function(){return respondWithRpcPromise(_0xd948('0x61'),'create',{'module':_0xd948('0x62')});})[_0xd948('0x33')](function(){var _0xf8a772=_0x336797[_0xd948('0x63')]['get']({'plain':!![]});if(!_0xf8a772)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf8a772[_0xd948('0x64')]===_0xd948('0x63')){var _0x3c8be8=_0x221cca[_0xd948('0x34')]({'plain':!![]});return db[_0xd948('0x65')][_0xd948('0x58')]({'where':{'name':_0xd948('0x35'),'userProfileId':_0xf8a772[_0xd948('0x66')]},'raw':!![]})[_0xd948('0x33')](function(_0x28c56d){if(_0x28c56d&&_0x28c56d[_0xd948('0x67')]===0x0){return db[_0xd948('0x36')][_0xd948('0x59')]({'name':_0x3c8be8[_0xd948('0x3a')],'resourceId':_0x3c8be8['id'],'type':_0x28c56d[_0xd948('0x3a')],'sectionId':_0x28c56d['id']},{})[_0xd948('0x33')](function(){return _0x221cca;});}else{return _0x221cca;}})[_0xd948('0x54')](function(_0x258dec){logger[_0xd948('0x23')](_0xd948('0x68'),_0x258dec);throw _0x258dec;});}return _0x221cca;})[_0xd948('0x33')](respondWithResult(_0x2ac5da,0xc9))[_0xd948('0x54')](handleError(_0x2ac5da,null));};exports['update']=function(_0x308e37,_0x3a6b94,_0x46e558){var _0x19aaa6;return db['VoiceContext']['find']({'where':{'id':_0x308e37[_0xd948('0x69')]['id']}})['then'](handleEntityNotFound(_0x3a6b94,null))[_0xd948('0x33')](saveUpdates(_0x308e37[_0xd948('0x5a')],null))[_0xd948('0x33')](function(_0x23369c){if(_0x23369c){_0x19aaa6=_0x23369c;return db[_0xd948('0x3e')][_0xd948('0x52')]({'raw':!![]});}})[_0xd948('0x33')](function(_0x207841){var _0x204c85=fs[_0xd948('0x5b')](path[_0xd948('0x5c')](config['root'],_0xd948('0x5e')),_0xd948('0x5f'));var _0x1a7f4c=ejs[_0xd948('0x60')](_0x204c85,{'contexts':_0x207841||[]});fs[_0xd948('0x6a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1a7f4c);})[_0xd948('0x33')](function(){return respondWithRpcPromise('Reload',_0xd948('0x32'),{'module':_0xd948('0x62')});})[_0xd948('0x33')](function(){return _0x19aaa6;})[_0xd948('0x33')](respondWithResult(_0x3a6b94,null))[_0xd948('0x54')](handleError(_0x3a6b94,null));};exports[_0xd948('0x37')]=function(_0x4752a6,_0x1ce8e4,_0x3c0853){var _0x24f017;return db['VoiceContext'][_0xd948('0x58')]({'where':{'id':_0x4752a6[_0xd948('0x69')]['id']}})[_0xd948('0x33')](handleEntityNotFound(_0x1ce8e4,null))[_0xd948('0x33')](removeEntity(_0x1ce8e4,null))[_0xd948('0x33')](function(){return db[_0xd948('0x3e')][_0xd948('0x52')]({'raw':!![]});})[_0xd948('0x33')](function(_0x213d53){var _0x4549ea=fs['readFileSync'](path[_0xd948('0x5c')](config['root'],'server/files/templates/context.ejs'),_0xd948('0x5f'));var _0x528ab9=ejs[_0xd948('0x60')](_0x4549ea,{'contexts':_0x213d53});fs[_0xd948('0x6a')](_0xd948('0x6b'),_0x528ab9);return respondWithRpcPromise(_0xd948('0x61'),_0xd948('0x37'),{'module':_0xd948('0x62')});})[_0xd948('0x54')](handleError(_0x1ce8e4,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 5a5b0f9..297679e 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 _0xebda=['voice_contexts','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x88faed,_0x5b4a9f){var _0x242df2=function(_0x19e40c){while(--_0x19e40c){_0x88faed['push'](_0x88faed['shift']());}};_0x242df2(++_0x5b4a9f);}(_0xebda,0xa9));var _0xaebd=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xebda[_0x53cf8e];return _0x459197;};'use strict';var _=require('lodash');var util=require(_0xaebd('0x0'));var logger=require(_0xaebd('0x1'))(_0xaebd('0x2'));var moment=require(_0xaebd('0x3'));var BPromise=require(_0xaebd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaebd('0x5'));var rimraf=require(_0xaebd('0x6'));var config=require(_0xaebd('0x7'));var attributes=require(_0xaebd('0x8'));module[_0xaebd('0x9')]=function(_0x1c3c78,_0x21373f){return _0x1c3c78[_0xaebd('0xa')]('VoiceContext',attributes,{'tableName':_0xaebd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26dc=['path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x26dc,0x1b9));var _0xc26d=function(_0x38a803,_0x1b15b2){_0x38a803=_0x38a803-0x0;var _0x5e8b65=_0x26dc[_0x38a803];return _0x5e8b65;};'use strict';var _=require(_0xc26d('0x0'));var util=require(_0xc26d('0x1'));var logger=require(_0xc26d('0x2'))(_0xc26d('0x3'));var moment=require(_0xc26d('0x4'));var BPromise=require(_0xc26d('0x5'));var rp=require(_0xc26d('0x6'));var fs=require('fs');var path=require(_0xc26d('0x7'));var rimraf=require(_0xc26d('0x8'));var config=require(_0xc26d('0x9'));var attributes=require(_0xc26d('0xa'));module[_0xc26d('0xb')]=function(_0x430182,_0x500d97){return _0x430182[_0xc26d('0xc')]('VoiceContext',attributes,{'tableName':_0xc26d('0xd'),'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 2effa23..f9cb3bc 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 _0xc343=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','bluebird'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc343,0x173));var _0x3c34=function(_0x12b6b2,_0x5bcfec){_0x12b6b2=_0x12b6b2-0x0;var _0x42cbb2=_0xc343[_0x12b6b2];return _0x42cbb2;};'use strict';var _=require(_0x3c34('0x0'));var util=require('util');var moment=require(_0x3c34('0x1'));var BPromise=require(_0x3c34('0x2'));var rs=require(_0x3c34('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3c34('0x4'));var logger=require(_0x3c34('0x5'))(_0x3c34('0x6'));var config=require(_0x3c34('0x7'));var jayson=require(_0x3c34('0x8'));var client=jayson[_0x3c34('0x9')][_0x3c34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b12df,_0x9b457,_0x3d7335){return new BPromise(function(_0x351315,_0x1e98c3){return client[_0x3c34('0xb')](_0x2b12df,_0x3d7335)[_0x3c34('0xc')](function(_0x182f43){logger['info'](_0x3c34('0xd'),_0x9b457,'request\x20sent');logger[_0x3c34('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x9b457,_0x3c34('0xf'),JSON[_0x3c34('0x10')](_0x182f43));if(_0x182f43[_0x3c34('0x11')]){if(_0x182f43[_0x3c34('0x11')]['code']===0x1f4){logger['error'](_0x3c34('0xd'),_0x9b457,_0x182f43[_0x3c34('0x11')]['message']);return _0x1e98c3(_0x182f43[_0x3c34('0x11')][_0x3c34('0x12')]);}logger['error'](_0x3c34('0xd'),_0x9b457,_0x182f43[_0x3c34('0x11')][_0x3c34('0x12')]);return _0x351315(_0x182f43[_0x3c34('0x11')][_0x3c34('0x12')]);}else{logger[_0x3c34('0x13')](_0x3c34('0xd'),_0x9b457,'request\x20sent');_0x351315(_0x182f43[_0x3c34('0x14')][_0x3c34('0x12')]);}})[_0x3c34('0x15')](function(_0x2b01ad){logger['error'](_0x3c34('0xd'),_0x9b457,_0x2b01ad);_0x1e98c3(_0x2b01ad);});});} \ No newline at end of file +var _0x10a5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x2bf888,_0x374f0b){var _0x3038d6=function(_0xe1b6d9){while(--_0xe1b6d9){_0x2bf888['push'](_0x2bf888['shift']());}};_0x3038d6(++_0x374f0b);}(_0x10a5,0x163));var _0x510a=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0x10a5[_0x56b138];return _0x3df878;};'use strict';var _=require(_0x510a('0x0'));var util=require(_0x510a('0x1'));var moment=require(_0x510a('0x2'));var BPromise=require(_0x510a('0x3'));var rs=require(_0x510a('0x4'));var fs=require('fs');var Redis=require(_0x510a('0x5'));var db=require(_0x510a('0x6'))['db'];var utils=require(_0x510a('0x7'));var logger=require(_0x510a('0x8'))(_0x510a('0x9'));var config=require(_0x510a('0xa'));var jayson=require(_0x510a('0xb'));var client=jayson[_0x510a('0xc')][_0x510a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4bdf71,_0x5a9ffa,_0x1484a1){return new BPromise(function(_0x1639dc,_0x149a3d){return client[_0x510a('0xe')](_0x4bdf71,_0x1484a1)[_0x510a('0xf')](function(_0x4737d0){logger[_0x510a('0x10')](_0x510a('0x11'),_0x5a9ffa,_0x510a('0x12'));logger['debug'](_0x510a('0x13'),_0x5a9ffa,_0x510a('0x12'),JSON['stringify'](_0x4737d0));if(_0x4737d0[_0x510a('0x14')]){if(_0x4737d0[_0x510a('0x14')][_0x510a('0x15')]===0x1f4){logger[_0x510a('0x14')](_0x510a('0x11'),_0x5a9ffa,_0x4737d0[_0x510a('0x14')][_0x510a('0x16')]);return _0x149a3d(_0x4737d0[_0x510a('0x14')]['message']);}logger[_0x510a('0x14')](_0x510a('0x11'),_0x5a9ffa,_0x4737d0['error']['message']);return _0x1639dc(_0x4737d0['error'][_0x510a('0x16')]);}else{logger[_0x510a('0x10')](_0x510a('0x11'),_0x5a9ffa,_0x510a('0x12'));_0x1639dc(_0x4737d0[_0x510a('0x17')][_0x510a('0x16')]);}})['catch'](function(_0x19f5c4){logger[_0x510a('0x14')]('VoiceContext,\x20%s,\x20%s',_0x5a9ffa,_0x19f5c4);_0x149a3d(_0x19f5c4);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index d7319bd..c05cb49 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 _0x60fc=['/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','describe'];(function(_0x16123d,_0x39e701){var _0x43d7ba=function(_0x45d352){while(--_0x45d352){_0x16123d['push'](_0x16123d['shift']());}};_0x43d7ba(++_0x39e701);}(_0x60fc,0x128));var _0xc60f=function(_0x55fee4,_0x647ca8){_0x55fee4=_0x55fee4-0x0;var _0x56ab7c=_0x60fc[_0x55fee4];return _0x56ab7c;};'use strict';var multer=require(_0xc60f('0x0'));var util=require(_0xc60f('0x1'));var path=require(_0xc60f('0x2'));var timeout=require(_0xc60f('0x3'));var express=require('express');var router=express[_0xc60f('0x4')]();var fs_extra=require(_0xc60f('0x5'));var auth=require(_0xc60f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0xc60f('0x7')]('/',auth[_0xc60f('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xc60f('0x9')]);router[_0xc60f('0x7')](_0xc60f('0xa'),auth[_0xc60f('0x8')](),controller[_0xc60f('0xb')]);router[_0xc60f('0xc')]('/',auth[_0xc60f('0x8')](),controller[_0xc60f('0xd')]);router[_0xc60f('0xe')]('/:id',auth[_0xc60f('0x8')](),controller[_0xc60f('0xf')]);router[_0xc60f('0x10')](_0xc60f('0xa'),auth[_0xc60f('0x8')](),controller['destroy']);module[_0xc60f('0x11')]=router; \ No newline at end of file +var _0xd749=['exports','multer','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','create','put','destroy'];(function(_0x5c17d9,_0x392dab){var _0x50afa5=function(_0xa591e1){while(--_0xa591e1){_0x5c17d9['push'](_0x5c17d9['shift']());}};_0x50afa5(++_0x392dab);}(_0xd749,0x11e));var _0x9d74=function(_0x23cbbb,_0x47464c){_0x23cbbb=_0x23cbbb-0x0;var _0x5016a1=_0xd749[_0x23cbbb];return _0x5016a1;};'use strict';var multer=require(_0x9d74('0x0'));var util=require('util');var path=require(_0x9d74('0x1'));var timeout=require(_0x9d74('0x2'));var express=require('express');var router=express[_0x9d74('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9d74('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x9d74('0x5')]('/',auth[_0x9d74('0x6')](),controller[_0x9d74('0x7')]);router[_0x9d74('0x5')](_0x9d74('0x8'),auth[_0x9d74('0x6')](),controller['describe']);router[_0x9d74('0x5')](_0x9d74('0x9'),auth[_0x9d74('0x6')](),controller[_0x9d74('0xa')]);router['post']('/',auth[_0x9d74('0x6')](),controller[_0x9d74('0xb')]);router[_0x9d74('0xc')](_0x9d74('0x9'),auth[_0x9d74('0x6')](),controller['update']);router['delete'](_0x9d74('0x9'),auth[_0x9d74('0x6')](),controller[_0x9d74('0xd')]);module[_0x9d74('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 7535b02..f5158da 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 _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x3e74,0x175));var _0x43e7=function(_0x82cc9e,_0x37b917){_0x82cc9e=_0x82cc9e-0x0;var _0x41f8be=_0x3e74[_0x82cc9e];return _0x41f8be;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x3a68c6,_0x4e14c8){var _0x1c14b5=function(_0x2c81bd){while(--_0x2c81bd){_0x3a68c6['push'](_0x3a68c6['shift']());}};_0x1c14b5(++_0x4e14c8);}(_0x34e8,0x12c));var _0x834e=function(_0x2ea16d,_0x1b1246){_0x2ea16d=_0x2ea16d-0x0;var _0x450eaf=_0x34e8[_0x2ea16d];return _0x450eaf;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'privilege':{'type':Sequelize[_0x834e('0x2')]},'channel':{'type':Sequelize[_0x834e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'calleridnum':{'type':Sequelize[_0x834e('0x2')]},'calleridname':{'type':Sequelize[_0x834e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'connectedlinename':{'type':Sequelize[_0x834e('0x2')]},'language':{'type':Sequelize[_0x834e('0x2')]},'accountcode':{'type':Sequelize[_0x834e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x834e('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x834e('0x2')]},'linkedid':{'type':Sequelize[_0x834e('0x2')]},'destchannel':{'type':Sequelize[_0x834e('0x2')]},'destchannelstate':{'type':Sequelize[_0x834e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x834e('0x2')]},'destcalleridname':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x834e('0x2')]},'destlanguage':{'type':Sequelize[_0x834e('0x2')]},'destaccountcode':{'type':Sequelize[_0x834e('0x2')]},'destcontext':{'type':Sequelize[_0x834e('0x2')]},'destexten':{'type':Sequelize[_0x834e('0x2')]},'destpriority':{'type':Sequelize[_0x834e('0x3')]},'destuniqueid':{'type':Sequelize[_0x834e('0x2')]},'destlinkedid':{'type':Sequelize[_0x834e('0x2')]},'dialstring':{'type':Sequelize[_0x834e('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x834e('0x4')]},'answertime':{'type':Sequelize[_0x834e('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x834e('0x2')],'comment':_0x834e('0x5')},'routeId':{'type':Sequelize[_0x834e('0x3')]},'duration':{'type':Sequelize[_0x834e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x834e('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index df969e4..dc9308a 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 _0x1c97=['length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','VoiceDialReport','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields'];(function(_0x4f66d2,_0x405cdd){var _0x400338=function(_0x405105){while(--_0x405105){_0x4f66d2['push'](_0x4f66d2['shift']());}};_0x400338(++_0x405cdd);}(_0x1c97,0x1ec));var _0x71c9=function(_0x1b915,_0x7fbd8a){_0x1b915=_0x1b915-0x0;var _0x27ec6b=_0x1c97[_0x1b915];return _0x27ec6b;};'use strict';var emlformat=require(_0x71c9('0x0'));var rimraf=require(_0x71c9('0x1'));var zipdir=require(_0x71c9('0x2'));var jsonpatch=require(_0x71c9('0x3'));var rp=require(_0x71c9('0x4'));var moment=require(_0x71c9('0x5'));var BPromise=require(_0x71c9('0x6'));var Mustache=require(_0x71c9('0x7'));var util=require(_0x71c9('0x8'));var path=require(_0x71c9('0x9'));var sox=require('sox');var csv=require(_0x71c9('0xa'));var ejs=require(_0x71c9('0xb'));var fs=require('fs');var fs_extra=require(_0x71c9('0xc'));var _=require('lodash');var squel=require(_0x71c9('0xd'));var crypto=require(_0x71c9('0xe'));var jsforce=require(_0x71c9('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71c9('0x10'));var Redis=require(_0x71c9('0x11'));var authService=require(_0x71c9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x71c9('0x13'));var hardwareService=require(_0x71c9('0x14'));var logger=require(_0x71c9('0x15'))(_0x71c9('0x16'));var utils=require('../../config/utils');var config=require(_0x71c9('0x17'));var licenseUtil=require(_0x71c9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11a6ca,_0x35238a){_0x35238a=_0x35238a||0xcc;return function(_0x239ff9){if(_0x239ff9){return _0x11a6ca[_0x71c9('0x19')](_0x35238a);}return _0x11a6ca['status'](_0x35238a)[_0x71c9('0x1a')]();};}function respondWithResult(_0x35b838,_0x2bbb9b){_0x2bbb9b=_0x2bbb9b||0xc8;return function(_0x1b9980){if(_0x1b9980){return _0x35b838[_0x71c9('0x1b')](_0x2bbb9b)[_0x71c9('0x1c')](_0x1b9980);}};}function respondWithFilteredResult(_0x2db696,_0x39dcdc){return function(_0x582d15){if(_0x582d15){var _0x589cb6=typeof _0x39dcdc[_0x71c9('0x1d')]===_0x71c9('0x1e')&&typeof _0x39dcdc[_0x71c9('0x1f')]===_0x71c9('0x1e');var _0x77a5de=_0x582d15[_0x71c9('0x20')];var _0x113046=_0x589cb6?0x0:_0x39dcdc['offset'];var _0x747fe9=_0x589cb6?_0x582d15[_0x71c9('0x20')]:_0x39dcdc[_0x71c9('0x1d')]+_0x39dcdc[_0x71c9('0x1f')];var _0x229e6c;if(_0x747fe9>=_0x77a5de){_0x747fe9=_0x77a5de;_0x229e6c=0xc8;}else{_0x229e6c=0xce;}_0x2db696['status'](_0x229e6c);return _0x2db696[_0x71c9('0x21')](_0x71c9('0x22'),_0x113046+'-'+_0x747fe9+'/'+_0x77a5de)[_0x71c9('0x1c')](_0x582d15);}return null;};}function patchUpdates(_0x328c3b){return function(_0x1dc764){try{jsonpatch[_0x71c9('0x23')](_0x1dc764,_0x328c3b,!![]);}catch(_0x1c3def){return BPromise[_0x71c9('0x24')](_0x1c3def);}return _0x1dc764['save']();};}function saveUpdates(_0x3a6a53,_0x406be4){return function(_0x4c74b2){if(_0x4c74b2){return _0x4c74b2['update'](_0x3a6a53)[_0x71c9('0x25')](function(_0x52144f){return _0x52144f;});}return null;};}function removeEntity(_0x1199a8,_0x1664c3){return function(_0x3c92cf){if(_0x3c92cf){return _0x3c92cf[_0x71c9('0x26')]()['then'](function(){_0x1199a8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45b818,_0x571618){return function(_0x505689){if(!_0x505689){_0x45b818[_0x71c9('0x19')](0x194);}return _0x505689;};}function handleError(_0x528b18,_0x2eaa66){_0x2eaa66=_0x2eaa66||0x1f4;return function(_0x418dd1){logger[_0x71c9('0x27')](_0x418dd1[_0x71c9('0x28')]);if(_0x418dd1[_0x71c9('0x29')]){delete _0x418dd1[_0x71c9('0x29')];}_0x528b18[_0x71c9('0x1b')](_0x2eaa66)[_0x71c9('0x2a')](_0x418dd1);};}exports[_0x71c9('0x2b')]=function(_0x3ae8ea,_0x3e0b24){var _0x5aafe0={},_0x25f4e0={},_0x435de0={'count':0x0,'rows':[]};var _0x34cf6f=_[_0x71c9('0x2c')](db['VoiceDialReport'][_0x71c9('0x2d')],function(_0x21ff20){return{'name':_0x21ff20[_0x71c9('0x2e')],'type':_0x21ff20[_0x71c9('0x2f')][_0x71c9('0x30')]};});_0x25f4e0[_0x71c9('0x31')]=_[_0x71c9('0x2c')](_0x34cf6f,_0x71c9('0x29'));_0x25f4e0[_0x71c9('0x32')]=_['keys'](_0x3ae8ea[_0x71c9('0x32')]);_0x25f4e0['filters']=_[_0x71c9('0x33')](_0x25f4e0[_0x71c9('0x31')],_0x25f4e0['query']);_0x5aafe0[_0x71c9('0x34')]=_['intersection'](_0x25f4e0[_0x71c9('0x31')],qs[_0x71c9('0x35')](_0x3ae8ea[_0x71c9('0x32')]['fields']));_0x5aafe0[_0x71c9('0x34')]=_0x5aafe0[_0x71c9('0x34')][_0x71c9('0x36')]?_0x5aafe0[_0x71c9('0x34')]:_0x25f4e0[_0x71c9('0x31')];if(!_0x3ae8ea[_0x71c9('0x32')][_0x71c9('0x37')](_0x71c9('0x38'))){_0x5aafe0[_0x71c9('0x1f')]=qs[_0x71c9('0x1f')](_0x3ae8ea[_0x71c9('0x32')][_0x71c9('0x1f')]);_0x5aafe0[_0x71c9('0x1d')]=qs['offset'](_0x3ae8ea[_0x71c9('0x32')]['offset']);}_0x5aafe0['order']=qs[_0x71c9('0x39')](_0x3ae8ea['query']['sort']);_0x5aafe0[_0x71c9('0x3a')]=qs[_0x71c9('0x3b')](_[_0x71c9('0x3c')](_0x3ae8ea[_0x71c9('0x32')],_0x25f4e0[_0x71c9('0x3b')]),_0x34cf6f);if(_0x3ae8ea[_0x71c9('0x32')]['filter']){_0x5aafe0[_0x71c9('0x3a')]=_[_0x71c9('0x3d')](_0x5aafe0['where'],{'$or':_['map'](_0x34cf6f,function(_0xe807f1){if(_0xe807f1[_0x71c9('0x2f')]!==_0x71c9('0x3e')){var _0x38e2e9={};_0x38e2e9[_0xe807f1[_0x71c9('0x29')]]={'$like':'%'+_0x3ae8ea['query'][_0x71c9('0x3f')]+'%'};return _0x38e2e9;}})});}_0x5aafe0=_['merge']({},_0x5aafe0,_0x3ae8ea[_0x71c9('0x40')]);var _0x271d6c={'where':_0x5aafe0[_0x71c9('0x3a')]};return db[_0x71c9('0x41')]['count'](_0x271d6c)[_0x71c9('0x25')](function(_0x3dfe96){_0x435de0['count']=_0x3dfe96;if(_0x3ae8ea[_0x71c9('0x32')]['includeAll']){_0x5aafe0[_0x71c9('0x42')]=[{'all':!![]}];}return db[_0x71c9('0x41')][_0x71c9('0x43')](_0x5aafe0);})[_0x71c9('0x25')](function(_0x35a275){_0x435de0[_0x71c9('0x44')]=_0x35a275;return _0x435de0;})['then'](respondWithFilteredResult(_0x3e0b24,_0x5aafe0))['catch'](handleError(_0x3e0b24,null));};exports[_0x71c9('0x45')]=function(_0x42b278,_0x412655){var _0x3d2753={'raw':!![],'where':{'id':_0x42b278[_0x71c9('0x46')]['id']}},_0x180dae={};_0x180dae[_0x71c9('0x31')]=_['keys'](db[_0x71c9('0x41')]['rawAttributes']);_0x180dae[_0x71c9('0x32')]=_[_0x71c9('0x47')](_0x42b278[_0x71c9('0x32')]);_0x180dae[_0x71c9('0x3b')]=_['intersection'](_0x180dae[_0x71c9('0x31')],_0x180dae[_0x71c9('0x32')]);_0x3d2753[_0x71c9('0x34')]=_[_0x71c9('0x33')](_0x180dae['model'],qs[_0x71c9('0x35')](_0x42b278[_0x71c9('0x32')][_0x71c9('0x35')]));_0x3d2753[_0x71c9('0x34')]=_0x3d2753['attributes']['length']?_0x3d2753[_0x71c9('0x34')]:_0x180dae[_0x71c9('0x31')];if(_0x42b278['query'][_0x71c9('0x48')]){_0x3d2753['include']=[{'all':!![]}];}_0x3d2753=_['merge']({},_0x3d2753,_0x42b278[_0x71c9('0x40')]);return db['VoiceDialReport'][_0x71c9('0x49')](_0x3d2753)[_0x71c9('0x25')](handleEntityNotFound(_0x412655,null))[_0x71c9('0x25')](respondWithResult(_0x412655,null))[_0x71c9('0x4a')](handleError(_0x412655,null));};exports['create']=function(_0x251917,_0x1b825c){return db[_0x71c9('0x41')][_0x71c9('0x4b')](_0x251917['body'],{})[_0x71c9('0x25')](respondWithResult(_0x1b825c,0xc9))[_0x71c9('0x4a')](handleError(_0x1b825c,null));};exports['update']=function(_0x231fc1,_0x12ca6b){if(_0x231fc1[_0x71c9('0x4c')]['id']){delete _0x231fc1['body']['id'];}return db[_0x71c9('0x41')][_0x71c9('0x49')]({'where':{'id':_0x231fc1[_0x71c9('0x46')]['id']}})[_0x71c9('0x25')](handleEntityNotFound(_0x12ca6b,null))[_0x71c9('0x25')](saveUpdates(_0x231fc1[_0x71c9('0x4c')],null))[_0x71c9('0x25')](respondWithResult(_0x12ca6b,null))[_0x71c9('0x4a')](handleError(_0x12ca6b,null));};exports[_0x71c9('0x26')]=function(_0x20bd74,_0x27de74){return db[_0x71c9('0x41')]['find']({'where':{'id':_0x20bd74[_0x71c9('0x46')]['id']}})['then'](handleEntityNotFound(_0x27de74,null))[_0x71c9('0x25')](removeEntity(_0x27de74,null))[_0x71c9('0x4a')](handleError(_0x27de74,null));};exports[_0x71c9('0x4d')]=function(_0x4eecbd,_0x29bcff){return db[_0x71c9('0x41')][_0x71c9('0x4d')]()[_0x71c9('0x25')](respondWithResult(_0x29bcff,null))[_0x71c9('0x4a')](handleError(_0x29bcff,null));}; \ No newline at end of file +var _0x2cb9=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','length','includeAll','create','body','find','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x2cb9,0x82));var _0x92cb=function(_0x24c5b1,_0x1e986b){_0x24c5b1=_0x24c5b1-0x0;var _0x3f2140=_0x2cb9[_0x24c5b1];return _0x3f2140;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x92cb('0x0'));var zipdir=require(_0x92cb('0x1'));var jsonpatch=require(_0x92cb('0x2'));var rp=require(_0x92cb('0x3'));var moment=require(_0x92cb('0x4'));var BPromise=require(_0x92cb('0x5'));var Mustache=require(_0x92cb('0x6'));var util=require('util');var path=require(_0x92cb('0x7'));var sox=require(_0x92cb('0x8'));var csv=require(_0x92cb('0x9'));var ejs=require(_0x92cb('0xa'));var fs=require('fs');var fs_extra=require(_0x92cb('0xb'));var _=require(_0x92cb('0xc'));var squel=require(_0x92cb('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x92cb('0xe'));var toCsv=require(_0x92cb('0x9'));var querystring=require('querystring');var Papa=require(_0x92cb('0xf'));var Redis=require('ioredis');var authService=require(_0x92cb('0x10'));var qs=require(_0x92cb('0x11'));var as=require(_0x92cb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x92cb('0x13'));var utils=require(_0x92cb('0x14'));var config=require(_0x92cb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x92cb('0x16'))['db'];function respondWithStatusCode(_0x396295,_0xf45c59){_0xf45c59=_0xf45c59||0xcc;return function(_0x47949f){if(_0x47949f){return _0x396295[_0x92cb('0x17')](_0xf45c59);}return _0x396295[_0x92cb('0x18')](_0xf45c59)[_0x92cb('0x19')]();};}function respondWithResult(_0x55f2ad,_0x2d0403){_0x2d0403=_0x2d0403||0xc8;return function(_0xa06e5a){if(_0xa06e5a){return _0x55f2ad[_0x92cb('0x18')](_0x2d0403)[_0x92cb('0x1a')](_0xa06e5a);}};}function respondWithFilteredResult(_0x41eabb,_0x1a28d5){return function(_0x352dee){if(_0x352dee){var _0xe0f46d=typeof _0x1a28d5['offset']===_0x92cb('0x1b')&&typeof _0x1a28d5[_0x92cb('0x1c')]===_0x92cb('0x1b');var _0x5d545d=_0x352dee[_0x92cb('0x1d')];var _0x10a70b=_0xe0f46d?0x0:_0x1a28d5[_0x92cb('0x1e')];var _0xc55651=_0xe0f46d?_0x352dee[_0x92cb('0x1d')]:_0x1a28d5[_0x92cb('0x1e')]+_0x1a28d5['limit'];var _0x1cf6c2;if(_0xc55651>=_0x5d545d){_0xc55651=_0x5d545d;_0x1cf6c2=0xc8;}else{_0x1cf6c2=0xce;}_0x41eabb[_0x92cb('0x18')](_0x1cf6c2);return _0x41eabb[_0x92cb('0x1f')](_0x92cb('0x20'),_0x10a70b+'-'+_0xc55651+'/'+_0x5d545d)['json'](_0x352dee);}return null;};}function patchUpdates(_0x58a1eb){return function(_0x9dc54d){try{jsonpatch[_0x92cb('0x21')](_0x9dc54d,_0x58a1eb,!![]);}catch(_0xcc844f){return BPromise[_0x92cb('0x22')](_0xcc844f);}return _0x9dc54d[_0x92cb('0x23')]();};}function saveUpdates(_0x4abb47,_0x1dda2f){return function(_0x270f2f){if(_0x270f2f){return _0x270f2f[_0x92cb('0x24')](_0x4abb47)[_0x92cb('0x25')](function(_0x401542){return _0x401542;});}return null;};}function removeEntity(_0x59bb01,_0x1a4e8a){return function(_0x3e9c48){if(_0x3e9c48){return _0x3e9c48[_0x92cb('0x26')]()[_0x92cb('0x25')](function(){_0x59bb01[_0x92cb('0x18')](0xcc)[_0x92cb('0x19')]();});}};}function handleEntityNotFound(_0x294efd,_0x54ad90){return function(_0x3a9af5){if(!_0x3a9af5){_0x294efd['sendStatus'](0x194);}return _0x3a9af5;};}function handleError(_0x41da66,_0x4e2e08){_0x4e2e08=_0x4e2e08||0x1f4;return function(_0x4dffd5){logger['error'](_0x4dffd5[_0x92cb('0x27')]);if(_0x4dffd5[_0x92cb('0x28')]){delete _0x4dffd5[_0x92cb('0x28')];}_0x41da66['status'](_0x4e2e08)[_0x92cb('0x29')](_0x4dffd5);};}exports[_0x92cb('0x2a')]=function(_0x1ee195,_0x15efc3){var _0x290148={},_0xfdb5fd={},_0x572115={'count':0x0,'rows':[]};var _0x1f46e4=_[_0x92cb('0x2b')](db[_0x92cb('0x2c')][_0x92cb('0x2d')],function(_0x31d335){return{'name':_0x31d335['fieldName'],'type':_0x31d335[_0x92cb('0x2e')]['key']};});_0xfdb5fd[_0x92cb('0x2f')]=_[_0x92cb('0x2b')](_0x1f46e4,'name');_0xfdb5fd[_0x92cb('0x30')]=_[_0x92cb('0x31')](_0x1ee195[_0x92cb('0x30')]);_0xfdb5fd[_0x92cb('0x32')]=_[_0x92cb('0x33')](_0xfdb5fd[_0x92cb('0x2f')],_0xfdb5fd[_0x92cb('0x30')]);_0x290148[_0x92cb('0x34')]=_[_0x92cb('0x33')](_0xfdb5fd[_0x92cb('0x2f')],qs[_0x92cb('0x35')](_0x1ee195[_0x92cb('0x30')][_0x92cb('0x35')]));_0x290148[_0x92cb('0x34')]=_0x290148['attributes']['length']?_0x290148[_0x92cb('0x34')]:_0xfdb5fd['model'];if(!_0x1ee195[_0x92cb('0x30')][_0x92cb('0x36')](_0x92cb('0x37'))){_0x290148[_0x92cb('0x1c')]=qs[_0x92cb('0x1c')](_0x1ee195[_0x92cb('0x30')][_0x92cb('0x1c')]);_0x290148[_0x92cb('0x1e')]=qs['offset'](_0x1ee195[_0x92cb('0x30')][_0x92cb('0x1e')]);}_0x290148['order']=qs[_0x92cb('0x38')](_0x1ee195['query'][_0x92cb('0x38')]);_0x290148[_0x92cb('0x39')]=qs['filters'](_['pick'](_0x1ee195[_0x92cb('0x30')],_0xfdb5fd['filters']),_0x1f46e4);if(_0x1ee195[_0x92cb('0x30')][_0x92cb('0x3a')]){_0x290148['where']=_['merge'](_0x290148[_0x92cb('0x39')],{'$or':_[_0x92cb('0x2b')](_0x1f46e4,function(_0x18cd2a){if(_0x18cd2a[_0x92cb('0x2e')]!==_0x92cb('0x3b')){var _0x1d881e={};_0x1d881e[_0x18cd2a['name']]={'$like':'%'+_0x1ee195['query'][_0x92cb('0x3a')]+'%'};return _0x1d881e;}})});}_0x290148=_[_0x92cb('0x3c')]({},_0x290148,_0x1ee195[_0x92cb('0x3d')]);var _0x3f5429={'where':_0x290148[_0x92cb('0x39')]};return db['VoiceDialReport'][_0x92cb('0x1d')](_0x3f5429)[_0x92cb('0x25')](function(_0x4f7cf4){_0x572115[_0x92cb('0x1d')]=_0x4f7cf4;if(_0x1ee195[_0x92cb('0x30')]['includeAll']){_0x290148[_0x92cb('0x3e')]=[{'all':!![]}];}return db[_0x92cb('0x2c')][_0x92cb('0x3f')](_0x290148);})[_0x92cb('0x25')](function(_0x4ac6f4){_0x572115[_0x92cb('0x40')]=_0x4ac6f4;return _0x572115;})['then'](respondWithFilteredResult(_0x15efc3,_0x290148))['catch'](handleError(_0x15efc3,null));};exports[_0x92cb('0x41')]=function(_0x505f91,_0x2b0d05){var _0x26ead6={'raw':!![],'where':{'id':_0x505f91[_0x92cb('0x42')]['id']}},_0x514747={};_0x514747[_0x92cb('0x2f')]=_[_0x92cb('0x31')](db[_0x92cb('0x2c')][_0x92cb('0x2d')]);_0x514747['query']=_[_0x92cb('0x31')](_0x505f91[_0x92cb('0x30')]);_0x514747[_0x92cb('0x32')]=_[_0x92cb('0x33')](_0x514747[_0x92cb('0x2f')],_0x514747[_0x92cb('0x30')]);_0x26ead6[_0x92cb('0x34')]=_[_0x92cb('0x33')](_0x514747[_0x92cb('0x2f')],qs[_0x92cb('0x35')](_0x505f91[_0x92cb('0x30')]['fields']));_0x26ead6[_0x92cb('0x34')]=_0x26ead6[_0x92cb('0x34')][_0x92cb('0x43')]?_0x26ead6[_0x92cb('0x34')]:_0x514747[_0x92cb('0x2f')];if(_0x505f91[_0x92cb('0x30')][_0x92cb('0x44')]){_0x26ead6[_0x92cb('0x3e')]=[{'all':!![]}];}_0x26ead6=_['merge']({},_0x26ead6,_0x505f91[_0x92cb('0x3d')]);return db[_0x92cb('0x2c')]['find'](_0x26ead6)[_0x92cb('0x25')](handleEntityNotFound(_0x2b0d05,null))['then'](respondWithResult(_0x2b0d05,null))['catch'](handleError(_0x2b0d05,null));};exports[_0x92cb('0x45')]=function(_0x2fc9df,_0x48a29d){return db[_0x92cb('0x2c')][_0x92cb('0x45')](_0x2fc9df[_0x92cb('0x46')],{})['then'](respondWithResult(_0x48a29d,0xc9))['catch'](handleError(_0x48a29d,null));};exports[_0x92cb('0x24')]=function(_0x4ff1df,_0x3c3246){if(_0x4ff1df[_0x92cb('0x46')]['id']){delete _0x4ff1df[_0x92cb('0x46')]['id'];}return db['VoiceDialReport'][_0x92cb('0x47')]({'where':{'id':_0x4ff1df[_0x92cb('0x42')]['id']}})[_0x92cb('0x25')](handleEntityNotFound(_0x3c3246,null))[_0x92cb('0x25')](saveUpdates(_0x4ff1df[_0x92cb('0x46')],null))[_0x92cb('0x25')](respondWithResult(_0x3c3246,null))[_0x92cb('0x48')](handleError(_0x3c3246,null));};exports[_0x92cb('0x26')]=function(_0x3d6a54,_0x2a3bc5){return db[_0x92cb('0x2c')][_0x92cb('0x47')]({'where':{'id':_0x3d6a54['params']['id']}})[_0x92cb('0x25')](handleEntityNotFound(_0x2a3bc5,null))[_0x92cb('0x25')](removeEntity(_0x2a3bc5,null))[_0x92cb('0x48')](handleError(_0x2a3bc5,null));};exports[_0x92cb('0x49')]=function(_0x263975,_0x23135b){return db[_0x92cb('0x2c')][_0x92cb('0x49')]()[_0x92cb('0x25')](respondWithResult(_0x23135b,null))['catch'](handleError(_0x23135b,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 6534e77..9545cb2 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 _0x7f3f=['uniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x7f3f[_0x149a9b];return _0x2c2bf6;};'use strict';var _=require(_0xf7f3('0x0'));var util=require(_0xf7f3('0x1'));var logger=require('../../config/logger')(_0xf7f3('0x2'));var moment=require(_0xf7f3('0x3'));var BPromise=require(_0xf7f3('0x4'));var rp=require(_0xf7f3('0x5'));var fs=require('fs');var path=require(_0xf7f3('0x6'));var rimraf=require('rimraf');var config=require(_0xf7f3('0x7'));var attributes=require(_0xf7f3('0x8'));module['exports']=function(_0x163eab,_0x2c1059){return _0x163eab[_0xf7f3('0x9')](_0xf7f3('0xa'),attributes,{'tableName':_0xf7f3('0xb'),'paranoid':![],'indexes':[{'fields':[_0xf7f3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbb8=['VoiceDialReport','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','./voiceDialReport.attributes'];(function(_0x255f3b,_0x5e4699){var _0x849fda=function(_0x2d31ca){while(--_0x2d31ca){_0x255f3b['push'](_0x255f3b['shift']());}};_0x849fda(++_0x5e4699);}(_0xfbb8,0x160));var _0x8fbb=function(_0x590381,_0x5c3948){_0x590381=_0x590381-0x0;var _0xe300df=_0xfbb8[_0x590381];return _0xe300df;};'use strict';var _=require(_0x8fbb('0x0'));var util=require(_0x8fbb('0x1'));var logger=require(_0x8fbb('0x2'))(_0x8fbb('0x3'));var moment=require('moment');var BPromise=require(_0x8fbb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fbb('0x5'));var rimraf=require(_0x8fbb('0x6'));var config=require('../../config/environment');var attributes=require(_0x8fbb('0x7'));module['exports']=function(_0x292a4a,_0x3c14a9){return _0x292a4a['define'](_0x8fbb('0x8'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x8fbb('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 989c84f..a4bd405 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 _0xada2=['attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','stringify','UpdateVoiceDialReport'];(function(_0x43dae0,_0x31f275){var _0x55dc1c=function(_0xd0dd74){while(--_0xd0dd74){_0x43dae0['push'](_0x43dae0['shift']());}};_0x55dc1c(++_0x31f275);}(_0xada2,0xc2));var _0x2ada=function(_0x21119f,_0x42e7a7){_0x21119f=_0x21119f-0x0;var _0x31135e=_0xada2[_0x21119f];return _0x31135e;};'use strict';var _=require(_0x2ada('0x0'));var util=require('util');var moment=require(_0x2ada('0x1'));var BPromise=require('bluebird');var rs=require(_0x2ada('0x2'));var fs=require('fs');var Redis=require(_0x2ada('0x3'));var db=require(_0x2ada('0x4'))['db'];var utils=require(_0x2ada('0x5'));var logger=require(_0x2ada('0x6'))(_0x2ada('0x7'));var config=require(_0x2ada('0x8'));var jayson=require(_0x2ada('0x9'));var client=jayson[_0x2ada('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x269249,_0x92ba58,_0x11cf14){return new BPromise(function(_0x2788fd,_0x435437){return client['request'](_0x269249,_0x11cf14)[_0x2ada('0xb')](function(_0x539d07){logger[_0x2ada('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x92ba58,_0x2ada('0xd'));logger[_0x2ada('0xe')](_0x2ada('0xf'),_0x92ba58,_0x2ada('0xd'),JSON['stringify'](_0x539d07));if(_0x539d07[_0x2ada('0x10')]){if(_0x539d07[_0x2ada('0x10')][_0x2ada('0x11')]===0x1f4){logger['error'](_0x2ada('0x12'),_0x92ba58,_0x539d07['error'][_0x2ada('0x13')]);return _0x435437(_0x539d07[_0x2ada('0x10')]['message']);}logger['error'](_0x2ada('0x12'),_0x92ba58,_0x539d07[_0x2ada('0x10')][_0x2ada('0x13')]);return _0x2788fd(_0x539d07['error'][_0x2ada('0x13')]);}else{logger[_0x2ada('0xc')](_0x2ada('0x12'),_0x92ba58,_0x2ada('0xd'));_0x2788fd(_0x539d07[_0x2ada('0x14')][_0x2ada('0x13')]);}})[_0x2ada('0x15')](function(_0x3111cc){logger['error'](_0x2ada('0x12'),_0x92ba58,_0x3111cc);_0x435437(_0x3111cc);});});}exports[_0x2ada('0x16')]=function(_0x6cae58){var _0x21a548=this;return new Promise(function(_0x815867,_0x38c8cc){return db[_0x2ada('0x17')][_0x2ada('0x18')](_0x6cae58[_0x2ada('0x19')],{'raw':_0x6cae58[_0x2ada('0x1a')]?_0x6cae58[_0x2ada('0x1a')][_0x2ada('0x1b')]===undefined?!![]:![]:!![]})[_0x2ada('0xb')](function(_0x8847ab){logger[_0x2ada('0xc')](_0x2ada('0x16'),_0x6cae58);logger[_0x2ada('0xe')]('CreateVoiceDialReport',_0x6cae58,JSON[_0x2ada('0x1c')](_0x8847ab));_0x815867(_0x8847ab);})[_0x2ada('0x15')](function(_0x14ed86){logger['error'](_0x2ada('0x16'),_0x14ed86[_0x2ada('0x13')],_0x6cae58);_0x38c8cc(_0x21a548[_0x2ada('0x10')](0x1f4,_0x14ed86[_0x2ada('0x13')]));});});};exports[_0x2ada('0x1d')]=function(_0x29be5f){var _0x40f1c1=this;return new Promise(function(_0xd0a83a,_0x12ad51){return db['VoiceDialReport']['update'](_0x29be5f[_0x2ada('0x19')],{'raw':_0x29be5f[_0x2ada('0x1a')]?_0x29be5f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29be5f[_0x2ada('0x1a')]?_0x29be5f[_0x2ada('0x1a')]['where']||null:null,'attributes':_0x29be5f[_0x2ada('0x1a')]?_0x29be5f[_0x2ada('0x1a')][_0x2ada('0x1e')]||null:null,'limit':_0x29be5f[_0x2ada('0x1a')]?_0x29be5f[_0x2ada('0x1a')][_0x2ada('0x1f')]||null:null})[_0x2ada('0xb')](function(_0x249499){logger[_0x2ada('0xc')](_0x2ada('0x1d'),_0x29be5f);logger[_0x2ada('0xe')]('UpdateVoiceDialReport',_0x29be5f,JSON['stringify'](_0x249499));_0xd0a83a(_0x249499);})['catch'](function(_0x1e6074){logger[_0x2ada('0x10')](_0x2ada('0x1d'),_0x1e6074[_0x2ada('0x13')],_0x29be5f);_0x12ad51(_0x40f1c1['error'](0x1f4,_0x1e6074['message']));});});}; \ No newline at end of file +var _0x16bb=['rpc','../../config/environment','jayson/promise','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','where','limit','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x10c190,_0xda61fe){var _0x3ed8ec=function(_0x2dbbfd){while(--_0x2dbbfd){_0x10c190['push'](_0x10c190['shift']());}};_0x3ed8ec(++_0xda61fe);}(_0x16bb,0x72));var _0xb16b=function(_0x3d8f21,_0x359d21){_0x3d8f21=_0x3d8f21-0x0;var _0x3cdde5=_0x16bb[_0x3d8f21];return _0x3cdde5;};'use strict';var _=require('lodash');var util=require(_0xb16b('0x0'));var moment=require(_0xb16b('0x1'));var BPromise=require('bluebird');var rs=require(_0xb16b('0x2'));var fs=require('fs');var Redis=require(_0xb16b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb16b('0x4'));var logger=require(_0xb16b('0x5'))(_0xb16b('0x6'));var config=require(_0xb16b('0x7'));var jayson=require(_0xb16b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37ca56,_0x539bde,_0x1ab1a4){return new BPromise(function(_0x316c85,_0x3d7a1e){return client['request'](_0x37ca56,_0x1ab1a4)[_0xb16b('0x9')](function(_0x132d8b){logger[_0xb16b('0xa')](_0xb16b('0xb'),_0x539bde,_0xb16b('0xc'));logger[_0xb16b('0xd')](_0xb16b('0xe'),_0x539bde,_0xb16b('0xc'),JSON[_0xb16b('0xf')](_0x132d8b));if(_0x132d8b['error']){if(_0x132d8b['error']['code']===0x1f4){logger[_0xb16b('0x10')](_0xb16b('0xb'),_0x539bde,_0x132d8b['error'][_0xb16b('0x11')]);return _0x3d7a1e(_0x132d8b['error'][_0xb16b('0x11')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x539bde,_0x132d8b[_0xb16b('0x10')]['message']);return _0x316c85(_0x132d8b[_0xb16b('0x10')][_0xb16b('0x11')]);}else{logger[_0xb16b('0xa')](_0xb16b('0xb'),_0x539bde,_0xb16b('0xc'));_0x316c85(_0x132d8b[_0xb16b('0x12')]['message']);}})[_0xb16b('0x13')](function(_0x47e1d1){logger[_0xb16b('0x10')](_0xb16b('0xb'),_0x539bde,_0x47e1d1);_0x3d7a1e(_0x47e1d1);});});}exports[_0xb16b('0x14')]=function(_0x2a8918){var _0x59f423=this;return new Promise(function(_0x5092f7,_0x1e6c2c){return db[_0xb16b('0x15')][_0xb16b('0x16')](_0x2a8918[_0xb16b('0x17')],{'raw':_0x2a8918[_0xb16b('0x18')]?_0x2a8918['options'][_0xb16b('0x19')]===undefined?!![]:![]:!![]})[_0xb16b('0x9')](function(_0x447647){logger[_0xb16b('0xa')](_0xb16b('0x14'),_0x2a8918);logger['debug'](_0xb16b('0x14'),_0x2a8918,JSON[_0xb16b('0xf')](_0x447647));_0x5092f7(_0x447647);})[_0xb16b('0x13')](function(_0x342f5a){logger[_0xb16b('0x10')](_0xb16b('0x14'),_0x342f5a['message'],_0x2a8918);_0x1e6c2c(_0x59f423[_0xb16b('0x10')](0x1f4,_0x342f5a[_0xb16b('0x11')]));});});};exports[_0xb16b('0x1a')]=function(_0x54175a){var _0x320434=this;return new Promise(function(_0x2b3d05,_0x4cbc92){return db['VoiceDialReport'][_0xb16b('0x1b')](_0x54175a[_0xb16b('0x17')],{'raw':_0x54175a[_0xb16b('0x18')]?_0x54175a['options'][_0xb16b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54175a[_0xb16b('0x18')]?_0x54175a['options'][_0xb16b('0x1c')]||null:null,'attributes':_0x54175a[_0xb16b('0x18')]?_0x54175a[_0xb16b('0x18')]['attributes']||null:null,'limit':_0x54175a[_0xb16b('0x18')]?_0x54175a[_0xb16b('0x18')][_0xb16b('0x1d')]||null:null})[_0xb16b('0x9')](function(_0x1ee6f4){logger['info'](_0xb16b('0x1a'),_0x54175a);logger[_0xb16b('0xd')](_0xb16b('0x1a'),_0x54175a,JSON[_0xb16b('0xf')](_0x1ee6f4));_0x2b3d05(_0x1ee6f4);})[_0xb16b('0x13')](function(_0x27099c){logger[_0xb16b('0x10')]('UpdateVoiceDialReport',_0x27099c[_0xb16b('0x11')],_0x54175a);_0x4cbc92(_0x320434[_0xb16b('0x10')](0x1f4,_0x27099c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 70b991d..48d1a6e 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 _0x9535=['./voiceExtension.controller','index','get','/:id','show','post','isAuthenticated','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x39e384,_0x1bd5ae){var _0x11aed2=function(_0x200d26){while(--_0x200d26){_0x39e384['push'](_0x39e384['shift']());}};_0x11aed2(++_0x1bd5ae);}(_0x9535,0x1f2));var _0x5953=function(_0x2efab7,_0x4748e6){_0x2efab7=_0x2efab7-0x0;var _0x41478c=_0x9535[_0x2efab7];return _0x41478c;};'use strict';var multer=require(_0x5953('0x0'));var util=require('util');var path=require(_0x5953('0x1'));var timeout=require(_0x5953('0x2'));var express=require(_0x5953('0x3'));var router=express[_0x5953('0x4')]();var fs_extra=require(_0x5953('0x5'));var auth=require(_0x5953('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5953('0x7'));var controller=require(_0x5953('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5953('0x9')]);router[_0x5953('0xa')](_0x5953('0xb'),auth['isAuthenticated'](),controller[_0x5953('0xc')]);router[_0x5953('0xd')]('/',auth[_0x5953('0xe')](),controller[_0x5953('0xf')]);router[_0x5953('0xd')](_0x5953('0x10'),auth[_0x5953('0xe')](),controller[_0x5953('0x11')]);router[_0x5953('0x12')]('/:id',auth[_0x5953('0xe')](),controller[_0x5953('0x13')]);router[_0x5953('0x14')](_0x5953('0xb'),auth[_0x5953('0xe')](),controller[_0x5953('0x15')]);module[_0x5953('0x16')]=router; \ No newline at end of file +var _0x9b6a=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','create','post','/:id/applications','addApplications','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service'];(function(_0x3895b7,_0xd4796b){var _0x3f3b8c=function(_0x43a116){while(--_0x43a116){_0x3895b7['push'](_0x3895b7['shift']());}};_0x3f3b8c(++_0xd4796b);}(_0x9b6a,0xdf));var _0xa9b6=function(_0x5b3487,_0x27dc26){_0x5b3487=_0x5b3487-0x0;var _0x2a8f2e=_0x9b6a[_0x5b3487];return _0x2a8f2e;};'use strict';var multer=require(_0xa9b6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa9b6('0x1'));var router=express[_0xa9b6('0x2')]();var fs_extra=require(_0xa9b6('0x3'));var auth=require(_0xa9b6('0x4'));var interaction=require(_0xa9b6('0x5'));var config=require(_0xa9b6('0x6'));var controller=require(_0xa9b6('0x7'));router[_0xa9b6('0x8')]('/',auth[_0xa9b6('0x9')](),controller[_0xa9b6('0xa')]);router['get'](_0xa9b6('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xa9b6('0x9')](),controller[_0xa9b6('0xc')]);router[_0xa9b6('0xd')](_0xa9b6('0xe'),auth[_0xa9b6('0x9')](),controller[_0xa9b6('0xf')]);router['put'](_0xa9b6('0xb'),auth[_0xa9b6('0x9')](),controller['update']);router[_0xa9b6('0x10')](_0xa9b6('0xb'),auth[_0xa9b6('0x9')](),controller[_0xa9b6('0x11')]);module[_0xa9b6('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 034a4c8..d26477e 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 _0x0068=['sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten'];(function(_0x3dca03,_0x40ef4e){var _0x20b315=function(_0x311dd3){while(--_0x311dd3){_0x3dca03['push'](_0x3dca03['shift']());}};_0x20b315(++_0x40ef4e);}(_0x0068,0x10a));var _0x8006=function(_0x5241ff,_0x4fa868){_0x5241ff=_0x5241ff-0x0;var _0x10974a=_0x0068[_0x5241ff];return _0x10974a;};'use strict';var Sequelize=require(_0x8006('0x0'));module['exports']={'context':{'type':Sequelize[_0x8006('0x1')],'allowNull':![],'unique':_0x8006('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8006('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x8006('0x2')},'tag':{'type':Sequelize[_0x8006('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8006('0x3')},'appdata':{'type':Sequelize[_0x8006('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x8006('0x4')](_0x8006('0x5'),_0x8006('0x6'),_0x8006('0x7'),_0x8006('0x8'),_0x8006('0x9'),_0x8006('0xa'),_0x8006('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x8006('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8006('0xc')},'IntervalId':{'type':Sequelize[_0x8006('0xd')]},'isApp':{'type':Sequelize[_0x8006('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x8006('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x8006('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x8006('0x1')],'defaultValue':_0x8006('0xf')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x8006('0x10')],'get':function(_0x435208){return this[_0x8006('0x11')](_0x8006('0x12'));}},'alias':{'type':Sequelize[_0x8006('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x2c34=['compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x2c34,0xe1));var _0x42c3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2c34[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x42c3('0x0'));module[_0x42c3('0x1')]={'context':{'type':Sequelize[_0x42c3('0x2')],'allowNull':![],'unique':_0x42c3('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x42c3('0x2')],'allowNull':![],'unique':_0x42c3('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x42c3('0x3')},'tag':{'type':Sequelize[_0x42c3('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x42c3('0x2')],'allowNull':![],'defaultValue':_0x42c3('0x4')},'appdata':{'type':Sequelize[_0x42c3('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x42c3('0x5')](_0x42c3('0x6'),_0x42c3('0x7'),_0x42c3('0x8'),_0x42c3('0x9'),_0x42c3('0xa'),'system',_0x42c3('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x42c3('0x2')]},'interval':{'type':Sequelize[_0x42c3('0x2')],'allowNull':![],'defaultValue':_0x42c3('0xc')},'IntervalId':{'type':Sequelize[_0x42c3('0xd')]},'isApp':{'type':Sequelize[_0x42c3('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x42c3('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x42c3('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x42c3('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x42c3('0xd')]},'recordingFormat':{'type':Sequelize[_0x42c3('0x2')],'defaultValue':_0x42c3('0xf')},'answer':{'type':Sequelize[_0x42c3('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x42c3('0x10')],'get':function(_0x5d32cf){return this[_0x42c3('0x11')](_0x42c3('0x12'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index b26243b..9716113 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 _0x3b81=['squel','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','includes','find','type','name','UserProfileResource','send','map','VoiceExtension','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','findOne','sequelize','isApp','rewriteDial','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5f1e1c,_0x329fc6){var _0x5981f5=function(_0x2f1db5){while(--_0x2f1db5){_0x5f1e1c['push'](_0x5f1e1c['shift']());}};_0x5981f5(++_0x329fc6);}(_0x3b81,0x132));var _0x13b8=function(_0x2bfe2c,_0x244cc5){_0x2bfe2c=_0x2bfe2c-0x0;var _0x311713=_0x3b81[_0x2bfe2c];return _0x311713;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13b8('0x1'));var rp=require(_0x13b8('0x2'));var moment=require(_0x13b8('0x3'));var BPromise=require(_0x13b8('0x4'));var Mustache=require('mustache');var util=require(_0x13b8('0x5'));var path=require(_0x13b8('0x6'));var sox=require(_0x13b8('0x7'));var csv=require(_0x13b8('0x8'));var ejs=require(_0x13b8('0x9'));var fs=require('fs');var fs_extra=require(_0x13b8('0xa'));var _=require(_0x13b8('0xb'));var squel=require(_0x13b8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x13b8('0xd'));var toCsv=require(_0x13b8('0x8'));var querystring=require('querystring');var Papa=require(_0x13b8('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x13b8('0xf'));var as=require(_0x13b8('0x10'));var hardwareService=require(_0x13b8('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x13b8('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x13b8('0x13'));var db=require(_0x13b8('0x14'))['db'];config['redis']=_[_0x13b8('0x15')](config['redis'],{'host':_0x13b8('0x16'),'port':0x18eb});var socket=require(_0x13b8('0x17'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x13b8('0x18')](socket);function respondWithStatusCode(_0x33a54a,_0x5b0102){_0x5b0102=_0x5b0102||0xcc;return function(_0x28cf2c){if(_0x28cf2c){return _0x33a54a[_0x13b8('0x19')](_0x5b0102);}return _0x33a54a[_0x13b8('0x1a')](_0x5b0102)[_0x13b8('0x1b')]();};}function respondWithResult(_0x4035ab,_0x5bc884){_0x5bc884=_0x5bc884||0xc8;return function(_0x30081f){if(_0x30081f){return _0x4035ab[_0x13b8('0x1a')](_0x5bc884)['json'](_0x30081f);}};}function respondWithFilteredResult(_0x38da8d,_0x3c2f17){return function(_0x412be0){if(_0x412be0){var _0x406c2d=typeof _0x3c2f17[_0x13b8('0x1c')]===_0x13b8('0x1d')&&typeof _0x3c2f17[_0x13b8('0x1e')]===_0x13b8('0x1d');var _0x163f2a=_0x412be0['count'];var _0xe9c4fa=_0x406c2d?0x0:_0x3c2f17['offset'];var _0x3eb800=_0x406c2d?_0x412be0[_0x13b8('0x1f')]:_0x3c2f17[_0x13b8('0x1c')]+_0x3c2f17[_0x13b8('0x1e')];var _0x5d766c;if(_0x3eb800>=_0x163f2a){_0x3eb800=_0x163f2a;_0x5d766c=0xc8;}else{_0x5d766c=0xce;}_0x38da8d[_0x13b8('0x1a')](_0x5d766c);return _0x38da8d[_0x13b8('0x20')](_0x13b8('0x21'),_0xe9c4fa+'-'+_0x3eb800+'/'+_0x163f2a)['json'](_0x412be0);}return null;};}function patchUpdates(_0x24f964){return function(_0x4cb5a2){try{jsonpatch[_0x13b8('0x22')](_0x4cb5a2,_0x24f964,!![]);}catch(_0x2d3724){return BPromise[_0x13b8('0x23')](_0x2d3724);}return _0x4cb5a2[_0x13b8('0x24')]();};}function saveUpdates(_0x120df5,_0x525c91){return function(_0x49184c){if(_0x49184c){return _0x49184c[_0x13b8('0x25')](_0x120df5)['then'](function(_0x2222a9){return _0x2222a9;});}return null;};}function removeEntity(_0x2b55c,_0x371dc0){return function(_0x2d1905){if(_0x2d1905){return _0x2d1905[_0x13b8('0x26')]()[_0x13b8('0x27')](function(){var _0xd1a811=_0x2d1905[_0x13b8('0x28')]({'plain':!![]});var _0x4a548b=[{'name':_0x13b8('0x29'),'value':_0x13b8('0x2a'),'ignore':![]},{'name':_0x13b8('0x2b'),'value':_0x13b8('0x2c'),'ignore':![]},{'name':_0x13b8('0x2d'),'value':_0x13b8('0x2e'),'ignore':![]}];var _0x16a8ce=_(_0x4a548b)[_0x13b8('0x2f')](_0x13b8('0x30'))['map'](_0x13b8('0x31'))[_0x13b8('0x31')]();if(_[_0x13b8('0x32')](_0x16a8ce,_0xd1a811['type'])){return;}var _0x52a9c9=_[_0x13b8('0x33')](_0x4a548b,[_0x13b8('0x31'),_0xd1a811[_0x13b8('0x34')]])[_0x13b8('0x35')];return db[_0x13b8('0x36')]['destroy']({'where':{'type':_0x52a9c9,'resourceId':_0xd1a811['id']}})[_0x13b8('0x27')](function(){return _0x2d1905;});})[_0x13b8('0x27')](function(){_0x2b55c[_0x13b8('0x1a')](0xcc)[_0x13b8('0x1b')]();});}};}function handleEntityNotFound(_0x515925,_0x97eca1){return function(_0x3bb2c9){if(!_0x3bb2c9){_0x515925['sendStatus'](0x194);}return _0x3bb2c9;};}function handleError(_0x26eef9,_0x341070){_0x341070=_0x341070||0x1f4;return function(_0x350a88){logger['error'](_0x350a88['stack']);if(_0x350a88['name']){delete _0x350a88[_0x13b8('0x35')];}_0x26eef9[_0x13b8('0x1a')](_0x341070)[_0x13b8('0x37')](_0x350a88);};}exports['index']=function(_0x5813bb,_0x520c5f){var _0x4e45fe={},_0x26a6b5={},_0x4d139={'count':0x0,'rows':[]};var _0x374457=_[_0x13b8('0x38')](db[_0x13b8('0x39')][_0x13b8('0x3a')],function(_0xb56f3b){return{'name':_0xb56f3b[_0x13b8('0x3b')],'type':_0xb56f3b['type']['key']};});_0x26a6b5[_0x13b8('0x3c')]=_[_0x13b8('0x38')](_0x374457,_0x13b8('0x35'));_0x26a6b5[_0x13b8('0x3d')]=_[_0x13b8('0x3e')](_0x5813bb['query']);_0x26a6b5[_0x13b8('0x3f')]=_[_0x13b8('0x40')](_0x26a6b5[_0x13b8('0x3c')],_0x26a6b5[_0x13b8('0x3d')]);_0x4e45fe[_0x13b8('0x41')]=_[_0x13b8('0x40')](_0x26a6b5[_0x13b8('0x3c')],qs[_0x13b8('0x42')](_0x5813bb['query'][_0x13b8('0x42')]));_0x4e45fe[_0x13b8('0x41')]=_0x4e45fe[_0x13b8('0x41')][_0x13b8('0x43')]?_0x4e45fe[_0x13b8('0x41')]:_0x26a6b5[_0x13b8('0x3c')];if(!_0x5813bb[_0x13b8('0x3d')][_0x13b8('0x44')]('nolimit')){_0x4e45fe['limit']=qs[_0x13b8('0x1e')](_0x5813bb[_0x13b8('0x3d')][_0x13b8('0x1e')]);_0x4e45fe[_0x13b8('0x1c')]=qs[_0x13b8('0x1c')](_0x5813bb[_0x13b8('0x3d')][_0x13b8('0x1c')]);}_0x4e45fe[_0x13b8('0x45')]=qs[_0x13b8('0x46')](_0x5813bb['query'][_0x13b8('0x46')]);_0x4e45fe[_0x13b8('0x47')]=qs[_0x13b8('0x3f')](_[_0x13b8('0x48')](_0x5813bb[_0x13b8('0x3d')],_0x26a6b5[_0x13b8('0x3f')]),_0x374457);if(_0x5813bb['query'][_0x13b8('0x2f')]){_0x4e45fe[_0x13b8('0x47')]=_[_0x13b8('0x49')](_0x4e45fe['where'],{'$or':_[_0x13b8('0x38')](_0x374457,function(_0x3847c5){if(_0x3847c5['type']!==_0x13b8('0x4a')){var _0x2798b5={};_0x2798b5[_0x3847c5[_0x13b8('0x35')]]={'$like':'%'+_0x5813bb[_0x13b8('0x3d')]['filter']+'%'};return _0x2798b5;}})});}_0x4e45fe=_[_0x13b8('0x49')]({},_0x4e45fe,_0x5813bb[_0x13b8('0x4b')]);var _0x4027c1={'where':_0x4e45fe[_0x13b8('0x47')]};return db['VoiceExtension'][_0x13b8('0x1f')](_0x4027c1)[_0x13b8('0x27')](function(_0x4d1ec3){_0x4d139[_0x13b8('0x1f')]=_0x4d1ec3;if(_0x5813bb[_0x13b8('0x3d')][_0x13b8('0x4c')]){_0x4e45fe[_0x13b8('0x4d')]=[{'all':!![]}];}return db['VoiceExtension'][_0x13b8('0x4e')](_0x4e45fe);})['then'](function(_0x5384c5){_0x4d139['rows']=_0x5384c5;return _0x4d139;})['then'](respondWithFilteredResult(_0x520c5f,_0x4e45fe))[_0x13b8('0x4f')](handleError(_0x520c5f,null));};exports[_0x13b8('0x50')]=function(_0x33bdd1,_0x399ed1){var _0x11b5aa={'raw':![],'where':{'id':_0x33bdd1[_0x13b8('0x51')]['id']}},_0x311053={};_0x311053['model']=_['keys'](db[_0x13b8('0x39')][_0x13b8('0x3a')]);_0x311053[_0x13b8('0x3d')]=_[_0x13b8('0x3e')](_0x33bdd1[_0x13b8('0x3d')]);_0x311053[_0x13b8('0x3f')]=_[_0x13b8('0x40')](_0x311053[_0x13b8('0x3c')],_0x311053['query']);_0x11b5aa[_0x13b8('0x41')]=_['intersection'](_0x311053[_0x13b8('0x3c')],qs[_0x13b8('0x42')](_0x33bdd1['query'][_0x13b8('0x42')]));_0x11b5aa[_0x13b8('0x41')]=_0x11b5aa[_0x13b8('0x41')]['length']?_0x11b5aa[_0x13b8('0x41')]:_0x311053[_0x13b8('0x3c')];if(_0x33bdd1[_0x13b8('0x3d')]['includeAll']){_0x11b5aa[_0x13b8('0x4d')]=[{'all':!![]}];}_0x11b5aa=_[_0x13b8('0x49')]({},_0x11b5aa,_0x33bdd1['options']);return db[_0x13b8('0x39')][_0x13b8('0x33')](_0x11b5aa)[_0x13b8('0x27')](handleEntityNotFound(_0x399ed1,null))[_0x13b8('0x27')](respondWithResult(_0x399ed1,null))[_0x13b8('0x4f')](handleError(_0x399ed1,null));};exports[_0x13b8('0x26')]=function(_0x311dd0,_0x472e15){return db[_0x13b8('0x39')]['find']({'where':{'id':_0x311dd0[_0x13b8('0x51')]['id']}})[_0x13b8('0x27')](handleEntityNotFound(_0x472e15,null))[_0x13b8('0x27')](removeEntity(_0x472e15,null))[_0x13b8('0x4f')](handleError(_0x472e15,null));};exports[_0x13b8('0x52')]=function(_0x368b46,_0x443e18){if(_0x368b46[_0x13b8('0x53')][_0x13b8('0x34')]===_0x13b8('0x2c')&&!_['startsWith'](_0x368b46[_0x13b8('0x53')][_0x13b8('0x54')],'_')){_0x368b46['body'][_0x13b8('0x54')]='_'['concat'](_0x368b46[_0x13b8('0x53')][_0x13b8('0x54')]);}return db[_0x13b8('0x39')][_0x13b8('0x52')](_0x368b46['body'],{'raw':![]})[_0x13b8('0x27')](function(_0x392e58){var _0x210446=_0x368b46[_0x13b8('0x55')]['get']({'plain':!![]});if(!_0x210446)throw new Error(_0x13b8('0x56'));if(_0x210446[_0x13b8('0x57')]===_0x13b8('0x55')){var _0x1921c4=_0x392e58[_0x13b8('0x28')]({'plain':!![]});var _0x124081=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x13b8('0x2b'),'value':_0x13b8('0x2c')},{'name':_0x13b8('0x2d'),'value':_0x13b8('0x2e')}];var _0x213a56=_['find'](_0x124081,[_0x13b8('0x31'),_0x1921c4[_0x13b8('0x34')]])[_0x13b8('0x35')];return db['UserProfileSection'][_0x13b8('0x33')]({'where':{'name':_0x213a56,'userProfileId':_0x210446[_0x13b8('0x58')]},'raw':!![]})[_0x13b8('0x27')](function(_0x3fc7f9){if(_0x3fc7f9&&_0x3fc7f9[_0x13b8('0x59')]===0x0){return db[_0x13b8('0x36')][_0x13b8('0x52')]({'name':_0x1921c4['name'],'resourceId':_0x1921c4['id'],'type':_0x3fc7f9[_0x13b8('0x35')],'sectionId':_0x3fc7f9['id']},{})[_0x13b8('0x27')](function(){return _0x392e58;});}else{return _0x392e58;}})[_0x13b8('0x4f')](function(_0x425632){logger[_0x13b8('0x5a')](_0x13b8('0x5b'),_0x425632);throw _0x425632;});}return _0x392e58;})[_0x13b8('0x27')](respondWithResult(_0x443e18,0xc9))['catch'](handleError(_0x443e18,null));};exports[_0x13b8('0x25')]=function(_0xcee440,_0x3d4697){if(_0xcee440[_0x13b8('0x53')]['id']){delete _0xcee440[_0x13b8('0x53')]['id'];}return db[_0x13b8('0x39')][_0x13b8('0x33')]({'where':{'id':_0xcee440[_0x13b8('0x51')]['id']}})[_0x13b8('0x27')](handleEntityNotFound(_0x3d4697,null))[_0x13b8('0x27')](function(_0xcae9a8){if(_0xcae9a8){return db['VoiceExtension']['update'](_[_0x13b8('0x48')](_0xcee440[_0x13b8('0x53')],['exten',_0x13b8('0x5c'),'description',_0x13b8('0x5d'),_0x13b8('0x5e'),_0x13b8('0x5f'),_0x13b8('0x60')]),{'where':{'context':_0xcae9a8[_0x13b8('0x5c')],'exten':_0xcae9a8['exten']},'individualHooks':!![]})[_0x13b8('0x27')](function(_0x284831){return _0x284831;});}return null;})['then'](respondWithStatusCode(_0x3d4697,null))[_0x13b8('0x4f')](handleError(_0x3d4697,null));};exports[_0x13b8('0x61')]=function(_0x456f5d,_0x4b1c76){return db[_0x13b8('0x39')][_0x13b8('0x62')]({'where':{'id':_0x456f5d['params']['id']}})[_0x13b8('0x27')](function(_0x7cb6ab){if(_0x7cb6ab){return db[_0x13b8('0x63')]['transaction'](function(_0x170a3d){return db[_0x13b8('0x39')][_0x13b8('0x26')]({'where':{'VoiceExtensionId':_0x456f5d[_0x13b8('0x51')]['id']},'transaction':_0x170a3d})['then'](function(){var _0x215b26=_['map'](_0x456f5d[_0x13b8('0x53')],function(_0xc1fb70){_0xc1fb70['VoiceExtensionId']=_0x456f5d[_0x13b8('0x51')]['id'];_0xc1fb70[_0x13b8('0x64')]=!![];return _0xc1fb70;});var _0x2ce79e=_0x456f5d[_0x13b8('0x3d')][_0x13b8('0x65')]&&_0x456f5d[_0x13b8('0x3d')][_0x13b8('0x65')]['toLowerCase']()==='true'?!![]:![];return _0x7cb6ab[_0x13b8('0x66')](_0x215b26,_0x2ce79e);})[_0x13b8('0x27')](function(_0x5b390b){return db[_0x13b8('0x39')][_0x13b8('0x67')](_0x5b390b,{'transaction':_0x170a3d});});})[_0x13b8('0x27')](function(){return db[_0x13b8('0x39')][_0x13b8('0x68')]({'where':{'isApp':!![],'VoiceExtensionId':_0x456f5d['params']['id']},'order':_0x13b8('0x69')});});}})[_0x13b8('0x27')](respondWithResult(_0x4b1c76,null))[_0x13b8('0x4f')](handleError(_0x4b1c76,null));}; \ No newline at end of file +var _0xc0c2=['ignore','value','includes','type','find','name','UserProfileResource','error','stack','send','index','map','VoiceExtension','fieldName','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','cutdigits','alias','context','addApplications','findOne','sequelize','transaction','rewriteDial','toLowerCase','true','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','set','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter'];(function(_0x40bde9,_0x50f93d){var _0x3195b0=function(_0x146205){while(--_0x146205){_0x40bde9['push'](_0x40bde9['shift']());}};_0x3195b0(++_0x50f93d);}(_0xc0c2,0x195));var _0x2c0c=function(_0x40b723,_0x118b22){_0x40b723=_0x40b723-0x0;var _0x1981ad=_0xc0c2[_0x40b723];return _0x1981ad;};'use strict';var emlformat=require(_0x2c0c('0x0'));var rimraf=require(_0x2c0c('0x1'));var zipdir=require(_0x2c0c('0x2'));var jsonpatch=require(_0x2c0c('0x3'));var rp=require(_0x2c0c('0x4'));var moment=require('moment');var BPromise=require(_0x2c0c('0x5'));var Mustache=require(_0x2c0c('0x6'));var util=require('util');var path=require(_0x2c0c('0x7'));var sox=require('sox');var csv=require(_0x2c0c('0x8'));var ejs=require(_0x2c0c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2c0c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2c0c('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2c0c('0xc'));var Papa=require(_0x2c0c('0xd'));var Redis=require(_0x2c0c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2c0c('0xf'));var as=require(_0x2c0c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c0c('0x11'))(_0x2c0c('0x12'));var utils=require('../../config/utils');var config=require(_0x2c0c('0x13'));var licenseUtil=require(_0x2c0c('0x14'));var db=require(_0x2c0c('0x15'))['db'];config['redis']=_[_0x2c0c('0x16')](config[_0x2c0c('0x17')],{'host':_0x2c0c('0x18'),'port':0x18eb});var socket=require(_0x2c0c('0x19'))(new Redis(config[_0x2c0c('0x17')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x4c87e1,_0xa84d82){_0xa84d82=_0xa84d82||0xcc;return function(_0x5c56f7){if(_0x5c56f7){return _0x4c87e1[_0x2c0c('0x1a')](_0xa84d82);}return _0x4c87e1['status'](_0xa84d82)[_0x2c0c('0x1b')]();};}function respondWithResult(_0x835566,_0x54e436){_0x54e436=_0x54e436||0xc8;return function(_0x5237e9){if(_0x5237e9){return _0x835566[_0x2c0c('0x1c')](_0x54e436)[_0x2c0c('0x1d')](_0x5237e9);}};}function respondWithFilteredResult(_0x3b9eb5,_0x4035c8){return function(_0xbe3188){if(_0xbe3188){var _0x165060=typeof _0x4035c8[_0x2c0c('0x1e')]===_0x2c0c('0x1f')&&typeof _0x4035c8[_0x2c0c('0x20')]==='undefined';var _0x433fe8=_0xbe3188[_0x2c0c('0x21')];var _0x1c037f=_0x165060?0x0:_0x4035c8[_0x2c0c('0x1e')];var _0x5a83fe=_0x165060?_0xbe3188[_0x2c0c('0x21')]:_0x4035c8[_0x2c0c('0x1e')]+_0x4035c8['limit'];var _0xc81656;if(_0x5a83fe>=_0x433fe8){_0x5a83fe=_0x433fe8;_0xc81656=0xc8;}else{_0xc81656=0xce;}_0x3b9eb5['status'](_0xc81656);return _0x3b9eb5[_0x2c0c('0x22')]('Content-Range',_0x1c037f+'-'+_0x5a83fe+'/'+_0x433fe8)[_0x2c0c('0x1d')](_0xbe3188);}return null;};}function patchUpdates(_0x193f10){return function(_0x4610df){try{jsonpatch['apply'](_0x4610df,_0x193f10,!![]);}catch(_0x171292){return BPromise['reject'](_0x171292);}return _0x4610df[_0x2c0c('0x23')]();};}function saveUpdates(_0x41ccee,_0x1c7290){return function(_0x534697){if(_0x534697){return _0x534697[_0x2c0c('0x24')](_0x41ccee)[_0x2c0c('0x25')](function(_0x178cf4){return _0x178cf4;});}return null;};}function removeEntity(_0x49805c,_0x3eba15){return function(_0x17e109){if(_0x17e109){return _0x17e109[_0x2c0c('0x26')]()[_0x2c0c('0x25')](function(){var _0x41f726=_0x17e109[_0x2c0c('0x27')]({'plain':!![]});var _0x49d6fe=[{'name':_0x2c0c('0x28'),'value':_0x2c0c('0x29'),'ignore':![]},{'name':_0x2c0c('0x2a'),'value':_0x2c0c('0x2b'),'ignore':![]},{'name':_0x2c0c('0x2c'),'value':_0x2c0c('0x2d'),'ignore':![]}];var _0x4ceb7c=_(_0x49d6fe)[_0x2c0c('0x2e')](_0x2c0c('0x2f'))['map'](_0x2c0c('0x30'))['value']();if(_[_0x2c0c('0x31')](_0x4ceb7c,_0x41f726[_0x2c0c('0x32')])){return;}var _0x32eaa4=_[_0x2c0c('0x33')](_0x49d6fe,[_0x2c0c('0x30'),_0x41f726[_0x2c0c('0x32')]])[_0x2c0c('0x34')];return db[_0x2c0c('0x35')]['destroy']({'where':{'type':_0x32eaa4,'resourceId':_0x41f726['id']}})[_0x2c0c('0x25')](function(){return _0x17e109;});})[_0x2c0c('0x25')](function(){_0x49805c[_0x2c0c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x252ad6,_0x3a4959){return function(_0x116d45){if(!_0x116d45){_0x252ad6[_0x2c0c('0x1a')](0x194);}return _0x116d45;};}function handleError(_0x2d44aa,_0x1c1aee){_0x1c1aee=_0x1c1aee||0x1f4;return function(_0x248af4){logger[_0x2c0c('0x36')](_0x248af4[_0x2c0c('0x37')]);if(_0x248af4[_0x2c0c('0x34')]){delete _0x248af4[_0x2c0c('0x34')];}_0x2d44aa[_0x2c0c('0x1c')](_0x1c1aee)[_0x2c0c('0x38')](_0x248af4);};}exports[_0x2c0c('0x39')]=function(_0x2794ff,_0x341da3){var _0x4b69b9={},_0x3f2584={},_0x5b04d7={'count':0x0,'rows':[]};var _0x17b214=_[_0x2c0c('0x3a')](db[_0x2c0c('0x3b')]['rawAttributes'],function(_0x4133e1){return{'name':_0x4133e1[_0x2c0c('0x3c')],'type':_0x4133e1[_0x2c0c('0x32')]['key']};});_0x3f2584['model']=_['map'](_0x17b214,'name');_0x3f2584[_0x2c0c('0x3d')]=_['keys'](_0x2794ff['query']);_0x3f2584[_0x2c0c('0x3e')]=_[_0x2c0c('0x3f')](_0x3f2584['model'],_0x3f2584['query']);_0x4b69b9['attributes']=_[_0x2c0c('0x3f')](_0x3f2584[_0x2c0c('0x40')],qs[_0x2c0c('0x41')](_0x2794ff[_0x2c0c('0x3d')][_0x2c0c('0x41')]));_0x4b69b9['attributes']=_0x4b69b9[_0x2c0c('0x42')][_0x2c0c('0x43')]?_0x4b69b9[_0x2c0c('0x42')]:_0x3f2584['model'];if(!_0x2794ff[_0x2c0c('0x3d')][_0x2c0c('0x44')](_0x2c0c('0x45'))){_0x4b69b9['limit']=qs[_0x2c0c('0x20')](_0x2794ff[_0x2c0c('0x3d')][_0x2c0c('0x20')]);_0x4b69b9[_0x2c0c('0x1e')]=qs['offset'](_0x2794ff[_0x2c0c('0x3d')]['offset']);}_0x4b69b9[_0x2c0c('0x46')]=qs[_0x2c0c('0x47')](_0x2794ff['query'][_0x2c0c('0x47')]);_0x4b69b9[_0x2c0c('0x48')]=qs[_0x2c0c('0x3e')](_[_0x2c0c('0x49')](_0x2794ff[_0x2c0c('0x3d')],_0x3f2584[_0x2c0c('0x3e')]),_0x17b214);if(_0x2794ff['query'][_0x2c0c('0x2e')]){_0x4b69b9[_0x2c0c('0x48')]=_[_0x2c0c('0x4a')](_0x4b69b9[_0x2c0c('0x48')],{'$or':_[_0x2c0c('0x3a')](_0x17b214,function(_0x2e5e60){if(_0x2e5e60[_0x2c0c('0x32')]!==_0x2c0c('0x4b')){var _0x58a797={};_0x58a797[_0x2e5e60[_0x2c0c('0x34')]]={'$like':'%'+_0x2794ff[_0x2c0c('0x3d')][_0x2c0c('0x2e')]+'%'};return _0x58a797;}})});}_0x4b69b9=_[_0x2c0c('0x4a')]({},_0x4b69b9,_0x2794ff[_0x2c0c('0x4c')]);var _0x44411c={'where':_0x4b69b9[_0x2c0c('0x48')]};return db['VoiceExtension'][_0x2c0c('0x21')](_0x44411c)[_0x2c0c('0x25')](function(_0x10931f){_0x5b04d7[_0x2c0c('0x21')]=_0x10931f;if(_0x2794ff[_0x2c0c('0x3d')][_0x2c0c('0x4d')]){_0x4b69b9['include']=[{'all':!![]}];}return db[_0x2c0c('0x3b')][_0x2c0c('0x4e')](_0x4b69b9);})['then'](function(_0x1e2503){_0x5b04d7[_0x2c0c('0x4f')]=_0x1e2503;return _0x5b04d7;})[_0x2c0c('0x25')](respondWithFilteredResult(_0x341da3,_0x4b69b9))[_0x2c0c('0x50')](handleError(_0x341da3,null));};exports[_0x2c0c('0x51')]=function(_0x10d2b1,_0x48de09){var _0x435c8e={'raw':![],'where':{'id':_0x10d2b1[_0x2c0c('0x52')]['id']}},_0x24ec56={};_0x24ec56[_0x2c0c('0x40')]=_['keys'](db[_0x2c0c('0x3b')]['rawAttributes']);_0x24ec56[_0x2c0c('0x3d')]=_[_0x2c0c('0x53')](_0x10d2b1[_0x2c0c('0x3d')]);_0x24ec56['filters']=_['intersection'](_0x24ec56[_0x2c0c('0x40')],_0x24ec56[_0x2c0c('0x3d')]);_0x435c8e[_0x2c0c('0x42')]=_['intersection'](_0x24ec56['model'],qs['fields'](_0x10d2b1[_0x2c0c('0x3d')]['fields']));_0x435c8e['attributes']=_0x435c8e[_0x2c0c('0x42')]['length']?_0x435c8e[_0x2c0c('0x42')]:_0x24ec56[_0x2c0c('0x40')];if(_0x10d2b1[_0x2c0c('0x3d')][_0x2c0c('0x4d')]){_0x435c8e[_0x2c0c('0x54')]=[{'all':!![]}];}_0x435c8e=_[_0x2c0c('0x4a')]({},_0x435c8e,_0x10d2b1[_0x2c0c('0x4c')]);return db[_0x2c0c('0x3b')]['find'](_0x435c8e)[_0x2c0c('0x25')](handleEntityNotFound(_0x48de09,null))[_0x2c0c('0x25')](respondWithResult(_0x48de09,null))[_0x2c0c('0x50')](handleError(_0x48de09,null));};exports['destroy']=function(_0x352733,_0x2e0ff8){return db[_0x2c0c('0x3b')][_0x2c0c('0x33')]({'where':{'id':_0x352733[_0x2c0c('0x52')]['id']}})[_0x2c0c('0x25')](handleEntityNotFound(_0x2e0ff8,null))[_0x2c0c('0x25')](removeEntity(_0x2e0ff8,null))[_0x2c0c('0x50')](handleError(_0x2e0ff8,null));};exports[_0x2c0c('0x55')]=function(_0x249806,_0x5eae5a){if(_0x249806[_0x2c0c('0x56')]['type']==='outbound'&&!_[_0x2c0c('0x57')](_0x249806['body'][_0x2c0c('0x58')],'_')){_0x249806[_0x2c0c('0x56')]['exten']='_'[_0x2c0c('0x59')](_0x249806[_0x2c0c('0x56')]['exten']);}return db[_0x2c0c('0x3b')][_0x2c0c('0x55')](_0x249806[_0x2c0c('0x56')],{'raw':![]})[_0x2c0c('0x25')](function(_0x3fdfa2){var _0x2594bd=_0x249806[_0x2c0c('0x5a')][_0x2c0c('0x27')]({'plain':!![]});if(!_0x2594bd)throw new Error(_0x2c0c('0x5b'));if(_0x2594bd[_0x2c0c('0x5c')]===_0x2c0c('0x5a')){var _0x3bce9a=_0x3fdfa2['get']({'plain':!![]});var _0x4556c7=[{'name':'InboundRoutes','value':_0x2c0c('0x29')},{'name':_0x2c0c('0x2a'),'value':_0x2c0c('0x2b')},{'name':_0x2c0c('0x2c'),'value':_0x2c0c('0x2d')}];var _0x176a72=_[_0x2c0c('0x33')](_0x4556c7,[_0x2c0c('0x30'),_0x3bce9a['type']])['name'];return db[_0x2c0c('0x5d')][_0x2c0c('0x33')]({'where':{'name':_0x176a72,'userProfileId':_0x2594bd[_0x2c0c('0x5e')]},'raw':!![]})[_0x2c0c('0x25')](function(_0xa14a57){if(_0xa14a57&&_0xa14a57[_0x2c0c('0x5f')]===0x0){return db[_0x2c0c('0x35')]['create']({'name':_0x3bce9a[_0x2c0c('0x34')],'resourceId':_0x3bce9a['id'],'type':_0xa14a57['name'],'sectionId':_0xa14a57['id']},{})[_0x2c0c('0x25')](function(){return _0x3fdfa2;});}else{return _0x3fdfa2;}})['catch'](function(_0x437917){logger[_0x2c0c('0x36')](_0x2c0c('0x60'),_0x437917);throw _0x437917;});}return _0x3fdfa2;})['then'](respondWithResult(_0x5eae5a,0xc9))['catch'](handleError(_0x5eae5a,null));};exports[_0x2c0c('0x24')]=function(_0x2a8262,_0x1ab913){if(_0x2a8262[_0x2c0c('0x56')]['id']){delete _0x2a8262[_0x2c0c('0x56')]['id'];}return db[_0x2c0c('0x3b')][_0x2c0c('0x33')]({'where':{'id':_0x2a8262[_0x2c0c('0x52')]['id']}})['then'](handleEntityNotFound(_0x1ab913,null))[_0x2c0c('0x25')](function(_0x477b3f){if(_0x477b3f){return db[_0x2c0c('0x3b')][_0x2c0c('0x24')](_[_0x2c0c('0x49')](_0x2a8262[_0x2c0c('0x56')],[_0x2c0c('0x58'),'context',_0x2c0c('0x61'),_0x2c0c('0x62'),_0x2c0c('0x63'),'mandatoryDisposition',_0x2c0c('0x64')]),{'where':{'context':_0x477b3f[_0x2c0c('0x65')],'exten':_0x477b3f[_0x2c0c('0x58')]},'individualHooks':!![]})[_0x2c0c('0x25')](function(_0x481612){return _0x481612;});}return null;})[_0x2c0c('0x25')](respondWithStatusCode(_0x1ab913,null))[_0x2c0c('0x50')](handleError(_0x1ab913,null));};exports[_0x2c0c('0x66')]=function(_0x2362ad,_0x4acc79){return db[_0x2c0c('0x3b')][_0x2c0c('0x67')]({'where':{'id':_0x2362ad['params']['id']}})[_0x2c0c('0x25')](function(_0x8bfcc2){if(_0x8bfcc2){return db[_0x2c0c('0x68')][_0x2c0c('0x69')](function(_0x108f9a){return db[_0x2c0c('0x3b')][_0x2c0c('0x26')]({'where':{'VoiceExtensionId':_0x2362ad[_0x2c0c('0x52')]['id']},'transaction':_0x108f9a})[_0x2c0c('0x25')](function(){var _0x2aaad0=_[_0x2c0c('0x3a')](_0x2362ad['body'],function(_0x4e56bf){_0x4e56bf['VoiceExtensionId']=_0x2362ad['params']['id'];_0x4e56bf['isApp']=!![];return _0x4e56bf;});var _0x3d5b1d=_0x2362ad[_0x2c0c('0x3d')][_0x2c0c('0x6a')]&&_0x2362ad[_0x2c0c('0x3d')][_0x2c0c('0x6a')][_0x2c0c('0x6b')]()===_0x2c0c('0x6c')?!![]:![];return _0x8bfcc2[_0x2c0c('0x6d')](_0x2aaad0,_0x3d5b1d);})[_0x2c0c('0x25')](function(_0x58b24a){return db['VoiceExtension'][_0x2c0c('0x6e')](_0x58b24a,{'transaction':_0x108f9a});});})['then'](function(){return db['VoiceExtension'][_0x2c0c('0x6f')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2362ad[_0x2c0c('0x52')]['id']},'order':_0x2c0c('0x70')});});}})[_0x2c0c('0x25')](respondWithResult(_0x4acc79,null))[_0x2c0c('0x50')](handleError(_0x4acc79,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index c53437a..e68f392 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 _0xc25b=['setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x4d3948,_0x5e8f91){var _0x3c20e5=function(_0x4f03e6){while(--_0x4f03e6){_0x4d3948['push'](_0x4d3948['shift']());}};_0x3c20e5(++_0x5e8f91);}(_0xc25b,0x66));var _0xbc25=function(_0x2fe2e0,_0x11ec8f){_0x2fe2e0=_0x2fe2e0-0x0;var _0x123911=_0xc25b[_0x2fe2e0];return _0x123911;};'use strict';var EventEmitter=require(_0xbc25('0x0'));var VoiceExtension=require(_0xbc25('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xbc25('0x2')](0x0);var events={'afterCreate':_0xbc25('0x3'),'afterUpdate':'update','afterDestroy':_0xbc25('0x4')};function emitEvent(_0x1b04bc){return function(_0x5e1a39,_0x32a16b,_0x2f99e1){VoiceExtensionEvents[_0xbc25('0x5')](_0x1b04bc+':'+_0x5e1a39['id'],_0x5e1a39);VoiceExtensionEvents[_0xbc25('0x5')](_0x1b04bc,_0x5e1a39);_0x2f99e1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xbc25('0x6')](e,emitEvent(event));}}module[_0xbc25('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xd820=['update','remove','hasOwnProperty','hook','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x235acb,_0x151fb6){var _0x24d52a=function(_0xe41e7f){while(--_0xe41e7f){_0x235acb['push'](_0x235acb['shift']());}};_0x24d52a(++_0x151fb6);}(_0xd820,0x1c4));var _0x0d82=function(_0xb2d973,_0x469f4f){_0xb2d973=_0xb2d973-0x0;var _0xd1a153=_0xd820[_0xb2d973];return _0xd1a153;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x0d82('0x0'))['db'][_0x0d82('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0d82('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d82('0x3'),'afterDestroy':_0x0d82('0x4')};function emitEvent(_0x481368){return function(_0x4e2573,_0xd714be,_0x8babe0){VoiceExtensionEvents['emit'](_0x481368+':'+_0x4e2573['id'],_0x4e2573);VoiceExtensionEvents['emit'](_0x481368,_0x4e2573);_0x8babe0(null);};}for(var e in events){if(events[_0x0d82('0x5')](e)){var event=events[e];VoiceExtension[_0x0d82('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index bae76ff..62e5ad3 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 _0x9b1b=['outboundDial','appdata','priority','concat','last','define','VoiceExtension','voice_extensions','then','Hangup','util','./voiceExtension.attributes','exports','type','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','Set','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','split','length','name','trunk','param','phone','prefix','SIP','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','interval','IntervalId','*,*,*,*','intervals','filter','toLowerCase','tag','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},'];(function(_0x446880,_0x5b9dbc){var _0x2a8581=function(_0x45fa33){while(--_0x45fa33){_0x446880['push'](_0x446880['shift']());}};_0x2a8581(++_0x5b9dbc);}(_0x9b1b,0x1a9));var _0xb9b1=function(_0x226e60,_0x46d51e){_0x226e60=_0x226e60-0x0;var _0x581e70=_0x9b1b[_0x226e60];return _0x581e70;};'use strict';var util=require(_0xb9b1('0x0'));var _=require('lodash');var attributes=require(_0xb9b1('0x1'));module[_0xb9b1('0x2')]=function(_0x2aa68b){var _0x5848e3=_0x2aa68b['models'];function _0x56fb62(_0x51361c){var _0x433461=0x2;var _0x2f3c54=[{'type':_0x51361c[_0xb9b1('0x3')],'app':'Set','appdata':_0xb9b1('0x4')+_0x51361c[_0xb9b1('0x3')],'context':_0x51361c[_0xb9b1('0x5')],'exten':_0x51361c[_0xb9b1('0x6')],'priority':_0x433461++,'VoiceExtensionId':_0x51361c['id']},{'type':_0x51361c[_0xb9b1('0x3')],'app':_0x51361c['alias']?'Set':_0xb9b1('0x7'),'appdata':_0x51361c[_0xb9b1('0x8')]?_0xb9b1('0x9')+_0x51361c[_0xb9b1('0x8')]:_0xb9b1('0xa'),'context':_0x51361c['context'],'exten':_0x51361c['exten'],'priority':_0x433461++,'VoiceExtensionId':_0x51361c['id']}];if(_0x51361c[_0xb9b1('0x3')]===_0xb9b1('0xb')){_0x2f3c54['push']({'type':_0xb9b1('0xb'),'app':'Set','appdata':'CDR(routeid)='+_0x51361c['id'],'context':_0x51361c['context'],'exten':_0x51361c['exten'],'priority':_0x433461++,'VoiceExtensionId':_0x51361c['id']});}_0x2f3c54[_0xb9b1('0xc')]({'type':_0x51361c[_0xb9b1('0x3')],'app':_0xb9b1('0xd'),'appdata':_0xb9b1('0xe'),'context':_0x51361c[_0xb9b1('0x5')],'exten':_0x51361c[_0xb9b1('0x6')],'priority':_0x433461++,'VoiceExtensionId':_0x51361c['id']},{'type':_0x51361c[_0xb9b1('0x3')],'app':_0xb9b1('0xd'),'appdata':_0xb9b1('0xf'),'context':_0x51361c[_0xb9b1('0x5')],'exten':_0x51361c[_0xb9b1('0x6')],'priority':_0x433461++,'VoiceExtensionId':_0x51361c['id']},{'type':_0x51361c[_0xb9b1('0x3')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x51361c['context'],'exten':_0x51361c['exten'],'priority':_0x433461++,'VoiceExtensionId':_0x51361c['id']});return _0x2f3c54;}function _0x541c31(_0x14c4f5){var _0x4620c0=0x2;var _0x47f7e5=[{'type':_0xb9b1('0x10'),'app':_0xb9b1('0xd'),'appdata':'CDR(type)=outbound','context':_0x14c4f5[_0xb9b1('0x5')],'exten':_0x14c4f5['exten'],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']},{'type':_0xb9b1('0x10'),'app':_0x14c4f5[_0xb9b1('0x8')]?'Set':_0xb9b1('0x7'),'appdata':_0x14c4f5[_0xb9b1('0x8')]?_0xb9b1('0x9')+_0x14c4f5[_0xb9b1('0x8')]:_0xb9b1('0xa'),'context':_0x14c4f5[_0xb9b1('0x5')],'exten':_0x14c4f5['exten'],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']},{'type':_0xb9b1('0x10'),'app':_0xb9b1('0xd'),'appdata':_0xb9b1('0x11')+(_0x14c4f5['cutdigits']?_0xb9b1('0x12')+_0x14c4f5[_0xb9b1('0x13')]+'}':_0xb9b1('0x14')),'context':_0x14c4f5['context'],'exten':_0x14c4f5[_0xb9b1('0x6')],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']},{'type':'outbound','app':_0xb9b1('0xd'),'appdata':'CDR(routeid)='+_0x14c4f5['id'],'context':_0x14c4f5[_0xb9b1('0x5')],'exten':_0x14c4f5[_0xb9b1('0x6')],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']},{'type':_0xb9b1('0x10'),'app':'ExecIf','appdata':_0xb9b1('0x15')+(_0x4620c0+0x2)+_0xb9b1('0x16')+(_0x4620c0+0x1)+')','context':_0x14c4f5['context'],'exten':_0x14c4f5[_0xb9b1('0x6')],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']},{'type':'outbound','app':_0xb9b1('0xd'),'appdata':_0x14c4f5[_0xb9b1('0x13')]?_0xb9b1('0x17')+_0x14c4f5[_0xb9b1('0x13')]+'}':_0xb9b1('0x18'),'context':_0x14c4f5[_0xb9b1('0x5')],'exten':_0x14c4f5['exten'],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']},{'type':'outbound','app':_0xb9b1('0xd'),'appdata':_0xb9b1('0xe'),'context':_0x14c4f5[_0xb9b1('0x5')],'exten':_0x14c4f5[_0xb9b1('0x6')],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']},{'type':'outbound','app':_0xb9b1('0xd'),'appdata':_0xb9b1('0xf'),'context':_0x14c4f5[_0xb9b1('0x5')],'exten':_0x14c4f5[_0xb9b1('0x6')],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']},{'type':_0xb9b1('0x10'),'app':_0xb9b1('0xd'),'appdata':_0xb9b1('0x19'),'context':_0x14c4f5['context'],'exten':_0x14c4f5[_0xb9b1('0x6')],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']},{'type':_0xb9b1('0x10'),'app':'Set','appdata':_0xb9b1('0x1a')+_0x14c4f5['id'],'context':_0x14c4f5[_0xb9b1('0x5')],'exten':_0x14c4f5[_0xb9b1('0x6')],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']}];if(_0x14c4f5[_0xb9b1('0x1b')](_0xb9b1('0x1c'))&&_0x14c4f5[_0xb9b1('0x1c')]!==_0xb9b1('0x1d')){_0x47f7e5[_0xb9b1('0xc')]({'type':'outbound','app':_0xb9b1('0xd'),'appdata':_0xb9b1('0x1e'),'context':_0x14c4f5['context'],'exten':_0x14c4f5[_0xb9b1('0x6')],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']},{'type':_0xb9b1('0x10'),'app':_0xb9b1('0xd'),'appdata':_0xb9b1('0x1f')+_0x14c4f5['recordingFormat']||_0xb9b1('0x20'),'context':_0x14c4f5[_0xb9b1('0x5')],'exten':_0x14c4f5[_0xb9b1('0x6')],'priority':_0x4620c0++,'VoiceExtensionId':_0x14c4f5['id']});}return _0x47f7e5;}function _0x20e888(_0x5dac67){var _0x57b61b=[{'name':'trunk','param':0x0},{'name':_0xb9b1('0x21'),'param':0x1},{'name':_0xb9b1('0x22'),'param':0x2},{'name':'url','param':0x3}];var _0x4e2aa4={};var _0x4c3d8b=_0x5dac67[_0xb9b1('0x23')](',');var _0x1d7481=[];for(var _0x16a28f=0x0;_0x16a28f<_0x57b61b[_0xb9b1('0x24')];_0x16a28f++){switch(_0x57b61b[_0x16a28f][_0xb9b1('0x25')]){case _0xb9b1('0x26'):_0x4e2aa4[_0xb9b1('0x26')]=_0x4c3d8b[_0x57b61b[_0x16a28f][_0xb9b1('0x27')]][_0xb9b1('0x23')]('/')[0x1];_0x4e2aa4[_0xb9b1('0x28')]=_0x4c3d8b[_0x57b61b[_0x16a28f][_0xb9b1('0x27')]]['split']('/')[0x2];_0x4e2aa4[_0xb9b1('0x29')]=_0x4e2aa4[_0xb9b1('0x28')]?_0x4e2aa4[_0xb9b1('0x28')]['split']('$')[0x0]:undefined;_0x4e2aa4[_0xb9b1('0x28')]=route[_0xb9b1('0x13')]?(_0x4e2aa4[_0xb9b1('0x29')]||'')+'${EXTEN:'+route[_0xb9b1('0x13')]+'}':(_0x4e2aa4[_0xb9b1('0x29')]||'')+_0xb9b1('0x14');_0x1d7481[_0x57b61b[_0x16a28f][_0xb9b1('0x27')]]=[_0xb9b1('0x2a'),_0x4e2aa4[_0xb9b1('0x26')],_0x4e2aa4['phone']]['join']('/');break;case _0xb9b1('0x22'):_0x4e2aa4[_0xb9b1('0x22')]=_0x4c3d8b[_0x57b61b[_0x16a28f]['param']];if(route[_0xb9b1('0x1c')]!==_0xb9b1('0x1d')){if(_0x4e2aa4[_0xb9b1('0x22')]['indexOf'](_0xb9b1('0x2b'))<0x0){_0x4e2aa4['options']+=_0xb9b1('0x2b');}}else{_0x4e2aa4[_0xb9b1('0x22')]=_0x4e2aa4[_0xb9b1('0x22')][_0xb9b1('0x2c')](_0xb9b1('0x2b'),'');}_0x1d7481[_0x57b61b[_0x16a28f]['param']]=_0x4e2aa4['options'];break;default:_0x1d7481[_0x57b61b[_0x16a28f][_0xb9b1('0x27')]]=_0x4c3d8b[_0x57b61b[_0x16a28f]['param']];}}return _0x1d7481[_0xb9b1('0x2d')](',');}function _0x459915(_0x5c3ade,_0x3d1979,_0x2cb02d,_0x248b13){return new Promise(function(_0x5d3a7c,_0x2a3c0f){var _0x46d264=[];if(_[_0xb9b1('0x2e')](_0x3d1979))return _0x5d3a7c(_0x46d264);_0x5848e3[_0xb9b1('0x2f')]['findAll']({'attributes':['id',_0xb9b1('0x30'),_0xb9b1('0x31')],'raw':!![]})['then'](function(_0x34dbe1){for(var _0x4e5e7a=0x0,_0xdb728=0x0;_0x4e5e7a<_0x3d1979[_0xb9b1('0x24')];_0x4e5e7a++,_0xdb728=0x0){var _0xe2cfd6=_0x3d1979[_0x4e5e7a];var _0x5e8c6a=[];var _0xb56485=[];if(_0xe2cfd6['interval']!==_0xb9b1('0x32')){_0xe2cfd6[_0xb9b1('0x33')]=[_0xe2cfd6[_0xb9b1('0x30')]];}else{_0xe2cfd6[_0xb9b1('0x33')]=_0xe2cfd6[_0xb9b1('0x31')]?_['map'](_[_0xb9b1('0x34')](_0x34dbe1,{'IntervalId':_0xe2cfd6['IntervalId']}),_0xb9b1('0x30')):[];}_0xe2cfd6[_0xb9b1('0x5')]=_0x5c3ade[_0xb9b1('0x5')];_0xe2cfd6[_0xb9b1('0x6')]=_0x5c3ade[_0xb9b1('0x6')];if(_0xe2cfd6[_0xb9b1('0x3')])_0xe2cfd6['type']=_0xe2cfd6[_0xb9b1('0x3')][_0xb9b1('0x35')]();if(_0x5c3ade[_0xb9b1('0x3')]===_0xb9b1('0x10')){if(_0xe2cfd6[_0xb9b1('0x1b')](_0xb9b1('0x36'))&&_0xe2cfd6[_0xb9b1('0x36')]&&_0xe2cfd6[_0xb9b1('0x36')]!=='--'){_0x5e8c6a[_0xb9b1('0xc')]({'type':_0xe2cfd6[_0xb9b1('0x3')][_0xb9b1('0x35')](),'app':_0xb9b1('0xd'),'appdata':'CDR(tag)='+_0xe2cfd6['tag'],'context':_0x5c3ade[_0xb9b1('0x5')],'exten':_0x5c3ade['exten'],'priority':_0xe2cfd6[_0xb9b1('0x33')][_0xb9b1('0x24')]+_0x2cb02d+_0xdb728++,'VoiceExtensionId':_0x5c3ade['id']});}_0x5e8c6a[_0xb9b1('0xc')]({'type':_0xe2cfd6['type'][_0xb9b1('0x35')](),'app':_0xb9b1('0x37'),'appdata':_0xb9b1('0x38')+(_0xe2cfd6[_0xb9b1('0x39')]?_0xb9b1('0x3a')+_0xe2cfd6['callerID']+')':_0xb9b1('0x3b')),'context':_0x5c3ade[_0xb9b1('0x5')],'exten':_0x5c3ade[_0xb9b1('0x6')],'priority':_0xe2cfd6['intervals']['length']+_0x2cb02d+_0xdb728++,'VoiceExtensionId':_0x5c3ade['id']});}else{if(_0xe2cfd6[_0xb9b1('0x1b')](_0xb9b1('0x3c'))){if([_0xb9b1('0x3d'),'playback'][_0xb9b1('0x3e')](_0xe2cfd6[_0xb9b1('0x3f')][_0xb9b1('0x35')]())&&_0xe2cfd6[_0xb9b1('0x40')]!==_0xb9b1('0x41')){if(_0xe2cfd6[_0xb9b1('0x3c')]){_0x5e8c6a[_0xb9b1('0xc')]({'type':_0xe2cfd6['type'][_0xb9b1('0x35')](),'app':'ExecIf','appdata':_0xb9b1('0x42'),'context':_0x5c3ade['context'],'exten':_0x5c3ade[_0xb9b1('0x6')],'priority':_0xe2cfd6[_0xb9b1('0x33')][_0xb9b1('0x24')]+_0x2cb02d+_0xdb728++,'VoiceExtensionId':_0x5c3ade['id']});_0x5e8c6a[_0xb9b1('0xc')]({'type':_0xe2cfd6[_0xb9b1('0x3')]['toLowerCase'](),'app':'Set','appdata':_0xb9b1('0x43'),'context':_0x5c3ade[_0xb9b1('0x5')],'exten':_0x5c3ade[_0xb9b1('0x6')],'priority':_0xe2cfd6['intervals'][_0xb9b1('0x24')]+_0x2cb02d+_0xdb728++,'VoiceExtensionId':_0x5c3ade['id']});}else{_0x5e8c6a[_0xb9b1('0xc')]({'type':_0xe2cfd6['type']['toLowerCase'](),'app':'ExecIf','appdata':_0xb9b1('0x44'),'context':_0x5c3ade[_0xb9b1('0x5')],'exten':_0x5c3ade[_0xb9b1('0x6')],'priority':_0xe2cfd6['intervals'][_0xb9b1('0x24')]+_0x2cb02d+_0xdb728++,'VoiceExtensionId':_0x5c3ade['id']});_0x5e8c6a[_0xb9b1('0xc')]({'type':_0xe2cfd6[_0xb9b1('0x3')][_0xb9b1('0x35')](),'app':_0xb9b1('0xd'),'appdata':_0xb9b1('0x45'),'context':_0x5c3ade[_0xb9b1('0x5')],'exten':_0x5c3ade[_0xb9b1('0x6')],'priority':_0xe2cfd6[_0xb9b1('0x33')][_0xb9b1('0x24')]+_0x2cb02d+_0xdb728++,'VoiceExtensionId':_0x5c3ade['id']});}}}}for(var _0x1dedc1=0x0;_0x1dedc1<_0xe2cfd6[_0xb9b1('0x33')][_0xb9b1('0x24')];_0x1dedc1++){var _0x128894=_0x2cb02d+_0xe2cfd6[_0xb9b1('0x33')][_0xb9b1('0x24')];var _0x354b72=_0x1dedc1===_0xe2cfd6[_0xb9b1('0x33')]['length']-0x1?_0x2cb02d+_0x5e8c6a[_0xb9b1('0x24')]+_0xb56485[_0xb9b1('0x24')]+0x2:_0x2cb02d+_0x1dedc1+0x1;_0x5e8c6a[_0xb9b1('0x46')](_0x1dedc1,0x0,{'type':_0x5c3ade[_0xb9b1('0x3')],'app':_0xb9b1('0x47'),'appdata':_0xe2cfd6[_0xb9b1('0x33')][_0x1dedc1]+'?'+_0x5c3ade['context']+_0xb9b1('0x48')+_0x128894+':'+_0x5c3ade['context']+',${EXTEN},'+_0x354b72,'exten':_0x5c3ade[_0xb9b1('0x6')],'context':_0x5c3ade[_0xb9b1('0x5')],'priority':_0x2cb02d+_0x1dedc1,'VoiceExtensionId':_0x5c3ade['id']});}if(_0x248b13&&_0xe2cfd6[_0xb9b1('0x40')]===_0xb9b1('0x49'))_0xe2cfd6[_0xb9b1('0x4a')]=_0x20e888(_0xe2cfd6[_0xb9b1('0x4a')]);_0xe2cfd6[_0xb9b1('0x4b')]=_0x5e8c6a[_0xb9b1('0x24')]?_['last'](_0x5e8c6a)[_0xb9b1('0x4b')]+0x1:_0x2cb02d;_0x46d264=_[_0xb9b1('0x4c')](_0x46d264,_0x5e8c6a,[_0xe2cfd6],_0xb56485);_0x2cb02d=_[_0xb9b1('0x4d')](_0x46d264)[_0xb9b1('0x4b')]+0x1;}return _0x5d3a7c(_0x46d264);})['catch'](function(_0x1bed07){_0x2a3c0f(_0x1bed07);});});}return _0x2aa68b[_0xb9b1('0x4e')](_0xb9b1('0x4f'),attributes,{'tableName':_0xb9b1('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x24c453,_0x11e1cd){var _0x130dcd=this;var _0x178a38=_0x130dcd['type']===_0xb9b1('0x10')?_0x541c31(_0x130dcd):_0x56fb62(_0x130dcd);return _0x459915(_0x130dcd,_0x24c453,_[_0xb9b1('0x4d')](_0x178a38)[_0xb9b1('0x4b')]+0x1,_0x11e1cd)[_0xb9b1('0x51')](function(_0x58b762){var _0x38e325=_['concat'](_0x178a38,_0x58b762);_0x38e325[_0xb9b1('0xc')]({'type':_0x130dcd[_0xb9b1('0x3')],'app':_0xb9b1('0x52'),'exten':_0x130dcd[_0xb9b1('0x6')],'context':_0x130dcd[_0xb9b1('0x5')],'priority':_[_0xb9b1('0x4d')](_0x38e325)[_0xb9b1('0x4b')]+0x1,'VoiceExtensionId':_0x130dcd['id']});return _0x38e325;});}}});}; \ No newline at end of file +var _0x0cf3=['_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','name','param','phone','prefix','${EXTEN}','SIP','join','none','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','intervals','IntervalId','map','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','app','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','define','VoiceExtension','Hangup','./voiceExtension.attributes','exports','models','Set','context','type','NoOp','alias','No\x20alias\x20set','inbound','push','exten','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x0cf3,0x173));var _0x30cf=function(_0x2caa42,_0x3e766e){_0x2caa42=_0x2caa42-0x0;var _0x3af036=_0x0cf3[_0x2caa42];return _0x3af036;};'use strict';var util=require('util');var _=require('lodash');var attributes=require(_0x30cf('0x0'));module[_0x30cf('0x1')]=function(_0x42bdf0){var _0x281d08=_0x42bdf0[_0x30cf('0x2')];function _0x1a80a7(_0x2f7455){var _0x3a5ee5=0x2;var _0x2eb2d9=[{'type':_0x2f7455['type'],'app':_0x30cf('0x3'),'appdata':'CDR(type)='+_0x2f7455['type'],'context':_0x2f7455[_0x30cf('0x4')],'exten':_0x2f7455['exten'],'priority':_0x3a5ee5++,'VoiceExtensionId':_0x2f7455['id']},{'type':_0x2f7455[_0x30cf('0x5')],'app':_0x2f7455['alias']?_0x30cf('0x3'):_0x30cf('0x6'),'appdata':_0x2f7455[_0x30cf('0x7')]?'CDR(routeAlias)='+_0x2f7455['alias']:_0x30cf('0x8'),'context':_0x2f7455[_0x30cf('0x4')],'exten':_0x2f7455['exten'],'priority':_0x3a5ee5++,'VoiceExtensionId':_0x2f7455['id']}];if(_0x2f7455[_0x30cf('0x5')]===_0x30cf('0x9')){_0x2eb2d9[_0x30cf('0xa')]({'type':_0x30cf('0x9'),'app':_0x30cf('0x3'),'appdata':'CDR(routeid)='+_0x2f7455['id'],'context':_0x2f7455[_0x30cf('0x4')],'exten':_0x2f7455[_0x30cf('0xb')],'priority':_0x3a5ee5++,'VoiceExtensionId':_0x2f7455['id']});}_0x2eb2d9[_0x30cf('0xa')]({'type':_0x2f7455['type'],'app':_0x30cf('0x3'),'appdata':_0x30cf('0xc'),'context':_0x2f7455[_0x30cf('0x4')],'exten':_0x2f7455[_0x30cf('0xb')],'priority':_0x3a5ee5++,'VoiceExtensionId':_0x2f7455['id']},{'type':_0x2f7455['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2f7455[_0x30cf('0x4')],'exten':_0x2f7455['exten'],'priority':_0x3a5ee5++,'VoiceExtensionId':_0x2f7455['id']},{'type':_0x2f7455[_0x30cf('0x5')],'app':_0x30cf('0x3'),'appdata':_0x30cf('0xd'),'context':_0x2f7455[_0x30cf('0x4')],'exten':_0x2f7455['exten'],'priority':_0x3a5ee5++,'VoiceExtensionId':_0x2f7455['id']});return _0x2eb2d9;}function _0xe1db33(_0x587970){var _0x554e5b=0x2;var _0xddcdc8=[{'type':'outbound','app':'Set','appdata':_0x30cf('0xe'),'context':_0x587970[_0x30cf('0x4')],'exten':_0x587970[_0x30cf('0xb')],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']},{'type':_0x30cf('0xf'),'app':_0x587970[_0x30cf('0x7')]?'Set':_0x30cf('0x6'),'appdata':_0x587970[_0x30cf('0x7')]?_0x30cf('0x10')+_0x587970[_0x30cf('0x7')]:_0x30cf('0x8'),'context':_0x587970[_0x30cf('0x4')],'exten':_0x587970['exten'],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']},{'type':'outbound','app':_0x30cf('0x3'),'appdata':_0x30cf('0x11')+(_0x587970[_0x30cf('0x12')]?_0x30cf('0x13')+_0x587970[_0x30cf('0x12')]+'}':'${EXTEN}'),'context':_0x587970[_0x30cf('0x4')],'exten':_0x587970['exten'],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']},{'type':_0x30cf('0xf'),'app':_0x30cf('0x3'),'appdata':_0x30cf('0x14')+_0x587970['id'],'context':_0x587970[_0x30cf('0x4')],'exten':_0x587970[_0x30cf('0xb')],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']},{'type':_0x30cf('0xf'),'app':_0x30cf('0x15'),'appdata':_0x30cf('0x16')+(_0x554e5b+0x2)+_0x30cf('0x17')+(_0x554e5b+0x1)+')','context':_0x587970['context'],'exten':_0x587970[_0x30cf('0xb')],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']},{'type':_0x30cf('0xf'),'app':_0x30cf('0x3'),'appdata':_0x587970[_0x30cf('0x12')]?_0x30cf('0x18')+_0x587970[_0x30cf('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x587970[_0x30cf('0x4')],'exten':_0x587970['exten'],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']},{'type':'outbound','app':_0x30cf('0x3'),'appdata':_0x30cf('0xc'),'context':_0x587970[_0x30cf('0x4')],'exten':_0x587970[_0x30cf('0xb')],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']},{'type':'outbound','app':_0x30cf('0x3'),'appdata':_0x30cf('0x19'),'context':_0x587970[_0x30cf('0x4')],'exten':_0x587970[_0x30cf('0xb')],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']},{'type':_0x30cf('0xf'),'app':_0x30cf('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x587970['context'],'exten':_0x587970[_0x30cf('0xb')],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']},{'type':'outbound','app':_0x30cf('0x3'),'appdata':_0x30cf('0x1a')+_0x587970['id'],'context':_0x587970[_0x30cf('0x4')],'exten':_0x587970[_0x30cf('0xb')],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']}];if(_0x587970[_0x30cf('0x1b')](_0x30cf('0x1c'))&&_0x587970[_0x30cf('0x1c')]!=='none'){_0xddcdc8[_0x30cf('0xa')]({'type':_0x30cf('0xf'),'app':_0x30cf('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x587970[_0x30cf('0x4')],'exten':_0x587970[_0x30cf('0xb')],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']},{'type':_0x30cf('0xf'),'app':_0x30cf('0x3'),'appdata':_0x30cf('0x1d')+_0x587970['recordingFormat']||_0x30cf('0x1e'),'context':_0x587970[_0x30cf('0x4')],'exten':_0x587970[_0x30cf('0xb')],'priority':_0x554e5b++,'VoiceExtensionId':_0x587970['id']});}return _0xddcdc8;}function _0x17b18c(_0x3f6c59){var _0x3d64f7=[{'name':_0x30cf('0x1f'),'param':0x0},{'name':_0x30cf('0x20'),'param':0x1},{'name':_0x30cf('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x592d5b={};var _0x5858e4=_0x3f6c59[_0x30cf('0x22')](',');var _0x2a6caf=[];for(var _0x1acb11=0x0;_0x1acb11<_0x3d64f7[_0x30cf('0x23')];_0x1acb11++){switch(_0x3d64f7[_0x1acb11][_0x30cf('0x24')]){case'trunk':_0x592d5b[_0x30cf('0x1f')]=_0x5858e4[_0x3d64f7[_0x1acb11][_0x30cf('0x25')]][_0x30cf('0x22')]('/')[0x1];_0x592d5b[_0x30cf('0x26')]=_0x5858e4[_0x3d64f7[_0x1acb11][_0x30cf('0x25')]][_0x30cf('0x22')]('/')[0x2];_0x592d5b[_0x30cf('0x27')]=_0x592d5b[_0x30cf('0x26')]?_0x592d5b[_0x30cf('0x26')][_0x30cf('0x22')]('$')[0x0]:undefined;_0x592d5b['phone']=route[_0x30cf('0x12')]?(_0x592d5b['prefix']||'')+_0x30cf('0x13')+route[_0x30cf('0x12')]+'}':(_0x592d5b[_0x30cf('0x27')]||'')+_0x30cf('0x28');_0x2a6caf[_0x3d64f7[_0x1acb11][_0x30cf('0x25')]]=[_0x30cf('0x29'),_0x592d5b[_0x30cf('0x1f')],_0x592d5b[_0x30cf('0x26')]][_0x30cf('0x2a')]('/');break;case'options':_0x592d5b['options']=_0x5858e4[_0x3d64f7[_0x1acb11][_0x30cf('0x25')]];if(route['recordingFormat']!==_0x30cf('0x2b')){if(_0x592d5b[_0x30cf('0x21')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x592d5b[_0x30cf('0x21')]+=_0x30cf('0x2c');}}else{_0x592d5b[_0x30cf('0x21')]=_0x592d5b[_0x30cf('0x21')][_0x30cf('0x2d')](_0x30cf('0x2c'),'');}_0x2a6caf[_0x3d64f7[_0x1acb11]['param']]=_0x592d5b[_0x30cf('0x21')];break;default:_0x2a6caf[_0x3d64f7[_0x1acb11][_0x30cf('0x25')]]=_0x5858e4[_0x3d64f7[_0x1acb11][_0x30cf('0x25')]];}}return _0x2a6caf[_0x30cf('0x2a')](',');}function _0x3b7bae(_0x585fb1,_0x108d8e,_0x30c7fe,_0x2e5fbb){return new Promise(function(_0xc53b41,_0x4bfff1){var _0x20cd3d=[];if(_[_0x30cf('0x2e')](_0x108d8e))return _0xc53b41(_0x20cd3d);_0x281d08[_0x30cf('0x2f')][_0x30cf('0x30')]({'attributes':['id',_0x30cf('0x31'),'IntervalId'],'raw':!![]})['then'](function(_0x23a1c6){for(var _0x5e7cd5=0x0,_0x47e68d=0x0;_0x5e7cd5<_0x108d8e[_0x30cf('0x23')];_0x5e7cd5++,_0x47e68d=0x0){var _0x213f3d=_0x108d8e[_0x5e7cd5];var _0x3ca484=[];var _0x4db6e7=[];if(_0x213f3d[_0x30cf('0x31')]!=='*,*,*,*'){_0x213f3d[_0x30cf('0x32')]=[_0x213f3d[_0x30cf('0x31')]];}else{_0x213f3d[_0x30cf('0x32')]=_0x213f3d[_0x30cf('0x33')]?_[_0x30cf('0x34')](_['filter'](_0x23a1c6,{'IntervalId':_0x213f3d[_0x30cf('0x33')]}),'interval'):[];}_0x213f3d['context']=_0x585fb1[_0x30cf('0x4')];_0x213f3d[_0x30cf('0xb')]=_0x585fb1[_0x30cf('0xb')];if(_0x213f3d[_0x30cf('0x5')])_0x213f3d['type']=_0x213f3d[_0x30cf('0x5')][_0x30cf('0x35')]();if(_0x585fb1[_0x30cf('0x5')]===_0x30cf('0xf')){if(_0x213f3d[_0x30cf('0x1b')](_0x30cf('0x36'))&&_0x213f3d[_0x30cf('0x36')]&&_0x213f3d['tag']!=='--'){_0x3ca484[_0x30cf('0xa')]({'type':_0x213f3d[_0x30cf('0x5')]['toLowerCase'](),'app':'Set','appdata':_0x30cf('0x37')+_0x213f3d[_0x30cf('0x36')],'context':_0x585fb1[_0x30cf('0x4')],'exten':_0x585fb1[_0x30cf('0xb')],'priority':_0x213f3d['intervals'][_0x30cf('0x23')]+_0x30c7fe+_0x47e68d++,'VoiceExtensionId':_0x585fb1['id']});}_0x3ca484[_0x30cf('0xa')]({'type':_0x213f3d['type']['toLowerCase'](),'app':'ExecIf','appdata':_0x30cf('0x38')+(_0x213f3d[_0x30cf('0x39')]?_0x30cf('0x3a')+_0x213f3d[_0x30cf('0x39')]+')':_0x30cf('0x3b')),'context':_0x585fb1[_0x30cf('0x4')],'exten':_0x585fb1['exten'],'priority':_0x213f3d['intervals'][_0x30cf('0x23')]+_0x30c7fe+_0x47e68d++,'VoiceExtensionId':_0x585fb1['id']});}else{if(_0x213f3d[_0x30cf('0x1b')](_0x30cf('0x3c'))){if([_0x30cf('0x3d'),_0x30cf('0x3e')][_0x30cf('0x3f')](_0x213f3d[_0x30cf('0x40')][_0x30cf('0x35')]())&&_0x213f3d['appType']!==_0x30cf('0x41')){if(_0x213f3d[_0x30cf('0x3c')]){_0x3ca484['push']({'type':_0x213f3d[_0x30cf('0x5')]['toLowerCase'](),'app':_0x30cf('0x15'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x585fb1[_0x30cf('0x4')],'exten':_0x585fb1[_0x30cf('0xb')],'priority':_0x213f3d[_0x30cf('0x32')][_0x30cf('0x23')]+_0x30c7fe+_0x47e68d++,'VoiceExtensionId':_0x585fb1['id']});_0x3ca484[_0x30cf('0xa')]({'type':_0x213f3d[_0x30cf('0x5')][_0x30cf('0x35')](),'app':'Set','appdata':_0x30cf('0x42'),'context':_0x585fb1[_0x30cf('0x4')],'exten':_0x585fb1[_0x30cf('0xb')],'priority':_0x213f3d[_0x30cf('0x32')]['length']+_0x30c7fe+_0x47e68d++,'VoiceExtensionId':_0x585fb1['id']});}else{_0x3ca484['push']({'type':_0x213f3d[_0x30cf('0x5')]['toLowerCase'](),'app':_0x30cf('0x15'),'appdata':_0x30cf('0x43'),'context':_0x585fb1[_0x30cf('0x4')],'exten':_0x585fb1['exten'],'priority':_0x213f3d[_0x30cf('0x32')][_0x30cf('0x23')]+_0x30c7fe+_0x47e68d++,'VoiceExtensionId':_0x585fb1['id']});_0x3ca484['push']({'type':_0x213f3d[_0x30cf('0x5')][_0x30cf('0x35')](),'app':_0x30cf('0x3'),'appdata':_0x30cf('0x44'),'context':_0x585fb1['context'],'exten':_0x585fb1[_0x30cf('0xb')],'priority':_0x213f3d[_0x30cf('0x32')]['length']+_0x30c7fe+_0x47e68d++,'VoiceExtensionId':_0x585fb1['id']});}}}}for(var _0x219abe=0x0;_0x219abe<_0x213f3d[_0x30cf('0x32')][_0x30cf('0x23')];_0x219abe++){var _0x5a1b9c=_0x30c7fe+_0x213f3d[_0x30cf('0x32')][_0x30cf('0x23')];var _0x20d4f8=_0x219abe===_0x213f3d[_0x30cf('0x32')]['length']-0x1?_0x30c7fe+_0x3ca484['length']+_0x4db6e7[_0x30cf('0x23')]+0x2:_0x30c7fe+_0x219abe+0x1;_0x3ca484[_0x30cf('0x45')](_0x219abe,0x0,{'type':_0x585fb1[_0x30cf('0x5')],'app':_0x30cf('0x46'),'appdata':_0x213f3d[_0x30cf('0x32')][_0x219abe]+'?'+_0x585fb1[_0x30cf('0x4')]+_0x30cf('0x47')+_0x5a1b9c+':'+_0x585fb1[_0x30cf('0x4')]+',${EXTEN},'+_0x20d4f8,'exten':_0x585fb1[_0x30cf('0xb')],'context':_0x585fb1['context'],'priority':_0x30c7fe+_0x219abe,'VoiceExtensionId':_0x585fb1['id']});}if(_0x2e5fbb&&_0x213f3d['appType']===_0x30cf('0x48'))_0x213f3d[_0x30cf('0x49')]=_0x17b18c(_0x213f3d['appdata']);_0x213f3d[_0x30cf('0x4a')]=_0x3ca484[_0x30cf('0x23')]?_[_0x30cf('0x4b')](_0x3ca484)['priority']+0x1:_0x30c7fe;_0x20cd3d=_[_0x30cf('0x4c')](_0x20cd3d,_0x3ca484,[_0x213f3d],_0x4db6e7);_0x30c7fe=_[_0x30cf('0x4b')](_0x20cd3d)['priority']+0x1;}return _0xc53b41(_0x20cd3d);})['catch'](function(_0x5763b4){_0x4bfff1(_0x5763b4);});});}return _0x42bdf0[_0x30cf('0x4d')](_0x30cf('0x4e'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x18c7f0,_0x56d381){var _0x329a5a=this;var _0x13ed2c=_0x329a5a['type']===_0x30cf('0xf')?_0xe1db33(_0x329a5a):_0x1a80a7(_0x329a5a);return _0x3b7bae(_0x329a5a,_0x18c7f0,_[_0x30cf('0x4b')](_0x13ed2c)[_0x30cf('0x4a')]+0x1,_0x56d381)['then'](function(_0x74cd09){var _0x52bf6c=_[_0x30cf('0x4c')](_0x13ed2c,_0x74cd09);_0x52bf6c[_0x30cf('0xa')]({'type':_0x329a5a['type'],'app':_0x30cf('0x4f'),'exten':_0x329a5a['exten'],'context':_0x329a5a['context'],'priority':_[_0x30cf('0x4b')](_0x52bf6c)[_0x30cf('0x4a')]+0x1,'VoiceExtensionId':_0x329a5a['id']});return _0x52bf6c;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 83cb25f..c700d6c 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 _0xba34=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','then','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceExtension','findAll','options','raw','limit','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x7eadd1,_0x48a71b){var _0x51d796=function(_0x11c6af){while(--_0x11c6af){_0x7eadd1['push'](_0x7eadd1['shift']());}};_0x51d796(++_0x48a71b);}(_0xba34,0x119));var _0x4ba3=function(_0xfcb0b5,_0x161bd5){_0xfcb0b5=_0xfcb0b5-0x0;var _0x17f3a0=_0xba34[_0xfcb0b5];return _0x17f3a0;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});config[_0x4ba3('0xb')]=_['defaults'](config[_0x4ba3('0xb')],{'host':_0x4ba3('0xc'),'port':0x18eb});var socket=require(_0x4ba3('0xd'))(new Redis(config[_0x4ba3('0xb')]));require(_0x4ba3('0xe'))[_0x4ba3('0xf')](socket);function respondWithRpcPromise(_0x292f58,_0x3f653c,_0x2ed106){return new BPromise(function(_0x14ebf2,_0x2d215b){return client['request'](_0x292f58,_0x2ed106)[_0x4ba3('0x10')](function(_0x9071){logger['info'](_0x4ba3('0x11'),_0x3f653c,'request\x20sent');logger[_0x4ba3('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3f653c,_0x4ba3('0x13'),JSON[_0x4ba3('0x14')](_0x9071));if(_0x9071[_0x4ba3('0x15')]){if(_0x9071[_0x4ba3('0x15')][_0x4ba3('0x16')]===0x1f4){logger[_0x4ba3('0x15')](_0x4ba3('0x11'),_0x3f653c,_0x9071[_0x4ba3('0x15')][_0x4ba3('0x17')]);return _0x2d215b(_0x9071[_0x4ba3('0x15')][_0x4ba3('0x17')]);}logger[_0x4ba3('0x15')](_0x4ba3('0x11'),_0x3f653c,_0x9071[_0x4ba3('0x15')][_0x4ba3('0x17')]);return _0x14ebf2(_0x9071[_0x4ba3('0x15')]['message']);}else{logger[_0x4ba3('0x18')](_0x4ba3('0x11'),_0x3f653c,_0x4ba3('0x13'));_0x14ebf2(_0x9071[_0x4ba3('0x19')]['message']);}})[_0x4ba3('0x1a')](function(_0xe4eff9){logger[_0x4ba3('0x15')](_0x4ba3('0x11'),_0x3f653c,_0xe4eff9);_0x2d215b(_0xe4eff9);});});}exports[_0x4ba3('0x1b')]=function(_0x125944){var _0x4b2791=this;return new Promise(function(_0x57de6a,_0x2278b0){return db['VoiceExtension'][_0x4ba3('0x1c')]({'raw':_0x125944[_0x4ba3('0x1d')]?_0x125944[_0x4ba3('0x1d')][_0x4ba3('0x1e')]===undefined?!![]:![]:!![],'where':_0x125944[_0x4ba3('0x1d')]?_0x125944[_0x4ba3('0x1d')]['where']||null:null,'attributes':_0x125944[_0x4ba3('0x1d')]?_0x125944[_0x4ba3('0x1d')]['attributes']||null:null,'limit':_0x125944[_0x4ba3('0x1d')]?_0x125944['options'][_0x4ba3('0x1f')]||null:null,'include':_0x125944[_0x4ba3('0x1d')]?_0x125944[_0x4ba3('0x1d')][_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x125944[_0x4ba3('0x1d')][_0x4ba3('0x20')],function(_0xe1f7d2){return{'model':db[_0xe1f7d2[_0x4ba3('0x22')]],'as':_0xe1f7d2['as'],'attributes':_0xe1f7d2[_0x4ba3('0x23')],'include':_0xe1f7d2['include']?_[_0x4ba3('0x21')](_0xe1f7d2[_0x4ba3('0x20')],function(_0x2311ed){return{'model':db[_0x2311ed['model']],'as':_0x2311ed['as'],'attributes':_0x2311ed[_0x4ba3('0x23')],'include':_0x2311ed[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x2311ed['include'],function(_0x10cae6){return{'model':db[_0x10cae6[_0x4ba3('0x22')]],'as':_0x10cae6['as'],'attributes':_0x10cae6[_0x4ba3('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4ba3('0x10')](function(_0x4a339e){logger['info'](_0x4ba3('0x1b'),_0x125944);logger[_0x4ba3('0x12')](_0x4ba3('0x1b'),_0x125944,JSON[_0x4ba3('0x14')](_0x4a339e));_0x57de6a(_0x4a339e);})[_0x4ba3('0x1a')](function(_0x11f88f){logger['error'](_0x4ba3('0x1b'),_0x11f88f[_0x4ba3('0x17')],_0x125944);_0x2278b0(_0x4b2791[_0x4ba3('0x15')](0x1f4,_0x11f88f[_0x4ba3('0x17')]));});});}; \ No newline at end of file +var _0x746f=['client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','attributes','limit','include','map','model','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x500362,_0x677617){var _0x3bcc99=function(_0x1eb9eb){while(--_0x1eb9eb){_0x500362['push'](_0x500362['shift']());}};_0x3bcc99(++_0x677617);}(_0x746f,0x9c));var _0xf746=function(_0x29b38c,_0x377fae){_0x29b38c=_0x29b38c-0x0;var _0x514494=_0x746f[_0x29b38c];return _0x514494;};'use strict';var _=require(_0xf746('0x0'));var util=require(_0xf746('0x1'));var moment=require(_0xf746('0x2'));var BPromise=require(_0xf746('0x3'));var rs=require(_0xf746('0x4'));var fs=require('fs');var Redis=require(_0xf746('0x5'));var db=require(_0xf746('0x6'))['db'];var utils=require(_0xf746('0x7'));var logger=require(_0xf746('0x8'))(_0xf746('0x9'));var config=require(_0xf746('0xa'));var jayson=require(_0xf746('0xb'));var client=jayson[_0xf746('0xc')][_0xf746('0xd')]({'port':0x232a});config[_0xf746('0xe')]=_[_0xf746('0xf')](config[_0xf746('0xe')],{'host':_0xf746('0x10'),'port':0x18eb});var socket=require(_0xf746('0x11'))(new Redis(config[_0xf746('0xe')]));require(_0xf746('0x12'))[_0xf746('0x13')](socket);function respondWithRpcPromise(_0xfe206a,_0xb5d59f,_0xf72dfd){return new BPromise(function(_0x5dc740,_0x3a0fa8){return client[_0xf746('0x14')](_0xfe206a,_0xf72dfd)[_0xf746('0x15')](function(_0x47ce05){logger[_0xf746('0x16')]('VoiceExtension,\x20%s,\x20%s',_0xb5d59f,_0xf746('0x17'));logger[_0xf746('0x18')](_0xf746('0x19'),_0xb5d59f,_0xf746('0x17'),JSON[_0xf746('0x1a')](_0x47ce05));if(_0x47ce05[_0xf746('0x1b')]){if(_0x47ce05['error'][_0xf746('0x1c')]===0x1f4){logger[_0xf746('0x1b')](_0xf746('0x1d'),_0xb5d59f,_0x47ce05['error'][_0xf746('0x1e')]);return _0x3a0fa8(_0x47ce05[_0xf746('0x1b')][_0xf746('0x1e')]);}logger[_0xf746('0x1b')](_0xf746('0x1d'),_0xb5d59f,_0x47ce05[_0xf746('0x1b')]['message']);return _0x5dc740(_0x47ce05[_0xf746('0x1b')]['message']);}else{logger[_0xf746('0x16')](_0xf746('0x1d'),_0xb5d59f,'request\x20sent');_0x5dc740(_0x47ce05[_0xf746('0x1f')][_0xf746('0x1e')]);}})[_0xf746('0x20')](function(_0x11d8db){logger[_0xf746('0x1b')](_0xf746('0x1d'),_0xb5d59f,_0x11d8db);_0x3a0fa8(_0x11d8db);});});}exports['GetVoiceExtension']=function(_0x37b1c9){var _0x486c27=this;return new Promise(function(_0x15465c,_0x386445){return db[_0xf746('0x21')][_0xf746('0x22')]({'raw':_0x37b1c9[_0xf746('0x23')]?_0x37b1c9[_0xf746('0x23')]['raw']===undefined?!![]:![]:!![],'where':_0x37b1c9[_0xf746('0x23')]?_0x37b1c9['options']['where']||null:null,'attributes':_0x37b1c9[_0xf746('0x23')]?_0x37b1c9[_0xf746('0x23')][_0xf746('0x24')]||null:null,'limit':_0x37b1c9[_0xf746('0x23')]?_0x37b1c9[_0xf746('0x23')][_0xf746('0x25')]||null:null,'include':_0x37b1c9['options']?_0x37b1c9[_0xf746('0x23')][_0xf746('0x26')]?_[_0xf746('0x27')](_0x37b1c9[_0xf746('0x23')]['include'],function(_0x4be1c1){return{'model':db[_0x4be1c1[_0xf746('0x28')]],'as':_0x4be1c1['as'],'attributes':_0x4be1c1['attributes'],'include':_0x4be1c1[_0xf746('0x26')]?_[_0xf746('0x27')](_0x4be1c1[_0xf746('0x26')],function(_0x24fe20){return{'model':db[_0x24fe20[_0xf746('0x28')]],'as':_0x24fe20['as'],'attributes':_0x24fe20['attributes'],'include':_0x24fe20['include']?_[_0xf746('0x27')](_0x24fe20[_0xf746('0x26')],function(_0x2c76a2){return{'model':db[_0x2c76a2[_0xf746('0x28')]],'as':_0x2c76a2['as'],'attributes':_0x2c76a2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf746('0x15')](function(_0x596b9f){logger[_0xf746('0x16')]('GetVoiceExtension',_0x37b1c9);logger[_0xf746('0x18')](_0xf746('0x29'),_0x37b1c9,JSON[_0xf746('0x1a')](_0x596b9f));_0x15465c(_0x596b9f);})[_0xf746('0x20')](function(_0x3eb10c){logger[_0xf746('0x1b')]('GetVoiceExtension',_0x3eb10c[_0xf746('0x1e')],_0x37b1c9);_0x386445(_0x486c27[_0xf746('0x1b')](0x1f4,_0x3eb10c[_0xf746('0x1e')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 06bc599..4cedc5f 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 _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x197df3,_0x1692fd){var _0xe7ab00=function(_0x913e0c){while(--_0x913e0c){_0x197df3['push'](_0x197df3['shift']());}};_0xe7ab00(++_0x1692fd);}(_0x7a54,0x106));var _0x47a5=function(_0x10a79f,_0x3d6057){_0x10a79f=_0x10a79f-0x0;var _0x4470f8=_0x7a54[_0x10a79f];return _0x4470f8;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file +var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0xb5abf3,_0x39dfed){var _0x126395=function(_0x36c078){while(--_0x36c078){_0xb5abf3['push'](_0xb5abf3['shift']());}};_0x126395(++_0x39dfed);}(_0x4975,0x86));var _0x5497=function(_0x13c809,_0x4e119a){_0x13c809=_0x13c809-0x0;var _0x6d13e=_0x4975[_0x13c809];return _0x6d13e;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 1858ca5..db6184c 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 _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x149882,_0x39b6be){_0x149882=_0x149882-0x0;var _0x43c6ee=_0x5f2f[_0x149882];return _0x43c6ee;};'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 _0x4745=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','isAuthenticated','/:id/messages','getMessages','post','create','put'];(function(_0x16916f,_0x1655ee){var _0x536d2a=function(_0x8cdc62){while(--_0x8cdc62){_0x16916f['push'](_0x16916f['shift']());}};_0x536d2a(++_0x1655ee);}(_0x4745,0x1e7));var _0x5474=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x4745[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var path=require(_0x5474('0x2'));var timeout=require(_0x5474('0x3'));var express=require(_0x5474('0x4'));var router=express[_0x5474('0x5')]();var fs_extra=require(_0x5474('0x6'));var auth=require(_0x5474('0x7'));var interaction=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var controller=require(_0x5474('0xa'));router[_0x5474('0xb')]('/',auth['isAuthenticated'](),controller[_0x5474('0xc')]);router[_0x5474('0xb')]('/:id',auth[_0x5474('0xd')](),controller['show']);router[_0x5474('0xb')](_0x5474('0xe'),auth['isAuthenticated'](),controller[_0x5474('0xf')]);router[_0x5474('0x10')]('/',auth[_0x5474('0xd')](),controller[_0x5474('0x11')]);router[_0x5474('0x12')](_0x5474('0x13'),auth[_0x5474('0xd')](),controller[_0x5474('0x14')]);router['delete'](_0x5474('0x13'),auth[_0x5474('0xd')](),controller[_0x5474('0x15')]);module[_0x5474('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 b3f4dd6..ddac454 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 _0x6e15=['TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0xb30aa8,_0x21ed99){var _0x517cec=function(_0x1b9ba6){while(--_0x1b9ba6){_0xb30aa8['push'](_0xb30aa8['shift']());}};_0x517cec(++_0x21ed99);}(_0x6e15,0x1da));var _0x56e1=function(_0x53cf81,_0x255a9d){_0x53cf81=_0x53cf81-0x0;var _0xc8a847=_0x6e15[_0x53cf81];return _0xc8a847;};'use strict';var Sequelize=require(_0x56e1('0x0'));module[_0x56e1('0x1')]={'customer_id':{'type':Sequelize[_0x56e1('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x56e1('0x3'),'unique':_0x56e1('0x4')},'mailbox':{'type':Sequelize[_0x56e1('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x56e1('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x56e1('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5376ac){this['setDataValue'](_0x56e1('0x5'),typeof _0x5376ac===_0x56e1('0x6')&&_0x5376ac[_0x56e1('0x7')]()?_0x5376ac['trim']():null);}},'pager':{'type':Sequelize[_0x56e1('0x2')]},'tz':{'type':Sequelize[_0x56e1('0x2')],'defaultValue':_0x56e1('0x8')},'attach':{'type':Sequelize[_0x56e1('0x9')]('yes','no'),'defaultValue':_0x56e1('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x56e1('0x9')]('yes','no'),'defaultValue':_0x56e1('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x56e1('0x2')]},'review':{'type':Sequelize[_0x56e1('0x9')](_0x56e1('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x56e1('0x9')](_0x56e1('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x56e1('0x9')](_0x56e1('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x56e1('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x56e1('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x56e1('0x9')](_0x56e1('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x56e1('0x9')](_0x56e1('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x56e1('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x56e1('0x9')](_0x56e1('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x56e1('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x56e1('0xa'),'allowNull':![]},'stamp':{'type':_0x56e1('0xc')},'emailsubject':{'type':Sequelize[_0x56e1('0x2')]},'emailbody':{'type':Sequelize[_0x56e1('0x2')]},'maxsecs':{'type':Sequelize[_0x56e1('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x56e1('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x56e1('0xe')],'get':function(){return this['getDataValue']('fullname')+_0x56e1('0xf')+this[_0x56e1('0x10')](_0x56e1('0x11'));}}}; \ No newline at end of file +var _0xeb6b=['ENUM','yes','TINYINT(4)','VIRTUAL','fullname','getDataValue','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','central'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xeb6b,0x17e));var _0xbeb6=function(_0x3d225f,_0x154f3d){_0x3d225f=_0x3d225f-0x0;var _0xa583ae=_0xeb6b[_0x3d225f];return _0xa583ae;};'use strict';var Sequelize=require('sequelize');module[_0xbeb6('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xbeb6('0x1')],'defaultValue':_0xbeb6('0x2'),'unique':_0xbeb6('0x3')},'mailbox':{'type':Sequelize[_0xbeb6('0x1')],'defaultValue':'','allowNull':![],'unique':_0xbeb6('0x3')},'password':{'type':Sequelize[_0xbeb6('0x1')]},'fullname':{'type':Sequelize[_0xbeb6('0x1')]},'email':{'type':Sequelize[_0xbeb6('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1876e3){this[_0xbeb6('0x4')](_0xbeb6('0x5'),typeof _0x1876e3==='string'&&_0x1876e3[_0xbeb6('0x6')]()?_0x1876e3['trim']():null);}},'pager':{'type':Sequelize[_0xbeb6('0x1')]},'tz':{'type':Sequelize[_0xbeb6('0x1')],'defaultValue':_0xbeb6('0x7')},'attach':{'type':Sequelize[_0xbeb6('0x8')](_0xbeb6('0x9'),'no'),'defaultValue':_0xbeb6('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xbeb6('0x8')](_0xbeb6('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xbeb6('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xbeb6('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xbeb6('0x8')](_0xbeb6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xbeb6('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xbeb6('0x8')](_0xbeb6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xbeb6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xbeb6('0x8')]('yes','no'),'defaultValue':_0xbeb6('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xbeb6('0x8')](_0xbeb6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xbeb6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xbeb6('0x8')]('yes','no'),'defaultValue':_0xbeb6('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xbeb6('0xb')],'get':function(){return this['getDataValue'](_0xbeb6('0xc'))+'\x20-\x20'+this[_0xbeb6('0xd')](_0xbeb6('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 133b4ee..f6e18e0 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 _0x6c76=['save','then','destroy','get','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','getMessages','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','apply','reject'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6c76,0x184));var _0x66c7=function(_0x411ec7,_0x247aab){_0x411ec7=_0x411ec7-0x0;var _0x4f54a8=_0x6c76[_0x411ec7];return _0x4f54a8;};'use strict';var emlformat=require(_0x66c7('0x0'));var rimraf=require(_0x66c7('0x1'));var zipdir=require(_0x66c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66c7('0x3'));var moment=require(_0x66c7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x66c7('0x5'));var path=require(_0x66c7('0x6'));var sox=require('sox');var csv=require(_0x66c7('0x7'));var ejs=require(_0x66c7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66c7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66c7('0xa'));var deskjs=require(_0x66c7('0xb'));var toCsv=require(_0x66c7('0x7'));var querystring=require('querystring');var Papa=require(_0x66c7('0xc'));var Redis=require(_0x66c7('0xd'));var authService=require(_0x66c7('0xe'));var qs=require(_0x66c7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66c7('0x10'));var logger=require(_0x66c7('0x11'))(_0x66c7('0x12'));var utils=require(_0x66c7('0x13'));var config=require(_0x66c7('0x14'));var licenseUtil=require(_0x66c7('0x15'));var db=require(_0x66c7('0x16'))['db'];function respondWithStatusCode(_0x5176a3,_0x18c309){_0x18c309=_0x18c309||0xcc;return function(_0x760e36){if(_0x760e36){return _0x5176a3[_0x66c7('0x17')](_0x18c309);}return _0x5176a3[_0x66c7('0x18')](_0x18c309)[_0x66c7('0x19')]();};}function respondWithResult(_0x1e91d1,_0x618bd7){_0x618bd7=_0x618bd7||0xc8;return function(_0xf3b04){if(_0xf3b04){return _0x1e91d1[_0x66c7('0x18')](_0x618bd7)['json'](_0xf3b04);}};}function respondWithFilteredResult(_0x110f6d,_0x4dd902){return function(_0x208010){if(_0x208010){var _0x39f951=typeof _0x4dd902[_0x66c7('0x1a')]===_0x66c7('0x1b')&&typeof _0x4dd902[_0x66c7('0x1c')]==='undefined';var _0x5cf913=_0x208010['count'];var _0x5129f6=_0x39f951?0x0:_0x4dd902[_0x66c7('0x1a')];var _0x19f29d=_0x39f951?_0x208010['count']:_0x4dd902['offset']+_0x4dd902[_0x66c7('0x1c')];var _0x9b65cf;if(_0x19f29d>=_0x5cf913){_0x19f29d=_0x5cf913;_0x9b65cf=0xc8;}else{_0x9b65cf=0xce;}_0x110f6d[_0x66c7('0x18')](_0x9b65cf);return _0x110f6d[_0x66c7('0x1d')]('Content-Range',_0x5129f6+'-'+_0x19f29d+'/'+_0x5cf913)['json'](_0x208010);}return null;};}function patchUpdates(_0x1853b2){return function(_0x237177){try{jsonpatch[_0x66c7('0x1e')](_0x237177,_0x1853b2,!![]);}catch(_0x1c43c4){return BPromise[_0x66c7('0x1f')](_0x1c43c4);}return _0x237177[_0x66c7('0x20')]();};}function saveUpdates(_0x4804cf,_0x4ddbd2){return function(_0x366e9b){if(_0x366e9b){return _0x366e9b['update'](_0x4804cf)[_0x66c7('0x21')](function(_0x8b96b1){return _0x8b96b1;});}return null;};}function removeEntity(_0x44bdef,_0x1fc9d3){return function(_0x5bfaf6){if(_0x5bfaf6){return _0x5bfaf6[_0x66c7('0x22')]()[_0x66c7('0x21')](function(){var _0x5b28e6=_0x5bfaf6[_0x66c7('0x23')]({'plain':!![]});var _0x11a6b9=_0x66c7('0x24');return db[_0x66c7('0x25')][_0x66c7('0x22')]({'where':{'type':_0x11a6b9,'resourceId':_0x5b28e6['id']}})['then'](function(){return _0x5bfaf6;});})['then'](function(){_0x44bdef['status'](0xcc)[_0x66c7('0x19')]();});}};}function handleEntityNotFound(_0x542ff1,_0x5c5e42){return function(_0x9afd50){if(!_0x9afd50){_0x542ff1[_0x66c7('0x17')](0x194);}return _0x9afd50;};}function handleError(_0x205b7e,_0xb4b65b){_0xb4b65b=_0xb4b65b||0x1f4;return function(_0x36a830){logger[_0x66c7('0x26')](_0x36a830['stack']);if(_0x36a830[_0x66c7('0x27')]){delete _0x36a830[_0x66c7('0x27')];}_0x205b7e[_0x66c7('0x18')](_0xb4b65b)[_0x66c7('0x28')](_0x36a830);};}exports[_0x66c7('0x29')]=function(_0x592f0e,_0x263b48){var _0x4f1a34={},_0xfbd97={},_0x543fbf={'count':0x0,'rows':[]};var _0x296875=_[_0x66c7('0x2a')](db[_0x66c7('0x2b')][_0x66c7('0x2c')],function(_0xb26028){return{'name':_0xb26028[_0x66c7('0x2d')],'type':_0xb26028['type']['key']};});_0xfbd97[_0x66c7('0x2e')]=_[_0x66c7('0x2a')](_0x296875,_0x66c7('0x27'));_0xfbd97[_0x66c7('0x2f')]=_[_0x66c7('0x30')](_0x592f0e[_0x66c7('0x2f')]);_0xfbd97[_0x66c7('0x31')]=_[_0x66c7('0x32')](_0xfbd97[_0x66c7('0x2e')],_0xfbd97[_0x66c7('0x2f')]);_0x4f1a34[_0x66c7('0x33')]=_[_0x66c7('0x32')](_0xfbd97['model'],qs['fields'](_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x34')]));_0x4f1a34[_0x66c7('0x33')]=_0x4f1a34[_0x66c7('0x33')][_0x66c7('0x35')]?_0x4f1a34[_0x66c7('0x33')]:_0xfbd97[_0x66c7('0x2e')];if(!_0x592f0e['query'][_0x66c7('0x36')](_0x66c7('0x37'))){_0x4f1a34[_0x66c7('0x1c')]=qs[_0x66c7('0x1c')](_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x1c')]);_0x4f1a34[_0x66c7('0x1a')]=qs[_0x66c7('0x1a')](_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x1a')]);}_0x4f1a34[_0x66c7('0x38')]=qs['sort'](_0x592f0e['query'][_0x66c7('0x39')]);_0x4f1a34[_0x66c7('0x3a')]=qs[_0x66c7('0x31')](_['pick'](_0x592f0e['query'],_0xfbd97[_0x66c7('0x31')]),_0x296875);if(_0x592f0e[_0x66c7('0x2f')]['filter']){_0x4f1a34[_0x66c7('0x3a')]=_[_0x66c7('0x3b')](_0x4f1a34[_0x66c7('0x3a')],{'$or':_['map'](_0x296875,function(_0x20374a){if(_0x20374a[_0x66c7('0x3c')]!==_0x66c7('0x3d')){var _0x14d59c={};_0x14d59c[_0x20374a[_0x66c7('0x27')]]={'$like':'%'+_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x3e')]+'%'};return _0x14d59c;}})});}_0x4f1a34=_[_0x66c7('0x3b')]({},_0x4f1a34,_0x592f0e[_0x66c7('0x3f')]);var _0x5f34ed={'where':_0x4f1a34[_0x66c7('0x3a')]};return db[_0x66c7('0x2b')][_0x66c7('0x40')](_0x5f34ed)[_0x66c7('0x21')](function(_0x3f169e){_0x543fbf[_0x66c7('0x40')]=_0x3f169e;if(_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x41')]){_0x4f1a34[_0x66c7('0x42')]=[{'all':!![]}];}return db[_0x66c7('0x2b')]['findAll'](_0x4f1a34);})['then'](function(_0x528f5c){_0x543fbf[_0x66c7('0x43')]=_0x528f5c;return _0x543fbf;})[_0x66c7('0x21')](respondWithFilteredResult(_0x263b48,_0x4f1a34))['catch'](handleError(_0x263b48,null));};exports['show']=function(_0x34d002,_0x3cd3ab){var _0x44d637={'raw':!![],'where':{'id':_0x34d002[_0x66c7('0x44')]['id']}},_0x900ee7={};_0x900ee7['model']=_[_0x66c7('0x30')](db['VoiceMail']['rawAttributes']);_0x900ee7[_0x66c7('0x2f')]=_[_0x66c7('0x30')](_0x34d002[_0x66c7('0x2f')]);_0x900ee7[_0x66c7('0x31')]=_['intersection'](_0x900ee7['model'],_0x900ee7[_0x66c7('0x2f')]);_0x44d637['attributes']=_['intersection'](_0x900ee7[_0x66c7('0x2e')],qs[_0x66c7('0x34')](_0x34d002[_0x66c7('0x2f')][_0x66c7('0x34')]));_0x44d637['attributes']=_0x44d637[_0x66c7('0x33')][_0x66c7('0x35')]?_0x44d637[_0x66c7('0x33')]:_0x900ee7['model'];if(_0x34d002[_0x66c7('0x2f')][_0x66c7('0x41')]){_0x44d637[_0x66c7('0x42')]=[{'all':!![]}];}_0x44d637=_[_0x66c7('0x3b')]({},_0x44d637,_0x34d002[_0x66c7('0x3f')]);return db[_0x66c7('0x2b')][_0x66c7('0x45')](_0x44d637)[_0x66c7('0x21')](handleEntityNotFound(_0x3cd3ab,null))['then'](respondWithResult(_0x3cd3ab,null))[_0x66c7('0x46')](handleError(_0x3cd3ab,null));};exports[_0x66c7('0x47')]=function(_0x23d0eb,_0x1386a2){return db[_0x66c7('0x2b')][_0x66c7('0x47')](_0x23d0eb[_0x66c7('0x48')],{})[_0x66c7('0x21')](function(_0x1b3dc2){var _0x2d8eeb=_0x23d0eb[_0x66c7('0x49')][_0x66c7('0x23')]({'plain':!![]});if(!_0x2d8eeb)throw new Error(_0x66c7('0x4a'));if(_0x2d8eeb[_0x66c7('0x4b')]==='user'){var _0x43d4db=_0x1b3dc2[_0x66c7('0x23')]({'plain':!![]});var _0x27070b=_0x66c7('0x24');return db['UserProfileSection'][_0x66c7('0x45')]({'where':{'name':_0x27070b,'userProfileId':_0x2d8eeb[_0x66c7('0x4c')]},'raw':!![]})['then'](function(_0x275a20){if(_0x275a20&&_0x275a20[_0x66c7('0x4d')]===0x0){return db[_0x66c7('0x25')][_0x66c7('0x47')]({'name':_0x43d4db[_0x66c7('0x27')],'resourceId':_0x43d4db['id'],'type':_0x275a20[_0x66c7('0x27')],'sectionId':_0x275a20['id']},{})[_0x66c7('0x21')](function(){return _0x1b3dc2;});}else{return _0x1b3dc2;}})['catch'](function(_0x933dd6){logger[_0x66c7('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x933dd6);throw _0x933dd6;});}return _0x1b3dc2;})[_0x66c7('0x21')](respondWithResult(_0x1386a2,0xc9))[_0x66c7('0x46')](handleError(_0x1386a2,null));};exports[_0x66c7('0x4e')]=function(_0x5df6d1,_0x382a48){if(_0x5df6d1[_0x66c7('0x48')]['id']){delete _0x5df6d1[_0x66c7('0x48')]['id'];}return db[_0x66c7('0x2b')][_0x66c7('0x45')]({'where':{'id':_0x5df6d1[_0x66c7('0x44')]['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x382a48,null))[_0x66c7('0x21')](saveUpdates(_0x5df6d1['body'],null))[_0x66c7('0x21')](respondWithResult(_0x382a48,null))[_0x66c7('0x46')](handleError(_0x382a48,null));};exports['destroy']=function(_0x23f865,_0x167968){return db[_0x66c7('0x2b')]['find']({'where':{'id':_0x23f865['params']['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x167968,null))['then'](removeEntity(_0x167968,null))[_0x66c7('0x46')](handleError(_0x167968,null));};exports[_0x66c7('0x4f')]=function(_0x45e5a2,_0x106b1e,_0xebff6b){return db[_0x66c7('0x2b')]['findOne']({'where':{'id':_0x45e5a2['params']['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x106b1e,null))[_0x66c7('0x21')](function(_0x5e6e32){var _0x5a4908;var _0x157369={},_0x5004aa={};_0x5004aa[_0x66c7('0x2e')]=_[_0x66c7('0x30')](db[_0x66c7('0x50')][_0x66c7('0x2c')]);_0x5004aa['query']=_[_0x66c7('0x30')](_0x45e5a2[_0x66c7('0x2f')]);_0x5004aa[_0x66c7('0x31')]=_[_0x66c7('0x32')](_0x5004aa[_0x66c7('0x2e')],_0x5004aa[_0x66c7('0x2f')]);_0x157369['attributes']=_[_0x66c7('0x32')](_0x5004aa[_0x66c7('0x2e')],qs[_0x66c7('0x34')](_0x45e5a2['query'][_0x66c7('0x34')]));_0x157369['attributes']=_0x157369[_0x66c7('0x33')][_0x66c7('0x35')]?_0x157369[_0x66c7('0x33')]:_0x5004aa[_0x66c7('0x2e')];if(!_0x45e5a2[_0x66c7('0x2f')][_0x66c7('0x36')]('nolimit')){_0x157369[_0x66c7('0x1c')]=qs[_0x66c7('0x1c')](_0x45e5a2[_0x66c7('0x2f')][_0x66c7('0x1c')]);_0x157369[_0x66c7('0x1a')]=qs['offset'](_0x45e5a2[_0x66c7('0x2f')][_0x66c7('0x1a')]);}_0x157369[_0x66c7('0x38')]=qs[_0x66c7('0x39')](_0x45e5a2[_0x66c7('0x2f')][_0x66c7('0x39')]);_0x157369[_0x66c7('0x3a')]=qs[_0x66c7('0x31')](_[_0x66c7('0x51')](_0x45e5a2[_0x66c7('0x2f')],_0x5004aa[_0x66c7('0x31')]));if(_0x45e5a2[_0x66c7('0x2f')]['filter']){_0x157369[_0x66c7('0x3a')]=_[_0x66c7('0x3b')](_0x157369[_0x66c7('0x3a')],{'$or':_[_0x66c7('0x2a')](_0x157369[_0x66c7('0x33')],function(_0x419b49){var _0x237d7a={};_0x237d7a[_0x419b49]={'$like':'%'+_0x45e5a2['query'][_0x66c7('0x3e')]+'%'};return _0x237d7a;})});}_0x157369[_0x66c7('0x3a')]=_[_0x66c7('0x3b')](_0x157369[_0x66c7('0x3a')],{'mailboxuser':_0x5e6e32[_0x66c7('0x52')]});_0x157369=_[_0x66c7('0x3b')]({},_0x157369,_0x45e5a2[_0x66c7('0x3f')]);return db[_0x66c7('0x50')][_0x66c7('0x53')](_0x157369)[_0x66c7('0x21')](respondWithFilteredResult(_0x106b1e,_0x157369));})[_0x66c7('0x46')](handleError(_0x106b1e,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(_0x4fc99b,_0x3199fe){var _0x3d31d3=function(_0x468dec){while(--_0x468dec){_0x4fc99b['push'](_0x4fc99b['shift']());}};_0x3d31d3(++_0x3199fe);}(_0xbee3,0xd5));var _0x3bee=function(_0x453ef9,_0x32c3be){_0x453ef9=_0x453ef9-0x0;var _0x319c3a=_0xbee3[_0x453ef9];return _0x319c3a;};'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 7e85a98..0c29fc1 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 _0xc6fa=['../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4cba63,_0x1ecffb){var _0x3e7300=function(_0x37e811){while(--_0x37e811){_0x4cba63['push'](_0x4cba63['shift']());}};_0x3e7300(++_0x1ecffb);}(_0xc6fa,0xa1));var _0xac6f=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0xc6fa[_0x4d2f00];return _0x2d7b7f;};'use strict';var _=require(_0xac6f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xac6f('0x1'));var moment=require(_0xac6f('0x2'));var BPromise=require(_0xac6f('0x3'));var rp=require(_0xac6f('0x4'));var fs=require('fs');var path=require(_0xac6f('0x5'));var rimraf=require(_0xac6f('0x6'));var config=require(_0xac6f('0x7'));var attributes=require(_0xac6f('0x8'));module[_0xac6f('0x9')]=function(_0x5c2b82,_0x2ed1c6){return _0x5c2b82[_0xac6f('0xa')]('VoiceMail',attributes,{'tableName':_0xac6f('0xb'),'paranoid':![],'indexes':[{'name':_0xac6f('0xc'),'fields':[_0xac6f('0xd'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a6d=['api','moment','rimraf','../../config/environment','exports','define','VoiceMail','mailbox_context','mailbox','context','lodash','util','../../config/logger'];(function(_0x12387d,_0x4bb008){var _0x78d5d3=function(_0x3ec1cd){while(--_0x3ec1cd){_0x12387d['push'](_0x12387d['shift']());}};_0x78d5d3(++_0x4bb008);}(_0x0a6d,0xa6));var _0xd0a6=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x0a6d[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xd0a6('0x0'));var util=require(_0xd0a6('0x1'));var logger=require(_0xd0a6('0x2'))(_0xd0a6('0x3'));var moment=require(_0xd0a6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd0a6('0x5'));var config=require(_0xd0a6('0x6'));var attributes=require('./voiceMail.attributes');module[_0xd0a6('0x7')]=function(_0x3d78bf,_0x14eb86){return _0x3d78bf[_0xd0a6('0x8')](_0xd0a6('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xd0a6('0xa'),'fields':[_0xd0a6('0xb'),_0xd0a6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index cbc2392..783c750 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 _0x0c0f=['../../config/environment','jayson/promise','client','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0c0f,0x183));var _0xf0c0=function(_0x2be3b5,_0x2833f4){_0x2be3b5=_0x2be3b5-0x0;var _0x18a076=_0x0c0f[_0x2be3b5];return _0x18a076;};'use strict';var _=require(_0xf0c0('0x0'));var util=require(_0xf0c0('0x1'));var moment=require(_0xf0c0('0x2'));var BPromise=require(_0xf0c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0c0('0x4'));var db=require(_0xf0c0('0x5'))['db'];var utils=require(_0xf0c0('0x6'));var logger=require(_0xf0c0('0x7'))(_0xf0c0('0x8'));var config=require(_0xf0c0('0x9'));var jayson=require(_0xf0c0('0xa'));var client=jayson[_0xf0c0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21ef26,_0x1f1d71,_0x1d8185){return new BPromise(function(_0x5f2894,_0x2d4b8c){return client['request'](_0x21ef26,_0x1d8185)['then'](function(_0x342b90){logger[_0xf0c0('0xc')]('VoiceMail,\x20%s,\x20%s',_0x1f1d71,_0xf0c0('0xd'));logger[_0xf0c0('0xe')](_0xf0c0('0xf'),_0x1f1d71,_0xf0c0('0xd'),JSON[_0xf0c0('0x10')](_0x342b90));if(_0x342b90['error']){if(_0x342b90[_0xf0c0('0x11')]['code']===0x1f4){logger[_0xf0c0('0x11')](_0xf0c0('0x12'),_0x1f1d71,_0x342b90['error'][_0xf0c0('0x13')]);return _0x2d4b8c(_0x342b90[_0xf0c0('0x11')][_0xf0c0('0x13')]);}logger['error'](_0xf0c0('0x12'),_0x1f1d71,_0x342b90[_0xf0c0('0x11')]['message']);return _0x5f2894(_0x342b90[_0xf0c0('0x11')][_0xf0c0('0x13')]);}else{logger[_0xf0c0('0xc')](_0xf0c0('0x12'),_0x1f1d71,_0xf0c0('0xd'));_0x5f2894(_0x342b90[_0xf0c0('0x14')][_0xf0c0('0x13')]);}})[_0xf0c0('0x15')](function(_0x2d14e2){logger[_0xf0c0('0x11')](_0xf0c0('0x12'),_0x1f1d71,_0x2d14e2);_0x2d4b8c(_0x2d14e2);});});} \ No newline at end of file +var _0xc2cd=['../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x20f5ea,_0x5146ef){var _0x3dee4f=function(_0x3c418f){while(--_0x3c418f){_0x20f5ea['push'](_0x20f5ea['shift']());}};_0x3dee4f(++_0x5146ef);}(_0xc2cd,0x12e));var _0xdc2c=function(_0x16d786,_0x5cd7ff){_0x16d786=_0x16d786-0x0;var _0x375e28=_0xc2cd[_0x16d786];return _0x375e28;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xdc2c('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc2c('0x1'));var db=require(_0xdc2c('0x2'))['db'];var utils=require(_0xdc2c('0x3'));var logger=require(_0xdc2c('0x4'))(_0xdc2c('0x5'));var config=require(_0xdc2c('0x6'));var jayson=require(_0xdc2c('0x7'));var client=jayson[_0xdc2c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x77906e,_0x50fb8f,_0x123114){return new BPromise(function(_0x1a2200,_0x2a3173){return client[_0xdc2c('0x9')](_0x77906e,_0x123114)[_0xdc2c('0xa')](function(_0x483182){logger[_0xdc2c('0xb')](_0xdc2c('0xc'),_0x50fb8f,_0xdc2c('0xd'));logger[_0xdc2c('0xe')](_0xdc2c('0xf'),_0x50fb8f,_0xdc2c('0xd'),JSON[_0xdc2c('0x10')](_0x483182));if(_0x483182[_0xdc2c('0x11')]){if(_0x483182[_0xdc2c('0x11')][_0xdc2c('0x12')]===0x1f4){logger[_0xdc2c('0x11')]('VoiceMail,\x20%s,\x20%s',_0x50fb8f,_0x483182[_0xdc2c('0x11')]['message']);return _0x2a3173(_0x483182[_0xdc2c('0x11')][_0xdc2c('0x13')]);}logger[_0xdc2c('0x11')](_0xdc2c('0xc'),_0x50fb8f,_0x483182[_0xdc2c('0x11')][_0xdc2c('0x13')]);return _0x1a2200(_0x483182['error'][_0xdc2c('0x13')]);}else{logger[_0xdc2c('0xb')]('VoiceMail,\x20%s,\x20%s',_0x50fb8f,_0xdc2c('0xd'));_0x1a2200(_0x483182[_0xdc2c('0x14')][_0xdc2c('0x13')]);}})[_0xdc2c('0x15')](function(_0x43ed9a){logger[_0xdc2c('0x11')]('VoiceMail,\x20%s,\x20%s',_0x50fb8f,_0x43ed9a);_0x2a3173(_0x43ed9a);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index dd0f674..cfbcfdd 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 _0x3eb9=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','download','post','put','update','delete','multer'];(function(_0x467dcd,_0x3b588c){var _0x2b67b0=function(_0x52f38e){while(--_0x52f38e){_0x467dcd['push'](_0x467dcd['shift']());}};_0x2b67b0(++_0x3b588c);}(_0x3eb9,0x11c));var _0x93eb=function(_0x5e2c70,_0x108e64){_0x5e2c70=_0x5e2c70-0x0;var _0x1e6cbc=_0x3eb9[_0x5e2c70];return _0x1e6cbc;};'use strict';var multer=require(_0x93eb('0x0'));var util=require(_0x93eb('0x1'));var path=require('path');var timeout=require(_0x93eb('0x2'));var express=require(_0x93eb('0x3'));var router=express[_0x93eb('0x4')]();var fs_extra=require(_0x93eb('0x5'));var auth=require(_0x93eb('0x6'));var interaction=require(_0x93eb('0x7'));var config=require(_0x93eb('0x8'));var controller=require(_0x93eb('0x9'));router[_0x93eb('0xa')]('/',auth[_0x93eb('0xb')](),controller['index']);router['get'](_0x93eb('0xc'),auth[_0x93eb('0xb')](),controller[_0x93eb('0xd')]);router['get']('/:id/download',auth[_0x93eb('0xb')](),controller[_0x93eb('0xe')]);router[_0x93eb('0xf')]('/',auth[_0x93eb('0xb')](),controller['create']);router[_0x93eb('0x10')](_0x93eb('0xc'),auth[_0x93eb('0xb')](),controller[_0x93eb('0x11')]);router[_0x93eb('0x12')]('/:id',auth[_0x93eb('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9c10=['download','put','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','/:id','isAuthenticated','show'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c10,0xe1));var _0x09c1=function(_0x7bb4e,_0x4f9a3e){_0x7bb4e=_0x7bb4e-0x0;var _0x1f2978=_0x9c10[_0x7bb4e];return _0x1f2978;};'use strict';var multer=require(_0x09c1('0x0'));var util=require(_0x09c1('0x1'));var path=require('path');var timeout=require(_0x09c1('0x2'));var express=require(_0x09c1('0x3'));var router=express[_0x09c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x09c1('0x5'));var interaction=require(_0x09c1('0x6'));var config=require(_0x09c1('0x7'));var controller=require(_0x09c1('0x8'));router[_0x09c1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c1('0x9')](_0x09c1('0xa'),auth[_0x09c1('0xb')](),controller[_0x09c1('0xc')]);router[_0x09c1('0x9')]('/:id/download',auth[_0x09c1('0xb')](),controller[_0x09c1('0xd')]);router['post']('/',auth[_0x09c1('0xb')](),controller['create']);router[_0x09c1('0xe')]('/:id',auth[_0x09c1('0xb')](),controller['update']);router['delete']('/:id',auth[_0x09c1('0xb')](),controller[_0x09c1('0xf')]);module[_0x09c1('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index b29d516..8ed0a79 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 _0xb190=['exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0xb190,0xa4));var _0x0b19=function(_0x2d0092,_0x4122d9){_0x2d0092=_0x2d0092-0x0;var _0x571cf8=_0xb190[_0x2d0092];return _0x571cf8;};'use strict';var Sequelize=require(_0x0b19('0x0'));module[_0x0b19('0x1')]={'name':{'type':Sequelize[_0x0b19('0x2')],'get':function(_0x1ed6b2){return this[_0x0b19('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x0b19('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x0b19('0x6')](_0x0b19('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':''},'stamp':{'type':_0x0b19('0x8'),'defaultValue':Sequelize[_0x0b19('0x9')](_0x0b19('0xa'))}}; \ No newline at end of file +var _0x7085=['getDataValue','INTEGER','STRING','long','TIMESTAMP','literal','sequelize'];(function(_0x1c6719,_0x2a9c16){var _0x6a7ae3=function(_0x49be1d){while(--_0x49be1d){_0x1c6719['push'](_0x1c6719['shift']());}};_0x6a7ae3(++_0x2a9c16);}(_0x7085,0x133));var _0x5708=function(_0xd70344,_0x304eac){_0xd70344=_0xd70344-0x0;var _0x338d4b=_0x7085[_0xd70344];return _0x338d4b;};'use strict';var Sequelize=require(_0x5708('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xa85546){return this[_0x5708('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x5708('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x5708('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x5708('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x5708('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5708('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5708('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x5708('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0x5708('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5708('0x3')],'defaultValue':''},'stamp':{'type':_0x5708('0x5'),'defaultValue':Sequelize[_0x5708('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index c671a02..d2f4706 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 _0x928b=['filters','filter','type','VIRTUAL','merge','options','catch','params','length','includeAll','include','create','body','find','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','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/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','VoiceMailMessage','rawAttributes','key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x928b,0x1c5));var _0xb928=function(_0x44598b,_0x1bfec7){_0x44598b=_0x44598b-0x0;var _0x557b2a=_0x928b[_0x44598b];return _0x557b2a;};'use strict';var emlformat=require(_0xb928('0x0'));var rimraf=require(_0xb928('0x1'));var zipdir=require(_0xb928('0x2'));var jsonpatch=require(_0xb928('0x3'));var rp=require(_0xb928('0x4'));var moment=require(_0xb928('0x5'));var BPromise=require(_0xb928('0x6'));var Mustache=require(_0xb928('0x7'));var util=require(_0xb928('0x8'));var path=require('path');var sox=require(_0xb928('0x9'));var csv=require(_0xb928('0xa'));var ejs=require(_0xb928('0xb'));var fs=require('fs');var fs_extra=require(_0xb928('0xc'));var _=require(_0xb928('0xd'));var squel=require(_0xb928('0xe'));var crypto=require(_0xb928('0xf'));var jsforce=require(_0xb928('0x10'));var deskjs=require(_0xb928('0x11'));var toCsv=require(_0xb928('0xa'));var querystring=require(_0xb928('0x12'));var Papa=require(_0xb928('0x13'));var Redis=require(_0xb928('0x14'));var authService=require(_0xb928('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xb928('0x16'));var hardwareService=require(_0xb928('0x17'));var logger=require(_0xb928('0x18'))('api');var utils=require('../../config/utils');var config=require(_0xb928('0x19'));var licenseUtil=require(_0xb928('0x1a'));var db=require(_0xb928('0x1b'))['db'];function respondWithStatusCode(_0x4a63a7,_0xecb15f){_0xecb15f=_0xecb15f||0xcc;return function(_0x3577b2){if(_0x3577b2){return _0x4a63a7[_0xb928('0x1c')](_0xecb15f);}return _0x4a63a7[_0xb928('0x1d')](_0xecb15f)[_0xb928('0x1e')]();};}function respondWithResult(_0x1356c6,_0x5ec6b4){_0x5ec6b4=_0x5ec6b4||0xc8;return function(_0x6ff6f6){if(_0x6ff6f6){return _0x1356c6[_0xb928('0x1d')](_0x5ec6b4)[_0xb928('0x1f')](_0x6ff6f6);}};}function respondWithFilteredResult(_0x1aa15e,_0x5d427e){return function(_0x2f008d){if(_0x2f008d){var _0x2bb5f6=typeof _0x5d427e['offset']===_0xb928('0x20')&&typeof _0x5d427e['limit']===_0xb928('0x20');var _0x108998=_0x2f008d['count'];var _0x3f858e=_0x2bb5f6?0x0:_0x5d427e[_0xb928('0x21')];var _0x14cabf=_0x2bb5f6?_0x2f008d[_0xb928('0x22')]:_0x5d427e[_0xb928('0x21')]+_0x5d427e[_0xb928('0x23')];var _0x37ae8c;if(_0x14cabf>=_0x108998){_0x14cabf=_0x108998;_0x37ae8c=0xc8;}else{_0x37ae8c=0xce;}_0x1aa15e['status'](_0x37ae8c);return _0x1aa15e[_0xb928('0x24')](_0xb928('0x25'),_0x3f858e+'-'+_0x14cabf+'/'+_0x108998)[_0xb928('0x1f')](_0x2f008d);}return null;};}function patchUpdates(_0x411873){return function(_0x2c394d){try{jsonpatch[_0xb928('0x26')](_0x2c394d,_0x411873,!![]);}catch(_0x31de75){return BPromise[_0xb928('0x27')](_0x31de75);}return _0x2c394d[_0xb928('0x28')]();};}function saveUpdates(_0x1fb99c,_0x4873d0){return function(_0x55d773){if(_0x55d773){return _0x55d773[_0xb928('0x29')](_0x1fb99c)[_0xb928('0x2a')](function(_0x2dc5e9){return _0x2dc5e9;});}return null;};}function removeEntity(_0x5e1fa5,_0x7af8c2){return function(_0x2b0b4f){if(_0x2b0b4f){return _0x2b0b4f[_0xb928('0x2b')]()[_0xb928('0x2a')](function(){_0x5e1fa5[_0xb928('0x1d')](0xcc)[_0xb928('0x1e')]();});}};}function handleEntityNotFound(_0x304514,_0x25a326){return function(_0x3b12b1){if(!_0x3b12b1){_0x304514['sendStatus'](0x194);}return _0x3b12b1;};}function handleError(_0x5aba81,_0x1a3495){_0x1a3495=_0x1a3495||0x1f4;return function(_0x38f5cc){logger[_0xb928('0x2c')](_0x38f5cc['stack']);if(_0x38f5cc[_0xb928('0x2d')]){delete _0x38f5cc[_0xb928('0x2d')];}_0x5aba81[_0xb928('0x1d')](_0x1a3495)[_0xb928('0x2e')](_0x38f5cc);};}exports[_0xb928('0x2f')]=function(_0x33126f,_0x68967a){var _0x5aba0d={},_0x5d6295={},_0xd91f65={'count':0x0,'rows':[]};var _0x24e2fd=_['map'](db[_0xb928('0x30')][_0xb928('0x31')],function(_0x27b991){return{'name':_0x27b991['fieldName'],'type':_0x27b991['type'][_0xb928('0x32')]};});_0x5d6295[_0xb928('0x33')]=_['differenceBy'](_[_0xb928('0x34')](_0x24e2fd,_0xb928('0x2d')),[_0xb928('0x2d')]);_0x5d6295['query']=_[_0xb928('0x35')](_0x33126f['query']);_0x5d6295['filters']=_[_0xb928('0x36')](_0x5d6295['model'],_0x5d6295[_0xb928('0x37')]);_0x5aba0d[_0xb928('0x38')]=_[_0xb928('0x36')](_0x5d6295[_0xb928('0x33')],qs[_0xb928('0x39')](_0x33126f[_0xb928('0x37')][_0xb928('0x39')]));_0x5aba0d['attributes']=_0x5aba0d[_0xb928('0x38')]['length']?_0x5aba0d[_0xb928('0x38')]:_0x5d6295[_0xb928('0x33')];if(!_0x33126f['query'][_0xb928('0x3a')](_0xb928('0x3b'))){_0x5aba0d[_0xb928('0x23')]=qs[_0xb928('0x23')](_0x33126f[_0xb928('0x37')][_0xb928('0x23')]);_0x5aba0d[_0xb928('0x21')]=qs['offset'](_0x33126f['query']['offset']);}_0x5aba0d[_0xb928('0x3c')]=qs[_0xb928('0x3d')](_0x33126f['query'][_0xb928('0x3d')]);_0x5aba0d[_0xb928('0x3e')]=qs['filters'](_['pick'](_0x33126f[_0xb928('0x37')],_0x5d6295[_0xb928('0x3f')]),_0x24e2fd);if(_0x33126f[_0xb928('0x37')][_0xb928('0x40')]){_0x5aba0d[_0xb928('0x3e')]=_['merge'](_0x5aba0d[_0xb928('0x3e')],{'$or':_[_0xb928('0x34')](_0x24e2fd,function(_0x4443f9){if(_0x4443f9[_0xb928('0x41')]!==_0xb928('0x42')){var _0x8f0717={};_0x8f0717[_0x4443f9['name']]={'$like':'%'+_0x33126f[_0xb928('0x37')][_0xb928('0x40')]+'%'};return _0x8f0717;}})});}_0x5aba0d=_[_0xb928('0x43')]({},_0x5aba0d,_0x33126f[_0xb928('0x44')]);var _0x26d9f6={'where':_0x5aba0d[_0xb928('0x3e')]};return db[_0xb928('0x30')][_0xb928('0x22')](_0x26d9f6)[_0xb928('0x2a')](function(_0x2c8abc){_0xd91f65[_0xb928('0x22')]=_0x2c8abc;if(_0x33126f['query']['includeAll']){_0x5aba0d['include']=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x5aba0d);})[_0xb928('0x2a')](function(_0x4de6de){_0xd91f65['rows']=_0x4de6de;return _0xd91f65;})['then'](respondWithFilteredResult(_0x68967a,_0x5aba0d))[_0xb928('0x45')](handleError(_0x68967a,null));};exports['show']=function(_0x2f2ed5,_0x24813f){var _0x453693={'raw':!![],'where':{'id':_0x2f2ed5[_0xb928('0x46')]['id']}},_0x2361e3={};_0x2361e3[_0xb928('0x33')]=_['keys'](db[_0xb928('0x30')][_0xb928('0x31')]);_0x2361e3[_0xb928('0x37')]=_[_0xb928('0x35')](_0x2f2ed5[_0xb928('0x37')]);_0x2361e3[_0xb928('0x3f')]=_[_0xb928('0x36')](_0x2361e3[_0xb928('0x33')],_0x2361e3[_0xb928('0x37')]);_0x453693['attributes']=_[_0xb928('0x36')](_0x2361e3[_0xb928('0x33')],qs[_0xb928('0x39')](_0x2f2ed5[_0xb928('0x37')][_0xb928('0x39')]));_0x453693[_0xb928('0x38')]=_0x453693[_0xb928('0x38')][_0xb928('0x47')]?_0x453693['attributes']:_0x2361e3[_0xb928('0x33')];if(_0x2f2ed5['query'][_0xb928('0x48')]){_0x453693[_0xb928('0x49')]=[{'all':!![]}];}_0x453693=_[_0xb928('0x43')]({},_0x453693,_0x2f2ed5[_0xb928('0x44')]);return db[_0xb928('0x30')]['find'](_0x453693)[_0xb928('0x2a')](handleEntityNotFound(_0x24813f,null))[_0xb928('0x2a')](respondWithResult(_0x24813f,null))[_0xb928('0x45')](handleError(_0x24813f,null));};exports['create']=function(_0x35cb7c,_0x24f5e2){return db['VoiceMailMessage'][_0xb928('0x4a')](_0x35cb7c['body'],{})[_0xb928('0x2a')](respondWithResult(_0x24f5e2,0xc9))['catch'](handleError(_0x24f5e2,null));};exports[_0xb928('0x29')]=function(_0x441f1b,_0x45a2c5){if(_0x441f1b[_0xb928('0x4b')]['id']){delete _0x441f1b[_0xb928('0x4b')]['id'];}return db[_0xb928('0x30')]['find']({'where':{'id':_0x441f1b[_0xb928('0x46')]['id']}})[_0xb928('0x2a')](handleEntityNotFound(_0x45a2c5,null))['then'](saveUpdates(_0x441f1b[_0xb928('0x4b')],null))[_0xb928('0x2a')](respondWithResult(_0x45a2c5,null))[_0xb928('0x45')](handleError(_0x45a2c5,null));};exports[_0xb928('0x2b')]=function(_0x282fd1,_0x4c77d1){return db[_0xb928('0x30')][_0xb928('0x4c')]({'where':{'id':_0x282fd1[_0xb928('0x46')]['id']}})[_0xb928('0x2a')](handleEntityNotFound(_0x4c77d1,null))[_0xb928('0x2a')](removeEntity(_0x4c77d1,null))[_0xb928('0x45')](handleError(_0x4c77d1,null));};exports[_0xb928('0x4d')]=function(_0x49ca9a,_0x8a86a3,_0x3fbf2f){return db[_0xb928('0x30')][_0xb928('0x4c')]({'where':{'id':_0x49ca9a[_0xb928('0x46')]['id']},'attributes':['id',_0xb928('0x4e'),_0xb928('0x4f')]})['then'](handleEntityNotFound(_0x8a86a3,null))[_0xb928('0x2a')](function(_0x492e51){if(_0x492e51){if(!_0x492e51['recording']){throw new db[(_0xb928('0x50'))][(_0xb928('0x51'))](_0xb928('0x52'));}var _0x4dbd78={'Content-Type':_0xb928('0x53'),'Content-Disposition':'attachment'};if(_0x492e51['msg_id']){_0x4dbd78[_0xb928('0x54')]=_0xb928('0x55')+_0x492e51[_0xb928('0x4f')]+'.wav\x22';}_0x8a86a3[_0xb928('0x24')](_0x4dbd78);return _0x8a86a3[_0xb928('0x2e')](new Buffer(_0x492e51[_0xb928('0x4e')]));}})[_0xb928('0x45')](handleError(_0x8a86a3,null));}; \ No newline at end of file +var _0xcc36=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','destroy','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','stack','name','send','VoiceMailMessage','rawAttributes','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc36,0xc7));var _0x6cc3=function(_0x4be43e,_0x22febf){_0x4be43e=_0x4be43e-0x0;var _0xb3b959=_0xcc36[_0x4be43e];return _0xb3b959;};'use strict';var emlformat=require(_0x6cc3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6cc3('0x1'));var jsonpatch=require(_0x6cc3('0x2'));var rp=require(_0x6cc3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cc3('0x4'));var path=require('path');var sox=require(_0x6cc3('0x5'));var csv=require(_0x6cc3('0x6'));var ejs=require(_0x6cc3('0x7'));var fs=require('fs');var fs_extra=require(_0x6cc3('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6cc3('0x9'));var jsforce=require(_0x6cc3('0xa'));var deskjs=require(_0x6cc3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6cc3('0xc'));var Papa=require(_0x6cc3('0xd'));var Redis=require(_0x6cc3('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6cc3('0xf'));var hardwareService=require(_0x6cc3('0x10'));var logger=require('../../config/logger')(_0x6cc3('0x11'));var utils=require(_0x6cc3('0x12'));var config=require(_0x6cc3('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6cc3('0x14'))['db'];function respondWithStatusCode(_0x1dfdaf,_0x37ef96){_0x37ef96=_0x37ef96||0xcc;return function(_0x5623f1){if(_0x5623f1){return _0x1dfdaf[_0x6cc3('0x15')](_0x37ef96);}return _0x1dfdaf[_0x6cc3('0x16')](_0x37ef96)[_0x6cc3('0x17')]();};}function respondWithResult(_0x167b48,_0xfb6943){_0xfb6943=_0xfb6943||0xc8;return function(_0x5f416f){if(_0x5f416f){return _0x167b48['status'](_0xfb6943)['json'](_0x5f416f);}};}function respondWithFilteredResult(_0x40242e,_0x505246){return function(_0xf292f1){if(_0xf292f1){var _0x321c01=typeof _0x505246[_0x6cc3('0x18')]==='undefined'&&typeof _0x505246[_0x6cc3('0x19')]===_0x6cc3('0x1a');var _0x35200f=_0xf292f1[_0x6cc3('0x1b')];var _0x261797=_0x321c01?0x0:_0x505246['offset'];var _0x15766a=_0x321c01?_0xf292f1[_0x6cc3('0x1b')]:_0x505246[_0x6cc3('0x18')]+_0x505246[_0x6cc3('0x19')];var _0x25639e;if(_0x15766a>=_0x35200f){_0x15766a=_0x35200f;_0x25639e=0xc8;}else{_0x25639e=0xce;}_0x40242e[_0x6cc3('0x16')](_0x25639e);return _0x40242e[_0x6cc3('0x1c')](_0x6cc3('0x1d'),_0x261797+'-'+_0x15766a+'/'+_0x35200f)[_0x6cc3('0x1e')](_0xf292f1);}return null;};}function patchUpdates(_0x29b531){return function(_0x4bd6b0){try{jsonpatch[_0x6cc3('0x1f')](_0x4bd6b0,_0x29b531,!![]);}catch(_0x1bed00){return BPromise[_0x6cc3('0x20')](_0x1bed00);}return _0x4bd6b0['save']();};}function saveUpdates(_0x345c49,_0x4d357f){return function(_0x457aca){if(_0x457aca){return _0x457aca[_0x6cc3('0x21')](_0x345c49)[_0x6cc3('0x22')](function(_0x20ebe2){return _0x20ebe2;});}return null;};}function removeEntity(_0x74e7b0,_0x2bca44){return function(_0x8b5c03){if(_0x8b5c03){return _0x8b5c03['destroy']()['then'](function(){_0x74e7b0[_0x6cc3('0x16')](0xcc)[_0x6cc3('0x17')]();});}};}function handleEntityNotFound(_0x30ac78,_0x4779a5){return function(_0x50423b){if(!_0x50423b){_0x30ac78[_0x6cc3('0x15')](0x194);}return _0x50423b;};}function handleError(_0xfe3a6b,_0x2b019f){_0x2b019f=_0x2b019f||0x1f4;return function(_0x27991e){logger['error'](_0x27991e[_0x6cc3('0x23')]);if(_0x27991e[_0x6cc3('0x24')]){delete _0x27991e['name'];}_0xfe3a6b['status'](_0x2b019f)[_0x6cc3('0x25')](_0x27991e);};}exports['index']=function(_0x1aa476,_0x18d7ec){var _0x33ff05={},_0x57ee0e={},_0x17fb84={'count':0x0,'rows':[]};var _0x4be9c1=_['map'](db[_0x6cc3('0x26')][_0x6cc3('0x27')],function(_0x15ad6c){return{'name':_0x15ad6c['fieldName'],'type':_0x15ad6c['type'][_0x6cc3('0x28')]};});_0x57ee0e[_0x6cc3('0x29')]=_[_0x6cc3('0x2a')](_[_0x6cc3('0x2b')](_0x4be9c1,'name'),[_0x6cc3('0x24')]);_0x57ee0e[_0x6cc3('0x2c')]=_[_0x6cc3('0x2d')](_0x1aa476[_0x6cc3('0x2c')]);_0x57ee0e[_0x6cc3('0x2e')]=_[_0x6cc3('0x2f')](_0x57ee0e[_0x6cc3('0x29')],_0x57ee0e['query']);_0x33ff05[_0x6cc3('0x30')]=_[_0x6cc3('0x2f')](_0x57ee0e[_0x6cc3('0x29')],qs[_0x6cc3('0x31')](_0x1aa476['query']['fields']));_0x33ff05[_0x6cc3('0x30')]=_0x33ff05[_0x6cc3('0x30')][_0x6cc3('0x32')]?_0x33ff05[_0x6cc3('0x30')]:_0x57ee0e[_0x6cc3('0x29')];if(!_0x1aa476[_0x6cc3('0x2c')][_0x6cc3('0x33')](_0x6cc3('0x34'))){_0x33ff05[_0x6cc3('0x19')]=qs[_0x6cc3('0x19')](_0x1aa476[_0x6cc3('0x2c')][_0x6cc3('0x19')]);_0x33ff05[_0x6cc3('0x18')]=qs['offset'](_0x1aa476[_0x6cc3('0x2c')][_0x6cc3('0x18')]);}_0x33ff05[_0x6cc3('0x35')]=qs[_0x6cc3('0x36')](_0x1aa476[_0x6cc3('0x2c')][_0x6cc3('0x36')]);_0x33ff05['where']=qs[_0x6cc3('0x2e')](_[_0x6cc3('0x37')](_0x1aa476[_0x6cc3('0x2c')],_0x57ee0e[_0x6cc3('0x2e')]),_0x4be9c1);if(_0x1aa476[_0x6cc3('0x2c')][_0x6cc3('0x38')]){_0x33ff05[_0x6cc3('0x39')]=_[_0x6cc3('0x3a')](_0x33ff05[_0x6cc3('0x39')],{'$or':_[_0x6cc3('0x2b')](_0x4be9c1,function(_0x1d2a58){if(_0x1d2a58[_0x6cc3('0x3b')]!==_0x6cc3('0x3c')){var _0x52e86a={};_0x52e86a[_0x1d2a58[_0x6cc3('0x24')]]={'$like':'%'+_0x1aa476[_0x6cc3('0x2c')]['filter']+'%'};return _0x52e86a;}})});}_0x33ff05=_[_0x6cc3('0x3a')]({},_0x33ff05,_0x1aa476[_0x6cc3('0x3d')]);var _0x9c32b3={'where':_0x33ff05[_0x6cc3('0x39')]};return db[_0x6cc3('0x26')]['count'](_0x9c32b3)[_0x6cc3('0x22')](function(_0x1587d0){_0x17fb84[_0x6cc3('0x1b')]=_0x1587d0;if(_0x1aa476[_0x6cc3('0x2c')]['includeAll']){_0x33ff05[_0x6cc3('0x3e')]=[{'all':!![]}];}return db[_0x6cc3('0x26')][_0x6cc3('0x3f')](_0x33ff05);})[_0x6cc3('0x22')](function(_0x23f12d){_0x17fb84[_0x6cc3('0x40')]=_0x23f12d;return _0x17fb84;})[_0x6cc3('0x22')](respondWithFilteredResult(_0x18d7ec,_0x33ff05))[_0x6cc3('0x41')](handleError(_0x18d7ec,null));};exports[_0x6cc3('0x42')]=function(_0x468e0b,_0x59e711){var _0x2fb506={'raw':!![],'where':{'id':_0x468e0b['params']['id']}},_0x5a2c78={};_0x5a2c78['model']=_[_0x6cc3('0x2d')](db[_0x6cc3('0x26')][_0x6cc3('0x27')]);_0x5a2c78[_0x6cc3('0x2c')]=_[_0x6cc3('0x2d')](_0x468e0b[_0x6cc3('0x2c')]);_0x5a2c78[_0x6cc3('0x2e')]=_['intersection'](_0x5a2c78['model'],_0x5a2c78[_0x6cc3('0x2c')]);_0x2fb506[_0x6cc3('0x30')]=_['intersection'](_0x5a2c78[_0x6cc3('0x29')],qs[_0x6cc3('0x31')](_0x468e0b[_0x6cc3('0x2c')][_0x6cc3('0x31')]));_0x2fb506[_0x6cc3('0x30')]=_0x2fb506[_0x6cc3('0x30')]['length']?_0x2fb506['attributes']:_0x5a2c78['model'];if(_0x468e0b['query'][_0x6cc3('0x43')]){_0x2fb506[_0x6cc3('0x3e')]=[{'all':!![]}];}_0x2fb506=_['merge']({},_0x2fb506,_0x468e0b['options']);return db[_0x6cc3('0x26')][_0x6cc3('0x44')](_0x2fb506)['then'](handleEntityNotFound(_0x59e711,null))[_0x6cc3('0x22')](respondWithResult(_0x59e711,null))[_0x6cc3('0x41')](handleError(_0x59e711,null));};exports['create']=function(_0x4add7e,_0x289c22){return db[_0x6cc3('0x26')][_0x6cc3('0x45')](_0x4add7e['body'],{})[_0x6cc3('0x22')](respondWithResult(_0x289c22,0xc9))[_0x6cc3('0x41')](handleError(_0x289c22,null));};exports[_0x6cc3('0x21')]=function(_0x1a94e0,_0xf4b05f){if(_0x1a94e0[_0x6cc3('0x46')]['id']){delete _0x1a94e0['body']['id'];}return db[_0x6cc3('0x26')]['find']({'where':{'id':_0x1a94e0[_0x6cc3('0x47')]['id']}})[_0x6cc3('0x22')](handleEntityNotFound(_0xf4b05f,null))[_0x6cc3('0x22')](saveUpdates(_0x1a94e0[_0x6cc3('0x46')],null))[_0x6cc3('0x22')](respondWithResult(_0xf4b05f,null))[_0x6cc3('0x41')](handleError(_0xf4b05f,null));};exports[_0x6cc3('0x48')]=function(_0x270bbb,_0x3edba8){return db[_0x6cc3('0x26')][_0x6cc3('0x44')]({'where':{'id':_0x270bbb[_0x6cc3('0x47')]['id']}})[_0x6cc3('0x22')](handleEntityNotFound(_0x3edba8,null))['then'](removeEntity(_0x3edba8,null))[_0x6cc3('0x41')](handleError(_0x3edba8,null));};exports[_0x6cc3('0x49')]=function(_0x13f8d4,_0x574679,_0x3786d1){return db['VoiceMailMessage'][_0x6cc3('0x44')]({'where':{'id':_0x13f8d4[_0x6cc3('0x47')]['id']},'attributes':['id',_0x6cc3('0x4a'),_0x6cc3('0x4b')]})[_0x6cc3('0x22')](handleEntityNotFound(_0x574679,null))[_0x6cc3('0x22')](function(_0x3465e0){if(_0x3465e0){if(!_0x3465e0['recording']){throw new db[(_0x6cc3('0x4c'))]['ValidationError'](_0x6cc3('0x4d'));}var _0x364895={'Content-Type':_0x6cc3('0x4e'),'Content-Disposition':_0x6cc3('0x4f')};if(_0x3465e0[_0x6cc3('0x4b')]){_0x364895[_0x6cc3('0x50')]=_0x6cc3('0x51')+_0x3465e0[_0x6cc3('0x4b')]+_0x6cc3('0x52');}_0x574679['set'](_0x364895);return _0x574679['send'](new Buffer(_0x3465e0[_0x6cc3('0x4a')]));}})[_0x6cc3('0x41')](handleError(_0x574679,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index b9738fc..b92c2de 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 _0x22cd=['bluebird','request-promise','rimraf','../../config/environment','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment'];(function(_0x57d584,_0x5911a2){var _0x58e36f=function(_0x36d654){while(--_0x36d654){_0x57d584['push'](_0x57d584['shift']());}};_0x58e36f(++_0x5911a2);}(_0x22cd,0x1e8));var _0xd22c=function(_0x2b8722,_0x50d540){_0x2b8722=_0x2b8722-0x0;var _0x20c180=_0x22cd[_0x2b8722];return _0x20c180;};'use strict';var _=require(_0xd22c('0x0'));var util=require('util');var logger=require(_0xd22c('0x1'))(_0xd22c('0x2'));var moment=require(_0xd22c('0x3'));var BPromise=require(_0xd22c('0x4'));var rp=require(_0xd22c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd22c('0x6'));var config=require(_0xd22c('0x7'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x3e87b8,_0x28c527){return _0x3e87b8[_0xd22c('0x8')](_0xd22c('0x9'),attributes,{'tableName':_0xd22c('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xd22c('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe3c9=['api','moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger'];(function(_0x2b61a9,_0x12e8d8){var _0x278119=function(_0x45c757){while(--_0x45c757){_0x2b61a9['push'](_0x2b61a9['shift']());}};_0x278119(++_0x12e8d8);}(_0xe3c9,0x6e));var _0x9e3c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe3c9[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x9e3c('0x0'));var util=require('util');var logger=require(_0x9e3c('0x1'))(_0x9e3c('0x2'));var moment=require(_0x9e3c('0x3'));var BPromise=require(_0x9e3c('0x4'));var rp=require(_0x9e3c('0x5'));var fs=require('fs');var path=require(_0x9e3c('0x6'));var rimraf=require('rimraf');var config=require(_0x9e3c('0x7'));var attributes=require(_0x9e3c('0x8'));module[_0x9e3c('0x9')]=function(_0x45b798,_0x2e1f05){return _0x45b798[_0x9e3c('0xa')](_0x9e3c('0xb'),attributes,{'tableName':_0x9e3c('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x9e3c('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index ffd338f..4be4bc6 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 _0xab89=['http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x36a403,_0x210a0b){var _0x50fb97=function(_0x4609e7){while(--_0x4609e7){_0x36a403['push'](_0x36a403['shift']());}};_0x50fb97(++_0x210a0b);}(_0xab89,0xac));var _0x9ab8=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xab89[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x9ab8('0x0'));var util=require(_0x9ab8('0x1'));var moment=require(_0x9ab8('0x2'));var BPromise=require(_0x9ab8('0x3'));var rs=require(_0x9ab8('0x4'));var fs=require('fs');var Redis=require(_0x9ab8('0x5'));var db=require(_0x9ab8('0x6'))['db'];var utils=require(_0x9ab8('0x7'));var logger=require('../../config/logger')(_0x9ab8('0x8'));var config=require(_0x9ab8('0x9'));var jayson=require(_0x9ab8('0xa'));var client=jayson[_0x9ab8('0xb')][_0x9ab8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f0f63,_0x47b363,_0x54e9d1){return new BPromise(function(_0x50fcd0,_0x23ac79){return client[_0x9ab8('0xd')](_0x4f0f63,_0x54e9d1)[_0x9ab8('0xe')](function(_0x2fb129){logger['info'](_0x9ab8('0xf'),_0x47b363,_0x9ab8('0x10'));logger['debug'](_0x9ab8('0x11'),_0x47b363,_0x9ab8('0x10'),JSON[_0x9ab8('0x12')](_0x2fb129));if(_0x2fb129[_0x9ab8('0x13')]){if(_0x2fb129['error']['code']===0x1f4){logger[_0x9ab8('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x47b363,_0x2fb129['error'][_0x9ab8('0x14')]);return _0x23ac79(_0x2fb129[_0x9ab8('0x13')][_0x9ab8('0x14')]);}logger[_0x9ab8('0x13')](_0x9ab8('0xf'),_0x47b363,_0x2fb129['error'][_0x9ab8('0x14')]);return _0x50fcd0(_0x2fb129[_0x9ab8('0x13')][_0x9ab8('0x14')]);}else{logger[_0x9ab8('0x15')]('VoiceMailMessage,\x20%s,\x20%s',_0x47b363,_0x9ab8('0x10'));_0x50fcd0(_0x2fb129[_0x9ab8('0x16')][_0x9ab8('0x14')]);}})['catch'](function(_0x2e5b25){logger['error'](_0x9ab8('0xf'),_0x47b363,_0x2e5b25);_0x23ac79(_0x2e5b25);});});} \ No newline at end of file +var _0x5fc9=['stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x52ff77,_0x51ab49){var _0x280dae=function(_0x451c81){while(--_0x451c81){_0x52ff77['push'](_0x52ff77['shift']());}};_0x280dae(++_0x51ab49);}(_0x5fc9,0x139));var _0x95fc=function(_0x4b1fe0,_0x1036d6){_0x4b1fe0=_0x4b1fe0-0x0;var _0x155a16=_0x5fc9[_0x4b1fe0];return _0x155a16;};'use strict';var _=require(_0x95fc('0x0'));var util=require(_0x95fc('0x1'));var moment=require('moment');var BPromise=require(_0x95fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95fc('0x3'));var db=require(_0x95fc('0x4'))['db'];var utils=require(_0x95fc('0x5'));var logger=require('../../config/logger')(_0x95fc('0x6'));var config=require('../../config/environment');var jayson=require(_0x95fc('0x7'));var client=jayson[_0x95fc('0x8')][_0x95fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5779d9,_0x32f655,_0x21a9dd){return new BPromise(function(_0x432ed5,_0xa58a21){return client[_0x95fc('0xa')](_0x5779d9,_0x21a9dd)[_0x95fc('0xb')](function(_0x1f6578){logger[_0x95fc('0xc')](_0x95fc('0xd'),_0x32f655,_0x95fc('0xe'));logger[_0x95fc('0xf')](_0x95fc('0x10'),_0x32f655,_0x95fc('0xe'),JSON[_0x95fc('0x11')](_0x1f6578));if(_0x1f6578['error']){if(_0x1f6578[_0x95fc('0x12')]['code']===0x1f4){logger[_0x95fc('0x12')](_0x95fc('0xd'),_0x32f655,_0x1f6578[_0x95fc('0x12')]['message']);return _0xa58a21(_0x1f6578[_0x95fc('0x12')][_0x95fc('0x13')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x32f655,_0x1f6578[_0x95fc('0x12')][_0x95fc('0x13')]);return _0x432ed5(_0x1f6578[_0x95fc('0x12')][_0x95fc('0x13')]);}else{logger[_0x95fc('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x32f655,_0x95fc('0xe'));_0x432ed5(_0x1f6578[_0x95fc('0x14')][_0x95fc('0x13')]);}})[_0x95fc('0x15')](function(_0x3eb4c3){logger[_0x95fc('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x32f655,_0x3eb4c3);_0xa58a21(_0x3eb4c3);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 3ff0b24..ca3e5b1 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 _0x8157=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','getSounds','post','/:id/sounds','addSound','put','update','delete','/:id/sounds/:id2','exports'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x8157,0x17a));var _0x7815=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x8157[_0xa388a2];return _0x7ce7f6;};'use strict';var multer=require(_0x7815('0x0'));var util=require(_0x7815('0x1'));var path=require(_0x7815('0x2'));var timeout=require('connect-timeout');var express=require(_0x7815('0x3'));var router=express[_0x7815('0x4')]();var fs_extra=require(_0x7815('0x5'));var auth=require(_0x7815('0x6'));var interaction=require(_0x7815('0x7'));var config=require(_0x7815('0x8'));var controller=require('./voiceMusicOnHold.controller');router[_0x7815('0x9')]('/',auth[_0x7815('0xa')](),controller['index']);router[_0x7815('0x9')](_0x7815('0xb'),auth[_0x7815('0xa')](),controller['show']);router[_0x7815('0x9')]('/:id/sounds',auth[_0x7815('0xa')](),controller[_0x7815('0xc')]);router[_0x7815('0xd')]('/',auth[_0x7815('0xa')](),controller['create']);router['post'](_0x7815('0xe'),auth[_0x7815('0xa')](),controller[_0x7815('0xf')]);router[_0x7815('0x10')]('/:id',auth[_0x7815('0xa')](),controller[_0x7815('0x11')]);router[_0x7815('0x12')](_0x7815('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x7815('0x12')](_0x7815('0x13'),auth[_0x7815('0xa')](),controller['removeSound']);module[_0x7815('0x14')]=router; \ No newline at end of file +var _0xa293=['/:id/sounds','isAuthenticated','post','create','put','update','delete','/:id','destroy','/:id/sounds/:id2','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index'];(function(_0x21c9f4,_0x21da50){var _0x3cf421=function(_0x3da8ef){while(--_0x3da8ef){_0x21c9f4['push'](_0x21c9f4['shift']());}};_0x3cf421(++_0x21da50);}(_0xa293,0x155));var _0x3a29=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xa293[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x3a29('0x0'));var util=require(_0x3a29('0x1'));var path=require(_0x3a29('0x2'));var timeout=require(_0x3a29('0x3'));var express=require(_0x3a29('0x4'));var router=express['Router']();var fs_extra=require(_0x3a29('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3a29('0x6'));var config=require(_0x3a29('0x7'));var controller=require(_0x3a29('0x8'));router[_0x3a29('0x9')]('/',auth['isAuthenticated'](),controller[_0x3a29('0xa')]);router[_0x3a29('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3a29('0x9')](_0x3a29('0xb'),auth[_0x3a29('0xc')](),controller['getSounds']);router[_0x3a29('0xd')]('/',auth[_0x3a29('0xc')](),controller[_0x3a29('0xe')]);router[_0x3a29('0xd')]('/:id/sounds',auth[_0x3a29('0xc')](),controller['addSound']);router[_0x3a29('0xf')]('/:id',auth[_0x3a29('0xc')](),controller[_0x3a29('0x10')]);router[_0x3a29('0x11')](_0x3a29('0x12'),auth[_0x3a29('0xc')](),controller[_0x3a29('0x13')]);router[_0x3a29('0x11')](_0x3a29('0x14'),auth[_0x3a29('0xc')](),controller['removeSound']);module[_0x3a29('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 7b47b11..f7fc318 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 _0x02f6=['mp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','custom','files'];(function(_0x325de2,_0x2546b7){var _0x173fad=function(_0x1043b4){while(--_0x1043b4){_0x325de2['push'](_0x325de2['shift']());}};_0x173fad(++_0x2546b7);}(_0x02f6,0x186));var _0x602f=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x02f6[_0x479509];return _0x382da8;};'use strict';var Sequelize=require(_0x602f('0x0'));module[_0x602f('0x1')]={'name':{'type':Sequelize[_0x602f('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x602f('0x3')](_0x602f('0x4'),_0x602f('0x5'),_0x602f('0x6'),'quietmp3nb',_0x602f('0x7'),_0x602f('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x602f('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x602f('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x602f('0x2')],'allowNull':!![],'defaultValue':_0x602f('0x9')},'format':{'type':Sequelize[_0x602f('0x2')],'allowNull':!![]},'stamp':{'type':_0x602f('0xa')},'defaultEntry':{'type':Sequelize[_0x602f('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf1fa=['alpha','TIMESTAMP','BOOLEAN','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xf1fa,0xdb));var _0xaf1f=function(_0x1dd8d4,_0x3b784b){_0x1dd8d4=_0x1dd8d4-0x0;var _0xd023c2=_0xf1fa[_0x1dd8d4];return _0xd023c2;};'use strict';var Sequelize=require('sequelize');module[_0xaf1f('0x0')]={'name':{'type':Sequelize[_0xaf1f('0x1')],'allowNull':![],'unique':_0xaf1f('0x2')},'mode':{'type':Sequelize[_0xaf1f('0x3')](_0xaf1f('0x4'),_0xaf1f('0x5'),_0xaf1f('0x6'),_0xaf1f('0x7'),_0xaf1f('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0xaf1f('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xaf1f('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xaf1f('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xaf1f('0x1')],'allowNull':!![],'defaultValue':_0xaf1f('0x9')},'format':{'type':Sequelize[_0xaf1f('0x1')],'allowNull':!![]},'stamp':{'type':_0xaf1f('0xa')},'defaultEntry':{'type':Sequelize[_0xaf1f('0xb')],'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 77095f2..ee44662 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 _0x855d=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','createdAt','server/files/sounds/converted','%s.%s','basename','save_name','extname','converted_format','format','Sequelize','removeSound','id2','getSounds','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds'];(function(_0x5d5678,_0x3fc15e){var _0x50c6c4=function(_0x60dbb1){while(--_0x60dbb1){_0x5d5678['push'](_0x5d5678['shift']());}};_0x50c6c4(++_0x3fc15e);}(_0x855d,0xf9));var _0xd855=function(_0x458b5a,_0x5b0e18){_0x458b5a=_0x458b5a-0x0;var _0x202d59=_0x855d[_0x458b5a];return _0x202d59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd855('0x0'));var zipdir=require(_0xd855('0x1'));var jsonpatch=require(_0xd855('0x2'));var rp=require(_0xd855('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd855('0x4'));var sox=require('sox');var csv=require(_0xd855('0x5'));var ejs=require(_0xd855('0x6'));var fs=require('fs');var fs_extra=require(_0xd855('0x7'));var _=require(_0xd855('0x8'));var squel=require(_0xd855('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd855('0xa'));var toCsv=require(_0xd855('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd855('0xb'));var authService=require(_0xd855('0xc'));var qs=require(_0xd855('0xd'));var as=require(_0xd855('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd855('0xf'));var utils=require(_0xd855('0x10'));var config=require(_0xd855('0x11'));var licenseUtil=require(_0xd855('0x12'));var db=require(_0xd855('0x13'))['db'];function respondWithStatusCode(_0x53472a,_0x53ec8a){_0x53ec8a=_0x53ec8a||0xcc;return function(_0x1d78d4){if(_0x1d78d4){return _0x53472a[_0xd855('0x14')](_0x53ec8a);}return _0x53472a[_0xd855('0x15')](_0x53ec8a)['end']();};}function respondWithResult(_0x93ea08,_0x4140ce){_0x4140ce=_0x4140ce||0xc8;return function(_0x535754){if(_0x535754){return _0x93ea08['status'](_0x4140ce)[_0xd855('0x16')](_0x535754);}};}function respondWithFilteredResult(_0x12c273,_0x41904c){return function(_0xd157f3){if(_0xd157f3){var _0x522514=typeof _0x41904c[_0xd855('0x17')]===_0xd855('0x18')&&typeof _0x41904c[_0xd855('0x19')]===_0xd855('0x18');var _0x471e6b=_0xd157f3[_0xd855('0x1a')];var _0x4d2053=_0x522514?0x0:_0x41904c[_0xd855('0x17')];var _0x5383dc=_0x522514?_0xd157f3[_0xd855('0x1a')]:_0x41904c[_0xd855('0x17')]+_0x41904c[_0xd855('0x19')];var _0x10dcb2;if(_0x5383dc>=_0x471e6b){_0x5383dc=_0x471e6b;_0x10dcb2=0xc8;}else{_0x10dcb2=0xce;}_0x12c273[_0xd855('0x15')](_0x10dcb2);return _0x12c273[_0xd855('0x1b')](_0xd855('0x1c'),_0x4d2053+'-'+_0x5383dc+'/'+_0x471e6b)[_0xd855('0x16')](_0xd157f3);}return null;};}function patchUpdates(_0x2627af){return function(_0x28d526){try{jsonpatch['apply'](_0x28d526,_0x2627af,!![]);}catch(_0x5ddf18){return BPromise[_0xd855('0x1d')](_0x5ddf18);}return _0x28d526['save']();};}function saveUpdates(_0x1c1ac7,_0x30600a){return function(_0x573f48){if(_0x573f48){return _0x573f48[_0xd855('0x1e')](_0x1c1ac7)[_0xd855('0x1f')](function(_0x4a5db8){return _0x4a5db8;});}return null;};}function removeEntity(_0x55efbc,_0x561242){return function(_0x2478ac){if(_0x2478ac){return _0x2478ac[_0xd855('0x20')]()[_0xd855('0x1f')](function(){var _0x140692=_0x2478ac[_0xd855('0x21')]({'plain':!![]});var _0x17bba2='MusicOnHolds';return db[_0xd855('0x22')][_0xd855('0x20')]({'where':{'type':_0x17bba2,'resourceId':_0x140692['id']}})[_0xd855('0x1f')](function(){return _0x2478ac;});})[_0xd855('0x1f')](function(){_0x55efbc[_0xd855('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5157ac,_0x41cbd9){return function(_0x110fa2){if(!_0x110fa2){_0x5157ac[_0xd855('0x14')](0x194);}return _0x110fa2;};}function handleError(_0x56b3d5,_0x25a4cb){_0x25a4cb=_0x25a4cb||0x1f4;return function(_0x172385){logger[_0xd855('0x23')](_0x172385[_0xd855('0x24')]);if(_0x172385[_0xd855('0x25')]){delete _0x172385[_0xd855('0x25')];}_0x56b3d5[_0xd855('0x15')](_0x25a4cb)[_0xd855('0x26')](_0x172385);};}exports[_0xd855('0x27')]=function(_0xe6a410,_0x454a62){var _0x2c4c12={},_0x47e927={},_0x40152f={'count':0x0,'rows':[]};var _0x554fd5=_[_0xd855('0x28')](db[_0xd855('0x29')][_0xd855('0x2a')],function(_0x16370e){return{'name':_0x16370e[_0xd855('0x2b')],'type':_0x16370e[_0xd855('0x2c')][_0xd855('0x2d')]};});_0x47e927[_0xd855('0x2e')]=_[_0xd855('0x28')](_0x554fd5,_0xd855('0x25'));_0x47e927[_0xd855('0x2f')]=_['keys'](_0xe6a410[_0xd855('0x2f')]);_0x47e927[_0xd855('0x30')]=_[_0xd855('0x31')](_0x47e927[_0xd855('0x2e')],_0x47e927[_0xd855('0x2f')]);_0x2c4c12[_0xd855('0x32')]=_[_0xd855('0x31')](_0x47e927[_0xd855('0x2e')],qs[_0xd855('0x33')](_0xe6a410[_0xd855('0x2f')][_0xd855('0x33')]));_0x2c4c12[_0xd855('0x32')]=_0x2c4c12[_0xd855('0x32')][_0xd855('0x34')]?_0x2c4c12[_0xd855('0x32')]:_0x47e927['model'];if(!_0xe6a410['query']['hasOwnProperty'](_0xd855('0x35'))){_0x2c4c12[_0xd855('0x19')]=qs['limit'](_0xe6a410[_0xd855('0x2f')][_0xd855('0x19')]);_0x2c4c12[_0xd855('0x17')]=qs[_0xd855('0x17')](_0xe6a410[_0xd855('0x2f')][_0xd855('0x17')]);}_0x2c4c12[_0xd855('0x36')]=qs['sort'](_0xe6a410['query'][_0xd855('0x37')]);delete _0xe6a410['query']['sort'];_0x2c4c12[_0xd855('0x38')]=qs['filters'](_[_0xd855('0x39')](_0xe6a410[_0xd855('0x2f')],_0x47e927[_0xd855('0x30')]),_0x554fd5);if(_0xe6a410[_0xd855('0x2f')][_0xd855('0x3a')]){_0x2c4c12[_0xd855('0x38')]=_[_0xd855('0x3b')](_0x2c4c12[_0xd855('0x38')],{'$or':_[_0xd855('0x28')](_0x554fd5,function(_0x1b04d0){if(_0x1b04d0[_0xd855('0x2c')]!==_0xd855('0x3c')){var _0x26afef={};_0x26afef[_0x1b04d0[_0xd855('0x25')]]={'$like':'%'+_0xe6a410['query'][_0xd855('0x3a')]+'%'};return _0x26afef;}})});}_0x2c4c12=_[_0xd855('0x3b')]({},_0x2c4c12,_0xe6a410[_0xd855('0x3d')]);var _0x1ae55b={'where':_0x2c4c12[_0xd855('0x38')]};return db[_0xd855('0x29')][_0xd855('0x1a')](_0x1ae55b)[_0xd855('0x1f')](function(_0x103845){_0x40152f[_0xd855('0x1a')]=_0x103845;if(_0xe6a410[_0xd855('0x2f')][_0xd855('0x3e')]){_0x2c4c12[_0xd855('0x3f')]=[{'all':!![]}];}return db[_0xd855('0x29')][_0xd855('0x40')](_0x2c4c12);})['then'](function(_0x1ef483){_0x40152f[_0xd855('0x41')]=_0x1ef483;return _0x40152f;})['then'](respondWithFilteredResult(_0x454a62,_0x2c4c12))[_0xd855('0x42')](handleError(_0x454a62,null));};exports[_0xd855('0x43')]=function(_0x53eeba,_0x74b059){var _0x441abd={'raw':![],'where':{'id':_0x53eeba[_0xd855('0x44')]['id']}},_0x328dea={};_0x328dea[_0xd855('0x2e')]=_[_0xd855('0x45')](db[_0xd855('0x29')][_0xd855('0x2a')]);_0x328dea[_0xd855('0x2f')]=_['keys'](_0x53eeba[_0xd855('0x2f')]);_0x328dea[_0xd855('0x30')]=_[_0xd855('0x31')](_0x328dea[_0xd855('0x2e')],_0x328dea[_0xd855('0x2f')]);_0x441abd[_0xd855('0x32')]=_[_0xd855('0x31')](_0x328dea[_0xd855('0x2e')],qs[_0xd855('0x33')](_0x53eeba['query'][_0xd855('0x33')]));_0x441abd['attributes']=_0x441abd[_0xd855('0x32')][_0xd855('0x34')]?_0x441abd[_0xd855('0x32')]:_0x328dea[_0xd855('0x2e')];if(_0x53eeba[_0xd855('0x2f')][_0xd855('0x3e')]){_0x441abd[_0xd855('0x3f')]=[{'all':!![]}];}_0x441abd=_[_0xd855('0x3b')]({},_0x441abd,_0x53eeba[_0xd855('0x3d')]);return db[_0xd855('0x29')][_0xd855('0x46')](_0x441abd)[_0xd855('0x1f')](handleEntityNotFound(_0x74b059,null))[_0xd855('0x1f')](respondWithResult(_0x74b059,null))[_0xd855('0x42')](handleError(_0x74b059,null));};exports[_0xd855('0x1e')]=function(_0x17d8ae,_0x44ce11){if(_0x17d8ae[_0xd855('0x47')]['id']){delete _0x17d8ae['body']['id'];}return db[_0xd855('0x29')]['find']({'where':{'id':_0x17d8ae[_0xd855('0x44')]['id']}})[_0xd855('0x1f')](handleEntityNotFound(_0x44ce11,null))['then'](saveUpdates(_0x17d8ae[_0xd855('0x47')],null))[_0xd855('0x1f')](respondWithResult(_0x44ce11,null))[_0xd855('0x42')](handleError(_0x44ce11,null));};exports[_0xd855('0x48')]=function(_0xd73deb,_0x5ee5a0,_0x5502f5){return db[_0xd855('0x49')][_0xd855('0x4a')](function(_0x8f9892){if(_0xd73deb[_0xd855('0x47')][_0xd855('0x4b')]===_0xd855('0x4c')){_0xd73deb[_0xd855('0x47')][_0xd855('0x4d')]=path[_0xd855('0x4e')](config[_0xd855('0x4f')],_0xd855('0x50'),_0xd73deb[_0xd855('0x47')][_0xd855('0x25')]);}return db[_0xd855('0x29')][_0xd855('0x48')](_0xd73deb[_0xd855('0x47')],{'transaction':_0x8f9892})[_0xd855('0x1f')](function(_0x14d13d){if(_0xd73deb[_0xd855('0x47')][_0xd855('0x4b')]===_0xd855('0x4c')){fs['mkdirSync'](_0x14d13d['directory'],parseInt(_0xd855('0x51'),0x8));}var _0x1bf286=_0xd73deb[_0xd855('0x52')][_0xd855('0x21')]({'plain':!![]});if(!_0x1bf286)throw new Error(_0xd855('0x53'));if(_0x1bf286[_0xd855('0x54')]===_0xd855('0x52')){var _0x257860=_0x14d13d[_0xd855('0x21')]({'plain':!![]});return db[_0xd855('0x55')][_0xd855('0x46')]({'where':{'name':_0xd855('0x56'),'userProfileId':_0x1bf286[_0xd855('0x57')]},'raw':!![]})[_0xd855('0x1f')](function(_0xbc63b0){if(_0xbc63b0&&_0xbc63b0[_0xd855('0x58')]===0x0){return db[_0xd855('0x22')][_0xd855('0x48')]({'name':_0x257860[_0xd855('0x25')],'resourceId':_0x257860['id'],'type':_0xbc63b0['name'],'sectionId':_0xbc63b0['id']},{})[_0xd855('0x1f')](function(){return _0x14d13d;});}else{return _0x14d13d;}})[_0xd855('0x42')](function(_0x4c427f){logger[_0xd855('0x23')](_0xd855('0x59'),_0x4c427f);});}return _0x14d13d;});})['then'](respondWithResult(_0x5ee5a0,0xc9))[_0xd855('0x42')](handleError(_0x5ee5a0,null));};exports[_0xd855('0x20')]=function(_0xe6708e,_0x2bf8b5,_0x43d5e1){var _0x4d663b;return db['VoiceMusicOnHold'][_0xd855('0x46')]({'where':{'id':_0xe6708e[_0xd855('0x44')]['id']}})['then'](function(_0x466b63){if(_0x466b63){return db[_0xd855('0x49')][_0xd855('0x4a')](function(_0x13569f){return _0x466b63['destroy']({'transaction':_0x13569f,'raw':!![]})[_0xd855('0x1f')](function(_0x10bb4f){if(_0x10bb4f[_0xd855('0x4d')]){fs[_0xd855('0x5a')](_0x10bb4f[_0xd855('0x4d')])[_0xd855('0x5b')](function(_0x9d1d93){fs[_0xd855('0x5c')](path['join'](_0x10bb4f[_0xd855('0x4d')],_0x9d1d93));});fs[_0xd855('0x5d')](_0x10bb4f[_0xd855('0x4d')]);}return _0x10bb4f;});})[_0xd855('0x42')](function(_0x2a5ffb){throw new db['Sequelize'][(_0xd855('0x5e'))](_0x2a5ffb[_0xd855('0x5f')]);});}})['then'](handleEntityNotFound(_0x2bf8b5,null))['then'](removeEntity(_0x2bf8b5,null))[_0xd855('0x42')](handleError(_0x2bf8b5,null));};exports[_0xd855('0x60')]=function(_0x813689,_0x2b450e,_0x1a3129){return db[_0xd855('0x49')]['transaction'](function(_0x39c3f3){var _0x17cff5;return db['VoiceMusicOnHold'][_0xd855('0x46')]({'where':{'id':_0x813689['params']['id']}})['then'](function(_0x3aa768){if(_0x3aa768){_0x17cff5=_0x3aa768;return _0x3aa768[_0xd855('0x60')](_0x813689[_0xd855('0x47')]['id'],{'transaction':_0x39c3f3});}})[_0xd855('0x1f')](function(_0x85acb5){if(_0x85acb5){return db[_0xd855('0x61')][_0xd855('0x62')]({'where':{'id':_0x813689[_0xd855('0x47')]['id']},'attributes':['id',_0xd855('0x25'),'save_name','converted_format',_0xd855('0x63')],'raw':!![]});}})[_0xd855('0x1f')](function(_0x166f3c){if(_0x166f3c){var _0x964fd8=path[_0xd855('0x4e')](config[_0xd855('0x4f')],_0xd855('0x64'),util['format'](_0xd855('0x65'),path[_0xd855('0x66')](_0x166f3c[_0xd855('0x67')],path[_0xd855('0x68')](_0x166f3c[_0xd855('0x67')])),_0x166f3c[_0xd855('0x69')]));var _0xcc5ff5=path['join'](config[_0xd855('0x4f')],_0xd855('0x50'),_0x17cff5[_0xd855('0x25')],util[_0xd855('0x6a')](_0xd855('0x65'),_0x166f3c[_0xd855('0x25')],_0x166f3c[_0xd855('0x69')]));fs['symlinkSync'](_0x964fd8,_0xcc5ff5);return _0x166f3c;}})[_0xd855('0x42')](function(_0x3e1534){throw new db[(_0xd855('0x6b'))]['ValidationError'](_0x3e1534[_0xd855('0x5f')]);});})[_0xd855('0x1f')](handleEntityNotFound(_0x2b450e,null))['then'](respondWithResult(_0x2b450e,0xc9))[_0xd855('0x42')](handleError(_0x2b450e,null));};exports[_0xd855('0x6c')]=function(_0x4c1442,_0x5ad461,_0xac2c13){return db[_0xd855('0x49')]['transaction'](function(_0x33fde8){var _0x4d502e;return db[_0xd855('0x29')][_0xd855('0x62')]({'where':{'id':_0x4c1442[_0xd855('0x44')]['id']}})[_0xd855('0x1f')](handleEntityNotFound(_0x5ad461,null))[_0xd855('0x1f')](function(_0x4b332c){if(_0x4b332c){_0x4d502e=_0x4b332c;return _0x4b332c[_0xd855('0x6c')](_0x4c1442['params']['id2']);}})['then'](function(_0x1916bd){if(_0x1916bd){return db[_0xd855('0x61')][_0xd855('0x62')]({'where':{'id':_0x4c1442['params'][_0xd855('0x6d')]},'attributes':['id',_0xd855('0x25'),_0xd855('0x67'),_0xd855('0x69'),_0xd855('0x63')],'raw':!![]});}})[_0xd855('0x1f')](function(_0xcc2216){if(_0xcc2216){fs[_0xd855('0x5c')](path[_0xd855('0x4e')](_0x4d502e[_0xd855('0x4d')],util[_0xd855('0x6a')](_0xd855('0x65'),_0xcc2216['name'],_0xcc2216['converted_format'])));return _0xcc2216;}})[_0xd855('0x42')](function(_0x19e09f){throw new db[(_0xd855('0x6b'))][(_0xd855('0x5e'))](_0x19e09f[_0xd855('0x5f')]);});})['then'](handleEntityNotFound(_0x5ad461,null))[_0xd855('0x1f')](respondWithStatusCode(_0x5ad461,0xcc))[_0xd855('0x42')](handleError(_0x5ad461,null));};exports[_0xd855('0x6e')]=function(_0x4b6daf,_0x3c6370,_0x539843){var _0x2e83f8={};var _0x3cd703={};var _0x286f16;var _0x1d2060;return db[_0xd855('0x29')][_0xd855('0x62')]({'where':{'id':_0x4b6daf[_0xd855('0x44')]['id']}})[_0xd855('0x1f')](handleEntityNotFound(_0x3c6370,null))[_0xd855('0x1f')](function(_0x3b9aad){if(_0x3b9aad){_0x286f16=_0x3b9aad;_0x3cd703['model']=_[_0xd855('0x45')](db['Sound'][_0xd855('0x2a')]);_0x3cd703[_0xd855('0x2f')]=_[_0xd855('0x45')](_0x4b6daf[_0xd855('0x2f')]);_0x3cd703[_0xd855('0x30')]=_[_0xd855('0x31')](_0x3cd703[_0xd855('0x2e')],_0x3cd703['query']);_0x2e83f8[_0xd855('0x32')]=_['intersection'](_0x3cd703[_0xd855('0x2e')],qs[_0xd855('0x33')](_0x4b6daf[_0xd855('0x2f')]['fields']));_0x2e83f8[_0xd855('0x32')]=_0x2e83f8[_0xd855('0x32')][_0xd855('0x34')]?_0x2e83f8[_0xd855('0x32')]:_0x3cd703[_0xd855('0x2e')];_0x2e83f8[_0xd855('0x36')]=qs[_0xd855('0x37')](_0x4b6daf[_0xd855('0x2f')][_0xd855('0x37')]);_0x2e83f8[_0xd855('0x38')]=qs[_0xd855('0x30')](_[_0xd855('0x39')](_0x4b6daf[_0xd855('0x2f')],_0x3cd703[_0xd855('0x30')]));if(_0x4b6daf['query'][_0xd855('0x3a')]){_0x2e83f8['where']=_['merge'](_0x2e83f8[_0xd855('0x38')],{'$or':_[_0xd855('0x28')](_0x2e83f8[_0xd855('0x32')],function(_0x6add19){var _0x5db159={};_0x5db159[_0x6add19]={'$like':'%'+_0x4b6daf['query'][_0xd855('0x3a')]+'%'};return _0x5db159;})});}_0x2e83f8=_[_0xd855('0x3b')]({},_0x2e83f8,_0x4b6daf[_0xd855('0x3d')]);return _0x286f16[_0xd855('0x6e')](_0x2e83f8);}})['then'](function(_0x2f742d){if(_0x2f742d){_0x1d2060=_0x2f742d['length'];if(!_0x4b6daf['query'][_0xd855('0x6f')]('nolimit')){_0x2e83f8['limit']=qs[_0xd855('0x19')](_0x4b6daf['query'][_0xd855('0x19')]);_0x2e83f8[_0xd855('0x17')]=qs[_0xd855('0x17')](_0x4b6daf[_0xd855('0x2f')]['offset']);}return _0x286f16[_0xd855('0x6e')](_0x2e83f8);}})[_0xd855('0x1f')](function(_0x510327){if(_0x510327){return _0x510327?{'count':_0x1d2060,'rows':_0x510327}:null;}})['then'](respondWithResult(_0x3c6370,null))[_0xd855('0x42')](handleError(_0x3c6370,null));}; \ No newline at end of file +var _0x2faf=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','body','params','create','sequelize','transaction','mode','files','directory','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','addSound','save_name','converted_format','createdAt','join','root','format','basename','extname','%s.%s','symlinkSync','message','removeSound','findOne','id2','Sound','pick','getSounds','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x249509,_0x96bf5e){var _0x1ad0ab=function(_0x3456de){while(--_0x3456de){_0x249509['push'](_0x249509['shift']());}};_0x1ad0ab(++_0x96bf5e);}(_0x2faf,0x1a8));var _0xf2fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2faf[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf2fa('0x0'));var rp=require(_0xf2fa('0x1'));var moment=require('moment');var BPromise=require(_0xf2fa('0x2'));var Mustache=require('mustache');var util=require(_0xf2fa('0x3'));var path=require(_0xf2fa('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf2fa('0x5'));var fs=require('fs');var fs_extra=require(_0xf2fa('0x6'));var _=require(_0xf2fa('0x7'));var squel=require('squel');var crypto=require(_0xf2fa('0x8'));var jsforce=require(_0xf2fa('0x9'));var deskjs=require(_0xf2fa('0xa'));var toCsv=require(_0xf2fa('0xb'));var querystring=require(_0xf2fa('0xc'));var Papa=require('papaparse');var Redis=require(_0xf2fa('0xd'));var authService=require(_0xf2fa('0xe'));var qs=require(_0xf2fa('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf2fa('0x10'));var utils=require(_0xf2fa('0x11'));var config=require(_0xf2fa('0x12'));var licenseUtil=require(_0xf2fa('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d49d4,_0x4fe3d1){_0x4fe3d1=_0x4fe3d1||0xcc;return function(_0x3e2321){if(_0x3e2321){return _0x5d49d4[_0xf2fa('0x14')](_0x4fe3d1);}return _0x5d49d4[_0xf2fa('0x15')](_0x4fe3d1)[_0xf2fa('0x16')]();};}function respondWithResult(_0x37cc84,_0x469e0f){_0x469e0f=_0x469e0f||0xc8;return function(_0x47fa3a){if(_0x47fa3a){return _0x37cc84[_0xf2fa('0x15')](_0x469e0f)[_0xf2fa('0x17')](_0x47fa3a);}};}function respondWithFilteredResult(_0x42582e,_0x10079a){return function(_0x530f03){if(_0x530f03){var _0x3d6a77=typeof _0x10079a[_0xf2fa('0x18')]===_0xf2fa('0x19')&&typeof _0x10079a['limit']===_0xf2fa('0x19');var _0x136427=_0x530f03[_0xf2fa('0x1a')];var _0x40681b=_0x3d6a77?0x0:_0x10079a[_0xf2fa('0x18')];var _0x24fa58=_0x3d6a77?_0x530f03[_0xf2fa('0x1a')]:_0x10079a[_0xf2fa('0x18')]+_0x10079a[_0xf2fa('0x1b')];var _0x4e770b;if(_0x24fa58>=_0x136427){_0x24fa58=_0x136427;_0x4e770b=0xc8;}else{_0x4e770b=0xce;}_0x42582e['status'](_0x4e770b);return _0x42582e[_0xf2fa('0x1c')](_0xf2fa('0x1d'),_0x40681b+'-'+_0x24fa58+'/'+_0x136427)[_0xf2fa('0x17')](_0x530f03);}return null;};}function patchUpdates(_0x2496e0){return function(_0x38a351){try{jsonpatch[_0xf2fa('0x1e')](_0x38a351,_0x2496e0,!![]);}catch(_0x11f896){return BPromise[_0xf2fa('0x1f')](_0x11f896);}return _0x38a351[_0xf2fa('0x20')]();};}function saveUpdates(_0x2bdb01,_0x4e88bb){return function(_0x49e470){if(_0x49e470){return _0x49e470[_0xf2fa('0x21')](_0x2bdb01)[_0xf2fa('0x22')](function(_0x3e7c91){return _0x3e7c91;});}return null;};}function removeEntity(_0x4d4ba6,_0x2d39a2){return function(_0x5c5075){if(_0x5c5075){return _0x5c5075[_0xf2fa('0x23')]()[_0xf2fa('0x22')](function(){var _0x1566bc=_0x5c5075[_0xf2fa('0x24')]({'plain':!![]});var _0x341e08=_0xf2fa('0x25');return db[_0xf2fa('0x26')][_0xf2fa('0x23')]({'where':{'type':_0x341e08,'resourceId':_0x1566bc['id']}})['then'](function(){return _0x5c5075;});})[_0xf2fa('0x22')](function(){_0x4d4ba6['status'](0xcc)[_0xf2fa('0x16')]();});}};}function handleEntityNotFound(_0x370de6,_0x319807){return function(_0x255027){if(!_0x255027){_0x370de6['sendStatus'](0x194);}return _0x255027;};}function handleError(_0x412cb4,_0x53b304){_0x53b304=_0x53b304||0x1f4;return function(_0x5570f8){logger[_0xf2fa('0x27')](_0x5570f8[_0xf2fa('0x28')]);if(_0x5570f8[_0xf2fa('0x29')]){delete _0x5570f8['name'];}_0x412cb4[_0xf2fa('0x15')](_0x53b304)[_0xf2fa('0x2a')](_0x5570f8);};}exports[_0xf2fa('0x2b')]=function(_0xec564a,_0x4cf8ff){var _0x2da6de={},_0x4ca39b={},_0x18536d={'count':0x0,'rows':[]};var _0x5efd9c=_[_0xf2fa('0x2c')](db[_0xf2fa('0x2d')][_0xf2fa('0x2e')],function(_0x5d4fbb){return{'name':_0x5d4fbb[_0xf2fa('0x2f')],'type':_0x5d4fbb[_0xf2fa('0x30')][_0xf2fa('0x31')]};});_0x4ca39b['model']=_['map'](_0x5efd9c,_0xf2fa('0x29'));_0x4ca39b[_0xf2fa('0x32')]=_[_0xf2fa('0x33')](_0xec564a[_0xf2fa('0x32')]);_0x4ca39b[_0xf2fa('0x34')]=_[_0xf2fa('0x35')](_0x4ca39b['model'],_0x4ca39b[_0xf2fa('0x32')]);_0x2da6de[_0xf2fa('0x36')]=_[_0xf2fa('0x35')](_0x4ca39b[_0xf2fa('0x37')],qs['fields'](_0xec564a[_0xf2fa('0x32')][_0xf2fa('0x38')]));_0x2da6de[_0xf2fa('0x36')]=_0x2da6de[_0xf2fa('0x36')][_0xf2fa('0x39')]?_0x2da6de[_0xf2fa('0x36')]:_0x4ca39b[_0xf2fa('0x37')];if(!_0xec564a['query'][_0xf2fa('0x3a')]('nolimit')){_0x2da6de['limit']=qs['limit'](_0xec564a[_0xf2fa('0x32')][_0xf2fa('0x1b')]);_0x2da6de[_0xf2fa('0x18')]=qs[_0xf2fa('0x18')](_0xec564a[_0xf2fa('0x32')][_0xf2fa('0x18')]);}_0x2da6de[_0xf2fa('0x3b')]=qs['sort'](_0xec564a[_0xf2fa('0x32')][_0xf2fa('0x3c')]);delete _0xec564a['query'][_0xf2fa('0x3c')];_0x2da6de[_0xf2fa('0x3d')]=qs[_0xf2fa('0x34')](_['pick'](_0xec564a[_0xf2fa('0x32')],_0x4ca39b[_0xf2fa('0x34')]),_0x5efd9c);if(_0xec564a[_0xf2fa('0x32')][_0xf2fa('0x3e')]){_0x2da6de[_0xf2fa('0x3d')]=_[_0xf2fa('0x3f')](_0x2da6de[_0xf2fa('0x3d')],{'$or':_[_0xf2fa('0x2c')](_0x5efd9c,function(_0x514b81){if(_0x514b81[_0xf2fa('0x30')]!=='VIRTUAL'){var _0x760b7c={};_0x760b7c[_0x514b81[_0xf2fa('0x29')]]={'$like':'%'+_0xec564a[_0xf2fa('0x32')][_0xf2fa('0x3e')]+'%'};return _0x760b7c;}})});}_0x2da6de=_[_0xf2fa('0x3f')]({},_0x2da6de,_0xec564a[_0xf2fa('0x40')]);var _0x2740f0={'where':_0x2da6de[_0xf2fa('0x3d')]};return db[_0xf2fa('0x2d')]['count'](_0x2740f0)[_0xf2fa('0x22')](function(_0x541ea4){_0x18536d['count']=_0x541ea4;if(_0xec564a[_0xf2fa('0x32')][_0xf2fa('0x41')]){_0x2da6de[_0xf2fa('0x42')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xf2fa('0x43')](_0x2da6de);})[_0xf2fa('0x22')](function(_0x3e6099){_0x18536d[_0xf2fa('0x44')]=_0x3e6099;return _0x18536d;})[_0xf2fa('0x22')](respondWithFilteredResult(_0x4cf8ff,_0x2da6de))[_0xf2fa('0x45')](handleError(_0x4cf8ff,null));};exports[_0xf2fa('0x46')]=function(_0x183148,_0x354911){var _0x23a37c={'raw':![],'where':{'id':_0x183148['params']['id']}},_0x535427={};_0x535427[_0xf2fa('0x37')]=_[_0xf2fa('0x33')](db['VoiceMusicOnHold'][_0xf2fa('0x2e')]);_0x535427[_0xf2fa('0x32')]=_[_0xf2fa('0x33')](_0x183148[_0xf2fa('0x32')]);_0x535427['filters']=_['intersection'](_0x535427[_0xf2fa('0x37')],_0x535427[_0xf2fa('0x32')]);_0x23a37c[_0xf2fa('0x36')]=_[_0xf2fa('0x35')](_0x535427[_0xf2fa('0x37')],qs[_0xf2fa('0x38')](_0x183148[_0xf2fa('0x32')][_0xf2fa('0x38')]));_0x23a37c['attributes']=_0x23a37c[_0xf2fa('0x36')]['length']?_0x23a37c[_0xf2fa('0x36')]:_0x535427[_0xf2fa('0x37')];if(_0x183148[_0xf2fa('0x32')][_0xf2fa('0x41')]){_0x23a37c[_0xf2fa('0x42')]=[{'all':!![]}];}_0x23a37c=_[_0xf2fa('0x3f')]({},_0x23a37c,_0x183148[_0xf2fa('0x40')]);return db[_0xf2fa('0x2d')][_0xf2fa('0x47')](_0x23a37c)[_0xf2fa('0x22')](handleEntityNotFound(_0x354911,null))['then'](respondWithResult(_0x354911,null))[_0xf2fa('0x45')](handleError(_0x354911,null));};exports[_0xf2fa('0x21')]=function(_0x394292,_0x39b192){if(_0x394292[_0xf2fa('0x48')]['id']){delete _0x394292[_0xf2fa('0x48')]['id'];}return db['VoiceMusicOnHold'][_0xf2fa('0x47')]({'where':{'id':_0x394292[_0xf2fa('0x49')]['id']}})[_0xf2fa('0x22')](handleEntityNotFound(_0x39b192,null))[_0xf2fa('0x22')](saveUpdates(_0x394292['body'],null))[_0xf2fa('0x22')](respondWithResult(_0x39b192,null))[_0xf2fa('0x45')](handleError(_0x39b192,null));};exports[_0xf2fa('0x4a')]=function(_0x619673,_0x33e4de,_0x2af1d8){return db[_0xf2fa('0x4b')][_0xf2fa('0x4c')](function(_0x24db16){if(_0x619673[_0xf2fa('0x48')][_0xf2fa('0x4d')]===_0xf2fa('0x4e')){_0x619673[_0xf2fa('0x48')][_0xf2fa('0x4f')]=path['join'](config['root'],_0xf2fa('0x50'),_0x619673[_0xf2fa('0x48')][_0xf2fa('0x29')]);}return db[_0xf2fa('0x2d')][_0xf2fa('0x4a')](_0x619673['body'],{'transaction':_0x24db16})[_0xf2fa('0x22')](function(_0x172f9e){if(_0x619673[_0xf2fa('0x48')][_0xf2fa('0x4d')]==='files'){fs['mkdirSync'](_0x172f9e[_0xf2fa('0x4f')],parseInt(_0xf2fa('0x51'),0x8));}var _0x49bd4a=_0x619673[_0xf2fa('0x52')][_0xf2fa('0x24')]({'plain':!![]});if(!_0x49bd4a)throw new Error(_0xf2fa('0x53'));if(_0x49bd4a[_0xf2fa('0x54')]===_0xf2fa('0x52')){var _0xc3a3d3=_0x172f9e[_0xf2fa('0x24')]({'plain':!![]});return db[_0xf2fa('0x55')][_0xf2fa('0x47')]({'where':{'name':_0xf2fa('0x25'),'userProfileId':_0x49bd4a['userProfileId']},'raw':!![]})[_0xf2fa('0x22')](function(_0x5e6fdd){if(_0x5e6fdd&&_0x5e6fdd[_0xf2fa('0x56')]===0x0){return db[_0xf2fa('0x26')][_0xf2fa('0x4a')]({'name':_0xc3a3d3[_0xf2fa('0x29')],'resourceId':_0xc3a3d3['id'],'type':_0x5e6fdd[_0xf2fa('0x29')],'sectionId':_0x5e6fdd['id']},{})[_0xf2fa('0x22')](function(){return _0x172f9e;});}else{return _0x172f9e;}})['catch'](function(_0x1b4af1){logger[_0xf2fa('0x27')](_0xf2fa('0x57'),_0x1b4af1);});}return _0x172f9e;});})[_0xf2fa('0x22')](respondWithResult(_0x33e4de,0xc9))[_0xf2fa('0x45')](handleError(_0x33e4de,null));};exports[_0xf2fa('0x23')]=function(_0x5a6e8d,_0x3c1c83,_0x44c84f){var _0xd19f10;return db['VoiceMusicOnHold'][_0xf2fa('0x47')]({'where':{'id':_0x5a6e8d[_0xf2fa('0x49')]['id']}})[_0xf2fa('0x22')](function(_0x24452c){if(_0x24452c){return db[_0xf2fa('0x4b')][_0xf2fa('0x4c')](function(_0x5c0d3a){return _0x24452c[_0xf2fa('0x23')]({'transaction':_0x5c0d3a,'raw':!![]})[_0xf2fa('0x22')](function(_0x5366d7){if(_0x5366d7[_0xf2fa('0x4f')]){fs[_0xf2fa('0x58')](_0x5366d7['directory'])[_0xf2fa('0x59')](function(_0x26c6be){fs[_0xf2fa('0x5a')](path['join'](_0x5366d7[_0xf2fa('0x4f')],_0x26c6be));});fs['rmdirSync'](_0x5366d7[_0xf2fa('0x4f')]);}return _0x5366d7;});})['catch'](function(_0x39098){throw new db[(_0xf2fa('0x5b'))][(_0xf2fa('0x5c'))](_0x39098['message']);});}})[_0xf2fa('0x22')](handleEntityNotFound(_0x3c1c83,null))[_0xf2fa('0x22')](removeEntity(_0x3c1c83,null))[_0xf2fa('0x45')](handleError(_0x3c1c83,null));};exports[_0xf2fa('0x5d')]=function(_0x2ab792,_0x238d03,_0x260c26){return db[_0xf2fa('0x4b')]['transaction'](function(_0xf65da5){var _0x5b53fd;return db['VoiceMusicOnHold'][_0xf2fa('0x47')]({'where':{'id':_0x2ab792[_0xf2fa('0x49')]['id']}})[_0xf2fa('0x22')](function(_0x3d9840){if(_0x3d9840){_0x5b53fd=_0x3d9840;return _0x3d9840['addSound'](_0x2ab792['body']['id'],{'transaction':_0xf65da5});}})['then'](function(_0x39a3a3){if(_0x39a3a3){return db['Sound']['findOne']({'where':{'id':_0x2ab792[_0xf2fa('0x48')]['id']},'attributes':['id',_0xf2fa('0x29'),_0xf2fa('0x5e'),_0xf2fa('0x5f'),_0xf2fa('0x60')],'raw':!![]});}})[_0xf2fa('0x22')](function(_0x366c98){if(_0x366c98){var _0x56c293=path[_0xf2fa('0x61')](config[_0xf2fa('0x62')],'server/files/sounds/converted',util[_0xf2fa('0x63')]('%s.%s',path[_0xf2fa('0x64')](_0x366c98[_0xf2fa('0x5e')],path[_0xf2fa('0x65')](_0x366c98['save_name'])),_0x366c98[_0xf2fa('0x5f')]));var _0x40efb0=path['join'](config[_0xf2fa('0x62')],_0xf2fa('0x50'),_0x5b53fd[_0xf2fa('0x29')],util['format'](_0xf2fa('0x66'),_0x366c98['name'],_0x366c98[_0xf2fa('0x5f')]));fs[_0xf2fa('0x67')](_0x56c293,_0x40efb0);return _0x366c98;}})[_0xf2fa('0x45')](function(_0x4edd71){throw new db['Sequelize'][(_0xf2fa('0x5c'))](_0x4edd71[_0xf2fa('0x68')]);});})[_0xf2fa('0x22')](handleEntityNotFound(_0x238d03,null))['then'](respondWithResult(_0x238d03,0xc9))[_0xf2fa('0x45')](handleError(_0x238d03,null));};exports[_0xf2fa('0x69')]=function(_0xc8eec7,_0x224cef,_0xec8ccb){return db[_0xf2fa('0x4b')][_0xf2fa('0x4c')](function(_0x39ffb5){var _0x5b39fd;return db['VoiceMusicOnHold'][_0xf2fa('0x6a')]({'where':{'id':_0xc8eec7['params']['id']}})['then'](handleEntityNotFound(_0x224cef,null))[_0xf2fa('0x22')](function(_0x37c97b){if(_0x37c97b){_0x5b39fd=_0x37c97b;return _0x37c97b[_0xf2fa('0x69')](_0xc8eec7[_0xf2fa('0x49')][_0xf2fa('0x6b')]);}})[_0xf2fa('0x22')](function(_0x35effc){if(_0x35effc){return db[_0xf2fa('0x6c')][_0xf2fa('0x6a')]({'where':{'id':_0xc8eec7[_0xf2fa('0x49')][_0xf2fa('0x6b')]},'attributes':['id',_0xf2fa('0x29'),_0xf2fa('0x5e'),_0xf2fa('0x5f'),_0xf2fa('0x60')],'raw':!![]});}})['then'](function(_0x3cc0f2){if(_0x3cc0f2){fs['unlinkSync'](path[_0xf2fa('0x61')](_0x5b39fd[_0xf2fa('0x4f')],util[_0xf2fa('0x63')]('%s.%s',_0x3cc0f2[_0xf2fa('0x29')],_0x3cc0f2['converted_format'])));return _0x3cc0f2;}})[_0xf2fa('0x45')](function(_0xf1977e){throw new db[(_0xf2fa('0x5b'))][(_0xf2fa('0x5c'))](_0xf1977e['message']);});})[_0xf2fa('0x22')](handleEntityNotFound(_0x224cef,null))[_0xf2fa('0x22')](respondWithStatusCode(_0x224cef,0xcc))[_0xf2fa('0x45')](handleError(_0x224cef,null));};exports['getSounds']=function(_0x466298,_0x4dcf49,_0x42e9db){var _0x2c3c91={};var _0x2d027d={};var _0x192e97;var _0x4b4df8;return db[_0xf2fa('0x2d')]['findOne']({'where':{'id':_0x466298[_0xf2fa('0x49')]['id']}})[_0xf2fa('0x22')](handleEntityNotFound(_0x4dcf49,null))[_0xf2fa('0x22')](function(_0x38feab){if(_0x38feab){_0x192e97=_0x38feab;_0x2d027d[_0xf2fa('0x37')]=_['keys'](db[_0xf2fa('0x6c')][_0xf2fa('0x2e')]);_0x2d027d[_0xf2fa('0x32')]=_[_0xf2fa('0x33')](_0x466298[_0xf2fa('0x32')]);_0x2d027d[_0xf2fa('0x34')]=_[_0xf2fa('0x35')](_0x2d027d[_0xf2fa('0x37')],_0x2d027d['query']);_0x2c3c91[_0xf2fa('0x36')]=_[_0xf2fa('0x35')](_0x2d027d[_0xf2fa('0x37')],qs['fields'](_0x466298[_0xf2fa('0x32')][_0xf2fa('0x38')]));_0x2c3c91['attributes']=_0x2c3c91[_0xf2fa('0x36')][_0xf2fa('0x39')]?_0x2c3c91[_0xf2fa('0x36')]:_0x2d027d[_0xf2fa('0x37')];_0x2c3c91[_0xf2fa('0x3b')]=qs[_0xf2fa('0x3c')](_0x466298['query'][_0xf2fa('0x3c')]);_0x2c3c91[_0xf2fa('0x3d')]=qs[_0xf2fa('0x34')](_[_0xf2fa('0x6d')](_0x466298[_0xf2fa('0x32')],_0x2d027d['filters']));if(_0x466298['query'][_0xf2fa('0x3e')]){_0x2c3c91['where']=_[_0xf2fa('0x3f')](_0x2c3c91[_0xf2fa('0x3d')],{'$or':_[_0xf2fa('0x2c')](_0x2c3c91['attributes'],function(_0x8df114){var _0x1805db={};_0x1805db[_0x8df114]={'$like':'%'+_0x466298[_0xf2fa('0x32')][_0xf2fa('0x3e')]+'%'};return _0x1805db;})});}_0x2c3c91=_[_0xf2fa('0x3f')]({},_0x2c3c91,_0x466298[_0xf2fa('0x40')]);return _0x192e97[_0xf2fa('0x6e')](_0x2c3c91);}})[_0xf2fa('0x22')](function(_0x5beb42){if(_0x5beb42){_0x4b4df8=_0x5beb42['length'];if(!_0x466298['query']['hasOwnProperty']('nolimit')){_0x2c3c91[_0xf2fa('0x1b')]=qs[_0xf2fa('0x1b')](_0x466298[_0xf2fa('0x32')][_0xf2fa('0x1b')]);_0x2c3c91[_0xf2fa('0x18')]=qs['offset'](_0x466298[_0xf2fa('0x32')][_0xf2fa('0x18')]);}return _0x192e97[_0xf2fa('0x6e')](_0x2c3c91);}})[_0xf2fa('0x22')](function(_0x4cffb3){if(_0x4cffb3){return _0x4cffb3?{'count':_0x4b4df8,'rows':_0x4cffb3}:null;}})[_0xf2fa('0x22')](respondWithResult(_0x4dcf49,null))[_0xf2fa('0x45')](handleError(_0x4dcf49,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 8320cf4..99fca99 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 _0x8dbd=['../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3192eb,_0x155a6e){var _0x1b3ef0=function(_0x42f2f7){while(--_0x42f2f7){_0x3192eb['push'](_0x3192eb['shift']());}};_0x1b3ef0(++_0x155a6e);}(_0x8dbd,0x165));var _0xd8db=function(_0x26efbd,_0x110fac){_0x26efbd=_0x26efbd-0x0;var _0xe25667=_0x8dbd[_0x26efbd];return _0xe25667;};'use strict';var _=require('lodash');var util=require(_0xd8db('0x0'));var logger=require(_0xd8db('0x1'))(_0xd8db('0x2'));var moment=require(_0xd8db('0x3'));var BPromise=require(_0xd8db('0x4'));var rp=require(_0xd8db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8db('0x6'));var config=require(_0xd8db('0x7'));var attributes=require(_0xd8db('0x8'));module[_0xd8db('0x9')]=function(_0x4f4f0b,_0xd9255c){return _0x4f4f0b[_0xd8db('0xa')](_0xd8db('0xb'),attributes,{'tableName':_0xd8db('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a05=['rimraf','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3ca4d8,_0x14b8d3){var _0x3b1457=function(_0x1aba59){while(--_0x1aba59){_0x3ca4d8['push'](_0x3ca4d8['shift']());}};_0x3b1457(++_0x14b8d3);}(_0x4a05,0x18e));var _0x54a0=function(_0x3f9f39,_0x39d8c2){_0x3f9f39=_0x3f9f39-0x0;var _0x3de0b8=_0x4a05[_0x3f9f39];return _0x3de0b8;};'use strict';var _=require(_0x54a0('0x0'));var util=require(_0x54a0('0x1'));var logger=require(_0x54a0('0x2'))(_0x54a0('0x3'));var moment=require(_0x54a0('0x4'));var BPromise=require(_0x54a0('0x5'));var rp=require(_0x54a0('0x6'));var fs=require('fs');var path=require(_0x54a0('0x7'));var rimraf=require(_0x54a0('0x8'));var config=require(_0x54a0('0x9'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x54a0('0xa')]=function(_0x30384b,_0x341a77){return _0x30384b[_0x54a0('0xb')](_0x54a0('0xc'),attributes,{'tableName':_0x54a0('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 0f0e2ea..05415e8 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 _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(_0x4894d0,_0x12806b){var _0x2c7f01=function(_0x417984){while(--_0x417984){_0x4894d0['push'](_0x4894d0['shift']());}};_0x2c7f01(++_0x12806b);}(_0xe706,0xa3));var _0x6e70=function(_0x29b929,_0x2a4b10){_0x29b929=_0x29b929-0x0;var _0x3a8ce6=_0xe706[_0x29b929];return _0x3a8ce6;};'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 +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x193057,_0x19df76){var _0x50e426=function(_0x46881b){while(--_0x46881b){_0x193057['push'](_0x193057['shift']());}};_0x50e426(++_0x19df76);}(_0xedd9,0xfc));var _0x9edd=function(_0x57b5c3,_0xb62bb6){_0x57b5c3=_0x57b5c3-0x0;var _0x38692d=_0xedd9[_0x57b5c3];return _0x38692d;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 2e086a8..460140e 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 _0x3d5d=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','update','delete','destroy','removeAgents','exports'];(function(_0x1ef7e6,_0x1f8fa1){var _0x4d7de6=function(_0x5cae05){while(--_0x5cae05){_0x1ef7e6['push'](_0x1ef7e6['shift']());}};_0x4d7de6(++_0x1f8fa1);}(_0x3d5d,0x160));var _0xd3d5=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x3d5d[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd3d5('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd3d5('0x1')]();var fs_extra=require(_0xd3d5('0x2'));var auth=require(_0xd3d5('0x3'));var interaction=require(_0xd3d5('0x4'));var config=require(_0xd3d5('0x5'));var controller=require(_0xd3d5('0x6'));router[_0xd3d5('0x7')]('/',auth[_0xd3d5('0x8')](),controller['index']);router[_0xd3d5('0x7')]('/describe',auth[_0xd3d5('0x8')](),controller[_0xd3d5('0x9')]);router[_0xd3d5('0x7')](_0xd3d5('0xa'),auth[_0xd3d5('0x8')](),controller[_0xd3d5('0xb')]);router[_0xd3d5('0x7')](_0xd3d5('0xc'),auth[_0xd3d5('0x8')](),controller[_0xd3d5('0xd')]);router[_0xd3d5('0xe')]('/',auth[_0xd3d5('0x8')](),controller[_0xd3d5('0xf')]);router[_0xd3d5('0xe')](_0xd3d5('0xc'),auth[_0xd3d5('0x8')](),controller[_0xd3d5('0x10')]);router['put'](_0xd3d5('0xa'),auth[_0xd3d5('0x8')](),controller[_0xd3d5('0x11')]);router[_0xd3d5('0x12')](_0xd3d5('0xa'),auth[_0xd3d5('0x8')](),controller[_0xd3d5('0x13')]);router[_0xd3d5('0x12')](_0xd3d5('0xc'),auth[_0xd3d5('0x8')](),controller[_0xd3d5('0x14')]);module[_0xd3d5('0x15')]=router; \ No newline at end of file +var _0x795f=['post','create','addAgents','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voicePrefix.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/users','getAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x795f,0x13f));var _0xf795=function(_0xea4c4,_0x450e3f){_0xea4c4=_0xea4c4-0x0;var _0x3db169=_0x795f[_0xea4c4];return _0x3db169;};'use strict';var multer=require(_0xf795('0x0'));var util=require('util');var path=require(_0xf795('0x1'));var timeout=require(_0xf795('0x2'));var express=require(_0xf795('0x3'));var router=express[_0xf795('0x4')]();var fs_extra=require(_0xf795('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf795('0x6'));var controller=require(_0xf795('0x7'));router['get']('/',auth[_0xf795('0x8')](),controller[_0xf795('0x9')]);router['get'](_0xf795('0xa'),auth[_0xf795('0x8')](),controller[_0xf795('0xb')]);router[_0xf795('0xc')](_0xf795('0xd'),auth['isAuthenticated'](),controller[_0xf795('0xe')]);router[_0xf795('0xc')](_0xf795('0xf'),auth['isAuthenticated'](),controller[_0xf795('0x10')]);router[_0xf795('0x11')]('/',auth[_0xf795('0x8')](),controller[_0xf795('0x12')]);router['post'](_0xf795('0xf'),auth[_0xf795('0x8')](),controller[_0xf795('0x13')]);router[_0xf795('0x14')]('/:id',auth[_0xf795('0x8')](),controller[_0xf795('0x15')]);router[_0xf795('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xf795('0x16')](_0xf795('0xf'),auth[_0xf795('0x8')](),controller['removeAgents']);module[_0xf795('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index c00cf88..b1a7268 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 _0x914c=['system-','getDataValue','name','sequelize','STRING'];(function(_0x47ced9,_0x38ec71){var _0x13ec04=function(_0x41917c){while(--_0x41917c){_0x47ced9['push'](_0x47ced9['shift']());}};_0x13ec04(++_0x38ec71);}(_0x914c,0x13e));var _0xc914=function(_0x4d934b,_0x52f8e9){_0x4d934b=_0x4d934b-0x0;var _0xc0338b=_0x914c[_0x4d934b];return _0xc0338b;};'use strict';var Sequelize=require(_0xc914('0x0'));module['exports']={'name':{'type':Sequelize[_0xc914('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xada1d9){return _0xc914('0x2')+this[_0xc914('0x3')](_0xc914('0x4'))+'-';}},'description':{'type':Sequelize[_0xc914('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1526=['INTEGER','sequelize','exports','name','system-','STRING'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x1526,0xc1));var _0x6152=function(_0x41ab22,_0x23e9da){_0x41ab22=_0x41ab22-0x0;var _0x1aa618=_0x1526[_0x41ab22];return _0x1aa618;};'use strict';var Sequelize=require(_0x6152('0x0'));module[_0x6152('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6152('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2ce71f){return _0x6152('0x3')+this['getDataValue'](_0x6152('0x2'))+'-';}},'description':{'type':Sequelize[_0x6152('0x4')]},'callerIdAll':{'type':Sequelize[_0x6152('0x4')]},'VoiceExtensionId':{'type':Sequelize[_0x6152('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 36c8360..3783a16 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 _0xb7aa=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','${EXTEN:','length','charAt','update','system-','VoiceExtensionId','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','options','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','send','index','VoicePrefix','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','includeAll','rows','show','params','rawAttributes','keys','find','catch','describe','create','sequelize','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error'];(function(_0x29b6bc,_0x2967d1){var _0x5fa66d=function(_0x1bb198){while(--_0x1bb198){_0x29b6bc['push'](_0x29b6bc['shift']());}};_0x5fa66d(++_0x2967d1);}(_0xb7aa,0x11a));var _0xab7a=function(_0x797339,_0x4dc36d){_0x797339=_0x797339-0x0;var _0x24be8c=_0xb7aa[_0x797339];return _0x24be8c;};'use strict';var emlformat=require(_0xab7a('0x0'));var rimraf=require(_0xab7a('0x1'));var zipdir=require(_0xab7a('0x2'));var jsonpatch=require(_0xab7a('0x3'));var rp=require(_0xab7a('0x4'));var moment=require(_0xab7a('0x5'));var BPromise=require(_0xab7a('0x6'));var Mustache=require(_0xab7a('0x7'));var util=require(_0xab7a('0x8'));var path=require(_0xab7a('0x9'));var sox=require('sox');var csv=require(_0xab7a('0xa'));var ejs=require(_0xab7a('0xb'));var fs=require('fs');var fs_extra=require(_0xab7a('0xc'));var _=require(_0xab7a('0xd'));var squel=require('squel');var crypto=require(_0xab7a('0xe'));var jsforce=require(_0xab7a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xab7a('0xa'));var querystring=require(_0xab7a('0x10'));var Papa=require(_0xab7a('0x11'));var Redis=require(_0xab7a('0x12'));var authService=require(_0xab7a('0x13'));var qs=require(_0xab7a('0x14'));var as=require(_0xab7a('0x15'));var hardwareService=require(_0xab7a('0x16'));var logger=require(_0xab7a('0x17'))(_0xab7a('0x18'));var utils=require('../../config/utils');var config=require(_0xab7a('0x19'));var licenseUtil=require(_0xab7a('0x1a'));var db=require(_0xab7a('0x1b'))['db'];config[_0xab7a('0x1c')]=_['defaults'](config[_0xab7a('0x1c')],{'host':_0xab7a('0x1d'),'port':0x18eb});var socket=require(_0xab7a('0x1e'))(new Redis(config[_0xab7a('0x1c')]));require('./voicePrefix.socket')[_0xab7a('0x1f')](socket);function respondWithStatusCode(_0x1cc43f,_0x4a78b8){_0x4a78b8=_0x4a78b8||0xcc;return function(_0x899a95){if(_0x899a95){return _0x1cc43f[_0xab7a('0x20')](_0x4a78b8);}return _0x1cc43f[_0xab7a('0x21')](_0x4a78b8)[_0xab7a('0x22')]();};}function respondWithResult(_0x30146c,_0x522f10){_0x522f10=_0x522f10||0xc8;return function(_0x198e78){if(_0x198e78){return _0x30146c[_0xab7a('0x21')](_0x522f10)['json'](_0x198e78);}};}function respondWithFilteredResult(_0x203980,_0x177c90){return function(_0x187f51){if(_0x187f51){var _0xc3bb41=typeof _0x177c90[_0xab7a('0x23')]===_0xab7a('0x24')&&typeof _0x177c90[_0xab7a('0x25')]==='undefined';var _0x41f3c0=_0x187f51[_0xab7a('0x26')];var _0x16ce64=_0xc3bb41?0x0:_0x177c90[_0xab7a('0x23')];var _0x2fa287=_0xc3bb41?_0x187f51[_0xab7a('0x26')]:_0x177c90[_0xab7a('0x23')]+_0x177c90[_0xab7a('0x25')];var _0x169988;if(_0x2fa287>=_0x41f3c0){_0x2fa287=_0x41f3c0;_0x169988=0xc8;}else{_0x169988=0xce;}_0x203980[_0xab7a('0x21')](_0x169988);return _0x203980[_0xab7a('0x27')]('Content-Range',_0x16ce64+'-'+_0x2fa287+'/'+_0x41f3c0)['json'](_0x187f51);}return null;};}function patchUpdates(_0x5c4c3e){return function(_0x60ad2b){try{jsonpatch[_0xab7a('0x28')](_0x60ad2b,_0x5c4c3e,!![]);}catch(_0x33f484){return BPromise[_0xab7a('0x29')](_0x33f484);}return _0x60ad2b[_0xab7a('0x2a')]();};}function saveUpdates(_0x8c1e1f,_0x3324f2){return function(_0x533680){if(_0x533680){return _0x533680['update'](_0x8c1e1f)[_0xab7a('0x2b')](function(_0x4a13dd){return _0x4a13dd;});}return null;};}function removeEntity(_0x4d8e6b,_0x249904){return function(_0x570a8b){if(_0x570a8b){return _0x570a8b[_0xab7a('0x2c')]()[_0xab7a('0x2b')](function(){var _0x81dc99=_0x570a8b[_0xab7a('0x2d')]({'plain':!![]});var _0x2b0885='VoicePrefixes';return db[_0xab7a('0x2e')][_0xab7a('0x2c')]({'where':{'type':_0x2b0885,'resourceId':_0x81dc99['id']}})[_0xab7a('0x2b')](function(){return _0x570a8b;});})['then'](function(){_0x4d8e6b[_0xab7a('0x21')](0xcc)[_0xab7a('0x22')]();});}};}function handleEntityNotFound(_0x32945c,_0x599375){return function(_0x5d16f4){if(!_0x5d16f4){_0x32945c[_0xab7a('0x20')](0x194);}return _0x5d16f4;};}function handleError(_0x5b5501,_0x3f5219){_0x3f5219=_0x3f5219||0x1f4;return function(_0x3dfbaf){logger['error'](_0x3dfbaf[_0xab7a('0x2f')]);if(_0x3dfbaf[_0xab7a('0x30')]){delete _0x3dfbaf[_0xab7a('0x30')];}_0x5b5501[_0xab7a('0x21')](_0x3f5219)[_0xab7a('0x31')](_0x3dfbaf);};}exports[_0xab7a('0x32')]=function(_0x58a509,_0x44ba02){var _0x554154={},_0x304af8={},_0x3a7c55={'count':0x0,'rows':[]};var _0x20a0a8=_['map'](db[_0xab7a('0x33')]['rawAttributes'],function(_0x59fb42){return{'name':_0x59fb42[_0xab7a('0x34')],'type':_0x59fb42[_0xab7a('0x35')][_0xab7a('0x36')]};});_0x304af8[_0xab7a('0x37')]=_[_0xab7a('0x38')](_0x20a0a8,_0xab7a('0x30'));_0x304af8[_0xab7a('0x39')]=_['keys'](_0x58a509[_0xab7a('0x39')]);_0x304af8[_0xab7a('0x3a')]=_[_0xab7a('0x3b')](_0x304af8[_0xab7a('0x37')],_0x304af8['query']);_0x554154[_0xab7a('0x3c')]=_[_0xab7a('0x3b')](_0x304af8[_0xab7a('0x37')],qs['fields'](_0x58a509[_0xab7a('0x39')][_0xab7a('0x3d')]));_0x554154[_0xab7a('0x3c')]=_0x554154[_0xab7a('0x3c')]['length']?_0x554154[_0xab7a('0x3c')]:_0x304af8[_0xab7a('0x37')];if(!_0x58a509[_0xab7a('0x39')]['hasOwnProperty']('nolimit')){_0x554154[_0xab7a('0x25')]=qs['limit'](_0x58a509[_0xab7a('0x39')][_0xab7a('0x25')]);_0x554154['offset']=qs['offset'](_0x58a509[_0xab7a('0x39')][_0xab7a('0x23')]);}_0x554154[_0xab7a('0x3e')]=qs[_0xab7a('0x3f')](_0x58a509['query']['sort']);_0x554154[_0xab7a('0x40')]=qs[_0xab7a('0x3a')](_[_0xab7a('0x41')](_0x58a509[_0xab7a('0x39')],_0x304af8['filters']),_0x20a0a8);if(_0x58a509[_0xab7a('0x39')][_0xab7a('0x42')]){_0x554154[_0xab7a('0x40')]=_['merge'](_0x554154[_0xab7a('0x40')],{'$or':_[_0xab7a('0x38')](_0x20a0a8,function(_0x2c42a9){if(_0x2c42a9[_0xab7a('0x35')]!=='VIRTUAL'){var _0x1e431d={};_0x1e431d[_0x2c42a9['name']]={'$like':'%'+_0x58a509[_0xab7a('0x39')][_0xab7a('0x42')]+'%'};return _0x1e431d;}})});}_0x554154=_[_0xab7a('0x43')]({},_0x554154,_0x58a509['options']);var _0x103826={'where':_0x554154[_0xab7a('0x40')]};return db[_0xab7a('0x33')][_0xab7a('0x26')](_0x103826)['then'](function(_0x2ddf18){_0x3a7c55[_0xab7a('0x26')]=_0x2ddf18;if(_0x58a509[_0xab7a('0x39')][_0xab7a('0x44')]){_0x554154['include']=[{'all':!![]}];}return db[_0xab7a('0x33')]['findAll'](_0x554154);})[_0xab7a('0x2b')](function(_0x4d980a){_0x3a7c55[_0xab7a('0x45')]=_0x4d980a;return _0x3a7c55;})[_0xab7a('0x2b')](respondWithFilteredResult(_0x44ba02,_0x554154))['catch'](handleError(_0x44ba02,null));};exports[_0xab7a('0x46')]=function(_0x600bb8,_0x1e890b){var _0x2e31e9={'raw':![],'where':{'id':_0x600bb8[_0xab7a('0x47')]['id']}},_0xe9afc0={};_0xe9afc0['model']=_['keys'](db[_0xab7a('0x33')][_0xab7a('0x48')]);_0xe9afc0[_0xab7a('0x39')]=_[_0xab7a('0x49')](_0x600bb8[_0xab7a('0x39')]);_0xe9afc0[_0xab7a('0x3a')]=_[_0xab7a('0x3b')](_0xe9afc0[_0xab7a('0x37')],_0xe9afc0[_0xab7a('0x39')]);_0x2e31e9[_0xab7a('0x3c')]=_[_0xab7a('0x3b')](_0xe9afc0[_0xab7a('0x37')],qs['fields'](_0x600bb8['query'][_0xab7a('0x3d')]));_0x2e31e9[_0xab7a('0x3c')]=_0x2e31e9[_0xab7a('0x3c')]['length']?_0x2e31e9[_0xab7a('0x3c')]:_0xe9afc0['model'];if(_0x600bb8[_0xab7a('0x39')][_0xab7a('0x44')]){_0x2e31e9['include']=[{'all':!![]}];}_0x2e31e9=_['merge']({},_0x2e31e9,_0x600bb8['options']);return db[_0xab7a('0x33')][_0xab7a('0x4a')](_0x2e31e9)['then'](handleEntityNotFound(_0x1e890b,null))['then'](respondWithResult(_0x1e890b,null))[_0xab7a('0x4b')](handleError(_0x1e890b,null));};exports[_0xab7a('0x2c')]=function(_0xf7344c,_0x1ba1ef){return db[_0xab7a('0x33')]['find']({'where':{'id':_0xf7344c['params']['id']}})[_0xab7a('0x2b')](handleEntityNotFound(_0x1ba1ef,null))['then'](removeEntity(_0x1ba1ef,null))[_0xab7a('0x4b')](handleError(_0x1ba1ef,null));};exports['describe']=function(_0x32c1b7,_0x3f73b8){return db[_0xab7a('0x33')][_0xab7a('0x4c')]()[_0xab7a('0x2b')](respondWithResult(_0x3f73b8,null))[_0xab7a('0x4b')](handleError(_0x3f73b8,null));};exports[_0xab7a('0x4d')]=function(_0x2bfd65,_0x33f8e7){var _0xea5de5;return db[_0xab7a('0x4e')]['transaction'](function(_0x3bfdae){return db[_0xab7a('0x33')][_0xab7a('0x4d')](_0x2bfd65[_0xab7a('0x4f')],{'transaction':_0x3bfdae})['then'](function(_0x57b506){_0xea5de5=_0x57b506['get']({'plain':!![]});return db[_0xab7a('0x50')][_0xab7a('0x4a')]({'where':{'id':_0xea5de5['VoiceExtensionId']},'raw':!![]})[_0xab7a('0x2b')](function(_0x28d5e9){return createVoicePrefixExtensions(_0xea5de5,_0x28d5e9,_0x3bfdae);});});})[_0xab7a('0x2b')](function(){var _0x3a501b=_0x2bfd65[_0xab7a('0x51')][_0xab7a('0x2d')]({'plain':!![]});if(!_0x3a501b)throw new Error(_0xab7a('0x52'));if(_0x3a501b[_0xab7a('0x53')]===_0xab7a('0x51')){var _0x3fb2fe=_0xea5de5;return db[_0xab7a('0x54')][_0xab7a('0x4a')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3a501b['userProfileId']},'raw':!![]})[_0xab7a('0x2b')](function(_0x1ca03c){if(_0x1ca03c&&_0x1ca03c[_0xab7a('0x55')]===0x0){return db['UserProfileResource'][_0xab7a('0x4d')]({'name':_0x3fb2fe['name'],'resourceId':_0x3fb2fe['id'],'type':_0x1ca03c[_0xab7a('0x30')],'sectionId':_0x1ca03c['id']},{})['then'](function(){return _0xea5de5;});}else{return _0xea5de5;}})[_0xab7a('0x4b')](function(_0x4d2ebb){logger[_0xab7a('0x56')](_0xab7a('0x57'),_0x4d2ebb);throw _0x4d2ebb;});}return _0xea5de5;})[_0xab7a('0x2b')](respondWithResult(_0x33f8e7,null))[_0xab7a('0x4b')](handleError(_0x33f8e7,null));};function Extension(_0x17aa25,_0x13762f,_0x23055d,_0xfb96fa){this[_0xab7a('0x58')]='from-sip';this['exten']=_0x17aa25;this['app']=_0x23055d;this[_0xab7a('0x35')]=_0xab7a('0x59');this['description']=_0xab7a('0x5a');this[_0xab7a('0x5b')]=_0x13762f;this[_0xab7a('0x5c')]=_0xfb96fa;}function createVoicePrefixExtensions(_0x56a225,_0x14fb46,_0x107677){return new BPromise(function(_0x1db24b,_0x5312e4){var _0x4c84ff=new Extension(formatPrefixName(_0x56a225[_0xab7a('0x5d')]),0x1,_0xab7a('0x5e'),_0xab7a('0x5f'));_0x4c84ff[_0xab7a('0x60')]=_0x56a225['id'];return db[_0xab7a('0x50')][_0xab7a('0x4d')](_0x4c84ff,{'transaction':_0x107677})[_0xab7a('0x2b')](function(_0x7e765a){var _0x37db85=_0x7e765a[_0xab7a('0x2d')]({'plain':!![]});var _0x272dde=_['map'](addVoicePrefixExtensions(_0x56a225,_0x14fb46),function(_0x4263ac){_0x4263ac['VoiceExtensionId']=_0x37db85['id'];_0x4263ac[_0xab7a('0x60')]=_0x56a225['id'];return _0x4263ac;});return db[_0xab7a('0x50')][_0xab7a('0x61')](_0x272dde,{'transaction':_0x107677})['then'](function(_0x520c83){if(!_0x520c83){return _0x5312e4('Extensions\x20creation\x20failed');}else{return _0x1db24b(_0x520c83);}})['catch'](function(_0x98441){return _0x5312e4(_0x98441);});});;});};function addVoicePrefixExtensions(_0x274e91,_0x4a0461){var _0x40d487=[];var _0xaae5c2=formatPrefixName(_0x274e91[_0xab7a('0x5d')]);_0x40d487[_0xab7a('0x62')](new Extension(_0xaae5c2,0x2,_0xab7a('0x63'),_0xab7a('0x64')+_0x274e91[_0xab7a('0x30')]));if(_0x274e91[_0xab7a('0x65')]){_0x40d487[_0xab7a('0x62')](new Extension(_0xaae5c2,0x3,_0xab7a('0x63'),'PREFIX-CALLERIDALL='+_0x274e91[_0xab7a('0x65')]));}else{_0x40d487[_0xab7a('0x62')](new Extension(_0xaae5c2,0x3,_0xab7a('0x5e'),_0xab7a('0x66')));}_0x40d487[_0xab7a('0x62')](new Extension(_0xaae5c2,0x4,'goto',_0x4a0461[_0xab7a('0x58')]+','+_0xab7a('0x67')+(0x8+_0x274e91[_0xab7a('0x30')]['length'])+'}'+','+0x1));return _0x40d487;}function formatPrefixName(_0x48eb78){var _0x40d4f0='_';for(var _0x4cc81a=0x0;_0x4cc81a<_0x48eb78[_0xab7a('0x68')];_0x4cc81a++){if(_0x48eb78['charAt'](_0x4cc81a)=='-'){_0x40d4f0+=_0x48eb78[_0xab7a('0x69')](_0x4cc81a);}else{_0x40d4f0+='['+_0x48eb78[_0xab7a('0x69')](_0x4cc81a)+']';}}_0x40d4f0+='.';return _0x40d4f0;}exports[_0xab7a('0x6a')]=function(_0xfb3730,_0x38ef99,_0x354556){var _0xb98aa8=_0xfb3730['body'];_0xb98aa8['prefix']=_0xab7a('0x6b')+_0xb98aa8[_0xab7a('0x30')]+'-';return db[_0xab7a('0x4e')]['transaction'](function(_0x2c54c3){return db['VoicePrefix'][_0xab7a('0x6a')](_0xb98aa8,{'where':{'id':_0xb98aa8['id']},'transaction':_0x2c54c3})[_0xab7a('0x2b')](function(){return db[_0xab7a('0x50')][_0xab7a('0x2c')]({'where':{'VoicePrefixId':_0xb98aa8['id']},'transaction':_0x2c54c3})[_0xab7a('0x2b')](function(){return db[_0xab7a('0x50')][_0xab7a('0x4a')]({'where':{'id':_0xb98aa8[_0xab7a('0x6c')]},'raw':!![]})[_0xab7a('0x2b')](function(_0x4d6b8c){return createVoicePrefixExtensions(_0xb98aa8,_0x4d6b8c,_0x2c54c3);});});});})[_0xab7a('0x2b')](function(){return db[_0xab7a('0x33')][_0xab7a('0x6d')](_0xb98aa8['id']);})['then'](respondWithResult(_0x38ef99,null))[_0xab7a('0x4b')](handleError(_0x38ef99,null));};exports[_0xab7a('0x6e')]=function(_0x368608,_0x144332,_0x5c3255){return db[_0xab7a('0x33')][_0xab7a('0x4a')]({'where':{'id':_0x368608[_0xab7a('0x47')]['id']}})[_0xab7a('0x2b')](handleEntityNotFound(_0x144332,null))[_0xab7a('0x2b')](function(_0x3c48f1){if(_0x3c48f1){return _0x3c48f1[_0xab7a('0x6e')](_0x368608[_0xab7a('0x4f')][_0xab7a('0x6f')],_['omit'](_0x368608['body'],[_0xab7a('0x6f'),'id'])||{})[_0xab7a('0x70')](function(_0x5ef7f1){for(var _0x648e7f=0x0;_0x648e7f<_0x368608['body'][_0xab7a('0x6f')]['length'];_0x648e7f+=0x1){socket[_0xab7a('0x71')](_0xab7a('0x72'),{'UserId':Number(_0x368608[_0xab7a('0x4f')][_0xab7a('0x6f')][_0x648e7f]),'VoicePrefixId':Number(_0x368608[_0xab7a('0x47')]['id'])});}return _0x5ef7f1;});}})[_0xab7a('0x2b')](respondWithResult(_0x144332,null))[_0xab7a('0x4b')](handleError(_0x144332,null));};exports[_0xab7a('0x73')]=function(_0x57fa58,_0x28533b,_0x392d61){return db['VoicePrefix'][_0xab7a('0x4a')]({'where':{'id':_0x57fa58[_0xab7a('0x47')]['id']}})['then'](handleEntityNotFound(_0x28533b,null))[_0xab7a('0x2b')](function(_0x4e186b){if(_0x4e186b){return _0x4e186b[_0xab7a('0x73')](_0x57fa58[_0xab7a('0x39')]['ids'])['then'](function(){if(_['isArray'](_0x57fa58[_0xab7a('0x39')][_0xab7a('0x6f')])){for(var _0x1c4a7f=0x0;_0x1c4a7f<_0x57fa58['query']['ids'][_0xab7a('0x68')];_0x1c4a7f+=0x1){socket[_0xab7a('0x71')](_0xab7a('0x74'),{'UserId':Number(_0x57fa58['query'][_0xab7a('0x6f')][_0x1c4a7f]),'VoicePrefixId':Number(_0x57fa58[_0xab7a('0x47')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x57fa58[_0xab7a('0x39')][_0xab7a('0x6f')]),'VoicePrefixId':Number(_0x57fa58[_0xab7a('0x47')]['id'])});}});}})[_0xab7a('0x2b')](respondWithStatusCode(_0x28533b,null))[_0xab7a('0x4b')](handleError(_0x28533b,null));};exports[_0xab7a('0x75')]=function(_0x3f3556,_0x246127,_0x24d250){var _0x27a754={};var _0xda9552={};var _0x64a146;var _0x20f378;return db[_0xab7a('0x33')][_0xab7a('0x76')]({'where':{'id':_0x3f3556[_0xab7a('0x47')]['id']}})[_0xab7a('0x2b')](handleEntityNotFound(_0x246127,null))[_0xab7a('0x2b')](function(_0x3c5d4a){if(_0x3c5d4a){_0x64a146=_0x3c5d4a;_0xda9552[_0xab7a('0x37')]=_[_0xab7a('0x49')](db[_0xab7a('0x77')][_0xab7a('0x48')]);_0xda9552[_0xab7a('0x39')]=_[_0xab7a('0x49')](_0x3f3556[_0xab7a('0x39')]);_0xda9552[_0xab7a('0x3a')]=_[_0xab7a('0x3b')](_0xda9552[_0xab7a('0x37')],_0xda9552[_0xab7a('0x39')]);_0x27a754['attributes']=_[_0xab7a('0x3b')](_0xda9552['model'],qs[_0xab7a('0x3d')](_0x3f3556[_0xab7a('0x39')][_0xab7a('0x3d')]));_0x27a754[_0xab7a('0x3c')]=_0x27a754[_0xab7a('0x3c')][_0xab7a('0x68')]?_0x27a754[_0xab7a('0x3c')]:_0xda9552['model'];_0x27a754['order']=qs[_0xab7a('0x3f')](_0x3f3556[_0xab7a('0x39')][_0xab7a('0x3f')]);_0x27a754[_0xab7a('0x40')]=qs[_0xab7a('0x3a')](_[_0xab7a('0x41')](_0x3f3556['query'],_0xda9552[_0xab7a('0x3a')]));if(_0x3f3556[_0xab7a('0x39')]['filter']){_0x27a754[_0xab7a('0x40')]=_[_0xab7a('0x43')](_0x27a754[_0xab7a('0x40')],{'$or':_['map'](_0x27a754[_0xab7a('0x3c')],function(_0x5ec87d){var _0x16f9ee={};_0x16f9ee[_0x5ec87d]={'$like':'%'+_0x3f3556[_0xab7a('0x39')]['filter']+'%'};return _0x16f9ee;})});}_0x27a754=_[_0xab7a('0x43')]({},_0x27a754,_0x3f3556[_0xab7a('0x78')]);return _0x64a146[_0xab7a('0x75')](_0x27a754);}})[_0xab7a('0x2b')](function(_0x3dd12f){if(_0x3dd12f){_0x20f378=_0x3dd12f['length'];if(!_0x3f3556['query'][_0xab7a('0x79')](_0xab7a('0x7a'))){_0x27a754[_0xab7a('0x25')]=qs[_0xab7a('0x25')](_0x3f3556[_0xab7a('0x39')][_0xab7a('0x25')]);_0x27a754[_0xab7a('0x23')]=qs[_0xab7a('0x23')](_0x3f3556[_0xab7a('0x39')][_0xab7a('0x23')]);}return _0x64a146[_0xab7a('0x75')](_0x27a754);}})['then'](function(_0x61ef85){if(_0x61ef85){return _0x61ef85?{'count':_0x20f378,'rows':_0x61ef85}:null;}})[_0xab7a('0x2b')](respondWithResult(_0x246127,null))[_0xab7a('0x4b')](handleError(_0x246127,null));}; \ No newline at end of file +var _0x6836=['filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','sequelize','transaction','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoicePrefixes','userProfileId','autoAssociation','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','push','callerIdAll','goto','${EXTEN:','charAt','body','system-','addAgents','ids','emit','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x2f17cf,_0x2112a0){var _0x306a1b=function(_0x3e5f2b){while(--_0x3e5f2b){_0x2f17cf['push'](_0x2f17cf['shift']());}};_0x306a1b(++_0x2112a0);}(_0x6836,0x1c0));var _0x6683=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x6836[_0x1beef3];return _0x5af964;};'use strict';var emlformat=require(_0x6683('0x0'));var rimraf=require(_0x6683('0x1'));var zipdir=require(_0x6683('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6683('0x3'));var moment=require('moment');var BPromise=require(_0x6683('0x4'));var Mustache=require('mustache');var util=require(_0x6683('0x5'));var path=require('path');var sox=require(_0x6683('0x6'));var csv=require(_0x6683('0x7'));var ejs=require(_0x6683('0x8'));var fs=require('fs');var fs_extra=require(_0x6683('0x9'));var _=require('lodash');var squel=require(_0x6683('0xa'));var crypto=require(_0x6683('0xb'));var jsforce=require(_0x6683('0xc'));var deskjs=require(_0x6683('0xd'));var toCsv=require(_0x6683('0x7'));var querystring=require(_0x6683('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6683('0xf'));var qs=require(_0x6683('0x10'));var as=require(_0x6683('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6683('0x12'))('api');var utils=require(_0x6683('0x13'));var config=require(_0x6683('0x14'));var licenseUtil=require(_0x6683('0x15'));var db=require(_0x6683('0x16'))['db'];config[_0x6683('0x17')]=_[_0x6683('0x18')](config[_0x6683('0x17')],{'host':_0x6683('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6683('0x17')]));require(_0x6683('0x1a'))[_0x6683('0x1b')](socket);function respondWithStatusCode(_0x28985f,_0x2f6419){_0x2f6419=_0x2f6419||0xcc;return function(_0x5ea3c3){if(_0x5ea3c3){return _0x28985f[_0x6683('0x1c')](_0x2f6419);}return _0x28985f[_0x6683('0x1d')](_0x2f6419)[_0x6683('0x1e')]();};}function respondWithResult(_0x11fdef,_0xee9bd4){_0xee9bd4=_0xee9bd4||0xc8;return function(_0x1a689d){if(_0x1a689d){return _0x11fdef[_0x6683('0x1d')](_0xee9bd4)[_0x6683('0x1f')](_0x1a689d);}};}function respondWithFilteredResult(_0x47466b,_0xe808ff){return function(_0x4cad41){if(_0x4cad41){var _0x3afbec=typeof _0xe808ff[_0x6683('0x20')]===_0x6683('0x21')&&typeof _0xe808ff[_0x6683('0x22')]==='undefined';var _0x2dabc1=_0x4cad41[_0x6683('0x23')];var _0x410692=_0x3afbec?0x0:_0xe808ff[_0x6683('0x20')];var _0x258708=_0x3afbec?_0x4cad41[_0x6683('0x23')]:_0xe808ff[_0x6683('0x20')]+_0xe808ff[_0x6683('0x22')];var _0x1978a9;if(_0x258708>=_0x2dabc1){_0x258708=_0x2dabc1;_0x1978a9=0xc8;}else{_0x1978a9=0xce;}_0x47466b[_0x6683('0x1d')](_0x1978a9);return _0x47466b[_0x6683('0x24')](_0x6683('0x25'),_0x410692+'-'+_0x258708+'/'+_0x2dabc1)[_0x6683('0x1f')](_0x4cad41);}return null;};}function patchUpdates(_0x3b63e7){return function(_0x10b7c0){try{jsonpatch[_0x6683('0x26')](_0x10b7c0,_0x3b63e7,!![]);}catch(_0x55aeb3){return BPromise[_0x6683('0x27')](_0x55aeb3);}return _0x10b7c0[_0x6683('0x28')]();};}function saveUpdates(_0x49c1ce,_0x3250e5){return function(_0x4579d9){if(_0x4579d9){return _0x4579d9[_0x6683('0x29')](_0x49c1ce)['then'](function(_0x3b005e){return _0x3b005e;});}return null;};}function removeEntity(_0x2a2243,_0x43879e){return function(_0xd93a1){if(_0xd93a1){return _0xd93a1['destroy']()[_0x6683('0x2a')](function(){var _0x40959d=_0xd93a1[_0x6683('0x2b')]({'plain':!![]});var _0x234d8f='VoicePrefixes';return db[_0x6683('0x2c')][_0x6683('0x2d')]({'where':{'type':_0x234d8f,'resourceId':_0x40959d['id']}})[_0x6683('0x2a')](function(){return _0xd93a1;});})[_0x6683('0x2a')](function(){_0x2a2243[_0x6683('0x1d')](0xcc)[_0x6683('0x1e')]();});}};}function handleEntityNotFound(_0x343f4e,_0xda3a48){return function(_0x1d2b1e){if(!_0x1d2b1e){_0x343f4e['sendStatus'](0x194);}return _0x1d2b1e;};}function handleError(_0x150b8f,_0x1f57fa){_0x1f57fa=_0x1f57fa||0x1f4;return function(_0x48a4f3){logger[_0x6683('0x2e')](_0x48a4f3[_0x6683('0x2f')]);if(_0x48a4f3['name']){delete _0x48a4f3[_0x6683('0x30')];}_0x150b8f['status'](_0x1f57fa)[_0x6683('0x31')](_0x48a4f3);};}exports[_0x6683('0x32')]=function(_0x27fd8f,_0x268c54){var _0x5e6fd7={},_0xd001af={},_0x4748d8={'count':0x0,'rows':[]};var _0x1bc932=_[_0x6683('0x33')](db[_0x6683('0x34')][_0x6683('0x35')],function(_0xaa6a8c){return{'name':_0xaa6a8c[_0x6683('0x36')],'type':_0xaa6a8c[_0x6683('0x37')][_0x6683('0x38')]};});_0xd001af[_0x6683('0x39')]=_[_0x6683('0x33')](_0x1bc932,_0x6683('0x30'));_0xd001af[_0x6683('0x3a')]=_[_0x6683('0x3b')](_0x27fd8f['query']);_0xd001af[_0x6683('0x3c')]=_['intersection'](_0xd001af['model'],_0xd001af[_0x6683('0x3a')]);_0x5e6fd7[_0x6683('0x3d')]=_[_0x6683('0x3e')](_0xd001af[_0x6683('0x39')],qs[_0x6683('0x3f')](_0x27fd8f[_0x6683('0x3a')][_0x6683('0x3f')]));_0x5e6fd7[_0x6683('0x3d')]=_0x5e6fd7['attributes'][_0x6683('0x40')]?_0x5e6fd7[_0x6683('0x3d')]:_0xd001af[_0x6683('0x39')];if(!_0x27fd8f['query']['hasOwnProperty'](_0x6683('0x41'))){_0x5e6fd7['limit']=qs[_0x6683('0x22')](_0x27fd8f[_0x6683('0x3a')]['limit']);_0x5e6fd7[_0x6683('0x20')]=qs[_0x6683('0x20')](_0x27fd8f[_0x6683('0x3a')][_0x6683('0x20')]);}_0x5e6fd7[_0x6683('0x42')]=qs[_0x6683('0x43')](_0x27fd8f[_0x6683('0x3a')]['sort']);_0x5e6fd7[_0x6683('0x44')]=qs[_0x6683('0x3c')](_[_0x6683('0x45')](_0x27fd8f['query'],_0xd001af['filters']),_0x1bc932);if(_0x27fd8f[_0x6683('0x3a')][_0x6683('0x46')]){_0x5e6fd7['where']=_[_0x6683('0x47')](_0x5e6fd7[_0x6683('0x44')],{'$or':_[_0x6683('0x33')](_0x1bc932,function(_0x517fe3){if(_0x517fe3['type']!==_0x6683('0x48')){var _0x38e148={};_0x38e148[_0x517fe3[_0x6683('0x30')]]={'$like':'%'+_0x27fd8f[_0x6683('0x3a')][_0x6683('0x46')]+'%'};return _0x38e148;}})});}_0x5e6fd7=_[_0x6683('0x47')]({},_0x5e6fd7,_0x27fd8f[_0x6683('0x49')]);var _0xa78996={'where':_0x5e6fd7['where']};return db[_0x6683('0x34')]['count'](_0xa78996)[_0x6683('0x2a')](function(_0x8663ed){_0x4748d8['count']=_0x8663ed;if(_0x27fd8f['query'][_0x6683('0x4a')]){_0x5e6fd7[_0x6683('0x4b')]=[{'all':!![]}];}return db[_0x6683('0x34')][_0x6683('0x4c')](_0x5e6fd7);})[_0x6683('0x2a')](function(_0x1ce2a9){_0x4748d8[_0x6683('0x4d')]=_0x1ce2a9;return _0x4748d8;})['then'](respondWithFilteredResult(_0x268c54,_0x5e6fd7))[_0x6683('0x4e')](handleError(_0x268c54,null));};exports[_0x6683('0x4f')]=function(_0x1d3198,_0x3361e4){var _0x1d1828={'raw':![],'where':{'id':_0x1d3198[_0x6683('0x50')]['id']}},_0x4401e1={};_0x4401e1[_0x6683('0x39')]=_[_0x6683('0x3b')](db[_0x6683('0x34')][_0x6683('0x35')]);_0x4401e1[_0x6683('0x3a')]=_[_0x6683('0x3b')](_0x1d3198[_0x6683('0x3a')]);_0x4401e1[_0x6683('0x3c')]=_[_0x6683('0x3e')](_0x4401e1[_0x6683('0x39')],_0x4401e1['query']);_0x1d1828['attributes']=_['intersection'](_0x4401e1[_0x6683('0x39')],qs[_0x6683('0x3f')](_0x1d3198[_0x6683('0x3a')]['fields']));_0x1d1828[_0x6683('0x3d')]=_0x1d1828[_0x6683('0x3d')][_0x6683('0x40')]?_0x1d1828['attributes']:_0x4401e1[_0x6683('0x39')];if(_0x1d3198[_0x6683('0x3a')]['includeAll']){_0x1d1828['include']=[{'all':!![]}];}_0x1d1828=_['merge']({},_0x1d1828,_0x1d3198['options']);return db[_0x6683('0x34')][_0x6683('0x51')](_0x1d1828)[_0x6683('0x2a')](handleEntityNotFound(_0x3361e4,null))[_0x6683('0x2a')](respondWithResult(_0x3361e4,null))[_0x6683('0x4e')](handleError(_0x3361e4,null));};exports[_0x6683('0x2d')]=function(_0x3a01ed,_0x5a3bba){return db[_0x6683('0x34')][_0x6683('0x51')]({'where':{'id':_0x3a01ed[_0x6683('0x50')]['id']}})[_0x6683('0x2a')](handleEntityNotFound(_0x5a3bba,null))[_0x6683('0x2a')](removeEntity(_0x5a3bba,null))['catch'](handleError(_0x5a3bba,null));};exports[_0x6683('0x52')]=function(_0x2325ce,_0x380dbb){return db[_0x6683('0x34')][_0x6683('0x52')]()[_0x6683('0x2a')](respondWithResult(_0x380dbb,null))[_0x6683('0x4e')](handleError(_0x380dbb,null));};exports[_0x6683('0x53')]=function(_0x228fa3,_0x3f7170){var _0x101626;return db[_0x6683('0x54')][_0x6683('0x55')](function(_0x41d082){return db[_0x6683('0x34')][_0x6683('0x53')](_0x228fa3['body'],{'transaction':_0x41d082})[_0x6683('0x2a')](function(_0x5bb4ee){_0x101626=_0x5bb4ee[_0x6683('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0x6683('0x51')]({'where':{'id':_0x101626[_0x6683('0x56')]},'raw':!![]})['then'](function(_0x2d8aef){return createVoicePrefixExtensions(_0x101626,_0x2d8aef,_0x41d082);});});})[_0x6683('0x2a')](function(){var _0x2d370a=_0x228fa3[_0x6683('0x57')][_0x6683('0x2b')]({'plain':!![]});if(!_0x2d370a)throw new Error(_0x6683('0x58'));if(_0x2d370a[_0x6683('0x59')]===_0x6683('0x57')){var _0x3cf45e=_0x101626;return db['UserProfileSection'][_0x6683('0x51')]({'where':{'name':_0x6683('0x5a'),'userProfileId':_0x2d370a[_0x6683('0x5b')]},'raw':!![]})[_0x6683('0x2a')](function(_0x40dd9e){if(_0x40dd9e&&_0x40dd9e[_0x6683('0x5c')]===0x0){return db[_0x6683('0x2c')][_0x6683('0x53')]({'name':_0x3cf45e[_0x6683('0x30')],'resourceId':_0x3cf45e['id'],'type':_0x40dd9e[_0x6683('0x30')],'sectionId':_0x40dd9e['id']},{})[_0x6683('0x2a')](function(){return _0x101626;});}else{return _0x101626;}})['catch'](function(_0x118ee0){logger[_0x6683('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x118ee0);throw _0x118ee0;});}return _0x101626;})[_0x6683('0x2a')](respondWithResult(_0x3f7170,null))[_0x6683('0x4e')](handleError(_0x3f7170,null));};function Extension(_0x2742fb,_0x3e4e9c,_0x195e1e,_0x2c157b){this[_0x6683('0x5d')]=_0x6683('0x5e');this[_0x6683('0x5f')]=_0x2742fb;this[_0x6683('0x60')]=_0x195e1e;this[_0x6683('0x37')]=_0x6683('0x61');this[_0x6683('0x62')]=_0x6683('0x63');this['priority']=_0x3e4e9c;this[_0x6683('0x64')]=_0x2c157b;}function createVoicePrefixExtensions(_0x198c27,_0x43aa98,_0x609020){return new BPromise(function(_0x44bf65,_0x516726){var _0x4193d1=new Extension(formatPrefixName(_0x198c27[_0x6683('0x65')]),0x1,_0x6683('0x66'),_0x6683('0x67'));_0x4193d1['VoicePrefixId']=_0x198c27['id'];return db['VoiceExtension'][_0x6683('0x53')](_0x4193d1,{'transaction':_0x609020})[_0x6683('0x2a')](function(_0x41ce7f){var _0x40a92b=_0x41ce7f[_0x6683('0x2b')]({'plain':!![]});var _0x379d34=_[_0x6683('0x33')](addVoicePrefixExtensions(_0x198c27,_0x43aa98),function(_0x3a93a7){_0x3a93a7[_0x6683('0x56')]=_0x40a92b['id'];_0x3a93a7[_0x6683('0x68')]=_0x198c27['id'];return _0x3a93a7;});return db[_0x6683('0x69')][_0x6683('0x6a')](_0x379d34,{'transaction':_0x609020})[_0x6683('0x2a')](function(_0x3a2428){if(!_0x3a2428){return _0x516726(_0x6683('0x6b'));}else{return _0x44bf65(_0x3a2428);}})[_0x6683('0x4e')](function(_0x346900){return _0x516726(_0x346900);});});;});};function addVoicePrefixExtensions(_0x340f72,_0x3b29cf){var _0x17b45a=[];var _0x5e0e10=formatPrefixName(_0x340f72['prefix']);_0x17b45a['push'](new Extension(_0x5e0e10,0x2,_0x6683('0x6c'),_0x6683('0x6d')+_0x340f72[_0x6683('0x30')]));if(_0x340f72['callerIdAll']){_0x17b45a[_0x6683('0x6e')](new Extension(_0x5e0e10,0x3,_0x6683('0x6c'),'PREFIX-CALLERIDALL='+_0x340f72[_0x6683('0x6f')]));}else{_0x17b45a[_0x6683('0x6e')](new Extension(_0x5e0e10,0x3,'NoOp','No\x20callerid\x20available'));}_0x17b45a[_0x6683('0x6e')](new Extension(_0x5e0e10,0x4,_0x6683('0x70'),_0x3b29cf['context']+','+_0x6683('0x71')+(0x8+_0x340f72['name'][_0x6683('0x40')])+'}'+','+0x1));return _0x17b45a;}function formatPrefixName(_0x551a40){var _0x12354f='_';for(var _0x5da435=0x0;_0x5da435<_0x551a40[_0x6683('0x40')];_0x5da435++){if(_0x551a40['charAt'](_0x5da435)=='-'){_0x12354f+=_0x551a40[_0x6683('0x72')](_0x5da435);}else{_0x12354f+='['+_0x551a40[_0x6683('0x72')](_0x5da435)+']';}}_0x12354f+='.';return _0x12354f;}exports[_0x6683('0x29')]=function(_0x4ba4c6,_0x4d1631,_0x4748af){var _0x3576f9=_0x4ba4c6[_0x6683('0x73')];_0x3576f9[_0x6683('0x65')]=_0x6683('0x74')+_0x3576f9[_0x6683('0x30')]+'-';return db[_0x6683('0x54')][_0x6683('0x55')](function(_0x55f434){return db[_0x6683('0x34')]['update'](_0x3576f9,{'where':{'id':_0x3576f9['id']},'transaction':_0x55f434})[_0x6683('0x2a')](function(){return db[_0x6683('0x69')]['destroy']({'where':{'VoicePrefixId':_0x3576f9['id']},'transaction':_0x55f434})[_0x6683('0x2a')](function(){return db[_0x6683('0x69')][_0x6683('0x51')]({'where':{'id':_0x3576f9[_0x6683('0x56')]},'raw':!![]})[_0x6683('0x2a')](function(_0x2aca23){return createVoicePrefixExtensions(_0x3576f9,_0x2aca23,_0x55f434);});});});})[_0x6683('0x2a')](function(){return db[_0x6683('0x34')]['findById'](_0x3576f9['id']);})['then'](respondWithResult(_0x4d1631,null))['catch'](handleError(_0x4d1631,null));};exports[_0x6683('0x75')]=function(_0x549cf4,_0x1db250,_0x59d1a6){return db[_0x6683('0x34')]['find']({'where':{'id':_0x549cf4[_0x6683('0x50')]['id']}})['then'](handleEntityNotFound(_0x1db250,null))[_0x6683('0x2a')](function(_0x56a9ea){if(_0x56a9ea){return _0x56a9ea[_0x6683('0x75')](_0x549cf4[_0x6683('0x73')][_0x6683('0x76')],_['omit'](_0x549cf4[_0x6683('0x73')],[_0x6683('0x76'),'id'])||{})['spread'](function(_0x55b2cf){for(var _0x58bcb6=0x0;_0x58bcb6<_0x549cf4[_0x6683('0x73')][_0x6683('0x76')][_0x6683('0x40')];_0x58bcb6+=0x1){socket[_0x6683('0x77')]('userVoicePrefix:save',{'UserId':Number(_0x549cf4[_0x6683('0x73')][_0x6683('0x76')][_0x58bcb6]),'VoicePrefixId':Number(_0x549cf4[_0x6683('0x50')]['id'])});}return _0x55b2cf;});}})[_0x6683('0x2a')](respondWithResult(_0x1db250,null))['catch'](handleError(_0x1db250,null));};exports[_0x6683('0x78')]=function(_0x519ce8,_0x3e0690,_0x2b8724){return db[_0x6683('0x34')][_0x6683('0x51')]({'where':{'id':_0x519ce8[_0x6683('0x50')]['id']}})[_0x6683('0x2a')](handleEntityNotFound(_0x3e0690,null))[_0x6683('0x2a')](function(_0x435eb3){if(_0x435eb3){return _0x435eb3['removeAgents'](_0x519ce8[_0x6683('0x3a')][_0x6683('0x76')])[_0x6683('0x2a')](function(){if(_[_0x6683('0x79')](_0x519ce8[_0x6683('0x3a')][_0x6683('0x76')])){for(var _0x4e38d0=0x0;_0x4e38d0<_0x519ce8['query'][_0x6683('0x76')][_0x6683('0x40')];_0x4e38d0+=0x1){socket[_0x6683('0x77')](_0x6683('0x7a'),{'UserId':Number(_0x519ce8[_0x6683('0x3a')][_0x6683('0x76')][_0x4e38d0]),'VoicePrefixId':Number(_0x519ce8[_0x6683('0x50')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x519ce8[_0x6683('0x3a')][_0x6683('0x76')]),'VoicePrefixId':Number(_0x519ce8['params']['id'])});}});}})[_0x6683('0x2a')](respondWithStatusCode(_0x3e0690,null))['catch'](handleError(_0x3e0690,null));};exports['getAgents']=function(_0x5a7a2d,_0x57694b,_0x43155b){var _0x51a122={};var _0x4cd707={};var _0x6f4a8;var _0x54aab6;return db[_0x6683('0x34')][_0x6683('0x7b')]({'where':{'id':_0x5a7a2d['params']['id']}})['then'](handleEntityNotFound(_0x57694b,null))['then'](function(_0x22273d){if(_0x22273d){_0x6f4a8=_0x22273d;_0x4cd707[_0x6683('0x39')]=_[_0x6683('0x3b')](db[_0x6683('0x7c')][_0x6683('0x35')]);_0x4cd707['query']=_['keys'](_0x5a7a2d[_0x6683('0x3a')]);_0x4cd707['filters']=_['intersection'](_0x4cd707['model'],_0x4cd707[_0x6683('0x3a')]);_0x51a122[_0x6683('0x3d')]=_[_0x6683('0x3e')](_0x4cd707[_0x6683('0x39')],qs['fields'](_0x5a7a2d[_0x6683('0x3a')][_0x6683('0x3f')]));_0x51a122[_0x6683('0x3d')]=_0x51a122['attributes'][_0x6683('0x40')]?_0x51a122['attributes']:_0x4cd707[_0x6683('0x39')];_0x51a122[_0x6683('0x42')]=qs[_0x6683('0x43')](_0x5a7a2d[_0x6683('0x3a')][_0x6683('0x43')]);_0x51a122[_0x6683('0x44')]=qs[_0x6683('0x3c')](_[_0x6683('0x45')](_0x5a7a2d[_0x6683('0x3a')],_0x4cd707[_0x6683('0x3c')]));if(_0x5a7a2d[_0x6683('0x3a')][_0x6683('0x46')]){_0x51a122[_0x6683('0x44')]=_[_0x6683('0x47')](_0x51a122[_0x6683('0x44')],{'$or':_['map'](_0x51a122[_0x6683('0x3d')],function(_0x41fb3a){var _0x673d3f={};_0x673d3f[_0x41fb3a]={'$like':'%'+_0x5a7a2d[_0x6683('0x3a')][_0x6683('0x46')]+'%'};return _0x673d3f;})});}_0x51a122=_[_0x6683('0x47')]({},_0x51a122,_0x5a7a2d[_0x6683('0x49')]);return _0x6f4a8[_0x6683('0x7d')](_0x51a122);}})[_0x6683('0x2a')](function(_0x5cb7dc){if(_0x5cb7dc){_0x54aab6=_0x5cb7dc[_0x6683('0x40')];if(!_0x5a7a2d[_0x6683('0x3a')][_0x6683('0x7e')](_0x6683('0x41'))){_0x51a122['limit']=qs[_0x6683('0x22')](_0x5a7a2d['query'][_0x6683('0x22')]);_0x51a122[_0x6683('0x20')]=qs[_0x6683('0x20')](_0x5a7a2d[_0x6683('0x3a')][_0x6683('0x20')]);}return _0x6f4a8[_0x6683('0x7d')](_0x51a122);}})[_0x6683('0x2a')](function(_0x5c405b){if(_0x5c405b){return _0x5c405b?{'count':_0x54aab6,'rows':_0x5c405b}:null;}})[_0x6683('0x2a')](respondWithResult(_0x57694b,null))[_0x6683('0x4e')](handleError(_0x57694b,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 043d2bb..9244851 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 _0x94be=['emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x196e1b,_0x55fa06){var _0x5e1f18=function(_0x3bdb41){while(--_0x3bdb41){_0x196e1b['push'](_0x196e1b['shift']());}};_0x5e1f18(++_0x55fa06);}(_0x94be,0xd3));var _0xe94b=function(_0x1c2b98,_0x570b0c){_0x1c2b98=_0x1c2b98-0x0;var _0x56bf33=_0x94be[_0x1c2b98];return _0x56bf33;};'use strict';var EventEmitter=require(_0xe94b('0x0'));var VoicePrefix=require(_0xe94b('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe94b('0x2')](0x0);var events={'afterCreate':_0xe94b('0x3'),'afterUpdate':_0xe94b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f9929){return function(_0x37c3a6,_0x29991a,_0x61ab59){VoicePrefixEvents[_0xe94b('0x5')](_0x3f9929+':'+_0x37c3a6['id'],_0x37c3a6);VoicePrefixEvents[_0xe94b('0x5')](_0x3f9929,_0x37c3a6);_0x61ab59(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xe94b('0x6')](e,emitEvent(event));}}module[_0xe94b('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xcafc=['hook','exports','events','../../mysqldb','VoicePrefix','save','update','remove','emit','hasOwnProperty'];(function(_0x29fd52,_0x28fe66){var _0x4683d9=function(_0x4c0e0a){while(--_0x4c0e0a){_0x29fd52['push'](_0x29fd52['shift']());}};_0x4683d9(++_0x28fe66);}(_0xcafc,0x66));var _0xccaf=function(_0x4efccf,_0x1f2bab){_0x4efccf=_0x4efccf-0x0;var _0x2c8b15=_0xcafc[_0x4efccf];return _0x2c8b15;};'use strict';var EventEmitter=require(_0xccaf('0x0'));var VoicePrefix=require(_0xccaf('0x1'))['db'][_0xccaf('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xccaf('0x3'),'afterUpdate':_0xccaf('0x4'),'afterDestroy':_0xccaf('0x5')};function emitEvent(_0x1a1982){return function(_0x2350a8,_0x1805b1,_0x11fa0e){VoicePrefixEvents[_0xccaf('0x6')](_0x1a1982+':'+_0x2350a8['id'],_0x2350a8);VoicePrefixEvents[_0xccaf('0x6')](_0x1a1982,_0x2350a8);_0x11fa0e(null);};}for(var e in events){if(events[_0xccaf('0x7')](e)){var event=events[e];VoicePrefix[_0xccaf('0x8')](e,emitEvent(event));}}module[_0xccaf('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index ad62679..d4e241b 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 _0x160d=['path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x160d,0x118));var _0xd160=function(_0x181850,_0x281503){_0x181850=_0x181850-0x0;var _0x211252=_0x160d[_0x181850];return _0x211252;};'use strict';var _=require(_0xd160('0x0'));var util=require(_0xd160('0x1'));var logger=require(_0xd160('0x2'))('api');var moment=require(_0xd160('0x3'));var BPromise=require(_0xd160('0x4'));var rp=require(_0xd160('0x5'));var fs=require('fs');var path=require(_0xd160('0x6'));var rimraf=require(_0xd160('0x7'));var config=require(_0xd160('0x8'));var attributes=require(_0xd160('0x9'));module['exports']=function(_0x368a5f,_0xbdc243){return _0x368a5f[_0xd160('0xa')](_0xd160('0xb'),attributes,{'tableName':_0xd160('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f81=['VoicePrefix','voice_prefixes','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./voicePrefix.attributes','exports'];(function(_0x11eb2a,_0x4d1442){var _0x1a7dd8=function(_0x12ee2f){while(--_0x12ee2f){_0x11eb2a['push'](_0x11eb2a['shift']());}};_0x1a7dd8(++_0x4d1442);}(_0x4f81,0x18e));var _0x14f8=function(_0x330d06,_0x2cad74){_0x330d06=_0x330d06-0x0;var _0x5f5698=_0x4f81[_0x330d06];return _0x5f5698;};'use strict';var _=require(_0x14f8('0x0'));var util=require('util');var logger=require(_0x14f8('0x1'))(_0x14f8('0x2'));var moment=require('moment');var BPromise=require(_0x14f8('0x3'));var rp=require(_0x14f8('0x4'));var fs=require('fs');var path=require(_0x14f8('0x5'));var rimraf=require(_0x14f8('0x6'));var config=require('../../config/environment');var attributes=require(_0x14f8('0x7'));module[_0x14f8('0x8')]=function(_0x395227,_0x535f1b){return _0x395227['define'](_0x14f8('0x9'),attributes,{'tableName':_0x14f8('0xa'),'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 e3466d6..934d370 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 _0xcb04=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x599f12,_0x5390d6){var _0x59e0b5=function(_0x41900a){while(--_0x41900a){_0x599f12['push'](_0x599f12['shift']());}};_0x59e0b5(++_0x5390d6);}(_0xcb04,0x9a));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4cb0('0x0'));var util=require(_0x4cb0('0x1'));var moment=require(_0x4cb0('0x2'));var BPromise=require(_0x4cb0('0x3'));var rs=require(_0x4cb0('0x4'));var fs=require('fs');var Redis=require(_0x4cb0('0x5'));var db=require(_0x4cb0('0x6'))['db'];var utils=require(_0x4cb0('0x7'));var logger=require(_0x4cb0('0x8'))(_0x4cb0('0x9'));var config=require('../../config/environment');var jayson=require(_0x4cb0('0xa'));var client=jayson[_0x4cb0('0xb')][_0x4cb0('0xc')]({'port':0x232a});config[_0x4cb0('0xd')]=_[_0x4cb0('0xe')](config[_0x4cb0('0xd')],{'host':_0x4cb0('0xf'),'port':0x18eb});var socket=require(_0x4cb0('0x10'))(new Redis(config[_0x4cb0('0xd')]));require(_0x4cb0('0x11'))[_0x4cb0('0x12')](socket);function respondWithRpcPromise(_0x10d679,_0x442a53,_0x24170c){return new BPromise(function(_0xc313bc,_0x57738){return client[_0x4cb0('0x13')](_0x10d679,_0x24170c)[_0x4cb0('0x14')](function(_0x5d5c99){logger[_0x4cb0('0x15')](_0x4cb0('0x16'),_0x442a53,_0x4cb0('0x17'));logger[_0x4cb0('0x18')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x442a53,_0x4cb0('0x17'),JSON[_0x4cb0('0x19')](_0x5d5c99));if(_0x5d5c99[_0x4cb0('0x1a')]){if(_0x5d5c99[_0x4cb0('0x1a')][_0x4cb0('0x1b')]===0x1f4){logger[_0x4cb0('0x1a')](_0x4cb0('0x16'),_0x442a53,_0x5d5c99[_0x4cb0('0x1a')][_0x4cb0('0x1c')]);return _0x57738(_0x5d5c99['error'][_0x4cb0('0x1c')]);}logger[_0x4cb0('0x1a')](_0x4cb0('0x16'),_0x442a53,_0x5d5c99[_0x4cb0('0x1a')]['message']);return _0xc313bc(_0x5d5c99['error'][_0x4cb0('0x1c')]);}else{logger[_0x4cb0('0x15')](_0x4cb0('0x16'),_0x442a53,_0x4cb0('0x17'));_0xc313bc(_0x5d5c99[_0x4cb0('0x1d')][_0x4cb0('0x1c')]);}})[_0x4cb0('0x1e')](function(_0x4cd6b5){logger['error'](_0x4cb0('0x16'),_0x442a53,_0x4cd6b5);_0x57738(_0x4cd6b5);});});} \ No newline at end of file +var _0x3fc6=['request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s'];(function(_0x482a8b,_0x5eb44c){var _0x45c180=function(_0x4e6a76){while(--_0x4e6a76){_0x482a8b['push'](_0x482a8b['shift']());}};_0x45c180(++_0x5eb44c);}(_0x3fc6,0x115));var _0x63fc=function(_0xe1b9fa,_0xf43255){_0xe1b9fa=_0xe1b9fa-0x0;var _0x4a985e=_0x3fc6[_0xe1b9fa];return _0x4a985e;};'use strict';var _=require(_0x63fc('0x0'));var util=require('util');var moment=require(_0x63fc('0x1'));var BPromise=require(_0x63fc('0x2'));var rs=require(_0x63fc('0x3'));var fs=require('fs');var Redis=require(_0x63fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x63fc('0x5'));var logger=require(_0x63fc('0x6'))(_0x63fc('0x7'));var config=require('../../config/environment');var jayson=require(_0x63fc('0x8'));var client=jayson['client'][_0x63fc('0x9')]({'port':0x232a});config[_0x63fc('0xa')]=_[_0x63fc('0xb')](config['redis'],{'host':_0x63fc('0xc'),'port':0x18eb});var socket=require(_0x63fc('0xd'))(new Redis(config[_0x63fc('0xa')]));require(_0x63fc('0xe'))[_0x63fc('0xf')](socket);function respondWithRpcPromise(_0x5f328c,_0x319f1e,_0x544f22){return new BPromise(function(_0x5ad9a0,_0x6b8e8f){return client[_0x63fc('0x10')](_0x5f328c,_0x544f22)[_0x63fc('0x11')](function(_0x4445ba){logger[_0x63fc('0x12')](_0x63fc('0x13'),_0x319f1e,_0x63fc('0x14'));logger[_0x63fc('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x319f1e,_0x63fc('0x14'),JSON[_0x63fc('0x16')](_0x4445ba));if(_0x4445ba[_0x63fc('0x17')]){if(_0x4445ba['error'][_0x63fc('0x18')]===0x1f4){logger[_0x63fc('0x17')](_0x63fc('0x13'),_0x319f1e,_0x4445ba['error'][_0x63fc('0x19')]);return _0x6b8e8f(_0x4445ba[_0x63fc('0x17')][_0x63fc('0x19')]);}logger[_0x63fc('0x17')](_0x63fc('0x13'),_0x319f1e,_0x4445ba[_0x63fc('0x17')][_0x63fc('0x19')]);return _0x5ad9a0(_0x4445ba[_0x63fc('0x17')][_0x63fc('0x19')]);}else{logger[_0x63fc('0x12')](_0x63fc('0x13'),_0x319f1e,_0x63fc('0x14'));_0x5ad9a0(_0x4445ba[_0x63fc('0x1a')][_0x63fc('0x19')]);}})['catch'](function(_0x225c93){logger[_0x63fc('0x17')](_0x63fc('0x13'),_0x319f1e,_0x225c93);_0x6b8e8f(_0x225c93);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index ec29310..47c166f 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 _0x7ee1=['length','./voicePrefix.events','remove','update','register'];(function(_0x44b09d,_0x1d2fdc){var _0x4d9038=function(_0x5df0d5){while(--_0x5df0d5){_0x44b09d['push'](_0x44b09d['shift']());}};_0x4d9038(++_0x1d2fdc);}(_0x7ee1,0xab));var _0x17ee=function(_0x5214b6,_0xc9b988){_0x5214b6=_0x5214b6-0x0;var _0x4365dd=_0x7ee1[_0x5214b6];return _0x4365dd;};'use strict';var VoicePrefixEvents=require(_0x17ee('0x0'));var events=['save',_0x17ee('0x1'),_0x17ee('0x2')];function createListener(_0x455623,_0xe08ab1){return function(_0x45c9e3){_0xe08ab1['emit'](_0x455623,_0x45c9e3);};}function removeListener(_0x3a5743,_0x5172f0){return function(){VoicePrefixEvents['removeListener'](_0x3a5743,_0x5172f0);};}exports[_0x17ee('0x3')]=function(_0x2e4db0){for(var _0x2efefb=0x0,_0x3e6b4c=events[_0x17ee('0x4')];_0x2efefb<_0x3e6b4c;_0x2efefb++){var _0x59b876=events[_0x2efefb];var _0x314088=createListener('voicePrefix:'+_0x59b876,_0x2e4db0);VoicePrefixEvents['on'](_0x59b876,_0x314088);}}; \ No newline at end of file +var _0xb575=['voicePrefix:','./voicePrefix.events','save','update','emit','removeListener','register'];(function(_0x42c5a2,_0x38a2b9){var _0xbaf6e1=function(_0x357391){while(--_0x357391){_0x42c5a2['push'](_0x42c5a2['shift']());}};_0xbaf6e1(++_0x38a2b9);}(_0xb575,0xda));var _0x5b57=function(_0x2d3dcb,_0x1dee96){_0x2d3dcb=_0x2d3dcb-0x0;var _0x301f1a=_0xb575[_0x2d3dcb];return _0x301f1a;};'use strict';var VoicePrefixEvents=require(_0x5b57('0x0'));var events=[_0x5b57('0x1'),'remove',_0x5b57('0x2')];function createListener(_0x4c5b3f,_0x4a644c){return function(_0x585c94){_0x4a644c[_0x5b57('0x3')](_0x4c5b3f,_0x585c94);};}function removeListener(_0x34ae8e,_0x4b91c3){return function(){VoicePrefixEvents[_0x5b57('0x4')](_0x34ae8e,_0x4b91c3);};}exports[_0x5b57('0x5')]=function(_0x501a91){for(var _0x542b77=0x0,_0x672beb=events['length'];_0x542b77<_0x672beb;_0x542b77++){var _0x4232d0=events[_0x542b77];var _0x5dd0c7=createListener(_0x5b57('0x6')+_0x4232d0,_0x501a91);VoicePrefixEvents['on'](_0x4232d0,_0x5dd0c7);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 7349e8e..fea8f31 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 _0xe0a3=['../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','getBlackLists','post','/:id/clone','/:id/teams','addTeams','addAgents','addLists','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeBlackLists','exports','multer','path','Router'];(function(_0x155fd7,_0x542719){var _0x4183bf=function(_0x21ab87){while(--_0x21ab87){_0x155fd7['push'](_0x155fd7['shift']());}};_0x4183bf(++_0x542719);}(_0xe0a3,0x1b5));var _0x3e0a=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xe0a3[_0x68ee8b];return _0x5148f7;};'use strict';var multer=require(_0x3e0a('0x0'));var util=require('util');var path=require(_0x3e0a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3e0a('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3e0a('0x3'));var config=require(_0x3e0a('0x4'));var controller=require(_0x3e0a('0x5'));router[_0x3e0a('0x6')]('/',auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x8')]);router[_0x3e0a('0x6')](_0x3e0a('0x9'),auth[_0x3e0a('0x7')](),controller[_0x3e0a('0xa')]);router[_0x3e0a('0x6')](_0x3e0a('0xb'),auth['isAuthenticated'](),controller[_0x3e0a('0xc')]);router['get'](_0x3e0a('0xd'),auth['isAuthenticated'](),controller[_0x3e0a('0xe')]);router[_0x3e0a('0x6')](_0x3e0a('0xf'),auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x10')]);router[_0x3e0a('0x6')](_0x3e0a('0x11'),auth['isAuthenticated'](),controller['getHopperBlacks']);router['get']('/:id/teams',auth[_0x3e0a('0x7')](),controller['getTeams']);router['get'](_0x3e0a('0x12'),auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x13')]);router[_0x3e0a('0x6')](_0x3e0a('0x14'),auth['isAuthenticated'](),controller[_0x3e0a('0x15')]);router[_0x3e0a('0x6')](_0x3e0a('0x16'),auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x17')]);router[_0x3e0a('0x6')]('/:id/blacklists',auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x18')]);router[_0x3e0a('0x19')]('/',auth[_0x3e0a('0x7')](),controller['create']);router[_0x3e0a('0x19')](_0x3e0a('0x1a'),auth[_0x3e0a('0x7')](),controller['clone']);router['post'](_0x3e0a('0x1b'),auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x1c')]);router[_0x3e0a('0x19')](_0x3e0a('0x12'),auth['isAuthenticated'](),controller[_0x3e0a('0x1d')]);router[_0x3e0a('0x19')](_0x3e0a('0x16'),auth['isAuthenticated'](),controller[_0x3e0a('0x1e')]);router[_0x3e0a('0x19')](_0x3e0a('0x1f'),auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x20')]);router['put'](_0x3e0a('0x9'),auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x21')]);router[_0x3e0a('0x22')](_0x3e0a('0x9'),auth['isAuthenticated'](),controller[_0x3e0a('0x23')]);router['delete']('/:id/teams',auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x24')]);router['delete']('/:id/users',auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x25')]);router[_0x3e0a('0x22')]('/:id/lists',auth[_0x3e0a('0x7')](),controller['removeLists']);router[_0x3e0a('0x22')](_0x3e0a('0x1f'),auth[_0x3e0a('0x7')](),controller[_0x3e0a('0x26')]);module[_0x3e0a('0x27')]=router; \ No newline at end of file +var _0xf60c=['../../config/environment','get','index','/:id','isAuthenticated','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','getBlackLists','post','create','clone','addTeams','addAgents','/:id/lists','addLists','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1274dd,_0x21624b){var _0xc6919=function(_0xa90669){while(--_0xa90669){_0x1274dd['push'](_0x1274dd['shift']());}};_0xc6919(++_0x21624b);}(_0xf60c,0xcf));var _0xcf60=function(_0x3e33c6,_0x1f80e4){_0x3e33c6=_0x3e33c6-0x0;var _0x1190cc=_0xf60c[_0x3e33c6];return _0x1190cc;};'use strict';var multer=require(_0xcf60('0x0'));var util=require(_0xcf60('0x1'));var path=require(_0xcf60('0x2'));var timeout=require(_0xcf60('0x3'));var express=require(_0xcf60('0x4'));var router=express['Router']();var fs_extra=require(_0xcf60('0x5'));var auth=require(_0xcf60('0x6'));var interaction=require(_0xcf60('0x7'));var config=require(_0xcf60('0x8'));var controller=require('./voiceQueue.controller');router[_0xcf60('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf60('0xa')]);router['get'](_0xcf60('0xb'),auth[_0xcf60('0xc')](),controller['show']);router[_0xcf60('0x9')](_0xcf60('0xd'),auth[_0xcf60('0xc')](),controller[_0xcf60('0xe')]);router[_0xcf60('0x9')]('/:id/hopper_histories',auth[_0xcf60('0xc')](),controller[_0xcf60('0xf')]);router[_0xcf60('0x9')](_0xcf60('0x10'),auth[_0xcf60('0xc')](),controller['getHopperFinals']);router[_0xcf60('0x9')](_0xcf60('0x11'),auth[_0xcf60('0xc')](),controller[_0xcf60('0x12')]);router[_0xcf60('0x9')](_0xcf60('0x13'),auth[_0xcf60('0xc')](),controller[_0xcf60('0x14')]);router['get'](_0xcf60('0x15'),auth[_0xcf60('0xc')](),controller[_0xcf60('0x16')]);router[_0xcf60('0x9')](_0xcf60('0x17'),auth[_0xcf60('0xc')](),controller[_0xcf60('0x18')]);router[_0xcf60('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0xcf60('0x19')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xcf60('0x1a')]);router[_0xcf60('0x1b')]('/',auth[_0xcf60('0xc')](),controller[_0xcf60('0x1c')]);router['post']('/:id/clone',auth[_0xcf60('0xc')](),controller[_0xcf60('0x1d')]);router[_0xcf60('0x1b')]('/:id/teams',auth[_0xcf60('0xc')](),controller[_0xcf60('0x1e')]);router[_0xcf60('0x1b')](_0xcf60('0x15'),auth[_0xcf60('0xc')](),controller[_0xcf60('0x1f')]);router[_0xcf60('0x1b')](_0xcf60('0x20'),auth[_0xcf60('0xc')](),controller[_0xcf60('0x21')]);router[_0xcf60('0x1b')](_0xcf60('0x22'),auth[_0xcf60('0xc')](),controller[_0xcf60('0x23')]);router['put']('/:id',auth[_0xcf60('0xc')](),controller[_0xcf60('0x24')]);router[_0xcf60('0x25')](_0xcf60('0xb'),auth['isAuthenticated'](),controller[_0xcf60('0x26')]);router[_0xcf60('0x25')](_0xcf60('0x13'),auth[_0xcf60('0xc')](),controller[_0xcf60('0x27')]);router['delete']('/:id/users',auth[_0xcf60('0xc')](),controller[_0xcf60('0x28')]);router[_0xcf60('0x25')]('/:id/lists',auth['isAuthenticated'](),controller[_0xcf60('0x29')]);router['delete'](_0xcf60('0x22'),auth['isAuthenticated'](),controller[_0xcf60('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 214ad5e..1b7b05f 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 _0x3edb=['dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','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).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','type'];(function(_0x29b30c,_0x4f4b69){var _0x3e0cd3=function(_0x3d21e2){while(--_0x3d21e2){_0x29b30c['push'](_0x29b30c['shift']());}};_0x3e0cd3(++_0x4f4b69);}(_0x3edb,0x1c9));var _0xb3ed=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x3edb[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0xb3ed('0x0'));module[_0xb3ed('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb3ed('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x4'),_0xb3ed('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xb3ed('0x7'),_0xb3ed('0x8'),_0xb3ed('0x9'),'random',_0xb3ed('0xa'),_0xb3ed('0xb'),_0xb3ed('0xc'),_0xb3ed('0xd')),'allowNull':![],'defaultValue':_0xb3ed('0x7'),'set':function(_0x33d48f){this['setDataValue'](_0xb3ed('0xe'),_0x33d48f?_0x33d48f:'rrmemory');},'get':function(){var _0x5402f0=this[_0xb3ed('0xf')](_0xb3ed('0x10'));var _0x240741=this[_0xb3ed('0xf')](_0xb3ed('0x11'));var _0x4e143e=this[_0xb3ed('0xf')]('strategy');if(_0x5402f0==='inbound'){return _0x4e143e;}if(_0x240741===_0xb3ed('0x12')&&_0x4e143e===_0xb3ed('0xa')||_0x240741==='booked'&&_0x4e143e===_0xb3ed('0x13')){return _0x4e143e;}if(_0x240741===_0xb3ed('0x14')||_0x240741===_0xb3ed('0x15')||_0x240741===_0xb3ed('0x16')){return _0x4e143e;}return null;}},'servicelevel':{'type':Sequelize[_0xb3ed('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xb3ed('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xb3ed('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xb3ed('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb3ed('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb3ed('0x3')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x18'),'no',_0xb3ed('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb3ed('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb3ed('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xb3ed('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xb3ed('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xb3ed('0x18'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0xb3ed('0x18'),'no',_0xb3ed('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb3ed('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb3ed('0x6')]},'queue_quantity1':{'type':Sequelize[_0xb3ed('0x6')]},'queue_quantity2':{'type':Sequelize[_0xb3ed('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0xb3ed('0x6')]},'queue_less_than':{'type':Sequelize[_0xb3ed('0x6')]},'periodic_announce':{'type':Sequelize[_0xb3ed('0x1b')],'set':function(_0x4a916a){this[_0xb3ed('0x1c')](_0xb3ed('0x1d'),_0x4a916a?_0x4a916a[_0xb3ed('0x1e')](','):[]);},'get':function(){return this[_0xb3ed('0xf')](_0xb3ed('0x1d'))?this[_0xb3ed('0xf')]('periodic_announce')[_0xb3ed('0x1f')](','):[];}},'joinempty':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':_0xb3ed('0x18'),'set':function(_0x34fea1){this[_0xb3ed('0x1c')](_0xb3ed('0x20'),_0x34fea1?_0x34fea1[_0xb3ed('0x1e')](','):undefined);},'get':function(){return this[_0xb3ed('0xf')](_0xb3ed('0x20'))?this[_0xb3ed('0xf')](_0xb3ed('0x20'))[_0xb3ed('0x1f')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':'no','set':function(_0x239c33){this['setDataValue']('leavewhenempty',_0x239c33?_0x239c33[_0xb3ed('0x1e')](','):undefined);},'get':function(){return this[_0xb3ed('0xf')](_0xb3ed('0x21'))?this[_0xb3ed('0xf')](_0xb3ed('0x21'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb3ed('0x6')]},'description':{'type':Sequelize[_0xb3ed('0x6')]},'acw':{'type':Sequelize[_0xb3ed('0x22')],'defaultValue':0x0,'set':function(_0x3440a0){this['setDataValue']('acw',_0x3440a0);if(_0x3440a0){if(this[_0xb3ed('0xf')](_0xb3ed('0x23'))<0x2){this[_0xb3ed('0x1c')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb3ed('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb3ed('0x22')],'defaultValue':0x0,'comment':_0xb3ed('0x24')},'dialMethod':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x25'),_0xb3ed('0x14'),_0xb3ed('0x16'),'predictive','booked'),'defaultValue':_0xb3ed('0x14'),'comment':_0xb3ed('0x26')},'dialLimitChannel':{'type':Sequelize[_0xb3ed('0x17')](0x4)[_0xb3ed('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb3ed('0x28')},'dialLimitQueue':{'type':Sequelize[_0xb3ed('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb3ed('0x29')},'dialPowerLevel':{'type':Sequelize[_0xb3ed('0x2a')](0x2)[_0xb3ed('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xb3ed('0x2b')},'dialPredictiveOptimization':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x2c'),_0xb3ed('0x2d')),'defaultValue':'dropRate','comment':_0xb3ed('0x2e')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xb3ed('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xb3ed('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb3ed('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb3ed('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xb3ed('0x17')](0x3)[_0xb3ed('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb3ed('0x30')},'dialQueueOptions':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xb3ed('0x17')](0x3)[_0xb3ed('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb3ed('0x31')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xb3ed('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb3ed('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb3ed('0x17')](0x5)[_0xb3ed('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb3ed('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb3ed('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb3ed('0x17')](0x5)[_0xb3ed('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb3ed('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb3ed('0x27')],'defaultValue':0x3,'comment':_0xb3ed('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb3ed('0x17')](0x5)[_0xb3ed('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb3ed('0x17')](0x3)[_0xb3ed('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':_0xb3ed('0x36')},'dialPrefix':{'type':Sequelize[_0xb3ed('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb3ed('0x3')](_0xb3ed('0x37'),'never',_0xb3ed('0x38')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xb3ed('0x22')],'defaultValue':0x0,'comment':_0xb3ed('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0xb3ed('0x17')](0x9)[_0xb3ed('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb3ed('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xb3ed('0x17')](0x9)[_0xb3ed('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb3ed('0x17')](0x9)[_0xb3ed('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb3ed('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb3ed('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xb3ed('0x17')](0x9)[_0xb3ed('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb3ed('0x17')](0x9)[_0xb3ed('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb3ed('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xb3ed('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb3ed('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb3ed('0x17')](0x9)[_0xb3ed('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb3ed('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0xb3ed('0x17')](0x5)[_0xb3ed('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb3ed('0x40')},'dialRecallInQueue':{'type':Sequelize[_0xb3ed('0x22')],'defaultValue':0x0,'comment':_0xb3ed('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb3ed('0x3')]('DESC',_0xb3ed('0x42')),'defaultValue':_0xb3ed('0x43')},'dialQueueProject2':{'type':Sequelize[_0xb3ed('0x6')],'comment':_0xb3ed('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb3ed('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb3ed('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb3ed('0x17')](0x3)[_0xb3ed('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb3ed('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xb3ed('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb3ed('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb3ed('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb3ed('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb3ed('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xb3ed('0x17')](0x3)[_0xb3ed('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb3ed('0x47')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb3ed('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb3ed('0x17')](0x3)[_0xb3ed('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb3ed('0x17')](0x5)[_0xb3ed('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb3ed('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0xb3ed('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb3ed('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb3ed('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb3ed('0x17')](0x3)[_0xb3ed('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb3ed('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb3ed('0x17')](0x5)[_0xb3ed('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb3ed('0x17')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb3ed('0x22')],'defaultValue':![],'comment':_0xb3ed('0x4c'),'set':function(_0x7509c5){if(!_0x7509c5)this[_0xb3ed('0x1c')](_0xb3ed('0x4d'),null);this[_0xb3ed('0x1c')](_0xb3ed('0x4e'),_0x7509c5);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xb3ed('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb3ed('0x17')](0x3)[_0xb3ed('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xabce=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','default','ringall','fewestcalls','rrmemory','linear','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','Active/Disactive\x20Campaign','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','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\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x5a7db2,_0x1f82f8){var _0x35b27d=function(_0x4c8cd3){while(--_0x4c8cd3){_0x5a7db2['push'](_0x5a7db2['shift']());}};_0x35b27d(++_0x1f82f8);}(_0xabce,0x103));var _0xeabc=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xabce[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![],'unique':_0xeabc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xeabc('0x4')]('inbound','outbound'),'allowNull':![],'defaultValue':_0xeabc('0x5')},'musiconhold':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':_0xeabc('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xeabc('0x7'),'leastrecent',_0xeabc('0x8'),'random',_0xeabc('0x9'),_0xeabc('0xa'),_0xeabc('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0xeabc('0x7'),'set':function(_0x341f16){this[_0xeabc('0xc')](_0xeabc('0xd'),_0x341f16?_0x341f16:_0xeabc('0x9'));},'get':function(){var _0x283cdf=this[_0xeabc('0xe')](_0xeabc('0xf'));var _0xdb5022=this[_0xeabc('0xe')](_0xeabc('0x10'));var _0x1c7eb0=this[_0xeabc('0xe')](_0xeabc('0xd'));if(_0x283cdf===_0xeabc('0x5')){return _0x1c7eb0;}if(_0xdb5022===_0xeabc('0x11')&&_0x1c7eb0==='rrmemory'||_0xdb5022===_0xeabc('0x11')&&_0x1c7eb0===_0xeabc('0x12')){return _0x1c7eb0;}if(_0xdb5022===_0xeabc('0x13')||_0xdb5022==='predictive'||_0xdb5022==='power'){return _0x1c7eb0;}return null;}},'servicelevel':{'type':Sequelize[_0xeabc('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xeabc('0x14')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xeabc('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xeabc('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xeabc('0x4')]('yes','no'),'defaultValue':_0xeabc('0x15')},'autopause':{'type':Sequelize[_0xeabc('0x4')](_0xeabc('0x15'),'no',_0xeabc('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xeabc('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xeabc('0x4')](_0xeabc('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xeabc('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xeabc('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xeabc('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xeabc('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xeabc('0x4')](_0xeabc('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xeabc('0x4')](_0xeabc('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xeabc('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xeabc('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xeabc('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xeabc('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xeabc('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xeabc('0x4')](_0xeabc('0x15'),'no'),'defaultValue':_0xeabc('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xeabc('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xeabc('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xeabc('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xeabc('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xeabc('0x2')]},'queue_youarenext':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xeabc('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xeabc('0x2')]},'queue_quantity2':{'type':Sequelize[_0xeabc('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xeabc('0x2')]},'queue_less_than':{'type':Sequelize[_0xeabc('0x2')]},'periodic_announce':{'type':Sequelize[_0xeabc('0x17')],'set':function(_0x481ee1){this[_0xeabc('0xc')](_0xeabc('0x18'),_0x481ee1?_0x481ee1[_0xeabc('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0xeabc('0x18'))?this['getDataValue'](_0xeabc('0x18'))[_0xeabc('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':_0xeabc('0x15'),'set':function(_0x73c8d4){this[_0xeabc('0xc')](_0xeabc('0x1b'),_0x73c8d4?_0x73c8d4['join'](','):undefined);},'get':function(){return this[_0xeabc('0xe')](_0xeabc('0x1b'))?this[_0xeabc('0xe')]('joinempty')[_0xeabc('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':'no','set':function(_0x4492fd){this['setDataValue'](_0xeabc('0x1c'),_0x4492fd?_0x4492fd[_0xeabc('0x19')](','):undefined);},'get':function(){return this[_0xeabc('0xe')]('leavewhenempty')?this[_0xeabc('0xe')](_0xeabc('0x1c'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xeabc('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xeabc('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xeabc('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xeabc('0x4')](_0xeabc('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xeabc('0x2')]},'description':{'type':Sequelize[_0xeabc('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x353e48){this['setDataValue'](_0xeabc('0x1d'),_0x353e48);if(_0x353e48){if(this[_0xeabc('0xe')](_0xeabc('0x1e'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xeabc('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xeabc('0x1f')},'dialMethod':{'type':Sequelize['ENUM']('preview','progressive','power',_0xeabc('0x20'),'booked'),'defaultValue':_0xeabc('0x13'),'comment':_0xeabc('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xeabc('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xeabc('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xeabc('0x23')},'dialPowerLevel':{'type':Sequelize[_0xeabc('0x24')](0x2)[_0xeabc('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0xeabc('0x25')),'defaultValue':_0xeabc('0x25'),'comment':_0xeabc('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xeabc('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0xeabc('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xeabc('0x28')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xeabc('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':_0xeabc('0x29'),'comment':_0xeabc('0x2a')},'dialQueueTimeout':{'type':Sequelize[_0xeabc('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeabc('0x2b')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xeabc('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0xeabc('0x14')](0x3)[_0xeabc('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeabc('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xeabc('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xeabc('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeabc('0x2e')},'dialBusyRetryFrequency':{'type':Sequelize[_0xeabc('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeabc('0x2f')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xeabc('0x14')](0x3)[_0xeabc('0x22')],'defaultValue':0x3,'comment':_0xeabc('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xeabc('0x14')](0x5)[_0xeabc('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeabc('0x31')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xeabc('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xeabc('0x32')},'dialTimezone':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':_0xeabc('0x33')},'dialPrefix':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xeabc('0x4')](_0xeabc('0x34'),_0xeabc('0x35'),_0xeabc('0x36')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xeabc('0x37')],'defaultValue':0x0,'comment':_0xeabc('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0xeabc('0x14')](0x9)[_0xeabc('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xeabc('0x39')},'dialAMDGreeting':{'type':Sequelize[_0xeabc('0x14')](0x9)[_0xeabc('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xeabc('0x14')](0x9)[_0xeabc('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xeabc('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xeabc('0x14')](0x9)[_0xeabc('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xeabc('0x14')](0x9)[_0xeabc('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xeabc('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xeabc('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xeabc('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xeabc('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xeabc('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xeabc('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xeabc('0x14')](0x9)[_0xeabc('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeabc('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xeabc('0x14')](0x5)[_0xeabc('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xeabc('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xeabc('0x37')],'defaultValue':0x0,'comment':_0xeabc('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xeabc('0x4')](_0xeabc('0x41'),'ASC'),'defaultValue':_0xeabc('0x41')},'dialQueueProject2':{'type':Sequelize[_0xeabc('0x2')],'comment':_0xeabc('0x2c')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xeabc('0x37')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xeabc('0x14')](0x3)[_0xeabc('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeabc('0x42')},'dialCutDigit':{'type':Sequelize[_0xeabc('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeabc('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xeabc('0x14')](0x3)[_0xeabc('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeabc('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xeabc('0x14')](0x5)[_0xeabc('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeabc('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0xeabc('0x14')](0x3)[_0xeabc('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xeabc('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xeabc('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeabc('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xeabc('0x14')](0x5)[_0xeabc('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeabc('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0xeabc('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeabc('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0xeabc('0x14')](0x5)[_0xeabc('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeabc('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xeabc('0x14')](0x3)[_0xeabc('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeabc('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xeabc('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeabc('0x14')],'allowNull':!![],'comment':_0xeabc('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0xeabc('0x37')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x287f88){if(!_0x287f88)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xeabc('0xc')](_0xeabc('0x4c'),_0x287f88);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xeabc('0x14')](0x3)[_0xeabc('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xeabc('0x14')](0x3)[_0xeabc('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 990a547..2b791ea 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 _0x5f21=['all','union','compact','removeAgents','forEach','userVoiceQueue:remove','addAgents','userVoiceQueue:save','isEmpty','isNil','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','fromQuery','COALESCE(phone,\x27\x27)','into','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','cm_contacts','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','QueueCampaigns','filter','ignore','map','value','includes','find','name','error','stack','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','rows','catch','show','user','get','inbound','outbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','Agents','online','voicePause','interface','flatMap','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','emit','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f21,0x1a1));var _0x15f2=function(_0x47f40b,_0x4c578e){_0x47f40b=_0x47f40b-0x0;var _0x39be6c=_0x5f21[_0x47f40b];return _0x39be6c;};'use strict';var emlformat=require(_0x15f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15f2('0x1'));var jsonpatch=require(_0x15f2('0x2'));var rp=require(_0x15f2('0x3'));var moment=require('moment');var BPromise=require(_0x15f2('0x4'));var Mustache=require(_0x15f2('0x5'));var util=require(_0x15f2('0x6'));var path=require('path');var sox=require(_0x15f2('0x7'));var csv=require('to-csv');var ejs=require(_0x15f2('0x8'));var fs=require('fs');var fs_extra=require(_0x15f2('0x9'));var _=require(_0x15f2('0xa'));var squel=require(_0x15f2('0xb'));var crypto=require(_0x15f2('0xc'));var jsforce=require(_0x15f2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x15f2('0xe'));var querystring=require('querystring');var Papa=require(_0x15f2('0xf'));var Redis=require(_0x15f2('0x10'));var authService=require(_0x15f2('0x11'));var qs=require(_0x15f2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15f2('0x13'));var logger=require('../../config/logger')(_0x15f2('0x14'));var utils=require(_0x15f2('0x15'));var config=require(_0x15f2('0x16'));var licenseUtil=require(_0x15f2('0x17'));var db=require(_0x15f2('0x18'))['db'];config[_0x15f2('0x19')]=_[_0x15f2('0x1a')](config['redis'],{'host':_0x15f2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x15f2('0x19')]));require(_0x15f2('0x1c'))[_0x15f2('0x1d')](socket);function respondWithStatusCode(_0x1a7f2b,_0x14ec53){_0x14ec53=_0x14ec53||0xcc;return function(_0x18e081){if(_0x18e081){return _0x1a7f2b[_0x15f2('0x1e')](_0x14ec53);}return _0x1a7f2b[_0x15f2('0x1f')](_0x14ec53)[_0x15f2('0x20')]();};}function respondWithResult(_0x51a052,_0x333ce6){_0x333ce6=_0x333ce6||0xc8;return function(_0x43ee2d){if(_0x43ee2d){return _0x51a052[_0x15f2('0x1f')](_0x333ce6)[_0x15f2('0x21')](_0x43ee2d);}};}function respondWithFilteredResult(_0x3eb567,_0x4b6e64){return function(_0x36dcbf){if(_0x36dcbf){var _0x2b22c8=typeof _0x4b6e64[_0x15f2('0x22')]===_0x15f2('0x23')&&typeof _0x4b6e64[_0x15f2('0x24')]===_0x15f2('0x23');var _0x3343e5=_0x36dcbf[_0x15f2('0x25')];var _0x33f3ea=_0x2b22c8?0x0:_0x4b6e64[_0x15f2('0x22')];var _0x1f5ac8=_0x2b22c8?_0x36dcbf[_0x15f2('0x25')]:_0x4b6e64[_0x15f2('0x22')]+_0x4b6e64[_0x15f2('0x24')];var _0x4f8489;if(_0x1f5ac8>=_0x3343e5){_0x1f5ac8=_0x3343e5;_0x4f8489=0xc8;}else{_0x4f8489=0xce;}_0x3eb567[_0x15f2('0x1f')](_0x4f8489);return _0x3eb567[_0x15f2('0x26')](_0x15f2('0x27'),_0x33f3ea+'-'+_0x1f5ac8+'/'+_0x3343e5)[_0x15f2('0x21')](_0x36dcbf);}return null;};}function patchUpdates(_0x59ad28){return function(_0x5b007e){try{jsonpatch[_0x15f2('0x28')](_0x5b007e,_0x59ad28,!![]);}catch(_0x467c84){return BPromise['reject'](_0x467c84);}return _0x5b007e['save']();};}function saveUpdates(_0x3cb5e7,_0x1a1fe5){return function(_0x474b4e){if(_0x474b4e){return _0x474b4e[_0x15f2('0x29')](_0x3cb5e7)[_0x15f2('0x2a')](function(_0x3f5d65){return _0x3f5d65;});}return null;};}function removeEntity(_0x2cf62f,_0x3bd18e){return function(_0x3572a5){if(_0x3572a5){return _0x3572a5[_0x15f2('0x2b')]()['then'](function(){var _0x4fc3a6=_0x3572a5['get']({'plain':!![]});var _0x17967b=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x15f2('0x2c'),'value':'outbound','ignore':![]}];var _0x2a2c1e=_(_0x17967b)[_0x15f2('0x2d')](_0x15f2('0x2e'))[_0x15f2('0x2f')](_0x15f2('0x30'))[_0x15f2('0x30')]();if(_[_0x15f2('0x31')](_0x2a2c1e,_0x4fc3a6['type'])){return;}var _0x245933=_[_0x15f2('0x32')](_0x17967b,[_0x15f2('0x30'),_0x4fc3a6['type']])[_0x15f2('0x33')];return db['UserProfileResource'][_0x15f2('0x2b')]({'where':{'type':_0x245933,'resourceId':_0x4fc3a6['id']}})[_0x15f2('0x2a')](function(){return _0x3572a5;});})[_0x15f2('0x2a')](function(){_0x2cf62f[_0x15f2('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x316b0e,_0x37c230){return function(_0x6324b5){if(!_0x6324b5){_0x316b0e[_0x15f2('0x1e')](0x194);}return _0x6324b5;};}function handleError(_0x57becd,_0x4b11d5){_0x4b11d5=_0x4b11d5||0x1f4;return function(_0x5d0061){logger[_0x15f2('0x34')](_0x5d0061[_0x15f2('0x35')]);if(_0x5d0061[_0x15f2('0x33')]){delete _0x5d0061[_0x15f2('0x33')];}_0x57becd['status'](_0x4b11d5)['send'](_0x5d0061);};}exports['index']=function(_0x24647f,_0x56e88b){var _0x367c4b={},_0x1c6d24={},_0x40f965={'count':0x0,'rows':[]};var _0x57c0d0=_[_0x15f2('0x2f')](db['VoiceQueue'][_0x15f2('0x36')],function(_0x317230){return{'name':_0x317230[_0x15f2('0x37')],'type':_0x317230[_0x15f2('0x38')][_0x15f2('0x39')]};});_0x1c6d24[_0x15f2('0x3a')]=_['map'](_0x57c0d0,_0x15f2('0x33'));_0x1c6d24['query']=_[_0x15f2('0x3b')](_0x24647f[_0x15f2('0x3c')]);_0x1c6d24[_0x15f2('0x3d')]=_[_0x15f2('0x3e')](_0x1c6d24[_0x15f2('0x3a')],_0x1c6d24['query']);_0x367c4b['attributes']=_['intersection'](_0x1c6d24[_0x15f2('0x3a')],qs[_0x15f2('0x3f')](_0x24647f[_0x15f2('0x3c')]['fields']));_0x367c4b['attributes']=_0x367c4b[_0x15f2('0x40')][_0x15f2('0x41')]?_0x367c4b[_0x15f2('0x40')]:_0x1c6d24[_0x15f2('0x3a')];if(!_0x24647f['query'][_0x15f2('0x42')](_0x15f2('0x43'))){_0x367c4b[_0x15f2('0x24')]=qs[_0x15f2('0x24')](_0x24647f['query'][_0x15f2('0x24')]);_0x367c4b[_0x15f2('0x22')]=qs[_0x15f2('0x22')](_0x24647f[_0x15f2('0x3c')][_0x15f2('0x22')]);}_0x367c4b[_0x15f2('0x44')]=qs['sort'](_0x24647f['query'][_0x15f2('0x45')]);_0x367c4b[_0x15f2('0x46')]=qs['filters'](_[_0x15f2('0x47')](_0x24647f[_0x15f2('0x3c')],_0x1c6d24[_0x15f2('0x3d')]),_0x57c0d0);if(_0x24647f[_0x15f2('0x3c')][_0x15f2('0x2d')]){_0x367c4b[_0x15f2('0x46')]=_[_0x15f2('0x48')](_0x367c4b[_0x15f2('0x46')],{'$or':_[_0x15f2('0x2f')](_0x57c0d0,function(_0x3da040){if(_0x3da040[_0x15f2('0x38')]!==_0x15f2('0x49')){var _0x537faa={};_0x537faa[_0x3da040[_0x15f2('0x33')]]={'$like':'%'+_0x24647f[_0x15f2('0x3c')][_0x15f2('0x2d')]+'%'};return _0x537faa;}})});}_0x367c4b=_[_0x15f2('0x48')]({},_0x367c4b,_0x24647f[_0x15f2('0x4a')]);var _0x569c7e={'where':_0x367c4b['where']};return db[_0x15f2('0x4b')][_0x15f2('0x25')](_0x569c7e)[_0x15f2('0x2a')](function(_0x3acd58){_0x40f965[_0x15f2('0x25')]=_0x3acd58;if(_0x24647f[_0x15f2('0x3c')][_0x15f2('0x4c')]){_0x367c4b[_0x15f2('0x4d')]=[{'all':!![]}];}return db['VoiceQueue'][_0x15f2('0x4e')](_0x367c4b);})[_0x15f2('0x2a')](function(_0x57f3ef){_0x40f965[_0x15f2('0x4f')]=_0x57f3ef;return _0x40f965;})[_0x15f2('0x2a')](respondWithFilteredResult(_0x56e88b,_0x367c4b))[_0x15f2('0x50')](handleError(_0x56e88b,null));};exports[_0x15f2('0x51')]=function(_0x425eef,_0x3350a4){var _0x18b7a0={'raw':![],'where':{'id':_0x425eef['params']['id']}},_0x320f3f={};_0x320f3f[_0x15f2('0x3a')]=_['keys'](db[_0x15f2('0x4b')][_0x15f2('0x36')]);_0x320f3f['query']=_[_0x15f2('0x3b')](_0x425eef[_0x15f2('0x3c')]);_0x320f3f[_0x15f2('0x3d')]=_[_0x15f2('0x3e')](_0x320f3f[_0x15f2('0x3a')],_0x320f3f[_0x15f2('0x3c')]);_0x18b7a0[_0x15f2('0x40')]=_[_0x15f2('0x3e')](_0x320f3f[_0x15f2('0x3a')],qs[_0x15f2('0x3f')](_0x425eef[_0x15f2('0x3c')]['fields']));_0x18b7a0[_0x15f2('0x40')]=_0x18b7a0[_0x15f2('0x40')][_0x15f2('0x41')]?_0x18b7a0[_0x15f2('0x40')]:_0x320f3f[_0x15f2('0x3a')];if(_0x425eef[_0x15f2('0x3c')][_0x15f2('0x4c')]){_0x18b7a0[_0x15f2('0x4d')]=[{'all':!![]}];}_0x18b7a0=_['merge']({},_0x18b7a0,_0x425eef[_0x15f2('0x4a')]);return db[_0x15f2('0x4b')][_0x15f2('0x32')](_0x18b7a0)[_0x15f2('0x2a')](handleEntityNotFound(_0x3350a4,null))[_0x15f2('0x2a')](respondWithResult(_0x3350a4,null))[_0x15f2('0x50')](handleError(_0x3350a4,null));};exports['create']=function(_0x423380,_0x5545dd){return db[_0x15f2('0x4b')]['create'](_0x423380['body'],{})[_0x15f2('0x2a')](function(_0x4d4b52){var _0x2c39dc=_0x423380[_0x15f2('0x52')][_0x15f2('0x53')]({'plain':!![]});if(!_0x2c39dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c39dc['role']==='user'){var _0x325f60=_0x4d4b52['get']({'plain':!![]});var _0x11fab9=[{'name':'VoiceQueues','value':_0x15f2('0x54')},{'name':_0x15f2('0x2c'),'value':_0x15f2('0x55')}];var _0x3e53ff=_[_0x15f2('0x32')](_0x11fab9,[_0x15f2('0x30'),_0x325f60[_0x15f2('0x38')]])[_0x15f2('0x33')];return db[_0x15f2('0x56')][_0x15f2('0x32')]({'where':{'name':_0x3e53ff,'userProfileId':_0x2c39dc[_0x15f2('0x57')]},'raw':!![]})[_0x15f2('0x2a')](function(_0x147fb9){if(_0x147fb9&&_0x147fb9[_0x15f2('0x58')]===0x0){return db[_0x15f2('0x59')][_0x15f2('0x5a')]({'name':_0x325f60[_0x15f2('0x33')],'resourceId':_0x325f60['id'],'type':_0x147fb9['name'],'sectionId':_0x147fb9['id']},{})[_0x15f2('0x2a')](function(){return _0x4d4b52;});}else{return _0x4d4b52;}})['catch'](function(_0x5ee764){logger['error'](_0x15f2('0x5b'),_0x5ee764);throw _0x5ee764;});}return _0x4d4b52;})[_0x15f2('0x2a')](respondWithResult(_0x5545dd,0xc9))[_0x15f2('0x50')](handleError(_0x5545dd,null));};exports[_0x15f2('0x5c')]=function(_0x3328fa,_0x60edf4){var _0x2b4095={'where':{'id':_0x3328fa[_0x15f2('0x5d')]['id']}},_0x4773f4={};_0x4773f4[_0x15f2('0x3a')]=_['keys'](db[_0x15f2('0x4b')]['rawAttributes']);_0x2b4095[_0x15f2('0x40')]=_['intersection'](_0x4773f4['model'],qs[_0x15f2('0x3f')](_0x3328fa['query'][_0x15f2('0x3f')]));_0x2b4095['attributes']=_0x2b4095['attributes'][_0x15f2('0x41')]?_0x2b4095[_0x15f2('0x40')]:_0x4773f4['model'];if(_0x3328fa[_0x15f2('0x3c')]['includeAll']){_0x2b4095[_0x15f2('0x4d')]=[{'all':!![]}];}_0x2b4095=_[_0x15f2('0x48')]({},_0x2b4095,_0x3328fa[_0x15f2('0x4a')]);return db[_0x15f2('0x4b')]['find'](_0x2b4095)[_0x15f2('0x2a')](handleEntityNotFound(_0x60edf4,null))[_0x15f2('0x2a')](function(_0x1f768e){if(_0x1f768e){var _0x49855a=_0x1f768e[_0x15f2('0x53')]({'plain':!![]});_0x49855a=qs[_0x15f2('0x5e')](_0x49855a,['id',_0x15f2('0x5f'),_0x15f2('0x60')]);_0x3328fa[_0x15f2('0x61')]=_[_0x15f2('0x5e')](_0x3328fa[_0x15f2('0x61')],['id',_0x15f2('0x5f'),_0x15f2('0x60')]);return db['VoiceQueue']['create'](_[_0x15f2('0x48')](_0x49855a,_0x3328fa[_0x15f2('0x61')]),{'include':_0x3328fa[_0x15f2('0x3c')]['includeAll']?[{'all':!![]}]:undefined})[_0x15f2('0x2a')](function(_0x44ecc7){var _0xb8e1d7=_0x3328fa[_0x15f2('0x52')][_0x15f2('0x53')]({'plain':!![]});if(!_0xb8e1d7)throw new Error(_0x15f2('0x62'));if(_0xb8e1d7[_0x15f2('0x63')]===_0x15f2('0x52')){var _0x8fde1c=_0x44ecc7[_0x15f2('0x53')]({'plain':!![]});var _0x17a181=[{'name':_0x15f2('0x64'),'value':_0x15f2('0x54')},{'name':_0x15f2('0x2c'),'value':_0x15f2('0x55')}];var _0x25b0d=_[_0x15f2('0x32')](_0x17a181,['value',_0x8fde1c['type']])[_0x15f2('0x33')];return db[_0x15f2('0x56')][_0x15f2('0x32')]({'where':{'name':_0x25b0d,'userProfileId':_0xb8e1d7['userProfileId']},'raw':!![]})[_0x15f2('0x2a')](function(_0x47b0ea){if(_0x47b0ea&&_0x47b0ea['autoAssociation']===0x0){return db[_0x15f2('0x59')]['create']({'name':_0x8fde1c[_0x15f2('0x33')],'resourceId':_0x8fde1c['id'],'type':_0x47b0ea[_0x15f2('0x33')],'sectionId':_0x47b0ea['id']},{})[_0x15f2('0x2a')](function(){return _0x44ecc7;});}else{return _0x44ecc7;}})[_0x15f2('0x50')](function(_0x2c1145){logger['error'](_0x15f2('0x5b'),_0x2c1145);throw _0x2c1145;});}return _0x44ecc7;});}})[_0x15f2('0x2a')](respondWithResult(_0x60edf4,0xc9))[_0x15f2('0x50')](handleError(_0x60edf4,null));};exports[_0x15f2('0x29')]=function(_0x54a844,_0x1556ba){if(_0x54a844[_0x15f2('0x61')]['id']){delete _0x54a844[_0x15f2('0x61')]['id'];}return db[_0x15f2('0x4b')][_0x15f2('0x32')]({'where':{'id':_0x54a844['params']['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x1556ba,null))[_0x15f2('0x2a')](saveUpdates(_0x54a844[_0x15f2('0x61')],null))[_0x15f2('0x2a')](respondWithResult(_0x1556ba,null))[_0x15f2('0x50')](handleError(_0x1556ba,null));};exports[_0x15f2('0x2b')]=function(_0x76af81,_0x11d54d){return db['VoiceQueue'][_0x15f2('0x32')]({'where':{'id':_0x76af81[_0x15f2('0x5d')]['id']}})['then'](handleEntityNotFound(_0x11d54d,null))[_0x15f2('0x2a')](removeEntity(_0x11d54d,null))[_0x15f2('0x50')](handleError(_0x11d54d,null));};exports[_0x15f2('0x65')]=function(_0x400a53,_0xe46284,_0xe5a5be){var _0x2d354e={'raw':![],'where':{}};var _0x41a5fb={};var _0x20f0d7={'count':0x0,'rows':[]};return db[_0x15f2('0x4b')][_0x15f2('0x66')]({'where':{'id':_0x400a53[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0xe46284,null))[_0x15f2('0x2a')](function(_0x11e1e6){if(_0x11e1e6){_0x41a5fb[_0x15f2('0x3a')]=_['keys'](db[_0x15f2('0x67')][_0x15f2('0x36')]);_0x41a5fb[_0x15f2('0x3c')]=_[_0x15f2('0x3b')](_0x400a53[_0x15f2('0x3c')]);_0x41a5fb[_0x15f2('0x3d')]=_['intersection'](_0x41a5fb[_0x15f2('0x3a')],_0x41a5fb[_0x15f2('0x3c')]);_0x2d354e['attributes']=_[_0x15f2('0x3e')](_0x41a5fb['model'],qs['fields'](_0x400a53[_0x15f2('0x3c')]['fields']));_0x2d354e['attributes']=_0x2d354e[_0x15f2('0x40')][_0x15f2('0x41')]?_0x2d354e['attributes']:_0x41a5fb[_0x15f2('0x3a')];if(!_0x400a53[_0x15f2('0x3c')]['hasOwnProperty']('nolimit')){_0x2d354e['limit']=qs[_0x15f2('0x24')](_0x400a53[_0x15f2('0x3c')][_0x15f2('0x24')]);_0x2d354e[_0x15f2('0x22')]=qs[_0x15f2('0x22')](_0x400a53[_0x15f2('0x3c')][_0x15f2('0x22')]);}_0x2d354e[_0x15f2('0x44')]=qs['sort'](_0x400a53[_0x15f2('0x3c')][_0x15f2('0x45')]);_0x2d354e[_0x15f2('0x46')]=qs[_0x15f2('0x3d')](_[_0x15f2('0x47')](_0x400a53['query'],_0x41a5fb[_0x15f2('0x3d')]));_0x2d354e[_0x15f2('0x46')][_0x15f2('0x68')]=_0x11e1e6['id'];if(_0x400a53['query'][_0x15f2('0x2d')]){_0x2d354e['where']=_[_0x15f2('0x48')](_0x2d354e[_0x15f2('0x46')],{'$or':_[_0x15f2('0x2f')](_0x2d354e['attributes'],function(_0x36336c){var _0x4067d0={};_0x4067d0[_0x36336c]={'$like':'%'+_0x400a53[_0x15f2('0x3c')]['filter']+'%'};return _0x4067d0;})});}_0x2d354e=_[_0x15f2('0x48')]({},_0x2d354e,_0x400a53[_0x15f2('0x4a')]);return db[_0x15f2('0x67')][_0x15f2('0x25')]({'where':_0x2d354e[_0x15f2('0x46')]})['then'](function(_0x3bf4d9){_0x20f0d7[_0x15f2('0x25')]=_0x3bf4d9;if(_0x400a53[_0x15f2('0x3c')][_0x15f2('0x4c')]){_0x2d354e[_0x15f2('0x4d')]=[{'all':!![]}];}return db[_0x15f2('0x67')][_0x15f2('0x4e')](_0x2d354e);})[_0x15f2('0x2a')](function(_0x37854e){_0x20f0d7[_0x15f2('0x4f')]=_0x37854e;return _0x20f0d7;});}})[_0x15f2('0x2a')](respondWithFilteredResult(_0xe46284,_0x2d354e))['catch'](handleError(_0xe46284,null));};exports[_0x15f2('0x69')]=function(_0x4e21bf,_0x1d1d93,_0x5a846e){var _0x1fea1c={'raw':!![],'where':{}};var _0x1701a9={};var _0x27a015={'count':0x0,'rows':[]};return db[_0x15f2('0x4b')][_0x15f2('0x66')]({'where':{'id':_0x4e21bf['params']['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x1d1d93,null))[_0x15f2('0x2a')](function(_0xc05a9){if(_0xc05a9){_0x1701a9[_0x15f2('0x3a')]=_[_0x15f2('0x3b')](db[_0x15f2('0x6a')][_0x15f2('0x36')]);_0x1701a9[_0x15f2('0x3c')]=_[_0x15f2('0x3b')](_0x4e21bf[_0x15f2('0x3c')]);_0x1701a9[_0x15f2('0x3d')]=_[_0x15f2('0x3e')](_0x1701a9[_0x15f2('0x3a')],_0x1701a9[_0x15f2('0x3c')]);_0x1fea1c[_0x15f2('0x40')]=_[_0x15f2('0x3e')](_0x1701a9[_0x15f2('0x3a')],qs[_0x15f2('0x3f')](_0x4e21bf[_0x15f2('0x3c')][_0x15f2('0x3f')]));_0x1fea1c[_0x15f2('0x40')]=_0x1fea1c[_0x15f2('0x40')]['length']?_0x1fea1c[_0x15f2('0x40')]:_0x1701a9['model'];if(!_0x4e21bf[_0x15f2('0x3c')][_0x15f2('0x42')]('nolimit')){_0x1fea1c['limit']=qs[_0x15f2('0x24')](_0x4e21bf[_0x15f2('0x3c')][_0x15f2('0x24')]);_0x1fea1c[_0x15f2('0x22')]=qs[_0x15f2('0x22')](_0x4e21bf['query']['offset']);}_0x1fea1c[_0x15f2('0x44')]=qs[_0x15f2('0x45')](_0x4e21bf[_0x15f2('0x3c')][_0x15f2('0x45')]);_0x1fea1c['where']=qs['filters'](_['pick'](_0x4e21bf[_0x15f2('0x3c')],_0x1701a9['filters']));_0x1fea1c[_0x15f2('0x46')][_0x15f2('0x68')]=_0xc05a9['id'];if(_0x4e21bf['query'][_0x15f2('0x2d')]){_0x1fea1c[_0x15f2('0x46')]=_[_0x15f2('0x48')](_0x1fea1c[_0x15f2('0x46')],{'$or':_['map'](_0x1fea1c['attributes'],function(_0x51663b){var _0x40d822={};_0x40d822[_0x51663b]={'$like':'%'+_0x4e21bf[_0x15f2('0x3c')]['filter']+'%'};return _0x40d822;})});}_0x1fea1c=_[_0x15f2('0x48')]({},_0x1fea1c,_0x4e21bf[_0x15f2('0x4a')]);return db[_0x15f2('0x6a')][_0x15f2('0x25')]({'where':_0x1fea1c['where']})['then'](function(_0x595f7a){_0x27a015[_0x15f2('0x25')]=_0x595f7a;if(_0x4e21bf[_0x15f2('0x3c')][_0x15f2('0x4c')]){_0x1fea1c['include']=[{'all':!![]}];}return db[_0x15f2('0x6a')][_0x15f2('0x4e')](_0x1fea1c);})[_0x15f2('0x2a')](function(_0x39db02){_0x27a015[_0x15f2('0x4f')]=_0x39db02;return _0x27a015;});}})['then'](respondWithFilteredResult(_0x1d1d93,_0x1fea1c))[_0x15f2('0x50')](handleError(_0x1d1d93,null));};exports[_0x15f2('0x6b')]=function(_0x5f44b3,_0x40b8c5,_0x13273a){var _0x546de1={'raw':!![],'where':{}};var _0x8dae2d={};var _0xb8970e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x15f2('0x66')]({'where':{'id':_0x5f44b3['params']['id']}})['then'](handleEntityNotFound(_0x40b8c5,null))['then'](function(_0x17fe86){if(_0x17fe86){_0x8dae2d[_0x15f2('0x3a')]=_[_0x15f2('0x3b')](db[_0x15f2('0x6c')][_0x15f2('0x36')]);_0x8dae2d[_0x15f2('0x3c')]=_[_0x15f2('0x3b')](_0x5f44b3[_0x15f2('0x3c')]);_0x8dae2d[_0x15f2('0x3d')]=_['intersection'](_0x8dae2d['model'],_0x8dae2d[_0x15f2('0x3c')]);_0x546de1[_0x15f2('0x40')]=_[_0x15f2('0x3e')](_0x8dae2d[_0x15f2('0x3a')],qs[_0x15f2('0x3f')](_0x5f44b3[_0x15f2('0x3c')][_0x15f2('0x3f')]));_0x546de1[_0x15f2('0x40')]=_0x546de1[_0x15f2('0x40')]['length']?_0x546de1[_0x15f2('0x40')]:_0x8dae2d[_0x15f2('0x3a')];if(!_0x5f44b3[_0x15f2('0x3c')][_0x15f2('0x42')]('nolimit')){_0x546de1[_0x15f2('0x24')]=qs[_0x15f2('0x24')](_0x5f44b3[_0x15f2('0x3c')][_0x15f2('0x24')]);_0x546de1[_0x15f2('0x22')]=qs[_0x15f2('0x22')](_0x5f44b3['query'][_0x15f2('0x22')]);}_0x546de1['order']=qs[_0x15f2('0x45')](_0x5f44b3[_0x15f2('0x3c')][_0x15f2('0x45')]);_0x546de1['where']=qs[_0x15f2('0x3d')](_[_0x15f2('0x47')](_0x5f44b3[_0x15f2('0x3c')],_0x8dae2d[_0x15f2('0x3d')]));_0x546de1[_0x15f2('0x46')][_0x15f2('0x68')]=_0x17fe86['id'];if(_0x5f44b3['query']['filter']){_0x546de1[_0x15f2('0x46')]=_['merge'](_0x546de1['where'],{'$or':_[_0x15f2('0x2f')](_0x546de1['attributes'],function(_0xe8efb6){var _0x45822f={};_0x45822f[_0xe8efb6]={'$like':'%'+_0x5f44b3[_0x15f2('0x3c')][_0x15f2('0x2d')]+'%'};return _0x45822f;})});}_0x546de1=_[_0x15f2('0x48')]({},_0x546de1,_0x5f44b3[_0x15f2('0x4a')]);return db[_0x15f2('0x6c')][_0x15f2('0x25')]({'where':_0x546de1[_0x15f2('0x46')]})[_0x15f2('0x2a')](function(_0x37b9ec){_0xb8970e[_0x15f2('0x25')]=_0x37b9ec;if(_0x5f44b3[_0x15f2('0x3c')]['includeAll']){_0x546de1['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x15f2('0x4e')](_0x546de1);})[_0x15f2('0x2a')](function(_0x4d4adc){_0xb8970e[_0x15f2('0x4f')]=_0x4d4adc;return _0xb8970e;});}})[_0x15f2('0x2a')](respondWithFilteredResult(_0x40b8c5,_0x546de1))[_0x15f2('0x50')](handleError(_0x40b8c5,null));};exports[_0x15f2('0x6d')]=function(_0x3fcbc2,_0x3b43ec,_0x23d63d){var _0x107f11={'raw':!![],'where':{}};var _0x30510a={};var _0x29dc89={'count':0x0,'rows':[]};return db[_0x15f2('0x4b')][_0x15f2('0x66')]({'where':{'id':_0x3fcbc2[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x3b43ec,null))[_0x15f2('0x2a')](function(_0x2d4054){if(_0x2d4054){_0x30510a[_0x15f2('0x3a')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x30510a[_0x15f2('0x3c')]=_[_0x15f2('0x3b')](_0x3fcbc2['query']);_0x30510a[_0x15f2('0x3d')]=_[_0x15f2('0x3e')](_0x30510a[_0x15f2('0x3a')],_0x30510a['query']);_0x107f11[_0x15f2('0x40')]=_[_0x15f2('0x3e')](_0x30510a[_0x15f2('0x3a')],qs[_0x15f2('0x3f')](_0x3fcbc2[_0x15f2('0x3c')][_0x15f2('0x3f')]));_0x107f11[_0x15f2('0x40')]=_0x107f11[_0x15f2('0x40')][_0x15f2('0x41')]?_0x107f11[_0x15f2('0x40')]:_0x30510a[_0x15f2('0x3a')];if(!_0x3fcbc2[_0x15f2('0x3c')]['hasOwnProperty'](_0x15f2('0x43'))){_0x107f11[_0x15f2('0x24')]=qs[_0x15f2('0x24')](_0x3fcbc2['query'][_0x15f2('0x24')]);_0x107f11[_0x15f2('0x22')]=qs['offset'](_0x3fcbc2['query'][_0x15f2('0x22')]);}_0x107f11[_0x15f2('0x44')]=qs[_0x15f2('0x45')](_0x3fcbc2[_0x15f2('0x3c')][_0x15f2('0x45')]);_0x107f11['where']=qs[_0x15f2('0x3d')](_[_0x15f2('0x47')](_0x3fcbc2['query'],_0x30510a[_0x15f2('0x3d')]));_0x107f11[_0x15f2('0x46')][_0x15f2('0x68')]=_0x2d4054['id'];if(_0x3fcbc2[_0x15f2('0x3c')][_0x15f2('0x2d')]){_0x107f11['where']=_[_0x15f2('0x48')](_0x107f11['where'],{'$or':_['map'](_0x107f11['attributes'],function(_0x4b9112){var _0x29d848={};_0x29d848[_0x4b9112]={'$like':'%'+_0x3fcbc2[_0x15f2('0x3c')][_0x15f2('0x2d')]+'%'};return _0x29d848;})});}_0x107f11=_[_0x15f2('0x48')]({},_0x107f11,_0x3fcbc2[_0x15f2('0x4a')]);return db[_0x15f2('0x6e')]['count']({'where':_0x107f11[_0x15f2('0x46')]})[_0x15f2('0x2a')](function(_0x3b1a55){_0x29dc89[_0x15f2('0x25')]=_0x3b1a55;if(_0x3fcbc2['query']['includeAll']){_0x107f11[_0x15f2('0x4d')]=[{'all':!![]}];}return db[_0x15f2('0x6e')][_0x15f2('0x4e')](_0x107f11);})[_0x15f2('0x2a')](function(_0x2b127a){_0x29dc89[_0x15f2('0x4f')]=_0x2b127a;return _0x29dc89;});}})[_0x15f2('0x2a')](respondWithFilteredResult(_0x3b43ec,_0x107f11))[_0x15f2('0x50')](handleError(_0x3b43ec,null));};exports['getTeams']=function(_0x5ecbc0,_0x2f02ec,_0x4813c0){var _0x2f38e9={};var _0x5e706f={};var _0x51ce7a;var _0x7a08d8;return db[_0x15f2('0x4b')]['findOne']({'where':{'id':_0x5ecbc0[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x2f02ec,null))[_0x15f2('0x2a')](function(_0x1c5c26){if(_0x1c5c26){_0x51ce7a=_0x1c5c26;_0x5e706f[_0x15f2('0x3a')]=_['keys'](db[_0x15f2('0x6f')]['rawAttributes']);_0x5e706f[_0x15f2('0x3c')]=_['keys'](_0x5ecbc0[_0x15f2('0x3c')]);_0x5e706f['filters']=_[_0x15f2('0x3e')](_0x5e706f[_0x15f2('0x3a')],_0x5e706f['query']);_0x2f38e9['attributes']=_['intersection'](_0x5e706f[_0x15f2('0x3a')],qs[_0x15f2('0x3f')](_0x5ecbc0[_0x15f2('0x3c')][_0x15f2('0x3f')]));_0x2f38e9['attributes']=_0x2f38e9[_0x15f2('0x40')][_0x15f2('0x41')]?_0x2f38e9[_0x15f2('0x40')]:_0x5e706f[_0x15f2('0x3a')];_0x2f38e9[_0x15f2('0x44')]=qs[_0x15f2('0x45')](_0x5ecbc0['query'][_0x15f2('0x45')]);_0x2f38e9[_0x15f2('0x46')]=qs[_0x15f2('0x3d')](_[_0x15f2('0x47')](_0x5ecbc0[_0x15f2('0x3c')],_0x5e706f['filters']));if(_0x5ecbc0['query'][_0x15f2('0x2d')]){_0x2f38e9[_0x15f2('0x46')]=_[_0x15f2('0x48')](_0x2f38e9[_0x15f2('0x46')],{'$or':_[_0x15f2('0x2f')](_0x2f38e9[_0x15f2('0x40')],function(_0x3dc903){var _0x2fdae3={};_0x2fdae3[_0x3dc903]={'$like':'%'+_0x5ecbc0[_0x15f2('0x3c')][_0x15f2('0x2d')]+'%'};return _0x2fdae3;})});}_0x2f38e9=_[_0x15f2('0x48')]({},_0x2f38e9,_0x5ecbc0[_0x15f2('0x4a')]);return _0x51ce7a[_0x15f2('0x70')](_0x2f38e9);}})[_0x15f2('0x2a')](function(_0x4b3f34){if(_0x4b3f34){_0x7a08d8=_0x4b3f34[_0x15f2('0x41')];if(!_0x5ecbc0[_0x15f2('0x3c')][_0x15f2('0x42')](_0x15f2('0x43'))){_0x2f38e9['limit']=qs['limit'](_0x5ecbc0['query'][_0x15f2('0x24')]);_0x2f38e9['offset']=qs[_0x15f2('0x22')](_0x5ecbc0['query'][_0x15f2('0x22')]);}return _0x51ce7a['getTeams'](_0x2f38e9);}})[_0x15f2('0x2a')](function(_0x244663){if(_0x244663){return _0x244663?{'count':_0x7a08d8,'rows':_0x244663}:null;}})['then'](respondWithResult(_0x2f02ec,null))[_0x15f2('0x50')](handleError(_0x2f02ec,null));};exports[_0x15f2('0x71')]=function(_0x42c3c7,_0x5da7bb,_0x2ad4e4){var _0x3a52ea=_0x42c3c7[_0x15f2('0x61')][_0x15f2('0x72')];var _0x398f07=_[_0x15f2('0x2f')](_0x3a52ea,'id');return db[_0x15f2('0x6f')][_0x15f2('0x4e')]({'where':{'id':_0x398f07},'attributes':['id'],'include':[{'model':db['User'],'as':_0x15f2('0x73'),'attributes':['id',_0x15f2('0x33'),_0x15f2('0x74'),_0x15f2('0x75'),_0x15f2('0x76')],'raw':!![]}]})[_0x15f2('0x2a')](function(_0x4a2172){if(_0x4a2172){var _0x2e2a9a=_[_0x15f2('0x77')](_0x4a2172,function(_0x3ab3dc){var _0x340683=_0x3ab3dc[_0x15f2('0x53')]({'plain':!![]});_0x340683[_0x15f2('0x73')]['forEach'](function(_0x4c6ab1){_0x4c6ab1[_0x15f2('0x78')]=_['find'](_0x3a52ea,{'id':_0x340683['id']})[_0x15f2('0x78')];});return _0x340683[_0x15f2('0x73')];});return db[_0x15f2('0x4b')]['find']({'where':{'id':_0x42c3c7[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](function(_0xfa4bee){return db[_0x15f2('0x79')][_0x15f2('0x7a')](function(_0x521b53){return _0xfa4bee[_0x15f2('0x71')](_0x398f07,{'transaction':_0x521b53})[_0x15f2('0x2a')](function(){return BPromise[_0x15f2('0x7b')](_0x3a52ea,function(_0x3bf1e3){return db[_0x15f2('0x7c')]['upsert']({'TeamId':_0x3bf1e3['id'],'VoiceQueueId':_0x42c3c7[_0x15f2('0x5d')]['id'],'penalty':_0x3bf1e3[_0x15f2('0x78')]},{'transaction':_0x521b53});});})['then'](function(){return BPromise[_0x15f2('0x7b')](_0x2e2a9a,function(_0x57a919){return db[_0x15f2('0x7d')][_0x15f2('0x7e')]({'where':{'UserId':_0x57a919['id'],'VoiceQueueId':_0x42c3c7[_0x15f2('0x5d')]['id']},'defaults':{'penalty':_0x57a919[_0x15f2('0x78')]},'transaction':_0x521b53});});})[_0x15f2('0x2a')](function(){return BPromise[_0x15f2('0x7b')](_[_0x15f2('0x2d')](_0x2e2a9a,{'online':!![]}),function(_0x49df6a){return db[_0x15f2('0x7f')][_0x15f2('0x80')]({'membername':_0x49df6a[_0x15f2('0x33')],'UserId':_0x49df6a['id'],'queue_name':_0xfa4bee[_0x15f2('0x33')],'VoiceQueueId':_0xfa4bee['id'],'interface':_['isNil'](_0x49df6a[_0x15f2('0x76')])?util[_0x15f2('0x81')](_0x15f2('0x82'),_0x49df6a[_0x15f2('0x33')]):_0x49df6a[_0x15f2('0x76')],'paused':_0x49df6a[_0x15f2('0x75')]||![],'penalty':_0x49df6a[_0x15f2('0x78')]},{'transaction':_0x521b53});});})[_0x15f2('0x2a')](function(){_0x2e2a9a['forEach'](function(_0x39a21b){socket[_0x15f2('0x83')]('userVoiceQueue:save',{'UserId':_0x39a21b['id'],'VoiceQueueId':_0xfa4bee['id']});});});});});}})['then'](respondWithStatusCode(_0x5da7bb,null))['catch'](handleError(_0x5da7bb,null));};exports[_0x15f2('0x84')]=function(_0x1652fd,_0x461f0e,_0x3234f2){return db[_0x15f2('0x6f')]['findAll']({'where':{'id':_0x1652fd[_0x15f2('0x3c')][_0x15f2('0x85')]},'attributes':['id'],'include':[{'model':db[_0x15f2('0x86')],'as':_0x15f2('0x73'),'attributes':['id'],'raw':!![]}]})[_0x15f2('0x2a')](handleEntityNotFound(_0x461f0e,null))[_0x15f2('0x2a')](function(_0x18c603){var _0x347ddd=_[_0x15f2('0x2f')](_0x18c603,'id');var _0x4f4507=[];var _0x541118=[];var _0x16c2cc=squel[_0x15f2('0x87')]();_0x16c2cc['field'](_0x15f2('0x88'))[_0x15f2('0x89')](_0x15f2('0x8a'),'tq')['join'](_0x15f2('0x8b'),'ut',_0x15f2('0x8c'))[_0x15f2('0x46')](_0x15f2('0x8d'),_0x1652fd['params']['id']);for(var _0x519f56=0x0;_0x519f56<_0x18c603['length'];_0x519f56+=0x1){let _0x58f271=_0x18c603[_0x519f56];for(var _0x3b349a=0x0;_0x3b349a<_0x58f271[_0x15f2('0x73')][_0x15f2('0x41')];_0x3b349a+=0x1){let _0x245b17=_0x58f271[_0x15f2('0x73')][_0x3b349a];var _0x4d28a1=_0x16c2cc[_0x15f2('0x5c')]();_0x4d28a1['where'](_0x15f2('0x8e'),_0x245b17['id']);_0x541118[_0x15f2('0x8f')](db[_0x15f2('0x79')][_0x15f2('0x3c')](_0x4d28a1[_0x15f2('0x90')](),{'type':db[_0x15f2('0x79')][_0x15f2('0x91')]['SELECT']})['then'](function(_0x28037f){if(_0x28037f[_0x15f2('0x41')]===0x1){return _0x245b17['id'];}else{var _0x26aebe=_[_0x15f2('0x92')](_[_0x15f2('0x2f')](_0x28037f,'TeamId'),function(_0x4bb840){return _['includes'](_0x347ddd,_0x4bb840);});if(_0x26aebe){return _0x245b17['id'];}}}));}}return BPromise[_0x15f2('0x93')](_0x541118)['then'](function(_0xb0ea90){_0x4f4507=_(_0x4f4507)[_0x15f2('0x94')](_0xb0ea90)[_0x15f2('0x95')]()[_0x15f2('0x30')]();return db['VoiceQueue'][_0x15f2('0x32')]({'where':{'id':_0x1652fd[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](function(_0x336f29){return db[_0x15f2('0x79')]['transaction'](function(_0x5214a0){return _0x336f29['removeTeams'](_0x1652fd[_0x15f2('0x3c')][_0x15f2('0x85')],{'transaction':_0x5214a0})[_0x15f2('0x2a')](function(){if(!_['isEmpty'](_0x4f4507)){return _0x336f29[_0x15f2('0x96')](_0x4f4507,{'transaction':_0x5214a0})['then'](function(){return db[_0x15f2('0x7f')][_0x15f2('0x2b')]({'where':{'VoiceQueueId':_0x1652fd['params']['id'],'UserId':_0x4f4507},'transaction':_0x5214a0});});}})[_0x15f2('0x2a')](function(){_0x4f4507[_0x15f2('0x97')](function(_0x9aaceb){socket[_0x15f2('0x83')](_0x15f2('0x98'),{'UserId':_0x9aaceb,'VoiceQueueId':_0x336f29['id']});});});});});});})[_0x15f2('0x2a')](respondWithStatusCode(_0x461f0e,null))[_0x15f2('0x50')](handleError(_0x461f0e,null));};exports[_0x15f2('0x99')]=function(_0x3cf2ab,_0x3acccb,_0x4d3fb6){var _0x2247a0,_0x264201;return db[_0x15f2('0x4b')][_0x15f2('0x32')]({'where':{'id':_0x3cf2ab[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x3acccb,null))[_0x15f2('0x2a')](function(_0x3f59e8){if(_0x3f59e8){_0x264201=_0x3f59e8;return _0x3f59e8[_0x15f2('0x99')](_0x3cf2ab['body'][_0x15f2('0x85')],_['omit'](_0x3cf2ab[_0x15f2('0x61')],[_0x15f2('0x85'),'id'])||{})['spread'](function(_0x489e93){for(var _0x57e433=0x0;_0x57e433<_0x3cf2ab[_0x15f2('0x61')]['ids'][_0x15f2('0x41')];_0x57e433+=0x1){socket['emit'](_0x15f2('0x9a'),{'UserId':Number(_0x3cf2ab[_0x15f2('0x61')][_0x15f2('0x85')][_0x57e433]),'VoiceQueueId':Number(_0x3cf2ab[_0x15f2('0x5d')]['id'])});}return _0x489e93;});}})[_0x15f2('0x2a')](function(_0x491b92){_0x2247a0=_0x491b92||[];if(_0x264201){return db[_0x15f2('0x86')][_0x15f2('0x4e')]({'where':{'id':_0x3cf2ab[_0x15f2('0x61')][_0x15f2('0x85')]},'attributes':['id','name',_0x15f2('0x74'),_0x15f2('0x75'),'interface'],'raw':!![]});}})[_0x15f2('0x2a')](function(_0x148df7){if(!_[_0x15f2('0x9b')](_0x148df7)){var _0x2bece5=[];for(var _0x49b0c9=0x0;_0x49b0c9<_0x148df7[_0x15f2('0x41')];_0x49b0c9++){if(_0x148df7[_0x49b0c9]['online']){_0x2bece5[_0x15f2('0x8f')](db[_0x15f2('0x7f')]['upsert']({'membername':_0x148df7[_0x49b0c9][_0x15f2('0x33')],'UserId':_0x148df7[_0x49b0c9]['id'],'queue_name':_0x264201[_0x15f2('0x33')],'VoiceQueueId':_0x264201['id'],'interface':_[_0x15f2('0x9c')](_0x148df7[_0x49b0c9][_0x15f2('0x76')])?util[_0x15f2('0x81')](_0x15f2('0x82'),_0x148df7[_0x49b0c9][_0x15f2('0x33')]):_0x148df7[_0x49b0c9][_0x15f2('0x76')],'paused':_0x148df7[_0x49b0c9][_0x15f2('0x75')]||![],'penalty':_0x3cf2ab[_0x15f2('0x61')]['penalty']||0x0}));}}return BPromise['all'](_0x2bece5);}})[_0x15f2('0x2a')](function(){return _0x2247a0;})['then'](respondWithResult(_0x3acccb,null))['catch'](handleError(_0x3acccb,null));};exports[_0x15f2('0x96')]=function(_0x3b3678,_0x166d43,_0x13ab1d){return db['VoiceQueue'][_0x15f2('0x32')]({'where':{'id':_0x3b3678[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x166d43,null))['then'](function(_0x48ac17){if(_0x48ac17){return _0x48ac17[_0x15f2('0x96')](_0x3b3678[_0x15f2('0x3c')][_0x15f2('0x85')])[_0x15f2('0x2a')](function(){if(_[_0x15f2('0x9d')](_0x3b3678[_0x15f2('0x3c')][_0x15f2('0x85')])){for(var _0x4c7c62=0x0;_0x4c7c62<_0x3b3678['query'][_0x15f2('0x85')][_0x15f2('0x41')];_0x4c7c62+=0x1){socket['emit'](_0x15f2('0x98'),{'UserId':Number(_0x3b3678[_0x15f2('0x3c')][_0x15f2('0x85')][_0x4c7c62]),'VoiceQueueId':Number(_0x3b3678[_0x15f2('0x5d')]['id'])});}}else{socket[_0x15f2('0x83')](_0x15f2('0x98'),{'UserId':Number(_0x3b3678['query'][_0x15f2('0x85')]),'VoiceQueueId':Number(_0x3b3678['params']['id'])});}});}})['then'](function(_0x558090){return db[_0x15f2('0x7f')][_0x15f2('0x2b')]({'where':{'VoiceQueueId':_0x3b3678[_0x15f2('0x5d')]['id'],'UserId':_0x3b3678[_0x15f2('0x3c')]['ids']}})[_0x15f2('0x2a')](function(){return _0x558090;});})[_0x15f2('0x2a')](respondWithStatusCode(_0x166d43,null))[_0x15f2('0x50')](handleError(_0x166d43,null));};exports[_0x15f2('0x9e')]=function(_0x5b285f,_0x19a740,_0x2dd3c3){var _0x20f83={};var _0x3e7596={};var _0x1a6aa3;var _0x482a20;return db['VoiceQueue'][_0x15f2('0x66')]({'where':{'id':_0x5b285f[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x19a740,null))[_0x15f2('0x2a')](function(_0x444c76){if(_0x444c76){_0x1a6aa3=_0x444c76;_0x3e7596[_0x15f2('0x3a')]=_[_0x15f2('0x3b')](db[_0x15f2('0x86')][_0x15f2('0x36')]);_0x3e7596[_0x15f2('0x3c')]=_[_0x15f2('0x3b')](_0x5b285f['query']);_0x3e7596[_0x15f2('0x3d')]=_['intersection'](_0x3e7596['model'],_0x3e7596[_0x15f2('0x3c')]);_0x20f83['attributes']=_[_0x15f2('0x3e')](_0x3e7596['model'],qs[_0x15f2('0x3f')](_0x5b285f[_0x15f2('0x3c')][_0x15f2('0x3f')]));_0x20f83[_0x15f2('0x40')]=_0x20f83[_0x15f2('0x40')]['length']?_0x20f83['attributes']:_0x3e7596[_0x15f2('0x3a')];_0x20f83[_0x15f2('0x44')]=qs[_0x15f2('0x45')](_0x5b285f['query'][_0x15f2('0x45')]);_0x20f83[_0x15f2('0x46')]=qs[_0x15f2('0x3d')](_[_0x15f2('0x47')](_0x5b285f[_0x15f2('0x3c')],_0x3e7596['filters']));if(_0x5b285f[_0x15f2('0x3c')]['filter']){_0x20f83[_0x15f2('0x46')]=_[_0x15f2('0x48')](_0x20f83[_0x15f2('0x46')],{'$or':_[_0x15f2('0x2f')](_0x20f83[_0x15f2('0x40')],function(_0x880cde){var _0x1be674={};_0x1be674[_0x880cde]={'$like':'%'+_0x5b285f[_0x15f2('0x3c')][_0x15f2('0x2d')]+'%'};return _0x1be674;})});}_0x20f83=_[_0x15f2('0x48')]({},_0x20f83,_0x5b285f[_0x15f2('0x4a')]);return _0x1a6aa3[_0x15f2('0x9e')](_0x20f83);}})['then'](function(_0x61070f){if(_0x61070f){_0x482a20=_0x61070f[_0x15f2('0x41')];if(!_0x5b285f['query'][_0x15f2('0x42')](_0x15f2('0x43'))){_0x20f83[_0x15f2('0x24')]=qs[_0x15f2('0x24')](_0x5b285f[_0x15f2('0x3c')][_0x15f2('0x24')]);_0x20f83[_0x15f2('0x22')]=qs[_0x15f2('0x22')](_0x5b285f[_0x15f2('0x3c')][_0x15f2('0x22')]);}return _0x1a6aa3['getAgents'](_0x20f83);}})['then'](function(_0x17ed41){if(_0x17ed41){return _0x17ed41?{'count':_0x482a20,'rows':_0x17ed41}:null;}})[_0x15f2('0x2a')](respondWithResult(_0x19a740,null))['catch'](handleError(_0x19a740,null));};exports[_0x15f2('0x9f')]=function(_0x4f3115,_0x58eabc,_0x28969c){var _0x36eee0={};var _0x449bba={};var _0xec1672;var _0xd993e;return db['VoiceQueue'][_0x15f2('0x66')]({'where':{'id':_0x4f3115[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x58eabc,null))['then'](function(_0x2ea628){if(_0x2ea628){_0xec1672=_0x2ea628;_0x449bba['model']=_['keys'](db[_0x15f2('0x7f')][_0x15f2('0x36')]);_0x449bba['query']=_['keys'](_0x4f3115[_0x15f2('0x3c')]);_0x449bba[_0x15f2('0x3d')]=_['intersection'](_0x449bba['model'],_0x449bba[_0x15f2('0x3c')]);_0x36eee0[_0x15f2('0x40')]=_[_0x15f2('0x3e')](_0x449bba[_0x15f2('0x3a')],qs['fields'](_0x4f3115[_0x15f2('0x3c')][_0x15f2('0x3f')]));_0x36eee0[_0x15f2('0x40')]=_0x36eee0[_0x15f2('0x40')][_0x15f2('0x41')]?_0x36eee0['attributes']:_0x449bba[_0x15f2('0x3a')];_0x36eee0[_0x15f2('0x44')]=qs[_0x15f2('0x45')](_0x4f3115[_0x15f2('0x3c')][_0x15f2('0x45')]);_0x36eee0[_0x15f2('0x46')]=qs['filters'](_['pick'](_0x4f3115[_0x15f2('0x3c')],_0x449bba['filters']));if(_0x4f3115[_0x15f2('0x3c')][_0x15f2('0x2d')]){_0x36eee0[_0x15f2('0x46')]=_[_0x15f2('0x48')](_0x36eee0[_0x15f2('0x46')],{'$or':_[_0x15f2('0x2f')](_0x36eee0[_0x15f2('0x40')],function(_0xf8ca5a){var _0xb4a709={};_0xb4a709[_0xf8ca5a]={'$like':'%'+_0x4f3115[_0x15f2('0x3c')][_0x15f2('0x2d')]+'%'};return _0xb4a709;})});}_0x36eee0=_[_0x15f2('0x48')]({},_0x36eee0,_0x4f3115[_0x15f2('0x4a')]);return _0xec1672['getMembers'](_0x36eee0);}})[_0x15f2('0x2a')](function(_0x4e0d68){if(_0x4e0d68){_0xd993e=_0x4e0d68[_0x15f2('0x41')];if(!_0x4f3115['query']['hasOwnProperty'](_0x15f2('0x43'))){_0x36eee0['limit']=qs['limit'](_0x4f3115[_0x15f2('0x3c')][_0x15f2('0x24')]);_0x36eee0[_0x15f2('0x22')]=qs[_0x15f2('0x22')](_0x4f3115[_0x15f2('0x3c')][_0x15f2('0x22')]);}return _0xec1672[_0x15f2('0x9f')](_0x36eee0);}})[_0x15f2('0x2a')](function(_0x246844){return _0x246844?{'count':_0xd993e,'rows':_0x246844}:null;})[_0x15f2('0x2a')](respondWithResult(_0x58eabc,null))[_0x15f2('0x50')](handleError(_0x58eabc,null));};exports['getLists']=function(_0x3f3cd8,_0x5cf237,_0x2d4f7c){var _0x22a6c6={};var _0x3f35ff={};var _0x4f9b8c;var _0x1296b6;return db[_0x15f2('0x4b')]['findOne']({'where':{'id':_0x3f3cd8[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x5cf237,null))[_0x15f2('0x2a')](function(_0x3382a0){if(_0x3382a0){_0x4f9b8c=_0x3382a0;_0x3f35ff[_0x15f2('0x3a')]=_[_0x15f2('0x3b')](db[_0x15f2('0xa0')]['rawAttributes']);_0x3f35ff[_0x15f2('0x3c')]=_[_0x15f2('0x3b')](_0x3f3cd8['query']);_0x3f35ff[_0x15f2('0x3d')]=_[_0x15f2('0x3e')](_0x3f35ff[_0x15f2('0x3a')],_0x3f35ff['query']);_0x22a6c6[_0x15f2('0x40')]=_[_0x15f2('0x3e')](_0x3f35ff[_0x15f2('0x3a')],qs['fields'](_0x3f3cd8[_0x15f2('0x3c')][_0x15f2('0x3f')]));_0x22a6c6['attributes']=_0x22a6c6['attributes']['length']?_0x22a6c6[_0x15f2('0x40')]:_0x3f35ff[_0x15f2('0x3a')];_0x22a6c6[_0x15f2('0x44')]=qs[_0x15f2('0x45')](_0x3f3cd8['query'][_0x15f2('0x45')]);_0x22a6c6[_0x15f2('0x46')]=qs[_0x15f2('0x3d')](_[_0x15f2('0x47')](_0x3f3cd8['query'],_0x3f35ff[_0x15f2('0x3d')]));if(_0x3f3cd8[_0x15f2('0x3c')][_0x15f2('0x2d')]){_0x22a6c6[_0x15f2('0x46')]=_[_0x15f2('0x48')](_0x22a6c6[_0x15f2('0x46')],{'$or':_['map'](_0x22a6c6[_0x15f2('0x40')],function(_0x466f18){var _0x381d38={};_0x381d38[_0x466f18]={'$like':'%'+_0x3f3cd8[_0x15f2('0x3c')][_0x15f2('0x2d')]+'%'};return _0x381d38;})});}_0x22a6c6=_[_0x15f2('0x48')]({},_0x22a6c6,_0x3f3cd8['options']);return _0x4f9b8c[_0x15f2('0xa1')](_0x22a6c6);}})[_0x15f2('0x2a')](function(_0x37df30){if(_0x37df30){_0x1296b6=_0x37df30[_0x15f2('0x41')];if(!_0x3f3cd8[_0x15f2('0x3c')][_0x15f2('0x42')](_0x15f2('0x43'))){_0x22a6c6[_0x15f2('0x24')]=qs['limit'](_0x3f3cd8[_0x15f2('0x3c')][_0x15f2('0x24')]);_0x22a6c6['offset']=qs[_0x15f2('0x22')](_0x3f3cd8[_0x15f2('0x3c')][_0x15f2('0x22')]);}return _0x4f9b8c['getLists'](_0x22a6c6);}})[_0x15f2('0x2a')](function(_0x5cd27e){if(_0x5cd27e){return _0x5cd27e?{'count':_0x1296b6,'rows':_0x5cd27e}:null;}})[_0x15f2('0x2a')](respondWithResult(_0x5cf237,null))[_0x15f2('0x50')](handleError(_0x5cf237,null));};exports[_0x15f2('0xa2')]=function(_0x1d0edd,_0x47e3a0,_0xce3c0e){var _0x317420,_0x1fe6ec;return db[_0x15f2('0x4b')][_0x15f2('0x32')]({'where':{'id':_0x1d0edd[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x47e3a0,null))[_0x15f2('0x2a')](function(_0x198286){if(_0x198286){_0x1fe6ec=_0x198286;return _0x198286[_0x15f2('0xa2')](_0x1d0edd['body'][_0x15f2('0x85')],_[_0x15f2('0x5e')](_0x1d0edd['body'],[_0x15f2('0x85'),'id'])||{});}return null;})['spread'](function(_0x2e2c31){var _0x1d3488;_0x317420=_0x2e2c31||[];var _0x52b72a=[];if(_0x2e2c31){for(var _0x4a25ae=0x0;_0x4a25ae<_0x2e2c31[_0x15f2('0x41')];_0x4a25ae+=0x1){var _0x3d2302=_0x2e2c31[_0x4a25ae][_0x15f2('0x53')]({'plain':!![]});_0x1fe6ec[_0x15f2('0xa3')]=_0x1d0edd['body'][_0x15f2('0xa3')]?_0x1d0edd['body']['dialCheckDuplicateType']:_0x1fe6ec['dialCheckDuplicateType'];switch(_0x1fe6ec[_0x15f2('0xa3')]){case'always':_0x1d3488=squel[_0x15f2('0xa4')]()['into'](_0x15f2('0xa5'))['fromQuery']([_0x15f2('0xa6'),_0x15f2('0xa7'),_0x15f2('0xa8'),_0x15f2('0xa9'),'VoiceQueueId',_0x15f2('0x5f'),'updatedAt'],squel[_0x15f2('0x87')]()[_0x15f2('0xaa')](_0x15f2('0xa6'),_0x15f2('0xa6'))[_0x15f2('0xaa')](_0x15f2('0xab'),_0x15f2('0xa7'))[_0x15f2('0xaa')]('id',_0x15f2('0xa8'))[_0x15f2('0xaa')](_0x3d2302[_0x15f2('0xac')][_0x15f2('0x90')](),_0x15f2('0xa9'))['field'](_0x1d0edd[_0x15f2('0x5d')]['id'][_0x15f2('0x90')](),_0x15f2('0x68'))[_0x15f2('0xaa')](_0x15f2('0xab'),'createdAt')['field'](_0x15f2('0xab'),'updatedAt')[_0x15f2('0x89')]('cm_contacts')['where'](_0x15f2('0xad'))[_0x15f2('0x46')]('ListId\x20=\x20?',_0x3d2302[_0x15f2('0xac')][_0x15f2('0x90')]())[_0x15f2('0x46')](_0x15f2('0xae'))[_0x15f2('0x46')](_0x15f2('0xaf'),squel['select']()[_0x15f2('0xaa')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')[_0x15f2('0x46')](_0x15f2('0x8d'),_0x1d0edd[_0x15f2('0x5d')]['id'][_0x15f2('0x90')]()))[_0x15f2('0x46')](_0x15f2('0xaf'),squel[_0x15f2('0x87')]()['field']('COALESCE(phone,\x27\x27)')[_0x15f2('0x89')](_0x15f2('0xa5'))[_0x15f2('0x46')]('VoiceQueueId\x20=\x20?',_0x1d0edd[_0x15f2('0x5d')]['id'][_0x15f2('0x90')]())))[_0x15f2('0x90')]();break;case _0x15f2('0xb0'):_0x1d3488=squel[_0x15f2('0xa4')]()['into'](_0x15f2('0xa5'))[_0x15f2('0xb1')]([_0x15f2('0xa6'),_0x15f2('0xa7'),_0x15f2('0xa8'),_0x15f2('0xa9'),_0x15f2('0x68'),_0x15f2('0x5f'),_0x15f2('0x60')],squel[_0x15f2('0x87')]()[_0x15f2('0xaa')](_0x15f2('0xa6'),_0x15f2('0xa6'))[_0x15f2('0xaa')]('NOW()',_0x15f2('0xa7'))[_0x15f2('0xaa')]('id',_0x15f2('0xa8'))[_0x15f2('0xaa')](_0x3d2302[_0x15f2('0xac')]['toString'](),_0x15f2('0xa9'))[_0x15f2('0xaa')](_0x1d0edd[_0x15f2('0x5d')]['id'][_0x15f2('0x90')](),_0x15f2('0x68'))[_0x15f2('0xaa')]('NOW()',_0x15f2('0x5f'))[_0x15f2('0xaa')](_0x15f2('0xab'),_0x15f2('0x60'))[_0x15f2('0x89')]('cm_contacts')[_0x15f2('0x46')](_0x15f2('0xad'))[_0x15f2('0x46')]('ListId\x20=\x20?',_0x3d2302['CmListId'][_0x15f2('0x90')]())[_0x15f2('0x46')](_0x15f2('0xae'))[_0x15f2('0x46')](_0x15f2('0xaf'),squel[_0x15f2('0x87')]()[_0x15f2('0xaa')](_0x15f2('0xb2'))['from'](_0x15f2('0xa5'))[_0x15f2('0x46')]('VoiceQueueId\x20=\x20?',_0x1d0edd[_0x15f2('0x5d')]['id']['toString']())))[_0x15f2('0x90')]();break;default:_0x1d3488=squel['insert']()[_0x15f2('0xb3')]('cm_hopper')[_0x15f2('0xb1')](['phone',_0x15f2('0xa7'),_0x15f2('0xa8'),'ListId',_0x15f2('0x68'),_0x15f2('0x5f'),_0x15f2('0x60')],squel[_0x15f2('0x87')]()[_0x15f2('0xaa')](_0x15f2('0xa6'),'phone')[_0x15f2('0xaa')]('NOW()',_0x15f2('0xa7'))[_0x15f2('0xaa')]('id',_0x15f2('0xa8'))[_0x15f2('0xaa')](_0x3d2302['CmListId'][_0x15f2('0x90')](),_0x15f2('0xa9'))[_0x15f2('0xaa')](_0x1d0edd['params']['id'][_0x15f2('0x90')](),_0x15f2('0x68'))[_0x15f2('0xaa')](_0x15f2('0xab'),_0x15f2('0x5f'))[_0x15f2('0xaa')](_0x15f2('0xab'),'updatedAt')[_0x15f2('0x89')]('cm_contacts')[_0x15f2('0x46')](_0x15f2('0xad'))[_0x15f2('0x46')](_0x15f2('0xb4'),_0x3d2302[_0x15f2('0xac')][_0x15f2('0x90')]())['where'](_0x15f2('0xae')))['toString']();}_0x52b72a['push'](db[_0x15f2('0x79')][_0x15f2('0x3c')](_0x1d3488));}return BPromise[_0x15f2('0x93')](_0x52b72a);}})[_0x15f2('0x2a')](function(){return _0x317420;})[_0x15f2('0x2a')](respondWithResult(_0x47e3a0,null))[_0x15f2('0x50')](handleError(_0x47e3a0,null));};exports['removeLists']=function(_0x2d47a9,_0x514964,_0x350971){return db[_0x15f2('0x4b')]['find']({'where':{'id':_0x2d47a9[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x514964,null))[_0x15f2('0x2a')](function(_0x8bc9b7){if(_0x8bc9b7){return _0x8bc9b7[_0x15f2('0xb5')](_0x2d47a9[_0x15f2('0x3c')]['ids']);}})[_0x15f2('0x2a')](function(_0x2e2e19){if(_0x2e2e19){return db[_0x15f2('0x67')][_0x15f2('0x2b')]({'where':{'ListId':_0x2d47a9[_0x15f2('0x3c')][_0x15f2('0x85')],'VoiceQueueId':_0x2d47a9['params']['id']}})['then'](function(){return _0x2e2e19;});}})['then'](respondWithStatusCode(_0x514964,null))[_0x15f2('0x50')](handleError(_0x514964,null));};exports[_0x15f2('0xb6')]=function(_0x5846ff,_0x590bee,_0x262558){var _0x2b0ccf={};var _0x4f4345={};var _0x364c4f;var _0x4588ad;return db['VoiceQueue'][_0x15f2('0x66')]({'where':{'id':_0x5846ff[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x590bee,null))[_0x15f2('0x2a')](function(_0x2601e3){if(_0x2601e3){_0x364c4f=_0x2601e3;_0x4f4345[_0x15f2('0x3a')]=_[_0x15f2('0x3b')](db[_0x15f2('0xa0')][_0x15f2('0x36')]);_0x4f4345[_0x15f2('0x3c')]=_[_0x15f2('0x3b')](_0x5846ff[_0x15f2('0x3c')]);_0x4f4345[_0x15f2('0x3d')]=_[_0x15f2('0x3e')](_0x4f4345[_0x15f2('0x3a')],_0x4f4345['query']);_0x2b0ccf[_0x15f2('0x40')]=_[_0x15f2('0x3e')](_0x4f4345[_0x15f2('0x3a')],qs[_0x15f2('0x3f')](_0x5846ff[_0x15f2('0x3c')][_0x15f2('0x3f')]));_0x2b0ccf['attributes']=_0x2b0ccf['attributes'][_0x15f2('0x41')]?_0x2b0ccf[_0x15f2('0x40')]:_0x4f4345[_0x15f2('0x3a')];_0x2b0ccf[_0x15f2('0x44')]=qs[_0x15f2('0x45')](_0x5846ff[_0x15f2('0x3c')]['sort']);_0x2b0ccf[_0x15f2('0x46')]=qs[_0x15f2('0x3d')](_[_0x15f2('0x47')](_0x5846ff[_0x15f2('0x3c')],_0x4f4345[_0x15f2('0x3d')]));if(_0x5846ff[_0x15f2('0x3c')]['filter']){_0x2b0ccf[_0x15f2('0x46')]=_[_0x15f2('0x48')](_0x2b0ccf[_0x15f2('0x46')],{'$or':_[_0x15f2('0x2f')](_0x2b0ccf[_0x15f2('0x40')],function(_0x384069){var _0x30da79={};_0x30da79[_0x384069]={'$like':'%'+_0x5846ff[_0x15f2('0x3c')][_0x15f2('0x2d')]+'%'};return _0x30da79;})});}_0x2b0ccf=_[_0x15f2('0x48')]({},_0x2b0ccf,_0x5846ff[_0x15f2('0x4a')]);return _0x364c4f[_0x15f2('0xb6')](_0x2b0ccf);}})[_0x15f2('0x2a')](function(_0x457353){if(_0x457353){_0x4588ad=_0x457353['length'];if(!_0x5846ff[_0x15f2('0x3c')][_0x15f2('0x42')](_0x15f2('0x43'))){_0x2b0ccf[_0x15f2('0x24')]=qs['limit'](_0x5846ff[_0x15f2('0x3c')][_0x15f2('0x24')]);_0x2b0ccf[_0x15f2('0x22')]=qs[_0x15f2('0x22')](_0x5846ff[_0x15f2('0x3c')][_0x15f2('0x22')]);}return _0x364c4f[_0x15f2('0xb6')](_0x2b0ccf);}})['then'](function(_0x258af7){if(_0x258af7){return _0x258af7?{'count':_0x4588ad,'rows':_0x258af7}:null;}})[_0x15f2('0x2a')](respondWithResult(_0x590bee,null))[_0x15f2('0x50')](handleError(_0x590bee,null));};exports[_0x15f2('0xb7')]=function(_0x1121af,_0x11a937,_0x7630be){var _0x89a86c,_0x377f68;return db['VoiceQueue']['find']({'where':{'id':_0x1121af[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x11a937,null))[_0x15f2('0x2a')](function(_0x31bc61){if(_0x31bc61){_0x377f68=_0x31bc61;return _0x31bc61[_0x15f2('0xb7')](_0x1121af[_0x15f2('0x61')][_0x15f2('0x85')],_['omit'](_0x1121af[_0x15f2('0x61')],[_0x15f2('0x85'),'id'])||{});}return null;})[_0x15f2('0xb8')](function(_0x33e95a){var _0x107834;_0x89a86c=_0x33e95a||[];var _0x16fcab=[];if(_0x33e95a){for(var _0x281e88=0x0;_0x281e88<_0x33e95a[_0x15f2('0x41')];_0x281e88+=0x1){var _0x2c7b72=_0x33e95a[_0x281e88][_0x15f2('0x53')]({'plain':!![]});_0x107834=squel[_0x15f2('0xa4')]()[_0x15f2('0xb3')](_0x15f2('0xb9'))[_0x15f2('0xb1')]([_0x15f2('0xa6'),_0x15f2('0xa8'),_0x15f2('0xa9'),_0x15f2('0x68'),'createdAt',_0x15f2('0x60')],squel[_0x15f2('0x87')]()[_0x15f2('0xaa')](_0x15f2('0xa6'),_0x15f2('0xa6'))[_0x15f2('0xaa')]('id',_0x15f2('0xa8'))[_0x15f2('0xaa')](_0x2c7b72['CmListId']['toString'](),_0x15f2('0xa9'))[_0x15f2('0xaa')](_0x1121af[_0x15f2('0x5d')]['id'][_0x15f2('0x90')](),_0x15f2('0x68'))[_0x15f2('0xaa')](_0x15f2('0xab'),'createdAt')[_0x15f2('0xaa')](_0x15f2('0xab'),_0x15f2('0x60'))[_0x15f2('0x89')](_0x15f2('0xba'))[_0x15f2('0x46')](_0x15f2('0xad'))[_0x15f2('0x46')](_0x15f2('0xb4'),_0x2c7b72[_0x15f2('0xac')]['toString']())['where'](_0x15f2('0xae')))[_0x15f2('0x90')]();_0x16fcab[_0x15f2('0x8f')](db[_0x15f2('0x79')][_0x15f2('0x3c')](_0x107834));}return BPromise[_0x15f2('0x93')](_0x16fcab);}})['then'](function(){return _0x89a86c;})[_0x15f2('0x2a')](respondWithResult(_0x11a937,null))[_0x15f2('0x50')](handleError(_0x11a937,null));};exports[_0x15f2('0xbb')]=function(_0x3815c4,_0x44de17,_0x2d7c04){return db[_0x15f2('0x4b')]['find']({'where':{'id':_0x3815c4[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](handleEntityNotFound(_0x44de17,null))[_0x15f2('0x2a')](function(_0x5b4674){if(_0x5b4674){return _0x5b4674[_0x15f2('0xbb')](_0x3815c4[_0x15f2('0x3c')][_0x15f2('0x85')]);}})[_0x15f2('0x2a')](function(_0x47a107){if(_0x47a107){return db[_0x15f2('0x6e')]['destroy']({'where':{'ListId':_0x3815c4[_0x15f2('0x3c')][_0x15f2('0x85')],'VoiceQueueId':_0x3815c4[_0x15f2('0x5d')]['id']}})[_0x15f2('0x2a')](function(){return _0x47a107;});}})[_0x15f2('0x2a')](respondWithStatusCode(_0x44de17,null))[_0x15f2('0x50')](handleError(_0x44de17,null));}; \ No newline at end of file +var _0xabb0=['ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeAgents','addAgents','spread','isEmpty','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','field','CmListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','scheduledAt','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','set','apply','save','update','destroy','then','VoiceQueues','outbound','map','value','type','find','name','UserProfileResource','stack','send','index','VoiceQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','show','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','merge','inbound','getHoppers','CmHopper','VoiceQueueId','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','teams','User','Agents','online','interface','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId'];(function(_0x12d463,_0x579a31){var _0x33e6fd=function(_0x403942){while(--_0x403942){_0x12d463['push'](_0x12d463['shift']());}};_0x33e6fd(++_0x579a31);}(_0xabb0,0x1a5));var _0x0abb=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xabb0[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x0abb('0x0'));var rimraf=require(_0x0abb('0x1'));var zipdir=require(_0x0abb('0x2'));var jsonpatch=require(_0x0abb('0x3'));var rp=require('request-promise');var moment=require(_0x0abb('0x4'));var BPromise=require(_0x0abb('0x5'));var Mustache=require(_0x0abb('0x6'));var util=require(_0x0abb('0x7'));var path=require(_0x0abb('0x8'));var sox=require(_0x0abb('0x9'));var csv=require(_0x0abb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0abb('0xb'));var squel=require('squel');var crypto=require(_0x0abb('0xc'));var jsforce=require(_0x0abb('0xd'));var deskjs=require(_0x0abb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0abb('0xf'));var Papa=require(_0x0abb('0x10'));var Redis=require(_0x0abb('0x11'));var authService=require(_0x0abb('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0abb('0x13'));var logger=require(_0x0abb('0x14'))(_0x0abb('0x15'));var utils=require(_0x0abb('0x16'));var config=require(_0x0abb('0x17'));var licenseUtil=require(_0x0abb('0x18'));var db=require(_0x0abb('0x19'))['db'];config[_0x0abb('0x1a')]=_[_0x0abb('0x1b')](config[_0x0abb('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0abb('0x1c'))(new Redis(config[_0x0abb('0x1a')]));require('./voiceQueue.socket')[_0x0abb('0x1d')](socket);function respondWithStatusCode(_0x558749,_0x5803a6){_0x5803a6=_0x5803a6||0xcc;return function(_0xc83348){if(_0xc83348){return _0x558749[_0x0abb('0x1e')](_0x5803a6);}return _0x558749[_0x0abb('0x1f')](_0x5803a6)[_0x0abb('0x20')]();};}function respondWithResult(_0x58f293,_0x95c082){_0x95c082=_0x95c082||0xc8;return function(_0xfd1704){if(_0xfd1704){return _0x58f293['status'](_0x95c082)[_0x0abb('0x21')](_0xfd1704);}};}function respondWithFilteredResult(_0x17f960,_0x28a8bd){return function(_0x15c507){if(_0x15c507){var _0x209ba0=typeof _0x28a8bd[_0x0abb('0x22')]==='undefined'&&typeof _0x28a8bd[_0x0abb('0x23')]==='undefined';var _0x418c23=_0x15c507[_0x0abb('0x24')];var _0x1793da=_0x209ba0?0x0:_0x28a8bd['offset'];var _0x220660=_0x209ba0?_0x15c507['count']:_0x28a8bd['offset']+_0x28a8bd['limit'];var _0x241135;if(_0x220660>=_0x418c23){_0x220660=_0x418c23;_0x241135=0xc8;}else{_0x241135=0xce;}_0x17f960[_0x0abb('0x1f')](_0x241135);return _0x17f960[_0x0abb('0x25')]('Content-Range',_0x1793da+'-'+_0x220660+'/'+_0x418c23)[_0x0abb('0x21')](_0x15c507);}return null;};}function patchUpdates(_0x1be6ca){return function(_0x16a53c){try{jsonpatch[_0x0abb('0x26')](_0x16a53c,_0x1be6ca,!![]);}catch(_0x15cc88){return BPromise['reject'](_0x15cc88);}return _0x16a53c[_0x0abb('0x27')]();};}function saveUpdates(_0x4794e2,_0x20fbb2){return function(_0x2a227a){if(_0x2a227a){return _0x2a227a[_0x0abb('0x28')](_0x4794e2)['then'](function(_0x34b640){return _0x34b640;});}return null;};}function removeEntity(_0x4a7739,_0x7d3533){return function(_0x317894){if(_0x317894){return _0x317894[_0x0abb('0x29')]()[_0x0abb('0x2a')](function(){var _0x47723f=_0x317894['get']({'plain':!![]});var _0x42a707=[{'name':_0x0abb('0x2b'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0x0abb('0x2c'),'ignore':![]}];var _0x466018=_(_0x42a707)['filter']('ignore')[_0x0abb('0x2d')](_0x0abb('0x2e'))['value']();if(_['includes'](_0x466018,_0x47723f[_0x0abb('0x2f')])){return;}var _0x58d288=_[_0x0abb('0x30')](_0x42a707,[_0x0abb('0x2e'),_0x47723f[_0x0abb('0x2f')]])[_0x0abb('0x31')];return db[_0x0abb('0x32')][_0x0abb('0x29')]({'where':{'type':_0x58d288,'resourceId':_0x47723f['id']}})[_0x0abb('0x2a')](function(){return _0x317894;});})[_0x0abb('0x2a')](function(){_0x4a7739['status'](0xcc)[_0x0abb('0x20')]();});}};}function handleEntityNotFound(_0x364fc7,_0x30c9e5){return function(_0x5eea12){if(!_0x5eea12){_0x364fc7[_0x0abb('0x1e')](0x194);}return _0x5eea12;};}function handleError(_0x458809,_0x10fd79){_0x10fd79=_0x10fd79||0x1f4;return function(_0x5ed3e7){logger['error'](_0x5ed3e7[_0x0abb('0x33')]);if(_0x5ed3e7[_0x0abb('0x31')]){delete _0x5ed3e7[_0x0abb('0x31')];}_0x458809['status'](_0x10fd79)[_0x0abb('0x34')](_0x5ed3e7);};}exports[_0x0abb('0x35')]=function(_0x19a325,_0x3a0fda){var _0x150c9f={},_0x139eeb={},_0x1414f4={'count':0x0,'rows':[]};var _0x1a158e=_[_0x0abb('0x2d')](db[_0x0abb('0x36')][_0x0abb('0x37')],function(_0x4ea61e){return{'name':_0x4ea61e[_0x0abb('0x38')],'type':_0x4ea61e[_0x0abb('0x2f')]['key']};});_0x139eeb[_0x0abb('0x39')]=_['map'](_0x1a158e,_0x0abb('0x31'));_0x139eeb[_0x0abb('0x3a')]=_[_0x0abb('0x3b')](_0x19a325['query']);_0x139eeb[_0x0abb('0x3c')]=_[_0x0abb('0x3d')](_0x139eeb['model'],_0x139eeb['query']);_0x150c9f[_0x0abb('0x3e')]=_[_0x0abb('0x3d')](_0x139eeb[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x19a325[_0x0abb('0x3a')][_0x0abb('0x3f')]));_0x150c9f[_0x0abb('0x3e')]=_0x150c9f[_0x0abb('0x3e')][_0x0abb('0x40')]?_0x150c9f[_0x0abb('0x3e')]:_0x139eeb[_0x0abb('0x39')];if(!_0x19a325['query'][_0x0abb('0x41')](_0x0abb('0x42'))){_0x150c9f[_0x0abb('0x23')]=qs['limit'](_0x19a325[_0x0abb('0x3a')][_0x0abb('0x23')]);_0x150c9f[_0x0abb('0x22')]=qs[_0x0abb('0x22')](_0x19a325['query'][_0x0abb('0x22')]);}_0x150c9f[_0x0abb('0x43')]=qs[_0x0abb('0x44')](_0x19a325[_0x0abb('0x3a')][_0x0abb('0x44')]);_0x150c9f[_0x0abb('0x45')]=qs[_0x0abb('0x3c')](_[_0x0abb('0x46')](_0x19a325[_0x0abb('0x3a')],_0x139eeb['filters']),_0x1a158e);if(_0x19a325['query'][_0x0abb('0x47')]){_0x150c9f['where']=_['merge'](_0x150c9f[_0x0abb('0x45')],{'$or':_[_0x0abb('0x2d')](_0x1a158e,function(_0xfc4b48){if(_0xfc4b48[_0x0abb('0x2f')]!==_0x0abb('0x48')){var _0x40c88a={};_0x40c88a[_0xfc4b48['name']]={'$like':'%'+_0x19a325[_0x0abb('0x3a')]['filter']+'%'};return _0x40c88a;}})});}_0x150c9f=_['merge']({},_0x150c9f,_0x19a325[_0x0abb('0x49')]);var _0x24c1bb={'where':_0x150c9f[_0x0abb('0x45')]};return db[_0x0abb('0x36')][_0x0abb('0x24')](_0x24c1bb)[_0x0abb('0x2a')](function(_0x3e10c2){_0x1414f4[_0x0abb('0x24')]=_0x3e10c2;if(_0x19a325[_0x0abb('0x3a')][_0x0abb('0x4a')]){_0x150c9f[_0x0abb('0x4b')]=[{'all':!![]}];}return db['VoiceQueue'][_0x0abb('0x4c')](_0x150c9f);})['then'](function(_0x51741d){_0x1414f4['rows']=_0x51741d;return _0x1414f4;})[_0x0abb('0x2a')](respondWithFilteredResult(_0x3a0fda,_0x150c9f))['catch'](handleError(_0x3a0fda,null));};exports[_0x0abb('0x4d')]=function(_0x4574c7,_0x4f6991){var _0x3fb7b0={'raw':![],'where':{'id':_0x4574c7['params']['id']}},_0x441d4a={};_0x441d4a[_0x0abb('0x39')]=_[_0x0abb('0x3b')](db[_0x0abb('0x36')]['rawAttributes']);_0x441d4a[_0x0abb('0x3a')]=_[_0x0abb('0x3b')](_0x4574c7[_0x0abb('0x3a')]);_0x441d4a[_0x0abb('0x3c')]=_['intersection'](_0x441d4a[_0x0abb('0x39')],_0x441d4a[_0x0abb('0x3a')]);_0x3fb7b0[_0x0abb('0x3e')]=_['intersection'](_0x441d4a[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x4574c7[_0x0abb('0x3a')][_0x0abb('0x3f')]));_0x3fb7b0['attributes']=_0x3fb7b0['attributes'][_0x0abb('0x40')]?_0x3fb7b0['attributes']:_0x441d4a['model'];if(_0x4574c7[_0x0abb('0x3a')][_0x0abb('0x4a')]){_0x3fb7b0[_0x0abb('0x4b')]=[{'all':!![]}];}_0x3fb7b0=_['merge']({},_0x3fb7b0,_0x4574c7['options']);return db[_0x0abb('0x36')][_0x0abb('0x30')](_0x3fb7b0)['then'](handleEntityNotFound(_0x4f6991,null))[_0x0abb('0x2a')](respondWithResult(_0x4f6991,null))[_0x0abb('0x4e')](handleError(_0x4f6991,null));};exports[_0x0abb('0x4f')]=function(_0x3a855d,_0x171859){return db[_0x0abb('0x36')][_0x0abb('0x4f')](_0x3a855d['body'],{})[_0x0abb('0x2a')](function(_0x5a9ba0){var _0xca3513=_0x3a855d[_0x0abb('0x50')][_0x0abb('0x51')]({'plain':!![]});if(!_0xca3513)throw new Error(_0x0abb('0x52'));if(_0xca3513[_0x0abb('0x53')]===_0x0abb('0x50')){var _0x120c4f=_0x5a9ba0['get']({'plain':!![]});var _0x44c639=[{'name':_0x0abb('0x2b'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x4f7e97=_[_0x0abb('0x30')](_0x44c639,[_0x0abb('0x2e'),_0x120c4f[_0x0abb('0x2f')]])[_0x0abb('0x31')];return db[_0x0abb('0x54')][_0x0abb('0x30')]({'where':{'name':_0x4f7e97,'userProfileId':_0xca3513[_0x0abb('0x55')]},'raw':!![]})[_0x0abb('0x2a')](function(_0x5e0fa2){if(_0x5e0fa2&&_0x5e0fa2[_0x0abb('0x56')]===0x0){return db[_0x0abb('0x32')]['create']({'name':_0x120c4f['name'],'resourceId':_0x120c4f['id'],'type':_0x5e0fa2[_0x0abb('0x31')],'sectionId':_0x5e0fa2['id']},{})[_0x0abb('0x2a')](function(){return _0x5a9ba0;});}else{return _0x5a9ba0;}})[_0x0abb('0x4e')](function(_0x1f4178){logger[_0x0abb('0x57')](_0x0abb('0x58'),_0x1f4178);throw _0x1f4178;});}return _0x5a9ba0;})[_0x0abb('0x2a')](respondWithResult(_0x171859,0xc9))[_0x0abb('0x4e')](handleError(_0x171859,null));};exports[_0x0abb('0x59')]=function(_0x4d2041,_0x2afb55){var _0x151734={'where':{'id':_0x4d2041[_0x0abb('0x5a')]['id']}},_0x47b37e={};_0x47b37e[_0x0abb('0x39')]=_[_0x0abb('0x3b')](db['VoiceQueue'][_0x0abb('0x37')]);_0x151734['attributes']=_[_0x0abb('0x3d')](_0x47b37e[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x4d2041[_0x0abb('0x3a')][_0x0abb('0x3f')]));_0x151734[_0x0abb('0x3e')]=_0x151734[_0x0abb('0x3e')][_0x0abb('0x40')]?_0x151734[_0x0abb('0x3e')]:_0x47b37e[_0x0abb('0x39')];if(_0x4d2041[_0x0abb('0x3a')][_0x0abb('0x4a')]){_0x151734[_0x0abb('0x4b')]=[{'all':!![]}];}_0x151734=_['merge']({},_0x151734,_0x4d2041[_0x0abb('0x49')]);return db[_0x0abb('0x36')][_0x0abb('0x30')](_0x151734)[_0x0abb('0x2a')](handleEntityNotFound(_0x2afb55,null))['then'](function(_0x5d709b){if(_0x5d709b){var _0x4b823f=_0x5d709b[_0x0abb('0x51')]({'plain':!![]});_0x4b823f=qs[_0x0abb('0x5b')](_0x4b823f,['id',_0x0abb('0x5c'),_0x0abb('0x5d')]);_0x4d2041[_0x0abb('0x5e')]=_['omit'](_0x4d2041[_0x0abb('0x5e')],['id','createdAt',_0x0abb('0x5d')]);return db[_0x0abb('0x36')][_0x0abb('0x4f')](_[_0x0abb('0x5f')](_0x4b823f,_0x4d2041[_0x0abb('0x5e')]),{'include':_0x4d2041[_0x0abb('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x0abb('0x2a')](function(_0x3575f3){var _0x27223e=_0x4d2041[_0x0abb('0x50')][_0x0abb('0x51')]({'plain':!![]});if(!_0x27223e)throw new Error(_0x0abb('0x52'));if(_0x27223e[_0x0abb('0x53')]==='user'){var _0x5b88e6=_0x3575f3[_0x0abb('0x51')]({'plain':!![]});var _0x264008=[{'name':'VoiceQueues','value':_0x0abb('0x60')},{'name':'QueueCampaigns','value':_0x0abb('0x2c')}];var _0x2f851b=_[_0x0abb('0x30')](_0x264008,[_0x0abb('0x2e'),_0x5b88e6[_0x0abb('0x2f')]])['name'];return db[_0x0abb('0x54')][_0x0abb('0x30')]({'where':{'name':_0x2f851b,'userProfileId':_0x27223e[_0x0abb('0x55')]},'raw':!![]})['then'](function(_0x2e40ad){if(_0x2e40ad&&_0x2e40ad[_0x0abb('0x56')]===0x0){return db[_0x0abb('0x32')][_0x0abb('0x4f')]({'name':_0x5b88e6['name'],'resourceId':_0x5b88e6['id'],'type':_0x2e40ad[_0x0abb('0x31')],'sectionId':_0x2e40ad['id']},{})['then'](function(){return _0x3575f3;});}else{return _0x3575f3;}})[_0x0abb('0x4e')](function(_0x536615){logger[_0x0abb('0x57')](_0x0abb('0x58'),_0x536615);throw _0x536615;});}return _0x3575f3;});}})['then'](respondWithResult(_0x2afb55,0xc9))[_0x0abb('0x4e')](handleError(_0x2afb55,null));};exports[_0x0abb('0x28')]=function(_0x7e16af,_0x4da1d5){if(_0x7e16af[_0x0abb('0x5e')]['id']){delete _0x7e16af[_0x0abb('0x5e')]['id'];}return db['VoiceQueue'][_0x0abb('0x30')]({'where':{'id':_0x7e16af['params']['id']}})['then'](handleEntityNotFound(_0x4da1d5,null))[_0x0abb('0x2a')](saveUpdates(_0x7e16af[_0x0abb('0x5e')],null))[_0x0abb('0x2a')](respondWithResult(_0x4da1d5,null))[_0x0abb('0x4e')](handleError(_0x4da1d5,null));};exports[_0x0abb('0x29')]=function(_0x23530d,_0x28a7e7){return db[_0x0abb('0x36')][_0x0abb('0x30')]({'where':{'id':_0x23530d[_0x0abb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x28a7e7,null))[_0x0abb('0x2a')](removeEntity(_0x28a7e7,null))[_0x0abb('0x4e')](handleError(_0x28a7e7,null));};exports[_0x0abb('0x61')]=function(_0x42da12,_0x19ff15,_0x6c4738){var _0x5b034b={'raw':![],'where':{}};var _0x194389={};var _0x11be1e={'count':0x0,'rows':[]};return db[_0x0abb('0x36')]['findOne']({'where':{'id':_0x42da12[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x19ff15,null))[_0x0abb('0x2a')](function(_0x2397a0){if(_0x2397a0){_0x194389[_0x0abb('0x39')]=_[_0x0abb('0x3b')](db[_0x0abb('0x62')]['rawAttributes']);_0x194389['query']=_[_0x0abb('0x3b')](_0x42da12[_0x0abb('0x3a')]);_0x194389[_0x0abb('0x3c')]=_[_0x0abb('0x3d')](_0x194389[_0x0abb('0x39')],_0x194389[_0x0abb('0x3a')]);_0x5b034b[_0x0abb('0x3e')]=_['intersection'](_0x194389[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x42da12[_0x0abb('0x3a')][_0x0abb('0x3f')]));_0x5b034b[_0x0abb('0x3e')]=_0x5b034b[_0x0abb('0x3e')]['length']?_0x5b034b['attributes']:_0x194389[_0x0abb('0x39')];if(!_0x42da12[_0x0abb('0x3a')][_0x0abb('0x41')](_0x0abb('0x42'))){_0x5b034b[_0x0abb('0x23')]=qs[_0x0abb('0x23')](_0x42da12[_0x0abb('0x3a')][_0x0abb('0x23')]);_0x5b034b[_0x0abb('0x22')]=qs[_0x0abb('0x22')](_0x42da12[_0x0abb('0x3a')][_0x0abb('0x22')]);}_0x5b034b[_0x0abb('0x43')]=qs['sort'](_0x42da12[_0x0abb('0x3a')]['sort']);_0x5b034b[_0x0abb('0x45')]=qs[_0x0abb('0x3c')](_[_0x0abb('0x46')](_0x42da12['query'],_0x194389['filters']));_0x5b034b[_0x0abb('0x45')][_0x0abb('0x63')]=_0x2397a0['id'];if(_0x42da12['query'][_0x0abb('0x47')]){_0x5b034b[_0x0abb('0x45')]=_['merge'](_0x5b034b[_0x0abb('0x45')],{'$or':_[_0x0abb('0x2d')](_0x5b034b[_0x0abb('0x3e')],function(_0x7b851a){var _0x5aa294={};_0x5aa294[_0x7b851a]={'$like':'%'+_0x42da12[_0x0abb('0x3a')][_0x0abb('0x47')]+'%'};return _0x5aa294;})});}_0x5b034b=_[_0x0abb('0x5f')]({},_0x5b034b,_0x42da12[_0x0abb('0x49')]);return db[_0x0abb('0x62')][_0x0abb('0x24')]({'where':_0x5b034b[_0x0abb('0x45')]})['then'](function(_0x97819d){_0x11be1e[_0x0abb('0x24')]=_0x97819d;if(_0x42da12['query'][_0x0abb('0x4a')]){_0x5b034b['include']=[{'all':!![]}];}return db['CmHopper'][_0x0abb('0x4c')](_0x5b034b);})[_0x0abb('0x2a')](function(_0x58355a){_0x11be1e[_0x0abb('0x64')]=_0x58355a;return _0x11be1e;});}})[_0x0abb('0x2a')](respondWithFilteredResult(_0x19ff15,_0x5b034b))[_0x0abb('0x4e')](handleError(_0x19ff15,null));};exports[_0x0abb('0x65')]=function(_0x2c4413,_0x344da1,_0x59ccb9){var _0x1532d9={'raw':!![],'where':{}};var _0x1ea004={};var _0x25a7ba={'count':0x0,'rows':[]};return db[_0x0abb('0x36')][_0x0abb('0x66')]({'where':{'id':_0x2c4413[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x344da1,null))['then'](function(_0x4e69ac){if(_0x4e69ac){_0x1ea004['model']=_[_0x0abb('0x3b')](db[_0x0abb('0x67')][_0x0abb('0x37')]);_0x1ea004[_0x0abb('0x3a')]=_['keys'](_0x2c4413['query']);_0x1ea004[_0x0abb('0x3c')]=_[_0x0abb('0x3d')](_0x1ea004[_0x0abb('0x39')],_0x1ea004[_0x0abb('0x3a')]);_0x1532d9[_0x0abb('0x3e')]=_[_0x0abb('0x3d')](_0x1ea004['model'],qs[_0x0abb('0x3f')](_0x2c4413['query']['fields']));_0x1532d9[_0x0abb('0x3e')]=_0x1532d9[_0x0abb('0x3e')][_0x0abb('0x40')]?_0x1532d9[_0x0abb('0x3e')]:_0x1ea004[_0x0abb('0x39')];if(!_0x2c4413[_0x0abb('0x3a')][_0x0abb('0x41')](_0x0abb('0x42'))){_0x1532d9[_0x0abb('0x23')]=qs[_0x0abb('0x23')](_0x2c4413['query'][_0x0abb('0x23')]);_0x1532d9['offset']=qs[_0x0abb('0x22')](_0x2c4413[_0x0abb('0x3a')][_0x0abb('0x22')]);}_0x1532d9['order']=qs[_0x0abb('0x44')](_0x2c4413['query'][_0x0abb('0x44')]);_0x1532d9[_0x0abb('0x45')]=qs[_0x0abb('0x3c')](_[_0x0abb('0x46')](_0x2c4413['query'],_0x1ea004[_0x0abb('0x3c')]));_0x1532d9[_0x0abb('0x45')][_0x0abb('0x63')]=_0x4e69ac['id'];if(_0x2c4413[_0x0abb('0x3a')][_0x0abb('0x47')]){_0x1532d9[_0x0abb('0x45')]=_[_0x0abb('0x5f')](_0x1532d9[_0x0abb('0x45')],{'$or':_[_0x0abb('0x2d')](_0x1532d9[_0x0abb('0x3e')],function(_0x170ca5){var _0x2ef3f4={};_0x2ef3f4[_0x170ca5]={'$like':'%'+_0x2c4413[_0x0abb('0x3a')][_0x0abb('0x47')]+'%'};return _0x2ef3f4;})});}_0x1532d9=_[_0x0abb('0x5f')]({},_0x1532d9,_0x2c4413[_0x0abb('0x49')]);return db[_0x0abb('0x67')][_0x0abb('0x24')]({'where':_0x1532d9['where']})[_0x0abb('0x2a')](function(_0x4bcf83){_0x25a7ba[_0x0abb('0x24')]=_0x4bcf83;if(_0x2c4413[_0x0abb('0x3a')]['includeAll']){_0x1532d9[_0x0abb('0x4b')]=[{'all':!![]}];}return db[_0x0abb('0x67')]['findAll'](_0x1532d9);})[_0x0abb('0x2a')](function(_0xaa7073){_0x25a7ba[_0x0abb('0x64')]=_0xaa7073;return _0x25a7ba;});}})[_0x0abb('0x2a')](respondWithFilteredResult(_0x344da1,_0x1532d9))[_0x0abb('0x4e')](handleError(_0x344da1,null));};exports[_0x0abb('0x68')]=function(_0x128892,_0x12295b,_0x4cc5d4){var _0x35b3dc={'raw':!![],'where':{}};var _0x406aa5={};var _0xf014de={'count':0x0,'rows':[]};return db[_0x0abb('0x36')]['findOne']({'where':{'id':_0x128892[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x12295b,null))[_0x0abb('0x2a')](function(_0x4c6daf){if(_0x4c6daf){_0x406aa5[_0x0abb('0x39')]=_['keys'](db[_0x0abb('0x69')]['rawAttributes']);_0x406aa5['query']=_[_0x0abb('0x3b')](_0x128892[_0x0abb('0x3a')]);_0x406aa5[_0x0abb('0x3c')]=_[_0x0abb('0x3d')](_0x406aa5[_0x0abb('0x39')],_0x406aa5[_0x0abb('0x3a')]);_0x35b3dc[_0x0abb('0x3e')]=_[_0x0abb('0x3d')](_0x406aa5[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x128892[_0x0abb('0x3a')]['fields']));_0x35b3dc['attributes']=_0x35b3dc['attributes']['length']?_0x35b3dc[_0x0abb('0x3e')]:_0x406aa5[_0x0abb('0x39')];if(!_0x128892[_0x0abb('0x3a')][_0x0abb('0x41')](_0x0abb('0x42'))){_0x35b3dc[_0x0abb('0x23')]=qs[_0x0abb('0x23')](_0x128892[_0x0abb('0x3a')][_0x0abb('0x23')]);_0x35b3dc[_0x0abb('0x22')]=qs[_0x0abb('0x22')](_0x128892[_0x0abb('0x3a')][_0x0abb('0x22')]);}_0x35b3dc['order']=qs['sort'](_0x128892[_0x0abb('0x3a')][_0x0abb('0x44')]);_0x35b3dc[_0x0abb('0x45')]=qs[_0x0abb('0x3c')](_['pick'](_0x128892[_0x0abb('0x3a')],_0x406aa5[_0x0abb('0x3c')]));_0x35b3dc['where'][_0x0abb('0x63')]=_0x4c6daf['id'];if(_0x128892[_0x0abb('0x3a')]['filter']){_0x35b3dc[_0x0abb('0x45')]=_[_0x0abb('0x5f')](_0x35b3dc['where'],{'$or':_[_0x0abb('0x2d')](_0x35b3dc[_0x0abb('0x3e')],function(_0x1bf618){var _0x50808b={};_0x50808b[_0x1bf618]={'$like':'%'+_0x128892[_0x0abb('0x3a')][_0x0abb('0x47')]+'%'};return _0x50808b;})});}_0x35b3dc=_[_0x0abb('0x5f')]({},_0x35b3dc,_0x128892[_0x0abb('0x49')]);return db[_0x0abb('0x69')][_0x0abb('0x24')]({'where':_0x35b3dc[_0x0abb('0x45')]})[_0x0abb('0x2a')](function(_0x559da0){_0xf014de[_0x0abb('0x24')]=_0x559da0;if(_0x128892[_0x0abb('0x3a')][_0x0abb('0x4a')]){_0x35b3dc[_0x0abb('0x4b')]=[{'all':!![]}];}return db[_0x0abb('0x69')][_0x0abb('0x4c')](_0x35b3dc);})[_0x0abb('0x2a')](function(_0x43f9d6){_0xf014de[_0x0abb('0x64')]=_0x43f9d6;return _0xf014de;});}})['then'](respondWithFilteredResult(_0x12295b,_0x35b3dc))[_0x0abb('0x4e')](handleError(_0x12295b,null));};exports['getHopperBlacks']=function(_0x51d83e,_0x10d1ba,_0x53debf){var _0x77d859={'raw':!![],'where':{}};var _0x4c52e8={};var _0x2a2eb6={'count':0x0,'rows':[]};return db[_0x0abb('0x36')][_0x0abb('0x66')]({'where':{'id':_0x51d83e[_0x0abb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x10d1ba,null))[_0x0abb('0x2a')](function(_0x11a1cd){if(_0x11a1cd){_0x4c52e8['model']=_[_0x0abb('0x3b')](db[_0x0abb('0x6a')][_0x0abb('0x37')]);_0x4c52e8[_0x0abb('0x3a')]=_[_0x0abb('0x3b')](_0x51d83e[_0x0abb('0x3a')]);_0x4c52e8[_0x0abb('0x3c')]=_[_0x0abb('0x3d')](_0x4c52e8[_0x0abb('0x39')],_0x4c52e8[_0x0abb('0x3a')]);_0x77d859['attributes']=_['intersection'](_0x4c52e8[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x51d83e[_0x0abb('0x3a')][_0x0abb('0x3f')]));_0x77d859[_0x0abb('0x3e')]=_0x77d859[_0x0abb('0x3e')][_0x0abb('0x40')]?_0x77d859[_0x0abb('0x3e')]:_0x4c52e8['model'];if(!_0x51d83e[_0x0abb('0x3a')]['hasOwnProperty'](_0x0abb('0x42'))){_0x77d859[_0x0abb('0x23')]=qs[_0x0abb('0x23')](_0x51d83e['query']['limit']);_0x77d859[_0x0abb('0x22')]=qs['offset'](_0x51d83e[_0x0abb('0x3a')][_0x0abb('0x22')]);}_0x77d859['order']=qs[_0x0abb('0x44')](_0x51d83e[_0x0abb('0x3a')][_0x0abb('0x44')]);_0x77d859['where']=qs[_0x0abb('0x3c')](_['pick'](_0x51d83e[_0x0abb('0x3a')],_0x4c52e8[_0x0abb('0x3c')]));_0x77d859[_0x0abb('0x45')][_0x0abb('0x63')]=_0x11a1cd['id'];if(_0x51d83e['query'][_0x0abb('0x47')]){_0x77d859[_0x0abb('0x45')]=_['merge'](_0x77d859['where'],{'$or':_['map'](_0x77d859[_0x0abb('0x3e')],function(_0x472567){var _0x4b74b8={};_0x4b74b8[_0x472567]={'$like':'%'+_0x51d83e[_0x0abb('0x3a')]['filter']+'%'};return _0x4b74b8;})});}_0x77d859=_['merge']({},_0x77d859,_0x51d83e[_0x0abb('0x49')]);return db[_0x0abb('0x6a')]['count']({'where':_0x77d859[_0x0abb('0x45')]})[_0x0abb('0x2a')](function(_0x29b28a){_0x2a2eb6['count']=_0x29b28a;if(_0x51d83e[_0x0abb('0x3a')][_0x0abb('0x4a')]){_0x77d859[_0x0abb('0x4b')]=[{'all':!![]}];}return db[_0x0abb('0x6a')][_0x0abb('0x4c')](_0x77d859);})[_0x0abb('0x2a')](function(_0x1697d4){_0x2a2eb6[_0x0abb('0x64')]=_0x1697d4;return _0x2a2eb6;});}})['then'](respondWithFilteredResult(_0x10d1ba,_0x77d859))['catch'](handleError(_0x10d1ba,null));};exports[_0x0abb('0x6b')]=function(_0x3d7791,_0x2b95bc,_0x379f5d){var _0x5258ce={};var _0x489ef9={};var _0x474654;var _0x2a0172;return db['VoiceQueue'][_0x0abb('0x66')]({'where':{'id':_0x3d7791[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x2b95bc,null))['then'](function(_0x47c841){if(_0x47c841){_0x474654=_0x47c841;_0x489ef9[_0x0abb('0x39')]=_[_0x0abb('0x3b')](db[_0x0abb('0x6c')][_0x0abb('0x37')]);_0x489ef9[_0x0abb('0x3a')]=_[_0x0abb('0x3b')](_0x3d7791['query']);_0x489ef9['filters']=_[_0x0abb('0x3d')](_0x489ef9[_0x0abb('0x39')],_0x489ef9[_0x0abb('0x3a')]);_0x5258ce[_0x0abb('0x3e')]=_[_0x0abb('0x3d')](_0x489ef9[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x3d7791[_0x0abb('0x3a')][_0x0abb('0x3f')]));_0x5258ce['attributes']=_0x5258ce[_0x0abb('0x3e')][_0x0abb('0x40')]?_0x5258ce[_0x0abb('0x3e')]:_0x489ef9['model'];_0x5258ce[_0x0abb('0x43')]=qs[_0x0abb('0x44')](_0x3d7791[_0x0abb('0x3a')]['sort']);_0x5258ce[_0x0abb('0x45')]=qs[_0x0abb('0x3c')](_['pick'](_0x3d7791['query'],_0x489ef9['filters']));if(_0x3d7791[_0x0abb('0x3a')][_0x0abb('0x47')]){_0x5258ce[_0x0abb('0x45')]=_[_0x0abb('0x5f')](_0x5258ce[_0x0abb('0x45')],{'$or':_[_0x0abb('0x2d')](_0x5258ce[_0x0abb('0x3e')],function(_0x3dd602){var _0x4e4a73={};_0x4e4a73[_0x3dd602]={'$like':'%'+_0x3d7791[_0x0abb('0x3a')][_0x0abb('0x47')]+'%'};return _0x4e4a73;})});}_0x5258ce=_['merge']({},_0x5258ce,_0x3d7791['options']);return _0x474654['getTeams'](_0x5258ce);}})[_0x0abb('0x2a')](function(_0x44c1fa){if(_0x44c1fa){_0x2a0172=_0x44c1fa['length'];if(!_0x3d7791[_0x0abb('0x3a')]['hasOwnProperty'](_0x0abb('0x42'))){_0x5258ce[_0x0abb('0x23')]=qs[_0x0abb('0x23')](_0x3d7791[_0x0abb('0x3a')][_0x0abb('0x23')]);_0x5258ce['offset']=qs[_0x0abb('0x22')](_0x3d7791['query']['offset']);}return _0x474654[_0x0abb('0x6b')](_0x5258ce);}})['then'](function(_0xf69c1e){if(_0xf69c1e){return _0xf69c1e?{'count':_0x2a0172,'rows':_0xf69c1e}:null;}})[_0x0abb('0x2a')](respondWithResult(_0x2b95bc,null))[_0x0abb('0x4e')](handleError(_0x2b95bc,null));};exports['addTeams']=function(_0x5e1cf4,_0x3147e5,_0x26db94){var _0x30c2a8=_0x5e1cf4[_0x0abb('0x5e')][_0x0abb('0x6d')];var _0x3f3280=_[_0x0abb('0x2d')](_0x30c2a8,'id');return db[_0x0abb('0x6c')]['findAll']({'where':{'id':_0x3f3280},'attributes':['id'],'include':[{'model':db[_0x0abb('0x6e')],'as':_0x0abb('0x6f'),'attributes':['id','name',_0x0abb('0x70'),'voicePause',_0x0abb('0x71')],'raw':!![]}]})[_0x0abb('0x2a')](function(_0x181841){if(_0x181841){var _0x30775f=_['flatMap'](_0x181841,function(_0x87a64c){var _0x2bbc35=_0x87a64c[_0x0abb('0x51')]({'plain':!![]});_0x2bbc35[_0x0abb('0x6f')][_0x0abb('0x72')](function(_0x1b4032){_0x1b4032['penalty']=_[_0x0abb('0x30')](_0x30c2a8,{'id':_0x2bbc35['id']})[_0x0abb('0x73')];});return _0x2bbc35[_0x0abb('0x6f')];});return db[_0x0abb('0x36')][_0x0abb('0x30')]({'where':{'id':_0x5e1cf4['params']['id']}})[_0x0abb('0x2a')](function(_0x4a5e2f){return db[_0x0abb('0x74')][_0x0abb('0x75')](function(_0x3be384){return _0x4a5e2f[_0x0abb('0x76')](_0x3f3280,{'transaction':_0x3be384})[_0x0abb('0x2a')](function(){return BPromise[_0x0abb('0x77')](_0x30c2a8,function(_0x5af0c8){return db[_0x0abb('0x78')][_0x0abb('0x79')]({'TeamId':_0x5af0c8['id'],'VoiceQueueId':_0x5e1cf4[_0x0abb('0x5a')]['id'],'penalty':_0x5af0c8[_0x0abb('0x73')]},{'transaction':_0x3be384});});})['then'](function(){return BPromise[_0x0abb('0x77')](_0x30775f,function(_0x545603){return db[_0x0abb('0x7a')]['findOrCreate']({'where':{'UserId':_0x545603['id'],'VoiceQueueId':_0x5e1cf4['params']['id']},'defaults':{'penalty':_0x545603[_0x0abb('0x73')]},'transaction':_0x3be384});});})[_0x0abb('0x2a')](function(){return BPromise[_0x0abb('0x77')](_[_0x0abb('0x47')](_0x30775f,{'online':!![]}),function(_0x2f3091){return db[_0x0abb('0x7b')]['upsert']({'membername':_0x2f3091[_0x0abb('0x31')],'UserId':_0x2f3091['id'],'queue_name':_0x4a5e2f[_0x0abb('0x31')],'VoiceQueueId':_0x4a5e2f['id'],'interface':_[_0x0abb('0x7c')](_0x2f3091['interface'])?util[_0x0abb('0x7d')](_0x0abb('0x7e'),_0x2f3091[_0x0abb('0x31')]):_0x2f3091['interface'],'paused':_0x2f3091[_0x0abb('0x7f')]||![],'penalty':_0x2f3091[_0x0abb('0x73')]},{'transaction':_0x3be384});});})['then'](function(){_0x30775f[_0x0abb('0x72')](function(_0x5644a9){socket[_0x0abb('0x80')](_0x0abb('0x81'),{'UserId':_0x5644a9['id'],'VoiceQueueId':_0x4a5e2f['id']});});});});});}})[_0x0abb('0x2a')](respondWithStatusCode(_0x3147e5,null))[_0x0abb('0x4e')](handleError(_0x3147e5,null));};exports[_0x0abb('0x82')]=function(_0x585db4,_0x313c53,_0x17b22c){return db[_0x0abb('0x6c')][_0x0abb('0x4c')]({'where':{'id':_0x585db4['query'][_0x0abb('0x83')]},'attributes':['id'],'include':[{'model':db[_0x0abb('0x6e')],'as':_0x0abb('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x313c53,null))[_0x0abb('0x2a')](function(_0x19bc20){var _0x11c6fe=_[_0x0abb('0x2d')](_0x19bc20,'id');var _0x1e8649=[];var _0x3a2d6=[];var _0x8d5344=squel[_0x0abb('0x84')]();_0x8d5344['field'](_0x0abb('0x85'))['from']('team_has_voice_queues','tq')['join']('user_has_teams','ut',_0x0abb('0x86'))[_0x0abb('0x45')](_0x0abb('0x87'),_0x585db4[_0x0abb('0x5a')]['id']);for(var _0x5edf04=0x0;_0x5edf04<_0x19bc20[_0x0abb('0x40')];_0x5edf04+=0x1){let _0x286d91=_0x19bc20[_0x5edf04];for(var _0x2aa3f1=0x0;_0x2aa3f1<_0x286d91[_0x0abb('0x6f')][_0x0abb('0x40')];_0x2aa3f1+=0x1){let _0x37d720=_0x286d91[_0x0abb('0x6f')][_0x2aa3f1];var _0x3fccac=_0x8d5344[_0x0abb('0x59')]();_0x3fccac[_0x0abb('0x45')](_0x0abb('0x88'),_0x37d720['id']);_0x3a2d6[_0x0abb('0x89')](db['sequelize']['query'](_0x3fccac[_0x0abb('0x8a')](),{'type':db['sequelize'][_0x0abb('0x8b')][_0x0abb('0x8c')]})[_0x0abb('0x2a')](function(_0x47af90){if(_0x47af90[_0x0abb('0x40')]===0x1){return _0x37d720['id'];}else{var _0x6a46dc=_[_0x0abb('0x8d')](_[_0x0abb('0x2d')](_0x47af90,_0x0abb('0x8e')),function(_0x2bc38d){return _[_0x0abb('0x8f')](_0x11c6fe,_0x2bc38d);});if(_0x6a46dc){return _0x37d720['id'];}}}));}}return BPromise[_0x0abb('0x90')](_0x3a2d6)[_0x0abb('0x2a')](function(_0x371ce7){_0x1e8649=_(_0x1e8649)[_0x0abb('0x91')](_0x371ce7)[_0x0abb('0x92')]()['value']();return db[_0x0abb('0x36')][_0x0abb('0x30')]({'where':{'id':_0x585db4[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](function(_0x1751e4){return db['sequelize']['transaction'](function(_0x48f185){return _0x1751e4[_0x0abb('0x82')](_0x585db4[_0x0abb('0x3a')][_0x0abb('0x83')],{'transaction':_0x48f185})['then'](function(){if(!_['isEmpty'](_0x1e8649)){return _0x1751e4[_0x0abb('0x93')](_0x1e8649,{'transaction':_0x48f185})[_0x0abb('0x2a')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x585db4['params']['id'],'UserId':_0x1e8649},'transaction':_0x48f185});});}})[_0x0abb('0x2a')](function(){_0x1e8649[_0x0abb('0x72')](function(_0x22c043){socket[_0x0abb('0x80')]('userVoiceQueue:remove',{'UserId':_0x22c043,'VoiceQueueId':_0x1751e4['id']});});});});});});})[_0x0abb('0x2a')](respondWithStatusCode(_0x313c53,null))[_0x0abb('0x4e')](handleError(_0x313c53,null));};exports[_0x0abb('0x94')]=function(_0x1e24bb,_0x45f738,_0x3db5c5){var _0x545005,_0x330d57;return db[_0x0abb('0x36')][_0x0abb('0x30')]({'where':{'id':_0x1e24bb['params']['id']}})['then'](handleEntityNotFound(_0x45f738,null))[_0x0abb('0x2a')](function(_0x22997d){if(_0x22997d){_0x330d57=_0x22997d;return _0x22997d[_0x0abb('0x94')](_0x1e24bb[_0x0abb('0x5e')][_0x0abb('0x83')],_[_0x0abb('0x5b')](_0x1e24bb[_0x0abb('0x5e')],[_0x0abb('0x83'),'id'])||{})[_0x0abb('0x95')](function(_0x1fc5e8){for(var _0xaf7ee3=0x0;_0xaf7ee3<_0x1e24bb['body']['ids'][_0x0abb('0x40')];_0xaf7ee3+=0x1){socket[_0x0abb('0x80')](_0x0abb('0x81'),{'UserId':Number(_0x1e24bb['body'][_0x0abb('0x83')][_0xaf7ee3]),'VoiceQueueId':Number(_0x1e24bb[_0x0abb('0x5a')]['id'])});}return _0x1fc5e8;});}})[_0x0abb('0x2a')](function(_0x2a3bbc){_0x545005=_0x2a3bbc||[];if(_0x330d57){return db[_0x0abb('0x6e')][_0x0abb('0x4c')]({'where':{'id':_0x1e24bb[_0x0abb('0x5e')][_0x0abb('0x83')]},'attributes':['id','name',_0x0abb('0x70'),'voicePause',_0x0abb('0x71')],'raw':!![]});}})[_0x0abb('0x2a')](function(_0x14d4d9){if(!_[_0x0abb('0x96')](_0x14d4d9)){var _0x409af8=[];for(var _0x444a9a=0x0;_0x444a9a<_0x14d4d9[_0x0abb('0x40')];_0x444a9a++){if(_0x14d4d9[_0x444a9a][_0x0abb('0x70')]){_0x409af8['push'](db[_0x0abb('0x7b')][_0x0abb('0x79')]({'membername':_0x14d4d9[_0x444a9a][_0x0abb('0x31')],'UserId':_0x14d4d9[_0x444a9a]['id'],'queue_name':_0x330d57[_0x0abb('0x31')],'VoiceQueueId':_0x330d57['id'],'interface':_[_0x0abb('0x7c')](_0x14d4d9[_0x444a9a][_0x0abb('0x71')])?util[_0x0abb('0x7d')](_0x0abb('0x7e'),_0x14d4d9[_0x444a9a][_0x0abb('0x31')]):_0x14d4d9[_0x444a9a][_0x0abb('0x71')],'paused':_0x14d4d9[_0x444a9a][_0x0abb('0x7f')]||![],'penalty':_0x1e24bb[_0x0abb('0x5e')]['penalty']||0x0}));}}return BPromise[_0x0abb('0x90')](_0x409af8);}})[_0x0abb('0x2a')](function(){return _0x545005;})[_0x0abb('0x2a')](respondWithResult(_0x45f738,null))[_0x0abb('0x4e')](handleError(_0x45f738,null));};exports[_0x0abb('0x93')]=function(_0x3cd0aa,_0x301e1c,_0x3adaab){return db[_0x0abb('0x36')][_0x0abb('0x30')]({'where':{'id':_0x3cd0aa[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x301e1c,null))[_0x0abb('0x2a')](function(_0x234bbe){if(_0x234bbe){return _0x234bbe[_0x0abb('0x93')](_0x3cd0aa['query']['ids'])[_0x0abb('0x2a')](function(){if(_[_0x0abb('0x97')](_0x3cd0aa['query']['ids'])){for(var _0x22b60e=0x0;_0x22b60e<_0x3cd0aa['query']['ids'][_0x0abb('0x40')];_0x22b60e+=0x1){socket[_0x0abb('0x80')](_0x0abb('0x98'),{'UserId':Number(_0x3cd0aa[_0x0abb('0x3a')]['ids'][_0x22b60e]),'VoiceQueueId':Number(_0x3cd0aa['params']['id'])});}}else{socket[_0x0abb('0x80')](_0x0abb('0x98'),{'UserId':Number(_0x3cd0aa[_0x0abb('0x3a')][_0x0abb('0x83')]),'VoiceQueueId':Number(_0x3cd0aa[_0x0abb('0x5a')]['id'])});}});}})[_0x0abb('0x2a')](function(_0x54b894){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3cd0aa[_0x0abb('0x5a')]['id'],'UserId':_0x3cd0aa[_0x0abb('0x3a')][_0x0abb('0x83')]}})[_0x0abb('0x2a')](function(){return _0x54b894;});})[_0x0abb('0x2a')](respondWithStatusCode(_0x301e1c,null))[_0x0abb('0x4e')](handleError(_0x301e1c,null));};exports['getAgents']=function(_0x49cf9c,_0xf13442,_0x241df1){var _0x25d6f1={};var _0x12eac8={};var _0x4d307b;var _0x1f0177;return db['VoiceQueue'][_0x0abb('0x66')]({'where':{'id':_0x49cf9c['params']['id']}})['then'](handleEntityNotFound(_0xf13442,null))['then'](function(_0x14055f){if(_0x14055f){_0x4d307b=_0x14055f;_0x12eac8['model']=_['keys'](db[_0x0abb('0x6e')][_0x0abb('0x37')]);_0x12eac8[_0x0abb('0x3a')]=_[_0x0abb('0x3b')](_0x49cf9c['query']);_0x12eac8[_0x0abb('0x3c')]=_[_0x0abb('0x3d')](_0x12eac8[_0x0abb('0x39')],_0x12eac8[_0x0abb('0x3a')]);_0x25d6f1[_0x0abb('0x3e')]=_[_0x0abb('0x3d')](_0x12eac8[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x49cf9c['query'][_0x0abb('0x3f')]));_0x25d6f1['attributes']=_0x25d6f1['attributes']['length']?_0x25d6f1[_0x0abb('0x3e')]:_0x12eac8[_0x0abb('0x39')];_0x25d6f1['order']=qs[_0x0abb('0x44')](_0x49cf9c['query'][_0x0abb('0x44')]);_0x25d6f1[_0x0abb('0x45')]=qs[_0x0abb('0x3c')](_['pick'](_0x49cf9c[_0x0abb('0x3a')],_0x12eac8[_0x0abb('0x3c')]));if(_0x49cf9c[_0x0abb('0x3a')][_0x0abb('0x47')]){_0x25d6f1[_0x0abb('0x45')]=_['merge'](_0x25d6f1[_0x0abb('0x45')],{'$or':_[_0x0abb('0x2d')](_0x25d6f1['attributes'],function(_0x3cc3a9){var _0x3a3d6d={};_0x3a3d6d[_0x3cc3a9]={'$like':'%'+_0x49cf9c['query'][_0x0abb('0x47')]+'%'};return _0x3a3d6d;})});}_0x25d6f1=_[_0x0abb('0x5f')]({},_0x25d6f1,_0x49cf9c[_0x0abb('0x49')]);return _0x4d307b['getAgents'](_0x25d6f1);}})[_0x0abb('0x2a')](function(_0x356a03){if(_0x356a03){_0x1f0177=_0x356a03[_0x0abb('0x40')];if(!_0x49cf9c[_0x0abb('0x3a')][_0x0abb('0x41')](_0x0abb('0x42'))){_0x25d6f1[_0x0abb('0x23')]=qs[_0x0abb('0x23')](_0x49cf9c[_0x0abb('0x3a')][_0x0abb('0x23')]);_0x25d6f1['offset']=qs['offset'](_0x49cf9c['query'][_0x0abb('0x22')]);}return _0x4d307b[_0x0abb('0x99')](_0x25d6f1);}})['then'](function(_0x13e18e){if(_0x13e18e){return _0x13e18e?{'count':_0x1f0177,'rows':_0x13e18e}:null;}})[_0x0abb('0x2a')](respondWithResult(_0xf13442,null))[_0x0abb('0x4e')](handleError(_0xf13442,null));};exports[_0x0abb('0x9a')]=function(_0x318e86,_0x120d1f,_0xd57b05){var _0x399ab3={};var _0x3c7b88={};var _0x3926e0;var _0x4a7567;return db['VoiceQueue']['findOne']({'where':{'id':_0x318e86['params']['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x120d1f,null))[_0x0abb('0x2a')](function(_0x3544ea){if(_0x3544ea){_0x3926e0=_0x3544ea;_0x3c7b88[_0x0abb('0x39')]=_['keys'](db[_0x0abb('0x7b')][_0x0abb('0x37')]);_0x3c7b88[_0x0abb('0x3a')]=_[_0x0abb('0x3b')](_0x318e86[_0x0abb('0x3a')]);_0x3c7b88['filters']=_[_0x0abb('0x3d')](_0x3c7b88[_0x0abb('0x39')],_0x3c7b88[_0x0abb('0x3a')]);_0x399ab3[_0x0abb('0x3e')]=_[_0x0abb('0x3d')](_0x3c7b88[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x318e86[_0x0abb('0x3a')][_0x0abb('0x3f')]));_0x399ab3[_0x0abb('0x3e')]=_0x399ab3[_0x0abb('0x3e')]['length']?_0x399ab3[_0x0abb('0x3e')]:_0x3c7b88[_0x0abb('0x39')];_0x399ab3[_0x0abb('0x43')]=qs[_0x0abb('0x44')](_0x318e86[_0x0abb('0x3a')][_0x0abb('0x44')]);_0x399ab3['where']=qs[_0x0abb('0x3c')](_[_0x0abb('0x46')](_0x318e86['query'],_0x3c7b88[_0x0abb('0x3c')]));if(_0x318e86[_0x0abb('0x3a')]['filter']){_0x399ab3[_0x0abb('0x45')]=_[_0x0abb('0x5f')](_0x399ab3['where'],{'$or':_[_0x0abb('0x2d')](_0x399ab3['attributes'],function(_0x1921f1){var _0x1e0768={};_0x1e0768[_0x1921f1]={'$like':'%'+_0x318e86[_0x0abb('0x3a')]['filter']+'%'};return _0x1e0768;})});}_0x399ab3=_[_0x0abb('0x5f')]({},_0x399ab3,_0x318e86[_0x0abb('0x49')]);return _0x3926e0['getMembers'](_0x399ab3);}})[_0x0abb('0x2a')](function(_0x341a53){if(_0x341a53){_0x4a7567=_0x341a53[_0x0abb('0x40')];if(!_0x318e86['query'][_0x0abb('0x41')](_0x0abb('0x42'))){_0x399ab3[_0x0abb('0x23')]=qs['limit'](_0x318e86[_0x0abb('0x3a')][_0x0abb('0x23')]);_0x399ab3[_0x0abb('0x22')]=qs[_0x0abb('0x22')](_0x318e86[_0x0abb('0x3a')][_0x0abb('0x22')]);}return _0x3926e0[_0x0abb('0x9a')](_0x399ab3);}})[_0x0abb('0x2a')](function(_0x17fa92){return _0x17fa92?{'count':_0x4a7567,'rows':_0x17fa92}:null;})[_0x0abb('0x2a')](respondWithResult(_0x120d1f,null))['catch'](handleError(_0x120d1f,null));};exports[_0x0abb('0x9b')]=function(_0x21b9aa,_0x14f3a0,_0x57d95a){var _0x112124={};var _0x50f276={};var _0x37a012;var _0x9fee9e;return db[_0x0abb('0x36')]['findOne']({'where':{'id':_0x21b9aa[_0x0abb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x14f3a0,null))['then'](function(_0x1a715b){if(_0x1a715b){_0x37a012=_0x1a715b;_0x50f276[_0x0abb('0x39')]=_[_0x0abb('0x3b')](db['CmList'][_0x0abb('0x37')]);_0x50f276[_0x0abb('0x3a')]=_[_0x0abb('0x3b')](_0x21b9aa[_0x0abb('0x3a')]);_0x50f276[_0x0abb('0x3c')]=_[_0x0abb('0x3d')](_0x50f276['model'],_0x50f276[_0x0abb('0x3a')]);_0x112124[_0x0abb('0x3e')]=_[_0x0abb('0x3d')](_0x50f276[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x21b9aa['query'][_0x0abb('0x3f')]));_0x112124['attributes']=_0x112124['attributes'][_0x0abb('0x40')]?_0x112124['attributes']:_0x50f276[_0x0abb('0x39')];_0x112124['order']=qs[_0x0abb('0x44')](_0x21b9aa[_0x0abb('0x3a')]['sort']);_0x112124[_0x0abb('0x45')]=qs[_0x0abb('0x3c')](_[_0x0abb('0x46')](_0x21b9aa['query'],_0x50f276[_0x0abb('0x3c')]));if(_0x21b9aa[_0x0abb('0x3a')][_0x0abb('0x47')]){_0x112124[_0x0abb('0x45')]=_[_0x0abb('0x5f')](_0x112124[_0x0abb('0x45')],{'$or':_[_0x0abb('0x2d')](_0x112124['attributes'],function(_0xc848da){var _0x2bf40d={};_0x2bf40d[_0xc848da]={'$like':'%'+_0x21b9aa['query'][_0x0abb('0x47')]+'%'};return _0x2bf40d;})});}_0x112124=_[_0x0abb('0x5f')]({},_0x112124,_0x21b9aa['options']);return _0x37a012[_0x0abb('0x9b')](_0x112124);}})[_0x0abb('0x2a')](function(_0x4074dc){if(_0x4074dc){_0x9fee9e=_0x4074dc['length'];if(!_0x21b9aa[_0x0abb('0x3a')]['hasOwnProperty']('nolimit')){_0x112124[_0x0abb('0x23')]=qs['limit'](_0x21b9aa[_0x0abb('0x3a')]['limit']);_0x112124[_0x0abb('0x22')]=qs[_0x0abb('0x22')](_0x21b9aa[_0x0abb('0x3a')][_0x0abb('0x22')]);}return _0x37a012[_0x0abb('0x9b')](_0x112124);}})['then'](function(_0x14a45e){if(_0x14a45e){return _0x14a45e?{'count':_0x9fee9e,'rows':_0x14a45e}:null;}})[_0x0abb('0x2a')](respondWithResult(_0x14f3a0,null))[_0x0abb('0x4e')](handleError(_0x14f3a0,null));};exports[_0x0abb('0x9c')]=function(_0x177e44,_0x41490e,_0x3c526e){var _0x23b353,_0x31877a;return db['VoiceQueue'][_0x0abb('0x30')]({'where':{'id':_0x177e44[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x41490e,null))[_0x0abb('0x2a')](function(_0x3df097){if(_0x3df097){_0x31877a=_0x3df097;return _0x3df097[_0x0abb('0x9c')](_0x177e44[_0x0abb('0x5e')]['ids'],_[_0x0abb('0x5b')](_0x177e44[_0x0abb('0x5e')],[_0x0abb('0x83'),'id'])||{});}return null;})[_0x0abb('0x95')](function(_0xeec7ee){var _0x329b48;_0x23b353=_0xeec7ee||[];var _0x51c5c2=[];if(_0xeec7ee){for(var _0x29c999=0x0;_0x29c999<_0xeec7ee['length'];_0x29c999+=0x1){var _0x47425b=_0xeec7ee[_0x29c999][_0x0abb('0x51')]({'plain':!![]});_0x31877a[_0x0abb('0x9d')]=_0x177e44[_0x0abb('0x5e')][_0x0abb('0x9d')]?_0x177e44[_0x0abb('0x5e')][_0x0abb('0x9d')]:_0x31877a[_0x0abb('0x9d')];switch(_0x31877a['dialCheckDuplicateType']){case _0x0abb('0x9e'):_0x329b48=squel[_0x0abb('0x9f')]()[_0x0abb('0xa0')]('cm_hopper')[_0x0abb('0xa1')]([_0x0abb('0xa2'),'scheduledAt',_0x0abb('0xa3'),_0x0abb('0xa4'),_0x0abb('0x63'),_0x0abb('0x5c'),'updatedAt'],squel['select']()[_0x0abb('0xa5')](_0x0abb('0xa2'),_0x0abb('0xa2'))[_0x0abb('0xa5')]('NOW()','scheduledAt')[_0x0abb('0xa5')]('id','ContactId')['field'](_0x47425b[_0x0abb('0xa6')]['toString'](),_0x0abb('0xa4'))['field'](_0x177e44['params']['id'][_0x0abb('0x8a')](),'VoiceQueueId')['field'](_0x0abb('0xa7'),_0x0abb('0x5c'))[_0x0abb('0xa5')]('NOW()',_0x0abb('0x5d'))[_0x0abb('0xa8')](_0x0abb('0xa9'))[_0x0abb('0x45')](_0x0abb('0xaa'))[_0x0abb('0x45')]('ListId\x20=\x20?',_0x47425b['CmListId'][_0x0abb('0x8a')]())[_0x0abb('0x45')](_0x0abb('0xab'))[_0x0abb('0x45')](_0x0abb('0xac'),squel['select']()['field'](_0x0abb('0xad'))[_0x0abb('0xa8')](_0x0abb('0xae'))[_0x0abb('0x45')](_0x0abb('0x87'),_0x177e44[_0x0abb('0x5a')]['id'][_0x0abb('0x8a')]()))[_0x0abb('0x45')](_0x0abb('0xac'),squel[_0x0abb('0x84')]()[_0x0abb('0xa5')](_0x0abb('0xaf'))[_0x0abb('0xa8')](_0x0abb('0xb0'))[_0x0abb('0x45')](_0x0abb('0x87'),_0x177e44[_0x0abb('0x5a')]['id']['toString']())))[_0x0abb('0x8a')]();break;case _0x0abb('0xb1'):_0x329b48=squel[_0x0abb('0x9f')]()[_0x0abb('0xa0')](_0x0abb('0xb0'))[_0x0abb('0xa1')]([_0x0abb('0xa2'),_0x0abb('0xb2'),_0x0abb('0xa3'),_0x0abb('0xa4'),_0x0abb('0x63'),_0x0abb('0x5c'),_0x0abb('0x5d')],squel[_0x0abb('0x84')]()[_0x0abb('0xa5')]('phone',_0x0abb('0xa2'))['field'](_0x0abb('0xa7'),'scheduledAt')[_0x0abb('0xa5')]('id',_0x0abb('0xa3'))[_0x0abb('0xa5')](_0x47425b[_0x0abb('0xa6')]['toString'](),_0x0abb('0xa4'))[_0x0abb('0xa5')](_0x177e44[_0x0abb('0x5a')]['id']['toString'](),_0x0abb('0x63'))[_0x0abb('0xa5')](_0x0abb('0xa7'),_0x0abb('0x5c'))[_0x0abb('0xa5')](_0x0abb('0xa7'),_0x0abb('0x5d'))[_0x0abb('0xa8')]('cm_contacts')[_0x0abb('0x45')](_0x0abb('0xaa'))[_0x0abb('0x45')](_0x0abb('0xb3'),_0x47425b[_0x0abb('0xa6')][_0x0abb('0x8a')]())[_0x0abb('0x45')](_0x0abb('0xab'))['where'](_0x0abb('0xac'),squel[_0x0abb('0x84')]()[_0x0abb('0xa5')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x0abb('0x87'),_0x177e44['params']['id'][_0x0abb('0x8a')]())))[_0x0abb('0x8a')]();break;default:_0x329b48=squel[_0x0abb('0x9f')]()[_0x0abb('0xa0')]('cm_hopper')[_0x0abb('0xa1')](['phone',_0x0abb('0xb2'),_0x0abb('0xa3'),_0x0abb('0xa4'),_0x0abb('0x63'),_0x0abb('0x5c'),_0x0abb('0x5d')],squel[_0x0abb('0x84')]()[_0x0abb('0xa5')](_0x0abb('0xa2'),_0x0abb('0xa2'))['field']('NOW()',_0x0abb('0xb2'))[_0x0abb('0xa5')]('id',_0x0abb('0xa3'))['field'](_0x47425b[_0x0abb('0xa6')][_0x0abb('0x8a')](),'ListId')[_0x0abb('0xa5')](_0x177e44[_0x0abb('0x5a')]['id'][_0x0abb('0x8a')](),'VoiceQueueId')[_0x0abb('0xa5')](_0x0abb('0xa7'),_0x0abb('0x5c'))[_0x0abb('0xa5')]('NOW()',_0x0abb('0x5d'))[_0x0abb('0xa8')](_0x0abb('0xa9'))['where'](_0x0abb('0xaa'))[_0x0abb('0x45')](_0x0abb('0xb3'),_0x47425b[_0x0abb('0xa6')][_0x0abb('0x8a')]())['where'](_0x0abb('0xab')))[_0x0abb('0x8a')]();}_0x51c5c2['push'](db[_0x0abb('0x74')][_0x0abb('0x3a')](_0x329b48));}return BPromise[_0x0abb('0x90')](_0x51c5c2);}})[_0x0abb('0x2a')](function(){return _0x23b353;})[_0x0abb('0x2a')](respondWithResult(_0x41490e,null))[_0x0abb('0x4e')](handleError(_0x41490e,null));};exports[_0x0abb('0xb4')]=function(_0xa3d327,_0x29484d,_0x550aa4){return db[_0x0abb('0x36')][_0x0abb('0x30')]({'where':{'id':_0xa3d327['params']['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x29484d,null))[_0x0abb('0x2a')](function(_0x46660a){if(_0x46660a){return _0x46660a['removeLists'](_0xa3d327['query'][_0x0abb('0x83')]);}})[_0x0abb('0x2a')](function(_0x4d7742){if(_0x4d7742){return db[_0x0abb('0x62')][_0x0abb('0x29')]({'where':{'ListId':_0xa3d327['query'][_0x0abb('0x83')],'VoiceQueueId':_0xa3d327['params']['id']}})[_0x0abb('0x2a')](function(){return _0x4d7742;});}})[_0x0abb('0x2a')](respondWithStatusCode(_0x29484d,null))[_0x0abb('0x4e')](handleError(_0x29484d,null));};exports[_0x0abb('0xb5')]=function(_0x34565a,_0x330848,_0x18357f){var _0x21551a={};var _0x20c69e={};var _0x2b0071;var _0x492962;return db[_0x0abb('0x36')][_0x0abb('0x66')]({'where':{'id':_0x34565a[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x330848,null))[_0x0abb('0x2a')](function(_0x554d29){if(_0x554d29){_0x2b0071=_0x554d29;_0x20c69e[_0x0abb('0x39')]=_[_0x0abb('0x3b')](db['CmList'][_0x0abb('0x37')]);_0x20c69e[_0x0abb('0x3a')]=_[_0x0abb('0x3b')](_0x34565a[_0x0abb('0x3a')]);_0x20c69e[_0x0abb('0x3c')]=_['intersection'](_0x20c69e[_0x0abb('0x39')],_0x20c69e['query']);_0x21551a[_0x0abb('0x3e')]=_[_0x0abb('0x3d')](_0x20c69e[_0x0abb('0x39')],qs[_0x0abb('0x3f')](_0x34565a[_0x0abb('0x3a')][_0x0abb('0x3f')]));_0x21551a[_0x0abb('0x3e')]=_0x21551a['attributes']['length']?_0x21551a[_0x0abb('0x3e')]:_0x20c69e[_0x0abb('0x39')];_0x21551a[_0x0abb('0x43')]=qs[_0x0abb('0x44')](_0x34565a[_0x0abb('0x3a')][_0x0abb('0x44')]);_0x21551a[_0x0abb('0x45')]=qs['filters'](_[_0x0abb('0x46')](_0x34565a[_0x0abb('0x3a')],_0x20c69e['filters']));if(_0x34565a['query'][_0x0abb('0x47')]){_0x21551a[_0x0abb('0x45')]=_[_0x0abb('0x5f')](_0x21551a['where'],{'$or':_[_0x0abb('0x2d')](_0x21551a[_0x0abb('0x3e')],function(_0x41edf8){var _0x73e908={};_0x73e908[_0x41edf8]={'$like':'%'+_0x34565a[_0x0abb('0x3a')]['filter']+'%'};return _0x73e908;})});}_0x21551a=_[_0x0abb('0x5f')]({},_0x21551a,_0x34565a['options']);return _0x2b0071['getBlackLists'](_0x21551a);}})[_0x0abb('0x2a')](function(_0x5acf02){if(_0x5acf02){_0x492962=_0x5acf02[_0x0abb('0x40')];if(!_0x34565a[_0x0abb('0x3a')][_0x0abb('0x41')](_0x0abb('0x42'))){_0x21551a[_0x0abb('0x23')]=qs['limit'](_0x34565a[_0x0abb('0x3a')][_0x0abb('0x23')]);_0x21551a['offset']=qs[_0x0abb('0x22')](_0x34565a[_0x0abb('0x3a')][_0x0abb('0x22')]);}return _0x2b0071[_0x0abb('0xb5')](_0x21551a);}})[_0x0abb('0x2a')](function(_0x16af98){if(_0x16af98){return _0x16af98?{'count':_0x492962,'rows':_0x16af98}:null;}})[_0x0abb('0x2a')](respondWithResult(_0x330848,null))[_0x0abb('0x4e')](handleError(_0x330848,null));};exports[_0x0abb('0xb6')]=function(_0x2fc1a9,_0x333480,_0x32c0ef){var _0x359e7d,_0x130de6;return db[_0x0abb('0x36')][_0x0abb('0x30')]({'where':{'id':_0x2fc1a9[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x333480,null))[_0x0abb('0x2a')](function(_0x57b511){if(_0x57b511){_0x130de6=_0x57b511;return _0x57b511[_0x0abb('0xb6')](_0x2fc1a9[_0x0abb('0x5e')][_0x0abb('0x83')],_[_0x0abb('0x5b')](_0x2fc1a9[_0x0abb('0x5e')],[_0x0abb('0x83'),'id'])||{});}return null;})[_0x0abb('0x95')](function(_0x227955){var _0x589f45;_0x359e7d=_0x227955||[];var _0x20087a=[];if(_0x227955){for(var _0x5e5d74=0x0;_0x5e5d74<_0x227955[_0x0abb('0x40')];_0x5e5d74+=0x1){var _0xc8cab0=_0x227955[_0x5e5d74]['get']({'plain':!![]});_0x589f45=squel[_0x0abb('0x9f')]()['into'](_0x0abb('0xb7'))[_0x0abb('0xa1')]([_0x0abb('0xa2'),_0x0abb('0xa3'),'ListId',_0x0abb('0x63'),'createdAt',_0x0abb('0x5d')],squel[_0x0abb('0x84')]()[_0x0abb('0xa5')](_0x0abb('0xa2'),_0x0abb('0xa2'))['field']('id',_0x0abb('0xa3'))[_0x0abb('0xa5')](_0xc8cab0[_0x0abb('0xa6')]['toString'](),_0x0abb('0xa4'))['field'](_0x2fc1a9[_0x0abb('0x5a')]['id'][_0x0abb('0x8a')](),'VoiceQueueId')[_0x0abb('0xa5')](_0x0abb('0xa7'),_0x0abb('0x5c'))['field'](_0x0abb('0xa7'),_0x0abb('0x5d'))[_0x0abb('0xa8')](_0x0abb('0xa9'))[_0x0abb('0x45')](_0x0abb('0xaa'))[_0x0abb('0x45')](_0x0abb('0xb3'),_0xc8cab0[_0x0abb('0xa6')][_0x0abb('0x8a')]())[_0x0abb('0x45')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x20087a[_0x0abb('0x89')](db[_0x0abb('0x74')][_0x0abb('0x3a')](_0x589f45));}return BPromise[_0x0abb('0x90')](_0x20087a);}})[_0x0abb('0x2a')](function(){return _0x359e7d;})[_0x0abb('0x2a')](respondWithResult(_0x333480,null))[_0x0abb('0x4e')](handleError(_0x333480,null));};exports[_0x0abb('0xb8')]=function(_0x495287,_0x4aeb5e,_0x2892c3){return db[_0x0abb('0x36')][_0x0abb('0x30')]({'where':{'id':_0x495287[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](handleEntityNotFound(_0x4aeb5e,null))[_0x0abb('0x2a')](function(_0x345a26){if(_0x345a26){return _0x345a26[_0x0abb('0xb8')](_0x495287[_0x0abb('0x3a')][_0x0abb('0x83')]);}})[_0x0abb('0x2a')](function(_0x375c5a){if(_0x375c5a){return db[_0x0abb('0x6a')]['destroy']({'where':{'ListId':_0x495287[_0x0abb('0x3a')][_0x0abb('0x83')],'VoiceQueueId':_0x495287[_0x0abb('0x5a')]['id']}})[_0x0abb('0x2a')](function(){return _0x375c5a;});}})[_0x0abb('0x2a')](respondWithStatusCode(_0x4aeb5e,null))['catch'](handleError(_0x4aeb5e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 5cf81bb..fd545cf 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 _0xabd0=['emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','update'];(function(_0x21c6d5,_0x4ca9fd){var _0x126749=function(_0x45a6ab){while(--_0x45a6ab){_0x21c6d5['push'](_0x21c6d5['shift']());}};_0x126749(++_0x4ca9fd);}(_0xabd0,0x1ec));var _0x0abd=function(_0x276107,_0x11ee26){_0x276107=_0x276107-0x0;var _0x5d1beb=_0xabd0[_0x276107];return _0x5d1beb;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x0abd('0x0'))['db'][_0x0abd('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0abd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0abd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x285408){return function(_0x4da6b2,_0xdaa4,_0x1aa7f7){VoiceQueueEvents['emit'](_0x285408+':'+_0x4da6b2['id'],_0x4da6b2);VoiceQueueEvents[_0x0abd('0x4')](_0x285408,_0x4da6b2);_0x1aa7f7(null);};}for(var e in events){if(events[_0x0abd('0x5')](e)){var event=events[e];VoiceQueue[_0x0abd('0x6')](e,emitEvent(event));}}module[_0x0abd('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x15b6=['VoiceQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x15b6,0x7e));var _0x615b=function(_0x135c4d,_0x6e303e){_0x135c4d=_0x135c4d-0x0;var _0x263376=_0x15b6[_0x135c4d];return _0x263376;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x615b('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x615b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x615b('0x2'),'afterDestroy':_0x615b('0x3')};function emitEvent(_0x541f11){return function(_0x726536,_0x429904,_0x392157){VoiceQueueEvents['emit'](_0x541f11+':'+_0x726536['id'],_0x726536);VoiceQueueEvents[_0x615b('0x4')](_0x541f11,_0x726536);_0x392157(null);};}for(var e in events){if(events[_0x615b('0x5')](e)){var event=events[e];VoiceQueue[_0x615b('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5da8f58..2d93fc8 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x4ed2b2,_0x4096ed){var _0x54a658=function(_0x3d3a16){while(--_0x3d3a16){_0x4ed2b2['push'](_0x4ed2b2['shift']());}};_0x54a658(++_0x4096ed);}(_0xedd9,0xfc));var _0x9edd=function(_0x8d565d,_0xff5baa){_0x8d565d=_0x8d565d-0x0;var _0x8641dd=_0xedd9[_0x8d565d];return _0x8641dd;};'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':'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(_0x21ca2a,_0x469aee){var _0x1ba7fd=function(_0x4b1d7d){while(--_0x4b1d7d){_0x21ca2a['push'](_0x21ca2a['shift']());}};_0x1ba7fd(++_0x469aee);}(_0x70e0,0x17b));var _0x070e=function(_0x4bb05f,_0x1d54f0){_0x4bb05f=_0x4bb05f-0x0;var _0x540185=_0x70e0[_0x4bb05f];return _0x540185;};'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 7635bfe..ac4514b 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 _0x809f=['client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','info','GetVoiceQueue','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x50850f,_0x2649c7){var _0x5e9ba4=function(_0x2e19ff){while(--_0x2e19ff){_0x50850f['push'](_0x50850f['shift']());}};_0x5e9ba4(++_0x2649c7);}(_0x809f,0x190));var _0xf809=function(_0x95a519,_0x2fad88){_0x95a519=_0x95a519-0x0;var _0x3ef432=_0x809f[_0x95a519];return _0x3ef432;};'use strict';var _=require(_0xf809('0x0'));var util=require(_0xf809('0x1'));var moment=require(_0xf809('0x2'));var BPromise=require(_0xf809('0x3'));var rs=require(_0xf809('0x4'));var fs=require('fs');var Redis=require(_0xf809('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf809('0x6'));var logger=require(_0xf809('0x7'))('rpc');var config=require(_0xf809('0x8'));var jayson=require(_0xf809('0x9'));var client=jayson[_0xf809('0xa')]['http']({'port':0x232a});config[_0xf809('0xb')]=_[_0xf809('0xc')](config['redis'],{'host':_0xf809('0xd'),'port':0x18eb});var socket=require(_0xf809('0xe'))(new Redis(config[_0xf809('0xb')]));require(_0xf809('0xf'))[_0xf809('0x10')](socket);function respondWithRpcPromise(_0x2f8f8b,_0x41fb2a,_0x1026d5){return new BPromise(function(_0xe4c6f1,_0x51829b){return client[_0xf809('0x11')](_0x2f8f8b,_0x1026d5)[_0xf809('0x12')](function(_0x3384de){logger['info'](_0xf809('0x13'),_0x41fb2a,_0xf809('0x14'));logger[_0xf809('0x15')](_0xf809('0x16'),_0x41fb2a,_0xf809('0x14'),JSON[_0xf809('0x17')](_0x3384de));if(_0x3384de[_0xf809('0x18')]){if(_0x3384de[_0xf809('0x18')]['code']===0x1f4){logger[_0xf809('0x18')](_0xf809('0x13'),_0x41fb2a,_0x3384de[_0xf809('0x18')][_0xf809('0x19')]);return _0x51829b(_0x3384de['error']['message']);}logger['error'](_0xf809('0x13'),_0x41fb2a,_0x3384de[_0xf809('0x18')][_0xf809('0x19')]);return _0xe4c6f1(_0x3384de['error']['message']);}else{logger['info'](_0xf809('0x13'),_0x41fb2a,_0xf809('0x14'));_0xe4c6f1(_0x3384de[_0xf809('0x1a')][_0xf809('0x19')]);}})[_0xf809('0x1b')](function(_0x31638c){logger[_0xf809('0x18')](_0xf809('0x13'),_0x41fb2a,_0x31638c);_0x51829b(_0x31638c);});});}exports['GetVoiceQueue']=function(_0x189f25){var _0x2e4f4d=this;return new Promise(function(_0x3fb3a7,_0x29c523){return db['VoiceQueue'][_0xf809('0x1c')]({'raw':_0x189f25[_0xf809('0x1d')]?_0x189f25[_0xf809('0x1d')][_0xf809('0x1e')]===undefined?!![]:![]:!![],'where':_0x189f25[_0xf809('0x1d')]?_0x189f25[_0xf809('0x1d')][_0xf809('0x1f')]||null:null,'attributes':_0x189f25['options']?_0x189f25[_0xf809('0x1d')][_0xf809('0x20')]||null:null,'limit':_0x189f25['options']?_0x189f25['options'][_0xf809('0x21')]||null:null,'include':_0x189f25[_0xf809('0x1d')]?_0x189f25['options']['include']?_[_0xf809('0x22')](_0x189f25[_0xf809('0x1d')][_0xf809('0x23')],function(_0x521691){return{'model':db[_0x521691[_0xf809('0x24')]],'as':_0x521691['as'],'attributes':_0x521691['attributes'],'include':_0x521691[_0xf809('0x23')]?_[_0xf809('0x22')](_0x521691[_0xf809('0x23')],function(_0x88fe1b){return{'model':db[_0x88fe1b[_0xf809('0x24')]],'as':_0x88fe1b['as'],'attributes':_0x88fe1b[_0xf809('0x20')],'include':_0x88fe1b['include']?_['map'](_0x88fe1b[_0xf809('0x23')],function(_0x54e6f6){return{'model':db[_0x54e6f6[_0xf809('0x24')]],'as':_0x54e6f6['as'],'attributes':_0x54e6f6[_0xf809('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf809('0x12')](function(_0x12ccc1){logger[_0xf809('0x25')](_0xf809('0x26'),_0x189f25);logger[_0xf809('0x15')]('GetVoiceQueue',_0x189f25,JSON[_0xf809('0x17')](_0x12ccc1));_0x3fb3a7(_0x12ccc1);})[_0xf809('0x1b')](function(_0x596d26){logger['error'](_0xf809('0x26'),_0x596d26[_0xf809('0x19')],_0x189f25);_0x29c523(_0x2e4f4d[_0xf809('0x18')](0x1f4,_0x596d26[_0xf809('0x19')]));});});};exports[_0xf809('0x27')]=function(_0x5391c2){var _0x4f9944=this;return new Promise(function(_0x48c5bf,_0x2d67ed){return db['VoiceQueue'][_0xf809('0x28')]({'raw':_0x5391c2['options']?_0x5391c2[_0xf809('0x1d')][_0xf809('0x1e')]===undefined?!![]:![]:!![],'where':_0x5391c2[_0xf809('0x1d')]?_0x5391c2[_0xf809('0x1d')][_0xf809('0x1f')]||null:null,'attributes':_0x5391c2['options']?_0x5391c2[_0xf809('0x1d')][_0xf809('0x20')]||null:null,'include':_0x5391c2[_0xf809('0x1d')]?_0x5391c2[_0xf809('0x1d')][_0xf809('0x23')]?_['map'](_0x5391c2[_0xf809('0x1d')][_0xf809('0x23')],function(_0x4aa0a4){return{'model':db[_0x4aa0a4[_0xf809('0x24')]],'as':_0x4aa0a4['as'],'attributes':_0x4aa0a4[_0xf809('0x20')],'include':_0x4aa0a4[_0xf809('0x23')]?_[_0xf809('0x22')](_0x4aa0a4['include'],function(_0x25f401){return{'model':db[_0x25f401['model']],'as':_0x25f401['as'],'attributes':_0x25f401[_0xf809('0x20')],'include':_0x25f401[_0xf809('0x23')]?_[_0xf809('0x22')](_0x25f401[_0xf809('0x23')],function(_0xd9f1f1){return{'model':db[_0xd9f1f1[_0xf809('0x24')]],'as':_0xd9f1f1['as'],'attributes':_0xd9f1f1[_0xf809('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b9243){logger[_0xf809('0x25')](_0xf809('0x27'),_0x5391c2);logger['debug'](_0xf809('0x27'),_0x5391c2,JSON[_0xf809('0x17')](_0x3b9243));_0x48c5bf(_0x3b9243);})[_0xf809('0x1b')](function(_0x5c4ab2){logger[_0xf809('0x18')](_0xf809('0x27'),_0x5c4ab2['message'],_0x5391c2);_0x2d67ed(_0x4f9944[_0xf809('0x18')](0x1f4,_0x5c4ab2['message']));});});}; \ No newline at end of file +var _0xb27d=['include','model','attributes','debug','ShowVoiceQueue','find','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','map'];(function(_0x57f194,_0x5a870d){var _0x18be7c=function(_0x16ed3d){while(--_0x16ed3d){_0x57f194['push'](_0x57f194['shift']());}};_0x18be7c(++_0x5a870d);}(_0xb27d,0x12e));var _0xdb27=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xb27d[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xdb27('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdb27('0x1'));var fs=require('fs');var Redis=require(_0xdb27('0x2'));var db=require(_0xdb27('0x3'))['db'];var utils=require(_0xdb27('0x4'));var logger=require(_0xdb27('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdb27('0x6')]['http']({'port':0x232a});config['redis']=_[_0xdb27('0x7')](config['redis'],{'host':_0xdb27('0x8'),'port':0x18eb});var socket=require(_0xdb27('0x9'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0xdb27('0xa')](socket);function respondWithRpcPromise(_0x4b2b61,_0x54080e,_0x53524a){return new BPromise(function(_0x38dbf6,_0x16f1cb){return client[_0xdb27('0xb')](_0x4b2b61,_0x53524a)[_0xdb27('0xc')](function(_0x50a7da){logger[_0xdb27('0xd')](_0xdb27('0xe'),_0x54080e,'request\x20sent');logger['debug'](_0xdb27('0xf'),_0x54080e,_0xdb27('0x10'),JSON[_0xdb27('0x11')](_0x50a7da));if(_0x50a7da[_0xdb27('0x12')]){if(_0x50a7da['error'][_0xdb27('0x13')]===0x1f4){logger[_0xdb27('0x12')](_0xdb27('0xe'),_0x54080e,_0x50a7da[_0xdb27('0x12')]['message']);return _0x16f1cb(_0x50a7da[_0xdb27('0x12')][_0xdb27('0x14')]);}logger[_0xdb27('0x12')](_0xdb27('0xe'),_0x54080e,_0x50a7da[_0xdb27('0x12')][_0xdb27('0x14')]);return _0x38dbf6(_0x50a7da[_0xdb27('0x12')][_0xdb27('0x14')]);}else{logger[_0xdb27('0xd')]('VoiceQueue,\x20%s,\x20%s',_0x54080e,_0xdb27('0x10'));_0x38dbf6(_0x50a7da[_0xdb27('0x15')][_0xdb27('0x14')]);}})[_0xdb27('0x16')](function(_0x229002){logger[_0xdb27('0x12')](_0xdb27('0xe'),_0x54080e,_0x229002);_0x16f1cb(_0x229002);});});}exports[_0xdb27('0x17')]=function(_0x2bf364){var _0x52357d=this;return new Promise(function(_0x456791,_0x290812){return db[_0xdb27('0x18')][_0xdb27('0x19')]({'raw':_0x2bf364[_0xdb27('0x1a')]?_0x2bf364[_0xdb27('0x1a')][_0xdb27('0x1b')]===undefined?!![]:![]:!![],'where':_0x2bf364[_0xdb27('0x1a')]?_0x2bf364[_0xdb27('0x1a')][_0xdb27('0x1c')]||null:null,'attributes':_0x2bf364[_0xdb27('0x1a')]?_0x2bf364[_0xdb27('0x1a')]['attributes']||null:null,'limit':_0x2bf364[_0xdb27('0x1a')]?_0x2bf364['options'][_0xdb27('0x1d')]||null:null,'include':_0x2bf364['options']?_0x2bf364[_0xdb27('0x1a')]['include']?_[_0xdb27('0x1e')](_0x2bf364[_0xdb27('0x1a')][_0xdb27('0x1f')],function(_0x575191){return{'model':db[_0x575191[_0xdb27('0x20')]],'as':_0x575191['as'],'attributes':_0x575191['attributes'],'include':_0x575191[_0xdb27('0x1f')]?_['map'](_0x575191['include'],function(_0x530037){return{'model':db[_0x530037[_0xdb27('0x20')]],'as':_0x530037['as'],'attributes':_0x530037[_0xdb27('0x21')],'include':_0x530037[_0xdb27('0x1f')]?_[_0xdb27('0x1e')](_0x530037[_0xdb27('0x1f')],function(_0x27eb97){return{'model':db[_0x27eb97[_0xdb27('0x20')]],'as':_0x27eb97['as'],'attributes':_0x27eb97['attributes']};}):[]};}):[]};}):[]:[]})[_0xdb27('0xc')](function(_0x4d062e){logger[_0xdb27('0xd')](_0xdb27('0x17'),_0x2bf364);logger[_0xdb27('0x22')](_0xdb27('0x17'),_0x2bf364,JSON[_0xdb27('0x11')](_0x4d062e));_0x456791(_0x4d062e);})['catch'](function(_0x7e9c66){logger['error'](_0xdb27('0x17'),_0x7e9c66['message'],_0x2bf364);_0x290812(_0x52357d[_0xdb27('0x12')](0x1f4,_0x7e9c66[_0xdb27('0x14')]));});});};exports[_0xdb27('0x23')]=function(_0xd22cd8){var _0x714528=this;return new Promise(function(_0x1530bb,_0x39c54a){return db[_0xdb27('0x18')][_0xdb27('0x24')]({'raw':_0xd22cd8[_0xdb27('0x1a')]?_0xd22cd8[_0xdb27('0x1a')][_0xdb27('0x1b')]===undefined?!![]:![]:!![],'where':_0xd22cd8[_0xdb27('0x1a')]?_0xd22cd8[_0xdb27('0x1a')]['where']||null:null,'attributes':_0xd22cd8[_0xdb27('0x1a')]?_0xd22cd8['options'][_0xdb27('0x21')]||null:null,'include':_0xd22cd8[_0xdb27('0x1a')]?_0xd22cd8[_0xdb27('0x1a')]['include']?_[_0xdb27('0x1e')](_0xd22cd8[_0xdb27('0x1a')][_0xdb27('0x1f')],function(_0x223615){return{'model':db[_0x223615[_0xdb27('0x20')]],'as':_0x223615['as'],'attributes':_0x223615[_0xdb27('0x21')],'include':_0x223615[_0xdb27('0x1f')]?_['map'](_0x223615['include'],function(_0x24a627){return{'model':db[_0x24a627[_0xdb27('0x20')]],'as':_0x24a627['as'],'attributes':_0x24a627['attributes'],'include':_0x24a627[_0xdb27('0x1f')]?_[_0xdb27('0x1e')](_0x24a627[_0xdb27('0x1f')],function(_0x3e5bfb){return{'model':db[_0x3e5bfb[_0xdb27('0x20')]],'as':_0x3e5bfb['as'],'attributes':_0x3e5bfb[_0xdb27('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c8681){logger['info'](_0xdb27('0x23'),_0xd22cd8);logger['debug']('ShowVoiceQueue',_0xd22cd8,JSON[_0xdb27('0x11')](_0x5c8681));_0x1530bb(_0x5c8681);})['catch'](function(_0x453630){logger[_0xdb27('0x12')](_0xdb27('0x23'),_0x453630[_0xdb27('0x14')],_0xd22cd8);_0x39c54a(_0x714528[_0xdb27('0x12')](0x1f4,_0x453630[_0xdb27('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 182586b..434be33 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 _0xaf52=['removeListener','register','length','voiceQueue:','./voiceQueue.events','remove','update','emit'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xaf52,0x1ac));var _0x2af5=function(_0x40c630,_0x35863d){_0x40c630=_0x40c630-0x0;var _0x5579f6=_0xaf52[_0x40c630];return _0x5579f6;};'use strict';var VoiceQueueEvents=require(_0x2af5('0x0'));var events=['save',_0x2af5('0x1'),_0x2af5('0x2')];function createListener(_0x57ecab,_0x236918){return function(_0x35ca37){_0x236918[_0x2af5('0x3')](_0x57ecab,_0x35ca37);};}function removeListener(_0x47a070,_0x451cfc){return function(){VoiceQueueEvents[_0x2af5('0x4')](_0x47a070,_0x451cfc);};}exports[_0x2af5('0x5')]=function(_0x35168d){for(var _0x3616d5=0x0,_0x241579=events[_0x2af5('0x6')];_0x3616d5<_0x241579;_0x3616d5++){var _0x3ffe17=events[_0x3616d5];var _0x269e41=createListener(_0x2af5('0x7')+_0x3ffe17,_0x35168d);VoiceQueueEvents['on'](_0x3ffe17,_0x269e41);}}; \ No newline at end of file +var _0xd7d9=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','emit'];(function(_0xf19b15,_0x4f36ca){var _0x112420=function(_0x3e2889){while(--_0x3e2889){_0xf19b15['push'](_0xf19b15['shift']());}};_0x112420(++_0x4f36ca);}(_0xd7d9,0x15b));var _0x9d7d=function(_0x54e856,_0x313d5c){_0x54e856=_0x54e856-0x0;var _0x124873=_0xd7d9[_0x54e856];return _0x124873;};'use strict';var VoiceQueueEvents=require(_0x9d7d('0x0'));var events=[_0x9d7d('0x1'),'remove','update'];function createListener(_0x38a12a,_0xe8407a){return function(_0x529388){_0xe8407a[_0x9d7d('0x2')](_0x38a12a,_0x529388);};}function removeListener(_0x58e4de,_0x286293){return function(){VoiceQueueEvents[_0x9d7d('0x3')](_0x58e4de,_0x286293);};}exports[_0x9d7d('0x4')]=function(_0x1eb14b){for(var _0x1a29eb=0x0,_0x517157=events[_0x9d7d('0x5')];_0x1a29eb<_0x517157;_0x1a29eb++){var _0x3a7de3=events[_0x1a29eb];var _0x5df752=createListener(_0x9d7d('0x6')+_0x3a7de3,_0x1eb14b);VoiceQueueEvents['on'](_0x3a7de3,_0x5df752);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index cca846f..51eeb9d 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 _0x7b9c=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','/describe','isAuthenticated','get','/index','show','post','put'];(function(_0x140f9d,_0x260908){var _0x1ad88a=function(_0x3d1fca){while(--_0x3d1fca){_0x140f9d['push'](_0x140f9d['shift']());}};_0x1ad88a(++_0x260908);}(_0x7b9c,0x194));var _0xc7b9=function(_0x143f66,_0xc137ba){_0x143f66=_0x143f66-0x0;var _0x52a5f3=_0x7b9c[_0x143f66];return _0x52a5f3;};'use strict';var multer=require(_0xc7b9('0x0'));var util=require('util');var path=require(_0xc7b9('0x1'));var timeout=require(_0xc7b9('0x2'));var express=require(_0xc7b9('0x3'));var router=express[_0xc7b9('0x4')]();var fs_extra=require(_0xc7b9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc7b9('0x6'));var config=require(_0xc7b9('0x7'));var controller=require(_0xc7b9('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc7b9('0x9'),auth[_0xc7b9('0xa')](),controller['describe']);router[_0xc7b9('0xb')](_0xc7b9('0xc'),auth[_0xc7b9('0xa')](),controller['getVoiceQueuesReport']);router[_0xc7b9('0xb')]('/:id',auth[_0xc7b9('0xa')](),controller[_0xc7b9('0xd')]);router[_0xc7b9('0xe')]('/',auth[_0xc7b9('0xa')](),controller['create']);router[_0xc7b9('0xf')](_0xc7b9('0x10'),auth[_0xc7b9('0xa')](),controller[_0xc7b9('0x11')]);router[_0xc7b9('0x12')](_0xc7b9('0x10'),auth['isAuthenticated'](),controller[_0xc7b9('0x13')]);module[_0xc7b9('0x14')]=router; \ No newline at end of file +var _0x2727=['show','post','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','index','isAuthenticated','/index','getVoiceQueuesReport'];(function(_0x304383,_0x566b94){var _0x56dfe4=function(_0x8f417b){while(--_0x8f417b){_0x304383['push'](_0x304383['shift']());}};_0x56dfe4(++_0x566b94);}(_0x2727,0x161));var _0x7272=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2727[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7272('0x0'));var util=require(_0x7272('0x1'));var path=require(_0x7272('0x2'));var timeout=require(_0x7272('0x3'));var express=require(_0x7272('0x4'));var router=express[_0x7272('0x5')]();var fs_extra=require(_0x7272('0x6'));var auth=require(_0x7272('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7272('0x8'));var controller=require(_0x7272('0x9'));router[_0x7272('0xa')]('/',auth['isAuthenticated'](),controller[_0x7272('0xb')]);router[_0x7272('0xa')]('/describe',auth[_0x7272('0xc')](),controller['describe']);router['get'](_0x7272('0xd'),auth['isAuthenticated'](),controller[_0x7272('0xe')]);router[_0x7272('0xa')]('/:id',auth[_0x7272('0xc')](),controller[_0x7272('0xf')]);router[_0x7272('0x10')]('/',auth[_0x7272('0xc')](),controller[_0x7272('0x11')]);router[_0x7272('0x12')]('/:id',auth[_0x7272('0xc')](),controller[_0x7272('0x13')]);router[_0x7272('0x14')](_0x7272('0x15'),auth[_0x7272('0xc')](),controller['destroy']);module[_0x7272('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 2c0313f..1f45778 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 _0x0962=['moment','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x72ee00,_0x4f9a0c){var _0x4da881=function(_0x5f1dc2){while(--_0x5f1dc2){_0x72ee00['push'](_0x72ee00['shift']());}};_0x4da881(++_0x4f9a0c);}(_0x0962,0xd0));var _0x2096=function(_0x47d6a9,_0x32de4b){_0x47d6a9=_0x47d6a9-0x0;var _0x11c430=_0x0962[_0x47d6a9];return _0x11c430;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2096('0x0'));module[_0x2096('0x1')]={'type':{'type':Sequelize[_0x2096('0x2')]},'uniqueid':{'type':Sequelize[_0x2096('0x2')]},'calleridnum':{'type':Sequelize[_0x2096('0x2')]},'calleridname':{'type':Sequelize[_0x2096('0x2')]},'queue':{'type':Sequelize[_0x2096('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x2096('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x2096('0x3')],'set':function(_0x462ba3){var _0x3a78c3=moment(_0x462ba3);var _0x209f36=moment(this[_0x2096('0x4')]('queuecallerjoinAt'))[_0x2096('0x5')](_0x2096('0x6'));var _0x13bf44=_0x3a78c3[_0x2096('0x7')](_0x209f36,'seconds');this[_0x2096('0x8')]('queuecallerleaveAt',_0x462ba3);this[_0x2096('0x8')](_0x2096('0x9'),_0x13bf44||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x2096('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x2096('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2096('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x2096('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x2096('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2096('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x2096('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x2096('0xa')]},'channel':{'type':Sequelize[_0x2096('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2096('0x2')]},'accountcode':{'type':Sequelize[_0x2096('0x2')]},'context':{'type':Sequelize[_0x2096('0x2')]},'exten':{'type':Sequelize[_0x2096('0x2')]},'priority':{'type':Sequelize[_0x2096('0x2')]},'holdtime':{'type':Sequelize[_0x2096('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2096('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2096('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2096('0x2')],'comment':_0x2096('0xc')},'transferexten':{'type':Sequelize[_0x2096('0x2')]},'transferuniqueid':{'type':Sequelize[_0x2096('0x2')]},'disposition':{'type':Sequelize[_0x2096('0x2')]},'secondDisposition':{'type':Sequelize[_0x2096('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2096('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbfb8=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xbfb8,0x9d));var _0x8bfb=function(_0x14c5e5,_0x193326){_0x14c5e5=_0x14c5e5-0x0;var _0x2fc3ce=_0xbfb8[_0x14c5e5];return _0x2fc3ce;};'use strict';var Sequelize=require(_0x8bfb('0x0'));var moment=require(_0x8bfb('0x1'));module[_0x8bfb('0x2')]={'type':{'type':Sequelize[_0x8bfb('0x3')]},'uniqueid':{'type':Sequelize[_0x8bfb('0x3')]},'calleridnum':{'type':Sequelize[_0x8bfb('0x3')]},'calleridname':{'type':Sequelize[_0x8bfb('0x3')]},'queue':{'type':Sequelize[_0x8bfb('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x8bfb('0x4')],'set':function(_0x3c9bb7){var _0x1c4f5c=moment(_0x3c9bb7);var _0x69e474=moment(this[_0x8bfb('0x5')](_0x8bfb('0x6')))[_0x8bfb('0x7')](_0x8bfb('0x8'));var _0x1a715d=_0x1c4f5c[_0x8bfb('0x9')](_0x69e474,_0x8bfb('0xa'));this[_0x8bfb('0xb')](_0x8bfb('0xc'),_0x3c9bb7);this['setDataValue']('holdtime',_0x1a715d||null);}},'position':{'type':Sequelize[_0x8bfb('0xd')]},'count':{'type':Sequelize[_0x8bfb('0xd')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x8bfb('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8bfb('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8bfb('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x8bfb('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8bfb('0x3')]},'connectedlinename':{'type':Sequelize[_0x8bfb('0x3')]},'accountcode':{'type':Sequelize[_0x8bfb('0x3')]},'context':{'type':Sequelize[_0x8bfb('0x3')]},'exten':{'type':Sequelize[_0x8bfb('0x3')]},'priority':{'type':Sequelize[_0x8bfb('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8bfb('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8bfb('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8bfb('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x8bfb('0x10')},'transferexten':{'type':Sequelize[_0x8bfb('0x3')]},'transferuniqueid':{'type':Sequelize[_0x8bfb('0x3')]},'disposition':{'type':Sequelize[_0x8bfb('0x3')]},'secondDisposition':{'type':Sequelize[_0x8bfb('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8bfb('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x8bfb('0xd')],'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 3596b56..0a8b9b7 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 _0x0d02=['offset','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','nolimit','rows','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','json','undefined','count'];(function(_0x532b76,_0x29338c){var _0x387b9c=function(_0x13798c){while(--_0x13798c){_0x532b76['push'](_0x532b76['shift']());}};_0x387b9c(++_0x29338c);}(_0x0d02,0xd4));var _0x20d0=function(_0x2b2455,_0x451090){_0x2b2455=_0x2b2455-0x0;var _0x15f8dc=_0x0d02[_0x2b2455];return _0x15f8dc;};'use strict';var emlformat=require(_0x20d0('0x0'));var rimraf=require(_0x20d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20d0('0x2'));var rp=require(_0x20d0('0x3'));var moment=require(_0x20d0('0x4'));var BPromise=require(_0x20d0('0x5'));var Mustache=require(_0x20d0('0x6'));var util=require(_0x20d0('0x7'));var path=require('path');var sox=require(_0x20d0('0x8'));var csv=require(_0x20d0('0x9'));var ejs=require(_0x20d0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x20d0('0xb'));var deskjs=require(_0x20d0('0xc'));var toCsv=require(_0x20d0('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x20d0('0xd'));var authService=require(_0x20d0('0xe'));var qs=require(_0x20d0('0xf'));var as=require(_0x20d0('0x10'));var hardwareService=require(_0x20d0('0x11'));var logger=require(_0x20d0('0x12'))(_0x20d0('0x13'));var utils=require(_0x20d0('0x14'));var config=require(_0x20d0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x20d0('0x16'))['db'];config[_0x20d0('0x17')]=_[_0x20d0('0x18')](config[_0x20d0('0x17')],{'host':_0x20d0('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x407396,_0x41d217){_0x41d217=_0x41d217||0xcc;return function(_0x3e323f){if(_0x3e323f){return _0x407396[_0x20d0('0x1a')](_0x41d217);}return _0x407396['status'](_0x41d217)['end']();};}function respondWithResult(_0x40d62d,_0x4c23d8){_0x4c23d8=_0x4c23d8||0xc8;return function(_0x435659){if(_0x435659){return _0x40d62d[_0x20d0('0x1b')](_0x4c23d8)[_0x20d0('0x1c')](_0x435659);}};}function respondWithFilteredResult(_0xd7c33d,_0x194af4){return function(_0x5975f6){if(_0x5975f6){var _0x4387f4=typeof _0x194af4['offset']===_0x20d0('0x1d')&&typeof _0x194af4['limit']==='undefined';var _0x4201fe=_0x5975f6[_0x20d0('0x1e')];var _0x46822a=_0x4387f4?0x0:_0x194af4['offset'];var _0x231dd4=_0x4387f4?_0x5975f6[_0x20d0('0x1e')]:_0x194af4[_0x20d0('0x1f')]+_0x194af4['limit'];var _0x134f0f;if(_0x231dd4>=_0x4201fe){_0x231dd4=_0x4201fe;_0x134f0f=0xc8;}else{_0x134f0f=0xce;}_0xd7c33d[_0x20d0('0x1b')](_0x134f0f);return _0xd7c33d[_0x20d0('0x20')]('Content-Range',_0x46822a+'-'+_0x231dd4+'/'+_0x4201fe)['json'](_0x5975f6);}return null;};}function patchUpdates(_0xdb14ae){return function(_0x3fdd4d){try{jsonpatch[_0x20d0('0x21')](_0x3fdd4d,_0xdb14ae,!![]);}catch(_0x352cf2){return BPromise[_0x20d0('0x22')](_0x352cf2);}return _0x3fdd4d[_0x20d0('0x23')]();};}function saveUpdates(_0x4fea9b,_0xcd12f1){return function(_0x10c413){if(_0x10c413){return _0x10c413[_0x20d0('0x24')](_0x4fea9b)[_0x20d0('0x25')](function(_0x1e6642){return _0x1e6642;});}return null;};}function removeEntity(_0x3af4f2,_0x3513fb){return function(_0x3b1441){if(_0x3b1441){return _0x3b1441[_0x20d0('0x26')]()[_0x20d0('0x25')](function(){_0x3af4f2[_0x20d0('0x1b')](0xcc)[_0x20d0('0x27')]();});}};}function handleEntityNotFound(_0x28bd59,_0xac0d53){return function(_0x345ddb){if(!_0x345ddb){_0x28bd59[_0x20d0('0x1a')](0x194);}return _0x345ddb;};}function handleError(_0x5f20de,_0x551c02){_0x551c02=_0x551c02||0x1f4;return function(_0x7dd724){logger['error'](_0x7dd724[_0x20d0('0x28')]);if(_0x7dd724[_0x20d0('0x29')]){delete _0x7dd724['name'];}_0x5f20de['status'](_0x551c02)[_0x20d0('0x2a')](_0x7dd724);};}exports[_0x20d0('0x2b')]=function(_0x3bd9d8,_0x5fdec4){var _0xf976a4={},_0x428373={},_0x108003={'count':0x0,'rows':[]};var _0x40a58d=_['map'](db[_0x20d0('0x2c')][_0x20d0('0x2d')],function(_0x5569b7){return{'name':_0x5569b7[_0x20d0('0x2e')],'type':_0x5569b7[_0x20d0('0x2f')][_0x20d0('0x30')]};});_0x428373['model']=_[_0x20d0('0x31')](_0x40a58d,_0x20d0('0x29'));_0x428373[_0x20d0('0x32')]=_[_0x20d0('0x33')](_0x3bd9d8[_0x20d0('0x32')]);_0x428373[_0x20d0('0x34')]=_[_0x20d0('0x35')](_0x428373[_0x20d0('0x36')],_0x428373[_0x20d0('0x32')]);_0xf976a4[_0x20d0('0x37')]=_[_0x20d0('0x35')](_0x428373[_0x20d0('0x36')],qs['fields'](_0x3bd9d8[_0x20d0('0x32')][_0x20d0('0x38')]));_0xf976a4[_0x20d0('0x37')]=_0xf976a4[_0x20d0('0x37')]['length']?_0xf976a4['attributes']:_0x428373['model'];if(!_0x3bd9d8[_0x20d0('0x32')][_0x20d0('0x39')]('nolimit')){_0xf976a4['limit']=qs['limit'](_0x3bd9d8['query'][_0x20d0('0x3a')]);_0xf976a4[_0x20d0('0x1f')]=qs[_0x20d0('0x1f')](_0x3bd9d8[_0x20d0('0x32')]['offset']);}_0xf976a4[_0x20d0('0x3b')]=qs[_0x20d0('0x3c')](_0x3bd9d8[_0x20d0('0x32')][_0x20d0('0x3c')]);_0xf976a4[_0x20d0('0x3d')]=qs[_0x20d0('0x34')](_[_0x20d0('0x3e')](_0x3bd9d8[_0x20d0('0x32')],_0x428373[_0x20d0('0x34')]),_0x40a58d);if(_0x3bd9d8[_0x20d0('0x32')][_0x20d0('0x3f')]){_0xf976a4['where']=_[_0x20d0('0x40')](_0xf976a4['where'],{'$or':_[_0x20d0('0x31')](_0x40a58d,function(_0x4beaac){if(_0x4beaac[_0x20d0('0x2f')]!==_0x20d0('0x41')){var _0x4c9638={};_0x4c9638[_0x4beaac[_0x20d0('0x29')]]={'$like':'%'+_0x3bd9d8[_0x20d0('0x32')]['filter']+'%'};return _0x4c9638;}})});}_0xf976a4=_['merge']({},_0xf976a4,_0x3bd9d8[_0x20d0('0x42')]);var _0x2338f0={'where':_0xf976a4[_0x20d0('0x3d')]};return db[_0x20d0('0x2c')][_0x20d0('0x1e')](_0x2338f0)[_0x20d0('0x25')](function(_0x2ce930){_0x108003[_0x20d0('0x1e')]=_0x2ce930;if(_0x3bd9d8['query'][_0x20d0('0x43')]){_0xf976a4[_0x20d0('0x44')]=[{'all':!![]}];}return db[_0x20d0('0x2c')][_0x20d0('0x45')](_0xf976a4);})['then'](function(_0x1ae0cf){_0x108003['rows']=_0x1ae0cf;return _0x108003;})['then'](respondWithFilteredResult(_0x5fdec4,_0xf976a4))[_0x20d0('0x46')](handleError(_0x5fdec4,null));};exports[_0x20d0('0x47')]=function(_0x361af8,_0x112cc7){var _0x56b5b8={'raw':![],'where':{'id':_0x361af8[_0x20d0('0x48')]['id']}},_0xa1f3fd={};_0xa1f3fd[_0x20d0('0x36')]=_[_0x20d0('0x33')](db[_0x20d0('0x2c')]['rawAttributes']);_0xa1f3fd['query']=_['keys'](_0x361af8['query']);_0xa1f3fd['filters']=_[_0x20d0('0x35')](_0xa1f3fd['model'],_0xa1f3fd['query']);_0x56b5b8[_0x20d0('0x37')]=_[_0x20d0('0x35')](_0xa1f3fd['model'],qs[_0x20d0('0x38')](_0x361af8[_0x20d0('0x32')][_0x20d0('0x38')]));_0x56b5b8[_0x20d0('0x37')]=_0x56b5b8[_0x20d0('0x37')][_0x20d0('0x49')]?_0x56b5b8[_0x20d0('0x37')]:_0xa1f3fd[_0x20d0('0x36')];if(_0x361af8[_0x20d0('0x32')]['includeAll']){_0x56b5b8[_0x20d0('0x44')]=[{'all':!![]}];}_0x56b5b8=_[_0x20d0('0x40')]({},_0x56b5b8,_0x361af8['options']);return db['VoiceQueueReport'][_0x20d0('0x4a')](_0x56b5b8)[_0x20d0('0x25')](handleEntityNotFound(_0x112cc7,null))[_0x20d0('0x25')](respondWithResult(_0x112cc7,null))['catch'](handleError(_0x112cc7,null));};exports[_0x20d0('0x4b')]=function(_0x4dbb3e,_0x531e47){return db[_0x20d0('0x2c')][_0x20d0('0x4b')](_0x4dbb3e[_0x20d0('0x4c')],{})['then'](respondWithResult(_0x531e47,0xc9))[_0x20d0('0x46')](handleError(_0x531e47,null));};exports[_0x20d0('0x24')]=function(_0x5cd48b,_0x30095c){if(_0x5cd48b['body']['id']){delete _0x5cd48b[_0x20d0('0x4c')]['id'];}return db[_0x20d0('0x2c')][_0x20d0('0x4a')]({'where':{'id':_0x5cd48b[_0x20d0('0x48')]['id']}})[_0x20d0('0x25')](handleEntityNotFound(_0x30095c,null))['then'](saveUpdates(_0x5cd48b[_0x20d0('0x4c')],null))[_0x20d0('0x25')](respondWithResult(_0x30095c,null))['catch'](handleError(_0x30095c,null));};exports[_0x20d0('0x26')]=function(_0x509dcd,_0x406d49){return db[_0x20d0('0x2c')]['find']({'where':{'id':_0x509dcd['params']['id']}})['then'](handleEntityNotFound(_0x406d49,null))['then'](removeEntity(_0x406d49,null))[_0x20d0('0x46')](handleError(_0x406d49,null));};exports[_0x20d0('0x4d')]=function(_0x1134a2,_0x4c53bf){return db[_0x20d0('0x2c')]['describe']()[_0x20d0('0x25')](respondWithResult(_0x4c53bf,null))[_0x20d0('0x46')](handleError(_0x4c53bf,null));};exports['getVoiceQueuesReport']=function(_0x525dc9,_0xc9fc3a){var _0x1eee8c={},_0x3106de={},_0x2e2644={'count':0x0,'rows':[]};_0x3106de[_0x20d0('0x36')]=_[_0x20d0('0x33')](db['VoiceQueueReport'][_0x20d0('0x2d')]);_0x3106de[_0x20d0('0x32')]=_['keys'](_0x525dc9[_0x20d0('0x32')]);_0x3106de[_0x20d0('0x34')]=_[_0x20d0('0x35')](_0x3106de[_0x20d0('0x36')],_0x3106de[_0x20d0('0x32')]);_0x1eee8c['attributes']=_[_0x20d0('0x35')](_0x3106de[_0x20d0('0x36')],qs['fields'](_0x525dc9['query'][_0x20d0('0x38')]));_0x1eee8c[_0x20d0('0x37')]=_0x1eee8c['attributes']['length']?_0x1eee8c[_0x20d0('0x37')]:_0x3106de[_0x20d0('0x36')];if(!_0x525dc9[_0x20d0('0x32')][_0x20d0('0x39')](_0x20d0('0x4e'))){_0x1eee8c[_0x20d0('0x3a')]=qs[_0x20d0('0x3a')](_0x525dc9['query'][_0x20d0('0x3a')]);_0x1eee8c[_0x20d0('0x1f')]=qs['offset'](_0x525dc9[_0x20d0('0x32')][_0x20d0('0x1f')]);}_0x1eee8c['order']=qs[_0x20d0('0x3c')](_0x525dc9[_0x20d0('0x32')][_0x20d0('0x3c')]);_0x1eee8c[_0x20d0('0x3d')]=qs[_0x20d0('0x34')](_[_0x20d0('0x3e')](_0x525dc9[_0x20d0('0x32')],_0x3106de['filters']));if(_0x525dc9[_0x20d0('0x32')][_0x20d0('0x3f')]){_0x1eee8c[_0x20d0('0x3d')]=_[_0x20d0('0x40')](_0x1eee8c[_0x20d0('0x3d')],{'$or':_[_0x20d0('0x31')](_0x1eee8c[_0x20d0('0x37')],function(_0x46b213){var _0x321792={};_0x321792[_0x46b213]={'$like':'%'+_0x525dc9['query'][_0x20d0('0x3f')]+'%'};return _0x321792;})});}_0x1eee8c=_['merge']({},_0x1eee8c,_0x525dc9[_0x20d0('0x42')]);var _0x53ab23={'where':_0x1eee8c[_0x20d0('0x3d')]};return db[_0x20d0('0x2c')][_0x20d0('0x1e')](_0x53ab23)[_0x20d0('0x25')](function(_0x336f4e){_0x2e2644['count']=_0x336f4e;if(_0x525dc9[_0x20d0('0x32')][_0x20d0('0x43')]){_0x1eee8c['include']=[{'all':!![]}];}return db[_0x20d0('0x2c')][_0x20d0('0x45')](_0x1eee8c);})[_0x20d0('0x25')](function(_0x5e99c5){_0x2e2644[_0x20d0('0x4f')]=_0x5e99c5;return _0x2e2644;})[_0x20d0('0x25')](respondWithFilteredResult(_0xc9fc3a,_0x1eee8c,'getVoiceQueuesReport'))['catch'](handleError(_0xc9fc3a,null,_0x20d0('0x50')));}; \ No newline at end of file +var _0x4ccc=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','create','body','destroy','describe','getVoiceQueuesReport','hasOwnProperty','includeAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','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','redis','./voiceQueueReport.socket','register','sendStatus'];(function(_0x3d7be4,_0x46e37d){var _0x59c962=function(_0x141645){while(--_0x141645){_0x3d7be4['push'](_0x3d7be4['shift']());}};_0x59c962(++_0x46e37d);}(_0x4ccc,0x81));var _0xc4cc=function(_0x157c79,_0x38ea3a){_0x157c79=_0x157c79-0x0;var _0x8315ff=_0x4ccc[_0x157c79];return _0x8315ff;};'use strict';var emlformat=require(_0xc4cc('0x0'));var rimraf=require(_0xc4cc('0x1'));var zipdir=require(_0xc4cc('0x2'));var jsonpatch=require(_0xc4cc('0x3'));var rp=require(_0xc4cc('0x4'));var moment=require('moment');var BPromise=require(_0xc4cc('0x5'));var Mustache=require('mustache');var util=require(_0xc4cc('0x6'));var path=require(_0xc4cc('0x7'));var sox=require(_0xc4cc('0x8'));var csv=require(_0xc4cc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc4cc('0xa'));var crypto=require(_0xc4cc('0xb'));var jsforce=require(_0xc4cc('0xc'));var deskjs=require(_0xc4cc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc4cc('0xe'));var Papa=require(_0xc4cc('0xf'));var Redis=require(_0xc4cc('0x10'));var authService=require(_0xc4cc('0x11'));var qs=require(_0xc4cc('0x12'));var as=require(_0xc4cc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc4cc('0x14'));var utils=require(_0xc4cc('0x15'));var config=require(_0xc4cc('0x16'));var licenseUtil=require(_0xc4cc('0x17'));var db=require(_0xc4cc('0x18'))['db'];config['redis']=_['defaults'](config[_0xc4cc('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc4cc('0x19')]));require(_0xc4cc('0x1a'))[_0xc4cc('0x1b')](socket);function respondWithStatusCode(_0x9d884e,_0x52ff20){_0x52ff20=_0x52ff20||0xcc;return function(_0x334b2c){if(_0x334b2c){return _0x9d884e[_0xc4cc('0x1c')](_0x52ff20);}return _0x9d884e[_0xc4cc('0x1d')](_0x52ff20)['end']();};}function respondWithResult(_0x4ec1ad,_0x37f3e9){_0x37f3e9=_0x37f3e9||0xc8;return function(_0x3cc16e){if(_0x3cc16e){return _0x4ec1ad[_0xc4cc('0x1d')](_0x37f3e9)[_0xc4cc('0x1e')](_0x3cc16e);}};}function respondWithFilteredResult(_0x5906a4,_0x499711){return function(_0x3f62af){if(_0x3f62af){var _0x296de8=typeof _0x499711[_0xc4cc('0x1f')]===_0xc4cc('0x20')&&typeof _0x499711[_0xc4cc('0x21')]===_0xc4cc('0x20');var _0x567fe0=_0x3f62af[_0xc4cc('0x22')];var _0x54d3b9=_0x296de8?0x0:_0x499711[_0xc4cc('0x1f')];var _0x37ba8e=_0x296de8?_0x3f62af[_0xc4cc('0x22')]:_0x499711[_0xc4cc('0x1f')]+_0x499711[_0xc4cc('0x21')];var _0x5283c1;if(_0x37ba8e>=_0x567fe0){_0x37ba8e=_0x567fe0;_0x5283c1=0xc8;}else{_0x5283c1=0xce;}_0x5906a4['status'](_0x5283c1);return _0x5906a4[_0xc4cc('0x23')](_0xc4cc('0x24'),_0x54d3b9+'-'+_0x37ba8e+'/'+_0x567fe0)['json'](_0x3f62af);}return null;};}function patchUpdates(_0x4bebb5){return function(_0x54e65c){try{jsonpatch[_0xc4cc('0x25')](_0x54e65c,_0x4bebb5,!![]);}catch(_0x5cc53c){return BPromise[_0xc4cc('0x26')](_0x5cc53c);}return _0x54e65c['save']();};}function saveUpdates(_0x48308c,_0x236d09){return function(_0x543b70){if(_0x543b70){return _0x543b70[_0xc4cc('0x27')](_0x48308c)[_0xc4cc('0x28')](function(_0x256716){return _0x256716;});}return null;};}function removeEntity(_0xae4954,_0x17b011){return function(_0x5084ad){if(_0x5084ad){return _0x5084ad['destroy']()[_0xc4cc('0x28')](function(){_0xae4954[_0xc4cc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a706,_0x12b37a){return function(_0x311b4e){if(!_0x311b4e){_0x54a706['sendStatus'](0x194);}return _0x311b4e;};}function handleError(_0x11e87b,_0x47c2b5){_0x47c2b5=_0x47c2b5||0x1f4;return function(_0x399809){logger[_0xc4cc('0x29')](_0x399809['stack']);if(_0x399809['name']){delete _0x399809[_0xc4cc('0x2a')];}_0x11e87b['status'](_0x47c2b5)[_0xc4cc('0x2b')](_0x399809);};}exports['index']=function(_0x671849,_0x335fcd){var _0x4016f0={},_0x14fa3c={},_0xf481b4={'count':0x0,'rows':[]};var _0x17da49=_['map'](db[_0xc4cc('0x2c')][_0xc4cc('0x2d')],function(_0x35b25d){return{'name':_0x35b25d[_0xc4cc('0x2e')],'type':_0x35b25d[_0xc4cc('0x2f')][_0xc4cc('0x30')]};});_0x14fa3c[_0xc4cc('0x31')]=_[_0xc4cc('0x32')](_0x17da49,'name');_0x14fa3c[_0xc4cc('0x33')]=_['keys'](_0x671849[_0xc4cc('0x33')]);_0x14fa3c[_0xc4cc('0x34')]=_[_0xc4cc('0x35')](_0x14fa3c[_0xc4cc('0x31')],_0x14fa3c[_0xc4cc('0x33')]);_0x4016f0['attributes']=_[_0xc4cc('0x35')](_0x14fa3c[_0xc4cc('0x31')],qs['fields'](_0x671849['query'][_0xc4cc('0x36')]));_0x4016f0[_0xc4cc('0x37')]=_0x4016f0[_0xc4cc('0x37')][_0xc4cc('0x38')]?_0x4016f0[_0xc4cc('0x37')]:_0x14fa3c[_0xc4cc('0x31')];if(!_0x671849[_0xc4cc('0x33')]['hasOwnProperty'](_0xc4cc('0x39'))){_0x4016f0[_0xc4cc('0x21')]=qs[_0xc4cc('0x21')](_0x671849['query'][_0xc4cc('0x21')]);_0x4016f0[_0xc4cc('0x1f')]=qs[_0xc4cc('0x1f')](_0x671849[_0xc4cc('0x33')][_0xc4cc('0x1f')]);}_0x4016f0[_0xc4cc('0x3a')]=qs[_0xc4cc('0x3b')](_0x671849[_0xc4cc('0x33')][_0xc4cc('0x3b')]);_0x4016f0[_0xc4cc('0x3c')]=qs[_0xc4cc('0x34')](_['pick'](_0x671849[_0xc4cc('0x33')],_0x14fa3c['filters']),_0x17da49);if(_0x671849[_0xc4cc('0x33')][_0xc4cc('0x3d')]){_0x4016f0[_0xc4cc('0x3c')]=_['merge'](_0x4016f0[_0xc4cc('0x3c')],{'$or':_[_0xc4cc('0x32')](_0x17da49,function(_0x5aef0e){if(_0x5aef0e['type']!==_0xc4cc('0x3e')){var _0x44f23c={};_0x44f23c[_0x5aef0e[_0xc4cc('0x2a')]]={'$like':'%'+_0x671849[_0xc4cc('0x33')][_0xc4cc('0x3d')]+'%'};return _0x44f23c;}})});}_0x4016f0=_[_0xc4cc('0x3f')]({},_0x4016f0,_0x671849[_0xc4cc('0x40')]);var _0xbdeffb={'where':_0x4016f0[_0xc4cc('0x3c')]};return db[_0xc4cc('0x2c')][_0xc4cc('0x22')](_0xbdeffb)['then'](function(_0x3f95bf){_0xf481b4[_0xc4cc('0x22')]=_0x3f95bf;if(_0x671849[_0xc4cc('0x33')]['includeAll']){_0x4016f0[_0xc4cc('0x41')]=[{'all':!![]}];}return db[_0xc4cc('0x2c')][_0xc4cc('0x42')](_0x4016f0);})[_0xc4cc('0x28')](function(_0x1fde1a){_0xf481b4[_0xc4cc('0x43')]=_0x1fde1a;return _0xf481b4;})[_0xc4cc('0x28')](respondWithFilteredResult(_0x335fcd,_0x4016f0))[_0xc4cc('0x44')](handleError(_0x335fcd,null));};exports[_0xc4cc('0x45')]=function(_0x10b7ea,_0x5a47a2){var _0x277c78={'raw':![],'where':{'id':_0x10b7ea[_0xc4cc('0x46')]['id']}},_0x2d7742={};_0x2d7742[_0xc4cc('0x31')]=_[_0xc4cc('0x47')](db[_0xc4cc('0x2c')][_0xc4cc('0x2d')]);_0x2d7742[_0xc4cc('0x33')]=_['keys'](_0x10b7ea[_0xc4cc('0x33')]);_0x2d7742[_0xc4cc('0x34')]=_['intersection'](_0x2d7742[_0xc4cc('0x31')],_0x2d7742[_0xc4cc('0x33')]);_0x277c78['attributes']=_['intersection'](_0x2d7742[_0xc4cc('0x31')],qs['fields'](_0x10b7ea[_0xc4cc('0x33')][_0xc4cc('0x36')]));_0x277c78[_0xc4cc('0x37')]=_0x277c78[_0xc4cc('0x37')][_0xc4cc('0x38')]?_0x277c78[_0xc4cc('0x37')]:_0x2d7742[_0xc4cc('0x31')];if(_0x10b7ea[_0xc4cc('0x33')]['includeAll']){_0x277c78[_0xc4cc('0x41')]=[{'all':!![]}];}_0x277c78=_[_0xc4cc('0x3f')]({},_0x277c78,_0x10b7ea[_0xc4cc('0x40')]);return db['VoiceQueueReport']['find'](_0x277c78)['then'](handleEntityNotFound(_0x5a47a2,null))['then'](respondWithResult(_0x5a47a2,null))[_0xc4cc('0x44')](handleError(_0x5a47a2,null));};exports[_0xc4cc('0x48')]=function(_0x465f27,_0xefaaad){return db[_0xc4cc('0x2c')][_0xc4cc('0x48')](_0x465f27[_0xc4cc('0x49')],{})[_0xc4cc('0x28')](respondWithResult(_0xefaaad,0xc9))[_0xc4cc('0x44')](handleError(_0xefaaad,null));};exports[_0xc4cc('0x27')]=function(_0xe3874c,_0x31761f){if(_0xe3874c[_0xc4cc('0x49')]['id']){delete _0xe3874c[_0xc4cc('0x49')]['id'];}return db[_0xc4cc('0x2c')]['find']({'where':{'id':_0xe3874c['params']['id']}})[_0xc4cc('0x28')](handleEntityNotFound(_0x31761f,null))[_0xc4cc('0x28')](saveUpdates(_0xe3874c[_0xc4cc('0x49')],null))[_0xc4cc('0x28')](respondWithResult(_0x31761f,null))[_0xc4cc('0x44')](handleError(_0x31761f,null));};exports[_0xc4cc('0x4a')]=function(_0x18cead,_0x5155af){return db[_0xc4cc('0x2c')]['find']({'where':{'id':_0x18cead[_0xc4cc('0x46')]['id']}})[_0xc4cc('0x28')](handleEntityNotFound(_0x5155af,null))['then'](removeEntity(_0x5155af,null))[_0xc4cc('0x44')](handleError(_0x5155af,null));};exports['describe']=function(_0x311959,_0x21564e){return db['VoiceQueueReport'][_0xc4cc('0x4b')]()[_0xc4cc('0x28')](respondWithResult(_0x21564e,null))['catch'](handleError(_0x21564e,null));};exports[_0xc4cc('0x4c')]=function(_0x4b7c36,_0x3d50c5){var _0x14ba34={},_0x4eb1fe={},_0x7e4d8={'count':0x0,'rows':[]};_0x4eb1fe[_0xc4cc('0x31')]=_[_0xc4cc('0x47')](db[_0xc4cc('0x2c')]['rawAttributes']);_0x4eb1fe[_0xc4cc('0x33')]=_[_0xc4cc('0x47')](_0x4b7c36[_0xc4cc('0x33')]);_0x4eb1fe['filters']=_[_0xc4cc('0x35')](_0x4eb1fe['model'],_0x4eb1fe[_0xc4cc('0x33')]);_0x14ba34[_0xc4cc('0x37')]=_[_0xc4cc('0x35')](_0x4eb1fe[_0xc4cc('0x31')],qs[_0xc4cc('0x36')](_0x4b7c36[_0xc4cc('0x33')][_0xc4cc('0x36')]));_0x14ba34['attributes']=_0x14ba34[_0xc4cc('0x37')][_0xc4cc('0x38')]?_0x14ba34[_0xc4cc('0x37')]:_0x4eb1fe['model'];if(!_0x4b7c36[_0xc4cc('0x33')][_0xc4cc('0x4d')](_0xc4cc('0x39'))){_0x14ba34['limit']=qs[_0xc4cc('0x21')](_0x4b7c36[_0xc4cc('0x33')][_0xc4cc('0x21')]);_0x14ba34[_0xc4cc('0x1f')]=qs[_0xc4cc('0x1f')](_0x4b7c36[_0xc4cc('0x33')][_0xc4cc('0x1f')]);}_0x14ba34[_0xc4cc('0x3a')]=qs[_0xc4cc('0x3b')](_0x4b7c36[_0xc4cc('0x33')][_0xc4cc('0x3b')]);_0x14ba34['where']=qs[_0xc4cc('0x34')](_['pick'](_0x4b7c36[_0xc4cc('0x33')],_0x4eb1fe[_0xc4cc('0x34')]));if(_0x4b7c36[_0xc4cc('0x33')][_0xc4cc('0x3d')]){_0x14ba34['where']=_[_0xc4cc('0x3f')](_0x14ba34['where'],{'$or':_[_0xc4cc('0x32')](_0x14ba34[_0xc4cc('0x37')],function(_0x3a2eff){var _0x875870={};_0x875870[_0x3a2eff]={'$like':'%'+_0x4b7c36['query'][_0xc4cc('0x3d')]+'%'};return _0x875870;})});}_0x14ba34=_[_0xc4cc('0x3f')]({},_0x14ba34,_0x4b7c36['options']);var _0x324788={'where':_0x14ba34[_0xc4cc('0x3c')]};return db[_0xc4cc('0x2c')]['count'](_0x324788)[_0xc4cc('0x28')](function(_0x5668df){_0x7e4d8['count']=_0x5668df;if(_0x4b7c36['query'][_0xc4cc('0x4e')]){_0x14ba34[_0xc4cc('0x41')]=[{'all':!![]}];}return db[_0xc4cc('0x2c')][_0xc4cc('0x42')](_0x14ba34);})[_0xc4cc('0x28')](function(_0x61433d){_0x7e4d8[_0xc4cc('0x43')]=_0x61433d;return _0x7e4d8;})['then'](respondWithFilteredResult(_0x3d50c5,_0x14ba34,_0xc4cc('0x4c')))[_0xc4cc('0x44')](handleError(_0x3d50c5,null,_0xc4cc('0x4c')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 5e9173e..6af9092 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 _0xa091=['events','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0xa091,0x18c));var _0x1a09=function(_0x4298b1,_0x1ec4f1){_0x4298b1=_0x4298b1-0x0;var _0x3d6d4a=_0xa091[_0x4298b1];return _0x3d6d4a;};'use strict';var EventEmitter=require(_0x1a09('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x1a09('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1a09('0x2')](0x0);var events={'afterCreate':_0x1a09('0x3'),'afterUpdate':_0x1a09('0x4'),'afterDestroy':_0x1a09('0x5')};function emitEvent(_0x58ce16){return function(_0x237039,_0x3077e5,_0x1d1eef){VoiceQueueReportEvents[_0x1a09('0x6')](_0x58ce16+':'+_0x237039['id'],_0x237039);VoiceQueueReportEvents['emit'](_0x58ce16,_0x237039);_0x1d1eef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x1a09('0x7')](e,emitEvent(event));}}module[_0x1a09('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xea00=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','save','update'];(function(_0x5a26f5,_0x196300){var _0x2e9ef7=function(_0x593736){while(--_0x593736){_0x5a26f5['push'](_0x5a26f5['shift']());}};_0x2e9ef7(++_0x196300);}(_0xea00,0x64));var _0x0ea0=function(_0x1ee88f,_0x28c7ab){_0x1ee88f=_0x1ee88f-0x0;var _0x4b5ce8=_0xea00[_0x1ee88f];return _0x4b5ce8;};'use strict';var EventEmitter=require(_0x0ea0('0x0'));var VoiceQueueReport=require(_0x0ea0('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ea0('0x2'),'afterUpdate':_0x0ea0('0x3'),'afterDestroy':_0x0ea0('0x4')};function emitEvent(_0x3ef27f){return function(_0x5cfcac,_0x27d5e0,_0x2c069f){VoiceQueueReportEvents[_0x0ea0('0x5')](_0x3ef27f+':'+_0x5cfcac['id'],_0x5cfcac);VoiceQueueReportEvents['emit'](_0x3ef27f,_0x5cfcac);_0x2c069f(null);};}for(var e in events){if(events[_0x0ea0('0x6')](e)){var event=events[e];VoiceQueueReport[_0x0ea0('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index dc26747..b713a7e 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 _0x42ab=['path','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','moment','request-promise'];(function(_0x1550eb,_0x447251){var _0x477220=function(_0x24454f){while(--_0x24454f){_0x1550eb['push'](_0x1550eb['shift']());}};_0x477220(++_0x447251);}(_0x42ab,0x67));var _0xb42a=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x42ab[_0x5416db];return _0x243e35;};'use strict';var _=require('lodash');var util=require(_0xb42a('0x0'));var logger=require(_0xb42a('0x1'))(_0xb42a('0x2'));var moment=require(_0xb42a('0x3'));var BPromise=require('bluebird');var rp=require(_0xb42a('0x4'));var fs=require('fs');var path=require(_0xb42a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0xb42a('0x6')]=function(_0x2dcf66,_0x54977b){return _0x2dcf66[_0xb42a('0x7')](_0xb42a('0x8'),attributes,{'tableName':_0xb42a('0x9'),'paranoid':![],'indexes':[{'fields':[_0xb42a('0xa')]},{'fields':[_0xb42a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x17bd=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x17bd,0xbe));var _0xd17b=function(_0xcd3810,_0x526a4a){_0xcd3810=_0xcd3810-0x0;var _0x1ddfef=_0x17bd[_0xcd3810];return _0x1ddfef;};'use strict';var _=require(_0xd17b('0x0'));var util=require(_0xd17b('0x1'));var logger=require(_0xd17b('0x2'))(_0xd17b('0x3'));var moment=require(_0xd17b('0x4'));var BPromise=require(_0xd17b('0x5'));var rp=require(_0xd17b('0x6'));var fs=require('fs');var path=require(_0xd17b('0x7'));var rimraf=require('rimraf');var config=require(_0xd17b('0x8'));var attributes=require(_0xd17b('0x9'));module[_0xd17b('0xa')]=function(_0x5adc68,_0x2c6744){return _0x5adc68[_0xd17b('0xb')](_0xd17b('0xc'),attributes,{'tableName':_0xd17b('0xd'),'paranoid':![],'indexes':[{'fields':[_0xd17b('0xe')]},{'fields':[_0xd17b('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index d8f07ee..ada6966 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 _0xfeb1=['GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','include','model','then','CreateVoiceQueueReport','body','raw','UpdateVoiceQueueReport','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x28ef81,_0x2224f0){var _0x24de06=function(_0x524979){while(--_0x524979){_0x28ef81['push'](_0x28ef81['shift']());}};_0x24de06(++_0x2224f0);}(_0xfeb1,0xf8));var _0x1feb=function(_0x7400bb,_0x50d4ef){_0x7400bb=_0x7400bb-0x0;var _0x5c909b=_0xfeb1[_0x7400bb];return _0x5c909b;};'use strict';var _=require(_0x1feb('0x0'));var util=require(_0x1feb('0x1'));var moment=require('moment');var BPromise=require(_0x1feb('0x2'));var rs=require(_0x1feb('0x3'));var fs=require('fs');var Redis=require(_0x1feb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1feb('0x5'))(_0x1feb('0x6'));var config=require(_0x1feb('0x7'));var jayson=require(_0x1feb('0x8'));var client=jayson['client'][_0x1feb('0x9')]({'port':0x232a});config[_0x1feb('0xa')]=_[_0x1feb('0xb')](config[_0x1feb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1feb('0xc'))(new Redis(config[_0x1feb('0xa')]));require(_0x1feb('0xd'))['register'](socket);function respondWithRpcPromise(_0x4de815,_0x36a6da,_0x1f1ffb){return new BPromise(function(_0x3e2d2c,_0x2c666f){return client[_0x1feb('0xe')](_0x4de815,_0x1f1ffb)['then'](function(_0xb1df22){logger[_0x1feb('0xf')](_0x1feb('0x10'),_0x36a6da,_0x1feb('0x11'));logger[_0x1feb('0x12')](_0x1feb('0x13'),_0x36a6da,_0x1feb('0x11'),JSON[_0x1feb('0x14')](_0xb1df22));if(_0xb1df22['error']){if(_0xb1df22[_0x1feb('0x15')]['code']===0x1f4){logger[_0x1feb('0x15')](_0x1feb('0x10'),_0x36a6da,_0xb1df22['error'][_0x1feb('0x16')]);return _0x2c666f(_0xb1df22[_0x1feb('0x15')]['message']);}logger[_0x1feb('0x15')](_0x1feb('0x10'),_0x36a6da,_0xb1df22[_0x1feb('0x15')]['message']);return _0x3e2d2c(_0xb1df22['error'][_0x1feb('0x16')]);}else{logger['info'](_0x1feb('0x10'),_0x36a6da,_0x1feb('0x11'));_0x3e2d2c(_0xb1df22[_0x1feb('0x17')][_0x1feb('0x16')]);}})[_0x1feb('0x18')](function(_0x2e345b){logger[_0x1feb('0x15')](_0x1feb('0x10'),_0x36a6da,_0x2e345b);_0x2c666f(_0x2e345b);});});}exports[_0x1feb('0x19')]=function(_0x58aff1){var _0xd48385=this;return new Promise(function(_0x5d41e6,_0xd381c8){return db[_0x1feb('0x1a')][_0x1feb('0x1b')]({'raw':_0x58aff1[_0x1feb('0x1c')]?_0x58aff1[_0x1feb('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x58aff1['options']?_0x58aff1['options'][_0x1feb('0x1d')]||null:null,'attributes':_0x58aff1[_0x1feb('0x1c')]?_0x58aff1['options'][_0x1feb('0x1e')]||null:null,'limit':_0x58aff1['options']?_0x58aff1['options'][_0x1feb('0x1f')]||null:null,'include':_0x58aff1[_0x1feb('0x1c')]?_0x58aff1[_0x1feb('0x1c')][_0x1feb('0x20')]?_['map'](_0x58aff1['options'][_0x1feb('0x20')],function(_0x25ba58){return{'model':db[_0x25ba58[_0x1feb('0x21')]],'as':_0x25ba58['as'],'attributes':_0x25ba58['attributes'],'include':_0x25ba58[_0x1feb('0x20')]?_['map'](_0x25ba58[_0x1feb('0x20')],function(_0x417072){return{'model':db[_0x417072[_0x1feb('0x21')]],'as':_0x417072['as'],'attributes':_0x417072[_0x1feb('0x1e')],'include':_0x417072[_0x1feb('0x20')]?_['map'](_0x417072[_0x1feb('0x20')],function(_0x191e40){return{'model':db[_0x191e40[_0x1feb('0x21')]],'as':_0x191e40['as'],'attributes':_0x191e40[_0x1feb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1feb('0x22')](function(_0x350078){logger[_0x1feb('0xf')](_0x1feb('0x19'),_0x58aff1);logger['debug']('GetVoiceQueueReport',_0x58aff1,JSON[_0x1feb('0x14')](_0x350078));_0x5d41e6(_0x350078);})[_0x1feb('0x18')](function(_0x1ed7b2){logger['error'](_0x1feb('0x19'),_0x1ed7b2[_0x1feb('0x16')],_0x58aff1);_0xd381c8(_0xd48385[_0x1feb('0x15')](0x1f4,_0x1ed7b2[_0x1feb('0x16')]));});});};exports[_0x1feb('0x23')]=function(_0x4b6bc9){var _0x588a8e=this;return new Promise(function(_0x3b9d42,_0x7795e0){return db['VoiceQueueReport']['create'](_0x4b6bc9[_0x1feb('0x24')],{'raw':_0x4b6bc9[_0x1feb('0x1c')]?_0x4b6bc9[_0x1feb('0x1c')][_0x1feb('0x25')]===undefined?!![]:![]:!![]})[_0x1feb('0x22')](function(_0x2937db){logger[_0x1feb('0xf')](_0x1feb('0x23'),_0x4b6bc9);logger[_0x1feb('0x12')](_0x1feb('0x23'),_0x4b6bc9,JSON[_0x1feb('0x14')](_0x2937db));_0x3b9d42(_0x2937db);})[_0x1feb('0x18')](function(_0x4965c0){logger[_0x1feb('0x15')](_0x1feb('0x23'),_0x4965c0['message'],_0x4b6bc9);_0x7795e0(_0x588a8e[_0x1feb('0x15')](0x1f4,_0x4965c0[_0x1feb('0x16')]));});});};exports[_0x1feb('0x26')]=function(_0xdbf6c5){var _0x368ef6=this;return new Promise(function(_0x156965,_0x4d78cf){return db['VoiceQueueReport']['update'](_0xdbf6c5['body'],{'raw':_0xdbf6c5[_0x1feb('0x1c')]?_0xdbf6c5[_0x1feb('0x1c')][_0x1feb('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdbf6c5[_0x1feb('0x1c')]?_0xdbf6c5[_0x1feb('0x1c')][_0x1feb('0x1d')]||null:null,'attributes':_0xdbf6c5[_0x1feb('0x1c')]?_0xdbf6c5['options'][_0x1feb('0x1e')]||null:null,'limit':_0xdbf6c5[_0x1feb('0x1c')]?_0xdbf6c5[_0x1feb('0x1c')]['limit']||null:null})[_0x1feb('0x22')](function(_0x244955){logger[_0x1feb('0xf')]('UpdateVoiceQueueReport',_0xdbf6c5);logger['debug'](_0x1feb('0x26'),_0xdbf6c5,JSON['stringify'](_0x244955));_0x156965(_0x244955);})['catch'](function(_0x2bb6db){logger[_0x1feb('0x15')](_0x1feb('0x26'),_0x2bb6db[_0x1feb('0x16')],_0xdbf6c5);_0x4d78cf(_0x368ef6['error'](0x1f4,_0x2bb6db[_0x1feb('0x16')]));});});}; \ No newline at end of file +var _0x9ebf=['GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','limit','map','include','model','attributes','then','CreateVoiceQueueReport','body','raw','debug','UpdateVoiceQueueReport','update','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9ebf,0x171));var _0xf9eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9ebf[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf9eb('0x0'));var util=require('util');var moment=require(_0xf9eb('0x1'));var BPromise=require(_0xf9eb('0x2'));var rs=require(_0xf9eb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9eb('0x5'))(_0xf9eb('0x6'));var config=require(_0xf9eb('0x7'));var jayson=require(_0xf9eb('0x8'));var client=jayson[_0xf9eb('0x9')][_0xf9eb('0xa')]({'port':0x232a});config[_0xf9eb('0xb')]=_[_0xf9eb('0xc')](config[_0xf9eb('0xb')],{'host':_0xf9eb('0xd'),'port':0x18eb});var socket=require(_0xf9eb('0xe'))(new Redis(config['redis']));require(_0xf9eb('0xf'))[_0xf9eb('0x10')](socket);function respondWithRpcPromise(_0x375310,_0x2550b5,_0x1254b9){return new BPromise(function(_0x385375,_0x197b59){return client[_0xf9eb('0x11')](_0x375310,_0x1254b9)['then'](function(_0x42a317){logger[_0xf9eb('0x12')](_0xf9eb('0x13'),_0x2550b5,_0xf9eb('0x14'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x2550b5,_0xf9eb('0x14'),JSON[_0xf9eb('0x15')](_0x42a317));if(_0x42a317[_0xf9eb('0x16')]){if(_0x42a317[_0xf9eb('0x16')][_0xf9eb('0x17')]===0x1f4){logger[_0xf9eb('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x2550b5,_0x42a317[_0xf9eb('0x16')][_0xf9eb('0x18')]);return _0x197b59(_0x42a317[_0xf9eb('0x16')][_0xf9eb('0x18')]);}logger[_0xf9eb('0x16')](_0xf9eb('0x13'),_0x2550b5,_0x42a317[_0xf9eb('0x16')][_0xf9eb('0x18')]);return _0x385375(_0x42a317[_0xf9eb('0x16')]['message']);}else{logger[_0xf9eb('0x12')](_0xf9eb('0x13'),_0x2550b5,'request\x20sent');_0x385375(_0x42a317[_0xf9eb('0x19')][_0xf9eb('0x18')]);}})[_0xf9eb('0x1a')](function(_0x3b580f){logger[_0xf9eb('0x16')](_0xf9eb('0x13'),_0x2550b5,_0x3b580f);_0x197b59(_0x3b580f);});});}exports[_0xf9eb('0x1b')]=function(_0x473b73){var _0x8c3a39=this;return new Promise(function(_0x5d4923,_0x4ea674){return db[_0xf9eb('0x1c')][_0xf9eb('0x1d')]({'raw':_0x473b73['options']?_0x473b73['options']['raw']===undefined?!![]:![]:!![],'where':_0x473b73['options']?_0x473b73[_0xf9eb('0x1e')][_0xf9eb('0x1f')]||null:null,'attributes':_0x473b73[_0xf9eb('0x1e')]?_0x473b73[_0xf9eb('0x1e')]['attributes']||null:null,'limit':_0x473b73[_0xf9eb('0x1e')]?_0x473b73[_0xf9eb('0x1e')][_0xf9eb('0x20')]||null:null,'include':_0x473b73[_0xf9eb('0x1e')]?_0x473b73[_0xf9eb('0x1e')]['include']?_[_0xf9eb('0x21')](_0x473b73['options'][_0xf9eb('0x22')],function(_0x38aa55){return{'model':db[_0x38aa55[_0xf9eb('0x23')]],'as':_0x38aa55['as'],'attributes':_0x38aa55[_0xf9eb('0x24')],'include':_0x38aa55[_0xf9eb('0x22')]?_[_0xf9eb('0x21')](_0x38aa55['include'],function(_0x497471){return{'model':db[_0x497471['model']],'as':_0x497471['as'],'attributes':_0x497471[_0xf9eb('0x24')],'include':_0x497471['include']?_[_0xf9eb('0x21')](_0x497471[_0xf9eb('0x22')],function(_0x338153){return{'model':db[_0x338153[_0xf9eb('0x23')]],'as':_0x338153['as'],'attributes':_0x338153['attributes']};}):[]};}):[]};}):[]:[]})[_0xf9eb('0x25')](function(_0x5b3a35){logger[_0xf9eb('0x12')]('GetVoiceQueueReport',_0x473b73);logger['debug'](_0xf9eb('0x1b'),_0x473b73,JSON[_0xf9eb('0x15')](_0x5b3a35));_0x5d4923(_0x5b3a35);})[_0xf9eb('0x1a')](function(_0x161f77){logger['error'](_0xf9eb('0x1b'),_0x161f77[_0xf9eb('0x18')],_0x473b73);_0x4ea674(_0x8c3a39[_0xf9eb('0x16')](0x1f4,_0x161f77[_0xf9eb('0x18')]));});});};exports[_0xf9eb('0x26')]=function(_0x43d16b){var _0x21edf5=this;return new Promise(function(_0x3fd880,_0x304330){return db[_0xf9eb('0x1c')]['create'](_0x43d16b[_0xf9eb('0x27')],{'raw':_0x43d16b[_0xf9eb('0x1e')]?_0x43d16b[_0xf9eb('0x1e')][_0xf9eb('0x28')]===undefined?!![]:![]:!![]})[_0xf9eb('0x25')](function(_0x3193a0){logger[_0xf9eb('0x12')]('CreateVoiceQueueReport',_0x43d16b);logger[_0xf9eb('0x29')]('CreateVoiceQueueReport',_0x43d16b,JSON[_0xf9eb('0x15')](_0x3193a0));_0x3fd880(_0x3193a0);})['catch'](function(_0x366cde){logger['error'](_0xf9eb('0x26'),_0x366cde[_0xf9eb('0x18')],_0x43d16b);_0x304330(_0x21edf5[_0xf9eb('0x16')](0x1f4,_0x366cde[_0xf9eb('0x18')]));});});};exports[_0xf9eb('0x2a')]=function(_0x4e70ec){var _0x3494b0=this;return new Promise(function(_0x24f386,_0x1cafd8){return db['VoiceQueueReport'][_0xf9eb('0x2b')](_0x4e70ec[_0xf9eb('0x27')],{'raw':_0x4e70ec[_0xf9eb('0x1e')]?_0x4e70ec[_0xf9eb('0x1e')][_0xf9eb('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e70ec[_0xf9eb('0x1e')]?_0x4e70ec[_0xf9eb('0x1e')][_0xf9eb('0x1f')]||null:null,'attributes':_0x4e70ec['options']?_0x4e70ec['options']['attributes']||null:null,'limit':_0x4e70ec[_0xf9eb('0x1e')]?_0x4e70ec[_0xf9eb('0x1e')][_0xf9eb('0x20')]||null:null})[_0xf9eb('0x25')](function(_0x265022){logger[_0xf9eb('0x12')]('UpdateVoiceQueueReport',_0x4e70ec);logger['debug'](_0xf9eb('0x2a'),_0x4e70ec,JSON['stringify'](_0x265022));_0x24f386(_0x265022);})[_0xf9eb('0x1a')](function(_0x23c53a){logger[_0xf9eb('0x16')](_0xf9eb('0x2a'),_0x23c53a[_0xf9eb('0x18')],_0x4e70ec);_0x1cafd8(_0x3494b0[_0xf9eb('0x16')](0x1f4,_0x23c53a[_0xf9eb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index ea6f31d..c0d4bc2 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 _0x1224=['update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x5490c2,_0x3d757f){var _0x4f4a3d=function(_0x4e992a){while(--_0x4e992a){_0x5490c2['push'](_0x5490c2['shift']());}};_0x4f4a3d(++_0x3d757f);}(_0x1224,0x10d));var _0x4122=function(_0x2d7836,_0x5a5412){_0x2d7836=_0x2d7836-0x0;var _0x491179=_0x1224[_0x2d7836];return _0x491179;};'use strict';var VoiceQueueReportEvents=require(_0x4122('0x0'));var events=[_0x4122('0x1'),_0x4122('0x2'),_0x4122('0x3')];function createListener(_0x488f55,_0x3d42a9){return function(_0x51632b){_0x3d42a9[_0x4122('0x4')](_0x488f55,_0x51632b);};}function removeListener(_0x1f1533,_0x2f506b){return function(){VoiceQueueReportEvents['removeListener'](_0x1f1533,_0x2f506b);};}exports[_0x4122('0x5')]=function(_0x76278c){for(var _0xc6dfaf=0x0,_0x40b5e4=events[_0x4122('0x6')];_0xc6dfaf<_0x40b5e4;_0xc6dfaf++){var _0x431470=events[_0xc6dfaf];var _0x2444a3=createListener(_0x4122('0x7')+_0x431470,_0x76278c);VoiceQueueReportEvents['on'](_0x431470,_0x2444a3);}}; \ No newline at end of file +var _0x31c2=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x18db38,_0x3a1001){var _0x185e7a=function(_0x5aca6d){while(--_0x5aca6d){_0x18db38['push'](_0x18db38['shift']());}};_0x185e7a(++_0x3a1001);}(_0x31c2,0x1e1));var _0x231c=function(_0x1d787c,_0x4c1167){_0x1d787c=_0x1d787c-0x0;var _0x59d195=_0x31c2[_0x1d787c];return _0x59d195;};'use strict';var VoiceQueueReportEvents=require(_0x231c('0x0'));var events=[_0x231c('0x1'),_0x231c('0x2'),_0x231c('0x3')];function createListener(_0x1c57c9,_0x7e36a0){return function(_0xa1faa4){_0x7e36a0[_0x231c('0x4')](_0x1c57c9,_0xa1faa4);};}function removeListener(_0x5b0b0a,_0x59f232){return function(){VoiceQueueReportEvents[_0x231c('0x5')](_0x5b0b0a,_0x59f232);};}exports[_0x231c('0x6')]=function(_0x1f3f7d){for(var _0x219c3f=0x0,_0x48bfb2=events[_0x231c('0x7')];_0x219c3f<_0x48bfb2;_0x219c3f++){var _0x49ff9e=events[_0x219c3f];var _0x439df8=createListener(_0x231c('0x8')+_0x49ff9e,_0x1f3f7d);VoiceQueueReportEvents['on'](_0x49ff9e,_0x439df8);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 1719a69..0032a88 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 _0xb950=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','/:id','isAuthenticated','show','create','put','delete','destroy'];(function(_0x5e472c,_0x425b2e){var _0x1d055e=function(_0x361d13){while(--_0x361d13){_0x5e472c['push'](_0x5e472c['shift']());}};_0x1d055e(++_0x425b2e);}(_0xb950,0x18d));var _0x0b95=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb950[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x0b95('0x0'));var util=require('util');var path=require(_0x0b95('0x1'));var timeout=require('connect-timeout');var express=require(_0x0b95('0x2'));var router=express[_0x0b95('0x3')]();var fs_extra=require(_0x0b95('0x4'));var auth=require(_0x0b95('0x5'));var interaction=require(_0x0b95('0x6'));var config=require(_0x0b95('0x7'));var controller=require(_0x0b95('0x8'));router[_0x0b95('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0b95('0x9')](_0x0b95('0xa'),auth[_0x0b95('0xb')](),controller[_0x0b95('0xc')]);router['post']('/',auth[_0x0b95('0xb')](),controller[_0x0b95('0xd')]);router[_0x0b95('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0b95('0xf')](_0x0b95('0xa'),auth[_0x0b95('0xb')](),controller[_0x0b95('0x10')]);module[_0x0b95('0x11')]=router; \ No newline at end of file +var _0x9102=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','create','put','update','delete','destroy'];(function(_0x17f80f,_0x15e0c7){var _0x2ddd72=function(_0xcf477d){while(--_0xcf477d){_0x17f80f['push'](_0x17f80f['shift']());}};_0x2ddd72(++_0x15e0c7);}(_0x9102,0x133));var _0x2910=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x9102[_0x1ccdf7];return _0x52a0ae;};'use strict';var multer=require('multer');var util=require(_0x2910('0x0'));var path=require('path');var timeout=require(_0x2910('0x1'));var express=require(_0x2910('0x2'));var router=express[_0x2910('0x3')]();var fs_extra=require(_0x2910('0x4'));var auth=require(_0x2910('0x5'));var interaction=require(_0x2910('0x6'));var config=require(_0x2910('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x2910('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2910('0x9'),auth[_0x2910('0xa')](),controller['show']);router[_0x2910('0xb')]('/',auth[_0x2910('0xa')](),controller[_0x2910('0xc')]);router[_0x2910('0xd')](_0x2910('0x9'),auth[_0x2910('0xa')](),controller[_0x2910('0xe')]);router[_0x2910('0xf')]('/:id',auth[_0x2910('0xa')](),controller[_0x2910('0x10')]);module[_0x2910('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 fff2f3f..dd9dcfe 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 _0xc155=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x2d86a6,_0x4dbbed){var _0x112397=function(_0x2a357d){while(--_0x2a357d){_0x2d86a6['push'](_0x2d86a6['shift']());}};_0x112397(++_0x4dbbed);}(_0xc155,0x16a));var _0x5c15=function(_0x1f142b,_0x73dd2f){_0x1f142b=_0x1f142b-0x0;var _0x384f74=_0xc155[_0x1f142b];return _0x384f74;};'use strict';var Sequelize=require(_0x5c15('0x0'));var moment=require(_0x5c15('0x1'));module[_0x5c15('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x5c15('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5c15('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5c15('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5c15('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5c15('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5c15('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5c15('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5c15('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5c15('0x4')],'allowNull':![],'defaultValue':moment()[_0x5c15('0x5')](_0x5c15('0x6'))}}; \ No newline at end of file +var _0xe3ef=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0xf3c51c,_0x4f5db2){var _0x440d95=function(_0x1215f5){while(--_0x1215f5){_0xf3c51c['push'](_0xf3c51c['shift']());}};_0x440d95(++_0x4f5db2);}(_0xe3ef,0x1bb));var _0xfe3e=function(_0x39237f,_0x11426f){_0x39237f=_0x39237f-0x0;var _0x46ccc7=_0xe3ef[_0x39237f];return _0x46ccc7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfe3e('0x0'));module[_0xfe3e('0x1')]={'time':{'type':Sequelize[_0xfe3e('0x2')]},'callid':{'type':Sequelize[_0xfe3e('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfe3e('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xfe3e('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xfe3e('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xfe3e('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xfe3e('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfe3e('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfe3e('0x3')],'allowNull':![],'defaultValue':moment()[_0xfe3e('0x4')](_0xfe3e('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index fbc55e5..1b38823 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 _0x6f3a=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','rawAttributes','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','VoiceQueuesLog','includeAll','find','catch','create','body','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x337860,_0x1b2a6b){var _0x587649=function(_0x4c2fe9){while(--_0x4c2fe9){_0x337860['push'](_0x337860['shift']());}};_0x587649(++_0x1b2a6b);}(_0x6f3a,0x1a9));var _0xa6f3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x6f3a[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa6f3('0x0'));var jsonpatch=require(_0xa6f3('0x1'));var rp=require(_0xa6f3('0x2'));var moment=require('moment');var BPromise=require(_0xa6f3('0x3'));var Mustache=require(_0xa6f3('0x4'));var util=require(_0xa6f3('0x5'));var path=require(_0xa6f3('0x6'));var sox=require(_0xa6f3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6f3('0x8'));var _=require(_0xa6f3('0x9'));var squel=require(_0xa6f3('0xa'));var crypto=require(_0xa6f3('0xb'));var jsforce=require(_0xa6f3('0xc'));var deskjs=require(_0xa6f3('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa6f3('0xe'));var Papa=require(_0xa6f3('0xf'));var Redis=require(_0xa6f3('0x10'));var authService=require(_0xa6f3('0x11'));var qs=require(_0xa6f3('0x12'));var as=require(_0xa6f3('0x13'));var hardwareService=require(_0xa6f3('0x14'));var logger=require(_0xa6f3('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xa6f3('0x16'));var licenseUtil=require(_0xa6f3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33dff1,_0x5cf5ab){_0x5cf5ab=_0x5cf5ab||0xcc;return function(_0x474238){if(_0x474238){return _0x33dff1[_0xa6f3('0x18')](_0x5cf5ab);}return _0x33dff1[_0xa6f3('0x19')](_0x5cf5ab)[_0xa6f3('0x1a')]();};}function respondWithResult(_0x3b1491,_0x33a878){_0x33a878=_0x33a878||0xc8;return function(_0x4e5ae1){if(_0x4e5ae1){return _0x3b1491['status'](_0x33a878)[_0xa6f3('0x1b')](_0x4e5ae1);}};}function respondWithFilteredResult(_0x4279c4,_0x552323){return function(_0x26e81b){if(_0x26e81b){var _0xaa695a=typeof _0x552323['offset']===_0xa6f3('0x1c')&&typeof _0x552323['limit']==='undefined';var _0x58a3a4=_0x26e81b[_0xa6f3('0x1d')];var _0x4c3544=_0xaa695a?0x0:_0x552323[_0xa6f3('0x1e')];var _0x258e2e=_0xaa695a?_0x26e81b[_0xa6f3('0x1d')]:_0x552323[_0xa6f3('0x1e')]+_0x552323[_0xa6f3('0x1f')];var _0x5845ad;if(_0x258e2e>=_0x58a3a4){_0x258e2e=_0x58a3a4;_0x5845ad=0xc8;}else{_0x5845ad=0xce;}_0x4279c4[_0xa6f3('0x19')](_0x5845ad);return _0x4279c4[_0xa6f3('0x20')](_0xa6f3('0x21'),_0x4c3544+'-'+_0x258e2e+'/'+_0x58a3a4)[_0xa6f3('0x1b')](_0x26e81b);}return null;};}function patchUpdates(_0x3c6046){return function(_0x39bf48){try{jsonpatch[_0xa6f3('0x22')](_0x39bf48,_0x3c6046,!![]);}catch(_0x46229d){return BPromise[_0xa6f3('0x23')](_0x46229d);}return _0x39bf48[_0xa6f3('0x24')]();};}function saveUpdates(_0x30b0f4,_0x3756c1){return function(_0x1db694){if(_0x1db694){return _0x1db694[_0xa6f3('0x25')](_0x30b0f4)[_0xa6f3('0x26')](function(_0x45d517){return _0x45d517;});}return null;};}function removeEntity(_0x4cf5e7,_0x184a4f){return function(_0x1ff318){if(_0x1ff318){return _0x1ff318['destroy']()[_0xa6f3('0x26')](function(){_0x4cf5e7[_0xa6f3('0x19')](0xcc)[_0xa6f3('0x1a')]();});}};}function handleEntityNotFound(_0x5db197,_0x33d073){return function(_0x130571){if(!_0x130571){_0x5db197[_0xa6f3('0x18')](0x194);}return _0x130571;};}function handleError(_0x39c5a3,_0x282402){_0x282402=_0x282402||0x1f4;return function(_0xe17d0c){logger[_0xa6f3('0x27')](_0xe17d0c['stack']);if(_0xe17d0c[_0xa6f3('0x28')]){delete _0xe17d0c[_0xa6f3('0x28')];}_0x39c5a3[_0xa6f3('0x19')](_0x282402)[_0xa6f3('0x29')](_0xe17d0c);};}exports['index']=function(_0x52aa68,_0x3460bc){var _0x453819={},_0x420527={},_0x99aa0f={'count':0x0,'rows':[]};var _0x2bed2d=_['map'](db['VoiceQueuesLog'][_0xa6f3('0x2a')],function(_0xff00b6){return{'name':_0xff00b6['fieldName'],'type':_0xff00b6[_0xa6f3('0x2b')][_0xa6f3('0x2c')]};});_0x420527['model']=_['map'](_0x2bed2d,'name');_0x420527[_0xa6f3('0x2d')]=_[_0xa6f3('0x2e')](_0x52aa68[_0xa6f3('0x2d')]);_0x420527['filters']=_[_0xa6f3('0x2f')](_0x420527['model'],_0x420527[_0xa6f3('0x2d')]);_0x453819[_0xa6f3('0x30')]=_[_0xa6f3('0x2f')](_0x420527[_0xa6f3('0x31')],qs[_0xa6f3('0x32')](_0x52aa68['query']['fields']));_0x453819[_0xa6f3('0x30')]=_0x453819['attributes'][_0xa6f3('0x33')]?_0x453819['attributes']:_0x420527[_0xa6f3('0x31')];if(!_0x52aa68[_0xa6f3('0x2d')][_0xa6f3('0x34')](_0xa6f3('0x35'))){_0x453819['limit']=qs[_0xa6f3('0x1f')](_0x52aa68[_0xa6f3('0x2d')][_0xa6f3('0x1f')]);_0x453819[_0xa6f3('0x1e')]=qs[_0xa6f3('0x1e')](_0x52aa68[_0xa6f3('0x2d')][_0xa6f3('0x1e')]);}_0x453819[_0xa6f3('0x36')]=qs[_0xa6f3('0x37')](_0x52aa68[_0xa6f3('0x2d')]['sort']);_0x453819[_0xa6f3('0x38')]=qs[_0xa6f3('0x39')](_['pick'](_0x52aa68[_0xa6f3('0x2d')],_0x420527[_0xa6f3('0x39')]),_0x2bed2d);if(_0x52aa68[_0xa6f3('0x2d')][_0xa6f3('0x3a')]){_0x453819[_0xa6f3('0x38')]=_['merge'](_0x453819[_0xa6f3('0x38')],{'$or':_['map'](_0x2bed2d,function(_0xa3c36){if(_0xa3c36[_0xa6f3('0x2b')]!==_0xa6f3('0x3b')){var _0x58bd7a={};_0x58bd7a[_0xa3c36[_0xa6f3('0x28')]]={'$like':'%'+_0x52aa68[_0xa6f3('0x2d')][_0xa6f3('0x3a')]+'%'};return _0x58bd7a;}})});}_0x453819=_[_0xa6f3('0x3c')]({},_0x453819,_0x52aa68[_0xa6f3('0x3d')]);var _0x410ee0={'where':_0x453819[_0xa6f3('0x38')]};return db['VoiceQueuesLog'][_0xa6f3('0x1d')](_0x410ee0)[_0xa6f3('0x26')](function(_0x3578c2){_0x99aa0f[_0xa6f3('0x1d')]=_0x3578c2;if(_0x52aa68[_0xa6f3('0x2d')]['includeAll']){_0x453819[_0xa6f3('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xa6f3('0x3f')](_0x453819);})['then'](function(_0x595a6f){_0x99aa0f[_0xa6f3('0x40')]=_0x595a6f;return _0x99aa0f;})[_0xa6f3('0x26')](respondWithFilteredResult(_0x3460bc,_0x453819))['catch'](handleError(_0x3460bc,null));};exports[_0xa6f3('0x41')]=function(_0x23540b,_0x2be7da){var _0x30686b={'raw':!![],'where':{'id':_0x23540b[_0xa6f3('0x42')]['id']}},_0x430963={};_0x430963[_0xa6f3('0x31')]=_[_0xa6f3('0x2e')](db[_0xa6f3('0x43')][_0xa6f3('0x2a')]);_0x430963['query']=_[_0xa6f3('0x2e')](_0x23540b[_0xa6f3('0x2d')]);_0x430963[_0xa6f3('0x39')]=_[_0xa6f3('0x2f')](_0x430963['model'],_0x430963[_0xa6f3('0x2d')]);_0x30686b[_0xa6f3('0x30')]=_['intersection'](_0x430963['model'],qs[_0xa6f3('0x32')](_0x23540b[_0xa6f3('0x2d')][_0xa6f3('0x32')]));_0x30686b[_0xa6f3('0x30')]=_0x30686b[_0xa6f3('0x30')][_0xa6f3('0x33')]?_0x30686b['attributes']:_0x430963[_0xa6f3('0x31')];if(_0x23540b['query'][_0xa6f3('0x44')]){_0x30686b[_0xa6f3('0x3e')]=[{'all':!![]}];}_0x30686b=_[_0xa6f3('0x3c')]({},_0x30686b,_0x23540b['options']);return db[_0xa6f3('0x43')][_0xa6f3('0x45')](_0x30686b)[_0xa6f3('0x26')](handleEntityNotFound(_0x2be7da,null))[_0xa6f3('0x26')](respondWithResult(_0x2be7da,null))[_0xa6f3('0x46')](handleError(_0x2be7da,null));};exports[_0xa6f3('0x47')]=function(_0x30c7ca,_0x477699){return db['VoiceQueuesLog'][_0xa6f3('0x47')](_0x30c7ca[_0xa6f3('0x48')],{})[_0xa6f3('0x26')](respondWithResult(_0x477699,0xc9))[_0xa6f3('0x46')](handleError(_0x477699,null));};exports[_0xa6f3('0x25')]=function(_0x4ec791,_0x4ead11){if(_0x4ec791[_0xa6f3('0x48')]['id']){delete _0x4ec791[_0xa6f3('0x48')]['id'];}return db['VoiceQueuesLog'][_0xa6f3('0x45')]({'where':{'id':_0x4ec791['params']['id']}})[_0xa6f3('0x26')](handleEntityNotFound(_0x4ead11,null))[_0xa6f3('0x26')](saveUpdates(_0x4ec791['body'],null))[_0xa6f3('0x26')](respondWithResult(_0x4ead11,null))[_0xa6f3('0x46')](handleError(_0x4ead11,null));};exports[_0xa6f3('0x49')]=function(_0x1b2a01,_0x3b9342){return db[_0xa6f3('0x43')][_0xa6f3('0x45')]({'where':{'id':_0x1b2a01['params']['id']}})[_0xa6f3('0x26')](handleEntityNotFound(_0x3b9342,null))[_0xa6f3('0x26')](removeEntity(_0x3b9342,null))[_0xa6f3('0x46')](handleError(_0x3b9342,null));}; \ No newline at end of file +var _0x4687=['attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','find','create','body','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','offset','count','limit','apply','update','then','sendStatus','name','map','VoiceQueuesLog','rawAttributes','type','model','query','filters','intersection'];(function(_0x4cae4a,_0x25396a){var _0x5c7e62=function(_0x3ce014){while(--_0x3ce014){_0x4cae4a['push'](_0x4cae4a['shift']());}};_0x5c7e62(++_0x25396a);}(_0x4687,0x187));var _0x7468=function(_0x52d7e6,_0x152758){_0x52d7e6=_0x52d7e6-0x0;var _0x2828da=_0x4687[_0x52d7e6];return _0x2828da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7468('0x0'));var zipdir=require(_0x7468('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7468('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7468('0x3'));var util=require(_0x7468('0x4'));var path=require(_0x7468('0x5'));var sox=require(_0x7468('0x6'));var csv=require('to-csv');var ejs=require(_0x7468('0x7'));var fs=require('fs');var fs_extra=require(_0x7468('0x8'));var _=require(_0x7468('0x9'));var squel=require(_0x7468('0xa'));var crypto=require(_0x7468('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7468('0xc'));var querystring=require(_0x7468('0xd'));var Papa=require('papaparse');var Redis=require(_0x7468('0xe'));var authService=require(_0x7468('0xf'));var qs=require(_0x7468('0x10'));var as=require(_0x7468('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7468('0x12'));var utils=require(_0x7468('0x13'));var config=require(_0x7468('0x14'));var licenseUtil=require(_0x7468('0x15'));var db=require(_0x7468('0x16'))['db'];function respondWithStatusCode(_0x1a5b80,_0x54c57d){_0x54c57d=_0x54c57d||0xcc;return function(_0x2e0980){if(_0x2e0980){return _0x1a5b80['sendStatus'](_0x54c57d);}return _0x1a5b80['status'](_0x54c57d)[_0x7468('0x17')]();};}function respondWithResult(_0x186368,_0x41da2a){_0x41da2a=_0x41da2a||0xc8;return function(_0x50e60a){if(_0x50e60a){return _0x186368[_0x7468('0x18')](_0x41da2a)[_0x7468('0x19')](_0x50e60a);}};}function respondWithFilteredResult(_0x140c04,_0x410276){return function(_0x4d6998){if(_0x4d6998){var _0x12c81a=typeof _0x410276['offset']===_0x7468('0x1a')&&typeof _0x410276['limit']===_0x7468('0x1a');var _0x1d3f27=_0x4d6998['count'];var _0x5e88dc=_0x12c81a?0x0:_0x410276[_0x7468('0x1b')];var _0x4fccf2=_0x12c81a?_0x4d6998[_0x7468('0x1c')]:_0x410276[_0x7468('0x1b')]+_0x410276[_0x7468('0x1d')];var _0x5e63af;if(_0x4fccf2>=_0x1d3f27){_0x4fccf2=_0x1d3f27;_0x5e63af=0xc8;}else{_0x5e63af=0xce;}_0x140c04[_0x7468('0x18')](_0x5e63af);return _0x140c04['set']('Content-Range',_0x5e88dc+'-'+_0x4fccf2+'/'+_0x1d3f27)[_0x7468('0x19')](_0x4d6998);}return null;};}function patchUpdates(_0x15b8c4){return function(_0x296826){try{jsonpatch[_0x7468('0x1e')](_0x296826,_0x15b8c4,!![]);}catch(_0x342897){return BPromise['reject'](_0x342897);}return _0x296826['save']();};}function saveUpdates(_0x3a9653,_0x17ee91){return function(_0x72cb83){if(_0x72cb83){return _0x72cb83[_0x7468('0x1f')](_0x3a9653)[_0x7468('0x20')](function(_0x2266b2){return _0x2266b2;});}return null;};}function removeEntity(_0x464529,_0x51dbaa){return function(_0x349230){if(_0x349230){return _0x349230['destroy']()['then'](function(){_0x464529[_0x7468('0x18')](0xcc)[_0x7468('0x17')]();});}};}function handleEntityNotFound(_0x56a740,_0x98cd27){return function(_0xb47ad5){if(!_0xb47ad5){_0x56a740[_0x7468('0x21')](0x194);}return _0xb47ad5;};}function handleError(_0xc4ccd5,_0x1aa589){_0x1aa589=_0x1aa589||0x1f4;return function(_0x4016e8){logger['error'](_0x4016e8['stack']);if(_0x4016e8['name']){delete _0x4016e8[_0x7468('0x22')];}_0xc4ccd5[_0x7468('0x18')](_0x1aa589)['send'](_0x4016e8);};}exports['index']=function(_0x7a685f,_0x2c0e1f){var _0x340ab3={},_0xeba4e9={},_0x51dd14={'count':0x0,'rows':[]};var _0x1a973f=_[_0x7468('0x23')](db[_0x7468('0x24')][_0x7468('0x25')],function(_0x107acf){return{'name':_0x107acf['fieldName'],'type':_0x107acf[_0x7468('0x26')]['key']};});_0xeba4e9[_0x7468('0x27')]=_[_0x7468('0x23')](_0x1a973f,_0x7468('0x22'));_0xeba4e9[_0x7468('0x28')]=_['keys'](_0x7a685f['query']);_0xeba4e9[_0x7468('0x29')]=_[_0x7468('0x2a')](_0xeba4e9[_0x7468('0x27')],_0xeba4e9['query']);_0x340ab3[_0x7468('0x2b')]=_[_0x7468('0x2a')](_0xeba4e9['model'],qs[_0x7468('0x2c')](_0x7a685f[_0x7468('0x28')]['fields']));_0x340ab3[_0x7468('0x2b')]=_0x340ab3[_0x7468('0x2b')][_0x7468('0x2d')]?_0x340ab3[_0x7468('0x2b')]:_0xeba4e9['model'];if(!_0x7a685f[_0x7468('0x28')][_0x7468('0x2e')](_0x7468('0x2f'))){_0x340ab3[_0x7468('0x1d')]=qs[_0x7468('0x1d')](_0x7a685f[_0x7468('0x28')][_0x7468('0x1d')]);_0x340ab3['offset']=qs[_0x7468('0x1b')](_0x7a685f['query'][_0x7468('0x1b')]);}_0x340ab3['order']=qs['sort'](_0x7a685f['query']['sort']);_0x340ab3[_0x7468('0x30')]=qs[_0x7468('0x29')](_[_0x7468('0x31')](_0x7a685f[_0x7468('0x28')],_0xeba4e9[_0x7468('0x29')]),_0x1a973f);if(_0x7a685f[_0x7468('0x28')][_0x7468('0x32')]){_0x340ab3[_0x7468('0x30')]=_['merge'](_0x340ab3[_0x7468('0x30')],{'$or':_['map'](_0x1a973f,function(_0x35bd1a){if(_0x35bd1a[_0x7468('0x26')]!=='VIRTUAL'){var _0x5a49b7={};_0x5a49b7[_0x35bd1a[_0x7468('0x22')]]={'$like':'%'+_0x7a685f['query'][_0x7468('0x32')]+'%'};return _0x5a49b7;}})});}_0x340ab3=_[_0x7468('0x33')]({},_0x340ab3,_0x7a685f[_0x7468('0x34')]);var _0xf36d38={'where':_0x340ab3[_0x7468('0x30')]};return db['VoiceQueuesLog']['count'](_0xf36d38)[_0x7468('0x20')](function(_0x4d2ec5){_0x51dd14[_0x7468('0x1c')]=_0x4d2ec5;if(_0x7a685f[_0x7468('0x28')][_0x7468('0x35')]){_0x340ab3['include']=[{'all':!![]}];}return db[_0x7468('0x24')][_0x7468('0x36')](_0x340ab3);})[_0x7468('0x20')](function(_0x323095){_0x51dd14[_0x7468('0x37')]=_0x323095;return _0x51dd14;})[_0x7468('0x20')](respondWithFilteredResult(_0x2c0e1f,_0x340ab3))[_0x7468('0x38')](handleError(_0x2c0e1f,null));};exports['show']=function(_0x4e1e1c,_0x1ffd37){var _0x533fe4={'raw':!![],'where':{'id':_0x4e1e1c[_0x7468('0x39')]['id']}},_0x95fe77={};_0x95fe77[_0x7468('0x27')]=_[_0x7468('0x3a')](db['VoiceQueuesLog'][_0x7468('0x25')]);_0x95fe77[_0x7468('0x28')]=_['keys'](_0x4e1e1c[_0x7468('0x28')]);_0x95fe77['filters']=_[_0x7468('0x2a')](_0x95fe77[_0x7468('0x27')],_0x95fe77['query']);_0x533fe4['attributes']=_[_0x7468('0x2a')](_0x95fe77[_0x7468('0x27')],qs[_0x7468('0x2c')](_0x4e1e1c[_0x7468('0x28')][_0x7468('0x2c')]));_0x533fe4[_0x7468('0x2b')]=_0x533fe4[_0x7468('0x2b')]['length']?_0x533fe4[_0x7468('0x2b')]:_0x95fe77[_0x7468('0x27')];if(_0x4e1e1c[_0x7468('0x28')][_0x7468('0x35')]){_0x533fe4['include']=[{'all':!![]}];}_0x533fe4=_[_0x7468('0x33')]({},_0x533fe4,_0x4e1e1c[_0x7468('0x34')]);return db[_0x7468('0x24')][_0x7468('0x3b')](_0x533fe4)[_0x7468('0x20')](handleEntityNotFound(_0x1ffd37,null))[_0x7468('0x20')](respondWithResult(_0x1ffd37,null))[_0x7468('0x38')](handleError(_0x1ffd37,null));};exports[_0x7468('0x3c')]=function(_0x5d5d6c,_0x516440){return db['VoiceQueuesLog'][_0x7468('0x3c')](_0x5d5d6c[_0x7468('0x3d')],{})['then'](respondWithResult(_0x516440,0xc9))[_0x7468('0x38')](handleError(_0x516440,null));};exports[_0x7468('0x1f')]=function(_0x17b4c1,_0x504b78){if(_0x17b4c1[_0x7468('0x3d')]['id']){delete _0x17b4c1[_0x7468('0x3d')]['id'];}return db[_0x7468('0x24')][_0x7468('0x3b')]({'where':{'id':_0x17b4c1[_0x7468('0x39')]['id']}})[_0x7468('0x20')](handleEntityNotFound(_0x504b78,null))[_0x7468('0x20')](saveUpdates(_0x17b4c1[_0x7468('0x3d')],null))[_0x7468('0x20')](respondWithResult(_0x504b78,null))['catch'](handleError(_0x504b78,null));};exports['destroy']=function(_0x318c85,_0x5827db){return db['VoiceQueuesLog'][_0x7468('0x3b')]({'where':{'id':_0x318c85['params']['id']}})[_0x7468('0x20')](handleEntityNotFound(_0x5827db,null))[_0x7468('0x20')](removeEntity(_0x5827db,null))['catch'](handleError(_0x5827db,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 101d650..a4b9a7f 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 _0x47c2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','dtm','lodash','util'];(function(_0x57b65f,_0x1e6bc7){var _0x317d05=function(_0x139d8f){while(--_0x139d8f){_0x57b65f['push'](_0x57b65f['shift']());}};_0x317d05(++_0x1e6bc7);}(_0x47c2,0x1ae));var _0x247c=function(_0x125dea,_0xb160c1){_0x125dea=_0x125dea-0x0;var _0x3f612a=_0x47c2[_0x125dea];return _0x3f612a;};'use strict';var _=require(_0x247c('0x0'));var util=require(_0x247c('0x1'));var logger=require(_0x247c('0x2'))(_0x247c('0x3'));var moment=require(_0x247c('0x4'));var BPromise=require(_0x247c('0x5'));var rp=require(_0x247c('0x6'));var fs=require('fs');var path=require(_0x247c('0x7'));var rimraf=require(_0x247c('0x8'));var config=require(_0x247c('0x9'));var attributes=require(_0x247c('0xa'));module[_0x247c('0xb')]=function(_0x233af5,_0x233e90){return _0x233af5[_0x247c('0xc')](_0x247c('0xd'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x247c('0xe'),'fields':['event',_0x247c('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x405f=['dtm','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceQueuesLog','voice_queues_log','event'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x405f,0x127));var _0xf405=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x405f[_0x1d24eb];return _0x1dc576;};'use strict';var _=require('lodash');var util=require(_0xf405('0x0'));var logger=require(_0xf405('0x1'))(_0xf405('0x2'));var moment=require(_0xf405('0x3'));var BPromise=require(_0xf405('0x4'));var rp=require(_0xf405('0x5'));var fs=require('fs');var path=require(_0xf405('0x6'));var rimraf=require(_0xf405('0x7'));var config=require(_0xf405('0x8'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x179442,_0x56b41f){return _0x179442[_0xf405('0x9')](_0xf405('0xa'),attributes,{'tableName':_0xf405('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xf405('0xc'),_0xf405('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 d9ca8d1..458b6dd 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 _0x87ae=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x87ae,0xf5));var _0xe87a=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x87ae[_0x6a0266];return _0x309e00;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe87a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe87a('0x1'));var db=require(_0xe87a('0x2'))['db'];var utils=require(_0xe87a('0x3'));var logger=require('../../config/logger')(_0xe87a('0x4'));var config=require(_0xe87a('0x5'));var jayson=require(_0xe87a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x125dd3,_0x2fbd6b,_0x5dff22){return new BPromise(function(_0x379db4,_0x455b3a){return client['request'](_0x125dd3,_0x5dff22)[_0xe87a('0x7')](function(_0x278d7c){logger['info'](_0xe87a('0x8'),_0x2fbd6b,_0xe87a('0x9'));logger[_0xe87a('0xa')](_0xe87a('0xb'),_0x2fbd6b,_0xe87a('0x9'),JSON[_0xe87a('0xc')](_0x278d7c));if(_0x278d7c['error']){if(_0x278d7c['error'][_0xe87a('0xd')]===0x1f4){logger[_0xe87a('0xe')](_0xe87a('0x8'),_0x2fbd6b,_0x278d7c['error'][_0xe87a('0xf')]);return _0x455b3a(_0x278d7c[_0xe87a('0xe')]['message']);}logger[_0xe87a('0xe')](_0xe87a('0x8'),_0x2fbd6b,_0x278d7c[_0xe87a('0xe')]['message']);return _0x379db4(_0x278d7c['error']['message']);}else{logger['info'](_0xe87a('0x8'),_0x2fbd6b,_0xe87a('0x9'));_0x379db4(_0x278d7c[_0xe87a('0x10')][_0xe87a('0xf')]);}})['catch'](function(_0x415147){logger[_0xe87a('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2fbd6b,_0x415147);_0x455b3a(_0x415147);});});} \ No newline at end of file +var _0x52fc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment'];(function(_0x5d852f,_0x2f8706){var _0x1fe8fd=function(_0x3c3adf){while(--_0x3c3adf){_0x5d852f['push'](_0x5d852f['shift']());}};_0x1fe8fd(++_0x2f8706);}(_0x52fc,0xc5));var _0xc52f=function(_0x3bca58,_0x4a85c4){_0x3bca58=_0x3bca58-0x0;var _0x29f35f=_0x52fc[_0x3bca58];return _0x29f35f;};'use strict';var _=require(_0xc52f('0x0'));var util=require(_0xc52f('0x1'));var moment=require(_0xc52f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc52f('0x3'));var db=require(_0xc52f('0x4'))['db'];var utils=require(_0xc52f('0x5'));var logger=require(_0xc52f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc52f('0x7'));var client=jayson[_0xc52f('0x8')][_0xc52f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x523425,_0x4cae04,_0x4db523){return new BPromise(function(_0x4c73c8,_0x3d2845){return client['request'](_0x523425,_0x4db523)[_0xc52f('0xa')](function(_0x52db4a){logger[_0xc52f('0xb')](_0xc52f('0xc'),_0x4cae04,'request\x20sent');logger[_0xc52f('0xd')](_0xc52f('0xe'),_0x4cae04,_0xc52f('0xf'),JSON[_0xc52f('0x10')](_0x52db4a));if(_0x52db4a['error']){if(_0x52db4a[_0xc52f('0x11')]['code']===0x1f4){logger[_0xc52f('0x11')](_0xc52f('0xc'),_0x4cae04,_0x52db4a[_0xc52f('0x11')][_0xc52f('0x12')]);return _0x3d2845(_0x52db4a[_0xc52f('0x11')][_0xc52f('0x12')]);}logger['error'](_0xc52f('0xc'),_0x4cae04,_0x52db4a[_0xc52f('0x11')][_0xc52f('0x12')]);return _0x4c73c8(_0x52db4a[_0xc52f('0x11')][_0xc52f('0x12')]);}else{logger['info'](_0xc52f('0xc'),_0x4cae04,_0xc52f('0xf'));_0x4c73c8(_0x52db4a[_0xc52f('0x13')][_0xc52f('0x12')]);}})['catch'](function(_0x2a5863){logger[_0xc52f('0x11')](_0xc52f('0xc'),_0x4cae04,_0x2a5863);_0x3d2845(_0x2a5863);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 272438e..f3b1b0b 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 _0xe96b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','runTranscribe','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3aa131,_0x3342b7){var _0x35d256=function(_0x3a9311){while(--_0x3a9311){_0x3aa131['push'](_0x3aa131['shift']());}};_0x35d256(++_0x3342b7);}(_0xe96b,0x83));var _0xbe96=function(_0x56f481,_0x41b55e){_0x56f481=_0x56f481-0x0;var _0x3a6cc2=_0xe96b[_0x56f481];return _0x3a6cc2;};'use strict';var multer=require(_0xbe96('0x0'));var util=require(_0xbe96('0x1'));var path=require(_0xbe96('0x2'));var timeout=require(_0xbe96('0x3'));var express=require(_0xbe96('0x4'));var router=express[_0xbe96('0x5')]();var fs_extra=require(_0xbe96('0x6'));var auth=require(_0xbe96('0x7'));var interaction=require(_0xbe96('0x8'));var config=require(_0xbe96('0x9'));var controller=require(_0xbe96('0xa'));router[_0xbe96('0xb')]('/',auth[_0xbe96('0xc')](),controller[_0xbe96('0xd')]);router[_0xbe96('0xb')](_0xbe96('0xe'),auth[_0xbe96('0xc')](),controller['describe']);router[_0xbe96('0xb')](_0xbe96('0xf'),auth['isAuthenticated'](),controller[_0xbe96('0x10')]);router[_0xbe96('0xb')](_0xbe96('0x11'),auth[_0xbe96('0xc')](),controller[_0xbe96('0x12')]);router['get'](_0xbe96('0x13'),controller[_0xbe96('0x14')]);router[_0xbe96('0xb')](_0xbe96('0x15'),auth[_0xbe96('0xc')](),controller['downloadTranscribe']);router[_0xbe96('0x16')]('/',auth[_0xbe96('0xc')](),controller['create']);router[_0xbe96('0x16')]('/:id/transcribe',auth[_0xbe96('0xc')](),controller[_0xbe96('0x17')]);router['put'](_0xbe96('0xf'),auth[_0xbe96('0xc')](),controller['update']);router[_0xbe96('0x18')](_0xbe96('0xf'),auth[_0xbe96('0xc')](),controller[_0xbe96('0x19')]);module[_0xbe96('0x1a')]=router; \ No newline at end of file +var _0x3d8a=['/:id/download','download','downloads','/:id/transcribe','post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x18ad63,_0x29c705){var _0x219813=function(_0x22fbf0){while(--_0x22fbf0){_0x18ad63['push'](_0x18ad63['shift']());}};_0x219813(++_0x29c705);}(_0x3d8a,0x142));var _0xa3d8=function(_0x14435f,_0x45ea68){_0x14435f=_0x14435f-0x0;var _0x348321=_0x3d8a[_0x14435f];return _0x348321;};'use strict';var multer=require(_0xa3d8('0x0'));var util=require(_0xa3d8('0x1'));var path=require(_0xa3d8('0x2'));var timeout=require('connect-timeout');var express=require(_0xa3d8('0x3'));var router=express[_0xa3d8('0x4')]();var fs_extra=require(_0xa3d8('0x5'));var auth=require(_0xa3d8('0x6'));var interaction=require(_0xa3d8('0x7'));var config=require(_0xa3d8('0x8'));var controller=require(_0xa3d8('0x9'));router[_0xa3d8('0xa')]('/',auth[_0xa3d8('0xb')](),controller['index']);router['get'](_0xa3d8('0xc'),auth[_0xa3d8('0xb')](),controller[_0xa3d8('0xd')]);router['get'](_0xa3d8('0xe'),auth[_0xa3d8('0xb')](),controller[_0xa3d8('0xf')]);router[_0xa3d8('0xa')](_0xa3d8('0x10'),auth[_0xa3d8('0xb')](),controller[_0xa3d8('0x11')]);router['get']('/:id/downloads',controller[_0xa3d8('0x12')]);router[_0xa3d8('0xa')](_0xa3d8('0x13'),auth[_0xa3d8('0xb')](),controller['downloadTranscribe']);router[_0xa3d8('0x14')]('/',auth[_0xa3d8('0xb')](),controller['create']);router['post'](_0xa3d8('0x13'),auth[_0xa3d8('0xb')](),controller['runTranscribe']);router[_0xa3d8('0x15')](_0xa3d8('0xe'),auth['isAuthenticated'](),controller[_0xa3d8('0x16')]);router[_0xa3d8('0x17')](_0xa3d8('0xe'),auth['isAuthenticated'](),controller[_0xa3d8('0x18')]);module[_0xa3d8('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 922409d..c860c9e 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(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 33c3765..fdf844a 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 _0x682c=['includeAll','include','find','create','body','catch','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','extname','unlink','message','downloads','sequelize','token','push','$and','filename','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceRecording','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','map','merge','options','rows','show','params','length'];(function(_0x5d3369,_0xe47921){var _0x51c215=function(_0x24c0f1){while(--_0x24c0f1){_0x5d3369['push'](_0x5d3369['shift']());}};_0x51c215(++_0xe47921);}(_0x682c,0xe6));var _0xc682=function(_0x4d19d6,_0x478b73){_0x4d19d6=_0x4d19d6-0x0;var _0x238fd4=_0x682c[_0x4d19d6];return _0x238fd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc682('0x0'));var zipdir=require(_0xc682('0x1'));var jsonpatch=require(_0xc682('0x2'));var rp=require(_0xc682('0x3'));var moment=require(_0xc682('0x4'));var BPromise=require(_0xc682('0x5'));var Mustache=require('mustache');var util=require(_0xc682('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc682('0x7'));var ejs=require(_0xc682('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc682('0x9'));var squel=require(_0xc682('0xa'));var crypto=require(_0xc682('0xb'));var jsforce=require(_0xc682('0xc'));var deskjs=require(_0xc682('0xd'));var toCsv=require(_0xc682('0x7'));var querystring=require(_0xc682('0xe'));var Papa=require(_0xc682('0xf'));var AWS=require(_0xc682('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xc682('0x11'));var authService=require(_0xc682('0x12'));var qs=require(_0xc682('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc682('0x14'));var logger=require(_0xc682('0x15'))('api');var utils=require(_0xc682('0x16'));var config=require(_0xc682('0x17'));var licenseUtil=require(_0xc682('0x18'));var db=require(_0xc682('0x19'))['db'];function respondWithStatusCode(_0x4e70c3,_0x5bfef7){_0x5bfef7=_0x5bfef7||0xcc;return function(_0x3c619c){if(_0x3c619c){return _0x4e70c3['sendStatus'](_0x5bfef7);}return _0x4e70c3['status'](_0x5bfef7)[_0xc682('0x1a')]();};}function respondWithResult(_0x409784,_0x269c93){_0x269c93=_0x269c93||0xc8;return function(_0x469fe1){if(_0x469fe1){return _0x409784[_0xc682('0x1b')](_0x269c93)[_0xc682('0x1c')](_0x469fe1);}};}function respondWithFilteredResult(_0x2db2c2,_0x2af5c5){return function(_0x3e5c5e){if(_0x3e5c5e){var _0x20eb6b=typeof _0x2af5c5[_0xc682('0x1d')]===_0xc682('0x1e')&&typeof _0x2af5c5[_0xc682('0x1f')]==='undefined';var _0x326656=_0x3e5c5e['count'];var _0x1d07e8=_0x20eb6b?0x0:_0x2af5c5[_0xc682('0x1d')];var _0xf3210a=_0x20eb6b?_0x3e5c5e[_0xc682('0x20')]:_0x2af5c5[_0xc682('0x1d')]+_0x2af5c5[_0xc682('0x1f')];var _0x1ff8c3;if(_0xf3210a>=_0x326656){_0xf3210a=_0x326656;_0x1ff8c3=0xc8;}else{_0x1ff8c3=0xce;}_0x2db2c2['status'](_0x1ff8c3);return _0x2db2c2[_0xc682('0x21')](_0xc682('0x22'),_0x1d07e8+'-'+_0xf3210a+'/'+_0x326656)[_0xc682('0x1c')](_0x3e5c5e);}return null;};}function patchUpdates(_0x42a639){return function(_0x22772a){try{jsonpatch[_0xc682('0x23')](_0x22772a,_0x42a639,!![]);}catch(_0x1a9a41){return BPromise[_0xc682('0x24')](_0x1a9a41);}return _0x22772a['save']();};}function saveUpdates(_0x2cdd33,_0x1a1d84){return function(_0xa0e09e){if(_0xa0e09e){return _0xa0e09e[_0xc682('0x25')](_0x2cdd33)[_0xc682('0x26')](function(_0x22b924){return _0x22b924;});}return null;};}function removeEntity(_0x117fbd,_0x3e6139){return function(_0x44e293){if(_0x44e293){return _0x44e293[_0xc682('0x27')]()[_0xc682('0x26')](function(){_0x117fbd[_0xc682('0x1b')](0xcc)[_0xc682('0x1a')]();});}};}function handleEntityNotFound(_0x2fd437,_0x2cc723){return function(_0x19ffbc){if(!_0x19ffbc){_0x2fd437[_0xc682('0x28')](0x194);}return _0x19ffbc;};}function handleError(_0x22b56c,_0x905cd1){_0x905cd1=_0x905cd1||0x1f4;return function(_0x3ef27d){logger[_0xc682('0x29')](_0x3ef27d[_0xc682('0x2a')]);if(_0x3ef27d[_0xc682('0x2b')]){delete _0x3ef27d[_0xc682('0x2b')];}_0x22b56c['status'](_0x905cd1)[_0xc682('0x2c')](_0x3ef27d);};}exports[_0xc682('0x2d')]=function(_0x5c35fd,_0x1613e7){var _0x52c1f2={},_0x1f8d65={},_0x4f2291={'count':0x0,'rows':[]};var _0x4a6eeb=_['map'](db[_0xc682('0x2e')]['rawAttributes'],function(_0x46ae4e){return{'name':_0x46ae4e[_0xc682('0x2f')],'type':_0x46ae4e[_0xc682('0x30')][_0xc682('0x31')]};});_0x1f8d65[_0xc682('0x32')]=_['differenceBy'](_['map'](_0x4a6eeb,_0xc682('0x2b')),['format']);_0x1f8d65[_0xc682('0x33')]=_[_0xc682('0x34')](_0x5c35fd[_0xc682('0x33')]);_0x1f8d65[_0xc682('0x35')]=_[_0xc682('0x36')](_0x1f8d65[_0xc682('0x32')],_0x1f8d65[_0xc682('0x33')]);_0x52c1f2['attributes']=_[_0xc682('0x36')](_0x1f8d65['model'],qs[_0xc682('0x37')](_0x5c35fd['query']['fields']));_0x52c1f2[_0xc682('0x38')]=_0x52c1f2[_0xc682('0x38')]['length']?_0x52c1f2[_0xc682('0x38')]:_0x1f8d65[_0xc682('0x32')];if(!_0x5c35fd[_0xc682('0x33')][_0xc682('0x39')](_0xc682('0x3a'))){_0x52c1f2[_0xc682('0x1f')]=qs[_0xc682('0x1f')](_0x5c35fd['query'][_0xc682('0x1f')]);_0x52c1f2[_0xc682('0x1d')]=qs[_0xc682('0x1d')](_0x5c35fd[_0xc682('0x33')][_0xc682('0x1d')]);}_0x52c1f2[_0xc682('0x3b')]=qs[_0xc682('0x3c')](_0x5c35fd['query'][_0xc682('0x3c')]);_0x52c1f2[_0xc682('0x3d')]=qs['filters'](_['pick'](_0x5c35fd['query'],_0x1f8d65[_0xc682('0x35')]),_0x4a6eeb);if(_0x5c35fd['query'][_0xc682('0x3e')]){_0x52c1f2[_0xc682('0x3d')]=_['merge'](_0x52c1f2[_0xc682('0x3d')],{'$or':_[_0xc682('0x3f')](_0x4a6eeb,function(_0x4f842c){if(_0x4f842c[_0xc682('0x30')]!=='VIRTUAL'){var _0x5bd660={};_0x5bd660[_0x4f842c[_0xc682('0x2b')]]={'$like':'%'+_0x5c35fd[_0xc682('0x33')][_0xc682('0x3e')]+'%'};return _0x5bd660;}})});}_0x52c1f2=_[_0xc682('0x40')]({},_0x52c1f2,_0x5c35fd[_0xc682('0x41')]);var _0x532ad7={'where':_0x52c1f2[_0xc682('0x3d')]};return db['VoiceRecording'][_0xc682('0x20')](_0x532ad7)['then'](function(_0x18a78b){_0x4f2291['count']=_0x18a78b;if(_0x5c35fd[_0xc682('0x33')]['includeAll']){_0x52c1f2['include']=[{'all':!![]}];}return db[_0xc682('0x2e')]['findAll'](_0x52c1f2);})['then'](function(_0x5534e4){_0x4f2291[_0xc682('0x42')]=_0x5534e4;return _0x4f2291;})['then'](respondWithFilteredResult(_0x1613e7,_0x52c1f2))['catch'](handleError(_0x1613e7,null));};exports[_0xc682('0x43')]=function(_0xf6aba7,_0x2e979b){var _0x3b9ff1={'raw':![],'where':{'id':_0xf6aba7[_0xc682('0x44')]['id']}},_0x1fb876={};_0x1fb876[_0xc682('0x32')]=_[_0xc682('0x34')](db[_0xc682('0x2e')]['rawAttributes']);_0x1fb876[_0xc682('0x33')]=_[_0xc682('0x34')](_0xf6aba7['query']);_0x1fb876[_0xc682('0x35')]=_[_0xc682('0x36')](_0x1fb876['model'],_0x1fb876[_0xc682('0x33')]);_0x3b9ff1[_0xc682('0x38')]=_[_0xc682('0x36')](_0x1fb876['model'],qs[_0xc682('0x37')](_0xf6aba7[_0xc682('0x33')]['fields']));_0x3b9ff1[_0xc682('0x38')]=_0x3b9ff1[_0xc682('0x38')][_0xc682('0x45')]?_0x3b9ff1[_0xc682('0x38')]:_0x1fb876[_0xc682('0x32')];if(_0xf6aba7[_0xc682('0x33')][_0xc682('0x46')]){_0x3b9ff1[_0xc682('0x47')]=[{'all':!![]}];}_0x3b9ff1=_[_0xc682('0x40')]({},_0x3b9ff1,_0xf6aba7[_0xc682('0x41')]);return db[_0xc682('0x2e')][_0xc682('0x48')](_0x3b9ff1)[_0xc682('0x26')](handleEntityNotFound(_0x2e979b,null))[_0xc682('0x26')](respondWithResult(_0x2e979b,null))['catch'](handleError(_0x2e979b,null));};exports[_0xc682('0x49')]=function(_0x48d36f,_0xead704){return db['VoiceRecording'][_0xc682('0x49')](_0x48d36f[_0xc682('0x4a')],{})[_0xc682('0x26')](respondWithResult(_0xead704,0xc9))['catch'](handleError(_0xead704,null));};exports['update']=function(_0x1cbd7d,_0x462feb){if(_0x1cbd7d[_0xc682('0x4a')]['id']){delete _0x1cbd7d[_0xc682('0x4a')]['id'];}return db[_0xc682('0x2e')][_0xc682('0x48')]({'where':{'id':_0x1cbd7d[_0xc682('0x44')]['id']}})[_0xc682('0x26')](handleEntityNotFound(_0x462feb,null))[_0xc682('0x26')](saveUpdates(_0x1cbd7d[_0xc682('0x4a')],null))[_0xc682('0x26')](respondWithResult(_0x462feb,null))[_0xc682('0x4b')](handleError(_0x462feb,null));};exports[_0xc682('0x4c')]=function(_0x2d11f3,_0x806624){return db[_0xc682('0x2e')][_0xc682('0x4c')]()[_0xc682('0x26')](respondWithResult(_0x806624,null))[_0xc682('0x4b')](handleError(_0x806624,null));};exports[_0xc682('0x4d')]=function(_0x441cb0,_0x2e49e1,_0x222106){var _0x4d519c=require(_0xc682('0x4e'));var _0x2f99e3=![];var _0x417ea6={};if(_0x441cb0['query']['type']&&_0x441cb0[_0xc682('0x33')][_0xc682('0x30')]===_0xc682('0x4f')){_0x417ea6['uniqueid']=_0x441cb0['params']['id'];}else{_0x417ea6['id']=_0x441cb0['params']['id'];}return db[_0xc682('0x2e')][_0xc682('0x48')]({'where':_0x417ea6,'attributes':['id',_0xc682('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x2e49e1,null))[_0xc682('0x26')](function(_0x2a6f5b){if(_0x2a6f5b){var _0x5b77ac=_0x2a6f5b[_0xc682('0x50')];var _0x30aea1=util[_0xc682('0x51')](_0xc682('0x52'),_0x5b77ac);if(fs[_0xc682('0x53')](_0x30aea1)){_0x2f99e3=!![];return _0x4d519c[_0xc682('0x54')](_0x30aea1,_0x5b77ac,config[_0xc682('0x55')][_0xc682('0x56')])['then'](function(){return _0x2a6f5b;});}return _0x2a6f5b;}})[_0xc682('0x26')](function(_0x55ba57){if(_0x55ba57){var _0x41d090=_0x55ba57[_0xc682('0x50')];if(!fs[_0xc682('0x53')](_0x41d090)){throw new db[(_0xc682('0x57'))][(_0xc682('0x58'))](_0xc682('0x59'));}if(_0x55ba57['filename']){return _0x2e49e1[_0xc682('0x4d')](_0x41d090,_0x55ba57['filename']+path[_0xc682('0x5a')](_0x41d090),function(){if(_0x2f99e3){fs[_0xc682('0x5b')](_0x41d090);}});}else{return _0x2e49e1[_0xc682('0x4d')](_0x41d090,function(_0x3e07d7){if(_0x2f99e3){fs[_0xc682('0x5b')](_0x41d090);}});}}})['catch'](function(_0x475056){if(_0x475056[_0xc682('0x5c')]===_0xc682('0x59')){_0x2e49e1[_0xc682('0x1b')](0x194)[_0xc682('0x2c')]('Not\x20found');}else{return handleError(_0x2e49e1,null);}});};exports[_0xc682('0x5d')]=function(_0x26947d,_0x57c442,_0x5c8bdf){var _0x59abd4=require(_0xc682('0x4e'));var _0x1d723a=![];var _0x4edd03={'$and':[db['sequelize']['where'](db[_0xc682('0x5e')]['fn']('MD5',db[_0xc682('0x5e')]['col'](_0xc682('0x4f'))),_0x26947d[_0xc682('0x33')][_0xc682('0x5f')])]};if(_0x26947d[_0xc682('0x33')][_0xc682('0x30')]&&_0x26947d[_0xc682('0x33')][_0xc682('0x30')]===_0xc682('0x4f')){_0x4edd03['$and'][_0xc682('0x60')]({'uniqueid':_0x26947d[_0xc682('0x44')]['id']});}else{_0x4edd03[_0xc682('0x61')][_0xc682('0x60')]({'id':_0x26947d[_0xc682('0x44')]['id']});}return db['VoiceRecording']['find']({'where':_0x4edd03,'attributes':['id',_0xc682('0x50')],'raw':!![]})[_0xc682('0x26')](handleEntityNotFound(_0x57c442,null))[_0xc682('0x26')](function(_0x47ac56){if(_0x47ac56){var _0x362829=util['format'](_0xc682('0x52'),_0x47ac56['value']);if(fs['existsSync'](_0x362829)){_0x1d723a=!![];return _0x59abd4[_0xc682('0x54')](_0x362829,_0x47ac56[_0xc682('0x50')],config[_0xc682('0x55')][_0xc682('0x56')])[_0xc682('0x26')](function(){return _0x47ac56;});}return _0x47ac56;}})['then'](function(_0x55d89e){if(_0x55d89e){if(!fs[_0xc682('0x53')](_0x55d89e['value'])){throw new db['Sequelize'][(_0xc682('0x58'))](_0xc682('0x59'));}if(_0x55d89e[_0xc682('0x62')]){return _0x57c442['download'](_0x55d89e[_0xc682('0x50')],_0x55d89e[_0xc682('0x62')]+path[_0xc682('0x5a')](_0x55d89e[_0xc682('0x50')]),function(){if(_0x1d723a){fs[_0xc682('0x5b')](_0x55d89e[_0xc682('0x50')]);}});}else{return _0x57c442[_0xc682('0x4d')](_0x55d89e['value'],function(_0x14ac57){if(_0x1d723a){fs[_0xc682('0x5b')](_0x55d89e[_0xc682('0x50')]);}});}}})['catch'](handleError(_0x57c442,null));};exports[_0xc682('0x27')]=function(_0x2347df,_0x5e4622){return db['VoiceRecording'][_0xc682('0x48')]({'where':{'id':_0x2347df[_0xc682('0x44')]['id']}})[_0xc682('0x26')](function(_0x1cf460){if(_[_0xc682('0x63')](_0x1cf460)){throw new ReferenceError(_0xc682('0x64'));}return _0x1cf460;})[_0xc682('0x26')](function(_0x789002){var _0x75edac=_0x789002[_0xc682('0x50')];logger[_0xc682('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x75edac);if(!_[_0xc682('0x63')](_0x789002[_0xc682('0x50')])&&fs[_0xc682('0x53')](_0x75edac)){logger[_0xc682('0x65')](_0xc682('0x66')+_0x75edac+_0xc682('0x67'));fs['unlinkSync'](_0x75edac);}_0x75edac=_0x75edac+_0xc682('0x68');if(!_[_0xc682('0x63')](_0x789002[_0xc682('0x50')])&&fs[_0xc682('0x53')](_0x75edac)){logger[_0xc682('0x65')](_0xc682('0x66')+_0x75edac+_0xc682('0x67'));fs[_0xc682('0x69')](_0x75edac);}return _0x789002;})['then'](function(_0x377de1){if(!_0x377de1)throw new InternalError();return _0x377de1[_0xc682('0x27')]();})[_0xc682('0x26')](function(){_0x5e4622[_0xc682('0x1b')](0xcc)[_0xc682('0x1a')]();})[_0xc682('0x4b')](handleError(_0x5e4622,null));};function getBucketslist(_0x162104,_0x39485a,_0x176697){return new Promise(function(_0x4177df,_0x3c4187){var _0x2e05a9=new AWS['S3']({'accessKeyId':_0x39485a,'secretAccessKey':_0x162104,'region':_0x176697});_0x2e05a9[_0xc682('0x6a')]({},function(_0x140ac9,_0x3a6177){if(_0x140ac9){return _0x3c4187(_0x140ac9);}else{return _0x4177df(_0x3a6177);}});});}function createBucket(_0x47f157,_0xc46946,_0x1fd2fc,_0x496ee3){return new Promise(function(_0xe773d2,_0x4b0d54){var _0x5d8033=new AWS['S3']({'accessKeyId':_0xc46946,'secretAccessKey':_0x47f157,'region':_0x1fd2fc});_0x5d8033['createBucket']({'Bucket':_0x496ee3},function(_0x4abfc1,_0x1ab199){if(_0x4abfc1){return _0x4b0d54(_0x4abfc1);}else{return _0xe773d2(_0x1ab199);}});});}function uploadFile(_0x1bffbe,_0x36bf8c,_0x50dbf7,_0x24a058,_0x56d5e5,_0x4b3b08){return new Promise(function(_0x46f7be,_0x145b40){var _0x3a27c4=new AWS['S3']({'accessKeyId':_0x36bf8c,'secretAccessKey':_0x1bffbe,'region':_0x50dbf7});_0x3a27c4['upload']({'Bucket':_0x24a058,'Key':_0x56d5e5,'Body':_0x4b3b08},function(_0x411b13,_0xff2848){if(_0x411b13){return _0x145b40(_0x411b13);}else{return _0x46f7be(_0xff2848);}});});}function startTranscribe(_0x3807e5,_0x4c02e5,_0x11fe35,_0x327983,_0xd25a5f,_0x1c517c){return new Promise(function(_0x1969ed,_0x137017){var _0x38911c=new AWS[(_0xc682('0x6b'))]({'accessKeyId':_0x4c02e5,'secretAccessKey':_0x3807e5,'region':_0x11fe35});_0x38911c[_0xc682('0x6c')]({'TranscriptionJobName':_0x327983,'LanguageCode':_0xd25a5f,'Media':{'MediaFileUri':_0x1c517c}},function(_0x4d2af6,_0x4b22cb){if(_0x4d2af6){return _0x137017(_0x4d2af6);}else{return _0x1969ed(_0x4b22cb);}});});}function transcribe(_0x3db051,_0x1302ee,_0x5abc2f,_0x6a52b,_0x4d6b85,_0x2979de,_0x4e68e1){return new Promise(function(_0x594443,_0x312f1d){var _0x447a92={};logger['info'](util[_0xc682('0x51')](_0xc682('0x6d'),_0x3db051,_0x4d6b85));return uploadFile(_0x1302ee,_0x5abc2f,_0x6a52b,_0x4d6b85,path[_0xc682('0x6e')](_0x2979de),fs[_0xc682('0x6f')](_0x2979de))['then'](function(_0x358e07){logger[_0xc682('0x65')](util[_0xc682('0x51')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x3db051,_0x4d6b85,_0x358e07['Location']));_0x447a92['bucket']=_0x358e07[_0xc682('0x70')];_0x447a92[_0xc682('0x71')]=_0x358e07[_0xc682('0x72')];logger[_0xc682('0x65')](util['format'](_0xc682('0x73'),_0x3db051));return startTranscribe(_0x1302ee,_0x5abc2f,_0x6a52b,uuidv4(),_0x4e68e1,_0x358e07[_0xc682('0x72')]);})['then'](function(_0x4ffe31){logger['info'](util[_0xc682('0x51')](_0xc682('0x74'),_0x3db051,_0x4ffe31[_0xc682('0x75')]['TranscriptionJobName']));_0x447a92[_0xc682('0x76')]=_0x4ffe31[_0xc682('0x75')]['TranscriptionJobName'];_0x447a92['transcribeStatus']=_0x4ffe31[_0xc682('0x75')][_0xc682('0x77')];return _0x594443(_0x447a92);})[_0xc682('0x4b')](function(_0x1e45b3){return _0x312f1d(_0x1e45b3);});});}exports[_0xc682('0x78')]=function(_0x3fbe44,_0x236f29,_0x238ab1){var _0x21195b;var _0x3f3fa3;var _0x3c64d4;var _0x378ee9=require(_0xc682('0x4e'));return db['VoiceRecording']['findOne']({'where':{'id':_0x3fbe44[_0xc682('0x44')]['id']}})['then'](function(_0x1b2d18){if(_0x1b2d18){var _0x4d702f=util[_0xc682('0x51')](_0xc682('0x52'),_0x1b2d18[_0xc682('0x50')]);if(fs[_0xc682('0x53')](_0x4d702f)){cypher=!![];return _0x378ee9['decryptFile'](_0x4d702f,_0x1b2d18['value'],config['secrets']['recording'])[_0xc682('0x26')](function(){return _0x1b2d18;});}return _0x1b2d18;}})[_0xc682('0x26')](function(_0xd976a9){if(!_0xd976a9){throw new db[(_0xc682('0x57'))][(_0xc682('0x58'))](_0xc682('0x79'));}_0x3f3fa3=_0xd976a9;return db[_0xc682('0x7a')][_0xc682('0x7b')]({'where':{'id':0x1}});})[_0xc682('0x26')](handleEntityNotFound(_0x236f29,null))[_0xc682('0x26')](function(_0x54659a){if(_0x54659a){_0x21195b=_0x54659a;if(!_0x21195b[_0xc682('0x7c')]||!_0x21195b[_0xc682('0x7d')]||!_0x21195b['transcribeRegion']||!_0x21195b[_0xc682('0x7e')]||!_0x21195b['bucket']){throw new db[(_0xc682('0x57'))][(_0xc682('0x58'))](_0xc682('0x7f'));}if(_0x3fbe44[_0xc682('0x4a')][_0xc682('0x80')]&&(!_0x21195b[_0xc682('0x81')]||!_0x21195b['sentimentAccountId']||!_0x21195b['sentimentRegion']||!_0x21195b[_0xc682('0x7e')]||!_0x21195b[_0xc682('0x82')])){throw new db[(_0xc682('0x57'))][(_0xc682('0x58'))](_0xc682('0x83'));}return db[_0xc682('0x84')][_0xc682('0x7b')]({'where':{'id':_0x21195b[_0xc682('0x7d')]}});}})[_0xc682('0x26')](function(_0x4b27b3){if(!_0x4b27b3){throw new db[(_0xc682('0x57'))][(_0xc682('0x58'))](_0xc682('0x85'));}if(!_0x4b27b3[_0xc682('0x86')]||!_0x4b27b3[_0xc682('0x87')]){throw new db[(_0xc682('0x57'))][(_0xc682('0x58'))](_0xc682('0x88'));}_0x3c64d4=_0x4b27b3;return getBucketslist(_0x3c64d4[_0xc682('0x86')],_0x3c64d4[_0xc682('0x87')],_0x21195b[_0xc682('0x89')]);})['then'](function(_0x3d32c5){if(_0x3d32c5&&_0x3d32c5['Buckets']){var _0x5a6e20=_['find'](_0x3d32c5['Buckets'],function(_0x31dd5d){return _0x31dd5d[_0xc682('0x8a')]===_0x21195b[_0xc682('0x82')];});if(!_0x5a6e20){logger[_0xc682('0x65')](util['format'](_0xc682('0x8b'),_0x3fbe44[_0xc682('0x44')]['id'],_0x21195b[_0xc682('0x82')]));return createBucket(_0x3c64d4[_0xc682('0x86')],_0x3c64d4[_0xc682('0x87')],_0x21195b['transcribeRegion'],_0x21195b[_0xc682('0x82')]);}logger[_0xc682('0x65')](util[_0xc682('0x51')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x3fbe44['params']['id'],_0x21195b[_0xc682('0x82')]));return;}})[_0xc682('0x26')](function(_0x5014c7){if(_0x3f3fa3[_0xc682('0x8c')]===_0xc682('0x8d')){return transcribe(_0x3fbe44['params']['id'],_0x3c64d4[_0xc682('0x86')],_0x3c64d4[_0xc682('0x87')],_0x21195b[_0xc682('0x89')],_0x21195b[_0xc682('0x82')],_0x3f3fa3['value'],_0x21195b[_0xc682('0x7e')]);}else{logger[_0xc682('0x65')](util['format'](_0xc682('0x8e'),_0x3fbe44[_0xc682('0x44')]['id']));return{'transcribeStatus':_0xc682('0x8f')};}})[_0xc682('0x26')](function(_0x1676a5){if(_0x1676a5){_0x1676a5['tempSentiment']=_0x3fbe44[_0xc682('0x4a')]['runSentiment'];return _0x3f3fa3['updateAttributes'](_0x1676a5);}})['then'](respondWithResult(_0x236f29,null))[_0xc682('0x4b')](handleError(_0x236f29,null));};function writeFile(_0x4b02c3,_0x30fafb){return new Promise(function(_0x1a2d52,_0x14d686){fs[_0xc682('0x90')](_0x30fafb,_0x4b02c3,function(_0x4da937,_0x4260dd){if(_0x4da937){return _0x14d686(_0x4da937);}else{return _0x1a2d52(_0x4260dd);}});});}exports[_0xc682('0x91')]=function(_0x32fe9b,_0x179512,_0x3f02ec){return db[_0xc682('0x2e')]['findOne']({'where':{'id':_0x32fe9b[_0xc682('0x44')]['id']}})[_0xc682('0x26')](handleEntityNotFound(_0x179512))['then'](function(_0x40d327){if(_0x40d327&&_0x40d327[_0xc682('0x92')]){var _0x245e2a=_0x40d327['fileText'];var _0x569f8e=config['root']+_0xc682('0x93')+_0x40d327['id']+_0xc682('0x94');if(fs[_0xc682('0x53')](_0x569f8e)){return _0x569f8e;}return writeFile(_0x245e2a,_0x569f8e)[_0xc682('0x26')](function(){return _0x569f8e;});}else{throw new db['Sequelize'][(_0xc682('0x58'))](_0xc682('0x95'));}})['then'](function(_0x4220ab){return _0x179512[_0xc682('0x4d')](_0x4220ab);})[_0xc682('0x4b')](handleError(_0x179512));}; \ No newline at end of file +var _0xe9cb=['find','create','body','params','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','col','token','$and','push','recording','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','secrets','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','options','include','findAll','catch','show','includeAll','merge'];(function(_0x3e592b,_0x2cc1e7){var _0x38c9e6=function(_0x4fb318){while(--_0x4fb318){_0x3e592b['push'](_0x3e592b['shift']());}};_0x38c9e6(++_0x2cc1e7);}(_0xe9cb,0x179));var _0xbe9c=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xe9cb[_0x4dbaad];return _0x226c72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe9c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe9c('0x1'));var moment=require(_0xbe9c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbe9c('0x3'));var util=require(_0xbe9c('0x4'));var path=require(_0xbe9c('0x5'));var sox=require('sox');var csv=require(_0xbe9c('0x6'));var ejs=require(_0xbe9c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbe9c('0x8'));var crypto=require(_0xbe9c('0x9'));var jsforce=require(_0xbe9c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xbe9c('0x6'));var querystring=require('querystring');var Papa=require(_0xbe9c('0xb'));var AWS=require('aws-sdk');var uuidv4=require(_0xbe9c('0xc'));var Redis=require(_0xbe9c('0xd'));var authService=require(_0xbe9c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbe9c('0xf'));var hardwareService=require(_0xbe9c('0x10'));var logger=require(_0xbe9c('0x11'))(_0xbe9c('0x12'));var utils=require(_0xbe9c('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43a117,_0x2a113b){_0x2a113b=_0x2a113b||0xcc;return function(_0x5d0c54){if(_0x5d0c54){return _0x43a117[_0xbe9c('0x14')](_0x2a113b);}return _0x43a117[_0xbe9c('0x15')](_0x2a113b)['end']();};}function respondWithResult(_0x198eb8,_0x1af062){_0x1af062=_0x1af062||0xc8;return function(_0x497108){if(_0x497108){return _0x198eb8[_0xbe9c('0x15')](_0x1af062)[_0xbe9c('0x16')](_0x497108);}};}function respondWithFilteredResult(_0x39a9dc,_0x142166){return function(_0x5ddcb4){if(_0x5ddcb4){var _0x40892b=typeof _0x142166[_0xbe9c('0x17')]==='undefined'&&typeof _0x142166[_0xbe9c('0x18')]===_0xbe9c('0x19');var _0x225aec=_0x5ddcb4[_0xbe9c('0x1a')];var _0x5c43ab=_0x40892b?0x0:_0x142166[_0xbe9c('0x17')];var _0x2a328a=_0x40892b?_0x5ddcb4[_0xbe9c('0x1a')]:_0x142166[_0xbe9c('0x17')]+_0x142166['limit'];var _0x37c57e;if(_0x2a328a>=_0x225aec){_0x2a328a=_0x225aec;_0x37c57e=0xc8;}else{_0x37c57e=0xce;}_0x39a9dc[_0xbe9c('0x15')](_0x37c57e);return _0x39a9dc[_0xbe9c('0x1b')](_0xbe9c('0x1c'),_0x5c43ab+'-'+_0x2a328a+'/'+_0x225aec)[_0xbe9c('0x16')](_0x5ddcb4);}return null;};}function patchUpdates(_0x4e9283){return function(_0xe45480){try{jsonpatch['apply'](_0xe45480,_0x4e9283,!![]);}catch(_0x17c185){return BPromise[_0xbe9c('0x1d')](_0x17c185);}return _0xe45480[_0xbe9c('0x1e')]();};}function saveUpdates(_0x15a651,_0x4da087){return function(_0x1446af){if(_0x1446af){return _0x1446af[_0xbe9c('0x1f')](_0x15a651)[_0xbe9c('0x20')](function(_0x9a15a9){return _0x9a15a9;});}return null;};}function removeEntity(_0x4bc95d,_0x28a0f6){return function(_0x10ef0c){if(_0x10ef0c){return _0x10ef0c['destroy']()[_0xbe9c('0x20')](function(){_0x4bc95d[_0xbe9c('0x15')](0xcc)[_0xbe9c('0x21')]();});}};}function handleEntityNotFound(_0xbd4eac,_0x355052){return function(_0x3e7ed4){if(!_0x3e7ed4){_0xbd4eac['sendStatus'](0x194);}return _0x3e7ed4;};}function handleError(_0x1ece61,_0xd570b){_0xd570b=_0xd570b||0x1f4;return function(_0x6b0b2){logger[_0xbe9c('0x22')](_0x6b0b2[_0xbe9c('0x23')]);if(_0x6b0b2['name']){delete _0x6b0b2[_0xbe9c('0x24')];}_0x1ece61[_0xbe9c('0x15')](_0xd570b)[_0xbe9c('0x25')](_0x6b0b2);};}exports[_0xbe9c('0x26')]=function(_0x3b82dd,_0x19f79f){var _0x460c03={},_0x3ae0ea={},_0x2b6944={'count':0x0,'rows':[]};var _0x3e5ad6=_[_0xbe9c('0x27')](db[_0xbe9c('0x28')][_0xbe9c('0x29')],function(_0x381c3c){return{'name':_0x381c3c[_0xbe9c('0x2a')],'type':_0x381c3c[_0xbe9c('0x2b')][_0xbe9c('0x2c')]};});_0x3ae0ea[_0xbe9c('0x2d')]=_[_0xbe9c('0x2e')](_[_0xbe9c('0x27')](_0x3e5ad6,_0xbe9c('0x24')),[_0xbe9c('0x2f')]);_0x3ae0ea[_0xbe9c('0x30')]=_[_0xbe9c('0x31')](_0x3b82dd[_0xbe9c('0x30')]);_0x3ae0ea[_0xbe9c('0x32')]=_[_0xbe9c('0x33')](_0x3ae0ea[_0xbe9c('0x2d')],_0x3ae0ea['query']);_0x460c03[_0xbe9c('0x34')]=_['intersection'](_0x3ae0ea[_0xbe9c('0x2d')],qs[_0xbe9c('0x35')](_0x3b82dd[_0xbe9c('0x30')][_0xbe9c('0x35')]));_0x460c03[_0xbe9c('0x34')]=_0x460c03[_0xbe9c('0x34')][_0xbe9c('0x36')]?_0x460c03[_0xbe9c('0x34')]:_0x3ae0ea[_0xbe9c('0x2d')];if(!_0x3b82dd[_0xbe9c('0x30')]['hasOwnProperty'](_0xbe9c('0x37'))){_0x460c03['limit']=qs['limit'](_0x3b82dd[_0xbe9c('0x30')][_0xbe9c('0x18')]);_0x460c03['offset']=qs[_0xbe9c('0x17')](_0x3b82dd[_0xbe9c('0x30')][_0xbe9c('0x17')]);}_0x460c03[_0xbe9c('0x38')]=qs['sort'](_0x3b82dd[_0xbe9c('0x30')]['sort']);_0x460c03[_0xbe9c('0x39')]=qs['filters'](_[_0xbe9c('0x3a')](_0x3b82dd[_0xbe9c('0x30')],_0x3ae0ea['filters']),_0x3e5ad6);if(_0x3b82dd[_0xbe9c('0x30')][_0xbe9c('0x3b')]){_0x460c03[_0xbe9c('0x39')]=_['merge'](_0x460c03['where'],{'$or':_[_0xbe9c('0x27')](_0x3e5ad6,function(_0x513492){if(_0x513492[_0xbe9c('0x2b')]!=='VIRTUAL'){var _0x43ace3={};_0x43ace3[_0x513492[_0xbe9c('0x24')]]={'$like':'%'+_0x3b82dd[_0xbe9c('0x30')][_0xbe9c('0x3b')]+'%'};return _0x43ace3;}})});}_0x460c03=_['merge']({},_0x460c03,_0x3b82dd[_0xbe9c('0x3c')]);var _0x7b4955={'where':_0x460c03[_0xbe9c('0x39')]};return db[_0xbe9c('0x28')][_0xbe9c('0x1a')](_0x7b4955)['then'](function(_0x580f15){_0x2b6944[_0xbe9c('0x1a')]=_0x580f15;if(_0x3b82dd[_0xbe9c('0x30')]['includeAll']){_0x460c03[_0xbe9c('0x3d')]=[{'all':!![]}];}return db[_0xbe9c('0x28')][_0xbe9c('0x3e')](_0x460c03);})[_0xbe9c('0x20')](function(_0x59d956){_0x2b6944['rows']=_0x59d956;return _0x2b6944;})[_0xbe9c('0x20')](respondWithFilteredResult(_0x19f79f,_0x460c03))[_0xbe9c('0x3f')](handleError(_0x19f79f,null));};exports[_0xbe9c('0x40')]=function(_0x56082d,_0x3fc22b){var _0xa559fd={'raw':![],'where':{'id':_0x56082d['params']['id']}},_0x36ee27={};_0x36ee27[_0xbe9c('0x2d')]=_[_0xbe9c('0x31')](db[_0xbe9c('0x28')][_0xbe9c('0x29')]);_0x36ee27['query']=_['keys'](_0x56082d['query']);_0x36ee27[_0xbe9c('0x32')]=_[_0xbe9c('0x33')](_0x36ee27[_0xbe9c('0x2d')],_0x36ee27[_0xbe9c('0x30')]);_0xa559fd[_0xbe9c('0x34')]=_['intersection'](_0x36ee27[_0xbe9c('0x2d')],qs[_0xbe9c('0x35')](_0x56082d['query'][_0xbe9c('0x35')]));_0xa559fd['attributes']=_0xa559fd[_0xbe9c('0x34')][_0xbe9c('0x36')]?_0xa559fd[_0xbe9c('0x34')]:_0x36ee27['model'];if(_0x56082d[_0xbe9c('0x30')][_0xbe9c('0x41')]){_0xa559fd[_0xbe9c('0x3d')]=[{'all':!![]}];}_0xa559fd=_[_0xbe9c('0x42')]({},_0xa559fd,_0x56082d[_0xbe9c('0x3c')]);return db[_0xbe9c('0x28')][_0xbe9c('0x43')](_0xa559fd)[_0xbe9c('0x20')](handleEntityNotFound(_0x3fc22b,null))[_0xbe9c('0x20')](respondWithResult(_0x3fc22b,null))[_0xbe9c('0x3f')](handleError(_0x3fc22b,null));};exports[_0xbe9c('0x44')]=function(_0x50d964,_0x852f5b){return db[_0xbe9c('0x28')][_0xbe9c('0x44')](_0x50d964['body'],{})[_0xbe9c('0x20')](respondWithResult(_0x852f5b,0xc9))[_0xbe9c('0x3f')](handleError(_0x852f5b,null));};exports[_0xbe9c('0x1f')]=function(_0x30662c,_0x4501eb){if(_0x30662c[_0xbe9c('0x45')]['id']){delete _0x30662c[_0xbe9c('0x45')]['id'];}return db[_0xbe9c('0x28')][_0xbe9c('0x43')]({'where':{'id':_0x30662c[_0xbe9c('0x46')]['id']}})[_0xbe9c('0x20')](handleEntityNotFound(_0x4501eb,null))[_0xbe9c('0x20')](saveUpdates(_0x30662c[_0xbe9c('0x45')],null))[_0xbe9c('0x20')](respondWithResult(_0x4501eb,null))['catch'](handleError(_0x4501eb,null));};exports[_0xbe9c('0x47')]=function(_0x2052c3,_0x4be68b){return db[_0xbe9c('0x28')][_0xbe9c('0x47')]()[_0xbe9c('0x20')](respondWithResult(_0x4be68b,null))[_0xbe9c('0x3f')](handleError(_0x4be68b,null));};exports[_0xbe9c('0x48')]=function(_0x4dc19f,_0x3afcc0,_0x5b0780){var _0x5aa70a=require(_0xbe9c('0x49'));var _0x2f6160=![];var _0x124cc6={};if(_0x4dc19f[_0xbe9c('0x30')][_0xbe9c('0x2b')]&&_0x4dc19f['query']['type']===_0xbe9c('0x4a')){_0x124cc6['uniqueid']=_0x4dc19f[_0xbe9c('0x46')]['id'];}else{_0x124cc6['id']=_0x4dc19f[_0xbe9c('0x46')]['id'];}return db[_0xbe9c('0x28')][_0xbe9c('0x43')]({'where':_0x124cc6,'attributes':['id',_0xbe9c('0x4b')],'raw':!![]})[_0xbe9c('0x20')](handleEntityNotFound(_0x3afcc0,null))[_0xbe9c('0x20')](function(_0x1be6dd){if(_0x1be6dd){var _0x2b495a=_0x1be6dd['value'];var _0x370172=util[_0xbe9c('0x2f')]('%s.cypher',_0x2b495a);if(fs[_0xbe9c('0x4c')](_0x370172)){_0x2f6160=!![];return _0x5aa70a[_0xbe9c('0x4d')](_0x370172,_0x2b495a,config['secrets']['recording'])[_0xbe9c('0x20')](function(){return _0x1be6dd;});}return _0x1be6dd;}})[_0xbe9c('0x20')](function(_0x52634f){if(_0x52634f){var _0xda6207=_0x52634f[_0xbe9c('0x4b')];if(!fs['existsSync'](_0xda6207)){throw new db['Sequelize'][(_0xbe9c('0x4e'))](_0xbe9c('0x4f'));}if(_0x52634f[_0xbe9c('0x50')]){return _0x3afcc0['download'](_0xda6207,_0x52634f[_0xbe9c('0x50')]+path[_0xbe9c('0x51')](_0xda6207),function(){if(_0x2f6160){fs[_0xbe9c('0x52')](_0xda6207);}});}else{return _0x3afcc0[_0xbe9c('0x48')](_0xda6207,function(_0x386765){if(_0x2f6160){fs[_0xbe9c('0x52')](_0xda6207);}});}}})['catch'](function(_0xc11855){if(_0xc11855[_0xbe9c('0x53')]==='VoiceRecording\x20not\x20found'){_0x3afcc0[_0xbe9c('0x15')](0x194)['send'](_0xbe9c('0x54'));}else{return handleError(_0x3afcc0,null);}});};exports['downloads']=function(_0x4fb97a,_0xd8106e,_0x5250cf){var _0x2c9cff=require(_0xbe9c('0x49'));var _0x439a3e=![];var _0x2e12af={'$and':[db['sequelize']['where'](db['sequelize']['fn']('MD5',db[_0xbe9c('0x55')][_0xbe9c('0x56')](_0xbe9c('0x4a'))),_0x4fb97a[_0xbe9c('0x30')][_0xbe9c('0x57')])]};if(_0x4fb97a[_0xbe9c('0x30')]['type']&&_0x4fb97a['query'][_0xbe9c('0x2b')]===_0xbe9c('0x4a')){_0x2e12af[_0xbe9c('0x58')][_0xbe9c('0x59')]({'uniqueid':_0x4fb97a[_0xbe9c('0x46')]['id']});}else{_0x2e12af[_0xbe9c('0x58')][_0xbe9c('0x59')]({'id':_0x4fb97a['params']['id']});}return db['VoiceRecording']['find']({'where':_0x2e12af,'attributes':['id','value'],'raw':!![]})[_0xbe9c('0x20')](handleEntityNotFound(_0xd8106e,null))['then'](function(_0x2837fd){if(_0x2837fd){var _0x556a31=util[_0xbe9c('0x2f')]('%s.cypher',_0x2837fd[_0xbe9c('0x4b')]);if(fs[_0xbe9c('0x4c')](_0x556a31)){_0x439a3e=!![];return _0x2c9cff[_0xbe9c('0x4d')](_0x556a31,_0x2837fd[_0xbe9c('0x4b')],config['secrets'][_0xbe9c('0x5a')])[_0xbe9c('0x20')](function(){return _0x2837fd;});}return _0x2837fd;}})[_0xbe9c('0x20')](function(_0x36ef36){if(_0x36ef36){if(!fs[_0xbe9c('0x4c')](_0x36ef36[_0xbe9c('0x4b')])){throw new db[(_0xbe9c('0x5b'))][(_0xbe9c('0x4e'))](_0xbe9c('0x4f'));}if(_0x36ef36[_0xbe9c('0x50')]){return _0xd8106e[_0xbe9c('0x48')](_0x36ef36[_0xbe9c('0x4b')],_0x36ef36[_0xbe9c('0x50')]+path['extname'](_0x36ef36['value']),function(){if(_0x439a3e){fs[_0xbe9c('0x52')](_0x36ef36[_0xbe9c('0x4b')]);}});}else{return _0xd8106e[_0xbe9c('0x48')](_0x36ef36['value'],function(_0x5ec95d){if(_0x439a3e){fs[_0xbe9c('0x52')](_0x36ef36['value']);}});}}})['catch'](handleError(_0xd8106e,null));};exports['destroy']=function(_0xd570bc,_0x133f53){return db['VoiceRecording'][_0xbe9c('0x43')]({'where':{'id':_0xd570bc[_0xbe9c('0x46')]['id']}})[_0xbe9c('0x20')](function(_0x162f6a){if(_[_0xbe9c('0x5c')](_0x162f6a)){throw new ReferenceError(_0xbe9c('0x5d'));}return _0x162f6a;})['then'](function(_0x4ff9dd){var _0x148012=_0x4ff9dd[_0xbe9c('0x4b')];logger[_0xbe9c('0x5e')](_0xbe9c('0x5f'),_0x148012);if(!_[_0xbe9c('0x5c')](_0x4ff9dd[_0xbe9c('0x4b')])&&fs[_0xbe9c('0x4c')](_0x148012)){logger[_0xbe9c('0x5e')](_0xbe9c('0x60')+_0x148012+_0xbe9c('0x61'));fs[_0xbe9c('0x62')](_0x148012);}_0x148012=_0x148012+_0xbe9c('0x63');if(!_[_0xbe9c('0x5c')](_0x4ff9dd[_0xbe9c('0x4b')])&&fs[_0xbe9c('0x4c')](_0x148012)){logger['info'](_0xbe9c('0x60')+_0x148012+_0xbe9c('0x61'));fs['unlinkSync'](_0x148012);}return _0x4ff9dd;})[_0xbe9c('0x20')](function(_0x1d4448){if(!_0x1d4448)throw new InternalError();return _0x1d4448['destroy']();})[_0xbe9c('0x20')](function(){_0x133f53['status'](0xcc)[_0xbe9c('0x21')]();})[_0xbe9c('0x3f')](handleError(_0x133f53,null));};function getBucketslist(_0x373e86,_0x50d963,_0x3ad6fb){return new Promise(function(_0x19dd5f,_0xc01a3e){var _0x39d8d6=new AWS['S3']({'accessKeyId':_0x50d963,'secretAccessKey':_0x373e86,'region':_0x3ad6fb});_0x39d8d6['listBuckets']({},function(_0x48ed49,_0x20cea9){if(_0x48ed49){return _0xc01a3e(_0x48ed49);}else{return _0x19dd5f(_0x20cea9);}});});}function createBucket(_0x4dc36e,_0x5b2723,_0x136f73,_0x49069b){return new Promise(function(_0x3e0d64,_0x1b3c69){var _0x2abd63=new AWS['S3']({'accessKeyId':_0x5b2723,'secretAccessKey':_0x4dc36e,'region':_0x136f73});_0x2abd63[_0xbe9c('0x64')]({'Bucket':_0x49069b},function(_0x42f5d1,_0x5024cf){if(_0x42f5d1){return _0x1b3c69(_0x42f5d1);}else{return _0x3e0d64(_0x5024cf);}});});}function uploadFile(_0x24db6a,_0x3418e1,_0x3b0e8b,_0x19960f,_0x1e6ede,_0x1f0de7){return new Promise(function(_0x54447c,_0x5f3bb7){var _0x4dbe88=new AWS['S3']({'accessKeyId':_0x3418e1,'secretAccessKey':_0x24db6a,'region':_0x3b0e8b});_0x4dbe88['upload']({'Bucket':_0x19960f,'Key':_0x1e6ede,'Body':_0x1f0de7},function(_0x4d1ef0,_0x2f2ec6){if(_0x4d1ef0){return _0x5f3bb7(_0x4d1ef0);}else{return _0x54447c(_0x2f2ec6);}});});}function startTranscribe(_0x4653a1,_0x348cd3,_0x5b4b69,_0x4c1462,_0x2b19c7,_0x571794){return new Promise(function(_0x59cf0b,_0xa7a3c6){var _0x22bb55=new AWS[(_0xbe9c('0x65'))]({'accessKeyId':_0x348cd3,'secretAccessKey':_0x4653a1,'region':_0x5b4b69});_0x22bb55[_0xbe9c('0x66')]({'TranscriptionJobName':_0x4c1462,'LanguageCode':_0x2b19c7,'Media':{'MediaFileUri':_0x571794}},function(_0x3aea1e,_0x3d8d24){if(_0x3aea1e){return _0xa7a3c6(_0x3aea1e);}else{return _0x59cf0b(_0x3d8d24);}});});}function transcribe(_0x1894d1,_0x55ff7,_0x660c25,_0x335c62,_0x3b6a60,_0x22acf1,_0x5c1635){return new Promise(function(_0x5cb930,_0x212ef1){var _0x38b534={};logger[_0xbe9c('0x5e')](util[_0xbe9c('0x2f')](_0xbe9c('0x67'),_0x1894d1,_0x3b6a60));return uploadFile(_0x55ff7,_0x660c25,_0x335c62,_0x3b6a60,path[_0xbe9c('0x68')](_0x22acf1),fs[_0xbe9c('0x69')](_0x22acf1))[_0xbe9c('0x20')](function(_0x14678d){logger[_0xbe9c('0x5e')](util[_0xbe9c('0x2f')](_0xbe9c('0x6a'),_0x1894d1,_0x3b6a60,_0x14678d['Location']));_0x38b534[_0xbe9c('0x6b')]=_0x14678d['Bucket'];_0x38b534[_0xbe9c('0x6c')]=_0x14678d[_0xbe9c('0x6d')];logger[_0xbe9c('0x5e')](util[_0xbe9c('0x2f')](_0xbe9c('0x6e'),_0x1894d1));return startTranscribe(_0x55ff7,_0x660c25,_0x335c62,uuidv4(),_0x5c1635,_0x14678d[_0xbe9c('0x6d')]);})['then'](function(_0x528c6a){logger[_0xbe9c('0x5e')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x1894d1,_0x528c6a['TranscriptionJob'][_0xbe9c('0x6f')]));_0x38b534['transcribeName']=_0x528c6a[_0xbe9c('0x70')][_0xbe9c('0x6f')];_0x38b534[_0xbe9c('0x71')]=_0x528c6a[_0xbe9c('0x70')][_0xbe9c('0x72')];return _0x5cb930(_0x38b534);})[_0xbe9c('0x3f')](function(_0x48072d){return _0x212ef1(_0x48072d);});});}exports[_0xbe9c('0x73')]=function(_0x28ced8,_0x5c0436,_0x5b741e){var _0x1d7ec2;var _0x56c869;var _0x47c71a;var _0x2dcffe=require(_0xbe9c('0x49'));return db['VoiceRecording']['findOne']({'where':{'id':_0x28ced8[_0xbe9c('0x46')]['id']}})[_0xbe9c('0x20')](function(_0x1fadb9){if(_0x1fadb9){var _0x2642ef=util[_0xbe9c('0x2f')]('%s.cypher',_0x1fadb9['value']);if(fs['existsSync'](_0x2642ef)){cypher=!![];return _0x2dcffe[_0xbe9c('0x4d')](_0x2642ef,_0x1fadb9['value'],config[_0xbe9c('0x74')][_0xbe9c('0x5a')])[_0xbe9c('0x20')](function(){return _0x1fadb9;});}return _0x1fadb9;}})[_0xbe9c('0x20')](function(_0x2fb737){if(!_0x2fb737){throw new db[(_0xbe9c('0x5b'))]['ValidationError'](_0xbe9c('0x75'));}_0x56c869=_0x2fb737;return db[_0xbe9c('0x76')][_0xbe9c('0x77')]({'where':{'id':0x1}});})[_0xbe9c('0x20')](handleEntityNotFound(_0x5c0436,null))[_0xbe9c('0x20')](function(_0x3ff224){if(_0x3ff224){_0x1d7ec2=_0x3ff224;if(!_0x1d7ec2[_0xbe9c('0x78')]||!_0x1d7ec2[_0xbe9c('0x79')]||!_0x1d7ec2[_0xbe9c('0x7a')]||!_0x1d7ec2[_0xbe9c('0x7b')]||!_0x1d7ec2[_0xbe9c('0x6b')]){throw new db[(_0xbe9c('0x5b'))][(_0xbe9c('0x4e'))](_0xbe9c('0x7c'));}if(_0x28ced8[_0xbe9c('0x45')][_0xbe9c('0x7d')]&&(!_0x1d7ec2['sentiment']||!_0x1d7ec2[_0xbe9c('0x7e')]||!_0x1d7ec2[_0xbe9c('0x7f')]||!_0x1d7ec2['language']||!_0x1d7ec2[_0xbe9c('0x6b')])){throw new db[(_0xbe9c('0x5b'))][(_0xbe9c('0x4e'))](_0xbe9c('0x80'));}return db[_0xbe9c('0x81')][_0xbe9c('0x77')]({'where':{'id':_0x1d7ec2[_0xbe9c('0x79')]}});}})[_0xbe9c('0x20')](function(_0x121484){if(!_0x121484){throw new db['Sequelize'][(_0xbe9c('0x4e'))](_0xbe9c('0x82'));}if(!_0x121484['data1']||!_0x121484['data2']){throw new db[(_0xbe9c('0x5b'))][(_0xbe9c('0x4e'))](_0xbe9c('0x83'));}_0x47c71a=_0x121484;return getBucketslist(_0x47c71a['data1'],_0x47c71a['data2'],_0x1d7ec2['transcribeRegion']);})[_0xbe9c('0x20')](function(_0x4c6423){if(_0x4c6423&&_0x4c6423[_0xbe9c('0x84')]){var _0x39224f=_[_0xbe9c('0x43')](_0x4c6423[_0xbe9c('0x84')],function(_0x56b554){return _0x56b554[_0xbe9c('0x85')]===_0x1d7ec2['bucket'];});if(!_0x39224f){logger['info'](util[_0xbe9c('0x2f')](_0xbe9c('0x86'),_0x28ced8[_0xbe9c('0x46')]['id'],_0x1d7ec2['bucket']));return createBucket(_0x47c71a[_0xbe9c('0x87')],_0x47c71a[_0xbe9c('0x88')],_0x1d7ec2[_0xbe9c('0x7a')],_0x1d7ec2[_0xbe9c('0x6b')]);}logger[_0xbe9c('0x5e')](util['format'](_0xbe9c('0x89'),_0x28ced8[_0xbe9c('0x46')]['id'],_0x1d7ec2[_0xbe9c('0x6b')]));return;}})['then'](function(_0x39db18){if(_0x56c869[_0xbe9c('0x71')]===_0xbe9c('0x8a')){return transcribe(_0x28ced8[_0xbe9c('0x46')]['id'],_0x47c71a['data1'],_0x47c71a['data2'],_0x1d7ec2['transcribeRegion'],_0x1d7ec2['bucket'],_0x56c869[_0xbe9c('0x4b')],_0x1d7ec2[_0xbe9c('0x7b')]);}else{logger['info'](util['format'](_0xbe9c('0x8b'),_0x28ced8[_0xbe9c('0x46')]['id']));return{'transcribeStatus':_0xbe9c('0x8c')};}})['then'](function(_0x217bb6){if(_0x217bb6){_0x217bb6[_0xbe9c('0x8d')]=_0x28ced8[_0xbe9c('0x45')][_0xbe9c('0x7d')];return _0x56c869[_0xbe9c('0x8e')](_0x217bb6);}})[_0xbe9c('0x20')](respondWithResult(_0x5c0436,null))['catch'](handleError(_0x5c0436,null));};function writeFile(_0x542d62,_0x4fcf55){return new Promise(function(_0x4bc307,_0x38b6de){fs[_0xbe9c('0x8f')](_0x4fcf55,_0x542d62,function(_0x3c46b8,_0x5660c4){if(_0x3c46b8){return _0x38b6de(_0x3c46b8);}else{return _0x4bc307(_0x5660c4);}});});}exports[_0xbe9c('0x90')]=function(_0x103b48,_0x4a0d37,_0x135d71){return db[_0xbe9c('0x28')][_0xbe9c('0x77')]({'where':{'id':_0x103b48[_0xbe9c('0x46')]['id']}})[_0xbe9c('0x20')](handleEntityNotFound(_0x4a0d37))[_0xbe9c('0x20')](function(_0x5a3352){if(_0x5a3352&&_0x5a3352[_0xbe9c('0x91')]){var _0x4a4b0c=_0x5a3352[_0xbe9c('0x91')];var _0x543f26=config['root']+_0xbe9c('0x92')+_0x5a3352['id']+_0xbe9c('0x93');if(fs[_0xbe9c('0x4c')](_0x543f26)){return _0x543f26;}return writeFile(_0x4a4b0c,_0x543f26)['then'](function(){return _0x543f26;});}else{throw new db[(_0xbe9c('0x5b'))]['ValidationError']('Transcript\x20not\x20available');}})[_0xbe9c('0x20')](function(_0x2e92da){return _0x4a0d37[_0xbe9c('0x48')](_0x2e92da);})['catch'](handleError(_0x4a0d37));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 939acd5..16be191 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 _0x7e22=['exports','define','voice_recordings','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5266e7,_0x97b16b){var _0x5470f1=function(_0x10258e){while(--_0x10258e){_0x5266e7['push'](_0x5266e7['shift']());}};_0x5470f1(++_0x97b16b);}(_0x7e22,0x1d8));var _0x27e2=function(_0x352f3f,_0xda7ed2){_0x352f3f=_0x352f3f-0x0;var _0x167843=_0x7e22[_0x352f3f];return _0x167843;};'use strict';var _=require(_0x27e2('0x0'));var util=require('util');var logger=require(_0x27e2('0x1'))(_0x27e2('0x2'));var moment=require(_0x27e2('0x3'));var BPromise=require(_0x27e2('0x4'));var rp=require(_0x27e2('0x5'));var fs=require('fs');var path=require(_0x27e2('0x6'));var rimraf=require('rimraf');var config=require(_0x27e2('0x7'));var attributes=require('./voiceRecording.attributes');module[_0x27e2('0x8')]=function(_0x350996,_0x3eb3cd){return _0x350996[_0x27e2('0x9')]('VoiceRecording',attributes,{'tableName':_0x27e2('0xa'),'paranoid':![],'indexes':[{'name':_0x27e2('0xb'),'fields':[_0x27e2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf54=['../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14e512,_0x40b006){var _0x516a60=function(_0x321750){while(--_0x321750){_0x14e512['push'](_0x14e512['shift']());}};_0x516a60(++_0x40b006);}(_0xcf54,0x125));var _0x4cf5=function(_0xf363f0,_0x3b5eeb){_0xf363f0=_0xf363f0-0x0;var _0x55a386=_0xcf54[_0xf363f0];return _0x55a386;};'use strict';var _=require('lodash');var util=require(_0x4cf5('0x0'));var logger=require(_0x4cf5('0x1'))(_0x4cf5('0x2'));var moment=require(_0x4cf5('0x3'));var BPromise=require(_0x4cf5('0x4'));var rp=require(_0x4cf5('0x5'));var fs=require('fs');var path=require(_0x4cf5('0x6'));var rimraf=require('rimraf');var config=require(_0x4cf5('0x7'));var attributes=require(_0x4cf5('0x8'));module[_0x4cf5('0x9')]=function(_0xaf761a,_0x76b42b){return _0xaf761a['define'](_0x4cf5('0xa'),attributes,{'tableName':_0x4cf5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 5bfce98..8c5e912 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 _0x958a=['unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher'];(function(_0x1c4a10,_0x395625){var _0x12cc21=function(_0x5cca4e){while(--_0x5cca4e){_0x1c4a10['push'](_0x1c4a10['shift']());}};_0x12cc21(++_0x395625);}(_0x958a,0x128));var _0xa958=function(_0x6f9da0,_0x49c37a){_0x6f9da0=_0x6f9da0-0x0;var _0x321b85=_0x958a[_0x6f9da0];return _0x321b85;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}exports[_0xa958('0x17')]=function(_0x4eadc9){var _0x3a053f=this;return new Promise(function(_0x70d13e,_0x52a184){return db[_0xa958('0x18')][_0xa958('0x19')](_0x4eadc9[_0xa958('0x1a')],{'raw':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')][_0xa958('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eadc9['options']?_0x4eadc9['options'][_0xa958('0x1d')]||null:null,'attributes':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')]['attributes']||null:null,'limit':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')]['limit']||null:null})[_0xa958('0xb')](function(_0x401175){logger['info']('UpdateVoiceRecording',_0x4eadc9);logger[_0xa958('0xf')](_0xa958('0x17'),_0x4eadc9,JSON['stringify'](_0x401175));_0x70d13e(_0x401175);})[_0xa958('0x16')](function(_0x27097a){logger[_0xa958('0x12')](_0xa958('0x17'),_0x27097a[_0xa958('0x14')],_0x4eadc9);_0x52a184(_0x3a053f[_0xa958('0x12')](0x1f4,_0x27097a['message']));});});};exports[_0xa958('0x1e')]=function(_0x48ef34){var _0x43df63=this;return new Promise(function(_0x3c2ea3,_0x32ea36){var _0x18f600=require(_0xa958('0x1f'));var _0xddc7f6;return db[_0xa958('0x20')][_0xa958('0x21')]({'attributes':['id',_0xa958('0x22')],'where':{'id':0x1},'raw':!![]})[_0xa958('0xb')](function(_0x4c4c37){_0xddc7f6=_0x4c4c37;return db['VoiceRecording'][_0xa958('0x23')](_0x48ef34['body']);})[_0xa958('0xb')](function(_0x1b76de){if(_0xddc7f6['callRecordingEncryption']&&fs[_0xa958('0x24')](_0x1b76de[_0xa958('0x25')])){var _0x179bc2=util[_0xa958('0x26')](_0xa958('0x27'),_0x1b76de['value']);return _0x18f600['encryptFile'](_0x1b76de[_0xa958('0x25')],_0x179bc2,config['secrets']['recording'])[_0xa958('0xb')](function(){fs[_0xa958('0x28')](_0x1b76de[_0xa958('0x25')]);logger[_0xa958('0xc')](_0xa958('0x29'));return _0x1b76de;});}return _0x1b76de;})[_0xa958('0xb')](function(_0x516a2f){logger[_0xa958('0xc')]('CreateVoiceRecording',_0x48ef34);logger['debug'](_0xa958('0x1e'),_0x48ef34,JSON[_0xa958('0x11')](_0x516a2f));_0x3c2ea3(_0x516a2f);})[_0xa958('0x16')](function(_0x1cc55d){logger[_0xa958('0x12')](_0xa958('0x1e'),_0x1cc55d[_0xa958('0x14')],_0x48ef34);_0x32ea36(_0x43df63[_0xa958('0x12')](0x1f4,_0x1cc55d['message']));});});}; \ No newline at end of file +var _0x4991=['where','attributes','limit','catch','VoiceRecording','create','existsSync','value','%s.cypher','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateVoiceRecording','update','body','options','raw'];(function(_0x4e1110,_0x4a8671){var _0x1c999f=function(_0x3aba9b){while(--_0x3aba9b){_0x4e1110['push'](_0x4e1110['shift']());}};_0x1c999f(++_0x4a8671);}(_0x4991,0xf7));var _0x1499=function(_0x2ab39c,_0x21dd18){_0x2ab39c=_0x2ab39c-0x0;var _0x193afa=_0x4991[_0x2ab39c];return _0x193afa;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd7,_0x1c65c3,_0x33b261){return new BPromise(function(_0x133bae,_0x380e48){return client[_0x1499('0xb')](_0x1c3bd7,_0x33b261)[_0x1499('0xc')](function(_0x48d2ca){logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');logger[_0x1499('0xf')](_0x1499('0x10'),_0x1c65c3,'request\x20sent',JSON[_0x1499('0x11')](_0x48d2ca));if(_0x48d2ca[_0x1499('0x12')]){if(_0x48d2ca['error']['code']===0x1f4){logger['error'](_0x1499('0xe'),_0x1c65c3,_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);return _0x380e48(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x1c65c3,_0x48d2ca[_0x1499('0x12')]['message']);return _0x133bae(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}else{logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');_0x133bae(_0x48d2ca[_0x1499('0x14')][_0x1499('0x13')]);}})['catch'](function(_0x25164c){logger[_0x1499('0x12')](_0x1499('0xe'),_0x1c65c3,_0x25164c);_0x380e48(_0x25164c);});});}exports[_0x1499('0x15')]=function(_0x1e45a9){var _0x27e533=this;return new Promise(function(_0x5b9859,_0x541477){return db['VoiceRecording'][_0x1499('0x16')](_0x1e45a9[_0x1499('0x17')],{'raw':_0x1e45a9['options']?_0x1e45a9[_0x1499('0x18')][_0x1499('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e45a9[_0x1499('0x18')]?_0x1e45a9[_0x1499('0x18')][_0x1499('0x1a')]||null:null,'attributes':_0x1e45a9[_0x1499('0x18')]?_0x1e45a9[_0x1499('0x18')][_0x1499('0x1b')]||null:null,'limit':_0x1e45a9[_0x1499('0x18')]?_0x1e45a9[_0x1499('0x18')][_0x1499('0x1c')]||null:null})[_0x1499('0xc')](function(_0x223f4c){logger[_0x1499('0xd')](_0x1499('0x15'),_0x1e45a9);logger[_0x1499('0xf')](_0x1499('0x15'),_0x1e45a9,JSON['stringify'](_0x223f4c));_0x5b9859(_0x223f4c);})[_0x1499('0x1d')](function(_0xc79f69){logger[_0x1499('0x12')](_0x1499('0x15'),_0xc79f69[_0x1499('0x13')],_0x1e45a9);_0x541477(_0x27e533[_0x1499('0x12')](0x1f4,_0xc79f69['message']));});});};exports['CreateVoiceRecording']=function(_0x12739b){var _0x3c9aca=this;return new Promise(function(_0x3b9259,_0x50f0cc){var _0x32782a=require('../../components/encryptor');var _0x3e5ed1;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x1499('0xc')](function(_0x103efa){_0x3e5ed1=_0x103efa;return db[_0x1499('0x1e')][_0x1499('0x1f')](_0x12739b[_0x1499('0x17')]);})[_0x1499('0xc')](function(_0x3dd534){if(_0x3e5ed1['callRecordingEncryption']&&fs[_0x1499('0x20')](_0x3dd534[_0x1499('0x21')])){var _0x39995b=util['format'](_0x1499('0x22'),_0x3dd534[_0x1499('0x21')]);return _0x32782a['encryptFile'](_0x3dd534[_0x1499('0x21')],_0x39995b,config[_0x1499('0x23')]['recording'])[_0x1499('0xc')](function(){fs[_0x1499('0x24')](_0x3dd534[_0x1499('0x21')]);logger[_0x1499('0xd')](_0x1499('0x25'));return _0x3dd534;});}return _0x3dd534;})[_0x1499('0xc')](function(_0x7b4d75){logger[_0x1499('0xd')](_0x1499('0x26'),_0x12739b);logger[_0x1499('0xf')](_0x1499('0x26'),_0x12739b,JSON[_0x1499('0x11')](_0x7b4d75));_0x3b9259(_0x7b4d75);})[_0x1499('0x1d')](function(_0x3f4c1a){logger[_0x1499('0x12')](_0x1499('0x26'),_0x3f4c1a[_0x1499('0x13')],_0x12739b);_0x50f0cc(_0x3c9aca[_0x1499('0x12')](0x1f4,_0x3f4c1a[_0x1499('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index bc26e97..2c82d95 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 _0xbea6=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbea6,0x93));var _0x6bea=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xbea6[_0x5f309e];return _0x487b5e;};'use strict';var multer=require(_0x6bea('0x0'));var util=require(_0x6bea('0x1'));var path=require(_0x6bea('0x2'));var timeout=require(_0x6bea('0x3'));var express=require(_0x6bea('0x4'));var router=express[_0x6bea('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6bea('0x6'));var interaction=require(_0x6bea('0x7'));var config=require(_0x6bea('0x8'));var controller=require(_0x6bea('0x9'));router[_0x6bea('0xa')]('/',auth['isAuthenticated'](),controller[_0x6bea('0xb')]);router['get'](_0x6bea('0xc'),auth[_0x6bea('0xd')](),controller['describe']);router[_0x6bea('0xa')](_0x6bea('0xe'),auth[_0x6bea('0xd')](),controller['show']);router[_0x6bea('0xf')]('/',auth[_0x6bea('0xd')](),controller[_0x6bea('0x10')]);router[_0x6bea('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6bea('0x12')]);router[_0x6bea('0x13')]('/:id',auth[_0x6bea('0xd')](),controller[_0x6bea('0x14')]);module[_0x6bea('0x15')]=router; \ No newline at end of file +var _0xadb9=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x39df21,_0x11b3f0){var _0x2137ac=function(_0x1a9754){while(--_0x1a9754){_0x39df21['push'](_0x39df21['shift']());}};_0x2137ac(++_0x11b3f0);}(_0xadb9,0x65));var _0x9adb=function(_0x9553a2,_0x5424d9){_0x9553a2=_0x9553a2-0x0;var _0x3e398c=_0xadb9[_0x9553a2];return _0x3e398c;};'use strict';var multer=require('multer');var util=require(_0x9adb('0x0'));var path=require(_0x9adb('0x1'));var timeout=require(_0x9adb('0x2'));var express=require(_0x9adb('0x3'));var router=express[_0x9adb('0x4')]();var fs_extra=require(_0x9adb('0x5'));var auth=require(_0x9adb('0x6'));var interaction=require(_0x9adb('0x7'));var config=require(_0x9adb('0x8'));var controller=require(_0x9adb('0x9'));router[_0x9adb('0xa')]('/',auth[_0x9adb('0xb')](),controller[_0x9adb('0xc')]);router['get'](_0x9adb('0xd'),auth[_0x9adb('0xb')](),controller['describe']);router['get'](_0x9adb('0xe'),auth['isAuthenticated'](),controller[_0x9adb('0xf')]);router[_0x9adb('0x10')]('/',auth[_0x9adb('0xb')](),controller[_0x9adb('0x11')]);router[_0x9adb('0x12')](_0x9adb('0xe'),auth[_0x9adb('0xb')](),controller[_0x9adb('0x13')]);router[_0x9adb('0x14')](_0x9adb('0xe'),auth[_0x9adb('0xb')](),controller[_0x9adb('0x15')]);module[_0x9adb('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index e14c084..664703d 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 _0xb783=['ENUM','blind','STRING','Yes','moment'];(function(_0x57d7f4,_0x45665d){var _0x2d49da=function(_0x9198a9){while(--_0x9198a9){_0x57d7f4['push'](_0x57d7f4['shift']());}};_0x2d49da(++_0x45665d);}(_0xb783,0x72));var _0x3b78=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb783[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3b78('0x0'));module['exports']={'type':{'type':Sequelize[_0x3b78('0x1')](_0x3b78('0x2'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x3b78('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x3b78('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x3b78('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x3b78('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x3b78('0x3')]},'transferercontext':{'type':Sequelize[_0x3b78('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x3b78('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x3b78('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x3b78('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x3b78('0x3')]},'transfereecontext':{'type':Sequelize[_0x3b78('0x3')]},'transfereeexten':{'type':Sequelize[_0x3b78('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x3b78('0x3')]},'isexternal':{'type':Sequelize[_0x3b78('0x1')](_0x3b78('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x3b78('0x3')]}}; \ No newline at end of file +var _0x2a39=['moment','ENUM','blind','STRING','Yes'];(function(_0x2c2fcc,_0xbda210){var _0x4b4516=function(_0xb93273){while(--_0xb93273){_0x2c2fcc['push'](_0x2c2fcc['shift']());}};_0x4b4516(++_0xbda210);}(_0x2a39,0x17c));var _0x92a3=function(_0x135c14,_0x41c790){_0x135c14=_0x135c14-0x0;var _0x19e640=_0x2a39[_0x135c14];return _0x19e640;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x92a3('0x0'));module['exports']={'type':{'type':Sequelize[_0x92a3('0x1')](_0x92a3('0x2'),'attended')},'result':{'type':Sequelize[_0x92a3('0x3')]},'transfererchannel':{'type':Sequelize[_0x92a3('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x92a3('0x3')]},'transferercalleridname':{'type':Sequelize[_0x92a3('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x92a3('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x92a3('0x3')]},'transferercontext':{'type':Sequelize[_0x92a3('0x3')]},'transfererexten':{'type':Sequelize[_0x92a3('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x92a3('0x3')]},'transfereechannel':{'type':Sequelize[_0x92a3('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x92a3('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x92a3('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x92a3('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x92a3('0x3')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x92a3('0x3')]},'transfereeexten':{'type':Sequelize[_0x92a3('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x92a3('0x3')]},'isexternal':{'type':Sequelize[_0x92a3('0x1')](_0x92a3('0x4'),'No')},'context':{'type':Sequelize[_0x92a3('0x3')]},'extension':{'type':Sequelize[_0x92a3('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 478d9be..0a5dbd0 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 _0xe59d=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','index','map','VoiceTransferReport','type','key'];(function(_0xff8595,_0x39341d){var _0x31e49e=function(_0x23ee7b){while(--_0x23ee7b){_0xff8595['push'](_0xff8595['shift']());}};_0x31e49e(++_0x39341d);}(_0xe59d,0x101));var _0xde59=function(_0x56a7bc,_0x41d6f6){_0x56a7bc=_0x56a7bc-0x0;var _0x4f5883=_0xe59d[_0x56a7bc];return _0x4f5883;};'use strict';var emlformat=require(_0xde59('0x0'));var rimraf=require(_0xde59('0x1'));var zipdir=require(_0xde59('0x2'));var jsonpatch=require(_0xde59('0x3'));var rp=require(_0xde59('0x4'));var moment=require(_0xde59('0x5'));var BPromise=require(_0xde59('0x6'));var Mustache=require(_0xde59('0x7'));var util=require('util');var path=require(_0xde59('0x8'));var sox=require(_0xde59('0x9'));var csv=require('to-csv');var ejs=require(_0xde59('0xa'));var fs=require('fs');var fs_extra=require(_0xde59('0xb'));var _=require(_0xde59('0xc'));var squel=require(_0xde59('0xd'));var crypto=require('crypto');var jsforce=require(_0xde59('0xe'));var deskjs=require(_0xde59('0xf'));var toCsv=require(_0xde59('0x10'));var querystring=require(_0xde59('0x11'));var Papa=require(_0xde59('0x12'));var Redis=require(_0xde59('0x13'));var authService=require(_0xde59('0x14'));var qs=require(_0xde59('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde59('0x16'));var logger=require(_0xde59('0x17'))(_0xde59('0x18'));var utils=require(_0xde59('0x19'));var config=require(_0xde59('0x1a'));var licenseUtil=require(_0xde59('0x1b'));var db=require(_0xde59('0x1c'))['db'];function respondWithStatusCode(_0x2e6631,_0x1021f5){_0x1021f5=_0x1021f5||0xcc;return function(_0x9b1f86){if(_0x9b1f86){return _0x2e6631[_0xde59('0x1d')](_0x1021f5);}return _0x2e6631[_0xde59('0x1e')](_0x1021f5)[_0xde59('0x1f')]();};}function respondWithResult(_0x1bc5b0,_0x5a0d8b){_0x5a0d8b=_0x5a0d8b||0xc8;return function(_0x5a73e0){if(_0x5a73e0){return _0x1bc5b0[_0xde59('0x1e')](_0x5a0d8b)[_0xde59('0x20')](_0x5a73e0);}};}function respondWithFilteredResult(_0x4ce251,_0x276f00){return function(_0x4b3ed7){if(_0x4b3ed7){var _0x2638c4=typeof _0x276f00[_0xde59('0x21')]===_0xde59('0x22')&&typeof _0x276f00[_0xde59('0x23')]===_0xde59('0x22');var _0xbbd137=_0x4b3ed7[_0xde59('0x24')];var _0x49a6f3=_0x2638c4?0x0:_0x276f00['offset'];var _0x23f53a=_0x2638c4?_0x4b3ed7[_0xde59('0x24')]:_0x276f00[_0xde59('0x21')]+_0x276f00['limit'];var _0x3006c2;if(_0x23f53a>=_0xbbd137){_0x23f53a=_0xbbd137;_0x3006c2=0xc8;}else{_0x3006c2=0xce;}_0x4ce251[_0xde59('0x1e')](_0x3006c2);return _0x4ce251['set']('Content-Range',_0x49a6f3+'-'+_0x23f53a+'/'+_0xbbd137)['json'](_0x4b3ed7);}return null;};}function patchUpdates(_0x11e6d3){return function(_0x3d5d0a){try{jsonpatch[_0xde59('0x25')](_0x3d5d0a,_0x11e6d3,!![]);}catch(_0x8fac5e){return BPromise[_0xde59('0x26')](_0x8fac5e);}return _0x3d5d0a[_0xde59('0x27')]();};}function saveUpdates(_0x47a446,_0x1fa6b2){return function(_0x1eac26){if(_0x1eac26){return _0x1eac26[_0xde59('0x28')](_0x47a446)['then'](function(_0x4d5433){return _0x4d5433;});}return null;};}function removeEntity(_0x4ac9cb,_0x4cf9a0){return function(_0x4cfff9){if(_0x4cfff9){return _0x4cfff9[_0xde59('0x29')]()[_0xde59('0x2a')](function(){_0x4ac9cb[_0xde59('0x1e')](0xcc)[_0xde59('0x1f')]();});}};}function handleEntityNotFound(_0xe3e72f,_0x2b118f){return function(_0x3ca116){if(!_0x3ca116){_0xe3e72f[_0xde59('0x1d')](0x194);}return _0x3ca116;};}function handleError(_0x37ae95,_0x233725){_0x233725=_0x233725||0x1f4;return function(_0x4bec98){logger[_0xde59('0x2b')](_0x4bec98[_0xde59('0x2c')]);if(_0x4bec98[_0xde59('0x2d')]){delete _0x4bec98['name'];}_0x37ae95['status'](_0x233725)['send'](_0x4bec98);};}exports[_0xde59('0x2e')]=function(_0x7a8825,_0x308cfb){var _0x386159={},_0x1ef558={},_0x10f6fe={'count':0x0,'rows':[]};var _0x28b059=_[_0xde59('0x2f')](db[_0xde59('0x30')]['rawAttributes'],function(_0x15a5c0){return{'name':_0x15a5c0['fieldName'],'type':_0x15a5c0[_0xde59('0x31')][_0xde59('0x32')]};});_0x1ef558[_0xde59('0x33')]=_[_0xde59('0x2f')](_0x28b059,'name');_0x1ef558[_0xde59('0x34')]=_[_0xde59('0x35')](_0x7a8825[_0xde59('0x34')]);_0x1ef558[_0xde59('0x36')]=_[_0xde59('0x37')](_0x1ef558[_0xde59('0x33')],_0x1ef558[_0xde59('0x34')]);_0x386159[_0xde59('0x38')]=_[_0xde59('0x37')](_0x1ef558[_0xde59('0x33')],qs[_0xde59('0x39')](_0x7a8825['query'][_0xde59('0x39')]));_0x386159[_0xde59('0x38')]=_0x386159['attributes'][_0xde59('0x3a')]?_0x386159[_0xde59('0x38')]:_0x1ef558[_0xde59('0x33')];if(!_0x7a8825[_0xde59('0x34')][_0xde59('0x3b')]('nolimit')){_0x386159['limit']=qs['limit'](_0x7a8825[_0xde59('0x34')]['limit']);_0x386159['offset']=qs[_0xde59('0x21')](_0x7a8825[_0xde59('0x34')][_0xde59('0x21')]);}_0x386159[_0xde59('0x3c')]=qs[_0xde59('0x3d')](_0x7a8825[_0xde59('0x34')][_0xde59('0x3d')]);_0x386159[_0xde59('0x3e')]=qs[_0xde59('0x36')](_['pick'](_0x7a8825[_0xde59('0x34')],_0x1ef558[_0xde59('0x36')]),_0x28b059);if(_0x7a8825[_0xde59('0x34')][_0xde59('0x3f')]){_0x386159[_0xde59('0x3e')]=_['merge'](_0x386159['where'],{'$or':_[_0xde59('0x2f')](_0x28b059,function(_0x4ac330){if(_0x4ac330[_0xde59('0x31')]!==_0xde59('0x40')){var _0x4bf73a={};_0x4bf73a[_0x4ac330[_0xde59('0x2d')]]={'$like':'%'+_0x7a8825[_0xde59('0x34')][_0xde59('0x3f')]+'%'};return _0x4bf73a;}})});}_0x386159=_[_0xde59('0x41')]({},_0x386159,_0x7a8825[_0xde59('0x42')]);var _0x5b2746={'where':_0x386159['where']};return db[_0xde59('0x30')][_0xde59('0x24')](_0x5b2746)[_0xde59('0x2a')](function(_0x37624f){_0x10f6fe['count']=_0x37624f;if(_0x7a8825['query'][_0xde59('0x43')]){_0x386159[_0xde59('0x44')]=[{'all':!![]}];}return db[_0xde59('0x30')]['findAll'](_0x386159);})[_0xde59('0x2a')](function(_0xd49caa){_0x10f6fe['rows']=_0xd49caa;return _0x10f6fe;})[_0xde59('0x2a')](respondWithFilteredResult(_0x308cfb,_0x386159))[_0xde59('0x45')](handleError(_0x308cfb,null));};exports[_0xde59('0x46')]=function(_0x3b1998,_0x37e59a){var _0xc6f790={'raw':!![],'where':{'id':_0x3b1998[_0xde59('0x47')]['id']}},_0x865e4e={};_0x865e4e[_0xde59('0x33')]=_[_0xde59('0x35')](db[_0xde59('0x30')][_0xde59('0x48')]);_0x865e4e['query']=_[_0xde59('0x35')](_0x3b1998[_0xde59('0x34')]);_0x865e4e[_0xde59('0x36')]=_[_0xde59('0x37')](_0x865e4e[_0xde59('0x33')],_0x865e4e[_0xde59('0x34')]);_0xc6f790[_0xde59('0x38')]=_[_0xde59('0x37')](_0x865e4e[_0xde59('0x33')],qs['fields'](_0x3b1998['query'][_0xde59('0x39')]));_0xc6f790[_0xde59('0x38')]=_0xc6f790['attributes']['length']?_0xc6f790[_0xde59('0x38')]:_0x865e4e[_0xde59('0x33')];if(_0x3b1998[_0xde59('0x34')][_0xde59('0x43')]){_0xc6f790[_0xde59('0x44')]=[{'all':!![]}];}_0xc6f790=_[_0xde59('0x41')]({},_0xc6f790,_0x3b1998[_0xde59('0x42')]);return db[_0xde59('0x30')][_0xde59('0x49')](_0xc6f790)[_0xde59('0x2a')](handleEntityNotFound(_0x37e59a,null))[_0xde59('0x2a')](respondWithResult(_0x37e59a,null))['catch'](handleError(_0x37e59a,null));};exports[_0xde59('0x4a')]=function(_0x1c814f,_0x2d8c3f){return db[_0xde59('0x30')]['create'](_0x1c814f[_0xde59('0x4b')],{})[_0xde59('0x2a')](respondWithResult(_0x2d8c3f,0xc9))['catch'](handleError(_0x2d8c3f,null));};exports['update']=function(_0x2ad504,_0x52c81e){if(_0x2ad504[_0xde59('0x4b')]['id']){delete _0x2ad504[_0xde59('0x4b')]['id'];}return db['VoiceTransferReport'][_0xde59('0x49')]({'where':{'id':_0x2ad504[_0xde59('0x47')]['id']}})[_0xde59('0x2a')](handleEntityNotFound(_0x52c81e,null))[_0xde59('0x2a')](saveUpdates(_0x2ad504[_0xde59('0x4b')],null))['then'](respondWithResult(_0x52c81e,null))[_0xde59('0x45')](handleError(_0x52c81e,null));};exports['destroy']=function(_0x4d5045,_0xbc2abb){return db[_0xde59('0x30')][_0xde59('0x49')]({'where':{'id':_0x4d5045[_0xde59('0x47')]['id']}})[_0xde59('0x2a')](handleEntityNotFound(_0xbc2abb,null))[_0xde59('0x2a')](removeEntity(_0xbc2abb,null))[_0xde59('0x45')](handleError(_0xbc2abb,null));};exports[_0xde59('0x4c')]=function(_0x523f65,_0x765510){return db['VoiceTransferReport'][_0xde59('0x4c')]()[_0xde59('0x2a')](respondWithResult(_0x765510,null))[_0xde59('0x45')](handleError(_0x765510,null));}; \ No newline at end of file +var _0x2dcb=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','stack','name','index','VoiceTransferReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','length','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x94d246,_0x376c5d){var _0x3214bc=function(_0x30efab){while(--_0x30efab){_0x94d246['push'](_0x94d246['shift']());}};_0x3214bc(++_0x376c5d);}(_0x2dcb,0x1cd));var _0xb2dc=function(_0x25e0f0,_0x4322e9){_0x25e0f0=_0x25e0f0-0x0;var _0xf98f1c=_0x2dcb[_0x25e0f0];return _0xf98f1c;};'use strict';var emlformat=require(_0xb2dc('0x0'));var rimraf=require(_0xb2dc('0x1'));var zipdir=require(_0xb2dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb2dc('0x3'));var moment=require(_0xb2dc('0x4'));var BPromise=require(_0xb2dc('0x5'));var Mustache=require(_0xb2dc('0x6'));var util=require(_0xb2dc('0x7'));var path=require(_0xb2dc('0x8'));var sox=require(_0xb2dc('0x9'));var csv=require(_0xb2dc('0xa'));var ejs=require(_0xb2dc('0xb'));var fs=require('fs');var fs_extra=require(_0xb2dc('0xc'));var _=require(_0xb2dc('0xd'));var squel=require(_0xb2dc('0xe'));var crypto=require('crypto');var jsforce=require(_0xb2dc('0xf'));var deskjs=require(_0xb2dc('0x10'));var toCsv=require(_0xb2dc('0xa'));var querystring=require('querystring');var Papa=require(_0xb2dc('0x11'));var Redis=require(_0xb2dc('0x12'));var authService=require(_0xb2dc('0x13'));var qs=require(_0xb2dc('0x14'));var as=require(_0xb2dc('0x15'));var hardwareService=require(_0xb2dc('0x16'));var logger=require(_0xb2dc('0x17'))(_0xb2dc('0x18'));var utils=require(_0xb2dc('0x19'));var config=require(_0xb2dc('0x1a'));var licenseUtil=require(_0xb2dc('0x1b'));var db=require(_0xb2dc('0x1c'))['db'];function respondWithStatusCode(_0x2ed9b7,_0xf33ae3){_0xf33ae3=_0xf33ae3||0xcc;return function(_0x119ae2){if(_0x119ae2){return _0x2ed9b7['sendStatus'](_0xf33ae3);}return _0x2ed9b7[_0xb2dc('0x1d')](_0xf33ae3)[_0xb2dc('0x1e')]();};}function respondWithResult(_0x2a091b,_0x1b3940){_0x1b3940=_0x1b3940||0xc8;return function(_0x5e7f0a){if(_0x5e7f0a){return _0x2a091b[_0xb2dc('0x1d')](_0x1b3940)['json'](_0x5e7f0a);}};}function respondWithFilteredResult(_0x3f8dc3,_0x483e25){return function(_0x1fa4b3){if(_0x1fa4b3){var _0x1cef8d=typeof _0x483e25['offset']==='undefined'&&typeof _0x483e25[_0xb2dc('0x1f')]===_0xb2dc('0x20');var _0x26c7d8=_0x1fa4b3[_0xb2dc('0x21')];var _0x247960=_0x1cef8d?0x0:_0x483e25['offset'];var _0x2ec89a=_0x1cef8d?_0x1fa4b3[_0xb2dc('0x21')]:_0x483e25[_0xb2dc('0x22')]+_0x483e25[_0xb2dc('0x1f')];var _0x1e7759;if(_0x2ec89a>=_0x26c7d8){_0x2ec89a=_0x26c7d8;_0x1e7759=0xc8;}else{_0x1e7759=0xce;}_0x3f8dc3[_0xb2dc('0x1d')](_0x1e7759);return _0x3f8dc3['set'](_0xb2dc('0x23'),_0x247960+'-'+_0x2ec89a+'/'+_0x26c7d8)[_0xb2dc('0x24')](_0x1fa4b3);}return null;};}function patchUpdates(_0x1eb228){return function(_0x439797){try{jsonpatch[_0xb2dc('0x25')](_0x439797,_0x1eb228,!![]);}catch(_0x1b75d8){return BPromise[_0xb2dc('0x26')](_0x1b75d8);}return _0x439797[_0xb2dc('0x27')]();};}function saveUpdates(_0x20a238,_0x5bf7ca){return function(_0x2264a2){if(_0x2264a2){return _0x2264a2[_0xb2dc('0x28')](_0x20a238)['then'](function(_0x2183a1){return _0x2183a1;});}return null;};}function removeEntity(_0x391fcd,_0x21452b){return function(_0x5af6fa){if(_0x5af6fa){return _0x5af6fa[_0xb2dc('0x29')]()[_0xb2dc('0x2a')](function(){_0x391fcd[_0xb2dc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fea2a,_0x5c298c){return function(_0x3c7c16){if(!_0x3c7c16){_0x4fea2a[_0xb2dc('0x2b')](0x194);}return _0x3c7c16;};}function handleError(_0x86af83,_0x2f0372){_0x2f0372=_0x2f0372||0x1f4;return function(_0x586ec9){logger['error'](_0x586ec9[_0xb2dc('0x2c')]);if(_0x586ec9[_0xb2dc('0x2d')]){delete _0x586ec9[_0xb2dc('0x2d')];}_0x86af83[_0xb2dc('0x1d')](_0x2f0372)['send'](_0x586ec9);};}exports[_0xb2dc('0x2e')]=function(_0x674c9a,_0x5f1be8){var _0x409f3a={},_0x522a91={},_0x97f8ff={'count':0x0,'rows':[]};var _0x461ca4=_['map'](db[_0xb2dc('0x2f')]['rawAttributes'],function(_0x55082b){return{'name':_0x55082b[_0xb2dc('0x30')],'type':_0x55082b[_0xb2dc('0x31')][_0xb2dc('0x32')]};});_0x522a91['model']=_['map'](_0x461ca4,_0xb2dc('0x2d'));_0x522a91[_0xb2dc('0x33')]=_[_0xb2dc('0x34')](_0x674c9a[_0xb2dc('0x33')]);_0x522a91[_0xb2dc('0x35')]=_[_0xb2dc('0x36')](_0x522a91[_0xb2dc('0x37')],_0x522a91['query']);_0x409f3a['attributes']=_['intersection'](_0x522a91[_0xb2dc('0x37')],qs[_0xb2dc('0x38')](_0x674c9a['query']['fields']));_0x409f3a[_0xb2dc('0x39')]=_0x409f3a[_0xb2dc('0x39')]['length']?_0x409f3a['attributes']:_0x522a91[_0xb2dc('0x37')];if(!_0x674c9a[_0xb2dc('0x33')][_0xb2dc('0x3a')](_0xb2dc('0x3b'))){_0x409f3a[_0xb2dc('0x1f')]=qs[_0xb2dc('0x1f')](_0x674c9a['query']['limit']);_0x409f3a[_0xb2dc('0x22')]=qs[_0xb2dc('0x22')](_0x674c9a[_0xb2dc('0x33')][_0xb2dc('0x22')]);}_0x409f3a[_0xb2dc('0x3c')]=qs['sort'](_0x674c9a[_0xb2dc('0x33')][_0xb2dc('0x3d')]);_0x409f3a[_0xb2dc('0x3e')]=qs[_0xb2dc('0x35')](_['pick'](_0x674c9a[_0xb2dc('0x33')],_0x522a91[_0xb2dc('0x35')]),_0x461ca4);if(_0x674c9a[_0xb2dc('0x33')][_0xb2dc('0x3f')]){_0x409f3a[_0xb2dc('0x3e')]=_['merge'](_0x409f3a[_0xb2dc('0x3e')],{'$or':_[_0xb2dc('0x40')](_0x461ca4,function(_0x57277d){if(_0x57277d[_0xb2dc('0x31')]!==_0xb2dc('0x41')){var _0x2fd7cb={};_0x2fd7cb[_0x57277d[_0xb2dc('0x2d')]]={'$like':'%'+_0x674c9a[_0xb2dc('0x33')][_0xb2dc('0x3f')]+'%'};return _0x2fd7cb;}})});}_0x409f3a=_[_0xb2dc('0x42')]({},_0x409f3a,_0x674c9a[_0xb2dc('0x43')]);var _0x3ff8bb={'where':_0x409f3a[_0xb2dc('0x3e')]};return db['VoiceTransferReport'][_0xb2dc('0x21')](_0x3ff8bb)['then'](function(_0x5d008d){_0x97f8ff[_0xb2dc('0x21')]=_0x5d008d;if(_0x674c9a['query'][_0xb2dc('0x44')]){_0x409f3a[_0xb2dc('0x45')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xb2dc('0x46')](_0x409f3a);})[_0xb2dc('0x2a')](function(_0x54b7dc){_0x97f8ff['rows']=_0x54b7dc;return _0x97f8ff;})['then'](respondWithFilteredResult(_0x5f1be8,_0x409f3a))['catch'](handleError(_0x5f1be8,null));};exports['show']=function(_0x76cf4b,_0x51d3e1){var _0x345de4={'raw':!![],'where':{'id':_0x76cf4b['params']['id']}},_0x20e96f={};_0x20e96f[_0xb2dc('0x37')]=_[_0xb2dc('0x34')](db[_0xb2dc('0x2f')]['rawAttributes']);_0x20e96f[_0xb2dc('0x33')]=_[_0xb2dc('0x34')](_0x76cf4b[_0xb2dc('0x33')]);_0x20e96f[_0xb2dc('0x35')]=_[_0xb2dc('0x36')](_0x20e96f['model'],_0x20e96f['query']);_0x345de4[_0xb2dc('0x39')]=_[_0xb2dc('0x36')](_0x20e96f[_0xb2dc('0x37')],qs['fields'](_0x76cf4b[_0xb2dc('0x33')][_0xb2dc('0x38')]));_0x345de4[_0xb2dc('0x39')]=_0x345de4[_0xb2dc('0x39')][_0xb2dc('0x47')]?_0x345de4[_0xb2dc('0x39')]:_0x20e96f[_0xb2dc('0x37')];if(_0x76cf4b[_0xb2dc('0x33')]['includeAll']){_0x345de4[_0xb2dc('0x45')]=[{'all':!![]}];}_0x345de4=_['merge']({},_0x345de4,_0x76cf4b[_0xb2dc('0x43')]);return db[_0xb2dc('0x2f')][_0xb2dc('0x48')](_0x345de4)[_0xb2dc('0x2a')](handleEntityNotFound(_0x51d3e1,null))[_0xb2dc('0x2a')](respondWithResult(_0x51d3e1,null))[_0xb2dc('0x49')](handleError(_0x51d3e1,null));};exports[_0xb2dc('0x4a')]=function(_0x21426a,_0x517297){return db[_0xb2dc('0x2f')][_0xb2dc('0x4a')](_0x21426a[_0xb2dc('0x4b')],{})['then'](respondWithResult(_0x517297,0xc9))[_0xb2dc('0x49')](handleError(_0x517297,null));};exports[_0xb2dc('0x28')]=function(_0x51acb0,_0x4299a0){if(_0x51acb0[_0xb2dc('0x4b')]['id']){delete _0x51acb0[_0xb2dc('0x4b')]['id'];}return db[_0xb2dc('0x2f')][_0xb2dc('0x48')]({'where':{'id':_0x51acb0['params']['id']}})[_0xb2dc('0x2a')](handleEntityNotFound(_0x4299a0,null))[_0xb2dc('0x2a')](saveUpdates(_0x51acb0[_0xb2dc('0x4b')],null))[_0xb2dc('0x2a')](respondWithResult(_0x4299a0,null))['catch'](handleError(_0x4299a0,null));};exports[_0xb2dc('0x29')]=function(_0x50c1d7,_0x4ad2b){return db[_0xb2dc('0x2f')][_0xb2dc('0x48')]({'where':{'id':_0x50c1d7[_0xb2dc('0x4c')]['id']}})[_0xb2dc('0x2a')](handleEntityNotFound(_0x4ad2b,null))[_0xb2dc('0x2a')](removeEntity(_0x4ad2b,null))[_0xb2dc('0x49')](handleError(_0x4ad2b,null));};exports[_0xb2dc('0x4d')]=function(_0x41d85b,_0x48d611){return db[_0xb2dc('0x2f')][_0xb2dc('0x4d')]()[_0xb2dc('0x2a')](respondWithResult(_0x48d611,null))[_0xb2dc('0x49')](handleError(_0x48d611,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 6252f85..023cf54 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 _0x55e6=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x13f12a,_0xdd812){var _0x111434=function(_0x1b64f5){while(--_0x1b64f5){_0x13f12a['push'](_0x13f12a['shift']());}};_0x111434(++_0xdd812);}(_0x55e6,0x155));var _0x655e=function(_0x27a198,_0x5e501d){_0x27a198=_0x27a198-0x0;var _0x42f6d9=_0x55e6[_0x27a198];return _0x42f6d9;};'use strict';var _=require(_0x655e('0x0'));var util=require(_0x655e('0x1'));var logger=require(_0x655e('0x2'))(_0x655e('0x3'));var moment=require(_0x655e('0x4'));var BPromise=require('bluebird');var rp=require(_0x655e('0x5'));var fs=require('fs');var path=require(_0x655e('0x6'));var rimraf=require(_0x655e('0x7'));var config=require(_0x655e('0x8'));var attributes=require(_0x655e('0x9'));module[_0x655e('0xa')]=function(_0x1b36ab,_0x52c1a2){return _0x1b36ab[_0x655e('0xb')](_0x655e('0xc'),attributes,{'tableName':_0x655e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0b1=['../../config/logger','api','request-promise','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0xa0b1,0x195));var _0x1a0b=function(_0x349077,_0x2eafb1){_0x349077=_0x349077-0x0;var _0x277000=_0xa0b1[_0x349077];return _0x277000;};'use strict';var _=require(_0x1a0b('0x0'));var util=require(_0x1a0b('0x1'));var logger=require(_0x1a0b('0x2'))(_0x1a0b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1a0b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a0b('0x5'));var attributes=require(_0x1a0b('0x6'));module[_0x1a0b('0x7')]=function(_0x2a8f4d,_0x59e1d6){return _0x2a8f4d[_0x1a0b('0x8')](_0x1a0b('0x9'),attributes,{'tableName':_0x1a0b('0xa'),'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 4b81b54..25af6df 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 _0x42b8=['raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceTransferReport','create','body','options'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0x42b8,0x71));var _0x842b=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x42b8[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0x842b('0x0'));var moment=require(_0x842b('0x1'));var BPromise=require(_0x842b('0x2'));var rs=require(_0x842b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x842b('0x4'))['db'];var utils=require(_0x842b('0x5'));var logger=require(_0x842b('0x6'))(_0x842b('0x7'));var config=require('../../config/environment');var jayson=require(_0x842b('0x8'));var client=jayson[_0x842b('0x9')][_0x842b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbad2ca,_0x445fd9,_0x224129){return new BPromise(function(_0x38d029,_0x3a85e4){return client[_0x842b('0xb')](_0xbad2ca,_0x224129)['then'](function(_0x137f64){logger[_0x842b('0xc')](_0x842b('0xd'),_0x445fd9,'request\x20sent');logger[_0x842b('0xe')](_0x842b('0xf'),_0x445fd9,_0x842b('0x10'),JSON[_0x842b('0x11')](_0x137f64));if(_0x137f64[_0x842b('0x12')]){if(_0x137f64[_0x842b('0x12')][_0x842b('0x13')]===0x1f4){logger['error'](_0x842b('0xd'),_0x445fd9,_0x137f64[_0x842b('0x12')][_0x842b('0x14')]);return _0x3a85e4(_0x137f64[_0x842b('0x12')][_0x842b('0x14')]);}logger[_0x842b('0x12')](_0x842b('0xd'),_0x445fd9,_0x137f64[_0x842b('0x12')][_0x842b('0x14')]);return _0x38d029(_0x137f64[_0x842b('0x12')][_0x842b('0x14')]);}else{logger[_0x842b('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x445fd9,_0x842b('0x10'));_0x38d029(_0x137f64[_0x842b('0x15')][_0x842b('0x14')]);}})[_0x842b('0x16')](function(_0x261532){logger[_0x842b('0x12')](_0x842b('0xd'),_0x445fd9,_0x261532);_0x3a85e4(_0x261532);});});}exports[_0x842b('0x17')]=function(_0x1e05c1){var _0x17802f=this;return new Promise(function(_0x4d4e71,_0x506aee){return db['VoiceTransferReport'][_0x842b('0x18')](_0x1e05c1[_0x842b('0x19')],{'raw':_0x1e05c1[_0x842b('0x1a')]?_0x1e05c1['options'][_0x842b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4bbaef){logger[_0x842b('0xc')](_0x842b('0x17'),_0x1e05c1);logger[_0x842b('0xe')](_0x842b('0x17'),_0x1e05c1,JSON[_0x842b('0x11')](_0x4bbaef));_0x4d4e71(_0x4bbaef);})[_0x842b('0x16')](function(_0x2cca35){logger['error'](_0x842b('0x17'),_0x2cca35['message'],_0x1e05c1);_0x506aee(_0x17802f['error'](0x1f4,_0x2cca35[_0x842b('0x14')]));});});}; \ No newline at end of file +var _0x26d2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','debug','util'];(function(_0x2b8240,_0xf3b75a){var _0x2b06c6=function(_0x341433){while(--_0x341433){_0x2b8240['push'](_0x2b8240['shift']());}};_0x2b06c6(++_0xf3b75a);}(_0x26d2,0x10d));var _0x226d=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x26d2[_0x540dcb];return _0x49353c;};'use strict';var _=require('lodash');var util=require(_0x226d('0x0'));var moment=require(_0x226d('0x1'));var BPromise=require(_0x226d('0x2'));var rs=require(_0x226d('0x3'));var fs=require('fs');var Redis=require(_0x226d('0x4'));var db=require(_0x226d('0x5'))['db'];var utils=require(_0x226d('0x6'));var logger=require('../../config/logger')(_0x226d('0x7'));var config=require(_0x226d('0x8'));var jayson=require(_0x226d('0x9'));var client=jayson['client'][_0x226d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe39385,_0x4b4048,_0x528b09){return new BPromise(function(_0x3eb33f,_0x4e49b0){return client['request'](_0xe39385,_0x528b09)[_0x226d('0xb')](function(_0x2244f6){logger[_0x226d('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x4b4048,_0x226d('0xd'));logger['debug'](_0x226d('0xe'),_0x4b4048,_0x226d('0xd'),JSON[_0x226d('0xf')](_0x2244f6));if(_0x2244f6[_0x226d('0x10')]){if(_0x2244f6['error']['code']===0x1f4){logger[_0x226d('0x10')](_0x226d('0x11'),_0x4b4048,_0x2244f6[_0x226d('0x10')][_0x226d('0x12')]);return _0x4e49b0(_0x2244f6[_0x226d('0x10')]['message']);}logger[_0x226d('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x4b4048,_0x2244f6[_0x226d('0x10')][_0x226d('0x12')]);return _0x3eb33f(_0x2244f6[_0x226d('0x10')]['message']);}else{logger[_0x226d('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x4b4048,_0x226d('0xd'));_0x3eb33f(_0x2244f6[_0x226d('0x13')]['message']);}})[_0x226d('0x14')](function(_0x265178){logger['error'](_0x226d('0x11'),_0x4b4048,_0x265178);_0x4e49b0(_0x265178);});});}exports[_0x226d('0x15')]=function(_0x2c8a1a){var _0x2a09df=this;return new Promise(function(_0x512e18,_0x46337c){return db[_0x226d('0x16')][_0x226d('0x17')](_0x2c8a1a[_0x226d('0x18')],{'raw':_0x2c8a1a['options']?_0x2c8a1a[_0x226d('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x226d('0xb')](function(_0x1a0619){logger[_0x226d('0xc')](_0x226d('0x15'),_0x2c8a1a);logger[_0x226d('0x1a')](_0x226d('0x15'),_0x2c8a1a,JSON[_0x226d('0xf')](_0x1a0619));_0x512e18(_0x1a0619);})[_0x226d('0x14')](function(_0xea3de4){logger[_0x226d('0x10')]('CreateVoiceTransferReport',_0xea3de4[_0x226d('0x12')],_0x2c8a1a);_0x46337c(_0x2a09df[_0x226d('0x10')](0x1f4,_0xea3de4['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 8fc2346..271e8c8 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 _0x163a=['/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','/hold','hold','unhold','/calls','/transfer','transfer','exports','express','Router','../../components/auth/service','post'];(function(_0x55db0d,_0x3cebed){var _0x217ab1=function(_0x41f432){while(--_0x41f432){_0x55db0d['push'](_0x55db0d['shift']());}};_0x217ab1(++_0x3cebed);}(_0x163a,0xe0));var _0xa163=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x163a[_0x3a6e4b];return _0x36572d;};'use strict';var express=require(_0xa163('0x0'));var router=express[_0xa163('0x1')]();var auth=require(_0xa163('0x2'));var controller=require('./webbar.controller');router[_0xa163('0x3')](_0xa163('0x4'),auth[_0xa163('0x5')](),auth[_0xa163('0x6')](),controller[_0xa163('0x7')]);router[_0xa163('0x3')](_0xa163('0x8'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xa163('0x9')]);router[_0xa163('0x3')](_0xa163('0xa'),auth[_0xa163('0x5')](),auth[_0xa163('0x6')](),controller[_0xa163('0xb')]);router[_0xa163('0x3')](_0xa163('0xc'),auth[_0xa163('0x5')](),auth[_0xa163('0x6')](),controller[_0xa163('0xd')]);router[_0xa163('0x3')]('/unhold',auth[_0xa163('0x5')](),auth['canUpdate'](),controller[_0xa163('0xe')]);router[_0xa163('0x3')](_0xa163('0xf'),auth['isAuthenticated'](),auth['canUpdate'](),controller['calls']);router['post'](_0xa163('0x10'),auth['isAuthenticated'](),auth[_0xa163('0x6')](),controller[_0xa163('0x11')]);module[_0xa163('0x12')]=router; \ No newline at end of file +var _0xdf8e=['hangup','/answer','answer','/hold','hold','/unhold','unhold','/calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','originate','/hangup','isAuthenticated','canUpdate'];(function(_0x271e42,_0x4650af){var _0x2b0193=function(_0x2577bc){while(--_0x2577bc){_0x271e42['push'](_0x271e42['shift']());}};_0x2b0193(++_0x4650af);}(_0xdf8e,0x101));var _0xedf8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xdf8e[_0x502c7d];return _0x30b7ed;};'use strict';var express=require(_0xedf8('0x0'));var router=express['Router']();var auth=require(_0xedf8('0x1'));var controller=require(_0xedf8('0x2'));router[_0xedf8('0x3')](_0xedf8('0x4'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xedf8('0x5')]);router[_0xedf8('0x3')](_0xedf8('0x6'),auth[_0xedf8('0x7')](),auth[_0xedf8('0x8')](),controller[_0xedf8('0x9')]);router['post'](_0xedf8('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xedf8('0xb')]);router['post'](_0xedf8('0xc'),auth['isAuthenticated'](),auth[_0xedf8('0x8')](),controller[_0xedf8('0xd')]);router[_0xedf8('0x3')](_0xedf8('0xe'),auth[_0xedf8('0x7')](),auth['canUpdate'](),controller[_0xedf8('0xf')]);router['post'](_0xedf8('0x10'),auth[_0xedf8('0x7')](),auth[_0xedf8('0x8')](),controller['calls']);router['post'](_0xedf8('0x11'),auth[_0xedf8('0x7')](),auth['canUpdate'](),controller['transfer']);module[_0xedf8('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index d3cb7b5..b8761cc 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 _0x49e9=['transferNumber\x20is\x20required','info','emit','log','handleError:','stack','name','status','send','NotFound','then','code','error','message','result','catch','User','agent','VoiceChannels','all','filter','rows','\x20not\x20found!','originate','originate\x20fired:','body','length','userId','callerId','callbackUrl','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','user:%s','answer','sessionId','entityFound:','webbar:answer','hold','hold\x20fired:','format','webbar:hold','hold\x20executed!','calls','UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','http','webbarapi','ioredis','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required'];(function(_0x141a0d,_0x148eaa){var _0x3ccf61=function(_0x25e6e7){while(--_0x25e6e7){_0x141a0d['push'](_0x141a0d['shift']());}};_0x3ccf61(++_0x148eaa);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var path=require(_0x949e('0x0'));var fs=require('fs');var _=require(_0x949e('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x949e('0x2'));var util=require(_0x949e('0x3'));var BPromise=require(_0x949e('0x4'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x949e('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x949e('0x6'));var Redis=require(_0x949e('0x7'));config[_0x949e('0x8')]=_['defaults'](config[_0x949e('0x8')],{'host':_0x949e('0x9'),'port':0x18eb});var io=require(_0x949e('0xa'))(new Redis(config[_0x949e('0x8')]));var Schema=require(_0x949e('0xb'));var originateValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'callNumber':{'type':'string','required':[!![],_0x949e('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x949e('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'sessionId':{'type':_0x949e('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'sessionId':{'type':_0x949e('0xf'),'required':[!![],_0x949e('0x10')]},'transferNumber':{'type':_0x949e('0xf'),'required':[!![],_0x949e('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'sessionId':{'type':_0x949e('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'sessionId':{'type':_0x949e('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x949e('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]}});function emit(_0xf1f41a,_0x5f5962,_0x420733){logger[_0x949e('0x12')](_0xf1f41a,_0x5f5962,JSON['stringify'](_0x420733));io['to'](_0xf1f41a)[_0x949e('0x13')](_0x5f5962,_0x420733);}function handleError(_0x175d62){return function(_0x43498d){console[_0x949e('0x14')](_0x949e('0x15'),_0x43498d,_0x43498d instanceof RangeError);logger['error'](_0x43498d[_0x949e('0x16')]);if(_0x43498d instanceof RangeError){if(_0x43498d[_0x949e('0x17')]){delete _0x43498d[_0x949e('0x17')];}_0x175d62[_0x949e('0x18')](0x194)[_0x949e('0x19')](_0x43498d);}else{if(_0x43498d[_0x949e('0x17')]){delete _0x43498d[_0x949e('0x17')];}_0x175d62[_0x949e('0x18')](0x1f4)[_0x949e('0x19')](_0x43498d);}};}function checkError(){return function(_0x39ad61){if(!_0x39ad61){throw new RangeError(_0x949e('0x1a'));}return _0x39ad61;};}function respondWithRpcPromise(_0x260c1c,_0x1e3a79){return new BPromise(function(_0x1927ab,_0x199d53){var _0x2e81f2=amiClient;return _0x2e81f2['request'](_0x260c1c,_0x1e3a79)[_0x949e('0x1b')](function(_0x44ffb4){if(_0x44ffb4['error']){if(_0x44ffb4['error'][_0x949e('0x1c')]===0x1f4){return _0x199d53(_0x44ffb4[_0x949e('0x1d')][_0x949e('0x1e')]);}return _0x1927ab(_0x44ffb4[_0x949e('0x1d')][_0x949e('0x1e')]);}else{_0x1927ab(_0x44ffb4[_0x949e('0x1f')]);}})[_0x949e('0x20')](function(_0x255b11){_0x199d53(_0x255b11);});});}function getAgent(_0x3468ac){return db[_0x949e('0x21')]['findOne']({'where':{'id':_0x3468ac,'role':_0x949e('0x22')}})[_0x949e('0x1b')](checkError());}function getAgentCheckSession(_0x59b3a1,_0x39308f){return new BPromise(function(_0x20061d,_0x55d56a){var _0x446401=respondWithRpcPromise(_0x949e('0x23'));var _0x5b9f28=getAgent(_0x59b3a1);Promise[_0x949e('0x24')]([_0x446401,_0x5b9f28])['then'](function(_0x5e6e34){var _0x4e169d=_0x5e6e34[0x0];var _0x54ad5d=_0x5e6e34[0x1];var _0x52f5bd=_[_0x949e('0x25')](_0x4e169d[_0x949e('0x26')],function(_0x3051ec){return _0x3051ec['UserId']==_0x54ad5d['id']&&_0x3051ec['sessionId']==_0x39308f;});if(_0x52f5bd['length']==0x1){_0x20061d(_0x54ad5d);}else{_0x55d56a(new RangeError('sessionId\x20'+_0x39308f+_0x949e('0x27')));}});});}exports[_0x949e('0x28')]=function(_0xcfd5a6,_0x1fe31b){logger['info'](_0x949e('0x29'),_0xcfd5a6[_0x949e('0x2a')]);var _0xad8500=originateValidation['validate'](_0xcfd5a6[_0x949e('0x2a')]);if(_0xad8500[_0x949e('0x2b')]>0x0){return _0x1fe31b[_0x949e('0x18')](0x190)['json'](_0xad8500);}var _0x5b7d77=_0xcfd5a6[_0x949e('0x2a')][_0x949e('0x2c')];var _0x25d65a=_0xcfd5a6[_0x949e('0x2a')]['callNumber'];var _0x15a63f=_0xcfd5a6[_0x949e('0x2a')][_0x949e('0x2d')];var _0x41b8d7=_0xcfd5a6[_0x949e('0x2a')][_0x949e('0x2e')];return getAgent(_0x5b7d77)[_0x949e('0x1b')](function(_0xe6c996){logger['info']('entityFound:',_0xe6c996[_0x949e('0x17')]);emit(util['format']('user:%s',_0xe6c996[_0x949e('0x17')]),_0x949e('0x2f'),{'callNumber':_0x25d65a,'callerId':_0x15a63f,'callbackUrl':_0x41b8d7});return _0x1fe31b[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':_0x949e('0x31')});})[_0x949e('0x20')](handleError(_0x1fe31b));};exports[_0x949e('0x32')]=function(_0x49bf64,_0x21bd17){logger[_0x949e('0x12')](_0x949e('0x33'),_0x49bf64[_0x949e('0x2a')]);var _0x39c90b=hangupValidation[_0x949e('0xb')](_0x49bf64[_0x949e('0x2a')]);if(_0x39c90b[_0x949e('0x2b')]>0x0){return _0x21bd17[_0x949e('0x18')](0x190)['json'](_0x39c90b);}var _0x34bcd5=_0x49bf64['body'][_0x949e('0x2c')];var _0x2b112a=_0x49bf64['body']['sessionId'];return getAgent(_0x34bcd5)['then'](function(_0x1e848c){logger[_0x949e('0x12')]('entityFound:',_0x1e848c['name']);emit(util['format'](_0x949e('0x34'),_0x1e848c[_0x949e('0x17')]),'webbar:hangup',{'sessionId':_0x2b112a});return _0x21bd17[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':'hangup\x20executed!'});})[_0x949e('0x20')](handleError(_0x21bd17));};exports[_0x949e('0x35')]=function(_0x3db452,_0xb384ed){logger['info']('answer\x20fired:',_0x3db452[_0x949e('0x2a')]);var _0x590aa7=answerValidation[_0x949e('0xb')](_0x3db452[_0x949e('0x2a')]);if(_0x590aa7[_0x949e('0x2b')]>0x0){return _0xb384ed[_0x949e('0x18')](0x190)[_0x949e('0x30')](_0x590aa7);}var _0x572f20=_0x3db452['body'][_0x949e('0x2c')];var _0x5e970b=_0x3db452[_0x949e('0x2a')][_0x949e('0x36')];return getAgent(_0x572f20)[_0x949e('0x1b')](function(_0x2fdfe6){logger[_0x949e('0x12')](_0x949e('0x37'),_0x2fdfe6['name']);emit(util['format'](_0x949e('0x34'),_0x2fdfe6[_0x949e('0x17')]),_0x949e('0x38'),{'sessionId':_0x5e970b});return _0xb384ed[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':'answer\x20executed!'});})[_0x949e('0x20')](handleError(_0xb384ed));};exports[_0x949e('0x39')]=function(_0x5b3086,_0x216789){logger[_0x949e('0x12')](_0x949e('0x3a'),_0x5b3086[_0x949e('0x2a')]);var _0x1f1e69=holdValidation[_0x949e('0xb')](_0x5b3086[_0x949e('0x2a')]);if(_0x1f1e69[_0x949e('0x2b')]>0x0){return _0x216789[_0x949e('0x18')](0x190)['json'](_0x1f1e69);}var _0x1599ea=_0x5b3086['body'][_0x949e('0x2c')];var _0x24c7a6=_0x5b3086['body'][_0x949e('0x36')];return getAgent(_0x1599ea)[_0x949e('0x1b')](function(_0x121355){logger[_0x949e('0x12')](_0x949e('0x37'),_0x121355[_0x949e('0x17')]);emit(util[_0x949e('0x3b')](_0x949e('0x34'),_0x121355['name']),_0x949e('0x3c'),{'sessionId':_0x24c7a6});return _0x216789[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':_0x949e('0x3d')});})[_0x949e('0x20')](handleError(_0x216789));};exports['unhold']=function(_0x5f23b2,_0x46a4fe){logger[_0x949e('0x12')]('unhold\x20fired:',_0x5f23b2[_0x949e('0x2a')]);var _0xdeefe1=unholdValidation[_0x949e('0xb')](_0x5f23b2[_0x949e('0x2a')]);if(_0xdeefe1['length']>0x0){return _0x46a4fe['status'](0x190)[_0x949e('0x30')](_0xdeefe1);}var _0x46d687=_0x5f23b2[_0x949e('0x2a')][_0x949e('0x2c')];var _0x16ec1b=_0x5f23b2[_0x949e('0x2a')][_0x949e('0x36')];return getAgent(_0x46d687)[_0x949e('0x1b')](function(_0x21477f){logger['info'](_0x949e('0x37'),_0x21477f['name']);emit(util[_0x949e('0x3b')]('user:%s',_0x21477f[_0x949e('0x17')]),'webbar:unhold',{'sessionId':_0x16ec1b});return _0x46a4fe[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':'unhold\x20executed!'});})[_0x949e('0x20')](handleError(_0x46a4fe));};exports[_0x949e('0x3e')]=function(_0x2eb9f9,_0x2a5e99){logger[_0x949e('0x12')]('calls\x20fired:',_0x2a5e99['body']);var _0x287a45=callsValidation[_0x949e('0xb')](_0x2eb9f9['body']);if(_0x287a45[_0x949e('0x2b')]>0x0){return _0x2a5e99[_0x949e('0x18')](0x190)['json'](_0x287a45);}var _0x195371=_0x2eb9f9[_0x949e('0x2a')][_0x949e('0x2c')];var _0x2d7397=respondWithRpcPromise(_0x949e('0x23'));var _0x41798a=getAgent(_0x195371);return Promise[_0x949e('0x24')]([_0x2d7397,_0x41798a])[_0x949e('0x1b')](function(_0x394b92){var _0x7dd940=_0x394b92[0x0];var _0x8cc24a=_0x394b92[0x1];var _0x1561b2=_[_0x949e('0x25')](_0x7dd940[_0x949e('0x26')],function(_0x1284ec){return _0x1284ec[_0x949e('0x3f')]==_0x8cc24a['id'];});return _0x2a5e99[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'count':_0x1561b2['length'],'rows':_0x1561b2});})[_0x949e('0x20')](handleError(_0x2a5e99));};exports['conference']=function(_0x5520cd,_0x1bc2bb){logger[_0x949e('0x12')](_0x949e('0x40'),_0x5520cd['body']);var _0xa07383=conferenceValidation[_0x949e('0xb')](_0x5520cd[_0x949e('0x2a')]);if(_0xa07383['length']>0x0){return _0x1bc2bb[_0x949e('0x18')](0x190)[_0x949e('0x30')](_0xa07383);}var _0x23a1c5=_0x5520cd['body'][_0x949e('0x2c')];return getAgent(_0x23a1c5)[_0x949e('0x1b')](function(_0x4073e9){logger[_0x949e('0x12')](_0x949e('0x37'),_0x4073e9[_0x949e('0x17')]);emit(util['format'](_0x949e('0x34'),_0x4073e9[_0x949e('0x17')]),_0x949e('0x41'));return _0x1bc2bb['status'](0xc8)['json']({'error':![],'message':_0x949e('0x42')});})['catch'](handleError(_0x1bc2bb));};exports[_0x949e('0x43')]=function(_0xcc3e22,_0x226576){logger[_0x949e('0x12')](_0x949e('0x44'),_0xcc3e22[_0x949e('0x2a')]);var _0x5ebbe3=transferValidation[_0x949e('0xb')](_0xcc3e22[_0x949e('0x2a')]);if(_0x5ebbe3[_0x949e('0x2b')]>0x0){return _0x226576[_0x949e('0x18')](0x190)[_0x949e('0x30')](_0x5ebbe3);}var _0x470e2a=_0xcc3e22['body'][_0x949e('0x2c')];var _0x1a1ebd=_0xcc3e22['body']['sessionId'];var _0x6ecca9=_0xcc3e22['body'][_0x949e('0x45')];return getAgent(_0x470e2a)['then'](function(_0x5c4c4c){logger[_0x949e('0x12')](_0x949e('0x37'),_0x5c4c4c[_0x949e('0x17')]);emit(util[_0x949e('0x3b')](_0x949e('0x34'),_0x5c4c4c[_0x949e('0x17')]),_0x949e('0x46'),{'sessionId':_0x1a1ebd,'transferNumber':_0x6ecca9});return _0x226576[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':_0x949e('0x47')});})[_0x949e('0x20')](handleError(_0x226576));}; \ No newline at end of file +var _0xb0b9=['User','agent','VoiceChannels','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','validate','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','calls','calls\x20fired:','filter','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','NotFound','then','code','message','catch'];(function(_0x1aef75,_0x4a570a){var _0x6b77c0=function(_0x50db3e){while(--_0x50db3e){_0x1aef75['push'](_0x1aef75['shift']());}};_0x6b77c0(++_0x4a570a);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x3d1b69,_0x3a8098){_0x3d1b69=_0x3d1b69-0x0;var _0x2e493f=_0xb0b9[_0x3d1b69];return _0x2e493f;};'use strict';var path=require(_0x9b0b('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0x9b0b('0x1'));var util=require(_0x9b0b('0x2'));var BPromise=require(_0x9b0b('0x3'));var jayson=require(_0x9b0b('0x4'));var amiClient=jayson[_0x9b0b('0x5')][_0x9b0b('0x6')]({'port':0x232a});var logger=require(_0x9b0b('0x7'))(_0x9b0b('0x8'));var Redis=require(_0x9b0b('0x9'));config[_0x9b0b('0xa')]=_[_0x9b0b('0xb')](config[_0x9b0b('0xa')],{'host':_0x9b0b('0xc'),'port':0x18eb});var io=require(_0x9b0b('0xd'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]},'callNumber':{'type':_0x9b0b('0x10'),'required':[!![],_0x9b0b('0x11')]},'callerId':{'type':_0x9b0b('0x10')},'callbackUrl':{'type':_0x9b0b('0x10')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':_0x9b0b('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':'string','required':[!![],_0x9b0b('0x12')]},'transferNumber':{'type':'string','required':[!![],_0x9b0b('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':_0x9b0b('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9b0b('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]}});function emit(_0x1e92c1,_0x4665d8,_0x12f1b9){logger[_0x9b0b('0x14')](_0x1e92c1,_0x4665d8,JSON[_0x9b0b('0x15')](_0x12f1b9));io['to'](_0x1e92c1)[_0x9b0b('0x16')](_0x4665d8,_0x12f1b9);}function handleError(_0xcab079){return function(_0x264b6d){console[_0x9b0b('0x17')](_0x9b0b('0x18'),_0x264b6d,_0x264b6d instanceof RangeError);logger[_0x9b0b('0x19')](_0x264b6d['stack']);if(_0x264b6d instanceof RangeError){if(_0x264b6d[_0x9b0b('0x1a')]){delete _0x264b6d[_0x9b0b('0x1a')];}_0xcab079[_0x9b0b('0x1b')](0x194)['send'](_0x264b6d);}else{if(_0x264b6d[_0x9b0b('0x1a')]){delete _0x264b6d[_0x9b0b('0x1a')];}_0xcab079[_0x9b0b('0x1b')](0x1f4)['send'](_0x264b6d);}};}function checkError(){return function(_0x3f19ae){if(!_0x3f19ae){throw new RangeError(_0x9b0b('0x1c'));}return _0x3f19ae;};}function respondWithRpcPromise(_0x27b8e3,_0x16c8f9){return new BPromise(function(_0x4fe0a2,_0x30bfe8){var _0x408f70=amiClient;return _0x408f70['request'](_0x27b8e3,_0x16c8f9)[_0x9b0b('0x1d')](function(_0x1e7789){if(_0x1e7789[_0x9b0b('0x19')]){if(_0x1e7789[_0x9b0b('0x19')][_0x9b0b('0x1e')]===0x1f4){return _0x30bfe8(_0x1e7789[_0x9b0b('0x19')][_0x9b0b('0x1f')]);}return _0x4fe0a2(_0x1e7789[_0x9b0b('0x19')][_0x9b0b('0x1f')]);}else{_0x4fe0a2(_0x1e7789['result']);}})[_0x9b0b('0x20')](function(_0x22a136){_0x30bfe8(_0x22a136);});});}function getAgent(_0x246652){return db[_0x9b0b('0x21')]['findOne']({'where':{'id':_0x246652,'role':_0x9b0b('0x22')}})[_0x9b0b('0x1d')](checkError());}function getAgentCheckSession(_0x5c9ec3,_0x2841fc){return new BPromise(function(_0x1e25fb,_0x1a31ba){var _0x47a135=respondWithRpcPromise(_0x9b0b('0x23'));var _0xa4f392=getAgent(_0x5c9ec3);Promise[_0x9b0b('0x24')]([_0x47a135,_0xa4f392])['then'](function(_0x2575d8){var _0x32668d=_0x2575d8[0x0];var _0x21b533=_0x2575d8[0x1];var _0x22ce12=_['filter'](_0x32668d[_0x9b0b('0x25')],function(_0xfa71df){return _0xfa71df['UserId']==_0x21b533['id']&&_0xfa71df[_0x9b0b('0x26')]==_0x2841fc;});if(_0x22ce12[_0x9b0b('0x27')]==0x1){_0x1e25fb(_0x21b533);}else{_0x1a31ba(new RangeError(_0x9b0b('0x28')+_0x2841fc+_0x9b0b('0x29')));}});});}exports[_0x9b0b('0x2a')]=function(_0x26e90c,_0xfd6ce){logger[_0x9b0b('0x14')]('originate\x20fired:',_0x26e90c['body']);var _0x3fcf01=originateValidation['validate'](_0x26e90c[_0x9b0b('0x2b')]);if(_0x3fcf01['length']>0x0){return _0xfd6ce['status'](0x190)['json'](_0x3fcf01);}var _0x40e4c3=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x212b85=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2d')];var _0x2938ff=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2e')];var _0x444d20=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2f')];return getAgent(_0x40e4c3)[_0x9b0b('0x1d')](function(_0x5dc1a6){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x5dc1a6[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')](_0x9b0b('0x32'),_0x5dc1a6[_0x9b0b('0x1a')]),_0x9b0b('0x33'),{'callNumber':_0x212b85,'callerId':_0x2938ff,'callbackUrl':_0x444d20});return _0xfd6ce[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x35')});})[_0x9b0b('0x20')](handleError(_0xfd6ce));};exports[_0x9b0b('0x36')]=function(_0x97d73a,_0x561942){logger['info'](_0x9b0b('0x37'),_0x97d73a[_0x9b0b('0x2b')]);var _0xe60dec=hangupValidation[_0x9b0b('0x38')](_0x97d73a[_0x9b0b('0x2b')]);if(_0xe60dec['length']>0x0){return _0x561942[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0xe60dec);}var _0x24cee7=_0x97d73a[_0x9b0b('0x2b')]['userId'];var _0x5ac75f=_0x97d73a[_0x9b0b('0x2b')]['sessionId'];return getAgent(_0x24cee7)[_0x9b0b('0x1d')](function(_0x316d86){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x316d86[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')](_0x9b0b('0x32'),_0x316d86[_0x9b0b('0x1a')]),_0x9b0b('0x39'),{'sessionId':_0x5ac75f});return _0x561942[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x3a')});})[_0x9b0b('0x20')](handleError(_0x561942));};exports[_0x9b0b('0x3b')]=function(_0xef0a28,_0x58d181){logger['info']('answer\x20fired:',_0xef0a28[_0x9b0b('0x2b')]);var _0x42d7e3=answerValidation[_0x9b0b('0x38')](_0xef0a28[_0x9b0b('0x2b')]);if(_0x42d7e3[_0x9b0b('0x27')]>0x0){return _0x58d181['status'](0x190)['json'](_0x42d7e3);}var _0x20ec55=_0xef0a28[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x136a33=_0xef0a28['body'][_0x9b0b('0x26')];return getAgent(_0x20ec55)[_0x9b0b('0x1d')](function(_0x177cde){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x177cde['name']);emit(util[_0x9b0b('0x31')](_0x9b0b('0x32'),_0x177cde[_0x9b0b('0x1a')]),_0x9b0b('0x3c'),{'sessionId':_0x136a33});return _0x58d181[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x3d')});})[_0x9b0b('0x20')](handleError(_0x58d181));};exports['hold']=function(_0x512ecc,_0x5bfa12){logger[_0x9b0b('0x14')](_0x9b0b('0x3e'),_0x512ecc[_0x9b0b('0x2b')]);var _0x25ed06=holdValidation[_0x9b0b('0x38')](_0x512ecc[_0x9b0b('0x2b')]);if(_0x25ed06[_0x9b0b('0x27')]>0x0){return _0x5bfa12[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x25ed06);}var _0x1f2108=_0x512ecc[_0x9b0b('0x2b')]['userId'];var _0x3b15b3=_0x512ecc[_0x9b0b('0x2b')]['sessionId'];return getAgent(_0x1f2108)['then'](function(_0xd9410f){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0xd9410f[_0x9b0b('0x1a')]);emit(util['format'](_0x9b0b('0x32'),_0xd9410f[_0x9b0b('0x1a')]),_0x9b0b('0x3f'),{'sessionId':_0x3b15b3});return _0x5bfa12[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x40')});})[_0x9b0b('0x20')](handleError(_0x5bfa12));};exports[_0x9b0b('0x41')]=function(_0x146654,_0x5d71d7){logger[_0x9b0b('0x14')]('unhold\x20fired:',_0x146654[_0x9b0b('0x2b')]);var _0x5eb636=unholdValidation['validate'](_0x146654[_0x9b0b('0x2b')]);if(_0x5eb636[_0x9b0b('0x27')]>0x0){return _0x5d71d7[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x5eb636);}var _0x105503=_0x146654[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x495b3e=_0x146654['body']['sessionId'];return getAgent(_0x105503)[_0x9b0b('0x1d')](function(_0x250b06){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x250b06[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')]('user:%s',_0x250b06[_0x9b0b('0x1a')]),_0x9b0b('0x42'),{'sessionId':_0x495b3e});return _0x5d71d7['status'](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x9b0b('0x20')](handleError(_0x5d71d7));};exports[_0x9b0b('0x43')]=function(_0x5156c1,_0x51ea1d){logger['info'](_0x9b0b('0x44'),_0x51ea1d[_0x9b0b('0x2b')]);var _0x23225c=callsValidation[_0x9b0b('0x38')](_0x5156c1[_0x9b0b('0x2b')]);if(_0x23225c[_0x9b0b('0x27')]>0x0){return _0x51ea1d[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x23225c);}var _0x283f31=_0x5156c1[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x4a2fbd=respondWithRpcPromise(_0x9b0b('0x23'));var _0x21f650=getAgent(_0x283f31);return Promise['all']([_0x4a2fbd,_0x21f650])[_0x9b0b('0x1d')](function(_0x30a39d){var _0x49ca3a=_0x30a39d[0x0];var _0x2a92b9=_0x30a39d[0x1];var _0x16f879=_[_0x9b0b('0x45')](_0x49ca3a[_0x9b0b('0x25')],function(_0x45b272){return _0x45b272['UserId']==_0x2a92b9['id'];});return _0x51ea1d[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'count':_0x16f879[_0x9b0b('0x27')],'rows':_0x16f879});})[_0x9b0b('0x20')](handleError(_0x51ea1d));};exports['conference']=function(_0x4928b1,_0x25553d){logger[_0x9b0b('0x14')]('conference\x20fired:',_0x4928b1['body']);var _0x3a599d=conferenceValidation[_0x9b0b('0x38')](_0x4928b1[_0x9b0b('0x2b')]);if(_0x3a599d[_0x9b0b('0x27')]>0x0){return _0x25553d[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x3a599d);}var _0xc935e1=_0x4928b1[_0x9b0b('0x2b')]['userId'];return getAgent(_0xc935e1)[_0x9b0b('0x1d')](function(_0x38ff6d){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x38ff6d['name']);emit(util[_0x9b0b('0x31')]('user:%s',_0x38ff6d[_0x9b0b('0x1a')]),_0x9b0b('0x46'));return _0x25553d[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x47')});})['catch'](handleError(_0x25553d));};exports[_0x9b0b('0x48')]=function(_0x3804e6,_0x4337c3){logger[_0x9b0b('0x14')]('transfer\x20fired:',_0x3804e6[_0x9b0b('0x2b')]);var _0x259340=transferValidation[_0x9b0b('0x38')](_0x3804e6[_0x9b0b('0x2b')]);if(_0x259340[_0x9b0b('0x27')]>0x0){return _0x4337c3['status'](0x190)[_0x9b0b('0x34')](_0x259340);}var _0x667604=_0x3804e6['body'][_0x9b0b('0x2c')];var _0x246056=_0x3804e6[_0x9b0b('0x2b')][_0x9b0b('0x26')];var _0x3b69a4=_0x3804e6[_0x9b0b('0x2b')][_0x9b0b('0x49')];return getAgent(_0x667604)[_0x9b0b('0x1d')](function(_0x1c0192){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x1c0192[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')]('user:%s',_0x1c0192[_0x9b0b('0x1a')]),_0x9b0b('0x4a'),{'sessionId':_0x246056,'transferNumber':_0x3b69a4});return _0x4337c3['status'](0xc8)['json']({'error':![],'message':_0x9b0b('0x4b')});})['catch'](handleError(_0x4337c3));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 3320b89..822955e 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 _0xef0f=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','removeAnswers','exports'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xef0f,0x168));var _0xfef0=function(_0x268a38,_0x3092f6){_0x268a38=_0x268a38-0x0;var _0x5118f9=_0xef0f[_0x268a38];return _0x5118f9;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0x8')](_0xfef0('0xf'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x8')](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x8')](_0xfef0('0x13'),auth[_0xfef0('0x9')](),controller['getAgents']);router[_0xfef0('0x8')](_0xfef0('0x14'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x15')]);router[_0xfef0('0x16')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x17')]);router['post'](_0xfef0('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x18')]);router[_0xfef0('0x16')](_0xfef0('0x13'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x19')]);router[_0xfef0('0x16')]('/:id/applications',auth[_0xfef0('0x9')](),controller[_0xfef0('0x1a')]);router[_0xfef0('0x16')](_0xfef0('0x1b'),controller[_0xfef0('0x1c')]);router['post'](_0xfef0('0x1d'),auth['isAuthenticated'](),controller[_0xfef0('0x1e')]);router[_0xfef0('0x1f')](_0xfef0('0xd'),auth['isAuthenticated'](),controller[_0xfef0('0x20')]);router['delete'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0xfef0('0x9')](),controller['removeDispositions']);router[_0xfef0('0x21')](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x22')]);router[_0xfef0('0x21')](_0xfef0('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xfef0('0x23')]=router; \ No newline at end of file +var _0x0295=['addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','/:id/applications','addApplications','/:id/notify','notify','put','/:id','update','delete','removeDispositions','removeAnswers','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','getDispositions','getAnswers','getAgents','post','create','/:id/dispositions'];(function(_0x13611e,_0x42652f){var _0x43b5b9=function(_0x28d3c1){while(--_0x28d3c1){_0x13611e['push'](_0x13611e['shift']());}};_0x43b5b9(++_0x42652f);}(_0x0295,0x1f0));var _0x5029=function(_0x5f2a50,_0x4700e0){_0x5f2a50=_0x5f2a50-0x0;var _0x7577ca=_0x0295[_0x5f2a50];return _0x7577ca;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0x7')]('/:id/dispositions',auth[_0x5029('0x8')](),controller[_0x5029('0xa')]);router[_0x5029('0x7')]('/:id/canned_answers',auth[_0x5029('0x8')](),controller[_0x5029('0xb')]);router[_0x5029('0x7')]('/:id/users',auth[_0x5029('0x8')](),controller[_0x5029('0xc')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x5029('0xd')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0xe')]);router[_0x5029('0xd')](_0x5029('0xf'),auth[_0x5029('0x8')](),controller[_0x5029('0x10')]);router[_0x5029('0xd')](_0x5029('0x11'),auth[_0x5029('0x8')](),controller[_0x5029('0x12')]);router[_0x5029('0xd')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x14')]);router['post'](_0x5029('0x15'),auth[_0x5029('0x8')](),controller[_0x5029('0x16')]);router[_0x5029('0xd')](_0x5029('0x17'),controller[_0x5029('0x18')]);router[_0x5029('0xd')]('/:id/send',auth[_0x5029('0x8')](),controller['send']);router[_0x5029('0x19')](_0x5029('0x1a'),auth[_0x5029('0x8')](),controller[_0x5029('0x1b')]);router['delete']('/:id',auth[_0x5029('0x8')](),controller['destroy']);router[_0x5029('0x1c')](_0x5029('0xf'),auth[_0x5029('0x8')](),controller[_0x5029('0x1d')]);router[_0x5029('0x1c')](_0x5029('0x11'),auth[_0x5029('0x8')](),controller[_0x5029('0x1e')]);router[_0x5029('0x1c')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x5029('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 43c5f5b..87efd96 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 _0xaeac=['ENUM','twilio','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate'];(function(_0x49d973,_0x28a440){var _0x134f4a=function(_0x53ca6a){while(--_0x53ca6a){_0x49d973['push'](_0x49d973['shift']());}};_0x134f4a(++_0x28a440);}(_0xaeac,0x6b));var _0xcaea=function(_0x145e88,_0x37f205){_0x145e88=_0x145e88-0x0;var _0x1af7e4=_0xaeac[_0x145e88];return _0x1af7e4;};'use strict';var Sequelize=require(_0xcaea('0x0'));var rs=require(_0xcaea('0x1'));module[_0xcaea('0x2')]={'name':{'type':Sequelize[_0xcaea('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xcaea('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xcaea('0x3')],'defaultValue':function(){return rs[_0xcaea('0x4')]();}},'phone':{'type':Sequelize[_0xcaea('0x3')]},'type':{'type':Sequelize[_0xcaea('0x5')](_0xcaea('0x6'))},'accountSid':{'type':Sequelize[_0xcaea('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xcaea('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xcaea('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcaea('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcaea('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcaea('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xcaea('0x8')],'defaultValue':![],'comment':_0xcaea('0xa'),'set':function(_0x267573){if(!_0x267573){this['setDataValue'](_0xcaea('0xb'),null);}this[_0xcaea('0xc')](_0xcaea('0xd'),_0x267573);}},'description':{'type':Sequelize[_0xcaea('0x3')]}}; \ No newline at end of file +var _0x4495=['ENUM','twilio','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','setDataValue','mandatoryDisposition','randomstring','exports','STRING','name','generate'];(function(_0x3040e0,_0x2fd324){var _0x406114=function(_0x2c7b25){while(--_0x2c7b25){_0x3040e0['push'](_0x3040e0['shift']());}};_0x406114(++_0x2fd324);}(_0x4495,0xdb));var _0x5449=function(_0x357400,_0xcd1e2){_0x357400=_0x357400-0x0;var _0x86ec59=_0x4495[_0x357400];return _0x86ec59;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x5449('0x0'));module[_0x5449('0x1')]={'name':{'type':Sequelize[_0x5449('0x2')],'unique':_0x5449('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x5449('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x5449('0x2')],'defaultValue':function(){return rs[_0x5449('0x4')]();}},'phone':{'type':Sequelize[_0x5449('0x2')]},'type':{'type':Sequelize[_0x5449('0x5')](_0x5449('0x6'))},'accountSid':{'type':Sequelize[_0x5449('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5449('0x7')],'defaultValue':function(){return _0x5449('0x8');}},'notificationSound':{'type':Sequelize[_0x5449('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5449('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5449('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5449('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5449('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5449('0xa')],'comment':_0x5449('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x5449('0x9')],'defaultValue':![],'comment':_0x5449('0xc'),'set':function(_0x249818){if(!_0x249818){this['setDataValue'](_0x5449('0xd'),null);}this[_0x5449('0xe')](_0x5449('0xf'),_0x249818);}},'description':{'type':Sequelize[_0x5449('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 10d85ff..76cf609 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 _0x1445=['status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','sort','filters','filter','where','merge','options','includeAll','findAll','rows','show','keys','length','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappAccounts','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','WhatsappAccountId','Disposition','findOne','rawAttributes','hasOwnProperty','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','priority','getApplications','whatsapp','Applications','applications','asc','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','From','replace','Body','messageId','MessageSid','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','CmContact','Contacts','DESC','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','set','Content-Type','text/xml','to\x20is\x20mandatory','List','ListId','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus'];(function(_0x285a88,_0x5a772b){var _0x4bd9ae=function(_0x52c6b2){while(--_0x52c6b2){_0x285a88['push'](_0x285a88['shift']());}};_0x4bd9ae(++_0x5a772b);}(_0x1445,0x90));var _0x5144=function(_0xc4483f,_0x160f2e){_0xc4483f=_0xc4483f-0x0;var _0xf791d4=_0x1445[_0xc4483f];return _0xf791d4;};'use strict';var emlformat=require(_0x5144('0x0'));var rimraf=require(_0x5144('0x1'));var zipdir=require(_0x5144('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5144('0x3'));var moment=require(_0x5144('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5144('0x5'));var util=require(_0x5144('0x6'));var path=require(_0x5144('0x7'));var sox=require(_0x5144('0x8'));var csv=require(_0x5144('0x9'));var ejs=require(_0x5144('0xa'));var fs=require('fs');var fs_extra=require(_0x5144('0xb'));var _=require(_0x5144('0xc'));var squel=require(_0x5144('0xd'));var crypto=require('crypto');var jsforce=require(_0x5144('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5144('0xf'));var Papa=require(_0x5144('0x10'));var Redis=require(_0x5144('0x11'));var authService=require(_0x5144('0x12'));var qs=require(_0x5144('0x13'));var as=require(_0x5144('0x14'));var hardwareService=require(_0x5144('0x15'));var logger=require('../../config/logger')(_0x5144('0x16'));var utils=require(_0x5144('0x17'));var config=require(_0x5144('0x18'));var licenseUtil=require(_0x5144('0x19'));var db=require(_0x5144('0x1a'))['db'];config[_0x5144('0x1b')]=_[_0x5144('0x1c')](config[_0x5144('0x1b')],{'host':_0x5144('0x1d'),'port':0x18eb});var socket=require(_0x5144('0x1e'))(new Redis(config[_0x5144('0x1b')]));require(_0x5144('0x1f'))['register'](socket);var jayson=require(_0x5144('0x20'));var client=jayson[_0x5144('0x21')][_0x5144('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x2c3431,_0xc7c17a,_0x2c6d90,_0x37c6da){return new BPromise(function(_0x2d01ac,_0x4d7c19){var _0x2ca6c3=_0x37c6da||client;return _0x2ca6c3[_0x5144('0x23')](_0x2c3431,_0x2c6d90)['then'](function(_0x9af255){logger['info'](_0x5144('0x24'),_0xc7c17a,_0x5144('0x25'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xc7c17a,_0x5144('0x25'),JSON['stringify'](_0x9af255));if(_0x9af255['error']){if(_0x9af255[_0x5144('0x26')][_0x5144('0x27')]===0x1f4){logger['error'](_0x5144('0x24'),_0xc7c17a,_0x9af255[_0x5144('0x26')][_0x5144('0x28')]);return _0x4d7c19(_0x9af255[_0x5144('0x26')][_0x5144('0x28')]);}logger[_0x5144('0x26')](_0x5144('0x24'),_0xc7c17a,_0x9af255['error'][_0x5144('0x28')]);return _0x2d01ac(_0x9af255[_0x5144('0x26')][_0x5144('0x28')]);}else{logger[_0x5144('0x29')](_0x5144('0x24'),_0xc7c17a,_0x5144('0x25'));_0x2d01ac(_0x9af255[_0x5144('0x2a')][_0x5144('0x28')]);}})[_0x5144('0x2b')](function(_0x10115b){logger[_0x5144('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0xc7c17a,_0x10115b);_0x4d7c19(_0x10115b);});});}function respondWithStatusCode(_0x4ded5b,_0x55dc35){_0x55dc35=_0x55dc35||0xcc;return function(_0x5a5908){if(_0x5a5908){return _0x4ded5b[_0x5144('0x2c')](_0x55dc35);}return _0x4ded5b['status'](_0x55dc35)['end']();};}function respondWithResult(_0x5114c7,_0x19fc69){_0x19fc69=_0x19fc69||0xc8;return function(_0x647bb0){if(_0x647bb0){return _0x5114c7[_0x5144('0x2d')](_0x19fc69)['json'](_0x647bb0);}};}function respondWithFilteredResult(_0x322bf2,_0xe2bbd8){return function(_0x3ec0e6){if(_0x3ec0e6){var _0x4f4c85=typeof _0xe2bbd8[_0x5144('0x2e')]===_0x5144('0x2f')&&typeof _0xe2bbd8[_0x5144('0x30')]===_0x5144('0x2f');var _0x2e0f54=_0x3ec0e6[_0x5144('0x31')];var _0x489785=_0x4f4c85?0x0:_0xe2bbd8['offset'];var _0x57fcf3=_0x4f4c85?_0x3ec0e6[_0x5144('0x31')]:_0xe2bbd8['offset']+_0xe2bbd8[_0x5144('0x30')];var _0x3da32d;if(_0x57fcf3>=_0x2e0f54){_0x57fcf3=_0x2e0f54;_0x3da32d=0xc8;}else{_0x3da32d=0xce;}_0x322bf2[_0x5144('0x2d')](_0x3da32d);return _0x322bf2['set'](_0x5144('0x32'),_0x489785+'-'+_0x57fcf3+'/'+_0x2e0f54)[_0x5144('0x33')](_0x3ec0e6);}return null;};}function patchUpdates(_0x5ae529){return function(_0x56e578){try{jsonpatch['apply'](_0x56e578,_0x5ae529,!![]);}catch(_0x2c2f29){return BPromise[_0x5144('0x34')](_0x2c2f29);}return _0x56e578[_0x5144('0x35')]();};}function saveUpdates(_0x33d063,_0x872ec5){return function(_0x49905f){if(_0x49905f){return _0x49905f[_0x5144('0x36')](_0x33d063)[_0x5144('0x37')](function(_0x248312){return _0x248312;});}return null;};}function removeEntity(_0x25e43a,_0x2e9b1f){return function(_0x225b9a){if(_0x225b9a){return _0x225b9a[_0x5144('0x38')]()[_0x5144('0x37')](function(){var _0x5da5cb=_0x225b9a[_0x5144('0x39')]({'plain':!![]});var _0x3602e0='WhatsappAccounts';return db[_0x5144('0x3a')][_0x5144('0x38')]({'where':{'type':_0x3602e0,'resourceId':_0x5da5cb['id']}})[_0x5144('0x37')](function(){return _0x225b9a;});})[_0x5144('0x37')](function(){_0x25e43a[_0x5144('0x2d')](0xcc)[_0x5144('0x3b')]();});}};}function handleEntityNotFound(_0x56d729,_0x449a54){return function(_0x23596f){if(!_0x23596f){_0x56d729['sendStatus'](0x194);}return _0x23596f;};}function handleError(_0x500b2c,_0x5e6c85){_0x5e6c85=_0x5e6c85||0x1f4;return function(_0x3a3741){logger[_0x5144('0x26')](_0x3a3741[_0x5144('0x3c')]);if(_0x3a3741[_0x5144('0x3d')]){delete _0x3a3741[_0x5144('0x3d')];}_0x500b2c[_0x5144('0x2d')](_0x5e6c85)[_0x5144('0x3e')](_0x3a3741);};}exports[_0x5144('0x3f')]=function(_0x297c95,_0x424c8d){var _0x148972={'include':[{'model':db[_0x5144('0x40')],'as':_0x5144('0x41')}]},_0x2f6bb3={},_0x1448b6={'count':0x0,'rows':[]};var _0x1cf21b=_[_0x5144('0x42')](db[_0x5144('0x43')]['rawAttributes'],function(_0x401946){return{'name':_0x401946[_0x5144('0x44')],'type':_0x401946[_0x5144('0x45')][_0x5144('0x46')]};});_0x2f6bb3[_0x5144('0x47')]=_[_0x5144('0x42')](_0x1cf21b,_0x5144('0x3d'));_0x2f6bb3[_0x5144('0x48')]=_['keys'](_0x297c95['query']);_0x2f6bb3['filters']=_[_0x5144('0x49')](_0x2f6bb3[_0x5144('0x47')],_0x2f6bb3[_0x5144('0x48')]);_0x148972[_0x5144('0x4a')]=_[_0x5144('0x49')](_0x2f6bb3[_0x5144('0x47')],qs[_0x5144('0x4b')](_0x297c95[_0x5144('0x48')][_0x5144('0x4b')]));_0x148972['attributes']=_0x148972[_0x5144('0x4a')]['length']?_0x148972[_0x5144('0x4a')]:_0x2f6bb3['model'];if(!_0x297c95[_0x5144('0x48')]['hasOwnProperty'](_0x5144('0x4c'))){_0x148972[_0x5144('0x30')]=qs['limit'](_0x297c95[_0x5144('0x48')]['limit']);_0x148972['offset']=qs[_0x5144('0x2e')](_0x297c95[_0x5144('0x48')][_0x5144('0x2e')]);}_0x148972['order']=qs[_0x5144('0x4d')](_0x297c95[_0x5144('0x48')][_0x5144('0x4d')]);_0x148972['where']=qs[_0x5144('0x4e')](_['pick'](_0x297c95[_0x5144('0x48')],_0x2f6bb3['filters']),_0x1cf21b);if(_0x297c95[_0x5144('0x48')][_0x5144('0x4f')]){_0x148972[_0x5144('0x50')]=_[_0x5144('0x51')](_0x148972[_0x5144('0x50')],{'$or':_[_0x5144('0x42')](_0x1cf21b,function(_0x2b68b3){if(_0x2b68b3['type']!=='VIRTUAL'){var _0xa25230={};_0xa25230[_0x2b68b3[_0x5144('0x3d')]]={'$like':'%'+_0x297c95[_0x5144('0x48')]['filter']+'%'};return _0xa25230;}})});}_0x148972=_[_0x5144('0x51')]({},_0x148972,_0x297c95[_0x5144('0x52')]);var _0x2c76bb={'where':_0x148972['where']};return db[_0x5144('0x43')][_0x5144('0x31')](_0x2c76bb)[_0x5144('0x37')](function(_0x2a0af0){_0x1448b6[_0x5144('0x31')]=_0x2a0af0;if(_0x297c95[_0x5144('0x48')][_0x5144('0x53')]){_0x148972['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0x5144('0x54')](_0x148972);})[_0x5144('0x37')](function(_0x24fb7a){_0x1448b6[_0x5144('0x55')]=_0x24fb7a;return _0x1448b6;})[_0x5144('0x37')](respondWithFilteredResult(_0x424c8d,_0x148972))['catch'](handleError(_0x424c8d,null));};exports[_0x5144('0x56')]=function(_0x8890fd,_0x19d13d){var _0x14edee={'raw':![],'where':{'id':_0x8890fd['params']['id']},'include':[{'model':db[_0x5144('0x40')],'as':'mandatoryDispositionPause'}]},_0x30f74c={};_0x30f74c['model']=_[_0x5144('0x57')](db[_0x5144('0x43')]['rawAttributes']);_0x30f74c[_0x5144('0x48')]=_['keys'](_0x8890fd[_0x5144('0x48')]);_0x30f74c['filters']=_[_0x5144('0x49')](_0x30f74c[_0x5144('0x47')],_0x30f74c[_0x5144('0x48')]);_0x14edee[_0x5144('0x4a')]=_[_0x5144('0x49')](_0x30f74c[_0x5144('0x47')],qs[_0x5144('0x4b')](_0x8890fd['query'][_0x5144('0x4b')]));_0x14edee[_0x5144('0x4a')]=_0x14edee[_0x5144('0x4a')][_0x5144('0x58')]?_0x14edee[_0x5144('0x4a')]:_0x30f74c[_0x5144('0x47')];if(_0x8890fd[_0x5144('0x48')][_0x5144('0x53')]){_0x14edee[_0x5144('0x59')]=[{'all':!![]}];}_0x14edee=_[_0x5144('0x51')]({},_0x14edee,_0x8890fd[_0x5144('0x52')]);return db['WhatsappAccount']['find'](_0x14edee)[_0x5144('0x37')](handleEntityNotFound(_0x19d13d,null))[_0x5144('0x37')](respondWithResult(_0x19d13d,null))[_0x5144('0x2b')](handleError(_0x19d13d,null));};exports['create']=function(_0x2211dd,_0x442a1c){return db[_0x5144('0x43')][_0x5144('0x5a')](_0x2211dd['body'],{})[_0x5144('0x37')](function(_0x573421){var _0x42b4ac=_0x2211dd[_0x5144('0x5b')][_0x5144('0x39')]({'plain':!![]});if(!_0x42b4ac)throw new Error(_0x5144('0x5c'));if(_0x42b4ac['role']===_0x5144('0x5b')){var _0xc17c99=_0x573421[_0x5144('0x39')]({'plain':!![]});var _0x32687e=_0x5144('0x5d');return db['UserProfileSection'][_0x5144('0x5e')]({'where':{'name':_0x32687e,'userProfileId':_0x42b4ac[_0x5144('0x5f')]},'raw':!![]})['then'](function(_0x5a736e){if(_0x5a736e&&_0x5a736e[_0x5144('0x60')]===0x0){return db[_0x5144('0x3a')][_0x5144('0x5a')]({'name':_0xc17c99[_0x5144('0x3d')],'resourceId':_0xc17c99['id'],'type':_0x5a736e['name'],'sectionId':_0x5a736e['id']},{})[_0x5144('0x37')](function(){return _0x573421;});}else{return _0x573421;}})[_0x5144('0x2b')](function(_0x28f949){logger['error'](_0x5144('0x61'),_0x28f949);throw _0x28f949;});}return _0x573421;})[_0x5144('0x37')](respondWithResult(_0x442a1c,0xc9))['catch'](handleError(_0x442a1c,null));};exports['update']=function(_0x2fd4f1,_0x5ec558){if(_0x2fd4f1[_0x5144('0x62')]['id']){delete _0x2fd4f1['body']['id'];}return db[_0x5144('0x43')]['find']({'where':{'id':_0x2fd4f1[_0x5144('0x63')]['id']},'include':[{'model':db[_0x5144('0x40')],'as':_0x5144('0x41')}]})['then'](handleEntityNotFound(_0x5ec558,null))['then'](saveUpdates(_0x2fd4f1[_0x5144('0x62')],null))['then'](respondWithResult(_0x5ec558,null))[_0x5144('0x2b')](handleError(_0x5ec558,null));};exports['destroy']=function(_0x4e4cb7,_0x3ca8eb){return db[_0x5144('0x43')]['find']({'where':{'id':_0x4e4cb7['params']['id']}})['then'](handleEntityNotFound(_0x3ca8eb,null))['then'](removeEntity(_0x3ca8eb,null))[_0x5144('0x2b')](handleError(_0x3ca8eb,null));};exports['describe']=function(_0x233670,_0x2555dd){return db[_0x5144('0x43')][_0x5144('0x64')]()[_0x5144('0x37')](respondWithResult(_0x2555dd,null))[_0x5144('0x2b')](handleError(_0x2555dd,null));};exports['addDisposition']=function(_0x24cdcc,_0x3a5895,_0x22e3da){if(_0x24cdcc[_0x5144('0x62')]['id']){delete _0x24cdcc[_0x5144('0x62')]['id'];}return db[_0x5144('0x43')]['find']({'where':{'id':_0x24cdcc[_0x5144('0x63')]['id']}})[_0x5144('0x37')](handleEntityNotFound(_0x3a5895,null))['then'](function(_0x478302){if(_0x478302){_0x24cdcc['body'][_0x5144('0x65')]=_0x478302['id'];return db[_0x5144('0x66')][_0x5144('0x5a')](_0x24cdcc['body']);}})[_0x5144('0x37')](respondWithResult(_0x3a5895,null))[_0x5144('0x2b')](handleError(_0x3a5895,null));};exports['getDispositions']=function(_0xbdedc2,_0x239a73,_0x51cf97){var _0x390114={'raw':![],'where':{}};var _0x41de52={};var _0x3b67a0={'count':0x0,'rows':[]};return db[_0x5144('0x43')][_0x5144('0x67')]({'where':{'id':_0xbdedc2[_0x5144('0x63')]['id']}})[_0x5144('0x37')](handleEntityNotFound(_0x239a73,null))[_0x5144('0x37')](function(_0x1a502d){if(_0x1a502d){_0x41de52[_0x5144('0x47')]=_[_0x5144('0x57')](db[_0x5144('0x66')][_0x5144('0x68')]);_0x41de52[_0x5144('0x48')]=_['keys'](_0xbdedc2['query']);_0x41de52[_0x5144('0x4e')]=_[_0x5144('0x49')](_0x41de52[_0x5144('0x47')],_0x41de52['query']);_0x390114['attributes']=_[_0x5144('0x49')](_0x41de52['model'],qs['fields'](_0xbdedc2['query'][_0x5144('0x4b')]));_0x390114[_0x5144('0x4a')]=_0x390114[_0x5144('0x4a')][_0x5144('0x58')]?_0x390114[_0x5144('0x4a')]:_0x41de52['model'];if(!_0xbdedc2['query'][_0x5144('0x69')]('nolimit')){_0x390114['limit']=qs[_0x5144('0x30')](_0xbdedc2[_0x5144('0x48')][_0x5144('0x30')]);_0x390114[_0x5144('0x2e')]=qs[_0x5144('0x2e')](_0xbdedc2[_0x5144('0x48')][_0x5144('0x2e')]);}_0x390114[_0x5144('0x6a')]=qs[_0x5144('0x4d')](_0xbdedc2[_0x5144('0x48')][_0x5144('0x4d')]);_0x390114[_0x5144('0x50')]=qs[_0x5144('0x4e')](_[_0x5144('0x6b')](_0xbdedc2[_0x5144('0x48')],_0x41de52[_0x5144('0x4e')]));_0x390114[_0x5144('0x50')][_0x5144('0x65')]=_0x1a502d['id'];if(_0xbdedc2[_0x5144('0x48')]['filter']){_0x390114[_0x5144('0x50')]=_[_0x5144('0x51')](_0x390114[_0x5144('0x50')],{'$or':_[_0x5144('0x42')](_0x390114[_0x5144('0x4a')],function(_0x5c3dca){var _0x17ae03={};_0x17ae03[_0x5c3dca]={'$like':'%'+_0xbdedc2[_0x5144('0x48')][_0x5144('0x4f')]+'%'};return _0x17ae03;})});}_0x390114=_['merge']({},_0x390114,_0xbdedc2[_0x5144('0x52')]);return db[_0x5144('0x66')][_0x5144('0x31')]({'where':_0x390114[_0x5144('0x50')]})['then'](function(_0x5e382f){_0x3b67a0[_0x5144('0x31')]=_0x5e382f;if(_0xbdedc2[_0x5144('0x48')][_0x5144('0x53')]){_0x390114[_0x5144('0x59')]=[{'all':!![]}];}return db[_0x5144('0x66')][_0x5144('0x54')](_0x390114);})[_0x5144('0x37')](function(_0x1397d7){_0x3b67a0[_0x5144('0x55')]=_0x1397d7;return _0x3b67a0;});}})[_0x5144('0x37')](respondWithFilteredResult(_0x239a73,_0x390114))[_0x5144('0x2b')](handleError(_0x239a73,null));};exports[_0x5144('0x6c')]=function(_0x2436b7,_0x47b48a,_0x1c1845){return db['WhatsappAccount'][_0x5144('0x5e')]({'where':{'id':_0x2436b7['params']['id']}})['then'](handleEntityNotFound(_0x47b48a,null))[_0x5144('0x37')](function(_0x13b155){if(_0x13b155){return _0x13b155[_0x5144('0x6c')](_0x2436b7[_0x5144('0x48')][_0x5144('0x6d')]);}})[_0x5144('0x37')](respondWithStatusCode(_0x47b48a,null))[_0x5144('0x2b')](handleError(_0x47b48a,null));};exports[_0x5144('0x6e')]=function(_0x14af33,_0x2a4899,_0x3765bb){if(_0x14af33[_0x5144('0x62')]['id']){delete _0x14af33['body']['id'];}return db[_0x5144('0x43')][_0x5144('0x5e')]({'where':{'id':_0x14af33[_0x5144('0x63')]['id']}})[_0x5144('0x37')](handleEntityNotFound(_0x2a4899,null))[_0x5144('0x37')](function(_0x4cbfda){if(_0x4cbfda){_0x14af33[_0x5144('0x62')][_0x5144('0x65')]=_0x4cbfda['id'];return db[_0x5144('0x6f')]['create'](_0x14af33[_0x5144('0x62')]);}})[_0x5144('0x37')](respondWithResult(_0x2a4899,null))[_0x5144('0x2b')](handleError(_0x2a4899,null));};exports[_0x5144('0x70')]=function(_0x307780,_0x32d2d9,_0x4d36e4){var _0xd1955={'raw':![],'where':{}};var _0x1a209d={};var _0x912169={'count':0x0,'rows':[]};return db[_0x5144('0x43')][_0x5144('0x67')]({'where':{'id':_0x307780[_0x5144('0x63')]['id']}})[_0x5144('0x37')](handleEntityNotFound(_0x32d2d9,null))[_0x5144('0x37')](function(_0x4297bc){if(_0x4297bc){_0x1a209d[_0x5144('0x47')]=_[_0x5144('0x57')](db[_0x5144('0x6f')][_0x5144('0x68')]);_0x1a209d[_0x5144('0x48')]=_['keys'](_0x307780[_0x5144('0x48')]);_0x1a209d[_0x5144('0x4e')]=_[_0x5144('0x49')](_0x1a209d[_0x5144('0x47')],_0x1a209d[_0x5144('0x48')]);_0xd1955[_0x5144('0x4a')]=_[_0x5144('0x49')](_0x1a209d[_0x5144('0x47')],qs['fields'](_0x307780[_0x5144('0x48')][_0x5144('0x4b')]));_0xd1955[_0x5144('0x4a')]=_0xd1955[_0x5144('0x4a')]['length']?_0xd1955[_0x5144('0x4a')]:_0x1a209d[_0x5144('0x47')];if(!_0x307780[_0x5144('0x48')][_0x5144('0x69')](_0x5144('0x4c'))){_0xd1955[_0x5144('0x30')]=qs[_0x5144('0x30')](_0x307780['query'][_0x5144('0x30')]);_0xd1955['offset']=qs['offset'](_0x307780[_0x5144('0x48')][_0x5144('0x2e')]);}_0xd1955[_0x5144('0x6a')]=qs[_0x5144('0x4d')](_0x307780[_0x5144('0x48')][_0x5144('0x4d')]);_0xd1955[_0x5144('0x50')]=qs['filters'](_[_0x5144('0x6b')](_0x307780['query'],_0x1a209d[_0x5144('0x4e')]));_0xd1955['where']['WhatsappAccountId']=_0x4297bc['id'];if(_0x307780[_0x5144('0x48')][_0x5144('0x4f')]){_0xd1955[_0x5144('0x50')]=_[_0x5144('0x51')](_0xd1955[_0x5144('0x50')],{'$or':_[_0x5144('0x42')](_0xd1955[_0x5144('0x4a')],function(_0x21bef6){var _0x4aeed7={};_0x4aeed7[_0x21bef6]={'$like':'%'+_0x307780[_0x5144('0x48')][_0x5144('0x4f')]+'%'};return _0x4aeed7;})});}_0xd1955=_[_0x5144('0x51')]({},_0xd1955,_0x307780[_0x5144('0x52')]);return db[_0x5144('0x6f')][_0x5144('0x31')]({'where':_0xd1955[_0x5144('0x50')]})[_0x5144('0x37')](function(_0x33e01f){_0x912169[_0x5144('0x31')]=_0x33e01f;if(_0x307780['query'][_0x5144('0x53')]){_0xd1955[_0x5144('0x59')]=[{'all':!![]}];}return db[_0x5144('0x6f')][_0x5144('0x54')](_0xd1955);})[_0x5144('0x37')](function(_0xa0759c){_0x912169[_0x5144('0x55')]=_0xa0759c;return _0x912169;});}})[_0x5144('0x37')](respondWithFilteredResult(_0x32d2d9,_0xd1955))[_0x5144('0x2b')](handleError(_0x32d2d9,null));};exports[_0x5144('0x71')]=function(_0xd489db,_0x376a8e,_0x403f1e){return db[_0x5144('0x43')][_0x5144('0x5e')]({'where':{'id':_0xd489db['params']['id']}})['then'](handleEntityNotFound(_0x376a8e,null))[_0x5144('0x37')](function(_0x2413e0){if(_0x2413e0){return _0x2413e0[_0x5144('0x71')](_0xd489db[_0x5144('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x376a8e,null))['catch'](handleError(_0x376a8e,null));};exports[_0x5144('0x72')]=function(_0x1d896a,_0x5d89f1,_0x55853b){return db['WhatsappAccount']['find']({'where':{'id':_0x1d896a['params']['id']}})[_0x5144('0x37')](handleEntityNotFound(_0x5d89f1,null))[_0x5144('0x37')](function(_0x120dc0){if(_0x120dc0){return _0x120dc0[_0x5144('0x72')](_0x1d896a[_0x5144('0x62')][_0x5144('0x6d')],_[_0x5144('0x73')](_0x1d896a[_0x5144('0x62')],[_0x5144('0x6d'),'id'])||{})[_0x5144('0x74')](function(_0x3ffa99){for(var _0x250ed6=0x0;_0x250ed6<_0x1d896a[_0x5144('0x62')]['ids']['length'];_0x250ed6+=0x1){socket[_0x5144('0x75')](_0x5144('0x76'),{'UserId':Number(_0x1d896a['body'][_0x5144('0x6d')][_0x250ed6]),'WhatsappAccountId':Number(_0x1d896a['params']['id'])});}return _0x3ffa99;});}})[_0x5144('0x37')](respondWithResult(_0x5d89f1,null))['catch'](handleError(_0x5d89f1,null));};exports[_0x5144('0x77')]=function(_0x79d2a2,_0x340f0e,_0x2ad702){return db['WhatsappAccount']['find']({'where':{'id':_0x79d2a2[_0x5144('0x63')]['id']}})[_0x5144('0x37')](handleEntityNotFound(_0x340f0e,null))[_0x5144('0x37')](function(_0x53711b){if(_0x53711b){return _0x53711b[_0x5144('0x77')](_0x79d2a2[_0x5144('0x48')][_0x5144('0x6d')])['then'](function(){if(_[_0x5144('0x78')](_0x79d2a2[_0x5144('0x48')][_0x5144('0x6d')])){for(var _0x20e93c=0x0;_0x20e93c<_0x79d2a2[_0x5144('0x48')][_0x5144('0x6d')][_0x5144('0x58')];_0x20e93c+=0x1){socket[_0x5144('0x75')](_0x5144('0x79'),{'UserId':Number(_0x79d2a2['query'][_0x5144('0x6d')][_0x20e93c]),'WhatsappAccountId':Number(_0x79d2a2[_0x5144('0x63')]['id'])});}}else{socket['emit'](_0x5144('0x79'),{'UserId':Number(_0x79d2a2[_0x5144('0x48')]['ids']),'WhatsappAccountId':Number(_0x79d2a2[_0x5144('0x63')]['id'])});}});}})[_0x5144('0x37')](respondWithStatusCode(_0x340f0e,null))[_0x5144('0x2b')](handleError(_0x340f0e,null));};exports[_0x5144('0x7a')]=function(_0x126027,_0x44051a,_0x454d10){var _0x38618f={};var _0x1ff5dd={};var _0x4126dd;var _0x1d7fd2;return db[_0x5144('0x43')]['findOne']({'where':{'id':_0x126027['params']['id']}})[_0x5144('0x37')](handleEntityNotFound(_0x44051a,null))[_0x5144('0x37')](function(_0xb49906){if(_0xb49906){_0x4126dd=_0xb49906;_0x1ff5dd[_0x5144('0x47')]=_[_0x5144('0x57')](db[_0x5144('0x7b')]['rawAttributes']);_0x1ff5dd[_0x5144('0x48')]=_[_0x5144('0x57')](_0x126027[_0x5144('0x48')]);_0x1ff5dd[_0x5144('0x4e')]=_[_0x5144('0x49')](_0x1ff5dd[_0x5144('0x47')],_0x1ff5dd['query']);_0x38618f['attributes']=_[_0x5144('0x49')](_0x1ff5dd['model'],qs[_0x5144('0x4b')](_0x126027[_0x5144('0x48')][_0x5144('0x4b')]));_0x38618f[_0x5144('0x4a')]=_0x38618f[_0x5144('0x4a')][_0x5144('0x58')]?_0x38618f[_0x5144('0x4a')]:_0x1ff5dd[_0x5144('0x47')];_0x38618f[_0x5144('0x6a')]=qs['sort'](_0x126027[_0x5144('0x48')]['sort']);_0x38618f[_0x5144('0x50')]=qs[_0x5144('0x4e')](_[_0x5144('0x6b')](_0x126027[_0x5144('0x48')],_0x1ff5dd['filters']));if(_0x126027[_0x5144('0x48')]['filter']){_0x38618f[_0x5144('0x50')]=_[_0x5144('0x51')](_0x38618f[_0x5144('0x50')],{'$or':_['map'](_0x38618f['attributes'],function(_0x433b44){var _0x5401de={};_0x5401de[_0x433b44]={'$like':'%'+_0x126027['query']['filter']+'%'};return _0x5401de;})});}_0x38618f=_[_0x5144('0x51')]({},_0x38618f,_0x126027['options']);return _0x4126dd['getAgents'](_0x38618f);}})[_0x5144('0x37')](function(_0x2c5c56){if(_0x2c5c56){_0x1d7fd2=_0x2c5c56['length'];if(!_0x126027['query'][_0x5144('0x69')](_0x5144('0x4c'))){_0x38618f[_0x5144('0x30')]=qs['limit'](_0x126027[_0x5144('0x48')]['limit']);_0x38618f[_0x5144('0x2e')]=qs[_0x5144('0x2e')](_0x126027['query'][_0x5144('0x2e')]);}return _0x4126dd[_0x5144('0x7a')](_0x38618f);}})[_0x5144('0x37')](function(_0x186eb9){if(_0x186eb9){return _0x186eb9?{'count':_0x1d7fd2,'rows':_0x186eb9}:null;}})[_0x5144('0x37')](respondWithResult(_0x44051a,null))[_0x5144('0x2b')](handleError(_0x44051a,null));};exports[_0x5144('0x7c')]=function(_0x4d07c9,_0xfe4601,_0x233785){return db[_0x5144('0x43')][_0x5144('0x67')]({'where':{'id':_0x4d07c9['params']['id']}})['then'](handleEntityNotFound(_0xfe4601,null))[_0x5144('0x37')](function(_0x382782){if(_0x382782){return db[_0x5144('0x7d')][_0x5144('0x7e')](function(_0x55aa1e){return db[_0x5144('0x7f')]['destroy']({'where':{'WhatsappAccountId':_0x4d07c9[_0x5144('0x63')]['id']},'transaction':_0x55aa1e})['then'](function(_0x561022){var _0x1db441=_[_0x5144('0x42')](_0x4d07c9[_0x5144('0x62')],function(_0xe6a7e8){_0xe6a7e8['WhatsappAccountId']=_0x4d07c9[_0x5144('0x63')]['id'];return _0xe6a7e8;});return db[_0x5144('0x7f')][_0x5144('0x80')](_0x1db441,{'transaction':_0x55aa1e});});})[_0x5144('0x37')](function(){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x4d07c9[_0x5144('0x63')]['id']},'order':_0x5144('0x81')});});}})[_0x5144('0x37')](respondWithResult(_0xfe4601,null))[_0x5144('0x2b')](handleError(_0xfe4601,null));};exports['getApplications']=function(_0x54673d,_0x2000ee,_0x8ca7e2){var _0x5150d4={};var _0x411336={};var _0x6c8d9;var _0x42fe52;return db[_0x5144('0x43')]['findOne']({'where':{'id':_0x54673d[_0x5144('0x63')]['id']}})[_0x5144('0x37')](handleEntityNotFound(_0x2000ee,null))[_0x5144('0x37')](function(_0x3ac696){if(_0x3ac696){_0x6c8d9=_0x3ac696;_0x411336[_0x5144('0x47')]=_[_0x5144('0x57')](db[_0x5144('0x7f')]['rawAttributes']);_0x411336['query']=_[_0x5144('0x57')](_0x54673d['query']);_0x411336['filters']=_[_0x5144('0x49')](_0x411336[_0x5144('0x47')],_0x411336['query']);_0x5150d4['attributes']=_[_0x5144('0x49')](_0x411336['model'],qs[_0x5144('0x4b')](_0x54673d[_0x5144('0x48')][_0x5144('0x4b')]));_0x5150d4[_0x5144('0x4a')]=_0x5150d4[_0x5144('0x4a')][_0x5144('0x58')]?_0x5150d4[_0x5144('0x4a')]:_0x411336[_0x5144('0x47')];_0x5150d4['order']=qs[_0x5144('0x4d')](_0x54673d['query'][_0x5144('0x4d')]);_0x5150d4[_0x5144('0x50')]=qs[_0x5144('0x4e')](_[_0x5144('0x6b')](_0x54673d['query'],_0x411336[_0x5144('0x4e')]));if(_0x54673d[_0x5144('0x48')][_0x5144('0x4f')]){_0x5150d4[_0x5144('0x50')]=_[_0x5144('0x51')](_0x5150d4['where'],{'$or':_[_0x5144('0x42')](_0x5150d4[_0x5144('0x4a')],function(_0x568cea){var _0x234f50={};_0x234f50[_0x568cea]={'$like':'%'+_0x54673d[_0x5144('0x48')][_0x5144('0x4f')]+'%'};return _0x234f50;})});}_0x5150d4=_['merge']({},_0x5150d4,_0x54673d[_0x5144('0x52')]);return _0x6c8d9[_0x5144('0x82')](_0x5150d4);}})[_0x5144('0x37')](function(_0x5fee45){if(_0x5fee45){_0x42fe52=_0x5fee45['length'];if(!_0x54673d[_0x5144('0x48')][_0x5144('0x69')](_0x5144('0x4c'))){_0x5150d4['limit']=qs['limit'](_0x54673d[_0x5144('0x48')][_0x5144('0x30')]);_0x5150d4[_0x5144('0x2e')]=qs[_0x5144('0x2e')](_0x54673d[_0x5144('0x48')][_0x5144('0x2e')]);}return _0x6c8d9[_0x5144('0x82')](_0x5150d4);}})[_0x5144('0x37')](function(_0x1105bc){if(_0x1105bc){return _0x1105bc?{'count':_0x42fe52,'rows':_0x1105bc}:null;}})[_0x5144('0x37')](respondWithResult(_0x2000ee,null))[_0x5144('0x2b')](handleError(_0x2000ee,null));};exports['notify']=function(_0x4ac76b,_0x4ab161,_0x46f635){var _0x23a955={'channel':_0x5144('0x83')};var _0x14ecbc=[];var _0x2c3808=[];var _0x47dab6={};return db[_0x5144('0x43')][_0x5144('0x5e')]({'where':{'id':_0x4ac76b[_0x5144('0x63')]['id']},'include':[{'model':db[_0x5144('0x7f')],'as':_0x5144('0x84')}]})[_0x5144('0x37')](handleEntityNotFound(_0x4ab161,null))[_0x5144('0x37')](function(_0x3b9f24){_0x23a955['account']=_0x3b9f24;_0x23a955[_0x5144('0x85')]=_['orderBy'](_0x3b9f24[_0x5144('0x84')],[_0x5144('0x81')],[_0x5144('0x86')]);if(_0x23a955[_0x5144('0x87')][_0x5144('0x84')]){delete _0x23a955['account'][_0x5144('0x84')];}return db['CmContact'][_0x5144('0x64')]();})[_0x5144('0x37')](function(_0x5b9aa3){if(!_0x5b9aa3){throw new db[(_0x5144('0x88'))][(_0x5144('0x89'))](_0x5144('0x8a'));}_0x14ecbc=_[_0x5144('0x8b')](_[_0x5144('0x57')](_0x5b9aa3),[_0x5144('0x8c'),'updatedAt']);_0x2c3808=_[_0x5144('0x8b')](_[_0x5144('0x57')](_0x5b9aa3),[_0x5144('0x8c'),_0x5144('0x8d'),_0x5144('0x8e'),'ListId']);_0x23a955[_0x5144('0x62')]={'mapKey':'mobile'};if(_0x23a955[_0x5144('0x87')][_0x5144('0x45')]&&_0x23a955[_0x5144('0x87')][_0x5144('0x45')]==='twilio'){_0x23a955[_0x5144('0x62')][_0x5144('0x8f')]=_0x4ac76b[_0x5144('0x62')][_0x5144('0x90')][_0x5144('0x91')]('whatsapp:','');_0x23a955[_0x5144('0x62')][_0x5144('0x62')]=_0x4ac76b[_0x5144('0x62')][_0x5144('0x92')];_0x23a955[_0x5144('0x62')][_0x5144('0x93')]=_0x4ac76b[_0x5144('0x62')][_0x5144('0x94')];}if(_0x23a955[_0x5144('0x62')]['id']){delete _0x23a955[_0x5144('0x62')]['id'];}if(_['isNil'](_0x23a955[_0x5144('0x62')][_0x5144('0x8f')])){throw new db[(_0x5144('0x88'))][(_0x5144('0x89'))](_0x5144('0x95'));}if(_['isNil'](_0x23a955[_0x5144('0x62')][_0x5144('0x62')])||_0x23a955[_0x5144('0x62')][_0x5144('0x62')]===''){throw new db[(_0x5144('0x88'))][(_0x5144('0x89'))](_0x5144('0x96'));}if(_[_0x5144('0x97')](_0x23a955[_0x5144('0x62')]['mapKey'])){throw new db['Sequelize'][(_0x5144('0x89'))](_0x5144('0x98')+_0x2c3808);}if(!_['includes'](_0x2c3808,_0x23a955[_0x5144('0x62')]['mapKey'])){throw new db['Sequelize'][(_0x5144('0x89'))](_0x5144('0x99')+_0x2c3808);}_0x47dab6[_0x23a955[_0x5144('0x62')][_0x5144('0x9a')]]=_0x23a955['body'][_0x5144('0x8f')];return db[_0x5144('0x9b')][_0x5144('0x5e')]({'where':{'id':_0x23a955[_0x5144('0x87')]['ListId']},'include':[{'model':db[_0x5144('0x9c')],'as':_0x5144('0x9d'),'where':_0x47dab6,'limit':0x1,'order':[[_0x5144('0x8d'),_0x5144('0x9e')]]}]});})[_0x5144('0x37')](handleEntityNotFound(_0x4ab161,null))[_0x5144('0x37')](function(_0xdf344a){if(_0xdf344a){_0x23a955['list']=_[_0x5144('0x73')](_0xdf344a,[_0x5144('0x9d')]);if(_0xdf344a['Contacts'][_0x5144('0x58')]){return _0xdf344a[_0x5144('0x9d')][0x0];}var _0x442144=_[_0x5144('0x1c')](_0x23a955[_0x5144('0x62')],{'firstName':_0x23a955[_0x5144('0x62')]['from'],'ListId':_0xdf344a['id']});_0x442144[_0x23a955['body'][_0x5144('0x9a')]]=_0x23a955[_0x5144('0x62')][_0x5144('0x8f')];return db[_0x5144('0x9c')][_0x5144('0x5a')](_0x442144,{'fields':_0x14ecbc,'raw':!![]});}})[_0x5144('0x37')](handleEntityNotFound(_0x4ab161,null))['then'](function(_0x4b755c){if(_0x4b755c){_0x23a955[_0x5144('0x9f')]=_0x4b755c;var _0x39ff6a={'ContactId':_0x4b755c['id'],'phone':_0x23a955[_0x5144('0x62')][_0x5144('0x8f')],'WhatsappAccountId':_0x4ac76b['params']['id']};var _0x545870={'ContactId':_0x4b755c['id'],'WhatsappAccountId':_0x4ac76b[_0x5144('0x63')]['id'],'closed':![]};return db[_0x5144('0xa0')][_0x5144('0x5e')]({'where':_0x545870})[_0x5144('0x37')](function(_0x3817f7){if(_0x3817f7){return[_0x3817f7,![]];}return db[_0x5144('0xa0')]['create'](_0x39ff6a)[_0x5144('0x37')](function(_0x4c8138){return[_0x4c8138,!![]];});});}})[_0x5144('0x74')](function(_0xb87a13,_0x296d82){_0x23a955[_0x5144('0xa1')]=_0xb87a13[_0x5144('0x39')]({'plain':!![]});_0x23a955[_0x5144('0xa1')][_0x5144('0xa2')]=![];if(_0x296d82){if(_0x23a955[_0x5144('0x87')][_0x5144('0xa3')]){_0x23a955['applications'][_0x5144('0xa4')]({'id':0x0,'priority':_0x23a955[_0x5144('0x85')][_0x5144('0x58')]+0x1,'app':_0x5144('0xa5'),'appdata':_0x5144('0xa6'),'interval':_0x5144('0xa7')});}_0x23a955[_0x5144('0xa1')][_0x5144('0xa2')]=!![];}return db[_0x5144('0xa8')][_0x5144('0x5a')]({'phone':_0x23a955['body'][_0x5144('0x8f')],'messageId':_0x23a955[_0x5144('0x62')][_0x5144('0x93')],'body':_0x23a955[_0x5144('0x62')][_0x5144('0x62')],'WhatsappAccountId':_0x4ac76b[_0x5144('0x63')]['id'],'WhatsappInteractionId':_0xb87a13['id'],'direction':'in','ContactId':_0xb87a13['ContactId'],'AttachmentId':_0x23a955[_0x5144('0x62')][_0x5144('0xa9')]});})[_0x5144('0x37')](function(_0x3015f4){_0x23a955[_0x5144('0x28')]=_0x3015f4;if(_0x23a955[_0x5144('0xa1')][_0x5144('0xaa')]){return db[_0x5144('0x7b')][_0x5144('0x5e')]({'attributes':['id','name'],'where':{'id':_0x23a955[_0x5144('0xa1')][_0x5144('0xaa')]}})['then'](function(_0x458669){if(_0x458669){_0x23a955[_0x5144('0x85')][_0x5144('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x458669[_0x5144('0x3d')]+','+(_0x23a955[_0x5144('0x87')][_0x5144('0xac')]||0xa),'interval':_0x5144('0xa7')});}return respondWithRpcPromise(_0x5144('0xad'),'startRouting',_0x23a955);});}return respondWithRpcPromise(_0x5144('0xad'),'startRouting',_0x23a955);})['then'](function(_0x5f1f47){if(_0x5f1f47){var _0x435f68=0xc8;var _0x376d51=_0x5144('0xae');logger['info'](_0x5144('0xaf'),_0x376d51,_0x435f68,'entity\x20found');logger[_0x5144('0xb0')](_0x5144('0xb1'),_0x376d51,_0x435f68,'entity\x20found',JSON[_0x5144('0xb2')](_0x5f1f47));if(_0x23a955['account']['type']===_0x5144('0xb3')){return _0x4ab161[_0x5144('0x2d')](_0x435f68)[_0x5144('0xb4')](_0x5144('0xb5'),_0x5144('0xb6'))[_0x5144('0x3e')]('\x0a');}else{return _0x4ab161[_0x5144('0x2d')](_0x435f68)[_0x5144('0x33')](_0x5f1f47);}}})['catch'](handleError(_0x4ab161,null));};exports['send']=function(_0x20882f,_0x5d60ba,_0x3b1dc4){var _0x16e50d,_0x2df132,_0x3f314d;if(_[_0x5144('0x97')](_0x20882f[_0x5144('0x62')][_0x5144('0x62')])||_0x20882f['body'][_0x5144('0x62')]===''){throw new db[(_0x5144('0x88'))][(_0x5144('0x89'))](_0x5144('0x96'));}if(_[_0x5144('0x97')](_0x20882f[_0x5144('0x62')]['to'])){throw new db[(_0x5144('0x88'))][(_0x5144('0x89'))](_0x5144('0xb7'));}_0x16e50d=_0x20882f[_0x5144('0x62')]['to'];return db[_0x5144('0x43')][_0x5144('0x5e')]({'where':{'id':_0x20882f['params']['id']},'include':[{'model':db[_0x5144('0x9b')],'as':_0x5144('0xb8'),'include':[{'model':db[_0x5144('0x9c')],'as':_0x5144('0x9d'),'where':{'mobile':_0x16e50d},'limit':0x1,'order':[[_0x5144('0x8d'),_0x5144('0x9e')]]}]}]})[_0x5144('0x37')](handleEntityNotFound(_0x5d60ba,null))[_0x5144('0x37')](function(_0x54fd0d){if(_0x54fd0d&&_0x54fd0d[_0x5144('0xb8')]){_0x2df132=_0x54fd0d[_0x5144('0x39')]({'plain':!![]});if(_0x2df132['List']&&_0x2df132[_0x5144('0xb8')][_0x5144('0x9d')][_0x5144('0x58')]){return _0x2df132[_0x5144('0xb8')]['Contacts'][0x0];}return db[_0x5144('0x9c')][_0x5144('0x5a')](_[_0x5144('0x1c')](_0x20882f[_0x5144('0x62')],{'firstName':_0x16e50d,'mobile':_0x16e50d,'phone':_0x16e50d,'ListId':_0x2df132[_0x5144('0xb9')]}));}})['then'](handleEntityNotFound(_0x5d60ba,null))[_0x5144('0x37')](function(_0x3449b0){if(_0x3449b0){_0x3f314d=_0x3449b0;return db[_0x5144('0xa0')][_0x5144('0x5e')]({'where':{'ContactId':_0x3f314d['id'],'closed':![],'WhatsappAccountId':_0x2df132['id']}})[_0x5144('0x37')](function(_0x5554b5){if(_0x5554b5){return[_0x5554b5,![]];}return db[_0x5144('0xa0')][_0x5144('0x5a')]({'UserId':_0x20882f[_0x5144('0x5b')]['id'],'ContactId':_0x3f314d['id'],'WhatsappAccountId':_0x2df132['id'],'phone':_0x16e50d,'firstMsgDirection':_0x5144('0xba'),'Messages':[_[_0x5144('0x51')](_0x20882f[_0x5144('0x62')],{'read':![],'body':_0x20882f[_0x5144('0x62')]['body'],'phone':_0x16e50d,'WhatsappAccountId':_0x2df132['id'],'UserId':_0x20882f['user']['id'],'ContactId':_0x3f314d['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x5144('0xbb')}]})[_0x5144('0x37')](function(_0x450c3e){return[_0x450c3e,!![]];});});}})[_0x5144('0x74')](function(_0x4cbc8b,_0x15c961){if(_0x15c961){return _0x4cbc8b;}return db[_0x5144('0xa8')][_0x5144('0x5a')](_['merge'](_0x20882f[_0x5144('0x62')],{'read':![],'body':_0x20882f[_0x5144('0x62')]['body'],'phone':_0x16e50d,'WhatsappAccountId':_0x2df132['id'],'WhatsappInteractionId':_0x4cbc8b['id'],'UserId':_0x20882f['user']['id'],'ContactId':_0x3f314d['id']}))[_0x5144('0x37')](function(_0x5c845c){_0x4cbc8b[_0x5144('0xbc')][_0x5144('0xbb')]=[];_0x4cbc8b[_0x5144('0xbc')]['Messages'][_0x5144('0xa4')](_0x5c845c[_0x5144('0xbc')]);return _0x4cbc8b;});})[_0x5144('0x37')](respondWithResult(_0x5d60ba,null))[_0x5144('0x2b')](handleError(_0x5d60ba,null));}; \ No newline at end of file +var _0xc15b=['client','http','request','info','request\x20sent','debug','stringify','error','message','WhatsappAccount,\x20%s,\x20%s','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','filters','filter','where','merge','VIRTUAL','includeAll','rows','params','keys','include','options','find','body','user','role','WhatsappAccounts','UserProfileSection','autoAssociation','describe','addDisposition','WhatsappAccountId','create','getDispositions','findOne','Disposition','order','pick','removeDispositions','addAnswer','CannedAnswer','hasOwnProperty','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','whatsapp','Applications','applications','orderBy','priority','account','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','MessageSid','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','defaults','CmContact','contact','WhatsappInteraction','interaction','get','created','close','unmanaged','*,*,*,*','WhatsappMessage','messageId','UserId','unshift','agent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','to\x20is\x20mandatory','List','dataValues','Messages','push','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise'];(function(_0x1bd245,_0x351ead){var _0x306d36=function(_0x17e32f){while(--_0x17e32f){_0x1bd245['push'](_0x1bd245['shift']());}};_0x306d36(++_0x351ead);}(_0xc15b,0x145));var _0xbc15=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xc15b[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require(_0xbc15('0x0'));var rimraf=require(_0xbc15('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc15('0x2'));var rp=require('request-promise');var moment=require(_0xbc15('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbc15('0x4'));var util=require('util');var path=require(_0xbc15('0x5'));var sox=require('sox');var csv=require(_0xbc15('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc15('0x7'));var _=require(_0xbc15('0x8'));var squel=require(_0xbc15('0x9'));var crypto=require(_0xbc15('0xa'));var jsforce=require(_0xbc15('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbc15('0x6'));var querystring=require('querystring');var Papa=require(_0xbc15('0xc'));var Redis=require(_0xbc15('0xd'));var authService=require(_0xbc15('0xe'));var qs=require(_0xbc15('0xf'));var as=require(_0xbc15('0x10'));var hardwareService=require(_0xbc15('0x11'));var logger=require('../../config/logger')(_0xbc15('0x12'));var utils=require(_0xbc15('0x13'));var config=require(_0xbc15('0x14'));var licenseUtil=require(_0xbc15('0x15'));var db=require(_0xbc15('0x16'))['db'];config[_0xbc15('0x17')]=_['defaults'](config[_0xbc15('0x17')],{'host':_0xbc15('0x18'),'port':0x18eb});var socket=require(_0xbc15('0x19'))(new Redis(config[_0xbc15('0x17')]));require(_0xbc15('0x1a'))[_0xbc15('0x1b')](socket);var jayson=require(_0xbc15('0x1c'));var client=jayson[_0xbc15('0x1d')][_0xbc15('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x16764d,_0xd673f7,_0x3db34d,_0x2eb56e){return new BPromise(function(_0x4da542,_0x5c27b8){var _0x25b8c2=_0x2eb56e||client;return _0x25b8c2[_0xbc15('0x1f')](_0x16764d,_0x3db34d)['then'](function(_0x2456fb){logger[_0xbc15('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0xd673f7,_0xbc15('0x21'));logger[_0xbc15('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xd673f7,_0xbc15('0x21'),JSON[_0xbc15('0x23')](_0x2456fb));if(_0x2456fb[_0xbc15('0x24')]){if(_0x2456fb[_0xbc15('0x24')]['code']===0x1f4){logger[_0xbc15('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0xd673f7,_0x2456fb[_0xbc15('0x24')][_0xbc15('0x25')]);return _0x5c27b8(_0x2456fb['error'][_0xbc15('0x25')]);}logger['error'](_0xbc15('0x26'),_0xd673f7,_0x2456fb['error']['message']);return _0x4da542(_0x2456fb[_0xbc15('0x24')]['message']);}else{logger['info'](_0xbc15('0x26'),_0xd673f7,_0xbc15('0x21'));_0x4da542(_0x2456fb['result']['message']);}})[_0xbc15('0x27')](function(_0x283044){logger[_0xbc15('0x24')](_0xbc15('0x26'),_0xd673f7,_0x283044);_0x5c27b8(_0x283044);});});}function respondWithStatusCode(_0x26fe5b,_0x39d268){_0x39d268=_0x39d268||0xcc;return function(_0x3469d3){if(_0x3469d3){return _0x26fe5b['sendStatus'](_0x39d268);}return _0x26fe5b['status'](_0x39d268)['end']();};}function respondWithResult(_0x2792ee,_0x2d00a3){_0x2d00a3=_0x2d00a3||0xc8;return function(_0x46d156){if(_0x46d156){return _0x2792ee[_0xbc15('0x28')](_0x2d00a3)[_0xbc15('0x29')](_0x46d156);}};}function respondWithFilteredResult(_0xa2e726,_0x128344){return function(_0x4d7dbb){if(_0x4d7dbb){var _0xacc394=typeof _0x128344[_0xbc15('0x2a')]===_0xbc15('0x2b')&&typeof _0x128344[_0xbc15('0x2c')]===_0xbc15('0x2b');var _0x3c2594=_0x4d7dbb['count'];var _0x4f097f=_0xacc394?0x0:_0x128344['offset'];var _0x38585e=_0xacc394?_0x4d7dbb[_0xbc15('0x2d')]:_0x128344['offset']+_0x128344[_0xbc15('0x2c')];var _0x30724a;if(_0x38585e>=_0x3c2594){_0x38585e=_0x3c2594;_0x30724a=0xc8;}else{_0x30724a=0xce;}_0xa2e726[_0xbc15('0x28')](_0x30724a);return _0xa2e726[_0xbc15('0x2e')](_0xbc15('0x2f'),_0x4f097f+'-'+_0x38585e+'/'+_0x3c2594)[_0xbc15('0x29')](_0x4d7dbb);}return null;};}function patchUpdates(_0x5ef0db){return function(_0x300e4f){try{jsonpatch[_0xbc15('0x30')](_0x300e4f,_0x5ef0db,!![]);}catch(_0x3b54e6){return BPromise[_0xbc15('0x31')](_0x3b54e6);}return _0x300e4f['save']();};}function saveUpdates(_0xb2d3ad,_0x1a2aed){return function(_0x40d37a){if(_0x40d37a){return _0x40d37a['update'](_0xb2d3ad)[_0xbc15('0x32')](function(_0x2f2165){return _0x2f2165;});}return null;};}function removeEntity(_0x3b09af,_0x5d49ef){return function(_0x541a43){if(_0x541a43){return _0x541a43[_0xbc15('0x33')]()['then'](function(){var _0x4f8f0d=_0x541a43['get']({'plain':!![]});var _0x4ed6a7='WhatsappAccounts';return db['UserProfileResource'][_0xbc15('0x33')]({'where':{'type':_0x4ed6a7,'resourceId':_0x4f8f0d['id']}})['then'](function(){return _0x541a43;});})['then'](function(){_0x3b09af[_0xbc15('0x28')](0xcc)[_0xbc15('0x34')]();});}};}function handleEntityNotFound(_0x409750,_0x3a3ca6){return function(_0x53427e){if(!_0x53427e){_0x409750['sendStatus'](0x194);}return _0x53427e;};}function handleError(_0x2b5d55,_0x5deb0c){_0x5deb0c=_0x5deb0c||0x1f4;return function(_0x9bff0d){logger[_0xbc15('0x24')](_0x9bff0d[_0xbc15('0x35')]);if(_0x9bff0d[_0xbc15('0x36')]){delete _0x9bff0d['name'];}_0x2b5d55[_0xbc15('0x28')](_0x5deb0c)['send'](_0x9bff0d);};}exports[_0xbc15('0x37')]=function(_0x2ce517,_0x299da5){var _0x30325f={'include':[{'model':db[_0xbc15('0x38')],'as':_0xbc15('0x39')}]},_0x4f0511={},_0x18f429={'count':0x0,'rows':[]};var _0x21da7c=_[_0xbc15('0x3a')](db[_0xbc15('0x3b')][_0xbc15('0x3c')],function(_0x2f5a18){return{'name':_0x2f5a18[_0xbc15('0x3d')],'type':_0x2f5a18[_0xbc15('0x3e')]['key']};});_0x4f0511[_0xbc15('0x3f')]=_[_0xbc15('0x3a')](_0x21da7c,_0xbc15('0x36'));_0x4f0511[_0xbc15('0x40')]=_['keys'](_0x2ce517[_0xbc15('0x40')]);_0x4f0511['filters']=_[_0xbc15('0x41')](_0x4f0511[_0xbc15('0x3f')],_0x4f0511['query']);_0x30325f[_0xbc15('0x42')]=_[_0xbc15('0x41')](_0x4f0511[_0xbc15('0x3f')],qs[_0xbc15('0x43')](_0x2ce517[_0xbc15('0x40')][_0xbc15('0x43')]));_0x30325f['attributes']=_0x30325f[_0xbc15('0x42')][_0xbc15('0x44')]?_0x30325f['attributes']:_0x4f0511['model'];if(!_0x2ce517['query']['hasOwnProperty'](_0xbc15('0x45'))){_0x30325f['limit']=qs[_0xbc15('0x2c')](_0x2ce517[_0xbc15('0x40')][_0xbc15('0x2c')]);_0x30325f['offset']=qs[_0xbc15('0x2a')](_0x2ce517[_0xbc15('0x40')][_0xbc15('0x2a')]);}_0x30325f['order']=qs[_0xbc15('0x46')](_0x2ce517[_0xbc15('0x40')][_0xbc15('0x46')]);_0x30325f['where']=qs['filters'](_['pick'](_0x2ce517[_0xbc15('0x40')],_0x4f0511[_0xbc15('0x47')]),_0x21da7c);if(_0x2ce517['query'][_0xbc15('0x48')]){_0x30325f[_0xbc15('0x49')]=_[_0xbc15('0x4a')](_0x30325f[_0xbc15('0x49')],{'$or':_[_0xbc15('0x3a')](_0x21da7c,function(_0x2ef6db){if(_0x2ef6db[_0xbc15('0x3e')]!==_0xbc15('0x4b')){var _0x17d1d0={};_0x17d1d0[_0x2ef6db[_0xbc15('0x36')]]={'$like':'%'+_0x2ce517[_0xbc15('0x40')][_0xbc15('0x48')]+'%'};return _0x17d1d0;}})});}_0x30325f=_['merge']({},_0x30325f,_0x2ce517['options']);var _0xb09aee={'where':_0x30325f['where']};return db[_0xbc15('0x3b')]['count'](_0xb09aee)['then'](function(_0x440499){_0x18f429[_0xbc15('0x2d')]=_0x440499;if(_0x2ce517[_0xbc15('0x40')][_0xbc15('0x4c')]){_0x30325f['include']=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x30325f);})[_0xbc15('0x32')](function(_0x2c005c){_0x18f429[_0xbc15('0x4d')]=_0x2c005c;return _0x18f429;})[_0xbc15('0x32')](respondWithFilteredResult(_0x299da5,_0x30325f))[_0xbc15('0x27')](handleError(_0x299da5,null));};exports['show']=function(_0x4f28ea,_0x51d24f){var _0x1807b9={'raw':![],'where':{'id':_0x4f28ea[_0xbc15('0x4e')]['id']},'include':[{'model':db[_0xbc15('0x38')],'as':'mandatoryDispositionPause'}]},_0x485574={};_0x485574[_0xbc15('0x3f')]=_[_0xbc15('0x4f')](db[_0xbc15('0x3b')]['rawAttributes']);_0x485574[_0xbc15('0x40')]=_[_0xbc15('0x4f')](_0x4f28ea[_0xbc15('0x40')]);_0x485574[_0xbc15('0x47')]=_[_0xbc15('0x41')](_0x485574['model'],_0x485574[_0xbc15('0x40')]);_0x1807b9['attributes']=_[_0xbc15('0x41')](_0x485574[_0xbc15('0x3f')],qs[_0xbc15('0x43')](_0x4f28ea[_0xbc15('0x40')][_0xbc15('0x43')]));_0x1807b9['attributes']=_0x1807b9[_0xbc15('0x42')]['length']?_0x1807b9[_0xbc15('0x42')]:_0x485574['model'];if(_0x4f28ea[_0xbc15('0x40')]['includeAll']){_0x1807b9[_0xbc15('0x50')]=[{'all':!![]}];}_0x1807b9=_[_0xbc15('0x4a')]({},_0x1807b9,_0x4f28ea[_0xbc15('0x51')]);return db['WhatsappAccount'][_0xbc15('0x52')](_0x1807b9)[_0xbc15('0x32')](handleEntityNotFound(_0x51d24f,null))[_0xbc15('0x32')](respondWithResult(_0x51d24f,null))[_0xbc15('0x27')](handleError(_0x51d24f,null));};exports['create']=function(_0x44a0fd,_0x9065f2){return db['WhatsappAccount']['create'](_0x44a0fd[_0xbc15('0x53')],{})['then'](function(_0x86c698){var _0x2fd32e=_0x44a0fd[_0xbc15('0x54')]['get']({'plain':!![]});if(!_0x2fd32e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fd32e[_0xbc15('0x55')]===_0xbc15('0x54')){var _0x162f39=_0x86c698['get']({'plain':!![]});var _0x26dcd5=_0xbc15('0x56');return db[_0xbc15('0x57')]['find']({'where':{'name':_0x26dcd5,'userProfileId':_0x2fd32e['userProfileId']},'raw':!![]})['then'](function(_0x2f9e1a){if(_0x2f9e1a&&_0x2f9e1a[_0xbc15('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x162f39[_0xbc15('0x36')],'resourceId':_0x162f39['id'],'type':_0x2f9e1a[_0xbc15('0x36')],'sectionId':_0x2f9e1a['id']},{})['then'](function(){return _0x86c698;});}else{return _0x86c698;}})[_0xbc15('0x27')](function(_0x4fbb2d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fbb2d);throw _0x4fbb2d;});}return _0x86c698;})[_0xbc15('0x32')](respondWithResult(_0x9065f2,0xc9))['catch'](handleError(_0x9065f2,null));};exports['update']=function(_0x3fb0e7,_0x398600){if(_0x3fb0e7[_0xbc15('0x53')]['id']){delete _0x3fb0e7['body']['id'];}return db[_0xbc15('0x3b')][_0xbc15('0x52')]({'where':{'id':_0x3fb0e7[_0xbc15('0x4e')]['id']},'include':[{'model':db[_0xbc15('0x38')],'as':_0xbc15('0x39')}]})[_0xbc15('0x32')](handleEntityNotFound(_0x398600,null))['then'](saveUpdates(_0x3fb0e7[_0xbc15('0x53')],null))[_0xbc15('0x32')](respondWithResult(_0x398600,null))[_0xbc15('0x27')](handleError(_0x398600,null));};exports[_0xbc15('0x33')]=function(_0xde5f39,_0x3c9d83){return db[_0xbc15('0x3b')]['find']({'where':{'id':_0xde5f39[_0xbc15('0x4e')]['id']}})[_0xbc15('0x32')](handleEntityNotFound(_0x3c9d83,null))['then'](removeEntity(_0x3c9d83,null))[_0xbc15('0x27')](handleError(_0x3c9d83,null));};exports[_0xbc15('0x59')]=function(_0x2b74d3,_0x46c11b){return db['WhatsappAccount'][_0xbc15('0x59')]()[_0xbc15('0x32')](respondWithResult(_0x46c11b,null))[_0xbc15('0x27')](handleError(_0x46c11b,null));};exports[_0xbc15('0x5a')]=function(_0x51cf2a,_0x11e1cd,_0x3fd2e3){if(_0x51cf2a[_0xbc15('0x53')]['id']){delete _0x51cf2a[_0xbc15('0x53')]['id'];}return db[_0xbc15('0x3b')][_0xbc15('0x52')]({'where':{'id':_0x51cf2a[_0xbc15('0x4e')]['id']}})[_0xbc15('0x32')](handleEntityNotFound(_0x11e1cd,null))['then'](function(_0x1d751b){if(_0x1d751b){_0x51cf2a[_0xbc15('0x53')][_0xbc15('0x5b')]=_0x1d751b['id'];return db['Disposition'][_0xbc15('0x5c')](_0x51cf2a['body']);}})[_0xbc15('0x32')](respondWithResult(_0x11e1cd,null))[_0xbc15('0x27')](handleError(_0x11e1cd,null));};exports[_0xbc15('0x5d')]=function(_0x481585,_0x3b0445,_0x35fbf6){var _0x2f98d1={'raw':![],'where':{}};var _0x5da47d={};var _0x3b1406={'count':0x0,'rows':[]};return db[_0xbc15('0x3b')][_0xbc15('0x5e')]({'where':{'id':_0x481585[_0xbc15('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3b0445,null))['then'](function(_0x3bb5bf){if(_0x3bb5bf){_0x5da47d['model']=_['keys'](db[_0xbc15('0x5f')]['rawAttributes']);_0x5da47d[_0xbc15('0x40')]=_['keys'](_0x481585[_0xbc15('0x40')]);_0x5da47d['filters']=_[_0xbc15('0x41')](_0x5da47d['model'],_0x5da47d[_0xbc15('0x40')]);_0x2f98d1[_0xbc15('0x42')]=_[_0xbc15('0x41')](_0x5da47d[_0xbc15('0x3f')],qs['fields'](_0x481585[_0xbc15('0x40')][_0xbc15('0x43')]));_0x2f98d1[_0xbc15('0x42')]=_0x2f98d1[_0xbc15('0x42')]['length']?_0x2f98d1[_0xbc15('0x42')]:_0x5da47d[_0xbc15('0x3f')];if(!_0x481585[_0xbc15('0x40')]['hasOwnProperty'](_0xbc15('0x45'))){_0x2f98d1[_0xbc15('0x2c')]=qs['limit'](_0x481585[_0xbc15('0x40')]['limit']);_0x2f98d1[_0xbc15('0x2a')]=qs[_0xbc15('0x2a')](_0x481585['query'][_0xbc15('0x2a')]);}_0x2f98d1[_0xbc15('0x60')]=qs[_0xbc15('0x46')](_0x481585[_0xbc15('0x40')]['sort']);_0x2f98d1[_0xbc15('0x49')]=qs['filters'](_[_0xbc15('0x61')](_0x481585[_0xbc15('0x40')],_0x5da47d['filters']));_0x2f98d1['where'][_0xbc15('0x5b')]=_0x3bb5bf['id'];if(_0x481585['query'][_0xbc15('0x48')]){_0x2f98d1[_0xbc15('0x49')]=_[_0xbc15('0x4a')](_0x2f98d1[_0xbc15('0x49')],{'$or':_[_0xbc15('0x3a')](_0x2f98d1[_0xbc15('0x42')],function(_0x29cfee){var _0x30b63c={};_0x30b63c[_0x29cfee]={'$like':'%'+_0x481585['query'][_0xbc15('0x48')]+'%'};return _0x30b63c;})});}_0x2f98d1=_[_0xbc15('0x4a')]({},_0x2f98d1,_0x481585['options']);return db[_0xbc15('0x5f')]['count']({'where':_0x2f98d1[_0xbc15('0x49')]})[_0xbc15('0x32')](function(_0x2e7778){_0x3b1406[_0xbc15('0x2d')]=_0x2e7778;if(_0x481585[_0xbc15('0x40')]['includeAll']){_0x2f98d1[_0xbc15('0x50')]=[{'all':!![]}];}return db[_0xbc15('0x5f')]['findAll'](_0x2f98d1);})[_0xbc15('0x32')](function(_0x1fffc7){_0x3b1406[_0xbc15('0x4d')]=_0x1fffc7;return _0x3b1406;});}})[_0xbc15('0x32')](respondWithFilteredResult(_0x3b0445,_0x2f98d1))['catch'](handleError(_0x3b0445,null));};exports[_0xbc15('0x62')]=function(_0x389b86,_0x1dbae1,_0x3951b5){return db[_0xbc15('0x3b')]['find']({'where':{'id':_0x389b86[_0xbc15('0x4e')]['id']}})[_0xbc15('0x32')](handleEntityNotFound(_0x1dbae1,null))['then'](function(_0x461ffb){if(_0x461ffb){return _0x461ffb[_0xbc15('0x62')](_0x389b86[_0xbc15('0x40')]['ids']);}})[_0xbc15('0x32')](respondWithStatusCode(_0x1dbae1,null))[_0xbc15('0x27')](handleError(_0x1dbae1,null));};exports[_0xbc15('0x63')]=function(_0x4757b3,_0x3e42a6,_0x2b50a6){if(_0x4757b3[_0xbc15('0x53')]['id']){delete _0x4757b3['body']['id'];}return db[_0xbc15('0x3b')][_0xbc15('0x52')]({'where':{'id':_0x4757b3[_0xbc15('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3e42a6,null))['then'](function(_0x540ac2){if(_0x540ac2){_0x4757b3[_0xbc15('0x53')][_0xbc15('0x5b')]=_0x540ac2['id'];return db[_0xbc15('0x64')][_0xbc15('0x5c')](_0x4757b3[_0xbc15('0x53')]);}})['then'](respondWithResult(_0x3e42a6,null))[_0xbc15('0x27')](handleError(_0x3e42a6,null));};exports['getAnswers']=function(_0x4c1823,_0xbf3c99,_0x32ec4f){var _0x3b235a={'raw':![],'where':{}};var _0x3ab687={};var _0x2be0f5={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xbc15('0x5e')]({'where':{'id':_0x4c1823[_0xbc15('0x4e')]['id']}})[_0xbc15('0x32')](handleEntityNotFound(_0xbf3c99,null))[_0xbc15('0x32')](function(_0x21c919){if(_0x21c919){_0x3ab687[_0xbc15('0x3f')]=_[_0xbc15('0x4f')](db[_0xbc15('0x64')][_0xbc15('0x3c')]);_0x3ab687[_0xbc15('0x40')]=_['keys'](_0x4c1823[_0xbc15('0x40')]);_0x3ab687[_0xbc15('0x47')]=_[_0xbc15('0x41')](_0x3ab687[_0xbc15('0x3f')],_0x3ab687[_0xbc15('0x40')]);_0x3b235a[_0xbc15('0x42')]=_['intersection'](_0x3ab687[_0xbc15('0x3f')],qs['fields'](_0x4c1823[_0xbc15('0x40')]['fields']));_0x3b235a[_0xbc15('0x42')]=_0x3b235a[_0xbc15('0x42')][_0xbc15('0x44')]?_0x3b235a['attributes']:_0x3ab687[_0xbc15('0x3f')];if(!_0x4c1823[_0xbc15('0x40')][_0xbc15('0x65')](_0xbc15('0x45'))){_0x3b235a[_0xbc15('0x2c')]=qs[_0xbc15('0x2c')](_0x4c1823['query']['limit']);_0x3b235a[_0xbc15('0x2a')]=qs[_0xbc15('0x2a')](_0x4c1823[_0xbc15('0x40')]['offset']);}_0x3b235a[_0xbc15('0x60')]=qs[_0xbc15('0x46')](_0x4c1823['query'][_0xbc15('0x46')]);_0x3b235a[_0xbc15('0x49')]=qs[_0xbc15('0x47')](_['pick'](_0x4c1823[_0xbc15('0x40')],_0x3ab687[_0xbc15('0x47')]));_0x3b235a[_0xbc15('0x49')][_0xbc15('0x5b')]=_0x21c919['id'];if(_0x4c1823[_0xbc15('0x40')][_0xbc15('0x48')]){_0x3b235a[_0xbc15('0x49')]=_[_0xbc15('0x4a')](_0x3b235a[_0xbc15('0x49')],{'$or':_[_0xbc15('0x3a')](_0x3b235a[_0xbc15('0x42')],function(_0x4248dd){var _0x1a6689={};_0x1a6689[_0x4248dd]={'$like':'%'+_0x4c1823[_0xbc15('0x40')]['filter']+'%'};return _0x1a6689;})});}_0x3b235a=_['merge']({},_0x3b235a,_0x4c1823[_0xbc15('0x51')]);return db[_0xbc15('0x64')][_0xbc15('0x2d')]({'where':_0x3b235a[_0xbc15('0x49')]})[_0xbc15('0x32')](function(_0x36df7d){_0x2be0f5[_0xbc15('0x2d')]=_0x36df7d;if(_0x4c1823[_0xbc15('0x40')]['includeAll']){_0x3b235a[_0xbc15('0x50')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3b235a);})[_0xbc15('0x32')](function(_0x4473a0){_0x2be0f5[_0xbc15('0x4d')]=_0x4473a0;return _0x2be0f5;});}})[_0xbc15('0x32')](respondWithFilteredResult(_0xbf3c99,_0x3b235a))[_0xbc15('0x27')](handleError(_0xbf3c99,null));};exports[_0xbc15('0x66')]=function(_0x3f9c0f,_0x597c1d,_0x3d65e4){return db[_0xbc15('0x3b')][_0xbc15('0x52')]({'where':{'id':_0x3f9c0f['params']['id']}})[_0xbc15('0x32')](handleEntityNotFound(_0x597c1d,null))[_0xbc15('0x32')](function(_0x22f2a0){if(_0x22f2a0){return _0x22f2a0[_0xbc15('0x66')](_0x3f9c0f[_0xbc15('0x40')][_0xbc15('0x67')]);}})[_0xbc15('0x32')](respondWithStatusCode(_0x597c1d,null))[_0xbc15('0x27')](handleError(_0x597c1d,null));};exports[_0xbc15('0x68')]=function(_0x3dc5fb,_0x1c16e4,_0x2b8678){return db[_0xbc15('0x3b')]['find']({'where':{'id':_0x3dc5fb['params']['id']}})['then'](handleEntityNotFound(_0x1c16e4,null))[_0xbc15('0x32')](function(_0x356909){if(_0x356909){return _0x356909[_0xbc15('0x68')](_0x3dc5fb[_0xbc15('0x53')][_0xbc15('0x67')],_[_0xbc15('0x69')](_0x3dc5fb[_0xbc15('0x53')],['ids','id'])||{})[_0xbc15('0x6a')](function(_0x3c9146){for(var _0xb2639b=0x0;_0xb2639b<_0x3dc5fb['body'][_0xbc15('0x67')][_0xbc15('0x44')];_0xb2639b+=0x1){socket[_0xbc15('0x6b')](_0xbc15('0x6c'),{'UserId':Number(_0x3dc5fb[_0xbc15('0x53')]['ids'][_0xb2639b]),'WhatsappAccountId':Number(_0x3dc5fb[_0xbc15('0x4e')]['id'])});}return _0x3c9146;});}})[_0xbc15('0x32')](respondWithResult(_0x1c16e4,null))[_0xbc15('0x27')](handleError(_0x1c16e4,null));};exports[_0xbc15('0x6d')]=function(_0x308566,_0x478ff3,_0x3fe6e7){return db[_0xbc15('0x3b')][_0xbc15('0x52')]({'where':{'id':_0x308566[_0xbc15('0x4e')]['id']}})[_0xbc15('0x32')](handleEntityNotFound(_0x478ff3,null))['then'](function(_0x5cd00c){if(_0x5cd00c){return _0x5cd00c['removeAgents'](_0x308566['query'][_0xbc15('0x67')])[_0xbc15('0x32')](function(){if(_['isArray'](_0x308566[_0xbc15('0x40')]['ids'])){for(var _0x483024=0x0;_0x483024<_0x308566[_0xbc15('0x40')][_0xbc15('0x67')][_0xbc15('0x44')];_0x483024+=0x1){socket['emit'](_0xbc15('0x6e'),{'UserId':Number(_0x308566['query']['ids'][_0x483024]),'WhatsappAccountId':Number(_0x308566[_0xbc15('0x4e')]['id'])});}}else{socket['emit'](_0xbc15('0x6e'),{'UserId':Number(_0x308566[_0xbc15('0x40')][_0xbc15('0x67')]),'WhatsappAccountId':Number(_0x308566[_0xbc15('0x4e')]['id'])});}});}})[_0xbc15('0x32')](respondWithStatusCode(_0x478ff3,null))[_0xbc15('0x27')](handleError(_0x478ff3,null));};exports[_0xbc15('0x6f')]=function(_0x1cf100,_0x5f5979,_0x55ea24){var _0xfdb95b={};var _0x1e4a09={};var _0x89c6bb;var _0x4f6a3b;return db[_0xbc15('0x3b')][_0xbc15('0x5e')]({'where':{'id':_0x1cf100[_0xbc15('0x4e')]['id']}})[_0xbc15('0x32')](handleEntityNotFound(_0x5f5979,null))['then'](function(_0x558473){if(_0x558473){_0x89c6bb=_0x558473;_0x1e4a09[_0xbc15('0x3f')]=_[_0xbc15('0x4f')](db[_0xbc15('0x70')][_0xbc15('0x3c')]);_0x1e4a09[_0xbc15('0x40')]=_[_0xbc15('0x4f')](_0x1cf100['query']);_0x1e4a09[_0xbc15('0x47')]=_[_0xbc15('0x41')](_0x1e4a09[_0xbc15('0x3f')],_0x1e4a09[_0xbc15('0x40')]);_0xfdb95b[_0xbc15('0x42')]=_['intersection'](_0x1e4a09[_0xbc15('0x3f')],qs[_0xbc15('0x43')](_0x1cf100[_0xbc15('0x40')][_0xbc15('0x43')]));_0xfdb95b['attributes']=_0xfdb95b[_0xbc15('0x42')]['length']?_0xfdb95b[_0xbc15('0x42')]:_0x1e4a09[_0xbc15('0x3f')];_0xfdb95b[_0xbc15('0x60')]=qs[_0xbc15('0x46')](_0x1cf100[_0xbc15('0x40')][_0xbc15('0x46')]);_0xfdb95b['where']=qs[_0xbc15('0x47')](_[_0xbc15('0x61')](_0x1cf100[_0xbc15('0x40')],_0x1e4a09[_0xbc15('0x47')]));if(_0x1cf100['query']['filter']){_0xfdb95b[_0xbc15('0x49')]=_[_0xbc15('0x4a')](_0xfdb95b[_0xbc15('0x49')],{'$or':_[_0xbc15('0x3a')](_0xfdb95b['attributes'],function(_0x3c654c){var _0xa5ccdd={};_0xa5ccdd[_0x3c654c]={'$like':'%'+_0x1cf100[_0xbc15('0x40')][_0xbc15('0x48')]+'%'};return _0xa5ccdd;})});}_0xfdb95b=_[_0xbc15('0x4a')]({},_0xfdb95b,_0x1cf100[_0xbc15('0x51')]);return _0x89c6bb[_0xbc15('0x6f')](_0xfdb95b);}})['then'](function(_0x56b2e6){if(_0x56b2e6){_0x4f6a3b=_0x56b2e6[_0xbc15('0x44')];if(!_0x1cf100['query']['hasOwnProperty'](_0xbc15('0x45'))){_0xfdb95b[_0xbc15('0x2c')]=qs[_0xbc15('0x2c')](_0x1cf100[_0xbc15('0x40')][_0xbc15('0x2c')]);_0xfdb95b[_0xbc15('0x2a')]=qs[_0xbc15('0x2a')](_0x1cf100[_0xbc15('0x40')][_0xbc15('0x2a')]);}return _0x89c6bb[_0xbc15('0x6f')](_0xfdb95b);}})[_0xbc15('0x32')](function(_0x1f0d82){if(_0x1f0d82){return _0x1f0d82?{'count':_0x4f6a3b,'rows':_0x1f0d82}:null;}})['then'](respondWithResult(_0x5f5979,null))[_0xbc15('0x27')](handleError(_0x5f5979,null));};exports['addApplications']=function(_0x55a0a1,_0x148341,_0x1d059b){return db[_0xbc15('0x3b')][_0xbc15('0x5e')]({'where':{'id':_0x55a0a1[_0xbc15('0x4e')]['id']}})['then'](handleEntityNotFound(_0x148341,null))['then'](function(_0xb626bf){if(_0xb626bf){return db['sequelize'][_0xbc15('0x71')](function(_0xf3354d){return db[_0xbc15('0x72')][_0xbc15('0x33')]({'where':{'WhatsappAccountId':_0x55a0a1['params']['id']},'transaction':_0xf3354d})['then'](function(_0x34bed3){var _0x579cfb=_[_0xbc15('0x3a')](_0x55a0a1[_0xbc15('0x53')],function(_0x51ea86){_0x51ea86[_0xbc15('0x5b')]=_0x55a0a1[_0xbc15('0x4e')]['id'];return _0x51ea86;});return db[_0xbc15('0x72')][_0xbc15('0x73')](_0x579cfb,{'transaction':_0xf3354d});});})[_0xbc15('0x32')](function(){return db['WhatsappApplication'][_0xbc15('0x74')]({'where':{'WhatsappAccountId':_0x55a0a1[_0xbc15('0x4e')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x148341,null))[_0xbc15('0x27')](handleError(_0x148341,null));};exports['getApplications']=function(_0x216ffd,_0x468df6,_0x1f7e5e){var _0x2c9ba7={};var _0x3e950d={};var _0x33f27b;var _0x4245e5;return db['WhatsappAccount'][_0xbc15('0x5e')]({'where':{'id':_0x216ffd['params']['id']}})[_0xbc15('0x32')](handleEntityNotFound(_0x468df6,null))[_0xbc15('0x32')](function(_0x31ad61){if(_0x31ad61){_0x33f27b=_0x31ad61;_0x3e950d[_0xbc15('0x3f')]=_[_0xbc15('0x4f')](db[_0xbc15('0x72')][_0xbc15('0x3c')]);_0x3e950d['query']=_[_0xbc15('0x4f')](_0x216ffd['query']);_0x3e950d['filters']=_[_0xbc15('0x41')](_0x3e950d[_0xbc15('0x3f')],_0x3e950d['query']);_0x2c9ba7[_0xbc15('0x42')]=_[_0xbc15('0x41')](_0x3e950d[_0xbc15('0x3f')],qs[_0xbc15('0x43')](_0x216ffd[_0xbc15('0x40')]['fields']));_0x2c9ba7[_0xbc15('0x42')]=_0x2c9ba7[_0xbc15('0x42')][_0xbc15('0x44')]?_0x2c9ba7[_0xbc15('0x42')]:_0x3e950d[_0xbc15('0x3f')];_0x2c9ba7[_0xbc15('0x60')]=qs[_0xbc15('0x46')](_0x216ffd[_0xbc15('0x40')]['sort']);_0x2c9ba7['where']=qs[_0xbc15('0x47')](_[_0xbc15('0x61')](_0x216ffd[_0xbc15('0x40')],_0x3e950d[_0xbc15('0x47')]));if(_0x216ffd[_0xbc15('0x40')][_0xbc15('0x48')]){_0x2c9ba7['where']=_[_0xbc15('0x4a')](_0x2c9ba7[_0xbc15('0x49')],{'$or':_[_0xbc15('0x3a')](_0x2c9ba7[_0xbc15('0x42')],function(_0x1b48f5){var _0x287a08={};_0x287a08[_0x1b48f5]={'$like':'%'+_0x216ffd['query'][_0xbc15('0x48')]+'%'};return _0x287a08;})});}_0x2c9ba7=_[_0xbc15('0x4a')]({},_0x2c9ba7,_0x216ffd[_0xbc15('0x51')]);return _0x33f27b[_0xbc15('0x75')](_0x2c9ba7);}})[_0xbc15('0x32')](function(_0x173239){if(_0x173239){_0x4245e5=_0x173239[_0xbc15('0x44')];if(!_0x216ffd['query'][_0xbc15('0x65')](_0xbc15('0x45'))){_0x2c9ba7[_0xbc15('0x2c')]=qs['limit'](_0x216ffd['query'][_0xbc15('0x2c')]);_0x2c9ba7[_0xbc15('0x2a')]=qs[_0xbc15('0x2a')](_0x216ffd[_0xbc15('0x40')][_0xbc15('0x2a')]);}return _0x33f27b[_0xbc15('0x75')](_0x2c9ba7);}})[_0xbc15('0x32')](function(_0x3ebf27){if(_0x3ebf27){return _0x3ebf27?{'count':_0x4245e5,'rows':_0x3ebf27}:null;}})[_0xbc15('0x32')](respondWithResult(_0x468df6,null))[_0xbc15('0x27')](handleError(_0x468df6,null));};exports[_0xbc15('0x76')]=function(_0x42fde4,_0x2d4d31,_0x466ac0){var _0x10f431={'channel':_0xbc15('0x77')};var _0x3994ba=[];var _0x21083d=[];var _0x4a4457={};return db['WhatsappAccount'][_0xbc15('0x52')]({'where':{'id':_0x42fde4[_0xbc15('0x4e')]['id']},'include':[{'model':db[_0xbc15('0x72')],'as':_0xbc15('0x78')}]})['then'](handleEntityNotFound(_0x2d4d31,null))[_0xbc15('0x32')](function(_0x206179){_0x10f431['account']=_0x206179;_0x10f431[_0xbc15('0x79')]=_[_0xbc15('0x7a')](_0x206179[_0xbc15('0x78')],[_0xbc15('0x7b')],['asc']);if(_0x10f431[_0xbc15('0x7c')]['Applications']){delete _0x10f431['account'][_0xbc15('0x78')];}return db['CmContact'][_0xbc15('0x59')]();})['then'](function(_0x355206){if(!_0x355206){throw new db[(_0xbc15('0x7d'))][(_0xbc15('0x7e'))](_0xbc15('0x7f'));}_0x3994ba=_['difference'](_[_0xbc15('0x4f')](_0x355206),['createdAt',_0xbc15('0x80')]);_0x21083d=_[_0xbc15('0x81')](_['keys'](_0x355206),[_0xbc15('0x82'),'updatedAt',_0xbc15('0x83'),_0xbc15('0x84')]);_0x10f431[_0xbc15('0x53')]={'mapKey':_0xbc15('0x85')};if(_0x10f431[_0xbc15('0x7c')]['type']&&_0x10f431[_0xbc15('0x7c')][_0xbc15('0x3e')]===_0xbc15('0x86')){_0x10f431[_0xbc15('0x53')][_0xbc15('0x87')]=_0x42fde4[_0xbc15('0x53')][_0xbc15('0x88')][_0xbc15('0x89')](_0xbc15('0x8a'),'');_0x10f431[_0xbc15('0x53')]['body']=_0x42fde4['body']['Body'];_0x10f431[_0xbc15('0x53')]['messageId']=_0x42fde4[_0xbc15('0x53')][_0xbc15('0x8b')];}if(_0x10f431[_0xbc15('0x53')]['id']){delete _0x10f431[_0xbc15('0x53')]['id'];}if(_['isNil'](_0x10f431['body'][_0xbc15('0x87')])){throw new db[(_0xbc15('0x7d'))][(_0xbc15('0x7e'))]('from\x20is\x20mandatory');}if(_[_0xbc15('0x8c')](_0x10f431[_0xbc15('0x53')][_0xbc15('0x53')])||_0x10f431[_0xbc15('0x53')][_0xbc15('0x53')]===''){throw new db[(_0xbc15('0x7d'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbc15('0x8c')](_0x10f431[_0xbc15('0x53')][_0xbc15('0x8d')])){throw new db['Sequelize'][(_0xbc15('0x7e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x21083d);}if(!_[_0xbc15('0x8e')](_0x21083d,_0x10f431[_0xbc15('0x53')][_0xbc15('0x8d')])){throw new db['Sequelize'][(_0xbc15('0x7e'))](_0xbc15('0x8f')+_0x21083d);}_0x4a4457[_0x10f431[_0xbc15('0x53')][_0xbc15('0x8d')]]=_0x10f431[_0xbc15('0x53')][_0xbc15('0x87')];return db[_0xbc15('0x90')][_0xbc15('0x52')]({'where':{'id':_0x10f431[_0xbc15('0x7c')][_0xbc15('0x84')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4a4457,'limit':0x1,'order':[[_0xbc15('0x80'),_0xbc15('0x91')]]}]});})[_0xbc15('0x32')](handleEntityNotFound(_0x2d4d31,null))[_0xbc15('0x32')](function(_0x74a35f){if(_0x74a35f){_0x10f431[_0xbc15('0x92')]=_['omit'](_0x74a35f,[_0xbc15('0x93')]);if(_0x74a35f[_0xbc15('0x93')][_0xbc15('0x44')]){return _0x74a35f[_0xbc15('0x93')][0x0];}var _0x48582d=_[_0xbc15('0x94')](_0x10f431[_0xbc15('0x53')],{'firstName':_0x10f431[_0xbc15('0x53')][_0xbc15('0x87')],'ListId':_0x74a35f['id']});_0x48582d[_0x10f431[_0xbc15('0x53')][_0xbc15('0x8d')]]=_0x10f431[_0xbc15('0x53')][_0xbc15('0x87')];return db[_0xbc15('0x95')]['create'](_0x48582d,{'fields':_0x3994ba,'raw':!![]});}})['then'](handleEntityNotFound(_0x2d4d31,null))[_0xbc15('0x32')](function(_0x561339){if(_0x561339){_0x10f431[_0xbc15('0x96')]=_0x561339;var _0x321571={'ContactId':_0x561339['id'],'phone':_0x10f431['body'][_0xbc15('0x87')],'WhatsappAccountId':_0x42fde4['params']['id']};var _0x595cdd={'ContactId':_0x561339['id'],'WhatsappAccountId':_0x42fde4[_0xbc15('0x4e')]['id'],'closed':![]};return db[_0xbc15('0x97')]['find']({'where':_0x595cdd})[_0xbc15('0x32')](function(_0x57979f){if(_0x57979f){return[_0x57979f,![]];}return db[_0xbc15('0x97')][_0xbc15('0x5c')](_0x321571)[_0xbc15('0x32')](function(_0x111c73){return[_0x111c73,!![]];});});}})[_0xbc15('0x6a')](function(_0x228d3d,_0x36ac29){_0x10f431[_0xbc15('0x98')]=_0x228d3d[_0xbc15('0x99')]({'plain':!![]});_0x10f431[_0xbc15('0x98')][_0xbc15('0x9a')]=![];if(_0x36ac29){if(_0x10f431['account']['autoclose']){_0x10f431[_0xbc15('0x79')]['push']({'id':0x0,'priority':_0x10f431[_0xbc15('0x79')][_0xbc15('0x44')]+0x1,'app':_0xbc15('0x9b'),'appdata':_0xbc15('0x9c'),'interval':_0xbc15('0x9d')});}_0x10f431['interaction'][_0xbc15('0x9a')]=!![];}return db[_0xbc15('0x9e')][_0xbc15('0x5c')]({'phone':_0x10f431[_0xbc15('0x53')][_0xbc15('0x87')],'messageId':_0x10f431[_0xbc15('0x53')][_0xbc15('0x9f')],'body':_0x10f431['body'][_0xbc15('0x53')],'WhatsappAccountId':_0x42fde4[_0xbc15('0x4e')]['id'],'WhatsappInteractionId':_0x228d3d['id'],'direction':'in','ContactId':_0x228d3d['ContactId'],'AttachmentId':_0x10f431['body']['AttachmentId']});})[_0xbc15('0x32')](function(_0x1085bd){_0x10f431[_0xbc15('0x25')]=_0x1085bd;if(_0x10f431[_0xbc15('0x98')][_0xbc15('0xa0')]){return db[_0xbc15('0x70')][_0xbc15('0x52')]({'attributes':['id',_0xbc15('0x36')],'where':{'id':_0x10f431['interaction'][_0xbc15('0xa0')]}})[_0xbc15('0x32')](function(_0x5a8464){if(_0x5a8464){_0x10f431['applications'][_0xbc15('0xa1')]({'id':0x0,'priority':0x0,'app':_0xbc15('0xa2'),'appdata':_0x5a8464[_0xbc15('0x36')]+','+(_0x10f431['account']['waitForTheAssignedAgent']||0xa),'interval':_0xbc15('0x9d')});}return respondWithRpcPromise(_0xbc15('0xa3'),_0xbc15('0xa4'),_0x10f431);});}return respondWithRpcPromise(_0xbc15('0xa3'),_0xbc15('0xa4'),_0x10f431);})[_0xbc15('0x32')](function(_0x469d12){if(_0x469d12){var _0x2ffefc=0xc8;var _0x29f863=_0xbc15('0xa5');logger[_0xbc15('0x20')](_0xbc15('0xa6'),_0x29f863,_0x2ffefc,'entity\x20found');logger[_0xbc15('0x22')](_0xbc15('0xa7'),_0x29f863,_0x2ffefc,'entity\x20found',JSON['stringify'](_0x469d12));if(_0x10f431[_0xbc15('0x7c')][_0xbc15('0x3e')]==='twilio'){return _0x2d4d31[_0xbc15('0x28')](_0x2ffefc)[_0xbc15('0x2e')](_0xbc15('0xa8'),_0xbc15('0xa9'))[_0xbc15('0xaa')](_0xbc15('0xab'));}else{return _0x2d4d31[_0xbc15('0x28')](_0x2ffefc)['json'](_0x469d12);}}})['catch'](handleError(_0x2d4d31,null));};exports[_0xbc15('0xaa')]=function(_0x592cd0,_0x3f3e3d,_0x3017bb){var _0x3403de,_0x1f6803,_0x5616f4;if(_[_0xbc15('0x8c')](_0x592cd0[_0xbc15('0x53')]['body'])||_0x592cd0[_0xbc15('0x53')][_0xbc15('0x53')]===''){throw new db['Sequelize'][(_0xbc15('0x7e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbc15('0x8c')](_0x592cd0[_0xbc15('0x53')]['to'])){throw new db[(_0xbc15('0x7d'))][(_0xbc15('0x7e'))](_0xbc15('0xac'));}_0x3403de=_0x592cd0[_0xbc15('0x53')]['to'];return db[_0xbc15('0x3b')][_0xbc15('0x52')]({'where':{'id':_0x592cd0[_0xbc15('0x4e')]['id']},'include':[{'model':db[_0xbc15('0x90')],'as':'List','include':[{'model':db[_0xbc15('0x95')],'as':'Contacts','where':{'mobile':_0x3403de},'limit':0x1,'order':[[_0xbc15('0x80'),_0xbc15('0x91')]]}]}]})['then'](handleEntityNotFound(_0x3f3e3d,null))[_0xbc15('0x32')](function(_0x4ed102){if(_0x4ed102&&_0x4ed102[_0xbc15('0xad')]){_0x1f6803=_0x4ed102[_0xbc15('0x99')]({'plain':!![]});if(_0x1f6803['List']&&_0x1f6803[_0xbc15('0xad')]['Contacts'][_0xbc15('0x44')]){return _0x1f6803[_0xbc15('0xad')][_0xbc15('0x93')][0x0];}return db[_0xbc15('0x95')][_0xbc15('0x5c')](_[_0xbc15('0x94')](_0x592cd0[_0xbc15('0x53')],{'firstName':_0x3403de,'mobile':_0x3403de,'phone':_0x3403de,'ListId':_0x1f6803['ListId']}));}})[_0xbc15('0x32')](handleEntityNotFound(_0x3f3e3d,null))[_0xbc15('0x32')](function(_0x26e665){if(_0x26e665){_0x5616f4=_0x26e665;return db['WhatsappInteraction'][_0xbc15('0x52')]({'where':{'ContactId':_0x5616f4['id'],'closed':![],'WhatsappAccountId':_0x1f6803['id']}})[_0xbc15('0x32')](function(_0x6122f2){if(_0x6122f2){return[_0x6122f2,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x592cd0[_0xbc15('0x54')]['id'],'ContactId':_0x5616f4['id'],'WhatsappAccountId':_0x1f6803['id'],'phone':_0x3403de,'firstMsgDirection':'out','Messages':[_[_0xbc15('0x4a')](_0x592cd0[_0xbc15('0x53')],{'read':![],'body':_0x592cd0[_0xbc15('0x53')][_0xbc15('0x53')],'phone':_0x3403de,'WhatsappAccountId':_0x1f6803['id'],'UserId':_0x592cd0[_0xbc15('0x54')]['id'],'ContactId':_0x5616f4['id']})]},{'include':[{'model':db[_0xbc15('0x9e')],'as':'Messages'}]})['then'](function(_0x51d996){return[_0x51d996,!![]];});});}})[_0xbc15('0x6a')](function(_0x4949d8,_0x50f947){if(_0x50f947){return _0x4949d8;}return db[_0xbc15('0x9e')][_0xbc15('0x5c')](_[_0xbc15('0x4a')](_0x592cd0[_0xbc15('0x53')],{'read':![],'body':_0x592cd0[_0xbc15('0x53')][_0xbc15('0x53')],'phone':_0x3403de,'WhatsappAccountId':_0x1f6803['id'],'WhatsappInteractionId':_0x4949d8['id'],'UserId':_0x592cd0['user']['id'],'ContactId':_0x5616f4['id']}))[_0xbc15('0x32')](function(_0x47419a){_0x4949d8[_0xbc15('0xae')][_0xbc15('0xaf')]=[];_0x4949d8['dataValues'][_0xbc15('0xaf')][_0xbc15('0xb0')](_0x47419a[_0xbc15('0xae')]);return _0x4949d8;});})[_0xbc15('0x32')](respondWithResult(_0x3f3e3d,null))[_0xbc15('0x27')](handleError(_0x3f3e3d,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index bafa3e3..dde98d3 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 _0xe857=['exports','../../mysqldb','setMaxListeners','save','remove','emit','hook'];(function(_0x395b58,_0x23518d){var _0x43c80a=function(_0x4f5687){while(--_0x4f5687){_0x395b58['push'](_0x395b58['shift']());}};_0x43c80a(++_0x23518d);}(_0xe857,0xa9));var _0x7e85=function(_0xe414ff,_0x1a3ddc){_0xe414ff=_0xe414ff-0x0;var _0x694aef=_0xe857[_0xe414ff];return _0x694aef;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x7e85('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7e85('0x1')](0x0);var events={'afterCreate':_0x7e85('0x2'),'afterUpdate':'update','afterDestroy':_0x7e85('0x3')};function emitEvent(_0x212f22){return function(_0x38a5b3,_0x39ff55,_0x43ec4f){WhatsappAccountEvents[_0x7e85('0x4')](_0x212f22+':'+_0x38a5b3['id'],_0x38a5b3);WhatsappAccountEvents[_0x7e85('0x4')](_0x212f22,_0x38a5b3);_0x43ec4f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x7e85('0x5')](e,emitEvent(event));}}module[_0x7e85('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x9999=['WhatsappAccount','setMaxListeners','save','emit','exports','events','../../mysqldb'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0x9999,0x178));var _0x9999=function(_0x4771b7,_0x30f53d){_0x4771b7=_0x4771b7-0x0;var _0x1fd27a=_0x9999[_0x4771b7];return _0x1fd27a;};'use strict';var EventEmitter=require(_0x9999('0x0'));var WhatsappAccount=require(_0x9999('0x1'))['db'][_0x9999('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9999('0x3')](0x0);var events={'afterCreate':_0x9999('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1de090){return function(_0x364700,_0x2f1293,_0xced9dd){WhatsappAccountEvents[_0x9999('0x5')](_0x1de090+':'+_0x364700['id'],_0x364700);WhatsappAccountEvents[_0x9999('0x5')](_0x1de090,_0x364700);_0xced9dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x9999('0x6')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 3110fa4..fd8d503 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 _0xa431=['exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0xa0c966,_0x9994e7){var _0x390b8a=function(_0x264fc6){while(--_0x264fc6){_0xa0c966['push'](_0xa0c966['shift']());}};_0x390b8a(++_0x9994e7);}(_0xa431,0x93));var _0x1a43=function(_0x3c1f28,_0x2f6f20){_0x3c1f28=_0x3c1f28-0x0;var _0x18f282=_0xa431[_0x3c1f28];return _0x18f282;};'use strict';var _=require(_0x1a43('0x0'));var util=require(_0x1a43('0x1'));var logger=require(_0x1a43('0x2'))(_0x1a43('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1a43('0x4'));var fs=require('fs');var path=require(_0x1a43('0x5'));var rimraf=require(_0x1a43('0x6'));var config=require(_0x1a43('0x7'));var attributes=require(_0x1a43('0x8'));module[_0x1a43('0x9')]=function(_0x3cba39,_0x46b472){return _0x3cba39[_0x1a43('0xa')](_0x1a43('0xb'),attributes,{'tableName':_0x1a43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43e4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x43e4,0xb0));var _0x443e=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x43e4[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x443e('0x0'));var util=require(_0x443e('0x1'));var logger=require(_0x443e('0x2'))(_0x443e('0x3'));var moment=require(_0x443e('0x4'));var BPromise=require(_0x443e('0x5'));var rp=require(_0x443e('0x6'));var fs=require('fs');var path=require(_0x443e('0x7'));var rimraf=require(_0x443e('0x8'));var config=require(_0x443e('0x9'));var attributes=require(_0x443e('0xa'));module[_0x443e('0xb')]=function(_0xe7aae7,_0x2e32d8){return _0xe7aae7[_0x443e('0xc')](_0x443e('0xd'),attributes,{'tableName':_0x443e('0xe'),'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 2478de4..0a1dea5 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 _0x2f75=['../../config/utils','../../config/logger','rpc','client','defaults','redis','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ShowWhatsappAccount','find','options','raw','map','include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x51adfc,_0x57ddae){var _0x5ee679=function(_0xf41425){while(--_0xf41425){_0x51adfc['push'](_0x51adfc['shift']());}};_0x5ee679(++_0x57ddae);}(_0x2f75,0x179));var _0x52f7=function(_0xb9abaf,_0x4080c){_0xb9abaf=_0xb9abaf-0x0;var _0x4f0255=_0x2f75[_0xb9abaf];return _0x4f0255;};'use strict';var _=require(_0x52f7('0x0'));var util=require(_0x52f7('0x1'));var moment=require(_0x52f7('0x2'));var BPromise=require(_0x52f7('0x3'));var rs=require(_0x52f7('0x4'));var fs=require('fs');var Redis=require(_0x52f7('0x5'));var db=require(_0x52f7('0x6'))['db'];var utils=require(_0x52f7('0x7'));var logger=require(_0x52f7('0x8'))(_0x52f7('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x52f7('0xa')]['http']({'port':0x232a});config['redis']=_[_0x52f7('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x52f7('0xc')]));require(_0x52f7('0xd'))[_0x52f7('0xe')](socket);function respondWithRpcPromise(_0x4cca56,_0x4fb1f3,_0x3e9d0e){return new BPromise(function(_0x12e617,_0x6cb669){return client['request'](_0x4cca56,_0x3e9d0e)[_0x52f7('0xf')](function(_0x4931a0){logger[_0x52f7('0x10')](_0x52f7('0x11'),_0x4fb1f3,_0x52f7('0x12'));logger[_0x52f7('0x13')](_0x52f7('0x14'),_0x4fb1f3,_0x52f7('0x12'),JSON[_0x52f7('0x15')](_0x4931a0));if(_0x4931a0[_0x52f7('0x16')]){if(_0x4931a0[_0x52f7('0x16')]['code']===0x1f4){logger['error'](_0x52f7('0x11'),_0x4fb1f3,_0x4931a0[_0x52f7('0x16')][_0x52f7('0x17')]);return _0x6cb669(_0x4931a0[_0x52f7('0x16')][_0x52f7('0x17')]);}logger[_0x52f7('0x16')](_0x52f7('0x11'),_0x4fb1f3,_0x4931a0['error'][_0x52f7('0x17')]);return _0x12e617(_0x4931a0[_0x52f7('0x16')]['message']);}else{logger[_0x52f7('0x10')](_0x52f7('0x11'),_0x4fb1f3,_0x52f7('0x12'));_0x12e617(_0x4931a0['result'][_0x52f7('0x17')]);}})['catch'](function(_0x3f4583){logger[_0x52f7('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x4fb1f3,_0x3f4583);_0x6cb669(_0x3f4583);});});}exports[_0x52f7('0x18')]=function(_0x6fe2c5){var _0x204730=this;return new Promise(function(_0xdcc34e,_0x1b3228){return db['WhatsappAccount'][_0x52f7('0x19')]({'raw':_0x6fe2c5['options']?_0x6fe2c5[_0x52f7('0x1a')][_0x52f7('0x1b')]===undefined?!![]:![]:!![],'where':_0x6fe2c5[_0x52f7('0x1a')]?_0x6fe2c5[_0x52f7('0x1a')]['where']||null:null,'attributes':_0x6fe2c5[_0x52f7('0x1a')]?_0x6fe2c5[_0x52f7('0x1a')]['attributes']||null:null,'include':_0x6fe2c5[_0x52f7('0x1a')]?_0x6fe2c5['options']['include']?_[_0x52f7('0x1c')](_0x6fe2c5[_0x52f7('0x1a')][_0x52f7('0x1d')],function(_0x4395b9){return{'model':db[_0x4395b9[_0x52f7('0x1e')]],'as':_0x4395b9['as'],'attributes':_0x4395b9[_0x52f7('0x1f')],'include':_0x4395b9['include']?_['map'](_0x4395b9[_0x52f7('0x1d')],function(_0x202172){return{'model':db[_0x202172[_0x52f7('0x1e')]],'as':_0x202172['as'],'attributes':_0x202172[_0x52f7('0x1f')],'include':_0x202172[_0x52f7('0x1d')]?_[_0x52f7('0x1c')](_0x202172[_0x52f7('0x1d')],function(_0x5936e2){return{'model':db[_0x5936e2[_0x52f7('0x1e')]],'as':_0x5936e2['as'],'attributes':_0x5936e2[_0x52f7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ca502){logger['info'](_0x52f7('0x18'),_0x6fe2c5);logger[_0x52f7('0x13')](_0x52f7('0x18'),_0x6fe2c5,JSON['stringify'](_0x3ca502));_0xdcc34e(_0x3ca502);})['catch'](function(_0x28b8fc){logger[_0x52f7('0x16')](_0x52f7('0x18'),_0x28b8fc['message'],_0x6fe2c5);_0x1b3228(_0x204730[_0x52f7('0x16')](0x1f4,_0x28b8fc[_0x52f7('0x17')]));});});}; \ No newline at end of file +var _0x790c=['defaults','redis','./whatsappAccount.socket','register','request','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','model','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x790c,0x106));var _0xc790=function(_0x2e73ac,_0x4217c9){_0x2e73ac=_0x2e73ac-0x0;var _0x1ea63a=_0x790c[_0x2e73ac];return _0x1ea63a;};'use strict';var _=require(_0xc790('0x0'));var util=require(_0xc790('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc790('0x2'));var db=require(_0xc790('0x3'))['db'];var utils=require(_0xc790('0x4'));var logger=require(_0xc790('0x5'))(_0xc790('0x6'));var config=require('../../config/environment');var jayson=require(_0xc790('0x7'));var client=jayson[_0xc790('0x8')][_0xc790('0x9')]({'port':0x232a});config['redis']=_[_0xc790('0xa')](config[_0xc790('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc790('0xb')]));require(_0xc790('0xc'))[_0xc790('0xd')](socket);function respondWithRpcPromise(_0x18c434,_0x27465c,_0x3150eb){return new BPromise(function(_0x390b4f,_0x317076){return client[_0xc790('0xe')](_0x18c434,_0x3150eb)['then'](function(_0x596393){logger[_0xc790('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x27465c,'request\x20sent');logger[_0xc790('0x10')](_0xc790('0x11'),_0x27465c,_0xc790('0x12'),JSON[_0xc790('0x13')](_0x596393));if(_0x596393[_0xc790('0x14')]){if(_0x596393[_0xc790('0x14')]['code']===0x1f4){logger[_0xc790('0x14')](_0xc790('0x15'),_0x27465c,_0x596393[_0xc790('0x14')]['message']);return _0x317076(_0x596393[_0xc790('0x14')][_0xc790('0x16')]);}logger['error'](_0xc790('0x15'),_0x27465c,_0x596393[_0xc790('0x14')][_0xc790('0x16')]);return _0x390b4f(_0x596393[_0xc790('0x14')]['message']);}else{logger[_0xc790('0xf')](_0xc790('0x15'),_0x27465c,_0xc790('0x12'));_0x390b4f(_0x596393[_0xc790('0x17')][_0xc790('0x16')]);}})[_0xc790('0x18')](function(_0x27a446){logger[_0xc790('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x27465c,_0x27a446);_0x317076(_0x27a446);});});}exports[_0xc790('0x19')]=function(_0x4e6e73){var _0x19a98d=this;return new Promise(function(_0x2641d1,_0x4898ff){return db[_0xc790('0x1a')][_0xc790('0x1b')]({'raw':_0x4e6e73[_0xc790('0x1c')]?_0x4e6e73[_0xc790('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4e6e73[_0xc790('0x1c')]?_0x4e6e73['options'][_0xc790('0x1d')]||null:null,'attributes':_0x4e6e73[_0xc790('0x1c')]?_0x4e6e73['options'][_0xc790('0x1e')]||null:null,'include':_0x4e6e73[_0xc790('0x1c')]?_0x4e6e73[_0xc790('0x1c')]['include']?_['map'](_0x4e6e73[_0xc790('0x1c')][_0xc790('0x1f')],function(_0x449110){return{'model':db[_0x449110[_0xc790('0x20')]],'as':_0x449110['as'],'attributes':_0x449110[_0xc790('0x1e')],'include':_0x449110[_0xc790('0x1f')]?_[_0xc790('0x21')](_0x449110[_0xc790('0x1f')],function(_0x4ea07c){return{'model':db[_0x4ea07c[_0xc790('0x20')]],'as':_0x4ea07c['as'],'attributes':_0x4ea07c[_0xc790('0x1e')],'include':_0x4ea07c['include']?_[_0xc790('0x21')](_0x4ea07c['include'],function(_0x5e090e){return{'model':db[_0x5e090e[_0xc790('0x20')]],'as':_0x5e090e['as'],'attributes':_0x5e090e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cbbac){logger[_0xc790('0xf')](_0xc790('0x19'),_0x4e6e73);logger['debug'](_0xc790('0x19'),_0x4e6e73,JSON[_0xc790('0x13')](_0x4cbbac));_0x2641d1(_0x4cbbac);})[_0xc790('0x18')](function(_0x4c8c9f){logger[_0xc790('0x14')](_0xc790('0x19'),_0x4c8c9f[_0xc790('0x16')],_0x4e6e73);_0x4898ff(_0x19a98d['error'](0x1f4,_0x4c8c9f[_0xc790('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 095702a..0644135 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 _0x22fc=['emit','removeListener','register','length','save'];(function(_0x172a00,_0x504165){var _0x3e870d=function(_0x502d84){while(--_0x502d84){_0x172a00['push'](_0x172a00['shift']());}};_0x3e870d(++_0x504165);}(_0x22fc,0x1d0));var _0xc22f=function(_0x2bb80e,_0x25e5dd){_0x2bb80e=_0x2bb80e-0x0;var _0x12adfd=_0x22fc[_0x2bb80e];return _0x12adfd;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xc22f('0x0'),'remove','update'];function createListener(_0x5066fa,_0x1a2a0c){return function(_0x3a2d5b){_0x1a2a0c[_0xc22f('0x1')](_0x5066fa,_0x3a2d5b);};}function removeListener(_0x244a94,_0x1ae7d7){return function(){WhatsappAccountEvents[_0xc22f('0x2')](_0x244a94,_0x1ae7d7);};}exports[_0xc22f('0x3')]=function(_0x3d73f9){for(var _0x490f8d=0x0,_0x1c4359=events[_0xc22f('0x4')];_0x490f8d<_0x1c4359;_0x490f8d++){var _0x101d1b=events[_0x490f8d];var _0x1ae226=createListener('whatsappAccount:'+_0x101d1b,_0x3d73f9);WhatsappAccountEvents['on'](_0x101d1b,_0x1ae226);}}; \ No newline at end of file +var _0xebd7=['save','remove','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x5d741d,_0x42e0c6){var _0x5b37ef=function(_0x9e0629){while(--_0x9e0629){_0x5d741d['push'](_0x5d741d['shift']());}};_0x5b37ef(++_0x42e0c6);}(_0xebd7,0x68));var _0x7ebd=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xebd7[_0x5c351c];return _0x26f3b3;};'use strict';var WhatsappAccountEvents=require(_0x7ebd('0x0'));var events=[_0x7ebd('0x1'),_0x7ebd('0x2'),'update'];function createListener(_0x21df13,_0x1462fd){return function(_0x2f57c3){_0x1462fd['emit'](_0x21df13,_0x2f57c3);};}function removeListener(_0x43303a,_0x151b3c){return function(){WhatsappAccountEvents[_0x7ebd('0x3')](_0x43303a,_0x151b3c);};}exports[_0x7ebd('0x4')]=function(_0xfdf7ab){for(var _0x8b005b=0x0,_0x96d905=events[_0x7ebd('0x5')];_0x8b005b<_0x96d905;_0x8b005b++){var _0x191119=events[_0x8b005b];var _0x36cfe5=createListener(_0x7ebd('0x6')+_0x191119,_0xfdf7ab);WhatsappAccountEvents['on'](_0x191119,_0x36cfe5);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 7c77082..18e24d5 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 _0x698d=['./whatsappApplication.controller','get','isAuthenticated','index','show','post','put','/:id','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x362510,_0x2bef8d){var _0x3a7871=function(_0x4f812a){while(--_0x4f812a){_0x362510['push'](_0x362510['shift']());}};_0x3a7871(++_0x2bef8d);}(_0x698d,0x1e6));var _0xd698=function(_0x5d61f5,_0x46fb73){_0x5d61f5=_0x5d61f5-0x0;var _0x5c1d95=_0x698d[_0x5d61f5];return _0x5c1d95;};'use strict';var multer=require('multer');var util=require(_0xd698('0x0'));var path=require(_0xd698('0x1'));var timeout=require(_0xd698('0x2'));var express=require(_0xd698('0x3'));var router=express[_0xd698('0x4')]();var fs_extra=require(_0xd698('0x5'));var auth=require(_0xd698('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd698('0x7'));router[_0xd698('0x8')]('/',auth[_0xd698('0x9')](),controller[_0xd698('0xa')]);router[_0xd698('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd698('0xb')]);router[_0xd698('0xc')]('/',auth[_0xd698('0x9')](),controller['create']);router[_0xd698('0xd')](_0xd698('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xd698('0xf')](_0xd698('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xd698('0x10')]=router; \ No newline at end of file +var _0xc6d3=['isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./whatsappApplication.controller','get','index','/:id','show','post','create','put'];(function(_0x34575e,_0x496bd3){var _0x569b48=function(_0x4ff4ee){while(--_0x4ff4ee){_0x34575e['push'](_0x34575e['shift']());}};_0x569b48(++_0x496bd3);}(_0xc6d3,0x7d));var _0x3c6d=function(_0x235b9d,_0x265e83){_0x235b9d=_0x235b9d-0x0;var _0x147d13=_0xc6d3[_0x235b9d];return _0x147d13;};'use strict';var multer=require(_0x3c6d('0x0'));var util=require(_0x3c6d('0x1'));var path=require(_0x3c6d('0x2'));var timeout=require(_0x3c6d('0x3'));var express=require(_0x3c6d('0x4'));var router=express['Router']();var fs_extra=require(_0x3c6d('0x5'));var auth=require(_0x3c6d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3c6d('0x7'));router[_0x3c6d('0x8')]('/',auth['isAuthenticated'](),controller[_0x3c6d('0x9')]);router[_0x3c6d('0x8')](_0x3c6d('0xa'),auth['isAuthenticated'](),controller[_0x3c6d('0xb')]);router[_0x3c6d('0xc')]('/',auth['isAuthenticated'](),controller[_0x3c6d('0xd')]);router[_0x3c6d('0xe')](_0x3c6d('0xa'),auth[_0x3c6d('0xf')](),controller[_0x3c6d('0x10')]);router[_0x3c6d('0x11')](_0x3c6d('0xa'),auth[_0x3c6d('0xf')](),controller[_0x3c6d('0x12')]);module[_0x3c6d('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index e642020..b61f10b 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 _0xdeaa=['INTEGER','STRING','TEXT','sequelize'];(function(_0xed0a4d,_0x258742){var _0x44cb6a=function(_0x1989f4){while(--_0x1989f4){_0xed0a4d['push'](_0xed0a4d['shift']());}};_0x44cb6a(++_0x258742);}(_0xdeaa,0x7b));var _0xadea=function(_0x415aaa,_0x467767){_0x415aaa=_0x415aaa-0x0;var _0x5ea7b2=_0xdeaa[_0x415aaa];return _0x5ea7b2;};'use strict';var Sequelize=require(_0xadea('0x0'));module['exports']={'priority':{'type':Sequelize[_0xadea('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xadea('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xadea('0x3')]()},'description':{'type':Sequelize[_0xadea('0x2')]},'interval':{'type':Sequelize[_0xadea('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x8f29=['sequelize','exports','INTEGER','STRING','noop'];(function(_0x504295,_0x414872){var _0x5d7bca=function(_0xcefe16){while(--_0xcefe16){_0x504295['push'](_0x504295['shift']());}};_0x5d7bca(++_0x414872);}(_0x8f29,0xeb));var _0x98f2=function(_0x2d2f63,_0x4432f4){_0x2d2f63=_0x2d2f63-0x0;var _0x170c1e=_0x8f29[_0x2d2f63];return _0x170c1e;};'use strict';var Sequelize=require(_0x98f2('0x0'));module[_0x98f2('0x1')]={'priority':{'type':Sequelize[_0x98f2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x98f2('0x3')],'allowNull':![],'defaultValue':_0x98f2('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x98f2('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index a6f3303..001d5c5 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 _0xdab3=['nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','show','params','find','catch','create','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','error','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x5b5781,_0x1f8aae){var _0x21f9be=function(_0x3fed7d){while(--_0x3fed7d){_0x5b5781['push'](_0x5b5781['shift']());}};_0x21f9be(++_0x1f8aae);}(_0xdab3,0xeb));var _0x3dab=function(_0x3a0b4a,_0x15a99c){_0x3a0b4a=_0x3a0b4a-0x0;var _0x3a1e2a=_0xdab3[_0x3a0b4a];return _0x3a1e2a;};'use strict';var emlformat=require(_0x3dab('0x0'));var rimraf=require(_0x3dab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3dab('0x2'));var rp=require(_0x3dab('0x3'));var moment=require(_0x3dab('0x4'));var BPromise=require(_0x3dab('0x5'));var Mustache=require(_0x3dab('0x6'));var util=require(_0x3dab('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3dab('0x8'));var ejs=require(_0x3dab('0x9'));var fs=require('fs');var fs_extra=require(_0x3dab('0xa'));var _=require(_0x3dab('0xb'));var squel=require(_0x3dab('0xc'));var crypto=require(_0x3dab('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3dab('0xe'));var toCsv=require(_0x3dab('0x8'));var querystring=require(_0x3dab('0xf'));var Papa=require(_0x3dab('0x10'));var Redis=require(_0x3dab('0x11'));var authService=require(_0x3dab('0x12'));var qs=require(_0x3dab('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3dab('0x14'));var logger=require(_0x3dab('0x15'))(_0x3dab('0x16'));var utils=require(_0x3dab('0x17'));var config=require(_0x3dab('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1556d6,_0x36196f){_0x36196f=_0x36196f||0xcc;return function(_0x302eec){if(_0x302eec){return _0x1556d6[_0x3dab('0x19')](_0x36196f);}return _0x1556d6[_0x3dab('0x1a')](_0x36196f)[_0x3dab('0x1b')]();};}function respondWithResult(_0x1e9dcb,_0xb44734){_0xb44734=_0xb44734||0xc8;return function(_0x54bf6e){if(_0x54bf6e){return _0x1e9dcb[_0x3dab('0x1a')](_0xb44734)[_0x3dab('0x1c')](_0x54bf6e);}};}function respondWithFilteredResult(_0x5b0784,_0x1bd550){return function(_0x60120a){if(_0x60120a){var _0x55cb0a=typeof _0x1bd550['offset']===_0x3dab('0x1d')&&typeof _0x1bd550[_0x3dab('0x1e')]===_0x3dab('0x1d');var _0x367942=_0x60120a[_0x3dab('0x1f')];var _0x4f71e1=_0x55cb0a?0x0:_0x1bd550[_0x3dab('0x20')];var _0x2cca19=_0x55cb0a?_0x60120a['count']:_0x1bd550[_0x3dab('0x20')]+_0x1bd550[_0x3dab('0x1e')];var _0x43961e;if(_0x2cca19>=_0x367942){_0x2cca19=_0x367942;_0x43961e=0xc8;}else{_0x43961e=0xce;}_0x5b0784[_0x3dab('0x1a')](_0x43961e);return _0x5b0784['set'](_0x3dab('0x21'),_0x4f71e1+'-'+_0x2cca19+'/'+_0x367942)[_0x3dab('0x1c')](_0x60120a);}return null;};}function patchUpdates(_0xfb3bc0){return function(_0x21bda4){try{jsonpatch[_0x3dab('0x22')](_0x21bda4,_0xfb3bc0,!![]);}catch(_0x220247){return BPromise[_0x3dab('0x23')](_0x220247);}return _0x21bda4[_0x3dab('0x24')]();};}function saveUpdates(_0x471dd5,_0x4ae9ee){return function(_0x29d21a){if(_0x29d21a){return _0x29d21a['update'](_0x471dd5)[_0x3dab('0x25')](function(_0x23f69a){return _0x23f69a;});}return null;};}function removeEntity(_0x420de0,_0x227c86){return function(_0x39b741){if(_0x39b741){return _0x39b741[_0x3dab('0x26')]()['then'](function(){_0x420de0['status'](0xcc)[_0x3dab('0x1b')]();});}};}function handleEntityNotFound(_0x10f848,_0x4f96aa){return function(_0x21880a){if(!_0x21880a){_0x10f848[_0x3dab('0x19')](0x194);}return _0x21880a;};}function handleError(_0x240c59,_0x151806){_0x151806=_0x151806||0x1f4;return function(_0x5acc7b){logger[_0x3dab('0x27')](_0x5acc7b['stack']);if(_0x5acc7b[_0x3dab('0x28')]){delete _0x5acc7b[_0x3dab('0x28')];}_0x240c59[_0x3dab('0x1a')](_0x151806)[_0x3dab('0x29')](_0x5acc7b);};}exports['index']=function(_0x4e562c,_0x36f834){var _0x5bfe9e={},_0x483bce={},_0x5b6026={'count':0x0,'rows':[]};var _0x56b1d6=_[_0x3dab('0x2a')](db[_0x3dab('0x2b')][_0x3dab('0x2c')],function(_0x42c7e3){return{'name':_0x42c7e3[_0x3dab('0x2d')],'type':_0x42c7e3[_0x3dab('0x2e')][_0x3dab('0x2f')]};});_0x483bce[_0x3dab('0x30')]=_[_0x3dab('0x2a')](_0x56b1d6,_0x3dab('0x28'));_0x483bce[_0x3dab('0x31')]=_[_0x3dab('0x32')](_0x4e562c[_0x3dab('0x31')]);_0x483bce[_0x3dab('0x33')]=_[_0x3dab('0x34')](_0x483bce[_0x3dab('0x30')],_0x483bce[_0x3dab('0x31')]);_0x5bfe9e[_0x3dab('0x35')]=_[_0x3dab('0x34')](_0x483bce[_0x3dab('0x30')],qs['fields'](_0x4e562c['query'][_0x3dab('0x36')]));_0x5bfe9e['attributes']=_0x5bfe9e[_0x3dab('0x35')][_0x3dab('0x37')]?_0x5bfe9e['attributes']:_0x483bce[_0x3dab('0x30')];if(!_0x4e562c[_0x3dab('0x31')][_0x3dab('0x38')](_0x3dab('0x39'))){_0x5bfe9e['limit']=qs['limit'](_0x4e562c[_0x3dab('0x31')]['limit']);_0x5bfe9e[_0x3dab('0x20')]=qs[_0x3dab('0x20')](_0x4e562c[_0x3dab('0x31')]['offset']);}_0x5bfe9e['order']=qs[_0x3dab('0x3a')](_0x4e562c[_0x3dab('0x31')][_0x3dab('0x3a')]);_0x5bfe9e['where']=qs[_0x3dab('0x33')](_[_0x3dab('0x3b')](_0x4e562c[_0x3dab('0x31')],_0x483bce[_0x3dab('0x33')]),_0x56b1d6);if(_0x4e562c[_0x3dab('0x31')]['filter']){_0x5bfe9e[_0x3dab('0x3c')]=_[_0x3dab('0x3d')](_0x5bfe9e[_0x3dab('0x3c')],{'$or':_[_0x3dab('0x2a')](_0x56b1d6,function(_0x8aef25){if(_0x8aef25[_0x3dab('0x2e')]!==_0x3dab('0x3e')){var _0x4bba15={};_0x4bba15[_0x8aef25[_0x3dab('0x28')]]={'$like':'%'+_0x4e562c[_0x3dab('0x31')][_0x3dab('0x3f')]+'%'};return _0x4bba15;}})});}_0x5bfe9e=_['merge']({},_0x5bfe9e,_0x4e562c['options']);var _0x240ae0={'where':_0x5bfe9e[_0x3dab('0x3c')]};return db[_0x3dab('0x2b')][_0x3dab('0x1f')](_0x240ae0)['then'](function(_0x2409ab){_0x5b6026[_0x3dab('0x1f')]=_0x2409ab;if(_0x4e562c[_0x3dab('0x31')][_0x3dab('0x40')]){_0x5bfe9e[_0x3dab('0x41')]=[{'all':!![]}];}return db[_0x3dab('0x2b')]['findAll'](_0x5bfe9e);})[_0x3dab('0x25')](function(_0x4a4153){_0x5b6026['rows']=_0x4a4153;return _0x5b6026;})[_0x3dab('0x25')](respondWithFilteredResult(_0x36f834,_0x5bfe9e))['catch'](handleError(_0x36f834,null));};exports[_0x3dab('0x42')]=function(_0x36e095,_0x2652e3){var _0x5d00cf={'raw':!![],'where':{'id':_0x36e095[_0x3dab('0x43')]['id']}},_0xf0bc93={};_0xf0bc93[_0x3dab('0x30')]=_[_0x3dab('0x32')](db[_0x3dab('0x2b')][_0x3dab('0x2c')]);_0xf0bc93[_0x3dab('0x31')]=_['keys'](_0x36e095[_0x3dab('0x31')]);_0xf0bc93['filters']=_[_0x3dab('0x34')](_0xf0bc93[_0x3dab('0x30')],_0xf0bc93[_0x3dab('0x31')]);_0x5d00cf['attributes']=_[_0x3dab('0x34')](_0xf0bc93[_0x3dab('0x30')],qs['fields'](_0x36e095['query'][_0x3dab('0x36')]));_0x5d00cf[_0x3dab('0x35')]=_0x5d00cf[_0x3dab('0x35')][_0x3dab('0x37')]?_0x5d00cf[_0x3dab('0x35')]:_0xf0bc93[_0x3dab('0x30')];if(_0x36e095[_0x3dab('0x31')][_0x3dab('0x40')]){_0x5d00cf[_0x3dab('0x41')]=[{'all':!![]}];}_0x5d00cf=_['merge']({},_0x5d00cf,_0x36e095['options']);return db['WhatsappApplication'][_0x3dab('0x44')](_0x5d00cf)[_0x3dab('0x25')](handleEntityNotFound(_0x2652e3,null))['then'](respondWithResult(_0x2652e3,null))[_0x3dab('0x45')](handleError(_0x2652e3,null));};exports[_0x3dab('0x46')]=function(_0x1137ec,_0x465819){return db[_0x3dab('0x2b')][_0x3dab('0x46')](_0x1137ec['body'],{})[_0x3dab('0x25')](respondWithResult(_0x465819,0xc9))['catch'](handleError(_0x465819,null));};exports[_0x3dab('0x47')]=function(_0x396e5e,_0x2341cd){if(_0x396e5e[_0x3dab('0x48')]['id']){delete _0x396e5e['body']['id'];}return db[_0x3dab('0x2b')][_0x3dab('0x44')]({'where':{'id':_0x396e5e[_0x3dab('0x43')]['id']}})[_0x3dab('0x25')](handleEntityNotFound(_0x2341cd,null))['then'](saveUpdates(_0x396e5e[_0x3dab('0x48')],null))[_0x3dab('0x25')](respondWithResult(_0x2341cd,null))[_0x3dab('0x45')](handleError(_0x2341cd,null));};exports[_0x3dab('0x26')]=function(_0x7c9bc6,_0x5cda6c){return db[_0x3dab('0x2b')]['find']({'where':{'id':_0x7c9bc6[_0x3dab('0x43')]['id']}})[_0x3dab('0x25')](handleEntityNotFound(_0x5cda6c,null))[_0x3dab('0x25')](removeEntity(_0x5cda6c,null))['catch'](handleError(_0x5cda6c,null));}; \ No newline at end of file +var _0x3588=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','show','length','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x299be3,_0x1a37a6){var _0xa32c75=function(_0x77d511){while(--_0x77d511){_0x299be3['push'](_0x299be3['shift']());}};_0xa32c75(++_0x1a37a6);}(_0x3588,0x82));var _0x8358=function(_0x327b49,_0xc232b8){_0x327b49=_0x327b49-0x0;var _0x4e7265=_0x3588[_0x327b49];return _0x4e7265;};'use strict';var emlformat=require(_0x8358('0x0'));var rimraf=require(_0x8358('0x1'));var zipdir=require(_0x8358('0x2'));var jsonpatch=require(_0x8358('0x3'));var rp=require(_0x8358('0x4'));var moment=require(_0x8358('0x5'));var BPromise=require(_0x8358('0x6'));var Mustache=require('mustache');var util=require(_0x8358('0x7'));var path=require(_0x8358('0x8'));var sox=require(_0x8358('0x9'));var csv=require(_0x8358('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8358('0xb'));var _=require(_0x8358('0xc'));var squel=require('squel');var crypto=require(_0x8358('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8358('0xe'));var toCsv=require(_0x8358('0xa'));var querystring=require(_0x8358('0xf'));var Papa=require(_0x8358('0x10'));var Redis=require('ioredis');var authService=require(_0x8358('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8358('0x12'));var hardwareService=require(_0x8358('0x13'));var logger=require(_0x8358('0x14'))(_0x8358('0x15'));var utils=require(_0x8358('0x16'));var config=require(_0x8358('0x17'));var licenseUtil=require(_0x8358('0x18'));var db=require(_0x8358('0x19'))['db'];function respondWithStatusCode(_0x3cf276,_0x2c2aeb){_0x2c2aeb=_0x2c2aeb||0xcc;return function(_0x213d5e){if(_0x213d5e){return _0x3cf276[_0x8358('0x1a')](_0x2c2aeb);}return _0x3cf276[_0x8358('0x1b')](_0x2c2aeb)[_0x8358('0x1c')]();};}function respondWithResult(_0xda422b,_0x317ea0){_0x317ea0=_0x317ea0||0xc8;return function(_0x51d21d){if(_0x51d21d){return _0xda422b['status'](_0x317ea0)[_0x8358('0x1d')](_0x51d21d);}};}function respondWithFilteredResult(_0x4bad9c,_0x19da0b){return function(_0x4f412a){if(_0x4f412a){var _0x585969=typeof _0x19da0b['offset']===_0x8358('0x1e')&&typeof _0x19da0b[_0x8358('0x1f')]===_0x8358('0x1e');var _0x366a2b=_0x4f412a[_0x8358('0x20')];var _0x27a21d=_0x585969?0x0:_0x19da0b[_0x8358('0x21')];var _0x524bfb=_0x585969?_0x4f412a[_0x8358('0x20')]:_0x19da0b[_0x8358('0x21')]+_0x19da0b['limit'];var _0x31038d;if(_0x524bfb>=_0x366a2b){_0x524bfb=_0x366a2b;_0x31038d=0xc8;}else{_0x31038d=0xce;}_0x4bad9c[_0x8358('0x1b')](_0x31038d);return _0x4bad9c[_0x8358('0x22')](_0x8358('0x23'),_0x27a21d+'-'+_0x524bfb+'/'+_0x366a2b)['json'](_0x4f412a);}return null;};}function patchUpdates(_0x56d435){return function(_0x19e667){try{jsonpatch[_0x8358('0x24')](_0x19e667,_0x56d435,!![]);}catch(_0x45ae60){return BPromise['reject'](_0x45ae60);}return _0x19e667['save']();};}function saveUpdates(_0x1330b5,_0x528ce8){return function(_0x218537){if(_0x218537){return _0x218537[_0x8358('0x25')](_0x1330b5)[_0x8358('0x26')](function(_0x21e9ad){return _0x21e9ad;});}return null;};}function removeEntity(_0x25d82a,_0x3675c3){return function(_0x1ae76d){if(_0x1ae76d){return _0x1ae76d['destroy']()[_0x8358('0x26')](function(){_0x25d82a['status'](0xcc)[_0x8358('0x1c')]();});}};}function handleEntityNotFound(_0x5d8317,_0x248d2f){return function(_0x1beaa7){if(!_0x1beaa7){_0x5d8317[_0x8358('0x1a')](0x194);}return _0x1beaa7;};}function handleError(_0x542499,_0x153e02){_0x153e02=_0x153e02||0x1f4;return function(_0x37a172){logger[_0x8358('0x27')](_0x37a172[_0x8358('0x28')]);if(_0x37a172[_0x8358('0x29')]){delete _0x37a172[_0x8358('0x29')];}_0x542499[_0x8358('0x1b')](_0x153e02)['send'](_0x37a172);};}exports[_0x8358('0x2a')]=function(_0x3921bc,_0x334443){var _0x458eb9={},_0x460d5c={},_0x1c1987={'count':0x0,'rows':[]};var _0x79b688=_[_0x8358('0x2b')](db[_0x8358('0x2c')][_0x8358('0x2d')],function(_0x340b39){return{'name':_0x340b39[_0x8358('0x2e')],'type':_0x340b39[_0x8358('0x2f')]['key']};});_0x460d5c[_0x8358('0x30')]=_['map'](_0x79b688,'name');_0x460d5c[_0x8358('0x31')]=_[_0x8358('0x32')](_0x3921bc[_0x8358('0x31')]);_0x460d5c[_0x8358('0x33')]=_['intersection'](_0x460d5c[_0x8358('0x30')],_0x460d5c[_0x8358('0x31')]);_0x458eb9[_0x8358('0x34')]=_['intersection'](_0x460d5c[_0x8358('0x30')],qs[_0x8358('0x35')](_0x3921bc[_0x8358('0x31')][_0x8358('0x35')]));_0x458eb9['attributes']=_0x458eb9[_0x8358('0x34')]['length']?_0x458eb9[_0x8358('0x34')]:_0x460d5c[_0x8358('0x30')];if(!_0x3921bc[_0x8358('0x31')][_0x8358('0x36')](_0x8358('0x37'))){_0x458eb9[_0x8358('0x1f')]=qs[_0x8358('0x1f')](_0x3921bc[_0x8358('0x31')][_0x8358('0x1f')]);_0x458eb9[_0x8358('0x21')]=qs[_0x8358('0x21')](_0x3921bc['query']['offset']);}_0x458eb9[_0x8358('0x38')]=qs[_0x8358('0x39')](_0x3921bc[_0x8358('0x31')][_0x8358('0x39')]);_0x458eb9['where']=qs[_0x8358('0x33')](_[_0x8358('0x3a')](_0x3921bc[_0x8358('0x31')],_0x460d5c[_0x8358('0x33')]),_0x79b688);if(_0x3921bc[_0x8358('0x31')][_0x8358('0x3b')]){_0x458eb9[_0x8358('0x3c')]=_['merge'](_0x458eb9[_0x8358('0x3c')],{'$or':_[_0x8358('0x2b')](_0x79b688,function(_0x546d2e){if(_0x546d2e[_0x8358('0x2f')]!==_0x8358('0x3d')){var _0x26ef7c={};_0x26ef7c[_0x546d2e[_0x8358('0x29')]]={'$like':'%'+_0x3921bc['query'][_0x8358('0x3b')]+'%'};return _0x26ef7c;}})});}_0x458eb9=_[_0x8358('0x3e')]({},_0x458eb9,_0x3921bc[_0x8358('0x3f')]);var _0x5b047a={'where':_0x458eb9[_0x8358('0x3c')]};return db[_0x8358('0x2c')][_0x8358('0x20')](_0x5b047a)[_0x8358('0x26')](function(_0x2c2a27){_0x1c1987['count']=_0x2c2a27;if(_0x3921bc['query'][_0x8358('0x40')]){_0x458eb9['include']=[{'all':!![]}];}return db[_0x8358('0x2c')]['findAll'](_0x458eb9);})['then'](function(_0x2a0a8a){_0x1c1987[_0x8358('0x41')]=_0x2a0a8a;return _0x1c1987;})[_0x8358('0x26')](respondWithFilteredResult(_0x334443,_0x458eb9))[_0x8358('0x42')](handleError(_0x334443,null));};exports[_0x8358('0x43')]=function(_0x106778,_0x2cd23f){var _0x32334f={'raw':!![],'where':{'id':_0x106778['params']['id']}},_0x59272f={};_0x59272f['model']=_[_0x8358('0x32')](db[_0x8358('0x2c')]['rawAttributes']);_0x59272f[_0x8358('0x31')]=_[_0x8358('0x32')](_0x106778[_0x8358('0x31')]);_0x59272f[_0x8358('0x33')]=_['intersection'](_0x59272f[_0x8358('0x30')],_0x59272f['query']);_0x32334f[_0x8358('0x34')]=_['intersection'](_0x59272f[_0x8358('0x30')],qs[_0x8358('0x35')](_0x106778[_0x8358('0x31')]['fields']));_0x32334f[_0x8358('0x34')]=_0x32334f[_0x8358('0x34')][_0x8358('0x44')]?_0x32334f[_0x8358('0x34')]:_0x59272f['model'];if(_0x106778['query']['includeAll']){_0x32334f['include']=[{'all':!![]}];}_0x32334f=_[_0x8358('0x3e')]({},_0x32334f,_0x106778[_0x8358('0x3f')]);return db[_0x8358('0x2c')][_0x8358('0x45')](_0x32334f)[_0x8358('0x26')](handleEntityNotFound(_0x2cd23f,null))[_0x8358('0x26')](respondWithResult(_0x2cd23f,null))['catch'](handleError(_0x2cd23f,null));};exports[_0x8358('0x46')]=function(_0x3e906d,_0x3664cb){return db[_0x8358('0x2c')][_0x8358('0x46')](_0x3e906d[_0x8358('0x47')],{})[_0x8358('0x26')](respondWithResult(_0x3664cb,0xc9))[_0x8358('0x42')](handleError(_0x3664cb,null));};exports['update']=function(_0x467fbc,_0x2da39c){if(_0x467fbc['body']['id']){delete _0x467fbc['body']['id'];}return db[_0x8358('0x2c')]['find']({'where':{'id':_0x467fbc[_0x8358('0x48')]['id']}})[_0x8358('0x26')](handleEntityNotFound(_0x2da39c,null))[_0x8358('0x26')](saveUpdates(_0x467fbc[_0x8358('0x47')],null))[_0x8358('0x26')](respondWithResult(_0x2da39c,null))[_0x8358('0x42')](handleError(_0x2da39c,null));};exports[_0x8358('0x49')]=function(_0x134144,_0x57e15f){return db[_0x8358('0x2c')][_0x8358('0x45')]({'where':{'id':_0x134144[_0x8358('0x48')]['id']}})['then'](handleEntityNotFound(_0x57e15f,null))[_0x8358('0x26')](removeEntity(_0x57e15f,null))[_0x8358('0x42')](handleError(_0x57e15f,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 262ed7d..256ff6d 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 _0x4491=['path','rimraf','../../config/environment','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x59591b,_0x354045){var _0x576642=function(_0x12d1ce){while(--_0x12d1ce){_0x59591b['push'](_0x59591b['shift']());}};_0x576642(++_0x354045);}(_0x4491,0x1bb));var _0x1449=function(_0x58fb4f,_0x575aa6){_0x58fb4f=_0x58fb4f-0x0;var _0x3b9efa=_0x4491[_0x58fb4f];return _0x3b9efa;};'use strict';var _=require(_0x1449('0x0'));var util=require('util');var logger=require(_0x1449('0x1'))('api');var moment=require(_0x1449('0x2'));var BPromise=require(_0x1449('0x3'));var rp=require(_0x1449('0x4'));var fs=require('fs');var path=require(_0x1449('0x5'));var rimraf=require(_0x1449('0x6'));var config=require(_0x1449('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0x1449('0x8')]=function(_0x557482,_0x1d45eb){return _0x557482[_0x1449('0x9')](_0x1449('0xa'),attributes,{'tableName':_0x1449('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1449('0xc'),'collate':_0x1449('0xd')});}; \ No newline at end of file +var _0x950a=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./whatsappApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x950a,0x111));var _0xa950=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0x950a[_0x567bcb];return _0x4eebc2;};'use strict';var _=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var logger=require(_0xa950('0x2'))(_0xa950('0x3'));var moment=require('moment');var BPromise=require(_0xa950('0x4'));var rp=require(_0xa950('0x5'));var fs=require('fs');var path=require(_0xa950('0x6'));var rimraf=require(_0xa950('0x7'));var config=require('../../config/environment');var attributes=require(_0xa950('0x8'));module[_0xa950('0x9')]=function(_0x512c0e,_0x14b4ac){return _0x512c0e[_0xa950('0xa')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa950('0xb'),'collate':_0xa950('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index a6187fa..b80ddbc 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','util'];(function(_0x500fae,_0x9be8cf){var _0x2957dd=function(_0x35965f){while(--_0x35965f){_0x500fae['push'](_0x500fae['shift']());}};_0x2957dd(++_0x9be8cf);}(_0xedd9,0xfc));var _0x9edd=function(_0x5deab0,_0x59f8e6){_0x5deab0=_0x5deab0-0x0;var _0x381b5a=_0xedd9[_0x5deab0];return _0x381b5a;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','WhatsappApplication,\x20%s,\x20%s','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x2cca62,_0x27d712){var _0x32eb88=function(_0x5509a3){while(--_0x5509a3){_0x2cca62['push'](_0x2cca62['shift']());}};_0x32eb88(++_0x27d712);}(_0x9f62,0x154));var _0x29f6=function(_0x31c105,_0x1ba933){_0x31c105=_0x31c105-0x0;var _0x2eb29f=_0x9f62[_0x31c105];return _0x2eb29f;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272876,_0x9a43fe,_0x2ba602){return new BPromise(function(_0x416c6c,_0x5e9945){return client['request'](_0x272876,_0x2ba602)['then'](function(_0x549f64){logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,'request\x20sent');logger['debug'](_0x29f6('0xb'),_0x9a43fe,_0x29f6('0xc'),JSON['stringify'](_0x549f64));if(_0x549f64[_0x29f6('0xd')]){if(_0x549f64[_0x29f6('0xd')]['code']===0x1f4){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x9a43fe,_0x549f64['error'][_0x29f6('0xe')]);return _0x5e9945(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}logger[_0x29f6('0xd')](_0x29f6('0xa'),_0x9a43fe,_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);return _0x416c6c(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}else{logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,_0x29f6('0xc'));_0x416c6c(_0x549f64[_0x29f6('0xf')][_0x29f6('0xe')]);}})[_0x29f6('0x10')](function(_0x14dd56){logger[_0x29f6('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x9a43fe,_0x14dd56);_0x5e9945(_0x14dd56);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 4dd59ef..ffd5db0 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 _0xfb65=['/:id/tags','tracked','addTags','put','whatsapp','update','delete','destroy','removeTags','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage'];(function(_0x25bc8e,_0xfc8071){var _0x361990=function(_0x283643){while(--_0x283643){_0x25bc8e['push'](_0x25bc8e['shift']());}};_0x361990(++_0xfc8071);}(_0xfb65,0x82));var _0x5fb6=function(_0x2be1d6,_0x6ee010){_0x2be1d6=_0x2be1d6-0x0;var _0xea43e4=_0xfb65[_0x2be1d6];return _0xea43e4;};'use strict';var multer=require('multer');var util=require(_0x5fb6('0x0'));var path=require(_0x5fb6('0x1'));var timeout=require('connect-timeout');var express=require(_0x5fb6('0x2'));var router=express['Router']();var fs_extra=require(_0x5fb6('0x3'));var auth=require(_0x5fb6('0x4'));var interaction=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var controller=require(_0x5fb6('0x7'));router[_0x5fb6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5fb6('0x8')](_0x5fb6('0x9'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xb')]);router['get'](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xd')]);router[_0x5fb6('0x8')]('/:id/messages',auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xe')]);router['get'](_0x5fb6('0xf'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x10')]);router[_0x5fb6('0x11')]('/',auth[_0x5fb6('0xa')](),controller['create']);router[_0x5fb6('0x11')](_0x5fb6('0x12'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x13')]);router[_0x5fb6('0x11')](_0x5fb6('0x14'),auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')]('whatsapp','whatsappinteraction:addtags'),controller[_0x5fb6('0x16')]);router[_0x5fb6('0x17')]('/:id',auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')](_0x5fb6('0x18'),'whatsappinteraction:update'),controller[_0x5fb6('0x19')]);router[_0x5fb6('0x1a')](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')](_0x5fb6('0x18'),'whatsappinteraction:destroy'),controller[_0x5fb6('0x1b')]);router['delete'](_0x5fb6('0x14'),auth['isAuthenticated'](),controller[_0x5fb6('0x1c')]);module[_0x5fb6('0x1d')]=router; \ No newline at end of file +var _0x31f0=['tracked','whatsapp','whatsappinteraction:addtags','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags'];(function(_0xba96b0,_0x36e8f8){var _0xdad969=function(_0x5226b4){while(--_0x5226b4){_0xba96b0['push'](_0xba96b0['shift']());}};_0xdad969(++_0x36e8f8);}(_0x31f0,0xb7));var _0x031f=function(_0x4e4ba2,_0x1c0b35){_0x4e4ba2=_0x4e4ba2-0x0;var _0x36c600=_0x31f0[_0x4e4ba2];return _0x36c600;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x031f('0x8')]('/describe',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0x8')](_0x031f('0xb'),auth['isAuthenticated'](),controller[_0x031f('0xc')]);router[_0x031f('0x8')](_0x031f('0xd'),auth[_0x031f('0x9')](),controller[_0x031f('0xe')]);router[_0x031f('0x8')](_0x031f('0xf'),auth[_0x031f('0x9')](),controller['download']);router[_0x031f('0x10')]('/',auth[_0x031f('0x9')](),controller[_0x031f('0x11')]);router[_0x031f('0x10')](_0x031f('0xd'),auth[_0x031f('0x9')](),controller[_0x031f('0x12')]);router['post'](_0x031f('0x13'),auth[_0x031f('0x9')](),interaction[_0x031f('0x14')](_0x031f('0x15'),_0x031f('0x16')),controller['addTags']);router['put'](_0x031f('0xb'),auth[_0x031f('0x9')](),interaction[_0x031f('0x14')](_0x031f('0x15'),'whatsappinteraction:update'),controller[_0x031f('0x17')]);router[_0x031f('0x18')]('/:id',auth[_0x031f('0x9')](),interaction['tracked'](_0x031f('0x15'),_0x031f('0x19')),controller[_0x031f('0x1a')]);router[_0x031f('0x18')](_0x031f('0x13'),auth[_0x031f('0x9')](),controller[_0x031f('0x1b')]);module[_0x031f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index c511f63..bb98c63 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 _0x49df=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x408e38,_0x23cda8){var _0x426b0e=function(_0x8f2898){while(--_0x8f2898){_0x408e38['push'](_0x408e38['shift']());}};_0x426b0e(++_0x23cda8);}(_0x49df,0xad));var _0xf49d=function(_0x382b8f,_0x5e0c9f){_0x382b8f=_0x382b8f-0x0;var _0x4c9b0e=_0x49df[_0x382b8f];return _0x4c9b0e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xf49d('0x0')]={'closed':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf49d('0x2')]},'disposition':{'type':Sequelize[_0xf49d('0x3')]},'secondDisposition':{'type':Sequelize[_0xf49d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf49d('0x3')]},'note':{'type':Sequelize[_0xf49d('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf49d('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf49d('0x4')]('in',_0xf49d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf49d('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf49d('0x4')]('in',_0xf49d('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbe52=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x42c92d,_0x2a215f){var _0x1d1436=function(_0x15a515){while(--_0x15a515){_0x42c92d['push'](_0x42c92d['shift']());}};_0x1d1436(++_0x2a215f);}(_0xbe52,0x164));var _0x2be5=function(_0x32f029,_0x4f58a6){_0x32f029=_0x32f029-0x0;var _0xd8796a=_0xbe52[_0x32f029];return _0xd8796a;};'use strict';var Sequelize=require(_0x2be5('0x0'));var moment=require(_0x2be5('0x1'));module[_0x2be5('0x2')]={'closed':{'type':Sequelize[_0x2be5('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2be5('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2be5('0x5')]},'thirdDisposition':{'type':Sequelize[_0x2be5('0x5')]},'note':{'type':Sequelize[_0x2be5('0x5')]},'phone':{'type':Sequelize[_0x2be5('0x5')]},'read1stAt':{'type':Sequelize[_0x2be5('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2be5('0x6')]('in',_0x2be5('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2be5('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2be5('0x6')]('in',_0x2be5('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2be5('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 196cb9a..3ff823c 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 _0x3fec=['Content-Range','apply','reject','save','update','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','then','catch','index','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','`\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)','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','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','isArray','tag','replace','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','QueryTypes','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','toString','sequelize','keyBy','WhatsappInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.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','c.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','merge','options','create','body','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','hasOwnProperty','pick','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','color','emit','whatsappInteractionTags:save','removeTags','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','push','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','System','out','renderFile','views','.pdf','download','err','unlinkSync','eml-format','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x3bc1d6,_0x3c6269){var _0x547f5f=function(_0x38fb03){while(--_0x38fb03){_0x3bc1d6['push'](_0x3bc1d6['shift']());}};_0x547f5f(++_0x3c6269);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc3fe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc3fe('0x1'));var rp=require(_0xc3fe('0x2'));var moment=require('moment');var BPromise=require(_0xc3fe('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc3fe('0x4'));var sox=require('sox');var csv=require(_0xc3fe('0x5'));var ejs=require(_0xc3fe('0x6'));var fs=require('fs');var fs_extra=require(_0xc3fe('0x7'));var _=require(_0xc3fe('0x8'));var squel=require(_0xc3fe('0x9'));var crypto=require(_0xc3fe('0xa'));var jsforce=require(_0xc3fe('0xb'));var deskjs=require(_0xc3fe('0xc'));var toCsv=require(_0xc3fe('0x5'));var querystring=require(_0xc3fe('0xd'));var Papa=require(_0xc3fe('0xe'));var Redis=require(_0xc3fe('0xf'));var authService=require(_0xc3fe('0x10'));var qs=require(_0xc3fe('0x11'));var as=require(_0xc3fe('0x12'));var pdf=require(_0xc3fe('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3fe('0x14'))(_0xc3fe('0x15'));var utils=require('../../config/utils');var config=require(_0xc3fe('0x16'));var licenseUtil=require(_0xc3fe('0x17'));var db=require(_0xc3fe('0x18'))['db'];config[_0xc3fe('0x19')]=_[_0xc3fe('0x1a')](config[_0xc3fe('0x19')],{'host':_0xc3fe('0x1b'),'port':0x18eb});var socket=require(_0xc3fe('0x1c'))(new Redis(config[_0xc3fe('0x19')]));require(_0xc3fe('0x1d'))['register'](socket);function respondWithStatusCode(_0x400476,_0x531fa5){_0x531fa5=_0x531fa5||0xcc;return function(_0x10091c){if(_0x10091c){return _0x400476[_0xc3fe('0x1e')](_0x531fa5);}return _0x400476[_0xc3fe('0x1f')](_0x531fa5)[_0xc3fe('0x20')]();};}function respondWithResult(_0x17edb6,_0x39705c){_0x39705c=_0x39705c||0xc8;return function(_0x1e291f){if(_0x1e291f){return _0x17edb6[_0xc3fe('0x1f')](_0x39705c)[_0xc3fe('0x21')](_0x1e291f);}};}function respondWithFilteredResult(_0x8d0835,_0x376fff){return function(_0x442fbd){if(_0x442fbd){var _0x423447=typeof _0x376fff[_0xc3fe('0x22')]===_0xc3fe('0x23')&&typeof _0x376fff['limit']===_0xc3fe('0x23');var _0x203d40=_0x442fbd[_0xc3fe('0x24')];var _0x599ea5=_0x423447?0x0:_0x376fff[_0xc3fe('0x22')];var _0x374fb4=_0x423447?_0x442fbd['count']:_0x376fff['offset']+_0x376fff[_0xc3fe('0x25')];var _0x434eb8;if(_0x374fb4>=_0x203d40){_0x374fb4=_0x203d40;_0x434eb8=0xc8;}else{_0x434eb8=0xce;}_0x8d0835[_0xc3fe('0x1f')](_0x434eb8);return _0x8d0835['set'](_0xc3fe('0x26'),_0x599ea5+'-'+_0x374fb4+'/'+_0x203d40)[_0xc3fe('0x21')](_0x442fbd);}return null;};}function patchUpdates(_0x3f9418){return function(_0x3c0ac4){try{jsonpatch[_0xc3fe('0x27')](_0x3c0ac4,_0x3f9418,!![]);}catch(_0x474195){return BPromise[_0xc3fe('0x28')](_0x474195);}return _0x3c0ac4[_0xc3fe('0x29')]();};}function saveUpdates(_0x2c4727,_0x30657f){return function(_0x3b4423){if(_0x3b4423){return _0x3b4423[_0xc3fe('0x2a')](_0x2c4727)['then'](function(_0x3220e7){return _0x3220e7;});}return null;};}function removeEntity(_0x1caee8,_0x1d3c16){return function(_0x3e8075){if(_0x3e8075){return _0x3e8075[_0xc3fe('0x2b')]()['then'](function(){_0x1caee8[_0xc3fe('0x1f')](0xcc)[_0xc3fe('0x20')]();});}};}function handleEntityNotFound(_0x2bfaa0,_0x1593b0){return function(_0x820b7f){if(!_0x820b7f){_0x2bfaa0[_0xc3fe('0x1e')](0x194);}return _0x820b7f;};}function handleError(_0x2dac90,_0x267b89){_0x267b89=_0x267b89||0x1f4;return function(_0xa74edf){logger[_0xc3fe('0x2c')](_0xa74edf[_0xc3fe('0x2d')]);if(_0xa74edf[_0xc3fe('0x2e')]){delete _0xa74edf[_0xc3fe('0x2e')];}_0x2dac90[_0xc3fe('0x1f')](_0x267b89)[_0xc3fe('0x2f')](_0xa74edf);};}function getInteractionUsers(_0x1339e7,_0x3cb4a7){return new BPromise(function(_0xe2117a,_0x5ac845){try{if(_0x3cb4a7[_0x1339e7['id']]){_0x1339e7[_0xc3fe('0x30')]=_[_0xc3fe('0x31')](_0x3cb4a7[_0x1339e7['id']],function(_0x4658c5){return{'id':_0x4658c5['id'],'fullname':_0x4658c5[_0xc3fe('0x32')]};});}}catch(_0x11a44e){_0x5ac845(_0x11a44e);}_0xe2117a(_0x1339e7);});}function getInteractionTags(_0x293999,_0x3f4573){return new BPromise(function(_0x28fc3b,_0x6fe063){try{if(_0x293999[_0xc3fe('0x33')]){_0x293999[_0xc3fe('0x34')]=[];_0x293999['TagIds']['split'](',')['forEach'](function(_0x26f65d){_0x293999[_0xc3fe('0x34')]['push'](_0x3f4573[_0x26f65d]);});}delete _0x293999[_0xc3fe('0x33')];}catch(_0x32f7b2){_0x6fe063(_0x32f7b2);}_0x28fc3b(_0x293999);});}function updateWhatsappInteraction(_0x5f37c0,_0x5b76ae,_0x38c948){return new BPromise(function(_0x237680,_0xd8aa2c){return getInteractionUsers(_0x5f37c0,_0x38c948)[_0xc3fe('0x35')](function(_0x5716b0){return getInteractionTags(_0x5716b0,_0x5b76ae);})['then'](function(_0x403283){_0x237680(_0x403283);})[_0xc3fe('0x36')](function(_0x4c47ef){_0xd8aa2c(_0x4c47ef);});});}exports[_0xc3fe('0x37')]=function(_0x5a9711,_0x299b61){var _0x484e59={},_0x1b0090={},_0x4e694d={'count':0x0,'rows':[]};var _0x7fc7fb=_[_0xc3fe('0x31')](db['WhatsappInteraction'][_0xc3fe('0x38')],function(_0x37e615){return{'name':_0x37e615['fieldName'],'type':_0x37e615[_0xc3fe('0x39')]['key']};});_0x1b0090[_0xc3fe('0x3a')]=_[_0xc3fe('0x31')](_0x7fc7fb,_0xc3fe('0x2e'));_0x1b0090[_0xc3fe('0x3b')]=_[_0xc3fe('0x3c')](_0x5a9711['query']);_0x1b0090[_0xc3fe('0x3d')]=_[_0xc3fe('0x3e')](_0x1b0090[_0xc3fe('0x3a')],_0x1b0090[_0xc3fe('0x3b')]);_0x484e59[_0xc3fe('0x3f')]=_[_0xc3fe('0x3e')](_0x1b0090[_0xc3fe('0x3a')],qs['fields'](_0x5a9711[_0xc3fe('0x3b')][_0xc3fe('0x40')]));_0x484e59[_0xc3fe('0x3f')]=_0x484e59[_0xc3fe('0x3f')][_0xc3fe('0x41')]?_0x484e59[_0xc3fe('0x3f')]:_0x1b0090[_0xc3fe('0x3a')];if(!_0x5a9711['query']['hasOwnProperty'](_0xc3fe('0x42'))){_0x484e59['limit']=qs['limit'](_0x5a9711[_0xc3fe('0x3b')][_0xc3fe('0x25')]);_0x484e59[_0xc3fe('0x22')]=qs[_0xc3fe('0x22')](_0x5a9711['query'][_0xc3fe('0x22')]);}_0x484e59[_0xc3fe('0x43')]=qs[_0xc3fe('0x44')](_0x5a9711['query'][_0xc3fe('0x44')]);_0x484e59[_0xc3fe('0x45')]=qs[_0xc3fe('0x3d')](_['pick'](_0x5a9711['query'],_0x1b0090['filters']),_0x7fc7fb);var _0x47551b=[];var _0x1530ff=squel[_0xc3fe('0x46')]()[_0xc3fe('0x47')]('id')[_0xc3fe('0x47')](_0xc3fe('0x2e'))[_0xc3fe('0x47')]('color')[_0xc3fe('0x48')](_0xc3fe('0x49'));var _0x97dded=squel[_0xc3fe('0x46')]()[_0xc3fe('0x47')](_0xc3fe('0x4a'))['field'](_0xc3fe('0x4b'))[_0xc3fe('0x47')](_0xc3fe('0x4c'))[_0xc3fe('0x48')](_0xc3fe('0x4d'),'ui')[_0xc3fe('0x4e')](_0xc3fe('0x4f'),'u',_0xc3fe('0x50'));var _0x4328b0=squel[_0xc3fe('0x46')]()['from'](_0xc3fe('0x51'),'i')[_0xc3fe('0x4e')](_0xc3fe('0x52'),'c',_0xc3fe('0x53'))[_0xc3fe('0x4e')](_0xc3fe('0x4f'),'o',_0xc3fe('0x54'))[_0xc3fe('0x4e')](_0xc3fe('0x55'),'a',_0xc3fe('0x56'))[_0xc3fe('0x4e')](_0xc3fe('0x57'),'me',_0xc3fe('0x58'))[_0xc3fe('0x4e')]('whatsapp_interaction_has_tags','it',_0xc3fe('0x59'))[_0xc3fe('0x4e')](_0xc3fe('0x49'),'t','t.id\x20=\x20it.TagId');var _0x1700e9=squel[_0xc3fe('0x5a')]();var _0x2668fb=[];var _0x49be8b=squel[_0xc3fe('0x5a')]();var _0x5a3c2c;if(_0x5a9711['query'][_0xc3fe('0x5b')]){_0x5a3c2c=as[_0xc3fe('0x5c')](_0x5a9711['query'][_0xc3fe('0x5b')]);var _0x400133=_0x5a3c2c['sqlOperator'];for(var _0xbbe076=0x0;_0xbbe076<_0x5a3c2c[_0xc3fe('0x5d')][_0xc3fe('0x41')];_0xbbe076++){var _0x3f85c0=_0x5a3c2c['conditions'][_0xbbe076];var _0x5d7b8a='i';var _0x196583=_[_0xc3fe('0x5e')](_0x7fc7fb,[_0xc3fe('0x2e'),_0x3f85c0['field']]);if(!_0x196583){switch(_0x3f85c0[_0xc3fe('0x47')]){case _0xc3fe('0x5f'):if(_0x3f85c0[_0xc3fe('0x60')]==0x1){_0x4328b0['having']('`'+_0x3f85c0[_0xc3fe('0x47')]+_0xc3fe('0x61'));}else{_0x4328b0['having']('`'+_0x3f85c0[_0xc3fe('0x47')]+_0xc3fe('0x62'));}break;case _0xc3fe('0x63'):if(_0x3f85c0[_0xc3fe('0x64')]===_0xc3fe('0x65')){if(_0x3f85c0[_0xc3fe('0x60')][_0xc3fe('0x66')]('\x20')[_0xc3fe('0x41')]>0x1){_0x1700e9[_0x400133](_0xc3fe('0x67'),qs['getFullTextValue'](_0x3f85c0[_0xc3fe('0x60')]),null);}else{var _0x5d1b6d='%'+_0x3f85c0[_0xc3fe('0x60')]+'%';_0x1700e9[_0x400133](_0xc3fe('0x68'),_0x5d1b6d,_0x5d1b6d,_0x5d1b6d);}}else{_0x196583=_['find'](_0x7fc7fb,[_0xc3fe('0x2e'),_0xc3fe('0x69')]);_0x3f85c0[_0xc3fe('0x47')]='ContactId';_0x51370d=as[_0xc3fe('0x6a')](_0x5d7b8a,_0x196583[_0xc3fe('0x39')],_0x3f85c0);_0x1700e9[_0x400133](_0x51370d[_0xc3fe('0x6b')],_0x51370d['value'][_0xc3fe('0x6c')],_0x51370d[_0xc3fe('0x60')][_0xc3fe('0x20')]);}break;case _0xc3fe('0x6d'):var _0x17fc18=_0x3f85c0[_0xc3fe('0x60')][_0xc3fe('0x66')](',')['map'](function(_0x11e5bf){return Number(_0x11e5bf);});_0x17fc18[_0xc3fe('0x6e')](function(_0x1ab9c8){_0x49be8b['or'](_0xc3fe('0x6f'),'%,'+_0x1ab9c8+',%');});_0x2668fb=_[_0xc3fe('0x70')](_0x2668fb,_0x17fc18);break;case _0xc3fe('0x71'):if(_0x3f85c0[_0xc3fe('0x64')]===_0xc3fe('0x65')){_0x1700e9[_0x400133](_0xc3fe('0x72'),'%'+_0x3f85c0[_0xc3fe('0x60')]+'%',null);}else{_0x196583=_[_0xc3fe('0x5e')](_0x7fc7fb,['name',_0xc3fe('0x73')]);_0x3f85c0[_0xc3fe('0x47')]='UserId';_0x51370d=as[_0xc3fe('0x6a')](_0x5d7b8a,_0x196583['type'],_0x3f85c0);_0x1700e9[_0x400133](_0x51370d[_0xc3fe('0x6b')],_0x51370d[_0xc3fe('0x60')][_0xc3fe('0x6c')],_0x51370d[_0xc3fe('0x60')][_0xc3fe('0x20')]);}break;case'body':_0x51370d=as[_0xc3fe('0x6a')]('me',null,_0x3f85c0);_0x1700e9[_0x400133](_0x51370d['text'],_0x51370d[_0xc3fe('0x60')]['start'],_0x51370d[_0xc3fe('0x60')][_0xc3fe('0x20')]);break;}}else{var _0x51370d=as[_0xc3fe('0x6a')](_0x5d7b8a,_0x196583[_0xc3fe('0x39')],_0x3f85c0);_0x1700e9[_0x400133](_0x51370d[_0xc3fe('0x6b')],_0x51370d[_0xc3fe('0x60')][_0xc3fe('0x6c')],_0x51370d[_0xc3fe('0x60')][_0xc3fe('0x20')]);}}}else{var _0x418b54=_(_0x5a9711['query'])[_0xc3fe('0x3c')]()[_0xc3fe('0x31')](function(_0x3f95fe){return _[_0xc3fe('0x74')](_0x7fc7fb,['name',_0x3f95fe])?_0x3f95fe:undefined;})['compact']()[_0xc3fe('0x60')]();if(!_[_0xc3fe('0x75')](_0x418b54)){_0x418b54[_0xc3fe('0x6e')](function(_0x1a853d){if(_0x1a853d===_0xc3fe('0x76')){_0x4328b0[_0xc3fe('0x45')](_0xc3fe('0x77'),[][_0xc3fe('0x78')](_0x5a9711[_0xc3fe('0x3b')][_0x1a853d]));}else if(_0x1a853d==='createdAt'){var _0x459e46=JSON[_0xc3fe('0x79')](_0x5a9711[_0xc3fe('0x3b')][_0x1a853d])['$gte'];var _0xae8545=JSON[_0xc3fe('0x79')](_0x5a9711[_0xc3fe('0x3b')][_0x1a853d])[_0xc3fe('0x7a')];_0x4328b0[_0xc3fe('0x45')](_0xc3fe('0x7b'),_0x459e46,_0xae8545);}else{if(_0x5a9711[_0xc3fe('0x3b')][_0x1a853d]===_0xc3fe('0x7c')){_0x4328b0[_0xc3fe('0x45')]('i.'+_0x1a853d+_0xc3fe('0x7d'));}else{_0x4328b0[_0xc3fe('0x45')]('i.'+_0x1a853d+_0xc3fe('0x7e'),_0x5a9711[_0xc3fe('0x3b')][_0x1a853d]);}}});}if(_0x5a9711[_0xc3fe('0x3b')]['read']){if(_0x5a9711['query'][_0xc3fe('0x7f')]==0x1){_0x4328b0['having'](_0xc3fe('0x80'));}else{_0x4328b0[_0xc3fe('0x81')]('`unreadMessages`\x20>\x200');}}if(_0x5a9711[_0xc3fe('0x3b')]['tag']){_0x2668fb=_[_0xc3fe('0x82')](_0x5a9711['query'][_0xc3fe('0x83')])?_0x5a9711[_0xc3fe('0x3b')]['tag']:new Array(_0x5a9711[_0xc3fe('0x3b')][_0xc3fe('0x83')]);_0x2668fb[_0xc3fe('0x6e')](function(_0x2a5a54){_0x49be8b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a5a54+',%');});}if(_0x5a9711[_0xc3fe('0x3b')]['filter']){var _0x12cdb1=_0x5a9711[_0xc3fe('0x3b')]['filter'][_0xc3fe('0x84')]('\x5c','\x5c\x5c')[_0xc3fe('0x84')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x12cdb1)){_0x1700e9['or'](_0xc3fe('0x85'),_0x12cdb1+'%')['or'](_0xc3fe('0x86'),_0x12cdb1+'%');}else{_0x1700e9['or'](_0xc3fe('0x87'),qs[_0xc3fe('0x88')](_0x12cdb1))['or'](_0xc3fe('0x89'),_0x12cdb1+'%');}}}_0x4328b0['where'](_0x1700e9);_0x4328b0[_0xc3fe('0x8a')](_0xc3fe('0x8b'));var _0xa15ef2={'type':db['Sequelize'][_0xc3fe('0x8c')]['SELECT'],'raw':!![]};var _0x1658ec=_0x4328b0['clone']();_0x1658ec['field']('i.id');_0x1658ec['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc3fe('0x5f'));if(_0x484e59[_0xc3fe('0x43')]){_0x484e59[_0xc3fe('0x43')][_0xc3fe('0x6e')](function(_0x5253a0){var _0x505455=_0x5253a0[0x0]===_0xc3fe('0x8d')?_0x5253a0[0x0]:'i.'+_0x5253a0[0x0];_0x4328b0[_0xc3fe('0x43')](_0x505455,_0x5253a0[0x1]===_0xc3fe('0x8e')?![]:!![]);});}if(!_[_0xc3fe('0x75')](_0x2668fb)){_0x4328b0[_0xc3fe('0x81')](_0x49be8b);_0x1658ec[_0xc3fe('0x45')](_0xc3fe('0x8f'),_0x2668fb);}BPromise[_0xc3fe('0x90')]()[_0xc3fe('0x35')](function(){if(!_0x5a3c2c){if(_0x5a9711['query'][_0xc3fe('0x76')])return;_0x1658ec[_0xc3fe('0x45')](_0xc3fe('0x91'));_0x4328b0['where'](_0xc3fe('0x91'));return;}if(_0x5a9711[_0xc3fe('0x92')][_0xc3fe('0x93')]!==_0xc3fe('0x94'))return;return _0x5a9711['user'][_0xc3fe('0x95')]({'attributes':['id'],'raw':!![]})[_0xc3fe('0x35')](function(_0x595534){if(_['isEmpty'](_0x595534)){_0x1658ec[_0xc3fe('0x45')]('i.WhatsappAccountId\x20IS\x20NULL');_0x4328b0[_0xc3fe('0x45')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x1658ec[_0xc3fe('0x45')]('i.WhatsappAccountId\x20IN\x20?',_[_0xc3fe('0x31')](_0x595534,'id'));_0x4328b0[_0xc3fe('0x45')](_0xc3fe('0x77'),_[_0xc3fe('0x31')](_0x595534,'id'));}});})[_0xc3fe('0x35')](function(){if(_0x5a9711['user'][_0xc3fe('0x93')]==='agent'&&!_0x5a3c2c&&!_0x5a9711['query']['WhatsappAccountId'])return[];return db['sequelize']['query'](_0x1658ec[_0xc3fe('0x96')](),_0xa15ef2);})[_0xc3fe('0x35')](function(_0x3feb30){_0x4e694d[_0xc3fe('0x24')]=_0x3feb30[_0xc3fe('0x41')];if(_0x4e694d[_0xc3fe('0x24')]===0x0)return[];return db[_0xc3fe('0x97')][_0xc3fe('0x3b')](_0x1530ff['toString'](),_0xa15ef2)[_0xc3fe('0x35')](function(_0x2b21dc){_0x47551b=_[_0xc3fe('0x98')](_0x2b21dc,'id');_0xa15ef2=_['merge'](_0xa15ef2,{'model':db[_0xc3fe('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a9711[_0xc3fe('0x3b')][_0xc3fe('0x40')]){_0x484e59[_0xc3fe('0x3f')][_0xc3fe('0x6e')](function(_0x53c2e3){_0x4328b0[_0xc3fe('0x47')]('i.'+_0x53c2e3);});}else{_0x4328b0[_0xc3fe('0x47')](_0xc3fe('0x9a'),_0xc3fe('0x5f'));_0x4328b0[_0xc3fe('0x47')](_0xc3fe('0x9b'),'Account.key');_0x4328b0[_0xc3fe('0x47')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x4328b0[_0xc3fe('0x47')](_0xc3fe('0x9c'),_0xc3fe('0x8d'));_0x4328b0['field'](_0xc3fe('0x9d'));_0x4328b0['field'](_0xc3fe('0x9e'),_0xc3fe('0x9f'));_0x4328b0[_0xc3fe('0x47')]('c.lastName',_0xc3fe('0xa0'));_0x4328b0[_0xc3fe('0x47')](_0xc3fe('0xa1'),'Contact.email');_0x4328b0[_0xc3fe('0x47')](_0xc3fe('0xa2'),'Contact.phone');_0x4328b0[_0xc3fe('0x47')](_0xc3fe('0xa3'),'Contact.mobile');_0x4328b0[_0xc3fe('0x47')](_0xc3fe('0xa4'),_0xc3fe('0xa5'));_0x4328b0[_0xc3fe('0x47')](_0xc3fe('0xa6'),_0xc3fe('0xa7'));_0x4328b0['field'](_0xc3fe('0xa8'),_0xc3fe('0xa9'));_0x4328b0[_0xc3fe('0x47')](_0xc3fe('0xaa'),_0xc3fe('0x33'));}if(_0x484e59[_0xc3fe('0x25')])_0x4328b0[_0xc3fe('0x25')](_0x484e59[_0xc3fe('0x25')]);if(_0x484e59['offset'])_0x4328b0[_0xc3fe('0x22')](_0x484e59[_0xc3fe('0x22')]);return db['sequelize'][_0xc3fe('0x3b')](_0x4328b0[_0xc3fe('0x96')](),_0xa15ef2);})['then'](function(_0x15f1f5){if(_0x15f1f5[_0xc3fe('0x41')]>0x0)_0x97dded[_0xc3fe('0x45')](_0xc3fe('0xab'),_[_0xc3fe('0x31')](_0x15f1f5,'id'));return db['sequelize'][_0xc3fe('0x3b')](_0x97dded[_0xc3fe('0x96')](),_0xa15ef2)[_0xc3fe('0x35')](function(_0x2da6a2){var _0x1f03e7=_[_0xc3fe('0xac')](_0x2da6a2,'WhatsappInteractionId');var _0x408569=[];_0x15f1f5['forEach'](function(_0x535b2d){_0x408569['push'](updateWhatsappInteraction(_0x535b2d,_0x47551b,_0x1f03e7));});return BPromise[_0xc3fe('0xad')](_0x408569);});});})[_0xc3fe('0x35')](function(_0x4fef1c){_0x4e694d[_0xc3fe('0xae')]=_0x4fef1c;return _0x4e694d;})[_0xc3fe('0x35')](respondWithFilteredResult(_0x299b61,_0x484e59))['catch'](handleError(_0x299b61,null));};exports[_0xc3fe('0xaf')]=function(_0x18824b,_0x27612b){var _0x25d04e={'raw':![],'where':{'id':_0x18824b[_0xc3fe('0xb0')]['id']}},_0x19d290={};_0x19d290[_0xc3fe('0x3a')]=_['keys'](db['WhatsappInteraction'][_0xc3fe('0x38')]);_0x19d290['query']=_[_0xc3fe('0x3c')](_0x18824b[_0xc3fe('0x3b')]);_0x19d290[_0xc3fe('0x3d')]=_[_0xc3fe('0x3e')](_0x19d290[_0xc3fe('0x3a')],_0x19d290['query']);_0x25d04e[_0xc3fe('0x3f')]=_[_0xc3fe('0x3e')](_0x19d290[_0xc3fe('0x3a')],qs[_0xc3fe('0x40')](_0x18824b[_0xc3fe('0x3b')][_0xc3fe('0x40')]));_0x25d04e['attributes']=_0x25d04e[_0xc3fe('0x3f')][_0xc3fe('0x41')]?_0x25d04e[_0xc3fe('0x3f')]:_0x19d290[_0xc3fe('0x3a')];if(_0x18824b[_0xc3fe('0x3b')][_0xc3fe('0xb1')]){_0x25d04e[_0xc3fe('0xb2')]=[{'all':!![]}];}_0x25d04e=_[_0xc3fe('0xb3')]({},_0x25d04e,_0x18824b[_0xc3fe('0xb4')]);return db[_0xc3fe('0x99')]['find'](_0x25d04e)['then'](handleEntityNotFound(_0x27612b,null))[_0xc3fe('0x35')](respondWithResult(_0x27612b,null))[_0xc3fe('0x36')](handleError(_0x27612b,null));};exports[_0xc3fe('0xb5')]=function(_0x337cf5,_0xa5f641){return db['WhatsappInteraction'][_0xc3fe('0xb5')](_0x337cf5[_0xc3fe('0xb6')],{})[_0xc3fe('0x35')](respondWithResult(_0xa5f641,0xc9))[_0xc3fe('0x36')](handleError(_0xa5f641,null));};exports[_0xc3fe('0x2a')]=function(_0x4cf865,_0x9c1439){if(_0x4cf865[_0xc3fe('0xb6')]['id']){delete _0x4cf865['body']['id'];}return db['WhatsappInteraction'][_0xc3fe('0x5e')]({'where':{'id':_0x4cf865[_0xc3fe('0xb0')]['id']}})['then'](handleEntityNotFound(_0x9c1439,null))[_0xc3fe('0x35')](saveUpdates(_0x4cf865[_0xc3fe('0xb6')],null))[_0xc3fe('0x35')](respondWithResult(_0x9c1439,null))[_0xc3fe('0x36')](handleError(_0x9c1439,null));};exports[_0xc3fe('0x2b')]=function(_0x216902,_0x2d58e7){return db[_0xc3fe('0x99')][_0xc3fe('0x5e')]({'where':{'id':_0x216902[_0xc3fe('0xb0')]['id']}})['then'](handleEntityNotFound(_0x2d58e7,null))['then'](removeEntity(_0x2d58e7,null))['catch'](handleError(_0x2d58e7,null));};exports['describe']=function(_0x2406e1,_0x88905f){return db[_0xc3fe('0x99')][_0xc3fe('0xb7')]()[_0xc3fe('0x35')](respondWithResult(_0x88905f,null))['catch'](handleError(_0x88905f,null));};exports[_0xc3fe('0xb8')]=function(_0x12c82c,_0x56f819,_0x2baff1){return db[_0xc3fe('0xb9')][_0xc3fe('0x5e')]({'where':{'id':_0x12c82c[_0xc3fe('0xb0')]['id']}})[_0xc3fe('0x35')](handleEntityNotFound(_0x56f819,null))[_0xc3fe('0x35')](function(_0x11a393){if(_0x11a393){return _0x11a393['addMessage'](_0x12c82c[_0xc3fe('0xb6')]['ids'],_[_0xc3fe('0xba')](_0x12c82c['body'],[_0xc3fe('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x56f819,null))[_0xc3fe('0x36')](handleError(_0x56f819,null));};exports[_0xc3fe('0xbc')]=function(_0x7d7f75,_0x419ce4,_0x823934){var _0x174553={'raw':![],'where':{}};var _0x598f4a={};var _0x5e88ba={'count':0x0,'rows':[]};return db[_0xc3fe('0x99')][_0xc3fe('0xbd')]({'where':{'id':_0x7d7f75[_0xc3fe('0xb0')]['id']}})[_0xc3fe('0x35')](handleEntityNotFound(_0x419ce4,null))[_0xc3fe('0x35')](function(_0x4130d4){if(_0x4130d4){_0x598f4a[_0xc3fe('0x3a')]=_['keys'](db[_0xc3fe('0xb9')][_0xc3fe('0x38')]);_0x598f4a[_0xc3fe('0x3b')]=_['keys'](_0x7d7f75['query']);_0x598f4a[_0xc3fe('0x3d')]=_['intersection'](_0x598f4a[_0xc3fe('0x3a')],_0x598f4a[_0xc3fe('0x3b')]);_0x174553[_0xc3fe('0x3f')]=_[_0xc3fe('0x3e')](_0x598f4a[_0xc3fe('0x3a')],qs[_0xc3fe('0x40')](_0x7d7f75['query'][_0xc3fe('0x40')]));_0x174553[_0xc3fe('0x3f')]=_0x174553[_0xc3fe('0x3f')][_0xc3fe('0x41')]?_0x174553['attributes']:_0x598f4a['model'];if(!_0x7d7f75[_0xc3fe('0x3b')][_0xc3fe('0xbe')](_0xc3fe('0x42'))){_0x174553[_0xc3fe('0x25')]=qs[_0xc3fe('0x25')](_0x7d7f75[_0xc3fe('0x3b')]['limit']);_0x174553['offset']=qs[_0xc3fe('0x22')](_0x7d7f75['query'][_0xc3fe('0x22')]);}_0x174553[_0xc3fe('0x43')]=qs[_0xc3fe('0x44')](_0x7d7f75[_0xc3fe('0x3b')][_0xc3fe('0x44')]);_0x174553['where']=qs[_0xc3fe('0x3d')](_[_0xc3fe('0xbf')](_0x7d7f75[_0xc3fe('0x3b')],_0x598f4a[_0xc3fe('0x3d')]));_0x174553[_0xc3fe('0x45')][_0xc3fe('0xc0')]=_0x4130d4['id'];if(_0x7d7f75['query'][_0xc3fe('0xc1')]){_0x174553[_0xc3fe('0x45')]=_[_0xc3fe('0xb3')](_0x174553[_0xc3fe('0x45')],{'$or':_[_0xc3fe('0x31')](_0x174553[_0xc3fe('0x3f')],function(_0x3329a6){var _0x58b145={};_0x58b145[_0x3329a6]={'$like':'%'+_0x7d7f75[_0xc3fe('0x3b')][_0xc3fe('0xc1')]+'%'};return _0x58b145;})});}if(_0x7d7f75['query']['$gte']){var _0x493784=_0x7d7f75['query'][_0xc3fe('0xc2')][_0xc3fe('0x66')](',');var _0x361e01={};_0x361e01[_0x493784[0x0]]={'$gte':moment(_0x493784[0x1])[_0xc3fe('0xc3')](_0xc3fe('0xc4'))};_0x174553[_0xc3fe('0x45')]=_['merge'](_0x174553[_0xc3fe('0x45')],_0x361e01);}_0x174553=_[_0xc3fe('0xb3')]({},_0x174553,_0x7d7f75[_0xc3fe('0xb4')]);return db[_0xc3fe('0xb9')][_0xc3fe('0x24')]({'where':_0x174553['where']})[_0xc3fe('0x35')](function(_0x498b06){_0x5e88ba['count']=_0x498b06;if(_0x7d7f75[_0xc3fe('0x3b')]['includeAll']){_0x174553['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x174553);})[_0xc3fe('0x35')](function(_0xa4d534){_0x5e88ba[_0xc3fe('0xae')]=_0xa4d534;return _0x5e88ba;});}})[_0xc3fe('0x35')](respondWithFilteredResult(_0x419ce4,_0x174553))['catch'](handleError(_0x419ce4,null));};exports[_0xc3fe('0xc5')]=function(_0x444373,_0x49de72,_0x108ef3){return db[_0xc3fe('0x99')][_0xc3fe('0x5e')]({'where':{'id':_0x444373[_0xc3fe('0xb0')]['id']}})[_0xc3fe('0x35')](handleEntityNotFound(_0x49de72,null))[_0xc3fe('0x35')](function(_0x1057ca){if(_0x1057ca){return _0x1057ca[_0xc3fe('0xc6')](_0x444373[_0xc3fe('0xb6')][_0xc3fe('0xbb')],_['omit'](_0x444373[_0xc3fe('0xb6')],['ids','id'])||{})['spread'](function(){return db[_0xc3fe('0x6d')]['findAll']({'attributes':['id',_0xc3fe('0x2e'),_0xc3fe('0xc7')],'where':{'id':_0x444373[_0xc3fe('0xb6')][_0xc3fe('0xbb')]}});})['then'](function(_0x5b9c81){socket[_0xc3fe('0xc8')](_0xc3fe('0xc9'),{'id':Number(_0x444373[_0xc3fe('0xb0')]['id']),'tags':_0x5b9c81||[]});return{'id':Number(_0x444373[_0xc3fe('0xb0')]['id']),'tags':_0x5b9c81||[]};});}})[_0xc3fe('0x35')](respondWithResult(_0x49de72,null))['catch'](handleError(_0x49de72,null));};exports[_0xc3fe('0xca')]=function(_0x29a1a3,_0x47762c,_0x307444){return db[_0xc3fe('0x99')][_0xc3fe('0x5e')]({'where':{'id':_0x29a1a3[_0xc3fe('0xb0')]['id']}})[_0xc3fe('0x35')](handleEntityNotFound(_0x47762c,null))[_0xc3fe('0x35')](function(_0x22a19c){if(_0x22a19c){return _0x22a19c[_0xc3fe('0xca')](_0x29a1a3['query'][_0xc3fe('0xbb')]);}})[_0xc3fe('0x35')](respondWithStatusCode(_0x47762c,null))[_0xc3fe('0x36')](handleError(_0x47762c,null));};exports['download']=function(_0x3cee59,_0x1a937a){var _0x568316=moment()['unix']()['toString']();var _0x58833d=path[_0xc3fe('0xcb')](config['root'],_0xc3fe('0xcc'),'files',_0xc3fe('0xcd'));var _0x5dd377=path['join'](config[_0xc3fe('0xce')],_0xc3fe('0xcc'),_0xc3fe('0xcf'),_0xc3fe('0xd0'));var _0x2652ac=path['join'](_0x58833d,_0x568316);var _0x30893e=util[_0xc3fe('0xc3')](_0xc3fe('0xd1'),_0x3cee59[_0xc3fe('0xb0')]['id'],_0x568316);var _0x34ab0e=path['join'](_0x58833d,_0x30893e);var _0x36a92b=[];_0x36a92b['push']({'model':db[_0xc3fe('0x71')],'as':'User','attributes':['id',_0xc3fe('0x32')],'raw':!![]});_0x36a92b[_0xc3fe('0xd2')]({'model':db[_0xc3fe('0xd3')],'as':'Contact','attributes':['id',_0xc3fe('0xd4'),_0xc3fe('0xd5')],'raw':!![]});if(_0x3cee59[_0xc3fe('0x3b')][_0xc3fe('0xd0')]){_0x36a92b[_0xc3fe('0xd2')]({'model':db[_0xc3fe('0xd6')],'as':_0xc3fe('0xd6'),'raw':!![]});}var _0x2bdf99=[{'model':db[_0xc3fe('0xb9')],'as':_0xc3fe('0xd7'),'attributes':['id',_0xc3fe('0xb6'),_0xc3fe('0xd8'),_0xc3fe('0xd9'),_0xc3fe('0xda'),_0xc3fe('0x7f')],'include':_0x36a92b}];_0x2bdf99[_0xc3fe('0xd2')]({'model':db[_0xc3fe('0xdb')],'as':'Account','attributes':['id','name']});_0x2bdf99[_0xc3fe('0xd2')]({'model':db[_0xc3fe('0x71')],'as':_0xc3fe('0xdc'),'attributes':['id',_0xc3fe('0x32')]});return db[_0xc3fe('0x99')][_0xc3fe('0x5e')]({'where':{'id':_0x3cee59['params']['id']},'include':_0x2bdf99})[_0xc3fe('0x35')](handleEntityNotFound(_0x1a937a,null))[_0xc3fe('0x35')](function(_0x4ee511){if(_0x4ee511){var _0x14aada=_0x4ee511[_0xc3fe('0xdd')]({'plain':!![]});fs[_0xc3fe('0xde')](_0x2652ac);var _0x38febe={'channel':_0xc3fe('0xdf'),'account':_0x14aada[_0xc3fe('0xe0')]['name'],'agent':_0x14aada['Owner']?_0x14aada[_0xc3fe('0xdc')][_0xc3fe('0x32')]:_0xc3fe('0xe1'),'createdAt':moment(_0x14aada[_0xc3fe('0xd8')])['format'](_0xc3fe('0xc4'))[_0xc3fe('0x96')](),'closedAt':_0x14aada[_0xc3fe('0xe2')]?moment(_0x14aada[_0xc3fe('0xe3')])[_0xc3fe('0xc3')](_0xc3fe('0xc4'))[_0xc3fe('0x96')]():'','disposition':_0x14aada[_0xc3fe('0xe4')],'messages':_(_0x14aada[_0xc3fe('0xd7')])[_0xc3fe('0xc1')]({'secret':![]})[_0xc3fe('0x31')](function(_0x3d4a3e){if(_0x3d4a3e[_0xc3fe('0xd6')]){var _0x18a52c=path['join'](_0x5dd377,_0x3d4a3e[_0xc3fe('0xd6')][_0xc3fe('0xe5')]);if(fs[_0xc3fe('0xe6')](_0x18a52c)){fs[_0xc3fe('0xe7')](_0x18a52c)['pipe'](fs['createWriteStream'](path[_0xc3fe('0xcb')](_0x2652ac,_0x3d4a3e[_0xc3fe('0xd6')][_0xc3fe('0xe5')])));}}return{'date':moment(_0x3d4a3e[_0xc3fe('0xd8')])[_0xc3fe('0xc3')](_0xc3fe('0xc4'))[_0xc3fe('0x96')](),'sender':_0x3d4a3e[_0xc3fe('0xd9')]==='out'?_0x3d4a3e[_0xc3fe('0x71')]?_0x3d4a3e[_0xc3fe('0x71')][_0xc3fe('0x32')]:_0xc3fe('0xe8'):_0x3d4a3e[_0xc3fe('0x63')][_0xc3fe('0xd4')]+(_0x3d4a3e[_0xc3fe('0x63')]['lastName']?'\x20'+_0x3d4a3e[_0xc3fe('0x63')][_0xc3fe('0xd5')]:''),'body':_0x3d4a3e[_0xc3fe('0xd6')]?_0x3d4a3e[_0xc3fe('0xd6')][_0xc3fe('0xe5')]:_0x3d4a3e[_0xc3fe('0xb6')],'direction':_0x3d4a3e[_0xc3fe('0xd9')]===_0xc3fe('0xe9')?'A':'C','secret':_0x3d4a3e[_0xc3fe('0xda')],'read':_0x3d4a3e[_0xc3fe('0x7f')],'attachment':_0x3d4a3e['Attachment']};})['value']()};return ejs[_0xc3fe('0xea')](path['join'](config[_0xc3fe('0xce')],_0xc3fe('0xcc'),_0xc3fe('0xeb'),'downloadInteraction.ejs'),{'interaction':_0x38febe})[_0xc3fe('0x35')](function(_0xab2b0e){var _0x45514f=path[_0xc3fe('0xcb')](_0x2652ac,'transcript-'+_0x14aada['id']+'-'+_0x568316+_0xc3fe('0xec'));var _0x2d530e={'path':_0x45514f,'channel':_0xc3fe('0xdf'),'interactionId':_0x14aada['id']};return pdf['createPdfFromHTML'](_0xab2b0e,_0x2d530e);})[_0xc3fe('0x35')](function(){return new BPromise(function(_0x5942cf,_0x132b43){zipdir(_0x2652ac,{'saveTo':_0x34ab0e},function(_0x3266b,_0x41e71b){if(_0x3266b)return _0x132b43(_0x3266b);return _0x5942cf(_0x41e71b);});})[_0xc3fe('0x35')](function(){return new BPromise(function(_0x689fba,_0x5f4791){rimraf(_0x2652ac,function(_0x41d513){if(_0x41d513)_0x5f4791(_0x41d513);return _0x689fba();});});})['then'](function(){return _0x1a937a[_0xc3fe('0xed')](_0x34ab0e,_0x30893e,function(_0x12223c){if(_0x12223c){console['log'](_0xc3fe('0xee'),_0x12223c);}else{fs[_0xc3fe('0xef')](_0x34ab0e);}});});});}else{return _0x1a937a[_0xc3fe('0x1e')](0xc8);}})[_0xc3fe('0x36')](handleError(_0x1a937a,null));}; \ No newline at end of file +var _0xb07f=['server','fullname','firstName','attachments','Attachment','Messages','createdAt','direction','WhatsappAccount','Owner','get','Account','N.A.','closed','closedAt','disposition','basename','createReadStream','System','lastName','secret','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','reject','update','then','error','name','send','Users','TagIds','Tags','push','index','fieldName','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','select','field','color','from','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','type','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','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','QueryTypes','SELECT','clone','contactName','isEmpty','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','user','role','toString','sequelize','keyBy','merge','WhatsappInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','includeAll','include','options','catch','create','describe','addMessage','ids','omit','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','setTags','spread','emit','whatsappInteractionTags:save','removeTags','files','tmp','join','root'];(function(_0x1255f0,_0x4836ec){var _0x2facbe=function(_0x106bdd){while(--_0x106bdd){_0x1255f0['push'](_0x1255f0['shift']());}};_0x2facbe(++_0x4836ec);}(_0xb07f,0x109));var _0xfb07=function(_0x569245,_0x1c56bd){_0x569245=_0x569245-0x0;var _0x1d6508=_0xb07f[_0x569245];return _0x1d6508;};'use strict';var emlformat=require(_0xfb07('0x0'));var rimraf=require(_0xfb07('0x1'));var zipdir=require(_0xfb07('0x2'));var jsonpatch=require(_0xfb07('0x3'));var rp=require(_0xfb07('0x4'));var moment=require(_0xfb07('0x5'));var BPromise=require(_0xfb07('0x6'));var Mustache=require(_0xfb07('0x7'));var util=require(_0xfb07('0x8'));var path=require(_0xfb07('0x9'));var sox=require(_0xfb07('0xa'));var csv=require('to-csv');var ejs=require(_0xfb07('0xb'));var fs=require('fs');var fs_extra=require(_0xfb07('0xc'));var _=require(_0xfb07('0xd'));var squel=require(_0xfb07('0xe'));var crypto=require(_0xfb07('0xf'));var jsforce=require(_0xfb07('0x10'));var deskjs=require(_0xfb07('0x11'));var toCsv=require(_0xfb07('0x12'));var querystring=require(_0xfb07('0x13'));var Papa=require(_0xfb07('0x14'));var Redis=require(_0xfb07('0x15'));var authService=require(_0xfb07('0x16'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xfb07('0x17'));var logger=require(_0xfb07('0x18'))('api');var utils=require(_0xfb07('0x19'));var config=require(_0xfb07('0x1a'));var licenseUtil=require(_0xfb07('0x1b'));var db=require(_0xfb07('0x1c'))['db'];config[_0xfb07('0x1d')]=_[_0xfb07('0x1e')](config[_0xfb07('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb07('0x1f'))(new Redis(config[_0xfb07('0x1d')]));require(_0xfb07('0x20'))[_0xfb07('0x21')](socket);function respondWithStatusCode(_0x2423f2,_0x3c283d){_0x3c283d=_0x3c283d||0xcc;return function(_0x29cbae){if(_0x29cbae){return _0x2423f2[_0xfb07('0x22')](_0x3c283d);}return _0x2423f2[_0xfb07('0x23')](_0x3c283d)[_0xfb07('0x24')]();};}function respondWithResult(_0x3dde76,_0x1cfc43){_0x1cfc43=_0x1cfc43||0xc8;return function(_0x1e42c4){if(_0x1e42c4){return _0x3dde76[_0xfb07('0x23')](_0x1cfc43)['json'](_0x1e42c4);}};}function respondWithFilteredResult(_0x57fc39,_0x3e747e){return function(_0x44b9c4){if(_0x44b9c4){var _0x197f12=typeof _0x3e747e['offset']===_0xfb07('0x25')&&typeof _0x3e747e[_0xfb07('0x26')]==='undefined';var _0x4fc244=_0x44b9c4[_0xfb07('0x27')];var _0x4b5708=_0x197f12?0x0:_0x3e747e[_0xfb07('0x28')];var _0x2c6c44=_0x197f12?_0x44b9c4[_0xfb07('0x27')]:_0x3e747e[_0xfb07('0x28')]+_0x3e747e[_0xfb07('0x26')];var _0x23c2be;if(_0x2c6c44>=_0x4fc244){_0x2c6c44=_0x4fc244;_0x23c2be=0xc8;}else{_0x23c2be=0xce;}_0x57fc39[_0xfb07('0x23')](_0x23c2be);return _0x57fc39['set'](_0xfb07('0x29'),_0x4b5708+'-'+_0x2c6c44+'/'+_0x4fc244)['json'](_0x44b9c4);}return null;};}function patchUpdates(_0x22ed97){return function(_0x14c771){try{jsonpatch[_0xfb07('0x2a')](_0x14c771,_0x22ed97,!![]);}catch(_0x301c1a){return BPromise[_0xfb07('0x2b')](_0x301c1a);}return _0x14c771['save']();};}function saveUpdates(_0x295989,_0x451cd8){return function(_0x10835a){if(_0x10835a){return _0x10835a[_0xfb07('0x2c')](_0x295989)[_0xfb07('0x2d')](function(_0x2eb3e6){return _0x2eb3e6;});}return null;};}function removeEntity(_0x531346,_0x36d6f3){return function(_0x28f33a){if(_0x28f33a){return _0x28f33a['destroy']()[_0xfb07('0x2d')](function(){_0x531346[_0xfb07('0x23')](0xcc)[_0xfb07('0x24')]();});}};}function handleEntityNotFound(_0x149ac0,_0x46927a){return function(_0x2b0650){if(!_0x2b0650){_0x149ac0[_0xfb07('0x22')](0x194);}return _0x2b0650;};}function handleError(_0x24ff99,_0x95f1d){_0x95f1d=_0x95f1d||0x1f4;return function(_0x27668f){logger[_0xfb07('0x2e')](_0x27668f['stack']);if(_0x27668f[_0xfb07('0x2f')]){delete _0x27668f[_0xfb07('0x2f')];}_0x24ff99[_0xfb07('0x23')](_0x95f1d)[_0xfb07('0x30')](_0x27668f);};}function getInteractionUsers(_0x5dd4c9,_0x46d57e){return new BPromise(function(_0xd5290c,_0x4ce9a4){try{if(_0x46d57e[_0x5dd4c9['id']]){_0x5dd4c9[_0xfb07('0x31')]=_['map'](_0x46d57e[_0x5dd4c9['id']],function(_0x328d2e){return{'id':_0x328d2e['id'],'fullname':_0x328d2e['fullname']};});}}catch(_0x56b48c){_0x4ce9a4(_0x56b48c);}_0xd5290c(_0x5dd4c9);});}function getInteractionTags(_0x4a8d4c,_0xf33bd0){return new BPromise(function(_0x3a6e9a,_0x38943c){try{if(_0x4a8d4c[_0xfb07('0x32')]){_0x4a8d4c[_0xfb07('0x33')]=[];_0x4a8d4c[_0xfb07('0x32')]['split'](',')['forEach'](function(_0xc1a4b0){_0x4a8d4c[_0xfb07('0x33')][_0xfb07('0x34')](_0xf33bd0[_0xc1a4b0]);});}delete _0x4a8d4c[_0xfb07('0x32')];}catch(_0x5e28cd){_0x38943c(_0x5e28cd);}_0x3a6e9a(_0x4a8d4c);});}function updateWhatsappInteraction(_0x5e721f,_0x22ef8c,_0x3e0d11){return new BPromise(function(_0x4757f2,_0x1162ec){return getInteractionUsers(_0x5e721f,_0x3e0d11)[_0xfb07('0x2d')](function(_0x32c031){return getInteractionTags(_0x32c031,_0x22ef8c);})['then'](function(_0x4b285d){_0x4757f2(_0x4b285d);})['catch'](function(_0x26a2d1){_0x1162ec(_0x26a2d1);});});}exports[_0xfb07('0x35')]=function(_0x1bad87,_0xc58e65){var _0x5cb29d={},_0x4958b7={},_0x9b59fc={'count':0x0,'rows':[]};var _0x1d0132=_['map'](db['WhatsappInteraction']['rawAttributes'],function(_0x23e510){return{'name':_0x23e510[_0xfb07('0x36')],'type':_0x23e510['type']['key']};});_0x4958b7[_0xfb07('0x37')]=_[_0xfb07('0x38')](_0x1d0132,_0xfb07('0x2f'));_0x4958b7[_0xfb07('0x39')]=_[_0xfb07('0x3a')](_0x1bad87['query']);_0x4958b7[_0xfb07('0x3b')]=_[_0xfb07('0x3c')](_0x4958b7[_0xfb07('0x37')],_0x4958b7[_0xfb07('0x39')]);_0x5cb29d['attributes']=_['intersection'](_0x4958b7[_0xfb07('0x37')],qs[_0xfb07('0x3d')](_0x1bad87[_0xfb07('0x39')][_0xfb07('0x3d')]));_0x5cb29d[_0xfb07('0x3e')]=_0x5cb29d[_0xfb07('0x3e')][_0xfb07('0x3f')]?_0x5cb29d['attributes']:_0x4958b7['model'];if(!_0x1bad87[_0xfb07('0x39')][_0xfb07('0x40')]('nolimit')){_0x5cb29d['limit']=qs[_0xfb07('0x26')](_0x1bad87[_0xfb07('0x39')][_0xfb07('0x26')]);_0x5cb29d['offset']=qs['offset'](_0x1bad87[_0xfb07('0x39')][_0xfb07('0x28')]);}_0x5cb29d[_0xfb07('0x41')]=qs[_0xfb07('0x42')](_0x1bad87[_0xfb07('0x39')][_0xfb07('0x42')]);_0x5cb29d[_0xfb07('0x43')]=qs[_0xfb07('0x3b')](_[_0xfb07('0x44')](_0x1bad87['query'],_0x4958b7[_0xfb07('0x3b')]),_0x1d0132);var _0x12c588=[];var _0x3d6372=squel[_0xfb07('0x45')]()[_0xfb07('0x46')]('id')[_0xfb07('0x46')](_0xfb07('0x2f'))[_0xfb07('0x46')](_0xfb07('0x47'))[_0xfb07('0x48')]('tools_tags');var _0x5c0ed7=squel[_0xfb07('0x45')]()[_0xfb07('0x46')]('u.id')[_0xfb07('0x46')](_0xfb07('0x49'))[_0xfb07('0x46')](_0xfb07('0x4a'))[_0xfb07('0x48')]('user_has_whatsapp_interactions','ui')['left_join'](_0xfb07('0x4b'),'u',_0xfb07('0x4c'));var _0x38354c=squel[_0xfb07('0x45')]()[_0xfb07('0x48')](_0xfb07('0x4d'),'i')[_0xfb07('0x4e')](_0xfb07('0x4f'),'c',_0xfb07('0x50'))[_0xfb07('0x4e')]('users','o','o.id\x20=\x20i.UserId')['left_join'](_0xfb07('0x51'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xfb07('0x4e')](_0xfb07('0x52'),'me',_0xfb07('0x53'))[_0xfb07('0x4e')](_0xfb07('0x54'),'it',_0xfb07('0x55'))['left_join'](_0xfb07('0x56'),'t',_0xfb07('0x57'));var _0x2d4a4d=squel[_0xfb07('0x58')]();var _0x36d2b1=[];var _0x589f50=squel[_0xfb07('0x58')]();var _0x3b85f7;if(_0x1bad87[_0xfb07('0x39')][_0xfb07('0x59')]){_0x3b85f7=as[_0xfb07('0x5a')](_0x1bad87['query'][_0xfb07('0x59')]);var _0x42ea0b=_0x3b85f7[_0xfb07('0x5b')];for(var _0x3b84a0=0x0;_0x3b84a0<_0x3b85f7[_0xfb07('0x5c')]['length'];_0x3b84a0++){var _0x210875=_0x3b85f7[_0xfb07('0x5c')][_0x3b84a0];var _0x26a7b7='i';var _0x16bd36=_['find'](_0x1d0132,[_0xfb07('0x2f'),_0x210875[_0xfb07('0x46')]]);if(!_0x16bd36){switch(_0x210875[_0xfb07('0x46')]){case _0xfb07('0x5d'):if(_0x210875[_0xfb07('0x5e')]==0x1){_0x38354c[_0xfb07('0x5f')]('`'+_0x210875[_0xfb07('0x46')]+_0xfb07('0x60'));}else{_0x38354c[_0xfb07('0x5f')]('`'+_0x210875[_0xfb07('0x46')]+'`\x20>\x200');}break;case _0xfb07('0x61'):if(_0x210875['operator']===_0xfb07('0x62')){if(_0x210875[_0xfb07('0x5e')][_0xfb07('0x63')]('\x20')[_0xfb07('0x3f')]>0x1){_0x2d4a4d[_0x42ea0b](_0xfb07('0x64'),qs[_0xfb07('0x65')](_0x210875[_0xfb07('0x5e')]),null);}else{var _0x4cc860='%'+_0x210875['value']+'%';_0x2d4a4d[_0x42ea0b]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4cc860,_0x4cc860,_0x4cc860);}}else{_0x16bd36=_[_0xfb07('0x66')](_0x1d0132,[_0xfb07('0x2f'),_0xfb07('0x67')]);_0x210875['field']=_0xfb07('0x67');_0x45a88f=as['buildExpression'](_0x26a7b7,_0x16bd36[_0xfb07('0x68')],_0x210875);_0x2d4a4d[_0x42ea0b](_0x45a88f[_0xfb07('0x69')],_0x45a88f['value'][_0xfb07('0x6a')],_0x45a88f[_0xfb07('0x5e')][_0xfb07('0x24')]);}break;case _0xfb07('0x6b'):var _0x294dc8=_0x210875[_0xfb07('0x5e')][_0xfb07('0x63')](',')[_0xfb07('0x38')](function(_0x2bca9f){return Number(_0x2bca9f);});_0x294dc8[_0xfb07('0x6c')](function(_0x18abd2){_0x589f50['or'](_0xfb07('0x6d'),'%,'+_0x18abd2+',%');});_0x36d2b1=_[_0xfb07('0x6e')](_0x36d2b1,_0x294dc8);break;case _0xfb07('0x6f'):if(_0x210875['operator']===_0xfb07('0x62')){_0x2d4a4d[_0x42ea0b](_0xfb07('0x70'),'%'+_0x210875['value']+'%',null);}else{_0x16bd36=_['find'](_0x1d0132,[_0xfb07('0x2f'),_0xfb07('0x71')]);_0x210875[_0xfb07('0x46')]='UserId';_0x45a88f=as[_0xfb07('0x72')](_0x26a7b7,_0x16bd36['type'],_0x210875);_0x2d4a4d[_0x42ea0b](_0x45a88f['text'],_0x45a88f['value']['start'],_0x45a88f[_0xfb07('0x5e')][_0xfb07('0x24')]);}break;case _0xfb07('0x73'):_0x45a88f=as[_0xfb07('0x72')]('me',null,_0x210875);_0x2d4a4d[_0x42ea0b](_0x45a88f[_0xfb07('0x69')],_0x45a88f[_0xfb07('0x5e')][_0xfb07('0x6a')],_0x45a88f['value'][_0xfb07('0x24')]);break;}}else{var _0x45a88f=as[_0xfb07('0x72')](_0x26a7b7,_0x16bd36[_0xfb07('0x68')],_0x210875);_0x2d4a4d[_0x42ea0b](_0x45a88f[_0xfb07('0x69')],_0x45a88f[_0xfb07('0x5e')][_0xfb07('0x6a')],_0x45a88f[_0xfb07('0x5e')]['end']);}}}else{var _0xa9b810=_(_0x1bad87[_0xfb07('0x39')])[_0xfb07('0x3a')]()[_0xfb07('0x38')](function(_0x2678d2){return _['some'](_0x1d0132,['name',_0x2678d2])?_0x2678d2:undefined;})[_0xfb07('0x74')]()[_0xfb07('0x5e')]();if(!_['isEmpty'](_0xa9b810)){_0xa9b810[_0xfb07('0x6c')](function(_0x311c6d){if(_0x311c6d===_0xfb07('0x75')){_0x38354c[_0xfb07('0x43')](_0xfb07('0x76'),[][_0xfb07('0x77')](_0x1bad87[_0xfb07('0x39')][_0x311c6d]));}else if(_0x311c6d==='createdAt'){var _0x4c1238=JSON[_0xfb07('0x78')](_0x1bad87['query'][_0x311c6d])[_0xfb07('0x79')];var _0x25d543=JSON[_0xfb07('0x78')](_0x1bad87[_0xfb07('0x39')][_0x311c6d])[_0xfb07('0x7a')];_0x38354c[_0xfb07('0x43')](_0xfb07('0x7b'),_0x4c1238,_0x25d543);}else{if(_0x1bad87[_0xfb07('0x39')][_0x311c6d]===_0xfb07('0x7c')){_0x38354c['where']('i.'+_0x311c6d+_0xfb07('0x7d'));}else{_0x38354c[_0xfb07('0x43')]('i.'+_0x311c6d+_0xfb07('0x7e'),_0x1bad87[_0xfb07('0x39')][_0x311c6d]);}}});}if(_0x1bad87[_0xfb07('0x39')]['read']){if(_0x1bad87[_0xfb07('0x39')][_0xfb07('0x7f')]==0x1){_0x38354c[_0xfb07('0x5f')](_0xfb07('0x80'));}else{_0x38354c['having'](_0xfb07('0x81'));}}if(_0x1bad87['query']['tag']){_0x36d2b1=_[_0xfb07('0x82')](_0x1bad87[_0xfb07('0x39')][_0xfb07('0x83')])?_0x1bad87[_0xfb07('0x39')][_0xfb07('0x83')]:new Array(_0x1bad87[_0xfb07('0x39')]['tag']);_0x36d2b1[_0xfb07('0x6c')](function(_0x29849c){_0x589f50['or'](_0xfb07('0x6d'),'%,'+_0x29849c+',%');});}if(_0x1bad87[_0xfb07('0x39')][_0xfb07('0x84')]){var _0x1533d7=_0x1bad87[_0xfb07('0x39')][_0xfb07('0x84')][_0xfb07('0x85')]('\x5c','\x5c\x5c')[_0xfb07('0x85')](/'/g,'\x27\x27');if(qs[_0xfb07('0x86')](_0x1533d7)){_0x2d4a4d['or'](_0xfb07('0x87'),_0x1533d7+'%')['or'](_0xfb07('0x88'),_0x1533d7+'%');}else{_0x2d4a4d['or'](_0xfb07('0x89'),qs[_0xfb07('0x65')](_0x1533d7))['or'](_0xfb07('0x8a'),_0x1533d7+'%');}}}_0x38354c['where'](_0x2d4a4d);_0x38354c[_0xfb07('0x8b')](_0xfb07('0x8c'));var _0x3d5466={'type':db[_0xfb07('0x8d')][_0xfb07('0x8e')][_0xfb07('0x8f')],'raw':!![]};var _0x1ecadf=_0x38354c[_0xfb07('0x90')]();_0x1ecadf[_0xfb07('0x46')](_0xfb07('0x8c'));_0x1ecadf[_0xfb07('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5cb29d[_0xfb07('0x41')]){_0x5cb29d[_0xfb07('0x41')][_0xfb07('0x6c')](function(_0x55ed70){var _0x18a22c=_0x55ed70[0x0]===_0xfb07('0x91')?_0x55ed70[0x0]:'i.'+_0x55ed70[0x0];_0x38354c[_0xfb07('0x41')](_0x18a22c,_0x55ed70[0x1]==='DESC'?![]:!![]);});}if(!_[_0xfb07('0x92')](_0x36d2b1)){_0x38354c[_0xfb07('0x5f')](_0x589f50);_0x1ecadf[_0xfb07('0x43')](_0xfb07('0x93'),_0x36d2b1);}BPromise['resolve']()[_0xfb07('0x2d')](function(){if(!_0x3b85f7){if(_0x1bad87[_0xfb07('0x39')][_0xfb07('0x75')])return;_0x1ecadf[_0xfb07('0x43')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x38354c[_0xfb07('0x43')](_0xfb07('0x94'));return;}if(_0x1bad87['user']['role']!==_0xfb07('0x95'))return;return _0x1bad87[_0xfb07('0x96')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x2d732d){if(_[_0xfb07('0x92')](_0x2d732d)){_0x1ecadf[_0xfb07('0x43')]('i.WhatsappAccountId\x20IS\x20NULL');_0x38354c[_0xfb07('0x43')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x1ecadf[_0xfb07('0x43')](_0xfb07('0x76'),_[_0xfb07('0x38')](_0x2d732d,'id'));_0x38354c[_0xfb07('0x43')](_0xfb07('0x76'),_[_0xfb07('0x38')](_0x2d732d,'id'));}});})['then'](function(){if(_0x1bad87['user'][_0xfb07('0x97')]===_0xfb07('0x95')&&!_0x3b85f7&&!_0x1bad87[_0xfb07('0x39')][_0xfb07('0x75')])return[];return db['sequelize'][_0xfb07('0x39')](_0x1ecadf[_0xfb07('0x98')](),_0x3d5466);})[_0xfb07('0x2d')](function(_0x1a1edf){_0x9b59fc[_0xfb07('0x27')]=_0x1a1edf[_0xfb07('0x3f')];if(_0x9b59fc['count']===0x0)return[];return db[_0xfb07('0x99')][_0xfb07('0x39')](_0x3d6372[_0xfb07('0x98')](),_0x3d5466)[_0xfb07('0x2d')](function(_0x257f9f){_0x12c588=_[_0xfb07('0x9a')](_0x257f9f,'id');_0x3d5466=_[_0xfb07('0x9b')](_0x3d5466,{'model':db[_0xfb07('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1bad87[_0xfb07('0x39')]['fields']){_0x5cb29d[_0xfb07('0x3e')][_0xfb07('0x6c')](function(_0x55665f){_0x38354c['field']('i.'+_0x55665f);});}else{_0x38354c[_0xfb07('0x46')](_0xfb07('0x9d'),'unreadMessages');_0x38354c[_0xfb07('0x46')](_0xfb07('0x9e'),_0xfb07('0x9f'));_0x38354c[_0xfb07('0x46')]('a.mandatoryDisposition',_0xfb07('0xa0'));_0x38354c[_0xfb07('0x46')](_0xfb07('0xa1'),_0xfb07('0x91'));_0x38354c[_0xfb07('0x46')]('i.*');_0x38354c[_0xfb07('0x46')]('c.firstName',_0xfb07('0xa2'));_0x38354c['field'](_0xfb07('0xa3'),_0xfb07('0xa4'));_0x38354c[_0xfb07('0x46')](_0xfb07('0xa5'),_0xfb07('0xa6'));_0x38354c[_0xfb07('0x46')](_0xfb07('0xa7'),_0xfb07('0xa8'));_0x38354c[_0xfb07('0x46')](_0xfb07('0xa9'),_0xfb07('0xaa'));_0x38354c[_0xfb07('0x46')](_0xfb07('0xab'),_0xfb07('0xac'));_0x38354c['field'](_0xfb07('0xad'),'Owner.fullname');_0x38354c[_0xfb07('0x46')](_0xfb07('0xae'),_0xfb07('0xaf'));_0x38354c[_0xfb07('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xfb07('0x32'));}if(_0x5cb29d[_0xfb07('0x26')])_0x38354c[_0xfb07('0x26')](_0x5cb29d[_0xfb07('0x26')]);if(_0x5cb29d['offset'])_0x38354c[_0xfb07('0x28')](_0x5cb29d['offset']);return db[_0xfb07('0x99')][_0xfb07('0x39')](_0x38354c[_0xfb07('0x98')](),_0x3d5466);})[_0xfb07('0x2d')](function(_0x1c0887){if(_0x1c0887[_0xfb07('0x3f')]>0x0)_0x5c0ed7[_0xfb07('0x43')](_0xfb07('0xb0'),_[_0xfb07('0x38')](_0x1c0887,'id'));return db[_0xfb07('0x99')]['query'](_0x5c0ed7[_0xfb07('0x98')](),_0x3d5466)[_0xfb07('0x2d')](function(_0x58adb9){var _0x21c478=_[_0xfb07('0xb1')](_0x58adb9,_0xfb07('0xb2'));var _0x58950e=[];_0x1c0887[_0xfb07('0x6c')](function(_0x4cf024){_0x58950e[_0xfb07('0x34')](updateWhatsappInteraction(_0x4cf024,_0x12c588,_0x21c478));});return BPromise[_0xfb07('0xb3')](_0x58950e);});});})[_0xfb07('0x2d')](function(_0x157c2c){_0x9b59fc[_0xfb07('0xb4')]=_0x157c2c;return _0x9b59fc;})[_0xfb07('0x2d')](respondWithFilteredResult(_0xc58e65,_0x5cb29d))['catch'](handleError(_0xc58e65,null));};exports[_0xfb07('0xb5')]=function(_0x805700,_0x4fdd58){var _0x1df2dd={'raw':![],'where':{'id':_0x805700[_0xfb07('0xb6')]['id']}},_0x1ca814={};_0x1ca814[_0xfb07('0x37')]=_[_0xfb07('0x3a')](db[_0xfb07('0x9c')]['rawAttributes']);_0x1ca814[_0xfb07('0x39')]=_[_0xfb07('0x3a')](_0x805700['query']);_0x1ca814[_0xfb07('0x3b')]=_[_0xfb07('0x3c')](_0x1ca814[_0xfb07('0x37')],_0x1ca814[_0xfb07('0x39')]);_0x1df2dd[_0xfb07('0x3e')]=_[_0xfb07('0x3c')](_0x1ca814[_0xfb07('0x37')],qs[_0xfb07('0x3d')](_0x805700[_0xfb07('0x39')][_0xfb07('0x3d')]));_0x1df2dd[_0xfb07('0x3e')]=_0x1df2dd[_0xfb07('0x3e')][_0xfb07('0x3f')]?_0x1df2dd[_0xfb07('0x3e')]:_0x1ca814[_0xfb07('0x37')];if(_0x805700[_0xfb07('0x39')][_0xfb07('0xb7')]){_0x1df2dd[_0xfb07('0xb8')]=[{'all':!![]}];}_0x1df2dd=_[_0xfb07('0x9b')]({},_0x1df2dd,_0x805700[_0xfb07('0xb9')]);return db[_0xfb07('0x9c')][_0xfb07('0x66')](_0x1df2dd)[_0xfb07('0x2d')](handleEntityNotFound(_0x4fdd58,null))[_0xfb07('0x2d')](respondWithResult(_0x4fdd58,null))[_0xfb07('0xba')](handleError(_0x4fdd58,null));};exports[_0xfb07('0xbb')]=function(_0x553c97,_0x3f501e){return db[_0xfb07('0x9c')][_0xfb07('0xbb')](_0x553c97[_0xfb07('0x73')],{})[_0xfb07('0x2d')](respondWithResult(_0x3f501e,0xc9))['catch'](handleError(_0x3f501e,null));};exports[_0xfb07('0x2c')]=function(_0x9f79da,_0xec7d03){if(_0x9f79da[_0xfb07('0x73')]['id']){delete _0x9f79da[_0xfb07('0x73')]['id'];}return db[_0xfb07('0x9c')][_0xfb07('0x66')]({'where':{'id':_0x9f79da[_0xfb07('0xb6')]['id']}})[_0xfb07('0x2d')](handleEntityNotFound(_0xec7d03,null))[_0xfb07('0x2d')](saveUpdates(_0x9f79da[_0xfb07('0x73')],null))[_0xfb07('0x2d')](respondWithResult(_0xec7d03,null))[_0xfb07('0xba')](handleError(_0xec7d03,null));};exports['destroy']=function(_0x3e326c,_0x19bdd3){return db[_0xfb07('0x9c')][_0xfb07('0x66')]({'where':{'id':_0x3e326c[_0xfb07('0xb6')]['id']}})[_0xfb07('0x2d')](handleEntityNotFound(_0x19bdd3,null))[_0xfb07('0x2d')](removeEntity(_0x19bdd3,null))[_0xfb07('0xba')](handleError(_0x19bdd3,null));};exports[_0xfb07('0xbc')]=function(_0x5b0103,_0x4f81b7){return db[_0xfb07('0x9c')][_0xfb07('0xbc')]()[_0xfb07('0x2d')](respondWithResult(_0x4f81b7,null))['catch'](handleError(_0x4f81b7,null));};exports['addMessage']=function(_0x136020,_0x4963f6,_0x34bf02){return db['WhatsappMessage'][_0xfb07('0x66')]({'where':{'id':_0x136020['params']['id']}})['then'](handleEntityNotFound(_0x4963f6,null))[_0xfb07('0x2d')](function(_0xc94dc8){if(_0xc94dc8){return _0xc94dc8[_0xfb07('0xbd')](_0x136020[_0xfb07('0x73')][_0xfb07('0xbe')],_[_0xfb07('0xbf')](_0x136020[_0xfb07('0x73')],[_0xfb07('0xbe'),'id'])||{});}})[_0xfb07('0x2d')](respondWithResult(_0x4963f6,null))[_0xfb07('0xba')](handleError(_0x4963f6,null));};exports['getMessages']=function(_0x16e71e,_0x2c3793,_0x466479){var _0x4b1645={'raw':![],'where':{}};var _0x175718={};var _0x18bb08={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xfb07('0xc0')]({'where':{'id':_0x16e71e[_0xfb07('0xb6')]['id']}})[_0xfb07('0x2d')](handleEntityNotFound(_0x2c3793,null))[_0xfb07('0x2d')](function(_0x4bc25f){if(_0x4bc25f){_0x175718[_0xfb07('0x37')]=_['keys'](db[_0xfb07('0xc1')]['rawAttributes']);_0x175718[_0xfb07('0x39')]=_[_0xfb07('0x3a')](_0x16e71e['query']);_0x175718['filters']=_[_0xfb07('0x3c')](_0x175718['model'],_0x175718[_0xfb07('0x39')]);_0x4b1645['attributes']=_[_0xfb07('0x3c')](_0x175718[_0xfb07('0x37')],qs[_0xfb07('0x3d')](_0x16e71e[_0xfb07('0x39')][_0xfb07('0x3d')]));_0x4b1645['attributes']=_0x4b1645['attributes'][_0xfb07('0x3f')]?_0x4b1645[_0xfb07('0x3e')]:_0x175718[_0xfb07('0x37')];if(!_0x16e71e[_0xfb07('0x39')]['hasOwnProperty']('nolimit')){_0x4b1645[_0xfb07('0x26')]=qs[_0xfb07('0x26')](_0x16e71e[_0xfb07('0x39')][_0xfb07('0x26')]);_0x4b1645['offset']=qs[_0xfb07('0x28')](_0x16e71e[_0xfb07('0x39')][_0xfb07('0x28')]);}_0x4b1645['order']=qs[_0xfb07('0x42')](_0x16e71e['query'][_0xfb07('0x42')]);_0x4b1645['where']=qs['filters'](_[_0xfb07('0x44')](_0x16e71e[_0xfb07('0x39')],_0x175718[_0xfb07('0x3b')]));_0x4b1645['where'][_0xfb07('0xb2')]=_0x4bc25f['id'];if(_0x16e71e[_0xfb07('0x39')]['filter']){_0x4b1645[_0xfb07('0x43')]=_[_0xfb07('0x9b')](_0x4b1645[_0xfb07('0x43')],{'$or':_[_0xfb07('0x38')](_0x4b1645[_0xfb07('0x3e')],function(_0x530f44){var _0x29e21e={};_0x29e21e[_0x530f44]={'$like':'%'+_0x16e71e[_0xfb07('0x39')][_0xfb07('0x84')]+'%'};return _0x29e21e;})});}if(_0x16e71e[_0xfb07('0x39')][_0xfb07('0x79')]){var _0x5cbd03=_0x16e71e[_0xfb07('0x39')][_0xfb07('0x79')]['split'](',');var _0x5da3b0={};_0x5da3b0[_0x5cbd03[0x0]]={'$gte':moment(_0x5cbd03[0x1])[_0xfb07('0xc2')](_0xfb07('0xc3'))};_0x4b1645[_0xfb07('0x43')]=_[_0xfb07('0x9b')](_0x4b1645[_0xfb07('0x43')],_0x5da3b0);}_0x4b1645=_['merge']({},_0x4b1645,_0x16e71e['options']);return db[_0xfb07('0xc1')][_0xfb07('0x27')]({'where':_0x4b1645['where']})[_0xfb07('0x2d')](function(_0x287a65){_0x18bb08[_0xfb07('0x27')]=_0x287a65;if(_0x16e71e[_0xfb07('0x39')][_0xfb07('0xb7')]){_0x4b1645[_0xfb07('0xb8')]=[{'all':!![]}];}return db[_0xfb07('0xc1')]['findAll'](_0x4b1645);})[_0xfb07('0x2d')](function(_0x4c83ba){_0x18bb08[_0xfb07('0xb4')]=_0x4c83ba;return _0x18bb08;});}})[_0xfb07('0x2d')](respondWithFilteredResult(_0x2c3793,_0x4b1645))[_0xfb07('0xba')](handleError(_0x2c3793,null));};exports['addTags']=function(_0x322317,_0x40b8b1,_0x90dad6){return db[_0xfb07('0x9c')][_0xfb07('0x66')]({'where':{'id':_0x322317[_0xfb07('0xb6')]['id']}})[_0xfb07('0x2d')](handleEntityNotFound(_0x40b8b1,null))[_0xfb07('0x2d')](function(_0x5d670c){if(_0x5d670c){return _0x5d670c[_0xfb07('0xc4')](_0x322317['body'][_0xfb07('0xbe')],_[_0xfb07('0xbf')](_0x322317['body'],[_0xfb07('0xbe'),'id'])||{})[_0xfb07('0xc5')](function(){return db[_0xfb07('0x6b')]['findAll']({'attributes':['id',_0xfb07('0x2f'),_0xfb07('0x47')],'where':{'id':_0x322317[_0xfb07('0x73')]['ids']}});})[_0xfb07('0x2d')](function(_0x380f24){socket[_0xfb07('0xc6')](_0xfb07('0xc7'),{'id':Number(_0x322317[_0xfb07('0xb6')]['id']),'tags':_0x380f24||[]});return{'id':Number(_0x322317[_0xfb07('0xb6')]['id']),'tags':_0x380f24||[]};});}})[_0xfb07('0x2d')](respondWithResult(_0x40b8b1,null))[_0xfb07('0xba')](handleError(_0x40b8b1,null));};exports[_0xfb07('0xc8')]=function(_0x303107,_0x21618a,_0x4df276){return db['WhatsappInteraction']['find']({'where':{'id':_0x303107[_0xfb07('0xb6')]['id']}})['then'](handleEntityNotFound(_0x21618a,null))[_0xfb07('0x2d')](function(_0x199849){if(_0x199849){return _0x199849['removeTags'](_0x303107['query'][_0xfb07('0xbe')]);}})['then'](respondWithStatusCode(_0x21618a,null))[_0xfb07('0xba')](handleError(_0x21618a,null));};exports['download']=function(_0x138314,_0xfcdf63){var _0x5c6412=moment()['unix']()[_0xfb07('0x98')]();var _0x105440=path['join'](config['root'],'server',_0xfb07('0xc9'),_0xfb07('0xca'));var _0x5549d5=path[_0xfb07('0xcb')](config[_0xfb07('0xcc')],_0xfb07('0xcd'),_0xfb07('0xc9'),'attachments');var _0x64b8db=path[_0xfb07('0xcb')](_0x105440,_0x5c6412);var _0x306da8=util[_0xfb07('0xc2')]('transcript-%d-%s.zip',_0x138314[_0xfb07('0xb6')]['id'],_0x5c6412);var _0x5b7a4c=path[_0xfb07('0xcb')](_0x105440,_0x306da8);var _0xbe5376=[];_0xbe5376[_0xfb07('0x34')]({'model':db[_0xfb07('0x6f')],'as':'User','attributes':['id',_0xfb07('0xce')],'raw':!![]});_0xbe5376[_0xfb07('0x34')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xfb07('0xcf'),'lastName'],'raw':!![]});if(_0x138314[_0xfb07('0x39')][_0xfb07('0xd0')]){_0xbe5376[_0xfb07('0x34')]({'model':db['Attachment'],'as':_0xfb07('0xd1'),'raw':!![]});}var _0x1b1103=[{'model':db[_0xfb07('0xc1')],'as':_0xfb07('0xd2'),'attributes':['id',_0xfb07('0x73'),_0xfb07('0xd3'),_0xfb07('0xd4'),'secret',_0xfb07('0x7f')],'include':_0xbe5376}];_0x1b1103[_0xfb07('0x34')]({'model':db[_0xfb07('0xd5')],'as':'Account','attributes':['id',_0xfb07('0x2f')]});_0x1b1103['push']({'model':db[_0xfb07('0x6f')],'as':_0xfb07('0xd6'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0xfb07('0x66')]({'where':{'id':_0x138314[_0xfb07('0xb6')]['id']},'include':_0x1b1103})[_0xfb07('0x2d')](handleEntityNotFound(_0xfcdf63,null))[_0xfb07('0x2d')](function(_0x131264){if(_0x131264){var _0x18ab05=_0x131264[_0xfb07('0xd7')]({'plain':!![]});fs['mkdirSync'](_0x64b8db);var _0x53ea6b={'channel':'Whatsapp','account':_0x18ab05[_0xfb07('0xd8')][_0xfb07('0x2f')],'agent':_0x18ab05['Owner']?_0x18ab05['Owner'][_0xfb07('0xce')]:_0xfb07('0xd9'),'createdAt':moment(_0x18ab05[_0xfb07('0xd3')])[_0xfb07('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x18ab05[_0xfb07('0xda')]?moment(_0x18ab05[_0xfb07('0xdb')])[_0xfb07('0xc2')](_0xfb07('0xc3'))['toString']():'','disposition':_0x18ab05[_0xfb07('0xdc')],'messages':_(_0x18ab05['Messages'])[_0xfb07('0x84')]({'secret':![]})[_0xfb07('0x38')](function(_0x5dc248){if(_0x5dc248[_0xfb07('0xd1')]){var _0x327aed=path['join'](_0x5549d5,_0x5dc248[_0xfb07('0xd1')][_0xfb07('0xdd')]);if(fs['existsSync'](_0x327aed)){fs[_0xfb07('0xde')](_0x327aed)['pipe'](fs['createWriteStream'](path['join'](_0x64b8db,_0x5dc248[_0xfb07('0xd1')]['basename'])));}}return{'date':moment(_0x5dc248['createdAt'])[_0xfb07('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfb07('0x98')](),'sender':_0x5dc248[_0xfb07('0xd4')]==='out'?_0x5dc248[_0xfb07('0x6f')]?_0x5dc248[_0xfb07('0x6f')][_0xfb07('0xce')]:_0xfb07('0xdf'):_0x5dc248['Contact'][_0xfb07('0xcf')]+(_0x5dc248[_0xfb07('0x61')][_0xfb07('0xe0')]?'\x20'+_0x5dc248[_0xfb07('0x61')]['lastName']:''),'body':_0x5dc248[_0xfb07('0xd1')]?_0x5dc248[_0xfb07('0xd1')][_0xfb07('0xdd')]:_0x5dc248[_0xfb07('0x73')],'direction':_0x5dc248[_0xfb07('0xd4')]==='out'?'A':'C','secret':_0x5dc248[_0xfb07('0xe1')],'read':_0x5dc248['read'],'attachment':_0x5dc248[_0xfb07('0xd1')]};})[_0xfb07('0x5e')]()};return ejs['renderFile'](path['join'](config['root'],_0xfb07('0xcd'),_0xfb07('0xe2'),_0xfb07('0xe3')),{'interaction':_0x53ea6b})[_0xfb07('0x2d')](function(_0x522c8b){var _0x1c7e0b=path['join'](_0x64b8db,_0xfb07('0xe4')+_0x18ab05['id']+'-'+_0x5c6412+_0xfb07('0xe5'));var _0x494253={'path':_0x1c7e0b,'channel':_0xfb07('0xe6'),'interactionId':_0x18ab05['id']};return pdf['createPdfFromHTML'](_0x522c8b,_0x494253);})[_0xfb07('0x2d')](function(){return new BPromise(function(_0x38d1cb,_0x2c45a9){zipdir(_0x64b8db,{'saveTo':_0x5b7a4c},function(_0x57d4cd,_0x45c4d0){if(_0x57d4cd)return _0x2c45a9(_0x57d4cd);return _0x38d1cb(_0x45c4d0);});})[_0xfb07('0x2d')](function(){return new BPromise(function(_0x4e7f4b,_0x17ed70){rimraf(_0x64b8db,function(_0x6a436c){if(_0x6a436c)_0x17ed70(_0x6a436c);return _0x4e7f4b();});});})[_0xfb07('0x2d')](function(){return _0xfcdf63[_0xfb07('0xe7')](_0x5b7a4c,_0x306da8,function(_0x3d7afc){if(_0x3d7afc){console[_0xfb07('0xe8')](_0xfb07('0xe9'),_0x3d7afc);}else{fs[_0xfb07('0xea')](_0x5b7a4c);}});});});}else{return _0xfcdf63[_0xfb07('0x22')](0xc8);}})[_0xfb07('0xba')](handleError(_0xfcdf63,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index e8848d0..fd4ae4d 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 _0x58e5=['unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','then'];(function(_0x2b7817,_0x59dca8){var _0x17d3d6=function(_0x4aeadc){while(--_0x4aeadc){_0x2b7817['push'](_0x2b7817['shift']());}};_0x17d3d6(++_0x59dca8);}(_0x58e5,0xd1));var _0x558e=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x58e5[_0x176329];return _0x31997c;};'use strict';var EventEmitter=require(_0x558e('0x0'));var WhatsappInteraction=require(_0x558e('0x1'))['db'][_0x558e('0x2')];var WhatsappMessage=require(_0x558e('0x1'))['db'][_0x558e('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x558e('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x558e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4959f0){return function(_0xd66d13,_0x58497f,_0x33bcd4){_0xd66d13['getUsers']({'attributes':['id'],'raw':!![]})[_0x558e('0x6')](function(_0xdf6e1e){_0xd66d13['setDataValue']('Users',_0xdf6e1e['map'](function(_0x537f9f){return{'id':_0x537f9f['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0xd66d13['id'],'direction':'in','read':![]},'raw':!![]});})[_0x558e('0x6')](function(_0x8b89a){_0xd66d13['setDataValue'](_0x558e('0x7'),_0x8b89a[_0x558e('0x8')]);WhatsappInteractionEvents[_0x558e('0x9')](_0x4959f0+':'+_0xd66d13['id'],_0xd66d13);WhatsappInteractionEvents[_0x558e('0x9')](_0x4959f0,_0xd66d13);_0x33bcd4(null);})['catch'](_0x33bcd4(null));};}for(var e in events){if(events[_0x558e('0xa')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x558e('0xb')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x557d=['Users','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','save','update','getUsers','then'];(function(_0x4ecd94,_0x3f01ac){var _0x33cd50=function(_0x242adb){while(--_0x242adb){_0x4ecd94['push'](_0x4ecd94['shift']());}};_0x33cd50(++_0x3f01ac);}(_0x557d,0xcb));var _0xd557=function(_0x180f9f,_0x4efded){_0x180f9f=_0x180f9f-0x0;var _0x1c1b5a=_0x557d[_0x180f9f];return _0x1c1b5a;};'use strict';var EventEmitter=require(_0xd557('0x0'));var WhatsappInteraction=require(_0xd557('0x1'))['db'][_0xd557('0x2')];var WhatsappMessage=require(_0xd557('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd557('0x3'),'afterUpdate':_0xd557('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f19d7){return function(_0x479940,_0x7f3f34,_0x598348){_0x479940[_0xd557('0x5')]({'attributes':['id'],'raw':!![]})[_0xd557('0x6')](function(_0x21173d){_0x479940['setDataValue'](_0xd557('0x7'),_0x21173d['map'](function(_0x1379a1){return{'id':_0x1379a1['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x479940['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x68af0d){_0x479940[_0xd557('0x8')](_0xd557('0x9'),_0x68af0d[_0xd557('0xa')]);WhatsappInteractionEvents[_0xd557('0xb')](_0x5f19d7+':'+_0x479940['id'],_0x479940);WhatsappInteractionEvents[_0xd557('0xb')](_0x5f19d7,_0x479940);_0x598348(null);})['catch'](_0x598348(null));};}for(var e in events){if(events[_0xd557('0xc')](e)){var event=events[e];WhatsappInteraction[_0xd557('0xd')](e,emitEvent(event));}}module[_0xd557('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 7ed0c5e..8b211a5 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 _0x28f2=['changed','closedAt','format','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions'];(function(_0x1bece5,_0x351cec){var _0xd8c7e1=function(_0x1b29d1){while(--_0x1b29d1){_0x1bece5['push'](_0x1bece5['shift']());}};_0xd8c7e1(++_0x351cec);}(_0x28f2,0x193));var _0x228f=function(_0xcc33b3,_0x12f104){_0xcc33b3=_0xcc33b3-0x0;var _0x528ab1=_0x28f2[_0xcc33b3];return _0x528ab1;};'use strict';var _=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var logger=require(_0x228f('0x2'))(_0x228f('0x3'));var moment=require(_0x228f('0x4'));var BPromise=require('bluebird');var rp=require(_0x228f('0x5'));var fs=require('fs');var path=require(_0x228f('0x6'));var rimraf=require(_0x228f('0x7'));var config=require(_0x228f('0x8'));var attributes=require(_0x228f('0x9'));module[_0x228f('0xa')]=function(_0x32c5c3,_0x485423){return _0x32c5c3[_0x228f('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x228f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x455eb6,_0xf4b011,_0x5f406c){if(_0x455eb6[_0x228f('0xd')]('closed')){_0x455eb6[_0x228f('0xe')]=moment()[_0x228f('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5f406c(null,_0x455eb6);}}});}; \ No newline at end of file +var _0x0498=['util','../../config/logger','moment','bluebird','./whatsappInteraction.attributes','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x17e880,_0x223657){var _0x235bbc=function(_0x4861c5){while(--_0x4861c5){_0x17e880['push'](_0x17e880['shift']());}};_0x235bbc(++_0x223657);}(_0x0498,0x1dc));var _0x8049=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x0498[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x8049('0x0'));var util=require(_0x8049('0x1'));var logger=require(_0x8049('0x2'))('api');var moment=require(_0x8049('0x3'));var BPromise=require(_0x8049('0x4'));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(_0x8049('0x5'));module['exports']=function(_0x2affe8,_0x33dcb9){return _0x2affe8['define']('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21eb90,_0x5b1134,_0x49ca3d){if(_0x21eb90[_0x8049('0x6')]('closed')){_0x21eb90['closedAt']=moment()[_0x8049('0x7')](_0x8049('0x8'));}_0x49ca3d(null,_0x21eb90);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 4ac8d01..5ea372d 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 _0xd523=['defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xd523,0xf4));var _0x3d52=function(_0x59e087,_0x599f36){_0x59e087=_0x59e087-0x0;var _0x13018a=_0xd523[_0x59e087];return _0x13018a;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var moment=require(_0x3d52('0x2'));var BPromise=require('bluebird');var rs=require(_0x3d52('0x3'));var fs=require('fs');var Redis=require(_0x3d52('0x4'));var db=require(_0x3d52('0x5'))['db'];var utils=require(_0x3d52('0x6'));var logger=require(_0x3d52('0x7'))(_0x3d52('0x8'));var config=require(_0x3d52('0x9'));var jayson=require(_0x3d52('0xa'));var client=jayson[_0x3d52('0xb')][_0x3d52('0xc')]({'port':0x232a});config[_0x3d52('0xd')]=_[_0x3d52('0xe')](config[_0x3d52('0xd')],{'host':_0x3d52('0xf'),'port':0x18eb});var socket=require(_0x3d52('0x10'))(new Redis(config[_0x3d52('0xd')]));require(_0x3d52('0x11'))[_0x3d52('0x12')](socket);function respondWithRpcPromise(_0x292eda,_0x23a93f,_0x18a5b5){return new BPromise(function(_0x269c06,_0x273137){return client[_0x3d52('0x13')](_0x292eda,_0x18a5b5)[_0x3d52('0x14')](function(_0x3baca2){logger[_0x3d52('0x15')](_0x3d52('0x16'),_0x23a93f,_0x3d52('0x17'));logger[_0x3d52('0x18')](_0x3d52('0x19'),_0x23a93f,_0x3d52('0x17'),JSON[_0x3d52('0x1a')](_0x3baca2));if(_0x3baca2[_0x3d52('0x1b')]){if(_0x3baca2[_0x3d52('0x1b')][_0x3d52('0x1c')]===0x1f4){logger[_0x3d52('0x1b')](_0x3d52('0x16'),_0x23a93f,_0x3baca2[_0x3d52('0x1b')][_0x3d52('0x1d')]);return _0x273137(_0x3baca2[_0x3d52('0x1b')][_0x3d52('0x1d')]);}logger[_0x3d52('0x1b')](_0x3d52('0x16'),_0x23a93f,_0x3baca2[_0x3d52('0x1b')][_0x3d52('0x1d')]);return _0x269c06(_0x3baca2['error'][_0x3d52('0x1d')]);}else{logger['info'](_0x3d52('0x16'),_0x23a93f,_0x3d52('0x17'));_0x269c06(_0x3baca2[_0x3d52('0x1e')][_0x3d52('0x1d')]);}})[_0x3d52('0x1f')](function(_0x249b9d){logger[_0x3d52('0x1b')](_0x3d52('0x16'),_0x23a93f,_0x249b9d);_0x273137(_0x249b9d);});});}exports['UpdateWhatsappInteraction']=function(_0x5d2ab3){var _0x4646da=this;return new Promise(function(_0x4ec8e8,_0x4f9cea){return db['WhatsappInteraction']['update'](_0x5d2ab3[_0x3d52('0x20')],{'raw':_0x5d2ab3['options']?_0x5d2ab3[_0x3d52('0x21')][_0x3d52('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d2ab3[_0x3d52('0x21')]?_0x5d2ab3[_0x3d52('0x21')]['where']||null:null,'attributes':_0x5d2ab3[_0x3d52('0x21')]?_0x5d2ab3['options']['attributes']||null:null,'limit':_0x5d2ab3[_0x3d52('0x21')]?_0x5d2ab3[_0x3d52('0x21')][_0x3d52('0x23')]||null:null})[_0x3d52('0x14')](function(_0x4d567f){logger[_0x3d52('0x15')](_0x3d52('0x24'),_0x5d2ab3);logger[_0x3d52('0x18')](_0x3d52('0x24'),_0x5d2ab3,JSON[_0x3d52('0x1a')](_0x4d567f));_0x4ec8e8(_0x4d567f);})[_0x3d52('0x1f')](function(_0x2d58e1){logger[_0x3d52('0x1b')]('UpdateWhatsappInteraction',_0x2d58e1['message'],_0x5d2ab3);_0x4f9cea(_0x4646da[_0x3d52('0x1b')](0x1f4,_0x2d58e1['message']));});});};exports[_0x3d52('0x25')]=function(_0x428fbe){return new Promise(function(_0x508de1,_0x5da030){return db['WhatsappInteraction']['find']({'where':_0x428fbe['options']?_0x428fbe[_0x3d52('0x21')]['where']||null:null})[_0x3d52('0x14')](function(_0x22f387){if(_0x22f387){return _0x22f387[_0x3d52('0x26')](_0x428fbe[_0x3d52('0x20')]['ids'],_[_0x3d52('0x27')](_0x428fbe['body'],[_0x3d52('0x28'),'id'])||{});}})[_0x3d52('0x29')](function(_0x5640b6){logger[_0x3d52('0x15')]('AddTags',_0x428fbe);logger[_0x3d52('0x18')](_0x3d52('0x2a'),_0x428fbe,JSON['stringify'](_0x5640b6));_0x508de1(_0x5640b6);})[_0x3d52('0x1f')](function(_0x1d278a){logger[_0x3d52('0x1b')](_0x3d52('0x2a'),_0x1d278a[_0x3d52('0x1d')],_0x428fbe);_0x5da030(_this[_0x3d52('0x1b')](0x1f4,_0x1d278a[_0x3d52('0x1d')]));});});}; \ No newline at end of file +var _0xad87=['where','addTags','omit','body','ids','AddTags','util','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','register','then','info','WhatsappInteraction,\x20%s,\x20%s','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','attributes','limit','debug','AddTagsToWhatsappInteraction','find'];(function(_0x3c95a3,_0x1159f1){var _0x57b25b=function(_0x332465){while(--_0x332465){_0x3c95a3['push'](_0x3c95a3['shift']());}};_0x57b25b(++_0x1159f1);}(_0xad87,0x7b));var _0x7ad8=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xad87[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require('lodash');var util=require(_0x7ad8('0x0'));var moment=require('moment');var BPromise=require(_0x7ad8('0x1'));var rs=require(_0x7ad8('0x2'));var fs=require('fs');var Redis=require(_0x7ad8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ad8('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7ad8('0x5'));var client=jayson[_0x7ad8('0x6')][_0x7ad8('0x7')]({'port':0x232a});config[_0x7ad8('0x8')]=_[_0x7ad8('0x9')](config[_0x7ad8('0x8')],{'host':_0x7ad8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ad8('0x8')]));require('./whatsappInteraction.socket')[_0x7ad8('0xb')](socket);function respondWithRpcPromise(_0x4224d2,_0x35e258,_0x4fd4a2){return new BPromise(function(_0x2bbbd7,_0x52c33a){return client['request'](_0x4224d2,_0x4fd4a2)[_0x7ad8('0xc')](function(_0x4616be){logger[_0x7ad8('0xd')](_0x7ad8('0xe'),_0x35e258,'request\x20sent');logger['debug'](_0x7ad8('0xf'),_0x35e258,_0x7ad8('0x10'),JSON[_0x7ad8('0x11')](_0x4616be));if(_0x4616be[_0x7ad8('0x12')]){if(_0x4616be[_0x7ad8('0x12')][_0x7ad8('0x13')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x35e258,_0x4616be[_0x7ad8('0x12')]['message']);return _0x52c33a(_0x4616be['error']['message']);}logger[_0x7ad8('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x35e258,_0x4616be[_0x7ad8('0x12')][_0x7ad8('0x14')]);return _0x2bbbd7(_0x4616be[_0x7ad8('0x12')][_0x7ad8('0x14')]);}else{logger[_0x7ad8('0xd')](_0x7ad8('0xe'),_0x35e258,_0x7ad8('0x10'));_0x2bbbd7(_0x4616be[_0x7ad8('0x15')][_0x7ad8('0x14')]);}})[_0x7ad8('0x16')](function(_0x4d6336){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x35e258,_0x4d6336);_0x52c33a(_0x4d6336);});});}exports[_0x7ad8('0x17')]=function(_0x175874){var _0x1f83dd=this;return new Promise(function(_0x1adeeb,_0x1bc207){return db[_0x7ad8('0x18')][_0x7ad8('0x19')](_0x175874['body'],{'raw':_0x175874[_0x7ad8('0x1a')]?_0x175874[_0x7ad8('0x1a')][_0x7ad8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x175874['options']?_0x175874['options']['where']||null:null,'attributes':_0x175874[_0x7ad8('0x1a')]?_0x175874[_0x7ad8('0x1a')][_0x7ad8('0x1c')]||null:null,'limit':_0x175874[_0x7ad8('0x1a')]?_0x175874['options'][_0x7ad8('0x1d')]||null:null})[_0x7ad8('0xc')](function(_0x456795){logger['info'](_0x7ad8('0x17'),_0x175874);logger[_0x7ad8('0x1e')](_0x7ad8('0x17'),_0x175874,JSON['stringify'](_0x456795));_0x1adeeb(_0x456795);})['catch'](function(_0x53230f){logger['error'](_0x7ad8('0x17'),_0x53230f[_0x7ad8('0x14')],_0x175874);_0x1bc207(_0x1f83dd[_0x7ad8('0x12')](0x1f4,_0x53230f['message']));});});};exports[_0x7ad8('0x1f')]=function(_0x694920){return new Promise(function(_0x352734,_0x5edd51){return db[_0x7ad8('0x18')][_0x7ad8('0x20')]({'where':_0x694920[_0x7ad8('0x1a')]?_0x694920['options'][_0x7ad8('0x21')]||null:null})[_0x7ad8('0xc')](function(_0x25acb1){if(_0x25acb1){return _0x25acb1[_0x7ad8('0x22')](_0x694920['body']['ids'],_[_0x7ad8('0x23')](_0x694920[_0x7ad8('0x24')],[_0x7ad8('0x25'),'id'])||{});}})['spread'](function(_0x449da5){logger['info'](_0x7ad8('0x26'),_0x694920);logger[_0x7ad8('0x1e')]('AddTags',_0x694920,JSON[_0x7ad8('0x11')](_0x449da5));_0x352734(_0x449da5);})[_0x7ad8('0x16')](function(_0x121b3f){logger['error'](_0x7ad8('0x26'),_0x121b3f['message'],_0x694920);_0x5edd51(_this[_0x7ad8('0x12')](0x1f4,_0x121b3f[_0x7ad8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 80852af..c65b88d 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 _0xefe0=['./whatsappInteraction.events','save','remove','update','emit','register','length','whatsappInteraction:'];(function(_0x350bab,_0x19148d){var _0x558de3=function(_0x1b5c3a){while(--_0x1b5c3a){_0x350bab['push'](_0x350bab['shift']());}};_0x558de3(++_0x19148d);}(_0xefe0,0x150));var _0x0efe=function(_0xa277de,_0x2ad712){_0xa277de=_0xa277de-0x0;var _0x27c2da=_0xefe0[_0xa277de];return _0x27c2da;};'use strict';var WhatsappInteractionEvents=require(_0x0efe('0x0'));var events=[_0x0efe('0x1'),_0x0efe('0x2'),_0x0efe('0x3')];function createListener(_0x3a0f55,_0x2a7c79){return function(_0xba7526){_0x2a7c79[_0x0efe('0x4')](_0x3a0f55,_0xba7526);};}function removeListener(_0xf083a1,_0xe912da){return function(){WhatsappInteractionEvents['removeListener'](_0xf083a1,_0xe912da);};}exports[_0x0efe('0x5')]=function(_0x50c21e){for(var _0x1ebf09=0x0,_0xf9573e=events[_0x0efe('0x6')];_0x1ebf09<_0xf9573e;_0x1ebf09++){var _0x10a34d=events[_0x1ebf09];var _0x322b3f=createListener(_0x0efe('0x7')+_0x10a34d,_0x50c21e);WhatsappInteractionEvents['on'](_0x10a34d,_0x322b3f);}}; \ No newline at end of file +var _0x68e6=['update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0x3cde2d,_0x58328c){var _0xe76d18=function(_0x4a464e){while(--_0x4a464e){_0x3cde2d['push'](_0x3cde2d['shift']());}};_0xe76d18(++_0x58328c);}(_0x68e6,0x15c));var _0x668e=function(_0x405221,_0x4390f5){_0x405221=_0x405221-0x0;var _0x4dfb89=_0x68e6[_0x405221];return _0x4dfb89;};'use strict';var WhatsappInteractionEvents=require(_0x668e('0x0'));var events=[_0x668e('0x1'),_0x668e('0x2'),_0x668e('0x3')];function createListener(_0x3dd57f,_0x421395){return function(_0x1b0850){_0x421395[_0x668e('0x4')](_0x3dd57f,_0x1b0850);};}function removeListener(_0x579757,_0x5b9636){return function(){WhatsappInteractionEvents[_0x668e('0x5')](_0x579757,_0x5b9636);};}exports[_0x668e('0x6')]=function(_0x99683){for(var _0x229a32=0x0,_0x51478b=events[_0x668e('0x7')];_0x229a32<_0x51478b;_0x229a32++){var _0x17a814=events[_0x229a32];var _0x4855a5=createListener(_0x668e('0x8')+_0x17a814,_0x99683);WhatsappInteractionEvents['on'](_0x17a814,_0x4855a5);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 378e43f..e576110 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 _0x0dd4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','exports','util','connect-timeout','express','fs-extra'];(function(_0x7835c2,_0x17fffc){var _0x5e9592=function(_0x56ec38){while(--_0x56ec38){_0x7835c2['push'](_0x7835c2['shift']());}};_0x5e9592(++_0x17fffc);}(_0x0dd4,0x79));var _0x40dd=function(_0x523a23,_0x5965b6){_0x523a23=_0x523a23-0x0;var _0x327d29=_0x0dd4[_0x523a23];return _0x327d29;};'use strict';var multer=require('multer');var util=require(_0x40dd('0x0'));var path=require('path');var timeout=require(_0x40dd('0x1'));var express=require(_0x40dd('0x2'));var router=express['Router']();var fs_extra=require(_0x40dd('0x3'));var auth=require(_0x40dd('0x4'));var interaction=require(_0x40dd('0x5'));var config=require(_0x40dd('0x6'));var controller=require(_0x40dd('0x7'));router[_0x40dd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x40dd('0x8')](_0x40dd('0x9'),auth[_0x40dd('0xa')](),controller[_0x40dd('0xb')]);router['get'](_0x40dd('0xc'),auth[_0x40dd('0xa')](),controller[_0x40dd('0xd')]);router[_0x40dd('0xe')]('/',auth[_0x40dd('0xa')](),interaction[_0x40dd('0xf')](_0x40dd('0x10'),_0x40dd('0x11')),controller['create']);router['post'](_0x40dd('0x12'),controller[_0x40dd('0x13')]);router['put'](_0x40dd('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x40dd('0x14')](_0x40dd('0x15'),auth[_0x40dd('0xa')](),controller[_0x40dd('0x16')]);router[_0x40dd('0x14')](_0x40dd('0x17'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x40dd('0xc'),auth[_0x40dd('0xa')](),controller['destroy']);module[_0x40dd('0x18')]=router; \ No newline at end of file +var _0x0cbd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','isAuthenticated','/:id','show','post','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0x0cbd,0xe9));var _0xd0cb=function(_0x5c470c,_0x416588){_0x5c470c=_0x5c470c-0x0;var _0x25e626=_0x0cbd[_0x5c470c];return _0x25e626;};'use strict';var multer=require(_0xd0cb('0x0'));var util=require(_0xd0cb('0x1'));var path=require(_0xd0cb('0x2'));var timeout=require(_0xd0cb('0x3'));var express=require(_0xd0cb('0x4'));var router=express[_0xd0cb('0x5')]();var fs_extra=require(_0xd0cb('0x6'));var auth=require(_0xd0cb('0x7'));var interaction=require(_0xd0cb('0x8'));var config=require(_0xd0cb('0x9'));var controller=require(_0xd0cb('0xa'));router[_0xd0cb('0xb')]('/',auth['isAuthenticated'](),controller[_0xd0cb('0xc')]);router['get']('/describe',auth[_0xd0cb('0xd')](),controller['describe']);router[_0xd0cb('0xb')](_0xd0cb('0xe'),auth[_0xd0cb('0xd')](),controller[_0xd0cb('0xf')]);router[_0xd0cb('0x10')]('/',auth[_0xd0cb('0xd')](),interaction['tracked']('whatsapp',_0xd0cb('0x11')),controller[_0xd0cb('0x12')]);router[_0xd0cb('0x10')](_0xd0cb('0x13'),controller[_0xd0cb('0x14')]);router[_0xd0cb('0x15')](_0xd0cb('0xe'),auth[_0xd0cb('0xd')](),controller[_0xd0cb('0x16')]);router[_0xd0cb('0x15')](_0xd0cb('0x17'),auth[_0xd0cb('0xd')](),controller[_0xd0cb('0x18')]);router[_0xd0cb('0x15')](_0xd0cb('0x19'),auth['isAuthenticated'](),controller[_0xd0cb('0x1a')]);router[_0xd0cb('0x1b')](_0xd0cb('0xe'),auth[_0xd0cb('0xd')](),controller[_0xd0cb('0x1c')]);module[_0xd0cb('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 6922ed6..33626cc 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 _0xaaf2=['ENUM','out','STRING','DATE','exports','TEXT','BOOLEAN'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0xaaf2,0x169));var _0x2aaf=function(_0x2c468b,_0xe380bc){_0x2c468b=_0x2c468b-0x0;var _0x20a988=_0xaaf2[_0x2c468b];return _0x20a988;};'use strict';var Sequelize=require('sequelize');module[_0x2aaf('0x0')]={'body':{'type':Sequelize[_0x2aaf('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2aaf('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2aaf('0x3')]('in',_0x2aaf('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x2aaf('0x5')](0xbe)},'phone':{'type':Sequelize[_0x2aaf('0x5')]},'readAt':{'type':Sequelize[_0x2aaf('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2aaf('0x5')]},'providerResponse':{'type':Sequelize[_0x2aaf('0x1')]}}; \ No newline at end of file +var _0x59b7=['medium','BOOLEAN','out','STRING','DATE','exports','TEXT'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x59b7,0x1ef));var _0x759b=function(_0x1a1a1c,_0x1608a7){_0x1a1a1c=_0x1a1a1c-0x0;var _0x3f0f83=_0x59b7[_0x1a1a1c];return _0x3f0f83;};'use strict';var Sequelize=require('sequelize');module[_0x759b('0x0')]={'body':{'type':Sequelize[_0x759b('0x1')](_0x759b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x759b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x759b('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x759b('0x5')](0xbe)},'phone':{'type':Sequelize[_0x759b('0x5')]},'readAt':{'type':Sequelize[_0x759b('0x6')]},'secret':{'type':Sequelize[_0x759b('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x759b('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 02a2331..ca97500 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 _0x6bfc=['hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','include','findAll','rows','catch','rawAttributes','includeAll','options','find','create','body','params','describe','whatsapp-interactions','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','../../config/logger','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','rejectmessage','WhatsappAccount','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','error','message','request\x20sent','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','WhatsappMessage','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x4a0833,_0x2a69ac){var _0x804b28=function(_0xbb366){while(--_0xbb366){_0x4a0833['push'](_0x4a0833['shift']());}};_0x804b28(++_0x2a69ac);}(_0x6bfc,0x159));var _0xc6bf=function(_0x1dc15f,_0xbd7f8f){_0x1dc15f=_0x1dc15f-0x0;var _0xd0a506=_0x6bfc[_0x1dc15f];return _0xd0a506;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6bf('0x0'));var zipdir=require(_0xc6bf('0x1'));var jsonpatch=require(_0xc6bf('0x2'));var rp=require('request-promise');var moment=require(_0xc6bf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc6bf('0x4'));var util=require('util');var path=require(_0xc6bf('0x5'));var sox=require(_0xc6bf('0x6'));var csv=require(_0xc6bf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6bf('0x8'));var _=require(_0xc6bf('0x9'));var squel=require(_0xc6bf('0xa'));var crypto=require(_0xc6bf('0xb'));var jsforce=require(_0xc6bf('0xc'));var deskjs=require(_0xc6bf('0xd'));var toCsv=require(_0xc6bf('0x7'));var querystring=require(_0xc6bf('0xe'));var Papa=require('papaparse');var Redis=require(_0xc6bf('0xf'));var authService=require(_0xc6bf('0x10'));var qs=require(_0xc6bf('0x11'));var as=require(_0xc6bf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc6bf('0x13'));var utils=require(_0xc6bf('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc6bf('0x15'))['db'];config[_0xc6bf('0x16')]=_['defaults'](config[_0xc6bf('0x16')],{'host':_0xc6bf('0x17'),'port':0x18eb});var socket=require(_0xc6bf('0x18'))(new Redis(config[_0xc6bf('0x16')]));require(_0xc6bf('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc6bf('0x1a')][_0xc6bf('0x1b')]({'port':0x232c});var client9002=jayson[_0xc6bf('0x1a')][_0xc6bf('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x331f31,_0x368195,_0x478f6,_0x54d6a8){return new BPromise(function(_0x23498a,_0x5b9900){var _0x4dec90=_0x54d6a8||client;return _0x4dec90[_0xc6bf('0x1c')](_0x331f31,_0x478f6)[_0xc6bf('0x1d')](function(_0x5bdc69){logger[_0xc6bf('0x1e')](_0xc6bf('0x1f'),_0x368195,'request\x20sent');logger[_0xc6bf('0x20')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x368195,'request\x20sent',JSON['stringify'](_0x5bdc69));if(_0x5bdc69[_0xc6bf('0x21')]){if(_0x5bdc69[_0xc6bf('0x21')]['code']===0x1f4){logger['error'](_0xc6bf('0x1f'),_0x368195,_0x5bdc69[_0xc6bf('0x21')]['message']);return _0x5b9900(_0x5bdc69[_0xc6bf('0x21')][_0xc6bf('0x22')]);}logger[_0xc6bf('0x21')](_0xc6bf('0x1f'),_0x368195,_0x5bdc69['error'][_0xc6bf('0x22')]);return _0x23498a(_0x5bdc69[_0xc6bf('0x21')][_0xc6bf('0x22')]);}else{logger[_0xc6bf('0x1e')](_0xc6bf('0x1f'),_0x368195,_0xc6bf('0x23'));_0x23498a(_0x5bdc69[_0xc6bf('0x24')][_0xc6bf('0x22')]);}})['catch'](function(_0x312138){logger[_0xc6bf('0x21')](_0xc6bf('0x1f'),_0x368195,_0x312138);_0x5b9900(_0x312138);});});}function respondWithStatusCode(_0x532bc1,_0x13281d){_0x13281d=_0x13281d||0xcc;return function(_0x273b97){if(_0x273b97){return _0x532bc1[_0xc6bf('0x25')](_0x13281d);}return _0x532bc1[_0xc6bf('0x26')](_0x13281d)[_0xc6bf('0x27')]();};}function respondWithResult(_0x15396c,_0x5abf52){_0x5abf52=_0x5abf52||0xc8;return function(_0x4b092f){if(_0x4b092f){return _0x15396c[_0xc6bf('0x26')](_0x5abf52)['json'](_0x4b092f);}};}function respondWithFilteredResult(_0x36b1c7,_0x48adb6){return function(_0x54fb9a){if(_0x54fb9a){var _0x2806e6=typeof _0x48adb6[_0xc6bf('0x28')]===_0xc6bf('0x29')&&typeof _0x48adb6[_0xc6bf('0x2a')]==='undefined';var _0x478af5=_0x54fb9a['count'];var _0x4f0234=_0x2806e6?0x0:_0x48adb6[_0xc6bf('0x28')];var _0xf49ed7=_0x2806e6?_0x54fb9a[_0xc6bf('0x2b')]:_0x48adb6[_0xc6bf('0x28')]+_0x48adb6[_0xc6bf('0x2a')];var _0x3186b1;if(_0xf49ed7>=_0x478af5){_0xf49ed7=_0x478af5;_0x3186b1=0xc8;}else{_0x3186b1=0xce;}_0x36b1c7[_0xc6bf('0x26')](_0x3186b1);return _0x36b1c7[_0xc6bf('0x2c')](_0xc6bf('0x2d'),_0x4f0234+'-'+_0xf49ed7+'/'+_0x478af5)[_0xc6bf('0x2e')](_0x54fb9a);}return null;};}function patchUpdates(_0x2ec79e){return function(_0x4630af){try{jsonpatch[_0xc6bf('0x2f')](_0x4630af,_0x2ec79e,!![]);}catch(_0x138092){return BPromise[_0xc6bf('0x30')](_0x138092);}return _0x4630af['save']();};}function saveUpdates(_0x310f9a,_0x1245d7){return function(_0x2a5036){if(_0x2a5036){return _0x2a5036[_0xc6bf('0x31')](_0x310f9a)['then'](function(_0x5393bc){return _0x5393bc;});}return null;};}function removeEntity(_0x39d41b,_0x188df5){return function(_0x11de46){if(_0x11de46){return _0x11de46[_0xc6bf('0x32')]()[_0xc6bf('0x1d')](function(){_0x39d41b['status'](0xcc)[_0xc6bf('0x27')]();});}};}function handleEntityNotFound(_0x571119,_0x525e59){return function(_0x31786a){if(!_0x31786a){_0x571119[_0xc6bf('0x25')](0x194);}return _0x31786a;};}function handleError(_0xda7005,_0x1eab86){_0x1eab86=_0x1eab86||0x1f4;return function(_0x2965bc){logger['error'](_0x2965bc[_0xc6bf('0x33')]);if(_0x2965bc[_0xc6bf('0x34')]){delete _0x2965bc['name'];}_0xda7005[_0xc6bf('0x26')](_0x1eab86)[_0xc6bf('0x35')](_0x2965bc);};}exports[_0xc6bf('0x36')]=function(_0x59b561,_0x5d1dbd){var _0x4fb13b={},_0x2a904b={},_0x3f05a4={'count':0x0,'rows':[]};var _0x2e9458=_['map'](db[_0xc6bf('0x37')]['rawAttributes'],function(_0x4b6f73){return{'name':_0x4b6f73[_0xc6bf('0x38')],'type':_0x4b6f73[_0xc6bf('0x39')][_0xc6bf('0x3a')]};});_0x2a904b['model']=_['map'](_0x2e9458,_0xc6bf('0x34'));_0x2a904b[_0xc6bf('0x3b')]=_[_0xc6bf('0x3c')](_0x59b561[_0xc6bf('0x3b')]);_0x2a904b[_0xc6bf('0x3d')]=_[_0xc6bf('0x3e')](_0x2a904b[_0xc6bf('0x3f')],_0x2a904b['query']);_0x4fb13b[_0xc6bf('0x40')]=_[_0xc6bf('0x3e')](_0x2a904b[_0xc6bf('0x3f')],qs['fields'](_0x59b561[_0xc6bf('0x3b')][_0xc6bf('0x41')]));_0x4fb13b[_0xc6bf('0x40')]=_0x4fb13b['attributes']['length']?_0x4fb13b['attributes']:_0x2a904b['model'];if(!_0x59b561[_0xc6bf('0x3b')][_0xc6bf('0x42')]('nolimit')){_0x4fb13b['limit']=qs[_0xc6bf('0x2a')](_0x59b561[_0xc6bf('0x3b')][_0xc6bf('0x2a')]);_0x4fb13b['offset']=qs[_0xc6bf('0x28')](_0x59b561[_0xc6bf('0x3b')][_0xc6bf('0x28')]);}_0x4fb13b[_0xc6bf('0x43')]=qs[_0xc6bf('0x44')](_0x59b561[_0xc6bf('0x3b')][_0xc6bf('0x44')]);_0x4fb13b['where']=qs['filters'](_[_0xc6bf('0x45')](_0x59b561[_0xc6bf('0x3b')],_0x2a904b[_0xc6bf('0x3d')]),_0x2e9458);if(_0x59b561[_0xc6bf('0x3b')][_0xc6bf('0x46')]){_0x4fb13b[_0xc6bf('0x47')]=_[_0xc6bf('0x48')](_0x4fb13b[_0xc6bf('0x47')],{'$or':_[_0xc6bf('0x49')](_0x2e9458,function(_0x3afe33){if(_0x3afe33[_0xc6bf('0x39')]!==_0xc6bf('0x4a')){var _0x1907a6={};_0x1907a6[_0x3afe33[_0xc6bf('0x34')]]={'$like':'%'+_0x59b561[_0xc6bf('0x3b')][_0xc6bf('0x46')]+'%'};return _0x1907a6;}})});}_0x4fb13b=_[_0xc6bf('0x48')]({},_0x4fb13b,_0x59b561['options']);var _0x100d5a={'where':_0x4fb13b[_0xc6bf('0x47')]};return db[_0xc6bf('0x37')][_0xc6bf('0x2b')](_0x100d5a)['then'](function(_0x2f75a3){_0x3f05a4[_0xc6bf('0x2b')]=_0x2f75a3;if(_0x59b561[_0xc6bf('0x3b')]['includeAll']){_0x4fb13b[_0xc6bf('0x4b')]=[{'all':!![]}];}return db[_0xc6bf('0x37')][_0xc6bf('0x4c')](_0x4fb13b);})[_0xc6bf('0x1d')](function(_0x5ee9ba){_0x3f05a4[_0xc6bf('0x4d')]=_0x5ee9ba;return _0x3f05a4;})[_0xc6bf('0x1d')](respondWithFilteredResult(_0x5d1dbd,_0x4fb13b))[_0xc6bf('0x4e')](handleError(_0x5d1dbd,null));};exports['show']=function(_0x4c0eb5,_0x4eb844){var _0x3bcce0={'raw':!![],'where':{'id':_0x4c0eb5['params']['id']}},_0x5b20ae={};_0x5b20ae[_0xc6bf('0x3f')]=_['keys'](db[_0xc6bf('0x37')][_0xc6bf('0x4f')]);_0x5b20ae[_0xc6bf('0x3b')]=_[_0xc6bf('0x3c')](_0x4c0eb5[_0xc6bf('0x3b')]);_0x5b20ae[_0xc6bf('0x3d')]=_[_0xc6bf('0x3e')](_0x5b20ae[_0xc6bf('0x3f')],_0x5b20ae[_0xc6bf('0x3b')]);_0x3bcce0[_0xc6bf('0x40')]=_[_0xc6bf('0x3e')](_0x5b20ae['model'],qs['fields'](_0x4c0eb5['query'][_0xc6bf('0x41')]));_0x3bcce0[_0xc6bf('0x40')]=_0x3bcce0['attributes']['length']?_0x3bcce0['attributes']:_0x5b20ae[_0xc6bf('0x3f')];if(_0x4c0eb5[_0xc6bf('0x3b')][_0xc6bf('0x50')]){_0x3bcce0['include']=[{'all':!![]}];}_0x3bcce0=_[_0xc6bf('0x48')]({},_0x3bcce0,_0x4c0eb5[_0xc6bf('0x51')]);return db['WhatsappMessage'][_0xc6bf('0x52')](_0x3bcce0)[_0xc6bf('0x1d')](handleEntityNotFound(_0x4eb844,null))[_0xc6bf('0x1d')](respondWithResult(_0x4eb844,null))[_0xc6bf('0x4e')](handleError(_0x4eb844,null));};exports[_0xc6bf('0x53')]=function(_0x548d3a,_0x4a6913){return db['WhatsappMessage'][_0xc6bf('0x53')](_0x548d3a[_0xc6bf('0x54')],{})[_0xc6bf('0x1d')](respondWithResult(_0x4a6913,0xc9))[_0xc6bf('0x4e')](handleError(_0x4a6913,null));};exports['update']=function(_0x1b8cef,_0x3059b3){if(_0x1b8cef[_0xc6bf('0x54')]['id']){delete _0x1b8cef[_0xc6bf('0x54')]['id'];}return db[_0xc6bf('0x37')]['find']({'where':{'id':_0x1b8cef[_0xc6bf('0x55')]['id']}})[_0xc6bf('0x1d')](handleEntityNotFound(_0x3059b3,null))[_0xc6bf('0x1d')](saveUpdates(_0x1b8cef[_0xc6bf('0x54')],null))[_0xc6bf('0x1d')](respondWithResult(_0x3059b3,null))[_0xc6bf('0x4e')](handleError(_0x3059b3,null));};exports['destroy']=function(_0x320481,_0x3f890e){return db['WhatsappMessage'][_0xc6bf('0x52')]({'where':{'id':_0x320481[_0xc6bf('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f890e,null))['then'](removeEntity(_0x3f890e,null))[_0xc6bf('0x4e')](handleError(_0x3f890e,null));};exports[_0xc6bf('0x56')]=function(_0x2b7d2c,_0x388728){return db[_0xc6bf('0x37')][_0xc6bf('0x56')]()[_0xc6bf('0x1d')](respondWithResult(_0x388728,null))['catch'](handleError(_0x388728,null));};var interaction_log=require('../../config/logger')(_0xc6bf('0x57'));exports[_0xc6bf('0x58')]=function(_0x4495a1,_0x248eaa,_0xa0c02c){var _0x5d24c9={'agent':{},'channel':_0xc6bf('0x59')};if(_0x4495a1[_0xc6bf('0x54')]['id']){delete _0x4495a1[_0xc6bf('0x54')]['id'];}_0x4495a1['body']['read']=!![];_0x4495a1[_0xc6bf('0x54')][_0xc6bf('0x5a')]=moment()[_0xc6bf('0x5b')](_0xc6bf('0x5c'));_0x4495a1['body']['UserId']=_0x4495a1[_0xc6bf('0x54')][_0xc6bf('0x5d')]||_0x4495a1[_0xc6bf('0x5e')]['id'];_0x5d24c9[_0xc6bf('0x5f')]['id']=_0x4495a1[_0xc6bf('0x54')][_0xc6bf('0x5d')];return db['WhatsappMessage']['find']({'where':{'id':_0x4495a1[_0xc6bf('0x55')]['id'],'UserId':null}})[_0xc6bf('0x1d')](handleEntityNotFound(_0x248eaa,null))[_0xc6bf('0x1d')](saveUpdates(_0x4495a1[_0xc6bf('0x54')],null))[_0xc6bf('0x1d')](function(_0x54a8f0){if(_0x54a8f0){_0x5d24c9['message']=_0x54a8f0[_0xc6bf('0x60')]({'plain':!![]});return db['WhatsappInteraction'][_0xc6bf('0x52')]({'where':{'id':_0x54a8f0[_0xc6bf('0x61')]}});}return null;})[_0xc6bf('0x1d')](handleEntityNotFound(_0x248eaa,null))[_0xc6bf('0x1d')](function(_0x4193ff){if(_0x4193ff){return _0x4193ff['update']({'UserId':_0x4495a1['body']['UserId'],'read1stAt':_['isNil'](_0x4193ff[_0xc6bf('0x62')])?moment()['format'](_0xc6bf('0x5c')):undefined});}return null;})[_0xc6bf('0x1d')](function(_0x3570c3){if(_0x3570c3){_0x5d24c9[_0xc6bf('0x63')]=_0x3570c3[_0xc6bf('0x60')]({'plain':!![]});interaction_log[_0xc6bf('0x1e')](_0xc6bf('0x64'),_0x4495a1[_0xc6bf('0x5e')]['id'],_0x4495a1[_0xc6bf('0x5e')][_0xc6bf('0x34')],_0x4495a1['user']['role'],_0x5d24c9[_0xc6bf('0x63')]['id'],_0x4495a1['body']?JSON[_0xc6bf('0x65')](_0x4495a1['body']):_0xc6bf('0x66'));return respondWithRpcPromise(_0xc6bf('0x67'),_0xc6bf('0x68'),_0x5d24c9);}return null;})[_0xc6bf('0x1d')](function(_0x211107){var _0x5dff03=_0xc6bf('0x69')+_0x211107[_0xc6bf('0x22')]['ContactId'];return db['sequelize'][_0xc6bf('0x3b')](_0x5dff03,{'type':db[_0xc6bf('0x6a')][_0xc6bf('0x6b')][_0xc6bf('0x6c')],'raw':!![]})[_0xc6bf('0x1d')](function(_0x35654d){return _0x35654d;});})[_0xc6bf('0x1d')](function(_0x849c51){if(_0x849c51){_0x5d24c9['message'][_0xc6bf('0x6d')]=_0x849c51[0x0];if(!_0x4495a1[_0xc6bf('0x54')]['UserId'])return;return db[_0xc6bf('0x6e')][_0xc6bf('0x52')]({'where':{'id':_0x4495a1[_0xc6bf('0x54')]['UserId'],'role':'agent'},'attributes':['id',_0xc6bf('0x34'),_0xc6bf('0x6f'),_0xc6bf('0x70'),_0xc6bf('0x71')],'raw':!![]});}return null;})[_0xc6bf('0x1d')](function(_0x3ae2b8){if(!_0x3ae2b8)return null;_0x5d24c9[_0xc6bf('0x22')][_0xc6bf('0x5f')]=_0x3ae2b8;return _0x5d24c9;})[_0xc6bf('0x1d')](function(_0x1feb89){if(_0x1feb89){if(_0x4495a1[_0xc6bf('0x54')][_0xc6bf('0x72')]){_0x5d24c9[_0xc6bf('0x22')][_0xc6bf('0x73')]=util['format'](_0xc6bf('0x74'),_0x4495a1[_0xc6bf('0x5e')][_0xc6bf('0x34')]);_0x5d24c9[_0xc6bf('0x22')][_0xc6bf('0x75')]=_0x5d24c9[_0xc6bf('0x75')];_0x5d24c9['message'][_0xc6bf('0x76')]='accept';return respondWithRpcPromise(_0xc6bf('0x77'),_0xc6bf('0x77'),{'event':'acceptmessage','message':_0x5d24c9[_0xc6bf('0x22')]},client9002)['then'](function(){return _0x5d24c9;});}return _0x5d24c9;}return null;})[_0xc6bf('0x1d')](respondWithResult(_0x248eaa,null))[_0xc6bf('0x4e')](handleError(_0x248eaa,null));};var interaction_log=require(_0xc6bf('0x78'))(_0xc6bf('0x57'));exports[_0xc6bf('0x30')]=function(_0x39620a,_0x4e08cf,_0x8ad39a){var _0x58fcd3={'agent':{},'channel':_0xc6bf('0x59')};if(_0x39620a['body']['id']){delete _0x39620a[_0xc6bf('0x54')]['id'];}_0x39620a[_0xc6bf('0x54')]['UserId']=_0x39620a['body']['UserId']||_0x39620a[_0xc6bf('0x5e')]['id'];_0x58fcd3[_0xc6bf('0x5f')]['id']=_0x39620a[_0xc6bf('0x54')][_0xc6bf('0x5d')];return db['WhatsappMessage'][_0xc6bf('0x52')]({'where':{'id':_0x39620a[_0xc6bf('0x55')]['id'],'UserId':null}})[_0xc6bf('0x1d')](handleEntityNotFound(_0x4e08cf,null))['then'](function(_0x4ef404){if(_0x4ef404){_0x58fcd3['message']=_0x4ef404[_0xc6bf('0x60')]({'plain':!![]});return db[_0xc6bf('0x79')]['find']({'where':{'id':_0x4ef404[_0xc6bf('0x61')]}});}return null;})[_0xc6bf('0x1d')](handleEntityNotFound(_0x4e08cf,null))[_0xc6bf('0x1d')](function(_0x1bdc0b){if(_0x1bdc0b){_0x58fcd3['interaction']=_0x1bdc0b['get']({'plain':!![]});interaction_log[_0xc6bf('0x1e')](_0xc6bf('0x7a'),_0x39620a[_0xc6bf('0x5e')]['id'],_0x39620a['user']['name'],_0x39620a[_0xc6bf('0x5e')][_0xc6bf('0x7b')],_0x58fcd3[_0xc6bf('0x63')]['id'],_0x39620a[_0xc6bf('0x54')]?JSON[_0xc6bf('0x65')](_0x39620a[_0xc6bf('0x54')]):_0xc6bf('0x66'));return respondWithRpcPromise(_0xc6bf('0x7c'),_0xc6bf('0x7d'),_0x58fcd3);}return null;})[_0xc6bf('0x1d')](function(_0x4973a2){var _0x2ce17d=_0xc6bf('0x69')+_0x4973a2[_0xc6bf('0x22')]['ContactId'];return db[_0xc6bf('0x7e')][_0xc6bf('0x3b')](_0x2ce17d,{'type':db[_0xc6bf('0x6a')]['QueryTypes'][_0xc6bf('0x6c')],'raw':!![]})[_0xc6bf('0x1d')](function(_0x153397){return _0x153397;});})['then'](function(_0x4c4c6e){if(_0x4c4c6e){_0x58fcd3[_0xc6bf('0x22')][_0xc6bf('0x6d')]=_0x4c4c6e[0x0];if(!_0x39620a[_0xc6bf('0x54')][_0xc6bf('0x5d')])return;return db[_0xc6bf('0x6e')][_0xc6bf('0x52')]({'where':{'id':_0x39620a[_0xc6bf('0x54')][_0xc6bf('0x5d')],'role':_0xc6bf('0x5f')},'attributes':['id',_0xc6bf('0x34'),_0xc6bf('0x6f'),_0xc6bf('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0x124706){if(!_0x124706)return null;_0x58fcd3[_0xc6bf('0x22')][_0xc6bf('0x5f')]=_0x124706;return _0x58fcd3;})[_0xc6bf('0x1d')](function(_0x3b567f){if(_0x3b567f){_0x3b567f[_0xc6bf('0x22')]['interface']=util[_0xc6bf('0x5b')](_0xc6bf('0x74'),_0x39620a[_0xc6bf('0x5e')][_0xc6bf('0x34')]);_0x3b567f[_0xc6bf('0x22')][_0xc6bf('0x75')]=_0x58fcd3[_0xc6bf('0x75')];_0x3b567f[_0xc6bf('0x22')]['event']='reject';respondWithRpcPromise('EventManager',_0xc6bf('0x77'),{'event':_0xc6bf('0x7f'),'message':_0x3b567f['message']},client9002);return _0x58fcd3;}return null;})['then'](respondWithResult(_0x4e08cf,null))['catch'](handleError(_0x4e08cf,null));};exports[_0xc6bf('0x26')]=function(_0x4d4378,_0x4b33dd,_0x3a350e){if(_0x4d4378['body']['id']){delete _0x4d4378[_0xc6bf('0x54')]['id'];}var _0xf02c40;return db[_0xc6bf('0x37')][_0xc6bf('0x52')]({'where':{'id':_0x4d4378[_0xc6bf('0x55')]['id']}})['then'](handleEntityNotFound(_0x4b33dd,null))['then'](function(_0x827025){if(_0x827025){_0xf02c40=_0x827025;return db[_0xc6bf('0x80')]['find']({'where':{'id':_0x827025['WhatsappAccountId']}});}})[_0xc6bf('0x1d')](handleEntityNotFound(_0x4b33dd,null))[_0xc6bf('0x1d')](function(_0x3a2444){if(_0x3a2444){logger[_0xc6bf('0x20')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xc6bf('0x26'),_0xc6bf('0x81'),_0x3a2444[_0xc6bf('0x39')],util[_0xc6bf('0x82')](_0x4d4378['body'],{'showHidden':![],'depth':null}));switch(_0x3a2444[_0xc6bf('0x39')]){case'twilio':if(_0x4d4378['body'][_0xc6bf('0x83')]&&_0x4d4378[_0xc6bf('0x54')][_0xc6bf('0x83')]===_0xf02c40[_0xc6bf('0x84')]&&_0x4d4378[_0xc6bf('0x54')]['MessageStatus']&&_0x4d4378[_0xc6bf('0x54')][_0xc6bf('0x85')]===_0xc6bf('0x86')){return _0xf02c40['update']({'read':!![]});}else{logger[_0xc6bf('0x21')](_0xc6bf('0x87'),_0xc6bf('0x26'),_0xc6bf('0x88'),util[_0xc6bf('0x82')](_0x4d4378[_0xc6bf('0x54')],{'showHidden':![],'depth':null}));}break;}return _0xf02c40;}})[_0xc6bf('0x1d')](respondWithResult(_0x4b33dd,null))[_0xc6bf('0x4e')](handleError(_0x4b33dd,null));}; \ No newline at end of file +var _0x276d=['fieldName','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','where','pick','filter','type','VIRTUAL','options','WhatsappMessage','include','findAll','rows','show','params','rawAttributes','includeAll','merge','create','find','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','email','internal','agent','manual','SIP/%s','channel','event','EventManager','acceptmessage','reject','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','fullname','interface','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','destroy','stack','name','send','index','map'];(function(_0x1d6d2f,_0x3e2ece){var _0xa7545e=function(_0x446c67){while(--_0x446c67){_0x1d6d2f['push'](_0x1d6d2f['shift']());}};_0xa7545e(++_0x3e2ece);}(_0x276d,0xe3));var _0xd276=function(_0x14a86e,_0x1131fc){_0x14a86e=_0x14a86e-0x0;var _0xba191a=_0x276d[_0x14a86e];return _0xba191a;};'use strict';var emlformat=require(_0xd276('0x0'));var rimraf=require(_0xd276('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd276('0x2'));var rp=require(_0xd276('0x3'));var moment=require(_0xd276('0x4'));var BPromise=require(_0xd276('0x5'));var Mustache=require(_0xd276('0x6'));var util=require(_0xd276('0x7'));var path=require('path');var sox=require(_0xd276('0x8'));var csv=require(_0xd276('0x9'));var ejs=require(_0xd276('0xa'));var fs=require('fs');var fs_extra=require(_0xd276('0xb'));var _=require(_0xd276('0xc'));var squel=require(_0xd276('0xd'));var crypto=require(_0xd276('0xe'));var jsforce=require(_0xd276('0xf'));var deskjs=require(_0xd276('0x10'));var toCsv=require(_0xd276('0x9'));var querystring=require(_0xd276('0x11'));var Papa=require(_0xd276('0x12'));var Redis=require(_0xd276('0x13'));var authService=require(_0xd276('0x14'));var qs=require(_0xd276('0x15'));var as=require(_0xd276('0x16'));var hardwareService=require(_0xd276('0x17'));var logger=require('../../config/logger')(_0xd276('0x18'));var utils=require(_0xd276('0x19'));var config=require(_0xd276('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd276('0x1b'))['db'];config['redis']=_[_0xd276('0x1c')](config[_0xd276('0x1d')],{'host':_0xd276('0x1e'),'port':0x18eb});var socket=require(_0xd276('0x1f'))(new Redis(config[_0xd276('0x1d')]));require(_0xd276('0x20'))['register'](socket);var jayson=require(_0xd276('0x21'));var client=jayson[_0xd276('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xd276('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17149b,_0x5e313f,_0x262421,_0x55ab67){return new BPromise(function(_0x58c1b4,_0x4750a8){var _0x45e372=_0x55ab67||client;return _0x45e372[_0xd276('0x23')](_0x17149b,_0x262421)[_0xd276('0x24')](function(_0x3773af){logger[_0xd276('0x25')](_0xd276('0x26'),_0x5e313f,_0xd276('0x27'));logger[_0xd276('0x28')](_0xd276('0x29'),_0x5e313f,_0xd276('0x27'),JSON[_0xd276('0x2a')](_0x3773af));if(_0x3773af[_0xd276('0x2b')]){if(_0x3773af[_0xd276('0x2b')][_0xd276('0x2c')]===0x1f4){logger['error'](_0xd276('0x26'),_0x5e313f,_0x3773af['error'][_0xd276('0x2d')]);return _0x4750a8(_0x3773af[_0xd276('0x2b')][_0xd276('0x2d')]);}logger[_0xd276('0x2b')](_0xd276('0x26'),_0x5e313f,_0x3773af[_0xd276('0x2b')][_0xd276('0x2d')]);return _0x58c1b4(_0x3773af[_0xd276('0x2b')][_0xd276('0x2d')]);}else{logger[_0xd276('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x5e313f,'request\x20sent');_0x58c1b4(_0x3773af[_0xd276('0x2e')][_0xd276('0x2d')]);}})[_0xd276('0x2f')](function(_0x57512e){logger[_0xd276('0x2b')](_0xd276('0x26'),_0x5e313f,_0x57512e);_0x4750a8(_0x57512e);});});}function respondWithStatusCode(_0x14e3a9,_0x44dd84){_0x44dd84=_0x44dd84||0xcc;return function(_0xcb542d){if(_0xcb542d){return _0x14e3a9[_0xd276('0x30')](_0x44dd84);}return _0x14e3a9[_0xd276('0x31')](_0x44dd84)[_0xd276('0x32')]();};}function respondWithResult(_0x1feace,_0x17819f){_0x17819f=_0x17819f||0xc8;return function(_0x54041e){if(_0x54041e){return _0x1feace[_0xd276('0x31')](_0x17819f)[_0xd276('0x33')](_0x54041e);}};}function respondWithFilteredResult(_0x929d9a,_0x6d9cd5){return function(_0x252acc){if(_0x252acc){var _0x58193f=typeof _0x6d9cd5[_0xd276('0x34')]===_0xd276('0x35')&&typeof _0x6d9cd5['limit']==='undefined';var _0xee5357=_0x252acc[_0xd276('0x36')];var _0x13e4cc=_0x58193f?0x0:_0x6d9cd5[_0xd276('0x34')];var _0x3d238b=_0x58193f?_0x252acc[_0xd276('0x36')]:_0x6d9cd5['offset']+_0x6d9cd5['limit'];var _0x4f2e41;if(_0x3d238b>=_0xee5357){_0x3d238b=_0xee5357;_0x4f2e41=0xc8;}else{_0x4f2e41=0xce;}_0x929d9a[_0xd276('0x31')](_0x4f2e41);return _0x929d9a['set'](_0xd276('0x37'),_0x13e4cc+'-'+_0x3d238b+'/'+_0xee5357)[_0xd276('0x33')](_0x252acc);}return null;};}function patchUpdates(_0x1204b0){return function(_0x85d5f2){try{jsonpatch[_0xd276('0x38')](_0x85d5f2,_0x1204b0,!![]);}catch(_0x1600eb){return BPromise['reject'](_0x1600eb);}return _0x85d5f2[_0xd276('0x39')]();};}function saveUpdates(_0x141aa2,_0x4752b8){return function(_0x495a9f){if(_0x495a9f){return _0x495a9f[_0xd276('0x3a')](_0x141aa2)[_0xd276('0x24')](function(_0x4aee1d){return _0x4aee1d;});}return null;};}function removeEntity(_0x42f1b5,_0x19a048){return function(_0xede458){if(_0xede458){return _0xede458[_0xd276('0x3b')]()[_0xd276('0x24')](function(){_0x42f1b5[_0xd276('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13fc4f,_0x13336d){return function(_0x5d7180){if(!_0x5d7180){_0x13fc4f[_0xd276('0x30')](0x194);}return _0x5d7180;};}function handleError(_0x2ff2e9,_0x1c840c){_0x1c840c=_0x1c840c||0x1f4;return function(_0xea2fb4){logger[_0xd276('0x2b')](_0xea2fb4[_0xd276('0x3c')]);if(_0xea2fb4[_0xd276('0x3d')]){delete _0xea2fb4[_0xd276('0x3d')];}_0x2ff2e9[_0xd276('0x31')](_0x1c840c)[_0xd276('0x3e')](_0xea2fb4);};}exports[_0xd276('0x3f')]=function(_0x22cb89,_0x123b34){var _0x5bfaf6={},_0x395afa={},_0x44d7e3={'count':0x0,'rows':[]};var _0x56b82f=_[_0xd276('0x40')](db['WhatsappMessage']['rawAttributes'],function(_0x225f85){return{'name':_0x225f85[_0xd276('0x41')],'type':_0x225f85['type']['key']};});_0x395afa[_0xd276('0x42')]=_[_0xd276('0x40')](_0x56b82f,'name');_0x395afa['query']=_[_0xd276('0x43')](_0x22cb89['query']);_0x395afa[_0xd276('0x44')]=_[_0xd276('0x45')](_0x395afa['model'],_0x395afa[_0xd276('0x46')]);_0x5bfaf6[_0xd276('0x47')]=_[_0xd276('0x45')](_0x395afa['model'],qs[_0xd276('0x48')](_0x22cb89[_0xd276('0x46')][_0xd276('0x48')]));_0x5bfaf6[_0xd276('0x47')]=_0x5bfaf6['attributes'][_0xd276('0x49')]?_0x5bfaf6[_0xd276('0x47')]:_0x395afa['model'];if(!_0x22cb89[_0xd276('0x46')]['hasOwnProperty'](_0xd276('0x4a'))){_0x5bfaf6[_0xd276('0x4b')]=qs['limit'](_0x22cb89[_0xd276('0x46')]['limit']);_0x5bfaf6[_0xd276('0x34')]=qs['offset'](_0x22cb89['query']['offset']);}_0x5bfaf6['order']=qs['sort'](_0x22cb89['query']['sort']);_0x5bfaf6[_0xd276('0x4c')]=qs[_0xd276('0x44')](_[_0xd276('0x4d')](_0x22cb89[_0xd276('0x46')],_0x395afa[_0xd276('0x44')]),_0x56b82f);if(_0x22cb89['query'][_0xd276('0x4e')]){_0x5bfaf6['where']=_['merge'](_0x5bfaf6[_0xd276('0x4c')],{'$or':_[_0xd276('0x40')](_0x56b82f,function(_0x4d3ae9){if(_0x4d3ae9[_0xd276('0x4f')]!==_0xd276('0x50')){var _0x346f86={};_0x346f86[_0x4d3ae9[_0xd276('0x3d')]]={'$like':'%'+_0x22cb89['query'][_0xd276('0x4e')]+'%'};return _0x346f86;}})});}_0x5bfaf6=_['merge']({},_0x5bfaf6,_0x22cb89[_0xd276('0x51')]);var _0x560248={'where':_0x5bfaf6[_0xd276('0x4c')]};return db[_0xd276('0x52')][_0xd276('0x36')](_0x560248)[_0xd276('0x24')](function(_0x1908ba){_0x44d7e3[_0xd276('0x36')]=_0x1908ba;if(_0x22cb89[_0xd276('0x46')]['includeAll']){_0x5bfaf6[_0xd276('0x53')]=[{'all':!![]}];}return db[_0xd276('0x52')][_0xd276('0x54')](_0x5bfaf6);})['then'](function(_0x37cc4b){_0x44d7e3[_0xd276('0x55')]=_0x37cc4b;return _0x44d7e3;})[_0xd276('0x24')](respondWithFilteredResult(_0x123b34,_0x5bfaf6))[_0xd276('0x2f')](handleError(_0x123b34,null));};exports[_0xd276('0x56')]=function(_0x23d4af,_0x2a24dc){var _0x13ae83={'raw':!![],'where':{'id':_0x23d4af[_0xd276('0x57')]['id']}},_0x23777f={};_0x23777f[_0xd276('0x42')]=_['keys'](db[_0xd276('0x52')][_0xd276('0x58')]);_0x23777f[_0xd276('0x46')]=_[_0xd276('0x43')](_0x23d4af['query']);_0x23777f[_0xd276('0x44')]=_[_0xd276('0x45')](_0x23777f['model'],_0x23777f['query']);_0x13ae83[_0xd276('0x47')]=_[_0xd276('0x45')](_0x23777f[_0xd276('0x42')],qs[_0xd276('0x48')](_0x23d4af[_0xd276('0x46')][_0xd276('0x48')]));_0x13ae83[_0xd276('0x47')]=_0x13ae83[_0xd276('0x47')][_0xd276('0x49')]?_0x13ae83['attributes']:_0x23777f['model'];if(_0x23d4af[_0xd276('0x46')][_0xd276('0x59')]){_0x13ae83[_0xd276('0x53')]=[{'all':!![]}];}_0x13ae83=_[_0xd276('0x5a')]({},_0x13ae83,_0x23d4af[_0xd276('0x51')]);return db[_0xd276('0x52')]['find'](_0x13ae83)['then'](handleEntityNotFound(_0x2a24dc,null))[_0xd276('0x24')](respondWithResult(_0x2a24dc,null))[_0xd276('0x2f')](handleError(_0x2a24dc,null));};exports['create']=function(_0xb5426c,_0x47ffed){return db['WhatsappMessage'][_0xd276('0x5b')](_0xb5426c['body'],{})[_0xd276('0x24')](respondWithResult(_0x47ffed,0xc9))['catch'](handleError(_0x47ffed,null));};exports['update']=function(_0x1391ed,_0x5dfc87){if(_0x1391ed['body']['id']){delete _0x1391ed['body']['id'];}return db[_0xd276('0x52')][_0xd276('0x5c')]({'where':{'id':_0x1391ed[_0xd276('0x57')]['id']}})[_0xd276('0x24')](handleEntityNotFound(_0x5dfc87,null))['then'](saveUpdates(_0x1391ed[_0xd276('0x5d')],null))[_0xd276('0x24')](respondWithResult(_0x5dfc87,null))[_0xd276('0x2f')](handleError(_0x5dfc87,null));};exports[_0xd276('0x3b')]=function(_0x2f8a0a,_0x5effa7){return db['WhatsappMessage']['find']({'where':{'id':_0x2f8a0a[_0xd276('0x57')]['id']}})['then'](handleEntityNotFound(_0x5effa7,null))[_0xd276('0x24')](removeEntity(_0x5effa7,null))[_0xd276('0x2f')](handleError(_0x5effa7,null));};exports['describe']=function(_0x2e07c4,_0x445bd6){return db[_0xd276('0x52')][_0xd276('0x5e')]()[_0xd276('0x24')](respondWithResult(_0x445bd6,null))[_0xd276('0x2f')](handleError(_0x445bd6,null));};var interaction_log=require(_0xd276('0x5f'))(_0xd276('0x60'));exports[_0xd276('0x61')]=function(_0x1a28da,_0x274f86,_0x3a1967){var _0x271ecf={'agent':{},'channel':_0xd276('0x62')};if(_0x1a28da[_0xd276('0x5d')]['id']){delete _0x1a28da['body']['id'];}_0x1a28da[_0xd276('0x5d')][_0xd276('0x63')]=!![];_0x1a28da[_0xd276('0x5d')][_0xd276('0x64')]=moment()[_0xd276('0x65')](_0xd276('0x66'));_0x1a28da[_0xd276('0x5d')][_0xd276('0x67')]=_0x1a28da['body']['UserId']||_0x1a28da[_0xd276('0x68')]['id'];_0x271ecf['agent']['id']=_0x1a28da[_0xd276('0x5d')]['UserId'];return db[_0xd276('0x52')]['find']({'where':{'id':_0x1a28da[_0xd276('0x57')]['id'],'UserId':null}})[_0xd276('0x24')](handleEntityNotFound(_0x274f86,null))[_0xd276('0x24')](saveUpdates(_0x1a28da['body'],null))['then'](function(_0x5b305d){if(_0x5b305d){_0x271ecf[_0xd276('0x2d')]=_0x5b305d[_0xd276('0x69')]({'plain':!![]});return db[_0xd276('0x6a')][_0xd276('0x5c')]({'where':{'id':_0x5b305d['WhatsappInteractionId']}});}return null;})[_0xd276('0x24')](handleEntityNotFound(_0x274f86,null))[_0xd276('0x24')](function(_0x10c81a){if(_0x10c81a){return _0x10c81a['update']({'UserId':_0x1a28da['body'][_0xd276('0x67')],'read1stAt':_[_0xd276('0x6b')](_0x10c81a[_0xd276('0x6c')])?moment()[_0xd276('0x65')](_0xd276('0x66')):undefined});}return null;})[_0xd276('0x24')](function(_0x2d563f){if(_0x2d563f){_0x271ecf[_0xd276('0x6d')]=_0x2d563f['get']({'plain':!![]});interaction_log[_0xd276('0x25')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1a28da['user']['id'],_0x1a28da[_0xd276('0x68')]['name'],_0x1a28da[_0xd276('0x68')][_0xd276('0x6e')],_0x271ecf['interaction']['id'],_0x1a28da['body']?JSON[_0xd276('0x2a')](_0x1a28da[_0xd276('0x5d')]):_0xd276('0x6f'));return respondWithRpcPromise(_0xd276('0x70'),_0xd276('0x71'),_0x271ecf);}return null;})[_0xd276('0x24')](function(_0x45f25f){var _0x43d9b5=_0xd276('0x72')+_0x45f25f[_0xd276('0x2d')]['ContactId'];return db[_0xd276('0x73')][_0xd276('0x46')](_0x43d9b5,{'type':db[_0xd276('0x74')][_0xd276('0x75')]['SELECT'],'raw':!![]})['then'](function(_0x3d08ec){return _0x3d08ec;});})['then'](function(_0x444577){if(_0x444577){_0x271ecf[_0xd276('0x2d')][_0xd276('0x76')]=_0x444577[0x0];if(!_0x1a28da[_0xd276('0x5d')][_0xd276('0x67')])return;return db[_0xd276('0x77')][_0xd276('0x5c')]({'where':{'id':_0x1a28da[_0xd276('0x5d')][_0xd276('0x67')],'role':'agent'},'attributes':['id',_0xd276('0x3d'),'fullname',_0xd276('0x78'),_0xd276('0x79')],'raw':!![]});}return null;})[_0xd276('0x24')](function(_0x1cf414){if(!_0x1cf414)return null;_0x271ecf[_0xd276('0x2d')][_0xd276('0x7a')]=_0x1cf414;return _0x271ecf;})[_0xd276('0x24')](function(_0x540b1a){if(_0x540b1a){if(_0x1a28da[_0xd276('0x5d')][_0xd276('0x7b')]){_0x271ecf[_0xd276('0x2d')]['interface']=util[_0xd276('0x65')](_0xd276('0x7c'),_0x1a28da[_0xd276('0x68')][_0xd276('0x3d')]);_0x271ecf[_0xd276('0x2d')][_0xd276('0x7d')]=_0x271ecf[_0xd276('0x7d')];_0x271ecf[_0xd276('0x2d')][_0xd276('0x7e')]=_0xd276('0x61');return respondWithRpcPromise(_0xd276('0x7f'),_0xd276('0x7f'),{'event':_0xd276('0x80'),'message':_0x271ecf[_0xd276('0x2d')]},client9002)[_0xd276('0x24')](function(){return _0x271ecf;});}return _0x271ecf;}return null;})['then'](respondWithResult(_0x274f86,null))[_0xd276('0x2f')](handleError(_0x274f86,null));};var interaction_log=require(_0xd276('0x5f'))('whatsapp-interactions');exports[_0xd276('0x81')]=function(_0x19e2d1,_0x3b3f39,_0x307142){var _0x1988d3={'agent':{},'channel':_0xd276('0x62')};if(_0x19e2d1[_0xd276('0x5d')]['id']){delete _0x19e2d1[_0xd276('0x5d')]['id'];}_0x19e2d1['body'][_0xd276('0x67')]=_0x19e2d1[_0xd276('0x5d')][_0xd276('0x67')]||_0x19e2d1[_0xd276('0x68')]['id'];_0x1988d3[_0xd276('0x7a')]['id']=_0x19e2d1[_0xd276('0x5d')][_0xd276('0x67')];return db[_0xd276('0x52')][_0xd276('0x5c')]({'where':{'id':_0x19e2d1[_0xd276('0x57')]['id'],'UserId':null}})[_0xd276('0x24')](handleEntityNotFound(_0x3b3f39,null))[_0xd276('0x24')](function(_0x11694d){if(_0x11694d){_0x1988d3[_0xd276('0x2d')]=_0x11694d[_0xd276('0x69')]({'plain':!![]});return db[_0xd276('0x6a')][_0xd276('0x5c')]({'where':{'id':_0x11694d[_0xd276('0x82')]}});}return null;})[_0xd276('0x24')](handleEntityNotFound(_0x3b3f39,null))[_0xd276('0x24')](function(_0x57e638){if(_0x57e638){_0x1988d3[_0xd276('0x6d')]=_0x57e638[_0xd276('0x69')]({'plain':!![]});interaction_log['info'](_0xd276('0x83'),_0x19e2d1['user']['id'],_0x19e2d1[_0xd276('0x68')]['name'],_0x19e2d1['user'][_0xd276('0x6e')],_0x1988d3[_0xd276('0x6d')]['id'],_0x19e2d1[_0xd276('0x5d')]?JSON['stringify'](_0x19e2d1[_0xd276('0x5d')]):'null');return respondWithRpcPromise(_0xd276('0x84'),_0xd276('0x85'),_0x1988d3);}return null;})[_0xd276('0x24')](function(_0x12eb0c){var _0x29e928=_0xd276('0x72')+_0x12eb0c[_0xd276('0x2d')]['ContactId'];return db[_0xd276('0x73')][_0xd276('0x46')](_0x29e928,{'type':db[_0xd276('0x74')][_0xd276('0x75')][_0xd276('0x86')],'raw':!![]})[_0xd276('0x24')](function(_0x117712){return _0x117712;});})[_0xd276('0x24')](function(_0x4ed754){if(_0x4ed754){_0x1988d3[_0xd276('0x2d')]['contact']=_0x4ed754[0x0];if(!_0x19e2d1['body'][_0xd276('0x67')])return;return db[_0xd276('0x77')][_0xd276('0x5c')]({'where':{'id':_0x19e2d1[_0xd276('0x5d')][_0xd276('0x67')],'role':_0xd276('0x7a')},'attributes':['id',_0xd276('0x3d'),_0xd276('0x87'),_0xd276('0x78'),_0xd276('0x79')],'raw':!![]});}return null;})[_0xd276('0x24')](function(_0x5275f4){if(!_0x5275f4)return null;_0x1988d3[_0xd276('0x2d')][_0xd276('0x7a')]=_0x5275f4;return _0x1988d3;})[_0xd276('0x24')](function(_0x20cbdb){if(_0x20cbdb){_0x20cbdb['message'][_0xd276('0x88')]=util[_0xd276('0x65')](_0xd276('0x7c'),_0x19e2d1['user'][_0xd276('0x3d')]);_0x20cbdb[_0xd276('0x2d')]['channel']=_0x1988d3[_0xd276('0x7d')];_0x20cbdb[_0xd276('0x2d')]['event']='reject';respondWithRpcPromise(_0xd276('0x7f'),_0xd276('0x7f'),{'event':'rejectmessage','message':_0x20cbdb[_0xd276('0x2d')]},client9002);return _0x1988d3;}return null;})[_0xd276('0x24')](respondWithResult(_0x3b3f39,null))['catch'](handleError(_0x3b3f39,null));};exports[_0xd276('0x31')]=function(_0x2f00d2,_0x29b35a,_0x4f5ce9){if(_0x2f00d2[_0xd276('0x5d')]['id']){delete _0x2f00d2[_0xd276('0x5d')]['id'];}var _0x334c0e;return db[_0xd276('0x52')][_0xd276('0x5c')]({'where':{'id':_0x2f00d2[_0xd276('0x57')]['id']}})[_0xd276('0x24')](handleEntityNotFound(_0x29b35a,null))['then'](function(_0x24dc8f){if(_0x24dc8f){_0x334c0e=_0x24dc8f;return db[_0xd276('0x89')]['find']({'where':{'id':_0x24dc8f[_0xd276('0x8a')]}});}})[_0xd276('0x24')](handleEntityNotFound(_0x29b35a,null))[_0xd276('0x24')](function(_0x4965ea){if(_0x4965ea){logger[_0xd276('0x28')](_0xd276('0x8b'),_0xd276('0x31'),_0xd276('0x8c'),_0x4965ea['type'],util[_0xd276('0x8d')](_0x2f00d2[_0xd276('0x5d')],{'showHidden':![],'depth':null}));switch(_0x4965ea['type']){case'twilio':if(_0x2f00d2[_0xd276('0x5d')]['MessageSid']&&_0x2f00d2[_0xd276('0x5d')][_0xd276('0x8e')]===_0x334c0e['messageId']&&_0x2f00d2[_0xd276('0x5d')][_0xd276('0x8f')]&&_0x2f00d2[_0xd276('0x5d')]['MessageStatus']===_0xd276('0x63')){return _0x334c0e[_0xd276('0x3a')]({'read':!![]});}else{logger['error'](_0xd276('0x90'),'status',_0xd276('0x91'),util[_0xd276('0x8d')](_0x2f00d2[_0xd276('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x334c0e;}})[_0xd276('0x24')](respondWithResult(_0x29b35a,null))[_0xd276('0x2f')](handleError(_0x29b35a,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index d85886f..259339d 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 _0x4fad=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','save'];(function(_0x5b300d,_0x4773d1){var _0x3c1c0b=function(_0x3229b9){while(--_0x3229b9){_0x5b300d['push'](_0x5b300d['shift']());}};_0x3c1c0b(++_0x4773d1);}(_0x4fad,0xcb));var _0xd4fa=function(_0x5972e3,_0x32f5b9){_0x5972e3=_0x5972e3-0x0;var _0x265a48=_0x4fad[_0x5972e3];return _0x265a48;};'use strict';var EventEmitter=require(_0xd4fa('0x0'));var WhatsappMessage=require(_0xd4fa('0x1'))['db'][_0xd4fa('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd4fa('0x3'),'afterUpdate':_0xd4fa('0x4'),'afterDestroy':_0xd4fa('0x5')};function emitEvent(_0x3fc857){return function(_0x419a9c,_0x3903a1,_0x138bcb){WhatsappMessageEvents[_0xd4fa('0x6')](_0x3fc857+':'+_0x419a9c['id'],_0x419a9c);WhatsappMessageEvents['emit'](_0x3fc857,_0x419a9c);_0x138bcb(null);};}for(var e in events){if(events[_0xd4fa('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xd4fa('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0x4bde=['hook','events','../../mysqldb','WhatsappMessage','save','update','remove','emit','hasOwnProperty'];(function(_0xe0dbd1,_0x324c2b){var _0x58338e=function(_0x90a4bd){while(--_0x90a4bd){_0xe0dbd1['push'](_0xe0dbd1['shift']());}};_0x58338e(++_0x324c2b);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x496e9e,_0x5396df){_0x496e9e=_0x496e9e-0x0;var _0x49b0d9=_0x4bde[_0x496e9e];return _0x49b0d9;};'use strict';var EventEmitter=require(_0xe4bd('0x0'));var WhatsappMessage=require(_0xe4bd('0x1'))['db'][_0xe4bd('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe4bd('0x3'),'afterUpdate':_0xe4bd('0x4'),'afterDestroy':_0xe4bd('0x5')};function emitEvent(_0x3108bd){return function(_0x5741e5,_0x210d47,_0x1b8621){WhatsappMessageEvents[_0xe4bd('0x6')](_0x3108bd+':'+_0x5741e5['id'],_0x5741e5);WhatsappMessageEvents[_0xe4bd('0x6')](_0x3108bd,_0x5741e5);_0x1b8621(null);};}for(var e in events){if(events[_0xe4bd('0x7')](e)){var event=events[e];WhatsappMessage[_0xe4bd('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 7d3d68d..0614ce8 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 _0xc02d=['models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','update','catch','error','out','find','then','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','lodash','util','api','request-promise','rimraf','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages'];(function(_0x3faaaa,_0x1497ac){var _0x23d9d2=function(_0x573575){while(--_0x573575){_0x3faaaa['push'](_0x3faaaa['shift']());}};_0x23d9d2(++_0x1497ac);}(_0xc02d,0xc8));var _0xdc02=function(_0x2389d3,_0x39428f){_0x2389d3=_0x2389d3-0x0;var _0xcbbdcc=_0xc02d[_0x2389d3];return _0xcbbdcc;};'use strict';var _=require(_0xdc02('0x0'));var util=require(_0xdc02('0x1'));var logger=require('../../config/logger')(_0xdc02('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdc02('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc02('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0xdc02('0x5')]=function(_0xb3dfb0,_0x54da61){return _0xb3dfb0[_0xdc02('0x6')]('WhatsappMessage',attributes,{'tableName':_0xdc02('0x7'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xdc02('0x8')]},{'name':_0xdc02('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x257a1d,_0x3bffa7,_0x309471){var _0x148cb8=_0xb3dfb0[_0xdc02('0xa')];var _0x365594=_0x257a1d[_0xdc02('0xb')]({'plain':!![]});if(_0x365594[_0xdc02('0xc')][_0xdc02('0xd')]()==='in'||_0x365594[_0xdc02('0xc')][_0xdc02('0xd')]()==='out'&&!_0x365594[_0xdc02('0xe')]&&!_[_0xdc02('0xf')](_0x365594[_0xdc02('0x10')])){_0x148cb8[_0xdc02('0x11')]['findOne']({'where':{'id':_0x365594[_0xdc02('0x12')]}})['then'](function(_0x1a2742){if(_0x1a2742){_0x1a2742[_0xdc02('0x13')]({'lastMsgAt':_0x365594['createdAt'],'lastMsgDirection':_0x365594[_0xdc02('0xc')][_0xdc02('0xd')]()});}})[_0xdc02('0x14')](function(_0x14d562){console[_0xdc02('0x15')](_0x14d562);});}if(_0x365594[_0xdc02('0xc')]===_0xdc02('0x16')&&!_0x365594[_0xdc02('0xe')]){var _0x921f66;_0x148cb8['WhatsappAccount'][_0xdc02('0x17')]({'where':{'id':_0x365594['WhatsappAccountId']},'raw':!![]})[_0xdc02('0x18')](function(_0x1e580b){_0x921f66=_0x1e580b;if(_0x921f66&&_0x921f66[_0xdc02('0x19')]){switch(_0x921f66[_0xdc02('0x19')]){case _0xdc02('0x1a'):var _0x165c95=require('twilio');if(_0x921f66[_0xdc02('0x1b')]&&_0x921f66['authToken']&&_0x921f66[_0xdc02('0x1c')]){var _0xcaff51=new _0x165c95(_0x921f66[_0xdc02('0x1b')],_0x921f66[_0xdc02('0x1d')]);_0xcaff51[_0xdc02('0x1e')][_0xdc02('0x1f')]({'body':_0x365594['body'],'to':_0xdc02('0x20')+_0x365594[_0xdc02('0x1c')],'from':_0xdc02('0x20')+_0x921f66[_0xdc02('0x1c')],'statusCallback':_0x921f66['remote']+_0xdc02('0x21')+_0x365594['id']+'/status?token='+_0x921f66[_0xdc02('0x22')]})[_0xdc02('0x18')](function(_0x39d679){if(_0x39d679[_0xdc02('0x23')]){return _0x257a1d[_0xdc02('0x13')]({'messageId':_0x39d679['sid']});}})[_0xdc02('0x14')](function(_0x4cec18){logger[_0xdc02('0x15')](_0xdc02('0x24'),_0xdc02('0x25'),'twilio',util[_0xdc02('0x26')](_0x4cec18,{'showHidden':![],'depth':null}));});}else{logger[_0xdc02('0x15')](_0xdc02('0x24'),_0xdc02('0x25'),_0xdc02('0x1a'),_0xdc02('0x27'));}break;}}})[_0xdc02('0x28')](function(){_0x309471();});}else{_0x309471();}}},'charset':_0xdc02('0x29'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc3fa=['accountSid','authToken','phone','messages','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','type','twilio'];(function(_0x3eaaa8,_0x449a5c){var _0x3bbd04=function(_0xa49792){while(--_0xa49792){_0x3eaaa8['push'](_0x3eaaa8['shift']());}};_0x3bbd04(++_0x449a5c);}(_0xc3fa,0x9f));var _0xac3f=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xc3fa[_0x41cfd4];return _0x190f48;};'use strict';var _=require(_0xac3f('0x0'));var util=require(_0xac3f('0x1'));var logger=require(_0xac3f('0x2'))(_0xac3f('0x3'));var moment=require('moment');var BPromise=require(_0xac3f('0x4'));var rp=require(_0xac3f('0x5'));var fs=require('fs');var path=require(_0xac3f('0x6'));var rimraf=require(_0xac3f('0x7'));var config=require('../../config/environment');var attributes=require(_0xac3f('0x8'));module[_0xac3f('0x9')]=function(_0x5b9d32,_0x201162){return _0x5b9d32[_0xac3f('0xa')]('WhatsappMessage',attributes,{'tableName':_0xac3f('0xb'),'paranoid':![],'indexes':[{'name':_0xac3f('0xc'),'fields':[_0xac3f('0xc')]},{'name':_0xac3f('0xd'),'fields':['body'],'type':_0xac3f('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x14f555,_0x58f4f8,_0xbb93ab){var _0x4039ab=_0x5b9d32[_0xac3f('0xf')];var _0x4ec740=_0x14f555[_0xac3f('0x10')]({'plain':!![]});if(_0x4ec740[_0xac3f('0x11')][_0xac3f('0x12')]()==='in'||_0x4ec740[_0xac3f('0x11')]['toLowerCase']()===_0xac3f('0x13')&&!_0x4ec740[_0xac3f('0x14')]&&!_[_0xac3f('0x15')](_0x4ec740[_0xac3f('0x16')])){_0x4039ab['WhatsappInteraction']['findOne']({'where':{'id':_0x4ec740[_0xac3f('0x17')]}})[_0xac3f('0x18')](function(_0xe1ac45){if(_0xe1ac45){_0xe1ac45[_0xac3f('0x19')]({'lastMsgAt':_0x4ec740[_0xac3f('0x1a')],'lastMsgDirection':_0x4ec740[_0xac3f('0x11')][_0xac3f('0x12')]()});}})[_0xac3f('0x1b')](function(_0x37acb8){console[_0xac3f('0x1c')](_0x37acb8);});}if(_0x4ec740[_0xac3f('0x11')]===_0xac3f('0x13')&&!_0x4ec740[_0xac3f('0x14')]){var _0x4a37a2;_0x4039ab[_0xac3f('0x1d')][_0xac3f('0x1e')]({'where':{'id':_0x4ec740['WhatsappAccountId']},'raw':!![]})[_0xac3f('0x18')](function(_0x458cc1){_0x4a37a2=_0x458cc1;if(_0x4a37a2&&_0x4a37a2[_0xac3f('0x1f')]){switch(_0x4a37a2[_0xac3f('0x1f')]){case _0xac3f('0x20'):var _0x368905=require('twilio');if(_0x4a37a2[_0xac3f('0x21')]&&_0x4a37a2[_0xac3f('0x22')]&&_0x4a37a2[_0xac3f('0x23')]){var _0x284e73=new _0x368905(_0x4a37a2[_0xac3f('0x21')],_0x4a37a2[_0xac3f('0x22')]);_0x284e73[_0xac3f('0x24')][_0xac3f('0x25')]({'body':_0x4ec740['body'],'to':_0xac3f('0x26')+_0x4ec740['phone'],'from':_0xac3f('0x26')+_0x4a37a2['phone'],'statusCallback':_0x4a37a2['remote']+_0xac3f('0x27')+_0x4ec740['id']+_0xac3f('0x28')+_0x4a37a2[_0xac3f('0x29')]})[_0xac3f('0x18')](function(_0x144c36){if(_0x144c36[_0xac3f('0x2a')]){return _0x14f555[_0xac3f('0x19')]({'messageId':_0x144c36['sid']});}})['catch'](function(_0x101c76){logger[_0xac3f('0x1c')](_0xac3f('0x2b'),_0xac3f('0x2c'),'twilio',util[_0xac3f('0x2d')](_0x101c76,{'showHidden':![],'depth':null}));});}else{logger[_0xac3f('0x1c')](_0xac3f('0x2b'),'afterCreate',_0xac3f('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})['finally'](function(){_0xbb93ab();});}else{_0xbb93ab();}}},'charset':_0xac3f('0x2e'),'collate':_0xac3f('0x2f')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 20b90b3..fdc567c 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 _0xd66e=['raw','info','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options'];(function(_0xf2994,_0x1e3ced){var _0x24b570=function(_0x1bebe8){while(--_0x1bebe8){_0xf2994['push'](_0xf2994['shift']());}};_0x24b570(++_0x1e3ced);}(_0xd66e,0xdb));var _0xed66=function(_0x3a1dec,_0x1f943f){_0x3a1dec=_0x3a1dec-0x0;var _0x60ede0=_0xd66e[_0x3a1dec];return _0x60ede0;};'use strict';var _=require(_0xed66('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xed66('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed66('0x2'))['db'];var utils=require(_0xed66('0x3'));var logger=require(_0xed66('0x4'))(_0xed66('0x5'));var config=require(_0xed66('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xed66('0x7')][_0xed66('0x8')]({'port':0x232a});config[_0xed66('0x9')]=_[_0xed66('0xa')](config[_0xed66('0x9')],{'host':_0xed66('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed66('0x9')]));require(_0xed66('0xc'))[_0xed66('0xd')](socket);function respondWithRpcPromise(_0x25a86e,_0x42d255,_0xb05a4){return new BPromise(function(_0x796932,_0x540075){return client[_0xed66('0xe')](_0x25a86e,_0xb05a4)[_0xed66('0xf')](function(_0x4b2a92){logger['info'](_0xed66('0x10'),_0x42d255,_0xed66('0x11'));logger[_0xed66('0x12')](_0xed66('0x13'),_0x42d255,_0xed66('0x11'),JSON['stringify'](_0x4b2a92));if(_0x4b2a92['error']){if(_0x4b2a92[_0xed66('0x14')][_0xed66('0x15')]===0x1f4){logger[_0xed66('0x14')](_0xed66('0x10'),_0x42d255,_0x4b2a92[_0xed66('0x14')]['message']);return _0x540075(_0x4b2a92[_0xed66('0x14')][_0xed66('0x16')]);}logger[_0xed66('0x14')](_0xed66('0x10'),_0x42d255,_0x4b2a92[_0xed66('0x14')][_0xed66('0x16')]);return _0x796932(_0x4b2a92[_0xed66('0x14')]['message']);}else{logger['info'](_0xed66('0x10'),_0x42d255,_0xed66('0x11'));_0x796932(_0x4b2a92['result'][_0xed66('0x16')]);}})[_0xed66('0x17')](function(_0x2bc8bb){logger[_0xed66('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x42d255,_0x2bc8bb);_0x540075(_0x2bc8bb);});});}exports[_0xed66('0x18')]=function(_0xfb58bc){var _0x3537a0=this;return new Promise(function(_0x2cc960,_0x4d471e){return db[_0xed66('0x19')][_0xed66('0x1a')](_0xfb58bc[_0xed66('0x1b')],{'raw':_0xfb58bc['options']?_0xfb58bc[_0xed66('0x1c')][_0xed66('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x38bde2){logger[_0xed66('0x1e')]('CreateWhatsappMessage',_0xfb58bc);logger['debug']('CreateWhatsappMessage',_0xfb58bc,JSON['stringify'](_0x38bde2));_0x2cc960(_0x38bde2);})[_0xed66('0x17')](function(_0x3a99ac){logger[_0xed66('0x14')](_0xed66('0x18'),_0x3a99ac[_0xed66('0x16')],_0xfb58bc);_0x4d471e(_0x3537a0['error'](0x1f4,_0x3a99ac[_0xed66('0x16')]));});});}; \ No newline at end of file +var _0xff40=['result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x4026d1,_0x53f826){var _0x4f978e=function(_0x1dd9f){while(--_0x1dd9f){_0x4026d1['push'](_0x4026d1['shift']());}};_0x4f978e(++_0x53f826);}(_0xff40,0x1e8));var _0x0ff4=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0xff40[_0x3d4876];return _0x58ca9d;};'use strict';var _=require(_0x0ff4('0x0'));var util=require(_0x0ff4('0x1'));var moment=require(_0x0ff4('0x2'));var BPromise=require(_0x0ff4('0x3'));var rs=require(_0x0ff4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0ff4('0x5'))('rpc');var config=require(_0x0ff4('0x6'));var jayson=require(_0x0ff4('0x7'));var client=jayson[_0x0ff4('0x8')][_0x0ff4('0x9')]({'port':0x232a});config[_0x0ff4('0xa')]=_[_0x0ff4('0xb')](config[_0x0ff4('0xa')],{'host':_0x0ff4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0ff4('0xd'))['register'](socket);function respondWithRpcPromise(_0x21b21e,_0x529046,_0x518a5e){return new BPromise(function(_0x14eda1,_0x3ab849){return client[_0x0ff4('0xe')](_0x21b21e,_0x518a5e)[_0x0ff4('0xf')](function(_0x51edc9){logger['info'](_0x0ff4('0x10'),_0x529046,_0x0ff4('0x11'));logger[_0x0ff4('0x12')](_0x0ff4('0x13'),_0x529046,'request\x20sent',JSON[_0x0ff4('0x14')](_0x51edc9));if(_0x51edc9[_0x0ff4('0x15')]){if(_0x51edc9[_0x0ff4('0x15')]['code']===0x1f4){logger[_0x0ff4('0x15')](_0x0ff4('0x10'),_0x529046,_0x51edc9[_0x0ff4('0x15')][_0x0ff4('0x16')]);return _0x3ab849(_0x51edc9[_0x0ff4('0x15')][_0x0ff4('0x16')]);}logger[_0x0ff4('0x15')](_0x0ff4('0x10'),_0x529046,_0x51edc9['error'][_0x0ff4('0x16')]);return _0x14eda1(_0x51edc9[_0x0ff4('0x15')][_0x0ff4('0x16')]);}else{logger[_0x0ff4('0x17')](_0x0ff4('0x10'),_0x529046,_0x0ff4('0x11'));_0x14eda1(_0x51edc9[_0x0ff4('0x18')][_0x0ff4('0x16')]);}})[_0x0ff4('0x19')](function(_0x591f83){logger[_0x0ff4('0x15')](_0x0ff4('0x10'),_0x529046,_0x591f83);_0x3ab849(_0x591f83);});});}exports[_0x0ff4('0x1a')]=function(_0x3ea75c){var _0xae23e2=this;return new Promise(function(_0x3a1523,_0x4f6bfb){return db[_0x0ff4('0x1b')][_0x0ff4('0x1c')](_0x3ea75c[_0x0ff4('0x1d')],{'raw':_0x3ea75c[_0x0ff4('0x1e')]?_0x3ea75c[_0x0ff4('0x1e')][_0x0ff4('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x364661){logger['info'](_0x0ff4('0x1a'),_0x3ea75c);logger[_0x0ff4('0x12')](_0x0ff4('0x1a'),_0x3ea75c,JSON[_0x0ff4('0x14')](_0x364661));_0x3a1523(_0x364661);})[_0x0ff4('0x19')](function(_0x3f2281){logger[_0x0ff4('0x15')](_0x0ff4('0x1a'),_0x3f2281[_0x0ff4('0x16')],_0x3ea75c);_0x4f6bfb(_0xae23e2[_0x0ff4('0x15')](0x1f4,_0x3f2281['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 7c53d51..4f94327 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 _0x6da7=['removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x6da7,0x1e3));var _0x76da=function(_0x5461ee,_0x8c1fca){_0x5461ee=_0x5461ee-0x0;var _0x359590=_0x6da7[_0x5461ee];return _0x359590;};'use strict';var WhatsappMessageEvents=require(_0x76da('0x0'));var events=[_0x76da('0x1'),_0x76da('0x2'),_0x76da('0x3')];function createListener(_0x2c2c78,_0x2d9bd3){return function(_0x287b5c){_0x2d9bd3[_0x76da('0x4')](_0x2c2c78,_0x287b5c);};}function removeListener(_0x9020cd,_0x273b7f){return function(){WhatsappMessageEvents[_0x76da('0x5')](_0x9020cd,_0x273b7f);};}exports[_0x76da('0x6')]=function(_0xec1a87){for(var _0x347145=0x0,_0x4fc7ea=events['length'];_0x347145<_0x4fc7ea;_0x347145++){var _0x26de3c=events[_0x347145];var _0x6716a6=createListener(_0x76da('0x7')+_0x26de3c,_0xec1a87);WhatsappMessageEvents['on'](_0x26de3c,_0x6716a6);}}; \ No newline at end of file +var _0x356c=['whatsappMessage:','./whatsappMessage.events','save','remove','emit','removeListener','length'];(function(_0x3a0585,_0x12062b){var _0xbdc3fc=function(_0x38fba7){while(--_0x38fba7){_0x3a0585['push'](_0x3a0585['shift']());}};_0xbdc3fc(++_0x12062b);}(_0x356c,0x12e));var _0xc356=function(_0x325c3d,_0x115497){_0x325c3d=_0x325c3d-0x0;var _0x4b29a8=_0x356c[_0x325c3d];return _0x4b29a8;};'use strict';var WhatsappMessageEvents=require(_0xc356('0x0'));var events=[_0xc356('0x1'),_0xc356('0x2'),'update'];function createListener(_0x5c00f1,_0x587857){return function(_0x4744fc){_0x587857[_0xc356('0x3')](_0x5c00f1,_0x4744fc);};}function removeListener(_0x14a085,_0x112038){return function(){WhatsappMessageEvents[_0xc356('0x4')](_0x14a085,_0x112038);};}exports['register']=function(_0x1bcc75){for(var _0xb39de2=0x0,_0x5ab4c2=events[_0xc356('0x5')];_0xb39de2<_0x5ab4c2;_0xb39de2++){var _0x5771f4=events[_0xb39de2];var _0x39c802=createListener(_0xc356('0x6')+_0x5771f4,_0x1bcc75);WhatsappMessageEvents['on'](_0x5771f4,_0x39c802);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 29cbc1f..ab17b39 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 _0xd9aa=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueue.controller','isAuthenticated','index','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path'];(function(_0x231d76,_0x2da17b){var _0x44f7b6=function(_0x560d41){while(--_0x560d41){_0x231d76['push'](_0x231d76['shift']());}};_0x44f7b6(++_0x2da17b);}(_0xd9aa,0x93));var _0xad9a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xd9aa[_0x342baa];return _0x1208f3;};'use strict';var multer=require(_0xad9a('0x0'));var util=require(_0xad9a('0x1'));var path=require(_0xad9a('0x2'));var timeout=require(_0xad9a('0x3'));var express=require(_0xad9a('0x4'));var router=express[_0xad9a('0x5')]();var fs_extra=require(_0xad9a('0x6'));var auth=require(_0xad9a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xad9a('0x8'));router['get']('/',auth[_0xad9a('0x9')](),controller[_0xad9a('0xa')]);router[_0xad9a('0xb')]('/describe',auth[_0xad9a('0x9')](),controller[_0xad9a('0xc')]);router['get'](_0xad9a('0xd'),auth[_0xad9a('0x9')](),controller[_0xad9a('0xe')]);router[_0xad9a('0xb')](_0xad9a('0xf'),auth[_0xad9a('0x9')](),controller[_0xad9a('0x10')]);router[_0xad9a('0xb')](_0xad9a('0x11'),auth[_0xad9a('0x9')](),controller[_0xad9a('0x12')]);router['get'](_0xad9a('0x13'),auth[_0xad9a('0x9')](),controller[_0xad9a('0x14')]);router[_0xad9a('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0xad9a('0x15')](_0xad9a('0x11'),auth[_0xad9a('0x9')](),controller[_0xad9a('0x16')]);router[_0xad9a('0x15')](_0xad9a('0x13'),auth[_0xad9a('0x9')](),controller[_0xad9a('0x17')]);router[_0xad9a('0x18')](_0xad9a('0xd'),auth['isAuthenticated'](),controller[_0xad9a('0x19')]);router[_0xad9a('0x1a')](_0xad9a('0xd'),auth[_0xad9a('0x9')](),controller[_0xad9a('0x1b')]);router[_0xad9a('0x1a')]('/:id/teams',auth[_0xad9a('0x9')](),controller[_0xad9a('0x1c')]);router['delete']('/:id/users',auth[_0xad9a('0x9')](),controller[_0xad9a('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x5fa1=['destroy','removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','put','update','delete'];(function(_0x5aac9e,_0xef5692){var _0x31e5ae=function(_0x511320){while(--_0x511320){_0x5aac9e['push'](_0x5aac9e['shift']());}};_0x31e5ae(++_0xef5692);}(_0x5fa1,0xd2));var _0x15fa=function(_0x382b85,_0xd06d63){_0x382b85=_0x382b85-0x0;var _0x159644=_0x5fa1[_0x382b85];return _0x159644;};'use strict';var multer=require(_0x15fa('0x0'));var util=require(_0x15fa('0x1'));var path=require('path');var timeout=require(_0x15fa('0x2'));var express=require('express');var router=express[_0x15fa('0x3')]();var fs_extra=require(_0x15fa('0x4'));var auth=require(_0x15fa('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x15fa('0x6'));router[_0x15fa('0x7')]('/',auth[_0x15fa('0x8')](),controller[_0x15fa('0x9')]);router['get'](_0x15fa('0xa'),auth[_0x15fa('0x8')](),controller[_0x15fa('0xb')]);router['get'](_0x15fa('0xc'),auth[_0x15fa('0x8')](),controller['show']);router[_0x15fa('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0x15fa('0xd')]);router[_0x15fa('0x7')](_0x15fa('0xe'),auth[_0x15fa('0x8')](),controller[_0x15fa('0xf')]);router[_0x15fa('0x7')](_0x15fa('0x10'),auth['isAuthenticated'](),controller[_0x15fa('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x15fa('0x12')]);router[_0x15fa('0x13')](_0x15fa('0xe'),auth[_0x15fa('0x8')](),controller['addTeams']);router['post'](_0x15fa('0x10'),auth[_0x15fa('0x8')](),controller[_0x15fa('0x14')]);router[_0x15fa('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x15fa('0x16')]);router[_0x15fa('0x17')](_0x15fa('0xc'),auth['isAuthenticated'](),controller[_0x15fa('0x18')]);router['delete'](_0x15fa('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x15fa('0x17')](_0x15fa('0x10'),auth[_0x15fa('0x8')](),controller[_0x15fa('0x19')]);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 7780296..6593537 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 _0x2ceb=['sequelize','exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x51172d,_0x200cf2){var _0x52064d=function(_0xa3008f){while(--_0xa3008f){_0x51172d['push'](_0x51172d['shift']());}};_0x52064d(++_0x200cf2);}(_0x2ceb,0x110));var _0xb2ce=function(_0x42c991,_0x38f625){_0x42c991=_0x42c991-0x0;var _0x4ae2e1=_0x2ceb[_0x42c991];return _0x4ae2e1;};'use strict';var Sequelize=require(_0xb2ce('0x0'));module[_0xb2ce('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb2ce('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb2ce('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb2ce('0x4')](_0xb2ce('0x5'),_0xb2ce('0x6'),_0xb2ce('0x7'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc817=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x5e3f0a,_0x539b4d){var _0x2b5920=function(_0xd4e919){while(--_0xd4e919){_0x5e3f0a['push'](_0x5e3f0a['shift']());}};_0x2b5920(++_0x539b4d);}(_0xc817,0x75));var _0x7c81=function(_0x1893bd,_0xe39df5){_0x1893bd=_0x1893bd-0x0;var _0x217dcf=_0xc817[_0x1893bd];return _0x217dcf;};'use strict';var Sequelize=require(_0x7c81('0x0'));module[_0x7c81('0x1')]={'name':{'type':Sequelize[_0x7c81('0x2')],'unique':_0x7c81('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7c81('0x4')](_0x7c81('0x5'),_0x7c81('0x6'),_0x7c81('0x7'))},'description':{'type':Sequelize[_0x7c81('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 59c91d2..e8a81d9 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 _0x3b1c=['send','index','map','WhatsappQueue','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','params','length','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','create','error','describe','findOne','UserWhatsappQueue','rawAttributes','nolimit','sort','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','rows','format','%s/%s','updatedAt','getTeams','Team','options','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','stack','name'];(function(_0x125c41,_0x2d0822){var _0x41869c=function(_0x2fcf30){while(--_0x2fcf30){_0x125c41['push'](_0x125c41['shift']());}};_0x41869c(++_0x2d0822);}(_0x3b1c,0x17d));var _0xc3b1=function(_0x2860b2,_0x2a8915){_0x2860b2=_0x2860b2-0x0;var _0x48c52b=_0x3b1c[_0x2860b2];return _0x48c52b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3b1('0x0'));var zipdir=require(_0xc3b1('0x1'));var jsonpatch=require(_0xc3b1('0x2'));var rp=require(_0xc3b1('0x3'));var moment=require(_0xc3b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc3b1('0x5'));var util=require(_0xc3b1('0x6'));var path=require(_0xc3b1('0x7'));var sox=require(_0xc3b1('0x8'));var csv=require(_0xc3b1('0x9'));var ejs=require(_0xc3b1('0xa'));var fs=require('fs');var fs_extra=require(_0xc3b1('0xb'));var _=require(_0xc3b1('0xc'));var squel=require(_0xc3b1('0xd'));var crypto=require(_0xc3b1('0xe'));var jsforce=require(_0xc3b1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc3b1('0x9'));var querystring=require(_0xc3b1('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc3b1('0x11'));var qs=require(_0xc3b1('0x12'));var as=require(_0xc3b1('0x13'));var hardwareService=require(_0xc3b1('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc3b1('0x15'));var licenseUtil=require(_0xc3b1('0x16'));var db=require(_0xc3b1('0x17'))['db'];config[_0xc3b1('0x18')]=_[_0xc3b1('0x19')](config['redis'],{'host':_0xc3b1('0x1a'),'port':0x18eb});var socket=require(_0xc3b1('0x1b'))(new Redis(config[_0xc3b1('0x18')]));require(_0xc3b1('0x1c'))[_0xc3b1('0x1d')](socket);function respondWithStatusCode(_0x33229b,_0x382e8c){_0x382e8c=_0x382e8c||0xcc;return function(_0xf2a62e){if(_0xf2a62e){return _0x33229b[_0xc3b1('0x1e')](_0x382e8c);}return _0x33229b['status'](_0x382e8c)[_0xc3b1('0x1f')]();};}function respondWithResult(_0x3a568c,_0x304d22){_0x304d22=_0x304d22||0xc8;return function(_0x565910){if(_0x565910){return _0x3a568c[_0xc3b1('0x20')](_0x304d22)[_0xc3b1('0x21')](_0x565910);}};}function respondWithFilteredResult(_0x3bda9d,_0x954743){return function(_0x416d5f){if(_0x416d5f){var _0x21552c=typeof _0x954743['offset']==='undefined'&&typeof _0x954743[_0xc3b1('0x22')]==='undefined';var _0x4fb23c=_0x416d5f[_0xc3b1('0x23')];var _0x595b39=_0x21552c?0x0:_0x954743[_0xc3b1('0x24')];var _0x2f0688=_0x21552c?_0x416d5f[_0xc3b1('0x23')]:_0x954743[_0xc3b1('0x24')]+_0x954743[_0xc3b1('0x22')];var _0xf0af5c;if(_0x2f0688>=_0x4fb23c){_0x2f0688=_0x4fb23c;_0xf0af5c=0xc8;}else{_0xf0af5c=0xce;}_0x3bda9d[_0xc3b1('0x20')](_0xf0af5c);return _0x3bda9d[_0xc3b1('0x25')](_0xc3b1('0x26'),_0x595b39+'-'+_0x2f0688+'/'+_0x4fb23c)[_0xc3b1('0x21')](_0x416d5f);}return null;};}function patchUpdates(_0x2c5ef8){return function(_0x427482){try{jsonpatch[_0xc3b1('0x27')](_0x427482,_0x2c5ef8,!![]);}catch(_0x3d7f34){return BPromise[_0xc3b1('0x28')](_0x3d7f34);}return _0x427482[_0xc3b1('0x29')]();};}function saveUpdates(_0x3c5bca,_0x432e8c){return function(_0x1c04ef){if(_0x1c04ef){return _0x1c04ef[_0xc3b1('0x2a')](_0x3c5bca)['then'](function(_0x483149){return _0x483149;});}return null;};}function removeEntity(_0x19992f,_0xc0ab7e){return function(_0x4d0e9a){if(_0x4d0e9a){return _0x4d0e9a[_0xc3b1('0x2b')]()[_0xc3b1('0x2c')](function(){var _0x217a87=_0x4d0e9a['get']({'plain':!![]});var _0x4bfb81='WhatsappQueues';return db[_0xc3b1('0x2d')]['destroy']({'where':{'type':_0x4bfb81,'resourceId':_0x217a87['id']}})[_0xc3b1('0x2c')](function(){return _0x4d0e9a;});})['then'](function(){_0x19992f['status'](0xcc)[_0xc3b1('0x1f')]();});}};}function handleEntityNotFound(_0x48b065,_0x5afb0a){return function(_0x2fce8f){if(!_0x2fce8f){_0x48b065[_0xc3b1('0x1e')](0x194);}return _0x2fce8f;};}function handleError(_0x26e135,_0x42fb19){_0x42fb19=_0x42fb19||0x1f4;return function(_0x394c76){logger['error'](_0x394c76[_0xc3b1('0x2e')]);if(_0x394c76[_0xc3b1('0x2f')]){delete _0x394c76['name'];}_0x26e135[_0xc3b1('0x20')](_0x42fb19)[_0xc3b1('0x30')](_0x394c76);};}exports[_0xc3b1('0x31')]=function(_0x50c97c,_0x5c02ee){var _0x575f9b={},_0x1703c3={},_0xec5881={'count':0x0,'rows':[]};var _0x2959fc=_[_0xc3b1('0x32')](db[_0xc3b1('0x33')]['rawAttributes'],function(_0x5dfddf){return{'name':_0x5dfddf[_0xc3b1('0x34')],'type':_0x5dfddf[_0xc3b1('0x35')][_0xc3b1('0x36')]};});_0x1703c3['model']=_[_0xc3b1('0x32')](_0x2959fc,'name');_0x1703c3['query']=_[_0xc3b1('0x37')](_0x50c97c[_0xc3b1('0x38')]);_0x1703c3[_0xc3b1('0x39')]=_['intersection'](_0x1703c3['model'],_0x1703c3[_0xc3b1('0x38')]);_0x575f9b[_0xc3b1('0x3a')]=_[_0xc3b1('0x3b')](_0x1703c3[_0xc3b1('0x3c')],qs[_0xc3b1('0x3d')](_0x50c97c['query'][_0xc3b1('0x3d')]));_0x575f9b[_0xc3b1('0x3a')]=_0x575f9b[_0xc3b1('0x3a')]['length']?_0x575f9b[_0xc3b1('0x3a')]:_0x1703c3[_0xc3b1('0x3c')];if(!_0x50c97c[_0xc3b1('0x38')][_0xc3b1('0x3e')]('nolimit')){_0x575f9b[_0xc3b1('0x22')]=qs[_0xc3b1('0x22')](_0x50c97c['query']['limit']);_0x575f9b[_0xc3b1('0x24')]=qs[_0xc3b1('0x24')](_0x50c97c[_0xc3b1('0x38')]['offset']);}_0x575f9b['order']=qs['sort'](_0x50c97c[_0xc3b1('0x38')]['sort']);_0x575f9b[_0xc3b1('0x3f')]=qs[_0xc3b1('0x39')](_[_0xc3b1('0x40')](_0x50c97c[_0xc3b1('0x38')],_0x1703c3['filters']),_0x2959fc);if(_0x50c97c[_0xc3b1('0x38')][_0xc3b1('0x41')]){_0x575f9b[_0xc3b1('0x3f')]=_[_0xc3b1('0x42')](_0x575f9b[_0xc3b1('0x3f')],{'$or':_[_0xc3b1('0x32')](_0x2959fc,function(_0x344e53){if(_0x344e53['type']!==_0xc3b1('0x43')){var _0x55a93a={};_0x55a93a[_0x344e53['name']]={'$like':'%'+_0x50c97c[_0xc3b1('0x38')][_0xc3b1('0x41')]+'%'};return _0x55a93a;}})});}_0x575f9b=_['merge']({},_0x575f9b,_0x50c97c['options']);var _0x35bcbd={'where':_0x575f9b[_0xc3b1('0x3f')]};return db['WhatsappQueue'][_0xc3b1('0x23')](_0x35bcbd)[_0xc3b1('0x2c')](function(_0x26181a){_0xec5881[_0xc3b1('0x23')]=_0x26181a;if(_0x50c97c[_0xc3b1('0x38')][_0xc3b1('0x44')]){_0x575f9b[_0xc3b1('0x45')]=[{'all':!![]}];}return db[_0xc3b1('0x33')]['findAll'](_0x575f9b);})[_0xc3b1('0x2c')](function(_0x592ad7){_0xec5881['rows']=_0x592ad7;return _0xec5881;})[_0xc3b1('0x2c')](respondWithFilteredResult(_0x5c02ee,_0x575f9b))[_0xc3b1('0x46')](handleError(_0x5c02ee,null));};exports['show']=function(_0x54ad43,_0x3bc062){var _0x15d9a5={'raw':!![],'where':{'id':_0x54ad43[_0xc3b1('0x47')]['id']}},_0x1a2878={};_0x1a2878[_0xc3b1('0x3c')]=_[_0xc3b1('0x37')](db[_0xc3b1('0x33')]['rawAttributes']);_0x1a2878[_0xc3b1('0x38')]=_[_0xc3b1('0x37')](_0x54ad43[_0xc3b1('0x38')]);_0x1a2878[_0xc3b1('0x39')]=_[_0xc3b1('0x3b')](_0x1a2878[_0xc3b1('0x3c')],_0x1a2878[_0xc3b1('0x38')]);_0x15d9a5['attributes']=_[_0xc3b1('0x3b')](_0x1a2878[_0xc3b1('0x3c')],qs[_0xc3b1('0x3d')](_0x54ad43[_0xc3b1('0x38')][_0xc3b1('0x3d')]));_0x15d9a5[_0xc3b1('0x3a')]=_0x15d9a5[_0xc3b1('0x3a')][_0xc3b1('0x48')]?_0x15d9a5['attributes']:_0x1a2878[_0xc3b1('0x3c')];if(_0x54ad43[_0xc3b1('0x38')][_0xc3b1('0x44')]){_0x15d9a5[_0xc3b1('0x45')]=[{'all':!![]}];}_0x15d9a5=_[_0xc3b1('0x42')]({},_0x15d9a5,_0x54ad43['options']);return db[_0xc3b1('0x33')][_0xc3b1('0x49')](_0x15d9a5)[_0xc3b1('0x2c')](handleEntityNotFound(_0x3bc062,null))['then'](respondWithResult(_0x3bc062,null))[_0xc3b1('0x46')](handleError(_0x3bc062,null));};exports['create']=function(_0x1071be,_0x4f44a0){return db['WhatsappQueue']['create'](_0x1071be[_0xc3b1('0x4a')],{})['then'](function(_0x243fb3){var _0x2554f1=_0x1071be[_0xc3b1('0x4b')][_0xc3b1('0x4c')]({'plain':!![]});if(!_0x2554f1)throw new Error(_0xc3b1('0x4d'));if(_0x2554f1[_0xc3b1('0x4e')]===_0xc3b1('0x4b')){var _0x55f316=_0x243fb3[_0xc3b1('0x4c')]({'plain':!![]});var _0x179b73=_0xc3b1('0x4f');return db[_0xc3b1('0x50')][_0xc3b1('0x49')]({'where':{'name':_0x179b73,'userProfileId':_0x2554f1[_0xc3b1('0x51')]},'raw':!![]})[_0xc3b1('0x2c')](function(_0x9e59a3){if(_0x9e59a3&&_0x9e59a3[_0xc3b1('0x52')]===0x0){return db['UserProfileResource'][_0xc3b1('0x53')]({'name':_0x55f316[_0xc3b1('0x2f')],'resourceId':_0x55f316['id'],'type':_0x9e59a3[_0xc3b1('0x2f')],'sectionId':_0x9e59a3['id']},{})[_0xc3b1('0x2c')](function(){return _0x243fb3;});}else{return _0x243fb3;}})[_0xc3b1('0x46')](function(_0x555298){logger[_0xc3b1('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x555298);throw _0x555298;});}return _0x243fb3;})[_0xc3b1('0x2c')](respondWithResult(_0x4f44a0,0xc9))[_0xc3b1('0x46')](handleError(_0x4f44a0,null));};exports[_0xc3b1('0x2a')]=function(_0x42f595,_0x1873ac){if(_0x42f595[_0xc3b1('0x4a')]['id']){delete _0x42f595['body']['id'];}return db['WhatsappQueue'][_0xc3b1('0x49')]({'where':{'id':_0x42f595[_0xc3b1('0x47')]['id']}})[_0xc3b1('0x2c')](handleEntityNotFound(_0x1873ac,null))[_0xc3b1('0x2c')](saveUpdates(_0x42f595[_0xc3b1('0x4a')],null))['then'](respondWithResult(_0x1873ac,null))[_0xc3b1('0x46')](handleError(_0x1873ac,null));};exports[_0xc3b1('0x2b')]=function(_0x10a3f8,_0x5844ef){return db[_0xc3b1('0x33')][_0xc3b1('0x49')]({'where':{'id':_0x10a3f8['params']['id']}})['then'](handleEntityNotFound(_0x5844ef,null))['then'](removeEntity(_0x5844ef,null))['catch'](handleError(_0x5844ef,null));};exports['describe']=function(_0x2405be,_0x32ee02){return db['WhatsappQueue'][_0xc3b1('0x55')]()['then'](respondWithResult(_0x32ee02,null))[_0xc3b1('0x46')](handleError(_0x32ee02,null));};exports['getMembers']=function(_0x203c12,_0x365b25,_0x48cf3d){var _0x308fe0={'raw':!![],'where':{}},_0x1646bf={},_0x28dfdf;return db['WhatsappQueue'][_0xc3b1('0x56')]({'where':{'id':_0x203c12[_0xc3b1('0x47')]['id']}})[_0xc3b1('0x2c')](handleEntityNotFound(_0x365b25,null))[_0xc3b1('0x2c')](function(_0x59d6b3){if(_0x59d6b3){_0x28dfdf=_0x59d6b3[_0xc3b1('0x4c')]({'plain':!![]});_0x1646bf[_0xc3b1('0x3c')]=_[_0xc3b1('0x37')](db[_0xc3b1('0x57')][_0xc3b1('0x58')]);_0x1646bf[_0xc3b1('0x38')]=_[_0xc3b1('0x37')](_0x203c12[_0xc3b1('0x38')]);_0x1646bf[_0xc3b1('0x39')]=_[_0xc3b1('0x3b')](_0x1646bf[_0xc3b1('0x3c')],_0x1646bf[_0xc3b1('0x38')]);_0x308fe0[_0xc3b1('0x3a')]=_[_0xc3b1('0x3b')](_0x1646bf['model'],qs['fields'](_0x203c12['query'][_0xc3b1('0x3d')]));_0x308fe0[_0xc3b1('0x3a')]=_0x308fe0[_0xc3b1('0x3a')][_0xc3b1('0x48')]?_0x308fe0[_0xc3b1('0x3a')]:_0x1646bf[_0xc3b1('0x3c')];if(!_0x203c12['query'][_0xc3b1('0x3e')](_0xc3b1('0x59'))){_0x308fe0[_0xc3b1('0x22')]=qs[_0xc3b1('0x22')](_0x203c12[_0xc3b1('0x38')][_0xc3b1('0x22')]);_0x308fe0['offset']=qs[_0xc3b1('0x24')](_0x203c12[_0xc3b1('0x38')][_0xc3b1('0x24')]);}_0x308fe0['order']=qs[_0xc3b1('0x5a')](_0x203c12[_0xc3b1('0x38')]['sort']);_0x308fe0['where']=qs[_0xc3b1('0x39')](_[_0xc3b1('0x40')](_0x203c12[_0xc3b1('0x38')],_0x1646bf[_0xc3b1('0x39')]));_0x308fe0[_0xc3b1('0x3f')][_0xc3b1('0x5b')]=_0x59d6b3['id'];if(_0x203c12[_0xc3b1('0x38')]['filter']){_0x308fe0[_0xc3b1('0x3f')]=_[_0xc3b1('0x42')](_0x308fe0[_0xc3b1('0x3f')],{'$or':_[_0xc3b1('0x32')](_0x308fe0[_0xc3b1('0x3a')],function(_0x22e608){var _0xde48ec={};_0xde48ec[_0x22e608]={'$like':'%'+_0x203c12[_0xc3b1('0x38')][_0xc3b1('0x41')]+'%'};return _0xde48ec;})});}_0x308fe0=_['merge']({},_0x308fe0,_0x203c12['options']);return db[_0xc3b1('0x57')]['findAll'](_0x308fe0);}})['then'](function(_0x275e22){if(_0x275e22){return db[_0xc3b1('0x5c')][_0xc3b1('0x5d')]({'where':{'id':_[_0xc3b1('0x32')](_0x275e22,_0xc3b1('0x5e')),'role':_0xc3b1('0x5f')},'attributes':['id',_0xc3b1('0x2f'),_0xc3b1('0x60'),'updatedAt',_0xc3b1('0x61')]});}})['then'](function(_0x10044a){if(_0x10044a){return{'count':_0x10044a[_0xc3b1('0x23')],'rows':_[_0xc3b1('0x32')](_0x10044a[_0xc3b1('0x62')],function(_0x5a83ca){return{'membername':_0x5a83ca[_0xc3b1('0x2f')],'UserId':_0x5a83ca['id'],'queue_name':_0x28dfdf['name'],'WhatsappQueueId':_0x28dfdf['id'],'interface':util[_0xc3b1('0x63')](_0xc3b1('0x64'),'SIP',_0x5a83ca[_0xc3b1('0x2f')]),'penalty':0x0,'paused':_0x5a83ca[_0xc3b1('0x60')],'createdAt':_0x5a83ca[_0xc3b1('0x61')],'updatedAt':_0x5a83ca[_0xc3b1('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc3b1('0x2c')](respondWithFilteredResult(_0x365b25,_0x308fe0))['catch'](handleError(_0x365b25,null));};exports[_0xc3b1('0x66')]=function(_0x52fe9b,_0x815d30,_0x3f3e9f){var _0x18325f={};var _0x3a8146={};var _0x378ef8;var _0x148ab4;return db[_0xc3b1('0x33')]['findOne']({'where':{'id':_0x52fe9b['params']['id']}})[_0xc3b1('0x2c')](handleEntityNotFound(_0x815d30,null))[_0xc3b1('0x2c')](function(_0x2b6168){if(_0x2b6168){_0x378ef8=_0x2b6168;_0x3a8146[_0xc3b1('0x3c')]=_[_0xc3b1('0x37')](db[_0xc3b1('0x67')]['rawAttributes']);_0x3a8146[_0xc3b1('0x38')]=_[_0xc3b1('0x37')](_0x52fe9b[_0xc3b1('0x38')]);_0x3a8146[_0xc3b1('0x39')]=_[_0xc3b1('0x3b')](_0x3a8146[_0xc3b1('0x3c')],_0x3a8146[_0xc3b1('0x38')]);_0x18325f[_0xc3b1('0x3a')]=_[_0xc3b1('0x3b')](_0x3a8146['model'],qs[_0xc3b1('0x3d')](_0x52fe9b['query']['fields']));_0x18325f['attributes']=_0x18325f[_0xc3b1('0x3a')][_0xc3b1('0x48')]?_0x18325f[_0xc3b1('0x3a')]:_0x3a8146[_0xc3b1('0x3c')];_0x18325f['order']=qs[_0xc3b1('0x5a')](_0x52fe9b['query'][_0xc3b1('0x5a')]);_0x18325f[_0xc3b1('0x3f')]=qs['filters'](_[_0xc3b1('0x40')](_0x52fe9b[_0xc3b1('0x38')],_0x3a8146[_0xc3b1('0x39')]));if(_0x52fe9b[_0xc3b1('0x38')]['filter']){_0x18325f[_0xc3b1('0x3f')]=_['merge'](_0x18325f['where'],{'$or':_[_0xc3b1('0x32')](_0x18325f['attributes'],function(_0x53d444){var _0x1af8c3={};_0x1af8c3[_0x53d444]={'$like':'%'+_0x52fe9b[_0xc3b1('0x38')]['filter']+'%'};return _0x1af8c3;})});}_0x18325f=_['merge']({},_0x18325f,_0x52fe9b[_0xc3b1('0x68')]);return _0x378ef8[_0xc3b1('0x66')](_0x18325f);}})['then'](function(_0x94c16a){if(_0x94c16a){_0x148ab4=_0x94c16a[_0xc3b1('0x48')];if(!_0x52fe9b['query'][_0xc3b1('0x3e')]('nolimit')){_0x18325f['limit']=qs[_0xc3b1('0x22')](_0x52fe9b[_0xc3b1('0x38')][_0xc3b1('0x22')]);_0x18325f[_0xc3b1('0x24')]=qs[_0xc3b1('0x24')](_0x52fe9b[_0xc3b1('0x38')]['offset']);}return _0x378ef8[_0xc3b1('0x66')](_0x18325f);}})[_0xc3b1('0x2c')](function(_0x57a83c){if(_0x57a83c){return _0x57a83c?{'count':_0x148ab4,'rows':_0x57a83c}:null;}})[_0xc3b1('0x2c')](respondWithResult(_0x815d30,null))[_0xc3b1('0x46')](handleError(_0x815d30,null));};exports['addTeams']=function(_0x23dbef,_0x5e06cf,_0x31b68d){var _0x48f3e8=_0x23dbef[_0xc3b1('0x4a')][_0xc3b1('0x69')];return db['Team'][_0xc3b1('0x6a')]({'where':{'id':_0x48f3e8},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc3b1('0x6b'),'attributes':['id',_0xc3b1('0x2f'),_0xc3b1('0x6c'),_0xc3b1('0x6d'),_0xc3b1('0x6e')],'raw':!![]}]})[_0xc3b1('0x2c')](function(_0x354bd2){if(_0x354bd2){var _0xc1ceaa=_[_0xc3b1('0x6f')](_0x354bd2,function(_0x3a45a4){var _0x34e819=_0x3a45a4[_0xc3b1('0x4c')]({'plain':!![]});return _0x34e819[_0xc3b1('0x6b')];});return db[_0xc3b1('0x33')][_0xc3b1('0x49')]({'where':{'id':_0x23dbef[_0xc3b1('0x47')]['id']}})[_0xc3b1('0x2c')](function(_0x5871fa){return db[_0xc3b1('0x70')][_0xc3b1('0x71')](function(_0x8d591){return _0x5871fa['addTeams'](_0x48f3e8,{'transaction':_0x8d591})[_0xc3b1('0x2c')](function(){return BPromise[_0xc3b1('0x72')](_0xc1ceaa,function(_0x291b94){return db['UserWhatsappQueue'][_0xc3b1('0x73')]({'where':{'UserId':_0x291b94['id'],'WhatsappQueueId':_0x23dbef['params']['id']},'transaction':_0x8d591});});})[_0xc3b1('0x2c')](function(){_0xc1ceaa[_0xc3b1('0x74')](function(_0x1de8f6){socket[_0xc3b1('0x75')](_0xc3b1('0x76'),{'UserId':_0x1de8f6['id'],'WhatsappQueueId':_0x5871fa['id']});});});});});}})[_0xc3b1('0x2c')](respondWithStatusCode(_0x5e06cf,null))[_0xc3b1('0x46')](handleError(_0x5e06cf,null));};exports[_0xc3b1('0x77')]=function(_0x579809,_0x561378,_0x365c9d){return db[_0xc3b1('0x67')]['findAll']({'where':{'id':_0x579809[_0xc3b1('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc3b1('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x561378,null))[_0xc3b1('0x2c')](function(_0x373797){var _0x42d7e7=_[_0xc3b1('0x32')](_0x373797,'id');var _0xb50962=[];var _0x1b8b61=[];var _0x192eb2=squel['select']();_0x192eb2['field'](_0xc3b1('0x78'))[_0xc3b1('0x79')](_0xc3b1('0x7a'),'tq')['join'](_0xc3b1('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc3b1('0x3f')](_0xc3b1('0x7c'),_0x579809[_0xc3b1('0x47')]['id']);for(var _0x5ecfec=0x0;_0x5ecfec<_0x373797['length'];_0x5ecfec+=0x1){let _0x5b2b71=_0x373797[_0x5ecfec];for(var _0x3e0103=0x0;_0x3e0103<_0x5b2b71[_0xc3b1('0x6b')][_0xc3b1('0x48')];_0x3e0103+=0x1){let _0x406a90=_0x5b2b71[_0xc3b1('0x6b')][_0x3e0103];var _0xb2c048=_0x192eb2[_0xc3b1('0x7d')]();_0xb2c048[_0xc3b1('0x3f')](_0xc3b1('0x7e'),_0x406a90['id']);_0x1b8b61[_0xc3b1('0x7f')](db[_0xc3b1('0x70')]['query'](_0xb2c048[_0xc3b1('0x80')](),{'type':db[_0xc3b1('0x70')][_0xc3b1('0x81')][_0xc3b1('0x82')]})[_0xc3b1('0x2c')](function(_0x54caff){if(_0x54caff[_0xc3b1('0x48')]===0x1){return _0x406a90['id'];}else{var _0x4a639d=_[_0xc3b1('0x83')](_[_0xc3b1('0x32')](_0x54caff,'TeamId'),function(_0x379e69){return _[_0xc3b1('0x84')](_0x42d7e7,_0x379e69);});if(_0x4a639d){return _0x406a90['id'];}}}));}}return BPromise[_0xc3b1('0x85')](_0x1b8b61)[_0xc3b1('0x2c')](function(_0x281f95){_0xb50962=_(_0xb50962)[_0xc3b1('0x86')](_0x281f95)[_0xc3b1('0x87')]()[_0xc3b1('0x88')]();return db[_0xc3b1('0x33')][_0xc3b1('0x49')]({'where':{'id':_0x579809[_0xc3b1('0x47')]['id']}})['then'](function(_0x43a70b){return db[_0xc3b1('0x70')]['transaction'](function(_0x49bd66){return _0x43a70b[_0xc3b1('0x77')](_0x579809['query']['ids'],{'transaction':_0x49bd66})[_0xc3b1('0x2c')](function(){if(!_[_0xc3b1('0x89')](_0xb50962)){return _0x43a70b[_0xc3b1('0x8a')](_0xb50962,{'transaction':_0x49bd66});}})['then'](function(){_0xb50962[_0xc3b1('0x74')](function(_0x7255c){socket[_0xc3b1('0x75')]('userWhatsappQueue:remove',{'UserId':_0x7255c,'WhatsappQueueId':_0x43a70b['id']});});});});});});})['then'](respondWithStatusCode(_0x561378,null))[_0xc3b1('0x46')](handleError(_0x561378,null));};exports[_0xc3b1('0x8b')]=function(_0xb6bff1,_0x5b7d51,_0x3c53e5){return db[_0xc3b1('0x33')][_0xc3b1('0x49')]({'where':{'id':_0xb6bff1[_0xc3b1('0x47')]['id']}})[_0xc3b1('0x2c')](handleEntityNotFound(_0x5b7d51,null))[_0xc3b1('0x2c')](function(_0x11665a){if(_0x11665a){return _0x11665a['addAgents'](_0xb6bff1[_0xc3b1('0x4a')]['ids'],_[_0xc3b1('0x8c')](_0xb6bff1[_0xc3b1('0x4a')],['ids','id'])||{})[_0xc3b1('0x8d')](function(_0x58b380){for(var _0x3935bb=0x0;_0x3935bb<_0xb6bff1[_0xc3b1('0x4a')][_0xc3b1('0x69')][_0xc3b1('0x48')];_0x3935bb+=0x1){socket['emit'](_0xc3b1('0x76'),{'UserId':Number(_0xb6bff1['body'][_0xc3b1('0x69')][_0x3935bb]),'WhatsappQueueId':Number(_0xb6bff1[_0xc3b1('0x47')]['id'])});}return _0x58b380;});}})[_0xc3b1('0x2c')](respondWithResult(_0x5b7d51,null))[_0xc3b1('0x46')](handleError(_0x5b7d51,null));};exports[_0xc3b1('0x8a')]=function(_0xa752c7,_0x45e5a8,_0x25e2d0){return db[_0xc3b1('0x33')][_0xc3b1('0x49')]({'where':{'id':_0xa752c7['params']['id']}})['then'](handleEntityNotFound(_0x45e5a8,null))[_0xc3b1('0x2c')](function(_0x4d3466){if(_0x4d3466){return _0x4d3466[_0xc3b1('0x8a')](_0xa752c7[_0xc3b1('0x38')][_0xc3b1('0x69')])['then'](function(){if(_['isArray'](_0xa752c7[_0xc3b1('0x38')][_0xc3b1('0x69')])){for(var _0x5e16e3=0x0;_0x5e16e3<_0xa752c7[_0xc3b1('0x38')][_0xc3b1('0x69')][_0xc3b1('0x48')];_0x5e16e3+=0x1){socket[_0xc3b1('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0xa752c7['query'][_0xc3b1('0x69')][_0x5e16e3]),'WhatsappQueueId':Number(_0xa752c7[_0xc3b1('0x47')]['id'])});}}else{socket[_0xc3b1('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0xa752c7[_0xc3b1('0x38')][_0xc3b1('0x69')]),'WhatsappQueueId':Number(_0xa752c7[_0xc3b1('0x47')]['id'])});}});}})[_0xc3b1('0x2c')](respondWithStatusCode(_0x45e5a8,null))['catch'](handleError(_0x45e5a8,null));};exports['getAgents']=function(_0x3bbea2,_0x5bf487,_0x34d70c){var _0x2fec9c={};var _0x2bf5cc={};var _0xdb641a;var _0x11c97e;return db[_0xc3b1('0x33')]['findOne']({'where':{'id':_0x3bbea2[_0xc3b1('0x47')]['id']}})[_0xc3b1('0x2c')](handleEntityNotFound(_0x5bf487,null))['then'](function(_0x4c6dd2){if(_0x4c6dd2){_0xdb641a=_0x4c6dd2;_0x2bf5cc[_0xc3b1('0x3c')]=_[_0xc3b1('0x37')](db['User'][_0xc3b1('0x58')]);_0x2bf5cc['query']=_[_0xc3b1('0x37')](_0x3bbea2[_0xc3b1('0x38')]);_0x2bf5cc[_0xc3b1('0x39')]=_[_0xc3b1('0x3b')](_0x2bf5cc[_0xc3b1('0x3c')],_0x2bf5cc['query']);_0x2fec9c[_0xc3b1('0x3a')]=_['intersection'](_0x2bf5cc['model'],qs[_0xc3b1('0x3d')](_0x3bbea2[_0xc3b1('0x38')][_0xc3b1('0x3d')]));_0x2fec9c[_0xc3b1('0x3a')]=_0x2fec9c[_0xc3b1('0x3a')][_0xc3b1('0x48')]?_0x2fec9c[_0xc3b1('0x3a')]:_0x2bf5cc['model'];_0x2fec9c['order']=qs[_0xc3b1('0x5a')](_0x3bbea2[_0xc3b1('0x38')][_0xc3b1('0x5a')]);_0x2fec9c[_0xc3b1('0x3f')]=qs[_0xc3b1('0x39')](_[_0xc3b1('0x40')](_0x3bbea2[_0xc3b1('0x38')],_0x2bf5cc[_0xc3b1('0x39')]));if(_0x3bbea2[_0xc3b1('0x38')][_0xc3b1('0x41')]){_0x2fec9c['where']=_[_0xc3b1('0x42')](_0x2fec9c['where'],{'$or':_['map'](_0x2fec9c[_0xc3b1('0x3a')],function(_0x1ed1d5){var _0x44d48e={};_0x44d48e[_0x1ed1d5]={'$like':'%'+_0x3bbea2['query']['filter']+'%'};return _0x44d48e;})});}_0x2fec9c=_[_0xc3b1('0x42')]({},_0x2fec9c,_0x3bbea2[_0xc3b1('0x68')]);return _0xdb641a[_0xc3b1('0x8e')](_0x2fec9c);}})['then'](function(_0x73360){if(_0x73360){_0x11c97e=_0x73360[_0xc3b1('0x48')];if(!_0x3bbea2[_0xc3b1('0x38')][_0xc3b1('0x3e')](_0xc3b1('0x59'))){_0x2fec9c[_0xc3b1('0x22')]=qs[_0xc3b1('0x22')](_0x3bbea2[_0xc3b1('0x38')][_0xc3b1('0x22')]);_0x2fec9c['offset']=qs[_0xc3b1('0x24')](_0x3bbea2[_0xc3b1('0x38')][_0xc3b1('0x24')]);}return _0xdb641a[_0xc3b1('0x8e')](_0x2fec9c);}})[_0xc3b1('0x2c')](function(_0x203f56){if(_0x203f56){return _0x203f56?{'count':_0x11c97e,'rows':_0x203f56}:null;}})[_0xc3b1('0x2c')](respondWithResult(_0x5bf487,null))[_0xc3b1('0x46')](handleError(_0x5bf487,null));}; \ No newline at end of file +var _0x05f5=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','order','sort','pick','filter','merge','where','includeAll','findAll','rows','show','keys','include','options','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','params','describe','UserWhatsappQueue','hasOwnProperty','nolimit','WhatsappQueueId','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','field','from','team_has_whatsapp_queues','WhatsappQueueId\x20=\x20?','clone','push','toString','SELECT','every','includes','union','compact','value','removeTeams','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','removeAgents','isArray','getAgents'];(function(_0x765a4a,_0x207b49){var _0x442283=function(_0xcfebe){while(--_0xcfebe){_0x765a4a['push'](_0x765a4a['shift']());}};_0x442283(++_0x207b49);}(_0x05f5,0x8c));var _0x505f=function(_0x45c981,_0x2ad2d4){_0x45c981=_0x45c981-0x0;var _0x4f62c8=_0x05f5[_0x45c981];return _0x4f62c8;};'use strict';var emlformat=require(_0x505f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x505f('0x1'));var jsonpatch=require(_0x505f('0x2'));var rp=require(_0x505f('0x3'));var moment=require(_0x505f('0x4'));var BPromise=require(_0x505f('0x5'));var Mustache=require(_0x505f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x505f('0x7'));var csv=require(_0x505f('0x8'));var ejs=require(_0x505f('0x9'));var fs=require('fs');var fs_extra=require(_0x505f('0xa'));var _=require(_0x505f('0xb'));var squel=require('squel');var crypto=require(_0x505f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x505f('0xd'));var toCsv=require(_0x505f('0x8'));var querystring=require(_0x505f('0xe'));var Papa=require(_0x505f('0xf'));var Redis=require(_0x505f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x505f('0x11'));var hardwareService=require(_0x505f('0x12'));var logger=require(_0x505f('0x13'))(_0x505f('0x14'));var utils=require(_0x505f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x505f('0x16'));var db=require(_0x505f('0x17'))['db'];config[_0x505f('0x18')]=_[_0x505f('0x19')](config[_0x505f('0x18')],{'host':_0x505f('0x1a'),'port':0x18eb});var socket=require(_0x505f('0x1b'))(new Redis(config[_0x505f('0x18')]));require(_0x505f('0x1c'))[_0x505f('0x1d')](socket);function respondWithStatusCode(_0x57a773,_0x10981e){_0x10981e=_0x10981e||0xcc;return function(_0xa28a9c){if(_0xa28a9c){return _0x57a773[_0x505f('0x1e')](_0x10981e);}return _0x57a773[_0x505f('0x1f')](_0x10981e)[_0x505f('0x20')]();};}function respondWithResult(_0x457625,_0x505f23){_0x505f23=_0x505f23||0xc8;return function(_0x5ab5d3){if(_0x5ab5d3){return _0x457625['status'](_0x505f23)[_0x505f('0x21')](_0x5ab5d3);}};}function respondWithFilteredResult(_0x3285bf,_0x4858f3){return function(_0x526751){if(_0x526751){var _0x1ff06f=typeof _0x4858f3[_0x505f('0x22')]===_0x505f('0x23')&&typeof _0x4858f3[_0x505f('0x24')]===_0x505f('0x23');var _0x4dfbb8=_0x526751[_0x505f('0x25')];var _0x49d4d6=_0x1ff06f?0x0:_0x4858f3[_0x505f('0x22')];var _0x2b99ed=_0x1ff06f?_0x526751[_0x505f('0x25')]:_0x4858f3[_0x505f('0x22')]+_0x4858f3['limit'];var _0x1900df;if(_0x2b99ed>=_0x4dfbb8){_0x2b99ed=_0x4dfbb8;_0x1900df=0xc8;}else{_0x1900df=0xce;}_0x3285bf[_0x505f('0x1f')](_0x1900df);return _0x3285bf[_0x505f('0x26')](_0x505f('0x27'),_0x49d4d6+'-'+_0x2b99ed+'/'+_0x4dfbb8)['json'](_0x526751);}return null;};}function patchUpdates(_0x62c184){return function(_0x1ad525){try{jsonpatch[_0x505f('0x28')](_0x1ad525,_0x62c184,!![]);}catch(_0xc1c628){return BPromise[_0x505f('0x29')](_0xc1c628);}return _0x1ad525['save']();};}function saveUpdates(_0x586856,_0x416e84){return function(_0x480fb1){if(_0x480fb1){return _0x480fb1[_0x505f('0x2a')](_0x586856)[_0x505f('0x2b')](function(_0x44dd65){return _0x44dd65;});}return null;};}function removeEntity(_0x5a3455,_0x558858){return function(_0x32a270){if(_0x32a270){return _0x32a270[_0x505f('0x2c')]()[_0x505f('0x2b')](function(){var _0x454f21=_0x32a270[_0x505f('0x2d')]({'plain':!![]});var _0x361210='WhatsappQueues';return db['UserProfileResource'][_0x505f('0x2c')]({'where':{'type':_0x361210,'resourceId':_0x454f21['id']}})[_0x505f('0x2b')](function(){return _0x32a270;});})[_0x505f('0x2b')](function(){_0x5a3455['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa79180,_0x45b334){return function(_0x3b2862){if(!_0x3b2862){_0xa79180['sendStatus'](0x194);}return _0x3b2862;};}function handleError(_0x5b36b8,_0xb1a4c9){_0xb1a4c9=_0xb1a4c9||0x1f4;return function(_0x5259e8){logger[_0x505f('0x2e')](_0x5259e8[_0x505f('0x2f')]);if(_0x5259e8[_0x505f('0x30')]){delete _0x5259e8['name'];}_0x5b36b8[_0x505f('0x1f')](_0xb1a4c9)[_0x505f('0x31')](_0x5259e8);};}exports[_0x505f('0x32')]=function(_0x1d64a8,_0xb65d0f){var _0x1617e3={},_0x5d7bca={},_0x2a2be1={'count':0x0,'rows':[]};var _0x1e3dcd=_[_0x505f('0x33')](db[_0x505f('0x34')][_0x505f('0x35')],function(_0x1a46a9){return{'name':_0x1a46a9[_0x505f('0x36')],'type':_0x1a46a9[_0x505f('0x37')][_0x505f('0x38')]};});_0x5d7bca[_0x505f('0x39')]=_[_0x505f('0x33')](_0x1e3dcd,_0x505f('0x30'));_0x5d7bca[_0x505f('0x3a')]=_['keys'](_0x1d64a8['query']);_0x5d7bca[_0x505f('0x3b')]=_[_0x505f('0x3c')](_0x5d7bca[_0x505f('0x39')],_0x5d7bca[_0x505f('0x3a')]);_0x1617e3['attributes']=_[_0x505f('0x3c')](_0x5d7bca['model'],qs['fields'](_0x1d64a8['query'][_0x505f('0x3d')]));_0x1617e3[_0x505f('0x3e')]=_0x1617e3[_0x505f('0x3e')][_0x505f('0x3f')]?_0x1617e3[_0x505f('0x3e')]:_0x5d7bca[_0x505f('0x39')];if(!_0x1d64a8[_0x505f('0x3a')]['hasOwnProperty']('nolimit')){_0x1617e3[_0x505f('0x24')]=qs[_0x505f('0x24')](_0x1d64a8[_0x505f('0x3a')][_0x505f('0x24')]);_0x1617e3[_0x505f('0x22')]=qs[_0x505f('0x22')](_0x1d64a8[_0x505f('0x3a')][_0x505f('0x22')]);}_0x1617e3[_0x505f('0x40')]=qs[_0x505f('0x41')](_0x1d64a8[_0x505f('0x3a')]['sort']);_0x1617e3['where']=qs['filters'](_[_0x505f('0x42')](_0x1d64a8[_0x505f('0x3a')],_0x5d7bca[_0x505f('0x3b')]),_0x1e3dcd);if(_0x1d64a8[_0x505f('0x3a')][_0x505f('0x43')]){_0x1617e3['where']=_[_0x505f('0x44')](_0x1617e3[_0x505f('0x45')],{'$or':_[_0x505f('0x33')](_0x1e3dcd,function(_0x513908){if(_0x513908['type']!=='VIRTUAL'){var _0x276b16={};_0x276b16[_0x513908[_0x505f('0x30')]]={'$like':'%'+_0x1d64a8['query'][_0x505f('0x43')]+'%'};return _0x276b16;}})});}_0x1617e3=_['merge']({},_0x1617e3,_0x1d64a8['options']);var _0x270fec={'where':_0x1617e3[_0x505f('0x45')]};return db[_0x505f('0x34')][_0x505f('0x25')](_0x270fec)['then'](function(_0x4feb44){_0x2a2be1['count']=_0x4feb44;if(_0x1d64a8['query'][_0x505f('0x46')]){_0x1617e3['include']=[{'all':!![]}];}return db[_0x505f('0x34')][_0x505f('0x47')](_0x1617e3);})['then'](function(_0x1cc5b0){_0x2a2be1[_0x505f('0x48')]=_0x1cc5b0;return _0x2a2be1;})[_0x505f('0x2b')](respondWithFilteredResult(_0xb65d0f,_0x1617e3))['catch'](handleError(_0xb65d0f,null));};exports[_0x505f('0x49')]=function(_0xf9de77,_0x5e08a9){var _0x501b5e={'raw':!![],'where':{'id':_0xf9de77['params']['id']}},_0x10d741={};_0x10d741[_0x505f('0x39')]=_[_0x505f('0x4a')](db[_0x505f('0x34')]['rawAttributes']);_0x10d741[_0x505f('0x3a')]=_['keys'](_0xf9de77[_0x505f('0x3a')]);_0x10d741[_0x505f('0x3b')]=_[_0x505f('0x3c')](_0x10d741[_0x505f('0x39')],_0x10d741[_0x505f('0x3a')]);_0x501b5e[_0x505f('0x3e')]=_[_0x505f('0x3c')](_0x10d741[_0x505f('0x39')],qs[_0x505f('0x3d')](_0xf9de77[_0x505f('0x3a')]['fields']));_0x501b5e[_0x505f('0x3e')]=_0x501b5e[_0x505f('0x3e')][_0x505f('0x3f')]?_0x501b5e[_0x505f('0x3e')]:_0x10d741['model'];if(_0xf9de77[_0x505f('0x3a')][_0x505f('0x46')]){_0x501b5e[_0x505f('0x4b')]=[{'all':!![]}];}_0x501b5e=_[_0x505f('0x44')]({},_0x501b5e,_0xf9de77[_0x505f('0x4c')]);return db[_0x505f('0x34')][_0x505f('0x4d')](_0x501b5e)[_0x505f('0x2b')](handleEntityNotFound(_0x5e08a9,null))[_0x505f('0x2b')](respondWithResult(_0x5e08a9,null))[_0x505f('0x4e')](handleError(_0x5e08a9,null));};exports[_0x505f('0x4f')]=function(_0x462fc2,_0x5b53c3){return db[_0x505f('0x34')][_0x505f('0x4f')](_0x462fc2[_0x505f('0x50')],{})[_0x505f('0x2b')](function(_0x8bcf7b){var _0xa38ad7=_0x462fc2[_0x505f('0x51')][_0x505f('0x2d')]({'plain':!![]});if(!_0xa38ad7)throw new Error(_0x505f('0x52'));if(_0xa38ad7[_0x505f('0x53')]===_0x505f('0x51')){var _0x4b0ba5=_0x8bcf7b[_0x505f('0x2d')]({'plain':!![]});var _0x26de0a='WhatsappQueues';return db[_0x505f('0x54')][_0x505f('0x4d')]({'where':{'name':_0x26de0a,'userProfileId':_0xa38ad7['userProfileId']},'raw':!![]})[_0x505f('0x2b')](function(_0x1c5407){if(_0x1c5407&&_0x1c5407[_0x505f('0x55')]===0x0){return db['UserProfileResource'][_0x505f('0x4f')]({'name':_0x4b0ba5[_0x505f('0x30')],'resourceId':_0x4b0ba5['id'],'type':_0x1c5407[_0x505f('0x30')],'sectionId':_0x1c5407['id']},{})[_0x505f('0x2b')](function(){return _0x8bcf7b;});}else{return _0x8bcf7b;}})[_0x505f('0x4e')](function(_0x7cedda){logger[_0x505f('0x2e')](_0x505f('0x56'),_0x7cedda);throw _0x7cedda;});}return _0x8bcf7b;})[_0x505f('0x2b')](respondWithResult(_0x5b53c3,0xc9))['catch'](handleError(_0x5b53c3,null));};exports['update']=function(_0x5c49f5,_0x3d29fc){if(_0x5c49f5[_0x505f('0x50')]['id']){delete _0x5c49f5[_0x505f('0x50')]['id'];}return db[_0x505f('0x34')][_0x505f('0x4d')]({'where':{'id':_0x5c49f5[_0x505f('0x57')]['id']}})[_0x505f('0x2b')](handleEntityNotFound(_0x3d29fc,null))[_0x505f('0x2b')](saveUpdates(_0x5c49f5[_0x505f('0x50')],null))['then'](respondWithResult(_0x3d29fc,null))[_0x505f('0x4e')](handleError(_0x3d29fc,null));};exports['destroy']=function(_0x4414b6,_0x1cede5){return db[_0x505f('0x34')][_0x505f('0x4d')]({'where':{'id':_0x4414b6[_0x505f('0x57')]['id']}})['then'](handleEntityNotFound(_0x1cede5,null))[_0x505f('0x2b')](removeEntity(_0x1cede5,null))[_0x505f('0x4e')](handleError(_0x1cede5,null));};exports[_0x505f('0x58')]=function(_0x14fa2e,_0x4a2e5c){return db[_0x505f('0x34')][_0x505f('0x58')]()['then'](respondWithResult(_0x4a2e5c,null))[_0x505f('0x4e')](handleError(_0x4a2e5c,null));};exports['getMembers']=function(_0x2b53df,_0xf0dcb7,_0x5d14cc){var _0x429864={'raw':!![],'where':{}},_0x176fe6={},_0x1a51ae;return db[_0x505f('0x34')]['findOne']({'where':{'id':_0x2b53df[_0x505f('0x57')]['id']}})['then'](handleEntityNotFound(_0xf0dcb7,null))['then'](function(_0x24a93e){if(_0x24a93e){_0x1a51ae=_0x24a93e[_0x505f('0x2d')]({'plain':!![]});_0x176fe6[_0x505f('0x39')]=_['keys'](db[_0x505f('0x59')]['rawAttributes']);_0x176fe6['query']=_[_0x505f('0x4a')](_0x2b53df[_0x505f('0x3a')]);_0x176fe6[_0x505f('0x3b')]=_[_0x505f('0x3c')](_0x176fe6['model'],_0x176fe6[_0x505f('0x3a')]);_0x429864[_0x505f('0x3e')]=_[_0x505f('0x3c')](_0x176fe6[_0x505f('0x39')],qs[_0x505f('0x3d')](_0x2b53df['query']['fields']));_0x429864['attributes']=_0x429864[_0x505f('0x3e')][_0x505f('0x3f')]?_0x429864[_0x505f('0x3e')]:_0x176fe6[_0x505f('0x39')];if(!_0x2b53df[_0x505f('0x3a')][_0x505f('0x5a')](_0x505f('0x5b'))){_0x429864['limit']=qs[_0x505f('0x24')](_0x2b53df[_0x505f('0x3a')]['limit']);_0x429864['offset']=qs[_0x505f('0x22')](_0x2b53df[_0x505f('0x3a')][_0x505f('0x22')]);}_0x429864[_0x505f('0x40')]=qs[_0x505f('0x41')](_0x2b53df[_0x505f('0x3a')][_0x505f('0x41')]);_0x429864[_0x505f('0x45')]=qs[_0x505f('0x3b')](_[_0x505f('0x42')](_0x2b53df[_0x505f('0x3a')],_0x176fe6[_0x505f('0x3b')]));_0x429864[_0x505f('0x45')][_0x505f('0x5c')]=_0x24a93e['id'];if(_0x2b53df[_0x505f('0x3a')][_0x505f('0x43')]){_0x429864[_0x505f('0x45')]=_[_0x505f('0x44')](_0x429864[_0x505f('0x45')],{'$or':_[_0x505f('0x33')](_0x429864[_0x505f('0x3e')],function(_0x31b610){var _0x3adf19={};_0x3adf19[_0x31b610]={'$like':'%'+_0x2b53df['query']['filter']+'%'};return _0x3adf19;})});}_0x429864=_[_0x505f('0x44')]({},_0x429864,_0x2b53df[_0x505f('0x4c')]);return db[_0x505f('0x59')][_0x505f('0x47')](_0x429864);}})[_0x505f('0x2b')](function(_0x5517c1){if(_0x5517c1){return db['User'][_0x505f('0x5d')]({'where':{'id':_['map'](_0x5517c1,'UserId'),'role':_0x505f('0x5e')},'attributes':['id',_0x505f('0x30'),_0x505f('0x5f'),_0x505f('0x60'),_0x505f('0x61')]});}})[_0x505f('0x2b')](function(_0x4c1c54){if(_0x4c1c54){return{'count':_0x4c1c54[_0x505f('0x25')],'rows':_[_0x505f('0x33')](_0x4c1c54[_0x505f('0x48')],function(_0x33367b){return{'membername':_0x33367b[_0x505f('0x30')],'UserId':_0x33367b['id'],'queue_name':_0x1a51ae['name'],'WhatsappQueueId':_0x1a51ae['id'],'interface':util[_0x505f('0x62')](_0x505f('0x63'),_0x505f('0x64'),_0x33367b[_0x505f('0x30')]),'penalty':0x0,'paused':_0x33367b[_0x505f('0x5f')],'createdAt':_0x33367b['createdAt'],'updatedAt':_0x33367b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x505f('0x2b')](respondWithFilteredResult(_0xf0dcb7,_0x429864))[_0x505f('0x4e')](handleError(_0xf0dcb7,null));};exports['getTeams']=function(_0x4b7bf8,_0x5f2d02,_0x1e8145){var _0x282910={};var _0x5277e4={};var _0x519ef7;var _0x90eed7;return db[_0x505f('0x34')][_0x505f('0x65')]({'where':{'id':_0x4b7bf8[_0x505f('0x57')]['id']}})['then'](handleEntityNotFound(_0x5f2d02,null))['then'](function(_0x1c9639){if(_0x1c9639){_0x519ef7=_0x1c9639;_0x5277e4['model']=_[_0x505f('0x4a')](db[_0x505f('0x66')]['rawAttributes']);_0x5277e4[_0x505f('0x3a')]=_[_0x505f('0x4a')](_0x4b7bf8[_0x505f('0x3a')]);_0x5277e4[_0x505f('0x3b')]=_[_0x505f('0x3c')](_0x5277e4['model'],_0x5277e4[_0x505f('0x3a')]);_0x282910[_0x505f('0x3e')]=_[_0x505f('0x3c')](_0x5277e4[_0x505f('0x39')],qs[_0x505f('0x3d')](_0x4b7bf8[_0x505f('0x3a')][_0x505f('0x3d')]));_0x282910[_0x505f('0x3e')]=_0x282910[_0x505f('0x3e')][_0x505f('0x3f')]?_0x282910[_0x505f('0x3e')]:_0x5277e4[_0x505f('0x39')];_0x282910['order']=qs['sort'](_0x4b7bf8[_0x505f('0x3a')][_0x505f('0x41')]);_0x282910['where']=qs[_0x505f('0x3b')](_[_0x505f('0x42')](_0x4b7bf8[_0x505f('0x3a')],_0x5277e4['filters']));if(_0x4b7bf8[_0x505f('0x3a')][_0x505f('0x43')]){_0x282910[_0x505f('0x45')]=_[_0x505f('0x44')](_0x282910[_0x505f('0x45')],{'$or':_[_0x505f('0x33')](_0x282910[_0x505f('0x3e')],function(_0x119d36){var _0x306ea1={};_0x306ea1[_0x119d36]={'$like':'%'+_0x4b7bf8[_0x505f('0x3a')][_0x505f('0x43')]+'%'};return _0x306ea1;})});}_0x282910=_[_0x505f('0x44')]({},_0x282910,_0x4b7bf8[_0x505f('0x4c')]);return _0x519ef7[_0x505f('0x67')](_0x282910);}})['then'](function(_0x56ecdb){if(_0x56ecdb){_0x90eed7=_0x56ecdb['length'];if(!_0x4b7bf8[_0x505f('0x3a')][_0x505f('0x5a')](_0x505f('0x5b'))){_0x282910[_0x505f('0x24')]=qs[_0x505f('0x24')](_0x4b7bf8['query'][_0x505f('0x24')]);_0x282910[_0x505f('0x22')]=qs[_0x505f('0x22')](_0x4b7bf8['query']['offset']);}return _0x519ef7['getTeams'](_0x282910);}})[_0x505f('0x2b')](function(_0x155baa){if(_0x155baa){return _0x155baa?{'count':_0x90eed7,'rows':_0x155baa}:null;}})[_0x505f('0x2b')](respondWithResult(_0x5f2d02,null))['catch'](handleError(_0x5f2d02,null));};exports[_0x505f('0x68')]=function(_0x9be1f5,_0x4c7582,_0x502ee9){var _0x27dac5=_0x9be1f5[_0x505f('0x50')][_0x505f('0x69')];return db[_0x505f('0x66')]['findAll']({'where':{'id':_0x27dac5},'attributes':['id'],'include':[{'model':db[_0x505f('0x6a')],'as':_0x505f('0x6b'),'attributes':['id',_0x505f('0x30'),_0x505f('0x6c'),_0x505f('0x6d'),_0x505f('0x6e')],'raw':!![]}]})[_0x505f('0x2b')](function(_0x19c85c){if(_0x19c85c){var _0x3ba9bc=_['flatMap'](_0x19c85c,function(_0x1c8512){var _0x4b319f=_0x1c8512['get']({'plain':!![]});return _0x4b319f[_0x505f('0x6b')];});return db[_0x505f('0x34')][_0x505f('0x4d')]({'where':{'id':_0x9be1f5[_0x505f('0x57')]['id']}})[_0x505f('0x2b')](function(_0x4d4df1){return db[_0x505f('0x6f')][_0x505f('0x70')](function(_0x5c1665){return _0x4d4df1[_0x505f('0x68')](_0x27dac5,{'transaction':_0x5c1665})[_0x505f('0x2b')](function(){return BPromise[_0x505f('0x71')](_0x3ba9bc,function(_0x44d503){return db[_0x505f('0x59')][_0x505f('0x72')]({'where':{'UserId':_0x44d503['id'],'WhatsappQueueId':_0x9be1f5['params']['id']},'transaction':_0x5c1665});});})['then'](function(){_0x3ba9bc[_0x505f('0x73')](function(_0x535eaf){socket[_0x505f('0x74')]('userWhatsappQueue:save',{'UserId':_0x535eaf['id'],'WhatsappQueueId':_0x4d4df1['id']});});});});});}})[_0x505f('0x2b')](respondWithStatusCode(_0x4c7582,null))[_0x505f('0x4e')](handleError(_0x4c7582,null));};exports['removeTeams']=function(_0x55d10c,_0x2fe8b2,_0x532d11){return db[_0x505f('0x66')][_0x505f('0x47')]({'where':{'id':_0x55d10c['query'][_0x505f('0x69')]},'attributes':['id'],'include':[{'model':db[_0x505f('0x6a')],'as':_0x505f('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x505f('0x2b')](handleEntityNotFound(_0x2fe8b2,null))[_0x505f('0x2b')](function(_0x7b0031){var _0x2bf94b=_[_0x505f('0x33')](_0x7b0031,'id');var _0x34fc98=[];var _0x267f53=[];var _0x4493ff=squel['select']();_0x4493ff[_0x505f('0x75')]('tq.TeamId')[_0x505f('0x76')](_0x505f('0x77'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x505f('0x45')](_0x505f('0x78'),_0x55d10c[_0x505f('0x57')]['id']);for(var _0x34d18c=0x0;_0x34d18c<_0x7b0031[_0x505f('0x3f')];_0x34d18c+=0x1){let _0x2d021a=_0x7b0031[_0x34d18c];for(var _0x2f119f=0x0;_0x2f119f<_0x2d021a['Agents']['length'];_0x2f119f+=0x1){let _0x3dd8c3=_0x2d021a[_0x505f('0x6b')][_0x2f119f];var _0x11d22b=_0x4493ff[_0x505f('0x79')]();_0x11d22b[_0x505f('0x45')]('ut.UserId\x20=\x20?',_0x3dd8c3['id']);_0x267f53[_0x505f('0x7a')](db[_0x505f('0x6f')][_0x505f('0x3a')](_0x11d22b[_0x505f('0x7b')](),{'type':db[_0x505f('0x6f')]['QueryTypes'][_0x505f('0x7c')]})[_0x505f('0x2b')](function(_0x4fbeea){if(_0x4fbeea[_0x505f('0x3f')]===0x1){return _0x3dd8c3['id'];}else{var _0x27dd3c=_[_0x505f('0x7d')](_['map'](_0x4fbeea,'TeamId'),function(_0x3e56f9){return _[_0x505f('0x7e')](_0x2bf94b,_0x3e56f9);});if(_0x27dd3c){return _0x3dd8c3['id'];}}}));}}return BPromise['all'](_0x267f53)[_0x505f('0x2b')](function(_0xde42f1){_0x34fc98=_(_0x34fc98)[_0x505f('0x7f')](_0xde42f1)[_0x505f('0x80')]()[_0x505f('0x81')]();return db[_0x505f('0x34')]['find']({'where':{'id':_0x55d10c['params']['id']}})[_0x505f('0x2b')](function(_0x590845){return db['sequelize'][_0x505f('0x70')](function(_0x48c255){return _0x590845[_0x505f('0x82')](_0x55d10c[_0x505f('0x3a')][_0x505f('0x69')],{'transaction':_0x48c255})[_0x505f('0x2b')](function(){if(!_[_0x505f('0x83')](_0x34fc98)){return _0x590845['removeAgents'](_0x34fc98,{'transaction':_0x48c255});}})[_0x505f('0x2b')](function(){_0x34fc98[_0x505f('0x73')](function(_0x4a8ee4){socket[_0x505f('0x74')](_0x505f('0x84'),{'UserId':_0x4a8ee4,'WhatsappQueueId':_0x590845['id']});});});});});});})[_0x505f('0x2b')](respondWithStatusCode(_0x2fe8b2,null))['catch'](handleError(_0x2fe8b2,null));};exports[_0x505f('0x85')]=function(_0x468549,_0x43e011,_0x486cf4){return db[_0x505f('0x34')][_0x505f('0x4d')]({'where':{'id':_0x468549[_0x505f('0x57')]['id']}})[_0x505f('0x2b')](handleEntityNotFound(_0x43e011,null))[_0x505f('0x2b')](function(_0x562e8e){if(_0x562e8e){return _0x562e8e[_0x505f('0x85')](_0x468549[_0x505f('0x50')][_0x505f('0x69')],_[_0x505f('0x86')](_0x468549[_0x505f('0x50')],['ids','id'])||{})[_0x505f('0x87')](function(_0x2c3721){for(var _0x44f3d8=0x0;_0x44f3d8<_0x468549[_0x505f('0x50')][_0x505f('0x69')][_0x505f('0x3f')];_0x44f3d8+=0x1){socket[_0x505f('0x74')](_0x505f('0x88'),{'UserId':Number(_0x468549[_0x505f('0x50')][_0x505f('0x69')][_0x44f3d8]),'WhatsappQueueId':Number(_0x468549[_0x505f('0x57')]['id'])});}return _0x2c3721;});}})[_0x505f('0x2b')](respondWithResult(_0x43e011,null))[_0x505f('0x4e')](handleError(_0x43e011,null));};exports[_0x505f('0x89')]=function(_0x52749b,_0x14b950,_0x2ff88e){return db[_0x505f('0x34')][_0x505f('0x4d')]({'where':{'id':_0x52749b[_0x505f('0x57')]['id']}})[_0x505f('0x2b')](handleEntityNotFound(_0x14b950,null))['then'](function(_0x1f0b8b){if(_0x1f0b8b){return _0x1f0b8b[_0x505f('0x89')](_0x52749b['query'][_0x505f('0x69')])[_0x505f('0x2b')](function(){if(_[_0x505f('0x8a')](_0x52749b[_0x505f('0x3a')][_0x505f('0x69')])){for(var _0x478457=0x0;_0x478457<_0x52749b[_0x505f('0x3a')][_0x505f('0x69')]['length'];_0x478457+=0x1){socket['emit'](_0x505f('0x84'),{'UserId':Number(_0x52749b[_0x505f('0x3a')][_0x505f('0x69')][_0x478457]),'WhatsappQueueId':Number(_0x52749b['params']['id'])});}}else{socket[_0x505f('0x74')]('userWhatsappQueue:remove',{'UserId':Number(_0x52749b[_0x505f('0x3a')]['ids']),'WhatsappQueueId':Number(_0x52749b['params']['id'])});}});}})[_0x505f('0x2b')](respondWithStatusCode(_0x14b950,null))[_0x505f('0x4e')](handleError(_0x14b950,null));};exports['getAgents']=function(_0x5e00b5,_0x3dd603,_0x2500f3){var _0x9e5c4a={};var _0x403732={};var _0x5861f7;var _0x2fa882;return db[_0x505f('0x34')][_0x505f('0x65')]({'where':{'id':_0x5e00b5[_0x505f('0x57')]['id']}})[_0x505f('0x2b')](handleEntityNotFound(_0x3dd603,null))[_0x505f('0x2b')](function(_0x521ebc){if(_0x521ebc){_0x5861f7=_0x521ebc;_0x403732[_0x505f('0x39')]=_['keys'](db['User'][_0x505f('0x35')]);_0x403732['query']=_[_0x505f('0x4a')](_0x5e00b5['query']);_0x403732['filters']=_[_0x505f('0x3c')](_0x403732['model'],_0x403732[_0x505f('0x3a')]);_0x9e5c4a[_0x505f('0x3e')]=_[_0x505f('0x3c')](_0x403732['model'],qs[_0x505f('0x3d')](_0x5e00b5[_0x505f('0x3a')][_0x505f('0x3d')]));_0x9e5c4a['attributes']=_0x9e5c4a[_0x505f('0x3e')][_0x505f('0x3f')]?_0x9e5c4a['attributes']:_0x403732[_0x505f('0x39')];_0x9e5c4a[_0x505f('0x40')]=qs[_0x505f('0x41')](_0x5e00b5[_0x505f('0x3a')]['sort']);_0x9e5c4a['where']=qs[_0x505f('0x3b')](_[_0x505f('0x42')](_0x5e00b5[_0x505f('0x3a')],_0x403732[_0x505f('0x3b')]));if(_0x5e00b5['query'][_0x505f('0x43')]){_0x9e5c4a[_0x505f('0x45')]=_[_0x505f('0x44')](_0x9e5c4a[_0x505f('0x45')],{'$or':_[_0x505f('0x33')](_0x9e5c4a['attributes'],function(_0x1bcec0){var _0x210e19={};_0x210e19[_0x1bcec0]={'$like':'%'+_0x5e00b5[_0x505f('0x3a')]['filter']+'%'};return _0x210e19;})});}_0x9e5c4a=_[_0x505f('0x44')]({},_0x9e5c4a,_0x5e00b5['options']);return _0x5861f7['getAgents'](_0x9e5c4a);}})[_0x505f('0x2b')](function(_0x5125db){if(_0x5125db){_0x2fa882=_0x5125db[_0x505f('0x3f')];if(!_0x5e00b5[_0x505f('0x3a')]['hasOwnProperty'](_0x505f('0x5b'))){_0x9e5c4a[_0x505f('0x24')]=qs[_0x505f('0x24')](_0x5e00b5[_0x505f('0x3a')][_0x505f('0x24')]);_0x9e5c4a[_0x505f('0x22')]=qs['offset'](_0x5e00b5[_0x505f('0x3a')][_0x505f('0x22')]);}return _0x5861f7[_0x505f('0x8b')](_0x9e5c4a);}})[_0x505f('0x2b')](function(_0x475b82){if(_0x475b82){return _0x475b82?{'count':_0x2fa882,'rows':_0x475b82}:null;}})[_0x505f('0x2b')](respondWithResult(_0x3dd603,null))[_0x505f('0x4e')](handleError(_0x3dd603,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 8563b92..0f0221c 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 _0x6613=['hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6613,0xbd));var _0x3661=function(_0x369c6,_0x1e6564){_0x369c6=_0x369c6-0x0;var _0x200515=_0x6613[_0x369c6];return _0x200515;};'use strict';var EventEmitter=require(_0x3661('0x0'));var WhatsappQueue=require(_0x3661('0x1'))['db'][_0x3661('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x3661('0x3')](0x0);var events={'afterCreate':_0x3661('0x4'),'afterUpdate':_0x3661('0x5'),'afterDestroy':_0x3661('0x6')};function emitEvent(_0x933eac){return function(_0x4263c4,_0x3b64a3,_0x2b6c03){WhatsappQueueEvents[_0x3661('0x7')](_0x933eac+':'+_0x4263c4['id'],_0x4263c4);WhatsappQueueEvents[_0x3661('0x7')](_0x933eac,_0x4263c4);_0x2b6c03(null);};}for(var e in events){if(events[_0x3661('0x8')](e)){var event=events[e];WhatsappQueue[_0x3661('0x9')](e,emitEvent(event));}}module[_0x3661('0xa')]=WhatsappQueueEvents; \ No newline at end of file +var _0xcd69=['save','update','remove','emit','hasOwnProperty','hook','exports','setMaxListeners'];(function(_0x1f66b0,_0x42588c){var _0x389af3=function(_0x1e18dd){while(--_0x1e18dd){_0x1f66b0['push'](_0x1f66b0['shift']());}};_0x389af3(++_0x42588c);}(_0xcd69,0x127));var _0x9cd6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xcd69[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x9cd6('0x0')](0x0);var events={'afterCreate':_0x9cd6('0x1'),'afterUpdate':_0x9cd6('0x2'),'afterDestroy':_0x9cd6('0x3')};function emitEvent(_0x236200){return function(_0x15d3c0,_0x1779f0,_0x33dc4e){WhatsappQueueEvents[_0x9cd6('0x4')](_0x236200+':'+_0x15d3c0['id'],_0x15d3c0);WhatsappQueueEvents['emit'](_0x236200,_0x15d3c0);_0x33dc4e(null);};}for(var e in events){if(events[_0x9cd6('0x5')](e)){var event=events[e];WhatsappQueue[_0x9cd6('0x6')](e,emitEvent(event));}}module[_0x9cd6('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index c9a2945..94cded1 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 _0xd6dd=['request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','../../config/logger','api','moment'];(function(_0x4b5385,_0x3f4c7e){var _0x286c0a=function(_0x5c4fe1){while(--_0x5c4fe1){_0x4b5385['push'](_0x4b5385['shift']());}};_0x286c0a(++_0x3f4c7e);}(_0xd6dd,0x1c4));var _0xdd6d=function(_0x21fdce,_0x3b4c0e){_0x21fdce=_0x21fdce-0x0;var _0xcdf7d6=_0xd6dd[_0x21fdce];return _0xcdf7d6;};'use strict';var _=require(_0xdd6d('0x0'));var util=require('util');var logger=require(_0xdd6d('0x1'))(_0xdd6d('0x2'));var moment=require(_0xdd6d('0x3'));var BPromise=require('bluebird');var rp=require(_0xdd6d('0x4'));var fs=require('fs');var path=require(_0xdd6d('0x5'));var rimraf=require(_0xdd6d('0x6'));var config=require(_0xdd6d('0x7'));var attributes=require(_0xdd6d('0x8'));module[_0xdd6d('0x9')]=function(_0x12c44f,_0x4549fa){return _0x12c44f[_0xdd6d('0xa')]('WhatsappQueue',attributes,{'tableName':_0xdd6d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c2a=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x199e78,_0x5796aa){var _0x25817b=function(_0x22f64e){while(--_0x22f64e){_0x199e78['push'](_0x199e78['shift']());}};_0x25817b(++_0x5796aa);}(_0x1c2a,0x19f));var _0xa1c2=function(_0x287561,_0x1812ef){_0x287561=_0x287561-0x0;var _0x551d50=_0x1c2a[_0x287561];return _0x551d50;};'use strict';var _=require(_0xa1c2('0x0'));var util=require(_0xa1c2('0x1'));var logger=require(_0xa1c2('0x2'))(_0xa1c2('0x3'));var moment=require(_0xa1c2('0x4'));var BPromise=require(_0xa1c2('0x5'));var rp=require(_0xa1c2('0x6'));var fs=require('fs');var path=require(_0xa1c2('0x7'));var rimraf=require('rimraf');var config=require(_0xa1c2('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0xa1c2('0x9')]=function(_0x25ef2a,_0x41b953){return _0x25ef2a[_0xa1c2('0xa')](_0xa1c2('0xb'),attributes,{'tableName':_0xa1c2('0xc'),'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 558c441..dbaa170 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 _0x7aaf=['include','model','attributes','ShowWhatsappQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','limit','map'];(function(_0x23ae54,_0x544ef3){var _0x117fa7=function(_0x19b565){while(--_0x19b565){_0x23ae54['push'](_0x23ae54['shift']());}};_0x117fa7(++_0x544ef3);}(_0x7aaf,0x16d));var _0xf7aa=function(_0x3d1214,_0x5b9f64){_0x3d1214=_0x3d1214-0x0;var _0x29aea8=_0x7aaf[_0x3d1214];return _0x29aea8;};'use strict';var _=require(_0xf7aa('0x0'));var util=require('util');var moment=require(_0xf7aa('0x1'));var BPromise=require(_0xf7aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7aa('0x3'));var db=require(_0xf7aa('0x4'))['db'];var utils=require(_0xf7aa('0x5'));var logger=require(_0xf7aa('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf7aa('0x7')][_0xf7aa('0x8')]({'port':0x232a});config[_0xf7aa('0x9')]=_['defaults'](config['redis'],{'host':_0xf7aa('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf7aa('0xb'))['register'](socket);function respondWithRpcPromise(_0x1c558e,_0x4ed795,_0x35788f){return new BPromise(function(_0x5e1d53,_0x38c6fe){return client[_0xf7aa('0xc')](_0x1c558e,_0x35788f)[_0xf7aa('0xd')](function(_0x4f65fd){logger[_0xf7aa('0xe')](_0xf7aa('0xf'),_0x4ed795,_0xf7aa('0x10'));logger[_0xf7aa('0x11')](_0xf7aa('0x12'),_0x4ed795,_0xf7aa('0x10'),JSON[_0xf7aa('0x13')](_0x4f65fd));if(_0x4f65fd[_0xf7aa('0x14')]){if(_0x4f65fd[_0xf7aa('0x14')][_0xf7aa('0x15')]===0x1f4){logger[_0xf7aa('0x14')](_0xf7aa('0xf'),_0x4ed795,_0x4f65fd[_0xf7aa('0x14')]['message']);return _0x38c6fe(_0x4f65fd[_0xf7aa('0x14')][_0xf7aa('0x16')]);}logger[_0xf7aa('0x14')](_0xf7aa('0xf'),_0x4ed795,_0x4f65fd[_0xf7aa('0x14')][_0xf7aa('0x16')]);return _0x5e1d53(_0x4f65fd['error'][_0xf7aa('0x16')]);}else{logger[_0xf7aa('0xe')](_0xf7aa('0xf'),_0x4ed795,'request\x20sent');_0x5e1d53(_0x4f65fd['result'][_0xf7aa('0x16')]);}})[_0xf7aa('0x17')](function(_0x1552c6){logger[_0xf7aa('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x4ed795,_0x1552c6);_0x38c6fe(_0x1552c6);});});}exports[_0xf7aa('0x18')]=function(_0x1af791){var _0x375c84=this;return new Promise(function(_0x2d5275,_0x1fe3d3){return db[_0xf7aa('0x19')]['findAll']({'raw':_0x1af791[_0xf7aa('0x1a')]?_0x1af791['options'][_0xf7aa('0x1b')]===undefined?!![]:![]:!![],'where':_0x1af791['options']?_0x1af791[_0xf7aa('0x1a')][_0xf7aa('0x1c')]||null:null,'attributes':_0x1af791['options']?_0x1af791[_0xf7aa('0x1a')]['attributes']||null:null,'limit':_0x1af791[_0xf7aa('0x1a')]?_0x1af791[_0xf7aa('0x1a')][_0xf7aa('0x1d')]||null:null,'include':_0x1af791[_0xf7aa('0x1a')]?_0x1af791['options']['include']?_[_0xf7aa('0x1e')](_0x1af791[_0xf7aa('0x1a')][_0xf7aa('0x1f')],function(_0x4654e8){return{'model':db[_0x4654e8[_0xf7aa('0x20')]],'as':_0x4654e8['as'],'attributes':_0x4654e8['attributes'],'include':_0x4654e8[_0xf7aa('0x1f')]?_[_0xf7aa('0x1e')](_0x4654e8['include'],function(_0xbc04b2){return{'model':db[_0xbc04b2['model']],'as':_0xbc04b2['as'],'attributes':_0xbc04b2['attributes'],'include':_0xbc04b2[_0xf7aa('0x1f')]?_[_0xf7aa('0x1e')](_0xbc04b2[_0xf7aa('0x1f')],function(_0x5cc346){return{'model':db[_0x5cc346[_0xf7aa('0x20')]],'as':_0x5cc346['as'],'attributes':_0x5cc346[_0xf7aa('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf7aa('0xd')](function(_0x48216e){logger[_0xf7aa('0xe')](_0xf7aa('0x18'),_0x1af791);logger[_0xf7aa('0x11')](_0xf7aa('0x18'),_0x1af791,JSON[_0xf7aa('0x13')](_0x48216e));_0x2d5275(_0x48216e);})[_0xf7aa('0x17')](function(_0x5f1bb2){logger['error']('GetWhatsappQueue',_0x5f1bb2[_0xf7aa('0x16')],_0x1af791);_0x1fe3d3(_0x375c84['error'](0x1f4,_0x5f1bb2[_0xf7aa('0x16')]));});});};exports[_0xf7aa('0x22')]=function(_0x1fee2b){var _0x4ebbf1=this;return new Promise(function(_0x5195ec,_0x4c76fd){return db[_0xf7aa('0x19')][_0xf7aa('0x23')]({'raw':_0x1fee2b[_0xf7aa('0x1a')]?_0x1fee2b[_0xf7aa('0x1a')][_0xf7aa('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fee2b[_0xf7aa('0x1a')]?_0x1fee2b[_0xf7aa('0x1a')]['where']||null:null,'attributes':_0x1fee2b[_0xf7aa('0x1a')]?_0x1fee2b[_0xf7aa('0x1a')][_0xf7aa('0x21')]||null:null,'include':_0x1fee2b[_0xf7aa('0x1a')]?_0x1fee2b[_0xf7aa('0x1a')][_0xf7aa('0x1f')]?_[_0xf7aa('0x1e')](_0x1fee2b[_0xf7aa('0x1a')][_0xf7aa('0x1f')],function(_0x169794){return{'model':db[_0x169794[_0xf7aa('0x20')]],'as':_0x169794['as'],'attributes':_0x169794[_0xf7aa('0x21')],'include':_0x169794['include']?_[_0xf7aa('0x1e')](_0x169794[_0xf7aa('0x1f')],function(_0x251c4b){return{'model':db[_0x251c4b[_0xf7aa('0x20')]],'as':_0x251c4b['as'],'attributes':_0x251c4b['attributes'],'include':_0x251c4b[_0xf7aa('0x1f')]?_[_0xf7aa('0x1e')](_0x251c4b['include'],function(_0x550199){return{'model':db[_0x550199['model']],'as':_0x550199['as'],'attributes':_0x550199['attributes']};}):[]};}):[]};}):[]:[]})[_0xf7aa('0xd')](function(_0x25c340){logger[_0xf7aa('0xe')](_0xf7aa('0x22'),_0x1fee2b);logger[_0xf7aa('0x11')](_0xf7aa('0x22'),_0x1fee2b,JSON['stringify'](_0x25c340));_0x5195ec(_0x25c340);})[_0xf7aa('0x17')](function(_0x2e3d90){logger[_0xf7aa('0x14')](_0xf7aa('0x22'),_0x2e3d90[_0xf7aa('0x16')],_0x1fee2b);_0x4c76fd(_0x4ebbf1[_0xf7aa('0x14')](0x1f4,_0x2e3d90['message']));});});}; \ No newline at end of file +var _0x3aaf=['stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','map','include','model','attributes','then','find','where','ShowWhatsappQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2f15ee,_0x3b0aaa){var _0x35fcde=function(_0x37a659){while(--_0x37a659){_0x2f15ee['push'](_0x2f15ee['shift']());}};_0x35fcde(++_0x3b0aaa);}(_0x3aaf,0x108));var _0xf3aa=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x3aaf[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xf3aa('0x0'));var util=require(_0xf3aa('0x1'));var moment=require(_0xf3aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xf3aa('0x3'));var fs=require('fs');var Redis=require(_0xf3aa('0x4'));var db=require(_0xf3aa('0x5'))['db'];var utils=require(_0xf3aa('0x6'));var logger=require(_0xf3aa('0x7'))(_0xf3aa('0x8'));var config=require(_0xf3aa('0x9'));var jayson=require(_0xf3aa('0xa'));var client=jayson[_0xf3aa('0xb')][_0xf3aa('0xc')]({'port':0x232a});config[_0xf3aa('0xd')]=_['defaults'](config['redis'],{'host':_0xf3aa('0xe'),'port':0x18eb});var socket=require(_0xf3aa('0xf'))(new Redis(config[_0xf3aa('0xd')]));require('./whatsappQueue.socket')[_0xf3aa('0x10')](socket);function respondWithRpcPromise(_0x31f178,_0xc2819b,_0x22d96f){return new BPromise(function(_0x2db201,_0xe7afff){return client[_0xf3aa('0x11')](_0x31f178,_0x22d96f)['then'](function(_0x15b901){logger[_0xf3aa('0x12')](_0xf3aa('0x13'),_0xc2819b,_0xf3aa('0x14'));logger[_0xf3aa('0x15')](_0xf3aa('0x16'),_0xc2819b,'request\x20sent',JSON[_0xf3aa('0x17')](_0x15b901));if(_0x15b901[_0xf3aa('0x18')]){if(_0x15b901[_0xf3aa('0x18')][_0xf3aa('0x19')]===0x1f4){logger[_0xf3aa('0x18')](_0xf3aa('0x13'),_0xc2819b,_0x15b901[_0xf3aa('0x18')]['message']);return _0xe7afff(_0x15b901['error'][_0xf3aa('0x1a')]);}logger['error'](_0xf3aa('0x13'),_0xc2819b,_0x15b901[_0xf3aa('0x18')][_0xf3aa('0x1a')]);return _0x2db201(_0x15b901['error']['message']);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0xc2819b,_0xf3aa('0x14'));_0x2db201(_0x15b901[_0xf3aa('0x1b')]['message']);}})[_0xf3aa('0x1c')](function(_0x581946){logger[_0xf3aa('0x18')](_0xf3aa('0x13'),_0xc2819b,_0x581946);_0xe7afff(_0x581946);});});}exports[_0xf3aa('0x1d')]=function(_0xfb9f7c){var _0x3d951c=this;return new Promise(function(_0xc3fa4d,_0x3fa795){return db[_0xf3aa('0x1e')]['findAll']({'raw':_0xfb9f7c[_0xf3aa('0x1f')]?_0xfb9f7c[_0xf3aa('0x1f')][_0xf3aa('0x20')]===undefined?!![]:![]:!![],'where':_0xfb9f7c[_0xf3aa('0x1f')]?_0xfb9f7c[_0xf3aa('0x1f')]['where']||null:null,'attributes':_0xfb9f7c[_0xf3aa('0x1f')]?_0xfb9f7c['options']['attributes']||null:null,'limit':_0xfb9f7c[_0xf3aa('0x1f')]?_0xfb9f7c[_0xf3aa('0x1f')]['limit']||null:null,'include':_0xfb9f7c[_0xf3aa('0x1f')]?_0xfb9f7c[_0xf3aa('0x1f')]['include']?_[_0xf3aa('0x21')](_0xfb9f7c[_0xf3aa('0x1f')][_0xf3aa('0x22')],function(_0xa134c4){return{'model':db[_0xa134c4[_0xf3aa('0x23')]],'as':_0xa134c4['as'],'attributes':_0xa134c4['attributes'],'include':_0xa134c4[_0xf3aa('0x22')]?_[_0xf3aa('0x21')](_0xa134c4[_0xf3aa('0x22')],function(_0x3c87ea){return{'model':db[_0x3c87ea['model']],'as':_0x3c87ea['as'],'attributes':_0x3c87ea[_0xf3aa('0x24')],'include':_0x3c87ea[_0xf3aa('0x22')]?_['map'](_0x3c87ea[_0xf3aa('0x22')],function(_0x17910c){return{'model':db[_0x17910c[_0xf3aa('0x23')]],'as':_0x17910c['as'],'attributes':_0x17910c[_0xf3aa('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf3aa('0x25')](function(_0x4e1043){logger[_0xf3aa('0x12')](_0xf3aa('0x1d'),_0xfb9f7c);logger[_0xf3aa('0x15')](_0xf3aa('0x1d'),_0xfb9f7c,JSON[_0xf3aa('0x17')](_0x4e1043));_0xc3fa4d(_0x4e1043);})[_0xf3aa('0x1c')](function(_0x417879){logger[_0xf3aa('0x18')](_0xf3aa('0x1d'),_0x417879[_0xf3aa('0x1a')],_0xfb9f7c);_0x3fa795(_0x3d951c['error'](0x1f4,_0x417879[_0xf3aa('0x1a')]));});});};exports['ShowWhatsappQueue']=function(_0x1c16ab){var _0x473128=this;return new Promise(function(_0x565161,_0x20d2ff){return db[_0xf3aa('0x1e')][_0xf3aa('0x26')]({'raw':_0x1c16ab[_0xf3aa('0x1f')]?_0x1c16ab[_0xf3aa('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1c16ab[_0xf3aa('0x1f')]?_0x1c16ab[_0xf3aa('0x1f')][_0xf3aa('0x27')]||null:null,'attributes':_0x1c16ab[_0xf3aa('0x1f')]?_0x1c16ab[_0xf3aa('0x1f')]['attributes']||null:null,'include':_0x1c16ab[_0xf3aa('0x1f')]?_0x1c16ab[_0xf3aa('0x1f')][_0xf3aa('0x22')]?_[_0xf3aa('0x21')](_0x1c16ab['options'][_0xf3aa('0x22')],function(_0x224f77){return{'model':db[_0x224f77[_0xf3aa('0x23')]],'as':_0x224f77['as'],'attributes':_0x224f77['attributes'],'include':_0x224f77[_0xf3aa('0x22')]?_[_0xf3aa('0x21')](_0x224f77[_0xf3aa('0x22')],function(_0x38e333){return{'model':db[_0x38e333[_0xf3aa('0x23')]],'as':_0x38e333['as'],'attributes':_0x38e333[_0xf3aa('0x24')],'include':_0x38e333[_0xf3aa('0x22')]?_[_0xf3aa('0x21')](_0x38e333[_0xf3aa('0x22')],function(_0x48c3c6){return{'model':db[_0x48c3c6[_0xf3aa('0x23')]],'as':_0x48c3c6['as'],'attributes':_0x48c3c6[_0xf3aa('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf3aa('0x25')](function(_0x3d5615){logger[_0xf3aa('0x12')](_0xf3aa('0x28'),_0x1c16ab);logger['debug'](_0xf3aa('0x28'),_0x1c16ab,JSON[_0xf3aa('0x17')](_0x3d5615));_0x565161(_0x3d5615);})[_0xf3aa('0x1c')](function(_0x3545ea){logger[_0xf3aa('0x18')]('ShowWhatsappQueue',_0x3545ea[_0xf3aa('0x1a')],_0x1c16ab);_0x20d2ff(_0x473128['error'](0x1f4,_0x3545ea['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 8ffdf30..641455a 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 _0xfdd9=['register','length','whatsappQueue:','save','remove','emit'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xfdd9,0x1bf));var _0x9fdd=function(_0x5f1302,_0x4dcb01){_0x5f1302=_0x5f1302-0x0;var _0x24b78d=_0xfdd9[_0x5f1302];return _0x24b78d;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x9fdd('0x0'),_0x9fdd('0x1'),'update'];function createListener(_0x385fcb,_0x355e1e){return function(_0x4aa238){_0x355e1e[_0x9fdd('0x2')](_0x385fcb,_0x4aa238);};}function removeListener(_0x4f4f01,_0x1bfa4b){return function(){WhatsappQueueEvents['removeListener'](_0x4f4f01,_0x1bfa4b);};}exports[_0x9fdd('0x3')]=function(_0x1e9c76){for(var _0x17614e=0x0,_0x18d63c=events[_0x9fdd('0x4')];_0x17614e<_0x18d63c;_0x17614e++){var _0x3a9f76=events[_0x17614e];var _0x54d90b=createListener(_0x9fdd('0x5')+_0x3a9f76,_0x1e9c76);WhatsappQueueEvents['on'](_0x3a9f76,_0x54d90b);}}; \ No newline at end of file +var _0x4df0=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x20e295,_0x308599){var _0x33ffbe=function(_0x2eeb46){while(--_0x2eeb46){_0x20e295['push'](_0x20e295['shift']());}};_0x33ffbe(++_0x308599);}(_0x4df0,0x138));var _0x04df=function(_0x104e26,_0x3e60ae){_0x104e26=_0x104e26-0x0;var _0x1525ac=_0x4df0[_0x104e26];return _0x1525ac;};'use strict';var WhatsappQueueEvents=require(_0x04df('0x0'));var events=[_0x04df('0x1'),_0x04df('0x2'),'update'];function createListener(_0xb4d812,_0x5765f5){return function(_0x3a0200){_0x5765f5['emit'](_0xb4d812,_0x3a0200);};}function removeListener(_0x329ecb,_0x511969){return function(){WhatsappQueueEvents[_0x04df('0x3')](_0x329ecb,_0x511969);};}exports[_0x04df('0x4')]=function(_0xf2056c){for(var _0x12c1d0=0x0,_0xd76758=events[_0x04df('0x5')];_0x12c1d0<_0xd76758;_0x12c1d0++){var _0x31e3b7=events[_0x12c1d0];var _0x3b6bcc=createListener(_0x04df('0x6')+_0x31e3b7,_0xf2056c);WhatsappQueueEvents['on'](_0x31e3b7,_0x3b6bcc);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index b50b88b..101199a 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 _0xe26b=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports','multer'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xe26b,0x9f));var _0xbe26=function(_0x55892c,_0xce573c){_0x55892c=_0x55892c-0x0;var _0x532bad=_0xe26b[_0x55892c];return _0x532bad;};'use strict';var multer=require(_0xbe26('0x0'));var util=require('util');var path=require(_0xbe26('0x1'));var timeout=require('connect-timeout');var express=require(_0xbe26('0x2'));var router=express[_0xbe26('0x3')]();var fs_extra=require(_0xbe26('0x4'));var auth=require(_0xbe26('0x5'));var interaction=require(_0xbe26('0x6'));var config=require(_0xbe26('0x7'));var controller=require(_0xbe26('0x8'));router[_0xbe26('0x9')]('/',auth[_0xbe26('0xa')](),controller[_0xbe26('0xb')]);router[_0xbe26('0x9')]('/describe',auth[_0xbe26('0xa')](),controller[_0xbe26('0xc')]);router['get'](_0xbe26('0xd'),auth['isAuthenticated'](),controller[_0xbe26('0xe')]);router['post']('/',auth[_0xbe26('0xa')](),controller[_0xbe26('0xf')]);router[_0xbe26('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xbe26('0x11')]);router[_0xbe26('0x12')](_0xbe26('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe26('0x13')]=router; \ No newline at end of file +var _0x15f3=['/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index','show','post','create','put'];(function(_0x2317c7,_0x2ab178){var _0x3e4917=function(_0x469a34){while(--_0x469a34){_0x2317c7['push'](_0x2317c7['shift']());}};_0x3e4917(++_0x2ab178);}(_0x15f3,0x73));var _0x315f=function(_0x205bcf,_0x2ae0d6){_0x205bcf=_0x205bcf-0x0;var _0x82c88a=_0x15f3[_0x205bcf];return _0x82c88a;};'use strict';var multer=require(_0x315f('0x0'));var util=require(_0x315f('0x1'));var path=require('path');var timeout=require(_0x315f('0x2'));var express=require(_0x315f('0x3'));var router=express['Router']();var fs_extra=require(_0x315f('0x4'));var auth=require(_0x315f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router[_0x315f('0x6')]('/',auth[_0x315f('0x7')](),controller[_0x315f('0x8')]);router[_0x315f('0x6')]('/describe',auth[_0x315f('0x7')](),controller['describe']);router[_0x315f('0x6')]('/:id',auth[_0x315f('0x7')](),controller[_0x315f('0x9')]);router[_0x315f('0xa')]('/',auth['isAuthenticated'](),controller[_0x315f('0xb')]);router[_0x315f('0xc')](_0x315f('0xd'),auth[_0x315f('0x7')](),controller['update']);router['delete'](_0x315f('0xd'),auth[_0x315f('0x7')](),controller[_0x315f('0xe')]);module[_0x315f('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index b27b355..bc7879c 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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x45acaa,_0x667cd5){var _0x3f6d9d=function(_0x583adc){while(--_0x583adc){_0x45acaa['push'](_0x45acaa['shift']());}};_0x3f6d9d(++_0x667cd5);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1acc94,_0x53de39){var _0xcde46b=function(_0x51652b){while(--_0x51652b){_0x1acc94['push'](_0x1acc94['shift']());}};_0xcde46b(++_0x53de39);}(_0x7a54,0x106));var _0x47a5=function(_0x1ab7c1,_0x545378){_0x1ab7c1=_0x1ab7c1-0x0;var _0x3352d9=_0x7a54[_0x1ab7c1];return _0x3352d9;};'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 diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 3067239..b619d42 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 _0x351d=['includeAll','include','catch','show','params','rawAttributes','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','limit','count','offset','apply','reject','save','update','destroy','then','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappQueueReport'];(function(_0x208c5e,_0x38594e){var _0x3b97e6=function(_0x2dbe18){while(--_0x2dbe18){_0x208c5e['push'](_0x208c5e['shift']());}};_0x3b97e6(++_0x38594e);}(_0x351d,0x90));var _0xd351=function(_0x4e5903,_0x31aef5){_0x4e5903=_0x4e5903-0x0;var _0x100dfe=_0x351d[_0x4e5903];return _0x100dfe;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb40c,_0x15549a){_0x15549a=_0x15549a||0xcc;return function(_0x23445f){if(_0x23445f){return _0x3eb40c[_0xd351('0x13')](_0x15549a);}return _0x3eb40c['status'](_0x15549a)[_0xd351('0x14')]();};}function respondWithResult(_0x316cf6,_0x597d7c){_0x597d7c=_0x597d7c||0xc8;return function(_0xc5a145){if(_0xc5a145){return _0x316cf6[_0xd351('0x15')](_0x597d7c)[_0xd351('0x16')](_0xc5a145);}};}function respondWithFilteredResult(_0xf1c285,_0x3867fb){return function(_0x4d238c){if(_0x4d238c){var _0x9f790f=typeof _0x3867fb['offset']==='undefined'&&typeof _0x3867fb[_0xd351('0x17')]==='undefined';var _0x21e591=_0x4d238c[_0xd351('0x18')];var _0x4e0164=_0x9f790f?0x0:_0x3867fb['offset'];var _0x1e1a3c=_0x9f790f?_0x4d238c[_0xd351('0x18')]:_0x3867fb[_0xd351('0x19')]+_0x3867fb[_0xd351('0x17')];var _0x51f265;if(_0x1e1a3c>=_0x21e591){_0x1e1a3c=_0x21e591;_0x51f265=0xc8;}else{_0x51f265=0xce;}_0xf1c285[_0xd351('0x15')](_0x51f265);return _0xf1c285['set']('Content-Range',_0x4e0164+'-'+_0x1e1a3c+'/'+_0x21e591)[_0xd351('0x16')](_0x4d238c);}return null;};}function patchUpdates(_0x4a427b){return function(_0x33b1e5){try{jsonpatch[_0xd351('0x1a')](_0x33b1e5,_0x4a427b,!![]);}catch(_0x3634c9){return BPromise[_0xd351('0x1b')](_0x3634c9);}return _0x33b1e5[_0xd351('0x1c')]();};}function saveUpdates(_0x53e729,_0x18625b){return function(_0xbbc58){if(_0xbbc58){return _0xbbc58[_0xd351('0x1d')](_0x53e729)['then'](function(_0x1ce7f7){return _0x1ce7f7;});}return null;};}function removeEntity(_0x2d9aa0,_0x365bbc){return function(_0x59fb6d){if(_0x59fb6d){return _0x59fb6d[_0xd351('0x1e')]()[_0xd351('0x1f')](function(){_0x2d9aa0[_0xd351('0x15')](0xcc)[_0xd351('0x14')]();});}};}function handleEntityNotFound(_0x489c9a,_0x40f7f3){return function(_0x483c92){if(!_0x483c92){_0x489c9a[_0xd351('0x13')](0x194);}return _0x483c92;};}function handleError(_0x8ad0a6,_0x54f471){_0x54f471=_0x54f471||0x1f4;return function(_0x2648d0){logger['error'](_0x2648d0['stack']);if(_0x2648d0[_0xd351('0x20')]){delete _0x2648d0['name'];}_0x8ad0a6['status'](_0x54f471)[_0xd351('0x21')](_0x2648d0);};}exports['index']=function(_0x38471c,_0x2ddae8){var _0x407b50={},_0x4d3f48={},_0x71ce9c={'count':0x0,'rows':[]};var _0x4aa902=_[_0xd351('0x22')](db['WhatsappQueueReport']['rawAttributes'],function(_0xeb4da9){return{'name':_0xeb4da9[_0xd351('0x23')],'type':_0xeb4da9[_0xd351('0x24')][_0xd351('0x25')]};});_0x4d3f48['model']=_[_0xd351('0x22')](_0x4aa902,_0xd351('0x20'));_0x4d3f48[_0xd351('0x26')]=_[_0xd351('0x27')](_0x38471c[_0xd351('0x26')]);_0x4d3f48[_0xd351('0x28')]=_[_0xd351('0x29')](_0x4d3f48[_0xd351('0x2a')],_0x4d3f48[_0xd351('0x26')]);_0x407b50['attributes']=_[_0xd351('0x29')](_0x4d3f48[_0xd351('0x2a')],qs[_0xd351('0x2b')](_0x38471c[_0xd351('0x26')]['fields']));_0x407b50[_0xd351('0x2c')]=_0x407b50[_0xd351('0x2c')][_0xd351('0x2d')]?_0x407b50[_0xd351('0x2c')]:_0x4d3f48[_0xd351('0x2a')];if(!_0x38471c[_0xd351('0x26')][_0xd351('0x2e')](_0xd351('0x2f'))){_0x407b50[_0xd351('0x17')]=qs['limit'](_0x38471c['query'][_0xd351('0x17')]);_0x407b50[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x38471c[_0xd351('0x26')][_0xd351('0x19')]);}_0x407b50[_0xd351('0x30')]=qs['sort'](_0x38471c['query'][_0xd351('0x31')]);_0x407b50['where']=qs[_0xd351('0x28')](_[_0xd351('0x32')](_0x38471c[_0xd351('0x26')],_0x4d3f48[_0xd351('0x28')]),_0x4aa902);if(_0x38471c[_0xd351('0x26')][_0xd351('0x33')]){_0x407b50[_0xd351('0x34')]=_[_0xd351('0x35')](_0x407b50[_0xd351('0x34')],{'$or':_[_0xd351('0x22')](_0x4aa902,function(_0x2b7170){if(_0x2b7170['type']!==_0xd351('0x36')){var _0x5f0b1c={};_0x5f0b1c[_0x2b7170[_0xd351('0x20')]]={'$like':'%'+_0x38471c[_0xd351('0x26')][_0xd351('0x33')]+'%'};return _0x5f0b1c;}})});}_0x407b50=_[_0xd351('0x35')]({},_0x407b50,_0x38471c[_0xd351('0x37')]);var _0x3db72a={'where':_0x407b50['where']};return db[_0xd351('0x38')][_0xd351('0x18')](_0x3db72a)['then'](function(_0x2e1219){_0x71ce9c[_0xd351('0x18')]=_0x2e1219;if(_0x38471c[_0xd351('0x26')][_0xd351('0x39')]){_0x407b50[_0xd351('0x3a')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x407b50);})[_0xd351('0x1f')](function(_0x3935aa){_0x71ce9c['rows']=_0x3935aa;return _0x71ce9c;})['then'](respondWithFilteredResult(_0x2ddae8,_0x407b50))[_0xd351('0x3b')](handleError(_0x2ddae8,null));};exports[_0xd351('0x3c')]=function(_0x4ff06a,_0x570d57){var _0x46af23={'raw':!![],'where':{'id':_0x4ff06a[_0xd351('0x3d')]['id']}},_0x18f9d1={};_0x18f9d1[_0xd351('0x2a')]=_[_0xd351('0x27')](db[_0xd351('0x38')][_0xd351('0x3e')]);_0x18f9d1[_0xd351('0x26')]=_[_0xd351('0x27')](_0x4ff06a['query']);_0x18f9d1['filters']=_[_0xd351('0x29')](_0x18f9d1[_0xd351('0x2a')],_0x18f9d1[_0xd351('0x26')]);_0x46af23[_0xd351('0x2c')]=_[_0xd351('0x29')](_0x18f9d1[_0xd351('0x2a')],qs[_0xd351('0x2b')](_0x4ff06a[_0xd351('0x26')][_0xd351('0x2b')]));_0x46af23[_0xd351('0x2c')]=_0x46af23[_0xd351('0x2c')][_0xd351('0x2d')]?_0x46af23[_0xd351('0x2c')]:_0x18f9d1[_0xd351('0x2a')];if(_0x4ff06a[_0xd351('0x26')][_0xd351('0x39')]){_0x46af23['include']=[{'all':!![]}];}_0x46af23=_[_0xd351('0x35')]({},_0x46af23,_0x4ff06a[_0xd351('0x37')]);return db[_0xd351('0x38')]['find'](_0x46af23)[_0xd351('0x1f')](handleEntityNotFound(_0x570d57,null))[_0xd351('0x1f')](respondWithResult(_0x570d57,null))[_0xd351('0x3b')](handleError(_0x570d57,null));};exports[_0xd351('0x3f')]=function(_0xbb92d4,_0x5bc86a){return db[_0xd351('0x38')]['create'](_0xbb92d4[_0xd351('0x40')],{})[_0xd351('0x1f')](respondWithResult(_0x5bc86a,0xc9))['catch'](handleError(_0x5bc86a,null));};exports['update']=function(_0x1bd727,_0x444206){if(_0x1bd727[_0xd351('0x40')]['id']){delete _0x1bd727['body']['id'];}return db[_0xd351('0x38')][_0xd351('0x41')]({'where':{'id':_0x1bd727['params']['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x444206,null))['then'](saveUpdates(_0x1bd727[_0xd351('0x40')],null))[_0xd351('0x1f')](respondWithResult(_0x444206,null))['catch'](handleError(_0x444206,null));};exports['destroy']=function(_0x25ea1e,_0x58ce5a){return db[_0xd351('0x38')][_0xd351('0x41')]({'where':{'id':_0x25ea1e[_0xd351('0x3d')]['id']}})['then'](handleEntityNotFound(_0x58ce5a,null))[_0xd351('0x1f')](removeEntity(_0x58ce5a,null))['catch'](handleError(_0x58ce5a,null));};exports['describe']=function(_0x48c287,_0x7e4bad){return db[_0xd351('0x38')][_0xd351('0x42')]()['then'](respondWithResult(_0x7e4bad,null))['catch'](handleError(_0x7e4bad,null));}; \ No newline at end of file +var _0xf45e=['Content-Range','json','apply','reject','save','destroy','then','sendStatus','stack','index','map','rawAttributes','type','key','model','name','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','WhatsappQueueReport','includeAll','include','findAll','rows','show','params','keys','length','merge','find','create','body','update','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set'];(function(_0x189307,_0x4791d5){var _0x87afe9=function(_0x37c315){while(--_0x37c315){_0x189307['push'](_0x189307['shift']());}};_0x87afe9(++_0x4791d5);}(_0xf45e,0x115));var _0xef45=function(_0x13d18b,_0x58777b){_0x13d18b=_0x13d18b-0x0;var _0x597a36=_0xf45e[_0x13d18b];return _0x597a36;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208b35,_0x5f0593){return function(_0x38b470){if(!_0x38b470){_0x208b35[_0xef45('0x2a')](0x194);}return _0x38b470;};}function handleError(_0x578f03,_0x46e423){_0x46e423=_0x46e423||0x1f4;return function(_0x2c356d){logger['error'](_0x2c356d[_0xef45('0x2b')]);if(_0x2c356d['name']){delete _0x2c356d['name'];}_0x578f03['status'](_0x46e423)['send'](_0x2c356d);};}exports[_0xef45('0x2c')]=function(_0x2f72ef,_0x217e8d){var _0x15ad38={},_0x5782d0={},_0x18f304={'count':0x0,'rows':[]};var _0x4f028c=_[_0xef45('0x2d')](db['WhatsappQueueReport'][_0xef45('0x2e')],function(_0x5bfd2d){return{'name':_0x5bfd2d['fieldName'],'type':_0x5bfd2d[_0xef45('0x2f')][_0xef45('0x30')]};});_0x5782d0[_0xef45('0x31')]=_[_0xef45('0x2d')](_0x4f028c,_0xef45('0x32'));_0x5782d0['query']=_['keys'](_0x2f72ef['query']);_0x5782d0[_0xef45('0x33')]=_[_0xef45('0x34')](_0x5782d0[_0xef45('0x31')],_0x5782d0[_0xef45('0x35')]);_0x15ad38[_0xef45('0x36')]=_[_0xef45('0x34')](_0x5782d0[_0xef45('0x31')],qs['fields'](_0x2f72ef['query'][_0xef45('0x37')]));_0x15ad38['attributes']=_0x15ad38[_0xef45('0x36')]['length']?_0x15ad38[_0xef45('0x36')]:_0x5782d0[_0xef45('0x31')];if(!_0x2f72ef[_0xef45('0x35')][_0xef45('0x38')](_0xef45('0x39'))){_0x15ad38['limit']=qs[_0xef45('0x20')](_0x2f72ef[_0xef45('0x35')][_0xef45('0x20')]);_0x15ad38['offset']=qs['offset'](_0x2f72ef[_0xef45('0x35')][_0xef45('0x1e')]);}_0x15ad38['order']=qs[_0xef45('0x3a')](_0x2f72ef['query']['sort']);_0x15ad38[_0xef45('0x3b')]=qs[_0xef45('0x33')](_[_0xef45('0x3c')](_0x2f72ef['query'],_0x5782d0[_0xef45('0x33')]),_0x4f028c);if(_0x2f72ef[_0xef45('0x35')][_0xef45('0x3d')]){_0x15ad38[_0xef45('0x3b')]=_['merge'](_0x15ad38['where'],{'$or':_[_0xef45('0x2d')](_0x4f028c,function(_0x474be1){if(_0x474be1[_0xef45('0x2f')]!==_0xef45('0x3e')){var _0x269a11={};_0x269a11[_0x474be1[_0xef45('0x32')]]={'$like':'%'+_0x2f72ef[_0xef45('0x35')][_0xef45('0x3d')]+'%'};return _0x269a11;}})});}_0x15ad38=_['merge']({},_0x15ad38,_0x2f72ef['options']);var _0x13f8b2={'where':_0x15ad38[_0xef45('0x3b')]};return db[_0xef45('0x3f')][_0xef45('0x21')](_0x13f8b2)[_0xef45('0x29')](function(_0x3bcada){_0x18f304[_0xef45('0x21')]=_0x3bcada;if(_0x2f72ef[_0xef45('0x35')][_0xef45('0x40')]){_0x15ad38[_0xef45('0x41')]=[{'all':!![]}];}return db[_0xef45('0x3f')][_0xef45('0x42')](_0x15ad38);})[_0xef45('0x29')](function(_0xd7d217){_0x18f304[_0xef45('0x43')]=_0xd7d217;return _0x18f304;})[_0xef45('0x29')](respondWithFilteredResult(_0x217e8d,_0x15ad38))['catch'](handleError(_0x217e8d,null));};exports[_0xef45('0x44')]=function(_0x5bdfad,_0x1b9d45){var _0x82c123={'raw':!![],'where':{'id':_0x5bdfad[_0xef45('0x45')]['id']}},_0x54ccb8={};_0x54ccb8['model']=_[_0xef45('0x46')](db['WhatsappQueueReport'][_0xef45('0x2e')]);_0x54ccb8[_0xef45('0x35')]=_[_0xef45('0x46')](_0x5bdfad[_0xef45('0x35')]);_0x54ccb8[_0xef45('0x33')]=_[_0xef45('0x34')](_0x54ccb8[_0xef45('0x31')],_0x54ccb8['query']);_0x82c123[_0xef45('0x36')]=_[_0xef45('0x34')](_0x54ccb8[_0xef45('0x31')],qs[_0xef45('0x37')](_0x5bdfad[_0xef45('0x35')][_0xef45('0x37')]));_0x82c123[_0xef45('0x36')]=_0x82c123[_0xef45('0x36')][_0xef45('0x47')]?_0x82c123[_0xef45('0x36')]:_0x54ccb8[_0xef45('0x31')];if(_0x5bdfad[_0xef45('0x35')][_0xef45('0x40')]){_0x82c123[_0xef45('0x41')]=[{'all':!![]}];}_0x82c123=_[_0xef45('0x48')]({},_0x82c123,_0x5bdfad['options']);return db[_0xef45('0x3f')][_0xef45('0x49')](_0x82c123)[_0xef45('0x29')](handleEntityNotFound(_0x1b9d45,null))['then'](respondWithResult(_0x1b9d45,null))['catch'](handleError(_0x1b9d45,null));};exports['create']=function(_0x29aeab,_0x18143c){return db[_0xef45('0x3f')][_0xef45('0x4a')](_0x29aeab[_0xef45('0x4b')],{})[_0xef45('0x29')](respondWithResult(_0x18143c,0xc9))['catch'](handleError(_0x18143c,null));};exports[_0xef45('0x4c')]=function(_0x463796,_0x2b2419){if(_0x463796['body']['id']){delete _0x463796['body']['id'];}return db[_0xef45('0x3f')][_0xef45('0x49')]({'where':{'id':_0x463796['params']['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x2b2419,null))[_0xef45('0x29')](saveUpdates(_0x463796[_0xef45('0x4b')],null))[_0xef45('0x29')](respondWithResult(_0x2b2419,null))[_0xef45('0x4d')](handleError(_0x2b2419,null));};exports[_0xef45('0x28')]=function(_0x23581f,_0xfa5fdd){return db[_0xef45('0x3f')][_0xef45('0x49')]({'where':{'id':_0x23581f[_0xef45('0x45')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0xfa5fdd,null))[_0xef45('0x29')](removeEntity(_0xfa5fdd,null))[_0xef45('0x4d')](handleError(_0xfa5fdd,null));};exports['describe']=function(_0x22b75e,_0x24aceb){return db[_0xef45('0x3f')]['describe']()[_0xef45('0x29')](respondWithResult(_0x24aceb,null))[_0xef45('0x4d')](handleError(_0x24aceb,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 878bc29..23fbde0 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 _0xdba1=['path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','request-promise'];(function(_0x2cde3d,_0x37644){var _0x2a7e9c=function(_0x845ecc){while(--_0x845ecc){_0x2cde3d['push'](_0x2cde3d['shift']());}};_0x2a7e9c(++_0x37644);}(_0xdba1,0x10c));var _0x1dba=function(_0x394075,_0x22c45e){_0x394075=_0x394075-0x0;var _0x5b9f10=_0xdba1[_0x394075];return _0x5b9f10;};'use strict';var _=require(_0x1dba('0x0'));var util=require(_0x1dba('0x1'));var logger=require(_0x1dba('0x2'))('api');var moment=require(_0x1dba('0x3'));var BPromise=require('bluebird');var rp=require(_0x1dba('0x4'));var fs=require('fs');var path=require(_0x1dba('0x5'));var rimraf=require(_0x1dba('0x6'));var config=require(_0x1dba('0x7'));var attributes=require(_0x1dba('0x8'));module[_0x1dba('0x9')]=function(_0x16ee64,_0x1acb1b){return _0x16ee64[_0x1dba('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0x1dba('0xb'),'paranoid':![],'indexes':[{'name':_0x1dba('0xc'),'fields':[_0x1dba('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c37=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x573325,_0x2f2fa5){var _0x1987bb=function(_0x2dfffa){while(--_0x2dfffa){_0x573325['push'](_0x573325['shift']());}};_0x1987bb(++_0x2f2fa5);}(_0x7c37,0xe9));var _0x77c3=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x7c37[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x77c3('0x0'));var util=require('util');var logger=require(_0x77c3('0x1'))('api');var moment=require(_0x77c3('0x2'));var BPromise=require(_0x77c3('0x3'));var rp=require(_0x77c3('0x4'));var fs=require('fs');var path=require(_0x77c3('0x5'));var rimraf=require(_0x77c3('0x6'));var config=require(_0x77c3('0x7'));var attributes=require('./whatsappQueueReport.attributes');module[_0x77c3('0x8')]=function(_0x3204c3,_0x386b23){return _0x3204c3[_0x77c3('0x9')](_0x77c3('0xa'),attributes,{'tableName':_0x77c3('0xb'),'paranoid':![],'indexes':[{'name':_0x77c3('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 9bb177a..045223d 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 _0x2b2a=['then','CreateWhatsappQueueReport','catch','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','WhatsappQueueReport','create','body','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b2a,0x1e7));var _0xa2b2=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x2b2a[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xa2b2('0x0'));var util=require(_0xa2b2('0x1'));var moment=require(_0xa2b2('0x2'));var BPromise=require(_0xa2b2('0x3'));var rs=require(_0xa2b2('0x4'));var fs=require('fs');var Redis=require(_0xa2b2('0x5'));var db=require(_0xa2b2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa2b2('0x7'));var jayson=require(_0xa2b2('0x8'));var client=jayson[_0xa2b2('0x9')][_0xa2b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bf07a,_0x5824ce,_0x254401){return new BPromise(function(_0x413022,_0x4558d2){return client['request'](_0x5bf07a,_0x254401)['then'](function(_0x51389a){logger['info'](_0xa2b2('0xb'),_0x5824ce,_0xa2b2('0xc'));logger[_0xa2b2('0xd')](_0xa2b2('0xe'),_0x5824ce,_0xa2b2('0xc'),JSON[_0xa2b2('0xf')](_0x51389a));if(_0x51389a['error']){if(_0x51389a['error'][_0xa2b2('0x10')]===0x1f4){logger[_0xa2b2('0x11')](_0xa2b2('0xb'),_0x5824ce,_0x51389a[_0xa2b2('0x11')][_0xa2b2('0x12')]);return _0x4558d2(_0x51389a[_0xa2b2('0x11')][_0xa2b2('0x12')]);}logger[_0xa2b2('0x11')](_0xa2b2('0xb'),_0x5824ce,_0x51389a[_0xa2b2('0x11')]['message']);return _0x413022(_0x51389a[_0xa2b2('0x11')][_0xa2b2('0x12')]);}else{logger[_0xa2b2('0x13')](_0xa2b2('0xb'),_0x5824ce,_0xa2b2('0xc'));_0x413022(_0x51389a['result'][_0xa2b2('0x12')]);}})['catch'](function(_0x337496){logger[_0xa2b2('0x11')](_0xa2b2('0xb'),_0x5824ce,_0x337496);_0x4558d2(_0x337496);});});}exports['CreateWhatsappQueueReport']=function(_0x519fd6){var _0x51ecd7=this;return new Promise(function(_0x24e658,_0x47c719){return db[_0xa2b2('0x14')][_0xa2b2('0x15')](_0x519fd6[_0xa2b2('0x16')],{'raw':_0x519fd6['options']?_0x519fd6[_0xa2b2('0x17')][_0xa2b2('0x18')]===undefined?!![]:![]:!![]})[_0xa2b2('0x19')](function(_0x8a30fc){logger[_0xa2b2('0x13')](_0xa2b2('0x1a'),_0x519fd6);logger[_0xa2b2('0xd')]('CreateWhatsappQueueReport',_0x519fd6,JSON['stringify'](_0x8a30fc));_0x24e658(_0x8a30fc);})[_0xa2b2('0x1b')](function(_0x28b1a0){logger['error'](_0xa2b2('0x1a'),_0x28b1a0['message'],_0x519fd6);_0x47c719(_0x51ecd7['error'](0x1f4,_0x28b1a0[_0xa2b2('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x826d5e){var _0x1a97b3=this;return new Promise(function(_0x5810c7,_0x466cc3){return db[_0xa2b2('0x14')]['update'](_0x826d5e['body'],{'raw':_0x826d5e[_0xa2b2('0x17')]?_0x826d5e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x826d5e['options']?_0x826d5e['options'][_0xa2b2('0x1c')]||null:null,'attributes':_0x826d5e[_0xa2b2('0x17')]?_0x826d5e[_0xa2b2('0x17')][_0xa2b2('0x1d')]||null:null,'limit':_0x826d5e[_0xa2b2('0x17')]?_0x826d5e[_0xa2b2('0x17')][_0xa2b2('0x1e')]||null:null})[_0xa2b2('0x19')](function(_0x2ab91c){logger[_0xa2b2('0x13')](_0xa2b2('0x1f'),_0x826d5e);logger[_0xa2b2('0xd')]('UpdateWhatsappQueueReport',_0x826d5e,JSON[_0xa2b2('0xf')](_0x2ab91c));_0x5810c7(_0x2ab91c);})['catch'](function(_0xfbcd78){logger['error'](_0xa2b2('0x1f'),_0xfbcd78['message'],_0x826d5e);_0x466cc3(_0x1a97b3[_0xa2b2('0x11')](0x1f4,_0xfbcd78[_0xa2b2('0x12')]));});});}; \ No newline at end of file +var _0x87cf=['info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappQueueReport','create','options','raw','then','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','body','where','limit','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x114281,_0x23c3f2){var _0x866964=function(_0x43c0f3){while(--_0x43c0f3){_0x114281['push'](_0x114281['shift']());}};_0x866964(++_0x23c3f2);}(_0x87cf,0x175));var _0xf87c=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x87cf[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf87c('0x0'));var BPromise=require(_0xf87c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf87c('0x2'));var db=require(_0xf87c('0x3'))['db'];var utils=require(_0xf87c('0x4'));var logger=require(_0xf87c('0x5'))(_0xf87c('0x6'));var config=require('../../config/environment');var jayson=require(_0xf87c('0x7'));var client=jayson[_0xf87c('0x8')][_0xf87c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1038b3,_0x3bf3cf,_0x5e07ff){return new BPromise(function(_0x3e423d,_0x6017cb){return client[_0xf87c('0xa')](_0x1038b3,_0x5e07ff)['then'](function(_0x5db8a3){logger[_0xf87c('0xb')](_0xf87c('0xc'),_0x3bf3cf,_0xf87c('0xd'));logger[_0xf87c('0xe')](_0xf87c('0xf'),_0x3bf3cf,'request\x20sent',JSON[_0xf87c('0x10')](_0x5db8a3));if(_0x5db8a3[_0xf87c('0x11')]){if(_0x5db8a3[_0xf87c('0x11')][_0xf87c('0x12')]===0x1f4){logger[_0xf87c('0x11')](_0xf87c('0xc'),_0x3bf3cf,_0x5db8a3[_0xf87c('0x11')][_0xf87c('0x13')]);return _0x6017cb(_0x5db8a3[_0xf87c('0x11')][_0xf87c('0x13')]);}logger[_0xf87c('0x11')](_0xf87c('0xc'),_0x3bf3cf,_0x5db8a3[_0xf87c('0x11')][_0xf87c('0x13')]);return _0x3e423d(_0x5db8a3['error'][_0xf87c('0x13')]);}else{logger[_0xf87c('0xb')](_0xf87c('0xc'),_0x3bf3cf,_0xf87c('0xd'));_0x3e423d(_0x5db8a3['result'][_0xf87c('0x13')]);}})[_0xf87c('0x14')](function(_0x40724b){logger[_0xf87c('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3bf3cf,_0x40724b);_0x6017cb(_0x40724b);});});}exports['CreateWhatsappQueueReport']=function(_0x31362b){var _0x471f31=this;return new Promise(function(_0x3fe6db,_0x1c1d6a){return db[_0xf87c('0x15')][_0xf87c('0x16')](_0x31362b['body'],{'raw':_0x31362b[_0xf87c('0x17')]?_0x31362b[_0xf87c('0x17')][_0xf87c('0x18')]===undefined?!![]:![]:!![]})[_0xf87c('0x19')](function(_0x522a45){logger[_0xf87c('0xb')](_0xf87c('0x1a'),_0x31362b);logger[_0xf87c('0xe')](_0xf87c('0x1a'),_0x31362b,JSON[_0xf87c('0x10')](_0x522a45));_0x3fe6db(_0x522a45);})['catch'](function(_0x187a28){logger[_0xf87c('0x11')]('CreateWhatsappQueueReport',_0x187a28[_0xf87c('0x13')],_0x31362b);_0x1c1d6a(_0x471f31['error'](0x1f4,_0x187a28['message']));});});};exports[_0xf87c('0x1b')]=function(_0xef2f99){var _0x437667=this;return new Promise(function(_0xec4a98,_0x48df96){return db[_0xf87c('0x15')][_0xf87c('0x1c')](_0xef2f99[_0xf87c('0x1d')],{'raw':_0xef2f99['options']?_0xef2f99['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xef2f99[_0xf87c('0x17')]?_0xef2f99[_0xf87c('0x17')][_0xf87c('0x1e')]||null:null,'attributes':_0xef2f99[_0xf87c('0x17')]?_0xef2f99[_0xf87c('0x17')]['attributes']||null:null,'limit':_0xef2f99[_0xf87c('0x17')]?_0xef2f99[_0xf87c('0x17')][_0xf87c('0x1f')]||null:null})[_0xf87c('0x19')](function(_0x29cae3){logger[_0xf87c('0xb')]('UpdateWhatsappQueueReport',_0xef2f99);logger[_0xf87c('0xe')](_0xf87c('0x1b'),_0xef2f99,JSON[_0xf87c('0x10')](_0x29cae3));_0xec4a98(_0x29cae3);})[_0xf87c('0x14')](function(_0x5efccb){logger[_0xf87c('0x11')](_0xf87c('0x1b'),_0x5efccb[_0xf87c('0x13')],_0xef2f99);_0x48df96(_0x437667['error'](0x1f4,_0x5efccb[_0xf87c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 8d62889..64139d9 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 _0xa694=['isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get'];(function(_0x3cc90b,_0x1b69d9){var _0x34051b=function(_0x1f01f7){while(--_0x1f01f7){_0x3cc90b['push'](_0x3cc90b['shift']());}};_0x34051b(++_0x1b69d9);}(_0xa694,0x145));var _0x4a69=function(_0x1b5535,_0x38d4ec){_0x1b5535=_0x1b5535-0x0;var _0x281948=_0xa694[_0x1b5535];return _0x281948;};'use strict';var multer=require(_0x4a69('0x0'));var util=require(_0x4a69('0x1'));var path=require(_0x4a69('0x2'));var timeout=require(_0x4a69('0x3'));var express=require(_0x4a69('0x4'));var router=express[_0x4a69('0x5')]();var fs_extra=require(_0x4a69('0x6'));var auth=require(_0x4a69('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4a69('0x8'));var controller=require(_0x4a69('0x9'));router[_0x4a69('0xa')]('/',auth[_0x4a69('0xb')](),controller[_0x4a69('0xc')]);router[_0x4a69('0xa')](_0x4a69('0xd'),auth[_0x4a69('0xb')](),controller['describe']);router['get'](_0x4a69('0xe'),auth[_0x4a69('0xb')](),controller['show']);router[_0x4a69('0xf')]('/',auth[_0x4a69('0xb')](),controller[_0x4a69('0x10')]);router[_0x4a69('0x11')]('/:id',auth[_0x4a69('0xb')](),controller[_0x4a69('0x12')]);router[_0x4a69('0x13')](_0x4a69('0xe'),auth['isAuthenticated'](),controller[_0x4a69('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5fd8=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x5fd8,0xf6));var _0x85fd=function(_0x1bea5b,_0x13f0ad){_0x1bea5b=_0x1bea5b-0x0;var _0xe31717=_0x5fd8[_0x1bea5b];return _0xe31717;};'use strict';var multer=require(_0x85fd('0x0'));var util=require(_0x85fd('0x1'));var path=require(_0x85fd('0x2'));var timeout=require('connect-timeout');var express=require(_0x85fd('0x3'));var router=express['Router']();var fs_extra=require(_0x85fd('0x4'));var auth=require(_0x85fd('0x5'));var interaction=require(_0x85fd('0x6'));var config=require(_0x85fd('0x7'));var controller=require(_0x85fd('0x8'));router[_0x85fd('0x9')]('/',auth[_0x85fd('0xa')](),controller[_0x85fd('0xb')]);router['get']('/describe',auth[_0x85fd('0xa')](),controller['describe']);router[_0x85fd('0x9')](_0x85fd('0xc'),auth[_0x85fd('0xa')](),controller[_0x85fd('0xd')]);router['post']('/',auth[_0x85fd('0xa')](),controller[_0x85fd('0xe')]);router['put'](_0x85fd('0xc'),auth[_0x85fd('0xa')](),controller[_0x85fd('0xf')]);router[_0x85fd('0x10')]('/:id',auth[_0x85fd('0xa')](),controller[_0x85fd('0x11')]);module[_0x85fd('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 0a0e815..ea283c6 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 _0x34b7=['account','agent','queue','DATE','STRING','ENUM'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0x34b7,0x196));var _0x734b=function(_0x1eebe4,_0x27f7b4){_0x1eebe4=_0x1eebe4-0x0;var _0x46f639=_0x34b7[_0x1eebe4];return _0x46f639;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x734b('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x734b('0x1')](_0x734b('0x2'),_0x734b('0x3'),_0x734b('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x734b('0x5')]}}; \ No newline at end of file +var _0x3aa2=['sequelize','exports','ENUM','queue','DATE'];(function(_0x28bbe4,_0x925216){var _0x1ff6fd=function(_0xea064){while(--_0xea064){_0x28bbe4['push'](_0x28bbe4['shift']());}};_0x1ff6fd(++_0x925216);}(_0x3aa2,0x13b));var _0x23aa=function(_0x37e342,_0x160c8f){_0x37e342=_0x37e342-0x0;var _0x1768f9=_0x3aa2[_0x37e342];return _0x1768f9;};'use strict';var Sequelize=require(_0x23aa('0x0'));module[_0x23aa('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x23aa('0x2')]('account','agent',_0x23aa('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x23aa('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 0af0fbd..d513e8f 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 _0xef50=['attributes','intersection','fields','length','order','sort','pick','filter','merge','where','type','VIRTUAL','WhatsappTransferReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters'];(function(_0x305678,_0x2043e7){var _0x29e3db=function(_0x167a88){while(--_0x167a88){_0x305678['push'](_0x305678['shift']());}};_0x29e3db(++_0x2043e7);}(_0xef50,0x1e1));var _0x0ef5=function(_0x4794e6,_0x544fa1){_0x4794e6=_0x4794e6-0x0;var _0x2b07d8=_0xef50[_0x4794e6];return _0x2b07d8;};'use strict';var emlformat=require(_0x0ef5('0x0'));var rimraf=require(_0x0ef5('0x1'));var zipdir=require(_0x0ef5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ef5('0x3'));var moment=require(_0x0ef5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0ef5('0x5'));var util=require(_0x0ef5('0x6'));var path=require(_0x0ef5('0x7'));var sox=require(_0x0ef5('0x8'));var csv=require('to-csv');var ejs=require(_0x0ef5('0x9'));var fs=require('fs');var fs_extra=require(_0x0ef5('0xa'));var _=require(_0x0ef5('0xb'));var squel=require(_0x0ef5('0xc'));var crypto=require(_0x0ef5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0ef5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ef5('0xf'));var Papa=require(_0x0ef5('0x10'));var Redis=require(_0x0ef5('0x11'));var authService=require(_0x0ef5('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ef5('0x13'));var logger=require(_0x0ef5('0x14'))(_0x0ef5('0x15'));var utils=require('../../config/utils');var config=require(_0x0ef5('0x16'));var licenseUtil=require(_0x0ef5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56f77e,_0x316630){_0x316630=_0x316630||0xcc;return function(_0x35fb4d){if(_0x35fb4d){return _0x56f77e[_0x0ef5('0x18')](_0x316630);}return _0x56f77e[_0x0ef5('0x19')](_0x316630)[_0x0ef5('0x1a')]();};}function respondWithResult(_0x78d461,_0x2dc027){_0x2dc027=_0x2dc027||0xc8;return function(_0x4c7bcf){if(_0x4c7bcf){return _0x78d461[_0x0ef5('0x19')](_0x2dc027)['json'](_0x4c7bcf);}};}function respondWithFilteredResult(_0x43559e,_0xa52849){return function(_0x4614db){if(_0x4614db){var _0x15a915=typeof _0xa52849['offset']===_0x0ef5('0x1b')&&typeof _0xa52849[_0x0ef5('0x1c')]===_0x0ef5('0x1b');var _0x39e2d3=_0x4614db[_0x0ef5('0x1d')];var _0x83753c=_0x15a915?0x0:_0xa52849[_0x0ef5('0x1e')];var _0x1df4c4=_0x15a915?_0x4614db[_0x0ef5('0x1d')]:_0xa52849[_0x0ef5('0x1e')]+_0xa52849[_0x0ef5('0x1c')];var _0x8e5edc;if(_0x1df4c4>=_0x39e2d3){_0x1df4c4=_0x39e2d3;_0x8e5edc=0xc8;}else{_0x8e5edc=0xce;}_0x43559e[_0x0ef5('0x19')](_0x8e5edc);return _0x43559e[_0x0ef5('0x1f')](_0x0ef5('0x20'),_0x83753c+'-'+_0x1df4c4+'/'+_0x39e2d3)[_0x0ef5('0x21')](_0x4614db);}return null;};}function patchUpdates(_0x29c2a4){return function(_0x4e4ac3){try{jsonpatch[_0x0ef5('0x22')](_0x4e4ac3,_0x29c2a4,!![]);}catch(_0x23535f){return BPromise[_0x0ef5('0x23')](_0x23535f);}return _0x4e4ac3['save']();};}function saveUpdates(_0x57beec,_0x3d6fa5){return function(_0x3e97e9){if(_0x3e97e9){return _0x3e97e9[_0x0ef5('0x24')](_0x57beec)[_0x0ef5('0x25')](function(_0x17c43a){return _0x17c43a;});}return null;};}function removeEntity(_0x3657d2,_0x162a4f){return function(_0x11d804){if(_0x11d804){return _0x11d804[_0x0ef5('0x26')]()['then'](function(){_0x3657d2[_0x0ef5('0x19')](0xcc)[_0x0ef5('0x1a')]();});}};}function handleEntityNotFound(_0x7224a9,_0x1903d1){return function(_0x14fb8c){if(!_0x14fb8c){_0x7224a9['sendStatus'](0x194);}return _0x14fb8c;};}function handleError(_0x3e88be,_0x5a9569){_0x5a9569=_0x5a9569||0x1f4;return function(_0x5c468c){logger[_0x0ef5('0x27')](_0x5c468c[_0x0ef5('0x28')]);if(_0x5c468c[_0x0ef5('0x29')]){delete _0x5c468c[_0x0ef5('0x29')];}_0x3e88be['status'](_0x5a9569)[_0x0ef5('0x2a')](_0x5c468c);};}exports[_0x0ef5('0x2b')]=function(_0x790c97,_0x19f602){var _0xa31d03={},_0x259763={},_0x549ab1={'count':0x0,'rows':[]};var _0x231345=_[_0x0ef5('0x2c')](db['WhatsappTransferReport'][_0x0ef5('0x2d')],function(_0x43c56c){return{'name':_0x43c56c['fieldName'],'type':_0x43c56c['type'][_0x0ef5('0x2e')]};});_0x259763[_0x0ef5('0x2f')]=_['map'](_0x231345,_0x0ef5('0x29'));_0x259763['query']=_[_0x0ef5('0x30')](_0x790c97[_0x0ef5('0x31')]);_0x259763[_0x0ef5('0x32')]=_['intersection'](_0x259763[_0x0ef5('0x2f')],_0x259763['query']);_0xa31d03[_0x0ef5('0x33')]=_[_0x0ef5('0x34')](_0x259763['model'],qs[_0x0ef5('0x35')](_0x790c97[_0x0ef5('0x31')]['fields']));_0xa31d03[_0x0ef5('0x33')]=_0xa31d03[_0x0ef5('0x33')][_0x0ef5('0x36')]?_0xa31d03[_0x0ef5('0x33')]:_0x259763[_0x0ef5('0x2f')];if(!_0x790c97[_0x0ef5('0x31')]['hasOwnProperty']('nolimit')){_0xa31d03[_0x0ef5('0x1c')]=qs[_0x0ef5('0x1c')](_0x790c97[_0x0ef5('0x31')]['limit']);_0xa31d03[_0x0ef5('0x1e')]=qs['offset'](_0x790c97['query'][_0x0ef5('0x1e')]);}_0xa31d03[_0x0ef5('0x37')]=qs[_0x0ef5('0x38')](_0x790c97[_0x0ef5('0x31')][_0x0ef5('0x38')]);_0xa31d03['where']=qs[_0x0ef5('0x32')](_[_0x0ef5('0x39')](_0x790c97[_0x0ef5('0x31')],_0x259763['filters']),_0x231345);if(_0x790c97['query'][_0x0ef5('0x3a')]){_0xa31d03['where']=_[_0x0ef5('0x3b')](_0xa31d03[_0x0ef5('0x3c')],{'$or':_[_0x0ef5('0x2c')](_0x231345,function(_0x31ff08){if(_0x31ff08[_0x0ef5('0x3d')]!==_0x0ef5('0x3e')){var _0x29e6c0={};_0x29e6c0[_0x31ff08[_0x0ef5('0x29')]]={'$like':'%'+_0x790c97['query'][_0x0ef5('0x3a')]+'%'};return _0x29e6c0;}})});}_0xa31d03=_['merge']({},_0xa31d03,_0x790c97['options']);var _0x27439e={'where':_0xa31d03[_0x0ef5('0x3c')]};return db[_0x0ef5('0x3f')][_0x0ef5('0x1d')](_0x27439e)[_0x0ef5('0x25')](function(_0x213f74){_0x549ab1[_0x0ef5('0x1d')]=_0x213f74;if(_0x790c97['query'][_0x0ef5('0x40')]){_0xa31d03[_0x0ef5('0x41')]=[{'all':!![]}];}return db[_0x0ef5('0x3f')][_0x0ef5('0x42')](_0xa31d03);})[_0x0ef5('0x25')](function(_0x3a5b4a){_0x549ab1[_0x0ef5('0x43')]=_0x3a5b4a;return _0x549ab1;})[_0x0ef5('0x25')](respondWithFilteredResult(_0x19f602,_0xa31d03))[_0x0ef5('0x44')](handleError(_0x19f602,null));};exports[_0x0ef5('0x45')]=function(_0x34685b,_0x49474e){var _0x4adc17={'raw':!![],'where':{'id':_0x34685b[_0x0ef5('0x46')]['id']}},_0x4b0dff={};_0x4b0dff[_0x0ef5('0x2f')]=_[_0x0ef5('0x30')](db[_0x0ef5('0x3f')][_0x0ef5('0x2d')]);_0x4b0dff[_0x0ef5('0x31')]=_[_0x0ef5('0x30')](_0x34685b[_0x0ef5('0x31')]);_0x4b0dff[_0x0ef5('0x32')]=_['intersection'](_0x4b0dff[_0x0ef5('0x2f')],_0x4b0dff[_0x0ef5('0x31')]);_0x4adc17[_0x0ef5('0x33')]=_[_0x0ef5('0x34')](_0x4b0dff[_0x0ef5('0x2f')],qs[_0x0ef5('0x35')](_0x34685b['query']['fields']));_0x4adc17[_0x0ef5('0x33')]=_0x4adc17[_0x0ef5('0x33')][_0x0ef5('0x36')]?_0x4adc17['attributes']:_0x4b0dff[_0x0ef5('0x2f')];if(_0x34685b[_0x0ef5('0x31')][_0x0ef5('0x40')]){_0x4adc17[_0x0ef5('0x41')]=[{'all':!![]}];}_0x4adc17=_[_0x0ef5('0x3b')]({},_0x4adc17,_0x34685b[_0x0ef5('0x47')]);return db[_0x0ef5('0x3f')][_0x0ef5('0x48')](_0x4adc17)['then'](handleEntityNotFound(_0x49474e,null))['then'](respondWithResult(_0x49474e,null))[_0x0ef5('0x44')](handleError(_0x49474e,null));};exports[_0x0ef5('0x49')]=function(_0x3eb5d2,_0x40c570){return db[_0x0ef5('0x3f')][_0x0ef5('0x49')](_0x3eb5d2[_0x0ef5('0x4a')],{})[_0x0ef5('0x25')](respondWithResult(_0x40c570,0xc9))[_0x0ef5('0x44')](handleError(_0x40c570,null));};exports[_0x0ef5('0x24')]=function(_0x554c2b,_0x1b4416){if(_0x554c2b[_0x0ef5('0x4a')]['id']){delete _0x554c2b[_0x0ef5('0x4a')]['id'];}return db[_0x0ef5('0x3f')][_0x0ef5('0x48')]({'where':{'id':_0x554c2b[_0x0ef5('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b4416,null))['then'](saveUpdates(_0x554c2b[_0x0ef5('0x4a')],null))[_0x0ef5('0x25')](respondWithResult(_0x1b4416,null))[_0x0ef5('0x44')](handleError(_0x1b4416,null));};exports[_0x0ef5('0x26')]=function(_0x51fb73,_0x5e8ffa){return db['WhatsappTransferReport']['find']({'where':{'id':_0x51fb73[_0x0ef5('0x46')]['id']}})[_0x0ef5('0x25')](handleEntityNotFound(_0x5e8ffa,null))['then'](removeEntity(_0x5e8ffa,null))['catch'](handleError(_0x5e8ffa,null));};exports['describe']=function(_0x343e45,_0x2fb40c){return db[_0x0ef5('0x3f')][_0x0ef5('0x4b')]()[_0x0ef5('0x25')](respondWithResult(_0x2fb40c,null))['catch'](handleError(_0x2fb40c,null));}; \ No newline at end of file +var _0x08e2=['rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','WhatsappTransferReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','eml-format'];(function(_0x1f5da5,_0x1d02a7){var _0x5f3eba=function(_0x5143d3){while(--_0x5143d3){_0x1f5da5['push'](_0x1f5da5['shift']());}};_0x5f3eba(++_0x1d02a7);}(_0x08e2,0xe0));var _0x208e=function(_0x3c4ae9,_0xed360a){_0x3c4ae9=_0x3c4ae9-0x0;var _0x3230f5=_0x08e2[_0x3c4ae9];return _0x3230f5;};'use strict';var emlformat=require(_0x208e('0x0'));var rimraf=require(_0x208e('0x1'));var zipdir=require(_0x208e('0x2'));var jsonpatch=require(_0x208e('0x3'));var rp=require(_0x208e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x208e('0x5'));var util=require(_0x208e('0x6'));var path=require(_0x208e('0x7'));var sox=require(_0x208e('0x8'));var csv=require(_0x208e('0x9'));var ejs=require(_0x208e('0xa'));var fs=require('fs');var fs_extra=require(_0x208e('0xb'));var _=require(_0x208e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x208e('0xd'));var deskjs=require(_0x208e('0xe'));var toCsv=require(_0x208e('0x9'));var querystring=require(_0x208e('0xf'));var Papa=require(_0x208e('0x10'));var Redis=require('ioredis');var authService=require(_0x208e('0x11'));var qs=require(_0x208e('0x12'));var as=require(_0x208e('0x13'));var hardwareService=require(_0x208e('0x14'));var logger=require(_0x208e('0x15'))(_0x208e('0x16'));var utils=require(_0x208e('0x17'));var config=require(_0x208e('0x18'));var licenseUtil=require(_0x208e('0x19'));var db=require(_0x208e('0x1a'))['db'];function respondWithStatusCode(_0x1fdf03,_0xc131b1){_0xc131b1=_0xc131b1||0xcc;return function(_0x46afc8){if(_0x46afc8){return _0x1fdf03[_0x208e('0x1b')](_0xc131b1);}return _0x1fdf03[_0x208e('0x1c')](_0xc131b1)[_0x208e('0x1d')]();};}function respondWithResult(_0x228052,_0xc25b69){_0xc25b69=_0xc25b69||0xc8;return function(_0x86dcd5){if(_0x86dcd5){return _0x228052[_0x208e('0x1c')](_0xc25b69)[_0x208e('0x1e')](_0x86dcd5);}};}function respondWithFilteredResult(_0x395a3c,_0x391fb2){return function(_0x4f2d98){if(_0x4f2d98){var _0x48fa20=typeof _0x391fb2[_0x208e('0x1f')]===_0x208e('0x20')&&typeof _0x391fb2[_0x208e('0x21')]===_0x208e('0x20');var _0x1dca9f=_0x4f2d98[_0x208e('0x22')];var _0x5641cc=_0x48fa20?0x0:_0x391fb2[_0x208e('0x1f')];var _0x1b247d=_0x48fa20?_0x4f2d98[_0x208e('0x22')]:_0x391fb2[_0x208e('0x1f')]+_0x391fb2[_0x208e('0x21')];var _0x4be8a5;if(_0x1b247d>=_0x1dca9f){_0x1b247d=_0x1dca9f;_0x4be8a5=0xc8;}else{_0x4be8a5=0xce;}_0x395a3c[_0x208e('0x1c')](_0x4be8a5);return _0x395a3c[_0x208e('0x23')](_0x208e('0x24'),_0x5641cc+'-'+_0x1b247d+'/'+_0x1dca9f)['json'](_0x4f2d98);}return null;};}function patchUpdates(_0x25347f){return function(_0x73c180){try{jsonpatch[_0x208e('0x25')](_0x73c180,_0x25347f,!![]);}catch(_0xc4fab5){return BPromise[_0x208e('0x26')](_0xc4fab5);}return _0x73c180[_0x208e('0x27')]();};}function saveUpdates(_0x275a19,_0x14b509){return function(_0x4e0d69){if(_0x4e0d69){return _0x4e0d69[_0x208e('0x28')](_0x275a19)[_0x208e('0x29')](function(_0x18bc35){return _0x18bc35;});}return null;};}function removeEntity(_0x331d43,_0x1777de){return function(_0x13742f){if(_0x13742f){return _0x13742f['destroy']()[_0x208e('0x29')](function(){_0x331d43[_0x208e('0x1c')](0xcc)[_0x208e('0x1d')]();});}};}function handleEntityNotFound(_0x2cc8b9,_0x5ec5eb){return function(_0x896c4e){if(!_0x896c4e){_0x2cc8b9[_0x208e('0x1b')](0x194);}return _0x896c4e;};}function handleError(_0xcc7d6a,_0xb43d1f){_0xb43d1f=_0xb43d1f||0x1f4;return function(_0x569179){logger[_0x208e('0x2a')](_0x569179[_0x208e('0x2b')]);if(_0x569179[_0x208e('0x2c')]){delete _0x569179[_0x208e('0x2c')];}_0xcc7d6a[_0x208e('0x1c')](_0xb43d1f)[_0x208e('0x2d')](_0x569179);};}exports['index']=function(_0x4600d0,_0x457f73){var _0x1aefba={},_0x34e91c={},_0x39f45b={'count':0x0,'rows':[]};var _0x1f2ae5=_['map'](db[_0x208e('0x2e')][_0x208e('0x2f')],function(_0x44da62){return{'name':_0x44da62[_0x208e('0x30')],'type':_0x44da62['type'][_0x208e('0x31')]};});_0x34e91c[_0x208e('0x32')]=_[_0x208e('0x33')](_0x1f2ae5,'name');_0x34e91c['query']=_['keys'](_0x4600d0[_0x208e('0x34')]);_0x34e91c[_0x208e('0x35')]=_[_0x208e('0x36')](_0x34e91c[_0x208e('0x32')],_0x34e91c['query']);_0x1aefba[_0x208e('0x37')]=_[_0x208e('0x36')](_0x34e91c[_0x208e('0x32')],qs['fields'](_0x4600d0['query'][_0x208e('0x38')]));_0x1aefba[_0x208e('0x37')]=_0x1aefba[_0x208e('0x37')][_0x208e('0x39')]?_0x1aefba[_0x208e('0x37')]:_0x34e91c[_0x208e('0x32')];if(!_0x4600d0[_0x208e('0x34')][_0x208e('0x3a')]('nolimit')){_0x1aefba[_0x208e('0x21')]=qs['limit'](_0x4600d0[_0x208e('0x34')][_0x208e('0x21')]);_0x1aefba[_0x208e('0x1f')]=qs[_0x208e('0x1f')](_0x4600d0[_0x208e('0x34')][_0x208e('0x1f')]);}_0x1aefba['order']=qs[_0x208e('0x3b')](_0x4600d0['query'][_0x208e('0x3b')]);_0x1aefba['where']=qs[_0x208e('0x35')](_[_0x208e('0x3c')](_0x4600d0['query'],_0x34e91c['filters']),_0x1f2ae5);if(_0x4600d0[_0x208e('0x34')][_0x208e('0x3d')]){_0x1aefba[_0x208e('0x3e')]=_[_0x208e('0x3f')](_0x1aefba[_0x208e('0x3e')],{'$or':_['map'](_0x1f2ae5,function(_0x2e9beb){if(_0x2e9beb[_0x208e('0x40')]!==_0x208e('0x41')){var _0xa5a430={};_0xa5a430[_0x2e9beb[_0x208e('0x2c')]]={'$like':'%'+_0x4600d0[_0x208e('0x34')][_0x208e('0x3d')]+'%'};return _0xa5a430;}})});}_0x1aefba=_['merge']({},_0x1aefba,_0x4600d0['options']);var _0x8e5020={'where':_0x1aefba[_0x208e('0x3e')]};return db[_0x208e('0x2e')][_0x208e('0x22')](_0x8e5020)[_0x208e('0x29')](function(_0x346d4f){_0x39f45b['count']=_0x346d4f;if(_0x4600d0[_0x208e('0x34')][_0x208e('0x42')]){_0x1aefba[_0x208e('0x43')]=[{'all':!![]}];}return db[_0x208e('0x2e')]['findAll'](_0x1aefba);})[_0x208e('0x29')](function(_0x4d327f){_0x39f45b[_0x208e('0x44')]=_0x4d327f;return _0x39f45b;})['then'](respondWithFilteredResult(_0x457f73,_0x1aefba))[_0x208e('0x45')](handleError(_0x457f73,null));};exports['show']=function(_0x4d5c9f,_0x5cb1fb){var _0x479b55={'raw':!![],'where':{'id':_0x4d5c9f[_0x208e('0x46')]['id']}},_0x2b82d3={};_0x2b82d3[_0x208e('0x32')]=_['keys'](db[_0x208e('0x2e')][_0x208e('0x2f')]);_0x2b82d3[_0x208e('0x34')]=_['keys'](_0x4d5c9f[_0x208e('0x34')]);_0x2b82d3[_0x208e('0x35')]=_[_0x208e('0x36')](_0x2b82d3['model'],_0x2b82d3[_0x208e('0x34')]);_0x479b55[_0x208e('0x37')]=_[_0x208e('0x36')](_0x2b82d3[_0x208e('0x32')],qs['fields'](_0x4d5c9f[_0x208e('0x34')][_0x208e('0x38')]));_0x479b55[_0x208e('0x37')]=_0x479b55[_0x208e('0x37')][_0x208e('0x39')]?_0x479b55['attributes']:_0x2b82d3['model'];if(_0x4d5c9f[_0x208e('0x34')]['includeAll']){_0x479b55[_0x208e('0x43')]=[{'all':!![]}];}_0x479b55=_[_0x208e('0x3f')]({},_0x479b55,_0x4d5c9f[_0x208e('0x47')]);return db[_0x208e('0x2e')][_0x208e('0x48')](_0x479b55)[_0x208e('0x29')](handleEntityNotFound(_0x5cb1fb,null))['then'](respondWithResult(_0x5cb1fb,null))['catch'](handleError(_0x5cb1fb,null));};exports['create']=function(_0x1dbf5a,_0x409abc){return db[_0x208e('0x2e')][_0x208e('0x49')](_0x1dbf5a[_0x208e('0x4a')],{})[_0x208e('0x29')](respondWithResult(_0x409abc,0xc9))['catch'](handleError(_0x409abc,null));};exports[_0x208e('0x28')]=function(_0x551d94,_0x4a1fff){if(_0x551d94[_0x208e('0x4a')]['id']){delete _0x551d94['body']['id'];}return db['WhatsappTransferReport'][_0x208e('0x48')]({'where':{'id':_0x551d94[_0x208e('0x46')]['id']}})[_0x208e('0x29')](handleEntityNotFound(_0x4a1fff,null))[_0x208e('0x29')](saveUpdates(_0x551d94[_0x208e('0x4a')],null))['then'](respondWithResult(_0x4a1fff,null))[_0x208e('0x45')](handleError(_0x4a1fff,null));};exports['destroy']=function(_0x53b342,_0x3cd855){return db[_0x208e('0x2e')]['find']({'where':{'id':_0x53b342[_0x208e('0x46')]['id']}})[_0x208e('0x29')](handleEntityNotFound(_0x3cd855,null))[_0x208e('0x29')](removeEntity(_0x3cd855,null))[_0x208e('0x45')](handleError(_0x3cd855,null));};exports['describe']=function(_0x4f1ef0,_0x2c35db){return db[_0x208e('0x2e')]['describe']()['then'](respondWithResult(_0x2c35db,null))[_0x208e('0x45')](handleError(_0x2c35db,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 7766e81..ae4fe5b 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 _0xb25d=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','report_whatsapp_transfer','lodash','util'];(function(_0x2e49c5,_0x41f824){var _0xad7c45=function(_0x3db6b3){while(--_0x3db6b3){_0x2e49c5['push'](_0x2e49c5['shift']());}};_0xad7c45(++_0x41f824);}(_0xb25d,0x12a));var _0xdb25=function(_0x15b75c,_0x52f837){_0x15b75c=_0x15b75c-0x0;var _0x1fb570=_0xb25d[_0x15b75c];return _0x1fb570;};'use strict';var _=require(_0xdb25('0x0'));var util=require(_0xdb25('0x1'));var logger=require(_0xdb25('0x2'))(_0xdb25('0x3'));var moment=require(_0xdb25('0x4'));var BPromise=require(_0xdb25('0x5'));var rp=require(_0xdb25('0x6'));var fs=require('fs');var path=require(_0xdb25('0x7'));var rimraf=require('rimraf');var config=require(_0xdb25('0x8'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x3a6a67,_0x245274){return _0x3a6a67['define']('WhatsappTransferReport',attributes,{'tableName':_0xdb25('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2d9=['api','moment','request-promise','path','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xf2d9,0x1c7));var _0x9f2d=function(_0x3005ce,_0x551f91){_0x3005ce=_0x3005ce-0x0;var _0x141beb=_0xf2d9[_0x3005ce];return _0x141beb;};'use strict';var _=require(_0x9f2d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9f2d('0x1'));var moment=require(_0x9f2d('0x2'));var BPromise=require('bluebird');var rp=require(_0x9f2d('0x3'));var fs=require('fs');var path=require(_0x9f2d('0x4'));var rimraf=require('rimraf');var config=require(_0x9f2d('0x5'));var attributes=require(_0x9f2d('0x6'));module[_0x9f2d('0x7')]=function(_0x2b175e,_0x5b4433){return _0x2b175e[_0x9f2d('0x8')](_0x9f2d('0x9'),attributes,{'tableName':_0x9f2d('0xa'),'paranoid':![],'indexes':[{'name':_0x9f2d('0xb'),'fields':[_0x9f2d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 79a3113..92c05c0 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 _0xc121=['stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x32ec4f,_0x42b5d5){var _0x5ff5a6=function(_0x4d7e80){while(--_0x4d7e80){_0x32ec4f['push'](_0x32ec4f['shift']());}};_0x5ff5a6(++_0x42b5d5);}(_0xc121,0xc7));var _0x1c12=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xc121[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x1c12('0x0'));var util=require(_0x1c12('0x1'));var moment=require('moment');var BPromise=require(_0x1c12('0x2'));var rs=require(_0x1c12('0x3'));var fs=require('fs');var Redis=require(_0x1c12('0x4'));var db=require(_0x1c12('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c12('0x6'))(_0x1c12('0x7'));var config=require(_0x1c12('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1c12('0x9')][_0x1c12('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc67fe0,_0x3d5c38,_0x4b6ae0){return new BPromise(function(_0x1d8b05,_0x22471a){return client[_0x1c12('0xb')](_0xc67fe0,_0x4b6ae0)[_0x1c12('0xc')](function(_0x4881b5){logger['info'](_0x1c12('0xd'),_0x3d5c38,_0x1c12('0xe'));logger[_0x1c12('0xf')](_0x1c12('0x10'),_0x3d5c38,_0x1c12('0xe'),JSON[_0x1c12('0x11')](_0x4881b5));if(_0x4881b5['error']){if(_0x4881b5[_0x1c12('0x12')][_0x1c12('0x13')]===0x1f4){logger[_0x1c12('0x12')](_0x1c12('0xd'),_0x3d5c38,_0x4881b5[_0x1c12('0x12')][_0x1c12('0x14')]);return _0x22471a(_0x4881b5[_0x1c12('0x12')][_0x1c12('0x14')]);}logger[_0x1c12('0x12')](_0x1c12('0xd'),_0x3d5c38,_0x4881b5[_0x1c12('0x12')][_0x1c12('0x14')]);return _0x1d8b05(_0x4881b5['error'][_0x1c12('0x14')]);}else{logger[_0x1c12('0x15')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3d5c38,_0x1c12('0xe'));_0x1d8b05(_0x4881b5[_0x1c12('0x16')][_0x1c12('0x14')]);}})[_0x1c12('0x17')](function(_0x53e1f8){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3d5c38,_0x53e1f8);_0x22471a(_0x53e1f8);});});} \ No newline at end of file +var _0xdedc=['WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xdedc,0x178));var _0xcded=function(_0x5c9844,_0x14354f){_0x5c9844=_0x5c9844-0x0;var _0x3663b8=_0xdedc[_0x5c9844];return _0x3663b8;};'use strict';var _=require('lodash');var util=require(_0xcded('0x0'));var moment=require(_0xcded('0x1'));var BPromise=require(_0xcded('0x2'));var rs=require(_0xcded('0x3'));var fs=require('fs');var Redis=require(_0xcded('0x4'));var db=require(_0xcded('0x5'))['db'];var utils=require(_0xcded('0x6'));var logger=require(_0xcded('0x7'))(_0xcded('0x8'));var config=require(_0xcded('0x9'));var jayson=require(_0xcded('0xa'));var client=jayson[_0xcded('0xb')][_0xcded('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ac8e6,_0xaf9b06,_0x1d0749){return new BPromise(function(_0x52faf5,_0x23d3f5){return client['request'](_0x4ac8e6,_0x1d0749)[_0xcded('0xd')](function(_0xcb3150){logger[_0xcded('0xe')](_0xcded('0xf'),_0xaf9b06,_0xcded('0x10'));logger['debug'](_0xcded('0x11'),_0xaf9b06,_0xcded('0x10'),JSON[_0xcded('0x12')](_0xcb3150));if(_0xcb3150[_0xcded('0x13')]){if(_0xcb3150[_0xcded('0x13')]['code']===0x1f4){logger[_0xcded('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0xaf9b06,_0xcb3150[_0xcded('0x13')][_0xcded('0x14')]);return _0x23d3f5(_0xcb3150[_0xcded('0x13')][_0xcded('0x14')]);}logger['error'](_0xcded('0xf'),_0xaf9b06,_0xcb3150[_0xcded('0x13')]['message']);return _0x52faf5(_0xcb3150['error'][_0xcded('0x14')]);}else{logger[_0xcded('0xe')](_0xcded('0xf'),_0xaf9b06,_0xcded('0x10'));_0x52faf5(_0xcb3150[_0xcded('0x15')][_0xcded('0x14')]);}})[_0xcded('0x16')](function(_0x4c49f1){logger[_0xcded('0x13')](_0xcded('0xf'),_0xaf9b06,_0x4c49f1);_0x23d3f5(_0x4c49f1);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index a7fe784..304624b 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87da=['sequelize','then','listen','info','start','map','filter','name','join','Offline\x20apps:','status','online','None','seedDB','./config/seedDB','./config/license','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x87da,0x122));var _0xa87d=function(_0x2e3045,_0x981539){_0x2e3045=_0x2e3045-0x0;var _0x2844cb=_0x87da[_0x2e3045];return _0x2844cb;};'use strict';var _=require(_0xa87d('0x0'));var mysqldb=require(_0xa87d('0x1'));var rpc=require(_0xa87d('0x2'));var config=require(_0xa87d('0x3'));var logger=require(_0xa87d('0x4'))('app');var pm2=require(_0xa87d('0x5'));var pm2Config=require(_0xa87d('0x6'));var schedule=require(_0xa87d('0x7'));var chat=require(_0xa87d('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xa87d('0x9'));function main(){return mysqldb['db'][_0xa87d('0xa')]['sync']()[_0xa87d('0xb')](function(){return rpc[_0xa87d('0xc')]();})[_0xa87d('0xb')](function(_0x3249d5){logger[_0xa87d('0xd')](_0x3249d5);return chat[_0xa87d('0xe')]();})[_0xa87d('0xb')](function(){return whatsapp['start']();})[_0xa87d('0xb')](function(){return schedule[_0xa87d('0xe')]();})[_0xa87d('0xb')](function(){return transcribe[_0xa87d('0xe')]();})[_0xa87d('0xb')](function(_0x12462a){logger[_0xa87d('0xd')](_0x12462a);return pm2[_0xa87d('0xe')](pm2Config);})[_0xa87d('0xb')](function(_0x2d8b8f){logger[_0xa87d('0xd')]('Online\x20apps:',_[_0xa87d('0xf')](_[_0xa87d('0x10')](_0x2d8b8f,{'status':'online'}),_0xa87d('0x11'))[_0xa87d('0x12')]());logger[_0xa87d('0xd')](_0xa87d('0x13'),_[_0xa87d('0xf')](_[_0xa87d('0x10')](_0x2d8b8f,function(_0x3e5505){return _0x3e5505[_0xa87d('0x14')]!==_0xa87d('0x15');}),_0xa87d('0x11'))[_0xa87d('0x12')]()||_0xa87d('0x16'));config[_0xa87d('0x17')]&&require(_0xa87d('0x18'))['default']();require(_0xa87d('0x19'))[_0xa87d('0x1a')]();})[_0xa87d('0x1b')](function(_0x36c297){logger['error'](_0xa87d('0x1c'),_0x36c297);process[_0xa87d('0x1d')](0x1);});}main(); \ No newline at end of file +var _0x6cf1=['./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','map','name','Offline\x20apps:','status','online','join','None','./config/seedDB','./config/license','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/pm2'];(function(_0x11f818,_0x30eac0){var _0x4bdb2f=function(_0x5b9ddd){while(--_0x5b9ddd){_0x11f818['push'](_0x11f818['shift']());}};_0x4bdb2f(++_0x30eac0);}(_0x6cf1,0x111));var _0x16cf=function(_0x1176e9,_0x2bc354){_0x1176e9=_0x1176e9-0x0;var _0x4a3e50=_0x6cf1[_0x1176e9];return _0x4a3e50;};'use strict';var _=require(_0x16cf('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require('./config/environment');var logger=require('./config/logger')('app');var pm2=require(_0x16cf('0x1'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x16cf('0x2'));var chat=require(_0x16cf('0x3'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x16cf('0x4'));function main(){return mysqldb['db'][_0x16cf('0x5')][_0x16cf('0x6')]()[_0x16cf('0x7')](function(){return rpc[_0x16cf('0x8')]();})[_0x16cf('0x7')](function(_0x2b1e89){logger[_0x16cf('0x9')](_0x2b1e89);return chat[_0x16cf('0xa')]();})[_0x16cf('0x7')](function(){return whatsapp[_0x16cf('0xa')]();})['then'](function(){return schedule[_0x16cf('0xa')]();})[_0x16cf('0x7')](function(){return transcribe[_0x16cf('0xa')]();})[_0x16cf('0x7')](function(_0x2aa6f8){logger[_0x16cf('0x9')](_0x2aa6f8);return pm2['start'](pm2Config);})['then'](function(_0x4af601){logger['info']('Online\x20apps:',_[_0x16cf('0xb')](_['filter'](_0x4af601,{'status':'online'}),_0x16cf('0xc'))['join']());logger[_0x16cf('0x9')](_0x16cf('0xd'),_[_0x16cf('0xb')](_['filter'](_0x4af601,function(_0x2a2a95){return _0x2a2a95[_0x16cf('0xe')]!==_0x16cf('0xf');}),_0x16cf('0xc'))[_0x16cf('0x10')]()||_0x16cf('0x11'));config['seedDB']&&require(_0x16cf('0x12'))['default']();require(_0x16cf('0x13'))[_0x16cf('0x14')]();})[_0x16cf('0x15')](function(_0x1bab99){logger[_0x16cf('0x16')](_0x16cf('0x17'),_0x1bab99);process[_0x16cf('0x18')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 92c50e5..4a9d5ff 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 _0xa946=['The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','splice','unshift','encryptString','sign','secret','promisify','hex','floor','toString','HS512','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','secrets','session','role','fullname','name','internal','email','userpic','md5secret','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','catch','headers','startsWith','authorization','Basic','User','find','authenticate','pass','json','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.'];(function(_0x2e6c19,_0x131233){var _0x52885d=function(_0x38f224){while(--_0x38f224){_0x2e6c19['push'](_0x2e6c19['shift']());}};_0x52885d(++_0x131233);}(_0xa946,0xff));var _0x6a94=function(_0x26236f,_0x36916c){_0x26236f=_0x26236f-0x0;var _0x11c59f=_0xa946[_0x26236f];return _0x11c59f;};'use strict';var db=require(_0x6a94('0x0'))['db'];var config=require(_0x6a94('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x6a94('0x2'));var encryptor=require(_0x6a94('0x3'));var _=require('lodash');var jwt=require(_0x6a94('0x4'));var expressJwt=require(_0x6a94('0x5'));var compose=require(_0x6a94('0x6'));var basicAuth=require(_0x6a94('0x7'));var crypto=require(_0x6a94('0x8'));var BPromise=require('bluebird');var util=require(_0x6a94('0x9'));var moment=require(_0x6a94('0xa'));var validateJwt=expressJwt({'secret':config[_0x6a94('0xb')][_0x6a94('0xc')]});var userAttributes=['id',_0x6a94('0xd'),_0x6a94('0xe'),_0x6a94('0xf'),_0x6a94('0x10'),_0x6a94('0x11'),_0x6a94('0x12'),'permissions',_0x6a94('0x13'),'voicePause',_0x6a94('0x14'),_0x6a94('0x15'),_0x6a94('0x16'),'smsPause',_0x6a94('0x17'),_0x6a94('0x18'),_0x6a94('0x19'),_0x6a94('0x1a'),_0x6a94('0x1b'),'crudPermissions',_0x6a94('0x1c'),_0x6a94('0x1d'),_0x6a94('0x1e'),_0x6a94('0x1f'),_0x6a94('0x20'),'phoneBarDnd',_0x6a94('0x21'),'phoneBarEnableDtmfTone',_0x6a94('0x22'),_0x6a94('0x23'),'phoneBarPrefixRequired',_0x6a94('0x24'),_0x6a94('0x25'),'hotdesk',_0x6a94('0x26'),_0x6a94('0x27'),_0x6a94('0x28'),_0x6a94('0x29'),_0x6a94('0x2a'),_0x6a94('0x2b'),'downloadOmnichannelInteractions',_0x6a94('0x2c')];exports[_0x6a94('0x2d')]=function(){return this[_0x6a94('0x2e')](!![])[_0x6a94('0x2f')](function(_0x1fda33,_0x43f723,_0x1774c1){if(_0x1fda33['user']){_0x1774c1();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1fda33[_0x6a94('0x30')]['id']},'attributes':['id',_0x6a94('0x31'),_0x6a94('0x32')],'raw':!![]})[_0x6a94('0x33')](function(_0x118133){if(_0x118133&&_0x118133[_0x6a94('0x31')]){return _0x43f723[_0x6a94('0x34')](_0x118133[_0x6a94('0x32')]==='unmanaged'?0x195:0x193)['json']({'message':_0x118133[_0x6a94('0x32')]===_0x6a94('0x35')?_0x6a94('0x36'):_0x6a94('0x37')});}else{_0x1774c1();}})[_0x6a94('0x38')](function(_0x2a1990){_0x1774c1(_0x2a1990);});}});};exports['isAuthenticated']=function isAuthenticated(_0x312d4f){return compose()[_0x6a94('0x2f')](function(_0x46443e,_0x26d5ff,_0x494123){var _0x373547;if(_0x46443e[_0x6a94('0x39')]['authorization']){if(_[_0x6a94('0x3a')](_0x46443e['headers'][_0x6a94('0x3b')],_0x6a94('0x3c'))){var _0xfffc51=basicAuth(_0x46443e);db[_0x6a94('0x3d')][_0x6a94('0x3e')]({'where':{'name':_0xfffc51[_0x6a94('0xf')]}})['then'](function(_0x21c479){if(!_0x21c479||!_0x21c479[_0x6a94('0x3f')](_0xfffc51[_0x6a94('0x40')])){return _0x26d5ff['status'](0x191)[_0x6a94('0x41')]({'message':_0x6a94('0x42')});}_0x46443e[_0x6a94('0x43')]={'id':_0x21c479['id']};_0x494123();})[_0x6a94('0x38')](function(_0x33773f){_0x494123(_0x33773f);});}else if(_[_0x6a94('0x3a')](_0x46443e[_0x6a94('0x39')]['authorization'],_0x6a94('0x44'))){validateJwt(_0x46443e,_0x26d5ff,_0x494123);}else{if(_0x312d4f){_0x494123();}else{return _0x26d5ff[_0x6a94('0x34')](0x193)[_0x6a94('0x41')]({'message':_0x6a94('0x45')});}}}else if(_0x46443e[_0x6a94('0x46')]['apikey']){try{var _0x3bb541={'audience':hardwareConf[_0x6a94('0x47')](),'issuer':hardwareConf[_0x6a94('0x47')]()};verifyJwt(_0x46443e[_0x6a94('0x46')][_0x6a94('0x48')],_0x3bb541)['then'](function(_0x39a464){return db[_0x6a94('0x3d')][_0x6a94('0x3e')]({'where':{'id':_0x39a464[_0x6a94('0x49')]}})[_0x6a94('0x33')](function(_0x345105){_0x373547=_0x345105;return db[_0x6a94('0x4a')][_0x6a94('0x4b')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x6a94('0x4c')],'raw':!![]});})['then'](function(_0x2a798e){if(!_0x373547||!_[_0x6a94('0x4d')](_0x373547[_0x6a94('0x4e')],_0x39a464[_0x6a94('0x4f')])){return _0x26d5ff[_0x6a94('0x34')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x373547[_0x6a94('0x50')]){return _0x26d5ff[_0x6a94('0x34')](0x191)[_0x6a94('0x41')]({'message':_0x6a94('0x51')});}if(_0x373547[_0x6a94('0x52')]){if(_0x2a798e[_0x6a94('0x4c')]>0x0){if(moment(_0x373547['blockedAt'])[_0x6a94('0x53')](_0x2a798e[_0x6a94('0x4c')],_0x6a94('0x54'))>moment()){return _0x26d5ff[_0x6a94('0x34')](0x191)[_0x6a94('0x41')]({'message':_0x6a94('0x51')});}}else{return _0x26d5ff['status'](0x191)['json']({'message':_0x6a94('0x51')});}}_0x46443e[_0x6a94('0x43')]={'id':_0x373547['id']};_0x494123();});})['catch'](function(){return _0x26d5ff[_0x6a94('0x34')](0x191)[_0x6a94('0x41')]({'message':_0x6a94('0x51')});});}catch(_0x18b0d0){_0x494123(_0x18b0d0);}}else if(_0x312d4f){_0x494123();}else{return _0x26d5ff[_0x6a94('0x34')](0x193)[_0x6a94('0x41')]({'message':_0x6a94('0x45')});}})[_0x6a94('0x2f')](function(_0x1f83c4,_0x22a78f,_0x3c09b5){if(_0x1f83c4['user']){db['User'][_0x6a94('0x3e')]({'where':{'id':_0x1f83c4[_0x6a94('0x43')]['id']},'attributes':userAttributes})['then'](function(_0x50bd93){if(!_0x50bd93){return _0x22a78f['status'](0x194)['json']({'message':_0x6a94('0x55')});}_0x1f83c4[_0x6a94('0x43')]=_0x50bd93;_0x3c09b5();})[_0x6a94('0x38')](function(_0x2d2eff){_0x3c09b5(_0x2d2eff);});}else if(_0x312d4f){_0x3c09b5();}else{return _0x22a78f[_0x6a94('0x34')](0x194)[_0x6a94('0x41')]({'message':_0x6a94('0x56')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x6a94('0x2f')](function(_0x4df98b,_0x2527bb,_0x54e89b){return licenseUtil[_0x6a94('0x57')]()['then'](function(_0xe5792b){if(_0xe5792b['update']){_0x54e89b();}else{return _0x2527bb[_0x6a94('0x34')](0x193)[_0x6a94('0x41')]({'message':_0x6a94('0x58')});}})[_0x6a94('0x38')](function(_0x436c49){_0x54e89b(_0x436c49);});});};exports[_0x6a94('0x59')]=function(_0x3c1601,_0x2621cc,_0xab7ea3){_0x3c1601[_0x6a94('0x59')]=!![];return _0xab7ea3();};exports['signToken']=function signToken(_0x4960d5){return signJwt(_0x4960d5);};exports[_0x6a94('0x5a')]=function(_0x28889d,_0x21cc1a){if(!_0x28889d[_0x6a94('0x43')]){return _0x21cc1a['status'](0x194)['json']({'message':_0x6a94('0x5b')});}var _0x590620={'payload':{'id':_0x28889d['user']['id'],'role':_0x28889d[_0x6a94('0x43')][_0x6a94('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x590620)['then'](function(_0x15e3d1){_0x21cc1a['cookie'](_0x6a94('0x5c'),_0x15e3d1);_0x21cc1a['redirect'](_0x6a94('0x5d'));})[_0x6a94('0x38')](function(_0x43e600){return _0x21cc1a['status'](0x1f4)['send'](_0x43e600);});};exports['retrieveApiKey']=function(_0x50f31f){if(_['isNil'](_0x50f31f[_0x6a94('0x4e')])||_['isNil'](_0x50f31f['apiKeyIat'])){return null;}else{return createJwt(_0x50f31f);}};exports[_0x6a94('0x5e')]=function(_0x5ca6eb){_0x5ca6eb['apiKeyNonce']=generateNonce();_0x5ca6eb[_0x6a94('0x5f')]=generateIssuedAt();return createJwt(_0x5ca6eb);};exports[_0x6a94('0x60')]=function(_0x4611d3,_0x4de0c9){var _0x466659=_0x4611d3[_0x6a94('0x46')][_0x6a94('0x48')];if(_0x466659){var _0x1db664={'nonce':_0x4de0c9[_0x6a94('0x4e')],'iat':_0x4de0c9[_0x6a94('0x5f')],'audience':hardwareConf[_0x6a94('0x47')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x466659,_0x1db664)[_0x6a94('0x33')](function(){return generateApiKey(_0x4de0c9);});}else{throw{'message':_0x6a94('0x61')};}};exports[_0x6a94('0x62')]=function(_0x4e9ded){var _0xd59292=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xd59292[_0x6a94('0x63')](_0x4e9ded))throw new db[(_0x6a94('0x64'))][(_0x6a94('0x65'))](_0x6a94('0x66'));return;};exports[_0x6a94('0x67')]=function(_0x1a0aef,_0x787152,_0x46c5b0){var _0x2e9060=encryptor[_0x6a94('0x68')](_0x787152)['split'](',');for(var _0x126d56=0x0;_0x126d56<_0x46c5b0;_0x126d56++){if(!_0x2e9060[_0x126d56])break;if(_0x1a0aef[_0x6a94('0x69')]()===_0x2e9060[_0x126d56]['toLowerCase']()){var _0x2fcf03=util[_0x6a94('0x6a')](_0x6a94('0x6b'),_0x46c5b0);if(_0x46c5b0===0x1){_0x2fcf03=_0x6a94('0x6c');}throw new db[(_0x6a94('0x64'))][(_0x6a94('0x65'))](_0x2fcf03);}}return;};exports[_0x6a94('0x6d')]=function(_0x2a318a,_0x32792e){var _0x22a20b=_0x32792e?encryptor[_0x6a94('0x68')](_0x32792e)[_0x6a94('0x6e')](','):[];if(_0x22a20b['length']===0x5){_0x22a20b[_0x6a94('0x6f')](-0x1,0x1);}_0x22a20b[_0x6a94('0x70')](_0x2a318a);return encryptor[_0x6a94('0x71')](_0x22a20b['join'](','));};function signJwt(_0x2b6b27){var _0x539018=BPromise['promisify'](jwt[_0x6a94('0x72')],{'context':jwt});var _0x57f0ca=_0x2b6b27[_0x6a94('0x73')]||config[_0x6a94('0xb')][_0x6a94('0xc')];return new BPromise(function(_0xb80810,_0x26b8c6){_0x539018(_0x2b6b27['payload'],_0x57f0ca,_0x2b6b27['options'])[_0x6a94('0x33')](function(_0x3baad1){_0xb80810(_0x3baad1);})[_0x6a94('0x38')](function(_0x3d2a13){_0x26b8c6(_0x3d2a13);});});}function verifyJwt(_0x162de0,_0x54fd27,_0x3cefa0){var _0xdd8ccb=BPromise[_0x6a94('0x74')](jwt['verify'],{'context':jwt});var _0x16f342=_0x3cefa0||config[_0x6a94('0xb')]['session'];return new BPromise(function(_0x38ca82,_0x3a4973){_0xdd8ccb(_0x162de0,_0x16f342,_0x54fd27)['then'](function(_0xdcf82c){_0x38ca82(_0xdcf82c);})[_0x6a94('0x38')](function(_0x480461){_0x3a4973(_0x480461);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x6a94('0x75'));}function generateIssuedAt(){return Math[_0x6a94('0x76')](Date['now']()/0x3e8)[_0x6a94('0x77')]();}function createJwt(_0x527dbf){var _0x5b7b1a={'payload':{'iat':_0x527dbf[_0x6a94('0x5f')],'nonce':_0x527dbf['apiKeyNonce']},'options':{'algorithm':_0x6a94('0x78'),'subject':_0x527dbf['id'][_0x6a94('0x77')](),'issuer':hardwareConf[_0x6a94('0x47')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x5b7b1a)[_0x6a94('0x33')](function(_0x4867cd){return{'iat':_0x527dbf['apiKeyIat'],'nonce':_0x527dbf[_0x6a94('0x4e')],'token':_0x4867cd};});} \ No newline at end of file +var _0x233a=['query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','add','minutes','catch','Unknown\x20authorization\x20format','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','split','join','promisify','sign','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session','name','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isAuthenticated','use','user','ChatInteraction','findOne','params','disposition','status','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','User','find','then','authenticate','Wrong\x20credentials.','Bearer'];(function(_0x563ee7,_0x1abd07){var _0x3f38c2=function(_0x2ac48c){while(--_0x2ac48c){_0x563ee7['push'](_0x563ee7['shift']());}};_0x3f38c2(++_0x1abd07);}(_0x233a,0x137));var _0xa233=function(_0x4a7427,_0x56c965){_0x4a7427=_0x4a7427-0x0;var _0x286638=_0x233a[_0x4a7427];return _0x286638;};'use strict';var db=require(_0xa233('0x0'))['db'];var config=require(_0xa233('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xa233('0x2'));var _=require(_0xa233('0x3'));var jwt=require(_0xa233('0x4'));var expressJwt=require(_0xa233('0x5'));var compose=require(_0xa233('0x6'));var basicAuth=require(_0xa233('0x7'));var crypto=require('crypto');var BPromise=require(_0xa233('0x8'));var util=require(_0xa233('0x9'));var moment=require(_0xa233('0xa'));var validateJwt=expressJwt({'secret':config[_0xa233('0xb')][_0xa233('0xc')]});var userAttributes=['id','role','fullname',_0xa233('0xd'),_0xa233('0xe'),_0xa233('0xf'),_0xa233('0x10'),_0xa233('0x11'),'md5secret',_0xa233('0x12'),_0xa233('0x13'),_0xa233('0x14'),_0xa233('0x15'),'smsPause',_0xa233('0x16'),_0xa233('0x17'),_0xa233('0x18'),_0xa233('0x19'),_0xa233('0x1a'),_0xa233('0x1b'),_0xa233('0x1c'),'passwordResetAt',_0xa233('0x1d'),_0xa233('0x1e'),_0xa233('0x1f'),_0xa233('0x20'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0xa233('0x21'),_0xa233('0x22'),'phoneBarPrefixRequired',_0xa233('0x23'),_0xa233('0x24'),_0xa233('0x25'),_0xa233('0x26'),_0xa233('0x27'),'privacyEnabled',_0xa233('0x28'),_0xa233('0x29'),_0xa233('0x2a'),_0xa233('0x2b'),_0xa233('0x2c')];exports['isChatInteractionAuthorized']=function(){return this[_0xa233('0x2d')](!![])[_0xa233('0x2e')](function(_0x5ded34,_0x377814,_0x4a3538){if(_0x5ded34[_0xa233('0x2f')]){_0x4a3538();}else{return db[_0xa233('0x30')][_0xa233('0x31')]({'where':{'id':_0x5ded34[_0xa233('0x32')]['id']},'attributes':['id','closed',_0xa233('0x33')],'raw':!![]})['then'](function(_0x5f85d){if(_0x5f85d&&_0x5f85d['closed']){return _0x377814[_0xa233('0x34')](_0x5f85d[_0xa233('0x33')]===_0xa233('0x35')?0x195:0x193)[_0xa233('0x36')]({'message':_0x5f85d[_0xa233('0x33')]===_0xa233('0x35')?_0xa233('0x37'):_0xa233('0x38')});}else{_0x4a3538();}})['catch'](function(_0x2bd171){_0x4a3538(_0x2bd171);});}});};exports['isAuthenticated']=function isAuthenticated(_0x540c24){return compose()[_0xa233('0x2e')](function(_0x1b2fab,_0x16d6f0,_0x56cc7e){var _0x1c6b37;if(_0x1b2fab[_0xa233('0x39')][_0xa233('0x3a')]){if(_[_0xa233('0x3b')](_0x1b2fab[_0xa233('0x39')]['authorization'],_0xa233('0x3c'))){var _0x5409a7=basicAuth(_0x1b2fab);db[_0xa233('0x3d')][_0xa233('0x3e')]({'where':{'name':_0x5409a7['name']}})[_0xa233('0x3f')](function(_0x119609){if(!_0x119609||!_0x119609[_0xa233('0x40')](_0x5409a7['pass'])){return _0x16d6f0['status'](0x191)[_0xa233('0x36')]({'message':_0xa233('0x41')});}_0x1b2fab[_0xa233('0x2f')]={'id':_0x119609['id']};_0x56cc7e();})['catch'](function(_0x87556b){_0x56cc7e(_0x87556b);});}else if(_[_0xa233('0x3b')](_0x1b2fab[_0xa233('0x39')][_0xa233('0x3a')],_0xa233('0x42'))){validateJwt(_0x1b2fab,_0x16d6f0,_0x56cc7e);}else{if(_0x540c24){_0x56cc7e();}else{return _0x16d6f0[_0xa233('0x34')](0x193)[_0xa233('0x36')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x1b2fab[_0xa233('0x43')][_0xa233('0x44')]){try{var _0x1ab0be={'audience':hardwareConf[_0xa233('0x45')](),'issuer':hardwareConf[_0xa233('0x45')]()};verifyJwt(_0x1b2fab['query'][_0xa233('0x44')],_0x1ab0be)[_0xa233('0x3f')](function(_0x20f8cb){return db[_0xa233('0x3d')]['find']({'where':{'id':_0x20f8cb[_0xa233('0x46')]}})[_0xa233('0x3f')](function(_0x29c741){_0x1c6b37=_0x29c741;return db[_0xa233('0x47')][_0xa233('0x31')]({'where':{'id':0x1},'attributes':[_0xa233('0x48'),_0xa233('0x49')],'raw':!![]});})[_0xa233('0x3f')](function(_0x246ca9){if(!_0x1c6b37||!_[_0xa233('0x4a')](_0x1c6b37[_0xa233('0x4b')],_0x20f8cb[_0xa233('0x4c')])){return _0x16d6f0[_0xa233('0x34')](0x191)['json']({'message':_0xa233('0x4d')});}if(_0x1c6b37[_0xa233('0x4e')]){return _0x16d6f0[_0xa233('0x34')](0x191)[_0xa233('0x36')]({'message':_0xa233('0x4f')});}if(_0x1c6b37['blocked']){if(_0x246ca9[_0xa233('0x49')]>0x0){if(moment(_0x1c6b37['blockedAt'])[_0xa233('0x50')](_0x246ca9[_0xa233('0x49')],_0xa233('0x51'))>moment()){return _0x16d6f0[_0xa233('0x34')](0x191)['json']({'message':_0xa233('0x4f')});}}else{return _0x16d6f0[_0xa233('0x34')](0x191)[_0xa233('0x36')]({'message':_0xa233('0x4f')});}}_0x1b2fab[_0xa233('0x2f')]={'id':_0x1c6b37['id']};_0x56cc7e();});})[_0xa233('0x52')](function(){return _0x16d6f0[_0xa233('0x34')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x20b7ba){_0x56cc7e(_0x20b7ba);}}else if(_0x540c24){_0x56cc7e();}else{return _0x16d6f0['status'](0x193)[_0xa233('0x36')]({'message':_0xa233('0x53')});}})['use'](function(_0x5d831f,_0x1243bf,_0x58933f){if(_0x5d831f[_0xa233('0x2f')]){db[_0xa233('0x3d')][_0xa233('0x3e')]({'where':{'id':_0x5d831f[_0xa233('0x2f')]['id']},'attributes':userAttributes})['then'](function(_0x5bbbe3){if(!_0x5bbbe3){return _0x1243bf[_0xa233('0x34')](0x194)[_0xa233('0x36')]({'message':'User\x20not\x20found.'});}_0x5d831f['user']=_0x5bbbe3;_0x58933f();})['catch'](function(_0x4061a9){_0x58933f(_0x4061a9);});}else if(_0x540c24){_0x58933f();}else{return _0x1243bf['status'](0x194)[_0xa233('0x36')]({'message':_0xa233('0x54')});}});};exports[_0xa233('0x55')]=function canUpdate(){return compose()['use'](function(_0x397ccb,_0x56235f,_0x1d67af){return licenseUtil[_0xa233('0x56')]()[_0xa233('0x3f')](function(_0x15de2c){if(_0x15de2c[_0xa233('0x57')]){_0x1d67af();}else{return _0x56235f[_0xa233('0x34')](0x193)[_0xa233('0x36')]({'message':_0xa233('0x58')});}})[_0xa233('0x52')](function(_0x28e27e){_0x1d67af(_0x28e27e);});});};exports[_0xa233('0x59')]=function(_0xffa058,_0x2b9618,_0x287605){_0xffa058[_0xa233('0x59')]=!![];return _0x287605();};exports[_0xa233('0x5a')]=function signToken(_0x4b4147){return signJwt(_0x4b4147);};exports[_0xa233('0x5b')]=function(_0xdd81e1,_0x3a6f2e){if(!_0xdd81e1[_0xa233('0x2f')]){return _0x3a6f2e[_0xa233('0x34')](0x194)[_0xa233('0x36')]({'message':_0xa233('0x5c')});}var _0x4fd344={'payload':{'id':_0xdd81e1['user']['id'],'role':_0xdd81e1[_0xa233('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4fd344)['then'](function(_0x161a32){_0x3a6f2e[_0xa233('0x5d')](_0xa233('0x5e'),_0x161a32);_0x3a6f2e[_0xa233('0x5f')](_0xa233('0x60'));})[_0xa233('0x52')](function(_0x31203f){return _0x3a6f2e['status'](0x1f4)[_0xa233('0x61')](_0x31203f);});};exports[_0xa233('0x62')]=function(_0x46ef99){if(_[_0xa233('0x63')](_0x46ef99[_0xa233('0x4b')])||_[_0xa233('0x63')](_0x46ef99[_0xa233('0x64')])){return null;}else{return createJwt(_0x46ef99);}};exports[_0xa233('0x65')]=function(_0xfea848){_0xfea848[_0xa233('0x4b')]=generateNonce();_0xfea848[_0xa233('0x64')]=generateIssuedAt();return createJwt(_0xfea848);};exports[_0xa233('0x66')]=function(_0xfdf209,_0x3a3489){var _0x51b5ba=_0xfdf209[_0xa233('0x43')][_0xa233('0x44')];if(_0x51b5ba){var _0x2ad39e={'nonce':_0x3a3489[_0xa233('0x4b')],'iat':_0x3a3489['apiKeyIat'],'audience':hardwareConf[_0xa233('0x45')](),'issuer':hardwareConf[_0xa233('0x45')]()};return verifyJwt(_0x51b5ba,_0x2ad39e)['then'](function(){return generateApiKey(_0x3a3489);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa233('0x67')]=function(_0x331176){var _0x39ece1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x39ece1[_0xa233('0x68')](_0x331176))throw new db[(_0xa233('0x69'))]['ValidationError'](_0xa233('0x6a'));return;};exports[_0xa233('0x6b')]=function(_0x35a370,_0x307324,_0x508020){var _0x968e44=encryptor[_0xa233('0x6c')](_0x307324)['split'](',');for(var _0x174a86=0x0;_0x174a86<_0x508020;_0x174a86++){if(!_0x968e44[_0x174a86])break;if(_0x35a370['toLowerCase']()===_0x968e44[_0x174a86]['toLowerCase']()){var _0x4ace24=util[_0xa233('0x6d')](_0xa233('0x6e'),_0x508020);if(_0x508020===0x1){_0x4ace24='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0xa233('0x6f'))](_0x4ace24);}}return;};exports[_0xa233('0x70')]=function(_0x3a42f8,_0x5b2a43){var _0x53b75f=_0x5b2a43?encryptor['decryptString'](_0x5b2a43)[_0xa233('0x71')](','):[];if(_0x53b75f['length']===0x5){_0x53b75f['splice'](-0x1,0x1);}_0x53b75f['unshift'](_0x3a42f8);return encryptor['encryptString'](_0x53b75f[_0xa233('0x72')](','));};function signJwt(_0x237112){var _0x45c1d6=BPromise[_0xa233('0x73')](jwt[_0xa233('0x74')],{'context':jwt});var _0x368c17=_0x237112['secret']||config[_0xa233('0xb')][_0xa233('0xc')];return new BPromise(function(_0x4568e8,_0x1740b3){_0x45c1d6(_0x237112[_0xa233('0x75')],_0x368c17,_0x237112[_0xa233('0x76')])[_0xa233('0x3f')](function(_0x50ece1){_0x4568e8(_0x50ece1);})[_0xa233('0x52')](function(_0xb0fda9){_0x1740b3(_0xb0fda9);});});}function verifyJwt(_0x50ca55,_0x331a44,_0x4a5414){var _0x47c760=BPromise[_0xa233('0x73')](jwt[_0xa233('0x77')],{'context':jwt});var _0xc13a8b=_0x4a5414||config[_0xa233('0xb')][_0xa233('0xc')];return new BPromise(function(_0x196fd1,_0x23afed){_0x47c760(_0x50ca55,_0xc13a8b,_0x331a44)['then'](function(_0x346fa2){_0x196fd1(_0x346fa2);})[_0xa233('0x52')](function(_0x28fd51){_0x23afed(_0x28fd51);});});}function generateNonce(){return crypto[_0xa233('0x78')](0x10)[_0xa233('0x79')](_0xa233('0x7a'));}function generateIssuedAt(){return Math[_0xa233('0x7b')](Date[_0xa233('0x7c')]()/0x3e8)[_0xa233('0x79')]();}function createJwt(_0x5aa82a){var _0x4cd7ca={'payload':{'iat':_0x5aa82a[_0xa233('0x64')],'nonce':_0x5aa82a['apiKeyNonce']},'options':{'algorithm':_0xa233('0x7d'),'subject':_0x5aa82a['id']['toString'](),'issuer':hardwareConf[_0xa233('0x45')](),'audience':hardwareConf[_0xa233('0x45')]()}};return signJwt(_0x4cd7ca)[_0xa233('0x3f')](function(_0x20c3d0){return{'iat':_0x5aa82a['apiKeyIat'],'nonce':_0x5aa82a[_0xa233('0x4b')],'token':_0x20c3d0};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 915da63..1152d7e 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 _0xa3fc=['join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','createWriteStream','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher','data','encryptString','utf8','base64','decryptString','secret','crypto','lodash','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm'];(function(_0x1ada77,_0x4949dc){var _0x4dd957=function(_0x2772e8){while(--_0x2772e8){_0x1ada77['push'](_0x1ada77['shift']());}};_0x4dd957(++_0x4949dc);}(_0xa3fc,0xff));var _0xca3f=function(_0x5a32bb,_0x2d24ca){_0x5a32bb=_0x5a32bb-0x0;var _0x594bce=_0xa3fc[_0x5a32bb];return _0x594bce;};'use strict';var crypto=require(_0xca3f('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xca3f('0x1'));var config=require('../../config/environment');var logger=require(_0xca3f('0x2'))(_0xca3f('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xca3f('0x4')],'algorithm':_0xca3f('0x5')};const fileOptions={'algorithm':_0xca3f('0x6')};if(config[_0xca3f('0x7')]&&config[_0xca3f('0x7')][_0xca3f('0x8')]){var isSupported=isAlgorithmSupported(config[_0xca3f('0x7')][_0xca3f('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0xca3f('0x7')][_0xca3f('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xca3f('0x9')](',\x20');logger[_0xca3f('0xa')](config['encrypt'][_0xca3f('0x8')],_0xca3f('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x864fea){return AES_SUPPORTED_RX[_0xca3f('0xc')](_0x864fea);}function getSupportedCiphers(){return crypto[_0xca3f('0xd')]()[_0xca3f('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x513991){return getSupportedCiphers()['indexOf'](_0x513991)>-0x1;}function combineOptions(_0x20bdeb){var _0x5cab08={};for(var _0x392c23 in fileOptions){if(fileOptions[_0xca3f('0xf')](_0x392c23)){_0x5cab08[_0x392c23]=fileOptions[_0x392c23];}}if(_0x20bdeb){for(var _0x1cae21 in _0x20bdeb){if(_0x20bdeb[_0xca3f('0xf')](_0x1cae21)){_0x5cab08[_0x1cae21]=_0x20bdeb[_0x1cae21];}}}return _0x5cab08;}exports['encryptFile']=function(_0x1acea3,_0x11f01d,_0x4f1639,_0x189f1c){return new BPromise(function(_0xdd8b44,_0x3dcb64){_0x189f1c=combineOptions(_0x189f1c);var _0x316480=new Buffer(_0x4f1639);var _0x92501a=fs['createReadStream'](_0x1acea3);var _0x4b2b88=fs[_0xca3f('0x10')](_0x11f01d);var _0x2ad5d=crypto['createCipher'](_0x189f1c['algorithm'],_0x316480);_0x92501a['on']('data',function(_0x12488d){var _0x48bdde=new Buffer(_0x2ad5d[_0xca3f('0x11')](_0x12488d),_0xca3f('0x12'));_0x4b2b88[_0xca3f('0x13')](_0x48bdde);});_0x92501a['on'](_0xca3f('0x14'),function(){try{var _0x44773c=new Buffer(_0x2ad5d[_0xca3f('0x15')](_0xca3f('0x12')),_0xca3f('0x12'));_0x4b2b88[_0xca3f('0x13')](_0x44773c);_0x4b2b88[_0xca3f('0x14')]();_0x4b2b88['on'](_0xca3f('0x16'),function(){return _0xdd8b44(_0x11f01d);});}catch(_0x5012e1){fs[_0xca3f('0x17')](_0x11f01d);return _0x3dcb64(_0x5012e1);}});});};exports[_0xca3f('0x18')]=function(_0x641994,_0x36f6e7,_0x5981ba,_0x992289){return new BPromise(function(_0x3ad4d0,_0xc04470){_0x992289=combineOptions(_0x992289);var _0x318a64=new Buffer(_0x5981ba);var _0x2cd10f=fs[_0xca3f('0x19')](_0x641994);var _0x3d61af=fs[_0xca3f('0x10')](_0x36f6e7);var _0x24a664=crypto[_0xca3f('0x1a')](_0x992289['algorithm'],_0x318a64);_0x2cd10f['on'](_0xca3f('0x1b'),function(_0x2d89a3){var _0x132c77=new Buffer(_0x24a664[_0xca3f('0x11')](_0x2d89a3),_0xca3f('0x12'));_0x3d61af[_0xca3f('0x13')](_0x132c77);});_0x2cd10f['on'](_0xca3f('0x14'),function(){try{var _0x338a76=new Buffer(_0x24a664[_0xca3f('0x15')]('binary'),_0xca3f('0x12'));_0x3d61af[_0xca3f('0x13')](_0x338a76);_0x3d61af[_0xca3f('0x14')]();_0x3d61af['on'](_0xca3f('0x16'),function(){return _0x3ad4d0(_0x36f6e7);});}catch(_0x3f1937){fs[_0xca3f('0x17')](_0x36f6e7);return _0xc04470(_0x3f1937);}});});};exports[_0xca3f('0x1c')]=function(_0x5848f9,_0x3dd574,_0x3cff3a){var _0x17bf1f=_0x3cff3a||stringOptions[_0xca3f('0x8')];var _0x5a7c8d=_0x3dd574||stringOptions['secret'];var _0x124d90=crypto['createCipher'](_0x17bf1f,_0x5a7c8d);var _0x5d9049=_0x124d90[_0xca3f('0x11')](_0x5848f9,_0xca3f('0x1d'),'base64');_0x5d9049+=_0x124d90[_0xca3f('0x15')](_0xca3f('0x1e'));return _0x5d9049;};exports[_0xca3f('0x1f')]=function(_0x36c216,_0x30532e,_0x506c2e){var _0x4d6113=_0x506c2e||stringOptions[_0xca3f('0x8')];var _0xd0825b=_0x30532e||stringOptions[_0xca3f('0x20')];var _0x17e857=crypto[_0xca3f('0x1a')](_0x4d6113,_0xd0825b);var _0x5829db=_0x17e857[_0xca3f('0x11')](_0x36c216,_0xca3f('0x1e'),_0xca3f('0x1d'));_0x5829db+=_0x17e857[_0xca3f('0x15')](_0xca3f('0x1d'));return _0x5829db;}; \ No newline at end of file +var _0x092a=['algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','encryptFile','createReadStream','createCipher','data','update','binary','write','end','final','createWriteStream','createDecipher','close','unlink','encryptString','secret','utf8','base64','decryptString','bluebird','lodash','app','session','aes-256-ctr','aes192','encrypt'];(function(_0x25dbdf,_0x1f4776){var _0x238e6e=function(_0x94ab3e){while(--_0x94ab3e){_0x25dbdf['push'](_0x25dbdf['shift']());}};_0x238e6e(++_0x1f4776);}(_0x092a,0x8f));var _0xa092=function(_0x4a9771,_0x52429b){_0x4a9771=_0x4a9771-0x0;var _0x52e0ed=_0x092a[_0x4a9771];return _0x52e0ed;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xa092('0x0'));var _=require(_0xa092('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xa092('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xa092('0x3')],'algorithm':_0xa092('0x4')};const fileOptions={'algorithm':_0xa092('0x5')};if(config[_0xa092('0x6')]&&config[_0xa092('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xa092('0x6')][_0xa092('0x7')]);if(isSupported){fileOptions[_0xa092('0x7')]=config[_0xa092('0x6')][_0xa092('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xa092('0x8')](',\x20');logger['error'](config['encrypt'][_0xa092('0x7')],_0xa092('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x5348c1){return AES_SUPPORTED_RX[_0xa092('0xa')](_0x5348c1);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xa092('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x56bddd){return getSupportedCiphers()['indexOf'](_0x56bddd)>-0x1;}function combineOptions(_0x1f8b08){var _0x5876e0={};for(var _0x3b4317 in fileOptions){if(fileOptions['hasOwnProperty'](_0x3b4317)){_0x5876e0[_0x3b4317]=fileOptions[_0x3b4317];}}if(_0x1f8b08){for(var _0x3837cf in _0x1f8b08){if(_0x1f8b08['hasOwnProperty'](_0x3837cf)){_0x5876e0[_0x3837cf]=_0x1f8b08[_0x3837cf];}}}return _0x5876e0;}exports[_0xa092('0xc')]=function(_0x43b649,_0x1ae1ce,_0x21977d,_0x307796){return new BPromise(function(_0x5eb8b8,_0x482512){_0x307796=combineOptions(_0x307796);var _0x8978a0=new Buffer(_0x21977d);var _0x50d734=fs[_0xa092('0xd')](_0x43b649);var _0x3242d5=fs['createWriteStream'](_0x1ae1ce);var _0x102863=crypto[_0xa092('0xe')](_0x307796[_0xa092('0x7')],_0x8978a0);_0x50d734['on'](_0xa092('0xf'),function(_0xc95b0c){var _0x4317d2=new Buffer(_0x102863[_0xa092('0x10')](_0xc95b0c),_0xa092('0x11'));_0x3242d5[_0xa092('0x12')](_0x4317d2);});_0x50d734['on'](_0xa092('0x13'),function(){try{var _0x132a48=new Buffer(_0x102863[_0xa092('0x14')](_0xa092('0x11')),_0xa092('0x11'));_0x3242d5[_0xa092('0x12')](_0x132a48);_0x3242d5[_0xa092('0x13')]();_0x3242d5['on']('close',function(){return _0x5eb8b8(_0x1ae1ce);});}catch(_0x2de9fa){fs['unlink'](_0x1ae1ce);return _0x482512(_0x2de9fa);}});});};exports['decryptFile']=function(_0x56c1ad,_0x340af7,_0x194a55,_0x597327){return new BPromise(function(_0x193520,_0x595400){_0x597327=combineOptions(_0x597327);var _0x1cd10b=new Buffer(_0x194a55);var _0x29c997=fs['createReadStream'](_0x56c1ad);var _0x1396ae=fs[_0xa092('0x15')](_0x340af7);var _0x3c995f=crypto[_0xa092('0x16')](_0x597327[_0xa092('0x7')],_0x1cd10b);_0x29c997['on']('data',function(_0x3da9fd){var _0x217940=new Buffer(_0x3c995f['update'](_0x3da9fd),'binary');_0x1396ae['write'](_0x217940);});_0x29c997['on'](_0xa092('0x13'),function(){try{var _0x41aea2=new Buffer(_0x3c995f[_0xa092('0x14')](_0xa092('0x11')),_0xa092('0x11'));_0x1396ae[_0xa092('0x12')](_0x41aea2);_0x1396ae[_0xa092('0x13')]();_0x1396ae['on'](_0xa092('0x17'),function(){return _0x193520(_0x340af7);});}catch(_0x37aaed){fs[_0xa092('0x18')](_0x340af7);return _0x595400(_0x37aaed);}});});};exports[_0xa092('0x19')]=function(_0x498cc0,_0x4b97bc,_0x104371){var _0x42a144=_0x104371||stringOptions[_0xa092('0x7')];var _0x2b648b=_0x4b97bc||stringOptions[_0xa092('0x1a')];var _0x83f796=crypto[_0xa092('0xe')](_0x42a144,_0x2b648b);var _0xd433a8=_0x83f796[_0xa092('0x10')](_0x498cc0,_0xa092('0x1b'),'base64');_0xd433a8+=_0x83f796[_0xa092('0x14')](_0xa092('0x1c'));return _0xd433a8;};exports[_0xa092('0x1d')]=function(_0x47c204,_0x76a573,_0x1679f3){var _0x1d5349=_0x1679f3||stringOptions['algorithm'];var _0x52ca6f=_0x76a573||stringOptions[_0xa092('0x1a')];var _0x4250d=crypto[_0xa092('0x16')](_0x1d5349,_0x52ca6f);var _0x2171e2=_0x4250d[_0xa092('0x10')](_0x47c204,_0xa092('0x1c'),_0xa092('0x1b'));_0x2171e2+=_0x4250d[_0xa092('0x14')](_0xa092('0x1b'));return _0x2171e2;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 8d1178f..4503b8e 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 _0x4227=['analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','query','QueryTypes','Empty','length','split','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','dirname','basename','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger'];(function(_0x512f6f,_0x1818c1){var _0x33cf5c=function(_0x3acb84){while(--_0x3acb84){_0x512f6f['push'](_0x512f6f['shift']());}};_0x33cf5c(++_0x1818c1);}(_0x4227,0x89));var _0x7422=function(_0x412fce,_0x2de4d5){_0x412fce=_0x412fce-0x0;var _0x4c75bb=_0x4227[_0x412fce];return _0x4c75bb;};'use strict';var util=require(_0x7422('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0x7422('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x7422('0x2'));var rimraf=require(_0x7422('0x3'));var db=require(_0x7422('0x4'))['db'];var dbH=require('../../mysqldb')[_0x7422('0x5')];var logger=require(_0x7422('0x6'))(_0x7422('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x7422('0x8')][0x2]);var QUERY=process[_0x7422('0x8')][0x3];var PATH=process[_0x7422('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xe99299,_0x45ca1a){var _0x12965e={'status':_0xe99299};var _0x599d78={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45ca1a){_0x12965e[_0x7422('0x9')]=_0x45ca1a;}return db[_0x7422('0xa')][_0x7422('0xb')](_0x12965e,_0x599d78);}function main(){var _0x511340=0x1388;var _0x1603ee;logger['info'](util[_0x7422('0xc')](_0x7422('0xd'),EXTRACTED_REPORT_ID,_0x7422('0xe')));return db[_0x7422('0xf')][_0x7422('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x7422('0x11')]})[_0x7422('0x12')](function(_0x575c47){if(_0x575c47){_0x1603ee=_0x575c47;_0x511340=_0x1603ee[_0x7422('0x11')]||0x1388;}})[_0x7422('0x12')](function(){return dbH['sequelize'][_0x7422('0x13')](util[_0x7422('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x7422('0x14')]['SELECT']});})[_0x7422('0x12')](function(_0x788829){if(!_0x788829[0x0]['num']){return analyticExtractedReport(_0x7422('0x15'));}var _0x39c31c=[];var _0x31c3ec=0x0;var _0x1d1ac3=!![];if(_0x788829&&_0x788829[_0x7422('0x16')]){var _0x25401d=_0x788829[0x0]['num']%(_0x31c3ec+_0x511340);if(_0x1603ee[_0x7422('0x17')]){for(;_0x1d1ac3;_0x31c3ec+=_0x511340,_0x25401d=_0x788829[0x0][_0x7422('0x18')]%(_0x31c3ec+_0x511340)){if(_0x25401d==0x0||_0x25401d==_0x788829[0x0][_0x7422('0x18')]){_0x1d1ac3=![];}_0x39c31c[_0x7422('0x19')](dbH['sequelize'][_0x7422('0x13')](util['format'](_0x7422('0x1a'),QUERY,_0x511340,_0x31c3ec),{'type':dbH[_0x7422('0x1b')][_0x7422('0x14')]['SELECT']}));}}else{_0x39c31c[_0x7422('0x19')](dbH[_0x7422('0x1b')][_0x7422('0x13')](QUERY,{'type':dbH[_0x7422('0x1b')]['QueryTypes']['SELECT']}));}}var _0x2fedd2=path[_0x7422('0x1c')](PATH);var _0x20c1e3=path[_0x7422('0x1d')](PATH,_0x7422('0x1e'));var _0x35e2b0=_0x1603ee[_0x7422('0x17')]&&_0x39c31c['length']>0x1;var _0x24ce62=[];if(!fs[_0x7422('0x1f')](path['join'](_0x2fedd2,_0x20c1e3))&&_0x35e2b0){fs[_0x7422('0x20')](path[_0x7422('0x21')](_0x2fedd2,_0x20c1e3));}return BPromise[_0x7422('0x22')](_0x39c31c,function(_0x3eeb9c){_0x24ce62['push'](_0x3eeb9c);})[_0x7422('0x12')](function(){for(var _0x2eed9f=0x0;_0x2eed9f<_0x24ce62[_0x7422('0x16')];_0x2eed9f+=0x1){var _0x2dd10f;var _0x3438d1=_0x24ce62[_0x2eed9f];if(_0x35e2b0){_0x2dd10f=path['join'](_0x2fedd2,_0x20c1e3,util[_0x7422('0xc')](_0x7422('0x23'),_0x20c1e3,_0x2eed9f,_0x7422('0x24')));}else{_0x2dd10f=path[_0x7422('0x21')](_0x2fedd2,util['format'](_0x7422('0x25'),_0x20c1e3,_0x7422('0x24')));}fs[_0x7422('0x26')](_0x2dd10f,csv(_0x3438d1));}})[_0x7422('0x12')](function(){if(_0x35e2b0){zipdir(path['join'](_0x2fedd2,_0x20c1e3),{'saveTo':path[_0x7422('0x21')](_0x2fedd2,util[_0x7422('0xc')]('%s.%s',_0x20c1e3,'zip'))},function(_0x2baac6,_0x2fb125){});rimraf(path['join'](_0x2fedd2,_0x20c1e3),function(){});}})[_0x7422('0x12')](function(){logger[_0x7422('0x27')](util[_0x7422('0xc')](_0x7422('0x28'),EXTRACTED_REPORT_ID,_0x7422('0xe')));return analyticExtractedReport(_0x7422('0x29'),_0x35e2b0?util[_0x7422('0xc')](_0x7422('0x25'),_0x20c1e3,_0x35e2b0?_0x7422('0x2a'):_0x7422('0x24')):null);});})[_0x7422('0x2b')](function(_0x47e57b){logger[_0x7422('0x27')](util[_0x7422('0xc')](_0x7422('0x2c'),EXTRACTED_REPORT_ID,_0x7422('0xe')),util['inspect'](_0x47e57b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7422('0x2d'));})[_0x7422('0x2e')](function(){process[_0x7422('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x9aea=['../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','CSV','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','lodash','bluebird','zip-dir'];(function(_0x495f24,_0x3119c1){var _0x9949e9=function(_0x5ddd10){while(--_0x5ddd10){_0x495f24['push'](_0x495f24['shift']());}};_0x9949e9(++_0x3119c1);}(_0x9aea,0xdd));var _0xa9ae=function(_0x17cb54,_0x49c42d){_0x17cb54=_0x17cb54-0x0;var _0x584cdf=_0x9aea[_0x17cb54];return _0x584cdf;};'use strict';var util=require(_0xa9ae('0x0'));var path=require('path');var _=require(_0xa9ae('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xa9ae('0x2'));var zipdir=require(_0xa9ae('0x3'));var rimraf=require('rimraf');var db=require(_0xa9ae('0x4'))['db'];var dbH=require(_0xa9ae('0x4'))[_0xa9ae('0x5')];var logger=require(_0xa9ae('0x6'))(_0xa9ae('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa9ae('0x8')][0x3];var PATH=process[_0xa9ae('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1e57c4,_0x53e52c){var _0x1f2e4b={'status':_0x1e57c4};var _0x3917f0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x53e52c){_0x1f2e4b[_0xa9ae('0x9')]=_0x53e52c;}return db[_0xa9ae('0xa')][_0xa9ae('0xb')](_0x1f2e4b,_0x3917f0);}function main(){var _0x2d1188=0x1388;var _0x1816c2;logger[_0xa9ae('0xc')](util[_0xa9ae('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa9ae('0xe')));return db['Setting'][_0xa9ae('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa9ae('0x10'),_0xa9ae('0x11')]})[_0xa9ae('0x12')](function(_0x35f861){if(_0x35f861){_0x1816c2=_0x35f861;_0x2d1188=_0x1816c2[_0xa9ae('0x11')]||0x1388;}})[_0xa9ae('0x12')](function(){return dbH[_0xa9ae('0x13')]['query'](util[_0xa9ae('0xd')](_0xa9ae('0x14'),QUERY),{'type':dbH[_0xa9ae('0x13')][_0xa9ae('0x15')]['SELECT']});})[_0xa9ae('0x12')](function(_0x1ec742){if(!_0x1ec742[0x0][_0xa9ae('0x16')]){return analyticExtractedReport(_0xa9ae('0x17'));}var _0x77b0a4=[];var _0xddb095=0x0;var _0x524bb2=!![];if(_0x1ec742&&_0x1ec742[_0xa9ae('0x18')]){var _0x42a98c=_0x1ec742[0x0][_0xa9ae('0x16')]%(_0xddb095+_0x2d1188);if(_0x1816c2['split']){for(;_0x524bb2;_0xddb095+=_0x2d1188,_0x42a98c=_0x1ec742[0x0]['num']%(_0xddb095+_0x2d1188)){if(_0x42a98c==0x0||_0x42a98c==_0x1ec742[0x0][_0xa9ae('0x16')]){_0x524bb2=![];}_0x77b0a4['push'](dbH['sequelize'][_0xa9ae('0x19')](util[_0xa9ae('0xd')](_0xa9ae('0x1a'),QUERY,_0x2d1188,_0xddb095),{'type':dbH[_0xa9ae('0x13')]['QueryTypes'][_0xa9ae('0x1b')]}));}}else{_0x77b0a4[_0xa9ae('0x1c')](dbH[_0xa9ae('0x13')][_0xa9ae('0x19')](QUERY,{'type':dbH[_0xa9ae('0x13')][_0xa9ae('0x15')][_0xa9ae('0x1b')]}));}}var _0x5a062d=path[_0xa9ae('0x1d')](PATH);var _0x4ca9a9=path['basename'](PATH,'.csv');var _0x478bb7=_0x1816c2[_0xa9ae('0x10')]&&_0x77b0a4['length']>0x1;var _0x13fb05=[];if(!fs['existsSync'](path[_0xa9ae('0x1e')](_0x5a062d,_0x4ca9a9))&&_0x478bb7){fs[_0xa9ae('0x1f')](path[_0xa9ae('0x1e')](_0x5a062d,_0x4ca9a9));}return BPromise[_0xa9ae('0x20')](_0x77b0a4,function(_0x12b061){_0x13fb05[_0xa9ae('0x1c')](_0x12b061);})[_0xa9ae('0x12')](function(){for(var _0x5e82f1=0x0;_0x5e82f1<_0x13fb05[_0xa9ae('0x18')];_0x5e82f1+=0x1){var _0x3873aa;var _0x2aac9e=_0x13fb05[_0x5e82f1];if(_0x478bb7){_0x3873aa=path[_0xa9ae('0x1e')](_0x5a062d,_0x4ca9a9,util[_0xa9ae('0xd')](_0xa9ae('0x21'),_0x4ca9a9,_0x5e82f1,_0xa9ae('0x22')));}else{_0x3873aa=path['join'](_0x5a062d,util['format'](_0xa9ae('0x23'),_0x4ca9a9,_0xa9ae('0x22')));}fs[_0xa9ae('0x24')](_0x3873aa,csv(_0x2aac9e));}})[_0xa9ae('0x12')](function(){if(_0x478bb7){zipdir(path[_0xa9ae('0x1e')](_0x5a062d,_0x4ca9a9),{'saveTo':path['join'](_0x5a062d,util['format'](_0xa9ae('0x23'),_0x4ca9a9,_0xa9ae('0x25')))},function(_0x372ec7,_0x3a48b7){});rimraf(path[_0xa9ae('0x1e')](_0x5a062d,_0x4ca9a9),function(){});}})[_0xa9ae('0x12')](function(){logger['info'](util['format'](_0xa9ae('0x26'),EXTRACTED_REPORT_ID,_0xa9ae('0xe')));return analyticExtractedReport(_0xa9ae('0x27'),_0x478bb7?util[_0xa9ae('0xd')](_0xa9ae('0x23'),_0x4ca9a9,_0x478bb7?_0xa9ae('0x25'):_0xa9ae('0x22')):null);});})[_0xa9ae('0x28')](function(_0x5c4f79){logger[_0xa9ae('0xc')](util['format'](_0xa9ae('0x29'),EXTRACTED_REPORT_ID,_0xa9ae('0xe')),util[_0xa9ae('0x2a')](_0x5c4f79,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xa9ae('0x2b')](function(){process[_0xa9ae('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 2abd525..5b3dd70 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 _0xd743=['JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','length','auto','body','chunk','keys','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','header','before','landscape','\x20/\x20','footer','Arial','right','num','Empty','basename','.pdf','join','%s.%s','Setting','find','splitSizePdf','then','split','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','existsSync','all','flatten','createPdfKitDocument','%s%d.%s','pdf','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','PDF','inspect','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.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','createWriteStream','finish','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd743,0x14f));var _0x3d74=function(_0x40ee09,_0x3393f9){_0x40ee09=_0x40ee09-0x0;var _0x19b1e2=_0xd743[_0x40ee09];return _0x19b1e2;};'use strict';var _=require(_0x3d74('0x0'));var fs=require('fs');var util=require(_0x3d74('0x1'));var path=require(_0x3d74('0x2'));var moment=require(_0x3d74('0x3'));var htmlToPdfmake=require(_0x3d74('0x4'));var PdfPrinter=require(_0x3d74('0x5'));var zipdir=require(_0x3d74('0x6'));var rimraf=require(_0x3d74('0x7'));var JSDOM=require(_0x3d74('0x8'))[_0x3d74('0x9')];var window=new JSDOM('')[_0x3d74('0xa')];var db=require('../../mysqldb')['db'];var dbH=require(_0x3d74('0xb'))[_0x3d74('0xc')];var logger=require(_0x3d74('0xd'))(_0x3d74('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x3d74('0xf')][0x2]);var QUERY=process[_0x3d74('0xf')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x3d74('0xf')][0x5];var FORMAT=_0x3d74('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x7110ff,_0x1d0de7){var _0x330ab8={'status':_0x7110ff};var _0x18d82e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1d0de7){_0x330ab8[_0x3d74('0x11')]=_0x1d0de7;}return db[_0x3d74('0x12')][_0x3d74('0x13')](_0x330ab8,_0x18d82e);}function getHeaders(_0x28f90f){return _[_0x3d74('0x14')](_0x28f90f,function(_0x564903){return{'text':_0x564903,'style':_0x3d74('0x15')};});}function getRows(_0x323170,_0x721860){return _['map'](_0x721860,function(_0x4cb1ee){return _(_0x4cb1ee)['pick'](_0x323170)[_0x3d74('0x14')](function(_0x473feb){return _0x473feb?_[_0x3d74('0x16')](_0x473feb):'';})['value']();});}function createTable(_0x5d92ad,_0x1bdc35){var _0x183ba4={'widths':_['fill'](Array(_0x5d92ad[_0x3d74('0x17')]),0x91),'heights':function(_0x472aed){return _0x472aed===0x0?_0x3d74('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x578967=getHeaders(_0x5d92ad);_0x183ba4[_0x3d74('0x19')]['push'](_0x578967);var _0x38e3a4=getRows(_0x5d92ad,_0x1bdc35);_0x183ba4[_0x3d74('0x19')]=_0x183ba4[_0x3d74('0x19')]['concat'](_0x38e3a4);return _0x183ba4;}function createTables(_0x1f82c0){var _0x3f43c4=[];var _0x53b88f=_[_0x3d74('0x1a')](Object[_0x3d74('0x1b')](_0x1f82c0[0x0]),0x5);_0x53b88f['forEach'](function(_0x1828dd){_0x3f43c4[_0x3d74('0x1c')](createTable(_0x1828dd,_0x1f82c0));});return _0x3f43c4;}function getPDFDocDefinition(_0x27615c){var _0x97bf61=util['format'](_0x3d74('0x1d'),NAME,EXTRACTED_REPORT[_0x3d74('0x1e')],moment(EXTRACTED_REPORT[_0x3d74('0x1f')])[_0x3d74('0x20')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x3e57f5=[];for(var _0x64be4f=0x0;_0x64be4f<_0x27615c[_0x3d74('0x17')];_0x64be4f++){var _0x282a69=[];if(_0x64be4f===0x0){_0x282a69[_0x3d74('0x1c')]({'text':_0x97bf61,'style':_0x3d74('0x21')});}var _0x1d8b67={'table':_0x27615c[_0x64be4f]};if(_0x64be4f>0x0){_0x1d8b67['pageBreak']=_0x3d74('0x22');_0x1d8b67['margin']=[0x0,0x46,0x0,0x0];}_0x282a69[_0x3d74('0x1c')](_0x1d8b67);_0x3e57f5[_0x3d74('0x1c')](_0x282a69);}return{'pageSize':'A4','pageOrientation':_0x3d74('0x23'),'content':_0x3e57f5,'footer':function(_0x20bad8,_0xffd77a){return{'text':_0x20bad8[_0x3d74('0x16')]()+_0x3d74('0x24')+_0xffd77a,'style':_0x3d74('0x25')};},'defaultStyle':{'font':_0x3d74('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x3d74('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1e2511){var _0x9c2c39=0x1388;var _0x960505;if(!_0x1e2511[0x0][_0x3d74('0x28')]){return analyticExtractedReport(_0x3d74('0x29'));}var _0x1660a5=[];var _0x3c3131=0x0;var _0x8bc970=!![];var _0x6072b7=path['dirname'](PATH);var _0x4b9016=path[_0x3d74('0x2a')](PATH,_0x3d74('0x2b'));var _0x442fbd=path[_0x3d74('0x2c')](_0x6072b7,util[_0x3d74('0x20')](_0x3d74('0x2d'),_0x4b9016,'pdf'));var _0x23e3e7=![];return db[_0x3d74('0x2e')][_0x3d74('0x2f')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x3d74('0x30')]})['then'](function(_0x174de0){if(_0x174de0){_0x960505=_0x174de0;_0x9c2c39=_0x960505[_0x3d74('0x30')]||0x3e8;}})[_0x3d74('0x31')](function(){if(_0x1e2511&&_0x1e2511[_0x3d74('0x17')]){var _0x4578d7=_0x1e2511[0x0]['num']%(_0x3c3131+_0x9c2c39);if(_0x960505[_0x3d74('0x32')]){for(;_0x8bc970;_0x3c3131+=_0x9c2c39,_0x4578d7=_0x1e2511[0x0][_0x3d74('0x28')]%(_0x3c3131+_0x9c2c39)){if(_0x4578d7==0x0||_0x4578d7==_0x1e2511[0x0][_0x3d74('0x28')]){_0x8bc970=![];}_0x1660a5[_0x3d74('0x1c')](dbH[_0x3d74('0x33')]['query'](util[_0x3d74('0x20')](_0x3d74('0x34'),QUERY,_0x9c2c39,_0x3c3131),{'type':dbH[_0x3d74('0x33')][_0x3d74('0x35')][_0x3d74('0x36')]}));}}else{_0x1660a5['push'](dbH[_0x3d74('0x33')][_0x3d74('0x37')](QUERY,{'type':dbH[_0x3d74('0x33')][_0x3d74('0x35')][_0x3d74('0x36')]}));}}_0x23e3e7=_0x960505[_0x3d74('0x32')]&&_0x1660a5['length']>0x1;if(!fs[_0x3d74('0x38')](path['join'](_0x6072b7,_0x4b9016))&&_0x23e3e7){fs['mkdirSync'](path['join'](_0x6072b7,_0x4b9016));}return Promise[_0x3d74('0x39')](_0x1660a5);})[_0x3d74('0x31')](function(_0x3fdb07){return createTables(_[_0x3d74('0x3a')](_0x3fdb07));})['then'](function(_0x267913){var _0xcd88d5=getPDFDocDefinition(_0x267913);var _0x393f78=getPDFPrinter();var _0x144e92=_0x393f78[_0x3d74('0x3b')](_0xcd88d5);if(_0x23e3e7)_0x442fbd=path[_0x3d74('0x2c')](_0x6072b7,_0x4b9016,util[_0x3d74('0x20')](_0x3d74('0x3c'),_0x4b9016,index,_0x3d74('0x3d')));return writePDFDocument(_0x144e92,_0x442fbd);})[_0x3d74('0x31')](function(){if(!_0x23e3e7)return;zipdir(path[_0x3d74('0x2c')](_0x6072b7,_0x4b9016),{'saveTo':path[_0x3d74('0x2c')](_0x6072b7,util[_0x3d74('0x20')](_0x3d74('0x2d'),_0x4b9016,'zip'))},function(_0x43f8a4){if(_0x43f8a4)throw _0x43f8a4;return;});})[_0x3d74('0x31')](function(){if(!_0x23e3e7)return;rimraf(path['join'](_0x6072b7,_0x4b9016),function(){});})[_0x3d74('0x31')](function(){logger[_0x3d74('0x3e')](util['format'](_0x3d74('0x3f'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x3d74('0x40'),_0x23e3e7?util['format'](_0x3d74('0x2d'),_0x4b9016,_0x23e3e7?'zip':_0x3d74('0x3d')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3d74('0x3e')](util[_0x3d74('0x20')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x3d74('0x12')][_0x3d74('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3d74('0x31')](function(_0x4c1cf3){EXTRACTED_REPORT=_0x4c1cf3;return dbH['sequelize']['query'](util[_0x3d74('0x20')](_0x3d74('0x42'),QUERY),{'type':dbH[_0x3d74('0x33')][_0x3d74('0x35')][_0x3d74('0x36')]});})[_0x3d74('0x31')](extractReport)[_0x3d74('0x43')](function(_0x5a2e3d){logger[_0x3d74('0x3e')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3d74('0x44')),util[_0x3d74('0x45')](_0x5a2e3d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x3d74('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x357c93=new PdfPrinter({'Arial':{'normal':__dirname+_0x3d74('0x47'),'bold':__dirname+_0x3d74('0x48'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x3d74('0x49')}});return _0x357c93;}function getPDFDocDefinitionFromHTML(_0x12fd79,_0x43d799){var _0x5c1540=util[_0x3d74('0x20')](_0x3d74('0x4a'),_0x43d799[_0x3d74('0x4b')],_0x43d799[_0x3d74('0x4c')]);var _0x5ce342=moment()[_0x3d74('0x20')](_0x3d74('0x4d'))[_0x3d74('0x16')]();var _0x82e104=htmlToPdfmake(_0x12fd79,{'window':window,'tableAutoSize':!![]});return{'content':[_0x82e104],'defaultStyle':{'font':_0x3d74('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3d74('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3d74('0x4e')}},'header':function(){return[{'text':_0x3d74('0x4f'),'style':_0x3d74('0x21')}];},'footer':function(_0x585bf9,_0x209f85){return[{'text':util[_0x3d74('0x20')](_0x3d74('0x50'),_0x5c1540,_0x585bf9,_0x209f85,_0x5ce342),'style':_0x3d74('0x25')}];}};}function writePDFDocument(_0x511212,_0x18f42b){return new Promise(function(_0xc89750,_0x40659a){var _0x2aa969=_0x511212[_0x3d74('0x51')](fs[_0x3d74('0x52')](_0x18f42b));_0x2aa969['on'](_0x3d74('0x53'),function(){_0xc89750('finish');});_0x2aa969['on']('error',function(_0x5677e8){_0x40659a(_0x5677e8);});_0x511212[_0x3d74('0x54')]();});}exports[_0x3d74('0x55')]=function(_0x3be7bd,_0x2016fc){var _0x337e55=getPDFPrinter();var _0x1d167b=getPDFDocDefinitionFromHTML(_0x3be7bd,_0x2016fc);var _0x3890a3=_0x337e55[_0x3d74('0x3b')](_0x1d167b);return writePDFDocument(_0x3890a3,_0x2016fc[_0x3d74('0x2')])[_0x3d74('0x43')](function(_0x50e8ec){throw _0x50e8ec;});}; \ No newline at end of file +var _0xe11d=['all','flatten','%s%d.%s','pdf','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','length','auto','push','chunk','keys','forEach','format','name','startDate','endDate','header','pageBreak','before','margin','landscape','footer','Arial','black','right','num','basename','join','%s.%s','find','split','splitSizePdf','then','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','mkdirSync'];(function(_0x3b42ba,_0x7fa12e){var _0x247c40=function(_0x102e22){while(--_0x102e22){_0x3b42ba['push'](_0x3b42ba['shift']());}};_0x247c40(++_0x7fa12e);}(_0xe11d,0x71));var _0xde11=function(_0x5645d0,_0x553088){_0x5645d0=_0x5645d0-0x0;var _0x5935a2=_0xe11d[_0x5645d0];return _0x5935a2;};'use strict';var _=require(_0xde11('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xde11('0x1'));var moment=require(_0xde11('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xde11('0x3'));var zipdir=require(_0xde11('0x4'));var rimraf=require(_0xde11('0x5'));var JSDOM=require(_0xde11('0x6'))[_0xde11('0x7')];var window=new JSDOM('')[_0xde11('0x8')];var db=require('../../mysqldb')['db'];var dbH=require(_0xde11('0x9'))[_0xde11('0xa')];var logger=require(_0xde11('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xde11('0xc')][0x2]);var QUERY=process[_0xde11('0xc')][0x3];var PATH=process[_0xde11('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4d1c64,_0x4fbede){var _0x2b6f82={'status':_0x4d1c64};var _0x56e652={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4fbede){_0x2b6f82[_0xde11('0xd')]=_0x4fbede;}return db[_0xde11('0xe')][_0xde11('0xf')](_0x2b6f82,_0x56e652);}function getHeaders(_0xd2e017){return _[_0xde11('0x10')](_0xd2e017,function(_0x3ae2e5){return{'text':_0x3ae2e5,'style':_0xde11('0x11')};});}function getRows(_0x1037e1,_0x574553){return _[_0xde11('0x10')](_0x574553,function(_0x2afe64){return _(_0x2afe64)[_0xde11('0x12')](_0x1037e1)[_0xde11('0x10')](function(_0x3e9e6e){return _0x3e9e6e?_[_0xde11('0x13')](_0x3e9e6e):'';})['value']();});}function createTable(_0x4fa85e,_0x104636){var _0x51f3d9={'widths':_['fill'](Array(_0x4fa85e[_0xde11('0x14')]),0x91),'heights':function(_0x587762){return _0x587762===0x0?_0xde11('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x36c7b3=getHeaders(_0x4fa85e);_0x51f3d9['body'][_0xde11('0x16')](_0x36c7b3);var _0x109c10=getRows(_0x4fa85e,_0x104636);_0x51f3d9['body']=_0x51f3d9['body']['concat'](_0x109c10);return _0x51f3d9;}function createTables(_0x436bd4){var _0x470d9c=[];var _0x409b61=_[_0xde11('0x17')](Object[_0xde11('0x18')](_0x436bd4[0x0]),0x5);_0x409b61[_0xde11('0x19')](function(_0x1b7f6a){_0x470d9c[_0xde11('0x16')](createTable(_0x1b7f6a,_0x436bd4));});return _0x470d9c;}function getPDFDocDefinition(_0x5432f8){var _0xcd0371=util[_0xde11('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xde11('0x1b')],moment(EXTRACTED_REPORT[_0xde11('0x1c')])[_0xde11('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0xde11('0x1d')])['format'](FORMAT));var _0xdec8d1=[];for(var _0x4a6eb2=0x0;_0x4a6eb2<_0x5432f8['length'];_0x4a6eb2++){var _0x50fae8=[];if(_0x4a6eb2===0x0){_0x50fae8[_0xde11('0x16')]({'text':_0xcd0371,'style':_0xde11('0x1e')});}var _0x53017a={'table':_0x5432f8[_0x4a6eb2]};if(_0x4a6eb2>0x0){_0x53017a[_0xde11('0x1f')]=_0xde11('0x20');_0x53017a[_0xde11('0x21')]=[0x0,0x46,0x0,0x0];}_0x50fae8[_0xde11('0x16')](_0x53017a);_0xdec8d1['push'](_0x50fae8);}return{'pageSize':'A4','pageOrientation':_0xde11('0x22'),'content':_0xdec8d1,'footer':function(_0x5216b3,_0x185c5a){return{'text':_0x5216b3[_0xde11('0x13')]()+'\x20/\x20'+_0x185c5a,'style':_0xde11('0x23')};},'defaultStyle':{'font':_0xde11('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xde11('0x25')},'footer':{'alignment':_0xde11('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1dc19f){var _0x2b0475=0x1388;var _0x271670;if(!_0x1dc19f[0x0][_0xde11('0x27')]){return analyticExtractedReport('Empty');}var _0x431db2=[];var _0x3f3c3d=0x0;var _0x17fded=!![];var _0x5c8cb1=path['dirname'](PATH);var _0xe104d0=path[_0xde11('0x28')](PATH,'.pdf');var _0x1435bc=path[_0xde11('0x29')](_0x5c8cb1,util[_0xde11('0x1a')](_0xde11('0x2a'),_0xe104d0,'pdf'));var _0x45396c=![];return db['Setting'][_0xde11('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xde11('0x2c'),_0xde11('0x2d')]})[_0xde11('0x2e')](function(_0x27f0e){if(_0x27f0e){_0x271670=_0x27f0e;_0x2b0475=_0x271670[_0xde11('0x2d')]||0x3e8;}})[_0xde11('0x2e')](function(){if(_0x1dc19f&&_0x1dc19f['length']){var _0x3c5321=_0x1dc19f[0x0][_0xde11('0x27')]%(_0x3f3c3d+_0x2b0475);if(_0x271670[_0xde11('0x2c')]){for(;_0x17fded;_0x3f3c3d+=_0x2b0475,_0x3c5321=_0x1dc19f[0x0][_0xde11('0x27')]%(_0x3f3c3d+_0x2b0475)){if(_0x3c5321==0x0||_0x3c5321==_0x1dc19f[0x0][_0xde11('0x27')]){_0x17fded=![];}_0x431db2['push'](dbH[_0xde11('0x2f')][_0xde11('0x30')](util[_0xde11('0x1a')](_0xde11('0x31'),QUERY,_0x2b0475,_0x3f3c3d),{'type':dbH[_0xde11('0x2f')][_0xde11('0x32')][_0xde11('0x33')]}));}}else{_0x431db2['push'](dbH[_0xde11('0x2f')][_0xde11('0x30')](QUERY,{'type':dbH[_0xde11('0x2f')][_0xde11('0x32')][_0xde11('0x33')]}));}}_0x45396c=_0x271670[_0xde11('0x2c')]&&_0x431db2[_0xde11('0x14')]>0x1;if(!fs['existsSync'](path['join'](_0x5c8cb1,_0xe104d0))&&_0x45396c){fs[_0xde11('0x34')](path[_0xde11('0x29')](_0x5c8cb1,_0xe104d0));}return Promise[_0xde11('0x35')](_0x431db2);})[_0xde11('0x2e')](function(_0x265878){return createTables(_[_0xde11('0x36')](_0x265878));})[_0xde11('0x2e')](function(_0x21f726){var _0x244728=getPDFDocDefinition(_0x21f726);var _0x50db4e=getPDFPrinter();var _0x47d623=_0x50db4e['createPdfKitDocument'](_0x244728);if(_0x45396c)_0x1435bc=path[_0xde11('0x29')](_0x5c8cb1,_0xe104d0,util[_0xde11('0x1a')](_0xde11('0x37'),_0xe104d0,index,_0xde11('0x38')));return writePDFDocument(_0x47d623,_0x1435bc);})[_0xde11('0x2e')](function(){if(!_0x45396c)return;zipdir(path['join'](_0x5c8cb1,_0xe104d0),{'saveTo':path[_0xde11('0x29')](_0x5c8cb1,util[_0xde11('0x1a')](_0xde11('0x2a'),_0xe104d0,_0xde11('0x39')))},function(_0xea4c31){if(_0xea4c31)throw _0xea4c31;return;});})['then'](function(){if(!_0x45396c)return;rimraf(path[_0xde11('0x29')](_0x5c8cb1,_0xe104d0),function(){});})[_0xde11('0x2e')](function(){logger[_0xde11('0x3a')](util['format'](_0xde11('0x3b'),EXTRACTED_REPORT_ID,_0xde11('0x3c')));return analyticExtractedReport(_0xde11('0x3d'),_0x45396c?util['format'](_0xde11('0x2a'),_0xe104d0,_0x45396c?'zip':_0xde11('0x38')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xde11('0x3a')](util[_0xde11('0x1a')](_0xde11('0x3e'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xde11('0xe')][_0xde11('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xde11('0x2e')](function(_0x20fa52){EXTRACTED_REPORT=_0x20fa52;return dbH['sequelize']['query'](util[_0xde11('0x1a')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xde11('0x2f')][_0xde11('0x32')]['SELECT']});})[_0xde11('0x2e')](extractReport)[_0xde11('0x40')](function(_0x5709d1){logger['info'](util[_0xde11('0x1a')](_0xde11('0x41'),EXTRACTED_REPORT_ID,_0xde11('0x42')),util['inspect'](_0x5709d1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xde11('0x43'));})[_0xde11('0x44')](function(){process[_0xde11('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1bcf35=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xde11('0x46'),'italics':__dirname+_0xde11('0x47'),'bolditalics':__dirname+_0xde11('0x48')}});return _0x1bcf35;}function getPDFDocDefinitionFromHTML(_0x4bb7e1,_0x29d117){var _0x31f2eb=util[_0xde11('0x1a')](_0xde11('0x49'),_0x29d117['channel'],_0x29d117[_0xde11('0x4a')]);var _0x699662=moment()[_0xde11('0x1a')](_0xde11('0x4b'))['toString']();var _0x423515=htmlToPdfmake(_0x4bb7e1,{'window':window,'tableAutoSize':!![]});return{'content':[_0x423515],'defaultStyle':{'font':_0xde11('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xde11('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xde11('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xde11('0x4c')}},'header':function(){return[{'text':_0xde11('0x4d'),'style':'header'}];},'footer':function(_0x9c4f96,_0x5636e7){return[{'text':util[_0xde11('0x1a')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x31f2eb,_0x9c4f96,_0x5636e7,_0x699662),'style':'footer'}];}};}function writePDFDocument(_0x13465c,_0x3ae90d){return new Promise(function(_0x4edd59,_0x11dde0){var _0x301a70=_0x13465c[_0xde11('0x4e')](fs[_0xde11('0x4f')](_0x3ae90d));_0x301a70['on'](_0xde11('0x50'),function(){_0x4edd59(_0xde11('0x50'));});_0x301a70['on']('error',function(_0x47672c){_0x11dde0(_0x47672c);});_0x13465c[_0xde11('0x51')]();});}exports[_0xde11('0x52')]=function(_0x3915fd,_0x56d926){var _0x45e7af=getPDFPrinter();var _0x296775=getPDFDocDefinitionFromHTML(_0x3915fd,_0x56d926);var _0x1b472e=_0x45e7af['createPdfKitDocument'](_0x296775);return writePDFDocument(_0x1b472e,_0x56d926[_0xde11('0x1')])['catch'](function(_0x153020){throw _0x153020;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 67b8690..9ecbf46 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 _0x61a3=['mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','update','format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','Empty','length','push','SELECT','dirname','basename','.xlsx','existsSync','join'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0x61a3,0x69));var _0x361a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61a3[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x361a('0x0'));var path=require(_0x361a('0x1'));var _=require(_0x361a('0x2'));var fs=require('fs');var json2xls=require(_0x361a('0x3'));var BPromise=require(_0x361a('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x361a('0x5'));var db=require(_0x361a('0x6'))['db'];var dbH=require('../../mysqldb')[_0x361a('0x7')];var logger=require(_0x361a('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x361a('0x9')][0x3];var PATH=process[_0x361a('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3850ab,_0x2bbee2){var _0x1d923c={'status':_0x3850ab};var _0x386ae9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2bbee2){_0x1d923c[_0x361a('0xa')]=_0x2bbee2;}return db['AnalyticExtractedReport'][_0x361a('0xb')](_0x1d923c,_0x386ae9);}function main(){var _0x4fa56c=0x1388;var _0x585b86;logger['info'](util[_0x361a('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x361a('0xd')));return db[_0x361a('0xe')][_0x361a('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x361a('0x10'),_0x361a('0x11')]})[_0x361a('0x12')](function(_0x312ef7){if(_0x312ef7){_0x585b86=_0x312ef7;_0x4fa56c=_0x585b86[_0x361a('0x11')]||0x1388;}})[_0x361a('0x12')](function(){return dbH['sequelize'][_0x361a('0x13')](util['format'](_0x361a('0x14'),QUERY),{'type':dbH[_0x361a('0x15')][_0x361a('0x16')]['SELECT']});})[_0x361a('0x12')](function(_0x2352ce){if(!_0x2352ce[0x0][_0x361a('0x17')]){return analyticExtractedReport(_0x361a('0x18'));}var _0x3643a1=[];var _0x5d39ad=0x0;var _0x3eea06=!![];if(_0x585b86[_0x361a('0x10')]){if(_0x2352ce&&_0x2352ce[_0x361a('0x19')]){var _0x47b044=_0x2352ce[0x0]['num']%(_0x5d39ad+_0x4fa56c);for(;_0x3eea06;_0x5d39ad+=_0x4fa56c,_0x47b044=_0x2352ce[0x0][_0x361a('0x17')]%(_0x5d39ad+_0x4fa56c)){if(_0x47b044==0x0||_0x47b044==_0x2352ce[0x0][_0x361a('0x17')]){_0x3eea06=![];}_0x3643a1[_0x361a('0x1a')](dbH[_0x361a('0x15')][_0x361a('0x13')](util[_0x361a('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4fa56c,_0x5d39ad),{'type':dbH[_0x361a('0x15')][_0x361a('0x16')][_0x361a('0x1b')]}));}}}else{_0x3643a1[_0x361a('0x1a')](dbH['sequelize'][_0x361a('0x13')](QUERY,{'type':dbH['sequelize'][_0x361a('0x16')][_0x361a('0x1b')]}));}var _0x3f2d57=path[_0x361a('0x1c')](PATH);var _0x2d3eaf=path[_0x361a('0x1d')](PATH,_0x361a('0x1e'));var _0x2fe2e1=_0x585b86[_0x361a('0x10')]&&_0x3643a1[_0x361a('0x19')]>0x1;var _0x9824bc=[];if(!fs[_0x361a('0x1f')](path[_0x361a('0x20')](_0x3f2d57,_0x2d3eaf))&&_0x2fe2e1){fs[_0x361a('0x21')](path[_0x361a('0x20')](_0x3f2d57,_0x2d3eaf));}return BPromise['each'](_0x3643a1,function(_0x316b92){_0x9824bc['push'](_0x316b92);})[_0x361a('0x12')](function(){for(var _0x1f59ca=0x0;_0x1f59ca<_0x9824bc[_0x361a('0x19')];_0x1f59ca+=0x1){var _0xb6d218;var _0x19b23c=_0x9824bc[_0x1f59ca];if(_0x2fe2e1){_0xb6d218=path[_0x361a('0x20')](_0x3f2d57,_0x2d3eaf,util[_0x361a('0xc')](_0x361a('0x22'),_0x2d3eaf,_0x1f59ca,_0x361a('0x23')));}else{_0xb6d218=path[_0x361a('0x20')](_0x3f2d57,util[_0x361a('0xc')](_0x361a('0x24'),_0x2d3eaf,_0x361a('0x23')));}fs[_0x361a('0x25')](_0xb6d218,json2xls(_0x19b23c),_0x361a('0x26'));}})[_0x361a('0x12')](function(){if(_0x2fe2e1){zipdir(path[_0x361a('0x20')](_0x3f2d57,_0x2d3eaf),{'saveTo':path['join'](_0x3f2d57,util['format'](_0x361a('0x24'),_0x2d3eaf,_0x361a('0x27')))},function(_0x5bd2b7,_0x36731a){});rimraf(path[_0x361a('0x20')](_0x3f2d57,_0x2d3eaf),function(){});}})['then'](function(){logger[_0x361a('0x28')](util[_0x361a('0xc')](_0x361a('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x2fe2e1?util['format']('%s.%s',_0x2d3eaf,_0x2fe2e1?_0x361a('0x27'):_0x361a('0x23')):null);});})[_0x361a('0x2a')](function(_0x2778a3){logger['info'](util[_0x361a('0xc')](_0x361a('0x2b'),EXTRACTED_REPORT_ID,_0x361a('0xd')),util[_0x361a('0x2c')](_0x2778a3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x361a('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x405c=['dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','info','catch','inspect','Failed','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0x5999ba,_0x97b26a){var _0x2140b5=function(_0x23b3fb){while(--_0x23b3fb){_0x5999ba['push'](_0x5999ba['shift']());}};_0x2140b5(++_0x97b26a);}(_0x405c,0x171));var _0xc405=function(_0xf4bf19,_0x4b7d39){_0xf4bf19=_0xf4bf19-0x0;var _0x3d2ddf=_0x405c[_0xf4bf19];return _0x3d2ddf;};'use strict';var util=require(_0xc405('0x0'));var path=require(_0xc405('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xc405('0x2'));var BPromise=require(_0xc405('0x3'));var zipdir=require(_0xc405('0x4'));var rimraf=require(_0xc405('0x5'));var db=require(_0xc405('0x6'))['db'];var dbH=require(_0xc405('0x6'))[_0xc405('0x7')];var logger=require(_0xc405('0x8'))(_0xc405('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xc405('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xc405('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xcbf878,_0x4333e5){var _0x2ccbdd={'status':_0xcbf878};var _0x3e0115={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4333e5){_0x2ccbdd[_0xc405('0xb')]=_0x4333e5;}return db[_0xc405('0xc')][_0xc405('0xd')](_0x2ccbdd,_0x3e0115);}function main(){var _0x4521af=0x1388;var _0x142e69;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc405('0xe')));return db[_0xc405('0xf')][_0xc405('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc405('0x11'),_0xc405('0x12')]})[_0xc405('0x13')](function(_0x172f86){if(_0x172f86){_0x142e69=_0x172f86;_0x4521af=_0x142e69[_0xc405('0x12')]||0x1388;}})['then'](function(){return dbH[_0xc405('0x14')][_0xc405('0x15')](util[_0xc405('0x16')](_0xc405('0x17'),QUERY),{'type':dbH['sequelize'][_0xc405('0x18')][_0xc405('0x19')]});})['then'](function(_0x51f3f1){if(!_0x51f3f1[0x0]['num']){return analyticExtractedReport(_0xc405('0x1a'));}var _0x3db92e=[];var _0x1c794e=0x0;var _0x415695=!![];if(_0x142e69[_0xc405('0x11')]){if(_0x51f3f1&&_0x51f3f1[_0xc405('0x1b')]){var _0x1e21af=_0x51f3f1[0x0][_0xc405('0x1c')]%(_0x1c794e+_0x4521af);for(;_0x415695;_0x1c794e+=_0x4521af,_0x1e21af=_0x51f3f1[0x0][_0xc405('0x1c')]%(_0x1c794e+_0x4521af)){if(_0x1e21af==0x0||_0x1e21af==_0x51f3f1[0x0]['num']){_0x415695=![];}_0x3db92e[_0xc405('0x1d')](dbH['sequelize'][_0xc405('0x15')](util['format'](_0xc405('0x1e'),QUERY,_0x4521af,_0x1c794e),{'type':dbH[_0xc405('0x14')]['QueryTypes'][_0xc405('0x19')]}));}}}else{_0x3db92e['push'](dbH[_0xc405('0x14')][_0xc405('0x15')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xc405('0x19')]}));}var _0x4999c0=path[_0xc405('0x1f')](PATH);var _0x184ecf=path[_0xc405('0x20')](PATH,_0xc405('0x21'));var _0x3f336e=_0x142e69[_0xc405('0x11')]&&_0x3db92e[_0xc405('0x1b')]>0x1;var _0x24415d=[];if(!fs[_0xc405('0x22')](path[_0xc405('0x23')](_0x4999c0,_0x184ecf))&&_0x3f336e){fs[_0xc405('0x24')](path[_0xc405('0x23')](_0x4999c0,_0x184ecf));}return BPromise['each'](_0x3db92e,function(_0x34af27){_0x24415d['push'](_0x34af27);})[_0xc405('0x13')](function(){for(var _0x43720a=0x0;_0x43720a<_0x24415d['length'];_0x43720a+=0x1){var _0x3fae41;var _0x24f7e5=_0x24415d[_0x43720a];if(_0x3f336e){_0x3fae41=path[_0xc405('0x23')](_0x4999c0,_0x184ecf,util[_0xc405('0x16')](_0xc405('0x25'),_0x184ecf,_0x43720a,'xlsx'));}else{_0x3fae41=path[_0xc405('0x23')](_0x4999c0,util[_0xc405('0x16')](_0xc405('0x26'),_0x184ecf,_0xc405('0x27')));}fs[_0xc405('0x28')](_0x3fae41,json2xls(_0x24f7e5),_0xc405('0x29'));}})[_0xc405('0x13')](function(){if(_0x3f336e){zipdir(path['join'](_0x4999c0,_0x184ecf),{'saveTo':path['join'](_0x4999c0,util['format'](_0xc405('0x26'),_0x184ecf,_0xc405('0x2a')))},function(_0x369b63,_0x3f0407){});rimraf(path[_0xc405('0x23')](_0x4999c0,_0x184ecf),function(){});}})[_0xc405('0x13')](function(){logger[_0xc405('0x2b')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xc405('0xe')));return analyticExtractedReport('Completed',_0x3f336e?util[_0xc405('0x16')](_0xc405('0x26'),_0x184ecf,_0x3f336e?'zip':_0xc405('0x27')):null);});})[_0xc405('0x2c')](function(_0x3f8efa){logger[_0xc405('0x2b')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc405('0xe')),util[_0xc405('0x2d')](_0x3f8efa,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc405('0x2e'));})['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 beb5ba1..4fbead7 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 _0x6144=['groupBy','queue','hasOwnProperty','extensions','extension','type','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','push','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','destroy','sortBy','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter'];(function(_0xbb7e59,_0x18590f){var _0x299681=function(_0x3ac77a){while(--_0x3ac77a){_0xbb7e59['push'](_0xbb7e59['shift']());}};_0x299681(++_0x18590f);}(_0x6144,0x1d5));var _0x4614=function(_0x170ee8,_0x67794a){_0x170ee8=_0x170ee8-0x0;var _0x22fd46=_0x6144[_0x170ee8];return _0x22fd46;};'use strict';var _=require(_0x4614('0x0'));var util=require(_0x4614('0x1'));function rewrite(_0x18453e,_0x32e973){var _0x432adc=this;return _0x18453e[_0x4614('0x2')][_0x4614('0x3')][_0x4614('0x4')]({'raw':!![]})[_0x4614('0x5')](function(_0x27318f){_0x432adc[_0x4614('0x6')]=_0x27318f;return _0x18453e[_0x4614('0x2')][_0x4614('0x7')]['findAll']({'where':{'IntervalId':_0x32e973[_0x4614('0x8')]},'raw':!![]});})[_0x4614('0x5')](function(_0x5b5c09){return _0x18453e[_0x4614('0x2')][_0x4614('0x7')][_0x4614('0x4')]({'where':{'exten':{'$in':_[_0x4614('0x9')](_[_0x4614('0xa')](_0x5b5c09,_0x4614('0xb')))}},'order':[{'raw':_0x4614('0xc')}],'raw':!![]});})[_0x4614('0x5')](function(_0xffb563){var _0x15d6b9=_[_0x4614('0xd')](_0xffb563,{'priority':'1'});var _0x13ace4=_[_0x4614('0xd')](_0xffb563,{'isApp':0x1});var _0x9cf412=_[_0x4614('0xe')](_0x13ace4,_0x4614('0xb'));var _0x2b727d=[_0x4614('0xf'),'playback'];var _0x532c4c=[];var _0x43e136=[];for(var _0x5bd31c in _0x9cf412){if(_0x9cf412[_0x4614('0x10')](_0x5bd31c)){_0x432adc['priority']=0x2;_0x432adc[_0x4614('0x11')]=[];_0x432adc[_0x4614('0x12')]=_['find'](_0x15d6b9,{'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')]});_0x432adc[_0x4614('0x11')]['push']({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':'Set','appdata':util[_0x4614('0x14')](_0x4614('0x15'),_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')]),'context':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x16')],'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')],'priority':_0x432adc[_0x4614('0x17')]++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')]});if(_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')]===_0x4614('0x19')){_0x432adc['extensions']['push']({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':_0x4614('0x1a'),'appdata':_0x4614('0x1b')+_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')],'context':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x16')],'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')],'priority':_0x432adc[_0x4614('0x17')]++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')]});}else if(_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')]===_0x4614('0x1c')){if(_0x432adc[_0x4614('0x12')]){_0x432adc[_0x4614('0x11')][_0x4614('0x1d')]({'type':_0x9cf412[_0x5bd31c][0x0]['type'],'app':_0x4614('0x1a'),'appdata':_0x4614('0x1e')+(_0x432adc[_0x4614('0x12')][_0x4614('0x1f')]?_0x4614('0x20')+_0x432adc['extension'][_0x4614('0x1f')]+'}':'${EXTEN}'),'context':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x16')],'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')],'priority':_0x432adc[_0x4614('0x17')]++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0]['VoiceExtensionId']});}_0x432adc[_0x4614('0x11')][_0x4614('0x1d')]({'type':_0x9cf412[_0x5bd31c][0x0]['type'],'app':'Set','appdata':_0x4614('0x1b')+_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')],'context':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x16')],'exten':_0x9cf412[_0x5bd31c][0x0]['exten'],'priority':_0x432adc['priority']++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')]});var _0x5cb9a5=_0x432adc[_0x4614('0x17')]++;_0x432adc[_0x4614('0x11')]['push']({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':_0x4614('0x21'),'appdata':_0x4614('0x22')+(_0x5cb9a5+0x2)+_0x4614('0x23')+(_0x5cb9a5+0x1)+')','context':_0x9cf412[_0x5bd31c][0x0]['context'],'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')],'priority':_0x5cb9a5,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')]});if(_0x432adc[_0x4614('0x12')]){_0x432adc[_0x4614('0x11')]['push']({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':_0x4614('0x1a'),'appdata':_0x432adc[_0x4614('0x12')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x432adc[_0x4614('0x12')]['cutdigits']+'}':_0x4614('0x24'),'context':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x16')],'exten':_0x9cf412[_0x5bd31c][0x0]['exten'],'priority':_0x432adc[_0x4614('0x17')]++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0]['VoiceExtensionId']});}_0x432adc[_0x4614('0x11')][_0x4614('0x1d')]({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':_0x4614('0x1a'),'appdata':_0x4614('0x25')+_0x9cf412[_0x5bd31c][0x0]['VoiceExtensionId'],'context':_0x9cf412[_0x5bd31c][0x0]['context'],'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')],'priority':_0x432adc[_0x4614('0x17')]++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')]});if(_0x432adc[_0x4614('0x12')]&&_0x432adc[_0x4614('0x12')]['hasOwnProperty'](_0x4614('0x26'))&&_0x432adc[_0x4614('0x12')][_0x4614('0x26')]!==_0x4614('0x27')){_0x432adc['extensions'][_0x4614('0x1d')]({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':_0x4614('0x1a'),'appdata':_0x4614('0x28'),'context':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x16')],'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')],'priority':_0x432adc['priority']++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0]['VoiceExtensionId']});_0x432adc['extensions']['push']({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':_0x4614('0x1a'),'appdata':_0x4614('0x29')+_0x432adc['extension'][_0x4614('0x26')]||'wav','context':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x16')],'exten':_0x9cf412[_0x5bd31c][0x0]['exten'],'priority':_0x432adc[_0x4614('0x17')]++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')]});}}_0x432adc[_0x4614('0x11')][_0x4614('0x1d')]({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':'Set','appdata':_0x4614('0x2a'),'context':_0x9cf412[_0x5bd31c][0x0]['context'],'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')],'priority':_0x432adc[_0x4614('0x17')]++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0]['VoiceExtensionId']});_0x432adc[_0x4614('0x11')][_0x4614('0x1d')]({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':_0x4614('0x1a'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x16')],'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')],'priority':_0x432adc[_0x4614('0x17')]++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')]});_0x432adc[_0x4614('0x11')][_0x4614('0x1d')]({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':_0x4614('0x1a'),'appdata':_0x4614('0x2b'),'context':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x16')],'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')],'priority':_0x432adc[_0x4614('0x17')]++,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')]});for(var _0x574324=0x0,_0x4b25d2=0x0;_0x574324<_0x9cf412[_0x5bd31c][_0x4614('0x2c')];_0x574324+=0x1,_0x4b25d2=0x0){var _0x1831f0=_0x9cf412[_0x5bd31c][_0x574324];if(_0x1831f0[_0x4614('0x13')]){_0x1831f0[_0x4614('0x13')]=_0x1831f0[_0x4614('0x13')][_0x4614('0x2d')]();}var _0x4f07d9=[];var _0x60b4ef=[];delete _0x1831f0['id'];delete _0x1831f0[_0x4614('0x2e')];delete _0x1831f0[_0x4614('0x2f')];var _0x441cc7=_0x1831f0['interval']!==_0x4614('0x30')?[_0x1831f0[_0x4614('0x31')]]:_0x1831f0[_0x4614('0x8')]?_[_0x4614('0xa')](_[_0x4614('0xd')](_0x432adc[_0x4614('0x6')],{'IntervalId':_0x1831f0[_0x4614('0x8')]}),_0x4614('0x31')):[];if(_0x1831f0[_0x4614('0x10')](_0x4614('0x32'))){if(_0x1831f0['tag']&&_0x1831f0[_0x4614('0x32')]!=='--'){_0x4f07d9[_0x4614('0x1d')]({'type':_0x1831f0['type'],'app':_0x4614('0x1a'),'appdata':'CDR(tag)='+_0x1831f0[_0x4614('0x32')],'context':_0x1831f0['context'],'exten':_0x1831f0['exten'],'priority':_0x441cc7['length']+_0x432adc[_0x4614('0x17')]+_0x4b25d2++,'VoiceExtensionId':_0x1831f0[_0x4614('0x18')]});}}if(_0x1831f0[_0x4614('0x13')]==='outbound'&&_0x1831f0['hasOwnProperty'](_0x4614('0x33'))){if(_0x1831f0[_0x4614('0x33')]){_0x4f07d9[_0x4614('0x1d')]({'type':_0x1831f0[_0x4614('0x13')],'app':_0x4614('0x21'),'appdata':_0x4614('0x34')+_0x1831f0[_0x4614('0x33')]+')','context':_0x1831f0['context'],'exten':_0x1831f0['exten'],'priority':_0x441cc7[_0x4614('0x2c')]+_0x432adc[_0x4614('0x17')]+_0x4b25d2++,'VoiceExtensionId':_0x1831f0['VoiceExtensionId']});}else{_0x4f07d9[_0x4614('0x1d')]({'type':_0x1831f0['type'],'app':_0x4614('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x1831f0['context'],'exten':_0x1831f0[_0x4614('0xb')],'priority':_0x441cc7[_0x4614('0x2c')]+_0x432adc[_0x4614('0x17')]+_0x4b25d2++,'VoiceExtensionId':_0x1831f0[_0x4614('0x18')]});}}if(_0x1831f0[_0x4614('0x10')]('answer')){if(_0x2b727d[_0x4614('0x35')](_0x1831f0[_0x4614('0x36')][_0x4614('0x2d')]())>=0x0&&_0x1831f0[_0x4614('0x37')]!==_0x4614('0x38')){if(_0x1831f0[_0x4614('0x39')]){_0x4f07d9['push']({'type':_0x1831f0[_0x4614('0x13')],'app':_0x4614('0x21'),'appdata':_0x4614('0x3a'),'context':_0x1831f0[_0x4614('0x16')],'exten':_0x1831f0[_0x4614('0xb')],'priority':_0x441cc7[_0x4614('0x2c')]+_0x432adc[_0x4614('0x17')]+_0x4b25d2++,'VoiceExtensionId':_0x1831f0[_0x4614('0x18')]});_0x4f07d9[_0x4614('0x1d')]({'type':_0x1831f0[_0x4614('0x13')],'app':_0x4614('0x1a'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1831f0[_0x4614('0x16')],'exten':_0x1831f0[_0x4614('0xb')],'priority':_0x441cc7[_0x4614('0x2c')]+_0x432adc['priority']+_0x4b25d2++,'VoiceExtensionId':_0x1831f0[_0x4614('0x18')]});}else{_0x4f07d9[_0x4614('0x1d')]({'type':_0x1831f0[_0x4614('0x13')],'app':_0x4614('0x21'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1831f0[_0x4614('0x16')],'exten':_0x1831f0[_0x4614('0xb')],'priority':_0x441cc7[_0x4614('0x2c')]+_0x432adc[_0x4614('0x17')]+_0x4b25d2++,'VoiceExtensionId':_0x1831f0['VoiceExtensionId']});_0x4f07d9[_0x4614('0x1d')]({'type':_0x1831f0[_0x4614('0x13')],'app':_0x4614('0x1a'),'appdata':_0x4614('0x3b'),'context':_0x1831f0[_0x4614('0x16')],'exten':_0x1831f0[_0x4614('0xb')],'priority':_0x441cc7[_0x4614('0x2c')]+_0x432adc['priority']+_0x4b25d2++,'VoiceExtensionId':_0x1831f0['VoiceExtensionId']});}}}for(var _0x149b38=0x0;_0x149b38<_0x441cc7[_0x4614('0x2c')];_0x149b38+=0x1){var _0x5e828d=_0x432adc['priority']+_0x441cc7[_0x4614('0x2c')];var _0x3bc121=_0x149b38===_0x441cc7[_0x4614('0x2c')]-0x1?_0x432adc['priority']+_0x4f07d9[_0x4614('0x2c')]+_0x60b4ef[_0x4614('0x2c')]+0x2:_0x432adc[_0x4614('0x17')]+_0x149b38+0x1;_0x4f07d9[_0x4614('0x3c')](_0x149b38,0x0,{'type':_0x1831f0[_0x4614('0x13')],'app':'GotoIfTime','appdata':_0x441cc7[_0x149b38]+'?'+_0x1831f0[_0x4614('0x16')]+',${EXTEN},'+_0x5e828d+':'+_0x1831f0[_0x4614('0x16')]+_0x4614('0x3d')+_0x3bc121,'exten':_0x1831f0[_0x4614('0xb')],'context':_0x1831f0[_0x4614('0x16')],'priority':_0x432adc[_0x4614('0x17')]+_0x149b38,'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0]['VoiceExtensionId']});}_0x1831f0[_0x4614('0x17')]=_0x4f07d9[_0x4614('0x2c')]?_[_0x4614('0x3e')](_0x4f07d9)['priority']+0x1:_0x432adc[_0x4614('0x17')];_0x432adc[_0x4614('0x17')]=(_0x60b4ef[_0x4614('0x2c')]?_[_0x4614('0x3e')](_0x60b4ef)[_0x4614('0x17')]:_0x1831f0['priority'])+0x1;_0x432adc[_0x4614('0x11')]=_[_0x4614('0x3f')](_0x432adc[_0x4614('0x11')],_0x4f07d9,[_0x1831f0],_0x60b4ef);}_0x432adc[_0x4614('0x11')]['push']({'type':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x13')],'app':_0x4614('0x40'),'exten':_0x9cf412[_0x5bd31c][0x0][_0x4614('0xb')],'context':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x16')],'priority':_0x432adc[_0x4614('0x17')],'VoiceExtensionId':_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')]});_0x532c4c[_0x4614('0x1d')](_0x9cf412[_0x5bd31c][0x0][_0x4614('0x18')]);_0x43e136=_[_0x4614('0x3f')](_0x43e136,_0x432adc[_0x4614('0x11')]);}}return _0x18453e['transaction'](function(_0x2f2a03){return _0x18453e[_0x4614('0x2')][_0x4614('0x7')][_0x4614('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x532c4c}},'transaction':_0x2f2a03})['then'](function(_0x386165){return _0x18453e[_0x4614('0x2')][_0x4614('0x7')]['bulkCreate'](_[_0x4614('0x42')](_0x43e136,'priority'),{'transaction':_0x2f2a03});});});})['catch'](function(_0x2b87ea){console[_0x4614('0x43')](_0x2b87ea);});}exports[_0x4614('0x44')]=rewrite; \ No newline at end of file +var _0x705e=['format','CDR(type)=%s','context','VoiceExtensionId','inbound','outbound','CDR(destination)=','extension','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','tag','CDR(tag)=','length','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice',',${EXTEN},','last','Hangup','concat','destroy','bulkCreate','error','util','Interval','findAll','intervals','models','IntervalId','then','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','push','type','Set'];(function(_0x52a6e3,_0x4a73b4){var _0x8910d0=function(_0x57e5ef){while(--_0x57e5ef){_0x52a6e3['push'](_0x52a6e3['shift']());}};_0x8910d0(++_0x4a73b4);}(_0x705e,0x13d));var _0xe705=function(_0x195662,_0x30db00){_0x195662=_0x195662-0x0;var _0x3ef225=_0x705e[_0x195662];return _0x3ef225;};'use strict';var _=require('lodash');var util=require(_0xe705('0x0'));function rewrite(_0x2e8ba6,_0x97f30c){var _0x7bf904=this;return _0x2e8ba6['models'][_0xe705('0x1')][_0xe705('0x2')]({'raw':!![]})['then'](function(_0x30640e){_0x7bf904[_0xe705('0x3')]=_0x30640e;return _0x2e8ba6[_0xe705('0x4')]['VoiceExtension'][_0xe705('0x2')]({'where':{'IntervalId':_0x97f30c[_0xe705('0x5')]},'raw':!![]});})[_0xe705('0x6')](function(_0x3502a9){return _0x2e8ba6[_0xe705('0x4')][_0xe705('0x7')][_0xe705('0x2')]({'where':{'exten':{'$in':_[_0xe705('0x8')](_[_0xe705('0x9')](_0x3502a9,_0xe705('0xa')))}},'order':[{'raw':_0xe705('0xb')}],'raw':!![]});})[_0xe705('0x6')](function(_0x484031){var _0x1f9196=_['filter'](_0x484031,{'priority':'1'});var _0x1fe358=_[_0xe705('0xc')](_0x484031,{'isApp':0x1});var _0x4bd1f2=_[_0xe705('0xd')](_0x1fe358,_0xe705('0xa'));var _0x256816=[_0xe705('0xe'),_0xe705('0xf')];var _0x4f8b3a=[];var _0x25db5a=[];for(var _0x4c28d5 in _0x4bd1f2){if(_0x4bd1f2[_0xe705('0x10')](_0x4c28d5)){_0x7bf904[_0xe705('0x11')]=0x2;_0x7bf904[_0xe705('0x12')]=[];_0x7bf904['extension']=_[_0xe705('0x13')](_0x1f9196,{'exten':_0x4bd1f2[_0x4c28d5][0x0]['exten']});_0x7bf904[_0xe705('0x12')][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':_0xe705('0x16'),'appdata':util[_0xe705('0x17')](_0xe705('0x18'),_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')]),'context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0xa')],'priority':_0x7bf904[_0xe705('0x11')]++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});if(_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')]===_0xe705('0x1b')){_0x7bf904[_0xe705('0x12')][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':_0xe705('0x16'),'appdata':'CDR(routeid)='+_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')],'context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0xa')],'priority':_0x7bf904[_0xe705('0x11')]++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});}else if(_0x4bd1f2[_0x4c28d5][0x0]['type']===_0xe705('0x1c')){if(_0x7bf904['extension']){_0x7bf904[_0xe705('0x12')][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0]['type'],'app':_0xe705('0x16'),'appdata':_0xe705('0x1d')+(_0x7bf904[_0xe705('0x1e')][_0xe705('0x1f')]?_0xe705('0x20')+_0x7bf904[_0xe705('0x1e')][_0xe705('0x1f')]+'}':_0xe705('0x21')),'context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0xa')],'priority':_0x7bf904[_0xe705('0x11')]++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});}_0x7bf904[_0xe705('0x12')]['push']({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':'Set','appdata':_0xe705('0x22')+_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')],'context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0xa')],'priority':_0x7bf904['priority']++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});var _0x1a74c8=_0x7bf904[_0xe705('0x11')]++;_0x7bf904['extensions'][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':'ExecIf','appdata':_0xe705('0x23')+(_0x1a74c8+0x2)+'):Goto('+(_0x1a74c8+0x1)+')','context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0xa')],'priority':_0x1a74c8,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});if(_0x7bf904['extension']){_0x7bf904[_0xe705('0x12')][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0]['type'],'app':_0xe705('0x16'),'appdata':_0x7bf904[_0xe705('0x1e')][_0xe705('0x1f')]?'CDR(prefix)=${EXTEN:0:'+_0x7bf904[_0xe705('0x1e')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0xa')],'priority':_0x7bf904['priority']++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});}_0x7bf904[_0xe705('0x12')]['push']({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':'Set','appdata':_0xe705('0x24')+_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')],'context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0]['exten'],'priority':_0x7bf904[_0xe705('0x11')]++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0]['VoiceExtensionId']});if(_0x7bf904['extension']&&_0x7bf904['extension'][_0xe705('0x10')](_0xe705('0x25'))&&_0x7bf904[_0xe705('0x1e')][_0xe705('0x25')]!==_0xe705('0x26')){_0x7bf904['extensions'][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':_0xe705('0x16'),'appdata':_0xe705('0x27'),'context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0xa')],'priority':_0x7bf904['priority']++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});_0x7bf904[_0xe705('0x12')][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':_0xe705('0x16'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x7bf904['extension'][_0xe705('0x25')]||_0xe705('0x28'),'context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0xa')],'priority':_0x7bf904[_0xe705('0x11')]++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});}}_0x7bf904[_0xe705('0x12')][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':_0xe705('0x16'),'appdata':_0xe705('0x29'),'context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0]['exten'],'priority':_0x7bf904[_0xe705('0x11')]++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});_0x7bf904[_0xe705('0x12')][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':'Set','appdata':_0xe705('0x2a'),'context':_0x4bd1f2[_0x4c28d5][0x0]['context'],'exten':_0x4bd1f2[_0x4c28d5][0x0]['exten'],'priority':_0x7bf904[_0xe705('0x11')]++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});_0x7bf904[_0xe705('0x12')][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':_0xe705('0x16'),'appdata':_0xe705('0x2b'),'context':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x19')],'exten':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0xa')],'priority':_0x7bf904['priority']++,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]});for(var _0x5011d4=0x0,_0x108e5e=0x0;_0x5011d4<_0x4bd1f2[_0x4c28d5]['length'];_0x5011d4+=0x1,_0x108e5e=0x0){var _0x97cc4a=_0x4bd1f2[_0x4c28d5][_0x5011d4];if(_0x97cc4a[_0xe705('0x15')]){_0x97cc4a['type']=_0x97cc4a['type'][_0xe705('0x2c')]();}var _0x55bb02=[];var _0x2793f2=[];delete _0x97cc4a['id'];delete _0x97cc4a[_0xe705('0x2d')];delete _0x97cc4a[_0xe705('0x2e')];var _0x5e69fc=_0x97cc4a[_0xe705('0x2f')]!=='*,*,*,*'?[_0x97cc4a['interval']]:_0x97cc4a['IntervalId']?_[_0xe705('0x9')](_[_0xe705('0xc')](_0x7bf904[_0xe705('0x3')],{'IntervalId':_0x97cc4a[_0xe705('0x5')]}),_0xe705('0x2f')):[];if(_0x97cc4a[_0xe705('0x10')]('tag')){if(_0x97cc4a[_0xe705('0x30')]&&_0x97cc4a[_0xe705('0x30')]!=='--'){_0x55bb02[_0xe705('0x14')]({'type':_0x97cc4a['type'],'app':'Set','appdata':_0xe705('0x31')+_0x97cc4a[_0xe705('0x30')],'context':_0x97cc4a[_0xe705('0x19')],'exten':_0x97cc4a[_0xe705('0xa')],'priority':_0x5e69fc[_0xe705('0x32')]+_0x7bf904['priority']+_0x108e5e++,'VoiceExtensionId':_0x97cc4a[_0xe705('0x1a')]});}}if(_0x97cc4a[_0xe705('0x15')]===_0xe705('0x1c')&&_0x97cc4a[_0xe705('0x10')]('callerID')){if(_0x97cc4a[_0xe705('0x33')]){_0x55bb02[_0xe705('0x14')]({'type':_0x97cc4a[_0xe705('0x15')],'app':_0xe705('0x34'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x97cc4a[_0xe705('0x33')]+')','context':_0x97cc4a[_0xe705('0x19')],'exten':_0x97cc4a[_0xe705('0xa')],'priority':_0x5e69fc[_0xe705('0x32')]+_0x7bf904[_0xe705('0x11')]+_0x108e5e++,'VoiceExtensionId':_0x97cc4a[_0xe705('0x1a')]});}else{_0x55bb02[_0xe705('0x14')]({'type':_0x97cc4a[_0xe705('0x15')],'app':'ExecIf','appdata':_0xe705('0x35'),'context':_0x97cc4a[_0xe705('0x19')],'exten':_0x97cc4a['exten'],'priority':_0x5e69fc[_0xe705('0x32')]+_0x7bf904['priority']+_0x108e5e++,'VoiceExtensionId':_0x97cc4a[_0xe705('0x1a')]});}}if(_0x97cc4a[_0xe705('0x10')](_0xe705('0x36'))){if(_0x256816[_0xe705('0x37')](_0x97cc4a['app'][_0xe705('0x2c')]())>=0x0&&_0x97cc4a[_0xe705('0x38')]!==_0xe705('0x39')){if(_0x97cc4a['answer']){_0x55bb02[_0xe705('0x14')]({'type':_0x97cc4a[_0xe705('0x15')],'app':'ExecIf','appdata':_0xe705('0x3a'),'context':_0x97cc4a[_0xe705('0x19')],'exten':_0x97cc4a[_0xe705('0xa')],'priority':_0x5e69fc['length']+_0x7bf904[_0xe705('0x11')]+_0x108e5e++,'VoiceExtensionId':_0x97cc4a[_0xe705('0x1a')]});_0x55bb02[_0xe705('0x14')]({'type':_0x97cc4a[_0xe705('0x15')],'app':_0xe705('0x16'),'appdata':_0xe705('0x3b'),'context':_0x97cc4a['context'],'exten':_0x97cc4a[_0xe705('0xa')],'priority':_0x5e69fc['length']+_0x7bf904[_0xe705('0x11')]+_0x108e5e++,'VoiceExtensionId':_0x97cc4a['VoiceExtensionId']});}else{_0x55bb02['push']({'type':_0x97cc4a[_0xe705('0x15')],'app':_0xe705('0x34'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x97cc4a[_0xe705('0x19')],'exten':_0x97cc4a[_0xe705('0xa')],'priority':_0x5e69fc[_0xe705('0x32')]+_0x7bf904[_0xe705('0x11')]+_0x108e5e++,'VoiceExtensionId':_0x97cc4a[_0xe705('0x1a')]});_0x55bb02[_0xe705('0x14')]({'type':_0x97cc4a['type'],'app':_0xe705('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x97cc4a['context'],'exten':_0x97cc4a[_0xe705('0xa')],'priority':_0x5e69fc['length']+_0x7bf904[_0xe705('0x11')]+_0x108e5e++,'VoiceExtensionId':_0x97cc4a[_0xe705('0x1a')]});}}}for(var _0x353707=0x0;_0x353707<_0x5e69fc['length'];_0x353707+=0x1){var _0x4afb54=_0x7bf904['priority']+_0x5e69fc[_0xe705('0x32')];var _0x4f34c5=_0x353707===_0x5e69fc[_0xe705('0x32')]-0x1?_0x7bf904[_0xe705('0x11')]+_0x55bb02['length']+_0x2793f2['length']+0x2:_0x7bf904[_0xe705('0x11')]+_0x353707+0x1;_0x55bb02[_0xe705('0x3c')](_0x353707,0x0,{'type':_0x97cc4a[_0xe705('0x15')],'app':'GotoIfTime','appdata':_0x5e69fc[_0x353707]+'?'+_0x97cc4a['context']+_0xe705('0x3d')+_0x4afb54+':'+_0x97cc4a['context']+_0xe705('0x3d')+_0x4f34c5,'exten':_0x97cc4a[_0xe705('0xa')],'context':_0x97cc4a[_0xe705('0x19')],'priority':_0x7bf904[_0xe705('0x11')]+_0x353707,'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0]['VoiceExtensionId']});}_0x97cc4a['priority']=_0x55bb02[_0xe705('0x32')]?_[_0xe705('0x3e')](_0x55bb02)[_0xe705('0x11')]+0x1:_0x7bf904[_0xe705('0x11')];_0x7bf904[_0xe705('0x11')]=(_0x2793f2[_0xe705('0x32')]?_[_0xe705('0x3e')](_0x2793f2)['priority']:_0x97cc4a[_0xe705('0x11')])+0x1;_0x7bf904[_0xe705('0x12')]=_['concat'](_0x7bf904['extensions'],_0x55bb02,[_0x97cc4a],_0x2793f2);}_0x7bf904[_0xe705('0x12')][_0xe705('0x14')]({'type':_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x15')],'app':_0xe705('0x3f'),'exten':_0x4bd1f2[_0x4c28d5][0x0]['exten'],'context':_0x4bd1f2[_0x4c28d5][0x0]['context'],'priority':_0x7bf904[_0xe705('0x11')],'VoiceExtensionId':_0x4bd1f2[_0x4c28d5][0x0]['VoiceExtensionId']});_0x4f8b3a[_0xe705('0x14')](_0x4bd1f2[_0x4c28d5][0x0][_0xe705('0x1a')]);_0x25db5a=_[_0xe705('0x40')](_0x25db5a,_0x7bf904[_0xe705('0x12')]);}}return _0x2e8ba6['transaction'](function(_0x3697b8){return _0x2e8ba6[_0xe705('0x4')][_0xe705('0x7')][_0xe705('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x4f8b3a}},'transaction':_0x3697b8})['then'](function(_0x29b6e6){return _0x2e8ba6['models'][_0xe705('0x7')][_0xe705('0x42')](_['sortBy'](_0x25db5a,_0xe705('0x11')),{'transaction':_0x3697b8});});});})['catch'](function(_0x525ccd){console[_0xe705('0x43')](_0x525ccd);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 4089f63..757863a 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 _0x386b=['api','redis','defaults','socket.io-emitter','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','stringify','cmContact','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','resume','resolve','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel'];(function(_0x1278cc,_0x1f070d){var _0x484807=function(_0x2dd294){while(--_0x2dd294){_0x1278cc['push'](_0x1278cc['shift']());}};_0x484807(++_0x1f070d);}(_0x386b,0x67));var _0xb386=function(_0x240657,_0x5dd4f1){_0x240657=_0x240657-0x0;var _0x42c4ac=_0x386b[_0x240657];return _0x42c4ac;};'use strict';var BPromise=require(_0xb386('0x0'));var util=require('util');var _=require(_0xb386('0x1'));var fs=require('fs');var squel=require(_0xb386('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xb386('0x3'));config[_0xb386('0x4')]=_[_0xb386('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb386('0x6'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xb386('0x7')][0x2]||process[_0xb386('0x7')][0x2]===_0xb386('0x8')||process[_0xb386('0x7')][0x2]===_0xb386('0x9')){throw new Error(_0xb386('0xa'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0xb386('0x7')][0x3]===_0xb386('0x8')||process[_0xb386('0x7')][0x3]===_0xb386('0x9')||!process[_0xb386('0x7')][0x4]||process[_0xb386('0x7')][0x4]==='undefined'||process['argv'][0x4]==='null'){throw new Error(_0xb386('0xb'));}var FIELDS=_['zipObject'](process[_0xb386('0x7')][0x3][_0xb386('0xc')](','),process[_0xb386('0x7')][0x4][_0xb386('0xc')](','));if(!process['argv'][0x5]||process[_0xb386('0x7')][0x5]===_0xb386('0x8')||process['argv'][0x5]===_0xb386('0x9')){throw new Error(_0xb386('0xd'));}var LISTID=process[_0xb386('0x7')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xb386('0x7')][0x6]!==_0xb386('0x8')&&process[_0xb386('0x7')][0x6]!==_0xb386('0x9')?process[_0xb386('0x7')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xb386('0x7')][0x7]!=='undefined'&&process[_0xb386('0x7')][0x7]!==_0xb386('0x9')?process[_0xb386('0x7')][0x7]:null;if(!process[_0xb386('0x7')][0x8]||process[_0xb386('0x7')][0x8]===_0xb386('0x8')||process[_0xb386('0x7')][0x8]==='null'){throw new Error(_0xb386('0xe'));}var SOCKET_TIMESTAMP=process[_0xb386('0x7')][0x8];}catch(_0x101941){logger[_0xb386('0xf')](_0x101941);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(_0x22cc2d,_0xa36b75,_0x11a02f,_0x9fbaff){var _0x24b77e={'message':_0xa36b75};_0x24b77e[_0x22cc2d]=!![];if(_0x11a02f){_0x24b77e[_0xb386('0x10')]=_0x11a02f;}if(_0x9fbaff){_0x24b77e[_0xb386('0x11')]=_0x9fbaff;}return _0x24b77e;}function isEmail(_0x4d5c55){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))*$/[_0xb386('0x12')](_0x4d5c55);}function checkRow(_0x27b6da,_0xc454c2,_0x550a8a){return new BPromise(function(_0xb905ee,_0x2b8e00){if(_[_0xb386('0x13')](_0x27b6da)){return _0x2b8e00(handleCheckRowError(_0xb386('0xf'),_0xb386('0x14'),null,_0x550a8a));}if(_0x27b6da[_0xb386('0x15')]&&_0x27b6da[_0xb386('0x15')][_0xb386('0x16')]){var _0x308f5d=_['map'](_0x27b6da['errors'],_0xb386('0x17'))[_0xb386('0x18')](';');return _0x2b8e00(handleCheckRowError('error',_0x308f5d,null,_0x550a8a));}var _0x209ab0={};for(var _0x1d071c in FIELDS){if(FIELDS['hasOwnProperty'](_0x1d071c)&&FIELDS[_0x1d071c]){_0x209ab0[_0x1d071c]=_0x27b6da[_0xb386('0x19')][0x0][FIELDS[_0x1d071c]]||_0x27b6da[_0xb386('0x19')][0x0]['\ufeff'+FIELDS[_0x1d071c]];}}if(!_0x209ab0[_0xb386('0x1a')]){return _0x2b8e00(handleCheckRowError(_0xb386('0xf'),_0xb386('0x1b'),null,_0x550a8a));}if(!_0x209ab0[_0xb386('0x1c')]){return _0x2b8e00(handleCheckRowError(_0xb386('0xf'),_0xb386('0x1d'),null,_0x550a8a));}if(_0x209ab0[_0xb386('0x1e')]){var _0x37cb30=moment(_0x209ab0['birthDate'],_0xb386('0x1f'));if(!_0x37cb30[_0xb386('0x20')]()){return _0x2b8e00(handleCheckRowError(_0xb386('0xf'),_0xb386('0x21'),null,_0x550a8a));}}if(_0x209ab0[_0xb386('0x22')]){if(!isEmail(_0x209ab0['email'])){return _0x2b8e00(handleCheckRowError(_0xb386('0xf'),_0xb386('0x23'),null,_0x550a8a));}}_0x209ab0[_0xb386('0x24')]=LISTID;_0x209ab0['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb386('0x16')]&&_0xc454c2){var _0xc0826e={};for(var _0x15c3b7=0x0,_0x2342d1=DUPLICATES[_0xb386('0x16')];_0x15c3b7<_0x2342d1;_0x15c3b7+=0x1){_0xc0826e[DUPLICATES[_0x15c3b7]]=_0x209ab0[DUPLICATES[_0x15c3b7]];}var _0x24d225=_[_0xb386('0x25')](_0xc454c2,_0xc0826e);if(_0x24d225){return _0x2b8e00(handleCheckRowError(_0xb386('0x26'),_0xb386('0x27'),_0x24d225,_0x550a8a));}}return db[_0xb386('0x28')][_0xb386('0x29')](_0x209ab0,{'raw':!![],'hooks':![],'fields':_[_0xb386('0x2a')](_0x209ab0)})[_0xb386('0x2b')](function(_0x489132){if(DUPLICATES&&DUPLICATES[_0xb386('0x16')]&&_0xc454c2){_0xc454c2['push'](_[_0xb386('0x2c')](_0x209ab0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x489132['id'];return _0xb905ee();})[_0xb386('0x2d')](function(_0x492078){return _0x2b8e00(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x492078[_0xb386('0x17')]||JSON[_0xb386('0x2e')](_0x492078)),null,_0x550a8a));});});}function checkHopper(){function _0x23caf4(){return function(_0x293f80){logger[_0xb386('0xf')](_0xb386('0x2f'),'checkHopper',util[_0xb386('0x30')](_0x293f80,{'showHidden':![],'depth':null}));};}var _0x5280ff=function(_0x326e60,_0x419e9c){var _0x23be74=squel[_0xb386('0x31')]()[_0xb386('0x32')]('cm_hopper')[_0xb386('0x33')]([_0xb386('0x1c'),_0xb386('0x34'),_0xb386('0x35'),_0xb386('0x24'),_0x419e9c,_0xb386('0x36'),_0xb386('0x37')],squel[_0xb386('0x38')]()[_0xb386('0x39')](_0xb386('0x1c'),'phone')['field'](_0xb386('0x3a'),_0xb386('0x34'))[_0xb386('0x39')]('id',_0xb386('0x35'))[_0xb386('0x39')](LISTID[_0xb386('0x3b')](),_0xb386('0x24'))[_0xb386('0x39')](_0x326e60['id'][_0xb386('0x3b')](),_0x419e9c)[_0xb386('0x39')](_0xb386('0x3a'),_0xb386('0x36'))[_0xb386('0x39')](_0xb386('0x3a'),_0xb386('0x37'))[_0xb386('0x3c')](_0xb386('0x3d'))[_0xb386('0x3e')]('deletedAt\x20IS\x20NULL')[_0xb386('0x3e')](_0xb386('0x3f'),LISTID[_0xb386('0x3b')]())[_0xb386('0x3e')](_0xb386('0x40'))[_0xb386('0x3e')](_0xb386('0x41'),squel[_0xb386('0x38')]()[_0xb386('0x39')](_0xb386('0x1c'))[_0xb386('0x3c')](_0xb386('0x42'))['where'](_0x419e9c+_0xb386('0x43'),_0x326e60['id']['toString']())))[_0xb386('0x3b')]();return _0x23be74;};var _0x4189b7=function(_0x260350,_0x7b37bc){var _0x351324=squel[_0xb386('0x31')]()[_0xb386('0x32')]('cm_hopper')['fromQuery']([_0xb386('0x1c'),_0xb386('0x34'),_0xb386('0x35'),_0xb386('0x24'),_0x7b37bc,_0xb386('0x36'),_0xb386('0x37')],squel[_0xb386('0x38')]()[_0xb386('0x39')](_0xb386('0x1c'),_0xb386('0x1c'))[_0xb386('0x39')](_0xb386('0x3a'),_0xb386('0x34'))[_0xb386('0x39')]('id','ContactId')[_0xb386('0x39')](LISTID[_0xb386('0x3b')](),_0xb386('0x24'))[_0xb386('0x39')](_0x260350['id']['toString'](),_0x7b37bc)[_0xb386('0x39')](_0xb386('0x3a'),_0xb386('0x36'))[_0xb386('0x39')](_0xb386('0x3a'),'updatedAt')[_0xb386('0x3c')](_0xb386('0x3d'))['where'](_0xb386('0x44'))[_0xb386('0x3e')]('ListId\x20=\x20?',LISTID[_0xb386('0x3b')]())[_0xb386('0x3e')](_0xb386('0x45'),squel[_0xb386('0x46')](hopperContacts))[_0xb386('0x3e')](_0xb386('0x40'))[_0xb386('0x3e')](_0xb386('0x41'),squel[_0xb386('0x38')]()[_0xb386('0x39')]('calleridnum')[_0xb386('0x3c')]('cm_hopper_final')[_0xb386('0x3e')](_0x7b37bc+_0xb386('0x43'),_0x260350['id']['toString']()))[_0xb386('0x3e')](_0xb386('0x41'),squel[_0xb386('0x38')]()[_0xb386('0x39')](_0xb386('0x1c'))[_0xb386('0x3c')](_0xb386('0x42'))['where'](_0x7b37bc+_0xb386('0x43'),_0x260350['id'][_0xb386('0x3b')]())))[_0xb386('0x3b')]();return _0x351324;};function _0x2a9c8a(_0x256ecb,_0xa3c3ac){var _0x333312=squel['insert']()[_0xb386('0x32')](_0xb386('0x42'))[_0xb386('0x33')]([_0xb386('0x1c'),'scheduledAt',_0xb386('0x35'),'ListId',_0xa3c3ac,_0xb386('0x36'),_0xb386('0x37')],squel[_0xb386('0x38')]()[_0xb386('0x39')]('phone',_0xb386('0x1c'))['field'](_0xb386('0x3a'),'scheduledAt')['field']('id',_0xb386('0x35'))[_0xb386('0x39')](LISTID['toString'](),_0xb386('0x24'))[_0xb386('0x39')](_0x256ecb['id'][_0xb386('0x3b')](),_0xa3c3ac)[_0xb386('0x39')](_0xb386('0x3a'),_0xb386('0x36'))[_0xb386('0x39')](_0xb386('0x3a'),_0xb386('0x37'))[_0xb386('0x3c')](_0xb386('0x3d'))[_0xb386('0x3e')](_0xb386('0x44'))[_0xb386('0x3e')]('ListId\x20=\x20?',LISTID[_0xb386('0x3b')]())[_0xb386('0x3e')](_0xb386('0x45'),squel[_0xb386('0x46')](hopperContacts))[_0xb386('0x3e')](_0xb386('0x40')))['toString']();return _0x333312;}function _0x24b043(_0x45337d,_0x3ac374){var _0x356f42=squel[_0xb386('0x31')]()['into'](_0xb386('0x47'))['fromQuery'](['phone','ContactId',_0xb386('0x24'),_0x3ac374,_0xb386('0x36'),'updatedAt'],squel[_0xb386('0x38')]()[_0xb386('0x39')](_0xb386('0x1c'),_0xb386('0x1c'))['field']('id',_0xb386('0x35'))[_0xb386('0x39')](LISTID[_0xb386('0x3b')](),'ListId')[_0xb386('0x39')](_0x45337d['id'][_0xb386('0x3b')](),_0x3ac374)['field'](_0xb386('0x3a'),_0xb386('0x36'))[_0xb386('0x39')]('NOW()','updatedAt')[_0xb386('0x3c')]('cm_contacts')['where'](_0xb386('0x44'))[_0xb386('0x3e')](_0xb386('0x3f'),LISTID[_0xb386('0x3b')]())['where'](_0xb386('0x45'),squel[_0xb386('0x46')](hopperContacts))[_0xb386('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0xb386('0x3b')]();return _0x356f42;}return db[_0xb386('0x48')][_0xb386('0x49')]({'where':{'type':_0xb386('0x4a')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb386('0x4b')],'as':_0xb386('0x4c'),'where':{'id':LISTID}}]})[_0xb386('0x2b')](function(_0x59937b){var _0x3ced30=[];if(_0x59937b){var _0x58f372;for(var _0x2da7b9=0x0,_0x1233fa;_0x2da7b9<_0x59937b[_0xb386('0x16')];_0x2da7b9+=0x1){_0x1233fa=_0x59937b[_0x2da7b9][_0xb386('0x4d')]({'plain':!![]});switch(_0x1233fa[_0xb386('0x4e')]){case _0xb386('0x4f'):_0x3ced30[_0xb386('0x50')](db[_0xb386('0x51')][_0xb386('0x52')](_0x4189b7(_0x1233fa,_0xb386('0x53')))[_0xb386('0x2b')](function(){})[_0xb386('0x2d')](_0x23caf4()));break;case _0xb386('0x54'):_0x3ced30[_0xb386('0x50')](db[_0xb386('0x51')][_0xb386('0x52')](_0x5280ff(_0x1233fa,_0xb386('0x53')))[_0xb386('0x2b')](function(){})[_0xb386('0x2d')](_0x23caf4()));break;default:_0x3ced30[_0xb386('0x50')](db[_0xb386('0x51')][_0xb386('0x52')](_0x2a9c8a(_0x1233fa,'VoiceQueueId'))[_0xb386('0x2b')](function(){})[_0xb386('0x2d')](_0x23caf4()));}}}return _0x3ced30;})[_0xb386('0x55')]()[_0xb386('0x2b')](function(){return db[_0xb386('0x48')][_0xb386('0x49')]({'where':{'type':_0xb386('0x4a')},'attributes':['id'],'include':[{'model':db[_0xb386('0x4b')],'as':_0xb386('0x56'),'where':{'id':LISTID}}]})[_0xb386('0x2b')](function(_0x3fc22b){var _0x55f625=[];if(_0x3fc22b){var _0x37dacf;for(var _0x58185e=0x0,_0x4a9152;_0x58185e<_0x3fc22b['length'];_0x58185e+=0x1){_0x4a9152=_0x3fc22b[_0x58185e][_0xb386('0x4d')]({'plain':!![]});_0x55f625[_0xb386('0x50')](db[_0xb386('0x51')][_0xb386('0x52')](_0x24b043(_0x4a9152,_0xb386('0x53')))[_0xb386('0x2b')](function(){})[_0xb386('0x2d')](_0x23caf4()));}}return _0x55f625;})[_0xb386('0x55')]();})[_0xb386('0x2b')](function(){return db[_0xb386('0x57')][_0xb386('0x49')]({'attributes':['id',_0xb386('0x4e')],'include':[{'model':db[_0xb386('0x4b')],'as':_0xb386('0x4c'),'where':{'id':LISTID}}]})[_0xb386('0x2b')](function(_0x3bfa5f){var _0x2386a6=[];if(_0x3bfa5f){for(var _0x3adf77=0x0,_0xe2ef4c;_0x3adf77<_0x3bfa5f[_0xb386('0x16')];_0x3adf77+=0x1){_0xe2ef4c=_0x3bfa5f[_0x3adf77]['get']({'plain':!![]});switch(_0xe2ef4c['dialCheckDuplicateType']){case _0xb386('0x4f'):_0x2386a6[_0xb386('0x50')](db['sequelize'][_0xb386('0x52')](_0x4189b7(_0xe2ef4c,'CampaignId'))[_0xb386('0x2b')](function(){})['catch'](_0x23caf4()));break;case _0xb386('0x54'):_0x2386a6['push'](db[_0xb386('0x51')][_0xb386('0x52')](_0x5280ff(_0xe2ef4c,_0xb386('0x58')))[_0xb386('0x2b')](function(){})[_0xb386('0x2d')](_0x23caf4()));break;default:_0x2386a6[_0xb386('0x50')](db[_0xb386('0x51')][_0xb386('0x52')](_0x2a9c8a(_0xe2ef4c,_0xb386('0x58')))[_0xb386('0x2b')](function(){})[_0xb386('0x2d')](_0x23caf4()));}}}return _0x2386a6;})[_0xb386('0x55')]();})[_0xb386('0x2b')](function(){return db[_0xb386('0x57')][_0xb386('0x49')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xb386('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x13df8a){var _0x16eb78=[];if(_0x13df8a){for(var _0x2214e6=0x0,_0x8b5715;_0x2214e6<_0x13df8a[_0xb386('0x16')];_0x2214e6+=0x1){_0x8b5715=_0x13df8a[_0x2214e6]['get']({'plain':!![]});_0x16eb78[_0xb386('0x50')](db[_0xb386('0x51')]['query'](_0x24b043(_0x8b5715,_0xb386('0x58')))['then'](function(){})[_0xb386('0x2d')](_0x23caf4()));}}return _0x16eb78;})[_0xb386('0x55')]();})[_0xb386('0x2d')](function(_0x37dde4){logger[_0xb386('0xf')](_0xb386('0x59'),_0xb386('0x5a'),_0x37dde4[_0xb386('0x17')]);});}var processPromises=function(_0x7dfe6c){return BPromise[_0xb386('0x55')](promises)['then'](function(_0x4909d5){})['catch'](function(_0x1b60d0){logger[_0xb386('0xf')](_0xb386('0x5b'),JSON[_0xb386('0x2e')](_0x1b60d0));})['finally'](function(){socket[_0xb386('0x5c')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x7dfe6c){return _0x7dfe6c[_0xb386('0x5d')]();}});};var endCsv=function(){return BPromise[_0xb386('0x5e')]()[_0xb386('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0xb386('0x2b')](function(){socket['emit'](_0xb386('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb386('0x60')](FILEPATH);}catch(_0x5f5cdd){logger[_0xb386('0xf')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xb386('0x2e')](_0x5f5cdd));}finally{process[_0xb386('0x61')](0x0);}});};process['on'](_0xb386('0x62'),function(){logger['info'](_0xb386('0x63'));endCsv();});function main(){return BPromise[_0xb386('0x5e')]()[_0xb386('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb386('0xc')](',');return db[_0xb386('0x28')][_0xb386('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb386('0x2b')](function(_0xe0ecdb){var _0x3bfcbf=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb386('0x64')](_0x3bfcbf,{'header':!![],'skipEmptyLines':!![],'step':function(_0x333a96,_0x401620){total+=0x1;var _0x1bcb29=total;promises['push'](checkRow(_0x333a96,_0xe0ecdb,_0x1bcb29)[_0xb386('0x2b')](function(){success+=0x1;})[_0xb386('0x2d')](function(_0x16b3eb){if(_0x16b3eb['error']){errors+=0x1;delete _0x16b3eb[_0xb386('0xf')];}else if(_0x16b3eb['duplicate']){duplicates+=0x1;delete _0x16b3eb[_0xb386('0x26')];}rows[_0xb386('0x50')](_0x16b3eb);}));if(total%0xc8===0x0){_0x401620[_0xb386('0x65')]();return processPromises(_0x401620);}},'complete':function(){return processPromises()[_0xb386('0x2b')](function(){logger[_0xb386('0x66')](_0xb386('0x67'));endCsv();});},'error':function(_0x42ea44,_0x3bd34e){logger[_0xb386('0x66')](_0xb386('0x68'),JSON[_0xb386('0x2e')](_0x42ea44));endCsv();}});})[_0xb386('0x2d')](function(_0x2a0ad3){logger['error'](_0xb386('0x69'),JSON[_0xb386('0x2e')](_0x2a0ad3));});}main(); \ No newline at end of file +var _0x4965=['map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','duplicate','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','insert','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','get','always','sequelize','query','VoiceQueueId','all','BlackLists','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../config/environment','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','contact','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length'];(function(_0x562a5e,_0x5d0e43){var _0x18fa46=function(_0x27a1fa){while(--_0x27a1fa){_0x562a5e['push'](_0x562a5e['shift']());}};_0x18fa46(++_0x5d0e43);}(_0x4965,0x122));var _0x5496=function(_0x29d932,_0x97f2a7){_0x29d932=_0x29d932-0x0;var _0x5cd611=_0x4965[_0x29d932];return _0x5cd611;};'use strict';var BPromise=require(_0x5496('0x0'));var util=require(_0x5496('0x1'));var _=require(_0x5496('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x5496('0x3'));var Redis=require(_0x5496('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x5496('0x5'));var logger=require('../../../config/logger')(_0x5496('0x6'));config['redis']=_['defaults'](config[_0x5496('0x7')],{'host':_0x5496('0x8'),'port':0x18eb});var socket=require(_0x5496('0x9'))(new Redis(config['redis']));require(_0x5496('0xa'))['register'](socket);try{if(!process['argv'][0x2]||process[_0x5496('0xb')][0x2]==='undefined'||process[_0x5496('0xb')][0x2]===_0x5496('0xc')){throw new Error(_0x5496('0xd'));}var FILEPATH=process[_0x5496('0xb')][0x2];if(!process[_0x5496('0xb')][0x3]||process[_0x5496('0xb')][0x3]===_0x5496('0xe')||process[_0x5496('0xb')][0x3]==='null'||!process['argv'][0x4]||process[_0x5496('0xb')][0x4]===_0x5496('0xe')||process[_0x5496('0xb')][0x4]===_0x5496('0xc')){throw new Error(_0x5496('0xf'));}var FIELDS=_[_0x5496('0x10')](process[_0x5496('0xb')][0x3][_0x5496('0x11')](','),process['argv'][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]==='undefined'||process['argv'][0x5]===_0x5496('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x5496('0xb')][0x5];var COMPANYID=process[_0x5496('0xb')][0x6]&&process[_0x5496('0xb')][0x6]!==_0x5496('0xe')&&process[_0x5496('0xb')][0x6]!==_0x5496('0xc')?process[_0x5496('0xb')][0x6]:null;var DUPLICATES=process[_0x5496('0xb')][0x7]&&process[_0x5496('0xb')][0x7]!==_0x5496('0xe')&&process[_0x5496('0xb')][0x7]!==_0x5496('0xc')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x5496('0xb')][0x8]===_0x5496('0xe')||process[_0x5496('0xb')][0x8]===_0x5496('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x5496('0xb')][0x8];}catch(_0x465d82){logger['error'](_0x465d82);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(_0x13114e,_0xcaac36,_0x309c1d,_0x56ab4e){var _0x256825={'message':_0xcaac36};_0x256825[_0x13114e]=!![];if(_0x309c1d){_0x256825[_0x5496('0x12')]=_0x309c1d;}if(_0x56ab4e){_0x256825['index']=_0x56ab4e;}return _0x256825;}function isEmail(_0x307d6b){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))*$/[_0x5496('0x13')](_0x307d6b);}function checkRow(_0x589ff8,_0x309438,_0x3b4193){return new BPromise(function(_0x3489a0,_0x58c3f7){if(_[_0x5496('0x14')](_0x589ff8)){return _0x58c3f7(handleCheckRowError(_0x5496('0x15'),_0x5496('0x16'),null,_0x3b4193));}if(_0x589ff8[_0x5496('0x17')]&&_0x589ff8[_0x5496('0x17')][_0x5496('0x18')]){var _0x248ce7=_[_0x5496('0x19')](_0x589ff8[_0x5496('0x17')],_0x5496('0x1a'))['join'](';');return _0x58c3f7(handleCheckRowError(_0x5496('0x15'),_0x248ce7,null,_0x3b4193));}var _0x238f61={};for(var _0x457384 in FIELDS){if(FIELDS[_0x5496('0x1b')](_0x457384)&&FIELDS[_0x457384]){_0x238f61[_0x457384]=_0x589ff8[_0x5496('0x1c')][0x0][FIELDS[_0x457384]]||_0x589ff8[_0x5496('0x1c')][0x0]['\ufeff'+FIELDS[_0x457384]];}}if(!_0x238f61[_0x5496('0x1d')]){return _0x58c3f7(handleCheckRowError(_0x5496('0x15'),_0x5496('0x1e'),null,_0x3b4193));}if(!_0x238f61[_0x5496('0x1f')]){return _0x58c3f7(handleCheckRowError('error',_0x5496('0x20'),null,_0x3b4193));}if(_0x238f61[_0x5496('0x21')]){var _0x565908=moment(_0x238f61['birthDate'],_0x5496('0x22'));if(!_0x565908['isValid']()){return _0x58c3f7(handleCheckRowError('error',_0x5496('0x23'),null,_0x3b4193));}}if(_0x238f61[_0x5496('0x24')]){if(!isEmail(_0x238f61[_0x5496('0x24')])){return _0x58c3f7(handleCheckRowError(_0x5496('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x3b4193));}}_0x238f61[_0x5496('0x25')]=LISTID;_0x238f61[_0x5496('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5496('0x18')]&&_0x309438){var _0x39aa00={};for(var _0x393937=0x0,_0x16b742=DUPLICATES['length'];_0x393937<_0x16b742;_0x393937+=0x1){_0x39aa00[DUPLICATES[_0x393937]]=_0x238f61[DUPLICATES[_0x393937]];}var _0x1fc7fe=_['find'](_0x309438,_0x39aa00);if(_0x1fc7fe){return _0x58c3f7(handleCheckRowError(_0x5496('0x27'),'Duplicate\x20Contact',_0x1fc7fe,_0x3b4193));}}return db[_0x5496('0x28')][_0x5496('0x29')](_0x238f61,{'raw':!![],'hooks':![],'fields':_[_0x5496('0x2a')](_0x238f61)})[_0x5496('0x2b')](function(_0x4bd53d){if(DUPLICATES&&DUPLICATES['length']&&_0x309438){_0x309438[_0x5496('0x2c')](_[_0x5496('0x2d')](_0x238f61,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4bd53d['id'];return _0x3489a0();})[_0x5496('0x2e')](function(_0x26c241){return _0x58c3f7(handleCheckRowError(_0x5496('0x15'),_0x5496('0x2f')+(_0x26c241[_0x5496('0x1a')]||JSON[_0x5496('0x30')](_0x26c241)),null,_0x3b4193));});});}function checkHopper(){function _0x25bd0f(){return function(_0x1845de){logger['error']('cmContact','checkHopper',util[_0x5496('0x31')](_0x1845de,{'showHidden':![],'depth':null}));};}var _0x7e3ae3=function(_0x2a3940,_0x11d33b){var _0x2c550b=squel['insert']()[_0x5496('0x32')](_0x5496('0x33'))[_0x5496('0x34')]([_0x5496('0x1f'),_0x5496('0x35'),_0x5496('0x36'),_0x5496('0x25'),_0x11d33b,_0x5496('0x37'),_0x5496('0x38')],squel[_0x5496('0x39')]()[_0x5496('0x3a')](_0x5496('0x1f'),'phone')[_0x5496('0x3a')](_0x5496('0x3b'),_0x5496('0x35'))[_0x5496('0x3a')]('id','ContactId')[_0x5496('0x3a')](LISTID['toString'](),_0x5496('0x25'))[_0x5496('0x3a')](_0x2a3940['id'][_0x5496('0x3c')](),_0x11d33b)[_0x5496('0x3a')](_0x5496('0x3b'),_0x5496('0x37'))[_0x5496('0x3a')]('NOW()',_0x5496('0x38'))[_0x5496('0x3d')](_0x5496('0x3e'))['where'](_0x5496('0x3f'))[_0x5496('0x40')](_0x5496('0x41'),LISTID['toString']())[_0x5496('0x40')](_0x5496('0x42'))[_0x5496('0x40')](_0x5496('0x43'),squel[_0x5496('0x39')]()[_0x5496('0x3a')](_0x5496('0x1f'))[_0x5496('0x3d')]('cm_hopper')['where'](_0x11d33b+'\x20=\x20?',_0x2a3940['id']['toString']())))[_0x5496('0x3c')]();return _0x2c550b;};var _0xac46d3=function(_0x52c517,_0x3c6d21){var _0x5c8e3b=squel[_0x5496('0x44')]()[_0x5496('0x32')](_0x5496('0x33'))['fromQuery'](['phone',_0x5496('0x35'),'ContactId',_0x5496('0x25'),_0x3c6d21,_0x5496('0x37'),_0x5496('0x38')],squel[_0x5496('0x39')]()[_0x5496('0x3a')]('phone',_0x5496('0x1f'))[_0x5496('0x3a')](_0x5496('0x3b'),_0x5496('0x35'))[_0x5496('0x3a')]('id',_0x5496('0x36'))[_0x5496('0x3a')](LISTID[_0x5496('0x3c')](),'ListId')['field'](_0x52c517['id'][_0x5496('0x3c')](),_0x3c6d21)[_0x5496('0x3a')](_0x5496('0x3b'),_0x5496('0x37'))[_0x5496('0x3a')](_0x5496('0x3b'),_0x5496('0x38'))['from'](_0x5496('0x3e'))[_0x5496('0x40')](_0x5496('0x3f'))['where'](_0x5496('0x41'),LISTID[_0x5496('0x3c')]())[_0x5496('0x40')](_0x5496('0x45'),squel[_0x5496('0x46')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0x5496('0x40')](_0x5496('0x43'),squel[_0x5496('0x39')]()[_0x5496('0x3a')](_0x5496('0x47'))[_0x5496('0x3d')](_0x5496('0x48'))[_0x5496('0x40')](_0x3c6d21+_0x5496('0x49'),_0x52c517['id']['toString']()))[_0x5496('0x40')](_0x5496('0x43'),squel[_0x5496('0x39')]()[_0x5496('0x3a')](_0x5496('0x1f'))[_0x5496('0x3d')](_0x5496('0x33'))[_0x5496('0x40')](_0x3c6d21+_0x5496('0x49'),_0x52c517['id'][_0x5496('0x3c')]())))[_0x5496('0x3c')]();return _0x5c8e3b;};function _0x4a4996(_0x5a508d,_0x78f658){var _0xea6bfd=squel[_0x5496('0x44')]()[_0x5496('0x32')](_0x5496('0x33'))['fromQuery']([_0x5496('0x1f'),_0x5496('0x35'),_0x5496('0x36'),_0x5496('0x25'),_0x78f658,_0x5496('0x37'),_0x5496('0x38')],squel[_0x5496('0x39')]()[_0x5496('0x3a')](_0x5496('0x1f'),'phone')['field'](_0x5496('0x3b'),'scheduledAt')['field']('id','ContactId')['field'](LISTID[_0x5496('0x3c')](),_0x5496('0x25'))[_0x5496('0x3a')](_0x5a508d['id'][_0x5496('0x3c')](),_0x78f658)['field'](_0x5496('0x3b'),_0x5496('0x37'))[_0x5496('0x3a')](_0x5496('0x3b'),_0x5496('0x38'))['from'](_0x5496('0x3e'))[_0x5496('0x40')](_0x5496('0x3f'))[_0x5496('0x40')](_0x5496('0x41'),LISTID[_0x5496('0x3c')]())[_0x5496('0x40')](_0x5496('0x45'),squel[_0x5496('0x46')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5496('0x3c')]();return _0xea6bfd;}function _0x37991b(_0x1af0ef,_0x445b23){var _0x7df949=squel[_0x5496('0x44')]()[_0x5496('0x32')](_0x5496('0x4a'))['fromQuery']([_0x5496('0x1f'),_0x5496('0x36'),_0x5496('0x25'),_0x445b23,_0x5496('0x37'),_0x5496('0x38')],squel[_0x5496('0x39')]()[_0x5496('0x3a')](_0x5496('0x1f'),_0x5496('0x1f'))[_0x5496('0x3a')]('id','ContactId')[_0x5496('0x3a')](LISTID[_0x5496('0x3c')](),_0x5496('0x25'))[_0x5496('0x3a')](_0x1af0ef['id'][_0x5496('0x3c')](),_0x445b23)[_0x5496('0x3a')](_0x5496('0x3b'),'createdAt')[_0x5496('0x3a')](_0x5496('0x3b'),_0x5496('0x38'))[_0x5496('0x3d')](_0x5496('0x3e'))[_0x5496('0x40')](_0x5496('0x3f'))[_0x5496('0x40')](_0x5496('0x41'),LISTID[_0x5496('0x3c')]())[_0x5496('0x40')]('id\x20IN\x20?',squel[_0x5496('0x46')](hopperContacts))['where'](_0x5496('0x42')))[_0x5496('0x3c')]();return _0x7df949;}return db[_0x5496('0x4b')][_0x5496('0x4c')]({'where':{'type':_0x5496('0x4d')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x5496('0x4e')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x456cd0){var _0x38cbde=[];if(_0x456cd0){var _0xc2f665;for(var _0x391434=0x0,_0x508ae1;_0x391434<_0x456cd0['length'];_0x391434+=0x1){_0x508ae1=_0x456cd0[_0x391434][_0x5496('0x4f')]({'plain':!![]});switch(_0x508ae1['dialCheckDuplicateType']){case _0x5496('0x50'):_0x38cbde[_0x5496('0x2c')](db[_0x5496('0x51')]['query'](_0xac46d3(_0x508ae1,'VoiceQueueId'))[_0x5496('0x2b')](function(){})[_0x5496('0x2e')](_0x25bd0f()));break;case'onlyIfOpen':_0x38cbde['push'](db[_0x5496('0x51')][_0x5496('0x52')](_0x7e3ae3(_0x508ae1,_0x5496('0x53')))['then'](function(){})['catch'](_0x25bd0f()));break;default:_0x38cbde[_0x5496('0x2c')](db[_0x5496('0x51')][_0x5496('0x52')](_0x4a4996(_0x508ae1,_0x5496('0x53')))[_0x5496('0x2b')](function(){})[_0x5496('0x2e')](_0x25bd0f()));}}}return _0x38cbde;})[_0x5496('0x54')]()[_0x5496('0x2b')](function(){return db[_0x5496('0x4b')][_0x5496('0x4c')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x5496('0x4e')],'as':_0x5496('0x55'),'where':{'id':LISTID}}]})[_0x5496('0x2b')](function(_0x3e812a){var _0xc21a2f=[];if(_0x3e812a){var _0x3de6b5;for(var _0x39e3c6=0x0,_0x1d71ce;_0x39e3c6<_0x3e812a[_0x5496('0x18')];_0x39e3c6+=0x1){_0x1d71ce=_0x3e812a[_0x39e3c6][_0x5496('0x4f')]({'plain':!![]});_0xc21a2f['push'](db[_0x5496('0x51')][_0x5496('0x52')](_0x37991b(_0x1d71ce,'VoiceQueueId'))[_0x5496('0x2b')](function(){})[_0x5496('0x2e')](_0x25bd0f()));}}return _0xc21a2f;})[_0x5496('0x54')]();})[_0x5496('0x2b')](function(){return db['Campaign'][_0x5496('0x4c')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x5496('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0x5496('0x2b')](function(_0x2e2d6a){var _0x35df0a=[];if(_0x2e2d6a){for(var _0x135c0c=0x0,_0x282184;_0x135c0c<_0x2e2d6a[_0x5496('0x18')];_0x135c0c+=0x1){_0x282184=_0x2e2d6a[_0x135c0c]['get']({'plain':!![]});switch(_0x282184['dialCheckDuplicateType']){case _0x5496('0x50'):_0x35df0a[_0x5496('0x2c')](db[_0x5496('0x51')][_0x5496('0x52')](_0xac46d3(_0x282184,_0x5496('0x56')))[_0x5496('0x2b')](function(){})[_0x5496('0x2e')](_0x25bd0f()));break;case _0x5496('0x57'):_0x35df0a[_0x5496('0x2c')](db[_0x5496('0x51')][_0x5496('0x52')](_0x7e3ae3(_0x282184,_0x5496('0x56')))['then'](function(){})['catch'](_0x25bd0f()));break;default:_0x35df0a['push'](db['sequelize'][_0x5496('0x52')](_0x4a4996(_0x282184,_0x5496('0x56')))[_0x5496('0x2b')](function(){})[_0x5496('0x2e')](_0x25bd0f()));}}}return _0x35df0a;})[_0x5496('0x54')]();})[_0x5496('0x2b')](function(){return db['Campaign'][_0x5496('0x4c')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x5496('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x2a5c65){var _0x180ff1=[];if(_0x2a5c65){for(var _0x495511=0x0,_0x1a0110;_0x495511<_0x2a5c65[_0x5496('0x18')];_0x495511+=0x1){_0x1a0110=_0x2a5c65[_0x495511]['get']({'plain':!![]});_0x180ff1[_0x5496('0x2c')](db['sequelize'][_0x5496('0x52')](_0x37991b(_0x1a0110,_0x5496('0x56')))[_0x5496('0x2b')](function(){})[_0x5496('0x2e')](_0x25bd0f()));}}return _0x180ff1;})[_0x5496('0x54')]();})[_0x5496('0x2e')](function(_0x1e6542){logger[_0x5496('0x15')](_0x5496('0x58'),'generalCheckHopper',_0x1e6542['message']);});}var processPromises=function(_0x24071a){return BPromise[_0x5496('0x54')](promises)[_0x5496('0x2b')](function(_0x69ae88){})[_0x5496('0x2e')](function(_0x25ffd7){logger[_0x5496('0x15')](_0x5496('0x59'),JSON[_0x5496('0x30')](_0x25ffd7));})[_0x5496('0x5a')](function(){socket[_0x5496('0x5b')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x24071a){return _0x24071a['resume']();}});};var endCsv=function(){return BPromise[_0x5496('0x5c')]()[_0x5496('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x5496('0x2b')](function(){socket[_0x5496('0x5b')](_0x5496('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5496('0x5e')](FILEPATH);}catch(_0x5ac172){logger[_0x5496('0x15')](_0x5496('0x5f'),JSON['stringify'](_0x5ac172));}finally{process[_0x5496('0x60')](0x0);}});};process['on'](_0x5496('0x61'),function(){logger[_0x5496('0x62')](_0x5496('0x63'));endCsv();});function main(){return BPromise[_0x5496('0x5c')]()[_0x5496('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x5496('0x28')][_0x5496('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5496('0x2b')](function(_0x5355b3){var _0xb80477=fs[_0x5496('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5496('0x65')](_0xb80477,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2d7ab8,_0x137e01){total+=0x1;var _0x57a8df=total;promises[_0x5496('0x2c')](checkRow(_0x2d7ab8,_0x5355b3,_0x57a8df)[_0x5496('0x2b')](function(){success+=0x1;})[_0x5496('0x2e')](function(_0x5cae46){if(_0x5cae46[_0x5496('0x15')]){errors+=0x1;delete _0x5cae46[_0x5496('0x15')];}else if(_0x5cae46['duplicate']){duplicates+=0x1;delete _0x5cae46[_0x5496('0x27')];}rows[_0x5496('0x2c')](_0x5cae46);}));if(total%0xc8===0x0){_0x137e01[_0x5496('0x66')]();return processPromises(_0x137e01);}},'complete':function(){return processPromises()['then'](function(){logger[_0x5496('0x62')](_0x5496('0x67'));endCsv();});},'error':function(_0x4dc8e7,_0x564fd1){logger[_0x5496('0x62')]('CSV\x20parse\x20error',JSON[_0x5496('0x30')](_0x4dc8e7));endCsv();}});})[_0x5496('0x2e')](function(_0x1a07dd){logger[_0x5496('0x15')](_0x5496('0x68'),JSON['stringify'](_0x1a07dd));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index b454990..a92a331 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 _0x62ce=['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;','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','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','emit','unlink','exit','complete','argv','root','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','papaparse','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','ContactId','ListId','createdAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_hopper_black','phone','ListId\x20=\x20?','concat','keys','CompanyId','updatedAt','fromQuery',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','group','info','Received\x20SIGINT','error','message','errors','sequelize','query','push','catch','main','send','binding','socket_timestamp','server/files/tmp','.csv','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','includes','agent\x20not\x20exists','email\x20wrong\x20format'];(function(_0xbc9cd8,_0x326ebf){var _0x2a7e20=function(_0x2529b5){while(--_0x2529b5){_0xbc9cd8['push'](_0xbc9cd8['shift']());}};_0x2a7e20(++_0x326ebf);}(_0x62ce,0x1a6));var _0xe62c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x62ce[_0x1facfa];return _0x9ec701;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xe62c('0x0'));var Papa=require(_0xe62c('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0xe62c('0x2'));var squel=require(_0xe62c('0x3'));var Redis=require('ioredis');var db=require(_0xe62c('0x4'))['db'];var config=require(_0xe62c('0x5'));var logger=require(_0xe62c('0x6'))(_0xe62c('0x7'));config[_0xe62c('0x8')]=_[_0xe62c('0x9')](config[_0xe62c('0x8')],{'host':_0xe62c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xe62c('0xb')](_0xe62c('0xc'));function isEmail(_0x32fba8){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))*$/[_0xe62c('0xd')](_0x32fba8);}function selectNotIn(_0x300169,_0x3d3b9a,_0x124c5b,_0x334ab7,_0x22a320){return squel[_0xe62c('0xe')]()[_0xe62c('0xf')]('phone')[_0xe62c('0x10')](_0x334ab7)[_0xe62c('0x11')](_0x3d3b9a,null,_0x3d3b9a+_0xe62c('0x12')+_0x334ab7+'.'+_0x124c5b)[_0xe62c('0x13')](_0x334ab7+'.'+_0x124c5b+_0xe62c('0x14')+_0x300169+'.'+_0x124c5b)[_0xe62c('0x13')](_0x3d3b9a+'.dialCheckDuplicateType\x20IN\x20('+_0x22a320[_0xe62c('0x11')]()+')');}function insertCmHopper(_0x17b78a,_0x21a971,_0x189ebb,_0x79c7ac,_0x35a523){var _0x34b33b=['cm_contacts.phone',_0xe62c('0x15'),_0xe62c('0x16'),_0xe62c('0x17'),_0x21a971+'.'+_0x79c7ac,_0xe62c('0x18'),_0xe62c('0x19'),_0xe62c('0x1a'),_0xe62c('0x1b'),'\x22'+_0x35a523+'\x22'];return squel[_0xe62c('0x1c')]()[_0xe62c('0x1d')](_0xe62c('0x1e'))['fromQuery'](['phone','scheduledat',_0xe62c('0x1f'),_0xe62c('0x20'),_0x79c7ac,_0xe62c('0x21'),'updatedAt',_0xe62c('0x22'),'UserId',_0xe62c('0x23')],squel[_0xe62c('0xe')]()[_0xe62c('0x24')](_0x34b33b)[_0xe62c('0x10')](_0x21a971)[_0xe62c('0x11')](_0xe62c('0x25'),null,_0xe62c('0x26')+_0x21a971+_0xe62c('0x27'))['join'](_0x189ebb,null,_0x189ebb+_0xe62c('0x12')+_0x21a971+'.'+_0x79c7ac)[_0xe62c('0x13')](_0x21a971+_0xe62c('0x28'),_0x17b78a)[_0xe62c('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xe62c('0x29'),selectNotIn(_0x21a971,_0x189ebb,_0x79c7ac,_0xe62c('0x1e'),[_0xe62c('0x2a'),_0xe62c('0x2b')]))[_0xe62c('0x13')](_0xe62c('0x29'),selectNotIn(_0x21a971,_0x189ebb,_0x79c7ac,_0xe62c('0x1e'),[_0xe62c('0x2a')])))[_0xe62c('0x2c')]();}function insertCmHopperBlack(_0x189010,_0xec8e50,_0x3a0c11,_0x4af0be){var _0x51c125=[_0xe62c('0x2d'),_0xe62c('0x16'),_0xe62c('0x17'),_0xec8e50+'.'+_0x4af0be,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0xe62c('0x1d')](_0xe62c('0x2e'))['fromQuery']([_0xe62c('0x2f'),'ContactId',_0xe62c('0x20'),_0x4af0be,_0xe62c('0x21'),'updatedAt'],squel[_0xe62c('0xe')]()[_0xe62c('0x24')](_0x51c125)[_0xe62c('0x10')](_0xec8e50)[_0xe62c('0x11')](_0xe62c('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0xec8e50+_0xe62c('0x27'))['join'](_0x3a0c11,null,_0x3a0c11+_0xe62c('0x12')+_0xec8e50+'.'+_0x4af0be)['where'](_0xec8e50+_0xe62c('0x28'),_0x189010)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe62c('0x13')](_0xe62c('0x29'),squel[_0xe62c('0xe')]()[_0xe62c('0xf')](_0xe62c('0x2f'))[_0xe62c('0x10')](_0xe62c('0x2e'))[_0xe62c('0x13')](_0xe62c('0x30'),_0x189010)['where'](_0x4af0be+'\x20=\x20?',_0xec8e50+'.'+_0x4af0be)))['toString']();}function insertCmContact(_0x2d0f99,_0x1c619d,_0x5b520b,_0x30baac){var _0xc2e0df=_[_0xe62c('0x31')](_[_0xe62c('0x32')](_0x30baac),[_0xe62c('0x20'),_0xe62c('0x33'),'createdAt',_0xe62c('0x34')]);return squel['insert']()[_0xe62c('0x1d')](_0xe62c('0x25'))[_0xe62c('0x35')](_0xc2e0df,squel[_0xe62c('0xe')]()['fields'](_0xc2e0df)['from'](_0x1c619d)[_0xe62c('0x13')]('('+_0x5b520b['join'](',')+_0xe62c('0x36'),squel[_0xe62c('0xe')]()[_0xe62c('0x24')](_0x5b520b)['from'](_0xe62c('0x25'))['where'](_0xe62c('0x30'),_0x2d0f99)['where'](_0xe62c('0x37')))[_0xe62c('0x13')](_0xe62c('0x38'),squel[_0xe62c('0xe')]()[_0xe62c('0xf')]('MIN(id)','min_id')[_0xe62c('0x10')](_0x1c619d)[_0xe62c('0x39')](_0x5b520b['join'](','))))[_0xe62c('0x2c')]();}function handleStop(){logger[_0xe62c('0x3a')](_0xe62c('0x3b'));stopped=!![];}function handleUncaughtException(_0x5a79c5){logger[_0xe62c('0x3c')](_0x5a79c5[_0xe62c('0x3d')]);process['exit'](0x1);}function handleError(_0x4f9a81,_0x836d0b){stats[_0xe62c('0x3e')]['push']({'name':_0x836d0b['code'],'message':_0x836d0b[_0xe62c('0x3d')],'row':_0x4f9a81});}function handleQuery(_0x4e5828){logger['info'](_0x4e5828);return db[_0xe62c('0x3f')][_0xe62c('0x40')](_0x4e5828)['spread'](function(_0x526a84){results[_0xe62c('0x41')](_0x526a84);})[_0xe62c('0x42')](function(_0x2d9f77){logger['error'](_0x2d9f77[_0xe62c('0x3d')]);});}function main(_0x58d78f,_0x24c668,_0x2df302,_0x597df2){logger[_0xe62c('0x3a')](_0xe62c('0x43'),_0x58d78f,JSON['stringify'](_0x24c668));process[_0xe62c('0x44')]('start');var _0xce79ea=_0x24c668[_0xe62c('0x45')];var _0x5c7867=_0x24c668[_0xe62c('0x46')];var _0x40567e=path[_0xe62c('0x11')](config['root'],_0xe62c('0x47'),_0x5c7867+_0xe62c('0x48'));var _0x554690=_[_0xe62c('0x32')](_0xce79ea)['join']();logger[_0xe62c('0x3a')]('header',_0x554690);fs[_0xe62c('0x49')](_0x40567e,_0x554690+'\x0a');Papa[_0xe62c('0x4a')](fs[_0xe62c('0x4b')](_0x58d78f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x553365,_0xf3112d){try{for(var _0x529ea6=0x0,_0x56fcd1=[];_0x529ea6<_0x553365[_0xe62c('0x4c')][_0xe62c('0x4d')];_0x529ea6++){stats[_0xe62c('0x4e')]+=0x1;if(_0x553365['errors'][_0x529ea6]){handleError(_0x553365[_0xe62c('0x4c')][_0x529ea6],_0x553365[_0xe62c('0x3e')][_0x529ea6]);}else{var _0x64f5a7=[];for(var _0x4440a0 in _0xce79ea){if(_0xce79ea[_0xe62c('0x4f')](_0x4440a0)){if(_0x553365[_0xe62c('0x4c')][_0x529ea6][_0xce79ea[_0x4440a0]]){var _0x4d0ebd=_[_0xe62c('0x50')](_0x553365[_0xe62c('0x4c')][_0x529ea6][_0xce79ea[_0x4440a0]][_0xe62c('0x51')](/"/g,'\x27'));switch(_0x4440a0){case _0xe62c('0x52'):var _0x277c08=moment(_0x4d0ebd,_0xe62c('0xc'),!![]);if(_0x277c08[_0xe62c('0x53')]()){_0x56fcd1['push']('\x22'+_0x4d0ebd+'\x22');}else{_0x64f5a7['push'](_0xe62c('0x54'));}break;case _0xe62c('0x22'):var _0x5c6075=parseInt(_0x4d0ebd);_0x4d0ebd=_[_0xe62c('0x55')](_0x5c6075)||_0x5c6075<0x0||_0x5c6075>0x4?_0x597df2?0x3:0x2:_0x5c6075;_0x56fcd1[_0xe62c('0x41')]('\x22'+_0x4d0ebd+'\x22');break;case _0xe62c('0x56'):var _0x10dce2=parseInt(_0x4d0ebd);if(_['isNumber'](_0x10dce2)&&_[_0xe62c('0x57')](_0x2df302,_0x10dce2)){_0x56fcd1['push']('\x22'+_0x10dce2+'\x22');}else{_0x64f5a7[_0xe62c('0x41')](_0xe62c('0x58'));}break;case'email':if(isEmail(_0x4d0ebd)){_0x56fcd1[_0xe62c('0x41')]('\x22'+_0x4d0ebd+'\x22');}else{_0x64f5a7[_0xe62c('0x41')](_0xe62c('0x59'));}break;case _0xe62c('0x5a'):var _0x2677e9=moment(_0x4d0ebd,_0xe62c('0x5b'),!![]);if(_0x2677e9[_0xe62c('0x53')]()){_0x56fcd1[_0xe62c('0x41')]('\x22'+_0x4d0ebd+'\x22');}else{_0x64f5a7[_0xe62c('0x41')](_0xe62c('0x5c'));}break;default:_0x56fcd1[_0xe62c('0x41')]('\x22'+_0x4d0ebd+'\x22');}}else{switch(_0x4440a0){case _0xe62c('0x5d'):case _0xe62c('0x2f'):_0x64f5a7[_0xe62c('0x41')](_0x4440a0+_0xe62c('0x5e'));break;default:_0x56fcd1['push']('\x22\x22');}}}}if(_0x64f5a7['length']){handleError(_0x553365[_0xe62c('0x4c')][_0x529ea6],{'code':'SystemRow','message':_0x64f5a7[_0xe62c('0x11')]()});}else{fs[_0xe62c('0x5f')](_0x40567e,_0x56fcd1[_0xe62c('0x11')]()+'\x0a');}_0x56fcd1=[];}if(!(stats[_0xe62c('0x4e')]%0xc8)){socket['emit'](_0xe62c('0x60')+_0x5c7867,stats);stats[_0xe62c('0x3e')]=[];}}if(stopped){logger[_0xe62c('0x3a')](_0xe62c('0x61'));_0xf3112d['abort']();}}catch(_0x2941dc){handleError(_0x553365[_0xe62c('0x4c')][_0x529ea6],{'code':_0xe62c('0x62'),'message':_0x2941dc[_0xe62c('0x3d')]});logger[_0xe62c('0x3c')](_0xe62c('0x63'),_0x2941dc[_0xe62c('0x3d')]);}},'complete':function(){try{var _0x5af695=[];var _0x351e1f=_0xe62c('0x25');if(_0x24c668[_0xe62c('0x64')]&&_0x24c668[_0xe62c('0x64')]['length']){_0x351e1f=_0xe62c('0x65')+_0x5c7867;_0x5af695['push'](_0xe62c('0x66')+_0x351e1f+_0xe62c('0x67'));}var _0x241f4c=util[_0xe62c('0xb')](_0xe62c('0x68'),_0x40567e,_0x351e1f,_0x554690,_0x24c668[_0xe62c('0x20')],_0x24c668['CompanyId']||null,NOW,NOW);if(_['isNil'](_0xce79ea[_0xe62c('0x52')])){_0x241f4c+=',\x20scheduledAt\x20=\x20NOW()';}_0x5af695[_0xe62c('0x41')](_0x241f4c);if(_0x24c668[_0xe62c('0x64')]&&_0x24c668['duplicates'][_0xe62c('0x4d')]){_0x5af695[_0xe62c('0x41')](insertCmContact(_0x24c668[_0xe62c('0x20')],_0x351e1f,_0x24c668['duplicates'],_0xce79ea));_0x5af695['push'](_0xe62c('0x69')+_0x351e1f+';');}_0x5af695[_0xe62c('0x41')](insertCmHopper(_0x24c668[_0xe62c('0x20')],_0xe62c('0x6a'),'voice_queues',_0xe62c('0x6b'),_0x597df2));_0x5af695['push'](insertCmHopperBlack(_0x24c668[_0xe62c('0x20')],'voice_queues_has_cm_blacklists','voice_queues',_0xe62c('0x6b')));_0x5af695[_0xe62c('0x41')](insertCmHopper(_0x24c668[_0xe62c('0x20')],_0xe62c('0x6c'),'campaigns',_0xe62c('0x6d'),_0x597df2));_0x5af695[_0xe62c('0x41')](insertCmHopperBlack(_0x24c668[_0xe62c('0x20')],_0xe62c('0x6e'),'campaigns','CampaignId'));BPromise[_0xe62c('0x6f')](_0x5af695,handleQuery)['then'](function(_0x4c3868){stats[_0xe62c('0x70')]=!![];stats[_0xe62c('0x71')]=_0x24c668[_0xe62c('0x64')]&&_0x24c668[_0xe62c('0x64')][_0xe62c('0x4d')]?results[0x2][_0xe62c('0x71')]:results[0x0][_0xe62c('0x71')];socket[_0xe62c('0x72')](_0xe62c('0x60')+_0x5c7867,stats);fs[_0xe62c('0x73')](_0x58d78f);fs[_0xe62c('0x73')](_0x40567e);process[_0xe62c('0x74')](0x0);})['catch'](function(_0x21af1d){logger[_0xe62c('0x3c')](_0x21af1d[_0xe62c('0x3d')]);process['exit'](0x1);});}catch(_0x3c1b72){logger[_0xe62c('0x3c')](_0xe62c('0x75'),_0x3c1b72[_0xe62c('0x3d')]);process[_0xe62c('0x74')](0x1);}},'error':function(_0x34810c,_0x1fb088,_0x25e0ac,_0x2dc67b){throw new Error(_0x2dc67b);}});}function validate(){if(process[_0xe62c('0x76')]&&process[_0xe62c('0x76')][_0xe62c('0x4d')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x977f60=path[_0xe62c('0x11')](config[_0xe62c('0x77')],'server/files/tmp',process[_0xe62c('0x76')][0x2]);if(!fs[_0xe62c('0x78')](_0x977f60)){throw new Error(_0xe62c('0x79'));}var _0x5b66f2={};try{_0x5b66f2=JSON['parse'](process[_0xe62c('0x76')][0x3]);if(!_0x5b66f2[_0xe62c('0x45')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x5b66f2['binding'][_0xe62c('0x2f')]){throw new Error(_0xe62c('0x7a'));}if(!_0x5b66f2[_0xe62c('0x45')][_0xe62c('0x5d')]){throw new Error(_0xe62c('0x7b'));}var _0x24af88=0x0;if(_0x5b66f2[_0xe62c('0x45')][_0xe62c('0x56')]){_0x24af88=0x1;}if(!_0x5b66f2[_0xe62c('0x20')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x50ad7a){throw new Error(_0xe62c('0x7c'));}var _0x4a856e=[];try{_0x4a856e=_[_0xe62c('0x7d')](JSON[_0xe62c('0x4a')](process['argv'][0x4]),'id');}catch(_0x4f8019){logger[_0xe62c('0x3a')](_0xe62c('0x7e'));}main(_0x977f60,_0x5b66f2,_0x4a856e,_0x24af88);}validate();process['on']('SIGINT',handleStop);process['on'](_0xe62c('0x7f'),handleUncaughtException); \ No newline at end of file +var _0x725a=['then','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','insert','cm_hopper_black','ContactId','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','exit','errors','code','sequelize','query','spread','push','catch','main','send','start','binding','root','parse','createReadStream','data','length','rows','trim','replace','isValid','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','firstName','SystemRow','appendFileSync','emit','Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','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','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x725a,0x119));var _0xa725=function(_0x38ff2b,_0x3a0316){_0x38ff2b=_0x38ff2b-0x0;var _0x341f5e=_0x725a[_0x38ff2b];return _0x341f5e;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xa725('0x0'));var Papa=require(_0xa725('0x1'));var util=require(_0xa725('0x2'));var BPromise=require(_0xa725('0x3'));var moment=require(_0xa725('0x4'));var squel=require(_0xa725('0x5'));var Redis=require(_0xa725('0x6'));var db=require(_0xa725('0x7'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xa725('0x8'));config[_0xa725('0x9')]=_[_0xa725('0xa')](config[_0xa725('0x9')],{'host':_0xa725('0xb'),'port':0x18eb});var socket=require(_0xa725('0xc'))(new Redis(config[_0xa725('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xa725('0xd')](_0xa725('0xe'));function isEmail(_0x3dad30){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))*$/[_0xa725('0xf')](_0x3dad30);}function selectNotIn(_0x369cde,_0x32abda,_0x262877,_0x63c9f6,_0x4885ad){return squel['select']()[_0xa725('0x10')](_0xa725('0x11'))[_0xa725('0x12')](_0x63c9f6)[_0xa725('0x13')](_0x32abda,null,_0x32abda+_0xa725('0x14')+_0x63c9f6+'.'+_0x262877)['where'](_0x63c9f6+'.'+_0x262877+'\x20=\x20'+_0x369cde+'.'+_0x262877)[_0xa725('0x15')](_0x32abda+_0xa725('0x16')+_0x4885ad[_0xa725('0x13')]()+')');}function insertCmHopper(_0x360549,_0x2fc1de,_0x30ba91,_0x263ce5,_0xf53f8a){var _0x3eacd1=[_0xa725('0x17'),'cm_contacts.scheduledat',_0xa725('0x18'),_0xa725('0x19'),_0x2fc1de+'.'+_0x263ce5,_0xa725('0x1a'),_0xa725('0x1b'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0xf53f8a+'\x22'];return squel['insert']()[_0xa725('0x1c')](_0xa725('0x1d'))[_0xa725('0x1e')]([_0xa725('0x11'),_0xa725('0x1f'),'ContactId',_0xa725('0x20'),_0x263ce5,_0xa725('0x21'),_0xa725('0x22'),'priority',_0xa725('0x23'),_0xa725('0x24')],squel[_0xa725('0x25')]()[_0xa725('0x26')](_0x3eacd1)[_0xa725('0x12')](_0x2fc1de)[_0xa725('0x13')](_0xa725('0x27'),null,_0xa725('0x28')+_0x2fc1de+'.CmListId')['join'](_0x30ba91,null,_0x30ba91+_0xa725('0x14')+_0x2fc1de+'.'+_0x263ce5)['where'](_0x2fc1de+'.CmListId\x20=\x20?',_0x360549)[_0xa725('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa725('0x15')](_0xa725('0x29'),selectNotIn(_0x2fc1de,_0x30ba91,_0x263ce5,'cm_hopper',[_0xa725('0x2a'),_0xa725('0x2b')]))[_0xa725('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2fc1de,_0x30ba91,_0x263ce5,'cm_hopper',['\x22always\x22'])))[_0xa725('0x2c')]();}function insertCmHopperBlack(_0x411feb,_0x1239d1,_0x5a7174,_0x3fbdd6){var _0x3fda21=[_0xa725('0x17'),_0xa725('0x18'),'cm_contacts.ListId',_0x1239d1+'.'+_0x3fbdd6,_0xa725('0x1a'),_0xa725('0x1b')];return squel[_0xa725('0x2d')]()[_0xa725('0x1c')](_0xa725('0x2e'))[_0xa725('0x1e')](['phone',_0xa725('0x2f'),_0xa725('0x20'),_0x3fbdd6,_0xa725('0x21'),_0xa725('0x22')],squel['select']()[_0xa725('0x26')](_0x3fda21)['from'](_0x1239d1)['join'](_0xa725('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x1239d1+_0xa725('0x30'))[_0xa725('0x13')](_0x5a7174,null,_0x5a7174+_0xa725('0x14')+_0x1239d1+'.'+_0x3fbdd6)[_0xa725('0x15')](_0x1239d1+_0xa725('0x31'),_0x411feb)['where'](_0xa725('0x32'),NOW)['where'](_0xa725('0x29'),squel['select']()[_0xa725('0x10')]('phone')['from'](_0xa725('0x2e'))[_0xa725('0x15')]('ListId\x20=\x20?',_0x411feb)[_0xa725('0x15')](_0x3fbdd6+_0xa725('0x33'),_0x1239d1+'.'+_0x3fbdd6)))['toString']();}function insertCmContact(_0x1d0c60,_0x3d9992,_0xe2a802,_0x1a766d){var _0x1f51d6=_[_0xa725('0x34')](_[_0xa725('0x35')](_0x1a766d),[_0xa725('0x20'),_0xa725('0x36'),'createdAt','updatedAt']);return squel['insert']()[_0xa725('0x1c')](_0xa725('0x27'))[_0xa725('0x1e')](_0x1f51d6,squel[_0xa725('0x25')]()['fields'](_0x1f51d6)['from'](_0x3d9992)[_0xa725('0x15')]('('+_0xe2a802[_0xa725('0x13')](',')+_0xa725('0x37'),squel[_0xa725('0x25')]()[_0xa725('0x26')](_0xe2a802)['from'](_0xa725('0x27'))[_0xa725('0x15')](_0xa725('0x38'),_0x1d0c60)[_0xa725('0x15')](_0xa725('0x39')))['where'](_0xa725('0x3a'),squel[_0xa725('0x25')]()['field'](_0xa725('0x3b'),_0xa725('0x3c'))['from'](_0x3d9992)[_0xa725('0x3d')](_0xe2a802[_0xa725('0x13')](','))))['toString']();}function handleStop(){logger[_0xa725('0x3e')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x565f57){logger[_0xa725('0x3f')](_0x565f57[_0xa725('0x40')]);process[_0xa725('0x41')](0x1);}function handleError(_0x57c997,_0xf1ada4){stats[_0xa725('0x42')]['push']({'name':_0xf1ada4[_0xa725('0x43')],'message':_0xf1ada4[_0xa725('0x40')],'row':_0x57c997});}function handleQuery(_0x581856){logger[_0xa725('0x3e')](_0x581856);return db[_0xa725('0x44')][_0xa725('0x45')](_0x581856)[_0xa725('0x46')](function(_0xcf4896){results[_0xa725('0x47')](_0xcf4896);})[_0xa725('0x48')](function(_0x449958){logger[_0xa725('0x3f')](_0x449958[_0xa725('0x40')]);});}function main(_0x2b6c6c,_0x114bc8,_0x28bdd1,_0x39b565){logger[_0xa725('0x3e')](_0xa725('0x49'),_0x2b6c6c,JSON['stringify'](_0x114bc8));process[_0xa725('0x4a')](_0xa725('0x4b'));var _0x42956d=_0x114bc8[_0xa725('0x4c')];var _0x3d6a4b=_0x114bc8['socket_timestamp'];var _0x1223e8=path[_0xa725('0x13')](config[_0xa725('0x4d')],'server/files/tmp',_0x3d6a4b+'.csv');var _0x4585a6=_[_0xa725('0x35')](_0x42956d)[_0xa725('0x13')]();logger[_0xa725('0x3e')]('header',_0x4585a6);fs['writeFileSync'](_0x1223e8,_0x4585a6+'\x0a');Papa[_0xa725('0x4e')](fs[_0xa725('0x4f')](_0x2b6c6c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x54467e,_0x3315d1){try{for(var _0x2f54c9=0x0,_0x526bd2=[];_0x2f54c9<_0x54467e[_0xa725('0x50')][_0xa725('0x51')];_0x2f54c9++){stats[_0xa725('0x52')]+=0x1;if(_0x54467e['errors'][_0x2f54c9]){handleError(_0x54467e[_0xa725('0x50')][_0x2f54c9],_0x54467e[_0xa725('0x42')][_0x2f54c9]);}else{var _0x2b6962=[];for(var _0x39fddd in _0x42956d){if(_0x42956d['hasOwnProperty'](_0x39fddd)){if(_0x54467e[_0xa725('0x50')][_0x2f54c9][_0x42956d[_0x39fddd]]){var _0x49ab2a=_[_0xa725('0x53')](_0x54467e[_0xa725('0x50')][_0x2f54c9][_0x42956d[_0x39fddd]][_0xa725('0x54')](/"/g,'\x27'));switch(_0x39fddd){case _0xa725('0x1f'):var _0x546145=moment(_0x49ab2a,_0xa725('0xe'),!![]);if(_0x546145[_0xa725('0x55')]()){_0x526bd2[_0xa725('0x47')]('\x22'+_0x49ab2a+'\x22');}else{_0x2b6962['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xa725('0x56'):var _0xa911f7=parseInt(_0x49ab2a);_0x49ab2a=_[_0xa725('0x57')](_0xa911f7)||_0xa911f7<0x0||_0xa911f7>0x4?_0x39b565?0x3:0x2:_0xa911f7;_0x526bd2['push']('\x22'+_0x49ab2a+'\x22');break;case _0xa725('0x23'):var _0x45e841=parseInt(_0x49ab2a);if(_[_0xa725('0x58')](_0x45e841)&&_[_0xa725('0x59')](_0x28bdd1,_0x45e841)){_0x526bd2[_0xa725('0x47')]('\x22'+_0x45e841+'\x22');}else{_0x2b6962[_0xa725('0x47')](_0xa725('0x5a'));}break;case'email':if(isEmail(_0x49ab2a)){_0x526bd2[_0xa725('0x47')]('\x22'+_0x49ab2a+'\x22');}else{_0x2b6962[_0xa725('0x47')](_0xa725('0x5b'));}break;case _0xa725('0x5c'):var _0x144daf=moment(_0x49ab2a,'YYYY-MM-DD',!![]);if(_0x144daf[_0xa725('0x55')]()){_0x526bd2['push']('\x22'+_0x49ab2a+'\x22');}else{_0x2b6962[_0xa725('0x47')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x526bd2[_0xa725('0x47')]('\x22'+_0x49ab2a+'\x22');}}else{switch(_0x39fddd){case _0xa725('0x5d'):case _0xa725('0x11'):_0x2b6962[_0xa725('0x47')](_0x39fddd+'\x20not\x20specified');break;default:_0x526bd2[_0xa725('0x47')]('\x22\x22');}}}}if(_0x2b6962[_0xa725('0x51')]){handleError(_0x54467e[_0xa725('0x50')][_0x2f54c9],{'code':_0xa725('0x5e'),'message':_0x2b6962[_0xa725('0x13')]()});}else{fs[_0xa725('0x5f')](_0x1223e8,_0x526bd2[_0xa725('0x13')]()+'\x0a');}_0x526bd2=[];}if(!(stats[_0xa725('0x52')]%0xc8)){socket[_0xa725('0x60')]('contact:import:'+_0x3d6a4b,stats);stats[_0xa725('0x42')]=[];}}if(stopped){logger[_0xa725('0x3e')](_0xa725('0x61'));_0x3315d1[_0xa725('0x62')]();}}catch(_0x5710b9){handleError(_0x54467e[_0xa725('0x50')][_0x2f54c9],{'code':'SystemError','message':_0x5710b9['message']});logger[_0xa725('0x3f')](_0xa725('0x63'),_0x5710b9[_0xa725('0x40')]);}},'complete':function(){try{var _0x4c11e0=[];var _0x1732fb=_0xa725('0x27');if(_0x114bc8[_0xa725('0x64')]&&_0x114bc8[_0xa725('0x64')]['length']){_0x1732fb='cm_contacts_'+_0x3d6a4b;_0x4c11e0[_0xa725('0x47')](_0xa725('0x65')+_0x1732fb+'\x20LIKE\x20cm_contacts;');}var _0x41914f=util['format'](_0xa725('0x66'),_0x1223e8,_0x1732fb,_0x4585a6,_0x114bc8[_0xa725('0x20')],_0x114bc8['CompanyId']||null,NOW,NOW);if(_[_0xa725('0x67')](_0x42956d[_0xa725('0x1f')])){_0x41914f+=_0xa725('0x68');}_0x4c11e0[_0xa725('0x47')](_0x41914f);if(_0x114bc8['duplicates']&&_0x114bc8['duplicates'][_0xa725('0x51')]){_0x4c11e0[_0xa725('0x47')](insertCmContact(_0x114bc8[_0xa725('0x20')],_0x1732fb,_0x114bc8[_0xa725('0x64')],_0x42956d));_0x4c11e0[_0xa725('0x47')](_0xa725('0x69')+_0x1732fb+';');}_0x4c11e0[_0xa725('0x47')](insertCmHopper(_0x114bc8[_0xa725('0x20')],_0xa725('0x6a'),_0xa725('0x6b'),_0xa725('0x6c'),_0x39b565));_0x4c11e0['push'](insertCmHopperBlack(_0x114bc8[_0xa725('0x20')],_0xa725('0x6d'),'voice_queues','VoiceQueueId'));_0x4c11e0[_0xa725('0x47')](insertCmHopper(_0x114bc8[_0xa725('0x20')],_0xa725('0x6e'),_0xa725('0x6f'),_0xa725('0x70'),_0x39b565));_0x4c11e0[_0xa725('0x47')](insertCmHopperBlack(_0x114bc8[_0xa725('0x20')],_0xa725('0x71'),_0xa725('0x6f'),_0xa725('0x70')));BPromise[_0xa725('0x72')](_0x4c11e0,handleQuery)[_0xa725('0x73')](function(_0x8881f3){stats['finish']=!![];stats[_0xa725('0x74')]=_0x114bc8['duplicates']&&_0x114bc8['duplicates'][_0xa725('0x51')]?results[0x2]['affectedRows']:results[0x0][_0xa725('0x74')];socket[_0xa725('0x60')](_0xa725('0x75')+_0x3d6a4b,stats);fs[_0xa725('0x76')](_0x2b6c6c);fs['unlink'](_0x1223e8);process[_0xa725('0x41')](0x0);})[_0xa725('0x48')](function(_0x329698){logger[_0xa725('0x3f')](_0x329698[_0xa725('0x40')]);process[_0xa725('0x41')](0x1);});}catch(_0x3881e9){logger[_0xa725('0x3f')](_0xa725('0x77'),_0x3881e9['message']);process[_0xa725('0x41')](0x1);}},'error':function(_0x122ddd,_0x586466,_0x328f78,_0x24b8d2){throw new Error(_0x24b8d2);}});}function validate(){if(process['argv']&&process[_0xa725('0x78')][_0xa725('0x51')]<0x4){throw new Error(_0xa725('0x79'));}var _0x288b81=path[_0xa725('0x13')](config['root'],_0xa725('0x7a'),process[_0xa725('0x78')][0x2]);if(!fs[_0xa725('0x7b')](_0x288b81)){throw new Error(_0xa725('0x7c'));}var _0x4eae56={};try{_0x4eae56=JSON['parse'](process['argv'][0x3]);if(!_0x4eae56[_0xa725('0x4c')]){throw new Error(_0xa725('0x7d'));}if(!_0x4eae56[_0xa725('0x4c')][_0xa725('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x4eae56[_0xa725('0x4c')][_0xa725('0x5d')]){throw new Error('firstName\x20is\x20mandatory');}var _0x5d10a7=0x0;if(_0x4eae56[_0xa725('0x4c')][_0xa725('0x23')]){_0x5d10a7=0x1;}if(!_0x4eae56['ListId']){throw new Error(_0xa725('0x7e'));}}catch(_0x2740db){throw new Error(_0xa725('0x7f'));}var _0xd48503=[];try{_0xd48503=_[_0xa725('0x80')](JSON[_0xa725('0x4e')](process[_0xa725('0x78')][0x4]),'id');}catch(_0x3a4c54){logger['info'](_0xa725('0x81'));}main(_0x288b81,_0x4eae56,_0xd48503,_0x5d10a7);}validate();process['on'](_0xa725('0x82'),handleStop);process['on'](_0xa725('0x83'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index c9f09f6..26c02d7 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 _0x56aa=['endtime','Duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Call\x20To','destexten','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','talktime','Called\x20Number','destcalleridnum','membername','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x56aa,0x1a8));var _0xa56a=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0x56aa[_0x204ad4];return _0x50675f;};'use strict';exports[_0xa56a('0x0')]=function(_0x4c68bc,_0x39f214){var _0x504e4c=[{'type':_0xa56a('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x4c68bc[_0xa56a('0x2')]()){case _0xa56a('0x3'):switch(_0x39f214['toLowerCase']()){case _0xa56a('0x4'):_0x504e4c[_0xa56a('0x5')]({'type':_0xa56a('0x6'),'content':'','variableName':_0xa56a('0x7')});_0x504e4c[_0xa56a('0x5')]({'type':_0xa56a('0x6'),'content':'','variableName':_0xa56a('0x8')});break;case _0xa56a('0x9'):_0x504e4c[_0xa56a('0x5')]({'type':_0xa56a('0x1'),'content':_0xa56a('0xa'),'variableName':null});_0x504e4c[_0xa56a('0x5')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x504e4c;};exports['getDescriptions']=function(_0x2ddd45,_0x97d8f8){var _0x38dfed=[];switch(_0x2ddd45[_0xa56a('0x2')]()){case _0xa56a('0x3'):switch(_0x97d8f8[_0xa56a('0x2')]()){case _0xa56a('0x4'):_0x38dfed=[{'type':'string','content':_0xa56a('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0xd'),'keyType':'variable','variableName':'calleridnum'},{'type':_0xa56a('0xc'),'content':'','key':'Caller\x20Name','keyType':_0xa56a('0x6'),'variableName':'calleridname'},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0xe'),'keyType':_0xa56a('0x6'),'variableName':_0xa56a('0xf')},{'type':'keyValue','content':'','key':'Queue','keyType':_0xa56a('0x6'),'variableName':_0xa56a('0x7')},{'type':'keyValue','content':'','key':_0xa56a('0x10'),'keyType':_0xa56a('0x6'),'variableName':'uniqueid'},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0x11'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xa56a('0x1'),'content':_0xa56a('0x12'),'key':null,'keyType':null,'variableName':null},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0x13'),'keyType':_0xa56a('0x6'),'variableName':_0xa56a('0x14')},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0x15'),'keyType':_0xa56a('0x6'),'variableName':'destcalleridnum'},{'type':_0xa56a('0x1'),'content':_0xa56a('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xa56a('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0xa56a('0x6'),'variableName':_0xa56a('0x17')},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0x18'),'keyType':'variable','variableName':_0xa56a('0x19')},{'type':'keyValue','content':'','key':_0xa56a('0x1a'),'keyType':_0xa56a('0x6'),'variableName':_0xa56a('0x1b')},{'type':_0xa56a('0xc'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0xa56a('0x1c')},{'type':_0xa56a('0xc'),'content':'','key':'Talk\x20Time','keyType':_0xa56a('0x6'),'variableName':_0xa56a('0x1d')}];break;case _0xa56a('0x9'):_0x38dfed=[{'type':'string','content':_0xa56a('0xb'),'variableName':null},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0x1e'),'keyType':_0xa56a('0x6'),'keyContent':'','variableName':_0xa56a('0x1f')},{'type':_0xa56a('0xc'),'content':'','key':'Member\x20Name','keyType':_0xa56a('0x6'),'keyContent':'','variableName':_0xa56a('0x20')},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0x10'),'keyType':_0xa56a('0x6'),'keyContent':'','variableName':_0xa56a('0x21')},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0x11'),'keyType':_0xa56a('0x6'),'keyContent':'','variableName':_0xa56a('0x22')},{'type':'string','content':_0xa56a('0x16')},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0x23'),'keyType':_0xa56a('0x6'),'keyContent':'','variableName':_0xa56a('0x24')},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0x25'),'keyType':_0xa56a('0x6'),'keyContent':'','variableName':_0xa56a('0x26')},{'type':'keyValue','content':'','key':_0xa56a('0x27'),'keyType':_0xa56a('0x6'),'keyContent':'','variableName':'duration'},{'type':_0xa56a('0xc'),'content':'','key':_0xa56a('0x28'),'keyType':_0xa56a('0x6'),'keyContent':'','variableName':_0xa56a('0x29')}];break;}}return _0x38dfed;}; \ No newline at end of file +var _0xb8b9=['Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','outbound','string','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','Duration','duration'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xb8b9,0x196));var _0x9b8b=function(_0x51b829,_0x3fb0b5){_0x51b829=_0x51b829-0x0;var _0x408760=_0xb8b9[_0x51b829];return _0x408760;};'use strict';exports[_0x9b8b('0x0')]=function(_0x245ee8,_0x53c037){var _0x33dd7b=[{'type':'string','content':_0x9b8b('0x1'),'variableName':null}];switch(_0x245ee8['toLowerCase']()){case _0x9b8b('0x2'):switch(_0x53c037[_0x9b8b('0x3')]()){case _0x9b8b('0x4'):_0x33dd7b[_0x9b8b('0x5')]({'type':_0x9b8b('0x6'),'content':'','variableName':'queue'});_0x33dd7b['push']({'type':_0x9b8b('0x6'),'content':'','variableName':'calleridnum'});break;case _0x9b8b('0x7'):_0x33dd7b['push']({'type':_0x9b8b('0x8'),'content':_0x9b8b('0x9'),'variableName':null});_0x33dd7b[_0x9b8b('0x5')]({'type':_0x9b8b('0x6'),'content':'','variableName':_0x9b8b('0xa')});break;}}return _0x33dd7b;};exports['getDescriptions']=function(_0x3e4102,_0x26a23c){var _0x4b6fcd=[];switch(_0x3e4102[_0x9b8b('0x3')]()){case'voice':switch(_0x26a23c[_0x9b8b('0x3')]()){case _0x9b8b('0x4'):_0x4b6fcd=[{'type':_0x9b8b('0x8'),'content':_0x9b8b('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0xd'),'keyType':_0x9b8b('0x6'),'variableName':'calleridnum'},{'type':_0x9b8b('0xc'),'content':'','key':'Caller\x20Name','keyType':'variable','variableName':_0x9b8b('0xe')},{'type':'keyValue','content':'','key':_0x9b8b('0xf'),'keyType':'variable','variableName':_0x9b8b('0x10')},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x11'),'keyType':'variable','variableName':_0x9b8b('0x12')},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x13'),'keyType':_0x9b8b('0x6'),'variableName':'uniqueid'},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x14'),'keyType':_0x9b8b('0x6'),'variableName':_0x9b8b('0x15')},{'type':_0x9b8b('0x8'),'content':_0x9b8b('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x9b8b('0x17'),'keyType':_0x9b8b('0x6'),'variableName':_0x9b8b('0x18')},{'type':'keyValue','content':'','key':_0x9b8b('0x19'),'keyType':_0x9b8b('0x6'),'variableName':_0x9b8b('0xa')},{'type':_0x9b8b('0x8'),'content':_0x9b8b('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x1b'),'keyType':_0x9b8b('0x6'),'variableName':'agentcalledAt'},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x1c'),'keyType':_0x9b8b('0x6'),'variableName':_0x9b8b('0x1d')},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x1e'),'keyType':_0x9b8b('0x6'),'variableName':_0x9b8b('0x1f')},{'type':'keyValue','content':'','key':_0x9b8b('0x20'),'keyType':'variable','variableName':_0x9b8b('0x21')},{'type':'keyValue','content':'','key':_0x9b8b('0x22'),'keyType':_0x9b8b('0x6'),'variableName':'talktime'}];break;case'outbound':_0x4b6fcd=[{'type':'string','content':_0x9b8b('0xb'),'variableName':null},{'type':'keyValue','content':'','key':_0x9b8b('0x23'),'keyType':_0x9b8b('0x6'),'keyContent':'','variableName':_0x9b8b('0xa')},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x24'),'keyType':'variable','keyContent':'','variableName':_0x9b8b('0x25')},{'type':_0x9b8b('0xc'),'content':'','key':'UniqueId','keyType':_0x9b8b('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x14'),'keyType':_0x9b8b('0x6'),'keyContent':'','variableName':_0x9b8b('0x26')},{'type':_0x9b8b('0x8'),'content':_0x9b8b('0x1a')},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x27'),'keyType':_0x9b8b('0x6'),'keyContent':'','variableName':_0x9b8b('0x28')},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x29'),'keyType':_0x9b8b('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x9b8b('0x2b')},{'type':_0x9b8b('0xc'),'content':'','key':_0x9b8b('0x2c'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x4b6fcd;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 63e344e..15a03e1 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 _0x4360=['error','tracked','query','clone','body','html','phone','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','Interaction','findOne','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4360,0xf8));var _0x0436=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x4360[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0436('0x0'));var db=require(_0x0436('0x1'))['db'];var loggers={'openchannel':require(_0x0436('0x2'))(_0x0436('0x3')),'mail':require(_0x0436('0x2'))(_0x0436('0x4')),'fax':require(_0x0436('0x2'))('fax-interactions'),'sms':require('../../config/logger')(_0x0436('0x5')),'chat':require(_0x0436('0x2'))(_0x0436('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x4aadd7,_0x197f74,_0x29e775){if(_0x4aadd7&&_0x4aadd7[_[_0x0436('0x7')](_0x29e775)+_0x0436('0x8')]){return _0x4aadd7[_[_0x0436('0x7')](_0x29e775)+'InteractionId'];}else if(_0x4aadd7&&_0x4aadd7['id']){return _0x4aadd7['id'];}else if(_0x197f74&&_0x197f74['id']){return _0x197f74['id'];}else{return'unknown';}}function log(_0x2a3626,_0x36f3ff,_0x25817f,_0x265f82,_0x4cd498,_0x3f0f8b){loggers[_0x4cd498['toLowerCase']()][_0x2a3626](_0x0436('0x9'),_0x3f0f8b['toUpperCase'](),_0x36f3ff?_0x36f3ff['id']:null,_0x36f3ff?_0x36f3ff[_0x0436('0xa')]:null,_0x36f3ff?_0x36f3ff[_0x0436('0xb')]:null,getInteractionId(_0x25817f,_0x265f82,_0x4cd498),_0x25817f?JSON['stringify'](_0x25817f):'null');}function updateUser(_0x578363,_0x55c206,_0x4f153b,_0x60c4d7,_0x591509){db[_['upperFirst'](_0x60c4d7)+_0x0436('0xc')][_0x0436('0xd')]({'where':{'id':getInteractionId(_0x55c206,_0x4f153b,_0x60c4d7)}})['then'](function(_0x369134){if(_0x369134){return _0x369134[_0x0436('0xe')]({'UserId':_0x578363?_0x578363['id']:null});}})[_0x0436('0xf')](function(_0x19c886){if(_0x19c886){log('info',_0x578363,_0x55c206,_0x4f153b,_0x60c4d7,_0x591509);}})['catch'](function(){log(_0x0436('0x10'),_0x578363,_0x55c206,_0x4f153b,_0x60c4d7,_0x591509);});}exports[_0x0436('0x11')]=function(_0x4e37f7,_0x3f5a7d){return function(_0x37a70c,_0x258dfd,_0x917052){var _0x213abb=_0x37a70c['user'];var _0x5f4a00={};var _0x24105f=_0x37a70c[_0x0436('0x12')];if(_0x5f4a00){_0x5f4a00=_[_0x0436('0x13')](_0x37a70c[_0x0436('0x14')]);_0x5f4a00=_['omit'](_0x5f4a00,['body',_0x0436('0x15'),_0x0436('0x16'),_0x0436('0x17'),'mobile']);}updateUser(_0x213abb,_0x5f4a00,_0x24105f,_0x4e37f7,_0x3f5a7d);_0x917052(null);};}; \ No newline at end of file +var _0xf67e=['whatsapp-interactions','InteractionId','upperFirst','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','update','error','tracked','user','query','clone','body','omit','html','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions'];(function(_0x4810bc,_0x515142){var _0x2c82c9=function(_0x3039fe){while(--_0x3039fe){_0x4810bc['push'](_0x4810bc['shift']());}};_0x2c82c9(++_0x515142);}(_0xf67e,0xb2));var _0xef67=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xf67e[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var db=require(_0xef67('0x0'))['db'];var loggers={'openchannel':require(_0xef67('0x1'))(_0xef67('0x2')),'mail':require(_0xef67('0x1'))('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0xef67('0x1'))(_0xef67('0x3')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0xef67('0x1'))(_0xef67('0x4'))};function getInteractionId(_0x57a5f5,_0x3089c9,_0x3bef74){if(_0x57a5f5&&_0x57a5f5[_['upperFirst'](_0x3bef74)+_0xef67('0x5')]){return _0x57a5f5[_[_0xef67('0x6')](_0x3bef74)+'InteractionId'];}else if(_0x57a5f5&&_0x57a5f5['id']){return _0x57a5f5['id'];}else if(_0x3089c9&&_0x3089c9['id']){return _0x3089c9['id'];}else{return'unknown';}}function log(_0xf2a7fd,_0x353992,_0x4d4516,_0x23d23c,_0x3cd082,_0x2f898f){loggers[_0x3cd082['toLowerCase']()][_0xf2a7fd](_0xef67('0x7'),_0x2f898f[_0xef67('0x8')](),_0x353992?_0x353992['id']:null,_0x353992?_0x353992[_0xef67('0x9')]:null,_0x353992?_0x353992['role']:null,getInteractionId(_0x4d4516,_0x23d23c,_0x3cd082),_0x4d4516?JSON[_0xef67('0xa')](_0x4d4516):_0xef67('0xb'));}function updateUser(_0x2f4707,_0x32aeb8,_0xcfc3c,_0x124e5e,_0x368bdd){db[_[_0xef67('0x6')](_0x124e5e)+_0xef67('0xc')][_0xef67('0xd')]({'where':{'id':getInteractionId(_0x32aeb8,_0xcfc3c,_0x124e5e)}})[_0xef67('0xe')](function(_0x1d85ad){if(_0x1d85ad){return _0x1d85ad[_0xef67('0xf')]({'UserId':_0x2f4707?_0x2f4707['id']:null});}})[_0xef67('0xe')](function(_0x16a682){if(_0x16a682){log('info',_0x2f4707,_0x32aeb8,_0xcfc3c,_0x124e5e,_0x368bdd);}})['catch'](function(){log(_0xef67('0x10'),_0x2f4707,_0x32aeb8,_0xcfc3c,_0x124e5e,_0x368bdd);});}exports[_0xef67('0x11')]=function(_0x1b1e8d,_0x18b7ba){return function(_0x4649da,_0x2857ee,_0x2f6a43){var _0x133951=_0x4649da[_0xef67('0x12')];var _0x2f24ab={};var _0x10bb20=_0x4649da[_0xef67('0x13')];if(_0x2f24ab){_0x2f24ab=_[_0xef67('0x14')](_0x4649da[_0xef67('0x15')]);_0x2f24ab=_[_0xef67('0x16')](_0x2f24ab,[_0xef67('0x15'),_0xef67('0x17'),'phone',_0xef67('0x18'),_0xef67('0x19')]);}updateUser(_0x133951,_0x2f24ab,_0x10bb20,_0x1b1e8d,_0x18b7ba);_0x2f6a43(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index b1786c9..9c83b13 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 _0xf8ab=['count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','composable-middleware','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','use','License','findOne','then'];(function(_0x3cec8c,_0x3f6c1d){var _0x38032e=function(_0x4ef75b){while(--_0x4ef75b){_0x3cec8c['push'](_0x3cec8c['shift']());}};_0x38032e(++_0x3f6c1d);}(_0xf8ab,0xf3));var _0xbf8a=function(_0x5cfb69,_0x8ad059){_0x5cfb69=_0x5cfb69-0x0;var _0x3564e7=_0xf8ab[_0x5cfb69];return _0x3564e7;};'use strict';var crypto=require(_0xbf8a('0x0'));var util=require('util');var compose=require(_0xbf8a('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1437d9,_0x75faea){if(_0x1437d9&&_0x75faea){if(_0x75faea['data1']&&_0x75faea[_0xbf8a('0x2')]){var _0x27e50f=_0x75faea[_0xbf8a('0x3')];var _0x2fa5ec=_0x75faea['license'];var _0x585608=_0x27e50f[_0xbf8a('0x4')]('-')[0x4];var _0x17e1ae=_0x27e50f[_0xbf8a('0x4')]('-')[0x0];var _0x4f26ce=crypto[_0xbf8a('0x5')](_0xbf8a('0x6'),util[_0xbf8a('0x7')](_0xbf8a('0x8'),_0x585608,_0x27e50f,_0x17e1ae));var _0x1cf738=_0x4f26ce[_0xbf8a('0x9')](_0x2fa5ec,'base64',_0xbf8a('0xa'));_0x1cf738+=_0x4f26ce[_0xbf8a('0xb')](_0xbf8a('0xa'));var _0x3d36cf=JSON[_0xbf8a('0xc')](_0x1cf738);return _0x3d36cf['hasOwnProperty'](_0x1437d9)?_0x3d36cf[_0x1437d9]:null;}}return null;}function isLimit(_0x14e678,_0x67a7a,_0x21bc86,_0x868ea){var _0x5ccb67=_0x67a7a;return compose()[_0xbf8a('0xd')](function(_0x5c339e,_0x4813d0,_0x2ddd00){return db[_0xbf8a('0xe')][_0xbf8a('0xf')]({'where':{'id':0x1},'raw':!![]})[_0xbf8a('0x10')](function(_0x5cff2b){var _0x515db8=getValueFromLicense(_0x14e678,_0x5cff2b);return _0x515db8?_0x515db8:_0x5ccb67;})[_0xbf8a('0x10')](function(_0x215fb3){_0x5ccb67=_0x215fb3;return _0x21bc86[_0xbf8a('0x11')](_0x868ea);})[_0xbf8a('0x10')](function(_0x253e41){if(_0x253e41>=_0x5ccb67){return _0x4813d0[_0xbf8a('0x12')](0x193)[_0xbf8a('0x13')]({'message':util['format'](_0xbf8a('0x14'),_0x14e678)});}_0x2ddd00();})[_0xbf8a('0x15')](function(_0x170e1d){_0x2ddd00(_0x170e1d);});});}function isUserLimit(){return isLimit(_0xbf8a('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0xbf8a('0x17')},{'role':_0xbf8a('0x18')}]}});}exports[_0xbf8a('0x19')]=isUserLimit; \ No newline at end of file +var _0x2a1d=['then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','use','findOne'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x2a1d,0xd4));var _0xd2a1=function(_0x2bdf07,_0x175421){_0x2bdf07=_0x2bdf07-0x0;var _0x20b8fb=_0x2a1d[_0x2bdf07];return _0x20b8fb;};'use strict';var crypto=require(_0xd2a1('0x0'));var util=require(_0xd2a1('0x1'));var compose=require(_0xd2a1('0x2'));var db=require(_0xd2a1('0x3'))['db'];var config=require(_0xd2a1('0x4'));function getValueFromLicense(_0x5445c7,_0x432e98){if(_0x5445c7&&_0x432e98){if(_0x432e98[_0xd2a1('0x5')]&&_0x432e98['license']){var _0x14d3e8=_0x432e98[_0xd2a1('0x5')];var _0x124d0c=_0x432e98[_0xd2a1('0x6')];var _0x2d5011=_0x14d3e8[_0xd2a1('0x7')]('-')[0x4];var _0x31c03b=_0x14d3e8[_0xd2a1('0x7')]('-')[0x0];var _0x5c5239=crypto[_0xd2a1('0x8')](_0xd2a1('0x9'),util[_0xd2a1('0xa')](_0xd2a1('0xb'),_0x2d5011,_0x14d3e8,_0x31c03b));var _0x48eb60=_0x5c5239[_0xd2a1('0xc')](_0x124d0c,_0xd2a1('0xd'),'utf8');_0x48eb60+=_0x5c5239[_0xd2a1('0xe')](_0xd2a1('0xf'));var _0x56c39b=JSON[_0xd2a1('0x10')](_0x48eb60);return _0x56c39b[_0xd2a1('0x11')](_0x5445c7)?_0x56c39b[_0x5445c7]:null;}}return null;}function isLimit(_0x1ab9ed,_0x44a7f8,_0x4be16c,_0x558f01){var _0x132fcc=_0x44a7f8;return compose()[_0xd2a1('0x12')](function(_0x43fc35,_0xeb24b7,_0x5e54e6){return db['License'][_0xd2a1('0x13')]({'where':{'id':0x1},'raw':!![]})[_0xd2a1('0x14')](function(_0x4e4c45){var _0x3cb2d6=getValueFromLicense(_0x1ab9ed,_0x4e4c45);return _0x3cb2d6?_0x3cb2d6:_0x132fcc;})[_0xd2a1('0x14')](function(_0x1b82a9){_0x132fcc=_0x1b82a9;return _0x4be16c[_0xd2a1('0x15')](_0x558f01);})[_0xd2a1('0x14')](function(_0x33f8a4){if(_0x33f8a4>=_0x132fcc){return _0xeb24b7['status'](0x193)[_0xd2a1('0x16')]({'message':util[_0xd2a1('0xa')](_0xd2a1('0x17'),_0x1ab9ed)});}_0x5e54e6();})[_0xd2a1('0x18')](function(_0x5c19b1){_0x5e54e6(_0x5c19b1);});});}function isUserLimit(){return isLimit(_0xd2a1('0x19'),0x1,db['User'],{'where':{'$or':[{'role':_0xd2a1('0x1a')},{'role':_0xd2a1('0x1b')}]}});}exports[_0xd2a1('0x1c')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 249926a..4f30752 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 _0xf73b=['and','[$or]','split','forEach','match','filter','indexOf','map','conditions','buildExpression','DATE','operator','$between','value','includes','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20IS\x20NULL)','$in','IN\x20?','$eq','=\x20?','$ne','<>\x20?','$startsWith','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$substring','start','$endsWith','shift','pop','utcOffset','add','seconds','parseSearch','sqlOperator','startsWith'];(function(_0x57a699,_0x276bcc){var _0x4f7ee1=function(_0x1ab4bf){while(--_0x1ab4bf){_0x57a699['push'](_0x57a699['shift']());}};_0x4f7ee1(++_0x276bcc);}(_0xf73b,0x19d));var _0xbf73=function(_0xd444e7,_0x986904){_0xd444e7=_0xd444e7-0x0;var _0x171580=_0xf73b[_0xd444e7];return _0x171580;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0xbf73('0x0')]=function(_0x33c21e){var _0x1c955b={'conditions':[]};_0x1c955b[_0xbf73('0x1')]=_[_0xbf73('0x2')](_0x33c21e,'[$or]')?'or':_0xbf73('0x3');var _0x3c2d4a=_0x33c21e['replace']('[$and]','')['replace'](_0xbf73('0x4'),'')[_0xbf73('0x5')]('||');for(var _0x16b29c=0x0;_0x16b29c<_0x3c2d4a['length'];_0x16b29c++){var _0x3780b9=_0x3c2d4a[_0x16b29c]['split'](':=');var _0xca70a8=_0x3780b9[0x0];var _0x168482=_0x3780b9['slice'](0x1);_0x168482[_0xbf73('0x6')](function(_0x15d624){var _0x50fbf4=_0x15d624[_0xbf73('0x5')]('[')['shift']();var _0x332a8a=_0x15d624[_0xbf73('0x7')](/\[(.*?)\]/g);_0x332a8a[_0xbf73('0x6')](function(_0x43e729){var _0x290e06=_0x43e729[_0xbf73('0x5')]('[')[_0xbf73('0x8')](function(_0x4defc1){return _0x4defc1[_0xbf73('0x9')](']')>-0x1;})[_0xbf73('0xa')](function(_0x41d6f0){return _0x41d6f0[_0xbf73('0x5')](']')[0x0];})[0x0];_0x1c955b[_0xbf73('0xb')]['push']({'field':_0xca70a8,'operator':_0x50fbf4,'value':_0x290e06});});});}return _0x1c955b;};exports[_0xbf73('0xc')]=function(_0x46f1f2,_0x276fd0,_0x1132fd){var _0x2317ee={};if(_0x276fd0===_0xbf73('0xd')){if(_0x1132fd['operator']==='$eq'){_0x1132fd[_0xbf73('0xe')]=_0xbf73('0xf');_0x1132fd[_0xbf73('0x10')]+=','+_0x1132fd[_0xbf73('0x10')];}else if(_[_0xbf73('0x11')](['$gt',_0xbf73('0x12')],_0x1132fd['operator'])){_0x1132fd[_0xbf73('0x10')]=moment(_0x1132fd[_0xbf73('0x10')])['add'](0x1,_0xbf73('0x13'))[_0xbf73('0x14')](_0xbf73('0x15'));}}if(_0x1132fd[_0xbf73('0x16')]){_0x276fd0=_0x1132fd[_0xbf73('0x16')];_0x2317ee[_0xbf73('0x17')]=_0xbf73('0x18')+_0x46f1f2+'.'+_0x1132fd[_0xbf73('0x19')]+_0xbf73('0x1a')+_0x1132fd[_0xbf73('0x16')]+')\x20'+parseOperator(_0x1132fd[_0xbf73('0xe')]);}else{_0x2317ee[_0xbf73('0x17')]=_0x46f1f2+'.'+_0x1132fd[_0xbf73('0x19')]+'\x20'+parseOperator(_0x1132fd[_0xbf73('0xe')]);}if(_[_0xbf73('0x11')](['$ne',_0xbf73('0x1b')],_0x1132fd['operator']))_0x2317ee['text']='('+_0x2317ee[_0xbf73('0x17')]+'\x20OR\x20'+_0x46f1f2+'.'+_0x1132fd[_0xbf73('0x19')]+_0xbf73('0x1c');_0x2317ee['value']=parseValue(_0x276fd0,_0x1132fd['operator'],_0x1132fd['value']);return _0x2317ee;};function parseOperator(_0x52cea8){var _0x250aeb;switch(_0x52cea8){case _0xbf73('0x1d'):_0x250aeb=_0xbf73('0x1e');break;case _0xbf73('0x1b'):_0x250aeb='NOT\x20IN\x20?';break;case _0xbf73('0x1f'):_0x250aeb=_0xbf73('0x20');break;case _0xbf73('0x21'):_0x250aeb=_0xbf73('0x22');break;case'$substring':case _0xbf73('0x23'):case'$endsWith':_0x250aeb='LIKE\x20?';break;case _0xbf73('0x24'):_0x250aeb=_0xbf73('0x25');break;case _0xbf73('0x26'):_0x250aeb=_0xbf73('0x27');break;case _0xbf73('0x12'):_0x250aeb=_0xbf73('0x28');break;case _0xbf73('0x29'):_0x250aeb=_0xbf73('0x2a');break;case _0xbf73('0xf'):_0x250aeb=_0xbf73('0x2b');break;}return _0x250aeb;}function parseValue(_0x5aee68,_0x4997d5,_0x107a4b){var _0x2452a8={'start':undefined,'end':undefined};switch(_0x4997d5){case _0xbf73('0x1d'):case'$notIn':_0x2452a8['start']=_0x107a4b[_0xbf73('0x5')](',');break;case _0xbf73('0x2c'):_0x2452a8['start']='%'+_0x107a4b+'%';break;case _0xbf73('0x23'):_0x2452a8[_0xbf73('0x2d')]=_0x107a4b+'%';break;case _0xbf73('0x2e'):_0x2452a8[_0xbf73('0x2d')]='%'+_0x107a4b;break;case _0xbf73('0xf'):var _0x2796cb=_0x107a4b[_0xbf73('0x5')](',');var _0x107a4b=_0x2796cb[_0xbf73('0x2f')]();var _0x23e1e0=_0x2796cb[_0xbf73('0x30')]();if(_0x5aee68===_0xbf73('0xd')){_0x107a4b=moment(_0x107a4b)[_0xbf73('0x31')](0x0,!![])['format']();_0x23e1e0=moment(_0x23e1e0)[_0xbf73('0x31')](0x0,!![])[_0xbf73('0x32')](0x17,'hours')[_0xbf73('0x32')](0x3b,'minutes')[_0xbf73('0x32')](0x3b,_0xbf73('0x33'))[_0xbf73('0x14')]();}_0x2452a8={'start':_0x107a4b,'end':_0x23e1e0};break;default:_0x2452a8[_0xbf73('0x2d')]=_0x107a4b;break;}return _0x2452a8;} \ No newline at end of file +var _0x9e3a=['start','$endsWith','utcOffset','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','and','replace','[$and]','split','length','slice','shift','match','forEach','indexOf','map','conditions','buildExpression','DATE','$eq','operator','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?'];(function(_0xa9ca8f,_0x9b109e){var _0x1ca345=function(_0xc23936){while(--_0xc23936){_0xa9ca8f['push'](_0xa9ca8f['shift']());}};_0x1ca345(++_0x9b109e);}(_0x9e3a,0x73));var _0xa9e3=function(_0x3e9542,_0x4de22f){_0x3e9542=_0x3e9542-0x0;var _0xc73c99=_0x9e3a[_0x3e9542];return _0xc73c99;};'use strict';var _=require(_0xa9e3('0x0'));var moment=require(_0xa9e3('0x1'));exports[_0xa9e3('0x2')]=function(_0xef661e){var _0x5d6efe={'conditions':[]};_0x5d6efe['sqlOperator']=_[_0xa9e3('0x3')](_0xef661e,_0xa9e3('0x4'))?'or':_0xa9e3('0x5');var _0x5350b9=_0xef661e[_0xa9e3('0x6')](_0xa9e3('0x7'),'')[_0xa9e3('0x6')](_0xa9e3('0x4'),'')[_0xa9e3('0x8')]('||');for(var _0x55107a=0x0;_0x55107a<_0x5350b9[_0xa9e3('0x9')];_0x55107a++){var _0x51cec4=_0x5350b9[_0x55107a][_0xa9e3('0x8')](':=');var _0x508c8b=_0x51cec4[0x0];var _0x3da030=_0x51cec4[_0xa9e3('0xa')](0x1);_0x3da030['forEach'](function(_0x39bd0b){var _0x40a5c1=_0x39bd0b[_0xa9e3('0x8')]('[')[_0xa9e3('0xb')]();var _0x202a0d=_0x39bd0b[_0xa9e3('0xc')](/\[(.*?)\]/g);_0x202a0d[_0xa9e3('0xd')](function(_0x5cd75d){var _0x50cb9a=_0x5cd75d[_0xa9e3('0x8')]('[')['filter'](function(_0x20bdc0){return _0x20bdc0[_0xa9e3('0xe')](']')>-0x1;})[_0xa9e3('0xf')](function(_0x2c393d){return _0x2c393d[_0xa9e3('0x8')](']')[0x0];})[0x0];_0x5d6efe[_0xa9e3('0x10')]['push']({'field':_0x508c8b,'operator':_0x40a5c1,'value':_0x50cb9a});});});}return _0x5d6efe;};exports[_0xa9e3('0x11')]=function(_0x173bf4,_0x2cdcfb,_0x3ab116){var _0x13154e={};if(_0x2cdcfb===_0xa9e3('0x12')){if(_0x3ab116['operator']===_0xa9e3('0x13')){_0x3ab116[_0xa9e3('0x14')]='$between';_0x3ab116[_0xa9e3('0x15')]+=','+_0x3ab116[_0xa9e3('0x15')];}else if(_[_0xa9e3('0x16')]([_0xa9e3('0x17'),_0xa9e3('0x18')],_0x3ab116[_0xa9e3('0x14')])){_0x3ab116[_0xa9e3('0x15')]=moment(_0x3ab116[_0xa9e3('0x15')])[_0xa9e3('0x19')](0x1,_0xa9e3('0x1a'))[_0xa9e3('0x1b')](_0xa9e3('0x1c'));}}if(_0x3ab116[_0xa9e3('0x1d')]){_0x2cdcfb=_0x3ab116[_0xa9e3('0x1d')];_0x13154e[_0xa9e3('0x1e')]=_0xa9e3('0x1f')+_0x173bf4+'.'+_0x3ab116[_0xa9e3('0x20')]+'\x20AS\x20'+_0x3ab116['castTo']+')\x20'+parseOperator(_0x3ab116[_0xa9e3('0x14')]);}else{_0x13154e[_0xa9e3('0x1e')]=_0x173bf4+'.'+_0x3ab116[_0xa9e3('0x20')]+'\x20'+parseOperator(_0x3ab116[_0xa9e3('0x14')]);}if(_[_0xa9e3('0x16')]([_0xa9e3('0x21'),_0xa9e3('0x22')],_0x3ab116[_0xa9e3('0x14')]))_0x13154e[_0xa9e3('0x1e')]='('+_0x13154e[_0xa9e3('0x1e')]+_0xa9e3('0x23')+_0x173bf4+'.'+_0x3ab116[_0xa9e3('0x20')]+'\x20IS\x20NULL)';_0x13154e[_0xa9e3('0x15')]=parseValue(_0x2cdcfb,_0x3ab116[_0xa9e3('0x14')],_0x3ab116['value']);return _0x13154e;};function parseOperator(_0x4c2388){var _0x4d8466;switch(_0x4c2388){case _0xa9e3('0x24'):_0x4d8466=_0xa9e3('0x25');break;case'$notIn':_0x4d8466=_0xa9e3('0x26');break;case'$eq':_0x4d8466=_0xa9e3('0x27');break;case _0xa9e3('0x21'):_0x4d8466=_0xa9e3('0x28');break;case'$substring':case _0xa9e3('0x29'):case'$endsWith':_0x4d8466=_0xa9e3('0x2a');break;case _0xa9e3('0x2b'):_0x4d8466=_0xa9e3('0x2c');break;case _0xa9e3('0x17'):_0x4d8466=_0xa9e3('0x2d');break;case _0xa9e3('0x18'):_0x4d8466=_0xa9e3('0x2e');break;case _0xa9e3('0x2f'):_0x4d8466='>=\x20?';break;case _0xa9e3('0x30'):_0x4d8466=_0xa9e3('0x31');break;}return _0x4d8466;}function parseValue(_0x37ab45,_0x19bf1a,_0x1823a1){var _0x5f2e80={'start':undefined,'end':undefined};switch(_0x19bf1a){case'$in':case _0xa9e3('0x22'):_0x5f2e80['start']=_0x1823a1[_0xa9e3('0x8')](',');break;case'$substring':_0x5f2e80[_0xa9e3('0x32')]='%'+_0x1823a1+'%';break;case _0xa9e3('0x29'):_0x5f2e80[_0xa9e3('0x32')]=_0x1823a1+'%';break;case _0xa9e3('0x33'):_0x5f2e80[_0xa9e3('0x32')]='%'+_0x1823a1;break;case _0xa9e3('0x30'):var _0xd47358=_0x1823a1[_0xa9e3('0x8')](',');var _0x1823a1=_0xd47358[_0xa9e3('0xb')]();var _0x54b9aa=_0xd47358['pop']();if(_0x37ab45===_0xa9e3('0x12')){_0x1823a1=moment(_0x1823a1)[_0xa9e3('0x34')](0x0,!![])[_0xa9e3('0x1b')]();_0x54b9aa=moment(_0x54b9aa)[_0xa9e3('0x34')](0x0,!![])[_0xa9e3('0x19')](0x17,'hours')[_0xa9e3('0x19')](0x3b,_0xa9e3('0x35'))[_0xa9e3('0x19')](0x3b,_0xa9e3('0x36'))[_0xa9e3('0x1b')]();}_0x5f2e80={'start':_0x1823a1,'end':_0x54b9aa};break;default:_0x5f2e80[_0xa9e3('0x32')]=_0x1823a1;break;}return _0x5f2e80;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 0e57018..3b51087 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 _0xf3a9=['model','intersection','attributes','nolimit','limit','order','where','pick','filter','merge','type','lower','options','moment','parse','keys','includes','fields','filters','forOwn','find','DATE','$gte','YYYY-MM-DD','utc','$lte','format','subtract','name','isArray','split','offset','sort','map','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','isEmpty','length','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','join','getOptions','query','$id'];(function(_0x138448,_0x1ba248){var _0xcabbb6=function(_0x44028a){while(--_0x44028a){_0x138448['push'](_0x138448['shift']());}};_0xcabbb6(++_0x1ba248);}(_0xf3a9,0x12a));var _0x9f3a=function(_0x531f6b,_0x461469){_0x531f6b=_0x531f6b-0x0;var _0x5d3b8b=_0xf3a9[_0x531f6b];return _0x5d3b8b;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0x9f3a('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2e8b8e){var _0x466f18=['ne'];try{var _0x1fdf7e=JSON[_0x9f3a('0x1')](_0x2e8b8e);var _0x42f894=Object[_0x9f3a('0x2')](_0x1fdf7e)[0x0];return _0x466f18[_0x9f3a('0x3')](_0x42f894);}catch(_0x1b26eb){return![];}}function getOperatorValue(_0x3bc60a){var _0x39b0db=JSON[_0x9f3a('0x1')](_0x3bc60a);var _0x4225a4=Object[_0x9f3a('0x2')](_0x39b0db)[0x0];var _0x1498dc=_0x39b0db[_0x4225a4];return{['$'+_0x4225a4]:_0x1498dc};}exports[_0x9f3a('0x4')]=function(_0x3da9d6){var _0x3461d2=null;if(_0x3da9d6){_0x3461d2=_0x3da9d6['split'](',');}return _0x3461d2;};exports[_0x9f3a('0x5')]=function(_0x251e4e,_0x2dedc0){var _0x400fbb={};if(!_['isEmpty'](_0x251e4e)){_[_0x9f3a('0x6')](_0x251e4e,function(_0xf20dd7,_0x3f080f){try{if(_0x2dedc0){var _0x1952f9=_[_0x9f3a('0x7')](_0x2dedc0,{'name':_0x3f080f})||{};if(hasSequelizeOperator(_0xf20dd7)){_0x400fbb[_0x3f080f]=getOperatorValue(_0xf20dd7);}else if(_0x1952f9['type']===_0x9f3a('0x8')&&_['isPlainObject'](_0xf20dd7)){var _0x79bb53=JSON[_0x9f3a('0x1')](_0xf20dd7);var _0x43fadd={'$gte':moment(moment(_0x79bb53[_0x9f3a('0x9')])['format'](_0x9f3a('0xa')))[_0x9f3a('0xb')]()['format'](),'$lte':moment(moment(_0x79bb53[_0x9f3a('0xc')])[_0x9f3a('0xd')](_0x9f3a('0xa')))[_0x9f3a('0xb')]()[_0x9f3a('0xe')](0x1,'s')[_0x9f3a('0xd')]()};_0x400fbb[_0x3f080f]=_0x43fadd;}else if(_0x1952f9[_0x9f3a('0xf')]==='uniqueid'){_0x400fbb[_0x3f080f]=_0xf20dd7;}else{_0x400fbb[_0x3f080f]=_[_0x9f3a('0x10')](_0xf20dd7)?_0xf20dd7:JSON[_0x9f3a('0x1')](_0xf20dd7);}}else{_0x400fbb[_0x3f080f]=_[_0x9f3a('0x10')](_0xf20dd7)?_0xf20dd7:JSON[_0x9f3a('0x1')](_0xf20dd7);}}catch(_0x2fb2c1){_0x400fbb[_0x3f080f]=_0xf20dd7[_0x9f3a('0x11')](',');}});}return _0x400fbb;};exports['limit']=function(_0x575a15){_0x575a15=parseInt(_0x575a15,0xa);if(!_0x575a15||_0x575a15<0x0){_0x575a15=LIMIT_VALUE;}return _0x575a15;};exports[_0x9f3a('0x12')]=function(_0x4c7462){_0x4c7462=parseInt(_0x4c7462,0xa);if(!_0x4c7462||_0x4c7462<0x0){_0x4c7462=0x0;}return _0x4c7462;};exports[_0x9f3a('0x13')]=function(_0x123770){var _0x315ac5,_0x2f6550=null;if(_0x123770){_0x315ac5=_0x123770[_0x9f3a('0x11')](',');_0x2f6550=_[_0x9f3a('0x14')](_0x315ac5,function(_0x264a4f){if(_0x264a4f[_0x9f3a('0x15')]('-')===0x0){return[_0x264a4f===_0x9f3a('0x16')?sequelize[_0x9f3a('0x17')](sequelize[_0x9f3a('0x18')](_0x9f3a('0x16')),_0x9f3a('0x19')):_0x264a4f['substr'](0x1),_0x9f3a('0x1a')];}else{return[_0x264a4f==='priority'?sequelize[_0x9f3a('0x17')](sequelize['col'](_0x9f3a('0x16')),_0x9f3a('0x19')):_0x264a4f,_0x9f3a('0x1b')];}});}return _0x2f6550;};exports[_0x9f3a('0x1c')]=function(_0x556efe,_0xbe188){if(_[_0x9f3a('0x1d')](_0x556efe)){return _0x556efe;}if(_[_0x9f3a('0x10')](_0x556efe)){for(var _0x4330c4=0x0;_0x4330c4<_0x556efe[_0x9f3a('0x1e')];_0x4330c4+=0x1){_0x556efe[_0x4330c4]=this[_0x9f3a('0x1c')](_0x556efe[_0x4330c4],_0xbe188);}return _0x556efe;}if(!_['isObject'](_0x556efe)){return _0x556efe;}if(_[_0x9f3a('0x1f')](_0xbe188)){_0xbe188=[_0xbe188];}if(!_[_0x9f3a('0x10')](_0xbe188)){return _0x556efe;}for(var _0x2e09df=0x0;_0x2e09df<_0xbe188[_0x9f3a('0x1e')];_0x2e09df+=0x1){_['unset'](_0x556efe,_0xbe188[_0x2e09df]);}for(var _0x301514 in _0x556efe){if(_0x556efe[_0x9f3a('0x20')](_0x301514)){_0x556efe[_0x301514]=this[_0x9f3a('0x1c')](_0x556efe[_0x301514],_0xbe188);}}return _0x556efe;};exports[_0x9f3a('0x21')]=function(_0x4e2212){return _0x4e2212[_0x9f3a('0x22')](RegExp(_0x9f3a('0x23')))?!![]:![];};exports[_0x9f3a('0x24')]=function(_0x1d82cb){return _0x1d82cb['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x9f3a('0x25')]=function(_0x11fe06){var _0x49af7d=[];_0x11fe06[_0x9f3a('0x11')](/[ ,]+/)[_0x9f3a('0x26')](function(_0x424713){_0x424713=_0x424713['replace'](/([^:]")"+/g,'$1');_0x424713='+'+_0x424713+'*';if(_0x424713[_0x9f3a('0x3')]('@'))_0x424713='\x22'+_0x424713+'\x22';_0x49af7d[_0x9f3a('0x27')](_0x424713);});return _0x49af7d[_0x9f3a('0x28')]('\x20');};exports[_0x9f3a('0x29')]=function(_0x33cc32,_0x6c8081,_0x16039b){var _0x4e2d1b={},_0x1d07ae={};if(_0x6c8081[_0x9f3a('0x2a')][_0x9f3a('0x2b')]){_0x6c8081[_0x9f3a('0x2a')]['id']=_0x6c8081[_0x9f3a('0x2a')][_0x9f3a('0x2b')];delete _0x6c8081[_0x9f3a('0x2a')][_0x9f3a('0x2b')];}_0x4e2d1b[_0x9f3a('0x2c')]=_[_0x9f3a('0x14')](_0x33cc32,'name');_0x4e2d1b[_0x9f3a('0x2a')]=_['keys'](_0x6c8081[_0x9f3a('0x2a')]);_0x4e2d1b[_0x9f3a('0x5')]=_[_0x9f3a('0x2d')](_0x4e2d1b[_0x9f3a('0x2c')],_0x4e2d1b['query']);_0x1d07ae[_0x9f3a('0x2e')]=_[_0x9f3a('0x2d')](_0x4e2d1b[_0x9f3a('0x2c')],this[_0x9f3a('0x4')](_0x6c8081[_0x9f3a('0x2a')]['fields']));_0x1d07ae['attributes']=_0x1d07ae[_0x9f3a('0x2e')][_0x9f3a('0x1e')]?_0x1d07ae[_0x9f3a('0x2e')]:_0x4e2d1b[_0x9f3a('0x2c')];if(!_0x6c8081[_0x9f3a('0x2a')][_0x9f3a('0x20')](_0x9f3a('0x2f'))){_0x1d07ae['limit']=this[_0x9f3a('0x30')](_0x6c8081['query'][_0x9f3a('0x30')]);_0x1d07ae['offset']=this['offset'](_0x6c8081['query'][_0x9f3a('0x12')]);}_0x1d07ae[_0x9f3a('0x31')]=this[_0x9f3a('0x13')](_0x6c8081[_0x9f3a('0x2a')][_0x9f3a('0x13')]);_0x1d07ae[_0x9f3a('0x32')]=this[_0x9f3a('0x5')](_[_0x9f3a('0x33')](_0x6c8081[_0x9f3a('0x2a')],_0x4e2d1b[_0x9f3a('0x5')]),_0x33cc32);if(_0x6c8081[_0x9f3a('0x2a')][_0x9f3a('0x34')]){_0x1d07ae[_0x9f3a('0x32')]=_[_0x9f3a('0x35')](_0x1d07ae[_0x9f3a('0x32')],{'$or':_[_0x9f3a('0x14')](_0x33cc32,function(_0x1da9c0){if(_0x1da9c0[_0x9f3a('0x36')]!=='VIRTUAL'){if(_0x16039b){return sequelize[_0x9f3a('0x32')](sequelize['fn'](_0x9f3a('0x37'),sequelize[_0x9f3a('0x18')](_0x1da9c0['name'])),{'$like':sequelize['fn'](_0x9f3a('0x37'),'%'+_0x6c8081['query']['filter']+'%')});}else{var _0x508c9c={};_0x508c9c[_0x1da9c0[_0x9f3a('0xf')]]={'$like':'%'+_0x6c8081[_0x9f3a('0x2a')]['filter']+'%'};return _0x508c9c;}}})});}_0x1d07ae=_[_0x9f3a('0x35')]({},_0x1d07ae,_0x6c8081[_0x9f3a('0x38')]);return _0x1d07ae;}; \ No newline at end of file +var _0xd17d=['^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','includes','join','getOptions','query','$id','model','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','lower','options','lodash','parse','keys','split','filters','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','col','unsigned','substr','DESC','cast','omit','length','isString','isNumeric','match'];(function(_0x6a3dee,_0x43c2a4){var _0x28b6bf=function(_0x3e98dd){while(--_0x3e98dd){_0x6a3dee['push'](_0x6a3dee['shift']());}};_0x28b6bf(++_0x43c2a4);}(_0xd17d,0x1e0));var _0xdd17=function(_0xddbe2,_0x45f95f){_0xddbe2=_0xddbe2-0x0;var _0x450ac5=_0xd17d[_0xddbe2];return _0x450ac5;};'use strict';var _=require(_0xdd17('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5397a5){var _0x88f4a0=['ne'];try{var _0x348899=JSON['parse'](_0x5397a5);var _0x2d9367=Object['keys'](_0x348899)[0x0];return _0x88f4a0['includes'](_0x2d9367);}catch(_0x3bcabc){return![];}}function getOperatorValue(_0x40cba4){var _0x105bea=JSON[_0xdd17('0x1')](_0x40cba4);var _0x582bd3=Object[_0xdd17('0x2')](_0x105bea)[0x0];var _0x3e26f1=_0x105bea[_0x582bd3];return{['$'+_0x582bd3]:_0x3e26f1};}exports['fields']=function(_0x586b30){var _0x689be=null;if(_0x586b30){_0x689be=_0x586b30[_0xdd17('0x3')](',');}return _0x689be;};exports[_0xdd17('0x4')]=function(_0x4edeed,_0x515443){var _0x29e4ed={};if(!_['isEmpty'](_0x4edeed)){_[_0xdd17('0x5')](_0x4edeed,function(_0x5ec6ad,_0x215778){try{if(_0x515443){var _0x53aeec=_[_0xdd17('0x6')](_0x515443,{'name':_0x215778})||{};if(hasSequelizeOperator(_0x5ec6ad)){_0x29e4ed[_0x215778]=getOperatorValue(_0x5ec6ad);}else if(_0x53aeec[_0xdd17('0x7')]===_0xdd17('0x8')&&_[_0xdd17('0x9')](_0x5ec6ad)){var _0x4b248f=JSON[_0xdd17('0x1')](_0x5ec6ad);var _0x148e5f={'$gte':moment(moment(_0x4b248f[_0xdd17('0xa')])[_0xdd17('0xb')](_0xdd17('0xc')))[_0xdd17('0xd')]()['format'](),'$lte':moment(moment(_0x4b248f[_0xdd17('0xe')])[_0xdd17('0xb')](_0xdd17('0xc')))[_0xdd17('0xd')]()['subtract'](0x1,'s')[_0xdd17('0xb')]()};_0x29e4ed[_0x215778]=_0x148e5f;}else if(_0x53aeec[_0xdd17('0xf')]===_0xdd17('0x10')){_0x29e4ed[_0x215778]=_0x5ec6ad;}else{_0x29e4ed[_0x215778]=_[_0xdd17('0x11')](_0x5ec6ad)?_0x5ec6ad:JSON[_0xdd17('0x1')](_0x5ec6ad);}}else{_0x29e4ed[_0x215778]=_[_0xdd17('0x11')](_0x5ec6ad)?_0x5ec6ad:JSON['parse'](_0x5ec6ad);}}catch(_0x4b0a0a){_0x29e4ed[_0x215778]=_0x5ec6ad['split'](',');}});}return _0x29e4ed;};exports[_0xdd17('0x12')]=function(_0x358574){_0x358574=parseInt(_0x358574,0xa);if(!_0x358574||_0x358574<0x0){_0x358574=LIMIT_VALUE;}return _0x358574;};exports[_0xdd17('0x13')]=function(_0x1ff4e4){_0x1ff4e4=parseInt(_0x1ff4e4,0xa);if(!_0x1ff4e4||_0x1ff4e4<0x0){_0x1ff4e4=0x0;}return _0x1ff4e4;};exports[_0xdd17('0x14')]=function(_0x1bd3fa){var _0x4c5bb5,_0x34172c=null;if(_0x1bd3fa){_0x4c5bb5=_0x1bd3fa[_0xdd17('0x3')](',');_0x34172c=_['map'](_0x4c5bb5,function(_0x1ce4f0){if(_0x1ce4f0[_0xdd17('0x15')]('-')===0x0){return[_0x1ce4f0===_0xdd17('0x16')?sequelize['cast'](sequelize[_0xdd17('0x17')](_0xdd17('0x16')),_0xdd17('0x18')):_0x1ce4f0[_0xdd17('0x19')](0x1),_0xdd17('0x1a')];}else{return[_0x1ce4f0===_0xdd17('0x16')?sequelize[_0xdd17('0x1b')](sequelize[_0xdd17('0x17')](_0xdd17('0x16')),'unsigned'):_0x1ce4f0,'ASC'];}});}return _0x34172c;};exports[_0xdd17('0x1c')]=function(_0x2382a0,_0x49db9d){if(_['isEmpty'](_0x2382a0)){return _0x2382a0;}if(_['isArray'](_0x2382a0)){for(var _0x1f035b=0x0;_0x1f035b<_0x2382a0[_0xdd17('0x1d')];_0x1f035b+=0x1){_0x2382a0[_0x1f035b]=this[_0xdd17('0x1c')](_0x2382a0[_0x1f035b],_0x49db9d);}return _0x2382a0;}if(!_['isObject'](_0x2382a0)){return _0x2382a0;}if(_[_0xdd17('0x1e')](_0x49db9d)){_0x49db9d=[_0x49db9d];}if(!_['isArray'](_0x49db9d)){return _0x2382a0;}for(var _0x587db9=0x0;_0x587db9<_0x49db9d[_0xdd17('0x1d')];_0x587db9+=0x1){_['unset'](_0x2382a0,_0x49db9d[_0x587db9]);}for(var _0x76bce3 in _0x2382a0){if(_0x2382a0['hasOwnProperty'](_0x76bce3)){_0x2382a0[_0x76bce3]=this[_0xdd17('0x1c')](_0x2382a0[_0x76bce3],_0x49db9d);}}return _0x2382a0;};exports[_0xdd17('0x1f')]=function(_0x3caf44){return _0x3caf44[_0xdd17('0x20')](RegExp(_0xdd17('0x21')))?!![]:![];};exports[_0xdd17('0x22')]=function(_0x254fba){return _0x254fba[_0xdd17('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0xdd17('0x23')]=function(_0x51e18d){var _0x512add=[];_0x51e18d['split'](/[ ,]+/)[_0xdd17('0x24')](function(_0x1e6ce1){_0x1e6ce1=_0x1e6ce1[_0xdd17('0x25')](/([^:]")"+/g,'$1');_0x1e6ce1='+'+_0x1e6ce1+'*';if(_0x1e6ce1[_0xdd17('0x26')]('@'))_0x1e6ce1='\x22'+_0x1e6ce1+'\x22';_0x512add['push'](_0x1e6ce1);});return _0x512add[_0xdd17('0x27')]('\x20');};exports[_0xdd17('0x28')]=function(_0x39d9f0,_0x226e0b,_0x145e81){var _0x586a62={},_0x41540b={};if(_0x226e0b[_0xdd17('0x29')][_0xdd17('0x2a')]){_0x226e0b['query']['id']=_0x226e0b['query'][_0xdd17('0x2a')];delete _0x226e0b[_0xdd17('0x29')][_0xdd17('0x2a')];}_0x586a62[_0xdd17('0x2b')]=_['map'](_0x39d9f0,_0xdd17('0xf'));_0x586a62[_0xdd17('0x29')]=_[_0xdd17('0x2')](_0x226e0b[_0xdd17('0x29')]);_0x586a62[_0xdd17('0x4')]=_[_0xdd17('0x2c')](_0x586a62[_0xdd17('0x2b')],_0x586a62['query']);_0x41540b[_0xdd17('0x2d')]=_[_0xdd17('0x2c')](_0x586a62[_0xdd17('0x2b')],this[_0xdd17('0x2e')](_0x226e0b['query'][_0xdd17('0x2e')]));_0x41540b[_0xdd17('0x2d')]=_0x41540b[_0xdd17('0x2d')][_0xdd17('0x1d')]?_0x41540b[_0xdd17('0x2d')]:_0x586a62[_0xdd17('0x2b')];if(!_0x226e0b['query'][_0xdd17('0x2f')](_0xdd17('0x30'))){_0x41540b['limit']=this[_0xdd17('0x12')](_0x226e0b[_0xdd17('0x29')]['limit']);_0x41540b['offset']=this[_0xdd17('0x13')](_0x226e0b[_0xdd17('0x29')][_0xdd17('0x13')]);}_0x41540b[_0xdd17('0x31')]=this[_0xdd17('0x14')](_0x226e0b['query'][_0xdd17('0x14')]);_0x41540b[_0xdd17('0x32')]=this[_0xdd17('0x4')](_[_0xdd17('0x33')](_0x226e0b['query'],_0x586a62['filters']),_0x39d9f0);if(_0x226e0b[_0xdd17('0x29')][_0xdd17('0x34')]){_0x41540b['where']=_[_0xdd17('0x35')](_0x41540b[_0xdd17('0x32')],{'$or':_[_0xdd17('0x36')](_0x39d9f0,function(_0x3f6840){if(_0x3f6840[_0xdd17('0x7')]!=='VIRTUAL'){if(_0x145e81){return sequelize['where'](sequelize['fn'](_0xdd17('0x37'),sequelize['col'](_0x3f6840[_0xdd17('0xf')])),{'$like':sequelize['fn'](_0xdd17('0x37'),'%'+_0x226e0b[_0xdd17('0x29')][_0xdd17('0x34')]+'%')});}else{var _0x135e8a={};_0x135e8a[_0x3f6840[_0xdd17('0xf')]]={'$like':'%'+_0x226e0b[_0xdd17('0x29')][_0xdd17('0x34')]+'%'};return _0x135e8a;}}})});}_0x41540b=_['merge']({},_0x41540b,_0x226e0b[_0xdd17('0x38')]);return _0x41540b;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 465e963..cd2786f 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x774d=['errorhandler','passport','moment','./environment','../mysqldb','default','get','env','appPath','public','development','test','join','root','client','use','set','json\x20replacer','toISOString','split','static','engine','ejs','renderFile','html','50mb','initialize','serve-favicon','body-parser','cookie-parser'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x774d,0x93));var _0xd774=function(_0x6aefff,_0xe3df93){_0x6aefff=_0x6aefff-0x0;var _0xeba47b=_0x774d[_0x6aefff];return _0xeba47b;};'use strict';var express=require('express');var favicon=require(_0xd774('0x0'));var bodyParser=require(_0xd774('0x1'));var methodOverride=require('method-override');var cookieParser=require(_0xd774('0x2'));var errorHandler=require(_0xd774('0x3'));var path=require('path');var passport=require(_0xd774('0x4'));var cors=require('cors');var moment=require(_0xd774('0x5'));var config=require(_0xd774('0x6'));var db=require(_0xd774('0x7'))['db'];exports[_0xd774('0x8')]=function(_0x2f4efd){var _0x5673e5=_0x2f4efd[_0xd774('0x9')](_0xd774('0xa'));if(_0x5673e5==='production'){_0x2f4efd['set'](_0xd774('0xb'),path['join'](config['root'],_0xd774('0xc')));}if(_0x5673e5===_0xd774('0xd')||_0x5673e5===_0xd774('0xe')){_0x2f4efd['set'](_0xd774('0xb'),path[_0xd774('0xf')](config[_0xd774('0x10')],_0xd774('0x11')));_0x2f4efd[_0xd774('0x12')](errorHandler());}_0x2f4efd[_0xd774('0x13')](_0xd774('0x14'),function(_0x4091c0,_0x23bcf4){if(this[_0x4091c0]instanceof Date){_0x23bcf4=this[_0x4091c0][_0xd774('0x15')]()[_0xd774('0x16')]('.')[0x0]+'Z';}return _0x23bcf4;});_0x2f4efd[_0xd774('0x12')](express[_0xd774('0x17')](_0x2f4efd[_0xd774('0x9')](_0xd774('0xb'))));_0x2f4efd[_0xd774('0x13')]('views',config[_0xd774('0x10')]+'/server/views');_0x2f4efd[_0xd774('0x18')]('html',require(_0xd774('0x19'))[_0xd774('0x1a')]);_0x2f4efd[_0xd774('0x13')]('view\x20engine',_0xd774('0x1b'));_0x2f4efd[_0xd774('0x12')](bodyParser['urlencoded']({'limit':_0xd774('0x1c'),'extended':!![]}));_0x2f4efd[_0xd774('0x12')](bodyParser['json']({'limit':_0xd774('0x1c')}));_0x2f4efd[_0xd774('0x12')](cors());_0x2f4efd[_0xd774('0x12')](methodOverride());_0x2f4efd[_0xd774('0x12')](cookieParser());_0x2f4efd['use'](passport[_0xd774('0x1d')]());}; \ No newline at end of file +var _0xc850=['set','appPath','join','public','development','test','root','client','use','toISOString','split','static','views','engine','ejs','renderFile','html','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','./environment','../mysqldb','default','get','env'];(function(_0x1204dc,_0x47e019){var _0x726b81=function(_0x4dfc9b){while(--_0x4dfc9b){_0x1204dc['push'](_0x1204dc['shift']());}};_0x726b81(++_0x47e019);}(_0xc850,0x10a));var _0x0c85=function(_0x7aeee4,_0x4c888c){_0x7aeee4=_0x7aeee4-0x0;var _0xcebaeb=_0xc850[_0x7aeee4];return _0xcebaeb;};'use strict';var express=require(_0x0c85('0x0'));var favicon=require(_0x0c85('0x1'));var bodyParser=require(_0x0c85('0x2'));var methodOverride=require(_0x0c85('0x3'));var cookieParser=require(_0x0c85('0x4'));var errorHandler=require(_0x0c85('0x5'));var path=require(_0x0c85('0x6'));var passport=require(_0x0c85('0x7'));var cors=require(_0x0c85('0x8'));var moment=require('moment');var config=require(_0x0c85('0x9'));var db=require(_0x0c85('0xa'))['db'];exports[_0x0c85('0xb')]=function(_0x15c8e6){var _0x362cd4=_0x15c8e6[_0x0c85('0xc')](_0x0c85('0xd'));if(_0x362cd4==='production'){_0x15c8e6[_0x0c85('0xe')](_0x0c85('0xf'),path[_0x0c85('0x10')](config['root'],_0x0c85('0x11')));}if(_0x362cd4===_0x0c85('0x12')||_0x362cd4===_0x0c85('0x13')){_0x15c8e6[_0x0c85('0xe')](_0x0c85('0xf'),path[_0x0c85('0x10')](config[_0x0c85('0x14')],_0x0c85('0x15')));_0x15c8e6[_0x0c85('0x16')](errorHandler());}_0x15c8e6['set']('json\x20replacer',function(_0x3476bb,_0x5c41af){if(this[_0x3476bb]instanceof Date){_0x5c41af=this[_0x3476bb][_0x0c85('0x17')]()[_0x0c85('0x18')]('.')[0x0]+'Z';}return _0x5c41af;});_0x15c8e6[_0x0c85('0x16')](express[_0x0c85('0x19')](_0x15c8e6['get'](_0x0c85('0xf'))));_0x15c8e6['set'](_0x0c85('0x1a'),config['root']+'/server/views');_0x15c8e6[_0x0c85('0x1b')]('html',require(_0x0c85('0x1c'))[_0x0c85('0x1d')]);_0x15c8e6[_0x0c85('0xe')]('view\x20engine',_0x0c85('0x1e'));_0x15c8e6[_0x0c85('0x16')](bodyParser[_0x0c85('0x1f')]({'limit':_0x0c85('0x20'),'extended':!![]}));_0x15c8e6[_0x0c85('0x16')](bodyParser[_0x0c85('0x21')]({'limit':_0x0c85('0x20')}));_0x15c8e6[_0x0c85('0x16')](cors());_0x15c8e6[_0x0c85('0x16')](methodOverride());_0x15c8e6[_0x0c85('0x16')](cookieParser());_0x15c8e6[_0x0c85('0x16')](passport[_0x0c85('0x22')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index c0dee29..a95d9bd 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 _0x0e63=['update','digest','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','keys','length','filter','family','IPv4','internal','concat','mac','address','getFirstInterface','cpus','join','createHash','md5'];(function(_0x315611,_0x2d376e){var _0x3884ba=function(_0x3d9aa1){while(--_0x3d9aa1){_0x315611['push'](_0x315611['shift']());}};_0x3884ba(++_0x2d376e);}(_0x0e63,0x96));var _0x30e6=function(_0x323f5e,_0x5f322b){_0x323f5e=_0x323f5e-0x0;var _0x376117=_0x0e63[_0x323f5e];return _0x376117;};'use strict';var _=require(_0x30e6('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x30e6('0x1'));var exec=require(_0x30e6('0x2'))[_0x30e6('0x3')];var config=require(_0x30e6('0x4'));function getInterfaces(){var _0x2a4777=[];var _0xacd13e=os['networkInterfaces']();var _0x149765=_[_0x30e6('0x5')](_[_0x30e6('0x6')](_0xacd13e));for(var _0x5a554f=0x0;_0x5a554f<_0x149765[_0x30e6('0x7')];_0x5a554f++){var _0x566ac8=_0xacd13e[_0x149765[_0x5a554f]][_0x30e6('0x8')](function(_0x5e8e14){return _0x5e8e14[_0x30e6('0x9')]===_0x30e6('0xa')&&_0x5e8e14[_0x30e6('0xb')]===![];});_0x2a4777=_0x2a4777[_0x30e6('0xc')](_0x566ac8);}return _0x2a4777;}function getFirstInterface(){var _0x1f78c0=_['head'](getInterfaces());return{'macAddress':_0x1f78c0&&_0x1f78c0[_0x30e6('0xd')]?_0x1f78c0[_0x30e6('0xd')]:'00:00:00:00:00:00','ipAddress':_0x1f78c0&&_0x1f78c0[_0x30e6('0xe')]?_0x1f78c0[_0x30e6('0xe')]:'127.0.0.1'};}exports[_0x30e6('0xf')]=getFirstInterface;function getCPUhash(){var _0x4ba176=_[_0x30e6('0x5')](os[_0x30e6('0x10')]()['map'](function(_0x4e33ab){return _0x4e33ab['model'];}))[_0x30e6('0x11')](':');return crypto[_0x30e6('0x12')](_0x30e6('0x13'))[_0x30e6('0x14')](_0x4ba176)[_0x30e6('0x15')](_0x30e6('0x16'));}exports[_0x30e6('0x17')]=function(){var _0xbb1423=os[_0x30e6('0x18')]();var _0x4541d2=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4541d2[_0x30e6('0x19')](config['licenseToken'])){return config[_0x30e6('0x1a')];}else if(_0xbb1423===_0x30e6('0x1b')){return exec(_0x30e6('0x1c'),{'encoding':_0x30e6('0x1d')})['replace']('\x0d\x0a','');}else{var _0x3308a0=getFirstInterface();var _0x392dcd=getCPUhash();var _0x513eec=_0x392dcd+'|'+os[_0x30e6('0x1e')]()+'|'+_0x3308a0[_0x30e6('0x1f')]+'|'+_0x3308a0[_0x30e6('0x20')];var _0x284da7=crypto[_0x30e6('0x12')](_0x30e6('0x13'))['update'](_0x513eec)[_0x30e6('0x15')](_0x30e6('0x16'));return _0x284da7[_0x30e6('0x21')](0x0,0x8)+'-'+_0x284da7[_0x30e6('0x21')](0x8,0xc)+'-'+_0x284da7['substring'](0xc,0x10)+'-'+_0x284da7[_0x30e6('0x21')](0x10,0x14)+'-'+_0x284da7[_0x30e6('0x21')](0x14);}}; \ No newline at end of file +var _0xa69a=['ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','orderBy','keys','filter','family','internal','concat','head','mac','address','127.0.0.1','map','join','md5','update','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress'];(function(_0x30a956,_0x11222e){var _0x2ac17d=function(_0x3be1d2){while(--_0x3be1d2){_0x30a956['push'](_0x30a956['shift']());}};_0x2ac17d(++_0x11222e);}(_0xa69a,0x12c));var _0xaa69=function(_0x59e773,_0x140b7a){_0x59e773=_0x59e773-0x0;var _0x32dd67=_0xa69a[_0x59e773];return _0x32dd67;};'use strict';var _=require(_0xaa69('0x0'));var os=require('os');var crypto=require(_0xaa69('0x1'));var machine=require(_0xaa69('0x2'));var exec=require(_0xaa69('0x3'))['execSync'];var config=require(_0xaa69('0x4'));function getInterfaces(){var _0x438b60=[];var _0x199e35=os['networkInterfaces']();var _0x3da018=_[_0xaa69('0x5')](_[_0xaa69('0x6')](_0x199e35));for(var _0x4e6c25=0x0;_0x4e6c25<_0x3da018['length'];_0x4e6c25++){var _0x1c3849=_0x199e35[_0x3da018[_0x4e6c25]][_0xaa69('0x7')](function(_0x4c5052){return _0x4c5052[_0xaa69('0x8')]==='IPv4'&&_0x4c5052[_0xaa69('0x9')]===![];});_0x438b60=_0x438b60[_0xaa69('0xa')](_0x1c3849);}return _0x438b60;}function getFirstInterface(){var _0x19cf47=_[_0xaa69('0xb')](getInterfaces());return{'macAddress':_0x19cf47&&_0x19cf47[_0xaa69('0xc')]?_0x19cf47[_0xaa69('0xc')]:'00:00:00:00:00:00','ipAddress':_0x19cf47&&_0x19cf47[_0xaa69('0xd')]?_0x19cf47['address']:_0xaa69('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x283b4c=_[_0xaa69('0x5')](os['cpus']()[_0xaa69('0xf')](function(_0x42324b){return _0x42324b['model'];}))[_0xaa69('0x10')](':');return crypto['createHash'](_0xaa69('0x11'))[_0xaa69('0x12')](_0x283b4c)[_0xaa69('0x13')](_0xaa69('0x14'));}exports[_0xaa69('0x15')]=function(){var _0x2b4cb=os[_0xaa69('0x16')]();var _0x4a0a93=/[0-9a-f-]{36}/;if(config[_0xaa69('0x17')]&&_0x4a0a93['test'](config[_0xaa69('0x17')])){return config[_0xaa69('0x17')];}else if(_0x2b4cb===_0xaa69('0x18')){return exec(_0xaa69('0x19'),{'encoding':_0xaa69('0x1a')})[_0xaa69('0x1b')]('\x0d\x0a','');}else{var _0x146535=getFirstInterface();var _0x3c2cfe=getCPUhash();var _0x362ad4=_0x3c2cfe+'|'+os[_0xaa69('0x1c')]()+'|'+_0x146535[_0xaa69('0x1d')]+'|'+_0x146535[_0xaa69('0x1e')];var _0x242a30=crypto[_0xaa69('0x1f')](_0xaa69('0x11'))[_0xaa69('0x12')](_0x362ad4)[_0xaa69('0x13')](_0xaa69('0x14'));return _0x242a30[_0xaa69('0x20')](0x0,0x8)+'-'+_0x242a30['substring'](0x8,0xc)+'-'+_0x242a30[_0xaa69('0x20')](0xc,0x10)+'-'+_0x242a30['substring'](0x10,0x14)+'-'+_0x242a30['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1638a19..b073354 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 _0x1429=['../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','version','../../mysqldb'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x1429,0x194));var _0x9142=function(_0x20105f,_0xf3ff25){_0x20105f=_0x20105f-0x0;var _0x4026de=_0x1429[_0x20105f];return _0x4026de;};'use strict';var util=require(_0x9142('0x0'));var moment=require(_0x9142('0x1'));var rp=require(_0x9142('0x2'));var BPromise=require(_0x9142('0x3'));var pkginfo=require('pkginfo')(module,_0x9142('0x4'));var db=require(_0x9142('0x5'))['db'];var encryptor=require(_0x9142('0x6'));var hardware=require('./hardware');var logger=require(_0x9142('0x7'))(_0x9142('0x8'));var HOST=_0x9142('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x53d911){return new BPromise(function(_0x1debbd,_0xdafe5d){var _0x2902f6=util[_0x9142('0xa')](_0x9142('0xb'),HOST,_0x53d911,module[_0x9142('0xc')][_0x9142('0x4')]);if(oldToken){_0x2902f6=util[_0x9142('0xa')](_0x9142('0xd'),HOST,_0x53d911,module[_0x9142('0xc')]['version'],oldToken);}var _0x56ddf8={'uri':_0x2902f6,'method':_0x9142('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x56ddf8)[_0x9142('0xf')](function(_0x4f0d66){_0x1debbd(_0x4f0d66);})[_0x9142('0x10')](function(_0x4179a2){_0xdafe5d(_0x4179a2);});});}function manageLicense(_0x5d23df,_0x455757){var _0x3c6a93=_0x455757[_0x9142('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x3c6a93[_0x9142('0x12')]!==_0x5d23df&&!_0x3c6a93['data2']){oldToken=_0x3c6a93[_0x9142('0x12')];}httpRequest(_0x5d23df)[_0x9142('0xf')](function(_0x11c99f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x11c99f[_0x9142('0x13')]){isOldTokenSent=![];if(!_0x3c6a93[_0x9142('0x8')]&&_0x3c6a93[_0x9142('0x8')]!=_0x11c99f[_0x9142('0x8')]||_0x3c6a93[_0x9142('0x8')]&&_0x3c6a93['data2']){logger[_0x9142('0x14')](_0x9142('0x15'));}if(_0x3c6a93[_0x9142('0x8')]&&!_0x3c6a93[_0x9142('0x16')]&&_0x3c6a93[_0x9142('0x8')]!=_0x11c99f[_0x9142('0x8')]){logger[_0x9142('0x14')](_0x9142('0x17'));}if(_0x3c6a93[_0x9142('0x8')]&&!_0x3c6a93[_0x9142('0x16')]&&_0x3c6a93['license']==_0x11c99f[_0x9142('0x8')]){return _0x455757;}return _0x455757[_0x9142('0x18')]({'data1':_0x5d23df,'data2':null,'license':_0x11c99f[_0x9142('0x8')]});}else{if(_0x11c99f['license']||_0x3c6a93['license']){if(!_0x3c6a93[_0x9142('0x16')]){if(_0x3c6a93[_0x9142('0x12')]==_0x5d23df){GRAY_PERIOD_REASON='Disabled';logger[_0x9142('0x14')](_0x9142('0x19'));}else{GRAY_PERIOD_REASON=_0x9142('0x1a');logger[_0x9142('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3c6a93[_0x9142('0x12')],_0x5d23df);}logger[_0x9142('0x14')](_0x9142('0x1b'),GRAY_PERIOD_REASON[_0x9142('0x1c')](),moment()[_0x9142('0xa')](_0x9142('0x1d')));return _0x455757[_0x9142('0x18')]({'data2':encryptor['encryptString'](moment()[_0x9142('0xa')](_0x9142('0x1d')))});}else{if(moment()[_0x9142('0x1e')](encryptor['decryptString'](_0x3c6a93[_0x9142('0x16')]),_0x9142('0x1f'))>DAYS){logger[_0x9142('0x14')](_0x9142('0x20'),moment()[_0x9142('0xa')](_0x9142('0x1d')));isOldTokenSent=![];return _0x455757[_0x9142('0x18')]({'data1':_0x5d23df,'data2':null,'license':null});}}}else{if(_0x3c6a93['data1']!=_0x5d23df){logger[_0x9142('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3c6a93[_0x9142('0x12')],_0x5d23df);return _0x455757[_0x9142('0x18')]({'data1':_0x5d23df,'data2':null,'license':null});}}}return _0x455757;})['then'](function(_0x28c9d6){_0x455757=_0x28c9d6;})[_0x9142('0x10')](function(_0x28629f){logger[_0x9142('0x21')](_0x28629f[_0x9142('0x22')]);})[_0x9142('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x9142('0x24')](),_0x455757);},TIME);});}function defaultLicense(){var _0x25f17d=hardware['getUuid']();if(_0x25f17d){return db[_0x9142('0x25')][_0x9142('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x25f17d}})[_0x9142('0x27')](function(_0x34c124,_0xa22eba){logger[_0x9142('0x14')](_0x9142('0x28'),_0x25f17d);manageLicense(_0x25f17d,_0x34c124);})[_0x9142('0x10')](function(_0x4f498c){logger[_0x9142('0x21')](_0x4f498c[_0x9142('0x22')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xde46=['%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','exports','GET','get','data1','then','active','data2','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','info'];(function(_0x30610a,_0x42156d){var _0x394352=function(_0xadd469){while(--_0xadd469){_0x30610a['push'](_0x30610a['shift']());}};_0x394352(++_0x42156d);}(_0xde46,0x162));var _0x6de4=function(_0xf7c389,_0x57c14e){_0xf7c389=_0xf7c389-0x0;var _0x157e71=_0xde46[_0xf7c389];return _0x157e71;};'use strict';var util=require(_0x6de4('0x0'));var moment=require(_0x6de4('0x1'));var rp=require(_0x6de4('0x2'));var BPromise=require(_0x6de4('0x3'));var pkginfo=require(_0x6de4('0x4'))(module,_0x6de4('0x5'));var db=require(_0x6de4('0x6'))['db'];var encryptor=require(_0x6de4('0x7'));var hardware=require(_0x6de4('0x8'));var logger=require('../logger')(_0x6de4('0x9'));var HOST=_0x6de4('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x16867e){return new BPromise(function(_0xa5108b,_0x4e10fe){var _0x4f5272=util[_0x6de4('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x16867e,module[_0x6de4('0xc')][_0x6de4('0x5')]);if(oldToken){_0x4f5272=util[_0x6de4('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x16867e,module[_0x6de4('0xc')][_0x6de4('0x5')],oldToken);}var _0x3265f9={'uri':_0x4f5272,'method':_0x6de4('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x3265f9)['then'](function(_0x5b647d){_0xa5108b(_0x5b647d);})['catch'](function(_0x1c3f47){_0x4e10fe(_0x1c3f47);});});}function manageLicense(_0x496ba2,_0x2b24ac){var _0x452695=_0x2b24ac[_0x6de4('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x452695['data1']!==_0x496ba2&&!_0x452695['data2']){oldToken=_0x452695[_0x6de4('0xf')];}httpRequest(_0x496ba2)[_0x6de4('0x10')](function(_0x5e8cb8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5e8cb8[_0x6de4('0x11')]){isOldTokenSent=![];if(!_0x452695[_0x6de4('0x9')]&&_0x452695[_0x6de4('0x9')]!=_0x5e8cb8[_0x6de4('0x9')]||_0x452695[_0x6de4('0x9')]&&_0x452695[_0x6de4('0x12')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x452695['license']&&!_0x452695[_0x6de4('0x12')]&&_0x452695['license']!=_0x5e8cb8[_0x6de4('0x9')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x452695[_0x6de4('0x9')]&&!_0x452695[_0x6de4('0x12')]&&_0x452695[_0x6de4('0x9')]==_0x5e8cb8[_0x6de4('0x9')]){return _0x2b24ac;}return _0x2b24ac[_0x6de4('0x13')]({'data1':_0x496ba2,'data2':null,'license':_0x5e8cb8[_0x6de4('0x9')]});}else{if(_0x5e8cb8[_0x6de4('0x9')]||_0x452695[_0x6de4('0x9')]){if(!_0x452695['data2']){if(_0x452695[_0x6de4('0xf')]==_0x496ba2){GRAY_PERIOD_REASON=_0x6de4('0x14');logger['info'](_0x6de4('0x15'));}else{GRAY_PERIOD_REASON=_0x6de4('0x16');logger[_0x6de4('0x17')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x452695[_0x6de4('0xf')],_0x496ba2);}logger[_0x6de4('0x17')](_0x6de4('0x18'),GRAY_PERIOD_REASON[_0x6de4('0x19')](),moment()[_0x6de4('0xb')](_0x6de4('0x1a')));return _0x2b24ac[_0x6de4('0x13')]({'data2':encryptor[_0x6de4('0x1b')](moment()[_0x6de4('0xb')](_0x6de4('0x1a')))});}else{if(moment()['diff'](encryptor[_0x6de4('0x1c')](_0x452695[_0x6de4('0x12')]),_0x6de4('0x1d'))>DAYS){logger[_0x6de4('0x17')](_0x6de4('0x1e'),moment()[_0x6de4('0xb')](_0x6de4('0x1a')));isOldTokenSent=![];return _0x2b24ac[_0x6de4('0x13')]({'data1':_0x496ba2,'data2':null,'license':null});}}}else{if(_0x452695[_0x6de4('0xf')]!=_0x496ba2){logger['info'](_0x6de4('0x1f'),_0x452695[_0x6de4('0xf')],_0x496ba2);return _0x2b24ac[_0x6de4('0x13')]({'data1':_0x496ba2,'data2':null,'license':null});}}}return _0x2b24ac;})[_0x6de4('0x10')](function(_0x20935d){_0x2b24ac=_0x20935d;})[_0x6de4('0x20')](function(_0x1bab20){logger[_0x6de4('0x21')](_0x1bab20['message']);})[_0x6de4('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x6de4('0x23')](),_0x2b24ac);},TIME);});}function defaultLicense(){var _0x24d08f=hardware['getUuid']();if(_0x24d08f){return db[_0x6de4('0x24')][_0x6de4('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x24d08f}})[_0x6de4('0x26')](function(_0x1fedef,_0x1c980b){logger[_0x6de4('0x17')](_0x6de4('0x27'),_0x24d08f);manageLicense(_0x24d08f,_0x1fedef);})['catch'](function(_0x3015c9){logger[_0x6de4('0x21')](_0x3015c9[_0x6de4('0x28')]);});}}exports[_0x6de4('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 26c7296..932102e 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 _0x2f38=['exports','util','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','catch','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','deadline','add','grayReason','changed','message','User','findAll','role','sequelize','col','admin','user','telephone','users','telephones','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2f38,0x1cd));var _0x82f3=function(_0x1569a7,_0x5bcbe5){_0x1569a7=_0x1569a7-0x0;var _0x275672=_0x2f38[_0x1569a7];return _0x275672;};'use strict';var util=require(_0x82f3('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0x82f3('0x1'));var hardware=require(_0x82f3('0x2'));var encryptor=require(_0x82f3('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x82f3('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x82f3('0x5'),'machineUuid':hardware[_0x82f3('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x82f3('0x7'),'machineUuid':hardware[_0x82f3('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2275fd){return new BPromise(function(_0x5e85ee,_0x3de2e6){return db[_0x82f3('0x8')]['find'](_[_0x82f3('0x9')](_0x2275fd,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x36833f){return checkLicense(_0x36833f,null);})[_0x82f3('0xa')](function(_0x11db54){_0x5e85ee(_0x11db54);return;})[_0x82f3('0xb')](function(_0x54b8c6){_0x3de2e6(_0x54b8c6);});});}function checkLicense(_0x5e34a0,_0x33aa4c){if(!_0x5e34a0){demoLicense['uuid']=_0x5e34a0[_0x82f3('0xc')];return demoLicense;}try{var _0x10fb50=_0x33aa4c||_0x5e34a0[_0x82f3('0xd')];if(_[_0x82f3('0xe')](_0x10fb50)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x901df3=_0x5e34a0[_0x82f3('0xc')];var _0x49de31=_0x5e34a0[_0x82f3('0xf')];var _0x5be0fa=_0x901df3[_0x82f3('0x10')]('-')[0x4];var _0x59a0a7=_0x901df3[_0x82f3('0x10')]('-')[0x0];var _0x28751d=encryptor[_0x82f3('0x11')](_0x10fb50,util[_0x82f3('0x12')](_0x82f3('0x13'),_0x5be0fa,_0x901df3,_0x59a0a7));var _0xe5b385=JSON[_0x82f3('0x14')](_0x28751d);_0xe5b385[_0x82f3('0x15')]=![];_0xe5b385[_0x82f3('0x16')]=_0x901df3;_0xe5b385[_0x82f3('0x17')]=hardware[_0x82f3('0x6')]();if(_0x49de31){var _0x71ba27=encryptor[_0x82f3('0x11')](_0x49de31);_0xe5b385['gray']=_0x71ba27;_0xe5b385[_0x82f3('0x18')]=moment(_0x71ba27)[_0x82f3('0x19')](0x7,'days')[_0x82f3('0x12')]();_0xe5b385[_0x82f3('0x1a')]=_0xe5b385[_0x82f3('0x16')]!=_0xe5b385[_0x82f3('0x17')]?_0x82f3('0x1b'):'disabled';}return _0xe5b385;}catch(_0x219581){breakingLicense[_0x82f3('0x16')]=_0x5e34a0[_0x82f3('0xc')];breakingLicense[_0x82f3('0x1c')]=_0x219581[_0x82f3('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x586b96,_0x2e959c){getLicense()['then'](function(_0x19978e){return db[_0x82f3('0x1d')][_0x82f3('0x1e')]({'attributes':[_0x82f3('0x1f'),[db[_0x82f3('0x20')]['fn']('COUNT',db[_0x82f3('0x20')][_0x82f3('0x21')](_0x82f3('0x1f'))),'count']],'group':_0x82f3('0x1f'),'where':{'role':{'$or':[_0x82f3('0x22'),_0x82f3('0x23'),_0x82f3('0x24')]}},'raw':!![]})[_0x82f3('0xa')](function(_0xd641ce){var _0x30643a={'user':_0x19978e[_0x82f3('0x25')]||0x0,'telephone':_0x19978e[_0x82f3('0x26')]||0x0};_0xd641ce[_0x82f3('0x27')](function(_0x309af9){var _0x5a3b75=_0x309af9[_0x82f3('0x1f')]===_0x82f3('0x22')?'user':_0x309af9[_0x82f3('0x1f')];_0x30643a[_0x5a3b75]-=_0x309af9[_0x82f3('0x28')];if(_0x30643a[_0x5a3b75]<0x0)_0x30643a[_0x5a3b75]=0x0;});_0x586b96(_0x30643a);return;});})[_0x82f3('0xb')](function(_0x30e28d){_0x2e959c(_0x30e28d);});});}function checkUserLimits(_0x4295fc){return new BPromise(function(_0xb59dc8,_0x1f782b){getLimits()[_0x82f3('0xa')](function(_0x11f2b2){var _0x11c625=_[_0x82f3('0x29')](_[_0x82f3('0x2a')](_0x4295fc,_0x82f3('0x1f')),[_0x82f3('0x22'),_0x82f3('0x23'),_0x82f3('0x24')]);var _0xa6e754=(_0x11c625[_0x82f3('0x22')]||0x0)+(_0x11c625[_0x82f3('0x23')]||0x0);var _0x36fe2c=_0x11c625[_0x82f3('0x24')]||0x0;if(_0xa6e754>_0x11f2b2['user'])return _0x1f782b(_0x82f3('0x2b'));if(_0x36fe2c>_0x11f2b2[_0x82f3('0x24')])return _0x1f782b(_0x82f3('0x2c'));return _0xb59dc8();})['catch'](function(_0x5e88ed){_0x1f782b(_0x5e88ed);});});}module[_0x82f3('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x498f=['COUNT','col','count','admin','user','users','telephones','forEach','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','then','catch','uuid','data1','data2','split','decryptString','format','%s:%s:%s','parse','demo','gray','deadline','add','days','machineUuid','disabled','message','User','role','sequelize'];(function(_0x37566c,_0xa72355){var _0x1f4366=function(_0xfb6d88){while(--_0xfb6d88){_0x37566c['push'](_0x37566c['shift']());}};_0x1f4366(++_0xa72355);}(_0x498f,0x1a3));var _0xf498=function(_0x1253dc,_0x32cc5d){_0x1253dc=_0x1253dc-0x0;var _0x320055=_0x498f[_0x1253dc];return _0x320055;};'use strict';var util=require(_0xf498('0x0'));var _=require(_0xf498('0x1'));var moment=require(_0xf498('0x2'));var BPromise=require('bluebird');var hardware=require(_0xf498('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0xf498('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf498('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xf498('0x6'),'machineUuid':hardware[_0xf498('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xf498('0x8'),'machineUuid':hardware[_0xf498('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3c0276){return new BPromise(function(_0x13af2a,_0x23eac9){return db[_0xf498('0x9')]['find'](_['defaults'](_0x3c0276,{'raw':!![],'where':{'id':0x1}}))[_0xf498('0xa')](function(_0x2d3553){return checkLicense(_0x2d3553,null);})[_0xf498('0xa')](function(_0x58371c){_0x13af2a(_0x58371c);return;})[_0xf498('0xb')](function(_0x307023){_0x23eac9(_0x307023);});});}function checkLicense(_0x556621,_0x55c7ff){if(!_0x556621){demoLicense[_0xf498('0xc')]=_0x556621[_0xf498('0xd')];return demoLicense;}try{var _0x1630f5=_0x55c7ff||_0x556621['license'];if(_['isEmpty'](_0x1630f5)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x44d6e4=_0x556621[_0xf498('0xd')];var _0x5879b9=_0x556621[_0xf498('0xe')];var _0x3805cc=_0x44d6e4[_0xf498('0xf')]('-')[0x4];var _0x110887=_0x44d6e4['split']('-')[0x0];var _0x59a021=encryptor[_0xf498('0x10')](_0x1630f5,util[_0xf498('0x11')](_0xf498('0x12'),_0x3805cc,_0x44d6e4,_0x110887));var _0x884c32=JSON[_0xf498('0x13')](_0x59a021);_0x884c32[_0xf498('0x14')]=![];_0x884c32['uuid']=_0x44d6e4;_0x884c32['machineUuid']=hardware[_0xf498('0x7')]();if(_0x5879b9){var _0x2b32c7=encryptor['decryptString'](_0x5879b9);_0x884c32[_0xf498('0x15')]=_0x2b32c7;_0x884c32[_0xf498('0x16')]=moment(_0x2b32c7)[_0xf498('0x17')](0x7,_0xf498('0x18'))[_0xf498('0x11')]();_0x884c32['grayReason']=_0x884c32[_0xf498('0xc')]!=_0x884c32[_0xf498('0x19')]?'changed':_0xf498('0x1a');}return _0x884c32;}catch(_0xdb5855){breakingLicense[_0xf498('0xc')]=_0x556621[_0xf498('0xd')];breakingLicense[_0xf498('0x1b')]=_0xdb5855[_0xf498('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xcc23a,_0x32fb78){getLicense()['then'](function(_0x248d85){return db[_0xf498('0x1c')]['findAll']({'attributes':[_0xf498('0x1d'),[db[_0xf498('0x1e')]['fn'](_0xf498('0x1f'),db['sequelize'][_0xf498('0x20')](_0xf498('0x1d'))),_0xf498('0x21')]],'group':'role','where':{'role':{'$or':[_0xf498('0x22'),_0xf498('0x23'),'telephone']}},'raw':!![]})[_0xf498('0xa')](function(_0x5b88c0){var _0x244594={'user':_0x248d85[_0xf498('0x24')]||0x0,'telephone':_0x248d85[_0xf498('0x25')]||0x0};_0x5b88c0[_0xf498('0x26')](function(_0x3265b8){var _0x204182=_0x3265b8[_0xf498('0x1d')]==='admin'?'user':_0x3265b8[_0xf498('0x1d')];_0x244594[_0x204182]-=_0x3265b8['count'];if(_0x244594[_0x204182]<0x0)_0x244594[_0x204182]=0x0;});_0xcc23a(_0x244594);return;});})[_0xf498('0xb')](function(_0x31d17d){_0x32fb78(_0x31d17d);});});}function checkUserLimits(_0x17db38){return new BPromise(function(_0x37c3c6,_0xa72569){getLimits()[_0xf498('0xa')](function(_0x68c10f){var _0x3f4149=_[_0xf498('0x27')](_[_0xf498('0x28')](_0x17db38,'role'),[_0xf498('0x22'),_0xf498('0x23'),_0xf498('0x29')]);var _0x208eb6=(_0x3f4149[_0xf498('0x22')]||0x0)+(_0x3f4149[_0xf498('0x23')]||0x0);var _0x82bef8=_0x3f4149[_0xf498('0x29')]||0x0;if(_0x208eb6>_0x68c10f['user'])return _0xa72569(_0xf498('0x2a'));if(_0x82bef8>_0x68c10f[_0xf498('0x29')])return _0xa72569(_0xf498('0x2b'));return _0x37c3c6();})['catch'](function(_0x5c5dab){_0xa72569(_0x5c5dab);});});}module[_0xf498('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index b224ccb..ec82150 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 _0x8f59=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x8f59,0x11d));var _0x98f5=function(_0x424663,_0xfa30f0){_0x424663=_0x424663-0x0;var _0x35b493=_0x8f59[_0x424663];return _0x35b493;};'use strict';module[_0x98f5('0x0')]={'DOMAIN':_0x98f5('0x1'),'SESSION_SECRET':_0x98f5('0x2'),'GOOGLE_ID':_0x98f5('0x3'),'GOOGLE_SECRET':_0x98f5('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x236c=['secret','exports','myappanuglar-secret','app-id'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x236c,0x155));var _0xc236=function(_0x1aa802,_0x1d5d82){_0x1aa802=_0x1aa802-0x0;var _0x26bd36=_0x236c[_0x1aa802];return _0x26bd36;};'use strict';module[_0xc236('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xc236('0x1'),'GOOGLE_ID':_0xc236('0x2'),'GOOGLE_SECRET':_0xc236('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index ca58e02..92b09d1 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1246=['info','env','debugLevel','moment','winston','INFO','join','/var','xcally','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','File','%s-%s','error','transports'];(function(_0x536256,_0x237fb5){var _0x1675f7=function(_0x339198){while(--_0x339198){_0x536256['push'](_0x536256['shift']());}};_0x1675f7(++_0x237fb5);}(_0x1246,0x10b));var _0x6124=function(_0x3ca0e9,_0x5d74b5){_0x3ca0e9=_0x3ca0e9-0x0;var _0xd1f0=_0x1246[_0x3ca0e9];return _0xd1f0;};'use strict';var moment=require(_0x6124('0x0'));var winston=require(_0x6124('0x1'));var util=require('util');var path=require('path');var debugLevel=_0x6124('0x2');function filename(_0x80b18b,_0x466c1d){return path[_0x6124('0x3')](_0x6124('0x4'),'log',_0x6124('0x5'),util['format'](_0x6124('0x6'),_0x80b18b,_0x466c1d));}function formatter(_0x51474f,_0x3f9123){_0x3f9123['message']=_0x3f9123[_0x6124('0x7')][_0x6124('0x8')](/@@{/g,_0x6124('0x9'))[_0x6124('0x8')](/}@@/g,_0x6124('0xa'))[_0x6124('0x8')](/@{/g,'{{')[_0x6124('0x8')](/}@/g,'}}');return util[_0x6124('0xb')](_0x6124('0xc'),moment()[_0x6124('0xb')](_0x6124('0xd')),_0x3f9123[_0x6124('0xe')][_0x6124('0xf')](),_0x51474f,_0x3f9123[_0x6124('0x7')]);}module[_0x6124('0x10')]=function(_0x3ea1e7){return new winston['Logger']({'transports':[new winston['transports'][(_0x6124('0x11'))]({'name':util[_0x6124('0xb')](_0x6124('0x12'),_0x3ea1e7,_0x6124('0x13')),'filename':filename(_0x3ea1e7,_0x6124('0x13')),'level':_0x6124('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5537a6){return formatter(_0x3ea1e7,_0x5537a6);}}),new winston[(_0x6124('0x14'))][(_0x6124('0x11'))]({'name':util[_0x6124('0xb')](_0x6124('0x12'),_0x3ea1e7,'info'),'filename':filename(_0x3ea1e7,_0x6124('0x15')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x266dcb){return formatter(_0x3ea1e7,_0x266dcb);}}),new winston['transports']['Console']({'level':process[_0x6124('0x16')][_0x6124('0x17')]||debugLevel,'json':![],'formatter':function(_0xd040b1){return formatter(_0x3ea1e7,_0xd040b1);}})]});}; \ No newline at end of file +var _0x0aa4=['exports','transports','File','%s-%s','error','info','Console','debugLevel','moment','join','/var','log','xcally','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase'];(function(_0x79b47f,_0x21b7da){var _0x5ab625=function(_0x10888f){while(--_0x10888f){_0x79b47f['push'](_0x79b47f['shift']());}};_0x5ab625(++_0x21b7da);}(_0x0aa4,0x13c));var _0x40aa=function(_0x472cfc,_0x4ec9f3){_0x472cfc=_0x472cfc-0x0;var _0x3ba7cb=_0x0aa4[_0x472cfc];return _0x3ba7cb;};'use strict';var moment=require(_0x40aa('0x0'));var winston=require('winston');var util=require('util');var path=require('path');var debugLevel='INFO';function filename(_0x4232f9,_0x2d22b8){return path[_0x40aa('0x1')](_0x40aa('0x2'),_0x40aa('0x3'),_0x40aa('0x4'),util['format'](_0x40aa('0x5'),_0x4232f9,_0x2d22b8));}function formatter(_0x554996,_0x10b4a3){_0x10b4a3[_0x40aa('0x6')]=_0x10b4a3[_0x40aa('0x6')][_0x40aa('0x7')](/@@{/g,'{{{')[_0x40aa('0x7')](/}@@/g,_0x40aa('0x8'))[_0x40aa('0x7')](/@{/g,'{{')[_0x40aa('0x7')](/}@/g,'}}');return util['format'](_0x40aa('0x9'),moment()[_0x40aa('0xa')](_0x40aa('0xb')),_0x10b4a3[_0x40aa('0xc')][_0x40aa('0xd')](),_0x554996,_0x10b4a3[_0x40aa('0x6')]);}module[_0x40aa('0xe')]=function(_0x528f1c){return new winston['Logger']({'transports':[new winston[(_0x40aa('0xf'))][(_0x40aa('0x10'))]({'name':util['format'](_0x40aa('0x11'),_0x528f1c,'error'),'filename':filename(_0x528f1c,_0x40aa('0x12')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ad0a7){return formatter(_0x528f1c,_0x3ad0a7);}}),new winston[(_0x40aa('0xf'))][(_0x40aa('0x10'))]({'name':util[_0x40aa('0xa')](_0x40aa('0x11'),_0x528f1c,'info'),'filename':filename(_0x528f1c,_0x40aa('0x13')),'level':_0x40aa('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3a4cc5){return formatter(_0x528f1c,_0x3a4cc5);}}),new winston[(_0x40aa('0xf'))][(_0x40aa('0x14'))]({'level':process['env'][_0x40aa('0x15')]||debugLevel,'json':![],'formatter':function(_0x2f1171){return formatter(_0x528f1c,_0x2f1171);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 1e2c738..b7c6831 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 _0x0ce9=['ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','join','../../services/express/index.js'];(function(_0x18d43d,_0x597070){var _0x267483=function(_0x3070d7){while(--_0x3070d7){_0x18d43d['push'](_0x18d43d['shift']());}};_0x267483(++_0x597070);}(_0x0ce9,0xa6));var _0x90ce=function(_0xb6728d,_0x124273){_0xb6728d=_0xb6728d-0x0;var _0x5e7f3a=_0x0ce9[_0xb6728d];return _0x5e7f3a;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path[_0x90ce('0x0')](__dirname,_0x90ce('0x1'))},{'name':_0x90ce('0x2'),'script':path[_0x90ce('0x0')](__dirname,_0x90ce('0x3'))},{'name':_0x90ce('0x4'),'script':path[_0x90ce('0x0')](__dirname,'../../services/agi/index.js')},{'name':_0x90ce('0x5'),'script':path[_0x90ce('0x0')](__dirname,_0x90ce('0x6'))},{'name':_0x90ce('0x7'),'script':path[_0x90ce('0x0')](__dirname,_0x90ce('0x8'))},{'name':_0x90ce('0x9'),'script':path[_0x90ce('0x0')](__dirname,_0x90ce('0xa'))}]};module[_0x90ce('0xb')]=config; \ No newline at end of file +var _0x8e07=['email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x3baeee,_0x470398){var _0x40920b=function(_0x2cb336){while(--_0x2cb336){_0x3baeee['push'](_0x3baeee['shift']());}};_0x40920b(++_0x470398);}(_0x8e07,0xcb));var _0x78e0=function(_0x21e2e8,_0x580b5c){_0x21e2e8=_0x21e2e8-0x0;var _0xfe58e1=_0x8e07[_0x21e2e8];return _0xfe58e1;};'use strict';var path=require(_0x78e0('0x0'));var os=require('os');var config={'apps':[{'name':_0x78e0('0x1'),'script':path[_0x78e0('0x2')](__dirname,_0x78e0('0x3'))},{'name':_0x78e0('0x4'),'script':path[_0x78e0('0x2')](__dirname,_0x78e0('0x5'))},{'name':_0x78e0('0x6'),'script':path[_0x78e0('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x78e0('0x7'),'script':path['join'](__dirname,_0x78e0('0x8'))},{'name':_0x78e0('0x9'),'script':path[_0x78e0('0x2')](__dirname,_0x78e0('0xa'))},{'name':_0x78e0('0xb'),'script':path[_0x78e0('0x2')](__dirname,_0x78e0('0xc'))}]};module[_0x78e0('0xd')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 4bbcdad..fbedd51 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 _0x5018=['then','restart','list','describe','dump','saved','pm2','./config','connect','connected','start','disconnect','stop'];(function(_0x2820a5,_0xbca915){var _0x491f77=function(_0x4156e4){while(--_0x4156e4){_0x2820a5['push'](_0x2820a5['shift']());}};_0x491f77(++_0xbca915);}(_0x5018,0x1cd));var _0x8501=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x5018[_0x510b98];return _0x45e775;};'use strict';var pm2=require(_0x8501('0x0'));var BPromise=require('bluebird');var config=require(_0x8501('0x1'));function connect(){return new BPromise(function(_0x209a85,_0x22cd17){return pm2[_0x8501('0x2')](function(_0x13f888){if(_0x13f888){return _0x22cd17(_0x13f888);}return _0x209a85(_0x8501('0x3'));});});};exports[_0x8501('0x4')]=function(_0x13a568){return connect()['then'](function(){return new BPromise(function(_0x1f965b,_0x551bb6){return pm2['start'](_0x13a568,function(_0x38df52,_0xcf2d65){if(_0x38df52){return _0x551bb6(_0x38df52);}pm2[_0x8501('0x5')]();return _0x1f965b(_0xcf2d65);});});});};exports[_0x8501('0x6')]=function(_0x1fa97d){return connect()[_0x8501('0x7')](function(){return new BPromise(function(_0x2e8b00,_0x26912a){return pm2[_0x8501('0x6')](_0x1fa97d,function(_0x547776,_0x47eb1e){if(_0x547776){return _0x26912a(_0x547776);}pm2[_0x8501('0x5')]();return _0x2e8b00(_0x47eb1e);});});});};exports[_0x8501('0x8')]=function(_0x32565a){return connect()[_0x8501('0x7')](function(){return new BPromise(function(_0x38372f,_0x424c08){return pm2['restart'](_0x32565a,function(_0x177db8,_0x274eab){if(_0x177db8){return _0x424c08(_0x177db8);}pm2[_0x8501('0x5')]();return _0x38372f(_0x274eab);});});});};exports['list']=function(){return connect()[_0x8501('0x7')](function(){return new BPromise(function(_0x48f8c1,_0x50ed84){return pm2[_0x8501('0x9')](function(_0x19ab74,_0x513d74){if(_0x19ab74){return _0x50ed84(_0x19ab74);}pm2[_0x8501('0x5')]();return _0x48f8c1(_0x513d74);});});});};exports[_0x8501('0xa')]=function(_0x562f61){return connect()['then'](function(){return new BPromise(function(_0x3622fc,_0x4455c1){return pm2['describe'](_0x562f61,function(_0x2ad139,_0x9c5c7a){if(_0x2ad139){return _0x4455c1(_0x2ad139);}pm2[_0x8501('0x5')]();return _0x3622fc(_0x9c5c7a);});});});};exports['delete']=function(_0x104981){return connect()[_0x8501('0x7')](function(){return new BPromise(function(_0x46b409,_0x4e9a5f){return pm2['delete'](_0x104981,function(_0x5d4fa0,_0x5d51a2){if(_0x5d4fa0){return _0x4e9a5f(_0x5d4fa0);}pm2['disconnect']();return _0x46b409(_0x5d51a2);});});});};exports[_0x8501('0xb')]=function(){return connect()[_0x8501('0x7')](function(){return new BPromise(function(_0x5ba594,_0x4499d7){return pm2[_0x8501('0xb')](function(_0x50f7c4){if(_0x50f7c4){return _0x4499d7(_0x50f7c4);}return _0x5ba594(_0x8501('0xc'));});});});}; \ No newline at end of file +var _0xd11f=['disconnect','stop','restart','list','describe','delete','dump','bluebird','./config','connected','start','then'];(function(_0x20e2c3,_0x5be903){var _0x4d2377=function(_0xd4fbcf){while(--_0xd4fbcf){_0x20e2c3['push'](_0x20e2c3['shift']());}};_0x4d2377(++_0x5be903);}(_0xd11f,0x73));var _0xfd11=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xd11f[_0x41cfd4];return _0x190f48;};'use strict';var pm2=require('pm2');var BPromise=require(_0xfd11('0x0'));var config=require(_0xfd11('0x1'));function connect(){return new BPromise(function(_0x5d3433,_0x42c121){return pm2['connect'](function(_0x1c8393){if(_0x1c8393){return _0x42c121(_0x1c8393);}return _0x5d3433(_0xfd11('0x2'));});});};exports[_0xfd11('0x3')]=function(_0x4fa0dd){return connect()[_0xfd11('0x4')](function(){return new BPromise(function(_0x292b6f,_0x4700ba){return pm2[_0xfd11('0x3')](_0x4fa0dd,function(_0x2f5ac5,_0x526076){if(_0x2f5ac5){return _0x4700ba(_0x2f5ac5);}pm2[_0xfd11('0x5')]();return _0x292b6f(_0x526076);});});});};exports[_0xfd11('0x6')]=function(_0x4c22e2){return connect()['then'](function(){return new BPromise(function(_0xc832f9,_0x777505){return pm2['stop'](_0x4c22e2,function(_0x176eac,_0x35b6b0){if(_0x176eac){return _0x777505(_0x176eac);}pm2[_0xfd11('0x5')]();return _0xc832f9(_0x35b6b0);});});});};exports[_0xfd11('0x7')]=function(_0x343e2b){return connect()['then'](function(){return new BPromise(function(_0x42da92,_0xe696d9){return pm2[_0xfd11('0x7')](_0x343e2b,function(_0x2ae713,_0x1e4286){if(_0x2ae713){return _0xe696d9(_0x2ae713);}pm2['disconnect']();return _0x42da92(_0x1e4286);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x3113c4,_0xa90d39){return pm2[_0xfd11('0x8')](function(_0x4df384,_0x16ff54){if(_0x4df384){return _0xa90d39(_0x4df384);}pm2['disconnect']();return _0x3113c4(_0x16ff54);});});});};exports['describe']=function(_0x109630){return connect()[_0xfd11('0x4')](function(){return new BPromise(function(_0x1335cc,_0x12d893){return pm2[_0xfd11('0x9')](_0x109630,function(_0x1b9fac,_0x5a131d){if(_0x1b9fac){return _0x12d893(_0x1b9fac);}pm2[_0xfd11('0x5')]();return _0x1335cc(_0x5a131d);});});});};exports['delete']=function(_0x464904){return connect()[_0xfd11('0x4')](function(){return new BPromise(function(_0x5490cd,_0x55974d){return pm2[_0xfd11('0xa')](_0x464904,function(_0x479410,_0x21dc0a){if(_0x479410){return _0x55974d(_0x479410);}pm2[_0xfd11('0x5')]();return _0x5490cd(_0x21dc0a);});});});};exports[_0xfd11('0xb')]=function(){return connect()[_0xfd11('0x4')](function(){return new BPromise(function(_0x4e8413,_0xc34be5){return pm2[_0xfd11('0xb')](function(_0x7dc16a){if(_0x7dc16a){return _0xc34be5(_0x7dc16a);}return _0x4e8413('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 2d117e4..97abe15 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 _0x934f=['lodash','util','../../config/environment','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start'];(function(_0x326e11,_0x2a4f76){var _0x3deedc=function(_0x37c9c0){while(--_0x37c9c0){_0x326e11['push'](_0x326e11['shift']());}};_0x3deedc(++_0x2a4f76);}(_0x934f,0xc0));var _0xf934=function(_0x27e297,_0x789346){_0x27e297=_0x27e297-0x0;var _0x2c1458=_0x934f[_0x27e297];return _0x2c1458;};'use strict';var _=require(_0xf934('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0xf934('0x1'));var config=require(_0xf934('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xf934('0x3'))('schedule');config[_0xf934('0x4')]=_[_0xf934('0x5')](config[_0xf934('0x4')],{'host':_0xf934('0x6'),'port':0x18eb});var io=require(_0xf934('0x7'))(new Redis(config[_0xf934('0x4')]));function closeInteractions(){var _0x41eabb=0x0;var _0x1daccb=[];return db[_0xf934('0x8')][_0xf934('0x9')]({'raw':!![],'attributes':['id',_0xf934('0xa')],'where':{'id':0x1}})[_0xf934('0xb')](function(_0x36e37a){_0x41eabb=_0x36e37a[_0xf934('0xa')];if(_0x41eabb){return db['ChatInteraction'][_0xf934('0xc')]({'raw':!![],'attributes':['id',_0xf934('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x36e37a[_0xf934('0xa')],_0xf934('0xe'))}}});}else{return[];}})[_0xf934('0xb')](function(_0x31a03a){if(_0x31a03a&&_0x31a03a['length']){_0x1daccb=_[_0xf934('0xf')](_0x31a03a||[],'id');logger[_0xf934('0x10')](_0xf934('0x11'),_0x1daccb[_0xf934('0x12')]());return db[_0xf934('0x13')][_0xf934('0x14')]({'closeReason':_0xf934('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xf934('0x16')](_0xf934('0x17'))},{'where':{'id':_0x1daccb}});}})[_0xf934('0xb')](function(){if(_0x1daccb&&_0x1daccb['length']){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x1daccb[_0xf934('0x12')]());for(var _0x418de2=0x0;_0x418de2<_0x1daccb[_0xf934('0x18')];_0x418de2++){io[_0xf934('0x19')](_0xf934('0x1a'),{'id':_0x1daccb[_0x418de2],'closed':!![]});}}})[_0xf934('0x1b')](function(_0x275ab4){logger[_0xf934('0x1c')](_0xf934('0x1d'),_0x275ab4?util[_0xf934('0x1e')](_0x275ab4,{'showHidden':![],'depth':null}):'');});}exports[_0xf934('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4ece=['emit','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../logger','redis','defaults','localhost','Setting','find','chatTimeout','then','findAll','lastMsgAt','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x4d8cdf,_0x598a82){var _0x1c2026=function(_0x1460ec){while(--_0x1460ec){_0x4d8cdf['push'](_0x4d8cdf['shift']());}};_0x1c2026(++_0x598a82);}(_0x4ece,0xc8));var _0xe4ec=function(_0x3d3896,_0x3aa0b4){_0x3d3896=_0x3d3896-0x0;var _0x1f7db6=_0x4ece[_0x3d3896];return _0x1f7db6;};'use strict';var _=require(_0xe4ec('0x0'));var moment=require(_0xe4ec('0x1'));var Redis=require(_0xe4ec('0x2'));var util=require(_0xe4ec('0x3'));var config=require(_0xe4ec('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xe4ec('0x5'))('schedule');config[_0xe4ec('0x6')]=_[_0xe4ec('0x7')](config['redis'],{'host':_0xe4ec('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe4ec('0x6')]));function closeInteractions(){var _0x3ae727=0x0;var _0x29c80c=[];return db[_0xe4ec('0x9')][_0xe4ec('0xa')]({'raw':!![],'attributes':['id',_0xe4ec('0xb')],'where':{'id':0x1}})[_0xe4ec('0xc')](function(_0x1b360a){_0x3ae727=_0x1b360a[_0xe4ec('0xb')];if(_0x3ae727){return db['ChatInteraction'][_0xe4ec('0xd')]({'raw':!![],'attributes':['id',_0xe4ec('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x1b360a[_0xe4ec('0xb')],'minutes')}}});}else{return[];}})[_0xe4ec('0xc')](function(_0x22be02){if(_0x22be02&&_0x22be02[_0xe4ec('0xf')]){_0x29c80c=_['map'](_0x22be02||[],'id');logger[_0xe4ec('0x10')](_0xe4ec('0x11'),_0x29c80c[_0xe4ec('0x12')]());return db[_0xe4ec('0x13')][_0xe4ec('0x14')]({'closeReason':'system','disposition':_0xe4ec('0x15'),'closed':!![],'closedAt':moment()['format'](_0xe4ec('0x16'))},{'where':{'id':_0x29c80c}});}})[_0xe4ec('0xc')](function(){if(_0x29c80c&&_0x29c80c['length']){logger['info'](_0xe4ec('0x17'),_0x29c80c[_0xe4ec('0x12')]());for(var _0x4ef04d=0x0;_0x4ef04d<_0x29c80c[_0xe4ec('0xf')];_0x4ef04d++){io[_0xe4ec('0x18')]('chatInteraction:update',{'id':_0x29c80c[_0x4ef04d],'closed':!![]});}}})['catch'](function(_0x5d855d){logger[_0xe4ec('0x19')](_0xe4ec('0x1a'),_0x5d855d?util[_0xe4ec('0x1b')](_0x5d855d,{'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/index.js b/server/config/schedule/index.js index 14dedb6..de5f755 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 _0x3e54=['cron','deleteJob','stop\x20cron','update','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','info','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','name','bcc','format','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','status','Sent','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','message','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','SendMail','then','error','stringify','catch','error\x20mail','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','exists','stop','delete\x20cron','toRun','length','index','resolve','run\x20job','active','isBetween','startAt','endAt','start','add\x20cron'];(function(_0x4b8c07,_0x4363f6){var _0xf19042=function(_0x21dec5){while(--_0x21dec5){_0x4b8c07['push'](_0x4b8c07['shift']());}};_0xf19042(++_0x4363f6);}(_0x3e54,0x161));var _0x43e5=function(_0x634135,_0x5533c5){_0x634135=_0x634135-0x0;var _0x24dd71=_0x3e54[_0x634135];return _0x24dd71;};'use strict';var fs=require('fs');var util=require(_0x43e5('0x0'));var path=require(_0x43e5('0x1'));var _=require(_0x43e5('0x2'));var moment=require(_0x43e5('0x3'));var CronJobManager=require(_0x43e5('0x4'));var jayson=require(_0x43e5('0x5'));var BPromise=require(_0x43e5('0x6'));var logger=require('../logger')('schedule');var db=require(_0x43e5('0x7'))['db'];var analyticCustomReportController=require(_0x43e5('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x43e5('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3e6635,_0x2fe8b3){return function(){logger[_0x43e5('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x3e6635[_0x43e5('0xb')]);var _0x19cad7=!![];var _0x46bca9={'tls':{'rejectUnauthorized':![]}};if(_0x3e6635[_0x43e5('0xc')][_0x43e5('0xd')][_0x43e5('0xe')]){_0x46bca9[_0x43e5('0xe')]=_0x3e6635['MailAccount']['Smtp'][_0x43e5('0xe')];}else{_0x46bca9[_0x43e5('0xf')]=_0x3e6635[_0x43e5('0xc')][_0x43e5('0xd')]['host'];_0x46bca9[_0x43e5('0x10')]=_0x3e6635['MailAccount']['Smtp'][_0x43e5('0x10')];_0x46bca9[_0x43e5('0x11')]=_0x3e6635[_0x43e5('0xc')][_0x43e5('0xd')][_0x43e5('0x11')];}if(_0x3e6635[_0x43e5('0xc')][_0x43e5('0xd')][_0x43e5('0x12')]){_0x46bca9[_0x43e5('0x13')]={'user':_0x3e6635['MailAccount'][_0x43e5('0xd')][_0x43e5('0x14')],'pass':_0x3e6635[_0x43e5('0xc')]['Smtp'][_0x43e5('0x15')]};}var _0x372951={'account':_0x46bca9,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3e6635[_0x43e5('0xc')][_0x43e5('0x16')],_0x3e6635[_0x43e5('0xc')][_0x43e5('0xb')]||_0x3e6635[_0x43e5('0xc')][_0x43e5('0xd')]['user']),'to':_0x3e6635[_0x43e5('0xb')],'cc':_0x3e6635['cc'],'bcc':_0x3e6635[_0x43e5('0x17')],'subject':util[_0x43e5('0x18')]('Report\x20%s\x20last\x20%s\x20%s',_0x2fe8b3['name'],_0x3e6635[_0x43e5('0x19')],_0x3e6635[_0x43e5('0x1a')])}};var _0x5a181a=path[_0x43e5('0x1b')](__dirname,_0x43e5('0x1c'));var _0x56a47d=_0x2fe8b3[_0x43e5('0x1d')];var _0x3efe79=util[_0x43e5('0x18')]('%s.%s',path[_0x43e5('0x1e')](_0x2fe8b3['savename'],path[_0x43e5('0x1f')](_0x2fe8b3[_0x43e5('0x1d')])),_0x43e5('0x20'));var _0x468263=path['join'](_0x5a181a,_0x56a47d);var _0x167b35=path[_0x43e5('0x1b')](_0x5a181a,_0x3efe79);if(fs[_0x43e5('0x21')](_0x468263)){_0x2fe8b3[_0x43e5('0x22')]=_0x43e5('0x23');_0x372951['message'][_0x43e5('0x24')]=[{'filename':_0x56a47d,'path':_0x468263}];_0x372951['message'][_0x43e5('0x25')]=util[_0x43e5('0x18')](_0x43e5('0x26'),JSON['stringify'](_0x2fe8b3,null,0x2));}else if(fs['existsSync'](_0x167b35)){_0x2fe8b3[_0x43e5('0x22')]=_0x43e5('0x23');_0x372951['message'][_0x43e5('0x24')]=[{'filename':_0x3efe79,'path':_0x167b35}];}else{_0x372951[_0x43e5('0x27')]['text']=_0x43e5('0x28');if(!_0x3e6635[_0x43e5('0x29')]){_0x19cad7=![];logger[_0x43e5('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x19cad7){return client['request'](_0x43e5('0x2a'),_0x372951)[_0x43e5('0x2b')](function(_0x269cd1){if(_0x269cd1['error']){return logger[_0x43e5('0x2c')]('error\x20mail',JSON[_0x43e5('0x2d')](_0x269cd1));}return logger['info']('email\x20sent');})[_0x43e5('0x2e')](function(_0x188263){return logger[_0x43e5('0x2c')](_0x43e5('0x2f'),JSON['stringify'](_0x188263));});}};}function handleError(){return function(_0x44d336){return logger[_0x43e5('0x2c')](JSON[_0x43e5('0x2d')](_0x44d336));};}function handleResult(_0x55e338){return function(_0x266860){logger[_0x43e5('0xa')]('data',JSON[_0x43e5('0x2d')](_0x266860));if(_0x55e338[_0x43e5('0xc')]&&_0x55e338[_0x43e5('0xc')][_0x43e5('0xd')]&&!_[_0x43e5('0x30')](_0x55e338[_0x43e5('0xb')])){setTimeout(handleSendEmail(_0x55e338,_0x266860),0x3c*0x3e8);}};}function handleJob(_0x292b45){return function(){try{if(_['isNil'](_0x292b45[_0x43e5('0x19')])){return logger['info'](_0x43e5('0x31'));}if(_[_0x43e5('0x30')](_0x292b45[_0x43e5('0x1a')])){return logger['info'](_0x43e5('0x32'));}var _0x2720fd={'startDate':moment()['subtract'](_0x292b45[_0x43e5('0x19')],_0x292b45['subtractUnit'])[_0x43e5('0x18')](_0x43e5('0x33')),'endDate':moment()[_0x43e5('0x18')](_0x43e5('0x33')),'type':_0x43e5('0x34'),'output':_0x292b45[_0x43e5('0x35')],'name':_0x292b45[_0x43e5('0x16')]};if(!_['isNil'](_0x292b45['DefaultReportId'])){logger[_0x43e5('0xa')](_0x43e5('0x36'),_0x292b45['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x292b45[_0x43e5('0x37')]},_0x2720fd)['then'](handleResult(_0x292b45))['catch'](handleError());}if(!_[_0x43e5('0x30')](_0x292b45[_0x43e5('0x38')])){logger[_0x43e5('0xa')](_0x43e5('0x39'),_0x292b45[_0x43e5('0x38')]);return analyticCustomReportController['runReport']({'id':_0x292b45[_0x43e5('0x38')]},_0x2720fd)[_0x43e5('0x2b')](handleResult(_0x292b45))[_0x43e5('0x2e')](handleError());}}catch(_0xa978c1){logger[_0x43e5('0x2c')](JSON[_0x43e5('0x2d')](_0xa978c1));}return logger[_0x43e5('0xa')](_0x43e5('0x3a'));};}function getJobs(_0x51317b){var _0x1a9e48={};if(_0x51317b){_0x1a9e48['id']=_0x51317b;}return db['Schedule'][_0x43e5('0x3b')]({'where':_0x1a9e48,'include':[{'model':db[_0x43e5('0xc')],'attributes':['id','name',_0x43e5('0xb')],'include':[{'model':db[_0x43e5('0x3c')],'as':_0x43e5('0xd')}]}]})[_0x43e5('0x2b')](function(_0x556472){var _0x1c8edb=_[_0x43e5('0x3d')](manager[_0x43e5('0x3e')]);var _0x35feb2=_[_0x43e5('0x3f')](_0x556472,function(_0x51ce4b){return _0x51ce4b['id'][_0x43e5('0x40')]();});var _0x52133b=_[_0x43e5('0x41')](_0x556472,function(_0x18dee9){return _0x18dee9['id'][_0x43e5('0x40')]();});var _0x107871=_0x51317b?_0x35feb2:_[_0x43e5('0x42')](_0x35feb2,_0x1c8edb);var _0x99743=_[_0x43e5('0x43')](_0x35feb2,_0x1c8edb);var _0x1dd730=_[_0x43e5('0x42')](_0x1c8edb,_0x35feb2);var _0x1bde9a;var _0x42aed0;for(_0x1bde9a=0x0;_0x1bde9a<_0x1dd730['length']&&!_0x51317b;_0x1bde9a+=0x1){_0x42aed0=_0x1dd730[_0x1bde9a][_0x43e5('0x40')]();if(manager[_0x43e5('0x44')](_0x42aed0)){manager[_0x43e5('0x45')](_0x42aed0);manager['deleteJob'](_0x42aed0);logger['info'](_0x43e5('0x46'),_0x42aed0);}}logger[_0x43e5('0xa')](_0x43e5('0x47'),JSON[_0x43e5('0x2d')](_0x107871));for(_0x1bde9a=0x0;_0x1bde9a<_0x107871[_0x43e5('0x48')];_0x1bde9a+=0x1){_0x42aed0=_0x107871[_0x1bde9a][_0x43e5('0x40')]();logger['info'](_0x43e5('0x49'),_0x42aed0);if(_0x51317b){logger['info']('my\x20id',_0x51317b);logger[_0x43e5('0xa')](JSON['stringify'](_0x52133b[_0x42aed0]));BPromise[_0x43e5('0x4a')]()[_0x43e5('0x2b')](handleJob(_0x52133b[_0x42aed0]));logger[_0x43e5('0xa')](_0x43e5('0x4b'),_0x52133b[_0x42aed0][_0x43e5('0x16')],_0x52133b[_0x42aed0]['cron']);}else if(_0x52133b[_0x42aed0]['cron']&&_0x52133b[_0x42aed0][_0x43e5('0x4c')]&&moment()[_0x43e5('0x4d')](_0x52133b[_0x42aed0][_0x43e5('0x4e')],_0x52133b[_0x42aed0][_0x43e5('0x4f')])){manager['add'](_0x42aed0,_0x52133b[_0x42aed0]['cron'],handleJob(_0x52133b[_0x42aed0]));manager[_0x43e5('0x50')](_0x42aed0);logger[_0x43e5('0xa')](_0x43e5('0x51'),_0x52133b[_0x42aed0][_0x43e5('0x16')],_0x52133b[_0x42aed0][_0x43e5('0x52')]);}else if(manager['exists'](_0x42aed0)){manager['stop'](_0x42aed0);manager[_0x43e5('0x53')](_0x42aed0);logger[_0x43e5('0xa')](_0x43e5('0x54'),_0x52133b[_0x42aed0][_0x43e5('0x16')],_0x52133b[_0x42aed0]['cron']);}}for(_0x1bde9a=0x0,_0x42aed0;_0x1bde9a<_0x99743[_0x43e5('0x48')]&&!_0x51317b;_0x1bde9a+=0x1){_0x42aed0=_0x99743[_0x1bde9a][_0x43e5('0x40')]();if(manager[_0x43e5('0x44')](_0x42aed0)){if(_0x52133b[_0x42aed0][_0x43e5('0x52')]&&_0x52133b[_0x42aed0][_0x43e5('0x4c')]&&moment()[_0x43e5('0x4d')](_0x52133b[_0x42aed0][_0x43e5('0x4e')],_0x52133b[_0x42aed0][_0x43e5('0x4f')])){manager[_0x43e5('0x55')](_0x42aed0,_0x52133b[_0x42aed0][_0x43e5('0x52')],handleJob(_0x52133b[_0x42aed0]));logger[_0x43e5('0xa')]('update\x20cron',_0x52133b[_0x42aed0]['name'],_0x52133b[_0x42aed0][_0x43e5('0x52')]);}else{manager[_0x43e5('0x45')](_0x42aed0);manager['deleteJob'](_0x42aed0);logger['info'](_0x43e5('0x54'),_0x52133b[_0x42aed0][_0x43e5('0x16')],_0x52133b[_0x42aed0][_0x43e5('0x52')]);}}}})[_0x43e5('0x2e')](function(_0x29713b){logger[_0x43e5('0x2c')](JSON[_0x43e5('0x2d')](_0x29713b));});}exports[_0x43e5('0x56')]=function(_0x58cb23){return getJobs(_0x58cb23);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x012a=['map','toString','difference','length','exists','stop','delete\x20cron','my\x20id','resolve','run\x20job','cron','active','isBetween','endAt','add','start','add\x20cron','stop\x20cron','startAt','update','run','util','path','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','extname','join','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','catch','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs'];(function(_0x535087,_0x177a81){var _0x4b2abd=function(_0x51136c){while(--_0x51136c){_0x535087['push'](_0x535087['shift']());}};_0x4b2abd(++_0x177a81);}(_0x012a,0x11a));var _0xa012=function(_0x17d2b9,_0x1a25a4){_0x17d2b9=_0x17d2b9-0x0;var _0x5d89db=_0x012a[_0x17d2b9];return _0x5d89db;};'use strict';var fs=require('fs');var util=require(_0xa012('0x0'));var path=require(_0xa012('0x1'));var _=require('lodash');var moment=require(_0xa012('0x2'));var CronJobManager=require(_0xa012('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0xa012('0x4'));var logger=require(_0xa012('0x5'))(_0xa012('0x6'));var db=require(_0xa012('0x7'))['db'];var analyticCustomReportController=require(_0xa012('0x8'));var analyticDefaultReportController=require(_0xa012('0x9'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xf07581,_0x4fa0c4){return function(){logger[_0xa012('0xa')](_0xa012('0xb'),_0xf07581[_0xa012('0xc')]);var _0x15d53c=!![];var _0x298687={'tls':{'rejectUnauthorized':![]}};if(_0xf07581[_0xa012('0xd')][_0xa012('0xe')][_0xa012('0xf')]){_0x298687[_0xa012('0xf')]=_0xf07581[_0xa012('0xd')]['Smtp'][_0xa012('0xf')];}else{_0x298687[_0xa012('0x10')]=_0xf07581['MailAccount'][_0xa012('0xe')][_0xa012('0x10')];_0x298687['port']=_0xf07581[_0xa012('0xd')][_0xa012('0xe')][_0xa012('0x11')];_0x298687[_0xa012('0x12')]=_0xf07581['MailAccount']['Smtp'][_0xa012('0x12')];}if(_0xf07581[_0xa012('0xd')][_0xa012('0xe')][_0xa012('0x13')]){_0x298687[_0xa012('0x14')]={'user':_0xf07581[_0xa012('0xd')]['Smtp'][_0xa012('0x15')],'pass':_0xf07581[_0xa012('0xd')][_0xa012('0xe')][_0xa012('0x16')]};}var _0xd3418c={'account':_0x298687,'message':{'from':util[_0xa012('0x17')]('\x22%s\x22\x20<%s>',_0xf07581[_0xa012('0xd')][_0xa012('0x18')],_0xf07581[_0xa012('0xd')][_0xa012('0xc')]||_0xf07581[_0xa012('0xd')]['Smtp']['user']),'to':_0xf07581['email'],'cc':_0xf07581['cc'],'bcc':_0xf07581[_0xa012('0x19')],'subject':util[_0xa012('0x17')](_0xa012('0x1a'),_0x4fa0c4['name'],_0xf07581['subtractNumber'],_0xf07581[_0xa012('0x1b')])}};var _0x5a8e24=path['join'](__dirname,_0xa012('0x1c'));var _0x9d54e0=_0x4fa0c4['savename'];var _0x4c7a06=util['format']('%s.%s',path['basename'](_0x4fa0c4[_0xa012('0x1d')],path[_0xa012('0x1e')](_0x4fa0c4[_0xa012('0x1d')])),'zip');var _0x514e4e=path[_0xa012('0x1f')](_0x5a8e24,_0x9d54e0);var _0x48b890=path['join'](_0x5a8e24,_0x4c7a06);if(fs[_0xa012('0x20')](_0x514e4e)){_0x4fa0c4[_0xa012('0x21')]=_0xa012('0x22');_0xd3418c[_0xa012('0x23')]['attachments']=[{'filename':_0x9d54e0,'path':_0x514e4e}];_0xd3418c['message'][_0xa012('0x24')]=util[_0xa012('0x17')](_0xa012('0x25'),JSON['stringify'](_0x4fa0c4,null,0x2));}else if(fs[_0xa012('0x20')](_0x48b890)){_0x4fa0c4[_0xa012('0x21')]=_0xa012('0x22');_0xd3418c[_0xa012('0x23')][_0xa012('0x26')]=[{'filename':_0x4c7a06,'path':_0x48b890}];}else{_0xd3418c['message'][_0xa012('0x24')]=_0xa012('0x27');if(!_0xf07581['sendIfEmpty']){_0x15d53c=![];logger[_0xa012('0xa')](_0xa012('0x28'));}}if(_0x15d53c){return client[_0xa012('0x29')](_0xa012('0x2a'),_0xd3418c)[_0xa012('0x2b')](function(_0x55ef16){if(_0x55ef16['error']){return logger[_0xa012('0x2c')](_0xa012('0x2d'),JSON[_0xa012('0x2e')](_0x55ef16));}return logger['info']('email\x20sent');})[_0xa012('0x2f')](function(_0x47a056){return logger[_0xa012('0x2c')](_0xa012('0x2d'),JSON[_0xa012('0x2e')](_0x47a056));});}};}function handleError(){return function(_0x24d0f9){return logger['error'](JSON[_0xa012('0x2e')](_0x24d0f9));};}function handleResult(_0x3c4441){return function(_0xad08e2){logger[_0xa012('0xa')]('data',JSON[_0xa012('0x2e')](_0xad08e2));if(_0x3c4441['MailAccount']&&_0x3c4441[_0xa012('0xd')]['Smtp']&&!_['isNil'](_0x3c4441[_0xa012('0xc')])){setTimeout(handleSendEmail(_0x3c4441,_0xad08e2),0x3c*0x3e8);}};}function handleJob(_0x1dc99d){return function(){try{if(_[_0xa012('0x30')](_0x1dc99d[_0xa012('0x31')])){return logger[_0xa012('0xa')](_0xa012('0x32'));}if(_['isNil'](_0x1dc99d['subtractUnit'])){return logger[_0xa012('0xa')](_0xa012('0x33'));}var _0x44d984={'startDate':moment()[_0xa012('0x34')](_0x1dc99d[_0xa012('0x31')],_0x1dc99d[_0xa012('0x1b')])[_0xa012('0x17')](_0xa012('0x35')),'endDate':moment()[_0xa012('0x17')](_0xa012('0x35')),'type':_0xa012('0x36'),'output':_0x1dc99d[_0xa012('0x37')],'name':_0x1dc99d['name']};if(!_[_0xa012('0x30')](_0x1dc99d[_0xa012('0x38')])){logger[_0xa012('0xa')](_0xa012('0x39'),_0x1dc99d['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x1dc99d[_0xa012('0x38')]},_0x44d984)[_0xa012('0x2b')](handleResult(_0x1dc99d))[_0xa012('0x2f')](handleError());}if(!_[_0xa012('0x30')](_0x1dc99d[_0xa012('0x3a')])){logger[_0xa012('0xa')](_0xa012('0x3b'),_0x1dc99d[_0xa012('0x3a')]);return analyticCustomReportController['runReport']({'id':_0x1dc99d['CustomReportId']},_0x44d984)[_0xa012('0x2b')](handleResult(_0x1dc99d))['catch'](handleError());}}catch(_0x4cda77){logger[_0xa012('0x2c')](JSON[_0xa012('0x2e')](_0x4cda77));}return logger['info'](_0xa012('0x3c'));};}function getJobs(_0x2f17d2){var _0x31c3a3={};if(_0x2f17d2){_0x31c3a3['id']=_0x2f17d2;}return db[_0xa012('0x3d')][_0xa012('0x3e')]({'where':_0x31c3a3,'include':[{'model':db[_0xa012('0xd')],'attributes':['id',_0xa012('0x18'),'email'],'include':[{'model':db[_0xa012('0x3f')],'as':_0xa012('0xe')}]}]})[_0xa012('0x2b')](function(_0x3fdcd3){var _0x272897=_[_0xa012('0x40')](manager[_0xa012('0x41')]);var _0x41ffe4=_[_0xa012('0x42')](_0x3fdcd3,function(_0x1d089a){return _0x1d089a['id'][_0xa012('0x43')]();});var _0x22a4c3=_['keyBy'](_0x3fdcd3,function(_0x1b37a7){return _0x1b37a7['id']['toString']();});var _0x237b62=_0x2f17d2?_0x41ffe4:_[_0xa012('0x44')](_0x41ffe4,_0x272897);var _0x1fbeeb=_['intersection'](_0x41ffe4,_0x272897);var _0x2ff38b=_[_0xa012('0x44')](_0x272897,_0x41ffe4);var _0x15b125;var _0x2c04f4;for(_0x15b125=0x0;_0x15b125<_0x2ff38b[_0xa012('0x45')]&&!_0x2f17d2;_0x15b125+=0x1){_0x2c04f4=_0x2ff38b[_0x15b125]['toString']();if(manager[_0xa012('0x46')](_0x2c04f4)){manager[_0xa012('0x47')](_0x2c04f4);manager['deleteJob'](_0x2c04f4);logger[_0xa012('0xa')](_0xa012('0x48'),_0x2c04f4);}}logger[_0xa012('0xa')]('toRun',JSON[_0xa012('0x2e')](_0x237b62));for(_0x15b125=0x0;_0x15b125<_0x237b62[_0xa012('0x45')];_0x15b125+=0x1){_0x2c04f4=_0x237b62[_0x15b125][_0xa012('0x43')]();logger[_0xa012('0xa')]('index',_0x2c04f4);if(_0x2f17d2){logger[_0xa012('0xa')](_0xa012('0x49'),_0x2f17d2);logger[_0xa012('0xa')](JSON['stringify'](_0x22a4c3[_0x2c04f4]));BPromise[_0xa012('0x4a')]()[_0xa012('0x2b')](handleJob(_0x22a4c3[_0x2c04f4]));logger[_0xa012('0xa')](_0xa012('0x4b'),_0x22a4c3[_0x2c04f4]['name'],_0x22a4c3[_0x2c04f4]['cron']);}else if(_0x22a4c3[_0x2c04f4][_0xa012('0x4c')]&&_0x22a4c3[_0x2c04f4][_0xa012('0x4d')]&&moment()[_0xa012('0x4e')](_0x22a4c3[_0x2c04f4]['startAt'],_0x22a4c3[_0x2c04f4][_0xa012('0x4f')])){manager[_0xa012('0x50')](_0x2c04f4,_0x22a4c3[_0x2c04f4]['cron'],handleJob(_0x22a4c3[_0x2c04f4]));manager[_0xa012('0x51')](_0x2c04f4);logger[_0xa012('0xa')](_0xa012('0x52'),_0x22a4c3[_0x2c04f4][_0xa012('0x18')],_0x22a4c3[_0x2c04f4][_0xa012('0x4c')]);}else if(manager['exists'](_0x2c04f4)){manager[_0xa012('0x47')](_0x2c04f4);manager['deleteJob'](_0x2c04f4);logger[_0xa012('0xa')](_0xa012('0x53'),_0x22a4c3[_0x2c04f4][_0xa012('0x18')],_0x22a4c3[_0x2c04f4][_0xa012('0x4c')]);}}for(_0x15b125=0x0,_0x2c04f4;_0x15b125<_0x1fbeeb[_0xa012('0x45')]&&!_0x2f17d2;_0x15b125+=0x1){_0x2c04f4=_0x1fbeeb[_0x15b125][_0xa012('0x43')]();if(manager[_0xa012('0x46')](_0x2c04f4)){if(_0x22a4c3[_0x2c04f4]['cron']&&_0x22a4c3[_0x2c04f4][_0xa012('0x4d')]&&moment()['isBetween'](_0x22a4c3[_0x2c04f4][_0xa012('0x54')],_0x22a4c3[_0x2c04f4][_0xa012('0x4f')])){manager[_0xa012('0x55')](_0x2c04f4,_0x22a4c3[_0x2c04f4]['cron'],handleJob(_0x22a4c3[_0x2c04f4]));logger['info']('update\x20cron',_0x22a4c3[_0x2c04f4]['name'],_0x22a4c3[_0x2c04f4][_0xa012('0x4c')]);}else{manager[_0xa012('0x47')](_0x2c04f4);manager['deleteJob'](_0x2c04f4);logger['info'](_0xa012('0x53'),_0x22a4c3[_0x2c04f4][_0xa012('0x18')],_0x22a4c3[_0x2c04f4][_0xa012('0x4c')]);}}}})[_0xa012('0x2f')](function(_0x4021d7){logger[_0xa012('0x2c')](JSON[_0xa012('0x2e')](_0x4021d7));});}exports[_0xa012('0x56')]=function(_0x317e77){return getJobs(_0x317e77);};exports[_0xa012('0x51')]=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 59bb6a3..b1f1aac 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 _0xdac7=['data2','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','inspect','start','lodash','aws-sdk','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','then','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','update','FailureReason','resolve','bucket','Transcript\x20not\x20available'];(function(_0x266d45,_0x5d3899){var _0x17171e=function(_0x5bac1c){while(--_0x5bac1c){_0x266d45['push'](_0x266d45['shift']());}};_0x17171e(++_0x5d3899);}(_0xdac7,0x180));var _0x7dac=function(_0x47a062,_0xccd2c4){_0x47a062=_0x47a062-0x0;var _0xb223ed=_0xdac7[_0x47a062];return _0xb223ed;};var _=require(_0x7dac('0x0'));var AWS=require(_0x7dac('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require('bluebird');var db=require(_0x7dac('0x2'))['db'];var logger=require(_0x7dac('0x3'))(_0x7dac('0x4'));function getTranscriptionJob(_0x3c4806,_0x56d2ac,_0x4f55eb,_0x4987d1){return new Promise(function(_0x17a05f,_0x2557ee){var _0x505705=new AWS[(_0x7dac('0x5'))]({'accessKeyId':_0x56d2ac,'secretAccessKey':_0x3c4806,'region':_0x4f55eb});_0x505705['getTranscriptionJob']({'TranscriptionJobName':_0x4987d1},function(_0x3b319f,_0x5ccf75){if(_0x3b319f){return _0x2557ee(_0x3b319f);}else{return _0x17a05f(_0x5ccf75);}});});}function sentiment(_0x8746d9,_0x19eaa4,_0x45fbdc,_0x43f23f,_0x11b680){return new Promise(function(_0x2b552f,_0x27eb87){var _0x41e0db=new AWS[(_0x7dac('0x6'))]({'accessKeyId':_0x19eaa4,'secretAccessKey':_0x8746d9,'region':_0x45fbdc});_0x41e0db[_0x7dac('0x7')]({'Text':_0x43f23f,'LanguageCode':_0x11b680['substring'](0x0,0x2)},function(_0x4e3a47,_0x4d4625){if(_0x4e3a47){return _0x27eb87(_0x4e3a47);}else{return _0x2b552f(_0x4d4625);}});});}function checkTranscribeJob(_0x28f4bc,_0x5dd35a,_0x42fbe3){var _0x4e5e65;return new BPromise(function(_0x2413ee,_0x22e197){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0xa'),_0x28f4bc['id'],_0x28f4bc[_0x7dac('0xb')]));return getTranscriptionJob(_0x42fbe3[_0x7dac('0xc')],_0x42fbe3['data2'],_0x5dd35a[_0x7dac('0xd')],_0x28f4bc['transcribeName'])['then'](function(_0x218a2a){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0xe'),_0x28f4bc['id'],_0x28f4bc[_0x7dac('0xb')],_0x218a2a['TranscriptionJob'][_0x7dac('0xf')]));if(!_0x28f4bc['fileText']){switch(_0x218a2a[_0x7dac('0x10')][_0x7dac('0xf')]){case _0x7dac('0x11'):var _0x1ddde7={'transcribeStatus':_0x218a2a[_0x7dac('0x10')][_0x7dac('0xf')],'fileUri':_0x218a2a[_0x7dac('0x10')][_0x7dac('0x12')][_0x7dac('0x13')]};logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x14'),_0x28f4bc['id']));return rp({'uri':_0x218a2a[_0x7dac('0x10')][_0x7dac('0x12')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x12cd84){logger['info'](util[_0x7dac('0x9')](_0x7dac('0x15'),_0x28f4bc['id']));if(_0x12cd84&&_0x12cd84['results']&&_0x12cd84[_0x7dac('0x16')][_0x7dac('0x17')]&&_0x12cd84['results'][_0x7dac('0x17')][_0x7dac('0x18')]){_0x1ddde7[_0x7dac('0x19')]='';for(var _0x179881=0x0;_0x179881<_0x12cd84[_0x7dac('0x16')][_0x7dac('0x17')][_0x7dac('0x18')];_0x179881++){_0x1ddde7['fileText']+=_0x12cd84[_0x7dac('0x16')][_0x7dac('0x17')][_0x179881][_0x7dac('0x1a')]+'';}}return _0x28f4bc['update'](_0x1ddde7);})['then'](function(){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x1b'),_0x28f4bc['id']));if(!_0x28f4bc[_0x7dac('0x1c')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x1f'));}if(!_0x5dd35a[_0x7dac('0x20')]||!_0x5dd35a[_0x7dac('0x21')]||!_0x5dd35a[_0x7dac('0x22')]||!_0x5dd35a[_0x7dac('0x23')]||!_0x5dd35a['bucket']){throw new db['Sequelize'][(_0x7dac('0x1e'))](_0x7dac('0x24'));}if(!_0x1ddde7[_0x7dac('0x19')]){throw new Error('Transcript\x20not\x20available');}if(_0x5dd35a[_0x7dac('0x21')]===_0x42fbe3['id']){return _0x42fbe3;}else{return db[_0x7dac('0x25')][_0x7dac('0x26')]({'where':{'id':_settings[_0x7dac('0x21')]}});}})['then'](function(_0x282e3d){if(!_0x282e3d){throw new db['Sequelize'][(_0x7dac('0x1e'))](_0x7dac('0x27'));}if(!_0x282e3d[_0x7dac('0xc')]||!_0x282e3d['data2']){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x28'));}_0x4e5e65=_0x282e3d;logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x29'),_0x28f4bc['id']));return sentiment(_0x4e5e65['data1'],_0x4e5e65['data2'],_0x5dd35a['sentimentRegion'],_0x1ddde7[_0x7dac('0x19')],_0x5dd35a[_0x7dac('0x23')]);})[_0x7dac('0x2a')](function(_0x4ec055){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x2b'),_0x28f4bc['id']));return _0x28f4bc['update']({'sentiment':_0x4ec055[_0x7dac('0x2c')],'sPositive':_0x4ec055[_0x7dac('0x2d')][_0x7dac('0x2e')],'sNegative':_0x4ec055[_0x7dac('0x2d')]['Negative'],'sMixed':_0x4ec055[_0x7dac('0x2d')][_0x7dac('0x2f')],'sNeutral':_0x4ec055[_0x7dac('0x2d')][_0x7dac('0x30')]});})[_0x7dac('0x2a')](function(){logger[_0x7dac('0x8')](util['format'](_0x7dac('0x1b'),_0x28f4bc['id']));_0x2413ee();});case'FAILED':return _0x28f4bc[_0x7dac('0x31')]({'transcribeStatus':'FAILED','failureReason':_0x218a2a[_0x7dac('0x10')][_0x7dac('0x32')]})[_0x7dac('0x2a')](function(){logger[_0x7dac('0x8')](util[_0x7dac('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x28f4bc['id']));_0x2413ee();});default:logger['info'](util[_0x7dac('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x28f4bc['id']));break;}}else{return BPromise[_0x7dac('0x33')]()[_0x7dac('0x2a')](function(){if(!_0x28f4bc[_0x7dac('0x1c')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x1f'));}if(!_0x5dd35a['sentiment']||!_0x5dd35a['sentimentAccountId']||!_0x5dd35a[_0x7dac('0x22')]||!_0x5dd35a[_0x7dac('0x23')]||!_0x5dd35a[_0x7dac('0x34')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x24'));}if(!_0x28f4bc['fileText']){throw new Error(_0x7dac('0x35'));}if(_0x5dd35a[_0x7dac('0x21')]===_0x42fbe3['id']){return _0x42fbe3;}else{return db[_0x7dac('0x25')][_0x7dac('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x7dac('0x2a')](function(_0x53e093){if(!_0x53e093){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x27'));}if(!_0x53e093[_0x7dac('0xc')]||!_0x53e093[_0x7dac('0x36')]){throw new db[(_0x7dac('0x1d'))]['ValidationError'](_0x7dac('0x28'));}_0x4e5e65=_0x53e093;logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x29'),_0x28f4bc['id']));return sentiment(_0x4e5e65[_0x7dac('0xc')],_0x4e5e65[_0x7dac('0x36')],_0x5dd35a[_0x7dac('0x22')],_0x28f4bc[_0x7dac('0x19')],_0x5dd35a[_0x7dac('0x23')]);})[_0x7dac('0x2a')](function(_0x378bb5){logger['info'](util['format'](_0x7dac('0x2b'),_0x28f4bc['id']));return _0x28f4bc[_0x7dac('0x31')]({'sentiment':_0x378bb5['Sentiment'],'sPositive':_0x378bb5[_0x7dac('0x2d')][_0x7dac('0x2e')],'sNegative':_0x378bb5[_0x7dac('0x2d')][_0x7dac('0x37')],'sMixed':_0x378bb5[_0x7dac('0x2d')]['Mixed'],'sNeutral':_0x378bb5[_0x7dac('0x2d')][_0x7dac('0x30')],'transcribeStatus':'COMPLETED'});})[_0x7dac('0x2a')](function(){logger[_0x7dac('0x8')](util['format'](_0x7dac('0x1b'),_0x28f4bc['id']));_0x2413ee();});}})[_0x7dac('0x38')](function(_0x1d860b){if(_0x1d860b){if(!_0x1d860b[_0x7dac('0x39')]||_0x1d860b[_0x7dac('0x39')]!==_0x7dac('0x3a')){logger[_0x7dac('0x3b')](util[_0x7dac('0x9')](_0x7dac('0x3c'),_0x28f4bc['id']),util['inspect'](_0x1d860b,{'showHidden':![],'depth':null}));}}_0x2413ee();});});}function checkTranscribe(){var _0x2d2c8b;var _0xe61204;var _0x49804d;return db[_0x7dac('0x3d')][_0x7dac('0x3e')]({'where':{'transcribeStatus':_0x7dac('0x3f')}})[_0x7dac('0x2a')](function(_0x3cd7a9){if(!_0x3cd7a9||!_0x3cd7a9[_0x7dac('0x18')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x40'));}_0x2d2c8b=_0x3cd7a9;return db[_0x7dac('0x41')][_0x7dac('0x26')]({'where':{'id':0x1}});})[_0x7dac('0x2a')](function(_0x1da157){if(!_0x1da157){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))]('Settings\x20not\x20available');}_0xe61204=_0x1da157;if(!_0xe61204[_0x7dac('0x4')]||!_0xe61204['transcribeAccountId']||!_0xe61204[_0x7dac('0xd')]||!_0xe61204[_0x7dac('0x23')]||!_0xe61204['bucket']){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x42'));}return db['CloudProvider'][_0x7dac('0x26')]({'where':{'id':_0xe61204[_0x7dac('0x43')]}});})[_0x7dac('0x2a')](function(_0x33909c){if(!_0x33909c){throw new db[(_0x7dac('0x1d'))]['ValidationError'](_0x7dac('0x27'));}if(!_0x33909c[_0x7dac('0xc')]||!_0x33909c['data2']){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x28'));}_0x49804d=_0x33909c;var _0x5cd59c=[];_0x2d2c8b[_0x7dac('0x44')](function(_0x1d7739){_0x5cd59c[_0x7dac('0x45')](checkTranscribeJob(_0x1d7739,_0xe61204,_0x49804d));});return BPromise[_0x7dac('0x46')](_0x5cd59c);})[_0x7dac('0x38')](function(_0x3b71fb){if(_0x3b71fb){if(!_0x3b71fb[_0x7dac('0x39')]||_0x3b71fb['name']!=='SequelizeValidationError'){logger['error'](util[_0x7dac('0x47')](_0x3b71fb,{'showHidden':![],'depth':null}));}}});}exports[_0x7dac('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x236c=['substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeName','then','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','language','bucket','ValidationError','Transcript\x20not\x20available','CloudProvider','sentimentAccountId','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','sentimentRegion','update','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20configured','findOne','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','push','all','catch','inspect','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','detectSentiment'];(function(_0x2beb5d,_0x38d01b){var _0x3555a3=function(_0xecae16){while(--_0xecae16){_0x2beb5d['push'](_0x2beb5d['shift']());}};_0x3555a3(++_0x38d01b);}(_0x236c,0x155));var _0xc236=function(_0x401848,_0x3e47c2){_0x401848=_0x401848-0x0;var _0x25c3ec=_0x236c[_0x401848];return _0x25c3ec;};var _=require(_0xc236('0x0'));var AWS=require('aws-sdk');var rp=require(_0xc236('0x1'));var util=require(_0xc236('0x2'));var BPromise=require(_0xc236('0x3'));var db=require(_0xc236('0x4'))['db'];var logger=require(_0xc236('0x5'))('transcribe');function getTranscriptionJob(_0x3adce9,_0x36e87d,_0x33bc57,_0xd582f6){return new Promise(function(_0x23d3cc,_0x461c3a){var _0x5abd65=new AWS[(_0xc236('0x6'))]({'accessKeyId':_0x36e87d,'secretAccessKey':_0x3adce9,'region':_0x33bc57});_0x5abd65[_0xc236('0x7')]({'TranscriptionJobName':_0xd582f6},function(_0x51a13b,_0x5bc6a2){if(_0x51a13b){return _0x461c3a(_0x51a13b);}else{return _0x23d3cc(_0x5bc6a2);}});});}function sentiment(_0x5cdee5,_0xbb4620,_0x4b8dc6,_0x30a28d,_0x381ed1){return new Promise(function(_0x18f33b,_0x2f8b72){var _0xaf651b=new AWS['Comprehend']({'accessKeyId':_0xbb4620,'secretAccessKey':_0x5cdee5,'region':_0x4b8dc6});_0xaf651b[_0xc236('0x8')]({'Text':_0x30a28d,'LanguageCode':_0x381ed1[_0xc236('0x9')](0x0,0x2)},function(_0x58acb0,_0xcfe854){if(_0x58acb0){return _0x2f8b72(_0x58acb0);}else{return _0x18f33b(_0xcfe854);}});});}function checkTranscribeJob(_0x1bc39f,_0x5ee3a5,_0x5b9638){var _0x5bce83;return new BPromise(function(_0x599d36,_0x6db6b9){logger[_0xc236('0xa')](util[_0xc236('0xb')](_0xc236('0xc'),_0x1bc39f['id'],_0x1bc39f['transcribeName']));return getTranscriptionJob(_0x5b9638[_0xc236('0xd')],_0x5b9638['data2'],_0x5ee3a5['transcribeRegion'],_0x1bc39f[_0xc236('0xe')])[_0xc236('0xf')](function(_0x443a46){logger[_0xc236('0xa')](util[_0xc236('0xb')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x1bc39f['id'],_0x1bc39f['transcribeName'],_0x443a46['TranscriptionJob'][_0xc236('0x10')]));if(!_0x1bc39f[_0xc236('0x11')]){switch(_0x443a46[_0xc236('0x12')]['TranscriptionJobStatus']){case _0xc236('0x13'):var _0x506974={'transcribeStatus':_0x443a46['TranscriptionJob'][_0xc236('0x10')],'fileUri':_0x443a46[_0xc236('0x12')][_0xc236('0x14')][_0xc236('0x15')]};logger[_0xc236('0xa')](util[_0xc236('0xb')](_0xc236('0x16'),_0x1bc39f['id']));return rp({'uri':_0x443a46[_0xc236('0x12')][_0xc236('0x14')][_0xc236('0x15')],'json':!![]})[_0xc236('0xf')](function(_0x4a9006){logger[_0xc236('0xa')](util[_0xc236('0xb')](_0xc236('0x17'),_0x1bc39f['id']));if(_0x4a9006&&_0x4a9006[_0xc236('0x18')]&&_0x4a9006[_0xc236('0x18')][_0xc236('0x19')]&&_0x4a9006[_0xc236('0x18')][_0xc236('0x19')][_0xc236('0x1a')]){_0x506974[_0xc236('0x11')]='';for(var _0x17cb3b=0x0;_0x17cb3b<_0x4a9006['results'][_0xc236('0x19')][_0xc236('0x1a')];_0x17cb3b++){_0x506974[_0xc236('0x11')]+=_0x4a9006[_0xc236('0x18')]['transcripts'][_0x17cb3b][_0xc236('0x1b')]+'';}}return _0x1bc39f['update'](_0x506974);})['then'](function(){logger[_0xc236('0xa')](util['format'](_0xc236('0x1c'),_0x1bc39f['id']));if(!_0x1bc39f['tempSentiment']){throw new db[(_0xc236('0x1d'))]['ValidationError'](_0xc236('0x1e'));}if(!_0x5ee3a5[_0xc236('0x1f')]||!_0x5ee3a5['sentimentAccountId']||!_0x5ee3a5['sentimentRegion']||!_0x5ee3a5[_0xc236('0x20')]||!_0x5ee3a5[_0xc236('0x21')]){throw new db[(_0xc236('0x1d'))][(_0xc236('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x506974['fileText']){throw new Error(_0xc236('0x23'));}if(_0x5ee3a5['sentimentAccountId']===_0x5b9638['id']){return _0x5b9638;}else{return db[_0xc236('0x24')]['findOne']({'where':{'id':_settings[_0xc236('0x25')]}});}})[_0xc236('0xf')](function(_0x57c99e){if(!_0x57c99e){throw new db['Sequelize'][(_0xc236('0x22'))](_0xc236('0x26'));}if(!_0x57c99e[_0xc236('0xd')]||!_0x57c99e[_0xc236('0x27')]){throw new db[(_0xc236('0x1d'))][(_0xc236('0x22'))](_0xc236('0x28'));}_0x5bce83=_0x57c99e;logger[_0xc236('0xa')](util[_0xc236('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1bc39f['id']));return sentiment(_0x5bce83['data1'],_0x5bce83['data2'],_0x5ee3a5[_0xc236('0x29')],_0x506974[_0xc236('0x11')],_0x5ee3a5[_0xc236('0x20')]);})[_0xc236('0xf')](function(_0x2e117c){logger[_0xc236('0xa')](util[_0xc236('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1bc39f['id']));return _0x1bc39f[_0xc236('0x2a')]({'sentiment':_0x2e117c[_0xc236('0x2b')],'sPositive':_0x2e117c[_0xc236('0x2c')]['Positive'],'sNegative':_0x2e117c[_0xc236('0x2c')][_0xc236('0x2d')],'sMixed':_0x2e117c[_0xc236('0x2c')][_0xc236('0x2e')],'sNeutral':_0x2e117c['SentimentScore'][_0xc236('0x2f')]});})[_0xc236('0xf')](function(){logger[_0xc236('0xa')](util[_0xc236('0xb')](_0xc236('0x1c'),_0x1bc39f['id']));_0x599d36();});case _0xc236('0x30'):return _0x1bc39f[_0xc236('0x2a')]({'transcribeStatus':_0xc236('0x30'),'failureReason':_0x443a46[_0xc236('0x12')][_0xc236('0x31')]})[_0xc236('0xf')](function(){logger[_0xc236('0xa')](util[_0xc236('0xb')](_0xc236('0x1c'),_0x1bc39f['id']));_0x599d36();});default:logger[_0xc236('0xa')](util[_0xc236('0xb')](_0xc236('0x32'),_0x1bc39f['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x1bc39f['tempSentiment']){throw new db['Sequelize'][(_0xc236('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5ee3a5[_0xc236('0x1f')]||!_0x5ee3a5[_0xc236('0x25')]||!_0x5ee3a5[_0xc236('0x29')]||!_0x5ee3a5[_0xc236('0x20')]||!_0x5ee3a5[_0xc236('0x21')]){throw new db[(_0xc236('0x1d'))][(_0xc236('0x22'))](_0xc236('0x33'));}if(!_0x1bc39f[_0xc236('0x11')]){throw new Error(_0xc236('0x23'));}if(_0x5ee3a5[_0xc236('0x25')]===_0x5b9638['id']){return _0x5b9638;}else{return db[_0xc236('0x24')][_0xc236('0x34')]({'where':{'id':_settings[_0xc236('0x25')]}});}})[_0xc236('0xf')](function(_0x594ffc){if(!_0x594ffc){throw new db[(_0xc236('0x1d'))][(_0xc236('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x594ffc[_0xc236('0xd')]||!_0x594ffc['data2']){throw new db[(_0xc236('0x1d'))]['ValidationError'](_0xc236('0x28'));}_0x5bce83=_0x594ffc;logger[_0xc236('0xa')](util[_0xc236('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1bc39f['id']));return sentiment(_0x5bce83[_0xc236('0xd')],_0x5bce83[_0xc236('0x27')],_0x5ee3a5[_0xc236('0x29')],_0x1bc39f['fileText'],_0x5ee3a5[_0xc236('0x20')]);})[_0xc236('0xf')](function(_0x317431){logger[_0xc236('0xa')](util[_0xc236('0xb')](_0xc236('0x35'),_0x1bc39f['id']));return _0x1bc39f['update']({'sentiment':_0x317431[_0xc236('0x2b')],'sPositive':_0x317431['SentimentScore'][_0xc236('0x36')],'sNegative':_0x317431[_0xc236('0x2c')][_0xc236('0x2d')],'sMixed':_0x317431[_0xc236('0x2c')][_0xc236('0x2e')],'sNeutral':_0x317431[_0xc236('0x2c')][_0xc236('0x2f')],'transcribeStatus':'COMPLETED'});})[_0xc236('0xf')](function(){logger['info'](util[_0xc236('0xb')](_0xc236('0x1c'),_0x1bc39f['id']));_0x599d36();});}})['catch'](function(_0x12bfe2){if(_0x12bfe2){if(!_0x12bfe2[_0xc236('0x37')]||_0x12bfe2[_0xc236('0x37')]!==_0xc236('0x38')){logger[_0xc236('0x39')](util[_0xc236('0xb')](_0xc236('0x3a'),_0x1bc39f['id']),util['inspect'](_0x12bfe2,{'showHidden':![],'depth':null}));}}_0x599d36();});});}function checkTranscribe(){var _0x50dd50;var _0xcc0461;var _0x2afed2;return db['VoiceRecording'][_0xc236('0x3b')]({'where':{'transcribeStatus':_0xc236('0x3c')}})[_0xc236('0xf')](function(_0x7c856f){if(!_0x7c856f||!_0x7c856f[_0xc236('0x1a')]){throw new db[(_0xc236('0x1d'))][(_0xc236('0x22'))](_0xc236('0x3d'));}_0x50dd50=_0x7c856f;return db[_0xc236('0x3e')]['findOne']({'where':{'id':0x1}});})[_0xc236('0xf')](function(_0x307663){if(!_0x307663){throw new db[(_0xc236('0x1d'))][(_0xc236('0x22'))](_0xc236('0x3f'));}_0xcc0461=_0x307663;if(!_0xcc0461[_0xc236('0x40')]||!_0xcc0461[_0xc236('0x41')]||!_0xcc0461['transcribeRegion']||!_0xcc0461[_0xc236('0x20')]||!_0xcc0461[_0xc236('0x21')]){throw new db[(_0xc236('0x1d'))][(_0xc236('0x22'))]('Transcribe\x20not\x20configured');}return db[_0xc236('0x24')][_0xc236('0x34')]({'where':{'id':_0xcc0461[_0xc236('0x41')]}});})[_0xc236('0xf')](function(_0x9d81c8){if(!_0x9d81c8){throw new db['Sequelize'][(_0xc236('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x9d81c8[_0xc236('0xd')]||!_0x9d81c8[_0xc236('0x27')]){throw new db[(_0xc236('0x1d'))][(_0xc236('0x22'))](_0xc236('0x28'));}_0x2afed2=_0x9d81c8;var _0x49ad63=[];_0x50dd50['forEach'](function(_0x3bee67){_0x49ad63[_0xc236('0x42')](checkTranscribeJob(_0x3bee67,_0xcc0461,_0x2afed2));});return BPromise[_0xc236('0x43')](_0x49ad63);})[_0xc236('0x44')](function(_0x3c4256){if(_0x3c4256){if(!_0x3c4256[_0xc236('0x37')]||_0x3c4256[_0xc236('0x37')]!==_0xc236('0x38')){logger[_0xc236('0x39')](util[_0xc236('0x45')](_0x3c4256,{'showHidden':![],'depth':null}));}}});}exports['start']=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 eaa720b..6d384b7 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 _0x2e17=['length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../mysqldb','../logger','redis','defaults','localhost','WhatsappInteraction','hours'];(function(_0x1c6367,_0x1295c5){var _0x4be9b0=function(_0x1955ba){while(--_0x1955ba){_0x1c6367['push'](_0x1c6367['shift']());}};_0x4be9b0(++_0x1295c5);}(_0x2e17,0x98));var _0x72e1=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x2e17[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0x72e1('0x0'));var moment=require(_0x72e1('0x1'));var Redis=require('ioredis');var util=require(_0x72e1('0x2'));var config=require('../../config/environment');var db=require(_0x72e1('0x3'))['db'];var logger=require(_0x72e1('0x4'))('schedule');config[_0x72e1('0x5')]=_[_0x72e1('0x6')](config['redis'],{'host':_0x72e1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x72e1('0x5')]));function closeInteractions(){var _0x2fe2f1=[];return db[_0x72e1('0x8')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x72e1('0x9'))}}})['then'](function(_0x256ac9){if(_0x256ac9&&_0x256ac9[_0x72e1('0xa')]){_0x2fe2f1=_[_0x72e1('0xb')](_0x256ac9||[],'id');logger['info'](_0x72e1('0xc'),_0x2fe2f1[_0x72e1('0xd')]());return db[_0x72e1('0x8')][_0x72e1('0xe')]({'closeReason':'system','disposition':_0x72e1('0xf'),'closed':!![],'closedAt':moment()[_0x72e1('0x10')](_0x72e1('0x11'))},{'where':{'id':_0x2fe2f1}});}})[_0x72e1('0x12')](function(){if(_0x2fe2f1&&_0x2fe2f1[_0x72e1('0xa')]){logger['info'](_0x72e1('0x13'),_0x2fe2f1[_0x72e1('0xd')]());for(var _0x381ace=0x0;_0x381ace<_0x2fe2f1[_0x72e1('0xa')];_0x381ace++){io[_0x72e1('0x14')](_0x72e1('0x15'),{'id':_0x2fe2f1[_0x381ace],'closed':!![]});}}})[_0x72e1('0x16')](function(_0x4f7c64){logger[_0x72e1('0x17')](_0x72e1('0x18'),_0x4f7c64?util[_0x72e1('0x19')](_0x4f7c64,{'showHidden':![],'depth':null}):'');});}exports[_0x72e1('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd9aa=['../../mysqldb','../logger','schedule','socket.io-emitter','redis','WhatsappInteraction','lastMsgAt','hours','then','length','map','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment'];(function(_0x1209d3,_0x3be586){var _0x4cc79e=function(_0x136814){while(--_0x136814){_0x1209d3['push'](_0x1209d3['shift']());}};_0x4cc79e(++_0x3be586);}(_0xd9aa,0x91));var _0xad9a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xd9aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xad9a('0x0'));var moment=require(_0xad9a('0x1'));var Redis=require(_0xad9a('0x2'));var util=require(_0xad9a('0x3'));var config=require(_0xad9a('0x4'));var db=require(_0xad9a('0x5'))['db'];var logger=require(_0xad9a('0x6'))(_0xad9a('0x7'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xad9a('0x8'))(new Redis(config[_0xad9a('0x9')]));function closeInteractions(){var _0x14c554=[];return db[_0xad9a('0xa')]['findAll']({'raw':!![],'attributes':['id',_0xad9a('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xad9a('0xc'))}}})[_0xad9a('0xd')](function(_0x2d3cd1){if(_0x2d3cd1&&_0x2d3cd1[_0xad9a('0xe')]){_0x14c554=_[_0xad9a('0xf')](_0x2d3cd1||[],'id');logger[_0xad9a('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x14c554[_0xad9a('0x11')]());return db[_0xad9a('0xa')][_0xad9a('0x12')]({'closeReason':_0xad9a('0x13'),'disposition':_0xad9a('0x14'),'closed':!![],'closedAt':moment()[_0xad9a('0x15')](_0xad9a('0x16'))},{'where':{'id':_0x14c554}});}})[_0xad9a('0xd')](function(){if(_0x14c554&&_0x14c554[_0xad9a('0xe')]){logger['info'](_0xad9a('0x17'),_0x14c554['join']());for(var _0xcb74ad=0x0;_0xcb74ad<_0x14c554[_0xad9a('0xe')];_0xcb74ad++){io[_0xad9a('0x18')](_0xad9a('0x19'),{'id':_0x14c554[_0xcb74ad],'closed':!![]});}}})[_0xad9a('0x1a')](function(_0x40aa5c){logger['error'](_0xad9a('0x1b'),_0x40aa5c?util[_0xad9a('0x1c')](_0x40aa5c,{'showHidden':![],'depth':null}):'');});}exports[_0xad9a('0x1d')]=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 f607491..4347ced 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d01=['log','contacts1','CmHopper','finished\x20populating','contacts2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate'];(function(_0x59da9b,_0x32d178){var _0x3e0b44=function(_0x407cbd){while(--_0x407cbd){_0x59da9b['push'](_0x59da9b['shift']());}};_0x3e0b44(++_0x32d178);}(_0x6d01,0x7d));var _0x16d0=function(_0x139145,_0x4d64da){_0x139145=_0x139145-0x0;var _0xa4fb44=_0x6d01[_0x139145];return _0xa4fb44;};'use strict';var util=require('util');var db=require(_0x16d0('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x16d0('0x1')]({'id':i,'firstName':_0x16d0('0x2')+i,'lastName':_0x16d0('0x3')+i,'phone':0xf879fb460+i,'email':_0x16d0('0x4')+i+_0x16d0('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x16d0('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x16d0('0x6')](),'updatedAt':Date[_0x16d0('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x16d0('0x1')]({'id':i,'firstName':_0x16d0('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x16d0('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x16d0('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x16d0('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x16d0('0x6')]()});}db[_0x16d0('0x7')][_0x16d0('0x8')]({'where':{}})[_0x16d0('0x9')](function(){return db['CmContact'][_0x16d0('0xa')](contacts);})[_0x16d0('0x9')](function(){console[_0x16d0('0xb')]('finished\x20populating',_0x16d0('0xc'));return db[_0x16d0('0xd')][_0x16d0('0x8')]({'where':{}});})[_0x16d0('0x9')](function(){return db['CmHopper'][_0x16d0('0xa')](hopper);})[_0x16d0('0x9')](function(){console[_0x16d0('0xb')](_0x16d0('0xe'),'hopper1');return db['CmContact']['bulkCreate'](contacts2);})[_0x16d0('0x9')](function(){console[_0x16d0('0xb')](_0x16d0('0xe'),_0x16d0('0xf'));return db[_0x16d0('0xd')][_0x16d0('0xa')](hopper2);})[_0x16d0('0x9')](function(){console[_0x16d0('0xb')]('finished\x20populating','hopper2');})[_0x16d0('0x10')](function(_0x58767c){console[_0x16d0('0xb')](_0x58767c);}); \ No newline at end of file +var _0x1b08=['@xcally.com','push','now','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','contacts2','hopper2','util','../mysqldb','Innocenzo','innocenzo.biondo'];(function(_0x2b41cd,_0x2b4d13){var _0x4d021b=function(_0x3b969e){while(--_0x3b969e){_0x2b41cd['push'](_0x2b41cd['shift']());}};_0x4d021b(++_0x2b4d13);}(_0x1b08,0x1be));var _0x81b0=function(_0x1ab313,_0x12bccc){_0x1ab313=_0x1ab313-0x0;var _0x2d73f4=_0x1b08[_0x1ab313];return _0x2d73f4;};'use strict';var util=require(_0x81b0('0x0'));var db=require(_0x81b0('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x81b0('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x81b0('0x3')+i+_0x81b0('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x81b0('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x81b0('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x81b0('0x6')](),'updatedAt':Date[_0x81b0('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x81b0('0x5')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x81b0('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x81b0('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x81b0('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x81b0('0x6')](),'updatedAt':Date[_0x81b0('0x6')]()});}db[_0x81b0('0x7')][_0x81b0('0x8')]({'where':{}})[_0x81b0('0x9')](function(){return db[_0x81b0('0x7')]['bulkCreate'](contacts);})[_0x81b0('0x9')](function(){console[_0x81b0('0xa')](_0x81b0('0xb'),_0x81b0('0xc'));return db[_0x81b0('0xd')][_0x81b0('0x8')]({'where':{}});})[_0x81b0('0x9')](function(){return db[_0x81b0('0xd')][_0x81b0('0xe')](hopper);})['then'](function(){console['log'](_0x81b0('0xb'),_0x81b0('0xf'));return db['CmContact'][_0x81b0('0xe')](contacts2);})[_0x81b0('0x9')](function(){console[_0x81b0('0xa')]('finished\x20populating',_0x81b0('0x10'));return db[_0x81b0('0xd')][_0x81b0('0xe')](hopper2);})['then'](function(){console['log'](_0x81b0('0xb'),_0x81b0('0x11'));})['catch'](function(_0xa3ffd2){console['log'](_0xa3ffd2);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index fd43979..45f9253 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4389=['bulkCreate','then','log','add\x20user','util','push','format','%s%s','%s%s@xcally.com','agent','password','friend','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User'];(function(_0x58e3ed,_0xbeff77){var _0x4a738c=function(_0x59ffc7){while(--_0x59ffc7){_0x58e3ed['push'](_0x58e3ed['shift']());}};_0x4a738c(++_0xbeff77);}(_0x4389,0x130));var _0x9438=function(_0xd32f21,_0x1c2dfa){_0xd32f21=_0xd32f21-0x0;var _0x153bdc=_0x4389[_0xd32f21];return _0x153bdc;};'use strict';var util=require(_0x9438('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9438('0x1')]({'name':util[_0x9438('0x2')](_0x9438('0x3'),'agent',i),'fullname':util[_0x9438('0x2')](_0x9438('0x3'),'agent',i),'email':util[_0x9438('0x2')](_0x9438('0x4'),_0x9438('0x5'),i),'role':'agent','password':_0x9438('0x6'),'internal':0xfa0+i,'type':_0x9438('0x7'),'transport':['udp','ws','wss'],'disallow':[_0x9438('0x8')],'allow':[_0x9438('0x9')],'defaultuser':util[_0x9438('0x2')](_0x9438('0x3'),_0x9438('0x5'),i),'encryption':_0x9438('0xa'),'avpf':_0x9438('0xa'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0x9438('0xa'),'dtlsverify':'no','dtlscertfile':_0x9438('0xb'),'dtlsprivatekey':_0x9438('0xc'),'dtlssetup':_0x9438('0xd'),'callerid':util[_0x9438('0x2')](_0x9438('0xe'),util[_0x9438('0x2')](_0x9438('0x3'),_0x9438('0x5'),i),0xfa0+i)});}db[_0x9438('0xf')][_0x9438('0x10')](users)[_0x9438('0x11')](function(){console[_0x9438('0x12')](_0x9438('0x13'));})['catch'](function(_0x504179){console['log'](_0x504179);}); \ No newline at end of file +var _0x1f60=['udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','%s%s','User','then','log','add\x20user','../mysqldb','push','format','agent','%s%s@xcally.com','password','friend'];(function(_0x34f162,_0x531a92){var _0x12c054=function(_0xbdb7df){while(--_0xbdb7df){_0x34f162['push'](_0x34f162['shift']());}};_0x12c054(++_0x531a92);}(_0x1f60,0x1c5));var _0x01f6=function(_0x14f02f,_0x48c4d0){_0x14f02f=_0x14f02f-0x0;var _0x12cd9c=_0x1f60[_0x14f02f];return _0x12cd9c;};'use strict';var util=require('util');var db=require(_0x01f6('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x01f6('0x1')]({'name':util[_0x01f6('0x2')]('%s%s',_0x01f6('0x3'),i),'fullname':util[_0x01f6('0x2')]('%s%s',_0x01f6('0x3'),i),'email':util['format'](_0x01f6('0x4'),'agent',i),'role':'agent','password':_0x01f6('0x5'),'internal':0xfa0+i,'type':_0x01f6('0x6'),'transport':[_0x01f6('0x7'),'ws',_0x01f6('0x8')],'disallow':[_0x01f6('0x9')],'allow':[_0x01f6('0xa')],'defaultuser':util['format']('%s%s',_0x01f6('0x3'),i),'encryption':_0x01f6('0xb'),'avpf':_0x01f6('0xb'),'force_avp':_0x01f6('0xb'),'icesupport':_0x01f6('0xb'),'dtlsenable':_0x01f6('0xb'),'dtlsverify':'no','dtlscertfile':_0x01f6('0xc'),'dtlsprivatekey':_0x01f6('0xd'),'dtlssetup':'actpass','callerid':util[_0x01f6('0x2')](_0x01f6('0xe'),util[_0x01f6('0x2')](_0x01f6('0xf'),'agent',i),0xfa0+i)});}db[_0x01f6('0x10')]['bulkCreate'](users)[_0x01f6('0x11')](function(){console[_0x01f6('0x12')](_0x01f6('0x13'));})['catch'](function(_0xa49625){console[_0x01f6('0x12')](_0xa49625);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 8ff0309..3303a8b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f25=['chat','fax','sms','mail','openchannel','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','emit','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','connection','remoteAddress','request','remotePort','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','UserProfileResource','resourceId','map','User','Campaign','where','format','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','VoiceQueues','MailQueues','Trunks','getChatQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice'];(function(_0x1b8a6c,_0x4c2a5f){var _0x13ec3b=function(_0x53e579){while(--_0x53e579){_0x1b8a6c['push'](_0x1b8a6c['shift']());}};_0x13ec3b(++_0x4c2a5f);}(_0x8f25,0x14b));var _0x58f2=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x8f25[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x58f2('0x0'));var util=require(_0x58f2('0x1'));var BPromise=require(_0x58f2('0x2'));var db=require(_0x58f2('0x3'))['db'];var config=require(_0x58f2('0x4'));var queryQueues={'attributes':['id',_0x58f2('0x5')],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name',_0x58f2('0x6')],'raw':!![],'where':{'role':_0x58f2('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x58f2('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x58f2('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x58f2('0x5')],'where':{'role':_0x58f2('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x58f2('0x5'),_0x58f2('0x8')],'where':{'type':_0x58f2('0x9')}};function getAssociatedResources(_0xbe19cb,_0x30feef,_0x4b56c1){return db[_0x58f2('0xa')][_0x58f2('0xb')]({'where':{'name':_0xbe19cb,'userProfileId':_0x30feef},'raw':!![]})[_0x58f2('0xc')](function(_0x4242a6){if(_0x4242a6){if(_0x4242a6[_0x58f2('0xd')]){switch(_0xbe19cb){case'VoiceQueues':case _0x58f2('0xe'):case _0x58f2('0xf'):case _0x58f2('0x10'):case'MailQueues':case _0x58f2('0x11'):case _0x58f2('0x12'):return db[_0x4b56c1]['findAll'](queryQueues);case _0x58f2('0x13'):return db[_0x4b56c1][_0x58f2('0x14')](queryTelephones);case'Trunks':return db[_0x4b56c1][_0x58f2('0x14')](queryTrunks);case _0x58f2('0x15'):return db[_0x4b56c1][_0x58f2('0x14')](queryCampaigns);}}else{return db[_0x58f2('0x16')][_0x58f2('0x14')]({'attributes':[_0x58f2('0x17')],'where':{'sectionId':_0x4242a6['id']},'raw':!![]})[_0x58f2('0xc')](function(_0x1d3f73){if(_0x1d3f73){var _0x371e73={'where':{'id':_[_0x58f2('0x18')](_0x1d3f73,_0x58f2('0x17'))},'raw':!![]};switch(_0x4b56c1){case _0x58f2('0x19'):_0x371e73['where'][_0x58f2('0x6')]='telephone';break;case _0x58f2('0x1a'):_0x371e73[_0x58f2('0x1b')]['type']='ivr';break;}return db[_0x4b56c1]['findAll'](_0x371e73);}else{return[];}});}}else{return[];}})['then'](function(_0x2e6fa1){return _0x2e6fa1;});}function joinOrLeaveQueues(_0x16523e,_0x48ddb2,_0xf66efd,_0x28370e){_0x16523e[_0x48ddb2](util[_0x58f2('0x1c')]('%s:queue:%s',_0xf66efd,_0x28370e[_0x58f2('0x5')]));if(_0x28370e[_0x58f2('0x1d')]){for(var _0x4c537f=0x0;_0x4c537f<_0x28370e[_0x58f2('0x1d')][_0x58f2('0x1e')];_0x4c537f+=0x1){_0x16523e[_0x48ddb2](util['format'](_0x58f2('0x1f'),_0x28370e[_0x58f2('0x1d')][_0x4c537f][_0x58f2('0x5')]));}}}function joinOrLeave(_0x32ff95,_0x16fa72,_0x4084a4){var _0x2e83cf;if(_0x32ff95[_0x58f2('0x20')][_0x58f2('0x21')]['id']){db[_0x58f2('0x19')][_0x58f2('0x22')]({'attributes':['id',_0x58f2('0x5'),_0x58f2('0x6'),_0x58f2('0x23')],'where':{'id':_0x32ff95[_0x58f2('0x20')][_0x58f2('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x58f2('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x58f2('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x58f2('0x26')],'as':_0x58f2('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x58f2('0x28')],'as':_0x58f2('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x58f2('0x2a')],'as':_0x58f2('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x58f2('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x58f2('0xc')](function(_0x4b2b78){if(_0x4b2b78){_0x2e83cf=_0x4b2b78;_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')](_0x58f2('0x1f'),_0x4b2b78[_0x58f2('0x5')]));var _0x48b1f6=[];switch(_0x4b2b78['role']){case _0x58f2('0x2d'):_0x32ff95[_0x16fa72]('voice:inbound');_0x32ff95[_0x16fa72](_0x58f2('0x2e'));if(queryQueues[_0x58f2('0x2f')](_0x58f2('0x30'))){delete queryQueues[_0x58f2('0x30')];}_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x32')]['findAll'](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x33')][_0x58f2('0x14')](queryQueues));_0x48b1f6['push'](db[_0x58f2('0x34')][_0x58f2('0x14')](queryQueues));_0x48b1f6['push'](db[_0x58f2('0x35')][_0x58f2('0x14')](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x36')][_0x58f2('0x14')](queryQueues));_0x48b1f6['push'](db[_0x58f2('0x37')][_0x58f2('0x14')](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x38')][_0x58f2('0x14')](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x19')]['findAll'](queryTelephones));_0x48b1f6['push'](db[_0x58f2('0x39')][_0x58f2('0x14')](queryTrunks));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x1a')]['findAll'](queryCampaigns));_0x48b1f6[_0x58f2('0x31')](db['User']['findAll'](queryAgents));break;case _0x58f2('0x3a'):_0x32ff95[_0x16fa72](_0x58f2('0x3b'));_0x32ff95[_0x16fa72]('voice:outbound');_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x3c'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x32')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0xe'),_0x4b2b78[_0x58f2('0x23')],'ChatQueue'));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources('FaxQueues',_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x34')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x10'),_0x4b2b78['userProfileId'],_0x58f2('0x35')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x3d'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x36')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x11'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x37')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources('WhatsappQueues',_0x4b2b78['userProfileId'],_0x58f2('0x38')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources('Telephones',_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x19')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x3e'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x39')));_0x48b1f6['push'](getAssociatedResources(_0x58f2('0x15'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x1a')));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x19')][_0x58f2('0x14')](queryAgents));break;case'agent':_0x32ff95[_0x16fa72](_0x58f2('0x3b'));_0x32ff95[_0x16fa72]('voice:outbound');_0x48b1f6[_0x58f2('0x31')](_0x4b2b78['getVoiceQueues']({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6[_0x58f2('0x31')](_0x4b2b78[_0x58f2('0x3f')]({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6['push'](_0x4b2b78['getFaxQueues']({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6[_0x58f2('0x31')](_0x4b2b78[_0x58f2('0x40')]({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6['push'](_0x4b2b78['getMailQueues']({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6[_0x58f2('0x31')](_0x4b2b78[_0x58f2('0x41')]({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6['push'](_0x4b2b78[_0x58f2('0x42')]({'attributes':['id',_0x58f2('0x5')]}));break;}return BPromise[_0x58f2('0x43')](_0x48b1f6);}})[_0x58f2('0xc')](function(_0x5e151b){if(_0x5e151b&&_0x5e151b[_0x58f2('0x1e')]){for(var _0x1d499b=0x0;_0x1d499b<_0x5e151b[_0x58f2('0x1e')];_0x1d499b+=0x1){for(var _0x537061=0x0;_0x537061<_0x5e151b[_0x1d499b][_0x58f2('0x1e')];_0x537061+=0x1){switch(_0x1d499b){case 0x0:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x44'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x1:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x45'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x2:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x46'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x3:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x47'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x4:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x48'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x5:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x49'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x6:joinOrLeaveQueues(_0x32ff95,_0x16fa72,'whatsapp',_0x5e151b[_0x1d499b][_0x537061]);break;case 0x7:if(_0x2e83cf[_0x58f2('0x6')]!==_0x58f2('0x7'))_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')]('telephone:%s',_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;case 0x8:if(_0x2e83cf[_0x58f2('0x6')]!==_0x58f2('0x7'))_0x32ff95[_0x16fa72](util['format'](_0x58f2('0x4a'),_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;case 0x9:if(_0x2e83cf[_0x58f2('0x6')]!==_0x58f2('0x7'))_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')](_0x58f2('0x4b'),_0x5e151b[_0x1d499b][_0x537061]['type'],_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;case 0xa:_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')](_0x58f2('0x1f'),_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;}}}}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x5da2ee=_[_0x58f2('0x18')](_0x2e83cf[_0x58f2('0x24')],'id');return _0x2e83cf[_0x58f2('0x4d')](_0x5da2ee)['then'](function(){for(var _0x316f19=0x0;_0x316f19<_0x5da2ee[_0x58f2('0x1e')];_0x316f19+=0x1){_0x4084a4['emit'](_0x58f2('0x4e'),{'ChatInteractionId':Number(_0x5da2ee[_0x316f19]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x39d15d=_[_0x58f2('0x18')](_0x2e83cf[_0x58f2('0x25')],'id');return _0x2e83cf[_0x58f2('0x4f')](_0x39d15d)['then'](function(){for(var _0x5ace9f=0x0;_0x5ace9f<_0x39d15d[_0x58f2('0x1e')];_0x5ace9f+=0x1){_0x4084a4['emit'](_0x58f2('0x50'),{'MailInteractionId':Number(_0x39d15d[_0x5ace9f]),'UserId':Number(_0x2e83cf['id'])});}});}})['then'](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x241b79=_['map'](_0x2e83cf[_0x58f2('0x27')],'id');return _0x2e83cf['removeFaxInteractions'](_0x241b79)[_0x58f2('0xc')](function(){for(var _0x110d7b=0x0;_0x110d7b<_0x241b79[_0x58f2('0x1e')];_0x110d7b+=0x1){_0x4084a4[_0x58f2('0x51')](_0x58f2('0x52'),{'FaxInteractionId':Number(_0x241b79[_0x110d7b]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x544e61=_[_0x58f2('0x18')](_0x2e83cf['SmsInteractions'],'id');return _0x2e83cf[_0x58f2('0x53')](_0x544e61)[_0x58f2('0xc')](function(){for(var _0x4c54ae=0x0;_0x4c54ae<_0x544e61[_0x58f2('0x1e')];_0x4c54ae+=0x1){_0x4084a4[_0x58f2('0x51')](_0x58f2('0x54'),{'SmsInteractionId':Number(_0x544e61[_0x4c54ae]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x325755=_[_0x58f2('0x18')](_0x2e83cf['OpenchannelInteractions'],'id');return _0x2e83cf['removeOpenchannelInteractions'](_0x325755)[_0x58f2('0xc')](function(){for(var _0x59bfa9=0x0;_0x59bfa9<_0x325755[_0x58f2('0x1e')];_0x59bfa9+=0x1){_0x4084a4[_0x58f2('0x51')](_0x58f2('0x55'),{'OpenchannelInteractionId':Number(_0x325755[_0x59bfa9]),'UserId':Number(_0x2e83cf['id'])});}});}})['then'](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x550dd9=_['map'](_0x2e83cf[_0x58f2('0x2c')],'id');return _0x2e83cf['removeWhatsappInteractions'](_0x550dd9)[_0x58f2('0xc')](function(){for(var _0x431677=0x0;_0x431677<_0x550dd9[_0x58f2('0x1e')];_0x431677+=0x1){_0x4084a4['emit'](_0x58f2('0x56'),{'WhatsappInteractionId':Number(_0x550dd9[_0x431677]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0x57')](function(_0x371ccb){_0x32ff95[_0x58f2('0x58')](_0x371ccb);});}}function onDisconnect(_0x560e62,_0xcdc1e0){joinOrLeave(_0x560e62,'leave',_0xcdc1e0);}function onConnect(_0x5ccaeb){joinOrLeave(_0x5ccaeb,_0x58f2('0x59'));}exports['default']=function(_0x175f3f){_0x175f3f['on'](_0x58f2('0x5a'),function(_0x3a1418){_0x3a1418['setMaxListeners'](0x0);_0x3a1418['address']=_0x3a1418['request'][_0x58f2('0x5a')][_0x58f2('0x5b')]+':'+_0x3a1418[_0x58f2('0x5c')]['connection'][_0x58f2('0x5d')];_0x3a1418['connectedAt']=new Date();_0x3a1418[_0x58f2('0x58')]=function(_0x50d1ce){console[_0x58f2('0x58')](_0x58f2('0x5e')+_0x3a1418[_0x58f2('0x5f')][_0x58f2('0x5')]+'['+_0x3a1418[_0x58f2('0x60')]+']',_0x50d1ce);};_0x3a1418['on'](_0x58f2('0x61'),function(){onDisconnect(_0x3a1418,_0x175f3f);_0x3a1418[_0x58f2('0x58')](_0x58f2('0x62'));});onConnect(_0x3a1418);_0x3a1418[_0x58f2('0x58')](_0x58f2('0x63'));});}; \ No newline at end of file +var _0xafcb=['MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','where','Campaign','format','%s:queue:%s','Agents','length','user:%s','query','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','push','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','voice:outbound','userProfileId','VoiceQueue','ChatQueue','SmsQueues','OpenchannelQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','map','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','catch','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','log','SocketIO\x20','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues'];(function(_0x97bf23,_0x459503){var _0x219296=function(_0x47c944){while(--_0x47c944){_0x97bf23['push'](_0x97bf23['shift']());}};_0x219296(++_0x459503);}(_0xafcb,0xb6));var _0xbafc=function(_0x65f0de,_0x2d7dc4){_0x65f0de=_0x65f0de-0x0;var _0x2afdb3=_0xafcb[_0x65f0de];return _0x2afdb3;};'use strict';var _=require(_0xbafc('0x0'));var util=require(_0xbafc('0x1'));var BPromise=require(_0xbafc('0x2'));var db=require(_0xbafc('0x3'))['db'];var config=require(_0xbafc('0x4'));var queryQueues={'attributes':['id',_0xbafc('0x5')],'include':[{'as':'Agents','model':db[_0xbafc('0x6')],'attributes':['id',_0xbafc('0x5'),_0xbafc('0x7')],'raw':!![],'where':{'role':_0xbafc('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xbafc('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xbafc('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xbafc('0x5')],'where':{'role':_0xbafc('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xbafc('0xa')],'where':{'type':_0xbafc('0xb')}};function getAssociatedResources(_0x46a9d5,_0x4900a7,_0x47ecdf){return db['UserProfileSection'][_0xbafc('0xc')]({'where':{'name':_0x46a9d5,'userProfileId':_0x4900a7},'raw':!![]})[_0xbafc('0xd')](function(_0xbd68ed){if(_0xbd68ed){if(_0xbd68ed[_0xbafc('0xe')]){switch(_0x46a9d5){case _0xbafc('0xf'):case _0xbafc('0x10'):case _0xbafc('0x11'):case'SmsQueues':case _0xbafc('0x12'):case _0xbafc('0x13'):case _0xbafc('0x14'):return db[_0x47ecdf][_0xbafc('0x15')](queryQueues);case _0xbafc('0x16'):return db[_0x47ecdf]['findAll'](queryTelephones);case _0xbafc('0x17'):return db[_0x47ecdf]['findAll'](queryTrunks);case _0xbafc('0x18'):return db[_0x47ecdf]['findAll'](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0xbafc('0x19')],'where':{'sectionId':_0xbd68ed['id']},'raw':!![]})[_0xbafc('0xd')](function(_0x4fdc0b){if(_0x4fdc0b){var _0x2a0e99={'where':{'id':_['map'](_0x4fdc0b,_0xbafc('0x19'))},'raw':!![]};switch(_0x47ecdf){case'User':_0x2a0e99[_0xbafc('0x1a')]['role']=_0xbafc('0x9');break;case _0xbafc('0x1b'):_0x2a0e99['where'][_0xbafc('0xa')]='ivr';break;}return db[_0x47ecdf][_0xbafc('0x15')](_0x2a0e99);}else{return[];}});}}else{return[];}})[_0xbafc('0xd')](function(_0x79e09){return _0x79e09;});}function joinOrLeaveQueues(_0xdad822,_0x11d1ec,_0x39a715,_0x230914){_0xdad822[_0x11d1ec](util[_0xbafc('0x1c')](_0xbafc('0x1d'),_0x39a715,_0x230914[_0xbafc('0x5')]));if(_0x230914[_0xbafc('0x1e')]){for(var _0x1e5371=0x0;_0x1e5371<_0x230914[_0xbafc('0x1e')][_0xbafc('0x1f')];_0x1e5371+=0x1){_0xdad822[_0x11d1ec](util['format'](_0xbafc('0x20'),_0x230914['Agents'][_0x1e5371][_0xbafc('0x5')]));}}}function joinOrLeave(_0x4d825c,_0xfcb308,_0x3f0dca){var _0x5cec82;if(_0x4d825c['handshake'][_0xbafc('0x21')]['id']){db[_0xbafc('0x6')]['find']({'attributes':['id',_0xbafc('0x5'),_0xbafc('0x7'),'userProfileId'],'where':{'id':_0x4d825c[_0xbafc('0x22')]['query']['id']},'include':[{'model':db[_0xbafc('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbafc('0x24')],'as':_0xbafc('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xbafc('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbafc('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xbafc('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xbafc('0x29')],'as':_0xbafc('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xbafc('0xd')](function(_0x29ccea){if(_0x29ccea){_0x5cec82=_0x29ccea;_0x4d825c[_0xfcb308](util['format'](_0xbafc('0x20'),_0x29ccea[_0xbafc('0x5')]));var _0x871e69=[];switch(_0x29ccea[_0xbafc('0x7')]){case _0xbafc('0x2b'):_0x4d825c[_0xfcb308](_0xbafc('0x2c'));_0x4d825c[_0xfcb308]('voice:outbound');if(queryQueues[_0xbafc('0x2d')]('include')){delete queryQueues['include'];}_0x871e69[_0xbafc('0x2e')](db['VoiceQueue']['findAll'](queryQueues));_0x871e69[_0xbafc('0x2e')](db['ChatQueue'][_0xbafc('0x15')](queryQueues));_0x871e69['push'](db[_0xbafc('0x2f')][_0xbafc('0x15')](queryQueues));_0x871e69[_0xbafc('0x2e')](db[_0xbafc('0x30')][_0xbafc('0x15')](queryQueues));_0x871e69['push'](db[_0xbafc('0x31')][_0xbafc('0x15')](queryQueues));_0x871e69[_0xbafc('0x2e')](db['OpenchannelQueue'][_0xbafc('0x15')](queryQueues));_0x871e69[_0xbafc('0x2e')](db[_0xbafc('0x32')]['findAll'](queryQueues));_0x871e69[_0xbafc('0x2e')](db[_0xbafc('0x6')][_0xbafc('0x15')](queryTelephones));_0x871e69[_0xbafc('0x2e')](db[_0xbafc('0x33')][_0xbafc('0x15')](queryTrunks));_0x871e69[_0xbafc('0x2e')](db[_0xbafc('0x1b')][_0xbafc('0x15')](queryCampaigns));_0x871e69[_0xbafc('0x2e')](db[_0xbafc('0x6')][_0xbafc('0x15')](queryAgents));break;case _0xbafc('0x34'):_0x4d825c[_0xfcb308]('voice:inbound');_0x4d825c[_0xfcb308](_0xbafc('0x35'));_0x871e69[_0xbafc('0x2e')](getAssociatedResources('VoiceQueues',_0x29ccea[_0xbafc('0x36')],_0xbafc('0x37')));_0x871e69['push'](getAssociatedResources(_0xbafc('0x10'),_0x29ccea[_0xbafc('0x36')],_0xbafc('0x38')));_0x871e69['push'](getAssociatedResources(_0xbafc('0x11'),_0x29ccea[_0xbafc('0x36')],_0xbafc('0x2f')));_0x871e69[_0xbafc('0x2e')](getAssociatedResources(_0xbafc('0x39'),_0x29ccea[_0xbafc('0x36')],_0xbafc('0x30')));_0x871e69[_0xbafc('0x2e')](getAssociatedResources(_0xbafc('0x12'),_0x29ccea[_0xbafc('0x36')],'MailQueue'));_0x871e69[_0xbafc('0x2e')](getAssociatedResources(_0xbafc('0x13'),_0x29ccea[_0xbafc('0x36')],_0xbafc('0x3a')));_0x871e69[_0xbafc('0x2e')](getAssociatedResources('WhatsappQueues',_0x29ccea[_0xbafc('0x36')],'WhatsappQueue'));_0x871e69[_0xbafc('0x2e')](getAssociatedResources(_0xbafc('0x16'),_0x29ccea[_0xbafc('0x36')],_0xbafc('0x6')));_0x871e69[_0xbafc('0x2e')](getAssociatedResources(_0xbafc('0x17'),_0x29ccea[_0xbafc('0x36')],_0xbafc('0x33')));_0x871e69[_0xbafc('0x2e')](getAssociatedResources(_0xbafc('0x18'),_0x29ccea[_0xbafc('0x36')],_0xbafc('0x1b')));_0x871e69[_0xbafc('0x2e')](db['User'][_0xbafc('0x15')](queryAgents));break;case'agent':_0x4d825c[_0xfcb308](_0xbafc('0x2c'));_0x4d825c[_0xfcb308](_0xbafc('0x35'));_0x871e69[_0xbafc('0x2e')](_0x29ccea[_0xbafc('0x3b')]({'attributes':['id','name']}));_0x871e69['push'](_0x29ccea[_0xbafc('0x3c')]({'attributes':['id',_0xbafc('0x5')]}));_0x871e69['push'](_0x29ccea[_0xbafc('0x3d')]({'attributes':['id',_0xbafc('0x5')]}));_0x871e69['push'](_0x29ccea[_0xbafc('0x3e')]({'attributes':['id',_0xbafc('0x5')]}));_0x871e69[_0xbafc('0x2e')](_0x29ccea[_0xbafc('0x3f')]({'attributes':['id',_0xbafc('0x5')]}));_0x871e69[_0xbafc('0x2e')](_0x29ccea['getOpenchannelQueues']({'attributes':['id',_0xbafc('0x5')]}));_0x871e69['push'](_0x29ccea[_0xbafc('0x40')]({'attributes':['id','name']}));break;}return BPromise[_0xbafc('0x41')](_0x871e69);}})[_0xbafc('0xd')](function(_0x44686f){if(_0x44686f&&_0x44686f[_0xbafc('0x1f')]){for(var _0x5402e7=0x0;_0x5402e7<_0x44686f[_0xbafc('0x1f')];_0x5402e7+=0x1){for(var _0x14d85f=0x0;_0x14d85f<_0x44686f[_0x5402e7]['length'];_0x14d85f+=0x1){switch(_0x5402e7){case 0x0:joinOrLeaveQueues(_0x4d825c,_0xfcb308,_0xbafc('0x42'),_0x44686f[_0x5402e7][_0x14d85f]);break;case 0x1:joinOrLeaveQueues(_0x4d825c,_0xfcb308,'chat',_0x44686f[_0x5402e7][_0x14d85f]);break;case 0x2:joinOrLeaveQueues(_0x4d825c,_0xfcb308,_0xbafc('0x43'),_0x44686f[_0x5402e7][_0x14d85f]);break;case 0x3:joinOrLeaveQueues(_0x4d825c,_0xfcb308,_0xbafc('0x44'),_0x44686f[_0x5402e7][_0x14d85f]);break;case 0x4:joinOrLeaveQueues(_0x4d825c,_0xfcb308,_0xbafc('0x45'),_0x44686f[_0x5402e7][_0x14d85f]);break;case 0x5:joinOrLeaveQueues(_0x4d825c,_0xfcb308,'openchannel',_0x44686f[_0x5402e7][_0x14d85f]);break;case 0x6:joinOrLeaveQueues(_0x4d825c,_0xfcb308,_0xbafc('0x46'),_0x44686f[_0x5402e7][_0x14d85f]);break;case 0x7:if(_0x5cec82[_0xbafc('0x7')]!==_0xbafc('0x8'))_0x4d825c[_0xfcb308](util[_0xbafc('0x1c')](_0xbafc('0x47'),_0x44686f[_0x5402e7][_0x14d85f]['name']));break;case 0x8:if(_0x5cec82['role']!=='agent')_0x4d825c[_0xfcb308](util['format'](_0xbafc('0x48'),_0x44686f[_0x5402e7][_0x14d85f][_0xbafc('0x5')]));break;case 0x9:if(_0x5cec82[_0xbafc('0x7')]!=='agent')_0x4d825c[_0xfcb308](util[_0xbafc('0x1c')]('campaign:%s:%s',_0x44686f[_0x5402e7][_0x14d85f]['type'],_0x44686f[_0x5402e7][_0x14d85f][_0xbafc('0x5')]));break;case 0xa:_0x4d825c[_0xfcb308](util[_0xbafc('0x1c')](_0xbafc('0x20'),_0x44686f[_0x5402e7][_0x14d85f][_0xbafc('0x5')]));break;}}}}})[_0xbafc('0xd')](function(){if(_0xfcb308===_0xbafc('0x49')){var _0x4f6c02=_['map'](_0x5cec82['ChatInteractions'],'id');return _0x5cec82[_0xbafc('0x4a')](_0x4f6c02)[_0xbafc('0xd')](function(){for(var _0x4c4cfa=0x0;_0x4c4cfa<_0x4f6c02[_0xbafc('0x1f')];_0x4c4cfa+=0x1){_0x3f0dca[_0xbafc('0x4b')](_0xbafc('0x4c'),{'ChatInteractionId':Number(_0x4f6c02[_0x4c4cfa]),'UserId':Number(_0x5cec82['id'])});}});}})[_0xbafc('0xd')](function(){if(_0xfcb308==='leave'){var _0x41d332=_[_0xbafc('0x4d')](_0x5cec82[_0xbafc('0x25')],'id');return _0x5cec82[_0xbafc('0x4e')](_0x41d332)[_0xbafc('0xd')](function(){for(var _0x413212=0x0;_0x413212<_0x41d332[_0xbafc('0x1f')];_0x413212+=0x1){_0x3f0dca[_0xbafc('0x4b')](_0xbafc('0x4f'),{'MailInteractionId':Number(_0x41d332[_0x413212]),'UserId':Number(_0x5cec82['id'])});}});}})['then'](function(){if(_0xfcb308===_0xbafc('0x49')){var _0x4b0443=_[_0xbafc('0x4d')](_0x5cec82[_0xbafc('0x50')],'id');return _0x5cec82[_0xbafc('0x51')](_0x4b0443)[_0xbafc('0xd')](function(){for(var _0x3ea533=0x0;_0x3ea533<_0x4b0443[_0xbafc('0x1f')];_0x3ea533+=0x1){_0x3f0dca['emit'](_0xbafc('0x52'),{'FaxInteractionId':Number(_0x4b0443[_0x3ea533]),'UserId':Number(_0x5cec82['id'])});}});}})[_0xbafc('0xd')](function(){if(_0xfcb308==='leave'){var _0x51f92a=_['map'](_0x5cec82[_0xbafc('0x53')],'id');return _0x5cec82[_0xbafc('0x54')](_0x51f92a)['then'](function(){for(var _0xeaae37=0x0;_0xeaae37<_0x51f92a[_0xbafc('0x1f')];_0xeaae37+=0x1){_0x3f0dca[_0xbafc('0x4b')](_0xbafc('0x55'),{'SmsInteractionId':Number(_0x51f92a[_0xeaae37]),'UserId':Number(_0x5cec82['id'])});}});}})['then'](function(){if(_0xfcb308==='leave'){var _0x367881=_[_0xbafc('0x4d')](_0x5cec82[_0xbafc('0x28')],'id');return _0x5cec82['removeOpenchannelInteractions'](_0x367881)[_0xbafc('0xd')](function(){for(var _0x4e08b5=0x0;_0x4e08b5<_0x367881[_0xbafc('0x1f')];_0x4e08b5+=0x1){_0x3f0dca[_0xbafc('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x367881[_0x4e08b5]),'UserId':Number(_0x5cec82['id'])});}});}})[_0xbafc('0xd')](function(){if(_0xfcb308===_0xbafc('0x49')){var _0x1cf861=_[_0xbafc('0x4d')](_0x5cec82[_0xbafc('0x2a')],'id');return _0x5cec82[_0xbafc('0x56')](_0x1cf861)[_0xbafc('0xd')](function(){for(var _0x515409=0x0;_0x515409<_0x1cf861[_0xbafc('0x1f')];_0x515409+=0x1){_0x3f0dca[_0xbafc('0x4b')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x1cf861[_0x515409]),'UserId':Number(_0x5cec82['id'])});}});}})[_0xbafc('0x57')](function(_0x2dd89f){_0x4d825c['log'](_0x2dd89f);});}}function onDisconnect(_0x5c94ce,_0x5edf49){joinOrLeave(_0x5c94ce,_0xbafc('0x49'),_0x5edf49);}function onConnect(_0xb8cc2){joinOrLeave(_0xb8cc2,_0xbafc('0x58'));}exports[_0xbafc('0x59')]=function(_0x36c591){_0x36c591['on'](_0xbafc('0x5a'),function(_0x5d8150){_0x5d8150[_0xbafc('0x5b')](0x0);_0x5d8150[_0xbafc('0x5c')]=_0x5d8150[_0xbafc('0x5d')][_0xbafc('0x5a')]['remoteAddress']+':'+_0x5d8150['request'][_0xbafc('0x5a')][_0xbafc('0x5e')];_0x5d8150[_0xbafc('0x5f')]=new Date();_0x5d8150['log']=function(_0x1a6212){console[_0xbafc('0x60')](_0xbafc('0x61')+_0x5d8150['nsp'][_0xbafc('0x5')]+'['+_0x5d8150[_0xbafc('0x5c')]+']',_0x1a6212);};_0x5d8150['on']('disconnect',function(){onDisconnect(_0x5d8150,_0x36c591);_0x5d8150[_0xbafc('0x60')](_0xbafc('0x62'));});onConnect(_0x5d8150);_0x5d8150[_0xbafc('0x60')](_0xbafc('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 3a2d640..7167352 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 _0x1070=['MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','error','catch','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','User','find','name','fullname','email','format','SIP/%s','agent','incomingmessage','get','changed','closed','internal','interface','length','model','callback','condition','../../mysqldb','jayson/promise','../logger','triggers','lodash','client','http','Chat','ChatInteraction','afterCreate','ChatMessage','Sms','SmsInteraction','newinteraction','afterUpdate','closedinteraction','newmessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x1070,0x1a9));var _0x0107=function(_0x2f7a08,_0x13e677){_0x2f7a08=_0x2f7a08-0x0;var _0x48edf1=_0x1070[_0x2f7a08];return _0x48edf1;};'use strict';var util=require('util');var db=require(_0x0107('0x0'))['db'];var jayson=require(_0x0107('0x1'));var logger=require(_0x0107('0x2'))(_0x0107('0x3'));var _=require(_0x0107('0x4'));var client=jayson[_0x0107('0x5')][_0x0107('0x6')]({'port':0x232a});var triggers=[{'channel':_0x0107('0x7'),'model':_0x0107('0x8'),'event':_0x0107('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0107('0x7'),'model':_0x0107('0x8'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0107('0x7'),'model':_0x0107('0xa'),'event':_0x0107('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0107('0xb'),'model':_0x0107('0xc'),'event':_0x0107('0x9'),'condition':_0x0107('0xd'),'callback':afterCreate},{'channel':_0x0107('0xb'),'model':_0x0107('0xc'),'event':_0x0107('0xe'),'condition':_0x0107('0xf'),'callback':afterUpdate},{'channel':_0x0107('0xb'),'model':'SmsMessage','event':'afterCreate','condition':_0x0107('0x10'),'callback':afterCreateMessage},{'channel':_0x0107('0x11'),'model':_0x0107('0x12'),'event':_0x0107('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0107('0x11'),'model':_0x0107('0x12'),'event':_0x0107('0xe'),'condition':_0x0107('0xf'),'callback':afterUpdate},{'channel':_0x0107('0x11'),'model':'WhatsappMessage','event':_0x0107('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0107('0x13'),'model':'FaxInteraction','event':_0x0107('0x9'),'condition':_0x0107('0xd'),'callback':afterCreate},{'channel':_0x0107('0x13'),'model':_0x0107('0x14'),'event':_0x0107('0xe'),'condition':_0x0107('0xf'),'callback':afterUpdate},{'channel':_0x0107('0x13'),'model':_0x0107('0x15'),'event':_0x0107('0x9'),'condition':_0x0107('0x10'),'callback':afterCreateMessage},{'channel':_0x0107('0x16'),'model':_0x0107('0x17'),'event':_0x0107('0x9'),'condition':_0x0107('0xd'),'callback':afterCreate},{'channel':_0x0107('0x16'),'model':'MailInteraction','event':_0x0107('0xe'),'condition':_0x0107('0xf'),'callback':afterUpdate},{'channel':_0x0107('0x16'),'model':_0x0107('0x18'),'event':_0x0107('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0107('0x19'),'model':_0x0107('0x1a'),'event':_0x0107('0x9'),'condition':_0x0107('0xd'),'callback':afterCreate},{'channel':_0x0107('0x19'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x0107('0xf'),'callback':afterUpdate},{'channel':_0x0107('0x19'),'model':'OpenchannelMessage','event':_0x0107('0x9'),'condition':_0x0107('0x10'),'callback':afterCreateMessage}];function request(_0x28e5c1){return client[_0x0107('0x1b')](_0x0107('0x1c'),_0x28e5c1)[_0x0107('0x1d')](function(_0x40cd82){logger[_0x0107('0x1e')](_0x0107('0x1f'),'EventManager',_0x40cd82);if(_0x40cd82[_0x0107('0x20')]){if(_0x40cd82['error']['code']===0x1f4){logger[_0x0107('0x20')](_0x0107('0x1f'),_0x0107('0x1c'),_0x40cd82[_0x0107('0x20')]);}}})[_0x0107('0x21')](function(_0x411b6c){logger[_0x0107('0x20')](_0x0107('0x1f'),_0x0107('0x1c'),_0x411b6c);});}function afterCreateMessage(_0xa83d51,_0x5f474b){return function(_0x41277c,_0x1321f4){_0x41277c=_0x41277c['get']({'plain':!![]});_0x41277c[_0x0107('0x22')]=_0xa83d51;_0x41277c[_0x0107('0x23')]=_0x41277c[_0x0107('0x24')];var _0x2ec9b6=_0x0107('0x25')+_0x41277c[_0x0107('0x26')];return db[_0x0107('0x27')][_0x0107('0x28')](_0x2ec9b6,{'type':db[_0x0107('0x29')][_0x0107('0x2a')][_0x0107('0x2b')],'raw':!![]})[_0x0107('0x1d')](function(_0x5bdbd4){return _0x5bdbd4;})[_0x0107('0x1d')](function(_0x426ba6){if(_0x426ba6){_0x41277c[_0x0107('0x2c')]=_0x426ba6[0x0];}if(_0x41277c[_0x0107('0x2d')]){return db[_0x0107('0x2e')][_0x0107('0x2f')]({'where':{'id':_0x41277c[_0x0107('0x2d')]},'attributes':['id',_0x0107('0x30'),_0x0107('0x31'),_0x0107('0x32'),'internal'],'raw':!![]})['then'](function(_0x31bc50){_0x41277c['interface']=util[_0x0107('0x33')](_0x0107('0x34'),_0x31bc50['name']);_0x41277c[_0x0107('0x22')]=_0xa83d51;_0x41277c[_0x0107('0x35')]=_0x31bc50;return request({'event':_0x0107('0x36'),'message':_0x41277c});})[_0x0107('0x21')](function(_0x4240bd){console[_0x0107('0x20')](_0x4240bd);});}else{return request({'event':'outgoingmessage','message':_0x41277c});}});};}function afterCreate(_0x1c49d3,_0x2079ba){return function(_0x1f8615,_0x4a88b5){_0x1f8615=_0x1f8615[_0x0107('0x37')]({'plain':!![]});_0x1f8615[_0x0107('0x22')]=_0x1c49d3;_0x1f8615[_0x0107('0x23')]='opened';var _0x42a053=_0x0107('0x25')+_0x1f8615[_0x0107('0x26')];return db['sequelize']['query'](_0x42a053,{'type':db[_0x0107('0x29')][_0x0107('0x2a')]['SELECT'],'raw':!![]})[_0x0107('0x1d')](function(_0x5cfb5d){return _0x5cfb5d;})[_0x0107('0x1d')](function(_0x80e7fa){if(_0x80e7fa){_0x1f8615['contact']=_0x80e7fa[0x0];}return request({'event':_0x2079ba,'message':_0x1f8615});});};}function afterUpdate(_0x9331fd,_0x51a8db){return function(_0x4e6deb,_0x388e11){if(_0x4e6deb[_0x0107('0x38')]('closed')&&_0x4e6deb[_0x0107('0x39')]){_0x4e6deb=_0x4e6deb['get']({'plain':!![]});_0x4e6deb['channel']=_0x9331fd;_0x4e6deb[_0x0107('0x23')]='closed';var _0x1621a5=_0x0107('0x25')+_0x4e6deb[_0x0107('0x26')];return db[_0x0107('0x27')][_0x0107('0x28')](_0x1621a5,{'type':db[_0x0107('0x29')][_0x0107('0x2a')]['SELECT'],'raw':!![]})['then'](function(_0x4dc01c){return _0x4dc01c;})[_0x0107('0x1d')](function(_0x4f5500){if(_0x4f5500){_0x4e6deb[_0x0107('0x2c')]=_0x4f5500[0x0];}if(_0x4e6deb[_0x0107('0x2d')]){return db['User']['find']({'where':{'id':_0x4e6deb[_0x0107('0x2d')]},'attributes':['id','name','fullname','email',_0x0107('0x3a')],'raw':!![]})[_0x0107('0x1d')](function(_0x385929){_0x4e6deb[_0x0107('0x3b')]=util[_0x0107('0x33')](_0x0107('0x34'),_0x385929[_0x0107('0x30')]);_0x4e6deb[_0x0107('0x35')]=_0x385929;return request({'event':_0x51a8db,'message':_0x4e6deb});})[_0x0107('0x21')](function(_0x50b8f9){console['error'](_0x50b8f9);});}else{return request({'event':_0x51a8db,'message':_0x4e6deb});}});}};}exports['default']=function(){for(var _0x40df30=0x0;_0x40df30=_0xc602da[_0x0ff2('0x15')]){throw Error(_0x0ff2('0x16'));}_0x2a0495(_0x489c50);})[_0x0ff2('0x17')](function(_0x5e0a50){_0x47cc8d(_0x5e0a50);});});}; \ No newline at end of file +var _0xe901=['openchannel','getChannels','isValidChannel','toLowerCase','includes','isUndefined','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','fax','whatsapp'];(function(_0x227378,_0x2073f2){var _0x502efe=function(_0x4c6818){while(--_0x4c6818){_0x227378['push'](_0x227378['shift']());}};_0x502efe(++_0x2073f2);}(_0xe901,0x83));var _0x1e90=function(_0xdb7eb4,_0x36875a){_0xdb7eb4=_0xdb7eb4-0x0;var _0x27f8a7=_0xe901[_0xdb7eb4];return _0x27f8a7;};'use strict';var _=require(_0x1e90('0x0'));var BPromise=require(_0x1e90('0x1'));var db=require(_0x1e90('0x2'))['db'];var util=require(_0x1e90('0x3'));var channels=[_0x1e90('0x4'),'mail','chat',_0x1e90('0x5'),'sms',_0x1e90('0x6'),_0x1e90('0x7')];exports[_0x1e90('0x8')]=function(){return channels;};exports[_0x1e90('0x9')]=function(_0x557f99){_0x557f99=_0x557f99[_0x1e90('0xa')]();return _[_0x1e90('0xb')](channels,_0x557f99);};exports['clearBlockUser']=function(_0x2a5ce7,_0x4ac504,_0x5f1fd6,_0x17c61c){var _0x4da2c0={'loginAttempts':_0x4ac504,'blocked':_0x5f1fd6};if(!_[_0x1e90('0xc')](_0x17c61c)){_0x4da2c0['blockedAt']=_0x17c61c;}return _0x2a5ce7[_0x1e90('0xd')](_0x4da2c0);};exports[_0x1e90('0xe')]=function(_0xcc0378){return new BPromise(function(_0x4c9155,_0x507e56){var _0x1962bb=0x0;if(_0xcc0378[_0x1e90('0xf')]!==_0x1e90('0x10')){_0x4c9155(_0xcc0378);}db[_0x1e90('0x11')][_0x1e90('0x12')]({'where':{'role':_0x1e90('0x10'),'online':!![],'id':{'$ne':_0xcc0378['id']}}})[_0x1e90('0x13')](function(_0x55a562){_0x1962bb=_0x55a562;return util[_0x1e90('0xe')]();})[_0x1e90('0x13')](function(_0x3ed90b){if(_0x3ed90b&&_0x3ed90b['agents']&&_0x1962bb>=_0x3ed90b[_0x1e90('0x14')]){throw Error(_0x1e90('0x15'));}_0x4c9155(_0xcc0378);})[_0x1e90('0x16')](function(_0x297e74){_0x507e56(_0x297e74);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 629749a..afbd0fa 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3b2=['json','send','exports','404','render','status'];(function(_0xc6d176,_0xfbf195){var _0x40e95d=function(_0x14f112){while(--_0x14f112){_0xc6d176['push'](_0xc6d176['shift']());}};_0x40e95d(++_0xfbf195);}(_0xf3b2,0x152));var _0x2f3b=function(_0x3c192c,_0x5bd6f9){_0x3c192c=_0x3c192c-0x0;var _0x3d8f5b=_0xf3b2[_0x3c192c];return _0x3d8f5b;};'use strict';module[_0x2f3b('0x0')][0x194]=function pageNotFound(_0x4871ff,_0x440fa5){var _0x3d0ca4=_0x2f3b('0x1');var _0x41d158=0x194;var _0x3299a7={'status':_0x41d158};_0x440fa5['status'](_0x3299a7['status']);_0x440fa5[_0x2f3b('0x2')](_0x3d0ca4,{},function(_0x11857a,_0x47e3cf){if(_0x11857a){return _0x440fa5[_0x2f3b('0x3')](_0x3299a7[_0x2f3b('0x3')])[_0x2f3b('0x4')](_0x3299a7);}_0x440fa5[_0x2f3b('0x5')](_0x47e3cf);});}; \ No newline at end of file +var _0x9158=['exports','404','render','status','json','send'];(function(_0x519f99,_0x519778){var _0x3e7436=function(_0x14027d){while(--_0x14027d){_0x519f99['push'](_0x519f99['shift']());}};_0x3e7436(++_0x519778);}(_0x9158,0x16e));var _0x8915=function(_0x24cb11,_0xd5faf7){_0x24cb11=_0x24cb11-0x0;var _0x2a1bc0=_0x9158[_0x24cb11];return _0x2a1bc0;};'use strict';module[_0x8915('0x0')][0x194]=function pageNotFound(_0xf9865c,_0x3c4f04){var _0x4b7c5a=_0x8915('0x1');var _0x4e61b0=0x194;var _0x38d764={'status':_0x4e61b0};_0x3c4f04['status'](_0x38d764['status']);_0x3c4f04[_0x8915('0x2')](_0x4b7c5a,{},function(_0x41d3aa,_0x219506){if(_0x41d3aa){return _0x3c4f04[_0x8915('0x3')](_0x38d764[_0x8915('0x3')])[_0x8915('0x4')](_0x38d764);}_0x3c4f04[_0x8915('0x5')](_0x219506);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 9b809d9..5a2976f 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4205=['Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','belongsToMany','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_fax_interactions','SmsInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueue','MailQueues','UserMailQueue','ChatQueue','ChatQueues','FaxQueues','VoicePrefixes','user_has_voice_prefixes','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccount','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','belongsTo','TrunkBackup','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailAccountId','Imap','hasOne','Smtp','Dispositions','ListId','Template','TemplateId','Pause','mandatoryDispositionPause','team_has_mail_queues','Account','Owner','mail_interaction_has_tags','Tag','Users','Interaction','MailInteractionId','ChatWebsiteId','restrict','TagId','List','FaxAccountId','Answers','Interactions','FaxApplication','FaxMessage','FaxInteractionId','fax_interaction_has_tags','Tags','ThroughTags','AttachmentId','FaxQueueReport','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','user_has_openchannel_accounts','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CompanyId','JscriptySessions','Company','cm_contact_has_tags','CmHopper','Agent','Queue','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','Fields','DefaultReportId','MetricId','Configurations','AccountId','SalesforceConfiguration','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','Variable','VariableId','SugarcrmConfiguration','Description','int_desk_configuration_has_tags','ZohoField','ZendeskAccount','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerConfiguration','ServicenowConfiguration','ServicenowField','Dynamics365Configuration','Dynamics365Account','SessionId','JscriptyAnswerReport','ProjectId','user_has_teams','VoiceQueues','team_has_fax_queues','SmsQueues','OpenchannelQueues','WhatsappQueues','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','HopperHistory','Queues','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xcall','127.0.0.1','mysql','utf8mb4','name','xC@LL1234','utf8','database','username','password','options','sequelizeHistory','User','import','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopperBlack','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/tag/tag.model','../api/template/template.model','Trigger','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../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','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','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','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.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','Campaign','../api/campaign/campaign.model','Migration','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','VoiceMail','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','Extensions','OpenchannelInteractions','ChatInteractions','FaxInteraction','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x4205,0xd8));var _0x5420=function(_0x1e0dd4,_0x481103){_0x1e0dd4=_0x1e0dd4-0x0;var _0x11aaee=_0x4205[_0x1e0dd4];return _0x11aaee;};'use strict';var config=require(_0x5420('0x0'));var Sequelize=require(_0x5420('0x1'));var _=require(_0x5420('0x2'));var jstz=require(_0x5420('0x3'));var timezone=jstz[_0x5420('0x4')]();config[_0x5420('0x1')]=_[_0x5420('0x5')](config[_0x5420('0x1')],{'database':'motion2','username':_0x5420('0x6'),'password':'xC@LL1234','options':{'host':_0x5420('0x7'),'port':0xcea,'dialect':_0x5420('0x8'),'dialectOptions':{'charset':_0x5420('0x9')},'logging':![],'timezone':timezone[_0x5420('0xa')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config['sequelizeHistory']=_['defaultsDeep'](config['sequelizeHistory'],{'database':'motion2','username':_0x5420('0x6'),'password':_0x5420('0xb'),'options':{'host':_0x5420('0x7'),'port':0xcea,'dialect':_0x5420('0x8'),'dialectOptions':{'charset':_0x5420('0x9')},'logging':![],'timezone':timezone[_0x5420('0xa')](),'define':{'charset':_0x5420('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x5420('0x1')][_0x5420('0xd')],config['sequelize'][_0x5420('0xe')],config[_0x5420('0x1')][_0x5420('0xf')],config['sequelize'][_0x5420('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0x5420('0x11')][_0x5420('0xe')],config[_0x5420('0x11')][_0x5420('0xf')],config['sequelizeHistory'][_0x5420('0x10')])};db[_0x5420('0x12')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/user/user.model');db['VoiceChanSpy']=db[_0x5420('0x1')]['import'](_0x5420('0x14'));db['VoiceContext']=db['sequelize'][_0x5420('0x13')](_0x5420('0x15'));db[_0x5420('0x16')]=db[_0x5420('0x1')]['import']('../api/voiceExtension/voiceExtension.model');db[_0x5420('0x17')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x18'));db[_0x5420('0x19')]=db['sequelize'][_0x5420('0x13')](_0x5420('0x1a'));db[_0x5420('0x1b')]=db['sequelize'][_0x5420('0x13')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x1c'));db['VoiceMail']=db[_0x5420('0x1')]['import'](_0x5420('0x1d'));db[_0x5420('0x1e')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x5420('0x1f')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x20'));db['VoiceDialReport']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x21'));db[_0x5420('0x22')]=db[_0x5420('0x1')]['import'](_0x5420('0x23'));db[_0x5420('0x24')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x25'));db[_0x5420('0x26')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/memberReport/memberReport.model');db[_0x5420('0x27')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/trunk/trunk.model');db[_0x5420('0x28')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x29'));db[_0x5420('0x2a')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x2b'));db[_0x5420('0x2c')]=db['sequelize'][_0x5420('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x5420('0x2d')]=db['sequelize']['import'](_0x5420('0x2e'));db['UserMailQueue']=db['sequelize']['import'](_0x5420('0x2f'));db[_0x5420('0x30')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x31'));db[_0x5420('0x32')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x5420('0x33')]=db['sequelize'][_0x5420('0x13')](_0x5420('0x34'));db[_0x5420('0x35')]=db['sequelize'][_0x5420('0x13')](_0x5420('0x36'));db[_0x5420('0x37')]=db[_0x5420('0x1')]['import']('../api/mailServerIn/mailServerIn.model');db[_0x5420('0x38')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0x5420('0x39')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x3a'));db['MailQueue']=db[_0x5420('0x1')]['import'](_0x5420('0x3b'));db[_0x5420('0x3c')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x3d'));db['MailInteraction']=db[_0x5420('0x1')]['import'](_0x5420('0x3e'));db[_0x5420('0x3f')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x40'));db[_0x5420('0x41')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x42'));db[_0x5420('0x43')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x44'));db[_0x5420('0x45')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/dashboard/dashboard.model');db[_0x5420('0x46')]=db['sequelize'][_0x5420('0x13')](_0x5420('0x47'));db[_0x5420('0x48')]=db[_0x5420('0x1')]['import'](_0x5420('0x49'));db['FaxApplication']=db['sequelize'][_0x5420('0x13')](_0x5420('0x4a'));db['FaxInteraction']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x4b'));db['FaxMessage']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x4c'));db[_0x5420('0x4d')]=db[_0x5420('0x1')]['import'](_0x5420('0x4e'));db['FaxQueueReport']=db[_0x5420('0x1')][_0x5420('0x13')]('../api/faxQueueReport/faxQueueReport.model');db[_0x5420('0x4f')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x50'));db['SmsApplication']=db[_0x5420('0x1')]['import'](_0x5420('0x51'));db[_0x5420('0x52')]=db[_0x5420('0x1')]['import']('../api/smsInteraction/smsInteraction.model');db[_0x5420('0x53')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x54'));db[_0x5420('0x55')]=db['sequelize']['import'](_0x5420('0x56'));db['OpenchannelAccount']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x57'));db['OpenchannelApplication']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x58'));db[_0x5420('0x59')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x5a'));db[_0x5420('0x5b')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/openchannelMessage/openchannelMessage.model');db[_0x5420('0x5c')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x5d'));db[_0x5420('0x5e')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x5f'));db[_0x5420('0x60')]=db['sequelize'][_0x5420('0x13')](_0x5420('0x61'));db[_0x5420('0x62')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x63'));db[_0x5420('0x64')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x65'));db[_0x5420('0x66')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x67'));db[_0x5420('0x68')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x69'));db['ChatQueue']=db['sequelize']['import']('../api/chatQueue/chatQueue.model');db[_0x5420('0x6a')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x6b'));db[_0x5420('0x6c')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x6d'));db[_0x5420('0x6e')]=db['sequelize'][_0x5420('0x13')](_0x5420('0x6f'));db['CmContact']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x70'));db['CmHopper']=db[_0x5420('0x1')][_0x5420('0x13')]('../api/cmHopper/cmHopper.model');db[_0x5420('0x71')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x5420('0x72')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x5420('0x73')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x74'));db[_0x5420('0x75')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x76'));db[_0x5420('0x77')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x78'));db[_0x5420('0x79')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x7a'));db[_0x5420('0x7b')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x7c'));db[_0x5420('0x7d')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x7e'));db[_0x5420('0x7f')]=db['sequelize'][_0x5420('0x13')](_0x5420('0x80'));db[_0x5420('0x81')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/condition/condition.model');db[_0x5420('0x82')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x83'));db['Pause']=db[_0x5420('0x1')][_0x5420('0x13')]('../api/pause/pause.model');db[_0x5420('0x84')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x85'));db[_0x5420('0x86')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x87'));db[_0x5420('0x88')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x89'));db[_0x5420('0x8a')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/sound/sound.model');db['Tag']=db['sequelize'][_0x5420('0x13')](_0x5420('0x8b'));db['Template']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x8c'));db[_0x5420('0x8d')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/trigger/trigger.model');db['Variable']=db[_0x5420('0x1')][_0x5420('0x13')]('../api/variable/variable.model');db[_0x5420('0x8e')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x8f'));db[_0x5420('0x90')]=db[_0x5420('0x1')]['import']('../api/integrationReport/integrationReport.model');db[_0x5420('0x91')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x92'));db['AnalyticDefaultReport']=db['sequelize'][_0x5420('0x13')](_0x5420('0x93'));db['AnalyticExtractedReport']=db[_0x5420('0x1')][_0x5420('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x5420('0x94')]=db['sequelize'][_0x5420('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0x5420('0x95')]=db['sequelize'][_0x5420('0x13')](_0x5420('0x96'));db[_0x5420('0x97')]=db['sequelize'][_0x5420('0x13')](_0x5420('0x98'));db['SalesforceAccount']=db['sequelize'][_0x5420('0x13')](_0x5420('0x99'));db['SalesforceConfiguration']=db['sequelize'][_0x5420('0x13')](_0x5420('0x9a'));db['SalesforceField']=db['sequelize'][_0x5420('0x13')](_0x5420('0x9b'));db[_0x5420('0x9c')]=db['sequelize']['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x9d'));db[_0x5420('0x9e')]=db[_0x5420('0x1')]['import'](_0x5420('0x9f'));db[_0x5420('0xa0')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xa1'));db[_0x5420('0xa2')]=db['sequelize'][_0x5420('0x13')](_0x5420('0xa3'));db[_0x5420('0xa4')]=db['sequelize'][_0x5420('0x13')](_0x5420('0xa5'));db[_0x5420('0xa6')]=db['sequelize'][_0x5420('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x5420('0xa7')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xa8'));db['ZohoField']=db['sequelize'][_0x5420('0x13')](_0x5420('0xa9'));db['ZendeskAccount']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xaa'));db[_0x5420('0xab')]=db[_0x5420('0x1')]['import'](_0x5420('0xac'));db[_0x5420('0xad')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/intZendeskField/intZendeskField.model');db[_0x5420('0xae')]=db['sequelize']['import'](_0x5420('0xaf'));db[_0x5420('0xb0')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xb1'));db['FreshdeskField']=db[_0x5420('0x1')][_0x5420('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x5420('0x1')][_0x5420('0x13')]('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xb2'));db[_0x5420('0xb3')]=db[_0x5420('0x1')]['import'](_0x5420('0xb4'));db[_0x5420('0xb5')]=db['sequelize'][_0x5420('0x13')](_0x5420('0xb6'));db['ServicenowConfiguration']=db[_0x5420('0x1')][_0x5420('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db['sequelize'][_0x5420('0x13')](_0x5420('0xb7'));db['Dynamics365Account']=db['sequelize'][_0x5420('0x13')](_0x5420('0xb8'));db['Dynamics365Configuration']=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xb9'));db[_0x5420('0xba')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xbb'));db[_0x5420('0xbc')]=db['sequelize'][_0x5420('0x13')](_0x5420('0xbd'));db[_0x5420('0xbe')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xbf'));db[_0x5420('0xc0')]=db['sequelize'][_0x5420('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x5420('0x8e')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x8f'));db[_0x5420('0xc1')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xc2'));db[_0x5420('0xc3')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xc4'));db[_0x5420('0xc5')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x5420('0x1')][_0x5420('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x5420('0xc6')]=db[_0x5420('0x1')]['import'](_0x5420('0xc7'));db[_0x5420('0xc8')]=db['sequelize'][_0x5420('0x13')](_0x5420('0xc9'));db[_0x5420('0xca')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xcb'));db[_0x5420('0xcc')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xcd'));db[_0x5420('0xce')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xcf'));db[_0x5420('0xd0')]=db[_0x5420('0x1')]['import'](_0x5420('0xd1'));db[_0x5420('0xd2')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xd3'));db['SquareOdbc']=db[_0x5420('0x1')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x5420('0xd4')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xd5'));db[_0x5420('0xd6')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xd7'));db[_0x5420('0xd8')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xd9'));db[_0x5420('0xda')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xdb'));db[_0x5420('0xdc')]=db[_0x5420('0x1')]['import'](_0x5420('0xdd'));db[_0x5420('0xde')]=db['sequelize'][_0x5420('0x13')](_0x5420('0xdf'));db[_0x5420('0xe0')]=db[_0x5420('0x1')]['import']('../api/migration/migration.model');db[_0x5420('0xe1')]=db['sequelize'][_0x5420('0x13')]('../api/attachment/attachment.model');db[_0x5420('0xe2')]=db['sequelize'][_0x5420('0x13')](_0x5420('0xe3'));db[_0x5420('0xe4')]=db[_0x5420('0x1')]['import'](_0x5420('0xe5'));db[_0x5420('0xe6')]=db[_0x5420('0x1')]['import'](_0x5420('0xe7'));db[_0x5420('0xe8')]=db['sequelize'][_0x5420('0x13')](_0x5420('0xe9'));db[_0x5420('0xea')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xeb'));db[_0x5420('0xec')]=db[_0x5420('0x1')]['import'](_0x5420('0xed'));db[_0x5420('0xee')]=db[_0x5420('0x1')]['import']('../api/cmList/cmList.model');db[_0x5420('0xef')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xf0'));db[_0x5420('0xf1')]=db[_0x5420('0x1')]['import'](_0x5420('0xf2'));db[_0x5420('0xf3')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xf4'));db[_0x5420('0xf5')]=db['sequelize'][_0x5420('0x13')](_0x5420('0xf6'));db[_0x5420('0xf7')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xf8'));db[_0x5420('0xf9')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/whatsappAccount/whatsappAccount.model');db[_0x5420('0xfa')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xfb'));db[_0x5420('0xfc')]=db['sequelize'][_0x5420('0x13')](_0x5420('0xfd'));db[_0x5420('0xfe')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0xff'));db[_0x5420('0x100')]=db[_0x5420('0x1')][_0x5420('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db['sequelize'][_0x5420('0x13')](_0x5420('0x101'));db[_0x5420('0x102')]=db[_0x5420('0x1')][_0x5420('0x13')](_0x5420('0x103'));db[_0x5420('0x104')]=db[_0x5420('0x1')]['import']('../api/cloudProvider/cloudProvider.model');db[_0x5420('0x105')]=db['sequelize'][_0x5420('0x13')](_0x5420('0x106'));db[_0x5420('0x12')]['hasOne'](db[_0x5420('0x107')],{'as':_0x5420('0x107'),'onDelete':_0x5420('0x108'),'foreignKey':'UserId'});db[_0x5420('0x12')][_0x5420('0x109')](db['VoiceRecording'],{'as':_0x5420('0x10a'),'foreignKey':_0x5420('0x10b')});db[_0x5420('0x12')][_0x5420('0x109')](db[_0x5420('0x2a')],{'as':_0x5420('0x10c'),'foreignKey':_0x5420('0x10b')});db[_0x5420('0x12')][_0x5420('0x109')](db[_0x5420('0x16')],{'as':_0x5420('0x10d'),'onDelete':_0x5420('0x108'),'hooks':!![]});db[_0x5420('0x12')][_0x5420('0x109')](db[_0x5420('0x72')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x5420('0x12')][_0x5420('0x109')](db[_0x5420('0x73')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x5420('0x12')][_0x5420('0x109')](db[_0x5420('0x75')],{'as':_0x5420('0x75'),'foreignKey':_0x5420('0x10b')});db[_0x5420('0x12')][_0x5420('0x109')](db['OpenchannelInteraction'],{'as':_0x5420('0x10e'),'foreignKey':'UserId'});db[_0x5420('0x12')][_0x5420('0x109')](db[_0x5420('0x64')],{'as':_0x5420('0x10f'),'foreignKey':_0x5420('0x10b')});db[_0x5420('0x12')]['hasMany'](db[_0x5420('0x52')],{'as':'SmsInteractions','foreignKey':_0x5420('0x10b')});db['User']['hasMany'](db[_0x5420('0x110')],{'as':_0x5420('0x111'),'foreignKey':'UserId'});db[_0x5420('0x12')][_0x5420('0x109')](db[_0x5420('0x112')],{'as':_0x5420('0x113'),'foreignKey':'UserId'});db[_0x5420('0x12')][_0x5420('0x109')](db[_0x5420('0xfc')],{'as':_0x5420('0x114'),'foreignKey':_0x5420('0x10b')});db[_0x5420('0x12')][_0x5420('0x109')](db[_0x5420('0xf7')],{'as':_0x5420('0x115'),'foreignKey':_0x5420('0x116')});db[_0x5420('0x12')]['belongsTo'](db[_0x5420('0xf1')],{'as':'UserProfile','foreignKey':_0x5420('0x117')});db[_0x5420('0x12')]['belongsToMany'](db[_0x5420('0x6a')],{'as':_0x5420('0x118'),'through':_0x5420('0x119')});db[_0x5420('0x12')]['belongsToMany'](db[_0x5420('0x11a')],{'as':_0x5420('0x11b'),'through':_0x5420('0x11c')});db['User'][_0x5420('0x11d')](db[_0x5420('0xee')],{'as':_0x5420('0x11e'),'through':_0x5420('0x11f')});db['User'][_0x5420('0x11d')](db[_0x5420('0xda')],{'through':'user_has_teams'});db[_0x5420('0x12')][_0x5420('0x11d')](db['MailInteraction'],{'as':_0x5420('0x113'),'through':_0x5420('0x120')});db['User'][_0x5420('0x11d')](db[_0x5420('0x64')],{'as':_0x5420('0x10f'),'through':'user_has_chat_interactions'});db[_0x5420('0x12')][_0x5420('0x11d')](db['FaxInteraction'],{'as':_0x5420('0x111'),'through':_0x5420('0x121')});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0x52')],{'as':_0x5420('0x122'),'through':'user_has_sms_interactions'});db[_0x5420('0x12')][_0x5420('0x11d')](db['OpenchannelInteraction'],{'as':_0x5420('0x10e'),'through':_0x5420('0x123')});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0xfc')],{'as':_0x5420('0x114'),'through':_0x5420('0x124')});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0x19')],{'as':'VoiceQueues','through':_0x5420('0x2c'),'required':![]});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0x125')],{'as':_0x5420('0x126'),'through':_0x5420('0x127'),'required':![]});db['User'][_0x5420('0x11d')](db[_0x5420('0x128')],{'as':_0x5420('0x129'),'through':_0x5420('0x2d'),'required':![],'hooks':!![]});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0x4d')],{'as':_0x5420('0x12a'),'through':_0x5420('0x30'),'required':![]});db[_0x5420('0x12')]['belongsToMany'](db[_0x5420('0x55')],{'as':'SmsQueues','through':_0x5420('0x32'),'required':![]});db[_0x5420('0x12')][_0x5420('0x11d')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x5420('0x33'),'required':![]});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0x102')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0xee')],{'through':_0x5420('0x11f')});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0xef')],{'as':_0x5420('0x12b'),'through':_0x5420('0x12c'),'required':![]});db[_0x5420('0x12')]['belongsToMany'](db['ChatWebsite'],{'as':'ChatWebsites','through':_0x5420('0x12d')});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0x48')],{'as':_0x5420('0x12e'),'through':_0x5420('0x12f')});db[_0x5420('0x12')][_0x5420('0x11d')](db['MailAccount'],{'as':_0x5420('0x130'),'through':'user_has_mail_accounts'});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0x131')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0x5420('0x12')][_0x5420('0x11d')](db[_0x5420('0x4f')],{'as':'SmsAccounts','through':_0x5420('0x132')});db[_0x5420('0x12')][_0x5420('0x11d')](db['WhatsappAccount'],{'as':_0x5420('0x133'),'through':_0x5420('0x134')});db[_0x5420('0x12')]['belongsToMany'](db[_0x5420('0xd4')],{'as':_0x5420('0x135'),'through':_0x5420('0x136')});db[_0x5420('0x137')]['hasMany'](db[_0x5420('0x16')],{'as':_0x5420('0x138'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x139')});db[_0x5420('0x13a')]['hasMany'](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x5420('0x16')][_0x5420('0x109')](db[_0x5420('0x16')],{'as':_0x5420('0x13b'),'onDelete':_0x5420('0x108')});db[_0x5420('0x17')][_0x5420('0x11d')](db[_0x5420('0x8a')],{'as':_0x5420('0x13c'),'through':'moh_has_sounds'});db[_0x5420('0x19')][_0x5420('0x109')](db[_0x5420('0x2a')],{'as':_0x5420('0x13d'),'foreignKey':_0x5420('0x13e')});db[_0x5420('0x19')][_0x5420('0x109')](db['CmHopper'],{'as':_0x5420('0x13f'),'foreignKey':_0x5420('0x13e')});db[_0x5420('0x19')][_0x5420('0x109')](db[_0x5420('0x72')],{'as':_0x5420('0x140'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db['CmHopperHistory'],{'as':_0x5420('0x141'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x5420('0x75')],{'as':'ReportAgentPreview','foreignKey':_0x5420('0x13e')});db[_0x5420('0x19')]['hasMany'](db[_0x5420('0x71')],{'as':_0x5420('0x142'),'foreignKey':_0x5420('0x13e')});db[_0x5420('0x19')]['hasMany'](db[_0x5420('0xc8')],{'as':'JscriptySessions','foreignKey':_0x5420('0x13e')});db[_0x5420('0x19')][_0x5420('0x143')](db[_0x5420('0x27')],{'as':_0x5420('0x27'),'foreignKey':'TrunkId'});db[_0x5420('0x19')]['belongsTo'](db[_0x5420('0x27')],{'as':_0x5420('0x144'),'foreignKey':'TrunkBackupId'});db[_0x5420('0x19')][_0x5420('0x143')](db['Interval'],{'as':_0x5420('0x82'),'foreignKey':_0x5420('0x145')});db[_0x5420('0x19')][_0x5420('0x143')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x5420('0x146')});db[_0x5420('0x19')][_0x5420('0x11d')](db[_0x5420('0xee')],{'as':_0x5420('0x11e'),'through':_0x5420('0x147')});db[_0x5420('0x19')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x148'),'through':_0x5420('0x2c')});db[_0x5420('0x19')]['belongsToMany'](db[_0x5420('0xda')],{'as':_0x5420('0x149'),'through':_0x5420('0x105')});db[_0x5420('0x19')]['belongsToMany'](db['CmList'],{'as':_0x5420('0x14a'),'through':_0x5420('0x14b')});db['VoiceRecording']['belongsTo'](db[_0x5420('0x12')],{'as':_0x5420('0x12'),'foreignKey':_0x5420('0x10b')});db[_0x5420('0x14c')][_0x5420('0x143')](db[_0x5420('0x12')],{'as':'User','foreignKey':'UserId'});db['VoiceMail'][_0x5420('0x109')](db[_0x5420('0x1e')],{'as':_0x5420('0x14d'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x14e'),'sourceKey':_0x5420('0x14f')});db['VoiceMailMessage']['belongsTo'](db[_0x5420('0x107')],{'foreignKey':_0x5420('0x14e'),'targetKey':_0x5420('0x14f')});db['VoiceCallReport'][_0x5420('0x109')](db['VoiceQueueReport'],{'as':_0x5420('0x150'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x5420('0x22')],{'as':_0x5420('0x151'),'foreignKey':_0x5420('0x152'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x5420('0x12')],{'as':_0x5420('0x12'),'foreignKey':_0x5420('0x10b')});db[_0x5420('0x1f')][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db['MailServerIn'][_0x5420('0x143')](db[_0x5420('0x39')],{'as':_0x5420('0x39'),'foreignKey':'MailAccountId'});db[_0x5420('0x38')][_0x5420('0x143')](db[_0x5420('0x39')],{'as':'MailAccount','foreignKey':_0x5420('0x155')});db[_0x5420('0x39')]['hasOne'](db[_0x5420('0x37')],{'as':_0x5420('0x156'),'onDelete':_0x5420('0x108')});db[_0x5420('0x39')][_0x5420('0x157')](db[_0x5420('0x38')],{'as':_0x5420('0x158'),'onDelete':_0x5420('0x108')});db['MailAccount'][_0x5420('0x109')](db[_0x5420('0x7f')],{'as':_0x5420('0x159'),'foreignKey':'MailAccountId','onDelete':_0x5420('0x108')});db['MailAccount'][_0x5420('0x109')](db[_0x5420('0x7d')],{'as':'Answers','foreignKey':_0x5420('0x155')});db[_0x5420('0x39')]['hasMany'](db[_0x5420('0x3f')],{'as':_0x5420('0x14d'),'foreignKey':'MailAccountId'});db[_0x5420('0x39')][_0x5420('0x109')](db[_0x5420('0x112')],{'as':'Interactions'});db[_0x5420('0x39')]['hasMany'](db[_0x5420('0x41')],{'as':_0x5420('0x13b')});db[_0x5420('0x39')]['belongsTo'](db[_0x5420('0xee')],{'as':'List','foreignKey':_0x5420('0x15a')});db[_0x5420('0x39')]['belongsTo'](db['Template'],{'as':_0x5420('0x15b'),'foreignKey':_0x5420('0x15c')});db[_0x5420('0x39')]['belongsTo'](db[_0x5420('0x15d')],{'as':_0x5420('0x15e'),'foreignKey':_0x5420('0x146')});db[_0x5420('0x39')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x148'),'through':'user_has_mail_accounts'});db[_0x5420('0x125')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x148'),'through':_0x5420('0x127')});db['MailQueue']['belongsToMany'](db[_0x5420('0xda')],{'through':_0x5420('0x15f'),'as':_0x5420('0x149')});db[_0x5420('0x112')][_0x5420('0x109')](db[_0x5420('0x3f')],{'as':_0x5420('0x14d'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x5420('0x112')][_0x5420('0x143')](db[_0x5420('0x39')],{'as':_0x5420('0x160'),'foreignKey':'MailAccountId'});db[_0x5420('0x112')][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db[_0x5420('0x112')][_0x5420('0x143')](db[_0x5420('0x12')],{'as':_0x5420('0x161'),'foreignKey':_0x5420('0x10b')});db[_0x5420('0x112')][_0x5420('0x11d')](db['Tag'],{'through':_0x5420('0x162'),'as':'Tags'});db[_0x5420('0x112')][_0x5420('0x11d')](db[_0x5420('0x163')],{'through':_0x5420('0x162'),'as':'ThroughTags'});db['MailInteraction'][_0x5420('0x11d')](db['User'],{'as':_0x5420('0x164'),'through':_0x5420('0x120'),'foreignKey':'MailInteractionId'});db[_0x5420('0x3f')]['hasMany'](db['Attachment'],{'as':'Attachments','onDelete':_0x5420('0x108')});db[_0x5420('0x3f')]['belongsTo'](db['User'],{'as':_0x5420('0x12')});db[_0x5420('0x3f')][_0x5420('0x143')](db[_0x5420('0x11a')],{'onDelete':_0x5420('0x108'),'as':_0x5420('0x153')});db[_0x5420('0x3f')]['belongsTo'](db[_0x5420('0x112')],{'as':_0x5420('0x165'),'foreignKey':_0x5420('0x166')});db[_0x5420('0x3f')][_0x5420('0x143')](db[_0x5420('0x39')],{'as':'Account','foreignKey':_0x5420('0x155')});db[_0x5420('0x3f')][_0x5420('0x143')](db[_0x5420('0x5e')],{'as':_0x5420('0x5e'),'foreignKey':_0x5420('0x167')});db[_0x5420('0x3f')][_0x5420('0x143')](db[_0x5420('0x68')],{'as':_0x5420('0x68'),'foreignKey':'ChatOfflineMessageId'});db[_0x5420('0x41')][_0x5420('0x143')](db[_0x5420('0x12')],{'onDelete':_0x5420('0x168')});db[_0x5420('0x41')][_0x5420('0x143')](db[_0x5420('0x125')],{'onDelete':_0x5420('0x168')});db[_0x5420('0x41')][_0x5420('0x143')](db['MailAccount'],{'onDelete':_0x5420('0x168')});db[_0x5420('0x41')][_0x5420('0x143')](db[_0x5420('0x82')],{'onDelete':_0x5420('0x168'),'foreignKey':_0x5420('0x145')});db[_0x5420('0x41')][_0x5420('0x143')](db[_0x5420('0x163')],{'onDelete':_0x5420('0x168'),'foreignKey':_0x5420('0x169')});db['MailQueueReport'][_0x5420('0x143')](db[_0x5420('0x39')],{});db[_0x5420('0x43')]['belongsTo'](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':_0x5420('0x15a')});db[_0x5420('0x43')]['belongsTo'](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db[_0x5420('0x43')][_0x5420('0x143')](db[_0x5420('0x112')],{});db[_0x5420('0x43')][_0x5420('0x143')](db['MailMessage'],{});db[_0x5420('0x43')][_0x5420('0x143')](db[_0x5420('0x12')],{});db['MailQueueReport'][_0x5420('0x143')](db[_0x5420('0x125')],{});db[_0x5420('0x45')][_0x5420('0x109')](db['DashboardItem'],{'as':'Items','onDelete':_0x5420('0x108')});db[_0x5420('0x48')][_0x5420('0x109')](db['Disposition'],{'as':_0x5420('0x159'),'foreignKey':_0x5420('0x16b'),'onDelete':_0x5420('0x108')});db[_0x5420('0x48')][_0x5420('0x109')](db[_0x5420('0x7d')],{'as':_0x5420('0x16c'),'foreignKey':_0x5420('0x16b')});db[_0x5420('0x48')][_0x5420('0x109')](db['FaxInteraction'],{'as':_0x5420('0x16d')});db[_0x5420('0x48')][_0x5420('0x109')](db[_0x5420('0x16e')],{'as':_0x5420('0x13b')});db[_0x5420('0x48')]['hasMany'](db[_0x5420('0x16')],{'as':'Exntensions','onDelete':'cascade'});db['FaxAccount'][_0x5420('0x109')](db['FaxMessage'],{'as':_0x5420('0x14d')});db[_0x5420('0x48')][_0x5420('0x143')](db[_0x5420('0x27')],{'as':'Trunk'});db[_0x5420('0x48')]['belongsTo'](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':_0x5420('0x15a')});db[_0x5420('0x48')][_0x5420('0x143')](db['Pause'],{'as':_0x5420('0x15e'),'foreignKey':_0x5420('0x146')});db[_0x5420('0x48')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':'Agents','through':_0x5420('0x12f')});db[_0x5420('0x16e')][_0x5420('0x143')](db[_0x5420('0x12')],{'onDelete':_0x5420('0x168')});db[_0x5420('0x16e')][_0x5420('0x143')](db[_0x5420('0x4d')],{'onDelete':_0x5420('0x168')});db['FaxApplication']['belongsTo'](db[_0x5420('0x48')],{'onDelete':_0x5420('0x168')});db['FaxApplication'][_0x5420('0x143')](db[_0x5420('0x163')],{'onDelete':'restrict','foreignKey':_0x5420('0x169')});db[_0x5420('0x110')][_0x5420('0x109')](db[_0x5420('0x16f')],{'as':_0x5420('0x14d'),'onDelete':'cascade','foreignKey':_0x5420('0x170')});db[_0x5420('0x110')][_0x5420('0x143')](db[_0x5420('0x48')],{'as':'Account','foreignKey':_0x5420('0x16b')});db[_0x5420('0x110')]['belongsTo'](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db[_0x5420('0x110')][_0x5420('0x143')](db[_0x5420('0x12')],{'as':_0x5420('0x161'),'foreignKey':'UserId'});db[_0x5420('0x110')]['belongsToMany'](db['Tag'],{'through':_0x5420('0x171'),'as':_0x5420('0x172')});db[_0x5420('0x110')][_0x5420('0x11d')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x5420('0x173')});db[_0x5420('0x110')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0x5420('0x170')});db['FaxMessage']['belongsTo'](db[_0x5420('0x12')],{'onDelete':'cascade','as':'User'});db[_0x5420('0x16f')][_0x5420('0x143')](db[_0x5420('0x110')],{'as':_0x5420('0x165'),'foreignKey':'FaxInteractionId'});db[_0x5420('0x16f')][_0x5420('0x143')](db['CmContact'],{'onDelete':_0x5420('0x108'),'as':_0x5420('0x153')});db['FaxMessage'][_0x5420('0x143')](db[_0x5420('0xe1')],{'as':_0x5420('0xe1'),'foreignKey':_0x5420('0x174')});db[_0x5420('0x16f')][_0x5420('0x143')](db[_0x5420('0x48')],{'as':_0x5420('0x160'),'foreignKey':_0x5420('0x16b')});db[_0x5420('0x4d')][_0x5420('0x11d')](db['User'],{'as':_0x5420('0x148'),'through':_0x5420('0x30')});db[_0x5420('0x4d')][_0x5420('0x11d')](db[_0x5420('0xda')],{'through':'team_has_fax_queues','as':_0x5420('0x149')});db[_0x5420('0x175')][_0x5420('0x143')](db[_0x5420('0x48')],{});db[_0x5420('0x175')]['belongsTo'](db[_0x5420('0xee')],{'as':'List','foreignKey':_0x5420('0x15a')});db[_0x5420('0x175')][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db[_0x5420('0x175')][_0x5420('0x143')](db[_0x5420('0x110')],{});db[_0x5420('0x175')][_0x5420('0x143')](db[_0x5420('0x16f')],{});db[_0x5420('0x175')][_0x5420('0x143')](db['User'],{});db[_0x5420('0x175')][_0x5420('0x143')](db[_0x5420('0x4d')],{});db[_0x5420('0x4f')][_0x5420('0x109')](db[_0x5420('0x7f')],{'as':_0x5420('0x159'),'foreignKey':_0x5420('0x176'),'onDelete':_0x5420('0x108')});db['SmsAccount']['hasMany'](db[_0x5420('0x7d')],{'as':_0x5420('0x16c'),'foreignKey':_0x5420('0x176')});db['SmsAccount'][_0x5420('0x109')](db['SmsMessage'],{'as':'Messages','foreignKey':_0x5420('0x176')});db[_0x5420('0x4f')][_0x5420('0x109')](db[_0x5420('0x52')],{'as':_0x5420('0x16d')});db[_0x5420('0x4f')][_0x5420('0x109')](db[_0x5420('0x177')],{'as':_0x5420('0x13b')});db[_0x5420('0x4f')]['belongsTo'](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':'ListId'});db[_0x5420('0x4f')][_0x5420('0x143')](db[_0x5420('0x15d')],{'as':_0x5420('0x15e'),'foreignKey':_0x5420('0x146')});db[_0x5420('0x4f')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x148'),'through':_0x5420('0x132')});db[_0x5420('0x177')][_0x5420('0x143')](db[_0x5420('0x12')],{'onDelete':_0x5420('0x168')});db[_0x5420('0x177')][_0x5420('0x143')](db[_0x5420('0x55')],{'onDelete':_0x5420('0x168')});db[_0x5420('0x177')][_0x5420('0x143')](db[_0x5420('0x4f')],{'onDelete':_0x5420('0x168')});db['SmsApplication'][_0x5420('0x143')](db[_0x5420('0x82')],{'onDelete':_0x5420('0x168'),'foreignKey':_0x5420('0x145')});db['SmsApplication']['belongsTo'](db[_0x5420('0x163')],{'onDelete':_0x5420('0x168'),'foreignKey':_0x5420('0x169')});db[_0x5420('0x52')][_0x5420('0x109')](db[_0x5420('0x53')],{'as':_0x5420('0x14d'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x178')});db[_0x5420('0x52')][_0x5420('0x143')](db[_0x5420('0x4f')],{'as':'Account','foreignKey':_0x5420('0x176')});db['SmsInteraction'][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db['SmsInteraction']['belongsTo'](db[_0x5420('0x12')],{'as':_0x5420('0x161'),'foreignKey':_0x5420('0x10b')});db[_0x5420('0x52')][_0x5420('0x11d')](db['Tag'],{'through':_0x5420('0x179'),'as':_0x5420('0x172')});db['SmsInteraction'][_0x5420('0x11d')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x5420('0x173')});db['SmsInteraction']['belongsToMany'](db[_0x5420('0x12')],{'as':_0x5420('0x164'),'through':'user_has_sms_interactions','foreignKey':_0x5420('0x178')});db[_0x5420('0x53')][_0x5420('0x143')](db[_0x5420('0x12')],{'as':'User'});db['SmsMessage']['belongsTo'](db[_0x5420('0x11a')],{'onDelete':_0x5420('0x108'),'as':'Contact'});db[_0x5420('0x53')]['belongsTo'](db['SmsInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x5420('0x143')](db[_0x5420('0x4f')],{'as':_0x5420('0x160'),'foreignKey':_0x5420('0x176')});db[_0x5420('0x55')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x148'),'through':_0x5420('0x32'),'foreignKey':_0x5420('0x17a')});db['SmsQueue'][_0x5420('0x11d')](db['Team'],{'through':_0x5420('0x17b'),'as':_0x5420('0x149')});db[_0x5420('0x131')][_0x5420('0x109')](db[_0x5420('0x7f')],{'as':_0x5420('0x159'),'foreignKey':'OpenchannelAccountId','onDelete':_0x5420('0x108')});db[_0x5420('0x131')][_0x5420('0x109')](db[_0x5420('0x7d')],{'as':_0x5420('0x16c'),'foreignKey':_0x5420('0x17c')});db[_0x5420('0x131')][_0x5420('0x109')](db[_0x5420('0x59')],{'as':_0x5420('0x16d'),'foreignKey':_0x5420('0x17c')});db[_0x5420('0x131')][_0x5420('0x109')](db[_0x5420('0x5b')],{'as':_0x5420('0x14d'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x5420('0x109')](db[_0x5420('0x17d')],{'as':_0x5420('0x13b'),'foreignKey':_0x5420('0x17c')});db[_0x5420('0x131')]['belongsTo'](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':'ListId'});db[_0x5420('0x131')][_0x5420('0x143')](db[_0x5420('0x15d')],{'as':'mandatoryDispositionPause','foreignKey':_0x5420('0x146')});db[_0x5420('0x131')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x148'),'through':_0x5420('0x17e')});db['OpenchannelApplication'][_0x5420('0x143')](db['User'],{'onDelete':_0x5420('0x168')});db[_0x5420('0x17d')]['belongsTo'](db[_0x5420('0x5c')],{'onDelete':_0x5420('0x168'),'foreignKey':_0x5420('0x17f')});db['OpenchannelApplication'][_0x5420('0x143')](db[_0x5420('0x131')],{'onDelete':_0x5420('0x168'),'foreignKey':_0x5420('0x17c')});db['OpenchannelApplication'][_0x5420('0x143')](db[_0x5420('0x82')],{'onDelete':'restrict','foreignKey':_0x5420('0x145')});db[_0x5420('0x17d')][_0x5420('0x143')](db[_0x5420('0x163')],{'onDelete':_0x5420('0x168'),'foreignKey':_0x5420('0x169')});db[_0x5420('0x59')][_0x5420('0x109')](db[_0x5420('0x5b')],{'as':_0x5420('0x14d'),'onDelete':_0x5420('0x108'),'foreignKey':'OpenchannelInteractionId'});db[_0x5420('0x59')][_0x5420('0x143')](db[_0x5420('0x131')],{'as':'Account','foreignKey':_0x5420('0x17c')});db[_0x5420('0x59')][_0x5420('0x143')](db['CmContact'],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db[_0x5420('0x59')]['belongsTo'](db[_0x5420('0x12')],{'as':_0x5420('0x161'),'foreignKey':'UserId'});db[_0x5420('0x59')][_0x5420('0x11d')](db[_0x5420('0x163')],{'through':_0x5420('0x180'),'as':_0x5420('0x172')});db['OpenchannelInteraction'][_0x5420('0x11d')](db[_0x5420('0x163')],{'through':'openchannel_interaction_has_tags','as':_0x5420('0x173')});db[_0x5420('0x59')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x164'),'through':_0x5420('0x123'),'foreignKey':_0x5420('0x181')});db[_0x5420('0x5b')][_0x5420('0x143')](db[_0x5420('0x12')],{'onDelete':'cascade','as':_0x5420('0x12')});db['OpenchannelMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x5420('0x108'),'as':_0x5420('0x153')});db[_0x5420('0x5b')][_0x5420('0x143')](db[_0x5420('0x59')],{'onDelete':_0x5420('0x108'),'as':_0x5420('0x165'),'foreignKey':_0x5420('0x181')});db[_0x5420('0x5b')][_0x5420('0x143')](db[_0x5420('0xe1')],{'as':'Attachment','foreignKey':_0x5420('0x174')});db[_0x5420('0x5b')][_0x5420('0x143')](db[_0x5420('0x131')],{'as':_0x5420('0x160'),'foreignKey':'OpenchannelAccountId'});db[_0x5420('0x5c')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x148'),'through':_0x5420('0x33'),'foreignKey':_0x5420('0x17f')});db[_0x5420('0x5c')][_0x5420('0x11d')](db[_0x5420('0xda')],{'through':_0x5420('0x182'),'as':_0x5420('0x149')});db[_0x5420('0x5e')][_0x5420('0x109')](db[_0x5420('0x7f')],{'as':_0x5420('0x159'),'foreignKey':_0x5420('0x167'),'onDelete':_0x5420('0x108')});db[_0x5420('0x5e')][_0x5420('0x109')](db['CannedAnswer'],{'as':_0x5420('0x16c'),'foreignKey':_0x5420('0x167')});db['ChatWebsite'][_0x5420('0x109')](db[_0x5420('0x6c')],{'as':'ProactiveActions'});db[_0x5420('0x5e')][_0x5420('0x109')](db[_0x5420('0x64')],{'as':_0x5420('0x16d')});db[_0x5420('0x5e')]['hasMany'](db['ChatApplication'],{'as':_0x5420('0x13b')});db['ChatWebsite'][_0x5420('0x109')](db['ChatMessage'],{'as':_0x5420('0x14d')});db[_0x5420('0x5e')]['belongsTo'](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':_0x5420('0x15a')});db['ChatWebsite'][_0x5420('0x143')](db[_0x5420('0x82')],{'as':_0x5420('0x82'),'foreignKey':_0x5420('0x145')});db[_0x5420('0x5e')][_0x5420('0x143')](db[_0x5420('0x39')],{'as':_0x5420('0x39'),'foreignKey':'MailAccountId'});db[_0x5420('0x5e')][_0x5420('0x143')](db[_0x5420('0x15d')],{'as':_0x5420('0x15e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x5420('0x5e')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':'Agents','through':_0x5420('0x12d')});db[_0x5420('0x60')]['belongsTo'](db[_0x5420('0x131')],{});db[_0x5420('0x60')][_0x5420('0x143')](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':'ListId'});db[_0x5420('0x60')][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':'Contact','foreignKey':_0x5420('0x154')});db[_0x5420('0x60')][_0x5420('0x143')](db[_0x5420('0x59')],{});db[_0x5420('0x60')][_0x5420('0x143')](db[_0x5420('0x5b')],{});db['OpenchannelQueueReport']['belongsTo'](db['User'],{});db['OpenchannelQueueReport'][_0x5420('0x143')](db['OpenchannelQueue'],{});db[_0x5420('0x62')][_0x5420('0x143')](db[_0x5420('0x12')],{'as':'Agent','foreignKey':_0x5420('0x10b'),'onDelete':_0x5420('0x168')});db[_0x5420('0x62')][_0x5420('0x143')](db['ChatQueue'],{'as':'Queue','foreignKey':_0x5420('0x183'),'onDelete':_0x5420('0x168')});db[_0x5420('0x62')]['belongsTo'](db['ChatWebsite'],{'as':_0x5420('0x184'),'foreignKey':_0x5420('0x167'),'onDelete':_0x5420('0x168')});db[_0x5420('0x62')]['belongsTo'](db[_0x5420('0x163')],{'onDelete':'restrict','foreignKey':_0x5420('0x169')});db[_0x5420('0x64')]['hasMany'](db[_0x5420('0x66')],{'as':_0x5420('0x14d'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x185')});db[_0x5420('0x64')]['belongsTo'](db[_0x5420('0x5e')],{'as':_0x5420('0x160'),'foreignKey':_0x5420('0x167')});db[_0x5420('0x64')][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db[_0x5420('0x64')][_0x5420('0x143')](db[_0x5420('0x12')],{'as':'Owner','foreignKey':_0x5420('0x10b')});db['ChatInteraction'][_0x5420('0x11d')](db[_0x5420('0x163')],{'through':_0x5420('0x186'),'as':'Tags'});db['ChatInteraction'][_0x5420('0x11d')](db[_0x5420('0x163')],{'through':_0x5420('0x186'),'as':_0x5420('0x173')});db[_0x5420('0x64')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x164'),'through':'user_has_chat_interactions','foreignKey':_0x5420('0x185')});db[_0x5420('0x66')][_0x5420('0x143')](db[_0x5420('0x12')],{'onDelete':_0x5420('0x108'),'as':_0x5420('0x12')});db[_0x5420('0x66')][_0x5420('0x143')](db[_0x5420('0x11a')],{'onDelete':_0x5420('0x108'),'as':'Contact','foreignKey':_0x5420('0x154')});db[_0x5420('0x66')]['belongsTo'](db[_0x5420('0x64')],{'onDelete':_0x5420('0x108'),'as':_0x5420('0x165'),'foreignKey':_0x5420('0x185')});db['ChatMessage'][_0x5420('0x143')](db['Attachment'],{'as':'Attachment','foreignKey':_0x5420('0x174')});db[_0x5420('0x66')][_0x5420('0x143')](db[_0x5420('0x5e')],{'as':'Account','foreignKey':_0x5420('0x167')});db['ChatOfflineMessage'][_0x5420('0x109')](db['Attachment'],{'as':_0x5420('0x187'),'foreignKey':_0x5420('0x188'),'onDelete':_0x5420('0x108'),'hooks':!![]});db['ChatOfflineMessage'][_0x5420('0x143')](db[_0x5420('0x11a')],{'onDelete':'cascade','as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db[_0x5420('0x68')][_0x5420('0x143')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x5420('0x167')});db['ChatQueue'][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x148'),'through':'UserChatQueue','hooks':!![]});db[_0x5420('0x128')][_0x5420('0x11d')](db[_0x5420('0xda')],{'through':_0x5420('0x189'),'as':_0x5420('0x149')});db['ChatGroup']['hasMany'](db[_0x5420('0xc5')],{'as':'Messages','foreignKey':_0x5420('0x18a'),'onDelete':_0x5420('0x108')});db[_0x5420('0x6a')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x13d'),'through':_0x5420('0x119')});db[_0x5420('0x6c')][_0x5420('0x143')](db[_0x5420('0x5e')],{'as':'Website','foreignKey':_0x5420('0x167')});db['CmCompany']['hasMany'](db['CmContact'],{'as':_0x5420('0x11b'),'foreignKey':_0x5420('0x18b')});db[_0x5420('0x11a')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x5420('0x154')});db[_0x5420('0x11a')][_0x5420('0x109')](db[_0x5420('0x72')],{'as':'HopperFinals','foreignKey':_0x5420('0x154')});db[_0x5420('0x11a')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'ContactId'});db['CmContact'][_0x5420('0x109')](db[_0x5420('0x75')],{'as':_0x5420('0x75'),'foreignKey':'ContactId'});db[_0x5420('0x11a')][_0x5420('0x109')](db['JscriptySessionReport'],{'as':_0x5420('0x18c'),'foreignKey':_0x5420('0x154')});db[_0x5420('0x11a')][_0x5420('0x109')](db[_0x5420('0x59')],{'as':_0x5420('0x10e'),'foreignKey':'ContactId','onDelete':_0x5420('0x168')});db[_0x5420('0x11a')][_0x5420('0x109')](db[_0x5420('0x64')],{'as':_0x5420('0x10f'),'foreignKey':_0x5420('0x154'),'onDelete':'restrict'});db[_0x5420('0x11a')][_0x5420('0x109')](db[_0x5420('0x52')],{'as':_0x5420('0x122'),'foreignKey':_0x5420('0x154'),'onDelete':'restrict'});db[_0x5420('0x11a')][_0x5420('0x109')](db[_0x5420('0x110')],{'as':_0x5420('0x111'),'foreignKey':_0x5420('0x154'),'onDelete':_0x5420('0x168')});db[_0x5420('0x11a')][_0x5420('0x109')](db[_0x5420('0x112')],{'as':_0x5420('0x113'),'foreignKey':_0x5420('0x154'),'onDelete':_0x5420('0x168')});db[_0x5420('0x11a')][_0x5420('0x143')](db[_0x5420('0x6e')],{'as':_0x5420('0x18d'),'foreignKey':_0x5420('0x18b')});db[_0x5420('0x11a')][_0x5420('0x143')](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':_0x5420('0x15a'),'onDelete':_0x5420('0x108')});db[_0x5420('0x11a')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x164'),'through':_0x5420('0x11c')});db['CmContact'][_0x5420('0x11d')](db[_0x5420('0x163')],{'as':_0x5420('0x172'),'through':'cm_contact_has_tags'});db[_0x5420('0x11a')]['belongsToMany'](db[_0x5420('0x163')],{'through':_0x5420('0x18e'),'as':_0x5420('0x173')});db[_0x5420('0x18f')][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db[_0x5420('0x18f')]['belongsTo'](db['CmList'],{'as':_0x5420('0x16a'),'foreignKey':_0x5420('0x15a'),'onDelete':'cascade'});db[_0x5420('0x18f')][_0x5420('0x143')](db[_0x5420('0x12')],{'as':_0x5420('0x190'),'foreignKey':_0x5420('0x10b')});db[_0x5420('0x18f')][_0x5420('0x143')](db[_0x5420('0x19')],{'as':_0x5420('0x191'),'foreignKey':_0x5420('0x13e'),'onDelete':_0x5420('0x108')});db[_0x5420('0x18f')][_0x5420('0x143')](db[_0x5420('0xde')],{'as':_0x5420('0xde'),'foreignKey':_0x5420('0x192'),'onDelete':_0x5420('0x108')});db[_0x5420('0x18f')]['belongsTo'](db[_0x5420('0x12')],{'as':'Owner','foreignKey':_0x5420('0x193')});db['CmHopperBlack'][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154'),'onDelete':_0x5420('0x108')});db[_0x5420('0x71')][_0x5420('0x143')](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':_0x5420('0x15a'),'onDelete':_0x5420('0x108')});db[_0x5420('0x71')][_0x5420('0x143')](db['VoiceQueue'],{'as':_0x5420('0x191'),'foreignKey':_0x5420('0x13e'),'onDelete':_0x5420('0x108')});db[_0x5420('0x71')]['belongsTo'](db['Campaign'],{'as':_0x5420('0xde'),'foreignKey':_0x5420('0x192'),'onDelete':_0x5420('0x108')});db[_0x5420('0x7b')][_0x5420('0x109')](db[_0x5420('0x81')],{'as':{'plural':_0x5420('0x194'),'singular':_0x5420('0x195')},'foreignKey':_0x5420('0x196'),'onDelete':_0x5420('0x108'),'hooks':!![]});db[_0x5420('0x7b')][_0x5420('0x109')](db[_0x5420('0x81')],{'as':{'plural':_0x5420('0x197'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x5420('0x108'),'hooks':!![]});db[_0x5420('0x7b')][_0x5420('0x109')](db[_0x5420('0x79')],{'as':_0x5420('0x198'),'foreignKey':'AutomationId','onDelete':_0x5420('0x108'),'hooks':!![]});db[_0x5420('0x7f')]['hasMany'](db[_0x5420('0x7f')],{'as':_0x5420('0x159'),'foreignKey':_0x5420('0x199'),'onDelete':_0x5420('0x108')});db[_0x5420('0x82')][_0x5420('0x109')](db[_0x5420('0x82')],{'as':_0x5420('0x19a'),'foreignKey':'IntervalId','onDelete':_0x5420('0x108'),'hooks':!![],'required':![]});db['Interval'][_0x5420('0x109')](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0x5420('0x145'),'onDelete':_0x5420('0x168')});db[_0x5420('0x82')]['hasMany'](db[_0x5420('0x41')],{'as':_0x5420('0x19b'),'foreignKey':_0x5420('0x145')});db[_0x5420('0x82')][_0x5420('0x109')](db[_0x5420('0x62')],{'as':_0x5420('0x19c'),'foreignKey':'IntervalId'});db['Interval']['hasMany'](db[_0x5420('0x16e')],{'as':_0x5420('0x19d'),'foreignKey':_0x5420('0x145')});db[_0x5420('0x82')][_0x5420('0x109')](db[_0x5420('0x177')],{'as':'SmsApplications','foreignKey':_0x5420('0x145')});db[_0x5420('0x88')][_0x5420('0x143')](db['MailAccount'],{});db[_0x5420('0x88')][_0x5420('0x143')](db[_0x5420('0x19e')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0x5420('0x143')](db[_0x5420('0x91')],{'foreignKey':_0x5420('0x19f')});db[_0x5420('0x8a')][_0x5420('0x11d')](db[_0x5420('0x17')],{'as':_0x5420('0x1a0'),'through':_0x5420('0x1a1'),'onDelete':_0x5420('0x168')});db[_0x5420('0x163')][_0x5420('0x11d')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0x5420('0x163')]['belongsToMany'](db[_0x5420('0x64')],{'through':_0x5420('0x186')});db[_0x5420('0x163')][_0x5420('0x11d')](db['MailInteraction'],{'through':_0x5420('0x162')});db[_0x5420('0x163')][_0x5420('0x11d')](db[_0x5420('0x52')],{'through':_0x5420('0x179')});db[_0x5420('0x163')][_0x5420('0x11d')](db['FaxInteraction'],{'through':_0x5420('0x171')});db['Tag'][_0x5420('0x11d')](db[_0x5420('0x59')],{'through':_0x5420('0x180')});db['Tag'][_0x5420('0x11d')](db[_0x5420('0xfc')],{'through':_0x5420('0x1a2')});db[_0x5420('0x8d')][_0x5420('0x109')](db[_0x5420('0x81')],{'as':{'plural':'AllConditions','singular':_0x5420('0x1a3')},'foreignKey':'TriggerAllId','onDelete':_0x5420('0x108'),'hooks':!![]});db[_0x5420('0x8d')][_0x5420('0x109')](db['Condition'],{'as':{'plural':_0x5420('0x1a4'),'singular':_0x5420('0x1a5')},'foreignKey':_0x5420('0x1a6'),'onDelete':_0x5420('0x108'),'hooks':!![]});db[_0x5420('0x8d')][_0x5420('0x109')](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0x5420('0x108'),'hooks':!![]});db[_0x5420('0x91')][_0x5420('0x109')](db['AnalyticFieldReport'],{'as':_0x5420('0x1a7'),'onDelete':'cascade','foreignKey':_0x5420('0x19f'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db['AnalyticFieldReport'],{'as':_0x5420('0x1a7'),'onDelete':'cascade','foreignKey':_0x5420('0x1a8')});db['AnalyticMetric']['hasMany'](db[_0x5420('0x95')],{'as':_0x5420('0x1a7'),'onDelete':'cascade','foreignKey':_0x5420('0x1a9')});db[_0x5420('0x95')][_0x5420('0x143')](db[_0x5420('0x94')],{'foreignKey':_0x5420('0x1a9')});db['SalesforceAccount'][_0x5420('0x109')](db['SalesforceConfiguration'],{'as':_0x5420('0x1aa'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1ab')});db[_0x5420('0x1ac')][_0x5420('0x109')](db[_0x5420('0x1ad')],{'as':_0x5420('0x1ae'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1af')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x5420('0x1b0'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1b1')});db[_0x5420('0x1ac')]['hasMany'](db[_0x5420('0x1ad')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x5420('0x1b2')});db['SalesforceConfiguration'][_0x5420('0x143')](db['SalesforceAccount'],{'as':_0x5420('0x160'),'foreignKey':_0x5420('0x1ab')});db[_0x5420('0x1ad')][_0x5420('0x109')](db[_0x5420('0x1ad')],{'as':_0x5420('0x1b3'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0x1ad')][_0x5420('0x109')](db[_0x5420('0x1ad')],{'as':'Description','foreignKey':_0x5420('0x1b1')});db['SalesforceField'][_0x5420('0x109')](db[_0x5420('0x1ad')],{'as':_0x5420('0x1b4'),'foreignKey':_0x5420('0x1b2')});db['SalesforceField'][_0x5420('0x143')](db[_0x5420('0x1b5')],{'as':_0x5420('0x1b5'),'foreignKey':_0x5420('0x1b6')});db[_0x5420('0x9c')][_0x5420('0x109')](db[_0x5420('0x1b7')],{'as':_0x5420('0x1aa'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1ab')});db['SugarcrmConfiguration'][_0x5420('0x109')](db[_0x5420('0x9e')],{'as':_0x5420('0x1ae'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0x1b7')][_0x5420('0x109')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1b1')});db[_0x5420('0x1b7')][_0x5420('0x109')](db[_0x5420('0x9e')],{'as':_0x5420('0x1a7'),'onDelete':_0x5420('0x108'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x5420('0x143')](db[_0x5420('0x9c')],{'as':'Account','foreignKey':_0x5420('0x1ab')});db['SugarcrmField'][_0x5420('0x109')](db[_0x5420('0x9e')],{'as':_0x5420('0x1b3'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0x9e')][_0x5420('0x109')](db[_0x5420('0x9e')],{'as':_0x5420('0x1b8'),'foreignKey':'DescriptionId'});db[_0x5420('0x9e')]['hasMany'](db[_0x5420('0x9e')],{'as':'Field','foreignKey':_0x5420('0x1b2')});db[_0x5420('0x9e')][_0x5420('0x143')](db[_0x5420('0x1b5')],{'as':_0x5420('0x1b5'),'foreignKey':_0x5420('0x1b6')});db[_0x5420('0xa0')][_0x5420('0x109')](db['DeskConfiguration'],{'as':_0x5420('0x1aa'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1ab')});db[_0x5420('0xa2')][_0x5420('0x109')](db[_0x5420('0xa4')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x5420('0x1af')});db[_0x5420('0xa2')]['hasMany'](db['DeskField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x5420('0x1b1')});db['DeskConfiguration'][_0x5420('0x109')](db[_0x5420('0xa4')],{'as':_0x5420('0x1a7'),'onDelete':_0x5420('0x108'),'foreignKey':'FieldId'});db[_0x5420('0xa2')][_0x5420('0x143')](db['DeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x5420('0xa2')]['belongsToMany'](db['Tag'],{'through':_0x5420('0x1b9')});db[_0x5420('0xa4')][_0x5420('0x109')](db[_0x5420('0xa4')],{'as':_0x5420('0x1b3'),'foreignKey':_0x5420('0x1af')});db['DeskField'][_0x5420('0x109')](db['DeskField'],{'as':_0x5420('0x1b8'),'foreignKey':_0x5420('0x1b1')});db[_0x5420('0xa4')][_0x5420('0x109')](db[_0x5420('0xa4')],{'as':_0x5420('0x1b4'),'foreignKey':_0x5420('0x1b2')});db[_0x5420('0xa4')]['belongsTo'](db[_0x5420('0x1b5')],{'as':_0x5420('0x1b5'),'foreignKey':_0x5420('0x1b6')});db['ZohoAccount'][_0x5420('0x109')](db[_0x5420('0xa7')],{'as':_0x5420('0x1aa'),'onDelete':'cascade','foreignKey':_0x5420('0x1ab')});db[_0x5420('0xa7')][_0x5420('0x109')](db['ZohoField'],{'as':'Subjects','onDelete':_0x5420('0x108'),'foreignKey':'SubjectId'});db[_0x5420('0xa7')][_0x5420('0x109')](db[_0x5420('0x1ba')],{'as':_0x5420('0x1b0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x5420('0xa7')][_0x5420('0x109')](db[_0x5420('0x1ba')],{'as':_0x5420('0x1a7'),'onDelete':_0x5420('0x108'),'foreignKey':'FieldId'});db[_0x5420('0xa7')]['belongsTo'](db['ZohoAccount'],{'as':'Account','foreignKey':_0x5420('0x1ab')});db[_0x5420('0x1ba')][_0x5420('0x109')](db[_0x5420('0x1ba')],{'as':_0x5420('0x1b3'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0x1ba')][_0x5420('0x109')](db[_0x5420('0x1ba')],{'as':_0x5420('0x1b8'),'foreignKey':_0x5420('0x1b1')});db[_0x5420('0x1ba')][_0x5420('0x109')](db['ZohoField'],{'as':_0x5420('0x1b4'),'foreignKey':_0x5420('0x1b2')});db[_0x5420('0x1ba')]['belongsTo'](db[_0x5420('0x1b5')],{'as':_0x5420('0x1b5'),'foreignKey':_0x5420('0x1b6')});db[_0x5420('0x1bb')][_0x5420('0x109')](db[_0x5420('0xab')],{'as':_0x5420('0x1aa'),'onDelete':'cascade','foreignKey':_0x5420('0x1ab')});db[_0x5420('0xab')][_0x5420('0x109')](db[_0x5420('0xad')],{'as':_0x5420('0x1ae'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0xab')][_0x5420('0x109')](db[_0x5420('0xad')],{'as':_0x5420('0x1b0'),'foreignKey':_0x5420('0x1b1')});db['ZendeskConfiguration'][_0x5420('0x109')](db[_0x5420('0xad')],{'as':_0x5420('0x1a7'),'foreignKey':_0x5420('0x1b2')});db['ZendeskConfiguration'][_0x5420('0x143')](db[_0x5420('0x1bb')],{'as':'Account','foreignKey':_0x5420('0x1ab')});db[_0x5420('0xab')][_0x5420('0x11d')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0x5420('0xad')]['hasMany'](db[_0x5420('0xad')],{'as':'Subject','foreignKey':_0x5420('0x1af')});db['ZendeskField'][_0x5420('0x109')](db[_0x5420('0xad')],{'as':'Description','foreignKey':_0x5420('0x1b1')});db[_0x5420('0xad')]['hasMany'](db['ZendeskField'],{'as':_0x5420('0x1b4'),'foreignKey':_0x5420('0x1b2')});db[_0x5420('0xad')][_0x5420('0x143')](db[_0x5420('0x1b5')],{'as':_0x5420('0x1b5'),'foreignKey':_0x5420('0x1b6')});db['FreshdeskAccount'][_0x5420('0x109')](db['FreshdeskConfiguration'],{'as':_0x5420('0x1aa'),'onDelete':_0x5420('0x108'),'foreignKey':'AccountId'});db[_0x5420('0xb0')][_0x5420('0x109')](db['FreshdeskField'],{'as':_0x5420('0x1ae'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0xb0')][_0x5420('0x109')](db[_0x5420('0x1bc')],{'as':_0x5420('0x1b0'),'onDelete':'cascade','foreignKey':_0x5420('0x1b1')});db[_0x5420('0xb0')]['hasMany'](db[_0x5420('0x1bc')],{'as':_0x5420('0x1a7'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1b2')});db[_0x5420('0xb0')][_0x5420('0x143')](db[_0x5420('0xae')],{'as':_0x5420('0x160'),'foreignKey':_0x5420('0x1ab')});db['FreshdeskConfiguration'][_0x5420('0x11d')](db[_0x5420('0x163')],{'through':_0x5420('0x1bd')});db[_0x5420('0x1bc')][_0x5420('0x109')](db[_0x5420('0x1bc')],{'as':_0x5420('0x1b3'),'foreignKey':'SubjectId'});db[_0x5420('0x1bc')][_0x5420('0x109')](db[_0x5420('0x1bc')],{'as':_0x5420('0x1b8'),'foreignKey':_0x5420('0x1b1')});db['FreshdeskField']['hasMany'](db[_0x5420('0x1bc')],{'as':'Field','foreignKey':_0x5420('0x1b2')});db[_0x5420('0x1bc')][_0x5420('0x143')](db[_0x5420('0x1b5')],{'as':_0x5420('0x1b5'),'foreignKey':_0x5420('0x1b6')});db[_0x5420('0x1be')][_0x5420('0x109')](db[_0x5420('0x1bf')],{'as':_0x5420('0x1aa'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1ab')});db['VtigerConfiguration'][_0x5420('0x109')](db[_0x5420('0xb3')],{'as':_0x5420('0x1ae'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0x1bf')][_0x5420('0x109')](db[_0x5420('0xb3')],{'as':_0x5420('0x1b0'),'foreignKey':_0x5420('0x1b1')});db['VtigerConfiguration']['hasMany'](db[_0x5420('0xb3')],{'as':_0x5420('0x1a7'),'foreignKey':_0x5420('0x1b2')});db['VtigerConfiguration'][_0x5420('0x143')](db['VtigerAccount'],{'as':_0x5420('0x160'),'foreignKey':_0x5420('0x1ab')});db['VtigerField'][_0x5420('0x109')](db[_0x5420('0xb3')],{'as':_0x5420('0x1b3'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0xb3')][_0x5420('0x109')](db[_0x5420('0xb3')],{'as':_0x5420('0x1b8'),'foreignKey':_0x5420('0x1b1')});db['VtigerField']['hasMany'](db[_0x5420('0xb3')],{'as':_0x5420('0x1b4'),'foreignKey':'FieldId'});db['VtigerField'][_0x5420('0x143')](db[_0x5420('0x1b5')],{'as':_0x5420('0x1b5'),'foreignKey':_0x5420('0x1b6')});db[_0x5420('0xb5')]['hasMany'](db[_0x5420('0x1c0')],{'as':_0x5420('0x1aa'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1ab')});db[_0x5420('0x1c0')][_0x5420('0x109')](db[_0x5420('0x1c1')],{'as':_0x5420('0x1ae'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0x1c0')][_0x5420('0x109')](db[_0x5420('0x1c1')],{'as':_0x5420('0x1b0'),'foreignKey':_0x5420('0x1b1')});db[_0x5420('0x1c0')][_0x5420('0x109')](db[_0x5420('0x1c1')],{'as':'Fields','foreignKey':_0x5420('0x1b2')});db['ServicenowConfiguration'][_0x5420('0x143')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x5420('0x1ab')});db[_0x5420('0x1c1')][_0x5420('0x109')](db[_0x5420('0x1c1')],{'as':_0x5420('0x1b3'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0x1c1')]['hasMany'](db['ServicenowField'],{'as':_0x5420('0x1b8'),'foreignKey':_0x5420('0x1b1')});db['ServicenowField'][_0x5420('0x109')](db[_0x5420('0x1c1')],{'as':_0x5420('0x1b4'),'foreignKey':_0x5420('0x1b2')});db[_0x5420('0x1c1')][_0x5420('0x143')](db[_0x5420('0x1b5')],{'as':'Variable','foreignKey':_0x5420('0x1b6')});db['Dynamics365Account']['hasMany'](db['Dynamics365Configuration'],{'as':_0x5420('0x1aa'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1ab')});db['Dynamics365Configuration'][_0x5420('0x109')](db[_0x5420('0xba')],{'as':_0x5420('0x1ae'),'onDelete':'cascade','foreignKey':_0x5420('0x1af')});db[_0x5420('0x1c2')][_0x5420('0x109')](db[_0x5420('0xba')],{'as':_0x5420('0x1b0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x5420('0x1c2')]['hasMany'](db[_0x5420('0xba')],{'as':_0x5420('0x1a7'),'onDelete':'cascade','foreignKey':_0x5420('0x1b2')});db[_0x5420('0x1c2')][_0x5420('0x143')](db[_0x5420('0x1c3')],{'as':_0x5420('0x160'),'foreignKey':_0x5420('0x1ab')});db[_0x5420('0xba')][_0x5420('0x109')](db[_0x5420('0xba')],{'as':_0x5420('0x1b3'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0xba')][_0x5420('0x109')](db[_0x5420('0xba')],{'as':_0x5420('0x1b8'),'foreignKey':_0x5420('0x1b1')});db[_0x5420('0xba')]['hasMany'](db[_0x5420('0xba')],{'as':_0x5420('0x1b4'),'foreignKey':_0x5420('0x1b2')});db['Dynamics365Field'][_0x5420('0x143')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x5420('0xbc')]['hasMany'](db[_0x5420('0xbe')],{'as':_0x5420('0x1aa'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1ab')});db['FreshsalesConfiguration'][_0x5420('0x109')](db[_0x5420('0xc0')],{'as':_0x5420('0x1ae'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0xbe')]['hasMany'](db[_0x5420('0xc0')],{'as':_0x5420('0x1b0'),'foreignKey':_0x5420('0x1b1')});db[_0x5420('0xbe')]['hasMany'](db[_0x5420('0xc0')],{'as':_0x5420('0x1a7'),'foreignKey':_0x5420('0x1b2')});db[_0x5420('0xbe')][_0x5420('0x143')](db[_0x5420('0xbc')],{'as':_0x5420('0x160'),'foreignKey':'AccountId'});db[_0x5420('0xc0')][_0x5420('0x109')](db[_0x5420('0xc0')],{'as':_0x5420('0x1b3'),'foreignKey':_0x5420('0x1af')});db[_0x5420('0xc0')][_0x5420('0x109')](db[_0x5420('0xc0')],{'as':_0x5420('0x1b8'),'foreignKey':_0x5420('0x1b1')});db[_0x5420('0xc0')][_0x5420('0x109')](db[_0x5420('0xc0')],{'as':_0x5420('0x1b4'),'foreignKey':_0x5420('0x1b2')});db['FreshsalesField'][_0x5420('0x143')](db['Variable'],{'as':_0x5420('0x1b5'),'foreignKey':_0x5420('0x1b6')});db['ChatQueueReport']['belongsTo'](db['ChatWebsite'],{});db[_0x5420('0xc3')][_0x5420('0x143')](db['CmList'],{'as':_0x5420('0x16a'),'foreignKey':'ListId'});db[_0x5420('0xc3')][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':'ContactId'});db[_0x5420('0xc3')]['belongsTo'](db[_0x5420('0x64')],{});db['ChatQueueReport'][_0x5420('0x143')](db[_0x5420('0x66')],{});db['ChatQueueReport'][_0x5420('0x143')](db[_0x5420('0x12')],{});db[_0x5420('0xc3')][_0x5420('0x143')](db[_0x5420('0x128')],{});db[_0x5420('0xc5')][_0x5420('0x143')](db[_0x5420('0x12')],{'onDelete':_0x5420('0x108'),'foreignKey':'FromId'});db[_0x5420('0xc5')][_0x5420('0x143')](db[_0x5420('0x12')],{'onDelete':_0x5420('0x108'),'foreignKey':'ToId'});db[_0x5420('0xc8')][_0x5420('0x109')](db[_0x5420('0xc6')],{'foreignKey':_0x5420('0x1c4'),'onDelete':_0x5420('0x108')});db['JscriptySessionReport'][_0x5420('0x109')](db[_0x5420('0x1c5')],{'foreignKey':_0x5420('0x1c4'),'onDelete':_0x5420('0x108')});db['SmsQueueReport']['belongsTo'](db[_0x5420('0x4f')],{});db['SmsQueueReport'][_0x5420('0x143')](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':_0x5420('0x15a')});db[_0x5420('0xca')]['belongsTo'](db['CmContact'],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db[_0x5420('0xca')][_0x5420('0x143')](db[_0x5420('0x52')],{});db['SmsQueueReport']['belongsTo'](db[_0x5420('0x53')],{});db[_0x5420('0xca')][_0x5420('0x143')](db[_0x5420('0x12')],{});db[_0x5420('0xca')][_0x5420('0x143')](db[_0x5420('0x55')],{});db[_0x5420('0xd0')][_0x5420('0x109')](db[_0x5420('0xc8')],{'foreignKey':_0x5420('0x1c6')});db[_0x5420('0xd0')][_0x5420('0x109')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0x5420('0x1c5')],{'foreignKey':'ProjectId'});db[_0x5420('0xd4')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x164'),'through':_0x5420('0x136')});db[_0x5420('0xda')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x148'),'through':_0x5420('0x1c7')});db['Team'][_0x5420('0x11d')](db[_0x5420('0x19')],{'through':_0x5420('0x105'),'as':_0x5420('0x1c8')});db['Team'][_0x5420('0x11d')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x5420('0x126')});db['Team'][_0x5420('0x11d')](db[_0x5420('0x128')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0x5420('0xda')][_0x5420('0x11d')](db[_0x5420('0x4d')],{'through':_0x5420('0x1c9'),'as':'FaxQueues'});db[_0x5420('0xda')][_0x5420('0x11d')](db['SmsQueue'],{'through':_0x5420('0x17b'),'as':_0x5420('0x1ca')});db['Team'][_0x5420('0x11d')](db[_0x5420('0x5c')],{'through':_0x5420('0x182'),'as':_0x5420('0x1cb')});db[_0x5420('0xda')][_0x5420('0x11d')](db[_0x5420('0x102')],{'through':'team_has_whatsapp_queues','as':_0x5420('0x1cc')});db[_0x5420('0xde')][_0x5420('0x109')](db[_0x5420('0x18f')],{'as':_0x5420('0x13f'),'foreignKey':'CampaignId'});db[_0x5420('0xde')][_0x5420('0x109')](db[_0x5420('0x72')],{'as':_0x5420('0x140'),'foreignKey':_0x5420('0x192')});db[_0x5420('0xde')][_0x5420('0x109')](db[_0x5420('0x73')],{'as':_0x5420('0x141'),'foreignKey':_0x5420('0x192')});db[_0x5420('0xde')][_0x5420('0x109')](db[_0x5420('0x71')],{'as':'HopperBlacks','foreignKey':_0x5420('0x192')});db['Campaign'][_0x5420('0x143')](db[_0x5420('0x27')],{'as':'Trunk','foreignKey':_0x5420('0x1cd')});db[_0x5420('0xde')][_0x5420('0x143')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x5420('0x1ce')});db['Campaign'][_0x5420('0x143')](db['Interval'],{'as':_0x5420('0x82'),'foreignKey':_0x5420('0x145')});db[_0x5420('0xde')][_0x5420('0x143')](db[_0x5420('0xd4')],{'as':_0x5420('0xd4'),'foreignKey':_0x5420('0x1cf')});db[_0x5420('0xde')][_0x5420('0x11d')](db[_0x5420('0xee')],{'as':_0x5420('0x11e'),'through':_0x5420('0x1d0')});db[_0x5420('0xde')][_0x5420('0x11d')](db['CmList'],{'as':_0x5420('0x14a'),'through':_0x5420('0x1d1')});db[_0x5420('0xe1')]['belongsTo'](db[_0x5420('0x68')],{'as':_0x5420('0x68'),'foreignKey':'ChatOfflineMessageId'});db[_0x5420('0xe4')]['belongsTo'](db['MailMessage'],{});db['MailTransferReport']['belongsTo'](db[_0x5420('0x112')],{});db[_0x5420('0xe4')][_0x5420('0x143')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x5420('0x1d2')});db[_0x5420('0xe4')][_0x5420('0x143')](db[_0x5420('0x12')],{'foreignKey':_0x5420('0x1d3'),'as':_0x5420('0x1d4')});db[_0x5420('0xe4')][_0x5420('0x143')](db[_0x5420('0x12')],{'foreignKey':_0x5420('0x1d5'),'as':_0x5420('0x1d6')});db[_0x5420('0xe4')]['belongsTo'](db[_0x5420('0x125')],{'foreignKey':_0x5420('0x1d7'),'as':_0x5420('0x1d8')});db[_0x5420('0xe4')][_0x5420('0x143')](db[_0x5420('0x39')],{'foreignKey':_0x5420('0x1d9'),'as':'ToAccount'});db['ChatTransferReport'][_0x5420('0x143')](db[_0x5420('0x66')],{});db['ChatTransferReport']['belongsTo'](db[_0x5420('0x64')],{});db[_0x5420('0xe6')][_0x5420('0x143')](db[_0x5420('0x5e')],{'foreignKey':_0x5420('0x1da'),'as':_0x5420('0x1d2')});db[_0x5420('0xe6')][_0x5420('0x143')](db[_0x5420('0x12')],{'foreignKey':_0x5420('0x1d3'),'as':_0x5420('0x1d4')});db[_0x5420('0xe6')][_0x5420('0x143')](db['User'],{'foreignKey':_0x5420('0x1d5'),'as':_0x5420('0x1d6')});db[_0x5420('0xe6')][_0x5420('0x143')](db[_0x5420('0x128')],{'foreignKey':'ToChatQueueId','as':_0x5420('0x1d8')});db['ChatTransferReport'][_0x5420('0x143')](db['ChatWebsite'],{'foreignKey':_0x5420('0x1db'),'as':_0x5420('0x1dc')});db[_0x5420('0xe8')]['belongsTo'](db[_0x5420('0x16f')],{});db[_0x5420('0xe8')][_0x5420('0x143')](db[_0x5420('0x110')],{});db['FaxTransferReport'][_0x5420('0x143')](db[_0x5420('0x48')],{'foreignKey':_0x5420('0x1dd'),'as':_0x5420('0x1d2')});db[_0x5420('0xe8')][_0x5420('0x143')](db[_0x5420('0x12')],{'foreignKey':_0x5420('0x1d3'),'as':_0x5420('0x1d4')});db[_0x5420('0xe8')][_0x5420('0x143')](db['User'],{'foreignKey':_0x5420('0x1d5'),'as':_0x5420('0x1d6')});db[_0x5420('0xe8')][_0x5420('0x143')](db[_0x5420('0x4d')],{'foreignKey':_0x5420('0x1de'),'as':_0x5420('0x1d8')});db[_0x5420('0xe8')]['belongsTo'](db[_0x5420('0x48')],{'foreignKey':'ToFaxAccountId','as':_0x5420('0x1dc')});db[_0x5420('0xea')][_0x5420('0x143')](db['OpenchannelMessage'],{});db[_0x5420('0xea')]['belongsTo'](db[_0x5420('0x59')],{});db[_0x5420('0xea')][_0x5420('0x143')](db[_0x5420('0x131')],{'foreignKey':_0x5420('0x1df'),'as':_0x5420('0x1d2')});db[_0x5420('0xea')][_0x5420('0x143')](db[_0x5420('0x12')],{'foreignKey':_0x5420('0x1d3'),'as':_0x5420('0x1d4')});db['OpenchannelTransferReport']['belongsTo'](db[_0x5420('0x12')],{'foreignKey':_0x5420('0x1d5'),'as':_0x5420('0x1d6')});db['OpenchannelTransferReport'][_0x5420('0x143')](db[_0x5420('0x5c')],{'foreignKey':_0x5420('0x1e0'),'as':_0x5420('0x1d8')});db[_0x5420('0xea')][_0x5420('0x143')](db[_0x5420('0x131')],{'foreignKey':_0x5420('0x1e1'),'as':_0x5420('0x1dc')});db[_0x5420('0xec')]['belongsTo'](db[_0x5420('0x53')],{});db['SmsTransferReport'][_0x5420('0x143')](db[_0x5420('0x52')],{});db['SmsTransferReport']['belongsTo'](db[_0x5420('0x4f')],{'foreignKey':_0x5420('0x1e2'),'as':_0x5420('0x1d2')});db['SmsTransferReport'][_0x5420('0x143')](db[_0x5420('0x12')],{'foreignKey':_0x5420('0x1d3'),'as':_0x5420('0x1d4')});db[_0x5420('0xec')]['belongsTo'](db[_0x5420('0x12')],{'foreignKey':_0x5420('0x1d5'),'as':_0x5420('0x1d6')});db[_0x5420('0xec')][_0x5420('0x143')](db[_0x5420('0x55')],{'foreignKey':_0x5420('0x1e3'),'as':_0x5420('0x1d8')});db[_0x5420('0xec')][_0x5420('0x143')](db[_0x5420('0x4f')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0x5420('0xee')][_0x5420('0x109')](db[_0x5420('0x7f')],{'as':_0x5420('0x159'),'foreignKey':'ListId','onDelete':_0x5420('0x108')});db[_0x5420('0xee')][_0x5420('0x109')](db[_0x5420('0x77')],{'as':_0x5420('0x1e4'),'foreignKey':'ListId'});db[_0x5420('0xee')][_0x5420('0x109')](db[_0x5420('0x11a')],{'as':_0x5420('0x11b'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x15a')});db[_0x5420('0xee')][_0x5420('0x109')](db[_0x5420('0x72')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x5420('0xee')][_0x5420('0x109')](db[_0x5420('0x73')],{'as':_0x5420('0x1e5'),'foreignKey':_0x5420('0x15a')});db[_0x5420('0xee')][_0x5420('0x109')](db[_0x5420('0x75')],{'as':_0x5420('0x75'),'foreignKey':'ListId'});db[_0x5420('0xee')][_0x5420('0x11d')](db[_0x5420('0x19')],{'as':_0x5420('0x1e6'),'through':_0x5420('0x147')});db[_0x5420('0xee')][_0x5420('0x11d')](db['User'],{'as':_0x5420('0x148'),'through':_0x5420('0x11f')});db[_0x5420('0xef')][_0x5420('0x109')](db[_0x5420('0x16')],{'as':_0x5420('0x10d'),'onDelete':_0x5420('0x108')});db[_0x5420('0xef')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':'Agents','through':_0x5420('0x12c')});db[_0x5420('0xf1')][_0x5420('0x109')](db[_0x5420('0x12')],{'as':'Users','foreignKey':_0x5420('0x117')});db['UserProfile'][_0x5420('0x109')](db[_0x5420('0xf3')],{'as':_0x5420('0x1e7'),'foreignKey':_0x5420('0x117'),'onDelete':_0x5420('0x108')});db[_0x5420('0xf3')][_0x5420('0x109')](db[_0x5420('0xf5')],{'as':_0x5420('0x1e8'),'foreignKey':'sectionId','onDelete':'cascade'});db[_0x5420('0xf9')][_0x5420('0x109')](db['Disposition'],{'as':_0x5420('0x159'),'foreignKey':_0x5420('0x1e9'),'onDelete':_0x5420('0x108')});db[_0x5420('0xf9')][_0x5420('0x109')](db[_0x5420('0x7d')],{'as':_0x5420('0x16c'),'foreignKey':_0x5420('0x1e9')});db[_0x5420('0xf9')][_0x5420('0x109')](db[_0x5420('0xfe')],{'as':_0x5420('0x14d'),'foreignKey':'WhatsappAccountId'});db[_0x5420('0xf9')][_0x5420('0x109')](db[_0x5420('0xfc')],{'as':_0x5420('0x16d')});db[_0x5420('0xf9')][_0x5420('0x109')](db[_0x5420('0xfa')],{'as':_0x5420('0x13b')});db[_0x5420('0xf9')][_0x5420('0x143')](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':_0x5420('0x15a')});db[_0x5420('0xf9')][_0x5420('0x143')](db[_0x5420('0x15d')],{'as':'mandatoryDispositionPause','foreignKey':_0x5420('0x146')});db[_0x5420('0xf9')][_0x5420('0x11d')](db['User'],{'as':_0x5420('0x148'),'through':_0x5420('0x134')});db[_0x5420('0xfa')][_0x5420('0x143')](db[_0x5420('0x12')],{'onDelete':_0x5420('0x168')});db[_0x5420('0xfa')][_0x5420('0x143')](db[_0x5420('0x102')],{'onDelete':'restrict'});db[_0x5420('0xfa')][_0x5420('0x143')](db[_0x5420('0xf9')],{'onDelete':'restrict'});db[_0x5420('0xfa')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0x5420('0x145')});db['WhatsappApplication']['belongsTo'](db[_0x5420('0x163')],{'onDelete':_0x5420('0x168'),'foreignKey':_0x5420('0x169')});db[_0x5420('0xfc')][_0x5420('0x109')](db[_0x5420('0xfe')],{'as':_0x5420('0x14d'),'onDelete':_0x5420('0x108'),'foreignKey':_0x5420('0x1ea')});db[_0x5420('0xfc')][_0x5420('0x143')](db[_0x5420('0xf9')],{'as':_0x5420('0x160'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db['WhatsappInteraction'][_0x5420('0x143')](db[_0x5420('0x12')],{'as':_0x5420('0x161'),'foreignKey':_0x5420('0x10b')});db['WhatsappInteraction'][_0x5420('0x11d')](db[_0x5420('0x163')],{'through':_0x5420('0x1a2'),'as':_0x5420('0x172')});db['WhatsappInteraction'][_0x5420('0x11d')](db[_0x5420('0x163')],{'through':_0x5420('0x1a2'),'as':_0x5420('0x173')});db[_0x5420('0xfc')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':_0x5420('0x164'),'through':_0x5420('0x124'),'foreignKey':_0x5420('0x1ea')});db[_0x5420('0xfe')][_0x5420('0x143')](db[_0x5420('0x12')],{'as':'User'});db['WhatsappMessage'][_0x5420('0x143')](db[_0x5420('0x11a')],{'onDelete':_0x5420('0x108'),'as':_0x5420('0x153')});db[_0x5420('0xfe')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x5420('0x165'),'foreignKey':_0x5420('0x1ea')});db['WhatsappMessage'][_0x5420('0x143')](db['WhatsappAccount'],{'as':_0x5420('0x160'),'foreignKey':_0x5420('0x1e9')});db[_0x5420('0x100')][_0x5420('0x143')](db[_0x5420('0xf9')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x5420('0xee')],{'as':_0x5420('0x16a'),'foreignKey':'ListId'});db['WhatsappQueueReport'][_0x5420('0x143')](db[_0x5420('0x11a')],{'as':_0x5420('0x153'),'foreignKey':_0x5420('0x154')});db[_0x5420('0x100')][_0x5420('0x143')](db[_0x5420('0xfc')],{});db['WhatsappQueueReport'][_0x5420('0x143')](db[_0x5420('0x102')],{});db[_0x5420('0x100')]['belongsTo'](db[_0x5420('0xfe')],{});db[_0x5420('0x100')][_0x5420('0x143')](db[_0x5420('0x12')],{});db[_0x5420('0x1eb')][_0x5420('0x143')](db[_0x5420('0xfe')],{});db['WhatsappTransferReport'][_0x5420('0x143')](db[_0x5420('0xfc')],{});db[_0x5420('0x1eb')][_0x5420('0x143')](db[_0x5420('0xf9')],{'foreignKey':'FromWhatsappAccountId','as':_0x5420('0x1d2')});db[_0x5420('0x1eb')]['belongsTo'](db[_0x5420('0xf9')],{'foreignKey':_0x5420('0x1ec'),'as':_0x5420('0x1dc')});db[_0x5420('0x1eb')][_0x5420('0x143')](db[_0x5420('0x102')],{'foreignKey':_0x5420('0x1ed'),'as':_0x5420('0x1d8')});db[_0x5420('0x1eb')][_0x5420('0x143')](db[_0x5420('0x12')],{'foreignKey':_0x5420('0x1d3'),'as':_0x5420('0x1d4')});db[_0x5420('0x1eb')][_0x5420('0x143')](db[_0x5420('0x12')],{'foreignKey':_0x5420('0x1d5'),'as':_0x5420('0x1d6')});db[_0x5420('0x102')][_0x5420('0x11d')](db[_0x5420('0x12')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0x5420('0x11d')](db['Team'],{'through':_0x5420('0x1ee'),'as':_0x5420('0x149')});module[_0x5420('0x1ef')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x9789=['WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','Sounds','moh_has_sounds','UserVoiceQueueRt','Hoppers','VoiceQueueId','HopperFinals','HopperHistories','Trunk','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','Messages','mailboxuser','mailbox','VoiceCallReport','uniqueid','AgentReports','ContactId','MailAccountId','hasOne','MailServerIn','Imap','Dispositions','Answers','Interactions','Applications','List','ListId','TemplateId','Pause','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','Tag','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachments','ChatWebsiteId','restrict','TagId','Items','FaxAccountId','Exntensions','FaxInteractionId','Interaction','AttachmentId','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','UserSmsQueue','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ProactiveActions','ChatApplication','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','JscriptySessions','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','All','Actions','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','fax_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyCondition','TriggerId','Fields','CustomReportId','MetricId','Configurations','AccountId','Subjects','Descriptions','Subject','SubjectId','Description','DescriptionId','FieldId','Variable','VariableId','SugarcrmField','Field','int_desk_configuration_has_tags','ZendeskConfiguration','int_zendesk_configuration_has_tags','ServicenowField','Dynamics365Account','FreshsalesConfiguration','FromId','ToId','SessionId','SmsQueueReport','ProjectId','SquareProject','team_has_whatsapp_queues','HopperBlacks','SquareProjectId','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToChatQueueId','ToChatWebsiteId','ToUserId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','voice_queues_has_cm_lists','UserProfileSection','UserProfileSections','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','lodash','jstz','determine','sequelize','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','motion2','utf8_general_ci','database','password','username','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../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','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','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','Automation','../api/automation/automation.model','CannedAnswer','Disposition','Condition','../api/condition/condition.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','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','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.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','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','CmHopperHistory','HopperHistory','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteraction','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','UserWhatsappQueue','VoicePrefix','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts'];(function(_0x2d0fd4,_0x2ca149){var _0x26ff35=function(_0x86859f){while(--_0x86859f){_0x2d0fd4['push'](_0x2d0fd4['shift']());}};_0x26ff35(++_0x2ca149);}(_0x9789,0xa4));var _0x9978=function(_0x33cc14,_0x1eb42b){_0x33cc14=_0x33cc14-0x0;var _0x1763ab=_0x9789[_0x33cc14];return _0x1763ab;};'use strict';var config=require(_0x9978('0x0'));var Sequelize=require('sequelize');var _=require(_0x9978('0x1'));var jstz=require(_0x9978('0x2'));var timezone=jstz[_0x9978('0x3')]();config[_0x9978('0x4')]=_['defaultsDeep'](config['sequelize'],{'database':'motion2','username':_0x9978('0x5'),'password':_0x9978('0x6'),'options':{'host':_0x9978('0x7'),'port':0xcea,'dialect':_0x9978('0x8'),'dialectOptions':{'charset':_0x9978('0x9')},'logging':![],'timezone':timezone[_0x9978('0xa')](),'define':{'charset':_0x9978('0xb'),'collate':'utf8_general_ci'}}});config[_0x9978('0xc')]=_['defaultsDeep'](config[_0x9978('0xc')],{'database':_0x9978('0xd'),'username':_0x9978('0x5'),'password':_0x9978('0x6'),'options':{'host':_0x9978('0x7'),'port':0xcea,'dialect':_0x9978('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x9978('0xa')](),'define':{'charset':'utf8','collate':_0x9978('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9978('0x4')][_0x9978('0xf')],config[_0x9978('0x4')]['username'],config[_0x9978('0x4')][_0x9978('0x10')],config[_0x9978('0x4')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0x9978('0xc')][_0x9978('0x11')],config[_0x9978('0xc')][_0x9978('0x10')],config['sequelizeHistory'][_0x9978('0x12')])};db[_0x9978('0x13')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/user/user.model');db[_0x9978('0x15')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x16'));db[_0x9978('0x17')]=db[_0x9978('0x4')]['import'](_0x9978('0x18'));db[_0x9978('0x19')]=db[_0x9978('0x4')]['import'](_0x9978('0x1a'));db[_0x9978('0x1b')]=db[_0x9978('0x4')]['import'](_0x9978('0x1c'));db[_0x9978('0x1d')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0x9978('0x1e')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x1f'));db[_0x9978('0x20')]=db['sequelize']['import'](_0x9978('0x21'));db[_0x9978('0x22')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x23'));db[_0x9978('0x24')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x25'));db['VoiceCallReport']=db[_0x9978('0x4')][_0x9978('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0x9978('0x26')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x27'));db[_0x9978('0x28')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x9978('0x29')]=db[_0x9978('0x4')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x9978('0x2a')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x2b'));db['Trunk']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x2c'));db[_0x9978('0x2d')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x2e'));db['UserVoiceQueueRt']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x2f'));db[_0x9978('0x30')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x31'));db[_0x9978('0x32')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x33'));db[_0x9978('0x34')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x9978('0x35')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db[_0x9978('0x4')]['import']('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db['sequelize'][_0x9978('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db['sequelize'][_0x9978('0x14')](_0x9978('0x36'));db['MailServerIn']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x37'));db[_0x9978('0x38')]=db['sequelize']['import'](_0x9978('0x39'));db['MailAccount']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x3a'));db[_0x9978('0x3b')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x3c'));db[_0x9978('0x3d')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x3e'));db[_0x9978('0x3f')]=db['sequelize']['import'](_0x9978('0x40'));db[_0x9978('0x41')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x42'));db[_0x9978('0x43')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x44'));db[_0x9978('0x45')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x46'));db[_0x9978('0x47')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x48'));db[_0x9978('0x49')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x4a'));db[_0x9978('0x4b')]=db[_0x9978('0x4')]['import'](_0x9978('0x4c'));db[_0x9978('0x4d')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x4e'));db['FaxInteraction']=db[_0x9978('0x4')]['import']('../api/faxInteraction/faxInteraction.model');db[_0x9978('0x4f')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x50'));db[_0x9978('0x51')]=db[_0x9978('0x4')]['import'](_0x9978('0x52'));db[_0x9978('0x53')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x54'));db[_0x9978('0x55')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x56'));db['SmsApplication']=db[_0x9978('0x4')][_0x9978('0x14')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db['sequelize'][_0x9978('0x14')](_0x9978('0x57'));db[_0x9978('0x58')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x59'));db[_0x9978('0x5a')]=db['sequelize']['import'](_0x9978('0x5b'));db[_0x9978('0x5c')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db['sequelize'][_0x9978('0x14')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x5d'));db[_0x9978('0x5e')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x5f'));db[_0x9978('0x60')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x61'));db['ChatWebsite']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x62'));db['OpenchannelQueueReport']=db[_0x9978('0x4')][_0x9978('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x63'));db['ChatInteraction']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x64'));db[_0x9978('0x65')]=db['sequelize'][_0x9978('0x14')]('../api/chatMessage/chatMessage.model');db[_0x9978('0x66')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x67'));db['ChatQueue']=db['sequelize'][_0x9978('0x14')]('../api/chatQueue/chatQueue.model');db[_0x9978('0x68')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x69'));db[_0x9978('0x6a')]=db['sequelize'][_0x9978('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x9978('0x6b')]=db[_0x9978('0x4')]['import'](_0x9978('0x6c'));db[_0x9978('0x6d')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x6e'));db[_0x9978('0x6f')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/cmHopper/cmHopper.model');db[_0x9978('0x70')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x71'));db[_0x9978('0x72')]=db[_0x9978('0x4')]['import'](_0x9978('0x73'));db['CmHopperHistory']=db[_0x9978('0x4')][_0x9978('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x74'));db[_0x9978('0x75')]=db['sequelize'][_0x9978('0x14')]('../api/cmCustomField/cmCustomField.model');db[_0x9978('0x76')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/action/action.model');db[_0x9978('0x77')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x78'));db[_0x9978('0x79')]=db[_0x9978('0x4')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x9978('0x7a')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/disposition/disposition.model');db[_0x9978('0x7b')]=db[_0x9978('0x4')]['import'](_0x9978('0x7c'));db['Interval']=db[_0x9978('0x4')][_0x9978('0x14')]('../api/interval/interval.model');db['Pause']=db['sequelize'][_0x9978('0x14')]('../api/pause/pause.model');db[_0x9978('0x7d')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x7e'));db[_0x9978('0x7f')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x80'));db[_0x9978('0x81')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/schedule/schedule.model');db[_0x9978('0x82')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x83'));db['Tag']=db['sequelize'][_0x9978('0x14')](_0x9978('0x84'));db[_0x9978('0x85')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x86'));db[_0x9978('0x87')]=db[_0x9978('0x4')]['import']('../api/trigger/trigger.model');db['Variable']=db[_0x9978('0x4')]['import'](_0x9978('0x88'));db[_0x9978('0x89')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x8a'));db[_0x9978('0x8b')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x8c'));db[_0x9978('0x8d')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x8e'));db[_0x9978('0x8f')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x90'));db[_0x9978('0x91')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x92'));db[_0x9978('0x93')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x94'));db[_0x9978('0x95')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x96'));db[_0x9978('0x97')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x98'));db[_0x9978('0x99')]=db['sequelize']['import'](_0x9978('0x9a'));db[_0x9978('0x9b')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x9c'));db[_0x9978('0x9d')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/intSalesforceField/intSalesforceField.model');db[_0x9978('0x9e')]=db['sequelize']['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x9978('0x9f')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xa0'));db['SugarcrmField']=db['sequelize'][_0x9978('0x14')](_0x9978('0xa1'));db[_0x9978('0xa2')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x9978('0xa3')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xa4'));db[_0x9978('0xa5')]=db[_0x9978('0x4')]['import'](_0x9978('0xa6'));db[_0x9978('0xa7')]=db['sequelize'][_0x9978('0x14')](_0x9978('0xa8'));db[_0x9978('0xa9')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xaa'));db[_0x9978('0xab')]=db['sequelize'][_0x9978('0x14')](_0x9978('0xac'));db[_0x9978('0xad')]=db[_0x9978('0x4')]['import'](_0x9978('0xae'));db['ZendeskConfiguration']=db[_0x9978('0x4')]['import'](_0x9978('0xaf'));db[_0x9978('0xb0')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xb1'));db[_0x9978('0xb2')]=db['sequelize']['import'](_0x9978('0xb3'));db[_0x9978('0xb4')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xb5'));db[_0x9978('0xb6')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xb7'));db[_0x9978('0xb8')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xb9'));db[_0x9978('0xba')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xbb'));db[_0x9978('0xbc')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xbd'));db[_0x9978('0xbe')]=db[_0x9978('0x4')]['import'](_0x9978('0xbf'));db[_0x9978('0xc0')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xc1'));db['ServicenowField']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xc2'));db['Dynamics365Account']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xc3'));db[_0x9978('0xc4')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xc5'));db[_0x9978('0xc6')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xc7'));db[_0x9978('0xc8')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xc9'));db[_0x9978('0xca')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xcb'));db[_0x9978('0x89')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/integration/integration.model');db[_0x9978('0xcc')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xcd'));db[_0x9978('0xce')]=db['sequelize'][_0x9978('0x14')](_0x9978('0xcf'));db[_0x9978('0xd0')]=db[_0x9978('0x4')]['import'](_0x9978('0xd1'));db[_0x9978('0xd2')]=db['sequelize'][_0x9978('0x14')](_0x9978('0xd3'));db[_0x9978('0xd4')]=db[_0x9978('0x4')]['import'](_0x9978('0xd5'));db[_0x9978('0xd6')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db['sequelize']['import'](_0x9978('0xd7'));db[_0x9978('0xd8')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xd9'));db[_0x9978('0xda')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xdb'));db[_0x9978('0xdc')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xdd'));db[_0x9978('0xde')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xdf'));db[_0x9978('0xe0')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize'][_0x9978('0x14')](_0x9978('0xe1'));db[_0x9978('0xe2')]=db['sequelize']['import'](_0x9978('0xe3'));db[_0x9978('0xe4')]=db['sequelize']['import'](_0x9978('0xe5'));db[_0x9978('0xe6')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/team/team.model');db['License']=db['sequelize']['import'](_0x9978('0xe7'));db[_0x9978('0xe8')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xe9'));db[_0x9978('0xea')]=db['sequelize'][_0x9978('0x14')](_0x9978('0xeb'));db[_0x9978('0xec')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xed'));db[_0x9978('0xee')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xef'));db[_0x9978('0xf0')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xf1'));db[_0x9978('0xf2')]=db[_0x9978('0x4')]['import'](_0x9978('0xf3'));db[_0x9978('0xf4')]=db['sequelize'][_0x9978('0x14')](_0x9978('0xf5'));db[_0x9978('0xf6')]=db[_0x9978('0x4')][_0x9978('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x9978('0xf7')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xf8'));db[_0x9978('0xf9')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xfa'));db['VoicePrefix']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xfb'));db[_0x9978('0xfc')]=db[_0x9978('0x4')]['import'](_0x9978('0xfd'));db['UserProfileSection']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0xfe'));db[_0x9978('0xff')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x100'));db[_0x9978('0x101')]=db[_0x9978('0x4')]['import'](_0x9978('0x102'));db[_0x9978('0x103')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x104'));db[_0x9978('0x105')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x106'));db[_0x9978('0x107')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x108'));db['WhatsappMessage']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x109'));db[_0x9978('0x10a')]=db[_0x9978('0x4')]['import'](_0x9978('0x10b'));db[_0x9978('0x10c')]=db['sequelize'][_0x9978('0x14')](_0x9978('0x10d'));db[_0x9978('0x10e')]=db[_0x9978('0x4')]['import']('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x10f'));db[_0x9978('0x110')]=db[_0x9978('0x4')][_0x9978('0x14')](_0x9978('0x111'));db[_0x9978('0x13')]['hasOne'](db[_0x9978('0x22')],{'as':'VoiceMail','onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x13')][_0x9978('0x114')](db[_0x9978('0x1e')],{'as':_0x9978('0x115'),'foreignKey':'UserId'});db[_0x9978('0x13')][_0x9978('0x114')](db['UserVoiceQueueRt'],{'as':_0x9978('0x116'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x13')]['hasMany'](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x9978('0x112'),'hooks':!![]});db[_0x9978('0x13')][_0x9978('0x114')](db[_0x9978('0x72')],{'as':'HopperFinals','foreignKey':_0x9978('0x113')});db[_0x9978('0x13')][_0x9978('0x114')](db[_0x9978('0x117')],{'as':_0x9978('0x118'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x13')][_0x9978('0x114')](db[_0x9978('0x119')],{'as':_0x9978('0x119'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x13')]['hasMany'](db[_0x9978('0x11a')],{'as':_0x9978('0x11b'),'foreignKey':_0x9978('0x113')});db['User'][_0x9978('0x114')](db[_0x9978('0x11c')],{'as':_0x9978('0x11d'),'foreignKey':_0x9978('0x113')});db['User']['hasMany'](db[_0x9978('0x11e')],{'as':_0x9978('0x11f'),'foreignKey':_0x9978('0x113')});db['User'][_0x9978('0x114')](db['FaxInteraction'],{'as':_0x9978('0x120'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x13')][_0x9978('0x114')](db['MailInteraction'],{'as':_0x9978('0x121'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x13')][_0x9978('0x114')](db[_0x9978('0x107')],{'as':_0x9978('0x122'),'foreignKey':_0x9978('0x113')});db['User'][_0x9978('0x114')](db[_0x9978('0x101')],{'as':'UserNotifications','foreignKey':_0x9978('0x123')});db[_0x9978('0x13')][_0x9978('0x124')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0x9978('0x125')});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x68')],{'as':_0x9978('0x127'),'through':_0x9978('0x128')});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x6d')],{'as':_0x9978('0x129'),'through':_0x9978('0x12a')});db['User'][_0x9978('0x126')](db[_0x9978('0xf9')],{'as':_0x9978('0x12b'),'through':_0x9978('0x12c')});db['User'][_0x9978('0x126')](db['Team'],{'through':_0x9978('0x12d')});db[_0x9978('0x13')]['belongsToMany'](db[_0x9978('0x3f')],{'as':'MailInteractions','through':_0x9978('0x12e')});db['User'][_0x9978('0x126')](db[_0x9978('0x11c')],{'as':_0x9978('0x11d'),'through':_0x9978('0x12f')});db['User'][_0x9978('0x126')](db[_0x9978('0x130')],{'as':_0x9978('0x120'),'through':_0x9978('0x131')});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x11e')],{'as':'SmsInteractions','through':_0x9978('0x132')});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x11a')],{'as':_0x9978('0x11b'),'through':'user_has_openchannel_interactions'});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x107')],{'as':_0x9978('0x122'),'through':_0x9978('0x133')});db[_0x9978('0x13')][_0x9978('0x126')](db['VoiceQueue'],{'as':_0x9978('0x134'),'through':_0x9978('0x30'),'required':![]});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x3b')],{'as':_0x9978('0x135'),'through':_0x9978('0x34'),'required':![]});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x136')],{'as':_0x9978('0x137'),'through':_0x9978('0x32'),'required':![],'hooks':!![]});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x51')],{'as':_0x9978('0x138'),'through':_0x9978('0x35'),'required':![]});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x5a')],{'as':_0x9978('0x139'),'through':'UserSmsQueue','required':![]});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x60')],{'as':_0x9978('0x13a'),'through':_0x9978('0x13b'),'required':![]});db['User'][_0x9978('0x126')](db['WhatsappQueue'],{'as':_0x9978('0x13c'),'through':_0x9978('0x13d'),'required':![]});db[_0x9978('0x13')]['belongsToMany'](db['CmList'],{'through':_0x9978('0x12c')});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x13e')],{'as':_0x9978('0x13f'),'through':_0x9978('0x140'),'required':![]});db['User'][_0x9978('0x126')](db[_0x9978('0x141')],{'as':_0x9978('0x142'),'through':_0x9978('0x143')});db[_0x9978('0x13')][_0x9978('0x126')](db['FaxAccount'],{'as':_0x9978('0x144'),'through':_0x9978('0x145')});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x146')],{'as':_0x9978('0x147'),'through':_0x9978('0x148')});db[_0x9978('0x13')]['belongsToMany'](db[_0x9978('0x5c')],{'as':_0x9978('0x149'),'through':_0x9978('0x14a')});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x55')],{'as':_0x9978('0x14b'),'through':_0x9978('0x14c')});db[_0x9978('0x13')][_0x9978('0x126')](db[_0x9978('0x103')],{'as':_0x9978('0x14d'),'through':_0x9978('0x14e')});db[_0x9978('0x13')]['belongsToMany'](db['SquareProject'],{'as':'SquareProjects','through':_0x9978('0x14f')});db[_0x9978('0x15')][_0x9978('0x114')](db[_0x9978('0x19')],{'as':'SpiedAgents','onDelete':_0x9978('0x112'),'foreignKey':'ChanSpyId'});db['VoiceContext']['hasMany'](db[_0x9978('0x19')],{'onDelete':'cascade'});db[_0x9978('0x19')][_0x9978('0x114')](db[_0x9978('0x19')],{'as':'Applications','onDelete':_0x9978('0x112')});db[_0x9978('0x1b')][_0x9978('0x126')](db['Sound'],{'as':_0x9978('0x150'),'through':_0x9978('0x151')});db['VoiceQueue'][_0x9978('0x114')](db[_0x9978('0x152')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x9978('0x1d')][_0x9978('0x114')](db[_0x9978('0x6f')],{'as':_0x9978('0x153'),'foreignKey':_0x9978('0x154')});db[_0x9978('0x1d')][_0x9978('0x114')](db[_0x9978('0x72')],{'as':_0x9978('0x155'),'foreignKey':_0x9978('0x154')});db[_0x9978('0x1d')]['hasMany'](db[_0x9978('0x117')],{'as':_0x9978('0x156'),'foreignKey':'VoiceQueueId'});db[_0x9978('0x1d')]['hasMany'](db[_0x9978('0x119')],{'as':_0x9978('0x119'),'foreignKey':_0x9978('0x154')});db['VoiceQueue']['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x9978('0x154')});db['VoiceQueue'][_0x9978('0x114')](db[_0x9978('0xd6')],{'as':'JscriptySessions','foreignKey':_0x9978('0x154')});db[_0x9978('0x1d')][_0x9978('0x124')](db['Trunk'],{'as':_0x9978('0x157'),'foreignKey':_0x9978('0x158')});db[_0x9978('0x1d')][_0x9978('0x124')](db[_0x9978('0x157')],{'as':_0x9978('0x159'),'foreignKey':_0x9978('0x15a')});db[_0x9978('0x1d')][_0x9978('0x124')](db[_0x9978('0x15b')],{'as':_0x9978('0x15b'),'foreignKey':_0x9978('0x15c')});db[_0x9978('0x1d')][_0x9978('0x124')](db['Pause'],{'as':_0x9978('0x15d'),'foreignKey':_0x9978('0x15e')});db['VoiceQueue']['belongsToMany'](db[_0x9978('0xf9')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x9978('0x1d')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x15f'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0x9978('0x126')](db['Team'],{'as':_0x9978('0x160'),'through':_0x9978('0x110')});db[_0x9978('0x1d')][_0x9978('0x126')](db[_0x9978('0xf9')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0x9978('0x1e')][_0x9978('0x124')](db[_0x9978('0x13')],{'as':_0x9978('0x13'),'foreignKey':_0x9978('0x113')});db['ScreenRecording']['belongsTo'](db[_0x9978('0x13')],{'as':_0x9978('0x13'),'foreignKey':'UserId'});db[_0x9978('0x22')]['hasMany'](db[_0x9978('0x24')],{'as':_0x9978('0x161'),'onDelete':'cascade','foreignKey':_0x9978('0x162'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0x9978('0x124')](db[_0x9978('0x22')],{'foreignKey':_0x9978('0x162'),'targetKey':_0x9978('0x163')});db[_0x9978('0x164')][_0x9978('0x114')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x9978('0x165'),'constraints':![]});db[_0x9978('0x164')][_0x9978('0x114')](db[_0x9978('0x28')],{'as':_0x9978('0x166'),'foreignKey':_0x9978('0x165'),'constraints':![]});db['VoiceCallReport'][_0x9978('0x124')](db['User'],{'as':_0x9978('0x13'),'foreignKey':'UserId'});db[_0x9978('0x164')][_0x9978('0x124')](db[_0x9978('0x6d')],{'as':'Contact','foreignKey':_0x9978('0x167')});db['MailServerIn'][_0x9978('0x124')](db[_0x9978('0x146')],{'as':_0x9978('0x146'),'foreignKey':_0x9978('0x168')});db[_0x9978('0x38')][_0x9978('0x124')](db[_0x9978('0x146')],{'as':_0x9978('0x146'),'foreignKey':_0x9978('0x168')});db[_0x9978('0x146')][_0x9978('0x169')](db[_0x9978('0x16a')],{'as':_0x9978('0x16b'),'onDelete':_0x9978('0x112')});db[_0x9978('0x146')][_0x9978('0x169')](db[_0x9978('0x38')],{'as':'Smtp','onDelete':_0x9978('0x112')});db[_0x9978('0x146')]['hasMany'](db['Disposition'],{'as':_0x9978('0x16c'),'foreignKey':_0x9978('0x168'),'onDelete':_0x9978('0x112')});db[_0x9978('0x146')][_0x9978('0x114')](db['CannedAnswer'],{'as':_0x9978('0x16d'),'foreignKey':_0x9978('0x168')});db[_0x9978('0x146')][_0x9978('0x114')](db[_0x9978('0x41')],{'as':_0x9978('0x161'),'foreignKey':_0x9978('0x168')});db[_0x9978('0x146')][_0x9978('0x114')](db[_0x9978('0x3f')],{'as':_0x9978('0x16e')});db[_0x9978('0x146')]['hasMany'](db[_0x9978('0x43')],{'as':_0x9978('0x16f')});db['MailAccount'][_0x9978('0x124')](db['CmList'],{'as':_0x9978('0x170'),'foreignKey':_0x9978('0x171')});db['MailAccount'][_0x9978('0x124')](db['Template'],{'as':_0x9978('0x85'),'foreignKey':_0x9978('0x172')});db['MailAccount']['belongsTo'](db[_0x9978('0x173')],{'as':_0x9978('0x15d'),'foreignKey':_0x9978('0x15e')});db[_0x9978('0x146')]['belongsToMany'](db[_0x9978('0x13')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x9978('0x3b')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x15f'),'through':_0x9978('0x34')});db[_0x9978('0x3b')]['belongsToMany'](db[_0x9978('0xe6')],{'through':_0x9978('0x174'),'as':_0x9978('0x160')});db[_0x9978('0x3f')][_0x9978('0x114')](db[_0x9978('0x41')],{'as':_0x9978('0x161'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x175')});db[_0x9978('0x3f')][_0x9978('0x124')](db['MailAccount'],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x168')});db['MailInteraction']['belongsTo'](db[_0x9978('0x6d')],{'as':_0x9978('0x177'),'foreignKey':_0x9978('0x167')});db[_0x9978('0x3f')][_0x9978('0x124')](db[_0x9978('0x13')],{'as':_0x9978('0x178'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x3f')][_0x9978('0x126')](db[_0x9978('0x179')],{'through':'mail_interaction_has_tags','as':_0x9978('0x17a')});db['MailInteraction'][_0x9978('0x126')](db['Tag'],{'through':_0x9978('0x17b'),'as':_0x9978('0x17c')});db['MailInteraction'][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x17d'),'through':_0x9978('0x12e'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x9978('0x114')](db[_0x9978('0xec')],{'as':_0x9978('0x17e'),'onDelete':'cascade'});db['MailMessage'][_0x9978('0x124')](db[_0x9978('0x13')],{'as':_0x9978('0x13')});db[_0x9978('0x41')][_0x9978('0x124')](db['CmContact'],{'onDelete':_0x9978('0x112'),'as':_0x9978('0x177')});db[_0x9978('0x41')][_0x9978('0x124')](db[_0x9978('0x3f')],{'as':'Interaction','foreignKey':_0x9978('0x175')});db[_0x9978('0x41')]['belongsTo'](db[_0x9978('0x146')],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x168')});db['MailMessage'][_0x9978('0x124')](db[_0x9978('0x141')],{'as':_0x9978('0x141'),'foreignKey':_0x9978('0x17f')});db[_0x9978('0x41')]['belongsTo'](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x9978('0x43')][_0x9978('0x124')](db[_0x9978('0x13')],{'onDelete':_0x9978('0x180')});db[_0x9978('0x43')][_0x9978('0x124')](db[_0x9978('0x3b')],{'onDelete':_0x9978('0x180')});db[_0x9978('0x43')][_0x9978('0x124')](db[_0x9978('0x146')],{'onDelete':_0x9978('0x180')});db[_0x9978('0x43')][_0x9978('0x124')](db[_0x9978('0x15b')],{'onDelete':_0x9978('0x180'),'foreignKey':_0x9978('0x15c')});db[_0x9978('0x43')][_0x9978('0x124')](db[_0x9978('0x179')],{'onDelete':_0x9978('0x180'),'foreignKey':_0x9978('0x181')});db['MailQueueReport'][_0x9978('0x124')](db[_0x9978('0x146')],{});db[_0x9978('0x45')]['belongsTo'](db[_0x9978('0xf9')],{'as':_0x9978('0x170'),'foreignKey':_0x9978('0x171')});db[_0x9978('0x45')][_0x9978('0x124')](db[_0x9978('0x6d')],{'as':'Contact','foreignKey':_0x9978('0x167')});db[_0x9978('0x45')]['belongsTo'](db[_0x9978('0x3f')],{});db[_0x9978('0x45')][_0x9978('0x124')](db['MailMessage'],{});db[_0x9978('0x45')][_0x9978('0x124')](db[_0x9978('0x13')],{});db[_0x9978('0x45')][_0x9978('0x124')](db['MailQueue'],{});db['Dashboard'][_0x9978('0x114')](db[_0x9978('0x49')],{'as':_0x9978('0x182'),'onDelete':_0x9978('0x112')});db['FaxAccount'][_0x9978('0x114')](db[_0x9978('0x7a')],{'as':_0x9978('0x16c'),'foreignKey':_0x9978('0x183'),'onDelete':'cascade'});db[_0x9978('0x4b')][_0x9978('0x114')](db[_0x9978('0x79')],{'as':_0x9978('0x16d'),'foreignKey':_0x9978('0x183')});db[_0x9978('0x4b')]['hasMany'](db[_0x9978('0x130')],{'as':'Interactions'});db[_0x9978('0x4b')][_0x9978('0x114')](db[_0x9978('0x4d')],{'as':'Applications'});db[_0x9978('0x4b')]['hasMany'](db['VoiceExtension'],{'as':_0x9978('0x184'),'onDelete':_0x9978('0x112')});db['FaxAccount'][_0x9978('0x114')](db[_0x9978('0x4f')],{'as':_0x9978('0x161')});db[_0x9978('0x4b')][_0x9978('0x124')](db['Trunk'],{'as':_0x9978('0x157')});db[_0x9978('0x4b')]['belongsTo'](db[_0x9978('0xf9')],{'as':'List','foreignKey':_0x9978('0x171')});db['FaxAccount'][_0x9978('0x124')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x9978('0x15e')});db[_0x9978('0x4b')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':'Agents','through':_0x9978('0x145')});db[_0x9978('0x4d')]['belongsTo'](db['User'],{'onDelete':_0x9978('0x180')});db[_0x9978('0x4d')][_0x9978('0x124')](db[_0x9978('0x51')],{'onDelete':_0x9978('0x180')});db[_0x9978('0x4d')][_0x9978('0x124')](db[_0x9978('0x4b')],{'onDelete':_0x9978('0x180')});db[_0x9978('0x4d')][_0x9978('0x124')](db['Tag'],{'onDelete':_0x9978('0x180'),'foreignKey':'TagId'});db[_0x9978('0x130')]['hasMany'](db[_0x9978('0x4f')],{'as':_0x9978('0x161'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x185')});db['FaxInteraction'][_0x9978('0x124')](db[_0x9978('0x4b')],{'as':'Account','foreignKey':_0x9978('0x183')});db[_0x9978('0x130')][_0x9978('0x124')](db[_0x9978('0x6d')],{'as':_0x9978('0x177'),'foreignKey':'ContactId'});db[_0x9978('0x130')][_0x9978('0x124')](db[_0x9978('0x13')],{'as':_0x9978('0x178'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x130')]['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x9978('0x130')][_0x9978('0x126')](db[_0x9978('0x179')],{'through':'fax_interaction_has_tags','as':_0x9978('0x17c')});db[_0x9978('0x130')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x17d'),'through':'user_has_fax_interactions','foreignKey':_0x9978('0x185')});db['FaxMessage'][_0x9978('0x124')](db[_0x9978('0x13')],{'onDelete':_0x9978('0x112'),'as':_0x9978('0x13')});db[_0x9978('0x4f')][_0x9978('0x124')](db[_0x9978('0x130')],{'as':_0x9978('0x186'),'foreignKey':'FaxInteractionId'});db[_0x9978('0x4f')]['belongsTo'](db['CmContact'],{'onDelete':_0x9978('0x112'),'as':_0x9978('0x177')});db[_0x9978('0x4f')][_0x9978('0x124')](db['Attachment'],{'as':'Attachment','foreignKey':_0x9978('0x187')});db[_0x9978('0x4f')][_0x9978('0x124')](db['FaxAccount'],{'as':_0x9978('0x176'),'foreignKey':'FaxAccountId'});db[_0x9978('0x51')][_0x9978('0x126')](db['User'],{'as':_0x9978('0x15f'),'through':_0x9978('0x35')});db['FaxQueue'][_0x9978('0x126')](db[_0x9978('0xe6')],{'through':'team_has_fax_queues','as':'Teams'});db['FaxQueueReport']['belongsTo'](db[_0x9978('0x4b')],{});db[_0x9978('0x53')][_0x9978('0x124')](db[_0x9978('0xf9')],{'as':_0x9978('0x170'),'foreignKey':_0x9978('0x171')});db[_0x9978('0x53')][_0x9978('0x124')](db[_0x9978('0x6d')],{'as':'Contact','foreignKey':'ContactId'});db[_0x9978('0x53')][_0x9978('0x124')](db[_0x9978('0x130')],{});db[_0x9978('0x53')][_0x9978('0x124')](db[_0x9978('0x4f')],{});db[_0x9978('0x53')][_0x9978('0x124')](db[_0x9978('0x13')],{});db[_0x9978('0x53')][_0x9978('0x124')](db[_0x9978('0x51')],{});db[_0x9978('0x55')][_0x9978('0x114')](db[_0x9978('0x7a')],{'as':_0x9978('0x16c'),'foreignKey':_0x9978('0x188'),'onDelete':_0x9978('0x112')});db['SmsAccount'][_0x9978('0x114')](db[_0x9978('0x79')],{'as':_0x9978('0x16d'),'foreignKey':_0x9978('0x188')});db[_0x9978('0x55')]['hasMany'](db[_0x9978('0x58')],{'as':_0x9978('0x161'),'foreignKey':'SmsAccountId'});db[_0x9978('0x55')][_0x9978('0x114')](db['SmsInteraction'],{'as':_0x9978('0x16e')});db[_0x9978('0x55')][_0x9978('0x114')](db['SmsApplication'],{'as':_0x9978('0x16f')});db[_0x9978('0x55')]['belongsTo'](db[_0x9978('0xf9')],{'as':_0x9978('0x170'),'foreignKey':_0x9978('0x171')});db[_0x9978('0x55')][_0x9978('0x124')](db[_0x9978('0x173')],{'as':_0x9978('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9978('0x55')]['belongsToMany'](db[_0x9978('0x13')],{'as':_0x9978('0x15f'),'through':'user_has_sms_accounts'});db[_0x9978('0x189')][_0x9978('0x124')](db['User'],{'onDelete':_0x9978('0x180')});db[_0x9978('0x189')][_0x9978('0x124')](db['SmsQueue'],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0x9978('0x55')],{'onDelete':_0x9978('0x180')});db[_0x9978('0x189')][_0x9978('0x124')](db[_0x9978('0x15b')],{'onDelete':_0x9978('0x180'),'foreignKey':_0x9978('0x15c')});db[_0x9978('0x189')][_0x9978('0x124')](db[_0x9978('0x179')],{'onDelete':_0x9978('0x180'),'foreignKey':_0x9978('0x181')});db[_0x9978('0x11e')][_0x9978('0x114')](db[_0x9978('0x58')],{'as':_0x9978('0x161'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x18a')});db['SmsInteraction'][_0x9978('0x124')](db['SmsAccount'],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x188')});db[_0x9978('0x11e')][_0x9978('0x124')](db[_0x9978('0x6d')],{'as':_0x9978('0x177'),'foreignKey':_0x9978('0x167')});db[_0x9978('0x11e')]['belongsTo'](db[_0x9978('0x13')],{'as':_0x9978('0x178'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x11e')][_0x9978('0x126')](db[_0x9978('0x179')],{'through':'sms_interaction_has_tags','as':_0x9978('0x17a')});db['SmsInteraction']['belongsToMany'](db[_0x9978('0x179')],{'through':_0x9978('0x18b'),'as':_0x9978('0x17c')});db['SmsInteraction'][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x17d'),'through':_0x9978('0x132'),'foreignKey':'SmsInteractionId'});db['SmsMessage']['belongsTo'](db[_0x9978('0x13')],{'as':_0x9978('0x13')});db[_0x9978('0x58')]['belongsTo'](db[_0x9978('0x6d')],{'onDelete':_0x9978('0x112'),'as':_0x9978('0x177')});db[_0x9978('0x58')][_0x9978('0x124')](db['SmsInteraction'],{'onDelete':_0x9978('0x112'),'as':_0x9978('0x186'),'foreignKey':_0x9978('0x18a')});db[_0x9978('0x58')][_0x9978('0x124')](db['SmsAccount'],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x188')});db[_0x9978('0x5a')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x15f'),'through':_0x9978('0x18c'),'foreignKey':_0x9978('0x18d')});db[_0x9978('0x5a')][_0x9978('0x126')](db[_0x9978('0xe6')],{'through':_0x9978('0x18e'),'as':_0x9978('0x160')});db[_0x9978('0x5c')]['hasMany'](db[_0x9978('0x7a')],{'as':_0x9978('0x16c'),'foreignKey':_0x9978('0x18f'),'onDelete':_0x9978('0x112')});db[_0x9978('0x5c')][_0x9978('0x114')](db[_0x9978('0x79')],{'as':'Answers','foreignKey':_0x9978('0x18f')});db[_0x9978('0x5c')][_0x9978('0x114')](db[_0x9978('0x11a')],{'as':'Interactions','foreignKey':_0x9978('0x18f')});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':_0x9978('0x161'),'foreignKey':_0x9978('0x18f')});db[_0x9978('0x5c')]['hasMany'](db[_0x9978('0x190')],{'as':_0x9978('0x16f'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x9978('0x124')](db[_0x9978('0xf9')],{'as':_0x9978('0x170'),'foreignKey':_0x9978('0x171')});db[_0x9978('0x5c')]['belongsTo'](db[_0x9978('0x173')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x9978('0x5c')]['belongsToMany'](db['User'],{'as':_0x9978('0x15f'),'through':_0x9978('0x14a')});db[_0x9978('0x190')][_0x9978('0x124')](db['User'],{'onDelete':'restrict'});db[_0x9978('0x190')][_0x9978('0x124')](db[_0x9978('0x60')],{'onDelete':_0x9978('0x180'),'foreignKey':_0x9978('0x191')});db['OpenchannelApplication']['belongsTo'](db[_0x9978('0x5c')],{'onDelete':_0x9978('0x180'),'foreignKey':_0x9978('0x18f')});db[_0x9978('0x190')]['belongsTo'](db[_0x9978('0x15b')],{'onDelete':'restrict','foreignKey':_0x9978('0x15c')});db[_0x9978('0x190')][_0x9978('0x124')](db[_0x9978('0x179')],{'onDelete':_0x9978('0x180'),'foreignKey':_0x9978('0x181')});db[_0x9978('0x11a')][_0x9978('0x114')](db['OpenchannelMessage'],{'as':_0x9978('0x161'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x192')});db[_0x9978('0x11a')][_0x9978('0x124')](db[_0x9978('0x5c')],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x18f')});db[_0x9978('0x11a')][_0x9978('0x124')](db['CmContact'],{'as':_0x9978('0x177'),'foreignKey':_0x9978('0x167')});db[_0x9978('0x11a')][_0x9978('0x124')](db['User'],{'as':'Owner','foreignKey':_0x9978('0x113')});db[_0x9978('0x11a')][_0x9978('0x126')](db[_0x9978('0x179')],{'through':_0x9978('0x193'),'as':'Tags'});db['OpenchannelInteraction'][_0x9978('0x126')](db[_0x9978('0x179')],{'through':'openchannel_interaction_has_tags','as':_0x9978('0x17c')});db[_0x9978('0x11a')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':'Users','through':_0x9978('0x194'),'foreignKey':_0x9978('0x192')});db[_0x9978('0x5e')]['belongsTo'](db[_0x9978('0x13')],{'onDelete':_0x9978('0x112'),'as':_0x9978('0x13')});db[_0x9978('0x5e')][_0x9978('0x124')](db['CmContact'],{'onDelete':_0x9978('0x112'),'as':'Contact'});db['OpenchannelMessage']['belongsTo'](db['OpenchannelInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0x9978('0x5e')][_0x9978('0x124')](db[_0x9978('0xec')],{'as':'Attachment','foreignKey':_0x9978('0x187')});db['OpenchannelMessage'][_0x9978('0x124')](db[_0x9978('0x5c')],{'as':'Account','foreignKey':_0x9978('0x18f')});db[_0x9978('0x60')][_0x9978('0x126')](db['User'],{'as':'Agents','through':_0x9978('0x13b'),'foreignKey':_0x9978('0x191')});db[_0x9978('0x60')][_0x9978('0x126')](db[_0x9978('0xe6')],{'through':_0x9978('0x195'),'as':'Teams'});db[_0x9978('0x141')][_0x9978('0x114')](db[_0x9978('0x7a')],{'as':_0x9978('0x16c'),'foreignKey':_0x9978('0x17f'),'onDelete':'cascade'});db[_0x9978('0x141')][_0x9978('0x114')](db[_0x9978('0x79')],{'as':_0x9978('0x16d'),'foreignKey':_0x9978('0x17f')});db[_0x9978('0x141')][_0x9978('0x114')](db['ChatProactiveAction'],{'as':_0x9978('0x196')});db[_0x9978('0x141')][_0x9978('0x114')](db[_0x9978('0x11c')],{'as':_0x9978('0x16e')});db[_0x9978('0x141')][_0x9978('0x114')](db[_0x9978('0x197')],{'as':_0x9978('0x16f')});db['ChatWebsite'][_0x9978('0x114')](db[_0x9978('0x65')],{'as':_0x9978('0x161')});db[_0x9978('0x141')]['belongsTo'](db['CmList'],{'as':_0x9978('0x170'),'foreignKey':'ListId'});db[_0x9978('0x141')][_0x9978('0x124')](db[_0x9978('0x15b')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x9978('0x141')][_0x9978('0x124')](db[_0x9978('0x146')],{'as':_0x9978('0x146'),'foreignKey':'MailAccountId'});db[_0x9978('0x141')]['belongsTo'](db[_0x9978('0x173')],{'as':_0x9978('0x15d'),'foreignKey':_0x9978('0x15e')});db[_0x9978('0x141')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x15f'),'through':_0x9978('0x143')});db['OpenchannelQueueReport'][_0x9978('0x124')](db[_0x9978('0x5c')],{});db[_0x9978('0x198')][_0x9978('0x124')](db[_0x9978('0xf9')],{'as':'List','foreignKey':'ListId'});db[_0x9978('0x198')][_0x9978('0x124')](db['CmContact'],{'as':_0x9978('0x177'),'foreignKey':_0x9978('0x167')});db[_0x9978('0x198')]['belongsTo'](db[_0x9978('0x11a')],{});db[_0x9978('0x198')][_0x9978('0x124')](db[_0x9978('0x5e')],{});db[_0x9978('0x198')]['belongsTo'](db['User'],{});db[_0x9978('0x198')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x9978('0x197')][_0x9978('0x124')](db[_0x9978('0x13')],{'as':_0x9978('0x199'),'foreignKey':_0x9978('0x113'),'onDelete':'restrict'});db[_0x9978('0x197')][_0x9978('0x124')](db[_0x9978('0x136')],{'as':_0x9978('0x19a'),'foreignKey':'ChatQueueId','onDelete':_0x9978('0x180')});db[_0x9978('0x197')]['belongsTo'](db[_0x9978('0x141')],{'as':_0x9978('0x19b'),'foreignKey':_0x9978('0x17f'),'onDelete':_0x9978('0x180')});db[_0x9978('0x197')][_0x9978('0x124')](db[_0x9978('0x179')],{'onDelete':'restrict','foreignKey':_0x9978('0x181')});db[_0x9978('0x11c')][_0x9978('0x114')](db[_0x9978('0x65')],{'as':_0x9978('0x161'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x19c')});db['ChatInteraction'][_0x9978('0x124')](db[_0x9978('0x141')],{'as':'Account','foreignKey':_0x9978('0x17f')});db[_0x9978('0x11c')][_0x9978('0x124')](db['CmContact'],{'as':_0x9978('0x177'),'foreignKey':_0x9978('0x167')});db['ChatInteraction']['belongsTo'](db['User'],{'as':_0x9978('0x178'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x11c')][_0x9978('0x126')](db['Tag'],{'through':_0x9978('0x19d'),'as':_0x9978('0x17a')});db['ChatInteraction'][_0x9978('0x126')](db[_0x9978('0x179')],{'through':_0x9978('0x19d'),'as':_0x9978('0x17c')});db['ChatInteraction'][_0x9978('0x126')](db['User'],{'as':_0x9978('0x17d'),'through':_0x9978('0x12f'),'foreignKey':_0x9978('0x19c')});db[_0x9978('0x65')][_0x9978('0x124')](db[_0x9978('0x13')],{'onDelete':'cascade','as':_0x9978('0x13')});db[_0x9978('0x65')][_0x9978('0x124')](db['CmContact'],{'onDelete':'cascade','as':_0x9978('0x177'),'foreignKey':_0x9978('0x167')});db[_0x9978('0x65')]['belongsTo'](db['ChatInteraction'],{'onDelete':'cascade','as':_0x9978('0x186'),'foreignKey':'ChatInteractionId'});db[_0x9978('0x65')][_0x9978('0x124')](db[_0x9978('0xec')],{'as':_0x9978('0xec'),'foreignKey':_0x9978('0x187')});db[_0x9978('0x65')][_0x9978('0x124')](db[_0x9978('0x141')],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x17f')});db[_0x9978('0x66')][_0x9978('0x114')](db[_0x9978('0xec')],{'as':_0x9978('0x17e'),'foreignKey':_0x9978('0x19e'),'onDelete':_0x9978('0x112'),'hooks':!![]});db[_0x9978('0x66')][_0x9978('0x124')](db[_0x9978('0x6d')],{'onDelete':_0x9978('0x112'),'as':_0x9978('0x177'),'foreignKey':_0x9978('0x167')});db['ChatOfflineMessage'][_0x9978('0x124')](db[_0x9978('0x141')],{'as':_0x9978('0x176'),'foreignKey':'ChatWebsiteId'});db[_0x9978('0x136')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x15f'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x9978('0x126')](db['Team'],{'through':_0x9978('0x19f'),'as':'Teams'});db[_0x9978('0x68')][_0x9978('0x114')](db[_0x9978('0xd0')],{'as':_0x9978('0x161'),'foreignKey':_0x9978('0x1a0'),'onDelete':_0x9978('0x112')});db[_0x9978('0x68')][_0x9978('0x126')](db['User'],{'as':'Members','through':_0x9978('0x128')});db[_0x9978('0x6a')][_0x9978('0x124')](db['ChatWebsite'],{'as':_0x9978('0x19b'),'foreignKey':_0x9978('0x17f')});db[_0x9978('0x6b')][_0x9978('0x114')](db['CmContact'],{'as':_0x9978('0x129'),'foreignKey':'CompanyId'});db[_0x9978('0x6d')][_0x9978('0x114')](db[_0x9978('0x6f')],{'as':_0x9978('0x153'),'foreignKey':_0x9978('0x167')});db[_0x9978('0x6d')][_0x9978('0x114')](db[_0x9978('0x72')],{'as':_0x9978('0x155'),'foreignKey':_0x9978('0x167')});db[_0x9978('0x6d')][_0x9978('0x114')](db['CmHopperHistory'],{'as':_0x9978('0x156'),'foreignKey':_0x9978('0x167')});db[_0x9978('0x6d')][_0x9978('0x114')](db[_0x9978('0x119')],{'as':_0x9978('0x119'),'foreignKey':_0x9978('0x167')});db[_0x9978('0x6d')][_0x9978('0x114')](db[_0x9978('0xd6')],{'as':_0x9978('0x1a1'),'foreignKey':_0x9978('0x167')});db['CmContact'][_0x9978('0x114')](db[_0x9978('0x11a')],{'as':_0x9978('0x11b'),'foreignKey':_0x9978('0x167'),'onDelete':_0x9978('0x180')});db[_0x9978('0x6d')][_0x9978('0x114')](db[_0x9978('0x11c')],{'as':_0x9978('0x11d'),'foreignKey':_0x9978('0x167'),'onDelete':_0x9978('0x180')});db[_0x9978('0x6d')][_0x9978('0x114')](db[_0x9978('0x11e')],{'as':_0x9978('0x11f'),'foreignKey':'ContactId','onDelete':_0x9978('0x180')});db[_0x9978('0x6d')][_0x9978('0x114')](db[_0x9978('0x130')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0x9978('0x180')});db['CmContact'][_0x9978('0x114')](db[_0x9978('0x3f')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0x9978('0x180')});db[_0x9978('0x6d')]['belongsTo'](db['CmCompany'],{'as':'Company','foreignKey':_0x9978('0x1a2')});db[_0x9978('0x6d')][_0x9978('0x124')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0x9978('0x112')});db[_0x9978('0x6d')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x17d'),'through':_0x9978('0x12a')});db[_0x9978('0x6d')]['belongsToMany'](db[_0x9978('0x179')],{'as':_0x9978('0x17a'),'through':_0x9978('0x1a3')});db[_0x9978('0x6d')]['belongsToMany'](db['Tag'],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0x9978('0x6f')][_0x9978('0x124')](db['CmContact'],{'as':_0x9978('0x177'),'foreignKey':_0x9978('0x167'),'onDelete':_0x9978('0x112')});db[_0x9978('0x6f')][_0x9978('0x124')](db['CmList'],{'as':_0x9978('0x170'),'foreignKey':'ListId','onDelete':_0x9978('0x112')});db[_0x9978('0x6f')][_0x9978('0x124')](db[_0x9978('0x13')],{'as':_0x9978('0x199'),'foreignKey':_0x9978('0x113')});db['CmHopper'][_0x9978('0x124')](db[_0x9978('0x1d')],{'as':'Queue','foreignKey':_0x9978('0x154'),'onDelete':'cascade'});db[_0x9978('0x6f')]['belongsTo'](db[_0x9978('0xe8')],{'as':_0x9978('0xe8'),'foreignKey':_0x9978('0x1a4'),'onDelete':_0x9978('0x112')});db['CmHopper'][_0x9978('0x124')](db['User'],{'as':'Owner','foreignKey':_0x9978('0x1a5')});db['CmHopperBlack'][_0x9978('0x124')](db[_0x9978('0x6d')],{'as':_0x9978('0x177'),'foreignKey':_0x9978('0x167'),'onDelete':_0x9978('0x112')});db[_0x9978('0x70')][_0x9978('0x124')](db['CmList'],{'as':_0x9978('0x170'),'foreignKey':_0x9978('0x171'),'onDelete':'cascade'});db['CmHopperBlack'][_0x9978('0x124')](db[_0x9978('0x1d')],{'as':_0x9978('0x19a'),'foreignKey':_0x9978('0x154'),'onDelete':_0x9978('0x112')});db[_0x9978('0x70')]['belongsTo'](db[_0x9978('0xe8')],{'as':_0x9978('0xe8'),'foreignKey':_0x9978('0x1a4'),'onDelete':_0x9978('0x112')});db[_0x9978('0x77')][_0x9978('0x114')](db[_0x9978('0x7b')],{'as':{'plural':_0x9978('0x1a6'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db['Automation'][_0x9978('0x114')](db[_0x9978('0x7b')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x9978('0x112'),'hooks':!![]});db[_0x9978('0x77')][_0x9978('0x114')](db[_0x9978('0x76')],{'as':_0x9978('0x1a7'),'foreignKey':'AutomationId','onDelete':_0x9978('0x112'),'hooks':!![]});db[_0x9978('0x7a')][_0x9978('0x114')](db[_0x9978('0x7a')],{'as':_0x9978('0x16c'),'foreignKey':_0x9978('0x1a8'),'onDelete':'cascade'});db['Interval'][_0x9978('0x114')](db[_0x9978('0x15b')],{'as':_0x9978('0x1a9'),'foreignKey':_0x9978('0x15c'),'onDelete':_0x9978('0x112'),'hooks':!![],'required':![]});db[_0x9978('0x15b')][_0x9978('0x114')](db['VoiceExtension'],{'as':_0x9978('0x1aa'),'foreignKey':_0x9978('0x15c'),'onDelete':'restrict'});db[_0x9978('0x15b')]['hasMany'](db['MailApplication'],{'as':_0x9978('0x1ab'),'foreignKey':_0x9978('0x15c')});db[_0x9978('0x15b')][_0x9978('0x114')](db[_0x9978('0x197')],{'as':_0x9978('0x1ac'),'foreignKey':_0x9978('0x15c')});db[_0x9978('0x15b')][_0x9978('0x114')](db['FaxApplication'],{'as':_0x9978('0x1ad'),'foreignKey':_0x9978('0x15c')});db[_0x9978('0x15b')][_0x9978('0x114')](db[_0x9978('0x189')],{'as':_0x9978('0x1ae'),'foreignKey':_0x9978('0x15c')});db[_0x9978('0x81')]['belongsTo'](db[_0x9978('0x146')],{});db['Schedule'][_0x9978('0x124')](db[_0x9978('0x8f')],{'foreignKey':'DefaultReportId'});db[_0x9978('0x81')][_0x9978('0x124')](db[_0x9978('0x8d')],{'foreignKey':'CustomReportId'});db[_0x9978('0x82')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0x9978('0x151'),'onDelete':_0x9978('0x180')});db['Tag'][_0x9978('0x126')](db[_0x9978('0x6d')],{'through':_0x9978('0x1a3')});db['Tag']['belongsToMany'](db['ChatInteraction'],{'through':_0x9978('0x19d')});db[_0x9978('0x179')]['belongsToMany'](db[_0x9978('0x3f')],{'through':_0x9978('0x17b')});db[_0x9978('0x179')]['belongsToMany'](db[_0x9978('0x11e')],{'through':_0x9978('0x18b')});db[_0x9978('0x179')][_0x9978('0x126')](db[_0x9978('0x130')],{'through':_0x9978('0x1af')});db[_0x9978('0x179')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0x9978('0x193')});db[_0x9978('0x179')]['belongsToMany'](db[_0x9978('0x107')],{'through':_0x9978('0x1b0')});db['Trigger']['hasMany'](db[_0x9978('0x7b')],{'as':{'plural':_0x9978('0x1b1'),'singular':'AllCondition'},'foreignKey':_0x9978('0x1b2'),'onDelete':_0x9978('0x112'),'hooks':!![]});db[_0x9978('0x87')][_0x9978('0x114')](db[_0x9978('0x7b')],{'as':{'plural':'AnyConditions','singular':_0x9978('0x1b3')},'foreignKey':'TriggerAnyId','onDelete':_0x9978('0x112'),'hooks':!![]});db[_0x9978('0x87')][_0x9978('0x114')](db[_0x9978('0x76')],{'as':'Actions','foreignKey':_0x9978('0x1b4'),'onDelete':'cascade','hooks':!![]});db[_0x9978('0x8d')]['hasMany'](db[_0x9978('0x95')],{'as':_0x9978('0x1b5'),'onDelete':'cascade','foreignKey':_0x9978('0x1b6'),'hooks':!![]});db['AnalyticDefaultReport'][_0x9978('0x114')](db['AnalyticFieldReport'],{'as':_0x9978('0x1b5'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x9978('0x93')][_0x9978('0x114')](db[_0x9978('0x95')],{'as':_0x9978('0x1b5'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1b7')});db[_0x9978('0x95')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x9978('0x1b7')});db[_0x9978('0x99')][_0x9978('0x114')](db[_0x9978('0x9b')],{'as':_0x9978('0x1b8'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1b9')});db[_0x9978('0x9b')][_0x9978('0x114')](db[_0x9978('0x9d')],{'as':_0x9978('0x1ba'),'onDelete':_0x9978('0x112'),'foreignKey':'SubjectId'});db['SalesforceConfiguration']['hasMany'](db[_0x9978('0x9d')],{'as':_0x9978('0x1bb'),'onDelete':_0x9978('0x112'),'foreignKey':'DescriptionId'});db[_0x9978('0x9b')][_0x9978('0x114')](db[_0x9978('0x9d')],{'as':_0x9978('0x1b5'),'onDelete':_0x9978('0x112'),'foreignKey':'FieldId'});db[_0x9978('0x9b')]['belongsTo'](db[_0x9978('0x99')],{'as':'Account','foreignKey':_0x9978('0x1b9')});db[_0x9978('0x9d')][_0x9978('0x114')](db['SalesforceField'],{'as':_0x9978('0x1bc'),'foreignKey':_0x9978('0x1bd')});db['SalesforceField']['hasMany'](db[_0x9978('0x9d')],{'as':_0x9978('0x1be'),'foreignKey':_0x9978('0x1bf')});db[_0x9978('0x9d')][_0x9978('0x114')](db['SalesforceField'],{'as':'Field','foreignKey':_0x9978('0x1c0')});db[_0x9978('0x9d')][_0x9978('0x124')](db[_0x9978('0x1c1')],{'as':_0x9978('0x1c1'),'foreignKey':_0x9978('0x1c2')});db['SugarcrmAccount']['hasMany'](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1b9')});db['SugarcrmConfiguration']['hasMany'](db[_0x9978('0x1c3')],{'as':'Subjects','onDelete':_0x9978('0x112'),'foreignKey':'SubjectId'});db[_0x9978('0x9f')][_0x9978('0x114')](db[_0x9978('0x1c3')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x9978('0x9f')]['hasMany'](db[_0x9978('0x1c3')],{'as':'Fields','onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0x9f')][_0x9978('0x124')](db[_0x9978('0x9e')],{'as':'Account','foreignKey':'AccountId'});db[_0x9978('0x1c3')]['hasMany'](db[_0x9978('0x1c3')],{'as':_0x9978('0x1bc'),'foreignKey':_0x9978('0x1bd')});db[_0x9978('0x1c3')][_0x9978('0x114')](db['SugarcrmField'],{'as':_0x9978('0x1be'),'foreignKey':_0x9978('0x1bf')});db[_0x9978('0x1c3')][_0x9978('0x114')](db[_0x9978('0x1c3')],{'as':_0x9978('0x1c4'),'foreignKey':'FieldId'});db['SugarcrmField']['belongsTo'](db[_0x9978('0x1c1')],{'as':_0x9978('0x1c1'),'foreignKey':_0x9978('0x1c2')});db[_0x9978('0xa2')][_0x9978('0x114')](db[_0x9978('0xa3')],{'as':'Configurations','onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1b9')});db[_0x9978('0xa3')][_0x9978('0x114')](db[_0x9978('0xa5')],{'as':_0x9978('0x1ba'),'onDelete':'cascade','foreignKey':'SubjectId'});db['DeskConfiguration'][_0x9978('0x114')](db[_0x9978('0xa5')],{'as':_0x9978('0x1bb'),'onDelete':'cascade','foreignKey':_0x9978('0x1bf')});db['DeskConfiguration'][_0x9978('0x114')](db[_0x9978('0xa5')],{'as':_0x9978('0x1b5'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1c0')});db['DeskConfiguration']['belongsTo'](db[_0x9978('0xa2')],{'as':'Account','foreignKey':_0x9978('0x1b9')});db[_0x9978('0xa3')][_0x9978('0x126')](db['Tag'],{'through':_0x9978('0x1c5')});db[_0x9978('0xa5')]['hasMany'](db[_0x9978('0xa5')],{'as':_0x9978('0x1bc'),'foreignKey':_0x9978('0x1bd')});db[_0x9978('0xa5')][_0x9978('0x114')](db['DeskField'],{'as':_0x9978('0x1be'),'foreignKey':_0x9978('0x1bf')});db[_0x9978('0xa5')][_0x9978('0x114')](db[_0x9978('0xa5')],{'as':_0x9978('0x1c4'),'foreignKey':'FieldId'});db[_0x9978('0xa5')][_0x9978('0x124')](db[_0x9978('0x1c1')],{'as':_0x9978('0x1c1'),'foreignKey':_0x9978('0x1c2')});db[_0x9978('0xa7')]['hasMany'](db[_0x9978('0xa9')],{'as':_0x9978('0x1b8'),'onDelete':'cascade','foreignKey':_0x9978('0x1b9')});db[_0x9978('0xa9')][_0x9978('0x114')](db[_0x9978('0xab')],{'as':_0x9978('0x1ba'),'onDelete':'cascade','foreignKey':_0x9978('0x1bd')});db[_0x9978('0xa9')][_0x9978('0x114')](db[_0x9978('0xab')],{'as':'Descriptions','onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1bf')});db[_0x9978('0xa9')]['hasMany'](db[_0x9978('0xab')],{'as':_0x9978('0x1b5'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0xa9')][_0x9978('0x124')](db[_0x9978('0xa7')],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x1b9')});db['ZohoField'][_0x9978('0x114')](db[_0x9978('0xab')],{'as':_0x9978('0x1bc'),'foreignKey':'SubjectId'});db[_0x9978('0xab')]['hasMany'](db['ZohoField'],{'as':'Description','foreignKey':_0x9978('0x1bf')});db['ZohoField'][_0x9978('0x114')](db[_0x9978('0xab')],{'as':_0x9978('0x1c4'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0xab')][_0x9978('0x124')](db[_0x9978('0x1c1')],{'as':_0x9978('0x1c1'),'foreignKey':_0x9978('0x1c2')});db['ZendeskAccount'][_0x9978('0x114')](db[_0x9978('0x1c6')],{'as':_0x9978('0x1b8'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x9978('0x1c6')][_0x9978('0x114')](db[_0x9978('0xb0')],{'as':_0x9978('0x1ba'),'foreignKey':_0x9978('0x1bd')});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0x9978('0x1bb'),'foreignKey':_0x9978('0x1bf')});db['ZendeskConfiguration']['hasMany'](db[_0x9978('0xb0')],{'as':_0x9978('0x1b5'),'foreignKey':_0x9978('0x1c0')});db['ZendeskConfiguration']['belongsTo'](db[_0x9978('0xad')],{'as':_0x9978('0x176'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x9978('0x126')](db[_0x9978('0x179')],{'through':_0x9978('0x1c7')});db[_0x9978('0xb0')][_0x9978('0x114')](db[_0x9978('0xb0')],{'as':_0x9978('0x1bc'),'foreignKey':'SubjectId'});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':_0x9978('0x1be'),'foreignKey':_0x9978('0x1bf')});db['ZendeskField'][_0x9978('0x114')](db[_0x9978('0xb0')],{'as':_0x9978('0x1c4'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0xb0')]['belongsTo'](db[_0x9978('0x1c1')],{'as':_0x9978('0x1c1'),'foreignKey':_0x9978('0x1c2')});db[_0x9978('0xb2')]['hasMany'](db[_0x9978('0xb4')],{'as':_0x9978('0x1b8'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1b9')});db['FreshdeskConfiguration'][_0x9978('0x114')](db[_0x9978('0xb6')],{'as':_0x9978('0x1ba'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1bd')});db[_0x9978('0xb4')][_0x9978('0x114')](db[_0x9978('0xb6')],{'as':_0x9978('0x1bb'),'onDelete':'cascade','foreignKey':_0x9978('0x1bf')});db[_0x9978('0xb4')][_0x9978('0x114')](db[_0x9978('0xb6')],{'as':_0x9978('0x1b5'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0xb4')][_0x9978('0x124')](db[_0x9978('0xb2')],{'as':_0x9978('0x176'),'foreignKey':'AccountId'});db[_0x9978('0xb4')][_0x9978('0x126')](db[_0x9978('0x179')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x9978('0xb6')][_0x9978('0x114')](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x9978('0x1bd')});db[_0x9978('0xb6')][_0x9978('0x114')](db['FreshdeskField'],{'as':_0x9978('0x1be'),'foreignKey':_0x9978('0x1bf')});db[_0x9978('0xb6')][_0x9978('0x114')](db['FreshdeskField'],{'as':_0x9978('0x1c4'),'foreignKey':'FieldId'});db['FreshdeskField'][_0x9978('0x124')](db[_0x9978('0x1c1')],{'as':_0x9978('0x1c1'),'foreignKey':_0x9978('0x1c2')});db['VtigerAccount']['hasMany'](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1b9')});db[_0x9978('0xba')][_0x9978('0x114')](db[_0x9978('0xbc')],{'as':_0x9978('0x1ba'),'foreignKey':_0x9978('0x1bd')});db[_0x9978('0xba')][_0x9978('0x114')](db[_0x9978('0xbc')],{'as':_0x9978('0x1bb'),'foreignKey':_0x9978('0x1bf')});db[_0x9978('0xba')][_0x9978('0x114')](db[_0x9978('0xbc')],{'as':_0x9978('0x1b5'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0xba')][_0x9978('0x124')](db[_0x9978('0xb8')],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x1b9')});db['VtigerField']['hasMany'](db[_0x9978('0xbc')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x9978('0xbc')][_0x9978('0x114')](db[_0x9978('0xbc')],{'as':_0x9978('0x1be'),'foreignKey':'DescriptionId'});db[_0x9978('0xbc')]['hasMany'](db[_0x9978('0xbc')],{'as':_0x9978('0x1c4'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0xbc')]['belongsTo'](db[_0x9978('0x1c1')],{'as':_0x9978('0x1c1'),'foreignKey':_0x9978('0x1c2')});db[_0x9978('0xbe')][_0x9978('0x114')](db[_0x9978('0xc0')],{'as':'Configurations','onDelete':_0x9978('0x112'),'foreignKey':'AccountId'});db[_0x9978('0xc0')]['hasMany'](db[_0x9978('0x1c8')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x9978('0xc0')]['hasMany'](db[_0x9978('0x1c8')],{'as':_0x9978('0x1bb'),'foreignKey':_0x9978('0x1bf')});db['ServicenowConfiguration'][_0x9978('0x114')](db['ServicenowField'],{'as':_0x9978('0x1b5'),'foreignKey':_0x9978('0x1c0')});db['ServicenowConfiguration'][_0x9978('0x124')](db[_0x9978('0xbe')],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x1b9')});db[_0x9978('0x1c8')][_0x9978('0x114')](db['ServicenowField'],{'as':_0x9978('0x1bc'),'foreignKey':_0x9978('0x1bd')});db[_0x9978('0x1c8')]['hasMany'](db[_0x9978('0x1c8')],{'as':_0x9978('0x1be'),'foreignKey':_0x9978('0x1bf')});db[_0x9978('0x1c8')][_0x9978('0x114')](db['ServicenowField'],{'as':_0x9978('0x1c4'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0x1c8')][_0x9978('0x124')](db[_0x9978('0x1c1')],{'as':_0x9978('0x1c1'),'foreignKey':'VariableId'});db[_0x9978('0x1c9')][_0x9978('0x114')](db[_0x9978('0xc4')],{'as':_0x9978('0x1b8'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1b9')});db['Dynamics365Configuration'][_0x9978('0x114')](db[_0x9978('0xc6')],{'as':_0x9978('0x1ba'),'onDelete':_0x9978('0x112'),'foreignKey':'SubjectId'});db[_0x9978('0xc4')]['hasMany'](db[_0x9978('0xc6')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x9978('0x1bf')});db[_0x9978('0xc4')][_0x9978('0x114')](db['Dynamics365Field'],{'as':_0x9978('0x1b5'),'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1c0')});db['Dynamics365Configuration']['belongsTo'](db[_0x9978('0x1c9')],{'as':'Account','foreignKey':_0x9978('0x1b9')});db['Dynamics365Field'][_0x9978('0x114')](db[_0x9978('0xc6')],{'as':_0x9978('0x1bc'),'foreignKey':_0x9978('0x1bd')});db['Dynamics365Field'][_0x9978('0x114')](db[_0x9978('0xc6')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x9978('0xc6')]['hasMany'](db[_0x9978('0xc6')],{'as':_0x9978('0x1c4'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0xc6')][_0x9978('0x124')](db[_0x9978('0x1c1')],{'as':_0x9978('0x1c1'),'foreignKey':_0x9978('0x1c2')});db[_0x9978('0xc8')][_0x9978('0x114')](db[_0x9978('0x1ca')],{'as':_0x9978('0x1b8'),'onDelete':'cascade','foreignKey':_0x9978('0x1b9')});db[_0x9978('0x1ca')][_0x9978('0x114')](db['FreshsalesField'],{'as':_0x9978('0x1ba'),'foreignKey':_0x9978('0x1bd')});db[_0x9978('0x1ca')][_0x9978('0x114')](db[_0x9978('0xca')],{'as':_0x9978('0x1bb'),'foreignKey':_0x9978('0x1bf')});db[_0x9978('0x1ca')][_0x9978('0x114')](db[_0x9978('0xca')],{'as':_0x9978('0x1b5'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0x1ca')][_0x9978('0x124')](db['FreshsalesAccount'],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x1b9')});db[_0x9978('0xca')][_0x9978('0x114')](db[_0x9978('0xca')],{'as':_0x9978('0x1bc'),'foreignKey':_0x9978('0x1bd')});db[_0x9978('0xca')][_0x9978('0x114')](db[_0x9978('0xca')],{'as':_0x9978('0x1be'),'foreignKey':_0x9978('0x1bf')});db['FreshsalesField'][_0x9978('0x114')](db['FreshsalesField'],{'as':_0x9978('0x1c4'),'foreignKey':_0x9978('0x1c0')});db[_0x9978('0xca')][_0x9978('0x124')](db['Variable'],{'as':_0x9978('0x1c1'),'foreignKey':'VariableId'});db[_0x9978('0xce')]['belongsTo'](db[_0x9978('0x141')],{});db[_0x9978('0xce')][_0x9978('0x124')](db[_0x9978('0xf9')],{'as':_0x9978('0x170'),'foreignKey':_0x9978('0x171')});db[_0x9978('0xce')]['belongsTo'](db[_0x9978('0x6d')],{'as':_0x9978('0x177'),'foreignKey':_0x9978('0x167')});db['ChatQueueReport'][_0x9978('0x124')](db['ChatInteraction'],{});db[_0x9978('0xce')][_0x9978('0x124')](db[_0x9978('0x65')],{});db[_0x9978('0xce')]['belongsTo'](db[_0x9978('0x13')],{});db[_0x9978('0xce')][_0x9978('0x124')](db['ChatQueue'],{});db['ChatInternalMessage'][_0x9978('0x124')](db[_0x9978('0x13')],{'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1cb')});db[_0x9978('0xd0')][_0x9978('0x124')](db[_0x9978('0x13')],{'onDelete':_0x9978('0x112'),'foreignKey':_0x9978('0x1cc')});db['JscriptySessionReport'][_0x9978('0x114')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x9978('0xd6')]['hasMany'](db[_0x9978('0xd2')],{'foreignKey':_0x9978('0x1cd'),'onDelete':_0x9978('0x112')});db['SmsQueueReport'][_0x9978('0x124')](db[_0x9978('0x55')],{});db[_0x9978('0x1ce')]['belongsTo'](db[_0x9978('0xf9')],{'as':_0x9978('0x170'),'foreignKey':_0x9978('0x171')});db[_0x9978('0x1ce')][_0x9978('0x124')](db[_0x9978('0x6d')],{'as':_0x9978('0x177'),'foreignKey':'ContactId'});db[_0x9978('0x1ce')][_0x9978('0x124')](db[_0x9978('0x11e')],{});db['SmsQueueReport'][_0x9978('0x124')](db[_0x9978('0x58')],{});db[_0x9978('0x1ce')]['belongsTo'](db[_0x9978('0x13')],{});db[_0x9978('0x1ce')][_0x9978('0x124')](db[_0x9978('0x5a')],{});db[_0x9978('0xdc')]['hasMany'](db[_0x9978('0xd6')],{'foreignKey':_0x9978('0x1cf')});db[_0x9978('0xdc')][_0x9978('0x114')](db[_0x9978('0xd4')],{'foreignKey':'ProjectId'});db[_0x9978('0xdc')][_0x9978('0x114')](db[_0x9978('0xd2')],{'foreignKey':'ProjectId'});db[_0x9978('0x1d0')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x17d'),'through':'user_has_square_projects'});db[_0x9978('0xe6')][_0x9978('0x126')](db['User'],{'as':_0x9978('0x15f'),'through':_0x9978('0x12d')});db[_0x9978('0xe6')][_0x9978('0x126')](db[_0x9978('0x1d')],{'through':_0x9978('0x110'),'as':'VoiceQueues'});db[_0x9978('0xe6')][_0x9978('0x126')](db['MailQueue'],{'through':_0x9978('0x174'),'as':'MailQueues'});db[_0x9978('0xe6')]['belongsToMany'](db['ChatQueue'],{'through':_0x9978('0x19f'),'as':_0x9978('0x137')});db[_0x9978('0xe6')]['belongsToMany'](db[_0x9978('0x51')],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team'][_0x9978('0x126')](db[_0x9978('0x5a')],{'through':_0x9978('0x18e'),'as':_0x9978('0x139')});db[_0x9978('0xe6')][_0x9978('0x126')](db[_0x9978('0x60')],{'through':'team_has_openchannel_queues','as':_0x9978('0x13a')});db['Team'][_0x9978('0x126')](db[_0x9978('0x10e')],{'through':_0x9978('0x1d1'),'as':_0x9978('0x13c')});db['Campaign'][_0x9978('0x114')](db['CmHopper'],{'as':_0x9978('0x153'),'foreignKey':_0x9978('0x1a4')});db['Campaign'][_0x9978('0x114')](db[_0x9978('0x72')],{'as':'HopperFinals','foreignKey':_0x9978('0x1a4')});db[_0x9978('0xe8')][_0x9978('0x114')](db[_0x9978('0x117')],{'as':_0x9978('0x156'),'foreignKey':_0x9978('0x1a4')});db['Campaign'][_0x9978('0x114')](db[_0x9978('0x70')],{'as':_0x9978('0x1d2'),'foreignKey':_0x9978('0x1a4')});db[_0x9978('0xe8')][_0x9978('0x124')](db[_0x9978('0x157')],{'as':_0x9978('0x157'),'foreignKey':_0x9978('0x158')});db[_0x9978('0xe8')][_0x9978('0x124')](db[_0x9978('0x157')],{'as':_0x9978('0x159'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x9978('0x124')](db['Interval'],{'as':_0x9978('0x15b'),'foreignKey':'IntervalId'});db['Campaign'][_0x9978('0x124')](db[_0x9978('0x1d0')],{'as':_0x9978('0x1d0'),'foreignKey':_0x9978('0x1d3')});db[_0x9978('0xe8')][_0x9978('0x126')](db[_0x9978('0xf9')],{'as':_0x9978('0x12b'),'through':'campaigns_has_cm_lists'});db[_0x9978('0xe8')][_0x9978('0x126')](db[_0x9978('0xf9')],{'as':'BlackLists','through':_0x9978('0x1d4')});db[_0x9978('0xec')][_0x9978('0x124')](db[_0x9978('0x66')],{'as':_0x9978('0x66'),'foreignKey':_0x9978('0x19e')});db[_0x9978('0xf0')][_0x9978('0x124')](db[_0x9978('0x41')],{});db[_0x9978('0xf0')]['belongsTo'](db['MailInteraction'],{});db[_0x9978('0xf0')][_0x9978('0x124')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x9978('0x1d5')});db[_0x9978('0xf0')][_0x9978('0x124')](db[_0x9978('0x13')],{'foreignKey':_0x9978('0x1d6'),'as':_0x9978('0x1d7')});db[_0x9978('0xf0')][_0x9978('0x124')](db['User'],{'foreignKey':'ToUserId','as':_0x9978('0x1d8')});db[_0x9978('0xf0')][_0x9978('0x124')](db[_0x9978('0x3b')],{'foreignKey':_0x9978('0x1d9'),'as':_0x9978('0x1da')});db[_0x9978('0xf0')][_0x9978('0x124')](db[_0x9978('0x146')],{'foreignKey':_0x9978('0x1db'),'as':_0x9978('0x1dc')});db['ChatTransferReport'][_0x9978('0x124')](db[_0x9978('0x65')],{});db[_0x9978('0xf2')][_0x9978('0x124')](db[_0x9978('0x11c')],{});db[_0x9978('0xf2')][_0x9978('0x124')](db[_0x9978('0x141')],{'foreignKey':'FromChatWebsiteId','as':_0x9978('0x1d5')});db['ChatTransferReport']['belongsTo'](db[_0x9978('0x13')],{'foreignKey':'FromUserId','as':_0x9978('0x1d7')});db[_0x9978('0xf2')][_0x9978('0x124')](db[_0x9978('0x13')],{'foreignKey':'ToUserId','as':_0x9978('0x1d8')});db[_0x9978('0xf2')]['belongsTo'](db[_0x9978('0x136')],{'foreignKey':_0x9978('0x1dd'),'as':_0x9978('0x1da')});db[_0x9978('0xf2')][_0x9978('0x124')](db[_0x9978('0x141')],{'foreignKey':_0x9978('0x1de'),'as':_0x9978('0x1dc')});db[_0x9978('0xf4')][_0x9978('0x124')](db[_0x9978('0x4f')],{});db[_0x9978('0xf4')][_0x9978('0x124')](db[_0x9978('0x130')],{});db[_0x9978('0xf4')][_0x9978('0x124')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':_0x9978('0x1d5')});db['FaxTransferReport'][_0x9978('0x124')](db['User'],{'foreignKey':_0x9978('0x1d6'),'as':'FromAgent'});db[_0x9978('0xf4')]['belongsTo'](db['User'],{'foreignKey':_0x9978('0x1df'),'as':_0x9978('0x1d8')});db[_0x9978('0xf4')][_0x9978('0x124')](db[_0x9978('0x51')],{'foreignKey':'ToFaxQueueId','as':_0x9978('0x1da')});db[_0x9978('0xf4')][_0x9978('0x124')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x9978('0x1dc')});db['OpenchannelTransferReport'][_0x9978('0x124')](db[_0x9978('0x5e')],{});db[_0x9978('0xf6')][_0x9978('0x124')](db[_0x9978('0x11a')],{});db[_0x9978('0xf6')][_0x9978('0x124')](db['OpenchannelAccount'],{'foreignKey':_0x9978('0x1e0'),'as':_0x9978('0x1d5')});db['OpenchannelTransferReport'][_0x9978('0x124')](db[_0x9978('0x13')],{'foreignKey':_0x9978('0x1d6'),'as':'FromAgent'});db[_0x9978('0xf6')][_0x9978('0x124')](db[_0x9978('0x13')],{'foreignKey':_0x9978('0x1df'),'as':'ToAgent'});db[_0x9978('0xf6')][_0x9978('0x124')](db[_0x9978('0x60')],{'foreignKey':'ToOpenchannelQueueId','as':_0x9978('0x1da')});db[_0x9978('0xf6')][_0x9978('0x124')](db[_0x9978('0x5c')],{'foreignKey':_0x9978('0x1e1'),'as':_0x9978('0x1dc')});db[_0x9978('0xf7')]['belongsTo'](db[_0x9978('0x58')],{});db[_0x9978('0xf7')][_0x9978('0x124')](db[_0x9978('0x11e')],{});db[_0x9978('0xf7')][_0x9978('0x124')](db['SmsAccount'],{'foreignKey':_0x9978('0x1e2'),'as':'FromAccount'});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x9978('0xf7')][_0x9978('0x124')](db['User'],{'foreignKey':_0x9978('0x1df'),'as':_0x9978('0x1d8')});db['SmsTransferReport'][_0x9978('0x124')](db[_0x9978('0x5a')],{'foreignKey':_0x9978('0x1e3'),'as':_0x9978('0x1da')});db[_0x9978('0xf7')][_0x9978('0x124')](db['SmsAccount'],{'foreignKey':_0x9978('0x1e4'),'as':'ToAccount'});db[_0x9978('0xf9')]['hasMany'](db[_0x9978('0x7a')],{'as':_0x9978('0x16c'),'foreignKey':_0x9978('0x171'),'onDelete':'cascade'});db[_0x9978('0xf9')]['hasMany'](db['CmCustomField'],{'as':_0x9978('0x1e5'),'foreignKey':'ListId'});db[_0x9978('0xf9')]['hasMany'](db[_0x9978('0x6d')],{'as':_0x9978('0x129'),'onDelete':'cascade','foreignKey':_0x9978('0x171')});db[_0x9978('0xf9')][_0x9978('0x114')](db[_0x9978('0x72')],{'as':_0x9978('0x155'),'foreignKey':_0x9978('0x171')});db[_0x9978('0xf9')][_0x9978('0x114')](db['CmHopperHistory'],{'as':_0x9978('0x118'),'foreignKey':_0x9978('0x171')});db[_0x9978('0xf9')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x9978('0xf9')][_0x9978('0x126')](db[_0x9978('0x1d')],{'as':'Queues','through':_0x9978('0x1e6')});db[_0x9978('0xf9')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x15f'),'through':_0x9978('0x12c')});db[_0x9978('0x13e')][_0x9978('0x114')](db['VoiceExtension'],{'as':_0x9978('0x1aa'),'onDelete':_0x9978('0x112')});db[_0x9978('0x13e')][_0x9978('0x126')](db['User'],{'as':_0x9978('0x15f'),'through':_0x9978('0x140')});db[_0x9978('0xfc')]['hasMany'](db[_0x9978('0x13')],{'as':_0x9978('0x17d'),'foreignKey':_0x9978('0x125')});db[_0x9978('0xfc')]['hasMany'](db[_0x9978('0x1e7')],{'as':_0x9978('0x1e8'),'foreignKey':_0x9978('0x125'),'onDelete':_0x9978('0x112')});db[_0x9978('0x1e7')]['hasMany'](db[_0x9978('0xff')],{'as':'Resources','foreignKey':_0x9978('0x1e9'),'onDelete':_0x9978('0x112')});db[_0x9978('0x103')][_0x9978('0x114')](db[_0x9978('0x7a')],{'as':'Dispositions','foreignKey':_0x9978('0x1ea'),'onDelete':_0x9978('0x112')});db[_0x9978('0x103')]['hasMany'](db[_0x9978('0x79')],{'as':'Answers','foreignKey':_0x9978('0x1ea')});db[_0x9978('0x103')][_0x9978('0x114')](db[_0x9978('0x1eb')],{'as':_0x9978('0x161'),'foreignKey':_0x9978('0x1ea')});db['WhatsappAccount'][_0x9978('0x114')](db['WhatsappInteraction'],{'as':_0x9978('0x16e')});db[_0x9978('0x103')][_0x9978('0x114')](db[_0x9978('0x105')],{'as':_0x9978('0x16f')});db['WhatsappAccount'][_0x9978('0x124')](db['CmList'],{'as':_0x9978('0x170'),'foreignKey':_0x9978('0x171')});db[_0x9978('0x103')]['belongsTo'](db[_0x9978('0x173')],{'as':_0x9978('0x15d'),'foreignKey':_0x9978('0x15e')});db[_0x9978('0x103')][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x15f'),'through':_0x9978('0x14e')});db[_0x9978('0x105')][_0x9978('0x124')](db[_0x9978('0x13')],{'onDelete':_0x9978('0x180')});db[_0x9978('0x105')][_0x9978('0x124')](db[_0x9978('0x10e')],{'onDelete':_0x9978('0x180')});db[_0x9978('0x105')][_0x9978('0x124')](db[_0x9978('0x103')],{'onDelete':_0x9978('0x180')});db[_0x9978('0x105')]['belongsTo'](db[_0x9978('0x15b')],{'onDelete':_0x9978('0x180'),'foreignKey':_0x9978('0x15c')});db[_0x9978('0x105')][_0x9978('0x124')](db['Tag'],{'onDelete':_0x9978('0x180'),'foreignKey':_0x9978('0x181')});db[_0x9978('0x107')]['hasMany'](db[_0x9978('0x1eb')],{'as':_0x9978('0x161'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction']['belongsTo'](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x9978('0x1ea')});db[_0x9978('0x107')][_0x9978('0x124')](db[_0x9978('0x6d')],{'as':_0x9978('0x177'),'foreignKey':'ContactId'});db[_0x9978('0x107')][_0x9978('0x124')](db['User'],{'as':_0x9978('0x178'),'foreignKey':_0x9978('0x113')});db[_0x9978('0x107')]['belongsToMany'](db[_0x9978('0x179')],{'through':_0x9978('0x1b0'),'as':_0x9978('0x17a')});db[_0x9978('0x107')][_0x9978('0x126')](db[_0x9978('0x179')],{'through':_0x9978('0x1b0'),'as':'ThroughTags'});db[_0x9978('0x107')]['belongsToMany'](db[_0x9978('0x13')],{'as':_0x9978('0x17d'),'through':_0x9978('0x133'),'foreignKey':_0x9978('0x1ec')});db[_0x9978('0x1eb')]['belongsTo'](db[_0x9978('0x13')],{'as':_0x9978('0x13')});db[_0x9978('0x1eb')][_0x9978('0x124')](db[_0x9978('0x6d')],{'onDelete':_0x9978('0x112'),'as':_0x9978('0x177')});db[_0x9978('0x1eb')][_0x9978('0x124')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x9978('0x186'),'foreignKey':_0x9978('0x1ec')});db[_0x9978('0x1eb')][_0x9978('0x124')](db[_0x9978('0x103')],{'as':_0x9978('0x176'),'foreignKey':_0x9978('0x1ea')});db[_0x9978('0x10a')][_0x9978('0x124')](db[_0x9978('0x103')],{});db[_0x9978('0x10a')][_0x9978('0x124')](db['CmList'],{'as':_0x9978('0x170'),'foreignKey':_0x9978('0x171')});db['WhatsappQueueReport']['belongsTo'](db[_0x9978('0x6d')],{'as':_0x9978('0x177'),'foreignKey':_0x9978('0x167')});db[_0x9978('0x10a')][_0x9978('0x124')](db[_0x9978('0x107')],{});db['WhatsappQueueReport'][_0x9978('0x124')](db[_0x9978('0x10e')],{});db[_0x9978('0x10a')]['belongsTo'](db[_0x9978('0x1eb')],{});db[_0x9978('0x10a')][_0x9978('0x124')](db[_0x9978('0x13')],{});db[_0x9978('0x10c')][_0x9978('0x124')](db['WhatsappMessage'],{});db[_0x9978('0x10c')][_0x9978('0x124')](db[_0x9978('0x107')],{});db[_0x9978('0x10c')]['belongsTo'](db[_0x9978('0x103')],{'foreignKey':_0x9978('0x1ed'),'as':_0x9978('0x1d5')});db[_0x9978('0x10c')][_0x9978('0x124')](db[_0x9978('0x103')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x9978('0x10c')][_0x9978('0x124')](db[_0x9978('0x10e')],{'foreignKey':_0x9978('0x1ee'),'as':_0x9978('0x1da')});db[_0x9978('0x10c')][_0x9978('0x124')](db[_0x9978('0x13')],{'foreignKey':_0x9978('0x1d6'),'as':_0x9978('0x1d7')});db[_0x9978('0x10c')][_0x9978('0x124')](db[_0x9978('0x13')],{'foreignKey':_0x9978('0x1df'),'as':'ToAgent'});db['WhatsappQueue'][_0x9978('0x126')](db[_0x9978('0x13')],{'as':_0x9978('0x15f'),'through':_0x9978('0x13d'),'foreignKey':_0x9978('0x1ef')});db[_0x9978('0x10e')][_0x9978('0x126')](db['Team'],{'through':_0x9978('0x1d1'),'as':_0x9978('0x160')});module[_0x9978('0x1f0')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index c3eb158..551c323 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9cb=['./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/squareReport','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','/www','/demo','root','/snippet','snippet','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','username','password','firstName','lastName','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','tenantId','channelSecret','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','clientEmail','privateKey','accesskeyid','key','pass','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','includes','path','express','express-winston','util','./errors','./config/environment','./config/logger','default','use','logger','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','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)','other','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','/api/voice/mails','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','/api/chat/messages','./api/chatMessage','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./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/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/internal/messages'];(function(_0x2531f5,_0x2d7279){var _0x457411=function(_0x6324b5){while(--_0x6324b5){_0x2531f5['push'](_0x2531f5['shift']());}};_0x457411(++_0x2d7279);}(_0xa9cb,0x1bf));var _0xba9c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9cb[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var path=require(_0xba9c('0x0'));var express=require(_0xba9c('0x1'));var ewinston=require(_0xba9c('0x2'));var util=require(_0xba9c('0x3'));var errors=require(_0xba9c('0x4'));var config=require(_0xba9c('0x5'));var logger=require(_0xba9c('0x6'))('api');var authLogger=require(_0xba9c('0x6'))('auth');exports[_0xba9c('0x7')]=function(_0x3ac786){_0x3ac786[_0xba9c('0x8')](ewinston[_0xba9c('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2e048b,_0x1249dc){var _0x4bac4b='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xba9c('0xa')](_0x2e048b['body'])){_0x4bac4b+=_0xba9c('0xb');var _0x164b48=_0x2e048b[_0xba9c('0xc')];maskSensitiveData(_0x164b48);}return util[_0xba9c('0xd')](_0x4bac4b,_0x2e048b[_0xba9c('0xe')],_0x2e048b[_0xba9c('0xf')]['x-forwarded-for']?_0x2e048b[_0xba9c('0xf')][_0xba9c('0x10')]:_0x2e048b[_0xba9c('0x11')][_0xba9c('0x12')]||_0x2e048b['ip'],_0x2e048b[_0xba9c('0x13')],_0x1249dc[_0xba9c('0x14')],_0x1249dc[_0xba9c('0x15')],_0x2e048b['user']?_0x2e048b[_0xba9c('0x16')]['id']:null,_0x2e048b[_0xba9c('0x16')]?_0x2e048b[_0xba9c('0x16')][_0xba9c('0x17')]:null,_0x2e048b[_0xba9c('0x16')]?_0x2e048b['user'][_0xba9c('0x18')]:null,_0x164b48?util[_0xba9c('0x19')](_0x164b48,![],null):'');}}));_0x3ac786[_0xba9c('0x8')](ewinston[_0xba9c('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x538489,_0x436dd3){var _0x2ccc77=_0xba9c('0x1a');if(_0x538489[_0xba9c('0xc')]&&_0x538489[_0xba9c('0xc')][_0xba9c('0x1b')]&&_0x538489[_0xba9c('0xc')][_0xba9c('0x1c')]){_0x2ccc77=_0xba9c('0x1d');}return util[_0xba9c('0xd')](_0x2ccc77,_0x538489[_0xba9c('0xe')],_0x538489[_0xba9c('0xf')][_0xba9c('0x10')]?_0x538489[_0xba9c('0xf')][_0xba9c('0x10')]:_0x538489[_0xba9c('0x11')][_0xba9c('0x12')]||_0x538489['ip'],_0x538489[_0xba9c('0x13')],_0x436dd3['statusCode'],_0x436dd3[_0xba9c('0x15')],_0x538489['user']?_0x538489[_0xba9c('0x16')]['id']:null,_0x538489['user']?_0x538489['user'][_0xba9c('0x17')]:null,_0x538489[_0xba9c('0x16')]?_0x538489[_0xba9c('0x16')][_0xba9c('0x18')]:null,_0x538489[_0xba9c('0xc')]&&_0x538489['body'][_0xba9c('0x1b')]?_0x538489[_0xba9c('0xc')]['device']:_0xba9c('0x1e'),_0x538489[_0xba9c('0xc')]&&_0x538489[_0xba9c('0xc')][_0xba9c('0x1c')]?_0x538489['body'][_0xba9c('0x1c')]:'',_0x538489[_0xba9c('0xc')]&&_0x538489['body'][_0xba9c('0x1f')]?_0x538489[_0xba9c('0xc')][_0xba9c('0x1f')]:'');},'ignoreRoute':function(_0xc5f73b){var _0xe5b08e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xe5b08e['test'](_0xc5f73b[_0xba9c('0x13')]);}}));_0x3ac786['use'](_0xba9c('0x20'),require(_0xba9c('0x21')));_0x3ac786['use'](_0xba9c('0x22'),require(_0xba9c('0x23')));_0x3ac786['use'](_0xba9c('0x24'),require(_0xba9c('0x25')));_0x3ac786['use'](_0xba9c('0x26'),require(_0xba9c('0x27')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x28'),require(_0xba9c('0x29')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x2a'),require(_0xba9c('0x2b')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x2c'),require('./api/voiceRecording'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x2d'),require('./api/screenRecording'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x2e'),require('./api/voiceMail'));_0x3ac786[_0xba9c('0x8')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x3ac786[_0xba9c('0x8')]('/api/voice/calls/reports',require(_0xba9c('0x2f')));_0x3ac786['use'](_0xba9c('0x30'),require(_0xba9c('0x31')));_0x3ac786[_0xba9c('0x8')]('/api/voice/agents/reports',require(_0xba9c('0x32')));_0x3ac786['use'](_0xba9c('0x33'),require(_0xba9c('0x34')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x35'),require(_0xba9c('0x36')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x37'),require('./api/trunk'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x38'),require(_0xba9c('0x39')));_0x3ac786[_0xba9c('0x8')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x3a'),require(_0xba9c('0x3b')));_0x3ac786['use'](_0xba9c('0x3c'),require(_0xba9c('0x3d')));_0x3ac786[_0xba9c('0x8')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x3ac786[_0xba9c('0x8')]('/api/mail/interactions',require(_0xba9c('0x3e')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x3f'),require(_0xba9c('0x40')));_0x3ac786['use'](_0xba9c('0x41'),require(_0xba9c('0x42')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x43'),require(_0xba9c('0x44')));_0x3ac786[_0xba9c('0x8')]('/api/dashboards',require(_0xba9c('0x45')));_0x3ac786['use'](_0xba9c('0x46'),require(_0xba9c('0x47')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x48'),require(_0xba9c('0x49')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x4a'),require(_0xba9c('0x4b')));_0x3ac786['use'](_0xba9c('0x4c'),require('./api/faxInteraction'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x4d'),require('./api/faxMessage'));_0x3ac786['use'](_0xba9c('0x4e'),require(_0xba9c('0x4f')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x50'),require('./api/faxQueueReport'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x51'),require(_0xba9c('0x52')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x53'),require(_0xba9c('0x54')));_0x3ac786['use']('/api/sms/interactions',require('./api/smsInteraction'));_0x3ac786[_0xba9c('0x8')]('/api/sms/messages',require(_0xba9c('0x55')));_0x3ac786[_0xba9c('0x8')]('/api/sms/queues',require(_0xba9c('0x56')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x57'),require(_0xba9c('0x58')));_0x3ac786[_0xba9c('0x8')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x3ac786['use'](_0xba9c('0x59'),require(_0xba9c('0x5a')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x5b'),require(_0xba9c('0x5c')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x5d'),require(_0xba9c('0x5e')));_0x3ac786['use']('/api/chat/websites',require(_0xba9c('0x5f')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x60'),require(_0xba9c('0x61')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x62'),require('./api/chatApplication'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x63'),require('./api/chatInteraction'));_0x3ac786['use'](_0xba9c('0x64'),require(_0xba9c('0x65')));_0x3ac786['use']('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x3ac786[_0xba9c('0x8')]('/api/chat/queues',require(_0xba9c('0x66')));_0x3ac786['use'](_0xba9c('0x67'),require('./api/chatGroup'));_0x3ac786['use'](_0xba9c('0x68'),require(_0xba9c('0x69')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x6a'),require(_0xba9c('0x6b')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x6c'),require(_0xba9c('0x6d')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x6e'),require(_0xba9c('0x6f')));_0x3ac786['use'](_0xba9c('0x70'),require(_0xba9c('0x71')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x72'),require('./api/cmHopperFinal'));_0x3ac786['use'](_0xba9c('0x73'),require('./api/cmHopperHistory'));_0x3ac786['use'](_0xba9c('0x74'),require(_0xba9c('0x75')));_0x3ac786[_0xba9c('0x8')]('/api/actions',require('./api/action'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x76'),require('./api/automation'));_0x3ac786[_0xba9c('0x8')]('/api/canned_answers',require(_0xba9c('0x77')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x78'),require(_0xba9c('0x79')));_0x3ac786['use'](_0xba9c('0x7a'),require(_0xba9c('0x7b')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x7c'),require(_0xba9c('0x7d')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x7e'),require(_0xba9c('0x7f')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x80'),require(_0xba9c('0x81')));_0x3ac786[_0xba9c('0x8')]('/api/voiceQueuesLog',require(_0xba9c('0x82')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x83'),require(_0xba9c('0x84')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x85'),require(_0xba9c('0x86')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x87'),require('./api/tag'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x88'),require(_0xba9c('0x89')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x8a'),require(_0xba9c('0x8b')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x8c'),require(_0xba9c('0x8d')));_0x3ac786['use']('/api/integrations',require(_0xba9c('0x8e')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x8f'),require(_0xba9c('0x90')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x91'),require(_0xba9c('0x92')));_0x3ac786[_0xba9c('0x8')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x3ac786['use']('/api/analytics/extracted_reports',require(_0xba9c('0x93')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x94'),require(_0xba9c('0x95')));_0x3ac786[_0xba9c('0x8')]('/api/analytics/field_reports',require(_0xba9c('0x96')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x97'),require(_0xba9c('0x98')));_0x3ac786[_0xba9c('0x8')]('/api/integrations/salesforce/accounts',require(_0xba9c('0x99')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x9a'),require('./api/intSalesforceConfiguration'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x9b'),require(_0xba9c('0x9c')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x9d'),require(_0xba9c('0x9e')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x9f'),require(_0xba9c('0xa0')));_0x3ac786['use']('/api/integrations/sugarcrm/fields',require(_0xba9c('0xa1')));_0x3ac786[_0xba9c('0x8')]('/api/integrations/desk/accounts',require(_0xba9c('0xa2')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xa3'),require(_0xba9c('0xa4')));_0x3ac786['use'](_0xba9c('0xa5'),require(_0xba9c('0xa6')));_0x3ac786['use'](_0xba9c('0xa7'),require(_0xba9c('0xa8')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xa9'),require('./api/intZohoConfiguration'));_0x3ac786['use']('/api/integrations/zoho/fields',require(_0xba9c('0xaa')));_0x3ac786['use'](_0xba9c('0xab'),require(_0xba9c('0xac')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xad'),require(_0xba9c('0xae')));_0x3ac786[_0xba9c('0x8')]('/api/integrations/zendesk/fields',require(_0xba9c('0xaf')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xb0'),require('./api/intFreshdeskAccount'));_0x3ac786['use'](_0xba9c('0xb1'),require(_0xba9c('0xb2')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xb3'),require(_0xba9c('0xb4')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xb5'),require('./api/intVtigerAccount'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xb6'),require('./api/intVtigerConfiguration'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xb7'),require(_0xba9c('0xb8')));_0x3ac786['use']('/api/integrations/servicenow/accounts',require(_0xba9c('0xb9')));_0x3ac786[_0xba9c('0x8')]('/api/integrations/servicenow/configurations',require(_0xba9c('0xba')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xbb'),require(_0xba9c('0xbc')));_0x3ac786[_0xba9c('0x8')]('/api/integrations/dynamics365/accounts',require(_0xba9c('0xbd')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xbe'),require('./api/intDynamics365Configuration'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xbf'),require(_0xba9c('0xc0')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xc1'),require(_0xba9c('0xc2')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xc3'),require(_0xba9c('0xc4')));_0x3ac786['use'](_0xba9c('0xc5'),require(_0xba9c('0xc6')));_0x3ac786[_0xba9c('0x8')]('/api/networks',require(_0xba9c('0xc7')));_0x3ac786['use']('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x3ac786['use'](_0xba9c('0xc8'),require(_0xba9c('0xc9')));_0x3ac786['use'](_0xba9c('0xca'),require(_0xba9c('0xcb')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xcc'),require(_0xba9c('0xcd')));_0x3ac786['use'](_0xba9c('0xce'),require(_0xba9c('0xcf')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xd0'),require('./api/smsQueueReport'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xd1'),require(_0xba9c('0xd2')));_0x3ac786[_0xba9c('0x8')]('/api/square/details/reports',require(_0xba9c('0xd3')));_0x3ac786['use'](_0xba9c('0xd4'),require('./api/jscriptyProject'));_0x3ac786['use'](_0xba9c('0xd5'),require(_0xba9c('0xd6')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xd7'),require('./api/squareOdbc'));_0x3ac786[_0xba9c('0x8')]('/api/square/projects',require(_0xba9c('0xd8')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xd9'),require(_0xba9c('0xda')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xdb'),require('./api/squareMessage'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xdc'),require(_0xba9c('0xdd')));_0x3ac786['use'](_0xba9c('0xde'),require(_0xba9c('0xdf')));_0x3ac786[_0xba9c('0x8')]('/api/campaigns',require(_0xba9c('0xe0')));_0x3ac786['use'](_0xba9c('0xe1'),require(_0xba9c('0xe2')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xe3'),require(_0xba9c('0xe4')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xe5'),require(_0xba9c('0xe6')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xe7'),require(_0xba9c('0xe8')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xe9'),require(_0xba9c('0xea')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xeb'),require(_0xba9c('0xec')));_0x3ac786['use']('/api/openchannel/reports/transfer',require(_0xba9c('0xed')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xee'),require(_0xba9c('0xef')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xf0'),require(_0xba9c('0xf1')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xf2'),require('./api/voicePrefix'));_0x3ac786['use'](_0xba9c('0xf3'),require(_0xba9c('0xf4')));_0x3ac786['use'](_0xba9c('0xf5'),require(_0xba9c('0xf6')));_0x3ac786[_0xba9c('0x8')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xf7'),require(_0xba9c('0xf8')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xf9'),require('./api/whatsappAccount'));_0x3ac786[_0xba9c('0x8')]('/api/whatsapp/applications',require(_0xba9c('0xfa')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xfb'),require('./api/whatsappInteraction'));_0x3ac786[_0xba9c('0x8')]('/api/whatsapp/messages',require(_0xba9c('0xfc')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xfd'),require('./api/whatsappQueueReport'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0xfe'),require('./api/whatsappTransferReport'));_0x3ac786[_0xba9c('0x8')]('/api/whatsapp/queues',require(_0xba9c('0xff')));_0x3ac786['use'](_0xba9c('0x100'),require('./api/cloudProvider'));_0x3ac786['use'](_0xba9c('0x101'),require(_0xba9c('0x102')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x103'),require(_0xba9c('0x104')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x105'),require(_0xba9c('0x106')));_0x3ac786[_0xba9c('0x8')]('/api/jira',require('./api/jira'));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x107'),require(_0xba9c('0x108')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x109'),require(_0xba9c('0x10a')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x10b'),require(_0xba9c('0x10c')));_0x3ac786[_0xba9c('0x8')]('/api/pm2',require(_0xba9c('0x10d')));_0x3ac786['use'](_0xba9c('0x10e'),require(_0xba9c('0x10f')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x110'),express[_0xba9c('0x111')](path[_0xba9c('0x112')](config['root'],_0xba9c('0x110'))));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x113'),express[_0xba9c('0x111')](path['join'](config['root'],_0xba9c('0x113'))));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x114'),express[_0xba9c('0x111')](path[_0xba9c('0x112')](config[_0xba9c('0x115')],_0xba9c('0x114'))));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x116'),express[_0xba9c('0x111')](path[_0xba9c('0x112')](config[_0xba9c('0x115')],_0xba9c('0x117'),'3.0.0')));_0x3ac786[_0xba9c('0x8')](_0xba9c('0x118'),express[_0xba9c('0x111')](path['join'](config[_0xba9c('0x115')],'/server/files/plugins')));_0x3ac786[_0xba9c('0x119')](_0xba9c('0x11a'))['get'](errors[0x194]);_0x3ac786['route']('/*')[_0xba9c('0x11b')](function(_0x3e8459,_0x37af83){_0x37af83[_0xba9c('0x11c')](path[_0xba9c('0x11d')](_0x3ac786[_0xba9c('0x11b')]('appPath')+_0xba9c('0x11e')));});};var sensitiveFields=[_0xba9c('0x11f'),_0xba9c('0x120'),'newPassword','apiKey',_0xba9c('0x121'),_0xba9c('0x122'),'street',_0xba9c('0x123'),_0xba9c('0x124'),_0xba9c('0x125'),_0xba9c('0x126'),_0xba9c('0x127'),_0xba9c('0x128'),_0xba9c('0x129'),_0xba9c('0x12a'),'accessKey',_0xba9c('0x12b'),'token',_0xba9c('0x12c'),'accessToken',_0xba9c('0x12d'),'authToken',_0xba9c('0x12e'),_0xba9c('0x12f'),_0xba9c('0x130'),_0xba9c('0x131'),_0xba9c('0x132'),_0xba9c('0x133'),'vidaooApiKey',_0xba9c('0x134'),_0xba9c('0x135'),_0xba9c('0x136'),'secretaccesskey',_0xba9c('0x137'),_0xba9c('0x16'),_0xba9c('0x138'),'accountSid',_0xba9c('0x139'),_0xba9c('0x13a'),_0xba9c('0x13b'),'registry',_0xba9c('0x13c')];function maskSensitiveData(_0xa44ddf){var _0x507947=/(?!^)[\s\S](?!$)/g;if(!_[_0xba9c('0x13d')](_0xa44ddf))return;for(var _0x1156e3 in _0xa44ddf){if(_[_0xba9c('0x13e')](_0xa44ddf[_0x1156e3])){for(var _0x20a51a=0x0;_0x20a51a<_0xa44ddf[_0x1156e3][_0xba9c('0x13f')];_0x20a51a++){maskSensitiveData(_0xa44ddf[_0x1156e3][_0x20a51a]);}}else if(_[_0xba9c('0x13d')](_0xa44ddf[_0x1156e3])){maskSensitiveData(_0xa44ddf[_0x1156e3]);}else if(_[_0xba9c('0x140')](_0xa44ddf[_0x1156e3])){_0xa44ddf[_0x1156e3]=_0xa44ddf[_0x1156e3]['replace'](/{{{/g,_0xba9c('0x141'))['replace'](/}}}/g,'}@@')[_0xba9c('0x142')](/{{/g,'@{')[_0xba9c('0x142')](/}}/g,'}@');if(_[_0xba9c('0x143')](sensitiveFields,_0x1156e3)){_0xa44ddf[_0x1156e3]=_0xa44ddf[_0x1156e3][_0xba9c('0x142')](_0x507947,'*');}}}} \ No newline at end of file +var _0x54a1=['/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./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/cloudProvider','/api/realtime','/api/auth/local','/api/auth/google','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/webbar','./api/webbar','root','static','join','/www','/demo','/snippet','snippet','3.0.0','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','street','mobile','fax','email','clientSecret','code','accessKey','tenantId','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','privateKey','accesskeyid','secretaccesskey','key','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','lodash','express','express-winston','util','./config/environment','./config/logger','api','auth','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','user','name','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','method','device','other','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/dashboards','./api/dashboard','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','/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/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','/api/triggers','./api/trigger','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration'];(function(_0x2b1551,_0x1776fe){var _0x2fc2a1=function(_0x5d43c8){while(--_0x5d43c8){_0x2b1551['push'](_0x2b1551['shift']());}};_0x2fc2a1(++_0x1776fe);}(_0x54a1,0x1c9));var _0x154a=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x54a1[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x154a('0x0'));var path=require('path');var express=require(_0x154a('0x1'));var ewinston=require(_0x154a('0x2'));var util=require(_0x154a('0x3'));var errors=require('./errors');var config=require(_0x154a('0x4'));var logger=require(_0x154a('0x5'))(_0x154a('0x6'));var authLogger=require(_0x154a('0x5'))(_0x154a('0x7'));exports[_0x154a('0x8')]=function(_0x56ea78){_0x56ea78['use'](ewinston[_0x154a('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1910bc,_0xde67f8){var _0x97808b=_0x154a('0xa');if(!_[_0x154a('0xb')](_0x1910bc[_0x154a('0xc')])){_0x97808b+=_0x154a('0xd');var _0xc09a1e=_0x1910bc[_0x154a('0xc')];maskSensitiveData(_0xc09a1e);}return util['format'](_0x97808b,_0x1910bc['method'],_0x1910bc[_0x154a('0xe')]['x-forwarded-for']?_0x1910bc['headers'][_0x154a('0xf')]:_0x1910bc[_0x154a('0x10')][_0x154a('0x11')]||_0x1910bc['ip'],_0x1910bc[_0x154a('0x12')],_0xde67f8[_0x154a('0x13')],_0xde67f8['responseTime'],_0x1910bc[_0x154a('0x14')]?_0x1910bc[_0x154a('0x14')]['id']:null,_0x1910bc[_0x154a('0x14')]?_0x1910bc[_0x154a('0x14')][_0x154a('0x15')]:null,_0x1910bc[_0x154a('0x14')]?_0x1910bc[_0x154a('0x14')][_0x154a('0x16')]:null,_0xc09a1e?util[_0x154a('0x17')](_0xc09a1e,![],null):'');}}));_0x56ea78[_0x154a('0x18')](ewinston[_0x154a('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1c667b,_0x2bcc54){var _0xfa1f22=_0x154a('0x19');if(_0x1c667b[_0x154a('0xc')]&&_0x1c667b[_0x154a('0xc')]['device']&&_0x1c667b['body'][_0x154a('0x1a')]){_0xfa1f22=_0x154a('0x1b');}return util[_0x154a('0x1c')](_0xfa1f22,_0x1c667b[_0x154a('0x1d')],_0x1c667b[_0x154a('0xe')][_0x154a('0xf')]?_0x1c667b['headers']['x-forwarded-for']:_0x1c667b[_0x154a('0x10')][_0x154a('0x11')]||_0x1c667b['ip'],_0x1c667b[_0x154a('0x12')],_0x2bcc54[_0x154a('0x13')],_0x2bcc54['responseTime'],_0x1c667b[_0x154a('0x14')]?_0x1c667b[_0x154a('0x14')]['id']:null,_0x1c667b[_0x154a('0x14')]?_0x1c667b['user'][_0x154a('0x15')]:null,_0x1c667b[_0x154a('0x14')]?_0x1c667b['user'][_0x154a('0x16')]:null,_0x1c667b[_0x154a('0xc')]&&_0x1c667b[_0x154a('0xc')]['device']?_0x1c667b[_0x154a('0xc')][_0x154a('0x1e')]:_0x154a('0x1f'),_0x1c667b[_0x154a('0xc')]&&_0x1c667b[_0x154a('0xc')][_0x154a('0x1a')]?_0x1c667b['body'][_0x154a('0x1a')]:'',_0x1c667b['body']&&_0x1c667b[_0x154a('0xc')][_0x154a('0x20')]?_0x1c667b[_0x154a('0xc')][_0x154a('0x20')]:'');},'ignoreRoute':function(_0x8fc779){var _0x56ede0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x56ede0[_0x154a('0x21')](_0x8fc779[_0x154a('0x12')]);}}));_0x56ea78[_0x154a('0x18')]('/api/users',require(_0x154a('0x22')));_0x56ea78[_0x154a('0x18')](_0x154a('0x23'),require(_0x154a('0x24')));_0x56ea78['use'](_0x154a('0x25'),require(_0x154a('0x26')));_0x56ea78[_0x154a('0x18')](_0x154a('0x27'),require('./api/voiceExtension'));_0x56ea78[_0x154a('0x18')](_0x154a('0x28'),require(_0x154a('0x29')));_0x56ea78[_0x154a('0x18')](_0x154a('0x2a'),require(_0x154a('0x2b')));_0x56ea78[_0x154a('0x18')]('/api/voice/recordings',require('./api/voiceRecording'));_0x56ea78[_0x154a('0x18')]('/api/screen/recordings',require('./api/screenRecording'));_0x56ea78['use']('/api/voice/mails',require(_0x154a('0x2c')));_0x56ea78[_0x154a('0x18')](_0x154a('0x2d'),require('./api/voiceMailMessage'));_0x56ea78[_0x154a('0x18')](_0x154a('0x2e'),require('./api/voiceCallReport'));_0x56ea78[_0x154a('0x18')](_0x154a('0x2f'),require(_0x154a('0x30')));_0x56ea78[_0x154a('0x18')](_0x154a('0x31'),require('./api/voiceAgentReport'));_0x56ea78['use'](_0x154a('0x32'),require(_0x154a('0x33')));_0x56ea78[_0x154a('0x18')]('/api/members/reports',require('./api/memberReport'));_0x56ea78['use'](_0x154a('0x34'),require(_0x154a('0x35')));_0x56ea78[_0x154a('0x18')](_0x154a('0x36'),require(_0x154a('0x37')));_0x56ea78[_0x154a('0x18')](_0x154a('0x38'),require('./api/mailServerOut'));_0x56ea78[_0x154a('0x18')](_0x154a('0x39'),require(_0x154a('0x3a')));_0x56ea78['use'](_0x154a('0x3b'),require(_0x154a('0x3c')));_0x56ea78['use'](_0x154a('0x3d'),require(_0x154a('0x3e')));_0x56ea78[_0x154a('0x18')](_0x154a('0x3f'),require(_0x154a('0x40')));_0x56ea78[_0x154a('0x18')](_0x154a('0x41'),require(_0x154a('0x42')));_0x56ea78[_0x154a('0x18')](_0x154a('0x43'),require(_0x154a('0x44')));_0x56ea78[_0x154a('0x18')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x56ea78[_0x154a('0x18')](_0x154a('0x45'),require(_0x154a('0x46')));_0x56ea78[_0x154a('0x18')]('/api/dashboards/items',require('./api/dashboardItem'));_0x56ea78[_0x154a('0x18')](_0x154a('0x47'),require(_0x154a('0x48')));_0x56ea78[_0x154a('0x18')](_0x154a('0x49'),require('./api/faxApplication'));_0x56ea78[_0x154a('0x18')](_0x154a('0x4a'),require(_0x154a('0x4b')));_0x56ea78[_0x154a('0x18')](_0x154a('0x4c'),require(_0x154a('0x4d')));_0x56ea78['use'](_0x154a('0x4e'),require(_0x154a('0x4f')));_0x56ea78[_0x154a('0x18')](_0x154a('0x50'),require(_0x154a('0x51')));_0x56ea78[_0x154a('0x18')](_0x154a('0x52'),require(_0x154a('0x53')));_0x56ea78[_0x154a('0x18')](_0x154a('0x54'),require(_0x154a('0x55')));_0x56ea78['use'](_0x154a('0x56'),require(_0x154a('0x57')));_0x56ea78[_0x154a('0x18')](_0x154a('0x58'),require(_0x154a('0x59')));_0x56ea78['use'](_0x154a('0x5a'),require(_0x154a('0x5b')));_0x56ea78[_0x154a('0x18')](_0x154a('0x5c'),require(_0x154a('0x5d')));_0x56ea78[_0x154a('0x18')](_0x154a('0x5e'),require(_0x154a('0x5f')));_0x56ea78['use'](_0x154a('0x60'),require(_0x154a('0x61')));_0x56ea78[_0x154a('0x18')](_0x154a('0x62'),require(_0x154a('0x63')));_0x56ea78[_0x154a('0x18')](_0x154a('0x64'),require(_0x154a('0x65')));_0x56ea78[_0x154a('0x18')](_0x154a('0x66'),require('./api/chatWebsite'));_0x56ea78[_0x154a('0x18')](_0x154a('0x67'),require('./api/openchannelQueueReport'));_0x56ea78['use']('/api/chat/applications',require(_0x154a('0x68')));_0x56ea78['use'](_0x154a('0x69'),require(_0x154a('0x6a')));_0x56ea78[_0x154a('0x18')]('/api/chat/messages',require(_0x154a('0x6b')));_0x56ea78[_0x154a('0x18')](_0x154a('0x6c'),require(_0x154a('0x6d')));_0x56ea78[_0x154a('0x18')](_0x154a('0x6e'),require(_0x154a('0x6f')));_0x56ea78['use'](_0x154a('0x70'),require('./api/chatGroup'));_0x56ea78[_0x154a('0x18')](_0x154a('0x71'),require('./api/chatProactiveAction'));_0x56ea78[_0x154a('0x18')](_0x154a('0x72'),require(_0x154a('0x73')));_0x56ea78[_0x154a('0x18')](_0x154a('0x74'),require(_0x154a('0x75')));_0x56ea78['use'](_0x154a('0x76'),require(_0x154a('0x77')));_0x56ea78[_0x154a('0x18')](_0x154a('0x78'),require('./api/cmHopperBlack'));_0x56ea78['use']('/api/cm/hopper_final',require(_0x154a('0x79')));_0x56ea78[_0x154a('0x18')](_0x154a('0x7a'),require('./api/cmHopperHistory'));_0x56ea78[_0x154a('0x18')]('/api/cm/custom_fields',require(_0x154a('0x7b')));_0x56ea78[_0x154a('0x18')](_0x154a('0x7c'),require(_0x154a('0x7d')));_0x56ea78[_0x154a('0x18')](_0x154a('0x7e'),require(_0x154a('0x7f')));_0x56ea78[_0x154a('0x18')](_0x154a('0x80'),require('./api/cannedAnswer'));_0x56ea78[_0x154a('0x18')](_0x154a('0x81'),require(_0x154a('0x82')));_0x56ea78['use'](_0x154a('0x83'),require(_0x154a('0x84')));_0x56ea78[_0x154a('0x18')]('/api/intervals',require(_0x154a('0x85')));_0x56ea78['use'](_0x154a('0x86'),require(_0x154a('0x87')));_0x56ea78[_0x154a('0x18')](_0x154a('0x88'),require('./api/cdr'));_0x56ea78['use']('/api/voiceQueuesLog',require(_0x154a('0x89')));_0x56ea78[_0x154a('0x18')]('/api/schedules',require(_0x154a('0x8a')));_0x56ea78[_0x154a('0x18')](_0x154a('0x8b'),require(_0x154a('0x8c')));_0x56ea78[_0x154a('0x18')](_0x154a('0x8d'),require('./api/tag'));_0x56ea78[_0x154a('0x18')](_0x154a('0x8e'),require('./api/template'));_0x56ea78[_0x154a('0x18')](_0x154a('0x8f'),require(_0x154a('0x90')));_0x56ea78['use']('/api/variables',require(_0x154a('0x91')));_0x56ea78[_0x154a('0x18')](_0x154a('0x92'),require('./api/integration'));_0x56ea78[_0x154a('0x18')](_0x154a('0x93'),require(_0x154a('0x94')));_0x56ea78[_0x154a('0x18')](_0x154a('0x95'),require(_0x154a('0x96')));_0x56ea78[_0x154a('0x18')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x56ea78['use'](_0x154a('0x97'),require(_0x154a('0x98')));_0x56ea78['use'](_0x154a('0x99'),require('./api/analyticMetric'));_0x56ea78[_0x154a('0x18')](_0x154a('0x9a'),require(_0x154a('0x9b')));_0x56ea78['use'](_0x154a('0x9c'),require(_0x154a('0x9d')));_0x56ea78['use'](_0x154a('0x9e'),require(_0x154a('0x9f')));_0x56ea78[_0x154a('0x18')](_0x154a('0xa0'),require(_0x154a('0xa1')));_0x56ea78['use']('/api/integrations/salesforce/fields',require(_0x154a('0xa2')));_0x56ea78[_0x154a('0x18')](_0x154a('0xa3'),require('./api/intSugarcrmAccount'));_0x56ea78['use']('/api/integrations/sugarcrm/configurations',require(_0x154a('0xa4')));_0x56ea78[_0x154a('0x18')](_0x154a('0xa5'),require('./api/intSugarcrmField'));_0x56ea78['use'](_0x154a('0xa6'),require('./api/intDeskAccount'));_0x56ea78['use']('/api/integrations/desk/configurations',require(_0x154a('0xa7')));_0x56ea78[_0x154a('0x18')]('/api/integrations/desk/fields',require(_0x154a('0xa8')));_0x56ea78[_0x154a('0x18')](_0x154a('0xa9'),require(_0x154a('0xaa')));_0x56ea78[_0x154a('0x18')](_0x154a('0xab'),require(_0x154a('0xac')));_0x56ea78['use']('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x56ea78[_0x154a('0x18')](_0x154a('0xad'),require(_0x154a('0xae')));_0x56ea78[_0x154a('0x18')](_0x154a('0xaf'),require(_0x154a('0xb0')));_0x56ea78['use']('/api/integrations/zendesk/fields',require(_0x154a('0xb1')));_0x56ea78['use'](_0x154a('0xb2'),require(_0x154a('0xb3')));_0x56ea78[_0x154a('0x18')](_0x154a('0xb4'),require(_0x154a('0xb5')));_0x56ea78[_0x154a('0x18')](_0x154a('0xb6'),require(_0x154a('0xb7')));_0x56ea78[_0x154a('0x18')](_0x154a('0xb8'),require('./api/intVtigerAccount'));_0x56ea78['use'](_0x154a('0xb9'),require(_0x154a('0xba')));_0x56ea78['use'](_0x154a('0xbb'),require(_0x154a('0xbc')));_0x56ea78[_0x154a('0x18')](_0x154a('0xbd'),require(_0x154a('0xbe')));_0x56ea78['use'](_0x154a('0xbf'),require(_0x154a('0xc0')));_0x56ea78[_0x154a('0x18')](_0x154a('0xc1'),require('./api/intServicenowField'));_0x56ea78['use'](_0x154a('0xc2'),require(_0x154a('0xc3')));_0x56ea78['use'](_0x154a('0xc4'),require(_0x154a('0xc5')));_0x56ea78['use']('/api/integrations/dynamics365/fields',require(_0x154a('0xc6')));_0x56ea78['use'](_0x154a('0xc7'),require(_0x154a('0xc8')));_0x56ea78[_0x154a('0x18')](_0x154a('0xc9'),require(_0x154a('0xca')));_0x56ea78[_0x154a('0x18')](_0x154a('0xcb'),require(_0x154a('0xcc')));_0x56ea78['use'](_0x154a('0xcd'),require(_0x154a('0xce')));_0x56ea78[_0x154a('0x18')](_0x154a('0xcf'),require(_0x154a('0xd0')));_0x56ea78['use'](_0x154a('0xd1'),require(_0x154a('0xd2')));_0x56ea78['use'](_0x154a('0xd3'),require(_0x154a('0xd4')));_0x56ea78[_0x154a('0x18')](_0x154a('0xd5'),require(_0x154a('0xd6')));_0x56ea78[_0x154a('0x18')](_0x154a('0xd7'),require(_0x154a('0xd8')));_0x56ea78[_0x154a('0x18')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x56ea78[_0x154a('0x18')]('/api/square/reports',require(_0x154a('0xd9')));_0x56ea78[_0x154a('0x18')]('/api/square/details/reports',require(_0x154a('0xda')));_0x56ea78[_0x154a('0x18')](_0x154a('0xdb'),require(_0x154a('0xdc')));_0x56ea78[_0x154a('0x18')](_0x154a('0xdd'),require(_0x154a('0xde')));_0x56ea78['use'](_0x154a('0xdf'),require(_0x154a('0xe0')));_0x56ea78['use'](_0x154a('0xe1'),require('./api/squareProject'));_0x56ea78['use'](_0x154a('0xe2'),require(_0x154a('0xe3')));_0x56ea78[_0x154a('0x18')](_0x154a('0xe4'),require(_0x154a('0xe5')));_0x56ea78[_0x154a('0x18')]('/api/teams',require(_0x154a('0xe6')));_0x56ea78['use']('/api/license',require(_0x154a('0xe7')));_0x56ea78[_0x154a('0x18')]('/api/campaigns',require(_0x154a('0xe8')));_0x56ea78[_0x154a('0x18')](_0x154a('0xe9'),require(_0x154a('0xea')));_0x56ea78[_0x154a('0x18')](_0x154a('0xeb'),require(_0x154a('0xec')));_0x56ea78['use'](_0x154a('0xed'),require(_0x154a('0xee')));_0x56ea78[_0x154a('0x18')](_0x154a('0xef'),require(_0x154a('0xf0')));_0x56ea78[_0x154a('0x18')](_0x154a('0xf1'),require(_0x154a('0xf2')));_0x56ea78['use'](_0x154a('0xf3'),require(_0x154a('0xf4')));_0x56ea78['use']('/api/openchannel/reports/transfer',require(_0x154a('0xf5')));_0x56ea78[_0x154a('0x18')](_0x154a('0xf6'),require(_0x154a('0xf7')));_0x56ea78[_0x154a('0x18')]('/api/cm/lists',require(_0x154a('0xf8')));_0x56ea78['use']('/api/voice/prefixes',require(_0x154a('0xf9')));_0x56ea78[_0x154a('0x18')](_0x154a('0xfa'),require(_0x154a('0xfb')));_0x56ea78[_0x154a('0x18')](_0x154a('0xfc'),require('./api/userProfileSection'));_0x56ea78[_0x154a('0x18')](_0x154a('0xfd'),require('./api/userProfileResource'));_0x56ea78[_0x154a('0x18')]('/api/userNotifications',require(_0x154a('0xfe')));_0x56ea78[_0x154a('0x18')](_0x154a('0xff'),require('./api/whatsappAccount'));_0x56ea78[_0x154a('0x18')](_0x154a('0x100'),require(_0x154a('0x101')));_0x56ea78[_0x154a('0x18')](_0x154a('0x102'),require(_0x154a('0x103')));_0x56ea78[_0x154a('0x18')](_0x154a('0x104'),require(_0x154a('0x105')));_0x56ea78[_0x154a('0x18')](_0x154a('0x106'),require(_0x154a('0x107')));_0x56ea78['use'](_0x154a('0x108'),require(_0x154a('0x109')));_0x56ea78[_0x154a('0x18')](_0x154a('0x10a'),require(_0x154a('0x10b')));_0x56ea78['use']('/api/cloudProviders',require(_0x154a('0x10c')));_0x56ea78[_0x154a('0x18')](_0x154a('0x10d'),require('./api/realtime'));_0x56ea78['use'](_0x154a('0x10e'),require('./api/authLocal'));_0x56ea78[_0x154a('0x18')](_0x154a('0x10f'),require('./api/authGoogle'));_0x56ea78['use'](_0x154a('0x110'),require('./api/jira'));_0x56ea78['use'](_0x154a('0x111'),require(_0x154a('0x112')));_0x56ea78[_0x154a('0x18')](_0x154a('0x113'),require(_0x154a('0x114')));_0x56ea78[_0x154a('0x18')](_0x154a('0x115'),require('./api/system'));_0x56ea78[_0x154a('0x18')]('/api/pm2',require('./api/pm2'));_0x56ea78['use'](_0x154a('0x116'),require(_0x154a('0x117')));_0x56ea78[_0x154a('0x18')]('/apidoc',express['static'](path['join'](config[_0x154a('0x118')],'/apidoc')));_0x56ea78[_0x154a('0x18')]('/www',express[_0x154a('0x119')](path[_0x154a('0x11a')](config[_0x154a('0x118')],_0x154a('0x11b'))));_0x56ea78[_0x154a('0x18')](_0x154a('0x11c'),express[_0x154a('0x119')](path[_0x154a('0x11a')](config[_0x154a('0x118')],'/demo')));_0x56ea78[_0x154a('0x18')](_0x154a('0x11d'),express[_0x154a('0x119')](path[_0x154a('0x11a')](config['root'],_0x154a('0x11e'),_0x154a('0x11f'))));_0x56ea78[_0x154a('0x18')]('/plugins',express[_0x154a('0x119')](path[_0x154a('0x11a')](config[_0x154a('0x118')],'/server/files/plugins')));_0x56ea78[_0x154a('0x120')](_0x154a('0x121'))[_0x154a('0x122')](errors[0x194]);_0x56ea78[_0x154a('0x120')]('/*')['get'](function(_0x5e61e5,_0x362cdc){_0x362cdc[_0x154a('0x123')](path[_0x154a('0x124')](_0x56ea78['get'](_0x154a('0x125'))+_0x154a('0x126')));});};var sensitiveFields=[_0x154a('0x127'),_0x154a('0x128'),_0x154a('0x129'),_0x154a('0x12a'),_0x154a('0x12b'),'lastName',_0x154a('0x12c'),'phone',_0x154a('0x12d'),_0x154a('0x12e'),_0x154a('0x12f'),'clientId',_0x154a('0x130'),'securityToken',_0x154a('0x131'),_0x154a('0x132'),_0x154a('0x133'),_0x154a('0x134'),'channelSecret','accessToken',_0x154a('0x135'),_0x154a('0x136'),_0x154a('0x137'),_0x154a('0x138'),_0x154a('0x139'),_0x154a('0x13a'),_0x154a('0x13b'),_0x154a('0x13c'),'vidaooApiKey','clientEmail',_0x154a('0x13d'),_0x154a('0x13e'),_0x154a('0x13f'),_0x154a('0x140'),_0x154a('0x14'),'pass','accountSid','localstationid',_0x154a('0x141'),_0x154a('0x142'),_0x154a('0x143'),_0x154a('0x144')];function maskSensitiveData(_0x340200){var _0x465cfe=/(?!^)[\s\S](?!$)/g;if(!_[_0x154a('0x145')](_0x340200))return;for(var _0x542a86 in _0x340200){if(_[_0x154a('0x146')](_0x340200[_0x542a86])){for(var _0x57ed18=0x0;_0x57ed18<_0x340200[_0x542a86][_0x154a('0x147')];_0x57ed18++){maskSensitiveData(_0x340200[_0x542a86][_0x57ed18]);}}else if(_[_0x154a('0x145')](_0x340200[_0x542a86])){maskSensitiveData(_0x340200[_0x542a86]);}else if(_[_0x154a('0x148')](_0x340200[_0x542a86])){_0x340200[_0x542a86]=_0x340200[_0x542a86][_0x154a('0x149')](/{{{/g,'@@{')[_0x154a('0x149')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0x154a('0x149')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x542a86)){_0x340200[_0x542a86]=_0x340200[_0x542a86][_0x154a('0x149')](_0x465cfe,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 2ff739c..1a5d0be 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8277=['../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/faxAccount/faxAccount.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/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.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/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/squareReport/squareReport.rpc'];(function(_0x243866,_0x36269a){var _0x551bbd=function(_0x5a07ab){while(--_0x5a07ab){_0x243866['push'](_0x243866['shift']());}};_0x551bbd(++_0x36269a);}(_0x8277,0x16d));var _0x7827=function(_0x2a6754,_0x277259){_0x2a6754=_0x2a6754-0x0;var _0x17feda=_0x8277[_0x2a6754];return _0x17feda;};'use strict';var jayson=require(_0x7827('0x0'));var BPromise=require(_0x7827('0x1'));var _=require(_0x7827('0x2'));var config=require(_0x7827('0x3'));exports[_0x7827('0x4')]=function(){return new BPromise(function(_0x1d2f0a,_0x4d34d3){var _0x51674={};_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/user/user.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x6')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x7')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x8')));_0x51674=_['merge'](_0x51674,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x9')));_0x51674=_['merge'](_0x51674,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x51674=_['merge'](_0x51674,require(_0x7827('0xa')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0xb')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0xc')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0xd')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0xe')));_0x51674=_['merge'](_0x51674,require(_0x7827('0xf')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x10')));_0x51674=_['merge'](_0x51674,require('../api/mailInteraction/mailInteraction.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x11')));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/mailApplication/mailApplication.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x12')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x13')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x14')));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/faxMessage/faxMessage.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x15')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x16')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x17')));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/smsInteraction/smsInteraction.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x18')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x19')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x1a')));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x1b')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x1c')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x1d')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x1e')));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/chatMessage/chatMessage.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/chatQueue/chatQueue.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/cmContact/cmContact.rpc'));_0x51674=_['merge'](_0x51674,require(_0x7827('0x1f')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x20')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x21')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x22')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x23')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x24')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x25')));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/sound/sound.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/template/template.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x26')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x27')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x28')));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x51674=_['merge'](_0x51674,require(_0x7827('0x29')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x2a')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x2b')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x2c')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x2d')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x2e')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x2f')));_0x51674=_['merge'](_0x51674,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x51674=_['merge'](_0x51674,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x51674=_['merge'](_0x51674,require(_0x7827('0x30')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x31')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x32')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x33')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x34')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x35')));_0x51674=_['merge'](_0x51674,require('../api/squareMessage/squareMessage.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x36')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x37')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x38')));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x39')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x3a')));_0x51674=_[_0x7827('0x5')](_0x51674,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x51674=_[_0x7827('0x5')](_0x51674,require(_0x7827('0x3b')));_0x51674=_['merge'](_0x51674,require(_0x7827('0x3c')));var _0x3a858c=jayson[_0x7827('0x3d')](_0x51674)['http']();var _0x220ab7=config[_0x7827('0x3e')][_0x7827('0x3f')]||config[_0x7827('0x3f')]+0x1;var _0x5b9139=config[_0x7827('0x3e')]['ip']||_0x7827('0x40');_0x3a858c['on'](_0x7827('0x41'),function(_0x409536){return _0x4d34d3(_0x409536);});_0x3a858c[_0x7827('0x4')](_0x220ab7,_0x5b9139,function(){console[_0x7827('0x42')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5b9139,_0x220ab7);require(_0x7827('0x43'))['default']();return _0x1d2f0a(_0x7827('0x44')+_0x5b9139+':'+_0x220ab7);});});}; \ No newline at end of file +var _0x6e4e=['log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.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','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost'];(function(_0x3837ca,_0x55a94b){var _0x556db8=function(_0x4b183f){while(--_0x4b183f){_0x3837ca['push'](_0x3837ca['shift']());}};_0x556db8(++_0x55a94b);}(_0x6e4e,0xca));var _0xe6e4=function(_0x46cc29,_0x473f8e){_0x46cc29=_0x46cc29-0x0;var _0x5ea06f=_0x6e4e[_0x46cc29];return _0x5ea06f;};'use strict';var jayson=require(_0xe6e4('0x0'));var BPromise=require('bluebird');var _=require(_0xe6e4('0x1'));var config=require('../config/environment');exports[_0xe6e4('0x2')]=function(){return new BPromise(function(_0x15969e,_0x2d3fe2){var _0x112781={};_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/user/user.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x4')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/voiceQueue/voiceQueue.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/voiceRecording/voiceRecording.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x5')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x112781=_['merge'](_0x112781,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x6')));_0x112781=_['merge'](_0x112781,require('../api/memberReport/memberReport.rpc'));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x7')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x8')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x9')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0xa')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0xb')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0xc')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0xd')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0xe')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0xf')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x10')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x11')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/faxApplication/faxApplication.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x12')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x13')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x14')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x15')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x16')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x17')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x18')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x19')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x1a')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x1b')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x1c')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x1d')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x1e')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x1f')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x20')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x21')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x22')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x23')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x24')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x25')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x26')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/interval/interval.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/pause/pause.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x27')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x28')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x29')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x2a')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x2b')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x2c')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x2d')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x2e')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x112781=_['merge'](_0x112781,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x2f')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x30')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x31')));_0x112781=_['merge'](_0x112781,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/squareReport/squareReport.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x32')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x33')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/squareProject/squareProject.rpc'));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x34')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x35')));_0x112781=_['merge'](_0x112781,require(_0xe6e4('0x36')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x37')));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/plugin/plugin.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x112781=_[_0xe6e4('0x3')](_0x112781,require(_0xe6e4('0x38')));var _0x111499=jayson[_0xe6e4('0x39')](_0x112781)[_0xe6e4('0x3a')]();var _0x3d8725=config[_0xe6e4('0x3b')][_0xe6e4('0x3c')]||config[_0xe6e4('0x3c')]+0x1;var _0x5c7aee=config[_0xe6e4('0x3b')]['ip']||_0xe6e4('0x3d');_0x111499['on']('error',function(_0xbc9125){return _0x2d3fe2(_0xbc9125);});_0x111499[_0xe6e4('0x2')](_0x3d8725,_0x5c7aee,function(){console[_0xe6e4('0x3e')](_0xe6e4('0x3f'),_0x5c7aee,_0x3d8725);require(_0xe6e4('0x40'))['default']();return _0x15969e(_0xe6e4('0x41')+_0x5c7aee+':'+_0x3d8725);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index f5b87c0..2c785fd 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 _0xfbf2=['command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','NO\x20MESSAGE','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setPriority','hangup','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','continueAt','extension','setExtension','getVariable','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','emit','ready','line','toLowerCase','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','startsWith','split','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xfbf2,0xc0));var _0x2fbf=function(_0x1277a3,_0xfa0e66){_0x1277a3=_0x1277a3-0x0;var _0x3c6822=_0xfbf2[_0x1277a3];return _0x3c6822;};'use strict';var util=require(_0x2fbf('0x0'));var _=require(_0x2fbf('0x1'));var EventEmitter=require(_0x2fbf('0x2'))[_0x2fbf('0x3')];var AGIReply=require(_0x2fbf('0x4'));var AGIError=require(_0x2fbf('0x5'));function AGIChannel(_0x4fb013){var _0x255a0b=this,_0x1f4177=new AGIReply(),_0xfc9ee7=![],_0x32b674={};EventEmitter[_0x2fbf('0x6')](_0x255a0b);_0x4fb013[_0x2fbf('0x7')](_0x2fbf('0x8'));_0x4fb013['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1f4177[_0x2fbf('0x7')](_0x2fbf('0x8'));_0x1f4177['on']('headers',function(_0x211c7c){for(var _0x4d9850 in _0x211c7c){_0x255a0b[_0x4d9850]=_0x211c7c[_0x4d9850];}_0x255a0b[_0x2fbf('0x9')](_0x2fbf('0xa'));});_0x1f4177['on'](_0x2fbf('0xb'),function(_0x72f3c8){if(_0x72f3c8[_0x2fbf('0xc')]()=='hangup'){_0x255a0b[_0x2fbf('0x9')]('hangup');return;}if(_0x72f3c8[_0x2fbf('0xd')](0x0,0xb)=='520-Invalid'){_0xfc9ee7=!![];}if(_0xfc9ee7){_0x32b674['rx']+=_0x72f3c8+'\x0a';if(_0x72f3c8[_0x2fbf('0xe')](_0x2fbf('0xf'))!=-0x1){_0xfc9ee7=![];}}else{_0x32b674['rx']=_0x72f3c8;}if(_0xfc9ee7){return;}if(typeof _0x32b674['cb']==_0x2fbf('0x10')){var _0x1c1ab6=_0x32b674['rx'][_0x2fbf('0xd')](0x0,0x3),_0x4c28bb=null,_0x44fb6a=null;_0x1c1ab6=parseInt(_0x1c1ab6);if(isNaN(_0x1c1ab6)){_0x32b674['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2fbf('0x11')});return;}if(_0x1c1ab6!=0xc8){_0x32b674['cb'](null,{'code':_0x1c1ab6,'result':-0x1,'extra':'KO'});return;}_0x4c28bb=_0x32b674['rx']['substring'](0x4)[_0x2fbf('0x12')](_0x2fbf('0x13'),'');if(_0x4c28bb['indexOf']('\x20')!=-0x1){_0x4c28bb=_0x4c28bb[_0x2fbf('0x14')](0x0,_0x4c28bb['indexOf']('\x20'));}if(_[_0x2fbf('0x15')](_0x4c28bb,'-1')){_0x4c28bb=parseInt(_0x4c28bb);}_0x44fb6a=_0x32b674['rx'][_0x2fbf('0x16')]('\x20');if(_0x44fb6a[_0x2fbf('0x17')]==0x3){_0x44fb6a=_0x44fb6a[0x2][_0x2fbf('0xd')](0x1,_0x44fb6a[0x2][_0x2fbf('0x17')]-0x1);}else if(_0x44fb6a[_0x2fbf('0x17')]>0x3){var _0x37cad2=/\((.+)\)/;var _0x4e856f=_0x32b674['rx'][_0x2fbf('0x18')](_0x37cad2);if(_0x4e856f){_0x44fb6a=_0x4e856f[0x1];}else{_0x44fb6a=null;}}else{_0x44fb6a=null;}_0x32b674['cb'](null,{'code':_0x1c1ab6,'result':_0x4c28bb,'extra':_0x44fb6a});}});_0x4fb013['on'](_0x2fbf('0x19'),function(_0x56b0d5){_0x255a0b[_0x2fbf('0x9')](_0x2fbf('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x56b0d5['code']));});_0x4fb013['on'](_0x2fbf('0x1a'),function(){_0x255a0b[_0x2fbf('0x9')](_0x2fbf('0x1a'),new AGIError(_0x2fbf('0x1b')));});_0x4fb013['on'](_0x2fbf('0x1c'),function(){_0x255a0b[_0x2fbf('0x9')](_0x2fbf('0x1c'),new AGIError(_0x2fbf('0x1d')));_0x4fb013['destroy']();});_0x4fb013['pipe'](_0x1f4177);this[_0x2fbf('0x1e')]=function(_0x5adec7,_0x5628c){var _0x5adec7=_0x5adec7||'',_0x5628c=typeof _0x5628c==_0x2fbf('0x10')?_0x5628c:new Function();_0x32b674={'tx':_0x5adec7,'rx':'','cb':_0x5628c};_0x4fb013[_0x2fbf('0x1f')](_0x5adec7+'\x0a');},this['close']=function(){_0x4fb013['destroy']();};}util[_0x2fbf('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x22')]=function(_0x104021){return this[_0x2fbf('0x1e')][_0x2fbf('0x23')](this,_0x104021);};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x24')]=function(){return this[_0x2fbf('0x22')](_0x2fbf('0x25'));};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x26')]=function(_0x545638,_0x777e3,_0x71d12d){_0x545638=_0x545638===undefined?_0x2fbf('0x27'):_0x545638;_0x777e3=_0x777e3===undefined?'5':_0x777e3;_0x71d12d=_0x71d12d===undefined?'1':_0x71d12d;return this['sendRequest'](util[_0x2fbf('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x545638,_0x777e3*0x3e8,_0x71d12d));};AGIChannel[_0x2fbf('0x21')]['noop']=function(_0x48494f){_0x48494f=_0x48494f||_0x2fbf('0x29');return this['sendRequest'](util[_0x2fbf('0x28')]('VERBOSE\x20\x22%s\x22',_0x48494f));};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x2a')]=function(_0xfab771,_0x1d67ca){if(_[_0x2fbf('0x2b')](_0x1d67ca)){return this[_0x2fbf('0x22')](util[_0x2fbf('0x28')]('EXEC\x20%s\x20%s',_0xfab771,_0x1d67ca[_0x2fbf('0x2c')](',')));}return this[_0x2fbf('0x22')](util['format'](_0x2fbf('0x2d'),_0xfab771,_0x1d67ca));};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x2e')]=function(_0x252d13){return this[_0x2fbf('0x22')](util['format'](_0x2fbf('0x2f'),_0x252d13));};AGIChannel[_0x2fbf('0x21')]['setExtension']=function(_0x419a79){return this[_0x2fbf('0x22')](util[_0x2fbf('0x28')]('SET\x20EXTENSION\x20%s',_0x419a79));};AGIChannel['prototype'][_0x2fbf('0x30')]=function(_0x55b770){return this[_0x2fbf('0x22')](util['format']('SET\x20PRIORITY\x20%s',_0x55b770));};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x31')]=function(){return this[_0x2fbf('0x22')](_0x2fbf('0x32'));};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x33')]=function(_0x3788aa,_0x4206ee){var _0x26ccce=_[_0x2fbf('0x34')](_0x4206ee)||_[_0x2fbf('0x35')](_0x4206ee)?_0x4206ee[_0x2fbf('0x36')]():_0x4206ee;return this['sendRequest'](util[_0x2fbf('0x28')](_0x2fbf('0x37'),_0x3788aa,_0x26ccce?_0x26ccce[_0x2fbf('0x36')]()[_0x2fbf('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x2fbf('0x21')]['sayNumber']=function(_0x317c53,_0x2cab72){return this[_0x2fbf('0x22')](util[_0x2fbf('0x28')](_0x2fbf('0x38'),_0x317c53,_0x2cab72));};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x39')]=function(_0x13b30b,_0x1dddf0){return this[_0x2fbf('0x22')](util[_0x2fbf('0x28')](_0x2fbf('0x3a'),_0x13b30b,_0x1dddf0));};AGIChannel[_0x2fbf('0x21')]['sayPhonetic']=function(_0x35f415,_0x2d378f){return this['sendRequest'](util[_0x2fbf('0x28')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x35f415,_0x2d378f));};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x3b')]=function(_0x5c1135,_0xc845c4,_0x401c53){_0xc845c4=_0xc845c4||this[_0x2fbf('0x3c')];_0x401c53=_0x401c53||0x1;this[_0x2fbf('0x2e')](_0x5c1135);this[_0x2fbf('0x3d')](_0xc845c4);this[_0x2fbf('0x30')](_0x401c53);return this['noop'](util['format']('GOTO\x20%s\x20%s\x20%s',_0x5c1135,_0xc845c4,_0x401c53));};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x3e')]=function(_0x2b01fe){return this[_0x2fbf('0x22')](util[_0x2fbf('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x2b01fe));};AGIChannel[_0x2fbf('0x21')]['recordFile']=function(_0x14e155,_0x393d8f,_0x45e1c5,_0x424668,_0x46b480,_0x21bd34){_0x393d8f=_0x393d8f||_0x2fbf('0x3f');_0x45e1c5=_0x45e1c5||'';_0x424668=_0x424668===undefined?-0x1:_0x424668==='-1'?-0x1:_0x424668*0x3e8;_0x46b480=_0x46b480===undefined?'':'s='+_0x46b480;_0x21bd34=_0x21bd34?_0x2fbf('0x40'):'';return this[_0x2fbf('0x22')](util[_0x2fbf('0x28')](_0x2fbf('0x41'),_0x14e155,_0x393d8f,_0x45e1c5,_0x424668,_0x21bd34,_0x46b480));};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x42')]=function(_0x142330,_0x2e10db){_0x2e10db=_0x2e10db||'';return this[_0x2fbf('0x22')](util[_0x2fbf('0x28')](_0x2fbf('0x43'),_0x142330,_0x2e10db));};AGIChannel['prototype'][_0x2fbf('0x44')]=function(_0x1ee059){return this[_0x2fbf('0x2a')](_0x2fbf('0x45'),_0x1ee059);};AGIChannel[_0x2fbf('0x21')][_0x2fbf('0x46')]=function(_0x2043ed){return this['exec'](_0x2fbf('0x47'),_0x2043ed);};AGIChannel['prototype'][_0x2fbf('0x19')]=function(_0x2442bf,_0x577b44){this['noop'](util['format'](_0x2fbf('0x48'),_0x2442bf['id'],_0x2442bf['label'],_0x577b44));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2fbf('0x49')]=AGIChannel; \ No newline at end of file +var _0x2dd8=['SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','hangup','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setExtension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','label','exports','util','lodash','events','EventEmitter','./reply','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','inherits','prototype','sendRequest','command','sync','answer','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s'];(function(_0x2dfe85,_0x147f2d){var _0x10b8c2=function(_0x4d7baf){while(--_0x4d7baf){_0x2dfe85['push'](_0x2dfe85['shift']());}};_0x10b8c2(++_0x147f2d);}(_0x2dd8,0xbe));var _0x82dd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2dd8[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x82dd('0x0'));var _=require(_0x82dd('0x1'));var EventEmitter=require(_0x82dd('0x2'))[_0x82dd('0x3')];var AGIReply=require(_0x82dd('0x4'));var AGIError=require('./error');function AGIChannel(_0x18046a){var _0x15ef6b=this,_0xe785a=new AGIReply(),_0x150a0e=![],_0x20c2a7={};EventEmitter['call'](_0x15ef6b);_0x18046a[_0x82dd('0x5')](_0x82dd('0x6'));_0x18046a[_0x82dd('0x7')](0x8*0x3c*0x3c*0x3e8);_0xe785a['setEncoding'](_0x82dd('0x6'));_0xe785a['on'](_0x82dd('0x8'),function(_0x5db48c){for(var _0x3f5d9b in _0x5db48c){_0x15ef6b[_0x3f5d9b]=_0x5db48c[_0x3f5d9b];}_0x15ef6b[_0x82dd('0x9')](_0x82dd('0xa'));});_0xe785a['on'](_0x82dd('0xb'),function(_0x5b766b){if(_0x5b766b[_0x82dd('0xc')]()=='hangup'){_0x15ef6b[_0x82dd('0x9')]('hangup');return;}if(_0x5b766b[_0x82dd('0xd')](0x0,0xb)==_0x82dd('0xe')){_0x150a0e=!![];}if(_0x150a0e){_0x20c2a7['rx']+=_0x5b766b+'\x0a';if(_0x5b766b[_0x82dd('0xf')](_0x82dd('0x10'))!=-0x1){_0x150a0e=![];}}else{_0x20c2a7['rx']=_0x5b766b;}if(_0x150a0e){return;}if(typeof _0x20c2a7['cb']==_0x82dd('0x11')){var _0x11fe40=_0x20c2a7['rx'][_0x82dd('0xd')](0x0,0x3),_0x34a2cd=null,_0x56c2d4=null;_0x11fe40=parseInt(_0x11fe40);if(isNaN(_0x11fe40)){_0x20c2a7['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x11fe40!=0xc8){_0x20c2a7['cb'](null,{'code':_0x11fe40,'result':-0x1,'extra':'KO'});return;}_0x34a2cd=_0x20c2a7['rx'][_0x82dd('0xd')](0x4)[_0x82dd('0x12')](_0x82dd('0x13'),'');if(_0x34a2cd[_0x82dd('0x14')]('\x20')!=-0x1){_0x34a2cd=_0x34a2cd[_0x82dd('0x15')](0x0,_0x34a2cd[_0x82dd('0x14')]('\x20'));}if(_[_0x82dd('0x16')](_0x34a2cd,'-1')){_0x34a2cd=parseInt(_0x34a2cd);}_0x56c2d4=_0x20c2a7['rx'][_0x82dd('0x17')]('\x20');if(_0x56c2d4[_0x82dd('0x18')]==0x3){_0x56c2d4=_0x56c2d4[0x2]['substring'](0x1,_0x56c2d4[0x2][_0x82dd('0x18')]-0x1);}else if(_0x56c2d4['length']>0x3){var _0x2c7d1b=/\((.+)\)/;var _0x2be3e1=_0x20c2a7['rx']['match'](_0x2c7d1b);if(_0x2be3e1){_0x56c2d4=_0x2be3e1[0x1];}else{_0x56c2d4=null;}}else{_0x56c2d4=null;}_0x20c2a7['cb'](null,{'code':_0x11fe40,'result':_0x34a2cd,'extra':_0x56c2d4});}});_0x18046a['on'](_0x82dd('0x19'),function(_0x48579b){_0x15ef6b[_0x82dd('0x9')](_0x82dd('0x19'),new AGIError(_0x82dd('0x1a'),_0x48579b[_0x82dd('0x1b')]));});_0x18046a['on']('close',function(){_0x15ef6b[_0x82dd('0x9')]('close',new AGIError(_0x82dd('0x1c')));});_0x18046a['on'](_0x82dd('0x1d'),function(){_0x15ef6b[_0x82dd('0x9')](_0x82dd('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x18046a[_0x82dd('0x1e')]();});_0x18046a[_0x82dd('0x1f')](_0xe785a);this['command']=function(_0x48df49,_0x5bff91){var _0x48df49=_0x48df49||'',_0x5bff91=typeof _0x5bff91==_0x82dd('0x11')?_0x5bff91:new Function();_0x20c2a7={'tx':_0x48df49,'rx':'','cb':_0x5bff91};_0x18046a['write'](_0x48df49+'\x0a');},this['close']=function(){_0x18046a[_0x82dd('0x1e')]();};}util[_0x82dd('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x82dd('0x21')][_0x82dd('0x22')]=function(_0x555b88){return this[_0x82dd('0x23')][_0x82dd('0x24')](this,_0x555b88);};AGIChannel[_0x82dd('0x21')][_0x82dd('0x25')]=function(){return this[_0x82dd('0x22')](_0x82dd('0x26'));};AGIChannel[_0x82dd('0x21')]['getData']=function(_0x5a9ede,_0x14b54c,_0x2f1f90){_0x5a9ede=_0x5a9ede===undefined?_0x82dd('0x27'):_0x5a9ede;_0x14b54c=_0x14b54c===undefined?'5':_0x14b54c;_0x2f1f90=_0x2f1f90===undefined?'1':_0x2f1f90;return this['sendRequest'](util['format'](_0x82dd('0x28'),_0x5a9ede,_0x14b54c*0x3e8,_0x2f1f90));};AGIChannel[_0x82dd('0x21')][_0x82dd('0x29')]=function(_0x4b4bfd){_0x4b4bfd=_0x4b4bfd||_0x82dd('0x2a');return this[_0x82dd('0x22')](util[_0x82dd('0x2b')](_0x82dd('0x2c'),_0x4b4bfd));};AGIChannel[_0x82dd('0x21')][_0x82dd('0x2d')]=function(_0x329aa6,_0x520c97){if(_[_0x82dd('0x2e')](_0x520c97)){return this['sendRequest'](util[_0x82dd('0x2b')](_0x82dd('0x2f'),_0x329aa6,_0x520c97[_0x82dd('0x30')](',')));}return this['sendRequest'](util['format'](_0x82dd('0x2f'),_0x329aa6,_0x520c97));};AGIChannel[_0x82dd('0x21')]['setContext']=function(_0x3da3f1){return this['sendRequest'](util[_0x82dd('0x2b')](_0x82dd('0x31'),_0x3da3f1));};AGIChannel['prototype']['setExtension']=function(_0x100070){return this[_0x82dd('0x22')](util[_0x82dd('0x2b')](_0x82dd('0x32'),_0x100070));};AGIChannel[_0x82dd('0x21')][_0x82dd('0x33')]=function(_0x436295){return this['sendRequest'](util[_0x82dd('0x2b')](_0x82dd('0x34'),_0x436295));};AGIChannel[_0x82dd('0x21')][_0x82dd('0x35')]=function(){return this[_0x82dd('0x22')]('HANGUP');};AGIChannel['prototype'][_0x82dd('0x36')]=function(_0x1e8cf1,_0x26a866){var _0x35087b=_['isBoolean'](_0x26a866)||_[_0x82dd('0x37')](_0x26a866)?_0x26a866[_0x82dd('0x38')]():_0x26a866;return this[_0x82dd('0x22')](util[_0x82dd('0x2b')](_0x82dd('0x39'),_0x1e8cf1,_0x35087b?_0x35087b[_0x82dd('0x38')]()[_0x82dd('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x82dd('0x3a')]=function(_0x4a84b4,_0x45be41){return this[_0x82dd('0x22')](util[_0x82dd('0x2b')](_0x82dd('0x3b'),_0x4a84b4,_0x45be41));};AGIChannel[_0x82dd('0x21')][_0x82dd('0x3c')]=function(_0x39b252,_0x4e1541){return this[_0x82dd('0x22')](util[_0x82dd('0x2b')](_0x82dd('0x3d'),_0x39b252,_0x4e1541));};AGIChannel['prototype'][_0x82dd('0x3e')]=function(_0x46b384,_0x241b31){return this['sendRequest'](util['format'](_0x82dd('0x3f'),_0x46b384,_0x241b31));};AGIChannel['prototype'][_0x82dd('0x40')]=function(_0x44aa19,_0x1eee39,_0x3729b8){_0x1eee39=_0x1eee39||this[_0x82dd('0x41')];_0x3729b8=_0x3729b8||0x1;this[_0x82dd('0x42')](_0x44aa19);this[_0x82dd('0x43')](_0x1eee39);this[_0x82dd('0x33')](_0x3729b8);return this[_0x82dd('0x29')](util[_0x82dd('0x2b')](_0x82dd('0x44'),_0x44aa19,_0x1eee39,_0x3729b8));};AGIChannel['prototype']['getVariable']=function(_0x383205){return this[_0x82dd('0x22')](util[_0x82dd('0x2b')](_0x82dd('0x45'),_0x383205));};AGIChannel[_0x82dd('0x21')][_0x82dd('0x46')]=function(_0x123f41,_0x39b3dc,_0x5c1bca,_0x479072,_0x436902,_0x2f6a15){_0x39b3dc=_0x39b3dc||'wav';_0x5c1bca=_0x5c1bca||'';_0x479072=_0x479072===undefined?-0x1:_0x479072==='-1'?-0x1:_0x479072*0x3e8;_0x436902=_0x436902===undefined?'':'s='+_0x436902;_0x2f6a15=_0x2f6a15?_0x82dd('0x47'):'';return this[_0x82dd('0x22')](util[_0x82dd('0x2b')](_0x82dd('0x48'),_0x123f41,_0x39b3dc,_0x5c1bca,_0x479072,_0x2f6a15,_0x436902));};AGIChannel[_0x82dd('0x21')][_0x82dd('0x49')]=function(_0x4d345e,_0xa24a2a){_0xa24a2a=_0xa24a2a||'';return this[_0x82dd('0x22')](util['format'](_0x82dd('0x4a'),_0x4d345e,_0xa24a2a));};AGIChannel[_0x82dd('0x21')][_0x82dd('0x4b')]=function(_0x893466){return this[_0x82dd('0x2d')](_0x82dd('0x4c'),_0x893466);};AGIChannel[_0x82dd('0x21')][_0x82dd('0x4d')]=function(_0x56533f){return this[_0x82dd('0x2d')]('WAIT',_0x56533f);};AGIChannel[_0x82dd('0x21')][_0x82dd('0x19')]=function(_0x9bd93d,_0x415769){this[_0x82dd('0x29')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x9bd93d['id'],_0x9bd93d[_0x82dd('0x4e')],_0x415769));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x82dd('0x4f')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index e4a143e..d553710 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 _0xabc4=['exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message'];(function(_0xcf77fa,_0x3e891e){var _0x11f2b9=function(_0x441934){while(--_0x441934){_0xcf77fa['push'](_0xcf77fa['shift']());}};_0x11f2b9(++_0x3e891e);}(_0xabc4,0x1d2));var _0x4abc=function(_0x42cf89,_0x2bd0dd){_0x42cf89=_0x42cf89-0x0;var _0x5a918f=_0xabc4[_0x42cf89];return _0x5a918f;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x4abc('0x0'),'E_AGI_ARGUMENT_PORT':_0x4abc('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x4abc('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x4abc('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x4abc('0x4'),'E_AGI_SOCKET_CLOSE':_0x4abc('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x4abc('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4abc('0x7'),'E_AGI_IVR_ENTRY':_0x4abc('0x8')};function AGIError(_0x1a2de3){var _0x1a2de3=_0x1a2de3||null,_0x3c202a=_0x3c202a||[],_0x2ce3c6=0x1,_0x5b2a3c='';if(!error[_0x1a2de3]){_0x1a2de3=_0x4abc('0x9');}_0x3c202a[_0x4abc('0xa')](error[_0x1a2de3]);while(arguments[_0x2ce3c6]){_0x3c202a[_0x4abc('0xa')](arguments[_0x2ce3c6]);_0x2ce3c6++;}_0x5b2a3c=util[_0x4abc('0xb')][_0x4abc('0xc')](util,_0x3c202a);this[_0x4abc('0xd')]=_0x5b2a3c;this['name']=_0x1a2de3;}module[_0x4abc('0xe')]=AGIError; \ No newline at end of file +var _0xed72=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.'];(function(_0x337f5a,_0x1ac9ec){var _0x2cceb1=function(_0x1dd278){while(--_0x1dd278){_0x337f5a['push'](_0x337f5a['shift']());}};_0x2cceb1(++_0x1ac9ec);}(_0xed72,0x80));var _0x2ed7=function(_0x48e6f1,_0x1bd3e8){_0x48e6f1=_0x48e6f1-0x0;var _0x154ae1=_0xed72[_0x48e6f1];return _0x154ae1;};'use strict';var util=require(_0x2ed7('0x0'));var error={'E_AGI_UNDEFINED':_0x2ed7('0x1'),'E_AGI_ARGUMENT_PORT':_0x2ed7('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x2ed7('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x2ed7('0x4'),'E_AGI_SOCKET_ERROR':_0x2ed7('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x2ed7('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x2ed7('0x7')};function AGIError(_0x32713b){var _0x32713b=_0x32713b||null,_0x5834ac=_0x5834ac||[],_0x378c6f=0x1,_0x2653ec='';if(!error[_0x32713b]){_0x32713b='E_AGI_UNDEFINED';}_0x5834ac[_0x2ed7('0x8')](error[_0x32713b]);while(arguments[_0x378c6f]){_0x5834ac[_0x2ed7('0x8')](arguments[_0x378c6f]);_0x378c6f++;}_0x2653ec=util[_0x2ed7('0x9')]['apply'](util,_0x5834ac);this[_0x2ed7('0xa')]=_0x2653ec;this['name']=_0x32713b;}module[_0x2ed7('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 37e2a6f..cb6725a 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 _0xace9=['traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getsecretdigits','numberOfEdges','prototype','addVertex','vertices','addEdge','edges','size','getVertex','no\x20vertex\x20found','stop\x20traverse','length','info','no\x20edge/s\x20available','condition','split','vswitch','target','agicommand','invalid'];(function(_0x16ee51,_0x37bbb0){var _0x2a1682=function(_0x4ed8fc){while(--_0x4ed8fc){_0x16ee51['push'](_0x16ee51['shift']());}};_0x2a1682(++_0x37bbb0);}(_0xace9,0xd1));var _0x9ace=function(_0x3ed67f,_0x1e357e){_0x3ed67f=_0x3ed67f-0x0;var _0x3bcbf5=_0xace9[_0x3ed67f];return _0x3bcbf5;};'use strict';var _=require(_0x9ace('0x0'));var logger=require(_0x9ace('0x1'))('agi');var verticesWithRetry=[_0x9ace('0x2'),'getdigits',_0x9ace('0x3')];var Graph=function(){this['vertices']={};this['edges']={};this[_0x9ace('0x4')]=0x0;};Graph[_0x9ace('0x5')][_0x9ace('0x6')]=function(_0x4836c1){this[_0x9ace('0x7')][_0x4836c1['id']]=_0x4836c1;this['edges'][_0x4836c1['id']]=[];};Graph[_0x9ace('0x5')][_0x9ace('0x8')]=function(_0x36ec23,_0x16c0c9,_0x2f6228){this[_0x9ace('0x9')][_0x36ec23]['push']({'target':_0x16c0c9,'condition':_0x2f6228});this['numberOfEdges']+=0x1;};Graph['prototype'][_0x9ace('0xa')]=function(){return _['size'](this['vertices']);};Graph[_0x9ace('0x5')]['relations']=function(){return this[_0x9ace('0x4')];};Graph[_0x9ace('0x5')][_0x9ace('0xb')]=function(_0x10f414){return this['vertices'][_0x10f414];};Graph[_0x9ace('0x5')]['traverseBFS']=function(_0x505450,_0x974c38){if(!this[_0x9ace('0x7')][_0x505450]){return logger['info'](_0x9ace('0xc'));}var _0x217172=_0x974c38(this[_0x9ace('0x7')][_0x505450]);if(!_0x217172){return logger['info'](_0x9ace('0xd'));}if(this[_0x9ace('0x9')][_0x505450][_0x9ace('0xe')]===0x0){return logger[_0x9ace('0xf')](_0x9ace('0x10'));}for(var _0x214549=0x0,_0x18a69a=[],_0x53d582=![];_0x214549\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','value','getSquareProject','then','catch','createSquareReport','indexOf','substring','inspect','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','hangup','sync','production','stringify','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','response','code','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','toString','[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','priority','continueAt','Project\x20%s\x20not\x20published','close','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','listening','connection','xml2json','lodash','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','[ERROR]\x20%s','[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','info','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x397dfb,_0x2373a1){var _0x39002f=function(_0x23748e){while(--_0x23748e){_0x397dfb['push'](_0x397dfb['shift']());}};_0x39002f(++_0x2373a1);}(_0xa897,0x97));var _0x7a89=function(_0x56f471,_0x37ab52){_0x56f471=_0x56f471-0x0;var _0x8ef2ab=_0xa897[_0x56f471];return _0x8ef2ab;};'use strict';var parser=require(_0x7a89('0x0'));var _=require(_0x7a89('0x1'));var syncho=require('syncho');var util=require('util');var moment=require('moment');var config=require('../../config/environment');var logger=require(_0x7a89('0x2'))(_0x7a89('0x3'));var utilLicense=require(_0x7a89('0x4'));var rpc=require(_0x7a89('0x5'));var mailRpc=require(_0x7a89('0x6'));var Graph=require('./graph');var Vertices=require(_0x7a89('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x7a89('0x8')](config[_0x7a89('0x3')],{'ip':_0x7a89('0x9'),'port':0x11dd});function connectionHandler(_0x55721f){process[_0x7a89('0xa')](function(){syncho(function(){try{setChannelVariables(_0x55721f);agiHandler(_0x55721f);}catch(_0x10a8cf){logger[_0x7a89('0xb')](_0x10a8cf[_0x7a89('0xc')]);}});});}function listeningHandler(){console[_0x7a89('0xd')](_0x7a89('0xe'),config[_0x7a89('0x3')][_0x7a89('0xf')]);logger['info'](util[_0x7a89('0x10')](_0x7a89('0x11'),config['agi']['ip'],config[_0x7a89('0x3')]['port']));}function errorHandler(_0x4fa441){if(_0x4fa441&&_0x4fa441['name']&&_0x4fa441[_0x7a89('0x12')]){logger['error'](util[_0x7a89('0x10')](_0x7a89('0x13'),_0x4fa441['name'],_0x4fa441[_0x7a89('0x12')]));}else{logger[_0x7a89('0xb')](util['format'](_0x7a89('0x14'),_0x4fa441[_0x7a89('0xc')]));}}function closeHandler(){logger['info'](util[_0x7a89('0x10')](_0x7a89('0x15'),this[_0x7a89('0x16')],this[_0x7a89('0x17')],this[_0x7a89('0x18')],this[_0x7a89('0x19')],this[_0x7a89('0x1a')]));try{createSquareReport(this);}catch(_0x16a3ec){logger[_0x7a89('0xb')](_0x16a3ec[_0x7a89('0xc')]);}}function timeoutHandler(){logger[_0x7a89('0x1b')](util['format'](_0x7a89('0x1c'),this[_0x7a89('0x16')],this[_0x7a89('0x17')],this[_0x7a89('0x18')],this[_0x7a89('0x19')],this[_0x7a89('0x1a')]));}function hangupHandler(){logger[_0x7a89('0x1b')](util[_0x7a89('0x10')](_0x7a89('0x1d'),this[_0x7a89('0x16')],this[_0x7a89('0x17')],this[_0x7a89('0x18')],this[_0x7a89('0x19')],this[_0x7a89('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x185177){return parser[_0x7a89('0x1e')](_0x185177,{'object':!![]})[_0x7a89('0x1f')][_0x7a89('0x20')];}function addVertex(_0x1a2429,_0xa42ca2,_0x477cec){_0xa42ca2[_0x7a89('0x21')]=_0x477cec;if(_0xa42ca2[_0x7a89('0x22')](_0x7a89('0x23'))){_0xa42ca2[_0x7a89('0x24')]=parseInt(_0xa42ca2['retry'],0xa);}_0x1a2429[_0x7a89('0x25')](_[_0x7a89('0x26')](_0xa42ca2,_0x7a89('0x27')));}function initGraph(_0x4f6e06,_0x3e1706){var _0x5285f4=new Graph();for(var _0x57a79c in _0x4f6e06){if(_0x4f6e06['hasOwnProperty'](_0x57a79c)){if(_[_0x7a89('0x28')](_0x4f6e06[_0x57a79c])){for(var _0x51f787=0x0;_0x51f787<_0x4f6e06[_0x57a79c][_0x7a89('0x29')];_0x51f787+=0x1){addVertex(_0x5285f4,_0x4f6e06[_0x57a79c][_0x51f787],_0x57a79c);}}else{addVertex(_0x5285f4,_0x4f6e06[_0x57a79c],_0x57a79c);}}}for(var _0x3b33e0=0x0;_0x3b33e0<_0x3e1706[_0x7a89('0x29')];_0x3b33e0+=0x1){if(_0x3e1706[_0x3b33e0][_0x7a89('0x2a')]&&_0x3e1706[_0x3b33e0][_0x7a89('0x2b')]){_0x5285f4['addEdge'](_0x3e1706[_0x3b33e0][_0x7a89('0x2a')],_0x3e1706[_0x3b33e0][_0x7a89('0x2b')],_0x3e1706[_0x3b33e0][_0x7a89('0x2c')]);}}return _0x5285f4;}function getSquareProject(_0x1a3b00,_0x3b406b){rpc[_0x7a89('0x2d')](_0x1a3b00)[_0x7a89('0x2e')](function(_0x18e43a){_0x3b406b(null,_0x18e43a);})[_0x7a89('0x2f')](function(_0x386bc4){_0x3b406b(null,_0x386bc4);});}function createSquareReport(_0x88f503,_0x40f462){rpc[_0x7a89('0x30')](_0x88f503)['then'](function(_0x514961){if(_0x40f462){_0x40f462(null,_0x514961);}})[_0x7a89('0x2f')](function(_0x1dded2){if(_0x40f462){_0x40f462(null,_0x1dded2);}});}function setChannelVariables(_0x3e0075){for(var _0x32f97b in _0x3e0075){if(_0x3e0075[_0x7a89('0x22')](_0x32f97b)){if(_0x32f97b[_0x7a89('0x31')]('agi_')===0x0){_0x3e0075[_0x32f97b[_0x7a89('0x32')](0x4)]=_0x3e0075[_0x32f97b];delete _0x3e0075[_0x32f97b];}}}}function getLogFromObject(_0x1f4220){return util[_0x7a89('0x33')](_0x1f4220,{'showHidden':![],'depth':null});}function agiHandler(_0x22d77a){var _0x4bc3ec,_0x3a848b,_0x4d0995,_0x5a13f7,_0x312e5a;logger[_0x7a89('0x34')]('variables',JSON['stringify'](_0x22d77a,null,0x2));logger['info'](util[_0x7a89('0x10')](_0x7a89('0x35'),_0x22d77a[_0x7a89('0x16')],_0x22d77a['calleridname'],_0x22d77a[_0x7a89('0x18')],_0x22d77a[_0x7a89('0x19')],_0x22d77a['uniqueid']));_0x22d77a['on'](_0x7a89('0xb'),errorHandler);_0x22d77a['on']('close',closeHandler);_0x22d77a['on']('timeout',timeoutHandler);_0x22d77a[_0x7a89('0x36')]=![];_0x22d77a['on'](_0x7a89('0x37'),hangupHandler);var _0x37272e=getSquareProject[_0x7a89('0x38')](null,_0x22d77a[_0x7a89('0x16')]);if(_0x37272e){if(_0x37272e[_0x7a89('0x39')]){_0x4bc3ec=getRoot(_0x37272e[_0x7a89('0x39')]);if(_0x4bc3ec&&_0x4bc3ec['start']){logger[_0x7a89('0x34')](_0x7a89('0x20'),JSON[_0x7a89('0x3a')](_0x4bc3ec,null,0x2));_0x22d77a['joinAt']=moment()[_0x7a89('0x10')](_0x7a89('0x3b'));_0x3a848b=initGraph(_[_0x7a89('0x26')](_0x4bc3ec,_0x7a89('0x27')),_0x4bc3ec['mxCell']);_0x4d0995=new Vertices(_0x22d77a,rpc,mailRpc);logger[_0x7a89('0x1b')](util[_0x7a89('0x10')](_0x7a89('0x3c'),_0x22d77a['arg_1'],_0x22d77a[_0x7a89('0x17')],_0x22d77a[_0x7a89('0x18')],_0x22d77a[_0x7a89('0x19')],_0x22d77a[_0x7a89('0x1a')]));_0x3a848b[_0x7a89('0x3d')](_0x4bc3ec[_0x7a89('0x3e')]['id'],function(_0x68096d){try{_0x68096d=_0x4d0995[_0x7a89('0x3f')](_0x68096d);logger[_0x7a89('0x34')]('vertex',JSON[_0x7a89('0x3a')](_0x68096d,null,0x2));if(_0x68096d[_0x7a89('0x21')]===_0x7a89('0x40')){logger[_0x7a89('0x1b')](_0x7a89('0x41'));_0x22d77a[_0x7a89('0x42')]=_0x68096d[_0x7a89('0x42')]||_0x22d77a[_0x7a89('0x42')];_0x22d77a[_0x7a89('0x43')]=_0x68096d[_0x7a89('0x43')];_0x22d77a['priority']=_0x68096d['priority']?_0x68096d['priority']-0x1:0x1;return null;}else if(_0x68096d&&_0x4d0995[_0x68096d[_0x7a89('0x21')]]){_0x312e5a=_0x4d0995[_0x68096d[_0x7a89('0x21')]](_0x68096d);logger[_0x7a89('0x1b')](_0x7a89('0x44'),JSON[_0x7a89('0x3a')](_0x312e5a,null,0x2));if(_0x312e5a&&_0x312e5a[_0x7a89('0x45')]===AGI_CODE_SUCCESS&&_0x312e5a['result']!==AGI_RESULT_ERROR&&!_0x22d77a[_0x7a89('0x36')]){logger[_0x7a89('0x34')](_0x7a89('0x44'),getLogFromObject(_0x312e5a));return _['isUndefined'](_0x312e5a[_0x7a89('0x46')])?null:_0x312e5a['result']['toString']();}else{logger['error']('response',getLogFromObject(_0x312e5a));return null;}}else{logger[_0x7a89('0xb')](_0x7a89('0x47'));return null;}}catch(_0x1943da){logger[_0x7a89('0xb')](_0x1943da[_0x7a89('0xc')]);return null;}});if(_0x4bc3ec[_0x7a89('0x48')]){logger[_0x7a89('0x1b')](util[_0x7a89('0x10')](_0x7a89('0x49'),_0x22d77a[_0x7a89('0x16')],_0x22d77a[_0x7a89('0x17')],_0x22d77a[_0x7a89('0x18')],_0x22d77a[_0x7a89('0x19')],_0x22d77a['uniqueid']));_0x3a848b[_0x7a89('0x3d')](_0x4bc3ec[_0x7a89('0x48')]['id'],function(_0x49af3f){try{_0x49af3f=_0x4d0995[_0x7a89('0x3f')](_0x49af3f);logger[_0x7a89('0x34')](_0x7a89('0x4a'),JSON[_0x7a89('0x3a')](_0x49af3f,null,0x2));if(_0x49af3f&&_0x4d0995[_0x49af3f[_0x7a89('0x21')]]){_0x312e5a=_0x4d0995[_0x49af3f[_0x7a89('0x21')]](_0x49af3f);if(_0x312e5a){logger[_0x7a89('0x34')](_0x7a89('0x44'),getLogFromObject(_0x312e5a));return _['isUndefined'](_0x312e5a[_0x7a89('0x46')])?null:_0x312e5a['result'][_0x7a89('0x4b')]();}else{logger[_0x7a89('0xb')](_0x7a89('0x44'),getLogFromObject(_0x312e5a));return null;}}else{logger['error'](_0x7a89('0x47'));return null;}}catch(_0x1ad544){logger[_0x7a89('0xb')](_0x1ad544[_0x7a89('0xc')]);return null;}});}logger[_0x7a89('0x1b')](util[_0x7a89('0x10')](_0x7a89('0x4c'),_0x22d77a[_0x7a89('0x16')],_0x22d77a[_0x7a89('0x17')],_0x22d77a['callerid'],_0x22d77a[_0x7a89('0x19')],_0x22d77a['uniqueid']));logger[_0x7a89('0x1b')](util[_0x7a89('0x10')](_0x7a89('0x4d'),_0x22d77a['context'],_0x22d77a['extension'],parseInt(_0x22d77a[_0x7a89('0x4e')],0xa)+0x1));_0x22d77a[_0x7a89('0x4f')](_0x22d77a[_0x7a89('0x42')],_0x22d77a['extension'],parseInt(_0x22d77a[_0x7a89('0x4e')],0xa)+0x1);_0x22d77a['close']();}}else{logger[_0x7a89('0xb')](util[_0x7a89('0x10')](_0x7a89('0x50'),_0x22d77a[_0x7a89('0x16')]));_0x22d77a['continueAt'](_0x22d77a[_0x7a89('0x42')],_0x22d77a[_0x7a89('0x43')],parseInt(_0x22d77a[_0x7a89('0x4e')],0xa)+0x1);_0x22d77a[_0x7a89('0x51')]();}}else{logger[_0x7a89('0xb')](util[_0x7a89('0x10')](_0x7a89('0x52'),_0x22d77a[_0x7a89('0x16')]));_0x22d77a['continueAt'](_0x22d77a[_0x7a89('0x42')],_0x22d77a['extension'],parseInt(_0x22d77a[_0x7a89('0x4e')],0xa)+0x1);_0x22d77a['close']();}}function main(){var _0x9aaae8;return utilLicense['getLicense']()[_0x7a89('0x2e')](function(_0x4ece5e){if(_0x4ece5e){if(_0x4ece5e[_0x7a89('0x53')]){if(_0x4ece5e[_0x7a89('0x54')]&&_0x4ece5e[_0x7a89('0x54')]>0x0){logger[_0x7a89('0x1b')](util[_0x7a89('0x10')](_0x7a89('0x55'),_0x4ece5e[_0x7a89('0x54')]));_0x9aaae8=_0x4ece5e['callysquare'];}else{logger['info'](_0x7a89('0x56'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x9aaae8=-0x1;}}})[_0x7a89('0x2f')](function(_0x46cb0a){logger[_0x7a89('0xb')](_0x7a89('0x57'),_0x46cb0a[_0x7a89('0xc')]);})[_0x7a89('0x48')](function(){var _0x8c469f=require('./server')(config['agi'][_0x7a89('0xf')],config[_0x7a89('0x3')]['ip'],_0x9aaae8);_0x8c469f['on'](_0x7a89('0xb'),errorHandler);_0x8c469f['on'](_0x7a89('0x58'),listeningHandler);_0x8c469f['on'](_0x7a89('0x59'),connectionHandler);_0x8c469f['on'](_0x7a89('0x51'),closeHandler);});}main(); \ No newline at end of file +var _0x4699=['arg_1','calleridname','callerid','dnid','[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','uniqueid','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','retry','addVertex','mxCell','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','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','isUndefined','[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\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','xml2json','lodash','moment','../../config/logger','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','format','[%s]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x3aa935,_0x13c716){var _0x214540=function(_0x3cf66d){while(--_0x3cf66d){_0x3aa935['push'](_0x3aa935['shift']());}};_0x214540(++_0x13c716);}(_0x4699,0x1b9));var _0x9469=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4699[_0x3dd15e];return _0x231fd0;};'use strict';var parser=require(_0x9469('0x0'));var _=require(_0x9469('0x1'));var syncho=require('syncho');var util=require('util');var moment=require(_0x9469('0x2'));var config=require('../../config/environment');var logger=require(_0x9469('0x3'))(_0x9469('0x4'));var utilLicense=require(_0x9469('0x5'));var rpc=require('./rpc');var mailRpc=require(_0x9469('0x6'));var Graph=require(_0x9469('0x7'));var Vertices=require(_0x9469('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x9469('0x4')]=_[_0x9469('0x9')](config[_0x9469('0x4')],{'ip':_0x9469('0xa'),'port':0x11dd});function connectionHandler(_0x22a680){process[_0x9469('0xb')](function(){syncho(function(){try{setChannelVariables(_0x22a680);agiHandler(_0x22a680);}catch(_0x1b7140){logger[_0x9469('0xc')](_0x1b7140[_0x9469('0xd')]);}});});}function listeningHandler(){console[_0x9469('0xe')](_0x9469('0xf'),config[_0x9469('0x4')][_0x9469('0x10')]);logger['info'](util['format'](_0x9469('0x11'),config[_0x9469('0x4')]['ip'],config[_0x9469('0x4')][_0x9469('0x10')]));}function errorHandler(_0x40f30){if(_0x40f30&&_0x40f30[_0x9469('0x12')]&&_0x40f30[_0x9469('0x13')]){logger[_0x9469('0xc')](util[_0x9469('0x14')](_0x9469('0x15'),_0x40f30[_0x9469('0x12')],_0x40f30['message']));}else{logger[_0x9469('0xc')](util[_0x9469('0x14')]('[ERROR]\x20%s',_0x40f30['stack']));}}function closeHandler(){logger[_0x9469('0x16')](util[_0x9469('0x14')](_0x9469('0x17'),this[_0x9469('0x18')],this[_0x9469('0x19')],this[_0x9469('0x1a')],this[_0x9469('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x4f0139){logger[_0x9469('0xc')](_0x4f0139[_0x9469('0xd')]);}}function timeoutHandler(){logger[_0x9469('0x16')](util[_0x9469('0x14')](_0x9469('0x1c'),this[_0x9469('0x18')],this[_0x9469('0x19')],this[_0x9469('0x1a')],this[_0x9469('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0x9469('0x16')](util[_0x9469('0x14')](_0x9469('0x1d'),this[_0x9469('0x18')],this[_0x9469('0x19')],this[_0x9469('0x1a')],this[_0x9469('0x1b')],this[_0x9469('0x1e')]));this[_0x9469('0x1f')]=!![];}function getRoot(_0x1a6a7c){return parser['toJson'](_0x1a6a7c,{'object':!![]})[_0x9469('0x20')][_0x9469('0x21')];}function addVertex(_0x3a32d2,_0x5bf1b5,_0x58e1a6){_0x5bf1b5[_0x9469('0x22')]=_0x58e1a6;if(_0x5bf1b5[_0x9469('0x23')]('retry')){_0x5bf1b5[_0x9469('0x24')]=parseInt(_0x5bf1b5[_0x9469('0x25')],0xa);}_0x3a32d2[_0x9469('0x26')](_['omit'](_0x5bf1b5,_0x9469('0x27')));}function initGraph(_0x3cb5d5,_0x43e2b8){var _0x501a60=new Graph();for(var _0xb09d1c in _0x3cb5d5){if(_0x3cb5d5[_0x9469('0x23')](_0xb09d1c)){if(_['isArray'](_0x3cb5d5[_0xb09d1c])){for(var _0x261951=0x0;_0x261951<_0x3cb5d5[_0xb09d1c]['length'];_0x261951+=0x1){addVertex(_0x501a60,_0x3cb5d5[_0xb09d1c][_0x261951],_0xb09d1c);}}else{addVertex(_0x501a60,_0x3cb5d5[_0xb09d1c],_0xb09d1c);}}}for(var _0xcd46aa=0x0;_0xcd46aa<_0x43e2b8[_0x9469('0x28')];_0xcd46aa+=0x1){if(_0x43e2b8[_0xcd46aa][_0x9469('0x29')]&&_0x43e2b8[_0xcd46aa][_0x9469('0x2a')]){_0x501a60[_0x9469('0x2b')](_0x43e2b8[_0xcd46aa][_0x9469('0x29')],_0x43e2b8[_0xcd46aa][_0x9469('0x2a')],_0x43e2b8[_0xcd46aa][_0x9469('0x2c')]);}}return _0x501a60;}function getSquareProject(_0x2bca23,_0x36333f){rpc[_0x9469('0x2d')](_0x2bca23)[_0x9469('0x2e')](function(_0x3d3ff2){_0x36333f(null,_0x3d3ff2);})[_0x9469('0x2f')](function(_0x8dc160){_0x36333f(null,_0x8dc160);});}function createSquareReport(_0x34a365,_0x36d94e){rpc[_0x9469('0x30')](_0x34a365)[_0x9469('0x2e')](function(_0xa4af2b){if(_0x36d94e){_0x36d94e(null,_0xa4af2b);}})[_0x9469('0x2f')](function(_0x18f524){if(_0x36d94e){_0x36d94e(null,_0x18f524);}});}function setChannelVariables(_0x480a75){for(var _0x5087b4 in _0x480a75){if(_0x480a75['hasOwnProperty'](_0x5087b4)){if(_0x5087b4[_0x9469('0x31')](_0x9469('0x32'))===0x0){_0x480a75[_0x5087b4['substring'](0x4)]=_0x480a75[_0x5087b4];delete _0x480a75[_0x5087b4];}}}}function getLogFromObject(_0x223db1){return util[_0x9469('0x33')](_0x223db1,{'showHidden':![],'depth':null});}function agiHandler(_0x1097ab){var _0x231e54,_0x14e6a0,_0x30eccc,_0x3e9220,_0x3050a4;logger[_0x9469('0x34')](_0x9469('0x35'),JSON[_0x9469('0x36')](_0x1097ab,null,0x2));logger[_0x9469('0x16')](util[_0x9469('0x14')](_0x9469('0x37'),_0x1097ab[_0x9469('0x18')],_0x1097ab['calleridname'],_0x1097ab[_0x9469('0x1a')],_0x1097ab[_0x9469('0x1b')],_0x1097ab['uniqueid']));_0x1097ab['on'](_0x9469('0xc'),errorHandler);_0x1097ab['on'](_0x9469('0x38'),closeHandler);_0x1097ab['on'](_0x9469('0x39'),timeoutHandler);_0x1097ab['evtHangup']=![];_0x1097ab['on'](_0x9469('0x3a'),hangupHandler);var _0xb43e80=getSquareProject[_0x9469('0x3b')](null,_0x1097ab['arg_1']);if(_0xb43e80){if(_0xb43e80['production']){_0x231e54=getRoot(_0xb43e80[_0x9469('0x3c')]);if(_0x231e54&&_0x231e54[_0x9469('0x3d')]){logger[_0x9469('0x34')](_0x9469('0x21'),JSON[_0x9469('0x36')](_0x231e54,null,0x2));_0x1097ab[_0x9469('0x3e')]=moment()[_0x9469('0x14')](_0x9469('0x3f'));_0x14e6a0=initGraph(_[_0x9469('0x40')](_0x231e54,'mxCell'),_0x231e54[_0x9469('0x27')]);_0x30eccc=new Vertices(_0x1097ab,rpc,mailRpc);logger[_0x9469('0x16')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1097ab[_0x9469('0x18')],_0x1097ab[_0x9469('0x19')],_0x1097ab[_0x9469('0x1a')],_0x1097ab[_0x9469('0x1b')],_0x1097ab['uniqueid']));_0x14e6a0[_0x9469('0x41')](_0x231e54[_0x9469('0x3d')]['id'],function(_0x58a9a6){try{_0x58a9a6=_0x30eccc[_0x9469('0x42')](_0x58a9a6);logger[_0x9469('0x34')](_0x9469('0x43'),JSON[_0x9469('0x36')](_0x58a9a6,null,0x2));if(_0x58a9a6[_0x9469('0x22')]===_0x9469('0x44')){logger[_0x9469('0x16')](_0x9469('0x45'));_0x1097ab['context']=_0x58a9a6[_0x9469('0x46')]||_0x1097ab[_0x9469('0x46')];_0x1097ab['extension']=_0x58a9a6[_0x9469('0x47')];_0x1097ab[_0x9469('0x48')]=_0x58a9a6[_0x9469('0x48')]?_0x58a9a6['priority']-0x1:0x1;return null;}else if(_0x58a9a6&&_0x30eccc[_0x58a9a6[_0x9469('0x22')]]){_0x3050a4=_0x30eccc[_0x58a9a6['agicommand']](_0x58a9a6);logger[_0x9469('0x16')](_0x9469('0x49'),JSON[_0x9469('0x36')](_0x3050a4,null,0x2));if(_0x3050a4&&_0x3050a4[_0x9469('0x4a')]===AGI_CODE_SUCCESS&&_0x3050a4[_0x9469('0x4b')]!==AGI_RESULT_ERROR&&!_0x1097ab[_0x9469('0x1f')]){logger['debug'](_0x9469('0x49'),getLogFromObject(_0x3050a4));return _['isUndefined'](_0x3050a4[_0x9469('0x4b')])?null:_0x3050a4[_0x9469('0x4b')][_0x9469('0x4c')]();}else{logger[_0x9469('0xc')](_0x9469('0x49'),getLogFromObject(_0x3050a4));return null;}}else{logger[_0x9469('0xc')](_0x9469('0x4d'));return null;}}catch(_0x340ad0){logger['error'](_0x340ad0[_0x9469('0xd')]);return null;}});if(_0x231e54[_0x9469('0x4e')]){logger[_0x9469('0x16')](util[_0x9469('0x14')](_0x9469('0x4f'),_0x1097ab[_0x9469('0x18')],_0x1097ab['calleridname'],_0x1097ab[_0x9469('0x1a')],_0x1097ab[_0x9469('0x1b')],_0x1097ab['uniqueid']));_0x14e6a0[_0x9469('0x41')](_0x231e54[_0x9469('0x4e')]['id'],function(_0x4625fa){try{_0x4625fa=_0x30eccc[_0x9469('0x42')](_0x4625fa);logger[_0x9469('0x34')](_0x9469('0x43'),JSON['stringify'](_0x4625fa,null,0x2));if(_0x4625fa&&_0x30eccc[_0x4625fa[_0x9469('0x22')]]){_0x3050a4=_0x30eccc[_0x4625fa[_0x9469('0x22')]](_0x4625fa);if(_0x3050a4){logger[_0x9469('0x34')](_0x9469('0x49'),getLogFromObject(_0x3050a4));return _[_0x9469('0x50')](_0x3050a4[_0x9469('0x4b')])?null:_0x3050a4['result']['toString']();}else{logger[_0x9469('0xc')](_0x9469('0x49'),getLogFromObject(_0x3050a4));return null;}}else{logger[_0x9469('0xc')](_0x9469('0x4d'));return null;}}catch(_0xc36189){logger['error'](_0xc36189[_0x9469('0xd')]);return null;}});}logger['info'](util[_0x9469('0x14')](_0x9469('0x51'),_0x1097ab[_0x9469('0x18')],_0x1097ab[_0x9469('0x19')],_0x1097ab[_0x9469('0x1a')],_0x1097ab[_0x9469('0x1b')],_0x1097ab[_0x9469('0x1e')]));logger[_0x9469('0x16')](util[_0x9469('0x14')](_0x9469('0x52'),_0x1097ab['context'],_0x1097ab[_0x9469('0x47')],parseInt(_0x1097ab[_0x9469('0x48')],0xa)+0x1));_0x1097ab[_0x9469('0x53')](_0x1097ab[_0x9469('0x46')],_0x1097ab[_0x9469('0x47')],parseInt(_0x1097ab[_0x9469('0x48')],0xa)+0x1);_0x1097ab['close']();}}else{logger[_0x9469('0xc')](util[_0x9469('0x14')](_0x9469('0x54'),_0x1097ab[_0x9469('0x18')]));_0x1097ab[_0x9469('0x53')](_0x1097ab['context'],_0x1097ab[_0x9469('0x47')],parseInt(_0x1097ab[_0x9469('0x48')],0xa)+0x1);_0x1097ab['close']();}}else{logger[_0x9469('0xc')](util[_0x9469('0x14')](_0x9469('0x55'),_0x1097ab[_0x9469('0x18')]));_0x1097ab[_0x9469('0x53')](_0x1097ab[_0x9469('0x46')],_0x1097ab[_0x9469('0x47')],parseInt(_0x1097ab[_0x9469('0x48')],0xa)+0x1);_0x1097ab[_0x9469('0x38')]();}}function main(){var _0x52fad9;return utilLicense[_0x9469('0x56')]()[_0x9469('0x2e')](function(_0x668845){if(_0x668845){if(_0x668845[_0x9469('0x57')]){if(_0x668845[_0x9469('0x58')]&&_0x668845[_0x9469('0x58')]>0x0){logger[_0x9469('0x16')](util[_0x9469('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x668845[_0x9469('0x58')]));_0x52fad9=_0x668845[_0x9469('0x58')];}else{logger[_0x9469('0x16')](_0x9469('0x59'));}}else{logger['info'](_0x9469('0x5a'));_0x52fad9=-0x1;}}})[_0x9469('0x2f')](function(_0x2f2731){logger[_0x9469('0xc')](_0x9469('0x5b'),_0x2f2731[_0x9469('0xd')]);})[_0x9469('0x4e')](function(){var _0x56481d=require('./server')(config[_0x9469('0x4')]['port'],config[_0x9469('0x4')]['ip'],_0x52fad9);_0x56481d['on'](_0x9469('0xc'),errorHandler);_0x56481d['on'](_0x9469('0x5c'),listeningHandler);_0x56481d['on']('connection',connectionHandler);_0x56481d['on'](_0x9469('0x38'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 67121c6..958c654 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 _0x2afd=['bluebird','request','then','error','message','catch','sendMailMessage','SendMail'];(function(_0x124c24,_0x13593a){var _0x5e4ec8=function(_0xa151fb){while(--_0xa151fb){_0x124c24['push'](_0x124c24['shift']());}};_0x5e4ec8(++_0x13593a);}(_0x2afd,0x68));var _0xd2af=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2afd[_0x3ab51d];return _0x29a04e;};'use strict';var BPromise=require(_0xd2af('0x0'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function request(_0x22b302,_0x5c4b7e){return new BPromise(function(_0x300284,_0x1cd75a){return client[_0xd2af('0x1')](_0x22b302,_0x5c4b7e)[_0xd2af('0x2')](function(_0x48be4b){if(_0x48be4b[_0xd2af('0x3')]){return _0x1cd75a(_0x48be4b[_0xd2af('0x3')][_0xd2af('0x4')]);}else{return _0x300284(_0x48be4b['result']);}})[_0xd2af('0x5')](function(_0x32890e){return _0x1cd75a(_0x32890e);});});}exports[_0xd2af('0x6')]=function(_0x32b8c7,_0x41cabf){return request(_0xd2af('0x7'),{'account':_0x32b8c7,'message':_0x41cabf});}; \ No newline at end of file +var _0x8551=['jayson/promise','client','request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x8551,0x13e));var _0x1855=function(_0x590861,_0x42c7f3){_0x590861=_0x590861-0x0;var _0x1d0a80=_0x8551[_0x590861];return _0x1d0a80;};'use strict';var BPromise=require(_0x1855('0x0'));var jayson=require(_0x1855('0x1'));var client=jayson[_0x1855('0x2')]['http']({'port':0x232b});function request(_0x2bcbef,_0x5b1ac2){return new BPromise(function(_0x27df25,_0x500bb9){return client[_0x1855('0x3')](_0x2bcbef,_0x5b1ac2)[_0x1855('0x4')](function(_0x347d7e){if(_0x347d7e[_0x1855('0x5')]){return _0x500bb9(_0x347d7e[_0x1855('0x5')][_0x1855('0x6')]);}else{return _0x27df25(_0x347d7e[_0x1855('0x7')]);}})[_0x1855('0x8')](function(_0x30ae59){return _0x500bb9(_0x30ae59);});});}exports[_0x1855('0x9')]=function(_0x3eace7,_0x56574a){return request(_0x1855('0xa'),{'account':_0x3eace7,'message':_0x56574a});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 2c283ef..c1ace97 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 _0x3495=['emit','headers','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','substring','length','split','indexOf','slice','trim'];(function(_0x28ba65,_0x3c7b96){var _0x9a8f91=function(_0x4a5033){while(--_0x4a5033){_0x28ba65['push'](_0x28ba65['shift']());}};_0x9a8f91(++_0x3c7b96);}(_0x3495,0x1de));var _0x5349=function(_0x506731,_0x58d11c){_0x506731=_0x506731-0x0;var _0x1f5bf4=_0x3495[_0x506731];return _0x1f5bf4;};'use strict';var util=require(_0x5349('0x0'));var Transform=require(_0x5349('0x1'))[_0x5349('0x2')];function AGIReply(_0x42494c){Transform[_0x5349('0x3')](this,_0x42494c);this[_0x5349('0x4')]='';this[_0x5349('0x5')]=![];}util[_0x5349('0x6')](AGIReply,Transform);AGIReply[_0x5349('0x7')]['_transform']=function(_0x4034ba,_0x8283b5,_0x5ce2cd){var _0xcb5a1='\x0a',_0x538385=['\x0a\x0a',_0x5349('0x8')],_0x6fb5dc=-0x1,_0x529323=-0x1,_0x393873='',_0x583cee=0x0,_0x1751b2='',_0x3eaddf='';this[_0x5349('0x4')]+=_0x4034ba[_0x5349('0x9')]();_0x1751b2=this[_0x5349('0x4')];if(!this[_0x5349('0x5')]){_0x583cee=0x0;while(_0x538385[_0x583cee]){while((_0x529323=_0x1751b2['indexOf'](_0x538385[_0x583cee]))!=-0x1){_0x393873=_0x538385[_0x583cee];_0x3eaddf=_0x1751b2[_0x5349('0xa')](0x0,_0x529323);_0x1751b2=_0x1751b2['substring'](_0x529323+_0x393873[_0x5349('0xb')]);var _0x32b09b=_0x3eaddf[_0x5349('0xc')](_0xcb5a1),_0xcf06a8=0x0,_0x11d230={},_0x2f5172='',_0x3c592a='',_0x642966=-0x1;while(_0x32b09b[_0xcf06a8]){_0x642966=_0x32b09b[_0xcf06a8][_0x5349('0xd')](':');if(_0x642966!=-0x1){_0x2f5172=_0x32b09b[_0xcf06a8][_0x5349('0xe')](0x0,_0x642966)['trim']();_0x3c592a=_0x32b09b[_0xcf06a8][_0x5349('0xe')](_0x642966+0x1)[_0x5349('0xf')]();if(_0x2f5172['length']>0x0){_0x11d230[_0x2f5172]=_0x3c592a;}}else{}_0xcf06a8++;}this[_0x5349('0x10')](_0x5349('0x11'),_0x11d230);this[_0x5349('0x5')]=!![];}_0x583cee++;}this['_localBuffer']=_0x1751b2;}else{while((_0x6fb5dc=_0x1751b2['indexOf'](_0xcb5a1))!=-0x1){_0x3eaddf=_0x1751b2['substring'](0x0,_0x6fb5dc);this[_0x5349('0x10')]('line',_0x3eaddf);_0x1751b2=_0x1751b2[_0x5349('0xa')](_0x6fb5dc+_0xcb5a1['length']);}this[_0x5349('0x4')]=_0x1751b2;}_0x5ce2cd();};module[_0x5349('0x12')]=AGIReply; \ No newline at end of file +var _0xc052=['emit','headers','line','exports','util','stream','call','prototype','\x0d\x0a\x0d\x0a','_localBuffer','toString','_inBody','indexOf','substring','length','split','trim','slice'];(function(_0x4e2bc6,_0x5e2401){var _0x59357a=function(_0x437f8c){while(--_0x437f8c){_0x4e2bc6['push'](_0x4e2bc6['shift']());}};_0x59357a(++_0x5e2401);}(_0xc052,0x70));var _0x2c05=function(_0x1f3b76,_0x17ba2a){_0x1f3b76=_0x1f3b76-0x0;var _0x4dc555=_0xc052[_0x1f3b76];return _0x4dc555;};'use strict';var util=require(_0x2c05('0x0'));var Transform=require(_0x2c05('0x1'))['Transform'];function AGIReply(_0x16b3dd){Transform[_0x2c05('0x2')](this,_0x16b3dd);this['_localBuffer']='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x2c05('0x3')]['_transform']=function(_0x2a501b,_0x1d7672,_0x41a498){var _0x3921a0='\x0a',_0x2dd7c9=['\x0a\x0a',_0x2c05('0x4')],_0x344b44=-0x1,_0x13d267=-0x1,_0x177fba='',_0x1a023c=0x0,_0x2582e1='',_0x3d6e01='';this[_0x2c05('0x5')]+=_0x2a501b[_0x2c05('0x6')]();_0x2582e1=this[_0x2c05('0x5')];if(!this[_0x2c05('0x7')]){_0x1a023c=0x0;while(_0x2dd7c9[_0x1a023c]){while((_0x13d267=_0x2582e1[_0x2c05('0x8')](_0x2dd7c9[_0x1a023c]))!=-0x1){_0x177fba=_0x2dd7c9[_0x1a023c];_0x3d6e01=_0x2582e1[_0x2c05('0x9')](0x0,_0x13d267);_0x2582e1=_0x2582e1[_0x2c05('0x9')](_0x13d267+_0x177fba[_0x2c05('0xa')]);var _0x4d3394=_0x3d6e01[_0x2c05('0xb')](_0x3921a0),_0xe6edae=0x0,_0x2d8eb0={},_0x45e7af='',_0x3238fb='',_0x50767e=-0x1;while(_0x4d3394[_0xe6edae]){_0x50767e=_0x4d3394[_0xe6edae]['indexOf'](':');if(_0x50767e!=-0x1){_0x45e7af=_0x4d3394[_0xe6edae]['slice'](0x0,_0x50767e)[_0x2c05('0xc')]();_0x3238fb=_0x4d3394[_0xe6edae][_0x2c05('0xd')](_0x50767e+0x1)['trim']();if(_0x45e7af[_0x2c05('0xa')]>0x0){_0x2d8eb0[_0x45e7af]=_0x3238fb;}}else{}_0xe6edae++;}this[_0x2c05('0xe')](_0x2c05('0xf'),_0x2d8eb0);this[_0x2c05('0x7')]=!![];}_0x1a023c++;}this[_0x2c05('0x5')]=_0x2582e1;}else{while((_0x344b44=_0x2582e1[_0x2c05('0x8')](_0x3921a0))!=-0x1){_0x3d6e01=_0x2582e1[_0x2c05('0x9')](0x0,_0x344b44);this[_0x2c05('0xe')](_0x2c05('0x10'),_0x3d6e01);_0x2582e1=_0x2582e1['substring'](_0x344b44+_0x3921a0[_0x2c05('0xa')]);}this[_0x2c05('0x5')]=_0x2582e1;}_0x41a498();};module[_0x2c05('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 75ec67a..64a2a3e 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 _0x219f=['CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','client','http','then','error','message','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage'];(function(_0x4a1b7d,_0x353256){var _0x429b4c=function(_0x4c881c){while(--_0x4c881c){_0x4a1b7d['push'](_0x4a1b7d['shift']());}};_0x429b4c(++_0x353256);}(_0x219f,0xf9));var _0xf219=function(_0x1543df,_0x223f34){_0x1543df=_0x1543df-0x0;var _0x84cff4=_0x219f[_0x1543df];return _0x84cff4;};'use strict';var BPromise=require(_0xf219('0x0'));var moment=require(_0xf219('0x1'));var _=require('lodash');var util=require(_0xf219('0x2'));var jayson=require(_0xf219('0x3'));var client=jayson[_0xf219('0x4')][_0xf219('0x5')]({'port':0x2329});function request(_0x1066b0,_0x374a79){return new BPromise(function(_0x26ab55,_0x42cc98){return client['request'](_0x1066b0,_0x374a79)[_0xf219('0x6')](function(_0x14413c){if(_0x14413c[_0xf219('0x7')]){return _0x42cc98(_0x14413c[_0xf219('0x7')][_0xf219('0x8')]);}else{return _0x26ab55(_0x14413c['result']);}})['catch'](function(_0x2ed0e2){return _0x42cc98(_0x2ed0e2);});});}exports[_0xf219('0x9')]=function(_0x238e84){return request(_0xf219('0xa'),{'options':{'raw':![],'where':{'name':_0x238e84},'attributes':['production']}});};exports[_0xf219('0xb')]=function(_0x41b088){return request(_0xf219('0xc'),{'options':{'raw':![],'where':{'id':_0x41b088},'include':[{'model':_0xf219('0xd'),'as':_0xf219('0xe')}],'attributes':['id',_0xf219('0xf'),_0xf219('0x10')]}});};exports[_0xf219('0x11')]=function(_0x151c66){return request(_0xf219('0xa'),{'options':{'where':{'id':_0x151c66},'attributes':[_0xf219('0xf')]}});};exports[_0xf219('0x12')]=function(_0x457b35){return request(_0xf219('0x13'),{'options':{'where':{'id':_0x457b35},'attributes':[_0xf219('0xf')]}});};exports[_0xf219('0x14')]=function(_0x3c6af4){return request(_0xf219('0x15'),{'options':{'where':{'id':_0x3c6af4},'attributes':[_0xf219('0xf')]}});};exports[_0xf219('0x16')]=function(_0x4cb985){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x4cb985},'attributes':[_0xf219('0x17')]}});};exports[_0xf219('0x18')]=function(_0x2af99c){return request(_0xf219('0x19'),{'options':{'where':{'id':_0x2af99c},'attributes':[_0xf219('0xf')]}});};exports['getTrunkById']=function(_0x2a6315){return request(_0xf219('0x1a'),{'options':{'where':{'id':_0x2a6315},'attributes':[_0xf219('0xf')]}});};exports[_0xf219('0x1b')]=function(_0x5756e9){return request('ShowSound',{'options':{'where':{'id':_0x5756e9},'attributes':[_0xf219('0x1c')]}});};exports[_0xf219('0x1d')]=function(_0x13816a){return request(_0xf219('0x1e'),{'options':{'raw':![],'where':{'id':_0x13816a},'include':[{'model':_0xf219('0x1f'),'as':'Intervals'}]}});};exports[_0xf219('0x20')]=function(_0x932d03){return request(_0xf219('0x21'),{'options':{'where':{'id':_0x932d03},'attributes':['id','name']}});};exports[_0xf219('0x22')]=function(_0x400106){return request(_0xf219('0x23'),{'body':_0x400106});};exports['createSquareDetailsReport']=function(_0x2011f8){return request(_0xf219('0x24'),{'body':_0x2011f8});};exports[_0xf219('0x25')]=function(_0x31aa15){return request('CreateSquareReport',{'body':_[_0xf219('0x26')](_0x31aa15,{'project_name':_0x31aa15[_0xf219('0x27')],'prev_project_name':_0x31aa15[_0xf219('0x28')]||'','is_subproject':_0x31aa15[_0xf219('0x28')]?!![]:![],'leaveAt':moment()[_0xf219('0x29')](_0xf219('0x2a'))})});};exports[_0xf219('0x2b')]=function(_0x3340e4){return request(_0xf219('0x2c'),{'body':_0x3340e4});};exports[_0xf219('0x2d')]=function(_0x45e80d){return request('CreateSquareMessage',{'body':_0x45e80d});};exports[_0xf219('0x2e')]=function(_0x570048){return request(_0xf219('0x2f'),{'options':{'raw':![],'where':{'phone':_0x570048[_0xf219('0x30')],'ListId':_0x570048['ListId']}}})['then'](function(_0x460ef8){if(_0x460ef8){return _0x460ef8;}return request('CreateCmContact',{'body':_0x570048});});};exports[_0xf219('0x31')]=function(_0x2b1778){return request(_0xf219('0x32'),{'options':{'where':{'id':_0x2b1778},'attributes':[_0xf219('0xf')]}});};exports['agentLogin']=function(_0x3be718,_0x5ae860){return request(_0xf219('0x33'),{'body':{'interface':_0x5ae860},'options':{'where':_0x3be718}});};exports[_0xf219('0x34')]=function(_0x26713e,_0x1cd4c7,_0x3de3b3){return request(_0xf219('0x35'),{'body':{'type':_0x1cd4c7,'uniqueid':_0x3de3b3},'options':{'where':_0x26713e}});};exports['agentUnpause']=function(_0x177830){return request(_0xf219('0x36'),{'body':{},'options':{'where':_0x177830}});};exports[_0xf219('0x37')]=function(_0x1addbe){return request(_0xf219('0x38'),{'body':{},'options':{'where':_0x1addbe}});}; \ No newline at end of file +var _0xb5a2=['production','getMailAccountById','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','save_name','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','bluebird','moment','lodash','jayson/promise','http','request','error','message','result','catch','ShowSquareProject'];(function(_0x293e67,_0x2038a0){var _0x433a81=function(_0x265a09){while(--_0x265a09){_0x293e67['push'](_0x293e67['shift']());}};_0x433a81(++_0x2038a0);}(_0xb5a2,0x1bd));var _0x2b5a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb5a2[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x2b5a('0x0'));var moment=require(_0x2b5a('0x1'));var _=require(_0x2b5a('0x2'));var util=require('util');var jayson=require(_0x2b5a('0x3'));var client=jayson['client'][_0x2b5a('0x4')]({'port':0x2329});function request(_0x81a646,_0x33267c){return new BPromise(function(_0x2288e7,_0x185e35){return client[_0x2b5a('0x5')](_0x81a646,_0x33267c)['then'](function(_0x2b5417){if(_0x2b5417[_0x2b5a('0x6')]){return _0x185e35(_0x2b5417[_0x2b5a('0x6')][_0x2b5a('0x7')]);}else{return _0x2288e7(_0x2b5417[_0x2b5a('0x8')]);}})[_0x2b5a('0x9')](function(_0x9c3297){return _0x185e35(_0x9c3297);});});}exports['getSquareProject']=function(_0x7f285a){return request(_0x2b5a('0xa'),{'options':{'raw':![],'where':{'name':_0x7f285a},'attributes':[_0x2b5a('0xb')]}});};exports[_0x2b5a('0xc')]=function(_0x25a436){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x25a436},'include':[{'model':_0x2b5a('0xd'),'as':_0x2b5a('0xe')}],'attributes':['id',_0x2b5a('0xf'),'email']}});};exports[_0x2b5a('0x10')]=function(_0x3e8069){return request(_0x2b5a('0xa'),{'options':{'where':{'id':_0x3e8069},'attributes':['name']}});};exports[_0x2b5a('0x11')]=function(_0x184e8f){return request(_0x2b5a('0x12'),{'options':{'where':{'id':_0x184e8f},'attributes':[_0x2b5a('0xf')]}});};exports[_0x2b5a('0x13')]=function(_0x5bd1bc){return request(_0x2b5a('0x14'),{'options':{'where':{'id':_0x5bd1bc},'attributes':[_0x2b5a('0xf')]}});};exports[_0x2b5a('0x15')]=function(_0x28522b){return request(_0x2b5a('0x16'),{'options':{'where':{'id':_0x28522b},'attributes':[_0x2b5a('0x17')]}});};exports[_0x2b5a('0x18')]=function(_0x2ce037){return request(_0x2b5a('0x19'),{'options':{'where':{'id':_0x2ce037},'attributes':[_0x2b5a('0xf')]}});};exports['getTrunkById']=function(_0x21e350){return request(_0x2b5a('0x1a'),{'options':{'where':{'id':_0x21e350},'attributes':[_0x2b5a('0xf')]}});};exports[_0x2b5a('0x1b')]=function(_0x200164){return request('ShowSound',{'options':{'where':{'id':_0x200164},'attributes':[_0x2b5a('0x1c')]}});};exports['getIntervalById']=function(_0x255f62){return request(_0x2b5a('0x1d'),{'options':{'raw':![],'where':{'id':_0x255f62},'include':[{'model':'Interval','as':_0x2b5a('0x1e')}]}});};exports[_0x2b5a('0x1f')]=function(_0x5a061f){return request(_0x2b5a('0x20'),{'options':{'where':{'id':_0x5a061f},'attributes':['id',_0x2b5a('0xf')]}});};exports[_0x2b5a('0x21')]=function(_0x128dd2){return request('CreateSmsMessage',{'body':_0x128dd2});};exports[_0x2b5a('0x22')]=function(_0x222559){return request('CreateSquareDetailsReport',{'body':_0x222559});};exports['createSquareReport']=function(_0x4360e9){return request(_0x2b5a('0x23'),{'body':_[_0x2b5a('0x24')](_0x4360e9,{'project_name':_0x4360e9[_0x2b5a('0x25')],'prev_project_name':_0x4360e9[_0x2b5a('0x26')]||'','is_subproject':_0x4360e9['arg_2']?!![]:![],'leaveAt':moment()[_0x2b5a('0x27')](_0x2b5a('0x28'))})});};exports[_0x2b5a('0x29')]=function(_0x44148d){return request(_0x2b5a('0x2a'),{'body':_0x44148d});};exports[_0x2b5a('0x2b')]=function(_0x48d102){return request(_0x2b5a('0x2c'),{'body':_0x48d102});};exports[_0x2b5a('0x2d')]=function(_0x7568b7){return request(_0x2b5a('0x2e'),{'options':{'raw':![],'where':{'phone':_0x7568b7[_0x2b5a('0x2f')],'ListId':_0x7568b7[_0x2b5a('0x30')]}}})['then'](function(_0x2342d0){if(_0x2342d0){return _0x2342d0;}return request(_0x2b5a('0x31'),{'body':_0x7568b7});});};exports[_0x2b5a('0x32')]=function(_0x10d7b4){return request('ShowPause',{'options':{'where':{'id':_0x10d7b4},'attributes':['name']}});};exports[_0x2b5a('0x33')]=function(_0x58e725,_0x5b2ec8){return request(_0x2b5a('0x34'),{'body':{'interface':_0x5b2ec8},'options':{'where':_0x58e725}});};exports[_0x2b5a('0x35')]=function(_0x4b475d,_0x24c160,_0x356a87){return request(_0x2b5a('0x36'),{'body':{'type':_0x24c160,'uniqueid':_0x356a87},'options':{'where':_0x4b475d}});};exports[_0x2b5a('0x37')]=function(_0x42b8bd){return request('UnpauseUser',{'body':{},'options':{'where':_0x42b8bd}});};exports[_0x2b5a('0x38')]=function(_0xe27d0e){return request('LogoutUser',{'body':{},'options':{'where':_0xe27d0e}});}; \ 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 907a0e4..264e1d9 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 _0xf435=['./lex','exports'];(function(_0x28c1c0,_0x2398aa){var _0x2ff1e3=function(_0x23dfb3){while(--_0x23dfb3){_0x28c1c0['push'](_0x28c1c0['shift']());}};_0x2ff1e3(++_0x2398aa);}(_0xf435,0x174));var _0x5f43=function(_0x4b4e32,_0x17e374){_0x4b4e32=_0x4b4e32-0x0;var _0x291f8b=_0xf435[_0x4b4e32];return _0x291f8b;};var polly=require('./polly');var lex=require(_0x5f43('0x0'));module[_0x5f43('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xc0a4=['exports','./lex'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xc0a4,0x147));var _0x4c0a=function(_0x5781e1,_0x13a9d4){_0x5781e1=_0x5781e1-0x0;var _0x349f2e=_0xc0a4[_0x5781e1];return _0x349f2e;};var polly=require('./polly');var lex=require(_0x4c0a('0x0'));module[_0x4c0a('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 1694d46..677e287 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 _0xe5b5=['exports','./lib/api'];(function(_0x1e63c0,_0x234bab){var _0x1ed2b6=function(_0x91e31f){while(--_0x91e31f){_0x1e63c0['push'](_0x1e63c0['shift']());}};_0x1ed2b6(++_0x234bab);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0xe5b5[_0x49c057];return _0xd8f0e6;};'use strict';var lex=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]=function(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763){return lex(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763);}; \ No newline at end of file +var _0x9348=['exports','./lib/api'];(function(_0x15e286,_0x405fdc){var _0x4d419c=function(_0x2e595b){while(--_0x2e595b){_0x15e286['push'](_0x15e286['shift']());}};_0x4d419c(++_0x405fdc);}(_0x9348,0x10d));var _0x8934=function(_0x453ab0,_0x5a8271){_0x453ab0=_0x453ab0-0x0;var _0x315b43=_0x9348[_0x453ab0];return _0x315b43;};'use strict';var lex=require(_0x8934('0x0'));module[_0x8934('0x1')]=function(_0x472223,_0x135b2c,_0x46a231,_0x4a2577,_0x34d032,_0x35da0b){return lex(_0x472223,_0x135b2c,_0x46a231,_0x4a2577,_0x34d032,_0x35da0b);}; \ 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 4e37eea..a099752 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(_0x1adbfd,_0x281747){var _0x19c754=function(_0x2bf78d){while(--_0x2bf78d){_0x1adbfd['push'](_0x1adbfd['shift']());}};_0x19c754(++_0x281747);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0xc8cc3d,_0x1e557c){var _0x142a7c=function(_0x258bae){while(--_0x258bae){_0xc8cc3d['push'](_0xc8cc3d['shift']());}};_0x142a7c(++_0x1e557c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 e714956..d157c44 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 _0x12bd=['exports','./lib/api'];(function(_0x21b3ab,_0x432c2e){var _0x3d5f1e=function(_0x35fbb0){while(--_0x35fbb0){_0x21b3ab['push'](_0x21b3ab['shift']());}};_0x3d5f1e(++_0x432c2e);}(_0x12bd,0x135));var _0xd12b=function(_0x1b0c8c,_0x486222){_0x1b0c8c=_0x1b0c8c-0x0;var _0x2e67c9=_0x12bd[_0x1b0c8c];return _0x2e67c9;};'use strict';var polly=require(_0xd12b('0x0'));module[_0xd12b('0x1')]=function(_0x592203,_0x32796d,_0x1584d8,_0x112e6e,_0xd290ce,_0x4a70fb,_0x438b45){return polly(_0x592203,_0x32796d,_0x1584d8,_0x112e6e,_0xd290ce,_0x4a70fb,_0x438b45);}; \ No newline at end of file +var _0xd2cb=['./lib/api'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0xd2cb,0xd7));var _0xbd2c=function(_0x298c7b,_0xa15467){_0x298c7b=_0x298c7b-0x0;var _0x4d9584=_0xd2cb[_0x298c7b];return _0x4d9584;};'use strict';var polly=require(_0xbd2c('0x0'));module['exports']=function(_0x4be648,_0x47ecbd,_0x2d4206,_0x674e9,_0x46b81e,_0x3a91d6,_0x43b64b){return polly(_0x4be648,_0x47ecbd,_0x2d4206,_0x674e9,_0x46b81e,_0x3a91d6,_0x43b64b);}; \ 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 f8decbb..9ec4dfb 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 _0x1dc9=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile'];(function(_0x3dabc0,_0x1c0f3e){var _0x5a3550=function(_0x214f57){while(--_0x214f57){_0x3dabc0['push'](_0x3dabc0['shift']());}};_0x5a3550(++_0x1c0f3e);}(_0x1dc9,0x8a));var _0x91dc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1dc9[_0x14add3];return _0x4a174f;};'use strict';var fs=require('fs');var path=require(_0x91dc('0x0'));var BPromise=require(_0x91dc('0x1'));var rs=require(_0x91dc('0x2'));var AWS=require(_0x91dc('0x3'));function pollyResult(_0x1ca601,_0x5d8134,_0x418fb3){return new BPromise(function(_0x4110a0,_0x236ffb){_0x1ca601[_0x91dc('0x4')](_0x5d8134,function(_0x15331c,_0x698171){if(_0x15331c){_0x236ffb(_0x15331c);}else if(_0x698171){if(_0x698171['AudioStream']instanceof Buffer){fs[_0x91dc('0x5')](_0x418fb3,_0x698171['AudioStream'],function(_0x278a4d){if(_0x278a4d){_0x236ffb(_0x278a4d);}else{_0x4110a0();}});}else{_0x236ffb(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x236ffb(new Error(_0x91dc('0x6')));}});});}module[_0x91dc('0x7')]=function(_0x5c907d,_0x41eafd,_0x546100,_0x50248e,_0x3f87bf,_0x1390ca,_0x41f056){var _0x493b72=new AWS['Polly']({'accessKeyId':_0x5c907d,'secretAccessKey':_0x41eafd,'region':_0x546100});var _0x1020a2={'Text':_0x3f87bf,'TextType':_0x1390ca||'text','OutputFormat':_0x91dc('0x8'),'VoiceId':_0x50248e};return pollyResult(_0x493b72,_0x1020a2,_0x41f056);}; \ No newline at end of file +var _0x334f=['aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring'];(function(_0xf12d84,_0x15cc7c){var _0x210154=function(_0x57df16){while(--_0x57df16){_0xf12d84['push'](_0xf12d84['shift']());}};_0x210154(++_0x15cc7c);}(_0x334f,0x106));var _0xf334=function(_0x514547,_0x6f64cb){_0x514547=_0x514547-0x0;var _0x3e9878=_0x334f[_0x514547];return _0x3e9878;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xf334('0x0'));var rs=require(_0xf334('0x1'));var AWS=require(_0xf334('0x2'));function pollyResult(_0x59f699,_0x4c2109,_0x313af8){return new BPromise(function(_0x11220a,_0x26acc6){_0x59f699[_0xf334('0x3')](_0x4c2109,function(_0x241d31,_0x49f0e8){if(_0x241d31){_0x26acc6(_0x241d31);}else if(_0x49f0e8){if(_0x49f0e8[_0xf334('0x4')]instanceof Buffer){fs[_0xf334('0x5')](_0x313af8,_0x49f0e8[_0xf334('0x4')],function(_0x44f780){if(_0x44f780){_0x26acc6(_0x44f780);}else{_0x11220a();}});}else{_0x26acc6(new Error(_0xf334('0x6')));}}else{_0x26acc6(new Error(_0xf334('0x7')));}});});}module[_0xf334('0x8')]=function(_0x4f4d0c,_0x955bba,_0x3aec50,_0x5280be,_0x4df5c8,_0x39adf0,_0x10ffc6){var _0x4ab9f1=new AWS[(_0xf334('0x9'))]({'accessKeyId':_0x4f4d0c,'secretAccessKey':_0x955bba,'region':_0x3aec50});var _0x36485b={'Text':_0x4df5c8,'TextType':_0x39adf0||_0xf334('0xa'),'OutputFormat':_0xf334('0xb'),'VoiceId':_0x5280be};return pollyResult(_0x4ab9f1,_0x36485b,_0x10ffc6);}; \ 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 04a1a8e..bd11236 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 _0x59f7=['./lib/api','exports'];(function(_0x39e730,_0x2cde9a){var _0x311b69=function(_0x416a13){while(--_0x416a13){_0x39e730['push'](_0x39e730['shift']());}};_0x311b69(++_0x2cde9a);}(_0x59f7,0x178));var _0x759f=function(_0x2cab93,_0x10e31c){_0x2cab93=_0x2cab93-0x0;var _0x50de52=_0x59f7[_0x2cab93];return _0x50de52;};'use strict';var asr=require(_0x759f('0x0'));module[_0x759f('0x1')]=function(_0x1a1954,_0x4dbcc5,_0x3a8c06,_0x30e2ff){return asr(_0x1a1954,_0x4dbcc5,_0x3a8c06);}; \ No newline at end of file +var _0xc356=['./lib/api','exports'];(function(_0x490dee,_0xd37e93){var _0x571ef3=function(_0x42b7c7){while(--_0x42b7c7){_0x490dee['push'](_0x490dee['shift']());}};_0x571ef3(++_0xd37e93);}(_0xc356,0xea));var _0x6c35=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0xc356[_0x20fb02];return _0x24a33e;};'use strict';var asr=require(_0x6c35('0x0'));module[_0x6c35('0x1')]=function(_0x13c8b8,_0x4f9142,_0x3ccd61,_0xcb60b0){return asr(_0x13c8b8,_0x4f9142,_0x3ccd61);}; \ 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 65e450d..8aeec34 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 _0x8b7c=['length','key\x20should\x20be\x20a\x20string','undefined','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x8b7c,0x119));var _0xc8b7=function(_0x369a41,_0x5ed95c){_0x369a41=_0x369a41-0x0;var _0x16807d=_0x8b7c[_0x369a41];return _0x16807d;};'use strict';var url=require(_0xc8b7('0x0'));var BPromise=require(_0xc8b7('0x1'));var fs=require('fs');var host=_0xc8b7('0x2');module[_0xc8b7('0x3')]=function(_0x2473cc,_0x47766d,_0x47089d){return new BPromise(function(_0x201c49,_0x4f66ab){var _0x85fa34;if(typeof _0x2473cc!==_0xc8b7('0x4')||_0x2473cc[_0xc8b7('0x5')]===0x0){return _0x4f66ab('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x47766d!==_0xc8b7('0x4')||_0x47766d[_0xc8b7('0x5')]===0x0){return _0x4f66ab(_0xc8b7('0x6'));}if(typeof _0x47089d!==_0xc8b7('0x7')&&(typeof _0x47089d!==_0xc8b7('0x4')||_0x47089d[_0xc8b7('0x5')]===0x0)){return _0x4f66ab('lang\x20should\x20be\x20a\x20string');}try{_0x85fa34=fs[_0xc8b7('0x8')](_0x2473cc)['toString'](_0xc8b7('0x9'));}catch(_0xf69f1f){return _0x4f66ab(_0xf69f1f);}return _0x201c49({'method':_0xc8b7('0xa'),'uri':host+_0xc8b7('0xb')+_0x47766d,'body':{'config':{'encoding':_0xc8b7('0xc'),'sampleRateHertz':'8000','languageCode':_0x47089d},'audio':{'content':_0x85fa34}},'json':!![]});});}; \ No newline at end of file +var _0x9b87=['/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST'];(function(_0x583b80,_0x49ca8c){var _0x590664=function(_0x1db449){while(--_0x1db449){_0x583b80['push'](_0x583b80['shift']());}};_0x590664(++_0x49ca8c);}(_0x9b87,0x8e));var _0x79b8=function(_0x2a770f,_0x4ad83d){_0x2a770f=_0x2a770f-0x0;var _0x5705ec=_0x9b87[_0x2a770f];return _0x5705ec;};'use strict';var url=require(_0x79b8('0x0'));var BPromise=require(_0x79b8('0x1'));var fs=require('fs');var host=_0x79b8('0x2');module[_0x79b8('0x3')]=function(_0x77ad5c,_0x4386a6,_0x23b645){return new BPromise(function(_0xb4e3e7,_0xbc1e74){var _0xa65bbc;if(typeof _0x77ad5c!==_0x79b8('0x4')||_0x77ad5c[_0x79b8('0x5')]===0x0){return _0xbc1e74(_0x79b8('0x6'));}if(typeof _0x4386a6!==_0x79b8('0x4')||_0x4386a6[_0x79b8('0x5')]===0x0){return _0xbc1e74(_0x79b8('0x7'));}if(typeof _0x23b645!=='undefined'&&(typeof _0x23b645!=='string'||_0x23b645['length']===0x0)){return _0xbc1e74('lang\x20should\x20be\x20a\x20string');}try{_0xa65bbc=fs[_0x79b8('0x8')](_0x77ad5c)[_0x79b8('0x9')](_0x79b8('0xa'));}catch(_0x4bc41f){return _0xbc1e74(_0x4bc41f);}return _0xb4e3e7({'method':_0x79b8('0xb'),'uri':host+_0x79b8('0xc')+_0x4386a6,'body':{'config':{'encoding':_0x79b8('0xd'),'sampleRateHertz':'8000','languageCode':_0x23b645},'audio':{'content':_0xa65bbc}},'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 e69668f..80c3a2b 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 _0x2c21=['exports'];(function(_0x25ea6c,_0x497f36){var _0x1ce894=function(_0x370066){while(--_0x370066){_0x25ea6c['push'](_0x25ea6c['shift']());}};_0x1ce894(++_0x497f36);}(_0x2c21,0x1b6));var _0x12c2=function(_0xcd4d8e,_0x1fc2fd){_0xcd4d8e=_0xcd4d8e-0x0;var _0x1c3c61=_0x2c21[_0xcd4d8e];return _0x1c3c61;};var asr=require('./asr');module[_0x12c2('0x0')]={'asr':asr}; \ No newline at end of file +var _0xad7e=['exports','./asr'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0xad7e,0x17d));var _0xead7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad7e[_0x3dd15e];return _0x231fd0;};var asr=require(_0xead7('0x0'));module[_0xead7('0x1')]={'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 5594b9f..6f8ee88 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 _0xe687=['.mp3','writeFile','chmodSync','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','data','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','length','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','lex','ispeechTTS','format','%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','text','channelData','CustomAction','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','sox','google-tts-api','url','parse','util','./sestek','./tilde','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','pipe','end','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','writeFileSync','base64','then','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','MP3','POST','generate'];(function(_0x5a80ef,_0x57d7fa){var _0x40ea9c=function(_0x3d12d0){while(--_0x3d12d0){_0x5a80ef['push'](_0x5a80ef['shift']());}};_0x40ea9c(++_0x57d7fa);}(_0xe687,0x155));var _0x7e68=function(_0x57ee22,_0x11b728){_0x57ee22=_0x57ee22-0x0;var _0x3890b6=_0xe687[_0x57ee22];return _0x3890b6;};'use strict';var apiai=require(_0x7e68('0x0'));var BPromise=require(_0x7e68('0x1'));var dialogflow=require(_0x7e68('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x7e68('0x3'));var md5=require(_0x7e68('0x4'));var path=require(_0x7e68('0x5'));var querystring=require(_0x7e68('0x6'));var rp=require(_0x7e68('0x7'));var rs=require('randomstring');var sox=require(_0x7e68('0x8'));var tts=require(_0x7e68('0x9'));var urlParse=require(_0x7e68('0xa'))[_0x7e68('0xb')];var util=require(_0x7e68('0xc'));var aws=require('./aws');var google=require('./google');var sestek=require(_0x7e68('0xd'));var tilde=require(_0x7e68('0xe'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x7e68('0xf');function downloadFile(_0x3ef5,_0x3a421a){return new BPromise(function(_0x303cae,_0x5966fb){var _0x94bbee=urlParse(_0x3ef5);var _0x5d2656=_0x94bbee[_0x7e68('0x10')]===_0x7e68('0x11')?https:http;var _0x5c8ab8={'host':_0x94bbee[_0x7e68('0x12')],'path':_0x94bbee[_0x7e68('0x5')],'headers':{'user-agent':_0x7e68('0x13')}};_0x5d2656[_0x7e68('0x14')](_0x5c8ab8,function(_0x502b02){if(_0x502b02[_0x7e68('0x15')]!==0xc8){logger['error'](_0x7e68('0x16')+_0x3ef5+_0x7e68('0x17')+_0x502b02['statusCode']+'\x20('+_0x502b02[_0x7e68('0x18')]+')');_0x5966fb(new Error(_0x7e68('0x16')+_0x3ef5+'\x20failed,\x20status\x20code\x20=\x20'+_0x502b02[_0x7e68('0x15')]+'\x20('+_0x502b02[_0x7e68('0x18')]+')'));return;}var _0x9c3169=fs[_0x7e68('0x19')](_0x3a421a);_0x9c3169['on'](_0x7e68('0x1a'),function(){logger[_0x7e68('0x1b')](_0x7e68('0x1c'));_0x9c3169[_0x7e68('0x1d')](_0x303cae);});_0x9c3169['on'](_0x7e68('0x1e'),function(_0x25cf10){fs[_0x7e68('0x1f')](_0x3a421a);logger[_0x7e68('0x1e')]('download\x20error',_0x25cf10);_0x5966fb(_0x25cf10);});_0x502b02[_0x7e68('0x20')](_0x9c3169);})['on'](_0x7e68('0x1e'),function(_0x4f0077){logger[_0x7e68('0x1e')](_0x4f0077);_0x5966fb(_0x4f0077);})['end']();});}function uploadFile(_0x541916){return new BPromise(function(_0x509b93,_0x44ff37){var _0x22d846=urlParse(_0x541916);var _0x305492=_0x22d846['protocol']===_0x7e68('0x11')?https:http;var _0x542666={'host':_0x22d846[_0x7e68('0x12')],'path':_0x22d846[_0x7e68('0x5')],'headers':{'user-agent':_0x7e68('0x13')}};_0x305492[_0x7e68('0x14')](_0x542666,function(_0x1ce207){if(_0x1ce207[_0x7e68('0x15')]!==0xc8){_0x44ff37(new Error('request\x20to\x20'+_0x541916+_0x7e68('0x17')+_0x1ce207['statusCode']+'\x20('+_0x1ce207['statusMessage']+')'));return;}var _0x33e5a7='';_0x1ce207['on']('data',function(_0x500d52){_0x33e5a7+=_0x500d52;});_0x1ce207['on'](_0x7e68('0x21'),function(){_0x509b93(_0x33e5a7);});})['on'](_0x7e68('0x1e'),function(_0x4de3de){_0x44ff37(_0x4de3de);})[_0x7e68('0x21')]();});}function convertFile(_0x7f1617,_0x57746c){return new BPromise(function(_0xd908e6,_0x4ad382){var _0x312ce6=sox['transcode'](_0x7f1617,_0x57746c,{'sampleRate':0x1f40,'format':_0x7e68('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x312ce6['on'](_0x7e68('0x1e'),function(_0x25bfad){logger[_0x7e68('0x1e')](_0x7e68('0x23'),_0x25bfad);_0x4ad382(_0x25bfad);});_0x312ce6['on']('end',function(){logger[_0x7e68('0x1b')](_0x7e68('0x24'));_0xd908e6();});_0x312ce6[_0x7e68('0x25')]();});}function base64Decode(_0x1414c1,_0x5b9884){var _0x54ce1f=path[_0x7e68('0x26')](__dirname,_0x7e68('0x27'),rs['generate'](0x4)+_0x7e68('0x28'));fs[_0x7e68('0x29')](_0x54ce1f,_0x1414c1,_0x7e68('0x2a'));return convertFile(_0x54ce1f,_0x5b9884)[_0x7e68('0x2b')](function(){try{fs[_0x7e68('0x1f')](_0x54ce1f);fs['chmodSync'](_0x5b9884,_0x7e68('0x2c'));}catch(_0x353a8f){logger['error'](_0x353a8f);}return _0x5b9884[_0x7e68('0x2d')]('.')[0x0];});}function base64Encode(_0x56de18){var _0x204cbd=fs[_0x7e68('0x2e')](_0x56de18);return new Buffer(_0x204cbd)['toString'](_0x7e68('0x2a'));}exports[_0x7e68('0x2f')]=function(_0x2579d3,_0x1cce62,_0x17c825,_0xbaf912,_0x40863c,_0x5ed07c){var _0x1c68ff,_0x33555b;var _0x11a278=_0x7e68('0x30');var _0x305475='?key='+_0x2579d3;var _0x1929c8={};if(_0x1cce62===_0x7e68('0x31')){_0x1929c8[_0x7e68('0x32')]={'ssml':_0x17c825};}else{_0x1929c8[_0x7e68('0x32')]={'text':_0x17c825};};_0x1929c8[_0x7e68('0x33')]={'languageCode':_0xbaf912,'ssmlGender':_0x40863c};_0x1929c8['audioConfig']={'audioEncoding':_0x7e68('0x34'),'sampleRateHertz':0x1f40};var _0x543e35={'url':_0x11a278+'text:synthesize'+_0x305475,'method':_0x7e68('0x35'),'json':!![],'body':_0x1929c8};return rp(_0x543e35)['then'](function(_0x244c22){return new BPromise(function(_0x4a11d6,_0xc5727){_0x1c68ff=path[_0x7e68('0x26')](__dirname,'tmp',rs[_0x7e68('0x36')](0x4)+_0x7e68('0x37'));var _0x1729fd=Buffer['from'](_0x244c22['audioContent'],_0x7e68('0x2a'));return fs[_0x7e68('0x38')](_0x1c68ff,_0x1729fd,function(_0x2290f0){_0xc5727(_0x2290f0);},function(_0x1df5ed){fs[_0x7e68('0x39')](_0x1c68ff,_0x7e68('0x2c'));_0x4a11d6(_0x1df5ed);});});})[_0x7e68('0x2b')](function(_0xf13ff9){_0x33555b=path[_0x7e68('0x26')](__dirname,_0x7e68('0x27'),rs[_0x7e68('0x36')](0x4)+_0x7e68('0x28'));return convertFile(_0x1c68ff,_0x33555b);})['then'](function(){try{fs[_0x7e68('0x1f')](_0x1c68ff);fs[_0x7e68('0x39')](_0x33555b,_0x7e68('0x2c'));}catch(_0x1c4f4b){logger[_0x7e68('0x1e')](_0x1c4f4b);}logger['info'](_0x7e68('0x3a'),_0x33555b[_0x7e68('0x2d')]('.')[0x0]);return _0x33555b[_0x7e68('0x2d')]('.')[0x0];});};exports['googleTTS']=function(_0x49b701,_0x279707){var _0x2fe60e=_0x7e68('0x3b');var _0x1d4636,_0x34f587;var _0x4d2ed1;var _0x3ad935={'encoding':_0x7e68('0x3c'),'method':'POST','timeout':0x2710,'url':_0x2fe60e,'headers':{'Content-Type':_0x7e68('0x3d')},'body':'f.req='+encodeURIComponent(JSON[_0x7e68('0x3e')]([[['jQ1olc',JSON[_0x7e68('0x3e')]([_0x49b701,_0x279707||'en',![],'null']),null,_0x7e68('0x3f')]]]))};return rp(_0x3ad935)[_0x7e68('0x2b')](function(_0x5a83c4){try{_0x4d2ed1=eval(_0x5a83c4[_0x7e68('0x40')](0x5))[0x0][0x2];}catch(_0x18d741){throw new Error(_0x7e68('0x41')+_0x5a83c4['data']);}if(!_0x4d2ed1){if(_0x49b701['length']>0xc8){throw new Error(_0x7e68('0x42'));}else{throw new Error(_0x7e68('0x43')+_0x279707+_0x7e68('0x44'));}}try{_0x4d2ed1=eval(_0x4d2ed1)[0x0];}catch(_0x2a7f88){throw new Error(_0x7e68('0x41')+res[_0x7e68('0x45')]);}const _0x5c4fc1=_0x4d2ed1;_0x1d4636=path['resolve'](__dirname,_0x7e68('0x27'),rs[_0x7e68('0x36')](0x4)+_0x7e68('0x37'));fs[_0x7e68('0x29')](_0x1d4636,_0x4d2ed1,{'encoding':_0x7e68('0x2a')});_0x34f587=path['resolve'](__dirname,_0x7e68('0x27'),rs[_0x7e68('0x36')](0x4)+_0x7e68('0x28'));return convertFile(_0x1d4636,_0x34f587);})[_0x7e68('0x2b')](function(){try{fs['unlink'](_0x1d4636);fs['chmodSync'](_0x34f587,'777');}catch(_0x30b583){logger[_0x7e68('0x1e')](_0x30b583);}logger[_0x7e68('0x1b')]('goggleTTS\x20path',_0x34f587[_0x7e68('0x2d')]('.')[0x0]);return _0x34f587[_0x7e68('0x2d')]('.')[0x0];});};exports[_0x7e68('0x46')]=function(_0x175ca0,_0x4afbc0,_0x409a9f){return google[_0x7e68('0x47')](_0x175ca0,_0x4afbc0,_0x409a9f)[_0x7e68('0x2b')](function(_0x49a482){logger[_0x7e68('0x1b')](_0x49a482[_0x7e68('0x48')]);return rp(_0x49a482);})['then'](function(_0x1f921d){var _0x14b859='';var _0x306bee=0x0;try{fs[_0x7e68('0x1f')](_0x175ca0);}catch(_0x1ccfbc){logger[_0x7e68('0x1e')](_0x1ccfbc);}if(_0x1f921d&&_0x1f921d[_0x7e68('0x49')]){_0x14b859=_0x1f921d[_0x7e68('0x49')]['map'](function(_0x3c5034){return _0x3c5034&&_0x3c5034['alternatives'][0x0]&&_0x3c5034[_0x7e68('0x4a')][0x0][_0x7e68('0x4b')]?_0x3c5034['alternatives'][0x0]['transcript']:'';})[_0x7e68('0x4c')]('\x0a');_0x306bee=_0x1f921d[_0x7e68('0x49')]['map'](function(_0x116e65){return _0x116e65&&_0x116e65[_0x7e68('0x4a')][0x0]&&_0x116e65['alternatives'][0x0]['confidence']?_0x116e65[_0x7e68('0x4a')][0x0][_0x7e68('0x4d')]:0x0;})[_0x7e68('0x4c')]('\x0a');}logger[_0x7e68('0x1b')](_0x7e68('0x4e'),_0x14b859);logger[_0x7e68('0x1b')](_0x7e68('0x4f'),_0x306bee);return{'transcript':_0x14b859,'confidence':_0x306bee};})[_0x7e68('0x50')](function(_0x1ccf95){logger[_0x7e68('0x1e')]('[%s]\x20%s:%s',_0x1ccf95[_0x7e68('0x15')],_0x1ccf95[_0x7e68('0x51')],_0x1ccf95[_0x7e68('0x52')]);});};exports[_0x7e68('0x53')]=function(_0x6bc28a,_0x46c51a,_0x3a0bf9,_0x1a32b4){var _0x4735f8=apiai(_0x46c51a,{'language':_0x1a32b4||'en'});return _0x4735f8[_0x7e68('0x54')](_0x3a0bf9,{'sessionId':md5(_0x6bc28a)})[_0x7e68('0x2b')](function(_0x12914e){logger[_0x7e68('0x1b')](JSON['stringify'](_0x12914e));return{'source':_0x12914e[_0x7e68('0x55')][_0x7e68('0x56')],'resolvedQuery':_0x12914e[_0x7e68('0x55')][_0x7e68('0x57')],'action':_0x12914e[_0x7e68('0x55')][_0x7e68('0x58')],'actionIncomplete':_0x12914e[_0x7e68('0x55')]['actionIncomplete'],'speech':_0x12914e['result']['fulfillment'][_0x7e68('0x59')],'score':_0x12914e[_0x7e68('0x55')][_0x7e68('0x5a')],'statusCode':_0x12914e[_0x7e68('0x5b')][_0x7e68('0x5c')],'endConversation':_0x12914e[_0x7e68('0x55')][_0x7e68('0x5d')]['endConversation']||![],'isFallbackIntent':_0x12914e[_0x7e68('0x55')][_0x7e68('0x5d')][_0x7e68('0x5e')]};});};exports[_0x7e68('0x5f')]=function(_0x39b05a,_0x5692e9,_0x4c7f9a,_0x3f93ac,_0x4093c7,_0x3be8a1){var _0x4614c8=_0x3f93ac['replace'](/\\n/g,'\x0a');var _0x22282e={'credentials':{'private_key':_0x4614c8,'client_email':_0x4c7f9a}};var _0x194e25=new dialogflow[(_0x7e68('0x60'))](_0x22282e);var _0x1912dd=_0x194e25[_0x7e68('0x61')](_0x5692e9,md5(_0x39b05a));var _0xf71e21={'session':_0x1912dd,'queryInput':{'text':{'text':_0x4093c7,'languageCode':_0x3be8a1}}};return _0x194e25[_0x7e68('0x62')](_0xf71e21)[_0x7e68('0x2b')](function(_0x592dfd){if(_0x592dfd&&_0x592dfd[_0x7e68('0x63')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x7e68('0x3e')](_0x592dfd));var _0xd7f4d1=_0x592dfd[0x0];if(_0xd7f4d1){var _0x2c3159={'action':_0xd7f4d1[_0x7e68('0x64')][_0x7e68('0x58')],'allRequiredParamsPresent':_0xd7f4d1['queryResult'][_0x7e68('0x65')],'endConversation':_0xd7f4d1[_0x7e68('0x64')]['diagnosticInfo']&&_0xd7f4d1[_0x7e68('0x64')][_0x7e68('0x66')][_0x7e68('0x67')]?_0xd7f4d1[_0x7e68('0x64')][_0x7e68('0x66')][_0x7e68('0x67')][_0x7e68('0x68')][_0x7e68('0x69')]:![],'fulfillmentText':_0xd7f4d1[_0x7e68('0x64')][_0x7e68('0x6a')],'intentName':_0xd7f4d1[_0x7e68('0x64')][_0x7e68('0x6b')][_0x7e68('0x51')],'intentDisplayName':_0xd7f4d1[_0x7e68('0x64')][_0x7e68('0x6b')][_0x7e68('0x6c')],'isFallbackIntent':_0xd7f4d1[_0x7e68('0x64')][_0x7e68('0x6b')][_0x7e68('0x6d')],'languageCode':_0xd7f4d1[_0x7e68('0x64')]['languageCode'],'queryText':_0xd7f4d1[_0x7e68('0x64')]['queryText'],'responseId':_0xd7f4d1[_0x7e68('0x6e')],'score':_0xd7f4d1[_0x7e68('0x64')][_0x7e68('0x6f')],'speech':_0xd7f4d1[_0x7e68('0x64')][_0x7e68('0x6a')],'providerResponse':JSON[_0x7e68('0x3e')](_0x592dfd)};return _0x2c3159;}}});};exports[_0x7e68('0x70')]=function(_0x458215,_0x972ea3,_0x262675,_0x5f18d9){return tilde[_0x7e68('0x47')](_0x458215,_0x972ea3,_0x262675,_0x5f18d9)[_0x7e68('0x2b')](function(_0x37688d){try{fs[_0x7e68('0x1f')](_0x458215);}catch(_0x2fd016){logger['error'](_0x2fd016);}logger[_0x7e68('0x1b')](_0x7e68('0x71'),_0x37688d[_0x7e68('0x4b')]);logger[_0x7e68('0x1b')](_0x7e68('0x72'),_0x37688d[_0x7e68('0x4d')]);return _0x37688d;});};exports['awsPolly']=function(_0x1b9320,_0x52ec07,_0x28aaf1,_0x57bdf5,_0x1a77e1,_0x2ab95c){var _0x1a3073=path[_0x7e68('0x26')](__dirname,_0x7e68('0x27'),rs[_0x7e68('0x36')](0x4)+_0x7e68('0x37'));var _0x2cb317;return aws[_0x7e68('0x73')](_0x1b9320,_0x52ec07,_0x28aaf1,_0x57bdf5,_0x1a77e1,_0x2ab95c,_0x1a3073)[_0x7e68('0x2b')](function(){_0x2cb317=path[_0x7e68('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x7e68('0x28'));return convertFile(_0x1a3073,_0x2cb317);})[_0x7e68('0x2b')](function(){try{fs['unlink'](_0x1a3073);fs[_0x7e68('0x39')](_0x2cb317,_0x7e68('0x2c'));}catch(_0x4187cb){logger['error'](_0x4187cb);}return _0x2cb317[_0x7e68('0x2d')]('.')[0x0];});};exports['awsLex']=function(_0x436389,_0x2d3777,_0x266548,_0x2cdb67,_0x498fbe,_0x2db358){return aws[_0x7e68('0x74')](_0x436389,_0x2d3777,_0x266548,_0x2cdb67,_0x498fbe,_0x2db358)[_0x7e68('0x2b')](function(_0x530cc7){logger[_0x7e68('0x1b')](JSON[_0x7e68('0x3e')](_0x530cc7));return _0x530cc7;});};exports[_0x7e68('0x75')]=function(_0x34b8b5,_0x2d8826,_0x157c4c,_0x5880f6){var _0x32ea28=util[_0x7e68('0x76')](_0x7e68('0x77'),ISPEECH_API,_0x34b8b5,encodeURIComponent(_0x2d8826),_0x157c4c,_0x5880f6);var _0x370e46=path['resolve'](__dirname,_0x7e68('0x27'),rs[_0x7e68('0x36')](0x4)+_0x7e68('0x37'));var _0x3b3aac;return downloadFile(_0x32ea28,_0x370e46)[_0x7e68('0x2b')](function(){_0x3b3aac=path[_0x7e68('0x26')](__dirname,_0x7e68('0x27'),rs[_0x7e68('0x36')](0x4)+'.wav');return convertFile(_0x370e46,_0x3b3aac);})[_0x7e68('0x2b')](function(){try{fs['unlink'](_0x370e46);fs['chmodSync'](_0x3b3aac,_0x7e68('0x2c'));}catch(_0x54fdb8){logger[_0x7e68('0x1e')](_0x54fdb8);}return _0x3b3aac[_0x7e68('0x2d')]('.')[0x0];});};exports[_0x7e68('0x78')]=function(_0x1af98d,_0x11f10e,_0x3bedde,_0x1dbaa2){var _0x2f9d41=util[_0x7e68('0x76')](_0x7e68('0x79'),ISPEECH_API,_0x11f10e,_0x3bedde,base64Encode(_0x1af98d),_0x1dbaa2?util['format'](_0x7e68('0x7a'),encodeURIComponent(_0x1dbaa2)):_0x7e68('0x7b'));return uploadFile(_0x2f9d41)[_0x7e68('0x2b')](function(_0xb95e5c){return querystring[_0x7e68('0xb')](_0xb95e5c);});};exports[_0x7e68('0x7c')]=function(_0x3299ca,_0x5be174){return sestek[_0x7e68('0x7d')](_0x3299ca,_0x5be174)[_0x7e68('0x2b')](function(_0x3600a2){logger[_0x7e68('0x1b')](JSON[_0x7e68('0x3e')](_0x3600a2));var _0x4eade8={'speech':_0x3600a2[_0x7e68('0x7e')],'action':_0x3600a2['channelData']?_0x3600a2[_0x7e68('0x7f')][_0x7e68('0x80')]:undefined,'actiondata':_0x3600a2[_0x7e68('0x7f')]?_0x3600a2[_0x7e68('0x7f')]['CustomActionData']:undefined};if(_0x3600a2['channelData']&&_0x3600a2[_0x7e68('0x7f')]['AudioFromTts']){return base64Decode(_0x3600a2['channelData'][_0x7e68('0x81')][_0x7e68('0x82')],path[_0x7e68('0x26')](__dirname,_0x7e68('0x27'),rs['generate'](0x4)+_0x7e68('0x28')))[_0x7e68('0x2b')](function(_0x4771f7){_0x4eade8[_0x7e68('0x83')]=_0x4771f7;return _0x4eade8;});}return _0x4eade8;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x9ca1=['split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','voice','audioConfig','MP3','text:synthesize','POST','.mp3','audioContent','writeFile','777','then','generate','googleTTS','utf8','f.req=','stringify','null','generic','slice','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','fulfillment','status','code','metadata','isFallbackIntent','googleDialogflowV2','SessionsClient','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','http','md5','path','querystring','request-promise','randomstring','google-tts-api','url','parse','util','./aws','./google','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','unlink','pipe','end','protocol','data','transcode','wav','error\x20convert','start','resolve','tmp','.wav','writeFileSync','base64','chmodSync'];(function(_0x39fb09,_0x4f0fc6){var _0x31aa84=function(_0x45312a){while(--_0x45312a){_0x39fb09['push'](_0x39fb09['shift']());}};_0x31aa84(++_0x4f0fc6);}(_0x9ca1,0x1e0));var _0x19ca=function(_0x45b4ff,_0x3cd2a2){_0x45b4ff=_0x45b4ff-0x0;var _0x3750be=_0x9ca1[_0x45b4ff];return _0x3750be;};'use strict';var apiai=require(_0x19ca('0x0'));var BPromise=require(_0x19ca('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x19ca('0x2'));var https=require('https');var md5=require(_0x19ca('0x3'));var path=require(_0x19ca('0x4'));var querystring=require(_0x19ca('0x5'));var rp=require(_0x19ca('0x6'));var rs=require(_0x19ca('0x7'));var sox=require('sox');var tts=require(_0x19ca('0x8'));var urlParse=require(_0x19ca('0x9'))[_0x19ca('0xa')];var util=require(_0x19ca('0xb'));var aws=require(_0x19ca('0xc'));var google=require(_0x19ca('0xd'));var sestek=require('./sestek');var tilde=require(_0x19ca('0xe'));var logger=require(_0x19ca('0xf'))('agi');var ISPEECH_API=_0x19ca('0x10');function downloadFile(_0x230f85,_0x3604aa){return new BPromise(function(_0x51d7d2,_0x51430a){var _0x332516=urlParse(_0x230f85);var _0x5d450b=_0x332516['protocol']===_0x19ca('0x11')?https:http;var _0x56e3ad={'host':_0x332516[_0x19ca('0x12')],'path':_0x332516[_0x19ca('0x4')],'headers':{'user-agent':_0x19ca('0x13')}};_0x5d450b[_0x19ca('0x14')](_0x56e3ad,function(_0x1e9035){if(_0x1e9035[_0x19ca('0x15')]!==0xc8){logger[_0x19ca('0x16')](_0x19ca('0x17')+_0x230f85+_0x19ca('0x18')+_0x1e9035[_0x19ca('0x15')]+'\x20('+_0x1e9035[_0x19ca('0x19')]+')');_0x51430a(new Error(_0x19ca('0x17')+_0x230f85+_0x19ca('0x18')+_0x1e9035[_0x19ca('0x15')]+'\x20('+_0x1e9035['statusMessage']+')'));return;}var _0x297dbd=fs['createWriteStream'](_0x3604aa);_0x297dbd['on'](_0x19ca('0x1a'),function(){logger[_0x19ca('0x1b')](_0x19ca('0x1c'));_0x297dbd['close'](_0x51d7d2);});_0x297dbd['on'](_0x19ca('0x16'),function(_0xfd8c5f){fs[_0x19ca('0x1d')](_0x3604aa);logger[_0x19ca('0x16')]('download\x20error',_0xfd8c5f);_0x51430a(_0xfd8c5f);});_0x1e9035[_0x19ca('0x1e')](_0x297dbd);})['on'](_0x19ca('0x16'),function(_0x10464b){logger[_0x19ca('0x16')](_0x10464b);_0x51430a(_0x10464b);})[_0x19ca('0x1f')]();});}function uploadFile(_0x29f589){return new BPromise(function(_0x1ebccf,_0x1ddb71){var _0x87ae12=urlParse(_0x29f589);var _0x548c24=_0x87ae12[_0x19ca('0x20')]===_0x19ca('0x11')?https:http;var _0x259d3a={'host':_0x87ae12[_0x19ca('0x12')],'path':_0x87ae12[_0x19ca('0x4')],'headers':{'user-agent':_0x19ca('0x13')}};_0x548c24[_0x19ca('0x14')](_0x259d3a,function(_0x30c514){if(_0x30c514['statusCode']!==0xc8){_0x1ddb71(new Error(_0x19ca('0x17')+_0x29f589+_0x19ca('0x18')+_0x30c514[_0x19ca('0x15')]+'\x20('+_0x30c514[_0x19ca('0x19')]+')'));return;}var _0x54588e='';_0x30c514['on'](_0x19ca('0x21'),function(_0x27948d){_0x54588e+=_0x27948d;});_0x30c514['on'](_0x19ca('0x1f'),function(){_0x1ebccf(_0x54588e);});})['on'](_0x19ca('0x16'),function(_0x3849a2){_0x1ddb71(_0x3849a2);})[_0x19ca('0x1f')]();});}function convertFile(_0x4e01e9,_0x147495){return new BPromise(function(_0x20fe13,_0x25cfe3){var _0x3c9326=sox[_0x19ca('0x22')](_0x4e01e9,_0x147495,{'sampleRate':0x1f40,'format':_0x19ca('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3c9326['on'](_0x19ca('0x16'),function(_0x2bf26e){logger[_0x19ca('0x16')](_0x19ca('0x24'),_0x2bf26e);_0x25cfe3(_0x2bf26e);});_0x3c9326['on'](_0x19ca('0x1f'),function(){logger[_0x19ca('0x1b')]('finish\x20to\x20convert');_0x20fe13();});_0x3c9326[_0x19ca('0x25')]();});}function base64Decode(_0x13ccb1,_0x2963f8){var _0xd78aca=path[_0x19ca('0x26')](__dirname,_0x19ca('0x27'),rs['generate'](0x4)+_0x19ca('0x28'));fs[_0x19ca('0x29')](_0xd78aca,_0x13ccb1,_0x19ca('0x2a'));return convertFile(_0xd78aca,_0x2963f8)['then'](function(){try{fs['unlink'](_0xd78aca);fs[_0x19ca('0x2b')](_0x2963f8,'777');}catch(_0x2bb7c3){logger[_0x19ca('0x16')](_0x2bb7c3);}return _0x2963f8[_0x19ca('0x2c')]('.')[0x0];});}function base64Encode(_0x164af5){var _0x51c645=fs['readFileSync'](_0x164af5);return new Buffer(_0x51c645)[_0x19ca('0x2d')]('base64');}exports[_0x19ca('0x2e')]=function(_0x1e4a26,_0x23cc87,_0x36411c,_0x482add,_0x178d7b,_0x4f840f){var _0xb87eda,_0x5b77d9;var _0x47cc38=_0x19ca('0x2f');var _0x4bbb1f=_0x19ca('0x30')+_0x1e4a26;var _0x12f14f={};if(_0x23cc87===_0x19ca('0x31')){_0x12f14f['input']={'ssml':_0x36411c};}else{_0x12f14f['input']={'text':_0x36411c};};_0x12f14f[_0x19ca('0x32')]={'languageCode':_0x482add,'ssmlGender':_0x178d7b};_0x12f14f[_0x19ca('0x33')]={'audioEncoding':_0x19ca('0x34'),'sampleRateHertz':0x1f40};var _0x485558={'url':_0x47cc38+_0x19ca('0x35')+_0x4bbb1f,'method':_0x19ca('0x36'),'json':!![],'body':_0x12f14f};return rp(_0x485558)['then'](function(_0x3c1c91){return new BPromise(function(_0x348d19,_0x2c6e79){_0xb87eda=path[_0x19ca('0x26')](__dirname,_0x19ca('0x27'),rs['generate'](0x4)+_0x19ca('0x37'));var _0x487415=Buffer['from'](_0x3c1c91[_0x19ca('0x38')],_0x19ca('0x2a'));return fs[_0x19ca('0x39')](_0xb87eda,_0x487415,function(_0x14a391){_0x2c6e79(_0x14a391);},function(_0x889dae){fs[_0x19ca('0x2b')](_0xb87eda,_0x19ca('0x3a'));_0x348d19(_0x889dae);});});})[_0x19ca('0x3b')](function(_0x53f52f){_0x5b77d9=path['resolve'](__dirname,_0x19ca('0x27'),rs[_0x19ca('0x3c')](0x4)+_0x19ca('0x28'));return convertFile(_0xb87eda,_0x5b77d9);})[_0x19ca('0x3b')](function(){try{fs[_0x19ca('0x1d')](_0xb87eda);fs['chmodSync'](_0x5b77d9,_0x19ca('0x3a'));}catch(_0xd00d48){logger['error'](_0xd00d48);}logger[_0x19ca('0x1b')]('googleCloudTTS\x20path',_0x5b77d9[_0x19ca('0x2c')]('.')[0x0]);return _0x5b77d9[_0x19ca('0x2c')]('.')[0x0];});};exports[_0x19ca('0x3d')]=function(_0x2948e6,_0x46ea5b){var _0xab0459='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x589d8e,_0x66f3db;var _0x2d286d;var _0x4432b7={'encoding':_0x19ca('0x3e'),'method':_0x19ca('0x36'),'timeout':0x2710,'url':_0xab0459,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x19ca('0x3f')+encodeURIComponent(JSON[_0x19ca('0x40')]([[['jQ1olc',JSON[_0x19ca('0x40')]([_0x2948e6,_0x46ea5b||'en',![],_0x19ca('0x41')]),null,_0x19ca('0x42')]]]))};return rp(_0x4432b7)[_0x19ca('0x3b')](function(_0x44f752){try{_0x2d286d=eval(_0x44f752[_0x19ca('0x43')](0x5))[0x0][0x2];}catch(_0x3ae04d){throw new Error('parse\x20response\x20failed:\x0a'+_0x44f752[_0x19ca('0x21')]);}if(!_0x2d286d){if(_0x2948e6[_0x19ca('0x44')]>0xc8){throw new Error(_0x19ca('0x45'));}else{throw new Error('lang\x20\x22'+_0x46ea5b+_0x19ca('0x46'));}}try{_0x2d286d=eval(_0x2d286d)[0x0];}catch(_0x2e11de){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x4e131d=_0x2d286d;_0x589d8e=path['resolve'](__dirname,_0x19ca('0x27'),rs['generate'](0x4)+'.mp3');fs[_0x19ca('0x29')](_0x589d8e,_0x2d286d,{'encoding':_0x19ca('0x2a')});_0x66f3db=path[_0x19ca('0x26')](__dirname,'tmp',rs[_0x19ca('0x3c')](0x4)+_0x19ca('0x28'));return convertFile(_0x589d8e,_0x66f3db);})[_0x19ca('0x3b')](function(){try{fs[_0x19ca('0x1d')](_0x589d8e);fs[_0x19ca('0x2b')](_0x66f3db,_0x19ca('0x3a'));}catch(_0x2cedbd){logger['error'](_0x2cedbd);}logger[_0x19ca('0x1b')](_0x19ca('0x47'),_0x66f3db[_0x19ca('0x2c')]('.')[0x0]);return _0x66f3db[_0x19ca('0x2c')]('.')[0x0];});};exports[_0x19ca('0x48')]=function(_0xf53e89,_0x448eb7,_0x1dbcb6){return google[_0x19ca('0x49')](_0xf53e89,_0x448eb7,_0x1dbcb6)['then'](function(_0x52850a){logger['info'](_0x52850a['uri']);return rp(_0x52850a);})[_0x19ca('0x3b')](function(_0x303117){var _0x5b331e='';var _0x5d0e72=0x0;try{fs[_0x19ca('0x1d')](_0xf53e89);}catch(_0x312701){logger[_0x19ca('0x16')](_0x312701);}if(_0x303117&&_0x303117[_0x19ca('0x4a')]){_0x5b331e=_0x303117[_0x19ca('0x4a')][_0x19ca('0x4b')](function(_0x10c00a){return _0x10c00a&&_0x10c00a['alternatives'][0x0]&&_0x10c00a[_0x19ca('0x4c')][0x0][_0x19ca('0x4d')]?_0x10c00a[_0x19ca('0x4c')][0x0]['transcript']:'';})['join']('\x0a');_0x5d0e72=_0x303117[_0x19ca('0x4a')][_0x19ca('0x4b')](function(_0x2007a9){return _0x2007a9&&_0x2007a9[_0x19ca('0x4c')][0x0]&&_0x2007a9[_0x19ca('0x4c')][0x0][_0x19ca('0x4e')]?_0x2007a9['alternatives'][0x0][_0x19ca('0x4e')]:0x0;})[_0x19ca('0x4f')]('\x0a');}logger[_0x19ca('0x1b')]('googleASR\x20transcription',_0x5b331e);logger[_0x19ca('0x1b')](_0x19ca('0x50'),_0x5d0e72);return{'transcript':_0x5b331e,'confidence':_0x5d0e72};})[_0x19ca('0x51')](function(_0x2af773){logger[_0x19ca('0x16')](_0x19ca('0x52'),_0x2af773[_0x19ca('0x15')],_0x2af773[_0x19ca('0x53')],_0x2af773[_0x19ca('0x54')]);});};exports[_0x19ca('0x55')]=function(_0x3ec7de,_0x32a667,_0x57feda,_0x46b6ac){var _0xef1e6f=apiai(_0x32a667,{'language':_0x46b6ac||'en'});return _0xef1e6f[_0x19ca('0x56')](_0x57feda,{'sessionId':md5(_0x3ec7de)})[_0x19ca('0x3b')](function(_0x14ef37){logger[_0x19ca('0x1b')](JSON[_0x19ca('0x40')](_0x14ef37));return{'source':_0x14ef37[_0x19ca('0x57')]['source'],'resolvedQuery':_0x14ef37[_0x19ca('0x57')][_0x19ca('0x58')],'action':_0x14ef37['result']['action'],'actionIncomplete':_0x14ef37[_0x19ca('0x57')]['actionIncomplete'],'speech':_0x14ef37[_0x19ca('0x57')][_0x19ca('0x59')]['speech'],'score':_0x14ef37['result']['score'],'statusCode':_0x14ef37[_0x19ca('0x5a')][_0x19ca('0x5b')],'endConversation':_0x14ef37['result'][_0x19ca('0x5c')]['endConversation']||![],'isFallbackIntent':_0x14ef37[_0x19ca('0x57')][_0x19ca('0x5c')][_0x19ca('0x5d')]};});};exports[_0x19ca('0x5e')]=function(_0x50a7ac,_0x203df2,_0x311970,_0x49516b,_0x351671,_0x18426d){var _0x437a70=_0x49516b['replace'](/\\n/g,'\x0a');var _0x1d397f={'credentials':{'private_key':_0x437a70,'client_email':_0x311970}};var _0x94e905=new dialogflow[(_0x19ca('0x5f'))](_0x1d397f);var _0x16c4ca=_0x94e905['sessionPath'](_0x203df2,md5(_0x50a7ac));var _0x2114d0={'session':_0x16c4ca,'queryInput':{'text':{'text':_0x351671,'languageCode':_0x18426d}}};return _0x94e905['detectIntent'](_0x2114d0)['then'](function(_0x170465){if(_0x170465&&_0x170465[_0x19ca('0x44')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x19ca('0x40')](_0x170465));var _0x1d534a=_0x170465[0x0];if(_0x1d534a){var _0x1b7254={'action':_0x1d534a[_0x19ca('0x60')][_0x19ca('0x61')],'allRequiredParamsPresent':_0x1d534a[_0x19ca('0x60')][_0x19ca('0x62')],'endConversation':_0x1d534a[_0x19ca('0x60')][_0x19ca('0x63')]&&_0x1d534a[_0x19ca('0x60')][_0x19ca('0x63')][_0x19ca('0x64')]?_0x1d534a['queryResult']['diagnosticInfo'][_0x19ca('0x64')][_0x19ca('0x65')][_0x19ca('0x66')]:![],'fulfillmentText':_0x1d534a['queryResult'][_0x19ca('0x67')],'intentName':_0x1d534a[_0x19ca('0x60')][_0x19ca('0x68')][_0x19ca('0x53')],'intentDisplayName':_0x1d534a['queryResult'][_0x19ca('0x68')][_0x19ca('0x69')],'isFallbackIntent':_0x1d534a[_0x19ca('0x60')][_0x19ca('0x68')][_0x19ca('0x6a')],'languageCode':_0x1d534a['queryResult'][_0x19ca('0x6b')],'queryText':_0x1d534a[_0x19ca('0x60')][_0x19ca('0x6c')],'responseId':_0x1d534a[_0x19ca('0x6d')],'score':_0x1d534a[_0x19ca('0x60')][_0x19ca('0x6e')],'speech':_0x1d534a[_0x19ca('0x60')][_0x19ca('0x67')],'providerResponse':JSON['stringify'](_0x170465)};return _0x1b7254;}}});};exports[_0x19ca('0x6f')]=function(_0x2eb0fc,_0x5944a1,_0x21f1f7,_0x2bc88c){return tilde['asr'](_0x2eb0fc,_0x5944a1,_0x21f1f7,_0x2bc88c)[_0x19ca('0x3b')](function(_0x40c4c1){try{fs[_0x19ca('0x1d')](_0x2eb0fc);}catch(_0x41b3c0){logger[_0x19ca('0x16')](_0x41b3c0);}logger[_0x19ca('0x1b')](_0x19ca('0x70'),_0x40c4c1[_0x19ca('0x4d')]);logger[_0x19ca('0x1b')](_0x19ca('0x71'),_0x40c4c1[_0x19ca('0x4e')]);return _0x40c4c1;});};exports['awsPolly']=function(_0x25fec2,_0xe6ceec,_0x6ad3b9,_0x13e3c4,_0x540f61,_0x23fdb2){var _0x1ae51a=path['resolve'](__dirname,'tmp',rs[_0x19ca('0x3c')](0x4)+_0x19ca('0x37'));var _0x542b59;return aws[_0x19ca('0x72')](_0x25fec2,_0xe6ceec,_0x6ad3b9,_0x13e3c4,_0x540f61,_0x23fdb2,_0x1ae51a)[_0x19ca('0x3b')](function(){_0x542b59=path[_0x19ca('0x26')](__dirname,_0x19ca('0x27'),rs[_0x19ca('0x3c')](0x4)+_0x19ca('0x28'));return convertFile(_0x1ae51a,_0x542b59);})[_0x19ca('0x3b')](function(){try{fs['unlink'](_0x1ae51a);fs[_0x19ca('0x2b')](_0x542b59,'777');}catch(_0x4ee216){logger[_0x19ca('0x16')](_0x4ee216);}return _0x542b59[_0x19ca('0x2c')]('.')[0x0];});};exports[_0x19ca('0x73')]=function(_0x4ff0b7,_0x423c13,_0x18479f,_0x16db01,_0x545b3c,_0x584c42){return aws[_0x19ca('0x74')](_0x4ff0b7,_0x423c13,_0x18479f,_0x16db01,_0x545b3c,_0x584c42)[_0x19ca('0x3b')](function(_0x3dd7f4){logger['info'](JSON[_0x19ca('0x40')](_0x3dd7f4));return _0x3dd7f4;});};exports[_0x19ca('0x75')]=function(_0x12c2ce,_0x593c71,_0x3a63d4,_0xdafb7d){var _0x7bcec7=util[_0x19ca('0x76')](_0x19ca('0x77'),ISPEECH_API,_0x12c2ce,encodeURIComponent(_0x593c71),_0x3a63d4,_0xdafb7d);var _0x23a95a=path['resolve'](__dirname,'tmp',rs[_0x19ca('0x3c')](0x4)+'.mp3');var _0x19158e;return downloadFile(_0x7bcec7,_0x23a95a)[_0x19ca('0x3b')](function(){_0x19158e=path[_0x19ca('0x26')](__dirname,_0x19ca('0x27'),rs[_0x19ca('0x3c')](0x4)+_0x19ca('0x28'));return convertFile(_0x23a95a,_0x19158e);})[_0x19ca('0x3b')](function(){try{fs[_0x19ca('0x1d')](_0x23a95a);fs[_0x19ca('0x2b')](_0x19158e,_0x19ca('0x3a'));}catch(_0x546083){logger[_0x19ca('0x16')](_0x546083);}return _0x19158e[_0x19ca('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x59a14a,_0x9c1d58,_0x5c0ed2,_0x30cf60){var _0x531764=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x9c1d58,_0x5c0ed2,base64Encode(_0x59a14a),_0x30cf60?util['format'](_0x19ca('0x78'),encodeURIComponent(_0x30cf60)):_0x19ca('0x79'));return uploadFile(_0x531764)[_0x19ca('0x3b')](function(_0x184d42){return querystring[_0x19ca('0xa')](_0x184d42);});};exports[_0x19ca('0x7a')]=function(_0x4cfbfd,_0x19f75f){return sestek[_0x19ca('0x7b')](_0x4cfbfd,_0x19f75f)[_0x19ca('0x3b')](function(_0x578d2a){logger[_0x19ca('0x1b')](JSON[_0x19ca('0x40')](_0x578d2a));var _0x1a0f6d={'speech':_0x578d2a[_0x19ca('0x7c')],'action':_0x578d2a[_0x19ca('0x7d')]?_0x578d2a[_0x19ca('0x7d')][_0x19ca('0x7e')]:undefined,'actiondata':_0x578d2a[_0x19ca('0x7d')]?_0x578d2a[_0x19ca('0x7d')][_0x19ca('0x7f')]:undefined};if(_0x578d2a[_0x19ca('0x7d')]&&_0x578d2a['channelData'][_0x19ca('0x80')]){return base64Decode(_0x578d2a['channelData'][_0x19ca('0x80')]['Data'],path[_0x19ca('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x19ca('0x28')))[_0x19ca('0x3b')](function(_0x33d4d2){_0x1a0f6d[_0x19ca('0x81')]=_0x33d4d2;return _0x1a0f6d;});}return _0x1a0f6d;});};exports[_0x19ca('0x82')]=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 1f200a3..7fdb078 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 _0x73e3=['./nda','exports'];(function(_0x5a7d9e,_0x4ae29e){var _0x1b2361=function(_0x5339ee){while(--_0x5339ee){_0x5a7d9e['push'](_0x5a7d9e['shift']());}};_0x1b2361(++_0x4ae29e);}(_0x73e3,0x8a));var _0x373e=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x73e3[_0xaa0309];return _0x5de7ce;};var nda=require(_0x373e('0x0'));module[_0x373e('0x1')]={'nda':nda}; \ No newline at end of file +var _0xd0ef=['exports','./nda'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xd0ef,0x1e3));var _0xfd0e=function(_0x112246,_0x295a73){_0x112246=_0x112246-0x0;var _0x33cfa8=_0xd0ef[_0x112246];return _0x33cfa8;};var nda=require(_0xfd0e('0x0'));module[_0xfd0e('0x1')]={'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 3039112..fbe5b0c 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 _0x78f0=['ndagenerate_audio','AudioOutputSettings','custom_action','body','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','extension','text','Bearer\x20','access_token','channelData','ProjectName','project'];(function(_0x14bf63,_0xdbd373){var _0x410d22=function(_0x2e5e3a){while(--_0x2e5e3a){_0x14bf63['push'](_0x14bf63['shift']());}};_0x410d22(++_0xdbd373);}(_0x78f0,0x15d));var _0x078f=function(_0x42ecfc,_0x36215b){_0x42ecfc=_0x42ecfc-0x0;var _0x197bb5=_0x78f0[_0x42ecfc];return _0x197bb5;};'use strict';var rp=require(_0x078f('0x0'));var url=require(_0x078f('0x1'));var logger=require(_0x078f('0x2'))(_0x078f('0x3'));module[_0x078f('0x4')]=function(_0x2bde34,_0x34a715){var _0x316f1c={'method':'POST','uri':url[_0x078f('0x5')](_0x34a715[_0x078f('0x6')],_0x078f('0x7')),'form':{'grant_type':_0x078f('0x8'),'username':_0x34a715['username'],'password':_0x34a715[_0x078f('0x8')]},'json':!![]};return rp(_0x316f1c)[_0x078f('0x9')](function(_0x4a7db3){var _0x2ef013={'method':_0x078f('0xa'),'uri':url[_0x078f('0x5')](_0x34a715[_0x078f('0xb')],_0x078f('0xc')),'body':{'type':_0x34a715[_0x078f('0xd')]||_0x078f('0xe'),'channelId':_0x078f('0xf'),'conversation':{'id':_0x2bde34['uniqueid']},'from':{'id':_0x2bde34[_0x078f('0x10')],'name':_0x2bde34[_0x078f('0x11')]},'recipient':{'id':_0x2bde34['dnid'],'name':_0x2bde34[_0x078f('0x12')]},'text':_0x34a715[_0x078f('0x13')],'channelData':{}},'headers':{'Authorization':_0x078f('0x14')+_0x4a7db3[_0x078f('0x15')]},'json':!![]};if(_0x34a715['project']){_0x2ef013['body'][_0x078f('0x16')][_0x078f('0x17')]=_0x34a715[_0x078f('0x18')];}if(_0x34a715[_0x078f('0x19')]=='1'){_0x2ef013['body'][_0x078f('0x16')][_0x078f('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x34a715[_0x078f('0x1b')]){_0x2ef013[_0x078f('0x1c')][_0x078f('0x16')][_0x078f('0x1d')]=_0x34a715[_0x078f('0x1b')];if(_0x34a715[_0x078f('0x1e')]){_0x2ef013['body']['channelData'][_0x078f('0x1f')]=_0x34a715[_0x078f('0x1e')];}}logger[_0x078f('0x20')](JSON[_0x078f('0x21')](_0x2ef013));return rp(_0x2ef013);});}; \ No newline at end of file +var _0x0834=['AudioOutputSettings','custom_action','body','CustomAction','CustomActionData','custom_action_data','../../../../../config/logger','agi','POST','ndauth_url','/token','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','access_token','project','channelData','ProjectName'];(function(_0x304e5a,_0x44f683){var _0x39cccf=function(_0x1fa3d2){while(--_0x1fa3d2){_0x304e5a['push'](_0x304e5a['shift']());}};_0x39cccf(++_0x44f683);}(_0x0834,0x18e));var _0x4083=function(_0x34d9bb,_0x570aea){_0x34d9bb=_0x34d9bb-0x0;var _0x441cd8=_0x0834[_0x34d9bb];return _0x441cd8;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x4083('0x0'))(_0x4083('0x1'));module['exports']=function(_0x491147,_0x5e1812){var _0x14d004={'method':_0x4083('0x2'),'uri':url['resolve'](_0x5e1812[_0x4083('0x3')],_0x4083('0x4')),'form':{'grant_type':'password','username':_0x5e1812[_0x4083('0x5')],'password':_0x5e1812['password']},'json':!![]};return rp(_0x14d004)[_0x4083('0x6')](function(_0x26ed53){var _0x2c42bb={'method':_0x4083('0x2'),'uri':url[_0x4083('0x7')](_0x5e1812[_0x4083('0x8')],_0x4083('0x9')),'body':{'type':_0x5e1812[_0x4083('0xa')]||_0x4083('0xb'),'channelId':_0x4083('0xc'),'conversation':{'id':_0x491147[_0x4083('0xd')]},'from':{'id':_0x491147[_0x4083('0xe')],'name':_0x491147[_0x4083('0xf')]},'recipient':{'id':_0x491147[_0x4083('0x10')],'name':_0x491147[_0x4083('0x11')]},'text':_0x5e1812['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x26ed53[_0x4083('0x12')]},'json':!![]};if(_0x5e1812[_0x4083('0x13')]){_0x2c42bb['body'][_0x4083('0x14')][_0x4083('0x15')]=_0x5e1812[_0x4083('0x13')];}if(_0x5e1812['ndagenerate_audio']=='1'){_0x2c42bb['body'][_0x4083('0x14')][_0x4083('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5e1812[_0x4083('0x17')]){_0x2c42bb[_0x4083('0x18')][_0x4083('0x14')][_0x4083('0x19')]=_0x5e1812[_0x4083('0x17')];if(_0x5e1812['custom_action_data']){_0x2c42bb[_0x4083('0x18')][_0x4083('0x14')][_0x4083('0x1a')]=_0x5e1812[_0x4083('0x1b')];}}logger['info'](JSON['stringify'](_0x2c42bb));return rp(_0x2c42bb);});}; \ 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 ca61520..0adaaea 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 _0x9e73=['exports'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0x9e73,0xd7));var _0x39e7=function(_0x51752d,_0x42fa10){_0x51752d=_0x51752d-0x0;var _0x555799=_0x9e73[_0x51752d];return _0x555799;};'use strict';var asr=require('./lib/api');module[_0x39e7('0x0')]=function(_0x54409c,_0x551c6c,_0x49a8d0,_0x28fc62){return asr(_0x54409c,_0x551c6c,_0x49a8d0,_0x28fc62);}; \ No newline at end of file +var _0xba2e=['./lib/api'];(function(_0x27e21f,_0x3cc784){var _0x5c0967=function(_0x38c605){while(--_0x38c605){_0x27e21f['push'](_0x27e21f['shift']());}};_0x5c0967(++_0x3cc784);}(_0xba2e,0x1e5));var _0xeba2=function(_0x4d894b,_0x292540){_0x4d894b=_0x4d894b-0x0;var _0x4b54b9=_0xba2e[_0x4d894b];return _0x4b54b9;};'use strict';var asr=require(_0xeba2('0x0'));module['exports']=function(_0x54771b,_0x30097a,_0x5df8b8,_0xc8d2db){return asr(_0x54771b,_0x30097a,_0x5df8b8,_0xc8d2db);}; \ 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 9f38dac..bbb0280 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 _0x3a54=['hypotheses','transcript','likelihood','Success.','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','message','bluebird','lodash','moment','../../../../../../config/logger','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','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','data','close','EOS','error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses'];(function(_0x511033,_0x44a597){var _0x275387=function(_0x4c4aa4){while(--_0x4c4aa4){_0x511033['push'](_0x511033['shift']());}};_0x275387(++_0x44a597);}(_0x3a54,0x176));var _0x43a5=function(_0x3dc5d0,_0x3809f3){_0x3dc5d0=_0x3dc5d0-0x0;var _0x126dde=_0x3a54[_0x3dc5d0];return _0x126dde;};'use strict';var BPromise=require(_0x43a5('0x0'));var _=require(_0x43a5('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x43a5('0x2'));var crypto=require('crypto');var logger=require(_0x43a5('0x3'))('agi');module[_0x43a5('0x4')]=function(_0x20d652,_0x2e76f0,_0xdabeae,_0x28a771){return new BPromise(function(_0x1a9f9f,_0x4313aa){logger[_0x43a5('0x5')](_0x43a5('0x6'),_0x28a771||_0x43a5('0x7'));var _0x139253=new WebSocket(_0x28a771||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x2ee099='';var _0x3962e3='0';var _0x5b3372='1';var _0x31acd5=_0x43a5('0x8');function _0x578002(_0x2a3831){var _0x53f25e=crypto[_0x43a5('0x9')](_0x43a5('0xa'));_0x53f25e['update'](_0x2a3831);return _0x53f25e[_0x43a5('0xb')]('hex');}function _0x30466c(){try{logger[_0x43a5('0x5')](_0x43a5('0xc'));var _0x30d918=moment()[_0x43a5('0xd')]();var _0x53d43b=_0x578002(_0x30d918+_0x2e76f0+_0xdabeae);_0x139253[_0x43a5('0xe')](JSON['stringify']({'appID':_0x2e76f0,'timestamp':_0x30d918,'appKey':_0x53d43b}));var _0x15fcd4=fs['createReadStream'](_0x20d652);_0x15fcd4['on'](_0x43a5('0xf'),function(_0x1bf2b3){_0x139253[_0x43a5('0xe')](_0x1bf2b3);});_0x15fcd4['on'](_0x43a5('0x10'),function(){_0x139253['send'](_0x43a5('0x11'));});}catch(_0x10d00b){logger[_0x43a5('0x12')]('Tilde\x20ASR\x20send\x20error',JSON[_0x43a5('0x13')](_0x10d00b));_0x139253[_0x43a5('0x14')]();}}function _0x5e8d28(_0x4e8acf){try{if(_0x4e8acf){var _0x40c98a=JSON[_0x43a5('0x15')](_0x4e8acf);switch(_0x40c98a[_0x43a5('0x16')]){case 0x0:if(_0x40c98a[_0x43a5('0x17')]){if(_0x40c98a[_0x43a5('0x17')][_0x43a5('0x18')]){logger[_0x43a5('0x5')](_0x43a5('0x19'),JSON['stringify'](_0x40c98a[_0x43a5('0x17')][_0x43a5('0x1a')]));_0x2ee099=_0x40c98a['result']['hypotheses'][0x0][_0x43a5('0x1b')];_0x3962e3=_0x40c98a[_0x43a5('0x17')][_0x43a5('0x1a')][0x0][_0x43a5('0x1c')];_0x5b3372='0';_0x31acd5=_0x43a5('0x1d');_0x139253[_0x43a5('0x14')]();}}break;case 0x1:logger['info'](_0x43a5('0x8'));_0x5b3372='1';_0x31acd5=_0x43a5('0x8');break;case 0x2:logger[_0x43a5('0x5')](_0x43a5('0x1e'));_0x5b3372='2';_0x31acd5=_0x43a5('0x1e');break;case 0x9:logger[_0x43a5('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x5b3372='9';_0x31acd5=_0x43a5('0x1f');break;case 0xa:logger[_0x43a5('0x5')]('Authentication\x20failed.');_0x5b3372='10';_0x31acd5=_0x43a5('0x20');break;case 0xb:logger[_0x43a5('0x5')](_0x43a5('0x21'));_0x5b3372='11';_0x31acd5=_0x43a5('0x21');}}}catch(_0x5c7462){logger[_0x43a5('0x12')](_0x43a5('0x22'),JSON[_0x43a5('0x13')](_0x5c7462));_0x139253[_0x43a5('0x14')]();}}function _0x98a77(){logger[_0x43a5('0x5')](_0x43a5('0x23'));_0x1a9f9f({'transcript':_0x2ee099,'confidence':_0x3962e3,'status':_0x5b3372,'status_message':_0x31acd5});}function _0x4ecf03(_0x3b029b){logger[_0x43a5('0x12')](_0x43a5('0x24'));if(!_[_0x43a5('0x25')](_0x3b029b)){logger[_0x43a5('0x12')](_[_0x43a5('0x26')](_0x3b029b)?JSON[_0x43a5('0x13')](_0x3b029b):_0x3b029b);}}_0x139253['on']('open',_0x30466c);_0x139253['on'](_0x43a5('0x27'),_0x5e8d28);_0x139253['on'](_0x43a5('0x10'),_0x98a77);_0x139253['on'](_0x43a5('0x12'),_0x4ecf03);});}; \ No newline at end of file +var _0xf84a=['stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','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.','error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','moment','crypto','exports','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','hex','info','Open\x20Tilde\x20ASR\x20socket','send'];(function(_0x10da55,_0x4ca26b){var _0x5198e0=function(_0x258518){while(--_0x258518){_0x10da55['push'](_0x10da55['shift']());}};_0x5198e0(++_0x4ca26b);}(_0xf84a,0x152));var _0xaf84=function(_0x588cab,_0x3d9ec2){_0x588cab=_0x588cab-0x0;var _0x337272=_0xf84a[_0x588cab];return _0x337272;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xaf84('0x0'));var crypto=require(_0xaf84('0x1'));var logger=require('../../../../../../config/logger')('agi');module[_0xaf84('0x2')]=function(_0x4dcbe6,_0x538717,_0x2391d5,_0x1e7f8d){return new BPromise(function(_0x56ea5c,_0x159fa3){logger['info'](_0xaf84('0x3'),_0x1e7f8d||_0xaf84('0x4'));var _0x1e32a2=new WebSocket(_0x1e7f8d||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x49896b='';var _0x2272c2='0';var _0x5cc8ca='1';var _0x274848=_0xaf84('0x5');function _0x42cfaa(_0x2ac89a){var _0x13278b=crypto[_0xaf84('0x6')](_0xaf84('0x7'));_0x13278b['update'](_0x2ac89a);return _0x13278b['digest'](_0xaf84('0x8'));}function _0x37d5c8(){try{logger[_0xaf84('0x9')](_0xaf84('0xa'));var _0x1c413d=moment()['unix']();var _0xfe83af=_0x42cfaa(_0x1c413d+_0x538717+_0x2391d5);_0x1e32a2[_0xaf84('0xb')](JSON[_0xaf84('0xc')]({'appID':_0x538717,'timestamp':_0x1c413d,'appKey':_0xfe83af}));var _0x3e1930=fs[_0xaf84('0xd')](_0x4dcbe6);_0x3e1930['on'](_0xaf84('0xe'),function(_0x1031e0){_0x1e32a2[_0xaf84('0xb')](_0x1031e0);});_0x3e1930['on'](_0xaf84('0xf'),function(){_0x1e32a2[_0xaf84('0xb')](_0xaf84('0x10'));});}catch(_0x3ac566){logger['error'](_0xaf84('0x11'),JSON[_0xaf84('0xc')](_0x3ac566));_0x1e32a2[_0xaf84('0x12')]();}}function _0x5d7844(_0x3c4c11){try{if(_0x3c4c11){var _0x355b62=JSON[_0xaf84('0x13')](_0x3c4c11);switch(_0x355b62[_0xaf84('0x14')]){case 0x0:if(_0x355b62[_0xaf84('0x15')]){if(_0x355b62[_0xaf84('0x15')]['final']){logger['info'](_0xaf84('0x16'),JSON[_0xaf84('0xc')](_0x355b62[_0xaf84('0x15')][_0xaf84('0x17')]));_0x49896b=_0x355b62[_0xaf84('0x15')][_0xaf84('0x17')][0x0][_0xaf84('0x18')];_0x2272c2=_0x355b62[_0xaf84('0x15')][_0xaf84('0x17')][0x0]['likelihood'];_0x5cc8ca='0';_0x274848='Success.';_0x1e32a2[_0xaf84('0x12')]();}}break;case 0x1:logger[_0xaf84('0x9')](_0xaf84('0x5'));_0x5cc8ca='1';_0x274848=_0xaf84('0x5');break;case 0x2:logger[_0xaf84('0x9')](_0xaf84('0x19'));_0x5cc8ca='2';_0x274848='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xaf84('0x9')](_0xaf84('0x1a'));_0x5cc8ca='9';_0x274848='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0xaf84('0x1b'));_0x5cc8ca='10';_0x274848=_0xaf84('0x1b');break;case 0xb:logger[_0xaf84('0x9')](_0xaf84('0x1c'));_0x5cc8ca='11';_0x274848=_0xaf84('0x1c');}}}catch(_0x465d48){logger[_0xaf84('0x1d')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xaf84('0xc')](_0x465d48));_0x1e32a2[_0xaf84('0x12')]();}}function _0x2f4e9c(){logger[_0xaf84('0x9')](_0xaf84('0x1e'));_0x56ea5c({'transcript':_0x49896b,'confidence':_0x2272c2,'status':_0x5cc8ca,'status_message':_0x274848});}function _0x4dfaf0(_0x37458a){logger['error'](_0xaf84('0x1f'));if(!_[_0xaf84('0x20')](_0x37458a)){logger[_0xaf84('0x1d')](_['isObject'](_0x37458a)?JSON['stringify'](_0x37458a):_0x37458a);}}_0x1e32a2['on'](_0xaf84('0x21'),_0x37d5c8);_0x1e32a2['on'](_0xaf84('0x22'),_0x5d7844);_0x1e32a2['on'](_0xaf84('0xf'),_0x2f4e9c);_0x1e32a2['on'](_0xaf84('0x1d'),_0x4dfaf0);});}; \ 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 54a482b..058daea 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 _0x4757=['./asr','exports'];(function(_0xd40e2c,_0x92be2){var _0x56c0b0=function(_0x4142f8){while(--_0x4142f8){_0xd40e2c['push'](_0xd40e2c['shift']());}};_0x56c0b0(++_0x92be2);}(_0x4757,0x1ac));var _0x7475=function(_0x569fef,_0x49c37a){_0x569fef=_0x569fef-0x0;var _0x11f20b=_0x4757[_0x569fef];return _0x11f20b;};var asr=require(_0x7475('0x0'));module[_0x7475('0x1')]={'asr':asr}; \ No newline at end of file +var _0xf67c=['./asr'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xf67c,0xcf));var _0xcf67=function(_0x170e37,_0x142768){_0x170e37=_0x170e37-0x0;var _0x927529=_0xf67c[_0x170e37];return _0x927529;};var asr=require(_0xcf67('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 2d57d96..60bc6c2 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 _0xee77=['events','EventEmitter','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net'];(function(_0x247ada,_0x3e6cfd){var _0x39f1a1=function(_0x33daf3){while(--_0x33daf3){_0x247ada['push'](_0x247ada['shift']());}};_0x39f1a1(++_0x3e6cfd);}(_0xee77,0x76));var _0x7ee7=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xee77[_0x9cd4c3];return _0x4c9025;};'use strict';var util=require(_0x7ee7('0x0'));var net=require(_0x7ee7('0x1'));var EventEmitter=require(_0x7ee7('0x2'))[_0x7ee7('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x7ee7('0x4'));var AGIServer=function(_0x5df731,_0x4380d5,_0x225345){var _0x3e51c9=this,_0x5df731=_0x5df731||0x11dd,_0x4380d5=_0x4380d5||_0x7ee7('0x5'),_0x4182b1=null,_0x55b336=0x0;EventEmitter[_0x7ee7('0x6')](_0x3e51c9);function _0x174fd5(){if(!_0x5df731){_0x3e51c9[_0x7ee7('0x7')](_0x7ee7('0x8'),new AGIError(_0x7ee7('0x9')));return![];}_0x4182b1=net['createServer']();_0x4182b1[_0x7ee7('0xa')](_0x5df731,_0x4380d5);_0x4182b1['on'](_0x7ee7('0xb'),function(){_0x3e51c9['emit']('listening');});_0x4182b1['on']('connection',function(_0x2702da){_0x4182b1[_0x7ee7('0xc')](function(_0x37ea2f,_0x2af2f2){if(_0x37ea2f){_0x3e51c9[_0x7ee7('0x7')](_0x7ee7('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x37ea2f));}else if(_0x225345&&_0x225345<0x0){_0x3e51c9[_0x7ee7('0x7')](_0x7ee7('0x8'),new AGIError(_0x7ee7('0xd')));_0x2702da[_0x7ee7('0xe')]();}else if(_0x225345&&_0x225345>0x0&&_0x225345<_0x2af2f2){_0x55b336+=0x1;_0x3e51c9[_0x7ee7('0x7')](_0x7ee7('0x8'),new AGIError(_0x7ee7('0xf'),_0x55b336));_0x2702da['destroy']();}else{var _0x3553f3=new AGIChannel(_0x2702da);_0x3553f3['on'](_0x7ee7('0x10'),function(){_0x3e51c9[_0x7ee7('0x7')](_0x7ee7('0x11'),_0x3553f3);});}});});_0x4182b1['on'](_0x7ee7('0x8'),function(_0x2b27d2){_0x3e51c9[_0x7ee7('0x7')](_0x7ee7('0x8'),new AGIError(_0x7ee7('0x12'),_0x2b27d2['code']));});_0x4182b1['on'](_0x7ee7('0x13'),function(){_0x3e51c9[_0x7ee7('0x7')](_0x7ee7('0x13'),new AGIError(_0x7ee7('0x14')));});}process[_0x7ee7('0x15')](function(){_0x174fd5();});};util[_0x7ee7('0x16')](AGIServer,EventEmitter);module[_0x7ee7('0x17')]=function(_0x3852a2,_0x30fff1,_0x37f21c){return new AGIServer(_0x3852a2,_0x30fff1,_0x37f21c);}; \ No newline at end of file +var _0x4863=['error','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','inherits','exports','net','events','EventEmitter','./error','./channel','127.0.0.1','emit'];(function(_0x56f747,_0x39ccca){var _0x4b90f1=function(_0x21082c){while(--_0x21082c){_0x56f747['push'](_0x56f747['shift']());}};_0x4b90f1(++_0x39ccca);}(_0x4863,0x77));var _0x3486=function(_0x5546a5,_0x372e99){_0x5546a5=_0x5546a5-0x0;var _0x5e4a94=_0x4863[_0x5546a5];return _0x5e4a94;};'use strict';var util=require('util');var net=require(_0x3486('0x0'));var EventEmitter=require(_0x3486('0x1'))[_0x3486('0x2')];var AGIError=require(_0x3486('0x3'));var AGIChannel=require(_0x3486('0x4'));var AGIServer=function(_0x4edaf6,_0x3f778d,_0x10e1ee){var _0xf99aab=this,_0x4edaf6=_0x4edaf6||0x11dd,_0x3f778d=_0x3f778d||_0x3486('0x5'),_0x142d14=null,_0x3c4363=0x0;EventEmitter['call'](_0xf99aab);function _0x3c6d2b(){if(!_0x4edaf6){_0xf99aab[_0x3486('0x6')](_0x3486('0x7'),new AGIError(_0x3486('0x8')));return![];}_0x142d14=net['createServer']();_0x142d14[_0x3486('0x9')](_0x4edaf6,_0x3f778d);_0x142d14['on'](_0x3486('0xa'),function(){_0xf99aab[_0x3486('0x6')](_0x3486('0xa'));});_0x142d14['on'](_0x3486('0xb'),function(_0xd22e58){_0x142d14[_0x3486('0xc')](function(_0x5e5355,_0x276252){if(_0x5e5355){_0xf99aab['emit'](_0x3486('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x5e5355));}else if(_0x10e1ee&&_0x10e1ee<0x0){_0xf99aab[_0x3486('0x6')]('error',new AGIError(_0x3486('0xd')));_0xd22e58[_0x3486('0xe')]();}else if(_0x10e1ee&&_0x10e1ee>0x0&&_0x10e1ee<_0x276252){_0x3c4363+=0x1;_0xf99aab[_0x3486('0x6')](_0x3486('0x7'),new AGIError(_0x3486('0xf'),_0x3c4363));_0xd22e58[_0x3486('0xe')]();}else{var _0x163a63=new AGIChannel(_0xd22e58);_0x163a63['on'](_0x3486('0x10'),function(){_0xf99aab['emit']('connection',_0x163a63);});}});});_0x142d14['on'](_0x3486('0x7'),function(_0x369fd2){_0xf99aab[_0x3486('0x6')](_0x3486('0x7'),new AGIError(_0x3486('0x11'),_0x369fd2['code']));});_0x142d14['on'](_0x3486('0x12'),function(){_0xf99aab[_0x3486('0x6')](_0x3486('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process['nextTick'](function(){_0x3c6d2b();});};util[_0x3486('0x13')](AGIServer,EventEmitter);module[_0x3486('0x14')]=function(_0x30e9cf,_0x462aa0,_0x117aa7){return new AGIServer(_0x30e9cf,_0x462aa0,_0x117aa7);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 6c977b7..02211bb 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 _0x47c5=['toUpperCase','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','replaceObjectAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','isArray','length','isString','%s.%s','saveRestApiResult','replaceAllVariables','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','result','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','url','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','googleDialogflowV2','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','streamFile','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','getData','maxdigit','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','agentLogout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20found','digit','no\x20variable\x20found','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','createSmsMessage','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\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\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','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','Executed\x20command\x20%s\x20%s','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','timeout','number','includes','POST','PUT','method'];(function(_0x160103,_0x1f90ee){var _0xf12407=function(_0x285383){while(--_0x285383){_0x160103['push'](_0x160103['shift']());}};_0xf12407(++_0x1f90ee);}(_0x47c5,0x165));var _0x547c=function(_0x2f3d1d,_0x28129e){_0x2f3d1d=_0x2f3d1d-0x0;var _0x89c489=_0x47c5[_0x2f3d1d];return _0x89c489;};'use strict';var fs=require('fs');var path=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var _=require(_0x547c('0x2'));var sh=require(_0x547c('0x3'));var odbc=require(_0x547c('0x4'))();var rs=require(_0x547c('0x5'));var moment=require('moment');var Mustache=require(_0x547c('0x6'));var rp=require(_0x547c('0x7'));var logger=require('../../config/logger')(_0x547c('0x8'));var config=require(_0x547c('0x9'));var scripts=require('./scripts');var FILES_PATH=_0x547c('0xa');var recursiveMapAttributes=[_0x547c('0xb'),_0x547c('0xc')];var verticesWithRetry=[_0x547c('0xd'),_0x547c('0xe'),_0x547c('0xf')];var AGIVertices=function(_0x3e2279,_0x40be25,_0x10dec9){this[_0x547c('0x10')]=_0x3e2279;this[_0x547c('0x11')]=_0x40be25;this[_0x547c('0x12')]=_0x10dec9;};AGIVertices[_0x547c('0x13')][_0x547c('0x14')]=function(_0x386e2c,_0x8addbe){this[_0x547c('0x11')]['getVariableById'](_0x386e2c)[_0x547c('0x15')](function(_0x39dce7){_0x8addbe(null,_0x39dce7?_0x39dce7['name']:![]);})[_0x547c('0x16')](function(_0x201d95){_0x8addbe(_0x201d95);});};AGIVertices[_0x547c('0x13')][_0x547c('0x17')]=function(_0x392a35,_0x150317){this[_0x547c('0x11')][_0x547c('0x18')](_0x392a35)[_0x547c('0x15')](function(_0x161991){_0x150317(null,_0x161991?_0x161991[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x39f316){_0x150317(_0x39f316);});};AGIVertices[_0x547c('0x13')][_0x547c('0x1a')]=function(_0xf32cdd,_0x39498d){this[_0x547c('0x11')]['getSquareProjectById'](_0xf32cdd)['then'](function(_0x23fa9e){_0x39498d(null,_0x23fa9e?_0x23fa9e[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x4a8901){_0x39498d(_0x4a8901);});};AGIVertices[_0x547c('0x13')][_0x547c('0x1b')]=function(_0x1ddbd3,_0x58ddc9){this[_0x547c('0x11')][_0x547c('0x1c')](_0x1ddbd3)['then'](function(_0x5453f9){_0x58ddc9(null,_0x5453f9?_0x5453f9[_0x547c('0x1d')]:![]);})[_0x547c('0x16')](function(_0x4f20c1){_0x58ddc9(_0x4f20c1);});};AGIVertices[_0x547c('0x13')][_0x547c('0x1e')]=function(_0x592e46,_0x2e317a){this[_0x547c('0x11')][_0x547c('0x1f')](_0x592e46)['then'](function(_0x3a55a0){_0x2e317a(null,_0x3a55a0?_0x3a55a0[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x26823c){_0x2e317a(_0x26823c);});};AGIVertices[_0x547c('0x13')][_0x547c('0x20')]=function(_0x2ab2cc,_0x17fa33){this['rpc'][_0x547c('0x21')](_0x2ab2cc)['then'](function(_0x5b05f2){_0x17fa33(null,_0x5b05f2?_0x5b05f2['name']:![]);})['catch'](function(_0x2c725d){_0x17fa33(_0x2c725d);});};AGIVertices['prototype'][_0x547c('0x22')]=function(_0x5729b0,_0x3ea493){var _0x486216=this;this[_0x547c('0x11')][_0x547c('0x23')](_0x5729b0)[_0x547c('0x15')](function(_0x30a96c){_0x3ea493(null,_0x30a96c?_0x486216[_0x547c('0x24')](_0x30a96c['save_name']):![]);})['catch'](function(_0x28c282){_0x3ea493(_0x28c282);});};AGIVertices['prototype'][_0x547c('0x25')]=function(_0xed2d39,_0x3e7652){this[_0x547c('0x11')][_0x547c('0x26')](_0xed2d39)[_0x547c('0x15')](function(_0x342c10){_0x3e7652(null,_0x342c10?_0x342c10:![]);})['catch'](function(_0x54f6a8){_0x3e7652(_0x54f6a8);});};AGIVertices[_0x547c('0x13')][_0x547c('0x27')]=function(_0x1e4313,_0x26850a,_0x1b8c17){this[_0x547c('0x12')][_0x547c('0x27')](_0x1e4313,_0x26850a)[_0x547c('0x15')](function(){_0x1b8c17(null);})[_0x547c('0x16')](function(_0x31026e){_0x1b8c17(_0x31026e);});};AGIVertices[_0x547c('0x13')][_0x547c('0x28')]=function(_0x243cb,_0x385275){this['rpc'][_0x547c('0x29')](_0x243cb)['then'](function(_0x4ad00e){if(_0x4ad00e){if(_0x4ad00e['IntervalId']){_0x385275(null,[_0x4ad00e[_0x547c('0x2a')]]);}else{_0x385275(null,_[_0x547c('0x2b')](_0x4ad00e[_0x547c('0x2c')],_0x547c('0x2a')));}}else{_0x385275(null,![]);}})[_0x547c('0x16')](function(_0x45f724){_0x385275(_0x45f724);});};AGIVertices['prototype']['getSoundPath']=function(_0x5ea2c7){return util[_0x547c('0x2d')](_0x547c('0x2e'),FILES_PATH,_0x5ea2c7);};AGIVertices[_0x547c('0x13')][_0x547c('0x2f')]=function(_0xe0352c,_0x185465,_0x57ce3b){odbc[_0x547c('0x30')](_0xe0352c,function(_0x4e2e52){if(_0x4e2e52){logger[_0x547c('0x31')](_0x547c('0x32'),_0x4e2e52);_0x57ce3b(_0x4e2e52);}else{logger['info'](_0x547c('0x33'));odbc['query'](_0x185465,function(_0x511103,_0x3137e0){if(_0x511103){logger[_0x547c('0x34')](_0x547c('0x35'),_0x185465);_0x57ce3b(_0x511103);}else{logger[_0x547c('0x34')]('Query\x20executed\x20correctly\x20%s',_0x185465);odbc['close'](function(_0xe5f1b9){if(_0xe5f1b9){logger[_0x547c('0x31')](_0x547c('0x36'),_0xe5f1b9);}_0x57ce3b(null,_0x3137e0);});}});}});};AGIVertices['prototype'][_0x547c('0x37')]=function(_0x21838a,_0x4746ee){this['rpc'][_0x547c('0x38')](_0x21838a)[_0x547c('0x15')](function(_0xbb08e7){_0x4746ee(null,_0xbb08e7?_0xbb08e7:![]);})['catch'](function(_0x26e8d2){_0x4746ee(_0x26e8d2);});};AGIVertices[_0x547c('0x13')]['createSmsMessage']=function(_0x26ea8c,_0x23c8b2){this[_0x547c('0x11')]['createSmsMessage'](_0x26ea8c)[_0x547c('0x15')](function(_0x4f2859){_0x23c8b2(null,_0x4f2859);})[_0x547c('0x16')](function(_0x5393a2){_0x23c8b2(_0x5393a2);});};AGIVertices[_0x547c('0x13')][_0x547c('0x39')]=function(_0x3d37d7,_0x3797d3,_0x139a61){this[_0x547c('0x11')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x547c('0x3a')],'node':_0x3d37d7[_0x547c('0x3b')],'application':_0x3d37d7[_0x547c('0x3c')],'data':_0x3797d3||null,'project_name':this['channel'][_0x547c('0x3d')],'callerid':this[_0x547c('0x10')][_0x547c('0x3e')]})[_0x547c('0x15')](function(_0x1e4ab7){if(_0x139a61){_0x139a61(null,_0x1e4ab7);}})[_0x547c('0x16')](function(_0x4adb6f){if(_0x139a61){_0x139a61(_0x4adb6f);}});};AGIVertices[_0x547c('0x13')][_0x547c('0x3f')]=function(_0x3d7088,_0x4c4287,_0x291302,_0x478320){this[_0x547c('0x11')][_0x547c('0x3f')]({'uniqueid':this['channel'][_0x547c('0x3a')],'callerid':this['channel'][_0x547c('0x3e')],'calleridname':this['channel'][_0x547c('0x40')],'context':this[_0x547c('0x10')]['context'],'extension':this[_0x547c('0x10')][_0x547c('0x41')],'priority':this[_0x547c('0x10')][_0x547c('0x42')],'accountcode':this['channel'][_0x547c('0x43')],'dnid':this['channel']['dnid'],'projectName':this[_0x547c('0x10')][_0x547c('0x3d')],'saveName':_0x4c4287,'filename':_0x3d7088[_0x547c('0x44')]||_0x4c4287,'savePath':_0x291302})[_0x547c('0x15')](function(_0x1daaf4){_0x478320(null,_0x1daaf4);})[_0x547c('0x16')](function(_0x153392){_0x478320(_0x153392);});};AGIVertices[_0x547c('0x13')][_0x547c('0x45')]=function(_0x31a262,_0x25b267,_0x38b2bc,_0x503b41,_0x4a0f42){this[_0x547c('0x11')][_0x547c('0x45')]({'uniqueid':this['channel'][_0x547c('0x3a')],'body':_0x31a262,'direction':_0x25b267,'providerName':_0x38b2bc,'providerResponse':_0x503b41})[_0x547c('0x15')](function(_0x3ab131){if(_0x4a0f42){_0x4a0f42(null,_0x3ab131);}})[_0x547c('0x16')](function(_0x30680d){if(_0x4a0f42){_0x4a0f42(_0x30680d);}});};AGIVertices[_0x547c('0x13')]['createCmContact']=function(_0x152982,_0x5258cf){this[_0x547c('0x11')][_0x547c('0x46')]({'firstName':_[_0x547c('0x47')](_0x152982['name'])||_[_0x547c('0x48')](_0x152982['name'])?_0x547c('0x49')+Math[_0x547c('0x4a')]():_0x152982['name'],'lastName':_[_0x547c('0x47')](_0x152982[_0x547c('0x4b')])||_[_0x547c('0x48')](_0x152982[_0x547c('0x4b')])?null:_0x152982[_0x547c('0x4b')],'phone':_0x152982[_0x547c('0x4c')],'ListId':_0x152982[_0x547c('0x4d')],'scheduledat':_0x152982['scheduledAt'],'callbackUniqueid':this[_0x547c('0x10')]['uniqueid'],'tags':_0x547c('0x4e'),'description':_0x547c('0x4f')+_0x152982[_0x547c('0x50')][_0x547c('0x51')](),'priority':_0x152982[_0x547c('0x52')]})['then'](function(_0x369fb0){_0x5258cf(null,_0x369fb0);})['catch'](function(_0x124222){_0x5258cf(_0x124222);});};AGIVertices[_0x547c('0x13')][_0x547c('0x53')]=function(_0x2b14e0,_0x347536){this['rpc'][_0x547c('0x54')](_0x2b14e0)[_0x547c('0x15')](function(_0x4efdd5){_0x347536(null,_0x4efdd5?_0x4efdd5[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x22e016){_0x347536(_0x22e016);});};AGIVertices[_0x547c('0x13')]['agentPause']=function(_0x52d134,_0x56125c,_0x188363){var _0x455467={'role':'agent'};_0x455467[_0x52d134]=this[_0x547c('0x10')]['callerid'];this[_0x547c('0x11')][_0x547c('0x55')](_0x455467,_0x56125c,this[_0x547c('0x10')][_0x547c('0x3a')])[_0x547c('0x15')](function(_0x423889){_0x188363(null,_[_0x547c('0x48')](_0x423889)?![]:!![]);})['catch'](function(_0x5746ee){logger[_0x547c('0x31')](_0x5746ee);_0x188363(null,![]);});};AGIVertices[_0x547c('0x13')][_0x547c('0x56')]=function(_0x64bf1e,_0xd3b584){var _0x50582e={'role':'agent'};_0x50582e[_0x64bf1e]=this['channel']['callerid'];this['rpc'][_0x547c('0x56')](_0x50582e)[_0x547c('0x15')](function(_0xe32d09){_0xd3b584(null,_['isNil'](_0xe32d09)?![]:!![]);})[_0x547c('0x16')](function(_0x1f901b){logger[_0x547c('0x31')](_0x1f901b);_0xd3b584(null,![]);});};AGIVertices[_0x547c('0x13')]['agentLogout']=function(_0x4ab718,_0x5c395d){var _0xa66eee={'role':_0x547c('0x57')};_0xa66eee[_0x4ab718]=this[_0x547c('0x10')][_0x547c('0x3e')];this[_0x547c('0x11')]['agentLogout'](_0xa66eee)['then'](function(_0x1e2826){_0x5c395d(null,_[_0x547c('0x48')](_0x1e2826)?![]:!![]);})[_0x547c('0x16')](function(_0x70451){logger[_0x547c('0x31')](_0x70451);_0x5c395d(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x531892,_0x244e32){var _0x48f519={'role':_0x547c('0x57')};_0x48f519[_0x531892]=this[_0x547c('0x10')][_0x547c('0x3e')];var _0x50f4e6=_0x531892!='internal'?util[_0x547c('0x2d')](_0x547c('0x58'),_0x547c('0x59'),this[_0x547c('0x10')][_0x547c('0x3e')]):undefined;this[_0x547c('0x11')][_0x547c('0x5a')](_0x48f519,_0x50f4e6)['then'](function(_0x310243){_0x244e32(null,_[_0x547c('0x48')](_0x310243)?![]:!![]);})[_0x547c('0x16')](function(_0x6bf96d){logger[_0x547c('0x31')](_0x6bf96d);_0x244e32(null,![]);});};AGIVertices[_0x547c('0x13')][_0x547c('0x5b')]=function(_0x4066ce,_0x49dc3c){sh[_0x547c('0x5c')](_[_0x547c('0x5d')](_0x4066ce),function(_0x1dedca,_0xe3e820){var _0x4f0ed4=_0xe3e820[_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'');_0x49dc3c(null,_0x4f0ed4);});};AGIVertices[_0x547c('0x13')][_0x547c('0x5f')]=function(_0x4e2acc,_0x52cccd){scripts['googleCloudTTS'](_0x4e2acc[_0x547c('0x60')],_0x4e2acc[_0x547c('0x61')]||_0x547c('0x62'),_0x4e2acc['text'],_0x4e2acc[_0x547c('0x63')]||_0x547c('0x64'),_0x4e2acc[_0x547c('0x65')]||_0x547c('0x66'),_0x4e2acc['audioEncoding']||'MP3')[_0x547c('0x15')](function(_0x5e41e4){_0x52cccd(null,_0x5e41e4);})[_0x547c('0x16')](function(_0x393204){_0x52cccd(_0x393204);});};AGIVertices['prototype'][_0x547c('0x67')]=function(_0x4edded,_0x1566d6){scripts[_0x547c('0x67')](_0x4edded['text'],_0x4edded[_0x547c('0x68')]||'en',0x1)[_0x547c('0x15')](function(_0xdd0ebc){_0x1566d6(null,_0xdd0ebc);})[_0x547c('0x16')](function(_0x4c7e53){_0x1566d6(_0x4c7e53);});};AGIVertices['prototype'][_0x547c('0x69')]=function(_0x165bfe,_0x358aed){var _0x3378a3={'uri':_0x165bfe['url'],'method':_0x165bfe['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x165bfe[_0x547c('0x6a')])===_0x547c('0x6b')&&parseInt(_0x165bfe[_0x547c('0x6a')])>=0x1?parseInt(_0x165bfe[_0x547c('0x6a')])*0x3e8:0x5*0x3e8};if(_[_0x547c('0x6c')]([_0x547c('0x6d'),_0x547c('0x6e')],_0x3378a3[_0x547c('0x6f')][_0x547c('0x70')]())){try{_0x3378a3[_0x547c('0x71')]=_0x165bfe[_0x547c('0xc')]?JSON[_0x547c('0x72')](_0x165bfe[_0x547c('0xc')]):{};}catch(_0x4e038b){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4e038b);}}try{_0x3378a3[_0x547c('0x73')]=_0x165bfe['rawHeaders']?JSON['parse'](_0x165bfe[_0x547c('0xb')]):{};}catch(_0x5cbef2){logger['error'](_0x547c('0x74'),_0x5cbef2);}if(_0x165bfe[_0x547c('0x75')]){try{var _0x2ab7d3=require(_0x165bfe[_0x547c('0x75')])['sync'](this,_0x3378a3);_0x3378a3[_0x547c('0x76')]=Mustache[_0x547c('0x77')](_0x165bfe['url'],_0x2ab7d3,{},['$$','$$']);if(_0x3378a3['headers']){_0x3378a3[_0x547c('0x73')]=JSON[_0x547c('0x72')](Mustache[_0x547c('0x77')](JSON[_0x547c('0x78')](_0x3378a3[_0x547c('0x73')]),_0x2ab7d3,{},['$$','$$']));}if(_0x3378a3[_0x547c('0x71')]){_0x3378a3[_0x547c('0x71')]=JSON[_0x547c('0x72')](Mustache['render'](JSON[_0x547c('0x78')](_0x3378a3[_0x547c('0x71')]),_0x2ab7d3,{},['$$','$$']));}}catch(_0x1fd7d1){logger['error'](_0x547c('0x79'),_0x1fd7d1);}}rp(_0x3378a3)[_0x547c('0x15')](function(_0x2cb2ff){var _0x1fa904={'statusCode':_0x2cb2ff[_0x547c('0x7a')]||0xc8,'statusMessage':_0x2cb2ff[_0x547c('0x7b')]||'OK','headers':_0x2cb2ff[_0x547c('0x73')]||{},'body':_0x2cb2ff[_0x547c('0x71')]||{}};_0x358aed(null,_0x1fa904);})[_0x547c('0x16')](function(_0x7a72fd){var _0x73eb72={'statusCode':_0x7a72fd[_0x547c('0x7a')]||0x1f4,'statusMessage':_0x7a72fd[_0x547c('0x7c')]||_0x547c('0x7d'),'headers':_0x7a72fd['options'][_0x547c('0x73')]||{},'body':_0x7a72fd[_0x547c('0x7e')][_0x547c('0x71')]||{}};_0x358aed(null,_0x73eb72);});};AGIVertices['prototype'][_0x547c('0x7f')]=function(_0x19927b,_0x185176){scripts[_0x547c('0x7f')](this[_0x547c('0x10')][_0x547c('0x3a')],_0x19927b[_0x547c('0x80')],_0x19927b[_0x547c('0x62')],_0x19927b[_0x547c('0x81')]||'en')[_0x547c('0x15')](function(_0x224f62){_0x185176(null,_0x224f62);})[_0x547c('0x16')](function(_0x3a988f){_0x185176(_0x3a988f);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x4d8594,_0x588e2b){scripts['googleDialogflowV2'](this['channel'][_0x547c('0x3a')],_0x4d8594[_0x547c('0x82')],_0x4d8594[_0x547c('0x83')],_0x4d8594[_0x547c('0x84')],_0x4d8594['text'],_0x4d8594[_0x547c('0x85')]||'en')[_0x547c('0x15')](function(_0x27410e){_0x588e2b(null,_0x27410e);})['catch'](function(_0x4607f4){_0x588e2b(_0x4607f4);});};AGIVertices[_0x547c('0x13')][_0x547c('0x86')]=function(_0x53a0a7,_0x51f200){scripts['sestekNDA'](this[_0x547c('0x10')],_0x53a0a7)['then'](function(_0x41e2c2){_0x51f200(null,_0x41e2c2);})[_0x547c('0x16')](function(_0x58d2b3){_0x51f200(_0x58d2b3);});};AGIVertices[_0x547c('0x13')][_0x547c('0x87')]=function(_0x168b42,_0x3f54cf){scripts[_0x547c('0x87')](_0x168b42['key'],_0x168b42[_0x547c('0x62')],_0x168b42['ispeech_tts_language']||_0x547c('0x64'),_0x168b42[_0x547c('0x88')])[_0x547c('0x15')](function(_0x1dfce9){_0x3f54cf(null,_0x1dfce9);})['catch'](function(_0x1e8cd7){_0x3f54cf(_0x1e8cd7);});};AGIVertices['prototype'][_0x547c('0x89')]=function(_0x8eb70e,_0x506426,_0x348ef8){scripts['ispeechASR'](_0x506426,_0x8eb70e[_0x547c('0x80')],_0x8eb70e[_0x547c('0x8a')]||_0x547c('0x64'),this[_0x547c('0x8b')](_0x8eb70e['model'])?_0x8eb70e[_0x547c('0x8c')]:undefined)[_0x547c('0x15')](function(_0xea441b){_0x348ef8(null,_0xea441b);})[_0x547c('0x16')](function(_0x2febce){_0x348ef8(_0x2febce);});};AGIVertices['prototype'][_0x547c('0x8d')]=function(_0x36d1b0,_0x28cbee){scripts['awsPolly'](_0x36d1b0[_0x547c('0x8e')],_0x36d1b0[_0x547c('0x8f')],_0x36d1b0[_0x547c('0x90')],_0x36d1b0[_0x547c('0x91')]||'Amy',_0x36d1b0[_0x547c('0x62')],_0x36d1b0['aws_text_type']||_0x547c('0x62'))['then'](function(_0x196128){_0x28cbee(null,_0x196128);})[_0x547c('0x16')](function(_0xc17a4d){_0x28cbee(_0xc17a4d);});};AGIVertices[_0x547c('0x13')][_0x547c('0x92')]=function(_0x2b314d,_0x48bb39){scripts['awsLex'](this['channel'][_0x547c('0x3a')],_0x2b314d[_0x547c('0x8e')],_0x2b314d[_0x547c('0x8f')],_0x2b314d[_0x547c('0x93')],_0x2b314d['text'],_0x2b314d[_0x547c('0x94')])['then'](function(_0xbd5c0e){_0x48bb39(null,_0xbd5c0e);})[_0x547c('0x16')](function(_0x7edc0f){_0x48bb39(_0x7edc0f);});};AGIVertices[_0x547c('0x13')][_0x547c('0x95')]=function(_0x15778c,_0x51e60a,_0x40bc73){scripts['googleASR'](_0x51e60a,_0x15778c[_0x547c('0x80')],_0x15778c[_0x547c('0x96')]||'en-US')[_0x547c('0x15')](function(_0x141f89){_0x40bc73(null,_0x141f89);})[_0x547c('0x16')](function(_0x1fe6a2){_0x40bc73(_0x1fe6a2);});};AGIVertices[_0x547c('0x13')][_0x547c('0x97')]=function(_0x24339b,_0x59bc57,_0xcdd93f){scripts[_0x547c('0x97')](_0x59bc57,_0x24339b[_0x547c('0x98')],_0x24339b['appsecret'],_0x24339b[_0x547c('0x76')])['then'](function(_0x1a29ca){_0xcdd93f(null,_0x1a29ca);})['catch'](function(_0x44b5e9){_0xcdd93f(_0x44b5e9);});};AGIVertices[_0x547c('0x13')][_0x547c('0x99')]=function(_0x13bbfe){var _0x515220=_[_0x547c('0x6c')](verticesWithRetry,_0x13bbfe[_0x547c('0x3c')])?_0x13bbfe:_[_0x547c('0x9a')](_0x13bbfe);for(var _0x358ca1 in _0x515220){if(_0x515220['hasOwnProperty'](_0x358ca1)){if(_0x515220[_0x358ca1]&&_['isString'](_0x515220[_0x358ca1])){if(_[_0x547c('0x6c')](recursiveMapAttributes,_0x358ca1)){_0x515220[_0x358ca1]=this[_0x547c('0x9b')](_0x515220[_0x358ca1]);}else{_0x515220[_0x358ca1]=this['replaceAllVariables'](_0x515220[_0x358ca1]);}}}}return _0x515220;};AGIVertices[_0x547c('0x13')]['recursiveNodeIndex']=function(_0x4c91fe){for(var _0x5c4b10 in _0x4c91fe){if(_0x4c91fe[_0x547c('0x9c')](_0x5c4b10)){if(_[_0x547c('0x9d')](_0x4c91fe[_0x5c4b10])){this[_0x547c('0x9e')](_0x4c91fe[_0x5c4b10]);}else if(_[_0x547c('0x9f')](_0x4c91fe[_0x5c4b10])){for(var _0x508a62=0x0;_0x508a62<_0x4c91fe[_0x5c4b10][_0x547c('0xa0')];_0x508a62++){this[_0x547c('0x9e')](_0x4c91fe[_0x5c4b10][_0x508a62]);}}else if(_[_0x547c('0xa1')](_0x4c91fe[_0x5c4b10])){_0x4c91fe[_0x5c4b10]=this['replaceAllVariables'](_0x4c91fe[_0x5c4b10]);}}}};AGIVertices[_0x547c('0x13')]['saveRestApiResult']=function(_0x90de50,_0x3ffc1e){for(var _0xc648f4 in _0x90de50){if(_0x90de50['hasOwnProperty'](_0xc648f4)){if(_[_0x547c('0x9d')](_0x90de50[_0xc648f4])){if(!_[_0x547c('0x47')](_0x90de50[_0xc648f4])){this['saveRestApiResult'](_0x90de50[_0xc648f4],util[_0x547c('0x2d')](_0x547c('0xa2'),_0x3ffc1e,_0xc648f4));}}else if(_[_0x547c('0x9f')](_0x90de50[_0xc648f4])){for(var _0x2fb055=0x0;_0x2fb055<_0x90de50[_0xc648f4][_0x547c('0xa0')];_0x2fb055++){this[_0x547c('0xa3')](_0x90de50[_0xc648f4][_0x2fb055],util[_0x547c('0x2d')](_0x547c('0xa2'),_0x3ffc1e,_0xc648f4+'['+_0x2fb055+']'));}}else{if(!_[_0x547c('0x48')](_0x90de50[_0xc648f4])){this[_0x547c('0x10')]['setVariable'](util['format'](_0x547c('0xa2'),_0x3ffc1e,_0xc648f4),_0x90de50[_0xc648f4]);}}}}};AGIVertices['prototype'][_0x547c('0x9b')]=function(_0x557e76){try{var _0x66a70c=JSON[_0x547c('0x72')](_0x557e76);this[_0x547c('0x9e')](_0x66a70c);return JSON[_0x547c('0x78')](_0x66a70c);}catch(_0x2c962d){return this[_0x547c('0xa4')](_0x557e76);}};AGIVertices[_0x547c('0x13')]['replaceAllVariables']=function(_0x180b89){var _0x23701c=_0x180b89[_0x547c('0xa5')]('{');for(var _0x436c13=0x1;_0x436c13<_0x23701c[_0x547c('0xa0')];_0x436c13+=0x1){var _0x3fa33c=_0x23701c[_0x436c13][_0x547c('0xa5')]('}');if(_0x3fa33c[_0x547c('0xa0')]>0x1){_0x180b89=_0x180b89[_0x547c('0xa6')]('{'+_0x3fa33c[0x0]+'}',this[_0x547c('0x10')][_0x547c('0x14')](_0x3fa33c[0x0])[_0x547c('0xa7')]||_0x3fa33c[0x0]);}}if(_0x23701c[_0x547c('0xa0')]===0x1){return _0x180b89['toString']();}return this[_0x547c('0xa4')](_0x180b89);};AGIVertices[_0x547c('0x13')][_0x547c('0xa8')]=function(_0x8811ee,_0x23da9d){var _0x11e9fd=this[_0x547c('0x10')][_0x547c('0x14')](_0x8811ee);if(_0x11e9fd['result']===-0x1){return _0x11e9fd;}logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xa9'),_0x23da9d,_0x11e9fd['extra']));return this['channel'][_0x547c('0xaa')](_0x23da9d,_0x11e9fd[_0x547c('0xa7')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x8b')]=function(_0x443680){return _0x443680&&_0x443680!=='0'&&_0x443680!=='-1'&&_0x443680!=='';};AGIVertices[_0x547c('0x13')][_0x547c('0xab')]=function(_0xb541a7){this['createSquareDetailsReport'][_0x547c('0xac')](this,_0xb541a7,'-');_0xb541a7[_0x547c('0xad')]=_0xb541a7['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x547c('0x13')][_0x547c('0xae')]=function(_0x40421b){logger[_0x547c('0x34')](util['format'](_0x547c('0xaf'),_0x40421b[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x40421b[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}var _0x50d13b='\x22'+_0x40421b[_0x547c('0x62')]+'\x22';if(this[_0x547c('0x8b')](_0x40421b[_0x547c('0x7e')])){_0x50d13b+=','+_0x40421b[_0x547c('0x7e')];}var _0x57dae1=this[_0x547c('0x10')]['exec']('MRCPSynth',_0x50d13b);if(_0x57dae1[_0x547c('0xb2')]===-0x1){return _0x57dae1;}return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0xb3'),_0x50d13b));};AGIVertices[_0x547c('0x13')]['mrcprecog']=function(_0x5c3ccc){logger[_0x547c('0x34')](util['format'](_0x547c('0xb4'),_0x5c3ccc[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x5c3ccc[_0x547c('0xb5')])){return this['channel'][_0x547c('0xb0')](_0x547c('0xb6'));}var _0x580190=_0x5c3ccc[_0x547c('0xb5')];if(this[_0x547c('0x8b')](_0x5c3ccc['options'])){_0x580190+=','+_0x5c3ccc[_0x547c('0x7e')];}var _0xa5710=this[_0x547c('0x10')]['exec'](_0x547c('0xb7'),_0x580190);if(_0xa5710['result']===-0x1){return _0xa5710;}var _0x47c368=this[_0x547c('0xa8')]('RECOG_CONFIDENCE()',_0x547c('0xb8'));if(_0x47c368['result']===-0x1){return _0x47c368;}var _0x1d00ea=this['getAndSetVariable'](_0x547c('0xb9'),_0x547c('0xba'));if(_0x1d00ea[_0x547c('0xb2')]===-0x1){return _0x1d00ea;}var _0x1bf745=this[_0x547c('0xa8')](_0x547c('0xbb'),_0x547c('0xbc'));if(_0x1bf745[_0x547c('0xb2')]===-0x1){return _0x1bf745;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xbd'),_0x580190));};AGIVertices[_0x547c('0x13')][_0x547c('0x8')]=function(_0x6105fe){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xbe'),_0x6105fe[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0x8')]([_0x6105fe[_0x547c('0xbf')],_0x6105fe[_0x547c('0xc0')]]);};AGIVertices['prototype'][_0x547c('0xc1')]=function(_0x2ea971){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2ea971[_0x547c('0x3b')]));if(this[_0x547c('0x8b')](_0x2ea971[_0x547c('0x6a')])){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xc2'),_0x2ea971[_0x547c('0x6a')]));var _0xecf19c=this['channel'][_0x547c('0xc3')](_0x2ea971[_0x547c('0x6a')]);if(_0xecf19c[_0x547c('0xb2')]===-0x1){return _0xecf19c;}}return this[_0x547c('0x10')][_0x547c('0xc1')]();};AGIVertices[_0x547c('0x13')][_0x547c('0x4e')]=function(_0x30a5b2){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xc4'),_0x30a5b2[_0x547c('0x3b')]));if(!this['isConfigured'](_0x30a5b2[_0x547c('0x4d')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x30a5b2,_0x547c('0xc5'));}_0x30a5b2[_0x547c('0x50')]=moment();if(this['isConfigured'](_0x30a5b2['delay'])){_0x30a5b2[_0x547c('0x50')]=moment()[_0x547c('0xc6')](_0x30a5b2[_0x547c('0xc7')],'minutes');}if(!this[_0x547c('0x8b')](_0x30a5b2[_0x547c('0x52')])){_0x30a5b2[_0x547c('0x52')]=0x2;}this[_0x547c('0x46')][_0x547c('0xac')](this,_0x30a5b2);return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xc8'),_0x30a5b2['phone'],_0x30a5b2['list_id'],_0x30a5b2[_0x547c('0x50')]));};AGIVertices[_0x547c('0x13')]['custom_app']=function(_0x101cd1){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xc9'),_0x101cd1[_0x547c('0x3b')]));var _0x21d031=this[_0x547c('0x10')][_0x547c('0x5c')](_0x101cd1['application'],_0x101cd1['options']);if(_0x21d031[_0x547c('0xb2')]===-0x1){return _0x21d031;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')]('Executed\x20command\x20%s\x20%s',_0x101cd1[_0x547c('0xca')],_0x101cd1['options']));};AGIVertices[_0x547c('0x13')][_0x547c('0xcb')]=function(_0x5b1afb){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xcc'),_0x5b1afb[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x5b1afb[_0x547c('0x62')])){return this[_0x547c('0x10')]['noop']('no\x20text\x20configured');}var _0x21c274='\x22'+_0x5b1afb[_0x547c('0x62')]+'\x22';if(this['isConfigured'](_0x5b1afb[_0x547c('0x7e')])){_0x21c274+=','+_0x5b1afb['options'];}var _0x340512=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0xcd'),_0x21c274);if(_0x340512['result']===-0x1){return _0x340512;}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x21c274));};AGIVertices[_0x547c('0x13')]['sestektts']=function(_0x2b4fd7){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xce'),_0x2b4fd7[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x2b4fd7[_0x547c('0x62')])){return this[_0x547c('0x10')]['noop']('no\x20text\x20configured');}var _0x36ee98='\x22'+_0x2b4fd7[_0x547c('0x62')]+'\x22';if(this['isConfigured'](_0x2b4fd7[_0x547c('0x7e')])){_0x36ee98+=','+_0x2b4fd7[_0x547c('0x7e')];}var _0x4a5a9b=this['channel'][_0x547c('0x5c')](_0x547c('0xcd'),_0x36ee98);if(_0x4a5a9b[_0x547c('0xb2')]===-0x1){return _0x4a5a9b;}return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0xb3'),_0x36ee98));};AGIVertices[_0x547c('0x13')][_0x547c('0xcf')]=function(_0x5256b0){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xd0'),_0x5256b0[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x5256b0[_0x547c('0xb5')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb6'));}var _0x42c8c5=_0x5256b0[_0x547c('0xb5')];if(this[_0x547c('0x8b')](_0x5256b0[_0x547c('0x7e')])){_0x42c8c5+=','+_0x5256b0[_0x547c('0x7e')];}var _0x5f2608=this['channel'][_0x547c('0x5c')](_0x547c('0xb7'),_0x42c8c5);if(_0x5f2608[_0x547c('0xb2')]===-0x1){return _0x5f2608;}var _0x5add20=this[_0x547c('0xa8')](_0x547c('0xd1'),_0x547c('0xd2'));if(_0x5add20[_0x547c('0xb2')]===-0x1){return _0x5add20;}var _0x45f2b7=this[_0x547c('0xa8')]('RECOG_INPUT()',_0x547c('0xd3'));if(_0x45f2b7[_0x547c('0xb2')]===-0x1){return _0x45f2b7;}var _0x47ad34=this['getAndSetVariable'](_0x547c('0xbb'),_0x547c('0xd4'));if(_0x47ad34[_0x547c('0xb2')]===-0x1){return _0x47ad34;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xbd'),_0x42c8c5));};AGIVertices[_0x547c('0x13')][_0x547c('0xd5')]=function(_0x4a2d0d){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xd6'),_0x4a2d0d[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x4a2d0d[_0x547c('0xb5')])){return this[_0x547c('0x10')]['noop']('no\x20grammar\x20configured');}var _0x4eee3e=_0x4a2d0d[_0x547c('0xb5')];if(this['isConfigured'](_0x4a2d0d[_0x547c('0x7e')])){_0x4eee3e+=','+_0x4a2d0d[_0x547c('0x7e')];}var _0x135c87=this[_0x547c('0x10')]['exec'](_0x547c('0xb7'),_0x4eee3e);if(_0x135c87[_0x547c('0xb2')]===-0x1){return _0x135c87;}var _0x65a4e4=this['getAndSetVariable'](_0x547c('0xd1'),_0x547c('0xd7'));if(_0x65a4e4['result']===-0x1){return _0x65a4e4;}var _0x203b7d=this[_0x547c('0xa8')](_0x547c('0xb9'),_0x547c('0xd8'));if(_0x203b7d['result']===-0x1){return _0x203b7d;}var _0x1e3004=this[_0x547c('0xa8')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x1e3004[_0x547c('0xb2')]===-0x1){return _0x1e3004;}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xbd'),_0x4eee3e));};AGIVertices[_0x547c('0x13')][_0x547c('0xd9')]=function(_0x3abe71){logger[_0x547c('0x34')](util['format'](_0x547c('0xda'),_0x3abe71[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x3abe71[_0x547c('0xdb')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x3abe71,_0x547c('0xdc'));}var _0x1059cd=this['getSquareOdbc'][_0x547c('0xac')](this,_0x3abe71['odbc_id']);if(!_0x1059cd){return this[_0x547c('0x10')][_0x547c('0x31')](_0x3abe71,_0x547c('0xdd'));}if(!this[_0x547c('0x8b')](_0x3abe71[_0x547c('0xde')])){return this['channel'][_0x547c('0x31')](_0x3abe71,'no\x20query\x20configured');}var _0xae973e=_0x3abe71[_0x547c('0xde')][_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xdf'),_0xae973e));var _0x2026bf=this[_0x547c('0x2f')]['sync'](this,_0x1059cd,_0xae973e);this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x3abe71,_0xae973e);if(!this[_0x547c('0x8b')](_0x3abe71['variable_id'])){return this[_0x547c('0x10')]['noop'](_0x547c('0xe0'));}var _0x36eb83=this['getVariable'][_0x547c('0xac')](this,_0x3abe71[_0x547c('0xe1')]);if(!_0x36eb83){return this['channel'][_0x547c('0x31')](_0x3abe71,'no\x20variable\x20found');}var _0x85ac5c=this;_0x2026bf['forEach'](function(_0x2eff31,_0x288fa8){Object['keys'](_0x2eff31)['forEach'](function(_0x4cdef9){_0x85ac5c[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')]('%s[%s][%s]',_0x36eb83,_0x288fa8,_0x4cdef9),_0x2eff31[_0x4cdef9]);});});this[_0x547c('0x10')][_0x547c('0xaa')](util['format'](_0x547c('0xe2'),_0x36eb83),_0x2026bf[_0x547c('0xa0')]);return this[_0x547c('0x10')][_0x547c('0xb0')](util['format'](_0x547c('0xe3'),_0x36eb83));};AGIVertices['prototype'][_0x547c('0xe4')]=function(_0x27ad64){logger[_0x547c('0xe5')](util[_0x547c('0x2d')](_0x547c('0xe6'),_0x27ad64[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x27ad64[_0x547c('0xe7')])){return this['channel'][_0x547c('0x31')](_0x27ad64,'no\x20user\x20selected');}var _0x21c7be=this[_0x547c('0x1e')][_0x547c('0xac')](this,_0x27ad64[_0x547c('0xe7')]);if(!_0x21c7be){return this['channel']['error'](_0x27ad64,_0x547c('0xe8'));}var _0x490e1e=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0xe9'),[util[_0x547c('0x2d')](_0x547c('0xea'),_0x21c7be),_0x27ad64[_0x547c('0x6a')],_0x27ad64[_0x547c('0xeb')],_0x27ad64[_0x547c('0xec')]]);if(_0x490e1e[_0x547c('0xb2')]===-0x1){return _0x490e1e;}return this[_0x547c('0x10')]['noop'](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x547c('0x13')][_0x547c('0xed')]=function(_0x27aeb1){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x27aeb1[_0x547c('0x3b')]));if(!this['isConfigured'](_0x27aeb1[_0x547c('0x80')])){return this[_0x547c('0x10')]['noop'](_0x547c('0xee'));}if(!this[_0x547c('0x8b')](_0x27aeb1['text'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this[_0x547c('0x10')][_0x547c('0xef')]=!![];this['createSquareDetailsReport'](_0x27aeb1);this[_0x547c('0x45')](_0x27aeb1[_0x547c('0x62')],'in','','');this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0xf0'),_0x27aeb1[_0x547c('0x62')]));var _0x251e38=this[_0x547c('0x7f')]['sync'](this,_0x27aeb1);if(_0x251e38){for(var _0x57eba7 in _0x251e38){if(_0x251e38[_0x547c('0x9c')](_0x57eba7)){this[_0x547c('0x10')]['setVariable'](util['format']('DIALOGFLOW_%s',_0x57eba7[_0x547c('0x70')]()),_0x251e38[_0x57eba7]);}}this[_0x547c('0x45')](_0x251e38['speech'],_0x547c('0xf1'),'dialogflow','');return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xf2'),_0x251e38[_0x547c('0xf3')]));}return this['channel'][_0x547c('0x31')](_0x27aeb1,_0x547c('0xf4'));};AGIVertices[_0x547c('0x13')]['dialogflowV2']=function(_0x309343){logger['info'](util[_0x547c('0x2d')](_0x547c('0xf5'),_0x309343[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x309343['dialogflowV2_project_id'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xf6'));}if(!this[_0x547c('0x8b')](_0x309343[_0x547c('0x83')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20client_email\x20configured');}if(!this[_0x547c('0x8b')](_0x309343['private_key'])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20private_key\x20configured');}if(!this[_0x547c('0x8b')](_0x309343[_0x547c('0x85')])){return this['channel'][_0x547c('0xb0')](_0x547c('0xf7'));}if(!this[_0x547c('0x8b')](_0x309343[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this['channel']['bot']=!![];this[_0x547c('0x39')](_0x309343);this[_0x547c('0x45')](_0x309343[_0x547c('0x62')],'in','','');this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xf8'),_0x309343[_0x547c('0x62')]));var _0x25e06e=this[_0x547c('0xf9')][_0x547c('0xac')](this,_0x309343);if(_0x25e06e){for(var _0x583fce in _0x25e06e){if(_0x25e06e['hasOwnProperty'](_0x583fce)){if(_0x583fce!==_0x547c('0xfa')){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0xfb'),_0x583fce[_0x547c('0x70')]()),_0x25e06e[_0x583fce]);}}}this[_0x547c('0x45')](_0x25e06e[_0x547c('0xf3')],_0x547c('0xf1'),'dialogflowV2',_0x25e06e['providerResponse']);return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xfc'),_0x25e06e[_0x547c('0xf3')]));}return this[_0x547c('0x10')]['error'](_0x309343,_0x547c('0xfd'));};AGIVertices[_0x547c('0x13')][_0x547c('0xfe')]=function(_0x770ced){logger[_0x547c('0x34')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x770ced['label']));if(!this[_0x547c('0x8b')](_0x770ced[_0x547c('0xff')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x547c('0x8b')](_0x770ced[_0x547c('0x100')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x101'));}if(!this[_0x547c('0x8b')](_0x770ced['password'])){return this[_0x547c('0x10')]['noop'](_0x547c('0x102'));}if(!this[_0x547c('0x8b')](_0x770ced[_0x547c('0x103')])){return this['channel']['noop'](_0x547c('0xb1'));}this[_0x547c('0x10')][_0x547c('0xef')]=!![];this[_0x547c('0x39')](_0x770ced);this['createSquareMessage'](_0x770ced[_0x547c('0x62')],'in','','');this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('Trying\x20SestekNDA:\x20%s',_0x770ced[_0x547c('0x62')]));var _0x4da4e0=this['sestekNDA'][_0x547c('0xac')](this,_0x770ced);if(_0x4da4e0){for(var _0x2cee60 in _0x4da4e0){if(_0x4da4e0['hasOwnProperty'](_0x2cee60)){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x104'),_0x2cee60['toUpperCase']()),_0x4da4e0[_0x2cee60]);}}this[_0x547c('0x45')](_0x4da4e0['speech'],_0x547c('0xf1'),_0x547c('0xfe'),'');if(_0x4da4e0[_0x547c('0x105')]){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x4da4e0['audiofile']));var _0x5bbcbf=this[_0x547c('0x10')][_0x547c('0x106')](_0x4da4e0['audiofile']);try{fs['unlink'](_0x4da4e0[_0x547c('0x105')]+'.wav');}catch(_0x4c7112){logger[_0x547c('0x31')](_0x4c7112);}return _0x5bbcbf;}else{return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')]('SestekNDA\x20Result\x20%s',_0x4da4e0[_0x547c('0xf3')]));}}return this[_0x547c('0x10')][_0x547c('0x31')](_0x770ced,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x547c('0x107')]=function(_0x25b70d){logger['info'](util[_0x547c('0x2d')](_0x547c('0x108'),_0x25b70d['label']));return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x107'));};AGIVertices[_0x547c('0x13')][_0x547c('0x109')]=function(_0x2bceab){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x2bceab[_0x547c('0x3b')]));var _0x161191='';if(_0x2bceab['trunk_id']){if(!this[_0x547c('0x8b')](_0x2bceab[_0x547c('0x10a')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x2bceab,_0x547c('0x10b'));}else{var _0x1e0c5b=parseInt(_0x2bceab[_0x547c('0x10a')],0xa);if(isNaN(_0x1e0c5b)){_0x161191=_0x2bceab[_0x547c('0x10a')];}else{_0x161191=this[_0x547c('0x20')][_0x547c('0xac')](this,_0x2bceab[_0x547c('0x10a')]);if(!_0x161191){return this[_0x547c('0x10')]['error'](_0x2bceab,_0x547c('0x10c'));}}}}else if(_0x2bceab['trunk_name']){_0x161191=_0x2bceab['trunk_name'];}else{return this[_0x547c('0x10')][_0x547c('0x31')](_0x2bceab,_0x547c('0x10b'));}var _0x545620=this[_0x547c('0x10')]['exec'](_0x547c('0xe9'),[util[_0x547c('0x2d')](_0x547c('0x10d'),_0x161191,_0x2bceab[_0x547c('0x4c')]),_0x2bceab[_0x547c('0x6a')],_0x2bceab[_0x547c('0xeb')],_0x2bceab['url']]);if(_0x545620[_0x547c('0xb2')]===-0x1){return _0x545620;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x10e'),_0x547c('0xe9')));};AGIVertices[_0x547c('0x13')][_0x547c('0x10f')]=function(_0x7ba892){logger[_0x547c('0x34')](util['format'](_0x547c('0x110'),_0x7ba892['label']));return this['channel'][_0x547c('0xb0')](_0x547c('0x10f'));};AGIVertices[_0x547c('0x13')][_0x547c('0xe')]=function(_0x40061a){logger[_0x547c('0x34')](util['format'](_0x547c('0x111'),_0x40061a[_0x547c('0x3b')]));if(_0x40061a[_0x547c('0xad')]===0x0){return this[_0x547c('0xab')](_0x40061a);}_0x40061a[_0x547c('0xad')]-=0x1;if(!this[_0x547c('0x8b')](_0x40061a['file_id'])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x40061a,_0x547c('0x112'));}var _0x410192=this[_0x547c('0x22')]['sync'](this,_0x40061a[_0x547c('0x113')]);if(!_0x410192){return this[_0x547c('0x10')][_0x547c('0x31')](_0x40061a,'no\x20file\x20audio\x20found');}if(!this[_0x547c('0x8b')](_0x40061a[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0x31')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1748ef=this[_0x547c('0x10')][_0x547c('0x114')](_0x410192,_0x40061a['response'],_0x40061a[_0x547c('0x115')]);var _0x1201b7=_0x1748ef[_0x547c('0xb2')]?_0x1748ef['result']['toString']():'';logger['info']('test',JSON[_0x547c('0x78')](_0x1748ef));if(_0x1748ef['result']===-0x1){this[_0x547c('0x39')][_0x547c('0xac')](this,_0x40061a,_0x1201b7);return _0x1748ef;}else if(_0x1748ef['extra']==='timeout'){_0x1748ef[_0x547c('0xb2')]=_0x1201b7[_0x547c('0xa0')]>=parseInt(_0x40061a[_0x547c('0x116')])?'x':'i';}else{_0x1748ef[_0x547c('0xb2')]=_0x1201b7[_0x547c('0xa0')]>=parseInt(_0x40061a[_0x547c('0x116')])&&_0x1201b7[_0x547c('0xa0')]<=parseInt(_0x40061a[_0x547c('0x115')])?'x':'i';}var _0x214304=this['getVariable']['sync'](this,_0x40061a['variable_id']);if(!_0x214304){return this[_0x547c('0x10')][_0x547c('0x31')](_0x40061a,'no\x20variable\x20found');}this[_0x547c('0x10')][_0x547c('0xaa')](_0x214304,_0x1201b7);if(this[_0x547c('0x8b')](_0x40061a[_0x547c('0x117')])){var _0x1ddfff=parseInt(_0x40061a['hiddendigitsnum'],0xa);var _0x2f70e0=rs['generate']({'charset':'*','length':_0x1ddfff});var _0x5d8d4d=_0x1201b7[_0x547c('0xa0')];if(_0x5d8d4d>0x0){if(_0x5d8d4d>_0x1ddfff){this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x40061a,_0x40061a[_0x547c('0x118')]===_0x547c('0x119')?_0x2f70e0+_0x1201b7[_0x547c('0x11a')](_0x1ddfff):_0x1201b7[_0x547c('0x11a')](0x0,_0x5d8d4d-_0x1ddfff)+_0x2f70e0);}else{this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x40061a,rs[_0x547c('0x11b')]({'charset':'*','length':_0x5d8d4d}));}}else{this[_0x547c('0x39')][_0x547c('0xac')](this,_0x40061a,'');}}else{this[_0x547c('0x39')]['sync'](this,_0x40061a,_0x1201b7);}return _0x1748ef;};AGIVertices[_0x547c('0x13')]['getsecretdigits']=function(_0x28f27b){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x11c'),_0x28f27b[_0x547c('0x3b')]));return this[_0x547c('0xe')](_0x28f27b);};AGIVertices[_0x547c('0x13')][_0x547c('0x11d')]=function(_0x5f4eac){logger['info'](util['format'](_0x547c('0x11e'),_0x5f4eac[_0x547c('0x3b')]));this[_0x547c('0x39')]['sync'](this,_0x5f4eac,_0x5f4eac[_0x547c('0x11f')]);return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x120'),_0x5f4eac[_0x547c('0x11f')]));};AGIVertices[_0x547c('0x13')]['awspolly']=function(_0x1ddf54){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x121'),_0x1ddf54['label']));if(!this[_0x547c('0x8b')](_0x1ddf54[_0x547c('0x8e')])||!this[_0x547c('0x8b')](_0x1ddf54[_0x547c('0x8f')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x122'));}if(!this[_0x547c('0x8b')](_0x1ddf54[_0x547c('0x62')])){return this[_0x547c('0x10')]['noop']('no\x20text\x20configured');}this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')]('Trying\x20aws\x20Polly\x20%s',_0x1ddf54[_0x547c('0x62')]));var _0x2c4f37=this['awsPolly'][_0x547c('0xac')](this,_0x1ddf54);if(_0x2c4f37){this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x123'),_0x2c4f37));var _0x2d8ffd=this['channel'][_0x547c('0x106')](_0x2c4f37);try{fs[_0x547c('0x124')](_0x2c4f37+_0x547c('0x125'));}catch(_0x348577){logger[_0x547c('0x31')](_0x348577);}return _0x2d8ffd;}return this[_0x547c('0x10')][_0x547c('0x31')](_0x1ddf54,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x547c('0x13')][_0x547c('0x126')]=function(_0x303f60){logger[_0x547c('0x34')](util['format'](_0x547c('0x127'),_0x303f60[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x303f60[_0x547c('0x8e')])||!this['isConfigured'](_0x303f60[_0x547c('0x8f')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x122'));}if(!this['isConfigured'](_0x303f60['aws_bot_name'])){return this['channel'][_0x547c('0xb0')](_0x547c('0x128'));}if(!this[_0x547c('0x8b')](_0x303f60['text'])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20text\x20configured');}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x303f60);this[_0x547c('0x45')](_0x303f60[_0x547c('0x62')],'in','','');this[_0x547c('0x10')]['noop'](util['format'](_0x547c('0x129'),_0x303f60[_0x547c('0x62')]));var _0x1e8dec=this[_0x547c('0x92')]['sync'](this,_0x303f60);if(_0x1e8dec){for(var _0x39275c in _0x1e8dec){if(_0x1e8dec[_0x547c('0x9c')](_0x39275c)&&_['isString'](_0x1e8dec[_0x39275c])){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')]('AWS_LEX_%s',_0x39275c[_0x547c('0x70')]()),_0x1e8dec[_0x39275c]);}}if(_['isNil'](_0x1e8dec[_0x547c('0x7c')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x547c('0x45')](_0x1e8dec[_0x547c('0x7c')],_0x547c('0xf1'),_0x547c('0x12a'),'');return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x12b'),_0x1e8dec[_0x547c('0x7c')]));}}return this['channel']['error'](_0x303f60,_0x547c('0x12c'));};AGIVertices[_0x547c('0x13')][_0x547c('0x12d')]=function(_0x5ac314){logger['info'](util[_0x547c('0x2d')](_0x547c('0x12e'),_0x5ac314['label'],_0x5ac314[_0x547c('0x6a')]));if(!this[_0x547c('0x8b')](_0x5ac314[_0x547c('0x80')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20key\x20configured');}var _0x5699a0='wav';var _0x45fbb2=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,rs[_0x547c('0x11b')](0x4));var _0x4f4482=util[_0x547c('0x2d')](_0x547c('0xa2'),_0x45fbb2,_0x5699a0);var _0x23c84c=!![];if(_0x5ac314['beep']==='NOBEEP'){_0x23c84c=![];}var _0x54948d=this['channel'][_0x547c('0x130')](_0x45fbb2,_0x5699a0,_0x5ac314[_0x547c('0x131')],_0x5ac314[_0x547c('0x6a')],undefined,_0x23c84c);if(_0x54948d[_0x547c('0xb2')]!==-0x1){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('google\x20%s\x20file\x20created',_0x4f4482));var _0x1510a1=this[_0x547c('0x95')][_0x547c('0xac')](this,_0x5ac314,_0x4f4482);if(_0x1510a1){for(var _0x4824d1 in _0x1510a1){if(_0x1510a1[_0x547c('0x9c')](_0x4824d1)){this[_0x547c('0x10')]['setVariable'](util[_0x547c('0x2d')](_0x547c('0x132'),_0x4824d1[_0x547c('0x70')]()),_0x1510a1[_0x4824d1]);}}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x133'),JSON['stringify'](_0x1510a1)));}}return _0x54948d;};AGIVertices[_0x547c('0x13')]['tildeasr']=function(_0xad307c){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x134'),_0xad307c[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0xad307c[_0x547c('0x98')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x135'));}if(!this[_0x547c('0x8b')](_0xad307c[_0x547c('0x136')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x137'));}var _0x9ddf2=_0x547c('0x138');var _0x1b4961=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x1a386f=util[_0x547c('0x2d')](_0x547c('0xa2'),_0x1b4961,_0x9ddf2);var _0x3e4503=!![];if(_0xad307c['beep']===_0x547c('0x139')){_0x3e4503=![];}var _0x4cd14a=this[_0x547c('0x10')][_0x547c('0x130')](_0x1b4961,_0x9ddf2,_0xad307c['intKey'],_0xad307c[_0x547c('0x6a')],undefined,_0x3e4503);if(_0x4cd14a[_0x547c('0xb2')]!==-0x1){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x13a'),_0x1a386f));var _0x44309c=this[_0x547c('0x97')]['sync'](this,_0xad307c,_0x1a386f);if(_0x44309c){for(var _0x15e613 in _0x44309c){if(_0x44309c[_0x547c('0x9c')](_0x15e613)){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x13b'),_0x15e613[_0x547c('0x70')]()),_0x44309c[_0x15e613]);}}return this[_0x547c('0x10')]['noop'](util['format'](_0x547c('0x13c'),JSON[_0x547c('0x78')](_0x44309c)));}}return _0x4cd14a;};AGIVertices[_0x547c('0x13')]['gotoc']=function(_0xf3bc02){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x13d'),_0xf3bc02['label']));return this['channel'][_0x547c('0x13e')](_0xf3bc02[_0x547c('0x13f')],_0xf3bc02[_0x547c('0x41')],_0xf3bc02[_0x547c('0x42')]);};AGIVertices['prototype'][_0x547c('0x140')]=function(_0x4cc4bb){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x141'),_0x4cc4bb['label']));if(!this[_0x547c('0x8b')](_0x4cc4bb[_0x547c('0x142')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x4cc4bb,_0x547c('0x143'));}try{var _0x3522ba=eval(_0x4cc4bb['condition'])?'true':_0x547c('0x144');this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0x145'),_0x4cc4bb['condition'],_0x3522ba));return{'code':0xc8,'result':_0x3522ba};}catch(_0x2b3ba6){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x1226e5){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x1226e5['label']));if(!this[_0x547c('0x8b')](_0x1226e5[_0x547c('0x146')])){return this['channel']['error'](_0x1226e5,_0x547c('0x147'));}var _0xbb471d=this['getIntervals']['sync'](this,_0x1226e5['interval_id']);if(!_0xbb471d){return this[_0x547c('0x10')][_0x547c('0x31')](_0x1226e5,_0x547c('0x148'));}for(var _0x52e3c3=0x0;_0x52e3c3<_0xbb471d[_0x547c('0xa0')];_0x52e3c3+=0x1){var _0x7fdeb=this['channel'][_0x547c('0x14')](util[_0x547c('0x2d')](_0x547c('0x149'),_0xbb471d[_0x52e3c3]));if(_0x7fdeb[_0x547c('0xb2')]===-0x1){return _0x7fdeb;}logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],_0x7fdeb['extra']));if(_0x7fdeb[_0x547c('0xa7')]===_0x547c('0x14b')){logger[_0x547c('0x34')](util['format']('IFTIME\x20%s\x20%s',_0xbb471d[_0x52e3c3],_0x547c('0x14b')));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],_0x547c('0x14b')));return{'code':0xc8,'result':_0x547c('0x14b')};}else{logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],_0x547c('0x144')));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],'false'));}}return{'code':0xc8,'result':_0x547c('0x144')};};AGIVertices[_0x547c('0x13')][_0x547c('0x14c')]=function(_0x15458f){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x14d'),_0x15458f[_0x547c('0x3b')]));return this['channel']['hangup']();};AGIVertices[_0x547c('0x13')][_0x547c('0x14e')]=function(_0x3c0b69){logger['info'](util[_0x547c('0x2d')](_0x547c('0x14f'),_0x3c0b69[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x3c0b69[_0x547c('0x80')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xee'));}var _0x4430dd=_0x547c('0x138');var _0x2467e2=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x5386c4=util[_0x547c('0x2d')](_0x547c('0xa2'),_0x2467e2,_0x4430dd);var _0x3c29b9=!![];if(_0x3c0b69[_0x547c('0x150')]==='NOBEEP'){_0x3c29b9=![];}var _0x28dd3e=this[_0x547c('0x10')][_0x547c('0x130')](_0x2467e2,_0x4430dd,_0x3c0b69['intKey'],_0x3c0b69[_0x547c('0x6a')],undefined,_0x3c29b9);if(_0x28dd3e['result']!==-0x1){this['channel']['noop'](util[_0x547c('0x2d')]('ispeech\x20%s\x20file\x20created',_0x5386c4));var _0xeacc0a=this['ispeechASR']['sync'](this,_0x3c0b69,_0x5386c4);if(_0xeacc0a){for(var _0x39fdc2 in _0xeacc0a){if(_0xeacc0a[_0x547c('0x9c')](_0x39fdc2)){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x151'),_0x39fdc2[_0x547c('0x70')]()),_0xeacc0a[_0x39fdc2]);}}return this['channel'][_0x547c('0xb0')](util['format'](_0x547c('0x152'),JSON[_0x547c('0x78')](_0xeacc0a)));}}return _0x28dd3e;};AGIVertices[_0x547c('0x13')][_0x547c('0x153')]=function(_0x433d30){logger[_0x547c('0x34')](util['format'](_0x547c('0x154'),_0x433d30[_0x547c('0x3b')]));if(!this['isConfigured'](_0x433d30[_0x547c('0x80')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x433d30[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x155'),_0x433d30['text']));var _0x1ab6e0=this[_0x547c('0x87')][_0x547c('0xac')](this,_0x433d30);if(_0x1ab6e0){this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0x156'),_0x1ab6e0));var _0x2a7ae0=this[_0x547c('0x10')][_0x547c('0x106')](_0x1ab6e0,_0x433d30[_0x547c('0x131')]);try{fs[_0x547c('0x124')](_0x1ab6e0+'.wav');}catch(_0x31f68b){logger['error'](_0x31f68b);}return _0x2a7ae0;}return this[_0x547c('0x10')][_0x547c('0x31')](_0x433d30,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x547c('0x13')]['login']=function(_0x39e457){logger['info'](util[_0x547c('0x2d')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x39e457[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x39e457['findBy'])){return this[_0x547c('0x10')]['error'](_0x39e457,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x547c('0x157'),this['channel']['callerid'],_0x39e457['findBy']));var _0x36618f=this[_0x547c('0x5a')][_0x547c('0xac')](this,_0x39e457[_0x547c('0x158')]);if(_0x36618f){logger['info'](util[_0x547c('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x547c('0x3e')],_0x39e457[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x39e457[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger[_0x547c('0x34')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x547c('0x10')][_0x547c('0x3e')],_0x39e457[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')]['callerid'],_0x39e457['findBy']));return{'code':0xc8,'result':_0x547c('0x15c')};}};AGIVertices[_0x547c('0x13')][_0x547c('0x15d')]=function(_0x336e89){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x15e'),_0x336e89[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x336e89[_0x547c('0x158')])){return this[_0x547c('0x10')]['error'](_0x336e89,_0x547c('0x15f'));}logger[_0x547c('0x34')](util[_0x547c('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));var _0x28f8f2=this[_0x547c('0x160')][_0x547c('0xac')](this,_0x336e89[_0x547c('0x158')]);if(_0x28f8f2){logger['info'](util[_0x547c('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15c')};}};AGIVertices['prototype'][_0x547c('0x161')]=function(_0x2d7ed4){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x162'),_0x2d7ed4['label']));if(!this['isConfigured'](_0x2d7ed4[_0x547c('0x163')])){return this[_0x547c('0x10')]['error'](_0x2d7ed4,_0x547c('0x164'));}this['channel']['noop'](util[_0x547c('0x2d')](_0x547c('0x165'),_0x2d7ed4[_0x547c('0x163')]));var _0x556b00=eval(_0x2d7ed4[_0x547c('0x163')]);if(!this[_0x547c('0x8b')](_0x2d7ed4[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xe0'));}var _0x151cba=this[_0x547c('0x14')][_0x547c('0xac')](this,_0x2d7ed4[_0x547c('0xe1')]);if(!_0x151cba){return this[_0x547c('0x10')][_0x547c('0x31')](_0x2d7ed4,'no\x20variable\x20found');}if(_['isArray'](_0x556b00)){var _0x263366=this;_0x556b00[_0x547c('0x166')](function(_0x23add7,_0x54eb69){_0x263366[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x167'),_0x151cba,_0x54eb69),_0x23add7);});return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x168'),_0x151cba));}else{return this[_0x547c('0x10')][_0x547c('0xaa')](_0x151cba,_0x556b00);}};AGIVertices[_0x547c('0x13')]['menu']=function(_0x416264){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x416264[_0x547c('0x3b')]));if(_0x416264[_0x547c('0xad')]===0x0){return this[_0x547c('0xab')](_0x416264);}_0x416264[_0x547c('0xad')]-=0x1;if(!this[_0x547c('0x8b')](_0x416264['file_id'])){return this['channel'][_0x547c('0x31')](_0x416264,_0x547c('0x112'));}var _0x22f5cc=this['getSound'][_0x547c('0xac')](this,_0x416264[_0x547c('0x113')]);if(!_0x22f5cc){return this['channel'][_0x547c('0x31')](_0x416264,_0x547c('0x169'));}var _0x5d6c6c=this[_0x547c('0x10')][_0x547c('0x114')](_0x22f5cc,_0x416264['response'],_0x416264[_0x547c('0x16a')]);var _0x14828a=_0x5d6c6c[_0x547c('0xb2')];if(_0x5d6c6c[_0x547c('0xb2')]===-0x1){this[_0x547c('0x39')]['sync'](this,_0x416264,'-1');return _0x5d6c6c;}else if(_0x5d6c6c[_0x547c('0xa7')]===_0x547c('0x6a')){_0x5d6c6c[_0x547c('0xb2')]=_0x5d6c6c[_0x547c('0xb2')][_0x547c('0xa0')]>0x0?_0x5d6c6c['result']:'t';}else if(_[_0x547c('0x47')](_0x5d6c6c[_0x547c('0xb2')])){_0x5d6c6c[_0x547c('0xb2')]='#';_0x14828a='#';}if(!this['isConfigured'](_0x416264[_0x547c('0xe1')])){this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xe0'));}else{var _0x467e81=this[_0x547c('0x14')][_0x547c('0xac')](this,_0x416264[_0x547c('0xe1')]);if(!_0x467e81){return this[_0x547c('0x10')][_0x547c('0x31')](_0x416264,_0x547c('0x16b'));}this[_0x547c('0x10')]['setVariable'](_0x467e81,_0x14828a);}this[_0x547c('0x39')][_0x547c('0xac')](this,_0x416264,_0x14828a);return _0x5d6c6c;};AGIVertices['prototype'][_0x547c('0xb0')]=function(_0x5a15e6){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x5a15e6[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0xb0')](_0x5a15e6[_0x547c('0x16c')]||_0x5a15e6[_0x547c('0x3b')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x16d')]=function(_0x48ab51){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x16e'),_0x48ab51[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x48ab51[_0x547c('0x158')])){return this[_0x547c('0x10')]['error'](_0x48ab51,'no\x20find\x20by\x20configured');}logger[_0x547c('0x34')](util['format'](_0x547c('0x157'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51['findBy']));var _0x30890f=this[_0x547c('0x53')][_0x547c('0xac')](this,_0x48ab51[_0x547c('0x16f')]);var _0x1609d9=this['agentPause'][_0x547c('0xac')](this,_0x48ab51[_0x547c('0x158')],_0x30890f);if(_0x1609d9){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger['info'](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x547c('0x13')]['playback']=function(_0x59377a){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x170'),_0x59377a[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x59377a[_0x547c('0x113')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x59377a,_0x547c('0x112'));}var _0x3a6283=this[_0x547c('0x22')][_0x547c('0xac')](this,_0x59377a[_0x547c('0x113')]);if(!_0x3a6283){return this['channel']['error'](_0x59377a,_0x547c('0x169'));}var _0x312c76=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0x171'),[_0x3a6283,_0x59377a['opts']]);if(_0x312c76['result']===-0x1){return _0x312c76;}return this['channel'][_0x547c('0xb0')](util['format']('Executed\x20command\x20%s\x20%s',_0x547c('0x171'),_0x3a6283));};AGIVertices[_0x547c('0x13')]['queue']=function(_0x38655f){logger['info'](util[_0x547c('0x2d')](_0x547c('0x172'),_0x38655f['label']));if(!this['isConfigured'](_0x38655f[_0x547c('0x173')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x38655f,_0x547c('0x174'));}var _0x26cedc='';var _0xe042ea=parseInt(_0x38655f[_0x547c('0x173')],0xa);if(isNaN(_0xe042ea)){_0x26cedc=_0x38655f[_0x547c('0x173')];}else{_0x26cedc=this[_0x547c('0x17')][_0x547c('0xac')](this,_0x38655f[_0x547c('0x173')]);if(!_0x26cedc){return this[_0x547c('0x10')]['error'](_0x38655f,'no\x20queue\x20found');}}var _0x5abe57='';if(this[_0x547c('0x8b')](_0x38655f[_0x547c('0x113')])){var _0x3f029d=this['getSound']['sync'](this,_0x38655f[_0x547c('0x113')]);if(_0x3f029d){_0x5abe57=_0x3f029d;}}this[_0x547c('0x39')][_0x547c('0xac')](this,_0x38655f,_0x26cedc);if(_0x38655f[_0x547c('0xeb')][_0x547c('0x175')]('x')<0x0){_0x38655f['opts']+='x';}if(_0x38655f[_0x547c('0xeb')][_0x547c('0x175')]('X')<0x0){_0x38655f[_0x547c('0xeb')]+='X';}this[_0x547c('0x10')]['setVariable'](_0x547c('0x176'),_0x26cedc?_0x26cedc[_0x547c('0x177')]():'');var _0x327db8=this[_0x547c('0x10')][_0x547c('0x5c')]('QUEUE',[_0x26cedc,_0x38655f[_0x547c('0xeb')],_0x38655f['url'],_0x5abe57,_0x38655f[_0x547c('0x6a')],_0x38655f[_0x547c('0x8')],_0x38655f[_0x547c('0x178')],_0x38655f[_0x547c('0x179')],'',_0x38655f[_0x547c('0x17a')]]);if(_0x327db8[_0x547c('0xb2')]===-0x1){return _0x327db8;}return this[_0x547c('0x10')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x547c('0x17b'),_0x26cedc));};AGIVertices[_0x547c('0x13')][_0x547c('0x17c')]=function(_0x806a2e){logger[_0x547c('0x34')](util['format'](_0x547c('0x17d'),_0x806a2e[_0x547c('0x3b')]));var _0x4b6a72=_0x806a2e[_0x547c('0x17e')]||'wav';var _0x372c70=util[_0x547c('0x2d')]('%s_%s',this['channel']['uniqueid'],rs[_0x547c('0x11b')](0x5));var _0x2a73e1=util[_0x547c('0x2d')](_0x547c('0x17f'),FILES_PATH,_0x372c70,_0x4b6a72);var _0x92c34c=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,_0x372c70);this[_0x547c('0x3f')][_0x547c('0xac')](this,_0x806a2e,_0x372c70,_0x2a73e1);this[_0x547c('0x10')][_0x547c('0xaa')](_0x547c('0x180'),_0x372c70);logger[_0x547c('0x34')](_0x547c('0x181'),_0x92c34c,_0x4b6a72,_0x806a2e[_0x547c('0x182')],_0x806a2e[_0x547c('0x6a')]);return this['channel']['recordFile'](_0x92c34c,_0x4b6a72,_0x806a2e[_0x547c('0x182')],_0x806a2e[_0x547c('0x6a')],undefined,!![]);};AGIVertices[_0x547c('0x13')][_0x547c('0x183')]=function(_0x1129db){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x184'),_0x1129db[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x1129db['url'])){return this['channel'][_0x547c('0xb0')](_0x547c('0x185'));}var _0x55fbd0=this['restAPI'][_0x547c('0xac')](this,_0x1129db);logger[_0x547c('0x34')](util['format'](_0x547c('0x186'),util['inspect'](_0x55fbd0,{'showHidden':![],'depth':null})));if(!this[_0x547c('0x8b')](_0x1129db[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x187'));}var _0x4f0d29=this[_0x547c('0x14')]['sync'](this,_0x1129db[_0x547c('0xe1')]);if(!_0x4f0d29){return this[_0x547c('0x10')][_0x547c('0x31')](_0x1129db,_0x547c('0x16b'));}this['channel'][_0x547c('0xaa')](util[_0x547c('0x2d')]('%s_STATUS_CODE',_0x4f0d29),_0x55fbd0[_0x547c('0x7a')]?_0x55fbd0[_0x547c('0x7a')]:_0x547c('0x188'));this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')]('%s_STATUS_MESSAGE',_0x4f0d29),_0x55fbd0[_0x547c('0x7b')]?_0x55fbd0[_0x547c('0x7b')]:'OK');if(_0x55fbd0[_0x547c('0x71')]){try{this[_0x547c('0xa3')](_0x55fbd0[_0x547c('0x71')],_0x4f0d29);}catch(_0x3757a9){logger['error'](util['format'](_0x547c('0x189'),_0x4f0d29));}}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xe3'),_0x4f0d29));};AGIVertices[_0x547c('0x13')][_0x547c('0x18a')]=function(_0xaadcb7){logger['info'](util['format'](_0x547c('0x18b'),_0xaadcb7['label']));return this[_0x547c('0x10')]['sayDigits'](_0xaadcb7[_0x547c('0x18c')]['replace'](/\s+/g,''),_0xaadcb7[_0x547c('0x182')]);};AGIVertices[_0x547c('0x13')]['saynumber']=function(_0x1ce40e){logger['info'](util[_0x547c('0x2d')](_0x547c('0x18d'),_0x1ce40e[_0x547c('0x3b')]));return this['channel'][_0x547c('0x18e')](_0x1ce40e['number'][_0x547c('0x5e')](/\s+/g,''),_0x1ce40e[_0x547c('0x182')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x18f')]=function(_0x5e7c6b){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x190'),_0x5e7c6b[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0x191')](_0x5e7c6b[_0x547c('0x62')],_0x5e7c6b[_0x547c('0x182')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x192')]=function(_0x4aa68e){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x193'),_0x4aa68e[_0x547c('0x3b')]));if(!this['isConfigured'](_0x4aa68e[_0x547c('0x194')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x195'));}var _0x509e98=this[_0x547c('0x25')][_0x547c('0xac')](this,_0x4aa68e[_0x547c('0x194')]);if(!_0x509e98||!_0x509e98[_0x547c('0x196')]){return this[_0x547c('0x10')]['error'](_0x4aa68e,_0x547c('0x197'));}var _0x5eedb4={'from':util[_0x547c('0x2d')](_0x547c('0x198'),_0x509e98[_0x547c('0x19')],_0x509e98[_0x547c('0x199')]||_0x509e98['Smtp'][_0x547c('0x19a')]),'to':_0x4aa68e['to']||'','cc':_0x4aa68e['cc']||'','bcc':_0x4aa68e[_0x547c('0x19b')]||'','subject':_0x4aa68e[_0x547c('0x19c')],'html':_0x4aa68e[_0x547c('0x62')],'text':_0x4aa68e[_0x547c('0x62')]};var _0x166864={'tls':{'rejectUnauthorized':![]}};if(_0x509e98[_0x547c('0x196')][_0x547c('0x19d')]){_0x166864[_0x547c('0x19d')]=_0x509e98[_0x547c('0x196')][_0x547c('0x19d')];}else{_0x166864[_0x547c('0x19e')]=_0x509e98[_0x547c('0x196')]['host'];_0x166864['port']=_0x509e98[_0x547c('0x196')][_0x547c('0x19f')];_0x166864[_0x547c('0x1a0')]=_0x509e98['Smtp'][_0x547c('0x1a0')];}if(_0x509e98[_0x547c('0x196')][_0x547c('0x1a1')]){_0x166864[_0x547c('0x1a2')]={'user':_0x509e98[_0x547c('0x196')][_0x547c('0x19a')],'pass':_0x509e98[_0x547c('0x196')]['pass']};}if(this[_0x547c('0x8b')](_0x4aa68e[_0x547c('0x1a3')])){}logger['debug']('sendMail\x20message',JSON[_0x547c('0x78')](_0x5eedb4));this['createSquareDetailsReport']['sync'](this,_0x4aa68e,_0x4aa68e[_0x547c('0x194')]);this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x509e98['name']));this[_0x547c('0x27')][_0x547c('0xac')](this,_0x166864,_0x5eedb4);return this[_0x547c('0x10')]['noop'](_0x547c('0x1a4'));};AGIVertices[_0x547c('0x13')]['sendFax']=function(_0x3b3d31){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x1a5'),_0x3b3d31[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x1a6'));};AGIVertices[_0x547c('0x13')]['sendSMS']=function(_0x26a68f){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1a7'),_0x26a68f[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x26a68f['sms_account_id'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x1a8'));}var _0x20f33b=this[_0x547c('0x37')][_0x547c('0xac')](this,_0x26a68f[_0x547c('0x1a9')]);if(!_0x20f33b){return this['channel'][_0x547c('0x31')](_0x26a68f,_0x547c('0x1aa'));}var _0x125278={'body':_0x26a68f[_0x547c('0x1ab')],'phone':_0x26a68f['to']||'','SmsAccountId':_0x20f33b['id']};logger[_0x547c('0xe5')](_0x547c('0x1ac'),JSON['stringify'](_0x125278));this[_0x547c('0x39')][_0x547c('0xac')](this,_0x26a68f,_0x26a68f[_0x547c('0x1a9')]);this['channel']['noop'](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x20f33b[_0x547c('0x19')]));this[_0x547c('0x1ad')][_0x547c('0xac')](this,_0x125278);return this['channel'][_0x547c('0xb0')](_0x547c('0x1ae'));};AGIVertices['prototype'][_0x547c('0x1af')]=function(_0x4498f3){logger[_0x547c('0x34')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x4498f3['label']));if(!this['isConfigured'](_0x4498f3[_0x547c('0xe1')])){return this['channel'][_0x547c('0x31')](_0x4498f3,_0x547c('0x1b0'));}var _0x27b6e7=this[_0x547c('0x14')][_0x547c('0xac')](this,_0x4498f3[_0x547c('0xe1')]);if(!_0x27b6e7){return this[_0x547c('0x10')][_0x547c('0x31')](_0x4498f3,_0x547c('0x16b'));}return this['channel'][_0x547c('0xaa')](_0x27b6e7,_0x4498f3[_0x547c('0x1b1')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x1b2')]=function(_0x15b69c){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20START\x20(%s)\x20block',_0x15b69c['label']));this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x1b3'));if(_0x15b69c['answer']===_0x547c('0x1b4')){this['channel'][_0x547c('0xb0')](_0x547c('0x1b5'));return this[_0x547c('0x10')]['answer']();}return this[_0x547c('0x10')][_0x547c('0xb0')]('Skipped\x20Answer');};AGIVertices[_0x547c('0x13')][_0x547c('0x1b6')]=function(_0x169091){logger['info'](util['format'](_0x547c('0x1b7'),_0x169091[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x169091[_0x547c('0x1b8')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x169091,_0x547c('0x1b9'));}var _0x530d50=this[_0x547c('0x1a')][_0x547c('0xac')](this,_0x169091[_0x547c('0x1b8')]);if(!this[_0x547c('0x8b')](_0x530d50)){return this['channel'][_0x547c('0x31')](_0x169091,util['format'](_0x547c('0x1ba'),_0x169091[_0x547c('0x1b8')]));}if(_0x530d50===this[_0x547c('0x10')]['arg_1']){return this[_0x547c('0x10')]['error'](_0x169091,_0x547c('0x1bb'));}this[_0x547c('0x39')]['sync'](this,_0x169091,_0x530d50);var _0x4eca26=this['channel'][_0x547c('0x5c')](_0x547c('0x1bc'),util[_0x547c('0x2d')](_0x547c('0x1bd'),config[_0x547c('0x8')][_0x547c('0x19e')]||_0x547c('0x1be'),_0x530d50,this[_0x547c('0x10')][_0x547c('0x3d')]));if(_0x4eca26[_0x547c('0xb2')]===-0x1){return _0x4eca26;}return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')]('Executed\x20command\x20%s\x20%s',_0x547c('0x1bc'),_0x530d50));};AGIVertices[_0x547c('0x13')][_0x547c('0x1bf')]=function(_0x57326b){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x1c0'),_0x57326b[_0x547c('0x3b')]));var _0x44c078=this[_0x547c('0x5b')][_0x547c('0xac')](this,_0x57326b['command']);this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x57326b,_0x57326b[_0x547c('0xbf')]);if(this[_0x547c('0x8b')](_0x57326b[_0x547c('0xe1')])){var _0x855cb3=this['getVariable'][_0x547c('0xac')](this,_0x57326b[_0x547c('0xe1')]);if(_0x855cb3){this[_0x547c('0x10')][_0x547c('0xaa')](_0x855cb3,_0x44c078);return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1c1'),_0x57326b[_0x547c('0xbf')],_0x855cb3));}}return this[_0x547c('0x10')][_0x547c('0xb0')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x57326b['command']));};AGIVertices[_0x547c('0x13')][_0x547c('0x1c2')]=function(_0x4a38af){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x1c3'),_0x4a38af[_0x547c('0x3b')]));_0x4a38af[_0x547c('0x62')]=_0x4a38af[_0x547c('0x62')][_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4a38af[_0x547c('0x60')])){return this[_0x547c('0x10')]['noop'](_0x547c('0x1c4'));}if(!this[_0x547c('0x8b')](_0x4a38af['text'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1c5'),_0x4a38af['text']));var _0xea5d21=this['googleCloudTTS']['sync'](this,_0x4a38af);if(_0xea5d21){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1c6'),_0xea5d21));var _0x105da8=this['channel'][_0x547c('0x106')](_0xea5d21);try{fs[_0x547c('0x124')](_0xea5d21+_0x547c('0x125'));}catch(_0x4b4130){logger['error'](_0x4b4130);}return _0x105da8;}return this[_0x547c('0x10')][_0x547c('0x31')](_0x4a38af,_0x547c('0x1c7'));};AGIVertices[_0x547c('0x13')][_0x547c('0x1c8')]=function(_0x7bfc89){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1c9'),_0x7bfc89['label']));_0x7bfc89[_0x547c('0x62')]=_0x7bfc89[_0x547c('0x62')][_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x7bfc89[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20text\x20configured');}this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1ca'),_0x7bfc89['text']));var _0x2a3508=this[_0x547c('0x67')][_0x547c('0xac')](this,_0x7bfc89);if(_0x2a3508){this[_0x547c('0x10')]['noop'](util['format'](_0x547c('0x1cb'),_0x2a3508));var _0x3e79e1=this[_0x547c('0x10')][_0x547c('0x106')](_0x2a3508);try{fs[_0x547c('0x124')](_0x2a3508+'.wav');}catch(_0x40fa4b){logger[_0x547c('0x31')](_0x40fa4b);}return _0x3e79e1;}return this['channel'][_0x547c('0x31')](_0x7bfc89,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x547c('0x13')][_0x547c('0x1cc')]=function(_0x56932e){logger['info'](util['format'](_0x547c('0x1cd'),_0x56932e[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x56932e[_0x547c('0x158')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x56932e,_0x547c('0x15f'));}logger['info'](util[_0x547c('0x2d')](_0x547c('0x157'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x56932e['findBy']));var _0x46e7a9=this['agentUnpause'][_0x547c('0xac')](this,_0x56932e['findBy']);if(_0x46e7a9){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x56932e['findBy']));this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x56932e['findBy']));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger[_0x547c('0x34')](util[_0x547c('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x547c('0x10')]['callerid'],_0x56932e[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x15b'),this['channel'][_0x547c('0x3e')],_0x56932e[_0x547c('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x547c('0x13')]['voicemail']=function(_0x5ce54a){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1ce'),_0x5ce54a[_0x547c('0x3b')]));var _0x44f83e=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0x1cf'),[_0x5ce54a['mailbox'],_0x5ce54a[_0x547c('0x7e')]]);if(_0x44f83e[_0x547c('0xb2')]===-0x1){return _0x44f83e;}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1d0'),_0x547c('0x1cf'),_0x5ce54a[_0x547c('0x1d1')]));};AGIVertices[_0x547c('0x13')][_0x547c('0x1d2')]=function(_0x11cf1b){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1d3'),_0x11cf1b[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x11cf1b[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x11cf1b,_0x547c('0x1b0'));}var _0x5d47ae=this[_0x547c('0x14')]['sync'](this,_0x11cf1b[_0x547c('0xe1')]);if(!_0x5d47ae){return this[_0x547c('0x10')][_0x547c('0x31')](_0x11cf1b,_0x547c('0x16b'));}var _0x391845=this[_0x547c('0x10')][_0x547c('0x14')](_0x5d47ae);return{'code':0xc8,'result':_0x391845['extra']?_0x391845[_0x547c('0xa7')]:'-'};};String['prototype'][_0x547c('0xa6')]=function(_0xc48591,_0x156307){return this[_0x547c('0xa5')](_0xc48591)[_0x547c('0x1d4')](_0x156307);};module['exports']=AGIVertices; \ No newline at end of file +var _0xc9de=['500\x20-\x20Internal\x20Server\x20Error','options','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','clear','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','no\x20database\x20selected','odbc_id','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Trying\x20Dialogflow:\x20%s','googleDialogflow','hasOwnProperty','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','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\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','maxRetry','digit','pause','getPause','success','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','record','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','email','subject','service','host','port','secure','authentication','auth','template_id','Trying\x20SendMail\x20with\x20account\x20%s','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','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','agi://%s/square,\x22%s\x22,\x22%s\x22','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','exports','path','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','mailRpc','prototype','rpc','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','channel','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','format','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','toUpperCase','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message'];(function(_0x1a27df,_0x11891c){var _0x194543=function(_0x5431c2){while(--_0x5431c2){_0x1a27df['push'](_0x1a27df['shift']());}};_0x194543(++_0x11891c);}(_0xc9de,0x140));var _0xec9d=function(_0x6d6650,_0x37087d){_0x6d6650=_0x6d6650-0x0;var _0x3033d4=_0xc9de[_0x6d6650];return _0x3033d4;};'use strict';var fs=require('fs');var path=require(_0xec9d('0x0'));var util=require(_0xec9d('0x1'));var _=require(_0xec9d('0x2'));var sh=require('shelljs');var odbc=require(_0xec9d('0x3'))();var rs=require(_0xec9d('0x4'));var moment=require(_0xec9d('0x5'));var Mustache=require(_0xec9d('0x6'));var rp=require(_0xec9d('0x7'));var logger=require(_0xec9d('0x8'))(_0xec9d('0x9'));var config=require(_0xec9d('0xa'));var scripts=require('./scripts');var FILES_PATH=_0xec9d('0xb');var recursiveMapAttributes=[_0xec9d('0xc'),_0xec9d('0xd')];var verticesWithRetry=[_0xec9d('0xe'),'getdigits',_0xec9d('0xf')];var AGIVertices=function(_0x552d43,_0x923b58,_0x56f2be){this['channel']=_0x552d43;this['rpc']=_0x923b58;this[_0xec9d('0x10')]=_0x56f2be;};AGIVertices[_0xec9d('0x11')]['getVariable']=function(_0x42abe5,_0x255cf7){this[_0xec9d('0x12')]['getVariableById'](_0x42abe5)[_0xec9d('0x13')](function(_0x45c7ef){_0x255cf7(null,_0x45c7ef?_0x45c7ef[_0xec9d('0x14')]:![]);})['catch'](function(_0x326385){_0x255cf7(_0x326385);});};AGIVertices['prototype'][_0xec9d('0x15')]=function(_0x41b5c7,_0x58c370){this[_0xec9d('0x12')][_0xec9d('0x16')](_0x41b5c7)[_0xec9d('0x13')](function(_0x117b77){_0x58c370(null,_0x117b77?_0x117b77[_0xec9d('0x14')]:![]);})[_0xec9d('0x17')](function(_0x53e74e){_0x58c370(_0x53e74e);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x18')]=function(_0x162d32,_0x5f5949){this[_0xec9d('0x12')][_0xec9d('0x19')](_0x162d32)[_0xec9d('0x13')](function(_0xc5b105){_0x5f5949(null,_0xc5b105?_0xc5b105[_0xec9d('0x14')]:![]);})['catch'](function(_0x5ddc51){_0x5f5949(_0x5ddc51);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x1a')]=function(_0x40e0a8,_0x33a967){this['rpc'][_0xec9d('0x1b')](_0x40e0a8)['then'](function(_0x463cbc){_0x33a967(null,_0x463cbc?_0x463cbc[_0xec9d('0x1c')]:![]);})[_0xec9d('0x17')](function(_0x1125fa){_0x33a967(_0x1125fa);});};AGIVertices['prototype'][_0xec9d('0x1d')]=function(_0x126e4e,_0x51ee86){this[_0xec9d('0x12')][_0xec9d('0x1e')](_0x126e4e)['then'](function(_0x24d3f2){_0x51ee86(null,_0x24d3f2?_0x24d3f2[_0xec9d('0x14')]:![]);})[_0xec9d('0x17')](function(_0x3f54d6){_0x51ee86(_0x3f54d6);});};AGIVertices['prototype'][_0xec9d('0x1f')]=function(_0x3a35a3,_0xf59b4){this['rpc'][_0xec9d('0x20')](_0x3a35a3)['then'](function(_0x5ccfea){_0xf59b4(null,_0x5ccfea?_0x5ccfea[_0xec9d('0x14')]:![]);})[_0xec9d('0x17')](function(_0x9aa176){_0xf59b4(_0x9aa176);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x21')]=function(_0x4f2374,_0x38c218){var _0x5c4e9d=this;this[_0xec9d('0x12')][_0xec9d('0x22')](_0x4f2374)[_0xec9d('0x13')](function(_0x3bfc0c){_0x38c218(null,_0x3bfc0c?_0x5c4e9d[_0xec9d('0x23')](_0x3bfc0c['save_name']):![]);})[_0xec9d('0x17')](function(_0x322576){_0x38c218(_0x322576);});};AGIVertices['prototype'][_0xec9d('0x24')]=function(_0x4d6d03,_0x777595){this[_0xec9d('0x12')]['getMailAccountById'](_0x4d6d03)['then'](function(_0x58307a){_0x777595(null,_0x58307a?_0x58307a:![]);})[_0xec9d('0x17')](function(_0xc44fc4){_0x777595(_0xc44fc4);});};AGIVertices[_0xec9d('0x11')]['sendMailMessage']=function(_0x4418de,_0x1cb20a,_0x768098){this[_0xec9d('0x10')][_0xec9d('0x25')](_0x4418de,_0x1cb20a)[_0xec9d('0x13')](function(){_0x768098(null);})[_0xec9d('0x17')](function(_0x32a9b1){_0x768098(_0x32a9b1);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x26')]=function(_0x47b6ef,_0x728515){this[_0xec9d('0x12')][_0xec9d('0x27')](_0x47b6ef)[_0xec9d('0x13')](function(_0x384bc0){if(_0x384bc0){if(_0x384bc0[_0xec9d('0x28')]){_0x728515(null,[_0x384bc0[_0xec9d('0x29')]]);}else{_0x728515(null,_['map'](_0x384bc0['Intervals'],_0xec9d('0x29')));}}else{_0x728515(null,![]);}})[_0xec9d('0x17')](function(_0x1f30c7){_0x728515(_0x1f30c7);});};AGIVertices['prototype'][_0xec9d('0x23')]=function(_0x283e3d){return util['format'](_0xec9d('0x2a'),FILES_PATH,_0x283e3d);};AGIVertices['prototype'][_0xec9d('0x2b')]=function(_0x20f873,_0x121cf5,_0x2d7ce9){odbc[_0xec9d('0x2c')](_0x20f873,function(_0xaf92b8){if(_0xaf92b8){logger[_0xec9d('0x2d')](_0xec9d('0x2e'),_0xaf92b8);_0x2d7ce9(_0xaf92b8);}else{logger[_0xec9d('0x2f')](_0xec9d('0x30'));odbc['query'](_0x121cf5,function(_0x6e257a,_0x5c6c59){if(_0x6e257a){logger[_0xec9d('0x2f')](_0xec9d('0x31'),_0x121cf5);_0x2d7ce9(_0x6e257a);}else{logger['info'](_0xec9d('0x32'),_0x121cf5);odbc[_0xec9d('0x33')](function(_0x4a81bb){if(_0x4a81bb){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4a81bb);}_0x2d7ce9(null,_0x5c6c59);});}});}});};AGIVertices['prototype'][_0xec9d('0x34')]=function(_0xe890e1,_0x3189e3){this[_0xec9d('0x12')]['getSmsAccountById'](_0xe890e1)[_0xec9d('0x13')](function(_0xb0c737){_0x3189e3(null,_0xb0c737?_0xb0c737:![]);})[_0xec9d('0x17')](function(_0xf0d3f3){_0x3189e3(_0xf0d3f3);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x35')]=function(_0x17de61,_0x5cf7bc){this[_0xec9d('0x12')][_0xec9d('0x35')](_0x17de61)[_0xec9d('0x13')](function(_0x13549b){_0x5cf7bc(null,_0x13549b);})['catch'](function(_0x367dd2){_0x5cf7bc(_0x367dd2);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x36')]=function(_0x476a71,_0x155e6e,_0x41277b){this[_0xec9d('0x12')][_0xec9d('0x36')]({'uniqueid':this['channel'][_0xec9d('0x37')],'node':_0x476a71[_0xec9d('0x38')],'application':_0x476a71[_0xec9d('0x39')],'data':_0x155e6e||null,'project_name':this[_0xec9d('0x3a')][_0xec9d('0x3b')],'callerid':this[_0xec9d('0x3a')][_0xec9d('0x3c')]})[_0xec9d('0x13')](function(_0x4652c5){if(_0x41277b){_0x41277b(null,_0x4652c5);}})['catch'](function(_0x457d07){if(_0x41277b){_0x41277b(_0x457d07);}});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x3d')]=function(_0x1d9e49,_0x22184e,_0x6ca6dc,_0x12c9dd){this[_0xec9d('0x12')][_0xec9d('0x3d')]({'uniqueid':this[_0xec9d('0x3a')][_0xec9d('0x37')],'callerid':this[_0xec9d('0x3a')]['callerid'],'calleridname':this[_0xec9d('0x3a')][_0xec9d('0x3e')],'context':this[_0xec9d('0x3a')][_0xec9d('0x3f')],'extension':this['channel']['extension'],'priority':this[_0xec9d('0x3a')][_0xec9d('0x40')],'accountcode':this['channel'][_0xec9d('0x41')],'dnid':this[_0xec9d('0x3a')][_0xec9d('0x42')],'projectName':this[_0xec9d('0x3a')][_0xec9d('0x3b')],'saveName':_0x22184e,'filename':_0x1d9e49['file']||_0x22184e,'savePath':_0x6ca6dc})[_0xec9d('0x13')](function(_0xcfbbe9){_0x12c9dd(null,_0xcfbbe9);})[_0xec9d('0x17')](function(_0x5fbe21){_0x12c9dd(_0x5fbe21);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x43')]=function(_0x6c6fb7,_0x4e6c46,_0x1fccd3,_0x27f2dd,_0x4fe01e){this[_0xec9d('0x12')]['createSquareMessage']({'uniqueid':this[_0xec9d('0x3a')][_0xec9d('0x37')],'body':_0x6c6fb7,'direction':_0x4e6c46,'providerName':_0x1fccd3,'providerResponse':_0x27f2dd})[_0xec9d('0x13')](function(_0x28245e){if(_0x4fe01e){_0x4fe01e(null,_0x28245e);}})[_0xec9d('0x17')](function(_0x50b249){if(_0x4fe01e){_0x4fe01e(_0x50b249);}});};AGIVertices[_0xec9d('0x11')]['createCmContact']=function(_0x28c56f,_0x2cb698){this[_0xec9d('0x12')][_0xec9d('0x44')]({'firstName':_[_0xec9d('0x45')](_0x28c56f[_0xec9d('0x14')])||_[_0xec9d('0x46')](_0x28c56f[_0xec9d('0x14')])?_0xec9d('0x47')+Math['random']():_0x28c56f[_0xec9d('0x14')],'lastName':_[_0xec9d('0x45')](_0x28c56f[_0xec9d('0x48')])||_[_0xec9d('0x46')](_0x28c56f[_0xec9d('0x48')])?null:_0x28c56f[_0xec9d('0x48')],'phone':_0x28c56f[_0xec9d('0x49')],'ListId':_0x28c56f[_0xec9d('0x4a')],'scheduledat':_0x28c56f['scheduledAt'],'callbackUniqueid':this[_0xec9d('0x3a')][_0xec9d('0x37')],'tags':_0xec9d('0x4b'),'description':_0xec9d('0x4c')+_0x28c56f[_0xec9d('0x4d')][_0xec9d('0x4e')](),'priority':_0x28c56f[_0xec9d('0x4f')]})[_0xec9d('0x13')](function(_0x24c3ef){_0x2cb698(null,_0x24c3ef);})['catch'](function(_0x593661){_0x2cb698(_0x593661);});};AGIVertices[_0xec9d('0x11')]['getPause']=function(_0x470071,_0x48a029){this[_0xec9d('0x12')][_0xec9d('0x50')](_0x470071)[_0xec9d('0x13')](function(_0x2a90d4){_0x48a029(null,_0x2a90d4?_0x2a90d4[_0xec9d('0x14')]:![]);})[_0xec9d('0x17')](function(_0x812ec4){_0x48a029(_0x812ec4);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x51')]=function(_0x365594,_0x62de7a,_0xbd079f){var _0x2b60b6={'role':_0xec9d('0x52')};_0x2b60b6[_0x365594]=this[_0xec9d('0x3a')][_0xec9d('0x3c')];this['rpc'][_0xec9d('0x51')](_0x2b60b6,_0x62de7a,this[_0xec9d('0x3a')]['uniqueid'])['then'](function(_0x2a58de){_0xbd079f(null,_[_0xec9d('0x46')](_0x2a58de)?![]:!![]);})[_0xec9d('0x17')](function(_0x4d6dfb){logger[_0xec9d('0x2d')](_0x4d6dfb);_0xbd079f(null,![]);});};AGIVertices['prototype'][_0xec9d('0x53')]=function(_0x39925a,_0x26235d){var _0x1b46cb={'role':_0xec9d('0x52')};_0x1b46cb[_0x39925a]=this[_0xec9d('0x3a')]['callerid'];this[_0xec9d('0x12')][_0xec9d('0x53')](_0x1b46cb)[_0xec9d('0x13')](function(_0x5532e9){_0x26235d(null,_[_0xec9d('0x46')](_0x5532e9)?![]:!![]);})[_0xec9d('0x17')](function(_0x4596cb){logger[_0xec9d('0x2d')](_0x4596cb);_0x26235d(null,![]);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x54')]=function(_0x7ac1,_0x3f6d26){var _0x47f3cd={'role':_0xec9d('0x52')};_0x47f3cd[_0x7ac1]=this[_0xec9d('0x3a')][_0xec9d('0x3c')];this[_0xec9d('0x12')][_0xec9d('0x54')](_0x47f3cd)[_0xec9d('0x13')](function(_0x129b12){_0x3f6d26(null,_[_0xec9d('0x46')](_0x129b12)?![]:!![]);})[_0xec9d('0x17')](function(_0x2091ce){logger[_0xec9d('0x2d')](_0x2091ce);_0x3f6d26(null,![]);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x55')]=function(_0x4d4cb2,_0xa6f7d9){var _0x157894={'role':_0xec9d('0x52')};_0x157894[_0x4d4cb2]=this[_0xec9d('0x3a')]['callerid'];var _0x44df7b=_0x4d4cb2!='internal'?util[_0xec9d('0x56')](_0xec9d('0x57'),'LOCAL',this[_0xec9d('0x3a')]['callerid']):undefined;this[_0xec9d('0x12')][_0xec9d('0x55')](_0x157894,_0x44df7b)[_0xec9d('0x13')](function(_0x1ac948){_0xa6f7d9(null,_[_0xec9d('0x46')](_0x1ac948)?![]:!![]);})['catch'](function(_0x2c551c){logger['error'](_0x2c551c);_0xa6f7d9(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x1e5068,_0xf27573){sh[_0xec9d('0x58')](_[_0xec9d('0x59')](_0x1e5068),function(_0x1a15c8,_0x7ff6cb){var _0x4bee25=_0x7ff6cb[_0xec9d('0x5a')](/(\r\n|\n|\r)/gm,'');_0xf27573(null,_0x4bee25);});};AGIVertices[_0xec9d('0x11')]['googleCloudTTS']=function(_0x6ee416,_0x53c3d7){scripts[_0xec9d('0x5b')](_0x6ee416[_0xec9d('0x5c')],_0x6ee416['google_cloud_tts_text_type']||_0xec9d('0x5d'),_0x6ee416[_0xec9d('0x5d')],_0x6ee416[_0xec9d('0x5e')]||_0xec9d('0x5f'),_0x6ee416[_0xec9d('0x60')]||'MALE',_0x6ee416[_0xec9d('0x61')]||_0xec9d('0x62'))[_0xec9d('0x13')](function(_0xed8eb2){_0x53c3d7(null,_0xed8eb2);})['catch'](function(_0x45fcfd){_0x53c3d7(_0x45fcfd);});};AGIVertices['prototype'][_0xec9d('0x63')]=function(_0x6a557e,_0x5073a0){scripts['googleTTS'](_0x6a557e[_0xec9d('0x5d')],_0x6a557e[_0xec9d('0x64')]||'en',0x1)[_0xec9d('0x13')](function(_0x2e5ea7){_0x5073a0(null,_0x2e5ea7);})['catch'](function(_0x48ed7b){_0x5073a0(_0x48ed7b);});};AGIVertices['prototype'][_0xec9d('0x65')]=function(_0x37d423,_0x31ecf0){var _0x46cb4a={'uri':_0x37d423[_0xec9d('0x66')],'method':_0x37d423[_0xec9d('0x67')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x37d423[_0xec9d('0x68')])==='number'&&parseInt(_0x37d423[_0xec9d('0x68')])>=0x1?parseInt(_0x37d423[_0xec9d('0x68')])*0x3e8:0x5*0x3e8};if(_[_0xec9d('0x69')]([_0xec9d('0x6a'),_0xec9d('0x6b')],_0x46cb4a[_0xec9d('0x67')][_0xec9d('0x6c')]())){try{_0x46cb4a['body']=_0x37d423['rawBody']?JSON['parse'](_0x37d423[_0xec9d('0xd')]):{};}catch(_0x5eab7a){logger[_0xec9d('0x2d')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5eab7a);}}try{_0x46cb4a[_0xec9d('0x6d')]=_0x37d423[_0xec9d('0xc')]?JSON[_0xec9d('0x6e')](_0x37d423[_0xec9d('0xc')]):{};}catch(_0x44b30d){logger[_0xec9d('0x2d')](_0xec9d('0x6f'),_0x44b30d);}if(_0x37d423[_0xec9d('0x70')]){try{var _0x564138=require(_0x37d423[_0xec9d('0x70')])[_0xec9d('0x71')](this,_0x46cb4a);_0x46cb4a[_0xec9d('0x72')]=Mustache[_0xec9d('0x73')](_0x37d423[_0xec9d('0x66')],_0x564138,{},['$$','$$']);if(_0x46cb4a[_0xec9d('0x6d')]){_0x46cb4a[_0xec9d('0x6d')]=JSON['parse'](Mustache[_0xec9d('0x73')](JSON[_0xec9d('0x74')](_0x46cb4a[_0xec9d('0x6d')]),_0x564138,{},['$$','$$']));}if(_0x46cb4a[_0xec9d('0x75')]){_0x46cb4a['body']=JSON[_0xec9d('0x6e')](Mustache[_0xec9d('0x73')](JSON['stringify'](_0x46cb4a[_0xec9d('0x75')]),_0x564138,{},['$$','$$']));}}catch(_0x1082b5){logger[_0xec9d('0x2d')](_0xec9d('0x76'),_0x1082b5);}}rp(_0x46cb4a)[_0xec9d('0x13')](function(_0x36979e){var _0x126aa0={'statusCode':_0x36979e[_0xec9d('0x77')]||0xc8,'statusMessage':_0x36979e[_0xec9d('0x78')]||'OK','headers':_0x36979e[_0xec9d('0x6d')]||{},'body':_0x36979e[_0xec9d('0x75')]||{}};_0x31ecf0(null,_0x126aa0);})[_0xec9d('0x17')](function(_0x5bc67a){var _0x286785={'statusCode':_0x5bc67a['statusCode']||0x1f4,'statusMessage':_0x5bc67a[_0xec9d('0x79')]||_0xec9d('0x7a'),'headers':_0x5bc67a[_0xec9d('0x7b')]['headers']||{},'body':_0x5bc67a[_0xec9d('0x7b')]['body']||{}};_0x31ecf0(null,_0x286785);});};AGIVertices[_0xec9d('0x11')]['googleDialogflow']=function(_0x48ecb9,_0x14a0b1){scripts['googleDialogflow'](this['channel'][_0xec9d('0x37')],_0x48ecb9[_0xec9d('0x7c')],_0x48ecb9[_0xec9d('0x5d')],_0x48ecb9[_0xec9d('0x7d')]||'en')[_0xec9d('0x13')](function(_0x30d2a5){_0x14a0b1(null,_0x30d2a5);})['catch'](function(_0x2d750d){_0x14a0b1(_0x2d750d);});};AGIVertices[_0xec9d('0x11')]['googleDialogflowV2']=function(_0x1129b4,_0x391fea){scripts[_0xec9d('0x7e')](this[_0xec9d('0x3a')][_0xec9d('0x37')],_0x1129b4[_0xec9d('0x7f')],_0x1129b4[_0xec9d('0x80')],_0x1129b4['private_key'],_0x1129b4[_0xec9d('0x5d')],_0x1129b4[_0xec9d('0x81')]||'en')[_0xec9d('0x13')](function(_0x178802){_0x391fea(null,_0x178802);})[_0xec9d('0x17')](function(_0x5a68ef){_0x391fea(_0x5a68ef);});};AGIVertices['prototype'][_0xec9d('0x82')]=function(_0x54ab92,_0x5cf082){scripts[_0xec9d('0x82')](this[_0xec9d('0x3a')],_0x54ab92)[_0xec9d('0x13')](function(_0x2e03b3){_0x5cf082(null,_0x2e03b3);})[_0xec9d('0x17')](function(_0x1f5b0d){_0x5cf082(_0x1f5b0d);});};AGIVertices['prototype'][_0xec9d('0x83')]=function(_0x4082d7,_0x2d90dd){scripts['ispeechTTS'](_0x4082d7[_0xec9d('0x7c')],_0x4082d7[_0xec9d('0x5d')],_0x4082d7[_0xec9d('0x84')]||'en-US',_0x4082d7[_0xec9d('0x85')])[_0xec9d('0x13')](function(_0x597dc5){_0x2d90dd(null,_0x597dc5);})[_0xec9d('0x17')](function(_0x31cdb8){_0x2d90dd(_0x31cdb8);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x86')]=function(_0x452fba,_0x5e975f,_0x395135){scripts[_0xec9d('0x86')](_0x5e975f,_0x452fba[_0xec9d('0x7c')],_0x452fba[_0xec9d('0x87')]||_0xec9d('0x5f'),this[_0xec9d('0x88')](_0x452fba[_0xec9d('0x89')])?_0x452fba[_0xec9d('0x89')]:undefined)[_0xec9d('0x13')](function(_0xecefa2){_0x395135(null,_0xecefa2);})['catch'](function(_0x50edec){_0x395135(_0x50edec);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x8a')]=function(_0x5c3c4e,_0xf69a2a){scripts[_0xec9d('0x8a')](_0x5c3c4e[_0xec9d('0x8b')],_0x5c3c4e['aws_secret_access_key'],_0x5c3c4e[_0xec9d('0x8c')],_0x5c3c4e[_0xec9d('0x8d')]||_0xec9d('0x8e'),_0x5c3c4e[_0xec9d('0x5d')],_0x5c3c4e['aws_text_type']||_0xec9d('0x5d'))[_0xec9d('0x13')](function(_0x56ac67){_0xf69a2a(null,_0x56ac67);})[_0xec9d('0x17')](function(_0xdc7bff){_0xf69a2a(_0xdc7bff);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x8f')]=function(_0x1801fa,_0x5cf07e){scripts[_0xec9d('0x8f')](this[_0xec9d('0x3a')][_0xec9d('0x37')],_0x1801fa[_0xec9d('0x8b')],_0x1801fa['aws_secret_access_key'],_0x1801fa[_0xec9d('0x90')],_0x1801fa[_0xec9d('0x5d')],_0x1801fa[_0xec9d('0x91')])['then'](function(_0x3ee0af){_0x5cf07e(null,_0x3ee0af);})[_0xec9d('0x17')](function(_0x2144ea){_0x5cf07e(_0x2144ea);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x92')]=function(_0x56c174,_0x25c869,_0x4e4885){scripts[_0xec9d('0x92')](_0x25c869,_0x56c174[_0xec9d('0x7c')],_0x56c174['google_asr_language']||'en-US')[_0xec9d('0x13')](function(_0x2702c7){_0x4e4885(null,_0x2702c7);})['catch'](function(_0x2e0081){_0x4e4885(_0x2e0081);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x93')]=function(_0x5a376e,_0x2e546b,_0x20aa07){scripts[_0xec9d('0x93')](_0x2e546b,_0x5a376e['appid'],_0x5a376e['appsecret'],_0x5a376e[_0xec9d('0x72')])['then'](function(_0x3d40d0){_0x20aa07(null,_0x3d40d0);})['catch'](function(_0x5e765c){_0x20aa07(_0x5e765c);});};AGIVertices[_0xec9d('0x11')][_0xec9d('0x94')]=function(_0x3db399){var _0x471cea=_[_0xec9d('0x69')](verticesWithRetry,_0x3db399[_0xec9d('0x39')])?_0x3db399:_['clone'](_0x3db399);for(var _0x2ef0aa in _0x471cea){if(_0x471cea['hasOwnProperty'](_0x2ef0aa)){if(_0x471cea[_0x2ef0aa]&&_[_0xec9d('0x95')](_0x471cea[_0x2ef0aa])){if(_['includes'](recursiveMapAttributes,_0x2ef0aa)){_0x471cea[_0x2ef0aa]=this[_0xec9d('0x96')](_0x471cea[_0x2ef0aa]);}else{_0x471cea[_0x2ef0aa]=this[_0xec9d('0x97')](_0x471cea[_0x2ef0aa]);}}}}return _0x471cea;};AGIVertices[_0xec9d('0x11')]['recursiveNodeIndex']=function(_0x49462f){for(var _0x50f1e0 in _0x49462f){if(_0x49462f['hasOwnProperty'](_0x50f1e0)){if(_[_0xec9d('0x98')](_0x49462f[_0x50f1e0])){this[_0xec9d('0x99')](_0x49462f[_0x50f1e0]);}else if(_[_0xec9d('0x9a')](_0x49462f[_0x50f1e0])){for(var _0x4b18cf=0x0;_0x4b18cf<_0x49462f[_0x50f1e0][_0xec9d('0x9b')];_0x4b18cf++){this[_0xec9d('0x99')](_0x49462f[_0x50f1e0][_0x4b18cf]);}}else if(_[_0xec9d('0x95')](_0x49462f[_0x50f1e0])){_0x49462f[_0x50f1e0]=this[_0xec9d('0x97')](_0x49462f[_0x50f1e0]);}}}};AGIVertices['prototype'][_0xec9d('0x9c')]=function(_0x1a29ae,_0xc6dd29){for(var _0x327a91 in _0x1a29ae){if(_0x1a29ae['hasOwnProperty'](_0x327a91)){if(_[_0xec9d('0x98')](_0x1a29ae[_0x327a91])){if(!_[_0xec9d('0x45')](_0x1a29ae[_0x327a91])){this['saveRestApiResult'](_0x1a29ae[_0x327a91],util['format']('%s.%s',_0xc6dd29,_0x327a91));}}else if(_['isArray'](_0x1a29ae[_0x327a91])){for(var _0x5ce5df=0x0;_0x5ce5df<_0x1a29ae[_0x327a91][_0xec9d('0x9b')];_0x5ce5df++){this[_0xec9d('0x9c')](_0x1a29ae[_0x327a91][_0x5ce5df],util[_0xec9d('0x56')](_0xec9d('0x9d'),_0xc6dd29,_0x327a91+'['+_0x5ce5df+']'));}}else{if(!_[_0xec9d('0x46')](_0x1a29ae[_0x327a91])){this[_0xec9d('0x3a')][_0xec9d('0x9e')](util[_0xec9d('0x56')](_0xec9d('0x9d'),_0xc6dd29,_0x327a91),_0x1a29ae[_0x327a91]);}}}}};AGIVertices[_0xec9d('0x11')][_0xec9d('0x96')]=function(_0x44a757){try{var _0xebcfa9=JSON[_0xec9d('0x6e')](_0x44a757);this[_0xec9d('0x99')](_0xebcfa9);return JSON['stringify'](_0xebcfa9);}catch(_0x589721){return this[_0xec9d('0x97')](_0x44a757);}};AGIVertices[_0xec9d('0x11')][_0xec9d('0x97')]=function(_0x5a1f62){var _0x2d2e46=_0x5a1f62['split']('{');for(var _0x258a81=0x1;_0x258a81<_0x2d2e46['length'];_0x258a81+=0x1){var _0xe9fec8=_0x2d2e46[_0x258a81][_0xec9d('0x9f')]('}');if(_0xe9fec8[_0xec9d('0x9b')]>0x1){_0x5a1f62=_0x5a1f62[_0xec9d('0xa0')]('{'+_0xe9fec8[0x0]+'}',this[_0xec9d('0x3a')][_0xec9d('0xa1')](_0xe9fec8[0x0])[_0xec9d('0xa2')]||_0xe9fec8[0x0]);}}if(_0x2d2e46[_0xec9d('0x9b')]===0x1){return _0x5a1f62[_0xec9d('0x4e')]();}return this[_0xec9d('0x97')](_0x5a1f62);};AGIVertices[_0xec9d('0x11')][_0xec9d('0xa3')]=function(_0x144b5e,_0x4ef172){var _0x2da65e=this['channel'][_0xec9d('0xa1')](_0x144b5e);if(_0x2da65e[_0xec9d('0xa4')]===-0x1){return _0x2da65e;}logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0xa5'),_0x4ef172,_0x2da65e[_0xec9d('0xa2')]));return this['channel'][_0xec9d('0x9e')](_0x4ef172,_0x2da65e[_0xec9d('0xa2')]);};AGIVertices[_0xec9d('0x11')][_0xec9d('0x88')]=function(_0x2c6e2f){return _0x2c6e2f&&_0x2c6e2f!=='0'&&_0x2c6e2f!=='-1'&&_0x2c6e2f!=='';};AGIVertices[_0xec9d('0x11')]['maxRetry']=function(_0x34c2df){this['createSquareDetailsReport'][_0xec9d('0x71')](this,_0x34c2df,'-');_0x34c2df['retry']=_0x34c2df['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xec9d('0x11')][_0xec9d('0xa6')]=function(_0x39bbdb){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x39bbdb[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x39bbdb[_0xec9d('0x5d')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xa8'));}var _0x1dc67c='\x22'+_0x39bbdb[_0xec9d('0x5d')]+'\x22';if(this[_0xec9d('0x88')](_0x39bbdb[_0xec9d('0x7b')])){_0x1dc67c+=','+_0x39bbdb[_0xec9d('0x7b')];}var _0x486172=this[_0xec9d('0x3a')][_0xec9d('0x58')](_0xec9d('0xa9'),_0x1dc67c);if(_0x486172['result']===-0x1){return _0x486172;}return this[_0xec9d('0x3a')]['noop'](util[_0xec9d('0x56')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1dc67c));};AGIVertices['prototype'][_0xec9d('0xaa')]=function(_0x5074f7){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0xab'),_0x5074f7[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x5074f7['grammar'])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')]('no\x20grammar\x20configured');}var _0x3db046=_0x5074f7[_0xec9d('0xac')];if(this[_0xec9d('0x88')](_0x5074f7[_0xec9d('0x7b')])){_0x3db046+=','+_0x5074f7[_0xec9d('0x7b')];}var _0x2ec5a5=this[_0xec9d('0x3a')][_0xec9d('0x58')](_0xec9d('0xad'),_0x3db046);if(_0x2ec5a5[_0xec9d('0xa4')]===-0x1){return _0x2ec5a5;}var _0x19d53f=this[_0xec9d('0xa3')](_0xec9d('0xae'),'MRCP_RECOG_CONFIDENCE');if(_0x19d53f[_0xec9d('0xa4')]===-0x1){return _0x19d53f;}var _0x3bbb88=this[_0xec9d('0xa3')](_0xec9d('0xaf'),'MRCP_RECOG_TRANSCRIPT');if(_0x3bbb88['result']===-0x1){return _0x3bbb88;}var _0x1b4243=this[_0xec9d('0xa3')](_0xec9d('0xb0'),'MRCP_RECOG_INSTANCE');if(_0x1b4243['result']===-0x1){return _0x1b4243;}return this[_0xec9d('0x3a')]['noop'](util[_0xec9d('0x56')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3db046));};AGIVertices['prototype'][_0xec9d('0x9')]=function(_0x564fb4){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0xb1'),_0x564fb4['label']));return this['channel'][_0xec9d('0x9')]([_0x564fb4[_0xec9d('0xb2')],_0x564fb4[_0xec9d('0xb3')]]);};AGIVertices[_0xec9d('0x11')][_0xec9d('0xb4')]=function(_0x1c7bd5){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x1c7bd5[_0xec9d('0x38')]));if(this[_0xec9d('0x88')](_0x1c7bd5[_0xec9d('0x68')])){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0xb5'),_0x1c7bd5[_0xec9d('0x68')]));var _0x472fed=this[_0xec9d('0x3a')][_0xec9d('0xb6')](_0x1c7bd5[_0xec9d('0x68')]);if(_0x472fed[_0xec9d('0xa4')]===-0x1){return _0x472fed;}}return this[_0xec9d('0x3a')][_0xec9d('0xb4')]();};AGIVertices['prototype'][_0xec9d('0x4b')]=function(_0xc4ace6){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0xb7'),_0xc4ace6[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0xc4ace6[_0xec9d('0x4a')])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0xc4ace6,_0xec9d('0xb8'));}_0xc4ace6[_0xec9d('0x4d')]=moment();if(this[_0xec9d('0x88')](_0xc4ace6['delay'])){_0xc4ace6[_0xec9d('0x4d')]=moment()['add'](_0xc4ace6[_0xec9d('0xb9')],_0xec9d('0xba'));}if(!this[_0xec9d('0x88')](_0xc4ace6['callback_priority'])){_0xc4ace6['callback_priority']=0x2;}this[_0xec9d('0x44')]['sync'](this,_0xc4ace6);return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util['format'](_0xec9d('0xbb'),_0xc4ace6[_0xec9d('0x49')],_0xc4ace6[_0xec9d('0x4a')],_0xc4ace6[_0xec9d('0x4d')]));};AGIVertices[_0xec9d('0x11')]['custom_app']=function(_0x22162c){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0xbc'),_0x22162c[_0xec9d('0x38')]));var _0x1e4eff=this[_0xec9d('0x3a')]['exec'](_0x22162c[_0xec9d('0xbd')],_0x22162c[_0xec9d('0x7b')]);if(_0x1e4eff[_0xec9d('0xa4')]===-0x1){return _0x1e4eff;}return this['channel'][_0xec9d('0xa7')](util[_0xec9d('0x56')]('Executed\x20command\x20%s\x20%s',_0x22162c[_0xec9d('0xbd')],_0x22162c[_0xec9d('0x7b')]));};AGIVertices[_0xec9d('0x11')][_0xec9d('0xbe')]=function(_0x3dc4bf){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0xbf'),_0x3dc4bf[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x3dc4bf[_0xec9d('0x5d')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xa8'));}var _0x5c0f64='\x22'+_0x3dc4bf[_0xec9d('0x5d')]+'\x22';if(this['isConfigured'](_0x3dc4bf['options'])){_0x5c0f64+=','+_0x3dc4bf[_0xec9d('0x7b')];}var _0x5e6568=this[_0xec9d('0x3a')][_0xec9d('0x58')](_0xec9d('0xa9'),_0x5c0f64);if(_0x5e6568[_0xec9d('0xa4')]===-0x1){return _0x5e6568;}return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0xc0'),_0x5c0f64));};AGIVertices['prototype'][_0xec9d('0xc1')]=function(_0xfabc5b){logger['info'](util[_0xec9d('0x56')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0xfabc5b[_0xec9d('0x38')]));if(!this['isConfigured'](_0xfabc5b[_0xec9d('0x5d')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xa8'));}var _0x175f59='\x22'+_0xfabc5b['text']+'\x22';if(this['isConfigured'](_0xfabc5b[_0xec9d('0x7b')])){_0x175f59+=','+_0xfabc5b[_0xec9d('0x7b')];}var _0x448540=this[_0xec9d('0x3a')][_0xec9d('0x58')](_0xec9d('0xa9'),_0x175f59);if(_0x448540[_0xec9d('0xa4')]===-0x1){return _0x448540;}return this[_0xec9d('0x3a')]['noop'](util[_0xec9d('0x56')](_0xec9d('0xc0'),_0x175f59));};AGIVertices[_0xec9d('0x11')]['lumenvoxasr']=function(_0x4a6ef9){logger[_0xec9d('0x2f')](util['format'](_0xec9d('0xc2'),_0x4a6ef9['label']));if(!this[_0xec9d('0x88')](_0x4a6ef9[_0xec9d('0xac')])){return this['channel']['noop'](_0xec9d('0xc3'));}var _0x417e4a=_0x4a6ef9['grammar'];if(this[_0xec9d('0x88')](_0x4a6ef9[_0xec9d('0x7b')])){_0x417e4a+=','+_0x4a6ef9[_0xec9d('0x7b')];}var _0x9edc3c=this[_0xec9d('0x3a')]['exec']('MRCPRecog',_0x417e4a);if(_0x9edc3c[_0xec9d('0xa4')]===-0x1){return _0x9edc3c;}var _0x33a564=this[_0xec9d('0xa3')](_0xec9d('0xae'),_0xec9d('0xc4'));if(_0x33a564['result']===-0x1){return _0x33a564;}var _0x50d86e=this[_0xec9d('0xa3')](_0xec9d('0xaf'),_0xec9d('0xc5'));if(_0x50d86e[_0xec9d('0xa4')]===-0x1){return _0x50d86e;}var _0x21efe7=this[_0xec9d('0xa3')](_0xec9d('0xb0'),'LUMENVOX_ASR_INSTANCE');if(_0x21efe7[_0xec9d('0xa4')]===-0x1){return _0x21efe7;}return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0xc6'),_0x417e4a));};AGIVertices['prototype']['sestekasr']=function(_0x55504){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0xc7'),_0x55504[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x55504[_0xec9d('0xac')])){return this[_0xec9d('0x3a')]['noop'](_0xec9d('0xc3'));}var _0x3172a1=_0x55504[_0xec9d('0xac')];if(this['isConfigured'](_0x55504[_0xec9d('0x7b')])){_0x3172a1+=','+_0x55504[_0xec9d('0x7b')];}var _0xe21b42=this[_0xec9d('0x3a')][_0xec9d('0x58')](_0xec9d('0xad'),_0x3172a1);if(_0xe21b42[_0xec9d('0xa4')]===-0x1){return _0xe21b42;}var _0x1f4aa9=this[_0xec9d('0xa3')](_0xec9d('0xae'),_0xec9d('0xc8'));if(_0x1f4aa9[_0xec9d('0xa4')]===-0x1){return _0x1f4aa9;}var _0x517db1=this[_0xec9d('0xa3')](_0xec9d('0xaf'),'SESTEK_ASR_TRANSCRIPT');if(_0x517db1[_0xec9d('0xa4')]===-0x1){return _0x517db1;}var _0x3634dc=this[_0xec9d('0xa3')](_0xec9d('0xb0'),_0xec9d('0xc9'));if(_0x3634dc[_0xec9d('0xa4')]===-0x1){return _0x3634dc;}return this['channel']['noop'](util[_0xec9d('0x56')](_0xec9d('0xc6'),_0x3172a1));};AGIVertices[_0xec9d('0x11')][_0xec9d('0xca')]=function(_0x46c54e){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x46c54e[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x46c54e['odbc_id'])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x46c54e,_0xec9d('0xcb'));}var _0x47ebaf=this[_0xec9d('0x1a')][_0xec9d('0x71')](this,_0x46c54e[_0xec9d('0xcc')]);if(!_0x47ebaf){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x46c54e,'no\x20odbc\x20database\x20found');}if(!this[_0xec9d('0x88')](_0x46c54e[_0xec9d('0xcd')])){return this['channel'][_0xec9d('0x2d')](_0x46c54e,_0xec9d('0xce'));}var _0x1e9a87=_0x46c54e[_0xec9d('0xcd')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xec9d('0x3a')]['noop'](util[_0xec9d('0x56')](_0xec9d('0xcf'),_0x1e9a87));var _0x171203=this[_0xec9d('0x2b')][_0xec9d('0x71')](this,_0x47ebaf,_0x1e9a87);this['createSquareDetailsReport'][_0xec9d('0x71')](this,_0x46c54e,_0x1e9a87);if(!this[_0xec9d('0x88')](_0x46c54e[_0xec9d('0xd0')])){return this['channel']['noop'](_0xec9d('0xd1'));}var _0x405893=this[_0xec9d('0xa1')]['sync'](this,_0x46c54e[_0xec9d('0xd0')]);if(!_0x405893){return this[_0xec9d('0x3a')]['error'](_0x46c54e,_0xec9d('0xd2'));}var _0x39fe2d=this;_0x171203[_0xec9d('0xd3')](function(_0x29dfc0,_0x2e42d2){Object[_0xec9d('0xd4')](_0x29dfc0)[_0xec9d('0xd3')](function(_0x57220e){_0x39fe2d[_0xec9d('0x3a')][_0xec9d('0x9e')](util[_0xec9d('0x56')]('%s[%s][%s]',_0x405893,_0x2e42d2,_0x57220e),_0x29dfc0[_0x57220e]);});});this[_0xec9d('0x3a')]['setVariable'](util[_0xec9d('0x56')]('%s_ROWS_COUNT',_0x405893),_0x171203[_0xec9d('0x9b')]);return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0xd5'),_0x405893));};AGIVertices['prototype'][_0xec9d('0xd6')]=function(_0x27174a){logger[_0xec9d('0xd7')](util[_0xec9d('0x56')](_0xec9d('0xd8'),_0x27174a[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x27174a[_0xec9d('0xd9')])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x27174a,_0xec9d('0xda'));}var _0x35ef1e=this['getUser']['sync'](this,_0x27174a[_0xec9d('0xd9')]);if(!_0x35ef1e){return this['channel']['error'](_0x27174a,'no\x20user\x20found');}var _0x41df75=this[_0xec9d('0x3a')][_0xec9d('0x58')](_0xec9d('0xdb'),[util[_0xec9d('0x56')](_0xec9d('0xdc'),_0x35ef1e),_0x27174a[_0xec9d('0x68')],_0x27174a[_0xec9d('0xdd')],_0x27174a[_0xec9d('0x66')]]);if(_0x41df75[_0xec9d('0xa4')]===-0x1){return _0x41df75;}return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0xde'),'DIAL'));};AGIVertices[_0xec9d('0x11')]['dialogflow']=function(_0x21209d){logger['info'](util[_0xec9d('0x56')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x21209d[_0xec9d('0x38')]));if(!this['isConfigured'](_0x21209d[_0xec9d('0x7c')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this[_0xec9d('0x88')](_0x21209d[_0xec9d('0x5d')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xa8'));}this[_0xec9d('0x3a')]['bot']=!![];this[_0xec9d('0x36')](_0x21209d);this['createSquareMessage'](_0x21209d[_0xec9d('0x5d')],'in','','');this[_0xec9d('0x3a')][_0xec9d('0xa7')](util['format'](_0xec9d('0xdf'),_0x21209d[_0xec9d('0x5d')]));var _0x12a0eb=this[_0xec9d('0xe0')]['sync'](this,_0x21209d);if(_0x12a0eb){for(var _0x5d94f3 in _0x12a0eb){if(_0x12a0eb[_0xec9d('0xe1')](_0x5d94f3)){this['channel']['setVariable'](util[_0xec9d('0x56')]('DIALOGFLOW_%s',_0x5d94f3[_0xec9d('0x6c')]()),_0x12a0eb[_0x5d94f3]);}}this[_0xec9d('0x43')](_0x12a0eb['speech'],_0xec9d('0xe2'),'dialogflow','');return this['channel']['noop'](util[_0xec9d('0x56')](_0xec9d('0xe3'),_0x12a0eb[_0xec9d('0xe4')]));}return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x21209d,_0xec9d('0xe5'));};AGIVertices[_0xec9d('0x11')][_0xec9d('0xe6')]=function(_0x1acb44){logger[_0xec9d('0x2f')](util['format'](_0xec9d('0xe7'),_0x1acb44[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x1acb44['dialogflowV2_project_id'])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x1acb44[_0xec9d('0x80')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xe8'));}if(!this[_0xec9d('0x88')](_0x1acb44[_0xec9d('0xe9')])){return this[_0xec9d('0x3a')]['noop'](_0xec9d('0xea'));}if(!this[_0xec9d('0x88')](_0x1acb44[_0xec9d('0x81')])){return this[_0xec9d('0x3a')]['noop']('no\x20anguage\x20configured');}if(!this[_0xec9d('0x88')](_0x1acb44['text'])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xa8'));}this[_0xec9d('0x3a')][_0xec9d('0xeb')]=!![];this[_0xec9d('0x36')](_0x1acb44);this[_0xec9d('0x43')](_0x1acb44[_0xec9d('0x5d')],'in','','');this['channel']['noop'](util['format'](_0xec9d('0xec'),_0x1acb44['text']));var _0x1ba621=this[_0xec9d('0x7e')]['sync'](this,_0x1acb44);if(_0x1ba621){for(var _0x41fe12 in _0x1ba621){if(_0x1ba621['hasOwnProperty'](_0x41fe12)){if(_0x41fe12!==_0xec9d('0xed')){this['channel'][_0xec9d('0x9e')](util[_0xec9d('0x56')]('DIALOGFLOW_%s',_0x41fe12[_0xec9d('0x6c')]()),_0x1ba621[_0x41fe12]);}}}this[_0xec9d('0x43')](_0x1ba621[_0xec9d('0xe4')],_0xec9d('0xe2'),_0xec9d('0xe6'),_0x1ba621[_0xec9d('0xed')]);return this['channel']['noop'](util[_0xec9d('0x56')](_0xec9d('0xee'),_0x1ba621['speech']));}return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x1acb44,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xec9d('0x11')][_0xec9d('0xef')]=function(_0x22bf6c){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0xf0'),_0x22bf6c['label']));if(!this[_0xec9d('0x88')](_0x22bf6c['ndauth_url'])){return this[_0xec9d('0x3a')]['noop'](_0xec9d('0xf1'));}if(!this['isConfigured'](_0x22bf6c[_0xec9d('0xf2')])){return this['channel']['noop'](_0xec9d('0xf3'));}if(!this[_0xec9d('0x88')](_0x22bf6c['password'])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xf4'));}if(!this[_0xec9d('0x88')](_0x22bf6c[_0xec9d('0xf5')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xa8'));}this[_0xec9d('0x3a')][_0xec9d('0xeb')]=!![];this[_0xec9d('0x36')](_0x22bf6c);this[_0xec9d('0x43')](_0x22bf6c[_0xec9d('0x5d')],'in','','');this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0xf6'),_0x22bf6c[_0xec9d('0x5d')]));var _0x37af82=this[_0xec9d('0x82')][_0xec9d('0x71')](this,_0x22bf6c);if(_0x37af82){for(var _0x196531 in _0x37af82){if(_0x37af82[_0xec9d('0xe1')](_0x196531)){this[_0xec9d('0x3a')][_0xec9d('0x9e')](util['format'](_0xec9d('0xf7'),_0x196531[_0xec9d('0x6c')]()),_0x37af82[_0x196531]);}}this[_0xec9d('0x43')](_0x37af82[_0xec9d('0xe4')],_0xec9d('0xe2'),_0xec9d('0xef'),'');if(_0x37af82[_0xec9d('0xf8')]){this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0xf9'),_0x37af82[_0xec9d('0xf8')]));var _0x1e4c67=this[_0xec9d('0x3a')][_0xec9d('0xfa')](_0x37af82[_0xec9d('0xf8')]);try{fs[_0xec9d('0xfb')](_0x37af82[_0xec9d('0xf8')]+_0xec9d('0xfc'));}catch(_0x34a8df){logger[_0xec9d('0x2d')](_0x34a8df);}return _0x1e4c67;}else{return this['channel'][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0xfd'),_0x37af82['speech']));}}return this['channel'][_0xec9d('0x2d')](_0x22bf6c,_0xec9d('0xfe'));};AGIVertices['prototype'][_0xec9d('0xff')]=function(_0x5f4356){logger[_0xec9d('0x2f')](util['format'](_0xec9d('0x100'),_0x5f4356[_0xec9d('0x38')]));return this[_0xec9d('0x3a')]['noop'](_0xec9d('0xff'));};AGIVertices[_0xec9d('0x11')]['ext_dial']=function(_0x415450){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x415450[_0xec9d('0x38')]));var _0x3c2c07='';if(_0x415450[_0xec9d('0x101')]){if(!this[_0xec9d('0x88')](_0x415450[_0xec9d('0x101')])){return this[_0xec9d('0x3a')]['error'](_0x415450,_0xec9d('0x102'));}else{var _0x47906a=parseInt(_0x415450[_0xec9d('0x101')],0xa);if(isNaN(_0x47906a)){_0x3c2c07=_0x415450[_0xec9d('0x101')];}else{_0x3c2c07=this[_0xec9d('0x1f')][_0xec9d('0x71')](this,_0x415450['trunk_id']);if(!_0x3c2c07){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x415450,'no\x20trunk\x20found');}}}}else if(_0x415450['trunk_name']){_0x3c2c07=_0x415450[_0xec9d('0x103')];}else{return this[_0xec9d('0x3a')]['error'](_0x415450,_0xec9d('0x102'));}var _0x16b1cc=this['channel'][_0xec9d('0x58')](_0xec9d('0xdb'),[util[_0xec9d('0x56')](_0xec9d('0x104'),_0x3c2c07,_0x415450[_0xec9d('0x49')]),_0x415450[_0xec9d('0x68')],_0x415450[_0xec9d('0xdd')],_0x415450[_0xec9d('0x66')]]);if(_0x16b1cc[_0xec9d('0xa4')]===-0x1){return _0x16b1cc;}return this[_0xec9d('0x3a')]['noop'](util['format']('Executed\x20command\x20%s',_0xec9d('0xdb')));};AGIVertices[_0xec9d('0x11')][_0xec9d('0x105')]=function(_0x57643b){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x57643b[_0xec9d('0x38')]));return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0x105'));};AGIVertices['prototype']['getdigits']=function(_0x365630){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x106'),_0x365630[_0xec9d('0x38')]));if(_0x365630[_0xec9d('0x107')]===0x0){return this['maxRetry'](_0x365630);}_0x365630[_0xec9d('0x107')]-=0x1;if(!this[_0xec9d('0x88')](_0x365630[_0xec9d('0x108')])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x365630,_0xec9d('0x109'));}var _0x55f09c=this[_0xec9d('0x21')][_0xec9d('0x71')](this,_0x365630[_0xec9d('0x108')]);if(!_0x55f09c){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x365630,_0xec9d('0x10a'));}if(!this[_0xec9d('0x88')](_0x365630[_0xec9d('0xd0')])){return this['channel'][_0xec9d('0x2d')](_0xec9d('0xd1'));}var _0x1b4da6=this['channel'][_0xec9d('0x10b')](_0x55f09c,_0x365630[_0xec9d('0x10c')],_0x365630[_0xec9d('0x10d')]);var _0x2ba703=_0x1b4da6[_0xec9d('0xa4')]?_0x1b4da6[_0xec9d('0xa4')][_0xec9d('0x4e')]():'';logger[_0xec9d('0x2f')](_0xec9d('0x10e'),JSON[_0xec9d('0x74')](_0x1b4da6));if(_0x1b4da6['result']===-0x1){this[_0xec9d('0x36')][_0xec9d('0x71')](this,_0x365630,_0x2ba703);return _0x1b4da6;}else if(_0x1b4da6[_0xec9d('0xa2')]===_0xec9d('0x68')){_0x1b4da6[_0xec9d('0xa4')]=_0x2ba703['length']>=parseInt(_0x365630['mindigit'])?'x':'i';}else{_0x1b4da6[_0xec9d('0xa4')]=_0x2ba703[_0xec9d('0x9b')]>=parseInt(_0x365630[_0xec9d('0x10f')])&&_0x2ba703[_0xec9d('0x9b')]<=parseInt(_0x365630['maxdigit'])?'x':'i';}var _0x4b5a0f=this[_0xec9d('0xa1')][_0xec9d('0x71')](this,_0x365630[_0xec9d('0xd0')]);if(!_0x4b5a0f){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x365630,'no\x20variable\x20found');}this[_0xec9d('0x3a')][_0xec9d('0x9e')](_0x4b5a0f,_0x2ba703);if(this['isConfigured'](_0x365630[_0xec9d('0x110')])){var _0x1e6db8=parseInt(_0x365630[_0xec9d('0x110')],0xa);var _0x56f933=rs[_0xec9d('0x111')]({'charset':'*','length':_0x1e6db8});var _0x373d29=_0x2ba703[_0xec9d('0x9b')];if(_0x373d29>0x0){if(_0x373d29>_0x1e6db8){this[_0xec9d('0x36')][_0xec9d('0x71')](this,_0x365630,_0x365630['hiddendigitspos']===_0xec9d('0x112')?_0x56f933+_0x2ba703[_0xec9d('0x113')](_0x1e6db8):_0x2ba703['substr'](0x0,_0x373d29-_0x1e6db8)+_0x56f933);}else{this[_0xec9d('0x36')][_0xec9d('0x71')](this,_0x365630,rs[_0xec9d('0x111')]({'charset':'*','length':_0x373d29}));}}else{this[_0xec9d('0x36')][_0xec9d('0x71')](this,_0x365630,'');}}else{this[_0xec9d('0x36')][_0xec9d('0x71')](this,_0x365630,_0x2ba703);}return _0x1b4da6;};AGIVertices[_0xec9d('0x11')][_0xec9d('0xf')]=function(_0x561480){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x114'),_0x561480[_0xec9d('0x38')]));return this['getdigits'](_0x561480);};AGIVertices[_0xec9d('0x11')][_0xec9d('0x115')]=function(_0x1fa311){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x116'),_0x1fa311[_0xec9d('0x38')]));this['createSquareDetailsReport']['sync'](this,_0x1fa311,_0x1fa311['goalname']);return this['channel'][_0xec9d('0xa7')](util[_0xec9d('0x56')]('GOAL\x20%s',_0x1fa311['goalname']));};AGIVertices['prototype'][_0xec9d('0x117')]=function(_0x3c94a0){logger[_0xec9d('0x2f')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x3c94a0[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x3c94a0['aws_access_key_id'])||!this[_0xec9d('0x88')](_0x3c94a0[_0xec9d('0x118')])){return this[_0xec9d('0x3a')]['noop'](_0xec9d('0x119'));}if(!this['isConfigured'](_0x3c94a0[_0xec9d('0x5d')])){return this[_0xec9d('0x3a')]['noop'](_0xec9d('0xa8'));}this[_0xec9d('0x3a')][_0xec9d('0xa7')](util['format'](_0xec9d('0x11a'),_0x3c94a0[_0xec9d('0x5d')]));var _0x201e11=this[_0xec9d('0x8a')]['sync'](this,_0x3c94a0);if(_0x201e11){this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x11b'),_0x201e11));var _0x321142=this[_0xec9d('0x3a')][_0xec9d('0xfa')](_0x201e11);try{fs[_0xec9d('0xfb')](_0x201e11+_0xec9d('0xfc'));}catch(_0x774b10){logger['error'](_0x774b10);}return _0x321142;}return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x3c94a0,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xec9d('0x11')][_0xec9d('0x11c')]=function(_0xda95cc){logger[_0xec9d('0x2f')](util['format'](_0xec9d('0x11d'),_0xda95cc[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0xda95cc['aws_access_key_id'])||!this['isConfigured'](_0xda95cc[_0xec9d('0x118')])){return this[_0xec9d('0x3a')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xec9d('0x88')](_0xda95cc['aws_bot_name'])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0x11e'));}if(!this[_0xec9d('0x88')](_0xda95cc[_0xec9d('0x5d')])){return this['channel'][_0xec9d('0xa7')](_0xec9d('0xa8'));}this[_0xec9d('0x3a')][_0xec9d('0xeb')]=!![];this[_0xec9d('0x36')](_0xda95cc);this['createSquareMessage'](_0xda95cc[_0xec9d('0x5d')],'in','','');this[_0xec9d('0x3a')][_0xec9d('0xa7')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0xda95cc[_0xec9d('0x5d')]));var _0x19e02e=this[_0xec9d('0x8f')][_0xec9d('0x71')](this,_0xda95cc);if(_0x19e02e){for(var _0xb865ea in _0x19e02e){if(_0x19e02e[_0xec9d('0xe1')](_0xb865ea)&&_[_0xec9d('0x95')](_0x19e02e[_0xb865ea])){this[_0xec9d('0x3a')][_0xec9d('0x9e')](util[_0xec9d('0x56')](_0xec9d('0x11f'),_0xb865ea[_0xec9d('0x6c')]()),_0x19e02e[_0xb865ea]);}}if(_[_0xec9d('0x46')](_0x19e02e[_0xec9d('0x79')])){return this['channel'][_0xec9d('0xa7')](_0xec9d('0x120'));}else{this[_0xec9d('0x43')](_0x19e02e[_0xec9d('0x79')],_0xec9d('0xe2'),_0xec9d('0x121'),'');return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')]('Amazon\x20Lex\x20Result\x20%s',_0x19e02e['message']));}}return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0xda95cc,_0xec9d('0x122'));};AGIVertices[_0xec9d('0x11')]['googleasr']=function(_0x22f8b4){logger['info'](util['format'](_0xec9d('0x123'),_0x22f8b4[_0xec9d('0x38')],_0x22f8b4[_0xec9d('0x68')]));if(!this[_0xec9d('0x88')](_0x22f8b4['key'])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0x124'));}var _0x694ba3='wav';var _0x1aeeb7=util['format'](_0xec9d('0x125'),FILES_PATH,rs[_0xec9d('0x111')](0x4));var _0x1f2736=util['format']('%s.%s',_0x1aeeb7,_0x694ba3);var _0x424e40=!![];if(_0x22f8b4[_0xec9d('0x126')]===_0xec9d('0x127')){_0x424e40=![];}var _0x26f25a=this[_0xec9d('0x3a')][_0xec9d('0x128')](_0x1aeeb7,_0x694ba3,_0x22f8b4['intKey'],_0x22f8b4['timeout'],undefined,_0x424e40);if(_0x26f25a[_0xec9d('0xa4')]!==-0x1){this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x129'),_0x1f2736));var _0x34a62d=this['googleASR'][_0xec9d('0x71')](this,_0x22f8b4,_0x1f2736);if(_0x34a62d){for(var _0x1b4397 in _0x34a62d){if(_0x34a62d[_0xec9d('0xe1')](_0x1b4397)){this['channel']['setVariable'](util['format'](_0xec9d('0x12a'),_0x1b4397['toUpperCase']()),_0x34a62d[_0x1b4397]);}}return this[_0xec9d('0x3a')]['noop'](util['format'](_0xec9d('0x12b'),JSON['stringify'](_0x34a62d)));}}return _0x26f25a;};AGIVertices[_0xec9d('0x11')][_0xec9d('0x12c')]=function(_0x280c52){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x12d'),_0x280c52[_0xec9d('0x38')]));if(!this['isConfigured'](_0x280c52['appid'])){return this[_0xec9d('0x3a')]['noop'](_0xec9d('0x12e'));}if(!this[_0xec9d('0x88')](_0x280c52[_0xec9d('0x12f')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0x130'));}var _0x564733=_0xec9d('0x131');var _0x574cff=util[_0xec9d('0x56')](_0xec9d('0x125'),FILES_PATH,rs[_0xec9d('0x111')](0x4));var _0x4bc9ca=util[_0xec9d('0x56')]('%s.%s',_0x574cff,_0x564733);var _0x515797=!![];if(_0x280c52[_0xec9d('0x126')]===_0xec9d('0x127')){_0x515797=![];}var _0x5accdd=this['channel'][_0xec9d('0x128')](_0x574cff,_0x564733,_0x280c52[_0xec9d('0x132')],_0x280c52[_0xec9d('0x68')],undefined,_0x515797);if(_0x5accdd['result']!==-0x1){this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x133'),_0x4bc9ca));var _0x22b0f4=this['tildeASR']['sync'](this,_0x280c52,_0x4bc9ca);if(_0x22b0f4){for(var _0x53fa44 in _0x22b0f4){if(_0x22b0f4['hasOwnProperty'](_0x53fa44)){this[_0xec9d('0x3a')][_0xec9d('0x9e')](util['format'](_0xec9d('0x134'),_0x53fa44[_0xec9d('0x6c')]()),_0x22b0f4[_0x53fa44]);}}return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x135'),JSON[_0xec9d('0x74')](_0x22b0f4)));}}return _0x5accdd;};AGIVertices[_0xec9d('0x11')][_0xec9d('0x136')]=function(_0x1bcbba){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x137'),_0x1bcbba[_0xec9d('0x38')]));return this['channel'][_0xec9d('0x138')](_0x1bcbba['context'],_0x1bcbba[_0xec9d('0x139')],_0x1bcbba[_0xec9d('0x40')]);};AGIVertices['prototype'][_0xec9d('0x13a')]=function(_0x2ca12c){logger[_0xec9d('0x2f')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x2ca12c['label']));if(!this['isConfigured'](_0x2ca12c[_0xec9d('0x13b')])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x2ca12c,_0xec9d('0x13c'));}try{var _0x1e384c=eval(_0x2ca12c['condition'])?_0xec9d('0x13d'):_0xec9d('0x13e');this['channel'][_0xec9d('0xa7')](util['format'](_0xec9d('0x13f'),_0x2ca12c['condition'],_0x1e384c));return{'code':0xc8,'result':_0x1e384c};}catch(_0x1ffd01){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0xec9d('0x140')]=function(_0x50fd29){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x141'),_0x50fd29[_0xec9d('0x38')]));if(!this['isConfigured'](_0x50fd29[_0xec9d('0x142')])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x50fd29,_0xec9d('0x143'));}var _0x249570=this['getIntervals'][_0xec9d('0x71')](this,_0x50fd29[_0xec9d('0x142')]);if(!_0x249570){return this['channel'][_0xec9d('0x2d')](_0x50fd29,_0xec9d('0x144'));}for(var _0x3ead12=0x0;_0x3ead12<_0x249570[_0xec9d('0x9b')];_0x3ead12+=0x1){var _0x27094b=this[_0xec9d('0x3a')][_0xec9d('0xa1')](util[_0xec9d('0x56')](_0xec9d('0x145'),_0x249570[_0x3ead12]));if(_0x27094b['result']===-0x1){return _0x27094b;}logger['info'](util[_0xec9d('0x56')]('IFTIME\x20%s\x20%s',_0x249570[_0x3ead12],_0x27094b['extra']));if(_0x27094b[_0xec9d('0xa2')]==='true'){logger['info'](util[_0xec9d('0x56')](_0xec9d('0x146'),_0x249570[_0x3ead12],'true'));this[_0xec9d('0x3a')][_0xec9d('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0x249570[_0x3ead12],_0xec9d('0x13d')));return{'code':0xc8,'result':_0xec9d('0x13d')};}else{logger['info'](util[_0xec9d('0x56')](_0xec9d('0x146'),_0x249570[_0x3ead12],_0xec9d('0x13e')));this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x146'),_0x249570[_0x3ead12],'false'));}}return{'code':0xc8,'result':_0xec9d('0x13e')};};AGIVertices['prototype'][_0xec9d('0x147')]=function(_0x54946d){logger['info'](util[_0xec9d('0x56')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x54946d['label']));return this[_0xec9d('0x3a')][_0xec9d('0x147')]();};AGIVertices[_0xec9d('0x11')][_0xec9d('0x148')]=function(_0x3a6c74){logger[_0xec9d('0x2f')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x3a6c74['label']));if(!this[_0xec9d('0x88')](_0x3a6c74[_0xec9d('0x7c')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0x124'));}var _0x497623='wav';var _0x57ed2f=util[_0xec9d('0x56')](_0xec9d('0x125'),FILES_PATH,rs[_0xec9d('0x111')](0x4));var _0x48b1ec=util[_0xec9d('0x56')]('%s.%s',_0x57ed2f,_0x497623);var _0x326b29=!![];if(_0x3a6c74[_0xec9d('0x126')]===_0xec9d('0x127')){_0x326b29=![];}var _0x54ce4d=this['channel']['recordFile'](_0x57ed2f,_0x497623,_0x3a6c74['intKey'],_0x3a6c74[_0xec9d('0x68')],undefined,_0x326b29);if(_0x54ce4d[_0xec9d('0xa4')]!==-0x1){this[_0xec9d('0x3a')]['noop'](util[_0xec9d('0x56')](_0xec9d('0x149'),_0x48b1ec));var _0x56cd71=this[_0xec9d('0x86')][_0xec9d('0x71')](this,_0x3a6c74,_0x48b1ec);if(_0x56cd71){for(var _0x7fe54 in _0x56cd71){if(_0x56cd71[_0xec9d('0xe1')](_0x7fe54)){this['channel']['setVariable'](util[_0xec9d('0x56')](_0xec9d('0x14a'),_0x7fe54[_0xec9d('0x6c')]()),_0x56cd71[_0x7fe54]);}}return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x14b'),JSON[_0xec9d('0x74')](_0x56cd71)));}}return _0x54ce4d;};AGIVertices[_0xec9d('0x11')][_0xec9d('0x14c')]=function(_0x5aacb6){logger[_0xec9d('0x2f')](util['format'](_0xec9d('0x14d'),_0x5aacb6[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x5aacb6[_0xec9d('0x7c')])){return this['channel'][_0xec9d('0xa7')](_0xec9d('0x124'));}if(!this[_0xec9d('0x88')](_0x5aacb6[_0xec9d('0x5d')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xa8'));}this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x14e'),_0x5aacb6[_0xec9d('0x5d')]));var _0x1dc5a0=this[_0xec9d('0x83')][_0xec9d('0x71')](this,_0x5aacb6);if(_0x1dc5a0){this[_0xec9d('0x3a')][_0xec9d('0xa7')](util['format'](_0xec9d('0x149'),_0x1dc5a0));var _0x38ea1e=this[_0xec9d('0x3a')][_0xec9d('0xfa')](_0x1dc5a0,_0x5aacb6['intKey']);try{fs['unlink'](_0x1dc5a0+_0xec9d('0xfc'));}catch(_0x350411){logger[_0xec9d('0x2d')](_0x350411);}return _0x38ea1e;}return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x5aacb6,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xec9d('0x11')][_0xec9d('0x14f')]=function(_0x456a11){logger['info'](util[_0xec9d('0x56')](_0xec9d('0x150'),_0x456a11['label']));if(!this['isConfigured'](_0x456a11['findBy'])){return this[_0xec9d('0x3a')]['error'](_0x456a11,_0xec9d('0x151'));}logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x152'),this[_0xec9d('0x3a')]['callerid'],_0x456a11[_0xec9d('0x153')]));var _0x137b81=this[_0xec9d('0x55')][_0xec9d('0x71')](this,_0x456a11[_0xec9d('0x153')]);if(_0x137b81){logger['info'](util[_0xec9d('0x56')](_0xec9d('0x154'),this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x456a11[_0xec9d('0x153')]));this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xec9d('0x3a')]['callerid'],_0x456a11[_0xec9d('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0xec9d('0x2f')](util['format'](_0xec9d('0x155'),this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x456a11[_0xec9d('0x153')]));this[_0xec9d('0x3a')][_0xec9d('0xa7')](util['format'](_0xec9d('0x155'),this[_0xec9d('0x3a')]['callerid'],_0x456a11[_0xec9d('0x153')]));return{'code':0xc8,'result':_0xec9d('0x156')};}};AGIVertices['prototype'][_0xec9d('0x157')]=function(_0x227a96){logger[_0xec9d('0x2f')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x227a96[_0xec9d('0x38')]));if(!this['isConfigured'](_0x227a96[_0xec9d('0x153')])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x227a96,_0xec9d('0x151'));}logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x152'),this['channel'][_0xec9d('0x3c')],_0x227a96[_0xec9d('0x153')]));var _0x19b2c7=this[_0xec9d('0x54')][_0xec9d('0x71')](this,_0x227a96[_0xec9d('0x153')]);if(_0x19b2c7){logger[_0xec9d('0x2f')](util['format'](_0xec9d('0x154'),this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x227a96[_0xec9d('0x153')]));this['channel'][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x154'),this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x227a96[_0xec9d('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x155'),this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x227a96['findBy']));this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x155'),this[_0xec9d('0x3a')]['callerid'],_0x227a96['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xec9d('0x11')]['math']=function(_0x16dc7c){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x158'),_0x16dc7c[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x16dc7c[_0xec9d('0x159')])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x16dc7c,_0xec9d('0x15a'));}this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x15b'),_0x16dc7c[_0xec9d('0x159')]));var _0x1c0cd8=eval(_0x16dc7c['operation']);if(!this['isConfigured'](_0x16dc7c[_0xec9d('0xd0')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xd1'));}var _0x50c069=this[_0xec9d('0xa1')]['sync'](this,_0x16dc7c[_0xec9d('0xd0')]);if(!_0x50c069){return this['channel']['error'](_0x16dc7c,_0xec9d('0xd2'));}if(_[_0xec9d('0x9a')](_0x1c0cd8)){var _0x3b3475=this;_0x1c0cd8[_0xec9d('0xd3')](function(_0x251684,_0x445ea7){_0x3b3475['channel'][_0xec9d('0x9e')](util[_0xec9d('0x56')](_0xec9d('0x15c'),_0x50c069,_0x445ea7),_0x251684);});return this['channel']['noop'](util[_0xec9d('0x56')]('variable\x20%s[key]\x20set',_0x50c069));}else{return this[_0xec9d('0x3a')][_0xec9d('0x9e')](_0x50c069,_0x1c0cd8);}};AGIVertices[_0xec9d('0x11')][_0xec9d('0xe')]=function(_0x49b126){logger['info'](util[_0xec9d('0x56')](_0xec9d('0x15d'),_0x49b126[_0xec9d('0x38')]));if(_0x49b126[_0xec9d('0x107')]===0x0){return this[_0xec9d('0x15e')](_0x49b126);}_0x49b126[_0xec9d('0x107')]-=0x1;if(!this[_0xec9d('0x88')](_0x49b126[_0xec9d('0x108')])){return this[_0xec9d('0x3a')]['error'](_0x49b126,_0xec9d('0x109'));}var _0x55c574=this['getSound'][_0xec9d('0x71')](this,_0x49b126[_0xec9d('0x108')]);if(!_0x55c574){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x49b126,'no\x20file\x20audio\x20found');}var _0x17b3a5=this[_0xec9d('0x3a')]['getData'](_0x55c574,_0x49b126[_0xec9d('0x10c')],_0x49b126[_0xec9d('0x15f')]);var _0x338f5f=_0x17b3a5[_0xec9d('0xa4')];if(_0x17b3a5['result']===-0x1){this[_0xec9d('0x36')][_0xec9d('0x71')](this,_0x49b126,'-1');return _0x17b3a5;}else if(_0x17b3a5[_0xec9d('0xa2')]===_0xec9d('0x68')){_0x17b3a5[_0xec9d('0xa4')]=_0x17b3a5[_0xec9d('0xa4')][_0xec9d('0x9b')]>0x0?_0x17b3a5[_0xec9d('0xa4')]:'t';}else if(_[_0xec9d('0x45')](_0x17b3a5['result'])){_0x17b3a5[_0xec9d('0xa4')]='#';_0x338f5f='#';}if(!this[_0xec9d('0x88')](_0x49b126[_0xec9d('0xd0')])){this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xd1'));}else{var _0x81b686=this[_0xec9d('0xa1')]['sync'](this,_0x49b126[_0xec9d('0xd0')]);if(!_0x81b686){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x49b126,'no\x20variable\x20found');}this[_0xec9d('0x3a')][_0xec9d('0x9e')](_0x81b686,_0x338f5f);}this[_0xec9d('0x36')][_0xec9d('0x71')](this,_0x49b126,_0x338f5f);return _0x17b3a5;};AGIVertices[_0xec9d('0x11')][_0xec9d('0xa7')]=function(_0x6eb022){logger[_0xec9d('0x2f')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x6eb022['label']));return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0x6eb022['output']||_0x6eb022[_0xec9d('0x38')]);};AGIVertices[_0xec9d('0x11')][_0xec9d('0x160')]=function(_0x30b308){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x30b308[_0xec9d('0x38')]));if(!this['isConfigured'](_0x30b308[_0xec9d('0x153')])){return this['channel'][_0xec9d('0x2d')](_0x30b308,'no\x20find\x20by\x20configured');}logger['info'](util[_0xec9d('0x56')](_0xec9d('0x152'),this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x30b308[_0xec9d('0x153')]));var _0x560240=this[_0xec9d('0x161')][_0xec9d('0x71')](this,_0x30b308['pause_id']);var _0x50f356=this[_0xec9d('0x51')][_0xec9d('0x71')](this,_0x30b308['findBy'],_0x560240);if(_0x50f356){logger['info'](util[_0xec9d('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x30b308[_0xec9d('0x153')]));this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x30b308['findBy']));return{'code':0xc8,'result':_0xec9d('0x162')};}else{logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xec9d('0x3a')]['callerid'],_0x30b308[_0xec9d('0x153')]));this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x154'),this[_0xec9d('0x3a')]['callerid'],_0x30b308[_0xec9d('0x153')]));return{'code':0xc8,'result':_0xec9d('0x156')};}};AGIVertices[_0xec9d('0x11')]['playback']=function(_0x48ffe){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x163'),_0x48ffe[_0xec9d('0x38')]));if(!this['isConfigured'](_0x48ffe[_0xec9d('0x108')])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x48ffe,_0xec9d('0x109'));}var _0x4829fa=this[_0xec9d('0x21')][_0xec9d('0x71')](this,_0x48ffe[_0xec9d('0x108')]);if(!_0x4829fa){return this['channel'][_0xec9d('0x2d')](_0x48ffe,_0xec9d('0x10a'));}var _0x237821=this['channel']['exec'](_0xec9d('0x164'),[_0x4829fa,_0x48ffe[_0xec9d('0xdd')]]);if(_0x237821[_0xec9d('0xa4')]===-0x1){return _0x237821;}return this['channel'][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x165'),_0xec9d('0x164'),_0x4829fa));};AGIVertices[_0xec9d('0x11')][_0xec9d('0x166')]=function(_0x1f7ca6){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x167'),_0x1f7ca6[_0xec9d('0x38')]));if(!this['isConfigured'](_0x1f7ca6[_0xec9d('0x168')])){return this['channel'][_0xec9d('0x2d')](_0x1f7ca6,_0xec9d('0x169'));}var _0x1f941d='';var _0x433df1=parseInt(_0x1f7ca6[_0xec9d('0x168')],0xa);if(isNaN(_0x433df1)){_0x1f941d=_0x1f7ca6['queue_id'];}else{_0x1f941d=this[_0xec9d('0x15')][_0xec9d('0x71')](this,_0x1f7ca6[_0xec9d('0x168')]);if(!_0x1f941d){return this[_0xec9d('0x3a')]['error'](_0x1f7ca6,_0xec9d('0x16a'));}}var _0x171298='';if(this['isConfigured'](_0x1f7ca6[_0xec9d('0x108')])){var _0x2e8db7=this[_0xec9d('0x21')][_0xec9d('0x71')](this,_0x1f7ca6['file_id']);if(_0x2e8db7){_0x171298=_0x2e8db7;}}this[_0xec9d('0x36')]['sync'](this,_0x1f7ca6,_0x1f941d);if(_0x1f7ca6[_0xec9d('0xdd')]['indexOf']('x')<0x0){_0x1f7ca6[_0xec9d('0xdd')]+='x';}if(_0x1f7ca6[_0xec9d('0xdd')][_0xec9d('0x16b')]('X')<0x0){_0x1f7ca6[_0xec9d('0xdd')]+='X';}this['channel']['setVariable']('XMCS-QUEUE',_0x1f941d?_0x1f941d[_0xec9d('0x16c')]():'');var _0x2a1b76=this[_0xec9d('0x3a')][_0xec9d('0x58')](_0xec9d('0x16d'),[_0x1f941d,_0x1f7ca6[_0xec9d('0xdd')],_0x1f7ca6[_0xec9d('0x66')],_0x171298,_0x1f7ca6['timeout'],_0x1f7ca6[_0xec9d('0x9')],_0x1f7ca6[_0xec9d('0x16e')],_0x1f7ca6['gosub'],'',_0x1f7ca6['position']]);if(_0x2a1b76[_0xec9d('0xa4')]===-0x1){return _0x2a1b76;}return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0xec9d('0x16d'),_0x1f941d));};AGIVertices[_0xec9d('0x11')][_0xec9d('0x16f')]=function(_0x1fd66e){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x1fd66e[_0xec9d('0x38')]));var _0x5554b7=_0x1fd66e[_0xec9d('0x170')]||_0xec9d('0x131');var _0xb0ef10=util[_0xec9d('0x56')](_0xec9d('0x171'),this['channel'][_0xec9d('0x37')],rs[_0xec9d('0x111')](0x5));var _0x4b633c=util['format']('%s/recordings/%s.%s',FILES_PATH,_0xb0ef10,_0x5554b7);var _0x4d77f6=util[_0xec9d('0x56')](_0xec9d('0x125'),FILES_PATH,_0xb0ef10);this[_0xec9d('0x3d')][_0xec9d('0x71')](this,_0x1fd66e,_0xb0ef10,_0x4b633c);this[_0xec9d('0x3a')][_0xec9d('0x9e')](_0xec9d('0x172'),_0xb0ef10);logger[_0xec9d('0x2f')](_0xec9d('0x173'),_0x4d77f6,_0x5554b7,_0x1fd66e[_0xec9d('0x174')],_0x1fd66e[_0xec9d('0x68')]);return this['channel'][_0xec9d('0x128')](_0x4d77f6,_0x5554b7,_0x1fd66e[_0xec9d('0x174')],_0x1fd66e['timeout'],undefined,!![]);};AGIVertices[_0xec9d('0x11')][_0xec9d('0x175')]=function(_0x4fa3d7){logger[_0xec9d('0x2f')](util['format'](_0xec9d('0x176'),_0x4fa3d7[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x4fa3d7[_0xec9d('0x66')])){return this[_0xec9d('0x3a')]['noop'](_0xec9d('0x177'));}var _0x4ac436=this[_0xec9d('0x65')][_0xec9d('0x71')](this,_0x4fa3d7);logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Response:',util[_0xec9d('0x178')](_0x4ac436,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x4fa3d7[_0xec9d('0xd0')])){return this['channel'][_0xec9d('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x3e9d54=this[_0xec9d('0xa1')][_0xec9d('0x71')](this,_0x4fa3d7[_0xec9d('0xd0')]);if(!_0x3e9d54){return this['channel']['error'](_0x4fa3d7,_0xec9d('0xd2'));}this[_0xec9d('0x3a')][_0xec9d('0x9e')](util['format']('%s_STATUS_CODE',_0x3e9d54),_0x4ac436['statusCode']?_0x4ac436[_0xec9d('0x77')]:_0xec9d('0x179'));this[_0xec9d('0x3a')][_0xec9d('0x9e')](util[_0xec9d('0x56')](_0xec9d('0x17a'),_0x3e9d54),_0x4ac436[_0xec9d('0x78')]?_0x4ac436['statusMessage']:'OK');if(_0x4ac436[_0xec9d('0x75')]){try{this[_0xec9d('0x9c')](_0x4ac436[_0xec9d('0x75')],_0x3e9d54);}catch(_0x2e17cf){logger['error'](util['format'](_0xec9d('0x17b'),_0x3e9d54));}}return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')]('variable\x20%s\x20set',_0x3e9d54));};AGIVertices['prototype'][_0xec9d('0x17c')]=function(_0x19a448){logger['info'](util[_0xec9d('0x56')](_0xec9d('0x17d'),_0x19a448[_0xec9d('0x38')]));return this[_0xec9d('0x3a')][_0xec9d('0x17e')](_0x19a448[_0xec9d('0x17f')][_0xec9d('0x5a')](/\s+/g,''),_0x19a448[_0xec9d('0x174')]);};AGIVertices[_0xec9d('0x11')][_0xec9d('0x180')]=function(_0x5364bc){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x181'),_0x5364bc['label']));return this[_0xec9d('0x3a')][_0xec9d('0x182')](_0x5364bc['number'][_0xec9d('0x5a')](/\s+/g,''),_0x5364bc[_0xec9d('0x174')]);};AGIVertices['prototype'][_0xec9d('0x183')]=function(_0x4e791c){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4e791c[_0xec9d('0x38')]));return this[_0xec9d('0x3a')][_0xec9d('0x184')](_0x4e791c[_0xec9d('0x5d')],_0x4e791c['escape_digits']);};AGIVertices[_0xec9d('0x11')][_0xec9d('0x185')]=function(_0x21cc57){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x21cc57[_0xec9d('0x38')]));if(!this['isConfigured'](_0x21cc57[_0xec9d('0x186')])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')]('no\x20mail\x20account\x20configured');}var _0x51ad3f=this[_0xec9d('0x24')][_0xec9d('0x71')](this,_0x21cc57[_0xec9d('0x186')]);if(!_0x51ad3f||!_0x51ad3f[_0xec9d('0x187')]){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x21cc57,_0xec9d('0x188'));}var _0x5da034={'from':util['format']('\x22%s\x22\x20<%s>',_0x51ad3f[_0xec9d('0x14')],_0x51ad3f[_0xec9d('0x189')]||_0x51ad3f['Smtp']['user']),'to':_0x21cc57['to']||'','cc':_0x21cc57['cc']||'','bcc':_0x21cc57['bcc']||'','subject':_0x21cc57[_0xec9d('0x18a')],'html':_0x21cc57[_0xec9d('0x5d')],'text':_0x21cc57[_0xec9d('0x5d')]};var _0x23611a={'tls':{'rejectUnauthorized':![]}};if(_0x51ad3f[_0xec9d('0x187')][_0xec9d('0x18b')]){_0x23611a[_0xec9d('0x18b')]=_0x51ad3f[_0xec9d('0x187')]['service'];}else{_0x23611a[_0xec9d('0x18c')]=_0x51ad3f[_0xec9d('0x187')][_0xec9d('0x18c')];_0x23611a[_0xec9d('0x18d')]=_0x51ad3f['Smtp']['port'];_0x23611a[_0xec9d('0x18e')]=_0x51ad3f['Smtp']['secure'];}if(_0x51ad3f[_0xec9d('0x187')][_0xec9d('0x18f')]){_0x23611a[_0xec9d('0x190')]={'user':_0x51ad3f['Smtp']['user'],'pass':_0x51ad3f[_0xec9d('0x187')]['pass']};}if(this[_0xec9d('0x88')](_0x21cc57[_0xec9d('0x191')])){}logger[_0xec9d('0xd7')]('sendMail\x20message',JSON[_0xec9d('0x74')](_0x5da034));this['createSquareDetailsReport'][_0xec9d('0x71')](this,_0x21cc57,_0x21cc57[_0xec9d('0x186')]);this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x192'),_0x51ad3f['name']));this[_0xec9d('0x25')][_0xec9d('0x71')](this,_0x23611a,_0x5da034);return this[_0xec9d('0x3a')][_0xec9d('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xec9d('0x11')]['sendFax']=function(_0x3ab4bc){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x3ab4bc[_0xec9d('0x38')]));return this['channel'][_0xec9d('0xa7')](_0xec9d('0x193'));};AGIVertices[_0xec9d('0x11')][_0xec9d('0x194')]=function(_0x3be9e5){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x3be9e5[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x3be9e5[_0xec9d('0x195')])){return this['channel'][_0xec9d('0xa7')]('no\x20sms\x20account\x20configured');}var _0x40c170=this['getSmsAccount'][_0xec9d('0x71')](this,_0x3be9e5[_0xec9d('0x195')]);if(!_0x40c170){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x3be9e5,_0xec9d('0x196'));}var _0x4d5f73={'body':_0x3be9e5[_0xec9d('0x197')],'phone':_0x3be9e5['to']||'','SmsAccountId':_0x40c170['id']};logger[_0xec9d('0xd7')](_0xec9d('0x198'),JSON[_0xec9d('0x74')](_0x4d5f73));this[_0xec9d('0x36')][_0xec9d('0x71')](this,_0x3be9e5,_0x3be9e5[_0xec9d('0x195')]);this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x199'),_0x40c170[_0xec9d('0x14')]));this[_0xec9d('0x35')][_0xec9d('0x71')](this,_0x4d5f73);return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0x19a'));};AGIVertices['prototype'][_0xec9d('0x19b')]=function(_0x27b327){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x19c'),_0x27b327[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x27b327[_0xec9d('0xd0')])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x27b327,'no\x20variable\x20selected');}var _0x52958a=this[_0xec9d('0xa1')]['sync'](this,_0x27b327[_0xec9d('0xd0')]);if(!_0x52958a){return this['channel'][_0xec9d('0x2d')](_0x27b327,_0xec9d('0xd2'));}return this[_0xec9d('0x3a')][_0xec9d('0x9e')](_0x52958a,_0x27b327['variable_value']);};AGIVertices[_0xec9d('0x11')][_0xec9d('0x19d')]=function(_0x317c59){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x19e'),_0x317c59['label']));this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0x19f'));if(_0x317c59[_0xec9d('0xb4')]==='yes'){this['channel'][_0xec9d('0xa7')](_0xec9d('0x1a0'));return this[_0xec9d('0x3a')][_0xec9d('0xb4')]();}return this['channel'][_0xec9d('0xa7')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xec9d('0x1a1')]=function(_0xf1e1cb){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x1a2'),_0xf1e1cb['label']));if(!this[_0xec9d('0x88')](_0xf1e1cb[_0xec9d('0x1a3')])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0xf1e1cb,'no\x20subproject\x20selected');}var _0x1dbc3a=this[_0xec9d('0x18')][_0xec9d('0x71')](this,_0xf1e1cb[_0xec9d('0x1a3')]);if(!this[_0xec9d('0x88')](_0x1dbc3a)){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0xf1e1cb,util[_0xec9d('0x56')](_0xec9d('0x1a4'),_0xf1e1cb[_0xec9d('0x1a3')]));}if(_0x1dbc3a===this['channel']['arg_1']){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0xf1e1cb,_0xec9d('0x1a5'));}this[_0xec9d('0x36')][_0xec9d('0x71')](this,_0xf1e1cb,_0x1dbc3a);var _0x7a0026=this['channel']['exec'](_0xec9d('0x1a6'),util[_0xec9d('0x56')](_0xec9d('0x1a7'),config[_0xec9d('0x9')][_0xec9d('0x18c')]||'127.0.0.1',_0x1dbc3a,this[_0xec9d('0x3a')][_0xec9d('0x3b')]));if(_0x7a0026[_0xec9d('0xa4')]===-0x1){return _0x7a0026;}return this['channel']['noop'](util[_0xec9d('0x56')](_0xec9d('0x165'),'AGI',_0x1dbc3a));};AGIVertices['prototype']['system']=function(_0x3bbd5a){logger['info'](util[_0xec9d('0x56')](_0xec9d('0x1a8'),_0x3bbd5a[_0xec9d('0x38')]));var _0x2e5ce4=this[_0xec9d('0x1a9')][_0xec9d('0x71')](this,_0x3bbd5a[_0xec9d('0xb2')]);this['createSquareDetailsReport'][_0xec9d('0x71')](this,_0x3bbd5a,_0x3bbd5a[_0xec9d('0xb2')]);if(this[_0xec9d('0x88')](_0x3bbd5a[_0xec9d('0xd0')])){var _0x14dfca=this['getVariable'][_0xec9d('0x71')](this,_0x3bbd5a[_0xec9d('0xd0')]);if(_0x14dfca){this[_0xec9d('0x3a')]['setVariable'](_0x14dfca,_0x2e5ce4);return this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x1aa'),_0x3bbd5a[_0xec9d('0xb2')],_0x14dfca));}}return this['channel'][_0xec9d('0xa7')](util['format'](_0xec9d('0x1ab'),_0x3bbd5a[_0xec9d('0xb2')]));};AGIVertices[_0xec9d('0x11')][_0xec9d('0x1ac')]=function(_0x17641f){logger['info'](util[_0xec9d('0x56')](_0xec9d('0x1ad'),_0x17641f[_0xec9d('0x38')]));_0x17641f[_0xec9d('0x5d')]=_0x17641f['text'][_0xec9d('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xec9d('0x88')](_0x17641f['apiKey'])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0x1ae'));}if(!this[_0xec9d('0x88')](_0x17641f[_0xec9d('0x5d')])){return this['channel'][_0xec9d('0xa7')](_0xec9d('0xa8'));}this['channel']['noop'](util[_0xec9d('0x56')](_0xec9d('0x1af'),_0x17641f['text']));var _0x1d5670=this[_0xec9d('0x5b')][_0xec9d('0x71')](this,_0x17641f);if(_0x1d5670){this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x1b0'),_0x1d5670));var _0x1cc910=this['channel'][_0xec9d('0xfa')](_0x1d5670);try{fs[_0xec9d('0xfb')](_0x1d5670+_0xec9d('0xfc'));}catch(_0x56746a){logger[_0xec9d('0x2d')](_0x56746a);}return _0x1cc910;}return this['channel'][_0xec9d('0x2d')](_0x17641f,_0xec9d('0x1b1'));};AGIVertices[_0xec9d('0x11')]['tts']=function(_0x250fc3){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x250fc3[_0xec9d('0x38')]));_0x250fc3[_0xec9d('0x5d')]=_0x250fc3[_0xec9d('0x5d')][_0xec9d('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x250fc3['text'])){return this[_0xec9d('0x3a')][_0xec9d('0xa7')](_0xec9d('0xa8'));}this[_0xec9d('0x3a')]['noop'](util[_0xec9d('0x56')](_0xec9d('0x1b2'),_0x250fc3['text']));var _0x3dc8cb=this[_0xec9d('0x63')][_0xec9d('0x71')](this,_0x250fc3);if(_0x3dc8cb){this[_0xec9d('0x3a')]['noop'](util['format'](_0xec9d('0x1b3'),_0x3dc8cb));var _0x1e52ab=this[_0xec9d('0x3a')][_0xec9d('0xfa')](_0x3dc8cb);try{fs[_0xec9d('0xfb')](_0x3dc8cb+_0xec9d('0xfc'));}catch(_0x2039a9){logger[_0xec9d('0x2d')](_0x2039a9);}return _0x1e52ab;}return this['channel'][_0xec9d('0x2d')](_0x250fc3,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xec9d('0x11')]['unpause']=function(_0x288ce3){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x1b4'),_0x288ce3[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x288ce3['findBy'])){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x288ce3,_0xec9d('0x151'));}logger['info'](util[_0xec9d('0x56')](_0xec9d('0x152'),this['channel'][_0xec9d('0x3c')],_0x288ce3['findBy']));var _0x163f43=this[_0xec9d('0x53')][_0xec9d('0x71')](this,_0x288ce3[_0xec9d('0x153')]);if(_0x163f43){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x154'),this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x288ce3[_0xec9d('0x153')]));this[_0xec9d('0x3a')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xec9d('0x3a')]['callerid'],_0x288ce3[_0xec9d('0x153')]));return{'code':0xc8,'result':_0xec9d('0x162')};}else{logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x288ce3[_0xec9d('0x153')]));this[_0xec9d('0x3a')][_0xec9d('0xa7')](util[_0xec9d('0x56')](_0xec9d('0x155'),this[_0xec9d('0x3a')][_0xec9d('0x3c')],_0x288ce3['findBy']));return{'code':0xc8,'result':_0xec9d('0x156')};}};AGIVertices[_0xec9d('0x11')][_0xec9d('0x1b5')]=function(_0x4f4cbe){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')](_0xec9d('0x1b6'),_0x4f4cbe[_0xec9d('0x38')]));var _0x43b06e=this[_0xec9d('0x3a')][_0xec9d('0x58')](_0xec9d('0x1b7'),[_0x4f4cbe[_0xec9d('0x1b8')],_0x4f4cbe[_0xec9d('0x7b')]]);if(_0x43b06e[_0xec9d('0xa4')]===-0x1){return _0x43b06e;}return this['channel']['noop'](util[_0xec9d('0x56')](_0xec9d('0x165'),_0xec9d('0x1b7'),_0x4f4cbe['mailbox']));};AGIVertices[_0xec9d('0x11')]['vswitch']=function(_0x3f533e){logger[_0xec9d('0x2f')](util[_0xec9d('0x56')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x3f533e[_0xec9d('0x38')]));if(!this[_0xec9d('0x88')](_0x3f533e['variable_id'])){return this['channel'][_0xec9d('0x2d')](_0x3f533e,'no\x20variable\x20selected');}var _0x5174ad=this[_0xec9d('0xa1')][_0xec9d('0x71')](this,_0x3f533e[_0xec9d('0xd0')]);if(!_0x5174ad){return this[_0xec9d('0x3a')][_0xec9d('0x2d')](_0x3f533e,_0xec9d('0xd2'));}var _0x2d19cb=this[_0xec9d('0x3a')]['getVariable'](_0x5174ad);return{'code':0xc8,'result':_0x2d19cb[_0xec9d('0xa2')]?_0x2d19cb[_0xec9d('0xa2')]:'-'};};String[_0xec9d('0x11')]['replaceAll']=function(_0x271497,_0x1310b9){return this[_0xec9d('0x9f')](_0x271497)['join'](_0x1310b9);};module[_0xec9d('0x1b9')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 1ca2be6..eb10d9d 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 _0x7f16=['voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','[ACW][START]\x20%s','message','queue','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport'];(function(_0xce17c4,_0x536920){var _0x4271c7=function(_0x1b961){while(--_0x1b961){_0xce17c4['push'](_0xce17c4['shift']());}};_0x4271c7(++_0x536920);}(_0x7f16,0x146));var _0x67f1=function(_0x111fec,_0x55932a){_0x111fec=_0x111fec-0x0;var _0x13b1a4=_0x7f16[_0x111fec];return _0x13b1a4;};'use strict';var util=require(_0x67f1('0x0'));var _=require(_0x67f1('0x1'));var moment=require('moment');var ami=require('../ami');var logger=require(_0x67f1('0x2'))(_0x67f1('0x3'));var RpcUser=require(_0x67f1('0x4'));var RpcVoiceAgentReport=require(_0x67f1('0x5'));function Acw(_0x4f44da){this['voiceQueues']=_0x4f44da[_0x67f1('0x6')];this[_0x67f1('0x7')]=_0x4f44da[_0x67f1('0x7')];this[_0x67f1('0x8')]=_0x4f44da[_0x67f1('0x8')];this['channels']={};ami['on'](_0x67f1('0x9'),this[_0x67f1('0xa')][_0x67f1('0xb')](this));ami['on'](_0x67f1('0xc'),this[_0x67f1('0xd')]['bind'](this));ami['on']('hangup',this[_0x67f1('0xe')]['bind'](this));ami['on'](_0x67f1('0xf'),this[_0x67f1('0x10')]['bind'](this));ami['on'](_0x67f1('0x11'),this[_0x67f1('0x12')][_0x67f1('0xb')](this));ami['on'](_0x67f1('0x13'),this[_0x67f1('0x14')][_0x67f1('0xb')](this));ami['on'](_0x67f1('0x15'),this[_0x67f1('0x16')][_0x67f1('0xb')](this));}function getDiff(_0x54dd25){var _0x1d64e5=moment()['milliseconds'](0x0);var _0x2b4a6d=moment(_0x54dd25)[_0x67f1('0x17')](0x0);return _0x1d64e5[_0x67f1('0x18')](_0x2b4a6d,_0x67f1('0x19'));}Acw[_0x67f1('0x1a')]['startAcw']=function(_0x4b4ef1){try{var _0x18be0a=this;var _0x3abb15=this[_0x67f1('0x1b')][_0x4b4ef1][_0x67f1('0x1c')];var _0x8e3479=this[_0x67f1('0x1b')][_0x4b4ef1]['queue'];var _0x404510=this[_0x67f1('0x6')][_0x8e3479];var _0x1682f4=![];var _0x259216=_0x67f1('0x1d');if(_0x404510[_0x67f1('0x1e')]){if(_0x404510[_0x67f1('0x1f')]['name']){_0x1682f4=!![];_0x259216=_0x404510[_0x67f1('0x1f')][_0x67f1('0x20')];}}ami[_0x67f1('0x21')]({'action':_0x67f1('0x22'),'interface':_0x3abb15,'paused':!![],'reason':_0x259216})[_0x67f1('0x23')](function(_0x3578a1){if(_0x18be0a[_0x67f1('0x7')][_0x3abb15]){return RpcUser['getAgent'](_0x18be0a[_0x67f1('0x7')][_0x3abb15]['id'])[_0x67f1('0x23')](function(_0x3e604e){if(_0x3e604e&&!_0x3e604e[_0x67f1('0x24')]){logger[_0x67f1('0x25')](_0x67f1('0x26'),_0x4b4ef1,_0x3abb15,_0x8e3479);var _0x46f5e5=_0x18be0a[_0x67f1('0x1b')][_0x4b4ef1][_0x67f1('0x27')]&&_0x18be0a[_0x67f1('0x1b')][_0x4b4ef1][_0x67f1('0x28')]?_0x18be0a[_0x67f1('0x1b')][_0x4b4ef1][_0x67f1('0x28')]:_0x4b4ef1;return RpcUser[_0x67f1('0x29')](_0x18be0a[_0x67f1('0x7')][_0x3abb15],_0x259216,_0x46f5e5)[_0x67f1('0x23')](function(_0x66d0e9){if(!_0x1682f4){_0x18be0a['timers'][_0x3abb15]={};logger[_0x67f1('0x25')](_0x67f1('0x2a'),_0x4b4ef1,_0x18be0a[_0x67f1('0x6')][_0x8e3479][_0x67f1('0x2b')],_0x3abb15,_0x8e3479);_0x18be0a[_0x67f1('0x8')][_0x3abb15][_0x67f1('0x2c')]=setTimeout(_0x18be0a[_0x67f1('0x2d')][_0x67f1('0xb')](_0x18be0a,_0x3abb15),_0x18be0a[_0x67f1('0x6')][_0x8e3479][_0x67f1('0x2b')]*0x3e8);_0x18be0a[_0x67f1('0x8')][_0x3abb15]['lastPauseAt']=moment()['format'](_0x67f1('0x2e'));_0x18be0a[_0x67f1('0x8')][_0x3abb15][_0x67f1('0x2f')]=_0x4b4ef1;_0x18be0a[_0x67f1('0x8')][_0x3abb15]['queue']=_0x8e3479;_0x18be0a[_0x67f1('0x8')][_0x3abb15][_0x67f1('0x30')]=function(){var _0x5427fb=getDiff(_0x18be0a['timers'][_0x3abb15]['lastPauseAt']);clearTimeout(_0x18be0a[_0x67f1('0x8')][_0x3abb15][_0x67f1('0x2c')]);_0x18be0a[_0x67f1('0x8')][_0x3abb15][_0x67f1('0x2c')]=![];RpcVoiceAgentReport[_0x67f1('0x31')]({'acwtime':_0x5427fb},_0x18be0a[_0x67f1('0x8')][_0x3abb15][_0x67f1('0x2f')],_0x3abb15)[_0x67f1('0x23')](function(_0x3aec6a){logger[_0x67f1('0x25')](_0x67f1('0x32'),_0x4b4ef1,_0x5427fb,_0x3aec6a);})[_0x67f1('0x33')](function(_0x25bcd8){logger[_0x67f1('0x34')](_0x67f1('0x35'),_0x4b4ef1,_0x25bcd8);});delete _0x18be0a[_0x67f1('0x8')][_0x3abb15];};}});}else{logger[_0x67f1('0x25')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x4b4ef1,_0x3abb15,_0x8e3479);}});}})['catch'](function(_0x1954e7){logger[_0x67f1('0x34')](_0x67f1('0x2a'),_0x4b4ef1,_0x18be0a[_0x67f1('0x6')][_0x8e3479]['acwTimeout'],_0x3abb15,_0x8e3479);})[_0x67f1('0x36')](function(){delete _0x18be0a[_0x67f1('0x1b')][_0x4b4ef1];});}catch(_0x3ebf54){logger['error'](_0x67f1('0x37'),_0x3ebf54[_0x67f1('0x38')]);}};Acw[_0x67f1('0x1a')]['stopAcw']=function(_0x5cfa76){try{var _0x4cc1f1=this;if(_0x4cc1f1['timers'][_0x5cfa76]){_0x4cc1f1['timers'][_0x5cfa76][_0x67f1('0x2c')]=![];var _0x2a1df2=_0x4cc1f1[_0x67f1('0x8')][_0x5cfa76][_0x67f1('0x2f')];var _0x1b24d4=_0x4cc1f1[_0x67f1('0x8')][_0x5cfa76][_0x67f1('0x39')];var _0x1ccf3b=_0x4cc1f1['voiceQueues'][_0x1b24d4][_0x67f1('0x2b')];logger[_0x67f1('0x25')](_0x67f1('0x3a'),_0x2a1df2,_0x5cfa76);RpcUser['saveUnpause'](this[_0x67f1('0x7')][_0x5cfa76]);RpcVoiceAgentReport[_0x67f1('0x31')]({'acwtime':_0x1ccf3b,'agentacw':!![]},_0x2a1df2,_0x5cfa76)['then'](function(_0x261548){logger[_0x67f1('0x25')](_0x67f1('0x32'),_0x2a1df2,_0x1ccf3b,_0x261548);})[_0x67f1('0x33')](function(_0x4f293e){logger[_0x67f1('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x2a1df2,_0x4f293e);});}else{logger[_0x67f1('0x34')](_0x67f1('0x3b'),_0x5cfa76);if(_0x4cc1f1['timers']){logger['info'](_0x67f1('0x3c'),JSON[_0x67f1('0x3d')](_0x4cc1f1[_0x67f1('0x8')]));}}}catch(_0xfe3915){logger[_0x67f1('0x34')](_0x67f1('0x3e'),_0xfe3915['message']);}};Acw[_0x67f1('0x1a')][_0x67f1('0xa')]=function(_0x271351){try{if(this[_0x67f1('0x6')][_0x271351['queue']]&&(this[_0x67f1('0x6')][_0x271351['queue']][_0x67f1('0x3')]||this[_0x67f1('0x6')][_0x271351[_0x67f1('0x39')]][_0x67f1('0x1e')])){if(this[_0x67f1('0x7')][_0x271351[_0x67f1('0x1c')]]){this[_0x67f1('0x1b')][_0x271351['uniqueid']]={'queue':_0x271351['queue'],'interface':_0x271351[_0x67f1('0x1c')],'destlinkedid':_0x271351['destlinkedid']};}}}catch(_0x439a2f){logger[_0x67f1('0x34')]('[ACW][syncAgentConnect]\x20%s',_0x439a2f[_0x67f1('0x38')]);}};Acw['prototype'][_0x67f1('0x16')]=function(_0x1cff5b){try{if(this[_0x67f1('0x6')][_0x1cff5b[_0x67f1('0x39')]]&&(this[_0x67f1('0x6')][_0x1cff5b[_0x67f1('0x39')]][_0x67f1('0x3')]||this['voiceQueues'][_0x1cff5b[_0x67f1('0x39')]][_0x67f1('0x1e')])){if(this['agents'][_0x1cff5b[_0x67f1('0x1c')]]){this[_0x67f1('0x1b')][_0x1cff5b[_0x67f1('0x2f')]]={'queue':_0x1cff5b[_0x67f1('0x39')],'interface':_0x1cff5b[_0x67f1('0x1c')]};}}}catch(_0x57b5cf){logger[_0x67f1('0x34')]('[ACW][syncAgentConnectPreview]\x20%s',_0x57b5cf[_0x67f1('0x38')]);}};Acw['prototype'][_0x67f1('0xd')]=function(_0x1a4540){try{if(this[_0x67f1('0x1b')][_0x1a4540[_0x67f1('0x2f')]]&&_[_0x67f1('0x3f')](this[_0x67f1('0x1b')][_0x1a4540[_0x67f1('0x2f')]]['attended'])){logger[_0x67f1('0x25')]('[%s][HANGUP:UNIQUEID]',_0x1a4540[_0x67f1('0x2f')]);this['startAcw'](_0x1a4540[_0x67f1('0x2f')]);}else if(this[_0x67f1('0x1b')][_0x1a4540[_0x67f1('0x40')]]&&_[_0x67f1('0x3f')](this['channels'][_0x1a4540[_0x67f1('0x40')]]['attended'])){logger[_0x67f1('0x25')](_0x67f1('0x41'),_0x1a4540[_0x67f1('0x40')]);this[_0x67f1('0x42')](_0x1a4540['linkedid']);}}catch(_0x2c4c03){logger[_0x67f1('0x34')]('[ACW][syncHangupRequest]\x20%s',_0x2c4c03['message']);}};Acw[_0x67f1('0x1a')][_0x67f1('0xe')]=function(_0xa98cdf){try{if(this[_0x67f1('0x1b')][_0xa98cdf['uniqueid']]&&this[_0x67f1('0x1b')][_0xa98cdf[_0x67f1('0x2f')]][_0x67f1('0x27')]){logger[_0x67f1('0x25')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0xa98cdf[_0x67f1('0x2f')]);this[_0x67f1('0x42')](_0xa98cdf[_0x67f1('0x2f')]);}else if(this[_0x67f1('0x1b')][_0xa98cdf[_0x67f1('0x40')]]&&this[_0x67f1('0x1b')][_0xa98cdf['linkedid']][_0x67f1('0x27')]){logger['info'](_0x67f1('0x43'),_0xa98cdf['linkedid']);this[_0x67f1('0x42')](_0xa98cdf[_0x67f1('0x40')]);}}catch(_0x5def00){logger[_0x67f1('0x34')](_0x67f1('0x44'),_0x5def00['message']);}};Acw[_0x67f1('0x1a')][_0x67f1('0x12')]=function(_0xf4d35f){try{if(!_['isNil'](this[_0x67f1('0x1b')][_0xf4d35f[_0x67f1('0x45')]])){this[_0x67f1('0x42')](_0xf4d35f[_0x67f1('0x45')]);if(this['channels'][_0xf4d35f[_0x67f1('0x46')]]){this[_0x67f1('0x1b')][_0xf4d35f[_0x67f1('0x46')]][_0x67f1('0x27')]=!![];this[_0x67f1('0x1b')][_0xf4d35f['transfertargetuniqueid']]=this[_0x67f1('0x1b')][_0xf4d35f[_0x67f1('0x46')]];delete this[_0x67f1('0x1b')][_0xf4d35f['secondtransfereruniqueid']];}}else if(!_[_0x67f1('0x47')](this[_0x67f1('0x1b')][_0xf4d35f[_0x67f1('0x48')]])){this['startAcw'](_0xf4d35f[_0x67f1('0x48')]);if(this['channels'][_0xf4d35f[_0x67f1('0x49')]]){this[_0x67f1('0x1b')][_0xf4d35f[_0x67f1('0x49')]][_0x67f1('0x27')]=!![];this[_0x67f1('0x1b')][_0xf4d35f[_0x67f1('0x45')]]=this[_0x67f1('0x1b')][_0xf4d35f[_0x67f1('0x49')]];delete this[_0x67f1('0x1b')][_0xf4d35f[_0x67f1('0x49')]];}}}catch(_0x22e9bc){logger[_0x67f1('0x34')]('[ACW][syncAttendedTransfer]\x20%s',_0x22e9bc[_0x67f1('0x38')]);}};Acw['prototype'][_0x67f1('0x14')]=function(_0x3cb8a8){try{if(this[_0x67f1('0x1b')][_0x3cb8a8['transfereruniqueid']]){logger[_0x67f1('0x25')](_0x67f1('0x4a'),JSON['stringify'](_0x3cb8a8[_0x67f1('0x4b')]));this[_0x67f1('0x42')](_0x3cb8a8[_0x67f1('0x4b')]);}else if(this[_0x67f1('0x1b')][_0x3cb8a8['transfererlinkedid']]){logger['info'](_0x67f1('0x4c'),JSON[_0x67f1('0x3d')](_0x3cb8a8[_0x67f1('0x4d')]));this[_0x67f1('0x42')](_0x3cb8a8[_0x67f1('0x4d')]);}}catch(_0x271184){logger[_0x67f1('0x34')](_0x67f1('0x4e'),_0x271184['message']);}};Acw[_0x67f1('0x1a')][_0x67f1('0x10')]=function(_0x3b80a5){try{if(this[_0x67f1('0x6')][_0x3b80a5[_0x67f1('0x39')]]&&this[_0x67f1('0x6')][_0x3b80a5[_0x67f1('0x39')]]['autopause']==='all'){if(this['agents'][_0x3b80a5[_0x67f1('0x1c')]]){logger[_0x67f1('0x25')](_0x67f1('0x4f'),_0x3b80a5['uniqueid'],_0x3b80a5[_0x67f1('0x1c')],_0x3b80a5[_0x67f1('0x39')]);return RpcUser['savePause'](this[_0x67f1('0x7')][_0x3b80a5[_0x67f1('0x1c')]],_0x67f1('0x50'),_0x3b80a5[_0x67f1('0x2f')]);}}}catch(_0x263934){logger[_0x67f1('0x34')](_0x67f1('0x51'),_0x263934[_0x67f1('0x38')]);}};module[_0x67f1('0x52')]=Acw; \ No newline at end of file +var _0xc807=['[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','info','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','uniqueid','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','message','destlinkedid','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xc807,0x65));var _0x7c80=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xc807[_0x3054be];return _0x3df150;};'use strict';var util=require(_0x7c80('0x0'));var _=require(_0x7c80('0x1'));var moment=require(_0x7c80('0x2'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x7c80('0x3'));var RpcUser=require(_0x7c80('0x4'));var RpcVoiceAgentReport=require(_0x7c80('0x5'));function Acw(_0x50e6a4){this[_0x7c80('0x6')]=_0x50e6a4[_0x7c80('0x6')];this[_0x7c80('0x7')]=_0x50e6a4[_0x7c80('0x7')];this['timers']=_0x50e6a4[_0x7c80('0x8')];this[_0x7c80('0x9')]={};ami['on'](_0x7c80('0xa'),this[_0x7c80('0xb')][_0x7c80('0xc')](this));ami['on'](_0x7c80('0xd'),this[_0x7c80('0xe')]['bind'](this));ami['on'](_0x7c80('0xf'),this[_0x7c80('0x10')][_0x7c80('0xc')](this));ami['on'](_0x7c80('0x11'),this[_0x7c80('0x12')][_0x7c80('0xc')](this));ami['on'](_0x7c80('0x13'),this[_0x7c80('0x14')][_0x7c80('0xc')](this));ami['on'](_0x7c80('0x15'),this[_0x7c80('0x16')][_0x7c80('0xc')](this));ami['on'](_0x7c80('0x17'),this[_0x7c80('0x18')][_0x7c80('0xc')](this));}function getDiff(_0x339178){var _0x17406b=moment()[_0x7c80('0x19')](0x0);var _0x2e9b9d=moment(_0x339178)[_0x7c80('0x19')](0x0);return _0x17406b[_0x7c80('0x1a')](_0x2e9b9d,_0x7c80('0x1b'));}Acw[_0x7c80('0x1c')][_0x7c80('0x1d')]=function(_0x586a31){try{var _0x43bf53=this;var _0x11014b=this[_0x7c80('0x9')][_0x586a31][_0x7c80('0x1e')];var _0xeed71c=this['channels'][_0x586a31][_0x7c80('0x1f')];var _0x51d07e=this[_0x7c80('0x6')][_0xeed71c];var _0x90121e=![];var _0x5c0611=_0x7c80('0x20');if(_0x51d07e[_0x7c80('0x21')]){if(_0x51d07e[_0x7c80('0x22')][_0x7c80('0x23')]){_0x90121e=!![];_0x5c0611=_0x51d07e[_0x7c80('0x22')][_0x7c80('0x23')];}}ami['Action']({'action':_0x7c80('0x24'),'interface':_0x11014b,'paused':!![],'reason':_0x5c0611})[_0x7c80('0x25')](function(_0x39268a){if(_0x43bf53[_0x7c80('0x7')][_0x11014b]){return RpcUser[_0x7c80('0x26')](_0x43bf53[_0x7c80('0x7')][_0x11014b]['id'])[_0x7c80('0x25')](function(_0x18e842){if(_0x18e842&&!_0x18e842['voicePause']){logger[_0x7c80('0x27')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x586a31,_0x11014b,_0xeed71c);var _0x6bae36=_0x43bf53[_0x7c80('0x9')][_0x586a31]['attended']&&_0x43bf53[_0x7c80('0x9')][_0x586a31]['destlinkedid']?_0x43bf53['channels'][_0x586a31]['destlinkedid']:_0x586a31;return RpcUser[_0x7c80('0x28')](_0x43bf53[_0x7c80('0x7')][_0x11014b],_0x5c0611,_0x6bae36)[_0x7c80('0x25')](function(_0x938734){if(!_0x90121e){_0x43bf53[_0x7c80('0x8')][_0x11014b]={};logger[_0x7c80('0x27')](_0x7c80('0x29'),_0x586a31,_0x43bf53[_0x7c80('0x6')][_0xeed71c][_0x7c80('0x2a')],_0x11014b,_0xeed71c);_0x43bf53[_0x7c80('0x8')][_0x11014b][_0x7c80('0x2b')]=setTimeout(_0x43bf53[_0x7c80('0x2c')][_0x7c80('0xc')](_0x43bf53,_0x11014b),_0x43bf53[_0x7c80('0x6')][_0xeed71c][_0x7c80('0x2a')]*0x3e8);_0x43bf53[_0x7c80('0x8')][_0x11014b]['lastPauseAt']=moment()[_0x7c80('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x43bf53[_0x7c80('0x8')][_0x11014b][_0x7c80('0x2e')]=_0x586a31;_0x43bf53['timers'][_0x11014b][_0x7c80('0x1f')]=_0xeed71c;_0x43bf53[_0x7c80('0x8')][_0x11014b][_0x7c80('0x2f')]=function(){var _0x2f7d2d=getDiff(_0x43bf53[_0x7c80('0x8')][_0x11014b][_0x7c80('0x30')]);clearTimeout(_0x43bf53[_0x7c80('0x8')][_0x11014b]['timer']);_0x43bf53[_0x7c80('0x8')][_0x11014b][_0x7c80('0x2b')]=![];RpcVoiceAgentReport[_0x7c80('0x31')]({'acwtime':_0x2f7d2d},_0x43bf53[_0x7c80('0x8')][_0x11014b][_0x7c80('0x2e')],_0x11014b)['then'](function(_0x70edaa){logger[_0x7c80('0x27')](_0x7c80('0x32'),_0x586a31,_0x2f7d2d,_0x70edaa);})[_0x7c80('0x33')](function(_0x57e4d6){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x586a31,_0x57e4d6);});delete _0x43bf53[_0x7c80('0x8')][_0x11014b];};}});}else{logger[_0x7c80('0x27')](_0x7c80('0x34'),_0x586a31,_0x11014b,_0xeed71c);}});}})[_0x7c80('0x33')](function(_0xd00d95){logger['error'](_0x7c80('0x29'),_0x586a31,_0x43bf53[_0x7c80('0x6')][_0xeed71c]['acwTimeout'],_0x11014b,_0xeed71c);})[_0x7c80('0x35')](function(){delete _0x43bf53['channels'][_0x586a31];});}catch(_0x234cd5){logger[_0x7c80('0x36')](_0x7c80('0x37'),_0x234cd5['message']);}};Acw['prototype'][_0x7c80('0x2c')]=function(_0x36e1e6){try{var _0x4bed89=this;if(_0x4bed89[_0x7c80('0x8')][_0x36e1e6]){_0x4bed89['timers'][_0x36e1e6][_0x7c80('0x2b')]=![];var _0x3bca0e=_0x4bed89[_0x7c80('0x8')][_0x36e1e6][_0x7c80('0x2e')];var _0x1a7571=_0x4bed89[_0x7c80('0x8')][_0x36e1e6]['queue'];var _0x4bc97f=_0x4bed89['voiceQueues'][_0x1a7571]['acwTimeout'];logger['info'](_0x7c80('0x38'),_0x3bca0e,_0x36e1e6);RpcUser['saveUnpause'](this[_0x7c80('0x7')][_0x36e1e6]);RpcVoiceAgentReport[_0x7c80('0x31')]({'acwtime':_0x4bc97f,'agentacw':!![]},_0x3bca0e,_0x36e1e6)[_0x7c80('0x25')](function(_0x5e7953){logger[_0x7c80('0x27')]('[%s][UPDATE][ACWTIME:%s]',_0x3bca0e,_0x4bc97f,_0x5e7953);})[_0x7c80('0x33')](function(_0x48241c){logger[_0x7c80('0x36')](_0x7c80('0x39'),_0x3bca0e,_0x48241c);});}else{logger['error'](_0x7c80('0x3a'),_0x36e1e6);if(_0x4bed89[_0x7c80('0x8')]){logger[_0x7c80('0x27')](_0x7c80('0x3b'),JSON[_0x7c80('0x3c')](_0x4bed89[_0x7c80('0x8')]));}}}catch(_0x46368d){logger[_0x7c80('0x36')]('[ACW][STOP]\x20%s',_0x46368d[_0x7c80('0x3d')]);}};Acw[_0x7c80('0x1c')]['syncAgentConnect']=function(_0x1db0cf){try{if(this[_0x7c80('0x6')][_0x1db0cf[_0x7c80('0x1f')]]&&(this[_0x7c80('0x6')][_0x1db0cf[_0x7c80('0x1f')]]['acw']||this[_0x7c80('0x6')][_0x1db0cf['queue']][_0x7c80('0x21')])){if(this[_0x7c80('0x7')][_0x1db0cf[_0x7c80('0x1e')]]){this[_0x7c80('0x9')][_0x1db0cf[_0x7c80('0x2e')]]={'queue':_0x1db0cf['queue'],'interface':_0x1db0cf[_0x7c80('0x1e')],'destlinkedid':_0x1db0cf[_0x7c80('0x3e')]};}}}catch(_0x4427cb){logger[_0x7c80('0x36')](_0x7c80('0x3f'),_0x4427cb[_0x7c80('0x3d')]);}};Acw[_0x7c80('0x1c')][_0x7c80('0x18')]=function(_0xb7ba83){try{if(this[_0x7c80('0x6')][_0xb7ba83['queue']]&&(this['voiceQueues'][_0xb7ba83[_0x7c80('0x1f')]][_0x7c80('0x3')]||this[_0x7c80('0x6')][_0xb7ba83[_0x7c80('0x1f')]][_0x7c80('0x21')])){if(this['agents'][_0xb7ba83['interface']]){this[_0x7c80('0x9')][_0xb7ba83['uniqueid']]={'queue':_0xb7ba83[_0x7c80('0x1f')],'interface':_0xb7ba83[_0x7c80('0x1e')]};}}}catch(_0x26cf5c){logger[_0x7c80('0x36')]('[ACW][syncAgentConnectPreview]\x20%s',_0x26cf5c['message']);}};Acw[_0x7c80('0x1c')][_0x7c80('0xe')]=function(_0x2b0277){try{if(this[_0x7c80('0x9')][_0x2b0277[_0x7c80('0x2e')]]&&_[_0x7c80('0x40')](this[_0x7c80('0x9')][_0x2b0277[_0x7c80('0x2e')]][_0x7c80('0x41')])){logger[_0x7c80('0x27')]('[%s][HANGUP:UNIQUEID]',_0x2b0277[_0x7c80('0x2e')]);this[_0x7c80('0x1d')](_0x2b0277['uniqueid']);}else if(this[_0x7c80('0x9')][_0x2b0277[_0x7c80('0x42')]]&&_[_0x7c80('0x40')](this['channels'][_0x2b0277[_0x7c80('0x42')]][_0x7c80('0x41')])){logger[_0x7c80('0x27')]('[%s][HANGUP:LINKEDID]',_0x2b0277[_0x7c80('0x42')]);this[_0x7c80('0x1d')](_0x2b0277[_0x7c80('0x42')]);}}catch(_0x20beb0){logger[_0x7c80('0x36')]('[ACW][syncHangupRequest]\x20%s',_0x20beb0['message']);}};Acw[_0x7c80('0x1c')][_0x7c80('0x10')]=function(_0x420185){try{if(this[_0x7c80('0x9')][_0x420185[_0x7c80('0x2e')]]&&this[_0x7c80('0x9')][_0x420185[_0x7c80('0x2e')]]['attended']){logger['info'](_0x7c80('0x43'),_0x420185['uniqueid']);this[_0x7c80('0x1d')](_0x420185[_0x7c80('0x2e')]);}else if(this[_0x7c80('0x9')][_0x420185[_0x7c80('0x42')]]&&this[_0x7c80('0x9')][_0x420185[_0x7c80('0x42')]][_0x7c80('0x41')]){logger[_0x7c80('0x27')](_0x7c80('0x44'),_0x420185[_0x7c80('0x42')]);this[_0x7c80('0x1d')](_0x420185[_0x7c80('0x42')]);}}catch(_0x574a02){logger[_0x7c80('0x36')](_0x7c80('0x45'),_0x574a02[_0x7c80('0x3d')]);}};Acw[_0x7c80('0x1c')][_0x7c80('0x14')]=function(_0x197d6c){try{if(!_[_0x7c80('0x46')](this['channels'][_0x197d6c[_0x7c80('0x47')]])){this[_0x7c80('0x1d')](_0x197d6c[_0x7c80('0x47')]);if(this[_0x7c80('0x9')][_0x197d6c[_0x7c80('0x48')]]){this['channels'][_0x197d6c[_0x7c80('0x48')]][_0x7c80('0x41')]=!![];this['channels'][_0x197d6c['transfertargetuniqueid']]=this[_0x7c80('0x9')][_0x197d6c[_0x7c80('0x48')]];delete this['channels'][_0x197d6c[_0x7c80('0x48')]];}}else if(!_[_0x7c80('0x46')](this['channels'][_0x197d6c[_0x7c80('0x49')]])){this[_0x7c80('0x1d')](_0x197d6c[_0x7c80('0x49')]);if(this[_0x7c80('0x9')][_0x197d6c[_0x7c80('0x4a')]]){this[_0x7c80('0x9')][_0x197d6c[_0x7c80('0x4a')]][_0x7c80('0x41')]=!![];this['channels'][_0x197d6c['transfereeuniqueid']]=this[_0x7c80('0x9')][_0x197d6c[_0x7c80('0x4a')]];delete this[_0x7c80('0x9')][_0x197d6c[_0x7c80('0x4a')]];}}}catch(_0x101d73){logger[_0x7c80('0x36')](_0x7c80('0x4b'),_0x101d73[_0x7c80('0x3d')]);}};Acw[_0x7c80('0x1c')][_0x7c80('0x16')]=function(_0xb68e72){try{if(this[_0x7c80('0x9')][_0xb68e72['transfereruniqueid']]){logger[_0x7c80('0x27')](_0x7c80('0x4c'),JSON['stringify'](_0xb68e72[_0x7c80('0x4d')]));this['startAcw'](_0xb68e72['transfereruniqueid']);}else if(this[_0x7c80('0x9')][_0xb68e72[_0x7c80('0x4e')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x7c80('0x3c')](_0xb68e72[_0x7c80('0x4e')]));this[_0x7c80('0x1d')](_0xb68e72[_0x7c80('0x4e')]);}}catch(_0x917939){logger['error'](_0x7c80('0x4f'),_0x917939[_0x7c80('0x3d')]);}};Acw[_0x7c80('0x1c')][_0x7c80('0x12')]=function(_0x3be1b7){try{if(this['voiceQueues'][_0x3be1b7[_0x7c80('0x1f')]]&&this[_0x7c80('0x6')][_0x3be1b7[_0x7c80('0x1f')]][_0x7c80('0x50')]==='all'){if(this[_0x7c80('0x7')][_0x3be1b7['interface']]){logger[_0x7c80('0x27')](_0x7c80('0x51'),_0x3be1b7[_0x7c80('0x2e')],_0x3be1b7['interface'],_0x3be1b7[_0x7c80('0x1f')]);return RpcUser['savePause'](this[_0x7c80('0x7')][_0x3be1b7[_0x7c80('0x1e')]],_0x7c80('0x52'),_0x3be1b7[_0x7c80('0x2e')]);}}}catch(_0x40f24a){logger[_0x7c80('0x36')](_0x7c80('0x53'),_0x40f24a[_0x7c80('0x3d')]);}};module[_0x7c80('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 3bf8e09..5bf04f0 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 _0xb25a=['lodash','../../config/logger','ami','../../config/environment','asterisk','username','password','keepConnected','Action','promisify','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','port','once','close','connect','info','format','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','log','asterisk-manager','bluebird','moment','util'];(function(_0x2b3284,_0x4ff135){var _0x212ed5=function(_0x19ccd7){while(--_0x19ccd7){_0x2b3284['push'](_0x2b3284['shift']());}};_0x212ed5(++_0x4ff135);}(_0xb25a,0x152));var _0xab25=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb25a[_0x19950b];return _0x3c6b41;};'use strict';var Manager=require(_0xab25('0x0'));var BPromise=require(_0xab25('0x1'));var moment=require(_0xab25('0x2'));var util=require(_0xab25('0x3'));var _=require(_0xab25('0x4'));var logger=require(_0xab25('0x5'))(_0xab25('0x6'));var config=require(_0xab25('0x7'));var ami=new Manager(config['asterisk']['port'],config[_0xab25('0x8')]['ip'],config[_0xab25('0x8')][_0xab25('0x9')],config['asterisk'][_0xab25('0xa')],!![]);ami[_0xab25('0xb')]();ami[_0xab25('0xc')]=BPromise[_0xab25('0xd')](ami['action']);function error(_0x1a0dae){logger[_0xab25('0xe')](util['format'](_0xab25('0xf'),config[_0xab25('0x8')][_0xab25('0x9')],config[_0xab25('0x8')]['ip'],config[_0xab25('0x8')]['port'],util[_0xab25('0x10')](_0x1a0dae,![],null)));}function close(){logger['error'](util['format'](_0xab25('0x11'),config[_0xab25('0x8')][_0xab25('0x9')],config[_0xab25('0x8')]['ip'],config['asterisk']['port']));}ami[_0xab25('0x12')]=function(){return function(){return ami[_0xab25('0xc')]({'action':_0xab25('0x13')});};};ami[_0xab25('0x14')]=function(){return function(){return ami[_0xab25('0xc')]({'action':_0xab25('0x15')});};};ami[_0xab25('0x16')]=function(){return function(){return ami['Action']({'action':_0xab25('0x17')});};};ami[_0xab25('0x18')]=function(){return function(){return ami['Action']({'action':_0xab25('0x19')});};};ami[_0xab25('0x1a')]=function(){return function(){return ami[_0xab25('0xc')]({'action':_0xab25('0x1b')});};};function connect(_0x306500){logger['info'](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk'][_0xab25('0x9')],config['asterisk']['ip'],config['asterisk'][_0xab25('0x1c')]));ami[_0xab25('0x1d')](_0xab25('0xe'),error);ami[_0xab25('0x1d')](_0xab25('0x1e'),close);}ami['on'](_0xab25('0x1f'),connect);ami['on']('shutdown',function(_0x4a3022){logger[_0xab25('0x20')](util[_0xab25('0x21')](_0xab25('0x22'),config['asterisk'][_0xab25('0x9')],config[_0xab25('0x8')]['ip'],config[_0xab25('0x8')]['port'],util['inspect'](_0x4a3022,![],null)));});ami['on']('fullybooted',function(_0x5d145e){logger[_0xab25('0x20')](util[_0xab25('0x21')](_0xab25('0x23'),config[_0xab25('0x8')][_0xab25('0x9')],config[_0xab25('0x8')]['ip'],config[_0xab25('0x8')]['port']));return BPromise['resolve']()[_0xab25('0x24')](ami[_0xab25('0x12')]())['then'](ami[_0xab25('0x14')]())[_0xab25('0x24')](ami[_0xab25('0x16')]())[_0xab25('0x24')](ami[_0xab25('0x18')]())[_0xab25('0x24')](ami[_0xab25('0x1a')]())['catch'](function(_0x41788b){console[_0xab25('0x25')](_0x41788b);});});ami[_0xab25('0x1d')]('error',error);ami[_0xab25('0x1d')](_0xab25('0x1e'),close);module['exports']=ami; \ No newline at end of file +var _0xeda8=['password','keepConnected','promisify','action','error','format','port','inspect','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','log','exports','asterisk-manager','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','username'];(function(_0xc6971f,_0x53138a){var _0x28ca53=function(_0xa0f0b4){while(--_0xa0f0b4){_0xc6971f['push'](_0xc6971f['shift']());}};_0x28ca53(++_0x53138a);}(_0xeda8,0x1e5));var _0x8eda=function(_0x12da9c,_0x428e85){_0x12da9c=_0x12da9c-0x0;var _0x56b9b7=_0xeda8[_0x12da9c];return _0x56b9b7;};'use strict';var Manager=require(_0x8eda('0x0'));var BPromise=require('bluebird');var moment=require(_0x8eda('0x1'));var util=require(_0x8eda('0x2'));var _=require(_0x8eda('0x3'));var logger=require(_0x8eda('0x4'))(_0x8eda('0x5'));var config=require(_0x8eda('0x6'));var ami=new Manager(config[_0x8eda('0x7')]['port'],config['asterisk']['ip'],config[_0x8eda('0x7')][_0x8eda('0x8')],config[_0x8eda('0x7')][_0x8eda('0x9')],!![]);ami[_0x8eda('0xa')]();ami['Action']=BPromise[_0x8eda('0xb')](ami[_0x8eda('0xc')]);function error(_0x16211b){logger[_0x8eda('0xd')](util[_0x8eda('0xe')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x8eda('0x7')]['username'],config['asterisk']['ip'],config['asterisk'][_0x8eda('0xf')],util[_0x8eda('0x10')](_0x16211b,![],null)));}function close(){logger['error'](util[_0x8eda('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x8eda('0x7')][_0x8eda('0x8')],config[_0x8eda('0x7')]['ip'],config[_0x8eda('0x7')][_0x8eda('0xf')]));}ami[_0x8eda('0x11')]=function(){return function(){return ami[_0x8eda('0x12')]({'action':_0x8eda('0x13')});};};ami[_0x8eda('0x14')]=function(){return function(){return ami[_0x8eda('0x12')]({'action':_0x8eda('0x15')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x8eda('0x12')]({'action':_0x8eda('0x16')});};};ami[_0x8eda('0x17')]=function(){return function(){return ami['Action']({'action':_0x8eda('0x18')});};};ami[_0x8eda('0x19')]=function(){return function(){return ami[_0x8eda('0x12')]({'action':_0x8eda('0x1a')});};};function connect(_0x26ea73){logger[_0x8eda('0x1b')](util[_0x8eda('0xe')](_0x8eda('0x1c'),config[_0x8eda('0x7')][_0x8eda('0x8')],config[_0x8eda('0x7')]['ip'],config['asterisk'][_0x8eda('0xf')]));ami[_0x8eda('0x1d')](_0x8eda('0xd'),error);ami[_0x8eda('0x1d')](_0x8eda('0x1e'),close);}ami['on'](_0x8eda('0x1f'),connect);ami['on']('shutdown',function(_0x110521){logger[_0x8eda('0x1b')](util[_0x8eda('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x8eda('0x7')][_0x8eda('0x8')],config[_0x8eda('0x7')]['ip'],config[_0x8eda('0x7')][_0x8eda('0xf')],util[_0x8eda('0x10')](_0x110521,![],null)));});ami['on'](_0x8eda('0x20'),function(_0x19070f){logger[_0x8eda('0x1b')](util[_0x8eda('0xe')](_0x8eda('0x21'),config[_0x8eda('0x7')][_0x8eda('0x8')],config[_0x8eda('0x7')]['ip'],config[_0x8eda('0x7')][_0x8eda('0xf')]));return BPromise[_0x8eda('0x22')]()['then'](ami[_0x8eda('0x11')]())[_0x8eda('0x23')](ami[_0x8eda('0x14')]())['then'](ami['actionSipPeerStatus']())[_0x8eda('0x23')](ami[_0x8eda('0x17')]())['then'](ami[_0x8eda('0x19')]())['catch'](function(_0xee4c29){console[_0x8eda('0x24')](_0xee4c29);});});ami[_0x8eda('0x1d')](_0x8eda('0xd'),error);ami['once'](_0x8eda('0x1e'),close);module[_0x8eda('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index bd3919a..63b83c4 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 _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x396f7d,_0xf9d7a){var _0x45efa6=function(_0x1e65a2){while(--_0x1e65a2){_0x396f7d['push'](_0x396f7d['shift']());}};_0x45efa6(++_0xf9d7a);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3072eb,_0x455321){_0x3072eb=_0x3072eb-0x0;var _0x55db4b=_0xbdb7[_0x3072eb];return _0x55db4b;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file +var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x2755fb,_0x5970f1){var _0x293f12=function(_0x4c629d){while(--_0x4c629d){_0x2755fb['push'](_0x2755fb['shift']());}};_0x293f12(++_0x5970f1);}(_0x9bde,0xe1));var _0xe9bd=function(_0x7d154e,_0x3b1624){_0x7d154e=_0x7d154e-0x0;var _0x5c7254=_0x9bde[_0x7d154e];return _0x5c7254;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 29effcc..9c885f9 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 _0x7cd0=['VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','exports','lodash','moment','isNil','string','voiceQueue','name','Contact','number','phone','queue','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0x7cd0,0xea));var _0x07cd=function(_0x40cf6e,_0x31439b){_0x40cf6e=_0x40cf6e-0x0;var _0x5bf109=_0x7cd0[_0x40cf6e];return _0x5bf109;};'use strict';var util=require('util');var _=require(_0x07cd('0x0'));var moment=require(_0x07cd('0x1'));function checkNameSurname(_0x498817,_0x459edc,_0x41419d){var _0x5fdad3='';if(!_[_0x07cd('0x2')](_0x459edc)&&_0x07cd('0x3')===typeof _0x459edc){_0x5fdad3+=_0x459edc;}if(!_[_0x07cd('0x2')](_0x41419d)&&'string'===typeof _0x41419d){_0x5fdad3+='\x20'+_0x41419d;}if(_0x5fdad3!==''){return _0x5fdad3;}return _0x498817;}function Action(_0x56f8c9,_0x5d215b,_0x2bb981){this[_0x07cd('0x4')]=_0x56f8c9;this['uniqueid']=_0x2bb981||undefined;this[_0x07cd('0x5')]=checkNameSurname(_0x5d215b[_0x07cd('0x6')]['phone'],_0x5d215b[_0x07cd('0x6')]['firstName'],_0x5d215b[_0x07cd('0x6')]['lastName']);this[_0x07cd('0x7')]=_0x5d215b[_0x07cd('0x6')][_0x07cd('0x8')];this[_0x07cd('0x9')]=_0x56f8c9[_0x07cd('0x5')];this['active']=_0x5d215b[_0x07cd('0xa')]||![];this['type']=_0x56f8c9['type'];this[_0x07cd('0xb')]=_0x56f8c9[_0x07cd('0xb')]||0x3;this[_0x07cd('0xc')]=_0x5d215b[_0x07cd('0xc')];this[_0x07cd('0xd')]=_0x5d215b[_0x07cd('0xd')];this['countcongestionretry']=_0x5d215b[_0x07cd('0xe')];this[_0x07cd('0xf')]=_0x5d215b[_0x07cd('0xf')];this[_0x07cd('0x10')]=_0x5d215b['countnosuchnumberretry'];this['countdropretry']=_0x5d215b[_0x07cd('0x11')];this[_0x07cd('0x12')]=_0x5d215b[_0x07cd('0x12')];this[_0x07cd('0x13')]=_0x5d215b['countmachineretry'];this[_0x07cd('0x14')]=_0x5d215b[_0x07cd('0x14')];this[_0x07cd('0x15')]=_0x5d215b['ContactId'];this[_0x07cd('0x16')]=_0x5d215b[_0x07cd('0x16')];this[_0x07cd('0x17')]=_0x5d215b[_0x07cd('0x17')];this['VoiceQueueId']=_0x5d215b[_0x07cd('0x18')];this[_0x07cd('0x19')]=_0x5d215b[_0x07cd('0x19')];this[_0x07cd('0x1a')]=_0x5d215b['id'];this[_0x07cd('0x1b')]=_0x5d215b[_0x07cd('0x6')][_0x07cd('0x1c')]||'';this['starttime']=moment()[_0x07cd('0x1d')](_0x07cd('0x1e'));this[_0x07cd('0x1f')]=_0x5d215b['callback'];this['callbackuniqueid']=_0x5d215b[_0x07cd('0x20')];this[_0x07cd('0x21')]=_0x5d215b['callbackat'];this['recallme']=_0x5d215b[_0x07cd('0x22')];this['originatecalleridnum']='';this[_0x07cd('0x23')]='';}Action['prototype'][_0x07cd('0x24')]=function(){return util[_0x07cd('0x1d')](_0x07cd('0x25'),this[_0x07cd('0x5')],this[_0x07cd('0x4')][_0x07cd('0x26')]>0x0?this[_0x07cd('0x7')][_0x07cd('0x27')](this[_0x07cd('0x4')][_0x07cd('0x26')]):this[_0x07cd('0x7')]);};Action[_0x07cd('0x28')][_0x07cd('0x29')]=function(){return this[_0x07cd('0x9')];};module[_0x07cd('0x2a')]=Action; \ No newline at end of file +var _0xfe1e=['dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','number','queue','active','type'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xfe1e,0x134));var _0xefe1=function(_0x7cec12,_0x51af0b){_0x7cec12=_0x7cec12-0x0;var _0x2c3dbd=_0xfe1e[_0x7cec12];return _0x2c3dbd;};'use strict';var util=require(_0xefe1('0x0'));var _=require(_0xefe1('0x1'));var moment=require(_0xefe1('0x2'));function checkNameSurname(_0x11974c,_0x4bbd5,_0xb98587){var _0x3c8fdb='';if(!_[_0xefe1('0x3')](_0x4bbd5)&&_0xefe1('0x4')===typeof _0x4bbd5){_0x3c8fdb+=_0x4bbd5;}if(!_['isNil'](_0xb98587)&&_0xefe1('0x4')===typeof _0xb98587){_0x3c8fdb+='\x20'+_0xb98587;}if(_0x3c8fdb!==''){return _0x3c8fdb;}return _0x11974c;}function Action(_0x39ff99,_0xb18339,_0x4441e2){this['voiceQueue']=_0x39ff99;this[_0xefe1('0x5')]=_0x4441e2||undefined;this[_0xefe1('0x6')]=checkNameSurname(_0xb18339[_0xefe1('0x7')][_0xefe1('0x8')],_0xb18339[_0xefe1('0x7')][_0xefe1('0x9')],_0xb18339[_0xefe1('0x7')]['lastName']);this[_0xefe1('0xa')]=_0xb18339[_0xefe1('0x7')][_0xefe1('0x8')];this[_0xefe1('0xb')]=_0x39ff99['name'];this[_0xefe1('0xc')]=_0xb18339[_0xefe1('0xc')]||![];this['type']=_0x39ff99[_0xefe1('0xd')];this[_0xefe1('0xe')]=_0x39ff99[_0xefe1('0xe')]||0x3;this[_0xefe1('0xf')]=_0xb18339['scheduledat'];this[_0xefe1('0x10')]=_0xb18339[_0xefe1('0x10')];this[_0xefe1('0x11')]=_0xb18339[_0xefe1('0x11')];this[_0xefe1('0x12')]=_0xb18339[_0xefe1('0x12')];this[_0xefe1('0x13')]=_0xb18339[_0xefe1('0x13')];this['countdropretry']=_0xb18339[_0xefe1('0x14')];this['countabandonedretry']=_0xb18339[_0xefe1('0x15')];this['countmachineretry']=_0xb18339[_0xefe1('0x16')];this['countagentrejectretry']=_0xb18339[_0xefe1('0x17')];this['ContactId']=_0xb18339[_0xefe1('0x18')];this['ListId']=_0xb18339[_0xefe1('0x19')];this[_0xefe1('0x1a')]=_0xb18339[_0xefe1('0x1a')];this[_0xefe1('0x1b')]=_0xb18339[_0xefe1('0x1b')];this[_0xefe1('0x1c')]=_0xb18339[_0xefe1('0x1c')];this[_0xefe1('0x1d')]=_0xb18339['id'];this[_0xefe1('0x1e')]=_0xb18339['Contact']['firstName']||'';this[_0xefe1('0x1f')]=moment()[_0xefe1('0x20')](_0xefe1('0x21'));this[_0xefe1('0x22')]=_0xb18339[_0xefe1('0x22')];this[_0xefe1('0x23')]=_0xb18339[_0xefe1('0x23')];this['callbackat']=_0xb18339[_0xefe1('0x24')];this[_0xefe1('0x25')]=_0xb18339['recallme'];this['originatecalleridnum']='';this[_0xefe1('0x26')]='';}Action[_0xefe1('0x27')][_0xefe1('0x28')]=function(){return util[_0xefe1('0x20')](_0xefe1('0x29'),this[_0xefe1('0x6')],this[_0xefe1('0x2a')][_0xefe1('0x2b')]>0x0?this[_0xefe1('0xa')][_0xefe1('0x2c')](this[_0xefe1('0x2a')][_0xefe1('0x2b')]):this[_0xefe1('0xa')]);};Action[_0xefe1('0x27')]['getQueue']=function(){return this[_0xefe1('0xb')];};module[_0xefe1('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index bb5f182..9983c1a 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 _0x3a60=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','statedesc','Answer','scheduledat','type','campaigntype','outbound'];(function(_0xfebcc7,_0x54d886){var _0x4cac4e=function(_0x5d651e){while(--_0x5d651e){_0xfebcc7['push'](_0xfebcc7['shift']());}};_0x4cac4e(++_0x54d886);}(_0x3a60,0x1b8));var _0x03a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a60[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x03a6('0x0'));var moment=require(_0x03a6('0x1'));function getSeconds(_0x17dc2e,_0x481e88){var _0x2c4fda=moment(_0x17dc2e)[_0x03a6('0x2')](0x0);var _0x56a2c9=moment(_0x481e88)['milliseconds'](0x0);return _0x2c4fda[_0x03a6('0x3')](_0x56a2c9,'seconds');}function AgentComplete(_0x2dec1e,_0x3827b9){this['state']=0x4;this[_0x03a6('0x4')]=_0x03a6('0x5');this[_0x03a6('0x6')]=_0x2dec1e[_0x03a6('0x6')];this[_0x03a6('0x7')]=_0x2dec1e[_0x03a6('0x7')];this[_0x03a6('0x8')]=_0x2dec1e[_0x03a6('0x7')]===_0x03a6('0x9')?_0x03a6('0xa'):_0x2dec1e[_0x03a6('0x7')];this[_0x03a6('0xb')]=_0x2dec1e['countbusyretry'];this[_0x03a6('0xc')]=_0x2dec1e[_0x03a6('0xc')];this[_0x03a6('0xd')]=_0x2dec1e[_0x03a6('0xd')];this['countglobal']=_0x2dec1e[_0x03a6('0xb')]+_0x2dec1e[_0x03a6('0xc')]+_0x2dec1e[_0x03a6('0xd')]+_0x2dec1e[_0x03a6('0xe')]+_0x2dec1e[_0x03a6('0xf')]+_0x2dec1e[_0x03a6('0x10')]+_0x2dec1e['countmachineretry']+_0x2dec1e['countagentrejectretry'];this[_0x03a6('0xe')]=_0x2dec1e[_0x03a6('0xe')];this[_0x03a6('0xf')]=_0x2dec1e[_0x03a6('0xf')];this['countabandonedretry']=_0x2dec1e['countabandonedretry'];this[_0x03a6('0x11')]=_0x2dec1e[_0x03a6('0x11')];this[_0x03a6('0x12')]=_0x2dec1e[_0x03a6('0x12')];this[_0x03a6('0x13')]=_0x3827b9['uniqueid'];this[_0x03a6('0x14')]=_0x2dec1e[_0x03a6('0x15')];this[_0x03a6('0x16')]=_0x2dec1e[_0x03a6('0x17')];this['starttime']=_0x2dec1e[_0x03a6('0x18')];this[_0x03a6('0x19')]=_0x2dec1e[_0x03a6('0x19')];this[_0x03a6('0x1a')]=_0x2dec1e[_0x03a6('0x1a')];this[_0x03a6('0x1b')]=moment()['format'](_0x03a6('0x1c'));this[_0x03a6('0x1d')]=getSeconds(_0x2dec1e[_0x03a6('0x19')],_0x2dec1e['starttime']);this[_0x03a6('0x1e')]=getSeconds(_0x2dec1e[_0x03a6('0x1a')],_0x2dec1e[_0x03a6('0x19')]);this['talktime']=getSeconds(this[_0x03a6('0x1b')],_0x2dec1e[_0x03a6('0x1a')]);this[_0x03a6('0xa')]=_0x3827b9[_0x03a6('0xa')];this[_0x03a6('0x1f')]=_0x3827b9['membername'];this[_0x03a6('0x20')]=_0x3827b9[_0x03a6('0x20')];this['callback']=_0x2dec1e[_0x03a6('0x21')];this[_0x03a6('0x22')]=_0x2dec1e['callbackuniqueid'];this[_0x03a6('0x23')]=_0x2dec1e[_0x03a6('0x23')];this[_0x03a6('0x24')]=_0x2dec1e[_0x03a6('0x24')];this[_0x03a6('0x25')]=_0x2dec1e['ContactId'];this[_0x03a6('0x26')]=_0x2dec1e[_0x03a6('0x26')];this['UserId']=_0x2dec1e[_0x03a6('0x27')];this['VoiceQueueId']=_0x2dec1e[_0x03a6('0x28')];this[_0x03a6('0x29')]=_0x2dec1e['CampaignId'];this[_0x03a6('0x2a')]=_0x2dec1e[_0x03a6('0x2a')]||'';this[_0x03a6('0x2b')]=_0x2dec1e[_0x03a6('0x2b')]||'';}module[_0x03a6('0x2c')]=AgentComplete; \ No newline at end of file +var _0x8076=['originatecalleridname','util','lodash','moment','milliseconds','diff','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8076,0x181));var _0x6807=function(_0x176009,_0x2b5166){_0x176009=_0x176009-0x0;var _0x59dccb=_0x8076[_0x176009];return _0x59dccb;};'use strict';var util=require(_0x6807('0x0'));var _=require(_0x6807('0x1'));var moment=require(_0x6807('0x2'));function getSeconds(_0x132d3d,_0x4c1fc6){var _0x4b262b=moment(_0x132d3d)[_0x6807('0x3')](0x0);var _0x1b8ca2=moment(_0x4c1fc6)[_0x6807('0x3')](0x0);return _0x4b262b[_0x6807('0x4')](_0x1b8ca2,'seconds');}function AgentComplete(_0x1cbf59,_0x2e4c34){this[_0x6807('0x5')]=0x4;this['statedesc']=_0x6807('0x6');this[_0x6807('0x7')]=_0x1cbf59[_0x6807('0x7')];this[_0x6807('0x8')]=_0x1cbf59[_0x6807('0x8')];this[_0x6807('0x9')]=_0x1cbf59['type']===_0x6807('0xa')?_0x6807('0xb'):_0x1cbf59[_0x6807('0x8')];this[_0x6807('0xc')]=_0x1cbf59['countbusyretry'];this[_0x6807('0xd')]=_0x1cbf59[_0x6807('0xd')];this[_0x6807('0xe')]=_0x1cbf59[_0x6807('0xe')];this[_0x6807('0xf')]=_0x1cbf59[_0x6807('0xc')]+_0x1cbf59['countcongestionretry']+_0x1cbf59[_0x6807('0xe')]+_0x1cbf59[_0x6807('0x10')]+_0x1cbf59[_0x6807('0x11')]+_0x1cbf59[_0x6807('0x12')]+_0x1cbf59[_0x6807('0x13')]+_0x1cbf59[_0x6807('0x14')];this[_0x6807('0x10')]=_0x1cbf59[_0x6807('0x10')];this[_0x6807('0x11')]=_0x1cbf59[_0x6807('0x11')];this[_0x6807('0x12')]=_0x1cbf59['countabandonedretry'];this[_0x6807('0x13')]=_0x1cbf59[_0x6807('0x13')];this[_0x6807('0x14')]=_0x1cbf59[_0x6807('0x14')];this[_0x6807('0x15')]=_0x2e4c34[_0x6807('0x15')];this[_0x6807('0x16')]=_0x1cbf59[_0x6807('0x17')];this[_0x6807('0x18')]=_0x1cbf59[_0x6807('0x19')];this[_0x6807('0x1a')]=_0x1cbf59['starttime'];this[_0x6807('0x1b')]=_0x1cbf59[_0x6807('0x1b')];this[_0x6807('0x1c')]=_0x1cbf59[_0x6807('0x1c')];this[_0x6807('0x1d')]=moment()[_0x6807('0x1e')](_0x6807('0x1f'));this[_0x6807('0x20')]=getSeconds(_0x1cbf59[_0x6807('0x1b')],_0x1cbf59[_0x6807('0x1a')]);this[_0x6807('0x21')]=getSeconds(_0x1cbf59[_0x6807('0x1c')],_0x1cbf59['responsetime']);this[_0x6807('0x22')]=getSeconds(this[_0x6807('0x1d')],_0x1cbf59[_0x6807('0x1c')]);this['queue']=_0x2e4c34[_0x6807('0xb')];this[_0x6807('0x23')]=_0x2e4c34[_0x6807('0x23')];this[_0x6807('0x24')]=_0x2e4c34[_0x6807('0x24')];this[_0x6807('0x25')]=_0x1cbf59[_0x6807('0x25')];this[_0x6807('0x26')]=_0x1cbf59['callbackuniqueid'];this[_0x6807('0x27')]=_0x1cbf59[_0x6807('0x27')];this[_0x6807('0x28')]=_0x1cbf59['recallme'];this[_0x6807('0x29')]=_0x1cbf59[_0x6807('0x29')];this[_0x6807('0x2a')]=_0x1cbf59[_0x6807('0x2a')];this[_0x6807('0x2b')]=_0x1cbf59['UserId'];this[_0x6807('0x2c')]=_0x1cbf59[_0x6807('0x2c')];this[_0x6807('0x2d')]=_0x1cbf59[_0x6807('0x2d')];this['originatecalleridnum']=_0x1cbf59[_0x6807('0x2e')]||'';this['originatecalleridname']=_0x1cbf59[_0x6807('0x2f')]||'';}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 464039c..fd4ace2 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 _0x207c=['countdropretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x35bcfe,_0x1a22fc){var _0x202ad0=function(_0x1c90ad){while(--_0x1c90ad){_0x35bcfe['push'](_0x35bcfe['shift']());}};_0x202ad0(++_0x1a22fc);}(_0x207c,0x1e8));var _0xc207=function(_0x972692,_0x2a1c56){_0x972692=_0x972692-0x0;var _0x542e84=_0x207c[_0x972692];return _0x542e84;};'use strict';var util=require('util');var _=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));function getSeconds(_0x1a420a,_0xaaba3d){var _0x2b40be=moment(_0x1a420a)[_0xc207('0x2')](0x0);var _0x1dd107=moment(_0xaaba3d)['milliseconds'](0x0);return _0x2b40be[_0xc207('0x3')](_0x1dd107,'seconds');}function Final(_0x5a727b){this['uniqueid']=_0x5a727b[_0xc207('0x4')];this[_0xc207('0x5')]=_0x5a727b[_0xc207('0x5')];this['type']=_0x5a727b[_0xc207('0x6')];this[_0xc207('0x7')]=_0x5a727b[_0xc207('0x6')]==='outbound'?_0xc207('0x8'):_0x5a727b[_0xc207('0x6')];this[_0xc207('0x9')]=_0x5a727b[_0xc207('0x9')];this[_0xc207('0xa')]=_0x5a727b[_0xc207('0xa')];this['countnoanswerretry']=_0x5a727b['countnoanswerretry'];this['countglobal']=_0x5a727b[_0xc207('0x9')]+_0x5a727b['countcongestionretry']+_0x5a727b[_0xc207('0xb')]+_0x5a727b[_0xc207('0xc')]+_0x5a727b['countdropretry']+_0x5a727b[_0xc207('0xd')]+_0x5a727b[_0xc207('0xe')]+_0x5a727b[_0xc207('0xf')];this[_0xc207('0xc')]=_0x5a727b[_0xc207('0xc')];this['countdropretry']=_0x5a727b[_0xc207('0x10')];this[_0xc207('0xd')]=_0x5a727b[_0xc207('0xd')];this[_0xc207('0xe')]=_0x5a727b['countmachineretry'];this['countagentrejectretry']=_0x5a727b['countagentrejectretry'];this[_0xc207('0x8')]=_0x5a727b[_0xc207('0x8')];this[_0xc207('0x11')]=_0x5a727b[_0xc207('0x11')];this['calleridnum']=_0x5a727b[_0xc207('0x12')];this[_0xc207('0x13')]=_0x5a727b[_0xc207('0x13')];this['responsetime']=_0x5a727b[_0xc207('0x14')];this['endtime']=_0x5a727b[_0xc207('0x14')];this[_0xc207('0x15')]=_0x5a727b[_0xc207('0x15')]||0x0;this[_0xc207('0x16')]=_0x5a727b[_0xc207('0x16')]||0x0;this[_0xc207('0x17')]=_0x5a727b[_0xc207('0x17')]||0x0;this[_0xc207('0x18')]=_0x5a727b[_0xc207('0x18')];this[_0xc207('0x19')]=_0x5a727b[_0xc207('0x19')];this[_0xc207('0x1a')]=_0x5a727b[_0xc207('0x1a')];this['recallme']=_0x5a727b[_0xc207('0x1b')];this['ContactId']=_0x5a727b[_0xc207('0x1c')];this[_0xc207('0x1d')]=_0x5a727b[_0xc207('0x1d')];this[_0xc207('0x1e')]=_0x5a727b[_0xc207('0x1e')];this[_0xc207('0x1f')]=_0x5a727b[_0xc207('0x1f')];this[_0xc207('0x20')]=_0x5a727b[_0xc207('0x20')];this[_0xc207('0x21')]=_0x5a727b[_0xc207('0x21')]||'';this[_0xc207('0x22')]=_0x5a727b[_0xc207('0x22')]||'';}module[_0xc207('0x23')]=Final; \ No newline at end of file +var _0x2caf=['campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','seconds','uniqueid','scheduledat'];(function(_0x293c0d,_0x34b459){var _0x24e22e=function(_0x6eb8c6){while(--_0x6eb8c6){_0x293c0d['push'](_0x293c0d['shift']());}};_0x24e22e(++_0x34b459);}(_0x2caf,0x6a));var _0xf2ca=function(_0x293870,_0x3b4d2d){_0x293870=_0x293870-0x0;var _0x2e6a4d=_0x2caf[_0x293870];return _0x2e6a4d;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x22932c,_0x53a64f){var _0x3b2612=moment(_0x22932c)[_0xf2ca('0x0')](0x0);var _0x43b96c=moment(_0x53a64f)[_0xf2ca('0x0')](0x0);return _0x3b2612[_0xf2ca('0x1')](_0x43b96c,_0xf2ca('0x2'));}function Final(_0x1a56cd){this['uniqueid']=_0x1a56cd[_0xf2ca('0x3')];this[_0xf2ca('0x4')]=_0x1a56cd[_0xf2ca('0x4')];this['type']=_0x1a56cd['type'];this[_0xf2ca('0x5')]=_0x1a56cd[_0xf2ca('0x6')]===_0xf2ca('0x7')?_0xf2ca('0x8'):_0x1a56cd[_0xf2ca('0x6')];this['countbusyretry']=_0x1a56cd[_0xf2ca('0x9')];this[_0xf2ca('0xa')]=_0x1a56cd[_0xf2ca('0xa')];this[_0xf2ca('0xb')]=_0x1a56cd[_0xf2ca('0xb')];this[_0xf2ca('0xc')]=_0x1a56cd['countbusyretry']+_0x1a56cd[_0xf2ca('0xa')]+_0x1a56cd[_0xf2ca('0xb')]+_0x1a56cd['countnosuchnumberretry']+_0x1a56cd[_0xf2ca('0xd')]+_0x1a56cd[_0xf2ca('0xe')]+_0x1a56cd['countmachineretry']+_0x1a56cd['countagentrejectretry'];this[_0xf2ca('0xf')]=_0x1a56cd['countnosuchnumberretry'];this[_0xf2ca('0xd')]=_0x1a56cd[_0xf2ca('0xd')];this[_0xf2ca('0xe')]=_0x1a56cd[_0xf2ca('0xe')];this[_0xf2ca('0x10')]=_0x1a56cd[_0xf2ca('0x10')];this[_0xf2ca('0x11')]=_0x1a56cd['countagentrejectretry'];this[_0xf2ca('0x8')]=_0x1a56cd['queue'];this[_0xf2ca('0x12')]=_0x1a56cd['calleridname'];this[_0xf2ca('0x13')]=_0x1a56cd[_0xf2ca('0x13')];this['starttime']=_0x1a56cd[_0xf2ca('0x14')];this[_0xf2ca('0x15')]=_0x1a56cd[_0xf2ca('0x15')];this[_0xf2ca('0x16')]=_0x1a56cd[_0xf2ca('0x15')];this[_0xf2ca('0x17')]=_0x1a56cd[_0xf2ca('0x17')]||0x0;this[_0xf2ca('0x18')]=_0x1a56cd[_0xf2ca('0x18')]||0x0;this[_0xf2ca('0x19')]=_0x1a56cd[_0xf2ca('0x19')]||0x0;this['callback']=_0x1a56cd[_0xf2ca('0x1a')];this[_0xf2ca('0x1b')]=_0x1a56cd[_0xf2ca('0x1b')];this[_0xf2ca('0x1c')]=_0x1a56cd[_0xf2ca('0x1c')];this[_0xf2ca('0x1d')]=_0x1a56cd[_0xf2ca('0x1d')];this[_0xf2ca('0x1e')]=_0x1a56cd['ContactId'];this[_0xf2ca('0x1f')]=_0x1a56cd[_0xf2ca('0x1f')];this['UserId']=_0x1a56cd[_0xf2ca('0x20')];this[_0xf2ca('0x21')]=_0x1a56cd[_0xf2ca('0x21')];this['CampaignId']=_0x1a56cd['CampaignId'];this[_0xf2ca('0x22')]=_0x1a56cd[_0xf2ca('0x22')]||'';this[_0xf2ca('0x23')]=_0x1a56cd[_0xf2ca('0x23')]||'';}module[_0xf2ca('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index cb3b0d5..14a6623 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 _0x3591=['name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','queue','membername','IVR','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid'];(function(_0x5aea23,_0x5f003){var _0x1dd080=function(_0x1913dc){while(--_0x1913dc){_0x5aea23['push'](_0x5aea23['shift']());}};_0x1dd080(++_0x5f003);}(_0x3591,0x1cd));var _0x1359=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x3591[_0x50aa2e];return _0x5e07f0;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x1e4b96,_0x4ed7b5){var _0x2ba0c5=moment(_0x1e4b96)[_0x1359('0x0')](0x0);var _0x18e814=moment(_0x4ed7b5)[_0x1359('0x0')](0x0);return _0x2ba0c5[_0x1359('0x1')](_0x18e814,_0x1359('0x2'));}function Hangup(_0x51e917,_0x3fa7ba){this['state']=0x4;this[_0x1359('0x3')]=_0x1359('0x4');this[_0x1359('0x5')]=_0x51e917[_0x1359('0x5')];this['type']=_0x51e917[_0x1359('0x6')];this[_0x1359('0x7')]=_0x51e917[_0x1359('0x6')]===_0x1359('0x8')?'queue':_0x51e917[_0x1359('0x6')];this['countbusyretry']=_0x51e917[_0x1359('0x9')];this[_0x1359('0xa')]=_0x51e917[_0x1359('0xa')];this['countnoanswerretry']=_0x51e917['countnoanswerretry'];this[_0x1359('0xb')]=_0x51e917['countbusyretry']+_0x51e917[_0x1359('0xa')]+_0x51e917[_0x1359('0xc')]+_0x51e917['countnosuchnumberretry']+_0x51e917[_0x1359('0xd')]+_0x51e917[_0x1359('0xe')]+_0x51e917[_0x1359('0xf')]+_0x51e917[_0x1359('0x10')];this[_0x1359('0x11')]=_0x51e917[_0x1359('0x11')];this[_0x1359('0xd')]=_0x51e917[_0x1359('0xd')];this[_0x1359('0xe')]=_0x51e917[_0x1359('0xe')];this[_0x1359('0xf')]=_0x51e917[_0x1359('0xf')];this['countagentrejectretry']=_0x51e917[_0x1359('0x10')];this[_0x1359('0x12')]=_0x3fa7ba['uniqueid'];this['calleridname']=_0x51e917[_0x1359('0x13')];this[_0x1359('0x14')]=_0x51e917[_0x1359('0x15')];this[_0x1359('0x16')]=_0x51e917['starttime'];this['responsetime']=_0x51e917[_0x1359('0x17')];this[_0x1359('0x18')]=moment()[_0x1359('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1359('0x1a')]=getSeconds(_0x51e917[_0x1359('0x17')],_0x51e917[_0x1359('0x16')]);this['holdtime']=0x0;this['talktime']=getSeconds(this[_0x1359('0x18')],_0x51e917[_0x1359('0x17')]);this[_0x1359('0x1b')]=_0x51e917[_0x1359('0x1b')];this[_0x1359('0x1c')]=_0x1359('0x1d');this[_0x1359('0x1e')]=_0x3fa7ba['cause-txt'];this[_0x1359('0x1f')]=_0x51e917[_0x1359('0x1f')];this[_0x1359('0x20')]=_0x51e917[_0x1359('0x20')];this['callbackat']=_0x51e917['callbackat'];this[_0x1359('0x21')]=_0x51e917['recallme'];this[_0x1359('0x22')]=_0x51e917[_0x1359('0x22')];this[_0x1359('0x23')]=_0x51e917[_0x1359('0x23')];this[_0x1359('0x24')]=_0x51e917[_0x1359('0x24')];this['VoiceQueueId']=_0x51e917[_0x1359('0x25')];this['CampaignId']=_0x51e917[_0x1359('0x26')];}module[_0x1359('0x27')]=Hangup; \ No newline at end of file +var _0xfa41=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry'];(function(_0x4782ba,_0x2d1cfa){var _0x443f1d=function(_0x3b42bf){while(--_0x3b42bf){_0x4782ba['push'](_0x4782ba['shift']());}};_0x443f1d(++_0x2d1cfa);}(_0xfa41,0x100));var _0x1fa4=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xfa41[_0xae7c2f];return _0x5d7001;};'use strict';var util=require(_0x1fa4('0x0'));var _=require(_0x1fa4('0x1'));var moment=require('moment');function getSeconds(_0x290c86,_0x5d25d8){var _0x2c947d=moment(_0x290c86)[_0x1fa4('0x2')](0x0);var _0x43d82f=moment(_0x5d25d8)[_0x1fa4('0x2')](0x0);return _0x2c947d[_0x1fa4('0x3')](_0x43d82f,_0x1fa4('0x4'));}function Hangup(_0x43cff2,_0x552423){this[_0x1fa4('0x5')]=0x4;this[_0x1fa4('0x6')]=_0x1fa4('0x7');this[_0x1fa4('0x8')]=_0x43cff2[_0x1fa4('0x8')];this[_0x1fa4('0x9')]=_0x43cff2[_0x1fa4('0x9')];this[_0x1fa4('0xa')]=_0x43cff2[_0x1fa4('0x9')]==='outbound'?_0x1fa4('0xb'):_0x43cff2[_0x1fa4('0x9')];this[_0x1fa4('0xc')]=_0x43cff2['countbusyretry'];this[_0x1fa4('0xd')]=_0x43cff2[_0x1fa4('0xd')];this['countnoanswerretry']=_0x43cff2[_0x1fa4('0xe')];this[_0x1fa4('0xf')]=_0x43cff2[_0x1fa4('0xc')]+_0x43cff2[_0x1fa4('0xd')]+_0x43cff2['countnoanswerretry']+_0x43cff2[_0x1fa4('0x10')]+_0x43cff2[_0x1fa4('0x11')]+_0x43cff2['countabandonedretry']+_0x43cff2[_0x1fa4('0x12')]+_0x43cff2[_0x1fa4('0x13')];this[_0x1fa4('0x10')]=_0x43cff2[_0x1fa4('0x10')];this['countdropretry']=_0x43cff2[_0x1fa4('0x11')];this['countabandonedretry']=_0x43cff2[_0x1fa4('0x14')];this[_0x1fa4('0x12')]=_0x43cff2['countmachineretry'];this[_0x1fa4('0x13')]=_0x43cff2[_0x1fa4('0x13')];this['uniqueid']=_0x552423[_0x1fa4('0x15')];this[_0x1fa4('0x16')]=_0x43cff2[_0x1fa4('0x17')];this[_0x1fa4('0x18')]=_0x43cff2[_0x1fa4('0x19')];this[_0x1fa4('0x1a')]=_0x43cff2[_0x1fa4('0x1a')];this[_0x1fa4('0x1b')]=_0x43cff2[_0x1fa4('0x1b')];this[_0x1fa4('0x1c')]=moment()['format'](_0x1fa4('0x1d'));this[_0x1fa4('0x1e')]=getSeconds(_0x43cff2[_0x1fa4('0x1b')],_0x43cff2[_0x1fa4('0x1a')]);this[_0x1fa4('0x1f')]=0x0;this[_0x1fa4('0x20')]=getSeconds(this['endtime'],_0x43cff2[_0x1fa4('0x1b')]);this[_0x1fa4('0xb')]=_0x43cff2['queue'];this[_0x1fa4('0x21')]=_0x1fa4('0x22');this[_0x1fa4('0x23')]=_0x552423[_0x1fa4('0x24')];this['callback']=_0x43cff2[_0x1fa4('0x25')];this[_0x1fa4('0x26')]=_0x43cff2[_0x1fa4('0x26')];this[_0x1fa4('0x27')]=_0x43cff2['callbackat'];this[_0x1fa4('0x28')]=_0x43cff2[_0x1fa4('0x28')];this['ContactId']=_0x43cff2[_0x1fa4('0x29')];this[_0x1fa4('0x2a')]=_0x43cff2['ListId'];this[_0x1fa4('0x2b')]=_0x43cff2[_0x1fa4('0x2b')];this['VoiceQueueId']=_0x43cff2['VoiceQueueId'];this[_0x1fa4('0x2c')]=_0x43cff2[_0x1fa4('0x2c')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 5b907aa..95550d8 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 _0xf41d=['util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname'];(function(_0x2d7daa,_0x3698e0){var _0x119a17=function(_0x4f717a){while(--_0x4f717a){_0x2d7daa['push'](_0x2d7daa['shift']());}};_0x119a17(++_0x3698e0);}(_0xf41d,0x78));var _0xdf41=function(_0xe51e93,_0x232c25){_0xe51e93=_0xe51e93-0x0;var _0x59f47c=_0xf41d[_0xe51e93];return _0x59f47c;};'use strict';var util=require(_0xdf41('0x0'));var _=require(_0xdf41('0x1'));var moment=require(_0xdf41('0x2'));function getSeconds(_0x4fc8cd,_0x23afe6){var _0x228379=moment(_0x4fc8cd)['milliseconds'](0x0);var _0x2cc4d1=moment(_0x23afe6)[_0xdf41('0x3')](0x0);return _0x228379[_0xdf41('0x4')](_0x2cc4d1,_0xdf41('0x5'));}function History(_0x224c03){this[_0xdf41('0x6')]=_0x224c03[_0xdf41('0x6')];this[_0xdf41('0x7')]=_0x224c03['scheduledat']||undefined;this[_0xdf41('0x8')]=_0x224c03[_0xdf41('0x8')];this[_0xdf41('0x9')]=_0x224c03[_0xdf41('0x8')]===_0xdf41('0xa')?'queue':_0x224c03[_0xdf41('0x8')];this[_0xdf41('0xb')]=_0x224c03[_0xdf41('0xb')];this[_0xdf41('0xc')]=_0x224c03[_0xdf41('0xc')];this[_0xdf41('0xd')]=_0x224c03[_0xdf41('0xd')];this[_0xdf41('0xe')]=_0x224c03[_0xdf41('0xb')]+_0x224c03[_0xdf41('0xc')]+_0x224c03[_0xdf41('0xd')]+_0x224c03['countnosuchnumberretry']+_0x224c03[_0xdf41('0xf')]+_0x224c03[_0xdf41('0x10')]+_0x224c03[_0xdf41('0x11')]+_0x224c03['countagentrejectretry'];this[_0xdf41('0x12')]=_0x224c03[_0xdf41('0x12')];this[_0xdf41('0xf')]=_0x224c03['countdropretry'];this[_0xdf41('0x10')]=_0x224c03[_0xdf41('0x10')];this['countmachineretry']=_0x224c03[_0xdf41('0x11')];this['countagentrejectretry']=_0x224c03[_0xdf41('0x13')];this[_0xdf41('0x14')]=_0x224c03[_0xdf41('0x14')];this[_0xdf41('0x15')]=_0x224c03[_0xdf41('0x16')];this[_0xdf41('0x17')]=_0x224c03[_0xdf41('0x18')];this['starttime']=_0x224c03[_0xdf41('0x19')];this[_0xdf41('0x1a')]=_0x224c03[_0xdf41('0x1a')];this[_0xdf41('0x1b')]=_0x224c03['responsetime'];this[_0xdf41('0x1c')]=getSeconds(_0x224c03[_0xdf41('0x1a')],_0x224c03[_0xdf41('0x19')]);this['holdtime']=0x0;this[_0xdf41('0x1d')]=0x0;this[_0xdf41('0x1e')]=_0x224c03[_0xdf41('0x1e')];this[_0xdf41('0x1f')]=_0x224c03[_0xdf41('0x1f')];this[_0xdf41('0x20')]=_0x224c03[_0xdf41('0x20')];this[_0xdf41('0x21')]=_0x224c03['recallme'];this[_0xdf41('0x22')]=_0x224c03[_0xdf41('0x22')];this[_0xdf41('0x23')]=_0x224c03[_0xdf41('0x23')];this[_0xdf41('0x24')]=_0x224c03['UserId'];this['VoiceQueueId']=_0x224c03[_0xdf41('0x25')];this['CampaignId']=_0x224c03['CampaignId'];this[_0xdf41('0x26')]=_0x224c03[_0xdf41('0x26')]||'';this[_0xdf41('0x27')]=_0x224c03['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file +var _0xc8ce=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x4126a1,_0x32682a){var _0x1e893b=function(_0x419446){while(--_0x419446){_0x4126a1['push'](_0x4126a1['shift']());}};_0x1e893b(++_0x32682a);}(_0xc8ce,0x176));var _0xec8c=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xc8ce[_0x257642];return _0x3d813b;};'use strict';var util=require(_0xec8c('0x0'));var _=require('lodash');var moment=require(_0xec8c('0x1'));function getSeconds(_0x1b9390,_0x4b48b6){var _0x11e917=moment(_0x1b9390)[_0xec8c('0x2')](0x0);var _0x27e309=moment(_0x4b48b6)['milliseconds'](0x0);return _0x11e917[_0xec8c('0x3')](_0x27e309,_0xec8c('0x4'));}function History(_0x2c0db0){this[_0xec8c('0x5')]=_0x2c0db0['uniqueid'];this['scheduledat']=_0x2c0db0[_0xec8c('0x6')]||undefined;this[_0xec8c('0x7')]=_0x2c0db0[_0xec8c('0x7')];this[_0xec8c('0x8')]=_0x2c0db0[_0xec8c('0x7')]===_0xec8c('0x9')?_0xec8c('0xa'):_0x2c0db0[_0xec8c('0x7')];this[_0xec8c('0xb')]=_0x2c0db0[_0xec8c('0xb')];this[_0xec8c('0xc')]=_0x2c0db0[_0xec8c('0xc')];this[_0xec8c('0xd')]=_0x2c0db0[_0xec8c('0xd')];this[_0xec8c('0xe')]=_0x2c0db0[_0xec8c('0xb')]+_0x2c0db0['countcongestionretry']+_0x2c0db0[_0xec8c('0xd')]+_0x2c0db0['countnosuchnumberretry']+_0x2c0db0['countdropretry']+_0x2c0db0[_0xec8c('0xf')]+_0x2c0db0[_0xec8c('0x10')]+_0x2c0db0[_0xec8c('0x11')];this[_0xec8c('0x12')]=_0x2c0db0['countnosuchnumberretry'];this[_0xec8c('0x13')]=_0x2c0db0[_0xec8c('0x13')];this[_0xec8c('0xf')]=_0x2c0db0[_0xec8c('0xf')];this['countmachineretry']=_0x2c0db0['countmachineretry'];this[_0xec8c('0x11')]=_0x2c0db0[_0xec8c('0x11')];this[_0xec8c('0xa')]=_0x2c0db0[_0xec8c('0xa')];this[_0xec8c('0x14')]=_0x2c0db0['name'];this[_0xec8c('0x15')]=_0x2c0db0[_0xec8c('0x16')];this[_0xec8c('0x17')]=_0x2c0db0['starttime'];this[_0xec8c('0x18')]=_0x2c0db0['responsetime'];this[_0xec8c('0x19')]=_0x2c0db0[_0xec8c('0x18')];this[_0xec8c('0x1a')]=getSeconds(_0x2c0db0['responsetime'],_0x2c0db0[_0xec8c('0x17')]);this[_0xec8c('0x1b')]=0x0;this[_0xec8c('0x1c')]=0x0;this[_0xec8c('0x1d')]=_0x2c0db0[_0xec8c('0x1d')];this[_0xec8c('0x1e')]=_0x2c0db0[_0xec8c('0x1e')];this['callbackat']=_0x2c0db0[_0xec8c('0x1f')];this[_0xec8c('0x20')]=_0x2c0db0[_0xec8c('0x20')];this[_0xec8c('0x21')]=_0x2c0db0[_0xec8c('0x21')];this[_0xec8c('0x22')]=_0x2c0db0[_0xec8c('0x22')];this[_0xec8c('0x23')]=_0x2c0db0[_0xec8c('0x23')];this[_0xec8c('0x24')]=_0x2c0db0['VoiceQueueId'];this[_0xec8c('0x25')]=_0x2c0db0[_0xec8c('0x25')];this[_0xec8c('0x26')]=_0x2c0db0[_0xec8c('0x26')]||'';this['originatecalleridname']=_0x2c0db0[_0xec8c('0x27')]||'';}module[_0xec8c('0x28')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index caf58c1..8f343b2 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 _0xdb76=['dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','stringify','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','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','predictiveIntervalDroppedCallsCallersExit','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','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangAbandonmentRate','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','catch','updateOriginated','queue','[Dialer][checkChannel][ivr]','resolve','checkIsBlackList','then','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','unlockContact','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[moveContactManagedDialer]\x20','createHistory','loggerHandler','notFound','saveInDb','merge','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','unmonitored','moveContactManagedDialer','syncVarSet','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','state','HangupInAMD','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','Machine','membername','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','rescheduleContact','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','dialGlobalMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','agent','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','Drop','dropreason','dialQueueProject2','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','calleridname','[syncAgentComplete][createHistory][11]','actionid','locked','stateinterface','strategy','push','paused','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','idHopper','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','iftime\x20%s,%s','interval','content','indexOf','command','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','dialPowerLevel','launchHandleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','responsetime','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countagentrejectretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','handlePower','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','voicePause','preview','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','countReScheduled','[countReScheduled]\x20','Contact.phone','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','[abandonmentRate]','Amax\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','[busyFactor]','p\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','milliseconds','seconds','emit','outbound','answered','loggedIn','pTalking','sumDuration','talking','type','abandoned','loggedInDb'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0xdb76,0x1be));var _0x6db7=function(_0x3054af,_0x1a6737){_0x3054af=_0x3054af-0x0;var _0x47e386=_0xdb76[_0x3054af];return _0x47e386;};'use strict';var util=require(_0x6db7('0x0'));var _=require(_0x6db7('0x1'));var BPromise=require(_0x6db7('0x2'));var uuid=require(_0x6db7('0x3'));var moment=require(_0x6db7('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x6db7('0x5'));var ut=require(_0x6db7('0x6'));var config=require(_0x6db7('0x7'));var logger=require(_0x6db7('0x8'))('dialer');var loggerBooked=require(_0x6db7('0x8'))(_0x6db7('0x9'));var loggerPredictive=require(_0x6db7('0x8'))(_0x6db7('0xa'));var loggerPredictiveCalls=require(_0x6db7('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x6db7('0x8'))(_0x6db7('0xb'));var ami=require('../ami');config[_0x6db7('0xc')]=_[_0x6db7('0xd')](config[_0x6db7('0xc')],{'host':_0x6db7('0xe'),'port':0x18eb});var io=require(_0x6db7('0xf'))(new Redis(config[_0x6db7('0xc')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x6db7('0x10'));var voiceQueueRt=require(_0x6db7('0x11'));var Action=require('./action');var History=require(_0x6db7('0x12'));var Final=require(_0x6db7('0x13'));var AgentComplete=require(_0x6db7('0x14'));var QueueCallerAbandon=require(_0x6db7('0x15'));var Hangup=require(_0x6db7('0x16'));var ipAgi=process[_0x6db7('0x17')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0x6db7('0x18'),'roundrobin':_0x6db7('0x19')};var Sequence=function(){};Sequence[_0x6db7('0x1a')][_0x6db7('0x1b')]=function(_0x9f999){this[_0x6db7('0x1c')]=this[_0x6db7('0x1c')]?this[_0x6db7('0x1c')][_0x6db7('0x1d')](_0x9f999):_0x9f999();};function Dialer(_0x3e4a49,_0x25df35){this[_0x6db7('0x1e')]=new Sequence();this['preview']=_0x25df35;this[_0x6db7('0x1f')]=_0x3e4a49[_0x6db7('0x1f')];this[_0x6db7('0x20')]=_0x3e4a49[_0x6db7('0x20')];this[_0x6db7('0x21')]=_0x3e4a49[_0x6db7('0x21')];this[_0x6db7('0x22')]=_0x3e4a49[_0x6db7('0x22')];this[_0x6db7('0x23')]=config[_0x6db7('0x23')]||0x2;this[_0x6db7('0x24')]={};this[_0x6db7('0x25')]={};this['contactsId']={};this[_0x6db7('0x26')]={};this[_0x6db7('0x27')]={};this[_0x6db7('0x28')]={};this[_0x6db7('0x29')]={};this[_0x6db7('0x2a')]={};this[_0x6db7('0x2b')]={};this['queueBookedRR']={};ami['on'](_0x6db7('0x2c'),this[_0x6db7('0x2d')]['bind'](this));ami['on'](_0x6db7('0x2e'),this[_0x6db7('0x2f')][_0x6db7('0x30')](this));ami['on']('originateresponse',this[_0x6db7('0x31')][_0x6db7('0x30')](this));ami['on']('agentcomplete',this[_0x6db7('0x32')][_0x6db7('0x30')](this));ami['on'](_0x6db7('0x33'),this['syncQueueSummary']['bind'](this));ami['on'](_0x6db7('0x34'),this[_0x6db7('0x35')][_0x6db7('0x30')](this));ami['on']('newexten',this[_0x6db7('0x36')][_0x6db7('0x30')](this));ami['on']('varset',this['syncVarSet'][_0x6db7('0x30')](this));ami['on'](_0x6db7('0x37'),this[_0x6db7('0x38')][_0x6db7('0x30')](this));ami['on'](_0x6db7('0x39'),this[_0x6db7('0x3a')]['bind'](this));this[_0x6db7('0x3b')]();this[_0x6db7('0x3c')]();}function isNotNull(_0x4a619d){return _0x4a619d!==null&&!_[_0x6db7('0x3d')](_0x4a619d);}function checkIsLoggedIn(_0x4f068e,_0xbff04f){return function(){if(_0xbff04f<=0x0){_0x4f068e[_0x6db7('0x3e')]=_0x6db7('0x3f');throw _0x4f068e[_0x6db7('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0xb4bf2b){return _0xb4bf2b;}function checkIsActive(_0x285adc,_0x236c63){return function(){if(!isActive(_0x236c63)){_0x285adc[_0x6db7('0x3e')]=_0x6db7('0x41');throw _0x285adc['name']+_0x6db7('0x42');}};}function checkInterval(_0x27c3fb){return function(){if(!isNotNull(_0x27c3fb[_0x6db7('0x43')])){_0x27c3fb['message']=_0x6db7('0x44');throw _0x27c3fb[_0x6db7('0x40')]+_0x6db7('0x45');}if(!isNotNull(_0x27c3fb['Interval'][_0x6db7('0x46')])){_0x27c3fb['message']=_0x6db7('0x44');throw _0x27c3fb['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x6db7('0x47')](_0x27c3fb[_0x6db7('0x43')][_0x6db7('0x46')]))){_0x27c3fb[_0x6db7('0x3e')]='INTERVAL_IS_NULL';throw _0x27c3fb['name']+_0x6db7('0x45');}};}function msgResponse(_0x459051,_0x58d60d,_0x3ad4d6){return{'action':_0x459051,'response':_0x58d60d,'message':_0x3ad4d6,'stack':_0x3ad4d6};}function myreject(_0x5ea735){return function(_0x11f618){return _0x5ea735(msgResponse('[ifTime][Action]',_0x6db7('0x48'),JSON['stringify'](_0x11f618)));};}function getSeconds(_0x478950,_0x73daca){var _0x7448da=moment(_0x478950)[_0x6db7('0x49')](0x0);var _0x20b875=moment(_0x73daca)[_0x6db7('0x49')](0x0);return _0x7448da['diff'](_0x20b875,_0x6db7('0x4a'));}function emit(_0x1ff3c9,_0x25483d,_0x8dc3ba){io['to'](_0x1ff3c9)[_0x6db7('0x4b')](_0x25483d,_0x8dc3ba);}function emitVoiceQueueSummary(_0x4ff457){if(_0x4ff457['type']===_0x6db7('0x4c')){var _0x465ac7={'id':_0x4ff457['id'],'name':_0x4ff457[_0x6db7('0x40')],'strategy':_0x4ff457['strategy'],'answered':_0x4ff457[_0x6db7('0x4d')],'available':_0x4ff457['available'],'loggedIn':_0x4ff457[_0x6db7('0x4e')],'pTalking':_0x4ff457[_0x6db7('0x4f')],'sumBillable':_0x4ff457['sumBillable'],'sumDuration':_0x4ff457[_0x6db7('0x50')],'sumHoldTime':_0x4ff457['sumHoldTime']||0x0,'talking':_0x4ff457[_0x6db7('0x51')],'total':_0x4ff457['total'],'type':_0x4ff457[_0x6db7('0x52')],'unmanaged':_0x4ff457['unmanaged'],'abandoned':_0x4ff457[_0x6db7('0x53')],'waiting':_0x4ff457['waiting'],'loggedInDb':_0x4ff457[_0x6db7('0x54')],'dialActive':_0x4ff457['dialActive'],'dialMethod':_0x4ff457[_0x6db7('0x55')],'dialOriginateCallerIdName':_0x4ff457[_0x6db7('0x56')],'dialOriginateCallerIdNumber':_0x4ff457[_0x6db7('0x57')],'dialOriginateTimeout':_0x4ff457['dialOriginateTimeout'],'dialPrefix':_0x4ff457[_0x6db7('0x58')],'outboundAnswerAgiCallsDay':_0x4ff457[_0x6db7('0x59')],'outboundAnswerCallsDay':_0x4ff457[_0x6db7('0x5a')],'outboundBlacklistCallsDay':_0x4ff457['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x4ff457[_0x6db7('0x5b')],'outboundCongestionCallsDay':_0x4ff457[_0x6db7('0x5c')],'outboundDropCallsDayACS':_0x4ff457[_0x6db7('0x5d')],'outboundDropCallsDayCallersExit':_0x4ff457[_0x6db7('0x5e')],'outboundDropCallsDayTimeout':_0x4ff457[_0x6db7('0x5f')],'outboundNoAnswerCallsDay':_0x4ff457[_0x6db7('0x60')],'outboundNoSuchCallsDay':_0x4ff457['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x4ff457[_0x6db7('0x61')],'outboundReCallsDay':_0x4ff457[_0x6db7('0x62')],'outboundRejectCallsDay':_0x4ff457['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4ff457['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x4ff457[_0x6db7('0x63')],'predictiveIntervalAvgHoldtime':_0x4ff457[_0x6db7('0x64')],'predictiveIntervalAvgTalktime':_0x4ff457[_0x6db7('0x65')],'predictiveIntervalDroppedCallsCallersExit':_0x4ff457['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4ff457[_0x6db7('0x66')],'predictiveIntervalErlangCalls':_0x4ff457[_0x6db7('0x67')],'predictiveIntervalErlangCallsDroppedCalls':_0x4ff457[_0x6db7('0x68')],'predictiveIntervalHitRate':_0x4ff457[_0x6db7('0x69')],'predictiveIntervalMultiplicativeFactor':_0x4ff457[_0x6db7('0x6a')],'predictiveIntervalPauses':_0x4ff457['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4ff457[_0x6db7('0x6b')],'predictiveIntervalTotalCalls':_0x4ff457[_0x6db7('0x6c')],'message':_0x4ff457[_0x6db7('0x3e')],'originated':_0x4ff457['originated'],'erlangCalls':_0x4ff457['erlangCalls'],'erlangCallToSecond':_0x4ff457[_0x6db7('0x6d')],'erlangAbandonmentRate':_0x4ff457['erlangAbandonmentRate'],'erlangBusyFactor':_0x4ff457[_0x6db7('0x6e')],'startPredictive':_0x4ff457[_0x6db7('0x28')],'startProgressive':_0x4ff457['startProgressive']};if(_0x4ff457['Trunk']){_0x465ac7[_0x6db7('0x6f')]={'id':_0x4ff457[_0x6db7('0x6f')]['id'],'name':_0x4ff457[_0x6db7('0x6f')][_0x6db7('0x40')],'active':_0x4ff457[_0x6db7('0x6f')][_0x6db7('0x70')],'callerid':_0x4ff457[_0x6db7('0x6f')][_0x6db7('0x71')]};}if(_0x4ff457['Interval']){_0x465ac7[_0x6db7('0x43')]={'id':_0x4ff457[_0x6db7('0x43')]['id'],'name':_0x4ff457[_0x6db7('0x43')]['name']};}var _0x48b8a7=md5(JSON[_0x6db7('0x72')](_0x465ac7));if(_0x4ff457[_0x6db7('0x73')]!==_0x48b8a7){_0x4ff457[_0x6db7('0x73')]=_0x48b8a7;emit(util[_0x6db7('0x74')](_0x6db7('0x75'),_0x465ac7[_0x6db7('0x40')]),_0x6db7('0x76'),_0x465ac7);}}}function emitCampaignSummary(_0x482c9b){if(_0x482c9b[_0x6db7('0x52')]===_0x6db7('0x77')){emit(util[_0x6db7('0x74')](_0x6db7('0x78'),_0x482c9b['name']),_0x6db7('0x79'),_0x482c9b);}}function checkGetDataPredictive(_0x189504){if(isNotNull(_0x189504)&&!_[_0x6db7('0x47')](_0x189504)){loggerPredictive[_0x6db7('0x7a')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x7b'),_0x189504['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0x6db7('0x7c'),_0x189504['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x6db7('0x7a')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x189504[_0x6db7('0x66')]);loggerPredictive[_0x6db7('0x7a')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x189504[_0x6db7('0x7d')]);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x7e'),_0x189504[_0x6db7('0x64')]);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x7f'),_0x189504['predictiveIntervalAvgTalktime']);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x80'));if(_0x189504[_0x6db7('0x6c')]>0x0){if(!_[_0x6db7('0x3d')](_0x189504[_0x6db7('0x65')])&&_0x189504['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x81'));if(!_[_0x6db7('0x3d')](_0x189504[_0x6db7('0x64')])&&_0x189504[_0x6db7('0x64')]>0x0){return!![];}loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x82'));}else{loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x83'));}}else{loggerPredictive[_0x6db7('0x7a')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x588855){return function(_0xd9f098){loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x84'));loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x85'),_0xd9f098[_0x6db7('0x86')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd9f098[_0x6db7('0x6d')]);loggerPredictive[_0x6db7('0x7a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd9f098[_0x6db7('0x87')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd9f098[_0x6db7('0x6e')]);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x88'),_0xd9f098[_0x6db7('0x87')]);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x80'));_['merge'](_0x588855,_0xd9f098);};}function getDiff(_0x1e7a92){var _0xacbd2f=moment()[_0x6db7('0x49')](0x0);var _0x363374=moment(_0x1e7a92)[_0x6db7('0x49')](0x0);return _0xacbd2f['diff'](_0x363374,_0x6db7('0x4a'));}function ifInterval(_0x4ad9ff,_0x336c7f){if(_[_0x6db7('0x3d')](_0x336c7f)){return![];}return getDiff(_0x336c7f)<_0x4ad9ff*0x3c;}function freeVariablesPredictive(_0x36e538){if(isNotNull(_0x36e538)){if(!_[_0x6db7('0x3d')](_0x36e538[_0x6db7('0x29')])){_0x36e538['startProgressive']=undefined;loggerPredictive[_0x6db7('0x7a')](_0x36e538['name'],_0x6db7('0x89'));}if(!_[_0x6db7('0x3d')](_0x36e538[_0x6db7('0x28')])){_0x36e538[_0x6db7('0x28')]=undefined;loggerPredictive[_0x6db7('0x7a')](_0x36e538['name'],_0x6db7('0x8a'));}if(!_[_0x6db7('0x3d')](_0x36e538[_0x6db7('0x8b')])){clearInterval(_0x36e538[_0x6db7('0x8b')]);_0x36e538['handlePredictive']=undefined;loggerPredictive[_0x6db7('0x7a')](_0x36e538[_0x6db7('0x40')],_0x6db7('0x8c'));}}}function erlangb(_0x1c6f44,_0x20cd5a){if(_0x20cd5a===0x0){return 0x0;}var _0x43c55c=0x1;for(var _0x3f7297=0x1;_0x3f7297<=_0x20cd5a;_0x3f7297+=0x1){_0x43c55c=0x1+_0x43c55c*_0x3f7297/_0x1c6f44;}return 0x1/_0x43c55c;}function isVoiceQueueOutbound(_0x7440f7){return _0x7440f7===_0x6db7('0x4c');}function isNotPreview(_0x3275cf){return _0x3275cf!=='preview';}function isCampaignIvr(_0x45124b){return _0x45124b===_0x6db7('0x77');}function getCallerId(_0x162418,_0x18ad95,_0x42cc0b){if(!_['isUndefined'](_0x42cc0b)&&typeof _0x42cc0b===_0x6db7('0x8d')&&!_[_0x6db7('0x47')](_0x42cc0b)){if(!_[_0x6db7('0x3d')](_0x18ad95)&&typeof _0x18ad95===_0x6db7('0x8d')&&!_['isEmpty'](_0x18ad95)){return util[_0x6db7('0x74')](_0x6db7('0x8e'),_0x18ad95,_0x42cc0b);}return util[_0x6db7('0x74')](_0x6db7('0x8e'),_0x42cc0b,_0x42cc0b);}if(!_['isUndefined'](_0x162418)&&typeof _0x162418===_0x6db7('0x8d')&&!_[_0x6db7('0x47')](_0x162418)){return _0x162418;}return _0x6db7('0x8f');}function loggerCatchQueueSummary(_0x3f7eb0,_0x1e813c){return function(_0x2db728){freeVariablesPredictive(_0x1e813c);emitVoiceQueueSummary(_0x1e813c);emitCampaignSummary(_0x1e813c);loggerSyncQueueSummary[_0x6db7('0x90')](_0x3f7eb0,util[_0x6db7('0x91')](_0x2db728,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x379c58,_0x41c665){return function(_0x4c5755){loggerPredictive[_0x6db7('0x90')](_0x41c665[_0x6db7('0x40')],_0x379c58);loggerPredictive[_0x6db7('0x90')](_0x4c5755[_0x6db7('0x92')]);freeVariablesPredictive(_0x41c665);};}function loggerCatch(_0x11eec4){return function(_0x44f5e0){logger['error'](_0x11eec4,util[_0x6db7('0x91')](_0x44f5e0,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x34f4eb){return _0x34f4eb&&!_[_0x6db7('0x3d')](_0x34f4eb)&&_0x34f4eb[_0x6db7('0x93')]>0x0;}function decremetOriginate(_0x1e2cc7){if(!_[_0x6db7('0x3d')](_0x1e2cc7)&&_0x1e2cc7!==null){if(typeof _0x1e2cc7[_0x6db7('0x94')]!==_0x6db7('0x95')){if(_0x1e2cc7['originated']>0x0){_0x1e2cc7[_0x6db7('0x94')]-=0x1;}else{logger[_0x6db7('0x90')](_0x6db7('0x96'));}}}else{logger[_0x6db7('0x90')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x3d6cd2,_0x3b3b02,_0x12f4a1){if(_0x3b3b02>_0x12f4a1){for(var _0x389db0=0x0;_0x389db0<_0x3b3b02-_0x12f4a1;_0x389db0+=0x1){decremetOriginate(_0x3d6cd2);}}}function loggerGetContactDialer(_0x14de39,_0xb650b8,_0x12904a){return function(_0x91832d){checkContactLowerLimitOriginate(_0xb650b8,_0x12904a,0x0);logger[_0x6db7('0x90')](_0x14de39,util['inspect'](_0x91832d,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x303246){return function(_0xc0dc1a){if(isNotNull(_0xc0dc1a)&&isNotNull(_0xc0dc1a[0x0])){if(_0xc0dc1a[0x0][_0x6db7('0x97')]>0x0){_0x303246[_0x6db7('0x3e')]=_0x6db7('0x98');logger[_0x6db7('0x7a')]('[getContactDialer2][ReScheduled]'+_0x303246[_0x6db7('0x40')],_0xc0dc1a[0x0][_0x6db7('0x97')],'contacts');}else{_0x303246[_0x6db7('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x6db7('0x99')+_0x303246['name']);}}};}function notSendMessagesQueue(_0x1b2cad){if(_0x1b2cad[_0x6db7('0x9a')]){freeVariablesPredictive(_0x1b2cad);if(_0x1b2cad[_0x6db7('0x94')]===0x0&&_0x1b2cad[_0x6db7('0x51')]===0x0&&_0x1b2cad['waiting']===0x0&&(_0x1b2cad[_0x6db7('0x4f')]||0x0)===0x0){_0x1b2cad[_0x6db7('0x9a')]=![];_0x1b2cad[_0x6db7('0x9b')]=0x0;_0x1b2cad[_0x6db7('0x3e')]=_0x6db7('0x41');loggerSyncQueueSummary[_0x6db7('0x90')](_0x6db7('0x9c'),_0x1b2cad[_0x6db7('0x40')],_0x6db7('0x9d'));}else{_0x1b2cad[_0x6db7('0x3e')]=_0x6db7('0x9e');loggerSyncQueueSummary[_0x6db7('0x90')](_0x6db7('0x9c'),_0x1b2cad[_0x6db7('0x40')],_0x6db7('0x9f'));}emitVoiceQueueSummary(_0x1b2cad);}}function notSendMessagesCampaign(_0xba8d65){if(_0xba8d65['sendMessageOneNotActive']){if(_0xba8d65['originated']===0x0){_0xba8d65[_0x6db7('0x9a')]=![];_0xba8d65[_0x6db7('0x3e')]=_0x6db7('0x41');loggerSyncQueueSummary[_0x6db7('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xba8d65['name'],_0x6db7('0x9d'));}else{_0xba8d65[_0x6db7('0x3e')]=_0x6db7('0x9e');loggerSyncQueueSummary['error'](_0x6db7('0xa0'),_0xba8d65['name'],'is\x20disactive');}emitCampaignSummary(_0xba8d65);}}function createObjHistory(_0xecfa7d,_0x39641f,_0x293954,_0x5a37e6,_0x120f49){_0xecfa7d[_0x6db7('0x3e')]=_0x293954;var _0x299f8f=new Action(_0xecfa7d,_0x39641f);var _0x4c203e=new History(_0x299f8f);_0x4c203e['state']=_0x5a37e6;_0x4c203e[_0x6db7('0xa1')]=_0x120f49;_0x4c203e[_0x6db7('0xa2')]=_0x299f8f[_0x6db7('0xa3')];return _0x4c203e;}Dialer[_0x6db7('0x1a')]['loopClearZombieChannels']=function(){var _0x215426=this;setInterval(function(){_0x215426[_0x6db7('0xa4')](_0x215426[_0x6db7('0x26')],_0x6db7('0xa5'));_0x215426[_0x6db7('0xa4')](_0x215426['actions'],_0x6db7('0xa6'));},0x32c8);};Dialer[_0x6db7('0x1a')][_0x6db7('0xa4')]=function(_0x33716f,_0x2659d5){var _0x1a1bba=this;for(var _0x552cd9 in _0x33716f){if(typeof _0x33716f[_0x552cd9]!==_0x6db7('0x95')){this[_0x6db7('0x1e')][_0x6db7('0x1b')](function(){if(!_[_0x6db7('0xa7')](_0x33716f[_0x552cd9])){return ami[_0x6db7('0xa8')]({'action':_0x6db7('0xa9'),'channel':_0x33716f[_0x552cd9][_0x6db7('0xaa')]})[_0x6db7('0xab')](function(_0xbe1233){if(_0xbe1233['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x33716f[_0x552cd9]&&_0x33716f[_0x552cd9][_0x6db7('0x52')]!==_0x6db7('0x77')){_0x1a1bba[_0x6db7('0xac')](_0x1a1bba[_0x6db7('0x1f')][_0x33716f[_0x552cd9][_0x6db7('0xad')]]);logger[_0x6db7('0x90')]('[Dialer][checkChannel]',_0x2659d5,_0x552cd9,_0x33716f[_0x552cd9]['queue']);delete _0x33716f[_0x552cd9];}if(_0x33716f[_0x552cd9]&&_0x33716f[_0x552cd9][_0x6db7('0x52')]==='ivr'){_0x1a1bba['updateOriginated'](_0x1a1bba[_0x6db7('0x20')][_0x33716f[_0x552cd9][_0x6db7('0xad')]]);logger[_0x6db7('0x90')](_0x6db7('0xae'),_0x2659d5,_0x552cd9,_0x33716f[_0x552cd9][_0x6db7('0xad')]);delete _0x33716f[_0x552cd9];}},0x2328);}});}});}}};Dialer[_0x6db7('0x1a')]['countReScheduled']=function(_0x298cf3){return BPromise[_0x6db7('0xaf')]()['then'](cmHopper['countReScheduled'](_0x298cf3))[_0x6db7('0xab')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x6db7('0xb0')]=function(_0x74c289){return BPromise['resolve']()[_0x6db7('0xb1')](cmHopperBlack['checkIsBlackList'](_0x74c289))[_0x6db7('0xab')](loggerCatch(_0x6db7('0xb2')));};Dialer[_0x6db7('0x1a')]['checkIsBlackListIvr']=function(_0x3806c2){return BPromise[_0x6db7('0xaf')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x3806c2))[_0x6db7('0xab')](loggerCatch(_0x6db7('0xb3')));};Dialer[_0x6db7('0x1a')][_0x6db7('0xb4')]=function(_0xcc4451){return BPromise[_0x6db7('0xaf')]()['then'](cmHopperHistory['avgHandleTime'](_0xcc4451))[_0x6db7('0xab')](loggerCatch(_0x6db7('0xb5')));};Dialer['prototype']['rescheduleContact']=function(_0x2c724a){return BPromise[_0x6db7('0xaf')]()['then'](cmHopper['rescheduleContact'](_0x2c724a))[_0x6db7('0xab')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x6db7('0x1a')][_0x6db7('0xb6')]=function(_0x5f1c4e,_0x126033,_0x45b4e4){return BPromise['resolve']()[_0x6db7('0xb1')](cmHopper['unlockContact'](_0x5f1c4e,_0x126033,_0x45b4e4))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer[_0x6db7('0x1a')][_0x6db7('0xb7')]=function(_0x19ab22,_0x527508,_0x1f5aca,_0x27b16e,_0x3e8af1){return BPromise[_0x6db7('0xaf')]()[_0x6db7('0xb1')](cmHopper[_0x6db7('0xb7')](_0x19ab22,_0x527508,_0x1f5aca,_0x27b16e))['catch'](function(_0x5c678b){_0x3e8af1[_0x6db7('0xb8')]-=_0x1f5aca;_0x3e8af1[_0x6db7('0xb8')]=_0x3e8af1[_0x6db7('0xb8')]>0x0?_0x3e8af1[_0x6db7('0xb8')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x5c678b);});};Dialer['prototype'][_0x6db7('0xb9')]=function(_0x366d96,_0x1ac4f5,_0x39c204,_0x130c90){return BPromise[_0x6db7('0xaf')]()[_0x6db7('0xb1')](cmHopper[_0x6db7('0xb9')](_0x366d96,_0x1ac4f5,_0x39c204))['catch'](function(_0x75b7e7){_0x130c90[_0x6db7('0xb8')]-=_0x1ac4f5;_0x130c90[_0x6db7('0xb8')]=_0x130c90[_0x6db7('0xb8')]>0x0?_0x130c90[_0x6db7('0xb8')]:0x0;loggerCatch(_0x6db7('0xba'))(_0x75b7e7);});};Dialer[_0x6db7('0x1a')][_0x6db7('0xbb')]=function(_0x5b7b83){return BPromise[_0x6db7('0xaf')]()[_0x6db7('0xb1')](voiceQueueRt[_0x6db7('0xbb')](_0x5b7b83))[_0x6db7('0xab')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['moveContactManagedDialer']=function(_0x4451c0){return BPromise[_0x6db7('0xaf')]()[_0x6db7('0xb1')](cmHopper['moveContactManagedDialer'](_0x4451c0))[_0x6db7('0xab')](loggerCatch(_0x6db7('0xbc')));};Dialer[_0x6db7('0x1a')][_0x6db7('0xbd')]=function(_0x5a4a2d){return BPromise[_0x6db7('0xaf')]()[_0x6db7('0xb1')](cmHopperHistory[_0x6db7('0xbd')](_0x5a4a2d))[_0x6db7('0xab')](loggerCatch('[createHistory]\x20'));};Dialer[_0x6db7('0x1a')][_0x6db7('0xac')]=function(_0x5e1c59){if(!_['isUndefined'](_0x5e1c59)&&_0x5e1c59!==null){if(typeof _0x5e1c59[_0x6db7('0x94')]!=='undefined'){if(_0x5e1c59[_0x6db7('0x94')]>0x0){_0x5e1c59[_0x6db7('0x94')]-=0x1;}else{logger[_0x6db7('0x90')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x6db7('0x90')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x6db7('0x1a')][_0x6db7('0xbe')]=function(_0x4de82e,_0x37bc19){var _0x2008a5=this;return function(_0x1bca25){_0x2008a5[_0x6db7('0xac')](_0x37bc19);logger[_0x6db7('0x90')](_0x4de82e,util['inspect'](_0x1bca25,{'showHidden':![],'depth':null}));};};Dialer[_0x6db7('0x1a')]['emptyContact']=function(_0x38d828,_0x25df0b,_0x1a42a1){var _0x3db953={'state':0x19,'statedesc':_0x6db7('0xbf')};this[_0x6db7('0xac')](_0x25df0b);this[_0x6db7('0xc0')](_[_0x6db7('0xc1')](_0x3db953,_[_0x6db7('0xc2')](_0x1a42a1,['ContactId',_0x6db7('0xc3'),_0x6db7('0xc4'),_0x6db7('0xc5'),_0x6db7('0xc6')])),_0x6db7('0xc7'),_0x6db7('0xc8'));logger[_0x6db7('0x90')](_0x38d828);};Dialer[_0x6db7('0x1a')]['isSuccess']=function(_0x124502){return _0x124502===_0x6db7('0xc9');};Dialer[_0x6db7('0x1a')][_0x6db7('0xca')]=function(_0xbfccbc){return!_[_0x6db7('0x3d')](_0xbfccbc)&&_0xbfccbc&&!_[_0x6db7('0x3d')](_0xbfccbc[_0x6db7('0x40')])&&!_['isUndefined'](_0xbfccbc['active'])&&_0xbfccbc[_0x6db7('0x70')]&&(this['trunks'][util[_0x6db7('0x74')](_0x6db7('0xcb'),_0xbfccbc[_0x6db7('0x40')])][_0x6db7('0xa9')]==='reachable'||this[_0x6db7('0x22')][util[_0x6db7('0x74')](_0x6db7('0xcb'),_0xbfccbc[_0x6db7('0x40')])][_0x6db7('0xa9')]===_0x6db7('0xcc'));};Dialer[_0x6db7('0x1a')][_0x6db7('0xc0')]=function(_0x2b2c69,_0x3603a6,_0x24af46){this[_0x6db7('0xbd')](_0x2b2c69)['catch'](loggerCatch(_0x3603a6));this[_0x6db7('0xcd')](_0x2b2c69)[_0x6db7('0xab')](loggerCatch(_0x24af46));};Dialer['prototype'][_0x6db7('0xce')]=function(_0x31996a){var _0x27674c=this['uniqueId'][_0x31996a[_0x6db7('0xcf')]];var _0x2dd33b;if(!_['isNil'](_0x31996a)&&!_['isNil'](_0x31996a[_0x6db7('0xd0')])&&!_[_0x6db7('0xa7')](_0x31996a[_0x6db7('0xd0')]['amdstatus'])&&_0x31996a[_0x6db7('0xd1')]===_0x6db7('0xd2')&&_0x27674c){if(_0x27674c['type']!=='ivr'&&this[_0x6db7('0x1f')][_0x27674c[_0x6db7('0xad')]][_0x6db7('0xd3')]&&_0x31996a[_0x6db7('0xd4')]===_0x6db7('0xd5')){delete this[_0x6db7('0x26')][_0x31996a[_0x6db7('0xcf')]];this[_0x6db7('0xac')](this['voiceQueues'][_0x27674c[_0x6db7('0xad')]]);this[_0x6db7('0x1f')][_0x27674c[_0x6db7('0xad')]][_0x6db7('0x5a')]+=0x1;this[_0x6db7('0x1f')][_0x27674c[_0x6db7('0xad')]][_0x6db7('0x59')]+=0x1;_0x2dd33b=new Hangup(_0x27674c,_0x31996a);_0x2dd33b[_0x6db7('0xd6')]=0x12;_0x2dd33b[_0x6db7('0xa1')]=_0x6db7('0xd7');_0x2dd33b['membername']=_0x6db7('0xd8');ami[_0x6db7('0x4b')](_0x6db7('0xd9'),ut['buildObj'](_0x2dd33b,_0x6db7('0xda')));this[_0x6db7('0xc0')](_0x2dd33b,_0x6db7('0xdb'),'[syncHangupInAMD]');}if(_0x27674c[_0x6db7('0x52')]!==_0x6db7('0x77')&&this['voiceQueues'][_0x27674c['queue']][_0x6db7('0xd3')]&&_0x31996a[_0x6db7('0xd4')]==='MACHINE'){var _0x89c7c5=this;return new BPromise(function(_0x16ac21,_0x1e876e){delete _0x89c7c5[_0x6db7('0x26')][_0x31996a[_0x6db7('0xcf')]];_0x89c7c5[_0x6db7('0xac')](_0x89c7c5[_0x6db7('0x1f')][_0x27674c['queue']]);_0x89c7c5[_0x6db7('0x1f')][_0x27674c[_0x6db7('0xad')]][_0x6db7('0x5a')]+=0x1;_0x89c7c5[_0x6db7('0x1f')][_0x27674c[_0x6db7('0xad')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x153209=_0x89c7c5['voiceQueues'][_0x27674c[_0x6db7('0xad')]];var _0x1170fe=new Hangup(_0x27674c,_0x31996a);_0x1170fe[_0x6db7('0xd6')]=0x13;_0x1170fe[_0x6db7('0xa1')]=_0x6db7('0xdc');_0x1170fe[_0x6db7('0xdd')]=_0x6db7('0xd8');_0x1170fe[_0x6db7('0xde')]+=0x1;_0x1170fe[_0x6db7('0xdf')]+=0x1;_0x1170fe[_0x6db7('0xda')]=!![];ami[_0x6db7('0x4b')](_0x6db7('0xd9'),ut[_0x6db7('0xe0')](_0x1170fe,'amd'));_0x89c7c5['createHistory'](_0x1170fe)[_0x6db7('0xab')](loggerCatch(_0x6db7('0xe1')));if(_0x1170fe['countbusyretry']+_0x1170fe[_0x6db7('0xe2')]+_0x1170fe[_0x6db7('0xe3')]+_0x1170fe[_0x6db7('0xe4')]+_0x1170fe[_0x6db7('0xe5')]+_0x1170fe[_0x6db7('0xe6')]+_0x1170fe['countmachineretry']+_0x1170fe['countagentrejectretry']>=_0x153209['dialGlobalMaxRetry']){_0x89c7c5[_0x6db7('0xe7')](_0x1170fe,_0x16ac21,_0x1e876e,_0x6db7('0xe8'));}else{if(_0x1170fe[_0x6db7('0xde')]>=_0x153209[_0x6db7('0xe9')]){_0x89c7c5[_0x6db7('0xea')](_0x1170fe,_0x16ac21,_0x1e876e,'reason\x2019\x20machine....');}else{_0x89c7c5[_0x6db7('0xeb')]({'active':![],'countmachineretry':_0x1170fe['countmachineretry'],'scheduledat':moment()[_0x6db7('0xec')](_0x153209['dialMachineRetryFrequency'],_0x6db7('0xed'))['format'](_0x6db7('0xee')),'ContactId':_0x1170fe[_0x6db7('0xef')],'ListId':_0x1170fe[_0x6db7('0xc3')],'VoiceQueueId':_0x1170fe[_0x6db7('0xc5')]||undefined,'CampaignId':_0x1170fe[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch(_0x6db7('0xf0')));_0x16ac21({'reschedule':0x1});}}});}if(_0x27674c[_0x6db7('0x52')]===_0x6db7('0x77')&&this[_0x6db7('0x20')][_0x27674c[_0x6db7('0xad')]][_0x6db7('0xd3')]&&_0x31996a['value']===_0x6db7('0xd5')){delete this[_0x6db7('0x26')][_0x31996a[_0x6db7('0xcf')]];this['updateOriginated'](this[_0x6db7('0x20')][_0x27674c[_0x6db7('0xad')]]);_0x2dd33b=new Hangup(_0x27674c,_0x31996a);_0x2dd33b[_0x6db7('0xd6')]=0x12;_0x2dd33b['statedesc']=_0x6db7('0xd7');_0x2dd33b[_0x6db7('0xdd')]=_0x6db7('0xd8');ami[_0x6db7('0x4b')](_0x6db7('0xd9'),ut['buildObj'](_0x2dd33b,_0x6db7('0xda')));this[_0x6db7('0xc0')](_0x2dd33b,_0x6db7('0xf1'),_0x6db7('0xf2'));}if(_0x27674c[_0x6db7('0x52')]==='ivr'&&this[_0x6db7('0x20')][_0x27674c[_0x6db7('0xad')]][_0x6db7('0xd3')]&&_0x31996a['value']===_0x6db7('0xf3')){var _0x89c7c5=this;return new BPromise(function(_0x3b10d6,_0x54f753){delete _0x89c7c5[_0x6db7('0x26')][_0x31996a['uniqueid']];_0x89c7c5[_0x6db7('0xac')](_0x89c7c5['campaigns'][_0x27674c['queue']]);_0x89c7c5[_0x6db7('0x20')][_0x27674c[_0x6db7('0xad')]][_0x6db7('0x5a')]+=0x1;_0x89c7c5[_0x6db7('0x20')][_0x27674c[_0x6db7('0xad')]][_0x6db7('0x59')]+=0x1;var _0x2f32e2=_0x89c7c5[_0x6db7('0x20')][_0x27674c['queue']];var _0x1b3392=new Hangup(_0x27674c,_0x31996a);_0x1b3392[_0x6db7('0xd6')]=0x13;_0x1b3392[_0x6db7('0xa1')]='Machine';_0x1b3392['membername']=_0x6db7('0xd8');_0x1b3392['countmachineretry']+=0x1;_0x1b3392['countglobal']+=0x1;_0x1b3392[_0x6db7('0xda')]=!![];ami['emit'](_0x6db7('0xd9'),ut['buildObj'](_0x1b3392,_0x6db7('0xda')));_0x89c7c5[_0x6db7('0xbd')](_0x1b3392)[_0x6db7('0xab')](loggerCatch(_0x6db7('0xe1')));if(_0x1b3392['countbusyretry']+_0x1b3392['countcongestionretry']+_0x1b3392['countnoanswerretry']+_0x1b3392[_0x6db7('0xe4')]+_0x1b3392[_0x6db7('0xe5')]+_0x1b3392[_0x6db7('0xe6')]+_0x1b3392['countmachineretry']+_0x1b3392['countagentrejectretry']>=_0x2f32e2[_0x6db7('0xf4')]){_0x89c7c5['stateGlobal'](_0x1b3392,_0x3b10d6,_0x54f753,_0x6db7('0xe8'));}else{if(_0x1b3392[_0x6db7('0xde')]>=_0x2f32e2[_0x6db7('0xe9')]){_0x89c7c5[_0x6db7('0xea')](_0x1b3392,_0x3b10d6,_0x54f753,_0x6db7('0xf5'));}else{_0x89c7c5['rescheduleContact']({'active':![],'countmachineretry':_0x1b3392[_0x6db7('0xde')],'scheduledat':moment()['add'](_0x2f32e2[_0x6db7('0xf6')],_0x6db7('0xed'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b3392['ContactId'],'ListId':_0x1b3392[_0x6db7('0xc3')],'VoiceQueueId':_0x1b3392[_0x6db7('0xc5')]||undefined,'CampaignId':_0x1b3392[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch('[rescheduleContact][Machine]'));_0x3b10d6({'reschedule':0x1});}}});}}};Dialer[_0x6db7('0x1a')][_0x6db7('0x35')]=function(_0x403bbe){var _0x16731d=this['uniqueId'][_0x403bbe[_0x6db7('0xcf')]];var _0x109267=this;var _0x1cb32b;if(_0x16731d&&_0x16731d['type']==='ivr'){delete this[_0x6db7('0x26')][_0x403bbe[_0x6db7('0xcf')]];this[_0x6db7('0xac')](this[_0x6db7('0x20')][_0x16731d[_0x6db7('0xad')]]);this[_0x6db7('0x20')][_0x16731d[_0x6db7('0xad')]][_0x6db7('0xf7')]+=0x1;_0x1cb32b=new Hangup(_0x16731d,_0x403bbe);this['createHistory'](_0x1cb32b)[_0x6db7('0xab')](loggerCatch(_0x6db7('0xf8')));this['moveContactManagedDialer'](_0x1cb32b)[_0x6db7('0xab')](loggerCatch(_0x6db7('0xf9')));}if(_0x16731d&&_0x16731d[_0x6db7('0x52')]!==_0x6db7('0x77')&&isNotNull(this[_0x6db7('0x1f')][_0x16731d[_0x6db7('0xad')]][_0x6db7('0xfa')])){delete this[_0x6db7('0x26')][_0x403bbe[_0x6db7('0xcf')]];this[_0x6db7('0xac')](this['voiceQueues'][_0x16731d[_0x6db7('0xad')]]);this['voiceQueues'][_0x16731d[_0x6db7('0xad')]]['outboundAnswerCallsDay']+=0x1;this[_0x6db7('0x1f')][_0x16731d[_0x6db7('0xad')]][_0x6db7('0x59')]+=0x1;_0x1cb32b=new Hangup(_0x16731d,_0x403bbe);_0x1cb32b['state']=0x10;_0x1cb32b[_0x6db7('0xa1')]=_0x6db7('0xfb');_0x1cb32b[_0x6db7('0xdd')]=_0x6db7('0xfc');this[_0x6db7('0xbd')](_0x1cb32b)[_0x6db7('0xab')](loggerCatch(_0x6db7('0xf8')));this[_0x6db7('0xcd')](_0x1cb32b)[_0x6db7('0xab')](loggerCatch(_0x6db7('0xf9')));}if(_0x16731d&&_0x16731d[_0x6db7('0x52')]!==_0x6db7('0x77')&&!isNotNull(this[_0x6db7('0x1f')][_0x16731d[_0x6db7('0xad')]][_0x6db7('0xfa')])){delete this[_0x6db7('0x26')][_0x403bbe[_0x6db7('0xcf')]];this['updateOriginated'](this[_0x6db7('0x1f')][_0x16731d[_0x6db7('0xad')]]);this[_0x6db7('0x1f')][_0x16731d[_0x6db7('0xad')]]['outboundUnknownCallsDay']+=0x1;_0x1cb32b=new Hangup(_0x16731d,_0x403bbe);_0x1cb32b[_0x6db7('0xd6')]=0xc;_0x1cb32b[_0x6db7('0xa1')]=_0x403bbe[_0x6db7('0xfd')];_0x1cb32b[_0x6db7('0xdd')]='Unknow';this[_0x6db7('0xbd')](_0x1cb32b)[_0x6db7('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x6db7('0xcd')](_0x1cb32b)[_0x6db7('0xab')](loggerCatch(_0x6db7('0xf9')));}};Dialer[_0x6db7('0x1a')][_0x6db7('0x32')]=function(_0x3f6386){var _0x17eecc=this[_0x6db7('0x26')][_0x3f6386[_0x6db7('0xcf')]];var _0x334552=this;if(this[_0x6db7('0x1f')][_0x3f6386[_0x6db7('0xad')]]){if(_0x17eecc&&_0x17eecc[_0x6db7('0x52')]!=='ivr'){delete this['uniqueId'][_0x3f6386[_0x6db7('0xcf')]];this[_0x6db7('0x1f')][_0x3f6386[_0x6db7('0xad')]]['outboundAnswerCallsDay']+=0x1;var _0x297838=new AgentComplete(_0x17eecc,_0x3f6386);if(_0x3f6386['reason']===_0x6db7('0xfe')){_0x297838['agiafterat']=this[_0x6db7('0x1f')][_0x3f6386[_0x6db7('0xad')]]['dialQueueProject2']&&this[_0x6db7('0x1f')][_0x3f6386['queue']][_0x6db7('0xff')]?moment()[_0x6db7('0x74')](_0x6db7('0xee')):undefined;}this[_0x6db7('0xbd')](_0x297838)[_0x6db7('0xab')](loggerCatch(_0x6db7('0x100')));this[_0x6db7('0xcd')](_0x297838)[_0x6db7('0xab')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x6db7('0x1a')][_0x6db7('0x2d')]=function(_0x28d29d){if(this[_0x6db7('0x1f')][_0x28d29d[_0x6db7('0xad')]]){if(this[_0x6db7('0x26')][_0x28d29d[_0x6db7('0xcf')]]&&this['uniqueId'][_0x28d29d[_0x6db7('0xcf')]]['type']!=='ivr'){this[_0x6db7('0xac')](this[_0x6db7('0x1f')][_0x28d29d[_0x6db7('0xad')]]);this[_0x6db7('0x26')][_0x28d29d[_0x6db7('0xcf')]][_0x6db7('0x101')]=moment()[_0x6db7('0x74')](_0x6db7('0xee'));}}};Dialer[_0x6db7('0x1a')][_0x6db7('0x102')]=function(_0x31f6a6){this['createHistory'](_0x31f6a6)[_0x6db7('0xab')](loggerCatch(_0x6db7('0x100')));this[_0x6db7('0xcd')](_0x31f6a6)['catch'](loggerCatch(_0x6db7('0x103')));};Dialer[_0x6db7('0x1a')][_0x6db7('0x2f')]=function(_0x57d467){var _0x2842c5=this[_0x6db7('0x26')][_0x57d467[_0x6db7('0xcf')]];var _0x5e26ac=this;if(this[_0x6db7('0x1f')][_0x57d467['queue']]){if(_0x2842c5&&_0x2842c5[_0x6db7('0x52')]!=='ivr'){delete this[_0x6db7('0x26')][_0x57d467['uniqueid']];this[_0x6db7('0xac')](this[_0x6db7('0x1f')][_0x57d467[_0x6db7('0xad')]]);_0x2842c5[_0x6db7('0x104')]=moment()['format'](_0x6db7('0xee'));var _0x1fb766=new QueueCallerAbandon(_0x2842c5,_0x57d467);if(getSeconds(_0x2842c5['droptime'],_0x2842c5['responsetime'])>=_0x2842c5['dialQueueTimeout']){this[_0x6db7('0x1f')][_0x57d467['queue']][_0x6db7('0x66')]+=0x1;this[_0x6db7('0x1f')][_0x57d467[_0x6db7('0xad')]][_0x6db7('0x5f')]+=0x1;this[_0x6db7('0x1f')][_0x57d467[_0x6db7('0xad')]][_0x6db7('0x68')]+=0x1;_0x1fb766['state']=0xa;_0x1fb766['statedesc']=_0x6db7('0x105');_0x1fb766[_0x6db7('0x106')]='TIMEOUT';_0x1fb766['agiafterat']=this[_0x6db7('0x1f')][_0x57d467[_0x6db7('0xad')]][_0x6db7('0x107')]?moment()['format'](_0x6db7('0xee')):undefined;_0x1fb766[_0x6db7('0xe5')]+=0x1;_0x1fb766[_0x6db7('0xdf')]+=0x1;if(_0x1fb766['countdropretry']>=this['voiceQueues'][_0x57d467[_0x6db7('0xad')]]['dialDropMaxRetry']){this[_0x6db7('0x102')](_0x1fb766);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x1fb766[_0x6db7('0xe5')],'scheduledat':moment()['add'](this[_0x6db7('0x1f')][_0x57d467[_0x6db7('0xad')]][_0x6db7('0x108')],'minutes')[_0x6db7('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2842c5['ContactId'],'ListId':_0x2842c5[_0x6db7('0xc3')],'VoiceQueueId':_0x2842c5[_0x6db7('0xc5')]||undefined,'CampaignId':_0x2842c5['CampaignId']||undefined})[_0x6db7('0xab')](loggerCatch(_0x6db7('0x109')));var _0x310ae1=new History(_0x1fb766);_0x310ae1[_0x6db7('0xd6')]=0xa;_0x310ae1[_0x6db7('0xa1')]=_0x6db7('0x105');_0x310ae1[_0x6db7('0xa3')]=moment()[_0x6db7('0x74')](_0x6db7('0xee'));_0x310ae1['endtime']=_0x310ae1[_0x6db7('0xa3')];_0x310ae1['calleridname']=_0x1fb766['calleridname'];_0x310ae1['calleridnum']=_0x1fb766[_0x6db7('0x10a')];this[_0x6db7('0xbd')](_0x310ae1)[_0x6db7('0xab')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x6db7('0x1f')][_0x57d467[_0x6db7('0xad')]][_0x6db7('0x7d')]+=0x1;this['voiceQueues'][_0x57d467[_0x6db7('0xad')]]['outboundDropCallsDayCallersExit']+=0x1;_0x1fb766[_0x6db7('0xd6')]=0xb;_0x1fb766[_0x6db7('0xa1')]=_0x6db7('0x10b');_0x1fb766[_0x6db7('0x106')]=_0x6db7('0x10c');_0x1fb766[_0x6db7('0xe6')]+=0x1;_0x1fb766['countglobal']+=0x1;if(_0x1fb766[_0x6db7('0xe6')]>=this[_0x6db7('0x1f')][_0x57d467[_0x6db7('0xad')]][_0x6db7('0x10d')]){this[_0x6db7('0x102')](_0x1fb766);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x1fb766[_0x6db7('0xe6')],'scheduledat':moment()[_0x6db7('0xec')](this['voiceQueues'][_0x57d467[_0x6db7('0xad')]][_0x6db7('0x10e')],'minutes')[_0x6db7('0x74')](_0x6db7('0xee')),'ContactId':_0x2842c5[_0x6db7('0xef')],'ListId':_0x2842c5[_0x6db7('0xc3')],'VoiceQueueId':_0x2842c5[_0x6db7('0xc5')]||undefined,'CampaignId':_0x2842c5[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x310ae1=new History(_0x1fb766);_0x310ae1['state']=0xb;_0x310ae1[_0x6db7('0xa1')]='Abandoned';_0x310ae1[_0x6db7('0xa3')]=moment()[_0x6db7('0x74')](_0x6db7('0xee'));_0x310ae1[_0x6db7('0xa2')]=_0x310ae1[_0x6db7('0xa3')];_0x310ae1['calleridname']=_0x1fb766[_0x6db7('0x10f')];_0x310ae1[_0x6db7('0x10a')]=_0x1fb766[_0x6db7('0x10a')];this[_0x6db7('0xbd')](_0x310ae1)[_0x6db7('0xab')](loggerCatch(_0x6db7('0x110')));}}}}};Dialer[_0x6db7('0x1a')][_0x6db7('0x36')]=function(_0x154bd4){if(this[_0x6db7('0x25')][_0x154bd4[_0x6db7('0xcf')]]){this[_0x6db7('0x25')][_0x154bd4[_0x6db7('0xcf')]][_0x6db7('0xaa')]=_0x154bd4[_0x6db7('0xaa')];}if(this[_0x6db7('0x26')][_0x154bd4['uniqueid']]){this[_0x6db7('0x26')][_0x154bd4['uniqueid']][_0x6db7('0xaa')]=_0x154bd4[_0x6db7('0xaa')];}};Dialer[_0x6db7('0x1a')]['syncQueueMember']=function(_0x15cace){if(strategy[this[_0x6db7('0x1f')][this['actions'][_0x15cace[_0x6db7('0x111')]][_0x6db7('0xad')]]['strategy']]===_0x6db7('0x19')){if(this[_0x6db7('0x25')][_0x15cace[_0x6db7('0x111')]]&&_['isNil'](this[_0x6db7('0x25')][_0x15cace[_0x6db7('0x111')]][_0x6db7('0x112')])&&_0x15cace[_0x6db7('0xa9')]==='1'&&_0x15cace['paused']==='0'){if(this[_0x6db7('0x21')][_0x15cace[_0x6db7('0x113')]]){if(!this['agents'][_0x15cace[_0x6db7('0x113')]][_0x6db7('0x112')]){this['agents'][_0x15cace[_0x6db7('0x113')]][_0x6db7('0x112')]=!![];this['actions'][_0x15cace[_0x6db7('0x111')]][_0x6db7('0x112')]=!![];this[_0x6db7('0x25')][_0x15cace[_0x6db7('0x111')]][_0x6db7('0x113')]=_0x15cace[_0x6db7('0x113')];}}}}else if((strategy[this[_0x6db7('0x1f')][this['actions'][_0x15cace[_0x6db7('0x111')]][_0x6db7('0xad')]][_0x6db7('0x114')]]||_0x6db7('0x18'))===_0x6db7('0x18')){if(this[_0x6db7('0x25')][_0x15cace[_0x6db7('0x111')]]){if(this[_0x6db7('0x21')][_0x15cace['stateinterface']]){this['actions'][_0x15cace[_0x6db7('0x111')]][_0x6db7('0x113')]=_0x15cace[_0x6db7('0x113')];if(_[_0x6db7('0xa7')](this[_0x6db7('0x2b')][this[_0x6db7('0x25')][_0x15cace['actionid']][_0x6db7('0xad')]])){this['queueBooked'][this[_0x6db7('0x25')][_0x15cace[_0x6db7('0x111')]][_0x6db7('0xad')]]=[];}this[_0x6db7('0x2b')][this[_0x6db7('0x25')][_0x15cace[_0x6db7('0x111')]][_0x6db7('0xad')]][_0x6db7('0x115')](_[_0x6db7('0xc1')](_[_0x6db7('0xc2')](this[_0x6db7('0x25')][_0x15cace[_0x6db7('0x111')]],['idHopper',_0x6db7('0x113')]),{'status':_0x15cace[_0x6db7('0xa9')],'paused':_0x15cace[_0x6db7('0x116')]}));}}}};function unlockQueueStatus(_0x4654c7,_0x3809fd){setTimeout(function(){if(_[_0x6db7('0x3d')](_0x4654c7['queueStatusComplete'])){loggerBooked[_0x6db7('0x90')](_0x6db7('0x117'),_0x3809fd);}_0x4654c7[_0x6db7('0x118')]=!![];loggerBooked['info'](_0x6db7('0x119'),_0x3809fd,JSON['stringify'](_[_0x6db7('0xc2')](_0x4654c7,[_0x6db7('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x6db7('0x1a')]['syncQueueStatusComplete']=function(_0x59c435){var _0xa6580e=this;var _0x29e7c6=_0xa6580e[_0x6db7('0x1f')][_0xa6580e[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]][_0x6db7('0xad')]];if(strategy[this[_0x6db7('0x1f')][this[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]]['queue']][_0x6db7('0x114')]]===_0x6db7('0x19')){if(this[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]]&&this[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]][_0x6db7('0x113')]){this['preview'][_0x6db7('0x11a')](this[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]][_0x6db7('0x11b')],this[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]][_0x6db7('0x113')])[_0x6db7('0xab')](function(_0x270ca5){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x6db7('0x91')](_0x270ca5,{'showHidden':![],'depth':null}));})['finally'](function(){_0xa6580e[_0x6db7('0xac')](_0xa6580e['voiceQueues'][_0xa6580e[_0x6db7('0x25')][_0x59c435['actionid']][_0x6db7('0xad')]]);_0xa6580e['agents'][_0xa6580e['actions'][_0x59c435[_0x6db7('0x111')]]['stateinterface']][_0x6db7('0x112')]=![];delete _0xa6580e[_0x6db7('0x25')][_0x59c435['actionid']];unlockQueueStatus(_0x29e7c6);});}else{this['updateOriginated'](this[_0x6db7('0x1f')][this[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]][_0x6db7('0xad')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x6db7('0x25')][_0x59c435['actionid']][_0x6db7('0xef')],'ListId':this['actions'][_0x59c435[_0x6db7('0x111')]][_0x6db7('0xc3')],'VoiceQueueId':this[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]][_0x6db7('0xc5')]||undefined,'CampaignId':this[_0x6db7('0x25')][_0x59c435['actionid']]['CampaignId']||undefined})[_0x6db7('0xab')](loggerCatch(_0x6db7('0x11c')));delete this[_0x6db7('0x25')][_0x59c435['actionid']];unlockQueueStatus(_0x29e7c6);}}else if((strategy[this[_0x6db7('0x1f')][this['actions'][_0x59c435[_0x6db7('0x111')]][_0x6db7('0xad')]][_0x6db7('0x114')]]||'rrmemory')===_0x6db7('0x18')){var _0x1b40eb;if(this[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]]&&!_['isEmpty'](this[_0x6db7('0x2b')][this[_0x6db7('0x25')][_0x59c435['actionid']]['queue']])){if(this[_0x6db7('0x11d')][_0xa6580e[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]][_0x6db7('0xad')]]){this[_0x6db7('0x11d')][_0xa6580e['actions'][_0x59c435[_0x6db7('0x111')]][_0x6db7('0xad')]]=this[_0x6db7('0x11d')][this[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]][_0x6db7('0xad')]]?this[_0x6db7('0x11d')][this[_0x6db7('0x25')][_0x59c435['actionid']][_0x6db7('0xad')]]:this['queueBooked'][this['actions'][_0x59c435[_0x6db7('0x111')]]['queue']]?this[_0x6db7('0x2b')][this['actions'][_0x59c435[_0x6db7('0x111')]][_0x6db7('0xad')]][_0x6db7('0x11e')]||0x0:0x0;}this[_0x6db7('0x2b')][this[_0x6db7('0x25')][_0x59c435[_0x6db7('0x111')]][_0x6db7('0xad')]][_0x6db7('0x11e')]=this[_0x6db7('0x11d')][this[_0x6db7('0x25')][_0x59c435['actionid']][_0x6db7('0xad')]];for(var _0x34133c=0x0;_0x34133c=0x0;})[_0x6db7('0xab')](myreject(_0x5d44fb)));}}else{_0x59392f[_0x6db7('0x115')](ami['Action']({'action':_0x6db7('0x13c'),'command':util['format'](_0x6db7('0x138'),_0x1a7b12,!_['isUndefined'](config['timezones'][_0x37acf6])?_0x37acf6:'')})['then'](function(_0x2e17d9){return _0x2e17d9[_0x6db7('0x13a')]['indexOf'](_0x6db7('0x13d'))>=0x0;})[_0x6db7('0xab')](myreject(_0x5d44fb)));}BPromise[_0x6db7('0x13e')](_0x59392f)[_0x6db7('0xb1')](function(_0xce192d){var _0x2a16a5=_['some'](_0xce192d);if(_0x2a16a5){return _0x4637bc(_0x2a16a5);}else{_0x437831[_0x6db7('0x3e')]=_0x3c9ad8?_0x6db7('0x13f'):_0x6db7('0x140');return _0x5d44fb(msgResponse(_0x6db7('0x141'),_0x6db7('0x131'),_0x6db7('0x142')+_0x3c9ad8+'\x20'+_0x423105+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x1a7b12,{'showHidden':![],'depth':null})+_0x6db7('0x143')+_0x37acf6));}})['catch'](function(_0x51f1c3){return _0x5d44fb(msgResponse(_0x6db7('0x12f'),_0x6db7('0x131'),JSON['stringify'](_0x51f1c3)));});});};Dialer[_0x6db7('0x1a')]['checkDialMethod']=function(_0x1504c3){var _0xac7167=this;return function(){switch(_0x1504c3[_0x6db7('0x55')]){case'progressive':freeVariablesPredictive(_0x1504c3);_0xac7167['handlePower'](_0x1504c3,0x1);break;case'power':freeVariablesPredictive(_0x1504c3);_0xac7167['handlePower'](_0x1504c3,_0x1504c3[_0x6db7('0x144')]);break;case _0x6db7('0xa'):_0xac7167[_0x6db7('0xa')](_0x1504c3);break;case _0x6db7('0x9'):freeVariablesPredictive(_0x1504c3);_0xac7167['handlePower'](_0x1504c3,0x1);break;default:freeVariablesPredictive(_0x1504c3);logger[_0x6db7('0x90')]('Queue',_0x1504c3[_0x6db7('0x40')],'method\x20not\x20recognized');}};};Dialer[_0x6db7('0x1a')][_0x6db7('0x145')]=function(_0x3fd86f){var _0x323884=this;return function(){_0x323884['handleIvr'](_0x3fd86f);};};Dialer[_0x6db7('0x1a')]['syncQueueSummary']=function(_0x605f11){var _0x3a49b9=this;if(isNotPreview(_0x605f11[_0x6db7('0x55')])){if(isVoiceQueueOutbound(_0x605f11[_0x6db7('0x52')])&&isActive(_0x605f11[_0x6db7('0x146')])){_0x605f11[_0x6db7('0x9a')]=!![];BPromise[_0x6db7('0xaf')]()[_0x6db7('0xb1')](checkIsLoggedIn(_0x605f11,_0x605f11[_0x6db7('0x4e')]))[_0x6db7('0xb1')](checkIsActive(_0x605f11,_0x605f11['dialActive']))['then'](checkInterval(_0x605f11))[_0x6db7('0xb1')](_0x3a49b9[_0x6db7('0x12a')](_0x605f11))[_0x6db7('0xb1')](_0x3a49b9['checkIfTime'](_0x605f11[_0x6db7('0x147')],_0x605f11[_0x6db7('0x148')],_0x605f11['name'],_0x605f11))[_0x6db7('0xb1')](_0x3a49b9[_0x6db7('0x130')](_0x605f11[_0x6db7('0x43')],_0x605f11[_0x6db7('0x148')],_0x605f11[_0x6db7('0x40')],_0x605f11))[_0x6db7('0xb1')](_0x3a49b9['checkDialMethod'](_0x605f11))['catch'](loggerCatchQueueSummary(_0x6db7('0x149'),_0x605f11));}else{notSendMessagesQueue(_0x605f11);}}else{freeVariablesPredictive(_0x605f11);}};Dialer[_0x6db7('0x1a')][_0x6db7('0x14a')]=function(){var _0x189921=this;var _0x53c045;for(var _0x477467 in this[_0x6db7('0x20')]){if(typeof this[_0x6db7('0x20')][_0x477467]!=='undefined'){_0x53c045=this[_0x6db7('0x20')][_0x477467];if(isCampaignIvr(_0x53c045[_0x6db7('0x52')])&&isActive(_0x53c045[_0x6db7('0x70')])){_0x53c045[_0x6db7('0x9a')]=!![];BPromise[_0x6db7('0xaf')]()[_0x6db7('0xb1')](checkIsActive(_0x53c045,_0x53c045['active']))[_0x6db7('0xb1')](checkInterval(_0x53c045))[_0x6db7('0xb1')](_0x189921[_0x6db7('0x12a')](_0x53c045))[_0x6db7('0xb1')](_0x189921[_0x6db7('0x12e')](_0x53c045[_0x6db7('0x147')],_0x53c045[_0x6db7('0x148')],_0x53c045['name'],_0x53c045))[_0x6db7('0xb1')](_0x189921[_0x6db7('0x130')](_0x53c045[_0x6db7('0x43')],_0x53c045[_0x6db7('0x148')],_0x53c045[_0x6db7('0x40')],_0x53c045))['then'](_0x189921['launchHandleIvr'](_0x53c045))[_0x6db7('0xab')](loggerCatchQueueSummary(_0x6db7('0x14b'),_0x53c045));}else{notSendMessagesCampaign(_0x53c045);}}}};function getCallerIdRandom(_0x226af1,_0x68bce6){var _0x37fbc1;var _0x4c1181;var _0xa3b8b0;if(_0x68bce6<=0x0){_0x68bce6=0x1;}_0x37fbc1=new RegExp(_0x6db7('0x14c')+_0x68bce6+'}$');_0x4c1181=Math[_0x6db7('0x14d')](0xa,_0x68bce6-0x1);_0xa3b8b0=Math[_0x6db7('0x14d')](0xa,_0x68bce6)-0x1;return util['format']('%s',_[_0x6db7('0x14e')](_0x226af1,_0x37fbc1,_[_0x6db7('0x14f')](_0x4c1181,_0xa3b8b0)));}function extractCalleridName(_0x565975){var _0x749e0d=_0x565975[_0x6db7('0x150')](/"(.*?)"/);return _0x749e0d?_0x749e0d[0x1]:_0x565975;}function extractCalleridNumber(_0xeb61a6){var _0x434aad=_0xeb61a6['match'](/<(.*?)>/);return _0x434aad?_0x434aad[0x1]:_0xeb61a6;}Dialer['prototype'][_0x6db7('0x151')]=function(_0x3be92c,_0x3516a2){var _0x30affb=this;var _0x5cfc3e=uuid['v4']();this['actions'][_0x5cfc3e]=new Action(_0x3be92c,_0x3516a2,_0x5cfc3e);return new BPromise(function(_0x23d1cd,_0x36e08c){if(_[_0x6db7('0x3d')](_0x3be92c)&&typeof _0x3be92c!==_0x6db7('0x152')){return _0x36e08c(msgResponse(_0x6db7('0x153'),_0x6db7('0x131'),_0x6db7('0x154')));}if(_[_0x6db7('0x3d')](_0x3516a2[_0x6db7('0x155')][_0x6db7('0x156')])||_0x3516a2[_0x6db7('0x155')]['phone']===null){return _0x36e08c(msgResponse(_0x6db7('0x153'),_0x6db7('0x131'),_0x6db7('0x157')));}var _0x2fe6db={'XMD-CALLERID':_0x30affb[_0x6db7('0x25')][_0x5cfc3e][_0x6db7('0x158')](),'XMD-AGI':_0x3be92c[_0x6db7('0xfa')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x3be92c[_0x6db7('0xfa')]):_0x6db7('0x159'),'XMD-AGIAFTER':_0x3be92c[_0x6db7('0x107')]?util['format'](_0x6db7('0x15a'),ipAgi,_0x3be92c[_0x6db7('0x107')]):'NONE','XMD-QUEUE':_0x3be92c[_0x6db7('0x52')]===_0x6db7('0x4c')?util[_0x6db7('0x74')](_0x6db7('0x15b'),_0x3be92c[_0x6db7('0x40')],_0x3be92c['dialQueueOptions']||'',_0x3be92c[_0x6db7('0xff')]?'c':'',_0x3be92c[_0x6db7('0x15c')]||0x3):_0x6db7('0x159'),'XMD-CONTACTID':_0x3516a2[_0x6db7('0xef')],'XMD-CDRTYPE':_0x6db7('0x15d'),'CALLERID(all)':_0x30affb['actions'][_0x5cfc3e][_0x6db7('0x158')](),'XMD-AMD':_0x3be92c[_0x6db7('0xd3')]?_0x6db7('0x15e'):_0x6db7('0x159'),'XMD-DESTINATION':_0x6db7('0xd2')};if(_0x3be92c[_0x6db7('0xd3')]){_0x2fe6db[_0x6db7('0x15f')]=_0x3be92c[_0x6db7('0x160')]||0x9c4;_0x2fe6db[_0x6db7('0x161')]=_0x3be92c[_0x6db7('0x162')]||0x5dc;_0x2fe6db[_0x6db7('0x163')]=_0x3be92c['dialAMDAfterGreetingSilence']||0x320;_0x2fe6db[_0x6db7('0x164')]=_0x3be92c['dialAMDTotalAnalysisTime']||0x1388;_0x2fe6db[_0x6db7('0x165')]=_0x3be92c[_0x6db7('0x166')]||0x64;_0x2fe6db[_0x6db7('0x167')]=_0x3be92c['dialAMDBetweenWordsSilence']||0x32;_0x2fe6db[_0x6db7('0x168')]=_0x3be92c[_0x6db7('0x169')]||0x3;_0x2fe6db['XMD-AMDSILENCETHRESHOLD']=_0x3be92c[_0x6db7('0x16a')]||0x100;_0x2fe6db[_0x6db7('0x16b')]=_0x3be92c['dialAMDMaximumWordLength']||0x1388;}if(_0x3be92c['type']==='outbound'){_0x2fe6db[_0x6db7('0x16c')]=_0x3516a2[_0x6db7('0xc5')];}else{_0x2fe6db[_0x6db7('0x16d')]=_0x3516a2['CampaignId'];}for(var _0x474edf in _0x3516a2['Contact']){if(typeof _0x3516a2['Contact'][_0x474edf]!==_0x6db7('0x95')){if(isNotNull(_0x3516a2[_0x6db7('0x155')][_0x474edf])&&_0x474edf!=='id'&&_0x474edf!==_0x6db7('0x16e')&&_0x474edf!==_0x6db7('0x16f')&&_0x474edf!=='updatedAt'){_0x2fe6db[util[_0x6db7('0x74')]('%s%s','XMD-',_[_0x6db7('0x170')](_0x474edf))]=_0x3516a2[_0x6db7('0x155')][_0x474edf];}}}var _0x4e167f=_0x30affb[_0x6db7('0xca')](_0x3be92c[_0x6db7('0x6f')])?getCallerId(_0x3be92c[_0x6db7('0x6f')][_0x6db7('0x71')],_0x3be92c['dialOriginateCallerIdName'],_0x3be92c[_0x6db7('0x171')]>0x0?getCallerIdRandom(_0x3be92c[_0x6db7('0x57')],_0x3be92c[_0x6db7('0x171')]):_0x3be92c[_0x6db7('0x57')]):getCallerId(_[_0x6db7('0xa7')](_0x3be92c[_0x6db7('0x12b')])?_0x3be92c[_0x6db7('0x6f')]['callerid']:_0x3be92c[_0x6db7('0x12b')][_0x6db7('0x71')],_0x3be92c[_0x6db7('0x56')],_0x3be92c[_0x6db7('0x171')]>0x0?getCallerIdRandom(_0x3be92c['dialOriginateCallerIdNumber'],_0x3be92c['dialRandomLastDigitCallerIdNumber']):_0x3be92c[_0x6db7('0x57')]);if(_0x4e167f){_0x2fe6db[_0x6db7('0x172')]=_0x30affb[_0x6db7('0x25')][_0x5cfc3e][_0x6db7('0x173')]=extractCalleridName(_0x4e167f);_0x2fe6db[_0x6db7('0x174')]=_0x30affb[_0x6db7('0x25')][_0x5cfc3e][_0x6db7('0x175')]=extractCalleridNumber(_0x4e167f);}return ami[_0x6db7('0xa8')]({'actionid':_0x5cfc3e,'action':_0x6db7('0x153'),'channel':_0x30affb[_0x6db7('0xca')](_0x3be92c[_0x6db7('0x6f')])?util['format'](_0x6db7('0x176'),_0x3be92c['Trunk']['name'],isNotNull(_0x3be92c[_0x6db7('0x58')])?_0x3be92c[_0x6db7('0x58')][_0x6db7('0x177')]()||'':'',_0x3be92c[_0x6db7('0x178')]>0x0?_0x3516a2[_0x6db7('0x155')][_0x6db7('0x156')][_0x6db7('0x179')](_0x3be92c['dialCutDigit']):_0x3516a2[_0x6db7('0x155')][_0x6db7('0x156')]):util[_0x6db7('0x74')]('SIP/%s/%s%s',_['isNil'](_0x3be92c['TrunkBackup'])?_0x3be92c[_0x6db7('0x6f')][_0x6db7('0x40')]:_0x3be92c[_0x6db7('0x12b')]['name'],isNotNull(_0x3be92c[_0x6db7('0x58')])?_0x3be92c[_0x6db7('0x58')]['trim']()||'':'',_0x3be92c['dialCutDigit']>0x0?_0x3516a2['Contact'][_0x6db7('0x156')][_0x6db7('0x179')](_0x3be92c['dialCutDigit']):_0x3516a2[_0x6db7('0x155')][_0x6db7('0x156')]),'callerid':_0x4e167f,'Exten':_0x6db7('0xd2'),'Context':_0x6db7('0x17a'),'Priority':'1','variable':_0x2fe6db,'timeout':(_0x3be92c['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5cfc3e})[_0x6db7('0xb1')](function(_0xd96ee2){return _0x23d1cd(_0xd96ee2);})['catch'](function(_0x44ef2a){_0x3be92c[_0x6db7('0x61')]+=0x1;var _0x52b8f6=new History(_0x30affb[_0x6db7('0x25')][_0x5cfc3e]);logger[_0x6db7('0x90')](util[_0x6db7('0x74')](_0x6db7('0x17b'),JSON[_0x6db7('0x72')](_0x44ef2a)));_0x52b8f6[_0x6db7('0xd6')]=0xe;_0x52b8f6['statedesc']='OriginateError';_0x52b8f6['starttime']=moment()['format'](_0x6db7('0xee'));_0x52b8f6[_0x6db7('0xa2')]=_0x52b8f6[_0x6db7('0xa3')];_0x30affb[_0x6db7('0xbd')](_0x52b8f6)[_0x6db7('0xab')](loggerCatch(_0x6db7('0x17c')));_0x30affb['moveContactManagedDialer'](_0x52b8f6)['catch'](loggerCatch(_0x6db7('0x17c')))[_0x6db7('0x1d')](function(){delete _0x30affb['actions'][_0x5cfc3e];return _0x36e08c(msgResponse('originate',_0x6db7('0x48'),_0x6db7('0x17d')));});});});};Dialer[_0x6db7('0x1a')]['syncOriginateResponse']=function(_0x237752){var _0x4dea13=this['actions'][_0x237752[_0x6db7('0x111')]];if(_0x4dea13){delete this['actions'][_0x237752['actionid']];_0x4dea13[_0x6db7('0x17e')]=moment()[_0x6db7('0x74')]('YYYY-MM-DD\x20HH:mm:ss');var _0x336041=_0x4dea13[_0x6db7('0x52')]===_0x6db7('0x77')?this[_0x6db7('0x20')][_0x4dea13['queue']]:this[_0x6db7('0x1f')][_0x4dea13['getQueue']()];if(!this[_0x6db7('0x17f')](_0x237752[_0x6db7('0x180')])){this[_0x6db7('0xac')](_0x336041);return this[_0x6db7('0x181')](_0x4dea13,_0x336041,_0x237752)[_0x6db7('0xab')](loggerCatch(_0x6db7('0x182')));}this[_0x6db7('0x26')][_0x237752[_0x6db7('0xcf')]]=_0x4dea13;}};Dialer[_0x6db7('0x1a')][_0x6db7('0x183')]=function(_0x4dfad8,_0x4dced4,_0x24bd11){var _0x504e19=new History(_0x4dced4);if(_0x504e19[_0x6db7('0x184')]+_0x504e19[_0x6db7('0xe2')]+_0x504e19[_0x6db7('0xe3')]+_0x504e19[_0x6db7('0xe4')]+_0x504e19[_0x6db7('0xe5')]+_0x504e19[_0x6db7('0xe6')]+_0x504e19[_0x6db7('0xde')]+_0x504e19[_0x6db7('0x185')]>=_0x24bd11[_0x6db7('0xf4')]-0x1){return!![];}switch(_0x4dfad8){case 0x3:if(_0x504e19['countnoanswerretry']>=_0x24bd11[_0x6db7('0x186')]-0x1){return!![];}this[_0x6db7('0xeb')]({'active':![],'countnoanswerretry':_0x504e19['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x24bd11['dialNoAnswerRetryFrequency'],_0x6db7('0xed'))['format'](_0x6db7('0xee')),'ContactId':_0x504e19[_0x6db7('0xef')],'ListId':_0x504e19[_0x6db7('0xc3')],'VoiceQueueId':_0x504e19[_0x6db7('0xc5')]||undefined,'CampaignId':_0x504e19[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch(_0x6db7('0x187')));break;case 0x5:if(_0x504e19[_0x6db7('0x184')]>=_0x24bd11[_0x6db7('0x188')]-0x1){return!![];}this[_0x6db7('0xeb')]({'active':![],'countbusyretry':_0x504e19[_0x6db7('0x184')]+=0x1,'scheduledat':moment()[_0x6db7('0xec')](_0x24bd11['dialBusyRetryFrequency'],_0x6db7('0xed'))[_0x6db7('0x74')](_0x6db7('0xee')),'ContactId':_0x504e19[_0x6db7('0xef')],'ListId':_0x504e19[_0x6db7('0xc3')],'VoiceQueueId':_0x504e19[_0x6db7('0xc5')]||undefined,'CampaignId':_0x504e19[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x504e19[_0x6db7('0xe2')]>=_0x24bd11[_0x6db7('0x189')]-0x1){return!![];}this[_0x6db7('0xeb')]({'active':![],'countcongestionretry':_0x504e19[_0x6db7('0xe2')]+=0x1,'scheduledat':moment()['add'](_0x24bd11[_0x6db7('0x18a')],_0x6db7('0xed'))[_0x6db7('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x504e19[_0x6db7('0xef')],'ListId':_0x504e19[_0x6db7('0xc3')],'VoiceQueueId':_0x504e19['VoiceQueueId']||undefined,'CampaignId':_0x504e19[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch(_0x6db7('0x18b')));break;case 0x0:if(_0x504e19[_0x6db7('0xe4')]>=_0x24bd11[_0x6db7('0x18c')]-0x1){return!![];}else{this[_0x6db7('0xeb')]({'active':![],'countnosuchnumberretry':_0x504e19[_0x6db7('0xe4')]+=0x1,'scheduledat':moment()[_0x6db7('0xec')](_0x24bd11[_0x6db7('0x18d')],'minutes')[_0x6db7('0x74')](_0x6db7('0xee')),'ContactId':_0x504e19[_0x6db7('0xef')],'ListId':_0x504e19['ListId'],'VoiceQueueId':_0x504e19[_0x6db7('0xc5')]||undefined,'CampaignId':_0x504e19[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch(_0x6db7('0x18e')));}break;case 0xa:if(_0x504e19[_0x6db7('0xe5')]>=_0x24bd11['dialDropMaxRetry']-0x1){return!![];}this[_0x6db7('0xeb')]({'active':![],'countdropretry':_0x504e19[_0x6db7('0xe5')]+=0x1,'scheduledat':moment()['add'](_0x24bd11[_0x6db7('0x108')],_0x6db7('0xed'))[_0x6db7('0x74')](_0x6db7('0xee')),'ContactId':_0x504e19[_0x6db7('0xef')],'ListId':_0x504e19[_0x6db7('0xc3')],'VoiceQueueId':_0x504e19[_0x6db7('0xc5')]||undefined,'CampaignId':_0x504e19[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch(_0x6db7('0x109')));break;case 0xb:if(_0x504e19[_0x6db7('0xe6')]>=_0x24bd11['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x6db7('0xeb')]({'active':![],'countabandonedretry':_0x504e19[_0x6db7('0xe6')]+=0x1,'scheduledat':moment()[_0x6db7('0xec')](_0x24bd11[_0x6db7('0x10e')],_0x6db7('0xed'))[_0x6db7('0x74')](_0x6db7('0xee')),'ContactId':_0x504e19[_0x6db7('0xef')],'ListId':_0x504e19[_0x6db7('0xc3')],'VoiceQueueId':_0x504e19[_0x6db7('0xc5')]||undefined,'CampaignId':_0x504e19[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch(_0x6db7('0x18f')));break;case 0x13:if(_0x504e19[_0x6db7('0xde')]>=_0x24bd11[_0x6db7('0xe9')]-0x1){return!![];}this[_0x6db7('0xeb')]({'active':![],'countmachineretry':_0x504e19['countmachineretry']+=0x1,'scheduledat':moment()[_0x6db7('0xec')](_0x24bd11[_0x6db7('0xf6')],_0x6db7('0xed'))[_0x6db7('0x74')](_0x6db7('0xee')),'ContactId':_0x504e19[_0x6db7('0xef')],'ListId':_0x504e19['ListId'],'VoiceQueueId':_0x504e19[_0x6db7('0xc5')]||undefined,'CampaignId':_0x504e19[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch(_0x6db7('0xf0')));break;case 0x14:if(_0x504e19[_0x6db7('0x185')]>=_0x24bd11[_0x6db7('0x190')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x504e19[_0x6db7('0x185')]+=0x1,'scheduledat':moment()[_0x6db7('0xec')](_0x24bd11[_0x6db7('0x191')],_0x6db7('0xed'))[_0x6db7('0x74')](_0x6db7('0xee')),'ContactId':_0x504e19['ContactId'],'ListId':_0x504e19[_0x6db7('0xc3')],'VoiceQueueId':_0x504e19[_0x6db7('0xc5')]||undefined,'CampaignId':_0x504e19[_0x6db7('0xc6')]||undefined})[_0x6db7('0xab')](loggerCatch(_0x6db7('0x192')));break;default:return!![];}};Dialer[_0x6db7('0x1a')][_0x6db7('0x181')]=function(_0x59eeca,_0x2af336,_0x4a695a){var _0xa0be3e=this;var _0x10cf64=new History(_0x59eeca);return new BPromise(function(_0x210b22,_0x3ef098){if(_[_0x6db7('0x3d')](_0x2af336)&&typeof _0x2af336!==_0x6db7('0x152')){return _0x3ef098(msgResponse(_0x6db7('0x193'),_0x6db7('0x131'),_0x6db7('0x194')));}if(_['isUndefined'](_0x4a695a)&&typeof _0x4a695a!==_0x6db7('0x152')){return _0x3ef098(msgResponse(_0x6db7('0x193'),_0x6db7('0x131'),_0x6db7('0x195')));}switch(_0x4a695a[_0x6db7('0x196')]){case'0':_0x2af336['outboundNoSuchCallsDay']+=0x1;_0x10cf64[_0x6db7('0xd6')]=0x0;_0x10cf64[_0x6db7('0xa1')]=_0x6db7('0x197');_0x10cf64[_0x6db7('0xe4')]+=0x1;_0x10cf64[_0x6db7('0xdf')]+=0x1;ami[_0x6db7('0x4b')](_0x6db7('0x198'),ut[_0x6db7('0xe0')](_0x59eeca,'nosuchnumber'));_0xa0be3e['createHistory'](_0x10cf64)[_0x6db7('0xab')](loggerCatch(_0x6db7('0xe1')));if(_0xa0be3e['checkRetriveMax'](0x0,_0x59eeca,_0x2af336)){if(_0x10cf64[_0x6db7('0xe4')]>=_0x2af336[_0x6db7('0x18c')]){_0xa0be3e[_0x6db7('0xea')](_0x10cf64,_0x210b22,_0x3ef098,_0x6db7('0x199'));}else{_0xa0be3e['stateGlobal'](_0x10cf64,_0x210b22,_0x3ef098,_0x6db7('0x199'));}}break;case'3':_0x2af336[_0x6db7('0x60')]+=0x1;_0x10cf64[_0x6db7('0xd6')]=0x3;_0x10cf64[_0x6db7('0xa1')]=_0x6db7('0x19a');_0x10cf64['countnoanswerretry']+=0x1;_0x10cf64[_0x6db7('0xdf')]+=0x1;ami[_0x6db7('0x4b')](_0x6db7('0x19b'),ut[_0x6db7('0xe0')](_0x59eeca,_0x6db7('0x19c')));_0xa0be3e[_0x6db7('0xbd')](_0x10cf64)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0xa0be3e[_0x6db7('0x183')](0x3,_0x59eeca,_0x2af336)){if(_0x10cf64[_0x6db7('0xe3')]>=_0x2af336[_0x6db7('0x186')]){_0xa0be3e[_0x6db7('0xea')](_0x10cf64,_0x210b22,_0x3ef098,_0x6db7('0x19d'));}else{_0xa0be3e['stateGlobal'](_0x10cf64,_0x210b22,_0x3ef098,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2af336['outboundBusyCallsDay']+=0x1;_0x10cf64[_0x6db7('0xd6')]=0x5;_0x10cf64[_0x6db7('0xa1')]=_0x6db7('0x19e');_0x10cf64['countbusyretry']+=0x1;_0x10cf64[_0x6db7('0xdf')]+=0x1;ami[_0x6db7('0x4b')](_0x6db7('0x19f'),ut[_0x6db7('0xe0')](_0x59eeca,'busy'));_0xa0be3e[_0x6db7('0xbd')](_0x10cf64)[_0x6db7('0xab')](loggerCatch(_0x6db7('0x1a0')));if(_0xa0be3e['checkRetriveMax'](0x5,_0x59eeca,_0x2af336)){if(_0x10cf64['countbusyretry']>=_0x2af336['dialBusyMaxRetry']){_0xa0be3e[_0x6db7('0xea')](_0x10cf64,_0x210b22,_0x3ef098,_0x6db7('0x1a1'));}else{_0xa0be3e[_0x6db7('0xe7')](_0x10cf64,_0x210b22,_0x3ef098,_0x6db7('0x1a1'));}}break;case'8':_0x2af336[_0x6db7('0x5c')]+=0x1;_0x10cf64[_0x6db7('0xd6')]=0x8;_0x10cf64[_0x6db7('0xa1')]='Congestion';_0x10cf64['countcongestionretry']+=0x1;_0x10cf64[_0x6db7('0xdf')]+=0x1;ami[_0x6db7('0x4b')](_0x6db7('0x1a2'),ut[_0x6db7('0xe0')](_0x59eeca,'congestion'));_0xa0be3e[_0x6db7('0xbd')](_0x10cf64)[_0x6db7('0xab')](loggerCatch(_0x6db7('0x1a3')));if(_0xa0be3e['checkRetriveMax'](0x8,_0x59eeca,_0x2af336)){if(_0x10cf64[_0x6db7('0xe2')]>=_0x2af336[_0x6db7('0x189')]){_0xa0be3e[_0x6db7('0xea')](_0x10cf64,_0x210b22,_0x3ef098,_0x6db7('0x1a4'));}else{_0xa0be3e[_0x6db7('0xe7')](_0x10cf64,_0x210b22,_0x3ef098,_0x6db7('0x1a4'));}}break;case'11':_0x2af336[_0x6db7('0x1a5')]+=0x1;_0x10cf64[_0x6db7('0xd6')]=0xb;_0x10cf64[_0x6db7('0xa1')]='Abandoned';_0x10cf64[_0x6db7('0xe6')]+=0x1;_0x10cf64['countglobal']+=0x1;_0xa0be3e[_0x6db7('0xbd')](_0x10cf64)[_0x6db7('0xab')](loggerCatch(_0x6db7('0x110')));if(_0xa0be3e[_0x6db7('0x183')](0xb,_0x59eeca,_0x2af336)){if(_0x10cf64[_0x6db7('0xe6')]>=_0x2af336[_0x6db7('0x10d')]){_0xa0be3e[_0x6db7('0xea')](_0x10cf64,_0x210b22,_0x3ef098,_0x6db7('0x1a6'));}else{_0xa0be3e[_0x6db7('0xe7')](_0x10cf64,_0x210b22,_0x3ef098,'reason\x2011\x20abandoned');}}break;case'20':_0x2af336[_0x6db7('0x1a7')]+=0x1;_0x10cf64[_0x6db7('0xd6')]=0x14;_0x10cf64[_0x6db7('0xa1')]=_0x6db7('0x1a8');_0x10cf64[_0x6db7('0x185')]+=0x1;_0x10cf64[_0x6db7('0xdf')]+=0x1;ami['emit']('custom:agentreject',ut['buildObj'](_0x59eeca,_0x6db7('0x1a9')));_0xa0be3e[_0x6db7('0xbd')](_0x10cf64)[_0x6db7('0xab')](loggerCatch(_0x6db7('0x1aa')));if(_0xa0be3e[_0x6db7('0x183')](0x14,_0x59eeca,_0x2af336)){if(_0x10cf64[_0x6db7('0x185')]>=_0x2af336[_0x6db7('0x190')]){_0xa0be3e[_0x6db7('0xea')](_0x10cf64,_0x210b22,_0x3ef098,'reason\x2020\x20agentreject');}else{_0xa0be3e['stateGlobal'](_0x10cf64,_0x210b22,_0x3ef098,'reason\x2020\x20agentreject');}}break;default:_0x2af336[_0x6db7('0x1ab')]+=0x1;_0x10cf64[_0x6db7('0xd6')]=0xc;_0x10cf64[_0x6db7('0xa1')]=_0x4a695a[_0x6db7('0x196')];_0xa0be3e[_0x6db7('0xbd')](_0x10cf64)['catch'](loggerCatch(_0x6db7('0x1ac')));if(_0xa0be3e[_0x6db7('0x183')](_0x4a695a['reason'],_0x59eeca,_0x2af336)){if(_0x10cf64[_0x6db7('0x184')]+_0x10cf64[_0x6db7('0xe2')]+_0x10cf64['countnoanswerretry']+_0x10cf64[_0x6db7('0xe4')]+_0x10cf64['countdropretry']+_0x10cf64[_0x6db7('0xe6')]+_0x10cf64[_0x6db7('0xde')]+_0x10cf64[_0x6db7('0x185')]>=_0x2af336[_0x6db7('0xf4')]){_0xa0be3e[_0x6db7('0xe7')](_0x10cf64,_0x210b22,_0x3ef098,_0x4a695a[_0x6db7('0x196')]);}else{_0xa0be3e[_0x6db7('0xea')](_0x10cf64,_0x210b22,_0x3ef098,_0x4a695a[_0x6db7('0x196')]);}}}});};Dialer['prototype']['stateGlobal']=function(_0xdfec9c,_0x2a1c12,_0x282aea,_0x53d87a){var _0x60b564=new Final(_0xdfec9c);_0x60b564[_0x6db7('0xd6')]=0xf;_0x60b564[_0x6db7('0xa1')]=_0x6db7('0x1ad');this[_0x6db7('0xea')](_0x60b564,_0x2a1c12,_0x282aea,_0x53d87a);};Dialer[_0x6db7('0x1a')]['createStateFinal']=function(_0x21860e,_0x6ba1c1,_0x49900b,_0xd9f912){this[_0x6db7('0xcd')](_0x21860e)[_0x6db7('0xb1')](function(){return _0x6ba1c1(msgResponse(_0x6db7('0x193'),_0x6db7('0xc9'),_0xd9f912));})['catch'](function(){return _0x49900b(msgResponse(_0x6db7('0x1ae'),_0x6db7('0x131'),_0x6db7('0x1af')));});};Dialer[_0x6db7('0x1a')][_0x6db7('0xa')]=function(_0x1b8641){var _0x540caa=_0x1b8641[_0x6db7('0x1b0')]/0x64;var _0x19e1e3=_0x1b8641[_0x6db7('0x5f')]/(_0x1b8641[_0x6db7('0x5f')]+_0x1b8641[_0x6db7('0x5a')]);var _0x3ded76=Math[_0x6db7('0x1b1')](_0x1b8641[_0x6db7('0x6b')]*(_0x1b8641[_0x6db7('0x1b2')]/0x64));var _0x370ae7=Math[_0x6db7('0x1b1')](_0x1b8641[_0x6db7('0x6b')]*(_0x1b8641[_0x6db7('0x1b3')]/0x64));var _0x1d766a=_0x1b8641[_0x6db7('0x9b')]+_0x1b8641[_0x6db7('0x51')];var _0xadaa3a=Math[_0x6db7('0x1b4')](_0x1b8641[_0x6db7('0x86')]*_0x1b8641['erlangAbandonmentRate']*_0x1b8641['predictiveIntervalHitRate']*_0x1b8641[_0x6db7('0x6a')]);if(_[_0x6db7('0x3d')](_0x1b8641[_0x6db7('0x29')])){if(!_[_0x6db7('0x3d')](_0x1b8641[_0x6db7('0x28')])){_0x1b8641['startPredictive']=undefined;loggerPredictive['error'](_0x6db7('0x1b5'),_0x6db7('0x1b6'));}if(!_[_0x6db7('0x3d')](_0x1b8641[_0x6db7('0x8b')])){loggerPredictive[_0x6db7('0x90')](_0x6db7('0x1b5'),_0x6db7('0x1b7'));clearInterval(_0x1b8641[_0x6db7('0x8b')]);_0x1b8641[_0x6db7('0x8b')]=undefined;}_0x1b8641[_0x6db7('0x29')]=moment()[_0x6db7('0x74')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x6db7('0x7a')](_0x1b8641[_0x6db7('0x40')],_0x6db7('0x1b8'),_0x1b8641[_0x6db7('0x29')]);this[_0x6db7('0x1b9')](_0x1b8641,0x1);}else if(ifInterval(_0x1b8641['dialPredictiveInterval'],_0x1b8641[_0x6db7('0x29')])){this['handlePower'](_0x1b8641,0x1);loggerPredictiveCalls[_0x6db7('0x7a')](_0x6db7('0x1ba'),_0x1b8641[_0x6db7('0x29')],_0x1b8641[_0x6db7('0x40')]);_0x1b8641[_0x6db7('0x86')]=0x0;_0x1b8641[_0x6db7('0x68')]=0x0;}else if(_0x540caa<_0x19e1e3&&_0x1b8641[_0x6db7('0x1bb')]===_0x6db7('0x1bc')){freeVariablesPredictive(_0x1b8641);loggerPredictive['info'](_0x6db7('0x1bd'),_0x6db7('0x1be'),_0x19e1e3,'startProgressive',_0x1b8641[_0x6db7('0x40')]);}else if(_0xadaa3a<_0x1b8641['predictiveIntervalErlangCallsDroppedCalls']&&_0x1b8641[_0x6db7('0x1bb')]===_0x6db7('0x1bc')){freeVariablesPredictive(_0x1b8641);loggerPredictive['info'](_0x6db7('0x1bf'),_0x6db7('0x1c0'),_0xadaa3a,_0x6db7('0x1c1'),_0x1b8641[_0x6db7('0x68')],_0x6db7('0x29'),_0x1b8641[_0x6db7('0x40')]);}else if(!ifInterval(_0x1b8641[_0x6db7('0x1c2')],_0x1b8641[_0x6db7('0x29')])&&_['isUndefined'](_0x1b8641[_0x6db7('0x28')])&&!_[_0x6db7('0x3d')](_0x1b8641[_0x6db7('0x29')])){_0x1b8641[_0x6db7('0x28')]=moment()[_0x6db7('0x74')](_0x6db7('0xee'));loggerPredictive['info'](_0x1b8641[_0x6db7('0x40')],_0x6db7('0x1c3'),_0x1b8641[_0x6db7('0x28')]);this[_0x6db7('0xb4')](_0x1b8641[_0x6db7('0x1c2')])[_0x6db7('0xb1')](this[_0x6db7('0x1c4')](_0x1b8641))[_0x6db7('0xb1')](mergeDataErlangB(_0x1b8641))['then'](this[_0x6db7('0x1c5')](_0x1b8641))[_0x6db7('0xab')](loggerCatchPredictive(_0x6db7('0x1c6'),_0x1b8641));}else if(!ifInterval(_0x1b8641['dialPredictiveInterval'],_0x1b8641['startPredictive'])){_0x1b8641['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x1b8641[_0x6db7('0x28')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x6db7('0x7a')](_0x1b8641['name'],_0x6db7('0x1c7'),_0x1b8641[_0x6db7('0x28')]);clearInterval(_0x1b8641[_0x6db7('0x8b')]);_0x1b8641[_0x6db7('0x8b')]=undefined;this[_0x6db7('0xb4')](_0x1b8641[_0x6db7('0x1c2')])[_0x6db7('0xb1')](this['getDataPredictive'](_0x1b8641))[_0x6db7('0xb1')](mergeDataErlangB(_0x1b8641))[_0x6db7('0xb1')](this[_0x6db7('0x1c5')](_0x1b8641))[_0x6db7('0xab')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x1b8641));}else if(_0x1b8641[_0x6db7('0x6b')]&&_0x1d766a<_0x1b8641[_0x6db7('0x6b')]-_0x370ae7){freeVariablesPredictive(_0x1b8641);loggerPredictive[_0x6db7('0x7a')](_0x1b8641[_0x6db7('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1d766a,_0x6db7('0x1c8'),_0x1b8641[_0x6db7('0x6b')],'-',_0x370ae7,'=',_0x1b8641['predictiveIntervalAvailable']-_0x370ae7,')');}else if(_0x1b8641[_0x6db7('0x6b')]&&_0x1d766a>_0x1b8641[_0x6db7('0x6b')]+_0x3ded76){freeVariablesPredictive(_0x1b8641);loggerPredictive[_0x6db7('0x7a')](_0x1b8641['name'],_0x6db7('0x1c9'),_0x1d766a,_0x6db7('0x1ca'),_0x1b8641[_0x6db7('0x6b')],'+',_0x3ded76,'=',_0x1b8641[_0x6db7('0x6b')]+_0x3ded76,')');}};Dialer[_0x6db7('0x1a')][_0x6db7('0x1c4')]=function(_0x1d28c5){var _0x59d4f7=this;return function(_0x20ae16){return new BPromise(function(_0x440509,_0x4e0892){_[_0x6db7('0xc1')](_0x1d28c5,_0x20ae16[0x0]);if(checkGetDataPredictive(_0x20ae16[0x0])){var _0xdc0b54=_0x1d28c5['predictiveIntervalAvailable']=_0x1d28c5['talking']+_0x1d28c5[_0x6db7('0x9b')];var _0x1a6578=_0x1d28c5[_0x6db7('0x1c2')]*0x3c;var _0x132543=_0x20ae16[0x0]['predictiveIntervalAvgTalktime']+_0x20ae16[0x0][_0x6db7('0x64')];var _0x5e435a=(_0x20ae16[0x0][_0x6db7('0x63')]+_0x20ae16[0x0][_0x6db7('0x66')]+_0x20ae16[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x20ae16[0x0][_0x6db7('0x6c')];_0x1d28c5[_0x6db7('0x69')]=_0x5e435a>0x0?_0x5e435a:0x1;switch(_0x1d28c5[_0x6db7('0x1bb')]){case _0x6db7('0x1bc'):var _0x22f9a5=_0x1d28c5[_0x6db7('0x1b0')]/0x64;return _0x59d4f7[_0x6db7('0x1cb')](_0xdc0b54,_0x1a6578,_0x132543,_0x5e435a,_0x22f9a5)['then'](function(_0x4144d0){return _0x440509(_0x4144d0);});case _0x6db7('0x1cc'):var _0x3988c4=_0x1d28c5['dialPredictiveOptimizationPercentage']/0x64;return _0x59d4f7[_0x6db7('0x1cd')](_0xdc0b54,_0x1a6578,_0x132543,_0x5e435a,_0x3988c4)[_0x6db7('0xb1')](function(_0x35ec53){return _0x440509(_0x35ec53);});default:return _0x4e0892(msgResponse(_0x6db7('0x1ce'),'Failure',_0x6db7('0x1cf')));}}else{return _0x4e0892(msgResponse(_0x6db7('0x1ce'),_0x6db7('0x131'),_0x6db7('0x1d0')));}});};};Dialer[_0x6db7('0x1a')][_0x6db7('0x1d1')]=function(_0x4df0b0){var _0x46a872=this;return function(_0x21ac34){return new BPromise(function(_0x1ade6f,_0x3d2877){_[_0x6db7('0xc1')](_0x4df0b0,_0x21ac34[0x0]);if(checkGetDataPredictive(_0x21ac34[0x0])){loggerPredictive['info'](JSON['stringify'](_0x21ac34[0x0]));if(_0x4df0b0[_0x6db7('0x1bb')]===_0x6db7('0x1bc')){return _0x46a872[_0x6db7('0xbb')](_0x4df0b0['id'])['then'](function(_0x22bc5a){var _0x32def9=_0x4df0b0['loggedIn']-_0x22bc5a[0x0][_0x6db7('0x1d2')];var _0x49b37b=_0x4df0b0[_0x6db7('0x1c2')]*0x3c;var _0x19790d=_0x21ac34[0x0]['predictiveIntervalAvgTalktime']+_0x21ac34[0x0]['predictiveIntervalAvgHoldtime'];var _0xc81c48=(_0x21ac34[0x0][_0x6db7('0x63')]+_0x21ac34[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x21ac34[0x0][_0x6db7('0x7d')])/_0x21ac34[0x0]['predictiveIntervalTotalCalls'];var _0xba0005=_0x4df0b0[_0x6db7('0x1b0')]/0x64;_0x4df0b0[_0x6db7('0x1d3')]=_0x22bc5a[0x0]['outboundQueuePauses']||0x0;_0x4df0b0[_0x6db7('0x69')]=_0xc81c48>0x0?_0xc81c48:0x1;return _0x46a872[_0x6db7('0x1cb')](_0x32def9,_0x49b37b,_0x19790d,_0xc81c48,_0xba0005);})[_0x6db7('0xb1')](function(_0x2ffe6a){return _0x1ade6f(_0x2ffe6a);})[_0x6db7('0xab')](function(_0x49312d){return _0x3d2877(msgResponse(_0x6db7('0x1d4'),_0x6db7('0x131'),JSON[_0x6db7('0x72')](_0x49312d)));});}if(_0x4df0b0['dialPredictiveOptimization']===_0x6db7('0x1cc')){return _0x46a872['getVoiceQueueRtPauses'](_0x4df0b0['id'])[_0x6db7('0xb1')](function(_0x1bb411){var _0x123be1=_0x4df0b0['loggedIn']-_0x1bb411[0x0]['outboundQueuePauses'];var _0x29ed8a=_0x4df0b0['dialPredictiveInterval']*0x3c;var _0x4dd711=_0x21ac34[0x0][_0x6db7('0x65')]+_0x21ac34[0x0][_0x6db7('0x64')];var _0x1a3ad1=(_0x21ac34[0x0][_0x6db7('0x63')]+_0x21ac34[0x0][_0x6db7('0x66')]+_0x21ac34[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x21ac34[0x0]['predictiveIntervalTotalCalls'];var _0x18abf2=_0x4df0b0[_0x6db7('0x1b0')]/0x64;_0x4df0b0[_0x6db7('0x1d3')]=_0x1bb411[0x0][_0x6db7('0x1d2')]||0x0;_0x4df0b0['predictiveIntervalHitRate']=_0x1a3ad1>0x0?_0x1a3ad1:0x1;return _0x46a872[_0x6db7('0x1cd')](_0x123be1,_0x29ed8a,_0x4dd711,_0x1a3ad1,_0x18abf2);})[_0x6db7('0xb1')](function(_0x2a4975){return _0x1ade6f(_0x2a4975);})[_0x6db7('0xab')](function(_0x514c1a){return _0x3d2877(msgResponse(_0x6db7('0x1d4'),_0x6db7('0x131'),JSON[_0x6db7('0x72')](_0x514c1a)));});}}else{return _0x3d2877(msgResponse(_0x6db7('0x1ce'),'Failure',_0x6db7('0x1d0')));}});};};Dialer[_0x6db7('0x1a')][_0x6db7('0x1c5')]=function(_0x355da5){var _0x26f094=this;return function(){var _0xd71bb6=0x0;var _0x4aeb31=Math['floor'](_0x355da5[_0x6db7('0x6d')]*0x3e8);if(_0x4aeb31>0x0){_0x4aeb31=_0x4aeb31<0x64?0x64:_0x4aeb31;loggerPredictive[_0x6db7('0x7a')](_0x355da5[_0x6db7('0x40')],_0x6db7('0x1d5'),_0x4aeb31,'milliseconds');_0x355da5[_0x6db7('0x8b')]=setInterval(function(){_0x26f094[_0x6db7('0x8b')](_0x355da5);loggerPredictiveCalls[_0x6db7('0x7a')](_0x6db7('0x1d6'),_0xd71bb6+=0x1);},_0x4aeb31);}else{loggerPredictive['info'](_0x355da5[_0x6db7('0x40')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x6db7('0x1d7')]=function(_0x337b7a,_0xbd27f1){var _0x26e387=this;return function(_0x10ae7d){if(_[_0x6db7('0x47')](_0x10ae7d)){if(_[_0x6db7('0xa7')](_0xbd27f1[_0x6db7('0xc4')])||!_0xbd27f1['recallme']){if(_0x337b7a['dialMethod']===_0x6db7('0x9')){_0x337b7a[_0x6db7('0x118')]=_[_0x6db7('0x3d')](_0x337b7a[_0x6db7('0x118')])?!![]:_0x337b7a[_0x6db7('0x118')];var _0x49aca2=uuid['v4']();_0x26e387['actions'][_0x49aca2]=new Action(_0x337b7a,_0xbd27f1,_0x49aca2);loggerBooked[_0x6db7('0x7a')](_0x6db7('0x1d8'),_0x49aca2,_0x6db7('0x1d9'),JSON[_0x6db7('0x72')](_0x337b7a[_0x6db7('0x118')]),_0x6db7('0x1da'),_0x337b7a[_0x6db7('0x40')]);if(_0x337b7a[_0x6db7('0x118')]){_0x337b7a[_0x6db7('0x118')]=![];_0x26e387['queueBooked'][_0x26e387[_0x6db7('0x25')][_0x49aca2][_0x6db7('0xad')]]=[];ami[_0x6db7('0xa8')]({'actionid':_0x49aca2,'action':_0x6db7('0x1db'),'queue':_0x337b7a[_0x6db7('0x40')]})[_0x6db7('0xab')](function(){_0x26e387['updateOriginated'](_0x337b7a);_0x26e387['rescheduleContact']({'active':![],'ContactId':_0x26e387[_0x6db7('0x25')][_0x49aca2]['ContactId'],'ListId':_0x26e387[_0x6db7('0x25')][_0x49aca2][_0x6db7('0xc3')],'VoiceQueueId':_0x26e387[_0x6db7('0x25')][_0x49aca2][_0x6db7('0xc5')]||undefined,'CampaignId':_0x26e387['actions'][_0x49aca2][_0x6db7('0xc6')]||undefined})['catch'](loggerCatch(_0x6db7('0x1dc')));delete _0x26e387[_0x6db7('0x25')][_0x49aca2];});}else{loggerBooked[_0x6db7('0x7a')](_0x6db7('0x1dd'),JSON['stringify'](_0x337b7a[_0x6db7('0x118')]),_0x6db7('0x1da'),_0x337b7a[_0x6db7('0x40')]);_0x26e387[_0x6db7('0xac')](_0x337b7a);_0x26e387[_0x6db7('0xeb')]({'active':![],'ContactId':_0x26e387['actions'][_0x49aca2][_0x6db7('0xef')],'ListId':_0x26e387[_0x6db7('0x25')][_0x49aca2][_0x6db7('0xc3')],'VoiceQueueId':_0x26e387[_0x6db7('0x25')][_0x49aca2][_0x6db7('0xc5')]||undefined,'CampaignId':_0x26e387[_0x6db7('0x25')][_0x49aca2][_0x6db7('0xc6')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x26e387[_0x6db7('0x25')][_0x49aca2];}}else{return _0x26e387[_0x6db7('0x151')](_0x337b7a,_0xbd27f1);}}else{if(getDiff(_0xbd27f1['scheduledat'])<_0x337b7a[_0x6db7('0x1de')]*0x3c){if(_0xbd27f1[_0x6db7('0x1df')]&&!_0xbd27f1['Agent'][_0x6db7('0x1e0')]){_0x26e387[_0x6db7('0x1e1')]['run'](_0xbd27f1['id'])[_0x6db7('0x1d')](function(){_0x26e387[_0x6db7('0xac')](_0x337b7a);});}else{_0x26e387['unlockContact']({'active':![]},_0xbd27f1['id'],0x1)[_0x6db7('0x1d')](function(){_0x26e387['updateOriginated'](_0x337b7a);});}}else{_0x337b7a[_0x6db7('0x62')]+=0x1;_0x26e387['updateOriginated'](_0x337b7a);if(_0x337b7a[_0x6db7('0x1e2')]){_0x26e387[_0x6db7('0xeb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xbd27f1[_0x6db7('0xef')],'ListId':_0xbd27f1[_0x6db7('0xc3')],'VoiceQueueId':_0xbd27f1['VoiceQueueId']||undefined,'CampaignId':_0xbd27f1[_0x6db7('0xc6')]||undefined})['catch'](loggerCatch(_0x6db7('0x1e3')));_0x26e387[_0x6db7('0xbd')](createObjHistory(_0x337b7a,_0xbd27f1,_0x6db7('0x1e4'),0x17,_0x6db7('0x1e5')))[_0x6db7('0xab')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x26e387['saveInDb'](createObjHistory(_0x337b7a,_0xbd27f1,_0x6db7('0x1e6'),0x16,_0x6db7('0x1e7')),_0x6db7('0x1e8'),_0x6db7('0x1e9'));}}}}else{_0x337b7a['outboundBlacklistCallsDay']+=0x1;_0x26e387['saveInDb'](createObjHistory(_0x337b7a,_0xbd27f1,_0x6db7('0x1ea'),0xd,_0x6db7('0x1eb')),_0x6db7('0x1ec'),_0x6db7('0x1ed'));throw _0x6db7('0x1ee');}};};Dialer[_0x6db7('0x1a')][_0x6db7('0x1ef')]=function(_0x54fb1d){var _0x41df83=this;var _0xe957b7=_0x54fb1d[_0x6db7('0x1f0')]-_0x54fb1d['originated']-_0x54fb1d[_0x6db7('0xb8')];emitCampaignSummary(_0x54fb1d);if(_0xe957b7>0x0){if(_0xe957b7>this[_0x6db7('0x23')]){_0xe957b7=this[_0x6db7('0x23')];}_0x54fb1d[_0x6db7('0xb8')]+=_0xe957b7;this[_0x6db7('0xb9')](_0x54fb1d['id'],_0xe957b7,_0x54fb1d[_0x6db7('0x1f1')],_0x54fb1d)[_0x6db7('0xb1')](function(_0x18a397){_0x54fb1d[_0x6db7('0xb8')]-=_0xe957b7;_0x54fb1d[_0x6db7('0xb8')]=_0x54fb1d[_0x6db7('0xb8')]>0x0?_0x54fb1d[_0x6db7('0xb8')]:0x0;if(!checkContactEmpty(_0x18a397)){_0x54fb1d[_0x6db7('0x3e')]=_0x6db7('0x1f2');logger[_0x6db7('0x7a')](_0x6db7('0x1f3')+_0x54fb1d[_0x6db7('0x40')]);}else{_0x54fb1d['originated']+=_0x18a397[_0x6db7('0x93')];_0x54fb1d[_0x6db7('0x3e')]=_0x6db7('0x1f4');for(var _0x407ce8=0x0;_0x407ce8<_0x18a397[_0x6db7('0x93')];_0x407ce8+=0x1){_0x54fb1d[_0x6db7('0x1f5')]+=0x1;if(_[_0x6db7('0xa7')](_0x18a397[_0x407ce8])||_['isNil'](_0x18a397[_0x407ce8][_0x6db7('0x155')])||_[_0x6db7('0xa7')](_0x18a397[_0x407ce8][_0x6db7('0x155')]['phone'])){_0x41df83[_0x6db7('0x1f6')](_0x6db7('0x1f7'),_0x54fb1d,_0x18a397[_0x407ce8]);}else{_0x41df83['checkIsBlackListIvr'](_[_0x6db7('0xc2')](_0x18a397[_0x407ce8],[_0x6db7('0xc6'),'Contact.phone']))[_0x6db7('0xb1')](_0x41df83[_0x6db7('0x1d7')](_0x54fb1d,_0x18a397[_0x407ce8]))[_0x6db7('0xab')](_0x41df83['loggerHandler'](_0x6db7('0x1f8'),_0x54fb1d));}}}})[_0x6db7('0xab')](loggerGetContactDialer(_0x6db7('0x1f9'),_0x54fb1d,_0xe957b7));}};Dialer['prototype']['handlePower']=function(_0x2f44f3,_0x2588ec){var _0x43f5a2=this;var _0x3bd5d0=[];var _0xfa0fdf=_0x2588ec>=0x1?_0x2588ec:0x1;if(_0x2f44f3[_0x6db7('0x55')]==='booked'){_0xfa0fdf=0x1;}var _0x5e5e85=Math[_0x6db7('0x1b4')](_0x2f44f3[_0x6db7('0x9b')]*_0xfa0fdf)-_0x2f44f3[_0x6db7('0x94')]-_0x2f44f3[_0x6db7('0xb8')];emitVoiceQueueSummary(_0x2f44f3);if(_0x2f44f3['dialLimitQueue']>0x0){var _0x35a757=_0x2f44f3[_0x6db7('0x1fa')]-_0x2f44f3[_0x6db7('0x94')]-_0x2f44f3['talking']-_0x2f44f3[_0x6db7('0xb8')]-_0x2f44f3[_0x6db7('0x4f')];if(_0x5e5e85>_0x35a757){_0x5e5e85=_0x35a757;}}if(_0x5e5e85>0x0){if(_0x2f44f3[_0x6db7('0x55')]===_0x6db7('0x9')){_0x5e5e85=0x1;}if(_0x5e5e85>this['maxNumberOriginate']){_0x5e5e85=this[_0x6db7('0x23')];}_0x2f44f3[_0x6db7('0xb8')]+=_0x5e5e85;for(var _0x2d6430 in this[_0x6db7('0x21')]){if(typeof this['agents'][_0x2d6430]!==_0x6db7('0x95')){if(this[_0x6db7('0x21')][_0x2d6430][_0x6db7('0xd6')]===_0x6db7('0x1fb')&&this[_0x6db7('0x21')][_0x2d6430][_0x6db7('0xa9')]===_0x6db7('0x1fc')){_0x3bd5d0[_0x6db7('0x115')](this['agents'][_0x2d6430]['id']);}}}this[_0x6db7('0xb7')](_0x2f44f3['id'],_0x3bd5d0,_0x5e5e85,_0x2f44f3[_0x6db7('0x1f1')],_0x2f44f3)[_0x6db7('0xb1')](function(_0x42d894){_0x2f44f3['temp']-=_0x5e5e85;_0x2f44f3['temp']=_0x2f44f3[_0x6db7('0xb8')]>0x0?_0x2f44f3[_0x6db7('0xb8')]:0x0;if(!checkContactEmpty(_0x42d894)){_0x43f5a2[_0x6db7('0x1fd')](_0x2f44f3)[_0x6db7('0xb1')](sendMessageReschedule(_0x2f44f3))[_0x6db7('0xab')](loggerCatch(_0x6db7('0x1fe')));}else{_0x2f44f3[_0x6db7('0x94')]+=_0x42d894[_0x6db7('0x93')];_0x2f44f3[_0x6db7('0x3e')]=_0x2f44f3[_0x6db7('0x55')]===_0x6db7('0x9')?_0x6db7('0x15e'):_0x6db7('0x1f4');for(var _0xb3cb16=0x0;_0xb3cb16<_0x42d894[_0x6db7('0x93')];_0xb3cb16+=0x1){if(_[_0x6db7('0xa7')](_0x42d894[_0xb3cb16])||_[_0x6db7('0xa7')](_0x42d894[_0xb3cb16][_0x6db7('0x155')])||_[_0x6db7('0xa7')](_0x42d894[_0xb3cb16][_0x6db7('0x155')][_0x6db7('0x156')])){_0x43f5a2[_0x6db7('0x1f6')](_0x6db7('0x1f7'),_0x2f44f3,_0x42d894[_0xb3cb16]);}else{_0x43f5a2[_0x6db7('0xb0')](_[_0x6db7('0xc2')](_0x42d894[_0xb3cb16],['VoiceQueueId',_0x6db7('0x1ff')]))[_0x6db7('0xb1')](_0x43f5a2['checkContactBlack'](_0x2f44f3,_0x42d894[_0xb3cb16]))[_0x6db7('0xab')](_0x43f5a2[_0x6db7('0xbe')](_0x6db7('0x1f7'),_0x2f44f3));}}}})['catch'](loggerGetContactDialer(_0x6db7('0x200'),_0x2f44f3,_0x5e5e85));}};Dialer[_0x6db7('0x1a')][_0x6db7('0x8b')]=function(_0x565ace){if(_0x565ace[_0x6db7('0x1fa')]>0x0){var _0x2f0997=_0x565ace[_0x6db7('0x1fa')]-_0x565ace['originated']-_0x565ace['talking'];if(_0x2f0997>0x0){this['tryOriginatePredictive'](_0x565ace);}else{loggerPredictiveCalls[_0x6db7('0x7a')](_0x6db7('0x201'));}}else{this[_0x6db7('0x202')](_0x565ace);}};Dialer[_0x6db7('0x1a')][_0x6db7('0x202')]=function(_0x554b5c){var _0x3fbb0f=this;var _0xb12fb3=[];_0x554b5c[_0x6db7('0x94')]+=0x1;for(var _0x4e31d6 in this['agents']){if(typeof this['agents'][_0x4e31d6]!=='undefined'){if(this[_0x6db7('0x21')][_0x4e31d6][_0x6db7('0xd6')]===_0x6db7('0x1fb')&&this[_0x6db7('0x21')][_0x4e31d6][_0x6db7('0xa9')]===_0x6db7('0x1fc')){_0xb12fb3['push'](this['agents'][_0x4e31d6]['id']);}}}this[_0x6db7('0xb7')](_0x554b5c['id'],_0xb12fb3,0x1,_0x554b5c[_0x6db7('0x1f1')],_0x554b5c)[_0x6db7('0xb1')](function(_0x44ea46){if(!checkContactEmpty(_0x44ea46)){checkContactLowerLimitOriginate(_0x554b5c,0x1,0x0);_0x3fbb0f['countReScheduled'](_0x554b5c)[_0x6db7('0xb1')](sendMessageReschedule(_0x554b5c))[_0x6db7('0xab')](loggerCatch(_0x6db7('0x1fe')));}else{_0x554b5c[_0x6db7('0x3e')]=_0x6db7('0x1f4');if(_['isNil'](_0x44ea46[0x0])||_[_0x6db7('0xa7')](_0x44ea46[0x0][_0x6db7('0x155')])||_[_0x6db7('0xa7')](_0x44ea46[0x0]['Contact'][_0x6db7('0x156')])){_0x3fbb0f[_0x6db7('0x1f6')](_0x6db7('0x1f7'),_0x554b5c,_0x44ea46[0x0]);}else{_0x3fbb0f[_0x6db7('0xb0')](_[_0x6db7('0xc2')](_0x44ea46[0x0],[_0x6db7('0xc5'),'Contact.phone']))[_0x6db7('0xb1')](_0x3fbb0f['checkContactBlack'](_0x554b5c,_0x44ea46[0x0]))[_0x6db7('0xab')](_0x3fbb0f['loggerHandler'](_0x6db7('0x203'),_0x554b5c));}}})['catch'](loggerGetContactDialer(_0x6db7('0x204'),_0x554b5c,0x1));emitVoiceQueueSummary(_0x554b5c);};Dialer['prototype'][_0x6db7('0x1cb')]=function(_0x46981d,_0x5ab291,_0x22f527,_0xc47df2,_0x1693ae,_0x5f01bc){loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x205'));loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x206'),_0x46981d);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x207'),_0x5ab291);loggerPredictive[_0x6db7('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',_0x22f527);loggerPredictive[_0x6db7('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',_0xc47df2);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x208'),_0x1693ae);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x80'));return new BPromise(function(_0x3a31ca,_0x37678d){if(_0x46981d<=0x0||isNaN(_0x46981d)){return _0x37678d(msgResponse('[abandonmentRate]','Error',_0x6db7('0x209')+_0x46981d));}if(_0x22f527<=0x0||isNaN(_0x22f527)){return _0x37678d(msgResponse('[abandonmentRate]',_0x6db7('0x48'),_0x6db7('0x20a')+_0x22f527));}if(_0xc47df2<=0x0||isNaN(_0xc47df2)){return _0x37678d(msgResponse(_0x6db7('0x20b'),'Error','p\x20=\x20'+_0xc47df2));}if(_0x5ab291<=0x0||isNaN(_0x5ab291)){return _0x37678d(msgResponse(_0x6db7('0x20b'),'Error','interval\x20=\x20'+_0x5ab291));}if(_0x1693ae<=0x0||isNaN(_0x1693ae)){return _0x37678d(msgResponse(_0x6db7('0x20b'),'Error',_0x6db7('0x20c')+_0x1693ae));}_0x5f01bc=_0x5f01bc||0x0;var _0x34de3a=0x1/_0x22f527;var _0x3937e8=0x0;var _0x211c64=0x0;var _0x221e86=0x0;var _0x67f605=0x0;for(var _0x43e702=0x0;_0x221e86<_0x1693ae;_0x43e702+=0x1){_0x211c64=_0x43e702/_0x5ab291;_0x3937e8=(_0xc47df2*_0x211c64+_0x5f01bc)/_0x34de3a;_0x221e86=erlangb(_0x3937e8,_0x46981d);_0x67f605=_0x3937e8/_0x46981d*(0x1-erlangb(_0x3937e8,_0x46981d));}return _0x3a31ca({'erlangCalls':_0x43e702,'erlangCallToSecond':_0x5ab291/_0x43e702,'erlangAbandonmentRate':_0x221e86,'erlangBusyFactor':_0x67f605});});};Dialer[_0x6db7('0x1a')][_0x6db7('0x1cd')]=function(_0x2276e5,_0xa2f696,_0x1cb2de,_0x2d318f,_0x3c57eb,_0x196068){loggerPredictive[_0x6db7('0x7a')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info']('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',_0x2276e5);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x207'),_0xa2f696);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x20d'),_0x1cb2de);loggerPredictive[_0x6db7('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',_0x2d318f);loggerPredictive[_0x6db7('0x7a')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c57eb);loggerPredictive[_0x6db7('0x7a')](_0x6db7('0x80'));return new BPromise(function(_0x9a1721,_0x5a2b6c){if(_0x2276e5<=0x0||isNaN(_0x2276e5)){return _0x5a2b6c(msgResponse(_0x6db7('0x20e'),'Error','m\x20=\x20'+_0x2276e5));}if(_0x1cb2de<=0x0||isNaN(_0x1cb2de)){return _0x5a2b6c(msgResponse(_0x6db7('0x20e'),_0x6db7('0x48'),'Ts\x20=\x20'+_0x1cb2de));}if(_0x2d318f<=0x0||isNaN(_0x2d318f)){return _0x5a2b6c(msgResponse('[busyFactor]',_0x6db7('0x48'),_0x6db7('0x20f')+_0x2d318f));}if(_0xa2f696<=0x0||isNaN(_0xa2f696)){return _0x5a2b6c(msgResponse('[busyFactor]',_0x6db7('0x48'),_0x6db7('0x210')+_0xa2f696));}if(_0x3c57eb<=0x0||isNaN(_0x3c57eb)){return _0x5a2b6c(msgResponse('[busyFactor]',_0x6db7('0x48'),_0x6db7('0x211')+_0x3c57eb));}_0x196068=_0x196068||0x0;var _0x68644f=0x1/_0x1cb2de;var _0x7f3b76=0x0;var _0x57ee40=0x0;var _0x407ffb=0x0;var _0x5387c4=0x0;for(var _0x6db34c=0x0;_0x5387c4<_0x3c57eb;_0x6db34c+=0x1){_0x57ee40=_0x6db34c/_0xa2f696;_0x7f3b76=(_0x2d318f*_0x57ee40+_0x196068)/_0x68644f;_0x407ffb=erlangb(_0x7f3b76,_0x2276e5);_0x5387c4=_0x7f3b76/_0x2276e5*(0x1-erlangb(_0x7f3b76,_0x2276e5));}return _0x9a1721({'erlangCalls':_0x6db34c,'erlangCallToSecond':_0xa2f696/_0x6db34c,'erlangAbandonmentRate':_0x407ffb,'erlangBusyFactor':_0x5387c4});});};module[_0x6db7('0x212')]=Dialer; \ No newline at end of file +var _0x5ebe=['NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','[getDataPredictive]','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','busyFactor','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','ACTIVE','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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','Ts\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Interval:\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','defaults','localhost','socket.io-emitter','redis','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','127.0.0.1','rrmemory','roundrobin','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startProgressive','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','loopClearZombieChannels','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','originated','erlangCalls','erlangBusyFactor','startPredictive','Trunk','active','callerid','stringify','format','voice:queue:%s','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','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','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','---------------------------','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','sendMessageOneNotActive','is\x20disactive','state','statedesc','starttime','prototype','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','channel','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','resolve','countReScheduled','catch','checkIsBlackList','[checkIsBlackList]\x20','then','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','VoiceQueueId','CampaignId','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','status','unmonitored','uniqueid','variable','exten','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','dialAMDActive','value','MACHINE','membername','countmachineretry','countcongestionretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','Machine','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','reason19\x20machine....','reason\x2019\x20machine....','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Unknow','reason','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','actionid','locked','stateinterface','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','loopCampaigns','checkIsTrunkReachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','iftime\x20%s,%s','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','launchHandleIvr','checkIfTimeIntervals','dialTimezone','syncCampaigns','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','trim','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5ebe,0x69));var _0xe5eb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5ebe[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require(_0xe5eb('0x0'));var BPromise=require(_0xe5eb('0x1'));var uuid=require(_0xe5eb('0x2'));var moment=require(_0xe5eb('0x3'));var rr=require('rr');var md5=require(_0xe5eb('0x4'));var Redis=require(_0xe5eb('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0xe5eb('0x6'))(_0xe5eb('0x7'));var loggerBooked=require(_0xe5eb('0x6'))(_0xe5eb('0x8'));var loggerPredictive=require(_0xe5eb('0x6'))(_0xe5eb('0x9'));var loggerPredictiveCalls=require(_0xe5eb('0x6'))(_0xe5eb('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require('../ami');config['redis']=_[_0xe5eb('0xb')](config['redis'],{'host':_0xe5eb('0xc'),'port':0x18eb});var io=require(_0xe5eb('0xd'))(new Redis(config[_0xe5eb('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xe5eb('0xf'));var cmHopperBlack=require(_0xe5eb('0x10'));var voiceQueueRt=require(_0xe5eb('0x11'));var Action=require(_0xe5eb('0x12'));var History=require(_0xe5eb('0x13'));var Final=require('./final');var AgentComplete=require(_0xe5eb('0x14'));var QueueCallerAbandon=require(_0xe5eb('0x15'));var Hangup=require(_0xe5eb('0x16'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xe5eb('0x17');var strategy={'rrmemory':_0xe5eb('0x18'),'roundrobin':_0xe5eb('0x19')};var Sequence=function(){};Sequence['prototype'][_0xe5eb('0x1a')]=function(_0x346772){this['tail']=this[_0xe5eb('0x1b')]?this['tail']['finally'](_0x346772):_0x346772();};function Dialer(_0x4e0ce1,_0x386733){this[_0xe5eb('0x1c')]=new Sequence();this['preview']=_0x386733;this[_0xe5eb('0x1d')]=_0x4e0ce1['voiceQueues'];this[_0xe5eb('0x1e')]=_0x4e0ce1[_0xe5eb('0x1e')];this[_0xe5eb('0x1f')]=_0x4e0ce1[_0xe5eb('0x1f')];this['trunks']=_0x4e0ce1[_0xe5eb('0x20')];this[_0xe5eb('0x21')]=config[_0xe5eb('0x21')]||0x2;this[_0xe5eb('0x22')]={};this[_0xe5eb('0x23')]={};this[_0xe5eb('0x24')]={};this[_0xe5eb('0x25')]={};this['optionPredictive']={};this['startPredictive']={};this[_0xe5eb('0x26')]={};this['ivrOriginated']={};this[_0xe5eb('0x27')]={};this[_0xe5eb('0x28')]={};ami['on']('agentconnect',this[_0xe5eb('0x29')][_0xe5eb('0x2a')](this));ami['on'](_0xe5eb('0x2b'),this['syncQueueCallerAbandon'][_0xe5eb('0x2a')](this));ami['on'](_0xe5eb('0x2c'),this[_0xe5eb('0x2d')]['bind'](this));ami['on'](_0xe5eb('0x2e'),this[_0xe5eb('0x2f')]['bind'](this));ami['on'](_0xe5eb('0x30'),this[_0xe5eb('0x31')][_0xe5eb('0x2a')](this));ami['on']('hangup',this[_0xe5eb('0x32')][_0xe5eb('0x2a')](this));ami['on'](_0xe5eb('0x33'),this[_0xe5eb('0x34')][_0xe5eb('0x2a')](this));ami['on']('varset',this[_0xe5eb('0x35')][_0xe5eb('0x2a')](this));ami['on'](_0xe5eb('0x36'),this[_0xe5eb('0x37')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xe5eb('0x2a')](this));this['loopCampaigns']();this[_0xe5eb('0x38')]();}function isNotNull(_0x225010){return _0x225010!==null&&!_['isUndefined'](_0x225010);}function checkIsLoggedIn(_0x11ad03,_0x2b844d){return function(){if(_0x2b844d<=0x0){_0x11ad03[_0xe5eb('0x39')]='AGENTS_NOT_LOGGED';throw _0x11ad03[_0xe5eb('0x3a')]+_0xe5eb('0x3b');}};}function isActive(_0x398938){return _0x398938;}function checkIsActive(_0x4ff4d8,_0x204615){return function(){if(!isActive(_0x204615)){_0x4ff4d8[_0xe5eb('0x39')]=_0xe5eb('0x3c');throw _0x4ff4d8[_0xe5eb('0x3a')]+_0xe5eb('0x3d');}};}function checkInterval(_0x5db472){return function(){if(!isNotNull(_0x5db472['Interval'])){_0x5db472['message']=_0xe5eb('0x3e');throw _0x5db472[_0xe5eb('0x3a')]+_0xe5eb('0x3f');}if(!isNotNull(_0x5db472[_0xe5eb('0x40')][_0xe5eb('0x41')])){_0x5db472[_0xe5eb('0x39')]=_0xe5eb('0x3e');throw _0x5db472['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x5db472['Interval'][_0xe5eb('0x41')]))){_0x5db472['message']=_0xe5eb('0x3e');throw _0x5db472[_0xe5eb('0x3a')]+_0xe5eb('0x3f');}};}function msgResponse(_0x5e2111,_0x2b8f59,_0xd88b68){return{'action':_0x5e2111,'response':_0x2b8f59,'message':_0xd88b68,'stack':_0xd88b68};}function myreject(_0x36ef22){return function(_0x50eb30){return _0x36ef22(msgResponse(_0xe5eb('0x42'),_0xe5eb('0x43'),JSON['stringify'](_0x50eb30)));};}function getSeconds(_0x4e9113,_0x5e87c7){var _0x312881=moment(_0x4e9113)['milliseconds'](0x0);var _0x36c153=moment(_0x5e87c7)[_0xe5eb('0x44')](0x0);return _0x312881[_0xe5eb('0x45')](_0x36c153,'seconds');}function emit(_0x102a09,_0xf68ecc,_0x5ec7cb){io['to'](_0x102a09)[_0xe5eb('0x46')](_0xf68ecc,_0x5ec7cb);}function emitVoiceQueueSummary(_0x159a61){if(_0x159a61[_0xe5eb('0x47')]===_0xe5eb('0x48')){var _0x5d2bbe={'id':_0x159a61['id'],'name':_0x159a61[_0xe5eb('0x3a')],'strategy':_0x159a61[_0xe5eb('0x49')],'answered':_0x159a61[_0xe5eb('0x4a')],'available':_0x159a61[_0xe5eb('0x4b')],'loggedIn':_0x159a61[_0xe5eb('0x4c')],'pTalking':_0x159a61[_0xe5eb('0x4d')],'sumBillable':_0x159a61[_0xe5eb('0x4e')],'sumDuration':_0x159a61[_0xe5eb('0x4f')],'sumHoldTime':_0x159a61['sumHoldTime']||0x0,'talking':_0x159a61[_0xe5eb('0x50')],'total':_0x159a61['total'],'type':_0x159a61[_0xe5eb('0x47')],'unmanaged':_0x159a61[_0xe5eb('0x51')],'abandoned':_0x159a61[_0xe5eb('0x52')],'waiting':_0x159a61[_0xe5eb('0x53')],'loggedInDb':_0x159a61[_0xe5eb('0x54')],'dialActive':_0x159a61[_0xe5eb('0x55')],'dialMethod':_0x159a61[_0xe5eb('0x56')],'dialOriginateCallerIdName':_0x159a61[_0xe5eb('0x57')],'dialOriginateCallerIdNumber':_0x159a61['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x159a61[_0xe5eb('0x58')],'dialPrefix':_0x159a61[_0xe5eb('0x59')],'outboundAnswerAgiCallsDay':_0x159a61[_0xe5eb('0x5a')],'outboundAnswerCallsDay':_0x159a61[_0xe5eb('0x5b')],'outboundBlacklistCallsDay':_0x159a61['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x159a61[_0xe5eb('0x5c')],'outboundCongestionCallsDay':_0x159a61[_0xe5eb('0x5d')],'outboundDropCallsDayACS':_0x159a61[_0xe5eb('0x5e')],'outboundDropCallsDayCallersExit':_0x159a61[_0xe5eb('0x5f')],'outboundDropCallsDayTimeout':_0x159a61[_0xe5eb('0x60')],'outboundNoAnswerCallsDay':_0x159a61['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x159a61[_0xe5eb('0x61')],'outboundOriginateFailureCallsDay':_0x159a61[_0xe5eb('0x62')],'outboundReCallsDay':_0x159a61[_0xe5eb('0x63')],'outboundRejectCallsDay':_0x159a61[_0xe5eb('0x64')],'outboundUnknownCallsDay':_0x159a61[_0xe5eb('0x65')],'predictiveIntervalAnsweredCalls':_0x159a61[_0xe5eb('0x66')],'predictiveIntervalAvgHoldtime':_0x159a61[_0xe5eb('0x67')],'predictiveIntervalAvgTalktime':_0x159a61[_0xe5eb('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x159a61[_0xe5eb('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x159a61[_0xe5eb('0x6a')],'predictiveIntervalErlangCalls':_0x159a61[_0xe5eb('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x159a61[_0xe5eb('0x6c')],'predictiveIntervalHitRate':_0x159a61[_0xe5eb('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x159a61[_0xe5eb('0x6e')],'predictiveIntervalPauses':_0x159a61['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x159a61['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x159a61[_0xe5eb('0x6f')],'message':_0x159a61[_0xe5eb('0x39')],'originated':_0x159a61[_0xe5eb('0x70')],'erlangCalls':_0x159a61[_0xe5eb('0x71')],'erlangCallToSecond':_0x159a61['erlangCallToSecond'],'erlangAbandonmentRate':_0x159a61['erlangAbandonmentRate'],'erlangBusyFactor':_0x159a61[_0xe5eb('0x72')],'startPredictive':_0x159a61[_0xe5eb('0x73')],'startProgressive':_0x159a61['startProgressive']};if(_0x159a61[_0xe5eb('0x74')]){_0x5d2bbe[_0xe5eb('0x74')]={'id':_0x159a61[_0xe5eb('0x74')]['id'],'name':_0x159a61[_0xe5eb('0x74')][_0xe5eb('0x3a')],'active':_0x159a61['Trunk'][_0xe5eb('0x75')],'callerid':_0x159a61['Trunk'][_0xe5eb('0x76')]};}if(_0x159a61[_0xe5eb('0x40')]){_0x5d2bbe['Interval']={'id':_0x159a61['Interval']['id'],'name':_0x159a61[_0xe5eb('0x40')][_0xe5eb('0x3a')]};}var _0x32ee6e=md5(JSON[_0xe5eb('0x77')](_0x5d2bbe));if(_0x159a61[_0xe5eb('0x4')]!==_0x32ee6e){_0x159a61[_0xe5eb('0x4')]=_0x32ee6e;emit(util[_0xe5eb('0x78')](_0xe5eb('0x79'),_0x5d2bbe['name']),'voice_queue:save',_0x5d2bbe);}}}function emitCampaignSummary(_0x202048){if(_0x202048[_0xe5eb('0x47')]==='ivr'){emit(util[_0xe5eb('0x78')](_0xe5eb('0x7a'),_0x202048['name']),_0xe5eb('0x7b'),_0x202048);}}function checkGetDataPredictive(_0x135639){if(isNotNull(_0x135639)&&!_[_0xe5eb('0x7c')](_0x135639)){loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x7e'));loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x7f'),_0x135639[_0xe5eb('0x6f')]);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x80'),_0x135639[_0xe5eb('0x66')]);loggerPredictive['info'](_0xe5eb('0x81'),_0x135639[_0xe5eb('0x6a')]);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x82'),_0x135639[_0xe5eb('0x69')]);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x83'),_0x135639[_0xe5eb('0x67')]);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x84'),_0x135639[_0xe5eb('0x68')]);loggerPredictive[_0xe5eb('0x7d')]('---------------------------');if(_0x135639[_0xe5eb('0x6f')]>0x0){if(!_['isUndefined'](_0x135639['predictiveIntervalAvgTalktime'])&&_0x135639[_0xe5eb('0x68')]>0x0){return!![];}loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x85'));if(!_[_0xe5eb('0x86')](_0x135639[_0xe5eb('0x67')])&&_0x135639['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x87'));}else{loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x88'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x143b28){return function(_0x2befb8){loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x89'));loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x8a'),_0x2befb8['erlangCalls']);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x8b'),_0x2befb8[_0xe5eb('0x8c')]);loggerPredictive['info'](_0xe5eb('0x8d'),_0x2befb8['erlangAbandonmentRate']);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x8e'),_0x2befb8[_0xe5eb('0x72')]);loggerPredictive['info'](_0xe5eb('0x8d'),_0x2befb8[_0xe5eb('0x8f')]);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x90'));_[_0xe5eb('0x91')](_0x143b28,_0x2befb8);};}function getDiff(_0x317944){var _0x150641=moment()[_0xe5eb('0x44')](0x0);var _0x37f3dc=moment(_0x317944)[_0xe5eb('0x44')](0x0);return _0x150641[_0xe5eb('0x45')](_0x37f3dc,_0xe5eb('0x92'));}function ifInterval(_0x2fb8dc,_0x3ded3b){if(_['isUndefined'](_0x3ded3b)){return![];}return getDiff(_0x3ded3b)<_0x2fb8dc*0x3c;}function freeVariablesPredictive(_0x52dd77){if(isNotNull(_0x52dd77)){if(!_[_0xe5eb('0x86')](_0x52dd77[_0xe5eb('0x26')])){_0x52dd77[_0xe5eb('0x26')]=undefined;loggerPredictive[_0xe5eb('0x7d')](_0x52dd77[_0xe5eb('0x3a')],_0xe5eb('0x93'));}if(!_[_0xe5eb('0x86')](_0x52dd77[_0xe5eb('0x73')])){_0x52dd77[_0xe5eb('0x73')]=undefined;loggerPredictive[_0xe5eb('0x7d')](_0x52dd77[_0xe5eb('0x3a')],_0xe5eb('0x94'));}if(!_[_0xe5eb('0x86')](_0x52dd77[_0xe5eb('0x95')])){clearInterval(_0x52dd77['handlePredictive']);_0x52dd77[_0xe5eb('0x95')]=undefined;loggerPredictive[_0xe5eb('0x7d')](_0x52dd77[_0xe5eb('0x3a')],_0xe5eb('0x96'));}}}function erlangb(_0x4737aa,_0x510515){if(_0x510515===0x0){return 0x0;}var _0x1e776d=0x1;for(var _0x38363=0x1;_0x38363<=_0x510515;_0x38363+=0x1){_0x1e776d=0x1+_0x1e776d*_0x38363/_0x4737aa;}return 0x1/_0x1e776d;}function isVoiceQueueOutbound(_0x347871){return _0x347871===_0xe5eb('0x48');}function isNotPreview(_0x5d33a9){return _0x5d33a9!==_0xe5eb('0x97');}function isCampaignIvr(_0x1bc5df){return _0x1bc5df===_0xe5eb('0x98');}function getCallerId(_0x91dc57,_0x2979d0,_0x365b68){if(!_[_0xe5eb('0x86')](_0x365b68)&&typeof _0x365b68==='string'&&!_[_0xe5eb('0x7c')](_0x365b68)){if(!_[_0xe5eb('0x86')](_0x2979d0)&&typeof _0x2979d0===_0xe5eb('0x99')&&!_[_0xe5eb('0x7c')](_0x2979d0)){return util[_0xe5eb('0x78')]('\x22%s\x22\x20<%s>',_0x2979d0,_0x365b68);}return util['format'](_0xe5eb('0x9a'),_0x365b68,_0x365b68);}if(!_[_0xe5eb('0x86')](_0x91dc57)&&typeof _0x91dc57===_0xe5eb('0x99')&&!_[_0xe5eb('0x7c')](_0x91dc57)){return _0x91dc57;}return _0xe5eb('0x9b');}function loggerCatchQueueSummary(_0x4d07e3,_0x1f62e7){return function(_0x3ce106){freeVariablesPredictive(_0x1f62e7);emitVoiceQueueSummary(_0x1f62e7);emitCampaignSummary(_0x1f62e7);loggerSyncQueueSummary['error'](_0x4d07e3,util[_0xe5eb('0x9c')](_0x3ce106,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x38a4d2,_0x4ee967){return function(_0x403bd8){loggerPredictive['error'](_0x4ee967['name'],_0x38a4d2);loggerPredictive[_0xe5eb('0x9d')](_0x403bd8[_0xe5eb('0x9e')]);freeVariablesPredictive(_0x4ee967);};}function loggerCatch(_0x391881){return function(_0x1803e3){logger['error'](_0x391881,util[_0xe5eb('0x9c')](_0x1803e3,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x51ff8c){return _0x51ff8c&&!_[_0xe5eb('0x86')](_0x51ff8c)&&_0x51ff8c['length']>0x0;}function decremetOriginate(_0x3ee7e5){if(!_[_0xe5eb('0x86')](_0x3ee7e5)&&_0x3ee7e5!==null){if(typeof _0x3ee7e5[_0xe5eb('0x70')]!==_0xe5eb('0x9f')){if(_0x3ee7e5[_0xe5eb('0x70')]>0x0){_0x3ee7e5[_0xe5eb('0x70')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2dc2b1,_0x1ec224,_0x4201a7){if(_0x1ec224>_0x4201a7){for(var _0x5789d3=0x0;_0x5789d3<_0x1ec224-_0x4201a7;_0x5789d3+=0x1){decremetOriginate(_0x2dc2b1);}}}function loggerGetContactDialer(_0x24a2f9,_0x1743a0,_0x4f9534){return function(_0x27d07e){checkContactLowerLimitOriginate(_0x1743a0,_0x4f9534,0x0);logger[_0xe5eb('0x9d')](_0x24a2f9,util[_0xe5eb('0x9c')](_0x27d07e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x29a47a){return function(_0xc14de2){if(isNotNull(_0xc14de2)&&isNotNull(_0xc14de2[0x0])){if(_0xc14de2[0x0][_0xe5eb('0xa0')]>0x0){_0x29a47a[_0xe5eb('0x39')]=_0xe5eb('0xa1');logger[_0xe5eb('0x7d')](_0xe5eb('0xa2')+_0x29a47a[_0xe5eb('0x3a')],_0xc14de2[0x0]['contactsRescheduled'],_0xe5eb('0xa3'));}else{_0x29a47a[_0xe5eb('0x39')]=_0xe5eb('0xa4');logger['info'](_0xe5eb('0xa5')+_0x29a47a['name']);}}};}function notSendMessagesQueue(_0x4770ad){if(_0x4770ad['sendMessageOneNotActive']){freeVariablesPredictive(_0x4770ad);if(_0x4770ad[_0xe5eb('0x70')]===0x0&&_0x4770ad['talking']===0x0&&_0x4770ad[_0xe5eb('0x53')]===0x0&&(_0x4770ad[_0xe5eb('0x4d')]||0x0)===0x0){_0x4770ad['sendMessageOneNotActive']=![];_0x4770ad['available']=0x0;_0x4770ad[_0xe5eb('0x39')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xe5eb('0x9d')](_0xe5eb('0xa6'),_0x4770ad['name'],_0xe5eb('0xa7'));}else{_0x4770ad['message']=_0xe5eb('0xa8');loggerSyncQueueSummary[_0xe5eb('0x9d')](_0xe5eb('0xa6'),_0x4770ad['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x4770ad);}}function notSendMessagesCampaign(_0x56695d){if(_0x56695d[_0xe5eb('0xa9')]){if(_0x56695d[_0xe5eb('0x70')]===0x0){_0x56695d[_0xe5eb('0xa9')]=![];_0x56695d[_0xe5eb('0x39')]=_0xe5eb('0x3c');loggerSyncQueueSummary[_0xe5eb('0x9d')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x56695d[_0xe5eb('0x3a')],_0xe5eb('0xa7'));}else{_0x56695d[_0xe5eb('0x39')]=_0xe5eb('0xa8');loggerSyncQueueSummary[_0xe5eb('0x9d')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x56695d[_0xe5eb('0x3a')],_0xe5eb('0xaa'));}emitCampaignSummary(_0x56695d);}}function createObjHistory(_0x1f03b9,_0x418c4f,_0x689739,_0x1fdd5c,_0x54ad85){_0x1f03b9[_0xe5eb('0x39')]=_0x689739;var _0x4e8f5c=new Action(_0x1f03b9,_0x418c4f);var _0x477a11=new History(_0x4e8f5c);_0x477a11[_0xe5eb('0xab')]=_0x1fdd5c;_0x477a11[_0xe5eb('0xac')]=_0x54ad85;_0x477a11['endtime']=_0x4e8f5c[_0xe5eb('0xad')];return _0x477a11;}Dialer[_0xe5eb('0xae')][_0xe5eb('0x38')]=function(){var _0xad490a=this;setInterval(function(){_0xad490a[_0xe5eb('0xaf')](_0xad490a['uniqueId'],_0xe5eb('0xb0'));_0xad490a['clearZombieChannels'](_0xad490a[_0xe5eb('0x23')],_0xe5eb('0xb1'));},0x32c8);};Dialer[_0xe5eb('0xae')][_0xe5eb('0xaf')]=function(_0x2195d8,_0x14e459){var _0x5a29c5=this;for(var _0x59d76f in _0x2195d8){if(typeof _0x2195d8[_0x59d76f]!==_0xe5eb('0x9f')){this[_0xe5eb('0x1c')][_0xe5eb('0x1a')](function(){if(!_[_0xe5eb('0xb2')](_0x2195d8[_0x59d76f])){return ami[_0xe5eb('0xb3')]({'action':'status','channel':_0x2195d8[_0x59d76f][_0xe5eb('0xb4')]})['catch'](function(_0x2e337b){if(_0x2e337b[_0xe5eb('0x39')]===_0xe5eb('0xb5')){setTimeout(function(){if(_0x2195d8[_0x59d76f]&&_0x2195d8[_0x59d76f]['type']!==_0xe5eb('0x98')){_0x5a29c5['updateOriginated'](_0x5a29c5[_0xe5eb('0x1d')][_0x2195d8[_0x59d76f][_0xe5eb('0xb6')]]);logger[_0xe5eb('0x9d')](_0xe5eb('0xb7'),_0x14e459,_0x59d76f,_0x2195d8[_0x59d76f][_0xe5eb('0xb6')]);delete _0x2195d8[_0x59d76f];}if(_0x2195d8[_0x59d76f]&&_0x2195d8[_0x59d76f][_0xe5eb('0x47')]===_0xe5eb('0x98')){_0x5a29c5[_0xe5eb('0xb8')](_0x5a29c5[_0xe5eb('0x1e')][_0x2195d8[_0x59d76f][_0xe5eb('0xb6')]]);logger[_0xe5eb('0x9d')](_0xe5eb('0xb9'),_0x14e459,_0x59d76f,_0x2195d8[_0x59d76f]['queue']);delete _0x2195d8[_0x59d76f];}},0x2328);}});}});}}};Dialer[_0xe5eb('0xae')]['countReScheduled']=function(_0x5be8ee){return BPromise[_0xe5eb('0xba')]()['then'](cmHopper[_0xe5eb('0xbb')](_0x5be8ee))[_0xe5eb('0xbc')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xe5eb('0xae')][_0xe5eb('0xbd')]=function(_0xf0d6b5){return BPromise[_0xe5eb('0xba')]()['then'](cmHopperBlack[_0xe5eb('0xbd')](_0xf0d6b5))[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0xbe')));};Dialer[_0xe5eb('0xae')]['checkIsBlackListIvr']=function(_0x1db388){return BPromise[_0xe5eb('0xba')]()[_0xe5eb('0xbf')](cmHopperBlack['checkIsBlackListIvr'](_0x1db388))['catch'](loggerCatch(_0xe5eb('0xc0')));};Dialer['prototype'][_0xe5eb('0xc1')]=function(_0x42d3e3){return BPromise[_0xe5eb('0xba')]()[_0xe5eb('0xbf')](cmHopperHistory[_0xe5eb('0xc2')](_0x42d3e3))[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0xc3')));};Dialer[_0xe5eb('0xae')][_0xe5eb('0xc4')]=function(_0x17a362){return BPromise[_0xe5eb('0xba')]()[_0xe5eb('0xbf')](cmHopper[_0xe5eb('0xc4')](_0x17a362))[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0xc5')));};Dialer[_0xe5eb('0xae')][_0xe5eb('0xc6')]=function(_0x3f4671,_0x48e6aa,_0x4202de){return BPromise['resolve']()[_0xe5eb('0xbf')](cmHopper[_0xe5eb('0xc6')](_0x3f4671,_0x48e6aa,_0x4202de))[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0xc7')));};Dialer[_0xe5eb('0xae')][_0xe5eb('0xc8')]=function(_0x1a7b43,_0x47ff09,_0x532a76,_0x5edc71,_0x47321a){return BPromise[_0xe5eb('0xba')]()[_0xe5eb('0xbf')](cmHopper[_0xe5eb('0xc8')](_0x1a7b43,_0x47ff09,_0x532a76,_0x5edc71))[_0xe5eb('0xbc')](function(_0x3ef116){_0x47321a[_0xe5eb('0xc9')]-=_0x532a76;_0x47321a[_0xe5eb('0xc9')]=_0x47321a['temp']>0x0?_0x47321a[_0xe5eb('0xc9')]:0x0;loggerCatch(_0xe5eb('0xca'))(_0x3ef116);});};Dialer[_0xe5eb('0xae')][_0xe5eb('0xcb')]=function(_0x236003,_0xd6bc7a,_0x5df5cd,_0x3d4ba5){return BPromise['resolve']()['then'](cmHopper[_0xe5eb('0xcb')](_0x236003,_0xd6bc7a,_0x5df5cd))[_0xe5eb('0xbc')](function(_0x2a066c){_0x3d4ba5[_0xe5eb('0xc9')]-=_0xd6bc7a;_0x3d4ba5['temp']=_0x3d4ba5['temp']>0x0?_0x3d4ba5[_0xe5eb('0xc9')]:0x0;loggerCatch(_0xe5eb('0xcc'))(_0x2a066c);});};Dialer[_0xe5eb('0xae')][_0xe5eb('0xcd')]=function(_0x45ffef){return BPromise['resolve']()[_0xe5eb('0xbf')](voiceQueueRt[_0xe5eb('0xcd')](_0x45ffef))['catch'](loggerCatch(_0xe5eb('0xce')));};Dialer[_0xe5eb('0xae')][_0xe5eb('0xcf')]=function(_0x29050f){return BPromise[_0xe5eb('0xba')]()[_0xe5eb('0xbf')](cmHopper['moveContactManagedDialer'](_0x29050f))[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0xd0')));};Dialer[_0xe5eb('0xae')][_0xe5eb('0xd1')]=function(_0x394d03){return BPromise[_0xe5eb('0xba')]()[_0xe5eb('0xbf')](cmHopperHistory['createHistory'](_0x394d03))[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0xd2')));};Dialer[_0xe5eb('0xae')][_0xe5eb('0xb8')]=function(_0x2d8d0c){if(!_[_0xe5eb('0x86')](_0x2d8d0c)&&_0x2d8d0c!==null){if(typeof _0x2d8d0c[_0xe5eb('0x70')]!==_0xe5eb('0x9f')){if(_0x2d8d0c[_0xe5eb('0x70')]>0x0){_0x2d8d0c[_0xe5eb('0x70')]-=0x1;}else{logger[_0xe5eb('0x9d')](_0xe5eb('0xd3'));}}}else{logger[_0xe5eb('0x9d')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xe5eb('0xae')][_0xe5eb('0xd4')]=function(_0x5c9274,_0x5d8e2c){var _0xff1e59=this;return function(_0x20cba3){_0xff1e59[_0xe5eb('0xb8')](_0x5d8e2c);logger[_0xe5eb('0x9d')](_0x5c9274,util[_0xe5eb('0x9c')](_0x20cba3,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xe5eb('0xd5')]=function(_0x4969a2,_0x138eab,_0x1d9b50){var _0x5e5539={'state':0x19,'statedesc':_0xe5eb('0xd6')};this[_0xe5eb('0xb8')](_0x138eab);this[_0xe5eb('0xd7')](_[_0xe5eb('0x91')](_0x5e5539,_[_0xe5eb('0xd8')](_0x1d9b50,[_0xe5eb('0xd9'),_0xe5eb('0xda'),'UserId',_0xe5eb('0xdb'),_0xe5eb('0xdc')])),'[emptyContact][createHistory]','[emptyContact]');logger['error'](_0x4969a2);};Dialer[_0xe5eb('0xae')][_0xe5eb('0xdd')]=function(_0x4d0cf0){return _0x4d0cf0===_0xe5eb('0xde');};Dialer[_0xe5eb('0xae')][_0xe5eb('0xdf')]=function(_0x41402c){return!_[_0xe5eb('0x86')](_0x41402c)&&_0x41402c&&!_[_0xe5eb('0x86')](_0x41402c['name'])&&!_[_0xe5eb('0x86')](_0x41402c[_0xe5eb('0x75')])&&_0x41402c[_0xe5eb('0x75')]&&(this['trunks'][util[_0xe5eb('0x78')](_0xe5eb('0xe0'),_0x41402c[_0xe5eb('0x3a')])]['status']===_0xe5eb('0xe1')||this[_0xe5eb('0x20')][util[_0xe5eb('0x78')](_0xe5eb('0xe0'),_0x41402c['name'])][_0xe5eb('0xe2')]===_0xe5eb('0xe3'));};Dialer[_0xe5eb('0xae')]['saveInDb']=function(_0x4d4831,_0xc4ece6,_0xb72dc8){this[_0xe5eb('0xd1')](_0x4d4831)[_0xe5eb('0xbc')](loggerCatch(_0xc4ece6));this[_0xe5eb('0xcf')](_0x4d4831)[_0xe5eb('0xbc')](loggerCatch(_0xb72dc8));};Dialer['prototype'][_0xe5eb('0x35')]=function(_0x2d80af){var _0x226388=this['uniqueId'][_0x2d80af[_0xe5eb('0xe4')]];var _0x5b2431;if(!_[_0xe5eb('0xb2')](_0x2d80af)&&!_['isNil'](_0x2d80af[_0xe5eb('0xe5')])&&!_['isNil'](_0x2d80af[_0xe5eb('0xe5')]['amdstatus'])&&_0x2d80af[_0xe5eb('0xe6')]==='xcally-motion-dialer'&&_0x226388){if(_0x226388['type']!==_0xe5eb('0x98')&&this[_0xe5eb('0x1d')][_0x226388[_0xe5eb('0xb6')]]['dialAMDActive']&&_0x2d80af['value']==='HANGUP'){delete this[_0xe5eb('0x25')][_0x2d80af[_0xe5eb('0xe4')]];this['updateOriginated'](this['voiceQueues'][_0x226388[_0xe5eb('0xb6')]]);this[_0xe5eb('0x1d')][_0x226388[_0xe5eb('0xb6')]][_0xe5eb('0x5b')]+=0x1;this[_0xe5eb('0x1d')][_0x226388[_0xe5eb('0xb6')]][_0xe5eb('0x5a')]+=0x1;_0x5b2431=new Hangup(_0x226388,_0x2d80af);_0x5b2431[_0xe5eb('0xab')]=0x12;_0x5b2431['statedesc']='HangupInAMD';_0x5b2431['membername']=_0xe5eb('0xe7');ami[_0xe5eb('0x46')](_0xe5eb('0xe8'),ut[_0xe5eb('0xe9')](_0x5b2431,_0xe5eb('0xea')));this['saveInDb'](_0x5b2431,_0xe5eb('0xeb'),'[syncHangupInAMD]');}if(_0x226388[_0xe5eb('0x47')]!==_0xe5eb('0x98')&&this[_0xe5eb('0x1d')][_0x226388[_0xe5eb('0xb6')]][_0xe5eb('0xec')]&&_0x2d80af[_0xe5eb('0xed')]===_0xe5eb('0xee')){var _0x5ebd4e=this;return new BPromise(function(_0x2e9201,_0x5b3912){delete _0x5ebd4e[_0xe5eb('0x25')][_0x2d80af[_0xe5eb('0xe4')]];_0x5ebd4e[_0xe5eb('0xb8')](_0x5ebd4e[_0xe5eb('0x1d')][_0x226388[_0xe5eb('0xb6')]]);_0x5ebd4e['voiceQueues'][_0x226388[_0xe5eb('0xb6')]][_0xe5eb('0x5b')]+=0x1;_0x5ebd4e['voiceQueues'][_0x226388[_0xe5eb('0xb6')]][_0xe5eb('0x5a')]+=0x1;var _0x47ab27=_0x5ebd4e['voiceQueues'][_0x226388[_0xe5eb('0xb6')]];var _0x50fefa=new Hangup(_0x226388,_0x2d80af);_0x50fefa[_0xe5eb('0xab')]=0x13;_0x50fefa[_0xe5eb('0xac')]='Machine';_0x50fefa[_0xe5eb('0xef')]=_0xe5eb('0xe7');_0x50fefa[_0xe5eb('0xf0')]+=0x1;_0x50fefa['countglobal']+=0x1;_0x50fefa[_0xe5eb('0xea')]=!![];ami['emit']('custom:amd',ut[_0xe5eb('0xe9')](_0x50fefa,'amd'));_0x5ebd4e[_0xe5eb('0xd1')](_0x50fefa)[_0xe5eb('0xbc')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x50fefa['countbusyretry']+_0x50fefa[_0xe5eb('0xf1')]+_0x50fefa['countnoanswerretry']+_0x50fefa['countnosuchnumberretry']+_0x50fefa['countdropretry']+_0x50fefa[_0xe5eb('0xf2')]+_0x50fefa[_0xe5eb('0xf0')]+_0x50fefa[_0xe5eb('0xf3')]>=_0x47ab27[_0xe5eb('0xf4')]){_0x5ebd4e[_0xe5eb('0xf5')](_0x50fefa,_0x2e9201,_0x5b3912,'reason19\x20machine....');}else{if(_0x50fefa[_0xe5eb('0xf0')]>=_0x47ab27[_0xe5eb('0xf6')]){_0x5ebd4e[_0xe5eb('0xf7')](_0x50fefa,_0x2e9201,_0x5b3912,'reason\x2019\x20machine....');}else{_0x5ebd4e['rescheduleContact']({'active':![],'countmachineretry':_0x50fefa[_0xe5eb('0xf0')],'scheduledat':moment()[_0xe5eb('0xf8')](_0x47ab27[_0xe5eb('0xf9')],_0xe5eb('0xfa'))['format'](_0xe5eb('0xfb')),'ContactId':_0x50fefa[_0xe5eb('0xd9')],'ListId':_0x50fefa[_0xe5eb('0xda')],'VoiceQueueId':_0x50fefa[_0xe5eb('0xdb')]||undefined,'CampaignId':_0x50fefa[_0xe5eb('0xdc')]||undefined})['catch'](loggerCatch(_0xe5eb('0xfc')));_0x2e9201({'reschedule':0x1});}}});}if(_0x226388[_0xe5eb('0x47')]===_0xe5eb('0x98')&&this[_0xe5eb('0x1e')][_0x226388['queue']][_0xe5eb('0xec')]&&_0x2d80af['value']==='HANGUP'){delete this[_0xe5eb('0x25')][_0x2d80af['uniqueid']];this['updateOriginated'](this[_0xe5eb('0x1e')][_0x226388[_0xe5eb('0xb6')]]);_0x5b2431=new Hangup(_0x226388,_0x2d80af);_0x5b2431[_0xe5eb('0xab')]=0x12;_0x5b2431[_0xe5eb('0xac')]='HangupInAMD';_0x5b2431[_0xe5eb('0xef')]='AMD';ami[_0xe5eb('0x46')](_0xe5eb('0xe8'),ut[_0xe5eb('0xe9')](_0x5b2431,_0xe5eb('0xea')));this[_0xe5eb('0xd7')](_0x5b2431,'[syncHangupInAMDIvr][createHistory]',_0xe5eb('0xfd'));}if(_0x226388[_0xe5eb('0x47')]==='ivr'&&this[_0xe5eb('0x1e')][_0x226388[_0xe5eb('0xb6')]][_0xe5eb('0xec')]&&_0x2d80af[_0xe5eb('0xed')]==='MACHINE'){var _0x5ebd4e=this;return new BPromise(function(_0x5a06d1,_0x5af159){delete _0x5ebd4e[_0xe5eb('0x25')][_0x2d80af[_0xe5eb('0xe4')]];_0x5ebd4e[_0xe5eb('0xb8')](_0x5ebd4e[_0xe5eb('0x1e')][_0x226388[_0xe5eb('0xb6')]]);_0x5ebd4e[_0xe5eb('0x1e')][_0x226388[_0xe5eb('0xb6')]]['outboundAnswerCallsDay']+=0x1;_0x5ebd4e[_0xe5eb('0x1e')][_0x226388['queue']][_0xe5eb('0x5a')]+=0x1;var _0x1a9cb3=_0x5ebd4e['campaigns'][_0x226388[_0xe5eb('0xb6')]];var _0x44d438=new Hangup(_0x226388,_0x2d80af);_0x44d438[_0xe5eb('0xab')]=0x13;_0x44d438['statedesc']=_0xe5eb('0xfe');_0x44d438['membername']='AMD';_0x44d438['countmachineretry']+=0x1;_0x44d438[_0xe5eb('0xff')]+=0x1;_0x44d438[_0xe5eb('0xea')]=!![];ami[_0xe5eb('0x46')](_0xe5eb('0xe8'),ut[_0xe5eb('0xe9')](_0x44d438,'amd'));_0x5ebd4e[_0xe5eb('0xd1')](_0x44d438)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x100')));if(_0x44d438[_0xe5eb('0x101')]+_0x44d438[_0xe5eb('0xf1')]+_0x44d438[_0xe5eb('0x102')]+_0x44d438[_0xe5eb('0x103')]+_0x44d438[_0xe5eb('0x104')]+_0x44d438[_0xe5eb('0xf2')]+_0x44d438['countmachineretry']+_0x44d438[_0xe5eb('0xf3')]>=_0x1a9cb3[_0xe5eb('0xf4')]){_0x5ebd4e['stateGlobal'](_0x44d438,_0x5a06d1,_0x5af159,_0xe5eb('0x105'));}else{if(_0x44d438[_0xe5eb('0xf0')]>=_0x1a9cb3[_0xe5eb('0xf6')]){_0x5ebd4e[_0xe5eb('0xf7')](_0x44d438,_0x5a06d1,_0x5af159,_0xe5eb('0x106'));}else{_0x5ebd4e[_0xe5eb('0xc4')]({'active':![],'countmachineretry':_0x44d438['countmachineretry'],'scheduledat':moment()[_0xe5eb('0xf8')](_0x1a9cb3['dialMachineRetryFrequency'],_0xe5eb('0xfa'))['format'](_0xe5eb('0xfb')),'ContactId':_0x44d438['ContactId'],'ListId':_0x44d438[_0xe5eb('0xda')],'VoiceQueueId':_0x44d438['VoiceQueueId']||undefined,'CampaignId':_0x44d438[_0xe5eb('0xdc')]||undefined})[_0xe5eb('0xbc')](loggerCatch('[rescheduleContact][Machine]'));_0x5a06d1({'reschedule':0x1});}}});}}};Dialer[_0xe5eb('0xae')][_0xe5eb('0x32')]=function(_0x31733a){var _0x3ae767=this[_0xe5eb('0x25')][_0x31733a[_0xe5eb('0xe4')]];var _0x3366cc=this;var _0x391f9e;if(_0x3ae767&&_0x3ae767[_0xe5eb('0x47')]==='ivr'){delete this[_0xe5eb('0x25')][_0x31733a[_0xe5eb('0xe4')]];this[_0xe5eb('0xb8')](this[_0xe5eb('0x1e')][_0x3ae767[_0xe5eb('0xb6')]]);this['campaigns'][_0x3ae767[_0xe5eb('0xb6')]]['ivrAnswerCallsDay']+=0x1;_0x391f9e=new Hangup(_0x3ae767,_0x31733a);this[_0xe5eb('0xd1')](_0x391f9e)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x107')));this['moveContactManagedDialer'](_0x391f9e)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x108')));}if(_0x3ae767&&_0x3ae767['type']!=='ivr'&&isNotNull(this['voiceQueues'][_0x3ae767[_0xe5eb('0xb6')]][_0xe5eb('0x109')])){delete this[_0xe5eb('0x25')][_0x31733a[_0xe5eb('0xe4')]];this[_0xe5eb('0xb8')](this[_0xe5eb('0x1d')][_0x3ae767[_0xe5eb('0xb6')]]);this[_0xe5eb('0x1d')][_0x3ae767[_0xe5eb('0xb6')]][_0xe5eb('0x5b')]+=0x1;this[_0xe5eb('0x1d')][_0x3ae767[_0xe5eb('0xb6')]][_0xe5eb('0x5a')]+=0x1;_0x391f9e=new Hangup(_0x3ae767,_0x31733a);_0x391f9e[_0xe5eb('0xab')]=0x10;_0x391f9e[_0xe5eb('0xac')]=_0xe5eb('0x10a');_0x391f9e[_0xe5eb('0xef')]=_0xe5eb('0x10b');this[_0xe5eb('0xd1')](_0x391f9e)[_0xe5eb('0xbc')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xe5eb('0xcf')](_0x391f9e)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x108')));}if(_0x3ae767&&_0x3ae767['type']!=='ivr'&&!isNotNull(this['voiceQueues'][_0x3ae767[_0xe5eb('0xb6')]]['dialQueueProject'])){delete this[_0xe5eb('0x25')][_0x31733a[_0xe5eb('0xe4')]];this[_0xe5eb('0xb8')](this[_0xe5eb('0x1d')][_0x3ae767['queue']]);this[_0xe5eb('0x1d')][_0x3ae767[_0xe5eb('0xb6')]][_0xe5eb('0x65')]+=0x1;_0x391f9e=new Hangup(_0x3ae767,_0x31733a);_0x391f9e[_0xe5eb('0xab')]=0xc;_0x391f9e['statedesc']=_0x31733a['cause-txt'];_0x391f9e[_0xe5eb('0xef')]=_0xe5eb('0x10c');this[_0xe5eb('0xd1')](_0x391f9e)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x107')));this['moveContactManagedDialer'](_0x391f9e)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x108')));}};Dialer[_0xe5eb('0xae')][_0xe5eb('0x2f')]=function(_0x8a8f2d){var _0x3f6951=this['uniqueId'][_0x8a8f2d[_0xe5eb('0xe4')]];var _0x2effe5=this;if(this[_0xe5eb('0x1d')][_0x8a8f2d[_0xe5eb('0xb6')]]){if(_0x3f6951&&_0x3f6951[_0xe5eb('0x47')]!==_0xe5eb('0x98')){delete this['uniqueId'][_0x8a8f2d[_0xe5eb('0xe4')]];this['voiceQueues'][_0x8a8f2d[_0xe5eb('0xb6')]][_0xe5eb('0x5b')]+=0x1;var _0x46a3d4=new AgentComplete(_0x3f6951,_0x8a8f2d);if(_0x8a8f2d[_0xe5eb('0x10d')]==='agent'){_0x46a3d4[_0xe5eb('0x10e')]=this[_0xe5eb('0x1d')][_0x8a8f2d[_0xe5eb('0xb6')]][_0xe5eb('0x10f')]&&this[_0xe5eb('0x1d')][_0x8a8f2d[_0xe5eb('0xb6')]]['dialAgiAfterHangupAgent']?moment()[_0xe5eb('0x78')](_0xe5eb('0xfb')):undefined;}this['createHistory'](_0x46a3d4)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x110')));this['moveContactManagedDialer'](_0x46a3d4)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x111')));}}};Dialer[_0xe5eb('0xae')]['syncAgentConnect']=function(_0x26f9a2){if(this[_0xe5eb('0x1d')][_0x26f9a2['queue']]){if(this[_0xe5eb('0x25')][_0x26f9a2['uniqueid']]&&this['uniqueId'][_0x26f9a2[_0xe5eb('0xe4')]]['type']!==_0xe5eb('0x98')){this[_0xe5eb('0xb8')](this['voiceQueues'][_0x26f9a2[_0xe5eb('0xb6')]]);this['uniqueId'][_0x26f9a2['uniqueid']][_0xe5eb('0x112')]=moment()[_0xe5eb('0x78')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xe5eb('0xae')]['queueCallerAbandonCreateState']=function(_0x253a21){this[_0xe5eb('0xd1')](_0x253a21)['catch'](loggerCatch(_0xe5eb('0x110')));this[_0xe5eb('0xcf')](_0x253a21)['catch'](loggerCatch(_0xe5eb('0x113')));};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x1374a6){var _0x5bdff8=this[_0xe5eb('0x25')][_0x1374a6[_0xe5eb('0xe4')]];var _0x1a5c24=this;if(this[_0xe5eb('0x1d')][_0x1374a6['queue']]){if(_0x5bdff8&&_0x5bdff8[_0xe5eb('0x47')]!=='ivr'){delete this['uniqueId'][_0x1374a6[_0xe5eb('0xe4')]];this[_0xe5eb('0xb8')](this[_0xe5eb('0x1d')][_0x1374a6[_0xe5eb('0xb6')]]);_0x5bdff8[_0xe5eb('0x114')]=moment()[_0xe5eb('0x78')](_0xe5eb('0xfb'));var _0x5558cf=new QueueCallerAbandon(_0x5bdff8,_0x1374a6);if(getSeconds(_0x5bdff8[_0xe5eb('0x114')],_0x5bdff8[_0xe5eb('0x115')])>=_0x5bdff8[_0xe5eb('0x116')]){this[_0xe5eb('0x1d')][_0x1374a6[_0xe5eb('0xb6')]][_0xe5eb('0x6a')]+=0x1;this[_0xe5eb('0x1d')][_0x1374a6[_0xe5eb('0xb6')]][_0xe5eb('0x60')]+=0x1;this[_0xe5eb('0x1d')][_0x1374a6[_0xe5eb('0xb6')]][_0xe5eb('0x6c')]+=0x1;_0x5558cf['state']=0xa;_0x5558cf['statedesc']=_0xe5eb('0x117');_0x5558cf[_0xe5eb('0x118')]=_0xe5eb('0x119');_0x5558cf[_0xe5eb('0x10e')]=this[_0xe5eb('0x1d')][_0x1374a6[_0xe5eb('0xb6')]][_0xe5eb('0x10f')]?moment()[_0xe5eb('0x78')](_0xe5eb('0xfb')):undefined;_0x5558cf[_0xe5eb('0x104')]+=0x1;_0x5558cf[_0xe5eb('0xff')]+=0x1;if(_0x5558cf[_0xe5eb('0x104')]>=this[_0xe5eb('0x1d')][_0x1374a6['queue']][_0xe5eb('0x11a')]){this[_0xe5eb('0x11b')](_0x5558cf);}else{this[_0xe5eb('0xc4')]({'active':![],'countdropretry':_0x5558cf[_0xe5eb('0x104')],'scheduledat':moment()[_0xe5eb('0xf8')](this[_0xe5eb('0x1d')][_0x1374a6['queue']][_0xe5eb('0x11c')],_0xe5eb('0xfa'))[_0xe5eb('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5bdff8[_0xe5eb('0xd9')],'ListId':_0x5bdff8['ListId'],'VoiceQueueId':_0x5bdff8[_0xe5eb('0xdb')]||undefined,'CampaignId':_0x5bdff8['CampaignId']||undefined})[_0xe5eb('0xbc')](loggerCatch('[rescheduleContact][Drop]'));var _0x44e9b3=new History(_0x5558cf);_0x44e9b3[_0xe5eb('0xab')]=0xa;_0x44e9b3[_0xe5eb('0xac')]=_0xe5eb('0x117');_0x44e9b3['starttime']=moment()[_0xe5eb('0x78')](_0xe5eb('0xfb'));_0x44e9b3[_0xe5eb('0x11d')]=_0x44e9b3[_0xe5eb('0xad')];_0x44e9b3[_0xe5eb('0x11e')]=_0x5558cf[_0xe5eb('0x11e')];_0x44e9b3[_0xe5eb('0x11f')]=_0x5558cf['calleridnum'];this['createHistory'](_0x44e9b3)['catch'](loggerCatch(_0xe5eb('0x120')));}}else{this['voiceQueues'][_0x1374a6[_0xe5eb('0xb6')]][_0xe5eb('0x69')]+=0x1;this[_0xe5eb('0x1d')][_0x1374a6[_0xe5eb('0xb6')]][_0xe5eb('0x5f')]+=0x1;_0x5558cf[_0xe5eb('0xab')]=0xb;_0x5558cf[_0xe5eb('0xac')]=_0xe5eb('0x121');_0x5558cf[_0xe5eb('0x118')]='CALLEREXIT';_0x5558cf[_0xe5eb('0xf2')]+=0x1;_0x5558cf['countglobal']+=0x1;if(_0x5558cf[_0xe5eb('0xf2')]>=this[_0xe5eb('0x1d')][_0x1374a6[_0xe5eb('0xb6')]][_0xe5eb('0x122')]){this[_0xe5eb('0x11b')](_0x5558cf);}else{this[_0xe5eb('0xc4')]({'active':![],'countabandonedretry':_0x5558cf[_0xe5eb('0xf2')],'scheduledat':moment()[_0xe5eb('0xf8')](this[_0xe5eb('0x1d')][_0x1374a6[_0xe5eb('0xb6')]][_0xe5eb('0x123')],_0xe5eb('0xfa'))[_0xe5eb('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5bdff8[_0xe5eb('0xd9')],'ListId':_0x5bdff8[_0xe5eb('0xda')],'VoiceQueueId':_0x5bdff8[_0xe5eb('0xdb')]||undefined,'CampaignId':_0x5bdff8[_0xe5eb('0xdc')]||undefined})[_0xe5eb('0xbc')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x44e9b3=new History(_0x5558cf);_0x44e9b3[_0xe5eb('0xab')]=0xb;_0x44e9b3['statedesc']=_0xe5eb('0x121');_0x44e9b3['starttime']=moment()[_0xe5eb('0x78')](_0xe5eb('0xfb'));_0x44e9b3[_0xe5eb('0x11d')]=_0x44e9b3['starttime'];_0x44e9b3[_0xe5eb('0x11e')]=_0x5558cf[_0xe5eb('0x11e')];_0x44e9b3[_0xe5eb('0x11f')]=_0x5558cf[_0xe5eb('0x11f')];this[_0xe5eb('0xd1')](_0x44e9b3)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x124')));}}}}};Dialer['prototype']['syncNewExten']=function(_0x808b65){if(this[_0xe5eb('0x23')][_0x808b65['uniqueid']]){this[_0xe5eb('0x23')][_0x808b65['uniqueid']]['channel']=_0x808b65[_0xe5eb('0xb4')];}if(this['uniqueId'][_0x808b65['uniqueid']]){this[_0xe5eb('0x25')][_0x808b65['uniqueid']][_0xe5eb('0xb4')]=_0x808b65[_0xe5eb('0xb4')];}};Dialer[_0xe5eb('0xae')][_0xe5eb('0x37')]=function(_0x2d0b6e){if(strategy[this['voiceQueues'][this[_0xe5eb('0x23')][_0x2d0b6e[_0xe5eb('0x125')]][_0xe5eb('0xb6')]][_0xe5eb('0x49')]]===_0xe5eb('0x19')){if(this[_0xe5eb('0x23')][_0x2d0b6e[_0xe5eb('0x125')]]&&_[_0xe5eb('0xb2')](this[_0xe5eb('0x23')][_0x2d0b6e['actionid']][_0xe5eb('0x126')])&&_0x2d0b6e[_0xe5eb('0xe2')]==='1'&&_0x2d0b6e['paused']==='0'){if(this[_0xe5eb('0x1f')][_0x2d0b6e[_0xe5eb('0x127')]]){if(!this[_0xe5eb('0x1f')][_0x2d0b6e[_0xe5eb('0x127')]]['locked']){this[_0xe5eb('0x1f')][_0x2d0b6e['stateinterface']][_0xe5eb('0x126')]=!![];this[_0xe5eb('0x23')][_0x2d0b6e[_0xe5eb('0x125')]][_0xe5eb('0x126')]=!![];this[_0xe5eb('0x23')][_0x2d0b6e[_0xe5eb('0x125')]]['stateinterface']=_0x2d0b6e[_0xe5eb('0x127')];}}}}else if((strategy[this['voiceQueues'][this[_0xe5eb('0x23')][_0x2d0b6e[_0xe5eb('0x125')]][_0xe5eb('0xb6')]][_0xe5eb('0x49')]]||_0xe5eb('0x18'))===_0xe5eb('0x18')){if(this[_0xe5eb('0x23')][_0x2d0b6e[_0xe5eb('0x125')]]){if(this[_0xe5eb('0x1f')][_0x2d0b6e['stateinterface']]){this[_0xe5eb('0x23')][_0x2d0b6e['actionid']][_0xe5eb('0x127')]=_0x2d0b6e[_0xe5eb('0x127')];if(_['isNil'](this['queueBooked'][this[_0xe5eb('0x23')][_0x2d0b6e[_0xe5eb('0x125')]][_0xe5eb('0xb6')]])){this[_0xe5eb('0x27')][this[_0xe5eb('0x23')][_0x2d0b6e[_0xe5eb('0x125')]][_0xe5eb('0xb6')]]=[];}this[_0xe5eb('0x27')][this[_0xe5eb('0x23')][_0x2d0b6e['actionid']][_0xe5eb('0xb6')]][_0xe5eb('0x128')](_[_0xe5eb('0x91')](_[_0xe5eb('0xd8')](this[_0xe5eb('0x23')][_0x2d0b6e['actionid']],[_0xe5eb('0x129'),'stateinterface']),{'status':_0x2d0b6e['status'],'paused':_0x2d0b6e[_0xe5eb('0x12a')]}));}}}};function unlockQueueStatus(_0x38f841,_0x395121){setTimeout(function(){if(_[_0xe5eb('0x86')](_0x38f841[_0xe5eb('0x12b')])){loggerBooked[_0xe5eb('0x9d')](_0xe5eb('0x12c'),_0x395121);}_0x38f841['queueStatusComplete']=!![];loggerBooked[_0xe5eb('0x7d')]('[booked][unlockQueueStatus]',_0x395121,JSON['stringify'](_[_0xe5eb('0xd8')](_0x38f841,[_0xe5eb('0x3a'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xe5eb('0xae')][_0xe5eb('0x12d')]=function(_0xf430a8){var _0x2b5384=this;var _0x1dab2d=_0x2b5384['voiceQueues'][_0x2b5384[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0xb6')]];if(strategy[this[_0xe5eb('0x1d')][this['actions'][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0xb6')]][_0xe5eb('0x49')]]==='roundrobin'){if(this['actions'][_0xf430a8[_0xe5eb('0x125')]]&&this['actions'][_0xf430a8['actionid']][_0xe5eb('0x127')]){this[_0xe5eb('0x97')][_0xe5eb('0x12e')](this[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0x129')],this[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0x127')])[_0xe5eb('0xbc')](function(_0x1ae425){logger[_0xe5eb('0x9d')](_0xe5eb('0x12f'),util['inspect'](_0x1ae425,{'showHidden':![],'depth':null}));})[_0xe5eb('0x130')](function(){_0x2b5384['updateOriginated'](_0x2b5384[_0xe5eb('0x1d')][_0x2b5384[_0xe5eb('0x23')][_0xf430a8['actionid']][_0xe5eb('0xb6')]]);_0x2b5384[_0xe5eb('0x1f')][_0x2b5384['actions'][_0xf430a8[_0xe5eb('0x125')]]['stateinterface']]['locked']=![];delete _0x2b5384[_0xe5eb('0x23')][_0xf430a8['actionid']];unlockQueueStatus(_0x1dab2d);});}else{this[_0xe5eb('0xb8')](this[_0xe5eb('0x1d')][this[_0xe5eb('0x23')][_0xf430a8['actionid']][_0xe5eb('0xb6')]]);this[_0xe5eb('0xc4')]({'active':![],'ContactId':this['actions'][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0xd9')],'ListId':this[_0xe5eb('0x23')][_0xf430a8['actionid']][_0xe5eb('0xda')],'VoiceQueueId':this['actions'][_0xf430a8[_0xe5eb('0x125')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0xdc')]||undefined})[_0xe5eb('0xbc')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]];unlockQueueStatus(_0x1dab2d);}}else if((strategy[this['voiceQueues'][this['actions'][_0xf430a8[_0xe5eb('0x125')]]['queue']][_0xe5eb('0x49')]]||_0xe5eb('0x18'))==='rrmemory'){var _0xdd41d;if(this[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]]&&!_['isEmpty'](this['queueBooked'][this['actions'][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0xb6')]])){if(this[_0xe5eb('0x28')][_0x2b5384[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0xb6')]]){this['queueBookedRR'][_0x2b5384[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0xb6')]]=this['queueBookedRR'][this[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0xb6')]]?this[_0xe5eb('0x28')][this[_0xe5eb('0x23')][_0xf430a8['actionid']][_0xe5eb('0xb6')]]:this[_0xe5eb('0x27')][this[_0xe5eb('0x23')][_0xf430a8['actionid']][_0xe5eb('0xb6')]]?this[_0xe5eb('0x27')][this[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0xb6')]][_0xe5eb('0x131')]||0x0:0x0;}this['queueBooked'][this[_0xe5eb('0x23')][_0xf430a8['actionid']][_0xe5eb('0xb6')]][_0xe5eb('0x131')]=this['queueBookedRR'][this[_0xe5eb('0x23')][_0xf430a8[_0xe5eb('0x125')]][_0xe5eb('0xb6')]];for(var _0x268ef2=0x0;_0x268ef2=0x0;})['catch'](myreject(_0x450f0c)));}}else{_0x3f358b['push'](ami['Action']({'action':'command','command':util[_0xe5eb('0x78')](_0xe5eb('0x148'),_0x4a4b2e,!_[_0xe5eb('0x86')](config['timezones'][_0x1d9186])?_0x1d9186:'')})[_0xe5eb('0xbf')](function(_0xa4ac70){return _0xa4ac70[_0xe5eb('0x149')][_0xe5eb('0x14a')](_0xe5eb('0x14b'))>=0x0;})[_0xe5eb('0xbc')](myreject(_0x450f0c)));}BPromise[_0xe5eb('0x14c')](_0x3f358b)['then'](function(_0x18536f){var _0x46785c=_['some'](_0x18536f);if(_0x46785c){return _0x3db2d8(_0x46785c);}else{_0x3f637e[_0xe5eb('0x39')]=_0x37c911?_0xe5eb('0x14d'):_0xe5eb('0x14e');return _0x450f0c(msgResponse(_0xe5eb('0x14f'),_0xe5eb('0x13f'),_0xe5eb('0x150')+_0x37c911+'\x20'+_0x36fc9e+_0xe5eb('0x151')+util['inspect'](_0x4a4b2e,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1d9186));}})[_0xe5eb('0xbc')](function(_0x5af83b){return _0x450f0c(msgResponse('ifTime','Failure',JSON['stringify'](_0x5af83b)));});});};Dialer[_0xe5eb('0xae')][_0xe5eb('0x152')]=function(_0x694090){var _0x34580c=this;return function(){switch(_0x694090[_0xe5eb('0x56')]){case _0xe5eb('0x153'):freeVariablesPredictive(_0x694090);_0x34580c[_0xe5eb('0x154')](_0x694090,0x1);break;case'power':freeVariablesPredictive(_0x694090);_0x34580c[_0xe5eb('0x154')](_0x694090,_0x694090[_0xe5eb('0x155')]);break;case'predictive':_0x34580c[_0xe5eb('0x9')](_0x694090);break;case'booked':freeVariablesPredictive(_0x694090);_0x34580c[_0xe5eb('0x154')](_0x694090,0x1);break;default:freeVariablesPredictive(_0x694090);logger[_0xe5eb('0x9d')]('Queue',_0x694090[_0xe5eb('0x3a')],'method\x20not\x20recognized');}};};Dialer[_0xe5eb('0xae')][_0xe5eb('0x156')]=function(_0xedae45){var _0x2750f9=this;return function(){_0x2750f9['handleIvr'](_0xedae45);};};Dialer[_0xe5eb('0xae')][_0xe5eb('0x31')]=function(_0xf16f94){var _0x565623=this;if(isNotPreview(_0xf16f94[_0xe5eb('0x56')])){if(isVoiceQueueOutbound(_0xf16f94[_0xe5eb('0x47')])&&isActive(_0xf16f94[_0xe5eb('0x55')])){_0xf16f94[_0xe5eb('0xa9')]=!![];BPromise[_0xe5eb('0xba')]()[_0xe5eb('0xbf')](checkIsLoggedIn(_0xf16f94,_0xf16f94[_0xe5eb('0x4c')]))['then'](checkIsActive(_0xf16f94,_0xf16f94[_0xe5eb('0x55')]))[_0xe5eb('0xbf')](checkInterval(_0xf16f94))['then'](_0x565623[_0xe5eb('0x13c')](_0xf16f94))['then'](_0x565623[_0xe5eb('0x13d')](_0xf16f94['dialGlobalInterval'],_0xf16f94['dialTimezone'],_0xf16f94[_0xe5eb('0x3a')],_0xf16f94))[_0xe5eb('0xbf')](_0x565623[_0xe5eb('0x157')](_0xf16f94[_0xe5eb('0x40')],_0xf16f94[_0xe5eb('0x158')],_0xf16f94[_0xe5eb('0x3a')],_0xf16f94))[_0xe5eb('0xbf')](_0x565623['checkDialMethod'](_0xf16f94))[_0xe5eb('0xbc')](loggerCatchQueueSummary('[syncQueueSummary]',_0xf16f94));}else{notSendMessagesQueue(_0xf16f94);}}else{freeVariablesPredictive(_0xf16f94);}};Dialer[_0xe5eb('0xae')][_0xe5eb('0x159')]=function(){var _0x177343=this;var _0x27808b;for(var _0x5a5a8d in this[_0xe5eb('0x1e')]){if(typeof this[_0xe5eb('0x1e')][_0x5a5a8d]!==_0xe5eb('0x9f')){_0x27808b=this['campaigns'][_0x5a5a8d];if(isCampaignIvr(_0x27808b[_0xe5eb('0x47')])&&isActive(_0x27808b[_0xe5eb('0x75')])){_0x27808b[_0xe5eb('0xa9')]=!![];BPromise[_0xe5eb('0xba')]()[_0xe5eb('0xbf')](checkIsActive(_0x27808b,_0x27808b[_0xe5eb('0x75')]))['then'](checkInterval(_0x27808b))[_0xe5eb('0xbf')](_0x177343[_0xe5eb('0x13c')](_0x27808b))['then'](_0x177343[_0xe5eb('0x13d')](_0x27808b[_0xe5eb('0x15a')],_0x27808b[_0xe5eb('0x158')],_0x27808b[_0xe5eb('0x3a')],_0x27808b))[_0xe5eb('0xbf')](_0x177343[_0xe5eb('0x157')](_0x27808b['Interval'],_0x27808b['dialTimezone'],_0x27808b[_0xe5eb('0x3a')],_0x27808b))[_0xe5eb('0xbf')](_0x177343[_0xe5eb('0x156')](_0x27808b))[_0xe5eb('0xbc')](loggerCatchQueueSummary(_0xe5eb('0x15b'),_0x27808b));}else{notSendMessagesCampaign(_0x27808b);}}}};function getCallerIdRandom(_0x4e2d75,_0x5d8d0b){var _0x83ce8f;var _0x51fbdc;var _0x111500;if(_0x5d8d0b<=0x0){_0x5d8d0b=0x1;}_0x83ce8f=new RegExp(_0xe5eb('0x15c')+_0x5d8d0b+'}$');_0x51fbdc=Math[_0xe5eb('0x15d')](0xa,_0x5d8d0b-0x1);_0x111500=Math[_0xe5eb('0x15d')](0xa,_0x5d8d0b)-0x1;return util[_0xe5eb('0x78')]('%s',_[_0xe5eb('0x15e')](_0x4e2d75,_0x83ce8f,_[_0xe5eb('0x15f')](_0x51fbdc,_0x111500)));}function extractCalleridName(_0x1bdef6){var _0x303e72=_0x1bdef6[_0xe5eb('0x160')](/"(.*?)"/);return _0x303e72?_0x303e72[0x1]:_0x1bdef6;}function extractCalleridNumber(_0x3222c5){var _0x426667=_0x3222c5[_0xe5eb('0x160')](/<(.*?)>/);return _0x426667?_0x426667[0x1]:_0x3222c5;}Dialer['prototype']['actionOriginate']=function(_0x100855,_0x1b46c9){var _0x2855ac=this;var _0x1f50ef=uuid['v4']();this['actions'][_0x1f50ef]=new Action(_0x100855,_0x1b46c9,_0x1f50ef);return new BPromise(function(_0x10bc5a,_0x2b1631){if(_[_0xe5eb('0x86')](_0x100855)&&typeof _0x100855!==_0xe5eb('0x161')){return _0x2b1631(msgResponse('originate',_0xe5eb('0x13f'),_0xe5eb('0x162')));}if(_['isUndefined'](_0x1b46c9[_0xe5eb('0x163')]['phone'])||_0x1b46c9[_0xe5eb('0x163')][_0xe5eb('0x164')]===null){return _0x2b1631(msgResponse(_0xe5eb('0x165'),'Failure',_0xe5eb('0x166')));}var _0x3cb6af={'XMD-CALLERID':_0x2855ac[_0xe5eb('0x23')][_0x1f50ef][_0xe5eb('0x167')](),'XMD-AGI':_0x100855['dialQueueProject']?util['format'](_0xe5eb('0x168'),ipAgi,_0x100855['dialQueueProject']):_0xe5eb('0x169'),'XMD-AGIAFTER':_0x100855[_0xe5eb('0x10f')]?util[_0xe5eb('0x78')](_0xe5eb('0x168'),ipAgi,_0x100855[_0xe5eb('0x10f')]):_0xe5eb('0x169'),'XMD-QUEUE':_0x100855['type']===_0xe5eb('0x48')?util[_0xe5eb('0x78')](_0xe5eb('0x16a'),_0x100855[_0xe5eb('0x3a')],_0x100855[_0xe5eb('0x16b')]||'',_0x100855['dialAgiAfterHangupAgent']?'c':'',_0x100855['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x1b46c9[_0xe5eb('0xd9')],'XMD-CDRTYPE':_0xe5eb('0x7'),'CALLERID(all)':_0x2855ac['actions'][_0x1f50ef][_0xe5eb('0x167')](),'XMD-AMD':_0x100855[_0xe5eb('0xec')]?'ACTIVE':'NONE','XMD-DESTINATION':_0xe5eb('0x16c')};if(_0x100855[_0xe5eb('0xec')]){_0x3cb6af[_0xe5eb('0x16d')]=_0x100855[_0xe5eb('0x16e')]||0x9c4;_0x3cb6af['XMD-AMDGREETING']=_0x100855[_0xe5eb('0x16f')]||0x5dc;_0x3cb6af[_0xe5eb('0x170')]=_0x100855[_0xe5eb('0x171')]||0x320;_0x3cb6af[_0xe5eb('0x172')]=_0x100855[_0xe5eb('0x173')]||0x1388;_0x3cb6af[_0xe5eb('0x174')]=_0x100855[_0xe5eb('0x175')]||0x64;_0x3cb6af[_0xe5eb('0x176')]=_0x100855['dialAMDBetweenWordsSilence']||0x32;_0x3cb6af['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x100855[_0xe5eb('0x177')]||0x3;_0x3cb6af[_0xe5eb('0x178')]=_0x100855[_0xe5eb('0x179')]||0x100;_0x3cb6af[_0xe5eb('0x17a')]=_0x100855[_0xe5eb('0x17b')]||0x1388;}if(_0x100855['type']===_0xe5eb('0x48')){_0x3cb6af[_0xe5eb('0x17c')]=_0x1b46c9['VoiceQueueId'];}else{_0x3cb6af[_0xe5eb('0x17d')]=_0x1b46c9['CampaignId'];}for(var _0x507d68 in _0x1b46c9[_0xe5eb('0x163')]){if(typeof _0x1b46c9[_0xe5eb('0x163')][_0x507d68]!==_0xe5eb('0x9f')){if(isNotNull(_0x1b46c9[_0xe5eb('0x163')][_0x507d68])&&_0x507d68!=='id'&&_0x507d68!==_0xe5eb('0x17e')&&_0x507d68!==_0xe5eb('0x17f')&&_0x507d68!==_0xe5eb('0x180')){_0x3cb6af[util[_0xe5eb('0x78')]('%s%s',_0xe5eb('0x181'),_[_0xe5eb('0x182')](_0x507d68))]=_0x1b46c9['Contact'][_0x507d68];}}}var _0x43b67d=_0x2855ac[_0xe5eb('0xdf')](_0x100855['Trunk'])?getCallerId(_0x100855['Trunk'][_0xe5eb('0x76')],_0x100855[_0xe5eb('0x57')],_0x100855[_0xe5eb('0x183')]>0x0?getCallerIdRandom(_0x100855['dialOriginateCallerIdNumber'],_0x100855['dialRandomLastDigitCallerIdNumber']):_0x100855[_0xe5eb('0x184')]):getCallerId(_[_0xe5eb('0xb2')](_0x100855[_0xe5eb('0x185')])?_0x100855[_0xe5eb('0x74')]['callerid']:_0x100855[_0xe5eb('0x185')][_0xe5eb('0x76')],_0x100855[_0xe5eb('0x57')],_0x100855[_0xe5eb('0x183')]>0x0?getCallerIdRandom(_0x100855['dialOriginateCallerIdNumber'],_0x100855['dialRandomLastDigitCallerIdNumber']):_0x100855[_0xe5eb('0x184')]);if(_0x43b67d){_0x3cb6af[_0xe5eb('0x186')]=_0x2855ac[_0xe5eb('0x23')][_0x1f50ef][_0xe5eb('0x187')]=extractCalleridName(_0x43b67d);_0x3cb6af[_0xe5eb('0x188')]=_0x2855ac[_0xe5eb('0x23')][_0x1f50ef][_0xe5eb('0x189')]=extractCalleridNumber(_0x43b67d);}return ami[_0xe5eb('0xb3')]({'actionid':_0x1f50ef,'action':'originate','channel':_0x2855ac[_0xe5eb('0xdf')](_0x100855[_0xe5eb('0x74')])?util['format'](_0xe5eb('0x18a'),_0x100855[_0xe5eb('0x74')][_0xe5eb('0x3a')],isNotNull(_0x100855[_0xe5eb('0x59')])?_0x100855[_0xe5eb('0x59')]['trim']()||'':'',_0x100855['dialCutDigit']>0x0?_0x1b46c9[_0xe5eb('0x163')][_0xe5eb('0x164')]['substring'](_0x100855[_0xe5eb('0x18b')]):_0x1b46c9[_0xe5eb('0x163')][_0xe5eb('0x164')]):util[_0xe5eb('0x78')]('SIP/%s/%s%s',_[_0xe5eb('0xb2')](_0x100855[_0xe5eb('0x185')])?_0x100855[_0xe5eb('0x74')]['name']:_0x100855[_0xe5eb('0x185')][_0xe5eb('0x3a')],isNotNull(_0x100855[_0xe5eb('0x59')])?_0x100855[_0xe5eb('0x59')][_0xe5eb('0x18c')]()||'':'',_0x100855[_0xe5eb('0x18b')]>0x0?_0x1b46c9[_0xe5eb('0x163')]['phone'][_0xe5eb('0x18d')](_0x100855[_0xe5eb('0x18b')]):_0x1b46c9['Contact'][_0xe5eb('0x164')]),'callerid':_0x43b67d,'Exten':_0xe5eb('0x16c'),'Context':_0xe5eb('0x18e'),'Priority':'1','variable':_0x3cb6af,'timeout':(_0x100855[_0xe5eb('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1f50ef})[_0xe5eb('0xbf')](function(_0x5282a5){return _0x10bc5a(_0x5282a5);})[_0xe5eb('0xbc')](function(_0x1cd65c){_0x100855['outboundOriginateFailureCallsDay']+=0x1;var _0x2ce28e=new History(_0x2855ac[_0xe5eb('0x23')][_0x1f50ef]);logger[_0xe5eb('0x9d')](util[_0xe5eb('0x78')](_0xe5eb('0x18f'),JSON[_0xe5eb('0x77')](_0x1cd65c)));_0x2ce28e[_0xe5eb('0xab')]=0xe;_0x2ce28e[_0xe5eb('0xac')]=_0xe5eb('0x190');_0x2ce28e['starttime']=moment()[_0xe5eb('0x78')](_0xe5eb('0xfb'));_0x2ce28e[_0xe5eb('0x11d')]=_0x2ce28e['starttime'];_0x2855ac[_0xe5eb('0xd1')](_0x2ce28e)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x191')));_0x2855ac[_0xe5eb('0xcf')](_0x2ce28e)['catch'](loggerCatch(_0xe5eb('0x191')))['finally'](function(){delete _0x2855ac[_0xe5eb('0x23')][_0x1f50ef];return _0x2b1631(msgResponse(_0xe5eb('0x165'),'Error',_0xe5eb('0x192')));});});});};Dialer['prototype'][_0xe5eb('0x2d')]=function(_0x5ba69b){var _0x1d4259=this[_0xe5eb('0x23')][_0x5ba69b['actionid']];if(_0x1d4259){delete this['actions'][_0x5ba69b[_0xe5eb('0x125')]];_0x1d4259[_0xe5eb('0x115')]=moment()[_0xe5eb('0x78')](_0xe5eb('0xfb'));var _0x1ccf91=_0x1d4259[_0xe5eb('0x47')]===_0xe5eb('0x98')?this[_0xe5eb('0x1e')][_0x1d4259[_0xe5eb('0xb6')]]:this[_0xe5eb('0x1d')][_0x1d4259[_0xe5eb('0x193')]()];if(!this[_0xe5eb('0xdd')](_0x5ba69b[_0xe5eb('0x194')])){this[_0xe5eb('0xb8')](_0x1ccf91);return this[_0xe5eb('0x195')](_0x1d4259,_0x1ccf91,_0x5ba69b)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0xe5eb('0x25')][_0x5ba69b['uniqueid']]=_0x1d4259;}};Dialer[_0xe5eb('0xae')][_0xe5eb('0x196')]=function(_0x378b85,_0x3a2f00,_0xb8da5){var _0x1e8000=new History(_0x3a2f00);if(_0x1e8000[_0xe5eb('0x101')]+_0x1e8000[_0xe5eb('0xf1')]+_0x1e8000[_0xe5eb('0x102')]+_0x1e8000[_0xe5eb('0x103')]+_0x1e8000[_0xe5eb('0x104')]+_0x1e8000[_0xe5eb('0xf2')]+_0x1e8000[_0xe5eb('0xf0')]+_0x1e8000[_0xe5eb('0xf3')]>=_0xb8da5['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x378b85){case 0x3:if(_0x1e8000[_0xe5eb('0x102')]>=_0xb8da5[_0xe5eb('0x197')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x1e8000[_0xe5eb('0x102')]+=0x1,'scheduledat':moment()[_0xe5eb('0xf8')](_0xb8da5[_0xe5eb('0x198')],_0xe5eb('0xfa'))[_0xe5eb('0x78')](_0xe5eb('0xfb')),'ContactId':_0x1e8000['ContactId'],'ListId':_0x1e8000[_0xe5eb('0xda')],'VoiceQueueId':_0x1e8000['VoiceQueueId']||undefined,'CampaignId':_0x1e8000[_0xe5eb('0xdc')]||undefined})[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x199')));break;case 0x5:if(_0x1e8000[_0xe5eb('0x101')]>=_0xb8da5[_0xe5eb('0x19a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x1e8000[_0xe5eb('0x101')]+=0x1,'scheduledat':moment()['add'](_0xb8da5['dialBusyRetryFrequency'],_0xe5eb('0xfa'))['format'](_0xe5eb('0xfb')),'ContactId':_0x1e8000[_0xe5eb('0xd9')],'ListId':_0x1e8000[_0xe5eb('0xda')],'VoiceQueueId':_0x1e8000[_0xe5eb('0xdb')]||undefined,'CampaignId':_0x1e8000[_0xe5eb('0xdc')]||undefined})[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x19b')));break;case 0x8:if(_0x1e8000['countcongestionretry']>=_0xb8da5[_0xe5eb('0x19c')]-0x1){return!![];}this[_0xe5eb('0xc4')]({'active':![],'countcongestionretry':_0x1e8000[_0xe5eb('0xf1')]+=0x1,'scheduledat':moment()[_0xe5eb('0xf8')](_0xb8da5[_0xe5eb('0x19d')],_0xe5eb('0xfa'))[_0xe5eb('0x78')](_0xe5eb('0xfb')),'ContactId':_0x1e8000[_0xe5eb('0xd9')],'ListId':_0x1e8000['ListId'],'VoiceQueueId':_0x1e8000[_0xe5eb('0xdb')]||undefined,'CampaignId':_0x1e8000[_0xe5eb('0xdc')]||undefined})['catch'](loggerCatch(_0xe5eb('0x19e')));break;case 0x0:if(_0x1e8000['countnosuchnumberretry']>=_0xb8da5['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1e8000[_0xe5eb('0x103')]+=0x1,'scheduledat':moment()['add'](_0xb8da5['dialNoSuchNumberRetryFrequency'],_0xe5eb('0xfa'))[_0xe5eb('0x78')](_0xe5eb('0xfb')),'ContactId':_0x1e8000[_0xe5eb('0xd9')],'ListId':_0x1e8000[_0xe5eb('0xda')],'VoiceQueueId':_0x1e8000[_0xe5eb('0xdb')]||undefined,'CampaignId':_0x1e8000['CampaignId']||undefined})[_0xe5eb('0xbc')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1e8000[_0xe5eb('0x104')]>=_0xb8da5[_0xe5eb('0x11a')]-0x1){return!![];}this[_0xe5eb('0xc4')]({'active':![],'countdropretry':_0x1e8000[_0xe5eb('0x104')]+=0x1,'scheduledat':moment()['add'](_0xb8da5[_0xe5eb('0x11c')],_0xe5eb('0xfa'))[_0xe5eb('0x78')](_0xe5eb('0xfb')),'ContactId':_0x1e8000[_0xe5eb('0xd9')],'ListId':_0x1e8000[_0xe5eb('0xda')],'VoiceQueueId':_0x1e8000['VoiceQueueId']||undefined,'CampaignId':_0x1e8000[_0xe5eb('0xdc')]||undefined})[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x19f')));break;case 0xb:if(_0x1e8000['countabandonedretry']>=_0xb8da5[_0xe5eb('0x122')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x1e8000[_0xe5eb('0xf2')]+=0x1,'scheduledat':moment()[_0xe5eb('0xf8')](_0xb8da5[_0xe5eb('0x123')],_0xe5eb('0xfa'))['format'](_0xe5eb('0xfb')),'ContactId':_0x1e8000[_0xe5eb('0xd9')],'ListId':_0x1e8000[_0xe5eb('0xda')],'VoiceQueueId':_0x1e8000[_0xe5eb('0xdb')]||undefined,'CampaignId':_0x1e8000['CampaignId']||undefined})[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x1a0')));break;case 0x13:if(_0x1e8000[_0xe5eb('0xf0')]>=_0xb8da5[_0xe5eb('0xf6')]-0x1){return!![];}this[_0xe5eb('0xc4')]({'active':![],'countmachineretry':_0x1e8000[_0xe5eb('0xf0')]+=0x1,'scheduledat':moment()[_0xe5eb('0xf8')](_0xb8da5[_0xe5eb('0xf9')],_0xe5eb('0xfa'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1e8000['ContactId'],'ListId':_0x1e8000[_0xe5eb('0xda')],'VoiceQueueId':_0x1e8000[_0xe5eb('0xdb')]||undefined,'CampaignId':_0x1e8000[_0xe5eb('0xdc')]||undefined})[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0xfc')));break;case 0x14:if(_0x1e8000[_0xe5eb('0xf3')]>=_0xb8da5[_0xe5eb('0x1a1')]-0x1){return!![];}this[_0xe5eb('0xc4')]({'active':![],'countagentrejectretry':_0x1e8000['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xe5eb('0xf8')](_0xb8da5[_0xe5eb('0x1a2')],_0xe5eb('0xfa'))[_0xe5eb('0x78')](_0xe5eb('0xfb')),'ContactId':_0x1e8000['ContactId'],'ListId':_0x1e8000[_0xe5eb('0xda')],'VoiceQueueId':_0x1e8000[_0xe5eb('0xdb')]||undefined,'CampaignId':_0x1e8000[_0xe5eb('0xdc')]||undefined})['catch'](loggerCatch(_0xe5eb('0x1a3')));break;default:return!![];}};Dialer[_0xe5eb('0xae')]['callProgressDetecting']=function(_0x502be6,_0x40fb99,_0x5768ca){var _0x2ff8a2=this;var _0x127a7d=new History(_0x502be6);return new BPromise(function(_0xf86086,_0x439473){if(_['isUndefined'](_0x40fb99)&&typeof _0x40fb99!==_0xe5eb('0x161')){return _0x439473(msgResponse(_0xe5eb('0x1a4'),'Failure',_0xe5eb('0x1a5')));}if(_[_0xe5eb('0x86')](_0x5768ca)&&typeof _0x5768ca!=='object'){return _0x439473(msgResponse(_0xe5eb('0x1a4'),'Failure',_0xe5eb('0x1a6')));}switch(_0x5768ca[_0xe5eb('0x10d')]){case'0':_0x40fb99['outboundNoSuchCallsDay']+=0x1;_0x127a7d[_0xe5eb('0xab')]=0x0;_0x127a7d[_0xe5eb('0xac')]=_0xe5eb('0x1a7');_0x127a7d[_0xe5eb('0x103')]+=0x1;_0x127a7d[_0xe5eb('0xff')]+=0x1;ami['emit'](_0xe5eb('0x1a8'),ut[_0xe5eb('0xe9')](_0x502be6,'nosuchnumber'));_0x2ff8a2[_0xe5eb('0xd1')](_0x127a7d)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2ff8a2[_0xe5eb('0x196')](0x0,_0x502be6,_0x40fb99)){if(_0x127a7d['countnosuchnumberretry']>=_0x40fb99[_0xe5eb('0x1a9')]){_0x2ff8a2['createStateFinal'](_0x127a7d,_0xf86086,_0x439473,_0xe5eb('0x1aa'));}else{_0x2ff8a2['stateGlobal'](_0x127a7d,_0xf86086,_0x439473,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x40fb99['outboundNoAnswerCallsDay']+=0x1;_0x127a7d[_0xe5eb('0xab')]=0x3;_0x127a7d[_0xe5eb('0xac')]=_0xe5eb('0x1ab');_0x127a7d[_0xe5eb('0x102')]+=0x1;_0x127a7d['countglobal']+=0x1;ami['emit']('custom:agentnoanswer',ut[_0xe5eb('0xe9')](_0x502be6,_0xe5eb('0x1ac')));_0x2ff8a2[_0xe5eb('0xd1')](_0x127a7d)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x1ad')));if(_0x2ff8a2['checkRetriveMax'](0x3,_0x502be6,_0x40fb99)){if(_0x127a7d[_0xe5eb('0x102')]>=_0x40fb99['dialNoAnswerMaxRetry']){_0x2ff8a2[_0xe5eb('0xf7')](_0x127a7d,_0xf86086,_0x439473,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2ff8a2[_0xe5eb('0xf5')](_0x127a7d,_0xf86086,_0x439473,_0xe5eb('0x1ae'));}}break;case'5':_0x40fb99[_0xe5eb('0x5c')]+=0x1;_0x127a7d[_0xe5eb('0xab')]=0x5;_0x127a7d[_0xe5eb('0xac')]='Busy';_0x127a7d[_0xe5eb('0x101')]+=0x1;_0x127a7d[_0xe5eb('0xff')]+=0x1;ami[_0xe5eb('0x46')]('custom:agentbusy',ut[_0xe5eb('0xe9')](_0x502be6,'busy'));_0x2ff8a2['createHistory'](_0x127a7d)['catch'](loggerCatch(_0xe5eb('0x1af')));if(_0x2ff8a2[_0xe5eb('0x196')](0x5,_0x502be6,_0x40fb99)){if(_0x127a7d[_0xe5eb('0x101')]>=_0x40fb99[_0xe5eb('0x19a')]){_0x2ff8a2[_0xe5eb('0xf7')](_0x127a7d,_0xf86086,_0x439473,_0xe5eb('0x1b0'));}else{_0x2ff8a2['stateGlobal'](_0x127a7d,_0xf86086,_0x439473,_0xe5eb('0x1b0'));}}break;case'8':_0x40fb99['outboundCongestionCallsDay']+=0x1;_0x127a7d[_0xe5eb('0xab')]=0x8;_0x127a7d[_0xe5eb('0xac')]=_0xe5eb('0x1b1');_0x127a7d['countcongestionretry']+=0x1;_0x127a7d[_0xe5eb('0xff')]+=0x1;ami[_0xe5eb('0x46')]('custom:agentcongestion',ut[_0xe5eb('0xe9')](_0x502be6,'congestion'));_0x2ff8a2[_0xe5eb('0xd1')](_0x127a7d)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x1b2')));if(_0x2ff8a2[_0xe5eb('0x196')](0x8,_0x502be6,_0x40fb99)){if(_0x127a7d[_0xe5eb('0xf1')]>=_0x40fb99[_0xe5eb('0x19c')]){_0x2ff8a2[_0xe5eb('0xf7')](_0x127a7d,_0xf86086,_0x439473,'reason\x208\x20congestion');}else{_0x2ff8a2[_0xe5eb('0xf5')](_0x127a7d,_0xf86086,_0x439473,_0xe5eb('0x1b3'));}}break;case'11':_0x40fb99[_0xe5eb('0x1b4')]+=0x1;_0x127a7d[_0xe5eb('0xab')]=0xb;_0x127a7d[_0xe5eb('0xac')]=_0xe5eb('0x121');_0x127a7d[_0xe5eb('0xf2')]+=0x1;_0x127a7d[_0xe5eb('0xff')]+=0x1;_0x2ff8a2[_0xe5eb('0xd1')](_0x127a7d)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x2ff8a2[_0xe5eb('0x196')](0xb,_0x502be6,_0x40fb99)){if(_0x127a7d[_0xe5eb('0xf2')]>=_0x40fb99['dialAbandonedMaxRetry']){_0x2ff8a2[_0xe5eb('0xf7')](_0x127a7d,_0xf86086,_0x439473,'reason\x2011\x20abandoned');}else{_0x2ff8a2['stateGlobal'](_0x127a7d,_0xf86086,_0x439473,_0xe5eb('0x1b5'));}}break;case'20':_0x40fb99[_0xe5eb('0x64')]+=0x1;_0x127a7d[_0xe5eb('0xab')]=0x14;_0x127a7d[_0xe5eb('0xac')]='AgentReject';_0x127a7d[_0xe5eb('0xf3')]+=0x1;_0x127a7d[_0xe5eb('0xff')]+=0x1;ami['emit'](_0xe5eb('0x1b6'),ut[_0xe5eb('0xe9')](_0x502be6,_0xe5eb('0x1b7')));_0x2ff8a2[_0xe5eb('0xd1')](_0x127a7d)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x1b8')));if(_0x2ff8a2[_0xe5eb('0x196')](0x14,_0x502be6,_0x40fb99)){if(_0x127a7d[_0xe5eb('0xf3')]>=_0x40fb99[_0xe5eb('0x1a1')]){_0x2ff8a2[_0xe5eb('0xf7')](_0x127a7d,_0xf86086,_0x439473,_0xe5eb('0x1b9'));}else{_0x2ff8a2[_0xe5eb('0xf5')](_0x127a7d,_0xf86086,_0x439473,_0xe5eb('0x1b9'));}}break;default:_0x40fb99[_0xe5eb('0x65')]+=0x1;_0x127a7d[_0xe5eb('0xab')]=0xc;_0x127a7d[_0xe5eb('0xac')]=_0x5768ca[_0xe5eb('0x10d')];_0x2ff8a2[_0xe5eb('0xd1')](_0x127a7d)[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x1ba')));if(_0x2ff8a2[_0xe5eb('0x196')](_0x5768ca[_0xe5eb('0x10d')],_0x502be6,_0x40fb99)){if(_0x127a7d[_0xe5eb('0x101')]+_0x127a7d[_0xe5eb('0xf1')]+_0x127a7d[_0xe5eb('0x102')]+_0x127a7d[_0xe5eb('0x103')]+_0x127a7d[_0xe5eb('0x104')]+_0x127a7d[_0xe5eb('0xf2')]+_0x127a7d[_0xe5eb('0xf0')]+_0x127a7d[_0xe5eb('0xf3')]>=_0x40fb99[_0xe5eb('0xf4')]){_0x2ff8a2[_0xe5eb('0xf5')](_0x127a7d,_0xf86086,_0x439473,_0x5768ca[_0xe5eb('0x10d')]);}else{_0x2ff8a2[_0xe5eb('0xf7')](_0x127a7d,_0xf86086,_0x439473,_0x5768ca[_0xe5eb('0x10d')]);}}}});};Dialer['prototype'][_0xe5eb('0xf5')]=function(_0x3fa652,_0x4586da,_0x56fffd,_0xf589f){var _0x239f4d=new Final(_0x3fa652);_0x239f4d[_0xe5eb('0xab')]=0xf;_0x239f4d['statedesc']=_0xe5eb('0x1bb');this[_0xe5eb('0xf7')](_0x239f4d,_0x4586da,_0x56fffd,_0xf589f);};Dialer['prototype']['createStateFinal']=function(_0x4ad271,_0x33511f,_0x4807b3,_0x3df0ca){this[_0xe5eb('0xcf')](_0x4ad271)['then'](function(){return _0x33511f(msgResponse(_0xe5eb('0x1a4'),_0xe5eb('0xde'),_0x3df0ca));})['catch'](function(){return _0x4807b3(msgResponse(_0xe5eb('0x1bc'),_0xe5eb('0x13f'),_0xe5eb('0x1bd')));});};Dialer[_0xe5eb('0xae')][_0xe5eb('0x9')]=function(_0x561e20){var _0x56f352=_0x561e20['dialPredictiveOptimizationPercentage']/0x64;var _0x56d73a=_0x561e20[_0xe5eb('0x60')]/(_0x561e20[_0xe5eb('0x60')]+_0x561e20[_0xe5eb('0x5b')]);var _0x24278d=Math[_0xe5eb('0x1be')](_0x561e20[_0xe5eb('0x1bf')]*(_0x561e20[_0xe5eb('0x1c0')]/0x64));var _0x4f45ad=Math['round'](_0x561e20[_0xe5eb('0x1bf')]*(_0x561e20[_0xe5eb('0x1c1')]/0x64));var _0x41e55=_0x561e20[_0xe5eb('0x4b')]+_0x561e20[_0xe5eb('0x50')];var _0x574f38=Math[_0xe5eb('0x1c2')](_0x561e20['erlangCalls']*_0x561e20[_0xe5eb('0x8f')]*_0x561e20[_0xe5eb('0x6d')]*_0x561e20[_0xe5eb('0x6e')]);if(_[_0xe5eb('0x86')](_0x561e20[_0xe5eb('0x26')])){if(!_[_0xe5eb('0x86')](_0x561e20['startPredictive'])){_0x561e20[_0xe5eb('0x73')]=undefined;loggerPredictive[_0xe5eb('0x9d')](_0xe5eb('0x1c3'),_0xe5eb('0x1c4'));}if(!_[_0xe5eb('0x86')](_0x561e20[_0xe5eb('0x95')])){loggerPredictive[_0xe5eb('0x9d')](_0xe5eb('0x1c3'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x561e20[_0xe5eb('0x95')]);_0x561e20[_0xe5eb('0x95')]=undefined;}_0x561e20[_0xe5eb('0x26')]=moment()[_0xe5eb('0x78')](_0xe5eb('0xfb'));loggerPredictive[_0xe5eb('0x7d')](_0x561e20[_0xe5eb('0x3a')],_0xe5eb('0x1c5'),_0x561e20[_0xe5eb('0x26')]);this[_0xe5eb('0x154')](_0x561e20,0x1);}else if(ifInterval(_0x561e20[_0xe5eb('0x1c6')],_0x561e20['startProgressive'])){this[_0xe5eb('0x154')](_0x561e20,0x1);loggerPredictiveCalls[_0xe5eb('0x7d')](_0xe5eb('0x1c7'),_0x561e20[_0xe5eb('0x26')],_0x561e20['name']);_0x561e20[_0xe5eb('0x71')]=0x0;_0x561e20['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x56f352<_0x56d73a&&_0x561e20['dialPredictiveOptimization']===_0xe5eb('0x1c8')){freeVariablesPredictive(_0x561e20);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x1c9'),_0xe5eb('0x1ca'),_0x56d73a,_0xe5eb('0x26'),_0x561e20[_0xe5eb('0x3a')]);}else if(_0x574f38<_0x561e20['predictiveIntervalErlangCallsDroppedCalls']&&_0x561e20[_0xe5eb('0x1cb')]==='dropRate'){freeVariablesPredictive(_0x561e20);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x1cc'),_0xe5eb('0x1cd'),_0x574f38,_0xe5eb('0x1ce'),_0x561e20[_0xe5eb('0x6c')],_0xe5eb('0x26'),_0x561e20['name']);}else if(!ifInterval(_0x561e20[_0xe5eb('0x1c6')],_0x561e20['startProgressive'])&&_[_0xe5eb('0x86')](_0x561e20[_0xe5eb('0x73')])&&!_[_0xe5eb('0x86')](_0x561e20['startProgressive'])){_0x561e20[_0xe5eb('0x73')]=moment()[_0xe5eb('0x78')](_0xe5eb('0xfb'));loggerPredictive[_0xe5eb('0x7d')](_0x561e20[_0xe5eb('0x3a')],_0xe5eb('0x1cf'),_0x561e20['startPredictive']);this['averageHandleTime'](_0x561e20['dialPredictiveInterval'])[_0xe5eb('0xbf')](this[_0xe5eb('0x1d0')](_0x561e20))[_0xe5eb('0xbf')](mergeDataErlangB(_0x561e20))['then'](this['startMethodPredictive'](_0x561e20))[_0xe5eb('0xbc')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x561e20));}else if(!ifInterval(_0x561e20[_0xe5eb('0x1c6')],_0x561e20[_0xe5eb('0x73')])){_0x561e20[_0xe5eb('0x6c')]=0x0;_0x561e20['startPredictive']=moment()['format'](_0xe5eb('0xfb'));loggerPredictive[_0xe5eb('0x7d')](_0x561e20[_0xe5eb('0x3a')],_0xe5eb('0x1d1'),_0x561e20[_0xe5eb('0x73')]);clearInterval(_0x561e20[_0xe5eb('0x95')]);_0x561e20['handlePredictive']=undefined;this[_0xe5eb('0xc1')](_0x561e20[_0xe5eb('0x1c6')])[_0xe5eb('0xbf')](this[_0xe5eb('0x1d0')](_0x561e20))[_0xe5eb('0xbf')](mergeDataErlangB(_0x561e20))['then'](this[_0xe5eb('0x1d2')](_0x561e20))[_0xe5eb('0xbc')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x561e20));}else if(_0x561e20[_0xe5eb('0x1bf')]&&_0x41e55<_0x561e20[_0xe5eb('0x1bf')]-_0x4f45ad){freeVariablesPredictive(_0x561e20);loggerPredictive[_0xe5eb('0x7d')](_0x561e20[_0xe5eb('0x3a')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x41e55,_0xe5eb('0x1d3'),_0x561e20['predictiveIntervalAvailable'],'-',_0x4f45ad,'=',_0x561e20[_0xe5eb('0x1bf')]-_0x4f45ad,')');}else if(_0x561e20[_0xe5eb('0x1bf')]&&_0x41e55>_0x561e20['predictiveIntervalAvailable']+_0x24278d){freeVariablesPredictive(_0x561e20);loggerPredictive[_0xe5eb('0x7d')](_0x561e20[_0xe5eb('0x3a')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x41e55,_0xe5eb('0x1d4'),_0x561e20['predictiveIntervalAvailable'],'+',_0x24278d,'=',_0x561e20['predictiveIntervalAvailable']+_0x24278d,')');}};Dialer[_0xe5eb('0xae')][_0xe5eb('0x1d0')]=function(_0xfbdfd9){var _0x330f02=this;return function(_0x8b4ee5){return new BPromise(function(_0x236488,_0x42ab85){_['merge'](_0xfbdfd9,_0x8b4ee5[0x0]);if(checkGetDataPredictive(_0x8b4ee5[0x0])){var _0x3d0dd1=_0xfbdfd9[_0xe5eb('0x1bf')]=_0xfbdfd9[_0xe5eb('0x50')]+_0xfbdfd9[_0xe5eb('0x4b')];var _0x3b3b18=_0xfbdfd9['dialPredictiveInterval']*0x3c;var _0x124fbf=_0x8b4ee5[0x0][_0xe5eb('0x68')]+_0x8b4ee5[0x0][_0xe5eb('0x67')];var _0x4c97c4=(_0x8b4ee5[0x0]['predictiveIntervalAnsweredCalls']+_0x8b4ee5[0x0][_0xe5eb('0x6a')]+_0x8b4ee5[0x0][_0xe5eb('0x69')])/_0x8b4ee5[0x0][_0xe5eb('0x6f')];_0xfbdfd9[_0xe5eb('0x6d')]=_0x4c97c4>0x0?_0x4c97c4:0x1;switch(_0xfbdfd9[_0xe5eb('0x1cb')]){case'dropRate':var _0x19970a=_0xfbdfd9[_0xe5eb('0x1d5')]/0x64;return _0x330f02[_0xe5eb('0x1d6')](_0x3d0dd1,_0x3b3b18,_0x124fbf,_0x4c97c4,_0x19970a)[_0xe5eb('0xbf')](function(_0x421fee){return _0x236488(_0x421fee);});case _0xe5eb('0x1d7'):var _0x36830e=_0xfbdfd9[_0xe5eb('0x1d5')]/0x64;return _0x330f02['busyFactor'](_0x3d0dd1,_0x3b3b18,_0x124fbf,_0x4c97c4,_0x36830e)[_0xe5eb('0xbf')](function(_0x19c870){return _0x236488(_0x19c870);});default:return _0x42ab85(msgResponse('[getDataPredictive]',_0xe5eb('0x13f'),_0xe5eb('0x1d8')));}}else{return _0x42ab85(msgResponse(_0xe5eb('0x1d9'),_0xe5eb('0x13f'),'check\x20failure'));}});};};Dialer[_0xe5eb('0xae')]['getDataPredictiveOld']=function(_0x5c05ea){var _0xb03fb2=this;return function(_0xd013fe){return new BPromise(function(_0x4307d5,_0x59fea6){_[_0xe5eb('0x91')](_0x5c05ea,_0xd013fe[0x0]);if(checkGetDataPredictive(_0xd013fe[0x0])){loggerPredictive[_0xe5eb('0x7d')](JSON[_0xe5eb('0x77')](_0xd013fe[0x0]));if(_0x5c05ea[_0xe5eb('0x1cb')]===_0xe5eb('0x1c8')){return _0xb03fb2[_0xe5eb('0xcd')](_0x5c05ea['id'])[_0xe5eb('0xbf')](function(_0x44a430){var _0x3d9f9e=_0x5c05ea['loggedIn']-_0x44a430[0x0][_0xe5eb('0x1da')];var _0x5329f0=_0x5c05ea[_0xe5eb('0x1c6')]*0x3c;var _0x4629bc=_0xd013fe[0x0][_0xe5eb('0x68')]+_0xd013fe[0x0][_0xe5eb('0x67')];var _0x189711=(_0xd013fe[0x0]['predictiveIntervalAnsweredCalls']+_0xd013fe[0x0][_0xe5eb('0x6a')]+_0xd013fe[0x0][_0xe5eb('0x69')])/_0xd013fe[0x0]['predictiveIntervalTotalCalls'];var _0x4e6caa=_0x5c05ea[_0xe5eb('0x1d5')]/0x64;_0x5c05ea['predictiveIntervalPauses']=_0x44a430[0x0][_0xe5eb('0x1da')]||0x0;_0x5c05ea['predictiveIntervalHitRate']=_0x189711>0x0?_0x189711:0x1;return _0xb03fb2[_0xe5eb('0x1d6')](_0x3d9f9e,_0x5329f0,_0x4629bc,_0x189711,_0x4e6caa);})['then'](function(_0x3433d2){return _0x4307d5(_0x3433d2);})['catch'](function(_0x46f528){return _0x59fea6(msgResponse(_0xe5eb('0x1db'),_0xe5eb('0x13f'),JSON[_0xe5eb('0x77')](_0x46f528)));});}if(_0x5c05ea[_0xe5eb('0x1cb')]===_0xe5eb('0x1d7')){return _0xb03fb2[_0xe5eb('0xcd')](_0x5c05ea['id'])['then'](function(_0x31f379){var _0x34761d=_0x5c05ea['loggedIn']-_0x31f379[0x0][_0xe5eb('0x1da')];var _0x2dd4e6=_0x5c05ea['dialPredictiveInterval']*0x3c;var _0x9795bb=_0xd013fe[0x0][_0xe5eb('0x68')]+_0xd013fe[0x0][_0xe5eb('0x67')];var _0x2955c0=(_0xd013fe[0x0]['predictiveIntervalAnsweredCalls']+_0xd013fe[0x0][_0xe5eb('0x6a')]+_0xd013fe[0x0][_0xe5eb('0x69')])/_0xd013fe[0x0][_0xe5eb('0x6f')];var _0x278321=_0x5c05ea[_0xe5eb('0x1d5')]/0x64;_0x5c05ea[_0xe5eb('0x1dc')]=_0x31f379[0x0][_0xe5eb('0x1da')]||0x0;_0x5c05ea[_0xe5eb('0x6d')]=_0x2955c0>0x0?_0x2955c0:0x1;return _0xb03fb2[_0xe5eb('0x1dd')](_0x34761d,_0x2dd4e6,_0x9795bb,_0x2955c0,_0x278321);})[_0xe5eb('0xbf')](function(_0x7d1ff5){return _0x4307d5(_0x7d1ff5);})['catch'](function(_0x51e5d8){return _0x59fea6(msgResponse(_0xe5eb('0x1db'),_0xe5eb('0x13f'),JSON[_0xe5eb('0x77')](_0x51e5d8)));});}}else{return _0x59fea6(msgResponse(_0xe5eb('0x1d9'),_0xe5eb('0x13f'),_0xe5eb('0x1de')));}});};};Dialer['prototype'][_0xe5eb('0x1d2')]=function(_0xc74dfe){var _0x43b684=this;return function(){var _0x20a55a=0x0;var _0x4c09d5=Math[_0xe5eb('0x1c2')](_0xc74dfe[_0xe5eb('0x8c')]*0x3e8);if(_0x4c09d5>0x0){_0x4c09d5=_0x4c09d5<0x64?0x64:_0x4c09d5;loggerPredictive['info'](_0xc74dfe[_0xe5eb('0x3a')],_0xe5eb('0x1df'),_0x4c09d5,_0xe5eb('0x44'));_0xc74dfe[_0xe5eb('0x95')]=setInterval(function(){_0x43b684[_0xe5eb('0x95')](_0xc74dfe);loggerPredictiveCalls[_0xe5eb('0x7d')](_0xe5eb('0x1e0'),_0x20a55a+=0x1);},_0x4c09d5);}else{loggerPredictive[_0xe5eb('0x7d')](_0xc74dfe[_0xe5eb('0x3a')],_0xe5eb('0x1e1'));}};};Dialer[_0xe5eb('0xae')][_0xe5eb('0x1e2')]=function(_0x47dc03,_0x27eaa6){var _0x4fa604=this;return function(_0x2b8128){if(_[_0xe5eb('0x7c')](_0x2b8128)){if(_[_0xe5eb('0xb2')](_0x27eaa6[_0xe5eb('0x1e3')])||!_0x27eaa6['recallme']){if(_0x47dc03['dialMethod']==='booked'){_0x47dc03['queueStatusComplete']=_[_0xe5eb('0x86')](_0x47dc03[_0xe5eb('0x12b')])?!![]:_0x47dc03[_0xe5eb('0x12b')];var _0xd6f6ff=uuid['v4']();_0x4fa604[_0xe5eb('0x23')][_0xd6f6ff]=new Action(_0x47dc03,_0x27eaa6,_0xd6f6ff);loggerBooked[_0xe5eb('0x7d')](_0xe5eb('0x1e4'),_0xd6f6ff,_0xe5eb('0x1e5'),JSON[_0xe5eb('0x77')](_0x47dc03[_0xe5eb('0x12b')]),'Queue:\x20',_0x47dc03[_0xe5eb('0x3a')]);if(_0x47dc03[_0xe5eb('0x12b')]){_0x47dc03[_0xe5eb('0x12b')]=![];_0x4fa604['queueBooked'][_0x4fa604[_0xe5eb('0x23')][_0xd6f6ff]['queue']]=[];ami['Action']({'actionid':_0xd6f6ff,'action':_0xe5eb('0x1e6'),'queue':_0x47dc03[_0xe5eb('0x3a')]})[_0xe5eb('0xbc')](function(){_0x4fa604[_0xe5eb('0xb8')](_0x47dc03);_0x4fa604[_0xe5eb('0xc4')]({'active':![],'ContactId':_0x4fa604['actions'][_0xd6f6ff][_0xe5eb('0xd9')],'ListId':_0x4fa604[_0xe5eb('0x23')][_0xd6f6ff][_0xe5eb('0xda')],'VoiceQueueId':_0x4fa604[_0xe5eb('0x23')][_0xd6f6ff][_0xe5eb('0xdb')]||undefined,'CampaignId':_0x4fa604[_0xe5eb('0x23')][_0xd6f6ff][_0xe5eb('0xdc')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4fa604[_0xe5eb('0x23')][_0xd6f6ff];});}else{loggerBooked[_0xe5eb('0x7d')]('[booked][checkContactBlack][else]',JSON[_0xe5eb('0x77')](_0x47dc03['queueStatusComplete']),_0xe5eb('0x1e7'),_0x47dc03['name']);_0x4fa604[_0xe5eb('0xb8')](_0x47dc03);_0x4fa604[_0xe5eb('0xc4')]({'active':![],'ContactId':_0x4fa604[_0xe5eb('0x23')][_0xd6f6ff]['ContactId'],'ListId':_0x4fa604[_0xe5eb('0x23')][_0xd6f6ff][_0xe5eb('0xda')],'VoiceQueueId':_0x4fa604['actions'][_0xd6f6ff][_0xe5eb('0xdb')]||undefined,'CampaignId':_0x4fa604[_0xe5eb('0x23')][_0xd6f6ff]['CampaignId']||undefined})[_0xe5eb('0xbc')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4fa604[_0xe5eb('0x23')][_0xd6f6ff];}}else{return _0x4fa604[_0xe5eb('0x1e8')](_0x47dc03,_0x27eaa6);}}else{if(getDiff(_0x27eaa6[_0xe5eb('0x1e9')])<_0x47dc03[_0xe5eb('0x1ea')]*0x3c){if(_0x27eaa6[_0xe5eb('0x1eb')]&&!_0x27eaa6[_0xe5eb('0x1eb')][_0xe5eb('0x1ec')]){_0x4fa604[_0xe5eb('0x97')]['run'](_0x27eaa6['id'])[_0xe5eb('0x130')](function(){_0x4fa604[_0xe5eb('0xb8')](_0x47dc03);});}else{_0x4fa604[_0xe5eb('0xc6')]({'active':![]},_0x27eaa6['id'],0x1)[_0xe5eb('0x130')](function(){_0x4fa604[_0xe5eb('0xb8')](_0x47dc03);});}}else{_0x47dc03[_0xe5eb('0x63')]+=0x1;_0x4fa604[_0xe5eb('0xb8')](_0x47dc03);if(_0x47dc03[_0xe5eb('0x1ed')]){_0x4fa604[_0xe5eb('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x27eaa6[_0xe5eb('0xd9')],'ListId':_0x27eaa6[_0xe5eb('0xda')],'VoiceQueueId':_0x27eaa6[_0xe5eb('0xdb')]||undefined,'CampaignId':_0x27eaa6[_0xe5eb('0xdc')]||undefined})[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x1ee')));_0x4fa604[_0xe5eb('0xd1')](createObjHistory(_0x47dc03,_0x27eaa6,_0xe5eb('0x1ef'),0x17,_0xe5eb('0x1f0')))[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x1f1')));}else{_0x4fa604[_0xe5eb('0xd7')](createObjHistory(_0x47dc03,_0x27eaa6,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0xe5eb('0x1f2'));}}}}else{_0x47dc03[_0xe5eb('0x1f3')]+=0x1;_0x4fa604[_0xe5eb('0xd7')](createObjHistory(_0x47dc03,_0x27eaa6,_0xe5eb('0x1f4'),0xd,_0xe5eb('0x1f5')),_0xe5eb('0x1f6'),_0xe5eb('0x1f7'));throw _0xe5eb('0x1f8');}};};Dialer[_0xe5eb('0xae')]['handleIvr']=function(_0xab0511){var _0x4b8eac=this;var _0x395750=_0xab0511[_0xe5eb('0x1f9')]-_0xab0511['originated']-_0xab0511['temp'];emitCampaignSummary(_0xab0511);if(_0x395750>0x0){if(_0x395750>this[_0xe5eb('0x21')]){_0x395750=this['maxNumberOriginate'];}_0xab0511[_0xe5eb('0xc9')]+=_0x395750;this['getContactDialerIvr'](_0xab0511['id'],_0x395750,_0xab0511[_0xe5eb('0x1fa')],_0xab0511)[_0xe5eb('0xbf')](function(_0x44c066){_0xab0511[_0xe5eb('0xc9')]-=_0x395750;_0xab0511['temp']=_0xab0511['temp']>0x0?_0xab0511[_0xe5eb('0xc9')]:0x0;if(!checkContactEmpty(_0x44c066)){_0xab0511[_0xe5eb('0x39')]=_0xe5eb('0xa4');logger[_0xe5eb('0x7d')]('[getContactCampaign2][Empty]'+_0xab0511[_0xe5eb('0x3a')]);}else{_0xab0511[_0xe5eb('0x70')]+=_0x44c066[_0xe5eb('0x147')];_0xab0511['message']=_0xe5eb('0x1fb');for(var _0x241ffb=0x0;_0x241ffb<_0x44c066['length'];_0x241ffb+=0x1){_0xab0511[_0xe5eb('0x1fc')]+=0x1;if(_[_0xe5eb('0xb2')](_0x44c066[_0x241ffb])||_[_0xe5eb('0xb2')](_0x44c066[_0x241ffb][_0xe5eb('0x163')])||_['isNil'](_0x44c066[_0x241ffb][_0xe5eb('0x163')][_0xe5eb('0x164')])){_0x4b8eac[_0xe5eb('0xd5')](_0xe5eb('0x1fd'),_0xab0511,_0x44c066[_0x241ffb]);}else{_0x4b8eac[_0xe5eb('0x1fe')](_['pick'](_0x44c066[_0x241ffb],[_0xe5eb('0xdc'),_0xe5eb('0x1ff')]))[_0xe5eb('0xbf')](_0x4b8eac[_0xe5eb('0x1e2')](_0xab0511,_0x44c066[_0x241ffb]))[_0xe5eb('0xbc')](_0x4b8eac['loggerHandler']('[actionOriginateIvr]\x20',_0xab0511));}}}})['catch'](loggerGetContactDialer(_0xe5eb('0x200'),_0xab0511,_0x395750));}};Dialer[_0xe5eb('0xae')][_0xe5eb('0x154')]=function(_0x57e186,_0x4de5b8){var _0x493512=this;var _0x2a6bc7=[];var _0x5d5fff=_0x4de5b8>=0x1?_0x4de5b8:0x1;if(_0x57e186[_0xe5eb('0x56')]===_0xe5eb('0x8')){_0x5d5fff=0x1;}var _0x2b72f5=Math[_0xe5eb('0x1c2')](_0x57e186[_0xe5eb('0x4b')]*_0x5d5fff)-_0x57e186[_0xe5eb('0x70')]-_0x57e186[_0xe5eb('0xc9')];emitVoiceQueueSummary(_0x57e186);if(_0x57e186[_0xe5eb('0x201')]>0x0){var _0x355c81=_0x57e186[_0xe5eb('0x201')]-_0x57e186[_0xe5eb('0x70')]-_0x57e186['talking']-_0x57e186[_0xe5eb('0xc9')]-_0x57e186[_0xe5eb('0x4d')];if(_0x2b72f5>_0x355c81){_0x2b72f5=_0x355c81;}}if(_0x2b72f5>0x0){if(_0x57e186[_0xe5eb('0x56')]==='booked'){_0x2b72f5=0x1;}if(_0x2b72f5>this[_0xe5eb('0x21')]){_0x2b72f5=this['maxNumberOriginate'];}_0x57e186[_0xe5eb('0xc9')]+=_0x2b72f5;for(var _0x3887af in this[_0xe5eb('0x1f')]){if(typeof this[_0xe5eb('0x1f')][_0x3887af]!==_0xe5eb('0x9f')){if(this[_0xe5eb('0x1f')][_0x3887af][_0xe5eb('0xab')]===_0xe5eb('0x202')&&this['agents'][_0x3887af][_0xe5eb('0xe2')]==='reachable'){_0x2a6bc7[_0xe5eb('0x128')](this[_0xe5eb('0x1f')][_0x3887af]['id']);}}}this[_0xe5eb('0xc8')](_0x57e186['id'],_0x2a6bc7,_0x2b72f5,_0x57e186[_0xe5eb('0x1fa')],_0x57e186)[_0xe5eb('0xbf')](function(_0xb95c2e){_0x57e186['temp']-=_0x2b72f5;_0x57e186[_0xe5eb('0xc9')]=_0x57e186['temp']>0x0?_0x57e186[_0xe5eb('0xc9')]:0x0;if(!checkContactEmpty(_0xb95c2e)){_0x493512[_0xe5eb('0xbb')](_0x57e186)[_0xe5eb('0xbf')](sendMessageReschedule(_0x57e186))[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x203')));}else{_0x57e186[_0xe5eb('0x70')]+=_0xb95c2e[_0xe5eb('0x147')];_0x57e186['message']=_0x57e186[_0xe5eb('0x56')]===_0xe5eb('0x8')?_0xe5eb('0x204'):_0xe5eb('0x1fb');for(var _0x181c23=0x0;_0x181c23<_0xb95c2e[_0xe5eb('0x147')];_0x181c23+=0x1){if(_[_0xe5eb('0xb2')](_0xb95c2e[_0x181c23])||_[_0xe5eb('0xb2')](_0xb95c2e[_0x181c23][_0xe5eb('0x163')])||_[_0xe5eb('0xb2')](_0xb95c2e[_0x181c23][_0xe5eb('0x163')][_0xe5eb('0x164')])){_0x493512['emptyContact'](_0xe5eb('0x1fd'),_0x57e186,_0xb95c2e[_0x181c23]);}else{_0x493512[_0xe5eb('0xbd')](_['pick'](_0xb95c2e[_0x181c23],['VoiceQueueId',_0xe5eb('0x1ff')]))[_0xe5eb('0xbf')](_0x493512['checkContactBlack'](_0x57e186,_0xb95c2e[_0x181c23]))['catch'](_0x493512['loggerHandler'](_0xe5eb('0x1fd'),_0x57e186));}}}})[_0xe5eb('0xbc')](loggerGetContactDialer(_0xe5eb('0x205'),_0x57e186,_0x2b72f5));}};Dialer[_0xe5eb('0xae')][_0xe5eb('0x95')]=function(_0x140c35){if(_0x140c35[_0xe5eb('0x201')]>0x0){var _0x15d0c1=_0x140c35[_0xe5eb('0x201')]-_0x140c35[_0xe5eb('0x70')]-_0x140c35['talking'];if(_0x15d0c1>0x0){this['tryOriginatePredictive'](_0x140c35);}else{loggerPredictiveCalls[_0xe5eb('0x7d')](_0xe5eb('0x206'));}}else{this['tryOriginatePredictive'](_0x140c35);}};Dialer[_0xe5eb('0xae')][_0xe5eb('0x207')]=function(_0x55ce55){var _0x49c329=this;var _0x33056e=[];_0x55ce55[_0xe5eb('0x70')]+=0x1;for(var _0x1b7394 in this[_0xe5eb('0x1f')]){if(typeof this[_0xe5eb('0x1f')][_0x1b7394]!==_0xe5eb('0x9f')){if(this['agents'][_0x1b7394][_0xe5eb('0xab')]===_0xe5eb('0x202')&&this['agents'][_0x1b7394][_0xe5eb('0xe2')]===_0xe5eb('0xe1')){_0x33056e[_0xe5eb('0x128')](this['agents'][_0x1b7394]['id']);}}}this[_0xe5eb('0xc8')](_0x55ce55['id'],_0x33056e,0x1,_0x55ce55[_0xe5eb('0x1fa')],_0x55ce55)[_0xe5eb('0xbf')](function(_0x25aed0){if(!checkContactEmpty(_0x25aed0)){checkContactLowerLimitOriginate(_0x55ce55,0x1,0x0);_0x49c329[_0xe5eb('0xbb')](_0x55ce55)['then'](sendMessageReschedule(_0x55ce55))[_0xe5eb('0xbc')](loggerCatch(_0xe5eb('0x203')));}else{_0x55ce55['message']=_0xe5eb('0x1fb');if(_[_0xe5eb('0xb2')](_0x25aed0[0x0])||_[_0xe5eb('0xb2')](_0x25aed0[0x0][_0xe5eb('0x163')])||_[_0xe5eb('0xb2')](_0x25aed0[0x0][_0xe5eb('0x163')][_0xe5eb('0x164')])){_0x49c329[_0xe5eb('0xd5')](_0xe5eb('0x1fd'),_0x55ce55,_0x25aed0[0x0]);}else{_0x49c329[_0xe5eb('0xbd')](_[_0xe5eb('0xd8')](_0x25aed0[0x0],[_0xe5eb('0xdb'),_0xe5eb('0x1ff')]))[_0xe5eb('0xbf')](_0x49c329[_0xe5eb('0x1e2')](_0x55ce55,_0x25aed0[0x0]))['catch'](_0x49c329[_0xe5eb('0xd4')](_0xe5eb('0x208'),_0x55ce55));}}})['catch'](loggerGetContactDialer(_0xe5eb('0x209'),_0x55ce55,0x1));emitVoiceQueueSummary(_0x55ce55);};Dialer['prototype'][_0xe5eb('0x1d6')]=function(_0x14303b,_0x5ac605,_0x2bf500,_0x2e779e,_0x4af7c4,_0x5d98fd){loggerPredictive[_0xe5eb('0x7d')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xe5eb('0x7d')]('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',_0x14303b);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ac605);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x20a'),_0x2bf500);loggerPredictive[_0xe5eb('0x7d')]('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',_0x2e779e);loggerPredictive[_0xe5eb('0x7d')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4af7c4);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x90'));return new BPromise(function(_0x15631f,_0x461204){if(_0x14303b<=0x0||isNaN(_0x14303b)){return _0x461204(msgResponse('[abandonmentRate]',_0xe5eb('0x43'),'m\x20=\x20'+_0x14303b));}if(_0x2bf500<=0x0||isNaN(_0x2bf500)){return _0x461204(msgResponse('[abandonmentRate]',_0xe5eb('0x43'),_0xe5eb('0x20b')+_0x2bf500));}if(_0x2e779e<=0x0||isNaN(_0x2e779e)){return _0x461204(msgResponse(_0xe5eb('0x20c'),'Error',_0xe5eb('0x20d')+_0x2e779e));}if(_0x5ac605<=0x0||isNaN(_0x5ac605)){return _0x461204(msgResponse(_0xe5eb('0x20c'),_0xe5eb('0x43'),_0xe5eb('0x20e')+_0x5ac605));}if(_0x4af7c4<=0x0||isNaN(_0x4af7c4)){return _0x461204(msgResponse(_0xe5eb('0x20c'),_0xe5eb('0x43'),'Amax\x20=\x20'+_0x4af7c4));}_0x5d98fd=_0x5d98fd||0x0;var _0x5e06eb=0x1/_0x2bf500;var _0x56c111=0x0;var _0x1bf3d1=0x0;var _0x27e6dd=0x0;var _0x400c0e=0x0;for(var _0x5f749b=0x0;_0x27e6dd<_0x4af7c4;_0x5f749b+=0x1){_0x1bf3d1=_0x5f749b/_0x5ac605;_0x56c111=(_0x2e779e*_0x1bf3d1+_0x5d98fd)/_0x5e06eb;_0x27e6dd=erlangb(_0x56c111,_0x14303b);_0x400c0e=_0x56c111/_0x14303b*(0x1-erlangb(_0x56c111,_0x14303b));}return _0x15631f({'erlangCalls':_0x5f749b,'erlangCallToSecond':_0x5ac605/_0x5f749b,'erlangAbandonmentRate':_0x27e6dd,'erlangBusyFactor':_0x400c0e});});};Dialer[_0xe5eb('0xae')]['busyFactor']=function(_0x419d52,_0x4313e2,_0x34c2b3,_0x52d4a8,_0x249eb1,_0x4710fa){loggerPredictive[_0xe5eb('0x7d')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xe5eb('0x7d')]('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',_0x419d52);loggerPredictive['info'](_0xe5eb('0x20f'),_0x4313e2);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',_0x34c2b3);loggerPredictive[_0xe5eb('0x7d')](_0xe5eb('0x210'),_0x52d4a8);loggerPredictive['info'](_0xe5eb('0x211'),_0x249eb1);loggerPredictive['info'](_0xe5eb('0x90'));return new BPromise(function(_0x441e1e,_0x3d6de9){if(_0x419d52<=0x0||isNaN(_0x419d52)){return _0x3d6de9(msgResponse(_0xe5eb('0x212'),_0xe5eb('0x43'),_0xe5eb('0x213')+_0x419d52));}if(_0x34c2b3<=0x0||isNaN(_0x34c2b3)){return _0x3d6de9(msgResponse(_0xe5eb('0x212'),_0xe5eb('0x43'),'Ts\x20=\x20'+_0x34c2b3));}if(_0x52d4a8<=0x0||isNaN(_0x52d4a8)){return _0x3d6de9(msgResponse('[busyFactor]',_0xe5eb('0x43'),_0xe5eb('0x20d')+_0x52d4a8));}if(_0x4313e2<=0x0||isNaN(_0x4313e2)){return _0x3d6de9(msgResponse('[busyFactor]',_0xe5eb('0x43'),_0xe5eb('0x20e')+_0x4313e2));}if(_0x249eb1<=0x0||isNaN(_0x249eb1)){return _0x3d6de9(msgResponse('[busyFactor]',_0xe5eb('0x43'),'Umin\x20=\x20'+_0x249eb1));}_0x4710fa=_0x4710fa||0x0;var _0x503368=0x1/_0x34c2b3;var _0x2bc372=0x0;var _0x5ea7df=0x0;var _0x40c40f=0x0;var _0x88cd2c=0x0;for(var _0x20f0fc=0x0;_0x88cd2c<_0x249eb1;_0x20f0fc+=0x1){_0x5ea7df=_0x20f0fc/_0x4313e2;_0x2bc372=(_0x52d4a8*_0x5ea7df+_0x4710fa)/_0x503368;_0x40c40f=erlangb(_0x2bc372,_0x419d52);_0x88cd2c=_0x2bc372/_0x419d52*(0x1-erlangb(_0x2bc372,_0x419d52));}return _0x441e1e({'erlangCalls':_0x20f0fc,'erlangCallToSecond':_0x4313e2/_0x20f0fc,'erlangAbandonmentRate':_0x40c40f,'erlangBusyFactor':_0x88cd2c});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index eb65841..1ba25a7 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 _0x9c34=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x26a169,_0x54f908){var _0x1f07a1=function(_0x344027){while(--_0x344027){_0x26a169['push'](_0x26a169['shift']());}};_0x1f07a1(++_0x54f908);}(_0x9c34,0xcc));var _0x49c3=function(_0x22afe1,_0x4e0c1a){_0x22afe1=_0x22afe1-0x0;var _0x5aaffc=_0x9c34[_0x22afe1];return _0x5aaffc;};'use strict';var util=require(_0x49c3('0x0'));var _=require(_0x49c3('0x1'));var moment=require(_0x49c3('0x2'));function getSeconds(_0x5d399b,_0x476690){var _0x20dee6=moment(_0x5d399b)[_0x49c3('0x3')](0x0);var _0x5ea8c7=moment(_0x476690)[_0x49c3('0x3')](0x0);return _0x20dee6[_0x49c3('0x4')](_0x5ea8c7,'seconds');}function QueueCallerAbandon(_0x417a47,_0x4189d3){this[_0x49c3('0x5')]=_0x417a47[_0x49c3('0x5')];this['type']=_0x417a47[_0x49c3('0x6')];this[_0x49c3('0x7')]=_0x417a47[_0x49c3('0x6')]===_0x49c3('0x8')?_0x49c3('0x9'):_0x417a47[_0x49c3('0x6')];this[_0x49c3('0xa')]=_0x417a47[_0x49c3('0xa')];this['countcongestionretry']=_0x417a47[_0x49c3('0xb')];this[_0x49c3('0xc')]=_0x417a47[_0x49c3('0xc')];this[_0x49c3('0xd')]=_0x417a47[_0x49c3('0xa')]+_0x417a47[_0x49c3('0xb')]+_0x417a47[_0x49c3('0xc')]+_0x417a47[_0x49c3('0xe')]+_0x417a47[_0x49c3('0xf')]+_0x417a47[_0x49c3('0x10')]+_0x417a47['countmachineretry']+_0x417a47['countagentrejectretry'];this[_0x49c3('0xe')]=_0x417a47[_0x49c3('0xe')];this[_0x49c3('0xf')]=_0x417a47[_0x49c3('0xf')];this[_0x49c3('0x10')]=_0x417a47['countabandonedretry'];this[_0x49c3('0x11')]=_0x417a47[_0x49c3('0x11')];this[_0x49c3('0x12')]=_0x417a47[_0x49c3('0x12')];this[_0x49c3('0x13')]=_0x4189d3[_0x49c3('0x13')];this[_0x49c3('0x14')]=_0x417a47[_0x49c3('0x15')];this[_0x49c3('0x16')]=_0x417a47[_0x49c3('0x17')];this['starttime']=_0x417a47['starttime'];this[_0x49c3('0x18')]=_0x417a47[_0x49c3('0x18')];this[_0x49c3('0x19')]=_0x417a47['droptime'];this[_0x49c3('0x1a')]=this['droptime'];this[_0x49c3('0x1b')]=getSeconds(_0x417a47[_0x49c3('0x18')],_0x417a47['starttime']);this[_0x49c3('0x1c')]=getSeconds(this[_0x49c3('0x19')],_0x417a47[_0x49c3('0x18')]);this[_0x49c3('0x1d')]=0x0;this['queue']=_0x4189d3[_0x49c3('0x9')];this[_0x49c3('0x1e')]=_0x4189d3['connectedlinename'];this[_0x49c3('0x1f')]=_0x4189d3[_0x49c3('0x1f')];this[_0x49c3('0x20')]=_0x417a47['callback'];this[_0x49c3('0x21')]=_0x417a47[_0x49c3('0x21')];this[_0x49c3('0x22')]=_0x417a47[_0x49c3('0x22')];this[_0x49c3('0x23')]=_0x417a47[_0x49c3('0x23')];this[_0x49c3('0x24')]=_0x417a47['ContactId'];this[_0x49c3('0x25')]=_0x417a47[_0x49c3('0x25')];this[_0x49c3('0x26')]=_0x417a47['UserId'];this[_0x49c3('0x27')]=_0x417a47['VoiceQueueId'];this[_0x49c3('0x28')]=_0x417a47[_0x49c3('0x28')];this[_0x49c3('0x29')]=_0x417a47[_0x49c3('0x29')]||'';this[_0x49c3('0x2a')]=_0x417a47[_0x49c3('0x2a')]||'';}module[_0x49c3('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0xa4f1=['ringtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime'];(function(_0x264370,_0x108e6f){var _0x594271=function(_0xff7632){while(--_0xff7632){_0x264370['push'](_0x264370['shift']());}};_0x594271(++_0x108e6f);}(_0xa4f1,0xe2));var _0x1a4f=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xa4f1[_0x122096];return _0x3d1966;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1a4f('0x0'));function getSeconds(_0x10f010,_0x56c57f){var _0x3c101b=moment(_0x10f010)['milliseconds'](0x0);var _0x439ad6=moment(_0x56c57f)[_0x1a4f('0x1')](0x0);return _0x3c101b[_0x1a4f('0x2')](_0x439ad6,_0x1a4f('0x3'));}function QueueCallerAbandon(_0x13fe86,_0x294300){this[_0x1a4f('0x4')]=_0x13fe86[_0x1a4f('0x4')];this[_0x1a4f('0x5')]=_0x13fe86[_0x1a4f('0x5')];this[_0x1a4f('0x6')]=_0x13fe86[_0x1a4f('0x5')]===_0x1a4f('0x7')?_0x1a4f('0x8'):_0x13fe86[_0x1a4f('0x5')];this[_0x1a4f('0x9')]=_0x13fe86['countbusyretry'];this[_0x1a4f('0xa')]=_0x13fe86[_0x1a4f('0xa')];this[_0x1a4f('0xb')]=_0x13fe86[_0x1a4f('0xb')];this[_0x1a4f('0xc')]=_0x13fe86['countbusyretry']+_0x13fe86[_0x1a4f('0xa')]+_0x13fe86['countnoanswerretry']+_0x13fe86[_0x1a4f('0xd')]+_0x13fe86[_0x1a4f('0xe')]+_0x13fe86[_0x1a4f('0xf')]+_0x13fe86[_0x1a4f('0x10')]+_0x13fe86['countagentrejectretry'];this[_0x1a4f('0xd')]=_0x13fe86['countnosuchnumberretry'];this['countdropretry']=_0x13fe86[_0x1a4f('0xe')];this[_0x1a4f('0xf')]=_0x13fe86['countabandonedretry'];this[_0x1a4f('0x10')]=_0x13fe86[_0x1a4f('0x10')];this['countagentrejectretry']=_0x13fe86[_0x1a4f('0x11')];this['uniqueid']=_0x294300[_0x1a4f('0x12')];this[_0x1a4f('0x13')]=_0x13fe86['name'];this[_0x1a4f('0x14')]=_0x13fe86[_0x1a4f('0x15')];this[_0x1a4f('0x16')]=_0x13fe86[_0x1a4f('0x16')];this[_0x1a4f('0x17')]=_0x13fe86[_0x1a4f('0x17')];this['droptime']=_0x13fe86[_0x1a4f('0x18')];this[_0x1a4f('0x19')]=this[_0x1a4f('0x18')];this[_0x1a4f('0x1a')]=getSeconds(_0x13fe86['responsetime'],_0x13fe86[_0x1a4f('0x16')]);this['holdtime']=getSeconds(this['droptime'],_0x13fe86[_0x1a4f('0x17')]);this['talktime']=0x0;this[_0x1a4f('0x8')]=_0x294300['queue'];this[_0x1a4f('0x1b')]=_0x294300[_0x1a4f('0x1c')];this[_0x1a4f('0x1d')]=_0x294300[_0x1a4f('0x1d')];this[_0x1a4f('0x1e')]=_0x13fe86[_0x1a4f('0x1e')];this[_0x1a4f('0x1f')]=_0x13fe86['callbackuniqueid'];this[_0x1a4f('0x20')]=_0x13fe86['callbackat'];this[_0x1a4f('0x21')]=_0x13fe86[_0x1a4f('0x21')];this['ContactId']=_0x13fe86[_0x1a4f('0x22')];this[_0x1a4f('0x23')]=_0x13fe86[_0x1a4f('0x23')];this[_0x1a4f('0x24')]=_0x13fe86[_0x1a4f('0x24')];this['VoiceQueueId']=_0x13fe86[_0x1a4f('0x25')];this['CampaignId']=_0x13fe86[_0x1a4f('0x26')];this[_0x1a4f('0x27')]=_0x13fe86[_0x1a4f('0x27')]||'';this[_0x1a4f('0x28')]=_0x13fe86[_0x1a4f('0x28')]||'';}module[_0x1a4f('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 c848558..ddd41a2 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(_0x57aeaf,_0x362bb9){var _0x3d4174=function(_0x23bffb){while(--_0x23bffb){_0x57aeaf['push'](_0x57aeaf['shift']());}};_0x3d4174(++_0x362bb9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x1ff1da,_0x3eb6cd){var _0x4d0b2f=function(_0x3783ce){while(--_0x3783ce){_0x1ff1da['push'](_0x1ff1da['shift']());}};_0x4d0b2f(++_0x3eb6cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 62843c2..f156c71 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 _0x2642=['execOriginate','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','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','format','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','syncHangup','syncOriginateResponse','syncNewchannel','context','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','hasOwnProperty','prototype','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','send'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x2642,0x1e2));var _0x2264=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2642[_0x501510];return _0x1e6ee5;};'use strict';var util=require('util');var _=require(_0x2264('0x0'));var BPromise=require(_0x2264('0x1'));var uuid=require(_0x2264('0x2'));var moment=require(_0x2264('0x3'));var path=require('path');var tiff2pdf=require(_0x2264('0x4'));var gs=require(_0x2264('0x5'));var logger=require('../../../config/logger')(_0x2264('0x6'));var ami=require(_0x2264('0x7'));var rpcDb=require(_0x2264('0x8'));var Channel=require(_0x2264('0x9'));var ut=require(_0x2264('0xa'));var Action=require(_0x2264('0xb'));var faxAccount=require(_0x2264('0xc'));var attachment=require(_0x2264('0xd'));var faxMessage=require(_0x2264('0xe'));function Fax(_0x36edf9){this[_0x2264('0xf')]={};this[_0x2264('0x10')]=_0x36edf9[_0x2264('0x10')];this[_0x2264('0x11')]=_0x36edf9[_0x2264('0x11')];this['actions']={};ami['on'](_0x2264('0x12'),this['syncNewchannel'][_0x2264('0x13')](this));ami['on']('varset',this[_0x2264('0x14')][_0x2264('0x13')](this));ami['on'](_0x2264('0x15'),this[_0x2264('0x16')][_0x2264('0x13')](this));ami['on'](_0x2264('0x17'),this[_0x2264('0x18')][_0x2264('0x13')](this));ami['on'](_0x2264('0x19'),this['syncFaxStatus'][_0x2264('0x13')](this));ami['on'](_0x2264('0x1a'),this[_0x2264('0x1b')]['bind'](this));ami['on']('hangup',this[_0x2264('0x1c')][_0x2264('0x13')](this));ami['on']('originateresponse',this[_0x2264('0x1d')]['bind'](this));}Fax['prototype'][_0x2264('0x1e')]=function(_0x59e8ec){if(_0x59e8ec[_0x2264('0x1f')]==='from-voip-provider'){for(var _0x1e7a0b in this[_0x2264('0x10')]){if(this[_0x2264('0x10')]['hasOwnProperty'](_0x1e7a0b)){if(_0x59e8ec[_0x2264('0x20')]===this[_0x2264('0x10')][_0x1e7a0b][_0x2264('0x21')]){this[_0x2264('0xf')][_0x59e8ec['uniqueid']]={};this[_0x2264('0xf')][_0x59e8ec[_0x2264('0x22')]][_0x2264('0x23')]=_0x59e8ec[_0x2264('0x23')];this['channels'][_0x59e8ec[_0x2264('0x22')]]['id']=this[_0x2264('0x10')][_0x1e7a0b]['id'];this[_0x2264('0xf')][_0x59e8ec[_0x2264('0x22')]]['name']=this[_0x2264('0x10')][_0x1e7a0b][_0x2264('0x24')];logger[_0x2264('0x25')](_0x59e8ec[_0x2264('0x22')],_0x2264('0x26'));}}}}if(this[_0x2264('0x27')][_0x59e8ec[_0x2264('0x22')]]){this[_0x2264('0xf')][_0x59e8ec['uniqueid']]={};this[_0x2264('0xf')][_0x59e8ec['uniqueid']]['channel']=_0x59e8ec[_0x2264('0x23')];logger[_0x2264('0x25')](_0x59e8ec[_0x2264('0x22')],'\x20syncNewchannel\x20');}};Fax['prototype'][_0x2264('0x14')]=function(_0x3bf320){if(this[_0x2264('0xf')][_0x3bf320[_0x2264('0x22')]]){for(var _0x4a8d74 in _0x3bf320[_0x2264('0x28')]){if(_0x3bf320['variable'][_0x2264('0x29')](_0x4a8d74)){this['channels'][_0x3bf320['uniqueid']][_0x4a8d74]=_0x3bf320['value'];}}}};Fax[_0x2264('0x2a')][_0x2264('0x16')]=function(_0x54c710){if(this[_0x2264('0xf')][_0x54c710[_0x2264('0x22')]]){this[_0x2264('0xf')][_0x54c710[_0x2264('0x22')]][_0x2264('0x2b')]=_0x54c710['channelstate'];this['channels'][_0x54c710[_0x2264('0x22')]]['channelstatedesc']=_0x54c710[_0x2264('0x2c')];}};Fax['prototype'][_0x2264('0x18')]=function(_0x568d95){if(this['channels'][_0x568d95[_0x2264('0x22')]]){for(var _0x52f91d in _0x568d95[_0x2264('0x28')]){if(_0x568d95['variable'][_0x2264('0x29')](_0x52f91d)){this[_0x2264('0xf')][_0x568d95[_0x2264('0x22')]][_0x52f91d]=_0x568d95['value'];}}}};Fax[_0x2264('0x2a')][_0x2264('0x2d')]=function(_0x196d3d){if(this[_0x2264('0xf')][_0x196d3d[_0x2264('0x22')]]){this[_0x2264('0xf')][_0x196d3d[_0x2264('0x22')]][_0x2264('0x2e')]=_0x196d3d[_0x2264('0x2e')];this[_0x2264('0xf')][_0x196d3d[_0x2264('0x22')]][_0x2264('0x2f')]=_0x196d3d['status'];this[_0x2264('0xf')][_0x196d3d[_0x2264('0x22')]][_0x2264('0x21')]=_0x196d3d[_0x2264('0x21')];this['channels'][_0x196d3d['uniqueid']][_0x2264('0x30')]=_0x196d3d[_0x2264('0x30')];logger[_0x2264('0x25')](_0x196d3d[_0x2264('0x22')],_0x2264('0x31'));}};Fax['prototype']['syncReceiveFax']=function(_0x17d948){var _0x6b0de8=this;if(this[_0x2264('0xf')][_0x17d948['uniqueid']]){var _0x3ed0ee=this['channels'][_0x17d948['uniqueid']]['id'];this['channels'][_0x17d948[_0x2264('0x22')]][_0x2264('0x32')]=_0x17d948[_0x2264('0x32')];this[_0x2264('0xf')][_0x17d948[_0x2264('0x22')]][_0x2264('0x33')]=_0x17d948[_0x2264('0x33')];this[_0x2264('0xf')][_0x17d948[_0x2264('0x22')]]['localstationid']=_0x17d948['localstationid'];this[_0x2264('0xf')][_0x17d948[_0x2264('0x22')]][_0x2264('0x34')]=_0x17d948[_0x2264('0x34')];this['channels'][_0x17d948[_0x2264('0x22')]][_0x2264('0x35')]=_0x17d948[_0x2264('0x35')];this[_0x2264('0xf')][_0x17d948[_0x2264('0x22')]][_0x2264('0x30')]=_0x17d948[_0x2264('0x30')];this['channels'][_0x17d948[_0x2264('0x22')]][_0x2264('0x36')]=_0x17d948[_0x2264('0x36')];if(this[_0x2264('0xf')][_0x17d948['uniqueid']][_0x2264('0x33')]>0x0){tiff2pdf(_0x17d948[_0x2264('0x30')],_0x2264('0x37'),function(_0x3657dd){logger[_0x2264('0x25')](_0x17d948[_0x2264('0x22')],_0x2264('0x38'),_0x3657dd[_0x2264('0x39')]);attachment['create']({'name':path[_0x2264('0x3a')](_0x17d948['filename'])['name'],'basename':path['parse'](_0x17d948[_0x2264('0x30')])[_0x2264('0x24')]+_0x2264('0x3b'),'type':_0x2264('0x3c')})[_0x2264('0x3d')](function(_0x53e27b){faxAccount[_0x2264('0x3e')](_0x3ed0ee,{'from':_0x17d948[_0x2264('0x36')],'mapKey':'fax','body':path[_0x2264('0x3a')](_0x17d948['filename'])['name']+_0x2264('0x3b'),'AttachmentId':_0x53e27b['id']})['catch'](function(_0x1fa3f0){logger[_0x2264('0x3f')](_0x17d948[_0x2264('0x22')],_0x2264('0x40'),JSON[_0x2264('0x41')](_0x1fa3f0));});})[_0x2264('0x42')](function(_0x4d73d4){logger[_0x2264('0x3f')](_0x17d948[_0x2264('0x22')],_0x2264('0x43'),JSON[_0x2264('0x41')](_0x4d73d4));});});}logger[_0x2264('0x25')](_0x17d948[_0x2264('0x22')],_0x2264('0x43'));}};Fax[_0x2264('0x2a')][_0x2264('0x1d')]=function(_0x49c1f6){if(this[_0x2264('0x27')][_0x49c1f6[_0x2264('0x22')]]){_[_0x2264('0x44')](this[_0x2264('0xf')][_0x49c1f6[_0x2264('0x22')]],_['pick'](_0x49c1f6,[_0x2264('0x45'),_0x2264('0x46')]));}};function updateStatus(_0xe126a8){if(_0xe126a8[_0x2264('0x47')]){faxMessage[_0x2264('0x48')](_0xe126a8[_0x2264('0x47')],{'failMessage':_0x2264('0x49')})[_0x2264('0x3d')](function(_0x2beef4){ut[_0x2264('0x4a')](_0x2264('0x4b'),_0x2beef4);})[_0x2264('0x42')](function(_0x2d2223){ut['logger'](_0x2264('0x4c'),_0x2d2223);});}else{ut['logger'](_0x2264('0x4d'));}}Fax[_0x2264('0x2a')][_0x2264('0x4e')]=function(_0x575946,_0x5aaf37,_0x155b9d){var _0x41a583=this;var _0x3d4661={};if(_0x5aaf37){_0x3d4661={'read':_0x5aaf37};}else{_0x3d4661={'failMessage':_0x155b9d};}if(this[_0x2264('0x27')][_0x575946][_0x2264('0x47')]){faxMessage['update'](this['actions'][_0x575946]['AttachmentId'],_0x3d4661)['then'](function(_0x12ec6c){ut[_0x2264('0x4a')](_0x2264('0x4f'),_0x12ec6c);})[_0x2264('0x42')](function(_0x2afde5){ut[_0x2264('0x4a')](_0x2264('0x50'),_0x2afde5);})[_0x2264('0x51')](function(){delete _0x41a583[_0x2264('0xf')][_0x575946];delete _0x41a583[_0x2264('0x27')][_0x575946];});}else{ut[_0x2264('0x4a')](_0x2264('0x52'));delete this[_0x2264('0xf')][_0x575946];delete this[_0x2264('0x27')][_0x575946];}};Fax[_0x2264('0x2a')][_0x2264('0x1c')]=function(_0x2159d4){var _0x38d887=this;if(this[_0x2264('0xf')][_0x2159d4['uniqueid']]){if(this['actions'][_0x2159d4['uniqueid']]){this[_0x2264('0xf')][_0x2159d4['uniqueid']]['id']=this['actions'][_0x2159d4[_0x2264('0x22')]]['id'];this[_0x2264('0xf')][_0x2159d4[_0x2264('0x22')]]['name']=this[_0x2264('0x27')][_0x2159d4['uniqueid']][_0x2264('0x24')];}logger[_0x2264('0x25')](_0x2159d4[_0x2264('0x22')],this['actions'][_0x2159d4[_0x2264('0x22')]]?_0x2264('0x53'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this['channels'][_0x2159d4[_0x2264('0x22')]]));if(this[_0x2264('0x27')][_0x2159d4[_0x2264('0x22')]]){if(this[_0x2264('0xf')][_0x2159d4['uniqueid']][_0x2264('0x54')]>0x0&&this['channels'][_0x2159d4[_0x2264('0x22')]][_0x2264('0x19')]===_0x2264('0x55')){this['updateStatus'](_0x2159d4[_0x2264('0x22')],!![]);}else{this['updateStatus'](_0x2159d4[_0x2264('0x22')],![],this['channels'][_0x2159d4[_0x2264('0x22')]][_0x2264('0x56')]?'SENDING\x20FAILED:\x20'+this[_0x2264('0xf')][_0x2159d4[_0x2264('0x22')]][_0x2264('0x56')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0x2264('0x57')]=function(_0x461901){var _0x215c22=this;return new BPromise(function(_0x5503b7,_0x5d72d7){_0x215c22[_0x2264('0x58')](_0x461901,_0x215c22[_0x2264('0x10')][_0x461901['FaxAccountId']])[_0x2264('0x3d')](function(_0x8dd645){ut['logger']('[Fax][execOriginate][success]',_0x8dd645);_0x5503b7(ut[_0x2264('0x39')](_0x2264('0x59')));})[_0x2264('0x42')](function(_0x1dbba3){ut[_0x2264('0x4a')]('[Fax][execOriginate][failure]',_0x1dbba3);updateStatus(_0x461901);_0x5d72d7(ut['message'](_0x2264('0x5a')));});});};Fax[_0x2264('0x2a')][_0x2264('0x5b')]=function(_0x5aebd7){var _0x2f5be4=this;return new BPromise(function(_0x8b8943,_0x410dca){var _0x5c77df=_0x2f5be4[_0x2264('0x5c')](_0x2f5be4[_0x2264('0x10')][_0x5aebd7[_0x2264('0x5d')]][_0x2264('0x5e')],_0x5aebd7);if(_0x5c77df['isValid']){_0x8b8943(ut[_0x2264('0x39')]('Trunk\x20Reachable'));}else{_0x410dca(ut[_0x2264('0x39')](_0x5c77df[_0x2264('0x39')]));}});};function originate(_0xaa2bac,_0x44a41b,_0x4c76af){return new BPromise(function(_0x32e747,_0x1460e3){if(_0x4c76af){var _0x1b86a4=util['format'](_0x2264('0x5f'),path['parse'](_0xaa2bac[_0x2264('0x60')])[_0x2264('0x24')],_0xaa2bac[_0x2264('0x60')]);gs['execute'](_0x1b86a4)[_0x2264('0x3d')](function(){_0xaa2bac['path']=util[_0x2264('0x61')]('%s/%s.tif',path[_0x2264('0x3a')](_0xaa2bac['path'])['dir'],path['parse'](_0xaa2bac[_0x2264('0x60')])['name']);_0x44a41b['XMF-PATH']=_0xaa2bac['path'];ut[_0x2264('0x4a')](_0x2264('0x62'),'');ami[_0x2264('0x63')](ut['variablesAction'](_0xaa2bac,_0x44a41b))['then'](function(_0x28dc38){_0x32e747(_0x28dc38);})['catch'](function(_0x13c9d5){_0x1460e3(_0x13c9d5);});})['catch'](function(_0x211bec){_0x1460e3(_0x211bec);});}else{ami[_0x2264('0x63')](ut[_0x2264('0x64')](_0xaa2bac,_0x44a41b))[_0x2264('0x3d')](function(_0x1b0523){_0x32e747(_0x1b0523);})[_0x2264('0x42')](function(_0x394324){_0x1460e3(_0x394324);});}});}Fax[_0x2264('0x2a')][_0x2264('0x58')]=function(_0x5eb0a9,_0x5326c9){var _0x13e949=this;return new BPromise(function(_0x127b27,_0x44d0ed){var _0x268aaf=uuid['v4']();var _0x19e77e=ut['addVariables'](_0x5eb0a9,_0x5326c9);_0x13e949[_0x2264('0x27')][_0x268aaf]=new Action(_0x268aaf,_0x5326c9,_0x5eb0a9);var _0x179dfd=_0x13e949[_0x2264('0x27')][_0x268aaf];if(path['parse'](_0x5eb0a9[_0x2264('0x60')])[_0x2264('0x65')]===_0x2264('0x3b')){originate(_0x179dfd,_0x19e77e,!![])[_0x2264('0x3d')](function(_0x54ecc0){_0x127b27(_0x54ecc0);})[_0x2264('0x42')](function(_0x32001b){_0x44d0ed(_0x32001b);});}else{originate(_0x179dfd,_0x19e77e,![])[_0x2264('0x3d')](function(_0x4c29fc){_0x127b27(_0x4c29fc);})['catch'](function(_0x3b24da){_0x44d0ed(_0x3b24da);});}});};Fax[_0x2264('0x2a')][_0x2264('0x66')]=function(_0x19de22){return!_[_0x2264('0x67')](_0x19de22)&&!_[_0x2264('0x67')](_0x19de22[_0x2264('0x24')])&&!_['isNil'](_0x19de22[_0x2264('0x68')])&&_0x19de22[_0x2264('0x68')]&&!_[_0x2264('0x67')](this[_0x2264('0x11')][util[_0x2264('0x61')](_0x2264('0x69'),_0x19de22[_0x2264('0x24')])])&&!_[_0x2264('0x67')](this[_0x2264('0x11')][util[_0x2264('0x61')](_0x2264('0x69'),_0x19de22['name'])]['status'])&&(this[_0x2264('0x11')][util['format'](_0x2264('0x69'),_0x19de22[_0x2264('0x24')])][_0x2264('0x2f')]===_0x2264('0x6a')||this[_0x2264('0x11')][util[_0x2264('0x61')](_0x2264('0x69'),_0x19de22['name'])][_0x2264('0x2f')]===_0x2264('0x6b'));};Fax[_0x2264('0x2a')][_0x2264('0x5c')]=function(_0x10cc45,_0x3cef3c){if(!this[_0x2264('0x66')](_0x10cc45)){ut[_0x2264('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x2264('0x67')](_0x10cc45)?'':_0x10cc45[_0x2264('0x24')]+_0x2264('0x6c'));return{'isValid':![],'message':_0x2264('0x6d')};}if(_[_0x2264('0x67')](_0x3cef3c['fax'])){ut[_0x2264('0x4a')](_0x2264('0x6e'),JSON[_0x2264('0x41')](_0x3cef3c));return{'isValid':![],'message':_0x2264('0x6f')};}if(_[_0x2264('0x67')](_0x3cef3c['path'])){ut[_0x2264('0x4a')](_0x2264('0x70'),JSON[_0x2264('0x41')](_0x3cef3c));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x2264('0x71')};};module['exports']=Fax; \ No newline at end of file +var _0xb6c9=['hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','fax','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','catch','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','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','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','variablesAction','addVariables','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Is\x20Valid','exports','util','lodash','bluebird','moment','path','tiff2pdf','../../../config/logger','../ami','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','bind','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','originateresponse','prototype','syncNewchannel','context','from-voip-provider'];(function(_0x147dfb,_0x237577){var _0x43496f=function(_0x4db189){while(--_0x4db189){_0x147dfb['push'](_0x147dfb['shift']());}};_0x43496f(++_0x237577);}(_0xb6c9,0x1be));var _0x9b6c=function(_0x414e73,_0x57569f){_0x414e73=_0x414e73-0x0;var _0x5c3cba=_0xb6c9[_0x414e73];return _0x5c3cba;};'use strict';var util=require(_0x9b6c('0x0'));var _=require(_0x9b6c('0x1'));var BPromise=require(_0x9b6c('0x2'));var uuid=require('uuid');var moment=require(_0x9b6c('0x3'));var path=require(_0x9b6c('0x4'));var tiff2pdf=require(_0x9b6c('0x5'));var gs=require('./util/gs');var logger=require(_0x9b6c('0x6'))('fax');var ami=require(_0x9b6c('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x9b6c('0x8'));var ut=require('./util/util');var Action=require(_0x9b6c('0x9'));var faxAccount=require(_0x9b6c('0xa'));var attachment=require(_0x9b6c('0xb'));var faxMessage=require(_0x9b6c('0xc'));function Fax(_0x4559d4){this['channels']={};this[_0x9b6c('0xd')]=_0x4559d4[_0x9b6c('0xd')];this['trunks']=_0x4559d4[_0x9b6c('0xe')];this[_0x9b6c('0xf')]={};ami['on'](_0x9b6c('0x10'),this['syncNewchannel'][_0x9b6c('0x11')](this));ami['on']('varset',this['syncVarSet'][_0x9b6c('0x11')](this));ami['on']('newstate',this[_0x9b6c('0x12')][_0x9b6c('0x11')](this));ami['on'](_0x9b6c('0x13'),this[_0x9b6c('0x14')][_0x9b6c('0x11')](this));ami['on'](_0x9b6c('0x15'),this[_0x9b6c('0x16')]['bind'](this));ami['on'](_0x9b6c('0x17'),this['syncReceiveFax'][_0x9b6c('0x11')](this));ami['on']('hangup',this[_0x9b6c('0x18')][_0x9b6c('0x11')](this));ami['on'](_0x9b6c('0x19'),this['syncOriginateResponse']['bind'](this));}Fax[_0x9b6c('0x1a')][_0x9b6c('0x1b')]=function(_0x129793){if(_0x129793[_0x9b6c('0x1c')]===_0x9b6c('0x1d')){for(var _0x1648cd in this[_0x9b6c('0xd')]){if(this[_0x9b6c('0xd')][_0x9b6c('0x1e')](_0x1648cd)){if(_0x129793[_0x9b6c('0x1f')]===this['faxAccounts'][_0x1648cd][_0x9b6c('0x20')]){this[_0x9b6c('0x21')][_0x129793[_0x9b6c('0x22')]]={};this[_0x9b6c('0x21')][_0x129793['uniqueid']][_0x9b6c('0x23')]=_0x129793[_0x9b6c('0x23')];this[_0x9b6c('0x21')][_0x129793[_0x9b6c('0x22')]]['id']=this[_0x9b6c('0xd')][_0x1648cd]['id'];this['channels'][_0x129793[_0x9b6c('0x22')]][_0x9b6c('0x24')]=this[_0x9b6c('0xd')][_0x1648cd][_0x9b6c('0x24')];logger[_0x9b6c('0x25')](_0x129793[_0x9b6c('0x22')],_0x9b6c('0x26'));}}}}if(this[_0x9b6c('0xf')][_0x129793[_0x9b6c('0x22')]]){this[_0x9b6c('0x21')][_0x129793[_0x9b6c('0x22')]]={};this[_0x9b6c('0x21')][_0x129793[_0x9b6c('0x22')]][_0x9b6c('0x23')]=_0x129793[_0x9b6c('0x23')];logger['info'](_0x129793['uniqueid'],_0x9b6c('0x26'));}};Fax[_0x9b6c('0x1a')][_0x9b6c('0x27')]=function(_0x4dcb72){if(this[_0x9b6c('0x21')][_0x4dcb72['uniqueid']]){for(var _0x536772 in _0x4dcb72[_0x9b6c('0x28')]){if(_0x4dcb72[_0x9b6c('0x28')][_0x9b6c('0x1e')](_0x536772)){this[_0x9b6c('0x21')][_0x4dcb72['uniqueid']][_0x536772]=_0x4dcb72[_0x9b6c('0x29')];}}}};Fax[_0x9b6c('0x1a')][_0x9b6c('0x12')]=function(_0x45caad){if(this[_0x9b6c('0x21')][_0x45caad[_0x9b6c('0x22')]]){this[_0x9b6c('0x21')][_0x45caad[_0x9b6c('0x22')]][_0x9b6c('0x2a')]=_0x45caad[_0x9b6c('0x2a')];this['channels'][_0x45caad[_0x9b6c('0x22')]][_0x9b6c('0x2b')]=_0x45caad['channelstatedesc'];}};Fax[_0x9b6c('0x1a')][_0x9b6c('0x14')]=function(_0x12af8d){if(this[_0x9b6c('0x21')][_0x12af8d[_0x9b6c('0x22')]]){for(var _0x66ee18 in _0x12af8d[_0x9b6c('0x28')]){if(_0x12af8d[_0x9b6c('0x28')]['hasOwnProperty'](_0x66ee18)){this[_0x9b6c('0x21')][_0x12af8d[_0x9b6c('0x22')]][_0x66ee18]=_0x12af8d[_0x9b6c('0x29')];}}}};Fax['prototype']['syncFaxStatus']=function(_0xfb33e2){if(this[_0x9b6c('0x21')][_0xfb33e2[_0x9b6c('0x22')]]){this[_0x9b6c('0x21')][_0xfb33e2[_0x9b6c('0x22')]][_0x9b6c('0x2c')]=_0xfb33e2[_0x9b6c('0x2c')];this[_0x9b6c('0x21')][_0xfb33e2[_0x9b6c('0x22')]][_0x9b6c('0x2d')]=_0xfb33e2[_0x9b6c('0x2d')];this[_0x9b6c('0x21')][_0xfb33e2['uniqueid']][_0x9b6c('0x20')]=_0xfb33e2[_0x9b6c('0x20')];this['channels'][_0xfb33e2[_0x9b6c('0x22')]][_0x9b6c('0x2e')]=_0xfb33e2[_0x9b6c('0x2e')];logger[_0x9b6c('0x25')](_0xfb33e2[_0x9b6c('0x22')],_0x9b6c('0x2f'));}};Fax[_0x9b6c('0x1a')][_0x9b6c('0x30')]=function(_0x398945){var _0x32d38e=this;if(this[_0x9b6c('0x21')][_0x398945[_0x9b6c('0x22')]]){var _0x3f119d=this['channels'][_0x398945[_0x9b6c('0x22')]]['id'];this[_0x9b6c('0x21')][_0x398945[_0x9b6c('0x22')]][_0x9b6c('0x31')]=_0x398945[_0x9b6c('0x31')];this[_0x9b6c('0x21')][_0x398945['uniqueid']][_0x9b6c('0x32')]=_0x398945[_0x9b6c('0x32')];this['channels'][_0x398945[_0x9b6c('0x22')]][_0x9b6c('0x20')]=_0x398945[_0x9b6c('0x20')];this['channels'][_0x398945[_0x9b6c('0x22')]][_0x9b6c('0x33')]=_0x398945[_0x9b6c('0x33')];this['channels'][_0x398945[_0x9b6c('0x22')]][_0x9b6c('0x34')]=_0x398945['transferrate'];this[_0x9b6c('0x21')][_0x398945[_0x9b6c('0x22')]][_0x9b6c('0x2e')]=_0x398945[_0x9b6c('0x2e')];this['channels'][_0x398945['uniqueid']][_0x9b6c('0x35')]=_0x398945[_0x9b6c('0x35')];if(this[_0x9b6c('0x21')][_0x398945[_0x9b6c('0x22')]][_0x9b6c('0x32')]>0x0){tiff2pdf(_0x398945[_0x9b6c('0x2e')],_0x9b6c('0x36'),function(_0xd382b5){logger[_0x9b6c('0x25')](_0x398945[_0x9b6c('0x22')],'\x20result\x20conversion\x20file\x20',_0xd382b5[_0x9b6c('0x37')]);attachment[_0x9b6c('0x38')]({'name':path['parse'](_0x398945['filename'])[_0x9b6c('0x24')],'basename':path[_0x9b6c('0x39')](_0x398945[_0x9b6c('0x2e')])[_0x9b6c('0x24')]+_0x9b6c('0x3a'),'type':_0x9b6c('0x3b')})[_0x9b6c('0x3c')](function(_0x2284c5){faxAccount[_0x9b6c('0x3d')](_0x3f119d,{'from':_0x398945[_0x9b6c('0x35')],'mapKey':_0x9b6c('0x3e'),'body':path[_0x9b6c('0x39')](_0x398945['filename'])['name']+_0x9b6c('0x3a'),'AttachmentId':_0x2284c5['id']})['catch'](function(_0x849655){logger[_0x9b6c('0x3f')](_0x398945[_0x9b6c('0x22')],_0x9b6c('0x40'),JSON[_0x9b6c('0x41')](_0x849655));});})['catch'](function(_0x28f2af){logger['error'](_0x398945['uniqueid'],_0x9b6c('0x42'),JSON[_0x9b6c('0x41')](_0x28f2af));});});}logger[_0x9b6c('0x25')](_0x398945[_0x9b6c('0x22')],_0x9b6c('0x42'));}};Fax['prototype'][_0x9b6c('0x43')]=function(_0x27151c){if(this['actions'][_0x27151c['uniqueid']]){_[_0x9b6c('0x44')](this[_0x9b6c('0x21')][_0x27151c[_0x9b6c('0x22')]],_[_0x9b6c('0x45')](_0x27151c,[_0x9b6c('0x46'),'reason']));}};function updateStatus(_0x162cf5){if(_0x162cf5[_0x9b6c('0x47')]){faxMessage[_0x9b6c('0x48')](_0x162cf5['AttachmentId'],{'failMessage':_0x9b6c('0x49')})[_0x9b6c('0x3c')](function(_0x3073f0){ut['logger'](_0x9b6c('0x4a'),_0x3073f0);})['catch'](function(_0x100c2c){ut[_0x9b6c('0x4b')](_0x9b6c('0x4c'),_0x100c2c);});}else{ut[_0x9b6c('0x4b')](_0x9b6c('0x4d'));}}Fax[_0x9b6c('0x1a')]['updateStatus']=function(_0xa52887,_0x31e908,_0x5ef8ed){var _0x25b222=this;var _0x1840d4={};if(_0x31e908){_0x1840d4={'read':_0x31e908};}else{_0x1840d4={'failMessage':_0x5ef8ed};}if(this[_0x9b6c('0xf')][_0xa52887][_0x9b6c('0x47')]){faxMessage[_0x9b6c('0x48')](this[_0x9b6c('0xf')][_0xa52887][_0x9b6c('0x47')],_0x1840d4)[_0x9b6c('0x3c')](function(_0xa75e43){ut[_0x9b6c('0x4b')](_0x9b6c('0x4e'),_0xa75e43);})[_0x9b6c('0x4f')](function(_0x424109){ut['logger'](_0x9b6c('0x50'),_0x424109);})[_0x9b6c('0x51')](function(){delete _0x25b222['channels'][_0xa52887];delete _0x25b222[_0x9b6c('0xf')][_0xa52887];});}else{ut[_0x9b6c('0x4b')]('[Fax][Message][NoUpdate2]');delete this[_0x9b6c('0x21')][_0xa52887];delete this[_0x9b6c('0xf')][_0xa52887];}};Fax[_0x9b6c('0x1a')]['syncHangup']=function(_0x273ea1){var _0x49efe4=this;if(this['channels'][_0x273ea1[_0x9b6c('0x22')]]){if(this[_0x9b6c('0xf')][_0x273ea1[_0x9b6c('0x22')]]){this[_0x9b6c('0x21')][_0x273ea1[_0x9b6c('0x22')]]['id']=this[_0x9b6c('0xf')][_0x273ea1['uniqueid']]['id'];this[_0x9b6c('0x21')][_0x273ea1[_0x9b6c('0x22')]][_0x9b6c('0x24')]=this[_0x9b6c('0xf')][_0x273ea1[_0x9b6c('0x22')]][_0x9b6c('0x24')];}logger['info'](_0x273ea1[_0x9b6c('0x22')],this[_0x9b6c('0xf')][_0x273ea1[_0x9b6c('0x22')]]?_0x9b6c('0x52'):_0x9b6c('0x53'),JSON[_0x9b6c('0x41')](this[_0x9b6c('0x21')][_0x273ea1['uniqueid']]));if(this[_0x9b6c('0xf')][_0x273ea1[_0x9b6c('0x22')]]){if(this[_0x9b6c('0x21')][_0x273ea1['uniqueid']][_0x9b6c('0x54')]>0x0&&this[_0x9b6c('0x21')][_0x273ea1[_0x9b6c('0x22')]][_0x9b6c('0x15')]===_0x9b6c('0x55')){this[_0x9b6c('0x56')](_0x273ea1['uniqueid'],!![]);}else{this['updateStatus'](_0x273ea1[_0x9b6c('0x22')],![],this[_0x9b6c('0x21')][_0x273ea1['uniqueid']][_0x9b6c('0x57')]?_0x9b6c('0x58')+this[_0x9b6c('0x21')][_0x273ea1['uniqueid']]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax['prototype'][_0x9b6c('0x59')]=function(_0x21bebb){var _0x839a59=this;return new BPromise(function(_0x1fa2cb,_0x5af499){_0x839a59[_0x9b6c('0x5a')](_0x21bebb,_0x839a59['faxAccounts'][_0x21bebb[_0x9b6c('0x5b')]])[_0x9b6c('0x3c')](function(_0x48b663){ut[_0x9b6c('0x4b')](_0x9b6c('0x5c'),_0x48b663);_0x1fa2cb(ut[_0x9b6c('0x37')](_0x9b6c('0x5d')));})[_0x9b6c('0x4f')](function(_0xc88807){ut['logger'](_0x9b6c('0x5e'),_0xc88807);updateStatus(_0x21bebb);_0x5af499(ut[_0x9b6c('0x37')](_0x9b6c('0x5f')));});});};Fax[_0x9b6c('0x1a')][_0x9b6c('0x60')]=function(_0x3599de){var _0x2a7931=this;return new BPromise(function(_0x4e8396,_0x2bf819){var _0x22ce27=_0x2a7931[_0x9b6c('0x61')](_0x2a7931['faxAccounts'][_0x3599de[_0x9b6c('0x5b')]][_0x9b6c('0x62')],_0x3599de);if(_0x22ce27[_0x9b6c('0x63')]){_0x4e8396(ut['message']('Trunk\x20Reachable'));}else{_0x2bf819(ut['message'](_0x22ce27[_0x9b6c('0x37')]));}});};function originate(_0x271598,_0x4929bf,_0x25b549){return new BPromise(function(_0x2dfc6c,_0x46e38e){if(_0x25b549){var _0xe2dc2f=util[_0x9b6c('0x64')](_0x9b6c('0x65'),path[_0x9b6c('0x39')](_0x271598[_0x9b6c('0x4')])[_0x9b6c('0x24')],_0x271598[_0x9b6c('0x4')]);gs['execute'](_0xe2dc2f)[_0x9b6c('0x3c')](function(){_0x271598[_0x9b6c('0x4')]=util[_0x9b6c('0x64')](_0x9b6c('0x66'),path['parse'](_0x271598[_0x9b6c('0x4')])[_0x9b6c('0x67')],path[_0x9b6c('0x39')](_0x271598[_0x9b6c('0x4')])[_0x9b6c('0x24')]);_0x4929bf['XMF-PATH']=_0x271598[_0x9b6c('0x4')];ut[_0x9b6c('0x4b')](_0x9b6c('0x68'),'');ami['Action'](ut[_0x9b6c('0x69')](_0x271598,_0x4929bf))[_0x9b6c('0x3c')](function(_0x223df3){_0x2dfc6c(_0x223df3);})[_0x9b6c('0x4f')](function(_0x58ba06){_0x46e38e(_0x58ba06);});})[_0x9b6c('0x4f')](function(_0x76e92a){_0x46e38e(_0x76e92a);});}else{ami['Action'](ut[_0x9b6c('0x69')](_0x271598,_0x4929bf))[_0x9b6c('0x3c')](function(_0x491448){_0x2dfc6c(_0x491448);})[_0x9b6c('0x4f')](function(_0xc714bf){_0x46e38e(_0xc714bf);});}});}Fax['prototype'][_0x9b6c('0x5a')]=function(_0xec1677,_0x4507d3){var _0x19a121=this;return new BPromise(function(_0x1ef543,_0x7e17b5){var _0x3b9152=uuid['v4']();var _0x2c2210=ut[_0x9b6c('0x6a')](_0xec1677,_0x4507d3);_0x19a121[_0x9b6c('0xf')][_0x3b9152]=new Action(_0x3b9152,_0x4507d3,_0xec1677);var _0x3328cb=_0x19a121[_0x9b6c('0xf')][_0x3b9152];if(path[_0x9b6c('0x39')](_0xec1677[_0x9b6c('0x4')])['ext']==='.pdf'){originate(_0x3328cb,_0x2c2210,!![])['then'](function(_0x2abc74){_0x1ef543(_0x2abc74);})[_0x9b6c('0x4f')](function(_0x42f40d){_0x7e17b5(_0x42f40d);});}else{originate(_0x3328cb,_0x2c2210,![])[_0x9b6c('0x3c')](function(_0x12ddc6){_0x1ef543(_0x12ddc6);})[_0x9b6c('0x4f')](function(_0x11a5c3){_0x7e17b5(_0x11a5c3);});}});};Fax[_0x9b6c('0x1a')]['isTrunkReachable']=function(_0x4feb90){return!_[_0x9b6c('0x6b')](_0x4feb90)&&!_[_0x9b6c('0x6b')](_0x4feb90[_0x9b6c('0x24')])&&!_[_0x9b6c('0x6b')](_0x4feb90[_0x9b6c('0x6c')])&&_0x4feb90[_0x9b6c('0x6c')]&&!_[_0x9b6c('0x6b')](this[_0x9b6c('0xe')][util['format']('SIP/%s',_0x4feb90[_0x9b6c('0x24')])])&&!_[_0x9b6c('0x6b')](this[_0x9b6c('0xe')][util[_0x9b6c('0x64')](_0x9b6c('0x6d'),_0x4feb90[_0x9b6c('0x24')])][_0x9b6c('0x2d')])&&(this[_0x9b6c('0xe')][util[_0x9b6c('0x64')](_0x9b6c('0x6d'),_0x4feb90[_0x9b6c('0x24')])]['status']===_0x9b6c('0x6e')||this[_0x9b6c('0xe')][util[_0x9b6c('0x64')](_0x9b6c('0x6d'),_0x4feb90[_0x9b6c('0x24')])][_0x9b6c('0x2d')]===_0x9b6c('0x6f'));};Fax[_0x9b6c('0x1a')]['checkTrunk']=function(_0x35a597,_0x559370){if(!this[_0x9b6c('0x70')](_0x35a597)){ut[_0x9b6c('0x4b')](_0x9b6c('0x71'),_[_0x9b6c('0x6b')](_0x35a597)?'':_0x35a597['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x9b6c('0x72')};}if(_[_0x9b6c('0x6b')](_0x559370['fax'])){ut[_0x9b6c('0x4b')](_0x9b6c('0x73'),JSON[_0x9b6c('0x41')](_0x559370));return{'isValid':![],'message':_0x9b6c('0x74')};}if(_[_0x9b6c('0x6b')](_0x559370[_0x9b6c('0x4')])){ut[_0x9b6c('0x4b')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x9b6c('0x41')](_0x559370));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x9b6c('0x75')};};module[_0x9b6c('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index b495452..9f618a9 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 _0x49a6=['preview','error','inspect','notify','resolve','util','bluebird','../../../config/logger'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x49a6,0x1cd));var _0x649a=function(_0x4aa0a5,_0x778d4d){_0x4aa0a5=_0x4aa0a5-0x0;var _0xe2d4c3=_0x49a6[_0x4aa0a5];return _0xe2d4c3;};'use strict';var util=require(_0x649a('0x0'));var BPromise=require(_0x649a('0x1'));var logger=require(_0x649a('0x2'))(_0x649a('0x3'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x558c0d){return function(_0x498ee4){logger[_0x649a('0x4')](_0x558c0d,util[_0x649a('0x5')](_0x498ee4,{'showHidden':![],'depth':null}));};}exports[_0x649a('0x6')]=function(_0x5c8dad,_0x4b0f47){return BPromise[_0x649a('0x7')]()['then'](faxAccount[_0x649a('0x6')](_0x5c8dad,_0x4b0f47))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x22a5=['inspect','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount'];(function(_0x16ccc4,_0x439e40){var _0x2d3fd0=function(_0x16c8e2){while(--_0x16c8e2){_0x16ccc4['push'](_0x16ccc4['shift']());}};_0x2d3fd0(++_0x439e40);}(_0x22a5,0x191));var _0x522a=function(_0x231321,_0xb062bd){_0x231321=_0x231321-0x0;var _0x145c98=_0x22a5[_0x231321];return _0x145c98;};'use strict';var util=require(_0x522a('0x0'));var BPromise=require('bluebird');var logger=require(_0x522a('0x1'))(_0x522a('0x2'));var _=require(_0x522a('0x3'));var faxAccount=require(_0x522a('0x4'));function loggerCatch(_0x105fd3){return function(_0x164dc5){logger['error'](_0x105fd3,util[_0x522a('0x5')](_0x164dc5,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x1c4f0c,_0x18672e){return BPromise['resolve']()['then'](faxAccount['notify'](_0x1c4f0c,_0x18672e))['catch'](loggerCatch(_0x522a('0x6')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 6236044..e29504e 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 _0x2339=['\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0x2339,0x1e1));var _0x9233=function(_0x448721,_0x45ff24){_0x448721=_0x448721-0x0;var _0x649ebc=_0x2339[_0x448721];return _0x649ebc;};'use strict';var util=require(_0x9233('0x0'));var logger=require(_0x9233('0x1'))(_0x9233('0x2'));var BPromise=require(_0x9233('0x3'));var exec=require(_0x9233('0x4'))[_0x9233('0x5')];exports[_0x9233('0x6')]=function(_0x168b04){return new BPromise(function(_0x44f5c9,_0x23db25){exec(_0x168b04,function(_0x5f76cb,_0x48a66a,_0x4a89f1){logger[_0x9233('0x7')](_0x9233('0x8'),_0x48a66a);if(_0x5f76cb){logger[_0x9233('0x7')](_0x9233('0x8'),_0x9233('0x9'),util['inspect'](_0x5f76cb,{'showHidden':![],'depth':null}),_0x48a66a,_0x4a89f1);_0x23db25(_0x5f76cb);}_0x44f5c9(_0x48a66a);});});}; \ No newline at end of file +var _0x1071=['fax','child_process','execute','info','Exec\x20gs','inspect','../../../../config/logger'];(function(_0x20c6f1,_0x21fa65){var _0x43c3bf=function(_0x40c2dd){while(--_0x40c2dd){_0x20c6f1['push'](_0x20c6f1['shift']());}};_0x43c3bf(++_0x21fa65);}(_0x1071,0x8b));var _0x1107=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1071[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var logger=require(_0x1107('0x0'))(_0x1107('0x1'));var BPromise=require('bluebird');var exec=require(_0x1107('0x2'))['exec'];exports[_0x1107('0x3')]=function(_0x519642){return new BPromise(function(_0x370ac3,_0x1a10c3){exec(_0x519642,function(_0x3a3075,_0x510fd6,_0x6c78ba){logger[_0x1107('0x4')](_0x1107('0x5'),_0x510fd6);if(_0x3a3075){logger['info'](_0x1107('0x5'),'\x20Error\x20:',util[_0x1107('0x6')](_0x3a3075,{'showHidden':![],'depth':null}),_0x510fd6,_0x6c78ba);_0x1a10c3(_0x3a3075);}_0x370ac3(_0x510fd6);});});}; \ 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 6012da1..fceeb1d 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 _0x17d3=['message','info','addVariables','ecm','headerinfo','maxrate','\x22%s\x22','modem','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','localstationid','util','lodash','../../../../config/logger'];(function(_0x35ae46,_0x30842f){var _0x215c6f=function(_0x5c1be1){while(--_0x5c1be1){_0x35ae46['push'](_0x35ae46['shift']());}};_0x215c6f(++_0x30842f);}(_0x17d3,0x140));var _0x317d=function(_0x3873be,_0x47997){_0x3873be=_0x3873be-0x0;var _0xd513d1=_0x17d3[_0x3873be];return _0xd513d1;};'use strict';var util=require(_0x317d('0x0'));var _=require(_0x317d('0x1'));var moment=require('moment');var logger=require(_0x317d('0x2'))('fax');exports[_0x317d('0x3')]=function(_0x286845){return{'message':_0x286845};};exports['logger']=function(_0x84b32d,_0x5db8de){logger[_0x317d('0x4')](_0x84b32d,util['inspect'](_0x5db8de,{'showHidden':![],'depth':null}));};exports[_0x317d('0x5')]=function(_0x568c17,_0x38e934){var _0x468032={'XMF-ECM':_0x38e934[_0x317d('0x6')],'XMF-HEADERINFO':_0x38e934[_0x317d('0x7')],'XMF-MINRATE':_0x38e934['minrate'],'XMF-MAXRATE':_0x38e934[_0x317d('0x8')],'XMF-MODEM':util['format'](_0x317d('0x9'),_0x38e934[_0x317d('0xa')]),'XMF-GATEWAY':_0x38e934['gateway'],'XMF-FAXDETECT':_0x38e934['faxdetect'],'XMF-T38TIMEOUT':_0x38e934['t38timeout'],'XMF-LOCALSTATIONID':_0x38e934['localstationid'],'XMF-PATH':_0x568c17['path']};return _0x468032;};exports[_0x317d('0xb')]=function(_0x340a52,_0x24a7bb){return{'actionid':_0x340a52[_0x317d('0xc')],'action':_0x317d('0xd'),'channel':_0x340a52['channel'],'Exten':_0x317d('0xe'),'Context':_0x317d('0xf'),'Priority':'1','callerid':util[_0x317d('0x10')](_0x317d('0x11'),_0x340a52['headerinfo']?_0x340a52['headerinfo']:'',_0x340a52[_0x317d('0x12')]),'variable':_0x24a7bb,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x340a52[_0x317d('0xc')]};}; \ No newline at end of file +var _0xef1f=['modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','lodash','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','minrate','maxrate','format','\x22%s\x22'];(function(_0x2e591e,_0x24a94d){var _0x38d745=function(_0x47ec18){while(--_0x47ec18){_0x2e591e['push'](_0x2e591e['shift']());}};_0x38d745(++_0x24a94d);}(_0xef1f,0xe3));var _0xfef1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xef1f[_0x57b54c];return _0x59cc19;};'use strict';var util=require('util');var _=require(_0xfef1('0x0'));var moment=require('moment');var logger=require(_0xfef1('0x1'))(_0xfef1('0x2'));exports[_0xfef1('0x3')]=function(_0x4df8d1){return{'message':_0x4df8d1};};exports[_0xfef1('0x4')]=function(_0x52a293,_0x340805){logger[_0xfef1('0x5')](_0x52a293,util[_0xfef1('0x6')](_0x340805,{'showHidden':![],'depth':null}));};exports[_0xfef1('0x7')]=function(_0x2b864a,_0x51135d){var _0x216471={'XMF-ECM':_0x51135d[_0xfef1('0x8')],'XMF-HEADERINFO':_0x51135d['headerinfo'],'XMF-MINRATE':_0x51135d[_0xfef1('0x9')],'XMF-MAXRATE':_0x51135d[_0xfef1('0xa')],'XMF-MODEM':util[_0xfef1('0xb')](_0xfef1('0xc'),_0x51135d[_0xfef1('0xd')]),'XMF-GATEWAY':_0x51135d['gateway'],'XMF-FAXDETECT':_0x51135d[_0xfef1('0xe')],'XMF-T38TIMEOUT':_0x51135d[_0xfef1('0xf')],'XMF-LOCALSTATIONID':_0x51135d[_0xfef1('0x10')],'XMF-PATH':_0x2b864a[_0xfef1('0x11')]};return _0x216471;};exports[_0xfef1('0x12')]=function(_0x5154be,_0x3d84b9){return{'actionid':_0x5154be[_0xfef1('0x13')],'action':'originate','channel':_0x5154be[_0xfef1('0x14')],'Exten':'xcally-motion-fax','Context':_0xfef1('0x15'),'Priority':'1','callerid':util[_0xfef1('0xb')](_0xfef1('0x16'),_0x5154be['headerinfo']?_0x5154be[_0xfef1('0x17')]:'',_0x5154be[_0xfef1('0x10')]),'variable':_0x3d84b9,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5154be[_0xfef1('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index d5de12b..abf2296 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 _0x9486=['getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','./realtime','./report','./acw','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts'];(function(_0x3f4027,_0x221cbb){var _0x4aea2e=function(_0x29bcbb){while(--_0x29bcbb){_0x3f4027['push'](_0x3f4027['shift']());}};_0x4aea2e(++_0x221cbb);}(_0x9486,0x9e));var _0x6948=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9486[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require(_0x6948('0x0'));var util=require('util');var moment=require('moment');var server=require('./server');var Realtime=require(_0x6948('0x1'));var Report=require(_0x6948('0x2'));var Acw=require(_0x6948('0x3'));var Trigger=require(_0x6948('0x4'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x6948('0x5'));var user=require(_0x6948('0x6'));var voiceQueue=require(_0x6948('0x7'));var voiceQueueReport=require(_0x6948('0x8'));var voiceCallReport=require(_0x6948('0x9'));var trunk=require(_0x6948('0xa'));var trigger=require('./rpc/trigger');var template=require(_0x6948('0xb'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x6948('0xc'));var voiceExtension=require(_0x6948('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x6948('0xe'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x6948('0xf'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x6948('0x10'));var freshsales=require(_0x6948('0x11'));var servicenow=require(_0x6948('0x12'));var dynamics365=require(_0x6948('0x13'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6948('0x14')](_0x6948('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6948('0x14')](_0x6948('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x6948('0x16')](user[_0x6948('0x17')]())[_0x6948('0x16')](realtime[_0x6948('0x18')]())[_0x6948('0x16')](user[_0x6948('0x19')]())[_0x6948('0x16')](realtime[_0x6948('0x1a')]())['then'](trunk[_0x6948('0x1b')]())[_0x6948('0x16')](realtime['initTrunks']())['then'](voiceQueue[_0x6948('0x1c')]())['then'](realtime[_0x6948('0x1d')]())[_0x6948('0x16')](trigger[_0x6948('0x1e')]())['then'](realtime[_0x6948('0x1f')]())[_0x6948('0x16')](template[_0x6948('0x20')]())[_0x6948('0x16')](realtime['initTemplates']())[_0x6948('0x16')](zendesk[_0x6948('0x21')]())[_0x6948('0x16')](realtime[_0x6948('0x22')]())['then'](salesforce[_0x6948('0x23')]())[_0x6948('0x16')](realtime[_0x6948('0x24')]())[_0x6948('0x16')](sugarcrm[_0x6948('0x25')]())[_0x6948('0x16')](realtime['initSugarcrmAccounts']())[_0x6948('0x16')](freshdesk[_0x6948('0x26')]())[_0x6948('0x16')](realtime[_0x6948('0x27')]())['then'](desk[_0x6948('0x28')]())[_0x6948('0x16')](realtime[_0x6948('0x29')]())[_0x6948('0x16')](zoho[_0x6948('0x2a')]())[_0x6948('0x16')](realtime[_0x6948('0x2b')]())[_0x6948('0x16')](vtiger[_0x6948('0x2c')]())[_0x6948('0x16')](realtime[_0x6948('0x2d')]())[_0x6948('0x16')](freshsales['getFreshsalesAccounts']())[_0x6948('0x16')](realtime[_0x6948('0x2e')]())['then'](servicenow['getServicenowAccounts']())[_0x6948('0x16')](realtime[_0x6948('0x2f')]())[_0x6948('0x16')](dynamics365[_0x6948('0x30')]())['then'](realtime['initDynamics365Accounts']())[_0x6948('0x16')](campaign['getCampaigns']())[_0x6948('0x16')](realtime[_0x6948('0x31')]())[_0x6948('0x16')](voiceExtension[_0x6948('0x32')]())[_0x6948('0x16')](realtime[_0x6948('0x33')]())[_0x6948('0x16')](faxAccount[_0x6948('0x34')]())[_0x6948('0x16')](realtime['initFaxAccounts']())[_0x6948('0x16')](function(){return realtime;});}function initParams(){return BPromise[_0x6948('0x35')]()['then'](voiceQueueReport[_0x6948('0x36')]())[_0x6948('0x16')](realtime[_0x6948('0x37')]())['then'](cmHopperHistory[_0x6948('0x38')]())[_0x6948('0x16')](realtime[_0x6948('0x39')]())[_0x6948('0x16')](cmHopperHistory[_0x6948('0x3a')]())['then'](realtime[_0x6948('0x3b')]())[_0x6948('0x16')](voiceCallReport[_0x6948('0x3c')]())['then'](realtime[_0x6948('0x3d')]())[_0x6948('0x16')](function(_0x28b940){})[_0x6948('0x3e')](function(_0x29f4fc){console[_0x6948('0x3f')](_0x29f4fc);});}function main(){return server[_0x6948('0x40')](realtime,preview,fax)[_0x6948('0x16')](function(_0x2268a9){return initRealtime();})[_0x6948('0x16')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x6948('0x3e')](function(_0x2217e5){console[_0x6948('0x3f')](_0x2217e5);});}main(); \ No newline at end of file +var _0xae65=['initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','sync','bluebird','util','moment','./server','./realtime','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xae65,0xdc));var _0x5ae6=function(_0x42b0bd,_0x24eb2f){_0x42b0bd=_0x42b0bd-0x0;var _0x22a2cd=_0xae65[_0x42b0bd];return _0x22a2cd;};'use strict';var BPromise=require(_0x5ae6('0x0'));var util=require(_0x5ae6('0x1'));var moment=require(_0x5ae6('0x2'));var server=require(_0x5ae6('0x3'));var Realtime=require(_0x5ae6('0x4'));var Report=require('./report');var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x5ae6('0x5'));var Preview=require(_0x5ae6('0x6'));var Fax=require(_0x5ae6('0x7'));var user=require(_0x5ae6('0x8'));var voiceQueue=require(_0x5ae6('0x9'));var voiceQueueReport=require(_0x5ae6('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x5ae6('0xb'));var trigger=require(_0x5ae6('0xc'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x5ae6('0xd'));var voiceExtension=require(_0x5ae6('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x5ae6('0xf'));var sugarcrm=require(_0x5ae6('0x10'));var freshdesk=require(_0x5ae6('0x11'));var desk=require(_0x5ae6('0x12'));var zoho=require(_0x5ae6('0x13'));var vtiger=require(_0x5ae6('0x14'));var freshsales=require(_0x5ae6('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x5ae6('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5ae6('0x17')](_0x5ae6('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5ae6('0x17')](_0x5ae6('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x5ae6('0x19')](user[_0x5ae6('0x1a')]())[_0x5ae6('0x19')](realtime['initAgents']())[_0x5ae6('0x19')](user[_0x5ae6('0x1b')]())['then'](realtime[_0x5ae6('0x1c')]())[_0x5ae6('0x19')](trunk[_0x5ae6('0x1d')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x1e')]())[_0x5ae6('0x19')](voiceQueue[_0x5ae6('0x1f')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x20')]())[_0x5ae6('0x19')](trigger[_0x5ae6('0x21')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x22')]())[_0x5ae6('0x19')](template[_0x5ae6('0x23')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x24')]())[_0x5ae6('0x19')](zendesk[_0x5ae6('0x25')]())[_0x5ae6('0x19')](realtime['initZendeskAccounts']())[_0x5ae6('0x19')](salesforce[_0x5ae6('0x26')]())['then'](realtime[_0x5ae6('0x27')]())[_0x5ae6('0x19')](sugarcrm[_0x5ae6('0x28')]())[_0x5ae6('0x19')](realtime['initSugarcrmAccounts']())[_0x5ae6('0x19')](freshdesk[_0x5ae6('0x29')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x2a')]())[_0x5ae6('0x19')](desk[_0x5ae6('0x2b')]())['then'](realtime[_0x5ae6('0x2c')]())[_0x5ae6('0x19')](zoho[_0x5ae6('0x2d')]())[_0x5ae6('0x19')](realtime['initZohoAccounts']())[_0x5ae6('0x19')](vtiger[_0x5ae6('0x2e')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x2f')]())[_0x5ae6('0x19')](freshsales[_0x5ae6('0x30')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x31')]())['then'](servicenow['getServicenowAccounts']())[_0x5ae6('0x19')](realtime['initServicenowAccounts']())[_0x5ae6('0x19')](dynamics365[_0x5ae6('0x32')]())['then'](realtime[_0x5ae6('0x33')]())[_0x5ae6('0x19')](campaign[_0x5ae6('0x34')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x35')]())[_0x5ae6('0x19')](voiceExtension[_0x5ae6('0x36')]())['then'](realtime[_0x5ae6('0x37')]())[_0x5ae6('0x19')](faxAccount[_0x5ae6('0x38')]())['then'](realtime[_0x5ae6('0x39')]())[_0x5ae6('0x19')](function(){return realtime;});}function initParams(){return BPromise[_0x5ae6('0x3a')]()['then'](voiceQueueReport[_0x5ae6('0x3b')]())['then'](realtime[_0x5ae6('0x3c')]())[_0x5ae6('0x19')](cmHopperHistory[_0x5ae6('0x3d')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x3e')]())[_0x5ae6('0x19')](cmHopperHistory[_0x5ae6('0x3f')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x40')]())[_0x5ae6('0x19')](voiceCallReport[_0x5ae6('0x41')]())[_0x5ae6('0x19')](realtime[_0x5ae6('0x42')]())['then'](function(_0x5a89c1){})[_0x5ae6('0x43')](function(_0x404f66){console['log'](_0x404f66);});}function main(){return server[_0x5ae6('0x44')](realtime,preview,fax)[_0x5ae6('0x19')](function(_0x27f30b){return initRealtime();})[_0x5ae6('0x19')](function(){return initParams();})['then'](function(){report[_0x5ae6('0x45')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x461a24){console['log'](_0x461a24);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 6c9f62b..d570da5 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x1cc4e1,_0x1629d4){var _0x192d47=function(_0x40dbe2){while(--_0x40dbe2){_0x1cc4e1['push'](_0x1cc4e1['shift']());}};_0x192d47(++_0x1629d4);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 44674ea..a6f2862 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 _0x11d7=['Trunk','Interval','SquareProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0x11d7,0x133));var _0x711d=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0x11d7[_0x5c38cd];return _0xc985ef;};'use strict';function Campaign(_0x3fe80){this['id']=_0x3fe80['id']||0x0;this[_0x711d('0x0')]=_0x3fe80[_0x711d('0x0')]||'';this[_0x711d('0x1')]=_0x3fe80[_0x711d('0x1')]||'campaign';this[_0x711d('0x2')]=0x0;this['temp']=0x0;this[_0x711d('0x3')]=0x0;this[_0x711d('0x4')]=0x0;this[_0x711d('0x5')]='';this[_0x711d('0x6')]=!![];this[_0x711d('0x7')]=_0x3fe80[_0x711d('0x7')];this[_0x711d('0x8')]=_0x3fe80[_0x711d('0x8')];this[_0x711d('0x9')]=_0x3fe80[_0x711d('0x9')]||null;this[_0x711d('0xa')]=_0x3fe80['dialGlobalInterval']?_0x3fe80['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x3fe80[_0x711d('0xb')];this[_0x711d('0xc')]=_0x3fe80[_0x711d('0xc')];this[_0x711d('0xd')]=_0x3fe80[_0x711d('0xd')]||0x1e;this[_0x711d('0xe')]=_0x3fe80[_0x711d('0xe')];this[_0x711d('0xf')]=_0x3fe80[_0x711d('0xf')];this[_0x711d('0x10')]=_0x3fe80[_0x711d('0x10')];this[_0x711d('0x11')]=_0x3fe80[_0x711d('0x11')];this[_0x711d('0x12')]=_0x3fe80[_0x711d('0x12')];this[_0x711d('0x13')]=_0x3fe80[_0x711d('0x13')];this['dialGlobalMaxRetry']=_0x3fe80[_0x711d('0x14')];this[_0x711d('0x15')]=_0x3fe80[_0x711d('0x15')]||0x3;this[_0x711d('0x16')]=_0x3fe80['dialNoSuchNumberRetryFrequency']||0x96;this[_0x711d('0x17')]=_0x3fe80['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x3fe80[_0x711d('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x3fe80['dialAbandonedMaxRetry']||0x3;this[_0x711d('0x19')]=_0x3fe80[_0x711d('0x19')]||0x96;this[_0x711d('0x1a')]=_0x3fe80[_0x711d('0x1a')]||0x3;this[_0x711d('0x1b')]=_0x3fe80['dialMachineRetryFrequency']||0x96;this[_0x711d('0x1c')]=_0x3fe80[_0x711d('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3fe80[_0x711d('0x1d')]||0x96;this[_0x711d('0x1e')]=_0x3fe80[_0x711d('0x1e')]||_0x711d('0x1f');this['dialPrefix']=_0x3fe80[_0x711d('0x20')]||undefined;this[_0x711d('0x21')]=_0x3fe80[_0x711d('0x21')]||undefined;this[_0x711d('0x22')]=_0x3fe80['dialCutDigit']||undefined;this[_0x711d('0x23')]=_0x3fe80[_0x711d('0x23')]?_0x3fe80[_0x711d('0x23')]:undefined;this[_0x711d('0x24')]=_0x3fe80['Trunk']?_0x3fe80[_0x711d('0x24')]:undefined;this['Interval']=_0x3fe80['Interval']?_0x3fe80[_0x711d('0x25')]:undefined;this['SquareProject']=_0x3fe80[_0x711d('0x26')]?_0x3fe80[_0x711d('0x26')]:undefined;this['dialQueueProject']=_0x3fe80[_0x711d('0x26')]?_0x3fe80[_0x711d('0x26')][_0x711d('0x0')]:undefined;this['dialAMDActive']=_0x3fe80['dialAMDActive']||![];this[_0x711d('0x27')]=_0x3fe80['dialAMDInitialSilence'];this[_0x711d('0x28')]=_0x3fe80[_0x711d('0x28')];this[_0x711d('0x29')]=_0x3fe80[_0x711d('0x29')];this['dialAMDTotalAnalysisTime']=_0x3fe80[_0x711d('0x2a')];this[_0x711d('0x2b')]=_0x3fe80['dialAMDMinWordLength'];this[_0x711d('0x2c')]=_0x3fe80[_0x711d('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x3fe80[_0x711d('0x2d')];this[_0x711d('0x2e')]=_0x3fe80[_0x711d('0x2e')];this[_0x711d('0x2f')]=_0x3fe80[_0x711d('0x2f')];}module[_0x711d('0x30')]=Campaign; \ No newline at end of file +var _0x9d51=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x2a3488,_0x31a0f9){var _0x1d0c2b=function(_0x52b0a2){while(--_0x52b0a2){_0x2a3488['push'](_0x2a3488['shift']());}};_0x1d0c2b(++_0x31a0f9);}(_0x9d51,0xf9));var _0x19d5=function(_0x54cd19,_0xd70508){_0x54cd19=_0x54cd19-0x0;var _0x3d68f4=_0x9d51[_0x54cd19];return _0x3d68f4;};'use strict';function Campaign(_0x4d8333){this['id']=_0x4d8333['id']||0x0;this[_0x19d5('0x0')]=_0x4d8333[_0x19d5('0x0')]||'';this[_0x19d5('0x1')]=_0x4d8333[_0x19d5('0x1')]||'campaign';this[_0x19d5('0x2')]=0x0;this[_0x19d5('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x19d5('0x4')]=0x0;this[_0x19d5('0x5')]='';this[_0x19d5('0x6')]=!![];this[_0x19d5('0x7')]=_0x4d8333['active'];this[_0x19d5('0x8')]=_0x4d8333[_0x19d5('0x8')];this['dialTimezone']=_0x4d8333[_0x19d5('0x9')]||null;this[_0x19d5('0xa')]=_0x4d8333[_0x19d5('0xa')]?_0x4d8333['dialGlobalInterval']:null;this[_0x19d5('0xb')]=_0x4d8333['dialOriginateCallerIdName'];this[_0x19d5('0xc')]=_0x4d8333['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x4d8333['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x4d8333[_0x19d5('0xd')];this[_0x19d5('0xe')]=_0x4d8333[_0x19d5('0xe')];this[_0x19d5('0xf')]=_0x4d8333[_0x19d5('0xf')];this[_0x19d5('0x10')]=_0x4d8333[_0x19d5('0x10')];this['dialNoAnswerMaxRetry']=_0x4d8333[_0x19d5('0x11')];this[_0x19d5('0x12')]=_0x4d8333['dialNoAnswerRetryFrequency'];this[_0x19d5('0x13')]=_0x4d8333[_0x19d5('0x13')];this[_0x19d5('0x14')]=_0x4d8333[_0x19d5('0x14')]||0x3;this[_0x19d5('0x15')]=_0x4d8333[_0x19d5('0x15')]||0x96;this[_0x19d5('0x16')]=_0x4d8333[_0x19d5('0x16')]||0x3;this[_0x19d5('0x17')]=_0x4d8333[_0x19d5('0x17')]||0x96;this[_0x19d5('0x18')]=_0x4d8333[_0x19d5('0x18')]||0x3;this[_0x19d5('0x19')]=_0x4d8333['dialAbandonedRetryFrequency']||0x96;this[_0x19d5('0x1a')]=_0x4d8333[_0x19d5('0x1a')]||0x3;this[_0x19d5('0x1b')]=_0x4d8333[_0x19d5('0x1b')]||0x96;this[_0x19d5('0x1c')]=_0x4d8333['dialAgentRejectMaxRetry']||0x3;this[_0x19d5('0x1d')]=_0x4d8333[_0x19d5('0x1d')]||0x96;this[_0x19d5('0x1e')]=_0x4d8333[_0x19d5('0x1e')]||'DESC';this[_0x19d5('0x1f')]=_0x4d8333[_0x19d5('0x1f')]||undefined;this[_0x19d5('0x20')]=_0x4d8333['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x19d5('0x21')]=_0x4d8333['dialCutDigit']||undefined;this[_0x19d5('0x22')]=_0x4d8333[_0x19d5('0x22')]?_0x4d8333['TrunkBackup']:undefined;this[_0x19d5('0x23')]=_0x4d8333[_0x19d5('0x23')]?_0x4d8333['Trunk']:undefined;this['Interval']=_0x4d8333[_0x19d5('0x24')]?_0x4d8333[_0x19d5('0x24')]:undefined;this['SquareProject']=_0x4d8333[_0x19d5('0x25')]?_0x4d8333[_0x19d5('0x25')]:undefined;this['dialQueueProject']=_0x4d8333[_0x19d5('0x25')]?_0x4d8333[_0x19d5('0x25')][_0x19d5('0x0')]:undefined;this[_0x19d5('0x26')]=_0x4d8333[_0x19d5('0x26')]||![];this[_0x19d5('0x27')]=_0x4d8333[_0x19d5('0x27')];this[_0x19d5('0x28')]=_0x4d8333['dialAMDGreeting'];this[_0x19d5('0x29')]=_0x4d8333[_0x19d5('0x29')];this[_0x19d5('0x2a')]=_0x4d8333['dialAMDTotalAnalysisTime'];this[_0x19d5('0x2b')]=_0x4d8333[_0x19d5('0x2b')];this['dialAMDBetweenWordsSilence']=_0x4d8333[_0x19d5('0x2c')];this[_0x19d5('0x2d')]=_0x4d8333[_0x19d5('0x2d')];this[_0x19d5('0x2e')]=_0x4d8333[_0x19d5('0x2e')];this['dialAMDMaximumWordLength']=_0x4d8333[_0x19d5('0x2f')];}module[_0x19d5('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index c8e29e3..28301e8 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 _0x4f2f=['calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','lastdata','billableseconds','holdtime','type','tag','monitors','transfercalleridnum','transferType','mohtime','destinationchannel'];(function(_0x46b0ba,_0x5a767c){var _0x2e53e0=function(_0x124fb2){while(--_0x124fb2){_0x46b0ba['push'](_0x46b0ba['shift']());}};_0x2e53e0(++_0x5a767c);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x4f2f[_0x1da04e];return _0xdd8c41;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0xf4f2('0x0')]='';this[_0xf4f2('0x1')]=0x0;this['calleridname']='';this[_0xf4f2('0x2')]=undefined;this[_0xf4f2('0x3')]=undefined;this[_0xf4f2('0x4')]=0x0;this[_0xf4f2('0x5')]='';this[_0xf4f2('0x6')]=0x0;this[_0xf4f2('0x7')]=0x0;this[_0xf4f2('0x8')]=0x0;this[_0xf4f2('0x9')]=![];this[_0xf4f2('0xa')]=null;this[_0xf4f2('0xb')]=null;this[_0xf4f2('0xc')]=![];this['abandoned']=![];this[_0xf4f2('0xd')]='';this[_0xf4f2('0xe')]='';this['duration']=0x0;this[_0xf4f2('0xf')]=0x0;this[_0xf4f2('0x10')]=0x0;this[_0xf4f2('0x11')]=null;this[_0xf4f2('0x12')]=null;this['disposition']=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this[_0xf4f2('0x13')]=[];this[_0xf4f2('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xf4f2('0x15')]=undefined;this[_0xf4f2('0x16')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x414f=['monitor','monitorFilename','queue','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answertime','unmanaged','abandoned','lastapplication','billableseconds','holdtime','type','tag','disposition'];(function(_0x3d8244,_0x4159ff){var _0x30a786=function(_0x8b84ff){while(--_0x8b84ff){_0x3d8244['push'](_0x3d8244['shift']());}};_0x30a786(++_0x4159ff);}(_0x414f,0x13f));var _0xf414=function(_0x3cb465,_0x36d920){_0x3cb465=_0x3cb465-0x0;var _0x4e197b=_0x414f[_0x3cb465];return _0x4e197b;};'use strict';function Channel(){this[_0xf414('0x0')]=null;this['channel']='';this[_0xf414('0x1')]='';this[_0xf414('0x2')]=0x0;this['calleridname']='';this[_0xf414('0x3')]=undefined;this[_0xf414('0x4')]=undefined;this[_0xf414('0x5')]=0x0;this[_0xf414('0x6')]='';this[_0xf414('0x7')]=0x0;this[_0xf414('0x8')]=0x0;this[_0xf414('0x9')]=0x0;this['answered']=![];this[_0xf414('0xa')]=null;this['endtime']=null;this[_0xf414('0xb')]=![];this[_0xf414('0xc')]=![];this[_0xf414('0xd')]='';this['lastdata']='';this['duration']=0x0;this[_0xf414('0xe')]=0x0;this[_0xf414('0xf')]=0x0;this[_0xf414('0x10')]=null;this[_0xf414('0x11')]=null;this[_0xf414('0x12')]=null;this[_0xf414('0x13')]=![];this[_0xf414('0x14')]=null;this[_0xf414('0x15')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xf414('0x16')]=undefined;this[_0xf414('0x17')]=undefined;this[_0xf414('0x18')]=0x0;}module[_0xf414('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 38fd2a1..5b504b5 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 _0x400c=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username'];(function(_0x1ef250,_0x1fa5b9){var _0x5f3dec=function(_0x31e533){while(--_0x31e533){_0x1ef250['push'](_0x1ef250['shift']());}};_0x5f3dec(++_0x1fa5b9);}(_0x400c,0x1d2));var _0xc400=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x400c[_0xa464c9];return _0x3d73c4;};'use strict';function DeskAccount(_0x52172a){this['id']=_0x52172a['id']||0x0;this[_0xc400('0x0')]=_0x52172a[_0xc400('0x0')]||'';this[_0xc400('0x1')]=_0x52172a[_0xc400('0x1')]||'';this[_0xc400('0x2')]=_0x52172a[_0xc400('0x2')]||'';this[_0xc400('0x3')]=_0x52172a['authType']||'';this[_0xc400('0x4')]=_0x52172a[_0xc400('0x4')]||'';this[_0xc400('0x5')]=_0x52172a[_0xc400('0x5')]||'';this[_0xc400('0x6')]=_0x52172a[_0xc400('0x6')]||'';this[_0xc400('0x7')]=_0x52172a[_0xc400('0x7')]||'';this[_0xc400('0x8')]=_0x52172a[_0xc400('0x8')]||'';this[_0xc400('0x9')]=_0x52172a[_0xc400('0x9')]||'';this[_0xc400('0xa')]=_0x52172a[_0xc400('0xa')]||'';this[_0xc400('0xb')]=_0x52172a[_0xc400('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xe60d=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x3d24f4,_0x5f3c2b){var _0x4d5d9f=function(_0x693e5f){while(--_0x693e5f){_0x3d24f4['push'](_0x3d24f4['shift']());}};_0x4d5d9f(++_0x5f3c2b);}(_0xe60d,0x1a4));var _0xde60=function(_0x56021f,_0x2dee44){_0x56021f=_0x56021f-0x0;var _0x5c200d=_0xe60d[_0x56021f];return _0x5c200d;};'use strict';function DeskAccount(_0x4d9b24){this['id']=_0x4d9b24['id']||0x0;this[_0xde60('0x0')]=_0x4d9b24[_0xde60('0x0')]||'';this[_0xde60('0x1')]=_0x4d9b24[_0xde60('0x1')]||'';this[_0xde60('0x2')]=_0x4d9b24[_0xde60('0x2')]||'';this[_0xde60('0x3')]=_0x4d9b24[_0xde60('0x3')]||'';this['password']=_0x4d9b24[_0xde60('0x4')]||'';this[_0xde60('0x5')]=_0x4d9b24[_0xde60('0x5')]||'';this[_0xde60('0x6')]=_0x4d9b24[_0xde60('0x6')]||'';this[_0xde60('0x7')]=_0x4d9b24[_0xde60('0x7')]||'';this[_0xde60('0x8')]=_0x4d9b24[_0xde60('0x8')]||'';this[_0xde60('0x9')]=_0x4d9b24['type']||'';this[_0xde60('0xa')]=_0x4d9b24[_0xde60('0xa')]||'';this[_0xde60('0xb')]=_0x4d9b24[_0xde60('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index bc85af5..dfbb811 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 _0xd8b0=['Configurations','exports','name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x2bf6be,_0x5b23f1){var _0x532ef4=function(_0x3760df){while(--_0x3760df){_0x2bf6be['push'](_0x2bf6be['shift']());}};_0x532ef4(++_0x5b23f1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';function Dynamics365Account(_0x5d04de){this['id']=_0x5d04de['id']||0x0;this[_0x0d8b('0x0')]=_0x5d04de['name']||'';this['username']=_0x5d04de['username']||'';this[_0x0d8b('0x1')]=_0x5d04de[_0x0d8b('0x1')]||'';this[_0x0d8b('0x2')]=_0x5d04de[_0x0d8b('0x2')]||'';this[_0x0d8b('0x3')]=_0x5d04de['tenantId']||'';this['clientId']=_0x5d04de[_0x0d8b('0x4')]||'';this[_0x0d8b('0x5')]=_0x5d04de[_0x0d8b('0x5')]||{};this['serverUrl']=_0x5d04de[_0x0d8b('0x6')]||'';this[_0x0d8b('0x7')]=_0x5d04de['Configurations']||{};}module[_0x0d8b('0x8')]=Dynamics365Account; \ No newline at end of file +var _0x2dae=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x20e4a7,_0x44787f){var _0x5108e3=function(_0x24cb05){while(--_0x24cb05){_0x20e4a7['push'](_0x20e4a7['shift']());}};_0x5108e3(++_0x44787f);}(_0x2dae,0xc3));var _0xe2da=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x2dae[_0x1ae4a9];return _0x54d0b0;};'use strict';function Dynamics365Account(_0x463a36){this['id']=_0x463a36['id']||0x0;this['name']=_0x463a36[_0xe2da('0x0')]||'';this[_0xe2da('0x1')]=_0x463a36[_0xe2da('0x1')]||'';this[_0xe2da('0x2')]=_0x463a36[_0xe2da('0x2')]||'';this['remoteUri']=_0x463a36[_0xe2da('0x3')]||'';this[_0xe2da('0x4')]=_0x463a36[_0xe2da('0x4')]||'';this[_0xe2da('0x5')]=_0x463a36['clientId']||'';this[_0xe2da('0x6')]=_0x463a36[_0xe2da('0x6')]||{};this[_0xe2da('0x7')]=_0x463a36[_0xe2da('0x7')]||'';this[_0xe2da('0x8')]=_0x463a36[_0xe2da('0x8')]||{};}module[_0xe2da('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 1ae775c..ee387d6 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 _0xf6d2=['gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29'];(function(_0x47bfef,_0x2c8e82){var _0x5cd479=function(_0x4f0d9d){while(--_0x4f0d9d){_0x47bfef['push'](_0x47bfef['shift']());}};_0x5cd479(++_0x2c8e82);}(_0xf6d2,0x1d8));var _0x2f6d=function(_0x3b964d,_0x46297b){_0x3b964d=_0x3b964d-0x0;var _0x59af99=_0xf6d2[_0x3b964d];return _0x59af99;};'use strict';function FaxAccount(_0x400990){this['id']=_0x400990['id']||0x0;this['name']=_0x400990[_0x2f6d('0x0')]||'';this[_0x2f6d('0x1')]=_0x400990[_0x2f6d('0x1')];this[_0x2f6d('0x2')]=_0x400990['ecm'];this[_0x2f6d('0x3')]=_0x400990[_0x2f6d('0x3')];this['localstationid']=_0x400990[_0x2f6d('0x4')];this['minrate']=_0x400990[_0x2f6d('0x5')]||0x960;this['maxrate']=_0x400990[_0x2f6d('0x6')]||0x3840;this['modem']=_0x400990['modem']||_0x2f6d('0x7');this[_0x2f6d('0x8')]=_0x400990[_0x2f6d('0x8')]||'no';this[_0x2f6d('0x9')]=_0x400990[_0x2f6d('0x9')]||'no';this[_0x2f6d('0xa')]=_0x400990[_0x2f6d('0xa')]||0x1388;this[_0x2f6d('0xb')]=_0x400990['tech']||'SIP';this[_0x2f6d('0xc')]=_0x400990[_0x2f6d('0xc')]?_0x400990[_0x2f6d('0xc')]:undefined;this[_0x2f6d('0xd')]=_0x400990['ListId'];this['key']=_0x400990[_0x2f6d('0xe')];}module[_0x2f6d('0xf')]=FaxAccount; \ No newline at end of file +var _0xb505=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x37195c,_0x22c7e2){var _0x36d3b3=function(_0x38b41f){while(--_0x38b41f){_0x37195c['push'](_0x37195c['shift']());}};_0x36d3b3(++_0x22c7e2);}(_0xb505,0x140));var _0x5b50=function(_0x478779,_0x3a6d8c){_0x478779=_0x478779-0x0;var _0x3fa166=_0xb505[_0x478779];return _0x3fa166;};'use strict';function FaxAccount(_0x5a3773){this['id']=_0x5a3773['id']||0x0;this[_0x5b50('0x0')]=_0x5a3773[_0x5b50('0x0')]||'';this[_0x5b50('0x1')]=_0x5a3773['description'];this['ecm']=_0x5a3773[_0x5b50('0x2')];this['headerinfo']=_0x5a3773[_0x5b50('0x3')];this[_0x5b50('0x4')]=_0x5a3773[_0x5b50('0x4')];this[_0x5b50('0x5')]=_0x5a3773[_0x5b50('0x5')]||0x960;this[_0x5b50('0x6')]=_0x5a3773[_0x5b50('0x6')]||0x3840;this[_0x5b50('0x7')]=_0x5a3773[_0x5b50('0x7')]||_0x5b50('0x8');this[_0x5b50('0x9')]=_0x5a3773[_0x5b50('0x9')]||'no';this['faxdetect']=_0x5a3773[_0x5b50('0xa')]||'no';this[_0x5b50('0xb')]=_0x5a3773['t38timeout']||0x1388;this['tech']=_0x5a3773['tech']||_0x5b50('0xc');this['Trunk']=_0x5a3773[_0x5b50('0xd')]?_0x5a3773[_0x5b50('0xd')]:undefined;this['ListId']=_0x5a3773[_0x5b50('0xe')];this[_0x5b50('0xf')]=_0x5a3773[_0x5b50('0xf')];}module[_0x5b50('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index a6b3757..ec2a099 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 _0xff4d=['serverUrl','Configurations','exports','name','username','token','remoteUri'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0xff4d,0x65));var _0xdff4=function(_0x4e566c,_0x16e04c){_0x4e566c=_0x4e566c-0x0;var _0x31947e=_0xff4d[_0x4e566c];return _0x31947e;};'use strict';function FreshdeskAccount(_0x2332dc){this['id']=_0x2332dc['id']||0x0;this[_0xdff4('0x0')]=_0x2332dc[_0xdff4('0x0')]||'';this[_0xdff4('0x1')]=_0x2332dc[_0xdff4('0x1')]||'';this['apiKey']=_0x2332dc[_0xdff4('0x2')]||'';this[_0xdff4('0x3')]=_0x2332dc[_0xdff4('0x3')]||'';this[_0xdff4('0x4')]=_0x2332dc[_0xdff4('0x4')]||'';this[_0xdff4('0x5')]=_0x2332dc['Configurations']||{};}module[_0xdff4('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x7826=['username','token','remoteUri','serverUrl','Configurations','name'];(function(_0x54f056,_0x10ac46){var _0x195e5f=function(_0x32efc7){while(--_0x32efc7){_0x54f056['push'](_0x54f056['shift']());}};_0x195e5f(++_0x10ac46);}(_0x7826,0xa1));var _0x6782=function(_0x3ee771,_0x2b8251){_0x3ee771=_0x3ee771-0x0;var _0x1e99fa=_0x7826[_0x3ee771];return _0x1e99fa;};'use strict';function FreshdeskAccount(_0x5b895f){this['id']=_0x5b895f['id']||0x0;this[_0x6782('0x0')]=_0x5b895f['name']||'';this[_0x6782('0x1')]=_0x5b895f[_0x6782('0x1')]||'';this['apiKey']=_0x5b895f[_0x6782('0x2')]||'';this[_0x6782('0x3')]=_0x5b895f[_0x6782('0x3')]||'';this['serverUrl']=_0x5b895f[_0x6782('0x4')]||'';this[_0x6782('0x5')]=_0x5b895f['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 1468185..6fa2087 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 _0xd8a5=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x76ff3d,_0x552104){var _0xfeb3b8=function(_0x37a3a3){while(--_0x37a3a3){_0x76ff3d['push'](_0x76ff3d['shift']());}};_0xfeb3b8(++_0x552104);}(_0xd8a5,0x160));var _0x5d8a=function(_0x5693b4,_0x9ea47b){_0x5693b4=_0x5693b4-0x0;var _0x489578=_0xd8a5[_0x5693b4];return _0x489578;};'use strict';function FreshsalesAccount(_0x515cfd){this['id']=_0x515cfd['id']||0x0;this['name']=_0x515cfd[_0x5d8a('0x0')]||'';this[_0x5d8a('0x1')]=_0x515cfd['username']||'';this[_0x5d8a('0x2')]=_0x515cfd[_0x5d8a('0x3')]||'';this[_0x5d8a('0x4')]=_0x515cfd[_0x5d8a('0x4')]||'';this[_0x5d8a('0x5')]=_0x515cfd[_0x5d8a('0x5')]||'';this[_0x5d8a('0x6')]=_0x515cfd[_0x5d8a('0x6')]||{};}module[_0x5d8a('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x2428=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x573255,_0x4d84fd){var _0x3d5253=function(_0x226ebc){while(--_0x226ebc){_0x573255['push'](_0x573255['shift']());}};_0x3d5253(++_0x4d84fd);}(_0x2428,0xd3));var _0x8242=function(_0x139672,_0x2bcfbc){_0x139672=_0x139672-0x0;var _0x55b248=_0x2428[_0x139672];return _0x55b248;};'use strict';function FreshsalesAccount(_0x4630f5){this['id']=_0x4630f5['id']||0x0;this[_0x8242('0x0')]=_0x4630f5[_0x8242('0x0')]||'';this[_0x8242('0x1')]=_0x4630f5[_0x8242('0x1')]||'';this[_0x8242('0x2')]=_0x4630f5[_0x8242('0x3')]||'';this[_0x8242('0x4')]=_0x4630f5[_0x8242('0x4')]||'';this[_0x8242('0x5')]=_0x4630f5[_0x8242('0x5')]||'';this[_0x8242('0x6')]=_0x4630f5['Configurations']||{};}module[_0x8242('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 0f2a72e..237b190 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 _0x73df=['lastAssignedTo','mohtime','variables','exports','type','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned'];(function(_0x57b36b,_0x452782){var _0x515125=function(_0x567ab5){while(--_0x567ab5){_0x57b36b['push'](_0x57b36b['shift']());}};_0x515125(++_0x452782);}(_0x73df,0x1f2));var _0xf73d=function(_0x5aa034,_0x13c83d){_0x5aa034=_0x5aa034-0x0;var _0x53afb5=_0x73df[_0x5aa034];return _0x53afb5;};'use strict';function QueueReport(){this[_0xf73d('0x0')]='inbound';this['uniqueid']='';this[_0xf73d('0x1')]='';this[_0xf73d('0x2')]='';this[_0xf73d('0x3')]='';this[_0xf73d('0x4')]=null;this['queuecallerleaveAt']=null;this[_0xf73d('0x5')]=0x1;this[_0xf73d('0x6')]=0x1;this[_0xf73d('0x7')]=![];this[_0xf73d('0x8')]=null;this[_0xf73d('0x9')]=![];this[_0xf73d('0xa')]=null;this[_0xf73d('0xb')]=![];this[_0xf73d('0xc')]=null;this[_0xf73d('0xd')]=0x1;this[_0xf73d('0xe')]='';this[_0xf73d('0xf')]='';this[_0xf73d('0x10')]='';this[_0xf73d('0x11')]='';this[_0xf73d('0x12')]='';this[_0xf73d('0x13')]='';this['priority']='';this[_0xf73d('0x14')]=0x0;this[_0xf73d('0x15')]=![];this[_0xf73d('0x16')]='';this[_0xf73d('0x17')]=0x0;this[_0xf73d('0x18')]={};}module[_0xf73d('0x19')]=QueueReport; \ No newline at end of file +var _0x8661=['queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','context','exten','assigned','lastAssignedTo','mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname'];(function(_0x49c4db,_0x2b1d7e){var _0x3bbef2=function(_0x320376){while(--_0x320376){_0x49c4db['push'](_0x49c4db['shift']());}};_0x3bbef2(++_0x2b1d7e);}(_0x8661,0x95));var _0x1866=function(_0x57c690,_0x23646e){_0x57c690=_0x57c690-0x0;var _0x5ca66f=_0x8661[_0x57c690];return _0x5ca66f;};'use strict';function QueueReport(){this[_0x1866('0x0')]=_0x1866('0x1');this[_0x1866('0x2')]='';this[_0x1866('0x3')]='';this[_0x1866('0x4')]='';this[_0x1866('0x5')]='';this[_0x1866('0x6')]=null;this[_0x1866('0x7')]=null;this['position']=0x1;this[_0x1866('0x8')]=0x1;this['queuecallerabandon']=![];this[_0x1866('0x9')]=null;this['queuecallercomplete']=![];this[_0x1866('0xa')]=null;this[_0x1866('0xb')]=![];this[_0x1866('0xc')]=null;this[_0x1866('0xd')]=0x1;this['channel']='';this[_0x1866('0xe')]='';this['connectedlinename']='';this[_0x1866('0xf')]='';this[_0x1866('0x10')]='';this[_0x1866('0x11')]='';this['priority']='';this['holdtime']=0x0;this[_0x1866('0x12')]=![];this[_0x1866('0x13')]='';this[_0x1866('0x14')]=0x0;this[_0x1866('0x15')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 8ffc80a..09808c2 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 _0x42bd=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username'];(function(_0x2d7919,_0x4f486b){var _0x2e8542=function(_0x157212){while(--_0x157212){_0x2d7919['push'](_0x2d7919['shift']());}};_0x2e8542(++_0x4f486b);}(_0x42bd,0x198));var _0xd42b=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x42bd[_0x13d07a];return _0x5ee0ee;};'use strict';function SalesforceAccount(_0x586f4b){this['id']=_0x586f4b['id']||0x0;this['name']=_0x586f4b[_0xd42b('0x0')]||'';this[_0xd42b('0x1')]=_0x586f4b[_0xd42b('0x1')]||'';this['remoteUri']=_0x586f4b['remoteUri']||'';this['password']=_0x586f4b[_0xd42b('0x2')]||'';this[_0xd42b('0x3')]=_0x586f4b[_0xd42b('0x3')]||'';this[_0xd42b('0x4')]=_0x586f4b[_0xd42b('0x4')]||'';this[_0xd42b('0x5')]=_0x586f4b[_0xd42b('0x5')]||'';this[_0xd42b('0x6')]=_0x586f4b['type']||_0xd42b('0x7');this[_0xd42b('0x8')]=_0x586f4b[_0xd42b('0x8')]||'';this['Configurations']=_0x586f4b[_0xd42b('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xad5f=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x1a9e4f,_0x3ed37f){var _0x5dfa04=function(_0x17bd79){while(--_0x17bd79){_0x1a9e4f['push'](_0x1a9e4f['shift']());}};_0x5dfa04(++_0x3ed37f);}(_0xad5f,0x1a8));var _0xfad5=function(_0x350c87,_0x2b44ef){_0x350c87=_0x350c87-0x0;var _0x163800=_0xad5f[_0x350c87];return _0x163800;};'use strict';function SalesforceAccount(_0x16c71c){this['id']=_0x16c71c['id']||0x0;this[_0xfad5('0x0')]=_0x16c71c[_0xfad5('0x0')]||'';this[_0xfad5('0x1')]=_0x16c71c[_0xfad5('0x1')]||'';this[_0xfad5('0x2')]=_0x16c71c['remoteUri']||'';this[_0xfad5('0x3')]=_0x16c71c[_0xfad5('0x3')]||'';this[_0xfad5('0x4')]=_0x16c71c[_0xfad5('0x4')]||'';this[_0xfad5('0x5')]=_0x16c71c[_0xfad5('0x5')]||'';this[_0xfad5('0x6')]=_0x16c71c['securityToken']||'';this[_0xfad5('0x7')]=_0x16c71c[_0xfad5('0x7')]||_0xfad5('0x8');this[_0xfad5('0x9')]=_0x16c71c['serverUrl']||'';this[_0xfad5('0xa')]=_0x16c71c[_0xfad5('0xa')]||{};}module[_0xfad5('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index ff9d008..a976cf2 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 _0x3fc4=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x54a24b,_0x423b2b){var _0x3c8bec=function(_0xfc3221){while(--_0xfc3221){_0x54a24b['push'](_0x54a24b['shift']());}};_0x3c8bec(++_0x423b2b);}(_0x3fc4,0x1d4));var _0x43fc=function(_0x205a4c,_0x3bb418){_0x205a4c=_0x205a4c-0x0;var _0x3039d4=_0x3fc4[_0x205a4c];return _0x3039d4;};'use strict';function ServicenowAccount(_0x36556e){this['id']=_0x36556e['id']||0x0;this[_0x43fc('0x0')]=_0x36556e['name']||'';this[_0x43fc('0x1')]=_0x36556e['username']||'';this[_0x43fc('0x2')]=_0x36556e[_0x43fc('0x2')]||'';this[_0x43fc('0x3')]=_0x36556e[_0x43fc('0x3')]||'';this[_0x43fc('0x4')]=_0x36556e[_0x43fc('0x4')]||'';this[_0x43fc('0x5')]=_0x36556e[_0x43fc('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xf377=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x1db78c,_0x37ea25){var _0x1e7df4=function(_0x3d60b7){while(--_0x3d60b7){_0x1db78c['push'](_0x1db78c['shift']());}};_0x1e7df4(++_0x37ea25);}(_0xf377,0x10d));var _0x7f37=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xf377[_0x55f8b4];return _0x2475f9;};'use strict';function ServicenowAccount(_0x51085f){this['id']=_0x51085f['id']||0x0;this[_0x7f37('0x0')]=_0x51085f[_0x7f37('0x0')]||'';this[_0x7f37('0x1')]=_0x51085f['username']||'';this[_0x7f37('0x2')]=_0x51085f[_0x7f37('0x2')]||'';this[_0x7f37('0x3')]=_0x51085f[_0x7f37('0x3')]||'';this[_0x7f37('0x4')]=_0x51085f['serverUrl']||'';this['Configurations']=_0x51085f[_0x7f37('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index a3c8920..8225f27 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 _0xdeeb=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x598117,_0x477b34){var _0x224ce6=function(_0x3ed2ed){while(--_0x3ed2ed){_0x598117['push'](_0x598117['shift']());}};_0x224ce6(++_0x477b34);}(_0xdeeb,0x1b3));var _0xbdee=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xdeeb[_0x138adb];return _0x1b27f2;};'use strict';function SugarcrmAccount(_0x2874c9){this['id']=_0x2874c9['id']||0x0;this['name']=_0x2874c9[_0xbdee('0x0')]||'';this[_0xbdee('0x1')]=_0x2874c9[_0xbdee('0x1')]||'';this['password']=_0x2874c9[_0xbdee('0x2')]||'';this['remoteUri']=_0x2874c9[_0xbdee('0x3')]||'';this['serverUrl']=_0x2874c9[_0xbdee('0x4')]||'';this['Configurations']=_0x2874c9[_0xbdee('0x5')]||{};}module[_0xbdee('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x37de=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x3f003c,_0x276a93){var _0x17ff25=function(_0x593558){while(--_0x593558){_0x3f003c['push'](_0x3f003c['shift']());}};_0x17ff25(++_0x276a93);}(_0x37de,0x10f));var _0xe37d=function(_0x517fc3,_0x384d51){_0x517fc3=_0x517fc3-0x0;var _0xc4a05c=_0x37de[_0x517fc3];return _0xc4a05c;};'use strict';function SugarcrmAccount(_0x413e01){this['id']=_0x413e01['id']||0x0;this[_0xe37d('0x0')]=_0x413e01[_0xe37d('0x0')]||'';this['username']=_0x413e01[_0xe37d('0x1')]||'';this[_0xe37d('0x2')]=_0x413e01['password']||'';this[_0xe37d('0x3')]=_0x413e01['remoteUri']||'';this[_0xe37d('0x4')]=_0x413e01[_0xe37d('0x4')]||'';this[_0xe37d('0x5')]=_0x413e01[_0xe37d('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 9940955..4fa4131 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 _0xeee9=['stateTime','status','exports','name','accountcode','state','unknown'];(function(_0x3791a5,_0x3e9d44){var _0x495f05=function(_0x2a2e0c){while(--_0x2a2e0c){_0x3791a5['push'](_0x3791a5['shift']());}};_0x495f05(++_0x3e9d44);}(_0xeee9,0x153));var _0x9eee=function(_0x23571e,_0x12d4bb){_0x23571e=_0x23571e-0x0;var _0x55eb29=_0xeee9[_0x23571e];return _0x55eb29;};'use strict';function Telephone(_0x16b31a){this['id']=_0x16b31a['id']||0x0;this[_0x9eee('0x0')]=_0x16b31a[_0x9eee('0x0')]||'';this[_0x9eee('0x1')]=_0x16b31a[_0x9eee('0x1')]||'';this[_0x9eee('0x2')]=_0x9eee('0x3');this[_0x9eee('0x4')]=0x0;this[_0x9eee('0x5')]=_0x9eee('0x3');this['address']='';}module[_0x9eee('0x6')]=Telephone; \ No newline at end of file +var _0x5a1c=['accountcode','unknown','stateTime','status','exports','name'];(function(_0x1b4cc3,_0x268075){var _0x40f002=function(_0x102e4d){while(--_0x102e4d){_0x1b4cc3['push'](_0x1b4cc3['shift']());}};_0x40f002(++_0x268075);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x51216,_0x157254){_0x51216=_0x51216-0x0;var _0x3d7040=_0x5a1c[_0x51216];return _0x3d7040;};'use strict';function Telephone(_0x44ce43){this['id']=_0x44ce43['id']||0x0;this[_0xc5a1('0x0')]=_0x44ce43['name']||'';this['accountcode']=_0x44ce43[_0xc5a1('0x1')]||'';this['state']=_0xc5a1('0x2');this[_0xc5a1('0x3')]=0x0;this[_0xc5a1('0x4')]=_0xc5a1('0x2');this['address']='';}module[_0xc5a1('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 4a98d8b..4612db2 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(_0x565e3b,_0x19c55a){var _0x488cf0=function(_0xa5af58){while(--_0xa5af58){_0x565e3b['push'](_0x565e3b['shift']());}};_0x488cf0(++_0x19c55a);}(_0xb10b,0x12a));var _0xbb10=function(_0x972b32,_0x56ea80){_0x972b32=_0x972b32-0x0;var _0x6e8e75=_0xb10b[_0x972b32];return _0x6e8e75;};'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(_0x17bde5,_0xb02b5a){var _0x309971=function(_0x5c745f){while(--_0x5c745f){_0x17bde5['push'](_0x17bde5['shift']());}};_0x309971(++_0xb02b5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 9b87a7c..86b042e 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(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4c6bca,_0x3de390){_0x4c6bca=_0x4c6bca-0x0;var _0x29d58e=_0x0b0e[_0x4c6bca];return _0x29d58e;};'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 _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0xdc0e2d,_0x14dcae){var _0x19f7d0=function(_0x4e74ea){while(--_0x4e74ea){_0xdc0e2d['push'](_0xdc0e2d['shift']());}};_0x19f7d0(++_0x14dcae);}(_0xb10b,0x12a));var _0xbb10=function(_0xd206ce,_0x3031d2){_0xd206ce=_0xd206ce-0x0;var _0x5b3ec6=_0xb10b[_0xd206ce];return _0x5b3ec6;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index d16c0a8..74fd72a 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 _0xdc30=['status','registry','host','domainport','registrationtime','address','exports','active','name','state','unknown'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0xdc30,0x8b));var _0x0dc3=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0xdc30[_0xce9195];return _0x530fe6;};'use strict';function Trunk(_0x3e6106){this['id']=_0x3e6106['id']||0x0;this[_0x0dc3('0x0')]=_0x3e6106[_0x0dc3('0x0')]||![];this['name']=_0x3e6106[_0x0dc3('0x1')]||'';this[_0x0dc3('0x2')]=_0x0dc3('0x3');this['stateTime']=0x0;this[_0x0dc3('0x4')]=_0x0dc3('0x3');this[_0x0dc3('0x5')]=_0x3e6106['registry']&&_0x3e6106['registry']['indexOf'](':')?_0x3e6106[_0x0dc3('0x5')]['split'](':')[0x0]:'';this[_0x0dc3('0x6')]='';this['port']='';this['domain']='';this[_0x0dc3('0x7')]='';this['refresh']='';this['stateRegistry']='unknown';this[_0x0dc3('0x8')]='';this[_0x0dc3('0x9')]='';this['defaultuser']=_0x3e6106['defaultuser']||'';}module[_0x0dc3('0xa')]=Trunk; \ No newline at end of file +var _0x20ef=['exports','active','name','state','stateTime','status','unknown','registry','indexOf','host','port','domain','domainport','refresh','registrationtime','address','defaultuser'];(function(_0x43ce3a,_0x589561){var _0x246e6d=function(_0x42a46f){while(--_0x42a46f){_0x43ce3a['push'](_0x43ce3a['shift']());}};_0x246e6d(++_0x589561);}(_0x20ef,0x133));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';function Trunk(_0x45827e){this['id']=_0x45827e['id']||0x0;this[_0xf20e('0x0')]=_0x45827e[_0xf20e('0x0')]||![];this[_0xf20e('0x1')]=_0x45827e[_0xf20e('0x1')]||'';this[_0xf20e('0x2')]='unknown';this[_0xf20e('0x3')]=0x0;this[_0xf20e('0x4')]=_0xf20e('0x5');this['registry']=_0x45827e[_0xf20e('0x6')]&&_0x45827e['registry'][_0xf20e('0x7')](':')?_0x45827e[_0xf20e('0x6')]['split'](':')[0x0]:'';this[_0xf20e('0x8')]='';this[_0xf20e('0x9')]='';this[_0xf20e('0xa')]='';this[_0xf20e('0xb')]='';this[_0xf20e('0xc')]='';this['stateRegistry']=_0xf20e('0x5');this[_0xf20e('0xd')]='';this[_0xf20e('0xe')]='';this[_0xf20e('0xf')]=_0x45827e[_0xf20e('0xf')]||'';}module[_0xf20e('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index d3c54c0..dc185e6 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 _0x4f52=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x4f52,0x111));var _0x24f5=function(_0x35fe3b,_0x310f07){_0x35fe3b=_0x35fe3b-0x0;var _0x2b3d86=_0x4f52[_0x35fe3b];return _0x2b3d86;};'use strict';function voiceExtension(_0x100c74){this['id']=_0x100c74['id']||0x0;this[_0x24f5('0x0')]=_0x100c74[_0x24f5('0x0')]||'';this['recordingFormat']=_0x100c74[_0x24f5('0x1')]||_0x24f5('0x2');this['mandatoryDisposition']=_0x100c74[_0x24f5('0x3')]||![];}module[_0x24f5('0x4')]=voiceExtension; \ No newline at end of file +var _0x49df=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x6e4ae7,_0x52094a){var _0x2e5f0e=function(_0x45e4b8){while(--_0x45e4b8){_0x6e4ae7['push'](_0x6e4ae7['shift']());}};_0x2e5f0e(++_0x52094a);}(_0x49df,0x18f));var _0xf49d=function(_0xe3c731,_0x347775){_0xe3c731=_0xe3c731-0x0;var _0x5693ee=_0x49df[_0xe3c731];return _0x5693ee;};'use strict';function voiceExtension(_0x99053b){this['id']=_0x99053b['id']||0x0;this[_0xf49d('0x0')]=_0x99053b[_0xf49d('0x0')]||'';this[_0xf49d('0x1')]=_0x99053b[_0xf49d('0x1')]||_0xf49d('0x2');this[_0xf49d('0x3')]=_0x99053b['mandatoryDisposition']||![];}module[_0xf49d('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 35c6a1a..7ad76c4 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 _0x9333=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','pTalking','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','unknown','not_inuse','invalid','unavailable','onhold','wav','wav49','gsm','rrmemory','monitor_format','type','inbound','waiting','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x9333,0x122));var _0x3933=function(_0x49741f,_0x20b39e){_0x49741f=_0x49741f-0x0;var _0x179734=_0x9333[_0x49741f];return _0x179734;};'use strict';var statusDesc=[_0x3933('0x0'),_0x3933('0x1'),'inuse','busy',_0x3933('0x2'),_0x3933('0x3'),'ringing','ringinuse',_0x3933('0x4')];var monitorFormat={'wav':_0x3933('0x5'),'wav49':_0x3933('0x6'),'gsm':_0x3933('0x7')};var strategy={'rrmemory':_0x3933('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x3a87d3){this['id']=_0x3a87d3['id']||0x0;this['name']=_0x3a87d3['name']||'';this['monitor_format']=_0x3a87d3[_0x3933('0x9')]||'';this[_0x3933('0xa')]=_0x3a87d3[_0x3933('0xa')]||_0x3933('0xb');this[_0x3933('0xc')]=0x0;this['talking']=0x0;this[_0x3933('0xd')]=0x0;this['answered']=0x0;this[_0x3933('0xe')]=0x0;this[_0x3933('0xf')]=0x0;this[_0x3933('0x10')]=0x0;this[_0x3933('0x11')]=0x0;this[_0x3933('0x12')]=0x0;this[_0x3933('0x13')]=0x0;this[_0x3933('0x14')]=0x0;this[_0x3933('0x15')]=_0x3a87d3['acw']||![];this['acwTimeout']=_0x3a87d3['acwTimeout']||0xa;this['autopause']=_0x3a87d3[_0x3933('0x16')]||'no';this[_0x3933('0x17')]=!![];this[_0x3933('0x18')]='';this['originated']=0x0;this[_0x3933('0x19')]=0x0;this[_0x3933('0x1a')]=_0x3a87d3[_0x3933('0x1a')]||null;this[_0x3933('0x1b')]=_0x3a87d3[_0x3933('0x1b')]?_0x3a87d3[_0x3933('0x1b')]:null;this[_0x3933('0x1c')]=_0x3a87d3['dialActive'];this[_0x3933('0x1d')]=_0x3a87d3[_0x3933('0x1d')]||_0x3933('0x1e');this['dialLimitChannel']=_0x3a87d3[_0x3933('0x1f')]||0x0;this[_0x3933('0x20')]=_0x3a87d3[_0x3933('0x20')]||0x0;this['dialPowerLevel']=_0x3a87d3[_0x3933('0x21')]||0x1;this['dialPredictiveOptimization']=_0x3a87d3[_0x3933('0x22')]||_0x3933('0x23');this['dialPredictiveOptimizationPercentage']=_0x3a87d3[_0x3933('0x24')]||0.03;this['dialPredictiveInterval']=_0x3a87d3[_0x3933('0x25')]||0x258;this[_0x3933('0x26')]=_0x3a87d3[_0x3933('0x26')]||_0x3933('0x27');this['dialOriginateCallerIdNumber']=_0x3a87d3[_0x3933('0x28')]||'anonymous';this[_0x3933('0x29')]=_0x3a87d3[_0x3933('0x29')]||0x1e;this[_0x3933('0x2a')]=_0x3a87d3[_0x3933('0x2a')]||_0x3933('0x2b');this[_0x3933('0x2c')]=_0x3a87d3[_0x3933('0x2c')]||0x3;this['dialQueueProject']=_0x3a87d3[_0x3933('0x2d')]||undefined;this[_0x3933('0x2e')]=_0x3a87d3[_0x3933('0x2e')]||0x3;this['dialCongestionRetryFrequency']=_0x3a87d3[_0x3933('0x2f')]||0x96;this[_0x3933('0x30')]=_0x3a87d3[_0x3933('0x30')]||0x3;this[_0x3933('0x31')]=_0x3a87d3[_0x3933('0x31')]||0x96;this['dialNoAnswerMaxRetry']=_0x3a87d3[_0x3933('0x32')]||0x3;this['dialNoAnswerRetryFrequency']=_0x3a87d3[_0x3933('0x33')]||0x96;this[_0x3933('0x34')]=_0x3a87d3[_0x3933('0x34')]||0x3;this[_0x3933('0x35')]=_0x3a87d3[_0x3933('0x35')]||0x96;this[_0x3933('0x36')]=_0x3a87d3[_0x3933('0x36')]||0x3;this[_0x3933('0x37')]=_0x3a87d3[_0x3933('0x37')]||0x96;this[_0x3933('0x38')]=_0x3a87d3[_0x3933('0x38')]||0x3;this[_0x3933('0x39')]=_0x3a87d3[_0x3933('0x39')]||0x96;this[_0x3933('0x3a')]=_0x3a87d3[_0x3933('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0x3a87d3[_0x3933('0x3b')]||0x96;this[_0x3933('0x3c')]=_0x3a87d3[_0x3933('0x3c')]||0x3;this[_0x3933('0x3d')]=_0x3a87d3['dialAgentRejectRetryFrequency']||0x96;this[_0x3933('0x3e')]=_0x3a87d3[_0x3933('0x3e')]||0x4;this[_0x3933('0x3f')]=_0x3a87d3['Trunk']?_0x3a87d3[_0x3933('0x3f')]:undefined;this['TrunkBackup']=_0x3a87d3[_0x3933('0x40')]?_0x3a87d3[_0x3933('0x40')]:undefined;this[_0x3933('0x41')]=_0x3a87d3[_0x3933('0x41')]||undefined;this['Interval']=_0x3a87d3[_0x3933('0x42')]?_0x3a87d3['Interval']:undefined;this['dialOrderByScheduledAt']=_0x3a87d3[_0x3933('0x43')]||_0x3933('0x44');this[_0x3933('0x45')]=_0x3a87d3['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x3933('0x46')]=_0x3a87d3[_0x3933('0x46')]||undefined;this[_0x3933('0x47')]=strategy[_0x3a87d3[_0x3933('0x47')]]||'rrmemory';this[_0x3933('0x48')]=!![];this[_0x3933('0x49')]=_0x3a87d3[_0x3933('0x49')]||![];this[_0x3933('0x4a')]=_0x3a87d3[_0x3933('0x4a')];this[_0x3933('0x4b')]=_0x3a87d3[_0x3933('0x4b')];this[_0x3933('0x4c')]=_0x3a87d3[_0x3933('0x4c')];this['dialAMDTotalAnalysisTime']=_0x3a87d3[_0x3933('0x4d')];this[_0x3933('0x4e')]=_0x3a87d3[_0x3933('0x4e')];this[_0x3933('0x4f')]=_0x3a87d3[_0x3933('0x4f')];this[_0x3933('0x50')]=_0x3a87d3[_0x3933('0x50')];this[_0x3933('0x51')]=_0x3a87d3[_0x3933('0x51')];this['dialAMDMaximumWordLength']=_0x3a87d3['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x3933('0x52')]=0x0;this['timeout']=_0x3a87d3['timeout'];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x3933('0x53')]=0x0;this[_0x3933('0x54')]=0x0;this[_0x3933('0x55')]=0x0;this[_0x3933('0x56')]=0x0;this[_0x3933('0x57')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x3933('0x58')]=0x0;this[_0x3933('0x59')]=0x0;this[_0x3933('0x5a')]=0x0;this[_0x3933('0x5b')]=0x0;this[_0x3933('0x5c')]=undefined;this[_0x3933('0x5d')]=undefined;this[_0x3933('0x5e')]=undefined;this[_0x3933('0x5f')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x3933('0x60')]=0x0;this[_0x3933('0x61')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x3933('0x62')]=0x0;this[_0x3933('0x63')]=0x0;this[_0x3933('0x64')]=0x0;this['predictiveIntervalMaxThreshold']=_0x3a87d3['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x3933('0x65')]=_0x3a87d3['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x3933('0x66')]=0x0;this[_0x3933('0x67')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x3933('0x68')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x3933('0x69')]=0x0;this[_0x3933('0x6a')]=_0x3a87d3[_0x3933('0x6a')]||0x1e;this[_0x3933('0x6b')]=_0x3a87d3[_0x3933('0x6b')]||![];this['dialQueueProject2']=_0x3a87d3[_0x3933('0x6c')]||undefined;this[_0x3933('0x6d')]=_0x3a87d3[_0x3933('0x6d')]||![];this[_0x3933('0x6e')]=_0x3a87d3[_0x3933('0x6e')]||![];this[_0x3933('0x9')]=monitorFormat[_0x3a87d3[_0x3933('0x9')]]?monitorFormat[_0x3a87d3['monitor_format']]:undefined;this['mandatoryDisposition']=_0x3a87d3['mandatoryDisposition']||![];this[_0x3933('0x6f')]=_0x3a87d3[_0x3933('0x6f')]?_0x3a87d3[_0x3933('0x6f')]:undefined;}module[_0x3933('0x70')]=VoiceQueue; \ No newline at end of file +var _0x696e=['exports','unknown','inuse','busy','unavailable','ringing','wav','wav49','rrmemory','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause'];(function(_0x21347a,_0x1ce3da){var _0xe2eb23=function(_0x1a02f9){while(--_0x1a02f9){_0x21347a['push'](_0x21347a['shift']());}};_0xe2eb23(++_0x1ce3da);}(_0x696e,0x1d1));var _0xe696=function(_0x1007e6,_0x21e57a){_0x1007e6=_0x1007e6-0x0;var _0x4406da=_0x696e[_0x1007e6];return _0x4406da;};'use strict';var statusDesc=[_0xe696('0x0'),'not_inuse',_0xe696('0x1'),_0xe696('0x2'),'invalid',_0xe696('0x3'),_0xe696('0x4'),'ringinuse','onhold'];var monitorFormat={'wav':_0xe696('0x5'),'wav49':_0xe696('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0xe696('0x7'),'roundrobin':'roundrobin'};function VoiceQueue(_0x23a678){this['id']=_0x23a678['id']||0x0;this[_0xe696('0x8')]=_0x23a678[_0xe696('0x8')]||'';this[_0xe696('0x9')]=_0x23a678[_0xe696('0x9')]||'';this['type']=_0x23a678[_0xe696('0xa')]||_0xe696('0xb');this[_0xe696('0xc')]=0x0;this[_0xe696('0xd')]=0x0;this['total']=0x0;this[_0xe696('0xe')]=0x0;this[_0xe696('0xf')]=0x0;this['sumHoldTime']=0x0;this[_0xe696('0x10')]=0x0;this[_0xe696('0x11')]=0x0;this[_0xe696('0x12')]=0x0;this[_0xe696('0x13')]=0x0;this[_0xe696('0x14')]=0x0;this['acw']=_0x23a678[_0xe696('0x15')]||![];this['acwTimeout']=_0x23a678[_0xe696('0x16')]||0xa;this['autopause']=_0x23a678[_0xe696('0x17')]||'no';this[_0xe696('0x18')]=!![];this[_0xe696('0x19')]='';this['originated']=0x0;this[_0xe696('0x1a')]=0x0;this[_0xe696('0x1b')]=_0x23a678[_0xe696('0x1b')]||null;this[_0xe696('0x1c')]=_0x23a678[_0xe696('0x1c')]?_0x23a678['dialGlobalInterval']:null;this[_0xe696('0x1d')]=_0x23a678[_0xe696('0x1d')];this[_0xe696('0x1e')]=_0x23a678[_0xe696('0x1e')]||'progressive';this[_0xe696('0x1f')]=_0x23a678[_0xe696('0x1f')]||0x0;this['dialLimitQueue']=_0x23a678[_0xe696('0x20')]||0x0;this[_0xe696('0x21')]=_0x23a678['dialPowerLevel']||0x1;this[_0xe696('0x22')]=_0x23a678[_0xe696('0x22')]||_0xe696('0x23');this[_0xe696('0x24')]=_0x23a678[_0xe696('0x24')]||0.03;this['dialPredictiveInterval']=_0x23a678[_0xe696('0x25')]||0x258;this[_0xe696('0x26')]=_0x23a678[_0xe696('0x26')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x23a678[_0xe696('0x27')]||_0xe696('0x28');this[_0xe696('0x29')]=_0x23a678[_0xe696('0x29')]||0x1e;this[_0xe696('0x2a')]=_0x23a678[_0xe696('0x2a')]||'tTxX';this[_0xe696('0x2b')]=_0x23a678[_0xe696('0x2b')]||0x3;this[_0xe696('0x2c')]=_0x23a678[_0xe696('0x2c')]||undefined;this[_0xe696('0x2d')]=_0x23a678[_0xe696('0x2d')]||0x3;this[_0xe696('0x2e')]=_0x23a678['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x23a678['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x23a678[_0xe696('0x2f')]||0x96;this[_0xe696('0x30')]=_0x23a678['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x23a678['dialNoAnswerRetryFrequency']||0x96;this[_0xe696('0x31')]=_0x23a678['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x23a678[_0xe696('0x32')]||0x96;this[_0xe696('0x33')]=_0x23a678[_0xe696('0x33')]||0x3;this[_0xe696('0x34')]=_0x23a678[_0xe696('0x34')]||0x96;this[_0xe696('0x35')]=_0x23a678[_0xe696('0x35')]||0x3;this[_0xe696('0x36')]=_0x23a678[_0xe696('0x36')]||0x96;this[_0xe696('0x37')]=_0x23a678[_0xe696('0x37')]||0x3;this['dialMachineRetryFrequency']=_0x23a678['dialMachineRetryFrequency']||0x96;this[_0xe696('0x38')]=_0x23a678[_0xe696('0x38')]||0x3;this[_0xe696('0x39')]=_0x23a678['dialAgentRejectRetryFrequency']||0x96;this[_0xe696('0x3a')]=_0x23a678[_0xe696('0x3a')]||0x4;this['Trunk']=_0x23a678[_0xe696('0x3b')]?_0x23a678[_0xe696('0x3b')]:undefined;this['TrunkBackup']=_0x23a678[_0xe696('0x3c')]?_0x23a678[_0xe696('0x3c')]:undefined;this[_0xe696('0x3d')]=_0x23a678[_0xe696('0x3d')]||undefined;this[_0xe696('0x3e')]=_0x23a678[_0xe696('0x3e')]?_0x23a678[_0xe696('0x3e')]:undefined;this[_0xe696('0x3f')]=_0x23a678[_0xe696('0x3f')]||_0xe696('0x40');this['dialRandomLastDigitCallerIdNumber']=_0x23a678['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x23a678[_0xe696('0x41')]||undefined;this[_0xe696('0x42')]=strategy[_0x23a678[_0xe696('0x42')]]||_0xe696('0x7');this[_0xe696('0x43')]=!![];this[_0xe696('0x44')]=_0x23a678['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x23a678[_0xe696('0x45')];this[_0xe696('0x46')]=_0x23a678[_0xe696('0x46')];this[_0xe696('0x47')]=_0x23a678[_0xe696('0x47')];this[_0xe696('0x48')]=_0x23a678[_0xe696('0x48')];this[_0xe696('0x49')]=_0x23a678['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x23a678[_0xe696('0x4a')];this[_0xe696('0x4b')]=_0x23a678[_0xe696('0x4b')];this[_0xe696('0x4c')]=_0x23a678['dialAMDSilenceThreshold'];this[_0xe696('0x4d')]=_0x23a678[_0xe696('0x4d')];this[_0xe696('0x4e')]=0x0;this[_0xe696('0x4f')]=0x0;this['timeout']=_0x23a678[_0xe696('0x50')];this[_0xe696('0x51')]=0x0;this[_0xe696('0x52')]=0x0;this[_0xe696('0x53')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xe696('0x54')]=0x0;this[_0xe696('0x55')]=0x0;this[_0xe696('0x56')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xe696('0x57')]=0x0;this[_0xe696('0x58')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xe696('0x59')]=0x0;this[_0xe696('0x5a')]=0x0;this[_0xe696('0x5b')]=0x0;this[_0xe696('0x5c')]=undefined;this[_0xe696('0x5d')]=undefined;this[_0xe696('0x5e')]=undefined;this[_0xe696('0x5f')]=1.05;this[_0xe696('0x60')]=0x0;this[_0xe696('0x61')]=0x0;this[_0xe696('0x62')]=0x0;this[_0xe696('0x63')]=0x0;this[_0xe696('0x64')]=0x0;this[_0xe696('0x65')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xe696('0x66')]=0x0;this['predictiveIntervalMaxThreshold']=_0x23a678[_0xe696('0x67')]||0x14;this[_0xe696('0x68')]=_0x23a678['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xe696('0x69')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xe696('0x6a')]=0x0;this[_0xe696('0x6b')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xe696('0x6c')]=0x0;this[_0xe696('0x6d')]=_0x23a678['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x23a678['dialRecallInQueue']||![];this[_0xe696('0x6e')]=_0x23a678[_0xe696('0x6e')]||undefined;this['dialAgiAfterHangupClient']=_0x23a678[_0xe696('0x6f')]||![];this[_0xe696('0x70')]=_0x23a678[_0xe696('0x70')]||![];this['monitor_format']=monitorFormat[_0x23a678[_0xe696('0x9')]]?monitorFormat[_0x23a678[_0xe696('0x9')]]:undefined;this[_0xe696('0x71')]=_0x23a678[_0xe696('0x71')]||![];this[_0xe696('0x72')]=_0x23a678[_0xe696('0x72')]?_0x23a678['mandatoryDispositionPause']:undefined;}module[_0xe696('0x73')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 12ba449..08112f8 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 _0x5c11=['serverUrl','Configurations','name','username','remoteUri'];(function(_0x3526b3,_0xee8d13){var _0x1e4c93=function(_0x1bdaef){while(--_0x1bdaef){_0x3526b3['push'](_0x3526b3['shift']());}};_0x1e4c93(++_0xee8d13);}(_0x5c11,0x11f));var _0x15c1=function(_0xd38133,_0xdae649){_0xd38133=_0xd38133-0x0;var _0x5e586e=_0x5c11[_0xd38133];return _0x5e586e;};'use strict';function VtigerAccount(_0x4844dd){this['id']=_0x4844dd['id']||0x0;this[_0x15c1('0x0')]=_0x4844dd[_0x15c1('0x0')]||'';this[_0x15c1('0x1')]=_0x4844dd[_0x15c1('0x1')]||'';this['accessKey']=_0x4844dd['accessKey']||'';this[_0x15c1('0x2')]=_0x4844dd[_0x15c1('0x2')]||'';this[_0x15c1('0x3')]=_0x4844dd[_0x15c1('0x3')]||'';this[_0x15c1('0x4')]=_0x4844dd[_0x15c1('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x6816=['exports','name','username','accessKey','remoteUri','Configurations'];(function(_0x475eac,_0x2fa495){var _0x4ad158=function(_0x2d7c4c){while(--_0x2d7c4c){_0x475eac['push'](_0x475eac['shift']());}};_0x4ad158(++_0x2fa495);}(_0x6816,0x97));var _0x6681=function(_0x3bd13d,_0x15d859){_0x3bd13d=_0x3bd13d-0x0;var _0x32b33f=_0x6816[_0x3bd13d];return _0x32b33f;};'use strict';function VtigerAccount(_0x40fc11){this['id']=_0x40fc11['id']||0x0;this[_0x6681('0x0')]=_0x40fc11[_0x6681('0x0')]||'';this[_0x6681('0x1')]=_0x40fc11[_0x6681('0x1')]||'';this[_0x6681('0x2')]=_0x40fc11[_0x6681('0x2')]||'';this['remoteUri']=_0x40fc11[_0x6681('0x3')]||'';this['serverUrl']=_0x40fc11['serverUrl']||'';this['Configurations']=_0x40fc11[_0x6681('0x4')]||{};}module[_0x6681('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 30c58f8..38e8e94 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 _0xdc67=['authType','type','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x30aedd,_0x3e8876){var _0x1d6ec5=function(_0x2bf629){while(--_0x2bf629){_0x30aedd['push'](_0x30aedd['shift']());}};_0x1d6ec5(++_0x3e8876);}(_0xdc67,0xa5));var _0x7dc6=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0xdc67[_0x5ff517];return _0x19a245;};'use strict';function ZendeskAccount(_0x57f4cb){this['id']=_0x57f4cb['id']||0x0;this['name']=_0x57f4cb[_0x7dc6('0x0')]||'';this[_0x7dc6('0x1')]=_0x57f4cb['username']||'';this[_0x7dc6('0x2')]=_0x57f4cb[_0x7dc6('0x2')]||'';this['token']=_0x57f4cb[_0x7dc6('0x3')]||'';this[_0x7dc6('0x4')]=_0x57f4cb[_0x7dc6('0x4')]||'';this[_0x7dc6('0x5')]=_0x57f4cb[_0x7dc6('0x5')]||'';this['type']=_0x57f4cb[_0x7dc6('0x6')]||'integrationTab';this[_0x7dc6('0x7')]=_0x57f4cb[_0x7dc6('0x7')]||'';this[_0x7dc6('0x8')]=_0x57f4cb['Configurations']||{};}module[_0x7dc6('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xaf14=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x207c43,_0xee63e1){var _0xbbcf33=function(_0x2dd3f3){while(--_0x2dd3f3){_0x207c43['push'](_0x207c43['shift']());}};_0xbbcf33(++_0xee63e1);}(_0xaf14,0x99));var _0x4af1=function(_0x13ac22,_0x4b4a36){_0x13ac22=_0x13ac22-0x0;var _0x2248af=_0xaf14[_0x13ac22];return _0x2248af;};'use strict';function ZendeskAccount(_0x251805){this['id']=_0x251805['id']||0x0;this[_0x4af1('0x0')]=_0x251805[_0x4af1('0x0')]||'';this[_0x4af1('0x1')]=_0x251805['username']||'';this[_0x4af1('0x2')]=_0x251805[_0x4af1('0x2')]||'';this[_0x4af1('0x3')]=_0x251805[_0x4af1('0x3')]||'';this[_0x4af1('0x4')]=_0x251805[_0x4af1('0x4')]||'';this[_0x4af1('0x5')]=_0x251805[_0x4af1('0x5')]||'';this[_0x4af1('0x6')]=_0x251805[_0x4af1('0x6')]||_0x4af1('0x7');this[_0x4af1('0x8')]=_0x251805[_0x4af1('0x8')]||'';this[_0x4af1('0x9')]=_0x251805[_0x4af1('0x9')]||{};}module[_0x4af1('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 c7baede..5d52f50 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 _0x3434=['serverUrl','code','refreshToken','Configurations','name','host','zone','clientId','clientSecret'];(function(_0x53f715,_0x52587b){var _0x16c757=function(_0x5cc9bf){while(--_0x5cc9bf){_0x53f715['push'](_0x53f715['shift']());}};_0x16c757(++_0x52587b);}(_0x3434,0x109));var _0x4343=function(_0x5cf5b0,_0x4073bb){_0x5cf5b0=_0x5cf5b0-0x0;var _0x10f862=_0x3434[_0x5cf5b0];return _0x10f862;};'use strict';function ZohoAccount(_0x2271c8){this['id']=_0x2271c8['id']||0x0;this[_0x4343('0x0')]=_0x2271c8[_0x4343('0x0')]||'';this['description']=_0x2271c8['description']||'';this['host']=_0x2271c8[_0x4343('0x1')]||'';this['zone']=_0x2271c8[_0x4343('0x2')]||'';this[_0x4343('0x3')]=_0x2271c8['clientId']||'';this['clientSecret']=_0x2271c8[_0x4343('0x4')]||'';this['serverUrl']=_0x2271c8[_0x4343('0x5')]||'';this[_0x4343('0x6')]=_0x2271c8[_0x4343('0x6')]||'';this[_0x4343('0x7')]=_0x2271c8[_0x4343('0x7')]||'';this[_0x4343('0x8')]=_0x2271c8[_0x4343('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x0b5c=['Configurations','exports','name','host','serverUrl','code','refreshToken'];(function(_0x4c8da9,_0x3b8d97){var _0x1c6c92=function(_0xb9b9c4){while(--_0xb9b9c4){_0x4c8da9['push'](_0x4c8da9['shift']());}};_0x1c6c92(++_0x3b8d97);}(_0x0b5c,0xc6));var _0xc0b5=function(_0x17c1e9,_0x1c5e8a){_0x17c1e9=_0x17c1e9-0x0;var _0x26f699=_0x0b5c[_0x17c1e9];return _0x26f699;};'use strict';function ZohoAccount(_0x5d4c67){this['id']=_0x5d4c67['id']||0x0;this[_0xc0b5('0x0')]=_0x5d4c67[_0xc0b5('0x0')]||'';this['description']=_0x5d4c67['description']||'';this[_0xc0b5('0x1')]=_0x5d4c67[_0xc0b5('0x1')]||'';this['zone']=_0x5d4c67['zone']||'';this['clientId']=_0x5d4c67['clientId']||'';this['clientSecret']=_0x5d4c67['clientSecret']||'';this[_0xc0b5('0x2')]=_0x5d4c67[_0xc0b5('0x2')]||'';this[_0xc0b5('0x3')]=_0x5d4c67[_0xc0b5('0x3')]||'';this[_0xc0b5('0x4')]=_0x5d4c67[_0xc0b5('0x4')]||'';this[_0xc0b5('0x5')]=_0x5d4c67[_0xc0b5('0x5')]||{};}module[_0xc0b5('0x6')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 027d194..13fb03d 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 _0x287a=['membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer'];(function(_0x21ccf9,_0x4def5e){var _0x31c14c=function(_0x329fe4){while(--_0x329fe4){_0x21ccf9['push'](_0x21ccf9['shift']());}};_0x31c14c(++_0x4def5e);}(_0x287a,0x1b7));var _0xa287=function(_0x22a021,_0x2dd8cc){_0x22a021=_0x22a021-0x0;var _0x38f6d7=_0x287a[_0x22a021];return _0x38f6d7;};'use strict';var util=require(_0xa287('0x0'));var _=require(_0xa287('0x1'));var moment=require(_0xa287('0x2'));function checkNameSurname(_0x20cfe5,_0x2474a1,_0x318091){var _0x191177='';if(!_[_0xa287('0x3')](_0x2474a1)&&'string'===typeof _0x2474a1){_0x191177+=_0x2474a1;}if(!_[_0xa287('0x3')](_0x318091)&&_0xa287('0x4')===typeof _0x318091){_0x191177+='\x20'+_0x318091;}if(_0x191177!==''){return _0x191177;}return _0x20cfe5;}function Action(_0x5432ff,_0x2af677,_0xf3383f,_0x517a30,_0x124a07){this['uniqueid']=_0xf3383f||undefined;this[_0xa287('0x5')]=_0x5432ff['id'];this[_0xa287('0x6')]=_0x2af677[_0xa287('0x7')];this[_0xa287('0x8')]=_0x2af677['type'];this[_0xa287('0x9')]=_0xa287('0x6');this[_0xa287('0xa')]=![];this[_0xa287('0xb')]=_[_0xa287('0x3')](_0x5432ff[_0xa287('0xc')])?undefined:_0x5432ff['Agent'][_0xa287('0x7')];this[_0xa287('0xd')]=this[_0xa287('0xb')]?util[_0xa287('0xe')]('SIP/%s',this[_0xa287('0xb')]):_0x517a30||undefined;this[_0xa287('0xf')]=checkNameSurname(_0x5432ff[_0xa287('0x10')][_0xa287('0x11')],_0x5432ff[_0xa287('0x10')][_0xa287('0x12')],_0x5432ff[_0xa287('0x10')][_0xa287('0x13')]);this[_0xa287('0x14')]=_0x5432ff[_0xa287('0x14')]||![];this[_0xa287('0x15')]=_0x5432ff[_0xa287('0x10')][_0xa287('0x11')];this[_0xa287('0x16')]=_0x5432ff[_0xa287('0x16')];this[_0xa287('0x17')]=_0x5432ff[_0xa287('0x17')]||0x0;this[_0xa287('0x18')]=_0x5432ff[_0xa287('0x18')]||0x0;this[_0xa287('0x19')]=_0x5432ff['countnoanswerretry']||0x0;this['countglobal']=(_0x5432ff[_0xa287('0x17')]||0x0)+(_0x5432ff[_0xa287('0x18')]||0x0)+(_0x5432ff[_0xa287('0x19')]||0x0)+(_0x5432ff[_0xa287('0x1a')]||0x0)+(_0x5432ff[_0xa287('0x1b')]||0x0)+(_0x5432ff[_0xa287('0x1c')]||0x0)+(_0x5432ff[_0xa287('0x1d')]||0x0)+(_0x5432ff[_0xa287('0x1e')]||0x0);this[_0xa287('0x1a')]=_0x5432ff[_0xa287('0x1a')]||0x0;this['countdropretry']=_0x5432ff['countdropretry']||0x0;this['countabandonedretry']=_0x5432ff[_0xa287('0x1c')]||0x0;this[_0xa287('0x1d')]=_0x5432ff[_0xa287('0x1d')]||0x0;this[_0xa287('0x1e')]=_0x5432ff[_0xa287('0x1e')]||0x0;this[_0xa287('0x1f')]=_0x5432ff[_0xa287('0x1f')];this[_0xa287('0x20')]=_0x5432ff['callbackuniqueid'];this[_0xa287('0x21')]=_0x5432ff['callbackat'];this[_0xa287('0x22')]=_0x5432ff[_0xa287('0x22')];this[_0xa287('0x23')]=_0x5432ff['ContactId'];this[_0xa287('0x24')]=_0x5432ff['ListId'];this['UserId']=_[_0xa287('0x3')](_0x5432ff[_0xa287('0xc')])?_0x5432ff['UserId']:_0x5432ff[_0xa287('0xc')]['id'];this[_0xa287('0x25')]=_0x5432ff[_0xa287('0x25')];this[_0xa287('0x26')]='';this[_0xa287('0x27')]='';}Action[_0xa287('0x28')][_0xa287('0x29')]=function(){return util['format'](_0xa287('0x2a'),this[_0xa287('0xf')],this[_0xa287('0x2b')]);};module[_0xa287('0x2c')]=Action; \ No newline at end of file +var _0x850a=['type','campaigntype','dialAnswer','membername','isNil','Agent','channelAgent','SIP/%s','calleridname','Contact','firstName','lastName','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','format','number','util','lodash','moment','string','uniqueid','idContact','queue','name'];(function(_0x45b62d,_0x30833a){var _0x28a68f=function(_0x5d7d58){while(--_0x5d7d58){_0x45b62d['push'](_0x45b62d['shift']());}};_0x28a68f(++_0x30833a);}(_0x850a,0x148));var _0xa850=function(_0x2cbec0,_0x262fef){_0x2cbec0=_0x2cbec0-0x0;var _0x3d4101=_0x850a[_0x2cbec0];return _0x3d4101;};'use strict';var util=require(_0xa850('0x0'));var _=require(_0xa850('0x1'));var moment=require(_0xa850('0x2'));function checkNameSurname(_0x99c385,_0x481107,_0x29a79a){var _0x72e695='';if(!_['isNil'](_0x481107)&&_0xa850('0x3')===typeof _0x481107){_0x72e695+=_0x481107;}if(!_['isNil'](_0x29a79a)&&'string'===typeof _0x29a79a){_0x72e695+='\x20'+_0x29a79a;}if(_0x72e695!==''){return _0x72e695;}return _0x99c385;}function Action(_0x4740e0,_0x5eea58,_0x48241f,_0x117388,_0x34b4db){this[_0xa850('0x4')]=_0x48241f||undefined;this[_0xa850('0x5')]=_0x4740e0['id'];this[_0xa850('0x6')]=_0x5eea58[_0xa850('0x7')];this[_0xa850('0x8')]=_0x5eea58['type'];this[_0xa850('0x9')]='queue';this[_0xa850('0xa')]=![];this[_0xa850('0xb')]=_[_0xa850('0xc')](_0x4740e0[_0xa850('0xd')])?undefined:_0x4740e0[_0xa850('0xd')][_0xa850('0x7')];this[_0xa850('0xe')]=this[_0xa850('0xb')]?util['format'](_0xa850('0xf'),this['membername']):_0x117388||undefined;this[_0xa850('0x10')]=checkNameSurname(_0x4740e0['Contact']['phone'],_0x4740e0[_0xa850('0x11')][_0xa850('0x12')],_0x4740e0['Contact'][_0xa850('0x13')]);this['active']=_0x4740e0['active']||![];this[_0xa850('0x14')]=_0x4740e0[_0xa850('0x11')]['phone'];this[_0xa850('0x15')]=_0x4740e0[_0xa850('0x15')];this['countbusyretry']=_0x4740e0[_0xa850('0x16')]||0x0;this[_0xa850('0x17')]=_0x4740e0[_0xa850('0x17')]||0x0;this['countnoanswerretry']=_0x4740e0[_0xa850('0x18')]||0x0;this['countglobal']=(_0x4740e0[_0xa850('0x16')]||0x0)+(_0x4740e0[_0xa850('0x17')]||0x0)+(_0x4740e0['countnoanswerretry']||0x0)+(_0x4740e0['countnosuchnumberretry']||0x0)+(_0x4740e0[_0xa850('0x19')]||0x0)+(_0x4740e0[_0xa850('0x1a')]||0x0)+(_0x4740e0['countmachineretry']||0x0)+(_0x4740e0[_0xa850('0x1b')]||0x0);this[_0xa850('0x1c')]=_0x4740e0[_0xa850('0x1c')]||0x0;this['countdropretry']=_0x4740e0['countdropretry']||0x0;this[_0xa850('0x1a')]=_0x4740e0['countabandonedretry']||0x0;this[_0xa850('0x1d')]=_0x4740e0[_0xa850('0x1d')]||0x0;this[_0xa850('0x1b')]=_0x4740e0['countagentrejectretry']||0x0;this[_0xa850('0x1e')]=_0x4740e0['callback'];this['callbackuniqueid']=_0x4740e0[_0xa850('0x1f')];this['callbackat']=_0x4740e0[_0xa850('0x20')];this[_0xa850('0x21')]=_0x4740e0[_0xa850('0x21')];this[_0xa850('0x22')]=_0x4740e0[_0xa850('0x22')];this[_0xa850('0x23')]=_0x4740e0[_0xa850('0x23')];this[_0xa850('0x24')]=_['isNil'](_0x4740e0[_0xa850('0xd')])?_0x4740e0[_0xa850('0x24')]:_0x4740e0[_0xa850('0xd')]['id'];this[_0xa850('0x25')]=_0x4740e0['VoiceQueueId'];this['originatecalleridnum']='';this[_0xa850('0x26')]='';}Action['prototype'][_0xa850('0x27')]=function(){return util[_0xa850('0x28')]('\x22%s\x22\x20<%s>',this[_0xa850('0x10')],this[_0xa850('0x29')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index c7fa81d..fa3a512 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 _0x1916=['[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','NoSuchNumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','totalGlobal','Answer','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','countbusyretry','countglobal','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','cloneAction','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','logAgent','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','run','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','toLowerVariables','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','lookAgent','logLookAgent','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','isUndefined','callProgressDetectingAgent','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','inspect','syncAttendedTransfer','transfertargetlinkedid','transfer','syncBlindTransfer','transfererlinkedid','util','lodash','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','redis','localhost','prototype','enqueue','tail','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','attendedtransfer','blindtransfer','loopCampaigns','type','outbound','name','answered','available','loggedIn','sumBillable','sumDuration','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emit','sendMessageOneNotActive','pTalking','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','logger','syncCampaigns','campaignsPreview','hasOwnProperty','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','[RecallMe]','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]'];(function(_0x59721d,_0x1b1bf7){var _0x3bc7eb=function(_0x2cfa1a){while(--_0x2cfa1a){_0x59721d['push'](_0x59721d['shift']());}};_0x3bc7eb(++_0x1b1bf7);}(_0x1916,0xc6));var _0x6191=function(_0x3c2dd9,_0x57be2f){_0x3c2dd9=_0x3c2dd9-0x0;var _0x23d25f=_0x1916[_0x3c2dd9];return _0x23d25f;};'use strict';var util=require(_0x6191('0x0'));var _=require(_0x6191('0x1'));var BPromise=require('bluebird');var uuid=require(_0x6191('0x2'));var moment=require(_0x6191('0x3'));var md5=require(_0x6191('0x4'));var Redis=require(_0x6191('0x5'));var config=require(_0x6191('0x6'));var logger=require(_0x6191('0x7'))(_0x6191('0x8'));var loggerAction=require(_0x6191('0x7'))(_0x6191('0x9'));var ami=require(_0x6191('0xa'));var rpcDb=require(_0x6191('0xb'));var Action=require(_0x6191('0xc'));var ut=require(_0x6191('0xd'));config['redis']=_[_0x6191('0xe')](config[_0x6191('0xf')],{'host':_0x6191('0x10'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x6191('0x11')][_0x6191('0x12')]=function(_0x1c9554){this['tail']=this['tail']?this[_0x6191('0x13')]['finally'](_0x1c9554):_0x1c9554();};function Preview(_0x15c989){this['sequence']=new Sequence();this['campaignsPreview']=_0x15c989[_0x6191('0x14')];this[_0x6191('0x15')]=_0x15c989[_0x6191('0x15')];this[_0x6191('0x16')]={};this[_0x6191('0x17')]=_0x15c989[_0x6191('0x17')];this[_0x6191('0x18')]=0x0;ami['on'](_0x6191('0x19'),this['syncOriginateResponse'][_0x6191('0x1a')](this));ami['on'](_0x6191('0x1b'),this['syncHangup']['bind'](this));ami['on']('hanguprequest',this[_0x6191('0x1c')][_0x6191('0x1a')](this));ami['on'](_0x6191('0x1d'),this[_0x6191('0x1e')]['bind'](this));ami['on']('newexten',this[_0x6191('0x1f')][_0x6191('0x1a')](this));ami['on'](_0x6191('0x20'),this['syncVarSet'][_0x6191('0x1a')](this));ami['on'](_0x6191('0x21'),this['syncAttendedTransfer'][_0x6191('0x1a')](this));ami['on'](_0x6191('0x22'),this['syncBlindTransfer'][_0x6191('0x1a')](this));this[_0x6191('0x23')](this['campaignsPreview']);}function emit(_0x5389ef,_0x2b867a,_0x398cb2){io['to'](_0x5389ef)['emit'](_0x2b867a,_0x398cb2);}function emitCampaignPreview(_0x368e53){if(_0x368e53[_0x6191('0x24')]===_0x6191('0x25')){var _0x2d4ecd={'id':_0x368e53['id'],'name':_0x368e53[_0x6191('0x26')],'strategy':_0x368e53['strategy'],'answered':_0x368e53[_0x6191('0x27')],'available':_0x368e53[_0x6191('0x28')],'loggedIn':_0x368e53[_0x6191('0x29')],'pTalking':_0x368e53['pTalking'],'sumBillable':_0x368e53[_0x6191('0x2a')],'sumDuration':_0x368e53[_0x6191('0x2b')],'sumHoldTime':_0x368e53['sumHoldTime']||0x0,'talking':_0x368e53['talking'],'total':_0x368e53[_0x6191('0x2c')],'type':_0x368e53[_0x6191('0x24')],'unmanaged':_0x368e53[_0x6191('0x2d')],'abandoned':_0x368e53['abandoned'],'waiting':_0x368e53[_0x6191('0x2e')],'loggedInDb':_0x368e53[_0x6191('0x2f')],'dialActive':_0x368e53[_0x6191('0x30')],'dialMethod':_0x368e53[_0x6191('0x31')],'dialOriginateCallerIdName':_0x368e53[_0x6191('0x32')],'dialOriginateCallerIdNumber':_0x368e53[_0x6191('0x33')],'dialOriginateTimeout':_0x368e53['dialOriginateTimeout'],'dialPrefix':_0x368e53[_0x6191('0x34')],'outboundAnswerAgiCallsDay':_0x368e53[_0x6191('0x35')],'outboundAnswerCallsDay':_0x368e53[_0x6191('0x36')],'outboundBlacklistCallsDay':_0x368e53['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x368e53[_0x6191('0x37')],'outboundCongestionCallsDay':_0x368e53[_0x6191('0x38')],'outboundDropCallsDayACS':_0x368e53[_0x6191('0x39')],'outboundDropCallsDayCallersExit':_0x368e53[_0x6191('0x3a')],'outboundDropCallsDayTimeout':_0x368e53[_0x6191('0x3b')],'outboundNoAnswerCallsDay':_0x368e53[_0x6191('0x3c')],'outboundNoSuchCallsDay':_0x368e53['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x368e53[_0x6191('0x3d')],'outboundReCallsDay':_0x368e53[_0x6191('0x3e')],'outboundRejectCallsDay':_0x368e53[_0x6191('0x3f')],'outboundUnknownCallsDay':_0x368e53[_0x6191('0x40')],'outboundAbandonedCallsDay':_0x368e53[_0x6191('0x41')],'predictiveIntervalAnsweredCalls':_0x368e53['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x368e53[_0x6191('0x42')],'predictiveIntervalAvgTalktime':_0x368e53[_0x6191('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x368e53[_0x6191('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x368e53[_0x6191('0x45')],'predictiveIntervalErlangCalls':_0x368e53[_0x6191('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x368e53['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x368e53['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x368e53[_0x6191('0x47')],'predictiveIntervalPauses':_0x368e53[_0x6191('0x48')],'predictiveIntervalAvailable':_0x368e53[_0x6191('0x49')],'predictiveIntervalTotalCalls':_0x368e53[_0x6191('0x4a')],'message':_0x368e53[_0x6191('0x4b')],'originated':_0x368e53[_0x6191('0x4c')],'erlangCalls':_0x368e53['erlangCalls'],'erlangCallToSecond':_0x368e53[_0x6191('0x4d')],'erlangAbandonmentRate':_0x368e53[_0x6191('0x4e')],'erlangBusyFactor':_0x368e53['erlangBusyFactor'],'startPredictive':_0x368e53[_0x6191('0x4f')],'startProgressive':_0x368e53[_0x6191('0x50')]};if(_0x368e53['Trunk']){_0x2d4ecd[_0x6191('0x51')]={'id':_0x368e53[_0x6191('0x51')]['id'],'name':_0x368e53['Trunk'][_0x6191('0x26')],'active':_0x368e53['Trunk'][_0x6191('0x52')],'callerid':_0x368e53[_0x6191('0x51')][_0x6191('0x53')]};}if(_0x368e53[_0x6191('0x54')]){_0x2d4ecd[_0x6191('0x54')]={'id':_0x368e53[_0x6191('0x54')]['id'],'name':_0x368e53['Interval'][_0x6191('0x26')]};}var _0x3612b4=md5(JSON[_0x6191('0x55')](_0x2d4ecd));if(_0x368e53[_0x6191('0x4')]!==_0x3612b4){_0x368e53[_0x6191('0x4')]=_0x3612b4;emit(util[_0x6191('0x56')]('voice:queue:%s',_0x2d4ecd[_0x6191('0x26')]),_0x6191('0x57'),_0x2d4ecd);}}}function emitVoiceQueueChannelRemove(_0x2f72a6){logger[_0x6191('0x58')](_0x6191('0x59'),JSON[_0x6191('0x55')](_0x2f72a6));emit(util[_0x6191('0x56')]('voice:queue:%s',_0x2f72a6[_0x6191('0x26')]),_0x6191('0x5a'),_0x2f72a6);io[_0x6191('0x5b')]('voice_queue_presence:remove',_0x2f72a6);}function notSendMessagesQueue(_0x4daa2b){if(_0x4daa2b[_0x6191('0x5c')]){if(_0x4daa2b[_0x6191('0x4c')]===0x0&&_0x4daa2b[_0x6191('0x5d')]===0x0){_0x4daa2b[_0x6191('0x5c')]=![];_0x4daa2b[_0x6191('0x28')]=0x0;_0x4daa2b['paused']=0x0;_0x4daa2b[_0x6191('0x4b')]=_0x6191('0x5e');ut['logger'](_0x6191('0x5f'),_0x4daa2b[_0x6191('0x26')]+_0x6191('0x60'));}else{_0x4daa2b[_0x6191('0x4b')]='IS_DISACTIVED';ut[_0x6191('0x61')](_0x6191('0x5f'),_0x4daa2b[_0x6191('0x26')]+'\x20is\x20disactive');}emitCampaignPreview(_0x4daa2b);}}Preview[_0x6191('0x11')][_0x6191('0x23')]=function(){var _0x50e320=this;setInterval(function(){_0x50e320[_0x6191('0x62')]();},0x7cf);};Preview['prototype'][_0x6191('0x62')]=function(){var _0x563c1f=this[_0x6191('0x63')];this[_0x6191('0x18')]+=0x1;for(var _0x319ab9 in _0x563c1f){if(_0x563c1f[_0x6191('0x64')](_0x319ab9)&&(_0x563c1f[_0x319ab9]['dialMethod']===_0x6191('0x8')||_0x563c1f[_0x319ab9][_0x6191('0x31')]==='booked')&&_0x563c1f[_0x319ab9][_0x6191('0x24')]===_0x6191('0x25')){if(this[_0x6191('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x563c1f[_0x6191('0x64')](_0x319ab9)&&_0x563c1f[_0x319ab9][_0x6191('0x31')]===_0x6191('0x8')&&_0x563c1f[_0x319ab9][_0x6191('0x24')]==='outbound'){if(_0x563c1f[_0x319ab9][_0x6191('0x30')]){this['setMessage'](_0x563c1f[_0x319ab9]);this['recallMe'](_0x563c1f[_0x319ab9]);}else{notSendMessagesQueue(_0x563c1f[_0x319ab9]);}}}};Preview[_0x6191('0x11')][_0x6191('0x65')]=function(_0x248816){var _0xa4e8c8=this;this[_0x6191('0x66')]['enqueue'](function(){if(!_[_0x6191('0x67')](_0xa4e8c8[_0x6191('0x16')][_0x248816])){loggerAction['info'](_0x6191('0x68'),_0x248816,_0x6191('0x69'),_0xa4e8c8['actions'][_0x248816][_0x6191('0x6a')],_0x6191('0x6b'),JSON[_0x6191('0x55')](_0xa4e8c8['campaignsPreview'][_0xa4e8c8['actions'][_0x248816][_0x6191('0x6a')]][_0x6191('0x4c')]),_0x6191('0x6c'),JSON['stringify'](_0xa4e8c8['campaignsPreview'][_0xa4e8c8[_0x6191('0x16')][_0x248816]['queue']][_0x6191('0x5d')]),JSON[_0x6191('0x55')](_0xa4e8c8[_0x6191('0x16')][_0x248816][_0x6191('0x6d')]),JSON['stringify'](_[_0x6191('0x6e')](_0xa4e8c8[_0x6191('0x16')][_0x248816],[_0x6191('0x6f'),'UserId',_0x6191('0x70'),_0x6191('0x71')])));return ami[_0x6191('0x72')]({'action':_0x6191('0x73'),'channel':_0xa4e8c8[_0x6191('0x16')][_0x248816][_0x6191('0x74')]})[_0x6191('0x75')](function(_0x3c4b45){if(_0x3c4b45[_0x6191('0x4b')]===_0x6191('0x76')){setTimeout(function(){if(_0xa4e8c8[_0x6191('0x16')][_0x248816]){ut[_0x6191('0x77')](_0xa4e8c8['campaignsPreview'][_0xa4e8c8[_0x6191('0x16')][_0x248816][_0x6191('0x6a')]],'[clearZombieChannel]');if(_0xa4e8c8[_0x6191('0x16')][_0x248816][_0x6191('0x6d')]===!![]){ut[_0x6191('0x78')](_0xa4e8c8[_0x6191('0x63')][_0xa4e8c8[_0x6191('0x16')][_0x248816][_0x6191('0x6a')]],_0x6191('0x79'));ut['loggerError'](_0x6191('0x7a')+_0x248816,_0xa4e8c8[_0x6191('0x16')][_0x248816][_0x6191('0x6a')]);}ut['loggerError'](_0x6191('0x7b')+_0x248816,_0xa4e8c8[_0x6191('0x16')][_0x248816][_0x6191('0x6a')]);delete _0xa4e8c8[_0x6191('0x16')][_0x248816];}},0x2328);}});}});};Preview[_0x6191('0x11')][_0x6191('0x7c')]=function(){var _0xd65e73=this;loggerAction[_0x6191('0x58')]('[action]',_[_0x6191('0x7d')](this[_0x6191('0x16')]));for(var _0x43cebf in this[_0x6191('0x16')]){if(_0xd65e73[_0x6191('0x16')][_0x6191('0x64')](_0x43cebf)){_0xd65e73['clearZombieChannel'](_0x43cebf);}}};Preview[_0x6191('0x11')]['recallMe']=function(_0x95b61){var _0x52fcbf=this;rpcDb['getContactRecallMe'](_0x95b61['id'],ut[_0x6191('0x7e')](this[_0x6191('0x17')]))[_0x6191('0x7f')](function(_0x1b1da7){if(!_[_0x6191('0x67')](_0x1b1da7)){for(var _0x3aa832=0x0;_0x3aa832<_0x1b1da7['length'];_0x3aa832+=0x1){if(ut[_0x6191('0x80')](_0x1b1da7[_0x3aa832][_0x6191('0x81')])<_0x95b61[_0x6191('0x82')]*0x3c){if(_0x1b1da7[_0x3aa832][_0x6191('0x83')]&&!_0x1b1da7[_0x3aa832][_0x6191('0x83')][_0x6191('0x84')]){_0x52fcbf['run'](_0x1b1da7[_0x3aa832]['id'])[_0x6191('0x7f')](ut['logger2'](_0x6191('0x85')))[_0x6191('0x75')](ut[_0x6191('0x86')](_0x6191('0x85')));}else{rpcDb[_0x6191('0x87')](_0x1b1da7[_0x3aa832]['id']);}}else{var _0x10841f=new Action(_0x1b1da7[_0x3aa832],_0x95b61);_0x10841f[_0x6191('0x88')]=moment()['format'](_0x6191('0x89'));_0x95b61[_0x6191('0x3e')]+=0x1;ut[_0x6191('0x8a')](_0x10841f,0x17,'RecallInQueue');if(_0x95b61[_0x6191('0x8b')]){rpcDb['rescheduleContactInQueue'](ut[_0x6191('0x8c')](_0x1b1da7[_0x3aa832]));rpcDb[_0x6191('0x8d')](_0x10841f,_0x6191('0x8e'));}else{ut[_0x6191('0x8a')](_0x10841f,0x16,'RecallFailedTimeout');rpcDb[_0x6191('0x8d')](_0x10841f,_0x6191('0x8f'));rpcDb[_0x6191('0x90')](_0x10841f,_0x6191('0x8f'));}}}}})[_0x6191('0x75')](ut[_0x6191('0x86')](_0x6191('0x91')));};Preview[_0x6191('0x11')]['setMessage']=function(_0x1540b6){_0x1540b6['sendMessageOneNotActive']=!![];if(ut[_0x6191('0x92')](_0x1540b6[_0x6191('0x29')])){_0x1540b6[_0x6191('0x4b')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x6191('0x93')](_0x1540b6[_0x6191('0x30')])){_0x1540b6[_0x6191('0x4b')]=_0x6191('0x5e');}else if(!this[_0x6191('0x94')](_0x1540b6['Trunk'])){if(!this[_0x6191('0x94')](_0x1540b6[_0x6191('0x95')])){_0x1540b6[_0x6191('0x4b')]=_0x6191('0x96');}else{_0x1540b6[_0x6191('0x4b')]='ACTIVE';}}else{_0x1540b6['message']=_0x6191('0x97');}emitCampaignPreview(_0x1540b6);};Preview['prototype'][_0x6191('0x98')]=function(_0x3cf360,_0x76bea9,_0x4ef1e1){var _0x128634=this;var _0x282d35=this[_0x6191('0x16')][_0x76bea9];var _0x561a04=this[_0x6191('0x63')][_0x282d35['queue']];var _0xec59a9;if(_0x561a04){switch(_0x4ef1e1){case'1':_0x561a04[_0x6191('0x99')]+=0x1;_0x282d35[_0x6191('0x9a')]+=0x1;_0x282d35['countglobal']=ut['totalGlobal'](_0x282d35);ut[_0x6191('0x8a')](_0x282d35,0x0,_0x6191('0x9b'));ami['emit']('custom:agentnosuchnumber',ut[_0x6191('0x9c')](_0x282d35,'nosuchnumber'));rpcDb[_0x6191('0x8d')](_0x282d35,_0x6191('0x9d'));if(ut['totalGlobal'](_0x282d35)>=_0x561a04['dialGlobalMaxRetry']){_0xec59a9=ut['cloneAction'](_0x282d35,0xf,_0x6191('0x9e'));rpcDb['createCustomerFinal'](_0xec59a9,_0x6191('0x9f'));}else{if(_0x282d35['countnosuchnumberretry']>=_0x561a04[_0x6191('0xa0')]){rpcDb[_0x6191('0x90')](_0x282d35,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x6191('0xa1')](ut[_0x6191('0xa2')](_0x282d35,'countnosuchnumberretry',_0x561a04[_0x6191('0xa3')]),_0x282d35[_0x6191('0xa4')],_0x282d35[_0x6191('0xa5')]);}}delete this[_0x6191('0x16')][_0x3cf360[_0x6191('0xa6')]];break;case _0x6191('0xa7'):var _0x4fc612=moment()[_0x6191('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x282d35[_0x6191('0xa8')]=_0x4fc612;_0x282d35[_0x6191('0xa9')]=_0x4fc612;_0x282d35[_0x6191('0x6d')]=!![];_0x561a04[_0x6191('0x5d')]+=0x1;logger[_0x6191('0x58')]('[syncHangup][talking][increment]',_0x282d35['uniqueid'],_0x6191('0xaa'),_0x561a04[_0x6191('0x26')],'pTalking:\x20',_0x561a04[_0x6191('0x5d')]);ami[_0x6191('0x5b')](_0x6191('0xab'),ut[_0x6191('0x9c')](_0x282d35,_0x6191('0xac'),this[_0x6191('0x63')][_0x282d35['queue']]));if(_0x561a04[_0x6191('0xad')]){ami[_0x6191('0x5b')](_0x6191('0xae'),ut[_0x6191('0xaf')](_0x282d35));}break;case'16':ami[_0x6191('0x5b')](_0x6191('0xb0'),ut[_0x6191('0x9c')](_0x282d35,_0x6191('0xb1'),this[_0x6191('0x63')][_0x282d35['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x282d35,_0x6191('0xb1')));_0x561a04[_0x6191('0x36')]+=0x1;_0x561a04[_0x6191('0x2c')]+=0x1;_0x561a04['answered']+=0x1;ut[_0x6191('0x78')](_0x561a04,_0x6191('0xb2'));_0x282d35['countglobal']=ut[_0x6191('0xb3')](_0x282d35);ut[_0x6191('0x8a')](_0x282d35,0x4,_0x6191('0xb4'));rpcDb[_0x6191('0x8d')](_0x282d35,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x6191('0x90')](_0x282d35,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x6191('0xb5')](_0x282d35);_0x561a04[_0x6191('0x2b')]+=_0x282d35[_0x6191('0xb6')];_0x561a04[_0x6191('0x2a')]+=_0x282d35[_0x6191('0xb6')];logger[_0x6191('0x58')](_0x6191('0xb7'),_0x282d35[_0x6191('0xb8')],_0x6191('0xaa'),_0x561a04[_0x6191('0x26')],'pTalking:\x20',_0x561a04[_0x6191('0x5d')]);delete this[_0x6191('0x16')][_0x3cf360[_0x6191('0xa6')]];break;case _0x6191('0xb9'):_0x561a04[_0x6191('0x37')]+=0x1;_0x282d35[_0x6191('0xba')]+=0x1;_0x282d35[_0x6191('0xbb')]=ut['totalGlobal'](_0x282d35);ut[_0x6191('0x8a')](_0x282d35,0x5,'Busy');ami[_0x6191('0x5b')](_0x6191('0xbc'),ut[_0x6191('0x9c')](_0x282d35,_0x6191('0xbd')));rpcDb[_0x6191('0x8d')](_0x282d35,_0x6191('0xbe'));if(ut[_0x6191('0xb3')](_0x282d35)>=_0x561a04[_0x6191('0xbf')]){_0xec59a9=ut['cloneAction'](_0x282d35,0xf,_0x6191('0x9e'));rpcDb[_0x6191('0x90')](_0xec59a9,_0x6191('0xc0'));}else{if(_0x282d35[_0x6191('0xba')]>=_0x561a04[_0x6191('0xc1')]){rpcDb['createCustomerFinal'](_0x282d35,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x6191('0xa1')](ut[_0x6191('0xa2')](_0x282d35,_0x6191('0xba'),_0x561a04[_0x6191('0xc2')]),_0x282d35['unlockAgent'],_0x282d35['activeContact']);}}break;case _0x6191('0xc3'):_0x561a04['outboundNoAnswerCallsDay']+=0x1;_0x282d35[_0x6191('0xc4')]+=0x1;_0x282d35[_0x6191('0xbb')]=ut[_0x6191('0xb3')](_0x282d35);ut['logCustomer'](_0x282d35,0x3,'NoAnswer');ami[_0x6191('0x5b')]('custom:agentnoanswer',ut['buildObj'](_0x282d35,_0x6191('0xc5')));rpcDb['createCustomerHistory'](_0x282d35,_0x6191('0xc6'));if(ut[_0x6191('0xb3')](_0x282d35)>=_0x561a04[_0x6191('0xbf')]){_0xec59a9=ut['cloneAction'](_0x282d35,0xf,_0x6191('0x9e'));rpcDb[_0x6191('0x90')](_0xec59a9,_0x6191('0xc7'));}else{if(_0x282d35['countnoanswerretry']>=_0x561a04[_0x6191('0xc8')]){rpcDb[_0x6191('0x90')](_0x282d35,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x6191('0xa1')](ut[_0x6191('0xa2')](_0x282d35,'countnoanswerretry',_0x561a04[_0x6191('0xc9')]),_0x282d35[_0x6191('0xa4')],_0x282d35['activeContact']);}}break;case'CONGESTION':_0x561a04[_0x6191('0x38')]+=0x1;_0x282d35['countcongestionretry']+=0x1;_0x282d35[_0x6191('0xbb')]=ut[_0x6191('0xb3')](_0x282d35);ut['logCustomer'](_0x282d35,0x8,'Congestion');ami[_0x6191('0x5b')](_0x6191('0xca'),ut[_0x6191('0x9c')](_0x282d35,'congestion'));rpcDb[_0x6191('0x8d')](_0x282d35,_0x6191('0xcb'));if(ut[_0x6191('0xb3')](_0x282d35)>=_0x561a04['dialGlobalMaxRetry']){_0xec59a9=ut[_0x6191('0xcc')](_0x282d35,0xf,_0x6191('0x9e'));rpcDb[_0x6191('0x90')](_0xec59a9,_0x6191('0xcd'));}else{if(_0x282d35[_0x6191('0xce')]>=_0x561a04['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x282d35,_0x6191('0xcb'));}else{rpcDb[_0x6191('0xa1')](ut['scheduledAt'](_0x282d35,_0x6191('0xce'),_0x561a04[_0x6191('0xc2')]),_0x282d35[_0x6191('0xa4')],_0x282d35['activeContact']);}}break;case _0x6191('0xcf'):_0x561a04['outboundRejectCallsDay']+=0x1;_0x282d35[_0x6191('0xd0')]+=0x1;_0x282d35[_0x6191('0xbb')]=ut[_0x6191('0xb3')](_0x282d35);ut['logCustomer'](_0x282d35,0x14,_0x6191('0xd1'));ami[_0x6191('0x5b')](_0x6191('0xd2'),ut[_0x6191('0x9c')](_0x282d35,_0x6191('0xd3')));rpcDb[_0x6191('0x8d')](_0x282d35,_0x6191('0xd4'));if(ut[_0x6191('0xb3')](_0x282d35)>=_0x561a04[_0x6191('0xbf')]){_0xec59a9=ut[_0x6191('0xcc')](_0x282d35,0x14,_0x6191('0xd1'));rpcDb[_0x6191('0x90')](_0xec59a9,_0x6191('0xd5'));}else{if(_0x282d35[_0x6191('0xd0')]>=_0x561a04[_0x6191('0xd6')]){rpcDb[_0x6191('0x90')](_0x282d35,_0x6191('0xd5'));}else{rpcDb['rescheduleContact'](ut[_0x6191('0xa2')](_0x282d35,_0x6191('0xd0'),_0x561a04[_0x6191('0xd7')]),_0x282d35[_0x6191('0xa4')],_0x282d35['activeContact']);}}break;case'ABANDONED':_0x561a04[_0x6191('0x41')]+=0x1;_0x282d35[_0x6191('0xd8')]+=0x1;_0x282d35['countglobal']=ut['totalGlobal'](_0x282d35);ut[_0x6191('0x8a')](_0x282d35,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x282d35,_0x6191('0xd9'));if(ut[_0x6191('0xb3')](_0x282d35)>=_0x561a04[_0x6191('0xbf')]){_0xec59a9=ut[_0x6191('0xcc')](_0x282d35,0xf,_0x6191('0x9e'));rpcDb[_0x6191('0x90')](_0xec59a9,_0x6191('0xd9'));}else{if(_0x282d35[_0x6191('0xda')]>=_0x561a04['dialAbandonedMaxRety']){rpcDb[_0x6191('0x90')](_0x282d35,_0x6191('0xd9'));}else{rpcDb[_0x6191('0xa1')](ut['scheduledAt'](_0x282d35,_0x6191('0xd8'),_0x561a04[_0x6191('0xdb')]),_0x282d35['unlockAgent'],_0x282d35[_0x6191('0xa5')]);}}break;case'18':_0x561a04[_0x6191('0x40')]+=0x1;_0x282d35[_0x6191('0xdc')]+=0x1;_0x282d35[_0x6191('0xbb')]=ut[_0x6191('0xb3')](_0x282d35);ut[_0x6191('0x8a')](_0x282d35,0x12,_0x3cf360[_0x6191('0xdd')]||_0x3cf360[_0x6191('0xde')]);ami['emit'](_0x6191('0xdf'),ut[_0x6191('0x9c')](_0x282d35,_0x6191('0xe0')));rpcDb[_0x6191('0x8d')](_0x282d35,_0x6191('0xe1'));if(ut['totalGlobal'](_0x282d35)>=_0x561a04[_0x6191('0xbf')]){_0xec59a9=ut[_0x6191('0xcc')](_0x282d35,0xf,_0x6191('0x9e'));rpcDb['createCustomerFinal'](_0xec59a9,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x6191('0x90')](_0x282d35,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x6191('0x16')][_0x3cf360[_0x6191('0xa6')]];break;case'19':_0x561a04['outboundUnknownCallsDay']+=0x1;_0x282d35['countglobal']=ut[_0x6191('0xb3')](_0x282d35);ut['logCustomer'](_0x282d35,0x13,_0x3cf360[_0x6191('0xdd')]||_0x3cf360['dialstatus']);ami[_0x6191('0x5b')](_0x6191('0xdf'),ut[_0x6191('0x9c')](_0x282d35,'amd'));rpcDb[_0x6191('0x8d')](_0x282d35,_0x6191('0xe2'));if(ut['totalGlobal'](_0x282d35)>=_0x561a04[_0x6191('0xbf')]){_0xec59a9=ut[_0x6191('0xcc')](_0x282d35,0xf,_0x6191('0x9e'));rpcDb[_0x6191('0x90')](_0xec59a9,_0x6191('0xe2'));}else{rpcDb[_0x6191('0x90')](_0x282d35,_0x6191('0xe2'));}delete this[_0x6191('0x16')][_0x3cf360[_0x6191('0xa6')]];break;default:if(_0x282d35[_0x6191('0x6d')]){ut['decrementTalkink'](_0x561a04,_0x6191('0xe3'));ut['loggerError'](_0x6191('0xe4')+_0x561a04[_0x6191('0x26')],_0x3cf360);}_0x561a04[_0x6191('0x40')]+=0x1;_0x282d35[_0x6191('0xbb')]=ut[_0x6191('0xb3')](_0x282d35);ut['logCustomer'](_0x282d35,0xc,_0x3cf360[_0x6191('0xdd')]||_0x3cf360[_0x6191('0xde')]);rpcDb[_0x6191('0x8d')](_0x282d35,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x282d35)>=_0x561a04['dialGlobalMaxRetry']){_0xec59a9=ut['cloneAction'](_0x282d35,0xf,_0x6191('0x9e'));rpcDb[_0x6191('0x90')](_0xec59a9,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x6191('0x90')](_0x282d35,_0x6191('0xe5'));}delete this[_0x6191('0x16')][_0x3cf360[_0x6191('0xa6')]];}if(!(_0x282d35[_0x6191('0x6d')]&&_0x4ef1e1==='16')){ut[_0x6191('0x77')](_0x561a04,_0x6191('0xe6'));logger[_0x6191('0x58')](_0x6191('0xe7'),_0x282d35[_0x6191('0xb8')],_0x6191('0xaa'),_0x561a04[_0x6191('0x26')],_0x6191('0x6b'),_0x561a04[_0x6191('0x4c')]);}if(_0x4ef1e1!==_0x6191('0xa7')){delete this[_0x6191('0x16')][_0x3cf360[_0x6191('0xa6')]];delete this[_0x6191('0x16')][_0x3cf360[_0x6191('0xe8')]];}}};Preview[_0x6191('0x11')]['callProgressDetectingAgent']=function(_0x1d71ce,_0xcda36e,_0x3975fb){if(_['isUndefined'](_0xcda36e)&&_0x6191('0xe9')!==typeof _0xcda36e){return;}if(_['isUndefined'](_0x3975fb)&&'object'!==typeof _0x3975fb){return;}switch(_0x3975fb[_0x6191('0xea')]){case'0':ut['logAgent'](_0x1d71ce,0x0,'NoSuchNumber');rpcDb[_0x6191('0xeb')](_0x1d71ce,_0x6191('0xec'));break;case'3':ut['logAgent'](_0x1d71ce,0x3,_0x6191('0xed'));rpcDb[_0x6191('0xeb')](_0x1d71ce,_0x6191('0xee'));break;case'5':ut[_0x6191('0xef')](_0x1d71ce,0x5,'Busy');rpcDb['createAgentHistory'](_0x1d71ce,_0x6191('0xf0'));break;case'8':ut[_0x6191('0xef')](_0x1d71ce,0x8,_0x6191('0xf1'));rpcDb['createAgentHistory'](_0x1d71ce,_0x6191('0xf2'));break;case'22':ut[_0x6191('0xef')](_0x1d71ce,0x16,_0x6191('0xf3'));rpcDb[_0x6191('0xeb')](_0x1d71ce,_0x6191('0xf4'));break;default:ut['logAgent'](_0x1d71ce,0xc,_0x3975fb[_0x6191('0xea')]);rpcDb[_0x6191('0xeb')](_0x1d71ce,_0x6191('0xf2'));}ut['updateOriginated'](_0xcda36e,'[callProgressDetectingAgent]');logger[_0x6191('0x58')](_0x6191('0xf5'),_0x1d71ce[_0x6191('0xb8')],_0x6191('0xaa'),_0xcda36e[_0x6191('0x26')],'originated:\x20',_0xcda36e[_0x6191('0x4c')]);delete this[_0x6191('0x16')][_0x1d71ce[_0x6191('0xb8')]];};Preview[_0x6191('0x11')][_0x6191('0xf6')]=function(_0x24738b,_0x339ee9,_0x4f8315,_0x481b41,_0x4bac63){var _0x3a63be=this;return new BPromise(function(_0x390b0d,_0x50f0b3){if(_[_0x6191('0x67')](_0x339ee9)||_[_0x6191('0x67')](_0x339ee9[_0x6191('0xf7')])||_[_0x6191('0x67')](_0x339ee9[_0x6191('0xf7')][_0x6191('0xf8')])||_[_0x6191('0x67')](_0x339ee9[_0x6191('0x70')])){_0x50f0b3(ut[_0x6191('0x4b')](_0x6191('0xf9'),_0x481b41,_0x4bac63));return;}var _0x402290=uuid['v4']();var _0x47a10b=_0x3a63be[_0x6191('0x63')][_0x339ee9[_0x6191('0x69')][_0x6191('0x26')]];var _0x4fd0ab=_0x4f8315?_0x3a63be['agents'][_0x4f8315]['id']:undefined;_0x3a63be['actions'][_0x402290]=new Action(_0x339ee9,_0x47a10b,_0x402290,_0x4f8315,_0x4fd0ab);var _0x23ceba=_0x3a63be[_0x6191('0x16')][_0x402290];_0x23ceba[_0x6191('0xa4')]=_0x481b41;_0x23ceba[_0x6191('0xa5')]=_0x4bac63;_0x23ceba['lookAgent']=_0x4f8315;if(_[_0x6191('0xfa')](_0x24738b)){_0x3a63be['execCall'](_0x23ceba,_0x47a10b,_0x339ee9,_0x4f8315)[_0x6191('0x7f')](function(_0x1a3a6b){logger['info']('[Preview][execCall][success]',_0x6191('0xfb')+_0x23ceba[_0x6191('0x6a')]+_0x6191('0xfc')+_0x23ceba[_0x6191('0xfd')],JSON[_0x6191('0x55')](_0x1a3a6b));ami['emit'](_0x6191('0xfe'),ut[_0x6191('0x9c')](_0x23ceba,'called',_0x3a63be['campaignsPreview'][_0x23ceba['queue']]));_0x390b0d(ut[_0x6191('0x4b')]('Calling'));})[_0x6191('0x75')](function(_0x30789a){ut[_0x6191('0x61')](_0x6191('0xff'),_0x30789a);_0x50f0b3(ut[_0x6191('0x4b')](_0x6191('0x100'),_0x481b41,_0x4bac63));});}else{_0x47a10b[_0x6191('0x101')]+=0x1;ut['logBlacklist'](_0x23ceba);rpcDb[_0x6191('0x102')](_0x23ceba,_0x6191('0x103'));delete _0x3a63be[_0x6191('0x16')][_0x402290];_0x50f0b3(ut['message'](_0x6191('0x104'),_0x481b41,_0x4bac63));}});};Preview['prototype'][_0x6191('0x94')]=function(_0x13f9dc){return!_['isNil'](_0x13f9dc)&&!_['isNil'](_0x13f9dc['name'])&&!_[_0x6191('0x67')](_0x13f9dc[_0x6191('0x52')])&&_0x13f9dc[_0x6191('0x52')]&&!_[_0x6191('0x67')](this[_0x6191('0x15')][util[_0x6191('0x56')](_0x6191('0x105'),_0x13f9dc['name'])])&&!_[_0x6191('0x67')](this[_0x6191('0x15')][util['format']('SIP/%s',_0x13f9dc[_0x6191('0x26')])][_0x6191('0x73')])&&(this['trunks'][util['format'](_0x6191('0x105'),_0x13f9dc['name'])][_0x6191('0x73')]==='reachable'||this[_0x6191('0x15')][util[_0x6191('0x56')]('SIP/%s',_0x13f9dc[_0x6191('0x26')])][_0x6191('0x73')]===_0x6191('0x106'));};Preview[_0x6191('0x11')][_0x6191('0x107')]=function(_0x581170,_0x200803){var _0x42eb99=this;return new BPromise(function(_0x47ee27,_0xc48d9b){_0x42eb99[_0x6191('0x108')](_0x581170,_0x200803)['then'](function(_0x56294d){_0x47ee27(_[_0x6191('0x6e')](_0x56294d,[_0x6191('0x4b')]));})[_0x6191('0x75')](function(_0x24aec7){if(_0x24aec7[_0x6191('0x109')]){rpcDb[_0x6191('0x10a')](_0x581170);}if(_0x24aec7[_0x6191('0x52')]){rpcDb['disableContact'](_0x581170);}_0xc48d9b(_[_0x6191('0x6e')](_0x24aec7,['message']));});});};Preview[_0x6191('0x11')]['execRun']=function(_0xb90685,_0x38279f){var _0x3e624f=this;return new BPromise(function(_0x20db7a,_0xdc30f6){var _0x4d5089,_0x12cfb1;rpcDb[_0x6191('0x10b')](_0xb90685)[_0x6191('0x7f')](function(_0x1ea8ed){if(!_[_0x6191('0x67')](_0x1ea8ed[0x0])){_0x12cfb1=_0x1ea8ed[0x0][_0x6191('0x10c')]?![]:!![];_0x4d5089=_0x1ea8ed[0x0][_0x6191('0x10c')]?!![]:![];_0x4d5089=_0x38279f?!![]:_0x4d5089;}var _0x39d371=_0x3e624f[_0x6191('0x10d')](_0x1ea8ed);if(_0x39d371[_0x6191('0x10e')]){rpcDb[_0x6191('0x10f')](_['pick'](_0x1ea8ed[0x0],[_0x6191('0x70'),'Contact.phone']))[_0x6191('0x7f')](function(_0xe05f97){_0x3e624f[_0x6191('0xf6')](_0xe05f97,_0x1ea8ed[0x0],_0x38279f,_0x12cfb1,_0x4d5089)['then'](function(_0x54f151){_0x20db7a(_0x54f151);})[_0x6191('0x75')](function(_0x1a5317){_0xdc30f6(_0x1a5317);});})['catch'](function(_0x1e26f4){ut[_0x6191('0x61')](_0x6191('0x110'),_0x1e26f4);_0xdc30f6(ut[_0x6191('0x4b')]('Call\x20unsuccessful',_0x12cfb1,_0x4d5089));});}else{_0xdc30f6(ut[_0x6191('0x4b')](_0x39d371['message'],_0x12cfb1,_0x4d5089));}})['catch'](function(_0x162c4e){ut['logger'](_0x6191('0x111'),_0x162c4e);_0xdc30f6(ut[_0x6191('0x4b')](_0x6191('0x112'),![],!![]));});});};Preview['prototype'][_0x6191('0x10d')]=function(_0x4ae96f){if(_[_0x6191('0x67')](_0x4ae96f)||_[_0x6191('0xfa')](_0x4ae96f)||!_[_0x6191('0x67')](_0x4ae96f[0x0][_0x6191('0x83')])&&_[_0x6191('0x67')](_0x4ae96f[0x0]['Agent'][_0x6191('0x26')])){ut[_0x6191('0x61')](_0x6191('0x113'),_0x4ae96f);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2fe8b6=this[_0x6191('0x63')][_0x4ae96f[0x0]['Queue'][_0x6191('0x26')]];_0x2fe8b6[_0x6191('0x4b')]=_0x6191('0x97');if(_[_0x6191('0x67')](_0x2fe8b6)){ut[_0x6191('0x61')](_0x6191('0x114'),_0x2fe8b6);return{'isValid':![],'message':_0x6191('0x115')};}if(!this[_0x6191('0x94')](_0x2fe8b6[_0x6191('0x51')])){ut[_0x6191('0x61')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x6191('0x116')+_0x2fe8b6['name']+_0x6191('0x117'));if(!this['isTrunkReachable'](_0x2fe8b6[_0x6191('0x95')])){ut[_0x6191('0x61')](_0x6191('0x118'),_0x2fe8b6[_0x6191('0x26')]+_0x6191('0x119'));return{'isValid':![],'message':_0x6191('0x11a')};}}if(!ut[_0x6191('0x93')](_0x2fe8b6[_0x6191('0x30')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x2fe8b6[_0x6191('0x26')]+_0x6191('0x11b'));return{'isValid':![],'message':_0x6191('0x116')+_0x2fe8b6[_0x6191('0x26')]+_0x6191('0x11b')};}return{'isValid':!![],'message':_0x6191('0x11c')};};Preview[_0x6191('0x11')][_0x6191('0x11d')]=function(_0x129280,_0x34f536,_0x5370dc,_0x3d304a){var _0x164206=this;return new BPromise(function(_0x548a91,_0x1d0135){var _0x53afff=_0x129280['uniqueid'];var _0x312ac0=_0x164206[_0x6191('0x94')](_0x34f536['Trunk'])?util['format'](_0x6191('0x11e'),_0x34f536[_0x6191('0x51')]['name'],_[_0x6191('0x67')](_0x34f536['dialPrefix'])?'':_0x34f536[_0x6191('0x34')][_0x6191('0x11f')]()||'',_0x34f536[_0x6191('0x120')]>0x0?_0x5370dc[_0x6191('0xf7')][_0x6191('0xf8')][_0x6191('0x121')](_0x34f536[_0x6191('0x120')]):_0x5370dc[_0x6191('0xf7')][_0x6191('0xf8')]):util[_0x6191('0x56')](_0x6191('0x11e'),_['isNil'](_0x34f536[_0x6191('0x95')])?_0x34f536[_0x6191('0x51')][_0x6191('0x26')]:_0x34f536[_0x6191('0x95')][_0x6191('0x26')],_[_0x6191('0x67')](_0x34f536[_0x6191('0x34')])?'':_0x34f536[_0x6191('0x34')][_0x6191('0x11f')]()||'',_0x34f536['dialCutDigit']>0x0?_0x5370dc[_0x6191('0xf7')][_0x6191('0xf8')][_0x6191('0x121')](_0x34f536[_0x6191('0x120')]):_0x5370dc['Contact'][_0x6191('0xf8')]);var _0xc0ea1f=_0x164206[_0x6191('0x94')](_0x34f536[_0x6191('0x51')])?ut[_0x6191('0x122')](_0x34f536[_0x6191('0x51')][_0x6191('0x53')],_0x34f536[_0x6191('0x32')],_0x34f536[_0x6191('0x123')]>0x0?ut[_0x6191('0x124')](_0x34f536[_0x6191('0x33')],_0x34f536[_0x6191('0x123')]):_0x34f536[_0x6191('0x33')]):ut[_0x6191('0x122')](_['isNil'](_0x34f536['TrunkBackup'])?_0x34f536[_0x6191('0x51')][_0x6191('0x53')]:_0x34f536[_0x6191('0x95')][_0x6191('0x53')],_0x34f536[_0x6191('0x32')],_0x34f536[_0x6191('0x123')]>0x0?ut[_0x6191('0x124')](_0x34f536[_0x6191('0x33')],_0x34f536[_0x6191('0x123')]):_0x34f536['dialOriginateCallerIdNumber']);if(_0xc0ea1f){_0x129280[_0x6191('0x125')]=ut[_0x6191('0x126')](_0xc0ea1f);_0x129280[_0x6191('0x127')]=ut[_0x6191('0x128')](_0xc0ea1f);}var _0x22f38d=ut['addVariables'](_0x34f536,_0x5370dc,_0x312ac0,_0xc0ea1f,_0x53afff,_0x129280);_['merge'](_0x129280,ut[_0x6191('0x129')](_0x22f38d));_0x129280[_0x6191('0x88')]=moment()[_0x6191('0x56')](_0x6191('0x89'));ami[_0x6191('0x72')](ut['variablesAction'](_0x129280,_0x34f536,_0x22f38d,_0x129280[_0x6191('0xa5')],_0x3d304a))[_0x6191('0x7f')](function(_0x1a647d){var _0x553396=_0x129280[_0x6191('0x12a')];if(!_[_0x6191('0x67')](_0x553396)){if(!_[_0x6191('0x67')](_0x164206[_0x6191('0x17')][_0x553396])){_0x164206[_0x6191('0x17')][_0x553396][_0x6191('0x12b')]=_0x129280[_0x6191('0x12c')];emit(util[_0x6191('0x56')](_0x6191('0x12d'),_0x164206['agents'][_0x553396][_0x6191('0x26')]),_0x6191('0x12e'),{'destaccountcode':_0x164206[_0x6191('0x17')][_0x553396][_0x6191('0x12f')],'destconnectedlinenum':_0x129280[_0x6191('0x12c')]});}}_0x34f536['originated']+=0x1;logger[_0x6191('0x58')](_0x6191('0x130'),_0x53afff,_0x6191('0xaa'),_0x34f536[_0x6191('0x26')],_0x6191('0x6b'),_0x34f536[_0x6191('0x4c')]);_0x548a91(_0x1a647d);})[_0x6191('0x75')](function(_0x168d19){ut[_0x6191('0xef')](_0x129280,0xe,_0x6191('0x131'));rpcDb[_0x6191('0xeb')](_0x129280,_0x6191('0x132'));_0x1d0135(_0x168d19);});});};Preview['prototype'][_0x6191('0x1f')]=function(_0x59e262){if(this[_0x6191('0x16')][_0x59e262['linkedid']]){this[_0x6191('0x16')][_0x59e262[_0x6191('0xa6')]][_0x6191('0x74')]=_0x59e262[_0x6191('0x74')];}};Preview[_0x6191('0x11')][_0x6191('0x133')]=function(_0x497d31){var _0x55154e=this;var _0x1bda02=this[_0x6191('0x16')][_0x497d31[_0x6191('0x134')]];if(_0x1bda02){if(_0x1bda02[_0x6191('0x135')]&&this[_0x6191('0x17')][_0x1bda02[_0x6191('0x135')]]){ut[_0x6191('0x136')](_0x1bda02,this[_0x6191('0x17')][_0x1bda02[_0x6191('0x135')]]['name'],this['agents'][_0x1bda02[_0x6191('0x135')]]['id']);}var _0x4fd7e8=_['clone'](_0x1bda02);_0x4fd7e8[_0x6191('0xa8')]=moment()[_0x6191('0x56')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1b3e49=_0x55154e[_0x6191('0x63')][_0x1bda02[_0x6191('0x6a')]];if(ut[_0x6191('0x137')](_0x497d31[_0x6191('0x138')])){if(_0x1bda02[_0x6191('0xa4')]){rpcDb[_0x6191('0x10a')](_0x1bda02[_0x6191('0xfd')]);}if(_0x1bda02[_0x6191('0xa5')]){rpcDb['disableContact'](_0x1bda02[_0x6191('0xfd')]);}ami[_0x6191('0x5b')](_0x6191('0x139'),ut[_0x6191('0x9c')](_0x1bda02,_0x6191('0x13a'),this[_0x6191('0x63')][_0x1bda02[_0x6191('0x6a')]]));this['callProgressDetectingAgent'](_0x4fd7e8,_0x1b3e49,_0x497d31);}else{_0x1bda02[_0x6191('0x88')]=moment()[_0x6191('0x56')](_0x6191('0x89'));ut[_0x6191('0xef')](_0x4fd7e8,0x4,_0x6191('0xb4'));rpcDb[_0x6191('0xeb')](_0x4fd7e8,_0x6191('0x13b'));}}};Preview[_0x6191('0x11')][_0x6191('0x13c')]=function(_0x50745a){var _0x45a6c4=this;var _0x2b5beb=this[_0x6191('0x16')][_0x50745a[_0x6191('0xa6')]];var _0x24f52f;if(_0x2b5beb){_0x24f52f=this[_0x6191('0x63')][_0x2b5beb[_0x6191('0x6a')]];logger[_0x6191('0x58')](_0x6191('0x13d'),_0x50745a['linkedid'],_0x6191('0xaa'),_0x24f52f[_0x6191('0x26')],_0x6191('0x6c'),_0x24f52f[_0x6191('0x5d')]);}if(this[_0x6191('0x16')][_0x50745a[_0x6191('0xa6')]]&&_0x50745a[_0x6191('0xa6')]!==_0x50745a[_0x6191('0xb8')]){if(_0x50745a[_0x6191('0x13e')]==='16'&&this[_0x6191('0x16')][_0x50745a[_0x6191('0xa6')]]['dialAnswer']){this[_0x6191('0x98')](_0x50745a,_0x50745a[_0x6191('0xa6')],_0x50745a['cause']);}else if(this[_0x6191('0x16')][_0x50745a['linkedid']][_0x6191('0x6d')]){logger[_0x6191('0x58')](_0x6191('0x13f'),_0x50745a[_0x6191('0xa6')],_0x50745a[_0x6191('0x13e')],_0x6191('0xaa'),_0x24f52f[_0x6191('0x26')],_0x6191('0x6c'),_0x24f52f['pTalking']);this[_0x6191('0x98')](_0x50745a,_0x50745a[_0x6191('0xa6')],_0x50745a[_0x6191('0x13e')]);}}else if(_0x2b5beb&&_['isNil'](_0x2b5beb[_0x6191('0x140')])&&_0x24f52f[_0x6191('0x141')]&&_0x50745a[_0x6191('0xa6')]===_0x50745a[_0x6191('0xb8')]&&_[_0x6191('0x67')](_0x50745a['reason'])&&_0x50745a['cause']==='16'&&_0x50745a[_0x6191('0x142')]==='6'&&_[_0x6191('0x143')](_0x2b5beb['transfer'])){if(_0x2b5beb[_0x6191('0xa4')]){rpcDb[_0x6191('0x10a')](_0x2b5beb['idContact']);}if(_0x2b5beb[_0x6191('0xa5')]){rpcDb[_0x6191('0x87')](_0x2b5beb['idContact']);}_0x50745a[_0x6191('0xea')]='22';this[_0x6191('0x144')](_0x2b5beb,_0x24f52f,_0x50745a);}else if(_0x2b5beb&&_0x2b5beb['transfer']){if(_0x50745a['cause']==='16'&&this[_0x6191('0x16')][_0x50745a[_0x6191('0xa6')]][_0x6191('0x6d')]){logger[_0x6191('0x58')](_0x6191('0x145'),_0x50745a[_0x6191('0xa6')],_0x50745a['cause'],_0x6191('0xaa'),_0x24f52f[_0x6191('0x26')],'pTalking:\x20',_0x24f52f[_0x6191('0x5d')]);this[_0x6191('0x98')](_0x50745a,_0x50745a[_0x6191('0xa6')],_0x50745a[_0x6191('0x13e')]);}else if(this[_0x6191('0x16')][_0x50745a[_0x6191('0xa6')]]['dialAnswer']){logger[_0x6191('0x58')](_0x6191('0x13f'),_0x50745a[_0x6191('0xa6')],_0x50745a['cause'],_0x6191('0xaa'),_0x24f52f[_0x6191('0x26')],_0x6191('0x6c'),_0x24f52f[_0x6191('0x5d')]);this[_0x6191('0x98')](_0x50745a,_0x50745a['linkedid'],_0x50745a[_0x6191('0x13e')]);}}};Preview['prototype'][_0x6191('0x1e')]=function(_0x486225){if(this[_0x6191('0x16')][_0x486225[_0x6191('0xe8')]]&&_0x486225[_0x6191('0xe8')]!==_0x486225[_0x6191('0x146')]){this['callProgressDetectingCustomer'](_0x486225,_0x486225[_0x6191('0xe8')],_0x486225[_0x6191('0xde')]);}};Preview['prototype']['syncHangupRequest']=function(_0x5543ed){if(this[_0x6191('0x16')][_0x5543ed[_0x6191('0xa6')]]&&_0x5543ed['linkedid']!==_0x5543ed[_0x6191('0xb8')]&&!this[_0x6191('0x16')][_0x5543ed['linkedid']][_0x6191('0x6d')]){if(_0x5543ed[_0x6191('0x13e')]==='1'){this[_0x6191('0x98')](_0x5543ed,_0x5543ed['linkedid'],_0x5543ed[_0x6191('0x13e')]);}}};Preview[_0x6191('0x11')][_0x6191('0x147')]=function(_0x2a93fb,_0x42c647,_0x4ba263){if(this['actions'][_0x2a93fb]){if(_[_0x6191('0x67')](this[_0x6191('0x16')][_0x2a93fb][_0x6191('0x148')])){this[_0x6191('0x16')][_0x2a93fb]['variables']={};}this['actions'][_0x2a93fb][_0x6191('0x148')][_0x42c647]=_0x4ba263;}};Preview[_0x6191('0x11')][_0x6191('0x149')]=function(_0x2924f7){try{if(!_['isNil'](_0x2924f7)){if(ut[_0x6191('0x14a')](_[_0x6191('0x14b')](_0x2924f7[_0x6191('0x14c')])[0x0])){this[_0x6191('0x147')](_0x2924f7[_0x6191('0xb8')],_[_0x6191('0x14b')](_0x2924f7[_0x6191('0x14c')])[0x0],_0x2924f7[_0x6191('0x14d')]);}}}catch(_0x17fefc){logger[_0x6191('0x14e')]('[syncVarSet][Preview]',util[_0x6191('0x14f')](_0x17fefc,{'showHidden':![],'depth':null}));}};Preview[_0x6191('0x11')][_0x6191('0x150')]=function(_0x30dfef){if(_0x30dfef){if(this[_0x6191('0x16')][_0x30dfef['transfertargetlinkedid']]){this[_0x6191('0x16')][_0x30dfef[_0x6191('0x151')]][_0x6191('0x152')]=!![];}}};Preview[_0x6191('0x11')][_0x6191('0x153')]=function(_0x207368){if(_0x207368){if(this['actions'][_0x207368['transfererlinkedid']]){this['actions'][_0x207368[_0x6191('0x154')]][_0x6191('0x152')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xed53=['keys','variable','value','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','setMessage','recallMe','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','countglobal','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','\x20Queue','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','dialBusyRetryFrequency','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','[callProgressDetectingAgent][logNoSuch]','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','trunks','SIP/%s','unmonitored','pick','unlock','unlockContact','execRun','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','execCall','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridNumber','addVariables','merge','starttime','Action','variablesAction','destconnectedlinenum','user:%s','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destlinkedid','addVariable','variables','filterKey'];(function(_0x1745bc,_0x2ff2f2){var _0x56e8fc=function(_0xa948cc){while(--_0xa948cc){_0x1745bc['push'](_0x1745bc['shift']());}};_0x56e8fc(++_0x2ff2f2);}(_0xed53,0x165));var _0x3ed5=function(_0x475598,_0x1eedab){_0x475598=_0x475598-0x0;var _0x1ee464=_0xed53[_0x475598];return _0x1ee464;};'use strict';var util=require(_0x3ed5('0x0'));var _=require(_0x3ed5('0x1'));var BPromise=require(_0x3ed5('0x2'));var uuid=require(_0x3ed5('0x3'));var moment=require(_0x3ed5('0x4'));var md5=require(_0x3ed5('0x5'));var Redis=require(_0x3ed5('0x6'));var config=require('../../../config/environment');var logger=require(_0x3ed5('0x7'))(_0x3ed5('0x8'));var loggerAction=require(_0x3ed5('0x7'))(_0x3ed5('0x9'));var ami=require(_0x3ed5('0xa'));var rpcDb=require(_0x3ed5('0xb'));var Action=require(_0x3ed5('0xc'));var ut=require(_0x3ed5('0xd'));config[_0x3ed5('0xe')]=_[_0x3ed5('0xf')](config['redis'],{'host':_0x3ed5('0x10'),'port':0x18eb});var io=require(_0x3ed5('0x11'))(new Redis(config[_0x3ed5('0xe')]));var Sequence=function(){};Sequence[_0x3ed5('0x12')][_0x3ed5('0x13')]=function(_0x2f2ec5){this[_0x3ed5('0x14')]=this[_0x3ed5('0x14')]?this[_0x3ed5('0x14')][_0x3ed5('0x15')](_0x2f2ec5):_0x2f2ec5();};function Preview(_0x270dfa){this['sequence']=new Sequence();this[_0x3ed5('0x16')]=_0x270dfa[_0x3ed5('0x17')];this['trunks']=_0x270dfa['trunks'];this[_0x3ed5('0x18')]={};this['agents']=_0x270dfa[_0x3ed5('0x19')];this[_0x3ed5('0x1a')]=0x0;ami['on'](_0x3ed5('0x1b'),this[_0x3ed5('0x1c')][_0x3ed5('0x1d')](this));ami['on'](_0x3ed5('0x1e'),this[_0x3ed5('0x1f')][_0x3ed5('0x1d')](this));ami['on'](_0x3ed5('0x20'),this[_0x3ed5('0x21')][_0x3ed5('0x1d')](this));ami['on']('dialend',this[_0x3ed5('0x22')][_0x3ed5('0x1d')](this));ami['on'](_0x3ed5('0x23'),this[_0x3ed5('0x24')]['bind'](this));ami['on'](_0x3ed5('0x25'),this[_0x3ed5('0x26')][_0x3ed5('0x1d')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x3ed5('0x1d')](this));ami['on']('blindtransfer',this[_0x3ed5('0x27')]['bind'](this));this[_0x3ed5('0x28')](this[_0x3ed5('0x16')]);}function emit(_0x52c447,_0x19bf74,_0xe94a56){io['to'](_0x52c447)[_0x3ed5('0x29')](_0x19bf74,_0xe94a56);}function emitCampaignPreview(_0x2606ed){if(_0x2606ed[_0x3ed5('0x2a')]===_0x3ed5('0x2b')){var _0x38cd41={'id':_0x2606ed['id'],'name':_0x2606ed[_0x3ed5('0x2c')],'strategy':_0x2606ed[_0x3ed5('0x2d')],'answered':_0x2606ed[_0x3ed5('0x2e')],'available':_0x2606ed['available'],'loggedIn':_0x2606ed[_0x3ed5('0x2f')],'pTalking':_0x2606ed[_0x3ed5('0x30')],'sumBillable':_0x2606ed[_0x3ed5('0x31')],'sumDuration':_0x2606ed[_0x3ed5('0x32')],'sumHoldTime':_0x2606ed[_0x3ed5('0x33')]||0x0,'talking':_0x2606ed['talking'],'total':_0x2606ed[_0x3ed5('0x34')],'type':_0x2606ed[_0x3ed5('0x2a')],'unmanaged':_0x2606ed[_0x3ed5('0x35')],'abandoned':_0x2606ed[_0x3ed5('0x36')],'waiting':_0x2606ed[_0x3ed5('0x37')],'loggedInDb':_0x2606ed[_0x3ed5('0x38')],'dialActive':_0x2606ed[_0x3ed5('0x39')],'dialMethod':_0x2606ed[_0x3ed5('0x3a')],'dialOriginateCallerIdName':_0x2606ed[_0x3ed5('0x3b')],'dialOriginateCallerIdNumber':_0x2606ed[_0x3ed5('0x3c')],'dialOriginateTimeout':_0x2606ed[_0x3ed5('0x3d')],'dialPrefix':_0x2606ed[_0x3ed5('0x3e')],'outboundAnswerAgiCallsDay':_0x2606ed[_0x3ed5('0x3f')],'outboundAnswerCallsDay':_0x2606ed[_0x3ed5('0x40')],'outboundBlacklistCallsDay':_0x2606ed[_0x3ed5('0x41')],'outboundBusyCallsDay':_0x2606ed[_0x3ed5('0x42')],'outboundCongestionCallsDay':_0x2606ed['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2606ed['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x2606ed['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2606ed['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x2606ed[_0x3ed5('0x43')],'outboundNoSuchCallsDay':_0x2606ed[_0x3ed5('0x44')],'outboundOriginateFailureCallsDay':_0x2606ed['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2606ed[_0x3ed5('0x45')],'outboundRejectCallsDay':_0x2606ed['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2606ed['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x2606ed['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x2606ed[_0x3ed5('0x46')],'predictiveIntervalAvgHoldtime':_0x2606ed[_0x3ed5('0x47')],'predictiveIntervalAvgTalktime':_0x2606ed[_0x3ed5('0x48')],'predictiveIntervalDroppedCallsCallersExit':_0x2606ed[_0x3ed5('0x49')],'predictiveIntervalDroppedCallsTimeout':_0x2606ed[_0x3ed5('0x4a')],'predictiveIntervalErlangCalls':_0x2606ed[_0x3ed5('0x4b')],'predictiveIntervalErlangCallsDroppedCalls':_0x2606ed[_0x3ed5('0x4c')],'predictiveIntervalHitRate':_0x2606ed[_0x3ed5('0x4d')],'predictiveIntervalMultiplicativeFactor':_0x2606ed[_0x3ed5('0x4e')],'predictiveIntervalPauses':_0x2606ed[_0x3ed5('0x4f')],'predictiveIntervalAvailable':_0x2606ed['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x2606ed[_0x3ed5('0x50')],'message':_0x2606ed[_0x3ed5('0x51')],'originated':_0x2606ed[_0x3ed5('0x52')],'erlangCalls':_0x2606ed[_0x3ed5('0x53')],'erlangCallToSecond':_0x2606ed['erlangCallToSecond'],'erlangAbandonmentRate':_0x2606ed[_0x3ed5('0x54')],'erlangBusyFactor':_0x2606ed[_0x3ed5('0x55')],'startPredictive':_0x2606ed[_0x3ed5('0x56')],'startProgressive':_0x2606ed['startProgressive']};if(_0x2606ed[_0x3ed5('0x57')]){_0x38cd41[_0x3ed5('0x57')]={'id':_0x2606ed['Trunk']['id'],'name':_0x2606ed['Trunk']['name'],'active':_0x2606ed['Trunk'][_0x3ed5('0x58')],'callerid':_0x2606ed[_0x3ed5('0x57')]['callerid']};}if(_0x2606ed[_0x3ed5('0x59')]){_0x38cd41[_0x3ed5('0x59')]={'id':_0x2606ed[_0x3ed5('0x59')]['id'],'name':_0x2606ed[_0x3ed5('0x59')][_0x3ed5('0x2c')]};}var _0x19b02d=md5(JSON[_0x3ed5('0x5a')](_0x38cd41));if(_0x2606ed[_0x3ed5('0x5')]!==_0x19b02d){_0x2606ed[_0x3ed5('0x5')]=_0x19b02d;emit(util[_0x3ed5('0x5b')](_0x3ed5('0x5c'),_0x38cd41[_0x3ed5('0x2c')]),_0x3ed5('0x5d'),_0x38cd41);}}}function emitVoiceQueueChannelRemove(_0x39bbf0){logger[_0x3ed5('0x5e')](_0x3ed5('0x5f'),JSON['stringify'](_0x39bbf0));emit(util[_0x3ed5('0x5b')](_0x3ed5('0x5c'),_0x39bbf0[_0x3ed5('0x2c')]),_0x3ed5('0x60'),_0x39bbf0);io['emit'](_0x3ed5('0x61'),_0x39bbf0);}function notSendMessagesQueue(_0x2c4d35){if(_0x2c4d35[_0x3ed5('0x62')]){if(_0x2c4d35[_0x3ed5('0x52')]===0x0&&_0x2c4d35['pTalking']===0x0){_0x2c4d35['sendMessageOneNotActive']=![];_0x2c4d35[_0x3ed5('0x63')]=0x0;_0x2c4d35[_0x3ed5('0x64')]=0x0;_0x2c4d35[_0x3ed5('0x51')]=_0x3ed5('0x65');ut['logger'](_0x3ed5('0x66'),_0x2c4d35[_0x3ed5('0x2c')]+'\x20is\x20not\x20active');}else{_0x2c4d35[_0x3ed5('0x51')]=_0x3ed5('0x67');ut[_0x3ed5('0x68')](_0x3ed5('0x66'),_0x2c4d35[_0x3ed5('0x2c')]+_0x3ed5('0x69'));}emitCampaignPreview(_0x2c4d35);}}Preview[_0x3ed5('0x12')][_0x3ed5('0x28')]=function(){var _0x18db3d=this;setInterval(function(){_0x18db3d[_0x3ed5('0x6a')]();},0x7cf);};Preview[_0x3ed5('0x12')][_0x3ed5('0x6a')]=function(){var _0x40167b=this['campaignsPreview'];this[_0x3ed5('0x1a')]+=0x1;for(var _0x1abbc8 in _0x40167b){if(_0x40167b[_0x3ed5('0x6b')](_0x1abbc8)&&(_0x40167b[_0x1abbc8][_0x3ed5('0x3a')]===_0x3ed5('0x8')||_0x40167b[_0x1abbc8][_0x3ed5('0x3a')]===_0x3ed5('0x6c'))&&_0x40167b[_0x1abbc8][_0x3ed5('0x2a')]===_0x3ed5('0x2b')){if(this[_0x3ed5('0x1a')]>0x7){this[_0x3ed5('0x1a')]=0x0;this['clearZombieChannels']();}}if(_0x40167b['hasOwnProperty'](_0x1abbc8)&&_0x40167b[_0x1abbc8][_0x3ed5('0x3a')]===_0x3ed5('0x8')&&_0x40167b[_0x1abbc8][_0x3ed5('0x2a')]===_0x3ed5('0x2b')){if(_0x40167b[_0x1abbc8][_0x3ed5('0x39')]){this[_0x3ed5('0x6d')](_0x40167b[_0x1abbc8]);this[_0x3ed5('0x6e')](_0x40167b[_0x1abbc8]);}else{notSendMessagesQueue(_0x40167b[_0x1abbc8]);}}}};Preview[_0x3ed5('0x12')]['clearZombieChannel']=function(_0x47863a){var _0x7dbefe=this;this[_0x3ed5('0x6f')][_0x3ed5('0x13')](function(){if(!_[_0x3ed5('0x70')](_0x7dbefe['actions'][_0x47863a])){loggerAction['info'](_0x3ed5('0x71'),_0x47863a,_0x3ed5('0x72'),_0x7dbefe[_0x3ed5('0x18')][_0x47863a][_0x3ed5('0x73')],_0x3ed5('0x74'),JSON[_0x3ed5('0x5a')](_0x7dbefe['campaignsPreview'][_0x7dbefe['actions'][_0x47863a][_0x3ed5('0x73')]][_0x3ed5('0x52')]),_0x3ed5('0x75'),JSON[_0x3ed5('0x5a')](_0x7dbefe[_0x3ed5('0x16')][_0x7dbefe['actions'][_0x47863a][_0x3ed5('0x73')]][_0x3ed5('0x30')]),JSON[_0x3ed5('0x5a')](_0x7dbefe[_0x3ed5('0x18')][_0x47863a][_0x3ed5('0x76')]),JSON[_0x3ed5('0x5a')](_['pick'](_0x7dbefe['actions'][_0x47863a],[_0x3ed5('0x77'),_0x3ed5('0x78'),_0x3ed5('0x79'),_0x3ed5('0x7a')])));return ami['Action']({'action':_0x3ed5('0x7b'),'channel':_0x7dbefe['actions'][_0x47863a][_0x3ed5('0x7c')]})[_0x3ed5('0x7d')](function(_0x3a762e){if(_0x3a762e[_0x3ed5('0x51')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x7dbefe['actions'][_0x47863a]){ut[_0x3ed5('0x7e')](_0x7dbefe['campaignsPreview'][_0x7dbefe['actions'][_0x47863a]['queue']],_0x3ed5('0x7f'));if(_0x7dbefe[_0x3ed5('0x18')][_0x47863a][_0x3ed5('0x76')]===!![]){ut[_0x3ed5('0x80')](_0x7dbefe[_0x3ed5('0x16')][_0x7dbefe['actions'][_0x47863a]['queue']],_0x3ed5('0x7f'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x47863a,_0x7dbefe[_0x3ed5('0x18')][_0x47863a][_0x3ed5('0x73')]);}ut[_0x3ed5('0x81')]('[Dialer][checkChannel][Preview]'+_0x47863a,_0x7dbefe[_0x3ed5('0x18')][_0x47863a][_0x3ed5('0x73')]);delete _0x7dbefe[_0x3ed5('0x18')][_0x47863a];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x29f4de=this;loggerAction[_0x3ed5('0x5e')]('[action]',_[_0x3ed5('0x82')](this['actions']));for(var _0x5f46d4 in this[_0x3ed5('0x18')]){if(_0x29f4de['actions'][_0x3ed5('0x6b')](_0x5f46d4)){_0x29f4de[_0x3ed5('0x83')](_0x5f46d4);}}};Preview[_0x3ed5('0x12')][_0x3ed5('0x6e')]=function(_0x36ca9f){var _0x6e9ef4=this;rpcDb[_0x3ed5('0x84')](_0x36ca9f['id'],ut[_0x3ed5('0x85')](this[_0x3ed5('0x19')]))[_0x3ed5('0x86')](function(_0x51ef3c){if(!_[_0x3ed5('0x70')](_0x51ef3c)){for(var _0xe3ea35=0x0;_0xe3ea35<_0x51ef3c['length'];_0xe3ea35+=0x1){if(ut[_0x3ed5('0x87')](_0x51ef3c[_0xe3ea35][_0x3ed5('0x88')])<_0x36ca9f[_0x3ed5('0x89')]*0x3c){if(_0x51ef3c[_0xe3ea35][_0x3ed5('0x8a')]&&!_0x51ef3c[_0xe3ea35]['Agent'][_0x3ed5('0x8b')]){_0x6e9ef4[_0x3ed5('0x8c')](_0x51ef3c[_0xe3ea35]['id'])[_0x3ed5('0x86')](ut[_0x3ed5('0x8d')](_0x3ed5('0x8e')))[_0x3ed5('0x7d')](ut[_0x3ed5('0x8d')](_0x3ed5('0x8e')));}else{rpcDb[_0x3ed5('0x8f')](_0x51ef3c[_0xe3ea35]['id']);}}else{var _0x25e73c=new Action(_0x51ef3c[_0xe3ea35],_0x36ca9f);_0x25e73c['starttime']=moment()[_0x3ed5('0x5b')](_0x3ed5('0x90'));_0x36ca9f[_0x3ed5('0x45')]+=0x1;ut[_0x3ed5('0x91')](_0x25e73c,0x17,_0x3ed5('0x92'));if(_0x36ca9f[_0x3ed5('0x93')]){rpcDb[_0x3ed5('0x94')](ut[_0x3ed5('0x95')](_0x51ef3c[_0xe3ea35]));rpcDb['createCustomerHistory'](_0x25e73c,_0x3ed5('0x96'));}else{ut[_0x3ed5('0x91')](_0x25e73c,0x16,_0x3ed5('0x97'));rpcDb[_0x3ed5('0x98')](_0x25e73c,_0x3ed5('0x99'));rpcDb[_0x3ed5('0x9a')](_0x25e73c,_0x3ed5('0x99'));}}}}})[_0x3ed5('0x7d')](ut[_0x3ed5('0x8d')]('[getContactRecallMe]'));};Preview[_0x3ed5('0x12')][_0x3ed5('0x6d')]=function(_0x1d2c6b){_0x1d2c6b[_0x3ed5('0x62')]=!![];if(ut[_0x3ed5('0x9b')](_0x1d2c6b[_0x3ed5('0x2f')])){_0x1d2c6b[_0x3ed5('0x51')]=_0x3ed5('0x9c');}else if(!ut[_0x3ed5('0x9d')](_0x1d2c6b['dialActive'])){_0x1d2c6b[_0x3ed5('0x51')]='NOT_ACTIVE';}else if(!this[_0x3ed5('0x9e')](_0x1d2c6b[_0x3ed5('0x57')])){if(!this[_0x3ed5('0x9e')](_0x1d2c6b['TrunkBackup'])){_0x1d2c6b[_0x3ed5('0x51')]=_0x3ed5('0x9f');}else{_0x1d2c6b['message']='ACTIVE';}}else{_0x1d2c6b[_0x3ed5('0x51')]='ACTIVE';}emitCampaignPreview(_0x1d2c6b);};Preview['prototype'][_0x3ed5('0xa0')]=function(_0x9708a7,_0x18082d,_0x19c051){var _0x5286ba=this;var _0x794a6d=this['actions'][_0x18082d];var _0x1f5c23=this[_0x3ed5('0x16')][_0x794a6d[_0x3ed5('0x73')]];var _0x3368b8;if(_0x1f5c23){switch(_0x19c051){case'1':_0x1f5c23[_0x3ed5('0x44')]+=0x1;_0x794a6d[_0x3ed5('0xa1')]+=0x1;_0x794a6d['countglobal']=ut[_0x3ed5('0xa2')](_0x794a6d);ut[_0x3ed5('0x91')](_0x794a6d,0x0,_0x3ed5('0xa3'));ami['emit'](_0x3ed5('0xa4'),ut[_0x3ed5('0xa5')](_0x794a6d,_0x3ed5('0xa6')));rpcDb[_0x3ed5('0x98')](_0x794a6d,_0x3ed5('0xa7'));if(ut[_0x3ed5('0xa2')](_0x794a6d)>=_0x1f5c23[_0x3ed5('0xa8')]){_0x3368b8=ut[_0x3ed5('0xa9')](_0x794a6d,0xf,_0x3ed5('0xaa'));rpcDb[_0x3ed5('0x9a')](_0x3368b8,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x794a6d[_0x3ed5('0xa1')]>=_0x1f5c23[_0x3ed5('0xab')]){rpcDb[_0x3ed5('0x9a')](_0x794a6d,_0x3ed5('0xac'));}else{rpcDb['rescheduleContact'](ut[_0x3ed5('0xad')](_0x794a6d,_0x3ed5('0xa1'),_0x1f5c23[_0x3ed5('0xae')]),_0x794a6d[_0x3ed5('0xaf')],_0x794a6d[_0x3ed5('0xb0')]);}}delete this[_0x3ed5('0x18')][_0x9708a7[_0x3ed5('0xb1')]];break;case _0x3ed5('0xb2'):var _0x527bc2=moment()[_0x3ed5('0x5b')](_0x3ed5('0x90'));_0x794a6d[_0x3ed5('0xb3')]=_0x527bc2;_0x794a6d[_0x3ed5('0xb4')]=_0x527bc2;_0x794a6d['dialAnswer']=!![];_0x1f5c23[_0x3ed5('0x30')]+=0x1;logger[_0x3ed5('0x5e')](_0x3ed5('0xb5'),_0x794a6d[_0x3ed5('0xb6')],'\x20Queue',_0x1f5c23[_0x3ed5('0x2c')],'pTalking:\x20',_0x1f5c23[_0x3ed5('0x30')]);ami[_0x3ed5('0x29')](_0x3ed5('0xb7'),ut['buildObj'](_0x794a6d,_0x3ed5('0xb8'),this[_0x3ed5('0x16')][_0x794a6d[_0x3ed5('0x73')]]));if(_0x1f5c23[_0x3ed5('0xb9')]){ami[_0x3ed5('0x29')](_0x3ed5('0xba'),ut[_0x3ed5('0xbb')](_0x794a6d));}break;case'16':ami[_0x3ed5('0x29')]('custom:agentcomplete',ut[_0x3ed5('0xa5')](_0x794a6d,_0x3ed5('0xbc'),this[_0x3ed5('0x16')][_0x794a6d[_0x3ed5('0x73')]]));emitVoiceQueueChannelRemove(ut[_0x3ed5('0xa5')](_0x794a6d,_0x3ed5('0xbc')));_0x1f5c23[_0x3ed5('0x40')]+=0x1;_0x1f5c23[_0x3ed5('0x34')]+=0x1;_0x1f5c23['answered']+=0x1;ut[_0x3ed5('0x80')](_0x1f5c23,_0x3ed5('0xbd'));_0x794a6d[_0x3ed5('0xbe')]=ut[_0x3ed5('0xa2')](_0x794a6d);ut['logCustomer'](_0x794a6d,0x4,'Answer');rpcDb['createCustomerHistory'](_0x794a6d,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x3ed5('0x9a')](_0x794a6d,_0x3ed5('0xbf'));rpcDb[_0x3ed5('0xc0')](_0x794a6d);_0x1f5c23[_0x3ed5('0x32')]+=_0x794a6d['talktime'];_0x1f5c23[_0x3ed5('0x31')]+=_0x794a6d[_0x3ed5('0xc1')];logger[_0x3ed5('0x5e')]('[syncHangup][talking][decrement]',_0x794a6d['uniqueid'],_0x3ed5('0xc2'),_0x1f5c23[_0x3ed5('0x2c')],'pTalking:\x20',_0x1f5c23['pTalking']);delete this[_0x3ed5('0x18')][_0x9708a7[_0x3ed5('0xb1')]];break;case'BUSY':_0x1f5c23[_0x3ed5('0x42')]+=0x1;_0x794a6d[_0x3ed5('0xc3')]+=0x1;_0x794a6d['countglobal']=ut['totalGlobal'](_0x794a6d);ut[_0x3ed5('0x91')](_0x794a6d,0x5,_0x3ed5('0xc4'));ami[_0x3ed5('0x29')]('custom:agentbusy',ut[_0x3ed5('0xa5')](_0x794a6d,_0x3ed5('0xc5')));rpcDb['createCustomerHistory'](_0x794a6d,_0x3ed5('0xc6'));if(ut[_0x3ed5('0xa2')](_0x794a6d)>=_0x1f5c23[_0x3ed5('0xa8')]){_0x3368b8=ut[_0x3ed5('0xa9')](_0x794a6d,0xf,_0x3ed5('0xaa'));rpcDb['createCustomerFinal'](_0x3368b8,_0x3ed5('0xc7'));}else{if(_0x794a6d[_0x3ed5('0xc3')]>=_0x1f5c23[_0x3ed5('0xc8')]){rpcDb[_0x3ed5('0x9a')](_0x794a6d,_0x3ed5('0xc6'));}else{rpcDb[_0x3ed5('0xc9')](ut[_0x3ed5('0xad')](_0x794a6d,_0x3ed5('0xc3'),_0x1f5c23['dialBusyRetryFrequency']),_0x794a6d[_0x3ed5('0xaf')],_0x794a6d['activeContact']);}}break;case'NOANSWER':_0x1f5c23['outboundNoAnswerCallsDay']+=0x1;_0x794a6d['countnoanswerretry']+=0x1;_0x794a6d['countglobal']=ut[_0x3ed5('0xa2')](_0x794a6d);ut[_0x3ed5('0x91')](_0x794a6d,0x3,_0x3ed5('0xca'));ami['emit'](_0x3ed5('0xcb'),ut['buildObj'](_0x794a6d,'noanswer'));rpcDb[_0x3ed5('0x98')](_0x794a6d,_0x3ed5('0xcc'));if(ut[_0x3ed5('0xa2')](_0x794a6d)>=_0x1f5c23[_0x3ed5('0xa8')]){_0x3368b8=ut['cloneAction'](_0x794a6d,0xf,_0x3ed5('0xaa'));rpcDb[_0x3ed5('0x9a')](_0x3368b8,_0x3ed5('0xcd'));}else{if(_0x794a6d[_0x3ed5('0xce')]>=_0x1f5c23['dialNoAnswerMaxRetry']){rpcDb[_0x3ed5('0x9a')](_0x794a6d,_0x3ed5('0xcc'));}else{rpcDb['rescheduleContact'](ut[_0x3ed5('0xad')](_0x794a6d,'countnoanswerretry',_0x1f5c23['dialNoAnswerRetryFrequency']),_0x794a6d[_0x3ed5('0xaf')],_0x794a6d[_0x3ed5('0xb0')]);}}break;case'CONGESTION':_0x1f5c23[_0x3ed5('0xcf')]+=0x1;_0x794a6d[_0x3ed5('0xd0')]+=0x1;_0x794a6d['countglobal']=ut[_0x3ed5('0xa2')](_0x794a6d);ut[_0x3ed5('0x91')](_0x794a6d,0x8,_0x3ed5('0xd1'));ami[_0x3ed5('0x29')](_0x3ed5('0xd2'),ut['buildObj'](_0x794a6d,_0x3ed5('0xd3')));rpcDb[_0x3ed5('0x98')](_0x794a6d,_0x3ed5('0xd4'));if(ut[_0x3ed5('0xa2')](_0x794a6d)>=_0x1f5c23['dialGlobalMaxRetry']){_0x3368b8=ut[_0x3ed5('0xa9')](_0x794a6d,0xf,_0x3ed5('0xaa'));rpcDb[_0x3ed5('0x9a')](_0x3368b8,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x794a6d[_0x3ed5('0xd0')]>=_0x1f5c23[_0x3ed5('0xd5')]){rpcDb['createCustomerFinal'](_0x794a6d,_0x3ed5('0xd4'));}else{rpcDb[_0x3ed5('0xc9')](ut[_0x3ed5('0xad')](_0x794a6d,_0x3ed5('0xd0'),_0x1f5c23[_0x3ed5('0xd6')]),_0x794a6d[_0x3ed5('0xaf')],_0x794a6d['activeContact']);}}break;case'CANCEL':_0x1f5c23[_0x3ed5('0xd7')]+=0x1;_0x794a6d['countagentrejectretry']+=0x1;_0x794a6d[_0x3ed5('0xbe')]=ut[_0x3ed5('0xa2')](_0x794a6d);ut['logCustomer'](_0x794a6d,0x14,_0x3ed5('0xd8'));ami[_0x3ed5('0x29')](_0x3ed5('0xd9'),ut[_0x3ed5('0xa5')](_0x794a6d,_0x3ed5('0xda')));rpcDb[_0x3ed5('0x98')](_0x794a6d,_0x3ed5('0xdb'));if(ut[_0x3ed5('0xa2')](_0x794a6d)>=_0x1f5c23[_0x3ed5('0xa8')]){_0x3368b8=ut[_0x3ed5('0xa9')](_0x794a6d,0x14,_0x3ed5('0xd8'));rpcDb['createCustomerFinal'](_0x3368b8,_0x3ed5('0xdc'));}else{if(_0x794a6d[_0x3ed5('0xdd')]>=_0x1f5c23[_0x3ed5('0xde')]){rpcDb[_0x3ed5('0x9a')](_0x794a6d,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x3ed5('0xc9')](ut[_0x3ed5('0xad')](_0x794a6d,_0x3ed5('0xdd'),_0x1f5c23[_0x3ed5('0xdf')]),_0x794a6d[_0x3ed5('0xaf')],_0x794a6d[_0x3ed5('0xb0')]);}}break;case _0x3ed5('0xe0'):_0x1f5c23[_0x3ed5('0xe1')]+=0x1;_0x794a6d[_0x3ed5('0xe2')]+=0x1;_0x794a6d['countglobal']=ut[_0x3ed5('0xa2')](_0x794a6d);ut[_0x3ed5('0x91')](_0x794a6d,0xb,_0x3ed5('0xe3'));rpcDb[_0x3ed5('0x98')](_0x794a6d,_0x3ed5('0xe4'));if(ut[_0x3ed5('0xa2')](_0x794a6d)>=_0x1f5c23['dialGlobalMaxRetry']){_0x3368b8=ut['cloneAction'](_0x794a6d,0xf,_0x3ed5('0xaa'));rpcDb[_0x3ed5('0x9a')](_0x3368b8,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x794a6d[_0x3ed5('0xe5')]>=_0x1f5c23[_0x3ed5('0xe6')]){rpcDb[_0x3ed5('0x9a')](_0x794a6d,_0x3ed5('0xe4'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x794a6d,_0x3ed5('0xe2'),_0x1f5c23[_0x3ed5('0xe7')]),_0x794a6d[_0x3ed5('0xaf')],_0x794a6d[_0x3ed5('0xb0')]);}}break;case'18':_0x1f5c23['outboundUnknownCallsDay']+=0x1;_0x794a6d[_0x3ed5('0xe8')]+=0x1;_0x794a6d[_0x3ed5('0xbe')]=ut[_0x3ed5('0xa2')](_0x794a6d);ut['logCustomer'](_0x794a6d,0x12,_0x9708a7[_0x3ed5('0xe9')]||_0x9708a7[_0x3ed5('0xea')]);ami[_0x3ed5('0x29')](_0x3ed5('0xeb'),ut[_0x3ed5('0xa5')](_0x794a6d,_0x3ed5('0xec')));rpcDb[_0x3ed5('0x98')](_0x794a6d,_0x3ed5('0xed'));if(ut[_0x3ed5('0xa2')](_0x794a6d)>=_0x1f5c23[_0x3ed5('0xa8')]){_0x3368b8=ut[_0x3ed5('0xa9')](_0x794a6d,0xf,_0x3ed5('0xaa'));rpcDb[_0x3ed5('0x9a')](_0x3368b8,_0x3ed5('0xed'));}else{rpcDb[_0x3ed5('0x9a')](_0x794a6d,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x3ed5('0x18')][_0x9708a7[_0x3ed5('0xb1')]];break;case'19':_0x1f5c23[_0x3ed5('0xee')]+=0x1;_0x794a6d['countglobal']=ut['totalGlobal'](_0x794a6d);ut[_0x3ed5('0x91')](_0x794a6d,0x13,_0x9708a7[_0x3ed5('0xe9')]||_0x9708a7[_0x3ed5('0xea')]);ami[_0x3ed5('0x29')](_0x3ed5('0xeb'),ut[_0x3ed5('0xa5')](_0x794a6d,_0x3ed5('0xec')));rpcDb[_0x3ed5('0x98')](_0x794a6d,_0x3ed5('0xef'));if(ut[_0x3ed5('0xa2')](_0x794a6d)>=_0x1f5c23[_0x3ed5('0xa8')]){_0x3368b8=ut[_0x3ed5('0xa9')](_0x794a6d,0xf,_0x3ed5('0xaa'));rpcDb[_0x3ed5('0x9a')](_0x3368b8,_0x3ed5('0xef'));}else{rpcDb[_0x3ed5('0x9a')](_0x794a6d,_0x3ed5('0xef'));}delete this[_0x3ed5('0x18')][_0x9708a7[_0x3ed5('0xb1')]];break;default:if(_0x794a6d[_0x3ed5('0x76')]){ut[_0x3ed5('0x80')](_0x1f5c23,_0x3ed5('0xf0'));ut[_0x3ed5('0x81')](_0x3ed5('0xf1')+_0x1f5c23[_0x3ed5('0x2c')],_0x9708a7);}_0x1f5c23[_0x3ed5('0xee')]+=0x1;_0x794a6d[_0x3ed5('0xbe')]=ut[_0x3ed5('0xa2')](_0x794a6d);ut['logCustomer'](_0x794a6d,0xc,_0x9708a7['cause-txt']||_0x9708a7[_0x3ed5('0xea')]);rpcDb['createCustomerHistory'](_0x794a6d,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x794a6d)>=_0x1f5c23[_0x3ed5('0xa8')]){_0x3368b8=ut[_0x3ed5('0xa9')](_0x794a6d,0xf,'Global');rpcDb[_0x3ed5('0x9a')](_0x3368b8,_0x3ed5('0xf2'));}else{rpcDb[_0x3ed5('0x9a')](_0x794a6d,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x3ed5('0x18')][_0x9708a7['linkedid']];}if(!(_0x794a6d[_0x3ed5('0x76')]&&_0x19c051==='16')){ut['updateOriginated'](_0x1f5c23,_0x3ed5('0xf3'));logger[_0x3ed5('0x5e')](_0x3ed5('0xf4'),_0x794a6d['uniqueid'],_0x3ed5('0xc2'),_0x1f5c23[_0x3ed5('0x2c')],_0x3ed5('0x74'),_0x1f5c23[_0x3ed5('0x52')]);}if(_0x19c051!=='ANSWER'){delete this[_0x3ed5('0x18')][_0x9708a7[_0x3ed5('0xb1')]];delete this[_0x3ed5('0x18')][_0x9708a7['destlinkedid']];}}};Preview[_0x3ed5('0x12')]['callProgressDetectingAgent']=function(_0x26504d,_0x34fc40,_0x33f020){if(_[_0x3ed5('0xf5')](_0x34fc40)&&_0x3ed5('0xf6')!==typeof _0x34fc40){return;}if(_[_0x3ed5('0xf5')](_0x33f020)&&_0x3ed5('0xf6')!==typeof _0x33f020){return;}switch(_0x33f020[_0x3ed5('0xf7')]){case'0':ut['logAgent'](_0x26504d,0x0,_0x3ed5('0xa3'));rpcDb['createAgentHistory'](_0x26504d,_0x3ed5('0xf8'));break;case'3':ut[_0x3ed5('0xf9')](_0x26504d,0x3,_0x3ed5('0xca'));rpcDb[_0x3ed5('0xfa')](_0x26504d,_0x3ed5('0xfb'));break;case'5':ut[_0x3ed5('0xf9')](_0x26504d,0x5,'Busy');rpcDb[_0x3ed5('0xfa')](_0x26504d,_0x3ed5('0xfc'));break;case'8':ut['logAgent'](_0x26504d,0x8,_0x3ed5('0xd1'));rpcDb[_0x3ed5('0xfa')](_0x26504d,_0x3ed5('0xfd'));break;case'22':ut[_0x3ed5('0xf9')](_0x26504d,0x16,_0x3ed5('0xfe'));rpcDb[_0x3ed5('0xfa')](_0x26504d,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x3ed5('0xf9')](_0x26504d,0xc,_0x33f020[_0x3ed5('0xf7')]);rpcDb[_0x3ed5('0xfa')](_0x26504d,_0x3ed5('0xfd'));}ut[_0x3ed5('0x7e')](_0x34fc40,'[callProgressDetectingAgent]');logger[_0x3ed5('0x5e')]('[originated][decrement][callProgressDetectingAgent]',_0x26504d[_0x3ed5('0xb6')],_0x3ed5('0xc2'),_0x34fc40['name'],'originated:\x20',_0x34fc40[_0x3ed5('0x52')]);delete this[_0x3ed5('0x18')][_0x26504d[_0x3ed5('0xb6')]];};Preview['prototype'][_0x3ed5('0xff')]=function(_0x1c1bf5,_0x539706,_0x3588b5,_0x465bde,_0x3f5c27){var _0xdf9570=this;return new BPromise(function(_0x38d76d,_0x508af4){if(_[_0x3ed5('0x70')](_0x539706)||_[_0x3ed5('0x70')](_0x539706[_0x3ed5('0x100')])||_[_0x3ed5('0x70')](_0x539706[_0x3ed5('0x100')][_0x3ed5('0x101')])||_[_0x3ed5('0x70')](_0x539706[_0x3ed5('0x79')])){_0x508af4(ut[_0x3ed5('0x51')](_0x3ed5('0x102'),_0x465bde,_0x3f5c27));return;}var _0x33c5f5=uuid['v4']();var _0x24c768=_0xdf9570[_0x3ed5('0x16')][_0x539706[_0x3ed5('0x72')][_0x3ed5('0x2c')]];var _0x13cfd8=_0x3588b5?_0xdf9570[_0x3ed5('0x19')][_0x3588b5]['id']:undefined;_0xdf9570[_0x3ed5('0x18')][_0x33c5f5]=new Action(_0x539706,_0x24c768,_0x33c5f5,_0x3588b5,_0x13cfd8);var _0x3b4d5e=_0xdf9570['actions'][_0x33c5f5];_0x3b4d5e[_0x3ed5('0xaf')]=_0x465bde;_0x3b4d5e['activeContact']=_0x3f5c27;_0x3b4d5e[_0x3ed5('0x103')]=_0x3588b5;if(_[_0x3ed5('0x104')](_0x1c1bf5)){_0xdf9570['execCall'](_0x3b4d5e,_0x24c768,_0x539706,_0x3588b5)['then'](function(_0x55044f){logger[_0x3ed5('0x5e')](_0x3ed5('0x105'),_0x3ed5('0x106')+_0x3b4d5e['queue']+_0x3ed5('0x107')+_0x3b4d5e[_0x3ed5('0x108')],JSON[_0x3ed5('0x5a')](_0x55044f));ami['emit'](_0x3ed5('0x109'),ut[_0x3ed5('0xa5')](_0x3b4d5e,_0x3ed5('0x10a'),_0xdf9570[_0x3ed5('0x16')][_0x3b4d5e[_0x3ed5('0x73')]]));_0x38d76d(ut[_0x3ed5('0x51')](_0x3ed5('0x10b')));})[_0x3ed5('0x7d')](function(_0x267b8a){ut[_0x3ed5('0x68')](_0x3ed5('0x10c'),_0x267b8a);_0x508af4(ut[_0x3ed5('0x51')](_0x3ed5('0x10d'),_0x465bde,_0x3f5c27));});}else{_0x24c768['outboundBlacklistCallsDay']+=0x1;ut[_0x3ed5('0x10e')](_0x3b4d5e);rpcDb[_0x3ed5('0x10f')](_0x3b4d5e,_0x3ed5('0x110'));delete _0xdf9570[_0x3ed5('0x18')][_0x33c5f5];_0x508af4(ut[_0x3ed5('0x51')](_0x3ed5('0x111'),_0x465bde,_0x3f5c27));}});};Preview[_0x3ed5('0x12')][_0x3ed5('0x9e')]=function(_0x8e0a8a){return!_[_0x3ed5('0x70')](_0x8e0a8a)&&!_[_0x3ed5('0x70')](_0x8e0a8a[_0x3ed5('0x2c')])&&!_['isNil'](_0x8e0a8a['active'])&&_0x8e0a8a[_0x3ed5('0x58')]&&!_[_0x3ed5('0x70')](this[_0x3ed5('0x112')][util[_0x3ed5('0x5b')](_0x3ed5('0x113'),_0x8e0a8a['name'])])&&!_['isNil'](this[_0x3ed5('0x112')][util[_0x3ed5('0x5b')](_0x3ed5('0x113'),_0x8e0a8a['name'])]['status'])&&(this['trunks'][util[_0x3ed5('0x5b')](_0x3ed5('0x113'),_0x8e0a8a[_0x3ed5('0x2c')])][_0x3ed5('0x7b')]==='reachable'||this[_0x3ed5('0x112')][util[_0x3ed5('0x5b')](_0x3ed5('0x113'),_0x8e0a8a[_0x3ed5('0x2c')])]['status']===_0x3ed5('0x114'));};Preview[_0x3ed5('0x12')][_0x3ed5('0x8c')]=function(_0x25966,_0x233c2e){var _0x25e69a=this;return new BPromise(function(_0x35c929,_0x3be1e8){_0x25e69a['execRun'](_0x25966,_0x233c2e)[_0x3ed5('0x86')](function(_0xed0471){_0x35c929(_[_0x3ed5('0x115')](_0xed0471,['message']));})['catch'](function(_0x35a21b){if(_0x35a21b[_0x3ed5('0x116')]){rpcDb[_0x3ed5('0x117')](_0x25966);}if(_0x35a21b['active']){rpcDb[_0x3ed5('0x8f')](_0x25966);}_0x3be1e8(_[_0x3ed5('0x115')](_0x35a21b,[_0x3ed5('0x51')]));});});};Preview[_0x3ed5('0x12')][_0x3ed5('0x118')]=function(_0x9b11e7,_0x574265){var _0x7b0bea=this;return new BPromise(function(_0x45cc83,_0x5b6823){var _0x130e1f,_0x1bac81;rpcDb[_0x3ed5('0x119')](_0x9b11e7)[_0x3ed5('0x86')](function(_0x5dfd42){if(!_[_0x3ed5('0x70')](_0x5dfd42[0x0])){_0x1bac81=_0x5dfd42[0x0]['recallme']?![]:!![];_0x130e1f=_0x5dfd42[0x0][_0x3ed5('0x11a')]?!![]:![];_0x130e1f=_0x574265?!![]:_0x130e1f;}var _0x4c6f99=_0x7b0bea['validateContact'](_0x5dfd42);if(_0x4c6f99[_0x3ed5('0x11b')]){rpcDb[_0x3ed5('0x11c')](_[_0x3ed5('0x115')](_0x5dfd42[0x0],[_0x3ed5('0x79'),_0x3ed5('0x11d')]))[_0x3ed5('0x86')](function(_0x366e95){_0x7b0bea[_0x3ed5('0xff')](_0x366e95,_0x5dfd42[0x0],_0x574265,_0x1bac81,_0x130e1f)['then'](function(_0x3c710a){_0x45cc83(_0x3c710a);})['catch'](function(_0x212393){_0x5b6823(_0x212393);});})[_0x3ed5('0x7d')](function(_0x6eb446){ut[_0x3ed5('0x68')]('[Preview][checkIsBlackList]',_0x6eb446);_0x5b6823(ut['message']('Call\x20unsuccessful',_0x1bac81,_0x130e1f));});}else{_0x5b6823(ut[_0x3ed5('0x51')](_0x4c6f99[_0x3ed5('0x51')],_0x1bac81,_0x130e1f));}})[_0x3ed5('0x7d')](function(_0x20dd51){ut[_0x3ed5('0x68')](_0x3ed5('0x11e'),_0x20dd51);_0x5b6823(ut[_0x3ed5('0x51')](_0x3ed5('0x11f'),![],!![]));});});};Preview[_0x3ed5('0x12')]['validateContact']=function(_0x2e0ffd){if(_[_0x3ed5('0x70')](_0x2e0ffd)||_[_0x3ed5('0x104')](_0x2e0ffd)||!_[_0x3ed5('0x70')](_0x2e0ffd[0x0]['Agent'])&&_['isNil'](_0x2e0ffd[0x0][_0x3ed5('0x8a')][_0x3ed5('0x2c')])){ut['logger'](_0x3ed5('0x120'),_0x2e0ffd);return{'isValid':![],'message':_0x3ed5('0x121')};}var _0x3bf6e6=this[_0x3ed5('0x16')][_0x2e0ffd[0x0][_0x3ed5('0x72')][_0x3ed5('0x2c')]];_0x3bf6e6[_0x3ed5('0x51')]='ACTIVE';if(_['isNil'](_0x3bf6e6)){ut[_0x3ed5('0x68')](_0x3ed5('0x122'),_0x3bf6e6);return{'isValid':![],'message':_0x3ed5('0x123')};}if(!this[_0x3ed5('0x9e')](_0x3bf6e6['Trunk'])){ut[_0x3ed5('0x68')](_0x3ed5('0x124'),_0x3ed5('0x125')+_0x3bf6e6['name']+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x3bf6e6[_0x3ed5('0x126')])){ut[_0x3ed5('0x68')](_0x3ed5('0x124'),_0x3bf6e6[_0x3ed5('0x2c')]+_0x3ed5('0x127'));return{'isValid':![],'message':_0x3ed5('0x128')};}}if(!ut[_0x3ed5('0x9d')](_0x3bf6e6[_0x3ed5('0x39')])){ut[_0x3ed5('0x68')](_0x3ed5('0x129'),_0x3bf6e6['name']+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x3bf6e6[_0x3ed5('0x2c')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x3ed5('0x12a')]=function(_0x189f56,_0xeff8e,_0xbef721,_0x1e6426){var _0x75b0bf=this;return new BPromise(function(_0x2e765c,_0x3f6f56){var _0x371b06=_0x189f56[_0x3ed5('0xb6')];var _0x28319b=_0x75b0bf['isTrunkReachable'](_0xeff8e[_0x3ed5('0x57')])?util['format']('SIP/%s/%s%s',_0xeff8e[_0x3ed5('0x57')]['name'],_['isNil'](_0xeff8e[_0x3ed5('0x3e')])?'':_0xeff8e[_0x3ed5('0x3e')][_0x3ed5('0x12b')]()||'',_0xeff8e[_0x3ed5('0x12c')]>0x0?_0xbef721[_0x3ed5('0x100')][_0x3ed5('0x101')][_0x3ed5('0x12d')](_0xeff8e[_0x3ed5('0x12c')]):_0xbef721[_0x3ed5('0x100')][_0x3ed5('0x101')]):util['format'](_0x3ed5('0x12e'),_[_0x3ed5('0x70')](_0xeff8e[_0x3ed5('0x126')])?_0xeff8e[_0x3ed5('0x57')][_0x3ed5('0x2c')]:_0xeff8e[_0x3ed5('0x126')][_0x3ed5('0x2c')],_[_0x3ed5('0x70')](_0xeff8e[_0x3ed5('0x3e')])?'':_0xeff8e['dialPrefix'][_0x3ed5('0x12b')]()||'',_0xeff8e[_0x3ed5('0x12c')]>0x0?_0xbef721['Contact'][_0x3ed5('0x101')][_0x3ed5('0x12d')](_0xeff8e[_0x3ed5('0x12c')]):_0xbef721[_0x3ed5('0x100')][_0x3ed5('0x101')]);var _0x23110b=_0x75b0bf[_0x3ed5('0x9e')](_0xeff8e[_0x3ed5('0x57')])?ut[_0x3ed5('0x12f')](_0xeff8e[_0x3ed5('0x57')][_0x3ed5('0x130')],_0xeff8e[_0x3ed5('0x3b')],_0xeff8e[_0x3ed5('0x131')]>0x0?ut['getCallerIdRandom'](_0xeff8e[_0x3ed5('0x3c')],_0xeff8e[_0x3ed5('0x131')]):_0xeff8e['dialOriginateCallerIdNumber']):ut['getCallerId'](_['isNil'](_0xeff8e[_0x3ed5('0x126')])?_0xeff8e['Trunk'][_0x3ed5('0x130')]:_0xeff8e[_0x3ed5('0x126')][_0x3ed5('0x130')],_0xeff8e['dialOriginateCallerIdName'],_0xeff8e[_0x3ed5('0x131')]>0x0?ut[_0x3ed5('0x132')](_0xeff8e[_0x3ed5('0x3c')],_0xeff8e['dialRandomLastDigitCallerIdNumber']):_0xeff8e[_0x3ed5('0x3c')]);if(_0x23110b){_0x189f56[_0x3ed5('0x133')]=ut['extractCalleridName'](_0x23110b);_0x189f56['originatecalleridnum']=ut[_0x3ed5('0x134')](_0x23110b);}var _0x46d70d=ut[_0x3ed5('0x135')](_0xeff8e,_0xbef721,_0x28319b,_0x23110b,_0x371b06,_0x189f56);_[_0x3ed5('0x136')](_0x189f56,ut['toLowerVariables'](_0x46d70d));_0x189f56[_0x3ed5('0x137')]=moment()[_0x3ed5('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x3ed5('0x138')](ut[_0x3ed5('0x139')](_0x189f56,_0xeff8e,_0x46d70d,_0x189f56[_0x3ed5('0xb0')],_0x1e6426))[_0x3ed5('0x86')](function(_0x144719){var _0x51984e=_0x189f56['channelAgent'];if(!_[_0x3ed5('0x70')](_0x51984e)){if(!_[_0x3ed5('0x70')](_0x75b0bf[_0x3ed5('0x19')][_0x51984e])){_0x75b0bf[_0x3ed5('0x19')][_0x51984e][_0x3ed5('0x13a')]=_0x189f56['calleridnum'];emit(util[_0x3ed5('0x5b')](_0x3ed5('0x13b'),_0x75b0bf['agents'][_0x51984e][_0x3ed5('0x2c')]),'user:agentconnect',{'destaccountcode':_0x75b0bf['agents'][_0x51984e][_0x3ed5('0x13c')],'destconnectedlinenum':_0x189f56['calleridnum']});}}_0xeff8e[_0x3ed5('0x52')]+=0x1;logger[_0x3ed5('0x5e')](_0x3ed5('0x13d'),_0x371b06,_0x3ed5('0xc2'),_0xeff8e[_0x3ed5('0x2c')],_0x3ed5('0x74'),_0xeff8e[_0x3ed5('0x52')]);_0x2e765c(_0x144719);})[_0x3ed5('0x7d')](function(_0x4726af){ut[_0x3ed5('0xf9')](_0x189f56,0xe,_0x3ed5('0x13e'));rpcDb['createAgentHistory'](_0x189f56,_0x3ed5('0x13f'));_0x3f6f56(_0x4726af);});});};Preview[_0x3ed5('0x12')][_0x3ed5('0x24')]=function(_0xe0fa6b){if(this[_0x3ed5('0x18')][_0xe0fa6b[_0x3ed5('0xb1')]]){this['actions'][_0xe0fa6b[_0x3ed5('0xb1')]][_0x3ed5('0x7c')]=_0xe0fa6b[_0x3ed5('0x7c')];}};Preview['prototype'][_0x3ed5('0x1c')]=function(_0x563acd){var _0x593731=this;var _0x3299ed=this[_0x3ed5('0x18')][_0x563acd[_0x3ed5('0x140')]];if(_0x3299ed){if(_0x3299ed[_0x3ed5('0x103')]&&this['agents'][_0x3299ed['lookAgent']]){ut[_0x3ed5('0x141')](_0x3299ed,this[_0x3ed5('0x19')][_0x3299ed[_0x3ed5('0x103')]][_0x3ed5('0x2c')],this[_0x3ed5('0x19')][_0x3299ed[_0x3ed5('0x103')]]['id']);}var _0x1c3cda=_[_0x3ed5('0x142')](_0x3299ed);_0x1c3cda['responsetime']=moment()[_0x3ed5('0x5b')](_0x3ed5('0x90'));var _0x1df1bd=_0x593731[_0x3ed5('0x16')][_0x3299ed['queue']];if(ut[_0x3ed5('0x143')](_0x563acd['response'])){if(_0x3299ed[_0x3ed5('0xaf')]){rpcDb[_0x3ed5('0x117')](_0x3299ed[_0x3ed5('0x108')]);}if(_0x3299ed[_0x3ed5('0xb0')]){rpcDb[_0x3ed5('0x8f')](_0x3299ed['idContact']);}ami[_0x3ed5('0x29')](_0x3ed5('0x144'),ut[_0x3ed5('0xa5')](_0x3299ed,_0x3ed5('0x145'),this[_0x3ed5('0x16')][_0x3299ed[_0x3ed5('0x73')]]));this[_0x3ed5('0x146')](_0x1c3cda,_0x1df1bd,_0x563acd);}else{_0x3299ed['starttime']=moment()['format'](_0x3ed5('0x90'));ut[_0x3ed5('0xf9')](_0x1c3cda,0x4,_0x3ed5('0x147'));rpcDb[_0x3ed5('0xfa')](_0x1c3cda,_0x3ed5('0x148'));}}};Preview['prototype'][_0x3ed5('0x1f')]=function(_0x534d2e){var _0x5d896e=this;var _0x83398d=this['actions'][_0x534d2e[_0x3ed5('0xb1')]];var _0x7798a0;if(_0x83398d){_0x7798a0=this['campaignsPreview'][_0x83398d[_0x3ed5('0x73')]];logger[_0x3ed5('0x5e')]('[syncHangup][talking]',_0x534d2e['linkedid'],_0x3ed5('0xc2'),_0x7798a0[_0x3ed5('0x2c')],'pTalking:\x20',_0x7798a0['pTalking']);}if(this[_0x3ed5('0x18')][_0x534d2e[_0x3ed5('0xb1')]]&&_0x534d2e[_0x3ed5('0xb1')]!==_0x534d2e[_0x3ed5('0xb6')]){if(_0x534d2e[_0x3ed5('0x149')]==='16'&&this[_0x3ed5('0x18')][_0x534d2e[_0x3ed5('0xb1')]]['dialAnswer']){this[_0x3ed5('0xa0')](_0x534d2e,_0x534d2e['linkedid'],_0x534d2e[_0x3ed5('0x149')]);}else if(this[_0x3ed5('0x18')][_0x534d2e[_0x3ed5('0xb1')]][_0x3ed5('0x76')]){logger[_0x3ed5('0x5e')](_0x3ed5('0x14a'),_0x534d2e[_0x3ed5('0xb1')],_0x534d2e[_0x3ed5('0x149')],_0x3ed5('0xc2'),_0x7798a0['name'],_0x3ed5('0x75'),_0x7798a0[_0x3ed5('0x30')]);this[_0x3ed5('0xa0')](_0x534d2e,_0x534d2e[_0x3ed5('0xb1')],_0x534d2e[_0x3ed5('0x149')]);}}else if(_0x83398d&&_['isNil'](_0x83398d[_0x3ed5('0x14b')])&&_0x7798a0[_0x3ed5('0x14c')]&&_0x534d2e['linkedid']===_0x534d2e[_0x3ed5('0xb6')]&&_[_0x3ed5('0x70')](_0x534d2e['reason'])&&_0x534d2e['cause']==='16'&&_0x534d2e[_0x3ed5('0x14d')]==='6'&&_[_0x3ed5('0xf5')](_0x83398d[_0x3ed5('0x14e')])){if(_0x83398d[_0x3ed5('0xaf')]){rpcDb[_0x3ed5('0x117')](_0x83398d[_0x3ed5('0x108')]);}if(_0x83398d['activeContact']){rpcDb[_0x3ed5('0x8f')](_0x83398d[_0x3ed5('0x108')]);}_0x534d2e['reason']='22';this[_0x3ed5('0x146')](_0x83398d,_0x7798a0,_0x534d2e);}else if(_0x83398d&&_0x83398d[_0x3ed5('0x14e')]){if(_0x534d2e['cause']==='16'&&this[_0x3ed5('0x18')][_0x534d2e[_0x3ed5('0xb1')]][_0x3ed5('0x76')]){logger[_0x3ed5('0x5e')]('[syncHangup][talking][transfer]',_0x534d2e[_0x3ed5('0xb1')],_0x534d2e['cause'],_0x3ed5('0xc2'),_0x7798a0[_0x3ed5('0x2c')],_0x3ed5('0x75'),_0x7798a0[_0x3ed5('0x30')]);this[_0x3ed5('0xa0')](_0x534d2e,_0x534d2e[_0x3ed5('0xb1')],_0x534d2e['cause']);}else if(this['actions'][_0x534d2e[_0x3ed5('0xb1')]]['dialAnswer']){logger[_0x3ed5('0x5e')](_0x3ed5('0x14a'),_0x534d2e['linkedid'],_0x534d2e[_0x3ed5('0x149')],_0x3ed5('0xc2'),_0x7798a0[_0x3ed5('0x2c')],_0x3ed5('0x75'),_0x7798a0['pTalking']);this[_0x3ed5('0xa0')](_0x534d2e,_0x534d2e[_0x3ed5('0xb1')],_0x534d2e['cause']);}}};Preview['prototype'][_0x3ed5('0x22')]=function(_0x8762c){if(this[_0x3ed5('0x18')][_0x8762c[_0x3ed5('0x14f')]]&&_0x8762c[_0x3ed5('0x14f')]!==_0x8762c['destuniqueid']){this['callProgressDetectingCustomer'](_0x8762c,_0x8762c[_0x3ed5('0x14f')],_0x8762c['dialstatus']);}};Preview[_0x3ed5('0x12')][_0x3ed5('0x21')]=function(_0x1d3ce0){if(this['actions'][_0x1d3ce0[_0x3ed5('0xb1')]]&&_0x1d3ce0[_0x3ed5('0xb1')]!==_0x1d3ce0[_0x3ed5('0xb6')]&&!this[_0x3ed5('0x18')][_0x1d3ce0['linkedid']][_0x3ed5('0x76')]){if(_0x1d3ce0[_0x3ed5('0x149')]==='1'){this[_0x3ed5('0xa0')](_0x1d3ce0,_0x1d3ce0[_0x3ed5('0xb1')],_0x1d3ce0['cause']);}}};Preview[_0x3ed5('0x12')][_0x3ed5('0x150')]=function(_0x17504d,_0x27b122,_0x172c6a){if(this[_0x3ed5('0x18')][_0x17504d]){if(_[_0x3ed5('0x70')](this[_0x3ed5('0x18')][_0x17504d]['variables'])){this['actions'][_0x17504d]['variables']={};}this[_0x3ed5('0x18')][_0x17504d][_0x3ed5('0x151')][_0x27b122]=_0x172c6a;}};Preview[_0x3ed5('0x12')][_0x3ed5('0x26')]=function(_0x2667b8){try{if(!_['isNil'](_0x2667b8)){if(ut[_0x3ed5('0x152')](_[_0x3ed5('0x153')](_0x2667b8['variable'])[0x0])){this[_0x3ed5('0x150')](_0x2667b8[_0x3ed5('0xb6')],_['keys'](_0x2667b8[_0x3ed5('0x154')])[0x0],_0x2667b8[_0x3ed5('0x155')]);}}}catch(_0x5cbc54){logger['error'](_0x3ed5('0x156'),util[_0x3ed5('0x157')](_0x5cbc54,{'showHidden':![],'depth':null}));}};Preview[_0x3ed5('0x12')][_0x3ed5('0x158')]=function(_0x51b721){if(_0x51b721){if(this[_0x3ed5('0x18')][_0x51b721[_0x3ed5('0x159')]]){this[_0x3ed5('0x18')][_0x51b721[_0x3ed5('0x159')]][_0x3ed5('0x14e')]=!![];}}};Preview[_0x3ed5('0x12')][_0x3ed5('0x27')]=function(_0x2ebec7){if(_0x2ebec7){if(this[_0x3ed5('0x18')][_0x2ebec7[_0x3ed5('0x15a')]]){this[_0x3ed5('0x18')][_0x2ebec7[_0x3ed5('0x15a')]]['transfer']=!![];}}};module[_0x3ed5('0x15b')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 111e1f5..4c3bc00 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 _0x6dc9=['[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','resolve','then','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','from-sip','exten','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create'];(function(_0x3d5cde,_0x14a795){var _0x4fd53d=function(_0x8598b9){while(--_0x8598b9){_0x3d5cde['push'](_0x3d5cde['shift']());}};_0x4fd53d(++_0x14a795);}(_0x6dc9,0x108));var _0x96dc=function(_0x3bac05,_0xe3556a){_0x3bac05=_0x3bac05-0x0;var _0x5bc64b=_0x6dc9[_0x3bac05];return _0x5bc64b;};'use strict';var util=require(_0x96dc('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require(_0x96dc('0x1'));var cmHopper=require(_0x96dc('0x2'));var cmHopperFinal=require(_0x96dc('0x3'));var cmHopperHistory=require(_0x96dc('0x4'));var cmHopperBlack=require(_0x96dc('0x5'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x96dc('0x6'));var voiceQueueReport=require(_0x96dc('0x7'));function loggerCatch(_0x4f5874){return function(_0x45e167){logger['error'](_0x4f5874,util['inspect'](_0x45e167,{'showHidden':![],'depth':null}));};}function create(_0x5ad5a4){return BPromise[_0x96dc('0x8')]()[_0x96dc('0x9')](cmHopperHistory['createHistory'](_0x5ad5a4))[_0x96dc('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x3c9c79){return BPromise[_0x96dc('0x8')]()[_0x96dc('0x9')](agentReportPreview['createHistory'](_0x3c9c79))['catch'](loggerCatch(_0x96dc('0xb')));}function moveContact(_0x4a8f4c){return BPromise[_0x96dc('0x8')]()['then'](cmHopper[_0x96dc('0xc')](_0x4a8f4c,!![]))[_0x96dc('0xa')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x96dc('0xd')]=function(_0x77693a){return BPromise[_0x96dc('0x8')]()['then'](cmHopperBlack[_0x96dc('0xd')](_0x77693a))['catch'](loggerCatch(_0x96dc('0xe')));};exports[_0x96dc('0xf')]=function(_0x4dd1ea){return BPromise[_0x96dc('0x8')]()[_0x96dc('0x9')](cmHopper['getContactPreview'](_0x4dd1ea))[_0x96dc('0xa')](loggerCatch(_0x96dc('0x10')));};exports['createHistory']=function(_0x52dbcc,_0x1d633b){create(_0x52dbcc)[_0x96dc('0xa')](loggerCatch(_0x1d633b));moveContact(_0x52dbcc)[_0x96dc('0xa')](loggerCatch(_0x1d633b));};exports['createAgentHistory']=function(_0x516858,_0x2a0f0d){createAgent(_0x516858)[_0x96dc('0xa')](loggerCatch(_0x2a0f0d));};exports['createCustomerHistory']=function(_0x40df90,_0x883c25){create(_0x40df90)[_0x96dc('0xa')](loggerCatch(_0x883c25));};exports[_0x96dc('0x11')]=function(_0x82ce2c,_0xa4bfe){moveContact(_0x82ce2c)[_0x96dc('0xa')](loggerCatch(_0xa4bfe));};exports[_0x96dc('0x12')]=function(_0x5b0d1f,_0x4e6853,_0x3723a6){if(_0x4e6853){_0x5b0d1f[_0x96dc('0x13')]=null;}if(_0x3723a6){_0x5b0d1f[_0x96dc('0x14')]=![];}return BPromise[_0x96dc('0x8')]()['then'](cmHopper[_0x96dc('0x12')](_0x5b0d1f))['catch'](loggerCatch(_0x96dc('0x15')));};exports[_0x96dc('0x16')]=function(_0x2804c9){return BPromise[_0x96dc('0x8')]()['then'](cmHopper[_0x96dc('0x16')](_0x2804c9))['catch'](loggerCatch(_0x96dc('0x17')));};exports[_0x96dc('0x18')]=function(_0x578f85){return BPromise[_0x96dc('0x8')]()['then'](cmHopper[_0x96dc('0x18')]({'UserId':null},_0x578f85,0x1))[_0x96dc('0xa')](loggerCatch('[unlockContact]\x20'));};exports[_0x96dc('0x19')]=function(_0x3cbc19){return BPromise[_0x96dc('0x8')]()[_0x96dc('0x9')](cmHopper['unlockContact']({'active':![]},_0x3cbc19,0x1))[_0x96dc('0xa')](loggerCatch(_0x96dc('0x1a')));};exports[_0x96dc('0x1b')]=function(_0x29694a){var _0x24df41={};_0x24df41['type']=_0x29694a[_0x96dc('0x1c')];_0x24df41[_0x96dc('0x1d')]=_0x29694a[_0x96dc('0x1d')];_0x24df41[_0x96dc('0x1e')]=_0x29694a[_0x96dc('0x1e')];_0x24df41[_0x96dc('0x1f')]=_0x29694a[_0x96dc('0x1f')];_0x24df41[_0x96dc('0x20')]=_0x29694a[_0x96dc('0x20')];_0x24df41[_0x96dc('0x21')]=_0x29694a['answertime'];_0x24df41['queuecallerleaveAt']=_0x29694a[_0x96dc('0x22')];_0x24df41[_0x96dc('0x23')]=0x1;_0x24df41[_0x96dc('0x24')]=_0x29694a[_0x96dc('0x25')];_0x24df41[_0x96dc('0x26')]=_0x29694a['membername'];_0x24df41['context']=_0x96dc('0x27');_0x24df41[_0x96dc('0x28')]='xcally-motion-preview';_0x24df41[_0x96dc('0x29')]=0x0;_0x24df41[_0x96dc('0x2a')]=0x1;_0x24df41[_0x96dc('0x2b')]=_0x29694a[_0x96dc('0x2c')];_0x24df41[_0x96dc('0x2d')]=_0x96dc('0x2e');return BPromise[_0x96dc('0x8')]()['then'](voiceQueueReport[_0x96dc('0x2f')](_0x24df41))[_0x96dc('0xa')](loggerCatch(_0x96dc('0x30')));};exports[_0x96dc('0x31')]=function(_0x437637,_0xf17743){return BPromise[_0x96dc('0x8')]()[_0x96dc('0x9')](cmHopper[_0x96dc('0x31')](_0x437637,_0xf17743))[_0x96dc('0xa')](loggerCatch(_0x96dc('0x32')));};exports[_0x96dc('0x33')]=function(_0x5fe538){return BPromise[_0x96dc('0x8')]()[_0x96dc('0x9')](cmHopper[_0x96dc('0x12')](_0x5fe538,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xad8a=['context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername'];(function(_0x56a0f2,_0x3ca569){var _0x2b8341=function(_0xc19de6){while(--_0xc19de6){_0x56a0f2['push'](_0x56a0f2['shift']());}};_0x2b8341(++_0x3ca569);}(_0xad8a,0xc8));var _0xaad8=function(_0x1e41cc,_0x29cfa9){_0x1e41cc=_0x1e41cc-0x0;var _0x530402=_0xad8a[_0x1e41cc];return _0x530402;};'use strict';var util=require(_0xaad8('0x0'));var BPromise=require(_0xaad8('0x1'));var logger=require('../../../config/logger')(_0xaad8('0x2'));var _=require('lodash');var cmHopper=require(_0xaad8('0x3'));var cmHopperFinal=require(_0xaad8('0x4'));var cmHopperHistory=require(_0xaad8('0x5'));var cmHopperBlack=require(_0xaad8('0x6'));var voiceQueueRt=require(_0xaad8('0x7'));var agentReportPreview=require(_0xaad8('0x8'));var voiceQueueReport=require(_0xaad8('0x9'));function loggerCatch(_0x14401d){return function(_0x703ded){logger[_0xaad8('0xa')](_0x14401d,util[_0xaad8('0xb')](_0x703ded,{'showHidden':![],'depth':null}));};}function create(_0x557f65){return BPromise[_0xaad8('0xc')]()[_0xaad8('0xd')](cmHopperHistory[_0xaad8('0xe')](_0x557f65))[_0xaad8('0xf')](loggerCatch(_0xaad8('0x10')));}function createAgent(_0x8a25c9){return BPromise[_0xaad8('0xc')]()[_0xaad8('0xd')](agentReportPreview[_0xaad8('0xe')](_0x8a25c9))[_0xaad8('0xf')](loggerCatch(_0xaad8('0x10')));}function moveContact(_0x47a2c2){return BPromise[_0xaad8('0xc')]()[_0xaad8('0xd')](cmHopper[_0xaad8('0x11')](_0x47a2c2,!![]))[_0xaad8('0xf')](loggerCatch(_0xaad8('0x12')));}exports['checkIsBlackList']=function(_0x4aea6b){return BPromise[_0xaad8('0xc')]()['then'](cmHopperBlack[_0xaad8('0x13')](_0x4aea6b))[_0xaad8('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xaad8('0x14')]=function(_0x94ae3d){return BPromise[_0xaad8('0xc')]()['then'](cmHopper[_0xaad8('0x14')](_0x94ae3d))[_0xaad8('0xf')](loggerCatch(_0xaad8('0x15')));};exports[_0xaad8('0xe')]=function(_0x29d233,_0xde7f0f){create(_0x29d233)['catch'](loggerCatch(_0xde7f0f));moveContact(_0x29d233)[_0xaad8('0xf')](loggerCatch(_0xde7f0f));};exports[_0xaad8('0x16')]=function(_0x17d947,_0x36975b){createAgent(_0x17d947)[_0xaad8('0xf')](loggerCatch(_0x36975b));};exports[_0xaad8('0x17')]=function(_0x5504af,_0x323a5a){create(_0x5504af)[_0xaad8('0xf')](loggerCatch(_0x323a5a));};exports[_0xaad8('0x18')]=function(_0x57c550,_0x4ebef1){moveContact(_0x57c550)[_0xaad8('0xf')](loggerCatch(_0x4ebef1));};exports[_0xaad8('0x19')]=function(_0x578669,_0xa69988,_0x548a67){if(_0xa69988){_0x578669[_0xaad8('0x1a')]=null;}if(_0x548a67){_0x578669[_0xaad8('0x1b')]=![];}return BPromise[_0xaad8('0xc')]()[_0xaad8('0xd')](cmHopper['rescheduleContact'](_0x578669))['catch'](loggerCatch(_0xaad8('0x1c')));};exports[_0xaad8('0x1d')]=function(_0x226a86){return BPromise[_0xaad8('0xc')]()['then'](cmHopper[_0xaad8('0x1d')](_0x226a86))[_0xaad8('0xf')](loggerCatch(_0xaad8('0x1e')));};exports['unlockContact']=function(_0x1382ed){return BPromise[_0xaad8('0xc')]()[_0xaad8('0xd')](cmHopper[_0xaad8('0x1f')]({'UserId':null},_0x1382ed,0x1))[_0xaad8('0xf')](loggerCatch(_0xaad8('0x20')));};exports[_0xaad8('0x21')]=function(_0x2f06d2){return BPromise[_0xaad8('0xc')]()[_0xaad8('0xd')](cmHopper['unlockContact']({'active':![]},_0x2f06d2,0x1))[_0xaad8('0xf')](loggerCatch(_0xaad8('0x22')));};exports[_0xaad8('0x23')]=function(_0x41371f){var _0x298a75={};_0x298a75[_0xaad8('0x24')]=_0x41371f[_0xaad8('0x24')];_0x298a75[_0xaad8('0x25')]=_0x41371f[_0xaad8('0x25')];_0x298a75[_0xaad8('0x26')]=_0x41371f[_0xaad8('0x26')];_0x298a75[_0xaad8('0x27')]=_0x41371f[_0xaad8('0x27')];_0x298a75[_0xaad8('0x28')]=_0x41371f[_0xaad8('0x28')];_0x298a75[_0xaad8('0x29')]=_0x41371f[_0xaad8('0x2a')];_0x298a75[_0xaad8('0x2b')]=_0x41371f[_0xaad8('0x2a')];_0x298a75[_0xaad8('0x2c')]=0x1;_0x298a75[_0xaad8('0x2d')]=_0x41371f[_0xaad8('0x2e')];_0x298a75['connectedlinename']=_0x41371f[_0xaad8('0x2f')];_0x298a75[_0xaad8('0x30')]=_0xaad8('0x31');_0x298a75[_0xaad8('0x32')]=_0xaad8('0x33');_0x298a75[_0xaad8('0x34')]=0x0;_0x298a75[_0xaad8('0x35')]=0x1;_0x298a75[_0xaad8('0x36')]=_0x41371f['membername'];_0x298a75[_0xaad8('0x37')]=_0xaad8('0x38');return BPromise[_0xaad8('0xc')]()[_0xaad8('0xd')](voiceQueueReport['create'](_0x298a75))[_0xaad8('0xf')](loggerCatch(_0xaad8('0x39')));};exports[_0xaad8('0x3a')]=function(_0x58f084,_0xec534d){return BPromise[_0xaad8('0xc')]()['then'](cmHopper[_0xaad8('0x3a')](_0x58f084,_0xec534d))[_0xaad8('0xf')](loggerCatch(_0xaad8('0x3b')));};exports[_0xaad8('0x3c')]=function(_0x3a938f){return BPromise[_0xaad8('0xc')]()[_0xaad8('0xd')](cmHopper[_0xaad8('0x19')](_0x3a938f,!![],!![]))[_0xaad8('0xf')](loggerCatch(_0xaad8('0x3d')));}; \ 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 a81f5ad..cc3eb3d 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 _0x82be=['responsetime','logLookAgent','membername','UserId','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','xcally-motion-preview','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','interface','channelAgent','mandatoryDisposition','queue','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','dialAnswer','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','isNil','createdAt','%s%s','XMD-','toUpper','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','endtime','logAgent'];(function(_0x47d958,_0x2ccf25){var _0x5039b0=function(_0x34b2c5){while(--_0x34b2c5){_0x47d958['push'](_0x47d958['shift']());}};_0x5039b0(++_0x2ccf25);}(_0x82be,0xdb));var _0xe82b=function(_0x35b197,_0x4ffe0d){_0x35b197=_0x35b197-0x0;var _0x1e347b=_0x82be[_0x35b197];return _0x1e347b;};'use strict';var util=require(_0xe82b('0x0'));var _=require(_0xe82b('0x1'));var moment=require(_0xe82b('0x2'));var logger=require(_0xe82b('0x3'))('preview');var ipAgi=process[_0xe82b('0x4')][_0xe82b('0x5')]||_0xe82b('0x6');function getSeconds(_0x31ef2f,_0x2a1cfc){var _0x316e91=moment(_0x31ef2f)[_0xe82b('0x7')](0x0);var _0x2669e5=moment(_0x2a1cfc)[_0xe82b('0x7')](0x0);return _0x316e91[_0xe82b('0x8')](_0x2669e5,_0xe82b('0x9'));}exports[_0xe82b('0xa')]=function(_0x1be76c){return function(_0x38c151){logger[_0xe82b('0xb')](_0x1be76c,util[_0xe82b('0xc')](_0x38c151,{'showHidden':![],'depth':null}));};};exports[_0xe82b('0xd')]=function(_0xb6fecc,_0x4d2876){logger[_0xe82b('0xe')](_0xb6fecc,util[_0xe82b('0xc')](_0x4d2876,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x431e97,_0x4fbb05){logger[_0xe82b('0xb')](_0x431e97,util['inspect'](_0x4fbb05,{'showHidden':![],'depth':null}));};exports[_0xe82b('0xf')]=function(_0x4ddc4a){return function(_0x455b7a){logger['info'](_0x4ddc4a,util[_0xe82b('0xc')](_0x455b7a,{'showHidden':![],'depth':null}));};};exports[_0xe82b('0x10')]=function(_0x3c4335,_0x5b5026,_0x561247){return{'message':_0x3c4335,'unlock':_0x5b5026,'active':_0x561247};};exports[_0xe82b('0x11')]=function(_0x1957e6,_0x557f81,_0xeab3c7){if(!_[_0xe82b('0x12')](_0xeab3c7)&&_0xe82b('0x13')===typeof _0xeab3c7&&!_['isEmpty'](_0xeab3c7)){if(!_[_0xe82b('0x12')](_0x557f81)&&'string'===typeof _0x557f81&&!_[_0xe82b('0x14')](_0x557f81)){return util['format'](_0xe82b('0x15'),_0x557f81,_0xeab3c7);}return util[_0xe82b('0x16')](_0xe82b('0x15'),_0xeab3c7,_0xeab3c7);}if(!_[_0xe82b('0x12')](_0x1957e6)&&_0xe82b('0x13')===typeof _0x1957e6&&!_[_0xe82b('0x14')](_0x1957e6)){return _0x1957e6;}return _0xe82b('0x17');};exports[_0xe82b('0x18')]=function(_0x337fd0){if(_['isNil'](_0x337fd0)){return![];}return _0x337fd0;};exports[_0xe82b('0x19')]=function(_0x3edfff,_0x40ee3f,_0x209267,_0x691a0,_0x28aa4a,_0x2dbf50){var _0x447461={'XMD-QUEUE':_0x40ee3f['Queue']?_0x40ee3f[_0xe82b('0x1a')]['name']:'','XMD-CALLERID':_0x691a0,'XMD-CALLERID-PREVIEW':_0x2dbf50?util[_0xe82b('0x16')](_0xe82b('0x15'),_0x2dbf50[_0xe82b('0x1b')],_0x2dbf50[_0xe82b('0x1c')]):_0x691a0,'XMD-DIALID':_0x28aa4a,'XMD-CONTACTID':_0x40ee3f[_0xe82b('0x1d')],'XMD-CDRTYPE':_0xe82b('0x1e'),'CALLERID(all)':_0x691a0,'XMD-VOICEQUEUEID':_0x40ee3f[_0xe82b('0x1f')],'XMD-DIALCHANNEL':_0x209267,'XMD-DIALTIMEOUT':_0x3edfff[_0xe82b('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0xe82b('0x16')]('\x22rtTxX%s%s\x22',_0x3edfff[_0xe82b('0x21')]?'g':'',_['isEmpty'](_0x3edfff[_0xe82b('0x22')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x3edfff[_0xe82b('0x23')]||'','XMD-AGI':_0x3edfff['dialQueueProject']?util[_0xe82b('0x16')](_0xe82b('0x24'),ipAgi,_0x3edfff[_0xe82b('0x25')]):'NONE','XMD-AGIAFTER':_0x3edfff[_0xe82b('0x21')]?util[_0xe82b('0x16')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3edfff['dialQueueProject2']):_0xe82b('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x2dbf50?_0x2dbf50[_0xe82b('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x2dbf50?_0x2dbf50[_0xe82b('0x28')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x3edfff[_0xe82b('0x22')])){_0x447461[util[_0xe82b('0x16')]('%s',_0xe82b('0x29'))]=_0x3edfff[_0xe82b('0x22')];_0x447461[util[_0xe82b('0x16')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x28aa4a;}if(_0x40ee3f&&_0x40ee3f[_0xe82b('0x2a')]){for(var _0x131a16 in _0x40ee3f['Contact']){if(_0x40ee3f[_0xe82b('0x2a')][_0xe82b('0x2b')](_0x131a16)){if(!_[_0xe82b('0x2c')](_0x40ee3f[_0xe82b('0x2a')][_0x131a16])&&_0x131a16!=='id'&&_0x131a16!=='tags'&&_0x131a16!==_0xe82b('0x2d')&&_0x131a16!=='updatedAt'){_0x447461[util['format'](_0xe82b('0x2e'),_0xe82b('0x2f'),_[_0xe82b('0x30')](_0x131a16))]=_0x40ee3f[_0xe82b('0x2a')][_0x131a16];}}}}return _0x447461;};exports['toLowerVariables']=function(_0x28af13){var _0x48dcae={};for(var _0xba315b in _0x28af13){if(_0x28af13[_0xe82b('0x2b')](_0xba315b)){_0x48dcae[util['format']('%s',_[_0xe82b('0x31')](_0xba315b))]=_0x28af13[_0xba315b];}}return{'variables':_0x48dcae};};exports['updateOriginated']=function(_0x54a3e0,_0x7bf676){if(!_[_0xe82b('0x2c')](_0x54a3e0)){if(_0x54a3e0['hasOwnProperty'](_0xe82b('0x32'))){if(_0x54a3e0[_0xe82b('0x32')]>0x0){_0x54a3e0['originated']-=0x1;}else{logger[_0xe82b('0xb')](_0xe82b('0x33'),_0x7bf676);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x7bf676);}};exports[_0xe82b('0x34')]=function(_0x5f9e19){var _0x13e47e=moment()[_0xe82b('0x16')](_0xe82b('0x35'));_0x5f9e19[_0xe82b('0x36')]=0xd;_0x5f9e19[_0xe82b('0x37')]='Blacklist';_0x5f9e19[_0xe82b('0x38')]=_0x13e47e;_0x5f9e19['responsetime']=_0x13e47e;_0x5f9e19[_0xe82b('0x39')]=_0x13e47e;};exports[_0xe82b('0x3a')]=function(_0x23ca86,_0x5b50cb,_0x29833b){var _0x50ebcf=moment()['format'](_0xe82b('0x35'));_0x23ca86[_0xe82b('0x36')]=_0x5b50cb;_0x23ca86[_0xe82b('0x37')]=_0x29833b;_0x23ca86[_0xe82b('0x3b')]=_0x50ebcf;_0x23ca86['ringtime']=getSeconds(_0x23ca86[_0xe82b('0x3b')],_0x23ca86[_0xe82b('0x38')]);};exports[_0xe82b('0x3c')]=function(_0x2d33e4,_0x1650a7,_0xe26aa4){_0x2d33e4[_0xe82b('0x3d')]=_0x1650a7;_0x2d33e4[_0xe82b('0x3e')]=_0xe26aa4;};exports[_0xe82b('0x3f')]=function(_0xb5f87f,_0x30e3ea,_0x15c333){var _0x5c9799=moment()[_0xe82b('0x16')](_0xe82b('0x35'));_0xb5f87f[_0xe82b('0x36')]=_0x30e3ea;_0xb5f87f['statedesc']=_0x15c333;_0xb5f87f[_0xe82b('0x3b')]=_0xb5f87f[_0xe82b('0x3b')]?_0xb5f87f['responsetime']:_0x5c9799;_0xb5f87f[_0xe82b('0x39')]=_0xb5f87f[_0xe82b('0x39')]?_0xb5f87f[_0xe82b('0x39')]:_0x5c9799;_0xb5f87f[_0xe82b('0x40')]=getSeconds(_0xb5f87f[_0xe82b('0x3b')]||0x0,_0xb5f87f[_0xe82b('0x38')]||0x0);_0xb5f87f[_0xe82b('0x41')]=_0xb5f87f[_0xe82b('0x42')]?getSeconds(_0xb5f87f[_0xe82b('0x39')],_0xb5f87f[_0xe82b('0x42')]):0x0;};exports[_0xe82b('0x43')]=function(_0x1f062e){return _0x1f062e===_0xe82b('0x44');};exports[_0xe82b('0x45')]=function(_0x2512ab,_0x2503b9,_0x1d9dbb,_0x4024cb,_0x2a80ae){var _0x47be18=_0x4024cb?_0xe82b('0x46'):_0x2512ab[_0xe82b('0x1b')];_0x47be18=_0x2a80ae?_0xe82b('0x47'):_0x47be18;return{'actionid':_0x2512ab[_0xe82b('0x48')],'action':_0xe82b('0x49'),'channel':_0x2512ab['channelAgent'],'callerid':util[_0xe82b('0x16')](_0xe82b('0x15'),_0x47be18,_0x2512ab[_0xe82b('0x1c')]),'Exten':_0xe82b('0x4a'),'Context':_0xe82b('0x4b'),'Priority':'1','variable':_0x1d9dbb,'timeout':(_0x2503b9['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2512ab[_0xe82b('0x48')]};};exports['totalGlobal']=function(_0x50563c){return _0x50563c[_0xe82b('0x4c')]+_0x50563c[_0xe82b('0x4d')]+_0x50563c[_0xe82b('0x4e')]+_0x50563c[_0xe82b('0x4f')]+_0x50563c[_0xe82b('0x50')];};exports[_0xe82b('0x51')]=function(_0x1ca5ab){var _0x4c9dc0=_[_0xe82b('0x52')](_0x1ca5ab);_0x4c9dc0[_0xe82b('0x36')]=0xf;_0x4c9dc0[_0xe82b('0x37')]=_0xe82b('0x53');return _0x4c9dc0;};exports[_0xe82b('0x54')]=function(_0x59a41a,_0x3b23b9,_0x15bc9e){var _0x2c0030={};_0x2c0030[_0x3b23b9]=_0x59a41a[_0x3b23b9];_0x2c0030[_0xe82b('0x55')]=![];_0x2c0030['scheduledat']=moment()['add'](_0x15bc9e,'minutes')[_0xe82b('0x16')](_0xe82b('0x35'));_0x2c0030[_0xe82b('0x1d')]=_0x59a41a['ContactId'];_0x2c0030['ListId']=_0x59a41a[_0xe82b('0x56')];_0x2c0030['VoiceQueueId']=_0x59a41a[_0xe82b('0x1f')]||undefined;return _0x2c0030;};exports[_0xe82b('0x57')]=function(_0x25d6b2,_0x2e1a01){if(!_['isNil'](_0x25d6b2)){if(_0x25d6b2[_0xe82b('0x58')]>0x0){_0x25d6b2[_0xe82b('0x58')]-=0x1;}else{logger['error'](_0x2e1a01,_0xe82b('0x59'));}}else{logger['error'](_0x2e1a01,_0xe82b('0x5a'));}};exports[_0xe82b('0x5b')]=function(_0x225a1f){if(_0x225a1f<=0x0){return!![];}return![];};exports[_0xe82b('0x5c')]=function(_0x311832,_0x386f8d,_0x67f6ef){_0x311832[_0xe82b('0x5d')]=_0x386f8d;_0x311832[_0xe82b('0x5e')]=_0x311832['queue'];_0x311832[_0xe82b('0x5f')]=_0x311832[_0xe82b('0x60')];if(_0x67f6ef){_0x311832[_0xe82b('0x61')]=_0x67f6ef[_0xe82b('0x61')];}return _0x311832;};exports['buildAcw']=function(_0x214946){var _0x2b174b={};_0x2b174b[_0xe82b('0x62')]=_0x214946['queue'];_0x2b174b['interface']=_0x214946[_0xe82b('0x60')];_0x2b174b[_0xe82b('0x48')]=_0x214946[_0xe82b('0x48')];return _0x2b174b;};exports['agentReadyId']=function(_0x40739f){var _0x4280d1=[];for(var _0x2f5bd9 in _0x40739f){if(_0x40739f[_0xe82b('0x2b')](_0x2f5bd9)){if(!_[_0xe82b('0x2c')](_0x40739f[_0x2f5bd9])&&_0x40739f[_0x2f5bd9][_0xe82b('0x36')]==='not_inuse'&&_0x40739f[_0x2f5bd9][_0xe82b('0x63')]===_0xe82b('0x64')){_0x4280d1[_0xe82b('0x65')](_0x40739f[_0x2f5bd9]['id']);}}}return _0x4280d1;};exports[_0xe82b('0x66')]=function(_0x35be2a){var _0x2e0c7c=moment()[_0xe82b('0x7')](0x0);var _0x1aaca3=moment(_0x35be2a)[_0xe82b('0x7')](0x0);return _0x2e0c7c[_0xe82b('0x8')](_0x1aaca3,_0xe82b('0x9'));};exports[_0xe82b('0x67')]=function(_0x4cb29a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4cb29a['ContactId'],'ListId':_0x4cb29a[_0xe82b('0x56')],'VoiceQueueId':_0x4cb29a['VoiceQueueId']||undefined,'CampaignId':_0x4cb29a[_0xe82b('0x68')]||undefined};};exports[_0xe82b('0x69')]=function(_0x50e3ef){if(_0x50e3ef===_0xe82b('0x48')||_0x50e3ef===_0xe82b('0x6a')||_0x50e3ef==='queue'||_0x50e3ef==='type'||_0x50e3ef==='campaigntype'||_0x50e3ef===_0xe82b('0x6b')||_0x50e3ef==='membername'||_0x50e3ef===_0xe82b('0x60')||_0x50e3ef===_0xe82b('0x1b')||_0x50e3ef===_0xe82b('0x55')||_0x50e3ef===_0xe82b('0x1c')||_0x50e3ef===_0xe82b('0x6c')||_0x50e3ef===_0xe82b('0x4c')||_0x50e3ef==='countcongestionretry'||_0x50e3ef===_0xe82b('0x4e')||_0x50e3ef===_0xe82b('0x6d')||_0x50e3ef===_0xe82b('0x6e')||_0x50e3ef===_0xe82b('0x6f')||_0x50e3ef===_0xe82b('0x70')||_0x50e3ef===_0xe82b('0x71')||_0x50e3ef===_0xe82b('0x1d')||_0x50e3ef===_0xe82b('0x56')||_0x50e3ef===_0xe82b('0x3e')||_0x50e3ef===_0xe82b('0x1f')||_0x50e3ef==='sipcallid'||_0x50e3ef===_0xe82b('0x72')||_0x50e3ef==='xmd-queue'||_0x50e3ef===_0xe82b('0x73')||_0x50e3ef==='xmd-listid'||_0x50e3ef===_0xe82b('0x74')||_0x50e3ef==='xmd-dialtimeout'||_0x50e3ef===_0xe82b('0x75')||_0x50e3ef==='xmd-dialid'||_0x50e3ef===_0xe82b('0x76')||_0x50e3ef===_0xe82b('0x77')||_0x50e3ef===_0xe82b('0x78')||_0x50e3ef===_0xe82b('0x79')||_0x50e3ef===_0xe82b('0x7a')||_0x50e3ef===_0xe82b('0x7b')||_0x50e3ef==='rtpaudioqos'||_0x50e3ef==='rtpaudioqosbridged'||_0x50e3ef===_0xe82b('0x7c')||_0x50e3ef===_0xe82b('0x7d')||_0x50e3ef===_0xe82b('0x7e')||_0x50e3ef==='rtpaudioqoslossbridged'||_0x50e3ef===_0xe82b('0x7f')||_0x50e3ef===_0xe82b('0x80')||_0x50e3ef==='rtpaudioqos'||_0x50e3ef===_0xe82b('0x81')||_0x50e3ef===_0xe82b('0x7c')||_0x50e3ef===_0xe82b('0x7d')||_0x50e3ef===_0xe82b('0x7e')||_0x50e3ef==='rtpaudioqoslossbridged'||_0x50e3ef===_0xe82b('0x7f')||_0x50e3ef===_0xe82b('0x80')||_0x50e3ef===_0xe82b('0x82')||_0x50e3ef===_0xe82b('0x83')||_0x50e3ef===_0xe82b('0x36')||_0x50e3ef===_0xe82b('0x37')){return![];}return!![];};exports[_0xe82b('0x84')]=function(_0x180ec8,_0x48d5b1){var _0x556db6,_0x166e6f,_0x208072;if(_0x48d5b1<=0x0){_0x48d5b1=0x1;}_0x556db6=new RegExp(_0xe82b('0x85')+_0x48d5b1+'}$');_0x166e6f=Math[_0xe82b('0x86')](0xa,_0x48d5b1-0x1);_0x208072=Math['pow'](0xa,_0x48d5b1)-0x1;return util[_0xe82b('0x16')]('%s',_[_0xe82b('0x87')](_0x180ec8,_0x556db6,_[_0xe82b('0x88')](_0x166e6f,_0x208072)));};exports[_0xe82b('0x89')]=function(_0xe21b2e){var _0x538433=_0xe21b2e[_0xe82b('0x8a')](/"(.*?)"/);return _0x538433?_0x538433[0x1]:_0xe21b2e;};exports['extractCalleridNumber']=function(_0x32d87c){var _0x33d9b2=_0x32d87c['match'](/<(.*?)>/);return _0x33d9b2?_0x33d9b2[0x1]:_0x32d87c;}; \ No newline at end of file +var _0x22d3=['timeout','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','active','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','buildObj','interface','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','idContact','type','dialAnswer','scheduledat','countbusyretry','callback','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger2','info','message','getCallerId','isUndefined','isEmpty','format','string','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','VoiceQueueId','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','%s%s','XMD-','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','logAgent','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','uniqueid','channelAgent','from-sip'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22d3,0xc2));var _0x322d=function(_0x55c00d,_0x520cb6){_0x55c00d=_0x55c00d-0x0;var _0x254a8f=_0x22d3[_0x55c00d];return _0x254a8f;};'use strict';var util=require('util');var _=require(_0x322d('0x0'));var moment=require(_0x322d('0x1'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x322d('0x2')][_0x322d('0x3')]||_0x322d('0x4');function getSeconds(_0x452490,_0x2263cb){var _0x13201b=moment(_0x452490)[_0x322d('0x5')](0x0);var _0x1794b7=moment(_0x2263cb)['milliseconds'](0x0);return _0x13201b[_0x322d('0x6')](_0x1794b7,_0x322d('0x7'));}exports[_0x322d('0x8')]=function(_0x5aa7c3){return function(_0x2f18de){logger[_0x322d('0x9')](_0x5aa7c3,util['inspect'](_0x2f18de,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x40115a,_0x17f0f6){logger['info'](_0x40115a,util[_0x322d('0xa')](_0x17f0f6,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x393b8c,_0x3265e3){logger[_0x322d('0x9')](_0x393b8c,util[_0x322d('0xa')](_0x3265e3,{'showHidden':![],'depth':null}));};exports[_0x322d('0xb')]=function(_0x3e7b53){return function(_0x1f1ca8){logger[_0x322d('0xc')](_0x3e7b53,util[_0x322d('0xa')](_0x1f1ca8,{'showHidden':![],'depth':null}));};};exports[_0x322d('0xd')]=function(_0x32b830,_0x1cf70d,_0x439fd8){return{'message':_0x32b830,'unlock':_0x1cf70d,'active':_0x439fd8};};exports[_0x322d('0xe')]=function(_0x126ca5,_0x36dc0d,_0x5aed1a){if(!_[_0x322d('0xf')](_0x5aed1a)&&'string'===typeof _0x5aed1a&&!_[_0x322d('0x10')](_0x5aed1a)){if(!_[_0x322d('0xf')](_0x36dc0d)&&'string'===typeof _0x36dc0d&&!_[_0x322d('0x10')](_0x36dc0d)){return util[_0x322d('0x11')]('\x22%s\x22\x20<%s>',_0x36dc0d,_0x5aed1a);}return util[_0x322d('0x11')]('\x22%s\x22\x20<%s>',_0x5aed1a,_0x5aed1a);}if(!_['isUndefined'](_0x126ca5)&&_0x322d('0x12')===typeof _0x126ca5&&!_['isEmpty'](_0x126ca5)){return _0x126ca5;}return _0x322d('0x13');};exports[_0x322d('0x14')]=function(_0x241d18){if(_[_0x322d('0x15')](_0x241d18)){return![];}return _0x241d18;};exports[_0x322d('0x16')]=function(_0x3a77f8,_0x457642,_0x1c0202,_0x4394eb,_0x2ca67b,_0x11b405){var _0xdba3cc={'XMD-QUEUE':_0x457642[_0x322d('0x17')]?_0x457642['Queue'][_0x322d('0x18')]:'','XMD-CALLERID':_0x4394eb,'XMD-CALLERID-PREVIEW':_0x11b405?util[_0x322d('0x11')](_0x322d('0x19'),_0x11b405[_0x322d('0x1a')],_0x11b405[_0x322d('0x1b')]):_0x4394eb,'XMD-DIALID':_0x2ca67b,'XMD-CONTACTID':_0x457642[_0x322d('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4394eb,'XMD-VOICEQUEUEID':_0x457642[_0x322d('0x1d')],'XMD-DIALCHANNEL':_0x1c0202,'XMD-DIALTIMEOUT':_0x3a77f8['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x322d('0x11')]('\x22rtTxX%s%s\x22',_0x3a77f8[_0x322d('0x1e')]?'g':'',_[_0x322d('0x10')](_0x3a77f8[_0x322d('0x1f')])?'':_0x322d('0x20')),'XMD-DIALURL':_0x3a77f8['dialPreviewUrl']||'','XMD-AGI':_0x3a77f8[_0x322d('0x21')]?util[_0x322d('0x11')](_0x322d('0x22'),ipAgi,_0x3a77f8[_0x322d('0x21')]):'NONE','XMD-AGIAFTER':_0x3a77f8[_0x322d('0x1e')]?util[_0x322d('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3a77f8['dialQueueProject2']):_0x322d('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x11b405?_0x11b405[_0x322d('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x11b405?_0x11b405[_0x322d('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x3a77f8[_0x322d('0x1f')])){_0xdba3cc[util[_0x322d('0x11')]('%s',_0x322d('0x26'))]=_0x3a77f8[_0x322d('0x1f')];_0xdba3cc[util[_0x322d('0x11')]('%s',_0x322d('0x27'))]=_0x2ca67b;}if(_0x457642&&_0x457642['Contact']){for(var _0x6b516f in _0x457642[_0x322d('0x28')]){if(_0x457642[_0x322d('0x28')][_0x322d('0x29')](_0x6b516f)){if(!_[_0x322d('0x15')](_0x457642['Contact'][_0x6b516f])&&_0x6b516f!=='id'&&_0x6b516f!==_0x322d('0x2a')&&_0x6b516f!=='createdAt'&&_0x6b516f!=='updatedAt'){_0xdba3cc[util[_0x322d('0x11')](_0x322d('0x2b'),_0x322d('0x2c'),_[_0x322d('0x2d')](_0x6b516f))]=_0x457642[_0x322d('0x28')][_0x6b516f];}}}}return _0xdba3cc;};exports['toLowerVariables']=function(_0x548eaa){var _0x9cb772={};for(var _0x48e8d5 in _0x548eaa){if(_0x548eaa['hasOwnProperty'](_0x48e8d5)){_0x9cb772[util[_0x322d('0x11')]('%s',_['toLower'](_0x48e8d5))]=_0x548eaa[_0x48e8d5];}}return{'variables':_0x9cb772};};exports[_0x322d('0x2e')]=function(_0x490361,_0x3331c0){if(!_[_0x322d('0x15')](_0x490361)){if(_0x490361['hasOwnProperty'](_0x322d('0x2f'))){if(_0x490361[_0x322d('0x2f')]>0x0){_0x490361[_0x322d('0x2f')]-=0x1;}else{logger[_0x322d('0x9')](_0x322d('0x30'),_0x3331c0);}}}else{logger[_0x322d('0x9')](_0x322d('0x31'),_0x3331c0);}};exports[_0x322d('0x32')]=function(_0x51874f){var _0x5ccc01=moment()[_0x322d('0x11')](_0x322d('0x33'));_0x51874f[_0x322d('0x34')]=0xd;_0x51874f['statedesc']='Blacklist';_0x51874f[_0x322d('0x35')]=_0x5ccc01;_0x51874f[_0x322d('0x36')]=_0x5ccc01;_0x51874f['endtime']=_0x5ccc01;};exports[_0x322d('0x37')]=function(_0x21fba2,_0x11b25c,_0x504522){var _0x38c2f7=moment()[_0x322d('0x11')](_0x322d('0x33'));_0x21fba2['state']=_0x11b25c;_0x21fba2[_0x322d('0x38')]=_0x504522;_0x21fba2[_0x322d('0x36')]=_0x38c2f7;_0x21fba2[_0x322d('0x39')]=getSeconds(_0x21fba2[_0x322d('0x36')],_0x21fba2[_0x322d('0x35')]);};exports[_0x322d('0x3a')]=function(_0x6d5721,_0x5c55e6,_0x35640c){_0x6d5721[_0x322d('0x3b')]=_0x5c55e6;_0x6d5721[_0x322d('0x3c')]=_0x35640c;};exports[_0x322d('0x3d')]=function(_0xe54eae,_0x3219cb,_0x5d5440){var _0x4a39f3=moment()[_0x322d('0x11')](_0x322d('0x33'));_0xe54eae[_0x322d('0x34')]=_0x3219cb;_0xe54eae[_0x322d('0x38')]=_0x5d5440;_0xe54eae[_0x322d('0x36')]=_0xe54eae['responsetime']?_0xe54eae[_0x322d('0x36')]:_0x4a39f3;_0xe54eae[_0x322d('0x3e')]=_0xe54eae[_0x322d('0x3e')]?_0xe54eae[_0x322d('0x3e')]:_0x4a39f3;_0xe54eae[_0x322d('0x39')]=getSeconds(_0xe54eae[_0x322d('0x36')]||0x0,_0xe54eae[_0x322d('0x35')]||0x0);_0xe54eae[_0x322d('0x3f')]=_0xe54eae[_0x322d('0x40')]?getSeconds(_0xe54eae[_0x322d('0x3e')],_0xe54eae[_0x322d('0x40')]):0x0;};exports[_0x322d('0x41')]=function(_0x3e45bd){return _0x3e45bd===_0x322d('0x42');};exports['variablesAction']=function(_0x2dcee7,_0x5ae8a3,_0x38c4df,_0xcb432f,_0x5b363e){var _0x156136=_0xcb432f?'RECALL':_0x2dcee7[_0x322d('0x1a')];_0x156136=_0x5b363e?'BOOKED':_0x156136;return{'actionid':_0x2dcee7[_0x322d('0x43')],'action':'originate','channel':_0x2dcee7[_0x322d('0x44')],'callerid':util[_0x322d('0x11')](_0x322d('0x19'),_0x156136,_0x2dcee7[_0x322d('0x1b')]),'Exten':'xcally-motion-preview','Context':_0x322d('0x45'),'Priority':'1','variable':_0x38c4df,'timeout':(_0x5ae8a3[_0x322d('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2dcee7[_0x322d('0x43')]};};exports['totalGlobal']=function(_0x3cecde){return _0x3cecde['countbusyretry']+_0x3cecde[_0x322d('0x47')]+_0x3cecde[_0x322d('0x48')]+_0x3cecde[_0x322d('0x49')]+_0x3cecde[_0x322d('0x4a')];};exports[_0x322d('0x4b')]=function(_0x22fd53){var _0x40d6bd=_[_0x322d('0x4c')](_0x22fd53);_0x40d6bd['state']=0xf;_0x40d6bd[_0x322d('0x38')]=_0x322d('0x4d');return _0x40d6bd;};exports['scheduledAt']=function(_0x4d75b4,_0x3b17bd,_0x1d5b74){var _0x478f53={};_0x478f53[_0x3b17bd]=_0x4d75b4[_0x3b17bd];_0x478f53[_0x322d('0x4e')]=![];_0x478f53['scheduledat']=moment()['add'](_0x1d5b74,'minutes')['format'](_0x322d('0x33'));_0x478f53[_0x322d('0x1c')]=_0x4d75b4['ContactId'];_0x478f53[_0x322d('0x4f')]=_0x4d75b4[_0x322d('0x4f')];_0x478f53[_0x322d('0x1d')]=_0x4d75b4[_0x322d('0x1d')]||undefined;return _0x478f53;};exports[_0x322d('0x50')]=function(_0x1cd2ee,_0x24c1ec){if(!_[_0x322d('0x15')](_0x1cd2ee)){if(_0x1cd2ee[_0x322d('0x51')]>0x0){_0x1cd2ee[_0x322d('0x51')]-=0x1;}else{logger[_0x322d('0x9')](_0x24c1ec,_0x322d('0x52'));}}else{logger[_0x322d('0x9')](_0x24c1ec,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x430088){if(_0x430088<=0x0){return!![];}return![];};exports[_0x322d('0x53')]=function(_0x23b674,_0x36d8c1,_0x13b8d7){_0x23b674['lastevent']=_0x36d8c1;_0x23b674[_0x322d('0x18')]=_0x23b674['queue'];_0x23b674[_0x322d('0x54')]=_0x23b674['channelAgent'];if(_0x13b8d7){_0x23b674[_0x322d('0x55')]=_0x13b8d7[_0x322d('0x55')];}return _0x23b674;};exports[_0x322d('0x56')]=function(_0x44d8fd){var _0x4efe77={};_0x4efe77[_0x322d('0x57')]=_0x44d8fd[_0x322d('0x57')];_0x4efe77[_0x322d('0x54')]=_0x44d8fd['channelAgent'];_0x4efe77['uniqueid']=_0x44d8fd['uniqueid'];return _0x4efe77;};exports[_0x322d('0x58')]=function(_0x54b2f4){var _0x3d6619=[];for(var _0x320a23 in _0x54b2f4){if(_0x54b2f4['hasOwnProperty'](_0x320a23)){if(!_[_0x322d('0x15')](_0x54b2f4[_0x320a23])&&_0x54b2f4[_0x320a23][_0x322d('0x34')]===_0x322d('0x59')&&_0x54b2f4[_0x320a23][_0x322d('0x5a')]===_0x322d('0x5b')){_0x3d6619[_0x322d('0x5c')](_0x54b2f4[_0x320a23]['id']);}}}return _0x3d6619;};exports[_0x322d('0x5d')]=function(_0x1ccefd){var _0xe495ce=moment()['milliseconds'](0x0);var _0x574254=moment(_0x1ccefd)[_0x322d('0x5')](0x0);return _0xe495ce[_0x322d('0x6')](_0x574254,_0x322d('0x7'));};exports[_0x322d('0x5e')]=function(_0x19e343){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x19e343[_0x322d('0x1c')],'ListId':_0x19e343[_0x322d('0x4f')],'VoiceQueueId':_0x19e343[_0x322d('0x1d')]||undefined,'CampaignId':_0x19e343[_0x322d('0x5f')]||undefined};};exports['filterKey']=function(_0x345cfc){if(_0x345cfc===_0x322d('0x43')||_0x345cfc===_0x322d('0x60')||_0x345cfc===_0x322d('0x57')||_0x345cfc===_0x322d('0x61')||_0x345cfc==='campaigntype'||_0x345cfc===_0x322d('0x62')||_0x345cfc==='membername'||_0x345cfc==='channelAgent'||_0x345cfc===_0x322d('0x1a')||_0x345cfc===_0x322d('0x4e')||_0x345cfc===_0x322d('0x1b')||_0x345cfc===_0x322d('0x63')||_0x345cfc===_0x322d('0x64')||_0x345cfc===_0x322d('0x47')||_0x345cfc===_0x322d('0x48')||_0x345cfc==='countglobal'||_0x345cfc===_0x322d('0x65')||_0x345cfc==='callbackuniqueid'||_0x345cfc==='callbackat'||_0x345cfc===_0x322d('0x66')||_0x345cfc===_0x322d('0x1c')||_0x345cfc===_0x322d('0x4f')||_0x345cfc===_0x322d('0x3c')||_0x345cfc===_0x322d('0x1d')||_0x345cfc==='sipcallid'||_0x345cfc===_0x322d('0x67')||_0x345cfc==='xmd-queue'||_0x345cfc===_0x322d('0x68')||_0x345cfc===_0x322d('0x69')||_0x345cfc===_0x322d('0x6a')||_0x345cfc===_0x322d('0x6b')||_0x345cfc===_0x322d('0x6c')||_0x345cfc==='xmd-dialid'||_0x345cfc===_0x322d('0x6d')||_0x345cfc===_0x322d('0x6e')||_0x345cfc===_0x322d('0x6f')||_0x345cfc===_0x322d('0x70')||_0x345cfc===_0x322d('0x71')||_0x345cfc===_0x322d('0x72')||_0x345cfc===_0x322d('0x73')||_0x345cfc==='rtpaudioqosbridged'||_0x345cfc===_0x322d('0x74')||_0x345cfc===_0x322d('0x75')||_0x345cfc===_0x322d('0x76')||_0x345cfc==='rtpaudioqoslossbridged'||_0x345cfc==='rtpaudioqosrtt'||_0x345cfc===_0x322d('0x77')||_0x345cfc===_0x322d('0x73')||_0x345cfc==='rtpaudioqosbridged'||_0x345cfc===_0x322d('0x74')||_0x345cfc===_0x322d('0x75')||_0x345cfc===_0x322d('0x76')||_0x345cfc===_0x322d('0x78')||_0x345cfc===_0x322d('0x79')||_0x345cfc===_0x322d('0x77')||_0x345cfc===_0x322d('0x7a')||_0x345cfc===_0x322d('0x7b')||_0x345cfc===_0x322d('0x34')||_0x345cfc==='statedesc'){return![];}return!![];};exports[_0x322d('0x7c')]=function(_0x939353,_0x420e90){var _0x45419a,_0x1fdcd5,_0x4d92d7;if(_0x420e90<=0x0){_0x420e90=0x1;}_0x45419a=new RegExp(_0x322d('0x7d')+_0x420e90+'}$');_0x1fdcd5=Math[_0x322d('0x7e')](0xa,_0x420e90-0x1);_0x4d92d7=Math[_0x322d('0x7e')](0xa,_0x420e90)-0x1;return util['format']('%s',_[_0x322d('0x7f')](_0x939353,_0x45419a,_[_0x322d('0x80')](_0x1fdcd5,_0x4d92d7)));};exports[_0x322d('0x81')]=function(_0x2b8c1c){var _0x2d572e=_0x2b8c1c[_0x322d('0x82')](/"(.*?)"/);return _0x2d572e?_0x2d572e[0x1]:_0x2b8c1c;};exports[_0x322d('0x83')]=function(_0x2a0dc8){var _0x4423f9=_0x2a0dc8[_0x322d('0x82')](/<(.*?)>/);return _0x4423f9?_0x4423f9[0x1]:_0x2a0dc8;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index fba1734..2c6475c 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 _0x2e07=['voicequeuechannel','voicechannel','voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','reload'];(function(_0x35b28f,_0xc83cba){var _0x5603eb=function(_0x513adf){while(--_0x513adf){_0x35b28f['push'](_0x35b28f['shift']());}};_0x5603eb(++_0xc83cba);}(_0x2e07,0x17d));var _0x72e0=function(_0x5285f2,_0x3c71c7){_0x5285f2=_0x5285f2-0x0;var _0x4ddce4=_0x2e07[_0x5285f2];return _0x4ddce4;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x72e0('0x0'),'required':!![]},'membername':{'type':_0x72e0('0x0'),'required':!![]},'penalty':{'type':_0x72e0('0x1'),'required':![]},'paused':{'type':_0x72e0('0x2'),'required':![]}};exports[_0x72e0('0x3')]={'queue':{'type':_0x72e0('0x0'),'required':!![]},'interface':{'type':_0x72e0('0x0'),'required':!![]}};exports[_0x72e0('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x72e0('0x2')},'reason':{'type':_0x72e0('0x0'),'required':![]}};exports[_0x72e0('0x5')]={'module':{'type':'string','required':![]}};exports[_0x72e0('0x6')]={'uniqueid':{'type':_0x72e0('0x0'),'required':!![]}};exports[_0x72e0('0x7')]={'uniqueid':{'type':_0x72e0('0x0'),'required':!![]},'filename':{'type':_0x72e0('0x0')},'format':{'type':_0x72e0('0x0')},'mixmonitorid':{'type':_0x72e0('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x72e0('0x0'),'required':!![]}};exports[_0x72e0('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x72e0('0x0'),'required':!![]},'context':{'type':_0x72e0('0x0')}}; \ No newline at end of file +var _0xd599=['queueadd','string','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x79975,_0x241aa1){var _0x2e4481=function(_0x5eb390){while(--_0x5eb390){_0x79975['push'](_0x79975['shift']());}};_0x2e4481(++_0x241aa1);}(_0xd599,0xc6));var _0x9d59=function(_0x34a1f3,_0x518c98){_0x34a1f3=_0x34a1f3-0x0;var _0x537ac4=_0xd599[_0x34a1f3];return _0x537ac4;};'use strict';exports[_0x9d59('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x9d59('0x1'),'required':!![]},'membername':{'type':_0x9d59('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x9d59('0x2'),'required':![]}};exports[_0x9d59('0x3')]={'queue':{'type':_0x9d59('0x1'),'required':!![]},'interface':{'type':_0x9d59('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0x9d59('0x2')},'reason':{'type':_0x9d59('0x1'),'required':![]}};exports[_0x9d59('0x4')]={'module':{'type':_0x9d59('0x1'),'required':![]}};exports[_0x9d59('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x9d59('0x6')]={'uniqueid':{'type':_0x9d59('0x1'),'required':!![]},'filename':{'type':_0x9d59('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x9d59('0x1')}};exports[_0x9d59('0x7')]={'uniqueid':{'type':_0x9d59('0x1'),'required':!![]}};exports[_0x9d59('0x8')]={'uniqueid':{'type':_0x9d59('0x1'),'required':!![]},'exten':{'type':_0x9d59('0x1'),'required':!![]},'context':{'type':_0x9d59('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index b454bab..5f3fd41 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 _0xd1ca=['hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','ivrAnswerCallsDay','isEmpty','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isUndefined','initTelephones','mergeFromDatabase','initTrunks','voiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','bluebird','util','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','mapKeys'];(function(_0x4ecef4,_0x3a4db0){var _0x11f0a8=function(_0x5fed0e){while(--_0x5fed0e){_0x4ecef4['push'](_0x4ecef4['shift']());}};_0x11f0a8(++_0x3a4db0);}(_0xd1ca,0xb6));var _0xad1c=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xd1ca[_0x68c979];return _0x4f0001;};'use strict';var BPromise=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var _=require('lodash');var moment=require(_0xad1c('0x2'));var Agent=require('../model/agent');var Telephone=require(_0xad1c('0x3'));var Trunk=require(_0xad1c('0x4'));var VoiceQueue=require(_0xad1c('0x5'));var Trigger=require(_0xad1c('0x6'));var Template=require(_0xad1c('0x7'));var Campaign=require(_0xad1c('0x8'));var VoiceExtension=require(_0xad1c('0x9'));var ZendeskAccount=require(_0xad1c('0xa'));var SalesforceAccount=require(_0xad1c('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xad1c('0xc'));var DeskAccount=require(_0xad1c('0xd'));var VtigerAccount=require(_0xad1c('0xe'));var ServicenowAccount=require(_0xad1c('0xf'));var Dynamics365Account=require(_0xad1c('0x10'));var FreshsalesAccount=require(_0xad1c('0x11'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xad1c('0x12')]={};this[_0xad1c('0x13')]={};this[_0xad1c('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0xad1c('0x15')]={};this[_0xad1c('0x16')]={};this[_0xad1c('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xad1c('0x18')]={};this[_0xad1c('0x19')]={};this[_0xad1c('0x1a')]={};this[_0xad1c('0x1b')]={};this[_0xad1c('0x1c')]={};this[_0xad1c('0x1d')]={};this[_0xad1c('0x1e')]={};this['salesforceAccounts']={};this[_0xad1c('0x1f')]={};this[_0xad1c('0x20')]={};this[_0xad1c('0x21')]={};this[_0xad1c('0x22')]={};this['vtigerAccounts']={};this[_0xad1c('0x23')]={};this[_0xad1c('0x24')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x3a9a7e,_0x44bfa1,_0x2c7e64){var _0x57c5d3=_[_0xad1c('0x25')](_0x3a9a7e,function(_0xd059d5,_0x3078a5){return _0xd059d5[_0x2c7e64];});for(var _0x2869db in _0x44bfa1){if(_0x44bfa1[_0xad1c('0x26')](_0x2869db)){if(!_0x57c5d3[_0x2869db]){delete _0x44bfa1[_0x2869db];}}}}function freeIsNotKeySip(_0x410ff3,_0x138798){var _0x550a76=_[_0xad1c('0x25')](_0x410ff3,function(_0x4eb526,_0x1127c6){return util[_0xad1c('0x27')](_0xad1c('0x28'),_0x4eb526[_0xad1c('0x29')]);});for(var _0x17aa85 in _0x138798){if(_0x138798[_0xad1c('0x26')](_0x17aa85)){if(!_0x550a76[_0x17aa85]){delete _0x138798[_0x17aa85];}}}}function freeIsNotKeyAgent(_0x5626f0,_0x2b2da3){var _0x17012f=_[_0xad1c('0x25')](_0x5626f0,function(_0x39c7a8,_0x3df50e){var _0x31f651=_[_0xad1c('0x2a')](_0x39c7a8['interface'])?util['format']('SIP/%s',_0x39c7a8[_0xad1c('0x29')]):_0x39c7a8[_0xad1c('0x2b')];return _0x31f651;});for(var _0x253878 in _0x2b2da3){if(_0x2b2da3[_0xad1c('0x26')](_0x253878)){if(!_0x17012f[_0x253878]){delete _0x2b2da3[_0x253878];}}}}function clearVoiceCallReports(_0x5dae3f){_0x5dae3f[_0xad1c('0x2c')]=0x0;_0x5dae3f[_0xad1c('0x2d')]=0x0;_0x5dae3f[_0xad1c('0x2e')]=0x0;_0x5dae3f[_0xad1c('0x2f')]=0x0;_0x5dae3f['sumBillable']=0x0;}function clearCampaigns(_0x5b9662){if(!_['isEmpty'](_0x5b9662)){for(var _0x59fc45 in _0x5b9662){if(_0x5b9662[_0xad1c('0x26')](_0x59fc45)){_0x5b9662[_0x59fc45]['ivrTotalCallsDays']=0x0;_0x5b9662[_0x59fc45][_0xad1c('0x30')]=0x0;}}}}function clearVoiceQueues(_0x24e8bc){if(!_[_0xad1c('0x31')](_0x24e8bc)){for(var _0x36cfde in _0x24e8bc){if(_0x24e8bc[_0xad1c('0x26')](_0x36cfde)){_0x24e8bc[_0x36cfde][_0xad1c('0x2c')]=0x0;_0x24e8bc[_0x36cfde]['answered']=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x32')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x33')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x2e')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x2f')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x34')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x35')]=0x0;_0x24e8bc[_0x36cfde]['outboundNoAnswerCallsDay']=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x36')]=0x0;_0x24e8bc[_0x36cfde]['outboundCongestionCallsDay']=0x0;_0x24e8bc[_0x36cfde]['outboundNoSuchCallsDay']=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x37')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x38')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x39')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x3a')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x3b')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x3c')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x3d')]=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x35')]=0x0;_0x24e8bc[_0x36cfde]['outboundAnswerCallsDay']=0x0;_0x24e8bc[_0x36cfde][_0xad1c('0x3e')]=!![];}}}}Realtime[_0xad1c('0x3f')]['mergeFromDatabase']=function(_0xb9994b,_0x35af88){for(var _0x5a766c in _0x35af88){if(_0xb9994b['hasOwnProperty'](_0x5a766c)){_0xb9994b[_0x5a766c]=_0x35af88[_0x5a766c];}}};Realtime[_0xad1c('0x3f')]['initAgents']=function(){var _0x4a04a4=this;return function(_0x17c3de){if(_0x17c3de){freeIsNotKeyAgent(_0x17c3de,_0x4a04a4['agents']);for(var _0x421026=0x0,_0x4ed477={},_0x190ba7={};_0x421026<_0x17c3de[_0xad1c('0x40')];_0x421026+=0x1){_0x4ed477=_0x17c3de[_0x421026];var _0x3c1235=_[_0xad1c('0x2a')](_0x4ed477['interface'])?util[_0xad1c('0x27')](_0xad1c('0x28'),_0x4ed477[_0xad1c('0x29')]):_0x4ed477['interface'];if(_[_0xad1c('0x41')](_0x4a04a4['agents'][_0x3c1235])){_0x4a04a4[_0xad1c('0x12')][_0x3c1235]=new Agent(_0x4ed477);}else{_0x4a04a4['mergeFromDatabase'](_0x4a04a4[_0xad1c('0x12')][_0x3c1235],_0x4ed477);}}}return _0x4a04a4['agents'];};};Realtime[_0xad1c('0x3f')][_0xad1c('0x42')]=function(){var _0x28b0a9=this;return function(_0x471db5){if(_0x471db5){freeIsNotKeySip(_0x471db5,_0x28b0a9['telephones']);for(var _0x4e1727=0x0,_0x2a6307={},_0x51fcf4={};_0x4e1727<_0x471db5['length'];_0x4e1727+=0x1){_0x2a6307=_0x471db5[_0x4e1727];if(_[_0xad1c('0x41')](_0x28b0a9[_0xad1c('0x13')][util[_0xad1c('0x27')](_0xad1c('0x28'),_0x2a6307[_0xad1c('0x29')])])){_0x28b0a9[_0xad1c('0x13')][util['format']('SIP/%s',_0x2a6307[_0xad1c('0x29')])]=new Telephone(_0x2a6307);}else{_0x28b0a9[_0xad1c('0x43')](_0x28b0a9[_0xad1c('0x13')][util[_0xad1c('0x27')](_0xad1c('0x28'),_0x2a6307[_0xad1c('0x29')])],_0x2a6307);}}}return _0x28b0a9[_0xad1c('0x13')];};};Realtime['prototype'][_0xad1c('0x44')]=function(){var _0x4643c1=this;return function(_0x5f2559){if(_0x5f2559){freeIsNotKeySip(_0x5f2559,_0x4643c1[_0xad1c('0x14')]);for(var _0x3246e7=0x0,_0x453409={},_0x3006a0={};_0x3246e7<_0x5f2559[_0xad1c('0x40')];_0x3246e7+=0x1){_0x453409=_0x5f2559[_0x3246e7];if(_[_0xad1c('0x41')](_0x4643c1[_0xad1c('0x14')][util[_0xad1c('0x27')](_0xad1c('0x28'),_0x453409['name'])])){_0x4643c1[_0xad1c('0x14')][util['format'](_0xad1c('0x28'),_0x453409[_0xad1c('0x29')])]=new Trunk(_0x453409);}else{_0x4643c1['mergeFromDatabase'](_0x4643c1[_0xad1c('0x14')][util[_0xad1c('0x27')](_0xad1c('0x28'),_0x453409[_0xad1c('0x29')])],_0x453409);}}}return _0x4643c1[_0xad1c('0x14')];};};Realtime[_0xad1c('0x3f')]['initVoiceQueues']=function(){var _0x332ced=this;return function(_0x209efd){if(_0x209efd){freeIsNotKey(_0x209efd,_0x332ced[_0xad1c('0x45')],_0xad1c('0x29'));for(var _0x29a41e=0x0,_0x278aac={},_0x4e5536={};_0x29a41e<_0x209efd[_0xad1c('0x40')];_0x29a41e+=0x1){_0x278aac=_0x209efd[_0x29a41e];if(_[_0xad1c('0x41')](_0x332ced[_0xad1c('0x45')][_0x278aac['name']])){_0x332ced['voiceQueues'][_0x278aac[_0xad1c('0x29')]]=new VoiceQueue(_0x278aac);}else{_0x332ced[_0xad1c('0x43')](_0x332ced[_0xad1c('0x45')][_0x278aac[_0xad1c('0x29')]],_0x278aac);}}}return _0x332ced[_0xad1c('0x45')];};};Realtime[_0xad1c('0x3f')][_0xad1c('0x46')]=function(){var _0x149452=this;return function(_0x31be14){if(_0x31be14){freeIsNotKey(_0x31be14,_0x149452[_0xad1c('0x47')],'id');for(var _0x386eb3=0x0,_0x5b6f89={},_0x497284={};_0x386eb3<_0x31be14[_0xad1c('0x40')];_0x386eb3+=0x1){_0x5b6f89=_0x31be14[_0x386eb3];if(_[_0xad1c('0x41')](_0x149452[_0xad1c('0x47')][_0x5b6f89['id']])){_0x149452['triggers'][_0x5b6f89['id']]=new Trigger(_0x5b6f89);}else{_0x149452['mergeFromDatabase'](_0x149452[_0xad1c('0x47')][_0x5b6f89['id']],_0x5b6f89);}}}return _0x149452[_0xad1c('0x47')];};};Realtime[_0xad1c('0x3f')][_0xad1c('0x48')]=function(){var _0x9c1a1f=this;return function(_0x27b81a){if(_0x27b81a){freeIsNotKey(_0x27b81a,_0x9c1a1f[_0xad1c('0x16')],'id');for(var _0x2ac844=0x0,_0x4ba001={},_0x1d4ec3={};_0x2ac844<_0x27b81a[_0xad1c('0x40')];_0x2ac844+=0x1){_0x4ba001=_0x27b81a[_0x2ac844];if(_[_0xad1c('0x41')](_0x9c1a1f[_0xad1c('0x16')][_0x4ba001['id']])){_0x9c1a1f['templates'][_0x4ba001['id']]=new Template(_0x4ba001);}else{_0x9c1a1f[_0xad1c('0x43')](_0x9c1a1f[_0xad1c('0x16')][_0x4ba001['id']],_0x4ba001);}}}return _0x9c1a1f['templates'];};};Realtime[_0xad1c('0x3f')][_0xad1c('0x49')]=function(){var _0x4b8083=this;return function(_0x4d477b){if(_0x4d477b){freeIsNotKey(_0x4d477b,_0x4b8083[_0xad1c('0x1e')],'id');for(var _0x2a2c12=0x0,_0x1867c8={},_0x5b3e53={};_0x2a2c12<_0x4d477b[_0xad1c('0x40')];_0x2a2c12+=0x1){_0x1867c8=_0x4d477b[_0x2a2c12];if(_[_0xad1c('0x41')](_0x4b8083['zendeskAccounts'][_0x1867c8['id']])){_0x4b8083['zendeskAccounts'][_0x1867c8['id']]=new ZendeskAccount(_0x1867c8);}else{_0x4b8083[_0xad1c('0x43')](_0x4b8083['zendeskAccounts'][_0x1867c8['id']],_0x1867c8);}}}return _0x4b8083[_0xad1c('0x1e')];};};Realtime['prototype'][_0xad1c('0x4a')]=function(){var _0x34bd2f=this;return function(_0x2d6135){if(_0x2d6135){freeIsNotKey(_0x2d6135,_0x34bd2f[_0xad1c('0x4b')],'id');for(var _0x1d32a5=0x0,_0x156c32={},_0x5f1f93={};_0x1d32a5<_0x2d6135[_0xad1c('0x40')];_0x1d32a5+=0x1){_0x156c32=_0x2d6135[_0x1d32a5];if(_[_0xad1c('0x41')](_0x34bd2f[_0xad1c('0x4b')][_0x156c32['id']])){_0x34bd2f['salesforceAccounts'][_0x156c32['id']]=new SalesforceAccount(_0x156c32);}else{_0x34bd2f[_0xad1c('0x43')](_0x34bd2f[_0xad1c('0x4b')][_0x156c32['id']],_0x156c32);}}}return _0x34bd2f[_0xad1c('0x4b')];};};Realtime[_0xad1c('0x3f')][_0xad1c('0x4c')]=function(){var _0x15a312=this;return function(_0x5add5e){if(_0x5add5e){freeIsNotKey(_0x5add5e,_0x15a312[_0xad1c('0x20')],'id');for(var _0x385330=0x0,_0x1fb5d6={},_0x359cdf={};_0x385330<_0x5add5e[_0xad1c('0x40')];_0x385330+=0x1){_0x1fb5d6=_0x5add5e[_0x385330];if(_[_0xad1c('0x41')](_0x15a312['freshdeskAccounts'][_0x1fb5d6['id']])){_0x15a312[_0xad1c('0x20')][_0x1fb5d6['id']]=new FreshdeskAccount(_0x1fb5d6);}else{_0x15a312[_0xad1c('0x43')](_0x15a312[_0xad1c('0x20')][_0x1fb5d6['id']],_0x1fb5d6);}}}return _0x15a312[_0xad1c('0x20')];};};Realtime['prototype'][_0xad1c('0x4d')]=function(){var _0x1e2c24=this;return function(_0x567554){if(_0x567554){freeIsNotKey(_0x567554,_0x1e2c24['zohoAccounts'],'id');for(var _0x5451ad=0x0,_0x35bfcb={},_0x3a2ecd={};_0x5451ad<_0x567554[_0xad1c('0x40')];_0x5451ad+=0x1){_0x35bfcb=_0x567554[_0x5451ad];if(_[_0xad1c('0x41')](_0x1e2c24[_0xad1c('0x21')][_0x35bfcb['id']])){_0x1e2c24[_0xad1c('0x21')][_0x35bfcb['id']]=new ZohoAccount(_0x35bfcb);}else{_0x1e2c24[_0xad1c('0x43')](_0x1e2c24[_0xad1c('0x21')][_0x35bfcb['id']],_0x35bfcb);}}}return _0x1e2c24[_0xad1c('0x21')];};};Realtime[_0xad1c('0x3f')]['initDeskAccounts']=function(){var _0x2dac96=this;return function(_0x788fe2){if(_0x788fe2){freeIsNotKey(_0x788fe2,_0x2dac96[_0xad1c('0x22')],'id');for(var _0x33d2a6=0x0,_0x169862={},_0x51ee4b={};_0x33d2a6<_0x788fe2['length'];_0x33d2a6+=0x1){_0x169862=_0x788fe2[_0x33d2a6];if(_[_0xad1c('0x41')](_0x2dac96[_0xad1c('0x22')][_0x169862['id']])){_0x2dac96[_0xad1c('0x22')][_0x169862['id']]=new DeskAccount(_0x169862);}else{_0x2dac96[_0xad1c('0x43')](_0x2dac96[_0xad1c('0x22')][_0x169862['id']],_0x169862);}}}return _0x2dac96[_0xad1c('0x22')];};};Realtime[_0xad1c('0x3f')][_0xad1c('0x4e')]=function(){var _0x208d0e=this;return function(_0x3b03d5){if(_0x3b03d5){freeIsNotKey(_0x3b03d5,_0x208d0e['sugarcrmAccounts'],'id');for(var _0x4d9c38=0x0,_0x34700e={},_0x213698={};_0x4d9c38<_0x3b03d5[_0xad1c('0x40')];_0x4d9c38+=0x1){_0x34700e=_0x3b03d5[_0x4d9c38];if(_[_0xad1c('0x41')](_0x208d0e[_0xad1c('0x1f')][_0x34700e['id']])){_0x208d0e[_0xad1c('0x1f')][_0x34700e['id']]=new SugarcrmAccount(_0x34700e);}else{_0x208d0e[_0xad1c('0x43')](_0x208d0e[_0xad1c('0x1f')][_0x34700e['id']],_0x34700e);}}}return _0x208d0e[_0xad1c('0x1f')];};};Realtime['prototype'][_0xad1c('0x4f')]=function(){var _0x2856b=this;return function(_0x16ca01){if(_0x16ca01){freeIsNotKey(_0x16ca01,_0x2856b[_0xad1c('0x50')],'id');for(var _0x2b7d6a=0x0,_0x4d56f3={},_0x5c460d={};_0x2b7d6a<_0x16ca01[_0xad1c('0x40')];_0x2b7d6a+=0x1){_0x4d56f3=_0x16ca01[_0x2b7d6a];if(_[_0xad1c('0x41')](_0x2856b['vtigerAccounts'][_0x4d56f3['id']])){_0x2856b['vtigerAccounts'][_0x4d56f3['id']]=new VtigerAccount(_0x4d56f3);}else{_0x2856b[_0xad1c('0x43')](_0x2856b[_0xad1c('0x50')][_0x4d56f3['id']],_0x4d56f3);}}}return _0x2856b[_0xad1c('0x50')];};};Realtime['prototype'][_0xad1c('0x51')]=function(){var _0xc731f6=this;return function(_0x52abd5){if(_0x52abd5){freeIsNotKey(_0x52abd5,_0xc731f6['servicenowAccounts'],'id');for(var _0x3d96df=0x0,_0x44b87d={},_0x205862={};_0x3d96df<_0x52abd5[_0xad1c('0x40')];_0x3d96df+=0x1){_0x44b87d=_0x52abd5[_0x3d96df];if(_['isUndefined'](_0xc731f6[_0xad1c('0x23')][_0x44b87d['id']])){_0xc731f6[_0xad1c('0x23')][_0x44b87d['id']]=new ServicenowAccount(_0x44b87d);}else{_0xc731f6[_0xad1c('0x43')](_0xc731f6[_0xad1c('0x23')][_0x44b87d['id']],_0x44b87d);}}}return _0xc731f6[_0xad1c('0x23')];};};Realtime['prototype'][_0xad1c('0x52')]=function(){var _0x4d0bce=this;return function(_0x372e66){if(_0x372e66){freeIsNotKey(_0x372e66,_0x4d0bce[_0xad1c('0x24')],'id');for(var _0x3e9805=0x0,_0x4e7027={},_0x54ddbf={};_0x3e9805<_0x372e66[_0xad1c('0x40')];_0x3e9805+=0x1){_0x4e7027=_0x372e66[_0x3e9805];if(_[_0xad1c('0x41')](_0x4d0bce[_0xad1c('0x24')][_0x4e7027['id']])){_0x4d0bce[_0xad1c('0x24')][_0x4e7027['id']]=new Dynamics365Account(_0x4e7027);}else{_0x4d0bce['mergeFromDatabase'](_0x4d0bce['dynamics365Accounts'][_0x4e7027['id']],_0x4e7027);}}}return _0x4d0bce['dynamics365Accounts'];};};Realtime[_0xad1c('0x3f')]['initFreshsalesAccounts']=function(){var _0xd99f09=this;return function(_0xfec297){if(_0xfec297){freeIsNotKey(_0xfec297,_0xd99f09[_0xad1c('0x53')],'id');for(var _0x360834=0x0,_0x344545={},_0x12d943={};_0x360834<_0xfec297[_0xad1c('0x40')];_0x360834+=0x1){_0x344545=_0xfec297[_0x360834];if(_[_0xad1c('0x41')](_0xd99f09[_0xad1c('0x53')][_0x344545['id']])){_0xd99f09[_0xad1c('0x53')][_0x344545['id']]=new FreshsalesAccount(_0x344545);}else{_0xd99f09['mergeFromDatabase'](_0xd99f09[_0xad1c('0x53')][_0x344545['id']],_0x344545);}}}return _0xd99f09['freshsalesAccounts'];};};Realtime[_0xad1c('0x3f')][_0xad1c('0x54')]=function(){var _0x68fc9a=this;return function(_0x19aac0){for(var _0x14951f=0x0;_0x14951f<_0x19aac0[_0xad1c('0x40')];_0x14951f+=0x1){_[_0xad1c('0x55')](_0x68fc9a[_0xad1c('0x45')][_0x19aac0[_0x14951f]['name']],_0x19aac0[_0x14951f]);}return _0x68fc9a[_0xad1c('0x45')];};};Realtime['prototype'][_0xad1c('0x56')]=function(){var _0x31fd90=this;return function(_0x3e32b5){clearVoiceQueues(_0x31fd90[_0xad1c('0x45')]);if(_0x3e32b5){_0x3e32b5=_['groupBy'](_0x3e32b5,_0xad1c('0x57'));for(var _0x56e678 in _0x3e32b5){if(_0x3e32b5[_0xad1c('0x26')](_0x56e678)){var _0x3147bf={};for(var _0x1e9b08=0x0;_0x1e9b08<_0x3e32b5[_0x56e678]['length'];_0x1e9b08+=0x1){var _0x469614=_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x58')];if(_0x31fd90['voiceQueues'][_0x469614]){if(_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x59')]){_0x31fd90[_0xad1c('0x45')][_0x469614][_0xad1c('0x32')]+=0x1;}if(_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x5a')]){_0x31fd90['voiceQueues'][_0x469614][_0xad1c('0x33')]+=0x1;}_0x31fd90[_0xad1c('0x45')][_0x469614][_0xad1c('0x2e')]+=moment(_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x5b')])[_0xad1c('0x5c')](moment(_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x5d')]),_0xad1c('0x5e'))||0x0;if(_0x1e9b08===_0x3e32b5[_0x56e678][_0xad1c('0x40')]-0x1){_0x31fd90[_0xad1c('0x45')][_0x469614][_0xad1c('0x2f')]+=moment(_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x5f')]||_0x3e32b5[_0x56e678][_0x1e9b08]['queuecallerabandonAt']||_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x60')])[_0xad1c('0x5c')](moment(_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x5d')]),'seconds')||0x0;_0x31fd90[_0xad1c('0x45')][_0x469614][_0xad1c('0x2c')]+=0x1;if(_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x61')]){_0x31fd90[_0xad1c('0x45')][_0x469614][_0xad1c('0x2d')]+=0x1;_0x31fd90[_0xad1c('0x45')][_0x469614][_0xad1c('0x34')]+=moment(_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x5f')])['diff'](moment(_0x3e32b5[_0x56e678][_0x1e9b08][_0xad1c('0x5b')]),_0xad1c('0x5e'))||0x0;}}else{_0x31fd90[_0xad1c('0x45')][_0x469614][_0xad1c('0x2f')]+=_0x31fd90[_0xad1c('0x45')][_0x469614]['sumHoldTime']||0x0;}}}}}}return _0x31fd90[_0xad1c('0x45')];};};Realtime['prototype'][_0xad1c('0x62')]=function(){var _0x54af6e=this;return function(_0x442b4c){clearVoiceCallReports(_0x54af6e[_0xad1c('0x17')]);if(_0x442b4c){for(var _0x1ba7c6=0x0;_0x1ba7c6<_0x442b4c['length'];_0x1ba7c6+=0x1){_0x54af6e['outbound'][_0xad1c('0x2c')]+=0x1;_0x54af6e[_0xad1c('0x17')][_0xad1c('0x2f')]+=_0x442b4c[_0x1ba7c6][_0xad1c('0x63')];if(_0x442b4c[_0x1ba7c6][_0xad1c('0x64')]===_0xad1c('0x65')){_0x54af6e['outbound'][_0xad1c('0x2d')]+=0x1;_0x54af6e['outbound'][_0xad1c('0x2e')]+=_0x442b4c[_0x1ba7c6][_0xad1c('0x63')]-_0x442b4c[_0x1ba7c6][_0xad1c('0x66')]||0x0;_0x54af6e['outbound'][_0xad1c('0x34')]+=_0x442b4c[_0x1ba7c6][_0xad1c('0x66')];}}}return _0x54af6e[_0xad1c('0x17')];};};Realtime[_0xad1c('0x3f')][_0xad1c('0x67')]=function(){var _0x1a6bfe=this;return function(_0x28176d){if(_0x28176d){freeIsNotKey(_0x28176d,_0x1a6bfe[_0xad1c('0x15')],_0xad1c('0x29'));for(var _0x28041d=0x0,_0x3e66cb={};_0x28041d<_0x28176d['length'];_0x28041d+=0x1){_0x3e66cb=_0x28176d[_0x28041d];if(_[_0xad1c('0x41')](_0x1a6bfe[_0xad1c('0x15')][_0x3e66cb[_0xad1c('0x29')]])){_0x1a6bfe['campaigns'][_0x3e66cb[_0xad1c('0x29')]]=new Campaign(_0x3e66cb);}else{_0x1a6bfe[_0xad1c('0x43')](_0x1a6bfe[_0xad1c('0x15')][_0x3e66cb[_0xad1c('0x29')]],_0x3e66cb);_0x1a6bfe[_0xad1c('0x15')][_0x3e66cb[_0xad1c('0x29')]][_0xad1c('0x68')]=_0x3e66cb[_0xad1c('0x69')]?_0x3e66cb[_0xad1c('0x69')][_0xad1c('0x29')]:undefined;}}}return _0x1a6bfe[_0xad1c('0x15')];};};Realtime['prototype'][_0xad1c('0x6a')]=function(){var _0x67561b=this;return function(_0x21a37c){if(_0x21a37c){freeIsNotKey(_0x21a37c,_0x67561b['voiceExtensions'],'id');for(var _0x5067a5=0x0,_0xd57b6c={};_0x5067a5<_0x21a37c[_0xad1c('0x40')];_0x5067a5+=0x1){_0xd57b6c=_0x21a37c[_0x5067a5];if(_[_0xad1c('0x41')](_0x67561b[_0xad1c('0x18')][_0xd57b6c['id']])){_0x67561b[_0xad1c('0x18')][_0xd57b6c['id']]=new VoiceExtension(_0xd57b6c);}else{_0x67561b[_0xad1c('0x43')](_0x67561b['voiceExtensions'][_0xd57b6c['id']],_0xd57b6c);}}}return _0x67561b['voiceExtensions'];};};Realtime[_0xad1c('0x3f')][_0xad1c('0x6b')]=function(){var _0x20a6ee=this;return function(_0x219940){clearCampaigns(_0x20a6ee[_0xad1c('0x15')]);for(var _0x3579f2=0x0;_0x3579f2<_0x219940[_0xad1c('0x40')];_0x3579f2+=0x1){_[_0xad1c('0x55')](_0x20a6ee[_0xad1c('0x15')][_0x219940[_0x3579f2][_0xad1c('0x29')]],_0x219940[_0x3579f2]);}return _0x20a6ee[_0xad1c('0x15')];};};Realtime[_0xad1c('0x3f')][_0xad1c('0x6c')]=function(){var _0x378a64=this;return function(_0x4c440d){if(_0x4c440d){freeIsNotKey(_0x4c440d,_0x378a64[_0xad1c('0x6d')],'id');for(var _0x3ce7dc=0x0,_0x4d4473={},_0x4fdc93={};_0x3ce7dc<_0x4c440d[_0xad1c('0x40')];_0x3ce7dc+=0x1){_0x4d4473=_0x4c440d[_0x3ce7dc];if(_[_0xad1c('0x41')](_0x378a64['faxAccounts'][_0x4d4473['id']])){_0x378a64[_0xad1c('0x6d')][_0x4d4473['id']]=new FaxAccount(_0x4d4473);}else{_0x378a64[_0xad1c('0x43')](_0x378a64[_0xad1c('0x6d')][_0x4d4473['id']],_0x4d4473);}}}return _0x378a64[_0xad1c('0x6d')];};};module['exports']=Realtime; \ No newline at end of file +var _0xe03e=['../model/faxAccount','agents','telephones','trunks','triggers','campaigns','voiceExtensions','channels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','isNil','interface','format','SIP/%s','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','mergeFromDatabase','prototype','initAgents','length','name','isUndefined','initTelephones','initTrunks','initVoiceQueues','voiceQueues','initTriggers','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','exports','bluebird','util','lodash','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount'];(function(_0x521458,_0xf9ff33){var _0x3f2f16=function(_0x441a76){while(--_0x441a76){_0x521458['push'](_0x521458['shift']());}};_0x3f2f16(++_0xf9ff33);}(_0xe03e,0x19d));var _0xee03=function(_0x42676b,_0x5ff2f2){_0x42676b=_0x42676b-0x0;var _0xc4889=_0xe03e[_0x42676b];return _0xc4889;};'use strict';var BPromise=require(_0xee03('0x0'));var util=require(_0xee03('0x1'));var _=require(_0xee03('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0xee03('0x3'));var Trunk=require(_0xee03('0x4'));var VoiceQueue=require(_0xee03('0x5'));var Trigger=require('../model/trigger');var Template=require(_0xee03('0x6'));var Campaign=require(_0xee03('0x7'));var VoiceExtension=require(_0xee03('0x8'));var ZendeskAccount=require(_0xee03('0x9'));var SalesforceAccount=require(_0xee03('0xa'));var FreshdeskAccount=require(_0xee03('0xb'));var SugarcrmAccount=require(_0xee03('0xc'));var ZohoAccount=require(_0xee03('0xd'));var DeskAccount=require(_0xee03('0xe'));var VtigerAccount=require(_0xee03('0xf'));var ServicenowAccount=require(_0xee03('0x10'));var Dynamics365Account=require(_0xee03('0x11'));var FreshsalesAccount=require(_0xee03('0x12'));var FaxAccount=require(_0xee03('0x13'));var Realtime=function(){this[_0xee03('0x14')]={};this[_0xee03('0x15')]={};this[_0xee03('0x16')]={};this['voiceQueues']={};this[_0xee03('0x17')]={};this[_0xee03('0x18')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xee03('0x19')]={};this[_0xee03('0x1a')]={};this['queueChannels']={};this['outboundChannels']={};this[_0xee03('0x1b')]={};this[_0xee03('0x1c')]={};this[_0xee03('0x1d')]={};this[_0xee03('0x1e')]={};this[_0xee03('0x1f')]={};this[_0xee03('0x20')]={};this[_0xee03('0x21')]={};this[_0xee03('0x22')]={};this[_0xee03('0x23')]={};this[_0xee03('0x24')]={};this[_0xee03('0x25')]={};this[_0xee03('0x26')]={};this[_0xee03('0x27')]={};};function freeIsNotKey(_0x48bbfd,_0x19e177,_0x3bd63f){var _0x4d48ac=_['mapKeys'](_0x48bbfd,function(_0x291490,_0x4b3277){return _0x291490[_0x3bd63f];});for(var _0x1ff78a in _0x19e177){if(_0x19e177[_0xee03('0x28')](_0x1ff78a)){if(!_0x4d48ac[_0x1ff78a]){delete _0x19e177[_0x1ff78a];}}}}function freeIsNotKeySip(_0x4ec287,_0xb83701){var _0x512309=_[_0xee03('0x29')](_0x4ec287,function(_0x53706a,_0x5e6758){return util['format']('SIP/%s',_0x53706a['name']);});for(var _0x5ad571 in _0xb83701){if(_0xb83701[_0xee03('0x28')](_0x5ad571)){if(!_0x512309[_0x5ad571]){delete _0xb83701[_0x5ad571];}}}}function freeIsNotKeyAgent(_0x141e4f,_0x1dd5fd){var _0x32ced4=_[_0xee03('0x29')](_0x141e4f,function(_0x5614d1,_0x528700){var _0x422fcd=_[_0xee03('0x2a')](_0x5614d1[_0xee03('0x2b')])?util[_0xee03('0x2c')](_0xee03('0x2d'),_0x5614d1['name']):_0x5614d1[_0xee03('0x2b')];return _0x422fcd;});for(var _0x3a0868 in _0x1dd5fd){if(_0x1dd5fd[_0xee03('0x28')](_0x3a0868)){if(!_0x32ced4[_0x3a0868]){delete _0x1dd5fd[_0x3a0868];}}}}function clearVoiceCallReports(_0x415ee0){_0x415ee0['total']=0x0;_0x415ee0[_0xee03('0x2e')]=0x0;_0x415ee0[_0xee03('0x2f')]=0x0;_0x415ee0[_0xee03('0x30')]=0x0;_0x415ee0[_0xee03('0x31')]=0x0;}function clearCampaigns(_0x4fedcf){if(!_[_0xee03('0x32')](_0x4fedcf)){for(var _0x57bb61 in _0x4fedcf){if(_0x4fedcf[_0xee03('0x28')](_0x57bb61)){_0x4fedcf[_0x57bb61][_0xee03('0x33')]=0x0;_0x4fedcf[_0x57bb61][_0xee03('0x34')]=0x0;}}}}function clearVoiceQueues(_0x2bc523){if(!_['isEmpty'](_0x2bc523)){for(var _0x29507a in _0x2bc523){if(_0x2bc523[_0xee03('0x28')](_0x29507a)){_0x2bc523[_0x29507a][_0xee03('0x35')]=0x0;_0x2bc523[_0x29507a][_0xee03('0x2e')]=0x0;_0x2bc523[_0x29507a][_0xee03('0x36')]=0x0;_0x2bc523[_0x29507a][_0xee03('0x37')]=0x0;_0x2bc523[_0x29507a]['sumHoldTime']=0x0;_0x2bc523[_0x29507a][_0xee03('0x30')]=0x0;_0x2bc523[_0x29507a][_0xee03('0x31')]=0x0;_0x2bc523[_0x29507a][_0xee03('0x38')]=0x0;_0x2bc523[_0x29507a]['outboundNoAnswerCallsDay']=0x0;_0x2bc523[_0x29507a][_0xee03('0x39')]=0x0;_0x2bc523[_0x29507a]['outboundCongestionCallsDay']=0x0;_0x2bc523[_0x29507a][_0xee03('0x3a')]=0x0;_0x2bc523[_0x29507a][_0xee03('0x3b')]=0x0;_0x2bc523[_0x29507a]['outboundDropCallsDayTimeout']=0x0;_0x2bc523[_0x29507a][_0xee03('0x3c')]=0x0;_0x2bc523[_0x29507a]['outboundBlacklistCallsDay']=0x0;_0x2bc523[_0x29507a][_0xee03('0x3d')]=0x0;_0x2bc523[_0x29507a][_0xee03('0x3e')]=0x0;_0x2bc523[_0x29507a]['outboundReCallsDay']=0x0;_0x2bc523[_0x29507a][_0xee03('0x38')]=0x0;_0x2bc523[_0x29507a]['outboundAnswerCallsDay']=0x0;_0x2bc523[_0x29507a]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0xee03('0x3f')]=function(_0x5b7f43,_0x35e775){for(var _0x1a323f in _0x35e775){if(_0x5b7f43['hasOwnProperty'](_0x1a323f)){_0x5b7f43[_0x1a323f]=_0x35e775[_0x1a323f];}}};Realtime[_0xee03('0x40')][_0xee03('0x41')]=function(){var _0x1007fc=this;return function(_0x3b9403){if(_0x3b9403){freeIsNotKeyAgent(_0x3b9403,_0x1007fc['agents']);for(var _0x59b0e8=0x0,_0x18c54a={},_0x5614a8={};_0x59b0e8<_0x3b9403[_0xee03('0x42')];_0x59b0e8+=0x1){_0x18c54a=_0x3b9403[_0x59b0e8];var _0x327c1c=_[_0xee03('0x2a')](_0x18c54a['interface'])?util[_0xee03('0x2c')](_0xee03('0x2d'),_0x18c54a[_0xee03('0x43')]):_0x18c54a[_0xee03('0x2b')];if(_[_0xee03('0x44')](_0x1007fc[_0xee03('0x14')][_0x327c1c])){_0x1007fc[_0xee03('0x14')][_0x327c1c]=new Agent(_0x18c54a);}else{_0x1007fc[_0xee03('0x3f')](_0x1007fc[_0xee03('0x14')][_0x327c1c],_0x18c54a);}}}return _0x1007fc[_0xee03('0x14')];};};Realtime[_0xee03('0x40')][_0xee03('0x45')]=function(){var _0x1998c2=this;return function(_0xeeb5d0){if(_0xeeb5d0){freeIsNotKeySip(_0xeeb5d0,_0x1998c2['telephones']);for(var _0x2fd52d=0x0,_0x2df74d={},_0x36f306={};_0x2fd52d<_0xeeb5d0['length'];_0x2fd52d+=0x1){_0x2df74d=_0xeeb5d0[_0x2fd52d];if(_['isUndefined'](_0x1998c2['telephones'][util[_0xee03('0x2c')]('SIP/%s',_0x2df74d[_0xee03('0x43')])])){_0x1998c2[_0xee03('0x15')][util[_0xee03('0x2c')](_0xee03('0x2d'),_0x2df74d[_0xee03('0x43')])]=new Telephone(_0x2df74d);}else{_0x1998c2[_0xee03('0x3f')](_0x1998c2['telephones'][util[_0xee03('0x2c')](_0xee03('0x2d'),_0x2df74d[_0xee03('0x43')])],_0x2df74d);}}}return _0x1998c2[_0xee03('0x15')];};};Realtime[_0xee03('0x40')][_0xee03('0x46')]=function(){var _0x30d4ff=this;return function(_0x1a5ced){if(_0x1a5ced){freeIsNotKeySip(_0x1a5ced,_0x30d4ff[_0xee03('0x16')]);for(var _0x5c1a63=0x0,_0x269f35={},_0x5eb8a6={};_0x5c1a63<_0x1a5ced[_0xee03('0x42')];_0x5c1a63+=0x1){_0x269f35=_0x1a5ced[_0x5c1a63];if(_[_0xee03('0x44')](_0x30d4ff[_0xee03('0x16')][util[_0xee03('0x2c')](_0xee03('0x2d'),_0x269f35['name'])])){_0x30d4ff[_0xee03('0x16')][util[_0xee03('0x2c')](_0xee03('0x2d'),_0x269f35['name'])]=new Trunk(_0x269f35);}else{_0x30d4ff[_0xee03('0x3f')](_0x30d4ff[_0xee03('0x16')][util[_0xee03('0x2c')](_0xee03('0x2d'),_0x269f35[_0xee03('0x43')])],_0x269f35);}}}return _0x30d4ff[_0xee03('0x16')];};};Realtime[_0xee03('0x40')][_0xee03('0x47')]=function(){var _0x227862=this;return function(_0x5cbe17){if(_0x5cbe17){freeIsNotKey(_0x5cbe17,_0x227862[_0xee03('0x48')],_0xee03('0x43'));for(var _0xfb247c=0x0,_0x24c739={},_0x8169bf={};_0xfb247c<_0x5cbe17[_0xee03('0x42')];_0xfb247c+=0x1){_0x24c739=_0x5cbe17[_0xfb247c];if(_[_0xee03('0x44')](_0x227862[_0xee03('0x48')][_0x24c739[_0xee03('0x43')]])){_0x227862[_0xee03('0x48')][_0x24c739[_0xee03('0x43')]]=new VoiceQueue(_0x24c739);}else{_0x227862[_0xee03('0x3f')](_0x227862[_0xee03('0x48')][_0x24c739[_0xee03('0x43')]],_0x24c739);}}}return _0x227862['voiceQueues'];};};Realtime['prototype'][_0xee03('0x49')]=function(){var _0x4d4599=this;return function(_0x536724){if(_0x536724){freeIsNotKey(_0x536724,_0x4d4599['triggers'],'id');for(var _0x2b93b1=0x0,_0x152847={},_0x344d94={};_0x2b93b1<_0x536724['length'];_0x2b93b1+=0x1){_0x152847=_0x536724[_0x2b93b1];if(_['isUndefined'](_0x4d4599[_0xee03('0x17')][_0x152847['id']])){_0x4d4599[_0xee03('0x17')][_0x152847['id']]=new Trigger(_0x152847);}else{_0x4d4599[_0xee03('0x3f')](_0x4d4599[_0xee03('0x17')][_0x152847['id']],_0x152847);}}}return _0x4d4599[_0xee03('0x17')];};};Realtime[_0xee03('0x40')]['initTemplates']=function(){var _0x882f2=this;return function(_0x4ff66e){if(_0x4ff66e){freeIsNotKey(_0x4ff66e,_0x882f2[_0xee03('0x4a')],'id');for(var _0x34f9c5=0x0,_0x35a50e={},_0x2fcc2e={};_0x34f9c5<_0x4ff66e[_0xee03('0x42')];_0x34f9c5+=0x1){_0x35a50e=_0x4ff66e[_0x34f9c5];if(_[_0xee03('0x44')](_0x882f2[_0xee03('0x4a')][_0x35a50e['id']])){_0x882f2[_0xee03('0x4a')][_0x35a50e['id']]=new Template(_0x35a50e);}else{_0x882f2[_0xee03('0x3f')](_0x882f2[_0xee03('0x4a')][_0x35a50e['id']],_0x35a50e);}}}return _0x882f2['templates'];};};Realtime['prototype'][_0xee03('0x4b')]=function(){var _0x3fa237=this;return function(_0x2ee887){if(_0x2ee887){freeIsNotKey(_0x2ee887,_0x3fa237[_0xee03('0x1d')],'id');for(var _0x1d4fe4=0x0,_0xea7979={},_0x3ac407={};_0x1d4fe4<_0x2ee887[_0xee03('0x42')];_0x1d4fe4+=0x1){_0xea7979=_0x2ee887[_0x1d4fe4];if(_[_0xee03('0x44')](_0x3fa237[_0xee03('0x1d')][_0xea7979['id']])){_0x3fa237[_0xee03('0x1d')][_0xea7979['id']]=new ZendeskAccount(_0xea7979);}else{_0x3fa237[_0xee03('0x3f')](_0x3fa237['zendeskAccounts'][_0xea7979['id']],_0xea7979);}}}return _0x3fa237['zendeskAccounts'];};};Realtime[_0xee03('0x40')][_0xee03('0x4c')]=function(){var _0x2207b2=this;return function(_0xfd1a66){if(_0xfd1a66){freeIsNotKey(_0xfd1a66,_0x2207b2['salesforceAccounts'],'id');for(var _0x47e46b=0x0,_0x2e7878={},_0x1b2a86={};_0x47e46b<_0xfd1a66[_0xee03('0x42')];_0x47e46b+=0x1){_0x2e7878=_0xfd1a66[_0x47e46b];if(_[_0xee03('0x44')](_0x2207b2[_0xee03('0x1e')][_0x2e7878['id']])){_0x2207b2['salesforceAccounts'][_0x2e7878['id']]=new SalesforceAccount(_0x2e7878);}else{_0x2207b2[_0xee03('0x3f')](_0x2207b2['salesforceAccounts'][_0x2e7878['id']],_0x2e7878);}}}return _0x2207b2[_0xee03('0x1e')];};};Realtime['prototype'][_0xee03('0x4d')]=function(){var _0x2d4739=this;return function(_0x59c537){if(_0x59c537){freeIsNotKey(_0x59c537,_0x2d4739[_0xee03('0x20')],'id');for(var _0x41081b=0x0,_0x9831d1={},_0x389d0c={};_0x41081b<_0x59c537['length'];_0x41081b+=0x1){_0x9831d1=_0x59c537[_0x41081b];if(_[_0xee03('0x44')](_0x2d4739[_0xee03('0x20')][_0x9831d1['id']])){_0x2d4739[_0xee03('0x20')][_0x9831d1['id']]=new FreshdeskAccount(_0x9831d1);}else{_0x2d4739[_0xee03('0x3f')](_0x2d4739[_0xee03('0x20')][_0x9831d1['id']],_0x9831d1);}}}return _0x2d4739[_0xee03('0x20')];};};Realtime[_0xee03('0x40')][_0xee03('0x4e')]=function(){var _0x40c183=this;return function(_0x147535){if(_0x147535){freeIsNotKey(_0x147535,_0x40c183[_0xee03('0x21')],'id');for(var _0x3c9f99=0x0,_0x5d6ed9={},_0x216ad7={};_0x3c9f99<_0x147535[_0xee03('0x42')];_0x3c9f99+=0x1){_0x5d6ed9=_0x147535[_0x3c9f99];if(_[_0xee03('0x44')](_0x40c183[_0xee03('0x21')][_0x5d6ed9['id']])){_0x40c183[_0xee03('0x21')][_0x5d6ed9['id']]=new ZohoAccount(_0x5d6ed9);}else{_0x40c183[_0xee03('0x3f')](_0x40c183['zohoAccounts'][_0x5d6ed9['id']],_0x5d6ed9);}}}return _0x40c183[_0xee03('0x21')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x20c8d2=this;return function(_0x19ae65){if(_0x19ae65){freeIsNotKey(_0x19ae65,_0x20c8d2[_0xee03('0x22')],'id');for(var _0x2dc10f=0x0,_0x339a9c={},_0x1cf5f9={};_0x2dc10f<_0x19ae65[_0xee03('0x42')];_0x2dc10f+=0x1){_0x339a9c=_0x19ae65[_0x2dc10f];if(_[_0xee03('0x44')](_0x20c8d2['deskAccounts'][_0x339a9c['id']])){_0x20c8d2[_0xee03('0x22')][_0x339a9c['id']]=new DeskAccount(_0x339a9c);}else{_0x20c8d2[_0xee03('0x3f')](_0x20c8d2[_0xee03('0x22')][_0x339a9c['id']],_0x339a9c);}}}return _0x20c8d2[_0xee03('0x22')];};};Realtime[_0xee03('0x40')][_0xee03('0x4f')]=function(){var _0x4e8b6a=this;return function(_0x42d808){if(_0x42d808){freeIsNotKey(_0x42d808,_0x4e8b6a[_0xee03('0x1f')],'id');for(var _0x21d5ad=0x0,_0x5edd4f={},_0x4662e9={};_0x21d5ad<_0x42d808[_0xee03('0x42')];_0x21d5ad+=0x1){_0x5edd4f=_0x42d808[_0x21d5ad];if(_['isUndefined'](_0x4e8b6a[_0xee03('0x1f')][_0x5edd4f['id']])){_0x4e8b6a[_0xee03('0x1f')][_0x5edd4f['id']]=new SugarcrmAccount(_0x5edd4f);}else{_0x4e8b6a[_0xee03('0x3f')](_0x4e8b6a[_0xee03('0x1f')][_0x5edd4f['id']],_0x5edd4f);}}}return _0x4e8b6a[_0xee03('0x1f')];};};Realtime[_0xee03('0x40')][_0xee03('0x50')]=function(){var _0x131c01=this;return function(_0x41868a){if(_0x41868a){freeIsNotKey(_0x41868a,_0x131c01[_0xee03('0x23')],'id');for(var _0xb0e230=0x0,_0x10f607={},_0x381390={};_0xb0e230<_0x41868a[_0xee03('0x42')];_0xb0e230+=0x1){_0x10f607=_0x41868a[_0xb0e230];if(_[_0xee03('0x44')](_0x131c01[_0xee03('0x23')][_0x10f607['id']])){_0x131c01['vtigerAccounts'][_0x10f607['id']]=new VtigerAccount(_0x10f607);}else{_0x131c01[_0xee03('0x3f')](_0x131c01[_0xee03('0x23')][_0x10f607['id']],_0x10f607);}}}return _0x131c01[_0xee03('0x23')];};};Realtime[_0xee03('0x40')][_0xee03('0x51')]=function(){var _0x43bfc9=this;return function(_0x141195){if(_0x141195){freeIsNotKey(_0x141195,_0x43bfc9[_0xee03('0x24')],'id');for(var _0x56d495=0x0,_0x4309e5={},_0x59ecd7={};_0x56d495<_0x141195[_0xee03('0x42')];_0x56d495+=0x1){_0x4309e5=_0x141195[_0x56d495];if(_['isUndefined'](_0x43bfc9['servicenowAccounts'][_0x4309e5['id']])){_0x43bfc9[_0xee03('0x24')][_0x4309e5['id']]=new ServicenowAccount(_0x4309e5);}else{_0x43bfc9['mergeFromDatabase'](_0x43bfc9[_0xee03('0x24')][_0x4309e5['id']],_0x4309e5);}}}return _0x43bfc9[_0xee03('0x24')];};};Realtime[_0xee03('0x40')][_0xee03('0x52')]=function(){var _0x50babf=this;return function(_0x27cbaf){if(_0x27cbaf){freeIsNotKey(_0x27cbaf,_0x50babf[_0xee03('0x25')],'id');for(var _0x202dba=0x0,_0x3065ac={},_0x16b726={};_0x202dba<_0x27cbaf['length'];_0x202dba+=0x1){_0x3065ac=_0x27cbaf[_0x202dba];if(_[_0xee03('0x44')](_0x50babf[_0xee03('0x25')][_0x3065ac['id']])){_0x50babf['dynamics365Accounts'][_0x3065ac['id']]=new Dynamics365Account(_0x3065ac);}else{_0x50babf[_0xee03('0x3f')](_0x50babf[_0xee03('0x25')][_0x3065ac['id']],_0x3065ac);}}}return _0x50babf['dynamics365Accounts'];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x185253=this;return function(_0x49fc31){if(_0x49fc31){freeIsNotKey(_0x49fc31,_0x185253[_0xee03('0x26')],'id');for(var _0x22af12=0x0,_0xa74c1={},_0x32fb79={};_0x22af12<_0x49fc31['length'];_0x22af12+=0x1){_0xa74c1=_0x49fc31[_0x22af12];if(_['isUndefined'](_0x185253[_0xee03('0x26')][_0xa74c1['id']])){_0x185253[_0xee03('0x26')][_0xa74c1['id']]=new FreshsalesAccount(_0xa74c1);}else{_0x185253['mergeFromDatabase'](_0x185253[_0xee03('0x26')][_0xa74c1['id']],_0xa74c1);}}}return _0x185253[_0xee03('0x26')];};};Realtime['prototype'][_0xee03('0x53')]=function(){var _0x1f2a13=this;return function(_0x23980c){for(var _0x650272=0x0;_0x650272<_0x23980c[_0xee03('0x42')];_0x650272+=0x1){_[_0xee03('0x54')](_0x1f2a13[_0xee03('0x48')][_0x23980c[_0x650272][_0xee03('0x43')]],_0x23980c[_0x650272]);}return _0x1f2a13[_0xee03('0x48')];};};Realtime['prototype'][_0xee03('0x55')]=function(){var _0x5452f8=this;return function(_0x2049a7){clearVoiceQueues(_0x5452f8[_0xee03('0x48')]);if(_0x2049a7){_0x2049a7=_['groupBy'](_0x2049a7,_0xee03('0x56'));for(var _0xf5facb in _0x2049a7){if(_0x2049a7['hasOwnProperty'](_0xf5facb)){var _0x5e3163={};for(var _0x3d363b=0x0;_0x3d363b<_0x2049a7[_0xf5facb][_0xee03('0x42')];_0x3d363b+=0x1){var _0x2d52e2=_0x2049a7[_0xf5facb][_0x3d363b]['queue'];if(_0x5452f8[_0xee03('0x48')][_0x2d52e2]){if(_0x2049a7[_0xf5facb][_0x3d363b][_0xee03('0x57')]){_0x5452f8[_0xee03('0x48')][_0x2d52e2][_0xee03('0x36')]+=0x1;}if(_0x2049a7[_0xf5facb][_0x3d363b][_0xee03('0x58')]){_0x5452f8[_0xee03('0x48')][_0x2d52e2][_0xee03('0x37')]+=0x1;}_0x5452f8[_0xee03('0x48')][_0x2d52e2][_0xee03('0x2f')]+=moment(_0x2049a7[_0xf5facb][_0x3d363b][_0xee03('0x59')])[_0xee03('0x5a')](moment(_0x2049a7[_0xf5facb][_0x3d363b][_0xee03('0x5b')]),_0xee03('0x5c'))||0x0;if(_0x3d363b===_0x2049a7[_0xf5facb][_0xee03('0x42')]-0x1){_0x5452f8['voiceQueues'][_0x2d52e2][_0xee03('0x30')]+=moment(_0x2049a7[_0xf5facb][_0x3d363b][_0xee03('0x5d')]||_0x2049a7[_0xf5facb][_0x3d363b]['queuecallerabandonAt']||_0x2049a7[_0xf5facb][_0x3d363b][_0xee03('0x5e')])['diff'](moment(_0x2049a7[_0xf5facb][_0x3d363b][_0xee03('0x5b')]),_0xee03('0x5c'))||0x0;_0x5452f8[_0xee03('0x48')][_0x2d52e2][_0xee03('0x35')]+=0x1;if(_0x2049a7[_0xf5facb][_0x3d363b][_0xee03('0x5f')]){_0x5452f8[_0xee03('0x48')][_0x2d52e2]['answered']+=0x1;_0x5452f8[_0xee03('0x48')][_0x2d52e2][_0xee03('0x31')]+=moment(_0x2049a7[_0xf5facb][_0x3d363b][_0xee03('0x5d')])[_0xee03('0x5a')](moment(_0x2049a7[_0xf5facb][_0x3d363b][_0xee03('0x59')]),_0xee03('0x5c'))||0x0;}}else{_0x5452f8[_0xee03('0x48')][_0x2d52e2][_0xee03('0x30')]+=_0x5452f8[_0xee03('0x48')][_0x2d52e2][_0xee03('0x2f')]||0x0;}}}}}}return _0x5452f8[_0xee03('0x48')];};};Realtime['prototype'][_0xee03('0x60')]=function(){var _0x28b0d7=this;return function(_0x559500){clearVoiceCallReports(_0x28b0d7[_0xee03('0x61')]);if(_0x559500){for(var _0x2df19d=0x0;_0x2df19d<_0x559500[_0xee03('0x42')];_0x2df19d+=0x1){_0x28b0d7['outbound'][_0xee03('0x35')]+=0x1;_0x28b0d7['outbound'][_0xee03('0x30')]+=_0x559500[_0x2df19d][_0xee03('0x62')];if(_0x559500[_0x2df19d][_0xee03('0x63')]===_0xee03('0x64')){_0x28b0d7[_0xee03('0x61')][_0xee03('0x2e')]+=0x1;_0x28b0d7[_0xee03('0x61')][_0xee03('0x2f')]+=_0x559500[_0x2df19d][_0xee03('0x62')]-_0x559500[_0x2df19d][_0xee03('0x65')]||0x0;_0x28b0d7['outbound'][_0xee03('0x31')]+=_0x559500[_0x2df19d][_0xee03('0x65')];}}}return _0x28b0d7['outbound'];};};Realtime['prototype'][_0xee03('0x66')]=function(){var _0x49150b=this;return function(_0x5f4a0e){if(_0x5f4a0e){freeIsNotKey(_0x5f4a0e,_0x49150b[_0xee03('0x18')],_0xee03('0x43'));for(var _0x32a5f1=0x0,_0x15083a={};_0x32a5f1<_0x5f4a0e[_0xee03('0x42')];_0x32a5f1+=0x1){_0x15083a=_0x5f4a0e[_0x32a5f1];if(_[_0xee03('0x44')](_0x49150b['campaigns'][_0x15083a[_0xee03('0x43')]])){_0x49150b[_0xee03('0x18')][_0x15083a['name']]=new Campaign(_0x15083a);}else{_0x49150b['mergeFromDatabase'](_0x49150b['campaigns'][_0x15083a[_0xee03('0x43')]],_0x15083a);_0x49150b[_0xee03('0x18')][_0x15083a[_0xee03('0x43')]][_0xee03('0x67')]=_0x15083a[_0xee03('0x68')]?_0x15083a[_0xee03('0x68')][_0xee03('0x43')]:undefined;}}}return _0x49150b[_0xee03('0x18')];};};Realtime['prototype'][_0xee03('0x69')]=function(){var _0x6b55d1=this;return function(_0x216cc9){if(_0x216cc9){freeIsNotKey(_0x216cc9,_0x6b55d1['voiceExtensions'],'id');for(var _0x3bdc2c=0x0,_0x580339={};_0x3bdc2c<_0x216cc9['length'];_0x3bdc2c+=0x1){_0x580339=_0x216cc9[_0x3bdc2c];if(_[_0xee03('0x44')](_0x6b55d1[_0xee03('0x19')][_0x580339['id']])){_0x6b55d1[_0xee03('0x19')][_0x580339['id']]=new VoiceExtension(_0x580339);}else{_0x6b55d1[_0xee03('0x3f')](_0x6b55d1[_0xee03('0x19')][_0x580339['id']],_0x580339);}}}return _0x6b55d1[_0xee03('0x19')];};};Realtime[_0xee03('0x40')][_0xee03('0x6a')]=function(){var _0x4e0bf1=this;return function(_0x581c50){clearCampaigns(_0x4e0bf1['campaigns']);for(var _0x2c8e8f=0x0;_0x2c8e8f<_0x581c50[_0xee03('0x42')];_0x2c8e8f+=0x1){_['merge'](_0x4e0bf1[_0xee03('0x18')][_0x581c50[_0x2c8e8f][_0xee03('0x43')]],_0x581c50[_0x2c8e8f]);}return _0x4e0bf1[_0xee03('0x18')];};};Realtime[_0xee03('0x40')]['initFaxAccounts']=function(){var _0x4605cf=this;return function(_0x428b5f){if(_0x428b5f){freeIsNotKey(_0x428b5f,_0x4605cf[_0xee03('0x27')],'id');for(var _0x51137c=0x0,_0x20009f={},_0x2cc9d1={};_0x51137c<_0x428b5f[_0xee03('0x42')];_0x51137c+=0x1){_0x20009f=_0x428b5f[_0x51137c];if(_[_0xee03('0x44')](_0x4605cf['faxAccounts'][_0x20009f['id']])){_0x4605cf[_0xee03('0x27')][_0x20009f['id']]=new FaxAccount(_0x20009f);}else{_0x4605cf[_0xee03('0x3f')](_0x4605cf[_0xee03('0x27')][_0x20009f['id']],_0x20009f);}}}return _0x4605cf[_0xee03('0x27')];};};module[_0xee03('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index bee4b00..59de623 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 _0xd1c8=['find','accountcode','name','length','assigned','lastAssignedTo','interface','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','from-voip-provider','context','xcally-motion-preview','calleridnum','originatecalleridnum','channel','destinationchannel','callerid','calleridpreview','disposition','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','forEach','Local','substring','indexOf','mobile','phone','isNil','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0xd1c8,0x14f));var _0x8d1c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd1c8[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8d1c('0x0'));var moment=require(_0x8d1c('0x1'));var util=require(_0x8d1c('0x2'));var config=require(_0x8d1c('0x3'));var ami=require(_0x8d1c('0x4'));var RpcVoiceAgentReport=require(_0x8d1c('0x5'));var RpcVoiceCallReport=require(_0x8d1c('0x6'));var RpcVoiceDialReport=require(_0x8d1c('0x7'));var RpcMemberReport=require(_0x8d1c('0x8'));var RpcVoiceQueueReport=require(_0x8d1c('0x9'));var RpcVoiceRecording=require(_0x8d1c('0xa'));var RpcVoiceTransferReport=require(_0x8d1c('0xb'));var VoiceQueueReport=require(_0x8d1c('0xc'));var VoiceCallReport=require(_0x8d1c('0xd'));var VoiceAgentReport=require(_0x8d1c('0xe'));var VoiceDialReport=require(_0x8d1c('0xf'));var UserReport=require(_0x8d1c('0x10'));function Report(_0xc2d933){this[_0x8d1c('0x11')]=_0xc2d933;this[_0x8d1c('0x12')]=_0xc2d933[_0x8d1c('0x12')];this['telephones']=_0xc2d933[_0x8d1c('0x13')];}Report[_0x8d1c('0x14')][_0x8d1c('0x15')]=function(_0x5b0f94){var _0x384e76=new VoiceQueueReport(this[_0x8d1c('0x11')]);var _0x29c715=new VoiceAgentReport(this[_0x8d1c('0x11')]);var _0x643a71=new VoiceDialReport(this[_0x8d1c('0x11')]);var _0x4129c5=new VoiceCallReport(this[_0x8d1c('0x11')]);var _0x2db826=new UserReport(this[_0x8d1c('0x11')]);if(config[_0x8d1c('0x16')]&&config[_0x8d1c('0x16')][_0x8d1c('0x17')]){ami['on'](_0x8d1c('0x18'),this[_0x8d1c('0x19')][_0x8d1c('0x1a')](this));ami['on'](_0x8d1c('0x1b'),this[_0x8d1c('0x1c')][_0x8d1c('0x1a')](this));ami['on'](_0x8d1c('0x1d'),this[_0x8d1c('0x1e')]['bind'](this));ami['on'](_0x8d1c('0x1f'),this[_0x8d1c('0x20')][_0x8d1c('0x1a')](this));ami['on'](_0x8d1c('0x21'),this[_0x8d1c('0x22')][_0x8d1c('0x1a')](this));ami['on'](_0x8d1c('0x23'),this['attendedTransfer'][_0x8d1c('0x1a')](this));}};Report[_0x8d1c('0x14')][_0x8d1c('0x24')]=function(_0x3cf378){var _0x2fdc0e;_0x2fdc0e=_[_0x8d1c('0x25')](this[_0x8d1c('0x12')],function(_0xb5760f){return _0xb5760f[_0x8d1c('0x26')]==_0x3cf378||_0xb5760f[_0x8d1c('0x27')]==_0x3cf378;});if(_['isNil'](_0x2fdc0e)){var _0x3eaa9e=_[_0x8d1c('0x25')](this[_0x8d1c('0x13')],function(_0x479e42){return _0x479e42[_0x8d1c('0x26')]==_0x3cf378||_0x479e42['name']==_0x3cf378;});if(_0x3eaa9e){_0x2fdc0e=_[_0x8d1c('0x25')](this[_0x8d1c('0x12')],function(_0x41343c){return _0x41343c['interface']==util['format']('SIP/%s',_0x3eaa9e['name']);});}}return _0x2fdc0e;};Report[_0x8d1c('0x14')][_0x8d1c('0x19')]=function(_0x5e6fc3){for(var _0x319ac4=0x0;_0x319ac4<_0x5e6fc3[_0x8d1c('0x28')];_0x319ac4+=0x1){var _0x4a6d4b=this['findAgent'](_0x5e6fc3[_0x319ac4]['connectedlinenum']);if(_0x4a6d4b){_0x5e6fc3[_0x319ac4]['accountcode']=_0x4a6d4b[_0x8d1c('0x26')];_0x5e6fc3[_0x319ac4][_0x8d1c('0x29')]=!![];_0x5e6fc3[_0x319ac4][_0x8d1c('0x2a')]=_0x4a6d4b[_0x8d1c('0x27')];_0x5e6fc3[_0x319ac4][_0x8d1c('0x2b')]=_['isNil'](_0x4a6d4b['interface'])?util[_0x8d1c('0x2c')]('SIP/%s',_0x4a6d4b['name']):_0x4a6d4b[_0x8d1c('0x2b')];if(_0x5e6fc3[_0x319ac4][_0x8d1c('0x2d')]){_0x5e6fc3[_0x319ac4][_0x8d1c('0x2e')]=moment()[_0x8d1c('0x2c')](_0x8d1c('0x2f'));}if(_0x5e6fc3[_0x319ac4][_0x8d1c('0x30')]){_0x5e6fc3[_0x319ac4][_0x8d1c('0x31')]=moment()[_0x8d1c('0x2c')](_0x8d1c('0x2f'));}RpcMemberReport[_0x8d1c('0x19')](_0x5e6fc3[_0x319ac4]);}RpcVoiceQueueReport[_0x8d1c('0x32')](_0x5e6fc3[_0x319ac4]);}};function extractCalleridNumber(_0xb8221b){var _0x57e7d3=_0xb8221b[_0x8d1c('0x33')](/<(.*?)>/);return _0x57e7d3?_0x57e7d3[0x1]:_0xb8221b;}Report[_0x8d1c('0x14')][_0x8d1c('0x1c')]=function(_0x377f14){_0x377f14[_0x8d1c('0x34')]=_0x377f14[_0x8d1c('0x34')]||_0x377f14[_0x8d1c('0x35')];if(_0x377f14[_0x8d1c('0x36')]==_0x8d1c('0x37')){_0x377f14[_0x8d1c('0x38')]=_0x8d1c('0x39');_0x377f14['lastdata']=_0x377f14[_0x8d1c('0x39')];if(_0x377f14['context']==_0x8d1c('0x3a')){_0x377f14['accountcode']='';_0x377f14['destination']=extractCalleridNumber(_0x377f14['callerid']);}else if(_0x377f14[_0x8d1c('0x3b')]=='from-sip'){if(_0x377f14[_0x8d1c('0x34')]==_0x8d1c('0x3c')){_0x377f14['destination']=extractCalleridNumber(_0x377f14['calleridpreview']);_0x377f14[_0x8d1c('0x3d')]=_0x377f14[_0x8d1c('0x3e')];_0x377f14['destinationchannel']=[_0x377f14['channel'],_0x377f14[_0x8d1c('0x3f')]=_0x377f14[_0x8d1c('0x40')]][0x0];_0x377f14[_0x8d1c('0x41')]=_0x377f14[_0x8d1c('0x42')];}else{_0x377f14[_0x8d1c('0x34')]=_0x377f14[_0x8d1c('0x3d')];_0x377f14[_0x8d1c('0x3d')]=_0x377f14['originatecalleridnum'];if(_0x377f14[_0x8d1c('0x43')]=='ANSWERED'){_0x377f14[_0x8d1c('0x26')]=_0x377f14[_0x8d1c('0x44')];}else{_0x377f14[_0x8d1c('0x26')]='';}}}}else{_0x377f14[_0x8d1c('0x41')]=util[_0x8d1c('0x2c')](_0x8d1c('0x45'),_0x377f14[_0x8d1c('0x46')],_0x377f14['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0x377f14[_0x8d1c('0x47')]]){var _0x5de107=RpcVoiceTransferReport[_0x8d1c('0x48')][_0x377f14['linkedid']];_0x5de107[_0x8d1c('0x49')]=_0x377f14[_0x8d1c('0x4a')];RpcVoiceTransferReport['blindTransfer'](_0x5de107);delete RpcVoiceTransferReport[_0x8d1c('0x48')][_0x377f14[_0x8d1c('0x47')]];}RpcVoiceCallReport['create'](_0x377f14);if(_0x377f14[_0x8d1c('0x4b')]){for(var _0x1e79b1=0x0;_0x1e79b1<_0x377f14[_0x8d1c('0x4c')]['length'];_0x1e79b1+=0x1){_0x377f14[_0x8d1c('0x4d')]=_0x377f14[_0x8d1c('0x4c')][_0x1e79b1][_0x8d1c('0x4e')];_0x377f14[_0x8d1c('0x4f')]=_0x377f14[_0x8d1c('0x4c')][_0x1e79b1][_0x8d1c('0x4f')];if(_0x377f14['exten']==_0x8d1c('0x3c')){_0x377f14[_0x8d1c('0x3d')]=_0x377f14[_0x8d1c('0x44')];_0x377f14[_0x8d1c('0x46')]=_0x377f14[_0x8d1c('0x50')];_0x377f14[_0x8d1c('0x44')]=_0x377f14['accountcode'];_0x377f14['connectedlinename']=_0x377f14[_0x8d1c('0x51')];_0x377f14['exten']=_0x377f14[_0x8d1c('0x3e')];}else if(_0x377f14[_0x8d1c('0x35')]==_0x8d1c('0x52')){_0x377f14['calleridnum']=_0x377f14[_0x8d1c('0x34')];_0x377f14[_0x8d1c('0x35')]=_0x377f14[_0x8d1c('0x3e')];}RpcVoiceRecording[_0x8d1c('0x32')](_0x377f14);}}};Report[_0x8d1c('0x14')]['voiceAgentReport']=function(_0x4ea253){if(_['isArray'](_0x4ea253)){_0x4ea253[_0x8d1c('0x53')](function(_0xda7a92){RpcVoiceAgentReport['create'](_0xda7a92);});}else{RpcVoiceAgentReport[_0x8d1c('0x32')](_0x4ea253);}};Report[_0x8d1c('0x14')][_0x8d1c('0x20')]=function(_0x381035){RpcVoiceDialReport['create'](_0x381035);var _0x13478f;var _0x483051;var _0x134f99=_0x381035['channel'];if(_['startsWith'](_0x134f99,_0x8d1c('0x54'))){_0x483051=_0x134f99[_0x8d1c('0x55')](_0x134f99[_0x8d1c('0x56')]('/')+0x1,_0x134f99[_0x8d1c('0x56')]('@'));_0x13478f=_['find'](this['agents'],function(_0x31c371){return _0x31c371[_0x8d1c('0x57')]==_0x483051||_0x31c371[_0x8d1c('0x58')]==_0x483051||_0x31c371['accountcode']==_0x483051;});}else{_0x483051=_0x134f99[_0x8d1c('0x55')](_0x134f99[_0x8d1c('0x56')]('/')+0x1,_0x134f99['lastIndexOf']('-'));_0x13478f=this[_0x8d1c('0x24')](_0x483051);}if(_0x13478f){_0x381035[_0x8d1c('0x2b')]=_[_0x8d1c('0x59')](_0x13478f[_0x8d1c('0x2b')])?util[_0x8d1c('0x2c')]('SIP/%s',_0x13478f['name']):_0x13478f[_0x8d1c('0x2b')];_0x381035[_0x8d1c('0x51')]=_0x13478f['name'];_0x381035['accountcode']=_0x13478f[_0x8d1c('0x26')];RpcMemberReport[_0x8d1c('0x20')](_0x381035);}};Report['prototype'][_0x8d1c('0x22')]=function(_0xa58683){RpcVoiceTransferReport[_0x8d1c('0x48')][_0xa58683[_0x8d1c('0x5a')]]=_0xa58683;};Report['prototype'][_0x8d1c('0x5b')]=function(_0x432b4a){RpcVoiceTransferReport[_0x8d1c('0x5b')](_0x432b4a);};module[_0x8d1c('0x5c')]=Report; \ No newline at end of file +var _0xe187=['attendedTransfer','findAgent','find','accountcode','isNil','name','format','prototype','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','create','match','destination','exten','dialer','lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','isArray','forEach','startsWith','Local','indexOf','phone','substring','exports','lodash','moment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer'];(function(_0x268c18,_0x5445de){var _0x590eb4=function(_0x4a89c5){while(--_0x4a89c5){_0x268c18['push'](_0x268c18['shift']());}};_0x590eb4(++_0x5445de);}(_0xe187,0x126));var _0x7e18=function(_0x1fda58,_0x1a691d){_0x1fda58=_0x1fda58-0x0;var _0x3dce0e=_0xe187[_0x1fda58];return _0x3dce0e;};'use strict';var _=require(_0x7e18('0x0'));var moment=require(_0x7e18('0x1'));var util=require('util');var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x7e18('0x2'));var RpcVoiceCallReport=require(_0x7e18('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x7e18('0x4'));var RpcVoiceQueueReport=require(_0x7e18('0x5'));var RpcVoiceRecording=require(_0x7e18('0x6'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x7e18('0x7'));var VoiceCallReport=require(_0x7e18('0x8'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x7e18('0x9'));var UserReport=require(_0x7e18('0xa'));function Report(_0x21bfde){this[_0x7e18('0xb')]=_0x21bfde;this[_0x7e18('0xc')]=_0x21bfde[_0x7e18('0xc')];this[_0x7e18('0xd')]=_0x21bfde[_0x7e18('0xd')];}Report['prototype'][_0x7e18('0xe')]=function(_0x4941b7){var _0x348264=new VoiceQueueReport(this[_0x7e18('0xb')]);var _0x460c18=new VoiceAgentReport(this[_0x7e18('0xb')]);var _0x20e558=new VoiceDialReport(this[_0x7e18('0xb')]);var _0x203c80=new VoiceCallReport(this['realtime']);var _0x219177=new UserReport(this[_0x7e18('0xb')]);if(config['xdr']&&config[_0x7e18('0xf')][_0x7e18('0x10')]){ami['on'](_0x7e18('0x11'),this[_0x7e18('0x12')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0x7e18('0x13')][_0x7e18('0x14')](this));ami['on'](_0x7e18('0x15'),this[_0x7e18('0x16')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0x7e18('0x17')]['bind'](this));ami['on'](_0x7e18('0x18'),this[_0x7e18('0x19')][_0x7e18('0x14')](this));ami['on']('attendedtransfer',this[_0x7e18('0x1a')][_0x7e18('0x14')](this));}};Report['prototype'][_0x7e18('0x1b')]=function(_0x5873cd){var _0x403814;_0x403814=_[_0x7e18('0x1c')](this[_0x7e18('0xc')],function(_0x4f122f){return _0x4f122f[_0x7e18('0x1d')]==_0x5873cd||_0x4f122f['name']==_0x5873cd;});if(_[_0x7e18('0x1e')](_0x403814)){var _0xc3c092=_[_0x7e18('0x1c')](this[_0x7e18('0xd')],function(_0x14d875){return _0x14d875[_0x7e18('0x1d')]==_0x5873cd||_0x14d875[_0x7e18('0x1f')]==_0x5873cd;});if(_0xc3c092){_0x403814=_[_0x7e18('0x1c')](this[_0x7e18('0xc')],function(_0x463466){return _0x463466['interface']==util[_0x7e18('0x20')]('SIP/%s',_0xc3c092[_0x7e18('0x1f')]);});}}return _0x403814;};Report[_0x7e18('0x21')]['voiceQueueReport']=function(_0x2a7d01){for(var _0x1e0c67=0x0;_0x1e0c67<_0x2a7d01[_0x7e18('0x22')];_0x1e0c67+=0x1){var _0x2c5abb=this[_0x7e18('0x1b')](_0x2a7d01[_0x1e0c67][_0x7e18('0x23')]);if(_0x2c5abb){_0x2a7d01[_0x1e0c67][_0x7e18('0x1d')]=_0x2c5abb[_0x7e18('0x1d')];_0x2a7d01[_0x1e0c67][_0x7e18('0x24')]=!![];_0x2a7d01[_0x1e0c67][_0x7e18('0x25')]=_0x2c5abb[_0x7e18('0x1f')];_0x2a7d01[_0x1e0c67]['interface']=_[_0x7e18('0x1e')](_0x2c5abb['interface'])?util[_0x7e18('0x20')]('SIP/%s',_0x2c5abb[_0x7e18('0x1f')]):_0x2c5abb[_0x7e18('0x26')];if(_0x2a7d01[_0x1e0c67][_0x7e18('0x27')]){_0x2a7d01[_0x1e0c67][_0x7e18('0x28')]=moment()[_0x7e18('0x20')](_0x7e18('0x29'));}if(_0x2a7d01[_0x1e0c67]['queuecallerexit']){_0x2a7d01[_0x1e0c67]['queuecallerexitAt']=moment()['format'](_0x7e18('0x29'));}RpcMemberReport['voiceQueueReport'](_0x2a7d01[_0x1e0c67]);}RpcVoiceQueueReport[_0x7e18('0x2a')](_0x2a7d01[_0x1e0c67]);}};function extractCalleridNumber(_0x3d0400){var _0x42d9c0=_0x3d0400[_0x7e18('0x2b')](/<(.*?)>/);return _0x42d9c0?_0x42d9c0[0x1]:_0x3d0400;}Report['prototype'][_0x7e18('0x13')]=function(_0xe8ed45){_0xe8ed45[_0x7e18('0x2c')]=_0xe8ed45[_0x7e18('0x2c')]||_0xe8ed45[_0x7e18('0x2d')];if(_0xe8ed45['type']==_0x7e18('0x2e')){_0xe8ed45[_0x7e18('0x2f')]=_0x7e18('0x30');_0xe8ed45[_0x7e18('0x31')]=_0xe8ed45[_0x7e18('0x30')];if(_0xe8ed45[_0x7e18('0x32')]=='from-voip-provider'){_0xe8ed45['accountcode']='';_0xe8ed45[_0x7e18('0x2c')]=extractCalleridNumber(_0xe8ed45[_0x7e18('0x33')]);}else if(_0xe8ed45['context']==_0x7e18('0x34')){if(_0xe8ed45[_0x7e18('0x2c')]==_0x7e18('0x35')){_0xe8ed45[_0x7e18('0x2c')]=extractCalleridNumber(_0xe8ed45[_0x7e18('0x36')]);_0xe8ed45['calleridnum']=_0xe8ed45[_0x7e18('0x37')];_0xe8ed45[_0x7e18('0x38')]=[_0xe8ed45['channel'],_0xe8ed45[_0x7e18('0x39')]=_0xe8ed45['destinationchannel']][0x0];_0xe8ed45[_0x7e18('0x33')]=_0xe8ed45[_0x7e18('0x36')];}else{_0xe8ed45[_0x7e18('0x2c')]=_0xe8ed45[_0x7e18('0x3a')];_0xe8ed45[_0x7e18('0x3a')]=_0xe8ed45['originatecalleridnum'];if(_0xe8ed45['disposition']==_0x7e18('0x3b')){_0xe8ed45[_0x7e18('0x1d')]=_0xe8ed45['connectedlinenum'];}else{_0xe8ed45[_0x7e18('0x1d')]='';}}}}else{_0xe8ed45[_0x7e18('0x33')]=util[_0x7e18('0x20')](_0x7e18('0x3c'),_0xe8ed45[_0x7e18('0x3d')],_0xe8ed45['calleridnum']);}if(RpcVoiceTransferReport[_0x7e18('0x3e')][_0xe8ed45[_0x7e18('0x3f')]]){var _0x14c924=RpcVoiceTransferReport[_0x7e18('0x3e')][_0xe8ed45['linkedid']];_0x14c924[_0x7e18('0x40')]=_0xe8ed45[_0x7e18('0x41')];RpcVoiceTransferReport[_0x7e18('0x19')](_0x14c924);delete RpcVoiceTransferReport[_0x7e18('0x3e')][_0xe8ed45[_0x7e18('0x3f')]];}RpcVoiceCallReport[_0x7e18('0x2a')](_0xe8ed45);if(_0xe8ed45[_0x7e18('0x42')]){for(var _0x371524=0x0;_0x371524<_0xe8ed45[_0x7e18('0x43')][_0x7e18('0x22')];_0x371524+=0x1){_0xe8ed45[_0x7e18('0x44')]=_0xe8ed45[_0x7e18('0x43')][_0x371524]['filename'];_0xe8ed45['createdAt']=_0xe8ed45['monitors'][_0x371524][_0x7e18('0x45')];if(_0xe8ed45['exten']=='xcally-motion-preview'){_0xe8ed45['calleridnum']=_0xe8ed45[_0x7e18('0x23')];_0xe8ed45[_0x7e18('0x3d')]=_0xe8ed45[_0x7e18('0x46')];_0xe8ed45['connectedlinenum']=_0xe8ed45['accountcode'];_0xe8ed45[_0x7e18('0x46')]=_0xe8ed45[_0x7e18('0x47')];_0xe8ed45[_0x7e18('0x2d')]=_0xe8ed45[_0x7e18('0x37')];}else if(_0xe8ed45[_0x7e18('0x2d')]=='xcally-motion-dialer'){_0xe8ed45[_0x7e18('0x3a')]=_0xe8ed45[_0x7e18('0x2c')];_0xe8ed45[_0x7e18('0x2d')]=_0xe8ed45[_0x7e18('0x37')];}RpcVoiceRecording[_0x7e18('0x2a')](_0xe8ed45);}}};Report[_0x7e18('0x21')][_0x7e18('0x16')]=function(_0x1a7da2){if(_[_0x7e18('0x48')](_0x1a7da2)){_0x1a7da2[_0x7e18('0x49')](function(_0x57ba36){RpcVoiceAgentReport[_0x7e18('0x2a')](_0x57ba36);});}else{RpcVoiceAgentReport[_0x7e18('0x2a')](_0x1a7da2);}};Report[_0x7e18('0x21')][_0x7e18('0x17')]=function(_0x26166e){RpcVoiceDialReport[_0x7e18('0x2a')](_0x26166e);var _0x393a21;var _0x4ba8f5;var _0x56ad19=_0x26166e[_0x7e18('0x39')];if(_[_0x7e18('0x4a')](_0x56ad19,_0x7e18('0x4b'))){_0x4ba8f5=_0x56ad19['substring'](_0x56ad19[_0x7e18('0x4c')]('/')+0x1,_0x56ad19[_0x7e18('0x4c')]('@'));_0x393a21=_[_0x7e18('0x1c')](this[_0x7e18('0xc')],function(_0x39aabf){return _0x39aabf['mobile']==_0x4ba8f5||_0x39aabf[_0x7e18('0x4d')]==_0x4ba8f5||_0x39aabf[_0x7e18('0x1d')]==_0x4ba8f5;});}else{_0x4ba8f5=_0x56ad19[_0x7e18('0x4e')](_0x56ad19['indexOf']('/')+0x1,_0x56ad19['lastIndexOf']('-'));_0x393a21=this['findAgent'](_0x4ba8f5);}if(_0x393a21){_0x26166e[_0x7e18('0x26')]=_[_0x7e18('0x1e')](_0x393a21[_0x7e18('0x26')])?util[_0x7e18('0x20')]('SIP/%s',_0x393a21[_0x7e18('0x1f')]):_0x393a21[_0x7e18('0x26')];_0x26166e[_0x7e18('0x47')]=_0x393a21[_0x7e18('0x1f')];_0x26166e[_0x7e18('0x1d')]=_0x393a21['accountcode'];RpcMemberReport[_0x7e18('0x17')](_0x26166e);}};Report[_0x7e18('0x21')][_0x7e18('0x19')]=function(_0x413ef4){RpcVoiceTransferReport[_0x7e18('0x3e')][_0x413ef4['transfererlinkedid']]=_0x413ef4;};Report[_0x7e18('0x21')][_0x7e18('0x1a')]=function(_0x2efd4c){RpcVoiceTransferReport[_0x7e18('0x1a')](_0x2efd4c);};module[_0x7e18('0x4f')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index b6c6ab2..6bad09d 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39af=['toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','mobile','phone','accountcode','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','util','bluebird','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','trunks','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','syncPeerStatus','resolve','then','actionSipShowRegistry','catch','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','error','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','state','[userReport][registry]','find','username','omit','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','agents','local'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x39af,0xea));var _0xf39a=function(_0x4568d4,_0x4a2a2b){_0x4568d4=_0x4568d4-0x0;var _0x4ec0ee=_0x39af[_0x4568d4];return _0x4ec0ee;};'use strict';var _=require(_0xf39a('0x0'));var moment=require('moment');var util=require(_0xf39a('0x1'));var Redis=require('ioredis');var BPromise=require(_0xf39a('0x2'));var config=require(_0xf39a('0x3'));var logger=require(_0xf39a('0x4'))('ami');var ami=require(_0xf39a('0x5'));config['redis']=_['defaults'](config[_0xf39a('0x6')],{'host':_0xf39a('0x7'),'port':0x18eb});var io=require(_0xf39a('0x8'))(new Redis(config[_0xf39a('0x6')]));function UserReport(_0x25d3bd){this[_0xf39a('0x9')]=_0x25d3bd[_0xf39a('0x9')];this['agents']=_0x25d3bd['agents'];this['telephones']=_0x25d3bd[_0xf39a('0xa')];ami['on'](_0xf39a('0xb'),this[_0xf39a('0xc')][_0xf39a('0xd')](this));ami['on'](_0xf39a('0xe'),this[_0xf39a('0xc')][_0xf39a('0xd')](this));ami['on'](_0xf39a('0xf'),this[_0xf39a('0x10')][_0xf39a('0xd')](this));ami['on']('peerstatus',this[_0xf39a('0x11')][_0xf39a('0xd')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0xf39a('0x12')]()[_0xf39a('0x13')](ami[_0xf39a('0x14')]())[_0xf39a('0x15')](function(_0x9c28ad){logger['error']('[userReport][sipshowregistry]',util[_0xf39a('0x16')](_0x9c28ad,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xf39a('0x13')](ami[_0xf39a('0x17')]())[_0xf39a('0x15')](function(_0x36f0b3){logger['error'](_0xf39a('0x18'),util[_0xf39a('0x16')](_0x36f0b3,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0xf39a('0x13')](ami[_0xf39a('0x19')]())[_0xf39a('0x15')](function(_0x3061f5){logger[_0xf39a('0x1a')](_0xf39a('0x1b'),util['inspect'](_0x3061f5,{'showHidden':![],'depth':null}));});}UserReport[_0xf39a('0x1c')][_0xf39a('0x1d')]=function(){setInterval(function(){BPromise[_0xf39a('0x12')]()[_0xf39a('0x13')](showSipRegistrations())['then'](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0xf39a('0x1c')][_0xf39a('0x1e')]=function(_0x4fd6f0){return _0x4fd6f0!==null&&!_[_0xf39a('0x1f')](_0x4fd6f0);};UserReport[_0xf39a('0x1c')][_0xf39a('0x20')]=function(_0x3ad829,_0x437347,_0x5df8ed){io['to'](_0x3ad829)['emit'](_0x437347,_0x5df8ed);};UserReport['prototype'][_0xf39a('0xc')]=function(_0x43f356){try{if(this[_0xf39a('0x1e')](_0x43f356)){logger[_0xf39a('0x21')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x43f356['username'],_0x43f356[_0xf39a('0x22')]);logger['debug'](_0xf39a('0x23'),util['inspect'](_0x43f356,{'showHidden':![],'depth':null}));var _0x592563=_[_0xf39a('0x24')](this[_0xf39a('0x9')],{'defaultuser':_0x43f356[_0xf39a('0x25')]});if(_0x592563){_0x43f356['stateRegistry']=_0x43f356[_0xf39a('0x22')];_['merge'](_0x592563,_[_0xf39a('0x26')](_0x43f356,['event','actionid',_0xf39a('0x25'),_0xf39a('0x22')]));logger[_0xf39a('0x27')](_0xf39a('0x28'),util[_0xf39a('0x16')](_0x592563,{'showHidden':![],'depth':null}));this[_0xf39a('0x20')](util[_0xf39a('0x29')](_0xf39a('0x2a'),_0x592563[_0xf39a('0x2b')]),_0xf39a('0x2c'),_0x592563);}}}catch(_0x44f5bd){logger[_0xf39a('0x1a')](_0xf39a('0x23'),util['inspect'](_0x44f5bd,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xf39a('0x10')]=function(_0x4408f9){try{if(this['isNotNull'](_0x4408f9)){logger[_0xf39a('0x21')](_0xf39a('0x2d'),_0x4408f9[_0xf39a('0x2e')],_0x4408f9[_0xf39a('0x22')]);logger['debug'](_0xf39a('0x2f'),util[_0xf39a('0x16')](_0x4408f9,{'showHidden':![],'depth':null}));if(this['agents'][_0x4408f9[_0xf39a('0x2e')]]){if(!this[_0xf39a('0x30')][_0x4408f9[_0xf39a('0x2e')]][_0xf39a('0x31')]||_0x4408f9[_0xf39a('0x22')][_0xf39a('0x32')]()=='inuse'){this[_0xf39a('0x30')][_0x4408f9[_0xf39a('0x2e')]]['local']=![];if(this['agents'][_0x4408f9['device']][_0xf39a('0x22')]!==_0x4408f9[_0xf39a('0x22')][_0xf39a('0x32')]()){this[_0xf39a('0x30')][_0x4408f9['device']][_0xf39a('0x33')]=_[_0xf39a('0x34')](moment()[_0xf39a('0x29')]('x'));}this[_0xf39a('0x30')][_0x4408f9[_0xf39a('0x2e')]]['state']=_0x4408f9[_0xf39a('0x22')][_0xf39a('0x32')]();this[_0xf39a('0x30')][_0x4408f9[_0xf39a('0x2e')]][_0xf39a('0x35')](_0x4408f9);}}else if(this[_0xf39a('0xa')][_0x4408f9[_0xf39a('0x2e')]]){if(this['telephones'][_0x4408f9[_0xf39a('0x2e')]]['state']!==_0x4408f9['state'][_0xf39a('0x32')]()){this[_0xf39a('0xa')][_0x4408f9[_0xf39a('0x2e')]][_0xf39a('0x33')]=_[_0xf39a('0x34')](moment()['format']('x'));}this[_0xf39a('0xa')][_0x4408f9[_0xf39a('0x2e')]]['state']=_0x4408f9[_0xf39a('0x22')][_0xf39a('0x32')]();logger[_0xf39a('0x27')](_0xf39a('0x36'),util['inspect'](this[_0xf39a('0xa')][_0x4408f9[_0xf39a('0x2e')]],{'showHidden':![],'depth':null}));this[_0xf39a('0x20')](util[_0xf39a('0x29')](_0xf39a('0x37'),this['telephones'][_0x4408f9['device']][_0xf39a('0x2b')]),_0xf39a('0x38'),this[_0xf39a('0xa')][_0x4408f9[_0xf39a('0x2e')]]);}else if(this[_0xf39a('0x9')][_0x4408f9[_0xf39a('0x2e')]]){if(this[_0xf39a('0x9')][_0x4408f9[_0xf39a('0x2e')]][_0xf39a('0x22')]!==_0x4408f9[_0xf39a('0x22')][_0xf39a('0x32')]()){this[_0xf39a('0x9')][_0x4408f9[_0xf39a('0x2e')]][_0xf39a('0x33')]=_[_0xf39a('0x34')](moment()[_0xf39a('0x29')]('x'));}this[_0xf39a('0x9')][_0x4408f9[_0xf39a('0x2e')]][_0xf39a('0x22')]=_0x4408f9[_0xf39a('0x22')]['toLowerCase']();logger['debug'](_0xf39a('0x39'),util[_0xf39a('0x16')](this[_0xf39a('0x9')][_0x4408f9[_0xf39a('0x2e')]],{'showHidden':![],'depth':null}));this[_0xf39a('0x20')](util['format'](_0xf39a('0x2a'),this[_0xf39a('0x9')][_0x4408f9[_0xf39a('0x2e')]][_0xf39a('0x2b')]),_0xf39a('0x2c'),this['trunks'][_0x4408f9['device']]);}else if(_[_0xf39a('0x3a')](_0x4408f9['device'],'Local')){var _0x5b0dc4=_0x4408f9[_0xf39a('0x2e')];var _0x2116a5=_0x5b0dc4['substring'](_0x5b0dc4['indexOf']('/')+0x1,_0x5b0dc4['indexOf']('@'));var _0x33f082=_[_0xf39a('0x24')](this[_0xf39a('0x30')],function(_0x2b116f){return _0x2b116f[_0xf39a('0x3b')]==_0x2116a5||_0x2b116f[_0xf39a('0x3c')]==_0x2116a5||_0x2b116f[_0xf39a('0x3d')]==_0x2116a5;});if(_0x33f082){if(_0x33f082[_0xf39a('0x22')]!==_0x4408f9[_0xf39a('0x22')][_0xf39a('0x32')]()){_0x33f082[_0xf39a('0x33')]=_[_0xf39a('0x34')](moment()[_0xf39a('0x29')]('x'));}_0x33f082[_0xf39a('0x22')]=_0x4408f9['state']['toLowerCase']();_0x33f082[_0xf39a('0x31')]=!![];_0x33f082['updateStatusRealtime'](_0x4408f9);}}}}catch(_0x554968){logger[_0xf39a('0x1a')](_0xf39a('0x2f'),util['inspect'](_0x554968,{'showHidden':![],'depth':null}));}};UserReport[_0xf39a('0x1c')][_0xf39a('0x11')]=function(_0x3a7163){try{if(this['isNotNull'](_0x3a7163)&&this[_0xf39a('0x1e')](_0x3a7163[_0xf39a('0x3e')])){logger[_0xf39a('0x21')](_0xf39a('0x3f'),_0x3a7163['peer'],_0x3a7163[_0xf39a('0x40')],_0x3a7163['peerstatus']);logger[_0xf39a('0x27')](_0xf39a('0x41'),util[_0xf39a('0x16')](_0x3a7163,{'showHidden':![],'depth':null}));if(this[_0xf39a('0x30')][_0x3a7163[_0xf39a('0x42')]]){if(!this[_0xf39a('0x30')][_0x3a7163[_0xf39a('0x42')]][_0xf39a('0x31')]||_0x3a7163[_0xf39a('0x3e')][_0xf39a('0x32')]()=='registered'){this['agents'][_0x3a7163[_0xf39a('0x42')]][_0xf39a('0x31')]=![];this[_0xf39a('0x30')][_0x3a7163[_0xf39a('0x42')]][_0xf39a('0x43')]=_0x3a7163[_0xf39a('0x3e')][_0xf39a('0x32')]();this['agents'][_0x3a7163[_0xf39a('0x42')]]['address']=_0x3a7163[_0xf39a('0x40')];this[_0xf39a('0x30')][_0x3a7163[_0xf39a('0x42')]][_0xf39a('0x35')](_0x3a7163);}}else if(this[_0xf39a('0xa')][_0x3a7163['peer']]){this[_0xf39a('0xa')][_0x3a7163[_0xf39a('0x42')]][_0xf39a('0x43')]=_0x3a7163[_0xf39a('0x3e')][_0xf39a('0x32')]();this[_0xf39a('0xa')][_0x3a7163[_0xf39a('0x42')]][_0xf39a('0x40')]=_0x3a7163[_0xf39a('0x40')];logger[_0xf39a('0x27')](_0xf39a('0x44'),util['inspect'](this[_0xf39a('0xa')][_0x3a7163[_0xf39a('0x42')]],{'showHidden':![],'depth':null}));this[_0xf39a('0x20')](util[_0xf39a('0x29')]('telephone:%s',this[_0xf39a('0xa')][_0x3a7163[_0xf39a('0x42')]][_0xf39a('0x2b')]),_0xf39a('0x38'),this[_0xf39a('0xa')][_0x3a7163[_0xf39a('0x42')]]);}else if(this['trunks'][_0x3a7163[_0xf39a('0x42')]]){this[_0xf39a('0x9')][_0x3a7163[_0xf39a('0x42')]][_0xf39a('0x43')]=_0x3a7163['peerstatus'][_0xf39a('0x32')]();this[_0xf39a('0x9')][_0x3a7163[_0xf39a('0x42')]][_0xf39a('0x40')]=_0x3a7163[_0xf39a('0x40')];logger['debug'](_0xf39a('0x45'),util[_0xf39a('0x16')](this[_0xf39a('0x9')][_0x3a7163['peer']],{'showHidden':![],'depth':null}));this[_0xf39a('0x20')](util[_0xf39a('0x29')]('trunk:%s',this['trunks'][_0x3a7163[_0xf39a('0x42')]][_0xf39a('0x2b')]),'trunk:save',this[_0xf39a('0x9')][_0x3a7163['peer']]);}}}catch(_0x5b7b9f){logger[_0xf39a('0x1a')]('[userReport][peerstatus]',util['inspect'](_0x5b7b9f,{'showHidden':![],'depth':null}));}};module[_0xf39a('0x46')]=UserReport; \ No newline at end of file +var _0x4a37=['omit','event','actionid','format','trunk:%s','name','trunk:save','isNotNull','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','telephones','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','find','phone','accountcode','syncPeerStatus','address','peer','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]','exports','moment','ioredis','bluebird','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','agents','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','resolve','then','actionSipShowRegistry','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','isUndefined','emit','info','username','debug','trunks','stateRegistry','state'];(function(_0x329fd2,_0x201f4d){var _0x55d7c1=function(_0x32e5f9){while(--_0x32e5f9){_0x329fd2['push'](_0x329fd2['shift']());}};_0x55d7c1(++_0x201f4d);}(_0x4a37,0xb1));var _0x74a3=function(_0x8a7585,_0x287a7f){_0x8a7585=_0x8a7585-0x0;var _0x1648a7=_0x4a37[_0x8a7585];return _0x1648a7;};'use strict';var _=require('lodash');var moment=require(_0x74a3('0x0'));var util=require('util');var Redis=require(_0x74a3('0x1'));var BPromise=require(_0x74a3('0x2'));var config=require(_0x74a3('0x3'));var logger=require('../../../config/logger')(_0x74a3('0x4'));var ami=require(_0x74a3('0x5'));config[_0x74a3('0x6')]=_[_0x74a3('0x7')](config['redis'],{'host':_0x74a3('0x8'),'port':0x18eb});var io=require(_0x74a3('0x9'))(new Redis(config[_0x74a3('0x6')]));function UserReport(_0x3bdc34){this['trunks']=_0x3bdc34['trunks'];this['agents']=_0x3bdc34[_0x74a3('0xa')];this['telephones']=_0x3bdc34['telephones'];ami['on'](_0x74a3('0xb'),this[_0x74a3('0xc')]['bind'](this));ami['on'](_0x74a3('0xd'),this[_0x74a3('0xc')][_0x74a3('0xe')](this));ami['on'](_0x74a3('0xf'),this[_0x74a3('0x10')][_0x74a3('0xe')](this));ami['on'](_0x74a3('0x11'),this['syncPeerStatus']['bind'](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x74a3('0x12')]()[_0x74a3('0x13')](ami[_0x74a3('0x14')]())[_0x74a3('0x15')](function(_0x3791d7){logger[_0x74a3('0x16')]('[userReport][sipshowregistry]',util[_0x74a3('0x17')](_0x3791d7,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x74a3('0x12')]()[_0x74a3('0x13')](ami[_0x74a3('0x18')]())[_0x74a3('0x15')](function(_0x4f1738){logger['error'](_0x74a3('0x19'),util[_0x74a3('0x17')](_0x4f1738,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x74a3('0x12')]()[_0x74a3('0x13')](ami[_0x74a3('0x1a')]())[_0x74a3('0x15')](function(_0xe0ee56){logger[_0x74a3('0x16')]('[userReport][sippeerstatus]',util[_0x74a3('0x17')](_0xe0ee56,{'showHidden':![],'depth':null}));});}UserReport[_0x74a3('0x1b')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x74a3('0x12')]()[_0x74a3('0x13')](showSipRegistrations())[_0x74a3('0x13')](listDeviceStates())[_0x74a3('0x13')](showPeersStatus());},0x32c8);};UserReport[_0x74a3('0x1b')]['isNotNull']=function(_0x1cea0d){return _0x1cea0d!==null&&!_[_0x74a3('0x1c')](_0x1cea0d);};UserReport[_0x74a3('0x1b')][_0x74a3('0x1d')]=function(_0x4d17b6,_0x424e3b,_0x224f93){io['to'](_0x4d17b6)[_0x74a3('0x1d')](_0x424e3b,_0x224f93);};UserReport[_0x74a3('0x1b')][_0x74a3('0xc')]=function(_0x2b95e4){try{if(this['isNotNull'](_0x2b95e4)){logger[_0x74a3('0x1e')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x2b95e4[_0x74a3('0x1f')],_0x2b95e4['state']);logger[_0x74a3('0x20')]('[userReport][registry]',util[_0x74a3('0x17')](_0x2b95e4,{'showHidden':![],'depth':null}));var _0x3a7c15=_['find'](this[_0x74a3('0x21')],{'defaultuser':_0x2b95e4[_0x74a3('0x1f')]});if(_0x3a7c15){_0x2b95e4[_0x74a3('0x22')]=_0x2b95e4[_0x74a3('0x23')];_['merge'](_0x3a7c15,_[_0x74a3('0x24')](_0x2b95e4,[_0x74a3('0x25'),_0x74a3('0x26'),'username',_0x74a3('0x23')]));logger[_0x74a3('0x20')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x74a3('0x17')](_0x3a7c15,{'showHidden':![],'depth':null}));this['emit'](util[_0x74a3('0x27')](_0x74a3('0x28'),_0x3a7c15[_0x74a3('0x29')]),_0x74a3('0x2a'),_0x3a7c15);}}}catch(_0x380f56){logger[_0x74a3('0x16')]('[userReport][registry]',util[_0x74a3('0x17')](_0x380f56,{'showHidden':![],'depth':null}));}};UserReport[_0x74a3('0x1b')][_0x74a3('0x10')]=function(_0x4133ea){try{if(this[_0x74a3('0x2b')](_0x4133ea)){logger[_0x74a3('0x1e')](_0x74a3('0x2c'),_0x4133ea['device'],_0x4133ea[_0x74a3('0x23')]);logger['debug'](_0x74a3('0x2d'),util[_0x74a3('0x17')](_0x4133ea,{'showHidden':![],'depth':null}));if(this[_0x74a3('0xa')][_0x4133ea[_0x74a3('0x2e')]]){if(!this[_0x74a3('0xa')][_0x4133ea[_0x74a3('0x2e')]]['local']||_0x4133ea['state'][_0x74a3('0x2f')]()==_0x74a3('0x30')){this['agents'][_0x4133ea[_0x74a3('0x2e')]][_0x74a3('0x31')]=![];if(this['agents'][_0x4133ea[_0x74a3('0x2e')]][_0x74a3('0x23')]!==_0x4133ea[_0x74a3('0x23')][_0x74a3('0x2f')]()){this[_0x74a3('0xa')][_0x4133ea['device']][_0x74a3('0x32')]=_[_0x74a3('0x33')](moment()[_0x74a3('0x27')]('x'));}this[_0x74a3('0xa')][_0x4133ea[_0x74a3('0x2e')]][_0x74a3('0x23')]=_0x4133ea[_0x74a3('0x23')][_0x74a3('0x2f')]();this[_0x74a3('0xa')][_0x4133ea[_0x74a3('0x2e')]][_0x74a3('0x34')](_0x4133ea);}}else if(this[_0x74a3('0x35')][_0x4133ea[_0x74a3('0x2e')]]){if(this[_0x74a3('0x35')][_0x4133ea[_0x74a3('0x2e')]]['state']!==_0x4133ea[_0x74a3('0x23')]['toLowerCase']()){this[_0x74a3('0x35')][_0x4133ea[_0x74a3('0x2e')]][_0x74a3('0x32')]=_[_0x74a3('0x33')](moment()[_0x74a3('0x27')]('x'));}this[_0x74a3('0x35')][_0x4133ea[_0x74a3('0x2e')]][_0x74a3('0x23')]=_0x4133ea[_0x74a3('0x23')]['toLowerCase']();logger[_0x74a3('0x20')](_0x74a3('0x36'),util[_0x74a3('0x17')](this[_0x74a3('0x35')][_0x4133ea[_0x74a3('0x2e')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x74a3('0x27')]('telephone:%s',this[_0x74a3('0x35')][_0x4133ea[_0x74a3('0x2e')]][_0x74a3('0x29')]),_0x74a3('0x37'),this['telephones'][_0x4133ea['device']]);}else if(this[_0x74a3('0x21')][_0x4133ea[_0x74a3('0x2e')]]){if(this[_0x74a3('0x21')][_0x4133ea['device']]['state']!==_0x4133ea['state'][_0x74a3('0x2f')]()){this[_0x74a3('0x21')][_0x4133ea['device']]['stateTime']=_[_0x74a3('0x33')](moment()[_0x74a3('0x27')]('x'));}this[_0x74a3('0x21')][_0x4133ea[_0x74a3('0x2e')]][_0x74a3('0x23')]=_0x4133ea[_0x74a3('0x23')][_0x74a3('0x2f')]();logger[_0x74a3('0x20')](_0x74a3('0x38'),util[_0x74a3('0x17')](this[_0x74a3('0x21')][_0x4133ea[_0x74a3('0x2e')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x74a3('0x27')](_0x74a3('0x28'),this['trunks'][_0x4133ea[_0x74a3('0x2e')]][_0x74a3('0x29')]),_0x74a3('0x2a'),this[_0x74a3('0x21')][_0x4133ea[_0x74a3('0x2e')]]);}else if(_[_0x74a3('0x39')](_0x4133ea[_0x74a3('0x2e')],_0x74a3('0x3a'))){var _0x3213d2=_0x4133ea['device'];var _0x3210da=_0x3213d2[_0x74a3('0x3b')](_0x3213d2[_0x74a3('0x3c')]('/')+0x1,_0x3213d2[_0x74a3('0x3c')]('@'));var _0x4b62e3=_[_0x74a3('0x3d')](this[_0x74a3('0xa')],function(_0x3f30b1){return _0x3f30b1['mobile']==_0x3210da||_0x3f30b1[_0x74a3('0x3e')]==_0x3210da||_0x3f30b1[_0x74a3('0x3f')]==_0x3210da;});if(_0x4b62e3){if(_0x4b62e3[_0x74a3('0x23')]!==_0x4133ea[_0x74a3('0x23')][_0x74a3('0x2f')]()){_0x4b62e3[_0x74a3('0x32')]=_[_0x74a3('0x33')](moment()[_0x74a3('0x27')]('x'));}_0x4b62e3['state']=_0x4133ea[_0x74a3('0x23')][_0x74a3('0x2f')]();_0x4b62e3[_0x74a3('0x31')]=!![];_0x4b62e3[_0x74a3('0x34')](_0x4133ea);}}}}catch(_0x4c5578){logger[_0x74a3('0x16')](_0x74a3('0x2d'),util[_0x74a3('0x17')](_0x4c5578,{'showHidden':![],'depth':null}));}};UserReport[_0x74a3('0x1b')][_0x74a3('0x40')]=function(_0x3bde4d){try{if(this[_0x74a3('0x2b')](_0x3bde4d)&&this[_0x74a3('0x2b')](_0x3bde4d[_0x74a3('0x11')])){logger[_0x74a3('0x1e')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x3bde4d['peer'],_0x3bde4d[_0x74a3('0x41')],_0x3bde4d['peerstatus']);logger[_0x74a3('0x20')]('[userReport][peerstatus]',util[_0x74a3('0x17')](_0x3bde4d,{'showHidden':![],'depth':null}));if(this[_0x74a3('0xa')][_0x3bde4d[_0x74a3('0x42')]]){if(!this[_0x74a3('0xa')][_0x3bde4d['peer']]['local']||_0x3bde4d[_0x74a3('0x11')][_0x74a3('0x2f')]()=='registered'){this[_0x74a3('0xa')][_0x3bde4d[_0x74a3('0x42')]][_0x74a3('0x31')]=![];this['agents'][_0x3bde4d['peer']][_0x74a3('0x43')]=_0x3bde4d['peerstatus']['toLowerCase']();this[_0x74a3('0xa')][_0x3bde4d['peer']][_0x74a3('0x41')]=_0x3bde4d[_0x74a3('0x41')];this[_0x74a3('0xa')][_0x3bde4d[_0x74a3('0x42')]][_0x74a3('0x34')](_0x3bde4d);}}else if(this[_0x74a3('0x35')][_0x3bde4d[_0x74a3('0x42')]]){this['telephones'][_0x3bde4d[_0x74a3('0x42')]]['status']=_0x3bde4d[_0x74a3('0x11')]['toLowerCase']();this[_0x74a3('0x35')][_0x3bde4d[_0x74a3('0x42')]]['address']=_0x3bde4d['address'];logger[_0x74a3('0x20')](_0x74a3('0x44'),util[_0x74a3('0x17')](this[_0x74a3('0x35')][_0x3bde4d[_0x74a3('0x42')]],{'showHidden':![],'depth':null}));this[_0x74a3('0x1d')](util['format']('telephone:%s',this[_0x74a3('0x35')][_0x3bde4d[_0x74a3('0x42')]][_0x74a3('0x29')]),'telephone:save',this[_0x74a3('0x35')][_0x3bde4d[_0x74a3('0x42')]]);}else if(this['trunks'][_0x3bde4d[_0x74a3('0x42')]]){this[_0x74a3('0x21')][_0x3bde4d[_0x74a3('0x42')]][_0x74a3('0x43')]=_0x3bde4d['peerstatus']['toLowerCase']();this[_0x74a3('0x21')][_0x3bde4d[_0x74a3('0x42')]]['address']=_0x3bde4d['address'];logger['debug']('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x74a3('0x17')](this['trunks'][_0x3bde4d[_0x74a3('0x42')]],{'showHidden':![],'depth':null}));this[_0x74a3('0x1d')](util[_0x74a3('0x27')](_0x74a3('0x28'),this[_0x74a3('0x21')][_0x3bde4d[_0x74a3('0x42')]][_0x74a3('0x29')]),'trunk:save',this['trunks'][_0x3bde4d[_0x74a3('0x42')]]);}}}catch(_0x477ea3){logger[_0x74a3('0x16')](_0x74a3('0x45'),util['inspect'](_0x477ea3,{'showHidden':![],'depth':null}));}};module[_0x74a3('0x46')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index cc78e87..640f5fe 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x519c30,_0x50ff8a){var _0x2f7ed5=function(_0x588b75){while(--_0x588b75){_0x519c30['push'](_0x519c30['shift']());}};_0x2f7ed5(++_0x50ff8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x13463c,_0x5f094e){var _0x5626ea=function(_0x31a427){while(--_0x31a427){_0x13463c['push'](_0x13463c['shift']());}};_0x5626ea(++_0x5f094e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index dbb70d1..e65e888 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7d2=['[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','connectedlinename','destinationchannel','toNumber','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','sipcallid','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','resolve','transferType','undefined','isEmpty','getSettings','then','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','BlindTransfer','blindTransfers','outbound','custom:voiceCallReport','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','type','ATTENDED','origtransfererlinkedid','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfererchannel','transfereruniqueid','BLIND','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','socket.io-emitter','channels','agents','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','inspect','linkedid','uniqueid','merge','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','format','user:%s','name','user:agentconnect','connectedlinenum','[%s][voiceCallReport][newcallerid]','debug','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','disposition','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','startsWith','CDR(routeAlias)','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','lastapplication','lastdata','cdr(','match'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa7d2,0x66));var _0x2a7d=function(_0x3e51b5,_0x2466f3){_0x3e51b5=_0x3e51b5-0x0;var _0xbf5ab9=_0xa7d2[_0x3e51b5];return _0xbf5ab9;};'use strict';var BPromise=require(_0x2a7d('0x0'));var _=require('lodash');var moment=require(_0x2a7d('0x1'));var util=require(_0x2a7d('0x2'));var path=require(_0x2a7d('0x3'));var Redis=require(_0x2a7d('0x4'));var config=require(_0x2a7d('0x5'));var logger=require(_0x2a7d('0x6'))(_0x2a7d('0x7'));var ami=require(_0x2a7d('0x8'));var Channel=require(_0x2a7d('0x9'));var RpcSetting=require(_0x2a7d('0xa'));var statusDesc=[_0x2a7d('0xb'),_0x2a7d('0xc'),'inuse','busy',_0x2a7d('0xd'),_0x2a7d('0xe'),_0x2a7d('0xf'),_0x2a7d('0x10'),'onhold'];var applications=[_0x2a7d('0x11'),_0x2a7d('0x12'),_0x2a7d('0x13'),_0x2a7d('0x14'),_0x2a7d('0x15'),_0x2a7d('0x16')];var dispositions=[_0x2a7d('0x17'),_0x2a7d('0x18'),_0x2a7d('0x18'),_0x2a7d('0x17'),'NO\x20ANSWER',_0x2a7d('0x17'),'ANSWERED',_0x2a7d('0x19'),_0x2a7d('0x18'),'FAILED',_0x2a7d('0x18')];var actions={};config[_0x2a7d('0x1a')]=_[_0x2a7d('0x1b')](config[_0x2a7d('0x1a')],{'host':'localhost','port':0x18eb});var io=require(_0x2a7d('0x1c'))(new Redis(config[_0x2a7d('0x1a')]));function VoiceCallReport(_0x580320){this[_0x2a7d('0x1d')]=_0x580320[_0x2a7d('0x1d')];this[_0x2a7d('0x1e')]=_0x580320[_0x2a7d('0x1e')];this['blindTransfers']={};ami['on']('coreshowchannel',this[_0x2a7d('0x1f')]['bind'](this));ami['on'](_0x2a7d('0x20'),this[_0x2a7d('0x1f')][_0x2a7d('0x21')](this));ami['on'](_0x2a7d('0x22'),this[_0x2a7d('0x23')]['bind'](this));ami['on'](_0x2a7d('0x24'),this[_0x2a7d('0x25')]['bind'](this));ami['on'](_0x2a7d('0x26'),this[_0x2a7d('0x27')]['bind'](this));ami['on'](_0x2a7d('0x28'),this[_0x2a7d('0x29')][_0x2a7d('0x21')](this));ami['on'](_0x2a7d('0x2a'),this[_0x2a7d('0x2b')][_0x2a7d('0x21')](this));ami['on'](_0x2a7d('0x2c'),this[_0x2a7d('0x2d')][_0x2a7d('0x21')](this));ami['on'](_0x2a7d('0x2e'),this['syncBlindTransfer']['bind'](this));ami['on'](_0x2a7d('0x2f'),this[_0x2a7d('0x30')][_0x2a7d('0x21')](this));ami['on']('musiconholdstop',this[_0x2a7d('0x31')][_0x2a7d('0x21')](this));try{logger['info'](_0x2a7d('0x32'));ami[_0x2a7d('0x33')]();}catch(_0x1765f5){logger[_0x2a7d('0x34')](_0x2a7d('0x35'),util['inspect'](_0x1765f5,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x2a7d('0x36')][_0x2a7d('0x37')]=function(_0x2967b4){return _0x2967b4!==null&&!_[_0x2a7d('0x38')](_0x2967b4);};VoiceCallReport['prototype'][_0x2a7d('0x39')]=function(_0x358ecc,_0x1706bc,_0x5b4a99){io['to'](_0x358ecc)[_0x2a7d('0x39')](_0x1706bc,_0x5b4a99);};VoiceCallReport[_0x2a7d('0x36')][_0x2a7d('0x2b')]=function(_0x51c18a){try{if(this[_0x2a7d('0x37')](_0x51c18a)){logger[_0x2a7d('0x3a')](_0x2a7d('0x3b'),_0x51c18a['uniqueid'],_0x51c18a[_0x2a7d('0x3c')],_0x51c18a[_0x2a7d('0x3d')]);logger['debug'](_0x2a7d('0x3e'),_0x51c18a['uniqueid'],util[_0x2a7d('0x3f')](_0x51c18a,{'showHidden':![],'depth':null}));if(_0x51c18a['uniqueid']===_0x51c18a[_0x2a7d('0x40')]){if(!_[_0x2a7d('0x38')](this[_0x2a7d('0x1d')][_0x51c18a[_0x2a7d('0x41')]])){_[_0x2a7d('0x42')](this[_0x2a7d('0x1d')][_0x51c18a[_0x2a7d('0x41')]],_[_0x2a7d('0x43')](_0x51c18a,_[_0x2a7d('0x44')](this[_0x2a7d('0x1d')][_0x51c18a[_0x2a7d('0x41')]])));}}if(_0x51c18a[_0x2a7d('0x45')]===_0x2a7d('0x46')){if(this[_0x2a7d('0x1e')][_0x51c18a[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]]){if(_0x51c18a[_0x2a7d('0x49')]==_0x2a7d('0x4a')){this[_0x2a7d('0x1e')][_0x51c18a[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]][_0x2a7d('0x4b')]=_0x51c18a['connectedlinenum'];this['emit'](util[_0x2a7d('0x4c')](_0x2a7d('0x4d'),this[_0x2a7d('0x1e')][_0x51c18a[_0x2a7d('0x47')]['split']('-')[0x0]][_0x2a7d('0x4e')]),_0x2a7d('0x4f'),{'destaccountcode':this[_0x2a7d('0x1e')][_0x51c18a[_0x2a7d('0x47')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x51c18a[_0x2a7d('0x50')]});}}}}}catch(_0x478594){logger[_0x2a7d('0x34')](_0x2a7d('0x51'),_0x51c18a[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x478594,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2a7d('0x36')][_0x2a7d('0x23')]=function(_0x9bcac9){try{if(this[_0x2a7d('0x37')](_0x9bcac9)){logger[_0x2a7d('0x52')]('[%s][voiceCallReport][newchannel]\x20event:',_0x9bcac9[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x9bcac9,{'showHidden':![],'depth':null}));if(_0x9bcac9[_0x2a7d('0x41')]===_0x9bcac9[_0x2a7d('0x40')]&&_0x9bcac9[_0x2a7d('0x47')]!=_0x2a7d('0x53')){if(_[_0x2a7d('0x38')](this[_0x2a7d('0x1d')][_0x9bcac9[_0x2a7d('0x41')]])){logger[_0x2a7d('0x3a')](_0x2a7d('0x54'),_0x9bcac9[_0x2a7d('0x41')],_0x9bcac9['context'],_0x9bcac9['exten']);this[_0x2a7d('0x1d')][_0x9bcac9[_0x2a7d('0x41')]]=new Channel();this[_0x2a7d('0x1d')][_0x9bcac9[_0x2a7d('0x41')]][_0x2a7d('0x55')]=moment()[_0x2a7d('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2a7d('0x1d')][_0x9bcac9['uniqueid']][_0x2a7d('0x56')]=dispositions[_['toNumber'](_0x9bcac9[_0x2a7d('0x57')])];_[_0x2a7d('0x42')](this[_0x2a7d('0x1d')][_0x9bcac9[_0x2a7d('0x41')]],_[_0x2a7d('0x43')](_0x9bcac9,_[_0x2a7d('0x44')](this['channels'][_0x9bcac9[_0x2a7d('0x41')]])));if(_0x9bcac9[_0x2a7d('0x45')]==='from-sip'){if(this['agents'][_0x9bcac9[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]]){if(_[_0x2a7d('0x38')](this[_0x2a7d('0x1e')][_0x9bcac9['channel'][_0x2a7d('0x48')]('-')[0x0]][_0x2a7d('0x4b')])){this['agents'][_0x9bcac9[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]][_0x2a7d('0x4b')]=_0x9bcac9['exten'];logger[_0x2a7d('0x52')](_0x2a7d('0x58'),_0x9bcac9[_0x2a7d('0x41')],util[_0x2a7d('0x3f')]({'destaccountcode':this[_0x2a7d('0x1e')][_0x9bcac9[_0x2a7d('0x47')]['split']('-')[0x0]][_0x2a7d('0x59')],'destconnectedlinenum':_0x9bcac9[_0x2a7d('0x49')]},{'showHidden':![],'depth':null}));this[_0x2a7d('0x39')](util['format'](_0x2a7d('0x4d'),this['agents'][_0x9bcac9[_0x2a7d('0x47')]['split']('-')[0x0]][_0x2a7d('0x4e')]),'user:agentconnect',{'destaccountcode':this['agents'][_0x9bcac9['channel']['split']('-')[0x0]][_0x2a7d('0x59')],'destconnectedlinenum':_0x9bcac9[_0x2a7d('0x49')]});}}}}}}}catch(_0x3402a7){logger['error'](_0x2a7d('0x5a'),_0x9bcac9['uniqueid'],util[_0x2a7d('0x3f')](_0x3402a7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x2a7d('0x1f')]=function(_0x13791e){try{if(this[_0x2a7d('0x37')](_0x13791e)){logger[_0x2a7d('0x52')](_0x2a7d('0x5b'),_0x13791e[_0x2a7d('0x41')],util['inspect'](_0x13791e,{'showHidden':![],'depth':null}));if(_0x13791e[_0x2a7d('0x41')]===_0x13791e[_0x2a7d('0x40')]&&_0x13791e[_0x2a7d('0x49')]!='h'&&_0x13791e[_0x2a7d('0x47')]!=_0x2a7d('0x53')){_0x13791e[_0x2a7d('0x5c')]=_0x13791e[_0x2a7d('0x5c')][_0x2a7d('0x5d')]();_0x13791e[_0x2a7d('0x5e')]=_0x13791e['appdata']&&_0x13791e['appdata'][_0x2a7d('0x5f')](_0x2a7d('0x60'))?_0x13791e[_0x2a7d('0x61')]:(_0x13791e['appdata']||_0x13791e[_0x2a7d('0x5e')])[_0x2a7d('0x5d')]();logger[_0x2a7d('0x3a')](_0x2a7d('0x62'),_0x13791e['uniqueid'],_0x13791e[_0x2a7d('0x5c')],_0x13791e['applicationdata']);if(_[_0x2a7d('0x38')](this[_0x2a7d('0x1d')][_0x13791e[_0x2a7d('0x41')]])){this['channels'][_0x13791e[_0x2a7d('0x41')]]=new Channel();this[_0x2a7d('0x1d')][_0x13791e[_0x2a7d('0x41')]]['starttime']=_0x13791e[_0x2a7d('0x63')]?moment()['subtract'](moment[_0x2a7d('0x63')](_0x13791e[_0x2a7d('0x63')])[_0x2a7d('0x64')](),_0x2a7d('0x64'))['format'](_0x2a7d('0x65')):moment()['format'](_0x2a7d('0x65'));this['channels'][_0x13791e[_0x2a7d('0x41')]][_0x2a7d('0x56')]=_0x2a7d('0x17');}_[_0x2a7d('0x42')](this['channels'][_0x13791e[_0x2a7d('0x41')]],_[_0x2a7d('0x43')](_0x13791e,_[_0x2a7d('0x44')](this['channels'][_0x13791e[_0x2a7d('0x41')]])));if(_['includes'](applications,_0x13791e[_0x2a7d('0x5c')])){this[_0x2a7d('0x1d')][_0x13791e['uniqueid']][_0x2a7d('0x66')]=_0x13791e['application'];this[_0x2a7d('0x1d')][_0x13791e[_0x2a7d('0x41')]][_0x2a7d('0x67')]=_0x13791e['applicationdata'];if(_0x13791e[_0x2a7d('0x5c')]===_0x2a7d('0x11')&&_[_0x2a7d('0x5f')](_0x13791e[_0x2a7d('0x5e')][_0x2a7d('0x5d')](),_0x2a7d('0x68'))){var _0x14b31b=_0x13791e[_0x2a7d('0x5e')][_0x2a7d('0x48')]('=');var _0xcc1a49=_0x14b31b[0x0][_0x2a7d('0x5d')]()[_0x2a7d('0x69')](/cdr\((.*)\)/);if(_0xcc1a49){this[_0x2a7d('0x1d')][_0x13791e[_0x2a7d('0x41')]][_0xcc1a49[0x1]]=_0x14b31b[0x1];}}else if(_0x13791e['application']===_0x2a7d('0x12')){this[_0x2a7d('0x1d')][_0x13791e[_0x2a7d('0x41')]]['queue']=_0x13791e[_0x2a7d('0x5e')][_0x2a7d('0x48')](',')[0x0];}}}}}catch(_0x54a9e9){logger[_0x2a7d('0x34')]('[%s][voiceCallReport][newexten]',_0x13791e[_0x2a7d('0x41')],util['inspect'](_0x54a9e9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2a7d('0x36')]['syncNewState']=function(_0x35541d){try{if(this['isNotNull'](_0x35541d)){logger[_0x2a7d('0x3a')](_0x2a7d('0x6a'),_0x35541d['uniqueid'],_0x35541d[_0x2a7d('0x40')],_0x35541d[_0x2a7d('0x3c')],_0x35541d['calleridnum']);logger[_0x2a7d('0x52')](_0x2a7d('0x6b'),_0x35541d[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x35541d,{'showHidden':![],'depth':null}));if(_0x35541d[_0x2a7d('0x41')]!==_0x35541d[_0x2a7d('0x40')]){if(this['channels'][_0x35541d['linkedid']]){if(_0x35541d['channelstate']==='6'){if(!this['channels'][_0x35541d[_0x2a7d('0x40')]]['answered']){var _0x30c0ae=moment();this[_0x2a7d('0x1d')][_0x35541d[_0x2a7d('0x40')]][_0x2a7d('0x6c')]=!![];this[_0x2a7d('0x1d')][_0x35541d['linkedid']][_0x2a7d('0x6d')]=_0x30c0ae['format']('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x2a7d('0x1d')][_0x35541d['linkedid']][_0x2a7d('0x55')]){this['channels'][_0x35541d['linkedid']]['holdtime']=_0x30c0ae[_0x2a7d('0x6e')](this['channels'][_0x35541d[_0x2a7d('0x40')]][_0x2a7d('0x55')],_0x2a7d('0x64'));}}this[_0x2a7d('0x1d')][_0x35541d[_0x2a7d('0x40')]]['linkedid']=_0x35541d[_0x2a7d('0x41')];if(_0x35541d[_0x2a7d('0x3d')]!==_0x2a7d('0x4a')){this['channels'][_0x35541d['linkedid']]['connectedlinenum']=_0x35541d[_0x2a7d('0x3d')];}this[_0x2a7d('0x1d')][_0x35541d[_0x2a7d('0x40')]][_0x2a7d('0x6f')]=_0x35541d[_0x2a7d('0x3c')];this['channels'][_0x35541d[_0x2a7d('0x40')]][_0x2a7d('0x70')]=_0x35541d[_0x2a7d('0x47')];this['channels'][_0x35541d[_0x2a7d('0x40')]][_0x2a7d('0x56')]=dispositions[_[_0x2a7d('0x71')](_0x35541d['channelstate'])];if(this['agents'][_0x35541d['channel']['split']('-')[0x0]]){this['channels'][_0x35541d[_0x2a7d('0x40')]][_0x2a7d('0x72')]=this[_0x2a7d('0x1e')][_0x35541d[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]]['id'];this[_0x2a7d('0x1d')][_0x35541d[_0x2a7d('0x40')]][_0x2a7d('0x73')]=this[_0x2a7d('0x1e')][_0x35541d[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]][_0x2a7d('0x4e')];}}}}else{if(this[_0x2a7d('0x1d')][_0x35541d[_0x2a7d('0x41')]]){if(_0x35541d['channelstate']==='6'){if(this[_0x2a7d('0x1e')][_0x35541d['channel'][_0x2a7d('0x48')]('-')[0x0]]){this['channels'][_0x35541d['uniqueid']]['UserId']=this[_0x2a7d('0x1e')][_0x35541d[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]]['id'];this[_0x2a7d('0x1d')][_0x35541d[_0x2a7d('0x41')]][_0x2a7d('0x73')]=this[_0x2a7d('0x1e')][_0x35541d[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]][_0x2a7d('0x4e')];}}}}if(_0x35541d[_0x2a7d('0x57')]==='6'&&_0x35541d[_0x2a7d('0x45')]==='from-sip'){if(this['agents'][_0x35541d[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]]){this[_0x2a7d('0x1e')][_0x35541d[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]][_0x2a7d('0x4b')]=_0x35541d[_0x2a7d('0x49')];var _0x222fbd;if(this[_0x2a7d('0x1d')][_0x35541d[_0x2a7d('0x41')]])_0x222fbd=this['channels'][_0x35541d[_0x2a7d('0x41')]][_0x2a7d('0x74')];else if(this['channels'][_0x35541d[_0x2a7d('0x40')]])_0x222fbd=this['channels'][_0x35541d[_0x2a7d('0x40')]][_0x2a7d('0x74')];logger[_0x2a7d('0x52')](_0x2a7d('0x75'),_0x35541d['uniqueid'],util[_0x2a7d('0x3f')]({'destaccountcode':this[_0x2a7d('0x1e')][_0x35541d[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x35541d[_0x2a7d('0x49')],'routealias':_0x222fbd},{'showHidden':![],'depth':null}));this[_0x2a7d('0x39')](util[_0x2a7d('0x4c')]('user:%s',this['agents'][_0x35541d[_0x2a7d('0x47')]['split']('-')[0x0]][_0x2a7d('0x4e')]),'user:agentconnect',{'destaccountcode':this[_0x2a7d('0x1e')][_0x35541d['channel'][_0x2a7d('0x48')]('-')[0x0]][_0x2a7d('0x59')],'destconnectedlinenum':_0x35541d['exten'],'routealias':_0x222fbd});}}}}catch(_0x27305e){logger[_0x2a7d('0x34')]('[%s][voiceCallReport][newstate]',_0x35541d[_0x2a7d('0x41')],util['inspect'](_0x27305e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2a7d('0x36')][_0x2a7d('0x76')]=function(_0x509e76,_0x2a650f){try{if(this[_0x2a7d('0x1d')][_0x509e76]){logger[_0x2a7d('0x3a')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x509e76,_0x2a650f);this[_0x2a7d('0x1d')][_0x509e76][_0x2a7d('0x77')]=!![];if(_[_0x2a7d('0x78')](_0x2a650f,_0x2a7d('0x79'))){_0x2a650f=_0x2a650f[_0x2a7d('0x7a')](_0x2a7d('0x79'),_0x2a7d('0x7b'));}this[_0x2a7d('0x1d')][_0x509e76][_0x2a7d('0x7c')]=_0x2a650f;var _0x2c6b84=_[_0x2a7d('0x7d')](this['channels'][_0x509e76][_0x2a7d('0x7e')],{'filename':_0x2a650f});if(_[_0x2a7d('0x7f')](_0x2c6b84)){this[_0x2a7d('0x1d')][_0x509e76][_0x2a7d('0x7e')][_0x2a7d('0x80')]({'filename':_0x2a650f,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x2a7d('0x81')});}}}catch(_0x49a332){logger['error'](_0x2a7d('0x82'),_0x509e76,util['inspect'](_0x49a332,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2a7d('0x36')][_0x2a7d('0x27')]=function(_0x706cae){try{if(this['isNotNull'](_0x706cae)){logger['debug'](_0x2a7d('0x83'),_0x706cae[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x706cae,{'showHidden':![],'depth':null}));if(this[_0x2a7d('0x1d')][_0x706cae[_0x2a7d('0x41')]]&&_0x706cae[_0x2a7d('0x47')]!='OutgoingSpoolFailed'){if(this[_0x2a7d('0x37')](_0x706cae[_0x2a7d('0x84')])){if(this[_0x2a7d('0x37')](_0x706cae[_0x2a7d('0x84')][_0x2a7d('0x85')])){logger[_0x2a7d('0x3a')](_0x2a7d('0x86'),_0x706cae[_0x2a7d('0x41')],_0x706cae[_0x2a7d('0x87')]);this['syncMixMonitorFilename'](_0x706cae[_0x2a7d('0x41')],_0x706cae['value']);}else if(this[_0x2a7d('0x37')](_0x706cae['variable'][_0x2a7d('0x88')])){logger['info'](_0x2a7d('0x89'),_0x706cae['uniqueid'],_0x706cae['value']);this[_0x2a7d('0x1d')][_0x706cae[_0x2a7d('0x41')]][_0x2a7d('0x3d')]=_0x706cae['value'];}else if(this[_0x2a7d('0x37')](_0x706cae['variable'][_0x2a7d('0x8a')])){logger[_0x2a7d('0x3a')](_0x2a7d('0x8b'),_0x706cae['uniqueid'],_0x706cae['value']);this[_0x2a7d('0x1d')][_0x706cae[_0x2a7d('0x41')]][_0x2a7d('0x8c')]=_0x706cae[_0x2a7d('0x87')];}else if(this[_0x2a7d('0x37')](_0x706cae[_0x2a7d('0x84')][_0x2a7d('0x8d')])){logger[_0x2a7d('0x3a')](_0x2a7d('0x8e'),_0x706cae[_0x2a7d('0x41')],_0x706cae[_0x2a7d('0x87')]);this['channels'][_0x706cae['uniqueid']]['type']=_0x706cae[_0x2a7d('0x87')];}else if(this['isNotNull'](_0x706cae[_0x2a7d('0x84')][_0x2a7d('0x8f')])){logger[_0x2a7d('0x3a')](_0x2a7d('0x90'),_0x706cae[_0x2a7d('0x41')],_0x706cae[_0x2a7d('0x87')]['split'](',')[0x0]);this[_0x2a7d('0x1d')][_0x706cae[_0x2a7d('0x41')]]['queue']=_0x706cae[_0x2a7d('0x87')]['split'](',')[0x0];}else if(this['isNotNull'](_0x706cae[_0x2a7d('0x84')]['xmd-originatecalleridnum'])){logger[_0x2a7d('0x3a')](_0x2a7d('0x91'),_0x706cae[_0x2a7d('0x41')],_0x706cae[_0x2a7d('0x87')]);this[_0x2a7d('0x1d')][_0x706cae['uniqueid']][_0x2a7d('0x92')]=_0x706cae['value'];}else if(this[_0x2a7d('0x37')](_0x706cae['variable']['xmd-destination'])){logger['info'](_0x2a7d('0x93'),_0x706cae[_0x2a7d('0x41')],_0x706cae[_0x2a7d('0x87')]);this[_0x2a7d('0x1d')][_0x706cae[_0x2a7d('0x41')]][_0x2a7d('0x94')]=_0x706cae[_0x2a7d('0x87')];}else if(this[_0x2a7d('0x37')](_0x706cae[_0x2a7d('0x84')][_0x2a7d('0x95')])){logger[_0x2a7d('0x3a')](_0x2a7d('0x96'),_0x706cae[_0x2a7d('0x41')],_0x706cae[_0x2a7d('0x87')]);this[_0x2a7d('0x1d')][_0x706cae[_0x2a7d('0x41')]][_0x2a7d('0x97')]=_0x706cae[_0x2a7d('0x87')];}else if(this[_0x2a7d('0x37')](_0x706cae[_0x2a7d('0x84')][_0x2a7d('0x98')])){logger[_0x2a7d('0x3a')](_0x2a7d('0x99'),_0x706cae['uniqueid'],_0x706cae[_0x2a7d('0x87')]);this['channels'][_0x706cae[_0x2a7d('0x41')]][_0x2a7d('0x12')]=_0x706cae[_0x2a7d('0x87')];}else if(this[_0x2a7d('0x37')](_0x706cae['variable']['sipcallid'])){logger[_0x2a7d('0x3a')](_0x2a7d('0x9a'),_0x706cae[_0x2a7d('0x41')],_0x706cae['value']);this[_0x2a7d('0x1d')][_0x706cae[_0x2a7d('0x41')]]['sipcalluniqueid']=_0x706cae['value'];}}}else if(this['isNotNull'](_0x706cae['variable'][_0x2a7d('0x85')])){if(_0x706cae[_0x2a7d('0x87')]){var _0x2095ab=path[_0x2a7d('0x9b')](_0x706cae[_0x2a7d('0x87')])[_0x2a7d('0x4e')];logger[_0x2a7d('0x3a')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x2095ab,_0x706cae['value']);this['syncMixMonitorFilename'](_0x2095ab,_0x706cae['value']);}}else if(this[_0x2a7d('0x1d')][_0x706cae['linkedid']]){if(this[_0x2a7d('0x37')](_0x706cae[_0x2a7d('0x84')])){if(this[_0x2a7d('0x37')](_0x706cae[_0x2a7d('0x84')][_0x2a7d('0x9c')])){logger['info'](_0x2a7d('0x9a'),_0x706cae[_0x2a7d('0x40')],_0x706cae[_0x2a7d('0x87')]);this['channels'][_0x706cae[_0x2a7d('0x40')]][_0x2a7d('0x9d')]=_0x706cae[_0x2a7d('0x87')];}}}}}catch(_0x518b52){logger['error']('[%s][voiceCallReport][varset]',_0x706cae['uniqueid'],util['inspect'](_0x518b52,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2a7d('0x36')][_0x2a7d('0x29')]=function(_0x47dde2){try{if(this[_0x2a7d('0x37')](_0x47dde2)){logger[_0x2a7d('0x52')](_0x2a7d('0x9e'),_0x47dde2[_0x2a7d('0x41')],util['inspect'](_0x47dde2,{'showHidden':![],'depth':null}));if(this[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]]){logger[_0x2a7d('0x3a')](_0x2a7d('0x9f'),_0x47dde2['uniqueid'],_0x47dde2[_0x2a7d('0xa0')]);var _0x2374c2=moment();this[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]][_0x2a7d('0xa1')]=_0x2374c2['format'](_0x2a7d('0x65'));this[_0x2a7d('0x1d')][_0x47dde2['uniqueid']][_0x2a7d('0x63')]=_0x2374c2[_0x2a7d('0x6e')](this[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]]['starttime'],_0x2a7d('0x64'));if(this[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]][_0x2a7d('0x6c')]){this[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]]['billableseconds']=_0x2374c2[_0x2a7d('0x6e')](this[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]][_0x2a7d('0x6d')],_0x2a7d('0x64'));this[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]]['holdtime']=this['channels'][_0x47dde2[_0x2a7d('0x41')]][_0x2a7d('0x63')]-this[_0x2a7d('0x1d')][_0x47dde2['uniqueid']][_0x2a7d('0xa2')];}if(_0x47dde2[_0x2a7d('0x45')]==='from-sip'){if(this['agents'][_0x47dde2[_0x2a7d('0x47')]['split']('-')[0x0]]){this[_0x2a7d('0x1e')][_0x47dde2[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]]=_['omit'](this[_0x2a7d('0x1e')][_0x47dde2[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]],['destconnectedlinenum']);logger[_0x2a7d('0x52')](_0x2a7d('0xa3'),_0x47dde2[_0x2a7d('0x41')],util[_0x2a7d('0x3f')]({'id':this[_0x2a7d('0x1e')][_0x47dde2['channel'][_0x2a7d('0x48')]('-')[0x0]]['id'],'destaccountcode':this[_0x2a7d('0x1e')][_0x47dde2['channel'][_0x2a7d('0x48')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0x2a7d('0x4c')](_0x2a7d('0x4d'),this[_0x2a7d('0x1e')][_0x47dde2[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]][_0x2a7d('0x4e')]),'user:agentcomplete',{'id':this['agents'][_0x47dde2[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x47dde2[_0x2a7d('0x47')][_0x2a7d('0x48')]('-')[0x0]][_0x2a7d('0x59')]});}}var _0x15eeb4=this;Promise[_0x2a7d('0xa4')]()['then'](function(){var _0x11e153=_0x15eeb4[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]];if(typeof _0x11e153[_0x2a7d('0xa5')]===_0x2a7d('0xa6'))return;if(_[_0x2a7d('0xa7')](_0x11e153[_0x2a7d('0x7e')]))return;return RpcSetting[_0x2a7d('0xa8')]()[_0x2a7d('0xa9')](function(_0x2ac7f8){if(!_0x2ac7f8['stopRecordingOnTransfer'])return;return Promise[_0x2a7d('0xa4')]()[_0x2a7d('0xa9')](function(){return ami[_0x2a7d('0xaa')]({'action':_0x2a7d('0xab'),'channel':_0x11e153[_0x2a7d('0x47')]})['catch'](function(){});})[_0x2a7d('0xa9')](function(){return ami[_0x2a7d('0xaa')]({'action':_0x2a7d('0xab'),'channel':_0x11e153[_0x2a7d('0x70')]})[_0x2a7d('0xac')](function(){})[_0x2a7d('0xad')](function(){var _0x38e5a7=_0x15eeb4[_0x2a7d('0x1e')][_0x11e153[_0x2a7d('0x70')][_0x2a7d('0x48')]('-')[0x0]];if(!_0x38e5a7)return;io[_0x2a7d('0x39')](_0x2a7d('0xae'),{'agentId':_0x38e5a7['id'],'uniqueid':_0x11e153['uniqueid']});});});});})[_0x2a7d('0xa9')](function(){if(_0x47dde2['event']===_0x2a7d('0xaf')){_0x15eeb4[_0x2a7d('0xb0')][_0x47dde2[_0x2a7d('0x41')]]=_0x15eeb4[_0x2a7d('0x1d')][_0x47dde2['uniqueid']];}else{if(_0x15eeb4[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]]['type']===_0x2a7d('0xb1')&&_0x15eeb4[_0x2a7d('0xb0')][_0x47dde2[_0x2a7d('0x41')]]){_0x15eeb4[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]]['uniqueid']=[_0x15eeb4['channels'][_0x47dde2['uniqueid']][_0x2a7d('0x40')],_0x15eeb4[_0x2a7d('0x1d')][_0x47dde2['uniqueid']][_0x2a7d('0x40')]=_0x15eeb4[_0x2a7d('0x1d')][_0x47dde2['uniqueid']][_0x2a7d('0x41')]][0x0];delete _0x15eeb4[_0x2a7d('0xb0')][_0x47dde2[_0x2a7d('0x41')]];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x47dde2[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x15eeb4[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]],{'showHidden':![],'depth':null}));ami['emit'](_0x2a7d('0xb2'),_0x15eeb4[_0x2a7d('0x1d')][_0x47dde2[_0x2a7d('0x41')]]);delete _0x15eeb4['channels'][_0x47dde2[_0x2a7d('0x41')]];});}}}catch(_0x283769){logger[_0x2a7d('0x34')]('[%s][voiceCallReport][hangup]',_0x47dde2['uniqueid'],util['inspect'](_0x283769,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2a7d('0x36')]['syncAttendedTransfer']=function(_0x222f08){try{if(this['isNotNull'](_0x222f08)){logger[_0x2a7d('0x3a')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x222f08['uniqueid'],_0x222f08['origtransferercalleridnum'],_0x222f08[_0x2a7d('0xb3')]);logger['debug'](_0x2a7d('0xb4'),_0x222f08['uniqueid'],util['inspect'](_0x222f08,{'showHidden':![],'depth':null}));if(this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xb5')]]){this[_0x2a7d('0x1d')][_0x222f08['transfereeuniqueid']][_0x2a7d('0xb6')]=_0x222f08[_0x2a7d('0xb7')];this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xb5')]]['transferconnectedlinenum']=_0x222f08[_0x2a7d('0xb3')];if(this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xb8')]]){var _0xb43ca5=this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xb8')]];this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xb8')]]=this['channels'][_0x222f08[_0x2a7d('0xb5')]];this[_0x2a7d('0x1d')][_0x222f08['transfereeuniqueid']]=_0xb43ca5;}}else if(this['channels'][_0x222f08[_0x2a7d('0xb9')]]){this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xb9')]][_0x2a7d('0xb6')]=_0x222f08[_0x2a7d('0xb7')];this['channels'][_0x222f08[_0x2a7d('0xb9')]][_0x2a7d('0xba')]=_0x222f08[_0x2a7d('0xb3')];if(this[_0x2a7d('0x1d')][_0x222f08['origtransfereruniqueid']]){var _0xb43ca5=this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xbb')]];this['channels'][_0x222f08[_0x2a7d('0xbb')]]=this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xb9')]];this[_0x2a7d('0x1d')][_0x222f08['transfertargetuniqueid']]=_0xb43ca5;}}if((this[_0x2a7d('0x1d')][_0x222f08['origtransfereruniqueid']]||this[_0x2a7d('0x1d')][_0x222f08['origtransfererlinkedid']])&&this['channels'][_0x222f08[_0x2a7d('0xb8')]]){var _0x58a1e1=_['some']([this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xbb')]],this['channels'][_0x222f08['origtransfererlinkedid']],this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xb8')]]],function(_0x198402){return _0x198402&&_0x198402[_0x2a7d('0xbc')]===_0x2a7d('0xb1')&&_0x198402['routeid'];});if(_0x58a1e1){if(this['channels'][_0x222f08[_0x2a7d('0xbb')]])this['channels'][_0x222f08[_0x2a7d('0xbb')]][_0x2a7d('0xa5')]=_0x2a7d('0xbd');if(this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xbe')]])this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xbe')]][_0x2a7d('0xa5')]=_0x2a7d('0xbd');this[_0x2a7d('0x1d')][_0x222f08[_0x2a7d('0xb8')]][_0x2a7d('0xa5')]='ATTENDED';}}}}catch(_0x51a0b1){logger[_0x2a7d('0x34')](_0x2a7d('0xbf'),_0x222f08[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x51a0b1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2a7d('0x36')][_0x2a7d('0xc0')]=function(_0x2c5dfb){try{if(this[_0x2a7d('0x37')](_0x2c5dfb)){logger['info'](_0x2a7d('0xc1'),_0x2c5dfb[_0x2a7d('0x41')],_0x2c5dfb[_0x2a7d('0xc2')],_0x2c5dfb[_0x2a7d('0xc3')]);logger[_0x2a7d('0x52')](_0x2a7d('0xc4'),_0x2c5dfb[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x2c5dfb,{'showHidden':![],'depth':null}));if(this[_0x2a7d('0x1d')][_0x2c5dfb['transfereeuniqueid']]){this['channels'][_0x2c5dfb[_0x2a7d('0xb5')]][_0x2a7d('0xb6')]=_0x2c5dfb['transfereecalleridnum'];this[_0x2a7d('0x1d')][_0x2c5dfb['transfereeuniqueid']][_0x2a7d('0xba')]=_0x2c5dfb[_0x2a7d('0xc3')];this['channels'][_0x2c5dfb[_0x2a7d('0xb5')]][_0x2a7d('0xa5')]='BLIND';this[_0x2a7d('0x29')]({'event':_0x2a7d('0xaf'),'uniqueid':_0x2c5dfb[_0x2a7d('0xb5')],'context':_0x2c5dfb[_0x2a7d('0x45')],'channel':_0x2c5dfb[_0x2a7d('0xc5')]});}else{this[_0x2a7d('0x1d')][_0x2c5dfb[_0x2a7d('0xc6')]][_0x2a7d('0xa5')]=_0x2a7d('0xc7');}}}catch(_0x5a6359){logger[_0x2a7d('0x34')]('[%s][voiceCallReport][blindtransfer]',_0x2c5dfb['uniqueid'],util[_0x2a7d('0x3f')](_0x5a6359,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2a7d('0x36')][_0x2a7d('0x30')]=function(_0x332d13){try{if(this[_0x2a7d('0x37')](_0x332d13)){logger[_0x2a7d('0x52')](_0x2a7d('0xc8'),_0x332d13[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x332d13,{'showHidden':![],'depth':null}));if(this[_0x2a7d('0x1d')][_0x332d13['uniqueid']]){if(!_[_0x2a7d('0x7f')](this[_0x2a7d('0x1d')][_0x332d13[_0x2a7d('0x41')]][_0x2a7d('0x6d')])){this['channels'][_0x332d13[_0x2a7d('0x41')]][_0x2a7d('0xc9')]=moment()[_0x2a7d('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x2a7d('0x3a')](_0x2a7d('0xca'),_0x332d13[_0x2a7d('0x41')],this[_0x2a7d('0x1d')][_0x332d13[_0x2a7d('0x41')]]['mohstarttime']);}}}}catch(_0x1ddf16){logger[_0x2a7d('0x34')](_0x2a7d('0xcb'),_0x332d13[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x1ddf16,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x2a7d('0x31')]=function(_0x63f4){try{if(this[_0x2a7d('0x37')](_0x63f4)){logger[_0x2a7d('0x52')](_0x2a7d('0xcc'),_0x63f4[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x63f4,{'showHidden':![],'depth':null}));if(this[_0x2a7d('0x1d')][_0x63f4[_0x2a7d('0x41')]]){if(!_[_0x2a7d('0x7f')](this[_0x2a7d('0x1d')][_0x63f4[_0x2a7d('0x41')]][_0x2a7d('0xc9')])){this['channels'][_0x63f4['uniqueid']][_0x2a7d('0xcd')]+=moment()['milliseconds'](0x0)['diff'](this[_0x2a7d('0x1d')][_0x63f4['uniqueid']][_0x2a7d('0xc9')],_0x2a7d('0x64'));logger[_0x2a7d('0x3a')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x63f4[_0x2a7d('0x41')],this[_0x2a7d('0x1d')][_0x63f4['uniqueid']][_0x2a7d('0xcd')]);delete this[_0x2a7d('0x1d')][_0x63f4['uniqueid']]['mohstarttime'];}}}}catch(_0x24e18e){logger[_0x2a7d('0x34')](_0x2a7d('0xce'),_0x63f4[_0x2a7d('0x41')],util[_0x2a7d('0x3f')](_0x24e18e,{'showHidden':![],'depth':null}));}};module[_0x2a7d('0xcf')]=VoiceCallReport; \ No newline at end of file +var _0xcbf1=['bluebird','lodash','moment','util','path','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','merge','context','from-sip','split','exten','xcally-motion-preview','channel','connectedlinenum','format','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','pick','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','application','duration','seconds','keys','includes','lastdata','cdr(','match','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','membername','name','UserId','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','replace','.wav49','.WAV','isNil','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','omit','transferType','isEmpty','monitors','getSettings','then','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','origtransferercalleridnum','secondtransfereruniqueid','transfereeuniqueid','transfertargetuniqueid','transfercalleridnum','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfererchannel','transfereruniqueid','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]'];(function(_0xc98c07,_0x18ddb6){var _0x199a2a=function(_0xd35e9e){while(--_0xd35e9e){_0xc98c07['push'](_0xc98c07['shift']());}};_0x199a2a(++_0x18ddb6);}(_0xcbf1,0xc9));var _0x1cbf=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcbf1[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0x1cbf('0x0'));var _=require(_0x1cbf('0x1'));var moment=require(_0x1cbf('0x2'));var util=require(_0x1cbf('0x3'));var path=require(_0x1cbf('0x4'));var Redis=require('ioredis');var config=require(_0x1cbf('0x5'));var logger=require('../../../config/logger')(_0x1cbf('0x6'));var ami=require(_0x1cbf('0x7'));var Channel=require(_0x1cbf('0x8'));var RpcSetting=require(_0x1cbf('0x9'));var statusDesc=[_0x1cbf('0xa'),'not_inuse',_0x1cbf('0xb'),_0x1cbf('0xc'),_0x1cbf('0xd'),_0x1cbf('0xe'),_0x1cbf('0xf'),_0x1cbf('0x10'),_0x1cbf('0x11')];var applications=[_0x1cbf('0x12'),_0x1cbf('0x13'),_0x1cbf('0x14'),_0x1cbf('0x15'),_0x1cbf('0x16'),_0x1cbf('0x17')];var dispositions=[_0x1cbf('0x18'),'FAILED',_0x1cbf('0x19'),_0x1cbf('0x18'),_0x1cbf('0x18'),_0x1cbf('0x18'),_0x1cbf('0x1a'),_0x1cbf('0x1b'),_0x1cbf('0x19'),_0x1cbf('0x19'),'FAILED'];var actions={};config[_0x1cbf('0x1c')]=_['defaults'](config['redis'],{'host':_0x1cbf('0x1d'),'port':0x18eb});var io=require(_0x1cbf('0x1e'))(new Redis(config[_0x1cbf('0x1c')]));function VoiceCallReport(_0x3cc757){this[_0x1cbf('0x1f')]=_0x3cc757[_0x1cbf('0x1f')];this[_0x1cbf('0x20')]=_0x3cc757[_0x1cbf('0x20')];this[_0x1cbf('0x21')]={};ami['on']('coreshowchannel',this[_0x1cbf('0x22')][_0x1cbf('0x23')](this));ami['on'](_0x1cbf('0x24'),this[_0x1cbf('0x22')][_0x1cbf('0x23')](this));ami['on'](_0x1cbf('0x25'),this[_0x1cbf('0x26')]['bind'](this));ami['on'](_0x1cbf('0x27'),this[_0x1cbf('0x28')]['bind'](this));ami['on'](_0x1cbf('0x29'),this[_0x1cbf('0x2a')]['bind'](this));ami['on'](_0x1cbf('0x2b'),this['syncHangup'][_0x1cbf('0x23')](this));ami['on'](_0x1cbf('0x2c'),this[_0x1cbf('0x2d')]['bind'](this));ami['on'](_0x1cbf('0x2e'),this[_0x1cbf('0x2f')][_0x1cbf('0x23')](this));ami['on'](_0x1cbf('0x30'),this[_0x1cbf('0x31')]['bind'](this));ami['on']('musiconholdstart',this[_0x1cbf('0x32')][_0x1cbf('0x23')](this));ami['on'](_0x1cbf('0x33'),this[_0x1cbf('0x34')][_0x1cbf('0x23')](this));try{logger['info'](_0x1cbf('0x35'));ami['actionCoreShowChannels']();}catch(_0x56d6e2){logger[_0x1cbf('0x36')](_0x1cbf('0x37'),util[_0x1cbf('0x38')](_0x56d6e2,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x1cbf('0x39')][_0x1cbf('0x3a')]=function(_0x4fbf43){return _0x4fbf43!==null&&!_[_0x1cbf('0x3b')](_0x4fbf43);};VoiceCallReport[_0x1cbf('0x39')]['emit']=function(_0x2ef218,_0x45eec8,_0x1bfdeb){io['to'](_0x2ef218)[_0x1cbf('0x3c')](_0x45eec8,_0x1bfdeb);};VoiceCallReport[_0x1cbf('0x39')][_0x1cbf('0x2d')]=function(_0x4a9068){try{if(this[_0x1cbf('0x3a')](_0x4a9068)){logger[_0x1cbf('0x3d')](_0x1cbf('0x3e'),_0x4a9068[_0x1cbf('0x3f')],_0x4a9068[_0x1cbf('0x40')],_0x4a9068[_0x1cbf('0x41')]);logger[_0x1cbf('0x42')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x4a9068['uniqueid'],util['inspect'](_0x4a9068,{'showHidden':![],'depth':null}));if(_0x4a9068[_0x1cbf('0x3f')]===_0x4a9068['linkedid']){if(!_[_0x1cbf('0x3b')](this[_0x1cbf('0x1f')][_0x4a9068[_0x1cbf('0x3f')]])){_[_0x1cbf('0x43')](this[_0x1cbf('0x1f')][_0x4a9068[_0x1cbf('0x3f')]],_['pick'](_0x4a9068,_['keys'](this['channels'][_0x4a9068[_0x1cbf('0x3f')]])));}}if(_0x4a9068[_0x1cbf('0x44')]===_0x1cbf('0x45')){if(this[_0x1cbf('0x20')][_0x4a9068['channel'][_0x1cbf('0x46')]('-')[0x0]]){if(_0x4a9068[_0x1cbf('0x47')]==_0x1cbf('0x48')){this[_0x1cbf('0x20')][_0x4a9068[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]['destconnectedlinenum']=_0x4a9068[_0x1cbf('0x4a')];this[_0x1cbf('0x3c')](util[_0x1cbf('0x4b')]('user:%s',this[_0x1cbf('0x20')][_0x4a9068[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]['name']),_0x1cbf('0x4c'),{'destaccountcode':this[_0x1cbf('0x20')][_0x4a9068[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]][_0x1cbf('0x4d')],'destconnectedlinenum':_0x4a9068[_0x1cbf('0x4a')]});}}}}}catch(_0x3204de){logger[_0x1cbf('0x36')](_0x1cbf('0x4e'),_0x4a9068[_0x1cbf('0x3f')],util[_0x1cbf('0x38')](_0x3204de,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1cbf('0x39')]['syncNewChannel']=function(_0x25b2c6){try{if(this[_0x1cbf('0x3a')](_0x25b2c6)){logger[_0x1cbf('0x42')](_0x1cbf('0x4f'),_0x25b2c6[_0x1cbf('0x3f')],util[_0x1cbf('0x38')](_0x25b2c6,{'showHidden':![],'depth':null}));if(_0x25b2c6['uniqueid']===_0x25b2c6[_0x1cbf('0x50')]&&_0x25b2c6['channel']!=_0x1cbf('0x51')){if(_['isUndefined'](this['channels'][_0x25b2c6[_0x1cbf('0x3f')]])){logger[_0x1cbf('0x3d')](_0x1cbf('0x52'),_0x25b2c6['uniqueid'],_0x25b2c6['context'],_0x25b2c6[_0x1cbf('0x47')]);this[_0x1cbf('0x1f')][_0x25b2c6['uniqueid']]=new Channel();this[_0x1cbf('0x1f')][_0x25b2c6[_0x1cbf('0x3f')]][_0x1cbf('0x53')]=moment()[_0x1cbf('0x4b')](_0x1cbf('0x54'));this['channels'][_0x25b2c6[_0x1cbf('0x3f')]][_0x1cbf('0x55')]=dispositions[_[_0x1cbf('0x56')](_0x25b2c6[_0x1cbf('0x57')])];_[_0x1cbf('0x43')](this[_0x1cbf('0x1f')][_0x25b2c6['uniqueid']],_[_0x1cbf('0x58')](_0x25b2c6,_['keys'](this[_0x1cbf('0x1f')][_0x25b2c6[_0x1cbf('0x3f')]])));if(_0x25b2c6[_0x1cbf('0x44')]==='from-sip'){if(this[_0x1cbf('0x20')][_0x25b2c6[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]){if(_[_0x1cbf('0x3b')](this[_0x1cbf('0x20')][_0x25b2c6['channel'][_0x1cbf('0x46')]('-')[0x0]]['destconnectedlinenum'])){this['agents'][_0x25b2c6[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]['destconnectedlinenum']=_0x25b2c6['exten'];logger[_0x1cbf('0x42')](_0x1cbf('0x59'),_0x25b2c6[_0x1cbf('0x3f')],util[_0x1cbf('0x38')]({'destaccountcode':this[_0x1cbf('0x20')][_0x25b2c6[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x25b2c6[_0x1cbf('0x47')]},{'showHidden':![],'depth':null}));this[_0x1cbf('0x3c')](util[_0x1cbf('0x4b')](_0x1cbf('0x5a'),this[_0x1cbf('0x20')][_0x25b2c6[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]['name']),_0x1cbf('0x4c'),{'destaccountcode':this['agents'][_0x25b2c6[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]][_0x1cbf('0x4d')],'destconnectedlinenum':_0x25b2c6['exten']});}}}}}}}catch(_0x1269a6){logger[_0x1cbf('0x36')]('[%s][voiceCallReport][newchannel]',_0x25b2c6['uniqueid'],util[_0x1cbf('0x38')](_0x1269a6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1cbf('0x39')][_0x1cbf('0x22')]=function(_0x303c4e){try{if(this['isNotNull'](_0x303c4e)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x303c4e[_0x1cbf('0x3f')],util[_0x1cbf('0x38')](_0x303c4e,{'showHidden':![],'depth':null}));if(_0x303c4e[_0x1cbf('0x3f')]===_0x303c4e[_0x1cbf('0x50')]&&_0x303c4e['exten']!='h'&&_0x303c4e[_0x1cbf('0x49')]!=_0x1cbf('0x51')){_0x303c4e['application']=_0x303c4e['application'][_0x1cbf('0x5b')]();_0x303c4e[_0x1cbf('0x5c')]=_0x303c4e[_0x1cbf('0x5d')]&&_0x303c4e[_0x1cbf('0x5d')][_0x1cbf('0x5e')](_0x1cbf('0x5f'))?_0x303c4e[_0x1cbf('0x5d')]:(_0x303c4e[_0x1cbf('0x5d')]||_0x303c4e['applicationdata'])['toLowerCase']();logger[_0x1cbf('0x3d')](_0x1cbf('0x60'),_0x303c4e[_0x1cbf('0x3f')],_0x303c4e[_0x1cbf('0x61')],_0x303c4e[_0x1cbf('0x5c')]);if(_[_0x1cbf('0x3b')](this[_0x1cbf('0x1f')][_0x303c4e[_0x1cbf('0x3f')]])){this['channels'][_0x303c4e[_0x1cbf('0x3f')]]=new Channel();this['channels'][_0x303c4e[_0x1cbf('0x3f')]][_0x1cbf('0x53')]=_0x303c4e[_0x1cbf('0x62')]?moment()['subtract'](moment['duration'](_0x303c4e[_0x1cbf('0x62')])[_0x1cbf('0x63')](),'seconds')[_0x1cbf('0x4b')](_0x1cbf('0x54')):moment()[_0x1cbf('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x303c4e[_0x1cbf('0x3f')]][_0x1cbf('0x55')]=_0x1cbf('0x18');}_[_0x1cbf('0x43')](this[_0x1cbf('0x1f')][_0x303c4e['uniqueid']],_[_0x1cbf('0x58')](_0x303c4e,_[_0x1cbf('0x64')](this['channels'][_0x303c4e[_0x1cbf('0x3f')]])));if(_[_0x1cbf('0x65')](applications,_0x303c4e[_0x1cbf('0x61')])){this['channels'][_0x303c4e[_0x1cbf('0x3f')]]['lastapplication']=_0x303c4e[_0x1cbf('0x61')];this[_0x1cbf('0x1f')][_0x303c4e[_0x1cbf('0x3f')]][_0x1cbf('0x66')]=_0x303c4e['applicationdata'];if(_0x303c4e[_0x1cbf('0x61')]==='set'&&_['startsWith'](_0x303c4e[_0x1cbf('0x5c')][_0x1cbf('0x5b')](),_0x1cbf('0x67'))){var _0x3433fd=_0x303c4e['applicationdata']['split']('=');var _0x1aa5df=_0x3433fd[0x0]['toLowerCase']()[_0x1cbf('0x68')](/cdr\((.*)\)/);if(_0x1aa5df){this['channels'][_0x303c4e[_0x1cbf('0x3f')]][_0x1aa5df[0x1]]=_0x3433fd[0x1];}}else if(_0x303c4e[_0x1cbf('0x61')]===_0x1cbf('0x13')){this[_0x1cbf('0x1f')][_0x303c4e[_0x1cbf('0x3f')]][_0x1cbf('0x13')]=_0x303c4e[_0x1cbf('0x5c')][_0x1cbf('0x46')](',')[0x0];}}}}}catch(_0x36441a){logger[_0x1cbf('0x36')]('[%s][voiceCallReport][newexten]',_0x303c4e[_0x1cbf('0x3f')],util[_0x1cbf('0x38')](_0x36441a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1cbf('0x39')][_0x1cbf('0x28')]=function(_0x5336be){try{if(this[_0x1cbf('0x3a')](_0x5336be)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x5336be['uniqueid'],_0x5336be['linkedid'],_0x5336be[_0x1cbf('0x40')],_0x5336be[_0x1cbf('0x41')]);logger['debug'](_0x1cbf('0x69'),_0x5336be[_0x1cbf('0x3f')],util['inspect'](_0x5336be,{'showHidden':![],'depth':null}));if(_0x5336be['uniqueid']!==_0x5336be[_0x1cbf('0x50')]){if(this['channels'][_0x5336be[_0x1cbf('0x50')]]){if(_0x5336be[_0x1cbf('0x57')]==='6'){if(!this[_0x1cbf('0x1f')][_0x5336be['linkedid']][_0x1cbf('0x6a')]){var _0x49a75a=moment();this[_0x1cbf('0x1f')][_0x5336be[_0x1cbf('0x50')]][_0x1cbf('0x6a')]=!![];this[_0x1cbf('0x1f')][_0x5336be['linkedid']][_0x1cbf('0x6b')]=_0x49a75a[_0x1cbf('0x4b')](_0x1cbf('0x54'));if(this['channels'][_0x5336be[_0x1cbf('0x50')]]['starttime']){this[_0x1cbf('0x1f')][_0x5336be[_0x1cbf('0x50')]][_0x1cbf('0x6c')]=_0x49a75a[_0x1cbf('0x6d')](this[_0x1cbf('0x1f')][_0x5336be[_0x1cbf('0x50')]][_0x1cbf('0x53')],'seconds');}}this[_0x1cbf('0x1f')][_0x5336be[_0x1cbf('0x50')]]['linkedid']=_0x5336be[_0x1cbf('0x3f')];if(_0x5336be[_0x1cbf('0x41')]!==_0x1cbf('0x48')){this[_0x1cbf('0x1f')][_0x5336be[_0x1cbf('0x50')]][_0x1cbf('0x4a')]=_0x5336be['calleridnum'];}this['channels'][_0x5336be[_0x1cbf('0x50')]][_0x1cbf('0x6e')]=_0x5336be[_0x1cbf('0x40')];this['channels'][_0x5336be[_0x1cbf('0x50')]][_0x1cbf('0x6f')]=_0x5336be[_0x1cbf('0x49')];this['channels'][_0x5336be['linkedid']][_0x1cbf('0x55')]=dispositions[_[_0x1cbf('0x56')](_0x5336be[_0x1cbf('0x57')])];if(this[_0x1cbf('0x20')][_0x5336be['channel'][_0x1cbf('0x46')]('-')[0x0]]){this[_0x1cbf('0x1f')][_0x5336be[_0x1cbf('0x50')]]['UserId']=this[_0x1cbf('0x20')][_0x5336be[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]['id'];this[_0x1cbf('0x1f')][_0x5336be[_0x1cbf('0x50')]][_0x1cbf('0x70')]=this['agents'][_0x5336be['channel'][_0x1cbf('0x46')]('-')[0x0]][_0x1cbf('0x71')];}}}}else{if(this['channels'][_0x5336be[_0x1cbf('0x3f')]]){if(_0x5336be[_0x1cbf('0x57')]==='6'){if(this[_0x1cbf('0x20')][_0x5336be['channel'][_0x1cbf('0x46')]('-')[0x0]]){this[_0x1cbf('0x1f')][_0x5336be[_0x1cbf('0x3f')]][_0x1cbf('0x72')]=this[_0x1cbf('0x20')][_0x5336be[_0x1cbf('0x49')]['split']('-')[0x0]]['id'];this['channels'][_0x5336be[_0x1cbf('0x3f')]][_0x1cbf('0x70')]=this['agents'][_0x5336be[_0x1cbf('0x49')]['split']('-')[0x0]][_0x1cbf('0x71')];}}}}if(_0x5336be['channelstate']==='6'&&_0x5336be[_0x1cbf('0x44')]===_0x1cbf('0x45')){if(this['agents'][_0x5336be[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]){this[_0x1cbf('0x20')][_0x5336be[_0x1cbf('0x49')]['split']('-')[0x0]]['destconnectedlinenum']=_0x5336be[_0x1cbf('0x47')];var _0x4ce287;if(this['channels'][_0x5336be[_0x1cbf('0x3f')]])_0x4ce287=this[_0x1cbf('0x1f')][_0x5336be[_0x1cbf('0x3f')]][_0x1cbf('0x73')];else if(this[_0x1cbf('0x1f')][_0x5336be[_0x1cbf('0x50')]])_0x4ce287=this[_0x1cbf('0x1f')][_0x5336be['linkedid']]['routealias'];logger[_0x1cbf('0x42')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x5336be['uniqueid'],util[_0x1cbf('0x38')]({'destaccountcode':this[_0x1cbf('0x20')][_0x5336be[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]][_0x1cbf('0x4d')],'destconnectedlinenum':_0x5336be[_0x1cbf('0x47')],'routealias':_0x4ce287},{'showHidden':![],'depth':null}));this[_0x1cbf('0x3c')](util[_0x1cbf('0x4b')](_0x1cbf('0x5a'),this[_0x1cbf('0x20')][_0x5336be[_0x1cbf('0x49')]['split']('-')[0x0]]['name']),_0x1cbf('0x4c'),{'destaccountcode':this[_0x1cbf('0x20')][_0x5336be[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5336be[_0x1cbf('0x47')],'routealias':_0x4ce287});}}}}catch(_0x5c89ce){logger[_0x1cbf('0x36')](_0x1cbf('0x74'),_0x5336be['uniqueid'],util[_0x1cbf('0x38')](_0x5c89ce,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1cbf('0x75')]=function(_0x4f5f8d,_0x453ef4){try{if(this['channels'][_0x4f5f8d]){logger[_0x1cbf('0x3d')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x4f5f8d,_0x453ef4);this[_0x1cbf('0x1f')][_0x4f5f8d]['monitor']=!![];if(_['endsWith'](_0x453ef4,'.wav49')){_0x453ef4=_0x453ef4[_0x1cbf('0x76')](_0x1cbf('0x77'),_0x1cbf('0x78'));}this[_0x1cbf('0x1f')][_0x4f5f8d]['monitorFilename']=_0x453ef4;var _0x5b0d52=_['find'](this['channels'][_0x4f5f8d]['monitors'],{'filename':_0x453ef4});if(_[_0x1cbf('0x79')](_0x5b0d52)){this[_0x1cbf('0x1f')][_0x4f5f8d]['monitors']['push']({'filename':_0x453ef4,'createdAt':moment()[_0x1cbf('0x4b')](_0x1cbf('0x54')),'mixmonitorid':'','status':_0x1cbf('0x7a')});}}}catch(_0x167c73){logger[_0x1cbf('0x36')]('[%s][voiceCallReport][mixMonitorFilename]',_0x4f5f8d,util[_0x1cbf('0x38')](_0x167c73,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1cbf('0x39')][_0x1cbf('0x2a')]=function(_0x2ce609){try{if(this[_0x1cbf('0x3a')](_0x2ce609)){logger[_0x1cbf('0x42')](_0x1cbf('0x7b'),_0x2ce609[_0x1cbf('0x3f')],util[_0x1cbf('0x38')](_0x2ce609,{'showHidden':![],'depth':null}));if(this[_0x1cbf('0x1f')][_0x2ce609['uniqueid']]&&_0x2ce609[_0x1cbf('0x49')]!=_0x1cbf('0x51')){if(this[_0x1cbf('0x3a')](_0x2ce609[_0x1cbf('0x7c')])){if(this[_0x1cbf('0x3a')](_0x2ce609['variable'][_0x1cbf('0x7d')])){logger[_0x1cbf('0x3d')](_0x1cbf('0x7e'),_0x2ce609[_0x1cbf('0x3f')],_0x2ce609['value']);this[_0x1cbf('0x75')](_0x2ce609[_0x1cbf('0x3f')],_0x2ce609['value']);}else if(this[_0x1cbf('0x3a')](_0x2ce609[_0x1cbf('0x7c')][_0x1cbf('0x7f')])){logger[_0x1cbf('0x3d')](_0x1cbf('0x80'),_0x2ce609[_0x1cbf('0x3f')],_0x2ce609['value']);this[_0x1cbf('0x1f')][_0x2ce609[_0x1cbf('0x3f')]][_0x1cbf('0x41')]=_0x2ce609['value'];}else if(this['isNotNull'](_0x2ce609[_0x1cbf('0x7c')][_0x1cbf('0x81')])){logger[_0x1cbf('0x3d')](_0x1cbf('0x82'),_0x2ce609[_0x1cbf('0x3f')],_0x2ce609[_0x1cbf('0x83')]);this[_0x1cbf('0x1f')][_0x2ce609[_0x1cbf('0x3f')]]['callerid']=_0x2ce609[_0x1cbf('0x83')];}else if(this[_0x1cbf('0x3a')](_0x2ce609['variable']['xmd-cdrtype'])){logger[_0x1cbf('0x3d')](_0x1cbf('0x84'),_0x2ce609[_0x1cbf('0x3f')],_0x2ce609[_0x1cbf('0x83')]);this[_0x1cbf('0x1f')][_0x2ce609[_0x1cbf('0x3f')]][_0x1cbf('0x85')]=_0x2ce609[_0x1cbf('0x83')];}else if(this['isNotNull'](_0x2ce609[_0x1cbf('0x7c')][_0x1cbf('0x86')])){logger[_0x1cbf('0x3d')](_0x1cbf('0x87'),_0x2ce609['uniqueid'],_0x2ce609['value'][_0x1cbf('0x46')](',')[0x0]);this[_0x1cbf('0x1f')][_0x2ce609[_0x1cbf('0x3f')]][_0x1cbf('0x13')]=_0x2ce609[_0x1cbf('0x83')]['split'](',')[0x0];}else if(this[_0x1cbf('0x3a')](_0x2ce609[_0x1cbf('0x7c')][_0x1cbf('0x88')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2ce609['uniqueid'],_0x2ce609[_0x1cbf('0x83')]);this[_0x1cbf('0x1f')][_0x2ce609[_0x1cbf('0x3f')]][_0x1cbf('0x89')]=_0x2ce609[_0x1cbf('0x83')];}else if(this[_0x1cbf('0x3a')](_0x2ce609[_0x1cbf('0x7c')][_0x1cbf('0x8a')])){logger[_0x1cbf('0x3d')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x2ce609[_0x1cbf('0x3f')],_0x2ce609[_0x1cbf('0x83')]);this['channels'][_0x2ce609['uniqueid']][_0x1cbf('0x8b')]=_0x2ce609[_0x1cbf('0x83')];}else if(this[_0x1cbf('0x3a')](_0x2ce609['variable']['xmd-callerid-preview'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x2ce609['uniqueid'],_0x2ce609[_0x1cbf('0x83')]);this[_0x1cbf('0x1f')][_0x2ce609[_0x1cbf('0x3f')]]['calleridpreview']=_0x2ce609['value'];}else if(this['isNotNull'](_0x2ce609[_0x1cbf('0x7c')][_0x1cbf('0x8c')])){logger[_0x1cbf('0x3d')](_0x1cbf('0x8d'),_0x2ce609[_0x1cbf('0x3f')],_0x2ce609['value']);this['channels'][_0x2ce609['uniqueid']][_0x1cbf('0x13')]=_0x2ce609['value'];}else if(this[_0x1cbf('0x3a')](_0x2ce609['variable'][_0x1cbf('0x8e')])){logger[_0x1cbf('0x3d')](_0x1cbf('0x8f'),_0x2ce609[_0x1cbf('0x3f')],_0x2ce609['value']);this[_0x1cbf('0x1f')][_0x2ce609[_0x1cbf('0x3f')]][_0x1cbf('0x90')]=_0x2ce609[_0x1cbf('0x83')];}}}else if(this[_0x1cbf('0x3a')](_0x2ce609[_0x1cbf('0x7c')]['mixmonitor_filename'])){if(_0x2ce609['value']){var _0x1f5388=path[_0x1cbf('0x91')](_0x2ce609[_0x1cbf('0x83')])[_0x1cbf('0x71')];logger[_0x1cbf('0x3d')](_0x1cbf('0x7e'),_0x1f5388,_0x2ce609['value']);this['syncMixMonitorFilename'](_0x1f5388,_0x2ce609[_0x1cbf('0x83')]);}}else if(this[_0x1cbf('0x1f')][_0x2ce609[_0x1cbf('0x50')]]){if(this['isNotNull'](_0x2ce609[_0x1cbf('0x7c')])){if(this[_0x1cbf('0x3a')](_0x2ce609[_0x1cbf('0x7c')][_0x1cbf('0x8e')])){logger[_0x1cbf('0x3d')](_0x1cbf('0x8f'),_0x2ce609[_0x1cbf('0x50')],_0x2ce609[_0x1cbf('0x83')]);this['channels'][_0x2ce609[_0x1cbf('0x50')]]['sipcalllinkedid']=_0x2ce609[_0x1cbf('0x83')];}}}}}catch(_0xa0f92c){logger[_0x1cbf('0x36')](_0x1cbf('0x92'),_0x2ce609['uniqueid'],util[_0x1cbf('0x38')](_0xa0f92c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1cbf('0x93')]=function(_0x12f52b){try{if(this[_0x1cbf('0x3a')](_0x12f52b)){logger[_0x1cbf('0x42')](_0x1cbf('0x94'),_0x12f52b['uniqueid'],util[_0x1cbf('0x38')](_0x12f52b,{'showHidden':![],'depth':null}));if(this['channels'][_0x12f52b[_0x1cbf('0x3f')]]){logger[_0x1cbf('0x3d')](_0x1cbf('0x95'),_0x12f52b['uniqueid'],_0x12f52b[_0x1cbf('0x96')]);var _0xa32d95=moment();this[_0x1cbf('0x1f')][_0x12f52b[_0x1cbf('0x3f')]]['endtime']=_0xa32d95[_0x1cbf('0x4b')](_0x1cbf('0x54'));this[_0x1cbf('0x1f')][_0x12f52b['uniqueid']][_0x1cbf('0x62')]=_0xa32d95[_0x1cbf('0x6d')](this[_0x1cbf('0x1f')][_0x12f52b['uniqueid']]['starttime'],'seconds');if(this[_0x1cbf('0x1f')][_0x12f52b[_0x1cbf('0x3f')]][_0x1cbf('0x6a')]){this[_0x1cbf('0x1f')][_0x12f52b[_0x1cbf('0x3f')]]['billableseconds']=_0xa32d95[_0x1cbf('0x6d')](this['channels'][_0x12f52b[_0x1cbf('0x3f')]]['answertime'],_0x1cbf('0x63'));this[_0x1cbf('0x1f')][_0x12f52b[_0x1cbf('0x3f')]]['holdtime']=this[_0x1cbf('0x1f')][_0x12f52b[_0x1cbf('0x3f')]][_0x1cbf('0x62')]-this[_0x1cbf('0x1f')][_0x12f52b[_0x1cbf('0x3f')]][_0x1cbf('0x97')];}if(_0x12f52b['context']===_0x1cbf('0x45')){if(this['agents'][_0x12f52b[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]){this[_0x1cbf('0x20')][_0x12f52b[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]=_[_0x1cbf('0x98')](this[_0x1cbf('0x20')][_0x12f52b[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]],['destconnectedlinenum']);logger[_0x1cbf('0x42')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x12f52b['uniqueid'],util[_0x1cbf('0x38')]({'id':this[_0x1cbf('0x20')][_0x12f52b[_0x1cbf('0x49')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x12f52b['channel'][_0x1cbf('0x46')]('-')[0x0]][_0x1cbf('0x4d')]},{'showHidden':![],'depth':null}));this[_0x1cbf('0x3c')](util['format'](_0x1cbf('0x5a'),this[_0x1cbf('0x20')][_0x12f52b['channel'][_0x1cbf('0x46')]('-')[0x0]]['name']),'user:agentcomplete',{'id':this[_0x1cbf('0x20')][_0x12f52b[_0x1cbf('0x49')][_0x1cbf('0x46')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x12f52b['channel'][_0x1cbf('0x46')]('-')[0x0]][_0x1cbf('0x4d')]});}}var _0x5e4bd1=this;Promise['resolve']()['then'](function(){var _0x2e3fa6=_0x5e4bd1['channels'][_0x12f52b[_0x1cbf('0x3f')]];if(typeof _0x2e3fa6[_0x1cbf('0x99')]==='undefined')return;if(_[_0x1cbf('0x9a')](_0x2e3fa6[_0x1cbf('0x9b')]))return;return RpcSetting[_0x1cbf('0x9c')]()[_0x1cbf('0x9d')](function(_0x562e5d){if(!_0x562e5d[_0x1cbf('0x9e')])return;return Promise[_0x1cbf('0x9f')]()[_0x1cbf('0x9d')](function(){return ami[_0x1cbf('0xa0')]({'action':_0x1cbf('0xa1'),'channel':_0x2e3fa6[_0x1cbf('0x49')]})[_0x1cbf('0xa2')](function(){});})[_0x1cbf('0x9d')](function(){return ami[_0x1cbf('0xa0')]({'action':_0x1cbf('0xa1'),'channel':_0x2e3fa6['destinationchannel']})['catch'](function(){})[_0x1cbf('0xa3')](function(){var _0x1333b8=_0x5e4bd1[_0x1cbf('0x20')][_0x2e3fa6[_0x1cbf('0x6f')][_0x1cbf('0x46')]('-')[0x0]];if(!_0x1333b8)return;io['emit'](_0x1cbf('0xa4'),{'agentId':_0x1333b8['id'],'uniqueid':_0x2e3fa6[_0x1cbf('0x3f')]});});});});})[_0x1cbf('0x9d')](function(){if(_0x12f52b[_0x1cbf('0xa5')]===_0x1cbf('0xa6')){_0x5e4bd1[_0x1cbf('0x21')][_0x12f52b['uniqueid']]=_0x5e4bd1[_0x1cbf('0x1f')][_0x12f52b['uniqueid']];}else{if(_0x5e4bd1[_0x1cbf('0x1f')][_0x12f52b[_0x1cbf('0x3f')]][_0x1cbf('0x85')]==='outbound'&&_0x5e4bd1[_0x1cbf('0x21')][_0x12f52b['uniqueid']]){_0x5e4bd1[_0x1cbf('0x1f')][_0x12f52b[_0x1cbf('0x3f')]][_0x1cbf('0x3f')]=[_0x5e4bd1[_0x1cbf('0x1f')][_0x12f52b[_0x1cbf('0x3f')]][_0x1cbf('0x50')],_0x5e4bd1['channels'][_0x12f52b[_0x1cbf('0x3f')]][_0x1cbf('0x50')]=_0x5e4bd1['channels'][_0x12f52b[_0x1cbf('0x3f')]][_0x1cbf('0x3f')]][0x0];delete _0x5e4bd1[_0x1cbf('0x21')][_0x12f52b[_0x1cbf('0x3f')]];}}logger[_0x1cbf('0x42')](_0x1cbf('0xa7'),_0x12f52b[_0x1cbf('0x3f')],util['inspect'](_0x5e4bd1['channels'][_0x12f52b[_0x1cbf('0x3f')]],{'showHidden':![],'depth':null}));ami['emit'](_0x1cbf('0xa8'),_0x5e4bd1[_0x1cbf('0x1f')][_0x12f52b[_0x1cbf('0x3f')]]);delete _0x5e4bd1['channels'][_0x12f52b['uniqueid']];});}}}catch(_0x9dc211){logger[_0x1cbf('0x36')](_0x1cbf('0xa9'),_0x12f52b[_0x1cbf('0x3f')],util['inspect'](_0x9dc211,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1cbf('0x39')]['syncAttendedTransfer']=function(_0x5bbd00){try{if(this[_0x1cbf('0x3a')](_0x5bbd00)){logger[_0x1cbf('0x3d')](_0x1cbf('0xaa'),_0x5bbd00[_0x1cbf('0x3f')],_0x5bbd00['origtransferercalleridnum'],_0x5bbd00[_0x1cbf('0xab')]);logger[_0x1cbf('0x42')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x5bbd00[_0x1cbf('0x3f')],util[_0x1cbf('0x38')](_0x5bbd00,{'showHidden':![],'depth':null}));if(this['channels'][_0x5bbd00['transfereeuniqueid']]){this[_0x1cbf('0x1f')][_0x5bbd00['transfereeuniqueid']]['transfercalleridnum']=_0x5bbd00[_0x1cbf('0xac')];this[_0x1cbf('0x1f')][_0x5bbd00['transfereeuniqueid']]['transferconnectedlinenum']=_0x5bbd00[_0x1cbf('0xab')];if(this['channels'][_0x5bbd00['secondtransfereruniqueid']]){var _0x27f6f5=this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xad')]];this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xad')]]=this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xae')]];this['channels'][_0x5bbd00[_0x1cbf('0xae')]]=_0x27f6f5;}}else if(this['channels'][_0x5bbd00[_0x1cbf('0xaf')]]){this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xaf')]][_0x1cbf('0xb0')]=_0x5bbd00[_0x1cbf('0xac')];this['channels'][_0x5bbd00[_0x1cbf('0xaf')]][_0x1cbf('0xb1')]=_0x5bbd00[_0x1cbf('0xab')];if(this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xb2')]]){var _0x27f6f5=this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xb2')]];this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xb2')]]=this['channels'][_0x5bbd00[_0x1cbf('0xaf')]];this[_0x1cbf('0x1f')][_0x5bbd00['transfertargetuniqueid']]=_0x27f6f5;}}if((this[_0x1cbf('0x1f')][_0x5bbd00['origtransfereruniqueid']]||this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xb3')]])&&this['channels'][_0x5bbd00['secondtransfereruniqueid']]){var _0x265764=_[_0x1cbf('0xb4')]([this['channels'][_0x5bbd00['origtransfereruniqueid']],this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xb3')]],this['channels'][_0x5bbd00[_0x1cbf('0xad')]]],function(_0x2bcc36){return _0x2bcc36&&_0x2bcc36[_0x1cbf('0x85')]===_0x1cbf('0xb5')&&_0x2bcc36[_0x1cbf('0xb6')];});if(_0x265764){if(this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xb2')]])this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xb2')]][_0x1cbf('0x99')]=_0x1cbf('0xb7');if(this[_0x1cbf('0x1f')][_0x5bbd00['origtransfererlinkedid']])this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xb3')]]['transferType']='ATTENDED';this[_0x1cbf('0x1f')][_0x5bbd00[_0x1cbf('0xad')]][_0x1cbf('0x99')]=_0x1cbf('0xb7');}}}}catch(_0x2a0f7a){logger[_0x1cbf('0x36')](_0x1cbf('0xb8'),_0x5bbd00[_0x1cbf('0x3f')],util[_0x1cbf('0x38')](_0x2a0f7a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1cbf('0x39')][_0x1cbf('0x31')]=function(_0x4afb3a){try{if(this[_0x1cbf('0x3a')](_0x4afb3a)){logger[_0x1cbf('0x3d')](_0x1cbf('0xb9'),_0x4afb3a[_0x1cbf('0x3f')],_0x4afb3a[_0x1cbf('0xba')],_0x4afb3a[_0x1cbf('0xbb')]);logger[_0x1cbf('0x42')](_0x1cbf('0xbc'),_0x4afb3a['uniqueid'],util[_0x1cbf('0x38')](_0x4afb3a,{'showHidden':![],'depth':null}));if(this[_0x1cbf('0x1f')][_0x4afb3a[_0x1cbf('0xae')]]){this[_0x1cbf('0x1f')][_0x4afb3a[_0x1cbf('0xae')]][_0x1cbf('0xb0')]=_0x4afb3a[_0x1cbf('0xba')];this[_0x1cbf('0x1f')][_0x4afb3a[_0x1cbf('0xae')]][_0x1cbf('0xb1')]=_0x4afb3a[_0x1cbf('0xbb')];this['channels'][_0x4afb3a[_0x1cbf('0xae')]][_0x1cbf('0x99')]='BLIND';this[_0x1cbf('0x93')]({'event':_0x1cbf('0xa6'),'uniqueid':_0x4afb3a[_0x1cbf('0xae')],'context':_0x4afb3a[_0x1cbf('0x44')],'channel':_0x4afb3a[_0x1cbf('0xbd')]});}else{this[_0x1cbf('0x1f')][_0x4afb3a[_0x1cbf('0xbe')]][_0x1cbf('0x99')]=_0x1cbf('0xbf');}}}catch(_0x2ca686){logger['error'](_0x1cbf('0xc0'),_0x4afb3a[_0x1cbf('0x3f')],util['inspect'](_0x2ca686,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1cbf('0x39')][_0x1cbf('0x32')]=function(_0x32ff9d){try{if(this['isNotNull'](_0x32ff9d)){logger['debug'](_0x1cbf('0xc1'),_0x32ff9d[_0x1cbf('0x3f')],util['inspect'](_0x32ff9d,{'showHidden':![],'depth':null}));if(this['channels'][_0x32ff9d[_0x1cbf('0x3f')]]){if(!_['isNil'](this[_0x1cbf('0x1f')][_0x32ff9d[_0x1cbf('0x3f')]][_0x1cbf('0x6b')])){this['channels'][_0x32ff9d[_0x1cbf('0x3f')]][_0x1cbf('0xc2')]=moment()[_0x1cbf('0x4b')](_0x1cbf('0x54'));logger[_0x1cbf('0x3d')](_0x1cbf('0xc3'),_0x32ff9d[_0x1cbf('0x3f')],this[_0x1cbf('0x1f')][_0x32ff9d[_0x1cbf('0x3f')]][_0x1cbf('0xc2')]);}}}}catch(_0x8774a0){logger[_0x1cbf('0x36')](_0x1cbf('0xc4'),_0x32ff9d[_0x1cbf('0x3f')],util[_0x1cbf('0x38')](_0x8774a0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1cbf('0x39')][_0x1cbf('0x34')]=function(_0x332a3d){try{if(this[_0x1cbf('0x3a')](_0x332a3d)){logger[_0x1cbf('0x42')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x332a3d['uniqueid'],util[_0x1cbf('0x38')](_0x332a3d,{'showHidden':![],'depth':null}));if(this[_0x1cbf('0x1f')][_0x332a3d['uniqueid']]){if(!_['isNil'](this[_0x1cbf('0x1f')][_0x332a3d[_0x1cbf('0x3f')]][_0x1cbf('0xc2')])){this[_0x1cbf('0x1f')][_0x332a3d['uniqueid']][_0x1cbf('0xc5')]+=moment()[_0x1cbf('0xc6')](0x0)[_0x1cbf('0x6d')](this[_0x1cbf('0x1f')][_0x332a3d[_0x1cbf('0x3f')]][_0x1cbf('0xc2')],_0x1cbf('0x63'));logger[_0x1cbf('0x3d')](_0x1cbf('0xc7'),_0x332a3d[_0x1cbf('0x3f')],this['channels'][_0x332a3d[_0x1cbf('0x3f')]][_0x1cbf('0xc5')]);delete this['channels'][_0x332a3d[_0x1cbf('0x3f')]][_0x1cbf('0xc2')];}}}}catch(_0x4adff4){logger[_0x1cbf('0x36')](_0x1cbf('0xc8'),_0x332a3d['uniqueid'],util['inspect'](_0x4adff4,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index a599dd9..127e80e 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0be8=['newexten','syncNewExten','hangup','syncHangup','prototype','isUndefined','emit','syncDialBegin','isNotNull','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','format','channel','substring','lastIndexOf','omit','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','merge','voice:outbound','custom:dialbegin','error','dialstatus','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','connect','info','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','membercalls','memberlastcall','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','lastevent','total','billableseconds','holdtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','voice_outbound:save','stringify','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','appdata','toLowerCase','startsWith','cdr(','split','[%s][voiceDialReport][newexten]','lodash','util','ioredis','../../../config/environment','../ami','redis','defaults','socket.io-emitter','channels','outbound','applications','dialbegin','bind','dialend','syncDialEnd','varset','syncVarSet'];(function(_0x7b2395,_0xca4664){var _0x85cba2=function(_0x103e21){while(--_0x103e21){_0x7b2395['push'](_0x7b2395['shift']());}};_0x85cba2(++_0xca4664);}(_0x0be8,0x142));var _0x80be=function(_0x5a5d41,_0x3ee827){_0x5a5d41=_0x5a5d41-0x0;var _0x2de42e=_0x0be8[_0x5a5d41];return _0x2de42e;};'use strict';var _=require(_0x80be('0x0'));var moment=require('moment');var util=require(_0x80be('0x1'));var Redis=require(_0x80be('0x2'));var config=require(_0x80be('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0x80be('0x4'));config[_0x80be('0x5')]=_[_0x80be('0x6')](config[_0x80be('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x80be('0x7'))(new Redis(config[_0x80be('0x5')]));function VoiceDialReport(_0x46343d){this[_0x80be('0x8')]=_0x46343d['outboundChannels'];this[_0x80be('0x9')]=_0x46343d[_0x80be('0x9')];this[_0x80be('0xa')]={};this['variables']={};ami['on'](_0x80be('0xb'),this['syncDialBegin'][_0x80be('0xc')](this));ami['on'](_0x80be('0xd'),this[_0x80be('0xe')]['bind'](this));ami['on'](_0x80be('0xf'),this[_0x80be('0x10')][_0x80be('0xc')](this));ami['on'](_0x80be('0x11'),this[_0x80be('0x12')]['bind'](this));ami['on'](_0x80be('0x13'),this[_0x80be('0x14')][_0x80be('0xc')](this));}VoiceDialReport[_0x80be('0x15')]['isNotNull']=function(_0x20f838){return _0x20f838!==null&&!_[_0x80be('0x16')](_0x20f838);};VoiceDialReport[_0x80be('0x15')][_0x80be('0x17')]=function(_0x12ec3b,_0x1e26ba,_0x9750ee){io['to'](_0x12ec3b)[_0x80be('0x17')](_0x1e26ba,_0x9750ee);};VoiceDialReport[_0x80be('0x15')][_0x80be('0x18')]=function(_0x4d1479){try{if(this[_0x80be('0x19')](_0x4d1479)){logger['debug'](_0x80be('0x1a'),_0x4d1479[_0x80be('0x1b')],util['inspect'](_0x4d1479,{'showHidden':![],'depth':null}));if(this[_0x80be('0x8')][_0x4d1479[_0x80be('0x1b')]]){_['merge'](this['channels'][_0x4d1479[_0x80be('0x1b')]],{'starttime':moment()[_0x80be('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x4d1479[_0x80be('0x1d')][_0x80be('0x1e')](0x0,_0x4d1479[_0x80be('0x1d')][_0x80be('0x1f')]('-')),'membername':_0x4d1479['channel']['substring'](_0x4d1479[_0x80be('0x1d')]['lastIndexOf']('/')+0x1,_0x4d1479[_0x80be('0x1d')][_0x80be('0x1f')]('-'))},_[_0x80be('0x20')](_0x4d1479,[_0x80be('0x21'),_0x80be('0x22')]));logger['info'](_0x80be('0x23'),_0x4d1479[_0x80be('0x1b')],this['channels'][_0x4d1479[_0x80be('0x1b')]][_0x80be('0x24')],this['channels'][_0x4d1479[_0x80be('0x1b')]]['interface']);logger[_0x80be('0x25')](_0x80be('0x26'),_0x4d1479[_0x80be('0x1b')],util[_0x80be('0x27')](this[_0x80be('0x8')][_0x4d1479[_0x80be('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x80be('0xa')][_0x4d1479[_0x80be('0x1b')]])_[_0x80be('0x28')](this[_0x80be('0x8')][_0x4d1479['uniqueid']],this[_0x80be('0xa')][_0x4d1479[_0x80be('0x1b')]]);this[_0x80be('0x17')](_0x80be('0x29'),'voice_outbound_channel:save',this[_0x80be('0x8')][_0x4d1479[_0x80be('0x1b')]]);logger[_0x80be('0x25')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x4d1479[_0x80be('0x1b')],util[_0x80be('0x27')](this[_0x80be('0x8')][_0x4d1479[_0x80be('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x80be('0x17')](_0x80be('0x2a'),this[_0x80be('0x8')][_0x4d1479[_0x80be('0x1b')]]);}}}catch(_0x1d43eb){logger[_0x80be('0x2b')]('[%s][voiceDialReport][dialbegin]',_0x4d1479['uniqueid'],util['inspect'](_0x1d43eb,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x80be('0x15')][_0x80be('0xe')]=function(_0x1918f3){try{if(this['isNotNull'](_0x1918f3)){logger[_0x80be('0x25')]('[%s][voiceDialReport][dialend]\x20event:',_0x1918f3['uniqueid'],util['inspect'](_0x1918f3,{'showHidden':![],'depth':null}));if(this[_0x80be('0x8')][_0x1918f3[_0x80be('0x1b')]]){this['channels'][_0x1918f3['uniqueid']]['dialstatus']=_0x1918f3[_0x80be('0x2c')];if(_0x1918f3[_0x80be('0x2c')]==='ANSWER'){this[_0x80be('0x8')][_0x1918f3[_0x80be('0x1b')]][_0x80be('0x2d')]=_0x1918f3['connectedlinenum'];this[_0x80be('0x8')][_0x1918f3['uniqueid']]['connectedlinename']=_0x1918f3[_0x80be('0x2e')];this[_0x80be('0x8')][_0x1918f3[_0x80be('0x1b')]][_0x80be('0x2f')]=moment()['format'](_0x80be('0x30'));this[_0x80be('0x8')][_0x1918f3[_0x80be('0x1b')]]['lastevent']=_0x80be('0x31');logger[_0x80be('0x32')](_0x80be('0x33'),_0x1918f3[_0x80be('0x1b')],_0x1918f3['channel'][_0x80be('0x1e')](_0x1918f3[_0x80be('0x1d')]['lastIndexOf']('/')+0x1,_0x1918f3[_0x80be('0x1d')][_0x80be('0x1f')]('-')));logger[_0x80be('0x25')](_0x80be('0x34'),_0x1918f3[_0x80be('0x1b')],util[_0x80be('0x27')](this[_0x80be('0x8')][_0x1918f3[_0x80be('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x80be('0x35'),this['channels'][_0x1918f3['uniqueid']]);}logger[_0x80be('0x25')](_0x80be('0x36'),_0x1918f3[_0x80be('0x1b')],util[_0x80be('0x27')](this[_0x80be('0x8')][_0x1918f3[_0x80be('0x1b')]],{'showHidden':![],'depth':null}));this[_0x80be('0x17')](_0x80be('0x29'),_0x80be('0x37'),this['channels'][_0x1918f3[_0x80be('0x1b')]]);}}}catch(_0x122d49){logger[_0x80be('0x2b')](_0x80be('0x38'),_0x1918f3['uniqueid'],util['inspect'](_0x122d49,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x80be('0x15')][_0x80be('0x10')]=function(_0x5f5b4a){try{if(this[_0x80be('0x19')](_0x5f5b4a)){logger[_0x80be('0x25')](_0x80be('0x39'),_0x5f5b4a[_0x80be('0x1b')],util[_0x80be('0x27')](_0x5f5b4a,{'showHidden':![],'depth':null}));this[_0x80be('0x3a')](_0x5f5b4a[_0x80be('0x1b')],_[_0x80be('0x3b')](_0x5f5b4a[_0x80be('0x3c')])[0x0],_0x5f5b4a[_0x80be('0x3d')]);if(this[_0x80be('0x19')](_0x5f5b4a[_0x80be('0x3c')])&&this[_0x80be('0x19')](_0x5f5b4a[_0x80be('0x3c')][_0x80be('0x3e')])){if(_[_0x80be('0x16')](this[_0x80be('0x8')][_0x5f5b4a[_0x80be('0x1b')]])){this[_0x80be('0x8')][_0x5f5b4a[_0x80be('0x1b')]]={'routeId':_0x5f5b4a['value'],'variables':this[_0x80be('0x3f')][_0x5f5b4a[_0x80be('0x1b')]]};logger[_0x80be('0x32')](_0x80be('0x40'),_0x5f5b4a[_0x80be('0x1b')],_0x5f5b4a[_0x80be('0x3c')][_0x80be('0x3e')],_[_0x80be('0x3b')](_0x5f5b4a[_0x80be('0x3c')])[0x0],_0x5f5b4a[_0x80be('0x3d')]);logger['debug'](_0x80be('0x41'),_0x5f5b4a[_0x80be('0x1b')],util[_0x80be('0x27')](this[_0x80be('0x8')][_0x5f5b4a[_0x80be('0x1b')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x80be('0x37'),this[_0x80be('0x8')][_0x5f5b4a[_0x80be('0x1b')]]);}}}}catch(_0x3a15df){logger['error'](_0x80be('0x42'),_0x5f5b4a[_0x80be('0x1b')],util[_0x80be('0x27')](_0x3a15df,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x80be('0x15')][_0x80be('0x3a')]=function(_0x3df5f4,_0x3fbafa,_0x1fadfd){var _0x589e4a=[_0x80be('0x43'),_0x80be('0x44'),'rtpaudioqosjitter',_0x80be('0x45'),_0x80be('0x46'),_0x80be('0x47'),_0x80be('0x48'),_0x80be('0x49'),'sipcallid','sipuri',_0x80be('0x4a'),'bridgepvtcallid',_0x80be('0x4b'),'memberdynamic','memberinterface',_0x80be('0x4c'),_0x80be('0x24'),'memberpenalty',_0x80be('0x4d')];if(!_[_0x80be('0x4e')](_0x3fbafa)&&!_[_0x80be('0x4f')](_0x589e4a,_0x3fbafa)){if(_['isUndefined'](this[_0x80be('0x3f')][_0x3df5f4])){this['variables'][_0x3df5f4]={};}this[_0x80be('0x3f')][_0x3df5f4][_0x3fbafa]=_0x1fadfd;}};VoiceDialReport['prototype'][_0x80be('0x14')]=function(_0x1fd534){try{if(this[_0x80be('0x19')](_0x1fd534)){logger[_0x80be('0x25')](_0x80be('0x50'),_0x1fd534[_0x80be('0x1b')],util['inspect'](_0x1fd534,{'showHidden':![],'depth':null}));if(this[_0x80be('0x8')][_0x1fd534['uniqueid']]){logger[_0x80be('0x32')](_0x80be('0x51'),_0x1fd534[_0x80be('0x1b')],_0x1fd534[_0x80be('0x52')]);this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x53')]=moment()[_0x80be('0x1c')](_0x80be('0x30'));this[_0x80be('0x8')][_0x1fd534['uniqueid']][_0x80be('0x54')]=moment(this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x53')])[_0x80be('0x55')](this['channels'][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x56')],_0x80be('0x57'));this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x58')]='complete';this['outbound'][_0x80be('0x59')]+=0x1;if(this[_0x80be('0x8')][_0x1fd534['uniqueid']][_0x80be('0x2f')]){this[_0x80be('0x9')]['answered']+=0x1;this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]]['holdtime']=moment(this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x2f')])['diff'](this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x56')],_0x80be('0x57'));this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x5a')]=moment(this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x53')])[_0x80be('0x55')](this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x2f')],_0x80be('0x57'));this['outbound']['sumHoldTime']+=this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x5b')]||0x0;this[_0x80be('0x9')][_0x80be('0x5c')]+=this['channels'][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x5a')];}this[_0x80be('0x9')][_0x80be('0x5d')]+=this['channels'][_0x1fd534[_0x80be('0x1b')]][_0x80be('0x54')];logger[_0x80be('0x25')](_0x80be('0x5e'),_0x1fd534[_0x80be('0x1b')],util[_0x80be('0x27')](this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x80be('0x17')](_0x80be('0x5f'),this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]]);logger['debug'](_0x80be('0x60'),_0x1fd534[_0x80be('0x1b')],util[_0x80be('0x27')](this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:dialend',this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x1fd534[_0x80be('0x1b')],util[_0x80be('0x27')](this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]],{'showHidden':![],'depth':null}));this[_0x80be('0x17')](_0x80be('0x29'),_0x80be('0x61'),this['outbound']);logger['info']('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x80be('0x62')](this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]]));logger[_0x80be('0x25')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x1fd534[_0x80be('0x1b')],util[_0x80be('0x27')](this[_0x80be('0x8')][_0x1fd534['uniqueid']],{'showHidden':![],'depth':null}));this[_0x80be('0x17')](_0x80be('0x29'),_0x80be('0x63'),this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]]);delete this[_0x80be('0x8')][_0x1fd534[_0x80be('0x1b')]];}else if(this[_0x80be('0x8')][_0x1fd534[_0x80be('0x64')]]){this[_0x80be('0x8')][_0x1fd534[_0x80be('0x64')]][_0x80be('0x1b')]=this[_0x80be('0x8')][_0x1fd534[_0x80be('0x64')]][_0x80be('0x65')];}if(this[_0x80be('0x3f')][_0x1fd534[_0x80be('0x1b')]]){delete this[_0x80be('0x3f')][_0x1fd534['uniqueid']];}}}catch(_0x56d944){logger[_0x80be('0x2b')](_0x80be('0x66'),_0x1fd534['uniqueid'],util[_0x80be('0x27')](_0x56d944,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x80be('0x12')]=function(_0x99487f){try{if(this[_0x80be('0x19')](_0x99487f)){logger[_0x80be('0x25')](_0x80be('0x67'),_0x99487f['uniqueid'],util['inspect'](_0x99487f,{'showHidden':![],'depth':null}));if(_0x99487f[_0x80be('0x68')]['toLowerCase']()===_0x80be('0x69')){_0x99487f[_0x80be('0x6a')]=(_0x99487f[_0x80be('0x6b')]||_0x99487f[_0x80be('0x6a')])[_0x80be('0x6c')]();if(_[_0x80be('0x6d')](_0x99487f['applicationdata'],_0x80be('0x6e'))){if(_[_0x80be('0x16')](this[_0x80be('0xa')][_0x99487f['uniqueid']]))this['applications'][_0x99487f[_0x80be('0x1b')]]={};logger[_0x80be('0x32')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x99487f['uniqueid'],_0x99487f[_0x80be('0x68')],_0x99487f['applicationdata']);var _0x537611=_0x99487f[_0x80be('0x6a')][_0x80be('0x6f')]('=');var _0x36deff=_0x537611[0x0]['match'](/cdr\((.*)\)/);if(_0x36deff)this[_0x80be('0xa')][_0x99487f[_0x80be('0x1b')]][_0x36deff[0x1]]=_0x537611[0x1];}}}}catch(_0x55d1de){logger[_0x80be('0x2b')](_0x80be('0x70'),_0x99487f[_0x80be('0x1b')],util[_0x80be('0x27')](_0x55d1de,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x81c4=['outbound','applications','variables','bind','dialend','syncDialEnd','varset','syncVarSet','newexten','syncNewExten','syncHangup','prototype','syncDialBegin','isNotNull','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','info','membername','interface','debug','merge','emit','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','variable','outboundrouteid','isUndefined','value','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','channels','outboundChannels'];(function(_0x42885c,_0x307cc2){var _0x292742=function(_0x213b9e){while(--_0x213b9e){_0x42885c['push'](_0x42885c['shift']());}};_0x292742(++_0x307cc2);}(_0x81c4,0x6b));var _0x481c=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x81c4[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x481c('0x0'));var moment=require(_0x481c('0x1'));var util=require('util');var Redis=require(_0x481c('0x2'));var config=require(_0x481c('0x3'));var logger=require(_0x481c('0x4'))('ami');var ami=require(_0x481c('0x5'));config[_0x481c('0x6')]=_[_0x481c('0x7')](config[_0x481c('0x6')],{'host':_0x481c('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x24aac5){this[_0x481c('0x9')]=_0x24aac5[_0x481c('0xa')];this[_0x481c('0xb')]=_0x24aac5[_0x481c('0xb')];this[_0x481c('0xc')]={};this[_0x481c('0xd')]={};ami['on']('dialbegin',this['syncDialBegin'][_0x481c('0xe')](this));ami['on'](_0x481c('0xf'),this[_0x481c('0x10')][_0x481c('0xe')](this));ami['on'](_0x481c('0x11'),this[_0x481c('0x12')][_0x481c('0xe')](this));ami['on'](_0x481c('0x13'),this[_0x481c('0x14')][_0x481c('0xe')](this));ami['on']('hangup',this[_0x481c('0x15')][_0x481c('0xe')](this));}VoiceDialReport[_0x481c('0x16')]['isNotNull']=function(_0x5aa249){return _0x5aa249!==null&&!_['isUndefined'](_0x5aa249);};VoiceDialReport[_0x481c('0x16')]['emit']=function(_0x1dd511,_0x152f80,_0x2cf661){io['to'](_0x1dd511)['emit'](_0x152f80,_0x2cf661);};VoiceDialReport[_0x481c('0x16')][_0x481c('0x17')]=function(_0x28f543){try{if(this[_0x481c('0x18')](_0x28f543)){logger['debug']('[%s][voiceDialReport][dialbegin]\x20event:',_0x28f543[_0x481c('0x19')],util[_0x481c('0x1a')](_0x28f543,{'showHidden':![],'depth':null}));if(this['channels'][_0x28f543['uniqueid']]){_['merge'](this[_0x481c('0x9')][_0x28f543['uniqueid']],{'starttime':moment()[_0x481c('0x1b')](_0x481c('0x1c')),'lastevent':_0x481c('0x1d'),'interface':_0x28f543[_0x481c('0x1e')][_0x481c('0x1f')](0x0,_0x28f543[_0x481c('0x1e')]['lastIndexOf']('-')),'membername':_0x28f543[_0x481c('0x1e')]['substring'](_0x28f543[_0x481c('0x1e')][_0x481c('0x20')]('/')+0x1,_0x28f543[_0x481c('0x1e')][_0x481c('0x20')]('-'))},_[_0x481c('0x21')](_0x28f543,[_0x481c('0x22'),'privilege']));logger[_0x481c('0x23')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x28f543[_0x481c('0x19')],this[_0x481c('0x9')][_0x28f543[_0x481c('0x19')]][_0x481c('0x24')],this['channels'][_0x28f543['uniqueid']][_0x481c('0x25')]);logger[_0x481c('0x26')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x28f543[_0x481c('0x19')],util[_0x481c('0x1a')](this['channels'][_0x28f543[_0x481c('0x19')]],{'showHidden':![],'depth':null}));if(this[_0x481c('0xc')][_0x28f543[_0x481c('0x19')]])_[_0x481c('0x27')](this[_0x481c('0x9')][_0x28f543[_0x481c('0x19')]],this[_0x481c('0xc')][_0x28f543[_0x481c('0x19')]]);this[_0x481c('0x28')]('voice:outbound',_0x481c('0x29'),this[_0x481c('0x9')][_0x28f543[_0x481c('0x19')]]);logger['debug'](_0x481c('0x2a'),_0x28f543[_0x481c('0x19')],util['inspect'](this[_0x481c('0x9')][_0x28f543[_0x481c('0x19')]],{'showHidden':![],'depth':null}));ami[_0x481c('0x28')]('custom:dialbegin',this[_0x481c('0x9')][_0x28f543['uniqueid']]);}}}catch(_0x541aa5){logger['error']('[%s][voiceDialReport][dialbegin]',_0x28f543['uniqueid'],util[_0x481c('0x1a')](_0x541aa5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481c('0x16')][_0x481c('0x10')]=function(_0x3f3956){try{if(this[_0x481c('0x18')](_0x3f3956)){logger[_0x481c('0x26')]('[%s][voiceDialReport][dialend]\x20event:',_0x3f3956[_0x481c('0x19')],util[_0x481c('0x1a')](_0x3f3956,{'showHidden':![],'depth':null}));if(this['channels'][_0x3f3956[_0x481c('0x19')]]){this[_0x481c('0x9')][_0x3f3956['uniqueid']][_0x481c('0x2b')]=_0x3f3956[_0x481c('0x2b')];if(_0x3f3956[_0x481c('0x2b')]===_0x481c('0x2c')){this[_0x481c('0x9')][_0x3f3956[_0x481c('0x19')]][_0x481c('0x2d')]=_0x3f3956[_0x481c('0x2d')];this[_0x481c('0x9')][_0x3f3956[_0x481c('0x19')]][_0x481c('0x2e')]=_0x3f3956['connectedlinename'];this['channels'][_0x3f3956['uniqueid']][_0x481c('0x2f')]=moment()[_0x481c('0x1b')](_0x481c('0x1c'));this[_0x481c('0x9')][_0x3f3956[_0x481c('0x19')]][_0x481c('0x30')]=_0x481c('0x31');logger[_0x481c('0x23')](_0x481c('0x32'),_0x3f3956[_0x481c('0x19')],_0x3f3956[_0x481c('0x1e')]['substring'](_0x3f3956[_0x481c('0x1e')]['lastIndexOf']('/')+0x1,_0x3f3956[_0x481c('0x1e')][_0x481c('0x20')]('-')));logger['debug'](_0x481c('0x33'),_0x3f3956[_0x481c('0x19')],util['inspect'](this[_0x481c('0x9')][_0x3f3956['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x481c('0x28')]('custom:dialconnect',this[_0x481c('0x9')][_0x3f3956[_0x481c('0x19')]]);}logger[_0x481c('0x26')](_0x481c('0x34'),_0x3f3956[_0x481c('0x19')],util['inspect'](this[_0x481c('0x9')][_0x3f3956[_0x481c('0x19')]],{'showHidden':![],'depth':null}));this['emit'](_0x481c('0x35'),_0x481c('0x29'),this['channels'][_0x3f3956[_0x481c('0x19')]]);}}}catch(_0x1375ab){logger[_0x481c('0x36')](_0x481c('0x37'),_0x3f3956[_0x481c('0x19')],util[_0x481c('0x1a')](_0x1375ab,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481c('0x16')][_0x481c('0x12')]=function(_0x5ecd1e){try{if(this[_0x481c('0x18')](_0x5ecd1e)){logger['debug'](_0x481c('0x38'),_0x5ecd1e[_0x481c('0x19')],util[_0x481c('0x1a')](_0x5ecd1e,{'showHidden':![],'depth':null}));this['addVariable'](_0x5ecd1e[_0x481c('0x19')],_[_0x481c('0x39')](_0x5ecd1e['variable'])[0x0],_0x5ecd1e['value']);if(this[_0x481c('0x18')](_0x5ecd1e[_0x481c('0x3a')])&&this[_0x481c('0x18')](_0x5ecd1e[_0x481c('0x3a')][_0x481c('0x3b')])){if(_[_0x481c('0x3c')](this[_0x481c('0x9')][_0x5ecd1e[_0x481c('0x19')]])){this[_0x481c('0x9')][_0x5ecd1e['uniqueid']]={'routeId':_0x5ecd1e[_0x481c('0x3d')],'variables':this['variables'][_0x5ecd1e[_0x481c('0x19')]]};logger[_0x481c('0x23')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x5ecd1e[_0x481c('0x19')],_0x5ecd1e[_0x481c('0x3a')][_0x481c('0x3b')],_[_0x481c('0x39')](_0x5ecd1e[_0x481c('0x3a')])[0x0],_0x5ecd1e['value']);logger[_0x481c('0x26')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x5ecd1e['uniqueid'],util['inspect'](this[_0x481c('0x9')][_0x5ecd1e['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x481c('0x35'),_0x481c('0x29'),this[_0x481c('0x9')][_0x5ecd1e['uniqueid']]);}}}}catch(_0x4cd9c2){logger[_0x481c('0x36')](_0x481c('0x3e'),_0x5ecd1e[_0x481c('0x19')],util[_0x481c('0x1a')](_0x4cd9c2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481c('0x16')][_0x481c('0x3f')]=function(_0x2100a9,_0x5b7140,_0x3e8d1c){var _0x41500b=[_0x481c('0x40'),_0x481c('0x41'),_0x481c('0x42'),_0x481c('0x43'),_0x481c('0x44'),'rtpaudioqoslossbridged',_0x481c('0x45'),_0x481c('0x46'),'sipcallid',_0x481c('0x47'),_0x481c('0x48'),_0x481c('0x49'),_0x481c('0x4a'),'memberdynamic',_0x481c('0x4b'),_0x481c('0x4c'),_0x481c('0x24'),'memberpenalty',_0x481c('0x4d')];if(!_[_0x481c('0x4e')](_0x5b7140)&&!_[_0x481c('0x4f')](_0x41500b,_0x5b7140)){if(_[_0x481c('0x3c')](this[_0x481c('0xd')][_0x2100a9])){this[_0x481c('0xd')][_0x2100a9]={};}this[_0x481c('0xd')][_0x2100a9][_0x5b7140]=_0x3e8d1c;}};VoiceDialReport[_0x481c('0x16')][_0x481c('0x15')]=function(_0x3fb500){try{if(this['isNotNull'](_0x3fb500)){logger[_0x481c('0x26')](_0x481c('0x50'),_0x3fb500[_0x481c('0x19')],util[_0x481c('0x1a')](_0x3fb500,{'showHidden':![],'depth':null}));if(this[_0x481c('0x9')][_0x3fb500[_0x481c('0x19')]]){logger['info'](_0x481c('0x51'),_0x3fb500[_0x481c('0x19')],_0x3fb500[_0x481c('0x52')]);this[_0x481c('0x9')][_0x3fb500['uniqueid']][_0x481c('0x53')]=moment()['format'](_0x481c('0x1c'));this[_0x481c('0x9')][_0x3fb500['uniqueid']][_0x481c('0x54')]=moment(this[_0x481c('0x9')][_0x3fb500['uniqueid']][_0x481c('0x53')])[_0x481c('0x55')](this[_0x481c('0x9')][_0x3fb500['uniqueid']][_0x481c('0x56')],_0x481c('0x57'));this['channels'][_0x3fb500[_0x481c('0x19')]]['lastevent']='complete';this['outbound'][_0x481c('0x58')]+=0x1;if(this['channels'][_0x3fb500['uniqueid']][_0x481c('0x2f')]){this[_0x481c('0xb')][_0x481c('0x59')]+=0x1;this[_0x481c('0x9')][_0x3fb500[_0x481c('0x19')]][_0x481c('0x5a')]=moment(this['channels'][_0x3fb500[_0x481c('0x19')]][_0x481c('0x2f')])[_0x481c('0x55')](this[_0x481c('0x9')][_0x3fb500[_0x481c('0x19')]][_0x481c('0x56')],'seconds');this[_0x481c('0x9')][_0x3fb500[_0x481c('0x19')]][_0x481c('0x5b')]=moment(this['channels'][_0x3fb500['uniqueid']][_0x481c('0x53')])[_0x481c('0x55')](this[_0x481c('0x9')][_0x3fb500[_0x481c('0x19')]][_0x481c('0x2f')],'seconds');this[_0x481c('0xb')][_0x481c('0x5c')]+=this[_0x481c('0x9')][_0x3fb500[_0x481c('0x19')]][_0x481c('0x5a')]||0x0;this[_0x481c('0xb')][_0x481c('0x5d')]+=this['channels'][_0x3fb500[_0x481c('0x19')]][_0x481c('0x5b')];}this[_0x481c('0xb')][_0x481c('0x5e')]+=this[_0x481c('0x9')][_0x3fb500['uniqueid']]['duration'];logger[_0x481c('0x26')](_0x481c('0x5f'),_0x3fb500[_0x481c('0x19')],util[_0x481c('0x1a')](this[_0x481c('0x9')][_0x3fb500['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x481c('0x60'),this['channels'][_0x3fb500[_0x481c('0x19')]]);logger[_0x481c('0x26')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x3fb500[_0x481c('0x19')],util[_0x481c('0x1a')](this[_0x481c('0x9')][_0x3fb500[_0x481c('0x19')]],{'showHidden':![],'depth':null}));ami[_0x481c('0x28')](_0x481c('0x61'),this['channels'][_0x3fb500[_0x481c('0x19')]]);logger[_0x481c('0x26')](_0x481c('0x62'),_0x3fb500[_0x481c('0x19')],util['inspect'](this[_0x481c('0x9')][_0x3fb500[_0x481c('0x19')]],{'showHidden':![],'depth':null}));this['emit'](_0x481c('0x35'),_0x481c('0x63'),this['outbound']);logger['info'](_0x481c('0x64'),JSON[_0x481c('0x65')](this[_0x481c('0x9')][_0x3fb500[_0x481c('0x19')]]));logger[_0x481c('0x26')](_0x481c('0x66'),_0x3fb500[_0x481c('0x19')],util[_0x481c('0x1a')](this[_0x481c('0x9')][_0x3fb500['uniqueid']],{'showHidden':![],'depth':null}));this[_0x481c('0x28')]('voice:outbound',_0x481c('0x67'),this[_0x481c('0x9')][_0x3fb500['uniqueid']]);delete this[_0x481c('0x9')][_0x3fb500[_0x481c('0x19')]];}else if(this[_0x481c('0x9')][_0x3fb500[_0x481c('0x68')]]){this[_0x481c('0x9')][_0x3fb500[_0x481c('0x68')]][_0x481c('0x19')]=this[_0x481c('0x9')][_0x3fb500[_0x481c('0x68')]][_0x481c('0x69')];}if(this[_0x481c('0xd')][_0x3fb500[_0x481c('0x19')]]){delete this[_0x481c('0xd')][_0x3fb500[_0x481c('0x19')]];}}}catch(_0x35519d){logger['error'](_0x481c('0x6a'),_0x3fb500[_0x481c('0x19')],util[_0x481c('0x1a')](_0x35519d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481c('0x16')][_0x481c('0x14')]=function(_0x2d3055){try{if(this['isNotNull'](_0x2d3055)){logger[_0x481c('0x26')](_0x481c('0x6b'),_0x2d3055[_0x481c('0x19')],util[_0x481c('0x1a')](_0x2d3055,{'showHidden':![],'depth':null}));if(_0x2d3055['application'][_0x481c('0x6c')]()===_0x481c('0x6d')){_0x2d3055[_0x481c('0x6e')]=(_0x2d3055[_0x481c('0x6f')]||_0x2d3055[_0x481c('0x6e')])['toLowerCase']();if(_['startsWith'](_0x2d3055[_0x481c('0x6e')],_0x481c('0x70'))){if(_[_0x481c('0x3c')](this['applications'][_0x2d3055['uniqueid']]))this[_0x481c('0xc')][_0x2d3055[_0x481c('0x19')]]={};logger['info'](_0x481c('0x71'),_0x2d3055['uniqueid'],_0x2d3055[_0x481c('0x72')],_0x2d3055[_0x481c('0x6e')]);var _0x25e850=_0x2d3055[_0x481c('0x6e')][_0x481c('0x73')]('=');var _0x2a2514=_0x25e850[0x0][_0x481c('0x74')](/cdr\((.*)\)/);if(_0x2a2514)this[_0x481c('0xc')][_0x2d3055[_0x481c('0x19')]][_0x2a2514[0x1]]=_0x25e850[0x1];}}}}catch(_0xa120b7){logger[_0x481c('0x36')]('[%s][voiceDialReport][newexten]',_0x2d3055[_0x481c('0x19')],util[_0x481c('0x1a')](_0xa120b7,{'showHidden':![],'depth':null}));}};module[_0x481c('0x75')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 0e6b11a..54d6a55 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe630=['[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','assigned','membername','queuecallercomplete','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','queuecallerexit','FORWARDTRANSFER','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','linkedid','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','queuecallerexitreason','[%s][voiceQueueReport][agentcomplete]','keys','variable','value','queuestatus','CONTINUE','lastevent','custom:timeout','varset','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','memberpenalty','[%s][voiceQueueReport][hangup]','length','diff','seconds','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertype','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceQueueReport][newexten]','lodash','moment','md5','ioredis','../../../config/environment','ami','../ami','../model/queueReport','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','agentcomplete','syncAgentComplete','syncAgentConnect','syncVarSet','hangup','syncHangup','syncFullyBooted','newexten','syncNewExten','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','unlockRR','prototype','clearZombieChannels','channels','switch','isNil','Action','status','channel','message','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','callerid','Interval','stringify','[voiceQueueReport][','voice_queue:save','isUndefined','queues','catch','[voiceQueueReport][queues]','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','countBy','callers','toNumber','loggedIn','loggedin','talking','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','push','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT'];(function(_0x39fba9,_0x245311){var _0x3078c5=function(_0x4540ff){while(--_0x4540ff){_0x39fba9['push'](_0x39fba9['shift']());}};_0x3078c5(++_0x245311);}(_0xe630,0x149));var _0x0e63=function(_0x50027a,_0x7f0218){_0x50027a=_0x50027a-0x0;var _0x3fab50=_0xe630[_0x50027a];return _0x3fab50;};'use strict';var _=require(_0x0e63('0x0'));var moment=require(_0x0e63('0x1'));var util=require('util');var md5=require(_0x0e63('0x2'));var Redis=require(_0x0e63('0x3'));var config=require(_0x0e63('0x4'));var logger=require('../../../config/logger')(_0x0e63('0x5'));var ami=require(_0x0e63('0x6'));var QueueReport=require(_0x0e63('0x7'));config['redis']=_[_0x0e63('0x8')](config[_0x0e63('0x9')],{'host':_0x0e63('0xa'),'port':0x18eb});var io=require(_0x0e63('0xb'))(new Redis(config[_0x0e63('0x9')]));var Sequence=function(){};Sequence['prototype'][_0x0e63('0xc')]=function(_0x2db49a){this[_0x0e63('0xd')]=this[_0x0e63('0xd')]?this[_0x0e63('0xd')][_0x0e63('0xe')](_0x2db49a):_0x2db49a();};function VoiceQueueReport(_0x16f195){this[_0x0e63('0xf')]=new Sequence();this[_0x0e63('0x10')]={};this[_0x0e63('0x11')]=_0x16f195[_0x0e63('0x11')];this['channels']=_0x16f195[_0x0e63('0x12')];this[_0x0e63('0x13')]=_0x16f195[_0x0e63('0x13')];this[_0x0e63('0x14')]=!![];this[_0x0e63('0x15')]=_0x16f195[_0x0e63('0x15')];this[_0x0e63('0x16')]={};ami['on'](_0x0e63('0x17'),this[_0x0e63('0x18')]['bind'](this));ami['on']('queuesummarycomplete',this[_0x0e63('0x19')][_0x0e63('0x1a')](this));ami['on'](_0x0e63('0x1b'),this[_0x0e63('0x1c')][_0x0e63('0x1a')](this));ami['on'](_0x0e63('0x1d'),this['syncQueueCallerAbandon']['bind'](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0x0e63('0x1a')](this));ami['on'](_0x0e63('0x1e'),this[_0x0e63('0x1f')]['bind'](this));ami['on']('agentconnect',this[_0x0e63('0x20')]['bind'](this));ami['on']('varset',this[_0x0e63('0x21')]['bind'](this));ami['on'](_0x0e63('0x22'),this[_0x0e63('0x23')]['bind'](this));ami['on']('fullybooted',this[_0x0e63('0x24')][_0x0e63('0x1a')](this));ami['on'](_0x0e63('0x25'),this[_0x0e63('0x26')][_0x0e63('0x1a')](this));ami['on'](_0x0e63('0x27'),this['syncMusicOnHoldStart'][_0x0e63('0x1a')](this));ami['on'](_0x0e63('0x28'),this[_0x0e63('0x29')][_0x0e63('0x1a')](this));ami['on'](_0x0e63('0x2a'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x0e63('0x2b'),this[_0x0e63('0x2c')][_0x0e63('0x1a')](this));this[_0x0e63('0x2d')]();this[_0x0e63('0x2e')]();}function clearChannels(_0x484ff3){if(!_[_0x0e63('0x2f')](_0x484ff3)){for(var _0x3c7de3 in _0x484ff3){if(_0x484ff3[_0x0e63('0x30')](_0x3c7de3)){delete _0x484ff3[_0x3c7de3];}}}}function clearCampaigns(_0xaa0600){if(!_[_0x0e63('0x2f')](_0xaa0600)){for(var _0x1dc52c in _0xaa0600){if(_0xaa0600[_0x0e63('0x30')](_0x1dc52c)){_0xaa0600[_0x1dc52c][_0x0e63('0x31')]=0x0;}}}}function clearVoiceQueues(_0x25e88e){if(!_[_0x0e63('0x2f')](_0x25e88e)){for(var _0x46c864 in _0x25e88e){if(_0x25e88e['hasOwnProperty'](_0x46c864)){_0x25e88e[_0x46c864]['originated']=0x0;_0x25e88e[_0x46c864]['talking']=0x0;_0x25e88e[_0x46c864][_0x0e63('0x32')]=0x0;_0x25e88e[_0x46c864][_0x0e63('0x33')]=0x0;_0x25e88e[_0x46c864][_0x0e63('0x34')]=!![];}}}}function clearAgentBooked(_0x188326){if(!_[_0x0e63('0x2f')](_0x188326)){for(var _0x816b25 in _0x188326){if(_0x188326[_0x0e63('0x30')](_0x816b25)){_0x188326[_0x816b25][_0x0e63('0x35')]=!![];}}}}VoiceQueueReport[_0x0e63('0x36')][_0x0e63('0x37')]=function(){var _0x1069c7=this;for(var _0x319061 in this[_0x0e63('0x38')]){if(this[_0x0e63('0x38')][_0x0e63('0x30')](_0x319061)&&!this[_0x0e63('0x38')][_0x319061][_0x0e63('0x39')]){this['sequence'][_0x0e63('0xc')](function(){if(!_[_0x0e63('0x3a')](_0x1069c7['channels'][_0x319061])){return ami[_0x0e63('0x3b')]({'action':_0x0e63('0x3c'),'channel':_0x1069c7[_0x0e63('0x38')][_0x319061][_0x0e63('0x3d')]})['catch'](function(_0x20de1b){if(_0x20de1b[_0x0e63('0x3e')]===_0x0e63('0x3f')){setTimeout(function(){if(_0x1069c7[_0x0e63('0x38')][_0x319061]){delete _0x1069c7[_0x0e63('0x38')][_0x319061];logger[_0x0e63('0x40')]('[%s][voiceQueueReport][checkChannel]',_0x319061,util[_0x0e63('0x41')](_0x20de1b,{'showHidden':![],'depth':null}));}if(_0x1069c7[_0x0e63('0x10')][_0x319061]){delete _0x1069c7[_0x0e63('0x10')][_0x319061];logger[_0x0e63('0x40')](_0x0e63('0x42'),_0x319061,util[_0x0e63('0x41')](_0x20de1b,{'showHidden':![],'depth':null}));}if(_0x1069c7['variables'][_0x319061]){delete _0x1069c7[_0x0e63('0x16')][_0x319061];logger[_0x0e63('0x40')](_0x0e63('0x43'),_0x319061,util[_0x0e63('0x41')](_0x20de1b,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x0e63('0x36')][_0x0e63('0x24')]=function(){logger['error'](_0x0e63('0x44'));clearChannels(this['channels']);this[_0x0e63('0x45')](this[_0x0e63('0x10')]);clearAgentBooked(this[_0x0e63('0x11')]);clearVoiceQueues(this[_0x0e63('0x13')]);clearCampaigns(this[_0x0e63('0x15')]);};VoiceQueueReport['prototype']['clearQueueReport']=function(_0x5e9f0f){var _0x162fe3=this;if(!_[_0x0e63('0x2f')](_0x5e9f0f)){for(var _0x5aebcc in _0x5e9f0f){if(_0x5e9f0f[_0x0e63('0x30')](_0x5aebcc)){_0x162fe3[_0x0e63('0x46')](_0x5e9f0f[_0x5aebcc],'clearqueuereport');delete _0x5e9f0f[_0x5aebcc];}}}};VoiceQueueReport['prototype'][_0x0e63('0x47')]=function(_0x5eed7e,_0x26e386,_0x5486a5){io['to'](_0x5eed7e)[_0x0e63('0x47')](_0x26e386,_0x5486a5);};VoiceQueueReport[_0x0e63('0x36')]['emitVoiceQueueChannelSave']=function(_0x198b04,_0x19b608){logger[_0x0e63('0x48')](_0x0e63('0x49')+_0x19b608+_0x0e63('0x4a'),_0x198b04[_0x0e63('0x4b')],util[_0x0e63('0x41')](_0x198b04,{'showHidden':![],'depth':null}));this[_0x0e63('0x47')](util[_0x0e63('0x4c')]('voice:queue:%s',_0x198b04['name']),_0x0e63('0x4d'),_0x198b04);io['emit'](_0x0e63('0x4e'),_0x198b04);};VoiceQueueReport[_0x0e63('0x36')][_0x0e63('0x46')]=function(_0x156ba1,_0x592f38){logger[_0x0e63('0x48')](_0x0e63('0x49')+_0x592f38+_0x0e63('0x4f'),_0x156ba1[_0x0e63('0x4b')],util[_0x0e63('0x41')](_0x156ba1,{'showHidden':![],'depth':null}));this[_0x0e63('0x47')](util[_0x0e63('0x4c')](_0x0e63('0x50'),_0x156ba1[_0x0e63('0x51')]),_0x0e63('0x52'),_0x156ba1);io['emit'](_0x0e63('0x53'),_0x156ba1);};VoiceQueueReport[_0x0e63('0x36')][_0x0e63('0x54')]=function(_0xe101e1,_0x5e66c5){if(_0xe101e1[_0x0e63('0x55')]===_0x0e63('0x56')){var _0x847a34={'id':_0xe101e1['id'],'name':_0xe101e1['name'],'strategy':_0xe101e1[_0x0e63('0x57')],'answered':_0xe101e1[_0x0e63('0x58')],'available':_0xe101e1[_0x0e63('0x59')],'loggedIn':_0xe101e1['loggedIn'],'pTalking':_0xe101e1[_0x0e63('0x32')],'sumBillable':_0xe101e1[_0x0e63('0x5a')],'sumDuration':_0xe101e1[_0x0e63('0x5b')],'sumHoldTime':_0xe101e1[_0x0e63('0x5c')]||0x0,'talking':_0xe101e1['talking'],'total':_0xe101e1[_0x0e63('0x5d')],'type':_0xe101e1['type'],'unmanaged':_0xe101e1[_0x0e63('0x5e')],'abandoned':_0xe101e1[_0x0e63('0x5f')],'waiting':_0xe101e1[_0x0e63('0x33')]};if(_0xe101e1[_0x0e63('0x60')]){_0x847a34[_0x0e63('0x60')]={'id':_0xe101e1[_0x0e63('0x60')]['id'],'name':_0xe101e1[_0x0e63('0x60')][_0x0e63('0x51')],'active':_0xe101e1['Trunk']['active'],'callerid':_0xe101e1['Trunk'][_0x0e63('0x61')]};}if(_0xe101e1[_0x0e63('0x62')]){_0x847a34[_0x0e63('0x62')]={'id':_0xe101e1['Interval']['id'],'name':_0xe101e1[_0x0e63('0x62')][_0x0e63('0x51')]};}var _0x1b743a=md5(JSON[_0x0e63('0x63')](_0x847a34));if(_0xe101e1['md5']!==_0x1b743a){_0xe101e1['md5']=_0x1b743a;logger[_0x0e63('0x48')](_0x0e63('0x64')+_0x5e66c5+']\x20sending\x20voice_queue:save\x20event:',util[_0x0e63('0x41')](_0x847a34,{'showHidden':![],'depth':null}));this[_0x0e63('0x47')](util[_0x0e63('0x4c')]('voice:queue:%s',_0x847a34[_0x0e63('0x51')]),_0x0e63('0x65'),_0x847a34);}}};VoiceQueueReport[_0x0e63('0x36')]['isNotNull']=function(_0x2c1d61){return _0x2c1d61!==null&&!_[_0x0e63('0x66')](_0x2c1d61);};VoiceQueueReport[_0x0e63('0x36')][_0x0e63('0x2e')]=function(){var _0x1b0c5c=this;setInterval(function(){_0x1b0c5c[_0x0e63('0x37')]();ami[_0x0e63('0x3b')]({'action':_0x0e63('0x67')})[_0x0e63('0x68')](function(_0x1978b1){logger['error'](_0x0e63('0x69'),util[_0x0e63('0x41')](_0x1978b1,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x0e63('0x36')][_0x0e63('0x2d')]=function(){var _0x241e70=this;setInterval(function(){if(_0x241e70[_0x0e63('0x14')]){return ami[_0x0e63('0x3b')]({'action':_0x0e63('0x17')})['then'](function(_0xee5c8b){_0x241e70[_0x0e63('0x14')]=![];})[_0x0e63('0x68')](function(_0x174d15){logger[_0x0e63('0x40')](_0x0e63('0x6a'),util[_0x0e63('0x41')](_0x174d15,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x0e63('0x36')][_0x0e63('0x18')]=function(_0x4266a1){try{if(this[_0x0e63('0x6b')](_0x4266a1)&&this[_0x0e63('0x6b')](_0x4266a1[_0x0e63('0x6c')])){logger['debug'](_0x0e63('0x6d'),util[_0x0e63('0x41')](_0x4266a1,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x4266a1[_0x0e63('0x6c')]]){logger[_0x0e63('0x6e')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x4266a1['queue']);var _0x2400b3=_[_0x0e63('0x6f')](this[_0x0e63('0x38')],_0x0e63('0x6c'))[_0x4266a1[_0x0e63('0x6c')]]||0x0;var _0x274e2c=_0x2400b3-_0x4266a1[_0x0e63('0x70')];if(this[_0x0e63('0x13')][_0x4266a1[_0x0e63('0x6c')]][_0x0e63('0x33')]!==_[_0x0e63('0x71')](_0x4266a1[_0x0e63('0x70')])||this[_0x0e63('0x13')][_0x4266a1[_0x0e63('0x6c')]][_0x0e63('0x72')]!==_[_0x0e63('0x71')](_0x4266a1[_0x0e63('0x73')])||this[_0x0e63('0x13')][_0x4266a1[_0x0e63('0x6c')]][_0x0e63('0x59')]!==_[_0x0e63('0x71')](_0x4266a1[_0x0e63('0x59')])||this[_0x0e63('0x13')][_0x4266a1[_0x0e63('0x6c')]][_0x0e63('0x74')]!==_0x274e2c){this['voiceQueues'][_0x4266a1[_0x0e63('0x6c')]]['waiting']=_[_0x0e63('0x71')](_0x4266a1['callers']);this['voiceQueues'][_0x4266a1[_0x0e63('0x6c')]][_0x0e63('0x72')]=_[_0x0e63('0x71')](_0x4266a1['loggedin']);this[_0x0e63('0x13')][_0x4266a1[_0x0e63('0x6c')]][_0x0e63('0x59')]=_['toNumber'](_0x4266a1[_0x0e63('0x59')]);this[_0x0e63('0x13')][_0x4266a1['queue']]['talking']=_0x274e2c>0x0?_0x274e2c:0x0;this[_0x0e63('0x13')][_0x4266a1['queue']][_0x0e63('0x74')]=this['voiceQueues'][_0x4266a1[_0x0e63('0x6c')]][_0x0e63('0x74')]>_[_0x0e63('0x71')](_0x4266a1[_0x0e63('0x73')])?_[_0x0e63('0x71')](_0x4266a1['loggedin']):this[_0x0e63('0x13')][_0x4266a1[_0x0e63('0x6c')]][_0x0e63('0x74')];this['emitVoiceQueueSummary'](this[_0x0e63('0x13')][_0x4266a1[_0x0e63('0x6c')]],_0x0e63('0x17'));}logger[_0x0e63('0x48')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x0e63('0x41')](this[_0x0e63('0x13')][_0x4266a1[_0x0e63('0x6c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0e63('0x75'),this['voiceQueues'][_0x4266a1['queue']]);}}}catch(_0x46fbed){logger[_0x0e63('0x40')](_0x0e63('0x6a'),util['inspect'](_0x46fbed,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0e63('0x19')]=function(_0x3313f7){logger[_0x0e63('0x48')](_0x0e63('0x76'),util[_0x0e63('0x41')](_0x3313f7,{'showHidden':![],'depth':null}));this[_0x0e63('0x14')]=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x305e4d){try{if(this['isNotNull'](_0x305e4d)){logger[_0x0e63('0x48')]('[%s][voiceQueueReport][queuecallerjoin]',_0x305e4d['uniqueid'],util['inspect'](_0x305e4d,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x0e63('0x10')][_0x305e4d[_0x0e63('0x4b')]]))this[_0x0e63('0x10')][_0x305e4d[_0x0e63('0x4b')]]=[];if(_[_0x0e63('0x66')](this[_0x0e63('0x38')][_0x305e4d[_0x0e63('0x4b')]]))this[_0x0e63('0x38')][_0x305e4d[_0x0e63('0x4b')]]={};var _0x5e1225=new QueueReport();_0x5e1225[_0x0e63('0x51')]=_0x305e4d[_0x0e63('0x6c')];_0x5e1225[_0x0e63('0x55')]=this[_0x0e63('0x13')][_0x5e1225[_0x0e63('0x51')]]&&this[_0x0e63('0x13')][_0x5e1225[_0x0e63('0x51')]]['type']?this[_0x0e63('0x13')][_0x5e1225[_0x0e63('0x51')]][_0x0e63('0x55')]||'inbound':_0x0e63('0x56');_0x5e1225[_0x0e63('0x6c')]=_0x305e4d['queue'];_0x5e1225[_0x0e63('0x77')]=moment()[_0x0e63('0x4c')](_0x0e63('0x78'));_0x5e1225[_0x0e63('0x79')]=_0x305e4d['position'];_0x5e1225[_0x0e63('0x7a')]=_0x305e4d[_0x0e63('0x7a')];_0x5e1225['uniqueid']=_0x305e4d[_0x0e63('0x4b')];_0x5e1225[_0x0e63('0x7b')]=this[_0x0e63('0x38')][_0x305e4d['uniqueid']][_0x0e63('0x7b')];logger[_0x0e63('0x6e')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x5e1225[_0x0e63('0x51')],_0x5e1225['type']);_['merge'](_0x5e1225,_['pick'](_0x305e4d,_['keys'](_0x5e1225)));this['queueReports'][_0x305e4d[_0x0e63('0x4b')]][_0x0e63('0x7c')](_0x5e1225);this[_0x0e63('0x38')][_0x305e4d[_0x0e63('0x4b')]]=_0x5e1225;this[_0x0e63('0x7d')](_0x5e1225,_0x0e63('0x1b'));}}catch(_0x5755c3){logger[_0x0e63('0x40')]('[%s][voiceQueueReport][queuecallerjoin]',_0x305e4d[_0x0e63('0x4b')],util[_0x0e63('0x41')](_0x5755c3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0e63('0x36')]['syncQueueCallerAbandon']=function(_0x880c92){try{if(this['isNotNull'](_0x880c92)){logger[_0x0e63('0x48')](_0x0e63('0x7e'),_0x880c92[_0x0e63('0x4b')],util['inspect'](_0x880c92,{'showHidden':![],'depth':null}));if(this[_0x0e63('0x10')][_0x880c92['uniqueid']]){var _0x5021fa=_[_0x0e63('0x7f')](this[_0x0e63('0x10')][_0x880c92['uniqueid']]);_0x5021fa['queuecallercomplete']=![];_0x5021fa[_0x0e63('0x80')]=null;_0x5021fa[_0x0e63('0x81')]=_0x880c92[_0x0e63('0x81')];_0x5021fa['originalposition']=_0x880c92[_0x0e63('0x82')];_0x5021fa[_0x0e63('0x1d')]=!![];_0x5021fa[_0x0e63('0x83')]=moment()['format'](_0x0e63('0x78'));_0x5021fa['queuecallerexitreason']=_0x0e63('0x84');_0x5021fa[_0x0e63('0x85')]=null;logger[_0x0e63('0x6e')](_0x0e63('0x86'),_0x5021fa['name'],_0x5021fa[_0x0e63('0x55')]);this[_0x0e63('0x38')][_0x880c92[_0x0e63('0x4b')]]=_0x5021fa;this[_0x0e63('0x46')](_0x5021fa,_0x0e63('0x1d'));}}}catch(_0x312928){logger['error'](_0x0e63('0x7e'),_0x880c92[_0x0e63('0x4b')],util['inspect'](_0x312928,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0e63('0x36')]['syncQueueCallerLeave']=function(_0x14e0e5){try{if(this[_0x0e63('0x6b')](_0x14e0e5)){logger['debug'](_0x0e63('0x87'),_0x14e0e5[_0x0e63('0x4b')],util[_0x0e63('0x41')](_0x14e0e5,{'showHidden':![],'depth':null}));if(this[_0x0e63('0x10')][_0x14e0e5[_0x0e63('0x4b')]]){var _0x33ead9=_[_0x0e63('0x7f')](this['queueReports'][_0x14e0e5[_0x0e63('0x4b')]]);_0x33ead9[_0x0e63('0x88')]=moment()[_0x0e63('0x4c')](_0x0e63('0x78'));_0x33ead9[_0x0e63('0x89')]=_0x14e0e5[_0x0e63('0x89')];_0x33ead9[_0x0e63('0x8a')]=_0x14e0e5[_0x0e63('0x8a')];logger['info'](_0x0e63('0x8b'),_0x33ead9['name'],_0x33ead9['type'],_0x14e0e5['connectedlinenum'],_0x14e0e5[_0x0e63('0x8a')]);this[_0x0e63('0x38')][_0x14e0e5['uniqueid']]=_0x33ead9;this[_0x0e63('0x7d')](_0x33ead9,_0x0e63('0x8c'));}}}catch(_0x11ce89){logger[_0x0e63('0x40')]('[%s][voiceQueueReport][queuecallerleave]',_0x14e0e5[_0x0e63('0x4b')],util[_0x0e63('0x41')](_0x11ce89,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0e63('0x20')]=function(_0x272656){try{if(this[_0x0e63('0x6b')](_0x272656)){logger[_0x0e63('0x48')](_0x0e63('0x8d'),_0x272656['uniqueid'],util[_0x0e63('0x41')](_0x272656,{'showHidden':![],'depth':null}));if(this[_0x0e63('0x10')][_0x272656[_0x0e63('0x4b')]]){var _0x4c457f=_[_0x0e63('0x7f')](this[_0x0e63('0x10')][_0x272656[_0x0e63('0x4b')]]);_0x4c457f['queuecallercomplete']=!![];_0x4c457f['queuecallerexitreason']=_0x0e63('0x8e');logger[_0x0e63('0x6e')](_0x0e63('0x8f'),_0x4c457f[_0x0e63('0x51')],_0x4c457f[_0x0e63('0x55')]);}}}catch(_0x95e32e){logger[_0x0e63('0x40')](_0x0e63('0x8d'),_0x272656[_0x0e63('0x4b')],util[_0x0e63('0x41')](_0x95e32e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0e63('0x36')][_0x0e63('0x1f')]=function(_0x15825b){try{if(this[_0x0e63('0x6b')](_0x15825b)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x15825b[_0x0e63('0x4b')],util[_0x0e63('0x41')](_0x15825b,{'showHidden':![],'depth':null}));if(this[_0x0e63('0x10')][_0x15825b[_0x0e63('0x4b')]]){var _0x540437=_[_0x0e63('0x7f')](this[_0x0e63('0x10')][_0x15825b[_0x0e63('0x4b')]]);_0x540437[_0x0e63('0x1d')]=![];_0x540437[_0x0e63('0x83')]=null;_0x540437[_0x0e63('0x90')]=!![];_0x540437[_0x0e63('0x85')]=_0x15825b[_0x0e63('0x91')];_0x540437[_0x0e63('0x81')]=_0x15825b['holdtime'];_0x540437[_0x0e63('0x92')]=!![];_0x540437['queuecallerexit']=![];_0x540437[_0x0e63('0x93')]=null;if(!_0x540437[_0x0e63('0x94')]){if(_0x15825b[_0x0e63('0x95')]==_0x0e63('0x94')){_0x540437['queuecallerexitreason']=_0x0e63('0x96');logger[_0x0e63('0x6e')](_0x0e63('0x97'),_0x540437[_0x0e63('0x51')],_0x540437[_0x0e63('0x55')]);}else{if(_[_0x0e63('0x98')](_0x15825b[_0x0e63('0x3d')][_0x0e63('0x99')](),_0x0e63('0x9a'))){if(this[_0x0e63('0x10')][_0x15825b['linkedid']]){var _0x4de256=_[_0x0e63('0x7f')](this[_0x0e63('0x10')][_0x15825b['linkedid']]);_0x4de256[_0x0e63('0x92')]=![];_0x4de256[_0x0e63('0x9b')]=!![];_0x4de256[_0x0e63('0x93')]=moment(_0x540437[_0x0e63('0x77')])['add'](_0x15825b[_0x0e63('0x81')],'seconds')[_0x0e63('0x4c')](_0x0e63('0x78'));_0x4de256['queuecallerexitreason']=_0x0e63('0x9c');_0x4de256[_0x0e63('0x94')]=!![];_0x4de256['transfertype']='FORWARD';_0x4de256[_0x0e63('0x9d')]=_0x15825b[_0x0e63('0x9e')];_0x4de256[_0x0e63('0x9f')]=_0x15825b['uniqueid'];logger[_0x0e63('0x6e')](_0x0e63('0xa0'),_0x4de256[_0x0e63('0x51')],_0x4de256[_0x0e63('0x55')]);var _0x1ac27a=this['queueReports'][_0x15825b[_0x0e63('0xa1')]];this[_0x0e63('0x10')][_0x15825b['linkedid']]=this[_0x0e63('0x10')][_0x15825b[_0x0e63('0x4b')]];this[_0x0e63('0x10')][_0x15825b['uniqueid']]=_0x1ac27a;}}else{_0x540437['queuecallerexitreason']='COMPLETEDBY'+_0x15825b[_0x0e63('0x95')][_0x0e63('0xa2')]();logger[_0x0e63('0x6e')](_0x0e63('0xa3'),_0x540437['name'],_0x540437[_0x0e63('0x55')],_0x540437[_0x0e63('0xa4')]);}}}this[_0x0e63('0x38')][_0x15825b[_0x0e63('0x4b')]]=_0x540437;this[_0x0e63('0x46')](_0x540437,_0x0e63('0x1e'));}}}catch(_0x994b0d){logger[_0x0e63('0x40')](_0x0e63('0xa5'),_0x15825b['uniqueid'],util[_0x0e63('0x41')](_0x994b0d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0e63('0x36')]['syncVarSet']=function(_0x393862){try{if(this[_0x0e63('0x6b')](_0x393862)){logger[_0x0e63('0x48')]('[%s][voiceQueueReport][varset]',_0x393862[_0x0e63('0x4b')],util[_0x0e63('0x41')](_0x393862,{'showHidden':![],'depth':null}));this['addVariable'](_0x393862[_0x0e63('0x4b')],_[_0x0e63('0xa6')](_0x393862[_0x0e63('0xa7')])[0x0],_0x393862[_0x0e63('0xa8')]);if(this[_0x0e63('0x10')][_0x393862[_0x0e63('0x4b')]]){var _0x487463=_[_0x0e63('0x7f')](this[_0x0e63('0x10')][_0x393862[_0x0e63('0x4b')]]);if(_0x487463){if(this['isNotNull'](_0x393862[_0x0e63('0xa7')])&&this[_0x0e63('0x6b')](_0x393862[_0x0e63('0xa7')][_0x0e63('0xa9')])){switch(_0x393862[_0x0e63('0xa8')]){case _0x0e63('0xaa'):_0x487463[_0x0e63('0x9b')]=![];_0x487463[_0x0e63('0x93')]=null;break;case'TIMEOUT':_0x487463[_0x0e63('0xab')]='timeout';_0x487463[_0x0e63('0x9b')]=!![];_0x487463[_0x0e63('0x93')]=moment()[_0x0e63('0x4c')](_0x0e63('0x78'));_0x487463[_0x0e63('0x88')]=moment()['format'](_0x0e63('0x78'));logger[_0x0e63('0x48')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x393862[_0x0e63('0x4b')],util[_0x0e63('0x41')](_0x487463,{'showHidden':![],'depth':null}));ami[_0x0e63('0x47')](_0x0e63('0xac'),_0x487463);break;default:_0x487463[_0x0e63('0x9b')]=!![];_0x487463[_0x0e63('0x93')]=moment()[_0x0e63('0x4c')](_0x0e63('0x78'));_0x487463[_0x0e63('0x88')]=moment()[_0x0e63('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');}_0x487463['queuecallerabandon']=![];_0x487463[_0x0e63('0x83')]=null;_0x487463['queuecallerexitreason']=_0x393862[_0x0e63('0xa8')];this[_0x0e63('0x38')][_0x393862[_0x0e63('0x4b')]]=_0x487463;this['emitVoiceQueueChannelRemove'](_0x487463,_0x0e63('0xad'));}else if(this[_0x0e63('0x6b')](_0x393862['variable'])&&this[_0x0e63('0x6b')](_0x393862[_0x0e63('0xa7')][_0x0e63('0xae')])){if(!_0x487463[_0x0e63('0x1d')]){_0x487463[_0x0e63('0x9b')]=!![];_0x487463[_0x0e63('0x93')]=moment()[_0x0e63('0x4c')](_0x0e63('0x78'));_0x487463[_0x0e63('0xa4')]='EXITWITHKEY';_0x487463[_0x0e63('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0e63('0x38')][_0x393862[_0x0e63('0x4b')]]=_0x487463;}}logger['info'](_0x0e63('0xaf'),_0x393862['uniqueid'],_0x487463[_0x0e63('0x51')],_0x487463['type'],_[_0x0e63('0xa6')](_0x393862[_0x0e63('0xa7')])[0x0],_0x393862[_0x0e63('0xa8')]);_0x487463['variables']=this['variables'][_0x393862[_0x0e63('0x4b')]];}}}}catch(_0x2c77b0){logger[_0x0e63('0x40')](_0x0e63('0xb0'),_0x393862['uniqueid'],util[_0x0e63('0x41')](_0x2c77b0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0e63('0x36')]['addVariable']=function(_0x3871a4,_0x2ac8a6,_0x7eeedb){var _0x174f04=[_0x0e63('0xb1'),'rtpaudioqosbridged',_0x0e63('0xb2'),_0x0e63('0xb3'),_0x0e63('0xb4'),'rtpaudioqoslossbridged',_0x0e63('0xb5'),_0x0e63('0xb6'),_0x0e63('0xb7'),_0x0e63('0xb8'),_0x0e63('0xb9'),_0x0e63('0xba'),'membercalls',_0x0e63('0xbb'),'memberinterface',_0x0e63('0xbc'),_0x0e63('0x91'),_0x0e63('0xbd'),'memberrealtime'];if(!_[_0x0e63('0x3a')](_0x2ac8a6)&&!_['includes'](_0x174f04,_0x2ac8a6)){if(_[_0x0e63('0x66')](this[_0x0e63('0x16')][_0x3871a4])){this[_0x0e63('0x16')][_0x3871a4]={};}this['variables'][_0x3871a4][_0x2ac8a6]=_0x7eeedb;}};VoiceQueueReport[_0x0e63('0x36')]['syncHangup']=function(_0x1fce02){try{if(this['isNotNull'](_0x1fce02)){logger['debug'](_0x0e63('0xbe'),_0x1fce02[_0x0e63('0x4b')],util[_0x0e63('0x41')](_0x1fce02,{'showHidden':![],'depth':null}));if(this[_0x0e63('0x10')][_0x1fce02['uniqueid']]){for(var _0x5b449c=0x0,_0x28668e={};_0x5b449c0x0?_0x12edea:0x0;this['voiceQueues'][_0x160f22[_0x9a1b('0x72')]][_0x9a1b('0x36')]=this[_0x9a1b('0x12')][_0x160f22['queue']][_0x9a1b('0x36')]>_['toNumber'](_0x160f22['loggedin'])?_['toNumber'](_0x160f22[_0x9a1b('0x79')]):this['voiceQueues'][_0x160f22[_0x9a1b('0x72')]][_0x9a1b('0x36')];this[_0x9a1b('0x7a')](this[_0x9a1b('0x12')][_0x160f22['queue']],_0x9a1b('0x16'));}logger[_0x9a1b('0x4e')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x9a1b('0x45')](this[_0x9a1b('0x12')][_0x160f22[_0x9a1b('0x72')]],{'showHidden':![],'depth':null}));ami['emit'](_0x9a1b('0x7b'),this[_0x9a1b('0x12')][_0x160f22[_0x9a1b('0x72')]]);}}}catch(_0xd6386e){logger[_0x9a1b('0x43')](_0x9a1b('0x71'),util[_0x9a1b('0x45')](_0xd6386e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0xf88235){logger[_0x9a1b('0x4e')](_0x9a1b('0x7c'),util[_0x9a1b('0x45')](_0xf88235,{'showHidden':![],'depth':null}));this[_0x9a1b('0x13')]=!![];};VoiceQueueReport[_0x9a1b('0x48')][_0x9a1b('0x1c')]=function(_0x3ad586){try{if(this[_0x9a1b('0x6a')](_0x3ad586)){logger[_0x9a1b('0x4e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x3ad586[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0x3ad586,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x3ad586[_0x9a1b('0x50')]]))this[_0x9a1b('0xe')][_0x3ad586['uniqueid']]=[];if(_['isUndefined'](this[_0x9a1b('0x10')][_0x3ad586[_0x9a1b('0x50')]]))this[_0x9a1b('0x10')][_0x3ad586[_0x9a1b('0x50')]]={};var _0x1c51c8=new QueueReport();_0x1c51c8[_0x9a1b('0x53')]=_0x3ad586[_0x9a1b('0x72')];_0x1c51c8[_0x9a1b('0x5a')]=this[_0x9a1b('0x12')][_0x1c51c8[_0x9a1b('0x53')]]&&this[_0x9a1b('0x12')][_0x1c51c8[_0x9a1b('0x53')]][_0x9a1b('0x5a')]?this[_0x9a1b('0x12')][_0x1c51c8[_0x9a1b('0x53')]][_0x9a1b('0x5a')]||_0x9a1b('0x5b'):_0x9a1b('0x5b');_0x1c51c8[_0x9a1b('0x72')]=_0x3ad586[_0x9a1b('0x72')];_0x1c51c8[_0x9a1b('0x7d')]=moment()[_0x9a1b('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c51c8[_0x9a1b('0x7e')]=_0x3ad586['position'];_0x1c51c8[_0x9a1b('0x7f')]=_0x3ad586['count'];_0x1c51c8[_0x9a1b('0x50')]=_0x3ad586[_0x9a1b('0x50')];_0x1c51c8[_0x9a1b('0x80')]=this[_0x9a1b('0x10')][_0x3ad586['uniqueid']][_0x9a1b('0x80')];logger['info'](_0x9a1b('0x81'),_0x1c51c8['name'],_0x1c51c8['type']);_['merge'](_0x1c51c8,_[_0x9a1b('0x82')](_0x3ad586,_[_0x9a1b('0x83')](_0x1c51c8)));this[_0x9a1b('0xe')][_0x3ad586[_0x9a1b('0x50')]]['push'](_0x1c51c8);this[_0x9a1b('0x10')][_0x3ad586['uniqueid']]=_0x1c51c8;this['emitVoiceQueueChannelSave'](_0x1c51c8,'queuecallerjoin');}}catch(_0x3c9b44){logger[_0x9a1b('0x43')](_0x9a1b('0x84'),_0x3ad586[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0x3c9b44,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9a1b('0x48')][_0x9a1b('0x1d')]=function(_0x2b79eb){try{if(this[_0x9a1b('0x6a')](_0x2b79eb)){logger['debug'](_0x9a1b('0x85'),_0x2b79eb[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0x2b79eb,{'showHidden':![],'depth':null}));if(this[_0x9a1b('0xe')][_0x2b79eb[_0x9a1b('0x50')]]){var _0x1b6591=_['last'](this[_0x9a1b('0xe')][_0x2b79eb[_0x9a1b('0x50')]]);_0x1b6591['queuecallercomplete']=![];_0x1b6591['queuecallercompleteAt']=null;_0x1b6591[_0x9a1b('0x86')]=_0x2b79eb[_0x9a1b('0x86')];_0x1b6591[_0x9a1b('0x87')]=_0x2b79eb[_0x9a1b('0x87')];_0x1b6591[_0x9a1b('0x88')]=!![];_0x1b6591[_0x9a1b('0x89')]=moment()[_0x9a1b('0x51')](_0x9a1b('0x8a'));_0x1b6591[_0x9a1b('0x8b')]='ABANDONED';_0x1b6591[_0x9a1b('0x8c')]=null;logger[_0x9a1b('0x74')](_0x9a1b('0x8d'),_0x1b6591[_0x9a1b('0x53')],_0x1b6591[_0x9a1b('0x5a')]);this[_0x9a1b('0x10')][_0x2b79eb[_0x9a1b('0x50')]]=_0x1b6591;this[_0x9a1b('0x56')](_0x1b6591,'queuecallerabandon');}}}catch(_0x359922){logger[_0x9a1b('0x43')](_0x9a1b('0x85'),_0x2b79eb['uniqueid'],util[_0x9a1b('0x45')](_0x359922,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9a1b('0x48')][_0x9a1b('0x1e')]=function(_0x474014){try{if(this[_0x9a1b('0x6a')](_0x474014)){logger[_0x9a1b('0x4e')](_0x9a1b('0x8e'),_0x474014[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0x474014,{'showHidden':![],'depth':null}));if(this[_0x9a1b('0xe')][_0x474014['uniqueid']]){var _0xe48949=_[_0x9a1b('0x8f')](this['queueReports'][_0x474014['uniqueid']]);_0xe48949[_0x9a1b('0x90')]=moment()[_0x9a1b('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0xe48949['connectedlinenum']=_0x474014[_0x9a1b('0x91')];_0xe48949['connectedlinename']=_0x474014[_0x9a1b('0x92')];logger[_0x9a1b('0x74')](_0x9a1b('0x93'),_0xe48949[_0x9a1b('0x53')],_0xe48949[_0x9a1b('0x5a')],_0x474014['connectedlinenum'],_0x474014[_0x9a1b('0x92')]);this['channels'][_0x474014['uniqueid']]=_0xe48949;this[_0x9a1b('0x4d')](_0xe48949,_0x9a1b('0x94'));}}}catch(_0xcab7d4){logger[_0x9a1b('0x43')]('[%s][voiceQueueReport][queuecallerleave]',_0x474014[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0xcab7d4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9a1b('0x48')][_0x9a1b('0x22')]=function(_0x57108a){try{if(this['isNotNull'](_0x57108a)){logger['debug'](_0x9a1b('0x95'),_0x57108a[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0x57108a,{'showHidden':![],'depth':null}));if(this[_0x9a1b('0xe')][_0x57108a[_0x9a1b('0x50')]]){var _0x2adfd6=_[_0x9a1b('0x8f')](this[_0x9a1b('0xe')][_0x57108a[_0x9a1b('0x50')]]);_0x2adfd6[_0x9a1b('0x96')]=!![];_0x2adfd6[_0x9a1b('0x8b')]=_0x9a1b('0x97');logger[_0x9a1b('0x74')](_0x9a1b('0x98'),_0x2adfd6[_0x9a1b('0x53')],_0x2adfd6[_0x9a1b('0x5a')]);}}}catch(_0x471c01){logger[_0x9a1b('0x43')]('[%s][voiceQueueReport][agentconnect]',_0x57108a[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0x471c01,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9a1b('0x48')][_0x9a1b('0x20')]=function(_0x152f34){try{if(this['isNotNull'](_0x152f34)){logger['debug'](_0x9a1b('0x99'),_0x152f34[_0x9a1b('0x50')],util['inspect'](_0x152f34,{'showHidden':![],'depth':null}));if(this[_0x9a1b('0xe')][_0x152f34[_0x9a1b('0x50')]]){var _0x200ede=_['last'](this[_0x9a1b('0xe')][_0x152f34[_0x9a1b('0x50')]]);_0x200ede[_0x9a1b('0x88')]=![];_0x200ede[_0x9a1b('0x89')]=null;_0x200ede['assigned']=!![];_0x200ede[_0x9a1b('0x8c')]=_0x152f34[_0x9a1b('0x9a')];_0x200ede[_0x9a1b('0x86')]=_0x152f34['holdtime'];_0x200ede[_0x9a1b('0x96')]=!![];_0x200ede[_0x9a1b('0x9b')]=![];_0x200ede[_0x9a1b('0x9c')]=null;if(!_0x200ede[_0x9a1b('0x9d')]){if(_0x152f34[_0x9a1b('0x9e')]=='transfer'){_0x200ede[_0x9a1b('0x8b')]=_0x9a1b('0x9f');logger[_0x9a1b('0x74')](_0x9a1b('0xa0'),_0x200ede['name'],_0x200ede[_0x9a1b('0x5a')]);}else{if(_[_0x9a1b('0xa1')](_0x152f34[_0x9a1b('0x40')][_0x9a1b('0xa2')](),'local/')){if(this[_0x9a1b('0xe')][_0x152f34[_0x9a1b('0xa3')]]){var _0x69ad7e=_[_0x9a1b('0x8f')](this[_0x9a1b('0xe')][_0x152f34[_0x9a1b('0xa3')]]);_0x69ad7e['queuecallercomplete']=![];_0x69ad7e[_0x9a1b('0x9b')]=!![];_0x69ad7e[_0x9a1b('0x9c')]=moment(_0x200ede['queuecallerjoinAt'])[_0x9a1b('0xa4')](_0x152f34[_0x9a1b('0x86')],_0x9a1b('0xa5'))[_0x9a1b('0x51')](_0x9a1b('0x8a'));_0x69ad7e[_0x9a1b('0x8b')]='FORWARDTRANSFER';_0x69ad7e[_0x9a1b('0x9d')]=!![];_0x69ad7e[_0x9a1b('0xa6')]=_0x9a1b('0xa7');_0x69ad7e[_0x9a1b('0xa8')]=_0x152f34[_0x9a1b('0xa9')];_0x69ad7e[_0x9a1b('0xaa')]=_0x152f34['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x69ad7e[_0x9a1b('0x53')],_0x69ad7e[_0x9a1b('0x5a')]);var _0x4caa6e=this[_0x9a1b('0xe')][_0x152f34['linkedid']];this[_0x9a1b('0xe')][_0x152f34[_0x9a1b('0xa3')]]=this[_0x9a1b('0xe')][_0x152f34[_0x9a1b('0x50')]];this[_0x9a1b('0xe')][_0x152f34[_0x9a1b('0x50')]]=_0x4caa6e;}}else{_0x200ede['queuecallerexitreason']=_0x9a1b('0xab')+_0x152f34[_0x9a1b('0x9e')][_0x9a1b('0xac')]();logger['info'](_0x9a1b('0xad'),_0x200ede['name'],_0x200ede[_0x9a1b('0x5a')],_0x200ede[_0x9a1b('0x8b')]);}}}this[_0x9a1b('0x10')][_0x152f34[_0x9a1b('0x50')]]=_0x200ede;this[_0x9a1b('0x56')](_0x200ede,'agentcomplete');}}}catch(_0xc58ff8){logger['error'](_0x9a1b('0x99'),_0x152f34[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0xc58ff8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9a1b('0x48')][_0x9a1b('0x24')]=function(_0x1c39ed){try{if(this[_0x9a1b('0x6a')](_0x1c39ed)){logger[_0x9a1b('0x4e')](_0x9a1b('0xae'),_0x1c39ed[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0x1c39ed,{'showHidden':![],'depth':null}));this[_0x9a1b('0xaf')](_0x1c39ed[_0x9a1b('0x50')],_[_0x9a1b('0x83')](_0x1c39ed['variable'])[0x0],_0x1c39ed['value']);if(this[_0x9a1b('0xe')][_0x1c39ed[_0x9a1b('0x50')]]){var _0x23c133=_[_0x9a1b('0x8f')](this[_0x9a1b('0xe')][_0x1c39ed[_0x9a1b('0x50')]]);if(_0x23c133){if(this[_0x9a1b('0x6a')](_0x1c39ed[_0x9a1b('0xb0')])&&this['isNotNull'](_0x1c39ed[_0x9a1b('0xb0')][_0x9a1b('0xb1')])){switch(_0x1c39ed[_0x9a1b('0xb2')]){case _0x9a1b('0xb3'):_0x23c133['queuecallerexit']=![];_0x23c133[_0x9a1b('0x9c')]=null;break;case _0x9a1b('0xb4'):_0x23c133[_0x9a1b('0xb5')]=_0x9a1b('0xb6');_0x23c133[_0x9a1b('0x9b')]=!![];_0x23c133[_0x9a1b('0x9c')]=moment()[_0x9a1b('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x23c133[_0x9a1b('0x90')]=moment()[_0x9a1b('0x51')](_0x9a1b('0x8a'));logger[_0x9a1b('0x4e')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1c39ed[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0x23c133,{'showHidden':![],'depth':null}));ami[_0x9a1b('0x4c')](_0x9a1b('0xb7'),_0x23c133);break;default:_0x23c133[_0x9a1b('0x9b')]=!![];_0x23c133[_0x9a1b('0x9c')]=moment()[_0x9a1b('0x51')](_0x9a1b('0x8a'));_0x23c133['queuecallerleaveAt']=moment()[_0x9a1b('0x51')](_0x9a1b('0x8a'));}_0x23c133[_0x9a1b('0x88')]=![];_0x23c133[_0x9a1b('0x89')]=null;_0x23c133[_0x9a1b('0x8b')]=_0x1c39ed['value'];this[_0x9a1b('0x10')][_0x1c39ed[_0x9a1b('0x50')]]=_0x23c133;this[_0x9a1b('0x56')](_0x23c133,'varset');}else if(this['isNotNull'](_0x1c39ed[_0x9a1b('0xb0')])&&this['isNotNull'](_0x1c39ed[_0x9a1b('0xb0')][_0x9a1b('0xb8')])){if(!_0x23c133[_0x9a1b('0x88')]){_0x23c133['queuecallerexit']=!![];_0x23c133['queuecallerexitAt']=moment()[_0x9a1b('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x23c133[_0x9a1b('0x8b')]=_0x9a1b('0xb9');_0x23c133['queuecallerleaveAt']=moment()[_0x9a1b('0x51')](_0x9a1b('0x8a'));this['channels'][_0x1c39ed[_0x9a1b('0x50')]]=_0x23c133;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x1c39ed[_0x9a1b('0x50')],_0x23c133[_0x9a1b('0x53')],_0x23c133[_0x9a1b('0x5a')],_[_0x9a1b('0x83')](_0x1c39ed[_0x9a1b('0xb0')])[0x0],_0x1c39ed['value']);_0x23c133['variables']=this[_0x9a1b('0x15')][_0x1c39ed[_0x9a1b('0x50')]];}}}}catch(_0x71e75){logger[_0x9a1b('0x43')](_0x9a1b('0xae'),_0x1c39ed[_0x9a1b('0x50')],util[_0x9a1b('0x45')](_0x71e75,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9a1b('0xaf')]=function(_0x2517b5,_0x48a6d5,_0x5b769a){var _0x5240df=['rtpaudioqos',_0x9a1b('0xba'),_0x9a1b('0xbb'),_0x9a1b('0xbc'),'rtpaudioqosloss',_0x9a1b('0xbd'),_0x9a1b('0xbe'),_0x9a1b('0xbf'),_0x9a1b('0xc0'),'sipuri',_0x9a1b('0xc1'),'bridgepvtcallid',_0x9a1b('0xc2'),_0x9a1b('0xc3'),_0x9a1b('0xc4'),'memberlastcall',_0x9a1b('0x9a'),_0x9a1b('0xc5'),_0x9a1b('0xc6')];if(!_[_0x9a1b('0x3d')](_0x48a6d5)&&!_[_0x9a1b('0xc7')](_0x5240df,_0x48a6d5)){if(_['isUndefined'](this[_0x9a1b('0x15')][_0x2517b5])){this[_0x9a1b('0x15')][_0x2517b5]={};}this[_0x9a1b('0x15')][_0x2517b5][_0x48a6d5]=_0x5b769a;}};VoiceQueueReport['prototype'][_0x9a1b('0x26')]=function(_0x459118){try{if(this[_0x9a1b('0x6a')](_0x459118)){logger[_0x9a1b('0x4e')](_0x9a1b('0xc8'),_0x459118['uniqueid'],util[_0x9a1b('0x45')](_0x459118,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x459118['uniqueid']]){for(var _0x5595d8=0x0,_0x6ef9a1={};_0x5595d8=0x0?moment(_0x50aa28[_0x52b7('0x19')])[_0x52b7('0x1a')](_0x50aa28[_0x52b7('0x18')],'seconds'):null,'data1':_0x52b7('0x1b'),'data2':_0x50aa28[_0x52b7('0x13')],'data3':_0x50aa28[_0x52b7('0x10')],'data4':_0x50aa28['dialstring']||null,'role':_0x52b7('0x12'),'internal':_0x50aa28[_0x52b7('0x13')]?_[_0x52b7('0x14')](_0x50aa28[_0x52b7('0x13')]):undefined,'uniqueid':_0x50aa28[_0x52b7('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x8d60=['uniqueid','voiceDialReport','Request','membername','starttime','endtime','dialstring','agent','lodash','util','../client','queuecallercompleteAt','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','queuecallerleaveAt','diff','seconds','calleridnum','exten','accountcode','toNumber'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d60,0x11b));var _0x08d6=function(_0xbe12e1,_0x3f7420){_0xbe12e1=_0xbe12e1-0x0;var _0x4bc0bc=_0x8d60[_0xbe12e1];return _0x4bc0bc;};'use strict';var moment=require('moment');var _=require(_0x08d6('0x0'));var util=require(_0x08d6('0x1'));var client=require(_0x08d6('0x2'));exports['voiceQueueReport']=function(_0x3b69ed){var _0x4ba723=_0x3b69ed[_0x08d6('0x3')]||_0x3b69ed['queuecallerexitAt'];return client['Request'](_0x08d6('0x4'),{'body':{'channel':_0x08d6('0x5'),'membername':_0x3b69ed[_0x08d6('0x6')],'interface':_[_0x08d6('0x7')](_0x3b69ed[_0x08d6('0x8')])?util[_0x08d6('0x9')]('SIP/%s',_0x3b69ed[_0x08d6('0x6')]):_0x3b69ed['interface'],'type':'TALKING','enterAt':_0x3b69ed[_0x08d6('0xa')],'exitAt':_0x4ba723,'duration':moment(_0x4ba723)[_0x08d6('0xb')](_0x3b69ed[_0x08d6('0xa')],_0x08d6('0xc')),'data1':'inbound','data2':_0x3b69ed[_0x08d6('0xd')],'data3':_0x3b69ed[_0x08d6('0xe')],'data4':null,'data5':_0x3b69ed['queue'],'role':'agent','internal':_0x3b69ed[_0x08d6('0xf')]?_[_0x08d6('0x10')](_0x3b69ed[_0x08d6('0xf')]):undefined,'uniqueid':_0x3b69ed[_0x08d6('0x11')]},'log':_0x08d6('0x4')});};exports[_0x08d6('0x12')]=function(_0x2776b3){return client[_0x08d6('0x13')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x2776b3[_0x08d6('0x14')],'interface':_0x2776b3[_0x08d6('0x8')],'type':'TALKING','enterAt':_0x2776b3[_0x08d6('0x15')],'exitAt':_0x2776b3[_0x08d6('0x16')],'duration':moment(_0x2776b3[_0x08d6('0x16')])[_0x08d6('0xb')](_0x2776b3[_0x08d6('0x15')],_0x08d6('0xc'))>=0x0?moment(_0x2776b3[_0x08d6('0x16')])[_0x08d6('0xb')](_0x2776b3[_0x08d6('0x15')],_0x08d6('0xc')):null,'data1':'outbound','data2':_0x2776b3[_0x08d6('0xf')],'data3':_0x2776b3['exten'],'data4':_0x2776b3[_0x08d6('0x17')]||null,'role':_0x08d6('0x18'),'internal':_0x2776b3[_0x08d6('0xf')]?_[_0x08d6('0x10')](_0x2776b3['accountcode']):undefined,'uniqueid':_0x2776b3['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 4fa77d4..2f9f3b7 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 _0x4dd2=['GetSettings','getSettings','Request','ShowSetting'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x4dd2,0xf1));var _0x24dd=function(_0x590da5,_0x298084){_0x590da5=_0x590da5-0x0;var _0x54d4c4=_0x4dd2[_0x590da5];return _0x54d4c4;};'use strict';var client=require('../client');exports[_0x24dd('0x0')]=function(){return client[_0x24dd('0x1')](_0x24dd('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x24dd('0x3')});}; \ No newline at end of file +var _0x88b5=['GetSettings','../client','getSettings','Request','stopRecordingOnTransfer'];(function(_0x5ba178,_0x25748d){var _0x98a27e=function(_0x4d485b){while(--_0x4d485b){_0x5ba178['push'](_0x5ba178['shift']());}};_0x98a27e(++_0x25748d);}(_0x88b5,0x10f));var _0x588b=function(_0x4e431a,_0x522d73){_0x4e431a=_0x4e431a-0x0;var _0x285ddf=_0x88b5[_0x4e431a];return _0x285ddf;};'use strict';var client=require(_0x588b('0x0'));exports[_0x588b('0x1')]=function(){return client[_0x588b('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x588b('0x3')]},'log':_0x588b('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 758d1fc..b97acb3 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 _0xff69=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x55f493,_0x45b237){var _0x4f6a92=function(_0x2d2552){while(--_0x2d2552){_0x55f493['push'](_0x55f493['shift']());}};_0x4f6a92(++_0x45b237);}(_0xff69,0x119));var _0x9ff6=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xff69[_0x432fca];return _0x3adba4;};'use strict';var client=require(_0x9ff6('0x0'));exports[_0x9ff6('0x1')]=function(_0x4c56fe){return function(_0x7fc1b4){return client[_0x9ff6('0x2')](_0x9ff6('0x3'),{'options':{'raw':!![],'attributes':['id',_0x9ff6('0x4'),_0x9ff6('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xe6da=['Request','GetTemplate','name','html','getTemplates'];(function(_0x1e343b,_0x304d05){var _0x4de775=function(_0x101958){while(--_0x101958){_0x1e343b['push'](_0x1e343b['shift']());}};_0x4de775(++_0x304d05);}(_0xe6da,0x1ee));var _0xae6d=function(_0x2b89ed,_0x162f53){_0x2b89ed=_0x2b89ed-0x0;var _0xb39052=_0xe6da[_0x2b89ed];return _0xb39052;};'use strict';var client=require('../client');exports[_0xae6d('0x0')]=function(_0x172ca2){return function(_0x3976d2){return client[_0xae6d('0x1')](_0xae6d('0x2'),{'options':{'raw':!![],'attributes':['id',_0xae6d('0x3'),_0xae6d('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 14effda..1e044b5 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 _0xdf21=['operator','value','AnyConditions','Action','action','data3','data6','data7','../client','getTriggers','GetTrigger','name','channel','status','Condition','AllConditions','field'];(function(_0x121450,_0x106bfa){var _0x4d480a=function(_0x53e807){while(--_0x53e807){_0x121450['push'](_0x121450['shift']());}};_0x4d480a(++_0x106bfa);}(_0xdf21,0xe5));var _0x1df2=function(_0x5eff5c,_0x63e6c1){_0x5eff5c=_0x5eff5c-0x0;var _0x4c7c80=_0xdf21[_0x5eff5c];return _0x4c7c80;};'use strict';var client=require(_0x1df2('0x0'));exports[_0x1df2('0x1')]=function(_0x72500){return function(_0x207e2d){return client['Request'](_0x1df2('0x2'),{'options':{'raw':![],'attributes':['id',_0x1df2('0x3'),_0x1df2('0x4'),_0x1df2('0x5')],'include':[{'model':_0x1df2('0x6'),'as':_0x1df2('0x7'),'attributes':['id',_0x1df2('0x8'),_0x1df2('0x9'),_0x1df2('0xa')]},{'model':'Condition','as':_0x1df2('0xb'),'attributes':['id',_0x1df2('0x8'),'operator','value']},{'model':_0x1df2('0xc'),'as':'Actions','attributes':['id',_0x1df2('0xd'),'data1','data2',_0x1df2('0xe'),'data4','data5',_0x1df2('0xf'),_0x1df2('0x10')]}]},'log':_0x1df2('0x2')});};}; \ No newline at end of file +var _0xaa4d=['status','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','data1','data2','data3','data5','data7','../client','getTriggers','Request','GetTrigger','channel'];(function(_0x327a80,_0xff6da3){var _0x1ff3b0=function(_0x22813e){while(--_0x22813e){_0x327a80['push'](_0x327a80['shift']());}};_0x1ff3b0(++_0xff6da3);}(_0xaa4d,0x151));var _0xdaa4=function(_0x45862f,_0xf5f0a6){_0x45862f=_0x45862f-0x0;var _0x35b20b=_0xaa4d[_0x45862f];return _0x35b20b;};'use strict';var client=require(_0xdaa4('0x0'));exports[_0xdaa4('0x1')]=function(_0x1d8c5b){return function(_0x4bca13){return client[_0xdaa4('0x2')](_0xdaa4('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xdaa4('0x4'),_0xdaa4('0x5')],'include':[{'model':_0xdaa4('0x6'),'as':_0xdaa4('0x7'),'attributes':['id','field',_0xdaa4('0x8'),_0xdaa4('0x9')]},{'model':_0xdaa4('0x6'),'as':_0xdaa4('0xa'),'attributes':['id',_0xdaa4('0xb'),_0xdaa4('0x8'),_0xdaa4('0x9')]},{'model':_0xdaa4('0xc'),'as':_0xdaa4('0xd'),'attributes':['id','action',_0xdaa4('0xe'),_0xdaa4('0xf'),_0xdaa4('0x10'),'data4',_0xdaa4('0x11'),'data6',_0xdaa4('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index fdf0b47..d587deb 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 _0xd420=['getTrunks','Request','GetTrunk','registry','defaultuser','../client'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0xd420,0x1d9));var _0x0d42=function(_0x5d29b4,_0x5a46b9){_0x5d29b4=_0x5d29b4-0x0;var _0x5a293a=_0xd420[_0x5d29b4];return _0x5a293a;};'use strict';var client=require(_0x0d42('0x0'));exports[_0x0d42('0x1')]=function(_0x49674e){return function(_0x49e2bf){return client[_0x0d42('0x2')](_0x0d42('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x0d42('0x4'),_0x0d42('0x5')]},'log':_0x0d42('0x3')});};}; \ No newline at end of file +var _0xb43b=['Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0x55deec,_0x130e1f){var _0x2a071a=function(_0x292388){while(--_0x292388){_0x55deec['push'](_0x55deec['shift']());}};_0x2a071a(++_0x130e1f);}(_0xb43b,0xbf));var _0xbb43=function(_0x579c45,_0x23aae2){_0x579c45=_0x579c45-0x0;var _0x3d86d8=_0xb43b[_0x579c45];return _0x3d86d8;};'use strict';var client=require(_0xbb43('0x0'));exports['getTrunks']=function(_0x1b9ba2){return function(_0x21ce6c){return client[_0xbb43('0x1')](_0xbb43('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xbb43('0x3'),_0xbb43('0x4'),_0xbb43('0x5')]},'log':_0xbb43('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index ed00de1..1e603d6 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x5d0e5a,_0x20f2fb){var _0x55a318=function(_0x576923){while(--_0x576923){_0x5d0e5a['push'](_0x5d0e5a['shift']());}};_0x55a318(++_0x20f2fb);}(_0xedd9,0xfc));var _0x9edd=function(_0x38f035,_0x262035){_0x38f035=_0x38f035-0x0;var _0x3cd4be=_0xedd9[_0x38f035];return _0x3cd4be;};'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 +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x4122af,_0x30c542){var _0x5b550e=function(_0x2dedf8){while(--_0x2dedf8){_0x4122af['push'](_0x4122af['shift']());}};_0x5b550e(++_0x30c542);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index e85688f..018b90f 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 _0xe758=['UpdateVoiceAgentReport','create','CreateVoiceAgentReport','update'];(function(_0x1ce0a7,_0x497e53){var _0x3a753e=function(_0x141643){while(--_0x141643){_0x1ce0a7['push'](_0x1ce0a7['shift']());}};_0x3a753e(++_0x497e53);}(_0xe758,0x65));var _0x8e75=function(_0x59ebd0,_0x2ce7db){_0x59ebd0=_0x59ebd0-0x0;var _0xbbaa50=_0xe758[_0x59ebd0];return _0xbbaa50;};'use strict';var client=require('../client');exports[_0x8e75('0x0')]=function(_0x302c15){return client['Request']('CreateVoiceAgentReport',{'body':_0x302c15,'log':_0x8e75('0x1')});};exports[_0x8e75('0x2')]=function(_0x134387,_0x24b61b,_0x46a16c){return client['Request'](_0x8e75('0x3'),{'body':_0x134387,'options':{'where':{'uniqueid':_0x24b61b,'interface':_0x46a16c,'agentcomplete':!![]}},'log':_0x8e75('0x3')});}; \ No newline at end of file +var _0xb97c=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xb97c,0x77));var _0xcb97=function(_0x306f19,_0x237f05){_0x306f19=_0x306f19-0x0;var _0x2ce7b1=_0xb97c[_0x306f19];return _0x2ce7b1;};'use strict';var client=require(_0xcb97('0x0'));exports['create']=function(_0x41fde2){return client[_0xcb97('0x1')]('CreateVoiceAgentReport',{'body':_0x41fde2,'log':_0xcb97('0x2')});};exports['update']=function(_0x2365f6,_0x35ca5e,_0x235520){return client[_0xcb97('0x1')](_0xcb97('0x3'),{'body':_0x2365f6,'options':{'where':{'uniqueid':_0x35ca5e,'interface':_0x235520,'agentcomplete':!![]}},'log':_0xcb97('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 6227a37..1ebc755 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 _0xa753=['billableseconds','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration'];(function(_0x140d26,_0x1a5ad2){var _0x36c952=function(_0x428044){while(--_0x428044){_0x140d26['push'](_0x140d26['shift']());}};_0x36c952(++_0x1a5ad2);}(_0xa753,0x161));var _0x3a75=function(_0x315ba7,_0x1b6006){_0x315ba7=_0x315ba7-0x0;var _0x4d253b=_0xa753[_0x315ba7];return _0x4d253b;};'use strict';var moment=require(_0x3a75('0x0'));var util=require('util');var _=require(_0x3a75('0x1'));var client=require(_0x3a75('0x2'));exports[_0x3a75('0x3')]=function(_0x301f88){return client[_0x3a75('0x4')](_0x3a75('0x5'),{'body':_[_0x3a75('0x6')](_0x301f88,{'source':_0x301f88[_0x3a75('0x7')],'destinationcontext':_0x301f88[_0x3a75('0x8')],'callerid':_0x301f88[_0x3a75('0x9')],'amaflags':_0x3a75('0xa')}),'log':_0x3a75('0x5')});};exports[_0x3a75('0xb')]=function(){return function(){return client['Request'](_0x3a75('0xc'),{'options':{'where':{'type':[_0x3a75('0xd')],'createdAt':{'$between':[moment()[_0x3a75('0xe')](_0x3a75('0xf'))[_0x3a75('0x10')](_0x3a75('0x11')),moment()[_0x3a75('0x12')]('day')['format'](_0x3a75('0x11'))]}},'attributes':['type',_0x3a75('0x13'),_0x3a75('0x14'),_0x3a75('0x15')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xf572=['create','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client'];(function(_0x2e9779,_0x27ad40){var _0x4eea00=function(_0xc51134){while(--_0xc51134){_0x2e9779['push'](_0x2e9779['shift']());}};_0x4eea00(++_0x27ad40);}(_0xf572,0x1d7));var _0x2f57=function(_0x177f63,_0x86eac3){_0x177f63=_0x177f63-0x0;var _0x456d27=_0xf572[_0x177f63];return _0x456d27;};'use strict';var moment=require(_0x2f57('0x0'));var util=require(_0x2f57('0x1'));var _=require(_0x2f57('0x2'));var client=require(_0x2f57('0x3'));exports[_0x2f57('0x4')]=function(_0x2297ff){return client['Request'](_0x2f57('0x5'),{'body':_[_0x2f57('0x6')](_0x2297ff,{'source':_0x2297ff[_0x2f57('0x7')],'destinationcontext':_0x2297ff[_0x2f57('0x8')],'callerid':_0x2297ff[_0x2f57('0x9')],'amaflags':_0x2f57('0xa')}),'log':_0x2f57('0x5')});};exports[_0x2f57('0xb')]=function(){return function(){return client[_0x2f57('0xc')](_0x2f57('0xd'),{'options':{'where':{'type':[_0x2f57('0xe')],'createdAt':{'$between':[moment()[_0x2f57('0xf')](_0x2f57('0x10'))[_0x2f57('0x11')](_0x2f57('0x12')),moment()[_0x2f57('0x13')]('day')[_0x2f57('0x11')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x2f57('0x14'),_0x2f57('0x15'),_0x2f57('0x16'),_0x2f57('0x17')]},'log':_0x2f57('0x18')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 7e044b0..c9accfa 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 _0xb2ed=['create','Request','CreateVoiceDialReport','../client'];(function(_0xe3a16b,_0x9da32a){var _0xf208b9=function(_0x5ac8a0){while(--_0x5ac8a0){_0xe3a16b['push'](_0xe3a16b['shift']());}};_0xf208b9(++_0x9da32a);}(_0xb2ed,0x1c7));var _0xdb2e=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0xb2ed[_0x344adc];return _0x4014b2;};'use strict';var client=require(_0xdb2e('0x0'));exports[_0xdb2e('0x1')]=function(_0x1451cb){return client[_0xdb2e('0x2')]('CreateVoiceDialReport',{'body':_0x1451cb,'log':_0xdb2e('0x3')});}; \ No newline at end of file +var _0x3234=['create','Request','CreateVoiceDialReport','../client'];(function(_0x13a9de,_0x247d3d){var _0x210229=function(_0x2cfe64){while(--_0x2cfe64){_0x13a9de['push'](_0x13a9de['shift']());}};_0x210229(++_0x247d3d);}(_0x3234,0x157));var _0x4323=function(_0x2dac3e,_0x3ffb48){_0x2dac3e=_0x2dac3e-0x0;var _0x1da1a7=_0x3234[_0x2dac3e];return _0x1da1a7;};'use strict';var client=require(_0x4323('0x0'));exports[_0x4323('0x1')]=function(_0x261f55){return client[_0x4323('0x2')](_0x4323('0x3'),{'body':_0x261f55,'log':_0x4323('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5bc9c44..4d78eb4 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 _0x6b24=['GetVoiceExtension','exten','getVoiceExtensions','Request'];(function(_0x1e7bd5,_0x4fc7ee){var _0x2573a4=function(_0x43bbec){while(--_0x43bbec){_0x1e7bd5['push'](_0x1e7bd5['shift']());}};_0x2573a4(++_0x4fc7ee);}(_0x6b24,0x1ce));var _0x46b2=function(_0x13d46e,_0xb71980){_0x13d46e=_0x13d46e-0x0;var _0x30e59b=_0x6b24[_0x13d46e];return _0x30e59b;};'use strict';var client=require('../client');exports[_0x46b2('0x0')]=function(){return function(){return client[_0x46b2('0x1')](_0x46b2('0x2'),{'options':{'raw':!![],'attributes':['id',_0x46b2('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xa9e0=['getVoiceExtensions','Request','recordingFormat','../client'];(function(_0x34637d,_0x29a649){var _0x4a7166=function(_0x577a78){while(--_0x577a78){_0x34637d['push'](_0x34637d['shift']());}};_0x4a7166(++_0x29a649);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x0a9e('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 3afb445..93fcf77 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 _0x79ff=['dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialPrefix','dialCheckDuplicateType','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','type','dialActive'];(function(_0x3ba367,_0x2ed555){var _0x3d7f4b=function(_0x18d6ae){while(--_0x18d6ae){_0x3ba367['push'](_0x3ba367['shift']());}};_0x3d7f4b(++_0x2ed555);}(_0x79ff,0x1df));var _0xf79f=function(_0x3a1b90,_0x3c0158){_0x3a1b90=_0x3a1b90-0x0;var _0xf6de77=_0x79ff[_0x3a1b90];return _0xf6de77;};'use strict';var client=require(_0xf79f('0x0'));exports[_0xf79f('0x1')]=function(){return function(){return client[_0xf79f('0x2')](_0xf79f('0x3'),{'options':{'raw':![],'attributes':['id',_0xf79f('0x4'),_0xf79f('0x5'),_0xf79f('0x6'),'autopause','monitor_format',_0xf79f('0x7'),_0xf79f('0x8'),_0xf79f('0x9'),_0xf79f('0xa'),_0xf79f('0xb'),_0xf79f('0xc'),_0xf79f('0xd'),_0xf79f('0xe'),'dialPredictiveInterval',_0xf79f('0xf'),_0xf79f('0x10'),_0xf79f('0x11'),_0xf79f('0x12'),_0xf79f('0x13'),'dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency',_0xf79f('0x14'),_0xf79f('0x15'),_0xf79f('0x16'),_0xf79f('0x17'),'dialGlobalMaxRetry','dialTimezone','dialGlobalInterval',_0xf79f('0x18'),_0xf79f('0x19'),'dialAMDActive','dialAMDInitialSilence',_0xf79f('0x1a'),_0xf79f('0x1b'),_0xf79f('0x1c'),_0xf79f('0x1d'),_0xf79f('0x1e'),_0xf79f('0x1f'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0xf79f('0x20'),_0xf79f('0x21'),_0xf79f('0x22'),'dialOrderByScheduledAt',_0xf79f('0x23'),_0xf79f('0x24'),_0xf79f('0x25'),_0xf79f('0x26'),_0xf79f('0x27'),_0xf79f('0x28'),_0xf79f('0x29'),'dialNoSuchNumberMaxRetry',_0xf79f('0x2a'),_0xf79f('0x2b'),_0xf79f('0x2c'),_0xf79f('0x2d'),'dialAbandonedRetryFrequency',_0xf79f('0x2e'),_0xf79f('0x2f'),_0xf79f('0x30'),_0xf79f('0x31'),_0xf79f('0x32'),_0xf79f('0x33'),_0xf79f('0x34')],'include':[{'model':'Trunk','as':_0xf79f('0x35'),'attributes':['id',_0xf79f('0x4'),_0xf79f('0x36'),_0xf79f('0x37')]},{'model':_0xf79f('0x38'),'as':_0xf79f('0x39'),'attributes':['id',_0xf79f('0x4')]},{'model':_0xf79f('0x35'),'as':_0xf79f('0x3a'),'attributes':['id',_0xf79f('0x4'),_0xf79f('0x36'),'active']},{'model':_0xf79f('0x3b'),'as':_0xf79f('0x3b'),'attributes':['id',_0xf79f('0x4')],'include':[{'model':_0xf79f('0x3b'),'as':_0xf79f('0x3c'),'attributes':['id',_0xf79f('0x4'),'interval']}]}]},'log':_0xf79f('0x1')});};}; \ No newline at end of file +var _0x2ada=['GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','Request'];(function(_0x3e3590,_0x16e735){var _0x776f0d=function(_0x26805b){while(--_0x26805b){_0x3e3590['push'](_0x3e3590['shift']());}};_0x776f0d(++_0x16e735);}(_0x2ada,0x16c));var _0xa2ad=function(_0x44b0de,_0x213afa){_0x44b0de=_0x44b0de-0x0;var _0x21da2a=_0x2ada[_0x44b0de];return _0x21da2a;};'use strict';var client=require('../client');exports[_0xa2ad('0x0')]=function(){return function(){return client[_0xa2ad('0x1')](_0xa2ad('0x2'),{'options':{'raw':![],'attributes':['id',_0xa2ad('0x3'),_0xa2ad('0x4'),_0xa2ad('0x5'),_0xa2ad('0x6'),'monitor_format',_0xa2ad('0x7'),'dialActive',_0xa2ad('0x8'),_0xa2ad('0x9'),_0xa2ad('0xa'),'dialPowerLevel',_0xa2ad('0xb'),_0xa2ad('0xc'),_0xa2ad('0xd'),_0xa2ad('0xe'),_0xa2ad('0xf'),_0xa2ad('0x10'),_0xa2ad('0x11'),_0xa2ad('0x12'),'dialQueueProject',_0xa2ad('0x13'),_0xa2ad('0x14'),_0xa2ad('0x15'),'dialBusyRetryFrequency',_0xa2ad('0x16'),_0xa2ad('0x17'),_0xa2ad('0x18'),_0xa2ad('0x19'),_0xa2ad('0x1a'),_0xa2ad('0x1b'),_0xa2ad('0x1c'),_0xa2ad('0x1d'),_0xa2ad('0x1e'),_0xa2ad('0x1f'),_0xa2ad('0x20'),_0xa2ad('0x21'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0xa2ad('0x22'),_0xa2ad('0x23'),'dialAMDMaximumWordLength','timeout','dialRecallMeTimeout',_0xa2ad('0x24'),'dialOrderByScheduledAt',_0xa2ad('0x25'),_0xa2ad('0x26'),_0xa2ad('0x27'),_0xa2ad('0x28'),_0xa2ad('0x29'),_0xa2ad('0x2a'),_0xa2ad('0x2b'),_0xa2ad('0x2c'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xa2ad('0x2d'),_0xa2ad('0x2e'),'dialAbandonedRetryFrequency',_0xa2ad('0x2f'),_0xa2ad('0x30'),'dialAgentRejectMaxRetry',_0xa2ad('0x31'),_0xa2ad('0x32'),_0xa2ad('0x33'),_0xa2ad('0x34')],'include':[{'model':_0xa2ad('0x35'),'as':'Trunk','attributes':['id',_0xa2ad('0x3'),_0xa2ad('0x36'),_0xa2ad('0x37')]},{'model':_0xa2ad('0x38'),'as':_0xa2ad('0x39'),'attributes':['id',_0xa2ad('0x3')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id','name',_0xa2ad('0x36'),_0xa2ad('0x37')]},{'model':_0xa2ad('0x3a'),'as':_0xa2ad('0x3a'),'attributes':['id','name'],'include':[{'model':_0xa2ad('0x3a'),'as':_0xa2ad('0x3b'),'attributes':['id',_0xa2ad('0x3'),_0xa2ad('0x3c')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 52e057d..16627da 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(_0x44623d,_0x38a498){var _0xefe681=function(_0x67f68b){while(--_0x67f68b){_0x44623d['push'](_0x44623d['shift']());}};_0xefe681(++_0x38a498);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x4983e4,_0x4305c2){var _0xc02957=function(_0x2e56ae){while(--_0x2e56ae){_0x4983e4['push'](_0x4983e4['shift']());}};_0xc02957(++_0x4305c2);}(_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 diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index c255c80..99fa074 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 _0x7ab5=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7ab5,0xb7));var _0x57ab=function(_0x526f6d,_0x755026){_0x526f6d=_0x526f6d-0x0;var _0x10224d=_0x7ab5[_0x526f6d];return _0x10224d;};'use strict';var client=require(_0x57ab('0x0'));exports[_0x57ab('0x1')]=function(_0x343f37){return function(){return client[_0x57ab('0x2')](_0x57ab('0x3'),{'options':{'where':{'VoiceQueueId':_0x343f37,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x2d27=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client','Request'];(function(_0x1b2825,_0x1bb466){var _0x1a5b38=function(_0x19d00b){while(--_0x19d00b){_0x1b2825['push'](_0x1b2825['shift']());}};_0x1a5b38(++_0x1bb466);}(_0x2d27,0x162));var _0x72d2=function(_0x378752,_0x158b32){_0x378752=_0x378752-0x0;var _0xd5a262=_0x2d27[_0x378752];return _0xd5a262;};'use strict';var client=require(_0x72d2('0x0'));exports['getVoiceQueueRtPauses']=function(_0x2ffcbc){return function(){return client[_0x72d2('0x1')](_0x72d2('0x2'),{'options':{'where':{'VoiceQueueId':_0x2ffcbc,'paused':!![]},'raw':!![]},'log':_0x72d2('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 7163b03..6bfefe8 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(_0x331540,_0x22a981){var _0x2ae9aa=function(_0x2d3664){while(--_0x2d3664){_0x331540['push'](_0x331540['shift']());}};_0x2ae9aa(++_0x22a981);}(_0x7a54,0x106));var _0x47a5=function(_0x39bbb2,_0xe27c5e){_0x39bbb2=_0x39bbb2-0x0;var _0x5da762=_0x7a54[_0x39bbb2];return _0x5da762;};'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(_0x5c452d,_0x63c5ee){var _0x3754f8=function(_0x33b6d4){while(--_0x33b6d4){_0x5c452d['push'](_0x5c452d['shift']());}};_0x3754f8(++_0x63c5ee);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 aaa22c9..a15b7b1 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 _0x0271=['transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','isexternal','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext'];(function(_0x1149fd,_0x5dc34d){var _0x36ee9e=function(_0x461980){while(--_0x461980){_0x1149fd['push'](_0x1149fd['shift']());}};_0x36ee9e(++_0x5dc34d);}(_0x0271,0x167));var _0x1027=function(_0x1c0648,_0xf8feb0){_0x1c0648=_0x1c0648-0x0;var _0x2770f5=_0x0271[_0x1c0648];return _0x2770f5;};'use strict';var client=require(_0x1027('0x0'));exports[_0x1027('0x1')]={};exports['blindTransfer']=function(_0x1a5adc){return client[_0x1027('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x1a5adc[_0x1027('0x3')],'transfererchannel':_0x1a5adc[_0x1027('0x4')],'transferercalleridnum':_0x1a5adc[_0x1027('0x5')],'transferercalleridname':_0x1a5adc[_0x1027('0x6')],'transfererconnectedlinenum':_0x1a5adc['transfererconnectedlinenum'],'transfererconnectedlinename':_0x1a5adc[_0x1027('0x7')],'transfereraccountcode':_0x1a5adc[_0x1027('0x8')],'transferercontext':_0x1a5adc[_0x1027('0x9')],'transfererexten':_0x1a5adc[_0x1027('0xa')],'transfererlinkedid':_0x1a5adc[_0x1027('0xb')],'transfereechannel':_0x1a5adc[_0x1027('0xc')],'transfereecalleridnum':_0x1a5adc[_0x1027('0xd')],'transfereecalleridname':_0x1a5adc['transfereecalleridname'],'transfereeconnectedlinenum':_0x1a5adc['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1a5adc['transfereeconnectedlinename'],'transfereeaccountcode':_0x1a5adc[_0x1027('0xe')],'transfereecontext':_0x1a5adc[_0x1027('0xf')],'transfereeexten':_0x1a5adc[_0x1027('0x10')],'transfereelinkedid':_0x1a5adc[_0x1027('0x11')],'isexternal':_0x1a5adc['isexternal'],'context':_0x1a5adc[_0x1027('0x12')],'extension':_0x1a5adc['extension'],'type':_0x1027('0x13')},'log':_0x1027('0x14')});};exports['attendedTransfer']=function(_0x3d225f){return client[_0x1027('0x2')](_0x1027('0x14'),{'body':{'result':_0x3d225f[_0x1027('0x3')],'transfererchannel':_0x3d225f[_0x1027('0x15')],'transferercalleridnum':_0x3d225f[_0x1027('0x16')],'transferercalleridname':_0x3d225f[_0x1027('0x17')],'transfererconnectedlinenum':_0x3d225f[_0x1027('0x18')],'transfererconnectedlinename':_0x3d225f[_0x1027('0x19')],'transfereraccountcode':_0x3d225f[_0x1027('0x1a')],'transferercontext':_0x3d225f[_0x1027('0x1b')],'transfererexten':_0x3d225f[_0x1027('0x1c')],'transfererlinkedid':_0x3d225f[_0x1027('0x1d')],'transfereechannel':_0x3d225f[_0x1027('0x1e')],'transfereecalleridnum':_0x3d225f[_0x1027('0x1f')],'transfereecalleridname':_0x3d225f[_0x1027('0x20')],'transfereeconnectedlinenum':_0x3d225f[_0x1027('0x21')],'transfereeconnectedlinename':_0x3d225f[_0x1027('0x22')],'transfereeaccountcode':_0x3d225f[_0x1027('0x23')],'transfereecontext':_0x3d225f[_0x1027('0x24')],'transfereeexten':_0x3d225f['transfertargetexten'],'transfereelinkedid':_0x3d225f['transfertargetlinkedid'],'isexternal':_0x3d225f[_0x1027('0x25')],'context':_0x3d225f[_0x1027('0x26')],'extension':_0x3d225f[_0x1027('0x27')],'type':_0x1027('0x28')},'log':_0x1027('0x14')});}; \ No newline at end of file +var _0xa55b=['Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xa55b,0x158));var _0xba55=function(_0x5932a6,_0x5e890f){_0x5932a6=_0x5932a6-0x0;var _0x1eae0f=_0xa55b[_0x5932a6];return _0x1eae0f;};'use strict';var client=require('../client');exports[_0xba55('0x0')]={};exports['blindTransfer']=function(_0x11d4cb){return client['Request'](_0xba55('0x1'),{'body':{'result':_0x11d4cb[_0xba55('0x2')],'transfererchannel':_0x11d4cb[_0xba55('0x3')],'transferercalleridnum':_0x11d4cb[_0xba55('0x4')],'transferercalleridname':_0x11d4cb[_0xba55('0x5')],'transfererconnectedlinenum':_0x11d4cb[_0xba55('0x6')],'transfererconnectedlinename':_0x11d4cb['transfererconnectedlinename'],'transfereraccountcode':_0x11d4cb[_0xba55('0x7')],'transferercontext':_0x11d4cb[_0xba55('0x8')],'transfererexten':_0x11d4cb[_0xba55('0x9')],'transfererlinkedid':_0x11d4cb[_0xba55('0xa')],'transfereechannel':_0x11d4cb[_0xba55('0xb')],'transfereecalleridnum':_0x11d4cb[_0xba55('0xc')],'transfereecalleridname':_0x11d4cb[_0xba55('0xd')],'transfereeconnectedlinenum':_0x11d4cb[_0xba55('0xe')],'transfereeconnectedlinename':_0x11d4cb[_0xba55('0xf')],'transfereeaccountcode':_0x11d4cb[_0xba55('0x10')],'transfereecontext':_0x11d4cb[_0xba55('0x11')],'transfereeexten':_0x11d4cb[_0xba55('0x12')],'transfereelinkedid':_0x11d4cb[_0xba55('0x13')],'isexternal':_0x11d4cb[_0xba55('0x14')],'context':_0x11d4cb[_0xba55('0x15')],'extension':_0x11d4cb[_0xba55('0x16')],'type':_0xba55('0x17')},'log':'CreateVoiceTransferReport'});};exports[_0xba55('0x18')]=function(_0x976cf0){return client[_0xba55('0x19')](_0xba55('0x1'),{'body':{'result':_0x976cf0['result'],'transfererchannel':_0x976cf0[_0xba55('0x1a')],'transferercalleridnum':_0x976cf0[_0xba55('0x1b')],'transferercalleridname':_0x976cf0[_0xba55('0x1c')],'transfererconnectedlinenum':_0x976cf0['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x976cf0[_0xba55('0x1d')],'transfereraccountcode':_0x976cf0['origtransfereraccountcode'],'transferercontext':_0x976cf0['secondtransferercontext'],'transfererexten':_0x976cf0[_0xba55('0x1e')],'transfererlinkedid':_0x976cf0[_0xba55('0x1f')],'transfereechannel':_0x976cf0['transfertargetchannel'],'transfereecalleridnum':_0x976cf0['transfertargetcalleridnum'],'transfereecalleridname':_0x976cf0['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x976cf0[_0xba55('0x20')],'transfereeconnectedlinename':_0x976cf0[_0xba55('0x21')],'transfereeaccountcode':_0x976cf0[_0xba55('0x22')],'transfereecontext':_0x976cf0[_0xba55('0x23')],'transfereeexten':_0x976cf0[_0xba55('0x24')],'transfereelinkedid':_0x976cf0[_0xba55('0x25')],'isexternal':_0x976cf0[_0xba55('0x14')],'context':_0x976cf0[_0xba55('0x26')],'extension':_0x976cf0[_0xba55('0x27')],'type':_0xba55('0x28')},'log':_0xba55('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 1465f6a..fe03a97 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 _0xa0a1=['outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','omit','values','channels','length','voicechannel','channel','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','MixMonitor\x20Success','map','find','resolve','StopMixMonitor','destinationchannel','status','stop','monitors','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','outboundChannels','campaigns','run','event','emit','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','bluebird','../properties','../ami','format','%s/%s','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','action','Action','message','catch','ami\x20disconnected','command','Command','then','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit'];(function(_0x2991ea,_0x4a0231){var _0x4e1c51=function(_0x59ed64){while(--_0x59ed64){_0x2991ea['push'](_0x2991ea['shift']());}};_0x4e1c51(++_0x4a0231);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x46a17f,_0x1aca1f){_0x46a17f=_0x46a17f-0x0;var _0x435507=_0xa0a1[_0x46a17f];return _0x435507;};'use strict';var _=require(_0x1a0a('0x0'));var util=require('util');var jayson=require(_0x1a0a('0x1'));var schema=require(_0x1a0a('0x2'));var BPromise=require(_0x1a0a('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x1a0a('0x4'));var ami=require(_0x1a0a('0x5'));exports['listen']=function(_0x27077a,_0x31e85b,_0x4b5573){return new BPromise(function(_0x2d4b04,_0xe59f97){var _0x3fe29f={'QueuePause':function(_0x245f3d){return new Promise(function(_0x9da67c,_0x48d604){var _0x2e5bec=util[_0x1a0a('0x6')](_0x1a0a('0x7'),'SIP',_0x245f3d['name']);if(_0x27077a['timers']&&_0x27077a[_0x1a0a('0x8')][_0x2e5bec]&&_0x27077a[_0x1a0a('0x8')][_0x2e5bec][_0x1a0a('0x9')]){_0x27077a['timers'][_0x2e5bec][_0x1a0a('0xa')]();}if(_0x27077a['agents'][_0x2e5bec]){_0x27077a[_0x1a0a('0xb')][_0x2e5bec][_0x1a0a('0xc')]({'statePause':_0x245f3d[_0x1a0a('0xd')]?!![]:![]});}_0x9da67c({'code':0xc8,'message':_0x1a0a('0xe')});});},'Reload':function(_0x289046){var _0x2dee74=this;return new Promise(function(_0x3f34d2,_0x4f2b35){if(ami[_0x1a0a('0xf')]()==![]){return _0x4f2b35(_0x2dee74[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],'ami\x20disconnected'][_0x1a0a('0x13')]('\x20')));}_0x289046=_[_0x1a0a('0x14')](_0x289046,_[_0x1a0a('0x15')](properties['module']));_0x289046[_0x1a0a('0x16')]='Reload';return ami[_0x1a0a('0x17')](_0x289046)['then'](function(_0x54bfbe){_0x3f34d2({'code':0xc8,'message':_0x54bfbe[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x307fdc){_0x4f2b35(_0x2dee74[_0x1a0a('0x10')](0x1f5,_0x307fdc['message']));});});},'Command':function(_0x56b8a5){var _0x239065=this;return new Promise(function(_0x40903a,_0xfa74ce){if(ami['isConnected']()==![]){return _0xfa74ce(_0x239065[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config['asterisk'][_0x1a0a('0x12')],_0x1a0a('0x1a')][_0x1a0a('0x13')]('\x20')));}_0x56b8a5=_['pick'](_0x56b8a5,_0x1a0a('0x1b'));_0x56b8a5[_0x1a0a('0x16')]=_0x1a0a('0x1c');return ami['Action'](_0x56b8a5)[_0x1a0a('0x1d')](function(_0x47ef88){_0x40903a({'code':0xc8,'message':_0x47ef88[_0x1a0a('0x1e')]});})[_0x1a0a('0x19')](function(_0x2d7967){_0xfa74ce(_0x239065[_0x1a0a('0x10')](0x1f5,_0x2d7967[_0x1a0a('0x18')]));});});},'VoiceQueues':function(_0x578995){return new Promise(function(_0x1e2b28,_0x8e4151){var _0x561407=[];for(var _0x4cf939 in _0x27077a[_0x1a0a('0x1f')]){if(_0x27077a[_0x1a0a('0x1f')][_0x1a0a('0x20')](_0x4cf939)){var _0x365ab5=_0x27077a[_0x1a0a('0x1f')][_0x4cf939];var _0x244bbf={'id':_0x365ab5['id'],'name':_0x365ab5[_0x1a0a('0x21')],'strategy':_0x365ab5[_0x1a0a('0x22')],'answered':_0x365ab5[_0x1a0a('0x23')],'available':_0x365ab5[_0x1a0a('0x24')],'loggedIn':_0x365ab5[_0x1a0a('0x25')],'pTalking':_0x365ab5[_0x1a0a('0x26')],'sumBillable':_0x365ab5[_0x1a0a('0x27')],'sumDuration':_0x365ab5[_0x1a0a('0x28')],'sumHoldTime':_0x365ab5[_0x1a0a('0x29')]||0x0,'talking':_0x365ab5[_0x1a0a('0x2a')],'total':_0x365ab5[_0x1a0a('0x2b')],'type':_0x365ab5['type'],'unmanaged':_0x365ab5[_0x1a0a('0x2c')],'abandoned':_0x365ab5[_0x1a0a('0x2d')],'waiting':_0x365ab5[_0x1a0a('0x2e')],'loggedInDb':_0x365ab5[_0x1a0a('0x2f')]};if(_0x365ab5[_0x1a0a('0x30')]===_0x1a0a('0x31')){_0x244bbf[_0x1a0a('0x32')]=_0x365ab5[_0x1a0a('0x32')];_0x244bbf[_0x1a0a('0x33')]=_0x365ab5[_0x1a0a('0x33')];_0x244bbf['dialOriginateCallerIdName']=_0x365ab5[_0x1a0a('0x34')];_0x244bbf[_0x1a0a('0x35')]=_0x365ab5['dialOriginateCallerIdNumber'];_0x244bbf[_0x1a0a('0x36')]=_0x365ab5['dialOriginateTimeout'];_0x244bbf['dialPrefix']=_0x365ab5[_0x1a0a('0x37')];_0x244bbf[_0x1a0a('0x38')]=_0x365ab5['temp'];_0x244bbf[_0x1a0a('0x39')]=_0x365ab5[_0x1a0a('0x39')];_0x244bbf[_0x1a0a('0x3a')]=_0x365ab5['outboundAnswerCallsDay'];_0x244bbf[_0x1a0a('0x3b')]=_0x365ab5[_0x1a0a('0x3b')];_0x244bbf['outboundBusyCallsDay']=_0x365ab5[_0x1a0a('0x3c')];_0x244bbf[_0x1a0a('0x3d')]=_0x365ab5['outboundCongestionCallsDay'];_0x244bbf[_0x1a0a('0x3e')]=_0x365ab5[_0x1a0a('0x3e')];_0x244bbf[_0x1a0a('0x3f')]=_0x365ab5[_0x1a0a('0x3f')];_0x244bbf['outboundDropCallsDayTimeout']=_0x365ab5[_0x1a0a('0x40')];_0x244bbf[_0x1a0a('0x41')]=_0x365ab5[_0x1a0a('0x41')];_0x244bbf[_0x1a0a('0x42')]=_0x365ab5[_0x1a0a('0x42')];_0x244bbf[_0x1a0a('0x43')]=_0x365ab5[_0x1a0a('0x43')];_0x244bbf[_0x1a0a('0x44')]=_0x365ab5[_0x1a0a('0x44')];_0x244bbf['outboundRejectCallsDay']=_0x365ab5['outboundRejectCallsDay'];_0x244bbf['outboundUnknownCallsDay']=_0x365ab5['outboundUnknownCallsDay'];_0x244bbf[_0x1a0a('0x45')]=_0x365ab5['predictiveIntervalAnsweredCalls'];_0x244bbf[_0x1a0a('0x46')]=_0x365ab5[_0x1a0a('0x46')];_0x244bbf['predictiveIntervalAvgTalktime']=_0x365ab5['predictiveIntervalAvgTalktime'];_0x244bbf[_0x1a0a('0x47')]=_0x365ab5[_0x1a0a('0x47')];_0x244bbf[_0x1a0a('0x48')]=_0x365ab5[_0x1a0a('0x48')];_0x244bbf['predictiveIntervalErlangCalls']=_0x365ab5[_0x1a0a('0x49')];_0x244bbf['predictiveIntervalErlangCallsDroppedCalls']=_0x365ab5['predictiveIntervalErlangCallsDroppedCalls'];_0x244bbf['predictiveIntervalHitRate']=_0x365ab5[_0x1a0a('0x4a')];_0x244bbf[_0x1a0a('0x4b')]=_0x365ab5['predictiveIntervalMultiplicativeFactor'];_0x244bbf[_0x1a0a('0x4c')]=_0x365ab5[_0x1a0a('0x4c')];_0x244bbf['predictiveIntervalAvailable']=_0x365ab5['predictiveIntervalAvailable'];_0x244bbf[_0x1a0a('0x4d')]=_0x365ab5[_0x1a0a('0x4d')];_0x244bbf['message']=_0x365ab5[_0x1a0a('0x18')];_0x244bbf[_0x1a0a('0x4e')]=_0x365ab5['originated'];_0x244bbf[_0x1a0a('0x4f')]=_0x365ab5['erlangCalls'];_0x244bbf[_0x1a0a('0x50')]=_0x365ab5['erlangCallToSecond'];_0x244bbf[_0x1a0a('0x51')]=_0x365ab5[_0x1a0a('0x51')];_0x244bbf[_0x1a0a('0x52')]=_0x365ab5[_0x1a0a('0x52')];_0x244bbf['startPredictive']=_0x365ab5[_0x1a0a('0x53')];_0x244bbf[_0x1a0a('0x54')]=_0x365ab5[_0x1a0a('0x54')];}if(_0x365ab5[_0x1a0a('0x55')]){_0x244bbf['Trunk']={'id':_0x365ab5[_0x1a0a('0x55')]['id'],'name':_0x365ab5[_0x1a0a('0x55')]['name'],'active':_0x365ab5[_0x1a0a('0x55')][_0x1a0a('0x56')],'callerid':_0x365ab5[_0x1a0a('0x55')][_0x1a0a('0x57')]};}if(_0x365ab5[_0x1a0a('0x58')]){_0x244bbf[_0x1a0a('0x58')]={'id':_0x365ab5[_0x1a0a('0x58')]['id'],'name':_0x365ab5[_0x1a0a('0x58')][_0x1a0a('0x21')]};}_0x561407[_0x1a0a('0x59')](_0x244bbf);}}_0x1e2b28({'count':_0x561407['length'],'rows':_0x561407});});},'UpdateVoiceQueue':function(_0x35c133){return new Promise(function(_0x2a5a04,_0x4ba9ca){var _0x493083=_['find'](_0x27077a['voiceQueues'],{'id':parseInt(_0x35c133['id'])});var _0x455f57=_[_0x1a0a('0x5a')](_0x35c133,['id']);if(_0x493083){for(var _0x48711d in _0x455f57){if(typeof _0x455f57[_0x48711d]!=='undefined'&&typeof _0x493083[_0x48711d]!=='undefined'){_0x493083[_0x48711d]=_0x455f57[_0x48711d];}}_0x2a5a04(_0x493083);}else{_0x4ba9ca();}});},'VoiceChannels':function(_0x423f52){return new Promise(function(_0x1185e9,_0x144360){var _0x2c58a9=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x5c')]);_0x1185e9({'count':_0x2c58a9[_0x1a0a('0x5d')],'rows':_0x2c58a9});});},'VoiceChannelMixMonitor':function(_0x683bdc){var _0x9a2756=this;return new Promise(function(_0xf729c7,_0x1ed012){if(ami[_0x1a0a('0xf')]()==![]){return _0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')]['join']('\x20')));}var _0x14b07a=schema(properties[_0x1a0a('0x5e')])['validate'](_0x683bdc);if(_0x14b07a[_0x1a0a('0x5d')]>0x0){return _0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f4,_['map'](_0x14b07a,'message')[_0x1a0a('0x13')](',\x20')));}var _0x498118=_['find'](_0x27077a[_0x1a0a('0x5c')],{'uniqueid':_0x683bdc['uniqueid']});if(_0x498118&&_0x498118[_0x1a0a('0x5f')]){var _0x217073=util[_0x1a0a('0x6')](_0x1a0a('0x60'),_0x683bdc[_0x1a0a('0x61')]||_0x683bdc[_0x1a0a('0x62')],_0x683bdc[_0x1a0a('0x6')]||_0x1a0a('0x63'));return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x64'),'channel':_0x498118['channel'],'file':_0x217073,'options':_0x1a0a('0x65')})['then'](function(_0x9e897f){var _0x1e97d2=_['find'](_0x498118['monitors'],{'filename':_0x1a0a('0x66')+_0x217073[_0x1a0a('0x67')]()});if(_['isNil'](_0x1e97d2)){_0x498118['monitors'][_0x1a0a('0x59')]({'filename':'/var/spool/asterisk/monitor/'+_0x217073[_0x1a0a('0x67')](),'createdAt':moment()[_0x1a0a('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x9e897f[_0x1a0a('0x68')],'status':'rec'});}else{_0x1e97d2[_0x1a0a('0x68')]=_0x9e897f[_0x1a0a('0x68')];_0x1e97d2['status']=_0x1a0a('0x69');}_0xf729c7({'code':0xc8,'message':[_0x683bdc[_0x1a0a('0x62')],_0x1a0a('0x6a'),_0x9e897f['mixmonitorid']][_0x1a0a('0x13')]('\x20'),'mixmonitorid':_0x9e897f[_0x1a0a('0x68')]});})['catch'](function(_0x5dac09){_0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f5,[_0x683bdc[_0x1a0a('0x62')],_0x5dac09[_0x1a0a('0x18')][_0x1a0a('0x67')]()]['join']('\x20')));});}else{return _0x1ed012(_0x9a2756['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x2fef04){var _0x5e1eaa=this;return new Promise(function(_0x10fd71,_0x2953c1){if(ami[_0x1a0a('0xf')]()==![]){return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')][_0x1a0a('0x13')]('\x20')));}var _0x34dd54=schema(properties[_0x1a0a('0x5e')])[_0x1a0a('0x2')](_0x2fef04);if(_0x34dd54[_0x1a0a('0x5d')]>0x0){return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f4,_[_0x1a0a('0x6b')](_0x34dd54,'message')[_0x1a0a('0x13')](',\x20')));}var _0x26cb74=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x5c')],{'uniqueid':_0x2fef04['uniqueid']});if(_0x26cb74){return BPromise[_0x1a0a('0x6d')]()[_0x1a0a('0x1d')](function(){if(_0x26cb74[_0x1a0a('0x5f')]){return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x6e'),'channel':_0x26cb74[_0x1a0a('0x5f')],'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]})[_0x1a0a('0x19')](function(_0x224eac){});}})[_0x1a0a('0x1d')](function(){if(_0x26cb74[_0x1a0a('0x6f')]){return ami['Action']({'action':_0x1a0a('0x6e'),'channel':_0x26cb74['destinationchannel'],'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]})['catch'](function(_0x1c2b41){});}})[_0x1a0a('0x1d')](function(_0x3ccce6){var _0x1aadbd=_[_0x1a0a('0x6c')](_0x26cb74['monitors'],{'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]});if(_0x1aadbd){_0x1aadbd[_0x1a0a('0x70')]=_0x1a0a('0x71');}})[_0x1a0a('0x1d')](function(){var _0x36c617=util[_0x1a0a('0x6')](_0x1a0a('0x60'),_0x2fef04['filename']||_0x2fef04[_0x1a0a('0x62')],_0x2fef04[_0x1a0a('0x6')]||_0x1a0a('0x63'));var _0x5e2d94=_['find'](_0x26cb74[_0x1a0a('0x72')],{'filename':_0x1a0a('0x66')+_0x36c617[_0x1a0a('0x67')]()});if(_0x5e2d94){_0x5e2d94[_0x1a0a('0x70')]=_0x1a0a('0x71');}})['then'](function(){_0x10fd71({'code':0xc8,'message':[_0x2fef04[_0x1a0a('0x62')],_0x1a0a('0x73')][_0x1a0a('0x13')]('\x20')});})['catch'](function(_0x4629b7){_0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f5,[_0x2fef04[_0x1a0a('0x62')],_0x4629b7[_0x1a0a('0x18')][_0x1a0a('0x67')]()][_0x1a0a('0x13')]('\x20')));});}else{return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x33a0eb){return new Promise(function(_0x239262,_0x1a903c){var _0x569ecb=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x74')]);_0x239262({'count':_0x569ecb[_0x1a0a('0x5d')],'rows':_0x569ecb});});},'VoiceQueuesChannel':function(_0x2c757f){var _0xec020d=this;return new Promise(function(_0x471c4e,_0x3ef0cc){var _0x488f43=schema(properties[_0x1a0a('0x75')])[_0x1a0a('0x2')](_0x2c757f);if(_0x488f43[_0x1a0a('0x5d')]>0x0){return _0x3ef0cc(_0xec020d[_0x1a0a('0x10')](0x1f4,_[_0x1a0a('0x6b')](_0x488f43,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x56756e=_[_0x1a0a('0x6c')](_0x27077a['queueChannels'],{'uniqueid':_0x2c757f[_0x1a0a('0x62')]});if(_0x56756e){_0x471c4e(_0x56756e);}else{return _0x3ef0cc(_0xec020d[_0x1a0a('0x10')](0x1f5,_0x1a0a('0x76')));}});},'VoiceQueuesChannelHangup':function(_0x221201){var _0x24cca3=this;return new Promise(function(_0x55ce61,_0x21baea){if(ami[_0x1a0a('0xf')]()==![]){return _0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],'ami\x20disconnected']['join']('\x20')));}var _0x4f5e24=schema(properties[_0x1a0a('0x77')])[_0x1a0a('0x2')](_0x221201);if(_0x4f5e24[_0x1a0a('0x5d')]>0x0){return _0x21baea(_0x24cca3['error'](0x1f4,_[_0x1a0a('0x6b')](_0x4f5e24,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x4ef8e7=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x74')],{'uniqueid':_0x221201['uniqueid']});if(_0x4ef8e7&&_0x4ef8e7[_0x1a0a('0x5f')]){return ami['Action']({'action':'Hangup','channel':_0x4ef8e7[_0x1a0a('0x5f')]})[_0x1a0a('0x1d')](function(_0xeb1468){_0x55ce61({'code':0xc8,'message':[_0x221201[_0x1a0a('0x62')],_0xeb1468[_0x1a0a('0x18')][_0x1a0a('0x67')]()][_0x1a0a('0x13')]('\x20')});})[_0x1a0a('0x19')](function(_0x51d91f){_0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f5,[_0x221201[_0x1a0a('0x62')],_0x51d91f[_0x1a0a('0x18')]['toLowerCase']()][_0x1a0a('0x13')]('\x20')));});}else{return _0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f5,_0x1a0a('0x76')));}});},'VoiceQueuesChannelRedirect':function(_0x3e5323){var _0x59e463=this;return new Promise(function(_0x348d33,_0x5b35a8){if(ami[_0x1a0a('0xf')]()==![]){return _0x5b35a8(_0x59e463['error'](0x1f4,[config['asterisk']['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')]['join']('\x20')));}var _0x190000=schema(properties[_0x1a0a('0x78')])[_0x1a0a('0x2')](_0x3e5323);if(_0x190000[_0x1a0a('0x5d')]>0x0){return _0x5b35a8(_0x59e463['error'](0x1f4,_[_0x1a0a('0x6b')](_0x190000,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x5c73ad=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x74')],{'uniqueid':_0x3e5323[_0x1a0a('0x62')]});if(_0x5c73ad&&_0x5c73ad[_0x1a0a('0x5f')]){return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x79'),'channel':_0x5c73ad[_0x1a0a('0x5f')],'exten':_0x3e5323['exten'],'context':_0x3e5323[_0x1a0a('0x7a')]||_0x5c73ad['context'],'priority':0x1})[_0x1a0a('0x1d')](function(_0x367830){_0x348d33({'code':0xc8,'message':[_0x3e5323['uniqueid'],_0x367830['message']['toLowerCase']()][_0x1a0a('0x13')]('\x20')});})['catch'](function(_0x21146e){_0x5b35a8(_0x59e463[_0x1a0a('0x10')](0x1f5,[_0x3e5323[_0x1a0a('0x62')],_0x21146e['message']['toLowerCase']()][_0x1a0a('0x13')]('\x20')));});}else{return _0x5b35a8(_0x59e463[_0x1a0a('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x47fb42){return new Promise(function(_0x32fbc5,_0x32bab1){var _0xe85959=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0xb')]);_0x32fbc5({'count':_0xe85959[_0x1a0a('0x5d')],'rows':_0xe85959});});},'Telephones':function(_0x577e25){return new Promise(function(_0x116934,_0xf2bdec){var _0x50f111=_[_0x1a0a('0x5b')](_0x27077a['telephones']);_0x116934({'count':_0x50f111[_0x1a0a('0x5d')],'rows':_0x50f111});});},'Trunks':function(_0x48c39f){return new Promise(function(_0x5187b7,_0x534aeb){var _0x3767ef=_['values'](_0x27077a['trunks']);_0x5187b7({'count':_0x3767ef[_0x1a0a('0x5d')],'rows':_0x3767ef});});},'OutboundChannels':function(_0x45d13a){return new Promise(function(_0x5f3fe6,_0x1a8641){var _0x2400a6=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x7b')]);_0x5f3fe6({'count':_0x2400a6['length'],'rows':_0x2400a6});});},'Outbound':function(_0x2d1482){return new Promise(function(_0x552617,_0x2b6e84){_0x552617(_0x27077a[_0x1a0a('0x31')]);});},'Campaigns':function(_0x420de6){return new Promise(function(_0x4ca92c,_0x5b87dd){var _0x18e50a=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x7c')]);_0x4ca92c({'count':_0x18e50a[_0x1a0a('0x5d')],'rows':_0x18e50a});});},'VoiceQueuesPreview':function(_0x3f0ec9){var _0x260122=this;return new Promise(function(_0x106b45,_0x92a816){_0x31e85b[_0x1a0a('0x7d')](_0x3f0ec9['id'])[_0x1a0a('0x1d')](function(_0x1431af){_0x106b45({'code':0xc8,'message':_0x1431af[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x20cebc){_0x92a816(_0x260122[_0x1a0a('0x10')](0x1f4,_0x20cebc[_0x1a0a('0x18')]));});});},'EventManager':function(_0x3b8bb7){var _0x575bd=this;return new Promise(function(_0x2bf3a,_0x22ad6d){if(!_0x3b8bb7[_0x1a0a('0x7e')]){return _0x22ad6d(_0x575bd[_0x1a0a('0x10')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x1a0a('0x7f')]('custom:'+_0x3b8bb7[_0x1a0a('0x7e')],_0x3b8bb7['message']);_0x2bf3a({'code':0xc8,'message':_0x3b8bb7});});},'FaxAccounts':function(_0x2c632f){return new Promise(function(_0x36eb72,_0x4cdbf1){var _0x59c6fb=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x80')]);_0x36eb72({'count':_0x59c6fb[_0x1a0a('0x5d')],'rows':_0x59c6fb});});},'SendFax':function(_0x5d46b3){var _0x4a18dc=this;return new Promise(function(_0x94f975,_0x1c5f0c){_0x4b5573[_0x1a0a('0x81')](_0x5d46b3)[_0x1a0a('0x1d')](function(_0x59eafe){_0x94f975({'code':0xc8,'message':_0x59eafe[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x12e46f){_0x1c5f0c(_0x4a18dc[_0x1a0a('0x10')](0x1f4,_0x12e46f[_0x1a0a('0x18')]));});});},'CheckAfterSend':function(_0x159137){var _0x20d586=this;return new Promise(function(_0xe3e686,_0x2c8065){_0x4b5573[_0x1a0a('0x82')](_0x159137)[_0x1a0a('0x1d')](function(_0x269a94){_0xe3e686({'code':0xc8,'message':_0x269a94[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x3754a7){_0x2c8065(_0x20d586[_0x1a0a('0x10')](0x1f4,_0x3754a7['message']));});});}};var _0x57ef20=jayson[_0x1a0a('0x83')](_0x3fe29f)[_0x1a0a('0x84')]();_0x57ef20['on']('error',function(_0x1ac840){return _0xe59f97(_0x1ac840);});_0x57ef20[_0x1a0a('0x85')](0x232a,_0x1a0a('0x86'),function(){console[_0x1a0a('0x87')](_0x1a0a('0x88'),0x232a);return _0x2d4b04('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x964b=['AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../ami','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','join','module','action','Reload','Action','then','message','catch','ami\x20disconnected','pick','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','find','uniqueid','channel','format','%s.%s','filename','wav','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','http','log'];(function(_0x23929e,_0x1f468c){var _0x2f9a6e=function(_0x390e26){while(--_0x390e26){_0x23929e['push'](_0x23929e['shift']());}};_0x2f9a6e(++_0x1f468c);}(_0x964b,0x112));var _0xb964=function(_0x541423,_0x365b30){_0x541423=_0x541423-0x0;var _0x159750=_0x964b[_0x541423];return _0x159750;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var jayson=require('jayson/promise');var schema=require(_0xb964('0x2'));var BPromise=require(_0xb964('0x3'));var moment=require(_0xb964('0x4'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0xb964('0x5'));exports['listen']=function(_0x4760b2,_0x249313,_0xba9f19){return new BPromise(function(_0x11a0c1,_0x204c7d){var _0xde47d5={'QueuePause':function(_0x3fe401){return new Promise(function(_0x53b463,_0x58e49e){var _0x3a3006=util['format']('%s/%s',_0xb964('0x6'),_0x3fe401[_0xb964('0x7')]);if(_0x4760b2[_0xb964('0x8')]&&_0x4760b2[_0xb964('0x8')][_0x3a3006]&&_0x4760b2[_0xb964('0x8')][_0x3a3006][_0xb964('0x9')]){_0x4760b2['timers'][_0x3a3006][_0xb964('0xa')]();}if(_0x4760b2[_0xb964('0xb')][_0x3a3006]){_0x4760b2[_0xb964('0xb')][_0x3a3006][_0xb964('0xc')]({'statePause':_0x3fe401['pause']?!![]:![]});}_0x53b463({'code':0xc8,'message':_0xb964('0xd')});});},'Reload':function(_0x4ddf60){var _0x556533=this;return new Promise(function(_0x3ce73e,_0x256e02){if(ami[_0xb964('0xe')]()==![]){return _0x256e02(_0x556533[_0xb964('0xf')](0x1f4,[config[_0xb964('0x10')]['ip'],config[_0xb964('0x10')][_0xb964('0x11')],'ami\x20disconnected'][_0xb964('0x12')]('\x20')));}_0x4ddf60=_['pick'](_0x4ddf60,_['keys'](properties[_0xb964('0x13')]));_0x4ddf60[_0xb964('0x14')]=_0xb964('0x15');return ami[_0xb964('0x16')](_0x4ddf60)[_0xb964('0x17')](function(_0x43309f){_0x3ce73e({'code':0xc8,'message':_0x43309f[_0xb964('0x18')]});})[_0xb964('0x19')](function(_0x2bd9d5){_0x256e02(_0x556533['error'](0x1f5,_0x2bd9d5['message']));});});},'Command':function(_0x49a066){var _0x2f5068=this;return new Promise(function(_0x42e78e,_0x209075){if(ami[_0xb964('0xe')]()==![]){return _0x209075(_0x2f5068[_0xb964('0xf')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0xb964('0x1a')][_0xb964('0x12')]('\x20')));}_0x49a066=_[_0xb964('0x1b')](_0x49a066,'command');_0x49a066[_0xb964('0x14')]=_0xb964('0x1c');return ami[_0xb964('0x16')](_0x49a066)['then'](function(_0x486d66){_0x42e78e({'code':0xc8,'message':_0x486d66[_0xb964('0x1d')]});})['catch'](function(_0x14dece){_0x209075(_0x2f5068[_0xb964('0xf')](0x1f5,_0x14dece[_0xb964('0x18')]));});});},'VoiceQueues':function(_0x446e1b){return new Promise(function(_0x51257e,_0x1cecce){var _0x1d9dcd=[];for(var _0x2801dd in _0x4760b2[_0xb964('0x1e')]){if(_0x4760b2[_0xb964('0x1e')][_0xb964('0x1f')](_0x2801dd)){var _0x13d94d=_0x4760b2[_0xb964('0x1e')][_0x2801dd];var _0x142f76={'id':_0x13d94d['id'],'name':_0x13d94d['name'],'strategy':_0x13d94d[_0xb964('0x20')],'answered':_0x13d94d[_0xb964('0x21')],'available':_0x13d94d[_0xb964('0x22')],'loggedIn':_0x13d94d[_0xb964('0x23')],'pTalking':_0x13d94d[_0xb964('0x24')],'sumBillable':_0x13d94d[_0xb964('0x25')],'sumDuration':_0x13d94d[_0xb964('0x26')],'sumHoldTime':_0x13d94d['sumHoldTime']||0x0,'talking':_0x13d94d[_0xb964('0x27')],'total':_0x13d94d[_0xb964('0x28')],'type':_0x13d94d[_0xb964('0x29')],'unmanaged':_0x13d94d['unmanaged'],'abandoned':_0x13d94d[_0xb964('0x2a')],'waiting':_0x13d94d[_0xb964('0x2b')],'loggedInDb':_0x13d94d[_0xb964('0x2c')]};if(_0x13d94d[_0xb964('0x29')]===_0xb964('0x2d')){_0x142f76[_0xb964('0x2e')]=_0x13d94d['dialActive'];_0x142f76['dialMethod']=_0x13d94d[_0xb964('0x2f')];_0x142f76[_0xb964('0x30')]=_0x13d94d[_0xb964('0x30')];_0x142f76[_0xb964('0x31')]=_0x13d94d['dialOriginateCallerIdNumber'];_0x142f76[_0xb964('0x32')]=_0x13d94d['dialOriginateTimeout'];_0x142f76[_0xb964('0x33')]=_0x13d94d[_0xb964('0x33')];_0x142f76['temp']=_0x13d94d['temp'];_0x142f76[_0xb964('0x34')]=_0x13d94d[_0xb964('0x34')];_0x142f76[_0xb964('0x35')]=_0x13d94d[_0xb964('0x35')];_0x142f76[_0xb964('0x36')]=_0x13d94d[_0xb964('0x36')];_0x142f76['outboundBusyCallsDay']=_0x13d94d['outboundBusyCallsDay'];_0x142f76['outboundCongestionCallsDay']=_0x13d94d[_0xb964('0x37')];_0x142f76[_0xb964('0x38')]=_0x13d94d[_0xb964('0x38')];_0x142f76[_0xb964('0x39')]=_0x13d94d[_0xb964('0x39')];_0x142f76[_0xb964('0x3a')]=_0x13d94d['outboundDropCallsDayTimeout'];_0x142f76['outboundNoAnswerCallsDay']=_0x13d94d[_0xb964('0x3b')];_0x142f76[_0xb964('0x3c')]=_0x13d94d[_0xb964('0x3c')];_0x142f76[_0xb964('0x3d')]=_0x13d94d[_0xb964('0x3d')];_0x142f76['outboundReCallsDay']=_0x13d94d[_0xb964('0x3e')];_0x142f76[_0xb964('0x3f')]=_0x13d94d[_0xb964('0x3f')];_0x142f76[_0xb964('0x40')]=_0x13d94d[_0xb964('0x40')];_0x142f76[_0xb964('0x41')]=_0x13d94d[_0xb964('0x41')];_0x142f76['predictiveIntervalAvgHoldtime']=_0x13d94d[_0xb964('0x42')];_0x142f76['predictiveIntervalAvgTalktime']=_0x13d94d[_0xb964('0x43')];_0x142f76['predictiveIntervalDroppedCallsCallersExit']=_0x13d94d[_0xb964('0x44')];_0x142f76[_0xb964('0x45')]=_0x13d94d['predictiveIntervalDroppedCallsTimeout'];_0x142f76['predictiveIntervalErlangCalls']=_0x13d94d[_0xb964('0x46')];_0x142f76[_0xb964('0x47')]=_0x13d94d[_0xb964('0x47')];_0x142f76[_0xb964('0x48')]=_0x13d94d[_0xb964('0x48')];_0x142f76['predictiveIntervalMultiplicativeFactor']=_0x13d94d[_0xb964('0x49')];_0x142f76[_0xb964('0x4a')]=_0x13d94d[_0xb964('0x4a')];_0x142f76['predictiveIntervalAvailable']=_0x13d94d[_0xb964('0x4b')];_0x142f76[_0xb964('0x4c')]=_0x13d94d[_0xb964('0x4c')];_0x142f76[_0xb964('0x18')]=_0x13d94d[_0xb964('0x18')];_0x142f76['originated']=_0x13d94d[_0xb964('0x4d')];_0x142f76[_0xb964('0x4e')]=_0x13d94d['erlangCalls'];_0x142f76[_0xb964('0x4f')]=_0x13d94d[_0xb964('0x4f')];_0x142f76[_0xb964('0x50')]=_0x13d94d[_0xb964('0x50')];_0x142f76['erlangBusyFactor']=_0x13d94d['erlangBusyFactor'];_0x142f76[_0xb964('0x51')]=_0x13d94d[_0xb964('0x51')];_0x142f76[_0xb964('0x52')]=_0x13d94d[_0xb964('0x52')];}if(_0x13d94d[_0xb964('0x53')]){_0x142f76[_0xb964('0x53')]={'id':_0x13d94d[_0xb964('0x53')]['id'],'name':_0x13d94d[_0xb964('0x53')]['name'],'active':_0x13d94d[_0xb964('0x53')]['active'],'callerid':_0x13d94d[_0xb964('0x53')][_0xb964('0x54')]};}if(_0x13d94d[_0xb964('0x55')]){_0x142f76['Interval']={'id':_0x13d94d[_0xb964('0x55')]['id'],'name':_0x13d94d[_0xb964('0x55')][_0xb964('0x7')]};}_0x1d9dcd[_0xb964('0x56')](_0x142f76);}}_0x51257e({'count':_0x1d9dcd[_0xb964('0x57')],'rows':_0x1d9dcd});});},'UpdateVoiceQueue':function(_0x3d6df5){return new Promise(function(_0x43c3b0,_0x30bbe9){var _0x1b1709=_['find'](_0x4760b2['voiceQueues'],{'id':parseInt(_0x3d6df5['id'])});var _0x4cbdca=_[_0xb964('0x58')](_0x3d6df5,['id']);if(_0x1b1709){for(var _0xe4e024 in _0x4cbdca){if(typeof _0x4cbdca[_0xe4e024]!=='undefined'&&typeof _0x1b1709[_0xe4e024]!==_0xb964('0x59')){_0x1b1709[_0xe4e024]=_0x4cbdca[_0xe4e024];}}_0x43c3b0(_0x1b1709);}else{_0x30bbe9();}});},'VoiceChannels':function(_0x2b9ec9){return new Promise(function(_0x516228,_0x58f7d1){var _0x343942=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x5b')]);_0x516228({'count':_0x343942[_0xb964('0x57')],'rows':_0x343942});});},'VoiceChannelMixMonitor':function(_0x4f1129){var _0x3bacfc=this;return new Promise(function(_0x52fbe7,_0x2cbbed){if(ami[_0xb964('0xe')]()==![]){return _0x2cbbed(_0x3bacfc[_0xb964('0xf')](0x1f4,[config[_0xb964('0x10')]['ip'],config[_0xb964('0x10')][_0xb964('0x11')],_0xb964('0x1a')][_0xb964('0x12')]('\x20')));}var _0x591a20=schema(properties[_0xb964('0x5c')])[_0xb964('0x2')](_0x4f1129);if(_0x591a20[_0xb964('0x57')]>0x0){return _0x2cbbed(_0x3bacfc[_0xb964('0xf')](0x1f4,_['map'](_0x591a20,_0xb964('0x18'))[_0xb964('0x12')](',\x20')));}var _0x1759bc=_[_0xb964('0x5d')](_0x4760b2[_0xb964('0x5b')],{'uniqueid':_0x4f1129[_0xb964('0x5e')]});if(_0x1759bc&&_0x1759bc[_0xb964('0x5f')]){var _0x27e73b=util[_0xb964('0x60')](_0xb964('0x61'),_0x4f1129[_0xb964('0x62')]||_0x4f1129[_0xb964('0x5e')],_0x4f1129[_0xb964('0x60')]||_0xb964('0x63'));return ami[_0xb964('0x16')]({'action':'MixMonitor','channel':_0x1759bc[_0xb964('0x5f')],'file':_0x27e73b,'options':'ai(mixmonitorid)'})[_0xb964('0x17')](function(_0x42b5ed){var _0x2344cb=_[_0xb964('0x5d')](_0x1759bc['monitors'],{'filename':_0xb964('0x64')+_0x27e73b[_0xb964('0x65')]()});if(_[_0xb964('0x66')](_0x2344cb)){_0x1759bc[_0xb964('0x67')][_0xb964('0x56')]({'filename':'/var/spool/asterisk/monitor/'+_0x27e73b['toLowerCase'](),'createdAt':moment()[_0xb964('0x60')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x42b5ed[_0xb964('0x68')],'status':_0xb964('0x69')});}else{_0x2344cb['mixmonitorid']=_0x42b5ed[_0xb964('0x68')];_0x2344cb[_0xb964('0x6a')]='rec';}_0x52fbe7({'code':0xc8,'message':[_0x4f1129[_0xb964('0x5e')],_0xb964('0x6b'),_0x42b5ed['mixmonitorid']][_0xb964('0x12')]('\x20'),'mixmonitorid':_0x42b5ed['mixmonitorid']});})[_0xb964('0x19')](function(_0x214430){_0x2cbbed(_0x3bacfc[_0xb964('0xf')](0x1f5,[_0x4f1129[_0xb964('0x5e')],_0x214430[_0xb964('0x18')][_0xb964('0x65')]()][_0xb964('0x12')]('\x20')));});}else{return _0x2cbbed(_0x3bacfc['error'](0x1f5,_0xb964('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x56276c){var _0x3f3b42=this;return new Promise(function(_0x584934,_0x21c239){if(ami[_0xb964('0xe')]()==![]){return _0x21c239(_0x3f3b42[_0xb964('0xf')](0x1f4,[config[_0xb964('0x10')]['ip'],config[_0xb964('0x10')][_0xb964('0x11')],'ami\x20disconnected'][_0xb964('0x12')]('\x20')));}var _0xd527bb=schema(properties['voicechannel'])[_0xb964('0x2')](_0x56276c);if(_0xd527bb[_0xb964('0x57')]>0x0){return _0x21c239(_0x3f3b42['error'](0x1f4,_[_0xb964('0x6d')](_0xd527bb,_0xb964('0x18'))[_0xb964('0x12')](',\x20')));}var _0x5f0877=_[_0xb964('0x5d')](_0x4760b2[_0xb964('0x5b')],{'uniqueid':_0x56276c[_0xb964('0x5e')]});if(_0x5f0877){return BPromise[_0xb964('0x6e')]()[_0xb964('0x17')](function(){if(_0x5f0877[_0xb964('0x5f')]){return ami[_0xb964('0x16')]({'action':_0xb964('0x6f'),'channel':_0x5f0877[_0xb964('0x5f')],'mixmonitorid':_0x56276c['mixmonitorid']})[_0xb964('0x19')](function(_0x5214d8){});}})['then'](function(){if(_0x5f0877[_0xb964('0x70')]){return ami['Action']({'action':_0xb964('0x6f'),'channel':_0x5f0877[_0xb964('0x70')],'mixmonitorid':_0x56276c[_0xb964('0x68')]})['catch'](function(_0x157805){});}})[_0xb964('0x17')](function(_0x59b558){var _0xfbdc9=_[_0xb964('0x5d')](_0x5f0877[_0xb964('0x67')],{'mixmonitorid':_0x56276c['mixmonitorid']});if(_0xfbdc9){_0xfbdc9[_0xb964('0x6a')]='stop';}})[_0xb964('0x17')](function(){var _0x4c59ef=util[_0xb964('0x60')](_0xb964('0x61'),_0x56276c[_0xb964('0x62')]||_0x56276c[_0xb964('0x5e')],_0x56276c['format']||_0xb964('0x63'));var _0x55698f=_[_0xb964('0x5d')](_0x5f0877[_0xb964('0x67')],{'filename':_0xb964('0x64')+_0x4c59ef[_0xb964('0x65')]()});if(_0x55698f){_0x55698f['status']=_0xb964('0x71');}})[_0xb964('0x17')](function(){_0x584934({'code':0xc8,'message':[_0x56276c[_0xb964('0x5e')],_0xb964('0x72')][_0xb964('0x12')]('\x20')});})[_0xb964('0x19')](function(_0xcd064b){_0x21c239(_0x3f3b42[_0xb964('0xf')](0x1f5,[_0x56276c[_0xb964('0x5e')],_0xcd064b[_0xb964('0x18')]['toLowerCase']()][_0xb964('0x12')]('\x20')));});}else{return _0x21c239(_0x3f3b42[_0xb964('0xf')](0x1f5,_0xb964('0x6c')));}});},'VoiceQueuesChannels':function(_0x31589a){return new Promise(function(_0x289901,_0x4580a2){var _0x3e837e=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x73')]);_0x289901({'count':_0x3e837e[_0xb964('0x57')],'rows':_0x3e837e});});},'VoiceQueuesChannel':function(_0x14ae72){var _0x4c754e=this;return new Promise(function(_0x5e9151,_0x1aada6){var _0x444121=schema(properties[_0xb964('0x74')])['validate'](_0x14ae72);if(_0x444121[_0xb964('0x57')]>0x0){return _0x1aada6(_0x4c754e['error'](0x1f4,_[_0xb964('0x6d')](_0x444121,'message')[_0xb964('0x12')](',\x20')));}var _0x206fc8=_[_0xb964('0x5d')](_0x4760b2[_0xb964('0x73')],{'uniqueid':_0x14ae72[_0xb964('0x5e')]});if(_0x206fc8){_0x5e9151(_0x206fc8);}else{return _0x1aada6(_0x4c754e['error'](0x1f5,_0xb964('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x4a2ebf){var _0x4e8dae=this;return new Promise(function(_0x2803dc,_0x5a9d2b){if(ami[_0xb964('0xe')]()==![]){return _0x5a9d2b(_0x4e8dae['error'](0x1f4,[config[_0xb964('0x10')]['ip'],config[_0xb964('0x10')][_0xb964('0x11')],_0xb964('0x1a')]['join']('\x20')));}var _0x3d95e9=schema(properties[_0xb964('0x75')])[_0xb964('0x2')](_0x4a2ebf);if(_0x3d95e9[_0xb964('0x57')]>0x0){return _0x5a9d2b(_0x4e8dae['error'](0x1f4,_[_0xb964('0x6d')](_0x3d95e9,_0xb964('0x18'))['join'](',\x20')));}var _0x2f7d9e=_[_0xb964('0x5d')](_0x4760b2['queueChannels'],{'uniqueid':_0x4a2ebf['uniqueid']});if(_0x2f7d9e&&_0x2f7d9e[_0xb964('0x5f')]){return ami[_0xb964('0x16')]({'action':'Hangup','channel':_0x2f7d9e[_0xb964('0x5f')]})[_0xb964('0x17')](function(_0x26ce8f){_0x2803dc({'code':0xc8,'message':[_0x4a2ebf[_0xb964('0x5e')],_0x26ce8f['message'][_0xb964('0x65')]()][_0xb964('0x12')]('\x20')});})[_0xb964('0x19')](function(_0x45b6d8){_0x5a9d2b(_0x4e8dae[_0xb964('0xf')](0x1f5,[_0x4a2ebf['uniqueid'],_0x45b6d8['message'][_0xb964('0x65')]()][_0xb964('0x12')]('\x20')));});}else{return _0x5a9d2b(_0x4e8dae[_0xb964('0xf')](0x1f5,_0xb964('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x1c8e7b){var _0x3d3584=this;return new Promise(function(_0x55ef89,_0x2d88e2){if(ami[_0xb964('0xe')]()==![]){return _0x2d88e2(_0x3d3584[_0xb964('0xf')](0x1f4,[config[_0xb964('0x10')]['ip'],config['asterisk']['username'],_0xb964('0x1a')][_0xb964('0x12')]('\x20')));}var _0x12266b=schema(properties[_0xb964('0x76')])[_0xb964('0x2')](_0x1c8e7b);if(_0x12266b['length']>0x0){return _0x2d88e2(_0x3d3584[_0xb964('0xf')](0x1f4,_[_0xb964('0x6d')](_0x12266b,_0xb964('0x18'))[_0xb964('0x12')](',\x20')));}var _0x377539=_[_0xb964('0x5d')](_0x4760b2[_0xb964('0x73')],{'uniqueid':_0x1c8e7b[_0xb964('0x5e')]});if(_0x377539&&_0x377539[_0xb964('0x5f')]){return ami['Action']({'action':_0xb964('0x77'),'channel':_0x377539[_0xb964('0x5f')],'exten':_0x1c8e7b['exten'],'context':_0x1c8e7b['context']||_0x377539[_0xb964('0x78')],'priority':0x1})[_0xb964('0x17')](function(_0x4348f7){_0x55ef89({'code':0xc8,'message':[_0x1c8e7b[_0xb964('0x5e')],_0x4348f7[_0xb964('0x18')][_0xb964('0x65')]()]['join']('\x20')});})['catch'](function(_0x37a420){_0x2d88e2(_0x3d3584[_0xb964('0xf')](0x1f5,[_0x1c8e7b['uniqueid'],_0x37a420[_0xb964('0x18')][_0xb964('0x65')]()]['join']('\x20')));});}else{return _0x2d88e2(_0x3d3584[_0xb964('0xf')](0x1f5,_0xb964('0x6c')));}});},'Agents':function(_0x36c47d){return new Promise(function(_0x3298ad,_0x1868a5){var _0x228b25=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0xb')]);_0x3298ad({'count':_0x228b25[_0xb964('0x57')],'rows':_0x228b25});});},'Telephones':function(_0x367eb8){return new Promise(function(_0x49707f,_0x541323){var _0x20c4f9=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x79')]);_0x49707f({'count':_0x20c4f9['length'],'rows':_0x20c4f9});});},'Trunks':function(_0x4a76f7){return new Promise(function(_0x4d1b94,_0x1e0889){var _0x2ba9e5=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x7a')]);_0x4d1b94({'count':_0x2ba9e5[_0xb964('0x57')],'rows':_0x2ba9e5});});},'OutboundChannels':function(_0x3bc89e){return new Promise(function(_0x4a46e0,_0x2c636c){var _0x4dbe07=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x7b')]);_0x4a46e0({'count':_0x4dbe07['length'],'rows':_0x4dbe07});});},'Outbound':function(_0xa63621){return new Promise(function(_0x466f12,_0x3ace12){_0x466f12(_0x4760b2[_0xb964('0x2d')]);});},'Campaigns':function(_0x28ab60){return new Promise(function(_0x53c7d0,_0x1dada2){var _0x15f7a8=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x7c')]);_0x53c7d0({'count':_0x15f7a8[_0xb964('0x57')],'rows':_0x15f7a8});});},'VoiceQueuesPreview':function(_0x1e336a){var _0x407ff7=this;return new Promise(function(_0x5f2b05,_0x12d7c0){_0x249313[_0xb964('0x7d')](_0x1e336a['id'])[_0xb964('0x17')](function(_0x26a401){_0x5f2b05({'code':0xc8,'message':_0x26a401[_0xb964('0x18')]});})[_0xb964('0x19')](function(_0x307b35){_0x12d7c0(_0x407ff7[_0xb964('0xf')](0x1f4,_0x307b35['message']));});});},'EventManager':function(_0x5419d3){var _0xeed18c=this;return new Promise(function(_0x1ea23a,_0x5b3c1d){if(!_0x5419d3['event']){return _0x5b3c1d(_0xeed18c[_0xb964('0xf')](0x1f4,_0xb964('0x7e')));}ami[_0xb964('0x7f')](_0xb964('0x80')+_0x5419d3[_0xb964('0x81')],_0x5419d3[_0xb964('0x18')]);_0x1ea23a({'code':0xc8,'message':_0x5419d3});});},'FaxAccounts':function(_0x208c09){return new Promise(function(_0x13816f,_0x34007a){var _0x4ab081=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x82')]);_0x13816f({'count':_0x4ab081[_0xb964('0x57')],'rows':_0x4ab081});});},'SendFax':function(_0x360036){var _0x2e7ad8=this;return new Promise(function(_0x20026a,_0x501ba9){_0xba9f19[_0xb964('0x83')](_0x360036)[_0xb964('0x17')](function(_0x403c84){_0x20026a({'code':0xc8,'message':_0x403c84[_0xb964('0x18')]});})['catch'](function(_0x9b630a){_0x501ba9(_0x2e7ad8[_0xb964('0xf')](0x1f4,_0x9b630a[_0xb964('0x18')]));});});},'CheckAfterSend':function(_0x534578){var _0xfcfaba=this;return new Promise(function(_0x2321f4,_0x4bc8ed){_0xba9f19['checkAfterSend'](_0x534578)[_0xb964('0x17')](function(_0x221010){_0x2321f4({'code':0xc8,'message':_0x221010[_0xb964('0x18')]});})[_0xb964('0x19')](function(_0x354c3){_0x4bc8ed(_0xfcfaba['error'](0x1f4,_0x354c3['message']));});});}};var _0x22bbb1=jayson['server'](_0xde47d5)[_0xb964('0x84')]();_0x22bbb1['on'](_0xb964('0xf'),function(_0x2ec697){return _0x204c7d(_0x2ec697);});_0x22bbb1['listen'](0x232a,'127.0.0.1',function(){console[_0xb964('0x85')](_0xb964('0x86'),0x232a);return _0x11a0c1(_0xb964('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 ac36fae..239253d 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 _0x355c=['','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','merge','bluebird','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','exec','data1','data2','xmd-contactid','ListId','data3','split','$or','map','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridname','Unknown','destcalleridname'];(function(_0x13d5a5,_0x41b1a4){var _0x1b4122=function(_0x3cd411){while(--_0x3cd411){_0x13d5a5['push'](_0x13d5a5['shift']());}};_0x1b4122(++_0x41b1a4);}(_0x355c,0x122));var _0xc355=function(_0x266945,_0x5c5e8c){_0x266945=_0x266945-0x0;var _0x4477d5=_0x355c[_0x266945];return _0x4477d5;};'use strict';var _=require('lodash');var BPromise=require(_0xc355('0x0'));var Redis=require(_0xc355('0x1'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0xc355('0x2'))(_0xc355('0x3'));var cmContactRpc=require(_0xc355('0x4'));config[_0xc355('0x5')]=_['defaults'](config[_0xc355('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc355('0x6'))(new Redis(config[_0xc355('0x5')]));function emit(_0x59e024,_0x57f2bb,_0x5f1046,_0x476653,_0x2c5d41){logger[_0xc355('0x7')](_0xc355('0x8'),_0x59e024,_0x57f2bb['id'],_0x5f1046,_0x476653,JSON['stringify'](_0x2c5d41));io['to'](_0x5f1046)['emit'](_0x476653,_0x2c5d41);}exports[_0xc355('0x9')]=function(_0x4a3361,_0x99093c,_0x3fcfc8,_0x52df6d){var _0x3a71f6,_0x3a14a3;var _0x32b2a8={};var _0x199889=Number(_0x3fcfc8[_0xc355('0xa')]);var _0x33ebdf=_0x3fcfc8[_0xc355('0xb')]?Boolean(Number(_0x3fcfc8[_0xc355('0xb')])):![];var _0x1360f9;if(_0x52df6d[_0xc355('0xc')]){_0x32b2a8['id']=_0x52df6d['xmd-contactid'];}if(!_0x32b2a8['id']){_0x32b2a8[_0xc355('0xd')]=_0x199889;_0x1360f9=_0x3fcfc8[_0xc355('0xe')]&&_0x3fcfc8[_0xc355('0xe')]!=='0'?_0x3fcfc8[_0xc355('0xe')][_0xc355('0xf')](','):['phone'];_0x32b2a8[_0xc355('0x10')]=_[_0xc355('0x11')](_0x1360f9,function(_0x3a5725){var _0x26a9d5={};_0x26a9d5[_0x3a5725]=_0x52df6d['routeId']?_0x52df6d[_0xc355('0x12')]:_0x52df6d[_0xc355('0x13')];return _0x26a9d5;});}var _0x1d782d=['id',_0xc355('0x14'),_0xc355('0x15'),_0xc355('0x16'),_0xc355('0x17'),_0xc355('0x18'),_0xc355('0xd'),_0xc355('0x19'),_0xc355('0x1a'),_0xc355('0x1b')];var _0x18186e=_[_0xc355('0x1c')](_0x1d782d,_0x1360f9);BPromise[_0xc355('0x1d')]()[_0xc355('0x1e')](cmContactRpc[_0xc355('0x1f')]({'attributes':_0x18186e,'where':_0x32b2a8}))['then'](function(_0x47d11e){_0x3a14a3=_0x47d11e;if(!_[_0xc355('0x20')](_0x3a14a3)){if(_0x3a14a3[_0xc355('0x21')]===0x1){_0x3a71f6=_0x3a14a3[0x0];logger[_0xc355('0x7')](_0xc355('0x22'),_0x52df6d['uniqueid'],_0x99093c['id'],_0x3a71f6['id']);}else{logger[_0xc355('0x7')](_0xc355('0x23'),_0x52df6d[_0xc355('0x24')],_0x99093c['id'],_['map'](_0x3a14a3,'id')[_0xc355('0x25')](','));}return;}else{logger[_0xc355('0x7')](_0xc355('0x26'),_0x52df6d[_0xc355('0x24')],_0x99093c['id']);var _0x4fcc7d={'ListId':_0x199889};var _0x219e5b=_0x3fcfc8[_0xc355('0x27')]&&_0x3fcfc8['data4']!=='0'?_0x3fcfc8[_0xc355('0x27')]:_0xc355('0x16');if(_0x33ebdf){logger[_0xc355('0x7')](_0xc355('0x28'),_0x52df6d[_0xc355('0x24')],_0x99093c['id']);_0x4fcc7d[_0x219e5b]=_[_0xc355('0x29')](_0x52df6d[_0xc355('0x2a')])?_0x52df6d[_0xc355('0x13')]:_0x52df6d['destcalleridnum'];if(_[_0xc355('0x29')](_0x52df6d[_0xc355('0x2a')])){_0x4fcc7d[_0xc355('0x14')]=_0x52df6d[_0xc355('0x2b')]&&_0x52df6d['calleridname']!==''?_0x52df6d['calleridname']:_0xc355('0x2c');}else{_0x4fcc7d[_0xc355('0x14')]=_0x52df6d[_0xc355('0x2d')]&&_0x52df6d[_0xc355('0x2d')]!==_0xc355('0x2e')?_0x52df6d[_0xc355('0x2d')]:_0xc355('0x2c');}return BPromise[_0xc355('0x1d')]()[_0xc355('0x1e')](cmContactRpc[_0xc355('0x2f')](_0x4fcc7d))['then'](function(_0x4a1e4c){_0x3a71f6=_0x4a1e4c;_0x3a14a3[_0xc355('0x30')](_0x4a1e4c);if(_0x3a71f6){logger[_0xc355('0x7')](_0xc355('0x31'),_0x52df6d[_0xc355('0x24')],_0x99093c['id'],_0x3a71f6['id']);}return;});}else{logger[_0xc355('0x7')](_0xc355('0x32'),_0x52df6d[_0xc355('0x24')],_0x99093c['id']);_0x4fcc7d[_0x219e5b]=_[_0xc355('0x29')](_0x52df6d[_0xc355('0x2a')])?_0x52df6d[_0xc355('0x13')]:_0x52df6d[_0xc355('0x12')];if(_[_0xc355('0x29')](_0x52df6d[_0xc355('0x2a')])){_0x4fcc7d[_0xc355('0x14')]=_0x52df6d[_0xc355('0x2b')]&&_0x52df6d[_0xc355('0x2b')]!==_0xc355('0x2e')?_0x52df6d[_0xc355('0x2b')]:_0xc355('0x2c');}else{_0x4fcc7d[_0xc355('0x14')]=_0x52df6d['destcalleridname']&&_0x52df6d['destcalleridname']!==_0xc355('0x2e')?_0x52df6d[_0xc355('0x2d')]:_0xc355('0x2c');}_0x3a71f6=_0x4fcc7d;_0x3a14a3[_0xc355('0x30')](_0x4fcc7d);return;}}})[_0xc355('0x1e')](function(){if(_0x4a3361){emit(_0x52df6d[_0xc355('0x24')],_0x99093c,util[_0xc355('0x33')]('user:%s',_0x4a3361[_0xc355('0x34')]),util['format'](_0xc355('0x35'),_0x3fcfc8[_0xc355('0x36')]['toLowerCase']()),{'evt':_[_0xc355('0x37')](_0x52df6d,{'autoCreate':_0x33ebdf}),'contact':_0x3a71f6===undefined?{}:_0x3a71f6,'contacts':_0x3a14a3[_0xc355('0x21')]===0x0?undefined:_0x3a14a3});}});}; \ No newline at end of file +var _0x6e6c=['defaults','localhost','info','[CM][%s][%s]','stringify','emit','data1','data2','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','fax','createdAt','scheduledAt','updatedAt','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','destcalleridname','','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','push','format','user:%s','action','merge','lodash','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact'];(function(_0x39a2d6,_0x477459){var _0x23af66=function(_0x2eb95e){while(--_0x2eb95e){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x23af66(++_0x477459);}(_0x6e6c,0xce));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc6e6('0x0'));var BPromise=require('bluebird');var Redis=require(_0xc6e6('0x1'));var util=require(_0xc6e6('0x2'));var config=require('../../../../config/environment');var logger=require(_0xc6e6('0x3'))(_0xc6e6('0x4'));var cmContactRpc=require(_0xc6e6('0x5'));config['redis']=_[_0xc6e6('0x6')](config['redis'],{'host':_0xc6e6('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xdc1dce,_0x5866e7,_0x3dc6cf,_0x13d36d,_0x3d7658){logger[_0xc6e6('0x8')](_0xc6e6('0x9'),_0xdc1dce,_0x5866e7['id'],_0x3dc6cf,_0x13d36d,JSON[_0xc6e6('0xa')](_0x3d7658));io['to'](_0x3dc6cf)[_0xc6e6('0xb')](_0x13d36d,_0x3d7658);}exports['exec']=function(_0x455dd6,_0x44278d,_0x3b1185,_0x5e6223){var _0x5626cc,_0x5b90e9;var _0x159174={};var _0x4a2dc5=Number(_0x3b1185[_0xc6e6('0xc')]);var _0x5896b1=_0x3b1185[_0xc6e6('0xd')]?Boolean(Number(_0x3b1185[_0xc6e6('0xd')])):![];var _0x42ef63;if(_0x5e6223[_0xc6e6('0xe')]){_0x159174['id']=_0x5e6223['xmd-contactid'];}if(!_0x159174['id']){_0x159174[_0xc6e6('0xf')]=_0x4a2dc5;_0x42ef63=_0x3b1185[_0xc6e6('0x10')]&&_0x3b1185[_0xc6e6('0x10')]!=='0'?_0x3b1185[_0xc6e6('0x10')][_0xc6e6('0x11')](','):[_0xc6e6('0x12')];_0x159174[_0xc6e6('0x13')]=_[_0xc6e6('0x14')](_0x42ef63,function(_0x6137ce){var _0x5e79d7={};_0x5e79d7[_0x6137ce]=_0x5e6223[_0xc6e6('0x15')]?_0x5e6223[_0xc6e6('0x16')]:_0x5e6223[_0xc6e6('0x17')];return _0x5e79d7;});}var _0x2d78bc=['id',_0xc6e6('0x18'),_0xc6e6('0x19'),_0xc6e6('0x12'),'mobile',_0xc6e6('0x1a'),_0xc6e6('0xf'),_0xc6e6('0x1b'),_0xc6e6('0x1c'),_0xc6e6('0x1d')];var _0x3a7005=_['union'](_0x2d78bc,_0x42ef63);BPromise[_0xc6e6('0x1e')]()[_0xc6e6('0x1f')](cmContactRpc['getContacts']({'attributes':_0x3a7005,'where':_0x159174}))[_0xc6e6('0x1f')](function(_0x344ac5){_0x5b90e9=_0x344ac5;if(!_[_0xc6e6('0x20')](_0x5b90e9)){if(_0x5b90e9[_0xc6e6('0x21')]===0x1){_0x5626cc=_0x5b90e9[0x0];logger['info'](_0xc6e6('0x22'),_0x5e6223[_0xc6e6('0x23')],_0x44278d['id'],_0x5626cc['id']);}else{logger[_0xc6e6('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x5e6223['uniqueid'],_0x44278d['id'],_[_0xc6e6('0x14')](_0x5b90e9,'id')[_0xc6e6('0x24')](','));}return;}else{logger[_0xc6e6('0x8')](_0xc6e6('0x25'),_0x5e6223[_0xc6e6('0x23')],_0x44278d['id']);var _0x104837={'ListId':_0x4a2dc5};var _0x152cdf=_0x3b1185[_0xc6e6('0x26')]&&_0x3b1185['data4']!=='0'?_0x3b1185['data4']:'phone';if(_0x5896b1){logger[_0xc6e6('0x8')](_0xc6e6('0x27'),_0x5e6223['uniqueid'],_0x44278d['id']);_0x104837[_0x152cdf]=_[_0xc6e6('0x28')](_0x5e6223[_0xc6e6('0x15')])?_0x5e6223['calleridnum']:_0x5e6223[_0xc6e6('0x16')];if(_[_0xc6e6('0x28')](_0x5e6223[_0xc6e6('0x15')])){_0x104837[_0xc6e6('0x18')]=_0x5e6223[_0xc6e6('0x29')]&&_0x5e6223[_0xc6e6('0x29')]!==''?_0x5e6223[_0xc6e6('0x29')]:'Unknown';}else{_0x104837[_0xc6e6('0x18')]=_0x5e6223[_0xc6e6('0x2a')]&&_0x5e6223['destcalleridname']!==_0xc6e6('0x2b')?_0x5e6223['destcalleridname']:'Unknown';}return BPromise[_0xc6e6('0x1e')]()[_0xc6e6('0x1f')](cmContactRpc[_0xc6e6('0x2c')](_0x104837))[_0xc6e6('0x1f')](function(_0x2e411a){_0x5626cc=_0x2e411a;_0x5b90e9['push'](_0x2e411a);if(_0x5626cc){logger['info'](_0xc6e6('0x2d'),_0x5e6223[_0xc6e6('0x23')],_0x44278d['id'],_0x5626cc['id']);}return;});}else{logger[_0xc6e6('0x8')](_0xc6e6('0x2e'),_0x5e6223['uniqueid'],_0x44278d['id']);_0x104837[_0x152cdf]=_[_0xc6e6('0x28')](_0x5e6223['routeId'])?_0x5e6223[_0xc6e6('0x17')]:_0x5e6223[_0xc6e6('0x16')];if(_[_0xc6e6('0x28')](_0x5e6223['routeId'])){_0x104837['firstName']=_0x5e6223[_0xc6e6('0x29')]&&_0x5e6223[_0xc6e6('0x29')]!==_0xc6e6('0x2b')?_0x5e6223[_0xc6e6('0x29')]:'Unknown';}else{_0x104837['firstName']=_0x5e6223[_0xc6e6('0x2a')]&&_0x5e6223[_0xc6e6('0x2a')]!==_0xc6e6('0x2b')?_0x5e6223[_0xc6e6('0x2a')]:_0xc6e6('0x2f');}_0x5626cc=_0x104837;_0x5b90e9[_0xc6e6('0x30')](_0x104837);return;}}})[_0xc6e6('0x1f')](function(){if(_0x455dd6){emit(_0x5e6223['uniqueid'],_0x44278d,util[_0xc6e6('0x31')](_0xc6e6('0x32'),_0x455dd6['name']),util['format']('trigger:%s',_0x3b1185[_0xc6e6('0x33')]['toLowerCase']()),{'evt':_[_0xc6e6('0x34')](_0x5e6223,{'autoCreate':_0x5896b1}),'contact':_0x5626cc===undefined?{}:_0x5626cc,'contacts':_0x5b90e9[_0xc6e6('0x21')]===0x0?undefined:_0x5b90e9});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 6a0a43b..7438b4a 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 _0xc736=['custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','prototype','info','stringify','emit','clone','interface','checkTriggers','hasOwnProperty','status','merge','variables','Actions','length','action','contactmanager','motionbar','data1','TemplateId','data2','render','html','template\x20not\x20found','uri','data3','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','winapp','winArguments','format','trigger:%s:%s','toLowerCase','jscripty','user:%s','name','trigger:%s','exec','integration','queue','routeId','urlforward','script','buildUri','parse','search','checkTrigger','AllConditions','every','checkConditions','channel','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','exports','lodash','url','mustache','ioredis','./urlforward','./cmContact','./script','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind'];(function(_0x339484,_0x170ec3){var _0x9ce0cc=function(_0xe944c8){while(--_0xe944c8){_0x339484['push'](_0x339484['shift']());}};_0x9ce0cc(++_0x170ec3);}(_0xc736,0xd4));var _0x6c73=function(_0x1bd90f,_0xd6debc){_0x1bd90f=_0x1bd90f-0x0;var _0x25d38b=_0xc736[_0x1bd90f];return _0x25d38b;};'use strict';var util=require('util');var _=require(_0x6c73('0x0'));var url=require(_0x6c73('0x1'));var Mustache=require(_0x6c73('0x2'));var Redis=require(_0x6c73('0x3'));var urlforward=require(_0x6c73('0x4'));var integration=require('./integration');var cmContact=require(_0x6c73('0x5'));var script=require(_0x6c73('0x6'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x6c73('0x7'));var ami=require(_0x6c73('0x8'));config[_0x6c73('0x9')]=_[_0x6c73('0xa')](config['redis'],{'host':_0x6c73('0xb'),'port':0x18eb});var io=require(_0x6c73('0xc'))(new Redis(config[_0x6c73('0x9')]));var operators={'equals':function(_0x532110,_0x3f9667){return _0x532110==_0x3f9667;},'not_equals':function(_0x23452a,_0x5f57a5){return _0x23452a!=_0x5f57a5;}};var barAndWebActions=[_0x6c73('0xd'),_0x6c73('0x1'),'winapp'];function Trigger(_0x1d0345){this[_0x6c73('0xe')]=_0x1d0345['triggers'];this[_0x6c73('0xf')]=_0x1d0345[_0x6c73('0xf')];this[_0x6c73('0x10')]=_0x1d0345['voiceQueues'];this['templates']=_0x1d0345[_0x6c73('0x11')];this[_0x6c73('0x12')]=_0x1d0345[_0x6c73('0x12')];this[_0x6c73('0x13')]=_0x1d0345['zendeskAccounts'];this[_0x6c73('0x14')]=_0x1d0345[_0x6c73('0x14')];this[_0x6c73('0x15')]=_0x1d0345[_0x6c73('0x15')];this[_0x6c73('0x16')]=_0x1d0345[_0x6c73('0x16')];this[_0x6c73('0x17')]=_0x1d0345[_0x6c73('0x17')];this[_0x6c73('0x18')]=_0x1d0345['deskAccounts'];this[_0x6c73('0x19')]=_0x1d0345['vtigerAccounts'];this[_0x6c73('0x1a')]=_0x1d0345[_0x6c73('0x1a')];this[_0x6c73('0x1b')]=_0x1d0345[_0x6c73('0x1b')];this['freshsalesAccounts']=_0x1d0345[_0x6c73('0x1c')];this[_0x6c73('0x1d')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x6c73('0x15')],'freshdesk':this[_0x6c73('0x14')],'sugarcrm':this[_0x6c73('0x16')],'zoho':this[_0x6c73('0x17')],'desk':this[_0x6c73('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x6c73('0x1b')],'freshsales':this[_0x6c73('0x1c')],'servicenow':this[_0x6c73('0x1a')]};ami['on']('custom:agentcalled',this[_0x6c73('0x1e')][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x20'),this[_0x6c73('0x1e')][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x21'),this[_0x6c73('0x1e')][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x22'),this['syncCustomEvent'][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x23'),this['syncCustomEvent'][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x24'),this[_0x6c73('0x1e')]['bind'](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x25'),this['syncCustomEvent'][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x26'),this[_0x6c73('0x1e')]['bind'](this));ami['on'](_0x6c73('0x27'),this['syncCustomEvent'][_0x6c73('0x1f')](this));ami['on']('custom:queuecallerabandon',this[_0x6c73('0x1e')][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x28'),this[_0x6c73('0x1e')]['bind'](this));ami['on'](_0x6c73('0x29'),this[_0x6c73('0x2a')][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x2b'),this[_0x6c73('0x2a')]['bind'](this));ami['on'](_0x6c73('0x2c'),this['syncAgentDial'][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x2d'),this[_0x6c73('0x1e')][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x2e'),this[_0x6c73('0x1e')][_0x6c73('0x1f')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x2f'),this[_0x6c73('0x1e')][_0x6c73('0x1f')](this));ami['on'](_0x6c73('0x30'),this[_0x6c73('0x1e')]['bind'](this));ami['on']('custom:rejectmessage',this[_0x6c73('0x1e')][_0x6c73('0x1f')](this));}Trigger[_0x6c73('0x31')]['emit']=function(_0x51f98a,_0x18d4e9,_0xe40d58){logger[_0x6c73('0x32')](_0x51f98a,_0x18d4e9,JSON[_0x6c73('0x33')](_0xe40d58));io['to'](_0x51f98a)[_0x6c73('0x34')](_0x18d4e9,_0xe40d58);};Trigger['prototype'][_0x6c73('0x1e')]=function(_0x216ea6){var _0x1b8833=_[_0x6c73('0x35')](_0x216ea6);this['checkTriggers'](_0x1b8833);};Trigger['prototype'][_0x6c73('0x2a')]=function(_0x392398){if(this['agents'][_0x392398[_0x6c73('0x36')]]){this[_0x6c73('0x1e')](_0x392398);}};Trigger[_0x6c73('0x31')][_0x6c73('0x37')]=function(_0x553c3c){var _0x533ffb;for(var _0x10cfb4 in this['triggers']){if(this['triggers'][_0x6c73('0x38')](_0x10cfb4)){if(this[_0x6c73('0xe')][_0x10cfb4][_0x6c73('0x39')]){_0x533ffb=this['checkTrigger'](this[_0x6c73('0xe')][_0x10cfb4],_0x553c3c);if(_0x533ffb){_[_0x6c73('0x3a')](_0x553c3c,_0x553c3c[_0x6c73('0x3b')]);for(var _0x3b686a=0x0,_0x301557,_0xa9c4e5,_0x10b00c;_0x3b686a0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ 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(_0x313bb0,_0x32d2be){var _0x5bef96=function(_0x4148d0){while(--_0x4148d0){_0x313bb0['push'](_0x313bb0['shift']());}};_0x5bef96(++_0x32d2be);}(_0x55ca,0x126));var _0xa55c=function(_0x8935ce,_0x3621c3){_0x8935ce=_0x8935ce-0x0;var _0x1a422f=_0x55ca[_0x8935ce];return _0x1a422f;};'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 3a7aa9f..2cc71c6 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 _0xbbb4=['toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','toLowerCase','outbound','contacts','/systemusers(','4.0','substring','enduserId','destcalleridnum','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','type','nameField','customField','idField','indexOf','ticketType','incident','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','POST','calleridnum','callDirection','queue','headers','odata-entityid','lastIndexOf','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','bluebird','request-promise','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','clientId','password','clientSecret','then','access_token','catch','error','message','GET','Bearer\x20','value','isNil','validateEmail','userEmail','email','length','isdisabled','info'];(function(_0x471268,_0x5ce885){var _0x1298f3=function(_0x3f5110){while(--_0x3f5110){_0x471268['push'](_0x471268['shift']());}};_0x1298f3(++_0x5ce885);}(_0xbbb4,0x162));var _0x4bbb=function(_0x4a6f37,_0x8cfe47){_0x4a6f37=_0x4a6f37-0x0;var _0x3a4087=_0xbbb4[_0x4a6f37];return _0x3a4087;};'use strict';var _=require(_0x4bbb('0x0'));var BPromise=require(_0x4bbb('0x1'));var rp=require(_0x4bbb('0x2'));var util=require('util');var intUtil=require('./util');var md5=require(_0x4bbb('0x3'));var Redis=require(_0x4bbb('0x4'));var logger=require(_0x4bbb('0x5'))(_0x4bbb('0x6'));var config=require(_0x4bbb('0x7'));config[_0x4bbb('0x8')]=_[_0x4bbb('0x9')](config['redis'],{'host':_0x4bbb('0xa'),'port':0x18eb});var io=require(_0x4bbb('0xb'))(new Redis(config[_0x4bbb('0x8')]));function getAuthToken(_0x1ab640,_0x1bd919,_0x4dee7e){var _0x5041e3={'method':'POST','uri':_0x1bd919,'form':{'client_id':_0x1ab640[_0x4bbb('0xc')],'resource':_0x1ab640['remoteUri'],'username':_0x1ab640['username'],'password':_0x1ab640[_0x4bbb('0xd')],'grant_type':_0x4bbb('0xd'),'client_secret':_0x1ab640[_0x4bbb('0xe')]},'json':!![]};return rp(_0x5041e3)[_0x4bbb('0xf')](function(_0x41d0c6){return _0x41d0c6[_0x4bbb('0x10')];})[_0x4bbb('0x11')](function(_0x5c37a2){logger[_0x4bbb('0x12')]('['+[_0x4dee7e['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x5c37a2[_0x4bbb('0x13')];});}function getUser(_0x2d27f3,_0x2548db,_0x234d58,_0x2624ca,_0x32aea9,_0x3b73a9){return new BPromise(function(_0x502c3a,_0x19ee92){return getAuthToken(_0x2548db,_0x2624ca,_0x3b73a9)[_0x4bbb('0xf')](function(_0xe48b6a){var _0x398e9d={'method':_0x4bbb('0x14'),'uri':_0x32aea9+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x4bbb('0x15')+_0xe48b6a,'OData-Version':'4.0'},'json':!![]};return rp(_0x398e9d);})['then'](function(_0x1952cc){var _0x2a1ce5=_0x1952cc[_0x4bbb('0x16')];var _0x23834c=![];var _0x1ea0ce=null;if(!_[_0x4bbb('0x17')](_0x234d58)){if(intUtil[_0x4bbb('0x18')](_0x234d58['email'])){_0x2d27f3[_0x4bbb('0x19')]=_0x234d58[_0x4bbb('0x1a')];for(_0x1ea0ce=0x0;_0x1ea0ce<_0x2a1ce5[_0x4bbb('0x1b')];_0x1ea0ce++){if(_0x2a1ce5[_0x1ea0ce]['internalemailaddress']===_0x234d58[_0x4bbb('0x1a')]&&!_0x2a1ce5[_0x1ea0ce][_0x4bbb('0x1c')]){_0x23834c=!![];logger[_0x4bbb('0x1d')]('['+[_0x3b73a9[_0x4bbb('0x1e')]()]+_0x4bbb('0x1f')+_0x2a1ce5[_0x1ea0ce][_0x4bbb('0x20')]+'!');_0x2d27f3[_0x4bbb('0x21')]=_0x2a1ce5[_0x1ea0ce]['systemuserid'];}}}}if(!_0x23834c){logger['info']('['+[_0x3b73a9['toUpperCase']()]+_0x4bbb('0x22'));_0x2d27f3[_0x4bbb('0x19')]=_0x2548db[_0x4bbb('0x23')];for(_0x1ea0ce=0x0;_0x1ea0ce<_0x2a1ce5['length'];_0x1ea0ce++){if(_0x2a1ce5[_0x1ea0ce]['internalemailaddress']===_0x2548db[_0x4bbb('0x23')]){_0x2d27f3[_0x4bbb('0x21')]=_0x2a1ce5[_0x1ea0ce][_0x4bbb('0x20')];}}}_0x502c3a(_0x2d27f3);})[_0x4bbb('0x11')](function(_0x1267a4){_0x19ee92(_0x1267a4[_0x4bbb('0x13')]);});});}function createEndUser(_0xa2fe2f,_0x1c1809,_0x979c86,_0x1d06a0,_0x1b8550,_0x5a6e01){return new BPromise(function(_0x14c7b8,_0x2ccbfa){return getAuthToken(_0x1c1809,_0x979c86,_0x5a6e01)[_0x4bbb('0xf')](function(_0x4444c1){var _0x55016f=_0x5a6e01[_0x4bbb('0x24')]()===_0x4bbb('0x25')?_0x1b8550['destcalleridnum']:_0x1b8550['calleridnum'];var _0x50b31e={'method':'POST','uri':_0x1d06a0+_0x4bbb('0x26'),'body':{'telephone1':_0x55016f,'fullname':_0x55016f,'firstname':_0x55016f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x4bbb('0x27')+_0xa2fe2f[_0x4bbb('0x21')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4444c1,'OData-Version':_0x4bbb('0x28')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x50b31e);})[_0x4bbb('0xf')](function(_0x1755a6){var _0x325bf4=_0x1755a6['headers']['odata-entityid'];var _0x1e811e=_0x325bf4[_0x4bbb('0x29')](_0x325bf4['lastIndexOf']('(')+0x1,_0x325bf4['lastIndexOf'](')'));_0xa2fe2f[_0x4bbb('0x2a')]=_0x1e811e;_0x14c7b8(_0xa2fe2f);})[_0x4bbb('0x11')](function(_0xd7f5b1){_0x2ccbfa(_0xd7f5b1['message']);});});}function getEndUser(_0x58702f,_0x3c9c31,_0xb0fe09,_0x36a2dc,_0x42c785,_0x517870){return new BPromise(function(_0x46ad18,_0x40d23a){var _0x32c209=_0x517870[_0x4bbb('0x24')]()===_0x4bbb('0x25')?_0x42c785[_0x4bbb('0x2b')]:_0x42c785['calleridnum'];return getAuthToken(_0x3c9c31,_0xb0fe09,_0x517870)[_0x4bbb('0xf')](function(_0x1e9ce2){var _0x138693={'method':'GET','uri':_0x36a2dc+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x32c209['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x4bbb('0x15')+_0x1e9ce2,'If-None-Match':null,'OData-Version':_0x4bbb('0x28')},'json':!![]};return rp(_0x138693);})[_0x4bbb('0xf')](function(_0x146d0a){var _0x4c93b3=null;if(_0x146d0a){var _0x293d3d=_0x146d0a[_0x4bbb('0x16')];var _0x144301=![];for(_0x4c93b3=0x0;_0x4c93b3<_0x293d3d[_0x4bbb('0x1b')];_0x4c93b3++){if(_0x293d3d[_0x4c93b3]['telephone1']===_0x32c209){_0x144301=!![];_0x58702f['enduserId']=_0x293d3d[_0x4c93b3][_0x4bbb('0x2c')];}}if(_0x144301){_0x46ad18(_0x58702f);}else{return createEndUser(_0x58702f,_0x3c9c31,_0xb0fe09,_0x36a2dc,_0x42c785,_0x517870)[_0x4bbb('0xf')](function(_0x3131ed){logger['info']('['+[_0x517870['toUpperCase']()]+_0x4bbb('0x2d'),_0x3131ed[_0x4bbb('0x2a')]);_0x46ad18(_0x3131ed);});}}else{return createEndUser(_0x58702f,_0x3c9c31,_0xb0fe09,_0x36a2dc,_0x42c785,_0x517870)['then'](function(_0x4b4d82){logger[_0x4bbb('0x1d')]('['+[_0x517870[_0x4bbb('0x1e')]()]+_0x4bbb('0x2e'),_0x4b4d82[_0x4bbb('0x2a')]);_0x46ad18(_0x4b4d82);});}});});}function getCustomFields(_0x59dbae,_0x3e6f74,_0x2400d2){var _0x1200df={};if(_0x59dbae[_0x4bbb('0x1b')]>0x0){_[_0x4bbb('0x2f')](_0x59dbae,function(_0x1e04a5){if(_[_0x4bbb('0x30')](['string','picklist'],_0x1e04a5[_0x4bbb('0x31')])&&_0x1e04a5[_0x4bbb('0x32')]&&!_0x1e04a5[_0x4bbb('0x33')]){var _0x45283b=_0x1e04a5[_0x4bbb('0x34')][_0x4bbb('0x24')]();var _0x4bea46=_0x45283b['substring'](0x0,_0x45283b[_0x4bbb('0x35')]('_'));var _0x3025cc=_0x45283b[_0x4bbb('0x29')](_0x45283b[_0x4bbb('0x35')]('_')+0x1);if(_0x4bea46===_0x2400d2){_0x1200df[_0x3025cc]=_0x1e04a5['content'];}}});}return _0x1200df;}function getTicket(_0x5a34ec,_0x2f4000,_0x27665b,_0x52476c,_0x5e6394,_0x24addd,_0x22c6b2){return new BPromise(function(_0x2bd146,_0x4f8bda){var _0x45ae7d;return getAuthToken(_0x2f4000,_0x27665b,_0x22c6b2)[_0x4bbb('0xf')](function(_0xe9d062){if(_0x24addd[_0x4bbb('0x36')]===_0x4bbb('0x37')){_0x45ae7d={'method':'POST','uri':_0x52476c+'incidents','body':Object[_0x4bbb('0x38')]({},{'title':intUtil[_0x4bbb('0x39')](_0x24addd[_0x4bbb('0x3a')],_0x5e6394,'\x20'),'description':intUtil['getString'](_0x24addd[_0x4bbb('0x3b')],_0x5e6394,'\x0a'),'customerid_contact@odata.bind':_0x4bbb('0x3c')+_0x5a34ec['enduserId']+')','ownerid@odata.bind':_0x4bbb('0x27')+_0x5a34ec[_0x4bbb('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x24addd[_0x4bbb('0x3d')],_0x5e6394,_0x24addd[_0x4bbb('0x36')])),'headers':{'Authorization':_0x4bbb('0x15')+_0xe9d062,'OData-Version':_0x4bbb('0x28')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x24addd[_0x4bbb('0x36')]===_0x4bbb('0x3e')){_0x45ae7d={'method':_0x4bbb('0x3f'),'uri':_0x52476c+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0x4bbb('0x39')](_0x24addd[_0x4bbb('0x3a')],_0x5e6394,'\x20'),'phonenumber':String(_0x5e6394[_0x4bbb('0x40')]),'description':intUtil[_0x4bbb('0x39')](_0x24addd[_0x4bbb('0x3b')],_0x5e6394,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4bbb('0x3c')+_0x5a34ec['enduserId']+')','ownerid@odata.bind':_0x4bbb('0x27')+_0x5a34ec[_0x4bbb('0x21')]+')','directioncode':_0x5a34ec['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x4bbb('0x27')+_0x5a34ec['userId']+')','participationtypemask':_0x5a34ec[_0x4bbb('0x41')]===_0x4bbb('0x42')?0x2:0x1},{'partyid_contact@odata.bind':_0x4bbb('0x3c')+_0x5a34ec[_0x4bbb('0x2a')]+')','participationtypemask':_0x5a34ec['callDirection']===_0x4bbb('0x42')?0x1:0x2}]},getCustomFields(_0x24addd[_0x4bbb('0x3d')],_0x5e6394,_0x24addd[_0x4bbb('0x36')])),'headers':{'Authorization':_0x4bbb('0x15')+_0xe9d062,'OData-Version':_0x4bbb('0x28')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x45ae7d);})[_0x4bbb('0xf')](function(_0x2272ed){var _0x1e6c79=_0x2272ed[_0x4bbb('0x43')][_0x4bbb('0x44')];var _0x1c59bf=_0x1e6c79[_0x4bbb('0x29')](_0x1e6c79[_0x4bbb('0x45')]('(')+0x1,_0x1e6c79[_0x4bbb('0x45')](')'));_0x5a34ec[_0x4bbb('0x46')]=_0x1c59bf;_0x2bd146(_0x5a34ec);})[_0x4bbb('0x11')](function(_0x19fde1){_0x4f8bda(_0x19fde1[_0x4bbb('0x13')]);});});}function emit(_0x129e03,_0x284158,_0x4535df,_0x252c44){var _0xde073e={'uri':util[_0x4bbb('0x47')](_0x4bbb('0x48'),_0x129e03,_0x4535df,_0x252c44)};io['to'](util[_0x4bbb('0x47')](_0x4bbb('0x49'),_0x284158))['emit'](_0x4bbb('0x4a'),_0xde073e);}exports['cs']=function(_0x11fdab,_0x5b983a,_0x42b58b,_0x160a2b,_0x37f1a6,_0x4e490e,_0x2cd978,_0x34572e){var _0x3863a4={};_0x4e490e[_0x4bbb('0x4b')]=intUtil[_0x4bbb('0x4c')](_0x4e490e['remoteUri']);_0x4e490e[_0x4bbb('0x4d')]=intUtil[_0x4bbb('0x4c')](_0x4e490e[_0x4bbb('0x4d')]);_0x3863a4[_0x4bbb('0x41')]=_0x34572e===_0x4bbb('0x42')||_0x34572e===_0x4bbb('0x4e')?_0x4bbb('0x42'):_0x4bbb('0x25');var _0x9a652=util[_0x4bbb('0x47')](_0x4bbb('0x4f'),_0x4e490e[_0x4bbb('0x4b')]);var _0x199dde=util[_0x4bbb('0x47')](_0x4bbb('0x50'),_0x4e490e[_0x4bbb('0x51')]);var _0x177a64=util[_0x4bbb('0x47')](_0x4bbb('0x52'),_0x4e490e[_0x4bbb('0x4d')],_0x5b983a[_0x4bbb('0x53')],md5(_0x5b983a[_0x4bbb('0x53')]));if(_0x37f1a6&&_0x37f1a6['monitor_format']){logger[_0x4bbb('0x1d')](_0x4bbb('0x54'),_0x4bbb('0x55'));_0x5b983a[_0x4bbb('0x56')]=_0x177a64;}else if(_0x2cd978&&_0x2cd978[_0x4bbb('0x57')]&&_0x2cd978[_0x4bbb('0x57')]!==_0x4bbb('0x58')){logger[_0x4bbb('0x1d')](_0x4bbb('0x59'),_0x4bbb('0x55'));_0x5b983a[_0x4bbb('0x56')]=_0x177a64;}else{_0x5b983a[_0x4bbb('0x56')]='';}return getUser(_0x3863a4,_0x4e490e,_0x160a2b,_0x199dde,_0x9a652,_0x34572e)[_0x4bbb('0xf')](function(_0x3cbfc5){logger[_0x4bbb('0x1d')]('['+_0x34572e[_0x4bbb('0x1e')]()+_0x4bbb('0x5a'),_0x3cbfc5[_0x4bbb('0x21')]);logger[_0x4bbb('0x1d')]('['+_0x34572e[_0x4bbb('0x1e')]()+_0x4bbb('0x5b'),_0x3cbfc5[_0x4bbb('0x19')]);return getEndUser(_0x3cbfc5,_0x4e490e,_0x199dde,_0x9a652,_0x5b983a,_0x34572e);})[_0x4bbb('0xf')](function(_0x3cdc04){logger['info']('['+_0x34572e[_0x4bbb('0x1e')]()+_0x4bbb('0x5c'),_0x3cdc04[_0x4bbb('0x2a')]);logger[_0x4bbb('0x1d')]('['+_0x34572e[_0x4bbb('0x1e')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x5b983a[_0x4bbb('0x40')]);return getTicket(_0x3cdc04,_0x4e490e,_0x199dde,_0x9a652,_0x5b983a,_0x42b58b,_0x34572e);})[_0x4bbb('0xf')](function(_0x20b375){logger[_0x4bbb('0x1d')](util[_0x4bbb('0x47')]('['+_0x34572e['toUpperCase']()+_0x4bbb('0x5d'),_0x42b58b[_0x4bbb('0x36')],_0x20b375[_0x4bbb('0x46')]));logger['info'](util['format']('['+_0x34572e[_0x4bbb('0x1e')]()+_0x4bbb('0x5e'),_0x34572e));if(_0x34572e!==_0x4bbb('0x4e')){logger[_0x4bbb('0x1d')]('['+_0x34572e[_0x4bbb('0x1e')]()+']',_0x4bbb('0x5f'));emit(_0x4e490e[_0x4bbb('0x4b')],_0x160a2b['name'],_0x42b58b[_0x4bbb('0x36')],_0x20b375['ticketId']);}})['catch'](function(_0x76979c){logger[_0x4bbb('0x12')]('['+_0x34572e['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x76979c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xeda8=['toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','calleridnum','POST','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','toLowerCase','destcalleridnum','GET','replace','%2b','value','telephone1','enduserId','contactid',']\x20Enduser\x20created!','picklist','type','customField','idField','indexOf','substring','content','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','Fields','phonecall','phonecalls','callDirection','queue','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','userEmail',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','clientId','remoteUri','username','password','clientSecret','then','access_token','catch',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','length','internalemailaddress'];(function(_0x276ca0,_0x137101){var _0x4f52bc=function(_0x487c75){while(--_0x487c75){_0x276ca0['push'](_0x276ca0['shift']());}};_0x4f52bc(++_0x137101);}(_0xeda8,0x1d6));var _0x8eda=function(_0x3ec938,_0x47eeaa){_0x3ec938=_0x3ec938-0x0;var _0x3ae0ce=_0xeda8[_0x3ec938];return _0x3ae0ce;};'use strict';var _=require(_0x8eda('0x0'));var BPromise=require(_0x8eda('0x1'));var rp=require(_0x8eda('0x2'));var util=require(_0x8eda('0x3'));var intUtil=require(_0x8eda('0x4'));var md5=require(_0x8eda('0x5'));var Redis=require(_0x8eda('0x6'));var logger=require(_0x8eda('0x7'))(_0x8eda('0x8'));var config=require('../../../../config/environment');config[_0x8eda('0x9')]=_[_0x8eda('0xa')](config[_0x8eda('0x9')],{'host':_0x8eda('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8eda('0x9')]));function getAuthToken(_0x9097b3,_0x59f4f3,_0x3946ae){var _0x4781f2={'method':'POST','uri':_0x59f4f3,'form':{'client_id':_0x9097b3[_0x8eda('0xc')],'resource':_0x9097b3[_0x8eda('0xd')],'username':_0x9097b3[_0x8eda('0xe')],'password':_0x9097b3[_0x8eda('0xf')],'grant_type':_0x8eda('0xf'),'client_secret':_0x9097b3[_0x8eda('0x10')]},'json':!![]};return rp(_0x4781f2)[_0x8eda('0x11')](function(_0x2a51f4){return _0x2a51f4[_0x8eda('0x12')];})[_0x8eda('0x13')](function(_0x3b4cf6){logger['error']('['+[_0x3946ae['toUpperCase']()]+_0x8eda('0x14'));return _0x3b4cf6[_0x8eda('0x15')];});}function getUser(_0xd3d95b,_0x1164fd,_0x45e0a3,_0xcee2,_0x53674b,_0x58a958){return new BPromise(function(_0x3ff499,_0x41923f){return getAuthToken(_0x1164fd,_0xcee2,_0x58a958)[_0x8eda('0x11')](function(_0x4ce2c5){var _0x2a7c34={'method':'GET','uri':_0x53674b+_0x8eda('0x16'),'headers':{'Authorization':_0x8eda('0x17')+_0x4ce2c5,'OData-Version':_0x8eda('0x18')},'json':!![]};return rp(_0x2a7c34);})[_0x8eda('0x11')](function(_0x327f49){var _0x73142d=_0x327f49['value'];var _0x3346bd=![];var _0x18c33d=null;if(!_[_0x8eda('0x19')](_0x45e0a3)){if(intUtil[_0x8eda('0x1a')](_0x45e0a3[_0x8eda('0x1b')])){_0xd3d95b['userEmail']=_0x45e0a3[_0x8eda('0x1b')];for(_0x18c33d=0x0;_0x18c33d<_0x73142d[_0x8eda('0x1c')];_0x18c33d++){if(_0x73142d[_0x18c33d][_0x8eda('0x1d')]===_0x45e0a3['email']&&!_0x73142d[_0x18c33d]['isdisabled']){_0x3346bd=!![];logger['info']('['+[_0x58a958[_0x8eda('0x1e')]()]+_0x8eda('0x1f')+_0x73142d[_0x18c33d]['systemuserid']+'!');_0xd3d95b[_0x8eda('0x20')]=_0x73142d[_0x18c33d][_0x8eda('0x21')];}}}}if(!_0x3346bd){logger[_0x8eda('0x22')]('['+[_0x58a958[_0x8eda('0x1e')]()]+_0x8eda('0x23'));_0xd3d95b['userEmail']=_0x1164fd[_0x8eda('0xe')];for(_0x18c33d=0x0;_0x18c33d<_0x73142d[_0x8eda('0x1c')];_0x18c33d++){if(_0x73142d[_0x18c33d][_0x8eda('0x1d')]===_0x1164fd['username']){_0xd3d95b[_0x8eda('0x20')]=_0x73142d[_0x18c33d][_0x8eda('0x21')];}}}_0x3ff499(_0xd3d95b);})[_0x8eda('0x13')](function(_0x40fbc2){_0x41923f(_0x40fbc2[_0x8eda('0x15')]);});});}function createEndUser(_0x33570f,_0x60b870,_0x341922,_0x5586fb,_0x3c0af1,_0x4bb2c7){return new BPromise(function(_0x32cb11,_0x2d9ba1){return getAuthToken(_0x60b870,_0x341922,_0x4bb2c7)[_0x8eda('0x11')](function(_0xff9e14){var _0x1e045b=_0x4bb2c7['toLowerCase']()===_0x8eda('0x24')?_0x3c0af1['destcalleridnum']:_0x3c0af1[_0x8eda('0x25')];var _0x18fac0={'method':_0x8eda('0x26'),'uri':_0x5586fb+_0x8eda('0x27'),'body':{'telephone1':_0x1e045b,'fullname':_0x1e045b,'firstname':_0x1e045b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8eda('0x28')+_0x33570f[_0x8eda('0x20')]+')'},'headers':{'Authorization':'Bearer\x20'+_0xff9e14,'OData-Version':_0x8eda('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x18fac0);})[_0x8eda('0x11')](function(_0x5e2857){var _0x4753d0=_0x5e2857[_0x8eda('0x29')][_0x8eda('0x2a')];var _0x30466f=_0x4753d0['substring'](_0x4753d0[_0x8eda('0x2b')]('(')+0x1,_0x4753d0[_0x8eda('0x2b')](')'));_0x33570f['enduserId']=_0x30466f;_0x32cb11(_0x33570f);})['catch'](function(_0x105d25){_0x2d9ba1(_0x105d25[_0x8eda('0x15')]);});});}function getEndUser(_0x486213,_0x568278,_0x104100,_0x54430b,_0x39046f,_0x2c0e1d){return new BPromise(function(_0x4a098b,_0x2933a2){var _0x5df9c8=_0x2c0e1d[_0x8eda('0x2c')]()===_0x8eda('0x24')?_0x39046f[_0x8eda('0x2d')]:_0x39046f[_0x8eda('0x25')];return getAuthToken(_0x568278,_0x104100,_0x2c0e1d)['then'](function(_0x442801){var _0x5e0181={'method':_0x8eda('0x2e'),'uri':_0x54430b+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x5df9c8[_0x8eda('0x2f')]('+',_0x8eda('0x30'))+'\x27','headers':{'Authorization':_0x8eda('0x17')+_0x442801,'If-None-Match':null,'OData-Version':_0x8eda('0x18')},'json':!![]};return rp(_0x5e0181);})[_0x8eda('0x11')](function(_0x412f32){var _0x4f815c=null;if(_0x412f32){var _0x418b45=_0x412f32[_0x8eda('0x31')];var _0x445c90=![];for(_0x4f815c=0x0;_0x4f815c<_0x418b45['length'];_0x4f815c++){if(_0x418b45[_0x4f815c][_0x8eda('0x32')]===_0x5df9c8){_0x445c90=!![];_0x486213[_0x8eda('0x33')]=_0x418b45[_0x4f815c][_0x8eda('0x34')];}}if(_0x445c90){_0x4a098b(_0x486213);}else{return createEndUser(_0x486213,_0x568278,_0x104100,_0x54430b,_0x39046f,_0x2c0e1d)[_0x8eda('0x11')](function(_0x1b40cb){logger['info']('['+[_0x2c0e1d['toUpperCase']()]+_0x8eda('0x35'),_0x1b40cb['enduserId']);_0x4a098b(_0x1b40cb);});}}else{return createEndUser(_0x486213,_0x568278,_0x104100,_0x54430b,_0x39046f,_0x2c0e1d)[_0x8eda('0x11')](function(_0x3f93ba){logger[_0x8eda('0x22')]('['+[_0x2c0e1d[_0x8eda('0x1e')]()]+']\x20Enduser\x20Created!',_0x3f93ba[_0x8eda('0x33')]);_0x4a098b(_0x3f93ba);});}});});}function getCustomFields(_0x1b9b7e,_0xe9f094,_0xf5713a){var _0x521b17={};if(_0x1b9b7e[_0x8eda('0x1c')]>0x0){_['forEach'](_0x1b9b7e,function(_0x24993d){if(_['includes'](['string',_0x8eda('0x36')],_0x24993d[_0x8eda('0x37')])&&_0x24993d['nameField']&&!_0x24993d[_0x8eda('0x38')]){var _0x3041fd=_0x24993d[_0x8eda('0x39')][_0x8eda('0x2c')]();var _0x470bbb=_0x3041fd['substring'](0x0,_0x3041fd[_0x8eda('0x3a')]('_'));var _0x4ee7c1=_0x3041fd[_0x8eda('0x3b')](_0x3041fd[_0x8eda('0x3a')]('_')+0x1);if(_0x470bbb===_0xf5713a){_0x521b17[_0x4ee7c1]=_0x24993d[_0x8eda('0x3c')];}}});}return _0x521b17;}function getTicket(_0x5b11d2,_0x22383a,_0x8b96c1,_0xdd486f,_0x4f82cb,_0x37e541,_0x21259f){return new BPromise(function(_0x5454a0,_0x1b8d71){var _0x20262f;return getAuthToken(_0x22383a,_0x8b96c1,_0x21259f)[_0x8eda('0x11')](function(_0x47ff79){if(_0x37e541[_0x8eda('0x3d')]===_0x8eda('0x3e')){_0x20262f={'method':_0x8eda('0x26'),'uri':_0xdd486f+_0x8eda('0x3f'),'body':Object[_0x8eda('0x40')]({},{'title':intUtil['getString'](_0x37e541[_0x8eda('0x41')],_0x4f82cb,'\x20'),'description':intUtil[_0x8eda('0x42')](_0x37e541[_0x8eda('0x43')],_0x4f82cb,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x5b11d2[_0x8eda('0x33')]+')','ownerid@odata.bind':'/systemusers('+_0x5b11d2[_0x8eda('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x37e541[_0x8eda('0x44')],_0x4f82cb,_0x37e541[_0x8eda('0x3d')])),'headers':{'Authorization':'Bearer\x20'+_0x47ff79,'OData-Version':_0x8eda('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x37e541[_0x8eda('0x3d')]===_0x8eda('0x45')){_0x20262f={'method':_0x8eda('0x26'),'uri':_0xdd486f+_0x8eda('0x46'),'body':Object['assign']({},{'subject':intUtil[_0x8eda('0x42')](_0x37e541['Subjects'],_0x4f82cb,'\x20'),'phonenumber':String(_0x4f82cb[_0x8eda('0x25')]),'description':intUtil[_0x8eda('0x42')](_0x37e541[_0x8eda('0x43')],_0x4f82cb,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x5b11d2[_0x8eda('0x33')]+')','ownerid@odata.bind':_0x8eda('0x28')+_0x5b11d2[_0x8eda('0x20')]+')','directioncode':_0x5b11d2[_0x8eda('0x47')]===_0x8eda('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x8eda('0x28')+_0x5b11d2['userId']+')','participationtypemask':_0x5b11d2[_0x8eda('0x47')]===_0x8eda('0x48')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x5b11d2[_0x8eda('0x33')]+')','participationtypemask':_0x5b11d2[_0x8eda('0x47')]==='queue'?0x1:0x2}]},getCustomFields(_0x37e541[_0x8eda('0x44')],_0x4f82cb,_0x37e541[_0x8eda('0x3d')])),'headers':{'Authorization':_0x8eda('0x17')+_0x47ff79,'OData-Version':_0x8eda('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x20262f);})[_0x8eda('0x11')](function(_0x3737d9){var _0x37b553=_0x3737d9['headers'][_0x8eda('0x2a')];var _0x4c287b=_0x37b553['substring'](_0x37b553['lastIndexOf']('(')+0x1,_0x37b553['lastIndexOf'](')'));_0x5b11d2[_0x8eda('0x49')]=_0x4c287b;_0x5454a0(_0x5b11d2);})[_0x8eda('0x13')](function(_0x31fd2f){_0x1b8d71(_0x31fd2f[_0x8eda('0x15')]);});});}function emit(_0x472918,_0x1ead04,_0x1f86c6,_0x4898b5){var _0x285fc2={'uri':util['format'](_0x8eda('0x4a'),_0x472918,_0x1f86c6,_0x4898b5)};io['to'](util['format'](_0x8eda('0x4b'),_0x1ead04))[_0x8eda('0x4c')](_0x8eda('0x4d'),_0x285fc2);}exports['cs']=function(_0x1b9428,_0x19a31a,_0x11b330,_0x1f03a7,_0x47034c,_0x4caa0c,_0x3c7beb,_0x29a698){var _0x2266ff={};_0x4caa0c['remoteUri']=intUtil[_0x8eda('0x4e')](_0x4caa0c[_0x8eda('0xd')]);_0x4caa0c['serverUrl']=intUtil[_0x8eda('0x4e')](_0x4caa0c[_0x8eda('0x4f')]);_0x2266ff[_0x8eda('0x47')]=_0x29a698==='queue'||_0x29a698==='unmanaged'?_0x8eda('0x48'):_0x8eda('0x24');var _0x32bd73=util[_0x8eda('0x50')](_0x8eda('0x51'),_0x4caa0c[_0x8eda('0xd')]);var _0x3e5ac9=util['format'](_0x8eda('0x52'),_0x4caa0c['tenantId']);var _0x2211a9=util[_0x8eda('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4caa0c[_0x8eda('0x4f')],_0x19a31a['uniqueid'],md5(_0x19a31a[_0x8eda('0x53')]));if(_0x47034c&&_0x47034c['monitor_format']){logger['info'](_0x8eda('0x54'),'Recording\x20is\x20enabled!');_0x19a31a[_0x8eda('0x55')]=_0x2211a9;}else if(_0x3c7beb&&_0x3c7beb[_0x8eda('0x56')]&&_0x3c7beb[_0x8eda('0x56')]!==_0x8eda('0x57')){logger[_0x8eda('0x22')](_0x8eda('0x58'),_0x8eda('0x59'));_0x19a31a[_0x8eda('0x55')]=_0x2211a9;}else{_0x19a31a['recordingURL']='';}return getUser(_0x2266ff,_0x4caa0c,_0x1f03a7,_0x3e5ac9,_0x32bd73,_0x29a698)[_0x8eda('0x11')](function(_0x3b2696){logger['info']('['+_0x29a698[_0x8eda('0x1e')]()+']\x20The\x20User\x20ID\x20is:',_0x3b2696[_0x8eda('0x20')]);logger['info']('['+_0x29a698[_0x8eda('0x1e')]()+']\x20The\x20User\x20email\x20is:',_0x3b2696[_0x8eda('0x5a')]);return getEndUser(_0x3b2696,_0x4caa0c,_0x3e5ac9,_0x32bd73,_0x19a31a,_0x29a698);})[_0x8eda('0x11')](function(_0x102279){logger[_0x8eda('0x22')]('['+_0x29a698[_0x8eda('0x1e')]()+_0x8eda('0x5b'),_0x102279[_0x8eda('0x33')]);logger['info']('['+_0x29a698['toUpperCase']()+_0x8eda('0x5c'),_0x19a31a[_0x8eda('0x25')]);return getTicket(_0x102279,_0x4caa0c,_0x3e5ac9,_0x32bd73,_0x19a31a,_0x11b330,_0x29a698);})[_0x8eda('0x11')](function(_0x59aeb2){logger[_0x8eda('0x22')](util[_0x8eda('0x50')]('['+_0x29a698[_0x8eda('0x1e')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x11b330[_0x8eda('0x3d')],_0x59aeb2['ticketId']));logger[_0x8eda('0x22')](util[_0x8eda('0x50')]('['+_0x29a698[_0x8eda('0x1e')]()+_0x8eda('0x5d'),_0x29a698));if(_0x29a698!==_0x8eda('0x5e')){logger['info']('['+_0x29a698[_0x8eda('0x1e')]()+']',_0x8eda('0x5f'));emit(_0x4caa0c[_0x8eda('0xd')],_0x1f03a7[_0x8eda('0x60')],_0x11b330[_0x8eda('0x3d')],_0x59aeb2[_0x8eda('0x49')]);}})[_0x8eda('0x13')](function(_0x264033){logger[_0x8eda('0x61')]('['+_0x29a698[_0x8eda('0x1e')]()+_0x8eda('0x62'),util[_0x8eda('0x63')](_0x264033,{'showHidden':!![],'depth':null}));});}; \ 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 2e39e7f..500a997 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 _0x12bb=['name','Fields','mapValues','keyBy','custom_fields','%s/api/v2/tickets','remoteUri','then','info','Ticket\x20created!','%s/api/v2/agents','Agent\x20found!','find','contact','email','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','[HTTP]','stringify','GET','map','forEach','includes','string','type','nameField','customField','toLowerCase','content','picklist','idField','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','Creating\x20new\x20ticket...','format','calleridname','getString','
','Tags'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0x12bb,0x1b0));var _0xb12b=function(_0x4d45bb,_0x2dccca){_0x4d45bb=_0x4d45bb-0x0;var _0x5eb1cb=_0x12bb[_0x4d45bb];return _0x5eb1cb;};'use strict';var _=require(_0xb12b('0x0'));var rp=require(_0xb12b('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xb12b('0x2'));var intUtil=require(_0xb12b('0x3'));var config=require(_0xb12b('0x4'));var logger=require(_0xb12b('0x5'))(_0xb12b('0x6'));config[_0xb12b('0x7')]=_[_0xb12b('0x8')](config[_0xb12b('0x7')],{'host':_0xb12b('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xb12b('0xa'),'Accept':'application/json'};function emit(_0x533f5e,_0x4301a2,_0x18eb2c){io['to'](_0x533f5e)[_0xb12b('0xb')](_0x4301a2,_0x18eb2c);}function getTicket(_0x29920d,_0x30e0c4,_0x31213a,_0x4d517e,_0x31b3c4){logger['info'](_0xb12b('0xc'));var _0x4cac69=_['merge']({'responder_id':_0x30e0c4['id'],'requester_id':_0x31213a['id'],'name':util[_0xb12b('0xd')]('Caller\x20-\x20%s',_0x31b3c4[_0xb12b('0xe')]),'phone':_0x31b3c4['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb12b('0xf')](_0x4d517e['Subjects'],_0x31b3c4,'\x20'),'description':intUtil[_0xb12b('0xf')](_0x4d517e['Descriptions'],_0x31b3c4,_0xb12b('0x10')),'tags':getTags(_0x4d517e[_0xb12b('0x11')],_0xb12b('0x12'))},getCustomFields(_0x4d517e[_0xb12b('0x13')],_0x31b3c4));_0x4cac69['custom_fields']=_[_0xb12b('0x14')](_[_0xb12b('0x15')](_0x4cac69[_0xb12b('0x16')],'id'),'value');return request({'uri':util[_0xb12b('0xd')](_0xb12b('0x17'),_0x29920d[_0xb12b('0x18')]),'method':'POST','body':_0x4cac69})[_0xb12b('0x19')](function(_0x1ff122){logger[_0xb12b('0x1a')](_0xb12b('0x1b'));return _0x1ff122;});}function getUser(_0x7e563d,_0x2dfb3f){if(intUtil['validateEmail'](_0x2dfb3f)){return request({'uri':util[_0xb12b('0xd')](_0xb12b('0x1c'),_0x7e563d[_0xb12b('0x18')]),'qs':{'email':_0x2dfb3f}})[_0xb12b('0x19')](function(_0x446517){if(_0x446517['length']){logger[_0xb12b('0x1a')](_0xb12b('0x1d'));return _[_0xb12b('0x1e')](_0x446517,function(_0x3c6250){return _0x3c6250[_0xb12b('0x1f')][_0xb12b('0x20')]===_0x2dfb3f;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xb12b('0xd')]('%s/api/v2/agents/me',_0x7e563d['remoteUri'])})['then'](function(_0x48c917){logger[_0xb12b('0x1a')]('Admin\x20account\x20selected.');return _0x48c917;});}});}else{logger[_0xb12b('0x1a')](_0xb12b('0x21'));return request({'uri':util[_0xb12b('0xd')](_0xb12b('0x22'),_0x7e563d[_0xb12b('0x18')])})[_0xb12b('0x19')](function(_0x1672c4){logger[_0xb12b('0x1a')](_0xb12b('0x23'));return _0x1672c4;});}}function getEndUser(_0x11f18c,_0x1b2d89,_0x1dd3f3){logger[_0xb12b('0x1a')](_0xb12b('0x24'),_0x1dd3f3);return request({'uri':util['format'](_0xb12b('0x25'),_0x11f18c[_0xb12b('0x18')]),'qs':{'phone':_0x1dd3f3}})[_0xb12b('0x19')](function(_0x3380a5){if(_0x3380a5[_0xb12b('0x26')]){logger[_0xb12b('0x1a')](_0xb12b('0x27'));return _['find'](_0x3380a5,{'phone':_0x1dd3f3});}else{logger[_0xb12b('0x1a')](_0xb12b('0x28'));return request({'uri':util[_0xb12b('0xd')](_0xb12b('0x25'),_0x11f18c[_0xb12b('0x18')]),'method':_0xb12b('0x29'),'body':{'name':_0x1b2d89,'phone':_0x1dd3f3}})['then'](function(_0x543587){logger[_0xb12b('0x1a')](_0xb12b('0x2a'));return _0x543587;});}});}function getAuth(_0x4decc6){return util[_0xb12b('0xd')](_0xb12b('0x2b'),new Buffer(_0x4decc6[_0xb12b('0x2c')]+':X')[_0xb12b('0x2d')]('base64'));}function request(_0x530417){logger['debug'](_0xb12b('0x2e'),JSON[_0xb12b('0x2f')](_0x530417));return rp(_[_0xb12b('0x8')](_0x530417,{'method':_0xb12b('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x1a7e85,_0xc96a9e){var _0x489baf=[];if(_0x1a7e85&&_0x1a7e85['length']>0x0){_0x489baf=_[_0xb12b('0x31')](_0x1a7e85,_0xc96a9e);}return _0x489baf;}function getCustomFields(_0x288606,_0x54716d){var _0x2a055e=[];var _0x2b05cb={'custom_fields':[]};if(_0x288606[_0xb12b('0x26')]>0x0){_[_0xb12b('0x32')](_0x288606,function(_0x3e6712){if(_[_0xb12b('0x33')]([_0xb12b('0x34'),'picklist'],_0x3e6712[_0xb12b('0x35')])&&_0x3e6712[_0xb12b('0x36')]&&!_0x3e6712[_0xb12b('0x37')]){_0x2b05cb[_0x3e6712[_0xb12b('0x36')][_0xb12b('0x38')]()]=_0x3e6712[_0xb12b('0x39')]['toString']();}else if(_[_0xb12b('0x33')](['string',_0xb12b('0x3a')],_0x3e6712['type'])&&_0x3e6712[_0xb12b('0x3b')]&&_0x3e6712[_0xb12b('0x37')]){_0x2b05cb[_0xb12b('0x16')][_0xb12b('0x3c')]({'id':_0x3e6712[_0xb12b('0x3b')],'value':_0x3e6712[_0xb12b('0x39')][_0xb12b('0x2d')]()});}else if(_0x3e6712[_0xb12b('0x35')]==='variable'&&_0x3e6712[_0xb12b('0x3d')]&&_0x3e6712[_0xb12b('0x3b')]&&_0x3e6712[_0xb12b('0x37')]){_0x54716d[_0x3e6712[_0xb12b('0x3d')]]&&_0x2b05cb['custom_fields']['push']({'id':_0x3e6712[_0xb12b('0x3b')],'value':_0x54716d[_0x3e6712[_0xb12b('0x3d')]][_0xb12b('0x2d')]()});}else if(_0x3e6712[_0xb12b('0x35')]===_0xb12b('0x3e')&&_0x3e6712[_0xb12b('0x3f')]&&_0x3e6712[_0xb12b('0x3f')][_0xb12b('0x12')]&&_0x3e6712[_0xb12b('0x3b')]&&_0x3e6712[_0xb12b('0x37')]){_0x54716d[_0x3e6712[_0xb12b('0x3f')][_0xb12b('0x12')][_0xb12b('0x38')]()]&&_0x2b05cb[_0xb12b('0x16')][_0xb12b('0x3c')]({'id':_0x3e6712['idField'],'value':_0x54716d[_0x3e6712['Variable'][_0xb12b('0x12')][_0xb12b('0x38')]()][_0xb12b('0x2d')]()});}});}return _0x2b05cb;}exports[_0xb12b('0x40')]=function(_0x3a50b3,_0x56adda,_0x160d84,_0x294df1,_0x572be0,_0x3bbf43){var _0x2f861f,_0x450da8;_0x3bbf43[_0xb12b('0x18')]=intUtil[_0xb12b('0x41')](_0x3bbf43['remoteUri']);_0x3bbf43[_0xb12b('0x42')]=intUtil['stripTrailingSlash'](_0x3bbf43['serverUrl']);if(_0x572be0&&_0x572be0[_0xb12b('0x43')]){logger[_0xb12b('0x1a')](_0xb12b('0x44'),_0xb12b('0x45'));_0x56adda[_0xb12b('0x46')]=util[_0xb12b('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3bbf43[_0xb12b('0x42')],_0x56adda['uniqueid'],md5(_0x56adda['uniqueid']));}else{_0x56adda[_0xb12b('0x46')]='';}headers[_0xb12b('0x47')]=getAuth(_0x3bbf43);return getUser(_0x3bbf43,_0x294df1[_0xb12b('0x20')])[_0xb12b('0x19')](function(_0x170539){_0x2f861f=_0x170539;logger[_0xb12b('0x1a')](_0xb12b('0x48'),_0x2f861f['id']);return getEndUser(_0x3bbf43,_0x56adda[_0xb12b('0xe')],_0x56adda[_0xb12b('0x49')]);})[_0xb12b('0x19')](function(_0x4cbc0d){_0x450da8=_0x4cbc0d;logger['info'](_0xb12b('0x4a'),_0x450da8['id']);return getTicket(_0x3bbf43,_0x2f861f,_0x450da8,_0x160d84,_0x56adda);})['then'](function(_0x1d67a7){if(_0x1d67a7&&_0x1d67a7['id']){logger[_0xb12b('0x1a')](_0xb12b('0x1b'));logger[_0xb12b('0x1a')](_0xb12b('0x4b'),_0x1d67a7['id']);logger['info'](_0xb12b('0x44'),_0xb12b('0x4c'));emit(util[_0xb12b('0xd')]('user:%s',_0x294df1[_0xb12b('0x12')]),_0xb12b('0x4d'),{'uri':util[_0xb12b('0xd')](_0xb12b('0x4e'),_0x3bbf43[_0xb12b('0x18')],_0x1d67a7['id'])});}})[_0xb12b('0x4f')](function(_0x285953){logger['error'](_0xb12b('0x44'),JSON[_0xb12b('0x2f')](_0x285953));});};exports[_0xb12b('0x50')]=function(_0x5e3535,_0x31e3ed,_0x12c617,_0x11293c,_0x5ce76c,_0x4c40a6,_0x14b47f){var _0x5b3551,_0x4760f9;_0x4c40a6[_0xb12b('0x18')]=intUtil['stripTrailingSlash'](_0x4c40a6[_0xb12b('0x18')]);_0x4c40a6[_0xb12b('0x42')]=intUtil[_0xb12b('0x41')](_0x4c40a6[_0xb12b('0x42')]);if(_0x14b47f&&_0x14b47f['recordingFormat']&&_0x14b47f[_0xb12b('0x51')]!=='none'){logger[_0xb12b('0x1a')](_0xb12b('0x52'),_0xb12b('0x45'));_0x31e3ed[_0xb12b('0x46')]=util[_0xb12b('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4c40a6[_0xb12b('0x42')],_0x31e3ed[_0xb12b('0x53')],md5(_0x31e3ed[_0xb12b('0x53')]));}headers[_0xb12b('0x47')]=getAuth(_0x4c40a6);return getUser(_0x4c40a6,_0x11293c[_0xb12b('0x20')])['then'](function(_0x5e6283){_0x5b3551=_0x5e6283;logger[_0xb12b('0x1a')]('The\x20User\x20ID\x20is:',_0x5b3551['id']);return getEndUser(_0x4c40a6,_0x31e3ed[_0xb12b('0x54')],_0x31e3ed[_0xb12b('0x55')]);})[_0xb12b('0x19')](function(_0x473d77){_0x4760f9=_0x473d77;logger[_0xb12b('0x1a')]('The\x20Enduser\x20ID\x20is:',_0x4760f9['id']);return getTicket(_0x4c40a6,_0x5b3551,_0x4760f9,_0x12c617,_0x31e3ed);})['then'](function(_0x3a454c){if(_0x3a454c&&_0x3a454c['id']){logger[_0xb12b('0x1a')](_0xb12b('0x1b'));logger[_0xb12b('0x1a')](_0xb12b('0x4b'),_0x3a454c['id']);logger[_0xb12b('0x1a')](_0xb12b('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x11293c[_0xb12b('0x12')]),_0xb12b('0x4d'),{'uri':util[_0xb12b('0xd')](_0xb12b('0x4e'),_0x4c40a6[_0xb12b('0x18')],_0x3a454c['id'])});}})['catch'](function(_0x3880fb){logger[_0xb12b('0x56')](_0xb12b('0x52'),JSON['stringify'](_0x3880fb));});};exports[_0xb12b('0x57')]=function(_0x331684,_0x161a2e,_0x21fc65,_0x578426,_0x3e7d21,_0x585a58){var _0x25265c,_0x1d797f;_0x585a58['remoteUri']=intUtil[_0xb12b('0x41')](_0x585a58['remoteUri']);_0x585a58[_0xb12b('0x42')]=intUtil['stripTrailingSlash'](_0x585a58[_0xb12b('0x42')]);if(_0x3e7d21&&_0x3e7d21['monitor_format']){logger[_0xb12b('0x1a')]('['+_0x161a2e[_0xb12b('0x58')][_0xb12b('0x59')]()+']',_0xb12b('0x45'));_0x161a2e[_0xb12b('0x46')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x585a58['serverUrl'],_0x161a2e[_0xb12b('0x53')],md5(_0x161a2e[_0xb12b('0x53')]));}else{_0x161a2e['recordingURL']='';}headers['Authorization']=getAuth(_0x585a58);return getUser(_0x585a58,'')[_0xb12b('0x19')](function(_0x14d6c5){_0x25265c=_0x14d6c5;logger[_0xb12b('0x1a')](_0xb12b('0x48'),_0x25265c['id']);return getEndUser(_0x585a58,_0x161a2e[_0xb12b('0xe')],_0x161a2e['calleridnum']);})['then'](function(_0x5a9913){_0x1d797f=_0x5a9913;logger['info'](_0xb12b('0x4a'),_0x1d797f['id']);return getTicket(_0x585a58,_0x25265c,_0x1d797f,_0x21fc65,_0x161a2e);})[_0xb12b('0x19')](function(_0x3e1d95){if(_0x3e1d95){logger['info'](_0xb12b('0x1b'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3e1d95['id']);}})[_0xb12b('0x4f')](function(_0x38189b){logger[_0xb12b('0x56')]('['+_0x161a2e['lastevent']['toUpperCase']()+']',JSON[_0xb12b('0x2f')](_0x38189b));});}; \ No newline at end of file +var _0x9c6e=['stringify','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Tags','name','Fields','mapValues','custom_fields','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','POST','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','defaults','GET','map','includes','string','type','nameField','customField','toLowerCase','content','picklist','push','idField','variable','variableName','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:'];(function(_0x117ac5,_0x169d26){var _0x2fdc47=function(_0x2ca0b){while(--_0x2ca0b){_0x117ac5['push'](_0x117ac5['shift']());}};_0x2fdc47(++_0x169d26);}(_0x9c6e,0x1d7));var _0xe9c6=function(_0x4473be,_0x529ba7){_0x4473be=_0x4473be-0x0;var _0x4a2ede=_0x9c6e[_0x4473be];return _0x4a2ede;};'use strict';var _=require(_0xe9c6('0x0'));var rp=require('request-promise');var md5=require(_0xe9c6('0x1'));var util=require(_0xe9c6('0x2'));var Redis=require(_0xe9c6('0x3'));var intUtil=require(_0xe9c6('0x4'));var config=require(_0xe9c6('0x5'));var logger=require(_0xe9c6('0x6'))(_0xe9c6('0x7'));config[_0xe9c6('0x8')]=_['defaults'](config['redis'],{'host':_0xe9c6('0x9'),'port':0x18eb});var io=require(_0xe9c6('0xa'))(new Redis(config[_0xe9c6('0x8')]));var headers={'Content-Type':_0xe9c6('0xb'),'Accept':_0xe9c6('0xb')};function emit(_0x34bf89,_0x369378,_0x1a3eab){io['to'](_0x34bf89)[_0xe9c6('0xc')](_0x369378,_0x1a3eab);}function getTicket(_0x5f5d7e,_0x580c0b,_0x356165,_0x56ff18,_0x205857){logger[_0xe9c6('0xd')]('Creating\x20new\x20ticket...');var _0x5d9a14=_[_0xe9c6('0xe')]({'responder_id':_0x580c0b['id'],'requester_id':_0x356165['id'],'name':util[_0xe9c6('0xf')](_0xe9c6('0x10'),_0x205857[_0xe9c6('0x11')]),'phone':_0x205857[_0xe9c6('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe9c6('0x13')](_0x56ff18[_0xe9c6('0x14')],_0x205857,'\x20'),'description':intUtil[_0xe9c6('0x13')](_0x56ff18['Descriptions'],_0x205857,'
'),'tags':getTags(_0x56ff18[_0xe9c6('0x15')],_0xe9c6('0x16'))},getCustomFields(_0x56ff18[_0xe9c6('0x17')],_0x205857));_0x5d9a14['custom_fields']=_[_0xe9c6('0x18')](_['keyBy'](_0x5d9a14[_0xe9c6('0x19')],'id'),_0xe9c6('0x1a'));return request({'uri':util[_0xe9c6('0xf')](_0xe9c6('0x1b'),_0x5f5d7e[_0xe9c6('0x1c')]),'method':'POST','body':_0x5d9a14})[_0xe9c6('0x1d')](function(_0x550ebb){logger[_0xe9c6('0xd')](_0xe9c6('0x1e'));return _0x550ebb;});}function getUser(_0x5d7aa7,_0x1b35f2){if(intUtil[_0xe9c6('0x1f')](_0x1b35f2)){return request({'uri':util[_0xe9c6('0xf')](_0xe9c6('0x20'),_0x5d7aa7['remoteUri']),'qs':{'email':_0x1b35f2}})[_0xe9c6('0x1d')](function(_0x8046f1){if(_0x8046f1[_0xe9c6('0x21')]){logger['info'](_0xe9c6('0x22'));return _[_0xe9c6('0x23')](_0x8046f1,function(_0x310eb8){return _0x310eb8[_0xe9c6('0x24')][_0xe9c6('0x25')]===_0x1b35f2;});}else{logger[_0xe9c6('0xd')](_0xe9c6('0x26'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x5d7aa7[_0xe9c6('0x1c')])})[_0xe9c6('0x1d')](function(_0x4faa9f){logger[_0xe9c6('0xd')]('Admin\x20account\x20selected.');return _0x4faa9f;});}});}else{logger['info'](_0xe9c6('0x27'));return request({'uri':util[_0xe9c6('0xf')](_0xe9c6('0x28'),_0x5d7aa7[_0xe9c6('0x1c')])})['then'](function(_0x57f3b7){logger[_0xe9c6('0xd')]('Admin\x20account\x20selected.');return _0x57f3b7;});}}function getEndUser(_0x5bea08,_0x416863,_0x18e4ce){logger[_0xe9c6('0xd')](_0xe9c6('0x29'),_0x18e4ce);return request({'uri':util[_0xe9c6('0xf')](_0xe9c6('0x2a'),_0x5bea08[_0xe9c6('0x1c')]),'qs':{'phone':_0x18e4ce}})[_0xe9c6('0x1d')](function(_0x539a0b){if(_0x539a0b[_0xe9c6('0x21')]){logger[_0xe9c6('0xd')](_0xe9c6('0x2b'));return _[_0xe9c6('0x23')](_0x539a0b,{'phone':_0x18e4ce});}else{logger[_0xe9c6('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xe9c6('0x2a'),_0x5bea08[_0xe9c6('0x1c')]),'method':_0xe9c6('0x2c'),'body':{'name':_0x416863,'phone':_0x18e4ce}})[_0xe9c6('0x1d')](function(_0x22e1d9){logger[_0xe9c6('0xd')](_0xe9c6('0x2d'));return _0x22e1d9;});}});}function getAuth(_0x1cba81){return util['format'](_0xe9c6('0x2e'),new Buffer(_0x1cba81['apiKey']+':X')[_0xe9c6('0x2f')](_0xe9c6('0x30')));}function request(_0x77d768){logger[_0xe9c6('0x31')](_0xe9c6('0x32'),JSON['stringify'](_0x77d768));return rp(_[_0xe9c6('0x33')](_0x77d768,{'method':_0xe9c6('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x599b92,_0x5002b7){var _0x55bb13=[];if(_0x599b92&&_0x599b92['length']>0x0){_0x55bb13=_[_0xe9c6('0x35')](_0x599b92,_0x5002b7);}return _0x55bb13;}function getCustomFields(_0x696925,_0x2f83a6){var _0x2fcb53=[];var _0x3a8142={'custom_fields':[]};if(_0x696925[_0xe9c6('0x21')]>0x0){_['forEach'](_0x696925,function(_0x2c79ff){if(_[_0xe9c6('0x36')]([_0xe9c6('0x37'),'picklist'],_0x2c79ff[_0xe9c6('0x38')])&&_0x2c79ff[_0xe9c6('0x39')]&&!_0x2c79ff[_0xe9c6('0x3a')]){_0x3a8142[_0x2c79ff['nameField'][_0xe9c6('0x3b')]()]=_0x2c79ff[_0xe9c6('0x3c')]['toString']();}else if(_['includes']([_0xe9c6('0x37'),_0xe9c6('0x3d')],_0x2c79ff[_0xe9c6('0x38')])&&_0x2c79ff['idField']&&_0x2c79ff[_0xe9c6('0x3a')]){_0x3a8142[_0xe9c6('0x19')][_0xe9c6('0x3e')]({'id':_0x2c79ff[_0xe9c6('0x3f')],'value':_0x2c79ff[_0xe9c6('0x3c')][_0xe9c6('0x2f')]()});}else if(_0x2c79ff[_0xe9c6('0x38')]===_0xe9c6('0x40')&&_0x2c79ff[_0xe9c6('0x41')]&&_0x2c79ff[_0xe9c6('0x3f')]&&_0x2c79ff[_0xe9c6('0x3a')]){_0x2f83a6[_0x2c79ff[_0xe9c6('0x41')]]&&_0x3a8142[_0xe9c6('0x19')][_0xe9c6('0x3e')]({'id':_0x2c79ff[_0xe9c6('0x3f')],'value':_0x2f83a6[_0x2c79ff[_0xe9c6('0x41')]][_0xe9c6('0x2f')]()});}else if(_0x2c79ff['type']==='customVariable'&&_0x2c79ff[_0xe9c6('0x42')]&&_0x2c79ff[_0xe9c6('0x42')][_0xe9c6('0x16')]&&_0x2c79ff[_0xe9c6('0x3f')]&&_0x2c79ff[_0xe9c6('0x3a')]){_0x2f83a6[_0x2c79ff[_0xe9c6('0x42')][_0xe9c6('0x16')]['toLowerCase']()]&&_0x3a8142[_0xe9c6('0x19')][_0xe9c6('0x3e')]({'id':_0x2c79ff[_0xe9c6('0x3f')],'value':_0x2f83a6[_0x2c79ff[_0xe9c6('0x42')][_0xe9c6('0x16')][_0xe9c6('0x3b')]()][_0xe9c6('0x2f')]()});}});}return _0x3a8142;}exports['queue']=function(_0x2c1f7e,_0x3cac3b,_0x11405a,_0x14be2b,_0xc44993,_0x5a88af){var _0x56d871,_0x63863f;_0x5a88af[_0xe9c6('0x1c')]=intUtil[_0xe9c6('0x43')](_0x5a88af['remoteUri']);_0x5a88af[_0xe9c6('0x44')]=intUtil['stripTrailingSlash'](_0x5a88af[_0xe9c6('0x44')]);if(_0xc44993&&_0xc44993[_0xe9c6('0x45')]){logger[_0xe9c6('0xd')](_0xe9c6('0x46'),_0xe9c6('0x47'));_0x3cac3b[_0xe9c6('0x48')]=util[_0xe9c6('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a88af[_0xe9c6('0x44')],_0x3cac3b[_0xe9c6('0x49')],md5(_0x3cac3b['uniqueid']));}else{_0x3cac3b['recordingURL']='';}headers['Authorization']=getAuth(_0x5a88af);return getUser(_0x5a88af,_0x14be2b[_0xe9c6('0x25')])['then'](function(_0x2f78e1){_0x56d871=_0x2f78e1;logger[_0xe9c6('0xd')](_0xe9c6('0x4a'),_0x56d871['id']);return getEndUser(_0x5a88af,_0x3cac3b[_0xe9c6('0x11')],_0x3cac3b['calleridnum']);})[_0xe9c6('0x1d')](function(_0x4778dc){_0x63863f=_0x4778dc;logger[_0xe9c6('0xd')](_0xe9c6('0x4b'),_0x63863f['id']);return getTicket(_0x5a88af,_0x56d871,_0x63863f,_0x11405a,_0x3cac3b);})[_0xe9c6('0x1d')](function(_0x4732e0){if(_0x4732e0&&_0x4732e0['id']){logger[_0xe9c6('0xd')](_0xe9c6('0x1e'));logger[_0xe9c6('0xd')]('The\x20Ticket\x20ID\x20is:',_0x4732e0['id']);logger[_0xe9c6('0xd')](_0xe9c6('0x46'),_0xe9c6('0x4c'));emit(util[_0xe9c6('0xf')](_0xe9c6('0x4d'),_0x14be2b[_0xe9c6('0x16')]),_0xe9c6('0x4e'),{'uri':util[_0xe9c6('0xf')](_0xe9c6('0x4f'),_0x5a88af[_0xe9c6('0x1c')],_0x4732e0['id'])});}})[_0xe9c6('0x50')](function(_0x91d27e){logger[_0xe9c6('0x51')](_0xe9c6('0x46'),JSON['stringify'](_0x91d27e));});};exports[_0xe9c6('0x52')]=function(_0x5c9c99,_0x487636,_0xce2507,_0x2e8e8d,_0x610f58,_0x3721cf,_0x2a1a44){var _0x2b15e5,_0x5ecc20;_0x3721cf['remoteUri']=intUtil[_0xe9c6('0x43')](_0x3721cf[_0xe9c6('0x1c')]);_0x3721cf[_0xe9c6('0x44')]=intUtil[_0xe9c6('0x43')](_0x3721cf['serverUrl']);if(_0x2a1a44&&_0x2a1a44['recordingFormat']&&_0x2a1a44[_0xe9c6('0x53')]!=='none'){logger[_0xe9c6('0xd')](_0xe9c6('0x54'),_0xe9c6('0x47'));_0x487636[_0xe9c6('0x48')]=util['format'](_0xe9c6('0x55'),_0x3721cf[_0xe9c6('0x44')],_0x487636[_0xe9c6('0x49')],md5(_0x487636[_0xe9c6('0x49')]));}headers[_0xe9c6('0x56')]=getAuth(_0x3721cf);return getUser(_0x3721cf,_0x2e8e8d[_0xe9c6('0x25')])[_0xe9c6('0x1d')](function(_0x51466d){_0x2b15e5=_0x51466d;logger[_0xe9c6('0xd')](_0xe9c6('0x4a'),_0x2b15e5['id']);return getEndUser(_0x3721cf,_0x487636[_0xe9c6('0x57')],_0x487636[_0xe9c6('0x58')]);})[_0xe9c6('0x1d')](function(_0x133f29){_0x5ecc20=_0x133f29;logger[_0xe9c6('0xd')]('The\x20Enduser\x20ID\x20is:',_0x5ecc20['id']);return getTicket(_0x3721cf,_0x2b15e5,_0x5ecc20,_0xce2507,_0x487636);})['then'](function(_0x5f2f5c){if(_0x5f2f5c&&_0x5f2f5c['id']){logger['info'](_0xe9c6('0x1e'));logger[_0xe9c6('0xd')]('The\x20Ticket\x20ID\x20is:',_0x5f2f5c['id']);logger[_0xe9c6('0xd')](_0xe9c6('0x54'),_0xe9c6('0x4c'));emit(util[_0xe9c6('0xf')](_0xe9c6('0x4d'),_0x2e8e8d[_0xe9c6('0x16')]),_0xe9c6('0x4e'),{'uri':util[_0xe9c6('0xf')]('%s/helpdesk/tickets/%d',_0x3721cf[_0xe9c6('0x1c')],_0x5f2f5c['id'])});}})[_0xe9c6('0x50')](function(_0x498e3b){logger[_0xe9c6('0x51')]('[OUTBOUND]',JSON['stringify'](_0x498e3b));});};exports[_0xe9c6('0x59')]=function(_0x8e48ce,_0x2b5494,_0x1b2221,_0x4f585f,_0x3785f2,_0x496675){var _0xc1051b,_0x20f22c;_0x496675[_0xe9c6('0x1c')]=intUtil['stripTrailingSlash'](_0x496675[_0xe9c6('0x1c')]);_0x496675[_0xe9c6('0x44')]=intUtil['stripTrailingSlash'](_0x496675[_0xe9c6('0x44')]);if(_0x3785f2&&_0x3785f2[_0xe9c6('0x45')]){logger[_0xe9c6('0xd')]('['+_0x2b5494[_0xe9c6('0x5a')][_0xe9c6('0x5b')]()+']','Recording\x20is\x20enabled!');_0x2b5494[_0xe9c6('0x48')]=util[_0xe9c6('0xf')](_0xe9c6('0x55'),_0x496675[_0xe9c6('0x44')],_0x2b5494[_0xe9c6('0x49')],md5(_0x2b5494[_0xe9c6('0x49')]));}else{_0x2b5494['recordingURL']='';}headers[_0xe9c6('0x56')]=getAuth(_0x496675);return getUser(_0x496675,'')['then'](function(_0x43f2ef){_0xc1051b=_0x43f2ef;logger[_0xe9c6('0xd')](_0xe9c6('0x4a'),_0xc1051b['id']);return getEndUser(_0x496675,_0x2b5494['calleridname'],_0x2b5494[_0xe9c6('0x12')]);})[_0xe9c6('0x1d')](function(_0x3fb52a){_0x20f22c=_0x3fb52a;logger[_0xe9c6('0xd')](_0xe9c6('0x4b'),_0x20f22c['id']);return getTicket(_0x496675,_0xc1051b,_0x20f22c,_0x1b2221,_0x2b5494);})[_0xe9c6('0x1d')](function(_0x47324f){if(_0x47324f){logger['info'](_0xe9c6('0x1e'));logger[_0xe9c6('0xd')](_0xe9c6('0x5c'),_0x47324f['id']);}})[_0xe9c6('0x50')](function(_0x479250){logger['error']('['+_0x2b5494['lastevent']['toUpperCase']()+']',JSON[_0xe9c6('0x5d')](_0x479250));});}; \ 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 fc4e5dc..6864b64 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 _0x20be=['freshsales','redis','defaults','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','/api/selector/owners','Getting\x20user\x20list','then','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','toUpperCase','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','Task\x20created:','ticketId','emit','trigger:browser:url','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger'];(function(_0x3d38ae,_0x51102b){var _0x3757ee=function(_0x22bac8){while(--_0x22bac8){_0x3d38ae['push'](_0x3d38ae['shift']());}};_0x3757ee(++_0x51102b);}(_0x20be,0xe3));var _0xe20b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x20be[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xe20b('0x0'));var rp=require(_0xe20b('0x1'));var md5=require(_0xe20b('0x2'));var util=require('util');var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0xe20b('0x3'));var intUtil=require(_0xe20b('0x4'));var config=require(_0xe20b('0x5'));var logger=require(_0xe20b('0x6'))(_0xe20b('0x7'));config[_0xe20b('0x8')]=_[_0xe20b('0x9')](config[_0xe20b('0x8')],{'host':_0xe20b('0xa'),'port':0x18eb});var io=require(_0xe20b('0xb'))(new Redis(config['redis']));function getAdminId(_0x2135c2,_0x581a7c,_0x213c66,_0x547be6){return new Promise(function(_0x18d841,_0x22a3fa){var _0x43a484=![];var _0x4c2e44={'method':_0xe20b('0xc'),'uri':_0x547be6+'/api/selector/owners','json':!![]};_0x4c2e44[_0xe20b('0xd')]=_0x213c66;logger[_0xe20b('0xe')](_0xe20b('0xf'));return rp(_0x4c2e44)['then'](function(_0xa393ed){if(_0xa393ed){var _0x5d22da=_0xa393ed[_0xe20b('0x10')];var _0x20783e=null;for(_0x20783e=0x0;_0x20783e<_0x5d22da[_0xe20b('0x11')];_0x20783e++){if(_0x5d22da[_0x20783e][_0xe20b('0x12')]===_0x2135c2[_0xe20b('0x13')]){_0x2135c2[_0xe20b('0x14')]=_0x5d22da[_0x20783e]['id'];_0x43a484=!![];}}if(_0x43a484){logger[_0xe20b('0xe')]('Admin\x20found:',_0x2135c2[_0xe20b('0x14')]);_0x18d841(_0x2135c2);}else{_0x22a3fa({'statusCode':0x194,'message':_0xe20b('0x15')});}}else{_0x22a3fa({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xe20b('0x16')](function(_0x3e01cc){logger[_0xe20b('0x17')]('['+[_0x581a7c['toUpperCase']()]+']',_0x3e01cc[_0xe20b('0x18')]);_0x22a3fa(_0x3e01cc);});});}function getUser(_0xc62d3d,_0x24b882,_0x245325){return function(_0x28391b){return new Promise(function(_0x5baf6c,_0x2d0b15){var _0xfe1dbd={'method':_0xe20b('0xc'),'uri':_0x245325+_0xe20b('0x19'),'json':!![]};_0xfe1dbd['headers']=_0x24b882;logger[_0xe20b('0xe')](_0xe20b('0x1a'));return rp(_0xfe1dbd)[_0xe20b('0x1b')](function(_0x5e2be2){if(_0x5e2be2){var _0x539f54=_0x5e2be2[_0xe20b('0x10')];var _0x494972=![];var _0xc8dee7=null;if(_0x28391b[_0xe20b('0x1c')]!==null){logger[_0xe20b('0xe')]('Getting\x20user\x20with\x20email',_0x28391b[_0xe20b('0x1c')]);_0x28391b[_0xe20b('0x1d')]=_0x28391b[_0xe20b('0x1c')];for(_0xc8dee7=0x0;_0xc8dee7<_0x539f54[_0xe20b('0x11')];_0xc8dee7++){if(_0x539f54[_0xc8dee7]['email']===_0x28391b[_0xe20b('0x1c')]){_0x494972=!![];_0x28391b[_0xe20b('0x1e')]=_0x539f54[_0xc8dee7]['id'];logger[_0xe20b('0xe')](_0xe20b('0x1f'),_0x28391b['userId']);}}}if(!_0x494972){logger[_0xe20b('0xe')](_0xe20b('0x20'));_0x28391b[_0xe20b('0x1d')]=_0x28391b['adminEmail'];_0x28391b[_0xe20b('0x1e')]=_0x28391b[_0xe20b('0x14')];_0x494972=!![];}if(_0x494972){_0x5baf6c(_0x28391b);}else{_0x2d0b15({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2d0b15({'statusCode':0x194,'message':_0xe20b('0x15')});}})[_0xe20b('0x16')](function(_0x16deb8){logger['error']('['+[_0xc62d3d[_0xe20b('0x21')]()]+']',_0x16deb8[_0xe20b('0x18')]);_0x2d0b15(_0x16deb8);});});};}function searchContact(_0x352812,_0x1c34f8,_0x3217b7,_0x5259a4){return new Promise(function(_0x214189,_0x18cf47){var _0x3abee0={'method':_0xe20b('0xc'),'headers':_0x1c34f8,'uri':_0x352812+_0xe20b('0x22')+_0x5259a4+_0xe20b('0x23')+_0x3217b7+'&entities=contact','json':!![]};rp(_0x3abee0)['then'](function(_0x12d32d){var _0x215b54=_[_0xe20b('0x24')](_0x12d32d[_0xe20b('0x25')][_0xe20b('0x25')],[_0x3217b7,_0x5259a4]);_0x214189(_0x215b54);})[_0xe20b('0x16')](function(_0xd882a3){_0x18cf47(_0xd882a3);});});}function getEndUser(_0x4ac325,_0x38080a,_0x12305b){return function(_0x3f65ae){return new Promise(function(_0x14989f,_0x213639){logger[_0xe20b('0xe')](util[_0xe20b('0x26')](_0xe20b('0x27'),_0x3f65ae[_0xe20b('0x28')]));searchContact(_0x12305b,_0x38080a,'mobile_number',_0x3f65ae['contactNumber'])['then'](function(_0x5e74ea){if(_0x5e74ea){_0x3f65ae[_0xe20b('0x29')]=_0x5e74ea['id'];logger[_0xe20b('0xe')](_0xe20b('0x2a'),_0x3f65ae[_0xe20b('0x29')]);return _0x14989f(_0x3f65ae);}searchContact(_0x12305b,_0x38080a,'work_number',_0x3f65ae[_0xe20b('0x28')])[_0xe20b('0x1b')](function(_0x225760){if(_0x225760){_0x3f65ae[_0xe20b('0x29')]=_0x225760['id'];logger[_0xe20b('0xe')]('Contact\x20found\x20work_number:',_0x3f65ae['endUserId']);return _0x14989f(_0x3f65ae);}createEndUser(_0x3f65ae,_0x4ac325,_0x38080a,_0x12305b)[_0xe20b('0x1b')](function(_0x146246){logger[_0xe20b('0xe')](_0xe20b('0x2b'),_0x146246[_0xe20b('0x29')]);return _0x14989f(_0x146246);});});})[_0xe20b('0x16')](function(_0x12975f){_0x213639(_0x12975f);});});};}function createEndUser(_0x2f17b1,_0x371f1b,_0x447fd2,_0x3059d8){return new Promise(function(_0x346c12,_0x2af2f9){var _0x57ab96=moment();var _0x2aca43={'method':_0xe20b('0x2c'),'uri':_0x3059d8+_0xe20b('0x2d'),'body':{'contact':{'last_name':_0x2f17b1['contactNumber'],'work_number':_0x2f17b1[_0xe20b('0x28')],'mobile_number':_0x2f17b1[_0xe20b('0x28')],'owner_id':_0x2f17b1[_0xe20b('0x1e')],'created_at':_0x57ab96[_0xe20b('0x26')](_0xe20b('0x2e'))}},'json':!![]};_0x2aca43[_0xe20b('0xd')]=_0x447fd2;logger[_0xe20b('0xe')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x2aca43)[_0xe20b('0x1b')](function(_0xae5c06){_0x2f17b1['endUserId']=_0xae5c06[_0xe20b('0x2f')]['id'];_0x346c12(_0x2f17b1);})[_0xe20b('0x16')](function(_0x28326b){logger[_0xe20b('0x17')]('['+[_0x371f1b['toUpperCase']()]+']',_0x28326b[_0xe20b('0x18')]);_0x2af2f9(_0x28326b[_0xe20b('0x18')]);});});}function getTicket(_0x1ffde2,_0xc4f1d4,_0x8172b4,_0x55d4a3,_0x1f6845){return function(_0x2d45f2){logger['info'](_0xe20b('0x30'));return new Promise(function(_0x287cbb,_0x5e5dbf){var _0x3d84d1=moment();var _0x108345={'method':_0xe20b('0x2c'),'uri':_0x8172b4+_0xe20b('0x31'),'body':{'title':intUtil['getString'](_0x55d4a3['Subjects'],_0x1f6845,'\x20'),'description':intUtil[_0xe20b('0x32')](_0x55d4a3[_0xe20b('0x33')],_0x1f6845,'\x0a'),'owner_id':_0x2d45f2[_0xe20b('0x1e')],'creater_id':_0x2d45f2['adminId'],'targetable_id':_0x2d45f2[_0xe20b('0x29')],'targetable_type':'Contact','created_at':_0x3d84d1[_0xe20b('0x26')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x3d84d1[_0xe20b('0x34')](0x1e,'m')[_0xe20b('0x26')](_0xe20b('0x2e'))},'json':!![]};_0x108345[_0xe20b('0xd')]=_0xc4f1d4;return rp(_0x108345)[_0xe20b('0x1b')](function(_0xe6d3d3){_0x2d45f2['ticketId']=_0xe6d3d3['task']['id'];logger[_0xe20b('0xe')](_0xe20b('0x35'),_0x2d45f2[_0xe20b('0x36')]);_0x287cbb(_0x2d45f2);})['catch'](function(_0x37fe33){logger[_0xe20b('0x17')]('['+[_0x1ffde2[_0xe20b('0x21')]()]+']',_0x37fe33['message']);_0x5e5dbf(_0x37fe33['message']);});});};}function emit(_0x2914e4,_0x4c9f1d,_0x35cbfa){var _0x3107ff={'uri':_0x2914e4+'/contacts/'+_0x35cbfa};io['to'](util[_0xe20b('0x26')]('user:%s',_0x4c9f1d))[_0xe20b('0x37')](_0xe20b('0x38'),_0x3107ff);}exports['cs']=function(_0x32b0d9,_0x1ff942,_0x1ac9a4,_0x2e119c,_0x3b31bc,_0x4e1946,_0x337f1a,_0x184c14){var _0x51c430={};var _0x85a737={'Authorization':'Token\x20token='+_0x4e1946[_0xe20b('0x39')]};_0x4e1946[_0xe20b('0x3a')]=intUtil['stripTrailingSlash'](_0x4e1946[_0xe20b('0x3a')]);_0x4e1946[_0xe20b('0x3b')]=intUtil[_0xe20b('0x3c')](_0x4e1946[_0xe20b('0x3b')]);var _0x14dd15=_0x4e1946['remoteUri'];_0x51c430[_0xe20b('0x13')]=_0x4e1946[_0xe20b('0x3d')];_0x51c430[_0xe20b('0x28')]=_0x184c14[_0xe20b('0x3e')]()===_0xe20b('0x3f')?_0x1ff942[_0xe20b('0x40')]:_0x1ff942[_0xe20b('0x41')];_0x51c430[_0xe20b('0x42')]=_0x184c14===_0xe20b('0x43')||_0x184c14===_0xe20b('0x44')?_0xe20b('0x43'):_0xe20b('0x3f');if(_0x2e119c){_0x51c430[_0xe20b('0x1c')]=_0x2e119c[_0xe20b('0x12')];}var _0x53d344=util[_0xe20b('0x26')](_0xe20b('0x45'),_0x4e1946[_0xe20b('0x3b')],_0x1ff942[_0xe20b('0x46')],md5(_0x1ff942[_0xe20b('0x46')]));if(_0x3b31bc&&_0x3b31bc[_0xe20b('0x47')]){logger[_0xe20b('0xe')](_0xe20b('0x48'),'Recording\x20is\x20enabled!');_0x1ff942['recordingURL']=_0x53d344;}else if(_0x337f1a&&_0x337f1a[_0xe20b('0x49')]&&_0x337f1a[_0xe20b('0x49')]!==_0xe20b('0x4a')){logger[_0xe20b('0xe')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1ff942[_0xe20b('0x4b')]=_0x53d344;}else{_0x1ff942[_0xe20b('0x4b')]='';}return getAdminId(_0x51c430,_0x184c14,_0x85a737,_0x14dd15)[_0xe20b('0x1b')](getUser(_0x184c14,_0x85a737,_0x14dd15))[_0xe20b('0x1b')](getEndUser(_0x184c14,_0x85a737,_0x14dd15))[_0xe20b('0x1b')](getTicket(_0x184c14,_0x85a737,_0x14dd15,_0x1ac9a4,_0x1ff942))[_0xe20b('0x1b')](function(_0x425399){logger[_0xe20b('0xe')](util[_0xe20b('0x26')](_0xe20b('0x4c'),_0x425399[_0xe20b('0x36')]));if(_0x184c14!==_0xe20b('0x44')){logger[_0xe20b('0xe')]('['+[_0x184c14[_0xe20b('0x21')]()]+']',_0xe20b('0x4d'));emit(_0x14dd15,_0x2e119c['name'],_0x425399[_0xe20b('0x29')]);}})[_0xe20b('0x16')](function(_0x41e1d2){logger['error']('['+[_0x184c14[_0xe20b('0x21')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x41e1d2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xecbf=['contact','message','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xecbf,0x18b));var _0xfecb=function(_0x3e8f28,_0x37aab6){_0x3e8f28=_0x3e8f28-0x0;var _0x112c27=_0xecbf[_0x3e8f28];return _0x112c27;};'use strict';var _=require(_0xfecb('0x0'));var rp=require(_0xfecb('0x1'));var md5=require('md5');var util=require(_0xfecb('0x2'));var moment=require(_0xfecb('0x3'));var Promise=require(_0xfecb('0x4'));var Redis=require(_0xfecb('0x5'));var intUtil=require('./util');var config=require(_0xfecb('0x6'));var logger=require(_0xfecb('0x7'))(_0xfecb('0x8'));config['redis']=_['defaults'](config[_0xfecb('0x9')],{'host':_0xfecb('0xa'),'port':0x18eb});var io=require(_0xfecb('0xb'))(new Redis(config[_0xfecb('0x9')]));function getAdminId(_0x4d3551,_0x461fc6,_0x44b80f,_0x250376){return new Promise(function(_0x1af53e,_0x475e34){var _0x1c2252=![];var _0x1e5260={'method':_0xfecb('0xc'),'uri':_0x250376+'/api/selector/owners','json':!![]};_0x1e5260[_0xfecb('0xd')]=_0x44b80f;logger[_0xfecb('0xe')](_0xfecb('0xf'));return rp(_0x1e5260)[_0xfecb('0x10')](function(_0x5173e0){if(_0x5173e0){var _0x38e63b=_0x5173e0['users'];var _0xf8dcb3=null;for(_0xf8dcb3=0x0;_0xf8dcb3<_0x38e63b[_0xfecb('0x11')];_0xf8dcb3++){if(_0x38e63b[_0xf8dcb3][_0xfecb('0x12')]===_0x4d3551[_0xfecb('0x13')]){_0x4d3551['adminId']=_0x38e63b[_0xf8dcb3]['id'];_0x1c2252=!![];}}if(_0x1c2252){logger[_0xfecb('0xe')](_0xfecb('0x14'),_0x4d3551[_0xfecb('0x15')]);_0x1af53e(_0x4d3551);}else{_0x475e34({'statusCode':0x194,'message':_0xfecb('0x16')});}}else{_0x475e34({'statusCode':0x194,'message':_0xfecb('0x16')});}})[_0xfecb('0x17')](function(_0x3c1abe){logger[_0xfecb('0x18')]('['+[_0x461fc6[_0xfecb('0x19')]()]+']',_0x3c1abe['message']);_0x475e34(_0x3c1abe);});});}function getUser(_0x375aa5,_0x3deae9,_0x1b77fd){return function(_0x42eb1d){return new Promise(function(_0x7685f8,_0x542e30){var _0x13b974={'method':_0xfecb('0xc'),'uri':_0x1b77fd+'/api/selector/owners','json':!![]};_0x13b974[_0xfecb('0xd')]=_0x3deae9;logger[_0xfecb('0xe')](_0xfecb('0x1a'));return rp(_0x13b974)[_0xfecb('0x10')](function(_0x3f1c09){if(_0x3f1c09){var _0x30d98=_0x3f1c09[_0xfecb('0x1b')];var _0x281ba4=![];var _0x3d4e7e=null;if(_0x42eb1d[_0xfecb('0x1c')]!==null){logger[_0xfecb('0xe')](_0xfecb('0x1d'),_0x42eb1d['agentEmail']);_0x42eb1d[_0xfecb('0x1e')]=_0x42eb1d[_0xfecb('0x1c')];for(_0x3d4e7e=0x0;_0x3d4e7e<_0x30d98['length'];_0x3d4e7e++){if(_0x30d98[_0x3d4e7e][_0xfecb('0x12')]===_0x42eb1d[_0xfecb('0x1c')]){_0x281ba4=!![];_0x42eb1d[_0xfecb('0x1f')]=_0x30d98[_0x3d4e7e]['id'];logger[_0xfecb('0xe')](_0xfecb('0x20'),_0x42eb1d['userId']);}}}if(!_0x281ba4){logger[_0xfecb('0xe')](_0xfecb('0x21'));_0x42eb1d[_0xfecb('0x1e')]=_0x42eb1d[_0xfecb('0x13')];_0x42eb1d['userId']=_0x42eb1d[_0xfecb('0x15')];_0x281ba4=!![];}if(_0x281ba4){_0x7685f8(_0x42eb1d);}else{_0x542e30({'statusCode':0x194,'message':_0xfecb('0x16')});}}else{_0x542e30({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xfecb('0x17')](function(_0x5a8d1a){logger['error']('['+[_0x375aa5[_0xfecb('0x19')]()]+']',_0x5a8d1a['message']);_0x542e30(_0x5a8d1a);});});};}function searchContact(_0x23a618,_0x3dd522,_0x538451,_0x33b9d5){return new Promise(function(_0x5d4331,_0x81a33c){var _0x59f447={'method':'GET','headers':_0x3dd522,'uri':_0x23a618+_0xfecb('0x22')+_0x33b9d5+_0xfecb('0x23')+_0x538451+_0xfecb('0x24'),'json':!![]};rp(_0x59f447)[_0xfecb('0x10')](function(_0x1dbd02){var _0x318caa=_[_0xfecb('0x25')](_0x1dbd02[_0xfecb('0x26')][_0xfecb('0x26')],[_0x538451,_0x33b9d5]);_0x5d4331(_0x318caa);})[_0xfecb('0x17')](function(_0x521987){_0x81a33c(_0x521987);});});}function getEndUser(_0x5a8a3e,_0x447b4f,_0x475bea){return function(_0x353146){return new Promise(function(_0x3f1418,_0x370487){logger[_0xfecb('0xe')](util[_0xfecb('0x27')]('Searching\x20contact\x20with\x20phone\x20%s',_0x353146[_0xfecb('0x28')]));searchContact(_0x475bea,_0x447b4f,_0xfecb('0x29'),_0x353146['contactNumber'])['then'](function(_0x222802){if(_0x222802){_0x353146[_0xfecb('0x2a')]=_0x222802['id'];logger[_0xfecb('0xe')]('Contact\x20found\x20mobile_number:',_0x353146[_0xfecb('0x2a')]);return _0x3f1418(_0x353146);}searchContact(_0x475bea,_0x447b4f,_0xfecb('0x2b'),_0x353146[_0xfecb('0x28')])['then'](function(_0x157ac5){if(_0x157ac5){_0x353146['endUserId']=_0x157ac5['id'];logger[_0xfecb('0xe')](_0xfecb('0x2c'),_0x353146[_0xfecb('0x2a')]);return _0x3f1418(_0x353146);}createEndUser(_0x353146,_0x5a8a3e,_0x447b4f,_0x475bea)[_0xfecb('0x10')](function(_0x37a8de){logger[_0xfecb('0xe')](_0xfecb('0x2d'),_0x37a8de[_0xfecb('0x2a')]);return _0x3f1418(_0x37a8de);});});})['catch'](function(_0x1b99d2){_0x370487(_0x1b99d2);});});};}function createEndUser(_0x1f021c,_0x15fb55,_0x44815e,_0x2231f7){return new Promise(function(_0x3f8871,_0x5c5144){var _0x34a6de=moment();var _0x504863={'method':_0xfecb('0x2e'),'uri':_0x2231f7+_0xfecb('0x2f'),'body':{'contact':{'last_name':_0x1f021c[_0xfecb('0x28')],'work_number':_0x1f021c['contactNumber'],'mobile_number':_0x1f021c[_0xfecb('0x28')],'owner_id':_0x1f021c['userId'],'created_at':_0x34a6de[_0xfecb('0x27')](_0xfecb('0x30'))}},'json':!![]};_0x504863[_0xfecb('0xd')]=_0x44815e;logger[_0xfecb('0xe')](_0xfecb('0x31'));return rp(_0x504863)[_0xfecb('0x10')](function(_0xad5927){_0x1f021c[_0xfecb('0x2a')]=_0xad5927[_0xfecb('0x32')]['id'];_0x3f8871(_0x1f021c);})[_0xfecb('0x17')](function(_0x1b17af){logger[_0xfecb('0x18')]('['+[_0x15fb55[_0xfecb('0x19')]()]+']',_0x1b17af[_0xfecb('0x33')]);_0x5c5144(_0x1b17af[_0xfecb('0x33')]);});});}function getTicket(_0x1601b4,_0x16f400,_0x44a7b7,_0x206ad5,_0x1a24bb){return function(_0xa9c985){logger[_0xfecb('0xe')](_0xfecb('0x34'));return new Promise(function(_0x449621,_0x277169){var _0x110038=moment();var _0x1c0ba8={'method':_0xfecb('0x2e'),'uri':_0x44a7b7+_0xfecb('0x35'),'body':{'title':intUtil[_0xfecb('0x36')](_0x206ad5[_0xfecb('0x37')],_0x1a24bb,'\x20'),'description':intUtil[_0xfecb('0x36')](_0x206ad5[_0xfecb('0x38')],_0x1a24bb,'\x0a'),'owner_id':_0xa9c985[_0xfecb('0x1f')],'creater_id':_0xa9c985[_0xfecb('0x15')],'targetable_id':_0xa9c985[_0xfecb('0x2a')],'targetable_type':_0xfecb('0x39'),'created_at':_0x110038[_0xfecb('0x27')](_0xfecb('0x30')),'due_date':_0x110038['add'](0x1e,'m')[_0xfecb('0x27')](_0xfecb('0x30'))},'json':!![]};_0x1c0ba8[_0xfecb('0xd')]=_0x16f400;return rp(_0x1c0ba8)['then'](function(_0x435e01){_0xa9c985['ticketId']=_0x435e01[_0xfecb('0x3a')]['id'];logger[_0xfecb('0xe')](_0xfecb('0x3b'),_0xa9c985[_0xfecb('0x3c')]);_0x449621(_0xa9c985);})[_0xfecb('0x17')](function(_0x33a40a){logger[_0xfecb('0x18')]('['+[_0x1601b4['toUpperCase']()]+']',_0x33a40a[_0xfecb('0x33')]);_0x277169(_0x33a40a[_0xfecb('0x33')]);});});};}function emit(_0x24d4f9,_0x406829,_0x4992c8){var _0x19a1cd={'uri':_0x24d4f9+_0xfecb('0x3d')+_0x4992c8};io['to'](util[_0xfecb('0x27')](_0xfecb('0x3e'),_0x406829))[_0xfecb('0x3f')](_0xfecb('0x40'),_0x19a1cd);}exports['cs']=function(_0x263552,_0x3f46db,_0x3b8b0c,_0x5c8bdd,_0x161363,_0x41424c,_0x2e8e8b,_0x28b5fd){var _0x416577={};var _0x523d1e={'Authorization':_0xfecb('0x41')+_0x41424c[_0xfecb('0x42')]};_0x41424c[_0xfecb('0x43')]=intUtil[_0xfecb('0x44')](_0x41424c['remoteUri']);_0x41424c[_0xfecb('0x45')]=intUtil[_0xfecb('0x44')](_0x41424c['serverUrl']);var _0x8d3af3=_0x41424c[_0xfecb('0x43')];_0x416577[_0xfecb('0x13')]=_0x41424c[_0xfecb('0x46')];_0x416577['contactNumber']=_0x28b5fd[_0xfecb('0x47')]()===_0xfecb('0x48')?_0x3f46db['destcalleridnum']:_0x3f46db[_0xfecb('0x49')];_0x416577[_0xfecb('0x4a')]=_0x28b5fd==='queue'||_0x28b5fd==='unmanaged'?_0xfecb('0x4b'):_0xfecb('0x48');if(_0x5c8bdd){_0x416577[_0xfecb('0x1c')]=_0x5c8bdd[_0xfecb('0x12')];}var _0x40deeb=util[_0xfecb('0x27')](_0xfecb('0x4c'),_0x41424c[_0xfecb('0x45')],_0x3f46db[_0xfecb('0x4d')],md5(_0x3f46db[_0xfecb('0x4d')]));if(_0x161363&&_0x161363[_0xfecb('0x4e')]){logger[_0xfecb('0xe')]('[QUEUE]',_0xfecb('0x4f'));_0x3f46db[_0xfecb('0x50')]=_0x40deeb;}else if(_0x2e8e8b&&_0x2e8e8b['recordingFormat']&&_0x2e8e8b[_0xfecb('0x51')]!==_0xfecb('0x52')){logger['info'](_0xfecb('0x53'),'Recording\x20is\x20enabled!');_0x3f46db[_0xfecb('0x50')]=_0x40deeb;}else{_0x3f46db['recordingURL']='';}return getAdminId(_0x416577,_0x28b5fd,_0x523d1e,_0x8d3af3)[_0xfecb('0x10')](getUser(_0x28b5fd,_0x523d1e,_0x8d3af3))[_0xfecb('0x10')](getEndUser(_0x28b5fd,_0x523d1e,_0x8d3af3))[_0xfecb('0x10')](getTicket(_0x28b5fd,_0x523d1e,_0x8d3af3,_0x3b8b0c,_0x3f46db))[_0xfecb('0x10')](function(_0x1e7bea){logger[_0xfecb('0xe')](util[_0xfecb('0x27')](_0xfecb('0x54'),_0x1e7bea['ticketId']));if(_0x28b5fd!=='unmanaged'){logger[_0xfecb('0xe')]('['+[_0x28b5fd[_0xfecb('0x19')]()]+']',_0xfecb('0x55'));emit(_0x8d3af3,_0x5c8bdd[_0xfecb('0x56')],_0x1e7bea[_0xfecb('0x2a')]);}})[_0xfecb('0x17')](function(_0x2f52dc){logger['error']('['+[_0x28b5fd[_0xfecb('0x19')]()]+_0xfecb('0x57'),util[_0xfecb('0x58')](_0x2f52dc,{'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 210d235..7cf9cdb 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 _0x1b0b=['./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find','data3','queue','routeId','EVENT\x20UNKNOWN','unmanaged','zendesk','salesforce','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','./zendesk'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1b0b,0x1c7));var _0xb1b0=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x1b0b[_0x2235bf];return _0x4c3a64;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0xb1b0('0x0'));var salesforce=require(_0xb1b0('0x1'));var sugarcrm=require(_0xb1b0('0x2'));var freshdesk=require(_0xb1b0('0x3'));var zoho=require(_0xb1b0('0x4'));var desk=require(_0xb1b0('0x5'));var vtiger=require(_0xb1b0('0x6'));var servicenow=require(_0xb1b0('0x7'));var dynamics365=require(_0xb1b0('0x8'));var freshsales=require(_0xb1b0('0x9'));var integrations=['zendesk','salesforce',_0xb1b0('0xa'),_0xb1b0('0xb'),_0xb1b0('0xc'),_0xb1b0('0xd'),_0xb1b0('0xe'),_0xb1b0('0xf'),_0xb1b0('0x10'),_0xb1b0('0x11')];exports[_0xb1b0('0x12')]=function(_0x3b82db,_0x4f9267,_0x333dec,_0x251f04,_0x4a5e81,_0x2f4cf6){if(_0x333dec){if(_[_0xb1b0('0x13')](integrations,_0x3b82db[_0xb1b0('0x14')][_0xb1b0('0x15')]())){try{var _0x176054=null;var _0x4fff67='';var _0x5eafe4=_0x333dec[_0x3b82db[_0xb1b0('0x14')]['toLowerCase']()];if(_0x5eafe4){var _0x308915=_0x5eafe4[_0x3b82db['data2']];if(_0x308915){var _0x3362b4=_[_0xb1b0('0x16')](_0x308915['Configurations'],{'id':parseInt(_0x3b82db[_0xb1b0('0x17')],0xa)});if(_0x3362b4){if(_0x251f04){if(_0x4a5e81&&_0x4f9267[_0xb1b0('0x18')]){_0x4fff67=_0xb1b0('0x18');}else if(_0x4f9267[_0xb1b0('0x19')]){_0x4fff67='outbound';}else{console['log'](_0xb1b0('0x1a'),_0x4f9267);}}else{_0x4fff67=_0xb1b0('0x1b');}switch(_0x3b82db[_0xb1b0('0x14')][_0xb1b0('0x15')]()){case _0xb1b0('0x1c'):zendesk[_0x4fff67](_0x3b82db,_0x4f9267,_0x3362b4,_0x251f04,_0x4a5e81,_0x308915,_0x2f4cf6);break;case _0xb1b0('0x1d'):salesforce[_0x4fff67](_0x3b82db,_0x4f9267,_0x3362b4,_0x251f04,_0x4a5e81,_0x308915,_0x2f4cf6);break;case'sugarcrm':sugarcrm[_0x4fff67](_0x3b82db,_0x4f9267,_0x3362b4,_0x251f04,_0x4a5e81,_0x308915,_0x2f4cf6);break;case _0xb1b0('0xb'):freshdesk[_0x4fff67](_0x3b82db,_0x4f9267,_0x3362b4,_0x251f04,_0x4a5e81,_0x308915,_0x2f4cf6);break;case _0xb1b0('0xc'):zoho[_0x4fff67](_0x3b82db,_0x4f9267,_0x3362b4,_0x251f04,_0x4a5e81,_0x308915,_0x2f4cf6);break;case _0xb1b0('0xd'):desk[_0x4fff67](_0x3b82db,_0x4f9267,_0x3362b4,_0x251f04,_0x4a5e81,_0x308915,_0x2f4cf6);break;case _0xb1b0('0xe'):vtiger[_0x4fff67](_0x3b82db,_0x4f9267,_0x3362b4,_0x251f04,_0x4a5e81,_0x308915,_0x2f4cf6);break;case _0xb1b0('0x10'):freshsales['cs'](_0x3b82db,_0x4f9267,_0x3362b4,_0x251f04,_0x4a5e81,_0x308915,_0x2f4cf6,_0x4fff67);break;case'servicenow':servicenow['cs'](_0x3b82db,_0x4f9267,_0x3362b4,_0x251f04,_0x4a5e81,_0x308915,_0x2f4cf6,_0x4fff67);break;case _0xb1b0('0xf'):dynamics365['cs'](_0x3b82db,_0x4f9267,_0x3362b4,_0x251f04,_0x4a5e81,_0x308915,_0x2f4cf6,_0x4fff67);break;default:console[_0xb1b0('0x1e')](_0xb1b0('0x1f'));}}else{_0x176054=require(_0xb1b0('0x20'))(_0x3b82db[_0xb1b0('0x14')][_0xb1b0('0x15')]());_0x176054[_0xb1b0('0x21')](_0xb1b0('0x22'),util[_0xb1b0('0x23')](_0xb1b0('0x24'),_0x3b82db['data1']['toLowerCase'](),_0x3b82db['data3']));}}else{_0x176054=require(_0xb1b0('0x20'))(_0x3b82db[_0xb1b0('0x14')][_0xb1b0('0x15')]());_0x176054[_0xb1b0('0x21')](_0xb1b0('0x22'),util['format'](_0xb1b0('0x25'),_0x3b82db[_0xb1b0('0x14')][_0xb1b0('0x15')](),_0x3b82db['data2']));}}else{}}catch(_0x253646){console[_0xb1b0('0x21')](_0x253646);}}}}; \ No newline at end of file +var _0x2515=['desk','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','Configurations','data3','queue','outbound','log','unmanaged','zendesk','sugarcrm','zoho','vtiger','freshsales','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./freshdesk','./zoho','./vtiger','./dynamics365','./freshsales','salesforce','freshdesk'];(function(_0x4f32bf,_0x2e0128){var _0x552f63=function(_0x41888c){while(--_0x41888c){_0x4f32bf['push'](_0x4f32bf['shift']());}};_0x552f63(++_0x2e0128);}(_0x2515,0x1ca));var _0x5251=function(_0x20a74e,_0x26c09d){_0x20a74e=_0x20a74e-0x0;var _0x513e0f=_0x2515[_0x20a74e];return _0x513e0f;};'use strict';var _=require(_0x5251('0x0'));var util=require(_0x5251('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x5251('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x5251('0x3'));var zoho=require(_0x5251('0x4'));var desk=require('./desk');var vtiger=require(_0x5251('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x5251('0x6'));var freshsales=require(_0x5251('0x7'));var integrations=['zendesk',_0x5251('0x8'),'sugarcrm',_0x5251('0x9'),'zoho',_0x5251('0xa'),'vtiger',_0x5251('0xb'),'freshsales',_0x5251('0xc')];exports[_0x5251('0xd')]=function(_0x436013,_0x10314d,_0x86f88d,_0x385d3a,_0xb66d,_0x547eb6){if(_0x86f88d){if(_[_0x5251('0xe')](integrations,_0x436013[_0x5251('0xf')]['toLowerCase']())){try{var _0x12a3f1=null;var _0x1d40aa='';var _0x3efec8=_0x86f88d[_0x436013[_0x5251('0xf')][_0x5251('0x10')]()];if(_0x3efec8){var _0x2ff1e3=_0x3efec8[_0x436013[_0x5251('0x11')]];if(_0x2ff1e3){var _0x1eb8f8=_['find'](_0x2ff1e3[_0x5251('0x12')],{'id':parseInt(_0x436013[_0x5251('0x13')],0xa)});if(_0x1eb8f8){if(_0x385d3a){if(_0xb66d&&_0x10314d['queue']){_0x1d40aa=_0x5251('0x14');}else if(_0x10314d['routeId']){_0x1d40aa=_0x5251('0x15');}else{console[_0x5251('0x16')]('EVENT\x20UNKNOWN',_0x10314d);}}else{_0x1d40aa=_0x5251('0x17');}switch(_0x436013[_0x5251('0xf')][_0x5251('0x10')]()){case _0x5251('0x18'):zendesk[_0x1d40aa](_0x436013,_0x10314d,_0x1eb8f8,_0x385d3a,_0xb66d,_0x2ff1e3,_0x547eb6);break;case _0x5251('0x8'):salesforce[_0x1d40aa](_0x436013,_0x10314d,_0x1eb8f8,_0x385d3a,_0xb66d,_0x2ff1e3,_0x547eb6);break;case _0x5251('0x19'):sugarcrm[_0x1d40aa](_0x436013,_0x10314d,_0x1eb8f8,_0x385d3a,_0xb66d,_0x2ff1e3,_0x547eb6);break;case'freshdesk':freshdesk[_0x1d40aa](_0x436013,_0x10314d,_0x1eb8f8,_0x385d3a,_0xb66d,_0x2ff1e3,_0x547eb6);break;case _0x5251('0x1a'):zoho[_0x1d40aa](_0x436013,_0x10314d,_0x1eb8f8,_0x385d3a,_0xb66d,_0x2ff1e3,_0x547eb6);break;case _0x5251('0xa'):desk[_0x1d40aa](_0x436013,_0x10314d,_0x1eb8f8,_0x385d3a,_0xb66d,_0x2ff1e3,_0x547eb6);break;case _0x5251('0x1b'):vtiger[_0x1d40aa](_0x436013,_0x10314d,_0x1eb8f8,_0x385d3a,_0xb66d,_0x2ff1e3,_0x547eb6);break;case _0x5251('0x1c'):freshsales['cs'](_0x436013,_0x10314d,_0x1eb8f8,_0x385d3a,_0xb66d,_0x2ff1e3,_0x547eb6,_0x1d40aa);break;case _0x5251('0xc'):servicenow['cs'](_0x436013,_0x10314d,_0x1eb8f8,_0x385d3a,_0xb66d,_0x2ff1e3,_0x547eb6,_0x1d40aa);break;case _0x5251('0xb'):dynamics365['cs'](_0x436013,_0x10314d,_0x1eb8f8,_0x385d3a,_0xb66d,_0x2ff1e3,_0x547eb6,_0x1d40aa);break;default:console[_0x5251('0x16')](_0x5251('0x1d'));}}else{_0x12a3f1=require(_0x5251('0x1e'))(_0x436013[_0x5251('0xf')]['toLowerCase']());_0x12a3f1[_0x5251('0x1f')]('[EXEC]',util[_0x5251('0x20')](_0x5251('0x21'),_0x436013[_0x5251('0xf')][_0x5251('0x10')](),_0x436013[_0x5251('0x13')]));}}else{_0x12a3f1=require(_0x5251('0x1e'))(_0x436013[_0x5251('0xf')]['toLowerCase']());_0x12a3f1[_0x5251('0x1f')](_0x5251('0x22'),util['format'](_0x5251('0x23'),_0x436013['data1'][_0x5251('0x10')](),_0x436013[_0x5251('0x11')]));}}else{}}catch(_0x29ee8f){console[_0x5251('0x1f')](_0x29ee8f);}}}}; \ 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 b4cf92b..f2a9497 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 _0x3099=['lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','length','cloneDeep','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Company','forEach','includes','string','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','newTab','trigger:browser:url','[OUTBOUND]','unmanaged','lastevent','toUpperCase','Fields',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','contact','account','WhatId','Case','endUserType','AccountId'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x3099,0xee));var _0x9309=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3099[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x9309('0x0'));var rp=require(_0x9309('0x1'));var moment=require(_0x9309('0x2'));var BPromise=require(_0x9309('0x3'));var md5=require(_0x9309('0x4'));var jsforce=require(_0x9309('0x5'));var util=require(_0x9309('0x6'));var Redis=require(_0x9309('0x7'));var intUtil=require(_0x9309('0x8'));var config=require(_0x9309('0x9'));var logger=require(_0x9309('0xa'))(_0x9309('0xb'));config['redis']=_[_0x9309('0xc')](config[_0x9309('0xd')],{'host':_0x9309('0xe'),'port':0x18eb});var io=require(_0x9309('0xf'))(new Redis(config[_0x9309('0xd')]));function emit(_0x4ebf85,_0x4e6c7e,_0x2545eb){io['to'](_0x4ebf85)[_0x9309('0x10')](_0x4e6c7e,_0x2545eb);}function getTicket(_0x58f394,_0x4d34a1,_0x48fd5b,_0x2cbb29,_0x57634b,_0x57fb44,_0x27913e,_0x28c6a7){var _0xb87881=Object[_0x9309('0x11')]({},{'OwnerId':_0x4d34a1['id'],'Subject':intUtil[_0x9309('0x12')](_0x2cbb29[_0x9309('0x13')],_0x57634b,'\x20'),'Description':intUtil[_0x9309('0x12')](_0x2cbb29[_0x9309('0x14')],_0x57634b,'\x0a')},getCustomFields(_0x57fb44,_0x57634b));if(_0x48fd5b){if(_0x2cbb29[_0x9309('0x15')]===_0x9309('0x16')){_0xb87881[_0x9309('0x17')]=moment['utc']();_0xb87881[_0x9309('0x18')]=![];_0xb87881[_0x9309('0x19')]=![];if(_0x48fd5b['endUserType']===_0x9309('0x1a')||_0x48fd5b['endUserType']==='lead'){_0xb87881['WhoId']=_0x48fd5b['id'];}else if(_0x48fd5b['endUserType']===_0x9309('0x1b')){_0xb87881[_0x9309('0x1c')]=_0x48fd5b['id'];}}else if(_0x2cbb29[_0x9309('0x15')]===_0x9309('0x1d')){if(_0x48fd5b[_0x9309('0x1e')]==='contact'){_0xb87881['ContactId']=_0x48fd5b['id'];}else if(_0x48fd5b[_0x9309('0x1e')]==='account'){_0xb87881[_0x9309('0x1f')]=_0x48fd5b['id'];}else if(_0x48fd5b['endUserType']===_0x9309('0x20')&&_0x2cbb29[_0x9309('0x21')]){_0xb87881[_0x2cbb29['leadId']]=_0x48fd5b['id'];}else{logger[_0x9309('0x22')](_0x9309('0x23'));}}}return _0x27913e[_0x9309('0x24')](_0x2cbb29[_0x9309('0x15')])[_0x9309('0x25')](_0xb87881);}function getUser(_0x325f93,_0xc96a0b,_0x3fecd3){if(!_[_0x9309('0x26')](_0xc96a0b)&&intUtil['validateEmail'](_0xc96a0b)){var _0x1835ae={'Email':_0xc96a0b};var _0x3c2e6b={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3fecd3['sobject']('User')[_0x9309('0x27')](_0x1835ae,_0x3c2e6b)[_0x9309('0x28')]()[_0x9309('0x29')](function(_0x1407fd){if(_0x1407fd['length']){var _0x24c29b=_[_0x9309('0x27')](_0x1407fd,function(_0x41434f){return _0x41434f[_0x9309('0x2a')]===_0xc96a0b;});if(_0x24c29b){logger[_0x9309('0x22')](_0x9309('0x2b'),_0xc96a0b);return BPromise[_0x9309('0x2c')]({'id':_0x24c29b['Id'],'name':_0x24c29b[_0x9309('0x2d')]});}}else{logger['info'](_0x9309('0x2e'),_0xc96a0b);return _0x3fecd3[_0x9309('0x2f')]()[_0x9309('0x29')](function(_0x48367d){return BPromise[_0x9309('0x2c')]({'id':_0x48367d['user_id'],'name':_0x48367d['display_name']});});}});}else{logger[_0x9309('0x22')](_0x9309('0x2e'),_0xc96a0b);return _0x3fecd3[_0x9309('0x2f')]()[_0x9309('0x29')](function(_0x40a158){return BPromise['resolve']({'id':_0x40a158[_0x9309('0x30')],'name':_0x40a158[_0x9309('0x31')]});});}}function getEndUser(_0x4d77fc,_0x22fb24,_0xde422b,_0x4fb285,_0xca59c1){var _0x23aebc={'$or':{'Phone':_0x4fb285}};var _0x4483b8={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x9309('0x2c')]()[_0x9309('0x29')](function(){logger['info'](_0x9309('0x32'),_0x4fb285,_0x22fb24['moduleSearch']);switch(_0x22fb24[_0x9309('0x33')]){case _0x9309('0x34'):var _0x52715d=_['cloneDeep'](_0x23aebc);if(_0x22fb24['additionalSearchContact']){var _0x353728={};_0x353728[_0x22fb24[_0x9309('0x35')]]=_0x4fb285;_[_0x9309('0x36')](_0x52715d[_0x9309('0x37')],_0x353728);}return _0xca59c1[_0x9309('0x24')](_0x9309('0x38'))['find'](_0x52715d,_0x4483b8)[_0x9309('0x28')]()[_0x9309('0x29')](function(_0x446f9f){if(_0x446f9f&&_0x446f9f[_0x9309('0x39')]){return _0x446f9f;}else{var _0x5e4176=_[_0x9309('0x3a')](_0x23aebc);if(_0x22fb24[_0x9309('0x3b')]){var _0x2c2815={};_0x2c2815[_0x22fb24['additionalSearchLead']]=_0x4fb285;_['merge'](_0x5e4176['$or'],_0x2c2815);}return _0xca59c1[_0x9309('0x24')]('Lead')[_0x9309('0x27')](_0x5e4176,_0x4483b8);}});case _0x9309('0x3c'):var _0x116660=_[_0x9309('0x3a')](_0x23aebc);if(_0x22fb24[_0x9309('0x3d')]){var _0x353728={};_0x353728[_0x22fb24[_0x9309('0x3d')]]=_0x4fb285;_[_0x9309('0x36')](_0x116660[_0x9309('0x37')],_0x353728);}return _0xca59c1[_0x9309('0x24')](_0x9309('0x3e'))[_0x9309('0x27')](_0x116660,_0x4483b8)[_0x9309('0x28')]()['then'](function(_0x180717){if(_0x180717&&_0x180717[_0x9309('0x39')]){return _0x180717;}else{var _0x271b3c=_[_0x9309('0x3a')](_0x23aebc);if(_0x22fb24[_0x9309('0x35')]){var _0x5380da={};_0x5380da[_0x22fb24['additionalSearchContact']]=_0x4fb285;_[_0x9309('0x36')](_0x271b3c[_0x9309('0x37')],_0x5380da);}return _0xca59c1[_0x9309('0x24')]('Contact')[_0x9309('0x27')](_0x271b3c,_0x4483b8)['then'](function(_0x210f2d){if(_0x210f2d&&_0x210f2d[_0x9309('0x39')]){return _0x210f2d;}else{var _0x49b6e7=_['cloneDeep'](_0x23aebc);if(_0x22fb24[_0x9309('0x3b')]){var _0x432f5a={};_0x432f5a[_0x22fb24[_0x9309('0x3b')]]=_0x4fb285;_[_0x9309('0x36')](_0x49b6e7[_0x9309('0x37')],_0x432f5a);}return _0xca59c1[_0x9309('0x24')](_0x9309('0x3f'))[_0x9309('0x27')](_0x49b6e7,_0x4483b8);}});}});case _0x9309('0x1a'):var _0x52715d=_['cloneDeep'](_0x23aebc);if(_0x22fb24[_0x9309('0x35')]){var _0x353728={};_0x353728[_0x22fb24[_0x9309('0x35')]]=_0x4fb285;_[_0x9309('0x36')](_0x52715d[_0x9309('0x37')],_0x353728);}return _0xca59c1[_0x9309('0x24')](_0x9309('0x38'))[_0x9309('0x27')](_0x52715d,_0x4483b8)['execute']();case _0x9309('0x20'):var _0x1fdbf2=_[_0x9309('0x3a')](_0x23aebc);if(_0x22fb24['additionalSearchLead']){var _0x353728={};_0x353728[_0x22fb24[_0x9309('0x3b')]]=_0x4fb285;_['merge'](_0x1fdbf2[_0x9309('0x37')],_0x353728);}return _0xca59c1[_0x9309('0x24')](_0x9309('0x3f'))[_0x9309('0x27')](_0x1fdbf2,_0x4483b8);case _0x9309('0x1b'):var _0x116660=_[_0x9309('0x3a')](_0x23aebc);if(_0x22fb24[_0x9309('0x3d')]){var _0x353728={};_0x353728[_0x22fb24[_0x9309('0x3d')]]=_0x4fb285;_[_0x9309('0x36')](_0x116660[_0x9309('0x37')],_0x353728);}return _0xca59c1[_0x9309('0x24')](_0x9309('0x3e'))[_0x9309('0x27')](_0x116660,_0x4483b8);default:return null;}})[_0x9309('0x29')](function(_0x54504d){if(_0x54504d&&_0x54504d[_0x9309('0x39')]){var _0x1a4c73=_['first'](_0x54504d);if(_0x1a4c73){return BPromise[_0x9309('0x2c')]({'id':_0x1a4c73['Id'],'name':_0x1a4c73[_0x9309('0x2d')],'phone':_0x1a4c73[_0x9309('0x40')],'endUserType':_0x1a4c73[_0x9309('0x41')]['type'][_0x9309('0x42')]()});}}})[_0x9309('0x29')](function(_0x34d24f){if(_0x34d24f){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x34d24f[_0x9309('0x1e')],_0x4fb285);return BPromise[_0x9309('0x2c')](_0x34d24f);}else{logger[_0x9309('0x22')](_0x9309('0x43'),_0x4fb285);var _0x4d8d35={'Phone':_0x4fb285};if(_0x22fb24[_0x9309('0x44')]){if(_0x22fb24[_0x9309('0x44')]===_0x9309('0x1a')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4fb285,_0x22fb24[_0x9309('0x44')]);_0x4d8d35['LastName']=_0xde422b!==_0x9309('0x45')?_0xde422b:util[_0x9309('0x46')](_0x9309('0x47'),_0x4fb285);}else if(_0x22fb24[_0x9309('0x44')]===_0x9309('0x20')){logger['info'](_0x9309('0x48'),_0x4fb285,_0x22fb24['moduleCreate']);_0x4d8d35[_0x9309('0x49')]=_0xde422b!==_0x9309('0x45')?_0xde422b:util['format'](_0x9309('0x47'),_0x4fb285);_0x4d8d35[_0x9309('0x4a')]='No\x20Company';}else if(_0x22fb24['moduleCreate']===_0x9309('0x1b')){logger[_0x9309('0x22')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4fb285,_0x22fb24[_0x9309('0x44')]);_0x4d8d35[_0x9309('0x2d')]=_0xde422b!==_0x9309('0x45')?_0xde422b:util[_0x9309('0x46')](_0x9309('0x47'),_0x4fb285);}else{return null;}}return _0xca59c1[_0x9309('0x24')](_['upperFirst'](_0x22fb24[_0x9309('0x44')]))['create'](_0x4d8d35)[_0x9309('0x29')](function(_0x231807){return BPromise[_0x9309('0x2c')]({'id':_0x231807['id'],'endUserType':_0x22fb24['moduleCreate']});});}});}function getCustomFields(_0x306ce5,_0x5a13b1){var _0xfd2396={};if(_0x306ce5[_0x9309('0x39')]>0x0){_[_0x9309('0x4b')](_0x306ce5,function(_0x41dd68){if(_[_0x9309('0x4c')]([_0x9309('0x4d'),_0x9309('0x4e')],_0x41dd68[_0x9309('0x4f')])&&_0x41dd68[_0x9309('0x50')]){_0xfd2396[_0x41dd68[_0x9309('0x50')]]=_0x41dd68[_0x9309('0x51')]['toString']();}else if(_0x41dd68[_0x9309('0x4f')]===_0x9309('0x52')&&_0x41dd68[_0x9309('0x53')]&&_0x41dd68[_0x9309('0x50')]){_0x5a13b1[_0x41dd68[_0x9309('0x53')]]&&(_0xfd2396[_0x41dd68[_0x9309('0x50')]]=_0x5a13b1[_0x41dd68[_0x9309('0x53')]][_0x9309('0x54')]());}else if(_0x41dd68['type']===_0x9309('0x55')&&_0x41dd68[_0x9309('0x56')]&&_0x41dd68['Variable'][_0x9309('0x57')]&&_0x41dd68[_0x9309('0x50')]){_0x5a13b1[_0x41dd68[_0x9309('0x56')]['name']['toLowerCase']()]&&(_0xfd2396[_0x41dd68['idField']]=_0x5a13b1[_0x41dd68[_0x9309('0x56')][_0x9309('0x57')]['toLowerCase']()][_0x9309('0x54')]());}});}return _0xfd2396;}function getConnection(_0x358a4e){var _0x10f5c6=_0x358a4e[_0x9309('0x58')][_0x9309('0x59')](_0x358a4e[_0x9309('0x5a')]);var _0xc19bae=new jsforce[(_0x9309('0x5b'))]({'oauth2':{'loginUrl':_0x358a4e[_0x9309('0x5c')]||_0x9309('0x5d'),'clientId':_0x358a4e[_0x9309('0x5e')],'clientSecret':_0x358a4e[_0x9309('0x5f')]}});return _0xc19bae[_0x9309('0x60')](_0x358a4e['username'],_0x10f5c6)[_0x9309('0x29')](function(){logger[_0x9309('0x22')](_0x9309('0x61'));return _0xc19bae;});}exports[_0x9309('0x62')]=function(_0x130db7,_0x223260,_0x4dc497,_0x455ed9,_0x226351,_0x1c6747){var _0x3e9264,_0x5cf6bc,_0x42b11a,_0x52694e;_0x1c6747[_0x9309('0x63')]=intUtil[_0x9309('0x64')](_0x1c6747[_0x9309('0x63')]);_0x1c6747[_0x9309('0x5c')]=intUtil['stripTrailingSlash'](_0x1c6747[_0x9309('0x5c')]);if(_0x226351&&_0x226351[_0x9309('0x65')]){logger[_0x9309('0x22')](_0x9309('0x66'),_0x9309('0x67'));_0x223260[_0x9309('0x68')]=util[_0x9309('0x46')](_0x9309('0x69'),_0x1c6747[_0x9309('0x63')],_0x223260[_0x9309('0x6a')],md5(_0x223260['uniqueid']));}else{_0x223260[_0x9309('0x68')]='';}return getConnection(_0x1c6747)[_0x9309('0x29')](function(_0x22ca31){_0x52694e=_0x22ca31;return getUser(_0x1c6747,_0x455ed9[_0x9309('0x6b')],_0x52694e);})[_0x9309('0x29')](function(_0x38e848){_0x3e9264=_0x38e848;return getEndUser(_0x1c6747,_0x4dc497,_0x223260[_0x9309('0x6c')],_0x223260[_0x9309('0x6d')],_0x52694e);})[_0x9309('0x29')](function(_0x5c4a03){_0x5cf6bc=_0x5c4a03;return getTicket(_0x1c6747,_0x3e9264,_0x5cf6bc,_0x4dc497,_0x223260,_0x4dc497['Fields'],_0x52694e,_0x9309('0x62'));})[_0x9309('0x29')](function(_0x161dc2){_0x42b11a=_0x161dc2;logger[_0x9309('0x22')](_0x9309('0x6e'),_0x42b11a['id']);logger['info'](_0x9309('0x6f'),_0x42b11a['id'],_0x455ed9['name'],_0x1c6747[_0x9309('0x4f')]);switch(_0x1c6747[_0x9309('0x4f')]){case'integrationTab':emit(util[_0x9309('0x46')](_0x9309('0x70'),_0x455ed9[_0x9309('0x57')]),_0x9309('0x71'),{'recordId':_0x42b11a['id']});break;case'newTab':emit(util[_0x9309('0x46')](_0x9309('0x70'),_0x455ed9['name']),'trigger:browser:url',{'uri':util[_0x9309('0x46')](_0x9309('0x72'),_0x52694e[_0x9309('0x73')],_0x42b11a['id'])});break;default:logger[_0x9309('0x74')](_0x9309('0x75'));}})[_0x9309('0x76')](function(_0x5a7668){logger[_0x9309('0x74')]('[QUEUE]',_0x5a7668);});};exports[_0x9309('0x77')]=function(_0x373222,_0x59d4a1,_0x161d1e,_0x5a54c7,_0x1ed2eb,_0x3d836b,_0xe800d6){var _0x1b5859,_0x189bf7,_0x272e2d,_0x5e5d89;_0x3d836b[_0x9309('0x63')]=intUtil[_0x9309('0x64')](_0x3d836b[_0x9309('0x63')]);_0x3d836b[_0x9309('0x5c')]=intUtil['stripTrailingSlash'](_0x3d836b['remoteUri']);if(_0xe800d6&&_0xe800d6[_0x9309('0x78')]&&_0xe800d6[_0x9309('0x78')]!=='none'){logger[_0x9309('0x22')]('[OUTBOUND]',_0x9309('0x67'));_0x59d4a1[_0x9309('0x68')]=util[_0x9309('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d836b[_0x9309('0x63')],_0x59d4a1[_0x9309('0x6a')],md5(_0x59d4a1[_0x9309('0x6a')]));}return getConnection(_0x3d836b)[_0x9309('0x29')](function(_0x3b804e){_0x5e5d89=_0x3b804e;return getUser(_0x3d836b,_0x5a54c7[_0x9309('0x6b')],_0x5e5d89);})[_0x9309('0x29')](function(_0x86c467){_0x1b5859=_0x86c467;return getEndUser(_0x3d836b,_0x161d1e,_0x59d4a1[_0x9309('0x79')],_0x59d4a1[_0x9309('0x7a')],_0x5e5d89);})[_0x9309('0x29')](function(_0x2f4486){_0x189bf7=_0x2f4486;return getTicket(_0x3d836b,_0x1b5859,_0x189bf7,_0x161d1e,_0x59d4a1,_0x161d1e['Fields'],_0x5e5d89,_0x9309('0x77'));})['then'](function(_0x847b6e){_0x272e2d=_0x847b6e;logger[_0x9309('0x22')](_0x9309('0x7b'),_0x272e2d['id']);logger[_0x9309('0x22')](_0x9309('0x7c'),_0x272e2d['id'],_0x5a54c7[_0x9309('0x57')],_0x3d836b[_0x9309('0x4f')]);switch(_0x3d836b[_0x9309('0x4f')]){case _0x9309('0x7d'):emit(util['format']('user:%s',_0x5a54c7['name']),_0x9309('0x71'),{'recordId':_0x272e2d['id']});break;case _0x9309('0x7e'):emit(util[_0x9309('0x46')](_0x9309('0x70'),_0x5a54c7[_0x9309('0x57')]),_0x9309('0x7f'),{'uri':util[_0x9309('0x46')]('%s/%s/e',_0x5e5d89[_0x9309('0x73')],_0x272e2d['id'])});break;default:logger['error'](_0x9309('0x80'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x9309('0x76')](function(_0x5612a4){logger[_0x9309('0x74')](_0x9309('0x80'),_0x5612a4);});};exports[_0x9309('0x81')]=function(_0x1794b5,_0xc6fd86,_0x52033c,_0x563203,_0x53f495,_0x62936e){var _0x1d8182,_0x23b369,_0xc6f5bc,_0x63d7d6;_0x62936e[_0x9309('0x63')]=intUtil[_0x9309('0x64')](_0x62936e[_0x9309('0x63')]);_0x62936e[_0x9309('0x5c')]=intUtil[_0x9309('0x64')](_0x62936e[_0x9309('0x5c')]);if(_0x53f495&&_0x53f495[_0x9309('0x65')]){logger['info']('['+_0xc6fd86[_0x9309('0x82')][_0x9309('0x83')]()+']',_0x9309('0x67'));_0xc6fd86[_0x9309('0x68')]=util[_0x9309('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x62936e[_0x9309('0x63')],_0xc6fd86['uniqueid'],md5(_0xc6fd86[_0x9309('0x6a')]));}else{_0xc6fd86[_0x9309('0x68')]='';}return getConnection(_0x62936e)[_0x9309('0x29')](function(_0x455d15){_0x63d7d6=_0x455d15;if(!_['isNil'](_0x563203)){return getUser(_0x62936e,_0x563203[_0x9309('0x57')],_0x63d7d6);}else{return getUser(_0x62936e,null,_0x63d7d6);}})['then'](function(_0x51b370){_0x1d8182=_0x51b370;return getEndUser(_0x62936e,_0x52033c,_0xc6fd86[_0x9309('0x6c')],_0xc6fd86[_0x9309('0x6d')],_0x63d7d6);})[_0x9309('0x29')](function(_0xf5a6cf){_0x23b369=_0xf5a6cf;return getTicket(_0x62936e,_0x1d8182,_0x23b369,_0x52033c,_0xc6fd86,_0x52033c[_0x9309('0x84')],_0x63d7d6);})['then'](function(_0x63d1a0){_0xc6f5bc=_0x63d1a0;logger['info']('['+_0xc6fd86[_0x9309('0x82')][_0x9309('0x83')]()+_0x9309('0x85'),_0xc6f5bc['id']);logger[_0x9309('0x22')]('['+_0xc6fd86[_0x9309('0x82')]['toUpperCase']()+_0x9309('0x86'),_0x62936e[_0x9309('0x4f')]);})[_0x9309('0x76')](function(_0x20b641){logger['error']('['+_0xc6fd86[_0x9309('0x82')][_0x9309('0x83')]()+']',_0x20b641);});}; \ No newline at end of file +var _0xfc06=['[OUTBOUND]','catch','unmanaged','toUpperCase','isNil','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','assign','getString','Subjects','Descriptions','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhatId','ticketType','Case','ContactId','account','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','User','find','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','$or','Contact','execute','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','length','merge','Phone','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Company','No\x20Company','forEach','includes','picklist','type','idField','toString','variable','variableName','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','clientSecret','login','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','instanceUrl'];(function(_0x155839,_0x3f679d){var _0x51d322=function(_0xf96e28){while(--_0xf96e28){_0x155839['push'](_0x155839['shift']());}};_0x51d322(++_0x3f679d);}(_0xfc06,0xfa));var _0x6fc0=function(_0x3236c8,_0x48b311){_0x3236c8=_0x3236c8-0x0;var _0x52dbb7=_0xfc06[_0x3236c8];return _0x52dbb7;};'use strict';var _=require(_0x6fc0('0x0'));var rp=require(_0x6fc0('0x1'));var moment=require('moment');var BPromise=require(_0x6fc0('0x2'));var md5=require(_0x6fc0('0x3'));var jsforce=require(_0x6fc0('0x4'));var util=require(_0x6fc0('0x5'));var Redis=require(_0x6fc0('0x6'));var intUtil=require('./util');var config=require(_0x6fc0('0x7'));var logger=require(_0x6fc0('0x8'))('salesforce');config[_0x6fc0('0x9')]=_[_0x6fc0('0xa')](config[_0x6fc0('0x9')],{'host':_0x6fc0('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6fc0('0x9')]));function emit(_0x1cc852,_0x10c1a2,_0x5d17b2){io['to'](_0x1cc852)[_0x6fc0('0xc')](_0x10c1a2,_0x5d17b2);}function getTicket(_0x1b9a6f,_0x4e4bdb,_0x39472d,_0x58689f,_0x46ca53,_0x11d7cd,_0x574d7f,_0x114200){var _0x20bc73=Object[_0x6fc0('0xd')]({},{'OwnerId':_0x4e4bdb['id'],'Subject':intUtil[_0x6fc0('0xe')](_0x58689f[_0x6fc0('0xf')],_0x46ca53,'\x20'),'Description':intUtil['getString'](_0x58689f[_0x6fc0('0x10')],_0x46ca53,'\x0a')},getCustomFields(_0x11d7cd,_0x46ca53));if(_0x39472d){if(_0x58689f['ticketType']==='Task'){_0x20bc73[_0x6fc0('0x11')]=moment['utc']();_0x20bc73[_0x6fc0('0x12')]=![];_0x20bc73[_0x6fc0('0x13')]=![];if(_0x39472d[_0x6fc0('0x14')]===_0x6fc0('0x15')||_0x39472d[_0x6fc0('0x14')]===_0x6fc0('0x16')){_0x20bc73['WhoId']=_0x39472d['id'];}else if(_0x39472d[_0x6fc0('0x14')]==='account'){_0x20bc73[_0x6fc0('0x17')]=_0x39472d['id'];}}else if(_0x58689f[_0x6fc0('0x18')]===_0x6fc0('0x19')){if(_0x39472d['endUserType']===_0x6fc0('0x15')){_0x20bc73[_0x6fc0('0x1a')]=_0x39472d['id'];}else if(_0x39472d[_0x6fc0('0x14')]===_0x6fc0('0x1b')){_0x20bc73['AccountId']=_0x39472d['id'];}else if(_0x39472d[_0x6fc0('0x14')]===_0x6fc0('0x16')&&_0x58689f[_0x6fc0('0x1c')]){_0x20bc73[_0x58689f['leadId']]=_0x39472d['id'];}else{logger[_0x6fc0('0x1d')](_0x6fc0('0x1e'));}}}return _0x574d7f[_0x6fc0('0x1f')](_0x58689f[_0x6fc0('0x18')])[_0x6fc0('0x20')](_0x20bc73);}function getUser(_0x58e466,_0x271406,_0x3b785e){if(!_['isNil'](_0x271406)&&intUtil['validateEmail'](_0x271406)){var _0x9a3af4={'Email':_0x271406};var _0x4fcda5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3b785e['sobject'](_0x6fc0('0x21'))[_0x6fc0('0x22')](_0x9a3af4,_0x4fcda5)['execute']()['then'](function(_0x2fab2c){if(_0x2fab2c['length']){var _0x5ddd79=_[_0x6fc0('0x22')](_0x2fab2c,function(_0x535de0){return _0x535de0['Email']===_0x271406;});if(_0x5ddd79){logger[_0x6fc0('0x1d')](_0x6fc0('0x23'),_0x271406);return BPromise[_0x6fc0('0x24')]({'id':_0x5ddd79['Id'],'name':_0x5ddd79[_0x6fc0('0x25')]});}}else{logger['info'](_0x6fc0('0x26'),_0x271406);return _0x3b785e['identity']()[_0x6fc0('0x27')](function(_0x3b80f6){return BPromise[_0x6fc0('0x24')]({'id':_0x3b80f6[_0x6fc0('0x28')],'name':_0x3b80f6['display_name']});});}});}else{logger['info'](_0x6fc0('0x26'),_0x271406);return _0x3b785e['identity']()[_0x6fc0('0x27')](function(_0xacb36f){return BPromise[_0x6fc0('0x24')]({'id':_0xacb36f[_0x6fc0('0x28')],'name':_0xacb36f[_0x6fc0('0x29')]});});}}function getEndUser(_0x3b7177,_0x1a58dc,_0x33904d,_0x57b4ea,_0x5c30ae){var _0x6410c1={'$or':{'Phone':_0x57b4ea}};var _0x5d8b23={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6fc0('0x24')]()[_0x6fc0('0x27')](function(){logger['info'](_0x6fc0('0x2a'),_0x57b4ea,_0x1a58dc['moduleSearch']);switch(_0x1a58dc[_0x6fc0('0x2b')]){case _0x6fc0('0x2c'):var _0x85dd61=_['cloneDeep'](_0x6410c1);if(_0x1a58dc[_0x6fc0('0x2d')]){var _0x21b167={};_0x21b167[_0x1a58dc[_0x6fc0('0x2d')]]=_0x57b4ea;_['merge'](_0x85dd61[_0x6fc0('0x2e')],_0x21b167);}return _0x5c30ae[_0x6fc0('0x1f')](_0x6fc0('0x2f'))[_0x6fc0('0x22')](_0x85dd61,_0x5d8b23)[_0x6fc0('0x30')]()[_0x6fc0('0x27')](function(_0x3c2968){if(_0x3c2968&&_0x3c2968['length']){return _0x3c2968;}else{var _0x3ada17=_[_0x6fc0('0x31')](_0x6410c1);if(_0x1a58dc[_0x6fc0('0x32')]){var _0x12e382={};_0x12e382[_0x1a58dc['additionalSearchLead']]=_0x57b4ea;_['merge'](_0x3ada17[_0x6fc0('0x2e')],_0x12e382);}return _0x5c30ae[_0x6fc0('0x1f')](_0x6fc0('0x33'))[_0x6fc0('0x22')](_0x3ada17,_0x5d8b23);}});case _0x6fc0('0x34'):var _0x4cc6c0=_[_0x6fc0('0x31')](_0x6410c1);if(_0x1a58dc[_0x6fc0('0x35')]){var _0x21b167={};_0x21b167[_0x1a58dc[_0x6fc0('0x35')]]=_0x57b4ea;_['merge'](_0x4cc6c0[_0x6fc0('0x2e')],_0x21b167);}return _0x5c30ae[_0x6fc0('0x1f')]('Account')['find'](_0x4cc6c0,_0x5d8b23)[_0x6fc0('0x30')]()[_0x6fc0('0x27')](function(_0x2c8fbb){if(_0x2c8fbb&&_0x2c8fbb[_0x6fc0('0x36')]){return _0x2c8fbb;}else{var _0x6a75=_[_0x6fc0('0x31')](_0x6410c1);if(_0x1a58dc[_0x6fc0('0x2d')]){var _0x523a49={};_0x523a49[_0x1a58dc[_0x6fc0('0x2d')]]=_0x57b4ea;_[_0x6fc0('0x37')](_0x6a75[_0x6fc0('0x2e')],_0x523a49);}return _0x5c30ae[_0x6fc0('0x1f')](_0x6fc0('0x2f'))[_0x6fc0('0x22')](_0x6a75,_0x5d8b23)[_0x6fc0('0x27')](function(_0x5821e1){if(_0x5821e1&&_0x5821e1[_0x6fc0('0x36')]){return _0x5821e1;}else{var _0x229892=_['cloneDeep'](_0x6410c1);if(_0x1a58dc['additionalSearchLead']){var _0x26fd01={};_0x26fd01[_0x1a58dc[_0x6fc0('0x32')]]=_0x57b4ea;_['merge'](_0x229892[_0x6fc0('0x2e')],_0x26fd01);}return _0x5c30ae[_0x6fc0('0x1f')]('Lead')[_0x6fc0('0x22')](_0x229892,_0x5d8b23);}});}});case _0x6fc0('0x15'):var _0x85dd61=_[_0x6fc0('0x31')](_0x6410c1);if(_0x1a58dc[_0x6fc0('0x2d')]){var _0x21b167={};_0x21b167[_0x1a58dc[_0x6fc0('0x2d')]]=_0x57b4ea;_[_0x6fc0('0x37')](_0x85dd61['$or'],_0x21b167);}return _0x5c30ae[_0x6fc0('0x1f')](_0x6fc0('0x2f'))[_0x6fc0('0x22')](_0x85dd61,_0x5d8b23)[_0x6fc0('0x30')]();case'lead':var _0x614acd=_[_0x6fc0('0x31')](_0x6410c1);if(_0x1a58dc[_0x6fc0('0x32')]){var _0x21b167={};_0x21b167[_0x1a58dc[_0x6fc0('0x32')]]=_0x57b4ea;_['merge'](_0x614acd[_0x6fc0('0x2e')],_0x21b167);}return _0x5c30ae['sobject']('Lead')[_0x6fc0('0x22')](_0x614acd,_0x5d8b23);case _0x6fc0('0x1b'):var _0x4cc6c0=_[_0x6fc0('0x31')](_0x6410c1);if(_0x1a58dc[_0x6fc0('0x35')]){var _0x21b167={};_0x21b167[_0x1a58dc['additionalSearchAccount']]=_0x57b4ea;_[_0x6fc0('0x37')](_0x4cc6c0[_0x6fc0('0x2e')],_0x21b167);}return _0x5c30ae[_0x6fc0('0x1f')]('Account')[_0x6fc0('0x22')](_0x4cc6c0,_0x5d8b23);default:return null;}})[_0x6fc0('0x27')](function(_0x57338b){if(_0x57338b&&_0x57338b[_0x6fc0('0x36')]){var _0x59a28a=_['first'](_0x57338b);if(_0x59a28a){return BPromise['resolve']({'id':_0x59a28a['Id'],'name':_0x59a28a[_0x6fc0('0x25')],'phone':_0x59a28a[_0x6fc0('0x38')],'endUserType':_0x59a28a['attributes']['type']['toLowerCase']()});}}})['then'](function(_0x128866){if(_0x128866){logger[_0x6fc0('0x1d')](_0x6fc0('0x39'),_0x128866[_0x6fc0('0x14')],_0x57b4ea);return BPromise[_0x6fc0('0x24')](_0x128866);}else{logger['info'](_0x6fc0('0x3a'),_0x57b4ea);var _0x3a9ab5={'Phone':_0x57b4ea};if(_0x1a58dc[_0x6fc0('0x3b')]){if(_0x1a58dc[_0x6fc0('0x3b')]===_0x6fc0('0x15')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x57b4ea,_0x1a58dc[_0x6fc0('0x3b')]);_0x3a9ab5['LastName']=_0x33904d!==_0x6fc0('0x3c')?_0x33904d:util['format'](_0x6fc0('0x3d'),_0x57b4ea);}else if(_0x1a58dc['moduleCreate']===_0x6fc0('0x16')){logger[_0x6fc0('0x1d')](_0x6fc0('0x3e'),_0x57b4ea,_0x1a58dc[_0x6fc0('0x3b')]);_0x3a9ab5[_0x6fc0('0x3f')]=_0x33904d!==''?_0x33904d:util[_0x6fc0('0x40')](_0x6fc0('0x3d'),_0x57b4ea);_0x3a9ab5[_0x6fc0('0x41')]=_0x6fc0('0x42');}else if(_0x1a58dc[_0x6fc0('0x3b')]===_0x6fc0('0x1b')){logger[_0x6fc0('0x1d')](_0x6fc0('0x3e'),_0x57b4ea,_0x1a58dc['moduleCreate']);_0x3a9ab5[_0x6fc0('0x25')]=_0x33904d!==_0x6fc0('0x3c')?_0x33904d:util['format'](_0x6fc0('0x3d'),_0x57b4ea);}else{return null;}}return _0x5c30ae[_0x6fc0('0x1f')](_['upperFirst'](_0x1a58dc[_0x6fc0('0x3b')]))[_0x6fc0('0x20')](_0x3a9ab5)[_0x6fc0('0x27')](function(_0x631303){return BPromise['resolve']({'id':_0x631303['id'],'endUserType':_0x1a58dc[_0x6fc0('0x3b')]});});}});}function getCustomFields(_0x20d169,_0x34663f){var _0x100692={};if(_0x20d169[_0x6fc0('0x36')]>0x0){_[_0x6fc0('0x43')](_0x20d169,function(_0xe09fc2){if(_[_0x6fc0('0x44')](['string',_0x6fc0('0x45')],_0xe09fc2[_0x6fc0('0x46')])&&_0xe09fc2[_0x6fc0('0x47')]){_0x100692[_0xe09fc2[_0x6fc0('0x47')]]=_0xe09fc2['content'][_0x6fc0('0x48')]();}else if(_0xe09fc2['type']===_0x6fc0('0x49')&&_0xe09fc2[_0x6fc0('0x4a')]&&_0xe09fc2[_0x6fc0('0x47')]){_0x34663f[_0xe09fc2[_0x6fc0('0x4a')]]&&(_0x100692[_0xe09fc2[_0x6fc0('0x47')]]=_0x34663f[_0xe09fc2[_0x6fc0('0x4a')]][_0x6fc0('0x48')]());}else if(_0xe09fc2['type']==='customVariable'&&_0xe09fc2[_0x6fc0('0x4b')]&&_0xe09fc2[_0x6fc0('0x4b')][_0x6fc0('0x4c')]&&_0xe09fc2[_0x6fc0('0x47')]){_0x34663f[_0xe09fc2[_0x6fc0('0x4b')][_0x6fc0('0x4c')][_0x6fc0('0x4d')]()]&&(_0x100692[_0xe09fc2['idField']]=_0x34663f[_0xe09fc2[_0x6fc0('0x4b')][_0x6fc0('0x4c')][_0x6fc0('0x4d')]()][_0x6fc0('0x48')]());}});}return _0x100692;}function getConnection(_0x20da2d){var _0xa9cebc=_0x20da2d[_0x6fc0('0x4e')][_0x6fc0('0x4f')](_0x20da2d[_0x6fc0('0x50')]);var _0x3a2259=new jsforce[(_0x6fc0('0x51'))]({'oauth2':{'loginUrl':_0x20da2d[_0x6fc0('0x52')]||'https://login.salesforce.com','clientId':_0x20da2d['clientId'],'clientSecret':_0x20da2d[_0x6fc0('0x53')]}});return _0x3a2259[_0x6fc0('0x54')](_0x20da2d['username'],_0xa9cebc)['then'](function(){logger[_0x6fc0('0x1d')]('Connection\x20established.');return _0x3a2259;});}exports[_0x6fc0('0x55')]=function(_0x312780,_0x20e2fc,_0xb8880d,_0x4de137,_0x389385,_0x478bfb){var _0xde51d3,_0x4cfa63,_0x19e7d9,_0x583d78;_0x478bfb[_0x6fc0('0x56')]=intUtil[_0x6fc0('0x57')](_0x478bfb['serverUrl']);_0x478bfb[_0x6fc0('0x52')]=intUtil[_0x6fc0('0x57')](_0x478bfb['remoteUri']);if(_0x389385&&_0x389385[_0x6fc0('0x58')]){logger[_0x6fc0('0x1d')](_0x6fc0('0x59'),'Recording\x20is\x20enabled!');_0x20e2fc['recordingURL']=util[_0x6fc0('0x40')](_0x6fc0('0x5a'),_0x478bfb[_0x6fc0('0x56')],_0x20e2fc[_0x6fc0('0x5b')],md5(_0x20e2fc[_0x6fc0('0x5b')]));}else{_0x20e2fc[_0x6fc0('0x5c')]='';}return getConnection(_0x478bfb)[_0x6fc0('0x27')](function(_0x4583cd){_0x583d78=_0x4583cd;return getUser(_0x478bfb,_0x4de137[_0x6fc0('0x5d')],_0x583d78);})[_0x6fc0('0x27')](function(_0x513ba4){_0xde51d3=_0x513ba4;return getEndUser(_0x478bfb,_0xb8880d,_0x20e2fc[_0x6fc0('0x5e')],_0x20e2fc[_0x6fc0('0x5f')],_0x583d78);})['then'](function(_0x2d669b){_0x4cfa63=_0x2d669b;return getTicket(_0x478bfb,_0xde51d3,_0x4cfa63,_0xb8880d,_0x20e2fc,_0xb8880d[_0x6fc0('0x60')],_0x583d78,_0x6fc0('0x55'));})[_0x6fc0('0x27')](function(_0x27eb75){_0x19e7d9=_0x27eb75;logger[_0x6fc0('0x1d')](_0x6fc0('0x61'),_0x19e7d9['id']);logger[_0x6fc0('0x1d')](_0x6fc0('0x62'),_0x19e7d9['id'],_0x4de137[_0x6fc0('0x4c')],_0x478bfb[_0x6fc0('0x46')]);switch(_0x478bfb[_0x6fc0('0x46')]){case'integrationTab':emit(util['format'](_0x6fc0('0x63'),_0x4de137[_0x6fc0('0x4c')]),_0x6fc0('0x64'),{'recordId':_0x19e7d9['id']});break;case _0x6fc0('0x65'):emit(util[_0x6fc0('0x40')]('user:%s',_0x4de137[_0x6fc0('0x4c')]),_0x6fc0('0x66'),{'uri':util[_0x6fc0('0x40')](_0x6fc0('0x67'),_0x583d78['instanceUrl'],_0x19e7d9['id'])});break;default:logger[_0x6fc0('0x68')](_0x6fc0('0x69'));}})['catch'](function(_0x1f82b6){logger['error'](_0x6fc0('0x59'),_0x1f82b6);});};exports['outbound']=function(_0x1c4bb9,_0x32a56d,_0x462532,_0x15278c,_0x387f71,_0x303ee5,_0x47b046){var _0x4cef67,_0x4f4d05,_0x2733af,_0x46b7eb;_0x303ee5['serverUrl']=intUtil[_0x6fc0('0x57')](_0x303ee5['serverUrl']);_0x303ee5['remoteUri']=intUtil[_0x6fc0('0x57')](_0x303ee5[_0x6fc0('0x52')]);if(_0x47b046&&_0x47b046[_0x6fc0('0x6a')]&&_0x47b046[_0x6fc0('0x6a')]!==_0x6fc0('0x6b')){logger[_0x6fc0('0x1d')]('[OUTBOUND]',_0x6fc0('0x6c'));_0x32a56d[_0x6fc0('0x5c')]=util[_0x6fc0('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x303ee5['serverUrl'],_0x32a56d['uniqueid'],md5(_0x32a56d[_0x6fc0('0x5b')]));}return getConnection(_0x303ee5)[_0x6fc0('0x27')](function(_0xd4832b){_0x46b7eb=_0xd4832b;return getUser(_0x303ee5,_0x15278c[_0x6fc0('0x5d')],_0x46b7eb);})['then'](function(_0x1a0a26){_0x4cef67=_0x1a0a26;return getEndUser(_0x303ee5,_0x462532,_0x32a56d['destcalleridname'],_0x32a56d[_0x6fc0('0x6d')],_0x46b7eb);})[_0x6fc0('0x27')](function(_0x1b46a9){_0x4f4d05=_0x1b46a9;return getTicket(_0x303ee5,_0x4cef67,_0x4f4d05,_0x462532,_0x32a56d,_0x462532[_0x6fc0('0x60')],_0x46b7eb,_0x6fc0('0x6e'));})[_0x6fc0('0x27')](function(_0x15cd56){_0x2733af=_0x15cd56;logger[_0x6fc0('0x1d')](_0x6fc0('0x6f'),_0x2733af['id']);logger[_0x6fc0('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2733af['id'],_0x15278c[_0x6fc0('0x4c')],_0x303ee5[_0x6fc0('0x46')]);switch(_0x303ee5[_0x6fc0('0x46')]){case'integrationTab':emit(util['format']('user:%s',_0x15278c['name']),_0x6fc0('0x64'),{'recordId':_0x2733af['id']});break;case _0x6fc0('0x65'):emit(util['format'](_0x6fc0('0x63'),_0x15278c['name']),_0x6fc0('0x66'),{'uri':util[_0x6fc0('0x40')](_0x6fc0('0x67'),_0x46b7eb[_0x6fc0('0x70')],_0x2733af['id'])});break;default:logger[_0x6fc0('0x68')](_0x6fc0('0x71'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x6fc0('0x72')](function(_0x1e6601){logger['error'](_0x6fc0('0x71'),_0x1e6601);});};exports[_0x6fc0('0x73')]=function(_0x17b210,_0x738d9d,_0x1f2b0f,_0xd06c94,_0x4d2d55,_0x4d4c75){var _0xa43bd1,_0x1bb086,_0x3b3ac2,_0x23b52e;_0x4d4c75[_0x6fc0('0x56')]=intUtil[_0x6fc0('0x57')](_0x4d4c75[_0x6fc0('0x56')]);_0x4d4c75['remoteUri']=intUtil['stripTrailingSlash'](_0x4d4c75[_0x6fc0('0x52')]);if(_0x4d2d55&&_0x4d2d55[_0x6fc0('0x58')]){logger[_0x6fc0('0x1d')]('['+_0x738d9d['lastevent'][_0x6fc0('0x74')]()+']',_0x6fc0('0x6c'));_0x738d9d[_0x6fc0('0x5c')]=util[_0x6fc0('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d4c75[_0x6fc0('0x56')],_0x738d9d['uniqueid'],md5(_0x738d9d[_0x6fc0('0x5b')]));}else{_0x738d9d['recordingURL']='';}return getConnection(_0x4d4c75)[_0x6fc0('0x27')](function(_0x5e934e){_0x23b52e=_0x5e934e;if(!_[_0x6fc0('0x75')](_0xd06c94)){return getUser(_0x4d4c75,_0xd06c94[_0x6fc0('0x4c')],_0x23b52e);}else{return getUser(_0x4d4c75,null,_0x23b52e);}})[_0x6fc0('0x27')](function(_0xf31650){_0xa43bd1=_0xf31650;return getEndUser(_0x4d4c75,_0x1f2b0f,_0x738d9d[_0x6fc0('0x5e')],_0x738d9d[_0x6fc0('0x5f')],_0x23b52e);})[_0x6fc0('0x27')](function(_0x35e3e8){_0x1bb086=_0x35e3e8;return getTicket(_0x4d4c75,_0xa43bd1,_0x1bb086,_0x1f2b0f,_0x738d9d,_0x1f2b0f[_0x6fc0('0x60')],_0x23b52e);})['then'](function(_0xe3e4f6){_0x3b3ac2=_0xe3e4f6;logger['info']('['+_0x738d9d[_0x6fc0('0x76')][_0x6fc0('0x74')]()+_0x6fc0('0x77'),_0x3b3ac2['id']);logger['info']('['+_0x738d9d['lastevent'][_0x6fc0('0x74')]()+_0x6fc0('0x78'),_0x4d4c75[_0x6fc0('0x46')]);})[_0x6fc0('0x72')](function(_0x4210e7){logger[_0x6fc0('0x68')]('['+_0x738d9d['lastevent'][_0x6fc0('0x74')]()+']',_0x4210e7);});}; \ 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 c470076..916331c 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 _0x36db=['%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','trigger:browser:url','username','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','format','email','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','],\x20getAdminUser\x20crm','toUpperCase','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm','catch','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','ticketId','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'];(function(_0x528c61,_0x41e87a){var _0x2defba=function(_0x375616){while(--_0x375616){_0x528c61['push'](_0x528c61['shift']());}};_0x2defba(++_0x41e87a);}(_0x36db,0xe6));var _0xb36d=function(_0x3a3fcc,_0x38afb3){_0x3a3fcc=_0x3a3fcc-0x0;var _0xe16438=_0x36db[_0x3a3fcc];return _0xe16438;};'use strict';var _=require(_0xb36d('0x0'));var Promise=require('bluebird');var rp=require(_0xb36d('0x1'));var util=require('util');var md5=require('md5');var Redis=require(_0xb36d('0x2'));var intUtil=require(_0xb36d('0x3'));var config=require(_0xb36d('0x4'));var logger=require(_0xb36d('0x5'))(_0xb36d('0x6'));config[_0xb36d('0x7')]=_[_0xb36d('0x8')](config[_0xb36d('0x7')],{'host':_0xb36d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb36d('0x7')]));function getAdminUser(_0x35e41c,_0x4c0347,_0x22807f,_0x436436,_0x3986ff,_0x2d29b7){return new Promise(function(_0x55f25d,_0xd6c32e){var _0x1a4df0={'method':_0xb36d('0xa'),'uri':_0x436436+_0xb36d('0xb')+'&'+_0x3986ff+'&'+_0x2d29b7,'auth':_0x4c0347,'json':!![]};return rp(_0x1a4df0)[_0xb36d('0xc')](function(_0x4938e4){if(_0x4938e4[_0xb36d('0xd')][_0xb36d('0xe')]>0x0){_0x22807f[_0xb36d('0xf')]=_0x4938e4['result'][0x0][_0xb36d('0x10')];}logger['info']('['+[_0x35e41c['toUpperCase']()]+_0xb36d('0x11'),_0x22807f);_0x55f25d(_0x22807f);})['catch'](function(_0xd3a524){logger['error']('['+[_0x35e41c[_0xb36d('0x12')]()]+']',_0xd3a524[_0xb36d('0x13')]);_0xd6c32e(_0xd3a524[_0xb36d('0x13')]);});});}function getUser(_0x2832b4,_0x54e07b,_0x3aabda,_0x2d8614,_0x4b92cf){return function(_0x30d335){logger[_0xb36d('0x14')]('['+[_0x2832b4['toUpperCase']()]+_0xb36d('0x15'),_0x30d335);return new Promise(function(_0x3814f4,_0x4ec67f){if(intUtil[_0xb36d('0x16')](_0x30d335[_0xb36d('0x17')])){var _0x128b21={'method':_0xb36d('0xa'),'uri':_0x3aabda+'sys_user?sysparm_query=email%3D'+_0x30d335[_0xb36d('0x17')]+'&'+_0x2d8614+'&'+_0x4b92cf,'auth':_0x54e07b,'json':!![]};logger[_0xb36d('0x14')]('['+[_0x2832b4['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x128b21);return rp(_0x128b21)[_0xb36d('0xc')](function(_0x5757ff){logger[_0xb36d('0x14')]('['+[_0x2832b4['toUpperCase']()]+_0xb36d('0x18'),_0x5757ff);if(_0x5757ff[_0xb36d('0xd')]['length']>0x0&&String(_0x5757ff[_0xb36d('0xd')][0x0]['active'])===_0xb36d('0x19')){_0x30d335[_0xb36d('0x1a')]=_0x5757ff[_0xb36d('0xd')][0x0]['sys_id'];}else{_0x30d335[_0xb36d('0x1a')]=_0x30d335[_0xb36d('0xf')];_0x30d335[_0xb36d('0x17')]=_0x30d335[_0xb36d('0x1b')];}logger[_0xb36d('0x14')]('['+[_0x2832b4[_0xb36d('0x12')]()]+_0xb36d('0x1c'),_0x30d335);_0x3814f4(_0x30d335);})[_0xb36d('0x1d')](function(_0x2805ef){logger[_0xb36d('0x1e')]('['+[_0x2832b4[_0xb36d('0x12')]()]+']',_0x2805ef[_0xb36d('0x13')]);_0x4ec67f(_0x2805ef[_0xb36d('0x13')]);});}else{logger[_0xb36d('0x14')]('['+[_0x2832b4['toUpperCase']()]+_0xb36d('0x1f'));_0x30d335['userId']=_0x30d335[_0xb36d('0xf')];_0x30d335[_0xb36d('0x17')]=_0x30d335[_0xb36d('0x1b')];_0x3814f4(_0x30d335);}});};}function createEndUser(_0x199639,_0x431993,_0xb9588a,_0x150d88,_0x4f00a3){logger[_0xb36d('0x14')]('['+[_0x199639['toUpperCase']()]+_0xb36d('0x20'),_0xb9588a);return new Promise(function(_0x798ce8,_0x250c0f){var _0x3b8956={'method':'POST','uri':_0x150d88+_0xb36d('0x21')+_0x4f00a3,'body':{'user_name':_0xb9588a[_0xb36d('0x22')],'roles':_0xb36d('0x23'),'first_name':_0xb9588a['endUserNumber'],'active':_0xb36d('0x19'),'date_format':'System','phone':_0xb9588a[_0xb36d('0x22')]},'auth':_0x431993,'json':!![]};return rp(_0x3b8956)[_0xb36d('0xc')](function(_0x2e24af){logger[_0xb36d('0x14')]('['+[_0x199639[_0xb36d('0x12')]()]+_0xb36d('0x24'),_0x2e24af[_0xb36d('0xd')]);_0xb9588a[_0xb36d('0x25')]=_0x2e24af['result'][_0xb36d('0x10')];_0x798ce8(_0xb9588a);})[_0xb36d('0x1d')](function(_0x138089){logger[_0xb36d('0x1e')]('['+[_0x199639[_0xb36d('0x12')]()]+']',_0x138089[_0xb36d('0x13')]);_0x250c0f(_0x138089['message']);});});}function getEndUser(_0x2e1e26,_0x1c749a,_0x57826b,_0x336596,_0x43a4f1){return function(_0x1b0172){logger[_0xb36d('0x14')]('['+[_0x2e1e26[_0xb36d('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x1b0172);return new Promise(function(_0x3332c5,_0x21c4c8){var _0x345183={'method':_0xb36d('0xa'),'uri':_0x57826b+'sys_user?sysparm_query=phone%3D'+_0x1b0172['endUserNumber']+'&'+_0x336596+'&'+_0x43a4f1,'auth':_0x1c749a,'json':!![]};return rp(_0x345183)[_0xb36d('0xc')](function(_0x20092d){if(_0x20092d[_0xb36d('0xd')]['length']>0x0){_0x1b0172[_0xb36d('0x25')]=_0x20092d[_0xb36d('0xd')][0x0][_0xb36d('0x10')];logger[_0xb36d('0x14')]('['+[_0x2e1e26['toUpperCase']()]+_0xb36d('0x26'),_0x1b0172);_0x3332c5(_0x1b0172);}else{return createEndUser(_0x2e1e26,_0x1c749a,_0x1b0172,_0x57826b,_0x336596)['then'](function(_0x2a6781){logger['info']('['+[_0x2e1e26[_0xb36d('0x12')]()]+_0xb36d('0x27'),_0x2a6781);_0x3332c5(_0x2a6781);});}})[_0xb36d('0x1d')](function(_0x56b186){logger[_0xb36d('0x1e')]('['+[_0x2e1e26['toUpperCase']()]+']',_0x56b186[_0xb36d('0x13')]);_0x21c4c8(_0x56b186['message']);});});};}function getCustomFields(_0x13ac19,_0x305acb){var _0x355a1d={};if(_0x13ac19[_0xb36d('0xe')]>0x0){_[_0xb36d('0x28')](_0x13ac19,function(_0x452019){if(_[_0xb36d('0x29')]([_0xb36d('0x2a'),_0xb36d('0x2b')],_0x452019[_0xb36d('0x2c')])&&_0x452019['nameField']&&!_0x452019[_0xb36d('0x2d')]){_0x355a1d[_0x452019[_0xb36d('0x2e')][_0xb36d('0x2f')]()]=_0x452019[_0xb36d('0x30')][_0xb36d('0x31')]();}else if(_[_0xb36d('0x29')]([_0xb36d('0x2a'),_0xb36d('0x2b')],_0x452019[_0xb36d('0x2c')])&&_0x452019[_0xb36d('0x32')]&&_0x452019[_0xb36d('0x2d')]){_0x355a1d[_0x452019[_0xb36d('0x32')]['toLowerCase']()]=_0x452019['content'][_0xb36d('0x31')]();}else if(_0x452019[_0xb36d('0x2c')]==='variable'&&_0x452019[_0xb36d('0x33')]&&_0x452019[_0xb36d('0x32')]&&_0x452019['customField']){_0x355a1d[_0x452019['idField'][_0xb36d('0x2f')]()]=_0x305acb[_0x452019[_0xb36d('0x33')]][_0xb36d('0x31')]();}else if(_0x452019[_0xb36d('0x2c')]===_0xb36d('0x34')&&_0x452019[_0xb36d('0x35')]&&_0x452019[_0xb36d('0x35')][_0xb36d('0x36')]&&_0x452019['idField']&&_0x452019['customField']){_0x355a1d[_0x452019[_0xb36d('0x32')][_0xb36d('0x2f')]()]=_0x305acb[_0x452019[_0xb36d('0x35')][_0xb36d('0x36')][_0xb36d('0x2f')]()]['toString']();}});}return _0x355a1d;}function getTicket(_0x4b12d2,_0x3284a3,_0x49bb56,_0x33aee1,_0x5cc939,_0x37fe4d){return function(_0x10a1a7){logger[_0xb36d('0x14')]('['+[_0x4b12d2['toUpperCase']()]+_0xb36d('0x37'),_0x10a1a7);return new Promise(function(_0x2fd13b,_0x3d0215){var _0x49100a=_0x4b12d2[_0xb36d('0x2f')]()==='outbound'?_0x10a1a7[_0xb36d('0x1a')]:_0x10a1a7[_0xb36d('0x25')];var _0x3ccc51={'method':_0xb36d('0x38'),'uri':_0x49bb56+_0xb36d('0x39')+'?'+_0x37fe4d,'body':Object[_0xb36d('0x3a')]({},{'active':'true','caller_id':_0x49100a,'assigned_to':_0x10a1a7[_0xb36d('0x1a')],'short_description':intUtil[_0xb36d('0x3b')](_0x33aee1[_0xb36d('0x3c')],_0x5cc939,'\x20'),'description':intUtil['getString'](_0x33aee1['Descriptions'],_0x5cc939,'\x0a')},getCustomFields(_0x33aee1[_0xb36d('0x3d')],_0x5cc939)),'auth':_0x3284a3,'json':!![]};return rp(_0x3ccc51)[_0xb36d('0xc')](function(_0x2f54e6){logger[_0xb36d('0x14')]('['+[_0x4b12d2[_0xb36d('0x12')]()]+_0xb36d('0x3e'),_0x2f54e6[_0xb36d('0xd')]);_0x10a1a7['ticketId']=_0x2f54e6[_0xb36d('0xd')][_0xb36d('0x10')];_0x10a1a7[_0xb36d('0x3f')]=_0x2f54e6['result']['number'];logger[_0xb36d('0x14')]('['+[_0x4b12d2['toUpperCase']()]+_0xb36d('0x40'),_0x10a1a7);_0x2fd13b(_0x10a1a7);})['catch'](function(_0x538015){logger['error']('['+[_0x4b12d2[_0xb36d('0x12')]()]+']',_0x538015[_0xb36d('0x13')]);_0x3d0215(_0x538015['message']);});});};}function createRemoteTag(_0x28b810,_0x2818e1,_0x3cc4c8,_0x1fffa5){return new Promise(function(_0x5c64ce,_0x228d91){var _0x257bf2={'method':_0xb36d('0x38'),'uri':_0x3cc4c8+_0xb36d('0x41')+'?'+_0x1fffa5,'body':{'short_description':_0x28b810,'global':!![],'active':!![],'name':_0x28b810},'auth':_0x2818e1,'json':!![]};return rp(_0x257bf2)[_0xb36d('0xc')](function(_0x4a5014){var _0x16a80d=_0x4a5014[_0xb36d('0xd')][_0xb36d('0x10')];_0x5c64ce(_0x16a80d);});});}function getRemoteTag(_0x15d33d,_0x43c0d6,_0x878348,_0x273d97,_0x8f7846){return new Promise(function(_0x13017e,_0x55c7c1){var _0x1947d1={'method':'GET','uri':_0x878348+_0xb36d('0x41')+_0xb36d('0x42')+_0x15d33d+'&'+_0x273d97,'auth':_0x43c0d6,'json':!![]};return rp(_0x1947d1)['then'](function(_0x193fcd){if(_0x193fcd[_0xb36d('0xd')][_0xb36d('0xe')]>0x0){var _0x14a40f=_0x193fcd[_0xb36d('0xd')][0x0][_0xb36d('0x10')];_0x13017e(_0x14a40f);}else{return createRemoteTag(_0x15d33d,_0x43c0d6,_0x878348,_0x273d97)[_0xb36d('0xc')](function(_0x3bb265){_0x13017e(_0x3bb265);});}});});}function assignTagToIncident(_0x3c8bf4,_0x4ce8f0,_0x4def7f,_0x41fa80,_0x2d796f){return new Promise(function(_0x3b6288,_0x410c53){var _0x183ea5={'method':'POST','uri':_0x4def7f+'label_entry'+'?'+_0x2d796f,'body':{'label':_0x3c8bf4,'table':'incident','id_type':_0xb36d('0x43'),'table_key':_0x41fa80[_0xb36d('0x44')],'title':_0xb36d('0x45')+_0x41fa80[_0xb36d('0x3f')],'id_display':_0x41fa80[_0xb36d('0x3f')]},'auth':_0x4ce8f0,'json':!![]};return rp(_0x183ea5)['then'](function(_0x55e6a7){_0x3b6288();})[_0xb36d('0x1d')](function(){_0x3b6288();});});}function manageTags(_0x2809be,_0x26bf55,_0x127cf9,_0x163ca8,_0x568367,_0x5306a0,_0x388719){return new Promise(function(_0x52f0e8,_0x1ebf4e){var _0x1dfbe9=[];_0x26bf55[_0xb36d('0x28')](function(_0x51c1e1){_0x1dfbe9[_0xb36d('0x46')](getRemoteTag(_0x51c1e1,_0x127cf9,_0x163ca8,_0x5306a0,_0x388719));});return Promise[_0xb36d('0x47')](_0x1dfbe9)[_0xb36d('0xc')](function(_0x4e6293){if(_0x4e6293[_0xb36d('0xe')]){logger[_0xb36d('0x14')]('['+[_0x2809be['toUpperCase']()]+_0xb36d('0x48'),_0x4e6293);var _0x49fc3d=[];_0x4e6293[_0xb36d('0x28')](function(_0x2c2587){_0x49fc3d[_0xb36d('0x46')](assignTagToIncident(_0x2c2587,_0x127cf9,_0x163ca8,_0x568367,_0x5306a0));});return Promise[_0xb36d('0x47')](_0x49fc3d)[_0xb36d('0xc')](function(){_0x52f0e8();})[_0xb36d('0x1d')](function(){_0x52f0e8();});}else{_0x52f0e8();}});});}function getTags(_0x4ad4bd,_0x139b3a,_0x3ac07c,_0x4366a1,_0x55dcbe,_0x5aeeae){return function(_0xd00c9b){return new Promise(function(_0x206965,_0x43eb3d){var _0x172a1d=[];var _0x470df8=_0x4366a1[_0xb36d('0x49')];if(_0x470df8&&_0x470df8[_0xb36d('0xe')]>0x0){_0x172a1d=_['map'](_0x470df8,_0xb36d('0x36'));}if(_0x172a1d[_0xb36d('0xe')]>0x0){return manageTags(_0x4ad4bd,_0x172a1d,_0x139b3a,_0x3ac07c,_0xd00c9b,_0x55dcbe,_0x5aeeae)[_0xb36d('0xc')](function(){_0x206965(_0xd00c9b);});}else{_0x206965(_0xd00c9b);}});};}function emit(_0x1f1aca,_0x353999,_0x383c88){var _0x2e7997=_0xb36d('0x4a')+_0xb36d('0x4b')+_0xb36d('0x4c')+_0xb36d('0x4d');var _0x5c9e38={'uri':_0x1f1aca+_0xb36d('0x4e')+_0x383c88+_0x2e7997};io['to'](util['format'](_0xb36d('0x4f'),_0x353999))['emit'](_0xb36d('0x50'),_0x5c9e38);}exports['cs']=function(_0xfdbdfc,_0x45e44c,_0x50a8e1,_0x38c678,_0xa520b,_0x2b85c1,_0x4495a8,_0x2cfb7b){var _0x89cd9b={};var _0x40ab21={'user':_0x2b85c1[_0xb36d('0x51')],'pass':_0x2b85c1['password']};var _0x5c255f=_0xb36d('0x52');var _0x4d5a8a='sysparm_display_value=true';_0x2b85c1['remoteUri']=intUtil[_0xb36d('0x53')](_0x2b85c1[_0xb36d('0x54')]);_0x2b85c1[_0xb36d('0x55')]=intUtil[_0xb36d('0x53')](_0x2b85c1[_0xb36d('0x55')]);var _0x1c5e02=util[_0xb36d('0x56')]('%s/api/now/table/',_0x2b85c1['remoteUri']);_0x89cd9b['userEmail']=!_['isNil'](_0x38c678)?_0x38c678[_0xb36d('0x57')]:null;_0x89cd9b['adminEmail']=_0x2b85c1['email'];_0x89cd9b[_0xb36d('0x22')]=_0x2cfb7b[_0xb36d('0x2f')]()==='outbound'?_0x45e44c['destcalleridnum']:_0x45e44c['calleridnum'];_0x89cd9b['callDirection']=_0x2cfb7b===_0xb36d('0x58')||_0x2cfb7b===_0xb36d('0x59')?_0xb36d('0x58'):_0xb36d('0x5a');var _0x184a65=util[_0xb36d('0x56')](_0xb36d('0x5b'),_0x2b85c1['serverUrl'],_0x45e44c[_0xb36d('0x5c')],md5(_0x45e44c[_0xb36d('0x5c')]));if(_0xa520b&&_0xa520b['monitor_format']){logger[_0xb36d('0x14')](_0xb36d('0x5d'),_0xb36d('0x5e'));_0x45e44c[_0xb36d('0x5f')]=_0x184a65;}else if(_0x4495a8&&_0x4495a8['recordingFormat']&&_0x4495a8[_0xb36d('0x60')]!==_0xb36d('0x61')){logger[_0xb36d('0x14')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x45e44c[_0xb36d('0x5f')]=_0x184a65;}else{_0x45e44c['recordingURL']='';}return getAdminUser(_0x2cfb7b,_0x40ab21,_0x89cd9b,_0x1c5e02,_0x4d5a8a,_0x5c255f)['then'](getUser(_0x2cfb7b,_0x40ab21,_0x1c5e02,_0x4d5a8a,_0x5c255f))[_0xb36d('0xc')](getEndUser(_0x2cfb7b,_0x40ab21,_0x1c5e02,_0x4d5a8a,_0x5c255f))[_0xb36d('0xc')](getTicket(_0x2cfb7b,_0x40ab21,_0x1c5e02,_0x50a8e1,_0x45e44c,_0x4d5a8a))[_0xb36d('0xc')](function(_0x54a559){logger[_0xb36d('0x14')](util['format'](_0xb36d('0x62'),_0x54a559[_0xb36d('0x44')]));logger[_0xb36d('0x14')](util['format'](_0xb36d('0x63'),_0x2cfb7b));if(_0x2cfb7b!=='unmanaged'){logger[_0xb36d('0x14')]('['+[_0x2cfb7b['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2b85c1[_0xb36d('0x54')],_0x38c678['name'],_0x54a559[_0xb36d('0x44')]);}})['catch'](function(_0x4330f6){logger[_0xb36d('0x1e')]('['+[_0x2cfb7b['toUpperCase']()]+_0xb36d('0x64'),util[_0xb36d('0x65')](_0x4330f6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9ba0=['calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','info','],\x20getAdminUser\x20crm','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','userId','adminId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','true','System','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','catch','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','getString','Subjects',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','stripTrailingSlash','serverUrl','format','%s/api/now/table/','remoteUri','isNil','email','destcalleridnum'];(function(_0x40d1b7,_0x514d11){var _0x39df83=function(_0x4b0018){while(--_0x4b0018){_0x40d1b7['push'](_0x40d1b7['shift']());}};_0x39df83(++_0x514d11);}(_0x9ba0,0xe9));var _0x09ba=function(_0x2c76f5,_0x1e87a6){_0x2c76f5=_0x2c76f5-0x0;var _0x1b450d=_0x9ba0[_0x2c76f5];return _0x1b450d;};'use strict';var _=require('lodash');var Promise=require(_0x09ba('0x0'));var rp=require(_0x09ba('0x1'));var util=require(_0x09ba('0x2'));var md5=require(_0x09ba('0x3'));var Redis=require(_0x09ba('0x4'));var intUtil=require(_0x09ba('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x09ba('0x6'));config[_0x09ba('0x7')]=_[_0x09ba('0x8')](config[_0x09ba('0x7')],{'host':_0x09ba('0x9'),'port':0x18eb});var io=require(_0x09ba('0xa'))(new Redis(config[_0x09ba('0x7')]));function getAdminUser(_0x21fd3e,_0x3f6099,_0x587663,_0x28cee3,_0x310777,_0x1e4ea1){return new Promise(function(_0x266e2e,_0x3a0084){var _0x12b8be={'method':'GET','uri':_0x28cee3+_0x09ba('0xb')+'&'+_0x310777+'&'+_0x1e4ea1,'auth':_0x3f6099,'json':!![]};return rp(_0x12b8be)['then'](function(_0x22d04c){if(_0x22d04c[_0x09ba('0xc')][_0x09ba('0xd')]>0x0){_0x587663['adminId']=_0x22d04c['result'][0x0][_0x09ba('0xe')];}logger[_0x09ba('0xf')]('['+[_0x21fd3e['toUpperCase']()]+_0x09ba('0x10'),_0x587663);_0x266e2e(_0x587663);})['catch'](function(_0x457073){logger[_0x09ba('0x11')]('['+[_0x21fd3e[_0x09ba('0x12')]()]+']',_0x457073[_0x09ba('0x13')]);_0x3a0084(_0x457073[_0x09ba('0x13')]);});});}function getUser(_0x1e8295,_0x32990a,_0x3f4939,_0x330cd4,_0x493626){return function(_0x215d0d){logger[_0x09ba('0xf')]('['+[_0x1e8295[_0x09ba('0x12')]()]+_0x09ba('0x14'),_0x215d0d);return new Promise(function(_0x3d1a99,_0x35d307){if(intUtil[_0x09ba('0x15')](_0x215d0d[_0x09ba('0x16')])){var _0x5eab5c={'method':_0x09ba('0x17'),'uri':_0x3f4939+_0x09ba('0x18')+_0x215d0d[_0x09ba('0x16')]+'&'+_0x330cd4+'&'+_0x493626,'auth':_0x32990a,'json':!![]};logger[_0x09ba('0xf')]('['+[_0x1e8295[_0x09ba('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x5eab5c);return rp(_0x5eab5c)['then'](function(_0x189e3f){logger[_0x09ba('0xf')]('['+[_0x1e8295[_0x09ba('0x12')]()]+_0x09ba('0x19'),_0x189e3f);if(_0x189e3f['result'][_0x09ba('0xd')]>0x0&&String(_0x189e3f['result'][0x0][_0x09ba('0x1a')])==='true'){_0x215d0d[_0x09ba('0x1b')]=_0x189e3f[_0x09ba('0xc')][0x0][_0x09ba('0xe')];}else{_0x215d0d[_0x09ba('0x1b')]=_0x215d0d[_0x09ba('0x1c')];_0x215d0d[_0x09ba('0x16')]=_0x215d0d[_0x09ba('0x1d')];}logger[_0x09ba('0xf')]('['+[_0x1e8295[_0x09ba('0x12')]()]+'],\x20getUser\x20crm',_0x215d0d);_0x3d1a99(_0x215d0d);})['catch'](function(_0x268816){logger['error']('['+[_0x1e8295[_0x09ba('0x12')]()]+']',_0x268816[_0x09ba('0x13')]);_0x35d307(_0x268816[_0x09ba('0x13')]);});}else{logger[_0x09ba('0xf')]('['+[_0x1e8295[_0x09ba('0x12')]()]+_0x09ba('0x1e'));_0x215d0d[_0x09ba('0x1b')]=_0x215d0d[_0x09ba('0x1c')];_0x215d0d[_0x09ba('0x16')]=_0x215d0d[_0x09ba('0x1d')];_0x3d1a99(_0x215d0d);}});};}function createEndUser(_0x48d02d,_0x591637,_0x4983a6,_0x237d86,_0x4b897e){logger[_0x09ba('0xf')]('['+[_0x48d02d[_0x09ba('0x12')]()]+_0x09ba('0x1f'),_0x4983a6);return new Promise(function(_0x465043,_0x21bc27){var _0xc70d54={'method':'POST','uri':_0x237d86+_0x09ba('0x20')+_0x4b897e,'body':{'user_name':_0x4983a6[_0x09ba('0x21')],'roles':_0x09ba('0x22'),'first_name':_0x4983a6[_0x09ba('0x21')],'active':_0x09ba('0x23'),'date_format':_0x09ba('0x24'),'phone':_0x4983a6[_0x09ba('0x21')]},'auth':_0x591637,'json':!![]};return rp(_0xc70d54)[_0x09ba('0x25')](function(_0x4ffcd2){logger[_0x09ba('0xf')]('['+[_0x48d02d['toUpperCase']()]+_0x09ba('0x26'),_0x4ffcd2[_0x09ba('0xc')]);_0x4983a6[_0x09ba('0x27')]=_0x4ffcd2[_0x09ba('0xc')][_0x09ba('0xe')];_0x465043(_0x4983a6);})['catch'](function(_0x42308f){logger[_0x09ba('0x11')]('['+[_0x48d02d[_0x09ba('0x12')]()]+']',_0x42308f['message']);_0x21bc27(_0x42308f[_0x09ba('0x13')]);});});}function getEndUser(_0x2ceb1e,_0x3e8186,_0x3ad091,_0x394860,_0x53b15c){return function(_0x3187d2){logger[_0x09ba('0xf')]('['+[_0x2ceb1e[_0x09ba('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x3187d2);return new Promise(function(_0x12e9cd,_0x38ce9d){var _0x439fab={'method':_0x09ba('0x17'),'uri':_0x3ad091+'sys_user?sysparm_query=phone%3D'+_0x3187d2[_0x09ba('0x21')]+'&'+_0x394860+'&'+_0x53b15c,'auth':_0x3e8186,'json':!![]};return rp(_0x439fab)[_0x09ba('0x25')](function(_0x2a1486){if(_0x2a1486[_0x09ba('0xc')][_0x09ba('0xd')]>0x0){_0x3187d2[_0x09ba('0x27')]=_0x2a1486[_0x09ba('0xc')][0x0]['sys_id'];logger[_0x09ba('0xf')]('['+[_0x2ceb1e[_0x09ba('0x12')]()]+_0x09ba('0x28'),_0x3187d2);_0x12e9cd(_0x3187d2);}else{return createEndUser(_0x2ceb1e,_0x3e8186,_0x3187d2,_0x3ad091,_0x394860)[_0x09ba('0x25')](function(_0x6a0798){logger[_0x09ba('0xf')]('['+[_0x2ceb1e[_0x09ba('0x12')]()]+_0x09ba('0x29'),_0x6a0798);_0x12e9cd(_0x6a0798);});}})[_0x09ba('0x2a')](function(_0x5e908c){logger[_0x09ba('0x11')]('['+[_0x2ceb1e[_0x09ba('0x12')]()]+']',_0x5e908c[_0x09ba('0x13')]);_0x38ce9d(_0x5e908c['message']);});});};}function getCustomFields(_0x24ec94,_0x7bc1a4){var _0x32f37e={};if(_0x24ec94['length']>0x0){_['forEach'](_0x24ec94,function(_0x52bfa0){if(_[_0x09ba('0x2b')]([_0x09ba('0x2c'),_0x09ba('0x2d')],_0x52bfa0[_0x09ba('0x2e')])&&_0x52bfa0['nameField']&&!_0x52bfa0[_0x09ba('0x2f')]){_0x32f37e[_0x52bfa0[_0x09ba('0x30')][_0x09ba('0x31')]()]=_0x52bfa0[_0x09ba('0x32')][_0x09ba('0x33')]();}else if(_[_0x09ba('0x2b')](['string',_0x09ba('0x2d')],_0x52bfa0[_0x09ba('0x2e')])&&_0x52bfa0['idField']&&_0x52bfa0['customField']){_0x32f37e[_0x52bfa0[_0x09ba('0x34')][_0x09ba('0x31')]()]=_0x52bfa0[_0x09ba('0x32')]['toString']();}else if(_0x52bfa0[_0x09ba('0x2e')]===_0x09ba('0x35')&&_0x52bfa0[_0x09ba('0x36')]&&_0x52bfa0[_0x09ba('0x34')]&&_0x52bfa0[_0x09ba('0x2f')]){_0x32f37e[_0x52bfa0[_0x09ba('0x34')][_0x09ba('0x31')]()]=_0x7bc1a4[_0x52bfa0['variableName']][_0x09ba('0x33')]();}else if(_0x52bfa0[_0x09ba('0x2e')]===_0x09ba('0x37')&&_0x52bfa0[_0x09ba('0x38')]&&_0x52bfa0[_0x09ba('0x38')]['name']&&_0x52bfa0[_0x09ba('0x34')]&&_0x52bfa0[_0x09ba('0x2f')]){_0x32f37e[_0x52bfa0[_0x09ba('0x34')][_0x09ba('0x31')]()]=_0x7bc1a4[_0x52bfa0['Variable'][_0x09ba('0x39')][_0x09ba('0x31')]()]['toString']();}});}return _0x32f37e;}function getTicket(_0x575c25,_0x31d4d4,_0x392919,_0x2414c4,_0x2d495c,_0x6067c5){return function(_0x22fbd5){logger[_0x09ba('0xf')]('['+[_0x575c25['toUpperCase']()]+_0x09ba('0x3a'),_0x22fbd5);return new Promise(function(_0x520464,_0x6085ec){var _0x338e55=_0x575c25[_0x09ba('0x31')]()===_0x09ba('0x3b')?_0x22fbd5[_0x09ba('0x1b')]:_0x22fbd5[_0x09ba('0x27')];var _0x3e270e={'method':_0x09ba('0x3c'),'uri':_0x392919+_0x09ba('0x3d')+'?'+_0x6067c5,'body':Object[_0x09ba('0x3e')]({},{'active':_0x09ba('0x23'),'caller_id':_0x338e55,'assigned_to':_0x22fbd5[_0x09ba('0x1b')],'short_description':intUtil[_0x09ba('0x3f')](_0x2414c4[_0x09ba('0x40')],_0x2d495c,'\x20'),'description':intUtil['getString'](_0x2414c4['Descriptions'],_0x2d495c,'\x0a')},getCustomFields(_0x2414c4['Fields'],_0x2d495c)),'auth':_0x31d4d4,'json':!![]};return rp(_0x3e270e)[_0x09ba('0x25')](function(_0x55458e){logger[_0x09ba('0xf')]('['+[_0x575c25[_0x09ba('0x12')]()]+_0x09ba('0x41'),_0x55458e[_0x09ba('0xc')]);_0x22fbd5[_0x09ba('0x42')]=_0x55458e[_0x09ba('0xc')][_0x09ba('0xe')];_0x22fbd5[_0x09ba('0x43')]=_0x55458e[_0x09ba('0xc')][_0x09ba('0x44')];logger[_0x09ba('0xf')]('['+[_0x575c25[_0x09ba('0x12')]()]+']\x20getTicket\x20crm',_0x22fbd5);_0x520464(_0x22fbd5);})[_0x09ba('0x2a')](function(_0x29ba98){logger[_0x09ba('0x11')]('['+[_0x575c25['toUpperCase']()]+']',_0x29ba98[_0x09ba('0x13')]);_0x6085ec(_0x29ba98[_0x09ba('0x13')]);});});};}function createRemoteTag(_0x39dd35,_0x186609,_0x10f6ac,_0x105755){return new Promise(function(_0x73d18e,_0x5d030a){var _0x4e56b7={'method':_0x09ba('0x3c'),'uri':_0x10f6ac+_0x09ba('0x45')+'?'+_0x105755,'body':{'short_description':_0x39dd35,'global':!![],'active':!![],'name':_0x39dd35},'auth':_0x186609,'json':!![]};return rp(_0x4e56b7)[_0x09ba('0x25')](function(_0x311532){var _0x3b9e2c=_0x311532['result'][_0x09ba('0xe')];_0x73d18e(_0x3b9e2c);});});}function getRemoteTag(_0x3b2c85,_0x43f1d1,_0x28c101,_0x5dd500,_0x231fa7){return new Promise(function(_0x3a4d1a,_0xbd74d7){var _0x385187={'method':'GET','uri':_0x28c101+_0x09ba('0x45')+_0x09ba('0x46')+_0x3b2c85+'&'+_0x5dd500,'auth':_0x43f1d1,'json':!![]};return rp(_0x385187)[_0x09ba('0x25')](function(_0x2c06cc){if(_0x2c06cc['result'][_0x09ba('0xd')]>0x0){var _0xb81463=_0x2c06cc[_0x09ba('0xc')][0x0]['sys_id'];_0x3a4d1a(_0xb81463);}else{return createRemoteTag(_0x3b2c85,_0x43f1d1,_0x28c101,_0x5dd500)[_0x09ba('0x25')](function(_0x25a012){_0x3a4d1a(_0x25a012);});}});});}function assignTagToIncident(_0xd1da39,_0x4acb5c,_0x1784c8,_0x23b2eb,_0x160acb){return new Promise(function(_0x2072e1,_0x40ece7){var _0x2449c6={'method':'POST','uri':_0x1784c8+_0x09ba('0x47')+'?'+_0x160acb,'body':{'label':_0xd1da39,'table':_0x09ba('0x3d'),'id_type':'Incident','table_key':_0x23b2eb[_0x09ba('0x42')],'title':'Incident\x20-\x20'+_0x23b2eb[_0x09ba('0x43')],'id_display':_0x23b2eb[_0x09ba('0x43')]},'auth':_0x4acb5c,'json':!![]};return rp(_0x2449c6)['then'](function(_0x28d3e2){_0x2072e1();})['catch'](function(){_0x2072e1();});});}function manageTags(_0x59c22f,_0x10c4a7,_0x4ba002,_0x24fb69,_0x3beaf3,_0x47e5ad,_0x1ba1ab){return new Promise(function(_0x36ad2b,_0x8f09c8){var _0x59f9cf=[];_0x10c4a7[_0x09ba('0x48')](function(_0x4df7ed){_0x59f9cf[_0x09ba('0x49')](getRemoteTag(_0x4df7ed,_0x4ba002,_0x24fb69,_0x47e5ad,_0x1ba1ab));});return Promise[_0x09ba('0x4a')](_0x59f9cf)[_0x09ba('0x25')](function(_0x3c69a9){if(_0x3c69a9[_0x09ba('0xd')]){logger[_0x09ba('0xf')]('['+[_0x59c22f['toUpperCase']()]+_0x09ba('0x4b'),_0x3c69a9);var _0x2ac571=[];_0x3c69a9[_0x09ba('0x48')](function(_0x5de7ad){_0x2ac571[_0x09ba('0x49')](assignTagToIncident(_0x5de7ad,_0x4ba002,_0x24fb69,_0x3beaf3,_0x47e5ad));});return Promise[_0x09ba('0x4a')](_0x2ac571)[_0x09ba('0x25')](function(){_0x36ad2b();})['catch'](function(){_0x36ad2b();});}else{_0x36ad2b();}});});}function getTags(_0x3f14bd,_0x286204,_0x297de5,_0x33e1ab,_0x453261,_0x4b8bbd){return function(_0x466636){return new Promise(function(_0x450baa,_0x4f7079){var _0x243e63=[];var _0x246cc8=_0x33e1ab[_0x09ba('0x4c')];if(_0x246cc8&&_0x246cc8[_0x09ba('0xd')]>0x0){_0x243e63=_['map'](_0x246cc8,_0x09ba('0x39'));}if(_0x243e63[_0x09ba('0xd')]>0x0){return manageTags(_0x3f14bd,_0x243e63,_0x286204,_0x297de5,_0x466636,_0x453261,_0x4b8bbd)[_0x09ba('0x25')](function(){_0x450baa(_0x466636);});}else{_0x450baa(_0x466636);}});};}function emit(_0x392f64,_0x3ca268,_0xd80dba){var _0x1a57d0='%26sysparm_record_target%3Dincident'+_0x09ba('0x4d')+_0x09ba('0x4e')+_0x09ba('0x4f');var _0x1f2c9b={'uri':_0x392f64+_0x09ba('0x50')+_0xd80dba+_0x1a57d0};io['to'](util['format'](_0x09ba('0x51'),_0x3ca268))[_0x09ba('0x52')](_0x09ba('0x53'),_0x1f2c9b);}exports['cs']=function(_0x4f88bb,_0x57431d,_0x352023,_0x429d8a,_0x40f532,_0x149160,_0x564af2,_0x6d5459){var _0x1a8a5c={};var _0x3124cf={'user':_0x149160[_0x09ba('0x54')],'pass':_0x149160['password']};var _0x24f2ae=_0x09ba('0x55');var _0x486ee2='sysparm_display_value=true';_0x149160['remoteUri']=intUtil[_0x09ba('0x56')](_0x149160['remoteUri']);_0x149160[_0x09ba('0x57')]=intUtil[_0x09ba('0x56')](_0x149160[_0x09ba('0x57')]);var _0xbc3fb2=util[_0x09ba('0x58')](_0x09ba('0x59'),_0x149160[_0x09ba('0x5a')]);_0x1a8a5c[_0x09ba('0x16')]=!_[_0x09ba('0x5b')](_0x429d8a)?_0x429d8a[_0x09ba('0x5c')]:null;_0x1a8a5c[_0x09ba('0x1d')]=_0x149160[_0x09ba('0x5c')];_0x1a8a5c[_0x09ba('0x21')]=_0x6d5459[_0x09ba('0x31')]()===_0x09ba('0x3b')?_0x57431d[_0x09ba('0x5d')]:_0x57431d[_0x09ba('0x5e')];_0x1a8a5c[_0x09ba('0x5f')]=_0x6d5459===_0x09ba('0x60')||_0x6d5459===_0x09ba('0x61')?_0x09ba('0x60'):'outbound';var _0x147c0d=util[_0x09ba('0x58')](_0x09ba('0x62'),_0x149160[_0x09ba('0x57')],_0x57431d[_0x09ba('0x63')],md5(_0x57431d[_0x09ba('0x63')]));if(_0x40f532&&_0x40f532[_0x09ba('0x64')]){logger[_0x09ba('0xf')]('[QUEUE]','Recording\x20is\x20enabled!');_0x57431d[_0x09ba('0x65')]=_0x147c0d;}else if(_0x564af2&&_0x564af2[_0x09ba('0x66')]&&_0x564af2[_0x09ba('0x66')]!==_0x09ba('0x67')){logger[_0x09ba('0xf')](_0x09ba('0x68'),'Recording\x20is\x20enabled!');_0x57431d[_0x09ba('0x65')]=_0x147c0d;}else{_0x57431d['recordingURL']='';}return getAdminUser(_0x6d5459,_0x3124cf,_0x1a8a5c,_0xbc3fb2,_0x486ee2,_0x24f2ae)[_0x09ba('0x25')](getUser(_0x6d5459,_0x3124cf,_0xbc3fb2,_0x486ee2,_0x24f2ae))[_0x09ba('0x25')](getEndUser(_0x6d5459,_0x3124cf,_0xbc3fb2,_0x486ee2,_0x24f2ae))[_0x09ba('0x25')](getTicket(_0x6d5459,_0x3124cf,_0xbc3fb2,_0x352023,_0x57431d,_0x486ee2))[_0x09ba('0x25')](function(_0x52cd49){logger[_0x09ba('0xf')](util[_0x09ba('0x58')](_0x09ba('0x69'),_0x52cd49['ticketId']));logger[_0x09ba('0xf')](util['format']('call\x20direction:\x20%s',_0x6d5459));if(_0x6d5459!==_0x09ba('0x61')){logger[_0x09ba('0xf')]('['+[_0x6d5459['toUpperCase']()]+']',_0x09ba('0x6a'));emit(_0x149160['remoteUri'],_0x429d8a[_0x09ba('0x39')],_0x52cd49[_0x09ba('0x42')]);}})[_0x09ba('0x2a')](function(_0xf07ec7){logger['error']('['+[_0x6d5459[_0x09ba('0x12')]()]+_0x09ba('0x6b'),util[_0x09ba('0x6c')](_0xf07ec7,{'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 c814fbf..494ad32 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 _0x4e10=['Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','length','find','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Enduser\x20created.','[HTTP]','map','type','nameField','customField','toLowerCase','content','idField','custom_fields','customVariable','Variable','login','username','PLAIN','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!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','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','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','lastevent','calleridnum','toUpperCase','lodash','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','name','direction','forEach','push','variableName','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64','stringify','isNil','info'];(function(_0x3d671c,_0x1da12f){var _0x1eb02a=function(_0x4a904e){while(--_0x4a904e){_0x3d671c['push'](_0x3d671c['shift']());}};_0x1eb02a(++_0x1da12f);}(_0x4e10,0x1ba));var _0x04e1=function(_0x538115,_0xc6b475){_0x538115=_0x538115-0x0;var _0x503486=_0x4e10[_0x538115];return _0x503486;};'use strict';var _=require(_0x04e1('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x04e1('0x1'));var util=require(_0x04e1('0x2'));var Redis=require('ioredis');var intUtil=require(_0x04e1('0x3'));var config=require(_0x04e1('0x4'));var logger=require(_0x04e1('0x5'))(_0x04e1('0x6'));config[_0x04e1('0x7')]=_[_0x04e1('0x8')](config[_0x04e1('0x7')],{'host':_0x04e1('0x9'),'port':0x18eb});var io=require(_0x04e1('0xa'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x3fb68d,_0x3e4a78,_0x5c48ff){io['to'](_0x3fb68d)['emit'](_0x3e4a78,_0x5c48ff);}function getTicket(_0x5bf632,_0x1d6d36,_0x399e83,_0xcfe209,_0x3622b1,_0x59c351,_0x4fdd44,_0x323340){logger['info'](_0x04e1('0xb'));var _0x89a33a=new Date();var _0x1d5b9f=[{'name':'name','value':intUtil[_0x04e1('0xc')](_0xcfe209[_0x04e1('0xd')],_0x3622b1,'\x20')},{'name':_0x04e1('0xe'),'value':_0x1d6d36['id']},{'name':'created_by','value':_0x1d6d36['id']},{'name':_0x04e1('0xf'),'value':intUtil[_0x04e1('0xc')](_0xcfe209[_0x04e1('0x10')],_0x3622b1,'\x0a')},{'name':_0x04e1('0x11'),'value':_0x89a33a[_0x04e1('0x12')]()[_0x04e1('0x13')](0x0,0x13)[_0x04e1('0x14')]('T','\x20')},{'name':_0x04e1('0x15'),'value':'0'},{'name':_0x04e1('0x16'),'value':'15'},{'name':_0x04e1('0x17'),'value':_0x399e83['id']},{'name':'parent_type','value':_0x04e1('0x18')},{'name':_0x04e1('0x19'),'value':_0x399e83[_0x04e1('0x1a')]},{'name':_0x04e1('0x1b'),'value':_0x323340}];if(_0x59c351['length']){_[_0x04e1('0x1c')](_0x59c351,function(_0x3cb622){if(_0x3622b1[_0x3cb622['variableName']]){_0x1d5b9f[_0x04e1('0x1d')]({'name':_0x3cb622['idField'],'value':_0x3622b1[_0x3cb622[_0x04e1('0x1e')]]});}});}return request({'form':{'method':_0x04e1('0x1f'),'input_type':_0x04e1('0x20'),'response_type':_0x04e1('0x20'),'rest_data':JSON['stringify']({'session':_0x4fdd44['id'],'module_name':_0x04e1('0x21'),'name_value_list':_0x1d5b9f})}});}function getAuth(_0x2d6d51){return util[_0x04e1('0x22')](_0x04e1('0x23'),new Buffer(_0x2d6d51[_0x04e1('0x24')]+':X')[_0x04e1('0x25')](_0x04e1('0x26')));}function getServerInfo(_0x33c1c2){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x04e1('0x20'),'rest_data':JSON[_0x04e1('0x27')]({'session':_0x33c1c2['id']})}});}function getUser(_0x33a649,_0x2252d5,_0x30e811){if(!_[_0x04e1('0x28')](_0x2252d5)){logger[_0x04e1('0x29')](_0x04e1('0x2a'),_0x2252d5);return request({'form':{'method':_0x04e1('0x2b'),'input_type':_0x04e1('0x20'),'response_type':_0x04e1('0x20'),'rest_data':JSON[_0x04e1('0x27')]({'session':_0x30e811['id'],'module_name':'Employees','query':util[_0x04e1('0x22')](_0x04e1('0x2c'),_0x2252d5),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x04e1('0x2d')](function(_0xb52a51){if(_0xb52a51[_0x04e1('0x2e')]['length']){var _0x4a1f3f=_['find'](_0xb52a51[_0x04e1('0x2e')],function(_0x2e8c77){return _0x2e8c77[_0x04e1('0x2f')][_0x04e1('0x30')][_0x04e1('0x31')]===_0x2252d5;});if(_0x4a1f3f){logger[_0x04e1('0x29')](_0x04e1('0x32'));return BPromise[_0x04e1('0x33')]({'id':_0x4a1f3f['name_value_list']['id'][_0x04e1('0x31')],'name':_0x4a1f3f[_0x04e1('0x2f')][_0x04e1('0x1a')][_0x04e1('0x31')]});}}logger[_0x04e1('0x29')](_0x04e1('0x34'));return BPromise[_0x04e1('0x33')]({'id':_0x30e811['name_value_list'][_0x04e1('0x35')][_0x04e1('0x31')],'name':_0x30e811[_0x04e1('0x2f')][_0x04e1('0x30')]['value']});});}else{logger['info'](_0x04e1('0x36'));return BPromise['resolve']({'id':_0x30e811[_0x04e1('0x2f')][_0x04e1('0x35')][_0x04e1('0x31')],'name':_0x30e811[_0x04e1('0x2f')]['user_name']['value']});}}function getEndUser(_0x2f3b74,_0x2cde28,_0xbc6727,_0x317b0c){logger[_0x04e1('0x29')](_0x04e1('0x37'),_0xbc6727);return request({'form':{'method':_0x04e1('0x2b'),'input_type':'JSON','response_type':_0x04e1('0x20'),'rest_data':JSON['stringify']({'session':_0x317b0c['id'],'module_name':_0x04e1('0x18'),'query':util[_0x04e1('0x22')](_0x04e1('0x38'),_0xbc6727),'order_by':'','offset':'0','select_fields':['id',_0x04e1('0x1a'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x04e1('0x2d')](function(_0x4affe1){if(_0x4affe1[_0x04e1('0x2e')][_0x04e1('0x39')]){var _0x1e5b4d=_[_0x04e1('0x3a')](_0x4affe1[_0x04e1('0x2e')],function(_0x3fac00){return _0x3fac00['name_value_list'][_0x04e1('0x3b')][_0x04e1('0x31')]===_0xbc6727;});if(_0x1e5b4d){logger[_0x04e1('0x29')](_0x04e1('0x3c'));return BPromise['resolve']({'id':_0x1e5b4d[_0x04e1('0x2f')]['id'][_0x04e1('0x31')],'name':_0x1e5b4d[_0x04e1('0x2f')][_0x04e1('0x1a')]['value'],'phone':_0x1e5b4d[_0x04e1('0x2f')]['phone_home'][_0x04e1('0x31')]});}}else{logger[_0x04e1('0x29')](_0x04e1('0x3d'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x04e1('0x20'),'rest_data':JSON[_0x04e1('0x27')]({'session':_0x317b0c['id'],'module_name':_0x04e1('0x18'),'name_value_list':[{'name':'first_name','value':_0x2cde28!==_0x04e1('0x3e')?_0x2cde28:util[_0x04e1('0x22')]('Caller\x20-\x20%s',_0xbc6727)},{'name':_0x04e1('0x3b'),'value':_0xbc6727}]})}})[_0x04e1('0x2d')](function(_0xe2c644){logger[_0x04e1('0x29')](_0x04e1('0x3f'));return BPromise[_0x04e1('0x33')]({'id':_0xe2c644['id'],'name':_0xe2c644[_0x04e1('0x2e')]['first_name']['value'],'phone':_0xe2c644[_0x04e1('0x2e')][_0x04e1('0x3b')][_0x04e1('0x31')]});});}});}function request(_0x58150c){logger['debug'](_0x04e1('0x40'),JSON[_0x04e1('0x27')](_0x58150c));return rp(_['merge'](def,_0x58150c));}function getTags(_0x269f32,_0x3dcab0){var _0x28d976=[];if(_0x269f32&&_0x269f32['length']>0x0){_0x28d976=_[_0x04e1('0x41')](_0x269f32,_0x3dcab0);}return _0x28d976;}function getCustomFields(_0x3b9445,_0x109d35){var _0x158840=[];var _0xe87c0f={'custom_fields':[]};if(_0x3b9445[_0x04e1('0x39')]>0x0){_['forEach'](_0x3b9445,function(_0x170df2){if(_0x170df2[_0x04e1('0x42')]==='string'&&_0x170df2[_0x04e1('0x43')]&&!_0x170df2[_0x04e1('0x44')]){_0xe87c0f[_0x170df2['nameField'][_0x04e1('0x45')]()]=_0x170df2[_0x04e1('0x46')][_0x04e1('0x25')]();}else if(_0x170df2['type']==='string'&&_0x170df2[_0x04e1('0x47')]&&_0x170df2[_0x04e1('0x44')]){_0xe87c0f[_0x04e1('0x48')]['push']({'id':_0x170df2[_0x04e1('0x47')],'value':_0x170df2[_0x04e1('0x46')][_0x04e1('0x25')]()});}else if(_0x170df2['type']==='variable'&&_0x170df2['variableName']&&_0x170df2[_0x04e1('0x47')]&&_0x170df2['customField']){_0x109d35[_0x170df2[_0x04e1('0x1e')]]&&_0xe87c0f[_0x04e1('0x48')][_0x04e1('0x1d')]({'id':_0x170df2['idField'],'value':_0x109d35[_0x170df2[_0x04e1('0x1e')]][_0x04e1('0x25')]()});}else if(_0x170df2['type']===_0x04e1('0x49')&&_0x170df2['Variable']&&_0x170df2[_0x04e1('0x4a')][_0x04e1('0x1a')]&&_0x170df2[_0x04e1('0x47')]&&_0x170df2[_0x04e1('0x44')]){_0x109d35[_0x170df2[_0x04e1('0x4a')][_0x04e1('0x1a')][_0x04e1('0x45')]()]&&_0xe87c0f[_0x04e1('0x48')][_0x04e1('0x1d')]({'id':_0x170df2[_0x04e1('0x47')],'value':_0x109d35[_0x170df2[_0x04e1('0x4a')]['name'][_0x04e1('0x45')]()][_0x04e1('0x25')]()});}});}return _0xe87c0f;}function getConnection(_0x4eaef7){return request({'method':'POST','form':{'method':_0x04e1('0x4b'),'input_type':_0x04e1('0x20'),'response_type':_0x04e1('0x20'),'rest_data':JSON[_0x04e1('0x27')]({'user_auth':{'user_name':_0x4eaef7[_0x04e1('0x4c')],'password':_0x4eaef7['password'],'encryption':_0x04e1('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x40ce94){var _0x5ab2bb=_0x40ce94;if(_0x5ab2bb['id']){def[_0x04e1('0x4e')]=_0x5ab2bb['id'];return BPromise['resolve'](_0x5ab2bb);}else{throw new Error(util[_0x04e1('0x22')](_0x04e1('0x4f'),_0x4eaef7['id']));}});}function setRelationship(_0x1ba455,_0x362c89,_0x5e56e4,_0x172156){return request({'form':{'method':_0x04e1('0x50'),'input_type':_0x04e1('0x20'),'response_type':_0x04e1('0x20'),'rest_data':JSON[_0x04e1('0x27')]({'session':_0x1ba455['id'],'module_name':_0x04e1('0x21'),'module_id':_0x5e56e4['id'],'link_field_name':_0x172156,'related_ids':[_0x362c89['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x04e1('0x51')]=function(_0x22aa93,_0xf5cc36,_0x5b4888,_0x477df6,_0x463f07,_0xe27ba0){var _0x361150,_0x4b20d6,_0x464001,_0x1adc89;_0xe27ba0[_0x04e1('0x52')]=intUtil[_0x04e1('0x53')](_0xe27ba0['remoteUri']);_0xe27ba0['serverUrl']=intUtil[_0x04e1('0x53')](_0xe27ba0[_0x04e1('0x54')]);def[_0x04e1('0x55')]=util[_0x04e1('0x22')](_0x04e1('0x56'),_0xe27ba0['remoteUri']);if(_0x463f07&&_0x463f07[_0x04e1('0x57')]){logger['info'](_0x04e1('0x58'),_0x04e1('0x59'));_0xf5cc36['recordingURL']=util[_0x04e1('0x22')](_0x04e1('0x5a'),_0xe27ba0['serverUrl'],_0xf5cc36[_0x04e1('0x5b')],md5(_0xf5cc36['uniqueid']));}else{_0xf5cc36[_0x04e1('0x5c')]='';}return getConnection(_0xe27ba0)[_0x04e1('0x2d')](function(_0x10a787){_0x1adc89=_0x10a787;return getUser(_0xe27ba0,_0x477df6['name'],_0x1adc89);})['then'](function(_0x599a9f){_0x361150=_0x599a9f;logger[_0x04e1('0x29')](_0x04e1('0x5d'),_0x361150['id']);return getEndUser(_0xe27ba0,_0xf5cc36[_0x04e1('0x5e')],_0xf5cc36['calleridnum'],_0x1adc89);})[_0x04e1('0x2d')](function(_0x3067ea){_0x4b20d6=_0x3067ea;logger[_0x04e1('0x29')]('The\x20Enduser\x20ID\x20is:',_0x4b20d6['id']);return getTicket(_0xe27ba0,_0x361150,_0x4b20d6,_0x5b4888,_0xf5cc36,_0x5b4888['Fields'],_0x1adc89,_0x04e1('0x5f'));})[_0x04e1('0x2d')](function(_0x1a9a0d){_0x464001=_0x1a9a0d;logger[_0x04e1('0x29')](_0x04e1('0x60'));logger[_0x04e1('0x29')](_0x04e1('0x61'),_0x464001['id']);return setRelationship(_0x1adc89,_0x361150,_0x464001,_0x04e1('0x62'));})['then'](function(){return setRelationship(_0x1adc89,_0x4b20d6,_0x464001,_0x04e1('0x63'));})[_0x04e1('0x2d')](function(){return getServerInfo(_0x1adc89);})[_0x04e1('0x2d')](function(_0x4d87a2){var _0x55f254=parseInt(_0x4d87a2[_0x04e1('0x64')][_0x04e1('0x65')](0x0));var _0x17565c=util[_0x04e1('0x22')](_0x04e1('0x66'),_0xe27ba0[_0x04e1('0x52')],_0x464001['id']);if(_0x55f254>0x6){_0x17565c=util[_0x04e1('0x22')](_0x04e1('0x67'),_0xe27ba0['remoteUri'],_0x464001['id']);}logger[_0x04e1('0x29')]('[QUEUE]',_0x04e1('0x68'));emit(util['format'](_0x04e1('0x69'),_0x477df6[_0x04e1('0x1a')]),_0x04e1('0x6a'),{'uri':_0x17565c});})[_0x04e1('0x6b')](function(_0x1d8284){logger[_0x04e1('0x6c')](_0x04e1('0x58'),JSON[_0x04e1('0x27')](_0x1d8284));});};exports[_0x04e1('0x6d')]=function(_0x13b571,_0x272444,_0x335b2a,_0x167c64,_0x9ccb43,_0x5ebb14,_0x31f328){var _0x5ca0ec,_0x463345,_0x41b628,_0x270c99;_0x5ebb14['remoteUri']=intUtil[_0x04e1('0x53')](_0x5ebb14[_0x04e1('0x52')]);_0x5ebb14[_0x04e1('0x54')]=intUtil[_0x04e1('0x53')](_0x5ebb14[_0x04e1('0x54')]);def[_0x04e1('0x55')]=util[_0x04e1('0x22')]('%s/service/v4_1/rest.php',_0x5ebb14[_0x04e1('0x52')]);if(_0x31f328&&_0x31f328[_0x04e1('0x6e')]&&_0x31f328[_0x04e1('0x6e')]!==_0x04e1('0x6f')){logger[_0x04e1('0x29')](_0x04e1('0x70'),'Recording\x20is\x20enabled!');_0x272444[_0x04e1('0x5c')]=util[_0x04e1('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5ebb14[_0x04e1('0x54')],_0x272444['uniqueid'],md5(_0x272444[_0x04e1('0x5b')]));}return getConnection(_0x5ebb14)[_0x04e1('0x2d')](function(_0x108b74){_0x270c99=_0x108b74;return getUser(_0x5ebb14,_0x167c64['name'],_0x270c99);})[_0x04e1('0x2d')](function(_0x24aefc){_0x5ca0ec=_0x24aefc;logger[_0x04e1('0x29')]('The\x20User\x20ID\x20is:',_0x5ca0ec['id']);return getEndUser(_0x5ebb14,_0x272444[_0x04e1('0x71')],_0x272444[_0x04e1('0x72')],_0x270c99);})[_0x04e1('0x2d')](function(_0x56650a){_0x463345=_0x56650a;logger['info'](_0x04e1('0x73'),_0x463345['id']);return getTicket(_0x5ebb14,_0x5ca0ec,_0x463345,_0x335b2a,_0x272444,_0x335b2a[_0x04e1('0x74')],_0x270c99,_0x04e1('0x75'));})[_0x04e1('0x2d')](function(_0x2545a4){_0x41b628=_0x2545a4;logger['info']('Ticket\x20created!');logger[_0x04e1('0x29')]('The\x20Ticket\x20ID\x20is:',_0x41b628['id']);return setRelationship(_0x270c99,_0x5ca0ec,_0x41b628,_0x04e1('0x62'));})[_0x04e1('0x2d')](function(){return setRelationship(_0x270c99,_0x463345,_0x41b628,_0x04e1('0x63'));})['then'](function(){return getServerInfo(_0x270c99);})[_0x04e1('0x2d')](function(_0x3eab04){var _0x5c5b6e=parseInt(_0x3eab04['version'][_0x04e1('0x65')](0x0));var _0x138b6d=util[_0x04e1('0x22')](_0x04e1('0x66'),_0x5ebb14[_0x04e1('0x52')],_0x41b628['id']);if(_0x5c5b6e>0x6){_0x138b6d=util[_0x04e1('0x22')](_0x04e1('0x67'),_0x5ebb14[_0x04e1('0x52')],_0x41b628['id']);}logger[_0x04e1('0x29')](_0x04e1('0x70'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x04e1('0x22')](_0x04e1('0x69'),_0x167c64['name']),_0x04e1('0x6a'),{'uri':_0x138b6d});})[_0x04e1('0x6b')](function(_0x4910d2){logger['error'](_0x04e1('0x70'),JSON[_0x04e1('0x27')](_0x4910d2));});};exports['unmanaged']=function(_0x6df01b,_0x62effa,_0x30fb0c,_0x5c84eb,_0x1573de,_0x1ecf30){var _0x1081bb,_0x18971f,_0x3728b5,_0x372564;_0x1ecf30['remoteUri']=intUtil[_0x04e1('0x53')](_0x1ecf30['remoteUri']);_0x1ecf30[_0x04e1('0x54')]=intUtil[_0x04e1('0x53')](_0x1ecf30[_0x04e1('0x54')]);def[_0x04e1('0x55')]=util[_0x04e1('0x22')](_0x04e1('0x56'),_0x1ecf30['remoteUri']);if(_0x1573de&&_0x1573de[_0x04e1('0x57')]){logger[_0x04e1('0x29')]('['+_0x62effa[_0x04e1('0x76')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x62effa['recordingURL']=util[_0x04e1('0x22')](_0x04e1('0x5a'),_0x1ecf30[_0x04e1('0x54')],_0x62effa[_0x04e1('0x5b')],md5(_0x62effa[_0x04e1('0x5b')]));}else{_0x62effa[_0x04e1('0x5c')]='';}return getConnection(_0x1ecf30)[_0x04e1('0x2d')](function(_0x2080ab){_0x372564=_0x2080ab;if(!_['isNil'](_0x5c84eb)){return getUser(_0x1ecf30,_0x5c84eb['name'],_0x372564);}else{return getUser(_0x1ecf30,null,_0x372564);}})[_0x04e1('0x2d')](function(_0x1e6462){_0x1081bb=_0x1e6462;logger[_0x04e1('0x29')](_0x04e1('0x5d'),_0x1081bb['id']);return getEndUser(_0x1ecf30,_0x62effa['calleridname'],_0x62effa[_0x04e1('0x77')],_0x372564);})['then'](function(_0x52f79e){_0x18971f=_0x52f79e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x18971f['id']);return getTicket(_0x1ecf30,_0x1081bb,_0x18971f,_0x30fb0c,_0x62effa,_0x30fb0c['Fields'],_0x372564,'Inbound');})[_0x04e1('0x2d')](function(_0x56965a){_0x3728b5=_0x56965a;logger[_0x04e1('0x29')](_0x04e1('0x60'));logger['info'](_0x04e1('0x61'),_0x3728b5['id']);return setRelationship(_0x372564,_0x1081bb,_0x3728b5,_0x04e1('0x62'));})[_0x04e1('0x2d')](function(){return setRelationship(_0x372564,_0x18971f,_0x3728b5,_0x04e1('0x63'));})['then'](function(){return getServerInfo(_0x372564);})[_0x04e1('0x6b')](function(_0x95d15f){logger[_0x04e1('0x6c')]('['+_0x62effa[_0x04e1('0x76')][_0x04e1('0x78')]()+']',JSON[_0x04e1('0x27')](_0x95d15f));});}; \ No newline at end of file +var _0xac92=['trigger:browser:url','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','users','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','push','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','resolve','name_value_list','value','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','length','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','forEach','type','string','nameField','customField','content','idField','custom_fields','variable','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','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...','catch','error','outbound','stripTrailingSlash','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','contacts','user:%s'];(function(_0x5de166,_0x27dfa8){var _0x42ec2=function(_0xbb6992){while(--_0xbb6992){_0x5de166['push'](_0x5de166['shift']());}};_0x42ec2(++_0x27dfa8);}(_0xac92,0x87));var _0x2ac9=function(_0x34ba74,_0x3edaa0){_0x34ba74=_0x34ba74-0x0;var _0x8c1e73=_0xac92[_0x34ba74];return _0x8c1e73;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x2ac9('0x0'));var util=require(_0x2ac9('0x1'));var Redis=require(_0x2ac9('0x2'));var intUtil=require(_0x2ac9('0x3'));var config=require(_0x2ac9('0x4'));var logger=require(_0x2ac9('0x5'))(_0x2ac9('0x6'));config[_0x2ac9('0x7')]=_['defaults'](config[_0x2ac9('0x7')],{'host':_0x2ac9('0x8'),'port':0x18eb});var io=require(_0x2ac9('0x9'))(new Redis(config[_0x2ac9('0x7')]));var def={'method':_0x2ac9('0xa'),'json':!![]};function emit(_0x4506d8,_0x1851cc,_0xd529ee){io['to'](_0x4506d8)[_0x2ac9('0xb')](_0x1851cc,_0xd529ee);}function getTicket(_0x4de42c,_0x23044f,_0x577c9c,_0x4cc795,_0x20a581,_0x5d163d,_0x504c01,_0x731b03){logger[_0x2ac9('0xc')](_0x2ac9('0xd'));var _0x4e776c=new Date();var _0x2c25bf=[{'name':_0x2ac9('0xe'),'value':intUtil[_0x2ac9('0xf')](_0x4cc795[_0x2ac9('0x10')],_0x20a581,'\x20')},{'name':'assigned_user_id','value':_0x23044f['id']},{'name':_0x2ac9('0x11'),'value':_0x23044f['id']},{'name':_0x2ac9('0x12'),'value':intUtil['getString'](_0x4cc795[_0x2ac9('0x13')],_0x20a581,'\x0a')},{'name':_0x2ac9('0x14'),'value':_0x4e776c[_0x2ac9('0x15')]()[_0x2ac9('0x16')](0x0,0x13)[_0x2ac9('0x17')]('T','\x20')},{'name':_0x2ac9('0x18'),'value':'0'},{'name':_0x2ac9('0x19'),'value':'15'},{'name':_0x2ac9('0x1a'),'value':_0x577c9c['id']},{'name':_0x2ac9('0x1b'),'value':'Contacts'},{'name':_0x2ac9('0x1c'),'value':_0x577c9c[_0x2ac9('0xe')]},{'name':_0x2ac9('0x1d'),'value':_0x731b03}];if(_0x5d163d['length']){_['forEach'](_0x5d163d,function(_0x29690a){if(_0x20a581[_0x29690a['variableName']]){_0x2c25bf[_0x2ac9('0x1e')]({'name':_0x29690a['idField'],'value':_0x20a581[_0x29690a[_0x2ac9('0x1f')]]});}});}return request({'form':{'method':_0x2ac9('0x20'),'input_type':_0x2ac9('0x21'),'response_type':_0x2ac9('0x21'),'rest_data':JSON[_0x2ac9('0x22')]({'session':_0x504c01['id'],'module_name':_0x2ac9('0x23'),'name_value_list':_0x2c25bf})}});}function getAuth(_0x57f90e){return util[_0x2ac9('0x24')](_0x2ac9('0x25'),new Buffer(_0x57f90e['apiKey']+':X')[_0x2ac9('0x26')](_0x2ac9('0x27')));}function getServerInfo(_0x55cc91){return request({'form':{'method':_0x2ac9('0x28'),'input_type':'JSON','response_type':_0x2ac9('0x21'),'rest_data':JSON[_0x2ac9('0x22')]({'session':_0x55cc91['id']})}});}function getUser(_0x38edaa,_0x41dad6,_0x9a7078){if(!_[_0x2ac9('0x29')](_0x41dad6)){logger[_0x2ac9('0xc')](_0x2ac9('0x2a'),_0x41dad6);return request({'form':{'method':_0x2ac9('0x2b'),'input_type':_0x2ac9('0x21'),'response_type':'JSON','rest_data':JSON[_0x2ac9('0x22')]({'session':_0x9a7078['id'],'module_name':_0x2ac9('0x2c'),'query':util['format'](_0x2ac9('0x2d'),_0x41dad6),'order_by':'','offset':'0','select_fields':['id',_0x2ac9('0xe'),_0x2ac9('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2ac9('0x2f')](function(_0x126fc3){if(_0x126fc3[_0x2ac9('0x30')]['length']){var _0x3d2946=_['find'](_0x126fc3[_0x2ac9('0x30')],function(_0x1e6114){return _0x1e6114['name_value_list'][_0x2ac9('0x2e')]['value']===_0x41dad6;});if(_0x3d2946){logger[_0x2ac9('0xc')]('Agent\x20found!');return BPromise[_0x2ac9('0x31')]({'id':_0x3d2946[_0x2ac9('0x32')]['id']['value'],'name':_0x3d2946['name_value_list'][_0x2ac9('0xe')][_0x2ac9('0x33')]});}}logger[_0x2ac9('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x2ac9('0x31')]({'id':_0x9a7078[_0x2ac9('0x32')]['user_id'][_0x2ac9('0x33')],'name':_0x9a7078['name_value_list'][_0x2ac9('0x2e')][_0x2ac9('0x33')]});});}else{logger[_0x2ac9('0xc')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x2ac9('0x31')]({'id':_0x9a7078['name_value_list'][_0x2ac9('0x34')]['value'],'name':_0x9a7078[_0x2ac9('0x32')][_0x2ac9('0x2e')]['value']});}}function getEndUser(_0x2b0933,_0x8a61aa,_0x5a6657,_0x1e22bc){logger[_0x2ac9('0xc')](_0x2ac9('0x35'),_0x5a6657);return request({'form':{'method':_0x2ac9('0x2b'),'input_type':_0x2ac9('0x21'),'response_type':_0x2ac9('0x21'),'rest_data':JSON[_0x2ac9('0x22')]({'session':_0x1e22bc['id'],'module_name':'Contacts','query':util['format'](_0x2ac9('0x36'),_0x5a6657),'order_by':'','offset':'0','select_fields':['id','name',_0x2ac9('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2ac9('0x2f')](function(_0x3c553e){if(_0x3c553e['entry_list'][_0x2ac9('0x38')]){var _0x7488a3=_[_0x2ac9('0x39')](_0x3c553e[_0x2ac9('0x30')],function(_0x5512f4){return _0x5512f4[_0x2ac9('0x32')][_0x2ac9('0x37')][_0x2ac9('0x33')]===_0x5a6657;});if(_0x7488a3){logger['info'](_0x2ac9('0x3a'));return BPromise[_0x2ac9('0x31')]({'id':_0x7488a3['name_value_list']['id'][_0x2ac9('0x33')],'name':_0x7488a3[_0x2ac9('0x32')][_0x2ac9('0xe')]['value'],'phone':_0x7488a3[_0x2ac9('0x32')][_0x2ac9('0x37')][_0x2ac9('0x33')]});}}else{logger[_0x2ac9('0xc')](_0x2ac9('0x3b'));return request({'form':{'method':_0x2ac9('0x20'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x2ac9('0x22')]({'session':_0x1e22bc['id'],'module_name':_0x2ac9('0x3c'),'name_value_list':[{'name':_0x2ac9('0x3d'),'value':_0x8a61aa!==_0x2ac9('0x3e')?_0x8a61aa:util[_0x2ac9('0x24')](_0x2ac9('0x3f'),_0x5a6657)},{'name':_0x2ac9('0x37'),'value':_0x5a6657}]})}})[_0x2ac9('0x2f')](function(_0x87db74){logger[_0x2ac9('0xc')](_0x2ac9('0x40'));return BPromise[_0x2ac9('0x31')]({'id':_0x87db74['id'],'name':_0x87db74[_0x2ac9('0x30')][_0x2ac9('0x3d')][_0x2ac9('0x33')],'phone':_0x87db74[_0x2ac9('0x30')][_0x2ac9('0x37')][_0x2ac9('0x33')]});});}});}function request(_0x134378){logger[_0x2ac9('0x41')](_0x2ac9('0x42'),JSON[_0x2ac9('0x22')](_0x134378));return rp(_['merge'](def,_0x134378));}function getTags(_0x2f5848,_0x14958c){var _0xc6a4b8=[];if(_0x2f5848&&_0x2f5848[_0x2ac9('0x38')]>0x0){_0xc6a4b8=_['map'](_0x2f5848,_0x14958c);}return _0xc6a4b8;}function getCustomFields(_0x27563c,_0x133fbc){var _0x43c5c3=[];var _0x321f16={'custom_fields':[]};if(_0x27563c['length']>0x0){_[_0x2ac9('0x43')](_0x27563c,function(_0x5ced8b){if(_0x5ced8b[_0x2ac9('0x44')]===_0x2ac9('0x45')&&_0x5ced8b[_0x2ac9('0x46')]&&!_0x5ced8b[_0x2ac9('0x47')]){_0x321f16[_0x5ced8b[_0x2ac9('0x46')]['toLowerCase']()]=_0x5ced8b[_0x2ac9('0x48')][_0x2ac9('0x26')]();}else if(_0x5ced8b[_0x2ac9('0x44')]===_0x2ac9('0x45')&&_0x5ced8b[_0x2ac9('0x49')]&&_0x5ced8b['customField']){_0x321f16[_0x2ac9('0x4a')]['push']({'id':_0x5ced8b[_0x2ac9('0x49')],'value':_0x5ced8b['content'][_0x2ac9('0x26')]()});}else if(_0x5ced8b[_0x2ac9('0x44')]===_0x2ac9('0x4b')&&_0x5ced8b['variableName']&&_0x5ced8b[_0x2ac9('0x49')]&&_0x5ced8b[_0x2ac9('0x47')]){_0x133fbc[_0x5ced8b[_0x2ac9('0x1f')]]&&_0x321f16[_0x2ac9('0x4a')][_0x2ac9('0x1e')]({'id':_0x5ced8b[_0x2ac9('0x49')],'value':_0x133fbc[_0x5ced8b[_0x2ac9('0x1f')]][_0x2ac9('0x26')]()});}else if(_0x5ced8b[_0x2ac9('0x44')]===_0x2ac9('0x4c')&&_0x5ced8b['Variable']&&_0x5ced8b[_0x2ac9('0x4d')][_0x2ac9('0xe')]&&_0x5ced8b[_0x2ac9('0x49')]&&_0x5ced8b[_0x2ac9('0x47')]){_0x133fbc[_0x5ced8b[_0x2ac9('0x4d')][_0x2ac9('0xe')][_0x2ac9('0x4e')]()]&&_0x321f16[_0x2ac9('0x4a')][_0x2ac9('0x1e')]({'id':_0x5ced8b[_0x2ac9('0x49')],'value':_0x133fbc[_0x5ced8b[_0x2ac9('0x4d')][_0x2ac9('0xe')][_0x2ac9('0x4e')]()][_0x2ac9('0x26')]()});}});}return _0x321f16;}function getConnection(_0x68bf41){return request({'method':_0x2ac9('0xa'),'form':{'method':_0x2ac9('0x4f'),'input_type':_0x2ac9('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x68bf41[_0x2ac9('0x50')],'password':_0x68bf41[_0x2ac9('0x51')],'encryption':_0x2ac9('0x52')},'application':_0x2ac9('0x53')})}})[_0x2ac9('0x2f')](function(_0x48c93d){var _0xa1b75b=_0x48c93d;if(_0xa1b75b['id']){def[_0x2ac9('0x54')]=_0xa1b75b['id'];return BPromise[_0x2ac9('0x31')](_0xa1b75b);}else{throw new Error(util[_0x2ac9('0x24')]('Account\x20%d\x20is\x20not\x20valid',_0x68bf41['id']));}});}function setRelationship(_0xdb3c6b,_0x8b5bde,_0x496a50,_0x252e26){return request({'form':{'method':_0x2ac9('0x55'),'input_type':_0x2ac9('0x21'),'response_type':_0x2ac9('0x21'),'rest_data':JSON['stringify']({'session':_0xdb3c6b['id'],'module_name':_0x2ac9('0x23'),'module_id':_0x496a50['id'],'link_field_name':_0x252e26,'related_ids':[_0x8b5bde['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2ac9('0x56')]=function(_0x23dd41,_0x21cbcb,_0x3b670a,_0x3970da,_0x32abe0,_0x25e515){var _0xd5906,_0x12b721,_0x31b91e,_0x9ace8c;_0x25e515[_0x2ac9('0x57')]=intUtil['stripTrailingSlash'](_0x25e515[_0x2ac9('0x57')]);_0x25e515[_0x2ac9('0x58')]=intUtil['stripTrailingSlash'](_0x25e515[_0x2ac9('0x58')]);def[_0x2ac9('0x59')]=util['format'](_0x2ac9('0x5a'),_0x25e515[_0x2ac9('0x57')]);if(_0x32abe0&&_0x32abe0[_0x2ac9('0x5b')]){logger[_0x2ac9('0xc')](_0x2ac9('0x5c'),_0x2ac9('0x5d'));_0x21cbcb[_0x2ac9('0x5e')]=util[_0x2ac9('0x24')](_0x2ac9('0x5f'),_0x25e515[_0x2ac9('0x58')],_0x21cbcb[_0x2ac9('0x60')],md5(_0x21cbcb[_0x2ac9('0x60')]));}else{_0x21cbcb[_0x2ac9('0x5e')]='';}return getConnection(_0x25e515)[_0x2ac9('0x2f')](function(_0x2d209d){_0x9ace8c=_0x2d209d;return getUser(_0x25e515,_0x3970da[_0x2ac9('0xe')],_0x9ace8c);})['then'](function(_0x3fd80d){_0xd5906=_0x3fd80d;logger[_0x2ac9('0xc')]('The\x20User\x20ID\x20is:',_0xd5906['id']);return getEndUser(_0x25e515,_0x21cbcb['calleridname'],_0x21cbcb['calleridnum'],_0x9ace8c);})['then'](function(_0x58cf49){_0x12b721=_0x58cf49;logger[_0x2ac9('0xc')]('The\x20Enduser\x20ID\x20is:',_0x12b721['id']);return getTicket(_0x25e515,_0xd5906,_0x12b721,_0x3b670a,_0x21cbcb,_0x3b670a['Fields'],_0x9ace8c,'Inbound');})[_0x2ac9('0x2f')](function(_0x3bf871){_0x31b91e=_0x3bf871;logger[_0x2ac9('0xc')](_0x2ac9('0x61'));logger[_0x2ac9('0xc')](_0x2ac9('0x62'),_0x31b91e['id']);return setRelationship(_0x9ace8c,_0xd5906,_0x31b91e,'users');})[_0x2ac9('0x2f')](function(){return setRelationship(_0x9ace8c,_0x12b721,_0x31b91e,'contacts');})[_0x2ac9('0x2f')](function(){return getServerInfo(_0x9ace8c);})[_0x2ac9('0x2f')](function(_0x1999c0){var _0x36cbd9=parseInt(_0x1999c0[_0x2ac9('0x63')][_0x2ac9('0x64')](0x0));var _0x3bd182=util['format'](_0x2ac9('0x65'),_0x25e515[_0x2ac9('0x57')],_0x31b91e['id']);if(_0x36cbd9>0x6){_0x3bd182=util['format'](_0x2ac9('0x66'),_0x25e515['remoteUri'],_0x31b91e['id']);}logger[_0x2ac9('0xc')](_0x2ac9('0x5c'),_0x2ac9('0x67'));emit(util[_0x2ac9('0x24')]('user:%s',_0x3970da[_0x2ac9('0xe')]),'trigger:browser:url',{'uri':_0x3bd182});})[_0x2ac9('0x68')](function(_0xf2c286){logger[_0x2ac9('0x69')](_0x2ac9('0x5c'),JSON[_0x2ac9('0x22')](_0xf2c286));});};exports[_0x2ac9('0x6a')]=function(_0x3c97cb,_0x37b4dc,_0xd05342,_0x360efd,_0x335cb4,_0x5cb24d,_0x41dff1){var _0xe22f67,_0x4a41ba,_0x38dd29,_0xab134;_0x5cb24d['remoteUri']=intUtil['stripTrailingSlash'](_0x5cb24d[_0x2ac9('0x57')]);_0x5cb24d[_0x2ac9('0x58')]=intUtil[_0x2ac9('0x6b')](_0x5cb24d[_0x2ac9('0x58')]);def[_0x2ac9('0x59')]=util[_0x2ac9('0x24')](_0x2ac9('0x5a'),_0x5cb24d[_0x2ac9('0x57')]);if(_0x41dff1&&_0x41dff1['recordingFormat']&&_0x41dff1['recordingFormat']!==_0x2ac9('0x6c')){logger[_0x2ac9('0xc')](_0x2ac9('0x6d'),'Recording\x20is\x20enabled!');_0x37b4dc[_0x2ac9('0x5e')]=util[_0x2ac9('0x24')](_0x2ac9('0x5f'),_0x5cb24d[_0x2ac9('0x58')],_0x37b4dc[_0x2ac9('0x60')],md5(_0x37b4dc[_0x2ac9('0x60')]));}return getConnection(_0x5cb24d)[_0x2ac9('0x2f')](function(_0x42b028){_0xab134=_0x42b028;return getUser(_0x5cb24d,_0x360efd['name'],_0xab134);})['then'](function(_0xb48eb1){_0xe22f67=_0xb48eb1;logger['info']('The\x20User\x20ID\x20is:',_0xe22f67['id']);return getEndUser(_0x5cb24d,_0x37b4dc[_0x2ac9('0x6e')],_0x37b4dc[_0x2ac9('0x6f')],_0xab134);})[_0x2ac9('0x2f')](function(_0x476285){_0x4a41ba=_0x476285;logger[_0x2ac9('0xc')](_0x2ac9('0x70'),_0x4a41ba['id']);return getTicket(_0x5cb24d,_0xe22f67,_0x4a41ba,_0xd05342,_0x37b4dc,_0xd05342[_0x2ac9('0x71')],_0xab134,_0x2ac9('0x72'));})[_0x2ac9('0x2f')](function(_0x490655){_0x38dd29=_0x490655;logger['info']('Ticket\x20created!');logger[_0x2ac9('0xc')](_0x2ac9('0x62'),_0x38dd29['id']);return setRelationship(_0xab134,_0xe22f67,_0x38dd29,'users');})[_0x2ac9('0x2f')](function(){return setRelationship(_0xab134,_0x4a41ba,_0x38dd29,_0x2ac9('0x73'));})[_0x2ac9('0x2f')](function(){return getServerInfo(_0xab134);})['then'](function(_0xb4c083){var _0x499843=parseInt(_0xb4c083[_0x2ac9('0x63')][_0x2ac9('0x64')](0x0));var _0x5ad97c=util[_0x2ac9('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x5cb24d['remoteUri'],_0x38dd29['id']);if(_0x499843>0x6){_0x5ad97c=util[_0x2ac9('0x24')](_0x2ac9('0x66'),_0x5cb24d[_0x2ac9('0x57')],_0x38dd29['id']);}logger[_0x2ac9('0xc')](_0x2ac9('0x6d'),_0x2ac9('0x67'));emit(util[_0x2ac9('0x24')](_0x2ac9('0x74'),_0x360efd[_0x2ac9('0xe')]),_0x2ac9('0x75'),{'uri':_0x5ad97c});})[_0x2ac9('0x68')](function(_0xae1535){logger['error'](_0x2ac9('0x6d'),JSON['stringify'](_0xae1535));});};exports[_0x2ac9('0x76')]=function(_0x262582,_0x1120da,_0xe430fc,_0x3ccb48,_0x45e551,_0x118e87){var _0x3b0579,_0x55d7a3,_0x3c909f,_0x5337c5;_0x118e87[_0x2ac9('0x57')]=intUtil['stripTrailingSlash'](_0x118e87[_0x2ac9('0x57')]);_0x118e87[_0x2ac9('0x58')]=intUtil[_0x2ac9('0x6b')](_0x118e87[_0x2ac9('0x58')]);def[_0x2ac9('0x59')]=util[_0x2ac9('0x24')](_0x2ac9('0x5a'),_0x118e87[_0x2ac9('0x57')]);if(_0x45e551&&_0x45e551['monitor_format']){logger[_0x2ac9('0xc')]('['+_0x1120da[_0x2ac9('0x77')][_0x2ac9('0x78')]()+']','Recording\x20is\x20enabled!');_0x1120da[_0x2ac9('0x5e')]=util[_0x2ac9('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x118e87[_0x2ac9('0x58')],_0x1120da['uniqueid'],md5(_0x1120da[_0x2ac9('0x60')]));}else{_0x1120da[_0x2ac9('0x5e')]='';}return getConnection(_0x118e87)[_0x2ac9('0x2f')](function(_0x11da77){_0x5337c5=_0x11da77;if(!_[_0x2ac9('0x29')](_0x3ccb48)){return getUser(_0x118e87,_0x3ccb48[_0x2ac9('0xe')],_0x5337c5);}else{return getUser(_0x118e87,null,_0x5337c5);}})[_0x2ac9('0x2f')](function(_0x5ea3fc){_0x3b0579=_0x5ea3fc;logger[_0x2ac9('0xc')](_0x2ac9('0x79'),_0x3b0579['id']);return getEndUser(_0x118e87,_0x1120da[_0x2ac9('0x7a')],_0x1120da[_0x2ac9('0x7b')],_0x5337c5);})['then'](function(_0x3a6601){_0x55d7a3=_0x3a6601;logger[_0x2ac9('0xc')](_0x2ac9('0x70'),_0x55d7a3['id']);return getTicket(_0x118e87,_0x3b0579,_0x55d7a3,_0xe430fc,_0x1120da,_0xe430fc['Fields'],_0x5337c5,_0x2ac9('0x7c'));})[_0x2ac9('0x2f')](function(_0x24b082){_0x3c909f=_0x24b082;logger['info']('Ticket\x20created!');logger[_0x2ac9('0xc')](_0x2ac9('0x62'),_0x3c909f['id']);return setRelationship(_0x5337c5,_0x3b0579,_0x3c909f,_0x2ac9('0x7d'));})[_0x2ac9('0x2f')](function(){return setRelationship(_0x5337c5,_0x55d7a3,_0x3c909f,_0x2ac9('0x73'));})[_0x2ac9('0x2f')](function(){return getServerInfo(_0x5337c5);})[_0x2ac9('0x68')](function(_0x10ba7f){logger[_0x2ac9('0x69')]('['+_0x1120da['lastevent']['toUpperCase']()+']',JSON[_0x2ac9('0x22')](_0x10ba7f));});}; \ 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 de54d0e..1887492 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 _0x876c=['variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','format','slice','lastIndexOf','validateEmail','isNil','test','util','getString','sortBy','type','string','variable'];(function(_0x20c6b1,_0xf79785){var _0x59682d=function(_0x3d0266){while(--_0x3d0266){_0x20c6b1['push'](_0x20c6b1['shift']());}};_0x59682d(++_0xf79785);}(_0x876c,0xba));var _0xc876=function(_0xa9c44c,_0x3a105c){_0xa9c44c=_0xa9c44c-0x0;var _0x2bc959=_0x876c[_0xa9c44c];return _0x2bc959;};'use strict';var _=require('lodash');var util=require(_0xc876('0x0'));exports[_0xc876('0x1')]=function(_0xf40fb7,_0xd10b84,_0x238d5c){var _0x20f08d=[];if(_0xf40fb7['length']>0x0){var _0x2ed538=_[_0xc876('0x2')](_0xf40fb7,['id']);for(var _0x5960af=0x0;_0x5960af<_0x2ed538['length'];_0x5960af++){var _0x39f96f=_0x2ed538[_0x5960af];if(_0x39f96f[_0xc876('0x3')]===_0xc876('0x4')){_0x20f08d['push'](_0x39f96f['content']);}else if(_0x39f96f[_0xc876('0x3')]===_0xc876('0x5')&&_0x39f96f[_0xc876('0x6')]){_0xd10b84[_0x39f96f[_0xc876('0x6')]]&&_0x20f08d[_0xc876('0x7')](_0xd10b84[_0x39f96f[_0xc876('0x6')]][_0xc876('0x8')]());}else if(_0x39f96f[_0xc876('0x3')]===_0xc876('0x9')&&_0x39f96f[_0xc876('0xa')]&&_0x39f96f[_0xc876('0xa')][_0xc876('0xb')]){_0xd10b84[_0x39f96f[_0xc876('0xa')][_0xc876('0xb')]['toLowerCase']()]&&_0x20f08d[_0xc876('0x7')](_0xd10b84[_0x39f96f[_0xc876('0xa')][_0xc876('0xb')][_0xc876('0xc')]()][_0xc876('0x8')]());}else if(_0x39f96f[_0xc876('0x3')]===_0xc876('0xd')){if(_0x39f96f[_0xc876('0xe')]===_0xc876('0x4')&&_0x39f96f[_0xc876('0xf')]){_0x20f08d['push'](util['format'](_0xc876('0x10'),_0x39f96f[_0xc876('0xf')],_0x39f96f[_0xc876('0x11')]));}else if(_0x39f96f['keyType']===_0xc876('0x5')&&_0x39f96f[_0xc876('0x6')]&&_0x39f96f[_0xc876('0xf')]){_0xd10b84[_0x39f96f[_0xc876('0x6')]]&&_0x20f08d[_0xc876('0x7')](util[_0xc876('0x12')](_0xc876('0x10'),_0x39f96f['key'],_0xd10b84[_0x39f96f[_0xc876('0x6')]]));}else if(_0x39f96f[_0xc876('0xe')]==='customVariable'&&_0x39f96f['Variable']&&_0x39f96f[_0xc876('0xa')][_0xc876('0xb')]&&_0x39f96f[_0xc876('0xf')]){_0xd10b84[_0x39f96f['Variable'][_0xc876('0xb')][_0xc876('0xc')]()]&&_0x20f08d[_0xc876('0x7')](util[_0xc876('0x12')](_0xc876('0x10'),_0x39f96f[_0xc876('0xf')],_0xd10b84[_0x39f96f['Variable'][_0xc876('0xb')]['toLowerCase']()]));}}}}return _0x20f08d['join'](_0x238d5c);};exports['stripTrailingSlash']=function(_0x3c0226){var _0x1efed3=_0x3c0226[_0xc876('0x13')](-0x1);if(_0x1efed3==='/'){_0x3c0226=_0x3c0226['substring'](0x0,_0x3c0226[_0xc876('0x14')](_0x1efed3));}return _0x3c0226;};exports[_0xc876('0x15')]=function(_0x56e552){if(!_[_0xc876('0x16')](_0x56e552)&&_0x56e552!==''){var _0x16a9d3=/^(([^<>()\[\]\\.,;:\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 _0x16a9d3[_0xc876('0x17')](String(_0x56e552)[_0xc876('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x8569=['test','lodash','util','length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','slice','substring','validateEmail','isNil'];(function(_0x1c3ab8,_0x9ba07f){var _0x2c7492=function(_0x10d74b){while(--_0x10d74b){_0x1c3ab8['push'](_0x1c3ab8['shift']());}};_0x2c7492(++_0x9ba07f);}(_0x8569,0x91));var _0x9856=function(_0x13e724,_0x296739){_0x13e724=_0x13e724-0x0;var _0x334a44=_0x8569[_0x13e724];return _0x334a44;};'use strict';var _=require(_0x9856('0x0'));var util=require(_0x9856('0x1'));exports['getString']=function(_0x39e1eb,_0x865041,_0x1ea06f){var _0x3e4fa9=[];if(_0x39e1eb[_0x9856('0x2')]>0x0){var _0x28a804=_['sortBy'](_0x39e1eb,['id']);for(var _0x4adc2e=0x0;_0x4adc2e<_0x28a804[_0x9856('0x2')];_0x4adc2e++){var _0x4e8669=_0x28a804[_0x4adc2e];if(_0x4e8669[_0x9856('0x3')]===_0x9856('0x4')){_0x3e4fa9[_0x9856('0x5')](_0x4e8669[_0x9856('0x6')]);}else if(_0x4e8669[_0x9856('0x3')]===_0x9856('0x7')&&_0x4e8669[_0x9856('0x8')]){_0x865041[_0x4e8669[_0x9856('0x8')]]&&_0x3e4fa9['push'](_0x865041[_0x4e8669[_0x9856('0x8')]][_0x9856('0x9')]());}else if(_0x4e8669[_0x9856('0x3')]===_0x9856('0xa')&&_0x4e8669[_0x9856('0xb')]&&_0x4e8669[_0x9856('0xb')][_0x9856('0xc')]){_0x865041[_0x4e8669[_0x9856('0xb')][_0x9856('0xc')]['toLowerCase']()]&&_0x3e4fa9[_0x9856('0x5')](_0x865041[_0x4e8669[_0x9856('0xb')][_0x9856('0xc')][_0x9856('0xd')]()]['toString']());}else if(_0x4e8669['type']===_0x9856('0xe')){if(_0x4e8669[_0x9856('0xf')]===_0x9856('0x4')&&_0x4e8669[_0x9856('0x10')]){_0x3e4fa9[_0x9856('0x5')](util[_0x9856('0x11')]('%s:\x20%s',_0x4e8669[_0x9856('0x10')],_0x4e8669['keyContent']));}else if(_0x4e8669[_0x9856('0xf')]===_0x9856('0x7')&&_0x4e8669[_0x9856('0x8')]&&_0x4e8669[_0x9856('0x10')]){_0x865041[_0x4e8669[_0x9856('0x8')]]&&_0x3e4fa9[_0x9856('0x5')](util[_0x9856('0x11')](_0x9856('0x12'),_0x4e8669[_0x9856('0x10')],_0x865041[_0x4e8669[_0x9856('0x8')]]));}else if(_0x4e8669[_0x9856('0xf')]==='customVariable'&&_0x4e8669[_0x9856('0xb')]&&_0x4e8669[_0x9856('0xb')]['name']&&_0x4e8669['key']){_0x865041[_0x4e8669[_0x9856('0xb')][_0x9856('0xc')][_0x9856('0xd')]()]&&_0x3e4fa9[_0x9856('0x5')](util[_0x9856('0x11')]('%s:\x20%s',_0x4e8669[_0x9856('0x10')],_0x865041[_0x4e8669[_0x9856('0xb')][_0x9856('0xc')][_0x9856('0xd')]()]));}}}}return _0x3e4fa9['join'](_0x1ea06f);};exports['stripTrailingSlash']=function(_0x5789a3){var _0x587677=_0x5789a3[_0x9856('0x13')](-0x1);if(_0x587677==='/'){_0x5789a3=_0x5789a3[_0x9856('0x14')](0x0,_0x5789a3['lastIndexOf'](_0x587677));}return _0x5789a3;};exports[_0x9856('0x15')]=function(_0x422230){if(!_[_0x9856('0x16')](_0x422230)&&_0x422230!==''){var _0x14dd72=/^(([^<>()\[\]\\.,;:\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 _0x14dd72[_0x9856('0x17')](String(_0x422230)['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 95c8661..818a7c0 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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','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','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x599346,_0x412daf){var _0x39f8c4=function(_0x3b445d){while(--_0x3b445d){_0x599346['push'](_0x599346['shift']());}};_0x39f8c4(++_0x412daf);}(_0xe706,0xa3));var _0x6e70=function(_0x12ff2c,_0x4cab86){_0x12ff2c=_0x12ff2c-0x0;var _0x2467a3=_0xe706[_0x12ff2c];return _0x2467a3;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','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','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x48d2b7,_0x41e772){var _0x2e7b8c=function(_0x55fe20){while(--_0x55fe20){_0x48d2b7['push'](_0x48d2b7['shift']());}};_0x2e7b8c(++_0x41e772);}(_0xe706,0xa3));var _0x6e70=function(_0x5982a5,_0x3dc07b){_0x5982a5=_0x5982a5-0x0;var _0x159c80=_0xe706[_0x5982a5];return _0x159c80;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ 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 827635b..5412ed7 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 _0x0cbc=['outbound','recordingFormat','none','uniqueid','Authorization','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','password','%s:%s','authType','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%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','catch','inspect'];(function(_0x5e40ee,_0x67c271){var _0x1738b4=function(_0x2346cd){while(--_0x2346cd){_0x5e40ee['push'](_0x5e40ee['shift']());}};_0x1738b4(++_0x67c271);}(_0x0cbc,0x1cd));var _0xc0cb=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0x0cbc[_0x30bd4d];return _0x306915;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xc0cb('0x0'));var util=require(_0xc0cb('0x1'));var Redis=require(_0xc0cb('0x2'));var intUtil=require(_0xc0cb('0x3'));var config=require(_0xc0cb('0x4'));var logger=require(_0xc0cb('0x5'))(_0xc0cb('0x6'));config[_0xc0cb('0x7')]=_[_0xc0cb('0x8')](config[_0xc0cb('0x7')],{'host':_0xc0cb('0x9'),'port':0x18eb});var io=require(_0xc0cb('0xa'))(new Redis(config[_0xc0cb('0x7')]));function emit(_0x382afc,_0x1fa903,_0x46debc){io['to'](_0x382afc)['emit'](_0x1fa903,_0x46debc);}var headers={'Content-Type':_0xc0cb('0xb'),'Accept':'application/json'};function getTicket(_0x1c0f1b,_0x12f5d5,_0x33adcf,_0xc81337,_0x51ed8d){logger[_0xc0cb('0xc')](_0xc0cb('0xd'));return request({'uri':util[_0xc0cb('0xe')](_0xc0cb('0xf'),_0x1c0f1b[_0xc0cb('0x10')]),'method':_0xc0cb('0x11'),'body':{'ticket':_[_0xc0cb('0x12')]({'requester_id':_0x33adcf['id'],'submitter_id':_0x12f5d5?_0x12f5d5['id']:undefined,'assignee_id':_0x12f5d5?_0x12f5d5['id']:undefined,'tags':getTags(_0xc81337[_0xc0cb('0x13')],_0xc0cb('0x14')),'subject':intUtil['getString'](_0xc81337[_0xc0cb('0x15')],_0x51ed8d,'\x20'),'description':intUtil[_0xc0cb('0x16')](_0xc81337[_0xc0cb('0x17')],_0x51ed8d,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc0cb('0x16')](_0xc81337['Descriptions'],_0x51ed8d,'\x0a')}},getCustomFields(_0xc81337[_0xc0cb('0x18')],_0x51ed8d))}})[_0xc0cb('0x19')](function(_0x5b5514){logger[_0xc0cb('0xc')](_0xc0cb('0x1a'));return _0x5b5514[_0xc0cb('0x1b')];});}function getUser(_0x315d31,_0x4299bb){if(intUtil[_0xc0cb('0x1c')](_0x4299bb)){logger['info']('Getting\x20agent\x20with\x20email',_0x4299bb);return request({'uri':util[_0xc0cb('0xe')](_0xc0cb('0x1d'),_0x315d31[_0xc0cb('0x10')]),'qs':{'query':util[_0xc0cb('0xe')](_0xc0cb('0x1e'),_0x4299bb)}})['then'](function(_0x2a1686){if(_0x2a1686[_0xc0cb('0x1f')]){logger[_0xc0cb('0xc')](_0xc0cb('0x20'));return _[_0xc0cb('0x21')](_0x2a1686[_0xc0cb('0x22')],{'email':_0x4299bb,'role':_0xc0cb('0x23')});}else{logger[_0xc0cb('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xc0cb('0x24'),_0x315d31[_0xc0cb('0x10')])})[_0xc0cb('0x19')](function(_0x1c6833){logger[_0xc0cb('0xc')](_0xc0cb('0x25'));return _0x1c6833[_0xc0cb('0x26')];});}});}else{logger[_0xc0cb('0xc')](_0xc0cb('0x27'));return request({'uri':util[_0xc0cb('0xe')](_0xc0cb('0x24'),_0x315d31[_0xc0cb('0x10')])})[_0xc0cb('0x19')](function(_0x3a2b7a){logger['info'](_0xc0cb('0x25'));return _0x3a2b7a[_0xc0cb('0x26')];});}}function getEndUser(_0x2cae48,_0x13beb,_0x5497f3){logger[_0xc0cb('0xc')]('Searching\x20enduser\x20with\x20phone',_0x5497f3);return request({'uri':util[_0xc0cb('0xe')](_0xc0cb('0x1d'),_0x2cae48['remoteUri']),'qs':{'query':util[_0xc0cb('0xe')](_0xc0cb('0x28'),_0x5497f3)}})[_0xc0cb('0x19')](function(_0x3a1b84){var _0x46131b;if(_0x3a1b84[_0xc0cb('0x22')][_0xc0cb('0x29')]){_0x3a1b84[_0xc0cb('0x22')]=_['filter'](_0x3a1b84[_0xc0cb('0x22')],{'suspended':![],'role':_0xc0cb('0x2a')});if(_0x3a1b84[_0xc0cb('0x22')][_0xc0cb('0x29')]){_0x46131b=_[_0xc0cb('0x2b')](_0x3a1b84[_0xc0cb('0x22')]);}}if(_0x46131b){logger['info'](_0xc0cb('0x2c'));return _0x46131b;}else{logger[_0xc0cb('0xc')](_0xc0cb('0x2d'));return request({'uri':util[_0xc0cb('0xe')](_0xc0cb('0x2e'),_0x2cae48['remoteUri']),'method':_0xc0cb('0x11'),'body':{'user':{'role':'end-user','name':util['format']('Caller\x20-\x20%s',_0x13beb||_0x5497f3),'phone':_0x5497f3}}})[_0xc0cb('0x19')](function(_0x43104a){logger['info']('Enduser\x20created.');return _0x43104a[_0xc0cb('0x26')];});}});}function getAuth(_0x7f3e14){var _0x4e9b2a;if(_0x7f3e14['authType']===_0xc0cb('0x2f')){_0x4e9b2a=util[_0xc0cb('0xe')](_0xc0cb('0x30'),_0x7f3e14['username'],_0x7f3e14['password']);}else if(_0x7f3e14[_0xc0cb('0x31')]===_0xc0cb('0x32')){_0x4e9b2a=util[_0xc0cb('0xe')](_0xc0cb('0x33'),_0x7f3e14[_0xc0cb('0x34')],_0x7f3e14[_0xc0cb('0x32')]);}return util['format'](_0xc0cb('0x35'),new Buffer(_0x4e9b2a)[_0xc0cb('0x36')](_0xc0cb('0x37')));}function request(_0x1b0486){logger[_0xc0cb('0x38')](_0xc0cb('0x39'),JSON[_0xc0cb('0x3a')](_0x1b0486));return rp(_[_0xc0cb('0x8')](_0x1b0486,{'method':_0xc0cb('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x306d46,_0x467991){var _0x440268=[];if(_0x306d46&&_0x306d46['length']>0x0){_0x440268=_[_0xc0cb('0x3c')](_0x306d46,_0x467991);}return _0x440268;}function getCustomFields(_0x396eae,_0x343267){var _0x678738=[];var _0x4deea0={'custom_fields':[]};if(_0x396eae['length']>0x0){_[_0xc0cb('0x3d')](_0x396eae,function(_0x5a7753){if(_[_0xc0cb('0x3e')]([_0xc0cb('0x3f'),_0xc0cb('0x40')],_0x5a7753[_0xc0cb('0x41')])&&_0x5a7753[_0xc0cb('0x42')]&&!_0x5a7753[_0xc0cb('0x43')]){_0x4deea0[_0x5a7753[_0xc0cb('0x42')]['toLowerCase']()]=_0x5a7753[_0xc0cb('0x44')]['toString']();}else if(_['includes'](['string',_0xc0cb('0x40')],_0x5a7753['type'])&&_0x5a7753[_0xc0cb('0x45')]&&_0x5a7753[_0xc0cb('0x43')]){_0x4deea0[_0xc0cb('0x46')]['push']({'id':_0x5a7753[_0xc0cb('0x45')],'value':_0x5a7753[_0xc0cb('0x44')][_0xc0cb('0x36')]()});}else if(_0x5a7753['type']==='variable'&&_0x5a7753['variableName']&&_0x5a7753['idField']&&_0x5a7753[_0xc0cb('0x43')]){_0x343267[_0x5a7753[_0xc0cb('0x47')]]&&_0x4deea0[_0xc0cb('0x46')]['push']({'id':_0x5a7753[_0xc0cb('0x45')],'value':_0x343267[_0x5a7753[_0xc0cb('0x47')]][_0xc0cb('0x36')]()});}else if(_0x5a7753[_0xc0cb('0x41')]===_0xc0cb('0x48')&&_0x5a7753[_0xc0cb('0x49')]&&_0x5a7753[_0xc0cb('0x49')][_0xc0cb('0x14')]&&_0x5a7753[_0xc0cb('0x45')]&&_0x5a7753[_0xc0cb('0x43')]){_0x343267[_0x5a7753[_0xc0cb('0x49')]['name'][_0xc0cb('0x4a')]()]&&_0x4deea0[_0xc0cb('0x46')]['push']({'id':_0x5a7753[_0xc0cb('0x45')],'value':_0x343267[_0x5a7753['Variable'][_0xc0cb('0x14')][_0xc0cb('0x4a')]()]['toString']()});}});}return _0x4deea0;}exports[_0xc0cb('0x4b')]=function(_0x23cf71,_0x5373dc,_0x256dae,_0x53e43d,_0x2b1c56,_0x343273){var _0x5162f9,_0x3de4cf;_0x343273[_0xc0cb('0x10')]=intUtil[_0xc0cb('0x4c')](_0x343273[_0xc0cb('0x10')]);_0x343273[_0xc0cb('0x4d')]=intUtil[_0xc0cb('0x4c')](_0x343273[_0xc0cb('0x4d')]);if(_0x2b1c56&&_0x2b1c56[_0xc0cb('0x4e')]){logger[_0xc0cb('0xc')](_0xc0cb('0x4f'),_0xc0cb('0x50'));_0x5373dc[_0xc0cb('0x51')]=util[_0xc0cb('0xe')](_0xc0cb('0x52'),_0x343273[_0xc0cb('0x4d')],_0x5373dc['uniqueid'],md5(_0x5373dc['uniqueid']));}else{_0x5373dc[_0xc0cb('0x51')]='';}headers['Authorization']=getAuth(_0x343273);return getUser(_0x343273,_0x53e43d[_0xc0cb('0x53')])[_0xc0cb('0x19')](function(_0x47e23f){_0x5162f9=_0x47e23f;logger[_0xc0cb('0xc')](_0xc0cb('0x54'),_0x5162f9['id']);return getEndUser(_0x343273,_0x5373dc['calleridname'],_0x5373dc[_0xc0cb('0x55')]);})[_0xc0cb('0x19')](function(_0x5e2860){_0x3de4cf=_0x5e2860;logger[_0xc0cb('0xc')](_0xc0cb('0x56'),_0x3de4cf['id']);return getTicket(_0x343273,_0x5162f9,_0x3de4cf,_0x256dae,_0x5373dc);})[_0xc0cb('0x19')](function(_0x13d895){if(_0x13d895){logger['info'](_0xc0cb('0x57'),_0x13d895['id']);switch(_0x343273[_0xc0cb('0x41')]){case _0xc0cb('0x58'):logger[_0xc0cb('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc0cb('0xe')](_0xc0cb('0x59'),_0x343273[_0xc0cb('0x10')],_0x5162f9['id'],_0x13d895['id']),'method':_0xc0cb('0x11')});case _0xc0cb('0x5a'):logger[_0xc0cb('0xc')](_0xc0cb('0x4f'),_0xc0cb('0x5b'));emit(util[_0xc0cb('0xe')](_0xc0cb('0x5c'),_0x53e43d[_0xc0cb('0x14')]),'trigger:browser:url',{'uri':util[_0xc0cb('0xe')](_0xc0cb('0x5d'),_0x343273['remoteUri'][_0xc0cb('0x5e')](_0xc0cb('0x5f'),''),_0x13d895['id'])});break;default:logger[_0xc0cb('0x60')](_0xc0cb('0x4f'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xc0cb('0x61')](function(_0x40e205){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xc0cb('0x62')](_0x40e205,{'showHidden':!![],'depth':null}));});};exports[_0xc0cb('0x63')]=function(_0x27c55f,_0x4ccb1e,_0x471236,_0x13ba0f,_0x23addf,_0x5e7603,_0x4e591a){var _0x359c97,_0x4b20b5;_0x5e7603['remoteUri']=intUtil[_0xc0cb('0x4c')](_0x5e7603[_0xc0cb('0x10')]);_0x5e7603[_0xc0cb('0x4d')]=intUtil[_0xc0cb('0x4c')](_0x5e7603[_0xc0cb('0x4d')]);if(_0x4e591a&&_0x4e591a[_0xc0cb('0x64')]&&_0x4e591a['recordingFormat']!==_0xc0cb('0x65')){logger[_0xc0cb('0xc')]('[OUTBOUND]',_0xc0cb('0x50'));_0x4ccb1e['recordingURL']=util[_0xc0cb('0xe')](_0xc0cb('0x52'),_0x5e7603[_0xc0cb('0x4d')],_0x4ccb1e['uniqueid'],md5(_0x4ccb1e[_0xc0cb('0x66')]));}headers[_0xc0cb('0x67')]=getAuth(_0x5e7603);return getUser(_0x5e7603,_0x13ba0f['email'])['then'](function(_0x1be052){_0x359c97=_0x1be052;logger[_0xc0cb('0xc')](_0xc0cb('0x54'),_0x359c97['id']);return getEndUser(_0x5e7603,_0x4ccb1e['destcalleridname'],_0x4ccb1e[_0xc0cb('0x68')]);})[_0xc0cb('0x19')](function(_0x1b7334){_0x4b20b5=_0x1b7334;logger[_0xc0cb('0xc')]('The\x20Enduser\x20ID\x20is:',_0x4b20b5['id']);return getTicket(_0x5e7603,_0x359c97,_0x4b20b5,_0x471236,_0x4ccb1e);})[_0xc0cb('0x19')](function(_0x1a6690){if(_0x1a6690){logger[_0xc0cb('0xc')](_0xc0cb('0x57'),_0x1a6690['id']);switch(_0x5e7603[_0xc0cb('0x41')]){case'integrationTab':logger[_0xc0cb('0xc')](_0xc0cb('0x69'),_0xc0cb('0x6a'));return request({'uri':util['format'](_0xc0cb('0x59'),_0x5e7603[_0xc0cb('0x10')],_0x359c97['id'],_0x1a6690['id']),'method':_0xc0cb('0x11')});case _0xc0cb('0x5a'):logger[_0xc0cb('0xc')]('[OUTBOUND]',_0xc0cb('0x5b'));emit(util[_0xc0cb('0xe')](_0xc0cb('0x5c'),_0x13ba0f[_0xc0cb('0x14')]),'trigger:browser:url',{'uri':util[_0xc0cb('0xe')](_0xc0cb('0x5d'),_0x5e7603['remoteUri'][_0xc0cb('0x5e')](_0xc0cb('0x5f'),''),_0x1a6690['id'])});break;default:logger[_0xc0cb('0x60')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xc0cb('0x61')](function(_0x15b2b9){logger[_0xc0cb('0x60')](_0xc0cb('0x6b'),util['inspect'](_0x15b2b9,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x1ac174,_0x41fa84,_0x36938c,_0x3ef1ec,_0x4ac8e1,_0x47086e){var _0x13d6fc,_0x45874c;_0x47086e[_0xc0cb('0x10')]=intUtil['stripTrailingSlash'](_0x47086e[_0xc0cb('0x10')]);_0x47086e[_0xc0cb('0x4d')]=intUtil[_0xc0cb('0x4c')](_0x47086e[_0xc0cb('0x4d')]);if(_0x4ac8e1&&_0x4ac8e1[_0xc0cb('0x4e')]){logger[_0xc0cb('0xc')]('['+_0x41fa84[_0xc0cb('0x6c')][_0xc0cb('0x6d')]()+']',_0xc0cb('0x50'));_0x41fa84['recordingURL']=util[_0xc0cb('0xe')](_0xc0cb('0x52'),_0x47086e['serverUrl'],_0x41fa84[_0xc0cb('0x66')],md5(_0x41fa84[_0xc0cb('0x66')]));}else{_0x41fa84[_0xc0cb('0x51')]='';}headers[_0xc0cb('0x67')]=getAuth(_0x47086e);return getUser(_0x47086e)['then'](function(_0xe3c954){_0x13d6fc=_0xe3c954;logger[_0xc0cb('0xc')](_0xc0cb('0x54'),_0x13d6fc['id']);return getEndUser(_0x47086e,_0x41fa84[_0xc0cb('0x6e')],_0x41fa84[_0xc0cb('0x55')]);})[_0xc0cb('0x19')](function(_0x53c6c8){_0x45874c=_0x53c6c8;logger['info']('The\x20Enduser\x20ID\x20is:',_0x45874c['id']);return getTicket(_0x47086e,_0x13d6fc,_0x45874c,_0x36938c,_0x41fa84);})[_0xc0cb('0x19')](function(_0x5b1968){if(_0x5b1968){logger['info'](_0xc0cb('0x57'),_0x5b1968['id']);}})['catch'](function(_0x42ef3f){logger[_0xc0cb('0x60')]('['+_0x41fa84[_0xc0cb('0x6c')]['toUpperCase']()+']'+_0xc0cb('0x6f'),util[_0xc0cb('0x62')](_0x42ef3f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe90b=['results','filter','end-user','length','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','Basic\x20%s','toString','base64','[HTTP]','stringify','map','forEach','includes','picklist','nameField','customField','content','string','idField','custom_fields','push','variable','variableName','type','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','integrationTab','[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','ticket','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xe90b,0x12f));var _0xbe90=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0xe90b[_0x223461];return _0x4dbe0a;};'use strict';var _=require(_0xbe90('0x0'));var rp=require(_0xbe90('0x1'));var md5=require(_0xbe90('0x2'));var util=require(_0xbe90('0x3'));var Redis=require(_0xbe90('0x4'));var intUtil=require(_0xbe90('0x5'));var config=require(_0xbe90('0x6'));var logger=require(_0xbe90('0x7'))(_0xbe90('0x8'));config[_0xbe90('0x9')]=_[_0xbe90('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xbe90('0xb'))(new Redis(config[_0xbe90('0x9')]));function emit(_0x291c24,_0x35f4e9,_0x401c30){io['to'](_0x291c24)[_0xbe90('0xc')](_0x35f4e9,_0x401c30);}var headers={'Content-Type':_0xbe90('0xd'),'Accept':_0xbe90('0xd')};function getTicket(_0x215c77,_0x49cd27,_0xecd6f8,_0x936415,_0x3efdae){logger[_0xbe90('0xe')](_0xbe90('0xf'));return request({'uri':util[_0xbe90('0x10')](_0xbe90('0x11'),_0x215c77[_0xbe90('0x12')]),'method':_0xbe90('0x13'),'body':{'ticket':_[_0xbe90('0x14')]({'requester_id':_0xecd6f8['id'],'submitter_id':_0x49cd27?_0x49cd27['id']:undefined,'assignee_id':_0x49cd27?_0x49cd27['id']:undefined,'tags':getTags(_0x936415[_0xbe90('0x15')],_0xbe90('0x16')),'subject':intUtil[_0xbe90('0x17')](_0x936415[_0xbe90('0x18')],_0x3efdae,'\x20'),'description':intUtil['getString'](_0x936415[_0xbe90('0x19')],_0x3efdae,'\x0a'),'comment':{'public':![],'body':intUtil[_0xbe90('0x17')](_0x936415[_0xbe90('0x19')],_0x3efdae,'\x0a')}},getCustomFields(_0x936415['Fields'],_0x3efdae))}})[_0xbe90('0x1a')](function(_0x2d526b){logger[_0xbe90('0xe')]('Ticket\x20created!');return _0x2d526b[_0xbe90('0x1b')];});}function getUser(_0x216478,_0x276af0){if(intUtil['validateEmail'](_0x276af0)){logger[_0xbe90('0xe')]('Getting\x20agent\x20with\x20email',_0x276af0);return request({'uri':util['format'](_0xbe90('0x1c'),_0x216478['remoteUri']),'qs':{'query':util['format'](_0xbe90('0x1d'),_0x276af0)}})[_0xbe90('0x1a')](function(_0x4d8dfe){if(_0x4d8dfe[_0xbe90('0x1e')]){logger[_0xbe90('0xe')]('Agent\x20found!');return _[_0xbe90('0x1f')](_0x4d8dfe['results'],{'email':_0x276af0,'role':_0xbe90('0x20')});}else{logger[_0xbe90('0xe')](_0xbe90('0x21'));return request({'uri':util[_0xbe90('0x10')](_0xbe90('0x22'),_0x216478['remoteUri'])})[_0xbe90('0x1a')](function(_0x5da196){logger[_0xbe90('0xe')](_0xbe90('0x23'));return _0x5da196[_0xbe90('0x24')];});}});}else{logger['info'](_0xbe90('0x21'));return request({'uri':util['format'](_0xbe90('0x22'),_0x216478[_0xbe90('0x12')])})['then'](function(_0x2c442a){logger[_0xbe90('0xe')](_0xbe90('0x23'));return _0x2c442a[_0xbe90('0x24')];});}}function getEndUser(_0x45177c,_0x2ebb84,_0x313707){logger[_0xbe90('0xe')](_0xbe90('0x25'),_0x313707);return request({'uri':util[_0xbe90('0x10')](_0xbe90('0x1c'),_0x45177c[_0xbe90('0x12')]),'qs':{'query':util['format'](_0xbe90('0x26'),_0x313707)}})[_0xbe90('0x1a')](function(_0x2a8c9e){var _0x4aacab;if(_0x2a8c9e[_0xbe90('0x27')]['length']){_0x2a8c9e[_0xbe90('0x27')]=_[_0xbe90('0x28')](_0x2a8c9e[_0xbe90('0x27')],{'suspended':![],'role':_0xbe90('0x29')});if(_0x2a8c9e[_0xbe90('0x27')][_0xbe90('0x2a')]){_0x4aacab=_[_0xbe90('0x2b')](_0x2a8c9e[_0xbe90('0x27')]);}}if(_0x4aacab){logger[_0xbe90('0xe')](_0xbe90('0x2c'));return _0x4aacab;}else{logger[_0xbe90('0xe')](_0xbe90('0x2d'));return request({'uri':util[_0xbe90('0x10')](_0xbe90('0x2e'),_0x45177c[_0xbe90('0x12')]),'method':_0xbe90('0x13'),'body':{'user':{'role':'end-user','name':util[_0xbe90('0x10')](_0xbe90('0x2f'),_0x2ebb84||_0x313707),'phone':_0x313707}}})[_0xbe90('0x1a')](function(_0x37d9fe){logger['info'](_0xbe90('0x30'));return _0x37d9fe['user'];});}});}function getAuth(_0x5f5b6c){var _0x5df796;if(_0x5f5b6c[_0xbe90('0x31')]==='password'){_0x5df796=util[_0xbe90('0x10')](_0xbe90('0x32'),_0x5f5b6c[_0xbe90('0x33')],_0x5f5b6c[_0xbe90('0x34')]);}else if(_0x5f5b6c['authType']==='token'){_0x5df796=util[_0xbe90('0x10')]('%s/token:%s',_0x5f5b6c[_0xbe90('0x33')],_0x5f5b6c[_0xbe90('0x35')]);}return util['format'](_0xbe90('0x36'),new Buffer(_0x5df796)[_0xbe90('0x37')](_0xbe90('0x38')));}function request(_0x2a8ac7){logger['debug'](_0xbe90('0x39'),JSON[_0xbe90('0x3a')](_0x2a8ac7));return rp(_[_0xbe90('0xa')](_0x2a8ac7,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x47c5f6,_0x321872){var _0x3a3d7a=[];if(_0x47c5f6&&_0x47c5f6[_0xbe90('0x2a')]>0x0){_0x3a3d7a=_[_0xbe90('0x3b')](_0x47c5f6,_0x321872);}return _0x3a3d7a;}function getCustomFields(_0x41cafc,_0x5a36a1){var _0x21f1b6=[];var _0x26af0a={'custom_fields':[]};if(_0x41cafc[_0xbe90('0x2a')]>0x0){_[_0xbe90('0x3c')](_0x41cafc,function(_0x2cff87){if(_[_0xbe90('0x3d')](['string',_0xbe90('0x3e')],_0x2cff87['type'])&&_0x2cff87[_0xbe90('0x3f')]&&!_0x2cff87[_0xbe90('0x40')]){_0x26af0a[_0x2cff87['nameField']['toLowerCase']()]=_0x2cff87[_0xbe90('0x41')][_0xbe90('0x37')]();}else if(_[_0xbe90('0x3d')]([_0xbe90('0x42'),_0xbe90('0x3e')],_0x2cff87['type'])&&_0x2cff87[_0xbe90('0x43')]&&_0x2cff87['customField']){_0x26af0a[_0xbe90('0x44')][_0xbe90('0x45')]({'id':_0x2cff87[_0xbe90('0x43')],'value':_0x2cff87[_0xbe90('0x41')][_0xbe90('0x37')]()});}else if(_0x2cff87['type']===_0xbe90('0x46')&&_0x2cff87[_0xbe90('0x47')]&&_0x2cff87[_0xbe90('0x43')]&&_0x2cff87[_0xbe90('0x40')]){_0x5a36a1[_0x2cff87[_0xbe90('0x47')]]&&_0x26af0a[_0xbe90('0x44')][_0xbe90('0x45')]({'id':_0x2cff87[_0xbe90('0x43')],'value':_0x5a36a1[_0x2cff87[_0xbe90('0x47')]][_0xbe90('0x37')]()});}else if(_0x2cff87[_0xbe90('0x48')]==='customVariable'&&_0x2cff87[_0xbe90('0x49')]&&_0x2cff87[_0xbe90('0x49')][_0xbe90('0x16')]&&_0x2cff87[_0xbe90('0x43')]&&_0x2cff87['customField']){_0x5a36a1[_0x2cff87[_0xbe90('0x49')][_0xbe90('0x16')][_0xbe90('0x4a')]()]&&_0x26af0a[_0xbe90('0x44')][_0xbe90('0x45')]({'id':_0x2cff87[_0xbe90('0x43')],'value':_0x5a36a1[_0x2cff87[_0xbe90('0x49')][_0xbe90('0x16')][_0xbe90('0x4a')]()][_0xbe90('0x37')]()});}});}return _0x26af0a;}exports['queue']=function(_0x189e17,_0x339eeb,_0x49063f,_0x32a61f,_0x17d6dc,_0x1c364d){var _0x84d5cf,_0x16349c;_0x1c364d[_0xbe90('0x12')]=intUtil['stripTrailingSlash'](_0x1c364d[_0xbe90('0x12')]);_0x1c364d['serverUrl']=intUtil[_0xbe90('0x4b')](_0x1c364d[_0xbe90('0x4c')]);if(_0x17d6dc&&_0x17d6dc[_0xbe90('0x4d')]){logger['info']('[QUEUE]',_0xbe90('0x4e'));_0x339eeb[_0xbe90('0x4f')]=util[_0xbe90('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c364d[_0xbe90('0x4c')],_0x339eeb[_0xbe90('0x50')],md5(_0x339eeb[_0xbe90('0x50')]));}else{_0x339eeb[_0xbe90('0x4f')]='';}headers[_0xbe90('0x51')]=getAuth(_0x1c364d);return getUser(_0x1c364d,_0x32a61f[_0xbe90('0x52')])[_0xbe90('0x1a')](function(_0x4f2879){_0x84d5cf=_0x4f2879;logger[_0xbe90('0xe')](_0xbe90('0x53'),_0x84d5cf['id']);return getEndUser(_0x1c364d,_0x339eeb['calleridname'],_0x339eeb[_0xbe90('0x54')]);})[_0xbe90('0x1a')](function(_0xa58b28){_0x16349c=_0xa58b28;logger[_0xbe90('0xe')](_0xbe90('0x55'),_0x16349c['id']);return getTicket(_0x1c364d,_0x84d5cf,_0x16349c,_0x49063f,_0x339eeb);})['then'](function(_0x1ef198){if(_0x1ef198){logger[_0xbe90('0xe')](_0xbe90('0x56'),_0x1ef198['id']);switch(_0x1c364d[_0xbe90('0x48')]){case'integrationTab':logger[_0xbe90('0xe')]('[QUEUE]',_0xbe90('0x57'));return request({'uri':util[_0xbe90('0x10')](_0xbe90('0x58'),_0x1c364d['remoteUri'],_0x84d5cf['id'],_0x1ef198['id']),'method':_0xbe90('0x13')});case _0xbe90('0x59'):logger[_0xbe90('0xe')](_0xbe90('0x5a'),_0xbe90('0x5b'));emit(util[_0xbe90('0x10')](_0xbe90('0x5c'),_0x32a61f[_0xbe90('0x16')]),_0xbe90('0x5d'),{'uri':util[_0xbe90('0x10')](_0xbe90('0x5e'),_0x1c364d[_0xbe90('0x12')][_0xbe90('0x5f')](_0xbe90('0x60'),''),_0x1ef198['id'])});break;default:logger[_0xbe90('0x61')](_0xbe90('0x5a'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x317034){logger[_0xbe90('0x61')](_0xbe90('0x62'),util[_0xbe90('0x63')](_0x317034,{'showHidden':!![],'depth':null}));});};exports[_0xbe90('0x64')]=function(_0x3a80ea,_0x3b2149,_0x45b03d,_0x34b05d,_0x42b6b5,_0x276f04,_0x3e36ed){var _0x441916,_0x151a05;_0x276f04[_0xbe90('0x12')]=intUtil['stripTrailingSlash'](_0x276f04[_0xbe90('0x12')]);_0x276f04[_0xbe90('0x4c')]=intUtil[_0xbe90('0x4b')](_0x276f04['serverUrl']);if(_0x3e36ed&&_0x3e36ed[_0xbe90('0x65')]&&_0x3e36ed[_0xbe90('0x65')]!=='none'){logger[_0xbe90('0xe')]('[OUTBOUND]',_0xbe90('0x4e'));_0x3b2149[_0xbe90('0x4f')]=util[_0xbe90('0x10')](_0xbe90('0x66'),_0x276f04[_0xbe90('0x4c')],_0x3b2149[_0xbe90('0x50')],md5(_0x3b2149[_0xbe90('0x50')]));}headers[_0xbe90('0x51')]=getAuth(_0x276f04);return getUser(_0x276f04,_0x34b05d['email'])[_0xbe90('0x1a')](function(_0xc26bca){_0x441916=_0xc26bca;logger[_0xbe90('0xe')]('The\x20User\x20ID\x20is:',_0x441916['id']);return getEndUser(_0x276f04,_0x3b2149[_0xbe90('0x67')],_0x3b2149[_0xbe90('0x68')]);})['then'](function(_0x388eaa){_0x151a05=_0x388eaa;logger[_0xbe90('0xe')](_0xbe90('0x55'),_0x151a05['id']);return getTicket(_0x276f04,_0x441916,_0x151a05,_0x45b03d,_0x3b2149);})[_0xbe90('0x1a')](function(_0x3e142e){if(_0x3e142e){logger[_0xbe90('0xe')]('The\x20Ticket\x20ID\x20is:',_0x3e142e['id']);switch(_0x276f04['type']){case _0xbe90('0x69'):logger['info']('[OUTBOUND]',_0xbe90('0x57'));return request({'uri':util[_0xbe90('0x10')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x276f04[_0xbe90('0x12')],_0x441916['id'],_0x3e142e['id']),'method':_0xbe90('0x13')});case _0xbe90('0x59'):logger['info'](_0xbe90('0x6a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbe90('0x10')](_0xbe90('0x5c'),_0x34b05d[_0xbe90('0x16')]),_0xbe90('0x5d'),{'uri':util[_0xbe90('0x10')](_0xbe90('0x5e'),_0x276f04[_0xbe90('0x12')][_0xbe90('0x5f')](_0xbe90('0x60'),''),_0x3e142e['id'])});break;default:logger[_0xbe90('0x61')](_0xbe90('0x6a'),_0xbe90('0x6b'));}}})[_0xbe90('0x6c')](function(_0x474cc3){logger[_0xbe90('0x61')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xbe90('0x63')](_0x474cc3,{'showHidden':!![],'depth':null}));});};exports[_0xbe90('0x6d')]=function(_0x3a200e,_0x2b6dc2,_0x4e9c30,_0x31db65,_0x179b10,_0x2e21a7){var _0x47b3e1,_0x435635;_0x2e21a7[_0xbe90('0x12')]=intUtil['stripTrailingSlash'](_0x2e21a7[_0xbe90('0x12')]);_0x2e21a7['serverUrl']=intUtil['stripTrailingSlash'](_0x2e21a7[_0xbe90('0x4c')]);if(_0x179b10&&_0x179b10['monitor_format']){logger['info']('['+_0x2b6dc2[_0xbe90('0x6e')][_0xbe90('0x6f')]()+']','Recording\x20is\x20enabled!');_0x2b6dc2['recordingURL']=util['format'](_0xbe90('0x66'),_0x2e21a7[_0xbe90('0x4c')],_0x2b6dc2['uniqueid'],md5(_0x2b6dc2[_0xbe90('0x50')]));}else{_0x2b6dc2[_0xbe90('0x4f')]='';}headers[_0xbe90('0x51')]=getAuth(_0x2e21a7);return getUser(_0x2e21a7)[_0xbe90('0x1a')](function(_0x5a8450){_0x47b3e1=_0x5a8450;logger[_0xbe90('0xe')](_0xbe90('0x53'),_0x47b3e1['id']);return getEndUser(_0x2e21a7,_0x2b6dc2[_0xbe90('0x70')],_0x2b6dc2[_0xbe90('0x54')]);})[_0xbe90('0x1a')](function(_0x1244be){_0x435635=_0x1244be;logger[_0xbe90('0xe')]('The\x20Enduser\x20ID\x20is:',_0x435635['id']);return getTicket(_0x2e21a7,_0x47b3e1,_0x435635,_0x4e9c30,_0x2b6dc2);})[_0xbe90('0x1a')](function(_0x5a2987){if(_0x5a2987){logger[_0xbe90('0xe')]('The\x20Ticket\x20ID\x20is:',_0x5a2987['id']);}})['catch'](function(_0x22f018){logger[_0xbe90('0x61')]('['+_0x2b6dc2[_0xbe90('0x6e')]['toUpperCase']()+']'+_0xbe90('0x71'),util['inspect'](_0x22f018,{'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 33000ae..9045af2 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 _0xb578=['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','clientSecret','refresh_token','add','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','email','info','Using\x20the\x20admin\x20account!','findIndex','Administrator','user','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','then','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','Contacts','Leads','Creating\x20new\x20call...','profile','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','startCase','talktime','Call_Duration','utc','diff','YYYY-MM-DDTHH:mm:ss','mm:ss','called','Call_Result','Called','Answered','rejected','Rejected','Abandoned','timeout','Timeout','outbound','starttime','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','trigger:browser:url','https://crm.','recordingFormat','[OUTBOUND]','/api/voice/recordings/','uniqueid','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','lastevent','toUpperCase','request-promise','util','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','emit','debug','[HTTP]','stringify','length','forEach','includes','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore'];(function(_0x7432ce,_0x5dfe7c){var _0xe02f4b=function(_0x255b17){while(--_0x255b17){_0x7432ce['push'](_0x7432ce['shift']());}};_0xe02f4b(++_0x5dfe7c);}(_0xb578,0x78));var _0x8b57=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb578[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var rp=require(_0x8b57('0x0'));var md5=require('md5');var util=require(_0x8b57('0x1'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x8b57('0x2'));var BPromise=require(_0x8b57('0x3'));var config=require(_0x8b57('0x4'));var logger=require('../../../../config/logger')(_0x8b57('0x5'));config[_0x8b57('0x6')]=_[_0x8b57('0x7')](config[_0x8b57('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x55d91e,_0x57c3a4,_0x2c200f){io['to'](_0x55d91e)[_0x8b57('0x8')](_0x57c3a4,_0x2c200f);}function request(_0x45507d){logger[_0x8b57('0x9')](_0x8b57('0xa'),JSON[_0x8b57('0xb')](_0x45507d));return rp(_0x45507d);}function getCustomFields(_0x53268d,_0x58438a){var _0x3e3697={};if(_0x53268d[_0x8b57('0xc')]>0x0){_[_0x8b57('0xd')](_0x53268d,function(_0x41d659){if(_[_0x8b57('0xe')](['string',_0x8b57('0xf')],_0x41d659[_0x8b57('0x10')])&&_0x41d659[_0x8b57('0x11')]){_0x3e3697[_0x41d659[_0x8b57('0x11')]]=_0x41d659[_0x8b57('0x12')]['toString']();}else if(_0x41d659[_0x8b57('0x10')]===_0x8b57('0x13')&&_0x41d659[_0x8b57('0x14')]&&_0x41d659[_0x8b57('0x11')]&&_0x58438a[_0x41d659[_0x8b57('0x14')]]){_0x3e3697[_0x41d659[_0x8b57('0x11')]]=_0x58438a[_0x41d659[_0x8b57('0x14')]][_0x8b57('0x15')]();}else if(_0x41d659['type']===_0x8b57('0x16')&&_0x41d659['Variable']&&_0x41d659[_0x8b57('0x17')][_0x8b57('0x18')]&&_0x41d659[_0x8b57('0x11')]&&_0x58438a[_0x41d659['Variable'][_0x8b57('0x18')]['toLowerCase']()]){_0x3e3697[_0x41d659[_0x8b57('0x11')]]=_0x58438a[_0x41d659['Variable'][_0x8b57('0x18')][_0x8b57('0x19')]()][_0x8b57('0x15')]();}});}return _0x3e3697;}function getName(_0x39e30a){if(_0x39e30a['indexOf']('\x20')>0x0){var _0x9bad16=_0x39e30a[_0x8b57('0x1a')](/ (.+)/);if(_0x9bad16[0x1]){return _0x9bad16;}}return[_0x39e30a,_0x39e30a];}var accountsTokens={};function getAccessToken(_0x1acf1f){return new Promise(function(_0x508798,_0x1a3289){if(!_['isNil'](accountsTokens[_0x1acf1f['id']])&&!_[_0x8b57('0x1b')](accountsTokens[_0x1acf1f['id']][_0x8b57('0x1c')])){if(moment()[_0x8b57('0x1d')](accountsTokens[_0x1acf1f['id']]['expires_in'])){_0x508798(accountsTokens[_0x1acf1f['id']]['access_token']);}}var _0x58f67d;switch(_0x1acf1f[_0x8b57('0x1e')]){case'US':_0x58f67d=_0x8b57('0x1f');break;case'AU':_0x58f67d=_0x8b57('0x20');break;case'EU':_0x58f67d=_0x8b57('0x21');break;case'IN':_0x58f67d=_0x8b57('0x22');break;case'CN':_0x58f67d=_0x8b57('0x23');break;default:_0x58f67d=_0x8b57('0x21');break;}var _0x23909b={'method':_0x8b57('0x24'),'uri':_0x58f67d+_0x8b57('0x25'),'qs':{'refresh_token':_0x1acf1f['refreshToken'],'client_id':_0x1acf1f['clientId'],'client_secret':_0x1acf1f[_0x8b57('0x26')],'grant_type':_0x8b57('0x27')},'json':!![]};return rp(_0x23909b)['then'](function(_0x227fe4){accountsTokens[_0x1acf1f['id']]={'access_token':_0x227fe4[_0x8b57('0x1c')],'expires_in':moment()[_0x8b57('0x28')](_0x227fe4[_0x8b57('0x29')],_0x8b57('0x2a'))};_0x508798(_0x227fe4['access_token']);})[_0x8b57('0x2b')](function(_0x2f7ab5){logger['error'](_0x8b57('0x2c'),_0x2f7ab5[_0x8b57('0x2d')]);_0x1a3289(_0x2f7ab5);});});}function getUser(_0x201dc9,_0x54a993,_0x3e71b7,_0x1b19fd){logger['info'](_0x8b57('0x2e'));return request({'method':_0x8b57('0x2f'),'uri':util[_0x8b57('0x30')](_0x8b57('0x31'),_0x54a993),'qs':{'type':_0x8b57('0x32')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x201dc9},'json':!![]})['then'](function(_0x115169){if(_0x115169[_0x8b57('0x33')]){var _0x4e2a1e=-0x1;if(_[_0x8b57('0x34')](_0x115169[_0x8b57('0x33')])){if(!_[_0x8b57('0x1b')](_0x1b19fd)){_0x4e2a1e=_['findIndex'](_0x115169[_0x8b57('0x33')],function(_0x3c7217){return _0x3c7217[_0x8b57('0x35')]===_0x1b19fd;});}if(_0x4e2a1e>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x8b57('0x36')](_0x8b57('0x37'));_0x4e2a1e=_[_0x8b57('0x38')](_0x115169[_0x8b57('0x33')],function(_0x3e958a){return _0x3e958a['profile'][_0x8b57('0x18')]==='Administrator';});}return _0x115169[_0x8b57('0x33')][_0x4e2a1e];}else{if(_0x115169['user']['profile'][_0x8b57('0x18')]===_0x8b57('0x39')){logger[_0x8b57('0x36')](_0x8b57('0x37'));user=_0x115169[_0x8b57('0x3a')];return user;}else{logger[_0x8b57('0x3b')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x115169));throw new Error(_0x8b57('0x3c')+JSON[_0x8b57('0xb')](_0x115169));}}}else{logger['error'](_0x8b57('0x3d'),JSON[_0x8b57('0xb')](_0x115169));throw new Error(_0x8b57('0x3c')+JSON[_0x8b57('0xb')](_0x115169));}})[_0x8b57('0x2b')](function(_0x500a3d){console[_0x8b57('0x3b')](_0x500a3d);});}function getZohoUser(_0x56a12a,_0x35cb3c){return new BPromise(function(_0xa55a09,_0x4481d4){request(_0x56a12a)[_0x8b57('0x3e')](function(_0x1db0b4){var _0x287e52=null;if(_0x1db0b4){_0x287e52=_0x1db0b4[_0x8b57('0x3f')][0x0];_0x287e52[_0x8b57('0x40')]=_0x35cb3c;}_0xa55a09(_0x287e52);})[_0x8b57('0x2b')](function(_0x383998){_0x4481d4(_0x383998);});});}function createEndUser(_0x5d733e,_0x3c32f4,_0x1c09e4,_0x36e531,_0xfa64c6,_0x1cfef9){var _0x1c09e4=getName(_0x1c09e4);return request({'method':_0x8b57('0x24'),'uri':_0x8b57('0x41')+_0x3c32f4+_0x8b57('0x42')+_['startCase'](_0x1cfef9[_0x8b57('0x43')])+'s','body':{'data':[{'Last_Name':_0x1c09e4[0x1],'First_Name':_0x1c09e4[0x0],'Phone':_0x36e531,'Owner':{'name':!_[_0x8b57('0x1b')](_0xfa64c6[_0x8b57('0x44')]['name'])?_0xfa64c6[_0x8b57('0x44')]['name']:!_[_0x8b57('0x1b')](_0xfa64c6[_0x8b57('0x45')])?_0xfa64c6['first_name']+'\x20'+_0xfa64c6[_0x8b57('0x46')]:_0xfa64c6[_0x8b57('0x46')],'id':_0xfa64c6['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5d733e},'json':!![]})[_0x8b57('0x3e')](function(_0x2535e1){if(_0x2535e1&&_0x2535e1[_0x8b57('0x3f')][0x0][_0x8b57('0x47')]===_0x8b57('0x48')){var _0xf51177=_0x2535e1[_0x8b57('0x3f')][0x0][_0x8b57('0x49')];_0xf51177['enduserType']=_['startCase'](_0x1cfef9[_0x8b57('0x43')])+'s';return _0xf51177;}logger['error'](_0x8b57('0x3d'),JSON[_0x8b57('0xb')](data));throw new Error(_0x8b57('0x4a')+JSON[_0x8b57('0xb')](data));})[_0x8b57('0x2b')](function(_0x8162b1){console['log'](_0x8b57('0x4b'),_0x8162b1);});}function getEndUser(_0x368e70,_0x5458ce,_0x4b2fc8,_0x13cce3,_0x4d0d9c,_0x3bca9c,_0x3eaa46){var _0x43c3b9={'method':_0x8b57('0x2f'),'uri':'','headers':{'Authorization':_0x8b57('0x4c')+_0x368e70},'json':!![]};switch(_0x3eaa46[_0x8b57('0x4d')]){case'contact_lead':_0x43c3b9[_0x8b57('0x4e')]=_0x8b57('0x41')+_0x5458ce+_0x8b57('0x4f')+_0x4d0d9c+'))';return getZohoUser(_0x43c3b9,'Contacts')[_0x8b57('0x3e')](function(_0x2a7ea2){if(_0x2a7ea2)return _0x2a7ea2;_0x43c3b9[_0x8b57('0x4e')]=_0x8b57('0x41')+_0x5458ce+_0x8b57('0x50')+_0x4d0d9c+'))';return getZohoUser(_0x43c3b9,'Leads')[_0x8b57('0x3e')](function(_0x284ada){if(_0x284ada)return _0x284ada;if(_0x3eaa46[_0x8b57('0x43')]!=_0x8b57('0x51')){return createEndUser(_0x368e70,_0x5458ce,_0x13cce3,_0x4d0d9c,_0x3bca9c,_0x3eaa46);}else{return{};}});});break;case'contact':_0x43c3b9[_0x8b57('0x4e')]=_0x8b57('0x41')+_0x5458ce+_0x8b57('0x4f')+_0x4d0d9c+'))';return getZohoUser(_0x43c3b9,_0x8b57('0x52'))['then'](function(_0x5040c7){if(_0x5040c7)return _0x5040c7;if(_0x3eaa46[_0x8b57('0x43')]!=_0x8b57('0x51')){return createEndUser(_0x368e70,_0x5458ce,_0x13cce3,_0x4d0d9c,_0x3bca9c,_0x3eaa46);}else{return{};}});break;case'lead':_0x43c3b9['uri']=_0x8b57('0x41')+_0x5458ce+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4d0d9c+'))';return getZohoUser(_0x43c3b9,_0x8b57('0x53'))[_0x8b57('0x3e')](function(_0x4ef0f4){if(_0x4ef0f4)return _0x4ef0f4;if(_0x3eaa46[_0x8b57('0x43')]!=_0x8b57('0x51')){return createEndUser(_0x368e70,_0x5458ce,_0x13cce3,_0x4d0d9c,_0x3bca9c,_0x3eaa46);}else{return{};}});break;}}function getCall(_0x3ca689,_0x176578,_0x4ec1a4,_0x5430c4,_0x3df107,_0x439ffd,_0x47e30f,_0x2c8f98){logger[_0x8b57('0x36')](_0x8b57('0x54'));var _0x2a0a56={};_0x2a0a56['Owner']={'name':!_[_0x8b57('0x1b')](_0x5430c4[_0x8b57('0x44')]['name'])&&!_[_0x8b57('0x1b')](_0x5430c4[_0x8b57('0x55')][_0x8b57('0x18')])&&_0x5430c4[_0x8b57('0x55')][_0x8b57('0x18')]==='administrator'?_0x5430c4[_0x8b57('0x44')]['name']:!_[_0x8b57('0x1b')](_0x5430c4[_0x8b57('0x45')])?_0x5430c4[_0x8b57('0x45')]+'\x20'+_0x5430c4[_0x8b57('0x46')]:_0x5430c4[_0x8b57('0x46')],'id':_0x5430c4['id']};_0x2a0a56[_0x8b57('0x56')]=intUtil[_0x8b57('0x57')](_0x439ffd[_0x8b57('0x58')],_0x47e30f,'\x20');_0x2a0a56[_0x8b57('0x59')]=intUtil[_0x8b57('0x57')](_0x439ffd[_0x8b57('0x5a')],_0x47e30f,'\x0a');if(_0x3df107['enduserType']===_0x8b57('0x52')){_0x2a0a56[_0x8b57('0x5b')]={'name':!_[_0x8b57('0x1b')](_0x3df107[_0x8b57('0x5c')])?_0x3df107[_0x8b57('0x5c')]:!_[_0x8b57('0x1b')](_0x3df107[_0x8b57('0x5d')])?_0x3df107[_0x8b57('0x5d')]+'\x20'+_0x3df107[_0x8b57('0x5e')]:_0x3df107[_0x8b57('0x5e')],'id':_0x3df107['id']};}if(_0x3df107[_0x8b57('0x40')]===_0x8b57('0x53')){_0x2a0a56[_0x8b57('0x5f')]={'name':!_[_0x8b57('0x1b')](_0x3df107['Full_Name'])?_0x3df107[_0x8b57('0x5c')]:!_[_0x8b57('0x1b')](_0x3df107[_0x8b57('0x5d')])?_0x3df107[_0x8b57('0x5d')]+'\x20'+_0x3df107[_0x8b57('0x5e')]:_0x3df107['Last_Name'],'id':_0x3df107['id']};_0x2a0a56[_0x8b57('0x60')]=_[_0x8b57('0x61')](_0x3df107[_0x8b57('0x40')]);}if(_0x47e30f[_0x8b57('0x62')]){_0x2a0a56[_0x8b57('0x63')]=moment[_0x8b57('0x64')](parseInt(_0x47e30f[_0x8b57('0x62')])*0x3e8)[_0x8b57('0x30')]('mm:ss');}else if(_0x47e30f['answertime']&&_0x47e30f['endtime']){_0x2a0a56[_0x8b57('0x63')]=moment[_0x8b57('0x64')](moment(_0x47e30f['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x8b57('0x65')](moment(_0x47e30f['starttime'],_0x8b57('0x66'))))[_0x8b57('0x30')](_0x8b57('0x67'));}switch(_0x47e30f['lastevent']){case _0x8b57('0x68'):_0x2a0a56[_0x8b57('0x69')]=_0x8b57('0x6a');break;case'complete':case'connect':_0x2a0a56[_0x8b57('0x69')]=_0x8b57('0x6b');break;case _0x8b57('0x6c'):_0x2a0a56[_0x8b57('0x69')]=_0x8b57('0x6d');break;case'abandoned':_0x2a0a56[_0x8b57('0x69')]=_0x8b57('0x6e');break;case _0x8b57('0x6f'):_0x2a0a56[_0x8b57('0x69')]=_0x8b57('0x70');default:}_0x2a0a56['Call_Start_Time']=(_0x2c8f98===_0x8b57('0x71')?moment(_0x47e30f[_0x8b57('0x72')])['format'](_0x8b57('0x66')):moment(_0x47e30f['agentcalledAt'])['format'](_0x8b57('0x66')))||moment()[_0x8b57('0x30')]('YYYY-MM-DDTHH:mm:ss');_0x2a0a56['Call_Type']=_0x2c8f98||_0x8b57('0x73');_0x2a0a56=_[_0x8b57('0x74')](_0x2a0a56,getCustomFields(_0x439ffd[_0x8b57('0x75')],_0x47e30f));return request({'method':_0x8b57('0x24'),'uri':_0x8b57('0x41')+_0x176578+_0x8b57('0x76'),'headers':{'Authorization':_0x8b57('0x4c')+_0x3ca689},'body':{'data':[_0x2a0a56]},'json':!![]})[_0x8b57('0x3e')](function(_0x56d8e0){if(_0x56d8e0&&_0x56d8e0['data'][0x0]['code']==='SUCCESS'){logger['info'](_0x8b57('0x77'));return{'id':_0x56d8e0['data'][0x0][_0x8b57('0x49')]['id']};}})[_0x8b57('0x2b')](function(_0x87d1ce){logger[_0x8b57('0x36')](_0x8b57('0x78'),_0x87d1ce[_0x8b57('0x2d')]);console[_0x8b57('0x79')](_0x8b57('0x78'),_0x87d1ce);});}exports[_0x8b57('0x7a')]=function(_0x50dd59,_0xe4eb22,_0x35e591,_0x3b046b,_0x3a0225,_0x5982a5){var _0x25e172,_0x49627c,_0x57271e;_0x5982a5['host']=intUtil[_0x8b57('0x7b')](_0x5982a5[_0x8b57('0x7c')]);_0x5982a5[_0x8b57('0x7d')]=intUtil[_0x8b57('0x7b')](_0x5982a5[_0x8b57('0x7d')]);if(_0x3a0225&&_0x3a0225[_0x8b57('0x7e')]){logger['info'](_0x8b57('0x7f'),_0x8b57('0x80'));_0xe4eb22[_0x8b57('0x81')]=_0x5982a5[_0x8b57('0x7d')]+'/api/voice/recordings/'+_0xe4eb22['uniqueid']+_0x8b57('0x82')+md5(_0xe4eb22['uniqueid']);}else{_0xe4eb22[_0x8b57('0x81')]='';}var _0x3faed6=_0x5982a5[_0x8b57('0x7c')]===_0x8b57('0x83')?'eu':_0x8b57('0x84');return getAccessToken(_0x5982a5)[_0x8b57('0x3e')](function(_0x451b32){_0x57271e=_0x451b32;return getUser(_0x57271e,_0x3faed6,_0x5982a5,_0x3b046b[_0x8b57('0x35')]);})[_0x8b57('0x3e')](function(_0x1004f3){_0x25e172=_0x1004f3;logger[_0x8b57('0x36')]('The\x20User\x20ID\x20is:',_0x25e172['id']);return getEndUser(_0x57271e,_0x3faed6,_0x5982a5,_0xe4eb22[_0x8b57('0x85')],_0xe4eb22[_0x8b57('0x86')],_0x25e172,_0x35e591);})[_0x8b57('0x3e')](function(_0x3ef1be){_0x49627c=_0x3ef1be;return getCall(_0x57271e,_0x3faed6,_0x5982a5,_0x25e172,_0x49627c,_0x35e591,_0xe4eb22,_0x8b57('0x73'));})[_0x8b57('0x3e')](function(_0x452c40){if(_0x452c40){logger[_0x8b57('0x36')](_0x8b57('0x87'),_0x452c40['id']);logger['info'](_0x8b57('0x7f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8b57('0x30')]('user:%s',_0x3b046b['name']),_0x8b57('0x88'),{'uri':_0x8b57('0x89')+_0x5982a5[_0x8b57('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x452c40['id']});}})['catch'](function(_0x2855c1){logger[_0x8b57('0x3b')](_0x8b57('0x7f'),JSON[_0x8b57('0xb')](_0x2855c1));});};exports[_0x8b57('0x71')]=function(_0x3915aa,_0x316d49,_0x188768,_0x2d8cfa,_0x4d3923,_0x25bf61,_0x5ffdde){var _0x22a61b,_0x3befff,_0x7aab23;_0x25bf61[_0x8b57('0x7c')]=intUtil[_0x8b57('0x7b')](_0x25bf61[_0x8b57('0x7c')]);_0x25bf61[_0x8b57('0x7d')]=intUtil['stripTrailingSlash'](_0x25bf61[_0x8b57('0x7d')]);if(_0x5ffdde&&_0x5ffdde['recordingFormat']&&_0x5ffdde[_0x8b57('0x8a')]!=='none'){logger[_0x8b57('0x36')](_0x8b57('0x8b'),_0x8b57('0x80'));_0x316d49[_0x8b57('0x81')]=_0x25bf61['serverUrl']+_0x8b57('0x8c')+_0x316d49[_0x8b57('0x8d')]+'/downloads?type=uniqueid&token='+md5(_0x316d49[_0x8b57('0x8d')]);}var _0x1483d5=_0x25bf61['host']===_0x8b57('0x83')?'eu':'com';return getAccessToken(_0x25bf61)[_0x8b57('0x3e')](function(_0x43f60c){_0x7aab23=_0x43f60c;return getUser(_0x7aab23,_0x1483d5,_0x25bf61,_0x2d8cfa[_0x8b57('0x35')]);})[_0x8b57('0x3e')](function(_0x333acc){_0x22a61b=_0x333acc;logger['info']('The\x20User\x20ID\x20is:',_0x22a61b['id']);return getEndUser(_0x7aab23,_0x1483d5,_0x25bf61,_0x316d49['destcalleridname'],_0x316d49[_0x8b57('0x8e')],_0x22a61b,_0x188768);})[_0x8b57('0x3e')](function(_0x1f2e9d){_0x3befff=_0x1f2e9d;return getCall(_0x7aab23,_0x1483d5,_0x25bf61,_0x22a61b,_0x3befff,_0x188768,_0x316d49,_0x8b57('0x8f'));})[_0x8b57('0x3e')](function(_0x2e591f){if(_0x2e591f){logger[_0x8b57('0x36')](_0x8b57('0x87'),_0x2e591f['id']);logger[_0x8b57('0x36')](_0x8b57('0x8b'),_0x8b57('0x90'));emit(util[_0x8b57('0x30')](_0x8b57('0x91'),_0x2d8cfa[_0x8b57('0x18')]),_0x8b57('0x88'),{'uri':_0x8b57('0x89')+_0x25bf61['host']+_0x8b57('0x92')+_0x2e591f['id']});}})[_0x8b57('0x2b')](function(_0x390d94){logger[_0x8b57('0x3b')]('[OUTBOUND]',JSON[_0x8b57('0xb')](_0x390d94));});};exports[_0x8b57('0x93')]=function(_0x19401a,_0x59d754,_0x5c07b5,_0x3fce90,_0x3234bc,_0x5f0aa1){var _0x45e3a0,_0x25c8f4,_0x1defe6;_0x5f0aa1[_0x8b57('0x7c')]=intUtil[_0x8b57('0x7b')](_0x5f0aa1[_0x8b57('0x7c')]);_0x5f0aa1['serverUrl']=intUtil[_0x8b57('0x7b')](_0x5f0aa1[_0x8b57('0x7d')]);if(_0x3234bc&&_0x3234bc[_0x8b57('0x7e')]){logger[_0x8b57('0x36')]('['+_0x59d754[_0x8b57('0x94')][_0x8b57('0x95')]()+']',_0x8b57('0x80'));_0x59d754['recordingURL']=_0x5f0aa1[_0x8b57('0x7d')]+_0x8b57('0x8c')+_0x59d754[_0x8b57('0x8d')]+_0x8b57('0x82')+md5(_0x59d754['uniqueid']);}else{_0x59d754[_0x8b57('0x81')]='';}var _0x494bfd=_0x5f0aa1[_0x8b57('0x7c')]===_0x8b57('0x83')?'eu':_0x8b57('0x84');return getAccessToken(_0x5f0aa1)[_0x8b57('0x3e')](function(_0x3ecd2d){_0x1defe6=_0x3ecd2d;return getUser(_0x1defe6,_0x494bfd,_0x5f0aa1);})[_0x8b57('0x3e')](function(_0x4f9f02){_0x45e3a0=_0x4f9f02;logger[_0x8b57('0x36')]('The\x20User\x20ID\x20is:',_0x45e3a0['id']);return getEndUser(_0x1defe6,_0x494bfd,_0x5f0aa1,_0x59d754['calleridname'],_0x59d754[_0x8b57('0x86')],_0x45e3a0,_0x5c07b5);})[_0x8b57('0x3e')](function(_0x717465){_0x25c8f4=_0x717465;return getCall(_0x1defe6,_0x494bfd,_0x5f0aa1,_0x45e3a0,_0x25c8f4,_0x5c07b5,_0x59d754,'Inbound');})['then'](function(_0x2d695c){if(_0x2d695c){logger[_0x8b57('0x36')](_0x8b57('0x87'),_0x2d695c['id']);}})[_0x8b57('0x2b')](function(_0x428a62){logger['error']('['+_0x59d754[_0x8b57('0x94')][_0x8b57('0x95')]()+']',JSON[_0x8b57('0xb')](_0x428a62));});}; \ No newline at end of file +var _0xc36d=['https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','error','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','lead','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','format','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','recordingURL','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','debug','stringify','length','forEach','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','split','isNil','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au'];(function(_0x283b33,_0x5192ca){var _0x5d5c0c=function(_0x243485){while(--_0x243485){_0x283b33['push'](_0x283b33['shift']());}};_0x5d5c0c(++_0x5192ca);}(_0xc36d,0x7d));var _0xdc36=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xc36d[_0x411add];return _0x238242;};'use strict';var _=require(_0xdc36('0x0'));var rp=require(_0xdc36('0x1'));var md5=require(_0xdc36('0x2'));var util=require(_0xdc36('0x3'));var intUtil=require(_0xdc36('0x4'));var moment=require(_0xdc36('0x5'));var Redis=require('ioredis');var BPromise=require(_0xdc36('0x6'));var config=require(_0xdc36('0x7'));var logger=require('../../../../config/logger')(_0xdc36('0x8'));config[_0xdc36('0x9')]=_[_0xdc36('0xa')](config[_0xdc36('0x9')],{'host':_0xdc36('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdc36('0x9')]));function emit(_0x456897,_0x2a0087,_0xdca7f7){io['to'](_0x456897)['emit'](_0x2a0087,_0xdca7f7);}function request(_0x20d00a){logger[_0xdc36('0xc')]('[HTTP]',JSON[_0xdc36('0xd')](_0x20d00a));return rp(_0x20d00a);}function getCustomFields(_0x1cb73d,_0x2483bd){var _0x4c0614={};if(_0x1cb73d[_0xdc36('0xe')]>0x0){_[_0xdc36('0xf')](_0x1cb73d,function(_0x4fda43){if(_['includes']([_0xdc36('0x10'),_0xdc36('0x11')],_0x4fda43[_0xdc36('0x12')])&&_0x4fda43[_0xdc36('0x13')]){_0x4c0614[_0x4fda43['idField']]=_0x4fda43[_0xdc36('0x14')][_0xdc36('0x15')]();}else if(_0x4fda43[_0xdc36('0x12')]===_0xdc36('0x16')&&_0x4fda43[_0xdc36('0x17')]&&_0x4fda43[_0xdc36('0x13')]&&_0x2483bd[_0x4fda43[_0xdc36('0x17')]]){_0x4c0614[_0x4fda43[_0xdc36('0x13')]]=_0x2483bd[_0x4fda43['variableName']][_0xdc36('0x15')]();}else if(_0x4fda43['type']==='customVariable'&&_0x4fda43['Variable']&&_0x4fda43[_0xdc36('0x18')][_0xdc36('0x19')]&&_0x4fda43['idField']&&_0x2483bd[_0x4fda43[_0xdc36('0x18')][_0xdc36('0x19')][_0xdc36('0x1a')]()]){_0x4c0614[_0x4fda43[_0xdc36('0x13')]]=_0x2483bd[_0x4fda43[_0xdc36('0x18')][_0xdc36('0x19')]['toLowerCase']()][_0xdc36('0x15')]();}});}return _0x4c0614;}function getName(_0x12d4bf){if(_0x12d4bf['indexOf']('\x20')>0x0){var _0x414953=_0x12d4bf[_0xdc36('0x1b')](/ (.+)/);if(_0x414953[0x1]){return _0x414953;}}return[_0x12d4bf,_0x12d4bf];}var accountsTokens={};function getAccessToken(_0x3f25f0){return new Promise(function(_0x5f15ef,_0x10aafb){if(!_[_0xdc36('0x1c')](accountsTokens[_0x3f25f0['id']])&&!_['isNil'](accountsTokens[_0x3f25f0['id']][_0xdc36('0x1d')])){if(moment()['isBefore'](accountsTokens[_0x3f25f0['id']]['expires_in'])){_0x5f15ef(accountsTokens[_0x3f25f0['id']][_0xdc36('0x1d')]);}}var _0x2b39a2;switch(_0x3f25f0[_0xdc36('0x1e')]){case'US':_0x2b39a2=_0xdc36('0x1f');break;case'AU':_0x2b39a2=_0xdc36('0x20');break;case'EU':_0x2b39a2=_0xdc36('0x21');break;case'IN':_0x2b39a2=_0xdc36('0x22');break;case'CN':_0x2b39a2=_0xdc36('0x23');break;default:_0x2b39a2='https://accounts.zoho.eu';break;}var _0x34057e={'method':'POST','uri':_0x2b39a2+_0xdc36('0x24'),'qs':{'refresh_token':_0x3f25f0[_0xdc36('0x25')],'client_id':_0x3f25f0[_0xdc36('0x26')],'client_secret':_0x3f25f0['clientSecret'],'grant_type':_0xdc36('0x27')},'json':!![]};return rp(_0x34057e)[_0xdc36('0x28')](function(_0x337091){accountsTokens[_0x3f25f0['id']]={'access_token':_0x337091['access_token'],'expires_in':moment()[_0xdc36('0x29')](_0x337091[_0xdc36('0x2a')],_0xdc36('0x2b'))};_0x5f15ef(_0x337091['access_token']);})[_0xdc36('0x2c')](function(_0x2dcef7){logger['error'](_0xdc36('0x2d'),_0x2dcef7[_0xdc36('0x2e')]);_0x10aafb(_0x2dcef7);});});}function getUser(_0x4ea2ad,_0x21151b,_0x5bba0b,_0x49bbf2){logger['info'](_0xdc36('0x2f'));return request({'method':_0xdc36('0x30'),'uri':util['format'](_0xdc36('0x31'),_0x21151b),'qs':{'type':_0xdc36('0x32')},'headers':{'Authorization':_0xdc36('0x33')+_0x4ea2ad},'json':!![]})['then'](function(_0x2a4451){if(_0x2a4451[_0xdc36('0x34')]){var _0x1d010c=-0x1;if(_[_0xdc36('0x35')](_0x2a4451[_0xdc36('0x34')])){if(!_[_0xdc36('0x1c')](_0x49bbf2)){_0x1d010c=_[_0xdc36('0x36')](_0x2a4451['users'],function(_0x16674c){return _0x16674c[_0xdc36('0x37')]===_0x49bbf2;});}if(_0x1d010c>=0x0){logger['info']('Agent\x20found!');}else{logger[_0xdc36('0x38')](_0xdc36('0x39'));_0x1d010c=_[_0xdc36('0x36')](_0x2a4451['users'],function(_0x521677){return _0x521677[_0xdc36('0x3a')][_0xdc36('0x19')]===_0xdc36('0x3b');});}return _0x2a4451[_0xdc36('0x34')][_0x1d010c];}else{if(_0x2a4451[_0xdc36('0x3c')][_0xdc36('0x3a')][_0xdc36('0x19')]===_0xdc36('0x3b')){logger[_0xdc36('0x38')](_0xdc36('0x39'));user=_0x2a4451[_0xdc36('0x3c')];return user;}else{logger['error'](_0xdc36('0x3d'),JSON[_0xdc36('0xd')](_0x2a4451));throw new Error(_0xdc36('0x3e')+JSON[_0xdc36('0xd')](_0x2a4451));}}}else{logger['error'](_0xdc36('0x3d'),JSON[_0xdc36('0xd')](_0x2a4451));throw new Error(_0xdc36('0x3e')+JSON[_0xdc36('0xd')](_0x2a4451));}})['catch'](function(_0x3c8bd5){console['error'](_0x3c8bd5);});}function getZohoUser(_0x4f82e7,_0x430c14){return new BPromise(function(_0x169c1e,_0x71ac57){request(_0x4f82e7)['then'](function(_0xde6ece){var _0x5abb6a=null;if(_0xde6ece){_0x5abb6a=_0xde6ece[_0xdc36('0x3f')][0x0];_0x5abb6a[_0xdc36('0x40')]=_0x430c14;}_0x169c1e(_0x5abb6a);})[_0xdc36('0x2c')](function(_0x54f0d4){_0x71ac57(_0x54f0d4);});});}function createEndUser(_0x34fe4d,_0x3394ca,_0xd98d42,_0x3da864,_0x50cf7b,_0x11e857){var _0xd98d42=getName(_0xd98d42);return request({'method':_0xdc36('0x41'),'uri':'https://www.zohoapis.'+_0x3394ca+'/crm/v2/'+_[_0xdc36('0x42')](_0x11e857[_0xdc36('0x43')])+'s','body':{'data':[{'Last_Name':_0xd98d42[0x1],'First_Name':_0xd98d42[0x0],'Phone':_0x3da864,'Owner':{'name':!_['isNil'](_0x50cf7b['role'][_0xdc36('0x19')])?_0x50cf7b[_0xdc36('0x44')][_0xdc36('0x19')]:!_[_0xdc36('0x1c')](_0x50cf7b[_0xdc36('0x45')])?_0x50cf7b[_0xdc36('0x45')]+'\x20'+_0x50cf7b[_0xdc36('0x46')]:_0x50cf7b[_0xdc36('0x46')],'id':_0x50cf7b['id']}}]},'headers':{'Authorization':_0xdc36('0x33')+_0x34fe4d},'json':!![]})[_0xdc36('0x28')](function(_0x1682df){if(_0x1682df&&_0x1682df[_0xdc36('0x3f')][0x0][_0xdc36('0x47')]===_0xdc36('0x48')){var _0x1f2604=_0x1682df[_0xdc36('0x3f')][0x0][_0xdc36('0x49')];_0x1f2604[_0xdc36('0x40')]=_[_0xdc36('0x42')](_0x11e857[_0xdc36('0x43')])+'s';return _0x1f2604;}logger[_0xdc36('0x4a')](_0xdc36('0x3d'),JSON[_0xdc36('0xd')](data));throw new Error(_0xdc36('0x4b')+JSON[_0xdc36('0xd')](data));})[_0xdc36('0x2c')](function(_0x557375){console[_0xdc36('0x4c')](_0xdc36('0x4d'),_0x557375);});}function getEndUser(_0x5485a1,_0x5a60e6,_0x3508c8,_0x4abae3,_0x177d9f,_0x51a276,_0x19c7fe){var _0x286de7={'method':_0xdc36('0x30'),'uri':'','headers':{'Authorization':_0xdc36('0x33')+_0x5485a1},'json':!![]};switch(_0x19c7fe[_0xdc36('0x4e')]){case _0xdc36('0x4f'):_0x286de7[_0xdc36('0x50')]=_0xdc36('0x51')+_0x5a60e6+_0xdc36('0x52')+_0x177d9f+'))';return getZohoUser(_0x286de7,_0xdc36('0x53'))[_0xdc36('0x28')](function(_0xd3e651){if(_0xd3e651)return _0xd3e651;_0x286de7[_0xdc36('0x50')]=_0xdc36('0x51')+_0x5a60e6+_0xdc36('0x54')+_0x177d9f+'))';return getZohoUser(_0x286de7,_0xdc36('0x55'))[_0xdc36('0x28')](function(_0x3399cc){if(_0x3399cc)return _0x3399cc;if(_0x19c7fe['moduleCreate']!='nothing'){return createEndUser(_0x5485a1,_0x5a60e6,_0x4abae3,_0x177d9f,_0x51a276,_0x19c7fe);}else{return{};}});});break;case _0xdc36('0x56'):_0x286de7[_0xdc36('0x50')]=_0xdc36('0x51')+_0x5a60e6+_0xdc36('0x52')+_0x177d9f+'))';return getZohoUser(_0x286de7,_0xdc36('0x53'))[_0xdc36('0x28')](function(_0x5ade8b){if(_0x5ade8b)return _0x5ade8b;if(_0x19c7fe[_0xdc36('0x43')]!=_0xdc36('0x57')){return createEndUser(_0x5485a1,_0x5a60e6,_0x4abae3,_0x177d9f,_0x51a276,_0x19c7fe);}else{return{};}});break;case _0xdc36('0x58'):_0x286de7['uri']=_0xdc36('0x51')+_0x5a60e6+_0xdc36('0x54')+_0x177d9f+'))';return getZohoUser(_0x286de7,_0xdc36('0x55'))[_0xdc36('0x28')](function(_0x3bfc00){if(_0x3bfc00)return _0x3bfc00;if(_0x19c7fe[_0xdc36('0x43')]!='nothing'){return createEndUser(_0x5485a1,_0x5a60e6,_0x4abae3,_0x177d9f,_0x51a276,_0x19c7fe);}else{return{};}});break;}}function getCall(_0x2f1707,_0x31b52c,_0x283df2,_0x18272a,_0x2d7201,_0x2b7319,_0x26775a,_0x225ffb){logger['info'](_0xdc36('0x59'));var _0x5bdc6={};_0x5bdc6[_0xdc36('0x5a')]={'name':!_[_0xdc36('0x1c')](_0x18272a[_0xdc36('0x44')][_0xdc36('0x19')])&&!_[_0xdc36('0x1c')](_0x18272a[_0xdc36('0x3a')]['name'])&&_0x18272a['profile'][_0xdc36('0x19')]===_0xdc36('0x5b')?_0x18272a['role'][_0xdc36('0x19')]:!_[_0xdc36('0x1c')](_0x18272a['first_name'])?_0x18272a['first_name']+'\x20'+_0x18272a[_0xdc36('0x46')]:_0x18272a['last_name'],'id':_0x18272a['id']};_0x5bdc6[_0xdc36('0x5c')]=intUtil['getString'](_0x2b7319[_0xdc36('0x5d')],_0x26775a,'\x20');_0x5bdc6['Description']=intUtil['getString'](_0x2b7319[_0xdc36('0x5e')],_0x26775a,'\x0a');if(_0x2d7201['enduserType']===_0xdc36('0x53')){_0x5bdc6[_0xdc36('0x5f')]={'name':!_[_0xdc36('0x1c')](_0x2d7201[_0xdc36('0x60')])?_0x2d7201[_0xdc36('0x60')]:!_['isNil'](_0x2d7201[_0xdc36('0x61')])?_0x2d7201[_0xdc36('0x61')]+'\x20'+_0x2d7201[_0xdc36('0x62')]:_0x2d7201['Last_Name'],'id':_0x2d7201['id']};}if(_0x2d7201['enduserType']===_0xdc36('0x55')){_0x5bdc6['What_Id']={'name':!_[_0xdc36('0x1c')](_0x2d7201[_0xdc36('0x60')])?_0x2d7201[_0xdc36('0x60')]:!_[_0xdc36('0x1c')](_0x2d7201['First_Name'])?_0x2d7201['First_Name']+'\x20'+_0x2d7201[_0xdc36('0x62')]:_0x2d7201[_0xdc36('0x62')],'id':_0x2d7201['id']};_0x5bdc6[_0xdc36('0x63')]=_[_0xdc36('0x42')](_0x2d7201[_0xdc36('0x40')]);}if(_0x26775a[_0xdc36('0x64')]){_0x5bdc6[_0xdc36('0x65')]=moment[_0xdc36('0x66')](parseInt(_0x26775a[_0xdc36('0x64')])*0x3e8)[_0xdc36('0x67')]('mm:ss');}else if(_0x26775a[_0xdc36('0x68')]&&_0x26775a['endtime']){_0x5bdc6[_0xdc36('0x65')]=moment[_0xdc36('0x66')](moment(_0x26775a[_0xdc36('0x69')],_0xdc36('0x6a'))[_0xdc36('0x6b')](moment(_0x26775a[_0xdc36('0x6c')],_0xdc36('0x6a'))))[_0xdc36('0x67')](_0xdc36('0x6d'));}switch(_0x26775a[_0xdc36('0x6e')]){case _0xdc36('0x6f'):_0x5bdc6[_0xdc36('0x70')]=_0xdc36('0x71');break;case _0xdc36('0x72'):case _0xdc36('0x73'):_0x5bdc6[_0xdc36('0x70')]=_0xdc36('0x74');break;case _0xdc36('0x75'):_0x5bdc6[_0xdc36('0x70')]=_0xdc36('0x76');break;case'abandoned':_0x5bdc6[_0xdc36('0x70')]=_0xdc36('0x77');break;case _0xdc36('0x78'):_0x5bdc6[_0xdc36('0x70')]=_0xdc36('0x79');default:}_0x5bdc6[_0xdc36('0x7a')]=(_0x225ffb==='outbound'?moment(_0x26775a[_0xdc36('0x6c')])[_0xdc36('0x67')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x26775a['agentcalledAt'])[_0xdc36('0x67')](_0xdc36('0x6a')))||moment()[_0xdc36('0x67')]('YYYY-MM-DDTHH:mm:ss');_0x5bdc6['Call_Type']=_0x225ffb||_0xdc36('0x7b');_0x5bdc6=_[_0xdc36('0x7c')](_0x5bdc6,getCustomFields(_0x2b7319['Fields'],_0x26775a));return request({'method':'POST','uri':_0xdc36('0x51')+_0x31b52c+_0xdc36('0x7d'),'headers':{'Authorization':_0xdc36('0x33')+_0x2f1707},'body':{'data':[_0x5bdc6]},'json':!![]})[_0xdc36('0x28')](function(_0x118c99){if(_0x118c99&&_0x118c99[_0xdc36('0x3f')][0x0][_0xdc36('0x47')]===_0xdc36('0x48')){logger['info'](_0xdc36('0x7e'));return{'id':_0x118c99['data'][0x0]['details']['id']};}})['catch'](function(_0x150515){logger[_0xdc36('0x38')](_0xdc36('0x7f'),_0x150515[_0xdc36('0x2e')]);console['log'](_0xdc36('0x7f'),_0x150515);});}exports[_0xdc36('0x80')]=function(_0x3c8aac,_0x1f4d20,_0xda6914,_0x481968,_0x4ff220,_0x48b13a){var _0x51148b,_0x277d13,_0x398272;_0x48b13a[_0xdc36('0x81')]=intUtil[_0xdc36('0x82')](_0x48b13a[_0xdc36('0x81')]);_0x48b13a[_0xdc36('0x83')]=intUtil[_0xdc36('0x82')](_0x48b13a[_0xdc36('0x83')]);if(_0x4ff220&&_0x4ff220[_0xdc36('0x84')]){logger['info'](_0xdc36('0x85'),_0xdc36('0x86'));_0x1f4d20['recordingURL']=_0x48b13a['serverUrl']+_0xdc36('0x87')+_0x1f4d20['uniqueid']+_0xdc36('0x88')+md5(_0x1f4d20['uniqueid']);}else{_0x1f4d20[_0xdc36('0x89')]='';}var _0x3667a2=_0x48b13a[_0xdc36('0x81')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x48b13a)['then'](function(_0x311024){_0x398272=_0x311024;return getUser(_0x398272,_0x3667a2,_0x48b13a,_0x481968[_0xdc36('0x37')]);})[_0xdc36('0x28')](function(_0x3a699d){_0x51148b=_0x3a699d;logger[_0xdc36('0x38')]('The\x20User\x20ID\x20is:',_0x51148b['id']);return getEndUser(_0x398272,_0x3667a2,_0x48b13a,_0x1f4d20[_0xdc36('0x8a')],_0x1f4d20[_0xdc36('0x8b')],_0x51148b,_0xda6914);})[_0xdc36('0x28')](function(_0x5eb18b){_0x277d13=_0x5eb18b;return getCall(_0x398272,_0x3667a2,_0x48b13a,_0x51148b,_0x277d13,_0xda6914,_0x1f4d20,'Inbound');})[_0xdc36('0x28')](function(_0x705e1e){if(_0x705e1e){logger[_0xdc36('0x38')](_0xdc36('0x8c'),_0x705e1e['id']);logger[_0xdc36('0x38')](_0xdc36('0x85'),_0xdc36('0x8d'));emit(util[_0xdc36('0x67')](_0xdc36('0x8e'),_0x481968[_0xdc36('0x19')]),'trigger:browser:url',{'uri':'https://crm.'+_0x48b13a['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x705e1e['id']});}})[_0xdc36('0x2c')](function(_0x329b49){logger[_0xdc36('0x4a')]('[QUEUE]',JSON[_0xdc36('0xd')](_0x329b49));});};exports[_0xdc36('0x8f')]=function(_0x26b38e,_0x192316,_0x594be6,_0x8822f1,_0x17ca8a,_0x111f62,_0x209cb6){var _0x81fdbf,_0xae33f3,_0x1d9196;_0x111f62[_0xdc36('0x81')]=intUtil[_0xdc36('0x82')](_0x111f62[_0xdc36('0x81')]);_0x111f62[_0xdc36('0x83')]=intUtil[_0xdc36('0x82')](_0x111f62['serverUrl']);if(_0x209cb6&&_0x209cb6[_0xdc36('0x90')]&&_0x209cb6[_0xdc36('0x90')]!==_0xdc36('0x91')){logger[_0xdc36('0x38')](_0xdc36('0x92'),'Recording\x20is\x20enabled!');_0x192316[_0xdc36('0x89')]=_0x111f62[_0xdc36('0x83')]+'/api/voice/recordings/'+_0x192316[_0xdc36('0x93')]+_0xdc36('0x88')+md5(_0x192316[_0xdc36('0x93')]);}var _0x4f99d1=_0x111f62[_0xdc36('0x81')]===_0xdc36('0x94')?'eu':_0xdc36('0x95');return getAccessToken(_0x111f62)[_0xdc36('0x28')](function(_0x137130){_0x1d9196=_0x137130;return getUser(_0x1d9196,_0x4f99d1,_0x111f62,_0x8822f1[_0xdc36('0x37')]);})[_0xdc36('0x28')](function(_0x202cac){_0x81fdbf=_0x202cac;logger['info'](_0xdc36('0x96'),_0x81fdbf['id']);return getEndUser(_0x1d9196,_0x4f99d1,_0x111f62,_0x192316['destcalleridname'],_0x192316[_0xdc36('0x97')],_0x81fdbf,_0x594be6);})[_0xdc36('0x28')](function(_0x3d2031){_0xae33f3=_0x3d2031;return getCall(_0x1d9196,_0x4f99d1,_0x111f62,_0x81fdbf,_0xae33f3,_0x594be6,_0x192316,_0xdc36('0x98'));})[_0xdc36('0x28')](function(_0x3920db){if(_0x3920db){logger[_0xdc36('0x38')]('The\x20Call\x20ID\x20is:',_0x3920db['id']);logger[_0xdc36('0x38')](_0xdc36('0x92'),_0xdc36('0x8d'));emit(util[_0xdc36('0x67')]('user:%s',_0x8822f1[_0xdc36('0x19')]),_0xdc36('0x99'),{'uri':_0xdc36('0x9a')+_0x111f62[_0xdc36('0x81')]+_0xdc36('0x9b')+_0x3920db['id']});}})['catch'](function(_0x4b7f8d){logger[_0xdc36('0x4a')](_0xdc36('0x92'),JSON['stringify'](_0x4b7f8d));});};exports[_0xdc36('0x9c')]=function(_0x10edfb,_0x41b0e0,_0x26fc14,_0x3d8aaf,_0x47d6ac,_0x3addfd){var _0xb72679,_0x564eb0,_0x29edce;_0x3addfd[_0xdc36('0x81')]=intUtil[_0xdc36('0x82')](_0x3addfd[_0xdc36('0x81')]);_0x3addfd[_0xdc36('0x83')]=intUtil[_0xdc36('0x82')](_0x3addfd[_0xdc36('0x83')]);if(_0x47d6ac&&_0x47d6ac['monitor_format']){logger[_0xdc36('0x38')]('['+_0x41b0e0[_0xdc36('0x6e')][_0xdc36('0x9d')]()+']',_0xdc36('0x86'));_0x41b0e0[_0xdc36('0x89')]=_0x3addfd['serverUrl']+_0xdc36('0x87')+_0x41b0e0[_0xdc36('0x93')]+'/downloads?type=uniqueid&token='+md5(_0x41b0e0[_0xdc36('0x93')]);}else{_0x41b0e0[_0xdc36('0x89')]='';}var _0x446dff=_0x3addfd[_0xdc36('0x81')]==='zoho.eu'?'eu':_0xdc36('0x95');return getAccessToken(_0x3addfd)['then'](function(_0x3424e4){_0x29edce=_0x3424e4;return getUser(_0x29edce,_0x446dff,_0x3addfd);})[_0xdc36('0x28')](function(_0x3b59e5){_0xb72679=_0x3b59e5;logger[_0xdc36('0x38')](_0xdc36('0x96'),_0xb72679['id']);return getEndUser(_0x29edce,_0x446dff,_0x3addfd,_0x41b0e0[_0xdc36('0x8a')],_0x41b0e0[_0xdc36('0x8b')],_0xb72679,_0x26fc14);})['then'](function(_0x992eb1){_0x564eb0=_0x992eb1;return getCall(_0x29edce,_0x446dff,_0x3addfd,_0xb72679,_0x564eb0,_0x26fc14,_0x41b0e0,_0xdc36('0x7b'));})[_0xdc36('0x28')](function(_0x41c710){if(_0x41c710){logger[_0xdc36('0x38')]('The\x20Call\x20ID\x20is:',_0x41c710['id']);}})[_0xdc36('0x2c')](function(_0x13f5b9){logger[_0xdc36('0x4a')]('['+_0x41b0e0[_0xdc36('0x6e')][_0xdc36('0x9d')]()+']',JSON[_0xdc36('0xd')](_0x13f5b9));});}; \ 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 8af8708..144d943 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 _0x4e8d=['data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','../../../../config/logger','exec','data2','Script'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4e8d,0xc3));var _0xd4e8=function(_0x22e60f,_0x8bd946){_0x22e60f=_0x22e60f-0x0;var _0x4c87f3=_0x4e8d[_0x22e60f];return _0x4c87f3;};'use strict';var util=require(_0xd4e8('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0xd4e8('0x1'))('trigger');exports[_0xd4e8('0x2')]=function(_0x3c89b6,_0x11056d){var _0x12b30c=_0x3c89b6[_0xd4e8('0x3')]?_0x3c89b6[_0xd4e8('0x3')]:_0xd4e8('0x4');var _0x7a9e4=_0x3c89b6[_0xd4e8('0x5')]?Mustache[_0xd4e8('0x6')](_0x3c89b6[_0xd4e8('0x5')],_0x11056d):_0x11056d;sh['exec'](_0x7a9e4,function(_0x14e5de,_0x42f902,_0x493ff5){if(_0x14e5de!==0x0){logger['error'](util[_0xd4e8('0x7')](_0xd4e8('0x8'),_0x12b30c,_0x7a9e4,_0x14e5de,_0x493ff5));}else{logger[_0xd4e8('0x9')](util[_0xd4e8('0x7')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x12b30c,_0x7a9e4,_0x42f902));}});}; \ No newline at end of file +var _0x6de5=['info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','data2','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x4fff72,_0xfef5cf){var _0x12ef81=function(_0x1e6554){while(--_0x1e6554){_0x4fff72['push'](_0x4fff72['shift']());}};_0x12ef81(++_0xfef5cf);}(_0x6de5,0x1ed));var _0x56de=function(_0x1e5536,_0x27d111){_0x1e5536=_0x1e5536-0x0;var _0x251027=_0x6de5[_0x1e5536];return _0x251027;};'use strict';var util=require('util');var sh=require(_0x56de('0x0'));var Mustache=require(_0x56de('0x1'));var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x5bb16,_0xfd876a){var _0x4c2cd6=_0x5bb16[_0x56de('0x2')]?_0x5bb16[_0x56de('0x2')]:'Script';var _0x364fd7=_0x5bb16[_0x56de('0x3')]?Mustache[_0x56de('0x4')](_0x5bb16[_0x56de('0x3')],_0xfd876a):_0xfd876a;sh['exec'](_0x364fd7,function(_0x52c888,_0x54bf7a,_0x18db41){if(_0x52c888!==0x0){logger[_0x56de('0x5')](util['format'](_0x56de('0x6'),_0x4c2cd6,_0x364fd7,_0x52c888,_0x18db41));}else{logger[_0x56de('0x7')](util[_0x56de('0x8')](_0x56de('0x9'),_0x4c2cd6,_0x364fd7,_0x54bf7a));}});}; \ 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 f54a9bc..639db0c 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 _0x1355=['number','data5','data6','parse','error','stack','GET','DELETE','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','then','isNil',',\x20request\x20body:\x20','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','data1','toUpperCase','render','data2'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x1355,0x14b));var _0x5135=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0x1355[_0x4c7d8b];return _0x187158;};'use strict';var rp=require(_0x5135('0x0'));var util=require(_0x5135('0x1'));var _=require(_0x5135('0x2'));var Mustache=require(_0x5135('0x3'));var logger=require(_0x5135('0x4'))('trigger');exports['exec']=function(_0x56604a,_0x29123f){var _0x222486,_0x17ca08;var _0x33f4b7={'method':_0x56604a[_0x5135('0x5')][_0x5135('0x6')](),'uri':Mustache[_0x5135('0x7')](_0x56604a[_0x5135('0x8')],_0x29123f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x56604a['data5'])===_0x5135('0x9')&&parseInt(_0x56604a[_0x5135('0xa')])>=0x1&&parseInt(_0x56604a[_0x5135('0xa')])<=0xa?parseInt(_0x56604a[_0x5135('0xa')])*0x3e8:0x5*0x3e8};try{_0x33f4b7['headers']=_0x56604a[_0x5135('0xb')]?JSON[_0x5135('0xc')](Mustache['render'](_0x56604a[_0x5135('0xb')],_0x29123f)):{};}catch(_0x19d601){logger[_0x5135('0xd')](_0x19d601[_0x5135('0xe')]);}switch(_0x56604a['data1'][_0x5135('0x6')]()){case _0x5135('0xf'):case _0x5135('0x10'):_0x222486=null;_0x33f4b7['qs']=_0x29123f;break;case _0x5135('0x11'):case'PUT':if(_0x56604a[_0x5135('0x12')]){try{_0x222486=JSON[_0x5135('0xc')](Mustache[_0x5135('0x7')](_0x56604a['data7'],_0x29123f));_0x33f4b7[_0x5135('0x13')]=_0x222486;}catch(_0x22accd){logger['error'](_0x22accd[_0x5135('0xe')]);logger[_0x5135('0xd')](_0x5135('0x14'));}}else{_0x222486=_0x29123f;_0x33f4b7[_0x5135('0x13')]=_0x222486;}break;}logger['info'](util[_0x5135('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x56604a[_0x5135('0x5')],_0x56604a[_0x5135('0x8')],JSON['stringify'](_0x33f4b7)));rp(_0x33f4b7)[_0x5135('0x16')](function(_0x3b6f34){_0x222486=!_[_0x5135('0x17')](_0x222486)?_0x5135('0x18')+_0x222486:'';_0x17ca08=typeof _0x3b6f34['body']===_0x5135('0x19')?JSON[_0x5135('0x1a')](_0x3b6f34[_0x5135('0x13')]):_0x3b6f34[_0x5135('0x13')];logger[_0x5135('0x1b')](util[_0x5135('0x15')](_0x5135('0x1c'),_0x56604a[_0x5135('0x5')],_0x56604a[_0x5135('0x8')],_0x3b6f34[_0x5135('0x1d')],_0x17ca08));})[_0x5135('0x1e')](function(_0x5f49e3){logger[_0x5135('0xd')](util['format'](_0x5135('0x1f'),_0x56604a['data1'],_0x56604a[_0x5135('0x8')],_0x5f49e3[_0x5135('0x1d')],_0x5f49e3[_0x5135('0x20')],_0x5f49e3[_0x5135('0x21')]));});}; \ No newline at end of file +var _0xf688=['data6','error','stack','toUpperCase','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','then','isNil',',\x20request\x20body:\x20','object','stringify','data2','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','data5','number','headers','parse'];(function(_0x1beae1,_0x1981ac){var _0x99ab21=function(_0x409b2d){while(--_0x409b2d){_0x1beae1['push'](_0x1beae1['shift']());}};_0x99ab21(++_0x1981ac);}(_0xf688,0x9d));var _0x8f68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf688[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x8f68('0x0'));var util=require(_0x8f68('0x1'));var _=require(_0x8f68('0x2'));var Mustache=require(_0x8f68('0x3'));var logger=require(_0x8f68('0x4'))(_0x8f68('0x5'));exports[_0x8f68('0x6')]=function(_0x35ea7c,_0x336a7d){var _0x1c68c3,_0x4e0bff;var _0x53ca9f={'method':_0x35ea7c[_0x8f68('0x7')]['toUpperCase'](),'uri':Mustache[_0x8f68('0x8')](_0x35ea7c['data2'],_0x336a7d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x35ea7c[_0x8f68('0x9')])===_0x8f68('0xa')&&parseInt(_0x35ea7c['data5'])>=0x1&&parseInt(_0x35ea7c[_0x8f68('0x9')])<=0xa?parseInt(_0x35ea7c[_0x8f68('0x9')])*0x3e8:0x5*0x3e8};try{_0x53ca9f[_0x8f68('0xb')]=_0x35ea7c['data6']?JSON[_0x8f68('0xc')](Mustache['render'](_0x35ea7c[_0x8f68('0xd')],_0x336a7d)):{};}catch(_0x410c5c){logger[_0x8f68('0xe')](_0x410c5c[_0x8f68('0xf')]);}switch(_0x35ea7c['data1'][_0x8f68('0x10')]()){case'GET':case _0x8f68('0x11'):_0x1c68c3=null;_0x53ca9f['qs']=_0x336a7d;break;case _0x8f68('0x12'):case _0x8f68('0x13'):if(_0x35ea7c[_0x8f68('0x14')]){try{_0x1c68c3=JSON[_0x8f68('0xc')](Mustache[_0x8f68('0x8')](_0x35ea7c[_0x8f68('0x14')],_0x336a7d));_0x53ca9f['body']=_0x1c68c3;}catch(_0x154845){logger[_0x8f68('0xe')](_0x154845[_0x8f68('0xf')]);logger['error'](_0x8f68('0x15'));}}else{_0x1c68c3=_0x336a7d;_0x53ca9f[_0x8f68('0x16')]=_0x1c68c3;}break;}logger[_0x8f68('0x17')](util[_0x8f68('0x18')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x35ea7c[_0x8f68('0x7')],_0x35ea7c['data2'],JSON['stringify'](_0x53ca9f)));rp(_0x53ca9f)[_0x8f68('0x19')](function(_0x403f07){_0x1c68c3=!_[_0x8f68('0x1a')](_0x1c68c3)?_0x8f68('0x1b')+_0x1c68c3:'';_0x4e0bff=typeof _0x403f07[_0x8f68('0x16')]===_0x8f68('0x1c')?JSON[_0x8f68('0x1d')](_0x403f07[_0x8f68('0x16')]):_0x403f07['body'];logger[_0x8f68('0x17')](util[_0x8f68('0x18')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x35ea7c[_0x8f68('0x7')],_0x35ea7c[_0x8f68('0x1e')],_0x403f07['statusCode'],_0x4e0bff));})[_0x8f68('0x1f')](function(_0x2b95a0){logger[_0x8f68('0xe')](util[_0x8f68('0x18')](_0x8f68('0x20'),_0x35ea7c[_0x8f68('0x7')],_0x35ea7c[_0x8f68('0x1e')],_0x2b95a0['statusCode'],_0x2b95a0[_0x8f68('0x21')],_0x2b95a0['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index f7ed32a..f687603 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 _0xc857=['jayson/promise','bluebird','routing','client','http','Request','request','then','debug','error','rpc','message','result','catch','exports'];(function(_0xb3c0fd,_0x43de0f){var _0x231781=function(_0x22d4d8){while(--_0x22d4d8){_0xb3c0fd['push'](_0xb3c0fd['shift']());}};_0x231781(++_0x43de0f);}(_0xc857,0x1d1));var _0x7c85=function(_0x359fd3,_0x4b0949){_0x359fd3=_0x359fd3-0x0;var _0x5b81e0=_0xc857[_0x359fd3];return _0x5b81e0;};'use strict';var jayson=require(_0x7c85('0x0'));var BPromise=require(_0x7c85('0x1'));var logger=require('../../config/logger')(_0x7c85('0x2'));var client=jayson[_0x7c85('0x3')][_0x7c85('0x4')]({'port':0x2329});client[_0x7c85('0x5')]=function(_0x4306f0,_0x40de04){return new BPromise(function(_0x4d778d,_0x16fde1){return client[_0x7c85('0x6')](_0x4306f0,_0x40de04)[_0x7c85('0x7')](function(_0x2b505d){logger[_0x7c85('0x8')]('rpc',_0x7c85('0x2'),_0x4306f0,_0x40de04,_0x2b505d);if(_0x2b505d['error']){logger[_0x7c85('0x9')](_0x7c85('0xa'),_0x7c85('0x2'),_0x4306f0,_0x2b505d[_0x7c85('0x9')]['message'],_0x40de04);return _0x16fde1(_0x2b505d['error'][_0x7c85('0xb')]);}else{return _0x4d778d(_0x2b505d[_0x7c85('0xc')]);}})[_0x7c85('0xd')](function(_0x48a1df){logger[_0x7c85('0x9')]('rpc',_0x7c85('0x2'),_0x4306f0,_0x48a1df,_0x40de04);return _0x16fde1(_0x48a1df);});});};module[_0x7c85('0xe')]=client; \ No newline at end of file +var _0x6d11=['../../config/logger','routing','client','http','Request','request','rpc','message','error','catch','exports','bluebird'];(function(_0x33fce5,_0x54df41){var _0x162e6e=function(_0x29def6){while(--_0x29def6){_0x33fce5['push'](_0x33fce5['shift']());}};_0x162e6e(++_0x54df41);}(_0x6d11,0x143));var _0x16d1=function(_0x15eeb3,_0xde4dcb){_0x15eeb3=_0x15eeb3-0x0;var _0x822e4b=_0x6d11[_0x15eeb3];return _0x822e4b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x16d1('0x0'));var logger=require(_0x16d1('0x1'))(_0x16d1('0x2'));var client=jayson[_0x16d1('0x3')][_0x16d1('0x4')]({'port':0x2329});client[_0x16d1('0x5')]=function(_0x33ca57,_0x302bee){return new BPromise(function(_0x50517a,_0x33fc0e){return client[_0x16d1('0x6')](_0x33ca57,_0x302bee)['then'](function(_0x40302b){logger['debug'](_0x16d1('0x7'),_0x16d1('0x2'),_0x33ca57,_0x302bee,_0x40302b);if(_0x40302b['error']){logger['error']('rpc',_0x16d1('0x2'),_0x33ca57,_0x40302b['error'][_0x16d1('0x8')],_0x302bee);return _0x33fc0e(_0x40302b[_0x16d1('0x9')][_0x16d1('0x8')]);}else{return _0x50517a(_0x40302b['result']);}})[_0x16d1('0xa')](function(_0xc01253){logger['error'](_0x16d1('0x7'),_0x16d1('0x2'),_0x33ca57,_0xc01253,_0x302bee);return _0x33fc0e(_0xc01253);});});};module[_0x16d1('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 7fc0876..917c18b 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 _0x8619=['listen','loginMailFrequency','catch','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0xbd77c1,_0x50b969){var _0x47fa83=function(_0x38dac1){while(--_0x38dac1){_0xbd77c1['push'](_0xbd77c1['shift']());}};_0x47fa83(++_0x50b969);}(_0x8619,0x18b));var _0x9861=function(_0x40949a,_0x10a831){_0x40949a=_0x40949a-0x0;var _0x1d2d33=_0x8619[_0x40949a];return _0x1d2d33;};'use strict';var BPromise=require(_0x9861('0x0'));var server=require(_0x9861('0x1'));var Realtime=require(_0x9861('0x2'));var EmailChannel=require(_0x9861('0x3'));var mailAccount=require(_0x9861('0x4'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x9861('0x5')]()[_0x9861('0x6')](mailAccount[_0x9861('0x7')]())[_0x9861('0x6')](realtime[_0x9861('0x8')]())[_0x9861('0x6')](function(){email[_0x9861('0x9')](realtime[_0x9861('0xa')]);return realtime;});}function main(){return server[_0x9861('0xb')](realtime,email)[_0x9861('0x6')](function(){return initRealtime();})[_0x9861('0x6')](function(){return setting['getSettings']();})[_0x9861('0x6')](function(_0x16f589){return setInterval(initRealtime,_0x16f589[_0x9861('0xc')]*0x3e8);})[_0x9861('0xd')](function(_0x4b965f){console['log'](_0x4b965f);});}main(); \ No newline at end of file +var _0x45a0=['catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','getMailAccounts','initMailAccounts','then','refresh','mailAccounts','listen','getSettings','loginMailFrequency'];(function(_0x5aa17e,_0x517d62){var _0x2002ba=function(_0x33facd){while(--_0x33facd){_0x5aa17e['push'](_0x5aa17e['shift']());}};_0x2002ba(++_0x517d62);}(_0x45a0,0x1a2));var _0x045a=function(_0x495b8f,_0x50be88){_0x495b8f=_0x495b8f-0x0;var _0x3e7b90=_0x45a0[_0x495b8f];return _0x3e7b90;};'use strict';var BPromise=require(_0x045a('0x0'));var server=require(_0x045a('0x1'));var Realtime=require(_0x045a('0x2'));var EmailChannel=require(_0x045a('0x3'));var mailAccount=require(_0x045a('0x4'));var setting=require(_0x045a('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()['then'](mailAccount[_0x045a('0x6')]())['then'](realtime[_0x045a('0x7')]())[_0x045a('0x8')](function(){email[_0x045a('0x9')](realtime[_0x045a('0xa')]);return realtime;});}function main(){return server[_0x045a('0xb')](realtime,email)[_0x045a('0x8')](function(){return initRealtime();})['then'](function(){return setting[_0x045a('0xc')]();})[_0x045a('0x8')](function(_0x3d231f){return setInterval(initRealtime,_0x3d231f[_0x045a('0xd')]*0x3e8);})[_0x045a('0xe')](function(_0x2bc077){console[_0x045a('0xf')](_0x2bc077);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index b41c81b..7e1ac6b 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 _0xc4d0=['hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','status','disabled','connected','name','messages','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','active','Imap','messageStatus','isNil','mailAccount:update','refresh'];(function(_0x4e7a40,_0x4d764f){var _0x233ae9=function(_0x5b4c40){while(--_0x5b4c40){_0x4e7a40['push'](_0x4e7a40['shift']());}};_0x233ae9(++_0x4d764f);}(_0xc4d0,0x1a0));var _0x0c4d=function(_0xdf6837,_0x440887){_0xdf6837=_0xdf6837-0x0;var _0x254cfa=_0xc4d0[_0xdf6837];return _0x254cfa;};'use strict';var _=require(_0x0c4d('0x0'));var moment=require(_0x0c4d('0x1'));var BPromise=require('bluebird');var md5=require(_0x0c4d('0x2'));var Redis=require(_0x0c4d('0x3'));var config=require(_0x0c4d('0x4'));var logger=require(_0x0c4d('0x5'))(_0x0c4d('0x6'));config['redis']=_['defaults'](config[_0x0c4d('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x0c4d('0x8'))(new Redis(config[_0x0c4d('0x7')]));var EmailImap=require(_0x0c4d('0x9'));var EmailSmtp=require(_0x0c4d('0xa'));var mailAccount=require(_0x0c4d('0xb'));var md5Accounts={};function EmailChannel(_0x486989){logger['info'](_0x0c4d('0xc'));this[_0x0c4d('0xd')]=_0x486989[_0x0c4d('0xd')];this[_0x0c4d('0xe')]={};this[_0x0c4d('0xf')]=new EmailSmtp();}EmailChannel[_0x0c4d('0x10')][_0x0c4d('0x11')]=function(_0x248538){var _0x296501=this[_0x0c4d('0xd')][_0x248538];var _0x4f8c5b={'id':_0x296501['id'],'name':_0x296501['name'],'key':_0x296501['key'],'active':_0x296501[_0x0c4d('0x12')],'Imap':{'status':_0x296501[_0x0c4d('0x13')]['status'],'messageStatus':_0x296501[_0x0c4d('0x13')][_0x0c4d('0x14')],'total':_0x296501['Imap']['total']}};if(_[_0x0c4d('0x15')](md5Accounts[_0x248538])){md5Accounts[_0x248538]={};}var _0x559667=md5(JSON['stringify'](_0x4f8c5b));if(md5Accounts[_0x248538][_0x0c4d('0x2')]!==_0x559667){md5Accounts[_0x248538][_0x0c4d('0x2')]=_0x559667;io[_0x0c4d('0x11')](_0x0c4d('0x16'),_0x4f8c5b);}};EmailChannel[_0x0c4d('0x10')][_0x0c4d('0x17')]=function(_0x3841df){for(var _0x1937ad in _0x3841df){if(_0x3841df[_0x0c4d('0x18')](_0x1937ad)){if(_0x3841df[_0x1937ad][_0x0c4d('0x13')]&&_0x3841df[_0x1937ad][_0x0c4d('0x12')]){var _0x3c97ba=_0x3841df[_0x1937ad][_0x0c4d('0x13')];if(!this[_0x0c4d('0xe')][_0x0c4d('0x18')](_0x3c97ba['id'])){this[_0x0c4d('0xe')][_0x3c97ba['id']]=new EmailImap(_0x3c97ba,_0x3841df[_0x1937ad][_0x0c4d('0x6')]);this[_0x0c4d('0xe')][_0x3c97ba['id']]['on'](_0x0c4d('0x19'),this[_0x0c4d('0x1a')][_0x0c4d('0x1b')](this,_0x1937ad));this[_0x0c4d('0xe')][_0x3c97ba['id']]['on'](_0x0c4d('0x6'),this[_0x0c4d('0x1c')][_0x0c4d('0x1b')](this,_0x1937ad));this['imapAccounts'][_0x3c97ba['id']]['on'](_0x0c4d('0x1d'),this[_0x0c4d('0x1e')]['bind'](this,_0x1937ad));this[_0x0c4d('0xe')][_0x3c97ba['id']]['on'](_0x0c4d('0x1f'),this[_0x0c4d('0x20')][_0x0c4d('0x1b')](this,_0x1937ad));}}else{if(_[_0x0c4d('0x15')](this[_0x0c4d('0xd')][_0x1937ad][_0x0c4d('0x13')])){this[_0x0c4d('0xd')][_0x1937ad]['Imap']={};}this[_0x0c4d('0xd')][_0x1937ad][_0x0c4d('0x13')][_0x0c4d('0x21')]=_0x0c4d('0x22');this[_0x0c4d('0xd')][_0x1937ad]['Imap'][_0x0c4d('0x14')]='';this[_0x0c4d('0x11')](_0x1937ad);}}}};EmailChannel['prototype'][_0x0c4d('0x1a')]=function(_0x28c590,_0xb47a5a){if(this[_0x0c4d('0xd')][_0x28c590]){this[_0x0c4d('0xd')][_0x28c590][_0x0c4d('0x13')][_0x0c4d('0x21')]=_0x0c4d('0x23');this[_0x0c4d('0xd')][_0x28c590][_0x0c4d('0x13')][_0x0c4d('0x14')]=_0xb47a5a[_0x0c4d('0x24')];if(_0xb47a5a[_0x0c4d('0x25')]){this[_0x0c4d('0xd')][_0x28c590]['Imap'][_0x0c4d('0x26')]=_0xb47a5a[_0x0c4d('0x25')][_0x0c4d('0x26')];}return this[_0x0c4d('0x11')](_0x28c590);}};EmailChannel['prototype'][_0x0c4d('0x1c')]=function(_0x4698a4,_0x6a00c2){logger[_0x0c4d('0x27')](_0x0c4d('0x28'),_0x6a00c2[_0x0c4d('0x29')],_0x6a00c2['lastName'],_0x6a00c2[_0x0c4d('0x2a')],_0x4698a4);if(this[_0x0c4d('0xd')][_0x4698a4]){return mailAccount[_0x0c4d('0x2b')](_0x4698a4,_0x6a00c2)[_0x0c4d('0x2c')](function(_0x75c574){if(_0x75c574){logger[_0x0c4d('0x27')](_0x0c4d('0x2d'));}})[_0x0c4d('0x2e')](function(_0x2e8d7d){logger[_0x0c4d('0x1f')](_0x0c4d('0x2f'),JSON[_0x0c4d('0x30')](_0x2e8d7d));});}};EmailChannel[_0x0c4d('0x10')][_0x0c4d('0x1e')]=function(_0x6aae4e){if(this[_0x0c4d('0xd')][_0x6aae4e]&&this[_0x0c4d('0xd')][_0x6aae4e]['Imap']){if(this[_0x0c4d('0xe')][this[_0x0c4d('0xd')][_0x6aae4e][_0x0c4d('0x13')]['id']]){delete this[_0x0c4d('0xe')][this['mailAccounts'][_0x6aae4e][_0x0c4d('0x13')]['id']];}this[_0x0c4d('0xd')][_0x6aae4e][_0x0c4d('0x13')]['lastSync']=moment();this['emit'](_0x6aae4e);}};EmailChannel[_0x0c4d('0x10')][_0x0c4d('0x20')]=function(_0x4c55f4,_0x5646c4){if(this[_0x0c4d('0xd')][_0x4c55f4]){this[_0x0c4d('0xd')][_0x4c55f4][_0x0c4d('0x13')]['status']=_0x0c4d('0x1f');this['mailAccounts'][_0x4c55f4][_0x0c4d('0x13')][_0x0c4d('0x14')]=_0x5646c4;return this[_0x0c4d('0x11')](_0x4c55f4);}};EmailChannel[_0x0c4d('0x10')][_0x0c4d('0x31')]=function(_0x465872,_0x3c11a0){return this['smtp']['send'](_0x465872,_0x3c11a0);};EmailChannel['prototype'][_0x0c4d('0x32')]=function(_0x442d89){var _0x348b8b=this;if(this[_0x0c4d('0xd')][_0x442d89['id']]){if(_['isNil'](this[_0x0c4d('0xd')][_0x442d89['id']][_0x0c4d('0x33')])){this[_0x0c4d('0xd')][_0x442d89['id']]['Smtp']={};}this[_0x0c4d('0xd')][_0x442d89['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0xa04d33,_0x237a6e){return _0x348b8b[_0x0c4d('0xf')][_0x0c4d('0x34')](_0x442d89)[_0x0c4d('0x2c')](function(_0x5683d4){_0x348b8b['mailAccounts'][_0x442d89['id']][_0x0c4d('0x33')][_0x0c4d('0x21')]=_0x0c4d('0x35');_0x348b8b['mailAccounts'][_0x442d89['id']][_0x0c4d('0x33')][_0x0c4d('0x14')]='';_0x348b8b[_0x0c4d('0x11')](_0x442d89['id']);_0xa04d33(_0x5683d4);})[_0x0c4d('0x2e')](function(_0x3befe4){_0x348b8b['mailAccounts'][_0x442d89['id']]['Smtp']['status']=_0x0c4d('0x1f');_0x348b8b[_0x0c4d('0xd')][_0x442d89['id']][_0x0c4d('0x33')][_0x0c4d('0x14')]=_0x3befe4;_0x348b8b[_0x0c4d('0x11')](_0x442d89['id']);_0x237a6e(_0x3befe4);});});}return this['smtp'][_0x0c4d('0x34')](_0x442d89);};module[_0x0c4d('0x36')]=EmailChannel; \ No newline at end of file +var _0x795d=['../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','imapAccounts','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','connected','name','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','ioredis','../../../config/environment'];(function(_0x1ce438,_0x26d084){var _0x168bc0=function(_0x5d4f5a){while(--_0x5d4f5a){_0x1ce438['push'](_0x1ce438['shift']());}};_0x168bc0(++_0x26d084);}(_0x795d,0xd7));var _0xd795=function(_0x3fb354,_0x523e06){_0x3fb354=_0x3fb354-0x0;var _0x17589d=_0x795d[_0x3fb354];return _0x17589d;};'use strict';var _=require(_0xd795('0x0'));var moment=require(_0xd795('0x1'));var BPromise=require(_0xd795('0x2'));var md5=require('md5');var Redis=require(_0xd795('0x3'));var config=require(_0xd795('0x4'));var logger=require(_0xd795('0x5'))(_0xd795('0x6'));config[_0xd795('0x7')]=_['defaults'](config[_0xd795('0x7')],{'host':_0xd795('0x8'),'port':0x18eb});var io=require(_0xd795('0x9'))(new Redis(config[_0xd795('0x7')]));var EmailImap=require(_0xd795('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xd795('0xb'));var md5Accounts={};function EmailChannel(_0x318e41){logger['info'](_0xd795('0xc'));this[_0xd795('0xd')]=_0x318e41[_0xd795('0xd')];this['imapAccounts']={};this[_0xd795('0xe')]=new EmailSmtp();}EmailChannel[_0xd795('0xf')][_0xd795('0x10')]=function(_0xa9ff6b){var _0x8fc872=this['mailAccounts'][_0xa9ff6b];var _0x51cc14={'id':_0x8fc872['id'],'name':_0x8fc872['name'],'key':_0x8fc872[_0xd795('0x11')],'active':_0x8fc872[_0xd795('0x12')],'Imap':{'status':_0x8fc872[_0xd795('0x13')][_0xd795('0x14')],'messageStatus':_0x8fc872[_0xd795('0x13')][_0xd795('0x15')],'total':_0x8fc872[_0xd795('0x13')][_0xd795('0x16')]}};if(_[_0xd795('0x17')](md5Accounts[_0xa9ff6b])){md5Accounts[_0xa9ff6b]={};}var _0x31dc0d=md5(JSON[_0xd795('0x18')](_0x51cc14));if(md5Accounts[_0xa9ff6b][_0xd795('0x19')]!==_0x31dc0d){md5Accounts[_0xa9ff6b]['md5']=_0x31dc0d;io[_0xd795('0x10')]('mailAccount:update',_0x51cc14);}};EmailChannel[_0xd795('0xf')]['refresh']=function(_0x270ac4){for(var _0x23d122 in _0x270ac4){if(_0x270ac4['hasOwnProperty'](_0x23d122)){if(_0x270ac4[_0x23d122][_0xd795('0x13')]&&_0x270ac4[_0x23d122][_0xd795('0x12')]){var _0x52acb7=_0x270ac4[_0x23d122][_0xd795('0x13')];if(!this[_0xd795('0x1a')][_0xd795('0x1b')](_0x52acb7['id'])){this[_0xd795('0x1a')][_0x52acb7['id']]=new EmailImap(_0x52acb7,_0x270ac4[_0x23d122][_0xd795('0x6')]);this[_0xd795('0x1a')][_0x52acb7['id']]['on'](_0xd795('0x1c'),this[_0xd795('0x1d')][_0xd795('0x1e')](this,_0x23d122));this['imapAccounts'][_0x52acb7['id']]['on'](_0xd795('0x6'),this[_0xd795('0x1f')][_0xd795('0x1e')](this,_0x23d122));this[_0xd795('0x1a')][_0x52acb7['id']]['on']('end',this[_0xd795('0x20')][_0xd795('0x1e')](this,_0x23d122));this[_0xd795('0x1a')][_0x52acb7['id']]['on'](_0xd795('0x21'),this[_0xd795('0x22')][_0xd795('0x1e')](this,_0x23d122));}}else{if(_[_0xd795('0x17')](this['mailAccounts'][_0x23d122][_0xd795('0x13')])){this[_0xd795('0xd')][_0x23d122][_0xd795('0x13')]={};}this['mailAccounts'][_0x23d122]['Imap']['status']=_0xd795('0x23');this[_0xd795('0xd')][_0x23d122][_0xd795('0x13')]['messageStatus']='';this[_0xd795('0x10')](_0x23d122);}}}};EmailChannel[_0xd795('0xf')][_0xd795('0x1d')]=function(_0x1d9f23,_0x4c42e9){if(this[_0xd795('0xd')][_0x1d9f23]){this['mailAccounts'][_0x1d9f23][_0xd795('0x13')][_0xd795('0x14')]=_0xd795('0x24');this[_0xd795('0xd')][_0x1d9f23][_0xd795('0x13')][_0xd795('0x15')]=_0x4c42e9[_0xd795('0x25')];if(_0x4c42e9[_0xd795('0x26')]){this[_0xd795('0xd')][_0x1d9f23]['Imap'][_0xd795('0x16')]=_0x4c42e9[_0xd795('0x26')]['total'];}return this[_0xd795('0x10')](_0x1d9f23);}};EmailChannel['prototype'][_0xd795('0x1f')]=function(_0x39cf05,_0x3b1702){logger[_0xd795('0x27')](_0xd795('0x28'),_0x3b1702[_0xd795('0x29')],_0x3b1702[_0xd795('0x2a')],_0x3b1702[_0xd795('0x2b')],_0x39cf05);if(this[_0xd795('0xd')][_0x39cf05]){return mailAccount[_0xd795('0x2c')](_0x39cf05,_0x3b1702)[_0xd795('0x2d')](function(_0x2038b5){if(_0x2038b5){logger[_0xd795('0x27')](_0xd795('0x2e'));}})[_0xd795('0x2f')](function(_0x81240a){logger[_0xd795('0x21')](_0xd795('0x30'),JSON['stringify'](_0x81240a));});}};EmailChannel['prototype'][_0xd795('0x20')]=function(_0x1a37b7){if(this[_0xd795('0xd')][_0x1a37b7]&&this[_0xd795('0xd')][_0x1a37b7][_0xd795('0x13')]){if(this[_0xd795('0x1a')][this[_0xd795('0xd')][_0x1a37b7][_0xd795('0x13')]['id']]){delete this[_0xd795('0x1a')][this[_0xd795('0xd')][_0x1a37b7]['Imap']['id']];}this[_0xd795('0xd')][_0x1a37b7][_0xd795('0x13')][_0xd795('0x31')]=moment();this[_0xd795('0x10')](_0x1a37b7);}};EmailChannel[_0xd795('0xf')][_0xd795('0x22')]=function(_0x5d5451,_0x2452bd){if(this['mailAccounts'][_0x5d5451]){this[_0xd795('0xd')][_0x5d5451]['Imap']['status']='error';this[_0xd795('0xd')][_0x5d5451]['Imap'][_0xd795('0x15')]=_0x2452bd;return this[_0xd795('0x10')](_0x5d5451);}};EmailChannel[_0xd795('0xf')]['sendMail']=function(_0x41930f,_0x172c04){return this[_0xd795('0xe')][_0xd795('0x32')](_0x41930f,_0x172c04);};EmailChannel[_0xd795('0xf')][_0xd795('0x33')]=function(_0x437c31){var _0x4f75a2=this;if(this[_0xd795('0xd')][_0x437c31['id']]){if(_[_0xd795('0x17')](this['mailAccounts'][_0x437c31['id']]['Smtp'])){this[_0xd795('0xd')][_0x437c31['id']][_0xd795('0x34')]={};}this[_0xd795('0xd')][_0x437c31['id']]['Smtp'][_0xd795('0x31')]=moment();return new BPromise(function(_0x317528,_0x133c52){return _0x4f75a2[_0xd795('0xe')][_0xd795('0x35')](_0x437c31)['then'](function(_0x3ec778){_0x4f75a2[_0xd795('0xd')][_0x437c31['id']][_0xd795('0x34')][_0xd795('0x14')]='verified';_0x4f75a2[_0xd795('0xd')][_0x437c31['id']][_0xd795('0x34')][_0xd795('0x15')]='';_0x4f75a2[_0xd795('0x10')](_0x437c31['id']);_0x317528(_0x3ec778);})[_0xd795('0x2f')](function(_0x31ffaf){_0x4f75a2[_0xd795('0xd')][_0x437c31['id']]['Smtp'][_0xd795('0x14')]='error';_0x4f75a2['mailAccounts'][_0x437c31['id']][_0xd795('0x34')][_0xd795('0x15')]=_0x31ffaf;_0x4f75a2[_0xd795('0x10')](_0x437c31['id']);_0x133c52(_0x31ffaf);});});}return this[_0xd795('0xe')][_0xd795('0x35')](_0x437c31);};module[_0xd795('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index bc872ca..48b69ad 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 _0x35ca=['handleError','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','required','getHost','handleOpenBox','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','body','attributes','handleMessageAttributes','handleMessageBody','handleSimpleParser','handleMessageEnd','parser','closeBox','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','simpleParser','events','./utils','../../../config/logger','email','mailbox','getAccount','account','once','ready','handleReady','bind','end','handleEnd','error'];(function(_0x572944,_0xd5c0df){var _0x2f457a=function(_0x5ba3bf){while(--_0x5ba3bf){_0x572944['push'](_0x572944['shift']());}};_0x2f457a(++_0xd5c0df);}(_0x35ca,0x10a));var _0xa35c=function(_0x4b1554,_0x1f2dd5){_0x4b1554=_0x4b1554-0x0;var _0x5565cf=_0x35ca[_0x4b1554];return _0x5565cf;};'use strict';var fs=require('fs');var path=require(_0xa35c('0x0'));var util=require(_0xa35c('0x1'));var Imap=require(_0xa35c('0x2'));var _=require(_0xa35c('0x3'));var rs=require('randomstring');var simpleParser=require('mailparser')[_0xa35c('0x4')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0xa35c('0x5'))['EventEmitter'];var utils=require(_0xa35c('0x6'));var logger=require(_0xa35c('0x7'))(_0xa35c('0x8'));function EmailImap(_0x474d4b,_0x5cdceb){this[_0xa35c('0x9')]='INBOX';this['account']=this[_0xa35c('0xa')](_0x474d4b,_0x5cdceb);this[_0xa35c('0x2')]=new Imap(this[_0xa35c('0xb')]);this[_0xa35c('0x2')][_0xa35c('0xc')](_0xa35c('0xd'),this[_0xa35c('0xe')][_0xa35c('0xf')](this));this[_0xa35c('0x2')][_0xa35c('0xc')](_0xa35c('0x10'),this[_0xa35c('0x11')][_0xa35c('0xf')](this));this['imap']['on'](_0xa35c('0x12'),this[_0xa35c('0x13')]['bind'](this));this[_0xa35c('0x2')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xa35c('0x14')][_0xa35c('0xa')]=function(_0x4bac85,_0x4dec20){var _0x3443de={'connTimeout':_0x4bac85['connTimeout']?_0x4bac85[_0xa35c('0x15')]*0x3e8:0x2710,'authTimeout':_0x4bac85[_0xa35c('0x16')]?_0x4bac85[_0xa35c('0x16')]*0x3e8:0x1388};if(_[_0xa35c('0x17')](_0x4bac85[_0xa35c('0x18')])){if(_0x4bac85[_0xa35c('0x19')]){_0x3443de[_0xa35c('0x1a')]=_0x4bac85[_0xa35c('0x1a')];_0x3443de['password']=_0x4bac85[_0xa35c('0x1b')];}_0x3443de[_0xa35c('0x1c')]=_0x4bac85[_0xa35c('0x1c')];_0x3443de['port']=_0x4bac85[_0xa35c('0x1d')]||0x3e1;if(_0x4bac85['tls']){_0x3443de[_0xa35c('0x1e')]=!![];}else{_0x3443de[_0xa35c('0x1e')]=![];_0x3443de['autotls']=_0xa35c('0x1f');}}else{_0x3443de[_0xa35c('0x1a')]=_0x4bac85[_0xa35c('0x1a')];_0x3443de[_0xa35c('0x1b')]=_0x4bac85[_0xa35c('0x1b')];_0x3443de['host']=utils[_0xa35c('0x20')](_0x4bac85['service']);_0x3443de[_0xa35c('0x1d')]=0x3e1;_0x3443de[_0xa35c('0x1e')]=!![];}_0x3443de[_0xa35c('0x8')]=_0x4dec20||_0x4bac85[_0xa35c('0x1a')]||'anonymous@xcally.com';return _0x3443de;};EmailImap[_0xa35c('0x14')][_0xa35c('0xe')]=function(){this[_0xa35c('0x2')]['openBox'](this[_0xa35c('0x9')],![],this['handleOpenBox']['bind'](this));};EmailImap['prototype'][_0xa35c('0x21')]=function(_0x3c0623,_0x59542e){if(_0x3c0623){this[_0xa35c('0x13')](_0x3c0623,!![]);}else{this[_0xa35c('0x22')](_0xa35c('0x23'),_0x59542e);this[_0xa35c('0x24')]();}};EmailImap[_0xa35c('0x14')][_0xa35c('0x25')]=function(_0x19c94e){if(_0x19c94e){this[_0xa35c('0x13')](_0x19c94e,!![]);}else{this[_0xa35c('0x2')][_0xa35c('0x10')]();}};EmailImap[_0xa35c('0x14')][_0xa35c('0x24')]=function(){this[_0xa35c('0x2')]['search']([_0xa35c('0x26')],this[_0xa35c('0x27')]['bind'](this));};EmailImap[_0xa35c('0x14')][_0xa35c('0x27')]=function(_0x220f8f,_0x500715){if(_0x220f8f){this[_0xa35c('0x13')](_0x220f8f,!![]);}else{if(_0x500715[_0xa35c('0x28')]){try{var _0x3456af=this[_0xa35c('0x2')][_0xa35c('0x29')](_0x500715,{'bodies':'','markSeen':!![]});_0x3456af['on']('message',this[_0xa35c('0x2a')][_0xa35c('0xf')](this));_0x3456af[_0xa35c('0xc')](_0xa35c('0x12'),this[_0xa35c('0x2b')]['bind'](this));_0x3456af['once'](_0xa35c('0x10'),this[_0xa35c('0x2c')]['bind'](this));}catch(_0x55c553){logger[_0xa35c('0x12')](_0x55c553);}}else{this[_0xa35c('0x2')]['closeBox'](!![],this[_0xa35c('0x25')][_0xa35c('0xf')](this));}}};EmailImap[_0xa35c('0x14')][_0xa35c('0x2a')]=function(_0x5d9e49,_0x404109){_0x5d9e49['on'](_0xa35c('0x2d'),this['handleMessageBody']['bind'](this));_0x5d9e49['once'](_0xa35c('0x2e'),this[_0xa35c('0x2f')][_0xa35c('0xf')](this));_0x5d9e49[_0xa35c('0xc')](_0xa35c('0x10'),this['handleMessageEnd'][_0xa35c('0xf')](this));};EmailImap['prototype'][_0xa35c('0x30')]=function(_0x10a235,_0x5974e3){simpleParser(_0x10a235,{'Iconv':Iconv},this[_0xa35c('0x31')][_0xa35c('0xf')](this));};EmailImap[_0xa35c('0x14')]['handleMessageAttributes']=function(_0x3561c0){};EmailImap[_0xa35c('0x14')][_0xa35c('0x32')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0xd1bb2c,_0x478bf0){if(_0xd1bb2c){logger['error'](_0xd1bb2c);}else{var _0x69a156=this;utils[_0xa35c('0x33')](this['account'],_0x478bf0,function(_0x1e54c1){_0x69a156[_0xa35c('0x22')](_0xa35c('0x8'),_0x1e54c1);});}};EmailImap[_0xa35c('0x14')]['handleFetchEnd']=function(){this[_0xa35c('0x2')][_0xa35c('0x34')](!![],this['handleCloseBox'][_0xa35c('0xf')](this));};EmailImap[_0xa35c('0x14')]['handleFetchError']=function(_0x801d2d){this[_0xa35c('0x13')](_0x801d2d);this[_0xa35c('0x2')][_0xa35c('0x34')](!![],this[_0xa35c('0x25')]['bind'](this));};EmailImap[_0xa35c('0x14')]['handleEnd']=function(){this['emit'](_0xa35c('0x10'));};EmailImap[_0xa35c('0x14')][_0xa35c('0x13')]=function(_0x2e7f4e,_0x241a5c){logger['error'](_0xa35c('0x13'),this[_0xa35c('0xb')][_0xa35c('0x8')],JSON['stringify'](_0x2e7f4e));var _0x4e669c='';if(_0x2e7f4e){if(_0x2e7f4e['textCode']){_0x4e669c=_0x2e7f4e[_0xa35c('0x35')];}else{for(var _0x122769 in _0x2e7f4e){if(_0x2e7f4e[_0xa35c('0x36')](_0x122769)){_0x4e669c+=_[_0xa35c('0x37')](_0x122769)+':\x20'+_0x2e7f4e[_0x122769]+'\x0a';}}}}if(_0x241a5c){this[_0xa35c('0x2')][_0xa35c('0x10')]();}else{this[_0xa35c('0x22')](_0xa35c('0x12'),_0x4e669c);this[_0xa35c('0x22')](_0xa35c('0x10'));}};module[_0xa35c('0x38')]=EmailImap; \ No newline at end of file +var _0x09c1=['mailparser','simpleParser','iconv','events','EventEmitter','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','port','tls','autotls','required','host','anonymous@xcally.com','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','util','imap','randomstring'];(function(_0x17c38b,_0x201c48){var _0x52e7a4=function(_0x2fa956){while(--_0x2fa956){_0x17c38b['push'](_0x17c38b['shift']());}};_0x52e7a4(++_0x201c48);}(_0x09c1,0xb1));var _0x109c=function(_0xe1f858,_0xb86c44){_0xe1f858=_0xe1f858-0x0;var _0x367af6=_0x09c1[_0xe1f858];return _0x367af6;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x109c('0x0'));var Imap=require(_0x109c('0x1'));var _=require('lodash');var rs=require(_0x109c('0x2'));var simpleParser=require(_0x109c('0x3'))[_0x109c('0x4')];var Iconv=require(_0x109c('0x5'))['Iconv'];var EventEmitter=require(_0x109c('0x6'))[_0x109c('0x7')];var utils=require('./utils');var logger=require(_0x109c('0x8'))(_0x109c('0x9'));function EmailImap(_0x21e68b,_0x5ab185){this[_0x109c('0xa')]='INBOX';this[_0x109c('0xb')]=this[_0x109c('0xc')](_0x21e68b,_0x5ab185);this['imap']=new Imap(this[_0x109c('0xb')]);this[_0x109c('0x1')][_0x109c('0xd')](_0x109c('0xe'),this[_0x109c('0xf')][_0x109c('0x10')](this));this[_0x109c('0x1')][_0x109c('0xd')](_0x109c('0x11'),this['handleEnd'][_0x109c('0x10')](this));this[_0x109c('0x1')]['on'](_0x109c('0x12'),this[_0x109c('0x13')][_0x109c('0x10')](this));this[_0x109c('0x1')][_0x109c('0x14')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x109c('0x15')][_0x109c('0xc')]=function(_0x135db6,_0x83a436){var _0x642c8f={'connTimeout':_0x135db6[_0x109c('0x16')]?_0x135db6[_0x109c('0x16')]*0x3e8:0x2710,'authTimeout':_0x135db6[_0x109c('0x17')]?_0x135db6[_0x109c('0x17')]*0x3e8:0x1388};if(_[_0x109c('0x18')](_0x135db6[_0x109c('0x19')])){if(_0x135db6[_0x109c('0x1a')]){_0x642c8f[_0x109c('0x1b')]=_0x135db6[_0x109c('0x1b')];_0x642c8f['password']=_0x135db6[_0x109c('0x1c')];}_0x642c8f['host']=_0x135db6['host'];_0x642c8f[_0x109c('0x1d')]=_0x135db6[_0x109c('0x1d')]||0x3e1;if(_0x135db6[_0x109c('0x1e')]){_0x642c8f['tls']=!![];}else{_0x642c8f['tls']=![];_0x642c8f[_0x109c('0x1f')]=_0x109c('0x20');}}else{_0x642c8f[_0x109c('0x1b')]=_0x135db6[_0x109c('0x1b')];_0x642c8f[_0x109c('0x1c')]=_0x135db6[_0x109c('0x1c')];_0x642c8f[_0x109c('0x21')]=utils['getHost'](_0x135db6[_0x109c('0x19')]);_0x642c8f['port']=0x3e1;_0x642c8f['tls']=!![];}_0x642c8f[_0x109c('0x9')]=_0x83a436||_0x135db6[_0x109c('0x1b')]||_0x109c('0x22');return _0x642c8f;};EmailImap[_0x109c('0x15')][_0x109c('0xf')]=function(){this[_0x109c('0x1')]['openBox'](this[_0x109c('0xa')],![],this[_0x109c('0x23')][_0x109c('0x10')](this));};EmailImap[_0x109c('0x15')]['handleOpenBox']=function(_0x4c7fec,_0x50687d){if(_0x4c7fec){this[_0x109c('0x13')](_0x4c7fec,!![]);}else{this[_0x109c('0x24')](_0x109c('0x25'),_0x50687d);this['readUnseen']();}};EmailImap[_0x109c('0x15')][_0x109c('0x26')]=function(_0x15f9e4){if(_0x15f9e4){this[_0x109c('0x13')](_0x15f9e4,!![]);}else{this[_0x109c('0x1')][_0x109c('0x11')]();}};EmailImap[_0x109c('0x15')][_0x109c('0x27')]=function(){this['imap'][_0x109c('0x28')]([_0x109c('0x29')],this[_0x109c('0x2a')][_0x109c('0x10')](this));};EmailImap['prototype'][_0x109c('0x2a')]=function(_0x24c7af,_0x1f756a){if(_0x24c7af){this[_0x109c('0x13')](_0x24c7af,!![]);}else{if(_0x1f756a[_0x109c('0x2b')]){try{var _0x2b422c=this[_0x109c('0x1')][_0x109c('0x2c')](_0x1f756a,{'bodies':'','markSeen':!![]});_0x2b422c['on']('message',this[_0x109c('0x2d')]['bind'](this));_0x2b422c[_0x109c('0xd')](_0x109c('0x12'),this['handleFetchError'][_0x109c('0x10')](this));_0x2b422c['once'](_0x109c('0x11'),this[_0x109c('0x2e')][_0x109c('0x10')](this));}catch(_0x4ebeb0){logger[_0x109c('0x12')](_0x4ebeb0);}}else{this['imap'][_0x109c('0x2f')](!![],this[_0x109c('0x26')][_0x109c('0x10')](this));}}};EmailImap['prototype'][_0x109c('0x2d')]=function(_0x3e0d4b,_0x58adfa){_0x3e0d4b['on'](_0x109c('0x30'),this[_0x109c('0x31')][_0x109c('0x10')](this));_0x3e0d4b[_0x109c('0xd')]('attributes',this[_0x109c('0x32')][_0x109c('0x10')](this));_0x3e0d4b[_0x109c('0xd')](_0x109c('0x11'),this[_0x109c('0x33')][_0x109c('0x10')](this));};EmailImap[_0x109c('0x15')][_0x109c('0x31')]=function(_0x4c156b,_0x3db97d){simpleParser(_0x4c156b,{'Iconv':Iconv},this[_0x109c('0x34')][_0x109c('0x10')](this));};EmailImap[_0x109c('0x15')]['handleMessageAttributes']=function(_0x26a343){};EmailImap[_0x109c('0x15')][_0x109c('0x33')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x5e1a76,_0x121c84){if(_0x5e1a76){logger[_0x109c('0x12')](_0x5e1a76);}else{var _0x41087b=this;utils[_0x109c('0x35')](this['account'],_0x121c84,function(_0x21b4f0){_0x41087b[_0x109c('0x24')](_0x109c('0x9'),_0x21b4f0);});}};EmailImap[_0x109c('0x15')][_0x109c('0x2e')]=function(){this[_0x109c('0x1')][_0x109c('0x2f')](!![],this[_0x109c('0x26')]['bind'](this));};EmailImap[_0x109c('0x15')][_0x109c('0x36')]=function(_0x5159e6){this[_0x109c('0x13')](_0x5159e6);this['imap']['closeBox'](!![],this[_0x109c('0x26')][_0x109c('0x10')](this));};EmailImap[_0x109c('0x15')]['handleEnd']=function(){this[_0x109c('0x24')]('end');};EmailImap[_0x109c('0x15')][_0x109c('0x13')]=function(_0x148938,_0x27953d){logger[_0x109c('0x12')](_0x109c('0x13'),this[_0x109c('0xb')][_0x109c('0x9')],JSON[_0x109c('0x37')](_0x148938));var _0x27358c='';if(_0x148938){if(_0x148938[_0x109c('0x38')]){_0x27358c=_0x148938['textCode'];}else{for(var _0x2f4d73 in _0x148938){if(_0x148938[_0x109c('0x39')](_0x2f4d73)){_0x27358c+=_[_0x109c('0x3a')](_0x2f4d73)+':\x20'+_0x148938[_0x2f4d73]+'\x0a';}}}}if(_0x27953d){this[_0x109c('0x1')][_0x109c('0x11')]();}else{this['emit'](_0x109c('0x12'),_0x27358c);this[_0x109c('0x24')](_0x109c('0x11'));}};module[_0x109c('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 8cd981e..0517f91 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 _0x7cc0=['nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','toString','verify','Not\x20verifired'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7cc0,0x96));var _0x07cc=function(_0x1d8d36,_0x117947){_0x1d8d36=_0x1d8d36-0x0;var _0x4c29d0=_0x7cc0[_0x1d8d36];return _0x4c29d0;};'use strict';var nodemailer=require(_0x07cc('0x0'));var BPromise=require(_0x07cc('0x1'));var inlineBase64=require(_0x07cc('0x2'));function EmailSmtp(){}EmailSmtp[_0x07cc('0x3')][_0x07cc('0x4')]=function(_0x2a9430,_0x914198){return new BPromise(function(_0x29f91a,_0x5dd407){var _0x5d9627=nodemailer[_0x07cc('0x5')](_0x2a9430);_0x5d9627[_0x07cc('0x6')]('compile',inlineBase64());_0x5d9627['sendMail'](_0x914198,function(_0x328f3b,_0x1a3c66){if(_0x328f3b){_0x5dd407(_0x328f3b[_0x07cc('0x7')]());}else{_0x29f91a(_0x1a3c66);}});});};EmailSmtp[_0x07cc('0x3')][_0x07cc('0x8')]=function(_0x1dd2cb){return new BPromise(function(_0x55f728,_0x44d7ca){var _0x46f026=nodemailer[_0x07cc('0x5')](_0x1dd2cb);_0x46f026[_0x07cc('0x8')](function(_0x4f131c,_0x413cff){if(_0x4f131c){_0x44d7ca(_0x4f131c[_0x07cc('0x7')]());}else{if(_0x413cff){_0x55f728(_0x413cff);}else{_0x44d7ca(_0x07cc('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x4727=['verify','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','toString'];(function(_0x1aef56,_0xf70a6d){var _0x3f5557=function(_0x5faf3d){while(--_0x5faf3d){_0x1aef56['push'](_0x1aef56['shift']());}};_0x3f5557(++_0xf70a6d);}(_0x4727,0x12e));var _0x7472=function(_0x5277fc,_0x269731){_0x5277fc=_0x5277fc-0x0;var _0x20c9cc=_0x4727[_0x5277fc];return _0x20c9cc;};'use strict';var nodemailer=require(_0x7472('0x0'));var BPromise=require(_0x7472('0x1'));var inlineBase64=require(_0x7472('0x2'));function EmailSmtp(){}EmailSmtp[_0x7472('0x3')][_0x7472('0x4')]=function(_0x54465c,_0xa6a549){return new BPromise(function(_0x95069e,_0xab62b5){var _0x4f174f=nodemailer[_0x7472('0x5')](_0x54465c);_0x4f174f['use'](_0x7472('0x6'),inlineBase64());_0x4f174f['sendMail'](_0xa6a549,function(_0x40c7ff,_0x35989e){if(_0x40c7ff){_0xab62b5(_0x40c7ff[_0x7472('0x7')]());}else{_0x95069e(_0x35989e);}});});};EmailSmtp[_0x7472('0x3')][_0x7472('0x8')]=function(_0x4f6ff3){return new BPromise(function(_0x5c503a,_0xe4cc22){var _0x17ec56=nodemailer[_0x7472('0x5')](_0x4f6ff3);_0x17ec56[_0x7472('0x8')](function(_0x438119,_0x4fc597){if(_0x438119){_0xe4cc22(_0x438119[_0x7472('0x7')]());}else{if(_0x4fc597){_0x5c503a(_0x4fc597);}else{_0xe4cc22('Not\x20verifired');}}});});};module[_0x7472('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index b1aa746..95744d5 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 _0x07e8=['_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Data','gmail','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','util','../../../config/logger','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','length','join','Anonymous','pop','isEmpty','html','test','includes','0x1?_0x2ca6f0['slice'](0x0,-0x1)[_0x807e('0x10')]('\x20'):_0x31f652[_0x807e('0xb')];}return _0x807e('0x11');}function getLastName(_0x19e72f){var _0x2ce562=_[_0x807e('0x5')](_0x19e72f[_0x807e('0xa')]);if(_0x2ce562&&_0x2ce562['name']){var _0x51355b=_0x2ce562[_0x807e('0xb')][_0x807e('0xe')](/\s+/);return _0x51355b[_0x807e('0xf')]>0x1?_0x51355b[_0x807e('0x12')]():'';}return'';}function getMails(_0x5800b9,_0x13b760){var _0x367913='';for(var _0x1ffc81=0x0;_0x1ffc81<_0x13b760[_0x807e('0xa')][_0x807e('0xf')];_0x1ffc81+=0x1){if(_0x13b760[_0x807e('0xa')][_0x1ffc81]['address']!==_0x5800b9){if(!_[_0x807e('0x13')](_0x367913)){_0x367913+=',';}_0x367913+=_0x13b760['value'][_0x1ffc81][_0x807e('0xb')]||_0x13b760[_0x807e('0xa')][_0x1ffc81][_0x807e('0x6')]||'';_0x367913+='\x20<';_0x367913+=_0x13b760[_0x807e('0xa')][_0x1ffc81][_0x807e('0x6')]?_0x13b760[_0x807e('0xa')][_0x1ffc81][_0x807e('0x6')]:_0x807e('0x7')+random[_0x807e('0x8')](0x6)+'@xcally.com';_0x367913+='>';}}return _0x367913;}function parseEmail(_0x5ca377,_0x415eaa,_0x23db10){if(_0x415eaa[_0x807e('0x14')]){var _0x42358e=/)<[^<]*)*<\/script>/gi;while(_0x42358e[_0x807e('0x15')](_0x415eaa[_0x807e('0x14')])){_0x415eaa[_0x807e('0x14')]=_0x415eaa[_0x807e('0x14')]['replace'](_0x42358e,'');}if(_0x415eaa[_0x807e('0x14')][_0x807e('0x16')](_0x807e('0x17'))){var _0x3ee5ff=[];_0x415eaa[_0x807e('0x18')][_0x807e('0x19')](_0x55f7c9=>{_0x3ee5ff[_0x807e('0x1a')](_0x55f7c9['filename']);});var _0x33ba88=/]+>/g;var _0x176274=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x141dbb=_0x415eaa['html'][_0x807e('0x1b')](_0x176274,_0x807e('0x1c'));var _0x16530c=_0x141dbb[_0x807e('0x1b')](_0x33ba88,_0x807e('0x1d'));for(let _0x3adcc4=0x0;_0x3adcc4<_0x3ee5ff['length'];_0x3adcc4++){var _0x289264=_0x16530c['replace'](_0x807e('0x1d'),_0x807e('0x1e')+_0x3ee5ff[_0x3adcc4]+_0x807e('0x1f'));_0x16530c=_0x289264;}_0x415eaa['html']=_0x16530c;}_0x23db10[_0x807e('0x20')]=_0x415eaa[_0x807e('0x14')];}else{_0x23db10['body']=_0x415eaa[_0x807e('0x21')];}if(_0x23db10[_0x807e('0x20')]){_0x23db10['body']=_0x23db10[_0x807e('0x20')][_0x807e('0x1b')](/0x0){var _0x4da2b5=[_0x807e('0x33'),_0x807e('0x34'),'Precedence:\x20auto_reply'];for(var _0x522146=0x0;_0x522146<_0x415eaa[_0x807e('0x35')][_0x807e('0xf')];_0x522146++){var _0x427998=_[_0x807e('0xd')](_0x4da2b5,_0x415eaa[_0x807e('0x35')][_0x522146][_0x807e('0x36')]);if(_0x427998>=0x0){_0x23db10[_0x807e('0x37')]=!![];}}}return _0x23db10;}exports[_0x807e('0x38')]=function(_0x383534,_0xaa20b5,_0x16d3b4){var _0x287cd0={'from':getAddress(_0xaa20b5[_0x807e('0x39')]),'firstName':getFirstName(_0xaa20b5['from']),'lastName':getLastName(_0xaa20b5[_0x807e('0x39')]),'mapKey':'email','message':{'from':getMails(_0x383534[_0x807e('0x26')],_0xaa20b5[_0x807e('0x39')]),'to':_0x383534['email'],'cc':'','subject':_0xaa20b5[_0x807e('0x3a')]||'','messageId':_0xaa20b5[_0x807e('0x3b')],'inReplyTo':_0xaa20b5['inReplyTo'],'sentAt':moment(_0xaa20b5['date'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0xaa20b5[_0x807e('0x14')]&&!_0xaa20b5[_0x807e('0x21')]){var _0x329cf1=_[_0x807e('0x3c')](_0xaa20b5[_0x807e('0x18')],{'contentType':_0x807e('0x3d')});if(_0x329cf1[_0x807e('0xf')]){logger['info'](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0xaa20b5[_0x807e('0x3b')]));tnef[_0x807e('0x3e')](_[_0x807e('0x3f')](_0x329cf1)[_0x807e('0x31')],function(_0x30c9c8,_0x17da49){if(_0x17da49){_0xaa20b5['html']=_0x17da49[_0x807e('0x40')]||_0x807e('0x41');if(_0x17da49[_0x807e('0x42')]){for(var _0x2d87be=0x0;_0x2d87be<_0x17da49[_0x807e('0x42')][_0x807e('0xf')];_0x2d87be++){var _0x40fbe3=_0x17da49[_0x807e('0x42')][_0x2d87be];_0x287cd0[_0x807e('0x23')][_0x807e('0x18')][_0x807e('0x1a')]({'filename':_0x40fbe3['Title'],'content':Buffer['from'](_0x40fbe3[_0x807e('0x43')])});}}}_0x16d3b4(parseEmail(_0x383534,_0xaa20b5,_0x287cd0));});}else{_0xaa20b5['html']='

Empty\x20message

';_0x16d3b4(parseEmail(_0x383534,_0xaa20b5,_0x287cd0));}}else{_0x16d3b4(parseEmail(_0x383534,_0xaa20b5,_0x287cd0));}};exports['getHost']=function(_0x49844a){switch(_0x49844a){case _0x807e('0x44'):return'imap.gmail.com';case _0x807e('0x45'):return _0x807e('0x46');case'hotmail':return _0x807e('0x47');case _0x807e('0x48'):return _0x807e('0x49');}return _0x807e('0x4a');}; \ No newline at end of file +var _0xd916=['YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','

Empty\x20message

','Attachments','push','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','../../../config/logger','email','head','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','value','pop','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x540ddd[_0x6d91('0x11')](0x0,-0x1)[_0x6d91('0x12')]('\x20'):_0x1c874c[_0x6d91('0xc')];}return _0x6d91('0x13');}function getLastName(_0x230468){var _0x12cc2b=_[_0x6d91('0x7')](_0x230468[_0x6d91('0x14')]);if(_0x12cc2b&&_0x12cc2b[_0x6d91('0xc')]){var _0x293e25=_0x12cc2b[_0x6d91('0xc')][_0x6d91('0xf')](/\s+/);return _0x293e25['length']>0x1?_0x293e25[_0x6d91('0x15')]():'';}return'';}function getMails(_0x33fbbe,_0x25debb){var _0x2143ac='';for(var _0x3602f3=0x0;_0x3602f3<_0x25debb[_0x6d91('0x14')]['length'];_0x3602f3+=0x1){if(_0x25debb[_0x6d91('0x14')][_0x3602f3]['address']!==_0x33fbbe){if(!_['isEmpty'](_0x2143ac)){_0x2143ac+=',';}_0x2143ac+=_0x25debb[_0x6d91('0x14')][_0x3602f3]['name']||_0x25debb[_0x6d91('0x14')][_0x3602f3]['address']||'';_0x2143ac+='\x20<';_0x2143ac+=_0x25debb['value'][_0x3602f3][_0x6d91('0x8')]?_0x25debb[_0x6d91('0x14')][_0x3602f3][_0x6d91('0x8')]:'anonymous'+random[_0x6d91('0xa')](0x6)+_0x6d91('0xb');_0x2143ac+='>';}}return _0x2143ac;}function parseEmail(_0x42e064,_0x95c65d,_0x1ad01b){if(_0x95c65d[_0x6d91('0x16')]){var _0x229612=/)<[^<]*)*<\/script>/gi;while(_0x229612[_0x6d91('0x17')](_0x95c65d[_0x6d91('0x16')])){_0x95c65d[_0x6d91('0x16')]=_0x95c65d[_0x6d91('0x16')][_0x6d91('0x18')](_0x229612,'');}if(_0x95c65d['html'][_0x6d91('0x19')](_0x6d91('0x1a'))){var _0x34ed05=[];_0x95c65d['attachments'][_0x6d91('0x1b')](_0x150907=>{_0x34ed05['push'](_0x150907[_0x6d91('0x1c')]);});var _0x72505e=/]+>/g;var _0x3ed163=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1269f4=_0x95c65d['html'][_0x6d91('0x18')](_0x3ed163,_0x6d91('0x1d'));var _0x1689f9=_0x1269f4['replace'](_0x72505e,_0x6d91('0x1e'));for(let _0x15e8ad=0x0;_0x15e8ad<_0x34ed05[_0x6d91('0x10')];_0x15e8ad++){var _0xb0c85f=_0x1689f9['replace'](_0x6d91('0x1e'),_0x6d91('0x1f')+_0x34ed05[_0x15e8ad]+_0x6d91('0x20'));_0x1689f9=_0xb0c85f;}_0x95c65d['html']=_0x1689f9;}_0x1ad01b[_0x6d91('0x21')]=_0x95c65d[_0x6d91('0x16')];}else{_0x1ad01b['body']=_0x95c65d[_0x6d91('0x22')];}if(_0x1ad01b['body']){_0x1ad01b['body']=_0x1ad01b['body'][_0x6d91('0x18')](/0x0){var _0x1e5543=[_0x6d91('0x32'),_0x6d91('0x33'),_0x6d91('0x34')];for(var _0x2698ad=0x0;_0x2698ad<_0x95c65d[_0x6d91('0x31')]['length'];_0x2698ad++){var _0x29bb35=_[_0x6d91('0xe')](_0x1e5543,_0x95c65d[_0x6d91('0x31')][_0x2698ad][_0x6d91('0x35')]);if(_0x29bb35>=0x0){_0x1ad01b['isAutoreply']=!![];}}}return _0x1ad01b;}exports['parser']=function(_0x4b0e2b,_0x4b9077,_0x58e271){var _0x2addcf={'from':getAddress(_0x4b9077['from']),'firstName':getFirstName(_0x4b9077['from']),'lastName':getLastName(_0x4b9077[_0x6d91('0x36')]),'mapKey':_0x6d91('0x6'),'message':{'from':getMails(_0x4b0e2b[_0x6d91('0x6')],_0x4b9077[_0x6d91('0x36')]),'to':_0x4b0e2b[_0x6d91('0x6')],'cc':'','subject':_0x4b9077['subject']||'','messageId':_0x4b9077['messageId'],'inReplyTo':_0x4b9077['inReplyTo'],'sentAt':moment(_0x4b9077[_0x6d91('0x37')])[_0x6d91('0x2c')](_0x6d91('0x38')),'attach':![],'attachments':[]}};if(!_0x4b9077['html']&&!_0x4b9077[_0x6d91('0x22')]){var _0x1d7430=_['filter'](_0x4b9077['attachments'],{'contentType':_0x6d91('0x39')});if(_0x1d7430[_0x6d91('0x10')]){logger[_0x6d91('0x3a')](util[_0x6d91('0x2c')](_0x6d91('0x3b'),_0x4b9077[_0x6d91('0x3c')]));tnef[_0x6d91('0x3d')](_['first'](_0x1d7430)['content'],function(_0x4054e2,_0x56359e){if(_0x56359e){_0x4b9077[_0x6d91('0x16')]=_0x56359e['BodyHTML']||_0x6d91('0x3e');if(_0x56359e[_0x6d91('0x3f')]){for(var _0x1dc298=0x0;_0x1dc298<_0x56359e[_0x6d91('0x3f')]['length'];_0x1dc298++){var _0x20a8fa=_0x56359e[_0x6d91('0x3f')][_0x1dc298];_0x2addcf[_0x6d91('0x24')][_0x6d91('0x28')][_0x6d91('0x40')]({'filename':_0x20a8fa[_0x6d91('0x41')],'content':Buffer[_0x6d91('0x36')](_0x20a8fa[_0x6d91('0x42')])});}}}_0x58e271(parseEmail(_0x4b0e2b,_0x4b9077,_0x2addcf));});}else{_0x4b9077['html']=_0x6d91('0x3e');_0x58e271(parseEmail(_0x4b0e2b,_0x4b9077,_0x2addcf));}}else{_0x58e271(parseEmail(_0x4b0e2b,_0x4b9077,_0x2addcf));}};exports[_0x6d91('0x43')]=function(_0x2219cc){switch(_0x2219cc){case'gmail':return _0x6d91('0x44');case _0x6d91('0x45'):return _0x6d91('0x46');case _0x6d91('0x47'):return'imap-mail.outlook.com';case _0x6d91('0x48'):return _0x6d91('0x49');}return _0x6d91('0x4a');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index d196cf8..5266b61 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 _0xfa54=['Service','key','SERV','active','Imap','Smtp','name'];(function(_0x359a8a,_0x3c9b85){var _0x10d370=function(_0x4bbabc){while(--_0x4bbabc){_0x359a8a['push'](_0x359a8a['shift']());}};_0x10d370(++_0x3c9b85);}(_0xfa54,0x14f));var _0x4fa5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfa54[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');function MailAccount(_0x51dec8){this['id']=_0x51dec8['id']||0x0;this[_0x4fa5('0x0')]=_0x51dec8[_0x4fa5('0x0')]||_0x4fa5('0x1');this[_0x4fa5('0x2')]=_0x51dec8[_0x4fa5('0x2')]||_0x4fa5('0x3');this[_0x4fa5('0x4')]=_0x51dec8[_0x4fa5('0x4')]||![];this[_0x4fa5('0x5')]=_0x51dec8[_0x4fa5('0x5')]||[];this[_0x4fa5('0x6')]=_0x51dec8[_0x4fa5('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xe31b=['Smtp','lodash','name','key','SERV','active','Imap'];(function(_0x58d7a0,_0x5f547b){var _0xdaa1e4=function(_0x3e4855){while(--_0x3e4855){_0x58d7a0['push'](_0x58d7a0['shift']());}};_0xdaa1e4(++_0x5f547b);}(_0xe31b,0x1eb));var _0xbe31=function(_0x162b73,_0x128905){_0x162b73=_0x162b73-0x0;var _0x22e1b6=_0xe31b[_0x162b73];return _0x22e1b6;};'use strict';var _=require(_0xbe31('0x0'));function MailAccount(_0x1d3419){this['id']=_0x1d3419['id']||0x0;this[_0xbe31('0x1')]=_0x1d3419[_0xbe31('0x1')]||'Service';this[_0xbe31('0x2')]=_0x1d3419[_0xbe31('0x2')]||_0xbe31('0x3');this[_0xbe31('0x4')]=_0x1d3419['active']||![];this[_0xbe31('0x5')]=_0x1d3419[_0xbe31('0x5')]||[];this[_0xbe31('0x6')]=_0x1d3419['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 8367336..8a5ed7f 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 _0x670d=['initMailAccounts','length','isUndefined','merge','exports','lodash','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x4c4451,_0x1304c4){var _0x3603a9=function(_0x1afa23){while(--_0x1afa23){_0x4c4451['push'](_0x4c4451['shift']());}};_0x3603a9(++_0x1304c4);}(_0x670d,0x11d));var _0xd670=function(_0x55a1f7,_0x7f31e8){_0x55a1f7=_0x55a1f7-0x0;var _0x347561=_0x670d[_0x55a1f7];return _0x347561;};'use strict';var _=require(_0xd670('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xd670('0x1')]={};};function freeIsNotKey(_0x5df602,_0x552192,_0x1bf71e){var _0x182c9d=_['mapKeys'](_0x5df602,function(_0x2c598d,_0x357b92){return _0x2c598d[_0x1bf71e];});for(var _0x3430b8 in _0x552192){if(_0x552192[_0xd670('0x2')](_0x3430b8)){if(!_0x182c9d[_0x3430b8]){delete _0x552192[_0x3430b8];}}}}Realtime[_0xd670('0x3')][_0xd670('0x4')]=function(_0x3cdcda,_0x400688){for(var _0x5497fe in _0x400688){if(_0x3cdcda['hasOwnProperty'](_0x5497fe)){_0x3cdcda[_0x5497fe]=_0x400688[_0x5497fe];}}};Realtime['prototype'][_0xd670('0x5')]=function(){var _0x3db616=this;return function(_0x46e3d2){if(_0x46e3d2){freeIsNotKey(_0x46e3d2,_0x3db616[_0xd670('0x1')],'id');for(var _0x5ecef6=0x0,_0x91eec3={},_0x56f4ed={};_0x5ecef6<_0x46e3d2[_0xd670('0x6')];_0x5ecef6+=0x1){_0x91eec3=_0x46e3d2[_0x5ecef6];if(_[_0xd670('0x7')](_0x3db616['mailAccounts'][_0x91eec3['id']])){_0x3db616['mailAccounts'][_0x91eec3['id']]=new MailAccount(_0x91eec3);}else{_[_0xd670('0x8')](_0x3db616['mailAccounts'][_0x91eec3['id']],_0x91eec3);}}}return _0x3db616[_0xd670('0x1')];};};module[_0xd670('0x9')]=Realtime; \ No newline at end of file +var _0xb84c=['mergeFromDatabase','merge','exports','../model/mailAccount','mailAccounts','hasOwnProperty'];(function(_0x5d4181,_0x45b6d3){var _0x103f69=function(_0x17978b){while(--_0x17978b){_0x5d4181['push'](_0x5d4181['shift']());}};_0x103f69(++_0x45b6d3);}(_0xb84c,0x1cb));var _0xcb84=function(_0x21c0d3,_0x24e10c){_0x21c0d3=_0x21c0d3-0x0;var _0x5d5181=_0xb84c[_0x21c0d3];return _0x5d5181;};'use strict';var _=require('lodash');var MailAccount=require(_0xcb84('0x0'));var Realtime=function(){this[_0xcb84('0x1')]={};};function freeIsNotKey(_0x19fd99,_0x14f353,_0x4a9fdf){var _0x4d3b7f=_['mapKeys'](_0x19fd99,function(_0x24e892,_0x454b01){return _0x24e892[_0x4a9fdf];});for(var _0x572506 in _0x14f353){if(_0x14f353[_0xcb84('0x2')](_0x572506)){if(!_0x4d3b7f[_0x572506]){delete _0x14f353[_0x572506];}}}}Realtime['prototype'][_0xcb84('0x3')]=function(_0x1c671f,_0x51b432){for(var _0x556868 in _0x51b432){if(_0x1c671f[_0xcb84('0x2')](_0x556868)){_0x1c671f[_0x556868]=_0x51b432[_0x556868];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x2bc2e8=this;return function(_0x2f9d48){if(_0x2f9d48){freeIsNotKey(_0x2f9d48,_0x2bc2e8[_0xcb84('0x1')],'id');for(var _0x3d9e44=0x0,_0x7e8f4b={},_0x5e64d3={};_0x3d9e44<_0x2f9d48['length'];_0x3d9e44+=0x1){_0x7e8f4b=_0x2f9d48[_0x3d9e44];if(_['isUndefined'](_0x2bc2e8[_0xcb84('0x1')][_0x7e8f4b['id']])){_0x2bc2e8[_0xcb84('0x1')][_0x7e8f4b['id']]=new MailAccount(_0x7e8f4b);}else{_[_0xcb84('0x4')](_0x2bc2e8[_0xcb84('0x1')][_0x7e8f4b['id']],_0x7e8f4b);}}}return _0x2bc2e8[_0xcb84('0x1')];};};module[_0xcb84('0x5')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 1f81aa1..0611c62 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 _0x9147=['email','key','ListId','TemplateId','MailServerIn','Imap','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service'];(function(_0x4ce79a,_0x161e09){var _0x228421=function(_0x281ae2){while(--_0x281ae2){_0x4ce79a['push'](_0x4ce79a['shift']());}};_0x228421(++_0x161e09);}(_0x9147,0x81));var _0x7914=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x9147[_0x580576];return _0x3f55a0;};'use strict';var client=require(_0x7914('0x0'));exports[_0x7914('0x1')]=function(){return function(){return client[_0x7914('0x2')](_0x7914('0x3'),{'options':{'attributes':['id',_0x7914('0x4'),_0x7914('0x5'),_0x7914('0x6'),'active',_0x7914('0x7'),_0x7914('0x8'),_0x7914('0x9')],'raw':![],'include':[{'model':_0x7914('0xa'),'as':_0x7914('0xb')},{'model':'MailServerOut','as':_0x7914('0xc')}]},'log':'getMailAccount'});};};exports[_0x7914('0xd')]=function(_0x5efc62,_0x59c064){return client[_0x7914('0x2')](_0x7914('0xe'),{'account':{'id':_0x5efc62},'body':_0x59c064,'log':_0x7914('0xe')});}; \ No newline at end of file +var _0x3c85=['Request','GetMailAccount','email','active','key','TemplateId','MailServerIn','Imap','NotifyMailAccount','../client','getMailAccounts'];(function(_0x303918,_0x76ce5f){var _0x23f96e=function(_0x34adb8){while(--_0x34adb8){_0x303918['push'](_0x303918['shift']());}};_0x23f96e(++_0x76ce5f);}(_0x3c85,0x1a0));var _0x53c8=function(_0x203073,_0x405fb2){_0x203073=_0x203073-0x0;var _0x1f38d8=_0x3c85[_0x203073];return _0x1f38d8;};'use strict';var client=require(_0x53c8('0x0'));exports[_0x53c8('0x1')]=function(){return function(){return client[_0x53c8('0x2')](_0x53c8('0x3'),{'options':{'attributes':['id','name','service',_0x53c8('0x4'),_0x53c8('0x5'),_0x53c8('0x6'),'ListId',_0x53c8('0x7')],'raw':![],'include':[{'model':_0x53c8('0x8'),'as':_0x53c8('0x9')},{'model':'MailServerOut','as':'Smtp'}]},'log':'getMailAccount'});};};exports['notify']=function(_0x7d5c2a,_0x4de781){return client['Request'](_0x53c8('0xa'),{'account':{'id':_0x7d5c2a},'body':_0x4de781,'log':_0x53c8('0xa')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index a084005..c6505df 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 _0x28f8=['../client','getSettings','Request','GetSettings'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x28f8,0x1d8));var _0x828f=function(_0x1162f9,_0x35f87c){_0x1162f9=_0x1162f9-0x0;var _0x75257c=_0x28f8[_0x1162f9];return _0x75257c;};'use strict';var client=require(_0x828f('0x0'));exports[_0x828f('0x1')]=function(){return client[_0x828f('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x828f('0x3')});}; \ No newline at end of file +var _0xf8ce=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0xdf4b51,_0x539e92){var _0x4ecc68=function(_0x415fc3){while(--_0x415fc3){_0xdf4b51['push'](_0xdf4b51['shift']());}};_0x4ecc68(++_0x539e92);}(_0xf8ce,0x8a));var _0xef8c=function(_0x4fef43,_0x35b63e){_0x4fef43=_0x4fef43-0x0;var _0x5f0217=_0xf8ce[_0x4fef43];return _0x5f0217;};'use strict';var client=require(_0xef8c('0x0'));exports[_0xef8c('0x1')]=function(){return client[_0xef8c('0x2')](_0xef8c('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xef8c('0x4')]},'log':_0xef8c('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index cb8f5e4..2e1bc45 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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 7cc8f34..a30df3c 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 _0x2fec=['redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','../../routes','default','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','createServer','timeout','listen','port','polling'];(function(_0x5a07e6,_0x2bf9bd){var _0x5a082c=function(_0x50c03a){while(--_0x50c03a){_0x5a07e6['push'](_0x5a07e6['shift']());}};_0x5a082c(++_0x2bf9bd);}(_0x2fec,0x97));var _0xc2fe=function(_0x481517,_0x64c69){_0x481517=_0x481517-0x0;var _0x37c2a4=_0x2fec[_0x481517];return _0x37c2a4;};'use strict';var _=require(_0xc2fe('0x0'));var http=require(_0xc2fe('0x1'));var express=require(_0xc2fe('0x2'));var sticky=require(_0xc2fe('0x3'));var Redis=require(_0xc2fe('0x4'));var config=require('../../config/environment');var app=express();var server=http[_0xc2fe('0x5')](app);server[_0xc2fe('0x6')]=0xdbba0;if(sticky[_0xc2fe('0x7')](server,config[_0xc2fe('0x8')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xc2fe('0x9')]});config[_0xc2fe('0xa')]=_[_0xc2fe('0xb')](config[_0xc2fe('0xa')],{'host':_0xc2fe('0xc'),'port':0x18eb});socketio[_0xc2fe('0xd')](require(_0xc2fe('0xe'))({'pubClient':new Redis(config[_0xc2fe('0xa')]),'subClient':new Redis(config[_0xc2fe('0xa')])}));require(_0xc2fe('0xf'))['default']();require(_0xc2fe('0x10'))['default'](socketio);require('../../config/express')['default'](app);require(_0xc2fe('0x11'))[_0xc2fe('0x12')](app);}else{server[_0xc2fe('0x13')](_0xc2fe('0x14'),function(){console[_0xc2fe('0x15')](_0xc2fe('0x16'),config[_0xc2fe('0x8')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x6144=['once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','express','sticky-session','../../config/environment','createServer','listen','port','socket.io','websocket','polling','redis','localhost','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x6144,0x192));var _0x4614=function(_0x38cccd,_0x133385){_0x38cccd=_0x38cccd-0x0;var _0xbeec3f=_0x6144[_0x38cccd];return _0xbeec3f;};'use strict';var _=require(_0x4614('0x0'));var http=require('http');var express=require(_0x4614('0x1'));var sticky=require(_0x4614('0x2'));var Redis=require('ioredis');var config=require(_0x4614('0x3'));var app=express();var server=http[_0x4614('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x4614('0x5')](server,config[_0x4614('0x6')])){var socketio=require(_0x4614('0x7'))(server,{'transports':[_0x4614('0x8'),_0x4614('0x9')]});config[_0x4614('0xa')]=_['defaults'](config[_0x4614('0xa')],{'host':_0x4614('0xb'),'port':0x18eb});socketio[_0x4614('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0x4614('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x4614('0xd'))[_0x4614('0xe')]();require(_0x4614('0xf'))[_0x4614('0xe')](socketio);require(_0x4614('0x10'))['default'](app);require(_0x4614('0x11'))[_0x4614('0xe')](app);}else{server[_0x4614('0x12')]('listening',function(){console[_0x4614('0x13')](_0x4614('0x14'),config[_0x4614('0x6')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index f4b5e17..e28af50 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 _0x1c7f=['http','request','then','debug','rpc','error','message','exports','jayson/promise','../../config/logger','routing','client'];(function(_0x1f816c,_0x51f22f){var _0x4878b6=function(_0xa70ac0){while(--_0xa70ac0){_0x1f816c['push'](_0x1f816c['shift']());}};_0x4878b6(++_0x51f22f);}(_0x1c7f,0x17c));var _0xf1c7=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0x1c7f[_0x126fb9];return _0xc8a3b1;};'use strict';var jayson=require(_0xf1c7('0x0'));var BPromise=require('bluebird');var logger=require(_0xf1c7('0x1'))(_0xf1c7('0x2'));var client=jayson[_0xf1c7('0x3')][_0xf1c7('0x4')]({'port':0x2329});client['Request']=function(_0x557858,_0x2c542e){return new BPromise(function(_0x96ff37,_0x24bf5e){return client[_0xf1c7('0x5')](_0x557858,_0x2c542e)[_0xf1c7('0x6')](function(_0x1de6d2){logger[_0xf1c7('0x7')](_0xf1c7('0x8'),_0xf1c7('0x2'),_0x557858,_0x2c542e,_0x1de6d2);if(_0x1de6d2[_0xf1c7('0x9')]){logger[_0xf1c7('0x9')](_0xf1c7('0x8'),_0xf1c7('0x2'),_0x557858,_0x1de6d2[_0xf1c7('0x9')]['message'],_0x2c542e);return _0x24bf5e(_0x1de6d2[_0xf1c7('0x9')][_0xf1c7('0xa')]);}else{return _0x96ff37(_0x1de6d2['result']);}})['catch'](function(_0x379d99){logger[_0xf1c7('0x9')](_0xf1c7('0x8'),_0xf1c7('0x2'),_0x557858,_0x379d99,_0x2c542e);return _0x24bf5e(_0x379d99);});});};module[_0xf1c7('0xb')]=client; \ No newline at end of file +var _0x10db=['http','Request','request','debug','rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x10db,0x1ea));var _0xb10d=function(_0x4a61c3,_0x10e6a9){_0x4a61c3=_0x4a61c3-0x0;var _0x4efae5=_0x10db[_0x4a61c3];return _0x4efae5;};'use strict';var jayson=require(_0xb10d('0x0'));var BPromise=require(_0xb10d('0x1'));var logger=require(_0xb10d('0x2'))(_0xb10d('0x3'));var client=jayson['client'][_0xb10d('0x4')]({'port':0x2329});client[_0xb10d('0x5')]=function(_0x6d03f3,_0x47e110){return new BPromise(function(_0x5dcc8f,_0xf34972){return client[_0xb10d('0x6')](_0x6d03f3,_0x47e110)['then'](function(_0x27f22e){logger[_0xb10d('0x7')](_0xb10d('0x8'),_0xb10d('0x3'),_0x6d03f3,_0x47e110,_0x27f22e);if(_0x27f22e[_0xb10d('0x9')]){logger['error']('rpc','routing',_0x6d03f3,_0x27f22e[_0xb10d('0x9')]['message'],_0x47e110);return _0xf34972(_0x27f22e[_0xb10d('0x9')][_0xb10d('0xa')]);}else{return _0x5dcc8f(_0x27f22e[_0xb10d('0xb')]);}})[_0xb10d('0xc')](function(_0x1a87ad){logger[_0xb10d('0x9')](_0xb10d('0x8'),'routing',_0x6d03f3,_0x1a87ad,_0x47e110);return _0xf34972(_0x1a87ad);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index e020a22..2e32e15 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 _0x085d=['initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','getAgents','then','initIntervals','getOpenchannelQueues'];(function(_0x1cdb2d,_0x8f1f76){var _0x4dafe3=function(_0xec694e){while(--_0xec694e){_0x1cdb2d['push'](_0x1cdb2d['shift']());}};_0x4dafe3(++_0x8f1f76);}(_0x085d,0x1d4));var _0xd085=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x085d[_0x166e96];return _0x553d73;};'use strict';var BPromise=require(_0xd085('0x0'));var server=require(_0xd085('0x1'));var Realtime=require(_0xd085('0x2'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0xd085('0x3'));var chatQueue=require(_0xd085('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xd085('0x5'));var faxQueue=require(_0xd085('0x6'));var whatsappQueue=require(_0xd085('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0xd085('0x8')]())['then'](realtime['initAgents']())['then'](interval['getIntervals']())[_0xd085('0x9')](realtime[_0xd085('0xa')]())[_0xd085('0x9')](openchannelQueue[_0xd085('0xb')]())[_0xd085('0x9')](realtime[_0xd085('0xc')]())[_0xd085('0x9')](chatQueue[_0xd085('0xd')]())[_0xd085('0x9')](realtime[_0xd085('0xe')]())[_0xd085('0x9')](smsQueue[_0xd085('0xf')]())[_0xd085('0x9')](realtime[_0xd085('0x10')]())[_0xd085('0x9')](mailQueue[_0xd085('0x11')]())[_0xd085('0x9')](realtime[_0xd085('0x12')]())[_0xd085('0x9')](faxQueue['getFaxQueues']())[_0xd085('0x9')](realtime['initFaxQueues']())[_0xd085('0x9')](whatsappQueue[_0xd085('0x13')]())[_0xd085('0x9')](realtime[_0xd085('0x14')]())[_0xd085('0x9')](function(){return realtime;});}function main(){return server[_0xd085('0x15')](realtime)[_0xd085('0x9')](function(_0x3676a0){return initRealtime();})[_0xd085('0x9')](function(_0x798d39){return setInterval(initRealtime,0x1388);})[_0xd085('0x16')](function(_0x4b3a33){console[_0xd085('0x17')](_0x4b3a33);});}main(); \ No newline at end of file +var _0x32f6=['initSmsQueues','getMailQueues','initFaxQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/whatsappQueue','then','getAgents','initAgents','initIntervals','getChatQueues','initChatQueues','getSmsQueues'];(function(_0x5d0eb8,_0x40c598){var _0x32d89b=function(_0x31fdf8){while(--_0x31fdf8){_0x5d0eb8['push'](_0x5d0eb8['shift']());}};_0x32d89b(++_0x40c598);}(_0x32f6,0x182));var _0x632f=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x32f6[_0x4b73a2];return _0x383c66;};'use strict';var BPromise=require(_0x632f('0x0'));var server=require('./server');var Realtime=require(_0x632f('0x1'));var user=require(_0x632f('0x2'));var interval=require(_0x632f('0x3'));var openchannelQueue=require(_0x632f('0x4'));var chatQueue=require(_0x632f('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x632f('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x632f('0x7')](user[_0x632f('0x8')]())['then'](realtime[_0x632f('0x9')]())['then'](interval['getIntervals']())[_0x632f('0x7')](realtime[_0x632f('0xa')]())[_0x632f('0x7')](openchannelQueue['getOpenchannelQueues']())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x632f('0xb')]())[_0x632f('0x7')](realtime[_0x632f('0xc')]())[_0x632f('0x7')](smsQueue[_0x632f('0xd')]())[_0x632f('0x7')](realtime[_0x632f('0xe')]())[_0x632f('0x7')](mailQueue[_0x632f('0xf')]())[_0x632f('0x7')](realtime['initMailQueues']())['then'](faxQueue['getFaxQueues']())['then'](realtime[_0x632f('0x10')]())['then'](whatsappQueue['getWhatsappQueues']())[_0x632f('0x7')](realtime['initWhatsappQueues']())[_0x632f('0x7')](function(){return realtime;});}function main(){return server[_0x632f('0x11')](realtime)[_0x632f('0x7')](function(_0xdd5093){return initRealtime();})[_0x632f('0x7')](function(_0x210b5f){return setInterval(initRealtime,0x1388);})[_0x632f('0x12')](function(_0x1e2bab){console[_0x632f('0x13')](_0x1e2bab);});}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 b048553..5251b78 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 _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x1a84b1,_0x3ca6d8){var _0x161938=function(_0x44e888){while(--_0x44e888){_0x1a84b1['push'](_0x1a84b1['shift']());}};_0x161938(++_0x3ca6d8);}(_0x326f,0xd1));var _0xf326=function(_0x1a7af0,_0x524cb7){_0x1a7af0=_0x1a7af0-0x0;var _0x3c2f06=_0x326f[_0x1a7af0];return _0x3c2f06;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x8ed99f,_0x4ec651){var _0x15dac4=function(_0x2ce7e1){while(--_0x2ce7e1){_0x8ed99f['push'](_0x8ed99f['shift']());}};_0x15dac4(++_0x4ec651);}(_0x5fc3,0xa8));var _0x35fc=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0x5fc3[_0x202d24];return _0x2b3a8e;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 74d4d01..4a94f29 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 _0xae87=['error','message','result','catch','sendMailMessage','bluebird','jayson/promise','http','request','then'];(function(_0x4a4b45,_0x5de197){var _0x40a7f8=function(_0x454140){while(--_0x454140){_0x4a4b45['push'](_0x4a4b45['shift']());}};_0x40a7f8(++_0x5de197);}(_0xae87,0x131));var _0x7ae8=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0xae87[_0x3932eb];return _0x5316e5;};'use strict';var BPromise=require(_0x7ae8('0x0'));var jayson=require(_0x7ae8('0x1'));var client=jayson['client'][_0x7ae8('0x2')]({'port':0x232b});function request(_0x2eed06,_0x740bf1){return new BPromise(function(_0xf4404c,_0x35cb4a){return client[_0x7ae8('0x3')](_0x2eed06,_0x740bf1)[_0x7ae8('0x4')](function(_0x361904){if(_0x361904[_0x7ae8('0x5')]){return _0x35cb4a(_0x361904[_0x7ae8('0x5')][_0x7ae8('0x6')]);}else{return _0xf4404c(_0x361904[_0x7ae8('0x7')]);}})[_0x7ae8('0x8')](function(_0x102c4d){return _0x35cb4a(_0x102c4d);});});}exports[_0x7ae8('0x9')]=function(_0x1417e6,_0x19ef8f){return request('SendMail',{'account':_0x1417e6,'message':_0x19ef8f});}; \ No newline at end of file +var _0xfd68=['jayson/promise','client','http','request','then','error','message','catch','sendMailMessage','SendMail','bluebird'];(function(_0x336b6a,_0x5ca73f){var _0x488269=function(_0x1240de){while(--_0x1240de){_0x336b6a['push'](_0x336b6a['shift']());}};_0x488269(++_0x5ca73f);}(_0xfd68,0xd0));var _0x8fd6=function(_0x4d4e90,_0x5918c0){_0x4d4e90=_0x4d4e90-0x0;var _0xee5402=_0xfd68[_0x4d4e90];return _0xee5402;};'use strict';var BPromise=require(_0x8fd6('0x0'));var jayson=require(_0x8fd6('0x1'));var client=jayson[_0x8fd6('0x2')][_0x8fd6('0x3')]({'port':0x232b});function request(_0x51bfcd,_0x5b3c5d){return new BPromise(function(_0x2353d0,_0x18bc8c){return client[_0x8fd6('0x4')](_0x51bfcd,_0x5b3c5d)[_0x8fd6('0x5')](function(_0x57c339){if(_0x57c339[_0x8fd6('0x6')]){return _0x18bc8c(_0x57c339['error'][_0x8fd6('0x7')]);}else{return _0x2353d0(_0x57c339['result']);}})[_0x8fd6('0x8')](function(_0x4bfa5c){return _0x18bc8c(_0x4bfa5c);});});}exports[_0x8fd6('0x9')]=function(_0x32a598,_0x425c89){return request(_0x8fd6('0xa'),{'account':_0x32a598,'message':_0x425c89});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index ee5ecc1..77a393b 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 _0x05e3=['idle','mail','chat','openchannel','fax','length','Status','format','faxStatus','smsCurrentCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','stringify','emit','user:save','exports','lodash','moment','md5','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working'];(function(_0x35ce45,_0x57c22a){var _0x5cd865=function(_0x1100fd){while(--_0x1100fd){_0x35ce45['push'](_0x35ce45['shift']());}};_0x5cd865(++_0x57c22a);}(_0x05e3,0x86));var _0x305e=function(_0x2c1524,_0x311a60){_0x2c1524=_0x2c1524-0x0;var _0x4ddd51=_0x05e3[_0x2c1524];return _0x4ddd51;};'use strict';var _=require(_0x305e('0x0'));var moment=require(_0x305e('0x1'));var md5=require(_0x305e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x305e('0x3')]=_[_0x305e('0x4')](config['redis'],{'host':_0x305e('0x5'),'port':0x18eb});var io=require(_0x305e('0x6'))(new Redis(config['redis']));function Agent(_0xd743b8){this['id']=_0xd743b8['id']||0x0;this[_0x305e('0x7')]=_0xd743b8[_0x305e('0x7')]||'';this[_0x305e('0x8')]=_0xd743b8[_0x305e('0x8')]||!![];this[_0x305e('0x9')]=_0xd743b8[_0x305e('0x9')]||![];this[_0x305e('0xa')]=_0xd743b8['chatPause']||![];this[_0x305e('0xb')]=_0xd743b8['mailPause']||![];this[_0x305e('0xc')]=_0xd743b8[_0x305e('0xc')]||![];this['smsPause']=_0xd743b8[_0x305e('0xd')]||![];this[_0x305e('0xe')]=_0xd743b8[_0x305e('0xe')]||![];this[_0x305e('0xf')]=_0x305e('0x10');this[_0x305e('0x11')]=0x0;this[_0x305e('0x12')]=_0xd743b8[_0x305e('0x12')]||0x0;this[_0x305e('0x13')]=0x0;this[_0x305e('0x14')]=_0x305e('0x10');this[_0x305e('0x15')]=0x0;this['mailCapacity']=_0xd743b8[_0x305e('0x16')]||0x0;this[_0x305e('0x17')]=0x0;this['faxStatus']=_0x305e('0x10');this[_0x305e('0x18')]=0x0;this[_0x305e('0x19')]=_0xd743b8[_0x305e('0x19')]||0x0;this[_0x305e('0x1a')]=0x0;this[_0x305e('0x1b')]=_0x305e('0x10');this['smsStatusTime']=0x0;this[_0x305e('0x1c')]=_0xd743b8[_0x305e('0x1c')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x305e('0x1d')]=_0x305e('0x10');this[_0x305e('0x1e')]=0x0;this[_0x305e('0x1f')]=_0xd743b8[_0x305e('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']='unknown';this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0xd743b8['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x305e('0x20')]=![];this[_0x305e('0x21')]=undefined;this[_0x305e('0x2')]='';this[_0x305e('0x22')]();}Agent[_0x305e('0x23')][_0x305e('0x24')]=function(_0x4a70d6){if(this[_0x4a70d6+_0x305e('0x25')]>0x0){if(this[_0x4a70d6+'Capacity']>0x0&&this[_0x4a70d6+_0x305e('0x25')]>=this[_0x4a70d6+_0x305e('0x26')]){return'maxcapacity';}else{return _0x305e('0x27');}}else{return _0x305e('0x28');}};Agent[_0x305e('0x23')][_0x305e('0x22')]=function(){var _0x151361=[_0x305e('0x29'),_0x305e('0x2a'),_0x305e('0x2b'),_0x305e('0x2c'),'sms','whatsapp'];for(var _0x1bda0f=0x0;_0x1bda0f<_0x151361[_0x305e('0x2d')];_0x1bda0f+=0x1){var _0x1aeb09=this[_0x305e('0x24')](_0x151361[_0x1bda0f]);if(this[_0x151361[_0x1bda0f]+_0x305e('0x2e')]!==_0x1aeb09){this[_0x151361[_0x1bda0f]+'StatusTime']=_['toNumber'](moment()[_0x305e('0x2f')]('x'));}this[_0x151361[_0x1bda0f]+_0x305e('0x2e')]=_0x1aeb09;}var _0x10b398={'id':this['id'],'name':this[_0x305e('0x7')],'online':this[_0x305e('0x8')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0x305e('0xb')],'smsPause':this[_0x305e('0xd')],'faxPause':this[_0x305e('0xc')],'openchannelPause':this[_0x305e('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x305e('0x11')],'chatCapacity':this[_0x305e('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x305e('0x14')],'mailStatusTime':this[_0x305e('0x15')],'mailCapacity':this[_0x305e('0x16')],'mailCurrentCapacity':this[_0x305e('0x17')],'faxStatus':this[_0x305e('0x30')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x305e('0x1a')],'smsStatus':this[_0x305e('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x305e('0x31')],'whatsappStatus':this[_0x305e('0x1d')],'whatsappStatusTime':this[_0x305e('0x1e')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x305e('0x32')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x305e('0x33')],'openchannelCapacity':this[_0x305e('0x34')],'openchannelCurrentCapacity':this[_0x305e('0x35')],'busy':this[_0x305e('0x20')],'busyQueue':this[_0x305e('0x21')]};var _0x3d2afb=md5(JSON[_0x305e('0x36')](_0x10b398));if(this['md5']!==_0x3d2afb){this[_0x305e('0x2')]=_0x3d2afb;io[_0x305e('0x37')](_0x305e('0x38'),_0x10b398);}};module[_0x305e('0x39')]=Agent; \ No newline at end of file +var _0xa7b1=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','chat','fax','sms','whatsapp','StatusTime','toNumber','format','mailStatus','smsStatusTime','smsCurrentCapacity','whatsappCurrentCapacity','stringify','emit','exports','moment','ioredis'];(function(_0x240e6c,_0x456ccc){var _0x1aae46=function(_0x2be7b4){while(--_0x2be7b4){_0x240e6c['push'](_0x240e6c['shift']());}};_0x1aae46(++_0x456ccc);}(_0xa7b1,0x194));var _0x1a7b=function(_0xc0cc9b,_0x4b9c12){_0xc0cc9b=_0xc0cc9b-0x0;var _0x29665f=_0xa7b1[_0xc0cc9b];return _0x29665f;};'use strict';var _=require('lodash');var moment=require(_0x1a7b('0x0'));var md5=require('md5');var Redis=require(_0x1a7b('0x1'));var config=require(_0x1a7b('0x2'));config[_0x1a7b('0x3')]=_[_0x1a7b('0x4')](config[_0x1a7b('0x3')],{'host':_0x1a7b('0x5'),'port':0x18eb});var io=require(_0x1a7b('0x6'))(new Redis(config[_0x1a7b('0x3')]));function Agent(_0x216556){this['id']=_0x216556['id']||0x0;this[_0x1a7b('0x7')]=_0x216556[_0x1a7b('0x7')]||'';this[_0x1a7b('0x8')]=_0x216556[_0x1a7b('0x8')]||!![];this[_0x1a7b('0x9')]=_0x216556[_0x1a7b('0x9')]||![];this['chatPause']=_0x216556[_0x1a7b('0xa')]||![];this['mailPause']=_0x216556[_0x1a7b('0xb')]||![];this['faxPause']=_0x216556[_0x1a7b('0xc')]||![];this[_0x1a7b('0xd')]=_0x216556[_0x1a7b('0xd')]||![];this[_0x1a7b('0xe')]=_0x216556[_0x1a7b('0xe')]||![];this[_0x1a7b('0xf')]=_0x1a7b('0x10');this[_0x1a7b('0x11')]=0x0;this[_0x1a7b('0x12')]=_0x216556[_0x1a7b('0x12')]||0x0;this[_0x1a7b('0x13')]=0x0;this['mailStatus']='unknown';this[_0x1a7b('0x14')]=0x0;this[_0x1a7b('0x15')]=_0x216556[_0x1a7b('0x15')]||0x0;this[_0x1a7b('0x16')]=0x0;this[_0x1a7b('0x17')]=_0x1a7b('0x10');this[_0x1a7b('0x18')]=0x0;this[_0x1a7b('0x19')]=_0x216556['faxCapacity']||0x0;this[_0x1a7b('0x1a')]=0x0;this[_0x1a7b('0x1b')]=_0x1a7b('0x10');this['smsStatusTime']=0x0;this[_0x1a7b('0x1c')]=_0x216556['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x1a7b('0x1d')]='unknown';this[_0x1a7b('0x1e')]=0x0;this[_0x1a7b('0x1f')]=_0x216556[_0x1a7b('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x1a7b('0x10');this[_0x1a7b('0x20')]=0x0;this[_0x1a7b('0x21')]=_0x216556[_0x1a7b('0x21')]||0x0;this[_0x1a7b('0x22')]=0x0;this[_0x1a7b('0x23')]=![];this[_0x1a7b('0x24')]=undefined;this[_0x1a7b('0x25')]='';this[_0x1a7b('0x26')]();}Agent['prototype'][_0x1a7b('0x27')]=function(_0x422b8d){if(this[_0x422b8d+_0x1a7b('0x28')]>0x0){if(this[_0x422b8d+_0x1a7b('0x29')]>0x0&&this[_0x422b8d+'CurrentCapacity']>=this[_0x422b8d+_0x1a7b('0x29')]){return _0x1a7b('0x2a');}else{return _0x1a7b('0x2b');}}else{return'idle';}};Agent['prototype'][_0x1a7b('0x26')]=function(){var _0x1b5e46=['mail',_0x1a7b('0x2c'),'openchannel',_0x1a7b('0x2d'),_0x1a7b('0x2e'),_0x1a7b('0x2f')];for(var _0x3235ef=0x0;_0x3235ef<_0x1b5e46['length'];_0x3235ef+=0x1){var _0x3e8e31=this[_0x1a7b('0x27')](_0x1b5e46[_0x3235ef]);if(this[_0x1b5e46[_0x3235ef]+'Status']!==_0x3e8e31){this[_0x1b5e46[_0x3235ef]+_0x1a7b('0x30')]=_[_0x1a7b('0x31')](moment()[_0x1a7b('0x32')]('x'));}this[_0x1b5e46[_0x3235ef]+'Status']=_0x3e8e31;}var _0x160a15={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0x1a7b('0x9')],'chatPause':this[_0x1a7b('0xa')],'mailPause':this[_0x1a7b('0xb')],'smsPause':this[_0x1a7b('0xd')],'faxPause':this[_0x1a7b('0xc')],'openchannelPause':this[_0x1a7b('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x1a7b('0x11')],'chatCapacity':this[_0x1a7b('0x12')],'chatCurrentCapacity':this[_0x1a7b('0x13')],'mailStatus':this[_0x1a7b('0x33')],'mailStatusTime':this[_0x1a7b('0x14')],'mailCapacity':this[_0x1a7b('0x15')],'mailCurrentCapacity':this[_0x1a7b('0x16')],'faxStatus':this[_0x1a7b('0x17')],'faxStatusTime':this[_0x1a7b('0x18')],'faxCapacity':this[_0x1a7b('0x19')],'faxCurrentCapacity':this[_0x1a7b('0x1a')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x1a7b('0x34')],'smsCapacity':this[_0x1a7b('0x1c')],'smsCurrentCapacity':this[_0x1a7b('0x35')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x1a7b('0x1f')],'whatsappCurrentCapacity':this[_0x1a7b('0x36')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x1a7b('0x20')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x1a7b('0x22')],'busy':this[_0x1a7b('0x23')],'busyQueue':this['busyQueue']};var _0x46b719=md5(JSON[_0x1a7b('0x37')](_0x160a15));if(this['md5']!==_0x46b719){this[_0x1a7b('0x25')]=_0x46b719;io[_0x1a7b('0x38')]('user:save',_0x160a15);}};module[_0x1a7b('0x39')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 14d0170..3938085 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 _0xe544=['strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','md5','format','emit','chat_queue:save','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout'];(function(_0x2c862c,_0x269b88){var _0x26403b=function(_0x33bb88){while(--_0x33bb88){_0x2c862c['push'](_0x2c862c['shift']());}};_0x26403b(++_0x269b88);}(_0xe544,0x181));var _0x4e54=function(_0x569cbe,_0x2b4cb4){_0x569cbe=_0x569cbe-0x0;var _0x2104a5=_0xe544[_0x569cbe];return _0x2104a5;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x4e54('0x0'));var Redis=require('ioredis');var config=require(_0x4e54('0x1'));config[_0x4e54('0x2')]=_[_0x4e54('0x3')](config[_0x4e54('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x4e54('0x4'))(new Redis(config[_0x4e54('0x2')]));function ChatQueue(_0xd4a5ac){this['id']=_0xd4a5ac['id']||0x0;this[_0x4e54('0x5')]=_0xd4a5ac[_0x4e54('0x5')]||'';this[_0x4e54('0x6')]=_0xd4a5ac[_0x4e54('0x6')]||0xa;this[_0x4e54('0x7')]=_0xd4a5ac[_0x4e54('0x7')]||_0x4e54('0x8');this['Agents']=_0xd4a5ac[_0x4e54('0x9')];this[_0x4e54('0xa')]={};this[_0x4e54('0xb')]=0x0;this['md5']='';this[_0x4e54('0xc')]();this[_0x4e54('0xd')]();}ChatQueue[_0x4e54('0xe')]['updateRouting']=function(){var _0x2f7757=this['mapAgentsId'][_0x4e54('0xf')];this[_0x4e54('0xa')]=_[_0x4e54('0x10')](this[_0x4e54('0x9')],'id');this['mapAgentsId']['_rr']=_0x2f7757;};ChatQueue[_0x4e54('0xe')][_0x4e54('0xd')]=function(){this[_0x4e54('0x11')]=0x0;this[_0x4e54('0x12')]=0x0;for(var _0x49706a=0x0;_0x49706a=0x0?this[_0x4e54('0x16')]:0x0;var _0x15998a={'id':this['id'],'available':this[_0x4e54('0x16')],'loggedIn':this[_0x4e54('0x11')],'name':this[_0x4e54('0x5')],'paused':this[_0x4e54('0x12')],'waiting':this[_0x4e54('0xb')]};var _0xa3619d=md5(JSON[_0x4e54('0x17')](_0x15998a));if(this[_0x4e54('0x18')]!==_0xa3619d){this[_0x4e54('0x18')]=_0xa3619d;io['to'](util[_0x4e54('0x19')]('chat:queue:%s',_0x15998a[_0x4e54('0x5')]))[_0x4e54('0x1a')](_0x4e54('0x1b'),_0x15998a);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x9965=['lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','Agents','mapAgentsId','waiting','map','loggedIn','paused','length','chatPause','available','stringify','format','exports'];(function(_0x2dab33,_0x4911d6){var _0x1a8c07=function(_0x527874){while(--_0x527874){_0x2dab33['push'](_0x2dab33['shift']());}};_0x1a8c07(++_0x4911d6);}(_0x9965,0x14a));var _0x5996=function(_0xea5d44,_0x4d25d3){_0xea5d44=_0xea5d44-0x0;var _0x448141=_0x9965[_0xea5d44];return _0x448141;};'use strict';var _=require(_0x5996('0x0'));var md5=require(_0x5996('0x1'));var util=require(_0x5996('0x2'));var Redis=require(_0x5996('0x3'));var config=require(_0x5996('0x4'));config[_0x5996('0x5')]=_[_0x5996('0x6')](config[_0x5996('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5996('0x5')]));function ChatQueue(_0x5d5f94){this['id']=_0x5d5f94['id']||0x0;this['name']=_0x5d5f94[_0x5996('0x7')]||'';this[_0x5996('0x8')]=_0x5d5f94['timeout']||0xa;this[_0x5996('0x9')]=_0x5d5f94[_0x5996('0x9')]||'beepall';this[_0x5996('0xa')]=_0x5d5f94[_0x5996('0xa')];this[_0x5996('0xb')]={};this[_0x5996('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue['prototype']['updateRouting']=function(){var _0xa812d=this[_0x5996('0xb')]['_rr'];this['mapAgentsId']=_[_0x5996('0xd')](this['Agents'],'id');this[_0x5996('0xb')]['_rr']=_0xa812d;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x5996('0xe')]=0x0;this[_0x5996('0xf')]=0x0;for(var _0x28262c=0x0;_0x28262c=0x0?this[_0x5996('0x12')]:0x0;var _0xc5ddc5={'id':this['id'],'available':this[_0x5996('0x12')],'loggedIn':this['loggedIn'],'name':this[_0x5996('0x7')],'paused':this[_0x5996('0xf')],'waiting':this[_0x5996('0xc')]};var _0x567d25=md5(JSON[_0x5996('0x13')](_0xc5ddc5));if(this[_0x5996('0x1')]!==_0x567d25){this['md5']=_0x567d25;io['to'](util[_0x5996('0x14')]('chat:queue:%s',_0xc5ddc5[_0x5996('0x7')]))['emit']('chat_queue:save',_0xc5ddc5);}};module[_0x5996('0x15')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index b380ced..a3d9904 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 _0xa15c=['ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0xa15c,0x169));var _0xca15=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa15c[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xca15('0x0'));var md5=require(_0xca15('0x1'));var util=require(_0xca15('0x2'));var Redis=require(_0xca15('0x3'));var config=require(_0xca15('0x4'));config[_0xca15('0x5')]=_[_0xca15('0x6')](config['redis'],{'host':_0xca15('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x16f5dc){this['id']=_0x16f5dc['id']||0x0;this[_0xca15('0x8')]=_0x16f5dc['name']||'';this[_0xca15('0x9')]=_0x16f5dc[_0xca15('0x9')]||0xa;this[_0xca15('0xa')]=_0x16f5dc[_0xca15('0xa')]||'beepall';this[_0xca15('0xb')]=_0x16f5dc[_0xca15('0xb')];this['mapAgentsId']={};this[_0xca15('0xc')]=0x0;this[_0xca15('0x1')]='';this[_0xca15('0xd')]();this[_0xca15('0xe')]();}FaxQueue[_0xca15('0xf')][_0xca15('0xd')]=function(){var _0x1ca18d=this[_0xca15('0x10')][_0xca15('0x11')];this[_0xca15('0x10')]=_[_0xca15('0x12')](this['Agents'],'id');this[_0xca15('0x10')][_0xca15('0x11')]=_0x1ca18d;};FaxQueue['prototype'][_0xca15('0xe')]=function(){this[_0xca15('0x13')]=0x0;this[_0xca15('0x14')]=0x0;for(var _0x5dfdcb=0x0;_0x5dfdcb=0x0?this['available']:0x0;var _0x3e6f59={'id':this['id'],'available':this[_0xca15('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xca15('0x8')],'paused':this[_0xca15('0x14')],'waiting':this['waiting']};var _0x6fbd05=md5(JSON[_0xca15('0x17')](_0x3e6f59));if(this[_0xca15('0x1')]!==_0x6fbd05){this['md5']=_0x6fbd05;io['to'](util['format'](_0xca15('0x18'),_0x3e6f59[_0xca15('0x8')]))[_0xca15('0x19')](_0xca15('0x1a'),_0x3e6f59);}};module[_0xca15('0x1b')]=FaxQueue; \ No newline at end of file +var _0x8565=['exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8565,0x197));var _0x5856=function(_0x40a506,_0x6f03e){_0x40a506=_0x40a506-0x0;var _0x1c9ed4=_0x8565[_0x40a506];return _0x1c9ed4;};'use strict';var _=require('lodash');var md5=require(_0x5856('0x0'));var util=require(_0x5856('0x1'));var Redis=require(_0x5856('0x2'));var config=require(_0x5856('0x3'));config[_0x5856('0x4')]=_[_0x5856('0x5')](config['redis'],{'host':_0x5856('0x6'),'port':0x18eb});var io=require(_0x5856('0x7'))(new Redis(config[_0x5856('0x4')]));function FaxQueue(_0x2b7249){this['id']=_0x2b7249['id']||0x0;this[_0x5856('0x8')]=_0x2b7249[_0x5856('0x8')]||'';this[_0x5856('0x9')]=_0x2b7249['timeout']||0xa;this[_0x5856('0xa')]=_0x2b7249[_0x5856('0xa')]||'beepall';this['Agents']=_0x2b7249[_0x5856('0xb')];this[_0x5856('0xc')]={};this[_0x5856('0xd')]=0x0;this[_0x5856('0x0')]='';this[_0x5856('0xe')]();this[_0x5856('0xf')]();}FaxQueue[_0x5856('0x10')][_0x5856('0xe')]=function(){var _0x3b0363=this[_0x5856('0xc')][_0x5856('0x11')];this[_0x5856('0xc')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x5856('0x11')]=_0x3b0363;};FaxQueue['prototype']['updateRealtime']=function(){this[_0x5856('0x12')]=0x0;this[_0x5856('0x13')]=0x0;for(var _0x532646=0x0;_0x532646=0x0?this[_0x5856('0x17')]:0x0;var _0x30d073={'id':this['id'],'available':this[_0x5856('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x5856('0x8')],'paused':this['paused'],'waiting':this[_0x5856('0xd')]};var _0x3a5e07=md5(JSON[_0x5856('0x18')](_0x30d073));if(this['md5']!==_0x3a5e07){this[_0x5856('0x0')]=_0x3a5e07;io['to'](util['format'](_0x5856('0x19'),_0x30d073[_0x5856('0x8')]))[_0x5856('0x1a')](_0x5856('0x1b'),_0x30d073);}};module[_0x5856('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 9adbb0a..55b92a3 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 _0xe5be=['name','Intervals','exports'];(function(_0x352864,_0x2b385c){var _0xd1e00e=function(_0xa023f4){while(--_0xa023f4){_0x352864['push'](_0x352864['shift']());}};_0xd1e00e(++_0x2b385c);}(_0xe5be,0x129));var _0xee5b=function(_0x495344,_0x541018){_0x495344=_0x495344-0x0;var _0x3d3fca=_0xe5be[_0x495344];return _0x3d3fca;};'use strict';function Interval(_0x358333){this['id']=_0x358333['id']||0x0;this[_0xee5b('0x0')]=_0x358333[_0xee5b('0x0')]||'';this[_0xee5b('0x1')]=_0x358333['Intervals']||{};}module[_0xee5b('0x2')]=Interval; \ No newline at end of file +var _0xc0cd=['exports','name','Intervals'];(function(_0x50f0d2,_0x979488){var _0x467428=function(_0x54585c){while(--_0x54585c){_0x50f0d2['push'](_0x50f0d2['shift']());}};_0x467428(++_0x979488);}(_0xc0cd,0xac));var _0xdc0c=function(_0x239763,_0x529b32){_0x239763=_0x239763-0x0;var _0x5201a8=_0xc0cd[_0x239763];return _0x5201a8;};'use strict';function Interval(_0x3ccef0){this['id']=_0x3ccef0['id']||0x0;this[_0xdc0c('0x0')]=_0x3ccef0[_0xdc0c('0x0')]||'';this[_0xdc0c('0x1')]=_0x3ccef0[_0xdc0c('0x1')]||{};}module[_0xdc0c('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 5a32336..91d8ce3 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 _0x262a=['Agents','mapAgentsId','updateRouting','prototype','map','_rr','loggedIn','paused','length','mailPause','available','stringify','format','emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment','redis','name','timeout','strategy','beepall'];(function(_0x3f92c5,_0x260799){var _0x4d5618=function(_0x2eb65a){while(--_0x2eb65a){_0x3f92c5['push'](_0x3f92c5['shift']());}};_0x4d5618(++_0x260799);}(_0x262a,0xf1));var _0xa262=function(_0x2872b0,_0x4b0855){_0x2872b0=_0x2872b0-0x0;var _0x58b379=_0x262a[_0x2872b0];return _0x58b379;};'use strict';var _=require(_0xa262('0x0'));var md5=require(_0xa262('0x1'));var util=require(_0xa262('0x2'));var Redis=require('ioredis');var config=require(_0xa262('0x3'));config[_0xa262('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa262('0x4')]));function MailQueue(_0x53bf14){this['id']=_0x53bf14['id']||0x0;this[_0xa262('0x5')]=_0x53bf14['name']||'';this[_0xa262('0x6')]=_0x53bf14[_0xa262('0x6')]||0xa;this[_0xa262('0x7')]=_0x53bf14[_0xa262('0x7')]||_0xa262('0x8');this[_0xa262('0x9')]=_0x53bf14[_0xa262('0x9')];this[_0xa262('0xa')]={};this['waiting']=0x0;this['md5']='';this[_0xa262('0xb')]();this['updateRealtime']();}MailQueue[_0xa262('0xc')][_0xa262('0xb')]=function(){var _0x2bd957=this[_0xa262('0xa')]['_rr'];this[_0xa262('0xa')]=_[_0xa262('0xd')](this[_0xa262('0x9')],'id');this['mapAgentsId'][_0xa262('0xe')]=_0x2bd957;};MailQueue[_0xa262('0xc')]['updateRealtime']=function(){this[_0xa262('0xf')]=0x0;this[_0xa262('0x10')]=0x0;for(var _0x2f341b=0x0;_0x2f341b=0x0?this[_0xa262('0x13')]:0x0;var _0x4c8560={'id':this['id'],'available':this[_0xa262('0x13')],'loggedIn':this[_0xa262('0xf')],'name':this[_0xa262('0x5')],'paused':this[_0xa262('0x10')],'waiting':this['waiting']};var _0x1a1046=md5(JSON[_0xa262('0x14')](_0x4c8560));if(this[_0xa262('0x1')]!==_0x1a1046){this['md5']=_0x1a1046;io['to'](util[_0xa262('0x15')]('mail:queue:%s',_0x4c8560[_0xa262('0x5')]))[_0xa262('0x16')](_0xa262('0x17'),_0x4c8560);}};module[_0xa262('0x18')]=MailQueue; \ No newline at end of file +var _0xb945=['strategy','beepall','mapAgentsId','updateRouting','prototype','_rr','Agents','updateRealtime','loggedIn','paused','online','mailPause','available','waiting','stringify','mail:queue:%s','emit','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0xb31ff9,_0x8302e5){var _0x3801c4=function(_0x5aee71){while(--_0x5aee71){_0xb31ff9['push'](_0xb31ff9['shift']());}};_0x3801c4(++_0x8302e5);}(_0xb945,0xf2));var _0x5b94=function(_0x2eef32,_0x29f149){_0x2eef32=_0x2eef32-0x0;var _0x279e3f=_0xb945[_0x2eef32];return _0x279e3f;};'use strict';var _=require('lodash');var md5=require(_0x5b94('0x0'));var util=require(_0x5b94('0x1'));var Redis=require('ioredis');var config=require(_0x5b94('0x2'));config['redis']=_['defaults'](config[_0x5b94('0x3')],{'host':_0x5b94('0x4'),'port':0x18eb});var io=require(_0x5b94('0x5'))(new Redis(config[_0x5b94('0x3')]));function MailQueue(_0x25c8f2){this['id']=_0x25c8f2['id']||0x0;this[_0x5b94('0x6')]=_0x25c8f2[_0x5b94('0x6')]||'';this['timeout']=_0x25c8f2[_0x5b94('0x7')]||0xa;this[_0x5b94('0x8')]=_0x25c8f2[_0x5b94('0x8')]||_0x5b94('0x9');this['Agents']=_0x25c8f2['Agents'];this[_0x5b94('0xa')]={};this['waiting']=0x0;this[_0x5b94('0x0')]='';this[_0x5b94('0xb')]();this['updateRealtime']();}MailQueue[_0x5b94('0xc')]['updateRouting']=function(){var _0x4f73ad=this['mapAgentsId'][_0x5b94('0xd')];this[_0x5b94('0xa')]=_['map'](this[_0x5b94('0xe')],'id');this['mapAgentsId'][_0x5b94('0xd')]=_0x4f73ad;};MailQueue['prototype'][_0x5b94('0xf')]=function(){this[_0x5b94('0x10')]=0x0;this[_0x5b94('0x11')]=0x0;for(var _0x6eb43d=0x0;_0x6eb43d=0x0?this['available']:0x0;var _0x3695e5={'id':this['id'],'available':this[_0x5b94('0x14')],'loggedIn':this[_0x5b94('0x10')],'name':this['name'],'paused':this[_0x5b94('0x11')],'waiting':this[_0x5b94('0x15')]};var _0x14c2ff=md5(JSON[_0x5b94('0x16')](_0x3695e5));if(this[_0x5b94('0x0')]!==_0x14c2ff){this['md5']=_0x14c2ff;io['to'](util['format'](_0x5b94('0x17'),_0x3695e5[_0x5b94('0x6')]))[_0x5b94('0x18')]('mail_queue:save',_0x3695e5);}};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 0d8e47d..57fd200 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x7a54,0x106));var _0x47a5=function(_0x1cf211,_0x588cdb){_0x1cf211=_0x1cf211-0x0;var _0x29b8c7=_0x7a54[_0x1cf211];return _0x29b8c7;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x2ef3,0xba));var _0x32ef=function(_0x363720,_0x2a34e1){_0x363720=_0x363720-0x0;var _0x5ddebc=_0x2ef3[_0x363720];return _0x5ddebc;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 4376169..a4d3b9e 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 _0x27c5=['online','smsPause','paused','available','stringify','format','sms_queue:save','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn'];(function(_0x3ee1b9,_0x285336){var _0x53c7a7=function(_0x4b1b74){while(--_0x4b1b74){_0x3ee1b9['push'](_0x3ee1b9['shift']());}};_0x53c7a7(++_0x285336);}(_0x27c5,0x173));var _0x527c=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0x27c5[_0x507403];return _0x1327c;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x527c('0x0'));var Redis=require(_0x527c('0x1'));var config=require(_0x527c('0x2'));config['redis']=_[_0x527c('0x3')](config[_0x527c('0x4')],{'host':_0x527c('0x5'),'port':0x18eb});var io=require(_0x527c('0x6'))(new Redis(config[_0x527c('0x4')]));function SmsQueue(_0x2bb668){this['id']=_0x2bb668['id']||0x0;this[_0x527c('0x7')]=_0x2bb668['name']||'';this[_0x527c('0x8')]=_0x2bb668['timeout']||0xa;this[_0x527c('0x9')]=_0x2bb668['strategy']||_0x527c('0xa');this[_0x527c('0xb')]=_0x2bb668[_0x527c('0xb')];this['mapAgentsId']={};this[_0x527c('0xc')]=0x0;this[_0x527c('0xd')]='';this[_0x527c('0xe')]();this[_0x527c('0xf')]();}SmsQueue[_0x527c('0x10')][_0x527c('0xe')]=function(){var _0x8519ed=this[_0x527c('0x11')][_0x527c('0x12')];this[_0x527c('0x11')]=_[_0x527c('0x13')](this['Agents'],'id');this['mapAgentsId'][_0x527c('0x12')]=_0x8519ed;};SmsQueue[_0x527c('0x10')][_0x527c('0xf')]=function(){this[_0x527c('0x14')]=0x0;this['paused']=0x0;for(var _0x416ed8=0x0;_0x416ed8=0x0?this[_0x527c('0x18')]:0x0;var _0x478d6e={'id':this['id'],'available':this[_0x527c('0x18')],'loggedIn':this[_0x527c('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x527c('0xc')]};var _0x1b157e=md5(JSON[_0x527c('0x19')](_0x478d6e));if(this[_0x527c('0xd')]!==_0x1b157e){this['md5']=_0x1b157e;io['to'](util[_0x527c('0x1a')]('sms:queue:%s',_0x478d6e[_0x527c('0x7')]))['emit'](_0x527c('0x1b'),_0x478d6e);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xc112=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','waiting','stringify','format','sms_queue:save','exports','lodash','md5','util','../../../config/environment'];(function(_0x3c5cc7,_0x447374){var _0x2aef2a=function(_0x14f79d){while(--_0x14f79d){_0x3c5cc7['push'](_0x3c5cc7['shift']());}};_0x2aef2a(++_0x447374);}(_0xc112,0xec));var _0x2c11=function(_0xab4901,_0x476077){_0xab4901=_0xab4901-0x0;var _0x474f9a=_0xc112[_0xab4901];return _0x474f9a;};'use strict';var _=require(_0x2c11('0x0'));var md5=require(_0x2c11('0x1'));var util=require(_0x2c11('0x2'));var Redis=require('ioredis');var config=require(_0x2c11('0x3'));config[_0x2c11('0x4')]=_[_0x2c11('0x5')](config[_0x2c11('0x4')],{'host':_0x2c11('0x6'),'port':0x18eb});var io=require(_0x2c11('0x7'))(new Redis(config[_0x2c11('0x4')]));function SmsQueue(_0x18b489){this['id']=_0x18b489['id']||0x0;this[_0x2c11('0x8')]=_0x18b489['name']||'';this['timeout']=_0x18b489[_0x2c11('0x9')]||0xa;this[_0x2c11('0xa')]=_0x18b489[_0x2c11('0xa')]||_0x2c11('0xb');this['Agents']=_0x18b489[_0x2c11('0xc')];this[_0x2c11('0xd')]={};this['waiting']=0x0;this[_0x2c11('0x1')]='';this[_0x2c11('0xe')]();this[_0x2c11('0xf')]();}SmsQueue[_0x2c11('0x10')][_0x2c11('0xe')]=function(){var _0x501d3c=this[_0x2c11('0xd')][_0x2c11('0x11')];this[_0x2c11('0xd')]=_[_0x2c11('0x12')](this[_0x2c11('0xc')],'id');this[_0x2c11('0xd')][_0x2c11('0x11')]=_0x501d3c;};SmsQueue['prototype'][_0x2c11('0xf')]=function(){this[_0x2c11('0x13')]=0x0;this[_0x2c11('0x14')]=0x0;for(var _0x3f8c82=0x0;_0x3f8c82=0x0?this[_0x2c11('0x18')]:0x0;var _0x12ce46={'id':this['id'],'available':this[_0x2c11('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x2c11('0x8')],'paused':this['paused'],'waiting':this[_0x2c11('0x19')]};var _0x269830=md5(JSON[_0x2c11('0x1a')](_0x12ce46));if(this[_0x2c11('0x1')]!==_0x269830){this[_0x2c11('0x1')]=_0x269830;io['to'](util[_0x2c11('0x1b')]('sms:queue:%s',_0x12ce46['name']))['emit'](_0x2c11('0x1c'),_0x12ce46);}};module[_0x2c11('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 10f11cc..8fb21c8 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 _0xf1d0=['localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','_rr','prototype','loggedIn','paused','online','available','stringify','format','emit','lodash','md5','util','../../../config/environment','redis','defaults'];(function(_0x45e2a7,_0x4e8fa4){var _0x1cc813=function(_0x1d3fa4){while(--_0x1d3fa4){_0x45e2a7['push'](_0x45e2a7['shift']());}};_0x1cc813(++_0x4e8fa4);}(_0xf1d0,0x125));var _0x0f1d=function(_0x56460a,_0x4f8f01){_0x56460a=_0x56460a-0x0;var _0x53e918=_0xf1d0[_0x56460a];return _0x53e918;};'use strict';var _=require(_0x0f1d('0x0'));var md5=require(_0x0f1d('0x1'));var util=require(_0x0f1d('0x2'));var Redis=require('ioredis');var config=require(_0x0f1d('0x3'));config[_0x0f1d('0x4')]=_[_0x0f1d('0x5')](config['redis'],{'host':_0x0f1d('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0f1d('0x4')]));function WhatsappQueue(_0x5d9ea7){this['id']=_0x5d9ea7['id']||0x0;this[_0x0f1d('0x7')]=_0x5d9ea7['name']||'';this[_0x0f1d('0x8')]=_0x5d9ea7[_0x0f1d('0x8')]||0xa;this[_0x0f1d('0x9')]=_0x5d9ea7[_0x0f1d('0x9')]||'beepall';this['Agents']=_0x5d9ea7[_0x0f1d('0xa')];this[_0x0f1d('0xb')]={};this[_0x0f1d('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0x0f1d('0xd')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x66dffc=this[_0x0f1d('0xb')][_0x0f1d('0xe')];this[_0x0f1d('0xb')]=_['map'](this[_0x0f1d('0xa')],'id');this[_0x0f1d('0xb')]['_rr']=_0x66dffc;};WhatsappQueue[_0x0f1d('0xf')][_0x0f1d('0xd')]=function(){this[_0x0f1d('0x10')]=0x0;this[_0x0f1d('0x11')]=0x0;for(var _0x47a1db=0x0;_0x47a1db=0x0?this[_0x0f1d('0x13')]:0x0;var _0x1e4478={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0f1d('0x10')],'name':this[_0x0f1d('0x7')],'paused':this['paused'],'waiting':this[_0x0f1d('0xc')]};var _0x1f9fa5=md5(JSON[_0x0f1d('0x14')](_0x1e4478));if(this[_0x0f1d('0x1')]!==_0x1f9fa5){this[_0x0f1d('0x1')]=_0x1f9fa5;io['to'](util[_0x0f1d('0x15')]('whatsapp:queue:%s',_0x1e4478[_0x0f1d('0x7')]))[_0x0f1d('0x16')]('whatsapp_queue:save',_0x1e4478);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x5c8e=['length','online','loggedIn','whatsappPause','available','format','emit','whatsapp_queue:save','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','mapAgentsId','prototype','paused'];(function(_0x305c8f,_0xc5f7fb){var _0x5ddc30=function(_0x1aed6f){while(--_0x1aed6f){_0x305c8f['push'](_0x305c8f['shift']());}};_0x5ddc30(++_0xc5f7fb);}(_0x5c8e,0x1d0));var _0xe5c8=function(_0x5994d0,_0x30f90c){_0x5994d0=_0x5994d0-0x0;var _0x4c3258=_0x5c8e[_0x5994d0];return _0x4c3258;};'use strict';var _=require(_0xe5c8('0x0'));var md5=require(_0xe5c8('0x1'));var util=require(_0xe5c8('0x2'));var Redis=require(_0xe5c8('0x3'));var config=require('../../../config/environment');config[_0xe5c8('0x4')]=_['defaults'](config[_0xe5c8('0x4')],{'host':_0xe5c8('0x5'),'port':0x18eb});var io=require(_0xe5c8('0x6'))(new Redis(config[_0xe5c8('0x4')]));function WhatsappQueue(_0x40910b){this['id']=_0x40910b['id']||0x0;this[_0xe5c8('0x7')]=_0x40910b[_0xe5c8('0x7')]||'';this[_0xe5c8('0x8')]=_0x40910b[_0xe5c8('0x8')]||0xa;this[_0xe5c8('0x9')]=_0x40910b[_0xe5c8('0x9')]||'beepall';this[_0xe5c8('0xa')]=_0x40910b[_0xe5c8('0xa')];this['mapAgentsId']={};this[_0xe5c8('0xb')]=0x0;this['md5']='';this[_0xe5c8('0xc')]();this['updateRealtime']();}WhatsappQueue['prototype'][_0xe5c8('0xc')]=function(){var _0xb5f22a=this['mapAgentsId']['_rr'];this[_0xe5c8('0xd')]=_['map'](this[_0xe5c8('0xa')],'id');this[_0xe5c8('0xd')]['_rr']=_0xb5f22a;};WhatsappQueue[_0xe5c8('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xe5c8('0xf')]=0x0;for(var _0x33275e=0x0;_0x33275e=0x0?this['available']:0x0;var _0x58e452={'id':this['id'],'available':this[_0xe5c8('0x14')],'loggedIn':this[_0xe5c8('0x12')],'name':this[_0xe5c8('0x7')],'paused':this['paused'],'waiting':this[_0xe5c8('0xb')]};var _0x253930=md5(JSON['stringify'](_0x58e452));if(this[_0xe5c8('0x1')]!==_0x253930){this[_0xe5c8('0x1')]=_0x253930;io['to'](util[_0xe5c8('0x15')]('whatsapp:queue:%s',_0x58e452[_0xe5c8('0x7')]))[_0xe5c8('0x16')](_0xe5c8('0x17'),_0x58e452);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 27ba542..f1a3327 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 _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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 +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(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 0573840..59a3de4 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 _0x709e=['../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x709e,0x1e3));var _0xe709=function(_0x9eecdb,_0x38264c){_0x9eecdb=_0x9eecdb-0x0;var _0xdf9891=_0x709e[_0x9eecdb];return _0xdf9891;};'use strict';var client=require(_0xe709('0x0'));exports[_0xe709('0x1')]=function(_0x697b48,_0x190dd5){return client[_0xe709('0x2')](_0xe709('0x3'),{'body':_0x190dd5,'options':{'where':{'id':_0x697b48}},'log':_0xe709('0x4')});};exports[_0xe709('0x5')]=function(_0x309c19,_0x466507){return client[_0xe709('0x2')](_0xe709('0x6'),{'body':_0x466507,'options':{'where':{'id':_0x309c19}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x86aa=['Request','UpdateChatInteraction','updateChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x51e4b0,_0xdeaf53){var _0x25d1fd=function(_0x48e235){while(--_0x48e235){_0x51e4b0['push'](_0x51e4b0['shift']());}};_0x25d1fd(++_0xdeaf53);}(_0x86aa,0x9a));var _0xa86a=function(_0x1eb43b,_0x288639){_0x1eb43b=_0x1eb43b-0x0;var _0x51d472=_0x86aa[_0x1eb43b];return _0x51d472;};'use strict';var client=require(_0xa86a('0x0'));exports[_0xa86a('0x1')]=function(_0x18470f,_0x474189){return client[_0xa86a('0x2')](_0xa86a('0x3'),{'body':_0x474189,'options':{'where':{'id':_0x18470f}},'log':_0xa86a('0x4')});};exports['addTags']=function(_0x3492fc,_0x3c550d){return client[_0xa86a('0x2')]('AddTagsToChatInteraction',{'body':_0x3c550d,'options':{'where':{'id':_0x3492fc}},'log':_0xa86a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 4f951a5..317f74c 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 _0x0387=['../client','create','Request','CreateChatMessage'];(function(_0x44e00a,_0x248bbc){var _0x2bdfba=function(_0x5e66c4){while(--_0x5e66c4){_0x44e00a['push'](_0x44e00a['shift']());}};_0x2bdfba(++_0x248bbc);}(_0x0387,0x180));var _0x7038=function(_0x23ece2,_0x234142){_0x23ece2=_0x23ece2-0x0;var _0x327aa8=_0x0387[_0x23ece2];return _0x327aa8;};'use strict';var client=require(_0x7038('0x0'));exports[_0x7038('0x1')]=function(_0x1a1a96){return client[_0x7038('0x2')](_0x7038('0x3'),{'body':_0x1a1a96,'log':'createChatMessage'});}; \ No newline at end of file +var _0xc827=['../client','create','CreateChatMessage','createChatMessage'];(function(_0x4b28d7,_0x3f132c){var _0x5dd58d=function(_0x29905d){while(--_0x29905d){_0x4b28d7['push'](_0x4b28d7['shift']());}};_0x5dd58d(++_0x3f132c);}(_0xc827,0x128));var _0x7c82=function(_0x51677a,_0x33eff7){_0x51677a=_0x51677a-0x0;var _0x24b049=_0xc827[_0x51677a];return _0x24b049;};'use strict';var client=require(_0x7c82('0x0'));exports[_0x7c82('0x1')]=function(_0xce96b7){return client['Request'](_0x7c82('0x2'),{'body':_0xce96b7,'log':_0x7c82('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index bdb1b06..111ab0b 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 _0x0fcd=['getChatQueues','Request','GetChatQueue','name','timeout','strategy','Agents','online','chatPause'];(function(_0x1ee049,_0x554b26){var _0x1643fb=function(_0x25ba1d){while(--_0x25ba1d){_0x1ee049['push'](_0x1ee049['shift']());}};_0x1643fb(++_0x554b26);}(_0x0fcd,0x129));var _0xd0fc=function(_0x520ef4,_0x2254c3){_0x520ef4=_0x520ef4-0x0;var _0x36d395=_0x0fcd[_0x520ef4];return _0x36d395;};'use strict';var client=require('../client');exports[_0xd0fc('0x0')]=function(){return function(){return client[_0xd0fc('0x1')](_0xd0fc('0x2'),{'options':{'raw':![],'attributes':['id',_0xd0fc('0x3'),_0xd0fc('0x4'),_0xd0fc('0x5')],'include':[{'model':'User','as':_0xd0fc('0x6'),'attributes':['id',_0xd0fc('0x3'),_0xd0fc('0x7'),_0xd0fc('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xd493=['timeout','Agents','name','getChatQueues','../client','Request','GetChatQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd493,0x1bd));var _0x3d49=function(_0x1770bc,_0x2cf3b3){_0x1770bc=_0x1770bc-0x0;var _0xed850a=_0xd493[_0x1770bc];return _0xed850a;};'use strict';var client=require(_0x3d49('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x3d49('0x1')](_0x3d49('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3d49('0x3'),'strategy'],'include':[{'model':'User','as':_0x3d49('0x4'),'attributes':['id',_0x3d49('0x5'),'online','chatPause']}]},'log':_0x3d49('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 98f1594..0a811ae 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 _0x6ce9=['CreateChatQueueReport','Request','UpdateChatQueueReport','../client','create'];(function(_0x5c50c2,_0x371a23){var _0x3566e2=function(_0x57f124){while(--_0x57f124){_0x5c50c2['push'](_0x5c50c2['shift']());}};_0x3566e2(++_0x371a23);}(_0x6ce9,0x76));var _0x96ce=function(_0x4c531c,_0x22b7a6){_0x4c531c=_0x4c531c-0x0;var _0x3154b9=_0x6ce9[_0x4c531c];return _0x3154b9;};'use strict';var client=require(_0x96ce('0x0'));exports[_0x96ce('0x1')]=function(_0x1d736b){return client['Request']('CreateChatQueueReport',{'body':_0x1d736b,'log':_0x96ce('0x2')});};exports['update']=function(_0x28a6a3,_0x18a969){return client[_0x96ce('0x3')](_0x96ce('0x4'),{'body':_0x18a969,'options':{'where':{'uniqueid':_0x28a6a3},'order':[['id','DESC']],'limit':0x1},'log':_0x96ce('0x4')});}; \ No newline at end of file +var _0xb575=['Request','UpdateChatQueueReport','DESC','../client','create'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xb575,0xda));var _0x5b57=function(_0x2cc30d,_0x553831){_0x2cc30d=_0x2cc30d-0x0;var _0x172112=_0xb575[_0x2cc30d];return _0x172112;};'use strict';var client=require(_0x5b57('0x0'));exports[_0x5b57('0x1')]=function(_0x577f6b){return client[_0x5b57('0x2')]('CreateChatQueueReport',{'body':_0x577f6b,'log':'CreateChatQueueReport'});};exports['update']=function(_0x3e984f,_0x34ae8e){return client['Request'](_0x5b57('0x3'),{'body':_0x34ae8e,'options':{'where':{'uniqueid':_0x3e984f},'order':[['id',_0x5b57('0x4')]],'limit':0x1},'log':_0x5b57('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 5f979be..2d75fcc 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(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0x7a54,0x106));var _0x47a5=function(_0x525de6,_0x2e8b29){_0x525de6=_0x525de6-0x0;var _0x4ab846=_0x7a54[_0x525de6];return _0x4ab846;};'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(_0x3f8a03,_0x319b9c){var _0x147fb2=function(_0x523c1c){while(--_0x523c1c){_0x3f8a03['push'](_0x3f8a03['shift']());}};_0x147fb2(++_0x319b9c);}(_0x7a54,0x106));var _0x47a5=function(_0x5c35cb,_0x5074f6){_0x5c35cb=_0x5c35cb-0x0;var _0x1a0f10=_0x7a54[_0x5c35cb];return _0x1a0f10;};'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 9a724a2..30b00e6 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 _0x92b3=['Request','CreateFaxMessage','../client','create'];(function(_0x5078b1,_0x5be17f){var _0x1ac481=function(_0x4ca5a7){while(--_0x4ca5a7){_0x5078b1['push'](_0x5078b1['shift']());}};_0x1ac481(++_0x5be17f);}(_0x92b3,0xd2));var _0x392b=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x92b3[_0x491a7f];return _0x3d8f44;};'use strict';var client=require(_0x392b('0x0'));exports[_0x392b('0x1')]=function(_0x34ecc9){return client[_0x392b('0x2')](_0x392b('0x3'),{'body':_0x34ecc9,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x86db=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x21178f,_0xc7e7a5){var _0x52cdfe=function(_0x1da7c4){while(--_0x1da7c4){_0x21178f['push'](_0x21178f['shift']());}};_0x52cdfe(++_0xc7e7a5);}(_0x86db,0x10e));var _0xb86d=function(_0x337216,_0x4184e2){_0x337216=_0x337216-0x0;var _0x113fdb=_0x86db[_0x337216];return _0x113fdb;};'use strict';var client=require(_0xb86d('0x0'));exports[_0xb86d('0x1')]=function(_0x3fdad2){return client[_0xb86d('0x2')](_0xb86d('0x3'),{'body':_0x3fdad2,'log':_0xb86d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index b21fe00..8d13d23 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 _0x9185=['getFaxQueues','Request','name','strategy','User','Agents','faxPause','../client'];(function(_0x571c65,_0x321f37){var _0x563767=function(_0x2e9f2a){while(--_0x2e9f2a){_0x571c65['push'](_0x571c65['shift']());}};_0x563767(++_0x321f37);}(_0x9185,0xef));var _0x5918=function(_0x4a4922,_0x82cb8f){_0x4a4922=_0x4a4922-0x0;var _0x55a8c6=_0x9185[_0x4a4922];return _0x55a8c6;};'use strict';var client=require(_0x5918('0x0'));exports[_0x5918('0x1')]=function(){return function(){return client[_0x5918('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x5918('0x3'),'timeout',_0x5918('0x4')],'include':[{'model':_0x5918('0x5'),'as':_0x5918('0x6'),'attributes':['id',_0x5918('0x3'),'online',_0x5918('0x7')]}]},'log':_0x5918('0x1')});};}; \ No newline at end of file +var _0xee4e=['name','timeout','strategy','User','Agents','faxPause','../client','getFaxQueues'];(function(_0x2e08dc,_0x539e2d){var _0x40c84f=function(_0x339691){while(--_0x339691){_0x2e08dc['push'](_0x2e08dc['shift']());}};_0x40c84f(++_0x539e2d);}(_0xee4e,0xf6));var _0xeee4=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xee4e[_0x2ec461];return _0x28603d;};'use strict';var client=require(_0xeee4('0x0'));exports[_0xeee4('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xeee4('0x2'),_0xeee4('0x3'),_0xeee4('0x4')],'include':[{'model':_0xeee4('0x5'),'as':_0xeee4('0x6'),'attributes':['id',_0xeee4('0x2'),'online',_0xeee4('0x7')]}]},'log':_0xeee4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index df159cc..9b35278 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 _0x2531=['Request','UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport'];(function(_0x276491,_0xa30f49){var _0x4a67a2=function(_0x52115b){while(--_0x52115b){_0x276491['push'](_0x276491['shift']());}};_0x4a67a2(++_0xa30f49);}(_0x2531,0xb1));var _0x1253=function(_0x20293c,_0x19370f){_0x20293c=_0x20293c-0x0;var _0x5553e3=_0x2531[_0x20293c];return _0x5553e3;};'use strict';var client=require(_0x1253('0x0'));exports[_0x1253('0x1')]=function(_0x348933){return client['Request'](_0x1253('0x2'),{'body':_0x348933,'log':_0x1253('0x2')});};exports['update']=function(_0x3dbfdd,_0xab05e7){return client[_0x1253('0x3')](_0x1253('0x4'),{'body':_0xab05e7,'options':{'where':{'uniqueid':_0x3dbfdd},'order':[['id',_0x1253('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xc687=['Request','CreateFaxQueueReport','UpdateFaxQueueReport','../client'];(function(_0x52beb2,_0xaf9dc9){var _0x3f2b2b=function(_0x49e2fe){while(--_0x49e2fe){_0x52beb2['push'](_0x52beb2['shift']());}};_0x3f2b2b(++_0xaf9dc9);}(_0xc687,0x16f));var _0x7c68=function(_0x68c6c9,_0x2d4c79){_0x68c6c9=_0x68c6c9-0x0;var _0xf39b75=_0xc687[_0x68c6c9];return _0xf39b75;};'use strict';var client=require(_0x7c68('0x0'));exports['create']=function(_0x4f1332){return client[_0x7c68('0x1')]('CreateFaxQueueReport',{'body':_0x4f1332,'log':_0x7c68('0x2')});};exports['update']=function(_0x1a829d,_0x1b10d8){return client[_0x7c68('0x1')]('UpdateFaxQueueReport',{'body':_0x1b10d8,'options':{'where':{'uniqueid':_0x1a829d},'order':[['id','DESC']],'limit':0x1},'log':_0x7c68('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f89757d..709e60e 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 _0x17bb=['getIntervals','GetInterval','name','Interval','Intervals','interval','../client'];(function(_0xcc117e,_0x7ebcdb){var _0x468b02=function(_0x14dc0c){while(--_0x14dc0c){_0xcc117e['push'](_0xcc117e['shift']());}};_0x468b02(++_0x7ebcdb);}(_0x17bb,0x84));var _0xb17b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x17bb[_0x2641f9];return _0x585741;};'use strict';var client=require(_0xb17b('0x0'));exports[_0xb17b('0x1')]=function(){return function(){return client['Request'](_0xb17b('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xb17b('0x3')],'include':[{'model':_0xb17b('0x4'),'as':_0xb17b('0x5'),'attributes':['id',_0xb17b('0x3'),_0xb17b('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x7517=['interval','../client','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x1906e0,_0x45a2bf){var _0x5657a6=function(_0x27fa24){while(--_0x27fa24){_0x1906e0['push'](_0x1906e0['shift']());}};_0x5657a6(++_0x45a2bf);}(_0x7517,0x1d9));var _0x7751=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x7517[_0x24061a];return _0x82054e;};'use strict';var client=require(_0x7751('0x0'));exports[_0x7751('0x1')]=function(){return function(){return client[_0x7751('0x2')](_0x7751('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7751('0x4')],'include':[{'model':_0x7751('0x5'),'as':_0x7751('0x6'),'attributes':['id',_0x7751('0x4'),_0x7751('0x7')]}]},'log':_0x7751('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 9f34ee4..399221a 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 _0xdb28=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x5440d3,_0x68412d){var _0x49b20a=function(_0x328c52){while(--_0x328c52){_0x5440d3['push'](_0x5440d3['shift']());}};_0x49b20a(++_0x68412d);}(_0xdb28,0x106));var _0x8db2=function(_0x26cc9d,_0x257cb7){_0x26cc9d=_0x26cc9d-0x0;var _0x371ba5=_0xdb28[_0x26cc9d];return _0x371ba5;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(_0x1dc797,_0xf66e59){return client['Request'](_0x8db2('0x2'),{'body':_0xf66e59,'options':{'where':{'id':_0x1dc797}},'log':_0x8db2('0x3')});};exports[_0x8db2('0x4')]=function(_0x4426fe,_0x11109e){return client['Request'](_0x8db2('0x5'),{'body':_0x11109e,'options':{'where':{'id':_0x4426fe}},'log':_0x8db2('0x6')});}; \ No newline at end of file +var _0x28f2=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x36c3b8,_0x4d066a){var _0x2f37bb=function(_0x12e47d){while(--_0x12e47d){_0x36c3b8['push'](_0x36c3b8['shift']());}};_0x2f37bb(++_0x4d066a);}(_0x28f2,0x193));var _0x228f=function(_0x149c1f,_0x32c7bc){_0x149c1f=_0x149c1f-0x0;var _0x4ab341=_0x28f2[_0x149c1f];return _0x4ab341;};'use strict';var client=require(_0x228f('0x0'));exports[_0x228f('0x1')]=function(_0x108337,_0x2e5e0b){return client[_0x228f('0x2')]('UpdateMailInteraction',{'body':_0x2e5e0b,'options':{'where':{'id':_0x108337}},'log':_0x228f('0x3')});};exports[_0x228f('0x4')]=function(_0x79ed5f,_0x4303c3){return client[_0x228f('0x2')](_0x228f('0x5'),{'body':_0x4303c3,'options':{'where':{'id':_0x79ed5f}},'log':_0x228f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c20ffd7..3d821c1 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 _0x30f9=['../client','create'];(function(_0x53588b,_0x4c0b60){var _0x34537e=function(_0x10af31){while(--_0x10af31){_0x53588b['push'](_0x53588b['shift']());}};_0x34537e(++_0x4c0b60);}(_0x30f9,0x6c));var _0x930f=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x30f9[_0x1da04e];return _0xdd8c41;};'use strict';var client=require(_0x930f('0x0'));exports[_0x930f('0x1')]=function(_0x518ba2){return client['Request']('CreateMailMessage',{'body':_0x518ba2,'log':'createMailMessage'});}; \ No newline at end of file +var _0xcc3c=['createMailMessage','../client','create'];(function(_0x38eb2f,_0x3100d){var _0x3b165f=function(_0x16d834){while(--_0x16d834){_0x38eb2f['push'](_0x38eb2f['shift']());}};_0x3b165f(++_0x3100d);}(_0xcc3c,0x1f0));var _0xccc3=function(_0x2a05a0,_0x1e0ce2){_0x2a05a0=_0x2a05a0-0x0;var _0x3e70ae=_0xcc3c[_0x2a05a0];return _0x3e70ae;};'use strict';var client=require(_0xccc3('0x0'));exports[_0xccc3('0x1')]=function(_0x57b93b){return client['Request']('CreateMailMessage',{'body':_0x57b93b,'log':_0xccc3('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 4cd183d..e326749 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 _0xb885=['strategy','Agents','online','getMailQueues','Request','name','timeout'];(function(_0x3412ba,_0x46fdae){var _0x5ec9b4=function(_0x5ebc10){while(--_0x5ebc10){_0x3412ba['push'](_0x3412ba['shift']());}};_0x5ec9b4(++_0x46fdae);}(_0xb885,0x1d8));var _0x5b88=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0xb885[_0x2a67fe];return _0x57e726;};'use strict';var client=require('../client');exports[_0x5b88('0x0')]=function(){return function(){return client[_0x5b88('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x5b88('0x2'),_0x5b88('0x3'),_0x5b88('0x4')],'include':[{'model':'User','as':_0x5b88('0x5'),'attributes':['id',_0x5b88('0x2'),_0x5b88('0x6'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x4fa0=['GetMailQueue','timeout','strategy','User','name','online','mailPause','../client','getMailQueues','Request'];(function(_0x48271f,_0xc4f6d3){var _0x13eb5c=function(_0x1a4acd){while(--_0x1a4acd){_0x48271f['push'](_0x48271f['shift']());}};_0x13eb5c(++_0xc4f6d3);}(_0x4fa0,0x7f));var _0x04fa=function(_0xd8813a,_0x315766){_0xd8813a=_0xd8813a-0x0;var _0x487db6=_0x4fa0[_0xd8813a];return _0x487db6;};'use strict';var client=require(_0x04fa('0x0'));exports[_0x04fa('0x1')]=function(){return function(){return client[_0x04fa('0x2')](_0x04fa('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x04fa('0x4'),_0x04fa('0x5')],'include':[{'model':_0x04fa('0x6'),'as':'Agents','attributes':['id',_0x04fa('0x7'),_0x04fa('0x8'),_0x04fa('0x9')]}]},'log':_0x04fa('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 97c38b4..a634b61 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 _0x7861=['UpdateMailQueueReport','../client','Request','CreateMailQueueReport','update','DESC'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x7861,0xc7));var _0x1786=function(_0x5786e5,_0x74c262){_0x5786e5=_0x5786e5-0x0;var _0x1cb35b=_0x7861[_0x5786e5];return _0x1cb35b;};'use strict';var client=require(_0x1786('0x0'));exports['create']=function(_0x297e43){return client[_0x1786('0x1')](_0x1786('0x2'),{'body':_0x297e43,'log':_0x1786('0x2')});};exports[_0x1786('0x3')]=function(_0x22dd3b,_0x6709b0){return client['Request']('UpdateMailQueueReport',{'body':_0x6709b0,'options':{'where':{'uniqueid':_0x22dd3b},'order':[['id',_0x1786('0x4')]],'limit':0x1},'log':_0x1786('0x5')});}; \ No newline at end of file +var _0xff76=['DESC','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x3f0bc0,_0x30e570){var _0x1aca4c=function(_0x39cfd8){while(--_0x39cfd8){_0x3f0bc0['push'](_0x3f0bc0['shift']());}};_0x1aca4c(++_0x30e570);}(_0xff76,0x6d));var _0x6ff7=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xff76[_0x1035c1];return _0x308d67;};'use strict';var client=require('../client');exports[_0x6ff7('0x0')]=function(_0xd12a78){return client[_0x6ff7('0x1')](_0x6ff7('0x2'),{'body':_0xd12a78,'log':_0x6ff7('0x2')});};exports[_0x6ff7('0x3')]=function(_0x28b4ce,_0x1b827d){return client['Request'](_0x6ff7('0x4'),{'body':_0x1b827d,'options':{'where':{'uniqueid':_0x28b4ce},'order':[['id',_0x6ff7('0x5')]],'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 d523d49..9dff372 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 _0xfbaf=['Request','UpdateOpenchannelInteraction','addTags','../client','update'];(function(_0x298ffc,_0x47e773){var _0x2f9f91=function(_0x17ec45){while(--_0x17ec45){_0x298ffc['push'](_0x298ffc['shift']());}};_0x2f9f91(++_0x47e773);}(_0xfbaf,0x139));var _0xffba=function(_0x54a8c2,_0x507332){_0x54a8c2=_0x54a8c2-0x0;var _0x12dcac=_0xfbaf[_0x54a8c2];return _0x12dcac;};'use strict';var client=require(_0xffba('0x0'));exports[_0xffba('0x1')]=function(_0xf561c4,_0xb2f584){return client[_0xffba('0x2')](_0xffba('0x3'),{'body':_0xb2f584,'options':{'where':{'id':_0xf561c4}},'log':'updateOpenchannelInteraction'});};exports[_0xffba('0x4')]=function(_0x15d414,_0x4d0e5d){return client[_0xffba('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x4d0e5d,'options':{'where':{'id':_0x15d414}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x1c93=['AddTagsToOpenchannelInteraction','../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request'];(function(_0x11a383,_0x4e05ae){var _0x49f2bb=function(_0x52e0ee){while(--_0x52e0ee){_0x11a383['push'](_0x11a383['shift']());}};_0x49f2bb(++_0x4e05ae);}(_0x1c93,0x16d));var _0x31c9=function(_0x3b7780,_0x2658d3){_0x3b7780=_0x3b7780-0x0;var _0x564678=_0x1c93[_0x3b7780];return _0x564678;};'use strict';var client=require(_0x31c9('0x0'));exports[_0x31c9('0x1')]=function(_0x53b474,_0x25ad23){return client['Request'](_0x31c9('0x2'),{'body':_0x25ad23,'options':{'where':{'id':_0x53b474}},'log':_0x31c9('0x3')});};exports[_0x31c9('0x4')]=function(_0x36061f,_0x42ca93){return client[_0x31c9('0x5')](_0x31c9('0x6'),{'body':_0x42ca93,'options':{'where':{'id':_0x36061f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 96b5675..9501d07 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 _0x5004=['../client','create'];(function(_0x448a99,_0x52bf78){var _0x37864b=function(_0xac9f){while(--_0xac9f){_0x448a99['push'](_0x448a99['shift']());}};_0x37864b(++_0x52bf78);}(_0x5004,0x1ae));var _0x4500=function(_0x2bade4,_0x1f31ee){_0x2bade4=_0x2bade4-0x0;var _0x53007b=_0x5004[_0x2bade4];return _0x53007b;};'use strict';var client=require(_0x4500('0x0'));exports[_0x4500('0x1')]=function(_0xb062d3){return client['Request']('CreateOpenchannelMessage',{'body':_0xb062d3,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x6106=['Request','CreateOpenchannelMessage'];(function(_0x526ab0,_0x4d2b04){var _0x16eb4b=function(_0x336def){while(--_0x336def){_0x526ab0['push'](_0x526ab0['shift']());}};_0x16eb4b(++_0x4d2b04);}(_0x6106,0x1ae));var _0x6610=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x6106[_0x1d24eb];return _0x1dc576;};'use strict';var client=require('../client');exports['create']=function(_0x2bfa34){return client[_0x6610('0x0')](_0x6610('0x1'),{'body':_0x2bfa34,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index d2c9808..f01db6b 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 _0x06c0=['getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','User','Agents','name','online','openchannelPause','../client'];(function(_0x49dd3b,_0x37bcf3){var _0x4dc1c9=function(_0x352e2f){while(--_0x352e2f){_0x49dd3b['push'](_0x49dd3b['shift']());}};_0x4dc1c9(++_0x37bcf3);}(_0x06c0,0x1ad));var _0x006c=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x06c0[_0x311c35];return _0x5cc50c;};'use strict';var client=require(_0x006c('0x0'));exports[_0x006c('0x1')]=function(){return function(){return client[_0x006c('0x2')](_0x006c('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x006c('0x4'),'strategy'],'include':[{'model':_0x006c('0x5'),'as':_0x006c('0x6'),'attributes':['id',_0x006c('0x7'),_0x006c('0x8'),_0x006c('0x9')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xd167=['name','timeout','strategy','User','online','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd167,0xc3));var _0x7d16=function(_0x59ae2c,_0x41b79e){_0x59ae2c=_0x59ae2c-0x0;var _0x4c27ab=_0xd167[_0x59ae2c];return _0x4c27ab;};'use strict';var client=require(_0x7d16('0x0'));exports[_0x7d16('0x1')]=function(){return function(){return client['Request'](_0x7d16('0x2'),{'options':{'raw':![],'attributes':['id',_0x7d16('0x3'),_0x7d16('0x4'),_0x7d16('0x5')],'include':[{'model':_0x7d16('0x6'),'as':'Agents','attributes':['id','name',_0x7d16('0x7'),_0x7d16('0x8')]}]},'log':_0x7d16('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 9f655ee..eab4207 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 _0x6a93=['DESC','UpdateOpenchannelQueueReport','../client','CreateOpenchannelQueueReport','update'];(function(_0x3a7373,_0xb53218){var _0x2ce783=function(_0xe5d98d){while(--_0xe5d98d){_0x3a7373['push'](_0x3a7373['shift']());}};_0x2ce783(++_0xb53218);}(_0x6a93,0x188));var _0x36a9=function(_0x402e14,_0x238581){_0x402e14=_0x402e14-0x0;var _0x5a3bda=_0x6a93[_0x402e14];return _0x5a3bda;};'use strict';var client=require(_0x36a9('0x0'));exports['create']=function(_0x322200){return client['Request'](_0x36a9('0x1'),{'body':_0x322200,'log':_0x36a9('0x1')});};exports[_0x36a9('0x2')]=function(_0x4b78ad,_0x93a67c){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x93a67c,'options':{'where':{'uniqueid':_0x4b78ad},'order':[['id',_0x36a9('0x3')]],'limit':0x1},'log':_0x36a9('0x4')});}; \ No newline at end of file +var _0x2b2a=['UpdateOpenchannelQueueReport','create','CreateOpenchannelQueueReport','DESC'];(function(_0x30b1e1,_0x22c111){var _0x148a80=function(_0x164864){while(--_0x164864){_0x30b1e1['push'](_0x30b1e1['shift']());}};_0x148a80(++_0x22c111);}(_0x2b2a,0x149));var _0xa2b2=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x2b2a[_0x16629d];return _0x56ccee;};'use strict';var client=require('../client');exports[_0xa2b2('0x0')]=function(_0x1f9d32){return client['Request'](_0xa2b2('0x1'),{'body':_0x1f9d32,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x16e996,_0x7c415f){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x7c415f,'options':{'where':{'uniqueid':_0x16e996},'order':[['id',_0xa2b2('0x2')]],'limit':0x1},'log':_0xa2b2('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 02480c4..95fd141 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 _0x39a9=['addTags','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x47408b,_0x3f0c47){var _0x2404ac=function(_0x348265){while(--_0x348265){_0x47408b['push'](_0x47408b['shift']());}};_0x2404ac(++_0x3f0c47);}(_0x39a9,0x1d0));var _0x939a=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x39a9[_0x47568e];return _0x33815b;};'use strict';var client=require(_0x939a('0x0'));exports[_0x939a('0x1')]=function(_0xb72a0,_0x119223){return client[_0x939a('0x2')](_0x939a('0x3'),{'body':_0x119223,'options':{'where':{'id':_0xb72a0}},'log':_0x939a('0x4')});};exports[_0x939a('0x5')]=function(_0x450b95,_0x1030c6){return client[_0x939a('0x2')]('AddTagsToSmsInteraction',{'body':_0x1030c6,'options':{'where':{'id':_0x450b95}},'log':_0x939a('0x6')});}; \ No newline at end of file +var _0xb790=['addTagsToSmsInteraction','update','UpdateSmsInteraction','AddTagsToSmsInteraction'];(function(_0x276341,_0x4ff417){var _0x5f2f4c=function(_0x2eb105){while(--_0x2eb105){_0x276341['push'](_0x276341['shift']());}};_0x5f2f4c(++_0x4ff417);}(_0xb790,0xe5));var _0x0b79=function(_0x5502a7,_0x325618){_0x5502a7=_0x5502a7-0x0;var _0x3946fa=_0xb790[_0x5502a7];return _0x3946fa;};'use strict';var client=require('../client');exports[_0x0b79('0x0')]=function(_0x557e0e,_0x59dbe8){return client['Request'](_0x0b79('0x1'),{'body':_0x59dbe8,'options':{'where':{'id':_0x557e0e}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x2d75b0,_0x30b3fa){return client['Request'](_0x0b79('0x2'),{'body':_0x30b3fa,'options':{'where':{'id':_0x2d75b0}},'log':_0x0b79('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index cd83666..c86305c 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 _0x38d2=['create','Request','CreateSmsMessage','../client'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x38d2,0x67));var _0x238d=function(_0x405292,_0x2ae10a){_0x405292=_0x405292-0x0;var _0xb3c050=_0x38d2[_0x405292];return _0xb3c050;};'use strict';var client=require(_0x238d('0x0'));exports[_0x238d('0x1')]=function(_0x434fd5){return client[_0x238d('0x2')](_0x238d('0x3'),{'body':_0x434fd5,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xf407=['createSmsMessage','create'];(function(_0x23f61f,_0x4e9219){var _0x8ece16=function(_0x4bd29e){while(--_0x4bd29e){_0x23f61f['push'](_0x23f61f['shift']());}};_0x8ece16(++_0x4e9219);}(_0xf407,0xd7));var _0x7f40=function(_0x45d151,_0x422a78){_0x45d151=_0x45d151-0x0;var _0x180a42=_0xf407[_0x45d151];return _0x180a42;};'use strict';var client=require('../client');exports[_0x7f40('0x0')]=function(_0x3ea823){return client['Request']('CreateSmsMessage',{'body':_0x3ea823,'log':_0x7f40('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index aa549a2..f919990 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x2101d3,_0x210818){var _0x3710ab=function(_0x4e16e1){while(--_0x4e16e1){_0x2101d3['push'](_0x2101d3['shift']());}};_0x3710ab(++_0x210818);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0xcb91[_0xbc2974];return _0x3a5b4f;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x211db9,_0x20224e){var _0x54aaf1=function(_0x55116c){while(--_0x55116c){_0x211db9['push'](_0x211db9['shift']());}};_0x54aaf1(++_0x20224e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 4c747a1..21f612a 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(_0x5d2516,_0x30862b){var _0x55cf98=function(_0x46c04f){while(--_0x46c04f){_0x5d2516['push'](_0x5d2516['shift']());}};_0x55cf98(++_0x30862b);}(_0x70e0,0x17b));var _0x070e=function(_0x383d9c,_0x4b83e7){_0x383d9c=_0x383d9c-0x0;var _0x276ea2=_0x70e0[_0x383d9c];return _0x276ea2;};'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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x1b07b7,_0x2552a5){var _0x5bd245=function(_0x4def49){while(--_0x4def49){_0x1b07b7['push'](_0x1b07b7['shift']());}};_0x5bd245(++_0x2552a5);}(_0x34e8,0x12c));var _0x834e=function(_0x300cc7,_0x23eea7){_0x300cc7=_0x300cc7-0x0;var _0x3ea8c8=_0x34e8[_0x300cc7];return _0x3ea8c8;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 8c93d5d..b707fc7 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(_0x34b5d6,_0x2fc8ef){var _0x3fca14=function(_0x36acb8){while(--_0x36acb8){_0x34b5d6['push'](_0x34b5d6['shift']());}};_0x3fca14(++_0x2fc8ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x424a6d,_0x205b32){var _0x97fe=function(_0x4d5600){while(--_0x4d5600){_0x424a6d['push'](_0x424a6d['shift']());}};_0x97fe(++_0x205b32);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 cc673d3..ba1d3f4 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 _0xdf98=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x541557,_0x550d3f){var _0x28bbde=function(_0xf1a092){while(--_0xf1a092){_0x541557['push'](_0x541557['shift']());}};_0x28bbde(++_0x550d3f);}(_0xdf98,0xcf));var _0x8df9=function(_0x2da45d,_0x35397b){_0x2da45d=_0x2da45d-0x0;var _0x1012a0=_0xdf98[_0x2da45d];return _0x1012a0;};'use strict';var client=require(_0x8df9('0x0'));exports['update']=function(_0x1f9abd,_0x4bbb45){return client['Request'](_0x8df9('0x1'),{'body':_0x4bbb45,'options':{'where':{'id':_0x1f9abd}},'log':_0x8df9('0x2')});};exports[_0x8df9('0x3')]=function(_0xeec2ab,_0x3f2ade){return client[_0x8df9('0x4')](_0x8df9('0x5'),{'body':_0x3f2ade,'options':{'where':{'id':_0xeec2ab}},'log':_0x8df9('0x6')});}; \ No newline at end of file +var _0x8ad5=['AddTagsToWhatsappInteraction','../client','update','updateWhatsappInteraction','addTags','Request'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8ad5,0xf1));var _0x58ad=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x8ad5[_0x2bf141];return _0x48277b;};'use strict';var client=require(_0x58ad('0x0'));exports[_0x58ad('0x1')]=function(_0x114e73,_0x263210){return client['Request']('UpdateWhatsappInteraction',{'body':_0x263210,'options':{'where':{'id':_0x114e73}},'log':_0x58ad('0x2')});};exports[_0x58ad('0x3')]=function(_0x223e54,_0x22aba9){return client[_0x58ad('0x4')](_0x58ad('0x5'),{'body':_0x22aba9,'options':{'where':{'id':_0x223e54}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index ae4d0d7..20bec18 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 _0x1de2=['create','Request','createWhatsappMessage'];(function(_0x7d5af1,_0x4ef29a){var _0x26862e=function(_0x3ef67a){while(--_0x3ef67a){_0x7d5af1['push'](_0x7d5af1['shift']());}};_0x26862e(++_0x4ef29a);}(_0x1de2,0xb7));var _0x21de=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0x1de2[_0x483d8b];return _0x6500f1;};'use strict';var client=require('../client');exports[_0x21de('0x0')]=function(_0x3e09cc){return client[_0x21de('0x1')]('CreateWhatsappMessage',{'body':_0x3e09cc,'log':_0x21de('0x2')});}; \ No newline at end of file +var _0xa364=['CreateWhatsappMessage','create','Request'];(function(_0x349b6a,_0x496705){var _0x21097c=function(_0x2aaded){while(--_0x2aaded){_0x349b6a['push'](_0x349b6a['shift']());}};_0x21097c(++_0x496705);}(_0xa364,0xac));var _0x4a36=function(_0x541e9c,_0x336a06){_0x541e9c=_0x541e9c-0x0;var _0x16594c=_0xa364[_0x541e9c];return _0x16594c;};'use strict';var client=require('../client');exports[_0x4a36('0x0')]=function(_0x3d43c7){return client[_0x4a36('0x1')](_0x4a36('0x2'),{'body':_0x3d43c7,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 582c08a..6217d1e 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 _0xb9cf=['whatsappPause','../client','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online'];(function(_0x18f9a1,_0xe74040){var _0x3510c0=function(_0x353f49){while(--_0x353f49){_0x18f9a1['push'](_0x18f9a1['shift']());}};_0x3510c0(++_0xe74040);}(_0xb9cf,0x141));var _0xfb9c=function(_0x21351f,_0x3a745f){_0x21351f=_0x21351f-0x0;var _0x2ae5c1=_0xb9cf[_0x21351f];return _0x2ae5c1;};'use strict';var client=require(_0xfb9c('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xfb9c('0x1')](_0xfb9c('0x2'),{'options':{'raw':![],'attributes':['id',_0xfb9c('0x3'),_0xfb9c('0x4'),_0xfb9c('0x5')],'include':[{'model':_0xfb9c('0x6'),'as':_0xfb9c('0x7'),'attributes':['id',_0xfb9c('0x3'),_0xfb9c('0x8'),_0xfb9c('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x34c5=['getWhatsappQueues','GetWhatsappQueue','name','strategy','User','online','whatsappPause'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0x34c5,0xc4));var _0x534c=function(_0x3ee611,_0x86e651){_0x3ee611=_0x3ee611-0x0;var _0x27a42f=_0x34c5[_0x3ee611];return _0x27a42f;};'use strict';var client=require('../client');exports[_0x534c('0x0')]=function(){return function(){return client['Request'](_0x534c('0x1'),{'options':{'raw':![],'attributes':['id',_0x534c('0x2'),'timeout',_0x534c('0x3')],'include':[{'model':_0x534c('0x4'),'as':'Agents','attributes':['id',_0x534c('0x2'),_0x534c('0x5'),_0x534c('0x6')]}]},'log':_0x534c('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index f9ebd1b..07cb72b 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 _0xf465=['CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0xf465,0x1d1));var _0x5f46=function(_0x502c9b,_0xdaf0b3){_0x502c9b=_0x502c9b-0x0;var _0x344c36=_0xf465[_0x502c9b];return _0x344c36;};'use strict';var client=require(_0x5f46('0x0'));exports[_0x5f46('0x1')]=function(_0x190d4f){return client[_0x5f46('0x2')](_0x5f46('0x3'),{'body':_0x190d4f,'log':_0x5f46('0x3')});};exports['update']=function(_0x441364,_0x59d94f){return client[_0x5f46('0x2')](_0x5f46('0x4'),{'body':_0x59d94f,'options':{'where':{'uniqueid':_0x441364},'order':[['id',_0x5f46('0x5')]],'limit':0x1},'log':_0x5f46('0x4')});}; \ No newline at end of file +var _0x0d92=['DESC','../client','Request','update','UpdateWhatsappQueueReport'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0d92,0x6a));var _0x20d9=function(_0x2c1ec3,_0x391f8b){_0x2c1ec3=_0x2c1ec3-0x0;var _0x2f5a61=_0x0d92[_0x2c1ec3];return _0x2f5a61;};'use strict';var client=require(_0x20d9('0x0'));exports['create']=function(_0xd207c2){return client[_0x20d9('0x1')]('CreateWhatsappQueueReport',{'body':_0xd207c2,'log':'CreateWhatsappQueueReport'});};exports[_0x20d9('0x2')]=function(_0x35689a,_0x583013){return client['Request'](_0x20d9('0x3'),{'body':_0x583013,'options':{'where':{'uniqueid':_0x35689a},'order':[['id',_0x20d9('0x4')]],'limit':0x1},'log':_0x20d9('0x3')});}; \ 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 cf9aeeb..aa6087d 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 _0x5dec=['name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','../../../../config/logger','./strategy','string','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]'];(function(_0x21ec38,_0x3f9660){var _0x48f577=function(_0x3957b4){while(--_0x3957b4){_0x21ec38['push'](_0x21ec38['shift']());}};_0x48f577(++_0x3f9660);}(_0x5dec,0x1e9));var _0xc5de=function(_0x56feee,_0x4d26c7){_0x56feee=_0x56feee-0x0;var _0x554d3e=_0x5dec[_0x56feee];return _0x554d3e;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0xc5de('0x0'))('routing');var strategy=require(_0xc5de('0x1'));var queue=schema({'name':{'type':_0xc5de('0x2'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xc5de('0x3'),'message':_0xc5de('0x4')}});function writeLog(_0x2e4fe9,_0x2028de,_0x190aa0){return logger[_0xc5de('0x5')](util['format'](_0xc5de('0x6'),_0x2e4fe9,_0x2028de[_0xc5de('0x7')],_0x190aa0));}function handleFindAgent(_0x516b1b){return function(_0x1f2e17){return _0x1f2e17[_0xc5de('0x7')][_0xc5de('0x8')]()===_0x516b1b['toLowerCase']();};}exports[_0xc5de('0x9')]=function(_0x301f78,_0x200825,_0x341446,_0x135604){return function(_0x2bca0c){try{var _0x2c0cec={'name':_0x200825[0x0],'timeout':_0x200825[0x1]};var _0xcf7cd4=queue['validate'](_0x2c0cec,{'typecast':!![]});if(_0xcf7cd4[_0xc5de('0xa')]){logger[_0xc5de('0xb')](_0xc5de('0xc'),_0x301f78,_['map'](_0xcf7cd4,_0xc5de('0xd'))[_0xc5de('0xe')](',\x20'));_0x2bca0c[_0xc5de('0xf')]();}else{var _0x2c1e29=_['find'](_0x341446['agents'],handleFindAgent(_0x2c0cec[_0xc5de('0x7')]));if(_0x2c1e29){var _0x4f78bd=(_0x2c0cec[_0xc5de('0x10')]||0xa)*0x3e8;var _0x4f0fe3,_0x2d93ff;var _0x53fb8f=seqqueue[_0xc5de('0x11')](_0x4f78bd);_0x53fb8f['id']=_0x301f78;_0x53fb8f[_0xc5de('0x12')]=_0x4f78bd;_0x53fb8f[_0xc5de('0x13')]=_0x135604['channel'];writeLog(_0x301f78,_0x2c1e29,util['format'](_0xc5de('0x14'),_0x4f78bd));_0x341446[_0xc5de('0x15')][_0x301f78]['on'](_0xc5de('0x16'),function(){logger['info'](_0xc5de('0x17'),_0x301f78);clearTimeout(_0x2d93ff);_0x2d93ff=undefined;_0x53fb8f[_0xc5de('0x18')]();if(_0x341446['rules'][_0x301f78]){delete _0x341446[_0xc5de('0x15')][_0x301f78];}_0x2bca0c['stop']();});_0x341446['rules'][_0x301f78]['on'](_0xc5de('0x19'),function(){if(_0x341446[_0xc5de('0x15')][_0x301f78]){delete _0x341446['rules'][_0x301f78];}});_0x2d93ff=setTimeout(function(){logger[_0xc5de('0x5')](_0xc5de('0x1a'),_0x301f78);clearTimeout(_0x2d93ff);_0x53fb8f[_0xc5de('0x18')]();_0x2bca0c[_0xc5de('0x1b')]();},_0x4f78bd);strategy[_0xc5de('0x1c')](_0x53fb8f,_0x2c1e29,_0x341446,_0x135604);}else{logger['error'](_0xc5de('0x1d'),_0x301f78,_0x2c0cec[_0xc5de('0x7')]);_0x2bca0c[_0xc5de('0xf')]();}}}catch(_0x123c81){console['log'](_0x123c81);logger[_0xc5de('0xb')](_0xc5de('0x1e'),_0x301f78,_0x123c81['stack']);_0x2bca0c[_0xc5de('0xf')]();}};}; \ No newline at end of file +var _0x7114=['lodash','util','seq-queue','../../../../config/logger','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','name','timeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate'];(function(_0xd9b610,_0x4b6b38){var _0x380873=function(_0x19ed74){while(--_0x19ed74){_0xd9b610['push'](_0xd9b610['shift']());}};_0x380873(++_0x4b6b38);}(_0x7114,0xd1));var _0x4711=function(_0x27b1ba,_0xb77706){_0x27b1ba=_0x27b1ba-0x0;var _0x3493eb=_0x7114[_0x27b1ba];return _0x3493eb;};'use strict';var schema=require(_0x4711('0x0'));var _=require(_0x4711('0x1'));var util=require(_0x4711('0x2'));var seqqueue=require(_0x4711('0x3'));var logger=require(_0x4711('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x4711('0x5'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x4d1f03,_0x54eae7,_0xde98c9){return logger[_0x4711('0x6')](util[_0x4711('0x7')](_0x4711('0x8'),_0x4d1f03,_0x54eae7['name'],_0xde98c9));}function handleFindAgent(_0x9b2b2a){return function(_0x1109b6){return _0x1109b6['name'][_0x4711('0x9')]()===_0x9b2b2a[_0x4711('0x9')]();};}exports[_0x4711('0xa')]=function(_0x49070b,_0x2b6eb6,_0x2fcd7e,_0x55bf61){return function(_0x3a9c2b){try{var _0x41da5d={'name':_0x2b6eb6[0x0],'timeout':_0x2b6eb6[0x1]};var _0x334a82=queue[_0x4711('0x0')](_0x41da5d,{'typecast':!![]});if(_0x334a82['length']){logger[_0x4711('0xb')](_0x4711('0xc'),_0x49070b,_[_0x4711('0xd')](_0x334a82,_0x4711('0xe'))[_0x4711('0xf')](',\x20'));_0x3a9c2b[_0x4711('0x10')]();}else{var _0x64a17b=_[_0x4711('0x11')](_0x2fcd7e[_0x4711('0x12')],handleFindAgent(_0x41da5d[_0x4711('0x13')]));if(_0x64a17b){var _0x4e1e34=(_0x41da5d[_0x4711('0x14')]||0xa)*0x3e8;var _0x3a4981,_0x4ede31;var _0x71b871=seqqueue['createQueue'](_0x4e1e34);_0x71b871['id']=_0x49070b;_0x71b871['atimeout']=_0x4e1e34;_0x71b871[_0x4711('0x15')]=_0x55bf61[_0x4711('0x15')];writeLog(_0x49070b,_0x64a17b,util[_0x4711('0x7')](_0x4711('0x16'),_0x4e1e34));_0x2fcd7e[_0x4711('0x17')][_0x49070b]['on'](_0x4711('0x18'),function(){logger[_0x4711('0x6')](_0x4711('0x19'),_0x49070b);clearTimeout(_0x4ede31);_0x4ede31=undefined;_0x71b871[_0x4711('0x1a')]();if(_0x2fcd7e[_0x4711('0x17')][_0x49070b]){delete _0x2fcd7e[_0x4711('0x17')][_0x49070b];}_0x3a9c2b['stop']();});_0x2fcd7e[_0x4711('0x17')][_0x49070b]['on'](_0x4711('0x1b'),function(){if(_0x2fcd7e[_0x4711('0x17')][_0x49070b]){delete _0x2fcd7e[_0x4711('0x17')][_0x49070b];}});_0x4ede31=setTimeout(function(){logger[_0x4711('0x6')](_0x4711('0x1c'),_0x49070b);clearTimeout(_0x4ede31);_0x71b871['close']();_0x3a9c2b[_0x4711('0x1d')]();},_0x4e1e34);strategy[_0x4711('0x1e')](_0x71b871,_0x64a17b,_0x2fcd7e,_0x55bf61);}else{logger[_0x4711('0xb')](_0x4711('0x1f'),_0x49070b,_0x41da5d[_0x4711('0x13')]);_0x3a9c2b[_0x4711('0x10')]();}}}catch(_0x38fbde){console[_0x4711('0x20')](_0x38fbde);logger[_0x4711('0xb')](_0x4711('0x21'),_0x49070b,_0x38fbde[_0x4711('0x22')]);_0x3a9c2b['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 488b01a..695a371 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 _0xb0a2=['channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','create','[%s][AMAZONLEX]\x20%s','catch','error','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','Message','then','dialogState','Failed','lodash','moment','aws-sdk','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0xb0a2,0xec));var _0x2b0a=function(_0x2f6cd7,_0x5ae901){_0x2f6cd7=_0x2f6cd7-0x0;var _0x4383a4=_0xb0a2[_0x2f6cd7];return _0x4383a4;};'use strict';var _=require(_0x2b0a('0x0'));var moment=require(_0x2b0a('0x1'));var AWS=require(_0x2b0a('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x2b0a('0x3'));var rpc={'chatMessage':require(_0x2b0a('0x4')),'openchannelMessage':require(_0x2b0a('0x5')),'mailMessage':require(_0x2b0a('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2b0a('0x7')),'whatsappMessage':require(_0x2b0a('0x8'))};exports['consequence']=function(_0x4397bf,_0x29741d){return function(_0x4e5d13){try{if(!_[_0x2b0a('0x9')](this[_0x2b0a('0xa')][_0x2b0a('0xb')])){logger[_0x2b0a('0xc')]('[%s][AMAZONLEX]\x20%s',_0x4397bf,_0x2b0a('0xd'));return _0x4e5d13[_0x2b0a('0xe')]();}var _0xaf20db={'ContactId':this[_0x2b0a('0xf')]['id'],'sentAt':moment()[_0x2b0a('0x10')](_0x2b0a('0x11')),'direction':_0x2b0a('0x12')};if(this[_0x2b0a('0x13')]===_0x2b0a('0x14')||this['channel']==='whatsapp'){_0xaf20db[_0x2b0a('0x15')]=this[_0x2b0a('0xa')][_0x2b0a('0x15')];}var _0x24abc8=this[_0x2b0a('0x13')];if(_0x24abc8===_0x2b0a('0x16')){_0xaf20db[_0x2b0a('0x17')]=this[_0x2b0a('0x18')]['id'];}else{_0xaf20db[_['upperFirst'](_0x24abc8)+'AccountId']=this[_0x2b0a('0x18')]['id'];}_0xaf20db[_[_0x2b0a('0x19')](_0x24abc8)+_0x2b0a('0x1a')]=this[_0x2b0a('0xa')]['id'];if(this[_0x2b0a('0xa')]['created']){var _0xe5f3d6=_0x29741d[0x4];if(!_[_0x2b0a('0x1b')](_0xe5f3d6)){_0xaf20db[_0x2b0a('0x1c')]=utils[_0x2b0a('0x1d')](_0xe5f3d6,this);return rpc[_0x24abc8+'Message'][_0x2b0a('0x1e')](_0xaf20db)['then'](function(_0x3298ef){logger[_0x2b0a('0xc')](_0x2b0a('0x1f'),_0x4397bf,_0xaf20db['body']);})[_0x2b0a('0x20')](function(_0x3cef24){logger[_0x2b0a('0x21')](_0x2b0a('0x1f'),_0x4397bf,JSON[_0x2b0a('0x22')](_0x3cef24));})[_0x2b0a('0x23')](function(){logger[_0x2b0a('0xc')](_0x2b0a('0x24'),_0x4397bf);_0x4e5d13[_0x2b0a('0x25')]();});}else{logger['info'](_0x2b0a('0x26'),_0x4397bf);_0x4e5d13[_0x2b0a('0x25')]();}}else{var _0x4ca728=this;var _0x350ef0=new AWS[(_0x2b0a('0x27'))]({'accessKeyId':_0x29741d[0x0],'secretAccessKey':_0x29741d[0x1],'region':_0x29741d[0x2]});var _0x4716be={'botAlias':_0x2b0a('0x28'),'botName':_0x29741d[0x3],'inputText':this[_0x2b0a('0x29')][_0x2b0a('0x1c')],'userId':this[_0x2b0a('0x13')]+':'+this['interaction']['id'][_0x2b0a('0x2a')]()};_0x350ef0[_0x2b0a('0x2b')](_0x4716be,function(_0x5d1072,_0x46c640){if(_0x5d1072){logger[_0x2b0a('0x21')](_0x2b0a('0x1f'),_0x4397bf,_0x5d1072[_0x2b0a('0x29')]);_0x4e5d13['next']();}else if(_0x46c640&&_0x46c640[_0x2b0a('0x29')]){_0x4ca728[_0x2b0a('0x1c')][_0x2b0a('0x2c')]=_0x46c640;_0xaf20db[_0x2b0a('0x1c')]=_0x46c640[_0x2b0a('0x29')];_0xaf20db[_0x2b0a('0x2d')]=_0x2b0a('0x2c');_0xaf20db[_0x2b0a('0x2e')]=JSON[_0x2b0a('0x22')](_0x46c640);return rpc[_0x24abc8+_0x2b0a('0x2f')][_0x2b0a('0x1e')](_0xaf20db)[_0x2b0a('0x30')](function(_0x573545){logger[_0x2b0a('0xc')](_0x2b0a('0x1f'),_0x4397bf,_0xaf20db[_0x2b0a('0x1c')]);if(_0x46c640[_0x2b0a('0x31')]==_0x2b0a('0x32')){_0x4e5d13[_0x2b0a('0xe')]();}else{_0x4e5d13[_0x2b0a('0x25')]();}})['catch'](function(_0x1586e7){logger[_0x2b0a('0x21')](_0x2b0a('0x1f'),_0x4397bf,JSON[_0x2b0a('0x22')](_0x1586e7));_0x4e5d13['next']();});}else{_0x4e5d13[_0x2b0a('0xe')]();}});}}catch(_0x513851){logger[_0x2b0a('0x21')](_0x2b0a('0x1f'),_0x4397bf,JSON[_0x2b0a('0x22')](_0x513851));_0x4e5d13[_0x2b0a('0x25')]();}};}; \ No newline at end of file +var _0xe4ed=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','channel','sms','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','stringify','dialogState','error','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x2c2838,_0x334032){var _0x24899a=function(_0x1a6b48){while(--_0x1a6b48){_0x2c2838['push'](_0x2c2838['shift']());}};_0x24899a(++_0x334032);}(_0xe4ed,0x192));var _0xde4e=function(_0x4de389,_0x1defd4){_0x4de389=_0x4de389-0x0;var _0x58aa68=_0xe4ed[_0x4de389];return _0x58aa68;};'use strict';var _=require(_0xde4e('0x0'));var moment=require(_0xde4e('0x1'));var AWS=require('aws-sdk');var utils=require(_0xde4e('0x2'));var logger=require(_0xde4e('0x3'))(_0xde4e('0x4'));var rpc={'chatMessage':require(_0xde4e('0x5')),'openchannelMessage':require(_0xde4e('0x6')),'mailMessage':require(_0xde4e('0x7')),'smsMessage':require(_0xde4e('0x8')),'faxMessage':require(_0xde4e('0x9')),'whatsappMessage':require(_0xde4e('0xa'))};exports[_0xde4e('0xb')]=function(_0x1c02b6,_0x274351){return function(_0x3b78bd){try{if(!_[_0xde4e('0xc')](this[_0xde4e('0xd')]['UserId'])){logger[_0xde4e('0xe')]('[%s][AMAZONLEX]\x20%s',_0x1c02b6,_0xde4e('0xf'));return _0x3b78bd['next']();}var _0x193227={'ContactId':this[_0xde4e('0x10')]['id'],'sentAt':moment()[_0xde4e('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xde4e('0x12')]===_0xde4e('0x13')||this['channel']==='whatsapp'){_0x193227[_0xde4e('0x14')]=this[_0xde4e('0xd')][_0xde4e('0x14')];}var _0x44cc8e=this[_0xde4e('0x12')];if(_0x44cc8e===_0xde4e('0x15')){_0x193227[_0xde4e('0x16')]=this['account']['id'];}else{_0x193227[_[_0xde4e('0x17')](_0x44cc8e)+_0xde4e('0x18')]=this[_0xde4e('0x19')]['id'];}_0x193227[_['upperFirst'](_0x44cc8e)+_0xde4e('0x1a')]=this['interaction']['id'];if(this[_0xde4e('0xd')][_0xde4e('0x1b')]){var _0x4c0b17=_0x274351[0x4];if(!_['isEmpty'](_0x4c0b17)){_0x193227[_0xde4e('0x1c')]=utils[_0xde4e('0x1d')](_0x4c0b17,this);return rpc[_0x44cc8e+_0xde4e('0x1e')][_0xde4e('0x1f')](_0x193227)[_0xde4e('0x20')](function(_0x1f73ed){logger[_0xde4e('0xe')](_0xde4e('0x21'),_0x1c02b6,_0x193227[_0xde4e('0x1c')]);})[_0xde4e('0x22')](function(_0x352b0f){logger['error'](_0xde4e('0x21'),_0x1c02b6,JSON['stringify'](_0x352b0f));})[_0xde4e('0x23')](function(){logger[_0xde4e('0xe')](_0xde4e('0x24'),_0x1c02b6);_0x3b78bd[_0xde4e('0x25')]();});}else{logger[_0xde4e('0xe')](_0xde4e('0x26'),_0x1c02b6);_0x3b78bd[_0xde4e('0x25')]();}}else{var _0x52aa81=this;var _0x5187e2=new AWS[(_0xde4e('0x27'))]({'accessKeyId':_0x274351[0x0],'secretAccessKey':_0x274351[0x1],'region':_0x274351[0x2]});var _0x2d71d2={'botAlias':_0xde4e('0x28'),'botName':_0x274351[0x3],'inputText':this[_0xde4e('0x29')][_0xde4e('0x1c')],'userId':this['channel']+':'+this[_0xde4e('0xd')]['id'][_0xde4e('0x2a')]()};_0x5187e2[_0xde4e('0x2b')](_0x2d71d2,function(_0x30c85b,_0x2c46cc){if(_0x30c85b){logger['error']('[%s][AMAZONLEX]\x20%s',_0x1c02b6,_0x30c85b['message']);_0x3b78bd[_0xde4e('0x2c')]();}else if(_0x2c46cc&&_0x2c46cc[_0xde4e('0x29')]){_0x52aa81['body'][_0xde4e('0x2d')]=_0x2c46cc;_0x193227[_0xde4e('0x1c')]=_0x2c46cc[_0xde4e('0x29')];_0x193227[_0xde4e('0x2e')]='amazonlex';_0x193227[_0xde4e('0x2f')]=JSON[_0xde4e('0x30')](_0x2c46cc);return rpc[_0x44cc8e+_0xde4e('0x1e')][_0xde4e('0x1f')](_0x193227)[_0xde4e('0x20')](function(_0x25bfc1){logger[_0xde4e('0xe')](_0xde4e('0x21'),_0x1c02b6,_0x193227[_0xde4e('0x1c')]);if(_0x2c46cc[_0xde4e('0x31')]=='Failed'){_0x3b78bd[_0xde4e('0x2c')]();}else{_0x3b78bd[_0xde4e('0x25')]();}})['catch'](function(_0x61c467){logger[_0xde4e('0x32')](_0xde4e('0x21'),_0x1c02b6,JSON[_0xde4e('0x30')](_0x61c467));_0x3b78bd['next']();});}else{_0x3b78bd[_0xde4e('0x2c')]();}});}}catch(_0x456994){logger[_0xde4e('0x32')](_0xde4e('0x21'),_0x1c02b6,JSON['stringify'](_0x456994));_0x3b78bd[_0xde4e('0x25')]();}};}; \ 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 d19c0d2..7d8eaf8 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 _0xfe86=['../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','out','body','getMustacheRender','message','phone','subject','startsWith','Re:','ChatWebsiteId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','','auto-replied','All','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','[%s][AUTOREPLY]\x20%s','finally','resolve','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage'];(function(_0x2165e3,_0x438638){var _0x3f7bd0=function(_0x329b40){while(--_0x329b40){_0x2165e3['push'](_0x2165e3['shift']());}};_0x3f7bd0(++_0x438638);}(_0xfe86,0xd3));var _0x6fe8=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xfe86[_0xe15270];return _0x1e813b;};'use strict';var _=require(_0x6fe8('0x0'));var moment=require(_0x6fe8('0x1'));var utils=require(_0x6fe8('0x2'));var logger=require(_0x6fe8('0x3'))(_0x6fe8('0x4'));var rpc={'chatMessage':require(_0x6fe8('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6fe8('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x6fe8('0x7')),'chatInteraction':require(_0x6fe8('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x6fe8('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x6fe8('0xa')),'whatsappInteraction':require(_0x6fe8('0xb'))};var mailRpc=require(_0x6fe8('0xc'));exports[_0x6fe8('0xd')]=function(_0x3be10b,_0x46e3a1,_0x5bc4a1,_0x22798b){return function(_0x5562c9){try{var _0x4c9d2d=this[_0x6fe8('0xe')];if(_0x4c9d2d===_0x6fe8('0xf')&&_0x22798b['body'][_0x6fe8('0x10')]){logger[_0x6fe8('0x11')]('[%s][AUTOREPLY]\x20%s',_0x3be10b,_0x6fe8('0x12'));return _0x5562c9[_0x6fe8('0x13')]();}if(_0x46e3a1[0x0]==='1'&&(_['isNil'](this[_0x6fe8('0x14')][_0x6fe8('0x15')])||!this[_0x6fe8('0x14')]['created'])){logger[_0x6fe8('0x11')]('[%s][AUTOREPLY]\x20%s',_0x3be10b,_0x6fe8('0x16'));return _0x5562c9[_0x6fe8('0x13')]();}if(_0x46e3a1[0x0]==='2'&&this['interaction'][_0x6fe8('0x17')]){logger[_0x6fe8('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3be10b,_0x6fe8('0x18'));return _0x5562c9[_0x6fe8('0x13')]();}var _0x5b60a4={'ContactId':this[_0x6fe8('0x19')]['id'],'sentAt':moment()[_0x6fe8('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x6fe8('0x1b')};if(this[_0x6fe8('0xe')]===_0x6fe8('0xf')){_0x5b60a4['body']=utils['getMustacheRender'](_0x46e3a1[0x2],this);}else{_0x5b60a4[_0x6fe8('0x1c')]=utils[_0x6fe8('0x1d')](_0x46e3a1[0x1],this);}if(this['message']){_0x5b60a4['to']=this['message']['from']||'';if(this[_0x6fe8('0xe')]==='mail'&&_0x46e3a1[0x1]==='1'){_0x5b60a4['cc']=this[_0x6fe8('0x1e')]['cc']||'';}_0x5b60a4['from']=this[_0x6fe8('0x1e')]['to']||'';_0x5b60a4[_0x6fe8('0x1f')]=this['message'][_0x6fe8('0x1f')]||'';_0x5b60a4['read']=!![];if(this['message'][_0x6fe8('0x20')]){_0x5b60a4[_0x6fe8('0x20')]='';_0x5b60a4['subject']+=_[_0x6fe8('0x21')](this['message'][_0x6fe8('0x20')],_0x6fe8('0x22'))?'':'Re:\x20';_0x5b60a4['subject']+=this[_0x6fe8('0x1e')][_0x6fe8('0x20')];}}if(this['channel']==='chat'){_0x5b60a4[_0x6fe8('0x23')]=this[_0x6fe8('0x24')]['id'];}else{_0x5b60a4[_[_0x6fe8('0x25')](this[_0x6fe8('0xe')])+'AccountId']=this['account']['id'];}_0x5b60a4[_[_0x6fe8('0x25')](this['channel'])+_0x6fe8('0x26')]=this[_0x6fe8('0x14')]['id'];var _0x48a392=this[_0x6fe8('0x14')];if(rpc[this['channel']+_0x6fe8('0x27')]){if(this[_0x6fe8('0xe')]==='mail'){var _0x2e1a77={'tls':{'rejectUnauthorized':![]}};if(this[_0x6fe8('0x24')][_0x6fe8('0x28')]['service']){_0x2e1a77[_0x6fe8('0x29')]=this[_0x6fe8('0x24')][_0x6fe8('0x28')][_0x6fe8('0x29')];}else{_0x2e1a77[_0x6fe8('0x2a')]=this['account'][_0x6fe8('0x28')][_0x6fe8('0x2a')];_0x2e1a77[_0x6fe8('0x2b')]=this[_0x6fe8('0x24')]['Smtp'][_0x6fe8('0x2b')];_0x2e1a77[_0x6fe8('0x2c')]=this[_0x6fe8('0x24')][_0x6fe8('0x28')]['secure'];}if(this[_0x6fe8('0x24')][_0x6fe8('0x28')]['authentication']){_0x2e1a77[_0x6fe8('0x2d')]={'user':this[_0x6fe8('0x24')][_0x6fe8('0x28')][_0x6fe8('0x2e')],'pass':this[_0x6fe8('0x24')][_0x6fe8('0x28')][_0x6fe8('0x2f')]};}_0x5b60a4[_0x6fe8('0x30')]=this[_0x6fe8('0x1e')][_0x6fe8('0x31')];_0x5b60a4[_0x6fe8('0x32')]=_0x6fe8('0x33')+_['replace'](_0x5b60a4[_0x6fe8('0x1c')],_0x6fe8('0x34'),_0x6fe8('0x35'))+_0x6fe8('0x36');_0x5b60a4['headers']={'Auto-Submitted':_0x6fe8('0x37'),'X-Auto-Response-Suppress':_0x6fe8('0x38'),'Precedence':_0x6fe8('0x39')};return mailRpc['sendMailMessage'](_0x2e1a77,_0x5b60a4)[_0x6fe8('0x3a')](function(_0x5653d6){logger[_0x6fe8('0x11')](_0x6fe8('0x3b'),_0x3be10b);_0x5b60a4[_0x6fe8('0x31')]=_0x5653d6['message']['messageId'];return rpc[_0x4c9d2d+_0x6fe8('0x27')][_0x6fe8('0x3c')](_0x5b60a4);})['then'](function(_0x539bc3){logger[_0x6fe8('0x11')]('[%s][AUTOREPLY]\x20%s',_0x3be10b,JSON[_0x6fe8('0x3d')](_0x539bc3));})[_0x6fe8('0x3e')](function(_0x2f2f5c){logger[_0x6fe8('0x3f')](_0x6fe8('0x40'),_0x3be10b,JSON[_0x6fe8('0x3d')](_0x2f2f5c));})['finally'](function(){Promise['resolve']()['then'](function(){if(_0x46e3a1[0x0]!=='2'||_0x48a392[_0x6fe8('0x17')])return;return rpc[_0x4c9d2d+_0x6fe8('0x41')][_0x6fe8('0x42')](_0x48a392['id'],{'autoreplyExecuted':!![]})[_0x6fe8('0x3a')](function(_0x139d53){logger[_0x6fe8('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3be10b,JSON[_0x6fe8('0x3d')](_0x139d53));})['catch'](function(_0x271205){logger['error'](_0x6fe8('0x43'),_0x3be10b,JSON['stringify'](_0x271205));});})[_0x6fe8('0x3a')](function(){_0x5562c9[_0x6fe8('0x13')]();});});}else{return rpc[this[_0x6fe8('0xe')]+'Message']['create'](_0x5b60a4)[_0x6fe8('0x3a')](function(_0x1b9d84){logger[_0x6fe8('0x11')](_0x6fe8('0x44'),_0x3be10b,_0x5b60a4[_0x6fe8('0x1c')]);})[_0x6fe8('0x3e')](function(_0xa29bf2){logger['error'](_0x6fe8('0x44'),_0x3be10b,JSON[_0x6fe8('0x3d')](_0xa29bf2));})[_0x6fe8('0x45')](function(){Promise[_0x6fe8('0x46')]()[_0x6fe8('0x3a')](function(){if(_0x46e3a1[0x0]!=='2'||_0x48a392['autoreplyExecuted'])return;return rpc[_0x4c9d2d+_0x6fe8('0x41')][_0x6fe8('0x42')](_0x48a392['id'],{'autoreplyExecuted':!![]})[_0x6fe8('0x3a')](function(_0x443336){logger[_0x6fe8('0x11')](_0x6fe8('0x47'),_0x3be10b,JSON[_0x6fe8('0x3d')](_0x443336));})[_0x6fe8('0x3e')](function(_0x14071c){logger['error'](_0x6fe8('0x43'),_0x3be10b,JSON[_0x6fe8('0x3d')](_0x14071c));});})['then'](function(){_0x5562c9['next']();});});}}}catch(_0xbffe30){logger[_0x6fe8('0x3f')]('[%s][AUTOREPLY]\x20%s',_0x3be10b,JSON[_0x6fe8('0x3d')](_0xbffe30));_0x5562c9[_0x6fe8('0x48')]();}};}; \ No newline at end of file +var _0xbc62=['chat','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','messageId','html','','replace','','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','then','Interaction','update','catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','body','getMustacheRender','message','from','phone','subject','Re:','Re:\x20'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xbc62,0x19b));var _0x2bc6=function(_0x278187,_0x1ba09f){_0x278187=_0x278187-0x0;var _0x11cb85=_0xbc62[_0x278187];return _0x11cb85;};'use strict';var _=require(_0x2bc6('0x0'));var moment=require(_0x2bc6('0x1'));var utils=require('./utils');var logger=require(_0x2bc6('0x2'))('routing');var rpc={'chatMessage':require(_0x2bc6('0x3')),'openchannelMessage':require(_0x2bc6('0x4')),'mailMessage':require(_0x2bc6('0x5')),'smsMessage':require(_0x2bc6('0x6')),'faxMessage':require(_0x2bc6('0x7')),'whatsappMessage':require(_0x2bc6('0x8')),'chatInteraction':require(_0x2bc6('0x9')),'openchannelInteraction':require(_0x2bc6('0xa')),'mailInteraction':require(_0x2bc6('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x2bc6('0xc')),'whatsappInteraction':require(_0x2bc6('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x2bc6('0xe')]=function(_0x110b74,_0x343e3b,_0x10e119,_0x5d8f67){return function(_0x5a8d79){try{var _0x3b3df6=this[_0x2bc6('0xf')];if(_0x3b3df6===_0x2bc6('0x10')&&_0x5d8f67['body'][_0x2bc6('0x11')]){logger[_0x2bc6('0x12')]('[%s][AUTOREPLY]\x20%s',_0x110b74,_0x2bc6('0x13'));return _0x5a8d79[_0x2bc6('0x14')]();}if(_0x343e3b[0x0]==='1'&&(_[_0x2bc6('0x15')](this[_0x2bc6('0x16')][_0x2bc6('0x17')])||!this[_0x2bc6('0x16')][_0x2bc6('0x17')])){logger['info'](_0x2bc6('0x18'),_0x110b74,'Autoreply\x20already\x20sent');return _0x5a8d79['next']();}if(_0x343e3b[0x0]==='2'&&this[_0x2bc6('0x16')][_0x2bc6('0x19')]){logger[_0x2bc6('0x12')](_0x2bc6('0x1a'),_0x110b74,_0x2bc6('0x1b'));return _0x5a8d79[_0x2bc6('0x14')]();}var _0xa67f45={'ContactId':this[_0x2bc6('0x1c')]['id'],'sentAt':moment()[_0x2bc6('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2bc6('0x1e')};if(this[_0x2bc6('0xf')]==='mail'){_0xa67f45[_0x2bc6('0x1f')]=utils['getMustacheRender'](_0x343e3b[0x2],this);}else{_0xa67f45[_0x2bc6('0x1f')]=utils[_0x2bc6('0x20')](_0x343e3b[0x1],this);}if(this[_0x2bc6('0x21')]){_0xa67f45['to']=this[_0x2bc6('0x21')]['from']||'';if(this[_0x2bc6('0xf')]===_0x2bc6('0x10')&&_0x343e3b[0x1]==='1'){_0xa67f45['cc']=this[_0x2bc6('0x21')]['cc']||'';}_0xa67f45[_0x2bc6('0x22')]=this['message']['to']||'';_0xa67f45[_0x2bc6('0x23')]=this[_0x2bc6('0x21')][_0x2bc6('0x23')]||'';_0xa67f45['read']=!![];if(this[_0x2bc6('0x21')][_0x2bc6('0x24')]){_0xa67f45[_0x2bc6('0x24')]='';_0xa67f45[_0x2bc6('0x24')]+=_['startsWith'](this[_0x2bc6('0x21')][_0x2bc6('0x24')],_0x2bc6('0x25'))?'':_0x2bc6('0x26');_0xa67f45[_0x2bc6('0x24')]+=this['message'][_0x2bc6('0x24')];}}if(this[_0x2bc6('0xf')]===_0x2bc6('0x27')){_0xa67f45['ChatWebsiteId']=this[_0x2bc6('0x28')]['id'];}else{_0xa67f45[_[_0x2bc6('0x29')](this[_0x2bc6('0xf')])+_0x2bc6('0x2a')]=this[_0x2bc6('0x28')]['id'];}_0xa67f45[_[_0x2bc6('0x29')](this[_0x2bc6('0xf')])+_0x2bc6('0x2b')]=this[_0x2bc6('0x16')]['id'];var _0x902f67=this[_0x2bc6('0x16')];if(rpc[this[_0x2bc6('0xf')]+_0x2bc6('0x2c')]){if(this[_0x2bc6('0xf')]==='mail'){var _0x233be7={'tls':{'rejectUnauthorized':![]}};if(this[_0x2bc6('0x28')][_0x2bc6('0x2d')]['service']){_0x233be7[_0x2bc6('0x2e')]=this['account'][_0x2bc6('0x2d')][_0x2bc6('0x2e')];}else{_0x233be7[_0x2bc6('0x2f')]=this[_0x2bc6('0x28')][_0x2bc6('0x2d')]['host'];_0x233be7['port']=this[_0x2bc6('0x28')][_0x2bc6('0x2d')][_0x2bc6('0x30')];_0x233be7[_0x2bc6('0x31')]=this[_0x2bc6('0x28')]['Smtp'][_0x2bc6('0x31')];}if(this[_0x2bc6('0x28')]['Smtp'][_0x2bc6('0x32')]){_0x233be7[_0x2bc6('0x33')]={'user':this[_0x2bc6('0x28')][_0x2bc6('0x2d')][_0x2bc6('0x34')],'pass':this['account'][_0x2bc6('0x2d')][_0x2bc6('0x35')]};}_0xa67f45['inReplyTo']=this[_0x2bc6('0x21')][_0x2bc6('0x36')];_0xa67f45[_0x2bc6('0x37')]=_0x2bc6('0x38')+_[_0x2bc6('0x39')](_0xa67f45['body'],']+(>|$)/g,''),'priorityTrue':_0x2825d0[0x1],'priorityFalse':_0x2825d0[0x2]};var _0x5b99e9=gotoif[_0x8bb3('0x0')](_0x4d7fb7,{'typecast':!![]});if(_0x5b99e9['length']){logger[_0x8bb3('0xb')](_0x8bb3('0xc'),_0x599993,_['map'](_0x5b99e9,_0x8bb3('0xd'))['join'](',\x20'));_0x9b0f0e[_0x8bb3('0xe')]();}else{try{var _0x116ef1=eval('('+_0x4d7fb7[_0x8bb3('0xf')]+')');var _0x13b30b=_0x116ef1?_0x4d7fb7[_0x8bb3('0x10')]:_0x4d7fb7[_0x8bb3('0x11')];logger[_0x8bb3('0x12')](_0x8bb3('0x13'),_0x599993,_0x4d7fb7['condition'],_0x116ef1,_0x13b30b||'next');if(_0x13b30b){var _0x41e59f=_['findIndex'](_0x9b0f0e[_0x8bb3('0x14')](),{'p':_0x13b30b});if(_0x41e59f>=0x0){logger[_0x8bb3('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x599993,_0x13b30b||'next',_0x41e59f);_0x9b0f0e[_0x8bb3('0x15')](_0x41e59f);}else{logger[_0x8bb3('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x599993,_0x13b30b||'next');_0x9b0f0e['stop']();}}else{_0x9b0f0e[_0x8bb3('0x15')]();}}catch(_0x1922d8){logger['error'](_0x8bb3('0x16'),_0x599993,_0x1922d8[_0x8bb3('0xd')]);_0x9b0f0e[_0x8bb3('0xe')]();}}}catch(_0x1abdca){logger[_0x8bb3('0xb')]('[%s][GOTOIF]\x20%s',_0x599993,JSON[_0x8bb3('0x17')](_0x1abdca));_0x9b0f0e[_0x8bb3('0xe')]();}};}; \ No newline at end of file +var _0x7d0b=['stringify','validate','lodash','routing','string','number','priority\x20true\x20is\x20a\x20number','error','[%s][GOTOIF]\x20%s','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x7d0b,0x166));var _0xb7d0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7d0b[_0x4b369d];return _0x571a98;};'use strict';var schema=require(_0xb7d0('0x0'));var _=require(_0xb7d0('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require('../../../../config/logger')(_0xb7d0('0x2'));var gotoif=schema({'condition':{'type':_0xb7d0('0x3'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xb7d0('0x4'),'message':_0xb7d0('0x5')},'priorityFalse':{'type':_0xb7d0('0x4'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x2e92b5,_0x3b62da){return function(_0x59891f){try{var _0x14b672={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x3b62da[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3b62da[0x1],'priorityFalse':_0x3b62da[0x2]};var _0x433c04=gotoif[_0xb7d0('0x0')](_0x14b672,{'typecast':!![]});if(_0x433c04['length']){logger[_0xb7d0('0x6')](_0xb7d0('0x7'),_0x2e92b5,_['map'](_0x433c04,_0xb7d0('0x8'))['join'](',\x20'));_0x59891f[_0xb7d0('0x9')]();}else{try{var _0x2a7cc3=eval('('+_0x14b672[_0xb7d0('0xa')]+')');var _0x3c3a1d=_0x2a7cc3?_0x14b672[_0xb7d0('0xb')]:_0x14b672[_0xb7d0('0xc')];logger[_0xb7d0('0xd')](_0xb7d0('0xe'),_0x2e92b5,_0x14b672['condition'],_0x2a7cc3,_0x3c3a1d||_0xb7d0('0xf'));if(_0x3c3a1d){var _0x4dfbb4=_['findIndex'](_0x59891f[_0xb7d0('0x10')](),{'p':_0x3c3a1d});if(_0x4dfbb4>=0x0){logger[_0xb7d0('0xd')](_0xb7d0('0x11'),_0x2e92b5,_0x3c3a1d||_0xb7d0('0xf'),_0x4dfbb4);_0x59891f[_0xb7d0('0xf')](_0x4dfbb4);}else{logger['info'](_0xb7d0('0x12'),_0x2e92b5,_0x3c3a1d||'next');_0x59891f[_0xb7d0('0x9')]();}}else{_0x59891f[_0xb7d0('0xf')]();}}catch(_0x4f2abe){logger[_0xb7d0('0x6')](_0xb7d0('0x13'),_0x2e92b5,_0x4f2abe['message']);_0x59891f[_0xb7d0('0x9')]();}}}catch(_0x38b9eb){logger[_0xb7d0('0x6')](_0xb7d0('0x7'),_0x2e92b5,JSON[_0xb7d0('0x14')](_0x38b9eb));_0x59891f[_0xb7d0('0x9')]();}};}; \ 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 8c9ca36..5e6851a 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 _0x2e61=['message','join','stop','info','priority','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','number','consequence','length','error','[%s][GOTOP]\x20%s','map'];(function(_0x1b69a4,_0x3e9f5f){var _0x4ab6a6=function(_0x33697){while(--_0x33697){_0x1b69a4['push'](_0x1b69a4['shift']());}};_0x4ab6a6(++_0x3e9f5f);}(_0x2e61,0x1af));var _0x12e6=function(_0x2f1f14,_0x4c266b){_0x2f1f14=_0x2f1f14-0x0;var _0x2e81ba=_0x2e61[_0x2f1f14];return _0x2e81ba;};'use strict';var schema=require(_0x12e6('0x0'));var _=require(_0x12e6('0x1'));var logger=require(_0x12e6('0x2'))('routing');var gotop=schema({'priority':{'type':_0x12e6('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x12e6('0x4')]=function(_0x462242,_0x7e86f2){return function(_0x2e3792){try{var _0x5db9e9={'priority':_0x7e86f2[0x0]};var _0x42fecd=gotop[_0x12e6('0x0')](_0x5db9e9,{'typecast':!![]});if(_0x42fecd[_0x12e6('0x5')]){logger[_0x12e6('0x6')](_0x12e6('0x7'),_0x462242,_[_0x12e6('0x8')](_0x42fecd,_0x12e6('0x9'))[_0x12e6('0xa')](',\x20'));_0x2e3792[_0x12e6('0xb')]();}else{logger[_0x12e6('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x462242,_0x5db9e9[_0x12e6('0xd')]);if(_0x5db9e9[_0x12e6('0xd')]){var _0x32c538=_[_0x12e6('0xe')](_0x2e3792[_0x12e6('0xf')](),{'p':_0x5db9e9[_0x12e6('0xd')]});if(_0x32c538>=0x0){logger[_0x12e6('0xc')](_0x12e6('0x10'),_0x462242,_0x5db9e9[_0x12e6('0xd')]||'next',_0x32c538);_0x2e3792[_0x12e6('0x11')](_0x32c538);}else{logger['info'](_0x12e6('0x12'),_0x462242,_0x5db9e9['priority']||_0x12e6('0x11'));_0x2e3792[_0x12e6('0xb')]();}}else{_0x2e3792[_0x12e6('0x11')]();}}}catch(_0x2c315a){logger[_0x12e6('0x6')](_0x12e6('0x7'),_0x462242,JSON[_0x12e6('0x13')](_0x2c315a));_0x2e3792[_0x12e6('0xb')]();}};}; \ No newline at end of file +var _0xc528=['join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%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','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message'];(function(_0x14ead9,_0x410058){var _0x17bfe6=function(_0x419379){while(--_0x419379){_0x14ead9['push'](_0x14ead9['shift']());}};_0x17bfe6(++_0x410058);}(_0xc528,0xc3));var _0x8c52=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc528[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require(_0x8c52('0x0'));var _=require(_0x8c52('0x1'));var logger=require(_0x8c52('0x2'))(_0x8c52('0x3'));var gotop=schema({'priority':{'type':_0x8c52('0x4'),'required':!![],'message':_0x8c52('0x5')}});exports[_0x8c52('0x6')]=function(_0x4664c9,_0x53ed50){return function(_0x3f9c01){try{var _0x80c39e={'priority':_0x53ed50[0x0]};var _0xc91ec2=gotop[_0x8c52('0x0')](_0x80c39e,{'typecast':!![]});if(_0xc91ec2[_0x8c52('0x7')]){logger[_0x8c52('0x8')](_0x8c52('0x9'),_0x4664c9,_[_0x8c52('0xa')](_0xc91ec2,_0x8c52('0xb'))[_0x8c52('0xc')](',\x20'));_0x3f9c01[_0x8c52('0xd')]();}else{logger['info'](_0x8c52('0xe'),_0x4664c9,_0x80c39e[_0x8c52('0xf')]);if(_0x80c39e['priority']){var _0x22a55b=_[_0x8c52('0x10')](_0x3f9c01[_0x8c52('0x11')](),{'p':_0x80c39e[_0x8c52('0xf')]});if(_0x22a55b>=0x0){logger[_0x8c52('0x12')](_0x8c52('0x13'),_0x4664c9,_0x80c39e[_0x8c52('0xf')]||_0x8c52('0x14'),_0x22a55b);_0x3f9c01[_0x8c52('0x14')](_0x22a55b);}else{logger['info'](_0x8c52('0x15'),_0x4664c9,_0x80c39e['priority']||_0x8c52('0x14'));_0x3f9c01[_0x8c52('0xd')]();}}else{_0x3f9c01[_0x8c52('0x14')]();}}}catch(_0x421399){logger[_0x8c52('0x8')]('[%s][GOTOP]\x20%s',_0x4664c9,JSON[_0x8c52('0x16')](_0x421399));_0x3f9c01[_0x8c52('0xd')]();}};}; \ 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 26c213c..f7daae8 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 _0xa896=['info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create'];(function(_0x11f997,_0x2a4fb2){var _0x193fa0=function(_0x58b205){while(--_0x58b205){_0x11f997['push'](_0x11f997['shift']());}};_0x193fa0(++_0x2a4fb2);}(_0xa896,0xe0));var _0x6a89=function(_0x138c5c,_0x52b12b){_0x138c5c=_0x138c5c-0x0;var _0x27a56b=_0xa896[_0x138c5c];return _0x27a56b;};'use strict';var _=require(_0x6a89('0x0'));var utils=require(_0x6a89('0x1'));var logger=require('../../../../config/logger')(_0x6a89('0x2'));var rpc={'chatMessage':require(_0x6a89('0x3')),'openchannelMessage':require(_0x6a89('0x4')),'mailMessage':require(_0x6a89('0x5')),'smsMessage':require(_0x6a89('0x6')),'faxMessage':require(_0x6a89('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x27a06c,_0x44495b){return function(_0x107439){try{var _0x12159a={'body':utils['getMustacheRender'](_0x44495b[0x0],this),'ContactId':this[_0x6a89('0x8')]['id']};if(this[_0x6a89('0x9')]===_0x6a89('0xa')){_0x12159a[_0x6a89('0xb')]=this[_0x6a89('0xc')]['id'];}else{_0x12159a[_[_0x6a89('0xd')](this[_0x6a89('0x9')])+_0x6a89('0xe')]=this[_0x6a89('0xc')]['id'];}_0x12159a[_['upperFirst'](this[_0x6a89('0x9')])+_0x6a89('0xf')]=this[_0x6a89('0x10')]['id'];if(rpc[this[_0x6a89('0x9')]+'Message']){return rpc[this[_0x6a89('0x9')]+_0x6a89('0x11')][_0x6a89('0x12')](_0x12159a)['then'](function(_0x5dbef6){logger[_0x6a89('0x13')](_0x6a89('0x14'),_0x27a06c,_0x12159a[_0x6a89('0x15')]);_0x107439[_0x6a89('0x16')]();})[_0x6a89('0x17')](function(_0x25b0d8){logger[_0x6a89('0x18')](_0x6a89('0x14'),_0x27a06c,JSON[_0x6a89('0x19')](_0x25b0d8));_0x107439[_0x6a89('0x1a')]();});}}catch(_0x1622f5){logger[_0x6a89('0x18')](_0x6a89('0x14'),_0x27a06c,JSON[_0x6a89('0x19')](_0x1622f5));_0x107439[_0x6a89('0x1a')]();}};}; \ No newline at end of file +var _0x21c9=['lodash','./utils','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','interaction','Message','create','then','info','next','catch','error','[%s][MESSAGE]\x20%s','stop'];(function(_0x2e616e,_0x42f760){var _0x5d3228=function(_0x1d1344){while(--_0x1d1344){_0x2e616e['push'](_0x2e616e['shift']());}};_0x5d3228(++_0x42f760);}(_0x21c9,0x19e));var _0x921c=function(_0x7cf6dc,_0x57e665){_0x7cf6dc=_0x7cf6dc-0x0;var _0x2f0153=_0x21c9[_0x7cf6dc];return _0x2f0153;};'use strict';var _=require(_0x921c('0x0'));var utils=require(_0x921c('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x921c('0x2')),'smsMessage':require(_0x921c('0x3')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x921c('0x4'))};exports[_0x921c('0x5')]=function(_0x1e6f48,_0x21cd81){return function(_0x4f7c16){try{var _0x1b0c84={'body':utils[_0x921c('0x6')](_0x21cd81[0x0],this),'ContactId':this['contact']['id']};if(this[_0x921c('0x7')]===_0x921c('0x8')){_0x1b0c84[_0x921c('0x9')]=this['account']['id'];}else{_0x1b0c84[_[_0x921c('0xa')](this['channel'])+_0x921c('0xb')]=this[_0x921c('0xc')]['id'];}_0x1b0c84[_[_0x921c('0xa')](this['channel'])+'InteractionId']=this[_0x921c('0xd')]['id'];if(rpc[this[_0x921c('0x7')]+_0x921c('0xe')]){return rpc[this[_0x921c('0x7')]+_0x921c('0xe')][_0x921c('0xf')](_0x1b0c84)[_0x921c('0x10')](function(_0x27c911){logger[_0x921c('0x11')]('[%s][MESSAGE]\x20%s',_0x1e6f48,_0x1b0c84['body']);_0x4f7c16[_0x921c('0x12')]();})[_0x921c('0x13')](function(_0x3844f4){logger[_0x921c('0x14')](_0x921c('0x15'),_0x1e6f48,JSON['stringify'](_0x3844f4));_0x4f7c16[_0x921c('0x16')]();});}}catch(_0xe10db5){logger['error'](_0x921c('0x15'),_0x1e6f48,JSON['stringify'](_0xe10db5));_0x4f7c16[_0x921c('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 f6aca96..76ed33a 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 _0xfe08=['next','stop','./utils','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfe08,0x7a));var _0x8fe0=function(_0x25bf94,_0x420e7e){_0x25bf94=_0x25bf94-0x0;var _0x24065b=_0xfe08[_0x25bf94];return _0x24065b;};'use strict';var utils=require(_0x8fe0('0x0'));var logger=require('../../../../config/logger')(_0x8fe0('0x1'));exports[_0x8fe0('0x2')]=function(_0x6031f6,_0x41a709){return function(_0x23c974){try{logger[_0x8fe0('0x3')](_0x8fe0('0x4'),_0x6031f6,utils[_0x8fe0('0x5')](_0x41a709[0x0],this));_0x23c974[_0x8fe0('0x6')]();}catch(_0x54a88){logger['error'](_0x8fe0('0x4'),_0x6031f6,JSON['stringify'](_0x54a88));_0x23c974[_0x8fe0('0x7')]();}};}; \ No newline at end of file +var _0xcb59=['next','error','[%s][NOOP]\x20%s','./utils','../../../../config/logger','routing','consequence','info','getMustacheRender'];(function(_0x4de5ea,_0x5d2f59){var _0x31a498=function(_0x54b6e1){while(--_0x54b6e1){_0x4de5ea['push'](_0x4de5ea['shift']());}};_0x31a498(++_0x5d2f59);}(_0xcb59,0x1a1));var _0x9cb5=function(_0x12a929,_0x2277e1){_0x12a929=_0x12a929-0x0;var _0xa6a4b=_0xcb59[_0x12a929];return _0xa6a4b;};'use strict';var utils=require(_0x9cb5('0x0'));var logger=require(_0x9cb5('0x1'))(_0x9cb5('0x2'));exports[_0x9cb5('0x3')]=function(_0x384060,_0xab7914){return function(_0x38e103){try{logger[_0x9cb5('0x4')]('[%s][NOOP]\x20%s',_0x384060,utils[_0x9cb5('0x5')](_0xab7914[0x0],this));_0x38e103[_0x9cb5('0x6')]();}catch(_0x426b9f){logger[_0x9cb5('0x7')](_0x9cb5('0x8'),_0x384060,JSON['stringify'](_0x426b9f));_0x38e103['stop']();}};}; \ 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 b1a284a..452a720 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 _0x2e97=['InteractionId','interaction','MessageId','message','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','update','catch','timeout','[%s][END:QUEUE][NAME:%s]','body','update\x20queue\x20report','toLowerCase','validate','length','[%s][QUEUE]\x20%s','join','find','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','lodash','seq-queue','../../../../config/logger','./strategy','defaults','localhost','redis','account','from','emit','clone','queue_id','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','upperFirst','channel'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x2e97,0x13d));var _0x72e9=function(_0xaf52f9,_0x3608bc){_0xaf52f9=_0xaf52f9-0x0;var _0xd9e03e=_0x2e97[_0xaf52f9];return _0xd9e03e;};'use strict';var schema=require('validate');var _=require(_0x72e9('0x0'));var util=require('util');var seqqueue=require(_0x72e9('0x1'));var moment=require('moment');var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x72e9('0x2'))('routing');var strategy=require(_0x72e9('0x3'));config['redis']=_[_0x72e9('0x4')](config['redis'],{'host':_0x72e9('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x72e9('0x6')]));var attributes=['id','queue_id',_0x72e9('0x7'),'queue',_0x72e9('0x8'),'joinAt'];function emit(_0x3a90c4,_0x1fce67,_0x3d7bee){io['to'](_0x3a90c4)[_0x72e9('0x9')](_0x1fce67,_0x3d7bee);}function emitChannelQueueInteraction(_0x29f8da,_0x29c718,_0x307424,_0x3ae193,_0x2773e2,_0x1216bc,_0x354d76,_0x2757c0){var _0x56601e=_[_0x72e9('0xa')](_0x307424);_0x56601e[_0x72e9('0xb')]=_0x2757c0;_0x56601e[_0x72e9('0xc')]=_0x29c718;_0x56601e[_0x72e9('0x7')]=_0x3ae193;_0x56601e['id']=_0x2773e2;if(_0x1216bc){_0x354d76[util[_0x72e9('0xd')](_0x72e9('0xe'),_0x29f8da)][_0x2773e2]=_[_0x72e9('0xf')](_0x56601e,attributes);}else{delete _0x354d76[util[_0x72e9('0xd')](_0x72e9('0xe'),_0x29f8da)][_0x2773e2];}emit(util[_0x72e9('0xd')](_0x72e9('0x10'),_0x29f8da,_0x29c718),util[_0x72e9('0xd')]('%s_queue_waiting_interaction:%s',_0x29f8da,_0x1216bc?_0x72e9('0x11'):'remove'),_[_0x72e9('0xf')](_0x56601e,attributes));}var rpc={'openchannelQueueReport':require(_0x72e9('0x12')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x72e9('0x13')),'smsQueueReport':require(_0x72e9('0x14')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x72e9('0x15'))};var queue=schema({'name':{'type':_0x72e9('0x16'),'required':!![],'message':_0x72e9('0x17')},'timeout':{'type':_0x72e9('0x18'),'message':_0x72e9('0x19')}});function startRouting(_0x399da7,_0x9d09c1,_0x34e5c0,_0x15d0ff){if(_0x399da7&&_0x9d09c1&&_0x34e5c0){_0x9d09c1[_0x72e9('0x1a')]+=0x1;var _0xba29fa={'uniqueid':_0x399da7,'from':_0x34e5c0['body']?_0x34e5c0['body']['from']:'','joinAt':moment()['format'](_0x72e9('0x1b')),'ContactId':_0x34e5c0[_0x72e9('0x1c')]?_0x34e5c0[_0x72e9('0x1c')]['id']:null,'ListId':_0x34e5c0[_0x72e9('0x1d')]?_0x34e5c0[_0x72e9('0x1d')]['id']:null};_0xba29fa[_['upperFirst'](_0x34e5c0['channel'])+_0x72e9('0x1e')]=_0x9d09c1['id']||null;_0xba29fa[_[_0x72e9('0x1f')](_0x34e5c0[_0x72e9('0x20')])+_0x72e9('0x21')]=_0x34e5c0['interaction']?_0x34e5c0[_0x72e9('0x22')]['id']:null;_0xba29fa[_['upperFirst'](_0x34e5c0['channel'])+_0x72e9('0x23')]=_0x34e5c0[_0x72e9('0x24')]?_0x34e5c0['message']['id']:null;_0xba29fa[_[_0x72e9('0x1f')](_0x34e5c0[_0x72e9('0x20')])+(_0x34e5c0[_0x72e9('0x20')]!=='chat'?'AccountId':_0x72e9('0x25'))]=_0x34e5c0[_0x72e9('0x7')]?_0x34e5c0['account']['id']:null;logger[_0x72e9('0x26')](util[_0x72e9('0xd')](_0x72e9('0x27'),_0x399da7,_0x9d09c1['name']));emitChannelQueueInteraction(_0x34e5c0[_0x72e9('0x20')],_0x9d09c1[_0x72e9('0x28')],_0xba29fa,_0x34e5c0['account'][_0x72e9('0x28')],_0x34e5c0[_0x72e9('0x24')]['id'],!![],_0x15d0ff,_0x9d09c1['id']);if(rpc[_0x34e5c0[_0x72e9('0x20')]+_0x72e9('0x29')]){return rpc[_0x34e5c0[_0x72e9('0x20')]+_0x72e9('0x29')][_0x72e9('0x2a')](_0xba29fa)['catch'](function(_0x165327){logger[_0x72e9('0x2b')](_0x72e9('0x2c'));});}}}function stopRouting(_0x29420b,_0x3f8e0d,_0x3fe8a2,_0x54fa3e){if(_0x29420b&&_0x3f8e0d){_0x3f8e0d[_0x72e9('0x1a')]-=0x1;var _0x1b6a37={'leaveAt':moment()[_0x72e9('0xd')](_0x72e9('0x1b')),'acceptAt':moment()[_0x72e9('0xd')](_0x72e9('0x1b')),'reason':_0x72e9('0x2d')};logger['info'](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x29420b,_0x3f8e0d['name']));emitChannelQueueInteraction(_0x3fe8a2[_0x72e9('0x20')],_0x3f8e0d['name'],_0x3fe8a2['body'],_0x3fe8a2['account']['name'],_0x3fe8a2[_0x72e9('0x24')]['id'],![],_0x54fa3e,_0x3f8e0d['id']);if(rpc[_0x3fe8a2[_0x72e9('0x20')]+_0x72e9('0x29')]){return rpc[_0x3fe8a2[_0x72e9('0x20')]+_0x72e9('0x29')][_0x72e9('0x2e')](_0x29420b,_0x1b6a37)[_0x72e9('0x2f')](function(_0x244026){logger[_0x72e9('0x2b')]('update\x20queue\x20report');});}}}function endRouting(_0x586709,_0x5e10de,_0x23299c,_0x123e8d){if(_0x586709&&_0x5e10de){_0x5e10de[_0x72e9('0x1a')]-=0x1;var _0x3ae9ea={'leaveAt':moment()[_0x72e9('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x72e9('0xd')](_0x72e9('0x1b')),'reason':_0x72e9('0x30')};logger[_0x72e9('0x26')](util[_0x72e9('0xd')](_0x72e9('0x31'),_0x586709,_0x5e10de[_0x72e9('0x28')]));emitChannelQueueInteraction(_0x23299c[_0x72e9('0x20')],_0x5e10de['name'],_0x23299c[_0x72e9('0x32')],_0x23299c['account'][_0x72e9('0x28')],_0x23299c[_0x72e9('0x24')]['id'],![],_0x123e8d);if(rpc[_0x23299c['channel']+'QueueReport']){return rpc[_0x23299c['channel']+'QueueReport'][_0x72e9('0x2e')](_0x586709,_0x3ae9ea)[_0x72e9('0x2f')](function(_0x3fbb77){logger['error'](_0x72e9('0x33'));});}}}function handleFindQueue(_0x1470e7){return function(_0x315233){return _0x315233[_0x72e9('0x28')][_0x72e9('0x34')]()===_0x1470e7[_0x72e9('0x34')]();};}exports['consequence']=function(_0x445e15,_0x1f3a36,_0x22e022,_0x5eb9e7){return function(_0x950ef7){try{var _0x2814fe={'name':_0x1f3a36[0x0],'timeout':_0x1f3a36[0x1]};var _0x23f59b=queue[_0x72e9('0x35')](_0x2814fe,{'typecast':!![]});if(_0x23f59b[_0x72e9('0x36')]){logger[_0x72e9('0x2b')](_0x72e9('0x37'),_0x445e15,_['map'](_0x23f59b,_0x72e9('0x24'))[_0x72e9('0x38')](',\x20'));_0x950ef7['stop']();}else{var _0x20eea9=_[_0x72e9('0x39')](_0x22e022[_0x5eb9e7[_0x72e9('0x20')]+'Queues'],handleFindQueue(_0x2814fe['name']));if(_0x20eea9){startRouting(_0x445e15,_0x20eea9,_0x5eb9e7,_0x22e022);var _0x428433=(_0x20eea9[_0x72e9('0x30')]||0xa)*0x3e8;var _0x3bd9dd=(_0x2814fe[_0x72e9('0x30')]||0x14)*0x3e8;var _0x19f486,_0x35375c;if(_0x428433>_0x3bd9dd){_0x3bd9dd=_0x428433;}var _0x69bf8e=seqqueue[_0x72e9('0x3a')](_0x428433);_0x69bf8e['id']=_0x445e15;_0x69bf8e['atimeout']=_0x428433;_0x69bf8e[_0x72e9('0x3b')]=_0x3bd9dd;_0x69bf8e['channel']=_0x5eb9e7[_0x72e9('0x20')];_0x22e022[_0x72e9('0x3c')][_0x445e15]['on'](_0x72e9('0x3d'),function(){logger[_0x72e9('0x26')](_0x72e9('0x3e'),_0x445e15);stopRouting(_0x445e15,_0x20eea9,_0x5eb9e7,_0x22e022);clearTimeout(_0x19f486);_0x19f486=undefined;_0x69bf8e[_0x72e9('0x3f')](!![]);if(_0x22e022[_0x72e9('0x3c')][_0x445e15]){delete _0x22e022[_0x72e9('0x3c')][_0x445e15];}_0x950ef7[_0x72e9('0x40')]();});_0x22e022['rules'][_0x445e15]['on'](_0x72e9('0x41'),function(){if(_0x22e022[_0x72e9('0x3c')][_0x445e15]){delete _0x22e022[_0x72e9('0x3c')][_0x445e15];}});_0x19f486=setTimeout(function(){logger[_0x72e9('0x26')](_0x72e9('0x42'),_0x445e15);endRouting(_0x445e15,_0x20eea9,_0x5eb9e7,_0x22e022);clearTimeout(_0x19f486);_0x69bf8e['close'](!![]);_0x950ef7['next']();},_0x3bd9dd);switch(_0x20eea9[_0x72e9('0x43')]){case'rrmemory':strategy[_0x72e9('0x44')](_0x69bf8e,_0x20eea9,_0x22e022,_0x5eb9e7);break;default:strategy[_0x72e9('0x45')](_0x69bf8e,_0x20eea9,_0x22e022,_0x5eb9e7);}}else{logger[_0x72e9('0x2b')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x445e15,_0x2814fe['name']);_0x950ef7[_0x72e9('0x40')]();}}}catch(_0xc3baf6){console['log'](_0xc3baf6);logger[_0x72e9('0x2b')](_0x72e9('0x37'),_0x445e15,_0xc3baf6['stack']);_0x950ef7[_0x72e9('0x40')]();}};}; \ No newline at end of file +var _0x0fda=['beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','util','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','MessageId','message','AccountId','account','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','waiting','accepted','update','timeout','info','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','join','stop','Queues','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory'];(function(_0x54f945,_0x432453){var _0x239c4a=function(_0x1366ca){while(--_0x1366ca){_0x54f945['push'](_0x54f945['shift']());}};_0x239c4a(++_0x432453);}(_0x0fda,0x96));var _0xa0fd=function(_0x222c17,_0x4df58a){_0x222c17=_0x222c17-0x0;var _0x58f211=_0x0fda[_0x222c17];return _0x58f211;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xa0fd('0x0'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xa0fd('0x1'));var config=require(_0xa0fd('0x2'));var logger=require(_0xa0fd('0x3'))(_0xa0fd('0x4'));var strategy=require('./strategy');config[_0xa0fd('0x5')]=_[_0xa0fd('0x6')](config['redis'],{'host':_0xa0fd('0x7'),'port':0x18eb});var io=require(_0xa0fd('0x8'))(new Redis(config[_0xa0fd('0x5')]));var attributes=['id',_0xa0fd('0x9'),'account',_0xa0fd('0xa'),_0xa0fd('0xb'),_0xa0fd('0xc')];function emit(_0x5b38a9,_0x4376a5,_0x71955c){io['to'](_0x5b38a9)[_0xa0fd('0xd')](_0x4376a5,_0x71955c);}function emitChannelQueueInteraction(_0x118e61,_0x5b4607,_0xcb4834,_0x3632f3,_0x3f07c8,_0x279918,_0x44fbd9,_0x22772a){var _0x497995=_[_0xa0fd('0xe')](_0xcb4834);_0x497995[_0xa0fd('0x9')]=_0x22772a;_0x497995[_0xa0fd('0xa')]=_0x5b4607;_0x497995['account']=_0x3632f3;_0x497995['id']=_0x3f07c8;if(_0x279918){_0x44fbd9[util[_0xa0fd('0xf')](_0xa0fd('0x10'),_0x118e61)][_0x3f07c8]=_[_0xa0fd('0x11')](_0x497995,attributes);}else{delete _0x44fbd9[util['format'](_0xa0fd('0x10'),_0x118e61)][_0x3f07c8];}emit(util[_0xa0fd('0xf')](_0xa0fd('0x12'),_0x118e61,_0x5b4607),util['format'](_0xa0fd('0x13'),_0x118e61,_0x279918?'save':_0xa0fd('0x14')),_[_0xa0fd('0x11')](_0x497995,attributes));}var rpc={'openchannelQueueReport':require(_0xa0fd('0x15')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xa0fd('0x16')),'faxQueueReport':require(_0xa0fd('0x17')),'whatsappQueueReport':require(_0xa0fd('0x18'))};var queue=schema({'name':{'type':_0xa0fd('0x19'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xa0fd('0x1a')}});function startRouting(_0xe5fc2d,_0x364438,_0x402e75,_0x13912e){if(_0xe5fc2d&&_0x364438&&_0x402e75){_0x364438['waiting']+=0x1;var _0x1cca79={'uniqueid':_0xe5fc2d,'from':_0x402e75['body']?_0x402e75[_0xa0fd('0x1b')]['from']:'','joinAt':moment()[_0xa0fd('0xf')](_0xa0fd('0x1c')),'ContactId':_0x402e75[_0xa0fd('0x1d')]?_0x402e75['contact']['id']:null,'ListId':_0x402e75[_0xa0fd('0x1e')]?_0x402e75[_0xa0fd('0x1e')]['id']:null};_0x1cca79[_[_0xa0fd('0x1f')](_0x402e75[_0xa0fd('0x20')])+'QueueId']=_0x364438['id']||null;_0x1cca79[_[_0xa0fd('0x1f')](_0x402e75[_0xa0fd('0x20')])+'InteractionId']=_0x402e75[_0xa0fd('0x21')]?_0x402e75[_0xa0fd('0x21')]['id']:null;_0x1cca79[_['upperFirst'](_0x402e75[_0xa0fd('0x20')])+_0xa0fd('0x22')]=_0x402e75[_0xa0fd('0x23')]?_0x402e75[_0xa0fd('0x23')]['id']:null;_0x1cca79[_[_0xa0fd('0x1f')](_0x402e75['channel'])+(_0x402e75[_0xa0fd('0x20')]!=='chat'?_0xa0fd('0x24'):'WebsiteId')]=_0x402e75[_0xa0fd('0x25')]?_0x402e75[_0xa0fd('0x25')]['id']:null;logger['info'](util['format'](_0xa0fd('0x26'),_0xe5fc2d,_0x364438['name']));emitChannelQueueInteraction(_0x402e75['channel'],_0x364438[_0xa0fd('0x27')],_0x1cca79,_0x402e75[_0xa0fd('0x25')]['name'],_0x402e75[_0xa0fd('0x23')]['id'],!![],_0x13912e,_0x364438['id']);if(rpc[_0x402e75[_0xa0fd('0x20')]+_0xa0fd('0x28')]){return rpc[_0x402e75[_0xa0fd('0x20')]+_0xa0fd('0x28')][_0xa0fd('0x29')](_0x1cca79)[_0xa0fd('0x2a')](function(_0x302c37){logger[_0xa0fd('0x2b')]('create\x20queue\x20report');});}}}function stopRouting(_0x16a78a,_0x531aab,_0x4a865a,_0x536acf){if(_0x16a78a&&_0x531aab){_0x531aab[_0xa0fd('0x2c')]-=0x1;var _0x11257c={'leaveAt':moment()[_0xa0fd('0xf')](_0xa0fd('0x1c')),'acceptAt':moment()[_0xa0fd('0xf')](_0xa0fd('0x1c')),'reason':_0xa0fd('0x2d')};logger['info'](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x16a78a,_0x531aab[_0xa0fd('0x27')]));emitChannelQueueInteraction(_0x4a865a[_0xa0fd('0x20')],_0x531aab[_0xa0fd('0x27')],_0x4a865a[_0xa0fd('0x1b')],_0x4a865a[_0xa0fd('0x25')]['name'],_0x4a865a[_0xa0fd('0x23')]['id'],![],_0x536acf,_0x531aab['id']);if(rpc[_0x4a865a[_0xa0fd('0x20')]+_0xa0fd('0x28')]){return rpc[_0x4a865a[_0xa0fd('0x20')]+_0xa0fd('0x28')][_0xa0fd('0x2e')](_0x16a78a,_0x11257c)[_0xa0fd('0x2a')](function(_0x1c2175){logger[_0xa0fd('0x2b')]('update\x20queue\x20report');});}}}function endRouting(_0x29fd34,_0x56bed9,_0x1920aa,_0x3b2efa){if(_0x29fd34&&_0x56bed9){_0x56bed9[_0xa0fd('0x2c')]-=0x1;var _0x28c821={'leaveAt':moment()[_0xa0fd('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0xa0fd('0x1c')),'reason':_0xa0fd('0x2f')};logger[_0xa0fd('0x30')](util[_0xa0fd('0xf')](_0xa0fd('0x31'),_0x29fd34,_0x56bed9[_0xa0fd('0x27')]));emitChannelQueueInteraction(_0x1920aa['channel'],_0x56bed9[_0xa0fd('0x27')],_0x1920aa['body'],_0x1920aa[_0xa0fd('0x25')][_0xa0fd('0x27')],_0x1920aa[_0xa0fd('0x23')]['id'],![],_0x3b2efa);if(rpc[_0x1920aa[_0xa0fd('0x20')]+_0xa0fd('0x28')]){return rpc[_0x1920aa[_0xa0fd('0x20')]+_0xa0fd('0x28')][_0xa0fd('0x2e')](_0x29fd34,_0x28c821)[_0xa0fd('0x2a')](function(_0x201fee){logger[_0xa0fd('0x2b')](_0xa0fd('0x32'));});}}}function handleFindQueue(_0x489836){return function(_0x2ca8a0){return _0x2ca8a0[_0xa0fd('0x27')][_0xa0fd('0x33')]()===_0x489836[_0xa0fd('0x33')]();};}exports[_0xa0fd('0x34')]=function(_0xf674f5,_0x41d455,_0x5680f6,_0x264b05){return function(_0x121edc){try{var _0x3a6d16={'name':_0x41d455[0x0],'timeout':_0x41d455[0x1]};var _0x24df1b=queue[_0xa0fd('0x35')](_0x3a6d16,{'typecast':!![]});if(_0x24df1b[_0xa0fd('0x36')]){logger[_0xa0fd('0x2b')](_0xa0fd('0x37'),_0xf674f5,_['map'](_0x24df1b,_0xa0fd('0x23'))[_0xa0fd('0x38')](',\x20'));_0x121edc[_0xa0fd('0x39')]();}else{var _0x2ab5bf=_['find'](_0x5680f6[_0x264b05['channel']+_0xa0fd('0x3a')],handleFindQueue(_0x3a6d16[_0xa0fd('0x27')]));if(_0x2ab5bf){startRouting(_0xf674f5,_0x2ab5bf,_0x264b05,_0x5680f6);var _0x3db530=(_0x2ab5bf['timeout']||0xa)*0x3e8;var _0x381b0f=(_0x3a6d16[_0xa0fd('0x2f')]||0x14)*0x3e8;var _0x2f0312,_0x3308ae;if(_0x3db530>_0x381b0f){_0x381b0f=_0x3db530;}var _0xec83b6=seqqueue['createQueue'](_0x3db530);_0xec83b6['id']=_0xf674f5;_0xec83b6[_0xa0fd('0x3b')]=_0x3db530;_0xec83b6['qtimeout']=_0x381b0f;_0xec83b6[_0xa0fd('0x20')]=_0x264b05[_0xa0fd('0x20')];_0x5680f6[_0xa0fd('0x3c')][_0xf674f5]['on'](_0xa0fd('0x3d'),function(){logger['info'](_0xa0fd('0x3e'),_0xf674f5);stopRouting(_0xf674f5,_0x2ab5bf,_0x264b05,_0x5680f6);clearTimeout(_0x2f0312);_0x2f0312=undefined;_0xec83b6[_0xa0fd('0x3f')](!![]);if(_0x5680f6[_0xa0fd('0x3c')][_0xf674f5]){delete _0x5680f6[_0xa0fd('0x3c')][_0xf674f5];}_0x121edc[_0xa0fd('0x39')]();});_0x5680f6['rules'][_0xf674f5]['on'](_0xa0fd('0x40'),function(){if(_0x5680f6[_0xa0fd('0x3c')][_0xf674f5]){delete _0x5680f6[_0xa0fd('0x3c')][_0xf674f5];}});_0x2f0312=setTimeout(function(){logger['info'](_0xa0fd('0x41'),_0xf674f5);endRouting(_0xf674f5,_0x2ab5bf,_0x264b05,_0x5680f6);clearTimeout(_0x2f0312);_0xec83b6[_0xa0fd('0x3f')](!![]);_0x121edc[_0xa0fd('0x42')]();},_0x381b0f);switch(_0x2ab5bf[_0xa0fd('0x43')]){case _0xa0fd('0x44'):strategy[_0xa0fd('0x44')](_0xec83b6,_0x2ab5bf,_0x5680f6,_0x264b05);break;default:strategy[_0xa0fd('0x45')](_0xec83b6,_0x2ab5bf,_0x5680f6,_0x264b05);}}else{logger[_0xa0fd('0x2b')](_0xa0fd('0x46'),_0xf674f5,_0x3a6d16[_0xa0fd('0x27')]);_0x121edc[_0xa0fd('0x39')]();}}}catch(_0x291dce){console[_0xa0fd('0x47')](_0x291dce);logger['error'](_0xa0fd('0x37'),_0xf674f5,_0x291dce[_0xa0fd('0x48')]);_0x121edc['stop']();}};}; \ 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 f3922be..aa9c79c 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 _0xfc20=['busyQueue','RINGING',':FORCED','hideNotification','writeLog','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy'];(function(_0xa3408d,_0x1f54ae){var _0x1b34c2=function(_0xe9587){while(--_0xe9587){_0xa3408d['push'](_0xa3408d['shift']());}};_0x1b34c2(++_0x1f54ae);}(_0xfc20,0x1e4));var _0x0fc2=function(_0x8f82df,_0x4ad0e9){_0x8f82df=_0x8f82df-0x0;var _0x19212a=_0xfc20[_0x8f82df];return _0x19212a;};'use strict';var _=require(_0x0fc2('0x0'));var uuid=require(_0x0fc2('0x1'));var util=require(_0x0fc2('0x2'));var logger=require(_0x0fc2('0x3'))('routing');var Agent=function(_0x36400e,_0x42e04d,_0x5be635,_0x35cb5f){this[_0x0fc2('0x4')]=uuid['v4']();this[_0x0fc2('0x5')]=_0x36400e;this[_0x0fc2('0x6')]=_0x42e04d;this[_0x0fc2('0x7')]=_0x5be635;this[_0x0fc2('0x8')]=_0x35cb5f;this[_0x0fc2('0x5')][_0x0fc2('0x9')](this[_0x0fc2('0xa')][_0x0fc2('0xb')](this),this[_0x0fc2('0xc')]['bind'](this));this[_0x0fc2('0x5')]['on'](_0x0fc2('0xd'),this[_0x0fc2('0xc')]['bind'](this));this[_0x0fc2('0x5')]['on'](_0x0fc2('0xe'),this['handleDrained'][_0x0fc2('0xb')](this));};Agent[_0x0fc2('0xf')][_0x0fc2('0x9')]=function(){this[_0x0fc2('0x5')]['push'](this['handleRun'][_0x0fc2('0xb')](this),this['handleTimeout'][_0x0fc2('0xb')](this));};Agent[_0x0fc2('0xf')][_0x0fc2('0x10')]=function(){this[_0x0fc2('0xc')](!![]);};Agent[_0x0fc2('0xf')][_0x0fc2('0xa')]=function(_0x6b184c){logger[_0x0fc2('0x11')](_0x0fc2('0x12'),this[_0x0fc2('0x5')]['id'],this['agent']['id']);if(_[_0x0fc2('0x13')](this[_0x0fc2('0x7')][_0x0fc2('0x14')][this['agent']['id']])){logger[_0x0fc2('0x11')](_0x0fc2('0x15'),this[_0x0fc2('0x5')]['id'],this[_0x0fc2('0x6')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing'][_0x0fc2('0x16')]||util[_0x0fc2('0x17')](this[_0x0fc2('0x5')]['id'],this['realtime']['agents'][this['agent']['id']],this[_0x0fc2('0x5')][_0x0fc2('0x18')],![])){this[_0x0fc2('0x7')]['agents'][this['agent']['id']][_0x0fc2('0x19')]=!![];this[_0x0fc2('0x7')]['agents'][this[_0x0fc2('0x6')]['id']][_0x0fc2('0x1a')]=undefined;util['showNotification'](this[_0x0fc2('0x4')],this['squeue']['id'],this[_0x0fc2('0x7')][_0x0fc2('0x14')][this[_0x0fc2('0x6')]['id']],null,this['routing']);util['writeLog'](this['squeue']['id'],this[_0x0fc2('0x7')][_0x0fc2('0x14')][this['agent']['id']],_0x0fc2('0x1b')+(this[_0x0fc2('0x8')][_0x0fc2('0x16')]?_0x0fc2('0x1c'):''));}else{logger[_0x0fc2('0x11')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x0fc2('0x9')]['bind'](this),0x3e8);}}};Agent[_0x0fc2('0xf')][_0x0fc2('0xc')]=function(_0x19d9bf){if(_[_0x0fc2('0x13')](this[_0x0fc2('0x7')][_0x0fc2('0x14')][this['agent']['id']])){return logger[_0x0fc2('0x11')](_0x0fc2('0x15'),this[_0x0fc2('0x5')]['id'],this['agent']['id']);}else{logger[_0x0fc2('0x11')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x0fc2('0x5')]['id'],this[_0x0fc2('0x6')]['id']);util[_0x0fc2('0x1d')](this[_0x0fc2('0x4')],this[_0x0fc2('0x5')]['id'],this[_0x0fc2('0x7')][_0x0fc2('0x14')][this[_0x0fc2('0x6')]['id']],null,this[_0x0fc2('0x8')]);this['realtime'][_0x0fc2('0x14')][this['agent']['id']][_0x0fc2('0x19')]=![];this[_0x0fc2('0x7')]['agents'][this[_0x0fc2('0x6')]['id']][_0x0fc2('0x1a')]=undefined;util[_0x0fc2('0x1e')](this[_0x0fc2('0x5')]['id'],this[_0x0fc2('0x7')][_0x0fc2('0x14')][this[_0x0fc2('0x6')]['id']],_0x19d9bf?_0x0fc2('0x1f'):_0x0fc2('0x20'));}if(!_0x19d9bf){setTimeout(this['push'][_0x0fc2('0xb')](this),0x3e8);}};function agent(_0x809278,_0x3d571d,_0x4ab41b,_0x2ba61d){return new Agent(_0x809278,_0x3d571d,_0x4ab41b,_0x2ba61d);}module[_0x0fc2('0x21')]=agent; \ No newline at end of file +var _0x4075=['hideNotification','STOP','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agents','forcedOwnership','isAgentAvailable','channel','busy','showNotification','writeLog','RINGING',':FORCED','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x4dc67f,_0x5bd594){var _0x881dbf=function(_0x8b5bf9){while(--_0x8b5bf9){_0x4dc67f['push'](_0x4dc67f['shift']());}};_0x881dbf(++_0x5bd594);}(_0x4075,0x10a));var _0x5407=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x4075[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x5407('0x0'));var uuid=require(_0x5407('0x1'));var util=require(_0x5407('0x2'));var logger=require(_0x5407('0x3'))(_0x5407('0x4'));var Agent=function(_0x596cba,_0x360e94,_0x1112e1,_0x3c297a){this[_0x5407('0x5')]=uuid['v4']();this[_0x5407('0x6')]=_0x596cba;this[_0x5407('0x7')]=_0x360e94;this[_0x5407('0x8')]=_0x1112e1;this[_0x5407('0x4')]=_0x3c297a;this[_0x5407('0x6')][_0x5407('0x9')](this[_0x5407('0xa')]['bind'](this),this[_0x5407('0xb')][_0x5407('0xc')](this));this['squeue']['on'](_0x5407('0xd'),this['handleTimeout'][_0x5407('0xc')](this));this[_0x5407('0x6')]['on'](_0x5407('0xe'),this[_0x5407('0xf')][_0x5407('0xc')](this));};Agent['prototype'][_0x5407('0x9')]=function(){this[_0x5407('0x6')][_0x5407('0x9')](this[_0x5407('0xa')]['bind'](this),this[_0x5407('0xb')]['bind'](this));};Agent[_0x5407('0x10')][_0x5407('0xf')]=function(){this['handleTimeout'](!![]);};Agent[_0x5407('0x10')][_0x5407('0xa')]=function(_0x40f193){logger[_0x5407('0x11')](_0x5407('0x12'),this['squeue']['id'],this[_0x5407('0x7')]['id']);if(_['isNil'](this[_0x5407('0x8')][_0x5407('0x13')][this[_0x5407('0x7')]['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x5407('0x7')]['id']);setTimeout(this[_0x5407('0x9')][_0x5407('0xc')](this),0x3e8);}else{if(this[_0x5407('0x4')][_0x5407('0x14')]||util[_0x5407('0x15')](this[_0x5407('0x6')]['id'],this[_0x5407('0x8')][_0x5407('0x13')][this['agent']['id']],this[_0x5407('0x6')][_0x5407('0x16')],![])){this[_0x5407('0x8')]['agents'][this[_0x5407('0x7')]['id']][_0x5407('0x17')]=!![];this[_0x5407('0x8')][_0x5407('0x13')][this['agent']['id']]['busyQueue']=undefined;util[_0x5407('0x18')](this[_0x5407('0x5')],this[_0x5407('0x6')]['id'],this[_0x5407('0x8')][_0x5407('0x13')][this['agent']['id']],null,this[_0x5407('0x4')]);util[_0x5407('0x19')](this['squeue']['id'],this['realtime'][_0x5407('0x13')][this[_0x5407('0x7')]['id']],_0x5407('0x1a')+(this[_0x5407('0x4')][_0x5407('0x14')]?_0x5407('0x1b'):''));}else{logger[_0x5407('0x11')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x5407('0x6')]['id'],this[_0x5407('0x7')]['id']);setTimeout(this[_0x5407('0x9')][_0x5407('0xc')](this),0x3e8);}}};Agent[_0x5407('0x10')]['handleTimeout']=function(_0x2f1946){if(_[_0x5407('0x1c')](this[_0x5407('0x8')][_0x5407('0x13')][this[_0x5407('0x7')]['id']])){return logger[_0x5407('0x11')](_0x5407('0x1d'),this[_0x5407('0x6')]['id'],this[_0x5407('0x7')]['id']);}else{logger[_0x5407('0x11')](_0x5407('0x1e'),this[_0x5407('0x6')]['id'],this[_0x5407('0x7')]['id']);util[_0x5407('0x1f')](this[_0x5407('0x5')],this['squeue']['id'],this['realtime'][_0x5407('0x13')][this[_0x5407('0x7')]['id']],null,this[_0x5407('0x4')]);this['realtime'][_0x5407('0x13')][this[_0x5407('0x7')]['id']][_0x5407('0x17')]=![];this['realtime'][_0x5407('0x13')][this['agent']['id']]['busyQueue']=undefined;util[_0x5407('0x19')](this[_0x5407('0x6')]['id'],this[_0x5407('0x8')][_0x5407('0x13')][this['agent']['id']],_0x2f1946?_0x5407('0x20'):'TIMEOUT');}if(!_0x2f1946){setTimeout(this['push'][_0x5407('0xc')](this),0x3e8);}};function agent(_0x415eb3,_0x48ff59,_0x4d1f04,_0x25d426){return new Agent(_0x415eb3,_0x48ff59,_0x4d1f04,_0x25d426);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 9958771..920b0b6 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 _0xdc97=['squeue','queue','realtime','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','handleRun','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','busyQueue','name','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','exports','lodash','uuid','./util','routing','notificationId'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x238f6e,_0x58069a){_0x238f6e=_0x238f6e-0x0;var _0x5ba4f8=_0xdc97[_0x238f6e];return _0x5ba4f8;};'use strict';var _=require(_0x7dc9('0x0'));var uuid=require(_0x7dc9('0x1'));var util=require(_0x7dc9('0x2'));var logger=require('../../../../../config/logger')(_0x7dc9('0x3'));var Beepall=function(_0x4f5c88,_0x228e39,_0x2b86da,_0x478a95){this[_0x7dc9('0x4')]=uuid['v4']();this[_0x7dc9('0x5')]=_0x4f5c88;this[_0x7dc9('0x6')]=_0x228e39;this[_0x7dc9('0x7')]=_0x2b86da;this['routing']=_0x478a95;this[_0x7dc9('0x5')]['push'](this['handleRun'][_0x7dc9('0x8')](this),this[_0x7dc9('0x9')][_0x7dc9('0x8')](this));this[_0x7dc9('0x5')]['on'](_0x7dc9('0xa'),this['handleTimeout'][_0x7dc9('0x8')](this));this[_0x7dc9('0x5')]['on'](_0x7dc9('0xb'),this[_0x7dc9('0xc')][_0x7dc9('0x8')](this));};Beepall[_0x7dc9('0xd')][_0x7dc9('0xe')]=function(){this['squeue']['push'](this['handleRun']['bind'](this),this[_0x7dc9('0x9')][_0x7dc9('0x8')](this));};Beepall['prototype'][_0x7dc9('0xc')]=function(_0x2f3acd){this[_0x7dc9('0x9')](!![]);};Beepall[_0x7dc9('0xd')][_0x7dc9('0xf')]=function(_0x11af93){var _0x524d09=!![];if(!_[_0x7dc9('0x10')](this[_0x7dc9('0x6')])&&!_[_0x7dc9('0x10')](this[_0x7dc9('0x6')][_0x7dc9('0x11')])&&this[_0x7dc9('0x6')][_0x7dc9('0x11')][_0x7dc9('0x12')]>0x0){for(var _0x4778d5=0x0,_0x5a6e04;_0x4778d50x0){for(var _0x555481=0x0,_0x5b6ef8;_0x5554810x0&&_0x1b7760[_0x5b6502+_0x22d7('0x27')]>=_0x1b7760[_0x5b6502+_0x22d7('0x28')]){writeLog(_0x141220,_0x1b7760,_0x5b6502['toUpperCase']()+_0x22d7('0x29'));return![];}}return!![];};exports[_0x22d7('0x2a')]=function(_0xfbb9b,_0xce7f15,_0x45dc29,_0x49199a,_0x2606bd){return sendNotification(!![],_0xfbb9b,_0xce7f15,_0x45dc29,_0x49199a,_0x2606bd);};exports[_0x22d7('0x2b')]=function(_0x33c621,_0x2c0b24,_0x539ba0,_0x1195bc,_0x21c334){return sendNotification(![],_0x33c621,_0x2c0b24,_0x539ba0,_0x1195bc,_0x21c334);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x90b1=['remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','hasOwnProperty','Capacity','toUpperCase','showNotification','lodash','util','../utils','../../../../../config/environment','../../../../../config/logger','routing','redis','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','notification:%s'];(function(_0xc559fe,_0x59d800){var _0x3dee1b=function(_0x44b833){while(--_0x44b833){_0xc559fe['push'](_0xc559fe['shift']());}};_0x3dee1b(++_0x59d800);}(_0x90b1,0x1bb));var _0x190b=function(_0x3e61d4,_0x224d2d){_0x3e61d4=_0x3e61d4-0x0;var _0x40bd4e=_0x90b1[_0x3e61d4];return _0x40bd4e;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var utils=require(_0x190b('0x2'));var Mustache=require('mustache');var Redis=require('ioredis');var config=require(_0x190b('0x3'));var logger=require(_0x190b('0x4'))(_0x190b('0x5'));config[_0x190b('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x190b('0x6')]));function emit(_0x34a689,_0x3b57f7,_0x626aa1){io['to'](_0x34a689)[_0x190b('0x7')](_0x3b57f7,_0x626aa1);}function sendNotification(_0x802924,_0x32c30c,_0x5cf2b4,_0x14b93d,_0x186101,_0x163966){io['to'](util[_0x190b('0x8')](_0x190b('0x9'),_0x14b93d[_0x190b('0xa')]))[_0x190b('0x7')](_0x190b('0xb'),_0x14b93d);var _0x5d6497=_0x163966||{};var _0xb3f47b=_0x5cf2b4[_0x190b('0xc')]('.');var _0x5701ad={'uniqueid':_0x32c30c,'channel':_0xb3f47b[0x0],'id':_0xb3f47b[0x1],'title':_0xb3f47b[0x0]+_0x190b('0xd'),'interactionId':_0xb3f47b[0x2],'queue':_0x186101?_0x186101[_0x190b('0xa')]:null,'sound':_0x5d6497[_0x190b('0xe')][_0x190b('0xf')],'shake':_0x5d6497[_0x190b('0xe')][_0x190b('0x10')]};try{if(!_0x5d6497[_0x190b('0x11')]){_0x5d6497[_0x190b('0x11')]={};}if(_0x186101){_0x5d6497[_0x190b('0x11')][_0x190b('0x12')]=_0x186101;}else if(_0x5d6497[_0x190b('0x11')][_0x190b('0x12')]){delete _0x5d6497[_0x190b('0x11')][_0x190b('0x12')];}_0x5701ad[_0x190b('0x13')]=utils[_0x190b('0x14')](_0x5d6497[_0x190b('0xe')]['notificationTemplate'],_0x5d6497);}catch(_0x428fec){_0x5701ad['msg']=_0x190b('0x15');logger[_0x190b('0x16')](util[_0x190b('0x8')](_0x190b('0x17'),_0x32c30c,_0x428fec['message']));}io['to'](util[_0x190b('0x8')](_0x190b('0x9'),_0x14b93d[_0x190b('0xa')]))[_0x190b('0x7')](util[_0x190b('0x8')](_0x190b('0x18'),_0x802924?'save':_0x190b('0x19')),_0x5701ad);}function writeLog(_0x14f0a5,_0x5092dd,_0xb4c32b){return logger['info'](util['format'](_0x190b('0x1a'),_0x14f0a5,_0x5092dd[_0x190b('0xa')],_0xb4c32b));}exports[_0x190b('0x1b')]=function(_0x4c0b6e,_0x37465e,_0x2e633e,_0x16e989){if(_0x37465e[_0x190b('0x1c')]){writeLog(_0x4c0b6e,_0x37465e,_0x190b('0x1d'));return![];}if(!_0x37465e[_0x190b('0x1e')]){writeLog(_0x4c0b6e,_0x37465e,_0x190b('0x1f'));return![];}if(_0x37465e[_0x2e633e+'Pause']){writeLog(_0x4c0b6e,_0x37465e,'PAUSE');return![];}if(_0x16e989&&_0x37465e[_0x190b('0x20')](_0x2e633e+_0x190b('0x21'))&&_0x37465e['hasOwnProperty'](_0x2e633e+'CurrentCapacity')){if(_0x37465e[_0x2e633e+_0x190b('0x21')]>0x0&&_0x37465e[_0x2e633e+'CurrentCapacity']>=_0x37465e[_0x2e633e+_0x190b('0x21')]){writeLog(_0x4c0b6e,_0x37465e,_0x2e633e[_0x190b('0x22')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x190b('0x23')]=function(_0x1deea6,_0x5c89ab,_0xa9d6f7,_0x2c47ae,_0x359b4a){return sendNotification(!![],_0x1deea6,_0x5c89ab,_0xa9d6f7,_0x2c47ae,_0x359b4a);};exports['hideNotification']=function(_0x536d7b,_0x3730cc,_0x4d5f3f,_0x14be2c,_0x19e421){return sendNotification(![],_0x536d7b,_0x3730cc,_0x4d5f3f,_0x14be2c,_0x19e421);};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 783ecb9..fe774f1 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 _0xfb09=['length','error','[%s][SYSTEM]\x20%s','map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0xb64c15,_0x5f5b4d){var _0x1cbf37=function(_0x3bf4f8){while(--_0x3bf4f8){_0xb64c15['push'](_0xb64c15['shift']());}};_0x1cbf37(++_0x5f5b4d);}(_0xfb09,0x19d));var _0x9fb0=function(_0x5501c4,_0x50e67d){_0x5501c4=_0x5501c4-0x0;var _0x546239=_0xfb09[_0x5501c4];return _0x546239;};'use strict';var schema=require(_0x9fb0('0x0'));var sh=require('shelljs');var _=require(_0x9fb0('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x9fb0('0x2'));var system=schema({'command':{'type':_0x9fb0('0x3'),'required':!![],'message':_0x9fb0('0x4')}});exports['consequence']=function(_0x2bf0ea,_0x1c334b){return function(_0x4f5701){try{var _0x3bad46={'command':_0x1c334b[0x0]};var _0x19b030=system['validate'](_0x3bad46,{'typecast':!![]});if(_0x19b030[_0x9fb0('0x5')]){logger[_0x9fb0('0x6')](_0x9fb0('0x7'),_0x2bf0ea,_[_0x9fb0('0x8')](_0x19b030,_0x9fb0('0x9'))['join'](',\x20'));logger['info'](_0x9fb0('0xa'),_0x2bf0ea);_0x4f5701[_0x9fb0('0xb')]();}else{var _0x4fbe2f=this;var _0x1bf925=utils[_0x9fb0('0xc')](_0x1c334b[0x0],this);logger[_0x9fb0('0xd')](_0x9fb0('0xe'),_0x2bf0ea,_0x1bf925);sh[_0x9fb0('0xf')](_[_0x9fb0('0x10')](_0x1bf925),function(_0x59c38,_0x1dbf84){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2bf0ea,_0x59c38);if(_0x59c38==0x0){var _0x349429=_0x1dbf84[_0x9fb0('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x1c334b[0x1])||_['isEmpty'](_0x1c334b[0x1])){logger['info'](_0x9fb0('0x12'),_0x2bf0ea);_0x4fbe2f[_0x9fb0('0x13')][_0x1c334b[0x1]]=_0x349429;}else{logger[_0x9fb0('0xd')](_0x9fb0('0x14'),_0x2bf0ea,_0x1c334b[0x1],_0x349429);_0x4fbe2f[_0x9fb0('0x13')][_0x1c334b[0x1]]=_0x349429;}}_0x4f5701[_0x9fb0('0xb')]();});}}catch(_0x4b9712){logger[_0x9fb0('0x6')](_0x9fb0('0x7'),_0x2bf0ea,_['isObject'](_0x4b9712)?JSON[_0x9fb0('0x15')](_0x4b9712):_0x4b9712);logger[_0x9fb0('0xd')](_0x9fb0('0xa'),_0x2bf0ea);_0x4f5701['next']();}};}; \ No newline at end of file +var _0x2f42=['validate','shelljs','lodash','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify'];(function(_0x15ffd5,_0x1bf5de){var _0x170afa=function(_0x31916a){while(--_0x31916a){_0x15ffd5['push'](_0x15ffd5['shift']());}};_0x170afa(++_0x1bf5de);}(_0x2f42,0x90));var _0x22f4=function(_0x3f7f7d,_0x46069a){_0x3f7f7d=_0x3f7f7d-0x0;var _0x4a9038=_0x2f42[_0x3f7f7d];return _0x4a9038;};'use strict';var schema=require(_0x22f4('0x0'));var sh=require(_0x22f4('0x1'));var _=require(_0x22f4('0x2'));var utils=require('./utils');var logger=require(_0x22f4('0x3'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x22f4('0x4')}});exports['consequence']=function(_0x3e9104,_0x458a9e){return function(_0x310bca){try{var _0x386042={'command':_0x458a9e[0x0]};var _0x1a9596=system[_0x22f4('0x0')](_0x386042,{'typecast':!![]});if(_0x1a9596[_0x22f4('0x5')]){logger[_0x22f4('0x6')](_0x22f4('0x7'),_0x3e9104,_['map'](_0x1a9596,_0x22f4('0x8'))[_0x22f4('0x9')](',\x20'));logger[_0x22f4('0xa')](_0x22f4('0xb'),_0x3e9104);_0x310bca[_0x22f4('0xc')]();}else{var _0x2f018b=this;var _0x4d948d=utils['getMustacheRender'](_0x458a9e[0x0],this);logger['info'](_0x22f4('0xd'),_0x3e9104,_0x4d948d);sh[_0x22f4('0xe')](_[_0x22f4('0xf')](_0x4d948d),function(_0x2df409,_0x5a6972){logger[_0x22f4('0xa')](_0x22f4('0x10'),_0x3e9104,_0x2df409);if(_0x2df409==0x0){var _0x3d97c8=_0x5a6972[_0x22f4('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x458a9e[0x1])||_[_0x22f4('0x12')](_0x458a9e[0x1])){logger[_0x22f4('0xa')](_0x22f4('0x13'),_0x3e9104);_0x2f018b['body'][_0x458a9e[0x1]]=_0x3d97c8;}else{logger[_0x22f4('0xa')](_0x22f4('0x14'),_0x3e9104,_0x458a9e[0x1],_0x3d97c8);_0x2f018b[_0x22f4('0x15')][_0x458a9e[0x1]]=_0x3d97c8;}}_0x310bca[_0x22f4('0xc')]();});}}catch(_0x1b7ddd){logger[_0x22f4('0x6')](_0x22f4('0x7'),_0x3e9104,_[_0x22f4('0x16')](_0x1b7ddd)?JSON[_0x22f4('0x17')](_0x1b7ddd):_0x1b7ddd);logger['info'](_0x22f4('0xb'),_0x3e9104);_0x310bca['next']();}};}; \ 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 6b3b62e..656dfdb 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 _0xf53d=['info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','error','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','[%s][TAG]\x20%s'];(function(_0x5e8c92,_0x38fe8d){var _0x48686f=function(_0x7a53a6){while(--_0x7a53a6){_0x5e8c92['push'](_0x5e8c92['shift']());}};_0x48686f(++_0x38fe8d);}(_0xf53d,0x193));var _0xdf53=function(_0x19ef5d,_0x3e44c7){_0x19ef5d=_0x19ef5d-0x0;var _0x57f6f0=_0xf53d[_0x19ef5d];return _0x57f6f0;};'use strict';var schema=require(_0xdf53('0x0'));var _=require(_0xdf53('0x1'));var rpc={'chatInteraction':require(_0xdf53('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xdf53('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xdf53('0x4')),'whatsappInteraction':require(_0xdf53('0x5'))};var logger=require(_0xdf53('0x6'))(_0xdf53('0x7'));var tag=schema({'tag':{'type':_0xdf53('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xdf53('0x9')]=function(_0xe44035,_0x5a2494,_0x3a2f3d,_0x1e5351){return function(_0xf287de){try{var _0x468b74={'tag':_0x5a2494[0x0]};var _0x3a9c42=tag['validate'](_0x468b74,{'typecast':!![]});if(_0x3a9c42['length']){logger['error'](_0xdf53('0xa'),_0xe44035,_['map'](_0x3a9c42,'message')['join'](',\x20'));logger[_0xdf53('0xb')](_0xdf53('0xc'),_0xe44035);_0xf287de[_0xdf53('0xd')]();}else{var _0x38898e={'ids':[_0x5a2494[0x0]]};if(rpc[_0x1e5351[_0xdf53('0xe')]+_0xdf53('0xf')]){rpc[_0x1e5351[_0xdf53('0xe')]+_0xdf53('0xf')][_0xdf53('0x10')](_0x1e5351['interaction']['id'],_0x38898e)[_0xdf53('0x11')](function(_0x4bacf6){logger[_0xdf53('0xb')](_0xdf53('0x12'),_0xe44035,_0x5a2494[0x1],_0x1e5351[_0xdf53('0xe')],_0x1e5351['interaction']['id']);})['catch'](function(_0x53ab15){logger[_0xdf53('0x13')](_0xdf53('0xa'),_0xe44035,JSON[_0xdf53('0x14')](_0x53ab15));logger[_0xdf53('0xb')](_0xdf53('0xc'),_0xe44035);})[_0xdf53('0x15')](function(){_0xf287de[_0xdf53('0xd')]();});}}}catch(_0x5cdc63){logger[_0xdf53('0x13')]('[%s][TAG]\x20%s',_0xe44035,_[_0xdf53('0x16')](_0x5cdc63)?JSON['stringify'](_0x5cdc63):_0x5cdc63);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xe44035);_0xf287de[_0xdf53('0xd')]();}};}; \ No newline at end of file +var _0x6821=['../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','validate','../../rpc/chatInteraction'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x6821,0xda));var _0x1682=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x6821[_0x38537f];return _0x141e23;};'use strict';var schema=require(_0x1682('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x1682('0x1')),'openchannelInteraction':require(_0x1682('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x1682('0x3')),'whatsappInteraction':require(_0x1682('0x4'))};var logger=require(_0x1682('0x5'))(_0x1682('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x1682('0x7')}});exports['consequence']=function(_0x96ffe,_0x49b960,_0x5a1bbd,_0x24ac32){return function(_0x3cec26){try{var _0x21d553={'tag':_0x49b960[0x0]};var _0x369196=tag[_0x1682('0x0')](_0x21d553,{'typecast':!![]});if(_0x369196['length']){logger[_0x1682('0x8')](_0x1682('0x9'),_0x96ffe,_['map'](_0x369196,'message')[_0x1682('0xa')](',\x20'));logger[_0x1682('0xb')](_0x1682('0xc'),_0x96ffe);_0x3cec26[_0x1682('0xd')]();}else{var _0x191d22={'ids':[_0x49b960[0x0]]};if(rpc[_0x24ac32[_0x1682('0xe')]+_0x1682('0xf')]){rpc[_0x24ac32['channel']+_0x1682('0xf')]['addTags'](_0x24ac32[_0x1682('0x10')]['id'],_0x191d22)[_0x1682('0x11')](function(_0x4fa2c7){logger['info'](_0x1682('0x12'),_0x96ffe,_0x49b960[0x1],_0x24ac32[_0x1682('0xe')],_0x24ac32[_0x1682('0x10')]['id']);})[_0x1682('0x13')](function(_0x1272bb){logger['error'](_0x1682('0x9'),_0x96ffe,JSON[_0x1682('0x14')](_0x1272bb));logger[_0x1682('0xb')](_0x1682('0xc'),_0x96ffe);})[_0x1682('0x15')](function(){_0x3cec26['next']();});}}}catch(_0x11e43b){logger[_0x1682('0x8')]('[%s][TAG]\x20%s',_0x96ffe,_['isObject'](_0x11e43b)?JSON['stringify'](_0x11e43b):_0x11e43b);logger[_0x1682('0xb')](_0x1682('0xc'),_0x96ffe);_0x3cec26[_0x1682('0xd')]();}};}; \ 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 5276b89..d108576 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 _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x321d7e,_0x1c51db){var _0xf333b4=function(_0x5b8bbd){while(--_0x5b8bbd){_0x321d7e['push'](_0x321d7e['shift']());}};_0xf333b4(++_0x1c51db);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x4b2bf4,_0xb17970){var _0x483c6a=function(_0x5315db){while(--_0x5315db){_0x4b2bf4['push'](_0x4b2bf4['shift']());}};_0x483c6a(++_0xb17970);}(_0xe706,0xa3));var _0x6e70=function(_0x353730,_0x504fdf){_0x353730=_0x353730-0x0;var _0x901b87=_0xe706[_0x353730];return _0x901b87;};'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 70c9254..01d25b8 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 _0xc26d=['bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','channel','message','interaction','applications','length','app','toLowerCase','appdata','split','push','slice','join','dialogflowv2','tag','format','%s:%s:%s','./interval','condition','intervals','priority','info','Push\x20new\x20rule','\x20|\x20','error','.js','rules','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','end','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise'];(function(_0xb0bc32,_0x1e1409){var _0xdab0e2=function(_0x3035a){while(--_0x3035a){_0xb0bc32['push'](_0xb0bc32['shift']());}};_0xdab0e2(++_0x1e1409);}(_0xc26d,0x148));var _0xdc26=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc26d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdc26('0x0'));var util=require(_0xdc26('0x1'));var path=require(_0xdc26('0x2'));var fs=require('fs');var jayson=require(_0xdc26('0x3'));var BPromise=require(_0xdc26('0x4'));var uuid=require('uuid');var config=require(_0xdc26('0x5'));var logger=require('../../../config/logger')(_0xdc26('0x6'));var rpc={'openchannelQueueReport':require(_0xdc26('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xdc26('0x8'))};var RuleEngine=require(_0xdc26('0x9'));function getId(_0x4e8e04,_0x3c1474,_0x3eba82){return util['format'](_0xdc26('0xa'),_0x4e8e04,_0x3c1474||0x0,_0x3eba82||0x0);}function getIntervals(_0x99b0f4,_0x3567c3){var _0x359dc4=[];if(!_['isNil'](_0x3567c3[_0xdc26('0xb')])&&!_[_0xdc26('0xc')](_0x99b0f4[_0x3567c3[_0xdc26('0xb')]])&&!_[_0xdc26('0xc')](_0x99b0f4[_0x3567c3[_0xdc26('0xb')]]['Intervals'])){_0x359dc4=_['map'](_0x99b0f4[_0x3567c3[_0xdc26('0xb')]][_0xdc26('0xd')],'interval');}else if(!_[_0xdc26('0xc')](_0x3567c3[_0xdc26('0xe')])){_0x359dc4=[_0x3567c3[_0xdc26('0xe')]];}return _0x359dc4;}exports[_0xdc26('0xf')]=function(_0x3ba678){_0x3ba678['rules']={};return new BPromise(function(_0x1b261e,_0x4f2c85){var _0x34cc7b={'Start':function(_0x155b7c){var _0x314bb0=this;return new Promise(function(_0x314132,_0xe435b){if(_0x155b7c){try{var _0x5f2222=[];var _0x2cb271=getId(_0x155b7c[_0xdc26('0x10')],_0x155b7c[_0xdc26('0x11')]?_0x155b7c[_0xdc26('0x11')]['id']:0x0,_0x155b7c[_0xdc26('0x12')]?_0x155b7c[_0xdc26('0x12')]['id']:0x0);if(_0x155b7c['applications']&&_['isArray'](_0x155b7c[_0xdc26('0x13')])&&_0x155b7c['applications'][_0xdc26('0x14')]){for(var _0x412e0e=0x0;_0x412e0e<_0x155b7c[_0xdc26('0x13')]['length'];_0x412e0e+=0x1){var _0x59c7c5=_0x155b7c['applications'][_0x412e0e];if(fs['existsSync'](path['join'](__dirname,_0xdc26('0x13'),_0x59c7c5['app']+'.js'))){var _0x14eb49=[];switch(_0x59c7c5[_0xdc26('0x15')][_0xdc26('0x16')]()){case'autoreply':var _0x56ba8d=_0x59c7c5[_0xdc26('0x17')][_0xdc26('0x18')](',');if(_0x155b7c[_0xdc26('0x10')]==='mail'){_0x14eb49[_0xdc26('0x19')](_0x56ba8d[0x0]);_0x14eb49[_0xdc26('0x19')](_0x56ba8d[0x1]);_0x14eb49[_0xdc26('0x19')](_0x56ba8d['slice'](0x2,_0x56ba8d[_0xdc26('0x14')])['join'](','));}else{_0x14eb49[_0xdc26('0x19')](_0x56ba8d[0x0]);_0x14eb49['push'](_0x56ba8d['slice'](0x1,_0x56ba8d[_0xdc26('0x14')])['join'](','));}break;case'dialogflow':var _0x282c4d=_0x59c7c5[_0xdc26('0x17')][_0xdc26('0x18')](',');_0x14eb49[_0xdc26('0x19')](_0x282c4d[0x0]);_0x14eb49[_0xdc26('0x19')](_0x282c4d[0x1]);_0x14eb49[_0xdc26('0x19')](_0x282c4d[_0xdc26('0x1a')](0x2,_0x282c4d[_0xdc26('0x14')])[_0xdc26('0x1b')](','));break;case _0xdc26('0x1c'):var _0x5e8d2f=_0x59c7c5[_0xdc26('0x17')][_0xdc26('0x18')](',');_0x14eb49['push'](_0x5e8d2f[0x0]);_0x14eb49[_0xdc26('0x19')](_0x5e8d2f[0x1]);_0x14eb49[_0xdc26('0x19')](_0x5e8d2f[0x2]);_0x14eb49[_0xdc26('0x19')](_0x5e8d2f[0x3]);_0x14eb49['push'](_0x5e8d2f['slice'](0x4,_0x5e8d2f['length'])['join'](','));break;case'amazonlex':var _0x100fb1=_0x59c7c5[_0xdc26('0x17')]['split'](',');_0x14eb49['push'](_0x100fb1[0x0]);_0x14eb49[_0xdc26('0x19')](_0x100fb1[0x1]);_0x14eb49[_0xdc26('0x19')](_0x100fb1[0x2]);_0x14eb49[_0xdc26('0x19')](_0x100fb1[0x3]);_0x14eb49[_0xdc26('0x19')](_0x100fb1[_0xdc26('0x1a')](0x4,_0x100fb1[_0xdc26('0x14')])[_0xdc26('0x1b')](','));break;case _0xdc26('0x11'):_0x14eb49['push'](_0x59c7c5[_0xdc26('0x17')]);break;case _0xdc26('0x1d'):_0x14eb49[_0xdc26('0x19')](_0x59c7c5['TagId']);_0x14eb49['push'](_0x59c7c5['appdata']);break;default:_0x14eb49=_[_0xdc26('0xc')](_0x59c7c5[_0xdc26('0x17')])?[]:_0x59c7c5[_0xdc26('0x17')][_0xdc26('0x18')](',');}var _0x1537a6={'id':util[_0xdc26('0x1e')](_0xdc26('0x1f'),_0x2cb271,_0x59c7c5['id'],_0x59c7c5[_0xdc26('0x15')]),'condition':require(_0xdc26('0x20'))[_0xdc26('0x21')](_0x2cb271,getIntervals(_0x3ba678[_0xdc26('0x22')],_0x59c7c5),_0x3ba678),'consequence':require('./applications/'+_0x59c7c5[_0xdc26('0x15')])['consequence'](_0x2cb271,_0x14eb49,_0x3ba678,_0x155b7c),'p':_0x59c7c5[_0xdc26('0x23')]||0x0};logger[_0xdc26('0x24')](_0xdc26('0x25'),_0x1537a6['id'],'on\x20interval',getIntervals(_0x3ba678['intervals'],_0x59c7c5)['join'](_0xdc26('0x26')));_0x5f2222['push'](_0x1537a6);}else{logger[_0xdc26('0x27')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0xdc26('0x13'),_0x59c7c5[_0xdc26('0x15')]+_0xdc26('0x28')));}}_0x3ba678[_0xdc26('0x29')][_0x2cb271]=new RuleEngine(_0x5f2222);_0x3ba678[_0xdc26('0x29')][_0x2cb271][_0xdc26('0x2a')](_0x155b7c,function(_0x2b72c2){logger['info'](_0xdc26('0x2b'),JSON[_0xdc26('0x2c')](_0x2b72c2[_0xdc26('0x2d')]));if(_0x3ba678[_0xdc26('0x29')][_0x2cb271]){_0x3ba678[_0xdc26('0x29')][_0x2cb271][_0xdc26('0x2e')](_0xdc26('0x2f'));}});return _0x314132({'code':0xc8,'message':_0x155b7c});}else{logger[_0xdc26('0x24')](_0xdc26('0x30'));return _0x314132({'code':0xc8,'message':_0x155b7c});}}catch(_0x2290e7){logger['error'](_0x2290e7[_0xdc26('0x31')]);return _0xe435b(_0x314bb0[_0xdc26('0x27')](0x1f4,_0x2290e7));}}return _0xe435b(_0xdc26('0x32'));});},'AcceptMessage':function(_0x53b2ba){var _0x4f2793=this;return new Promise(function(_0x4622bf,_0xd2fcc0){if(_0x53b2ba[_0xdc26('0x33')]&&_0x53b2ba[_0xdc26('0x33')]['id']){if(_0x3ba678['agents'][_0x53b2ba[_0xdc26('0x33')]['id']]){_0x3ba678[_0xdc26('0x34')][_0x53b2ba[_0xdc26('0x33')]['id']]['busy']=![];_0x3ba678['agents'][_0x53b2ba['agent']['id']]['busyQueue']=undefined;}}if(_0x53b2ba[_0xdc26('0x11')]&&_0x53b2ba[_0xdc26('0x11')]['id']){try{var _0x16c2f3=getId(_0x53b2ba['channel'],_0x53b2ba[_0xdc26('0x11')]?_0x53b2ba[_0xdc26('0x11')]['id']:0x0,_0x53b2ba[_0xdc26('0x12')]?_0x53b2ba[_0xdc26('0x12')]['id']:0x0);if(_0x3ba678[_0xdc26('0x29')][_0x16c2f3]){_0x3ba678[_0xdc26('0x29')][_0x16c2f3]['emit'](_0xdc26('0x35'));if(rpc[_0x53b2ba[_0xdc26('0x10')]+'QueueReport']){rpc[_0x53b2ba[_0xdc26('0x10')]+'QueueReport'][_0xdc26('0x36')](_0x16c2f3,{'UserId':_0x53b2ba['message'][_0xdc26('0x37')]})['catch'](function(_0x393bf1){logger[_0xdc26('0x27')](_0xdc26('0x38'));});}}return _0x4622bf({'code':0xc8,'message':_0x53b2ba});}catch(_0x4950da){logger[_0xdc26('0x27')](_0x4950da[_0xdc26('0x31')]);return _0xd2fcc0(_0x4f2793[_0xdc26('0x27')](0x1f4,_0x4950da));}}logger[_0xdc26('0x27')]('message\x20is\x20empty');return _0xd2fcc0(_0x4f2793[_0xdc26('0x27')](0x1f4,_0xdc26('0x39')));});},'RejectMessage':function(_0x5d028b){var _0x22f8e1=this;return new Promise(function(_0x23c68b,_0x1b5bd9){if(_0x5d028b[_0xdc26('0x33')]&&_0x5d028b[_0xdc26('0x33')]['id']){try{if(_0x3ba678[_0xdc26('0x34')][_0x5d028b['agent']['id']]){_0x3ba678[_0xdc26('0x34')][_0x5d028b[_0xdc26('0x33')]['id']][_0xdc26('0x3a')]=![];_0x3ba678[_0xdc26('0x34')][_0x5d028b[_0xdc26('0x33')]['id']][_0xdc26('0x3b')]=undefined;}return _0x23c68b({'code':0xc8,'message':_0x5d028b});}catch(_0x4308f1){logger[_0xdc26('0x27')](_0x4308f1[_0xdc26('0x31')]);return _0x1b5bd9(_0x22f8e1[_0xdc26('0x27')](0x1f4,_0x4308f1));}}logger[_0xdc26('0x27')](_0xdc26('0x39'));return _0x1b5bd9(_0x22f8e1[_0xdc26('0x27')](0x1f4,_0xdc26('0x39')));});},'AbandonInteraction':function(_0x2bd04d){var _0x1852e9=this;return new Promise(function(_0x5dde34,_0xc26fc6){if(_0x2bd04d[_0xdc26('0x10')]&&_0x2bd04d[_0xdc26('0x12')]&&_0x2bd04d['interaction']['id']){try{var _0x1accf4=getId(_0x2bd04d[_0xdc26('0x10')],_0x2bd04d['message']?_0x2bd04d[_0xdc26('0x11')]['id']:0x0,_0x2bd04d[_0xdc26('0x12')]?_0x2bd04d[_0xdc26('0x12')]['id']:0x0);if(_0x3ba678[_0xdc26('0x29')][_0x1accf4]){_0x3ba678['rules'][_0x1accf4][_0xdc26('0x2e')](_0xdc26('0x35'));}return _0x5dde34({'code':0xc8,'message':_0x2bd04d});}catch(_0x30cd15){logger[_0xdc26('0x27')](_0x30cd15[_0xdc26('0x31')]);return _0xc26fc6(_0x1852e9[_0xdc26('0x27')](0x1f4,_0x30cd15));}}logger[_0xdc26('0x27')]('message\x20is\x20empty');return _0xc26fc6(_0x1852e9[_0xdc26('0x27')](0x1f4,_0xdc26('0x39')));});},'AgentCapacity':function(_0x3c7f9e){var _0x31d53d=this;return new Promise(function(_0x44436e,_0x3e3f6c){if(_0x3ba678[_0xdc26('0x34')][_0xdc26('0x3c')](_0x3c7f9e['id'])){for(var _0xec2dff in _0x3c7f9e['capacity']){if(_0x3c7f9e[_0xdc26('0x3d')][_0xdc26('0x3c')](_0xec2dff)){if(_0x3ba678['agents'][_0x3c7f9e['id']]['hasOwnProperty'](_0xec2dff+_0xdc26('0x3e'))){_0x3ba678[_0xdc26('0x34')][_0x3c7f9e['id']][_0xec2dff+'CurrentCapacity']=parseInt(_0x3c7f9e[_0xdc26('0x3d')][_0xec2dff],0xa);}}}_0x3ba678['agents'][_0x3c7f9e['id']][_0xdc26('0x3f')]();return _0x44436e({'code':0xc8,'message':_0x3ba678[_0xdc26('0x34')][_0x3c7f9e['id']]});}else{return _0x3e3f6c(_0x31d53d[_0xdc26('0x27')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x1ef0cb){return new Promise(function(_0x34a287,_0x1baae3){var _0x404412=_[_0xdc26('0x40')](_0x3ba678['agents']);_0x34a287({'count':_0x404412[_0xdc26('0x14')],'rows':_0x404412});});},'ChatQueues':function(_0x353e0a){return new Promise(function(_0x1eced0,_0x3a0e12){var _0x2990d2=[];for(var _0x949499 in _0x3ba678['chatQueues']){if(_0x3ba678[_0xdc26('0x41')][_0xdc26('0x3c')](_0x949499)){var _0x4a2ab5=_0x3ba678[_0xdc26('0x41')][_0x949499];var _0x33602f={'id':_0x4a2ab5['id'],'available':_0x4a2ab5['available'],'loggedIn':_0x4a2ab5[_0xdc26('0x42')],'name':_0x4a2ab5['name'],'paused':_0x4a2ab5[_0xdc26('0x43')],'waiting':_0x4a2ab5[_0xdc26('0x44')]};_0x2990d2[_0xdc26('0x19')](_0x33602f);}}_0x1eced0({'count':_0x2990d2[_0xdc26('0x14')],'rows':_0x2990d2});});},'MailQueues':function(_0x32be64){return new Promise(function(_0x5c7572,_0xde9d37){var _0x56396f=[];for(var _0x5b0d8d in _0x3ba678['mailQueues']){if(_0x3ba678[_0xdc26('0x45')]['hasOwnProperty'](_0x5b0d8d)){var _0x4466a1=_0x3ba678['mailQueues'][_0x5b0d8d];var _0x1a6efe={'id':_0x4466a1['id'],'available':_0x4466a1['available'],'loggedIn':_0x4466a1[_0xdc26('0x42')],'name':_0x4466a1[_0xdc26('0x46')],'paused':_0x4466a1[_0xdc26('0x43')],'waiting':_0x4466a1[_0xdc26('0x44')]};_0x56396f[_0xdc26('0x19')](_0x1a6efe);}}_0x5c7572({'count':_0x56396f[_0xdc26('0x14')],'rows':_0x56396f});});},'OpenchannelQueues':function(_0x3524a0){return new Promise(function(_0x3f6af3,_0x1c4d81){var _0x544ad4=[];for(var _0x55bf96 in _0x3ba678[_0xdc26('0x47')]){if(_0x3ba678['openchannelQueues'][_0xdc26('0x3c')](_0x55bf96)){var _0x26d4c9=_0x3ba678[_0xdc26('0x47')][_0x55bf96];var _0x363695={'id':_0x26d4c9['id'],'available':_0x26d4c9[_0xdc26('0x48')],'loggedIn':_0x26d4c9['loggedIn'],'name':_0x26d4c9[_0xdc26('0x46')],'paused':_0x26d4c9[_0xdc26('0x43')],'waiting':_0x26d4c9['waiting']};_0x544ad4['push'](_0x363695);}}_0x3f6af3({'count':_0x544ad4[_0xdc26('0x14')],'rows':_0x544ad4});});},'SmsQueues':function(_0x52d3b9){return new Promise(function(_0x20e532,_0x2e0955){var _0x358a18=[];for(var _0x4ae825 in _0x3ba678['smsQueues']){if(_0x3ba678[_0xdc26('0x49')][_0xdc26('0x3c')](_0x4ae825)){var _0x43849a=_0x3ba678['smsQueues'][_0x4ae825];var _0x423587={'id':_0x43849a['id'],'available':_0x43849a[_0xdc26('0x48')],'loggedIn':_0x43849a[_0xdc26('0x42')],'name':_0x43849a[_0xdc26('0x46')],'paused':_0x43849a[_0xdc26('0x43')],'waiting':_0x43849a[_0xdc26('0x44')]};_0x358a18['push'](_0x423587);}}_0x20e532({'count':_0x358a18['length'],'rows':_0x358a18});});},'FaxQueues':function(_0xd7dd89){return new Promise(function(_0x1e835a,_0x3528d0){var _0x5b8919=[];for(var _0x472420 in _0x3ba678[_0xdc26('0x4a')]){if(_0x3ba678[_0xdc26('0x4a')][_0xdc26('0x3c')](_0x472420)){var _0x504fa8=_0x3ba678[_0xdc26('0x4a')][_0x472420];var _0x4197a1={'id':_0x504fa8['id'],'available':_0x504fa8[_0xdc26('0x48')],'loggedIn':_0x504fa8[_0xdc26('0x42')],'name':_0x504fa8[_0xdc26('0x46')],'paused':_0x504fa8[_0xdc26('0x43')],'waiting':_0x504fa8[_0xdc26('0x44')]};_0x5b8919['push'](_0x4197a1);}}_0x1e835a({'count':_0x5b8919[_0xdc26('0x14')],'rows':_0x5b8919});});},'WhatsappQueues':function(_0x21515d){return new Promise(function(_0x478ec3,_0x81f5ca){var _0x40d660=[];for(var _0x1b5901 in _0x3ba678[_0xdc26('0x4b')]){if(_0x3ba678['whatsappQueues']['hasOwnProperty'](_0x1b5901)){var _0x1867bd=_0x3ba678[_0xdc26('0x4b')][_0x1b5901];var _0x2acb6a={'id':_0x1867bd['id'],'available':_0x1867bd['available'],'loggedIn':_0x1867bd[_0xdc26('0x42')],'name':_0x1867bd[_0xdc26('0x46')],'paused':_0x1867bd['paused'],'waiting':_0x1867bd[_0xdc26('0x44')]};_0x40d660[_0xdc26('0x19')](_0x2acb6a);}}_0x478ec3({'count':_0x40d660[_0xdc26('0x14')],'rows':_0x40d660});});},'ChatQueuesWaitingInteractions':function(_0x148190){return new Promise(function(_0xb02c49,_0x4f1710){var _0x1cc811=_[_0xdc26('0x40')](_0x3ba678[_0xdc26('0x4c')]);_0xb02c49({'count':_0x1cc811[_0xdc26('0x14')],'rows':_0x1cc811});});},'MailQueuesWaitingInteractions':function(_0x343dac){return new Promise(function(_0x3d19c8,_0x389357){var _0x177ea2=_['values'](_0x3ba678[_0xdc26('0x4d')]);_0x3d19c8({'count':_0x177ea2[_0xdc26('0x14')],'rows':_0x177ea2});});},'OpenchannelQueuesWaitingInteractions':function(_0x33ee3b){return new Promise(function(_0x41e62e,_0x1a986f){var _0x294a3c=_[_0xdc26('0x40')](_0x3ba678[_0xdc26('0x4e')]);_0x41e62e({'count':_0x294a3c[_0xdc26('0x14')],'rows':_0x294a3c});});},'SmsQueuesWaitingInteractions':function(_0x5ea59c){return new Promise(function(_0x2a49df,_0x260bf9){var _0x166eb8=_[_0xdc26('0x40')](_0x3ba678[_0xdc26('0x4f')]);_0x2a49df({'count':_0x166eb8[_0xdc26('0x14')],'rows':_0x166eb8});});},'FaxQueuesWaitingInteractions':function(_0x14d367){return new Promise(function(_0x4808a4,_0x3582a6){var _0x3375fa=_['values'](_0x3ba678[_0xdc26('0x50')]);_0x4808a4({'count':_0x3375fa[_0xdc26('0x14')],'rows':_0x3375fa});});},'WhatsappQueuesWaitingInteractions':function(_0x28f846){return new Promise(function(_0x1fe92d,_0x4d53ca){var _0xdef717=_[_0xdc26('0x40')](_0x3ba678['whatsappQueuesWaitingInteractions']);_0x1fe92d({'count':_0xdef717[_0xdc26('0x14')],'rows':_0xdef717});});}};var _0x5ea895=jayson['server'](_0x34cc7b)['http']();_0x5ea895['on'](_0xdc26('0x27'),function(_0x51e5d3){logger['error'](JSON[_0xdc26('0x2c')](_0x51e5d3));return _0x4f2c85(_0x51e5d3);});_0x5ea895[_0xdc26('0xf')](0x232c,'127.0.0.1',function(){console[_0xdc26('0x51')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x1b261e(_0xdc26('0x52')+0x232c);});});}; \ No newline at end of file +var _0xd56e=['smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','existsSync','join','app','toLowerCase','appdata','mail','push','slice','dialogflow','split','dialogflowv2','amazonlex','tag','TagId','./interval','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','execute','Applications\x20executed','matchPath','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues'];(function(_0x41b9b4,_0x4264ed){var _0x3241af=function(_0x215412){while(--_0x215412){_0x41b9b4['push'](_0x41b9b4['shift']());}};_0x3241af(++_0x4264ed);}(_0xd56e,0x1e8));var _0xed56=function(_0x1ba775,_0x3ab394){_0x1ba775=_0x1ba775-0x0;var _0x567163=_0xd56e[_0x1ba775];return _0x567163;};'use strict';var _=require(_0xed56('0x0'));var util=require(_0xed56('0x1'));var path=require(_0xed56('0x2'));var fs=require('fs');var jayson=require(_0xed56('0x3'));var BPromise=require(_0xed56('0x4'));var uuid=require('uuid');var config=require(_0xed56('0x5'));var logger=require('../../../config/logger')(_0xed56('0x6'));var rpc={'openchannelQueueReport':require(_0xed56('0x7')),'mailQueueReport':require(_0xed56('0x8')),'chatQueueReport':require(_0xed56('0x9')),'smsQueueReport':require(_0xed56('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xed56('0xb'))};var RuleEngine=require(_0xed56('0xc'));function getId(_0x3152d5,_0x369fb1,_0x5de9ac){return util[_0xed56('0xd')](_0xed56('0xe'),_0x3152d5,_0x369fb1||0x0,_0x5de9ac||0x0);}function getIntervals(_0x476c5c,_0x3259a8){var _0x57e63e=[];if(!_['isNil'](_0x3259a8[_0xed56('0xf')])&&!_[_0xed56('0x10')](_0x476c5c[_0x3259a8[_0xed56('0xf')]])&&!_[_0xed56('0x10')](_0x476c5c[_0x3259a8[_0xed56('0xf')]][_0xed56('0x11')])){_0x57e63e=_['map'](_0x476c5c[_0x3259a8[_0xed56('0xf')]][_0xed56('0x11')],_0xed56('0x12'));}else if(!_['isNil'](_0x3259a8[_0xed56('0x12')])){_0x57e63e=[_0x3259a8[_0xed56('0x12')]];}return _0x57e63e;}exports[_0xed56('0x13')]=function(_0x557964){_0x557964[_0xed56('0x14')]={};return new BPromise(function(_0x1420a6,_0x1480b0){var _0x3d190d={'Start':function(_0x27003d){var _0x23ba8c=this;return new Promise(function(_0x2935f5,_0x39a5bd){if(_0x27003d){try{var _0x32fba6=[];var _0x1d1a3b=getId(_0x27003d[_0xed56('0x15')],_0x27003d[_0xed56('0x16')]?_0x27003d[_0xed56('0x16')]['id']:0x0,_0x27003d[_0xed56('0x17')]?_0x27003d[_0xed56('0x17')]['id']:0x0);if(_0x27003d['applications']&&_[_0xed56('0x18')](_0x27003d[_0xed56('0x19')])&&_0x27003d[_0xed56('0x19')][_0xed56('0x1a')]){for(var _0x1450db=0x0;_0x1450db<_0x27003d['applications'][_0xed56('0x1a')];_0x1450db+=0x1){var _0x51c15a=_0x27003d[_0xed56('0x19')][_0x1450db];if(fs[_0xed56('0x1b')](path[_0xed56('0x1c')](__dirname,_0xed56('0x19'),_0x51c15a[_0xed56('0x1d')]+'.js'))){var _0x447460=[];switch(_0x51c15a['app'][_0xed56('0x1e')]()){case'autoreply':var _0x230507=_0x51c15a[_0xed56('0x1f')]['split'](',');if(_0x27003d[_0xed56('0x15')]===_0xed56('0x20')){_0x447460['push'](_0x230507[0x0]);_0x447460[_0xed56('0x21')](_0x230507[0x1]);_0x447460['push'](_0x230507['slice'](0x2,_0x230507[_0xed56('0x1a')])[_0xed56('0x1c')](','));}else{_0x447460[_0xed56('0x21')](_0x230507[0x0]);_0x447460[_0xed56('0x21')](_0x230507[_0xed56('0x22')](0x1,_0x230507['length'])[_0xed56('0x1c')](','));}break;case _0xed56('0x23'):var _0x330dc5=_0x51c15a[_0xed56('0x1f')][_0xed56('0x24')](',');_0x447460[_0xed56('0x21')](_0x330dc5[0x0]);_0x447460['push'](_0x330dc5[0x1]);_0x447460[_0xed56('0x21')](_0x330dc5[_0xed56('0x22')](0x2,_0x330dc5[_0xed56('0x1a')])['join'](','));break;case _0xed56('0x25'):var _0x515665=_0x51c15a[_0xed56('0x1f')][_0xed56('0x24')](',');_0x447460[_0xed56('0x21')](_0x515665[0x0]);_0x447460[_0xed56('0x21')](_0x515665[0x1]);_0x447460[_0xed56('0x21')](_0x515665[0x2]);_0x447460[_0xed56('0x21')](_0x515665[0x3]);_0x447460[_0xed56('0x21')](_0x515665[_0xed56('0x22')](0x4,_0x515665['length'])['join'](','));break;case _0xed56('0x26'):var _0x326664=_0x51c15a[_0xed56('0x1f')][_0xed56('0x24')](',');_0x447460[_0xed56('0x21')](_0x326664[0x0]);_0x447460[_0xed56('0x21')](_0x326664[0x1]);_0x447460[_0xed56('0x21')](_0x326664[0x2]);_0x447460[_0xed56('0x21')](_0x326664[0x3]);_0x447460['push'](_0x326664[_0xed56('0x22')](0x4,_0x326664['length'])['join'](','));break;case _0xed56('0x16'):_0x447460[_0xed56('0x21')](_0x51c15a['appdata']);break;case _0xed56('0x27'):_0x447460[_0xed56('0x21')](_0x51c15a[_0xed56('0x28')]);_0x447460[_0xed56('0x21')](_0x51c15a[_0xed56('0x1f')]);break;default:_0x447460=_['isNil'](_0x51c15a['appdata'])?[]:_0x51c15a[_0xed56('0x1f')][_0xed56('0x24')](',');}var _0x34a8a9={'id':util[_0xed56('0xd')]('%s:%s:%s',_0x1d1a3b,_0x51c15a['id'],_0x51c15a['app']),'condition':require(_0xed56('0x29'))['condition'](_0x1d1a3b,getIntervals(_0x557964[_0xed56('0x2a')],_0x51c15a),_0x557964),'consequence':require('./applications/'+_0x51c15a['app'])[_0xed56('0x2b')](_0x1d1a3b,_0x447460,_0x557964,_0x27003d),'p':_0x51c15a[_0xed56('0x2c')]||0x0};logger[_0xed56('0x2d')](_0xed56('0x2e'),_0x34a8a9['id'],_0xed56('0x2f'),getIntervals(_0x557964[_0xed56('0x2a')],_0x51c15a)['join'](_0xed56('0x30')));_0x32fba6['push'](_0x34a8a9);}else{logger[_0xed56('0x31')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xed56('0x1c')](__dirname,'applications',_0x51c15a[_0xed56('0x1d')]+'.js'));}}_0x557964['rules'][_0x1d1a3b]=new RuleEngine(_0x32fba6);_0x557964[_0xed56('0x14')][_0x1d1a3b][_0xed56('0x32')](_0x27003d,function(_0x30cdc9){logger[_0xed56('0x2d')](_0xed56('0x33'),JSON['stringify'](_0x30cdc9[_0xed56('0x34')]));if(_0x557964[_0xed56('0x14')][_0x1d1a3b]){_0x557964['rules'][_0x1d1a3b][_0xed56('0x35')](_0xed56('0x36'));}});return _0x2935f5({'code':0xc8,'message':_0x27003d});}else{logger[_0xed56('0x2d')](_0xed56('0x37'));return _0x2935f5({'code':0xc8,'message':_0x27003d});}}catch(_0x44f118){logger[_0xed56('0x31')](_0x44f118['stack']);return _0x39a5bd(_0x23ba8c['error'](0x1f4,_0x44f118));}}return _0x39a5bd(_0xed56('0x38'));});},'AcceptMessage':function(_0x4271be){var _0x3f9aea=this;return new Promise(function(_0x534bd8,_0x21da26){if(_0x4271be[_0xed56('0x39')]&&_0x4271be[_0xed56('0x39')]['id']){if(_0x557964[_0xed56('0x3a')][_0x4271be[_0xed56('0x39')]['id']]){_0x557964[_0xed56('0x3a')][_0x4271be['agent']['id']][_0xed56('0x3b')]=![];_0x557964[_0xed56('0x3a')][_0x4271be[_0xed56('0x39')]['id']][_0xed56('0x3c')]=undefined;}}if(_0x4271be[_0xed56('0x16')]&&_0x4271be['message']['id']){try{var _0x440b3d=getId(_0x4271be[_0xed56('0x15')],_0x4271be['message']?_0x4271be[_0xed56('0x16')]['id']:0x0,_0x4271be[_0xed56('0x17')]?_0x4271be['interaction']['id']:0x0);if(_0x557964[_0xed56('0x14')][_0x440b3d]){_0x557964['rules'][_0x440b3d][_0xed56('0x35')](_0xed56('0x3d'));if(rpc[_0x4271be[_0xed56('0x15')]+_0xed56('0x3e')]){rpc[_0x4271be['channel']+'QueueReport']['update'](_0x440b3d,{'UserId':_0x4271be[_0xed56('0x16')][_0xed56('0x3f')]})[_0xed56('0x40')](function(_0x2f0ac2){logger[_0xed56('0x31')](_0xed56('0x41'));});}}return _0x534bd8({'code':0xc8,'message':_0x4271be});}catch(_0x51dcad){logger[_0xed56('0x31')](_0x51dcad[_0xed56('0x42')]);return _0x21da26(_0x3f9aea[_0xed56('0x31')](0x1f4,_0x51dcad));}}logger[_0xed56('0x31')]('message\x20is\x20empty');return _0x21da26(_0x3f9aea[_0xed56('0x31')](0x1f4,_0xed56('0x43')));});},'RejectMessage':function(_0x132463){var _0x5a7165=this;return new Promise(function(_0x5dbc73,_0x3df53e){if(_0x132463[_0xed56('0x39')]&&_0x132463[_0xed56('0x39')]['id']){try{if(_0x557964[_0xed56('0x3a')][_0x132463[_0xed56('0x39')]['id']]){_0x557964[_0xed56('0x3a')][_0x132463[_0xed56('0x39')]['id']]['busy']=![];_0x557964[_0xed56('0x3a')][_0x132463[_0xed56('0x39')]['id']]['busyQueue']=undefined;}return _0x5dbc73({'code':0xc8,'message':_0x132463});}catch(_0x7f985d){logger['error'](_0x7f985d['stack']);return _0x3df53e(_0x5a7165[_0xed56('0x31')](0x1f4,_0x7f985d));}}logger[_0xed56('0x31')](_0xed56('0x43'));return _0x3df53e(_0x5a7165[_0xed56('0x31')](0x1f4,_0xed56('0x43')));});},'AbandonInteraction':function(_0xfff0b8){var _0x1eb783=this;return new Promise(function(_0x53d531,_0x154b62){if(_0xfff0b8[_0xed56('0x15')]&&_0xfff0b8[_0xed56('0x17')]&&_0xfff0b8[_0xed56('0x17')]['id']){try{var _0x50b8bd=getId(_0xfff0b8['channel'],_0xfff0b8[_0xed56('0x16')]?_0xfff0b8['message']['id']:0x0,_0xfff0b8['interaction']?_0xfff0b8['interaction']['id']:0x0);if(_0x557964[_0xed56('0x14')][_0x50b8bd]){_0x557964[_0xed56('0x14')][_0x50b8bd][_0xed56('0x35')]('end');}return _0x53d531({'code':0xc8,'message':_0xfff0b8});}catch(_0x3ea288){logger['error'](_0x3ea288[_0xed56('0x42')]);return _0x154b62(_0x1eb783[_0xed56('0x31')](0x1f4,_0x3ea288));}}logger[_0xed56('0x31')](_0xed56('0x43'));return _0x154b62(_0x1eb783[_0xed56('0x31')](0x1f4,_0xed56('0x43')));});},'AgentCapacity':function(_0x5b31ee){var _0x47ca4c=this;return new Promise(function(_0x39811d,_0x1398ec){if(_0x557964['agents'][_0xed56('0x44')](_0x5b31ee['id'])){for(var _0x2e83fb in _0x5b31ee[_0xed56('0x45')]){if(_0x5b31ee[_0xed56('0x45')][_0xed56('0x44')](_0x2e83fb)){if(_0x557964[_0xed56('0x3a')][_0x5b31ee['id']][_0xed56('0x44')](_0x2e83fb+_0xed56('0x46'))){_0x557964[_0xed56('0x3a')][_0x5b31ee['id']][_0x2e83fb+_0xed56('0x46')]=parseInt(_0x5b31ee[_0xed56('0x45')][_0x2e83fb],0xa);}}}_0x557964[_0xed56('0x3a')][_0x5b31ee['id']][_0xed56('0x47')]();return _0x39811d({'code':0xc8,'message':_0x557964['agents'][_0x5b31ee['id']]});}else{return _0x1398ec(_0x47ca4c[_0xed56('0x31')](0x1f4,_0xed56('0x48')));}});},'Agents':function(_0x2311fa){return new Promise(function(_0x566e4a,_0x241d45){var _0x248313=_[_0xed56('0x49')](_0x557964[_0xed56('0x3a')]);_0x566e4a({'count':_0x248313[_0xed56('0x1a')],'rows':_0x248313});});},'ChatQueues':function(_0x219336){return new Promise(function(_0x23609a,_0x2916ee){var _0x27424a=[];for(var _0x28f12f in _0x557964['chatQueues']){if(_0x557964[_0xed56('0x4a')][_0xed56('0x44')](_0x28f12f)){var _0x16f20f=_0x557964['chatQueues'][_0x28f12f];var _0x4eec9c={'id':_0x16f20f['id'],'available':_0x16f20f[_0xed56('0x4b')],'loggedIn':_0x16f20f[_0xed56('0x4c')],'name':_0x16f20f[_0xed56('0x4d')],'paused':_0x16f20f[_0xed56('0x4e')],'waiting':_0x16f20f[_0xed56('0x4f')]};_0x27424a[_0xed56('0x21')](_0x4eec9c);}}_0x23609a({'count':_0x27424a['length'],'rows':_0x27424a});});},'MailQueues':function(_0x453301){return new Promise(function(_0x1bc939,_0x23e5e5){var _0x1f6dbd=[];for(var _0x89c80 in _0x557964[_0xed56('0x50')]){if(_0x557964[_0xed56('0x50')]['hasOwnProperty'](_0x89c80)){var _0x1df44f=_0x557964[_0xed56('0x50')][_0x89c80];var _0x6898ec={'id':_0x1df44f['id'],'available':_0x1df44f[_0xed56('0x4b')],'loggedIn':_0x1df44f[_0xed56('0x4c')],'name':_0x1df44f[_0xed56('0x4d')],'paused':_0x1df44f[_0xed56('0x4e')],'waiting':_0x1df44f[_0xed56('0x4f')]};_0x1f6dbd[_0xed56('0x21')](_0x6898ec);}}_0x1bc939({'count':_0x1f6dbd[_0xed56('0x1a')],'rows':_0x1f6dbd});});},'OpenchannelQueues':function(_0x422001){return new Promise(function(_0x5bcbc1,_0x1e4e26){var _0x18b072=[];for(var _0x4c1939 in _0x557964['openchannelQueues']){if(_0x557964['openchannelQueues'][_0xed56('0x44')](_0x4c1939)){var _0x4359c0=_0x557964[_0xed56('0x51')][_0x4c1939];var _0x19eac7={'id':_0x4359c0['id'],'available':_0x4359c0[_0xed56('0x4b')],'loggedIn':_0x4359c0[_0xed56('0x4c')],'name':_0x4359c0[_0xed56('0x4d')],'paused':_0x4359c0[_0xed56('0x4e')],'waiting':_0x4359c0[_0xed56('0x4f')]};_0x18b072[_0xed56('0x21')](_0x19eac7);}}_0x5bcbc1({'count':_0x18b072['length'],'rows':_0x18b072});});},'SmsQueues':function(_0x3c7125){return new Promise(function(_0x29a5a5,_0x1eae7c){var _0x1cd061=[];for(var _0x2ee4ed in _0x557964['smsQueues']){if(_0x557964[_0xed56('0x52')][_0xed56('0x44')](_0x2ee4ed)){var _0x2ad635=_0x557964[_0xed56('0x52')][_0x2ee4ed];var _0x442f7e={'id':_0x2ad635['id'],'available':_0x2ad635[_0xed56('0x4b')],'loggedIn':_0x2ad635[_0xed56('0x4c')],'name':_0x2ad635['name'],'paused':_0x2ad635[_0xed56('0x4e')],'waiting':_0x2ad635[_0xed56('0x4f')]};_0x1cd061[_0xed56('0x21')](_0x442f7e);}}_0x29a5a5({'count':_0x1cd061['length'],'rows':_0x1cd061});});},'FaxQueues':function(_0x57d791){return new Promise(function(_0x16cd5d,_0x158701){var _0x3cdd65=[];for(var _0x4bfeb6 in _0x557964['faxQueues']){if(_0x557964['faxQueues']['hasOwnProperty'](_0x4bfeb6)){var _0x55b5bf=_0x557964[_0xed56('0x53')][_0x4bfeb6];var _0x12f587={'id':_0x55b5bf['id'],'available':_0x55b5bf['available'],'loggedIn':_0x55b5bf[_0xed56('0x4c')],'name':_0x55b5bf[_0xed56('0x4d')],'paused':_0x55b5bf[_0xed56('0x4e')],'waiting':_0x55b5bf['waiting']};_0x3cdd65[_0xed56('0x21')](_0x12f587);}}_0x16cd5d({'count':_0x3cdd65[_0xed56('0x1a')],'rows':_0x3cdd65});});},'WhatsappQueues':function(_0x15cc39){return new Promise(function(_0x234f27,_0x3a345b){var _0x2c0816=[];for(var _0x5b0272 in _0x557964[_0xed56('0x54')]){if(_0x557964['whatsappQueues']['hasOwnProperty'](_0x5b0272)){var _0x92e35a=_0x557964[_0xed56('0x54')][_0x5b0272];var _0x5eaff6={'id':_0x92e35a['id'],'available':_0x92e35a[_0xed56('0x4b')],'loggedIn':_0x92e35a[_0xed56('0x4c')],'name':_0x92e35a['name'],'paused':_0x92e35a[_0xed56('0x4e')],'waiting':_0x92e35a[_0xed56('0x4f')]};_0x2c0816[_0xed56('0x21')](_0x5eaff6);}}_0x234f27({'count':_0x2c0816[_0xed56('0x1a')],'rows':_0x2c0816});});},'ChatQueuesWaitingInteractions':function(_0x31e5b5){return new Promise(function(_0x46f065,_0x41d1f3){var _0x4ba3d0=_[_0xed56('0x49')](_0x557964[_0xed56('0x55')]);_0x46f065({'count':_0x4ba3d0[_0xed56('0x1a')],'rows':_0x4ba3d0});});},'MailQueuesWaitingInteractions':function(_0x56f0ac){return new Promise(function(_0x3ace92,_0x507675){var _0x38148b=_['values'](_0x557964[_0xed56('0x56')]);_0x3ace92({'count':_0x38148b[_0xed56('0x1a')],'rows':_0x38148b});});},'OpenchannelQueuesWaitingInteractions':function(_0x5e5f41){return new Promise(function(_0x4ce3a0,_0x5789bf){var _0x57f6bd=_[_0xed56('0x49')](_0x557964[_0xed56('0x57')]);_0x4ce3a0({'count':_0x57f6bd['length'],'rows':_0x57f6bd});});},'SmsQueuesWaitingInteractions':function(_0x513b67){return new Promise(function(_0x368107,_0x47db18){var _0x24360c=_[_0xed56('0x49')](_0x557964[_0xed56('0x58')]);_0x368107({'count':_0x24360c['length'],'rows':_0x24360c});});},'FaxQueuesWaitingInteractions':function(_0x25df63){return new Promise(function(_0x511da3,_0x3a6b2f){var _0x19e8e8=_['values'](_0x557964['faxQueuesWaitingInteractions']);_0x511da3({'count':_0x19e8e8[_0xed56('0x1a')],'rows':_0x19e8e8});});},'WhatsappQueuesWaitingInteractions':function(_0x45fe5f){return new Promise(function(_0x39be28,_0x38c95d){var _0x2c7a8e=_[_0xed56('0x49')](_0x557964['whatsappQueuesWaitingInteractions']);_0x39be28({'count':_0x2c7a8e[_0xed56('0x1a')],'rows':_0x2c7a8e});});}};var _0x21057c=jayson[_0xed56('0x59')](_0x3d190d)[_0xed56('0x5a')]();_0x21057c['on'](_0xed56('0x31'),function(_0x432801){logger['error'](JSON[_0xed56('0x5b')](_0x432801));return _0x1480b0(_0x432801);});_0x21057c[_0xed56('0x13')](0x232c,_0xed56('0x5c'),function(){console[_0xed56('0x5d')](_0xed56('0x5e'),0x232c);return _0x1420a6('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 a0c33e8..c845eda 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 _0xa54a=['routing','client','http','request','then','error','message','result','catch','condition','rules','info','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','stack','util','jayson/promise','../../../config/logger'];(function(_0xb529a0,_0x5b607f){var _0x558689=function(_0x46b1d5){while(--_0x46b1d5){_0xb529a0['push'](_0xb529a0['shift']());}};_0x558689(++_0x5b607f);}(_0xa54a,0x1bf));var _0xaa54=function(_0x526c54,_0x5b4ab5){_0x526c54=_0x526c54-0x0;var _0x41ba47=_0xa54a[_0x526c54];return _0x41ba47;};'use strict';var util=require(_0xaa54('0x0'));var BPromise=require('bluebird');var jayson=require(_0xaa54('0x1'));var _=require('lodash');var logger=require(_0xaa54('0x2'))(_0xaa54('0x3'));var client=jayson[_0xaa54('0x4')][_0xaa54('0x5')]({'port':0x232a});function request(_0x527aab,_0x5e4b3a){return new BPromise(function(_0x191d67,_0x4e89d5){return client[_0xaa54('0x6')](_0x527aab,_0x5e4b3a)[_0xaa54('0x7')](function(_0x5a1d99){if(_0x5a1d99['error']){return _0x4e89d5(_0x5a1d99[_0xaa54('0x8')][_0xaa54('0x9')]);}else{return _0x191d67(_0x5a1d99[_0xaa54('0xa')]);}})[_0xaa54('0xb')](function(_0x17ffe4){return _0x4e89d5(_0x17ffe4);});});}exports[_0xaa54('0xc')]=function(_0x530a45,_0x65cf93,_0x32ac48){return function(_0x58c10c){if(_0x32ac48[_0xaa54('0xd')]&&!_0x32ac48['rules'][_0x530a45]){logger[_0xaa54('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x530a45);return _0x58c10c[_0xaa54('0xf')]();}var _0x4776bd=[];for(var _0x9aaf83=0x0;_0x9aaf83<_0x65cf93[_0xaa54('0x10')];_0x9aaf83+=0x1){_0x4776bd[_0xaa54('0x11')](request(_0xaa54('0x12'),{'command':util[_0xaa54('0x13')](_0xaa54('0x14'),_0x65cf93[_0x9aaf83])})['then'](function(_0x1024cc){return _0x1024cc&&_0x1024cc[_0xaa54('0x9')]&&_0x1024cc['message'][_0xaa54('0x15')](_0xaa54('0x16'))>=0x0?!![]:![];})[_0xaa54('0xb')](function(_0x4db675){logger['error'](_0xaa54('0x17'),_0x530a45,_0x65cf93[_0x9aaf83]);}));}BPromise[_0xaa54('0x18')](_0x4776bd)['then'](function(_0xe2384){var _0x5853a7=_['some'](_0xe2384);logger[_0xaa54('0xe')](_0xaa54('0x19'),_0x530a45,_0x65cf93['join'](_0xaa54('0x1a')),_0x5853a7);_0x58c10c[_0xaa54('0x1b')](_0x5853a7);})[_0xaa54('0xb')](function(_0x11af85){console[_0xaa54('0x1c')](_0x11af85);logger[_0xaa54('0x8')](_0xaa54('0x19'),_0x530a45,_0x65cf93['join'](_0xaa54('0x1a')),_0x11af85[_0xaa54('0x1d')]);_0x58c10c[_0xaa54('0xf')]();});};}; \ No newline at end of file +var _0x3eac=['stop','length','push','Command','format','iftime\x20%s','message','indexOf','true','error','[%s][INTERVAL]\x20%s','all','then','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','util','jayson/promise','lodash','../../../config/logger','routing','http','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0x3eac,0xec));var _0xc3ea=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x3eac[_0x2b5b44];return _0x32cb66;};'use strict';var util=require(_0xc3ea('0x0'));var BPromise=require('bluebird');var jayson=require(_0xc3ea('0x1'));var _=require(_0xc3ea('0x2'));var logger=require(_0xc3ea('0x3'))(_0xc3ea('0x4'));var client=jayson['client'][_0xc3ea('0x5')]({'port':0x232a});function request(_0x657849,_0x1c5c70){return new BPromise(function(_0x179172,_0x5d67b){return client['request'](_0x657849,_0x1c5c70)['then'](function(_0x5dcfd3){if(_0x5dcfd3['error']){return _0x5d67b(_0x5dcfd3['error']['message']);}else{return _0x179172(_0x5dcfd3[_0xc3ea('0x6')]);}})[_0xc3ea('0x7')](function(_0x19410b){return _0x5d67b(_0x19410b);});});}exports[_0xc3ea('0x8')]=function(_0x4a22e0,_0x3f7e90,_0x5d9780){return function(_0x596b4e){if(_0x5d9780['rules']&&!_0x5d9780[_0xc3ea('0x9')][_0x4a22e0]){logger[_0xc3ea('0xa')](_0xc3ea('0xb'),_0x4a22e0);return _0x596b4e[_0xc3ea('0xc')]();}var _0x3d1dfd=[];for(var _0x5e5060=0x0;_0x5e5060<_0x3f7e90[_0xc3ea('0xd')];_0x5e5060+=0x1){_0x3d1dfd[_0xc3ea('0xe')](request(_0xc3ea('0xf'),{'command':util[_0xc3ea('0x10')](_0xc3ea('0x11'),_0x3f7e90[_0x5e5060])})['then'](function(_0x426b2c){return _0x426b2c&&_0x426b2c[_0xc3ea('0x12')]&&_0x426b2c[_0xc3ea('0x12')][_0xc3ea('0x13')](_0xc3ea('0x14'))>=0x0?!![]:![];})[_0xc3ea('0x7')](function(_0x593184){logger[_0xc3ea('0x15')](_0xc3ea('0x16'),_0x4a22e0,_0x3f7e90[_0x5e5060]);}));}BPromise[_0xc3ea('0x17')](_0x3d1dfd)[_0xc3ea('0x18')](function(_0x27ff8d){var _0xdec520=_[_0xc3ea('0x19')](_0x27ff8d);logger[_0xc3ea('0xa')](_0xc3ea('0x1a'),_0x4a22e0,_0x3f7e90[_0xc3ea('0x1b')](_0xc3ea('0x1c')),_0xdec520);_0x596b4e['when'](_0xdec520);})[_0xc3ea('0x7')](function(_0x5da399){console[_0xc3ea('0x1d')](_0x5da399);logger[_0xc3ea('0x15')]('[%s][INTERVAL]\x20%s\x20%s',_0x4a22e0,_0x3f7e90[_0xc3ea('0x1b')](_0xc3ea('0x1c')),_0x5da399[_0xc3ea('0x1e')]);_0x596b4e[_0xc3ea('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index a03409e..8a1cabc 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 _0xb469=['agentringnoanswerAt','timeout','holdtime','ringtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','splice','diffTime','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','format','uniqueid','channel','membername','interface','connectedlinenum','getVoiceQueueByName','then','type','agentacw','acw','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','error','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout'];(function(_0x2eb449,_0x15f81a){var _0x52542d=function(_0x10836d){while(--_0x10836d){_0x2eb449['push'](_0x2eb449['shift']());}};_0x52542d(++_0x15f81a);}(_0xb469,0x13b));var _0x9b46=function(_0x3baf8c,_0x2b2562){_0x3baf8c=_0x3baf8c-0x0;var _0x8e7dd8=_0xb469[_0x3baf8c];return _0x8e7dd8;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var utils=require(_0x9b46('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x34f477,_0x1a41e8){utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x34f477[_0x9b46('0x5')],_0x34f477[_0x9b46('0x6')],_0x34f477['queue'],_0x34f477[_0x9b46('0x7')],_0x34f477[_0x9b46('0x8')],_0x34f477['calleridnum'],_0x34f477[_0x9b46('0x9')],_0x34f477['lastevent']));if(_0x34f477['queue']){utils[_0x9b46('0xa')](_0x34f477['queue'])[_0x9b46('0xb')](function(_0xb9d1b5){if(_0xb9d1b5){_0x34f477[_0x9b46('0xc')]=_0xb9d1b5['type'];_0x34f477[_0x9b46('0xd')]=_0x34f477['agentcomplete']?_0xb9d1b5[_0x9b46('0xe')]:![];_0x34f477['acwtime']=_0x34f477[_0x9b46('0xd')]?_0xb9d1b5['acwTimeout']:0x0;}utils[_0x9b46('0xf')](_0x9b46('0x10'),_0x34f477);});}else{utils['request'](_0x9b46('0x10'),_0x34f477);}if(_0x1a41e8){delete transfers[_0x34f477[_0x9b46('0x5')]];}else{delete agents[_0x34f477['destuniqueid']];}}exports[_0x9b46('0x11')]=function(_0x2cfb35){try{utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x13'),_0x2cfb35[_0x9b46('0x5')]),_0x2cfb35);agents[_0x2cfb35[_0x9b46('0x14')]]=_0x2cfb35;agents[_0x2cfb35[_0x9b46('0x14')]][_0x9b46('0x15')]=utils[_0x9b46('0x16')]();agents[_0x2cfb35[_0x9b46('0x14')]][_0x9b46('0x17')]=_0x9b46('0x18');agents[_0x2cfb35['destuniqueid']]['connectedlinenum']=null;agents[_0x2cfb35['destuniqueid']][_0x9b46('0x19')]=null;utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2cfb35['uniqueid'],agents[_0x2cfb35[_0x9b46('0x14')]]['membername'],_0x2cfb35['destuniqueid']));}catch(_0xfeb1b9){utils[_0x9b46('0x1a')](util['format'](_0x9b46('0x13'),_0x2cfb35[_0x9b46('0x5')]),_0xfeb1b9);}};exports['agentringnoanswer']=function(_0x55aece){try{if(!_[_0x9b46('0x1b')](agents[_0x55aece[_0x9b46('0x14')]])){utils[_0x9b46('0x12')](util['format']('[%s][agents][agentringnoanswer]',_0x55aece[_0x9b46('0x5')]),_0x55aece);utils['info'](util[_0x9b46('0x4')](_0x9b46('0x1c'),_0x55aece['uniqueid'],agents[_0x55aece[_0x9b46('0x14')]]['membername'],_0x55aece[_0x9b46('0x14')]));agents[_0x55aece[_0x9b46('0x14')]]['agentringnoanswer']=!![];agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x1d')]=utils[_0x9b46('0x16')]();agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x17')]=_0x9b46('0x1e');agents[_0x55aece[_0x9b46('0x14')]]['reason']=_0x9b46('0x1e');agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x1f')]=_0x55aece[_0x9b46('0x20')]?parseInt(_0x55aece[_0x9b46('0x20')])/0x3e8:0x0;agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x21')]=0x0;unanswered['push'](_0x55aece[_0x9b46('0x14')]);}}catch(_0xee519e){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x22'),_0x55aece[_0x9b46('0x5')]),_0xee519e);}};exports[_0x9b46('0x23')]=function(_0x17ba3d){try{_[_0x9b46('0x24')](agents,function(_0x20090a,_0x2e1c51){if(_0x20090a['uniqueid']==_0x17ba3d[_0x9b46('0x5')]&&!_[_0x9b46('0x25')](unanswered,_0x20090a[_0x9b46('0x14')])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x26'),_0x17ba3d[_0x9b46('0x5')]),_0x17ba3d);utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x27'),_0x17ba3d[_0x9b46('0x5')],_0x20090a['membername'],_0x20090a[_0x9b46('0x14')]));_0x20090a['agentringnoanswer']=!![];_0x20090a[_0x9b46('0x1d')]=utils[_0x9b46('0x16')]();_0x20090a[_0x9b46('0x17')]='abandoned';_0x20090a[_0x9b46('0x28')]=_0x9b46('0x29');_0x20090a[_0x9b46('0x1f')]=_0x17ba3d[_0x9b46('0x1f')];_0x20090a[_0x9b46('0x21')]=0x0;writeDB(_0x20090a);}});}catch(_0x5cb73f){utils['error'](util[_0x9b46('0x4')](_0x9b46('0x26'),_0x17ba3d[_0x9b46('0x5')]),_0x5cb73f);}};exports[_0x9b46('0x2a')]=function(_0x4fa731){try{if(agents[_0x4fa731[_0x9b46('0x14')]]){utils['debug'](util[_0x9b46('0x4')](_0x9b46('0x2b'),_0x4fa731[_0x9b46('0x5')]),_0x4fa731);utils[_0x9b46('0x3')](util['format'](_0x9b46('0x2c'),_0x4fa731['uniqueid'],agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x7')],_0x4fa731[_0x9b46('0x14')]));agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x2d')]=utils[_0x9b46('0x16')]();agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x9')]=_0x4fa731[_0x9b46('0x9')];agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x19')]=_0x4fa731['connectedlinename'];agents[_0x4fa731[_0x9b46('0x14')]]['holdtime']=_0x4fa731[_0x9b46('0x20')];agents[_0x4fa731[_0x9b46('0x14')]]['lastevent']=_0x9b46('0x2e');_['forIn'](agents,function(_0x416538,_0x493b0f){if(_0x416538[_0x9b46('0x14')]!=_0x4fa731[_0x9b46('0x14')]&&_0x416538[_0x9b46('0x5')]==_0x4fa731[_0x9b46('0x5')]){_0x416538[_0x9b46('0x21')]=0x0;_0x416538['holdtime']=_0x4fa731['ringtime'];_0x416538[_0x9b46('0x2f')]=!![];_0x416538['agentringnoanswerAt']=utils['now']();_0x416538['lastevent']='answered_elsewhere';_0x416538[_0x9b46('0x28')]='answered_elsewhere';_0x416538[_0x9b46('0x30')]=_0x4fa731['destuniqueid'];_0x416538[_0x9b46('0x31')]=_0x4fa731[_0x9b46('0x7')];writeDB(_0x416538);}});}}catch(_0x2e92aa){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x2b'),_0x4fa731[_0x9b46('0x5')]),_0x2e92aa);}};exports[_0x9b46('0x32')]=function(_0x148d86){try{if(!_['isNil'](agents[_0x148d86[_0x9b46('0x14')]])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x33'),_0x148d86[_0x9b46('0x5')]),_0x148d86);utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x34'),_0x148d86[_0x9b46('0x5')],agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x7')],_0x148d86[_0x9b46('0x14')]));agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x32')]=!![];agents[_0x148d86['destuniqueid']]['agentcompleteAt']=utils[_0x9b46('0x16')]();agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x21')]=utils['diffTime'](agents[_0x148d86['destuniqueid']][_0x9b46('0x35')],agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x2d')]);agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x28')]=_0x148d86[_0x9b46('0x28')];agents[_0x148d86['destuniqueid']][_0x9b46('0x17')]=_0x9b46('0x36');writeDB(agents[_0x148d86[_0x9b46('0x14')]]);}}catch(_0x47a938){utils[_0x9b46('0x1a')](util['format'](_0x9b46('0x33'),_0x148d86[_0x9b46('0x5')]),_0x47a938);}};exports[_0x9b46('0x37')]=function(_0x566bad){try{if(!_[_0x9b46('0x1b')](agents[_0x566bad[_0x9b46('0x38')]])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x39'),_0x566bad[_0x9b46('0x5')]),_0x566bad);utils['info'](util[_0x9b46('0x4')](_0x9b46('0x3a'),_0x566bad[_0x9b46('0x5')],agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x7')],agents[_0x566bad[_0x9b46('0x38')]]['uniqueid']));agents[_0x566bad[_0x9b46('0x38')]]['transfer']=!![];agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3b')]=_0x9b46('0x3c');agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3d')]=_0x566bad['extension'];agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3e')]=agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x5')];}}catch(_0x3f6b2f){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x39'),_0x566bad[_0x9b46('0x5')]),_0x3f6b2f);}};exports[_0x9b46('0x3f')]=function(_0x2f411f){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x2f411f[_0x9b46('0x40')]),_0x2f411f);if(_0x2f411f['origtransfereruniqueid']==_0x2f411f[_0x9b46('0x41')]){if(!_['isNil'](agents[_0x2f411f[_0x9b46('0x42')]])){utils['info'](util[_0x9b46('0x4')](_0x9b46('0x43'),_0x2f411f[_0x9b46('0x40')],agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x7')]));agents[_0x2f411f['secondtransfereruniqueid']][_0x9b46('0x44')]=!![];agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x3b')]=_0x9b46('0x45');agents[_0x2f411f[_0x9b46('0x42')]]['transferexten']=_0x2f411f['origtransfererexten'];agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x3e')]=_0x2f411f[_0x9b46('0x40')];}if(_0x2f411f[_0x9b46('0x46')]&&agents[_0x2f411f[_0x9b46('0x46')]]){agents[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x47')]=0x1;transfers[_0x2f411f[_0x9b46('0x46')]]=_['clone'](agents[_0x2f411f[_0x9b46('0x46')]]);transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x48')]=agents[_0x2f411f['secondtransfereruniqueid']][_0x9b46('0x48')];transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x49')]=agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x49')];transfers[_0x2f411f[_0x9b46('0x46')]]['agentcalledAt']=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x2d')]=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x1f')]=0x0;transfers[_0x2f411f['transfereeuniqueid']][_0x9b46('0x47')]=0x2;}}else if(_0x2f411f['secondtransfereruniqueid']==_0x2f411f[_0x9b46('0x4a')]){if(!_['isNil'](agents[_0x2f411f[_0x9b46('0x40')]])){utils[_0x9b46('0x3')](util['format'](_0x9b46('0x43'),_0x2f411f[_0x9b46('0x40')],agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x7')]));agents[_0x2f411f[_0x9b46('0x40')]]['transfer']=!![];agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x3b')]='ATTENDED';agents[_0x2f411f['origtransfereruniqueid']][_0x9b46('0x3d')]=_0x2f411f[_0x9b46('0x4b')];agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x3e')]=_0x2f411f[_0x9b46('0x42')];}if(_0x2f411f[_0x9b46('0x4c')]&&agents[_0x2f411f[_0x9b46('0x4c')]]){agents[_0x2f411f[_0x9b46('0x4c')]]['agententerreason']=0x1;transfers[_0x2f411f['transfertargetuniqueid']]=_[_0x9b46('0x4d')](agents[_0x2f411f[_0x9b46('0x4c')]]);transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x48')]=agents[_0x2f411f['origtransfereruniqueid']][_0x9b46('0x48')];transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x49')]=agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x49')];transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x15')]=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x4c')]]['agentconnectAt']=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x4c')]][_0x9b46('0x1f')]=0x0;transfers[_0x2f411f[_0x9b46('0x4c')]][_0x9b46('0x47')]=0x2;}}}catch(_0x4e8756){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x2f411f['origtransfereruniqueid']),_0x4e8756);}};exports[_0x9b46('0x4e')]=function(_0x200607){try{utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x4f'),_0x200607[_0x9b46('0x5')]),_0x200607);if(agents[_0x200607[_0x9b46('0x5')]]&&agents[_0x200607[_0x9b46('0x5')]]['reason']===_0x9b46('0x1e')){if(_0x200607[_0x9b46('0x50')]==='21'){agents[_0x200607['uniqueid']][_0x9b46('0x28')]='rejected';agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x17')]=_0x9b46('0x51');}utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x200607['uniqueid'],agents[_0x200607[_0x9b46('0x5')]]['membername'],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')],agents[_0x200607['uniqueid']]['lastevent']));writeDB(agents[_0x200607['uniqueid']]);var _0x2978aa=unanswered['indexOf'](_0x200607['uniqueid']);if(_0x2978aa>-0x1){unanswered[_0x9b46('0x52')](_0x2978aa,0x1);}}if(transfers[_0x200607[_0x9b46('0x5')]]){transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x32')]=!![];transfers[_0x200607['uniqueid']][_0x9b46('0x35')]=utils[_0x9b46('0x16')]();transfers[_0x200607[_0x9b46('0x5')]]['talktime']=utils['diffTime'](transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x35')],transfers[_0x200607[_0x9b46('0x5')]]['agentconnectAt']);transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')]='agent';transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x17')]=_0x9b46('0x36');utils[_0x9b46('0x3')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x200607[_0x9b46('0x5')],transfers[_0x200607['uniqueid']][_0x9b46('0x7')],transfers[_0x200607[_0x9b46('0x5')]]['reason'],transfers[_0x200607['uniqueid']]['lastevent']));writeDB(transfers[_0x200607[_0x9b46('0x5')]],!![]);}if(agents[_0x200607['uniqueid']]&&agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x2d')]){agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x32')]=!![];agents[_0x200607['uniqueid']][_0x9b46('0x35')]=utils[_0x9b46('0x16')]();agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x21')]=utils[_0x9b46('0x53')](agents[_0x200607['uniqueid']][_0x9b46('0x35')],agents[_0x200607['uniqueid']][_0x9b46('0x2d')]);agents[_0x200607[_0x9b46('0x5')]]['reason']=agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x44')]?_0x9b46('0x44'):_0x9b46('0x54');agents[_0x200607['uniqueid']][_0x9b46('0x17')]='complete';utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x55'),_0x200607['uniqueid'],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x7')],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')],agents[_0x200607['uniqueid']][_0x9b46('0x17')]));writeDB(agents[_0x200607['uniqueid']]);}}catch(_0x420d61){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x4f'),_0x200607[_0x9b46('0x5')]),_0x420d61);}}; \ No newline at end of file +var _0xeffd=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transferuniqueid','origtransfereruniqueid','transfereeuniqueid','clone','calleridname','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','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','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','[%s][agents][agentcalled]','now','called','error','agentringnoanswer','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','push','[%s][agents][agentringnoanswer]','forIn','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid'];(function(_0x443e27,_0x25bdaa){var _0x5738f9=function(_0x184805){while(--_0x184805){_0x443e27['push'](_0x443e27['shift']());}};_0x5738f9(++_0x25bdaa);}(_0xeffd,0x6b));var _0xdeff=function(_0x57d5a1,_0x476764){_0x57d5a1=_0x57d5a1-0x0;var _0x506273=_0xeffd[_0x57d5a1];return _0x506273;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var utils=require(_0xdeff('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xd8f1d6,_0x281a05){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x4'),_0xd8f1d6[_0xdeff('0x5')],_0xd8f1d6[_0xdeff('0x6')],_0xd8f1d6[_0xdeff('0x7')],_0xd8f1d6[_0xdeff('0x8')],_0xd8f1d6[_0xdeff('0x9')],_0xd8f1d6[_0xdeff('0xa')],_0xd8f1d6[_0xdeff('0xb')],_0xd8f1d6[_0xdeff('0xc')]));if(_0xd8f1d6[_0xdeff('0x7')]){utils[_0xdeff('0xd')](_0xd8f1d6[_0xdeff('0x7')])['then'](function(_0x3ae201){if(_0x3ae201){_0xd8f1d6[_0xdeff('0xe')]=_0x3ae201[_0xdeff('0xe')];_0xd8f1d6['agentacw']=_0xd8f1d6[_0xdeff('0xf')]?_0x3ae201[_0xdeff('0x10')]:![];_0xd8f1d6[_0xdeff('0x11')]=_0xd8f1d6[_0xdeff('0x12')]?_0x3ae201[_0xdeff('0x13')]:0x0;}utils[_0xdeff('0x14')](_0xdeff('0x15'),_0xd8f1d6);});}else{utils[_0xdeff('0x14')]('CreateVoiceAgentReport',_0xd8f1d6);}if(_0x281a05){delete transfers[_0xd8f1d6[_0xdeff('0x5')]];}else{delete agents[_0xd8f1d6[_0xdeff('0x16')]];}}exports['agentcalled']=function(_0x2e614c){try{utils['debug'](util['format'](_0xdeff('0x17'),_0x2e614c[_0xdeff('0x5')]),_0x2e614c);agents[_0x2e614c[_0xdeff('0x16')]]=_0x2e614c;agents[_0x2e614c[_0xdeff('0x16')]]['agentcalledAt']=utils[_0xdeff('0x18')]();agents[_0x2e614c[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x19');agents[_0x2e614c[_0xdeff('0x16')]][_0xdeff('0xb')]=null;agents[_0x2e614c['destuniqueid']]['connectedlinename']=null;utils[_0xdeff('0x2')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2e614c[_0xdeff('0x5')],agents[_0x2e614c[_0xdeff('0x16')]]['membername'],_0x2e614c[_0xdeff('0x16')]));}catch(_0x42e98e){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x17'),_0x2e614c[_0xdeff('0x5')]),_0x42e98e);}};exports[_0xdeff('0x1b')]=function(_0x919c93){try{if(!_['isNil'](agents[_0x919c93['destuniqueid']])){utils['debug'](util[_0xdeff('0x3')]('[%s][agents][agentringnoanswer]',_0x919c93[_0xdeff('0x5')]),_0x919c93);utils[_0xdeff('0x2')](util['format'](_0xdeff('0x1c'),_0x919c93[_0xdeff('0x5')],agents[_0x919c93['destuniqueid']]['membername'],_0x919c93[_0xdeff('0x16')]));agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1b')]=!![];agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1d')]=utils['now']();agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x1e');agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1f')]=_0xdeff('0x1e');agents[_0x919c93[_0xdeff('0x16')]]['holdtime']=_0x919c93[_0xdeff('0x20')]?parseInt(_0x919c93[_0xdeff('0x20')])/0x3e8:0x0;agents[_0x919c93['destuniqueid']]['talktime']=0x0;unanswered[_0xdeff('0x21')](_0x919c93[_0xdeff('0x16')]);}}catch(_0x16b2d0){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x22'),_0x919c93[_0xdeff('0x5')]),_0x16b2d0);}};exports['queuecallerabandon']=function(_0x331ddc){try{_[_0xdeff('0x23')](agents,function(_0x34e258,_0x5045b8){if(_0x34e258['uniqueid']==_0x331ddc[_0xdeff('0x5')]&&!_['includes'](unanswered,_0x34e258[_0xdeff('0x16')])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][queuecallerabandon]',_0x331ddc[_0xdeff('0x5')]),_0x331ddc);utils['info'](util['format'](_0xdeff('0x25'),_0x331ddc[_0xdeff('0x5')],_0x34e258[_0xdeff('0x8')],_0x34e258[_0xdeff('0x16')]));_0x34e258['agentringnoanswer']=!![];_0x34e258[_0xdeff('0x1d')]=utils[_0xdeff('0x18')]();_0x34e258[_0xdeff('0xc')]=_0xdeff('0x26');_0x34e258[_0xdeff('0x1f')]=_0xdeff('0x26');_0x34e258[_0xdeff('0x27')]=_0x331ddc['holdtime'];_0x34e258[_0xdeff('0x28')]=0x0;writeDB(_0x34e258);}});}catch(_0x5cef77){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x29'),_0x331ddc[_0xdeff('0x5')]),_0x5cef77);}};exports[_0xdeff('0x2a')]=function(_0x965c5b){try{if(agents[_0x965c5b['destuniqueid']]){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][agentconnect]',_0x965c5b[_0xdeff('0x5')]),_0x965c5b);utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x2b'),_0x965c5b[_0xdeff('0x5')],agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0x8')],_0x965c5b[_0xdeff('0x16')]));agents[_0x965c5b['destuniqueid']][_0xdeff('0x2c')]=utils['now']();agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0xb')]=_0x965c5b[_0xdeff('0xb')];agents[_0x965c5b['destuniqueid']][_0xdeff('0x2d')]=_0x965c5b[_0xdeff('0x2d')];agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0x27')]=_0x965c5b[_0xdeff('0x20')];agents[_0x965c5b['destuniqueid']][_0xdeff('0xc')]='connect';_[_0xdeff('0x23')](agents,function(_0x14f1d0,_0x518280){if(_0x14f1d0[_0xdeff('0x16')]!=_0x965c5b[_0xdeff('0x16')]&&_0x14f1d0[_0xdeff('0x5')]==_0x965c5b[_0xdeff('0x5')]){_0x14f1d0[_0xdeff('0x28')]=0x0;_0x14f1d0['holdtime']=_0x965c5b[_0xdeff('0x20')];_0x14f1d0[_0xdeff('0x1b')]=!![];_0x14f1d0[_0xdeff('0x1d')]=utils[_0xdeff('0x18')]();_0x14f1d0[_0xdeff('0xc')]='answered_elsewhere';_0x14f1d0['reason']=_0xdeff('0x2e');_0x14f1d0[_0xdeff('0x2f')]=_0x965c5b[_0xdeff('0x16')];_0x14f1d0[_0xdeff('0x30')]=_0x965c5b[_0xdeff('0x8')];writeDB(_0x14f1d0);}});}}catch(_0x289f70){utils[_0xdeff('0x1a')](util['format'](_0xdeff('0x31'),_0x965c5b[_0xdeff('0x5')]),_0x289f70);}};exports[_0xdeff('0xf')]=function(_0x54fa5b){try{if(!_[_0xdeff('0x32')](agents[_0x54fa5b[_0xdeff('0x16')]])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][agentcomplete]',_0x54fa5b[_0xdeff('0x5')]),_0x54fa5b);utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x33'),_0x54fa5b[_0xdeff('0x5')],agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x8')],_0x54fa5b[_0xdeff('0x16')]));agents[_0x54fa5b['destuniqueid']][_0xdeff('0xf')]=!![];agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x34')]=utils[_0xdeff('0x18')]();agents[_0x54fa5b[_0xdeff('0x16')]]['talktime']=utils[_0xdeff('0x35')](agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x34')],agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x2c')]);agents[_0x54fa5b['destuniqueid']][_0xdeff('0x1f')]=_0x54fa5b['reason'];agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x36');writeDB(agents[_0x54fa5b[_0xdeff('0x16')]]);}}catch(_0xf58aa6){utils[_0xdeff('0x1a')](util['format']('[%s][agents][agentcomplete]',_0x54fa5b[_0xdeff('0x5')]),_0xf58aa6);}};exports[_0xdeff('0x37')]=function(_0x3dc206){try{if(!_['isNil'](agents[_0x3dc206['transfereruniqueid']])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][blindtransfer]',_0x3dc206[_0xdeff('0x5')]),_0x3dc206);utils[_0xdeff('0x2')](util[_0xdeff('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x3dc206[_0xdeff('0x5')],agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x8')],agents[_0x3dc206['transfereruniqueid']][_0xdeff('0x5')]));agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x39')]=!![];agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x3a')]=_0xdeff('0x3b');agents[_0x3dc206[_0xdeff('0x38')]]['transferexten']=_0x3dc206[_0xdeff('0x3c')];agents[_0x3dc206[_0xdeff('0x38')]]['transferuniqueid']=agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x5')];}}catch(_0x2967b4){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x3d'),_0x3dc206[_0xdeff('0x5')]),_0x2967b4);}};exports[_0xdeff('0x3e')]=function(_0x5ca032){try{utils[_0xdeff('0x24')](util[_0xdeff('0x3')](_0xdeff('0x3f'),_0x5ca032['origtransfereruniqueid']),_0x5ca032);if(_0x5ca032['origtransfereruniqueid']==_0x5ca032[_0xdeff('0x40')]){if(!_[_0xdeff('0x32')](agents[_0x5ca032[_0xdeff('0x41')]])){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x42'),_0x5ca032['origtransfereruniqueid'],agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x8')]));agents[_0x5ca032[_0xdeff('0x41')]]['transfer']=!![];agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x3a')]=_0xdeff('0x43');agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x44')]=_0x5ca032[_0xdeff('0x45')];agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x46')]=_0x5ca032[_0xdeff('0x47')];}if(_0x5ca032['transfereeuniqueid']&&agents[_0x5ca032[_0xdeff('0x48')]]){agents[_0x5ca032[_0xdeff('0x48')]]['agententerreason']=0x1;transfers[_0x5ca032[_0xdeff('0x48')]]=_[_0xdeff('0x49')](agents[_0x5ca032[_0xdeff('0x48')]]);transfers[_0x5ca032['transfereeuniqueid']]['calleridnum']=agents[_0x5ca032[_0xdeff('0x41')]]['calleridnum'];transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x4a')]=agents[_0x5ca032[_0xdeff('0x41')]][_0xdeff('0x4a')];transfers[_0x5ca032[_0xdeff('0x48')]]['agentcalledAt']=utils['now']();transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x2c')]=utils[_0xdeff('0x18')]();transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x27')]=0x0;transfers[_0x5ca032[_0xdeff('0x48')]]['agententerreason']=0x2;}}else if(_0x5ca032[_0xdeff('0x41')]==_0x5ca032['secondtransfererlinkedid']){if(!_[_0xdeff('0x32')](agents[_0x5ca032[_0xdeff('0x47')]])){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x42'),_0x5ca032[_0xdeff('0x47')],agents[_0x5ca032[_0xdeff('0x47')]][_0xdeff('0x8')]));agents[_0x5ca032[_0xdeff('0x47')]]['transfer']=!![];agents[_0x5ca032[_0xdeff('0x47')]]['transfertype']=_0xdeff('0x43');agents[_0x5ca032[_0xdeff('0x47')]]['transferexten']=_0x5ca032[_0xdeff('0x4b')];agents[_0x5ca032['origtransfereruniqueid']][_0xdeff('0x46')]=_0x5ca032['secondtransfereruniqueid'];}if(_0x5ca032['transfertargetuniqueid']&&agents[_0x5ca032[_0xdeff('0x4c')]]){agents[_0x5ca032[_0xdeff('0x4c')]]['agententerreason']=0x1;transfers[_0x5ca032[_0xdeff('0x4c')]]=_[_0xdeff('0x49')](agents[_0x5ca032[_0xdeff('0x4c')]]);transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0xa')]=agents[_0x5ca032[_0xdeff('0x47')]][_0xdeff('0xa')];transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x4a')]=agents[_0x5ca032['origtransfereruniqueid']][_0xdeff('0x4a')];transfers[_0x5ca032[_0xdeff('0x4c')]]['agentcalledAt']=utils['now']();transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x2c')]=utils['now']();transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x27')]=0x0;transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x4d')]=0x2;}}}catch(_0x194eed){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x3f'),_0x5ca032[_0xdeff('0x47')]),_0x194eed);}};exports[_0xdeff('0x4e')]=function(_0x5ab2c5){try{utils[_0xdeff('0x24')](util[_0xdeff('0x3')](_0xdeff('0x4f'),_0x5ab2c5[_0xdeff('0x5')]),_0x5ab2c5);if(agents[_0x5ab2c5[_0xdeff('0x5')]]&&agents[_0x5ab2c5['uniqueid']]['reason']==='timeout'){if(_0x5ab2c5[_0xdeff('0x50')]==='21'){agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')]=_0xdeff('0x51');agents[_0x5ab2c5['uniqueid']]['lastevent']=_0xdeff('0x51');}utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x52'),_0x5ab2c5[_0xdeff('0x5')],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x8')],agents[_0x5ab2c5[_0xdeff('0x5')]]['reason'],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]));writeDB(agents[_0x5ab2c5[_0xdeff('0x5')]]);var _0x452fd4=unanswered[_0xdeff('0x53')](_0x5ab2c5[_0xdeff('0x5')]);if(_0x452fd4>-0x1){unanswered[_0xdeff('0x54')](_0x452fd4,0x1);}}if(transfers[_0x5ab2c5[_0xdeff('0x5')]]){transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xf')]=!![];transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x34')]=utils['now']();transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x28')]=utils[_0xdeff('0x35')](transfers[_0x5ab2c5['uniqueid']][_0xdeff('0x34')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x2c')]);transfers[_0x5ab2c5[_0xdeff('0x5')]]['reason']=_0xdeff('0x55');transfers[_0x5ab2c5[_0xdeff('0x5')]]['lastevent']=_0xdeff('0x36');utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x52'),_0x5ab2c5[_0xdeff('0x5')],transfers[_0x5ab2c5['uniqueid']][_0xdeff('0x8')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]));writeDB(transfers[_0x5ab2c5['uniqueid']],!![]);}if(agents[_0x5ab2c5[_0xdeff('0x5')]]&&agents[_0x5ab2c5[_0xdeff('0x5')]]['agentconnectAt']){agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xf')]=!![];agents[_0x5ab2c5[_0xdeff('0x5')]]['agentcompleteAt']=utils[_0xdeff('0x18')]();agents[_0x5ab2c5[_0xdeff('0x5')]]['talktime']=utils[_0xdeff('0x35')](agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x34')],agents[_0x5ab2c5[_0xdeff('0x5')]]['agentconnectAt']);agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')]=agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x39')]?_0xdeff('0x39'):_0xdeff('0x55');agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]=_0xdeff('0x36');utils['info'](util[_0xdeff('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ab2c5[_0xdeff('0x5')],agents[_0x5ab2c5['uniqueid']]['membername'],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')],agents[_0x5ab2c5['uniqueid']][_0xdeff('0xc')]));writeDB(agents[_0x5ab2c5[_0xdeff('0x5')]]);}}catch(_0xd49939){utils[_0xdeff('0x1a')](util['format'](_0xdeff('0x4f'),_0x5ab2c5[_0xdeff('0x5')]),_0xd49939);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 834acb1..1cb9a95 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 _0x58db=['then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','context','exten','now','DOCUMENTATION','newstate','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','[%s][calls][newstate]','hangup','callerid','cause-txt','endtime','duration','billableseconds','diffTime','[%s][calls][hangup]','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','error','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','split','lastIndexOf','includes','noop','gotoif','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','connectedlinenum','accountcode'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x58db,0x1f1));var _0xb58d=function(_0x5dd012,_0x253195){_0x5dd012=_0x5dd012-0x0;var _0x41b8bf=_0x58db[_0x5dd012];return _0x41b8bf;};'use strict';var _=require(_0xb58d('0x0'));var util=require(_0xb58d('0x1'));var utils=require(_0xb58d('0x2'));var transfers=require(_0xb58d('0x3'));var dispositions=[_0xb58d('0x4'),_0xb58d('0x5'),'FAILED',_0xb58d('0x4'),'NO\x20ANSWER',_0xb58d('0x4'),_0xb58d('0x6'),'BUSY',_0xb58d('0x5'),_0xb58d('0x5'),_0xb58d('0x5')];var channels={};function writeDB(_0x3107c4){var _0x17492e;if(transfers[_0xb58d('0x7')][_0x3107c4[_0xb58d('0x8')]]){_0x17492e=_0x3107c4[_0xb58d('0x8')];_0x3107c4['uniqueid']=transfers[_0xb58d('0x7')][_0x3107c4['uniqueid']][_0xb58d('0x9')];}utils['info'](util[_0xb58d('0xa')](_0xb58d('0xb'),_0x3107c4[_0xb58d('0x8')],_0x3107c4[_0xb58d('0xc')],_0x3107c4[_0xb58d('0xd')],_0x3107c4['membername'],_0x3107c4[_0xb58d('0xe')],_0x3107c4[_0xb58d('0xf')],_0x3107c4[_0xb58d('0x10')],_0x3107c4['lastevent']));if(_0x3107c4[_0xb58d('0x11')]){utils['getUserByInternal'](_0x3107c4[_0xb58d('0x11')])[_0xb58d('0x12')](function(_0x14c6d3){if(_0x14c6d3){_0x3107c4['UserId']=_0x14c6d3['id'];}utils[_0xb58d('0x13')]('CreateVoiceCallReport',_0x3107c4);});}else{utils[_0xb58d('0x13')](_0xb58d('0x14'),_0x3107c4);}if(channels[_0x3107c4['uniqueid']]){delete channels[_0x3107c4[_0xb58d('0x8')]];}else if(_0x17492e&&channels[_0x17492e]){delete transfers[_0xb58d('0x7')][_0x17492e];delete channels[_0x17492e];}}exports[_0xb58d('0x15')]=function(_0x54e54b){try{utils[_0xb58d('0x16')](util[_0xb58d('0xa')](_0xb58d('0x17'),_0x54e54b['uniqueid']),_0x54e54b);if(_0x54e54b[_0xb58d('0x8')]==_0x54e54b[_0xb58d('0x18')]&&_0x54e54b[_0xb58d('0xc')]!=_0xb58d('0x19')){utils[_0xb58d('0x1a')](util[_0xb58d('0xa')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x54e54b[_0xb58d('0x8')],_0x54e54b[_0xb58d('0x1b')],_0x54e54b['exten']));channels[_0x54e54b[_0xb58d('0x8')]]={'uniqueid':_0x54e54b[_0xb58d('0x8')],'accountcode':_0x54e54b[_0xb58d('0x11')],'source':_0x54e54b['calleridnum'],'destination':_0x54e54b[_0xb58d('0x1c')],'destinationcontext':_0x54e54b[_0xb58d('0x1b')],'channel':_0x54e54b[_0xb58d('0xc')],'starttime':utils[_0xb58d('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xb58d('0x4'),'amaflags':_0xb58d('0x1e')};}}catch(_0x477d7f){utils['error'](util['format']('[%s][calls][newchannel]',_0x54e54b['uniqueid']),_0x477d7f);}};exports[_0xb58d('0x1f')]=function(_0x36e855){try{utils['debug'](util['format']('[%s][calls][newstate]',_0x36e855[_0xb58d('0x8')]),_0x36e855);if(!_['isNil'](channels[_0x36e855['uniqueid']])&&_0x36e855[_0xb58d('0x20')]==0x6){utils[_0xb58d('0x1a')](util['format'](_0xb58d('0x21'),_0x36e855[_0xb58d('0x8')],_0x36e855[_0xb58d('0x1b')],_0x36e855[_0xb58d('0xc')]));if(_[_0xb58d('0x22')](channels[_0x36e855['uniqueid']][_0xb58d('0x23')])){channels[_0x36e855[_0xb58d('0x8')]]['systemanswertime']=utils[_0xb58d('0x1d')]();}}else if(!_[_0xb58d('0x22')](channels[_0x36e855[_0xb58d('0x18')]])&&_0x36e855[_0xb58d('0x20')]==0x6&&_0x36e855[_0xb58d('0x1b')]!=_0xb58d('0x24')){utils[_0xb58d('0x1a')](util['format'](_0xb58d('0x25'),_0x36e855[_0xb58d('0x8')],_0x36e855[_0xb58d('0x18')],_0x36e855[_0xb58d('0x1b')],_0x36e855[_0xb58d('0xc')]));channels[_0x36e855[_0xb58d('0x18')]][_0xb58d('0x11')]=_0x36e855['accountcode'];channels[_0x36e855['linkedid']][_0xb58d('0x26')]=_0x36e855['channel'];if(_[_0xb58d('0x22')](channels[_0x36e855['linkedid']][_0xb58d('0x27')])){channels[_0x36e855[_0xb58d('0x18')]][_0xb58d('0x27')]=utils[_0xb58d('0x1d')]();}channels[_0x36e855['linkedid']][_0xb58d('0x28')]=dispositions[_['toNumber'](_0x36e855['channelstate'])]||_0xb58d('0x6');}}catch(_0x1de79c){utils['error'](util['format'](_0xb58d('0x29'),_0x36e855[_0xb58d('0x8')]),_0x1de79c);}};exports[_0xb58d('0x2a')]=function(_0x4e69e3){try{if(!_['isNil'](channels[_0x4e69e3[_0xb58d('0x8')]])){utils[_0xb58d('0x16')](util['format']('[%s][calls][hangup]',_0x4e69e3[_0xb58d('0x8')]),_0x4e69e3);if(_['isNil'](channels[_0x4e69e3[_0xb58d('0x8')]][_0xb58d('0x2b')])){channels[_0x4e69e3['uniqueid']]['callerid']=_0x4e69e3['calleridname']+'\x20<'+_0x4e69e3[_0xb58d('0xf')]+'>';}utils[_0xb58d('0x1a')](util[_0xb58d('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x4e69e3['uniqueid'],channels[_0x4e69e3[_0xb58d('0x8')]][_0xb58d('0x2b')],_0x4e69e3[_0xb58d('0x2c')]));channels[_0x4e69e3[_0xb58d('0x8')]][_0xb58d('0x2d')]=utils['now']();channels[_0x4e69e3[_0xb58d('0x8')]][_0xb58d('0x2e')]=utils['diffTime'](channels[_0x4e69e3[_0xb58d('0x8')]][_0xb58d('0x2d')],channels[_0x4e69e3['uniqueid']]['starttime']);channels[_0x4e69e3[_0xb58d('0x8')]][_0xb58d('0x2f')]=channels[_0x4e69e3[_0xb58d('0x8')]][_0xb58d('0x27')]?utils[_0xb58d('0x30')](channels[_0x4e69e3['uniqueid']][_0xb58d('0x2d')],channels[_0x4e69e3['uniqueid']][_0xb58d('0x27')]):0x0;writeDB(channels[_0x4e69e3[_0xb58d('0x8')]]);}}catch(_0x5f21d2){utils['error'](util['format'](_0xb58d('0x31'),_0x4e69e3[_0xb58d('0x8')]),_0x5f21d2);}};exports['attendedtransfer']=function(_0x2001d9){try{if(!_[_0xb58d('0x22')](channels[_0x2001d9[_0xb58d('0x32')]])){utils[_0xb58d('0x16')](util[_0xb58d('0xa')](_0xb58d('0x33'),_0x2001d9[_0xb58d('0x34')]),_0x2001d9);if(channels[_0x2001d9[_0xb58d('0x32')]][_0xb58d('0xc')]==_0x2001d9['transfereechannel']){utils[_0xb58d('0x1a')](util[_0xb58d('0xa')](_0xb58d('0x35'),_0x2001d9[_0xb58d('0x34')],_0x2001d9[_0xb58d('0x32')],_0x2001d9[_0xb58d('0x36')]));channels[_0x2001d9[_0xb58d('0x32')]][_0xb58d('0x26')]=_0x2001d9[_0xb58d('0x36')];channels[_0x2001d9[_0xb58d('0x32')]][_0xb58d('0x37')]=_0xb58d('0x38');}else if(channels[_0x2001d9[_0xb58d('0x32')]][_0xb58d('0xc')]=_0x2001d9[_0xb58d('0x39')]){utils[_0xb58d('0x1a')](util[_0xb58d('0xa')](_0xb58d('0x35'),_0x2001d9[_0xb58d('0x34')],_0x2001d9[_0xb58d('0x32')],_0x2001d9[_0xb58d('0x3a')]));channels[_0x2001d9['localtwolinkedid']][_0xb58d('0x26')]=_0x2001d9[_0xb58d('0x3a')];channels[_0x2001d9[_0xb58d('0x32')]][_0xb58d('0x37')]='_attended';}}}catch(_0x282e9d){utils[_0xb58d('0x3b')](util[_0xb58d('0xa')]('[%s][calls][attendedtransfer]',_0x2001d9['origtransfereruniqueid']),_0x282e9d);}};exports[_0xb58d('0x3c')]=function(_0x489daa){try{if(!_[_0xb58d('0x22')](channels[_0x489daa[_0xb58d('0x8')]])){utils[_0xb58d('0x16')](util['format'](_0xb58d('0x3d'),_0x489daa[_0xb58d('0x8')]),_0x489daa);channels[_0x489daa[_0xb58d('0x8')]][_0xb58d('0x3e')]=utils[_0xb58d('0x1d')]();utils[_0xb58d('0x1a')](util[_0xb58d('0xa')](_0xb58d('0x3f'),_0x489daa['uniqueid'],channels[_0x489daa['uniqueid']][_0xb58d('0x3e')]));}}catch(_0x2a32fb){utils[_0xb58d('0x3b')](util[_0xb58d('0xa')](_0xb58d('0x3d'),_0x489daa[_0xb58d('0x8')]),_0x2a32fb);}};exports[_0xb58d('0x40')]=function(_0x2908df){try{if(!_[_0xb58d('0x22')](channels[_0x2908df[_0xb58d('0x8')]])){utils[_0xb58d('0x16')](util[_0xb58d('0xa')](_0xb58d('0x41'),_0x2908df[_0xb58d('0x8')]),_0x2908df);if(!_[_0xb58d('0x22')](channels[_0x2908df[_0xb58d('0x8')]][_0xb58d('0x3e')])){channels[_0x2908df[_0xb58d('0x8')]]['mohtime']+=utils[_0xb58d('0x30')](utils[_0xb58d('0x1d')](),channels[_0x2908df[_0xb58d('0x8')]]['musiconholdstartAt']);utils[_0xb58d('0x1a')](util['format'](_0xb58d('0x42'),_0x2908df[_0xb58d('0x8')],channels[_0x2908df[_0xb58d('0x8')]][_0xb58d('0x43')]));delete channels[_0x2908df[_0xb58d('0x8')]]['musiconholdstartAt'];}}}catch(_0x19a61d){utils[_0xb58d('0x3b')](util[_0xb58d('0xa')](_0xb58d('0x41'),_0x2908df[_0xb58d('0x8')]),_0x19a61d);}};exports[_0xb58d('0x44')]=function(_0x220082){try{if(!_['isNil'](channels[_0x220082[_0xb58d('0x8')]])){utils[_0xb58d('0x16')](util[_0xb58d('0xa')](_0xb58d('0x45'),_0x220082['uniqueid']),_0x220082);if(!_[_0xb58d('0x22')](_0x220082[_0xb58d('0x46')][_0xb58d('0x47')])){utils['info'](util[_0xb58d('0xa')](_0xb58d('0x48'),_0x220082[_0xb58d('0x8')],_0x220082[_0xb58d('0x49')]));channels[_0x220082['uniqueid']][_0xb58d('0x4a')]=_0x220082[_0xb58d('0x49')];}if(!_['isNil'](_0x220082[_0xb58d('0x46')]['xmd-phone'])){utils[_0xb58d('0x1a')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x220082[_0xb58d('0x8')],_0x220082['value']));channels[_0x220082[_0xb58d('0x8')]]['destination']=_0x220082['value'];channels[_0x220082['uniqueid']][_0xb58d('0x2b')]='\x22'+_0x220082[_0xb58d('0x49')]+_0xb58d('0x4b')+_0x220082[_0xb58d('0x49')]+'>';}if(!_[_0xb58d('0x22')](_0x220082[_0xb58d('0x46')][_0xb58d('0x4c')])||!_['isNil'](_0x220082['variable'][_0xb58d('0x4d')])){utils[_0xb58d('0x1a')](util[_0xb58d('0xa')](_0xb58d('0x4e'),_0x220082[_0xb58d('0x8')],!_[_0xb58d('0x22')](_0x220082[_0xb58d('0x46')]['xmd-callerid-preview'])?_0xb58d('0x4c'):_0xb58d('0x4d'),_0x220082[_0xb58d('0x49')]));channels[_0x220082[_0xb58d('0x8')]][_0xb58d('0x2b')]=_0x220082[_0xb58d('0x49')];}if(!_['isNil'](_0x220082[_0xb58d('0x46')][_0xb58d('0x4f')])||!_[_0xb58d('0x22')](_0x220082[_0xb58d('0x46')][_0xb58d('0x50')])){utils['info'](util[_0xb58d('0xa')](_0xb58d('0x4e'),_0x220082[_0xb58d('0x8')],!_[_0xb58d('0x22')](_0x220082[_0xb58d('0x46')]['xmd-queue'])?_0xb58d('0x4f'):'xmcs-queue',_0x220082['value']));channels[_0x220082[_0xb58d('0x8')]][_0xb58d('0x51')]=_0xb58d('0x52');channels[_0x220082['uniqueid']][_0xb58d('0x53')]=_0x220082[_0xb58d('0x49')];channels[_0x220082[_0xb58d('0x8')]][_0xb58d('0xd')]=!![];}if(!_[_0xb58d('0x22')](_0x220082[_0xb58d('0x46')]['xmd-contactid'])){utils[_0xb58d('0x1a')](util[_0xb58d('0xa')](_0xb58d('0x54'),_0x220082['uniqueid'],_0x220082[_0xb58d('0x49')]));channels[_0x220082[_0xb58d('0x8')]][_0xb58d('0x55')]=_0x220082[_0xb58d('0x49')];}if(!_[_0xb58d('0x22')](_0x220082[_0xb58d('0x46')]['xmd-cdrtype'])){utils[_0xb58d('0x1a')](util['format'](_0xb58d('0x56'),_0x220082[_0xb58d('0x8')],_0x220082[_0xb58d('0x49')]));channels[_0x220082[_0xb58d('0x8')]][_0xb58d('0x57')]=_0x220082['value'];}if(!_['isNil'](_0x220082[_0xb58d('0x46')]['outboundrouteid'])){utils[_0xb58d('0x1a')](util[_0xb58d('0xa')](_0xb58d('0x58'),_0x220082[_0xb58d('0x8')],_0x220082[_0xb58d('0x49')]));channels[_0x220082[_0xb58d('0x8')]]['routeid']=_0x220082[_0xb58d('0x49')];}if(!_[_0xb58d('0x22')](_0x220082[_0xb58d('0x46')][_0xb58d('0x59')])){utils[_0xb58d('0x1a')](util[_0xb58d('0xa')](_0xb58d('0x5a'),_0x220082[_0xb58d('0x8')],_0x220082[_0xb58d('0x49')]));channels[_0x220082[_0xb58d('0x8')]]['sipcallid']=_0x220082[_0xb58d('0x49')];}}}catch(_0xc72240){utils[_0xb58d('0x3b')](util[_0xb58d('0xa')](_0xb58d('0x45'),_0x220082[_0xb58d('0x8')]),_0xc72240);}};exports['newexten']=function(_0x4ff00b){try{if(!_['isNil'](channels[_0x4ff00b[_0xb58d('0x8')]])){utils[_0xb58d('0x16')](util[_0xb58d('0xa')]('[%s][calls][newexten]',_0x4ff00b[_0xb58d('0x8')]),_0x4ff00b);utils[_0xb58d('0x1a')](util[_0xb58d('0xa')](_0xb58d('0x5b'),_0x4ff00b[_0xb58d('0x8')],_0x4ff00b[_0xb58d('0x5c')],_0x4ff00b['appdata']));if(_0x4ff00b[_0xb58d('0x5c')][_0xb58d('0x5d')]()==_0xb58d('0x5e')&&_[_0xb58d('0x5f')](_0x4ff00b[_0xb58d('0x60')][_0xb58d('0x5d')](),'cdr')){var _0x109083=_0x4ff00b['appdata'][_0xb58d('0x61')]('=');var _0x32126c=_0x109083[0x0]['substring'](_0x109083[0x0][_0xb58d('0x62')]('(')+0x1,_0x109083[0x0][_0xb58d('0x62')](')'));var _0x38198c=_0x109083[0x1];channels[_0x4ff00b[_0xb58d('0x8')]][_0x32126c]=_0x38198c;}if(!_[_0xb58d('0x63')]([_0xb58d('0x2a'),_0xb58d('0x64'),'execif',_0xb58d('0x5e'),_0xb58d('0x65')],_0x4ff00b[_0xb58d('0x5c')]['toLowerCase']())){channels[_0x4ff00b[_0xb58d('0x8')]][_0xb58d('0x51')]=_0x4ff00b['application'];channels[_0x4ff00b['uniqueid']][_0xb58d('0x53')]=_0x4ff00b['appdata'];}}}catch(_0x2d4f49){utils[_0xb58d('0x3b')](util[_0xb58d('0xa')](_0xb58d('0x66'),_0x4ff00b['uniqueid']),_0x2d4f49);}}; \ No newline at end of file +var _0x2be9=['substring','lastIndexOf','includes','noop','lastapplication','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','request','CreateVoiceCallReport','debug','format','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','answertime','disposition','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','type','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','split'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0x2be9,0x146));var _0x92be=function(_0x56fbaa,_0x3bc5a6){_0x56fbaa=_0x56fbaa-0x0;var _0x49fbc1=_0x2be9[_0x56fbaa];return _0x49fbc1;};'use strict';var _=require(_0x92be('0x0'));var util=require(_0x92be('0x1'));var utils=require(_0x92be('0x2'));var transfers=require(_0x92be('0x3'));var dispositions=[_0x92be('0x4'),_0x92be('0x5'),_0x92be('0x5'),_0x92be('0x4'),_0x92be('0x4'),_0x92be('0x4'),_0x92be('0x6'),_0x92be('0x7'),'FAILED',_0x92be('0x5'),'FAILED'];var channels={};function writeDB(_0x862a2b){var _0x591218;if(transfers[_0x92be('0x8')][_0x862a2b['uniqueid']]){_0x591218=_0x862a2b[_0x92be('0x9')];_0x862a2b[_0x92be('0x9')]=transfers[_0x92be('0x8')][_0x862a2b['uniqueid']][_0x92be('0xa')];}utils[_0x92be('0xb')](util['format'](_0x92be('0xc'),_0x862a2b[_0x92be('0x9')],_0x862a2b[_0x92be('0xd')],_0x862a2b[_0x92be('0xe')],_0x862a2b[_0x92be('0xf')],_0x862a2b[_0x92be('0x10')],_0x862a2b[_0x92be('0x11')],_0x862a2b['connectedlinenum'],_0x862a2b[_0x92be('0x12')]));if(_0x862a2b[_0x92be('0x13')]){utils[_0x92be('0x14')](_0x862a2b[_0x92be('0x13')])['then'](function(_0x3ea774){if(_0x3ea774){_0x862a2b['UserId']=_0x3ea774['id'];}utils[_0x92be('0x15')](_0x92be('0x16'),_0x862a2b);});}else{utils[_0x92be('0x15')](_0x92be('0x16'),_0x862a2b);}if(channels[_0x862a2b[_0x92be('0x9')]]){delete channels[_0x862a2b['uniqueid']];}else if(_0x591218&&channels[_0x591218]){delete transfers[_0x92be('0x8')][_0x591218];delete channels[_0x591218];}}exports['newchannel']=function(_0x4f43bb){try{utils[_0x92be('0x17')](util[_0x92be('0x18')](_0x92be('0x19'),_0x4f43bb[_0x92be('0x9')]),_0x4f43bb);if(_0x4f43bb[_0x92be('0x9')]==_0x4f43bb[_0x92be('0x1a')]&&_0x4f43bb[_0x92be('0xd')]!='OutgoingSpoolFailed'){utils[_0x92be('0xb')](util['format'](_0x92be('0x1b'),_0x4f43bb[_0x92be('0x9')],_0x4f43bb['context'],_0x4f43bb[_0x92be('0x1c')]));channels[_0x4f43bb[_0x92be('0x9')]]={'uniqueid':_0x4f43bb[_0x92be('0x9')],'accountcode':_0x4f43bb[_0x92be('0x13')],'source':_0x4f43bb['calleridnum'],'destination':_0x4f43bb[_0x92be('0x1c')],'destinationcontext':_0x4f43bb[_0x92be('0x1d')],'channel':_0x4f43bb['channel'],'starttime':utils[_0x92be('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x92be('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x4c3bf9){utils[_0x92be('0x1f')](util['format'](_0x92be('0x19'),_0x4f43bb[_0x92be('0x9')]),_0x4c3bf9);}};exports[_0x92be('0x20')]=function(_0x245c8b){try{utils[_0x92be('0x17')](util['format'](_0x92be('0x21'),_0x245c8b[_0x92be('0x9')]),_0x245c8b);if(!_[_0x92be('0x22')](channels[_0x245c8b[_0x92be('0x9')]])&&_0x245c8b['channelstate']==0x6){utils[_0x92be('0xb')](util[_0x92be('0x18')](_0x92be('0x23'),_0x245c8b[_0x92be('0x9')],_0x245c8b[_0x92be('0x1d')],_0x245c8b[_0x92be('0xd')]));if(_[_0x92be('0x22')](channels[_0x245c8b[_0x92be('0x9')]][_0x92be('0x24')])){channels[_0x245c8b['uniqueid']][_0x92be('0x24')]=utils[_0x92be('0x1e')]();}}else if(!_[_0x92be('0x22')](channels[_0x245c8b['linkedid']])&&_0x245c8b[_0x92be('0x25')]==0x6&&_0x245c8b[_0x92be('0x1d')]!=_0x92be('0x26')){utils[_0x92be('0xb')](util[_0x92be('0x18')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x245c8b[_0x92be('0x9')],_0x245c8b['linkedid'],_0x245c8b[_0x92be('0x1d')],_0x245c8b[_0x92be('0xd')]));channels[_0x245c8b[_0x92be('0x1a')]]['accountcode']=_0x245c8b[_0x92be('0x13')];channels[_0x245c8b[_0x92be('0x1a')]]['destinationchannel']=_0x245c8b[_0x92be('0xd')];if(_[_0x92be('0x22')](channels[_0x245c8b[_0x92be('0x1a')]][_0x92be('0x27')])){channels[_0x245c8b['linkedid']][_0x92be('0x27')]=utils[_0x92be('0x1e')]();}channels[_0x245c8b[_0x92be('0x1a')]][_0x92be('0x28')]=dispositions[_['toNumber'](_0x245c8b[_0x92be('0x25')])]||_0x92be('0x6');}}catch(_0x25948e){utils[_0x92be('0x1f')](util[_0x92be('0x18')]('[%s][calls][newstate]',_0x245c8b[_0x92be('0x9')]),_0x25948e);}};exports[_0x92be('0x29')]=function(_0x1cf30e){try{if(!_[_0x92be('0x22')](channels[_0x1cf30e[_0x92be('0x9')]])){utils[_0x92be('0x17')](util[_0x92be('0x18')](_0x92be('0x2a'),_0x1cf30e['uniqueid']),_0x1cf30e);if(_[_0x92be('0x22')](channels[_0x1cf30e['uniqueid']][_0x92be('0x2b')])){channels[_0x1cf30e[_0x92be('0x9')]]['callerid']=_0x1cf30e[_0x92be('0x2c')]+'\x20<'+_0x1cf30e[_0x92be('0x11')]+'>';}utils['info'](util[_0x92be('0x18')](_0x92be('0x2d'),_0x1cf30e[_0x92be('0x9')],channels[_0x1cf30e['uniqueid']]['callerid'],_0x1cf30e[_0x92be('0x2e')]));channels[_0x1cf30e['uniqueid']][_0x92be('0x2f')]=utils['now']();channels[_0x1cf30e['uniqueid']][_0x92be('0x30')]=utils[_0x92be('0x31')](channels[_0x1cf30e[_0x92be('0x9')]][_0x92be('0x2f')],channels[_0x1cf30e['uniqueid']]['starttime']);channels[_0x1cf30e[_0x92be('0x9')]][_0x92be('0x32')]=channels[_0x1cf30e[_0x92be('0x9')]][_0x92be('0x27')]?utils[_0x92be('0x31')](channels[_0x1cf30e['uniqueid']]['endtime'],channels[_0x1cf30e[_0x92be('0x9')]]['answertime']):0x0;writeDB(channels[_0x1cf30e[_0x92be('0x9')]]);}}catch(_0xa6d05b){utils[_0x92be('0x1f')](util[_0x92be('0x18')]('[%s][calls][hangup]',_0x1cf30e[_0x92be('0x9')]),_0xa6d05b);}};exports[_0x92be('0x33')]=function(_0x5b608c){try{if(!_[_0x92be('0x22')](channels[_0x5b608c[_0x92be('0x34')]])){utils['debug'](util[_0x92be('0x18')](_0x92be('0x35'),_0x5b608c[_0x92be('0x36')]),_0x5b608c);if(channels[_0x5b608c['localtwolinkedid']][_0x92be('0xd')]==_0x5b608c[_0x92be('0x37')]){utils[_0x92be('0xb')](util[_0x92be('0x18')](_0x92be('0x38'),_0x5b608c['origtransfereruniqueid'],_0x5b608c[_0x92be('0x34')],_0x5b608c[_0x92be('0x39')]));channels[_0x5b608c[_0x92be('0x34')]][_0x92be('0x3a')]=_0x5b608c[_0x92be('0x39')];channels[_0x5b608c[_0x92be('0x34')]][_0x92be('0x3b')]=_0x92be('0x3c');}else if(channels[_0x5b608c[_0x92be('0x34')]][_0x92be('0xd')]=_0x5b608c[_0x92be('0x3d')]){utils[_0x92be('0xb')](util[_0x92be('0x18')](_0x92be('0x38'),_0x5b608c[_0x92be('0x36')],_0x5b608c[_0x92be('0x34')],_0x5b608c[_0x92be('0x3e')]));channels[_0x5b608c[_0x92be('0x34')]][_0x92be('0x3a')]=_0x5b608c[_0x92be('0x3e')];channels[_0x5b608c[_0x92be('0x34')]][_0x92be('0x3b')]=_0x92be('0x3c');}}}catch(_0x363592){utils['error'](util[_0x92be('0x18')](_0x92be('0x35'),_0x5b608c[_0x92be('0x36')]),_0x363592);}};exports[_0x92be('0x3f')]=function(_0x3d4d5b){try{if(!_['isNil'](channels[_0x3d4d5b[_0x92be('0x9')]])){utils[_0x92be('0x17')](util['format'](_0x92be('0x40'),_0x3d4d5b['uniqueid']),_0x3d4d5b);channels[_0x3d4d5b['uniqueid']]['musiconholdstartAt']=utils['now']();utils[_0x92be('0xb')](util[_0x92be('0x18')](_0x92be('0x41'),_0x3d4d5b[_0x92be('0x9')],channels[_0x3d4d5b[_0x92be('0x9')]]['musiconholdstartAt']));}}catch(_0x5f19c3){utils['error'](util['format']('[%s][calls][musiconholdstart]',_0x3d4d5b['uniqueid']),_0x5f19c3);}};exports[_0x92be('0x42')]=function(_0x342b29){try{if(!_[_0x92be('0x22')](channels[_0x342b29[_0x92be('0x9')]])){utils['debug'](util[_0x92be('0x18')]('[%s][calls][musiconholdstop]',_0x342b29[_0x92be('0x9')]),_0x342b29);if(!_[_0x92be('0x22')](channels[_0x342b29[_0x92be('0x9')]][_0x92be('0x43')])){channels[_0x342b29[_0x92be('0x9')]][_0x92be('0x44')]+=utils[_0x92be('0x31')](utils[_0x92be('0x1e')](),channels[_0x342b29[_0x92be('0x9')]]['musiconholdstartAt']);utils[_0x92be('0xb')](util['format'](_0x92be('0x45'),_0x342b29[_0x92be('0x9')],channels[_0x342b29[_0x92be('0x9')]]['mohtime']));delete channels[_0x342b29['uniqueid']][_0x92be('0x43')];}}}catch(_0x8c7c40){utils[_0x92be('0x1f')](util[_0x92be('0x18')](_0x92be('0x46'),_0x342b29['uniqueid']),_0x8c7c40);}};exports[_0x92be('0x47')]=function(_0x1e977e){try{if(!_[_0x92be('0x22')](channels[_0x1e977e[_0x92be('0x9')]])){utils['debug'](util[_0x92be('0x18')](_0x92be('0x48'),_0x1e977e[_0x92be('0x9')]),_0x1e977e);if(!_[_0x92be('0x22')](_0x1e977e['variable'][_0x92be('0x49')])){utils[_0x92be('0xb')](util[_0x92be('0x18')](_0x92be('0x4a'),_0x1e977e[_0x92be('0x9')],_0x1e977e[_0x92be('0x4b')]));channels[_0x1e977e[_0x92be('0x9')]][_0x92be('0x4c')]=_0x1e977e['value'];}if(!_[_0x92be('0x22')](_0x1e977e[_0x92be('0x4d')]['xmd-phone'])){utils[_0x92be('0xb')](util[_0x92be('0x18')](_0x92be('0x4e'),_0x1e977e[_0x92be('0x9')],_0x1e977e[_0x92be('0x4b')]));channels[_0x1e977e[_0x92be('0x9')]][_0x92be('0x4f')]=_0x1e977e['value'];channels[_0x1e977e['uniqueid']][_0x92be('0x2b')]='\x22'+_0x1e977e[_0x92be('0x4b')]+_0x92be('0x50')+_0x1e977e[_0x92be('0x4b')]+'>';}if(!_[_0x92be('0x22')](_0x1e977e[_0x92be('0x4d')]['xmd-callerid-preview'])||!_['isNil'](_0x1e977e[_0x92be('0x4d')][_0x92be('0x51')])){utils[_0x92be('0xb')](util[_0x92be('0x18')](_0x92be('0x52'),_0x1e977e[_0x92be('0x9')],!_[_0x92be('0x22')](_0x1e977e[_0x92be('0x4d')][_0x92be('0x53')])?_0x92be('0x53'):'xmd-callerid',_0x1e977e[_0x92be('0x4b')]));channels[_0x1e977e[_0x92be('0x9')]][_0x92be('0x2b')]=_0x1e977e['value'];}if(!_[_0x92be('0x22')](_0x1e977e[_0x92be('0x4d')][_0x92be('0x54')])||!_[_0x92be('0x22')](_0x1e977e[_0x92be('0x4d')][_0x92be('0x55')])){utils[_0x92be('0xb')](util[_0x92be('0x18')](_0x92be('0x52'),_0x1e977e[_0x92be('0x9')],!_[_0x92be('0x22')](_0x1e977e[_0x92be('0x4d')][_0x92be('0x54')])?_0x92be('0x54'):_0x92be('0x55'),_0x1e977e[_0x92be('0x4b')]));channels[_0x1e977e[_0x92be('0x9')]]['lastapplication']=_0x92be('0x56');channels[_0x1e977e[_0x92be('0x9')]][_0x92be('0x57')]=_0x1e977e['value'];channels[_0x1e977e[_0x92be('0x9')]]['queue']=!![];}if(!_[_0x92be('0x22')](_0x1e977e[_0x92be('0x4d')][_0x92be('0x58')])){utils[_0x92be('0xb')](util[_0x92be('0x18')](_0x92be('0x59'),_0x1e977e['uniqueid'],_0x1e977e[_0x92be('0x4b')]));channels[_0x1e977e[_0x92be('0x9')]][_0x92be('0x5a')]=_0x1e977e[_0x92be('0x4b')];}if(!_[_0x92be('0x22')](_0x1e977e[_0x92be('0x4d')]['xmd-cdrtype'])){utils['info'](util[_0x92be('0x18')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x1e977e['uniqueid'],_0x1e977e[_0x92be('0x4b')]));channels[_0x1e977e['uniqueid']][_0x92be('0x5b')]=_0x1e977e[_0x92be('0x4b')];}if(!_['isNil'](_0x1e977e[_0x92be('0x4d')]['outboundrouteid'])){utils[_0x92be('0xb')](util[_0x92be('0x18')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x1e977e[_0x92be('0x9')],_0x1e977e[_0x92be('0x4b')]));channels[_0x1e977e[_0x92be('0x9')]][_0x92be('0x5c')]=_0x1e977e[_0x92be('0x4b')];}if(!_[_0x92be('0x22')](_0x1e977e[_0x92be('0x4d')][_0x92be('0x5d')])){utils[_0x92be('0xb')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1e977e[_0x92be('0x9')],_0x1e977e[_0x92be('0x4b')]));channels[_0x1e977e[_0x92be('0x9')]][_0x92be('0x5d')]=_0x1e977e[_0x92be('0x4b')];}}}catch(_0x1a50bf){utils[_0x92be('0x1f')](util[_0x92be('0x18')](_0x92be('0x48'),_0x1e977e[_0x92be('0x9')]),_0x1a50bf);}};exports[_0x92be('0x5e')]=function(_0x1b72fe){try{if(!_[_0x92be('0x22')](channels[_0x1b72fe[_0x92be('0x9')]])){utils[_0x92be('0x17')](util[_0x92be('0x18')](_0x92be('0x5f'),_0x1b72fe['uniqueid']),_0x1b72fe);utils[_0x92be('0xb')](util[_0x92be('0x18')](_0x92be('0x60'),_0x1b72fe[_0x92be('0x9')],_0x1b72fe[_0x92be('0x61')],_0x1b72fe[_0x92be('0x62')]));if(_0x1b72fe[_0x92be('0x61')][_0x92be('0x63')]()==_0x92be('0x64')&&_['startsWith'](_0x1b72fe[_0x92be('0x62')]['toLowerCase'](),'cdr')){var _0x16b26c=_0x1b72fe['appdata'][_0x92be('0x65')]('=');var _0x2a34b3=_0x16b26c[0x0][_0x92be('0x66')](_0x16b26c[0x0][_0x92be('0x67')]('(')+0x1,_0x16b26c[0x0][_0x92be('0x67')](')'));var _0x78010e=_0x16b26c[0x1];channels[_0x1b72fe['uniqueid']][_0x2a34b3]=_0x78010e;}if(!_[_0x92be('0x68')]([_0x92be('0x29'),_0x92be('0x69'),'execif',_0x92be('0x64'),'gotoif'],_0x1b72fe[_0x92be('0x61')][_0x92be('0x63')]())){channels[_0x1b72fe[_0x92be('0x9')]][_0x92be('0x6a')]=_0x1b72fe[_0x92be('0x61')];channels[_0x1b72fe[_0x92be('0x9')]]['lastdata']=_0x1b72fe[_0x92be('0x62')];}}}catch(_0x5d4edb){utils[_0x92be('0x1f')](util['format'](_0x92be('0x5f'),_0x1b72fe[_0x92be('0x9')]),_0x5d4edb);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index ceadccd..71b2ae8 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 _0xb602=['./utils','connect','info','[core]\x20connected','shutdown','[core]\x20fullybooted','error','[core]\x20error','managerevent'];(function(_0x1e03e6,_0x312c15){var _0xe6aa60=function(_0x1334fc){while(--_0x1334fc){_0x1e03e6['push'](_0x1e03e6['shift']());}};_0xe6aa60(++_0x312c15);}(_0xb602,0x156));var _0x2b60=function(_0x28e424,_0x4d6508){_0x28e424=_0x28e424-0x0;var _0x25ab59=_0xb602[_0x28e424];return _0x25ab59;};'use strict';var utils=require(_0x2b60('0x0'));exports[_0x2b60('0x1')]=function(){utils[_0x2b60('0x2')](_0x2b60('0x3'));};exports[_0x2b60('0x4')]=function(){utils[_0x2b60('0x2')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0x2b60('0x2')](_0x2b60('0x5'));};exports[_0x2b60('0x6')]=function(_0x2ae030){utils[_0x2b60('0x6')](_0x2b60('0x7'),_0x2ae030);};exports['close']=function(){utils['info']('[core]\x20close');};exports[_0x2b60('0x8')]=function(_0x55b75a){}; \ No newline at end of file +var _0x2de6=['[core]\x20close','info','error','[core]\x20error','close'];(function(_0x1541ba,_0x170e89){var _0x4ed360=function(_0x5110ce){while(--_0x5110ce){_0x1541ba['push'](_0x1541ba['shift']());}};_0x4ed360(++_0x170e89);}(_0x2de6,0x1a0));var _0x62de=function(_0x2ce01e,_0x59d603){_0x2ce01e=_0x2ce01e-0x0;var _0x14f6ba=_0x2de6[_0x2ce01e];return _0x14f6ba;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x62de('0x0')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0x62de('0x0')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils['info']('[core]\x20fullybooted');};exports[_0x62de('0x1')]=function(_0x3aafc6){utils[_0x62de('0x1')](_0x62de('0x2'),_0x3aafc6);};exports[_0x62de('0x3')]=function(){utils['info'](_0x62de('0x4'));};exports['managerevent']=function(_0x27deff){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index b3d1313..d65605e 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 _0x71f7=['util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','error','dialbegin','[%s][dials][dialbegin]','assign','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','answertime','lastevent','connect','[%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','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash'];(function(_0x174623,_0x3c3372){var _0x7af0b4=function(_0x12fc64){while(--_0x12fc64){_0x174623['push'](_0x174623['shift']());}};_0x7af0b4(++_0x3c3372);}(_0x71f7,0x155));var _0x771f=function(_0x18cbe7,_0x27acd7){_0x18cbe7=_0x18cbe7-0x0;var _0x565136=_0x71f7[_0x18cbe7];return _0x565136;};'use strict';var _=require(_0x771f('0x0'));var util=require(_0x771f('0x1'));var utils=require(_0x771f('0x2'));var dials={};function writeDB(_0x21b2ad){utils[_0x771f('0x3')](util[_0x771f('0x4')](_0x771f('0x5'),_0x21b2ad[_0x771f('0x6')],_0x21b2ad[_0x771f('0x7')],_0x21b2ad[_0x771f('0x8')],_0x21b2ad[_0x771f('0x9')],_0x21b2ad[_0x771f('0xa')],_0x21b2ad[_0x771f('0xb')]));utils[_0x771f('0xc')](_0x771f('0xd'),_0x21b2ad);delete dials[_0x21b2ad[_0x771f('0x6')]];}exports['newexten']=function(_0x5f54ed){try{utils[_0x771f('0xe')](util[_0x771f('0x4')](_0x771f('0xf'),_0x5f54ed[_0x771f('0x6')]),_0x5f54ed);utils[_0x771f('0x3')](util['format'](_0x771f('0x10'),_0x5f54ed['uniqueid'],_0x5f54ed[_0x771f('0x11')],_0x5f54ed[_0x771f('0x12')]));if(_0x5f54ed[_0x771f('0x11')][_0x771f('0x13')]()==_0x771f('0x14')&&_[_0x771f('0x15')](_0x5f54ed[_0x771f('0x12')][_0x771f('0x13')](),_0x771f('0x16'))){var _0x2b07bb=_0x5f54ed[_0x771f('0x12')][_0x771f('0x17')]('=');dials[_0x5f54ed[_0x771f('0x6')]]={'routeId':_0x2b07bb[0x1]};}}catch(_0xeb8889){utils['error'](util[_0x771f('0x4')](_0x771f('0xf'),_0x5f54ed[_0x771f('0x6')]),_0xeb8889);}};exports[_0x771f('0x18')]=function(_0x2dde03){try{utils[_0x771f('0xe')](util[_0x771f('0x4')](_0x771f('0x19'),_0x2dde03['uniqueid']),_0x2dde03);if(!_[_0x771f('0x1a')](_0x2dde03[_0x771f('0x1b')][_0x771f('0x1c')])){utils[_0x771f('0x3')](util[_0x771f('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x2dde03[_0x771f('0x6')],_0x2dde03[_0x771f('0x1d')]));dials[_0x2dde03[_0x771f('0x6')]]={'routeId':_0x2dde03[_0x771f('0x1d')]};}}catch(_0x528cbb){utils[_0x771f('0x1e')](util['format'](_0x771f('0x19'),_0x2dde03['uniqueid']),_0x528cbb);}};exports[_0x771f('0x1f')]=function(_0x57704f){try{if(!_[_0x771f('0x1a')](dials[_0x57704f['uniqueid']])){utils[_0x771f('0xe')](util['format'](_0x771f('0x20'),_0x57704f[_0x771f('0x6')]),_0x57704f);dials[_0x57704f[_0x771f('0x6')]]=_[_0x771f('0x21')](dials[_0x57704f[_0x771f('0x6')]],_0x57704f);dials[_0x57704f[_0x771f('0x6')]]['starttime']=utils[_0x771f('0x22')]();dials[_0x57704f[_0x771f('0x6')]]['lastevent']=_0x771f('0x23');utils[_0x771f('0x3')](util[_0x771f('0x4')](_0x771f('0x24'),_0x57704f[_0x771f('0x6')],dials[_0x57704f['uniqueid']][_0x771f('0x25')]));}}catch(_0x24abbc){utils[_0x771f('0x1e')](util[_0x771f('0x4')]('[%s][dials][dialbegin]',_0x57704f[_0x771f('0x6')]),_0x24abbc);}};exports[_0x771f('0x26')]=function(_0x17a1c5){try{if(!_[_0x771f('0x1a')](dials[_0x17a1c5[_0x771f('0x6')]])){utils[_0x771f('0xe')](util[_0x771f('0x4')](_0x771f('0x27'),_0x17a1c5[_0x771f('0x6')]),_0x17a1c5);dials[_0x17a1c5[_0x771f('0x6')]][_0x771f('0xb')]=_0x17a1c5['dialstatus'];if(_0x17a1c5['dialstatus']==_0x771f('0x28')){dials[_0x17a1c5['uniqueid']]=_['assign'](dials[_0x17a1c5[_0x771f('0x6')]],_0x17a1c5);dials[_0x17a1c5[_0x771f('0x6')]][_0x771f('0x29')]=utils[_0x771f('0x22')]();dials[_0x17a1c5[_0x771f('0x6')]][_0x771f('0x2a')]=_0x771f('0x2b');utils[_0x771f('0x3')](util['format'](_0x771f('0x2c'),_0x17a1c5[_0x771f('0x6')],_0x17a1c5['dialstatus'],dials[_0x17a1c5[_0x771f('0x6')]][_0x771f('0x29')]));}else{utils[_0x771f('0x3')](util['format'](_0x771f('0x2d'),_0x17a1c5[_0x771f('0x6')],_0x17a1c5[_0x771f('0xb')]));}}}catch(_0x459203){utils[_0x771f('0x1e')](util[_0x771f('0x4')]('[%s][dials][dialend]',_0x17a1c5[_0x771f('0x6')]),_0x459203);}};exports[_0x771f('0x2e')]=function(_0x5d147b){try{if(!_[_0x771f('0x1a')](dials[_0x5d147b[_0x771f('0x6')]])){utils['debug'](util['format'](_0x771f('0x2f'),_0x5d147b[_0x771f('0x6')]),_0x5d147b);utils['info'](util[_0x771f('0x4')](_0x771f('0x30'),_0x5d147b[_0x771f('0x6')],_0x5d147b[_0x771f('0x9')],_0x5d147b[_0x771f('0x31')],_0x5d147b[_0x771f('0x32')]));dials[_0x5d147b['uniqueid']]=_[_0x771f('0x21')](dials[_0x5d147b[_0x771f('0x6')]],{'endtime':utils['now'](),'lastevent':_0x771f('0x33')});dials[_0x5d147b[_0x771f('0x6')]][_0x771f('0x34')]=utils[_0x771f('0x35')](dials[_0x5d147b[_0x771f('0x6')]][_0x771f('0x36')],dials[_0x5d147b[_0x771f('0x6')]][_0x771f('0x25')]);dials[_0x5d147b[_0x771f('0x6')]][_0x771f('0x37')]=utils[_0x771f('0x35')](dials[_0x5d147b['uniqueid']][_0x771f('0x29')]||dials[_0x5d147b[_0x771f('0x6')]]['endtime'],dials[_0x5d147b['uniqueid']]['starttime']);dials[_0x5d147b[_0x771f('0x6')]][_0x771f('0x38')]=dials[_0x5d147b['uniqueid']][_0x771f('0x29')]?utils[_0x771f('0x35')](dials[_0x5d147b['uniqueid']]['endtime'],dials[_0x5d147b[_0x771f('0x6')]][_0x771f('0x29')]):0x0;writeDB(dials[_0x5d147b['uniqueid']]);}}catch(_0x576557){utils[_0x771f('0x1e')](util['format'](_0x771f('0x2f'),_0x5d147b[_0x771f('0x6')]),_0x576557);}}; \ No newline at end of file +var _0x2d7f=['application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s'];(function(_0x551c3b,_0xa3279c){var _0x472202=function(_0x29bb8c){while(--_0x29bb8c){_0x551c3b['push'](_0x551c3b['shift']());}};_0x472202(++_0xa3279c);}(_0x2d7f,0x1e5));var _0xf2d7=function(_0x232ba4,_0x1eb213){_0x232ba4=_0x232ba4-0x0;var _0x3849b2=_0x2d7f[_0x232ba4];return _0x3849b2;};'use strict';var _=require(_0xf2d7('0x0'));var util=require('util');var utils=require(_0xf2d7('0x1'));var dials={};function writeDB(_0x29eef7){utils[_0xf2d7('0x2')](util[_0xf2d7('0x3')](_0xf2d7('0x4'),_0x29eef7['uniqueid'],_0x29eef7[_0xf2d7('0x5')],_0x29eef7[_0xf2d7('0x6')],_0x29eef7[_0xf2d7('0x7')],_0x29eef7['connectedlinenum'],_0x29eef7['dialstatus']));utils[_0xf2d7('0x8')](_0xf2d7('0x9'),_0x29eef7);delete dials[_0x29eef7['uniqueid']];}exports[_0xf2d7('0xa')]=function(_0x557934){try{utils[_0xf2d7('0xb')](util['format'](_0xf2d7('0xc'),_0x557934[_0xf2d7('0xd')]),_0x557934);utils[_0xf2d7('0x2')](util[_0xf2d7('0x3')](_0xf2d7('0xe'),_0x557934['uniqueid'],_0x557934[_0xf2d7('0xf')],_0x557934[_0xf2d7('0x10')]));if(_0x557934[_0xf2d7('0xf')][_0xf2d7('0x11')]()==_0xf2d7('0x12')&&_[_0xf2d7('0x13')](_0x557934[_0xf2d7('0x10')]['toLowerCase'](),_0xf2d7('0x14'))){var _0x4d29b4=_0x557934[_0xf2d7('0x10')]['split']('=');dials[_0x557934[_0xf2d7('0xd')]]={'routeId':_0x4d29b4[0x1]};}}catch(_0xb49402){utils[_0xf2d7('0x15')](util[_0xf2d7('0x3')]('[%s][dials][newexten]',_0x557934['uniqueid']),_0xb49402);}};exports[_0xf2d7('0x16')]=function(_0x46d139){try{utils[_0xf2d7('0xb')](util[_0xf2d7('0x3')]('[%s][dials][varset]',_0x46d139[_0xf2d7('0xd')]),_0x46d139);if(!_['isNil'](_0x46d139['variable'][_0xf2d7('0x17')])){utils[_0xf2d7('0x2')](util['format'](_0xf2d7('0x18'),_0x46d139[_0xf2d7('0xd')],_0x46d139[_0xf2d7('0x19')]));dials[_0x46d139['uniqueid']]={'routeId':_0x46d139[_0xf2d7('0x19')]};}}catch(_0x1e6178){utils[_0xf2d7('0x15')](util[_0xf2d7('0x3')]('[%s][dials][varset]',_0x46d139[_0xf2d7('0xd')]),_0x1e6178);}};exports['dialbegin']=function(_0x3dc723){try{if(!_[_0xf2d7('0x1a')](dials[_0x3dc723[_0xf2d7('0xd')]])){utils[_0xf2d7('0xb')](util[_0xf2d7('0x3')](_0xf2d7('0x1b'),_0x3dc723['uniqueid']),_0x3dc723);dials[_0x3dc723['uniqueid']]=_[_0xf2d7('0x1c')](dials[_0x3dc723[_0xf2d7('0xd')]],_0x3dc723);dials[_0x3dc723[_0xf2d7('0xd')]][_0xf2d7('0x1d')]=utils[_0xf2d7('0x1e')]();dials[_0x3dc723[_0xf2d7('0xd')]][_0xf2d7('0x1f')]=_0xf2d7('0x20');utils[_0xf2d7('0x2')](util[_0xf2d7('0x3')](_0xf2d7('0x21'),_0x3dc723[_0xf2d7('0xd')],dials[_0x3dc723[_0xf2d7('0xd')]][_0xf2d7('0x1d')]));}}catch(_0x1d86e3){utils[_0xf2d7('0x15')](util[_0xf2d7('0x3')]('[%s][dials][dialbegin]',_0x3dc723[_0xf2d7('0xd')]),_0x1d86e3);}};exports[_0xf2d7('0x22')]=function(_0x18f3c4){try{if(!_[_0xf2d7('0x1a')](dials[_0x18f3c4[_0xf2d7('0xd')]])){utils[_0xf2d7('0xb')](util[_0xf2d7('0x3')]('[%s][dials][dialend]',_0x18f3c4[_0xf2d7('0xd')]),_0x18f3c4);dials[_0x18f3c4[_0xf2d7('0xd')]][_0xf2d7('0x23')]=_0x18f3c4['dialstatus'];if(_0x18f3c4[_0xf2d7('0x23')]==_0xf2d7('0x24')){dials[_0x18f3c4[_0xf2d7('0xd')]]=_[_0xf2d7('0x1c')](dials[_0x18f3c4[_0xf2d7('0xd')]],_0x18f3c4);dials[_0x18f3c4[_0xf2d7('0xd')]][_0xf2d7('0x25')]=utils['now']();dials[_0x18f3c4[_0xf2d7('0xd')]][_0xf2d7('0x1f')]=_0xf2d7('0x26');utils[_0xf2d7('0x2')](util['format'](_0xf2d7('0x27'),_0x18f3c4[_0xf2d7('0xd')],_0x18f3c4['dialstatus'],dials[_0x18f3c4['uniqueid']]['answertime']));}else{utils[_0xf2d7('0x2')](util['format'](_0xf2d7('0x28'),_0x18f3c4[_0xf2d7('0xd')],_0x18f3c4['dialstatus']));}}}catch(_0x3aafb4){utils[_0xf2d7('0x15')](util[_0xf2d7('0x3')](_0xf2d7('0x29'),_0x18f3c4[_0xf2d7('0xd')]),_0x3aafb4);}};exports['hangup']=function(_0x40c23c){try{if(!_[_0xf2d7('0x1a')](dials[_0x40c23c[_0xf2d7('0xd')]])){utils[_0xf2d7('0xb')](util[_0xf2d7('0x3')](_0xf2d7('0x2a'),_0x40c23c[_0xf2d7('0xd')]),_0x40c23c);utils[_0xf2d7('0x2')](util[_0xf2d7('0x3')](_0xf2d7('0x2b'),_0x40c23c[_0xf2d7('0xd')],_0x40c23c['calleridnum'],_0x40c23c[_0xf2d7('0x2c')],_0x40c23c[_0xf2d7('0x2d')]));dials[_0x40c23c[_0xf2d7('0xd')]]=_[_0xf2d7('0x1c')](dials[_0x40c23c['uniqueid']],{'endtime':utils[_0xf2d7('0x1e')](),'lastevent':_0xf2d7('0x2e')});dials[_0x40c23c[_0xf2d7('0xd')]][_0xf2d7('0x2f')]=utils[_0xf2d7('0x30')](dials[_0x40c23c['uniqueid']][_0xf2d7('0x31')],dials[_0x40c23c[_0xf2d7('0xd')]][_0xf2d7('0x1d')]);dials[_0x40c23c[_0xf2d7('0xd')]]['holdtime']=utils[_0xf2d7('0x30')](dials[_0x40c23c[_0xf2d7('0xd')]]['answertime']||dials[_0x40c23c[_0xf2d7('0xd')]]['endtime'],dials[_0x40c23c['uniqueid']][_0xf2d7('0x1d')]);dials[_0x40c23c[_0xf2d7('0xd')]]['billableseconds']=dials[_0x40c23c[_0xf2d7('0xd')]][_0xf2d7('0x25')]?utils[_0xf2d7('0x30')](dials[_0x40c23c[_0xf2d7('0xd')]]['endtime'],dials[_0x40c23c[_0xf2d7('0xd')]][_0xf2d7('0x25')]):0x0;writeDB(dials[_0x40c23c[_0xf2d7('0xd')]]);}}catch(_0x5393a7){utils[_0xf2d7('0x15')](util[_0xf2d7('0x3')](_0xf2d7('0x2a'),_0x40c23c['uniqueid']),_0x5393a7);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 0db8bdd..3c7d66b 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 _0x3f5e=['[%s][index][dialend]','dialend','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f5e,0xd7));var _0xe3f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f5e[_0x3dd15e];return _0x231fd0;};var AsteriskManager=require('asterisk-manager');var config=require(_0xe3f5('0x0'));var utils=require(_0xe3f5('0x1'));var util=require(_0xe3f5('0x2'));var ami=new AsteriskManager(config[_0xe3f5('0x3')][_0xe3f5('0x4')],config[_0xe3f5('0x3')]['ip'],config['asterisk'][_0xe3f5('0x5')],config[_0xe3f5('0x3')][_0xe3f5('0x6')],!![]);ami[_0xe3f5('0x7')]();if(config['xdr']&&config[_0xe3f5('0x8')]['disabled']){utils[_0xe3f5('0x9')](_0xe3f5('0xa'));}else{var agents=require(_0xe3f5('0xb'));var calls=require(_0xe3f5('0xc'));var queues=require(_0xe3f5('0xd'));var recordings=require(_0xe3f5('0xe'));var members=require(_0xe3f5('0xf'));var dials=require(_0xe3f5('0x10'));var transfers=require(_0xe3f5('0x11'));var core=require(_0xe3f5('0x12'));ami['on'](_0xe3f5('0x13'),core['connect']);ami['on'](_0xe3f5('0x14'),core[_0xe3f5('0x14')]);ami['on'](_0xe3f5('0x15'),core[_0xe3f5('0x15')]);ami['on'](_0xe3f5('0x16'),core[_0xe3f5('0x16')]);ami['on'](_0xe3f5('0x17'),core[_0xe3f5('0x17')]);ami['on'](_0xe3f5('0x18'),core['managerevent']);ami['on'](_0xe3f5('0x19'),function(_0xb8973c){try{utils[_0xe3f5('0x1a')](util[_0xe3f5('0x1b')](_0xe3f5('0x1c'),_0xb8973c[_0xe3f5('0x1d')]),_0xb8973c);members['devicestatechange'](_0xb8973c);}catch(_0x174992){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x1c'),_0xb8973c[_0xe3f5('0x1d')]),_0x174992);}});ami['on'](_0xe3f5('0x1e'),function(_0x211d79){try{utils[_0xe3f5('0x1a')](util['format'](_0xe3f5('0x1f'),_0x211d79[_0xe3f5('0x20')]),_0x211d79);agents[_0xe3f5('0x1e')](_0x211d79);}catch(_0x1a859d){utils[_0xe3f5('0x16')](util['format'](_0xe3f5('0x1f'),_0x211d79[_0xe3f5('0x20')]),_0x1a859d);}});ami['on'](_0xe3f5('0x21'),function(_0x5a5f6b){try{utils[_0xe3f5('0x1a')](util[_0xe3f5('0x1b')](_0xe3f5('0x22'),_0x5a5f6b[_0xe3f5('0x20')]),_0x5a5f6b);agents[_0xe3f5('0x21')](_0x5a5f6b);}catch(_0x50c48c){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x22'),_0x5a5f6b[_0xe3f5('0x20')]),_0x50c48c);}});ami['on'](_0xe3f5('0x23'),function(_0x4311b4){try{utils['debug'](util[_0xe3f5('0x1b')](_0xe3f5('0x24'),_0x4311b4['uniqueid']),_0x4311b4);agents[_0xe3f5('0x23')](_0x4311b4);queues[_0xe3f5('0x23')](_0x4311b4);}catch(_0x5677b1){utils['error'](util[_0xe3f5('0x1b')](_0xe3f5('0x24'),_0x4311b4[_0xe3f5('0x20')]),_0x5677b1);}});ami['on'](_0xe3f5('0x25'),function(_0x2dc734){try{utils['debug'](util[_0xe3f5('0x1b')](_0xe3f5('0x26'),_0x2dc734[_0xe3f5('0x20')]),_0x2dc734);agents[_0xe3f5('0x25')](_0x2dc734);queues[_0xe3f5('0x25')](_0x2dc734);members[_0xe3f5('0x25')](_0x2dc734);}catch(_0x4183d8){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x26'),_0x2dc734[_0xe3f5('0x20')]),_0x4183d8);}});ami['on'](_0xe3f5('0x27'),function(_0x117fa0){try{utils[_0xe3f5('0x1a')](util[_0xe3f5('0x1b')](_0xe3f5('0x28'),_0x117fa0['uniqueid']),_0x117fa0);agents[_0xe3f5('0x27')](_0x117fa0);queues['queuecallerabandon'](_0x117fa0);}catch(_0x24d668){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x28'),_0x117fa0[_0xe3f5('0x20')]),_0x24d668);}});ami['on']('queuecallerjoin',function(_0x124409){try{utils[_0xe3f5('0x1a')](util[_0xe3f5('0x1b')](_0xe3f5('0x29'),_0x124409['uniqueid']),_0x124409);queues['queuecallerjoin'](_0x124409);recordings[_0xe3f5('0x2a')](_0x124409);}catch(_0x175f69){utils[_0xe3f5('0x16')](util['format'](_0xe3f5('0x29'),_0x124409[_0xe3f5('0x20')]),_0x175f69);}});ami['on'](_0xe3f5('0x2b'),function(_0x2f6451){try{utils['debug'](util['format'](_0xe3f5('0x2c'),_0x2f6451[_0xe3f5('0x20')]),_0x2f6451);queues[_0xe3f5('0x2b')](_0x2f6451);}catch(_0x4ecf0b){utils[_0xe3f5('0x16')](util['format'](_0xe3f5('0x2c'),_0x2f6451[_0xe3f5('0x20')]),_0x4ecf0b);}});ami['on'](_0xe3f5('0x2d'),function(_0x4482a0){try{utils['debug'](util[_0xe3f5('0x1b')](_0xe3f5('0x2e'),_0x4482a0['uniqueid']),_0x4482a0);queues['musiconholdstart'](_0x4482a0);calls[_0xe3f5('0x2d')](_0x4482a0);}catch(_0x54a2be){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x2e'),_0x4482a0[_0xe3f5('0x20')]),_0x54a2be);}});ami['on'](_0xe3f5('0x2f'),function(_0x218f22){try{utils['debug'](util[_0xe3f5('0x1b')](_0xe3f5('0x30'),_0x218f22[_0xe3f5('0x20')]),_0x218f22);queues['musiconholdstop'](_0x218f22);calls['musiconholdstop'](_0x218f22);}catch(_0x5210c2){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')]('[%s][index][musiconholdstop]',_0x218f22[_0xe3f5('0x20')]),_0x5210c2);}});ami['on'](_0xe3f5('0x31'),function(_0x1b6082){try{utils[_0xe3f5('0x1a')](util[_0xe3f5('0x1b')](_0xe3f5('0x32'),_0x1b6082['uniqueid']),_0x1b6082);calls[_0xe3f5('0x31')](_0x1b6082);recordings[_0xe3f5('0x31')](_0x1b6082);}catch(_0x514267){utils[_0xe3f5('0x16')](util['format']('[%s][index][newstate]',_0x1b6082['uniqueid']),_0x514267);}});ami['on'](_0xe3f5('0x33'),function(_0xd38a30){try{utils['debug'](util[_0xe3f5('0x1b')]('[%s][index][hangup]',_0xd38a30[_0xe3f5('0x20')]),_0xd38a30);calls[_0xe3f5('0x33')](_0xd38a30);recordings[_0xe3f5('0x33')](_0xd38a30);dials[_0xe3f5('0x33')](_0xd38a30);agents[_0xe3f5('0x33')](_0xd38a30);queues['hangup'](_0xd38a30);}catch(_0x4b8a7c){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x34'),_0xd38a30[_0xe3f5('0x20')]),_0x4b8a7c);}});ami['on'](_0xe3f5('0x35'),function(_0x2d9cf6){try{utils[_0xe3f5('0x1a')](util[_0xe3f5('0x1b')]('[%s][index][cdr]',_0x2d9cf6[_0xe3f5('0x20')]),_0x2d9cf6);members[_0xe3f5('0x35')](_0x2d9cf6);}catch(_0x3974cf){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x36'),_0x2d9cf6[_0xe3f5('0x20')]),_0x3974cf);}});ami['on']('blindtransfer',function(_0x3d9262){try{utils[_0xe3f5('0x1a')](util['format'](_0xe3f5('0x37'),_0x3d9262[_0xe3f5('0x20')]),_0x3d9262);queues['blindtransfer'](_0x3d9262);agents[_0xe3f5('0x38')](_0x3d9262);transfers['blindtransfer'](_0x3d9262);}catch(_0x2b8148){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x37'),_0x3d9262[_0xe3f5('0x20')]),_0x2b8148);}});ami['on'](_0xe3f5('0x39'),function(_0xe6bc9f){try{utils[_0xe3f5('0x1a')](util[_0xe3f5('0x1b')](_0xe3f5('0x3a'),_0xe6bc9f['origtransfereruniqueid']),_0xe6bc9f);queues[_0xe3f5('0x39')](_0xe6bc9f);transfers[_0xe3f5('0x39')](_0xe6bc9f);agents[_0xe3f5('0x39')](_0xe6bc9f);calls[_0xe3f5('0x39')](_0xe6bc9f);}catch(_0x1527db){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x3a'),_0xe6bc9f[_0xe3f5('0x3b')]),_0x1527db);}});ami['on'](_0xe3f5('0x3c'),function(_0x2eef05){try{utils['debug'](util[_0xe3f5('0x1b')](_0xe3f5('0x3d'),_0x2eef05[_0xe3f5('0x20')]),_0x2eef05);queues[_0xe3f5('0x3c')](_0x2eef05);recordings[_0xe3f5('0x3c')](_0x2eef05);calls['varset'](_0x2eef05);dials[_0xe3f5('0x3c')](_0x2eef05);}catch(_0x363f3d){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x3d'),_0x2eef05[_0xe3f5('0x20')]),_0x363f3d);}});ami['on'](_0xe3f5('0x3e'),function(_0x3edb2a){try{utils[_0xe3f5('0x1a')](util[_0xe3f5('0x1b')](_0xe3f5('0x3f'),_0x3edb2a[_0xe3f5('0x20')]),_0x3edb2a);calls[_0xe3f5('0x3e')](_0x3edb2a);recordings[_0xe3f5('0x3e')](_0x3edb2a);dials[_0xe3f5('0x3e')](_0x3edb2a);}catch(_0x390f40){utils['error'](util[_0xe3f5('0x1b')](_0xe3f5('0x3f'),_0x3edb2a[_0xe3f5('0x20')]),_0x390f40);}});ami['on'](_0xe3f5('0x40'),function(_0x465d67){try{utils['debug'](util['format'](_0xe3f5('0x41'),_0x465d67['uniqueid']),_0x465d67);calls[_0xe3f5('0x40')](_0x465d67);recordings[_0xe3f5('0x40')](_0x465d67);}catch(_0xe02134){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x41'),_0x465d67[_0xe3f5('0x20')]),_0xe02134);}});ami['on'](_0xe3f5('0x42'),function(_0x8a8b6c){try{utils['debug'](util[_0xe3f5('0x1b')](_0xe3f5('0x43'),_0x8a8b6c['uniqueid']),_0x8a8b6c);dials[_0xe3f5('0x42')](_0x8a8b6c);}catch(_0x439794){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x44'),_0x8a8b6c[_0xe3f5('0x20')]),_0x439794);}});ami['on']('dialend',function(_0xc666d9){try{utils[_0xe3f5('0x1a')](util[_0xe3f5('0x1b')](_0xe3f5('0x45'),_0xc666d9['uniqueid']),_0xc666d9);dials[_0xe3f5('0x46')](_0xc666d9);}catch(_0x47b7d6){utils[_0xe3f5('0x16')](util[_0xe3f5('0x1b')](_0xe3f5('0x45'),_0xc666d9[_0xe3f5('0x20')]),_0x47b7d6);}});} \ No newline at end of file +var _0xbd6f=['musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','password','keepConnected','xdr','disabled','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xbd6f,0x1b0));var _0xfbd6=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0xbd6f[_0x2a8c21];return _0x5f3061;};var AsteriskManager=require(_0xfbd6('0x0'));var config=require(_0xfbd6('0x1'));var utils=require(_0xfbd6('0x2'));var util=require(_0xfbd6('0x3'));var ami=new AsteriskManager(config[_0xfbd6('0x4')]['port'],config['asterisk']['ip'],config[_0xfbd6('0x4')]['username'],config['asterisk'][_0xfbd6('0x5')],!![]);ami[_0xfbd6('0x6')]();if(config[_0xfbd6('0x7')]&&config[_0xfbd6('0x7')][_0xfbd6('0x8')]){utils[_0xfbd6('0x9')]('XDR\x20DISABLED');}else{var agents=require(_0xfbd6('0xa'));var calls=require(_0xfbd6('0xb'));var queues=require(_0xfbd6('0xc'));var recordings=require(_0xfbd6('0xd'));var members=require(_0xfbd6('0xe'));var dials=require(_0xfbd6('0xf'));var transfers=require(_0xfbd6('0x10'));var core=require(_0xfbd6('0x11'));ami['on'](_0xfbd6('0x12'),core[_0xfbd6('0x12')]);ami['on'](_0xfbd6('0x13'),core[_0xfbd6('0x13')]);ami['on'](_0xfbd6('0x14'),core[_0xfbd6('0x14')]);ami['on'](_0xfbd6('0x15'),core[_0xfbd6('0x15')]);ami['on'](_0xfbd6('0x16'),core[_0xfbd6('0x16')]);ami['on'](_0xfbd6('0x17'),core['managerevent']);ami['on']('devicestatechange',function(_0x3984c7){try{utils['debug'](util[_0xfbd6('0x18')](_0xfbd6('0x19'),_0x3984c7[_0xfbd6('0x1a')]),_0x3984c7);members[_0xfbd6('0x1b')](_0x3984c7);}catch(_0x4b0644){utils[_0xfbd6('0x15')](util[_0xfbd6('0x18')](_0xfbd6('0x19'),_0x3984c7['device']),_0x4b0644);}});ami['on'](_0xfbd6('0x1c'),function(_0x2330cb){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')](_0xfbd6('0x1e'),_0x2330cb[_0xfbd6('0x1f')]),_0x2330cb);agents[_0xfbd6('0x1c')](_0x2330cb);}catch(_0x139fa1){utils['error'](util[_0xfbd6('0x18')]('[%s][index][agentcalled]',_0x2330cb[_0xfbd6('0x1f')]),_0x139fa1);}});ami['on'](_0xfbd6('0x20'),function(_0x3a334d){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')]('[%s][index][agentringnoanswer]',_0x3a334d[_0xfbd6('0x1f')]),_0x3a334d);agents[_0xfbd6('0x20')](_0x3a334d);}catch(_0x5304cd){utils[_0xfbd6('0x15')](util['format'](_0xfbd6('0x21'),_0x3a334d[_0xfbd6('0x1f')]),_0x5304cd);}});ami['on'](_0xfbd6('0x22'),function(_0x771034){try{utils[_0xfbd6('0x1d')](util['format'](_0xfbd6('0x23'),_0x771034[_0xfbd6('0x1f')]),_0x771034);agents[_0xfbd6('0x22')](_0x771034);queues['agentconnect'](_0x771034);}catch(_0x5d9ea2){utils[_0xfbd6('0x15')](util[_0xfbd6('0x18')](_0xfbd6('0x23'),_0x771034[_0xfbd6('0x1f')]),_0x5d9ea2);}});ami['on'](_0xfbd6('0x24'),function(_0x2188cf){try{utils['debug'](util[_0xfbd6('0x18')]('[%s][index][agentcomplete]',_0x2188cf[_0xfbd6('0x1f')]),_0x2188cf);agents['agentcomplete'](_0x2188cf);queues[_0xfbd6('0x24')](_0x2188cf);members[_0xfbd6('0x24')](_0x2188cf);}catch(_0x1f00be){utils[_0xfbd6('0x15')](util['format'](_0xfbd6('0x25'),_0x2188cf[_0xfbd6('0x1f')]),_0x1f00be);}});ami['on'](_0xfbd6('0x26'),function(_0x2f4297){try{utils['debug'](util[_0xfbd6('0x18')]('[%s][index][queuecallerabandon]',_0x2f4297[_0xfbd6('0x1f')]),_0x2f4297);agents[_0xfbd6('0x26')](_0x2f4297);queues[_0xfbd6('0x26')](_0x2f4297);}catch(_0x31bb17){utils[_0xfbd6('0x15')](util[_0xfbd6('0x18')](_0xfbd6('0x27'),_0x2f4297[_0xfbd6('0x1f')]),_0x31bb17);}});ami['on']('queuecallerjoin',function(_0x19cc95){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')]('[%s][index][queuecallerjoin]',_0x19cc95[_0xfbd6('0x1f')]),_0x19cc95);queues['queuecallerjoin'](_0x19cc95);recordings['queuecallerjoin'](_0x19cc95);}catch(_0x5e959f){utils[_0xfbd6('0x15')](util['format']('[%s][index][queuecallerjoin]',_0x19cc95[_0xfbd6('0x1f')]),_0x5e959f);}});ami['on'](_0xfbd6('0x28'),function(_0x425d6e){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')](_0xfbd6('0x29'),_0x425d6e[_0xfbd6('0x1f')]),_0x425d6e);queues[_0xfbd6('0x28')](_0x425d6e);}catch(_0x252d02){utils[_0xfbd6('0x15')](util[_0xfbd6('0x18')]('[%s][index][queuecallerleave]',_0x425d6e[_0xfbd6('0x1f')]),_0x252d02);}});ami['on']('musiconholdstart',function(_0x3a769f){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')](_0xfbd6('0x2a'),_0x3a769f['uniqueid']),_0x3a769f);queues[_0xfbd6('0x2b')](_0x3a769f);calls['musiconholdstart'](_0x3a769f);}catch(_0x5e4d70){utils[_0xfbd6('0x15')](util[_0xfbd6('0x18')](_0xfbd6('0x2a'),_0x3a769f[_0xfbd6('0x1f')]),_0x5e4d70);}});ami['on'](_0xfbd6('0x2c'),function(_0x52d37d){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')]('[%s][index][musiconholdstop]',_0x52d37d[_0xfbd6('0x1f')]),_0x52d37d);queues[_0xfbd6('0x2c')](_0x52d37d);calls[_0xfbd6('0x2c')](_0x52d37d);}catch(_0x3edb2e){utils['error'](util[_0xfbd6('0x18')](_0xfbd6('0x2d'),_0x52d37d[_0xfbd6('0x1f')]),_0x3edb2e);}});ami['on']('newstate',function(_0x15d533){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')](_0xfbd6('0x2e'),_0x15d533[_0xfbd6('0x1f')]),_0x15d533);calls[_0xfbd6('0x2f')](_0x15d533);recordings[_0xfbd6('0x2f')](_0x15d533);}catch(_0x10dbec){utils[_0xfbd6('0x15')](util[_0xfbd6('0x18')](_0xfbd6('0x2e'),_0x15d533[_0xfbd6('0x1f')]),_0x10dbec);}});ami['on']('hangup',function(_0x564a3d){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')](_0xfbd6('0x30'),_0x564a3d[_0xfbd6('0x1f')]),_0x564a3d);calls[_0xfbd6('0x31')](_0x564a3d);recordings[_0xfbd6('0x31')](_0x564a3d);dials[_0xfbd6('0x31')](_0x564a3d);agents[_0xfbd6('0x31')](_0x564a3d);queues[_0xfbd6('0x31')](_0x564a3d);}catch(_0x52618a){utils[_0xfbd6('0x15')](util[_0xfbd6('0x18')]('[%s][index][hangup]',_0x564a3d[_0xfbd6('0x1f')]),_0x52618a);}});ami['on'](_0xfbd6('0x32'),function(_0xb4794f){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')](_0xfbd6('0x33'),_0xb4794f['uniqueid']),_0xb4794f);members[_0xfbd6('0x32')](_0xb4794f);}catch(_0x2ccd9c){utils[_0xfbd6('0x15')](util['format'](_0xfbd6('0x33'),_0xb4794f['uniqueid']),_0x2ccd9c);}});ami['on'](_0xfbd6('0x34'),function(_0x2015fd){try{utils['debug'](util[_0xfbd6('0x18')](_0xfbd6('0x35'),_0x2015fd[_0xfbd6('0x1f')]),_0x2015fd);queues[_0xfbd6('0x34')](_0x2015fd);agents[_0xfbd6('0x34')](_0x2015fd);transfers['blindtransfer'](_0x2015fd);}catch(_0x2fb3bd){utils[_0xfbd6('0x15')](util[_0xfbd6('0x18')](_0xfbd6('0x35'),_0x2015fd['uniqueid']),_0x2fb3bd);}});ami['on'](_0xfbd6('0x36'),function(_0x57aa4a){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')](_0xfbd6('0x37'),_0x57aa4a[_0xfbd6('0x38')]),_0x57aa4a);queues[_0xfbd6('0x36')](_0x57aa4a);transfers[_0xfbd6('0x36')](_0x57aa4a);agents['attendedtransfer'](_0x57aa4a);calls[_0xfbd6('0x36')](_0x57aa4a);}catch(_0x133f2f){utils[_0xfbd6('0x15')](util['format'](_0xfbd6('0x37'),_0x57aa4a[_0xfbd6('0x38')]),_0x133f2f);}});ami['on'](_0xfbd6('0x39'),function(_0x20e684){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')](_0xfbd6('0x3a'),_0x20e684['uniqueid']),_0x20e684);queues[_0xfbd6('0x39')](_0x20e684);recordings[_0xfbd6('0x39')](_0x20e684);calls[_0xfbd6('0x39')](_0x20e684);dials[_0xfbd6('0x39')](_0x20e684);}catch(_0xc2f36){utils['error'](util[_0xfbd6('0x18')](_0xfbd6('0x3a'),_0x20e684['uniqueid']),_0xc2f36);}});ami['on']('newexten',function(_0x2eca60){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')](_0xfbd6('0x3b'),_0x2eca60[_0xfbd6('0x1f')]),_0x2eca60);calls[_0xfbd6('0x3c')](_0x2eca60);recordings[_0xfbd6('0x3c')](_0x2eca60);dials[_0xfbd6('0x3c')](_0x2eca60);}catch(_0x5149ae){utils['error'](util[_0xfbd6('0x18')]('[%s][index][newexten]',_0x2eca60['uniqueid']),_0x5149ae);}});ami['on'](_0xfbd6('0x3d'),function(_0x31fe41){try{utils[_0xfbd6('0x1d')](util[_0xfbd6('0x18')]('[%s][index][newchannel]',_0x31fe41[_0xfbd6('0x1f')]),_0x31fe41);calls[_0xfbd6('0x3d')](_0x31fe41);recordings['newchannel'](_0x31fe41);}catch(_0x5d8c65){utils[_0xfbd6('0x15')](util['format'](_0xfbd6('0x3e'),_0x31fe41['uniqueid']),_0x5d8c65);}});ami['on'](_0xfbd6('0x3f'),function(_0x22f184){try{utils['debug'](util['format'](_0xfbd6('0x40'),_0x22f184[_0xfbd6('0x1f')]),_0x22f184);dials[_0xfbd6('0x3f')](_0x22f184);}catch(_0x40d494){utils[_0xfbd6('0x15')](util[_0xfbd6('0x18')](_0xfbd6('0x41'),_0x22f184['uniqueid']),_0x40d494);}});ami['on'](_0xfbd6('0x42'),function(_0x1c2e95){try{utils[_0xfbd6('0x1d')](util['format'](_0xfbd6('0x43'),_0x1c2e95[_0xfbd6('0x1f')]),_0x1c2e95);dials[_0xfbd6('0x42')](_0x1c2e95);}catch(_0x17b908){utils[_0xfbd6('0x15')](util['format'](_0xfbd6('0x43'),_0x1c2e95[_0xfbd6('0x1f')]),_0x17b908);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index b3e058d..7f49812 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 _0xcb97=['channel','data2','membername','type','getUserByInterface','internal','request','getUserByName','split','then','CreateMemberReport','catch','error','[%s][members][writeDB]','some','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','now','agent','NOT_INUSE','isNil','exitAt','diffTime','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','queue','assign','[%s][members][cdr]','data1','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','lodash','util','./utils','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface'];(function(_0x2b58d8,_0x10a0e7){var _0x4d633c=function(_0x2200ec){while(--_0x2200ec){_0x2b58d8['push'](_0x2b58d8['shift']());}};_0x4d633c(++_0x10a0e7);}(_0xcb97,0x14f));var _0x7cb9=function(_0x54365c,_0x2f52a5){_0x54365c=_0x54365c-0x0;var _0x41160c=_0xcb97[_0x54365c];return _0x41160c;};'use strict';var _=require(_0x7cb9('0x0'));var util=require(_0x7cb9('0x1'));var utils=require(_0x7cb9('0x2'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x4b901a){utils[_0x7cb9('0x3')](util[_0x7cb9('0x4')](_0x7cb9('0x5'),_0x4b901a[_0x7cb9('0x6')],_0x4b901a[_0x7cb9('0x7')],_0x4b901a[_0x7cb9('0x8')],_0x4b901a[_0x7cb9('0x9')],_0x4b901a[_0x7cb9('0xa')],_0x4b901a[_0x7cb9('0xb')]));if(_0x4b901a[_0x7cb9('0x7')]){utils[_0x7cb9('0xc')](_0x4b901a[_0x7cb9('0x7')])['then'](function(_0x8f770f){if(_0x8f770f){_0x4b901a[_0x7cb9('0xa')]=_0x8f770f['name'];_0x4b901a['internal']=_0x8f770f[_0x7cb9('0xd')];utils[_0x7cb9('0xe')]('CreateMemberReport',_0x4b901a);}else{utils[_0x7cb9('0xf')](_0x4b901a[_0x7cb9('0x7')][_0x7cb9('0x10')]('/')[0x1])[_0x7cb9('0x11')](function(_0x3da12b){if(_0x3da12b){_0x4b901a[_0x7cb9('0xa')]=_0x3da12b['name'];_0x4b901a[_0x7cb9('0xd')]=_0x3da12b[_0x7cb9('0xd')];utils[_0x7cb9('0xe')](_0x7cb9('0x12'),_0x4b901a);}});}})[_0x7cb9('0x13')](function(_0x12c135){utils[_0x7cb9('0x14')](util[_0x7cb9('0x4')](_0x7cb9('0x15'),_0x4b901a[_0x7cb9('0x6')]),_0x12c135);});}delete members[_0x4b901a[_0x7cb9('0x7')]];}function startsWith(_0x5bb2cb,_0x515f5d){return _[_0x7cb9('0x16')](_0x5bb2cb,function(_0x203f09){return _['startsWith'](_0x515f5d,_0x203f09);});}exports[_0x7cb9('0x17')]=function(_0x386e4d){try{utils[_0x7cb9('0x18')](util[_0x7cb9('0x4')]('[%s][members][devicestatechange]',members[_0x386e4d['device']]?members[_0x386e4d['device']][_0x7cb9('0x6')]:_0x386e4d[_0x7cb9('0x19')]),_0x386e4d);utils[_0x7cb9('0x3')](util[_0x7cb9('0x4')](_0x7cb9('0x1a'),members[_0x386e4d[_0x7cb9('0x19')]]?members[_0x386e4d['device']][_0x7cb9('0x6')]:_0x386e4d[_0x7cb9('0x19')],_0x386e4d[_0x7cb9('0x1b')],_0x386e4d[_0x7cb9('0x19')]));switch(_0x386e4d['state']){case _0x7cb9('0x1c'):case _0x7cb9('0x1d'):if(!startsWith(exclude,_0x386e4d['device'])){members[_0x386e4d[_0x7cb9('0x19')]]={'channel':_0x7cb9('0x1e'),'interface':_0x386e4d[_0x7cb9('0x19')],'type':'TALKING','enterAt':utils[_0x7cb9('0x1f')](),'role':_0x7cb9('0x20')};}break;case _0x7cb9('0x21'):if(!_[_0x7cb9('0x22')](members[_0x386e4d[_0x7cb9('0x19')]])){members[_0x386e4d[_0x7cb9('0x19')]][_0x7cb9('0x23')]=utils[_0x7cb9('0x1f')]();members[_0x386e4d[_0x7cb9('0x19')]]['duration']=utils[_0x7cb9('0x24')](members[_0x386e4d[_0x7cb9('0x19')]][_0x7cb9('0x23')],members[_0x386e4d[_0x7cb9('0x19')]]['enterAt']);if(members[_0x386e4d[_0x7cb9('0x19')]][_0x7cb9('0x6')]){writeDB(members[_0x386e4d[_0x7cb9('0x19')]]);}}break;default:break;}}catch(_0x4a1bcb){utils[_0x7cb9('0x14')](util['format'](_0x7cb9('0x25'),members[_0x386e4d[_0x7cb9('0x19')]]?members[_0x386e4d['device']][_0x7cb9('0x6')]:_0x386e4d[_0x7cb9('0x19')]),_0x4a1bcb);}};exports[_0x7cb9('0x26')]=function(_0x21d77e){try{if(!_[_0x7cb9('0x22')](members[_0x21d77e['interface']])){utils[_0x7cb9('0x18')](util['format'](_0x7cb9('0x27'),_0x21d77e[_0x7cb9('0x6')]),_0x21d77e);utils[_0x7cb9('0x3')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x21d77e[_0x7cb9('0x6')],_0x21d77e[_0x7cb9('0x7')],_0x21d77e[_0x7cb9('0x28')]));members[_0x21d77e[_0x7cb9('0x7')]]=_[_0x7cb9('0x29')](members[_0x21d77e[_0x7cb9('0x7')]],{'data4':_0x21d77e[_0x7cb9('0x28')],'uniqueid':_0x21d77e[_0x7cb9('0x6')]});}}catch(_0x801c9b){utils['error'](util[_0x7cb9('0x4')](_0x7cb9('0x27'),_0x21d77e['uniqueid']),_0x801c9b);}};exports['cdr']=function(_0x411eed){try{utils[_0x7cb9('0x18')](util[_0x7cb9('0x4')](_0x7cb9('0x2a'),_0x411eed[_0x7cb9('0x6')]),_0x411eed);if(_0x411eed['channel']){var _0x2ef55e=_0x411eed[_0x7cb9('0x8')][_0x7cb9('0x10')]('-')[0x0];if(!_[_0x7cb9('0x22')](members[_0x2ef55e])){members[_0x2ef55e]=_[_0x7cb9('0x29')](members[_0x2ef55e],{'data1':members[_0x2ef55e][_0x7cb9('0x2b')]||_0x411eed[_0x7cb9('0xb')],'data2':members[_0x2ef55e][_0x7cb9('0x9')]||_0x411eed[_0x7cb9('0x2c')],'data3':members[_0x2ef55e][_0x7cb9('0x2d')]||_0x411eed['destination'],'uniqueid':members[_0x2ef55e]['uniqueid']||_0x411eed[_0x7cb9('0x6')]});utils[_0x7cb9('0x3')](util[_0x7cb9('0x4')](_0x7cb9('0x2e'),_0x411eed[_0x7cb9('0x6')],members[_0x2ef55e][_0x7cb9('0x2b')],members[_0x2ef55e]['data2'],members[_0x2ef55e][_0x7cb9('0x2d')]));if(members[_0x2ef55e][_0x7cb9('0x23')]){writeDB(members[_0x2ef55e]);}}}if(_0x411eed[_0x7cb9('0x2f')]){var _0x12f8ef=_0x411eed[_0x7cb9('0x2f')][_0x7cb9('0x10')]('-')[0x0];if(!_[_0x7cb9('0x22')](members[_0x12f8ef])){members[_0x12f8ef]=_[_0x7cb9('0x29')](members[_0x12f8ef],{'data1':members[_0x12f8ef][_0x7cb9('0x2b')]||_0x411eed['type'],'data2':members[_0x12f8ef][_0x7cb9('0x9')]||_0x411eed[_0x7cb9('0x2c')],'data3':members[_0x12f8ef][_0x7cb9('0x2d')]||_0x411eed[_0x7cb9('0x30')],'uniqueid':members[_0x12f8ef][_0x7cb9('0x6')]||_0x411eed['uniqueid']});utils[_0x7cb9('0x3')](util[_0x7cb9('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x411eed[_0x7cb9('0x6')],members[_0x12f8ef][_0x7cb9('0x2b')],members[_0x12f8ef]['data2'],members[_0x12f8ef][_0x7cb9('0x2d')]));if(members[_0x12f8ef][_0x7cb9('0x23')]){writeDB(members[_0x12f8ef]);}}}}catch(_0x5d43d9){utils[_0x7cb9('0x14')](util[_0x7cb9('0x4')](_0x7cb9('0x2a'),_0x411eed['uniqueid']),_0x5d43d9);}}; \ No newline at end of file +var _0x757f=['getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','error','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','enterAt','agentcomplete','queue','[%s][members][agentcomplete]','[%s][members][cdr]','channel','assign','data1','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x757f,0xee));var _0xf757=function(_0x412b2a,_0x11fb8a){_0x412b2a=_0x412b2a-0x0;var _0x5872e3=_0x757f[_0x412b2a];return _0x5872e3;};'use strict';var _=require(_0xf757('0x0'));var util=require('util');var utils=require(_0xf757('0x1'));var members={};var exclude=[_0xf757('0x2'),_0xf757('0x3')];function writeDB(_0x135d5e){utils[_0xf757('0x4')](util[_0xf757('0x5')](_0xf757('0x6'),_0x135d5e[_0xf757('0x7')],_0x135d5e[_0xf757('0x8')],_0x135d5e['channel'],_0x135d5e[_0xf757('0x9')],_0x135d5e[_0xf757('0xa')],_0x135d5e[_0xf757('0xb')]));if(_0x135d5e[_0xf757('0x8')]){utils[_0xf757('0xc')](_0x135d5e['interface'])['then'](function(_0x29f48c){if(_0x29f48c){_0x135d5e[_0xf757('0xa')]=_0x29f48c[_0xf757('0xd')];_0x135d5e[_0xf757('0xe')]=_0x29f48c['internal'];utils[_0xf757('0xf')](_0xf757('0x10'),_0x135d5e);}else{utils[_0xf757('0x11')](_0x135d5e[_0xf757('0x8')][_0xf757('0x12')]('/')[0x1])[_0xf757('0x13')](function(_0xbc9719){if(_0xbc9719){_0x135d5e[_0xf757('0xa')]=_0xbc9719[_0xf757('0xd')];_0x135d5e[_0xf757('0xe')]=_0xbc9719[_0xf757('0xe')];utils[_0xf757('0xf')](_0xf757('0x10'),_0x135d5e);}});}})[_0xf757('0x14')](function(_0x3dcfaa){utils[_0xf757('0x15')](util[_0xf757('0x5')](_0xf757('0x16'),_0x135d5e['uniqueid']),_0x3dcfaa);});}delete members[_0x135d5e[_0xf757('0x8')]];}function startsWith(_0x12fb35,_0x5c297e){return _[_0xf757('0x17')](_0x12fb35,function(_0x2b3540){return _[_0xf757('0x18')](_0x5c297e,_0x2b3540);});}exports['devicestatechange']=function(_0x1c5934){try{utils[_0xf757('0x19')](util[_0xf757('0x5')](_0xf757('0x1a'),members[_0x1c5934['device']]?members[_0x1c5934[_0xf757('0x1b')]][_0xf757('0x7')]:_0x1c5934[_0xf757('0x1b')]),_0x1c5934);utils[_0xf757('0x4')](util[_0xf757('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x1c5934['device']]?members[_0x1c5934[_0xf757('0x1b')]]['uniqueid']:_0x1c5934['device'],_0x1c5934[_0xf757('0x1c')],_0x1c5934[_0xf757('0x1b')]));switch(_0x1c5934['state']){case _0xf757('0x1d'):case _0xf757('0x1e'):if(!startsWith(exclude,_0x1c5934[_0xf757('0x1b')])){members[_0x1c5934[_0xf757('0x1b')]]={'channel':'voice','interface':_0x1c5934['device'],'type':_0xf757('0x1f'),'enterAt':utils[_0xf757('0x20')](),'role':_0xf757('0x21')};}break;case _0xf757('0x22'):if(!_[_0xf757('0x23')](members[_0x1c5934[_0xf757('0x1b')]])){members[_0x1c5934[_0xf757('0x1b')]][_0xf757('0x24')]=utils[_0xf757('0x20')]();members[_0x1c5934[_0xf757('0x1b')]]['duration']=utils['diffTime'](members[_0x1c5934[_0xf757('0x1b')]][_0xf757('0x24')],members[_0x1c5934[_0xf757('0x1b')]][_0xf757('0x25')]);if(members[_0x1c5934[_0xf757('0x1b')]][_0xf757('0x7')]){writeDB(members[_0x1c5934[_0xf757('0x1b')]]);}}break;default:break;}}catch(_0x180882){utils['error'](util['format'](_0xf757('0x1a'),members[_0x1c5934['device']]?members[_0x1c5934[_0xf757('0x1b')]]['uniqueid']:_0x1c5934[_0xf757('0x1b')]),_0x180882);}};exports[_0xf757('0x26')]=function(_0x52fea2){try{if(!_[_0xf757('0x23')](members[_0x52fea2[_0xf757('0x8')]])){utils[_0xf757('0x19')](util[_0xf757('0x5')]('[%s][members][agentcomplete]',_0x52fea2[_0xf757('0x7')]),_0x52fea2);utils['info'](util[_0xf757('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x52fea2[_0xf757('0x7')],_0x52fea2['interface'],_0x52fea2[_0xf757('0x27')]));members[_0x52fea2[_0xf757('0x8')]]=_['assign'](members[_0x52fea2[_0xf757('0x8')]],{'data4':_0x52fea2['queue'],'uniqueid':_0x52fea2[_0xf757('0x7')]});}}catch(_0x4a5e32){utils[_0xf757('0x15')](util[_0xf757('0x5')](_0xf757('0x28'),_0x52fea2[_0xf757('0x7')]),_0x4a5e32);}};exports['cdr']=function(_0x3fb69c){try{utils[_0xf757('0x19')](util[_0xf757('0x5')](_0xf757('0x29'),_0x3fb69c[_0xf757('0x7')]),_0x3fb69c);if(_0x3fb69c[_0xf757('0x2a')]){var _0xbb7cfd=_0x3fb69c[_0xf757('0x2a')][_0xf757('0x12')]('-')[0x0];if(!_['isNil'](members[_0xbb7cfd])){members[_0xbb7cfd]=_[_0xf757('0x2b')](members[_0xbb7cfd],{'data1':members[_0xbb7cfd][_0xf757('0x2c')]||_0x3fb69c[_0xf757('0xb')],'data2':members[_0xbb7cfd][_0xf757('0x9')]||_0x3fb69c[_0xf757('0x2d')],'data3':members[_0xbb7cfd][_0xf757('0x2e')]||_0x3fb69c[_0xf757('0x2f')],'uniqueid':members[_0xbb7cfd][_0xf757('0x7')]||_0x3fb69c[_0xf757('0x7')]});utils[_0xf757('0x4')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3fb69c['uniqueid'],members[_0xbb7cfd]['data1'],members[_0xbb7cfd][_0xf757('0x9')],members[_0xbb7cfd][_0xf757('0x2e')]));if(members[_0xbb7cfd][_0xf757('0x24')]){writeDB(members[_0xbb7cfd]);}}}if(_0x3fb69c[_0xf757('0x30')]){var _0x3d06c3=_0x3fb69c['destinationchannel']['split']('-')[0x0];if(!_[_0xf757('0x23')](members[_0x3d06c3])){members[_0x3d06c3]=_[_0xf757('0x2b')](members[_0x3d06c3],{'data1':members[_0x3d06c3]['data1']||_0x3fb69c[_0xf757('0xb')],'data2':members[_0x3d06c3][_0xf757('0x9')]||_0x3fb69c['source'],'data3':members[_0x3d06c3][_0xf757('0x2e')]||_0x3fb69c[_0xf757('0x2f')],'uniqueid':members[_0x3d06c3][_0xf757('0x7')]||_0x3fb69c[_0xf757('0x7')]});utils['info'](util[_0xf757('0x5')](_0xf757('0x31'),_0x3fb69c[_0xf757('0x7')],members[_0x3d06c3][_0xf757('0x2c')],members[_0x3d06c3][_0xf757('0x9')],members[_0x3d06c3]['data3']));if(members[_0x3d06c3]['exitAt']){writeDB(members[_0x3d06c3]);}}}}catch(_0x3bcd45){utils[_0xf757('0x15')](util[_0xf757('0x5')](_0xf757('0x29'),_0x3fb69c[_0xf757('0x7')]),_0x3bcd45);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 4196cee..a98908b 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 _0x8a0d=['calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','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][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue'];(function(_0x34c98e,_0x2cb42a){var _0x37f23c=function(_0x7887ef){while(--_0x7887ef){_0x34c98e['push'](_0x34c98e['shift']());}};_0x37f23c(++_0x2cb42a);}(_0x8a0d,0xd1));var _0xd8a0=function(_0x40c3c6,_0x169282){_0x40c3c6=_0x40c3c6-0x0;var _0x214c4b=_0x8a0d[_0x40c3c6];return _0x214c4b;};'use strict';var _=require(_0xd8a0('0x0'));var util=require('util');var utils=require(_0xd8a0('0x1'));var queues={};function writeDB(_0x1f4976){utils[_0xd8a0('0x2')](util['format'](_0xd8a0('0x3'),_0x1f4976[_0xd8a0('0x4')],_0x1f4976[_0xd8a0('0x5')],_0x1f4976[_0xd8a0('0x6')],_0x1f4976['lastAssignedTo'],_0x1f4976[_0xd8a0('0x7')],_0x1f4976[_0xd8a0('0x8')],_0x1f4976[_0xd8a0('0x9')]));if(_0x1f4976[_0xd8a0('0x6')]){utils[_0xd8a0('0xa')](_0x1f4976[_0xd8a0('0x6')])[_0xd8a0('0xb')](function(_0x240fa3){if(_0x240fa3){_0x1f4976[_0xd8a0('0xc')]=_0x240fa3['type'];}utils[_0xd8a0('0xd')](_0xd8a0('0xe'),_0x1f4976);});}else{utils[_0xd8a0('0xd')]('CreateVoiceQueueReport',_0x1f4976);}if(_0x1f4976[_0xd8a0('0xf')]){delete queues[_0x1f4976[_0xd8a0('0xf')]];}else{delete queues[_0x1f4976[_0xd8a0('0x4')]];}}exports[_0xd8a0('0x10')]=function(_0x426b4d){try{utils[_0xd8a0('0x11')](util[_0xd8a0('0x12')](_0xd8a0('0x13'),_0x426b4d[_0xd8a0('0x4')]),_0x426b4d);utils['info'](util[_0xd8a0('0x12')](_0xd8a0('0x14'),_0x426b4d[_0xd8a0('0x4')],_0x426b4d[_0xd8a0('0x6')],_0x426b4d[_0xd8a0('0x15')]));queues[_0x426b4d[_0xd8a0('0x4')]]=_[_0xd8a0('0x16')](_0x426b4d,{'originalposition':_0x426b4d[_0xd8a0('0x15')],'queuecallerjoinAt':utils[_0xd8a0('0x17')](),'mohtime':0x0});}catch(_0x1a9e0e){utils[_0xd8a0('0x18')](util[_0xd8a0('0x12')](_0xd8a0('0x13'),_0x426b4d['uniqueid']),_0x1a9e0e);}};exports['hangup']=function(_0x459fd8){try{if(!_[_0xd8a0('0x19')](queues[_0x459fd8[_0xd8a0('0x4')]])){utils['debug'](util[_0xd8a0('0x12')](_0xd8a0('0x1a'),_0x459fd8[_0xd8a0('0x4')]),_0x459fd8);if(queues[_0x459fd8['uniqueid']][_0xd8a0('0x1b')]){if(!queues[_0x459fd8[_0xd8a0('0x4')]][_0xd8a0('0x1c')]&&!queues[_0x459fd8[_0xd8a0('0x4')]][_0xd8a0('0x1d')]){queues[_0x459fd8[_0xd8a0('0x4')]][_0xd8a0('0x1e')]=!![];queues[_0x459fd8['uniqueid']][_0xd8a0('0x1f')]=utils['now']();queues[_0x459fd8[_0xd8a0('0x4')]][_0xd8a0('0x9')]=_0xd8a0('0x20');}utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x21'),_0x459fd8[_0xd8a0('0x4')],queues[_0x459fd8['uniqueid']][_0xd8a0('0x22')],queues[_0x459fd8[_0xd8a0('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x459fd8[_0xd8a0('0x4')]]);}else if(queues[_0x459fd8[_0xd8a0('0x4')]][_0xd8a0('0xf')]){utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x23'),_0x459fd8[_0xd8a0('0x4')],queues[_0x459fd8[_0xd8a0('0x4')]][_0xd8a0('0x22')],queues[_0x459fd8[_0xd8a0('0x4')]][_0xd8a0('0xf')]));queues[queues[_0x459fd8[_0xd8a0('0x4')]][_0xd8a0('0xf')]]=queues[_0x459fd8[_0xd8a0('0x4')]];queues[queues[_0x459fd8[_0xd8a0('0x4')]][_0xd8a0('0xf')]][_0xd8a0('0x24')]=0x2;delete queues[_0x459fd8[_0xd8a0('0x4')]];}}}catch(_0xd52de7){utils[_0xd8a0('0x18')](util['format'](_0xd8a0('0x1a'),_0x459fd8['uniqueid']),_0xd52de7);}};exports[_0xd8a0('0x25')]=function(_0x49df85){try{utils[_0xd8a0('0x11')](util['format'](_0xd8a0('0x26'),_0x49df85[_0xd8a0('0x4')]),_0x49df85);if(!_[_0xd8a0('0x19')](_0x49df85[_0xd8a0('0x27')]['queuestatus'])&&_0x49df85[_0xd8a0('0x28')][_0xd8a0('0x29')]()!==_0xd8a0('0x2a')){if(!_[_0xd8a0('0x19')](queues[_0x49df85[_0xd8a0('0x4')]])){queues[_0x49df85[_0xd8a0('0x4')]]['queuecallerabandon']=![];queues[_0x49df85[_0xd8a0('0x4')]][_0xd8a0('0x2b')]=null;queues[_0x49df85[_0xd8a0('0x4')]][_0xd8a0('0x1d')]=!![];queues[_0x49df85['uniqueid']][_0xd8a0('0x2c')]=utils[_0xd8a0('0x17')]();queues[_0x49df85[_0xd8a0('0x4')]][_0xd8a0('0x9')]=_0x49df85[_0xd8a0('0x28')][_0xd8a0('0x29')]();utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x2d'),_0x49df85[_0xd8a0('0x4')],queues[_0x49df85['uniqueid']][_0xd8a0('0x22')],_0x49df85[_0xd8a0('0x28')],queues[_0x49df85[_0xd8a0('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x49df85['uniqueid']]);}}else if(!_[_0xd8a0('0x19')](_0x49df85['variable'][_0xd8a0('0x2e')])){if(!_[_0xd8a0('0x19')](queues[_0x49df85[_0xd8a0('0x4')]])&&!queues[_0x49df85[_0xd8a0('0x4')]]['queuecallerabandon']){queues[_0x49df85[_0xd8a0('0x4')]]['queuecallerabandon']=![];queues[_0x49df85[_0xd8a0('0x4')]][_0xd8a0('0x2b')]=null;queues[_0x49df85[_0xd8a0('0x4')]][_0xd8a0('0x1d')]=!![];queues[_0x49df85[_0xd8a0('0x4')]]['queuecallerexitAt']=utils[_0xd8a0('0x17')]();queues[_0x49df85[_0xd8a0('0x4')]][_0xd8a0('0x9')]=_0xd8a0('0x2f');utils['info'](util[_0xd8a0('0x12')](_0xd8a0('0x30'),_0x49df85[_0xd8a0('0x4')],queues[_0x49df85['uniqueid']][_0xd8a0('0x22')],_0x49df85[_0xd8a0('0x28')],queues[_0x49df85[_0xd8a0('0x4')]][_0xd8a0('0x9')]));}}}catch(_0x4d3192){utils[_0xd8a0('0x18')](util[_0xd8a0('0x12')](_0xd8a0('0x26'),_0x49df85[_0xd8a0('0x4')]),_0x4d3192);}};exports[_0xd8a0('0x1c')]=function(_0x1feffa){try{if(!_[_0xd8a0('0x19')](queues[_0x1feffa[_0xd8a0('0x4')]])){utils[_0xd8a0('0x11')](util[_0xd8a0('0x12')](_0xd8a0('0x31'),_0x1feffa[_0xd8a0('0x4')]),_0x1feffa);queues[_0x1feffa[_0xd8a0('0x4')]][_0xd8a0('0x1d')]=![];queues[_0x1feffa[_0xd8a0('0x4')]][_0xd8a0('0x2c')]=null;queues[_0x1feffa[_0xd8a0('0x4')]][_0xd8a0('0x1c')]=!![];queues[_0x1feffa[_0xd8a0('0x4')]][_0xd8a0('0x2b')]=utils[_0xd8a0('0x17')]();queues[_0x1feffa[_0xd8a0('0x4')]][_0xd8a0('0x9')]=_0xd8a0('0x32');utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x33'),_0x1feffa[_0xd8a0('0x4')],queues[_0x1feffa[_0xd8a0('0x4')]][_0xd8a0('0x22')],queues[_0x1feffa['uniqueid']][_0xd8a0('0x9')]));}}catch(_0x292bbe){utils['error'](util[_0xd8a0('0x12')](_0xd8a0('0x31'),_0x1feffa['uniqueid']),_0x292bbe);}};exports[_0xd8a0('0x34')]=function(_0x35d224){try{if(!_[_0xd8a0('0x19')](queues[_0x35d224['uniqueid']])){utils[_0xd8a0('0x11')](util[_0xd8a0('0x12')]('[%s][queues][queuecallerleave]',_0x35d224[_0xd8a0('0x4')]),_0x35d224);utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x35'),_0x35d224['uniqueid'],queues[_0x35d224['uniqueid']][_0xd8a0('0x22')],_0x35d224[_0xd8a0('0x36')],_0x35d224['connectedlinename']));queues[_0x35d224['uniqueid']]['queuecallerleave']=!![];queues[_0x35d224[_0xd8a0('0x4')]][_0xd8a0('0x1b')]=utils['now']();queues[_0x35d224[_0xd8a0('0x4')]]['holdtime']=utils[_0xd8a0('0x37')](queues[_0x35d224['uniqueid']][_0xd8a0('0x1b')],queues[_0x35d224[_0xd8a0('0x4')]][_0xd8a0('0x38')]);queues[_0x35d224[_0xd8a0('0x4')]][_0xd8a0('0x15')]=_0x35d224[_0xd8a0('0x15')];queues[_0x35d224['uniqueid']][_0xd8a0('0x39')]=_0x35d224[_0xd8a0('0x39')];queues[_0x35d224['uniqueid']]['connectedlinenum']=_0x35d224[_0xd8a0('0x36')];queues[_0x35d224[_0xd8a0('0x4')]]['connectedlinename']=_0x35d224['connectedlinename'];}}catch(_0x16ed21){utils[_0xd8a0('0x18')](util[_0xd8a0('0x12')](_0xd8a0('0x3a'),_0x35d224[_0xd8a0('0x4')]),_0x16ed21);}};exports[_0xd8a0('0x3b')]=function(_0x345f58){try{if(!_[_0xd8a0('0x19')](queues[_0x345f58[_0xd8a0('0x4')]])){utils[_0xd8a0('0x11')](util[_0xd8a0('0x12')](_0xd8a0('0x3c'),_0x345f58[_0xd8a0('0x4')]),_0x345f58);utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x3d'),_0x345f58[_0xd8a0('0x4')],queues[_0x345f58['uniqueid']]['name'],_0x345f58[_0xd8a0('0x3e')],_0x345f58[_0xd8a0('0x3f')]));queues[_0x345f58[_0xd8a0('0x4')]][_0xd8a0('0x1c')]=![];queues[_0x345f58['uniqueid']][_0xd8a0('0x1c')]=![];queues[_0x345f58[_0xd8a0('0x4')]][_0xd8a0('0x2b')]=null;queues[_0x345f58[_0xd8a0('0x4')]][_0xd8a0('0x1d')]=![];queues[_0x345f58[_0xd8a0('0x4')]][_0xd8a0('0x9')]=null;queues[_0x345f58[_0xd8a0('0x4')]][_0xd8a0('0x2c')]=null;queues[_0x345f58[_0xd8a0('0x4')]][_0xd8a0('0x40')]=!![];queues[_0x345f58[_0xd8a0('0x4')]]['accountcode']=_0x345f58[_0xd8a0('0x3f')];queues[_0x345f58[_0xd8a0('0x4')]][_0xd8a0('0x41')]=_0x345f58[_0xd8a0('0x3e')];}}catch(_0x24f635){utils[_0xd8a0('0x18')](util['format']('[%s][queues][agentconnect]',_0x345f58['uniqueid']),_0x24f635);}};exports[_0xd8a0('0x42')]=function(_0x3c2504){try{if(!_[_0xd8a0('0x19')](queues[_0x3c2504[_0xd8a0('0x4')]])){if(queues[_0x3c2504[_0xd8a0('0x4')]][_0xd8a0('0x1b')]){utils['debug'](util['format'](_0xd8a0('0x43'),_0x3c2504['uniqueid']),_0x3c2504);queues[_0x3c2504[_0xd8a0('0x4')]][_0xd8a0('0x1c')]=![];queues[_0x3c2504[_0xd8a0('0x4')]][_0xd8a0('0x1c')]=![];queues[_0x3c2504['uniqueid']][_0xd8a0('0x2b')]=null;queues[_0x3c2504[_0xd8a0('0x4')]][_0xd8a0('0x1d')]=![];queues[_0x3c2504[_0xd8a0('0x4')]]['queuecallerexitAt']=null;queues[_0x3c2504[_0xd8a0('0x4')]][_0xd8a0('0x40')]=!![];queues[_0x3c2504[_0xd8a0('0x4')]][_0xd8a0('0x41')]=_0x3c2504[_0xd8a0('0x3e')];queues[_0x3c2504[_0xd8a0('0x4')]]['queuecallercomplete']=!![];queues[_0x3c2504[_0xd8a0('0x4')]]['queuecallercompleteAt']=utils['now']();if(_0x3c2504[_0xd8a0('0x44')]==_0xd8a0('0x45')){if(!queues[_0x3c2504[_0xd8a0('0x4')]][_0xd8a0('0x45')]){queues[_0x3c2504[_0xd8a0('0x4')]]['queuecallerexitreason']=_0xd8a0('0x46');}}else{queues[_0x3c2504['uniqueid']][_0xd8a0('0x9')]=_0xd8a0('0x47')+_0x3c2504[_0xd8a0('0x44')]['toUpperCase']();}utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x48'),_0x3c2504[_0xd8a0('0x4')],queues[_0x3c2504[_0xd8a0('0x4')]][_0xd8a0('0x22')],_0x3c2504[_0xd8a0('0x3e')],queues[_0x3c2504[_0xd8a0('0x4')]][_0xd8a0('0x9')]));writeDB(queues[_0x3c2504[_0xd8a0('0x4')]]);}}}catch(_0x3af7bc){utils[_0xd8a0('0x18')](util[_0xd8a0('0x12')]('[%s][queues][agentcomplete]',_0x3c2504[_0xd8a0('0x4')]),_0x3af7bc);}};exports['blindtransfer']=function(_0x3092d0){try{if(!_[_0xd8a0('0x19')](queues[_0x3092d0[_0xd8a0('0x49')]])){utils[_0xd8a0('0x11')](util[_0xd8a0('0x12')](_0xd8a0('0x4a'),_0x3092d0['uniqueid']),_0x3092d0);queues[_0x3092d0['transfereeuniqueid']][_0xd8a0('0x45')]=!![];queues[_0x3092d0[_0xd8a0('0x49')]][_0xd8a0('0x4b')]=_0xd8a0('0x4c');queues[_0x3092d0[_0xd8a0('0x49')]][_0xd8a0('0x4d')]=_0x3092d0[_0xd8a0('0x4e')];queues[_0x3092d0['transfereeuniqueid']]['transferuniqueid']=_0x3092d0[_0xd8a0('0x49')];queues[_0x3092d0[_0xd8a0('0x49')]]['queuecallerexitreason']=_0xd8a0('0x4f');utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x50'),_0x3092d0['uniqueid'],queues[_0x3092d0[_0xd8a0('0x49')]][_0xd8a0('0x22')],_0x3092d0[_0xd8a0('0x49')],_0x3092d0[_0xd8a0('0x4e')]));}}catch(_0x5dad86){utils[_0xd8a0('0x18')](util[_0xd8a0('0x12')](_0xd8a0('0x4a'),_0x3092d0[_0xd8a0('0x4')]),_0x5dad86);}};exports['attendedtransfer']=function(_0x1812ad){try{utils[_0xd8a0('0x11')](util[_0xd8a0('0x12')](_0xd8a0('0x51'),_0x1812ad[_0xd8a0('0x52')]),_0x1812ad);if(_0x1812ad['origtransfereruniqueid']==_0x1812ad[_0xd8a0('0x53')]){if(!_[_0xd8a0('0x19')](queues[_0x1812ad['secondtransfererlinkedid']])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1812ad['origtransfereruniqueid'],queues[_0x1812ad[_0xd8a0('0x54')]][_0xd8a0('0x22')],_0x1812ad[_0xd8a0('0x55')]));queues[_0x1812ad[_0xd8a0('0x54')]]['transfer']=!![];queues[_0x1812ad[_0xd8a0('0x54')]][_0xd8a0('0x4b')]=_0xd8a0('0x56');queues[_0x1812ad[_0xd8a0('0x54')]]['transferexten']=_0x1812ad[_0xd8a0('0x55')];queues[_0x1812ad['secondtransfererlinkedid']][_0xd8a0('0x57')]=_0x1812ad['origtransfereruniqueid'];queues[_0x1812ad[_0xd8a0('0x54')]][_0xd8a0('0x9')]=_0xd8a0('0x58');}if(!_[_0xd8a0('0x19')](queues[_0x1812ad[_0xd8a0('0x53')]])){if(_0x1812ad[_0xd8a0('0x59')]&&queues[_0x1812ad[_0xd8a0('0x59')]]){queues[_0x1812ad[_0xd8a0('0x59')]][_0xd8a0('0x24')]=0x1;queues[_0x1812ad['transfereeuniqueid']]=_[_0xd8a0('0x5a')](queues[_0x1812ad[_0xd8a0('0x59')]]);queues[_0x1812ad[_0xd8a0('0x49')]][_0xd8a0('0xf')]=_0x1812ad[_0xd8a0('0x5b')];queues[_0x1812ad[_0xd8a0('0x49')]]['queuecallerenterreason']=0x2;queues[_0x1812ad[_0xd8a0('0x49')]][_0xd8a0('0x7')]=queues[_0x1812ad[_0xd8a0('0x54')]][_0xd8a0('0x7')];queues[_0x1812ad[_0xd8a0('0x49')]][_0xd8a0('0x5c')]=queues[_0x1812ad[_0xd8a0('0x54')]][_0xd8a0('0x5c')];queues[_0x1812ad[_0xd8a0('0x49')]][_0xd8a0('0x38')]=utils[_0xd8a0('0x17')]();queues[_0x1812ad[_0xd8a0('0x49')]][_0xd8a0('0x1b')]=utils[_0xd8a0('0x17')]();queues[_0x1812ad[_0xd8a0('0x49')]][_0xd8a0('0x5d')]=0x0;queues[_0x1812ad['transfereeuniqueid']][_0xd8a0('0x5e')]=0x0;utils['info'](util[_0xd8a0('0x12')](_0xd8a0('0x5f'),_0x1812ad[_0xd8a0('0x52')],queues[_0x1812ad['transfereeuniqueid']][_0xd8a0('0x22')],queues[_0x1812ad[_0xd8a0('0x49')]][_0xd8a0('0x7')],queues[_0x1812ad['transfereeuniqueid']][_0xd8a0('0x5c')]));}else{utils[_0xd8a0('0x2')](util['format'](_0xd8a0('0x60'),_0x1812ad[_0xd8a0('0x52')],queues[_0x1812ad[_0xd8a0('0x53')]]['name'],_0x1812ad[_0xd8a0('0x54')]));queues[_0x1812ad[_0xd8a0('0x53')]][_0xd8a0('0xf')]=_0x1812ad[_0xd8a0('0x54')];}}}else if(_0x1812ad[_0xd8a0('0x61')]==_0x1812ad[_0xd8a0('0x54')]){if(!_[_0xd8a0('0x19')](queues[_0x1812ad[_0xd8a0('0x53')]])){utils['info'](util[_0xd8a0('0x12')](_0xd8a0('0x62'),_0x1812ad[_0xd8a0('0x52')],queues[_0x1812ad[_0xd8a0('0x53')]][_0xd8a0('0x22')],_0x1812ad[_0xd8a0('0x61')],_0x1812ad[_0xd8a0('0x63')]));queues[_0x1812ad[_0xd8a0('0x53')]][_0xd8a0('0x45')]=!![];queues[_0x1812ad[_0xd8a0('0x53')]][_0xd8a0('0x4b')]=_0xd8a0('0x56');queues[_0x1812ad[_0xd8a0('0x53')]]['transferexten']=_0x1812ad[_0xd8a0('0x63')];queues[_0x1812ad[_0xd8a0('0x53')]][_0xd8a0('0x57')]=_0x1812ad['secondtransfereruniqueid'];queues[_0x1812ad[_0xd8a0('0x53')]][_0xd8a0('0x9')]=_0xd8a0('0x58');}if(!_[_0xd8a0('0x19')](queues[_0x1812ad['secondtransfererlinkedid']])){if(_0x1812ad['transfertargetlinkedid']&&queues[_0x1812ad[_0xd8a0('0x64')]]){queues[_0x1812ad[_0xd8a0('0x64')]][_0xd8a0('0x24')]=0x1;queues[_0x1812ad[_0xd8a0('0x5b')]]=_['clone'](queues[_0x1812ad[_0xd8a0('0x64')]]);queues[_0x1812ad['transfertargetuniqueid']]['transfereduniqueid']=_0x1812ad[_0xd8a0('0x5b')];queues[_0x1812ad[_0xd8a0('0x5b')]][_0xd8a0('0x24')]=0x2;queues[_0x1812ad[_0xd8a0('0x5b')]][_0xd8a0('0x7')]=queues[_0x1812ad[_0xd8a0('0x53')]]['calleridnum'];queues[_0x1812ad[_0xd8a0('0x5b')]]['calleridname']=queues[_0x1812ad[_0xd8a0('0x53')]]['calleridname'];queues[_0x1812ad[_0xd8a0('0x5b')]][_0xd8a0('0x38')]=utils['now']();queues[_0x1812ad[_0xd8a0('0x5b')]][_0xd8a0('0x1b')]=utils[_0xd8a0('0x17')]();queues[_0x1812ad[_0xd8a0('0x5b')]][_0xd8a0('0x5d')]=0x0;queues[_0x1812ad['transfertargetuniqueid']][_0xd8a0('0x5e')]=0x0;utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x65'),_0x1812ad[_0xd8a0('0x52')],queues[_0x1812ad['transfertargetuniqueid']]['name'],queues[_0x1812ad[_0xd8a0('0x5b')]][_0xd8a0('0xf')],queues[_0x1812ad[_0xd8a0('0x5b')]][_0xd8a0('0x7')],queues[_0x1812ad['transfertargetuniqueid']]['calleridname']));}else{utils['info'](util[_0xd8a0('0x12')](_0xd8a0('0x60'),_0x1812ad['origtransfereruniqueid'],queues[_0x1812ad[_0xd8a0('0x54')]]['name'],_0x1812ad[_0xd8a0('0x53')]));queues[_0x1812ad[_0xd8a0('0x54')]][_0xd8a0('0xf')]=_0x1812ad[_0xd8a0('0x53')];}}}}catch(_0x1e580e){utils[_0xd8a0('0x18')](util[_0xd8a0('0x12')](_0xd8a0('0x51'),_0x1812ad[_0xd8a0('0x52')]),_0x1e580e);}};exports['musiconholdstart']=function(_0x5a37af){try{if(!_[_0xd8a0('0x19')](queues[_0x5a37af[_0xd8a0('0x4')]])){utils[_0xd8a0('0x11')](util[_0xd8a0('0x12')](_0xd8a0('0x66'),_0x5a37af[_0xd8a0('0x4')]),_0x5a37af);queues[_0x5a37af[_0xd8a0('0x4')]][_0xd8a0('0x67')]=utils[_0xd8a0('0x17')]();utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x68'),_0x5a37af[_0xd8a0('0x4')],queues[_0x5a37af[_0xd8a0('0x4')]][_0xd8a0('0x22')],queues[_0x5a37af['uniqueid']][_0xd8a0('0x67')]));}}catch(_0x16c78e){utils[_0xd8a0('0x18')](util[_0xd8a0('0x12')](_0xd8a0('0x66'),_0x5a37af[_0xd8a0('0x4')]),_0x16c78e);}};exports[_0xd8a0('0x69')]=function(_0x433c0a){try{if(!_[_0xd8a0('0x19')](queues[_0x433c0a['uniqueid']])){if(!_[_0xd8a0('0x19')](queues[_0x433c0a[_0xd8a0('0x4')]]['musiconholdstartAt'])){utils[_0xd8a0('0x11')](util['format'](_0xd8a0('0x6a'),_0x433c0a['uniqueid']),_0x433c0a);queues[_0x433c0a[_0xd8a0('0x4')]][_0xd8a0('0x5e')]+=utils['diffTime'](utils['now'](),queues[_0x433c0a[_0xd8a0('0x4')]][_0xd8a0('0x67')]);utils[_0xd8a0('0x2')](util[_0xd8a0('0x12')](_0xd8a0('0x6b'),_0x433c0a[_0xd8a0('0x4')],queues[_0x433c0a['uniqueid']][_0xd8a0('0x22')],queues[_0x433c0a[_0xd8a0('0x4')]][_0xd8a0('0x5e')]));delete queues[_0x433c0a[_0xd8a0('0x4')]]['musiconholdstartAt'];}}}catch(_0x6bbfdd){utils[_0xd8a0('0x18')](util[_0xd8a0('0x12')](_0xd8a0('0x6a'),_0x433c0a[_0xd8a0('0x4')]),_0x6bbfdd);}}; \ No newline at end of file +var _0x0f63=['accountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','error','[%s][queues][hangup]','[%s][queues][varset]','variable','value','toUpperCase','queuecallerexitAt','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerabandonAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','queuecallerleave','holdtime','diffTime','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode'];(function(_0x513d09,_0x5cd567){var _0x1b6eb9=function(_0x5d7baf){while(--_0x5d7baf){_0x513d09['push'](_0x513d09['shift']());}};_0x1b6eb9(++_0x5cd567);}(_0x0f63,0x94));var _0x30f6=function(_0x29a33d,_0x513e84){_0x29a33d=_0x29a33d-0x0;var _0x5479c3=_0x0f63[_0x29a33d];return _0x5479c3;};'use strict';var _=require(_0x30f6('0x0'));var util=require(_0x30f6('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1d232a){utils[_0x30f6('0x2')](util[_0x30f6('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x1d232a[_0x30f6('0x4')],_0x1d232a[_0x30f6('0x5')],_0x1d232a[_0x30f6('0x6')],_0x1d232a[_0x30f6('0x7')],_0x1d232a[_0x30f6('0x8')],_0x1d232a['accountcode'],_0x1d232a[_0x30f6('0x9')]));if(_0x1d232a[_0x30f6('0x6')]){utils[_0x30f6('0xa')](_0x1d232a[_0x30f6('0x6')])[_0x30f6('0xb')](function(_0x2ba617){if(_0x2ba617){_0x1d232a[_0x30f6('0xc')]=_0x2ba617[_0x30f6('0xc')];}utils[_0x30f6('0xd')]('CreateVoiceQueueReport',_0x1d232a);});}else{utils['request'](_0x30f6('0xe'),_0x1d232a);}if(_0x1d232a[_0x30f6('0xf')]){delete queues[_0x1d232a[_0x30f6('0xf')]];}else{delete queues[_0x1d232a[_0x30f6('0x4')]];}}exports[_0x30f6('0x10')]=function(_0x42f6bd){try{utils[_0x30f6('0x11')](util['format']('[%s][queues][queuecallerjoin]',_0x42f6bd[_0x30f6('0x4')]),_0x42f6bd);utils['info'](util['format'](_0x30f6('0x12'),_0x42f6bd[_0x30f6('0x4')],_0x42f6bd[_0x30f6('0x6')],_0x42f6bd[_0x30f6('0x13')]));queues[_0x42f6bd[_0x30f6('0x4')]]=_[_0x30f6('0x14')](_0x42f6bd,{'originalposition':_0x42f6bd[_0x30f6('0x13')],'queuecallerjoinAt':utils[_0x30f6('0x15')](),'mohtime':0x0});}catch(_0x18155c){utils['error'](util['format']('[%s][queues][queuecallerjoin]',_0x42f6bd['uniqueid']),_0x18155c);}};exports[_0x30f6('0x16')]=function(_0x362855){try{if(!_[_0x30f6('0x17')](queues[_0x362855[_0x30f6('0x4')]])){utils[_0x30f6('0x11')](util[_0x30f6('0x3')]('[%s][queues][hangup]',_0x362855[_0x30f6('0x4')]),_0x362855);if(queues[_0x362855['uniqueid']][_0x30f6('0x18')]){if(!queues[_0x362855[_0x30f6('0x4')]][_0x30f6('0x19')]&&!queues[_0x362855[_0x30f6('0x4')]][_0x30f6('0x1a')]){queues[_0x362855['uniqueid']][_0x30f6('0x1b')]=!![];queues[_0x362855[_0x30f6('0x4')]][_0x30f6('0x1c')]=utils[_0x30f6('0x15')]();queues[_0x362855[_0x30f6('0x4')]]['queuecallerexitreason']=_0x30f6('0x1d');}utils[_0x30f6('0x2')](util[_0x30f6('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x362855[_0x30f6('0x4')],queues[_0x362855[_0x30f6('0x4')]][_0x30f6('0x1e')],queues[_0x362855[_0x30f6('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x362855['uniqueid']]);}else if(queues[_0x362855[_0x30f6('0x4')]][_0x30f6('0xf')]){utils['info'](util[_0x30f6('0x3')](_0x30f6('0x1f'),_0x362855[_0x30f6('0x4')],queues[_0x362855['uniqueid']][_0x30f6('0x1e')],queues[_0x362855[_0x30f6('0x4')]][_0x30f6('0xf')]));queues[queues[_0x362855[_0x30f6('0x4')]]['transfereduniqueid']]=queues[_0x362855[_0x30f6('0x4')]];queues[queues[_0x362855[_0x30f6('0x4')]][_0x30f6('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x362855[_0x30f6('0x4')]];}}}catch(_0x1a730e){utils[_0x30f6('0x20')](util['format'](_0x30f6('0x21'),_0x362855[_0x30f6('0x4')]),_0x1a730e);}};exports['varset']=function(_0xf891d9){try{utils[_0x30f6('0x11')](util['format'](_0x30f6('0x22'),_0xf891d9[_0x30f6('0x4')]),_0xf891d9);if(!_[_0x30f6('0x17')](_0xf891d9[_0x30f6('0x23')]['queuestatus'])&&_0xf891d9[_0x30f6('0x24')][_0x30f6('0x25')]()!=='CONTINUE'){if(!_[_0x30f6('0x17')](queues[_0xf891d9[_0x30f6('0x4')]])){queues[_0xf891d9[_0x30f6('0x4')]]['queuecallerabandon']=![];queues[_0xf891d9['uniqueid']]['queuecallerabandonAt']=null;queues[_0xf891d9[_0x30f6('0x4')]][_0x30f6('0x1a')]=!![];queues[_0xf891d9[_0x30f6('0x4')]][_0x30f6('0x26')]=utils['now']();queues[_0xf891d9[_0x30f6('0x4')]][_0x30f6('0x9')]=_0xf891d9[_0x30f6('0x24')][_0x30f6('0x25')]();utils[_0x30f6('0x2')](util[_0x30f6('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0xf891d9['uniqueid'],queues[_0xf891d9[_0x30f6('0x4')]]['name'],_0xf891d9[_0x30f6('0x24')],queues[_0xf891d9[_0x30f6('0x4')]][_0x30f6('0x9')]));writeDB(queues[_0xf891d9['uniqueid']]);}}else if(!_[_0x30f6('0x17')](_0xf891d9[_0x30f6('0x23')][_0x30f6('0x27')])){if(!_[_0x30f6('0x17')](queues[_0xf891d9[_0x30f6('0x4')]])&&!queues[_0xf891d9[_0x30f6('0x4')]][_0x30f6('0x19')]){queues[_0xf891d9[_0x30f6('0x4')]][_0x30f6('0x19')]=![];queues[_0xf891d9[_0x30f6('0x4')]]['queuecallerabandonAt']=null;queues[_0xf891d9[_0x30f6('0x4')]]['queuecallerexit']=!![];queues[_0xf891d9[_0x30f6('0x4')]][_0x30f6('0x26')]=utils[_0x30f6('0x15')]();queues[_0xf891d9[_0x30f6('0x4')]][_0x30f6('0x9')]='EXITWITHKEY';utils['info'](util[_0x30f6('0x3')](_0x30f6('0x28'),_0xf891d9[_0x30f6('0x4')],queues[_0xf891d9[_0x30f6('0x4')]][_0x30f6('0x1e')],_0xf891d9[_0x30f6('0x24')],queues[_0xf891d9[_0x30f6('0x4')]][_0x30f6('0x9')]));}}}catch(_0x1ee55d){utils[_0x30f6('0x20')](util[_0x30f6('0x3')](_0x30f6('0x22'),_0xf891d9['uniqueid']),_0x1ee55d);}};exports[_0x30f6('0x19')]=function(_0x2881e9){try{if(!_[_0x30f6('0x17')](queues[_0x2881e9[_0x30f6('0x4')]])){utils[_0x30f6('0x11')](util[_0x30f6('0x3')](_0x30f6('0x29'),_0x2881e9['uniqueid']),_0x2881e9);queues[_0x2881e9[_0x30f6('0x4')]]['queuecallerexit']=![];queues[_0x2881e9['uniqueid']][_0x30f6('0x26')]=null;queues[_0x2881e9[_0x30f6('0x4')]][_0x30f6('0x19')]=!![];queues[_0x2881e9[_0x30f6('0x4')]][_0x30f6('0x2a')]=utils[_0x30f6('0x15')]();queues[_0x2881e9['uniqueid']]['queuecallerexitreason']=_0x30f6('0x2b');utils['info'](util[_0x30f6('0x3')](_0x30f6('0x2c'),_0x2881e9[_0x30f6('0x4')],queues[_0x2881e9[_0x30f6('0x4')]][_0x30f6('0x1e')],queues[_0x2881e9[_0x30f6('0x4')]][_0x30f6('0x9')]));}}catch(_0xb1d974){utils[_0x30f6('0x20')](util[_0x30f6('0x3')](_0x30f6('0x29'),_0x2881e9[_0x30f6('0x4')]),_0xb1d974);}};exports['queuecallerleave']=function(_0x1f24f7){try{if(!_[_0x30f6('0x17')](queues[_0x1f24f7[_0x30f6('0x4')]])){utils[_0x30f6('0x11')](util['format'](_0x30f6('0x2d'),_0x1f24f7[_0x30f6('0x4')]),_0x1f24f7);utils[_0x30f6('0x2')](util[_0x30f6('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1f24f7['uniqueid'],queues[_0x1f24f7['uniqueid']][_0x30f6('0x1e')],_0x1f24f7['connectedlinenum'],_0x1f24f7['connectedlinename']));queues[_0x1f24f7[_0x30f6('0x4')]][_0x30f6('0x2e')]=!![];queues[_0x1f24f7[_0x30f6('0x4')]]['queuecallerleaveAt']=utils[_0x30f6('0x15')]();queues[_0x1f24f7['uniqueid']][_0x30f6('0x2f')]=utils[_0x30f6('0x30')](queues[_0x1f24f7[_0x30f6('0x4')]][_0x30f6('0x18')],queues[_0x1f24f7[_0x30f6('0x4')]]['queuecallerjoinAt']);queues[_0x1f24f7[_0x30f6('0x4')]]['position']=_0x1f24f7[_0x30f6('0x13')];queues[_0x1f24f7[_0x30f6('0x4')]][_0x30f6('0x31')]=_0x1f24f7[_0x30f6('0x31')];queues[_0x1f24f7[_0x30f6('0x4')]][_0x30f6('0x32')]=_0x1f24f7['connectedlinenum'];queues[_0x1f24f7[_0x30f6('0x4')]][_0x30f6('0x33')]=_0x1f24f7[_0x30f6('0x33')];}}catch(_0x17368f){utils['error'](util[_0x30f6('0x3')](_0x30f6('0x2d'),_0x1f24f7['uniqueid']),_0x17368f);}};exports[_0x30f6('0x34')]=function(_0x5a8ce1){try{if(!_[_0x30f6('0x17')](queues[_0x5a8ce1[_0x30f6('0x4')]])){utils['debug'](util['format'](_0x30f6('0x35'),_0x5a8ce1['uniqueid']),_0x5a8ce1);utils[_0x30f6('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x5a8ce1[_0x30f6('0x4')],queues[_0x5a8ce1[_0x30f6('0x4')]][_0x30f6('0x1e')],_0x5a8ce1[_0x30f6('0x36')],_0x5a8ce1[_0x30f6('0x37')]));queues[_0x5a8ce1[_0x30f6('0x4')]][_0x30f6('0x19')]=![];queues[_0x5a8ce1[_0x30f6('0x4')]]['queuecallerabandon']=![];queues[_0x5a8ce1[_0x30f6('0x4')]][_0x30f6('0x2a')]=null;queues[_0x5a8ce1[_0x30f6('0x4')]][_0x30f6('0x1a')]=![];queues[_0x5a8ce1[_0x30f6('0x4')]][_0x30f6('0x9')]=null;queues[_0x5a8ce1['uniqueid']][_0x30f6('0x26')]=null;queues[_0x5a8ce1[_0x30f6('0x4')]]['assigned']=!![];queues[_0x5a8ce1[_0x30f6('0x4')]][_0x30f6('0x38')]=_0x5a8ce1['destaccountcode'];queues[_0x5a8ce1[_0x30f6('0x4')]][_0x30f6('0x7')]=_0x5a8ce1[_0x30f6('0x36')];}}catch(_0x16cf9b){utils['error'](util[_0x30f6('0x3')]('[%s][queues][agentconnect]',_0x5a8ce1[_0x30f6('0x4')]),_0x16cf9b);}};exports[_0x30f6('0x39')]=function(_0xc49ed7){try{if(!_[_0x30f6('0x17')](queues[_0xc49ed7[_0x30f6('0x4')]])){if(queues[_0xc49ed7['uniqueid']][_0x30f6('0x18')]){utils[_0x30f6('0x11')](util[_0x30f6('0x3')](_0x30f6('0x3a'),_0xc49ed7[_0x30f6('0x4')]),_0xc49ed7);queues[_0xc49ed7['uniqueid']][_0x30f6('0x19')]=![];queues[_0xc49ed7['uniqueid']][_0x30f6('0x19')]=![];queues[_0xc49ed7[_0x30f6('0x4')]]['queuecallerabandonAt']=null;queues[_0xc49ed7[_0x30f6('0x4')]]['queuecallerexit']=![];queues[_0xc49ed7[_0x30f6('0x4')]][_0x30f6('0x26')]=null;queues[_0xc49ed7[_0x30f6('0x4')]][_0x30f6('0x3b')]=!![];queues[_0xc49ed7['uniqueid']][_0x30f6('0x7')]=_0xc49ed7[_0x30f6('0x36')];queues[_0xc49ed7[_0x30f6('0x4')]]['queuecallercomplete']=!![];queues[_0xc49ed7['uniqueid']][_0x30f6('0x1c')]=utils[_0x30f6('0x15')]();if(_0xc49ed7[_0x30f6('0x3c')]==_0x30f6('0x3d')){if(!queues[_0xc49ed7[_0x30f6('0x4')]]['transfer']){queues[_0xc49ed7['uniqueid']][_0x30f6('0x9')]=_0x30f6('0x3e');}}else{queues[_0xc49ed7['uniqueid']][_0x30f6('0x9')]=_0x30f6('0x3f')+_0xc49ed7[_0x30f6('0x3c')][_0x30f6('0x25')]();}utils['info'](util['format'](_0x30f6('0x40'),_0xc49ed7[_0x30f6('0x4')],queues[_0xc49ed7[_0x30f6('0x4')]]['name'],_0xc49ed7[_0x30f6('0x36')],queues[_0xc49ed7['uniqueid']][_0x30f6('0x9')]));writeDB(queues[_0xc49ed7['uniqueid']]);}}}catch(_0x217dfe){utils[_0x30f6('0x20')](util[_0x30f6('0x3')](_0x30f6('0x3a'),_0xc49ed7[_0x30f6('0x4')]),_0x217dfe);}};exports[_0x30f6('0x41')]=function(_0x5b7343){try{if(!_['isNil'](queues[_0x5b7343[_0x30f6('0x42')]])){utils['debug'](util['format'](_0x30f6('0x43'),_0x5b7343[_0x30f6('0x4')]),_0x5b7343);queues[_0x5b7343['transfereeuniqueid']][_0x30f6('0x3d')]=!![];queues[_0x5b7343[_0x30f6('0x42')]][_0x30f6('0x44')]=_0x30f6('0x45');queues[_0x5b7343[_0x30f6('0x42')]]['transferexten']=_0x5b7343[_0x30f6('0x46')];queues[_0x5b7343[_0x30f6('0x42')]][_0x30f6('0x47')]=_0x5b7343[_0x30f6('0x42')];queues[_0x5b7343[_0x30f6('0x42')]][_0x30f6('0x9')]=_0x30f6('0x48');utils['info'](util[_0x30f6('0x3')](_0x30f6('0x49'),_0x5b7343['uniqueid'],queues[_0x5b7343['transfereeuniqueid']]['name'],_0x5b7343[_0x30f6('0x42')],_0x5b7343[_0x30f6('0x46')]));}}catch(_0x5ad16c){utils['error'](util[_0x30f6('0x3')](_0x30f6('0x43'),_0x5b7343['uniqueid']),_0x5ad16c);}};exports[_0x30f6('0x4a')]=function(_0x47293a){try{utils['debug'](util[_0x30f6('0x3')]('[%s][queues][attendedtransfer]',_0x47293a[_0x30f6('0x4b')]),_0x47293a);if(_0x47293a['origtransfereruniqueid']==_0x47293a[_0x30f6('0x4c')]){if(!_[_0x30f6('0x17')](queues[_0x47293a[_0x30f6('0x4d')]])){utils[_0x30f6('0x2')](util[_0x30f6('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x47293a[_0x30f6('0x4b')],queues[_0x47293a[_0x30f6('0x4d')]][_0x30f6('0x1e')],_0x47293a[_0x30f6('0x4e')]));queues[_0x47293a[_0x30f6('0x4d')]]['transfer']=!![];queues[_0x47293a[_0x30f6('0x4d')]][_0x30f6('0x44')]=_0x30f6('0x4f');queues[_0x47293a[_0x30f6('0x4d')]][_0x30f6('0x50')]=_0x47293a[_0x30f6('0x4e')];queues[_0x47293a['secondtransfererlinkedid']][_0x30f6('0x47')]=_0x47293a['origtransfereruniqueid'];queues[_0x47293a[_0x30f6('0x4d')]][_0x30f6('0x9')]=_0x30f6('0x51');}if(!_[_0x30f6('0x17')](queues[_0x47293a[_0x30f6('0x4c')]])){if(_0x47293a[_0x30f6('0x52')]&&queues[_0x47293a['transfereelinkedid']]){queues[_0x47293a[_0x30f6('0x52')]][_0x30f6('0x53')]=0x1;queues[_0x47293a[_0x30f6('0x42')]]=_['clone'](queues[_0x47293a[_0x30f6('0x52')]]);queues[_0x47293a[_0x30f6('0x42')]][_0x30f6('0xf')]=_0x47293a[_0x30f6('0x54')];queues[_0x47293a[_0x30f6('0x42')]]['queuecallerenterreason']=0x2;queues[_0x47293a['transfereeuniqueid']][_0x30f6('0x8')]=queues[_0x47293a[_0x30f6('0x4d')]][_0x30f6('0x8')];queues[_0x47293a[_0x30f6('0x42')]][_0x30f6('0x55')]=queues[_0x47293a[_0x30f6('0x4d')]][_0x30f6('0x55')];queues[_0x47293a[_0x30f6('0x42')]][_0x30f6('0x56')]=utils['now']();queues[_0x47293a[_0x30f6('0x42')]][_0x30f6('0x18')]=utils['now']();queues[_0x47293a[_0x30f6('0x42')]][_0x30f6('0x2f')]=0x0;queues[_0x47293a[_0x30f6('0x42')]]['mohtime']=0x0;utils[_0x30f6('0x2')](util[_0x30f6('0x3')](_0x30f6('0x57'),_0x47293a[_0x30f6('0x4b')],queues[_0x47293a[_0x30f6('0x42')]][_0x30f6('0x1e')],queues[_0x47293a[_0x30f6('0x42')]][_0x30f6('0x8')],queues[_0x47293a['transfereeuniqueid']][_0x30f6('0x55')]));}else{utils[_0x30f6('0x2')](util['format'](_0x30f6('0x58'),_0x47293a[_0x30f6('0x4b')],queues[_0x47293a[_0x30f6('0x4c')]][_0x30f6('0x1e')],_0x47293a[_0x30f6('0x4d')]));queues[_0x47293a[_0x30f6('0x4c')]][_0x30f6('0xf')]=_0x47293a[_0x30f6('0x4d')];}}}else if(_0x47293a[_0x30f6('0x59')]==_0x47293a[_0x30f6('0x4d')]){if(!_[_0x30f6('0x17')](queues[_0x47293a[_0x30f6('0x4c')]])){utils[_0x30f6('0x2')](util[_0x30f6('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x47293a[_0x30f6('0x4b')],queues[_0x47293a['origtransfererlinkedid']][_0x30f6('0x1e')],_0x47293a[_0x30f6('0x59')],_0x47293a[_0x30f6('0x5a')]));queues[_0x47293a[_0x30f6('0x4c')]][_0x30f6('0x3d')]=!![];queues[_0x47293a['origtransfererlinkedid']][_0x30f6('0x44')]='ATTENDED';queues[_0x47293a[_0x30f6('0x4c')]][_0x30f6('0x50')]=_0x47293a[_0x30f6('0x5a')];queues[_0x47293a[_0x30f6('0x4c')]][_0x30f6('0x47')]=_0x47293a[_0x30f6('0x59')];queues[_0x47293a[_0x30f6('0x4c')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x30f6('0x17')](queues[_0x47293a[_0x30f6('0x4d')]])){if(_0x47293a['transfertargetlinkedid']&&queues[_0x47293a[_0x30f6('0x5b')]]){queues[_0x47293a[_0x30f6('0x5b')]][_0x30f6('0x53')]=0x1;queues[_0x47293a['transfertargetuniqueid']]=_[_0x30f6('0x5c')](queues[_0x47293a[_0x30f6('0x5b')]]);queues[_0x47293a[_0x30f6('0x54')]][_0x30f6('0xf')]=_0x47293a[_0x30f6('0x54')];queues[_0x47293a[_0x30f6('0x54')]]['queuecallerenterreason']=0x2;queues[_0x47293a[_0x30f6('0x54')]][_0x30f6('0x8')]=queues[_0x47293a['origtransfererlinkedid']][_0x30f6('0x8')];queues[_0x47293a[_0x30f6('0x54')]][_0x30f6('0x55')]=queues[_0x47293a[_0x30f6('0x4c')]][_0x30f6('0x55')];queues[_0x47293a[_0x30f6('0x54')]][_0x30f6('0x56')]=utils[_0x30f6('0x15')]();queues[_0x47293a[_0x30f6('0x54')]][_0x30f6('0x18')]=utils['now']();queues[_0x47293a[_0x30f6('0x54')]]['holdtime']=0x0;queues[_0x47293a[_0x30f6('0x54')]]['mohtime']=0x0;utils[_0x30f6('0x2')](util[_0x30f6('0x3')](_0x30f6('0x5d'),_0x47293a[_0x30f6('0x4b')],queues[_0x47293a[_0x30f6('0x54')]][_0x30f6('0x1e')],queues[_0x47293a[_0x30f6('0x54')]][_0x30f6('0xf')],queues[_0x47293a[_0x30f6('0x54')]][_0x30f6('0x8')],queues[_0x47293a[_0x30f6('0x54')]]['calleridname']));}else{utils[_0x30f6('0x2')](util[_0x30f6('0x3')](_0x30f6('0x58'),_0x47293a[_0x30f6('0x4b')],queues[_0x47293a['secondtransfererlinkedid']][_0x30f6('0x1e')],_0x47293a[_0x30f6('0x4c')]));queues[_0x47293a[_0x30f6('0x4d')]][_0x30f6('0xf')]=_0x47293a['origtransfererlinkedid'];}}}}catch(_0x395fdb){utils[_0x30f6('0x20')](util[_0x30f6('0x3')](_0x30f6('0x5e'),_0x47293a[_0x30f6('0x4b')]),_0x395fdb);}};exports['musiconholdstart']=function(_0x2ec360){try{if(!_[_0x30f6('0x17')](queues[_0x2ec360['uniqueid']])){utils['debug'](util['format'](_0x30f6('0x5f'),_0x2ec360['uniqueid']),_0x2ec360);queues[_0x2ec360[_0x30f6('0x4')]][_0x30f6('0x60')]=utils[_0x30f6('0x15')]();utils[_0x30f6('0x2')](util['format'](_0x30f6('0x61'),_0x2ec360[_0x30f6('0x4')],queues[_0x2ec360[_0x30f6('0x4')]]['name'],queues[_0x2ec360[_0x30f6('0x4')]]['musiconholdstartAt']));}}catch(_0x121357){utils[_0x30f6('0x20')](util[_0x30f6('0x3')](_0x30f6('0x5f'),_0x2ec360[_0x30f6('0x4')]),_0x121357);}};exports[_0x30f6('0x62')]=function(_0x248601){try{if(!_[_0x30f6('0x17')](queues[_0x248601[_0x30f6('0x4')]])){if(!_[_0x30f6('0x17')](queues[_0x248601['uniqueid']][_0x30f6('0x60')])){utils[_0x30f6('0x11')](util['format'](_0x30f6('0x63'),_0x248601[_0x30f6('0x4')]),_0x248601);queues[_0x248601['uniqueid']][_0x30f6('0x64')]+=utils['diffTime'](utils[_0x30f6('0x15')](),queues[_0x248601[_0x30f6('0x4')]]['musiconholdstartAt']);utils['info'](util[_0x30f6('0x3')](_0x30f6('0x65'),_0x248601[_0x30f6('0x4')],queues[_0x248601['uniqueid']][_0x30f6('0x1e')],queues[_0x248601[_0x30f6('0x4')]][_0x30f6('0x64')]));delete queues[_0x248601[_0x30f6('0x4')]][_0x30f6('0x60')];}}}catch(_0x2b4eed){utils[_0x30f6('0x20')](util[_0x30f6('0x3')](_0x30f6('0x63'),_0x248601[_0x30f6('0x4')]),_0x2b4eed);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 629fe74..19a5d71 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 _0x92eb=['[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','value','endsWith','.wav49','replace','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','appdata','toLowerCase','set','startsWith','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','./utils','format','getUserByInternal','membername','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','accountcode','channel','error','newstate','[%s][recordings][newstate]','info','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','channelstate'];(function(_0x4596a1,_0x4a6fdc){var _0x5cc738=function(_0x1556f4){while(--_0x1556f4){_0x4596a1['push'](_0x4596a1['shift']());}};_0x5cc738(++_0x4a6fdc);}(_0x92eb,0x90));var _0xb92e=function(_0x6158fc,_0x20b38c){_0x6158fc=_0x6158fc-0x0;var _0x5b6e00=_0x92eb[_0x6158fc];return _0x5b6e00;};'use strict';var _=require(_0xb92e('0x0'));var util=require('util');var utils=require(_0xb92e('0x1'));var recordings={};function writeDB(_0x18e39c){utils['info'](util[_0xb92e('0x2')]('[%s][recordings][writeDB]',_0x18e39c['uniqueid']));if(_0x18e39c['accountcode']){utils[_0xb92e('0x3')](_0x18e39c['accountcode'])['then'](function(_0x422766){if(_0x422766){_0x18e39c[_0xb92e('0x4')]=_0x422766['name'];_0x18e39c[_0xb92e('0x5')]=_0x422766['id'];}utils['request'](_0xb92e('0x6'),_0x18e39c);});}else{utils[_0xb92e('0x7')](_0xb92e('0x6'),_0x18e39c);}}exports[_0xb92e('0x8')]=function(_0x305483){try{utils[_0xb92e('0x9')](util['format'](_0xb92e('0xa'),_0x305483['uniqueid']),_0x305483);if(_0x305483[_0xb92e('0xb')]==_0x305483[_0xb92e('0xc')]){utils['info'](util[_0xb92e('0x2')](_0xb92e('0xd'),_0x305483[_0xb92e('0xb')],_0x305483[_0xb92e('0xe')],_0x305483['exten']));recordings[_0x305483['uniqueid']]={'uniqueid':_0x305483['uniqueid'],'accountcode':_0x305483[_0xb92e('0xf')],'exten':_0x305483['exten'],'context':_0x305483[_0xb92e('0xe')],'channel':_0x305483[_0xb92e('0x10')],'monitors':[]};}}catch(_0x3adf07){utils[_0xb92e('0x11')](util['format'](_0xb92e('0xa'),_0x305483['uniqueid']),_0x3adf07);}};exports[_0xb92e('0x12')]=function(_0x28236c){try{utils[_0xb92e('0x9')](util[_0xb92e('0x2')](_0xb92e('0x13'),_0x28236c[_0xb92e('0xb')]),_0x28236c);if(!_['isNil'](recordings[_0x28236c[_0xb92e('0xb')]])&&_0x28236c['channelstate']==0x6){utils[_0xb92e('0x14')](util[_0xb92e('0x2')](_0xb92e('0x15'),_0x28236c[_0xb92e('0xb')],_0x28236c[_0xb92e('0xe')],_0x28236c[_0xb92e('0x10')]));}else if(!_[_0xb92e('0x16')](recordings[_0x28236c['linkedid']])&&_0x28236c[_0xb92e('0x17')]==0x6&&_0x28236c[_0xb92e('0xe')]!='transfer'){utils[_0xb92e('0x14')](util[_0xb92e('0x2')](_0xb92e('0x18'),_0x28236c[_0xb92e('0xb')],_0x28236c[_0xb92e('0xc')],_0x28236c['context'],_0x28236c[_0xb92e('0x10')]));recordings[_0x28236c['linkedid']][_0xb92e('0xf')]=_0x28236c[_0xb92e('0xf')];}}catch(_0x4979f2){utils[_0xb92e('0x11')](util[_0xb92e('0x2')](_0xb92e('0x13'),_0x28236c[_0xb92e('0xb')]),_0x4979f2);}};exports[_0xb92e('0x19')]=function(_0x18f0a3){try{if(!_[_0xb92e('0x16')](_0x18f0a3[_0xb92e('0x1a')])&&!_[_0xb92e('0x16')](_0x18f0a3[_0xb92e('0x1a')][_0xb92e('0x1b')])){utils[_0xb92e('0x9')](util[_0xb92e('0x2')]('[%s][recordings][varset]',_0x18f0a3['uniqueid']),_0x18f0a3);utils[_0xb92e('0x14')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x18f0a3[_0xb92e('0xb')],_0x18f0a3[_0xb92e('0x1a')],_0x18f0a3[_0xb92e('0x1c')]));if(_[_0xb92e('0x1d')](_0x18f0a3[_0xb92e('0x1c')],_0xb92e('0x1e'))){_0x18f0a3[_0xb92e('0x1c')]=_0x18f0a3[_0xb92e('0x1c')][_0xb92e('0x1f')]('.wav49',_0xb92e('0x20'));}if(recordings[_0x18f0a3[_0xb92e('0xc')]]){var _0x541754=_['find'](recordings[_0x18f0a3[_0xb92e('0xc')]][_0xb92e('0x21')],{'value':_0x18f0a3['value']});if(_[_0xb92e('0x16')](_0x541754)){recordings[_0x18f0a3[_0xb92e('0xc')]][_0xb92e('0x21')][_0xb92e('0x22')]({'value':_0x18f0a3[_0xb92e('0x1c')]});}}}}catch(_0x3381e2){utils[_0xb92e('0x11')](util[_0xb92e('0x2')](_0xb92e('0x23'),_0x18f0a3['uniqueid']),_0x3381e2);}};exports[_0xb92e('0x24')]=function(_0x2110ae){try{if(!_[_0xb92e('0x16')](recordings[_0x2110ae['uniqueid']])){utils[_0xb92e('0x9')](util[_0xb92e('0x2')](_0xb92e('0x25'),_0x2110ae[_0xb92e('0xb')]),_0x2110ae);utils[_0xb92e('0x14')](util[_0xb92e('0x2')](_0xb92e('0x26'),_0x2110ae[_0xb92e('0xb')],_0x2110ae[_0xb92e('0x27')],_0x2110ae[_0xb92e('0x28')],_0x2110ae['cause-txt']));recordings[_0x2110ae[_0xb92e('0xb')]][_0xb92e('0x27')]=_0x2110ae['calleridnum'];recordings[_0x2110ae[_0xb92e('0xb')]][_0xb92e('0x28')]=_0x2110ae[_0xb92e('0x28')];recordings[_0x2110ae[_0xb92e('0xb')]][_0xb92e('0x29')]=_0x2110ae[_0xb92e('0x29')];recordings[_0x2110ae[_0xb92e('0xb')]]['connectedlinename']=_0x2110ae[_0xb92e('0x2a')];if(recordings[_0x2110ae[_0xb92e('0xb')]][_0xb92e('0x2b')]==_0xb92e('0x2c')&&recordings[_0x2110ae[_0xb92e('0xb')]]['accountcode']){recordings[_0x2110ae[_0xb92e('0xb')]][_0xb92e('0x29')]=recordings[_0x2110ae['uniqueid']][_0xb92e('0xf')];recordings[_0x2110ae[_0xb92e('0xb')]][_0xb92e('0x2a')]='';}recordings[_0x2110ae[_0xb92e('0xb')]][_0xb92e('0x21')]['forEach'](function(_0x32f609){var _0x8c375f=_[_0xb92e('0x2d')](recordings[_0x2110ae[_0xb92e('0xb')]]);_0x8c375f[_0xb92e('0x1c')]=_0x32f609['value'];writeDB(_0x8c375f);});delete recordings[_0x2110ae[_0xb92e('0xb')]];}}catch(_0xa68fd4){utils['error'](util['format'](_0xb92e('0x25'),_0x2110ae[_0xb92e('0xb')]),_0xa68fd4);}};exports[_0xb92e('0x2e')]=function(_0x3743de){try{if(!_[_0xb92e('0x16')](recordings[_0x3743de[_0xb92e('0xb')]])){utils['debug'](util['format']('[%s][recordings][newexten]',_0x3743de[_0xb92e('0xb')]),_0x3743de);utils['info'](util[_0xb92e('0x2')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x3743de[_0xb92e('0xb')],_0x3743de['application'],_0x3743de[_0xb92e('0x2f')]));if(_0x3743de['application'][_0xb92e('0x30')]()==_0xb92e('0x31')&&_[_0xb92e('0x32')](_0x3743de[_0xb92e('0x2f')][_0xb92e('0x30')](),'cdr')){var _0x3125c3=_0x3743de['appdata']['split']('=');var _0x38063c=_0x3125c3[0x0][_0xb92e('0x33')](_0x3125c3[0x0]['lastIndexOf']('(')+0x1,_0x3125c3[0x0][_0xb92e('0x34')](')'));var _0x223cad=_0x3125c3[0x1];recordings[_0x3743de[_0xb92e('0xb')]][_0x38063c]=_0x223cad;}}}catch(_0x3b6f69){utils['error'](util[_0xb92e('0x2')]('[%s][recordings][newexten]',_0x3743de[_0xb92e('0xb')]),_0x3b6f69);}};exports[_0xb92e('0x35')]=function(_0x3aa03e){try{if(!_[_0xb92e('0x16')](recordings[_0x3aa03e[_0xb92e('0xb')]])){utils['debug'](util[_0xb92e('0x2')](_0xb92e('0x36'),_0x3aa03e[_0xb92e('0xb')]),_0x3aa03e);utils[_0xb92e('0x14')](util[_0xb92e('0x2')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x3aa03e[_0xb92e('0xb')],_0x3aa03e['queue']));recordings[_0x3aa03e['uniqueid']][_0xb92e('0x37')]=_0x3aa03e[_0xb92e('0x37')];}}catch(_0x49397c){utils[_0xb92e('0x11')](util[_0xb92e('0x2')](_0xb92e('0x36'),_0x3aa03e['uniqueid']),_0x49397c);}}; \ No newline at end of file +var _0x68b4=['getUserByInternal','membername','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','debug','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','type','outbound','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','lodash','util','./utils','info','format','[%s][recordings][writeDB]','accountcode'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0x68b4,0xc2));var _0x468b=function(_0x340b4a,_0x5efbfd){_0x340b4a=_0x340b4a-0x0;var _0xfdf6eb=_0x68b4[_0x340b4a];return _0xfdf6eb;};'use strict';var _=require(_0x468b('0x0'));var util=require(_0x468b('0x1'));var utils=require(_0x468b('0x2'));var recordings={};function writeDB(_0x52fe6c){utils[_0x468b('0x3')](util[_0x468b('0x4')](_0x468b('0x5'),_0x52fe6c['uniqueid']));if(_0x52fe6c[_0x468b('0x6')]){utils[_0x468b('0x7')](_0x52fe6c['accountcode'])['then'](function(_0x75d102){if(_0x75d102){_0x52fe6c[_0x468b('0x8')]=_0x75d102[_0x468b('0x9')];_0x52fe6c[_0x468b('0xa')]=_0x75d102['id'];}utils[_0x468b('0xb')]('CreateVoiceRecording',_0x52fe6c);});}else{utils[_0x468b('0xb')](_0x468b('0xc'),_0x52fe6c);}}exports[_0x468b('0xd')]=function(_0x277560){try{utils['debug'](util[_0x468b('0x4')](_0x468b('0xe'),_0x277560[_0x468b('0xf')]),_0x277560);if(_0x277560[_0x468b('0xf')]==_0x277560[_0x468b('0x10')]){utils[_0x468b('0x3')](util[_0x468b('0x4')](_0x468b('0x11'),_0x277560[_0x468b('0xf')],_0x277560['context'],_0x277560[_0x468b('0x12')]));recordings[_0x277560['uniqueid']]={'uniqueid':_0x277560[_0x468b('0xf')],'accountcode':_0x277560[_0x468b('0x6')],'exten':_0x277560[_0x468b('0x12')],'context':_0x277560[_0x468b('0x13')],'channel':_0x277560[_0x468b('0x14')],'monitors':[]};}}catch(_0x2e64d9){utils['error'](util[_0x468b('0x4')](_0x468b('0xe'),_0x277560[_0x468b('0xf')]),_0x2e64d9);}};exports[_0x468b('0x15')]=function(_0x186c57){try{utils['debug'](util[_0x468b('0x4')](_0x468b('0x16'),_0x186c57[_0x468b('0xf')]),_0x186c57);if(!_[_0x468b('0x17')](recordings[_0x186c57['uniqueid']])&&_0x186c57[_0x468b('0x18')]==0x6){utils[_0x468b('0x3')](util[_0x468b('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x186c57['uniqueid'],_0x186c57[_0x468b('0x13')],_0x186c57[_0x468b('0x14')]));}else if(!_[_0x468b('0x17')](recordings[_0x186c57[_0x468b('0x10')]])&&_0x186c57['channelstate']==0x6&&_0x186c57[_0x468b('0x13')]!=_0x468b('0x19')){utils[_0x468b('0x3')](util[_0x468b('0x4')](_0x468b('0x1a'),_0x186c57[_0x468b('0xf')],_0x186c57[_0x468b('0x10')],_0x186c57[_0x468b('0x13')],_0x186c57[_0x468b('0x14')]));recordings[_0x186c57[_0x468b('0x10')]][_0x468b('0x6')]=_0x186c57[_0x468b('0x6')];}}catch(_0xfd8b14){utils[_0x468b('0x1b')](util[_0x468b('0x4')](_0x468b('0x16'),_0x186c57[_0x468b('0xf')]),_0xfd8b14);}};exports[_0x468b('0x1c')]=function(_0x167702){try{if(!_[_0x468b('0x17')](_0x167702[_0x468b('0x1d')])&&!_[_0x468b('0x17')](_0x167702[_0x468b('0x1d')]['mixmonitor_filename'])){utils[_0x468b('0x1e')](util[_0x468b('0x4')](_0x468b('0x1f'),_0x167702[_0x468b('0xf')]),_0x167702);utils[_0x468b('0x3')](util[_0x468b('0x4')](_0x468b('0x20'),_0x167702[_0x468b('0xf')],_0x167702['variable'],_0x167702[_0x468b('0x21')]));if(_[_0x468b('0x22')](_0x167702[_0x468b('0x21')],_0x468b('0x23'))){_0x167702[_0x468b('0x21')]=_0x167702[_0x468b('0x21')][_0x468b('0x24')](_0x468b('0x23'),_0x468b('0x25'));}if(recordings[_0x167702[_0x468b('0x10')]]){var _0x4de4bf=_[_0x468b('0x26')](recordings[_0x167702[_0x468b('0x10')]][_0x468b('0x27')],{'value':_0x167702[_0x468b('0x21')]});if(_['isNil'](_0x4de4bf)){recordings[_0x167702[_0x468b('0x10')]][_0x468b('0x27')][_0x468b('0x28')]({'value':_0x167702[_0x468b('0x21')]});}}}}catch(_0x3a04b8){utils[_0x468b('0x1b')](util['format'](_0x468b('0x1f'),_0x167702[_0x468b('0xf')]),_0x3a04b8);}};exports[_0x468b('0x29')]=function(_0x596c0e){try{if(!_[_0x468b('0x17')](recordings[_0x596c0e[_0x468b('0xf')]])){utils[_0x468b('0x1e')](util[_0x468b('0x4')](_0x468b('0x2a'),_0x596c0e[_0x468b('0xf')]),_0x596c0e);utils[_0x468b('0x3')](util[_0x468b('0x4')](_0x468b('0x2b'),_0x596c0e[_0x468b('0xf')],_0x596c0e[_0x468b('0x2c')],_0x596c0e[_0x468b('0x2d')],_0x596c0e[_0x468b('0x2e')]));recordings[_0x596c0e[_0x468b('0xf')]][_0x468b('0x2c')]=_0x596c0e[_0x468b('0x2c')];recordings[_0x596c0e[_0x468b('0xf')]]['calleridname']=_0x596c0e[_0x468b('0x2d')];recordings[_0x596c0e[_0x468b('0xf')]][_0x468b('0x2f')]=_0x596c0e[_0x468b('0x2f')];recordings[_0x596c0e[_0x468b('0xf')]]['connectedlinename']=_0x596c0e['connectedlinename'];if(recordings[_0x596c0e[_0x468b('0xf')]][_0x468b('0x30')]==_0x468b('0x31')&&recordings[_0x596c0e['uniqueid']][_0x468b('0x6')]){recordings[_0x596c0e['uniqueid']]['connectedlinenum']=recordings[_0x596c0e[_0x468b('0xf')]][_0x468b('0x6')];recordings[_0x596c0e[_0x468b('0xf')]][_0x468b('0x32')]='';}recordings[_0x596c0e['uniqueid']][_0x468b('0x27')][_0x468b('0x33')](function(_0x169e79){var _0x232d6a=_[_0x468b('0x34')](recordings[_0x596c0e['uniqueid']]);_0x232d6a[_0x468b('0x21')]=_0x169e79[_0x468b('0x21')];writeDB(_0x232d6a);});delete recordings[_0x596c0e[_0x468b('0xf')]];}}catch(_0x4f6967){utils['error'](util['format'](_0x468b('0x2a'),_0x596c0e[_0x468b('0xf')]),_0x4f6967);}};exports[_0x468b('0x35')]=function(_0x220161){try{if(!_[_0x468b('0x17')](recordings[_0x220161[_0x468b('0xf')]])){utils[_0x468b('0x1e')](util[_0x468b('0x4')]('[%s][recordings][newexten]',_0x220161[_0x468b('0xf')]),_0x220161);utils[_0x468b('0x3')](util[_0x468b('0x4')](_0x468b('0x36'),_0x220161[_0x468b('0xf')],_0x220161[_0x468b('0x37')],_0x220161[_0x468b('0x38')]));if(_0x220161[_0x468b('0x37')][_0x468b('0x39')]()==_0x468b('0x3a')&&_['startsWith'](_0x220161[_0x468b('0x38')]['toLowerCase'](),'cdr')){var _0x17d57b=_0x220161[_0x468b('0x38')][_0x468b('0x3b')]('=');var _0x1339bd=_0x17d57b[0x0][_0x468b('0x3c')](_0x17d57b[0x0][_0x468b('0x3d')]('(')+0x1,_0x17d57b[0x0][_0x468b('0x3d')](')'));var _0xc9ec2f=_0x17d57b[0x1];recordings[_0x220161[_0x468b('0xf')]][_0x1339bd]=_0xc9ec2f;}}}catch(_0x1e13c9){utils[_0x468b('0x1b')](util[_0x468b('0x4')](_0x468b('0x3e'),_0x220161['uniqueid']),_0x1e13c9);}};exports[_0x468b('0x3f')]=function(_0x19b801){try{if(!_[_0x468b('0x17')](recordings[_0x19b801['uniqueid']])){utils[_0x468b('0x1e')](util[_0x468b('0x4')]('[%s][recordings][queuecallerjoin]',_0x19b801[_0x468b('0xf')]),_0x19b801);utils['info'](util[_0x468b('0x4')](_0x468b('0x40'),_0x19b801[_0x468b('0xf')],_0x19b801[_0x468b('0x41')]));recordings[_0x19b801['uniqueid']][_0x468b('0x41')]=_0x19b801['queue'];}}catch(_0x2a9392){utils['error'](util[_0x468b('0x4')](_0x468b('0x42'),_0x19b801[_0x468b('0xf')]),_0x2a9392);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a370005..2a2854c 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 _0xea85=['origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext'];(function(_0x366fa0,_0x4e78ab){var _0x3f1962=function(_0x23f884){while(--_0x23f884){_0x366fa0['push'](_0x366fa0['shift']());}};_0x3f1962(++_0x4e78ab);}(_0xea85,0x17b));var _0x5ea8=function(_0x2e43aa,_0x5c6e3d){_0x2e43aa=_0x2e43aa-0x0;var _0xd2c4ff=_0xea85[_0x2e43aa];return _0xd2c4ff;};'use strict';var _=require(_0x5ea8('0x0'));var util=require(_0x5ea8('0x1'));var utils=require(_0x5ea8('0x2'));function writeDB(_0xeb0b58){utils[_0x5ea8('0x3')](util[_0x5ea8('0x4')](_0x5ea8('0x5'),_0xeb0b58[_0x5ea8('0x6')]===_0x5ea8('0x7')?_0xeb0b58[_0x5ea8('0x8')]:_0xeb0b58[_0x5ea8('0x9')],_0xeb0b58['type']));utils[_0x5ea8('0xa')]('CreateVoiceTransferReport',_0xeb0b58);}exports[_0x5ea8('0xb')]={};exports[_0x5ea8('0xc')]=function(_0x4e99f1){try{utils[_0x5ea8('0xd')](util[_0x5ea8('0x4')](_0x5ea8('0xe'),_0x4e99f1[_0x5ea8('0x9')]),_0x4e99f1);utils['info'](util['format'](_0x5ea8('0xf'),_0x4e99f1[_0x5ea8('0x9')],_0x4e99f1['transferercalleridnum'],_0x4e99f1[_0x5ea8('0x10')],_0x4e99f1[_0x5ea8('0x11')],_0x4e99f1['transfereecalleridname']));_0x4e99f1[_0x5ea8('0x6')]='blind';exports[_0x5ea8('0xb')][_0x4e99f1[_0x5ea8('0x12')]]=_0x4e99f1;writeDB(_0x4e99f1);}catch(_0x1eabd4){utils[_0x5ea8('0x13')](util[_0x5ea8('0x4')](_0x5ea8('0xe'),_0x4e99f1[_0x5ea8('0x9')]),_0x1eabd4);}};exports[_0x5ea8('0x14')]=function(_0x33edfc){try{utils[_0x5ea8('0xd')](util['format'](_0x5ea8('0x15'),_0x33edfc[_0x5ea8('0x8')]),_0x33edfc);utils['info'](util[_0x5ea8('0x4')](_0x5ea8('0x16'),_0x33edfc[_0x5ea8('0x8')],_0x33edfc[_0x5ea8('0x17')],_0x33edfc[_0x5ea8('0x18')],_0x33edfc[_0x5ea8('0x19')],_0x33edfc[_0x5ea8('0x1a')]));_0x33edfc=_['assign'](_0x33edfc,{'transfererchannel':_0x33edfc[_0x5ea8('0x1b')],'transferercalleridnum':_0x33edfc[_0x5ea8('0x17')],'transferercalleridname':_0x33edfc[_0x5ea8('0x18')],'transfererconnectedlinenum':_0x33edfc[_0x5ea8('0x1c')],'transfererconnectedlinename':_0x33edfc['secondtransfererconnectedlinename'],'transfereraccountcode':_0x33edfc[_0x5ea8('0x1d')],'transferercontext':_0x33edfc[_0x5ea8('0x1e')],'transfererexten':_0x33edfc['secondtransfererexten'],'transfererlinkedid':_0x33edfc[_0x5ea8('0x1f')],'context':_0x33edfc[_0x5ea8('0x20')],'extension':_0x33edfc[_0x5ea8('0x21')],'type':_0x5ea8('0x7')});if(_[_0x5ea8('0x22')](_0x33edfc[_0x5ea8('0x23')])){_0x33edfc=_[_0x5ea8('0x24')](_0x33edfc,{'transfereechannel':_0x33edfc[_0x5ea8('0x25')],'transfereecalleridnum':_0x33edfc[_0x5ea8('0x19')],'transfereecalleridname':_0x33edfc[_0x5ea8('0x1a')],'transfereeconnectedlinenum':_0x33edfc[_0x5ea8('0x26')],'transfereeconnectedlinename':_0x33edfc['transfertargetconnectedlinename'],'transfereeaccountcode':_0x33edfc[_0x5ea8('0x27')],'transfereecontext':_0x33edfc['transfertargetcontext'],'transfereeexten':_0x33edfc[_0x5ea8('0x28')],'transfereelinkedid':_0x33edfc['transfertargetlinkedid']});}writeDB(_0x33edfc);}catch(_0x473be0){utils[_0x5ea8('0x13')](util['format'](_0x5ea8('0x15'),_0x33edfc[_0x5ea8('0x8')]),_0x473be0);}}; \ No newline at end of file +var _0x6cba=['origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','attended','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','./utils','format','origtransfereruniqueid','uniqueid','type','request','blinds','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign'];(function(_0x3bc9c9,_0xcaf226){var _0x5414b1=function(_0x2c35a7){while(--_0x2c35a7){_0x3bc9c9['push'](_0x3bc9c9['shift']());}};_0x5414b1(++_0xcaf226);}(_0x6cba,0x14f));var _0xa6cb=function(_0xdc6dcf,_0x4e9d7a){_0xdc6dcf=_0xdc6dcf-0x0;var _0x7cc8da=_0x6cba[_0xdc6dcf];return _0x7cc8da;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xa6cb('0x0'));function writeDB(_0x546a96){utils['info'](util[_0xa6cb('0x1')]('[%s][transfers][writeDB]\x20type:%s',_0x546a96['type']==='attended'?_0x546a96[_0xa6cb('0x2')]:_0x546a96[_0xa6cb('0x3')],_0x546a96[_0xa6cb('0x4')]));utils[_0xa6cb('0x5')]('CreateVoiceTransferReport',_0x546a96);}exports[_0xa6cb('0x6')]={};exports['blindtransfer']=function(_0x56ea84){try{utils[_0xa6cb('0x7')](util['format'](_0xa6cb('0x8'),_0x56ea84['uniqueid']),_0x56ea84);utils[_0xa6cb('0x9')](util[_0xa6cb('0x1')](_0xa6cb('0xa'),_0x56ea84[_0xa6cb('0x3')],_0x56ea84[_0xa6cb('0xb')],_0x56ea84[_0xa6cb('0xc')],_0x56ea84[_0xa6cb('0xd')],_0x56ea84[_0xa6cb('0xe')]));_0x56ea84['type']='blind';exports[_0xa6cb('0x6')][_0x56ea84[_0xa6cb('0xf')]]=_0x56ea84;writeDB(_0x56ea84);}catch(_0x358286){utils[_0xa6cb('0x10')](util[_0xa6cb('0x1')]('[%s][transfers][blindtransfer]',_0x56ea84[_0xa6cb('0x3')]),_0x358286);}};exports[_0xa6cb('0x11')]=function(_0x51f889){try{utils[_0xa6cb('0x7')](util['format'](_0xa6cb('0x12'),_0x51f889[_0xa6cb('0x2')]),_0x51f889);utils[_0xa6cb('0x9')](util[_0xa6cb('0x1')](_0xa6cb('0x13'),_0x51f889[_0xa6cb('0x2')],_0x51f889[_0xa6cb('0x14')],_0x51f889[_0xa6cb('0x15')],_0x51f889[_0xa6cb('0x16')],_0x51f889[_0xa6cb('0x17')]));_0x51f889=_[_0xa6cb('0x18')](_0x51f889,{'transfererchannel':_0x51f889[_0xa6cb('0x19')],'transferercalleridnum':_0x51f889[_0xa6cb('0x14')],'transferercalleridname':_0x51f889[_0xa6cb('0x15')],'transfererconnectedlinenum':_0x51f889[_0xa6cb('0x1a')],'transfererconnectedlinename':_0x51f889[_0xa6cb('0x1b')],'transfereraccountcode':_0x51f889[_0xa6cb('0x1c')],'transferercontext':_0x51f889[_0xa6cb('0x1d')],'transfererexten':_0x51f889[_0xa6cb('0x1e')],'transfererlinkedid':_0x51f889[_0xa6cb('0x1f')],'context':_0x51f889['origtransferercontext'],'extension':_0x51f889[_0xa6cb('0x20')],'type':_0xa6cb('0x21')});if(_['isNil'](_0x51f889['transfereechannel'])){_0x51f889=_['assign'](_0x51f889,{'transfereechannel':_0x51f889['transfertargetchannel'],'transfereecalleridnum':_0x51f889[_0xa6cb('0x16')],'transfereecalleridname':_0x51f889[_0xa6cb('0x17')],'transfereeconnectedlinenum':_0x51f889[_0xa6cb('0x22')],'transfereeconnectedlinename':_0x51f889[_0xa6cb('0x23')],'transfereeaccountcode':_0x51f889[_0xa6cb('0x24')],'transfereecontext':_0x51f889[_0xa6cb('0x25')],'transfereeexten':_0x51f889[_0xa6cb('0x26')],'transfereelinkedid':_0x51f889[_0xa6cb('0x27')]});}writeDB(_0x51f889);}catch(_0x352162){utils[_0xa6cb('0x10')](util[_0xa6cb('0x1')](_0xa6cb('0x12'),_0x51f889[_0xa6cb('0x2')]),_0x352162);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 42eedae..e9daffb 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 _0x1f0e=['notfound','[utils][getUserByName]','getVoiceQueueByName','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','isAfter','isBefore','bluebird','moment','util','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','interface','stringify','result','getUserByInternal','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x1f0e,0xe7));var _0xe1f0=function(_0x4bb2af,_0x47935f){_0x4bb2af=_0x4bb2af-0x0;var _0x67b257=_0x1f0e[_0x4bb2af];return _0x67b257;};'use strict';var BPromise=require(_0xe1f0('0x0'));var jayson=require('jayson/promise');var moment=require(_0xe1f0('0x1'));var util=require(_0xe1f0('0x2'));var client=jayson[_0xe1f0('0x3')][_0xe1f0('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xe1f0('0x5'));exports[_0xe1f0('0x6')]=function(_0x5a853c,_0x4a3ffc){logger['info'](_0x5a853c,_0x4a3ffc?util[_0xe1f0('0x7')](_0x4a3ffc,{'showHidden':![],'depth':null}):'');};exports[_0xe1f0('0x8')]=function(_0x44b6fa,_0x313911){logger[_0xe1f0('0x8')](_0x44b6fa,_0x313911?util['inspect'](_0x313911,{'showHidden':![],'depth':null}):'');};exports[_0xe1f0('0x9')]=function(_0x19b440,_0x24726e){logger[_0xe1f0('0x9')](_0x19b440,_0x24726e?util[_0xe1f0('0x7')](_0x24726e,{'showHidden':![],'depth':null}):'');};exports[_0xe1f0('0xa')]=function(_0x131eba,_0x158c68){return client[_0xe1f0('0xa')](_0x131eba,{'body':_0x158c68})[_0xe1f0('0xb')](function(_0x4eee6){logger[_0xe1f0('0x8')](_0xe1f0('0xc'),_0x131eba,_0x4eee6?util[_0xe1f0('0x7')](_0x4eee6,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x52b423){logger[_0xe1f0('0x9')]('[utils][request]\x20name:%s',_0x131eba,_0x52b423?util[_0xe1f0('0x7')](_0x52b423,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4f9518){return client['request'](_0xe1f0('0xd'),{'options':{'raw':!![],'attributes':['id',_0xe1f0('0xe'),_0xe1f0('0xf'),_0xe1f0('0x10')],'where':_0x4f9518,'limit':0x1}})[_0xe1f0('0xb')](function(_0x575377){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0xe1f0('0x11')](_0x4f9518),_0x575377?util[_0xe1f0('0x7')](_0x575377,{'showHidden':![],'depth':null}):'');return _0x575377[_0xe1f0('0x12')]['length']?_0x575377[_0xe1f0('0x12')][0x0]:null;});}exports[_0xe1f0('0x13')]=function(_0x3c475f){return new BPromise(function(_0xf37786,_0x1fce05){if(_0x3c475f){return getUser({'internal':_0x3c475f})['then'](function(_0x12fb24){logger[_0xe1f0('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x3c475f,_0x12fb24?'found':'notfound');return _0xf37786(_0x12fb24);})[_0xe1f0('0x14')](function(_0xde495d){logger[_0xe1f0('0x9')](_0xe1f0('0x15'),_0xde495d?util[_0xe1f0('0x7')](_0xde495d,{'showHidden':![],'depth':null}):'');return _0xf37786(null);});}return _0xf37786(null);});};exports[_0xe1f0('0x16')]=function(_0xe9abf2){return new BPromise(function(_0x4367aa,_0x4cc41f){if(_0xe9abf2){return getUser({'interface':_0xe9abf2})[_0xe1f0('0xb')](function(_0x577c00){logger[_0xe1f0('0x6')](_0xe1f0('0x17'),_0xe9abf2,_0x577c00?_0xe1f0('0x18'):'notfound');return _0x4367aa(_0x577c00);})['catch'](function(_0xd8d7cf){logger['error'](_0xe1f0('0x19'),_0xd8d7cf?util[_0xe1f0('0x7')](_0xd8d7cf,{'showHidden':![],'depth':null}):'');return _0x4367aa(null);});}return _0x4367aa(null);});};exports['getUserByName']=function(_0x50d3c5){return new BPromise(function(_0x32b43b,_0x291a55){if(_0x50d3c5){return getUser({'name':_0x50d3c5})[_0xe1f0('0xb')](function(_0xc535c4){logger[_0xe1f0('0x6')](_0xe1f0('0x1a'),_0x50d3c5,_0xc535c4?_0xe1f0('0x18'):_0xe1f0('0x1b'));return _0x32b43b(_0xc535c4);})[_0xe1f0('0x14')](function(_0x3800f6){logger[_0xe1f0('0x9')](_0xe1f0('0x1c'),_0x3800f6?util[_0xe1f0('0x7')](_0x3800f6,{'showHidden':![],'depth':null}):'');return _0x32b43b(null);});}return _0x32b43b(null);});};exports[_0xe1f0('0x1d')]=function(_0x338168){return new BPromise(function(_0x2eb725,_0x542b67){if(_0x338168){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0xe1f0('0x1e'),'acw','acwTimeout'],'where':{'name':_0x338168},'limit':0x1}})['then'](function(_0xf6efd1){logger[_0xe1f0('0x8')](_0xe1f0('0x1f'),_0x338168,_0xf6efd1?util[_0xe1f0('0x7')](_0xf6efd1,{'showHidden':![],'depth':null}):'');logger[_0xe1f0('0x6')](_0xe1f0('0x20'),_0x338168,_0xf6efd1?_0xe1f0('0x18'):_0xe1f0('0x1b'));return _0x2eb725(_0xf6efd1[_0xe1f0('0x12')]['length']?_0xf6efd1[_0xe1f0('0x12')][0x0]:null);})[_0xe1f0('0x14')](function(_0x217fdb){logger[_0xe1f0('0x9')](_0xe1f0('0x21'),_0x217fdb?util['inspect'](_0x217fdb,{'showHidden':![],'depth':null}):'');return _0x2eb725(null);});}return _0x2eb725(null);});};exports['addTime']=function(_0x50f803,_0x24198d){return moment(_0x50f803)[_0xe1f0('0x22')](_0x24198d,_0xe1f0('0x23'))[_0xe1f0('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x7c4cb9,_0x397d32){return moment(_0x7c4cb9)['subtract'](_0x397d32,_0xe1f0('0x23'))[_0xe1f0('0x24')](_0xe1f0('0x25'));};exports[_0xe1f0('0x26')]=function(_0x184c85,_0x154ef2){return moment(_0x184c85)[_0xe1f0('0x27')](moment(_0x154ef2),'seconds');};exports[_0xe1f0('0x28')]=function(_0x583113,_0x11daa2){return parseInt(_0x583113,0xa)+parseInt(_0x11daa2,0xa);};exports['now']=function(){return moment()[_0xe1f0('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe1f0('0x29')]=function(_0x2afb9d,_0x3a20e3){if(_0x3a20e3){return moment(_0x2afb9d)[_0xe1f0('0x29')](_0x3a20e3);}return!![];};exports[_0xe1f0('0x2a')]=function(_0x3fbbe7,_0x2d7050){if(_0x2d7050){return moment(_0x3fbbe7)[_0xe1f0('0x2a')](_0x2d7050);}else if(_0x3fbbe7){return!![];}return![];}; \ No newline at end of file +var _0xbcf5=['[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','diff','sumTime','now','isBefore','bluebird','jayson/promise','moment','util','client','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','internal','interface','then','stringify','result','getUserByInternal','found','notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName'];(function(_0x4c5878,_0x2d0034){var _0x14c6a7=function(_0x3fd8c4){while(--_0x3fd8c4){_0x4c5878['push'](_0x4c5878['shift']());}};_0x14c6a7(++_0x2d0034);}(_0xbcf5,0x1c6));var _0x5bcf=function(_0x10158e,_0x30f48f){_0x10158e=_0x10158e-0x0;var _0x5db35a=_0xbcf5[_0x10158e];return _0x5db35a;};'use strict';var BPromise=require(_0x5bcf('0x0'));var jayson=require(_0x5bcf('0x1'));var moment=require(_0x5bcf('0x2'));var util=require(_0x5bcf('0x3'));var client=jayson[_0x5bcf('0x4')]['http']({'port':0x2329});var logger=require(_0x5bcf('0x5'))(_0x5bcf('0x6'));exports['info']=function(_0x41619b,_0x5ee176){logger[_0x5bcf('0x7')](_0x41619b,_0x5ee176?util[_0x5bcf('0x8')](_0x5ee176,{'showHidden':![],'depth':null}):'');};exports[_0x5bcf('0x9')]=function(_0x3025ac,_0x7583b){logger['debug'](_0x3025ac,_0x7583b?util[_0x5bcf('0x8')](_0x7583b,{'showHidden':![],'depth':null}):'');};exports[_0x5bcf('0xa')]=function(_0x246751,_0x4a8b89){logger[_0x5bcf('0xa')](_0x246751,_0x4a8b89?util[_0x5bcf('0x8')](_0x4a8b89,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x54f95a,_0x6cd6b1){return client[_0x5bcf('0xb')](_0x54f95a,{'body':_0x6cd6b1})['then'](function(_0x108429){logger[_0x5bcf('0x9')](_0x5bcf('0xc'),_0x54f95a,_0x108429?util[_0x5bcf('0x8')](_0x108429,{'showHidden':![],'depth':null}):'');})[_0x5bcf('0xd')](function(_0x5ea908){logger[_0x5bcf('0xa')](_0x5bcf('0xc'),_0x54f95a,_0x5ea908?util[_0x5bcf('0x8')](_0x5ea908,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3897af){return client[_0x5bcf('0xb')](_0x5bcf('0xe'),{'options':{'raw':!![],'attributes':['id',_0x5bcf('0xf'),'name',_0x5bcf('0x10')],'where':_0x3897af,'limit':0x1}})[_0x5bcf('0x11')](function(_0x37af15){logger[_0x5bcf('0x9')]('[utils][getUser]\x20where:%s',JSON[_0x5bcf('0x12')](_0x3897af),_0x37af15?util[_0x5bcf('0x8')](_0x37af15,{'showHidden':![],'depth':null}):'');return _0x37af15[_0x5bcf('0x13')]['length']?_0x37af15[_0x5bcf('0x13')][0x0]:null;});}exports[_0x5bcf('0x14')]=function(_0x3d7ef5){return new BPromise(function(_0x31b143,_0x10d938){if(_0x3d7ef5){return getUser({'internal':_0x3d7ef5})[_0x5bcf('0x11')](function(_0x19fbd9){logger[_0x5bcf('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x3d7ef5,_0x19fbd9?_0x5bcf('0x15'):_0x5bcf('0x16'));return _0x31b143(_0x19fbd9);})[_0x5bcf('0xd')](function(_0x268e17){logger[_0x5bcf('0xa')]('[utils][getUserByInternal]',_0x268e17?util['inspect'](_0x268e17,{'showHidden':![],'depth':null}):'');return _0x31b143(null);});}return _0x31b143(null);});};exports['getUserByInterface']=function(_0x3e4f5a){return new BPromise(function(_0x4f1886,_0x5b632d){if(_0x3e4f5a){return getUser({'interface':_0x3e4f5a})[_0x5bcf('0x11')](function(_0x27d6fb){logger[_0x5bcf('0x7')](_0x5bcf('0x17'),_0x3e4f5a,_0x27d6fb?_0x5bcf('0x15'):'notfound');return _0x4f1886(_0x27d6fb);})['catch'](function(_0x53ec0e){logger[_0x5bcf('0xa')](_0x5bcf('0x18'),_0x53ec0e?util[_0x5bcf('0x8')](_0x53ec0e,{'showHidden':![],'depth':null}):'');return _0x4f1886(null);});}return _0x4f1886(null);});};exports[_0x5bcf('0x19')]=function(_0x5d0ce4){return new BPromise(function(_0x1f0ac1,_0x4f591c){if(_0x5d0ce4){return getUser({'name':_0x5d0ce4})['then'](function(_0x472489){logger[_0x5bcf('0x7')](_0x5bcf('0x1a'),_0x5d0ce4,_0x472489?'found':_0x5bcf('0x16'));return _0x1f0ac1(_0x472489);})[_0x5bcf('0xd')](function(_0x1c5945){logger[_0x5bcf('0xa')](_0x5bcf('0x1b'),_0x1c5945?util[_0x5bcf('0x8')](_0x1c5945,{'showHidden':![],'depth':null}):'');return _0x1f0ac1(null);});}return _0x1f0ac1(null);});};exports[_0x5bcf('0x1c')]=function(_0x16da40){return new BPromise(function(_0x32d46e,_0x126275){if(_0x16da40){return client[_0x5bcf('0xb')](_0x5bcf('0x1d'),{'options':{'raw':!![],'attributes':['id','name',_0x5bcf('0x1e'),_0x5bcf('0x1f'),_0x5bcf('0x20')],'where':{'name':_0x16da40},'limit':0x1}})['then'](function(_0x3d24dc){logger['debug'](_0x5bcf('0x21'),_0x16da40,_0x3d24dc?util[_0x5bcf('0x8')](_0x3d24dc,{'showHidden':![],'depth':null}):'');logger[_0x5bcf('0x7')](_0x5bcf('0x22'),_0x16da40,_0x3d24dc?'found':_0x5bcf('0x16'));return _0x32d46e(_0x3d24dc[_0x5bcf('0x13')][_0x5bcf('0x23')]?_0x3d24dc[_0x5bcf('0x13')][0x0]:null);})[_0x5bcf('0xd')](function(_0x11ed63){logger[_0x5bcf('0xa')](_0x5bcf('0x24'),_0x11ed63?util[_0x5bcf('0x8')](_0x11ed63,{'showHidden':![],'depth':null}):'');return _0x32d46e(null);});}return _0x32d46e(null);});};exports[_0x5bcf('0x25')]=function(_0x28341d,_0x48d3a4){return moment(_0x28341d)[_0x5bcf('0x26')](_0x48d3a4,'seconds')[_0x5bcf('0x27')](_0x5bcf('0x28'));};exports[_0x5bcf('0x29')]=function(_0x173807,_0x4b3aca){return moment(_0x173807)['subtract'](_0x4b3aca,_0x5bcf('0x2a'))['format'](_0x5bcf('0x28'));};exports[_0x5bcf('0x2b')]=function(_0x30939e,_0xc8de38){return moment(_0x30939e)[_0x5bcf('0x2c')](moment(_0xc8de38),_0x5bcf('0x2a'));};exports[_0x5bcf('0x2d')]=function(_0x32b62e,_0x1da2e1){return parseInt(_0x32b62e,0xa)+parseInt(_0x1da2e1,0xa);};exports[_0x5bcf('0x2e')]=function(){return moment()[_0x5bcf('0x27')](_0x5bcf('0x28'));};exports['isAfter']=function(_0x1165e1,_0xecdd2a){if(_0xecdd2a){return moment(_0x1165e1)['isAfter'](_0xecdd2a);}return!![];};exports[_0x5bcf('0x2f')]=function(_0x3a6fa8,_0xe15ac6){if(_0xe15ac6){return moment(_0x3a6fa8)[_0x5bcf('0x2f')](_0xe15ac6);}else if(_0x3a6fa8){return!![];}return![];}; \ No newline at end of file